From: Andrea Bianco Date: Thu, 25 Nov 2021 23:28:46 +0000 (+0100) Subject: Built motion from commit 82bb2304.|2.5.39 X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.messaging?a=commitdiff_plain;h=ae263337477e8df9f846663f7f1890c2f44ff69f;p=motion2.git Built motion from commit 82bb2304.|2.5.39 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2334198..f713f46 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-22T22:49:29.449Z", + "time": "2021-11-25T23:22:09.766Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4dbb209..2decd9c 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-22T22:49:29.449Z", + "time": "2021-11-25T23:22:09.766Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index f024053..f738d41 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8d9=['STRING','contactManager','integration','motionbar','jscripty','bot','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xb8d9,0x175));var _0x9b8d=function(_0x7f6a19,_0x4e1ec7){_0x7f6a19=_0x7f6a19-0x0;var _0x3a995b=_0xb8d9[_0x7f6a19];return _0x3a995b;};'use strict';var Sequelize=require(_0x9b8d('0x0'));module[_0x9b8d('0x1')]={'name':{'type':Sequelize[_0x9b8d('0x2')],'get':function(_0x2e174c){return this[_0x9b8d('0x3')](_0x9b8d('0x4'));}},'action':{'type':Sequelize[_0x9b8d('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9b8d('0x6'),_0x9b8d('0x7'),_0x9b8d('0x8'),_0x9b8d('0x9'),'urlForward','browser',_0x9b8d('0xa'),_0x9b8d('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x9b8d('0x5')](0x1000),'comment':_0x9b8d('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9b8d('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x9b8d('0xe')},'data6':{'type':Sequelize[_0x9b8d('0x5')],'comments':_0x9b8d('0xf')},'data7':{'type':Sequelize[_0x9b8d('0x10')],'comments':_0x9b8d('0x11')}}; \ No newline at end of file +var _0xf901=['exports','action','contactManager','motionbar','jscripty','browser','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x3b929b,_0x12eb50){var _0x2592a9=function(_0x5254e7){while(--_0x5254e7){_0x3b929b['push'](_0x3b929b['shift']());}};_0x2592a9(++_0x12eb50);}(_0xf901,0xa4));var _0x1f90=function(_0x57a43f,_0x2bde86){_0x57a43f=_0x57a43f-0x0;var _0x4a51a2=_0xf901[_0x57a43f];return _0x4a51a2;};'use strict';var Sequelize=require(_0x1f90('0x0'));module[_0x1f90('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f5c51){return this['getDataValue'](_0x1f90('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x1f90('0x3'),'integration',_0x1f90('0x4'),_0x1f90('0x5'),'urlForward',_0x1f90('0x6'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comment':_0x1f90('0x8')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x1f90('0x9')},'data3':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comment':_0x1f90('0xa')},'data4':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x1f90('0xb')},'data6':{'type':Sequelize[_0x1f90('0x7')],'comments':_0x1f90('0xc')},'data7':{'type':Sequelize[_0x1f90('0xd')],'comments':_0x1f90('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 608a6e0..739ddad 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84a5=['set','Content-Range','apply','reject','save','update','then','destroy','stack','name','body','Action','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x84a5,0x16e));var _0x584a=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x84a5[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x584a('0x0'));var rimraf=require(_0x584a('0x1'));var zipdir=require(_0x584a('0x2'));var jsonpatch=require(_0x584a('0x3'));var rp=require('request-promise');var moment=require(_0x584a('0x4'));var BPromise=require(_0x584a('0x5'));var Mustache=require(_0x584a('0x6'));var util=require(_0x584a('0x7'));var path=require(_0x584a('0x8'));var sox=require(_0x584a('0x9'));var csv=require(_0x584a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x584a('0xb'));var _=require(_0x584a('0xc'));var squel=require(_0x584a('0xd'));var crypto=require(_0x584a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x584a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x584a('0x10'));var Papa=require(_0x584a('0x11'));var Redis=require(_0x584a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x584a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x584a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x584a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x584a('0x16'));var db=require(_0x584a('0x17'))['db'];function respondWithStatusCode(_0x2a8c95,_0x2bcbe5){_0x2bcbe5=_0x2bcbe5||0xcc;return function(_0x2ebbcc){if(_0x2ebbcc){return _0x2a8c95[_0x584a('0x18')](_0x2bcbe5);}return _0x2a8c95[_0x584a('0x19')](_0x2bcbe5)[_0x584a('0x1a')]();};}function respondWithResult(_0xd7fc0d,_0x190114){_0x190114=_0x190114||0xc8;return function(_0x405806){if(_0x405806){return _0xd7fc0d[_0x584a('0x19')](_0x190114)[_0x584a('0x1b')](_0x405806);}};}function respondWithFilteredResult(_0x309603,_0x385e21){return function(_0x43e071){if(_0x43e071){var _0x47ca43=typeof _0x385e21['offset']===_0x584a('0x1c')&&typeof _0x385e21['limit']===_0x584a('0x1c');var _0x146442=_0x43e071[_0x584a('0x1d')];var _0x127b57=_0x47ca43?0x0:_0x385e21['offset'];var _0x4df604=_0x47ca43?_0x43e071[_0x584a('0x1d')]:_0x385e21['offset']+_0x385e21['limit'];var _0x211f70;if(_0x4df604>=_0x146442){_0x4df604=_0x146442;_0x211f70=0xc8;}else{_0x211f70=0xce;}_0x309603['status'](_0x211f70);return _0x309603[_0x584a('0x1e')](_0x584a('0x1f'),_0x127b57+'-'+_0x4df604+'/'+_0x146442)[_0x584a('0x1b')](_0x43e071);}return null;};}function patchUpdates(_0x1e690b){return function(_0x2de9b9){try{jsonpatch[_0x584a('0x20')](_0x2de9b9,_0x1e690b,!![]);}catch(_0x930798){return BPromise[_0x584a('0x21')](_0x930798);}return _0x2de9b9[_0x584a('0x22')]();};}function saveUpdates(_0x28807d,_0x1b39dd){return function(_0x3c1feb){if(_0x3c1feb){return _0x3c1feb[_0x584a('0x23')](_0x28807d)[_0x584a('0x24')](function(_0x41a743){return _0x41a743;});}return null;};}function removeEntity(_0x474753,_0x4f17f1){return function(_0x1d2a8d){if(_0x1d2a8d){return _0x1d2a8d[_0x584a('0x25')]()[_0x584a('0x24')](function(){_0x474753[_0x584a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d0d45,_0x457d08){return function(_0xf301f5){if(!_0xf301f5){_0x3d0d45[_0x584a('0x18')](0x194);}return _0xf301f5;};}function handleError(_0x58e09e,_0x29e1c8){_0x29e1c8=_0x29e1c8||0x1f4;return function(_0xb7534b){logger['error'](_0xb7534b[_0x584a('0x26')]);if(_0xb7534b[_0x584a('0x27')]){delete _0xb7534b[_0x584a('0x27')];}_0x58e09e[_0x584a('0x19')](_0x29e1c8)['send'](_0xb7534b);};}exports['update']=function(_0x393ffe,_0x3e6eca){if(_0x393ffe[_0x584a('0x28')]['id']){delete _0x393ffe[_0x584a('0x28')]['id'];}return db[_0x584a('0x29')]['find']({'where':{'id':_0x393ffe[_0x584a('0x2a')]['id']}})[_0x584a('0x24')](handleEntityNotFound(_0x3e6eca,null))[_0x584a('0x24')](saveUpdates(_0x393ffe['body'],null))['then'](respondWithResult(_0x3e6eca,null))[_0x584a('0x2b')](handleError(_0x3e6eca,null));};exports[_0x584a('0x25')]=function(_0x31c620,_0x47cac0){return db[_0x584a('0x29')]['find']({'where':{'id':_0x31c620[_0x584a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x47cac0,null))[_0x584a('0x24')](removeEntity(_0x47cac0,null))[_0x584a('0x2b')](handleError(_0x47cac0,null));}; \ No newline at end of file +var _0x7722=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','update','destroy','then','end','name','send','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel'];(function(_0x27c9a8,_0x1fe732){var _0x6666e8=function(_0x4c09cf){while(--_0x4c09cf){_0x27c9a8['push'](_0x27c9a8['shift']());}};_0x6666e8(++_0x1fe732);}(_0x7722,0x1cf));var _0x2772=function(_0x4c5ec3,_0x2f88ed){_0x4c5ec3=_0x4c5ec3-0x0;var _0x53d432=_0x7722[_0x4c5ec3];return _0x53d432;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2772('0x0'));var zipdir=require(_0x2772('0x1'));var jsonpatch=require(_0x2772('0x2'));var rp=require(_0x2772('0x3'));var moment=require(_0x2772('0x4'));var BPromise=require(_0x2772('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2772('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2772('0x7'));var _=require(_0x2772('0x8'));var squel=require(_0x2772('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2772('0xa'));var toCsv=require(_0x2772('0xb'));var querystring=require(_0x2772('0xc'));var Papa=require(_0x2772('0xd'));var Redis=require(_0x2772('0xe'));var authService=require(_0x2772('0xf'));var qs=require(_0x2772('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2772('0x11'));var logger=require(_0x2772('0x12'))(_0x2772('0x13'));var utils=require(_0x2772('0x14'));var config=require(_0x2772('0x15'));var licenseUtil=require(_0x2772('0x16'));var db=require(_0x2772('0x17'))['db'];function respondWithStatusCode(_0x53479e,_0x23bc93){_0x23bc93=_0x23bc93||0xcc;return function(_0x491eb2){if(_0x491eb2){return _0x53479e[_0x2772('0x18')](_0x23bc93);}return _0x53479e['status'](_0x23bc93)['end']();};}function respondWithResult(_0x4b6c37,_0x2da38a){_0x2da38a=_0x2da38a||0xc8;return function(_0x29a4c8){if(_0x29a4c8){return _0x4b6c37[_0x2772('0x19')](_0x2da38a)[_0x2772('0x1a')](_0x29a4c8);}};}function respondWithFilteredResult(_0x52718d,_0xaed3cf){return function(_0x3a3e8b){if(_0x3a3e8b){var _0x48d72e=typeof _0xaed3cf['offset']==='undefined'&&typeof _0xaed3cf[_0x2772('0x1b')]===_0x2772('0x1c');var _0x2e59ad=_0x3a3e8b[_0x2772('0x1d')];var _0x39b455=_0x48d72e?0x0:_0xaed3cf[_0x2772('0x1e')];var _0xc1f23b=_0x48d72e?_0x3a3e8b[_0x2772('0x1d')]:_0xaed3cf[_0x2772('0x1e')]+_0xaed3cf['limit'];var _0x331faf;if(_0xc1f23b>=_0x2e59ad){_0xc1f23b=_0x2e59ad;_0x331faf=0xc8;}else{_0x331faf=0xce;}_0x52718d[_0x2772('0x19')](_0x331faf);return _0x52718d['set'](_0x2772('0x1f'),_0x39b455+'-'+_0xc1f23b+'/'+_0x2e59ad)[_0x2772('0x1a')](_0x3a3e8b);}return null;};}function patchUpdates(_0x47b115){return function(_0x503b3a){try{jsonpatch['apply'](_0x503b3a,_0x47b115,!![]);}catch(_0x51eafa){return BPromise[_0x2772('0x20')](_0x51eafa);}return _0x503b3a['save']();};}function saveUpdates(_0x54fca4,_0x5c16fb){return function(_0x296e8e){if(_0x296e8e){return _0x296e8e[_0x2772('0x21')](_0x54fca4)['then'](function(_0x394af8){return _0x394af8;});}return null;};}function removeEntity(_0x359d2f,_0x571512){return function(_0x52f41d){if(_0x52f41d){return _0x52f41d[_0x2772('0x22')]()[_0x2772('0x23')](function(){_0x359d2f[_0x2772('0x19')](0xcc)[_0x2772('0x24')]();});}};}function handleEntityNotFound(_0xa88ae7,_0xca3c99){return function(_0x229a71){if(!_0x229a71){_0xa88ae7[_0x2772('0x18')](0x194);}return _0x229a71;};}function handleError(_0x51982,_0x47b7af){_0x47b7af=_0x47b7af||0x1f4;return function(_0x1e78e7){logger['error'](_0x1e78e7['stack']);if(_0x1e78e7[_0x2772('0x25')]){delete _0x1e78e7['name'];}_0x51982[_0x2772('0x19')](_0x47b7af)[_0x2772('0x26')](_0x1e78e7);};}exports['update']=function(_0x320146,_0x57f6fb){if(_0x320146['body']['id']){delete _0x320146['body']['id'];}return db[_0x2772('0x27')][_0x2772('0x28')]({'where':{'id':_0x320146[_0x2772('0x29')]['id']}})[_0x2772('0x23')](handleEntityNotFound(_0x57f6fb,null))[_0x2772('0x23')](saveUpdates(_0x320146['body'],null))[_0x2772('0x23')](respondWithResult(_0x57f6fb,null))[_0x2772('0x2a')](handleError(_0x57f6fb,null));};exports[_0x2772('0x22')]=function(_0x1e5425,_0x3a817d){return db[_0x2772('0x27')][_0x2772('0x28')]({'where':{'id':_0x1e5425[_0x2772('0x29')]['id']}})[_0x2772('0x23')](handleEntityNotFound(_0x3a817d,null))[_0x2772('0x23')](removeEntity(_0x3a817d,null))[_0x2772('0x2a')](handleError(_0x3a817d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index df55594..6aa2052 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3be=['request-promise','rimraf','../../config/environment','./action.attributes','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xd3be,0x195));var _0xed3b=function(_0x38fb45,_0x2e9de8){_0x38fb45=_0x38fb45-0x0;var _0x14b7de=_0xd3be[_0x38fb45];return _0x14b7de;};'use strict';var _=require('lodash');var util=require(_0xed3b('0x0'));var logger=require(_0xed3b('0x1'))(_0xed3b('0x2'));var moment=require(_0xed3b('0x3'));var BPromise=require(_0xed3b('0x4'));var rp=require(_0xed3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed3b('0x6'));var config=require(_0xed3b('0x7'));var attributes=require(_0xed3b('0x8'));module['exports']=function(_0x511353,_0x4fcdc5){return _0x511353['define']('Action',attributes,{'tableName':_0xed3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10aa=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0xcfdcc,_0x530128){var _0x2bd084=function(_0x244591){while(--_0x244591){_0xcfdcc['push'](_0xcfdcc['shift']());}};_0x2bd084(++_0x530128);}(_0x10aa,0x14b));var _0xa10a=function(_0x4c672a,_0x560653){_0x4c672a=_0x4c672a-0x0;var _0x2c8ad7=_0x10aa[_0x4c672a];return _0x2c8ad7;};'use strict';var _=require(_0xa10a('0x0'));var util=require(_0xa10a('0x1'));var logger=require(_0xa10a('0x2'))(_0xa10a('0x3'));var moment=require(_0xa10a('0x4'));var BPromise=require(_0xa10a('0x5'));var rp=require(_0xa10a('0x6'));var fs=require('fs');var path=require(_0xa10a('0x7'));var rimraf=require(_0xa10a('0x8'));var config=require(_0xa10a('0x9'));var attributes=require(_0xa10a('0xa'));module[_0xa10a('0xb')]=function(_0x147a35,_0xe3e13a){return _0x147a35[_0xa10a('0xc')](_0xa10a('0xd'),attributes,{'tableName':_0xa10a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index d9cef5d..2cebb8c 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x37d8d8,_0x36fe2a){var _0x53b10a=function(_0x49b197){while(--_0x49b197){_0x37d8d8['push'](_0x37d8d8['shift']());}};_0x53b10a(++_0x36fe2a);}(_0xabce,0x103));var _0xeabc=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xabce[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d85a942..f8fcb4e 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff69=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xff69,0x16c));var _0x9ff6=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xff69[_0x19b84f];return _0x18067b;};'use strict';var multer=require('multer');var util=require(_0x9ff6('0x0'));var path=require(_0x9ff6('0x1'));var timeout=require(_0x9ff6('0x2'));var express=require('express');var router=express[_0x9ff6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ff6('0x4'));var interaction=require(_0x9ff6('0x5'));var config=require(_0x9ff6('0x6'));var controller=require('./action.controller');router[_0x9ff6('0x7')](_0x9ff6('0x8'),auth[_0x9ff6('0x9')](),controller[_0x9ff6('0xa')]);router[_0x9ff6('0xb')]('/:id',auth[_0x9ff6('0x9')](),controller[_0x9ff6('0xc')]);module[_0x9ff6('0xd')]=router; \ No newline at end of file +var _0xd3df=['Router','fs-extra','../../components/interaction/service','./action.controller','put','isAuthenticated','/:id','destroy','exports','multer','path'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xd3df,0x1ed));var _0xfd3d=function(_0xc5a490,_0x217ba9){_0xc5a490=_0xc5a490-0x0;var _0x20e3e5=_0xd3df[_0xc5a490];return _0x20e3e5;};'use strict';var multer=require(_0xfd3d('0x0'));var util=require('util');var path=require(_0xfd3d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfd3d('0x2')]();var fs_extra=require(_0xfd3d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd3d('0x4'));var config=require('../../config/environment');var controller=require(_0xfd3d('0x5'));router[_0xfd3d('0x6')]('/:id',auth[_0xfd3d('0x7')](),controller['update']);router['delete'](_0xfd3d('0x8'),auth['isAuthenticated'](),controller[_0xfd3d('0x9')]);module[_0xfd3d('0xa')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 22d5872..845e3ab 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8958=['TEXT','exports'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x8958,0x93));var _0x8895=function(_0x38b0a1,_0x29da11){_0x38b0a1=_0x38b0a1-0x0;var _0x27d217=_0x8958[_0x38b0a1];return _0x27d217;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xbd51=['sequelize','STRING'];(function(_0xda6d0f,_0x35e271){var _0x244540=function(_0x30f643){while(--_0x30f643){_0xda6d0f['push'](_0xda6d0f['shift']());}};_0x244540(++_0x35e271);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4b3358,_0x526165){_0x4b3358=_0x4b3358-0x0;var _0x4be311=_0xbd51[_0x4b3358];return _0x4be311;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f600a85..b9ba1ac 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc1f=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','params','preview','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','field','replace','format','groupBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','function','orderBy','web','fullPath','%s-%s.%s','randomstring','generate','output','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','savename','countTable','COUNT(*)','SELECT','run','runReport','HOUR(%s)','IS\x20EMPTY','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','error','stack','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x530c53,_0x546020){var _0x5408ca=function(_0x1de646){while(--_0x1de646){_0x530c53['push'](_0x530c53['shift']());}};_0x5408ca(++_0x546020);}(_0xcc1f,0x1b8));var _0xfcc1=function(_0x40aa42,_0x1e6c0c){_0x40aa42=_0x40aa42-0x0;var _0x5391e4=_0xcc1f[_0x40aa42];return _0x5391e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcc1('0x0'));var zipdir=require(_0xfcc1('0x1'));var jsonpatch=require(_0xfcc1('0x2'));var rp=require('request-promise');var moment=require(_0xfcc1('0x3'));var BPromise=require(_0xfcc1('0x4'));var Mustache=require('mustache');var util=require(_0xfcc1('0x5'));var path=require(_0xfcc1('0x6'));var sox=require(_0xfcc1('0x7'));var csv=require(_0xfcc1('0x8'));var ejs=require(_0xfcc1('0x9'));var fs=require('fs');var fs_extra=require(_0xfcc1('0xa'));var _=require(_0xfcc1('0xb'));var squel=require(_0xfcc1('0xc'));var crypto=require(_0xfcc1('0xd'));var jsforce=require(_0xfcc1('0xe'));var deskjs=require(_0xfcc1('0xf'));var toCsv=require(_0xfcc1('0x8'));var querystring=require(_0xfcc1('0x10'));var Papa=require(_0xfcc1('0x11'));var Redis=require(_0xfcc1('0x12'));var authService=require(_0xfcc1('0x13'));var qs=require(_0xfcc1('0x14'));var as=require(_0xfcc1('0x15'));var hardwareService=require(_0xfcc1('0x16'));var logger=require(_0xfcc1('0x17'))(_0xfcc1('0x18'));var utils=require(_0xfcc1('0x19'));var config=require(_0xfcc1('0x1a'));var licenseUtil=require(_0xfcc1('0x1b'));var db=require('../../mysqldb')['db'];var dbH=require(_0xfcc1('0x1c'))[_0xfcc1('0x1d')];function respondWithStatusCode(_0x15bc45,_0x3b2c2b){_0x3b2c2b=_0x3b2c2b||0xcc;return function(_0x18b3fe){if(_0x18b3fe){return _0x15bc45[_0xfcc1('0x1e')](_0x3b2c2b);}return _0x15bc45[_0xfcc1('0x1f')](_0x3b2c2b)[_0xfcc1('0x20')]();};}function respondWithResult(_0x131024,_0x29aac9){_0x29aac9=_0x29aac9||0xc8;return function(_0x52698c){if(_0x52698c){return _0x131024[_0xfcc1('0x1f')](_0x29aac9)[_0xfcc1('0x21')](_0x52698c);}};}function respondWithFilteredResult(_0x10eb6d,_0x3d0410){return function(_0x686c0e){if(_0x686c0e){var _0xcba70=typeof _0x3d0410[_0xfcc1('0x22')]===_0xfcc1('0x23')&&typeof _0x3d0410[_0xfcc1('0x24')]===_0xfcc1('0x23');var _0x3730ff=_0x686c0e[_0xfcc1('0x25')];var _0x4f1cad=_0xcba70?0x0:_0x3d0410[_0xfcc1('0x22')];var _0x31fdf7=_0xcba70?_0x686c0e['count']:_0x3d0410[_0xfcc1('0x22')]+_0x3d0410['limit'];var _0x5e6326;if(_0x31fdf7>=_0x3730ff){_0x31fdf7=_0x3730ff;_0x5e6326=0xc8;}else{_0x5e6326=0xce;}_0x10eb6d[_0xfcc1('0x1f')](_0x5e6326);return _0x10eb6d['set'](_0xfcc1('0x26'),_0x4f1cad+'-'+_0x31fdf7+'/'+_0x3730ff)['json'](_0x686c0e);}return null;};}function patchUpdates(_0x5209c5){return function(_0x127538){try{jsonpatch[_0xfcc1('0x27')](_0x127538,_0x5209c5,!![]);}catch(_0x4b01cb){return BPromise[_0xfcc1('0x28')](_0x4b01cb);}return _0x127538[_0xfcc1('0x29')]();};}function saveUpdates(_0x378139,_0x3e88f1){return function(_0x259e9d){if(_0x259e9d){return _0x259e9d['update'](_0x378139)[_0xfcc1('0x2a')](function(_0x55e433){return _0x55e433;});}return null;};}function removeEntity(_0x24344f,_0x11c925){return function(_0x1d89ae){if(_0x1d89ae){return _0x1d89ae['destroy']()[_0xfcc1('0x2a')](function(){var _0x54a7f0=_0x1d89ae[_0xfcc1('0x2b')]({'plain':!![]});var _0x5f0aaa=_0xfcc1('0x2c');return db[_0xfcc1('0x2d')]['destroy']({'where':{'type':_0x5f0aaa,'resourceId':_0x54a7f0['id']}})['then'](function(){return _0x1d89ae;});})['then'](function(){_0x24344f[_0xfcc1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x394941,_0x940a7b){return function(_0x44360a){if(!_0x44360a){_0x394941[_0xfcc1('0x1e')](0x194);}return _0x44360a;};}function handleError(_0x2c4375,_0x5ab54e){_0x5ab54e=_0x5ab54e||0x1f4;return function(_0x15b2df){logger[_0xfcc1('0x2e')](_0x15b2df[_0xfcc1('0x2f')]);if(_0x15b2df['name']){delete _0x15b2df['name'];}_0x2c4375['status'](_0x5ab54e)['send'](_0x15b2df);};}exports['index']=function(_0x491aa7,_0x3e83af){var _0x40a3fb={},_0x3096ea={},_0x55fca1={'count':0x0,'rows':[]};var _0x4cc34c=_[_0xfcc1('0x30')](db[_0xfcc1('0x31')][_0xfcc1('0x32')],function(_0x5874ae){return{'name':_0x5874ae[_0xfcc1('0x33')],'type':_0x5874ae['type'][_0xfcc1('0x34')]};});_0x3096ea[_0xfcc1('0x35')]=_[_0xfcc1('0x30')](_0x4cc34c,_0xfcc1('0x36'));_0x3096ea[_0xfcc1('0x37')]=_[_0xfcc1('0x38')](_0x491aa7[_0xfcc1('0x37')]);_0x3096ea[_0xfcc1('0x39')]=_[_0xfcc1('0x3a')](_0x3096ea[_0xfcc1('0x35')],_0x3096ea[_0xfcc1('0x37')]);_0x40a3fb[_0xfcc1('0x3b')]=_[_0xfcc1('0x3a')](_0x3096ea[_0xfcc1('0x35')],qs[_0xfcc1('0x3c')](_0x491aa7[_0xfcc1('0x37')]['fields']));_0x40a3fb['attributes']=_0x40a3fb[_0xfcc1('0x3b')][_0xfcc1('0x3d')]?_0x40a3fb[_0xfcc1('0x3b')]:_0x3096ea['model'];if(!_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x3e')](_0xfcc1('0x3f'))){_0x40a3fb[_0xfcc1('0x24')]=qs[_0xfcc1('0x24')](_0x491aa7['query'][_0xfcc1('0x24')]);_0x40a3fb[_0xfcc1('0x22')]=qs[_0xfcc1('0x22')](_0x491aa7['query']['offset']);}_0x40a3fb[_0xfcc1('0x40')]=qs[_0xfcc1('0x41')](_0x491aa7['query'][_0xfcc1('0x41')]);_0x40a3fb[_0xfcc1('0x42')]=qs['filters'](_['pick'](_0x491aa7[_0xfcc1('0x37')],_0x3096ea['filters']),_0x4cc34c);if(_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x43')]){_0x40a3fb[_0xfcc1('0x42')]=_[_0xfcc1('0x44')](_0x40a3fb[_0xfcc1('0x42')],{'$or':_[_0xfcc1('0x30')](_0x4cc34c,function(_0x383490){if(_0x383490[_0xfcc1('0x45')]!==_0xfcc1('0x46')){var _0x408b1d={};_0x408b1d[_0x383490[_0xfcc1('0x36')]]={'$like':'%'+_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x43')]+'%'};return _0x408b1d;}})});}_0x40a3fb=_[_0xfcc1('0x44')]({},_0x40a3fb,_0x491aa7[_0xfcc1('0x47')]);var _0x4ec3ce={'where':_0x40a3fb[_0xfcc1('0x42')]};return db[_0xfcc1('0x31')]['count'](_0x4ec3ce)[_0xfcc1('0x2a')](function(_0x51ea33){_0x55fca1['count']=_0x51ea33;if(_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x48')]){_0x40a3fb[_0xfcc1('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xfcc1('0x4a')](_0x40a3fb);})[_0xfcc1('0x2a')](function(_0x3c31ff){_0x55fca1[_0xfcc1('0x4b')]=_0x3c31ff;return _0x55fca1;})[_0xfcc1('0x2a')](respondWithFilteredResult(_0x3e83af,_0x40a3fb))[_0xfcc1('0x4c')](handleError(_0x3e83af,null));};exports[_0xfcc1('0x4d')]=function(_0x18fe03,_0x4da709){var _0x11524d={'raw':![],'where':{'id':_0x18fe03['params']['id']}},_0xffa833={};_0xffa833[_0xfcc1('0x35')]=_['keys'](db[_0xfcc1('0x31')]['rawAttributes']);_0xffa833[_0xfcc1('0x37')]=_['keys'](_0x18fe03['query']);_0xffa833['filters']=_[_0xfcc1('0x3a')](_0xffa833[_0xfcc1('0x35')],_0xffa833[_0xfcc1('0x37')]);_0x11524d[_0xfcc1('0x3b')]=_[_0xfcc1('0x3a')](_0xffa833[_0xfcc1('0x35')],qs[_0xfcc1('0x3c')](_0x18fe03[_0xfcc1('0x37')][_0xfcc1('0x3c')]));_0x11524d['attributes']=_0x11524d[_0xfcc1('0x3b')][_0xfcc1('0x3d')]?_0x11524d[_0xfcc1('0x3b')]:_0xffa833[_0xfcc1('0x35')];if(_0x18fe03[_0xfcc1('0x37')]['includeAll']){_0x11524d[_0xfcc1('0x49')]=[{'all':!![]}];}_0x11524d=_[_0xfcc1('0x44')]({},_0x11524d,_0x18fe03[_0xfcc1('0x47')]);return db[_0xfcc1('0x31')][_0xfcc1('0x4e')](_0x11524d)['then'](handleEntityNotFound(_0x4da709,null))[_0xfcc1('0x2a')](respondWithResult(_0x4da709,null))['catch'](handleError(_0x4da709,null));};exports[_0xfcc1('0x4f')]=function(_0x2ab082,_0x281e7b){return db['AnalyticCustomReport'][_0xfcc1('0x4f')](_0x2ab082[_0xfcc1('0x50')],{})[_0xfcc1('0x2a')](function(_0x283001){var _0x84b826=_0x2ab082[_0xfcc1('0x51')]['get']({'plain':!![]});if(!_0x84b826)throw new Error(_0xfcc1('0x52'));if(_0x84b826[_0xfcc1('0x53')]===_0xfcc1('0x51')){var _0x2fcd30=_0x283001[_0xfcc1('0x2b')]({'plain':!![]});var _0x4c654d=_0xfcc1('0x54');return db[_0xfcc1('0x55')][_0xfcc1('0x4e')]({'where':{'name':_0x4c654d,'userProfileId':_0x84b826[_0xfcc1('0x56')]},'raw':!![]})[_0xfcc1('0x2a')](function(_0x14684a){if(_0x14684a&&_0x14684a[_0xfcc1('0x57')]===0x0){return db[_0xfcc1('0x2d')][_0xfcc1('0x4f')]({'name':_0x2fcd30[_0xfcc1('0x36')],'resourceId':_0x2fcd30['id'],'type':'CustomReports','sectionId':_0x14684a['id']},{})[_0xfcc1('0x2a')](function(){return _0x283001;});}else{return _0x283001;}})[_0xfcc1('0x4c')](function(_0x371d4e){logger[_0xfcc1('0x2e')](_0xfcc1('0x58'),_0x371d4e);throw _0x371d4e;});}return _0x283001;})[_0xfcc1('0x2a')](respondWithResult(_0x281e7b,0xc9))[_0xfcc1('0x4c')](handleError(_0x281e7b,null));};exports[_0xfcc1('0x59')]=function(_0x344754,_0x4f647a){if(_0x344754[_0xfcc1('0x50')]['id']){delete _0x344754['body']['id'];}return db['AnalyticCustomReport'][_0xfcc1('0x4e')]({'where':{'id':_0x344754['params']['id']}})['then'](handleEntityNotFound(_0x4f647a,null))['then'](saveUpdates(_0x344754[_0xfcc1('0x50')],null))[_0xfcc1('0x2a')](respondWithResult(_0x4f647a,null))[_0xfcc1('0x4c')](handleError(_0x4f647a,null));};exports[_0xfcc1('0x5a')]=function(_0x2319d9,_0x1c905a){return db[_0xfcc1('0x31')][_0xfcc1('0x4e')]({'where':{'id':_0x2319d9[_0xfcc1('0x5b')]['id']}})[_0xfcc1('0x2a')](handleEntityNotFound(_0x1c905a,null))[_0xfcc1('0x2a')](removeEntity(_0x1c905a,null))[_0xfcc1('0x4c')](handleError(_0x1c905a,null));};exports[_0xfcc1('0x5c')]=function(_0x4ad1e4,_0x29680a){var _0x49696=0xa;var _0x21739c=['join',_0xfcc1('0x5d'),_0xfcc1('0x5e'),'cross_join'];var _0x58785d={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':_0xfcc1('0x62'),'AVG':_0xfcc1('0x63'),'GROUP_CONCAT':_0xfcc1('0x64'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfcc1('0x65')};var _0x4f5d77={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5b418a=function(_0x5d5470){return!_[_0xfcc1('0x69')]([_0xfcc1('0x6a'),_0xfcc1('0x6b'),'IS\x20EMPTY',_0xfcc1('0x6c')],_0x5d5470);};var _0x179362=function(_0x3a6419){if(!_0x3a6419||!_0x3a6419[_0xfcc1('0x6d')][_0xfcc1('0x3d')]){return'';}for(var _0x4237a0='(',_0x368ad1=0x0;_0x368ad1<_0x3a6419[_0xfcc1('0x6d')][_0xfcc1('0x3d')];_0x368ad1+=0x1){_0x368ad1>0x0&&(_0x4237a0+='\x20'+_0x3a6419[_0xfcc1('0x6e')]+'\x20');_0x4237a0+=_0x3a6419['rules'][_0x368ad1][_0xfcc1('0x6f')]?_0x179362(_0x3a6419[_0xfcc1('0x6d')][_0x368ad1][_0xfcc1('0x6f')]):_0x3a6419[_0xfcc1('0x6d')][_0x368ad1]['field']+'\x20'+_0x3a6419[_0xfcc1('0x6d')][_0x368ad1]['condition']+(_0x5b418a(_0x3a6419['rules'][_0x368ad1][_0xfcc1('0x70')])?'\x20'+_0x3a6419[_0xfcc1('0x6d')][_0x368ad1][_0xfcc1('0x71')]:'');}return _0x4237a0+')';};var _0x42b7e9={'where':{'id':_0x4ad1e4[_0xfcc1('0x5b')]['id']}},_0x15f714,_0x40a4e2,_0x40f66c,_0xdc8413,_0x24528b;_0x42b7e9=_['merge']({},_0x42b7e9,_0x4ad1e4[_0xfcc1('0x47')]);return db[_0xfcc1('0x31')]['find'](_0x42b7e9)[_0xfcc1('0x2a')](function(_0x32bb66){if(_0x32bb66){_0x15f714=_0x32bb66;return _0x32bb66['getFields']();}return null;})[_0xfcc1('0x2a')](function(_0x441032){if(_0x441032){if(!_0x441032[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))](_0xfcc1('0x74'),0x193);}_0x40a4e2=_0x441032;return db[_0xfcc1('0x75')]['findAll']({'raw':!![]});}return null;})[_0xfcc1('0x2a')](function(_0x1c1675){if(_0x1c1675){_0x40f66c=_['keyBy'](_0x1c1675,'id');var _0x1e4927;var _0x1b937a=squel[_0xfcc1('0x76')]();_0x1b937a[_0xfcc1('0x77')](_0x15f714[_0xfcc1('0x78')]);for(var _0xee713e=0x0;_0xee713e<_0x40a4e2[_0xfcc1('0x3d')];_0xee713e+=0x1){_0x1e4927=_0x40a4e2[_0xee713e][_0xfcc1('0x79')]?_0x40f66c[_0x40a4e2[_0xee713e]['MetricId']][_0xfcc1('0x7a')]:_0x40a4e2[_0xee713e][_0xfcc1('0x7b')];_0x1e4927=_0x40a4e2[_0xee713e]['function']?_[_0xfcc1('0x7c')](_0x58785d[_0x40a4e2[_0xee713e]['function']],'%s',_0x1e4927):_0x1e4927;_0x1e4927=_0x40a4e2[_0xee713e][_0xfcc1('0x7d')]?_[_0xfcc1('0x7c')](_0x4f5d77[_0x40a4e2[_0xee713e][_0xfcc1('0x7d')]],'%s',_0x1e4927):_0x1e4927;if(_0x40a4e2[_0xee713e][_0xfcc1('0x7e')]){_0x1b937a[_0xfcc1('0x6f')](_0x1e4927);}_0x40a4e2[_0xee713e]['orderBy']&&_0x1b937a['order'](_0x1e4927,_0x40a4e2[_0xee713e]['orderBy']===_0xfcc1('0x7f')?![]:!![]);_0x1b937a[_0xfcc1('0x7b')](_0x1e4927,_0x40a4e2[_0xee713e]['alias']||_0x1e4927);}if(_0x15f714[_0xfcc1('0x80')]){_0x15f714[_0xfcc1('0x80')]=JSON[_0xfcc1('0x81')](_0x15f714[_0xfcc1('0x80')]);for(var _0x4b4674=0x0;_0x4b4674<_0x15f714['joins'][_0xfcc1('0x3d')];_0x4b4674+=0x1){if(_0x15f714['joins'][_0x4b4674][_0xfcc1('0x45')]&&_[_0xfcc1('0x69')](_0x21739c,_0x15f714[_0xfcc1('0x80')][_0x4b4674]['type'])&&_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x82')]&&_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x83')]&&_0x15f714[_0xfcc1('0x80')][_0x4b4674]['foreignKey']){_0x1b937a[_0x15f714[_0xfcc1('0x80')][_0x4b4674]['type']](_0x15f714['joins'][_0x4b4674][_0xfcc1('0x83')],null,util['format'](_0xfcc1('0x84'),_0x15f714[_0xfcc1('0x78')],_0x15f714[_0xfcc1('0x80')][_0x4b4674]['parentKey'],_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x83')],_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x85')]));}}}if(_0x15f714[_0xfcc1('0x86')]){_0x15f714['conditions']=JSON[_0xfcc1('0x81')](_0x15f714['conditions']);_0x1b937a[_0xfcc1('0x42')](_0x179362(_0x15f714['conditions']['group']));}_0x24528b=_0x1b937a[_0xfcc1('0x87')]();_0x1b937a[_0xfcc1('0x24')](_0x49696);_0x1b937a['offset'](0x0);logger[_0xfcc1('0x88')](_0xfcc1('0x89'),_0x1b937a[_0xfcc1('0x8a')]());return dbH['sequelize'][_0xfcc1('0x37')](_0x1b937a[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')][_0xfcc1('0x8c')]['SELECT']});}})[_0xfcc1('0x2a')](respondWithResult(_0x29680a,null))[_0xfcc1('0x4c')](handleError(_0x29680a,null));};function runReport(_0x3dc63f,_0x3e40fc,_0x31ba6c){var _0x3e0fd3=_0x3e40fc[_0xfcc1('0x36')];var _0x3eeb67=0xa;var _0xbd2ee3=[_0xfcc1('0x8d'),_0xfcc1('0x5d'),_0xfcc1('0x5e'),_0xfcc1('0x8e')];var _0x4bceeb={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':_0xfcc1('0x62'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfcc1('0x8f'),'GROUP_CONCAT DESC':_0xfcc1('0x65')};var _0x2aafe3={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':_0xfcc1('0x90')};var _0x5e3616=function(_0xe1f176){return!_[_0xfcc1('0x69')]([_0xfcc1('0x6a'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xe1f176);};var _0x5197aa=function(_0x15b70b){if(!_0x15b70b||!_0x15b70b[_0xfcc1('0x6d')][_0xfcc1('0x3d')]){return'';}for(var _0x407304='(',_0x31c5da=0x0;_0x31c5da<_0x15b70b['rules']['length'];_0x31c5da+=0x1){_0x31c5da>0x0&&(_0x407304+='\x20'+_0x15b70b[_0xfcc1('0x6e')]+'\x20');_0x407304+=_0x15b70b[_0xfcc1('0x6d')][_0x31c5da]['group']?_0x5197aa(_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x6f')]):_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x7b')]+'\x20'+_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x70')]+(_0x5e3616(_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x70')])?'\x20'+_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x71')]:'');}return _0x407304+')';};var _0x237ee1={'where':{'id':_0x3dc63f['id']}},_0x4cba87,_0x3f79ca,_0x4321dd,_0x1e54d8,_0x29aa1a;_0x237ee1=_[_0xfcc1('0x44')]({},_0x237ee1,_0x31ba6c);return db['AnalyticCustomReport'][_0xfcc1('0x4e')](_0x237ee1)['then'](function(_0x162042){if(_0x162042){_0x4cba87=_0x162042;return _0x162042['getFields']();}return null;})['then'](function(_0x4b556a){if(_0x4b556a){if(!_0x4b556a[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f79ca=_0x4b556a;return db[_0xfcc1('0x75')][_0xfcc1('0x4a')]({'raw':!![]});}return null;})[_0xfcc1('0x2a')](function(_0x101741){if(_0x101741){_0x4321dd=_['keyBy'](_0x101741,'id');var _0x52244f;var _0x3c263e=squel[_0xfcc1('0x76')]();_0x3c263e[_0xfcc1('0x77')](_0x4cba87[_0xfcc1('0x78')]);for(var _0x12d744=0x0;_0x12d744<_0x3f79ca[_0xfcc1('0x3d')];_0x12d744+=0x1){_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x79')]?_0x4321dd[_0x3f79ca[_0x12d744][_0xfcc1('0x79')]][_0xfcc1('0x7a')]:_0x3f79ca[_0x12d744][_0xfcc1('0x7b')];_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x91')]?_['replace'](_0x4bceeb[_0x3f79ca[_0x12d744][_0xfcc1('0x91')]],'%s',_0x52244f):_0x52244f;_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x7d')]?_['replace'](_0x2aafe3[_0x3f79ca[_0x12d744][_0xfcc1('0x7d')]],'%s',_0x52244f):_0x52244f;if(_0x3f79ca[_0x12d744][_0xfcc1('0x7e')]){_0x3c263e[_0xfcc1('0x6f')](_0x52244f);}_0x3f79ca[_0x12d744][_0xfcc1('0x92')]&&_0x3c263e[_0xfcc1('0x40')](_0x52244f,_0x3f79ca[_0x12d744][_0xfcc1('0x92')]==='DESC'?![]:!![]);_0x3c263e['field'](_0x52244f,_0x3f79ca[_0x12d744]['alias']||_0x52244f);}if(_0x4cba87[_0xfcc1('0x80')]){_0x4cba87['joins']=JSON[_0xfcc1('0x81')](_0x4cba87[_0xfcc1('0x80')]);for(var _0x1fc59c=0x0;_0x1fc59c<_0x4cba87['joins']['length'];_0x1fc59c+=0x1){if(_0x4cba87[_0xfcc1('0x80')][_0x1fc59c]['type']&&_[_0xfcc1('0x69')](_0xbd2ee3,_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x45')])&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c]['parentKey']&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x83')]&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x85')]){_0x3c263e[_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x45')]](_0x4cba87['joins'][_0x1fc59c][_0xfcc1('0x83')],null,util[_0xfcc1('0x7d')](_0xfcc1('0x84'),_0x4cba87[_0xfcc1('0x78')],_0x4cba87['joins'][_0x1fc59c]['parentKey'],_0x4cba87['joins'][_0x1fc59c][_0xfcc1('0x83')],_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x85')]));}}}if(_0x4cba87[_0xfcc1('0x86')]){_0x4cba87[_0xfcc1('0x86')]=JSON[_0xfcc1('0x81')](_0x4cba87['conditions']);_0x3c263e[_0xfcc1('0x42')](_0x5197aa(_0x4cba87[_0xfcc1('0x86')][_0xfcc1('0x6f')]));}_0x29aa1a=_0x3c263e[_0xfcc1('0x87')]();_0x3c263e[_0xfcc1('0x24')](_0x3eeb67);_0x3c263e[_0xfcc1('0x22')](0x0);return;}})[_0xfcc1('0x2a')](function(){if(_0x3e40fc['output']===_0xfcc1('0x93')){return null;}var _0xd98c9=_[_0xfcc1('0x44')](_0x3e40fc,{'name':_0x3e40fc[_0xfcc1('0x94')]||_0x3e40fc[_0xfcc1('0x36')]||_0x4cba87[_0xfcc1('0x36')],'basename':_0x3e0fd3,'savename':util['format'](_0xfcc1('0x95'),_0x3e40fc[_0xfcc1('0x36')]||_0x4cba87['name'],require(_0xfcc1('0x96'))[_0xfcc1('0x97')](0x4),_0x3e40fc[_0xfcc1('0x98')]||'csv'),'reportId':_0x4cba87['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xfcc1('0x4f')](_0xd98c9,{'raw':!![]});})[_0xfcc1('0x2a')](function(_0x63dd2b){if(_0x4cba87[_0xfcc1('0x78')]===_0xfcc1('0x99')){_0x29aa1a[_0xfcc1('0x42')](_0x4cba87[_0xfcc1('0x78')]+_0xfcc1('0x9a'),_0x3e40fc['startDate'],_0x3e40fc[_0xfcc1('0x9b')]);}else{_0x29aa1a[_0xfcc1('0x42')](_0x4cba87['table']+_0xfcc1('0x9c'),_0x3e40fc['startDate'],_0x3e40fc[_0xfcc1('0x9b')]);}if(_0x63dd2b){logger[_0xfcc1('0x9d')]('Run\x20Query:',_0x29aa1a['toString']());require(_0xfcc1('0x9e'))['fork'](path['join'](__dirname,'../../components/export/',_0x63dd2b[_0xfcc1('0x98')]),[_0x63dd2b['id'],_0x29aa1a['toString'](),path[_0xfcc1('0x8d')](__dirname,'../../files/reports',_0x63dd2b[_0xfcc1('0x9f')]),_0x3e0fd3]);return _0x63dd2b;}else{var _0x3ae6bd=squel[_0xfcc1('0x76')]();_0x3ae6bd[_0xfcc1('0x77')]('('+_0x29aa1a[_0xfcc1('0x8a')]()+')',_0xfcc1('0xa0'));_0x3ae6bd['field'](_0xfcc1('0xa1'),_0xfcc1('0x25'));_0x29aa1a[_0xfcc1('0x24')](_0x3e40fc['limit']||_0x3eeb67);_0x29aa1a[_0xfcc1('0x22')](_0x3e40fc[_0xfcc1('0x22')]||0x0);return dbH[_0xfcc1('0x8b')][_0xfcc1('0x37')](_0x3ae6bd[_0xfcc1('0x8a')](),{'type':dbH['sequelize'][_0xfcc1('0x8c')][_0xfcc1('0xa2')]})[_0xfcc1('0x2a')](function(_0x1541c5){if(!_0x1541c5[_0xfcc1('0x3d')]){_0x1e54d8=0x0;}else{_0x1e54d8=_0x1541c5[0x0][_0xfcc1('0x25')]||0x0;}return dbH[_0xfcc1('0x8b')][_0xfcc1('0x37')](_0x29aa1a[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')]['QueryTypes']['SELECT']});})['then'](function(_0x56884c){return{'rows':_0x56884c||[],'count':_0x1e54d8};});}});}exports[_0xfcc1('0xa3')]=function(_0x58e18e,_0x16dad4){return runReport(_0x58e18e['params'],_0x58e18e[_0xfcc1('0x37')],_0x58e18e[_0xfcc1('0x47')])[_0xfcc1('0x2a')](respondWithResult(_0x16dad4,null))[_0xfcc1('0x4c')](handleError(_0x16dad4,null));};exports[_0xfcc1('0xa4')]=runReport;exports[_0xfcc1('0x37')]=function(_0x56cb4f,_0x2ad7db){var _0x5262ce=0xa;var _0x5a89f8=[_0xfcc1('0x8d'),_0xfcc1('0x5d'),_0xfcc1('0x5e'),_0xfcc1('0x8e')];var _0x26dccb={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':'MIN(%s)','AVG':_0xfcc1('0x63'),'GROUP_CONCAT':_0xfcc1('0x64'),'GROUP_CONCAT ASC':_0xfcc1('0x8f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4206d3={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':_0xfcc1('0xa5'),'ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x39cb76=function(_0x59ffa4){return!_['includes']([_0xfcc1('0x6a'),_0xfcc1('0x6b'),_0xfcc1('0xa6'),'IS\x20NOT\x20EMPTY'],_0x59ffa4);};var _0xd310ae=function(_0x112a8d){if(!_0x112a8d||!_0x112a8d['rules'][_0xfcc1('0x3d')]){return'';}for(var _0x127161='(',_0x58432f=0x0;_0x58432f<_0x112a8d[_0xfcc1('0x6d')][_0xfcc1('0x3d')];_0x58432f+=0x1){_0x58432f>0x0&&(_0x127161+='\x20'+_0x112a8d['operator']+'\x20');_0x127161+=_0x112a8d[_0xfcc1('0x6d')][_0x58432f]['group']?_0xd310ae(_0x112a8d['rules'][_0x58432f][_0xfcc1('0x6f')]):_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x7b')]+'\x20'+_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x70')]+(_0x39cb76(_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x70')])?'\x20'+_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x71')]:'');}return _0x127161+')';};var _0x5b8ffc={'where':{'id':_0x56cb4f['params']['id']}},_0x52880c,_0x45e946,_0x56dba2,_0x4200c3,_0x3b21e3;_0x5b8ffc=_[_0xfcc1('0x44')]({},_0x5b8ffc,_0x56cb4f[_0xfcc1('0x47')]);return db['AnalyticCustomReport'][_0xfcc1('0x4e')](_0x5b8ffc)['then'](function(_0x8224a8){if(_0x8224a8){_0x52880c=_0x8224a8;return _0x8224a8['getFields']();}return null;})[_0xfcc1('0x2a')](function(_0x499e4f){if(_0x499e4f){if(!_0x499e4f[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x45e946=_0x499e4f;return db[_0xfcc1('0x75')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xc47aa3){if(_0xc47aa3){_0x56dba2=_['keyBy'](_0xc47aa3,'id');var _0xea0055;var _0x812750=squel[_0xfcc1('0x76')]();_0x812750[_0xfcc1('0x77')](_0x52880c['table']);for(var _0x512e89=0x0;_0x512e89<_0x45e946['length'];_0x512e89+=0x1){_0xea0055=_0x45e946[_0x512e89]['MetricId']?_0x56dba2[_0x45e946[_0x512e89][_0xfcc1('0x79')]][_0xfcc1('0x7a')]:_0x45e946[_0x512e89]['field'];_0xea0055=_0x45e946[_0x512e89][_0xfcc1('0x91')]?_['replace'](_0x26dccb[_0x45e946[_0x512e89][_0xfcc1('0x91')]],'%s',_0xea0055):_0xea0055;_0xea0055=_0x45e946[_0x512e89][_0xfcc1('0x7d')]?_[_0xfcc1('0x7c')](_0x4206d3[_0x45e946[_0x512e89]['format']],'%s',_0xea0055):_0xea0055;if(_0x45e946[_0x512e89]['groupBy']){_0x812750[_0xfcc1('0x6f')](_0xea0055);}_0x45e946[_0x512e89][_0xfcc1('0x92')]&&_0x812750[_0xfcc1('0x40')](_0xea0055,_0x45e946[_0x512e89]['orderBy']===_0xfcc1('0x7f')?![]:!![]);_0x812750['field'](_0xea0055,_0x45e946[_0x512e89]['alias']||_0xea0055);}if(_0x52880c['joins']){_0x52880c[_0xfcc1('0x80')]=JSON[_0xfcc1('0x81')](_0x52880c[_0xfcc1('0x80')]);for(var _0x5d7a04=0x0;_0x5d7a04<_0x52880c[_0xfcc1('0x80')]['length'];_0x5d7a04+=0x1){if(_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x45')]&&_[_0xfcc1('0x69')](_0x5a89f8,_0x52880c[_0xfcc1('0x80')][_0x5d7a04]['type'])&&_0x52880c['joins'][_0x5d7a04][_0xfcc1('0x82')]&&_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x83')]&&_0x52880c['joins'][_0x5d7a04]['foreignKey']){_0x812750[_0x52880c['joins'][_0x5d7a04]['type']](_0x52880c['joins'][_0x5d7a04][_0xfcc1('0x83')],null,util[_0xfcc1('0x7d')](_0xfcc1('0x84'),_0x52880c[_0xfcc1('0x78')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x82')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x83')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x85')]));}}}if(_0x52880c[_0xfcc1('0x86')]){_0x52880c[_0xfcc1('0x86')]=JSON[_0xfcc1('0x81')](_0x52880c[_0xfcc1('0x86')]);_0x812750['where'](_0xd310ae(_0x52880c[_0xfcc1('0x86')][_0xfcc1('0x6f')]));}_0x3b21e3=_0x812750[_0xfcc1('0x87')]();_0x812750['limit'](_0x5262ce);_0x812750['offset'](0x0);logger[_0xfcc1('0x88')](_0xfcc1('0x89'),_0x812750['toString']());return dbH[_0xfcc1('0x8b')]['query'](_0x812750[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')]['QueryTypes']['SELECT']});}})[_0xfcc1('0x2a')](function(){return{'sql':_0x3b21e3[_0xfcc1('0x8a')]()};})[_0xfcc1('0x2a')](respondWithResult(_0x2ad7db,null))[_0xfcc1('0x4c')](handleError(_0x2ad7db,null));}; \ No newline at end of file +var _0xf1d3=['MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','field','function','replace','orderBy','alias','joins','foreignKey','foreignTable','format','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','cross_join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','getFields','select','groupBy','DESC','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','savename','COUNT(*)','QueryTypes','COUNT(DISTINCT\x20%s)','AVG(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','options','AnalyticCustomReport','count','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)'];(function(_0x14677d,_0x55cbc4){var _0x5cb603=function(_0x150f67){while(--_0x150f67){_0x14677d['push'](_0x14677d['shift']());}};_0x5cb603(++_0x55cbc4);}(_0xf1d3,0xee));var _0x3f1d=function(_0x959f15,_0x395007){_0x959f15=_0x959f15-0x0;var _0x1547c4=_0xf1d3[_0x959f15];return _0x1547c4;};'use strict';var emlformat=require(_0x3f1d('0x0'));var rimraf=require(_0x3f1d('0x1'));var zipdir=require(_0x3f1d('0x2'));var jsonpatch=require(_0x3f1d('0x3'));var rp=require(_0x3f1d('0x4'));var moment=require(_0x3f1d('0x5'));var BPromise=require(_0x3f1d('0x6'));var Mustache=require(_0x3f1d('0x7'));var util=require(_0x3f1d('0x8'));var path=require(_0x3f1d('0x9'));var sox=require(_0x3f1d('0xa'));var csv=require(_0x3f1d('0xb'));var ejs=require(_0x3f1d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f1d('0xd'));var squel=require(_0x3f1d('0xe'));var crypto=require(_0x3f1d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3f1d('0xb'));var querystring=require(_0x3f1d('0x10'));var Papa=require(_0x3f1d('0x11'));var Redis=require(_0x3f1d('0x12'));var authService=require(_0x3f1d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3f1d('0x14'));var hardwareService=require(_0x3f1d('0x15'));var logger=require(_0x3f1d('0x16'))(_0x3f1d('0x17'));var utils=require(_0x3f1d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3f1d('0x19'));var db=require(_0x3f1d('0x1a'))['db'];var dbH=require(_0x3f1d('0x1a'))['dbH'];function respondWithStatusCode(_0x360705,_0x2b6674){_0x2b6674=_0x2b6674||0xcc;return function(_0x1b7e7f){if(_0x1b7e7f){return _0x360705[_0x3f1d('0x1b')](_0x2b6674);}return _0x360705[_0x3f1d('0x1c')](_0x2b6674)[_0x3f1d('0x1d')]();};}function respondWithResult(_0x2c8f49,_0x40158e){_0x40158e=_0x40158e||0xc8;return function(_0x391448){if(_0x391448){return _0x2c8f49['status'](_0x40158e)[_0x3f1d('0x1e')](_0x391448);}};}function respondWithFilteredResult(_0x4ce5c9,_0x1773f5){return function(_0x2fcd14){if(_0x2fcd14){var _0x43d63b=typeof _0x1773f5[_0x3f1d('0x1f')]===_0x3f1d('0x20')&&typeof _0x1773f5['limit']===_0x3f1d('0x20');var _0x9ae762=_0x2fcd14['count'];var _0x4fa624=_0x43d63b?0x0:_0x1773f5[_0x3f1d('0x1f')];var _0x3cb03e=_0x43d63b?_0x2fcd14['count']:_0x1773f5[_0x3f1d('0x1f')]+_0x1773f5[_0x3f1d('0x21')];var _0x34ac5b;if(_0x3cb03e>=_0x9ae762){_0x3cb03e=_0x9ae762;_0x34ac5b=0xc8;}else{_0x34ac5b=0xce;}_0x4ce5c9[_0x3f1d('0x1c')](_0x34ac5b);return _0x4ce5c9[_0x3f1d('0x22')](_0x3f1d('0x23'),_0x4fa624+'-'+_0x3cb03e+'/'+_0x9ae762)[_0x3f1d('0x1e')](_0x2fcd14);}return null;};}function patchUpdates(_0x492fb6){return function(_0x48f5d7){try{jsonpatch[_0x3f1d('0x24')](_0x48f5d7,_0x492fb6,!![]);}catch(_0xc8875d){return BPromise[_0x3f1d('0x25')](_0xc8875d);}return _0x48f5d7[_0x3f1d('0x26')]();};}function saveUpdates(_0xc3bae3,_0x42a132){return function(_0x4404fb){if(_0x4404fb){return _0x4404fb[_0x3f1d('0x27')](_0xc3bae3)[_0x3f1d('0x28')](function(_0x4785dd){return _0x4785dd;});}return null;};}function removeEntity(_0x1dd5f4,_0x4fc0e6){return function(_0x12f812){if(_0x12f812){return _0x12f812[_0x3f1d('0x29')]()[_0x3f1d('0x28')](function(){var _0x27908f=_0x12f812['get']({'plain':!![]});var _0x30f216=_0x3f1d('0x2a');return db[_0x3f1d('0x2b')][_0x3f1d('0x29')]({'where':{'type':_0x30f216,'resourceId':_0x27908f['id']}})[_0x3f1d('0x28')](function(){return _0x12f812;});})['then'](function(){_0x1dd5f4[_0x3f1d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x929c2a,_0x222f3b){return function(_0x7949d){if(!_0x7949d){_0x929c2a[_0x3f1d('0x1b')](0x194);}return _0x7949d;};}function handleError(_0x491253,_0x489af6){_0x489af6=_0x489af6||0x1f4;return function(_0x5d6b5d){logger[_0x3f1d('0x2c')](_0x5d6b5d[_0x3f1d('0x2d')]);if(_0x5d6b5d[_0x3f1d('0x2e')]){delete _0x5d6b5d[_0x3f1d('0x2e')];}_0x491253[_0x3f1d('0x1c')](_0x489af6)[_0x3f1d('0x2f')](_0x5d6b5d);};}exports['index']=function(_0x27cd32,_0xd4a7b6){var _0x2f4f26={},_0x3c1470={},_0x5325b2={'count':0x0,'rows':[]};var _0x37b590=_[_0x3f1d('0x30')](db['AnalyticCustomReport'][_0x3f1d('0x31')],function(_0x43795f){return{'name':_0x43795f[_0x3f1d('0x32')],'type':_0x43795f[_0x3f1d('0x33')][_0x3f1d('0x34')]};});_0x3c1470[_0x3f1d('0x35')]=_[_0x3f1d('0x30')](_0x37b590,_0x3f1d('0x2e'));_0x3c1470['query']=_[_0x3f1d('0x36')](_0x27cd32[_0x3f1d('0x37')]);_0x3c1470[_0x3f1d('0x38')]=_['intersection'](_0x3c1470['model'],_0x3c1470[_0x3f1d('0x37')]);_0x2f4f26['attributes']=_[_0x3f1d('0x39')](_0x3c1470[_0x3f1d('0x35')],qs[_0x3f1d('0x3a')](_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x3a')]));_0x2f4f26[_0x3f1d('0x3b')]=_0x2f4f26['attributes'][_0x3f1d('0x3c')]?_0x2f4f26[_0x3f1d('0x3b')]:_0x3c1470[_0x3f1d('0x35')];if(!_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x3d')]('nolimit')){_0x2f4f26['limit']=qs[_0x3f1d('0x21')](_0x27cd32['query'][_0x3f1d('0x21')]);_0x2f4f26['offset']=qs[_0x3f1d('0x1f')](_0x27cd32['query']['offset']);}_0x2f4f26[_0x3f1d('0x3e')]=qs['sort'](_0x27cd32[_0x3f1d('0x37')]['sort']);_0x2f4f26[_0x3f1d('0x3f')]=qs[_0x3f1d('0x38')](_[_0x3f1d('0x40')](_0x27cd32[_0x3f1d('0x37')],_0x3c1470[_0x3f1d('0x38')]),_0x37b590);if(_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x41')]){_0x2f4f26[_0x3f1d('0x3f')]=_[_0x3f1d('0x42')](_0x2f4f26[_0x3f1d('0x3f')],{'$or':_[_0x3f1d('0x30')](_0x37b590,function(_0x3935cc){if(_0x3935cc['type']!=='VIRTUAL'){var _0x16eb67={};_0x16eb67[_0x3935cc['name']]={'$like':'%'+_0x27cd32['query'][_0x3f1d('0x41')]+'%'};return _0x16eb67;}})});}_0x2f4f26=_[_0x3f1d('0x42')]({},_0x2f4f26,_0x27cd32[_0x3f1d('0x43')]);var _0x10e684={'where':_0x2f4f26[_0x3f1d('0x3f')]};return db[_0x3f1d('0x44')][_0x3f1d('0x45')](_0x10e684)[_0x3f1d('0x28')](function(_0xd8efa5){_0x5325b2[_0x3f1d('0x45')]=_0xd8efa5;if(_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x46')]){_0x2f4f26[_0x3f1d('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3f1d('0x48')](_0x2f4f26);})[_0x3f1d('0x28')](function(_0x496783){_0x5325b2['rows']=_0x496783;return _0x5325b2;})[_0x3f1d('0x28')](respondWithFilteredResult(_0xd4a7b6,_0x2f4f26))[_0x3f1d('0x49')](handleError(_0xd4a7b6,null));};exports[_0x3f1d('0x4a')]=function(_0xad9d8f,_0x1bd937){var _0x3d8652={'raw':![],'where':{'id':_0xad9d8f[_0x3f1d('0x4b')]['id']}},_0x2269f7={};_0x2269f7['model']=_['keys'](db['AnalyticCustomReport'][_0x3f1d('0x31')]);_0x2269f7['query']=_[_0x3f1d('0x36')](_0xad9d8f[_0x3f1d('0x37')]);_0x2269f7['filters']=_[_0x3f1d('0x39')](_0x2269f7[_0x3f1d('0x35')],_0x2269f7['query']);_0x3d8652[_0x3f1d('0x3b')]=_[_0x3f1d('0x39')](_0x2269f7[_0x3f1d('0x35')],qs[_0x3f1d('0x3a')](_0xad9d8f['query'][_0x3f1d('0x3a')]));_0x3d8652['attributes']=_0x3d8652[_0x3f1d('0x3b')][_0x3f1d('0x3c')]?_0x3d8652[_0x3f1d('0x3b')]:_0x2269f7[_0x3f1d('0x35')];if(_0xad9d8f[_0x3f1d('0x37')][_0x3f1d('0x46')]){_0x3d8652['include']=[{'all':!![]}];}_0x3d8652=_[_0x3f1d('0x42')]({},_0x3d8652,_0xad9d8f['options']);return db[_0x3f1d('0x44')][_0x3f1d('0x4c')](_0x3d8652)[_0x3f1d('0x28')](handleEntityNotFound(_0x1bd937,null))[_0x3f1d('0x28')](respondWithResult(_0x1bd937,null))[_0x3f1d('0x49')](handleError(_0x1bd937,null));};exports['create']=function(_0x4a17ba,_0x281954){return db[_0x3f1d('0x44')][_0x3f1d('0x4d')](_0x4a17ba['body'],{})[_0x3f1d('0x28')](function(_0x159e6a){var _0x329952=_0x4a17ba['user']['get']({'plain':!![]});if(!_0x329952)throw new Error(_0x3f1d('0x4e'));if(_0x329952[_0x3f1d('0x4f')]===_0x3f1d('0x50')){var _0xafb74e=_0x159e6a['get']({'plain':!![]});var _0x29a100=_0x3f1d('0x51');return db[_0x3f1d('0x52')][_0x3f1d('0x4c')]({'where':{'name':_0x29a100,'userProfileId':_0x329952[_0x3f1d('0x53')]},'raw':!![]})[_0x3f1d('0x28')](function(_0xb0897){if(_0xb0897&&_0xb0897[_0x3f1d('0x54')]===0x0){return db['UserProfileResource'][_0x3f1d('0x4d')]({'name':_0xafb74e[_0x3f1d('0x2e')],'resourceId':_0xafb74e['id'],'type':_0x3f1d('0x2a'),'sectionId':_0xb0897['id']},{})[_0x3f1d('0x28')](function(){return _0x159e6a;});}else{return _0x159e6a;}})[_0x3f1d('0x49')](function(_0x36e7b6){logger[_0x3f1d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36e7b6);throw _0x36e7b6;});}return _0x159e6a;})[_0x3f1d('0x28')](respondWithResult(_0x281954,0xc9))[_0x3f1d('0x49')](handleError(_0x281954,null));};exports[_0x3f1d('0x27')]=function(_0x540cdf,_0x51ab04){if(_0x540cdf['body']['id']){delete _0x540cdf[_0x3f1d('0x55')]['id'];}return db[_0x3f1d('0x44')][_0x3f1d('0x4c')]({'where':{'id':_0x540cdf[_0x3f1d('0x4b')]['id']}})[_0x3f1d('0x28')](handleEntityNotFound(_0x51ab04,null))['then'](saveUpdates(_0x540cdf['body'],null))[_0x3f1d('0x28')](respondWithResult(_0x51ab04,null))[_0x3f1d('0x49')](handleError(_0x51ab04,null));};exports['destroy']=function(_0x2268b3,_0x1037a9){return db['AnalyticCustomReport'][_0x3f1d('0x4c')]({'where':{'id':_0x2268b3[_0x3f1d('0x4b')]['id']}})[_0x3f1d('0x28')](handleEntityNotFound(_0x1037a9,null))['then'](removeEntity(_0x1037a9,null))[_0x3f1d('0x49')](handleError(_0x1037a9,null));};exports[_0x3f1d('0x56')]=function(_0x1ee3ab,_0x3359ab){var _0x319626=0xa;var _0x111d3a=[_0x3f1d('0x57'),_0x3f1d('0x58'),_0x3f1d('0x59'),'cross_join'];var _0x19ea8a={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3f1d('0x5e'),'GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0x4b1c75={'SEC_TO_TIME':_0x3f1d('0x60'),'DATE':_0x3f1d('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0x273210=function(_0x39293c){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),'IS\x20NOT\x20NULL',_0x3f1d('0x66'),_0x3f1d('0x67')],_0x39293c);};var _0x12c735=function(_0x87511d){if(!_0x87511d||!_0x87511d['rules'][_0x3f1d('0x3c')]){return'';}for(var _0x10aa37='(',_0x53adab=0x0;_0x53adab<_0x87511d[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x53adab+=0x1){_0x53adab>0x0&&(_0x10aa37+='\x20'+_0x87511d[_0x3f1d('0x69')]+'\x20');_0x10aa37+=_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6a')]?_0x12c735(_0x87511d['rules'][_0x53adab][_0x3f1d('0x6a')]):_0x87511d[_0x3f1d('0x68')][_0x53adab]['field']+'\x20'+_0x87511d[_0x3f1d('0x68')][_0x53adab]['condition']+(_0x273210(_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6b')])?'\x20'+_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6c')]:'');}return _0x10aa37+')';};var _0x11ea15={'where':{'id':_0x1ee3ab[_0x3f1d('0x4b')]['id']}},_0x110f98,_0x2c556b,_0x155466,_0x3b031d,_0x55a0f2;_0x11ea15=_[_0x3f1d('0x42')]({},_0x11ea15,_0x1ee3ab['options']);return db['AnalyticCustomReport']['find'](_0x11ea15)['then'](function(_0x218b0d){if(_0x218b0d){_0x110f98=_0x218b0d;return _0x218b0d['getFields']();}return null;})[_0x3f1d('0x28')](function(_0x3acc95){if(_0x3acc95){if(!_0x3acc95[_0x3f1d('0x3c')]){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x2c556b=_0x3acc95;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})['then'](function(_0x3be026){if(_0x3be026){_0x155466=_[_0x3f1d('0x71')](_0x3be026,'id');var _0x53e507;var _0x324c66=squel['select']();_0x324c66[_0x3f1d('0x72')](_0x110f98[_0x3f1d('0x73')]);for(var _0x2c4107=0x0;_0x2c4107<_0x2c556b[_0x3f1d('0x3c')];_0x2c4107+=0x1){_0x53e507=_0x2c556b[_0x2c4107][_0x3f1d('0x74')]?_0x155466[_0x2c556b[_0x2c4107][_0x3f1d('0x74')]][_0x3f1d('0x75')]:_0x2c556b[_0x2c4107][_0x3f1d('0x76')];_0x53e507=_0x2c556b[_0x2c4107][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x19ea8a[_0x2c556b[_0x2c4107][_0x3f1d('0x77')]],'%s',_0x53e507):_0x53e507;_0x53e507=_0x2c556b[_0x2c4107]['format']?_[_0x3f1d('0x78')](_0x4b1c75[_0x2c556b[_0x2c4107]['format']],'%s',_0x53e507):_0x53e507;if(_0x2c556b[_0x2c4107]['groupBy']){_0x324c66[_0x3f1d('0x6a')](_0x53e507);}_0x2c556b[_0x2c4107][_0x3f1d('0x79')]&&_0x324c66[_0x3f1d('0x3e')](_0x53e507,_0x2c556b[_0x2c4107][_0x3f1d('0x79')]==='DESC'?![]:!![]);_0x324c66[_0x3f1d('0x76')](_0x53e507,_0x2c556b[_0x2c4107][_0x3f1d('0x7a')]||_0x53e507);}if(_0x110f98[_0x3f1d('0x7b')]){_0x110f98[_0x3f1d('0x7b')]=JSON['parse'](_0x110f98['joins']);for(var _0x284bbc=0x0;_0x284bbc<_0x110f98[_0x3f1d('0x7b')][_0x3f1d('0x3c')];_0x284bbc+=0x1){if(_0x110f98[_0x3f1d('0x7b')][_0x284bbc]['type']&&_[_0x3f1d('0x64')](_0x111d3a,_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x33')])&&_0x110f98['joins'][_0x284bbc]['parentKey']&&_0x110f98[_0x3f1d('0x7b')][_0x284bbc]['foreignTable']&&_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7c')]){_0x324c66[_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x33')]](_0x110f98['joins'][_0x284bbc][_0x3f1d('0x7d')],null,util[_0x3f1d('0x7e')](_0x3f1d('0x7f'),_0x110f98['table'],_0x110f98['joins'][_0x284bbc]['parentKey'],_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7d')],_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7c')]));}}}if(_0x110f98[_0x3f1d('0x80')]){_0x110f98['conditions']=JSON[_0x3f1d('0x81')](_0x110f98[_0x3f1d('0x80')]);_0x324c66['where'](_0x12c735(_0x110f98[_0x3f1d('0x80')][_0x3f1d('0x6a')]));}_0x55a0f2=_0x324c66[_0x3f1d('0x82')]();_0x324c66['limit'](_0x319626);_0x324c66['offset'](0x0);logger[_0x3f1d('0x83')](_0x3f1d('0x84'),_0x324c66['toString']());return dbH[_0x3f1d('0x85')]['query'](_0x324c66[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')]['QueryTypes'][_0x3f1d('0x87')]});}})[_0x3f1d('0x28')](respondWithResult(_0x3359ab,null))[_0x3f1d('0x49')](handleError(_0x3359ab,null));};function runReport(_0x5dc6c5,_0x5ab052,_0x4a44d4){var _0x43612d=_0x5ab052[_0x3f1d('0x2e')];var _0x5791a4=0xa;var _0x2db3d2=['join',_0x3f1d('0x58'),_0x3f1d('0x59'),_0x3f1d('0x88')];var _0x3b4b7c={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3f1d('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0x51123d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3f1d('0x61'),'HOUR':_0x3f1d('0x8a'),'ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0xe575bb=function(_0x5a9958){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),_0x3f1d('0x8b'),_0x3f1d('0x66'),'IS\x20NOT\x20EMPTY'],_0x5a9958);};var _0x1d6f87=function(_0x406d46){if(!_0x406d46||!_0x406d46['rules']['length']){return'';}for(var _0x1488da='(',_0x4bdc71=0x0;_0x4bdc71<_0x406d46[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x4bdc71+=0x1){_0x4bdc71>0x0&&(_0x1488da+='\x20'+_0x406d46['operator']+'\x20');_0x1488da+=_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6a')]?_0x1d6f87(_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6a')]):_0x406d46['rules'][_0x4bdc71][_0x3f1d('0x76')]+'\x20'+_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6b')]+(_0xe575bb(_0x406d46[_0x3f1d('0x68')][_0x4bdc71]['condition'])?'\x20'+_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6c')]:'');}return _0x1488da+')';};var _0x4cde99={'where':{'id':_0x5dc6c5['id']}},_0xd1d4ec,_0x596ed5,_0x3830f9,_0x2f1b86,_0xdb5a3f;_0x4cde99=_[_0x3f1d('0x42')]({},_0x4cde99,_0x4a44d4);return db[_0x3f1d('0x44')][_0x3f1d('0x4c')](_0x4cde99)[_0x3f1d('0x28')](function(_0x416d39){if(_0x416d39){_0xd1d4ec=_0x416d39;return _0x416d39[_0x3f1d('0x8c')]();}return null;})[_0x3f1d('0x28')](function(_0x51d47e){if(_0x51d47e){if(!_0x51d47e[_0x3f1d('0x3c')]){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x596ed5=_0x51d47e;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1d2030){if(_0x1d2030){_0x3830f9=_[_0x3f1d('0x71')](_0x1d2030,'id');var _0x18638f;var _0x96dd86=squel[_0x3f1d('0x8d')]();_0x96dd86[_0x3f1d('0x72')](_0xd1d4ec['table']);for(var _0x3752a2=0x0;_0x3752a2<_0x596ed5[_0x3f1d('0x3c')];_0x3752a2+=0x1){_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x74')]?_0x3830f9[_0x596ed5[_0x3752a2][_0x3f1d('0x74')]][_0x3f1d('0x75')]:_0x596ed5[_0x3752a2][_0x3f1d('0x76')];_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x3b4b7c[_0x596ed5[_0x3752a2][_0x3f1d('0x77')]],'%s',_0x18638f):_0x18638f;_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x7e')]?_[_0x3f1d('0x78')](_0x51123d[_0x596ed5[_0x3752a2][_0x3f1d('0x7e')]],'%s',_0x18638f):_0x18638f;if(_0x596ed5[_0x3752a2][_0x3f1d('0x8e')]){_0x96dd86[_0x3f1d('0x6a')](_0x18638f);}_0x596ed5[_0x3752a2][_0x3f1d('0x79')]&&_0x96dd86['order'](_0x18638f,_0x596ed5[_0x3752a2]['orderBy']===_0x3f1d('0x8f')?![]:!![]);_0x96dd86['field'](_0x18638f,_0x596ed5[_0x3752a2]['alias']||_0x18638f);}if(_0xd1d4ec[_0x3f1d('0x7b')]){_0xd1d4ec['joins']=JSON[_0x3f1d('0x81')](_0xd1d4ec[_0x3f1d('0x7b')]);for(var _0x4d64f9=0x0;_0x4d64f9<_0xd1d4ec[_0x3f1d('0x7b')][_0x3f1d('0x3c')];_0x4d64f9+=0x1){if(_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x33')]&&_[_0x3f1d('0x64')](_0x2db3d2,_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x33')])&&_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x90')]&&_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')]&&_0xd1d4ec['joins'][_0x4d64f9]['foreignKey']){_0x96dd86[_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9]['type']](_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')],null,util['format'](_0x3f1d('0x7f'),_0xd1d4ec['table'],_0xd1d4ec['joins'][_0x4d64f9][_0x3f1d('0x90')],_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')],_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9]['foreignKey']));}}}if(_0xd1d4ec[_0x3f1d('0x80')]){_0xd1d4ec[_0x3f1d('0x80')]=JSON[_0x3f1d('0x81')](_0xd1d4ec[_0x3f1d('0x80')]);_0x96dd86['where'](_0x1d6f87(_0xd1d4ec['conditions'][_0x3f1d('0x6a')]));}_0xdb5a3f=_0x96dd86[_0x3f1d('0x82')]();_0x96dd86[_0x3f1d('0x21')](_0x5791a4);_0x96dd86[_0x3f1d('0x1f')](0x0);return;}})['then'](function(){if(_0x5ab052[_0x3f1d('0x91')]===_0x3f1d('0x92')){return null;}var _0x57a5b8=_[_0x3f1d('0x42')](_0x5ab052,{'name':_0x5ab052[_0x3f1d('0x93')]||_0x5ab052[_0x3f1d('0x2e')]||_0xd1d4ec[_0x3f1d('0x2e')],'basename':_0x43612d,'savename':util[_0x3f1d('0x7e')](_0x3f1d('0x94'),_0x5ab052[_0x3f1d('0x2e')]||_0xd1d4ec[_0x3f1d('0x2e')],require(_0x3f1d('0x95'))[_0x3f1d('0x96')](0x4),_0x5ab052[_0x3f1d('0x91')]||_0x3f1d('0x97')),'reportId':_0xd1d4ec['id'],'reportType':_0x3f1d('0x98')});return db[_0x3f1d('0x99')][_0x3f1d('0x4d')](_0x57a5b8,{'raw':!![]});})[_0x3f1d('0x28')](function(_0x3ab577){if(_0xd1d4ec[_0x3f1d('0x73')]==='cdr'){_0xdb5a3f[_0x3f1d('0x3f')](_0xd1d4ec['table']+_0x3f1d('0x9a'),_0x5ab052[_0x3f1d('0x9b')],_0x5ab052['endDate']);}else{_0xdb5a3f[_0x3f1d('0x3f')](_0xd1d4ec[_0x3f1d('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ab052[_0x3f1d('0x9b')],_0x5ab052[_0x3f1d('0x9c')]);}if(_0x3ab577){logger[_0x3f1d('0x9d')]('Run\x20Query:',_0xdb5a3f[_0x3f1d('0x86')]());require('child_process')[_0x3f1d('0x9e')](path[_0x3f1d('0x57')](__dirname,_0x3f1d('0x9f'),_0x3ab577[_0x3f1d('0x91')]),[_0x3ab577['id'],_0xdb5a3f[_0x3f1d('0x86')](),path[_0x3f1d('0x57')](__dirname,'../../files/reports',_0x3ab577[_0x3f1d('0xa0')]),_0x43612d]);return _0x3ab577;}else{var _0x27c6b8=squel[_0x3f1d('0x8d')]();_0x27c6b8['from']('('+_0xdb5a3f['toString']()+')','countTable');_0x27c6b8[_0x3f1d('0x76')](_0x3f1d('0xa1'),_0x3f1d('0x45'));_0xdb5a3f[_0x3f1d('0x21')](_0x5ab052[_0x3f1d('0x21')]||_0x5791a4);_0xdb5a3f[_0x3f1d('0x1f')](_0x5ab052[_0x3f1d('0x1f')]||0x0);return dbH[_0x3f1d('0x85')][_0x3f1d('0x37')](_0x27c6b8[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')]['SELECT']})[_0x3f1d('0x28')](function(_0x44dc06){if(!_0x44dc06[_0x3f1d('0x3c')]){_0x2f1b86=0x0;}else{_0x2f1b86=_0x44dc06[0x0][_0x3f1d('0x45')]||0x0;}return dbH['sequelize'][_0x3f1d('0x37')](_0xdb5a3f[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')]['SELECT']});})['then'](function(_0x495729){return{'rows':_0x495729||[],'count':_0x2f1b86};});}});}exports['run']=function(_0x28f1a6,_0x5e384f){return runReport(_0x28f1a6[_0x3f1d('0x4b')],_0x28f1a6[_0x3f1d('0x37')],_0x28f1a6[_0x3f1d('0x43')])[_0x3f1d('0x28')](respondWithResult(_0x5e384f,null))['catch'](handleError(_0x5e384f,null));};exports['runReport']=runReport;exports['query']=function(_0x211118,_0x2f0925){var _0x12b210=0xa;var _0x432ccd=[_0x3f1d('0x57'),_0x3f1d('0x58'),_0x3f1d('0x59'),_0x3f1d('0x88')];var _0x48d348={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':_0x3f1d('0xa3'),'MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':_0x3f1d('0xa4'),'GROUP_CONCAT':_0x3f1d('0x89'),'GROUP_CONCAT ASC':_0x3f1d('0x5e'),'GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0xdff638={'SEC_TO_TIME':_0x3f1d('0x60'),'DATE':_0x3f1d('0x61'),'HOUR':_0x3f1d('0x8a'),'ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0x33fe41=function(_0x44f32f){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),'IS\x20NOT\x20NULL',_0x3f1d('0x66'),_0x3f1d('0x67')],_0x44f32f);};var _0x1ca754=function(_0xd24586){if(!_0xd24586||!_0xd24586[_0x3f1d('0x68')][_0x3f1d('0x3c')]){return'';}for(var _0x4bc64c='(',_0x9070e9=0x0;_0x9070e9<_0xd24586[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x9070e9+=0x1){_0x9070e9>0x0&&(_0x4bc64c+='\x20'+_0xd24586[_0x3f1d('0x69')]+'\x20');_0x4bc64c+=_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6a')]?_0x1ca754(_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6a')]):_0xd24586['rules'][_0x9070e9][_0x3f1d('0x76')]+'\x20'+_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6b')]+(_0x33fe41(_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6b')])?'\x20'+_0xd24586[_0x3f1d('0x68')][_0x9070e9]['value']:'');}return _0x4bc64c+')';};var _0x2f189c={'where':{'id':_0x211118[_0x3f1d('0x4b')]['id']}},_0x2bb032,_0x46729d,_0x2fa8bc,_0x533be6,_0x53ce93;_0x2f189c=_[_0x3f1d('0x42')]({},_0x2f189c,_0x211118[_0x3f1d('0x43')]);return db['AnalyticCustomReport'][_0x3f1d('0x4c')](_0x2f189c)[_0x3f1d('0x28')](function(_0x3fe887){if(_0x3fe887){_0x2bb032=_0x3fe887;return _0x3fe887[_0x3f1d('0x8c')]();}return null;})['then'](function(_0x4f37fc){if(_0x4f37fc){if(!_0x4f37fc['length']){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x46729d=_0x4f37fc;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})[_0x3f1d('0x28')](function(_0x3b6aff){if(_0x3b6aff){_0x2fa8bc=_['keyBy'](_0x3b6aff,'id');var _0x26e8c4;var _0x5e6168=squel[_0x3f1d('0x8d')]();_0x5e6168[_0x3f1d('0x72')](_0x2bb032[_0x3f1d('0x73')]);for(var _0x2aa1e2=0x0;_0x2aa1e2<_0x46729d[_0x3f1d('0x3c')];_0x2aa1e2+=0x1){_0x26e8c4=_0x46729d[_0x2aa1e2]['MetricId']?_0x2fa8bc[_0x46729d[_0x2aa1e2]['MetricId']]['metric']:_0x46729d[_0x2aa1e2][_0x3f1d('0x76')];_0x26e8c4=_0x46729d[_0x2aa1e2][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x48d348[_0x46729d[_0x2aa1e2][_0x3f1d('0x77')]],'%s',_0x26e8c4):_0x26e8c4;_0x26e8c4=_0x46729d[_0x2aa1e2][_0x3f1d('0x7e')]?_[_0x3f1d('0x78')](_0xdff638[_0x46729d[_0x2aa1e2][_0x3f1d('0x7e')]],'%s',_0x26e8c4):_0x26e8c4;if(_0x46729d[_0x2aa1e2][_0x3f1d('0x8e')]){_0x5e6168['group'](_0x26e8c4);}_0x46729d[_0x2aa1e2][_0x3f1d('0x79')]&&_0x5e6168[_0x3f1d('0x3e')](_0x26e8c4,_0x46729d[_0x2aa1e2][_0x3f1d('0x79')]===_0x3f1d('0x8f')?![]:!![]);_0x5e6168[_0x3f1d('0x76')](_0x26e8c4,_0x46729d[_0x2aa1e2]['alias']||_0x26e8c4);}if(_0x2bb032[_0x3f1d('0x7b')]){_0x2bb032['joins']=JSON['parse'](_0x2bb032[_0x3f1d('0x7b')]);for(var _0x2c891f=0x0;_0x2c891f<_0x2bb032['joins']['length'];_0x2c891f+=0x1){if(_0x2bb032['joins'][_0x2c891f][_0x3f1d('0x33')]&&_[_0x3f1d('0x64')](_0x432ccd,_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x33')])&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x90')]&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f]['foreignTable']&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7c')]){_0x5e6168[_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x33')]](_0x2bb032['joins'][_0x2c891f][_0x3f1d('0x7d')],null,util[_0x3f1d('0x7e')](_0x3f1d('0x7f'),_0x2bb032[_0x3f1d('0x73')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x90')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7d')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7c')]));}}}if(_0x2bb032[_0x3f1d('0x80')]){_0x2bb032[_0x3f1d('0x80')]=JSON['parse'](_0x2bb032[_0x3f1d('0x80')]);_0x5e6168[_0x3f1d('0x3f')](_0x1ca754(_0x2bb032['conditions']['group']));}_0x53ce93=_0x5e6168[_0x3f1d('0x82')]();_0x5e6168[_0x3f1d('0x21')](_0x12b210);_0x5e6168['offset'](0x0);logger[_0x3f1d('0x83')](_0x3f1d('0x84'),_0x5e6168[_0x3f1d('0x86')]());return dbH[_0x3f1d('0x85')][_0x3f1d('0x37')](_0x5e6168[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')][_0x3f1d('0x87')]});}})[_0x3f1d('0x28')](function(){return{'sql':_0x53ce93[_0x3f1d('0x86')]()};})[_0x3f1d('0x28')](respondWithResult(_0x2f0925,null))[_0x3f1d('0x49')](handleError(_0x2f0925,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index aa2d97e..340607c 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1a6=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','lodash'];(function(_0x423b87,_0x2a1b40){var _0xe4851b=function(_0x1d7009){while(--_0x1d7009){_0x423b87['push'](_0x423b87['shift']());}};_0xe4851b(++_0x2a1b40);}(_0xb1a6,0x180));var _0x6b1a=function(_0x34440f,_0x13fcc6){_0x34440f=_0x34440f-0x0;var _0x2d7813=_0xb1a6[_0x34440f];return _0x2d7813;};'use strict';var _=require(_0x6b1a('0x0'));var util=require(_0x6b1a('0x1'));var logger=require(_0x6b1a('0x2'))(_0x6b1a('0x3'));var moment=require(_0x6b1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b1a('0x5'));var fs=require('fs');var path=require(_0x6b1a('0x6'));var rimraf=require(_0x6b1a('0x7'));var config=require(_0x6b1a('0x8'));var attributes=require(_0x6b1a('0x9'));module['exports']=function(_0x4cb354,_0x3e9d44){return _0x4cb354['define'](_0x6b1a('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0ff=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment'];(function(_0x254eb4,_0x8b207f){var _0x46c368=function(_0x418cad){while(--_0x418cad){_0x254eb4['push'](_0x254eb4['shift']());}};_0x46c368(++_0x8b207f);}(_0xa0ff,0x129));var _0xfa0f=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xa0ff[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0xfa0f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa0f('0x1'));var moment=require(_0xfa0f('0x2'));var BPromise=require(_0xfa0f('0x3'));var rp=require(_0xfa0f('0x4'));var fs=require('fs');var path=require(_0xfa0f('0x5'));var rimraf=require(_0xfa0f('0x6'));var config=require(_0xfa0f('0x7'));var attributes=require(_0xfa0f('0x8'));module[_0xfa0f('0x9')]=function(_0x2b98d2,_0x1cea37){return _0x2b98d2['define'](_0xfa0f('0xa'),attributes,{'tableName':_0xfa0f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 31e603a..366c9a2 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46b5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x317188,_0x538bbf){var _0x32354a=function(_0x145174){while(--_0x145174){_0x317188['push'](_0x317188['shift']());}};_0x32354a(++_0x538bbf);}(_0x46b5,0x18c));var _0x546b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x46b5[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x546b('0x0'));var util=require(_0x546b('0x1'));var moment=require(_0x546b('0x2'));var BPromise=require(_0x546b('0x3'));var rs=require(_0x546b('0x4'));var fs=require('fs');var Redis=require(_0x546b('0x5'));var db=require(_0x546b('0x6'))['db'];var utils=require(_0x546b('0x7'));var logger=require(_0x546b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x546b('0x9')][_0x546b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bfcd0,_0x2c469b,_0x247a98){return new BPromise(function(_0x3facd8,_0x172a2b){return client['request'](_0x1bfcd0,_0x247a98)['then'](function(_0x36651e){logger[_0x546b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c469b,_0x546b('0xc'));logger[_0x546b('0xd')](_0x546b('0xe'),_0x2c469b,_0x546b('0xc'),JSON[_0x546b('0xf')](_0x36651e));if(_0x36651e[_0x546b('0x10')]){if(_0x36651e[_0x546b('0x10')]['code']===0x1f4){logger[_0x546b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c469b,_0x36651e['error'][_0x546b('0x11')]);return _0x172a2b(_0x36651e[_0x546b('0x10')][_0x546b('0x11')]);}logger[_0x546b('0x10')](_0x546b('0x12'),_0x2c469b,_0x36651e['error'][_0x546b('0x11')]);return _0x3facd8(_0x36651e['error'][_0x546b('0x11')]);}else{logger[_0x546b('0xb')](_0x546b('0x12'),_0x2c469b,'request\x20sent');_0x3facd8(_0x36651e[_0x546b('0x13')][_0x546b('0x11')]);}})[_0x546b('0x14')](function(_0x4dd0bf){logger['error'](_0x546b('0x12'),_0x2c469b,_0x4dd0bf);_0x172a2b(_0x4dd0bf);});});} \ No newline at end of file +var _0x7058=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x3c20ee,_0x703766){var _0x5c952f=function(_0x3268b0){while(--_0x3268b0){_0x3c20ee['push'](_0x3c20ee['shift']());}};_0x5c952f(++_0x703766);}(_0x7058,0x13b));var _0x8705=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7058[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x8705('0x0'));var util=require(_0x8705('0x1'));var moment=require(_0x8705('0x2'));var BPromise=require(_0x8705('0x3'));var rs=require(_0x8705('0x4'));var fs=require('fs');var Redis=require(_0x8705('0x5'));var db=require(_0x8705('0x6'))['db'];var utils=require(_0x8705('0x7'));var logger=require(_0x8705('0x8'))('rpc');var config=require(_0x8705('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8705('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x398e41,_0x15dbb2,_0x1e0eac){return new BPromise(function(_0x2503cd,_0x427a54){return client[_0x8705('0xb')](_0x398e41,_0x1e0eac)[_0x8705('0xc')](function(_0x19680b){logger[_0x8705('0xd')](_0x8705('0xe'),_0x15dbb2,_0x8705('0xf'));logger[_0x8705('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x15dbb2,'request\x20sent',JSON[_0x8705('0x11')](_0x19680b));if(_0x19680b['error']){if(_0x19680b[_0x8705('0x12')][_0x8705('0x13')]===0x1f4){logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x19680b[_0x8705('0x12')]['message']);return _0x427a54(_0x19680b[_0x8705('0x12')]['message']);}logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x19680b[_0x8705('0x12')][_0x8705('0x14')]);return _0x2503cd(_0x19680b[_0x8705('0x12')]['message']);}else{logger['info'](_0x8705('0xe'),_0x15dbb2,_0x8705('0xf'));_0x2503cd(_0x19680b['result'][_0x8705('0x14')]);}})[_0x8705('0x15')](function(_0x2d8d24){logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x2d8d24);_0x427a54(_0x2d8d24);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 414736b..a584858 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f03=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','show','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f03,0x1db));var _0x36f0=function(_0x14ec9d,_0x5b19f4){_0x14ec9d=_0x14ec9d-0x0;var _0x521174=_0x6f03[_0x14ec9d];return _0x521174;};'use strict';var multer=require(_0x36f0('0x0'));var util=require(_0x36f0('0x1'));var path=require('path');var timeout=require(_0x36f0('0x2'));var express=require(_0x36f0('0x3'));var router=express[_0x36f0('0x4')]();var fs_extra=require(_0x36f0('0x5'));var auth=require(_0x36f0('0x6'));var interaction=require(_0x36f0('0x7'));var config=require(_0x36f0('0x8'));var controller=require(_0x36f0('0x9'));router['get']('/',auth[_0x36f0('0xa')](),controller[_0x36f0('0xb')]);router[_0x36f0('0xc')]('/:id',auth[_0x36f0('0xa')](),controller[_0x36f0('0xd')]);router[_0x36f0('0xc')]('/:id/preview',auth[_0x36f0('0xa')](),controller['preview']);router['get'](_0x36f0('0xe'),auth[_0x36f0('0xa')](),controller['run']);router[_0x36f0('0xc')](_0x36f0('0xf'),auth[_0x36f0('0xa')](),controller[_0x36f0('0x10')]);router[_0x36f0('0x11')]('/',auth['isAuthenticated'](),controller[_0x36f0('0x12')]);router[_0x36f0('0x13')](_0x36f0('0x14'),auth[_0x36f0('0xa')](),controller[_0x36f0('0x15')]);router[_0x36f0('0x16')]('/:id',auth[_0x36f0('0xa')](),controller[_0x36f0('0x17')]);module[_0x36f0('0x18')]=router; \ No newline at end of file +var _0xb335=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','/:id/query','post','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x4ab4c7,_0x1eb4f5){var _0x5d38a8=function(_0x598a92){while(--_0x598a92){_0x4ab4c7['push'](_0x4ab4c7['shift']());}};_0x5d38a8(++_0x1eb4f5);}(_0xb335,0xf4));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5b33('0x0'));var util=require(_0x5b33('0x1'));var path=require('path');var timeout=require(_0x5b33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5b33('0x3'));var config=require(_0x5b33('0x4'));var controller=require(_0x5b33('0x5'));router[_0x5b33('0x6')]('/',auth[_0x5b33('0x7')](),controller[_0x5b33('0x8')]);router[_0x5b33('0x6')](_0x5b33('0x9'),auth[_0x5b33('0x7')](),controller[_0x5b33('0xa')]);router[_0x5b33('0x6')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x5b33('0x6')](_0x5b33('0xb'),auth[_0x5b33('0x7')](),controller[_0x5b33('0xc')]);router[_0x5b33('0x6')](_0x5b33('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x5b33('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5b33('0xf')](_0x5b33('0x9'),auth[_0x5b33('0x7')](),controller[_0x5b33('0x10')]);router['delete'](_0x5b33('0x9'),auth['isAuthenticated'](),controller[_0x5b33('0x11')]);module[_0x5b33('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7284127..52d24f4 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x4e7ae5,_0x407167){var _0x14d181=function(_0x45b7d0){while(--_0x45b7d0){_0x4e7ae5['push'](_0x4e7ae5['shift']());}};_0x14d181(++_0x407167);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xf2ca[_0xef4ef0];return _0x39b60b;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file +var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x7da7[_0x31a37b];return _0x49ae16;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f51ab66..3a9f2f8 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3f8001,_0x57445a){var _0x799a1b=function(_0x145000){while(--_0x145000){_0x3f8001['push'](_0x3f8001['shift']());}};_0x799a1b(++_0x57445a);}(_0xf494,0x1c6));var _0x4f49=function(_0x3ad88c,_0x3e6fb0){_0x3ad88c=_0x3ad88c-0x0;var _0x44b377=_0xf494[_0x3ad88c];return _0x44b377;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file +var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1229df,_0x39bc91){var _0x28301f=function(_0x4bbebb){while(--_0x4bbebb){_0x1229df['push'](_0x1229df['shift']());}};_0x28301f(++_0x39bc91);}(_0xda19,0xd5));var _0x9da1=function(_0x375bbf,_0x556cdb){_0x375bbf=_0x375bbf-0x0;var _0x255aed=_0xda19[_0x375bbf];return _0x255aed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 933aa62..71f1263 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53cd=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','../../config/logger','api'];(function(_0x42a027,_0x6c9c55){var _0x4d486d=function(_0x3a2e43){while(--_0x3a2e43){_0x42a027['push'](_0x42a027['shift']());}};_0x4d486d(++_0x6c9c55);}(_0x53cd,0x1ee));var _0xd53c=function(_0x5ec78e,_0x51da72){_0x5ec78e=_0x5ec78e-0x0;var _0x3c4901=_0x53cd[_0x5ec78e];return _0x3c4901;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd53c('0x0'))(_0xd53c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd53c('0x2'));var config=require(_0xd53c('0x3'));var attributes=require(_0xd53c('0x4'));module[_0xd53c('0x5')]=function(_0x261a1e,_0x30a207){return _0x261a1e[_0xd53c('0x6')](_0xd53c('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbde=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x29de7c,_0x5bc2bf){var _0x29c03f=function(_0x2659b7){while(--_0x2659b7){_0x29de7c['push'](_0x29de7c['shift']());}};_0x29c03f(++_0x5bc2bf);}(_0xfbde,0x1d9));var _0xefbd=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xfbde[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var logger=require(_0xefbd('0x2'))(_0xefbd('0x3'));var moment=require('moment');var BPromise=require(_0xefbd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefbd('0x5'));var rimraf=require(_0xefbd('0x6'));var config=require(_0xefbd('0x7'));var attributes=require(_0xefbd('0x8'));module[_0xefbd('0x9')]=function(_0x1a9041,_0x2eeecd){return _0x1a9041[_0xefbd('0xa')](_0xefbd('0xb'),attributes,{'tableName':_0xefbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 9edc1f5..b87d8c0 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd026=['AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x45f55c,_0x48e11b){var _0x1f3400=function(_0x5002b2){while(--_0x5002b2){_0x45f55c['push'](_0x45f55c['shift']());}};_0x1f3400(++_0x48e11b);}(_0xd026,0x16f));var _0x6d02=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd026[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x6d02('0x0'));var util=require(_0x6d02('0x1'));var moment=require(_0x6d02('0x2'));var BPromise=require(_0x6d02('0x3'));var rs=require(_0x6d02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d02('0x5'));var logger=require(_0x6d02('0x6'))(_0x6d02('0x7'));var config=require(_0x6d02('0x8'));var jayson=require(_0x6d02('0x9'));var client=jayson['client'][_0x6d02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc9cb,_0x4b187c,_0x511b69){return new BPromise(function(_0x52b688,_0x2fcaf3){return client['request'](_0x3cc9cb,_0x511b69)['then'](function(_0x4fce9d){logger['info'](_0x6d02('0xb'),_0x4b187c,'request\x20sent');logger[_0x6d02('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4b187c,_0x6d02('0xd'),JSON['stringify'](_0x4fce9d));if(_0x4fce9d[_0x6d02('0xe')]){if(_0x4fce9d[_0x6d02('0xe')][_0x6d02('0xf')]===0x1f4){logger[_0x6d02('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,_0x4fce9d[_0x6d02('0xe')][_0x6d02('0x10')]);return _0x2fcaf3(_0x4fce9d[_0x6d02('0xe')][_0x6d02('0x10')]);}logger[_0x6d02('0xe')](_0x6d02('0xb'),_0x4b187c,_0x4fce9d[_0x6d02('0xe')]['message']);return _0x52b688(_0x4fce9d[_0x6d02('0xe')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,'request\x20sent');_0x52b688(_0x4fce9d[_0x6d02('0x11')]['message']);}})['catch'](function(_0x3993f5){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,_0x3993f5);_0x2fcaf3(_0x3993f5);});});} \ No newline at end of file +var _0xdb36=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdb36,0x18a));var _0x6db3=function(_0x3e4ffb,_0x2660b7){_0x3e4ffb=_0x3e4ffb-0x0;var _0x2a0f23=_0xdb36[_0x3e4ffb];return _0x2a0f23;};'use strict';var _=require(_0x6db3('0x0'));var util=require('util');var moment=require(_0x6db3('0x1'));var BPromise=require(_0x6db3('0x2'));var rs=require(_0x6db3('0x3'));var fs=require('fs');var Redis=require(_0x6db3('0x4'));var db=require(_0x6db3('0x5'))['db'];var utils=require(_0x6db3('0x6'));var logger=require(_0x6db3('0x7'))(_0x6db3('0x8'));var config=require(_0x6db3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6db3('0xa')][_0x6db3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3951d7,_0x111a95,_0x42cbcb){return new BPromise(function(_0x292b23,_0x420dfb){return client[_0x6db3('0xc')](_0x3951d7,_0x42cbcb)[_0x6db3('0xd')](function(_0x2ff1bf){logger[_0x6db3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x111a95,_0x6db3('0xf'));logger[_0x6db3('0x10')](_0x6db3('0x11'),_0x111a95,_0x6db3('0xf'),JSON[_0x6db3('0x12')](_0x2ff1bf));if(_0x2ff1bf[_0x6db3('0x13')]){if(_0x2ff1bf['error'][_0x6db3('0x14')]===0x1f4){logger['error'](_0x6db3('0x15'),_0x111a95,_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);return _0x420dfb(_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);}logger['error'](_0x6db3('0x15'),_0x111a95,_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);return _0x292b23(_0x2ff1bf[_0x6db3('0x13')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x111a95,_0x6db3('0xf'));_0x292b23(_0x2ff1bf[_0x6db3('0x17')]['message']);}})[_0x6db3('0x18')](function(_0x43778c){logger[_0x6db3('0x13')](_0x6db3('0x15'),_0x111a95,_0x43778c);_0x420dfb(_0x43778c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2d180c2..1f22238 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda98=['exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy'];(function(_0x1beb3c,_0x382881){var _0x21cc34=function(_0x13a312){while(--_0x13a312){_0x1beb3c['push'](_0x1beb3c['shift']());}};_0x21cc34(++_0x382881);}(_0xda98,0x1cd));var _0x8da9=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xda98[_0x485201];return _0x9ca98a;};'use strict';var multer=require(_0x8da9('0x0'));var util=require(_0x8da9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8da9('0x2'));var router=express[_0x8da9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8da9('0x4'));var config=require(_0x8da9('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x8da9('0x6')](),controller['index']);router[_0x8da9('0x7')](_0x8da9('0x8'),auth[_0x8da9('0x6')](),controller[_0x8da9('0x9')]);router[_0x8da9('0x7')]('/:id/preview',auth[_0x8da9('0x6')](),controller[_0x8da9('0xa')]);router[_0x8da9('0x7')](_0x8da9('0xb'),auth[_0x8da9('0x6')](),controller[_0x8da9('0xc')]);router[_0x8da9('0x7')](_0x8da9('0xd'),auth['isAuthenticated'](),controller[_0x8da9('0xe')]);router[_0x8da9('0xf')]('/',auth[_0x8da9('0x6')](),controller['create']);router[_0x8da9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8da9('0x11')](_0x8da9('0x8'),auth[_0x8da9('0x6')](),controller[_0x8da9('0x12')]);module[_0x8da9('0x13')]=router; \ No newline at end of file +var _0xeb47=['delete','exports','util','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','create','update'];(function(_0x25eec7,_0x545e27){var _0x4ec8c8=function(_0xd243f4){while(--_0xd243f4){_0x25eec7['push'](_0x25eec7['shift']());}};_0x4ec8c8(++_0x545e27);}(_0xeb47,0x1b7));var _0x7eb4=function(_0x56b16a,_0x134321){_0x56b16a=_0x56b16a-0x0;var _0x59fa56=_0xeb47[_0x56b16a];return _0x59fa56;};'use strict';var multer=require('multer');var util=require(_0x7eb4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7eb4('0x1'));var router=express[_0x7eb4('0x2')]();var fs_extra=require(_0x7eb4('0x3'));var auth=require(_0x7eb4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7eb4('0x5'));router[_0x7eb4('0x6')]('/',auth[_0x7eb4('0x7')](),controller[_0x7eb4('0x8')]);router[_0x7eb4('0x6')](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller['show']);router[_0x7eb4('0x6')](_0x7eb4('0xa'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xb')]);router[_0x7eb4('0x6')](_0x7eb4('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x7eb4('0x6')](_0x7eb4('0xd'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xe')]);router['post']('/',auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xf')]);router['put'](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0x10')]);router[_0x7eb4('0x11')](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller['destroy']);module[_0x7eb4('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 9ae251c..902fea3 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1600=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x1414cd,_0x51f303){var _0xf72873=function(_0x3f074d){while(--_0x3f074d){_0x1414cd['push'](_0x1414cd['shift']());}};_0xf72873(++_0x51f303);}(_0x1600,0x1df));var _0x0160=function(_0xcf5c6c,_0x567c7c){_0xcf5c6c=_0xcf5c6c-0x0;var _0x18f5c2=_0x1600[_0xcf5c6c];return _0x18f5c2;};'use strict';var Sequelize=require(_0x0160('0x0'));var moment=require(_0x0160('0x1'));module[_0x0160('0x2')]={'name':{'type':Sequelize[_0x0160('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0160('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0160('0x4')]('csv','pdf',_0x0160('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0160('0x6')]},'status':{'type':Sequelize[_0x0160('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0160('0x4')](_0x0160('0x7'),_0x0160('0x8')),'allowNull':![],'defaultValue':_0x0160('0x7')},'reportId':{'type':Sequelize[_0x0160('0x9')](0xb)[_0x0160('0xa')]},'reportType':{'type':Sequelize[_0x0160('0x3')]}}; \ No newline at end of file +var _0xa7e5=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xa7e5,0xf3));var _0x5a7e=function(_0x29423f,_0x587511){_0x29423f=_0x29423f-0x0;var _0xb914e3=_0xa7e5[_0x29423f];return _0xb914e3;};'use strict';var Sequelize=require(_0x5a7e('0x0'));var moment=require(_0x5a7e('0x1'));module[_0x5a7e('0x2')]={'name':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5a7e('0x4')](_0x5a7e('0x5'),_0x5a7e('0x6'),_0x5a7e('0x7')),'allowNull':![],'defaultValue':_0x5a7e('0x5')},'savename':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5a7e('0x8')]},'endDate':{'type':Sequelize[_0x5a7e('0x8')]},'status':{'type':Sequelize[_0x5a7e('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5a7e('0x4')](_0x5a7e('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x5a7e('0x9')},'reportId':{'type':Sequelize[_0x5a7e('0xa')](0xb)[_0x5a7e('0xb')]},'reportType':{'type':Sequelize[_0x5a7e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 83cea94..59d662e 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf429=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','count','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','ValidationError','exists','download','server/files/reports','%s.%s','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0xf429,0x10c));var _0x9f42=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf429[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9f42('0x0'));var jsonpatch=require(_0x9f42('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f42('0x2'));var Mustache=require(_0x9f42('0x3'));var util=require(_0x9f42('0x4'));var path=require(_0x9f42('0x5'));var sox=require(_0x9f42('0x6'));var csv=require(_0x9f42('0x7'));var ejs=require(_0x9f42('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f42('0x9'));var squel=require(_0x9f42('0xa'));var crypto=require('crypto');var jsforce=require(_0x9f42('0xb'));var deskjs=require(_0x9f42('0xc'));var toCsv=require(_0x9f42('0x7'));var querystring=require(_0x9f42('0xd'));var Papa=require(_0x9f42('0xe'));var Redis=require(_0x9f42('0xf'));var authService=require(_0x9f42('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f42('0x11'));var logger=require(_0x9f42('0x12'))(_0x9f42('0x13'));var utils=require(_0x9f42('0x14'));var config=require(_0x9f42('0x15'));var licenseUtil=require(_0x9f42('0x16'));var db=require(_0x9f42('0x17'))['db'];function respondWithStatusCode(_0x2574fb,_0xb09028){_0xb09028=_0xb09028||0xcc;return function(_0x146acf){if(_0x146acf){return _0x2574fb[_0x9f42('0x18')](_0xb09028);}return _0x2574fb['status'](_0xb09028)[_0x9f42('0x19')]();};}function respondWithResult(_0x4765b9,_0x517bf1){_0x517bf1=_0x517bf1||0xc8;return function(_0x5bcbdf){if(_0x5bcbdf){return _0x4765b9['status'](_0x517bf1)[_0x9f42('0x1a')](_0x5bcbdf);}};}function respondWithFilteredResult(_0x4263c0,_0x222669){return function(_0x21d071){if(_0x21d071){var _0x4124df=typeof _0x222669[_0x9f42('0x1b')]===_0x9f42('0x1c')&&typeof _0x222669[_0x9f42('0x1d')]===_0x9f42('0x1c');var _0x365897=_0x21d071['count'];var _0x41cff9=_0x4124df?0x0:_0x222669[_0x9f42('0x1b')];var _0x184715=_0x4124df?_0x21d071['count']:_0x222669[_0x9f42('0x1b')]+_0x222669[_0x9f42('0x1d')];var _0x3832d6;if(_0x184715>=_0x365897){_0x184715=_0x365897;_0x3832d6=0xc8;}else{_0x3832d6=0xce;}_0x4263c0[_0x9f42('0x1e')](_0x3832d6);return _0x4263c0[_0x9f42('0x1f')](_0x9f42('0x20'),_0x41cff9+'-'+_0x184715+'/'+_0x365897)[_0x9f42('0x1a')](_0x21d071);}return null;};}function patchUpdates(_0x4771e5){return function(_0x1a080b){try{jsonpatch[_0x9f42('0x21')](_0x1a080b,_0x4771e5,!![]);}catch(_0x4ccc77){return BPromise[_0x9f42('0x22')](_0x4ccc77);}return _0x1a080b[_0x9f42('0x23')]();};}function saveUpdates(_0x41a80b,_0x67c98e){return function(_0x34fc75){if(_0x34fc75){return _0x34fc75[_0x9f42('0x24')](_0x41a80b)['then'](function(_0x5ce0cd){return _0x5ce0cd;});}return null;};}function removeEntity(_0x3636f2,_0x2482fc){return function(_0x3a99e7){if(_0x3a99e7){return _0x3a99e7[_0x9f42('0x25')]()[_0x9f42('0x26')](function(){var _0x484731=_0x3a99e7['get']({'plain':!![]});var _0x44c221='ExtractedReports';return db['UserProfileResource'][_0x9f42('0x25')]({'where':{'type':_0x44c221,'resourceId':_0x484731['id']}})['then'](function(){return _0x3a99e7;});})[_0x9f42('0x26')](function(){_0x3636f2[_0x9f42('0x1e')](0xcc)[_0x9f42('0x19')]();});}};}function handleEntityNotFound(_0x5981b3,_0x136dc6){return function(_0x86bae9){if(!_0x86bae9){_0x5981b3[_0x9f42('0x18')](0x194);}return _0x86bae9;};}function handleError(_0x44f289,_0xf220f4){_0xf220f4=_0xf220f4||0x1f4;return function(_0x4ab4c4){logger[_0x9f42('0x27')](_0x4ab4c4['stack']);if(_0x4ab4c4[_0x9f42('0x28')]){delete _0x4ab4c4[_0x9f42('0x28')];}_0x44f289[_0x9f42('0x1e')](_0xf220f4)['send'](_0x4ab4c4);};}exports['index']=function(_0x2d6685,_0x3be8a3){var _0x19d0f6={},_0x216d07={},_0x724b8d={'count':0x0,'rows':[]};var _0x3d989c=_[_0x9f42('0x29')](db['AnalyticExtractedReport'][_0x9f42('0x2a')],function(_0x197eb6){return{'name':_0x197eb6[_0x9f42('0x2b')],'type':_0x197eb6['type'][_0x9f42('0x2c')]};});_0x216d07[_0x9f42('0x2d')]=_[_0x9f42('0x29')](_0x3d989c,_0x9f42('0x28'));_0x216d07[_0x9f42('0x2e')]=_['keys'](_0x2d6685[_0x9f42('0x2e')]);_0x216d07[_0x9f42('0x2f')]=_[_0x9f42('0x30')](_0x216d07[_0x9f42('0x2d')],_0x216d07[_0x9f42('0x2e')]);_0x19d0f6[_0x9f42('0x31')]=_[_0x9f42('0x30')](_0x216d07[_0x9f42('0x2d')],qs['fields'](_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x32')]));_0x19d0f6[_0x9f42('0x31')]=_0x19d0f6['attributes']['length']?_0x19d0f6[_0x9f42('0x31')]:_0x216d07[_0x9f42('0x2d')];if(!_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x33')](_0x9f42('0x34'))){_0x19d0f6[_0x9f42('0x1d')]=qs[_0x9f42('0x1d')](_0x2d6685['query'][_0x9f42('0x1d')]);_0x19d0f6['offset']=qs[_0x9f42('0x1b')](_0x2d6685[_0x9f42('0x2e')]['offset']);}_0x19d0f6[_0x9f42('0x35')]=qs['sort'](_0x2d6685[_0x9f42('0x2e')]['sort']);_0x19d0f6[_0x9f42('0x36')]=qs['filters'](_[_0x9f42('0x37')](_0x2d6685['query'],_0x216d07[_0x9f42('0x2f')]),_0x3d989c);if(_0x2d6685[_0x9f42('0x2e')]['filter']){_0x19d0f6['where']=_[_0x9f42('0x38')](_0x19d0f6[_0x9f42('0x36')],{'$or':_['map'](_0x3d989c,function(_0x76d32f){if(_0x76d32f['type']!==_0x9f42('0x39')){var _0x449f39={};_0x449f39[_0x76d32f['name']]={'$like':'%'+_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x3a')]+'%'};return _0x449f39;}})});}_0x19d0f6=_[_0x9f42('0x38')]({},_0x19d0f6,_0x2d6685[_0x9f42('0x3b')]);var _0x2aaf2c={'where':_0x19d0f6[_0x9f42('0x36')]};return db[_0x9f42('0x3c')][_0x9f42('0x3d')](_0x2aaf2c)[_0x9f42('0x26')](function(_0x2f7e33){_0x724b8d['count']=_0x2f7e33;if(_0x2d6685[_0x9f42('0x2e')]['includeAll']){_0x19d0f6[_0x9f42('0x3e')]=[{'all':!![]}];}return db[_0x9f42('0x3c')][_0x9f42('0x3f')](_0x19d0f6);})[_0x9f42('0x26')](function(_0x40ddc7){_0x724b8d[_0x9f42('0x40')]=_0x40ddc7;return _0x724b8d;})[_0x9f42('0x26')](respondWithFilteredResult(_0x3be8a3,_0x19d0f6))[_0x9f42('0x41')](handleError(_0x3be8a3,null));};exports[_0x9f42('0x42')]=function(_0x1efb38,_0x745a13){var _0x163667={'raw':!![],'where':{'id':_0x1efb38[_0x9f42('0x43')]['id']}},_0x2b39cb={};_0x2b39cb[_0x9f42('0x2d')]=_[_0x9f42('0x44')](db['AnalyticExtractedReport'][_0x9f42('0x2a')]);_0x2b39cb[_0x9f42('0x2e')]=_[_0x9f42('0x44')](_0x1efb38[_0x9f42('0x2e')]);_0x2b39cb['filters']=_[_0x9f42('0x30')](_0x2b39cb[_0x9f42('0x2d')],_0x2b39cb[_0x9f42('0x2e')]);_0x163667[_0x9f42('0x31')]=_[_0x9f42('0x30')](_0x2b39cb[_0x9f42('0x2d')],qs['fields'](_0x1efb38['query'][_0x9f42('0x32')]));_0x163667[_0x9f42('0x31')]=_0x163667[_0x9f42('0x31')][_0x9f42('0x45')]?_0x163667[_0x9f42('0x31')]:_0x2b39cb['model'];if(_0x1efb38[_0x9f42('0x2e')][_0x9f42('0x46')]){_0x163667[_0x9f42('0x3e')]=[{'all':!![]}];}_0x163667=_[_0x9f42('0x38')]({},_0x163667,_0x1efb38[_0x9f42('0x3b')]);return db[_0x9f42('0x3c')][_0x9f42('0x47')](_0x163667)[_0x9f42('0x26')](handleEntityNotFound(_0x745a13,null))[_0x9f42('0x26')](respondWithResult(_0x745a13,null))[_0x9f42('0x41')](handleError(_0x745a13,null));};exports[_0x9f42('0x48')]=function(_0x2babc9,_0x229c92){return db[_0x9f42('0x3c')][_0x9f42('0x48')](_0x2babc9[_0x9f42('0x49')],{})['then'](function(_0x29f41b){var _0x9446fd=_0x2babc9['user'][_0x9f42('0x4a')]({'plain':!![]});if(!_0x9446fd)throw new Error(_0x9f42('0x4b'));if(_0x9446fd[_0x9f42('0x4c')]===_0x9f42('0x4d')){var _0x533214=_0x29f41b['get']({'plain':!![]});var _0x32fc44='ExtractedReports';return db[_0x9f42('0x4e')][_0x9f42('0x47')]({'where':{'name':_0x32fc44,'userProfileId':_0x9446fd[_0x9f42('0x4f')]},'raw':!![]})[_0x9f42('0x26')](function(_0x3a3aa6){if(_0x3a3aa6&&_0x3a3aa6[_0x9f42('0x50')]===0x0){return db[_0x9f42('0x51')][_0x9f42('0x48')]({'name':_0x533214['name'],'resourceId':_0x533214['id'],'type':_0x3a3aa6[_0x9f42('0x28')],'sectionId':_0x3a3aa6['id']},{})[_0x9f42('0x26')](function(){return _0x29f41b;});}else{return _0x29f41b;}})['catch'](function(_0x4e1725){logger[_0x9f42('0x27')](_0x9f42('0x52'),_0x4e1725);throw _0x4e1725;});}return _0x29f41b;})[_0x9f42('0x26')](respondWithResult(_0x229c92,0xc9))[_0x9f42('0x41')](handleError(_0x229c92,null));};exports['update']=function(_0x18af84,_0x4c4cc0){if(_0x18af84[_0x9f42('0x49')]['id']){delete _0x18af84[_0x9f42('0x49')]['id'];}return db[_0x9f42('0x3c')]['find']({'where':{'id':_0x18af84['params']['id']}})[_0x9f42('0x26')](handleEntityNotFound(_0x4c4cc0,null))[_0x9f42('0x26')](saveUpdates(_0x18af84[_0x9f42('0x49')],null))['then'](respondWithResult(_0x4c4cc0,null))['catch'](handleError(_0x4c4cc0,null));};exports[_0x9f42('0x25')]=function(_0x94f732,_0x3204dd){return db[_0x9f42('0x3c')][_0x9f42('0x47')]({'where':{'id':_0x94f732[_0x9f42('0x43')]['id']}})['then'](handleEntityNotFound(_0x3204dd,null))[_0x9f42('0x26')](removeEntity(_0x3204dd,null))[_0x9f42('0x41')](handleError(_0x3204dd,null));};exports['download']=function(_0x3d11be,_0x48ab4e,_0x162c83){return db[_0x9f42('0x3c')][_0x9f42('0x47')]({'where':{'id':_0x3d11be['params']['id']},'attributes':[_0x9f42('0x28'),_0x9f42('0x53'),_0x9f42('0x54'),_0x9f42('0x55')],'raw':!![]})[_0x9f42('0x26')](handleEntityNotFound(_0x48ab4e,null))[_0x9f42('0x26')](function(_0x260a98){if(_0x260a98){if(!fs[_0x9f42('0x56')](path[_0x9f42('0x57')](config[_0x9f42('0x58')],'server/files/reports',_0x260a98[_0x9f42('0x54')]))){throw new db['Sequelize'][(_0x9f42('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3d11be[_0x9f42('0x2e')][_0x9f42('0x5a')]){return _0x48ab4e['sendStatus'](0xc8);}return _0x48ab4e[_0x9f42('0x5b')](path[_0x9f42('0x57')](config[_0x9f42('0x58')],_0x9f42('0x5c'),_0x260a98[_0x9f42('0x54')]),util['format'](_0x9f42('0x5d'),_0x260a98[_0x9f42('0x53')]||_0x260a98[_0x9f42('0x28')],_0x260a98[_0x9f42('0x55')]['toLowerCase']()));}})[_0x9f42('0x41')](handleError(_0x48ab4e,null));}; \ No newline at end of file +var _0x869b=['key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','ExtractedReports','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x869b,0x152));var _0xb869=function(_0x31131a,_0x4d32b8){_0x31131a=_0x31131a-0x0;var _0x25988f=_0x869b[_0x31131a];return _0x25988f;};'use strict';var emlformat=require(_0xb869('0x0'));var rimraf=require(_0xb869('0x1'));var zipdir=require(_0xb869('0x2'));var jsonpatch=require(_0xb869('0x3'));var rp=require(_0xb869('0x4'));var moment=require('moment');var BPromise=require(_0xb869('0x5'));var Mustache=require(_0xb869('0x6'));var util=require(_0xb869('0x7'));var path=require('path');var sox=require(_0xb869('0x8'));var csv=require(_0xb869('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb869('0xa'));var _=require(_0xb869('0xb'));var squel=require(_0xb869('0xc'));var crypto=require('crypto');var jsforce=require(_0xb869('0xd'));var deskjs=require(_0xb869('0xe'));var toCsv=require(_0xb869('0x9'));var querystring=require('querystring');var Papa=require(_0xb869('0xf'));var Redis=require('ioredis');var authService=require(_0xb869('0x10'));var qs=require(_0xb869('0x11'));var as=require(_0xb869('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb869('0x13'))(_0xb869('0x14'));var utils=require(_0xb869('0x15'));var config=require(_0xb869('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd3ca6b,_0x2dc526){_0x2dc526=_0x2dc526||0xcc;return function(_0xb6422b){if(_0xb6422b){return _0xd3ca6b[_0xb869('0x17')](_0x2dc526);}return _0xd3ca6b[_0xb869('0x18')](_0x2dc526)[_0xb869('0x19')]();};}function respondWithResult(_0x51bafc,_0x4b5b80){_0x4b5b80=_0x4b5b80||0xc8;return function(_0xf88f23){if(_0xf88f23){return _0x51bafc[_0xb869('0x18')](_0x4b5b80)['json'](_0xf88f23);}};}function respondWithFilteredResult(_0x56f5cf,_0x4c2819){return function(_0x1ddb5b){if(_0x1ddb5b){var _0x59122e=typeof _0x4c2819['offset']===_0xb869('0x1a')&&typeof _0x4c2819[_0xb869('0x1b')]===_0xb869('0x1a');var _0x350ee9=_0x1ddb5b[_0xb869('0x1c')];var _0x4f93fd=_0x59122e?0x0:_0x4c2819[_0xb869('0x1d')];var _0x2de6d9=_0x59122e?_0x1ddb5b['count']:_0x4c2819[_0xb869('0x1d')]+_0x4c2819[_0xb869('0x1b')];var _0x339fb4;if(_0x2de6d9>=_0x350ee9){_0x2de6d9=_0x350ee9;_0x339fb4=0xc8;}else{_0x339fb4=0xce;}_0x56f5cf[_0xb869('0x18')](_0x339fb4);return _0x56f5cf[_0xb869('0x1e')](_0xb869('0x1f'),_0x4f93fd+'-'+_0x2de6d9+'/'+_0x350ee9)[_0xb869('0x20')](_0x1ddb5b);}return null;};}function patchUpdates(_0x4e6a17){return function(_0x347b99){try{jsonpatch['apply'](_0x347b99,_0x4e6a17,!![]);}catch(_0x2b20be){return BPromise[_0xb869('0x21')](_0x2b20be);}return _0x347b99[_0xb869('0x22')]();};}function saveUpdates(_0x584f77,_0x4eed56){return function(_0x4a5268){if(_0x4a5268){return _0x4a5268[_0xb869('0x23')](_0x584f77)[_0xb869('0x24')](function(_0x379040){return _0x379040;});}return null;};}function removeEntity(_0x5550f1,_0x4777c5){return function(_0x53ea95){if(_0x53ea95){return _0x53ea95['destroy']()[_0xb869('0x24')](function(){var _0x3e0a39=_0x53ea95[_0xb869('0x25')]({'plain':!![]});var _0x387ed1=_0xb869('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x387ed1,'resourceId':_0x3e0a39['id']}})['then'](function(){return _0x53ea95;});})[_0xb869('0x24')](function(){_0x5550f1[_0xb869('0x18')](0xcc)[_0xb869('0x19')]();});}};}function handleEntityNotFound(_0x1b397e,_0x49a076){return function(_0x2f41fe){if(!_0x2f41fe){_0x1b397e[_0xb869('0x17')](0x194);}return _0x2f41fe;};}function handleError(_0x5ff7fa,_0x5792c9){_0x5792c9=_0x5792c9||0x1f4;return function(_0x1fdaf4){logger['error'](_0x1fdaf4[_0xb869('0x27')]);if(_0x1fdaf4[_0xb869('0x28')]){delete _0x1fdaf4['name'];}_0x5ff7fa[_0xb869('0x18')](_0x5792c9)[_0xb869('0x29')](_0x1fdaf4);};}exports[_0xb869('0x2a')]=function(_0x34453c,_0x12b6a1){var _0x2cabc6={},_0x1712c6={},_0x2575ec={'count':0x0,'rows':[]};var _0x570a0d=_['map'](db[_0xb869('0x2b')][_0xb869('0x2c')],function(_0x20c7f2){return{'name':_0x20c7f2[_0xb869('0x2d')],'type':_0x20c7f2['type'][_0xb869('0x2e')]};});_0x1712c6[_0xb869('0x2f')]=_[_0xb869('0x30')](_0x570a0d,_0xb869('0x28'));_0x1712c6[_0xb869('0x31')]=_['keys'](_0x34453c[_0xb869('0x31')]);_0x1712c6[_0xb869('0x32')]=_[_0xb869('0x33')](_0x1712c6[_0xb869('0x2f')],_0x1712c6[_0xb869('0x31')]);_0x2cabc6[_0xb869('0x34')]=_[_0xb869('0x33')](_0x1712c6[_0xb869('0x2f')],qs[_0xb869('0x35')](_0x34453c[_0xb869('0x31')][_0xb869('0x35')]));_0x2cabc6[_0xb869('0x34')]=_0x2cabc6['attributes'][_0xb869('0x36')]?_0x2cabc6[_0xb869('0x34')]:_0x1712c6['model'];if(!_0x34453c['query']['hasOwnProperty'](_0xb869('0x37'))){_0x2cabc6['limit']=qs[_0xb869('0x1b')](_0x34453c[_0xb869('0x31')][_0xb869('0x1b')]);_0x2cabc6[_0xb869('0x1d')]=qs[_0xb869('0x1d')](_0x34453c[_0xb869('0x31')][_0xb869('0x1d')]);}_0x2cabc6[_0xb869('0x38')]=qs[_0xb869('0x39')](_0x34453c[_0xb869('0x31')]['sort']);_0x2cabc6[_0xb869('0x3a')]=qs[_0xb869('0x32')](_['pick'](_0x34453c[_0xb869('0x31')],_0x1712c6['filters']),_0x570a0d);if(_0x34453c['query']['filter']){_0x2cabc6[_0xb869('0x3a')]=_[_0xb869('0x3b')](_0x2cabc6[_0xb869('0x3a')],{'$or':_['map'](_0x570a0d,function(_0x29478c){if(_0x29478c[_0xb869('0x3c')]!=='VIRTUAL'){var _0x2bd20a={};_0x2bd20a[_0x29478c[_0xb869('0x28')]]={'$like':'%'+_0x34453c[_0xb869('0x31')][_0xb869('0x3d')]+'%'};return _0x2bd20a;}})});}_0x2cabc6=_['merge']({},_0x2cabc6,_0x34453c[_0xb869('0x3e')]);var _0x170935={'where':_0x2cabc6[_0xb869('0x3a')]};return db[_0xb869('0x2b')][_0xb869('0x1c')](_0x170935)[_0xb869('0x24')](function(_0x2f4571){_0x2575ec[_0xb869('0x1c')]=_0x2f4571;if(_0x34453c['query'][_0xb869('0x3f')]){_0x2cabc6[_0xb869('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xb869('0x41')](_0x2cabc6);})[_0xb869('0x24')](function(_0x546d97){_0x2575ec[_0xb869('0x42')]=_0x546d97;return _0x2575ec;})[_0xb869('0x24')](respondWithFilteredResult(_0x12b6a1,_0x2cabc6))['catch'](handleError(_0x12b6a1,null));};exports[_0xb869('0x43')]=function(_0x384550,_0xdc17d6){var _0x5acef8={'raw':!![],'where':{'id':_0x384550[_0xb869('0x44')]['id']}},_0x59cb5b={};_0x59cb5b['model']=_[_0xb869('0x45')](db['AnalyticExtractedReport']['rawAttributes']);_0x59cb5b[_0xb869('0x31')]=_[_0xb869('0x45')](_0x384550[_0xb869('0x31')]);_0x59cb5b[_0xb869('0x32')]=_['intersection'](_0x59cb5b[_0xb869('0x2f')],_0x59cb5b[_0xb869('0x31')]);_0x5acef8[_0xb869('0x34')]=_[_0xb869('0x33')](_0x59cb5b['model'],qs[_0xb869('0x35')](_0x384550['query']['fields']));_0x5acef8[_0xb869('0x34')]=_0x5acef8['attributes'][_0xb869('0x36')]?_0x5acef8[_0xb869('0x34')]:_0x59cb5b[_0xb869('0x2f')];if(_0x384550['query'][_0xb869('0x3f')]){_0x5acef8[_0xb869('0x40')]=[{'all':!![]}];}_0x5acef8=_[_0xb869('0x3b')]({},_0x5acef8,_0x384550[_0xb869('0x3e')]);return db[_0xb869('0x2b')][_0xb869('0x46')](_0x5acef8)[_0xb869('0x24')](handleEntityNotFound(_0xdc17d6,null))[_0xb869('0x24')](respondWithResult(_0xdc17d6,null))[_0xb869('0x47')](handleError(_0xdc17d6,null));};exports['create']=function(_0x1bbdd5,_0x422861){return db[_0xb869('0x2b')]['create'](_0x1bbdd5['body'],{})[_0xb869('0x24')](function(_0x2f859d){var _0x31292d=_0x1bbdd5[_0xb869('0x48')]['get']({'plain':!![]});if(!_0x31292d)throw new Error(_0xb869('0x49'));if(_0x31292d[_0xb869('0x4a')]===_0xb869('0x48')){var _0x4dbca9=_0x2f859d[_0xb869('0x25')]({'plain':!![]});var _0x28cb71=_0xb869('0x26');return db[_0xb869('0x4b')]['find']({'where':{'name':_0x28cb71,'userProfileId':_0x31292d[_0xb869('0x4c')]},'raw':!![]})['then'](function(_0x4b5a32){if(_0x4b5a32&&_0x4b5a32[_0xb869('0x4d')]===0x0){return db['UserProfileResource'][_0xb869('0x4e')]({'name':_0x4dbca9[_0xb869('0x28')],'resourceId':_0x4dbca9['id'],'type':_0x4b5a32[_0xb869('0x28')],'sectionId':_0x4b5a32['id']},{})['then'](function(){return _0x2f859d;});}else{return _0x2f859d;}})[_0xb869('0x47')](function(_0x5f514d){logger[_0xb869('0x4f')](_0xb869('0x50'),_0x5f514d);throw _0x5f514d;});}return _0x2f859d;})['then'](respondWithResult(_0x422861,0xc9))[_0xb869('0x47')](handleError(_0x422861,null));};exports[_0xb869('0x23')]=function(_0x57b865,_0x48021a){if(_0x57b865[_0xb869('0x51')]['id']){delete _0x57b865['body']['id'];}return db[_0xb869('0x2b')][_0xb869('0x46')]({'where':{'id':_0x57b865[_0xb869('0x44')]['id']}})['then'](handleEntityNotFound(_0x48021a,null))[_0xb869('0x24')](saveUpdates(_0x57b865[_0xb869('0x51')],null))[_0xb869('0x24')](respondWithResult(_0x48021a,null))[_0xb869('0x47')](handleError(_0x48021a,null));};exports['destroy']=function(_0x1b0007,_0x322d49){return db[_0xb869('0x2b')][_0xb869('0x46')]({'where':{'id':_0x1b0007['params']['id']}})[_0xb869('0x24')](handleEntityNotFound(_0x322d49,null))[_0xb869('0x24')](removeEntity(_0x322d49,null))['catch'](handleError(_0x322d49,null));};exports[_0xb869('0x52')]=function(_0xbc3d2b,_0x445264,_0x217ff5){return db[_0xb869('0x2b')]['find']({'where':{'id':_0xbc3d2b['params']['id']},'attributes':['name',_0xb869('0x53'),_0xb869('0x54'),_0xb869('0x55')],'raw':!![]})[_0xb869('0x24')](handleEntityNotFound(_0x445264,null))[_0xb869('0x24')](function(_0x180103){if(_0x180103){if(!fs[_0xb869('0x56')](path[_0xb869('0x57')](config['root'],_0xb869('0x58'),_0x180103['savename']))){throw new db[(_0xb869('0x59'))][(_0xb869('0x5a'))](_0xb869('0x5b'));}if(_0xbc3d2b['query'][_0xb869('0x5c')]){return _0x445264['sendStatus'](0xc8);}return _0x445264[_0xb869('0x52')](path['join'](config['root'],_0xb869('0x58'),_0x180103['savename']),util[_0xb869('0x5d')](_0xb869('0x5e'),_0x180103['basename']||_0x180103['name'],_0x180103['output'][_0xb869('0x5f')]()));}})[_0xb869('0x47')](handleError(_0x445264,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 20edaaf..14dd132 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2d5=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x11975f,_0x41f438){var _0x1ecee8=function(_0x377330){while(--_0x377330){_0x11975f['push'](_0x11975f['shift']());}};_0x1ecee8(++_0x41f438);}(_0xf2d5,0x108));var _0x5f2d=function(_0x138880,_0x29e3fc){_0x138880=_0x138880-0x0;var _0x3860f5=_0xf2d5[_0x138880];return _0x3860f5;};'use strict';var _=require(_0x5f2d('0x0'));var util=require(_0x5f2d('0x1'));var logger=require(_0x5f2d('0x2'))(_0x5f2d('0x3'));var moment=require(_0x5f2d('0x4'));var BPromise=require(_0x5f2d('0x5'));var rp=require(_0x5f2d('0x6'));var fs=require('fs');var path=require(_0x5f2d('0x7'));var rimraf=require(_0x5f2d('0x8'));var config=require(_0x5f2d('0x9'));var attributes=require(_0x5f2d('0xa'));module[_0x5f2d('0xb')]=function(_0xddd385,_0x32bcb2){return _0xddd385[_0x5f2d('0xc')](_0x5f2d('0xd'),attributes,{'tableName':_0x5f2d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa92b=['AnalyticExtractedReport','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x478a3b,_0x68172){var _0x1d3cf6=function(_0x52e9e0){while(--_0x52e9e0){_0x478a3b['push'](_0x478a3b['shift']());}};_0x1d3cf6(++_0x68172);}(_0xa92b,0x19f));var _0xba92=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xa92b[_0x1fd675];return _0x16b554;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba92('0x0'))(_0xba92('0x1'));var moment=require(_0xba92('0x2'));var BPromise=require('bluebird');var rp=require(_0xba92('0x3'));var fs=require('fs');var path=require(_0xba92('0x4'));var rimraf=require(_0xba92('0x5'));var config=require('../../config/environment');var attributes=require(_0xba92('0x6'));module[_0xba92('0x7')]=function(_0x314c2e,_0x583ea3){return _0x314c2e['define'](_0xba92('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index efc1bd2..c4b3b8a 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b1b=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e10a1,_0x3dd6c2){var _0x43a79b=function(_0x405b32){while(--_0x405b32){_0x4e10a1['push'](_0x4e10a1['shift']());}};_0x43a79b(++_0x3dd6c2);}(_0x1b1b,0x1be));var _0xb1b1=function(_0x2dae0c,_0x3b578c){_0x2dae0c=_0x2dae0c-0x0;var _0x36c35b=_0x1b1b[_0x2dae0c];return _0x36c35b;};'use strict';var _=require(_0xb1b1('0x0'));var util=require(_0xb1b1('0x1'));var moment=require(_0xb1b1('0x2'));var BPromise=require(_0xb1b1('0x3'));var rs=require(_0xb1b1('0x4'));var fs=require('fs');var Redis=require(_0xb1b1('0x5'));var db=require(_0xb1b1('0x6'))['db'];var utils=require(_0xb1b1('0x7'));var logger=require(_0xb1b1('0x8'))(_0xb1b1('0x9'));var config=require(_0xb1b1('0xa'));var jayson=require(_0xb1b1('0xb'));var client=jayson[_0xb1b1('0xc')][_0xb1b1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x13b731,_0x35479f,_0x1bf2af){return new BPromise(function(_0x3007a2,_0x43557c){return client[_0xb1b1('0xe')](_0x13b731,_0x1bf2af)['then'](function(_0x41eac8){logger['info'](_0xb1b1('0xf'),_0x35479f,_0xb1b1('0x10'));logger[_0xb1b1('0x11')](_0xb1b1('0x12'),_0x35479f,_0xb1b1('0x10'),JSON[_0xb1b1('0x13')](_0x41eac8));if(_0x41eac8[_0xb1b1('0x14')]){if(_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x15')]===0x1f4){logger[_0xb1b1('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35479f,_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);return _0x43557c(_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);}logger[_0xb1b1('0x14')](_0xb1b1('0xf'),_0x35479f,_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);return _0x3007a2(_0x41eac8['error']['message']);}else{logger[_0xb1b1('0x17')](_0xb1b1('0xf'),_0x35479f,_0xb1b1('0x10'));_0x3007a2(_0x41eac8[_0xb1b1('0x18')]['message']);}})[_0xb1b1('0x19')](function(_0x2e9c6d){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35479f,_0x2e9c6d);_0x43557c(_0x2e9c6d);});});} \ No newline at end of file +var _0xed91=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x483888,_0x2ff778){var _0x4be161=function(_0x1c1915){while(--_0x1c1915){_0x483888['push'](_0x483888['shift']());}};_0x4be161(++_0x2ff778);}(_0xed91,0x185));var _0x1ed9=function(_0x1af1af,_0x4f2cb5){_0x1af1af=_0x1af1af-0x0;var _0x431458=_0xed91[_0x1af1af];return _0x431458;};'use strict';var _=require('lodash');var util=require(_0x1ed9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ed9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ed9('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1ed9('0x3'));var config=require(_0x1ed9('0x4'));var jayson=require(_0x1ed9('0x5'));var client=jayson[_0x1ed9('0x6')][_0x1ed9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b880f,_0x24eb98,_0x2cd480){return new BPromise(function(_0x11d588,_0x36a14f){return client[_0x1ed9('0x8')](_0x1b880f,_0x2cd480)[_0x1ed9('0x9')](function(_0x513dbc){logger[_0x1ed9('0xa')](_0x1ed9('0xb'),_0x24eb98,_0x1ed9('0xc'));logger['debug'](_0x1ed9('0xd'),_0x24eb98,_0x1ed9('0xc'),JSON[_0x1ed9('0xe')](_0x513dbc));if(_0x513dbc['error']){if(_0x513dbc[_0x1ed9('0xf')][_0x1ed9('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x24eb98,_0x513dbc[_0x1ed9('0xf')]['message']);return _0x36a14f(_0x513dbc['error'][_0x1ed9('0x11')]);}logger[_0x1ed9('0xf')](_0x1ed9('0xb'),_0x24eb98,_0x513dbc['error'][_0x1ed9('0x11')]);return _0x11d588(_0x513dbc['error']['message']);}else{logger[_0x1ed9('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24eb98,_0x1ed9('0xc'));_0x11d588(_0x513dbc[_0x1ed9('0x12')]['message']);}})['catch'](function(_0x1afba2){logger[_0x1ed9('0xf')](_0x1ed9('0xb'),_0x24eb98,_0x1afba2);_0x36a14f(_0x1afba2);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 84174a9..a65016c 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5433=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x5433,0x9c));var _0x3543=function(_0x5b22b7,_0x54986f){_0x5b22b7=_0x5b22b7-0x0;var _0xc92d7c=_0x5433[_0x5b22b7];return _0xc92d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3543('0x0'));var timeout=require(_0x3543('0x1'));var express=require(_0x3543('0x2'));var router=express[_0x3543('0x3')]();var fs_extra=require(_0x3543('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3543('0x5'));var config=require('../../config/environment');var controller=require(_0x3543('0x6'));router[_0x3543('0x7')]('/',auth[_0x3543('0x8')](),controller[_0x3543('0x9')]);router[_0x3543('0x7')](_0x3543('0xa'),auth[_0x3543('0x8')](),controller[_0x3543('0xb')]);router[_0x3543('0x7')](_0x3543('0xc'),auth[_0x3543('0x8')](),controller[_0x3543('0xd')]);router[_0x3543('0xe')]('/',auth[_0x3543('0x8')](),controller[_0x3543('0xf')]);router['put'](_0x3543('0xa'),auth[_0x3543('0x8')](),controller[_0x3543('0x10')]);router['delete'](_0x3543('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3543('0x11')]=router; \ No newline at end of file +var _0x54ef=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2d02bd,_0x55e476){var _0x82d9a2=function(_0x1001b9){while(--_0x1001b9){_0x2d02bd['push'](_0x2d02bd['shift']());}};_0x82d9a2(++_0x55e476);}(_0x54ef,0xff));var _0xf54e=function(_0x554b10,_0xd88236){_0x554b10=_0x554b10-0x0;var _0x350b54=_0x54ef[_0x554b10];return _0x350b54;};'use strict';var multer=require('multer');var util=require(_0xf54e('0x0'));var path=require('path');var timeout=require(_0xf54e('0x1'));var express=require(_0xf54e('0x2'));var router=express[_0xf54e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf54e('0x4'));var interaction=require(_0xf54e('0x5'));var config=require(_0xf54e('0x6'));var controller=require(_0xf54e('0x7'));router['get']('/',auth[_0xf54e('0x8')](),controller[_0xf54e('0x9')]);router[_0xf54e('0xa')](_0xf54e('0xb'),auth[_0xf54e('0x8')](),controller['show']);router[_0xf54e('0xa')](_0xf54e('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xf54e('0xd')]('/',auth[_0xf54e('0x8')](),controller[_0xf54e('0xe')]);router[_0xf54e('0xf')]('/:id',auth[_0xf54e('0x8')](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')]('/:id',auth[_0xf54e('0x8')](),controller[_0xf54e('0x12')]);module[_0xf54e('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c372de2..9cd7f74 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0212=['STRING','BOOLEAN','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0212,0x1f1));var _0x2021=function(_0x411069,_0x16ae05){_0x411069=_0x411069-0x0;var _0x68c645=_0x0212[_0x411069];return _0x68c645;};'use strict';var Sequelize=require('sequelize');module[_0x2021('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x2021('0x1')]},'function':{'type':Sequelize[_0x2021('0x1')]},'format':{'type':Sequelize[_0x2021('0x1')]},'groupBy':{'type':Sequelize[_0x2021('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2021('0x1')]},'custom':{'type':Sequelize[_0x2021('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb234=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb234,0x136));var _0x4b23=function(_0x5bd2e2,_0x246980){_0x5bd2e2=_0x5bd2e2-0x0;var _0x7ceb33=_0xb234[_0x5bd2e2];return _0x7ceb33;};'use strict';var Sequelize=require(_0x4b23('0x0'));module[_0x4b23('0x1')]={'field':{'type':Sequelize[_0x4b23('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4b23('0x3')]},'custom':{'type':Sequelize[_0x4b23('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 93061f8..ea2211c 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31ec=['mustache','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','AnalyticFieldReport','then','includeAll','include','rows','catch','show','params','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x31ec,0x13a));var _0xc31e=function(_0x441b5e,_0x2a8ce8){_0x441b5e=_0x441b5e-0x0;var _0xe75f16=_0x31ec[_0x441b5e];return _0xe75f16;};'use strict';var emlformat=require(_0xc31e('0x0'));var rimraf=require(_0xc31e('0x1'));var zipdir=require(_0xc31e('0x2'));var jsonpatch=require(_0xc31e('0x3'));var rp=require(_0xc31e('0x4'));var moment=require(_0xc31e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc31e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc31e('0x7'));var csv=require(_0xc31e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc31e('0x9'));var squel=require(_0xc31e('0xa'));var crypto=require(_0xc31e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc31e('0x8'));var querystring=require(_0xc31e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc31e('0xd'));var qs=require(_0xc31e('0xe'));var as=require(_0xc31e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc31e('0x10'))(_0xc31e('0x11'));var utils=require('../../config/utils');var config=require(_0xc31e('0x12'));var licenseUtil=require(_0xc31e('0x13'));var db=require(_0xc31e('0x14'))['db'];function respondWithStatusCode(_0x806e6e,_0xa6b5bd){_0xa6b5bd=_0xa6b5bd||0xcc;return function(_0x561ad5){if(_0x561ad5){return _0x806e6e[_0xc31e('0x15')](_0xa6b5bd);}return _0x806e6e[_0xc31e('0x16')](_0xa6b5bd)[_0xc31e('0x17')]();};}function respondWithResult(_0x408161,_0x4a89cc){_0x4a89cc=_0x4a89cc||0xc8;return function(_0x312e89){if(_0x312e89){return _0x408161[_0xc31e('0x16')](_0x4a89cc)[_0xc31e('0x18')](_0x312e89);}};}function respondWithFilteredResult(_0x569b6e,_0x29ab3a){return function(_0x417e23){if(_0x417e23){var _0x5cd3d5=typeof _0x29ab3a[_0xc31e('0x19')]===_0xc31e('0x1a')&&typeof _0x29ab3a['limit']===_0xc31e('0x1a');var _0x140e1f=_0x417e23[_0xc31e('0x1b')];var _0x478d93=_0x5cd3d5?0x0:_0x29ab3a[_0xc31e('0x19')];var _0x59f698=_0x5cd3d5?_0x417e23['count']:_0x29ab3a[_0xc31e('0x19')]+_0x29ab3a[_0xc31e('0x1c')];var _0x455fdf;if(_0x59f698>=_0x140e1f){_0x59f698=_0x140e1f;_0x455fdf=0xc8;}else{_0x455fdf=0xce;}_0x569b6e[_0xc31e('0x16')](_0x455fdf);return _0x569b6e['set'](_0xc31e('0x1d'),_0x478d93+'-'+_0x59f698+'/'+_0x140e1f)['json'](_0x417e23);}return null;};}function patchUpdates(_0x3e96cd){return function(_0x4d1c3d){try{jsonpatch[_0xc31e('0x1e')](_0x4d1c3d,_0x3e96cd,!![]);}catch(_0x3b42a7){return BPromise[_0xc31e('0x1f')](_0x3b42a7);}return _0x4d1c3d[_0xc31e('0x20')]();};}function saveUpdates(_0x4881ee,_0x39102e){return function(_0x7d4cde){if(_0x7d4cde){return _0x7d4cde['update'](_0x4881ee)['then'](function(_0x1a09b2){return _0x1a09b2;});}return null;};}function removeEntity(_0x38a9dc,_0x771a2a){return function(_0x216e7c){if(_0x216e7c){return _0x216e7c[_0xc31e('0x21')]()['then'](function(){_0x38a9dc[_0xc31e('0x16')](0xcc)[_0xc31e('0x17')]();});}};}function handleEntityNotFound(_0x391d8f,_0x3d13f2){return function(_0x3ca83e){if(!_0x3ca83e){_0x391d8f['sendStatus'](0x194);}return _0x3ca83e;};}function handleError(_0x48e926,_0x5f5a93){_0x5f5a93=_0x5f5a93||0x1f4;return function(_0x19af49){logger['error'](_0x19af49[_0xc31e('0x22')]);if(_0x19af49[_0xc31e('0x23')]){delete _0x19af49[_0xc31e('0x23')];}_0x48e926[_0xc31e('0x16')](_0x5f5a93)[_0xc31e('0x24')](_0x19af49);};}exports[_0xc31e('0x25')]=function(_0x2ece8f,_0x12562d){var _0x2fa0cb={},_0x42711b={},_0x17da49={'count':0x0,'rows':[]};var _0x50b23f=_['map'](db['AnalyticFieldReport'][_0xc31e('0x26')],function(_0x25172c){return{'name':_0x25172c[_0xc31e('0x27')],'type':_0x25172c[_0xc31e('0x28')][_0xc31e('0x29')]};});_0x42711b[_0xc31e('0x2a')]=_[_0xc31e('0x2b')](_0x50b23f,_0xc31e('0x23'));_0x42711b['query']=_[_0xc31e('0x2c')](_0x2ece8f[_0xc31e('0x2d')]);_0x42711b['filters']=_[_0xc31e('0x2e')](_0x42711b[_0xc31e('0x2a')],_0x42711b[_0xc31e('0x2d')]);_0x2fa0cb[_0xc31e('0x2f')]=_[_0xc31e('0x2e')](_0x42711b['model'],qs[_0xc31e('0x30')](_0x2ece8f['query'][_0xc31e('0x30')]));_0x2fa0cb[_0xc31e('0x2f')]=_0x2fa0cb[_0xc31e('0x2f')][_0xc31e('0x31')]?_0x2fa0cb[_0xc31e('0x2f')]:_0x42711b[_0xc31e('0x2a')];if(!_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x32')](_0xc31e('0x33'))){_0x2fa0cb[_0xc31e('0x1c')]=qs[_0xc31e('0x1c')](_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x1c')]);_0x2fa0cb[_0xc31e('0x19')]=qs[_0xc31e('0x19')](_0x2ece8f[_0xc31e('0x2d')]['offset']);}_0x2fa0cb['order']=qs['sort'](_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x34')]);_0x2fa0cb[_0xc31e('0x35')]=qs[_0xc31e('0x36')](_[_0xc31e('0x37')](_0x2ece8f['query'],_0x42711b[_0xc31e('0x36')]),_0x50b23f);if(_0x2ece8f['query'][_0xc31e('0x38')]){_0x2fa0cb[_0xc31e('0x35')]=_['merge'](_0x2fa0cb[_0xc31e('0x35')],{'$or':_[_0xc31e('0x2b')](_0x50b23f,function(_0x4d07bf){if(_0x4d07bf['type']!==_0xc31e('0x39')){var _0x3ad445={};_0x3ad445[_0x4d07bf['name']]={'$like':'%'+_0x2ece8f['query'][_0xc31e('0x38')]+'%'};return _0x3ad445;}})});}_0x2fa0cb=_[_0xc31e('0x3a')]({},_0x2fa0cb,_0x2ece8f['options']);var _0x43c823={'where':_0x2fa0cb['where']};return db[_0xc31e('0x3b')]['count'](_0x43c823)[_0xc31e('0x3c')](function(_0x4d1015){_0x17da49['count']=_0x4d1015;if(_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x3d')]){_0x2fa0cb[_0xc31e('0x3e')]=[{'all':!![]}];}return db[_0xc31e('0x3b')]['findAll'](_0x2fa0cb);})[_0xc31e('0x3c')](function(_0x20fe30){_0x17da49[_0xc31e('0x3f')]=_0x20fe30;return _0x17da49;})[_0xc31e('0x3c')](respondWithFilteredResult(_0x12562d,_0x2fa0cb))[_0xc31e('0x40')](handleError(_0x12562d,null));};exports[_0xc31e('0x41')]=function(_0x1e7edc,_0x13ef83){var _0x116936={'raw':![],'where':{'id':_0x1e7edc[_0xc31e('0x42')]['id']}},_0x59bd5c={};_0x59bd5c[_0xc31e('0x2a')]=_[_0xc31e('0x2c')](db['AnalyticFieldReport'][_0xc31e('0x26')]);_0x59bd5c[_0xc31e('0x2d')]=_[_0xc31e('0x2c')](_0x1e7edc[_0xc31e('0x2d')]);_0x59bd5c[_0xc31e('0x36')]=_[_0xc31e('0x2e')](_0x59bd5c[_0xc31e('0x2a')],_0x59bd5c[_0xc31e('0x2d')]);_0x116936[_0xc31e('0x2f')]=_['intersection'](_0x59bd5c['model'],qs[_0xc31e('0x30')](_0x1e7edc[_0xc31e('0x2d')][_0xc31e('0x30')]));_0x116936[_0xc31e('0x2f')]=_0x116936[_0xc31e('0x2f')][_0xc31e('0x31')]?_0x116936[_0xc31e('0x2f')]:_0x59bd5c['model'];if(_0x1e7edc[_0xc31e('0x2d')][_0xc31e('0x3d')]){_0x116936['include']=[{'all':!![]}];}_0x116936=_[_0xc31e('0x3a')]({},_0x116936,_0x1e7edc[_0xc31e('0x43')]);return db[_0xc31e('0x3b')][_0xc31e('0x44')](_0x116936)['then'](handleEntityNotFound(_0x13ef83,null))[_0xc31e('0x3c')](respondWithResult(_0x13ef83,null))['catch'](handleError(_0x13ef83,null));};exports['create']=function(_0x5d687a,_0x1494cc){return db[_0xc31e('0x3b')][_0xc31e('0x45')](_0x5d687a[_0xc31e('0x46')],{})[_0xc31e('0x3c')](respondWithResult(_0x1494cc,0xc9))[_0xc31e('0x40')](handleError(_0x1494cc,null));};exports[_0xc31e('0x47')]=function(_0x3c9da8,_0x38a796){return db[_0xc31e('0x3b')][_0xc31e('0x47')](_0x3c9da8[_0xc31e('0x46')],{'raw':![],'individualHooks':!![]})[_0xc31e('0x3c')](respondWithResult(_0x38a796,0xc9))[_0xc31e('0x40')](handleError(_0x38a796,null));};exports['update']=function(_0x4b92fe,_0x39059a){if(_0x4b92fe[_0xc31e('0x46')]['id']){delete _0x4b92fe['body']['id'];}return db[_0xc31e('0x3b')][_0xc31e('0x44')]({'where':{'id':_0x4b92fe['params']['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0x39059a,null))[_0xc31e('0x3c')](saveUpdates(_0x4b92fe[_0xc31e('0x46')],null))[_0xc31e('0x3c')](respondWithResult(_0x39059a,null))[_0xc31e('0x40')](handleError(_0x39059a,null));};exports[_0xc31e('0x21')]=function(_0x4fc1f8,_0xfe6bd4){return db['AnalyticFieldReport'][_0xc31e('0x44')]({'where':{'id':_0x4fc1f8[_0xc31e('0x42')]['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0xfe6bd4,null))['then'](removeEntity(_0xfe6bd4,null))[_0xc31e('0x40')](handleError(_0xfe6bd4,null));};exports[_0xc31e('0x48')]=function(_0x231cb6,_0x15a0bc){return db[_0xc31e('0x3b')]['destroy']({'where':{'id':_0x231cb6[_0xc31e('0x2d')][_0xc31e('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xc31e('0x3c')](respondWithResult(_0x15a0bc,0xcc))[_0xc31e('0x40')](handleError(_0x15a0bc,null));};exports[_0xc31e('0x4a')]=function(_0x4c33fc,_0x229fe6,_0x302078){return db[_0xc31e('0x4b')]['findOne']({'where':{'id':_0x4c33fc[_0xc31e('0x42')]['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0x229fe6,null))['then'](function(_0x58d559){if(_0x58d559){return db[_0xc31e('0x4c')][_0xc31e('0x4d')](function(_0x518736){return db[_0xc31e('0x3b')][_0xc31e('0x21')]({'where':{'CustomReportId':_0x4c33fc['params']['id']},'transaction':_0x518736})[_0xc31e('0x3c')](function(_0x26ae08){var _0xe240cc=_[_0xc31e('0x2b')](_0x4c33fc[_0xc31e('0x46')],function(_0x208fbb){delete _0x208fbb['id'];_0x208fbb[_0xc31e('0x4e')]=_0x4c33fc['params']['id'];return _0x208fbb;});return db['AnalyticFieldReport'][_0xc31e('0x47')](_0xe240cc,{'transaction':_0x518736});});})[_0xc31e('0x3c')](function(){return db[_0xc31e('0x3b')][_0xc31e('0x4f')]({'where':{'CustomReportId':_0x4c33fc[_0xc31e('0x42')]['id']}});});}})[_0xc31e('0x3c')](respondWithResult(_0x229fe6,null))[_0xc31e('0x40')](handleError(_0x229fe6,null));}; \ No newline at end of file +var _0xca56=['model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','bulkCreate','body','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','fieldName','key'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xca56,0x119));var _0x6ca5=function(_0x206887,_0x10d42d){_0x206887=_0x206887-0x0;var _0x2032e6=_0xca56[_0x206887];return _0x2032e6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca5('0x0'));var jsonpatch=require(_0x6ca5('0x1'));var rp=require(_0x6ca5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ca5('0x3'));var util=require(_0x6ca5('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x6ca5('0x5'));var ejs=require(_0x6ca5('0x6'));var fs=require('fs');var fs_extra=require(_0x6ca5('0x7'));var _=require('lodash');var squel=require(_0x6ca5('0x8'));var crypto=require(_0x6ca5('0x9'));var jsforce=require(_0x6ca5('0xa'));var deskjs=require(_0x6ca5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6ca5('0xc'));var Papa=require('papaparse');var Redis=require(_0x6ca5('0xd'));var authService=require(_0x6ca5('0xe'));var qs=require(_0x6ca5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca5('0x10'))(_0x6ca5('0x11'));var utils=require(_0x6ca5('0x12'));var config=require(_0x6ca5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca5('0x14'))['db'];function respondWithStatusCode(_0x2b0598,_0x11fc2b){_0x11fc2b=_0x11fc2b||0xcc;return function(_0x446d1b){if(_0x446d1b){return _0x2b0598['sendStatus'](_0x11fc2b);}return _0x2b0598[_0x6ca5('0x15')](_0x11fc2b)['end']();};}function respondWithResult(_0x3c4309,_0x378a9a){_0x378a9a=_0x378a9a||0xc8;return function(_0x1bfa37){if(_0x1bfa37){return _0x3c4309[_0x6ca5('0x15')](_0x378a9a)[_0x6ca5('0x16')](_0x1bfa37);}};}function respondWithFilteredResult(_0x2d57fa,_0x25d812){return function(_0x38417a){if(_0x38417a){var _0x3c4b5b=typeof _0x25d812[_0x6ca5('0x17')]===_0x6ca5('0x18')&&typeof _0x25d812[_0x6ca5('0x19')]==='undefined';var _0x3f4b42=_0x38417a[_0x6ca5('0x1a')];var _0x1b1530=_0x3c4b5b?0x0:_0x25d812[_0x6ca5('0x17')];var _0xe530f5=_0x3c4b5b?_0x38417a[_0x6ca5('0x1a')]:_0x25d812[_0x6ca5('0x17')]+_0x25d812[_0x6ca5('0x19')];var _0x2f7d67;if(_0xe530f5>=_0x3f4b42){_0xe530f5=_0x3f4b42;_0x2f7d67=0xc8;}else{_0x2f7d67=0xce;}_0x2d57fa[_0x6ca5('0x15')](_0x2f7d67);return _0x2d57fa[_0x6ca5('0x1b')](_0x6ca5('0x1c'),_0x1b1530+'-'+_0xe530f5+'/'+_0x3f4b42)['json'](_0x38417a);}return null;};}function patchUpdates(_0x2bcd56){return function(_0x2c9e97){try{jsonpatch[_0x6ca5('0x1d')](_0x2c9e97,_0x2bcd56,!![]);}catch(_0x35cfa0){return BPromise[_0x6ca5('0x1e')](_0x35cfa0);}return _0x2c9e97[_0x6ca5('0x1f')]();};}function saveUpdates(_0xdda910,_0x259dba){return function(_0x254d05){if(_0x254d05){return _0x254d05[_0x6ca5('0x20')](_0xdda910)[_0x6ca5('0x21')](function(_0x3e8a25){return _0x3e8a25;});}return null;};}function removeEntity(_0x1913ec,_0x17de8f){return function(_0x477888){if(_0x477888){return _0x477888['destroy']()['then'](function(){_0x1913ec[_0x6ca5('0x15')](0xcc)[_0x6ca5('0x22')]();});}};}function handleEntityNotFound(_0x47cede,_0x39d324){return function(_0x5a3311){if(!_0x5a3311){_0x47cede[_0x6ca5('0x23')](0x194);}return _0x5a3311;};}function handleError(_0x1241e7,_0x59fb57){_0x59fb57=_0x59fb57||0x1f4;return function(_0x1e1afe){logger[_0x6ca5('0x24')](_0x1e1afe[_0x6ca5('0x25')]);if(_0x1e1afe[_0x6ca5('0x26')]){delete _0x1e1afe[_0x6ca5('0x26')];}_0x1241e7[_0x6ca5('0x15')](_0x59fb57)['send'](_0x1e1afe);};}exports['index']=function(_0xcd30f3,_0x156dee){var _0x345922={},_0x456381={},_0x123e5c={'count':0x0,'rows':[]};var _0x2890cc=_['map'](db[_0x6ca5('0x27')][_0x6ca5('0x28')],function(_0x22ef40){return{'name':_0x22ef40[_0x6ca5('0x29')],'type':_0x22ef40['type'][_0x6ca5('0x2a')]};});_0x456381[_0x6ca5('0x2b')]=_[_0x6ca5('0x2c')](_0x2890cc,_0x6ca5('0x26'));_0x456381[_0x6ca5('0x2d')]=_[_0x6ca5('0x2e')](_0xcd30f3[_0x6ca5('0x2d')]);_0x456381['filters']=_[_0x6ca5('0x2f')](_0x456381[_0x6ca5('0x2b')],_0x456381[_0x6ca5('0x2d')]);_0x345922[_0x6ca5('0x30')]=_['intersection'](_0x456381[_0x6ca5('0x2b')],qs[_0x6ca5('0x31')](_0xcd30f3[_0x6ca5('0x2d')]['fields']));_0x345922['attributes']=_0x345922[_0x6ca5('0x30')][_0x6ca5('0x32')]?_0x345922[_0x6ca5('0x30')]:_0x456381['model'];if(!_0xcd30f3['query'][_0x6ca5('0x33')](_0x6ca5('0x34'))){_0x345922['limit']=qs['limit'](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x19')]);_0x345922['offset']=qs[_0x6ca5('0x17')](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x17')]);}_0x345922[_0x6ca5('0x35')]=qs[_0x6ca5('0x36')](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x36')]);_0x345922['where']=qs[_0x6ca5('0x37')](_[_0x6ca5('0x38')](_0xcd30f3[_0x6ca5('0x2d')],_0x456381[_0x6ca5('0x37')]),_0x2890cc);if(_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x39')]){_0x345922[_0x6ca5('0x3a')]=_[_0x6ca5('0x3b')](_0x345922['where'],{'$or':_['map'](_0x2890cc,function(_0x8e627e){if(_0x8e627e[_0x6ca5('0x3c')]!==_0x6ca5('0x3d')){var _0x555def={};_0x555def[_0x8e627e[_0x6ca5('0x26')]]={'$like':'%'+_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x39')]+'%'};return _0x555def;}})});}_0x345922=_[_0x6ca5('0x3b')]({},_0x345922,_0xcd30f3[_0x6ca5('0x3e')]);var _0x1b0fa9={'where':_0x345922[_0x6ca5('0x3a')]};return db[_0x6ca5('0x27')]['count'](_0x1b0fa9)[_0x6ca5('0x21')](function(_0x61f9c6){_0x123e5c[_0x6ca5('0x1a')]=_0x61f9c6;if(_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x3f')]){_0x345922[_0x6ca5('0x40')]=[{'all':!![]}];}return db[_0x6ca5('0x27')][_0x6ca5('0x41')](_0x345922);})['then'](function(_0x553904){_0x123e5c[_0x6ca5('0x42')]=_0x553904;return _0x123e5c;})[_0x6ca5('0x21')](respondWithFilteredResult(_0x156dee,_0x345922))[_0x6ca5('0x43')](handleError(_0x156dee,null));};exports[_0x6ca5('0x44')]=function(_0x4d0e52,_0x348e52){var _0x37350e={'raw':![],'where':{'id':_0x4d0e52[_0x6ca5('0x45')]['id']}},_0x2b0d1a={};_0x2b0d1a['model']=_['keys'](db[_0x6ca5('0x27')][_0x6ca5('0x28')]);_0x2b0d1a[_0x6ca5('0x2d')]=_[_0x6ca5('0x2e')](_0x4d0e52[_0x6ca5('0x2d')]);_0x2b0d1a[_0x6ca5('0x37')]=_[_0x6ca5('0x2f')](_0x2b0d1a['model'],_0x2b0d1a[_0x6ca5('0x2d')]);_0x37350e[_0x6ca5('0x30')]=_[_0x6ca5('0x2f')](_0x2b0d1a[_0x6ca5('0x2b')],qs[_0x6ca5('0x31')](_0x4d0e52[_0x6ca5('0x2d')][_0x6ca5('0x31')]));_0x37350e[_0x6ca5('0x30')]=_0x37350e['attributes'][_0x6ca5('0x32')]?_0x37350e[_0x6ca5('0x30')]:_0x2b0d1a[_0x6ca5('0x2b')];if(_0x4d0e52['query'][_0x6ca5('0x3f')]){_0x37350e[_0x6ca5('0x40')]=[{'all':!![]}];}_0x37350e=_[_0x6ca5('0x3b')]({},_0x37350e,_0x4d0e52['options']);return db[_0x6ca5('0x27')][_0x6ca5('0x46')](_0x37350e)[_0x6ca5('0x21')](handleEntityNotFound(_0x348e52,null))[_0x6ca5('0x21')](respondWithResult(_0x348e52,null))[_0x6ca5('0x43')](handleError(_0x348e52,null));};exports[_0x6ca5('0x47')]=function(_0x36c5e6,_0xdd0626){return db[_0x6ca5('0x27')]['create'](_0x36c5e6['body'],{})[_0x6ca5('0x21')](respondWithResult(_0xdd0626,0xc9))['catch'](handleError(_0xdd0626,null));};exports[_0x6ca5('0x48')]=function(_0x2e9b3f,_0x2c6c8c){return db[_0x6ca5('0x27')][_0x6ca5('0x48')](_0x2e9b3f[_0x6ca5('0x49')],{'raw':![],'individualHooks':!![]})[_0x6ca5('0x21')](respondWithResult(_0x2c6c8c,0xc9))[_0x6ca5('0x43')](handleError(_0x2c6c8c,null));};exports[_0x6ca5('0x20')]=function(_0x14f077,_0x44a908){if(_0x14f077[_0x6ca5('0x49')]['id']){delete _0x14f077['body']['id'];}return db['AnalyticFieldReport'][_0x6ca5('0x46')]({'where':{'id':_0x14f077[_0x6ca5('0x45')]['id']}})[_0x6ca5('0x21')](handleEntityNotFound(_0x44a908,null))[_0x6ca5('0x21')](saveUpdates(_0x14f077['body'],null))['then'](respondWithResult(_0x44a908,null))['catch'](handleError(_0x44a908,null));};exports[_0x6ca5('0x4a')]=function(_0x4f4ce8,_0x1c5aaa){return db[_0x6ca5('0x27')][_0x6ca5('0x46')]({'where':{'id':_0x4f4ce8['params']['id']}})['then'](handleEntityNotFound(_0x1c5aaa,null))[_0x6ca5('0x21')](removeEntity(_0x1c5aaa,null))[_0x6ca5('0x43')](handleError(_0x1c5aaa,null));};exports['bulkDestroy']=function(_0x4de63f,_0x43cc8d){return db[_0x6ca5('0x27')][_0x6ca5('0x4a')]({'where':{'id':_0x4de63f[_0x6ca5('0x2d')][_0x6ca5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x6ca5('0x21')](respondWithResult(_0x43cc8d,0xcc))['catch'](handleError(_0x43cc8d,null));};exports['addFields']=function(_0x11e8db,_0x3fb72b,_0x5a521a){return db[_0x6ca5('0x4c')][_0x6ca5('0x4d')]({'where':{'id':_0x11e8db[_0x6ca5('0x45')]['id']}})[_0x6ca5('0x21')](handleEntityNotFound(_0x3fb72b,null))[_0x6ca5('0x21')](function(_0x21a493){if(_0x21a493){return db[_0x6ca5('0x4e')][_0x6ca5('0x4f')](function(_0x12817c){return db[_0x6ca5('0x27')]['destroy']({'where':{'CustomReportId':_0x11e8db[_0x6ca5('0x45')]['id']},'transaction':_0x12817c})[_0x6ca5('0x21')](function(_0x4d8568){var _0x5bfcbb=_[_0x6ca5('0x2c')](_0x11e8db[_0x6ca5('0x49')],function(_0x4e5483){delete _0x4e5483['id'];_0x4e5483[_0x6ca5('0x50')]=_0x11e8db[_0x6ca5('0x45')]['id'];return _0x4e5483;});return db[_0x6ca5('0x27')]['bulkCreate'](_0x5bfcbb,{'transaction':_0x12817c});});})[_0x6ca5('0x21')](function(){return db[_0x6ca5('0x27')][_0x6ca5('0x41')]({'where':{'CustomReportId':_0x11e8db[_0x6ca5('0x45')]['id']}});});}})[_0x6ca5('0x21')](respondWithResult(_0x3fb72b,null))['catch'](handleError(_0x3fb72b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 7b01e65..35fa074 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6694=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0x6694,0x1a1));var _0x4669=function(_0x4be8a9,_0x47c045){_0x4be8a9=_0x4be8a9-0x0;var _0x73ccf8=_0x6694[_0x4be8a9];return _0x73ccf8;};'use strict';var _=require('lodash');var util=require(_0x4669('0x0'));var logger=require(_0x4669('0x1'))(_0x4669('0x2'));var moment=require(_0x4669('0x3'));var BPromise=require(_0x4669('0x4'));var rp=require(_0x4669('0x5'));var fs=require('fs');var path=require(_0x4669('0x6'));var rimraf=require(_0x4669('0x7'));var config=require(_0x4669('0x8'));var attributes=require(_0x4669('0x9'));module[_0x4669('0xa')]=function(_0x5961aa,_0x4200fd){return _0x5961aa[_0x4669('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x4669('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcdc=['AnalyticFieldReport','analytics_report_fields','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfcdc,0x178));var _0xcfcd=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfcdc[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xcfcd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfcd('0x1'));var moment=require(_0xcfcd('0x2'));var BPromise=require(_0xcfcd('0x3'));var rp=require(_0xcfcd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfcd('0x5'));var config=require(_0xcfcd('0x6'));var attributes=require(_0xcfcd('0x7'));module[_0xcfcd('0x8')]=function(_0xa361d5,_0x1502fa){return _0xa361d5['define'](_0xcfcd('0x9'),attributes,{'tableName':_0xcfcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 2e99cd4..a079063 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9454=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x49d0bb,_0x9206dc){var _0xf9c534=function(_0x53e76f){while(--_0x53e76f){_0x49d0bb['push'](_0x49d0bb['shift']());}};_0xf9c534(++_0x9206dc);}(_0x9454,0x1e2));var _0x4945=function(_0x5071bf,_0x82000e){_0x5071bf=_0x5071bf-0x0;var _0xc68643=_0x9454[_0x5071bf];return _0xc68643;};'use strict';var _=require(_0x4945('0x0'));var util=require(_0x4945('0x1'));var moment=require('moment');var BPromise=require(_0x4945('0x2'));var rs=require(_0x4945('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4945('0x4'))['db'];var utils=require(_0x4945('0x5'));var logger=require('../../config/logger')(_0x4945('0x6'));var config=require(_0x4945('0x7'));var jayson=require(_0x4945('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x474aa8,_0x32e4ce,_0x5d8cf2){return new BPromise(function(_0x4b8271,_0x1f1768){return client[_0x4945('0x9')](_0x474aa8,_0x5d8cf2)[_0x4945('0xa')](function(_0x68bb9b){logger[_0x4945('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x32e4ce,'request\x20sent');logger[_0x4945('0xc')](_0x4945('0xd'),_0x32e4ce,'request\x20sent',JSON[_0x4945('0xe')](_0x68bb9b));if(_0x68bb9b[_0x4945('0xf')]){if(_0x68bb9b[_0x4945('0xf')]['code']===0x1f4){logger['error'](_0x4945('0x10'),_0x32e4ce,_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);return _0x1f1768(_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);}logger[_0x4945('0xf')](_0x4945('0x10'),_0x32e4ce,_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);return _0x4b8271(_0x68bb9b['error']['message']);}else{logger[_0x4945('0xb')](_0x4945('0x10'),_0x32e4ce,_0x4945('0x12'));_0x4b8271(_0x68bb9b[_0x4945('0x13')][_0x4945('0x11')]);}})[_0x4945('0x14')](function(_0x25548b){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x32e4ce,_0x25548b);_0x1f1768(_0x25548b);});});} \ No newline at end of file +var _0x99e3=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x2db6f5,_0x49485c){var _0x2a1a93=function(_0x495873){while(--_0x495873){_0x2db6f5['push'](_0x2db6f5['shift']());}};_0x2a1a93(++_0x49485c);}(_0x99e3,0x12f));var _0x399e=function(_0x2e1ea4,_0x1181cc){_0x2e1ea4=_0x2e1ea4-0x0;var _0x39f643=_0x99e3[_0x2e1ea4];return _0x39f643;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x399e('0x0'));var BPromise=require(_0x399e('0x1'));var rs=require(_0x399e('0x2'));var fs=require('fs');var Redis=require(_0x399e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x399e('0x4'));var logger=require('../../config/logger')(_0x399e('0x5'));var config=require(_0x399e('0x6'));var jayson=require(_0x399e('0x7'));var client=jayson[_0x399e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x129ea6,_0x19e1e4,_0x3af2e6){return new BPromise(function(_0x5b45e1,_0x40ced3){return client['request'](_0x129ea6,_0x3af2e6)['then'](function(_0x435626){logger[_0x399e('0x9')](_0x399e('0xa'),_0x19e1e4,_0x399e('0xb'));logger['debug'](_0x399e('0xc'),_0x19e1e4,_0x399e('0xb'),JSON[_0x399e('0xd')](_0x435626));if(_0x435626[_0x399e('0xe')]){if(_0x435626['error'][_0x399e('0xf')]===0x1f4){logger['error'](_0x399e('0xa'),_0x19e1e4,_0x435626['error']['message']);return _0x40ced3(_0x435626[_0x399e('0xe')][_0x399e('0x10')]);}logger[_0x399e('0xe')](_0x399e('0xa'),_0x19e1e4,_0x435626[_0x399e('0xe')]['message']);return _0x5b45e1(_0x435626[_0x399e('0xe')][_0x399e('0x10')]);}else{logger[_0x399e('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x19e1e4,'request\x20sent');_0x5b45e1(_0x435626[_0x399e('0x11')][_0x399e('0x10')]);}})[_0x399e('0x12')](function(_0x2c2a45){logger[_0x399e('0xe')](_0x399e('0xa'),_0x19e1e4,_0x2c2a45);_0x40ced3(_0x2c2a45);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 9840e20..87099c2 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4039b2,_0x3c25bf){var _0x3f0ca8=function(_0x5e6d20){while(--_0x5e6d20){_0x4039b2['push'](_0x4039b2['shift']());}};_0x3f0ca8(++_0x3c25bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4db06e,_0x218860){var _0x3c32a6=function(_0x1b95d8){while(--_0x1b95d8){_0x4db06e['push'](_0x4db06e['shift']());}};_0x3c32a6(++_0x218860);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index f2157c0..92553af 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a79=['TEXT','exports','STRING'];(function(_0x5b6356,_0x388828){var _0x3d0cbf=function(_0x3564ce){while(--_0x3564ce){_0x5b6356['push'](_0x5b6356['shift']());}};_0x3d0cbf(++_0x388828);}(_0x3a79,0xca));var _0x93a7=function(_0x50547c,_0x3bfef0){_0x50547c=_0x50547c-0x0;var _0x4a3b93=_0x3a79[_0x50547c];return _0x4a3b93;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x93a7('0x1')]},'metric':{'type':Sequelize[_0x93a7('0x2')]},'description':{'type':Sequelize[_0x93a7('0x1')]}}; \ No newline at end of file +var _0x32d5=['TEXT','sequelize','exports','STRING','name'];(function(_0x3fdd6a,_0x3f1222){var _0x23694a=function(_0x496dde){while(--_0x496dde){_0x3fdd6a['push'](_0x3fdd6a['shift']());}};_0x23694a(++_0x3f1222);}(_0x32d5,0x1aa));var _0x532d=function(_0x12e5d9,_0x28bced){_0x12e5d9=_0x12e5d9-0x0;var _0x46a7b1=_0x32d5[_0x12e5d9];return _0x46a7b1;};'use strict';var Sequelize=require(_0x532d('0x0'));module[_0x532d('0x1')]={'name':{'type':Sequelize[_0x532d('0x2')],'allowNull':![],'unique':_0x532d('0x3')},'table':{'type':Sequelize[_0x532d('0x2')]},'metric':{'type':Sequelize[_0x532d('0x4')]},'description':{'type':Sequelize[_0x532d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index efd16d3..2cc7735 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x532d72,_0x5ae436){var _0x415525=function(_0x2e569a){while(--_0x2e569a){_0x532d72['push'](_0x532d72['shift']());}};_0x415525(++_0x5ae436);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file +var _0x9957=['fs-extra','lodash','squel','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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e21a8bc..bbd55f3 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe574=['../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe574,0x100));var _0x4e57=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe574[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4e57('0x0'));var util=require('util');var logger=require(_0x4e57('0x1'))(_0x4e57('0x2'));var moment=require(_0x4e57('0x3'));var BPromise=require(_0x4e57('0x4'));var rp=require(_0x4e57('0x5'));var fs=require('fs');var path=require(_0x4e57('0x6'));var rimraf=require(_0x4e57('0x7'));var config=require(_0x4e57('0x8'));var attributes=require(_0x4e57('0x9'));module[_0x4e57('0xa')]=function(_0x436174,_0x2825a9){return _0x436174['define']('AnalyticMetric',attributes,{'tableName':_0x4e57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24ce=['analytics_metrics','util','../../config/logger','api','moment','path','./analyticMetric.attributes','exports','define'];(function(_0x18c657,_0x4c1b87){var _0x298ed2=function(_0x220442){while(--_0x220442){_0x18c657['push'](_0x18c657['shift']());}};_0x298ed2(++_0x4c1b87);}(_0x24ce,0x1de));var _0xe24c=function(_0x1f0365,_0x38560c){_0x1f0365=_0x1f0365-0x0;var _0x54d0c7=_0x24ce[_0x1f0365];return _0x54d0c7;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var logger=require(_0xe24c('0x1'))(_0xe24c('0x2'));var moment=require(_0xe24c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe24c('0x5'));module[_0xe24c('0x6')]=function(_0x6f92e0,_0x1ac59c){return _0x6f92e0[_0xe24c('0x7')]('AnalyticMetric',attributes,{'tableName':_0xe24c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 4617076..431969d 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8d6=['catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c24df,_0x2e46a3){var _0x309b15=function(_0x5d525b){while(--_0x5d525b){_0x2c24df['push'](_0x2c24df['shift']());}};_0x309b15(++_0x2e46a3);}(_0xa8d6,0x144));var _0x6a8d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa8d6[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x6a8d('0x0'));var moment=require('moment');var BPromise=require(_0x6a8d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a8d('0x2'));var db=require(_0x6a8d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a8d('0x4'))(_0x6a8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x6a8d('0x6'));var client=jayson[_0x6a8d('0x7')][_0x6a8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39bece,_0x18abf,_0x2e02f6){return new BPromise(function(_0x2456bf,_0x559076){return client['request'](_0x39bece,_0x2e02f6)['then'](function(_0xab9ba){logger[_0x6a8d('0x9')](_0x6a8d('0xa'),_0x18abf,_0x6a8d('0xb'));logger['debug'](_0x6a8d('0xc'),_0x18abf,_0x6a8d('0xb'),JSON[_0x6a8d('0xd')](_0xab9ba));if(_0xab9ba[_0x6a8d('0xe')]){if(_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0xf')]===0x1f4){logger[_0x6a8d('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x18abf,_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0x10')]);return _0x559076(_0xab9ba[_0x6a8d('0xe')]['message']);}logger[_0x6a8d('0xe')](_0x6a8d('0xa'),_0x18abf,_0xab9ba[_0x6a8d('0xe')]['message']);return _0x2456bf(_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0x10')]);}else{logger[_0x6a8d('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x18abf,_0x6a8d('0xb'));_0x2456bf(_0xab9ba[_0x6a8d('0x11')][_0x6a8d('0x10')]);}})[_0x6a8d('0x12')](function(_0x5d8c3c){logger['error'](_0x6a8d('0xa'),_0x18abf,_0x5d8c3c);_0x559076(_0x5d8c3c);});});} \ No newline at end of file +var _0x5a74=['request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x299214,_0x2bab88){var _0x4d89c1=function(_0x34a13b){while(--_0x34a13b){_0x299214['push'](_0x299214['shift']());}};_0x4d89c1(++_0x2bab88);}(_0x5a74,0xfd));var _0x45a7=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0x5a74[_0x2d0953];return _0x1e824a;};'use strict';var _=require(_0x45a7('0x0'));var util=require(_0x45a7('0x1'));var moment=require(_0x45a7('0x2'));var BPromise=require(_0x45a7('0x3'));var rs=require(_0x45a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x45a7('0x5'));var logger=require(_0x45a7('0x6'))('rpc');var config=require(_0x45a7('0x7'));var jayson=require(_0x45a7('0x8'));var client=jayson[_0x45a7('0x9')][_0x45a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1246d4,_0x320863,_0x17abb6){return new BPromise(function(_0x1c4b89,_0x16665a){return client[_0x45a7('0xb')](_0x1246d4,_0x17abb6)[_0x45a7('0xc')](function(_0x450e04){logger['info'](_0x45a7('0xd'),_0x320863,_0x45a7('0xe'));logger[_0x45a7('0xf')](_0x45a7('0x10'),_0x320863,_0x45a7('0xe'),JSON[_0x45a7('0x11')](_0x450e04));if(_0x450e04[_0x45a7('0x12')]){if(_0x450e04[_0x45a7('0x12')][_0x45a7('0x13')]===0x1f4){logger[_0x45a7('0x12')](_0x45a7('0xd'),_0x320863,_0x450e04[_0x45a7('0x12')][_0x45a7('0x14')]);return _0x16665a(_0x450e04['error'][_0x45a7('0x14')]);}logger[_0x45a7('0x12')](_0x45a7('0xd'),_0x320863,_0x450e04[_0x45a7('0x12')][_0x45a7('0x14')]);return _0x1c4b89(_0x450e04['error'][_0x45a7('0x14')]);}else{logger[_0x45a7('0x15')](_0x45a7('0xd'),_0x320863,_0x45a7('0xe'));_0x1c4b89(_0x450e04[_0x45a7('0x16')][_0x45a7('0x14')]);}})[_0x45a7('0x17')](function(_0x337669){logger[_0x45a7('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x320863,_0x337669);_0x16665a(_0x337669);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0411ab3..52e5ae8 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92bc=['/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4db561,_0x521d0d){var _0x299980=function(_0x56f5c1){while(--_0x56f5c1){_0x4db561['push'](_0x4db561['shift']());}};_0x299980(++_0x521d0d);}(_0x92bc,0x106));var _0xc92b=function(_0x180ec6,_0x2c8b69){_0x180ec6=_0x180ec6-0x0;var _0xb7ca0d=_0x92bc[_0x180ec6];return _0xb7ca0d;};'use strict';var multer=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc92b('0x3')]();var fs_extra=require(_0xc92b('0x4'));var auth=require(_0xc92b('0x5'));var interaction=require(_0xc92b('0x6'));var config=require('../../config/environment');var controller=require(_0xc92b('0x7'));router[_0xc92b('0x8')]('/',auth[_0xc92b('0x9')](),controller['index']);router['get'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['show']);router[_0xc92b('0xb')]('/',auth[_0xc92b('0x9')](),controller[_0xc92b('0xc')]);router['put'](_0xc92b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc92b('0xd')]('/:id',auth[_0xc92b('0x9')](),controller[_0xc92b('0xe')]);module[_0xc92b('0xf')]=router; \ No newline at end of file +var _0x1134=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xf840f7,_0x29fe47){var _0x3e27b0=function(_0x320e7e){while(--_0x320e7e){_0xf840f7['push'](_0xf840f7['shift']());}};_0x3e27b0(++_0x29fe47);}(_0x1134,0x19c));var _0x4113=function(_0x2cfe7e,_0x151321){_0x2cfe7e=_0x2cfe7e-0x0;var _0x467836=_0x1134[_0x2cfe7e];return _0x467836;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./analyticMetric.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0xe')](_0x4113('0x9'),auth['isAuthenticated'](),controller[_0x4113('0xf')]);router[_0x4113('0x10')](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0x11')]);module[_0x4113('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index aa86a3c..ec1755a 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x138a=['exports','sequelize'];(function(_0x1b5c51,_0x3dd1c2){var _0x58d6ab=function(_0x491494){while(--_0x491494){_0x1b5c51['push'](_0x1b5c51['shift']());}};_0x58d6ab(++_0x3dd1c2);}(_0x138a,0x19f));var _0xa138=function(_0x1533f7,_0x1a338a){_0x1533f7=_0x1533f7-0x0;var _0x38e1f9=_0x138a[_0x1533f7];return _0x38e1f9;};'use strict';var Sequelize=require(_0xa138('0x0'));module[_0xa138('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x1e31=['sequelize','exports','TEXT'];(function(_0x4c8cf2,_0x93c235){var _0xc0237d=function(_0x409871){while(--_0x409871){_0x4c8cf2['push'](_0x4c8cf2['shift']());}};_0xc0237d(++_0x93c235);}(_0x1e31,0x1dd));var _0x11e3=function(_0x3573b2,_0x37b3ec){_0x3573b2=_0x3573b2-0x0;var _0x2494a4=_0x1e31[_0x3573b2];return _0x2494a4;};'use strict';var Sequelize=require(_0x11e3('0x0'));module[_0x11e3('0x1')]={'tree':{'type':Sequelize[_0x11e3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4766cf5..c9d6bf6 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa6c=['attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','catch','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xaa6c,0x17a));var _0xcaa6=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xaa6c[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0xcaa6('0x0'));var rimraf=require(_0xcaa6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaa6('0x2'));var rp=require(_0xcaa6('0x3'));var moment=require(_0xcaa6('0x4'));var BPromise=require(_0xcaa6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcaa6('0x6'));var csv=require(_0xcaa6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa6('0x8'));var squel=require(_0xcaa6('0x9'));var crypto=require(_0xcaa6('0xa'));var jsforce=require(_0xcaa6('0xb'));var deskjs=require(_0xcaa6('0xc'));var toCsv=require(_0xcaa6('0x7'));var querystring=require('querystring');var Papa=require(_0xcaa6('0xd'));var Redis=require(_0xcaa6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcaa6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcaa6('0x10'));var logger=require(_0xcaa6('0x11'))('api');var utils=require(_0xcaa6('0x12'));var config=require(_0xcaa6('0x13'));var licenseUtil=require(_0xcaa6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf3506,_0x297066){_0x297066=_0x297066||0xcc;return function(_0x27daf1){if(_0x27daf1){return _0xcf3506[_0xcaa6('0x15')](_0x297066);}return _0xcf3506[_0xcaa6('0x16')](_0x297066)['end']();};}function respondWithResult(_0x53c375,_0x4827f7){_0x4827f7=_0x4827f7||0xc8;return function(_0x2548ed){if(_0x2548ed){return _0x53c375[_0xcaa6('0x16')](_0x4827f7)[_0xcaa6('0x17')](_0x2548ed);}};}function respondWithFilteredResult(_0x2110d0,_0x2915d6){return function(_0x11814a){if(_0x11814a){var _0x4c67a8=typeof _0x2915d6[_0xcaa6('0x18')]===_0xcaa6('0x19')&&typeof _0x2915d6['limit']==='undefined';var _0x2fa950=_0x11814a['count'];var _0x4e1eb5=_0x4c67a8?0x0:_0x2915d6['offset'];var _0x4732f9=_0x4c67a8?_0x11814a[_0xcaa6('0x1a')]:_0x2915d6[_0xcaa6('0x18')]+_0x2915d6['limit'];var _0x2378ac;if(_0x4732f9>=_0x2fa950){_0x4732f9=_0x2fa950;_0x2378ac=0xc8;}else{_0x2378ac=0xce;}_0x2110d0[_0xcaa6('0x16')](_0x2378ac);return _0x2110d0[_0xcaa6('0x1b')](_0xcaa6('0x1c'),_0x4e1eb5+'-'+_0x4732f9+'/'+_0x2fa950)[_0xcaa6('0x17')](_0x11814a);}return null;};}function patchUpdates(_0x4eaab3){return function(_0x26e60c){try{jsonpatch['apply'](_0x26e60c,_0x4eaab3,!![]);}catch(_0x5921ee){return BPromise[_0xcaa6('0x1d')](_0x5921ee);}return _0x26e60c[_0xcaa6('0x1e')]();};}function saveUpdates(_0x6818ed,_0x3e788d){return function(_0x108944){if(_0x108944){return _0x108944[_0xcaa6('0x1f')](_0x6818ed)[_0xcaa6('0x20')](function(_0x5271eb){return _0x5271eb;});}return null;};}function removeEntity(_0x5d510a,_0x5567bb){return function(_0x4086e3){if(_0x4086e3){return _0x4086e3[_0xcaa6('0x21')]()[_0xcaa6('0x20')](function(){_0x5d510a[_0xcaa6('0x16')](0xcc)[_0xcaa6('0x22')]();});}};}function handleEntityNotFound(_0x4a776e,_0x534229){return function(_0x1af403){if(!_0x1af403){_0x4a776e[_0xcaa6('0x15')](0x194);}return _0x1af403;};}function handleError(_0x26d6f6,_0x113160){_0x113160=_0x113160||0x1f4;return function(_0x3653ca){logger['error'](_0x3653ca[_0xcaa6('0x23')]);if(_0x3653ca[_0xcaa6('0x24')]){delete _0x3653ca[_0xcaa6('0x24')];}_0x26d6f6['status'](_0x113160)[_0xcaa6('0x25')](_0x3653ca);};}exports['index']=function(_0xda11af,_0xeac590){var _0x222cfc={},_0x189ec9={},_0x338ed1={'count':0x0,'rows':[]};var _0x4dfbe6=_[_0xcaa6('0x26')](db[_0xcaa6('0x27')][_0xcaa6('0x28')],function(_0x361fa1){return{'name':_0x361fa1[_0xcaa6('0x29')],'type':_0x361fa1[_0xcaa6('0x2a')][_0xcaa6('0x2b')]};});_0x189ec9[_0xcaa6('0x2c')]=_[_0xcaa6('0x26')](_0x4dfbe6,_0xcaa6('0x24'));_0x189ec9[_0xcaa6('0x2d')]=_[_0xcaa6('0x2e')](_0xda11af[_0xcaa6('0x2d')]);_0x189ec9[_0xcaa6('0x2f')]=_['intersection'](_0x189ec9['model'],_0x189ec9[_0xcaa6('0x2d')]);_0x222cfc[_0xcaa6('0x30')]=_[_0xcaa6('0x31')](_0x189ec9[_0xcaa6('0x2c')],qs[_0xcaa6('0x32')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x32')]));_0x222cfc[_0xcaa6('0x30')]=_0x222cfc[_0xcaa6('0x30')][_0xcaa6('0x33')]?_0x222cfc['attributes']:_0x189ec9[_0xcaa6('0x2c')];if(!_0xda11af[_0xcaa6('0x2d')]['hasOwnProperty'](_0xcaa6('0x34'))){_0x222cfc['limit']=qs[_0xcaa6('0x35')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x35')]);_0x222cfc['offset']=qs[_0xcaa6('0x18')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x18')]);}_0x222cfc[_0xcaa6('0x36')]=qs[_0xcaa6('0x37')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x37')]);_0x222cfc[_0xcaa6('0x38')]=qs[_0xcaa6('0x2f')](_[_0xcaa6('0x39')](_0xda11af[_0xcaa6('0x2d')],_0x189ec9[_0xcaa6('0x2f')]),_0x4dfbe6);if(_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3a')]){_0x222cfc[_0xcaa6('0x38')]=_[_0xcaa6('0x3b')](_0x222cfc[_0xcaa6('0x38')],{'$or':_[_0xcaa6('0x26')](_0x4dfbe6,function(_0x14af9f){if(_0x14af9f[_0xcaa6('0x2a')]!==_0xcaa6('0x3c')){var _0x2fee8e={};_0x2fee8e[_0x14af9f[_0xcaa6('0x24')]]={'$like':'%'+_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3a')]+'%'};return _0x2fee8e;}})});}_0x222cfc=_['merge']({},_0x222cfc,_0xda11af[_0xcaa6('0x3d')]);var _0x1b6473={'where':_0x222cfc['where']};return db[_0xcaa6('0x27')][_0xcaa6('0x1a')](_0x1b6473)[_0xcaa6('0x20')](function(_0x2a3b4c){_0x338ed1[_0xcaa6('0x1a')]=_0x2a3b4c;if(_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3e')]){_0x222cfc[_0xcaa6('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xcaa6('0x40')](_0x222cfc);})[_0xcaa6('0x20')](function(_0x297780){_0x338ed1['rows']=_0x297780;return _0x338ed1;})[_0xcaa6('0x20')](respondWithFilteredResult(_0xeac590,_0x222cfc))['catch'](handleError(_0xeac590,null));};exports[_0xcaa6('0x41')]=function(_0x1bf756,_0x2af87f){var _0x3068d9={'raw':!![],'where':{'id':_0x1bf756['params']['id']}},_0x4bd3ec={};_0x4bd3ec[_0xcaa6('0x2c')]=_[_0xcaa6('0x2e')](db['AnalyticTreeReport'][_0xcaa6('0x28')]);_0x4bd3ec[_0xcaa6('0x2d')]=_[_0xcaa6('0x2e')](_0x1bf756[_0xcaa6('0x2d')]);_0x4bd3ec[_0xcaa6('0x2f')]=_[_0xcaa6('0x31')](_0x4bd3ec[_0xcaa6('0x2c')],_0x4bd3ec[_0xcaa6('0x2d')]);_0x3068d9['attributes']=_[_0xcaa6('0x31')](_0x4bd3ec[_0xcaa6('0x2c')],qs['fields'](_0x1bf756[_0xcaa6('0x2d')][_0xcaa6('0x32')]));_0x3068d9['attributes']=_0x3068d9[_0xcaa6('0x30')][_0xcaa6('0x33')]?_0x3068d9[_0xcaa6('0x30')]:_0x4bd3ec[_0xcaa6('0x2c')];if(_0x1bf756[_0xcaa6('0x2d')]['includeAll']){_0x3068d9[_0xcaa6('0x3f')]=[{'all':!![]}];}_0x3068d9=_[_0xcaa6('0x3b')]({},_0x3068d9,_0x1bf756[_0xcaa6('0x3d')]);return db[_0xcaa6('0x27')][_0xcaa6('0x42')](_0x3068d9)['then'](handleEntityNotFound(_0x2af87f,null))[_0xcaa6('0x20')](respondWithResult(_0x2af87f,null))['catch'](handleError(_0x2af87f,null));};exports[_0xcaa6('0x43')]=function(_0x4f2d02,_0xdbf79a){return db[_0xcaa6('0x27')][_0xcaa6('0x43')](_0x4f2d02[_0xcaa6('0x44')],{})['then'](respondWithResult(_0xdbf79a,0xc9))[_0xcaa6('0x45')](handleError(_0xdbf79a,null));};exports[_0xcaa6('0x1f')]=function(_0x43ffb6,_0x468fc6){if(_0x43ffb6[_0xcaa6('0x44')]['id']){delete _0x43ffb6['body']['id'];}return db[_0xcaa6('0x27')][_0xcaa6('0x42')]({'where':{'id':_0x43ffb6[_0xcaa6('0x46')]['id']}})[_0xcaa6('0x20')](handleEntityNotFound(_0x468fc6,null))[_0xcaa6('0x20')](saveUpdates(_0x43ffb6[_0xcaa6('0x44')],null))['then'](respondWithResult(_0x468fc6,null))[_0xcaa6('0x45')](handleError(_0x468fc6,null));};exports[_0xcaa6('0x21')]=function(_0x329812,_0x79f88c){return db[_0xcaa6('0x27')][_0xcaa6('0x42')]({'where':{'id':_0x329812[_0xcaa6('0x46')]['id']}})[_0xcaa6('0x20')](handleEntityNotFound(_0x79f88c,null))[_0xcaa6('0x20')](removeEntity(_0x79f88c,null))['catch'](handleError(_0x79f88c,null));}; \ No newline at end of file +var _0xc82a=['VIRTUAL','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x42fddd,_0xd397da){var _0x5b763d=function(_0xf19854){while(--_0xf19854){_0x42fddd['push'](_0x42fddd['shift']());}};_0x5b763d(++_0xd397da);}(_0xc82a,0xa9));var _0xac82=function(_0x332985,_0x216420){_0x332985=_0x332985-0x0;var _0x1a77c1=_0xc82a[_0x332985];return _0x1a77c1;};'use strict';var emlformat=require(_0xac82('0x0'));var rimraf=require(_0xac82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac82('0x2'));var rp=require(_0xac82('0x3'));var moment=require(_0xac82('0x4'));var BPromise=require(_0xac82('0x5'));var Mustache=require('mustache');var util=require(_0xac82('0x6'));var path=require(_0xac82('0x7'));var sox=require(_0xac82('0x8'));var csv=require('to-csv');var ejs=require(_0xac82('0x9'));var fs=require('fs');var fs_extra=require(_0xac82('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac82('0xc'));var querystring=require(_0xac82('0xd'));var Papa=require(_0xac82('0xe'));var Redis=require(_0xac82('0xf'));var authService=require(_0xac82('0x10'));var qs=require(_0xac82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac82('0x12'));var logger=require(_0xac82('0x13'))('api');var utils=require(_0xac82('0x14'));var config=require(_0xac82('0x15'));var licenseUtil=require(_0xac82('0x16'));var db=require(_0xac82('0x17'))['db'];function respondWithStatusCode(_0x589e00,_0x4662cb){_0x4662cb=_0x4662cb||0xcc;return function(_0x21ffa3){if(_0x21ffa3){return _0x589e00[_0xac82('0x18')](_0x4662cb);}return _0x589e00['status'](_0x4662cb)[_0xac82('0x19')]();};}function respondWithResult(_0x38b393,_0x4f3e9a){_0x4f3e9a=_0x4f3e9a||0xc8;return function(_0x23a18e){if(_0x23a18e){return _0x38b393[_0xac82('0x1a')](_0x4f3e9a)[_0xac82('0x1b')](_0x23a18e);}};}function respondWithFilteredResult(_0x127d72,_0x277fa2){return function(_0x442ce8){if(_0x442ce8){var _0x528dcb=typeof _0x277fa2[_0xac82('0x1c')]===_0xac82('0x1d')&&typeof _0x277fa2[_0xac82('0x1e')]===_0xac82('0x1d');var _0x4133ed=_0x442ce8[_0xac82('0x1f')];var _0x1c25c1=_0x528dcb?0x0:_0x277fa2['offset'];var _0x276894=_0x528dcb?_0x442ce8[_0xac82('0x1f')]:_0x277fa2[_0xac82('0x1c')]+_0x277fa2[_0xac82('0x1e')];var _0x30b400;if(_0x276894>=_0x4133ed){_0x276894=_0x4133ed;_0x30b400=0xc8;}else{_0x30b400=0xce;}_0x127d72[_0xac82('0x1a')](_0x30b400);return _0x127d72[_0xac82('0x20')](_0xac82('0x21'),_0x1c25c1+'-'+_0x276894+'/'+_0x4133ed)[_0xac82('0x1b')](_0x442ce8);}return null;};}function patchUpdates(_0x27da3b){return function(_0x581196){try{jsonpatch[_0xac82('0x22')](_0x581196,_0x27da3b,!![]);}catch(_0x2f807a){return BPromise['reject'](_0x2f807a);}return _0x581196[_0xac82('0x23')]();};}function saveUpdates(_0x4692f9,_0x16f39f){return function(_0xa9e3fc){if(_0xa9e3fc){return _0xa9e3fc[_0xac82('0x24')](_0x4692f9)[_0xac82('0x25')](function(_0x1bf348){return _0x1bf348;});}return null;};}function removeEntity(_0x3e52e4,_0x44ce12){return function(_0x259878){if(_0x259878){return _0x259878['destroy']()['then'](function(){_0x3e52e4[_0xac82('0x1a')](0xcc)[_0xac82('0x19')]();});}};}function handleEntityNotFound(_0x55f062,_0x225251){return function(_0x198c59){if(!_0x198c59){_0x55f062[_0xac82('0x18')](0x194);}return _0x198c59;};}function handleError(_0x5f461d,_0x48da25){_0x48da25=_0x48da25||0x1f4;return function(_0x321d76){logger[_0xac82('0x26')](_0x321d76[_0xac82('0x27')]);if(_0x321d76[_0xac82('0x28')]){delete _0x321d76[_0xac82('0x28')];}_0x5f461d['status'](_0x48da25)[_0xac82('0x29')](_0x321d76);};}exports[_0xac82('0x2a')]=function(_0x303f62,_0x4145e7){var _0x2c51ca={},_0x11a738={},_0x1e116d={'count':0x0,'rows':[]};var _0x3c1c7f=_[_0xac82('0x2b')](db['AnalyticTreeReport']['rawAttributes'],function(_0x469102){return{'name':_0x469102['fieldName'],'type':_0x469102[_0xac82('0x2c')]['key']};});_0x11a738['model']=_[_0xac82('0x2b')](_0x3c1c7f,_0xac82('0x28'));_0x11a738[_0xac82('0x2d')]=_[_0xac82('0x2e')](_0x303f62[_0xac82('0x2d')]);_0x11a738[_0xac82('0x2f')]=_[_0xac82('0x30')](_0x11a738[_0xac82('0x31')],_0x11a738[_0xac82('0x2d')]);_0x2c51ca[_0xac82('0x32')]=_[_0xac82('0x30')](_0x11a738['model'],qs[_0xac82('0x33')](_0x303f62[_0xac82('0x2d')][_0xac82('0x33')]));_0x2c51ca[_0xac82('0x32')]=_0x2c51ca[_0xac82('0x32')]['length']?_0x2c51ca['attributes']:_0x11a738[_0xac82('0x31')];if(!_0x303f62[_0xac82('0x2d')][_0xac82('0x34')](_0xac82('0x35'))){_0x2c51ca[_0xac82('0x1e')]=qs[_0xac82('0x1e')](_0x303f62[_0xac82('0x2d')][_0xac82('0x1e')]);_0x2c51ca[_0xac82('0x1c')]=qs[_0xac82('0x1c')](_0x303f62[_0xac82('0x2d')][_0xac82('0x1c')]);}_0x2c51ca[_0xac82('0x36')]=qs[_0xac82('0x37')](_0x303f62['query'][_0xac82('0x37')]);_0x2c51ca['where']=qs[_0xac82('0x2f')](_[_0xac82('0x38')](_0x303f62[_0xac82('0x2d')],_0x11a738[_0xac82('0x2f')]),_0x3c1c7f);if(_0x303f62[_0xac82('0x2d')][_0xac82('0x39')]){_0x2c51ca[_0xac82('0x3a')]=_['merge'](_0x2c51ca[_0xac82('0x3a')],{'$or':_[_0xac82('0x2b')](_0x3c1c7f,function(_0xc646ff){if(_0xc646ff['type']!==_0xac82('0x3b')){var _0x2fae9c={};_0x2fae9c[_0xc646ff[_0xac82('0x28')]]={'$like':'%'+_0x303f62[_0xac82('0x2d')][_0xac82('0x39')]+'%'};return _0x2fae9c;}})});}_0x2c51ca=_['merge']({},_0x2c51ca,_0x303f62[_0xac82('0x3c')]);var _0x498dba={'where':_0x2c51ca[_0xac82('0x3a')]};return db['AnalyticTreeReport'][_0xac82('0x1f')](_0x498dba)[_0xac82('0x25')](function(_0x1e5742){_0x1e116d[_0xac82('0x1f')]=_0x1e5742;if(_0x303f62[_0xac82('0x2d')][_0xac82('0x3d')]){_0x2c51ca[_0xac82('0x3e')]=[{'all':!![]}];}return db[_0xac82('0x3f')][_0xac82('0x40')](_0x2c51ca);})[_0xac82('0x25')](function(_0x3c3f03){_0x1e116d[_0xac82('0x41')]=_0x3c3f03;return _0x1e116d;})['then'](respondWithFilteredResult(_0x4145e7,_0x2c51ca))[_0xac82('0x42')](handleError(_0x4145e7,null));};exports[_0xac82('0x43')]=function(_0x558a3b,_0x57f86b){var _0x16a17d={'raw':!![],'where':{'id':_0x558a3b[_0xac82('0x44')]['id']}},_0x48642a={};_0x48642a[_0xac82('0x31')]=_[_0xac82('0x2e')](db[_0xac82('0x3f')][_0xac82('0x45')]);_0x48642a[_0xac82('0x2d')]=_['keys'](_0x558a3b['query']);_0x48642a['filters']=_[_0xac82('0x30')](_0x48642a[_0xac82('0x31')],_0x48642a[_0xac82('0x2d')]);_0x16a17d[_0xac82('0x32')]=_['intersection'](_0x48642a[_0xac82('0x31')],qs[_0xac82('0x33')](_0x558a3b[_0xac82('0x2d')][_0xac82('0x33')]));_0x16a17d[_0xac82('0x32')]=_0x16a17d[_0xac82('0x32')][_0xac82('0x46')]?_0x16a17d['attributes']:_0x48642a[_0xac82('0x31')];if(_0x558a3b[_0xac82('0x2d')][_0xac82('0x3d')]){_0x16a17d[_0xac82('0x3e')]=[{'all':!![]}];}_0x16a17d=_[_0xac82('0x47')]({},_0x16a17d,_0x558a3b[_0xac82('0x3c')]);return db[_0xac82('0x3f')][_0xac82('0x48')](_0x16a17d)['then'](handleEntityNotFound(_0x57f86b,null))[_0xac82('0x25')](respondWithResult(_0x57f86b,null))['catch'](handleError(_0x57f86b,null));};exports[_0xac82('0x49')]=function(_0x1eae80,_0x229b5b){return db[_0xac82('0x3f')][_0xac82('0x49')](_0x1eae80['body'],{})['then'](respondWithResult(_0x229b5b,0xc9))[_0xac82('0x42')](handleError(_0x229b5b,null));};exports[_0xac82('0x24')]=function(_0x3f44fb,_0x426151){if(_0x3f44fb[_0xac82('0x4a')]['id']){delete _0x3f44fb['body']['id'];}return db[_0xac82('0x3f')][_0xac82('0x48')]({'where':{'id':_0x3f44fb[_0xac82('0x44')]['id']}})[_0xac82('0x25')](handleEntityNotFound(_0x426151,null))[_0xac82('0x25')](saveUpdates(_0x3f44fb[_0xac82('0x4a')],null))[_0xac82('0x25')](respondWithResult(_0x426151,null))[_0xac82('0x42')](handleError(_0x426151,null));};exports[_0xac82('0x4b')]=function(_0x4e8aa4,_0x48bd37){return db['AnalyticTreeReport'][_0xac82('0x48')]({'where':{'id':_0x4e8aa4[_0xac82('0x44')]['id']}})['then'](handleEntityNotFound(_0x48bd37,null))[_0xac82('0x25')](removeEntity(_0x48bd37,null))[_0xac82('0x42')](handleError(_0x48bd37,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 64c9803..9324408 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4968=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b0fd6,_0x51a24c){var _0x2f6b80=function(_0x54e710){while(--_0x54e710){_0x5b0fd6['push'](_0x5b0fd6['shift']());}};_0x2f6b80(++_0x51a24c);}(_0x4968,0x13d));var _0x8496=function(_0x1e11e9,_0x42df78){_0x1e11e9=_0x1e11e9-0x0;var _0x3e10b8=_0x4968[_0x1e11e9];return _0x3e10b8;};'use strict';var _=require(_0x8496('0x0'));var util=require(_0x8496('0x1'));var logger=require(_0x8496('0x2'))(_0x8496('0x3'));var moment=require(_0x8496('0x4'));var BPromise=require(_0x8496('0x5'));var rp=require(_0x8496('0x6'));var fs=require('fs');var path=require(_0x8496('0x7'));var rimraf=require(_0x8496('0x8'));var config=require(_0x8496('0x9'));var attributes=require(_0x8496('0xa'));module[_0x8496('0xb')]=function(_0x104025,_0x37e8b8){return _0x104025[_0x8496('0xc')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5ba=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5799ad,_0x8cf2fe){var _0x4b26fa=function(_0x17b8dd){while(--_0x17b8dd){_0x5799ad['push'](_0x5799ad['shift']());}};_0x4b26fa(++_0x8cf2fe);}(_0xa5ba,0x1d9));var _0xaa5b=function(_0x32d0c5,_0x339ced){_0x32d0c5=_0x32d0c5-0x0;var _0x99e80=_0xa5ba[_0x32d0c5];return _0x99e80;};'use strict';var _=require('lodash');var util=require(_0xaa5b('0x0'));var logger=require(_0xaa5b('0x1'))(_0xaa5b('0x2'));var moment=require(_0xaa5b('0x3'));var BPromise=require(_0xaa5b('0x4'));var rp=require(_0xaa5b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa5b('0x6'));var config=require(_0xaa5b('0x7'));var attributes=require(_0xaa5b('0x8'));module[_0xaa5b('0x9')]=function(_0x54dd33,_0x3d846e){return _0x54dd33[_0xaa5b('0xa')](_0xaa5b('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index cd72dd3..57ef74a 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2dd8b1,_0xbfeabb){var _0x5f1eac=function(_0x32ac04){while(--_0x32ac04){_0x2dd8b1['push'](_0x2dd8b1['shift']());}};_0x5f1eac(++_0xbfeabb);}(_0x1261,0x144));var _0x1126=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0x1261[_0x43d604];return _0x2f0f74;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x59de2a,_0x264f62){var _0x1d18d2=function(_0x5c1a5a){while(--_0x5c1a5a){_0x59de2a['push'](_0x59de2a['shift']());}};_0x1d18d2(++_0x264f62);}(_0xadb5,0xad));var _0x5adb=function(_0x49a0ae,_0x1a4959){_0x49a0ae=_0x49a0ae-0x0;var _0x454b05=_0xadb5[_0x49a0ae];return _0x454b05;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e0cb398..0723158 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb51e=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3132dd,_0x20d1ed){var _0x23a4a1=function(_0x2a78f1){while(--_0x2a78f1){_0x3132dd['push'](_0x3132dd['shift']());}};_0x23a4a1(++_0x20d1ed);}(_0xb51e,0x134));var _0xeb51=function(_0xae1292,_0x51ef78){_0xae1292=_0xae1292-0x0;var _0x51d997=_0xb51e[_0xae1292];return _0x51d997;};'use strict';var multer=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var path=require('path');var timeout=require(_0xeb51('0x2'));var express=require(_0xeb51('0x3'));var router=express[_0xeb51('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeb51('0x5'));var config=require(_0xeb51('0x6'));var controller=require(_0xeb51('0x7'));router[_0xeb51('0x8')]('/',auth[_0xeb51('0x9')](),controller[_0xeb51('0xa')]);router[_0xeb51('0x8')](_0xeb51('0xb'),auth[_0xeb51('0x9')](),controller[_0xeb51('0xc')]);router[_0xeb51('0xd')]('/',auth[_0xeb51('0x9')](),controller[_0xeb51('0xe')]);router[_0xeb51('0xf')](_0xeb51('0xb'),auth[_0xeb51('0x9')](),controller[_0xeb51('0x10')]);router[_0xeb51('0x11')]('/:id',auth[_0xeb51('0x9')](),controller['destroy']);module[_0xeb51('0x12')]=router; \ No newline at end of file +var _0x0da0=['./analyticTreeReport.controller','index','get','isAuthenticated','show','post','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x0da0,0x14d));var _0x00da=function(_0x554b5b,_0x5466fc){_0x554b5b=_0x554b5b-0x0;var _0x50d223=_0x0da0[_0x554b5b];return _0x50d223;};'use strict';var multer=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var path=require('path');var timeout=require(_0x00da('0x2'));var express=require(_0x00da('0x3'));var router=express[_0x00da('0x4')]();var fs_extra=require(_0x00da('0x5'));var auth=require(_0x00da('0x6'));var interaction=require(_0x00da('0x7'));var config=require(_0x00da('0x8'));var controller=require(_0x00da('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x00da('0xa')]);router[_0x00da('0xb')]('/:id',auth[_0x00da('0xc')](),controller[_0x00da('0xd')]);router[_0x00da('0xe')]('/',auth[_0x00da('0xc')](),controller['create']);router['put'](_0x00da('0xf'),auth[_0x00da('0xc')](),controller[_0x00da('0x10')]);router[_0x00da('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x00da('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3dd9a16..98118d6 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa19=['STRING','sequelize','exports'];(function(_0x5b45da,_0x52bb87){var _0x2327f7=function(_0x35c430){while(--_0x35c430){_0x5b45da['push'](_0x5b45da['shift']());}};_0x2327f7(++_0x52bb87);}(_0xaa19,0x79));var _0x9aa1=function(_0x2dc444,_0x5ef1ff){_0x2dc444=_0x2dc444-0x0;var _0x3205ef=_0xaa19[_0x2dc444];return _0x3205ef;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')]},'basename':{'type':Sequelize[_0x9aa1('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd493=['STRING','sequelize'];(function(_0x13effa,_0xc7f14a){var _0x3ab647=function(_0x2d97bd){while(--_0x2d97bd){_0x13effa['push'](_0x13effa['shift']());}};_0x3ab647(++_0xc7f14a);}(_0xd493,0x1bd));var _0x3d49=function(_0x2068ae,_0x455540){_0x2068ae=_0x2068ae-0x0;var _0x37d844=_0xd493[_0x2068ae];return _0x37d844;};'use strict';var Sequelize=require(_0x3d49('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d49('0x1')]},'basename':{'type':Sequelize[_0x3d49('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c10cbf8..73eae2b 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd9a=['type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','options','include','catch','params','rawAttributes','merge','find','includeAll','get','updatedAt','body','create','originalname','file','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','Attachment','fieldName'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xdd9a,0x1bf));var _0xadd9=function(_0x5cc09d,_0x5a7735){_0x5cc09d=_0x5cc09d-0x0;var _0x306a29=_0xdd9a[_0x5cc09d];return _0x306a29;};'use strict';var emlformat=require(_0xadd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadd9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadd9('0x2'));var moment=require(_0xadd9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xadd9('0x4'));var util=require(_0xadd9('0x5'));var path=require(_0xadd9('0x6'));var sox=require(_0xadd9('0x7'));var csv=require(_0xadd9('0x8'));var ejs=require(_0xadd9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadd9('0xa'));var squel=require(_0xadd9('0xb'));var crypto=require(_0xadd9('0xc'));var jsforce=require(_0xadd9('0xd'));var deskjs=require(_0xadd9('0xe'));var toCsv=require(_0xadd9('0x8'));var querystring=require(_0xadd9('0xf'));var Papa=require('papaparse');var Redis=require(_0xadd9('0x10'));var authService=require(_0xadd9('0x11'));var qs=require(_0xadd9('0x12'));var as=require(_0xadd9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xadd9('0x14'));var config=require(_0xadd9('0x15'));var licenseUtil=require(_0xadd9('0x16'));var db=require(_0xadd9('0x17'))['db'];function respondWithStatusCode(_0x15382d,_0x20dcf9){_0x20dcf9=_0x20dcf9||0xcc;return function(_0x3d7b25){if(_0x3d7b25){return _0x15382d[_0xadd9('0x18')](_0x20dcf9);}return _0x15382d[_0xadd9('0x19')](_0x20dcf9)[_0xadd9('0x1a')]();};}function respondWithResult(_0x4414b2,_0x2d8395){_0x2d8395=_0x2d8395||0xc8;return function(_0x22e0c8){if(_0x22e0c8){return _0x4414b2[_0xadd9('0x19')](_0x2d8395)['json'](_0x22e0c8);}};}function respondWithFilteredResult(_0x53fb71,_0xe09e70){return function(_0x4faf55){if(_0x4faf55){var _0x117ca9=typeof _0xe09e70[_0xadd9('0x1b')]==='undefined'&&typeof _0xe09e70[_0xadd9('0x1c')]===_0xadd9('0x1d');var _0x5aa50a=_0x4faf55[_0xadd9('0x1e')];var _0x20d1b4=_0x117ca9?0x0:_0xe09e70[_0xadd9('0x1b')];var _0x19f992=_0x117ca9?_0x4faf55[_0xadd9('0x1e')]:_0xe09e70[_0xadd9('0x1b')]+_0xe09e70[_0xadd9('0x1c')];var _0x26e59e;if(_0x19f992>=_0x5aa50a){_0x19f992=_0x5aa50a;_0x26e59e=0xc8;}else{_0x26e59e=0xce;}_0x53fb71['status'](_0x26e59e);return _0x53fb71[_0xadd9('0x1f')](_0xadd9('0x20'),_0x20d1b4+'-'+_0x19f992+'/'+_0x5aa50a)[_0xadd9('0x21')](_0x4faf55);}return null;};}function patchUpdates(_0x39121e){return function(_0x544b17){try{jsonpatch[_0xadd9('0x22')](_0x544b17,_0x39121e,!![]);}catch(_0x45f93f){return BPromise[_0xadd9('0x23')](_0x45f93f);}return _0x544b17[_0xadd9('0x24')]();};}function saveUpdates(_0x1559e5,_0xfd9373){return function(_0x606b0f){if(_0x606b0f){return _0x606b0f[_0xadd9('0x25')](_0x1559e5)[_0xadd9('0x26')](function(_0x536101){return _0x536101;});}return null;};}function removeEntity(_0x2532a9,_0x2be88e){return function(_0x48af35){if(_0x48af35){return _0x48af35[_0xadd9('0x27')]()[_0xadd9('0x26')](function(){_0x2532a9[_0xadd9('0x19')](0xcc)[_0xadd9('0x1a')]();});}};}function handleEntityNotFound(_0x1d2c77,_0x658fc2){return function(_0x307887){if(!_0x307887){_0x1d2c77[_0xadd9('0x18')](0x194);}return _0x307887;};}function handleError(_0x5b81fd,_0x1744e4){_0x1744e4=_0x1744e4||0x1f4;return function(_0x5cf251){logger['error'](_0x5cf251[_0xadd9('0x28')]);if(_0x5cf251[_0xadd9('0x29')]){delete _0x5cf251['name'];}_0x5b81fd['status'](_0x1744e4)['send'](_0x5cf251);};}exports[_0xadd9('0x2a')]=function(_0x376532,_0x53d435){var _0x5d538c={},_0x127652={},_0x3daf66={'count':0x0,'rows':[]};var _0x39253d=_['map'](db[_0xadd9('0x2b')]['rawAttributes'],function(_0x56c4bb){return{'name':_0x56c4bb[_0xadd9('0x2c')],'type':_0x56c4bb[_0xadd9('0x2d')][_0xadd9('0x2e')]};});_0x127652['model']=_['map'](_0x39253d,_0xadd9('0x29'));_0x127652['query']=_[_0xadd9('0x2f')](_0x376532[_0xadd9('0x30')]);_0x127652['filters']=_[_0xadd9('0x31')](_0x127652[_0xadd9('0x32')],_0x127652[_0xadd9('0x30')]);_0x5d538c[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x127652['model'],qs[_0xadd9('0x34')](_0x376532[_0xadd9('0x30')][_0xadd9('0x34')]));_0x5d538c[_0xadd9('0x33')]=_0x5d538c['attributes'][_0xadd9('0x35')]?_0x5d538c[_0xadd9('0x33')]:_0x127652[_0xadd9('0x32')];if(!_0x376532[_0xadd9('0x30')][_0xadd9('0x36')]('nolimit')){_0x5d538c[_0xadd9('0x1c')]=qs[_0xadd9('0x1c')](_0x376532[_0xadd9('0x30')][_0xadd9('0x1c')]);_0x5d538c[_0xadd9('0x1b')]=qs[_0xadd9('0x1b')](_0x376532['query'][_0xadd9('0x1b')]);}_0x5d538c[_0xadd9('0x37')]=qs['sort'](_0x376532[_0xadd9('0x30')][_0xadd9('0x38')]);_0x5d538c[_0xadd9('0x39')]=qs['filters'](_['pick'](_0x376532['query'],_0x127652[_0xadd9('0x3a')]),_0x39253d);if(_0x376532['query'][_0xadd9('0x3b')]){_0x5d538c[_0xadd9('0x39')]=_['merge'](_0x5d538c[_0xadd9('0x39')],{'$or':_['map'](_0x39253d,function(_0x36612c){if(_0x36612c['type']!=='VIRTUAL'){var _0x2607d2={};_0x2607d2[_0x36612c['name']]={'$like':'%'+_0x376532[_0xadd9('0x30')][_0xadd9('0x3b')]+'%'};return _0x2607d2;}})});}_0x5d538c=_['merge']({},_0x5d538c,_0x376532[_0xadd9('0x3c')]);var _0x27bdbb={'where':_0x5d538c[_0xadd9('0x39')]};return db[_0xadd9('0x2b')][_0xadd9('0x1e')](_0x27bdbb)[_0xadd9('0x26')](function(_0x28a448){_0x3daf66[_0xadd9('0x1e')]=_0x28a448;if(_0x376532[_0xadd9('0x30')]['includeAll']){_0x5d538c[_0xadd9('0x3d')]=[{'all':!![]}];}return db[_0xadd9('0x2b')]['findAll'](_0x5d538c);})[_0xadd9('0x26')](function(_0x3cec83){_0x3daf66['rows']=_0x3cec83;return _0x3daf66;})[_0xadd9('0x26')](respondWithFilteredResult(_0x53d435,_0x5d538c))[_0xadd9('0x3e')](handleError(_0x53d435,null));};exports['show']=function(_0x6f68f8,_0x3ff4c5){var _0x1381d4={'raw':!![],'where':{'id':_0x6f68f8[_0xadd9('0x3f')]['id']}},_0x8612b={};_0x8612b['model']=_[_0xadd9('0x2f')](db[_0xadd9('0x2b')][_0xadd9('0x40')]);_0x8612b['query']=_[_0xadd9('0x2f')](_0x6f68f8['query']);_0x8612b['filters']=_[_0xadd9('0x31')](_0x8612b[_0xadd9('0x32')],_0x8612b[_0xadd9('0x30')]);_0x1381d4[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x8612b[_0xadd9('0x32')],qs[_0xadd9('0x34')](_0x6f68f8[_0xadd9('0x30')][_0xadd9('0x34')]));_0x1381d4[_0xadd9('0x33')]=_0x1381d4[_0xadd9('0x33')][_0xadd9('0x35')]?_0x1381d4[_0xadd9('0x33')]:_0x8612b[_0xadd9('0x32')];if(_0x6f68f8[_0xadd9('0x30')]['includeAll']){_0x1381d4['include']=[{'all':!![]}];}_0x1381d4=_[_0xadd9('0x41')]({},_0x1381d4,_0x6f68f8[_0xadd9('0x3c')]);return db[_0xadd9('0x2b')][_0xadd9('0x42')](_0x1381d4)['then'](handleEntityNotFound(_0x3ff4c5,null))['then'](respondWithResult(_0x3ff4c5,null))[_0xadd9('0x3e')](handleError(_0x3ff4c5,null));};exports['clone']=function(_0x5d3b75,_0x4097cd){var _0x493cf0={'where':{'id':_0x5d3b75[_0xadd9('0x3f')]['id']}},_0x3a3cb3={};_0x3a3cb3[_0xadd9('0x32')]=_[_0xadd9('0x2f')](db[_0xadd9('0x2b')]['rawAttributes']);_0x493cf0[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x3a3cb3[_0xadd9('0x32')],qs[_0xadd9('0x34')](_0x5d3b75[_0xadd9('0x30')]['fields']));_0x493cf0[_0xadd9('0x33')]=_0x493cf0[_0xadd9('0x33')]['length']?_0x493cf0['attributes']:_0x3a3cb3[_0xadd9('0x32')];if(_0x5d3b75[_0xadd9('0x30')][_0xadd9('0x43')]){_0x493cf0[_0xadd9('0x3d')]=[{'all':!![]}];}_0x493cf0=_[_0xadd9('0x41')]({},_0x493cf0,_0x5d3b75['options']);return db[_0xadd9('0x2b')][_0xadd9('0x42')](_0x493cf0)[_0xadd9('0x26')](handleEntityNotFound(_0x4097cd,null))[_0xadd9('0x26')](function(_0x5bdcd7){if(_0x5bdcd7){var _0x169312=_0x5bdcd7[_0xadd9('0x44')]({'plain':!![]});_0x169312=qs['omit'](_0x169312,['id','createdAt',_0xadd9('0x45')]);_0x5d3b75[_0xadd9('0x46')]=_['omit'](_0x5d3b75[_0xadd9('0x46')],['id','createdAt',_0xadd9('0x45')]);return db[_0xadd9('0x2b')][_0xadd9('0x47')](_[_0xadd9('0x41')](_0x169312,_0x5d3b75[_0xadd9('0x46')]),{'include':_0x5d3b75[_0xadd9('0x30')][_0xadd9('0x43')]?[{'all':!![]}]:undefined});}})[_0xadd9('0x26')](respondWithResult(_0x4097cd,0xc9))[_0xadd9('0x3e')](handleError(_0x4097cd,null));};exports['update']=function(_0x25ad40,_0x1986f6){if(_0x25ad40[_0xadd9('0x46')]['id']){delete _0x25ad40[_0xadd9('0x46')]['id'];}return db[_0xadd9('0x2b')][_0xadd9('0x42')]({'where':{'id':_0x25ad40[_0xadd9('0x3f')]['id']}})[_0xadd9('0x26')](handleEntityNotFound(_0x1986f6,null))['then'](saveUpdates(_0x25ad40[_0xadd9('0x46')],null))[_0xadd9('0x26')](respondWithResult(_0x1986f6,null))[_0xadd9('0x3e')](handleError(_0x1986f6,null));};exports[_0xadd9('0x27')]=function(_0x5a4c4a,_0x363b97){return db[_0xadd9('0x2b')][_0xadd9('0x42')]({'where':{'id':_0x5a4c4a['params']['id']}})[_0xadd9('0x26')](handleEntityNotFound(_0x363b97,null))[_0xadd9('0x26')](removeEntity(_0x363b97,null))[_0xadd9('0x3e')](handleError(_0x363b97,null));};exports[_0xadd9('0x47')]=function(_0x14b496,_0x1da7c6,_0x5a513f){_0x14b496['body'][_0xadd9('0x29')]=_0x14b496['file'][_0xadd9('0x48')];_0x14b496[_0xadd9('0x46')]['basename']=_0x14b496[_0xadd9('0x49')]['filename'];_0x14b496[_0xadd9('0x46')][_0xadd9('0x2d')]=_0x14b496[_0xadd9('0x49')][_0xadd9('0x4a')];return db[_0xadd9('0x2b')]['create'](_0x14b496[_0xadd9('0x46')])[_0xadd9('0x26')](respondWithResult(_0x1da7c6,0xc9))[_0xadd9('0x3e')](handleError(_0x1da7c6,null));};exports['download']=function(_0x4b4a1a,_0x1ac11a,_0x453056){return db['Attachment'][_0xadd9('0x4b')]({'where':{'id':_0x4b4a1a[_0xadd9('0x3f')]['id']},'raw':!![]})[_0xadd9('0x26')](handleEntityNotFound(_0x1ac11a,null))[_0xadd9('0x26')](function(_0x20fcaa){if(_0x20fcaa){var _0x2ebddd=_0x20fcaa[_0xadd9('0x4c')]!==null;var _0x49e96f=path[_0xadd9('0x4d')](config[_0xadd9('0x4e')],_0xadd9('0x4f'));if(_0x2ebddd){_0x49e96f=path[_0xadd9('0x4d')](_0x49e96f,_0xadd9('0x50'));}var _0x12df6d=path['join'](_0x49e96f,_0x20fcaa['basename']);return _0x1ac11a[_0xadd9('0x51')](_0x12df6d);}})[_0xadd9('0x3e')](handleError(_0x1ac11a,null));}; \ No newline at end of file +var _0xb0b2=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','clone','options','get','omit','body','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf'];(function(_0x4a8c03,_0x3fe458){var _0x243608=function(_0x513803){while(--_0x513803){_0x4a8c03['push'](_0x4a8c03['shift']());}};_0x243608(++_0x3fe458);}(_0xb0b2,0xb4));var _0x2b0b=function(_0x5b39e6,_0x3f3d77){_0x5b39e6=_0x5b39e6-0x0;var _0x26709a=_0xb0b2[_0x5b39e6];return _0x26709a;};'use strict';var emlformat=require(_0x2b0b('0x0'));var rimraf=require(_0x2b0b('0x1'));var zipdir=require(_0x2b0b('0x2'));var jsonpatch=require(_0x2b0b('0x3'));var rp=require('request-promise');var moment=require(_0x2b0b('0x4'));var BPromise=require(_0x2b0b('0x5'));var Mustache=require(_0x2b0b('0x6'));var util=require(_0x2b0b('0x7'));var path=require(_0x2b0b('0x8'));var sox=require(_0x2b0b('0x9'));var csv=require(_0x2b0b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b0b('0xb'));var squel=require('squel');var crypto=require(_0x2b0b('0xc'));var jsforce=require(_0x2b0b('0xd'));var deskjs=require(_0x2b0b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2b0b('0xf'));var Redis=require('ioredis');var authService=require(_0x2b0b('0x10'));var qs=require(_0x2b0b('0x11'));var as=require(_0x2b0b('0x12'));var hardwareService=require(_0x2b0b('0x13'));var logger=require(_0x2b0b('0x14'))(_0x2b0b('0x15'));var utils=require(_0x2b0b('0x16'));var config=require(_0x2b0b('0x17'));var licenseUtil=require(_0x2b0b('0x18'));var db=require(_0x2b0b('0x19'))['db'];function respondWithStatusCode(_0x31af67,_0x481fbc){_0x481fbc=_0x481fbc||0xcc;return function(_0x369cfb){if(_0x369cfb){return _0x31af67[_0x2b0b('0x1a')](_0x481fbc);}return _0x31af67['status'](_0x481fbc)[_0x2b0b('0x1b')]();};}function respondWithResult(_0x27f37c,_0x28be1c){_0x28be1c=_0x28be1c||0xc8;return function(_0x35ded5){if(_0x35ded5){return _0x27f37c[_0x2b0b('0x1c')](_0x28be1c)[_0x2b0b('0x1d')](_0x35ded5);}};}function respondWithFilteredResult(_0x134a26,_0x232247){return function(_0x639dd7){if(_0x639dd7){var _0x5b0a8b=typeof _0x232247[_0x2b0b('0x1e')]===_0x2b0b('0x1f')&&typeof _0x232247[_0x2b0b('0x20')]===_0x2b0b('0x1f');var _0x57443a=_0x639dd7[_0x2b0b('0x21')];var _0x2d7208=_0x5b0a8b?0x0:_0x232247[_0x2b0b('0x1e')];var _0x4933ce=_0x5b0a8b?_0x639dd7[_0x2b0b('0x21')]:_0x232247[_0x2b0b('0x1e')]+_0x232247[_0x2b0b('0x20')];var _0x1cdc9f;if(_0x4933ce>=_0x57443a){_0x4933ce=_0x57443a;_0x1cdc9f=0xc8;}else{_0x1cdc9f=0xce;}_0x134a26[_0x2b0b('0x1c')](_0x1cdc9f);return _0x134a26[_0x2b0b('0x22')](_0x2b0b('0x23'),_0x2d7208+'-'+_0x4933ce+'/'+_0x57443a)['json'](_0x639dd7);}return null;};}function patchUpdates(_0x337f1e){return function(_0x5e1e84){try{jsonpatch[_0x2b0b('0x24')](_0x5e1e84,_0x337f1e,!![]);}catch(_0x493183){return BPromise['reject'](_0x493183);}return _0x5e1e84['save']();};}function saveUpdates(_0x2c230c,_0x2dbde5){return function(_0x5b57e1){if(_0x5b57e1){return _0x5b57e1[_0x2b0b('0x25')](_0x2c230c)[_0x2b0b('0x26')](function(_0x615e8b){return _0x615e8b;});}return null;};}function removeEntity(_0x34a6f6,_0x5c1d0d){return function(_0x546392){if(_0x546392){return _0x546392[_0x2b0b('0x27')]()[_0x2b0b('0x26')](function(){_0x34a6f6[_0x2b0b('0x1c')](0xcc)[_0x2b0b('0x1b')]();});}};}function handleEntityNotFound(_0x35cd59,_0x51f58b){return function(_0x291194){if(!_0x291194){_0x35cd59[_0x2b0b('0x1a')](0x194);}return _0x291194;};}function handleError(_0x5af92f,_0x2e140f){_0x2e140f=_0x2e140f||0x1f4;return function(_0x2434a4){logger[_0x2b0b('0x28')](_0x2434a4[_0x2b0b('0x29')]);if(_0x2434a4['name']){delete _0x2434a4[_0x2b0b('0x2a')];}_0x5af92f['status'](_0x2e140f)[_0x2b0b('0x2b')](_0x2434a4);};}exports[_0x2b0b('0x2c')]=function(_0x118bbf,_0x453a53){var _0x302f0f={},_0x558774={},_0x3fdb4f={'count':0x0,'rows':[]};var _0x277153=_[_0x2b0b('0x2d')](db[_0x2b0b('0x2e')]['rawAttributes'],function(_0x2df8dc){return{'name':_0x2df8dc[_0x2b0b('0x2f')],'type':_0x2df8dc[_0x2b0b('0x30')][_0x2b0b('0x31')]};});_0x558774[_0x2b0b('0x32')]=_[_0x2b0b('0x2d')](_0x277153,_0x2b0b('0x2a'));_0x558774['query']=_[_0x2b0b('0x33')](_0x118bbf[_0x2b0b('0x34')]);_0x558774['filters']=_['intersection'](_0x558774[_0x2b0b('0x32')],_0x558774[_0x2b0b('0x34')]);_0x302f0f[_0x2b0b('0x35')]=_[_0x2b0b('0x36')](_0x558774[_0x2b0b('0x32')],qs[_0x2b0b('0x37')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x302f0f[_0x2b0b('0x35')]=_0x302f0f['attributes'][_0x2b0b('0x38')]?_0x302f0f[_0x2b0b('0x35')]:_0x558774[_0x2b0b('0x32')];if(!_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x39')](_0x2b0b('0x3a'))){_0x302f0f[_0x2b0b('0x20')]=qs[_0x2b0b('0x20')](_0x118bbf[_0x2b0b('0x34')]['limit']);_0x302f0f[_0x2b0b('0x1e')]=qs[_0x2b0b('0x1e')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x1e')]);}_0x302f0f[_0x2b0b('0x3b')]=qs[_0x2b0b('0x3c')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x3c')]);_0x302f0f[_0x2b0b('0x3d')]=qs[_0x2b0b('0x3e')](_[_0x2b0b('0x3f')](_0x118bbf[_0x2b0b('0x34')],_0x558774[_0x2b0b('0x3e')]),_0x277153);if(_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x40')]){_0x302f0f[_0x2b0b('0x3d')]=_['merge'](_0x302f0f[_0x2b0b('0x3d')],{'$or':_[_0x2b0b('0x2d')](_0x277153,function(_0xc966f1){if(_0xc966f1[_0x2b0b('0x30')]!=='VIRTUAL'){var _0x30abe9={};_0x30abe9[_0xc966f1[_0x2b0b('0x2a')]]={'$like':'%'+_0x118bbf[_0x2b0b('0x34')]['filter']+'%'};return _0x30abe9;}})});}_0x302f0f=_['merge']({},_0x302f0f,_0x118bbf['options']);var _0xcd942c={'where':_0x302f0f[_0x2b0b('0x3d')]};return db[_0x2b0b('0x2e')]['count'](_0xcd942c)[_0x2b0b('0x26')](function(_0x6dd43e){_0x3fdb4f[_0x2b0b('0x21')]=_0x6dd43e;if(_0x118bbf['query'][_0x2b0b('0x41')]){_0x302f0f[_0x2b0b('0x42')]=[{'all':!![]}];}return db[_0x2b0b('0x2e')][_0x2b0b('0x43')](_0x302f0f);})[_0x2b0b('0x26')](function(_0x3d0b9f){_0x3fdb4f['rows']=_0x3d0b9f;return _0x3fdb4f;})[_0x2b0b('0x26')](respondWithFilteredResult(_0x453a53,_0x302f0f))[_0x2b0b('0x44')](handleError(_0x453a53,null));};exports[_0x2b0b('0x45')]=function(_0x3f0256,_0x375624){var _0x8ab93c={'raw':!![],'where':{'id':_0x3f0256[_0x2b0b('0x46')]['id']}},_0x19b5e8={};_0x19b5e8[_0x2b0b('0x32')]=_[_0x2b0b('0x33')](db['Attachment'][_0x2b0b('0x47')]);_0x19b5e8['query']=_[_0x2b0b('0x33')](_0x3f0256['query']);_0x19b5e8[_0x2b0b('0x3e')]=_[_0x2b0b('0x36')](_0x19b5e8['model'],_0x19b5e8[_0x2b0b('0x34')]);_0x8ab93c[_0x2b0b('0x35')]=_[_0x2b0b('0x36')](_0x19b5e8[_0x2b0b('0x32')],qs['fields'](_0x3f0256[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x8ab93c[_0x2b0b('0x35')]=_0x8ab93c[_0x2b0b('0x35')][_0x2b0b('0x38')]?_0x8ab93c[_0x2b0b('0x35')]:_0x19b5e8[_0x2b0b('0x32')];if(_0x3f0256['query']['includeAll']){_0x8ab93c[_0x2b0b('0x42')]=[{'all':!![]}];}_0x8ab93c=_[_0x2b0b('0x48')]({},_0x8ab93c,_0x3f0256['options']);return db[_0x2b0b('0x2e')][_0x2b0b('0x49')](_0x8ab93c)[_0x2b0b('0x26')](handleEntityNotFound(_0x375624,null))['then'](respondWithResult(_0x375624,null))[_0x2b0b('0x44')](handleError(_0x375624,null));};exports[_0x2b0b('0x4a')]=function(_0xc9a1d6,_0x26eae5){var _0x580982={'where':{'id':_0xc9a1d6[_0x2b0b('0x46')]['id']}},_0x6ae8d3={};_0x6ae8d3['model']=_[_0x2b0b('0x33')](db[_0x2b0b('0x2e')]['rawAttributes']);_0x580982['attributes']=_[_0x2b0b('0x36')](_0x6ae8d3[_0x2b0b('0x32')],qs['fields'](_0xc9a1d6[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x580982['attributes']=_0x580982['attributes'][_0x2b0b('0x38')]?_0x580982['attributes']:_0x6ae8d3[_0x2b0b('0x32')];if(_0xc9a1d6['query'][_0x2b0b('0x41')]){_0x580982[_0x2b0b('0x42')]=[{'all':!![]}];}_0x580982=_['merge']({},_0x580982,_0xc9a1d6[_0x2b0b('0x4b')]);return db['Attachment'][_0x2b0b('0x49')](_0x580982)['then'](handleEntityNotFound(_0x26eae5,null))[_0x2b0b('0x26')](function(_0x214bbd){if(_0x214bbd){var _0x213a7d=_0x214bbd[_0x2b0b('0x4c')]({'plain':!![]});_0x213a7d=qs[_0x2b0b('0x4d')](_0x213a7d,['id','createdAt','updatedAt']);_0xc9a1d6[_0x2b0b('0x4e')]=_['omit'](_0xc9a1d6[_0x2b0b('0x4e')],['id','createdAt','updatedAt']);return db['Attachment'][_0x2b0b('0x4f')](_[_0x2b0b('0x48')](_0x213a7d,_0xc9a1d6[_0x2b0b('0x4e')]),{'include':_0xc9a1d6[_0x2b0b('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x26eae5,0xc9))['catch'](handleError(_0x26eae5,null));};exports[_0x2b0b('0x25')]=function(_0x4ca0b4,_0x2864a9){if(_0x4ca0b4['body']['id']){delete _0x4ca0b4[_0x2b0b('0x4e')]['id'];}return db['Attachment']['find']({'where':{'id':_0x4ca0b4[_0x2b0b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2864a9,null))[_0x2b0b('0x26')](saveUpdates(_0x4ca0b4[_0x2b0b('0x4e')],null))['then'](respondWithResult(_0x2864a9,null))['catch'](handleError(_0x2864a9,null));};exports[_0x2b0b('0x27')]=function(_0x41d150,_0x4bdbcd){return db[_0x2b0b('0x2e')][_0x2b0b('0x49')]({'where':{'id':_0x41d150[_0x2b0b('0x46')]['id']}})[_0x2b0b('0x26')](handleEntityNotFound(_0x4bdbcd,null))[_0x2b0b('0x26')](removeEntity(_0x4bdbcd,null))[_0x2b0b('0x44')](handleError(_0x4bdbcd,null));};exports[_0x2b0b('0x4f')]=function(_0xa11432,_0x58e11f,_0x2d6418){_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x2a')]=_0xa11432[_0x2b0b('0x50')][_0x2b0b('0x51')];_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x52')]=_0xa11432[_0x2b0b('0x50')][_0x2b0b('0x53')];_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x30')]=_0xa11432['file'][_0x2b0b('0x54')];return db['Attachment'][_0x2b0b('0x4f')](_0xa11432['body'])[_0x2b0b('0x26')](respondWithResult(_0x58e11f,0xc9))['catch'](handleError(_0x58e11f,null));};exports[_0x2b0b('0x55')]=function(_0x1ff537,_0x82758a,_0x4cb996){return db[_0x2b0b('0x2e')][_0x2b0b('0x56')]({'where':{'id':_0x1ff537[_0x2b0b('0x46')]['id']},'raw':!![]})[_0x2b0b('0x26')](handleEntityNotFound(_0x82758a,null))['then'](function(_0x24a216){if(_0x24a216){var _0x224ccc=_0x24a216['ChatOfflineMessageId']!==null;var _0x24616d=path[_0x2b0b('0x57')](config[_0x2b0b('0x58')],_0x2b0b('0x59'));if(_0x224ccc){_0x24616d=path['join'](_0x24616d,_0x2b0b('0x5a'));}var _0x40bf3e=path[_0x2b0b('0x57')](_0x24616d,_0x24a216['basename']);return _0x82758a[_0x2b0b('0x55')](_0x40bf3e);}})['catch'](handleError(_0x82758a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7d04dee..622ce23 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc973=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments'];(function(_0x28e4ed,_0x29241f){var _0x45cf01=function(_0x44427c){while(--_0x44427c){_0x28e4ed['push'](_0x28e4ed['shift']());}};_0x45cf01(++_0x29241f);}(_0xc973,0xb6));var _0x3c97=function(_0x22d2c0,_0x46ec64){_0x22d2c0=_0x22d2c0-0x0;var _0x235585=_0xc973[_0x22d2c0];return _0x235585;};'use strict';var _=require(_0x3c97('0x0'));var util=require(_0x3c97('0x1'));var logger=require('../../config/logger')(_0x3c97('0x2'));var moment=require(_0x3c97('0x3'));var BPromise=require(_0x3c97('0x4'));var rp=require(_0x3c97('0x5'));var fs=require('fs');var path=require(_0x3c97('0x6'));var rimraf=require(_0x3c97('0x7'));var config=require(_0x3c97('0x8'));var attributes=require(_0x3c97('0x9'));module['exports']=function(_0x4f868f,_0x117677){return _0x4f868f[_0x3c97('0xa')](_0x3c97('0xb'),attributes,{'tableName':_0x3c97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc4c=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x59eeeb,_0x317f1c){var _0x51ea47=function(_0x412952){while(--_0x412952){_0x59eeeb['push'](_0x59eeeb['shift']());}};_0x51ea47(++_0x317f1c);}(_0xfc4c,0x104));var _0xcfc4=function(_0x77f18f,_0x51c0bd){_0x77f18f=_0x77f18f-0x0;var _0x4199b5=_0xfc4c[_0x77f18f];return _0x4199b5;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var logger=require(_0xcfc4('0x2'))(_0xcfc4('0x3'));var moment=require('moment');var BPromise=require(_0xcfc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfc4('0x5'));var rimraf=require('rimraf');var config=require(_0xcfc4('0x6'));var attributes=require(_0xcfc4('0x7'));module['exports']=function(_0x19e8e4,_0x412340){return _0x19e8e4[_0xcfc4('0x8')]('Attachment',attributes,{'tableName':_0xcfc4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 34618e0..7364264 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateAttachment','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s'];(function(_0x3f7d30,_0x288d25){var _0x220b4b=function(_0x4806fe){while(--_0x4806fe){_0x3f7d30['push'](_0x3f7d30['shift']());}};_0x220b4b(++_0x288d25);}(_0x6c76,0x184));var _0x66c7=function(_0x169124,_0x2d98b5){_0x169124=_0x169124-0x0;var _0x3ee0d3=_0x6c76[_0x169124];return _0x3ee0d3;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['CreateAttachment']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['Attachment'][_0x66c7('0x14')](_0x5129f6[_0x66c7('0x15')],{'raw':_0x5129f6[_0x66c7('0x16')]?_0x5129f6[_0x66c7('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1853b2){logger[_0x66c7('0xa')](_0x66c7('0x17'),_0x5129f6);logger[_0x66c7('0x18')](_0x66c7('0x17'),_0x5129f6,JSON[_0x66c7('0xe')](_0x1853b2));_0x19f29d(_0x1853b2);})['catch'](function(_0x4ddbd2){logger[_0x66c7('0xf')]('CreateAttachment',_0x4ddbd2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0x4ddbd2[_0x66c7('0x11')]));});});}; \ No newline at end of file +var _0xb377=['catch','CreateAttachment','Attachment','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xb377,0x1b6));var _0x7b37=function(_0x5dd1d1,_0x54f22d){_0x5dd1d1=_0x5dd1d1-0x0;var _0x44d903=_0xb377[_0x5dd1d1];return _0x44d903;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['create'](_0x1447aa['body'],{'raw':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![]})[_0x7b37('0xd')](function(_0x30bf66){logger['info']('CreateAttachment',_0x1447aa);logger['debug'](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x1a')](_0x30bf66));_0x29a9dd(_0x30bf66);})[_0x7b37('0x15')](function(_0x200f17){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x200f17[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c['error'](0x1f4,_0x200f17[_0x7b37('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2539656..a1390c1 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x280da7,_0x3859c5){var _0x1a5fde=function(_0x11d1a2){while(--_0x11d1a2){_0x280da7['push'](_0x280da7['shift']());}};_0x1a5fde(++_0x3859c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32db89,_0x38e63e){_0x32db89=_0x32db89-0x0;var _0x786fe8=_0x5f2f[_0x32db89];return _0x786fe8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xa652a0,_0x560051){var _0xcec0f8=function(_0x1b2ceb){while(--_0x1b2ceb){_0xa652a0['push'](_0xa652a0['shift']());}};_0xcec0f8(++_0x560051);}(_0x2032,0xd9));var _0x2203=function(_0x336345,_0xac19ac){_0x336345=_0x336345-0x0;var _0x491db1=_0x2032[_0x336345];return _0x491db1;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 748bc01..c445352 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0x4192=['inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','admin','user','name','add','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s'];(function(_0x34ed72,_0x5ad61f){var _0x369ddf=function(_0x3739d4){while(--_0x3739d4){_0x34ed72['push'](_0x34ed72['shift']());}};_0x369ddf(++_0x5ad61f);}(_0x4192,0x167));var _0x2419=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0x4192[_0x141486];return _0x1b5fb9;};'use strict';var passport=require(_0x2419('0x0'));var LocalStrategy=require(_0x2419('0x1'))[_0x2419('0x2')];var moment=require(_0x2419('0x3'));var ActiveDirectory=require(_0x2419('0x4'));var BPromise=require('bluebird');var util=require(_0x2419('0x5'));var db=require(_0x2419('0x6'))['db'];var authService=require(_0x2419('0x7'));var utils=require('../../config/utils');var config=require(_0x2419('0x8'));var logger=require(_0x2419('0x9'))(_0x2419('0xa'));function isActiveDirectoryConfigured(_0x4edefb){var _0x24fead=![];if(typeof _0x4edefb[_0x2419('0xb')]!=='undefined'){_0x24fead=_0x4edefb['activedirectory'][_0x2419('0xc')]&&_0x4edefb[_0x2419('0xb')][_0x2419('0xd')]&&_0x4edefb[_0x2419('0xb')]['domain'];}return _0x24fead;}function adAuthenticate(_0x168770,_0x233429,_0x3b3669){return new BPromise(function(_0x2712a2,_0x50cbb7){try{var _0xb4b8=new ActiveDirectory(_0x168770);_0xb4b8[_0x2419('0xe')](_0x233429,_0x3b3669,function(_0x58802b,_0x1a869e){if(_0x58802b){logger[_0x2419('0xf')](_0x2419('0x10'),_0x233429,util[_0x2419('0x11')](_0x58802b,{'showHidden':![],'depth':null}));_0x50cbb7(_0x2419('0x12'));}else if(!_0x1a869e){logger['error'](_0x2419('0x13'),_0x233429);_0x50cbb7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2712a2(_0x1a869e);}});}catch(_0x47d49c){_0x50cbb7(_0x47d49c);}});}function ActiveDirectoryAuthenticate(_0x3af846,_0x349249,_0x31538e,_0x4456ac){var _0x122d5e,_0x1e829e;if(!isActiveDirectoryConfigured(config)){logger[_0x2419('0xf')](_0x2419('0x14'),_0x349249);return _0x4456ac(null,![],{'message':_0x2419('0x12')});}return db[_0x2419('0x15')][_0x2419('0x16')]({'where':{'id':0x1},'attributes':[_0x2419('0x17'),'blockDuration'],'raw':!![]})[_0x2419('0x18')](function(_0x12a854){_0x122d5e=_0x12a854;if(!_0x122d5e[_0x2419('0x17')]){logger[_0x2419('0xf')](_0x2419('0x19'),_0x349249);throw new Error(_0x2419('0x12'));}return _0x3af846[_0x2419('0x16')]({'logging':!![],'attributes':['id','name',_0x2419('0x1a'),_0x2419('0x1b'),'role','disabled',_0x2419('0x1c'),_0x2419('0x1d'),'online'],'where':{'name':_0x349249,'role':{'$or':[_0x2419('0x1e'),_0x2419('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x2419('0x18')](function(_0x5c30a6){if(!_0x5c30a6||_0x5c30a6&&_0x5c30a6[_0x2419('0x20')]!==_0x349249){throw new Error(_0x2419('0x12'));}_0x1e829e=_0x5c30a6;var _0x28c9ba=_0x1e829e[_0x2419('0x20')]+'@'+config[_0x2419('0xb')]['domain'];return adAuthenticate(config['activedirectory'],_0x28c9ba,_0x31538e);})['then'](function(_0x1c1c43){if(_0x1e829e['disabled']){throw new Error(_0x2419('0x12'));}if(_0x122d5e['blockDuration']>0x0){if(_0x1e829e[_0x2419('0x1c')]){if(moment(_0x1e829e['blockedAt'])[_0x2419('0x21')](_0x122d5e[_0x2419('0x22')],_0x2419('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2419('0x24')](_0x1e829e,0x0,![],null)[_0x2419('0x18')](function(){return utils[_0x2419('0x25')](_0x1e829e);})[_0x2419('0x18')](function(){return _0x4456ac(null,_0x1e829e);});}else{return utils[_0x2419('0x25')](_0x1e829e)['then'](function(){return _0x4456ac(null,_0x1e829e);});}}else{return utils[_0x2419('0x25')](_0x1e829e)['then'](function(){return _0x4456ac(null,_0x1e829e);});}})[_0x2419('0x26')](function(_0x1fafb8){return _0x4456ac(null,![],_0x1fafb8);});}function handleError(_0x49955a,_0xef8fac,_0x534b97){return _0x49955a[_0x2419('0x27')](_0xef8fac||0x1f4)[_0x2419('0x28')]({'message':_0x534b97?_0x534b97[_0x2419('0x29')]||_0x534b97:''});}exports['login']=function(_0x171472,_0x2daad9,_0x1972d9){passport[_0x2419('0xe')](_0x2419('0x2a'),function(_0x597ec3,_0xc58eba,_0x42c18d){var _0x3e1bdb=_0x597ec3||_0x42c18d;if(_0x3e1bdb){return handleError(_0x2daad9,0x191,_0x3e1bdb);}if(!_0xc58eba){return handleError(_0x2daad9,0x194,{'message':_0x2419('0x2b')});}else{var _0x568129={'payload':{'id':_0xc58eba['id'],'role':_0xc58eba['role']},'options':{'expiresIn':0x15180}};return authService[_0x2419('0x2c')](_0x568129)[_0x2419('0x18')](function(_0x34a321){_0x2daad9['json']({'id':_0xc58eba['id'],'token':_0x34a321,'statusCall':'','isAlreadyLogged':_0xc58eba['online']});});}})(_0x171472,_0x2daad9,_0x1972d9);};passport[_0x2419('0x2d')](_0x2419('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x2419('0x1a')},function(_0x5d19e2,_0x431a12,_0x3a3210){return ActiveDirectoryAuthenticate(db[_0x2419('0x2e')],_0x5d19e2,_0x431a12,_0x3a3210);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 53ea4b2..4d431d2 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3a6=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x3aa902,_0x5bd67f){var _0x1719a1=function(_0x292a06){while(--_0x292a06){_0x3aa902['push'](_0x3aa902['shift']());}};_0x1719a1(++_0x5bd67f);}(_0xd3a6,0xcb));var _0x6d3a=function(_0x73024a,_0x1de560){_0x73024a=_0x73024a-0x0;var _0x4fba7a=_0xd3a6[_0x73024a];return _0x4fba7a;};'use strict';var express=require('express');var router=express[_0x6d3a('0x0')]();var controller=require(_0x6d3a('0x1'));router[_0x6d3a('0x2')]('/',controller[_0x6d3a('0x3')]);module[_0x6d3a('0x4')]=router; \ No newline at end of file +var _0x4650=['login','Router','./authActiveDirectory.controller','post'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4650,0xc1));var _0x0465=function(_0x510a7a,_0x40c4b5){_0x510a7a=_0x510a7a-0x0;var _0x4c999f=_0x4650[_0x510a7a];return _0x4c999f;};'use strict';var express=require('express');var router=express[_0x0465('0x0')]();var controller=require(_0x0465('0x1'));router[_0x0465('0x2')]('/',controller[_0x0465('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 82fc533..a1a7ebb 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x29ac1e,_0x3f02cc){_0x29ac1e=_0x29ac1e-0x0;var _0x29f918=_0x7a54[_0x29ac1e];return _0x29f918;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 5847e81..dc2da59 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','setTokenCookie','exports','express','passport'];(function(_0x2d685c,_0x1fd061){var _0x5c5170=function(_0x1e8fe1){while(--_0x1e8fe1){_0x2d685c['push'](_0x2d685c['shift']());}};_0x5c5170(++_0x1fd061);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1d27a7,_0x43d21f){_0x1d27a7=_0x1d27a7-0x0;var _0x23d69e=_0x8d0e[_0x1d27a7];return _0x23d69e;};'use strict';var express=require(_0xe8d0('0x0'));var passport=require(_0xe8d0('0x1'));var router=express[_0xe8d0('0x2')]();var controller=require(_0xe8d0('0x3'));var userController=require(_0xe8d0('0x4'));var authService=require(_0xe8d0('0x5'));router[_0xe8d0('0x6')]('/',controller[_0xe8d0('0x7')]);router[_0xe8d0('0x6')]('/callback',controller[_0xe8d0('0x8')],authService['isMiddleware'],userController['login'],authService[_0xe8d0('0x9')]);module[_0xe8d0('0xa')]=router; \ No newline at end of file +var _0xadeb=['../../components/auth/service','get','/callback','isMiddleware','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xadeb,0x1bd));var _0xbade=function(_0x27757e,_0xb8d04c){_0x27757e=_0x27757e-0x0;var _0x59d3e4=_0xadeb[_0x27757e];return _0x59d3e4;};'use strict';var express=require('express');var passport=require(_0xbade('0x0'));var router=express['Router']();var controller=require(_0xbade('0x1'));var userController=require(_0xbade('0x2'));var authService=require(_0xbade('0x3'));router[_0xbade('0x4')]('/',controller['login']);router[_0xbade('0x4')](_0xbade('0x5'),controller['callback'],authService[_0xbade('0x6')],userController['login'],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d233ace..7a84e75 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f4e=['disabled','minutes','getLicense','catch','find','email','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','securePassword','enforcePasswordHistory','password','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','User','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','blocked','blockedAt','admin','user','then','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser'];(function(_0xb5c596,_0x418482){var _0xbfb7b9=function(_0x53d143){while(--_0x53d143){_0xb5c596['push'](_0xb5c596['shift']());}};_0xbfb7b9(++_0x418482);}(_0x3f4e,0x17b));var _0xe3f4=function(_0xdded02,_0x385f97){_0xdded02=_0xdded02-0x0;var _0x132d3f=_0x3f4e[_0xdded02];return _0x132d3f;};'use strict';var util=require(_0xe3f4('0x0'));var passport=require('passport');var LocalStrategy=require(_0xe3f4('0x1'))[_0xe3f4('0x2')];var jayson=require(_0xe3f4('0x3'));var _=require(_0xe3f4('0x4'));var rs=require(_0xe3f4('0x5'));var moment=require(_0xe3f4('0x6'));var db=require(_0xe3f4('0x7'))['db'];var authService=require(_0xe3f4('0x8'));var utils=require(_0xe3f4('0x9'));var client=jayson['client'][_0xe3f4('0xa')]({'port':0x232b});function localAuthenticate(_0x5476ab,_0x12da80,_0x5970e8,_0x29d0a9){var _0x3c9831,_0x54884f;return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'where':{'id':0x1},'attributes':[_0xe3f4('0xd'),_0xe3f4('0xe')],'raw':!![]})['then'](function(_0x22b6d6){_0x3c9831=_0x22b6d6;return _0x5476ab[_0xe3f4('0xc')]({'attributes':['id',_0xe3f4('0xf'),'password',_0xe3f4('0x10'),_0xe3f4('0x11'),'disabled',_0xe3f4('0x12'),_0xe3f4('0x13'),'loginAttempts'],'where':{'name':_0x12da80,'role':{'$or':[_0xe3f4('0x14'),_0xe3f4('0x15'),'agent']}}});})[_0xe3f4('0x16')](function(_0x2226ab){if(!_0x2226ab||_0x2226ab&&_0x2226ab['name']!==_0x12da80){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x54884f=_0x2226ab;return _0x54884f;}})[_0xe3f4('0x16')](function(){_0x54884f['authenticate'](_0x5970e8,function(_0x29aac6,_0x4190f6){var _0x1c166e=_0x54884f['loginAttempts']+0x1;if(_0x29aac6){return _0x29d0a9(_0x29aac6);}else if(!_0x4190f6){if(_0x54884f['disabled']){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3c9831[_0xe3f4('0xd')]>0x0){if(_0x54884f[_0xe3f4('0x12')]){if(_0x3c9831['blockDuration']>0x0){if(moment(_0x54884f['blockedAt'])[_0xe3f4('0x17')](_0x3c9831[_0xe3f4('0xe')],'minutes')>moment()){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x19')](_0x54884f,_0x1c166e,![],null)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{if(_0x1c166e>=_0x3c9831['allowedLoginAttempts']){return utils[_0xe3f4('0x19')](_0x54884f,0x0,!![],moment())['then'](function(){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});});}else{return utils[_0xe3f4('0x19')](_0x54884f,_0x1c166e,![],null)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{if(_0x54884f[_0xe3f4('0x1a')]){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else if(_0x3c9831[_0xe3f4('0xd')]>0x0){if(_0x54884f['blocked']){if(_0x3c9831[_0xe3f4('0xe')]>0x0){if(moment(_0x54884f[_0xe3f4('0x13')])['add'](_0x3c9831[_0xe3f4('0xe')],_0xe3f4('0x1b'))>moment()){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x19')](_0x54884f,0x0,![],null)[_0xe3f4('0x16')](function(){return utils[_0xe3f4('0x1c')](_0x54884f);})[_0xe3f4('0x16')](function(){return _0x29d0a9(null,_0x54884f);});}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{return utils[_0xe3f4('0x19')](_0x54884f,0x0,![],null)[_0xe3f4('0x16')](function(){return utils[_0xe3f4('0x1c')](_0x54884f);})['then'](function(){return _0x29d0a9(null,_0x54884f);})[_0xe3f4('0x1d')](function(_0x1c0929){return _0x29d0a9(null,![],_0x1c0929);});}}else{if(_0x54884f[_0xe3f4('0x12')]){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x1c')](_0x54884f)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,_0x54884f);});}}}});})[_0xe3f4('0x1d')](function(_0x2bbe21){return _0x29d0a9(null,![],_0x2bbe21);});}function sendServiceMail(_0x13eb5b){return db['MailAccount'][_0xe3f4('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xe3f4('0xf'),_0xe3f4('0x1f')],'include':[{'model':db[_0xe3f4('0x20')],'as':_0xe3f4('0x21')}]})[_0xe3f4('0x16')](function(_0x146073){if(!_0x146073){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x191e6b={'tls':{'rejectUnauthorized':![]}};if(_0x146073['Smtp'][_0xe3f4('0x22')]){_0x191e6b[_0xe3f4('0x22')]=_0x146073[_0xe3f4('0x21')][_0xe3f4('0x22')];}else{_0x191e6b['host']=_0x146073['Smtp']['host'];_0x191e6b['port']=_0x146073['Smtp'][_0xe3f4('0x23')];_0x191e6b[_0xe3f4('0x24')]=_0x146073['Smtp']['secure'];}if(_0x146073[_0xe3f4('0x21')][_0xe3f4('0x25')]){_0x191e6b[_0xe3f4('0x26')]={'user':_0x146073[_0xe3f4('0x21')][_0xe3f4('0x15')],'pass':_0x146073[_0xe3f4('0x21')][_0xe3f4('0x27')]};}var _0x257f2b={'account':_0x191e6b,'message':_[_0xe3f4('0x28')]({'from':util['format'](_0xe3f4('0x29'),_0x146073[_0xe3f4('0xf')],_0x146073['email']||_0x146073[_0xe3f4('0x21')][_0xe3f4('0x15')])},_0x13eb5b)};return client[_0xe3f4('0x2a')]('SendMail',_0x257f2b);})[_0xe3f4('0x16')](function(_0xa8d8c3){if(_0xa8d8c3[_0xe3f4('0x2b')]){throw new Error(util[_0xe3f4('0x2c')](_0xe3f4('0x2d'),_0xa8d8c3[_0xe3f4('0x2b')][_0xe3f4('0x2e')]||JSON['stringify'](_0xa8d8c3[_0xe3f4('0x2b')])));}return!![];});}function handleError(_0x5643a0,_0x58cc72,_0x545d56){return _0x5643a0['status'](_0x58cc72||0x1f4)[_0xe3f4('0x2f')]({'message':_0x545d56?_0x545d56[_0xe3f4('0x2e')]||_0x545d56:''});}exports['login']=function(_0x1aa41a,_0x4ca3ec,_0x1fe892){passport[_0xe3f4('0x30')](_0xe3f4('0x31'),function(_0x115394,_0x4ba6f3,_0x4b85d2){var _0x32d686=_0x115394||_0x4b85d2;if(_0x32d686){return handleError(_0x4ca3ec,0x191,_0x32d686);}if(!_0x4ba6f3){return handleError(_0x4ca3ec,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1bde56={'payload':{'id':_0x4ba6f3['id'],'role':_0x4ba6f3[_0xe3f4('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xe3f4('0x32')](_0x1bde56)['then'](function(_0x31b804){_0x4ca3ec[_0xe3f4('0x33')]({'id':_0x4ba6f3['id'],'token':_0x31b804,'statusCall':'','isAlreadyLogged':_0x4ba6f3[_0xe3f4('0x34')]});});}})(_0x1aa41a,_0x4ca3ec,_0x1fe892);};exports[_0xe3f4('0x35')]=function(_0xffba60,_0x51983c,_0x1b5643){if(!_0xffba60['body'][_0xe3f4('0x1f')]){return handleError(_0x51983c,0x1f4,{'message':_0xe3f4('0x36')});}var _0xf1c96d=rs[_0xe3f4('0x37')]();_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')]=_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')][_0xe3f4('0x39')]()['toLowerCase']();var _0x294b7d;return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'where':{'id':0x1},'attributes':[_0xe3f4('0xd'),'blockDuration'],'raw':!![]})[_0xe3f4('0x16')](function(_0x1602d4){_0x294b7d=_0x1602d4;return db['User']['find']({'where':{'email':_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')]}});})['then'](function(_0x5b8c2f){if(!_0x5b8c2f){throw new Error(_0xe3f4('0x3a'));}if(_0x5b8c2f['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5b8c2f['blocked']){if(moment(_0x5b8c2f['blockedAt'])[_0xe3f4('0x17')](_0x294b7d['blockDuration'],'minutes')>moment()){throw new Error(_0xe3f4('0x3b'));}else{_0x5b8c2f[_0xe3f4('0x12')]=![];_0x5b8c2f[_0xe3f4('0x13')]=null;}}_0x5b8c2f[_0xe3f4('0x3c')]=_0xf1c96d;_0x5b8c2f['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x5b8c2f['save']();})['then'](function(){return sendServiceMail({'to':_0xffba60['body']['email'],'subject':_0xe3f4('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe3f4('0x3e')+_0xe3f4('0x3f')+_0xffba60[_0xe3f4('0x40')][_0xe3f4('0x41')]+_0xe3f4('0x42')+_0xf1c96d+'\x0a\x0a'+_0xe3f4('0x43')});})[_0xe3f4('0x16')](function(){_0x51983c[_0xe3f4('0x44')](0xc8)[_0xe3f4('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xe3f4('0x1d')](function(_0xf19cd7){return handleError(_0x51983c,0x1f4,_0xf19cd7);});};exports['reset']=function(_0x502690,_0x58b46d,_0x56af9d){return db['User'][_0xe3f4('0x1e')]({'where':{'resetPasswordToken':_0x502690[_0xe3f4('0x45')][_0xe3f4('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x4a87e9){if(!_0x4a87e9){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'attributes':['id',_0xe3f4('0x47'),_0xe3f4('0x48'),'passwordHistoryLimit']})[_0xe3f4('0x16')](function(_0x461a38){if(_0x461a38['securePassword'])authService['validatePasswordPattern'](_0x502690['body'][_0xe3f4('0x49')]);if(!_0x461a38[_0xe3f4('0x48')]||!_0x4a87e9[_0xe3f4('0x4a')])return _0x4a87e9;authService[_0xe3f4('0x4b')](_0x502690[_0xe3f4('0x38')]['password'],_0x4a87e9[_0xe3f4('0x4a')],_0x461a38[_0xe3f4('0x4c')]);return _0x4a87e9;})[_0xe3f4('0x16')](function(){_0x4a87e9[_0xe3f4('0x49')]=_0x502690[_0xe3f4('0x38')][_0xe3f4('0x49')];_0x4a87e9[_0xe3f4('0x3c')]=null;_0x4a87e9['resetPasswordExpires']=null;return _0x4a87e9[_0xe3f4('0x4d')]();});})[_0xe3f4('0x16')](function(){_0x58b46d[_0xe3f4('0x44')](0xc8)[_0xe3f4('0x2f')]({'message':_0xe3f4('0x4e')});})[_0xe3f4('0x1d')](function(_0x46331e){return handleError(_0x58b46d,0x1f4,_0x46331e);});};passport[_0xe3f4('0x4f')](_0xe3f4('0x31'),new LocalStrategy({'usernameField':_0xe3f4('0xf'),'passwordField':'password'},function(_0x3daca3,_0x320346,_0x5d882f){return localAuthenticate(db[_0xe3f4('0x50')],_0x3daca3,_0x320346,_0x5d882f);})); \ No newline at end of file +var _0x0590=['\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','status','send','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','User','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','secure','auth','pass','merge','format'];(function(_0x38c987,_0x32d09c){var _0xc6c966=function(_0x2ee84e){while(--_0x2ee84e){_0x38c987['push'](_0x38c987['shift']());}};_0xc6c966(++_0x32d09c);}(_0x0590,0x166));var _0x0059=function(_0x49de06,_0x525321){_0x49de06=_0x49de06-0x0;var _0x59fda1=_0x0590[_0x49de06];return _0x59fda1;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x0059('0x0'))[_0x0059('0x1')];var jayson=require(_0x0059('0x2'));var _=require('lodash');var rs=require(_0x0059('0x3'));var moment=require('moment');var db=require(_0x0059('0x4'))['db'];var authService=require(_0x0059('0x5'));var utils=require('../../config/utils');var client=jayson[_0x0059('0x6')][_0x0059('0x7')]({'port':0x232b});function localAuthenticate(_0x489111,_0x21767b,_0x57b16e,_0xca9f50){var _0x23c5f5,_0x4c001f;return db[_0x0059('0x8')][_0x0059('0x9')]({'where':{'id':0x1},'attributes':[_0x0059('0xa'),'blockDuration'],'raw':!![]})[_0x0059('0xb')](function(_0x36121d){_0x23c5f5=_0x36121d;return _0x489111[_0x0059('0x9')]({'attributes':['id','name',_0x0059('0xc'),_0x0059('0xd'),_0x0059('0xe'),_0x0059('0xf'),_0x0059('0x10'),_0x0059('0x11'),_0x0059('0x12')],'where':{'name':_0x21767b,'role':{'$or':['admin',_0x0059('0x13'),_0x0059('0x14')]}}});})[_0x0059('0xb')](function(_0x341329){if(!_0x341329||_0x341329&&_0x341329[_0x0059('0x15')]!==_0x21767b){throw new Error(_0x0059('0x16'));}else{_0x4c001f=_0x341329;return _0x4c001f;}})['then'](function(){_0x4c001f[_0x0059('0x17')](_0x57b16e,function(_0x1c59dd,_0x4a1a22){var _0x2d3c82=_0x4c001f[_0x0059('0x12')]+0x1;if(_0x1c59dd){return _0xca9f50(_0x1c59dd);}else if(!_0x4a1a22){if(_0x4c001f[_0x0059('0xf')]){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else if(_0x23c5f5[_0x0059('0xa')]>0x0){if(_0x4c001f['blocked']){if(_0x23c5f5[_0x0059('0x18')]>0x0){if(moment(_0x4c001f['blockedAt'])[_0x0059('0x19')](_0x23c5f5['blockDuration'],'minutes')>moment()){return _0xca9f50(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0059('0x1a')](_0x4c001f,_0x2d3c82,![],null)[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{if(_0x2d3c82>=_0x23c5f5[_0x0059('0xa')]){return utils['clearBlockUser'](_0x4c001f,0x0,!![],moment())[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}else{return utils[_0x0059('0x1a')](_0x4c001f,_0x2d3c82,![],null)[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{if(_0x4c001f['disabled']){return _0xca9f50(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x23c5f5[_0x0059('0xa')]>0x0){if(_0x4c001f[_0x0059('0x10')]){if(_0x23c5f5[_0x0059('0x18')]>0x0){if(moment(_0x4c001f[_0x0059('0x11')])['add'](_0x23c5f5[_0x0059('0x18')],_0x0059('0x1b'))>moment()){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else{return utils[_0x0059('0x1a')](_0x4c001f,0x0,![],null)[_0x0059('0xb')](function(){return utils[_0x0059('0x1c')](_0x4c001f);})['then'](function(){return _0xca9f50(null,_0x4c001f);});}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{return utils[_0x0059('0x1a')](_0x4c001f,0x0,![],null)[_0x0059('0xb')](function(){return utils[_0x0059('0x1c')](_0x4c001f);})[_0x0059('0xb')](function(){return _0xca9f50(null,_0x4c001f);})[_0x0059('0x1d')](function(_0x2029dd){return _0xca9f50(null,![],_0x2029dd);});}}else{if(_0x4c001f[_0x0059('0x10')]){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else{return utils['getLicense'](_0x4c001f)[_0x0059('0xb')](function(){return _0xca9f50(null,_0x4c001f);});}}}});})[_0x0059('0x1d')](function(_0x55ce4a){return _0xca9f50(null,![],_0x55ce4a);});}function sendServiceMail(_0x3f2fd6){return db[_0x0059('0x1e')][_0x0059('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x0059('0x20')],'include':[{'model':db[_0x0059('0x21')],'as':_0x0059('0x22')}]})[_0x0059('0xb')](function(_0xa00528){if(!_0xa00528){throw new Error(_0x0059('0x23'));}var _0x3a1e3a={'tls':{'rejectUnauthorized':![]}};if(_0xa00528[_0x0059('0x22')][_0x0059('0x24')]){_0x3a1e3a[_0x0059('0x24')]=_0xa00528[_0x0059('0x22')]['service'];}else{_0x3a1e3a['host']=_0xa00528[_0x0059('0x22')]['host'];_0x3a1e3a['port']=_0xa00528['Smtp']['port'];_0x3a1e3a['secure']=_0xa00528[_0x0059('0x22')][_0x0059('0x25')];}if(_0xa00528[_0x0059('0x22')]['authentication']){_0x3a1e3a[_0x0059('0x26')]={'user':_0xa00528[_0x0059('0x22')][_0x0059('0x13')],'pass':_0xa00528[_0x0059('0x22')][_0x0059('0x27')]};}var _0x69983={'account':_0x3a1e3a,'message':_[_0x0059('0x28')]({'from':util[_0x0059('0x29')](_0x0059('0x2a'),_0xa00528['name'],_0xa00528[_0x0059('0x20')]||_0xa00528[_0x0059('0x22')][_0x0059('0x13')])},_0x3f2fd6)};return client[_0x0059('0x2b')](_0x0059('0x2c'),_0x69983);})['then'](function(_0x255dbc){if(_0x255dbc[_0x0059('0x2d')]){throw new Error(util[_0x0059('0x29')](_0x0059('0x2e'),_0x255dbc[_0x0059('0x2d')][_0x0059('0x2f')]||JSON[_0x0059('0x30')](_0x255dbc[_0x0059('0x2d')])));}return!![];});}function handleError(_0x2b55f3,_0x4ed6f3,_0x516e1d){return _0x2b55f3['status'](_0x4ed6f3||0x1f4)['send']({'message':_0x516e1d?_0x516e1d[_0x0059('0x2f')]||_0x516e1d:''});}exports[_0x0059('0x31')]=function(_0x7f62ec,_0xb8bcdc,_0x220974){passport[_0x0059('0x17')](_0x0059('0x32'),function(_0x1cf95b,_0x8bc798,_0x1e0510){var _0x352699=_0x1cf95b||_0x1e0510;if(_0x352699){return handleError(_0xb8bcdc,0x191,_0x352699);}if(!_0x8bc798){return handleError(_0xb8bcdc,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x27b656={'payload':{'id':_0x8bc798['id'],'role':_0x8bc798[_0x0059('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x0059('0x33')](_0x27b656)[_0x0059('0xb')](function(_0x425657){_0xb8bcdc[_0x0059('0x34')]({'id':_0x8bc798['id'],'token':_0x425657,'statusCall':'','isAlreadyLogged':_0x8bc798[_0x0059('0x35')]});});}})(_0x7f62ec,_0xb8bcdc,_0x220974);};exports['forgot']=function(_0x4a4b4d,_0x4978f4,_0x432409){if(!_0x4a4b4d['body'][_0x0059('0x20')]){return handleError(_0x4978f4,0x1f4,{'message':_0x0059('0x36')});}var _0x4e5a54=rs[_0x0059('0x37')]();_0x4a4b4d[_0x0059('0x38')]['email']=_0x4a4b4d[_0x0059('0x38')]['email']['trim']()[_0x0059('0x39')]();var _0x5895d1;return db[_0x0059('0x8')][_0x0059('0x9')]({'where':{'id':0x1},'attributes':[_0x0059('0xa'),'blockDuration'],'raw':!![]})[_0x0059('0xb')](function(_0x7f5cb0){_0x5895d1=_0x7f5cb0;return db['User'][_0x0059('0x1f')]({'where':{'email':_0x4a4b4d[_0x0059('0x38')][_0x0059('0x20')]}});})[_0x0059('0xb')](function(_0x23342d){if(!_0x23342d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x23342d[_0x0059('0xf')]){throw new Error(_0x0059('0x3a'));}if(_0x23342d[_0x0059('0x10')]){if(moment(_0x23342d[_0x0059('0x11')])[_0x0059('0x19')](_0x5895d1[_0x0059('0x18')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x23342d[_0x0059('0x10')]=![];_0x23342d[_0x0059('0x11')]=null;}}_0x23342d[_0x0059('0x3b')]=_0x4e5a54;_0x23342d[_0x0059('0x3c')]=Date[_0x0059('0x3d')]()+0x36ee80;return _0x23342d['save']();})[_0x0059('0xb')](function(){return sendServiceMail({'to':_0x4a4b4d['body']['email'],'subject':_0x0059('0x3e'),'text':_0x0059('0x3f')+_0x0059('0x40')+_0x0059('0x41')+_0x4a4b4d[_0x0059('0x42')][_0x0059('0x43')]+'/reset/'+_0x4e5a54+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0059('0xb')](function(){_0x4978f4[_0x0059('0x44')](0xc8)[_0x0059('0x45')]({'message':'Reset\x20Email\x20sent!'});})[_0x0059('0x1d')](function(_0x5c2043){return handleError(_0x4978f4,0x1f4,_0x5c2043);});};exports['reset']=function(_0x523d90,_0x5b4cf7,_0x2e5370){return db['User']['find']({'where':{'resetPasswordToken':_0x523d90['params'][_0x0059('0x46')],'resetPasswordExpires':{'$gt':Date[_0x0059('0x3d')]()}}})[_0x0059('0xb')](function(_0x2693d0){if(!_0x2693d0){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x0059('0x9')]({'attributes':['id',_0x0059('0x47'),'enforcePasswordHistory',_0x0059('0x48')]})['then'](function(_0x3bc28d){if(_0x3bc28d[_0x0059('0x47')])authService[_0x0059('0x49')](_0x523d90[_0x0059('0x38')][_0x0059('0xc')]);if(!_0x3bc28d[_0x0059('0x4a')]||!_0x2693d0[_0x0059('0x4b')])return _0x2693d0;authService[_0x0059('0x4c')](_0x523d90[_0x0059('0x38')][_0x0059('0xc')],_0x2693d0[_0x0059('0x4b')],_0x3bc28d[_0x0059('0x48')]);return _0x2693d0;})['then'](function(){_0x2693d0[_0x0059('0xc')]=_0x523d90['body'][_0x0059('0xc')];_0x2693d0['resetPasswordToken']=null;_0x2693d0[_0x0059('0x3c')]=null;return _0x2693d0['save']();});})[_0x0059('0xb')](function(){_0x5b4cf7[_0x0059('0x44')](0xc8)[_0x0059('0x45')]({'message':_0x0059('0x4d')});})[_0x0059('0x1d')](function(_0x3cf2a6){return handleError(_0x5b4cf7,0x1f4,_0x3cf2a6);});};passport[_0x0059('0x4e')]('local-login',new LocalStrategy({'usernameField':_0x0059('0x15'),'passwordField':'password'},function(_0x2cb021,_0x5c324a,_0x1dcb19){return localAuthenticate(db[_0x0059('0x4f')],_0x2cb021,_0x5c324a,_0x1dcb19);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index dd59489..a1a95c9 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3607=['./authLocal.controller','post','/forgot','/reset/:token','reset','exports','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3607,0x117));var _0x7360=function(_0x3fa3da,_0xe049d2){_0x3fa3da=_0x3fa3da-0x0;var _0x420157=_0x3607[_0x3fa3da];return _0x420157;};'use strict';var express=require(_0x7360('0x0'));var router=express['Router']();var controller=require(_0x7360('0x1'));router['post']('/',controller['login']);router[_0x7360('0x2')](_0x7360('0x3'),controller['forgot']);router['post'](_0x7360('0x4'),controller[_0x7360('0x5')]);module[_0x7360('0x6')]=router; \ No newline at end of file +var _0x9d42=['post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d42,0x17e));var _0x29d4=function(_0x51eb77,_0x436673){_0x51eb77=_0x51eb77-0x0;var _0x4b26fe=_0x9d42[_0x51eb77];return _0x4b26fe;};'use strict';var express=require(_0x29d4('0x0'));var router=express['Router']();var controller=require(_0x29d4('0x1'));router[_0x29d4('0x2')]('/',controller['login']);router['post'](_0x29d4('0x3'),controller[_0x29d4('0x4')]);router[_0x29d4('0x2')](_0x29d4('0x5'),controller[_0x29d4('0x6')]);module[_0x29d4('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 608b0f3..8b1cc4d 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76ce=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x3d793c,_0x234c37){var _0x4a7ae3=function(_0x3009ab){while(--_0x3009ab){_0x3d793c['push'](_0x3d793c['shift']());}};_0x4a7ae3(++_0x234c37);}(_0x76ce,0x65));var _0xe76c=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x76ce[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0xe76c('0x0'));module[_0xe76c('0x1')]={'name':{'type':Sequelize[_0xe76c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe76c('0x2')]},'description':{'type':Sequelize[_0xe76c('0x2')]},'status':{'type':Sequelize[_0xe76c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe76c('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc49a=['sequelize','STRING','BOOLEAN'];(function(_0x36072d,_0x24f414){var _0x32a52c=function(_0x19834c){while(--_0x19834c){_0x36072d['push'](_0x36072d['shift']());}};_0x32a52c(++_0x24f414);}(_0xc49a,0xf9));var _0xac49=function(_0x26e548,_0x419f69){_0x26e548=_0x26e548-0x0;var _0x1aa3f8=_0xc49a[_0x26e548];return _0x1aa3f8;};'use strict';var Sequelize=require(_0xac49('0x0'));module['exports']={'name':{'type':Sequelize[_0xac49('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac49('0x1')]},'status':{'type':Sequelize[_0xac49('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index ffcda46..ec2da02 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6a0=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','then','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','Action','getActions','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa6a0,0x187));var _0x0a6a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa6a0[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x0a6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6a('0x2'));var moment=require(_0x0a6a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a6a('0x4'));var util=require(_0x0a6a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0a6a('0x6'));var ejs=require(_0x0a6a('0x7'));var fs=require('fs');var fs_extra=require(_0x0a6a('0x8'));var _=require(_0x0a6a('0x9'));var squel=require(_0x0a6a('0xa'));var crypto=require('crypto');var jsforce=require(_0x0a6a('0xb'));var deskjs=require(_0x0a6a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0a6a('0xd'));var Papa=require('papaparse');var Redis=require(_0x0a6a('0xe'));var authService=require(_0x0a6a('0xf'));var qs=require(_0x0a6a('0x10'));var as=require(_0x0a6a('0x11'));var hardwareService=require(_0x0a6a('0x12'));var logger=require(_0x0a6a('0x13'))(_0x0a6a('0x14'));var utils=require(_0x0a6a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0a6a('0x16'));var db=require(_0x0a6a('0x17'))['db'];function respondWithStatusCode(_0x13bb6a,_0x4da05a){_0x4da05a=_0x4da05a||0xcc;return function(_0x49fdac){if(_0x49fdac){return _0x13bb6a[_0x0a6a('0x18')](_0x4da05a);}return _0x13bb6a['status'](_0x4da05a)[_0x0a6a('0x19')]();};}function respondWithResult(_0x392df2,_0x4c2ee8){_0x4c2ee8=_0x4c2ee8||0xc8;return function(_0x30e30d){if(_0x30e30d){return _0x392df2[_0x0a6a('0x1a')](_0x4c2ee8)[_0x0a6a('0x1b')](_0x30e30d);}};}function respondWithFilteredResult(_0x531952,_0x357877){return function(_0x68d434){if(_0x68d434){var _0x1f167e=typeof _0x357877['offset']===_0x0a6a('0x1c')&&typeof _0x357877[_0x0a6a('0x1d')]===_0x0a6a('0x1c');var _0x36bc68=_0x68d434[_0x0a6a('0x1e')];var _0x44f859=_0x1f167e?0x0:_0x357877[_0x0a6a('0x1f')];var _0x3e3c8b=_0x1f167e?_0x68d434[_0x0a6a('0x1e')]:_0x357877['offset']+_0x357877[_0x0a6a('0x1d')];var _0x2e8d38;if(_0x3e3c8b>=_0x36bc68){_0x3e3c8b=_0x36bc68;_0x2e8d38=0xc8;}else{_0x2e8d38=0xce;}_0x531952[_0x0a6a('0x1a')](_0x2e8d38);return _0x531952['set'](_0x0a6a('0x20'),_0x44f859+'-'+_0x3e3c8b+'/'+_0x36bc68)[_0x0a6a('0x1b')](_0x68d434);}return null;};}function patchUpdates(_0x1691d8){return function(_0xf4c204){try{jsonpatch['apply'](_0xf4c204,_0x1691d8,!![]);}catch(_0x2f93e8){return BPromise[_0x0a6a('0x21')](_0x2f93e8);}return _0xf4c204[_0x0a6a('0x22')]();};}function saveUpdates(_0x9ea62b,_0x556ff9){return function(_0x4234b6){if(_0x4234b6){return _0x4234b6['update'](_0x9ea62b)[_0x0a6a('0x23')](function(_0x59c8fb){return _0x59c8fb;});}return null;};}function removeEntity(_0x543f75,_0x47e534){return function(_0x469fbc){if(_0x469fbc){return _0x469fbc['destroy']()['then'](function(){_0x543f75['status'](0xcc)[_0x0a6a('0x19')]();});}};}function handleEntityNotFound(_0xaf6eda,_0x1562ae){return function(_0x219d79){if(!_0x219d79){_0xaf6eda[_0x0a6a('0x18')](0x194);}return _0x219d79;};}function handleError(_0x9f9188,_0x4c9f66){_0x4c9f66=_0x4c9f66||0x1f4;return function(_0x9fac42){logger[_0x0a6a('0x24')](_0x9fac42[_0x0a6a('0x25')]);if(_0x9fac42['name']){delete _0x9fac42[_0x0a6a('0x26')];}_0x9f9188[_0x0a6a('0x1a')](_0x4c9f66)[_0x0a6a('0x27')](_0x9fac42);};}exports[_0x0a6a('0x28')]=function(_0x5b5a45,_0x1b194c){var _0x3b3eb6={},_0x35e49d={},_0x4ad278={'count':0x0,'rows':[]};var _0x4e8845=_[_0x0a6a('0x29')](db[_0x0a6a('0x2a')]['rawAttributes'],function(_0x20b5b7){return{'name':_0x20b5b7[_0x0a6a('0x2b')],'type':_0x20b5b7[_0x0a6a('0x2c')][_0x0a6a('0x2d')]};});_0x35e49d[_0x0a6a('0x2e')]=_[_0x0a6a('0x29')](_0x4e8845,_0x0a6a('0x26'));_0x35e49d[_0x0a6a('0x2f')]=_['keys'](_0x5b5a45['query']);_0x35e49d[_0x0a6a('0x30')]=_['intersection'](_0x35e49d['model'],_0x35e49d[_0x0a6a('0x2f')]);_0x3b3eb6['attributes']=_[_0x0a6a('0x31')](_0x35e49d[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x3b3eb6[_0x0a6a('0x33')]=_0x3b3eb6[_0x0a6a('0x33')][_0x0a6a('0x34')]?_0x3b3eb6['attributes']:_0x35e49d['model'];if(!_0x5b5a45['query'][_0x0a6a('0x35')](_0x0a6a('0x36'))){_0x3b3eb6[_0x0a6a('0x1d')]=qs[_0x0a6a('0x1d')](_0x5b5a45[_0x0a6a('0x2f')]['limit']);_0x3b3eb6[_0x0a6a('0x1f')]=qs[_0x0a6a('0x1f')](_0x5b5a45[_0x0a6a('0x2f')]['offset']);}_0x3b3eb6[_0x0a6a('0x37')]=qs[_0x0a6a('0x38')](_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x3b3eb6[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_[_0x0a6a('0x3a')](_0x5b5a45[_0x0a6a('0x2f')],_0x35e49d[_0x0a6a('0x30')]),_0x4e8845);if(_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x3b3eb6[_0x0a6a('0x39')]=_['merge'](_0x3b3eb6[_0x0a6a('0x39')],{'$or':_[_0x0a6a('0x29')](_0x4e8845,function(_0x2a9134){if(_0x2a9134[_0x0a6a('0x2c')]!==_0x0a6a('0x3c')){var _0x55b485={};_0x55b485[_0x2a9134[_0x0a6a('0x26')]]={'$like':'%'+_0x5b5a45['query']['filter']+'%'};return _0x55b485;}})});}_0x3b3eb6=_[_0x0a6a('0x3d')]({},_0x3b3eb6,_0x5b5a45[_0x0a6a('0x3e')]);var _0x44ca80={'where':_0x3b3eb6['where']};return db['Automation'][_0x0a6a('0x1e')](_0x44ca80)['then'](function(_0x23964b){_0x4ad278[_0x0a6a('0x1e')]=_0x23964b;if(_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x3f')]){_0x3b3eb6[_0x0a6a('0x40')]=[{'all':!![]}];}return db[_0x0a6a('0x2a')][_0x0a6a('0x41')](_0x3b3eb6);})['then'](function(_0x1e29b7){_0x4ad278[_0x0a6a('0x42')]=_0x1e29b7;return _0x4ad278;})[_0x0a6a('0x23')](respondWithFilteredResult(_0x1b194c,_0x3b3eb6))[_0x0a6a('0x43')](handleError(_0x1b194c,null));};exports['show']=function(_0xd68c21,_0x9c571d){var _0x19848a={'raw':![],'where':{'id':_0xd68c21[_0x0a6a('0x44')]['id']}},_0x683bb8={};_0x683bb8[_0x0a6a('0x2e')]=_['keys'](db[_0x0a6a('0x2a')][_0x0a6a('0x45')]);_0x683bb8[_0x0a6a('0x2f')]=_[_0x0a6a('0x46')](_0xd68c21[_0x0a6a('0x2f')]);_0x683bb8['filters']=_[_0x0a6a('0x31')](_0x683bb8['model'],_0x683bb8['query']);_0x19848a['attributes']=_[_0x0a6a('0x31')](_0x683bb8[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0xd68c21[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x19848a[_0x0a6a('0x33')]=_0x19848a[_0x0a6a('0x33')]['length']?_0x19848a[_0x0a6a('0x33')]:_0x683bb8[_0x0a6a('0x2e')];if(_0xd68c21[_0x0a6a('0x2f')][_0x0a6a('0x3f')]){_0x19848a[_0x0a6a('0x40')]=[{'all':!![]}];}_0x19848a=_[_0x0a6a('0x3d')]({},_0x19848a,_0xd68c21[_0x0a6a('0x3e')]);return db[_0x0a6a('0x2a')][_0x0a6a('0x47')](_0x19848a)['then'](handleEntityNotFound(_0x9c571d,null))[_0x0a6a('0x23')](respondWithResult(_0x9c571d,null))[_0x0a6a('0x43')](handleError(_0x9c571d,null));};exports[_0x0a6a('0x48')]=function(_0x24d30e,_0x338c14){return db[_0x0a6a('0x2a')][_0x0a6a('0x48')](_0x24d30e[_0x0a6a('0x49')],{})[_0x0a6a('0x23')](respondWithResult(_0x338c14,0xc9))[_0x0a6a('0x43')](handleError(_0x338c14,null));};exports['update']=function(_0x57513c,_0x2bfb6c){if(_0x57513c[_0x0a6a('0x49')]['id']){delete _0x57513c[_0x0a6a('0x49')]['id'];}return db[_0x0a6a('0x2a')]['find']({'where':{'id':_0x57513c[_0x0a6a('0x44')]['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x2bfb6c,null))[_0x0a6a('0x23')](saveUpdates(_0x57513c[_0x0a6a('0x49')],null))[_0x0a6a('0x23')](respondWithResult(_0x2bfb6c,null))[_0x0a6a('0x43')](handleError(_0x2bfb6c,null));};exports['destroy']=function(_0xf0a1da,_0x58e711){return db[_0x0a6a('0x2a')][_0x0a6a('0x47')]({'where':{'id':_0xf0a1da['params']['id']}})['then'](handleEntityNotFound(_0x58e711,null))[_0x0a6a('0x23')](removeEntity(_0x58e711,null))['catch'](handleError(_0x58e711,null));};exports[_0x0a6a('0x4a')]=function(_0x1292e2,_0x281fb8,_0x1d3e81){return db[_0x0a6a('0x4b')][_0x0a6a('0x47')]({'where':{'id':_0x1292e2[_0x0a6a('0x44')]['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x281fb8,null))[_0x0a6a('0x23')](function(_0x434681){if(_0x434681){return _0x434681[_0x0a6a('0x4a')](_0x1292e2[_0x0a6a('0x49')]['ids'],_[_0x0a6a('0x4c')](_0x1292e2[_0x0a6a('0x49')],[_0x0a6a('0x4d'),'id'])||{});}})[_0x0a6a('0x23')](respondWithResult(_0x281fb8,null))['catch'](handleError(_0x281fb8,null));};exports[_0x0a6a('0x4e')]=function(_0x23bc81,_0x795016,_0x5b8e28){var _0x5b6c11={};var _0x498eeb={};var _0x4aead2;var _0x5dd3ba;return db[_0x0a6a('0x2a')][_0x0a6a('0x4f')]({'where':{'id':_0x23bc81['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x795016,null))[_0x0a6a('0x23')](function(_0x508909){if(_0x508909){_0x4aead2=_0x508909;_0x498eeb[_0x0a6a('0x2e')]=_[_0x0a6a('0x46')](db[_0x0a6a('0x4b')][_0x0a6a('0x45')]);_0x498eeb['query']=_[_0x0a6a('0x46')](_0x23bc81[_0x0a6a('0x2f')]);_0x498eeb[_0x0a6a('0x30')]=_['intersection'](_0x498eeb[_0x0a6a('0x2e')],_0x498eeb[_0x0a6a('0x2f')]);_0x5b6c11[_0x0a6a('0x33')]=_['intersection'](_0x498eeb[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x23bc81['query'][_0x0a6a('0x32')]));_0x5b6c11[_0x0a6a('0x33')]=_0x5b6c11['attributes'][_0x0a6a('0x34')]?_0x5b6c11[_0x0a6a('0x33')]:_0x498eeb[_0x0a6a('0x2e')];_0x5b6c11['order']=qs[_0x0a6a('0x38')](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x5b6c11[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_[_0x0a6a('0x3a')](_0x23bc81[_0x0a6a('0x2f')],_0x498eeb[_0x0a6a('0x30')]));if(_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x5b6c11[_0x0a6a('0x39')]=_[_0x0a6a('0x3d')](_0x5b6c11['where'],{'$or':_[_0x0a6a('0x29')](_0x5b6c11[_0x0a6a('0x33')],function(_0x1f0b19){var _0x4c276e={};_0x4c276e[_0x1f0b19]={'$like':'%'+_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x3b')]+'%'};return _0x4c276e;})});}_0x5b6c11=_['merge']({},_0x5b6c11,_0x23bc81[_0x0a6a('0x3e')]);return _0x4aead2['getConditions'](_0x5b6c11);}})['then'](function(_0x4db455){if(_0x4db455){_0x5dd3ba=_0x4db455['length'];if(!_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x35')](_0x0a6a('0x36'))){_0x5b6c11['limit']=qs[_0x0a6a('0x1d')](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x1d')]);_0x5b6c11[_0x0a6a('0x1f')]=qs['offset'](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x1f')]);}return _0x4aead2[_0x0a6a('0x4e')](_0x5b6c11);}})[_0x0a6a('0x23')](function(_0x2d50a6){if(_0x2d50a6){return _0x2d50a6?{'count':_0x5dd3ba,'rows':_0x2d50a6}:null;}})[_0x0a6a('0x23')](respondWithResult(_0x795016,null))['catch'](handleError(_0x795016,null));};exports['addActions']=function(_0xefde2a,_0x41c372,_0x11085f){return db[_0x0a6a('0x50')][_0x0a6a('0x47')]({'where':{'id':_0xefde2a['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x41c372,null))[_0x0a6a('0x23')](function(_0x250548){if(_0x250548){return _0x250548['addActions'](_0xefde2a[_0x0a6a('0x49')][_0x0a6a('0x4d')],_[_0x0a6a('0x4c')](_0xefde2a['body'],[_0x0a6a('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x41c372,null))['catch'](handleError(_0x41c372,null));};exports[_0x0a6a('0x51')]=function(_0x16aeed,_0x5c8264,_0x178bf7){var _0x218a6b={};var _0xa7d04b={};var _0x43d047;var _0x433390;return db[_0x0a6a('0x2a')][_0x0a6a('0x4f')]({'where':{'id':_0x16aeed['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x5c8264,null))[_0x0a6a('0x23')](function(_0x2cf5f1){if(_0x2cf5f1){_0x43d047=_0x2cf5f1;_0xa7d04b['model']=_[_0x0a6a('0x46')](db[_0x0a6a('0x50')]['rawAttributes']);_0xa7d04b[_0x0a6a('0x2f')]=_[_0x0a6a('0x46')](_0x16aeed[_0x0a6a('0x2f')]);_0xa7d04b[_0x0a6a('0x30')]=_['intersection'](_0xa7d04b['model'],_0xa7d04b[_0x0a6a('0x2f')]);_0x218a6b[_0x0a6a('0x33')]=_[_0x0a6a('0x31')](_0xa7d04b[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x218a6b[_0x0a6a('0x33')]=_0x218a6b[_0x0a6a('0x33')][_0x0a6a('0x34')]?_0x218a6b[_0x0a6a('0x33')]:_0xa7d04b[_0x0a6a('0x2e')];_0x218a6b[_0x0a6a('0x37')]=qs[_0x0a6a('0x38')](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x218a6b[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_['pick'](_0x16aeed[_0x0a6a('0x2f')],_0xa7d04b['filters']));if(_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x218a6b[_0x0a6a('0x39')]=_[_0x0a6a('0x3d')](_0x218a6b[_0x0a6a('0x39')],{'$or':_[_0x0a6a('0x29')](_0x218a6b[_0x0a6a('0x33')],function(_0x496024){var _0x414f51={};_0x414f51[_0x496024]={'$like':'%'+_0x16aeed['query']['filter']+'%'};return _0x414f51;})});}_0x218a6b=_['merge']({},_0x218a6b,_0x16aeed['options']);return _0x43d047[_0x0a6a('0x51')](_0x218a6b);}})[_0x0a6a('0x23')](function(_0x40355a){if(_0x40355a){_0x433390=_0x40355a[_0x0a6a('0x34')];if(!_0x16aeed[_0x0a6a('0x2f')]['hasOwnProperty'](_0x0a6a('0x36'))){_0x218a6b[_0x0a6a('0x1d')]=qs['limit'](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x1d')]);_0x218a6b['offset']=qs['offset'](_0x16aeed[_0x0a6a('0x2f')]['offset']);}return _0x43d047['getActions'](_0x218a6b);}})['then'](function(_0x5c9b06){if(_0x5c9b06){return _0x5c9b06?{'count':_0x433390,'rows':_0x5c9b06}:null;}})[_0x0a6a('0x23')](respondWithResult(_0x5c8264,null))[_0x0a6a('0x43')](handleError(_0x5c8264,null));}; \ No newline at end of file +var _0x2b22=['findAll','rows','catch','show','params','create','body','addConditions','Condition','omit','ids','getConditions','findOne','Action','find','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x2b22,0x68));var _0x22b2=function(_0x2ecd37,_0x17d130){_0x2ecd37=_0x2ecd37-0x0;var _0x70c377=_0x2b22[_0x2ecd37];return _0x70c377;};'use strict';var emlformat=require(_0x22b2('0x0'));var rimraf=require(_0x22b2('0x1'));var zipdir=require(_0x22b2('0x2'));var jsonpatch=require(_0x22b2('0x3'));var rp=require(_0x22b2('0x4'));var moment=require(_0x22b2('0x5'));var BPromise=require(_0x22b2('0x6'));var Mustache=require(_0x22b2('0x7'));var util=require(_0x22b2('0x8'));var path=require(_0x22b2('0x9'));var sox=require(_0x22b2('0xa'));var csv=require(_0x22b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22b2('0xc'));var _=require('lodash');var squel=require(_0x22b2('0xd'));var crypto=require('crypto');var jsforce=require(_0x22b2('0xe'));var deskjs=require(_0x22b2('0xf'));var toCsv=require(_0x22b2('0xb'));var querystring=require(_0x22b2('0x10'));var Papa=require('papaparse');var Redis=require(_0x22b2('0x11'));var authService=require(_0x22b2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x22b2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22b2('0x14'))(_0x22b2('0x15'));var utils=require(_0x22b2('0x16'));var config=require(_0x22b2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x22b2('0x18'))['db'];function respondWithStatusCode(_0x2480db,_0x52f70d){_0x52f70d=_0x52f70d||0xcc;return function(_0x1610e6){if(_0x1610e6){return _0x2480db[_0x22b2('0x19')](_0x52f70d);}return _0x2480db[_0x22b2('0x1a')](_0x52f70d)['end']();};}function respondWithResult(_0x122a2c,_0x5ae0b6){_0x5ae0b6=_0x5ae0b6||0xc8;return function(_0xc64663){if(_0xc64663){return _0x122a2c[_0x22b2('0x1a')](_0x5ae0b6)[_0x22b2('0x1b')](_0xc64663);}};}function respondWithFilteredResult(_0x50856f,_0x55d66d){return function(_0x55ed04){if(_0x55ed04){var _0x2ab4c6=typeof _0x55d66d[_0x22b2('0x1c')]===_0x22b2('0x1d')&&typeof _0x55d66d[_0x22b2('0x1e')]==='undefined';var _0x3f1d05=_0x55ed04['count'];var _0x44bd95=_0x2ab4c6?0x0:_0x55d66d['offset'];var _0x5c608a=_0x2ab4c6?_0x55ed04['count']:_0x55d66d[_0x22b2('0x1c')]+_0x55d66d['limit'];var _0x492124;if(_0x5c608a>=_0x3f1d05){_0x5c608a=_0x3f1d05;_0x492124=0xc8;}else{_0x492124=0xce;}_0x50856f[_0x22b2('0x1a')](_0x492124);return _0x50856f[_0x22b2('0x1f')](_0x22b2('0x20'),_0x44bd95+'-'+_0x5c608a+'/'+_0x3f1d05)[_0x22b2('0x1b')](_0x55ed04);}return null;};}function patchUpdates(_0x2ee779){return function(_0x328166){try{jsonpatch[_0x22b2('0x21')](_0x328166,_0x2ee779,!![]);}catch(_0x987cf3){return BPromise[_0x22b2('0x22')](_0x987cf3);}return _0x328166['save']();};}function saveUpdates(_0x4dedbe,_0x381f51){return function(_0x4c39ef){if(_0x4c39ef){return _0x4c39ef[_0x22b2('0x23')](_0x4dedbe)[_0x22b2('0x24')](function(_0x328068){return _0x328068;});}return null;};}function removeEntity(_0x2417cb,_0x1747e4){return function(_0x1ac0d5){if(_0x1ac0d5){return _0x1ac0d5[_0x22b2('0x25')]()['then'](function(){_0x2417cb[_0x22b2('0x1a')](0xcc)[_0x22b2('0x26')]();});}};}function handleEntityNotFound(_0x561678,_0x285c3c){return function(_0x1f46e7){if(!_0x1f46e7){_0x561678[_0x22b2('0x19')](0x194);}return _0x1f46e7;};}function handleError(_0x400674,_0x30d1a6){_0x30d1a6=_0x30d1a6||0x1f4;return function(_0x4ca0d1){logger[_0x22b2('0x27')](_0x4ca0d1[_0x22b2('0x28')]);if(_0x4ca0d1[_0x22b2('0x29')]){delete _0x4ca0d1['name'];}_0x400674['status'](_0x30d1a6)[_0x22b2('0x2a')](_0x4ca0d1);};}exports[_0x22b2('0x2b')]=function(_0x5a7c90,_0x49013){var _0x5a9352={},_0x2400fc={},_0x2eb4f6={'count':0x0,'rows':[]};var _0x3f6e69=_[_0x22b2('0x2c')](db[_0x22b2('0x2d')][_0x22b2('0x2e')],function(_0x54b834){return{'name':_0x54b834[_0x22b2('0x2f')],'type':_0x54b834[_0x22b2('0x30')][_0x22b2('0x31')]};});_0x2400fc[_0x22b2('0x32')]=_[_0x22b2('0x2c')](_0x3f6e69,_0x22b2('0x29'));_0x2400fc[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x5a7c90['query']);_0x2400fc['filters']=_['intersection'](_0x2400fc[_0x22b2('0x32')],_0x2400fc[_0x22b2('0x33')]);_0x5a9352[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x2400fc[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x37')]));_0x5a9352[_0x22b2('0x35')]=_0x5a9352['attributes'][_0x22b2('0x38')]?_0x5a9352[_0x22b2('0x35')]:_0x2400fc[_0x22b2('0x32')];if(!_0x5a7c90['query'][_0x22b2('0x39')](_0x22b2('0x3a'))){_0x5a9352[_0x22b2('0x1e')]=qs['limit'](_0x5a7c90[_0x22b2('0x33')]['limit']);_0x5a9352[_0x22b2('0x1c')]=qs['offset'](_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x1c')]);}_0x5a9352[_0x22b2('0x3b')]=qs[_0x22b2('0x3c')](_0x5a7c90[_0x22b2('0x33')]['sort']);_0x5a9352[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x5a7c90[_0x22b2('0x33')],_0x2400fc[_0x22b2('0x3e')]),_0x3f6e69);if(_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x40')]){_0x5a9352['where']=_[_0x22b2('0x41')](_0x5a9352['where'],{'$or':_[_0x22b2('0x2c')](_0x3f6e69,function(_0x3a132b){if(_0x3a132b[_0x22b2('0x30')]!=='VIRTUAL'){var _0x23a113={};_0x23a113[_0x3a132b[_0x22b2('0x29')]]={'$like':'%'+_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x40')]+'%'};return _0x23a113;}})});}_0x5a9352=_['merge']({},_0x5a9352,_0x5a7c90[_0x22b2('0x42')]);var _0x1f02ee={'where':_0x5a9352[_0x22b2('0x3d')]};return db[_0x22b2('0x2d')][_0x22b2('0x43')](_0x1f02ee)[_0x22b2('0x24')](function(_0x3bb3a7){_0x2eb4f6[_0x22b2('0x43')]=_0x3bb3a7;if(_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x44')]){_0x5a9352[_0x22b2('0x45')]=[{'all':!![]}];}return db['Automation'][_0x22b2('0x46')](_0x5a9352);})[_0x22b2('0x24')](function(_0x39c48c){_0x2eb4f6[_0x22b2('0x47')]=_0x39c48c;return _0x2eb4f6;})[_0x22b2('0x24')](respondWithFilteredResult(_0x49013,_0x5a9352))[_0x22b2('0x48')](handleError(_0x49013,null));};exports[_0x22b2('0x49')]=function(_0x3cfd98,_0x5a7f73){var _0x4241f1={'raw':![],'where':{'id':_0x3cfd98[_0x22b2('0x4a')]['id']}},_0x4845bf={};_0x4845bf[_0x22b2('0x32')]=_['keys'](db[_0x22b2('0x2d')][_0x22b2('0x2e')]);_0x4845bf[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x3cfd98['query']);_0x4845bf[_0x22b2('0x3e')]=_['intersection'](_0x4845bf['model'],_0x4845bf[_0x22b2('0x33')]);_0x4241f1[_0x22b2('0x35')]=_['intersection'](_0x4845bf['model'],qs['fields'](_0x3cfd98[_0x22b2('0x33')][_0x22b2('0x37')]));_0x4241f1['attributes']=_0x4241f1[_0x22b2('0x35')][_0x22b2('0x38')]?_0x4241f1['attributes']:_0x4845bf[_0x22b2('0x32')];if(_0x3cfd98['query'][_0x22b2('0x44')]){_0x4241f1[_0x22b2('0x45')]=[{'all':!![]}];}_0x4241f1=_[_0x22b2('0x41')]({},_0x4241f1,_0x3cfd98[_0x22b2('0x42')]);return db[_0x22b2('0x2d')]['find'](_0x4241f1)['then'](handleEntityNotFound(_0x5a7f73,null))[_0x22b2('0x24')](respondWithResult(_0x5a7f73,null))[_0x22b2('0x48')](handleError(_0x5a7f73,null));};exports[_0x22b2('0x4b')]=function(_0x559a80,_0x1e3fae){return db[_0x22b2('0x2d')][_0x22b2('0x4b')](_0x559a80[_0x22b2('0x4c')],{})['then'](respondWithResult(_0x1e3fae,0xc9))[_0x22b2('0x48')](handleError(_0x1e3fae,null));};exports[_0x22b2('0x23')]=function(_0x79755a,_0x54d43a){if(_0x79755a[_0x22b2('0x4c')]['id']){delete _0x79755a[_0x22b2('0x4c')]['id'];}return db[_0x22b2('0x2d')]['find']({'where':{'id':_0x79755a[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x54d43a,null))[_0x22b2('0x24')](saveUpdates(_0x79755a[_0x22b2('0x4c')],null))[_0x22b2('0x24')](respondWithResult(_0x54d43a,null))[_0x22b2('0x48')](handleError(_0x54d43a,null));};exports['destroy']=function(_0x53d7d0,_0x235a6d){return db[_0x22b2('0x2d')]['find']({'where':{'id':_0x53d7d0['params']['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x235a6d,null))[_0x22b2('0x24')](removeEntity(_0x235a6d,null))['catch'](handleError(_0x235a6d,null));};exports[_0x22b2('0x4d')]=function(_0x3ca91f,_0x31718d,_0x56588b){return db[_0x22b2('0x4e')]['find']({'where':{'id':_0x3ca91f[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x31718d,null))['then'](function(_0xb58683){if(_0xb58683){return _0xb58683['addConditions'](_0x3ca91f[_0x22b2('0x4c')]['ids'],_[_0x22b2('0x4f')](_0x3ca91f[_0x22b2('0x4c')],[_0x22b2('0x50'),'id'])||{});}})[_0x22b2('0x24')](respondWithResult(_0x31718d,null))[_0x22b2('0x48')](handleError(_0x31718d,null));};exports[_0x22b2('0x51')]=function(_0x577e5f,_0x19f760,_0x32544d){var _0x19c8dc={};var _0x25be83={};var _0x1f1f05;var _0x48406f;return db[_0x22b2('0x2d')][_0x22b2('0x52')]({'where':{'id':_0x577e5f[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x19f760,null))[_0x22b2('0x24')](function(_0x4976b4){if(_0x4976b4){_0x1f1f05=_0x4976b4;_0x25be83['model']=_['keys'](db[_0x22b2('0x4e')][_0x22b2('0x2e')]);_0x25be83[_0x22b2('0x33')]=_['keys'](_0x577e5f[_0x22b2('0x33')]);_0x25be83[_0x22b2('0x3e')]=_['intersection'](_0x25be83[_0x22b2('0x32')],_0x25be83[_0x22b2('0x33')]);_0x19c8dc[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x25be83[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x37')]));_0x19c8dc['attributes']=_0x19c8dc['attributes']['length']?_0x19c8dc['attributes']:_0x25be83[_0x22b2('0x32')];_0x19c8dc[_0x22b2('0x3b')]=qs[_0x22b2('0x3c')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x3c')]);_0x19c8dc[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x577e5f['query'],_0x25be83[_0x22b2('0x3e')]));if(_0x577e5f[_0x22b2('0x33')][_0x22b2('0x40')]){_0x19c8dc[_0x22b2('0x3d')]=_['merge'](_0x19c8dc[_0x22b2('0x3d')],{'$or':_[_0x22b2('0x2c')](_0x19c8dc[_0x22b2('0x35')],function(_0x541b9f){var _0x4a685c={};_0x4a685c[_0x541b9f]={'$like':'%'+_0x577e5f['query'][_0x22b2('0x40')]+'%'};return _0x4a685c;})});}_0x19c8dc=_['merge']({},_0x19c8dc,_0x577e5f[_0x22b2('0x42')]);return _0x1f1f05[_0x22b2('0x51')](_0x19c8dc);}})[_0x22b2('0x24')](function(_0x51e449){if(_0x51e449){_0x48406f=_0x51e449['length'];if(!_0x577e5f[_0x22b2('0x33')][_0x22b2('0x39')]('nolimit')){_0x19c8dc[_0x22b2('0x1e')]=qs[_0x22b2('0x1e')](_0x577e5f[_0x22b2('0x33')]['limit']);_0x19c8dc[_0x22b2('0x1c')]=qs[_0x22b2('0x1c')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x1c')]);}return _0x1f1f05['getConditions'](_0x19c8dc);}})[_0x22b2('0x24')](function(_0x3870b7){if(_0x3870b7){return _0x3870b7?{'count':_0x48406f,'rows':_0x3870b7}:null;}})[_0x22b2('0x24')](respondWithResult(_0x19f760,null))['catch'](handleError(_0x19f760,null));};exports['addActions']=function(_0x49ffe6,_0x4a8d33,_0x2b02dc){return db[_0x22b2('0x53')][_0x22b2('0x54')]({'where':{'id':_0x49ffe6[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x4a8d33,null))[_0x22b2('0x24')](function(_0xab0249){if(_0xab0249){return _0xab0249[_0x22b2('0x55')](_0x49ffe6[_0x22b2('0x4c')]['ids'],_[_0x22b2('0x4f')](_0x49ffe6[_0x22b2('0x4c')],[_0x22b2('0x50'),'id'])||{});}})[_0x22b2('0x24')](respondWithResult(_0x4a8d33,null))[_0x22b2('0x48')](handleError(_0x4a8d33,null));};exports[_0x22b2('0x56')]=function(_0x515032,_0x8d21f1,_0xbe7635){var _0x2840c9={};var _0x408148={};var _0x33f83b;var _0x918877;return db[_0x22b2('0x2d')][_0x22b2('0x52')]({'where':{'id':_0x515032[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x8d21f1,null))[_0x22b2('0x24')](function(_0x59036e){if(_0x59036e){_0x33f83b=_0x59036e;_0x408148[_0x22b2('0x32')]=_[_0x22b2('0x34')](db[_0x22b2('0x53')][_0x22b2('0x2e')]);_0x408148[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x515032['query']);_0x408148[_0x22b2('0x3e')]=_[_0x22b2('0x36')](_0x408148[_0x22b2('0x32')],_0x408148[_0x22b2('0x33')]);_0x2840c9[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x408148[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x515032[_0x22b2('0x33')]['fields']));_0x2840c9[_0x22b2('0x35')]=_0x2840c9[_0x22b2('0x35')][_0x22b2('0x38')]?_0x2840c9[_0x22b2('0x35')]:_0x408148[_0x22b2('0x32')];_0x2840c9['order']=qs[_0x22b2('0x3c')](_0x515032[_0x22b2('0x33')][_0x22b2('0x3c')]);_0x2840c9[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x515032[_0x22b2('0x33')],_0x408148[_0x22b2('0x3e')]));if(_0x515032[_0x22b2('0x33')][_0x22b2('0x40')]){_0x2840c9['where']=_[_0x22b2('0x41')](_0x2840c9['where'],{'$or':_['map'](_0x2840c9[_0x22b2('0x35')],function(_0x542412){var _0x2e5eee={};_0x2e5eee[_0x542412]={'$like':'%'+_0x515032[_0x22b2('0x33')][_0x22b2('0x40')]+'%'};return _0x2e5eee;})});}_0x2840c9=_['merge']({},_0x2840c9,_0x515032['options']);return _0x33f83b['getActions'](_0x2840c9);}})[_0x22b2('0x24')](function(_0x5f1d2d){if(_0x5f1d2d){_0x918877=_0x5f1d2d['length'];if(!_0x515032[_0x22b2('0x33')][_0x22b2('0x39')](_0x22b2('0x3a'))){_0x2840c9[_0x22b2('0x1e')]=qs[_0x22b2('0x1e')](_0x515032[_0x22b2('0x33')][_0x22b2('0x1e')]);_0x2840c9[_0x22b2('0x1c')]=qs[_0x22b2('0x1c')](_0x515032[_0x22b2('0x33')][_0x22b2('0x1c')]);}return _0x33f83b[_0x22b2('0x56')](_0x2840c9);}})[_0x22b2('0x24')](function(_0x2102e5){if(_0x2102e5){return _0x2102e5?{'count':_0x918877,'rows':_0x2102e5}:null;}})[_0x22b2('0x24')](respondWithResult(_0x8d21f1,null))[_0x22b2('0x48')](handleError(_0x8d21f1,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6c87520..b1bffc5 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e48=['tools_automations','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x24d6a2,_0x215264){var _0x3de4f6=function(_0x369d44){while(--_0x369d44){_0x24d6a2['push'](_0x24d6a2['shift']());}};_0x3de4f6(++_0x215264);}(_0x2e48,0x141));var _0x82e4=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0x2e48[_0x2353fe];return _0x4d43f6;};'use strict';var _=require(_0x82e4('0x0'));var util=require(_0x82e4('0x1'));var logger=require(_0x82e4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x82e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82e4('0x4'));var config=require(_0x82e4('0x5'));var attributes=require(_0x82e4('0x6'));module[_0x82e4('0x7')]=function(_0x48a58d,_0x2d24a4){return _0x48a58d[_0x82e4('0x8')]('Automation',attributes,{'tableName':_0x82e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc501=['path','../../config/environment','Automation','tools_automations','lodash','util','../../config/logger','bluebird'];(function(_0x4570f8,_0x358258){var _0x3ed54a=function(_0x1db86e){while(--_0x1db86e){_0x4570f8['push'](_0x4570f8['shift']());}};_0x3ed54a(++_0x358258);}(_0xc501,0x1b4));var _0x1c50=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0xc501[_0xc40b9f];return _0x535b9c;};'use strict';var _=require(_0x1c50('0x0'));var util=require(_0x1c50('0x1'));var logger=require(_0x1c50('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1c50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c50('0x4'));var rimraf=require('rimraf');var config=require(_0x1c50('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x2a4132,_0x4e8b46){return _0x2a4132['define'](_0x1c50('0x6'),attributes,{'tableName':_0x1c50('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 43eac96..a56f970 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3a8=['message','catch','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x4f3ce5,_0x3531f3){_0x4f3ce5=_0x4f3ce5-0x0;var _0x49b053=_0xf3a8[_0x4f3ce5];return _0x49b053;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var moment=require(_0x8f3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f3a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f3a('0x3'));var logger=require('../../config/logger')(_0x8f3a('0x4'));var config=require('../../config/environment');var jayson=require(_0x8f3a('0x5'));var client=jayson[_0x8f3a('0x6')][_0x8f3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32bb3a,_0xc50ed8,_0x2e290d){return new BPromise(function(_0x3dc1ea,_0xcfad11){return client[_0x8f3a('0x8')](_0x32bb3a,_0x2e290d)['then'](function(_0x2164ba){logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));logger[_0x8f3a('0xb')](_0x8f3a('0xc'),_0xc50ed8,_0x8f3a('0xa'),JSON['stringify'](_0x2164ba));if(_0x2164ba[_0x8f3a('0xd')]){if(_0x2164ba[_0x8f3a('0xd')]['code']===0x1f4){logger[_0x8f3a('0xd')]('Automation,\x20%s,\x20%s',_0xc50ed8,_0x2164ba['error'][_0x8f3a('0xe')]);return _0xcfad11(_0x2164ba[_0x8f3a('0xd')]['message']);}logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x2164ba[_0x8f3a('0xd')]['message']);return _0x3dc1ea(_0x2164ba[_0x8f3a('0xd')][_0x8f3a('0xe')]);}else{logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));_0x3dc1ea(_0x2164ba['result'][_0x8f3a('0xe')]);}})[_0x8f3a('0xf')](function(_0x9bf803){logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x9bf803);_0xcfad11(_0x9bf803);});});} \ No newline at end of file +var _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x1e2072,_0xe3cc90){_0x1e2072=_0x1e2072-0x0;var _0x22956b=_0x6582[_0x1e2072];return _0x22956b;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 69b2840..6131203 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03cf=['show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','util','path','Router','../../components/auth/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03cf,0x64));var _0xf03c=function(_0x3bcc4f,_0x3f476b){_0x3bcc4f=_0x3bcc4f-0x0;var _0x2f2654=_0x03cf[_0x3bcc4f];return _0x2f2654;};'use strict';var multer=require('multer');var util=require(_0xf03c('0x0'));var path=require(_0xf03c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf03c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf03c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf03c('0x4'));var controller=require(_0xf03c('0x5'));router[_0xf03c('0x6')]('/',auth['isAuthenticated'](),controller[_0xf03c('0x7')]);router[_0xf03c('0x6')](_0xf03c('0x8'),auth[_0xf03c('0x9')](),controller[_0xf03c('0xa')]);router[_0xf03c('0x6')]('/:id/conditions',auth[_0xf03c('0x9')](),controller[_0xf03c('0xb')]);router[_0xf03c('0x6')](_0xf03c('0xc'),auth[_0xf03c('0x9')](),controller[_0xf03c('0xd')]);router[_0xf03c('0xe')]('/',auth[_0xf03c('0x9')](),controller[_0xf03c('0xf')]);router[_0xf03c('0xe')](_0xf03c('0x10'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x11')]);router['post'](_0xf03c('0xc'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x12')]);router[_0xf03c('0x13')]('/:id',auth[_0xf03c('0x9')](),controller[_0xf03c('0x14')]);router['delete'](_0xf03c('0x8'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7fa9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','getConditions','/:id/actions','getActions','create','post','addActions','put','update','delete','destroy','multer','path'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x7fa9,0x76));var _0x97fa=function(_0x1e5af8,_0x5c2b3a){_0x1e5af8=_0x1e5af8-0x0;var _0x264c4f=_0x7fa9[_0x1e5af8];return _0x264c4f;};'use strict';var multer=require(_0x97fa('0x0'));var util=require('util');var path=require(_0x97fa('0x1'));var timeout=require(_0x97fa('0x2'));var express=require(_0x97fa('0x3'));var router=express[_0x97fa('0x4')]();var fs_extra=require(_0x97fa('0x5'));var auth=require(_0x97fa('0x6'));var interaction=require(_0x97fa('0x7'));var config=require('../../config/environment');var controller=require(_0x97fa('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97fa('0x9')](_0x97fa('0xa'),auth['isAuthenticated'](),controller[_0x97fa('0xb')]);router[_0x97fa('0x9')](_0x97fa('0xc'),auth[_0x97fa('0xd')](),controller[_0x97fa('0xe')]);router[_0x97fa('0x9')](_0x97fa('0xf'),auth['isAuthenticated'](),controller[_0x97fa('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x97fa('0x11')]);router[_0x97fa('0x12')]('/:id/conditions',auth[_0x97fa('0xd')](),controller['addConditions']);router[_0x97fa('0x12')](_0x97fa('0xf'),auth[_0x97fa('0xd')](),controller[_0x97fa('0x13')]);router[_0x97fa('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x97fa('0x15')]);router[_0x97fa('0x16')](_0x97fa('0xa'),auth[_0x97fa('0xd')](),controller[_0x97fa('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 12f8580..49aa67c 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b4b=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x37b792,_0x14b064){var _0xfcd8b=function(_0x28663b){while(--_0x28663b){_0x37b792['push'](_0x37b792['shift']());}};_0xfcd8b(++_0x14b064);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x0b4b[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xb0b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0b4('0x1')],'unique':_0xb0b4('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb0b4('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb0b4('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb0b4('0x4')},'limitCalls':{'type':Sequelize[_0xb0b4('0x5')](0x4)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb0b4('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb0b4('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0b4('0xd')},'dialTimezone':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':_0xb0b4('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x10'),_0xb0b4('0x11'),_0xb0b4('0x12')),'defaultValue':_0xb0b4('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb0b4('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb0b4('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0b4('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0b4('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb0b4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x18'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x19')},'dialCutDigit':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x23')}}; \ No newline at end of file +var _0xcf1c=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','always','never','onlyIfOpen','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5699af,_0x3fb494){var _0x699a79=function(_0x120f04){while(--_0x120f04){_0x5699af['push'](_0x5699af['shift']());}};_0x699a79(++_0x3fb494);}(_0xcf1c,0x1f0));var _0xccf1=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xcf1c[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0xccf1('0x0'));module['exports']={'name':{'type':Sequelize[_0xccf1('0x1')],'unique':_0xccf1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xccf1('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xccf1('0x4')],'defaultValue':0x0,'comment':_0xccf1('0x5')},'limitCalls':{'type':Sequelize[_0xccf1('0x6')](0x4)[_0xccf1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xccf1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xccf1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xccf1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xccf1('0xe')](_0xccf1('0xf'),_0xccf1('0x10'),_0xccf1('0x11')),'defaultValue':_0xccf1('0xf')},'dialAMDActive':{'type':Sequelize[_0xccf1('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xccf1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xccf1('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xccf1('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xccf1('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xccf1('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xccf1('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xccf1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xccf1('0xe')](_0xccf1('0x17'),'ASC'),'defaultValue':_0xccf1('0x17')},'dialPrefix':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xccf1('0x18')},'dialCutDigit':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xccf1('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5a35e82..2285344 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91d5=['ListId','field','phone','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','toString','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','include','findAll','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId'];(function(_0x98e634,_0x1b0126){var _0x52fa87=function(_0x3dc45b){while(--_0x3dc45b){_0x98e634['push'](_0x98e634['shift']());}};_0x52fa87(++_0x1b0126);}(_0x91d5,0xa2));var _0x591d=function(_0x2aa12f,_0xa81e42){_0x2aa12f=_0x2aa12f-0x0;var _0x30afdf=_0x91d5[_0x2aa12f];return _0x30afdf;};'use strict';var emlformat=require(_0x591d('0x0'));var rimraf=require(_0x591d('0x1'));var zipdir=require(_0x591d('0x2'));var jsonpatch=require(_0x591d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x591d('0x4'));var Mustache=require('mustache');var util=require(_0x591d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x591d('0x6'));var ejs=require(_0x591d('0x7'));var fs=require('fs');var fs_extra=require(_0x591d('0x8'));var _=require(_0x591d('0x9'));var squel=require(_0x591d('0xa'));var crypto=require(_0x591d('0xb'));var jsforce=require(_0x591d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x591d('0xd'));var Redis=require(_0x591d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x591d('0xf'));var as=require(_0x591d('0x10'));var hardwareService=require(_0x591d('0x11'));var logger=require(_0x591d('0x12'))(_0x591d('0x13'));var utils=require('../../config/utils');var config=require(_0x591d('0x14'));var licenseUtil=require(_0x591d('0x15'));var db=require(_0x591d('0x16'))['db'];function respondWithStatusCode(_0x1a582e,_0x4df13f){_0x4df13f=_0x4df13f||0xcc;return function(_0x25f440){if(_0x25f440){return _0x1a582e[_0x591d('0x17')](_0x4df13f);}return _0x1a582e[_0x591d('0x18')](_0x4df13f)[_0x591d('0x19')]();};}function respondWithResult(_0x299fcd,_0x495369){_0x495369=_0x495369||0xc8;return function(_0x30498d){if(_0x30498d){return _0x299fcd[_0x591d('0x18')](_0x495369)[_0x591d('0x1a')](_0x30498d);}};}function respondWithFilteredResult(_0x5d676f,_0x3a88bb){return function(_0x3cc824){if(_0x3cc824){var _0xd3c185=typeof _0x3a88bb[_0x591d('0x1b')]===_0x591d('0x1c')&&typeof _0x3a88bb['limit']===_0x591d('0x1c');var _0x25ebac=_0x3cc824[_0x591d('0x1d')];var _0x2c88dd=_0xd3c185?0x0:_0x3a88bb[_0x591d('0x1b')];var _0x3abba4=_0xd3c185?_0x3cc824['count']:_0x3a88bb[_0x591d('0x1b')]+_0x3a88bb[_0x591d('0x1e')];var _0x7d0083;if(_0x3abba4>=_0x25ebac){_0x3abba4=_0x25ebac;_0x7d0083=0xc8;}else{_0x7d0083=0xce;}_0x5d676f[_0x591d('0x18')](_0x7d0083);return _0x5d676f[_0x591d('0x1f')](_0x591d('0x20'),_0x2c88dd+'-'+_0x3abba4+'/'+_0x25ebac)[_0x591d('0x1a')](_0x3cc824);}return null;};}function patchUpdates(_0x1284e0){return function(_0x57d08a){try{jsonpatch[_0x591d('0x21')](_0x57d08a,_0x1284e0,!![]);}catch(_0x40f3f6){return BPromise['reject'](_0x40f3f6);}return _0x57d08a[_0x591d('0x22')]();};}function saveUpdates(_0x1277bf,_0x4d013c){return function(_0x278702){if(_0x278702){return _0x278702[_0x591d('0x23')](_0x1277bf)[_0x591d('0x24')](function(_0x3ec033){return _0x3ec033;});}return null;};}function removeEntity(_0x1fa77c,_0x9e8888){return function(_0x210600){if(_0x210600){return _0x210600[_0x591d('0x25')]()[_0x591d('0x24')](function(){var _0x2267df=_0x210600[_0x591d('0x26')]({'plain':!![]});var _0x1ddc8d=_0x591d('0x27');return db['UserProfileResource'][_0x591d('0x25')]({'where':{'type':_0x1ddc8d,'resourceId':_0x2267df['id']}})[_0x591d('0x24')](function(){return _0x210600;});})[_0x591d('0x24')](function(){_0x1fa77c[_0x591d('0x18')](0xcc)[_0x591d('0x19')]();});}};}function handleEntityNotFound(_0x5e4070,_0x534c5d){return function(_0x11e20f){if(!_0x11e20f){_0x5e4070[_0x591d('0x17')](0x194);}return _0x11e20f;};}function handleError(_0x3bf27a,_0x24aa87){_0x24aa87=_0x24aa87||0x1f4;return function(_0x5b78f2){logger[_0x591d('0x28')](_0x5b78f2[_0x591d('0x29')]);if(_0x5b78f2[_0x591d('0x2a')]){delete _0x5b78f2['name'];}_0x3bf27a[_0x591d('0x18')](_0x24aa87)[_0x591d('0x2b')](_0x5b78f2);};}exports[_0x591d('0x2c')]=function(_0x1716a1,_0x2c867d){var _0xaaf8fa={},_0x426042={},_0x42984b={'count':0x0,'rows':[]};var _0x3646f0=_[_0x591d('0x2d')](db['Campaign'][_0x591d('0x2e')],function(_0x49f6b5){return{'name':_0x49f6b5['fieldName'],'type':_0x49f6b5[_0x591d('0x2f')][_0x591d('0x30')]};});_0x426042['model']=_[_0x591d('0x2d')](_0x3646f0,_0x591d('0x2a'));_0x426042['query']=_[_0x591d('0x31')](_0x1716a1[_0x591d('0x32')]);_0x426042['filters']=_[_0x591d('0x33')](_0x426042['model'],_0x426042[_0x591d('0x32')]);_0xaaf8fa[_0x591d('0x34')]=_[_0x591d('0x33')](_0x426042[_0x591d('0x35')],qs[_0x591d('0x36')](_0x1716a1[_0x591d('0x32')][_0x591d('0x36')]));_0xaaf8fa['attributes']=_0xaaf8fa['attributes'][_0x591d('0x37')]?_0xaaf8fa[_0x591d('0x34')]:_0x426042[_0x591d('0x35')];if(!_0x1716a1[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0xaaf8fa[_0x591d('0x1e')]=qs['limit'](_0x1716a1[_0x591d('0x32')]['limit']);_0xaaf8fa[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x1716a1[_0x591d('0x32')][_0x591d('0x1b')]);}_0xaaf8fa[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x1716a1[_0x591d('0x32')]['sort']);_0xaaf8fa[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_[_0x591d('0x3e')](_0x1716a1[_0x591d('0x32')],_0x426042[_0x591d('0x3d')]),_0x3646f0);if(_0x1716a1[_0x591d('0x32')][_0x591d('0x3f')]){_0xaaf8fa[_0x591d('0x3c')]=_[_0x591d('0x40')](_0xaaf8fa[_0x591d('0x3c')],{'$or':_['map'](_0x3646f0,function(_0x4f6d75){if(_0x4f6d75[_0x591d('0x2f')]!==_0x591d('0x41')){var _0x35c3f6={};_0x35c3f6[_0x4f6d75['name']]={'$like':'%'+_0x1716a1[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x35c3f6;}})});}_0xaaf8fa=_['merge']({},_0xaaf8fa,_0x1716a1[_0x591d('0x42')]);var _0x15c75d={'where':_0xaaf8fa[_0x591d('0x3c')]};return db[_0x591d('0x43')][_0x591d('0x1d')](_0x15c75d)[_0x591d('0x24')](function(_0x4ea7b9){_0x42984b['count']=_0x4ea7b9;if(_0x1716a1['query']['includeAll']){_0xaaf8fa[_0x591d('0x44')]=[{'all':!![]}];}return db[_0x591d('0x43')][_0x591d('0x45')](_0xaaf8fa);})[_0x591d('0x24')](function(_0x280932){_0x42984b[_0x591d('0x46')]=_0x280932;return _0x42984b;})[_0x591d('0x24')](respondWithFilteredResult(_0x2c867d,_0xaaf8fa))[_0x591d('0x47')](handleError(_0x2c867d,null));};exports[_0x591d('0x48')]=function(_0x38185f,_0x22a434){var _0x40e8f6={'raw':![],'where':{'id':_0x38185f[_0x591d('0x49')]['id']}},_0x1e314b={};_0x1e314b[_0x591d('0x35')]=_['keys'](db[_0x591d('0x43')][_0x591d('0x2e')]);_0x1e314b[_0x591d('0x32')]=_[_0x591d('0x31')](_0x38185f[_0x591d('0x32')]);_0x1e314b[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x1e314b[_0x591d('0x35')],_0x1e314b[_0x591d('0x32')]);_0x40e8f6[_0x591d('0x34')]=_[_0x591d('0x33')](_0x1e314b['model'],qs['fields'](_0x38185f[_0x591d('0x32')][_0x591d('0x36')]));_0x40e8f6[_0x591d('0x34')]=_0x40e8f6['attributes']['length']?_0x40e8f6['attributes']:_0x1e314b[_0x591d('0x35')];if(_0x38185f[_0x591d('0x32')][_0x591d('0x4a')]){_0x40e8f6['include']=[{'all':!![]}];}_0x40e8f6=_['merge']({},_0x40e8f6,_0x38185f[_0x591d('0x42')]);return db['Campaign'][_0x591d('0x4b')](_0x40e8f6)[_0x591d('0x24')](handleEntityNotFound(_0x22a434,null))[_0x591d('0x24')](respondWithResult(_0x22a434,null))['catch'](handleError(_0x22a434,null));};exports[_0x591d('0x4c')]=function(_0x58410b,_0x3ef456){return db[_0x591d('0x43')][_0x591d('0x4c')](_0x58410b['body'],{})['then'](function(_0x109739){var _0x4ecf62=_0x58410b['user']['get']({'plain':!![]});if(!_0x4ecf62)throw new Error(_0x591d('0x4d'));if(_0x4ecf62[_0x591d('0x4e')]===_0x591d('0x4f')){var _0x59f201=_0x109739[_0x591d('0x26')]({'plain':!![]});var _0x4c1850=_0x591d('0x27');return db[_0x591d('0x50')][_0x591d('0x4b')]({'where':{'name':_0x4c1850,'userProfileId':_0x4ecf62[_0x591d('0x51')]},'raw':!![]})[_0x591d('0x24')](function(_0x2cc77f){if(_0x2cc77f&&_0x2cc77f[_0x591d('0x52')]===0x0){return db[_0x591d('0x53')][_0x591d('0x4c')]({'name':_0x59f201['name'],'resourceId':_0x59f201['id'],'type':_0x2cc77f[_0x591d('0x2a')],'sectionId':_0x2cc77f['id']},{})[_0x591d('0x24')](function(){return _0x109739;});}else{return _0x109739;}})[_0x591d('0x47')](function(_0x299013){logger['error'](_0x591d('0x54'),_0x299013);throw _0x299013;});}return _0x109739;})[_0x591d('0x24')](respondWithResult(_0x3ef456,0xc9))[_0x591d('0x47')](handleError(_0x3ef456,null));};exports[_0x591d('0x55')]=function(_0x27f125,_0x806783){var _0x5c323d={'where':{'id':_0x27f125[_0x591d('0x49')]['id']}},_0x427ca8={};_0x427ca8[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x43')][_0x591d('0x2e')]);_0x5c323d[_0x591d('0x34')]=_[_0x591d('0x33')](_0x427ca8['model'],qs['fields'](_0x27f125[_0x591d('0x32')][_0x591d('0x36')]));_0x5c323d['attributes']=_0x5c323d['attributes'][_0x591d('0x37')]?_0x5c323d[_0x591d('0x34')]:_0x427ca8['model'];if(_0x27f125[_0x591d('0x32')][_0x591d('0x4a')]){_0x5c323d['include']=[{'all':!![]}];}_0x5c323d=_['merge']({},_0x5c323d,_0x27f125[_0x591d('0x42')]);return db[_0x591d('0x43')][_0x591d('0x4b')](_0x5c323d)['then'](handleEntityNotFound(_0x806783,null))[_0x591d('0x24')](function(_0x2500c7){if(_0x2500c7){var _0x8a800c=_0x2500c7['get']({'plain':!![]});_0x8a800c=qs[_0x591d('0x56')](_0x8a800c,['id',_0x591d('0x57'),'updatedAt']);_0x27f125[_0x591d('0x58')]=_[_0x591d('0x56')](_0x27f125[_0x591d('0x58')],['id',_0x591d('0x57'),_0x591d('0x59')]);return db[_0x591d('0x43')][_0x591d('0x4c')](_[_0x591d('0x40')](_0x8a800c,_0x27f125['body']),{'include':_0x27f125[_0x591d('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x591d('0x24')](function(_0x280c63){var _0x2e4395=_0x27f125['user'][_0x591d('0x26')]({'plain':!![]});if(!_0x2e4395)throw new Error(_0x591d('0x4d'));if(_0x2e4395['role']===_0x591d('0x4f')){var _0x595b08=_0x280c63[_0x591d('0x26')]({'plain':!![]});var _0xd5b009=_0x591d('0x27');return db[_0x591d('0x50')][_0x591d('0x4b')]({'where':{'name':_0xd5b009,'userProfileId':_0x2e4395['userProfileId']},'raw':!![]})[_0x591d('0x24')](function(_0x13341a){if(_0x13341a&&_0x13341a[_0x591d('0x52')]===0x0){return db[_0x591d('0x53')][_0x591d('0x4c')]({'name':_0x595b08[_0x591d('0x2a')],'resourceId':_0x595b08['id'],'type':_0x13341a[_0x591d('0x2a')],'sectionId':_0x13341a['id']},{})[_0x591d('0x24')](function(){return _0x280c63;});}else{return _0x280c63;}})[_0x591d('0x47')](function(_0x3d4d86){logger['error'](_0x591d('0x54'),_0x3d4d86);throw _0x3d4d86;});}return _0x280c63;});}})[_0x591d('0x24')](respondWithResult(_0x806783,0xc9))[_0x591d('0x47')](handleError(_0x806783,null));};exports[_0x591d('0x23')]=function(_0x575724,_0x4aeb5d){if(_0x575724[_0x591d('0x58')]['id']){delete _0x575724[_0x591d('0x58')]['id'];}return db['Campaign'][_0x591d('0x4b')]({'where':{'id':_0x575724[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x4aeb5d,null))[_0x591d('0x24')](saveUpdates(_0x575724[_0x591d('0x58')],null))[_0x591d('0x24')](respondWithResult(_0x4aeb5d,null))[_0x591d('0x47')](handleError(_0x4aeb5d,null));};exports[_0x591d('0x25')]=function(_0x3a1347,_0x5b7ad2){return db[_0x591d('0x43')]['find']({'where':{'id':_0x3a1347[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b7ad2,null))[_0x591d('0x24')](removeEntity(_0x5b7ad2,null))['catch'](handleError(_0x5b7ad2,null));};exports['getHoppers']=function(_0x59c9a9,_0x2625a5,_0x1995bb){var _0x23f81a={'raw':!![],'where':{}};var _0x242ac8={};var _0x3be5cb={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x59c9a9[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2625a5,null))[_0x591d('0x24')](function(_0x5c616b){if(_0x5c616b){_0x242ac8[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x5b')]['rawAttributes']);_0x242ac8[_0x591d('0x32')]=_[_0x591d('0x31')](_0x59c9a9[_0x591d('0x32')]);_0x242ac8[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x242ac8[_0x591d('0x35')],_0x242ac8[_0x591d('0x32')]);_0x23f81a[_0x591d('0x34')]=_['intersection'](_0x242ac8['model'],qs[_0x591d('0x36')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x36')]));_0x23f81a[_0x591d('0x34')]=_0x23f81a[_0x591d('0x34')][_0x591d('0x37')]?_0x23f81a['attributes']:_0x242ac8[_0x591d('0x35')];if(!_0x59c9a9['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x23f81a[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x1e')]);_0x23f81a[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x1b')]);}_0x23f81a[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x59c9a9['query']['sort']);_0x23f81a[_0x591d('0x3c')]=qs['filters'](_[_0x591d('0x3e')](_0x59c9a9[_0x591d('0x32')],_0x242ac8[_0x591d('0x3d')]));_0x23f81a[_0x591d('0x3c')][_0x591d('0x5c')]=_0x5c616b['id'];if(_0x59c9a9[_0x591d('0x32')][_0x591d('0x3f')]){_0x23f81a[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x23f81a[_0x591d('0x3c')],{'$or':_['map'](_0x23f81a[_0x591d('0x34')],function(_0x57d420){var _0x1ddd3c={};_0x1ddd3c[_0x57d420]={'$like':'%'+_0x59c9a9[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x1ddd3c;})});}_0x23f81a=_[_0x591d('0x40')]({},_0x23f81a,_0x59c9a9[_0x591d('0x42')]);return db[_0x591d('0x5b')]['count']({'where':_0x23f81a[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x333c14){_0x3be5cb[_0x591d('0x1d')]=_0x333c14;if(_0x59c9a9[_0x591d('0x32')][_0x591d('0x4a')]){_0x23f81a[_0x591d('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x591d('0x45')](_0x23f81a);})[_0x591d('0x24')](function(_0x1fb782){_0x3be5cb[_0x591d('0x46')]=_0x1fb782;return _0x3be5cb;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x2625a5,_0x23f81a))['catch'](handleError(_0x2625a5,null));};exports['getHopperHistories']=function(_0x26d554,_0xff53d1,_0x2df0bf){var _0x24c88b={'raw':!![],'where':{}};var _0x175879={};var _0xbb6b1d={'count':0x0,'rows':[]};return db[_0x591d('0x43')]['findOne']({'where':{'id':_0x26d554[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0xff53d1,null))[_0x591d('0x24')](function(_0x88b1b6){if(_0x88b1b6){_0x175879[_0x591d('0x35')]=_['keys'](db[_0x591d('0x5d')][_0x591d('0x2e')]);_0x175879[_0x591d('0x32')]=_[_0x591d('0x31')](_0x26d554[_0x591d('0x32')]);_0x175879[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x175879[_0x591d('0x35')],_0x175879[_0x591d('0x32')]);_0x24c88b['attributes']=_[_0x591d('0x33')](_0x175879[_0x591d('0x35')],qs[_0x591d('0x36')](_0x26d554['query'][_0x591d('0x36')]));_0x24c88b['attributes']=_0x24c88b[_0x591d('0x34')]['length']?_0x24c88b[_0x591d('0x34')]:_0x175879[_0x591d('0x35')];if(!_0x26d554[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0x24c88b[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x26d554[_0x591d('0x32')]['limit']);_0x24c88b['offset']=qs[_0x591d('0x1b')](_0x26d554[_0x591d('0x32')][_0x591d('0x1b')]);}_0x24c88b['order']=qs[_0x591d('0x3b')](_0x26d554[_0x591d('0x32')][_0x591d('0x3b')]);_0x24c88b['where']=qs['filters'](_[_0x591d('0x3e')](_0x26d554['query'],_0x175879[_0x591d('0x3d')]));_0x24c88b[_0x591d('0x3c')][_0x591d('0x5c')]=_0x88b1b6['id'];if(_0x26d554['query']['filter']){_0x24c88b[_0x591d('0x3c')]=_['merge'](_0x24c88b['where'],{'$or':_['map'](_0x24c88b[_0x591d('0x34')],function(_0x59c48a){var _0x146257={};_0x146257[_0x59c48a]={'$like':'%'+_0x26d554['query'][_0x591d('0x3f')]+'%'};return _0x146257;})});}_0x24c88b=_[_0x591d('0x40')]({},_0x24c88b,_0x26d554[_0x591d('0x42')]);return db['CmHopperHistory'][_0x591d('0x1d')]({'where':_0x24c88b[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x280fa6){_0xbb6b1d[_0x591d('0x1d')]=_0x280fa6;if(_0x26d554['query'][_0x591d('0x4a')]){_0x24c88b['include']=[{'all':!![]}];}return db[_0x591d('0x5d')][_0x591d('0x45')](_0x24c88b);})[_0x591d('0x24')](function(_0x5f08b4){_0xbb6b1d[_0x591d('0x46')]=_0x5f08b4;return _0xbb6b1d;});}})[_0x591d('0x24')](respondWithFilteredResult(_0xff53d1,_0x24c88b))[_0x591d('0x47')](handleError(_0xff53d1,null));};exports[_0x591d('0x5e')]=function(_0x5a06b1,_0x5bebd1,_0x5e5f0f){var _0x1dfec2={'raw':!![],'where':{}};var _0x2d7619={};var _0x1ade4c={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x5a06b1[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x5bebd1,null))[_0x591d('0x24')](function(_0x80f5cd){if(_0x80f5cd){_0x2d7619[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x5f')]['rawAttributes']);_0x2d7619[_0x591d('0x32')]=_['keys'](_0x5a06b1[_0x591d('0x32')]);_0x2d7619['filters']=_[_0x591d('0x33')](_0x2d7619['model'],_0x2d7619[_0x591d('0x32')]);_0x1dfec2[_0x591d('0x34')]=_[_0x591d('0x33')](_0x2d7619['model'],qs[_0x591d('0x36')](_0x5a06b1[_0x591d('0x32')][_0x591d('0x36')]));_0x1dfec2[_0x591d('0x34')]=_0x1dfec2[_0x591d('0x34')][_0x591d('0x37')]?_0x1dfec2['attributes']:_0x2d7619[_0x591d('0x35')];if(!_0x5a06b1['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x1dfec2[_0x591d('0x1e')]=qs['limit'](_0x5a06b1[_0x591d('0x32')][_0x591d('0x1e')]);_0x1dfec2[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x5a06b1[_0x591d('0x32')]['offset']);}_0x1dfec2[_0x591d('0x3a')]=qs['sort'](_0x5a06b1['query'][_0x591d('0x3b')]);_0x1dfec2[_0x591d('0x3c')]=qs['filters'](_[_0x591d('0x3e')](_0x5a06b1[_0x591d('0x32')],_0x2d7619['filters']));_0x1dfec2['where']['CampaignId']=_0x80f5cd['id'];if(_0x5a06b1[_0x591d('0x32')][_0x591d('0x3f')]){_0x1dfec2[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x1dfec2[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x1dfec2[_0x591d('0x34')],function(_0x3caaa7){var _0x45842c={};_0x45842c[_0x3caaa7]={'$like':'%'+_0x5a06b1[_0x591d('0x32')]['filter']+'%'};return _0x45842c;})});}_0x1dfec2=_[_0x591d('0x40')]({},_0x1dfec2,_0x5a06b1[_0x591d('0x42')]);return db[_0x591d('0x5f')][_0x591d('0x1d')]({'where':_0x1dfec2['where']})[_0x591d('0x24')](function(_0x1a82bf){_0x1ade4c[_0x591d('0x1d')]=_0x1a82bf;if(_0x5a06b1[_0x591d('0x32')][_0x591d('0x4a')]){_0x1dfec2[_0x591d('0x44')]=[{'all':!![]}];}return db[_0x591d('0x5f')]['findAll'](_0x1dfec2);})[_0x591d('0x24')](function(_0x4184a3){_0x1ade4c['rows']=_0x4184a3;return _0x1ade4c;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x5bebd1,_0x1dfec2))[_0x591d('0x47')](handleError(_0x5bebd1,null));};exports[_0x591d('0x60')]=function(_0x1c7cd7,_0x34e1d7,_0x4d36ac){var _0x188b44={'raw':!![],'where':{}};var _0x51d99f={};var _0x45ba97={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x1c7cd7[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x34e1d7,null))[_0x591d('0x24')](function(_0x2b4122){if(_0x2b4122){_0x51d99f[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x61')]['rawAttributes']);_0x51d99f[_0x591d('0x32')]=_[_0x591d('0x31')](_0x1c7cd7[_0x591d('0x32')]);_0x51d99f[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x51d99f['model'],_0x51d99f['query']);_0x188b44[_0x591d('0x34')]=_[_0x591d('0x33')](_0x51d99f[_0x591d('0x35')],qs[_0x591d('0x36')](_0x1c7cd7[_0x591d('0x32')]['fields']));_0x188b44['attributes']=_0x188b44[_0x591d('0x34')][_0x591d('0x37')]?_0x188b44[_0x591d('0x34')]:_0x51d99f[_0x591d('0x35')];if(!_0x1c7cd7['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x188b44['limit']=qs[_0x591d('0x1e')](_0x1c7cd7['query']['limit']);_0x188b44[_0x591d('0x1b')]=qs['offset'](_0x1c7cd7['query']['offset']);}_0x188b44[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x1c7cd7['query'][_0x591d('0x3b')]);_0x188b44['where']=qs['filters'](_[_0x591d('0x3e')](_0x1c7cd7[_0x591d('0x32')],_0x51d99f['filters']));_0x188b44['where'][_0x591d('0x5c')]=_0x2b4122['id'];if(_0x1c7cd7[_0x591d('0x32')][_0x591d('0x3f')]){_0x188b44[_0x591d('0x3c')]=_['merge'](_0x188b44[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x188b44[_0x591d('0x34')],function(_0x5c6d6e){var _0x5daaa2={};_0x5daaa2[_0x5c6d6e]={'$like':'%'+_0x1c7cd7[_0x591d('0x32')]['filter']+'%'};return _0x5daaa2;})});}_0x188b44=_[_0x591d('0x40')]({},_0x188b44,_0x1c7cd7['options']);return db[_0x591d('0x61')][_0x591d('0x1d')]({'where':_0x188b44[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x1d558c){_0x45ba97[_0x591d('0x1d')]=_0x1d558c;if(_0x1c7cd7['query'][_0x591d('0x4a')]){_0x188b44['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x188b44);})[_0x591d('0x24')](function(_0x4523bb){_0x45ba97['rows']=_0x4523bb;return _0x45ba97;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x34e1d7,_0x188b44))[_0x591d('0x47')](handleError(_0x34e1d7,null));};exports[_0x591d('0x62')]=function(_0x49698e,_0x541caf,_0x41de07){var _0x17d1d4={};var _0x584946={};var _0x32bc29;var _0x1ffa38;return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x49698e[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x541caf,null))[_0x591d('0x24')](function(_0x364137){if(_0x364137){_0x32bc29=_0x364137;_0x584946['model']=_[_0x591d('0x31')](db[_0x591d('0x63')][_0x591d('0x2e')]);_0x584946[_0x591d('0x32')]=_[_0x591d('0x31')](_0x49698e[_0x591d('0x32')]);_0x584946[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x584946['model'],_0x584946[_0x591d('0x32')]);_0x17d1d4['attributes']=_[_0x591d('0x33')](_0x584946['model'],qs[_0x591d('0x36')](_0x49698e[_0x591d('0x32')][_0x591d('0x36')]));_0x17d1d4['attributes']=_0x17d1d4['attributes']['length']?_0x17d1d4[_0x591d('0x34')]:_0x584946[_0x591d('0x35')];_0x17d1d4[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x49698e[_0x591d('0x32')][_0x591d('0x3b')]);_0x17d1d4[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_['pick'](_0x49698e[_0x591d('0x32')],_0x584946[_0x591d('0x3d')]));if(_0x49698e[_0x591d('0x32')][_0x591d('0x3f')]){_0x17d1d4[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x17d1d4[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x17d1d4['attributes'],function(_0x4f664d){var _0x406a69={};_0x406a69[_0x4f664d]={'$like':'%'+_0x49698e['query']['filter']+'%'};return _0x406a69;})});}_0x17d1d4=_[_0x591d('0x40')]({},_0x17d1d4,_0x49698e[_0x591d('0x42')]);return _0x32bc29['getLists'](_0x17d1d4);}})['then'](function(_0x140d45){if(_0x140d45){_0x1ffa38=_0x140d45[_0x591d('0x37')];if(!_0x49698e[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0x17d1d4[_0x591d('0x1e')]=qs['limit'](_0x49698e[_0x591d('0x32')][_0x591d('0x1e')]);_0x17d1d4[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x49698e[_0x591d('0x32')][_0x591d('0x1b')]);}return _0x32bc29['getLists'](_0x17d1d4);}})[_0x591d('0x24')](function(_0x46b443){if(_0x46b443){return _0x46b443?{'count':_0x1ffa38,'rows':_0x46b443}:null;}})[_0x591d('0x24')](respondWithResult(_0x541caf,null))[_0x591d('0x47')](handleError(_0x541caf,null));};exports[_0x591d('0x64')]=function(_0x4ea093,_0x1dee81,_0xec2e50){var _0x2432f7,_0x441acf;return db[_0x591d('0x43')]['find']({'where':{'id':_0x4ea093[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x1dee81,null))[_0x591d('0x24')](function(_0xc42fa7){if(_0xc42fa7){_0x441acf=_0xc42fa7;return _0xc42fa7[_0x591d('0x64')](_0x4ea093[_0x591d('0x58')][_0x591d('0x65')],_[_0x591d('0x56')](_0x4ea093[_0x591d('0x58')],[_0x591d('0x65'),'id'])||{});}return null;})[_0x591d('0x66')](function(_0x3ca76){var _0x19e070;_0x2432f7=_0x3ca76||[];var _0x276a4f=[];if(_0x3ca76){for(var _0xacb29e=0x0;_0xacb29e<_0x3ca76[_0x591d('0x37')];_0xacb29e+=0x1){var _0x196dc8=_0x3ca76[_0xacb29e]['get']({'plain':!![]});_0x441acf['dialCheckDuplicateType']=_0x4ea093[_0x591d('0x58')][_0x591d('0x67')]?_0x4ea093[_0x591d('0x58')][_0x591d('0x67')]:_0x441acf[_0x591d('0x67')];switch(_0x441acf['dialCheckDuplicateType']){case'always':_0x19e070=squel[_0x591d('0x68')]()[_0x591d('0x69')](_0x591d('0x6a'))[_0x591d('0x6b')](['phone',_0x591d('0x6c'),_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel['select']()[_0x591d('0x6f')]('phone',_0x591d('0x70'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x6c'))[_0x591d('0x6f')]('id',_0x591d('0x6d'))[_0x591d('0x6f')](_0x196dc8[_0x591d('0x72')]['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093[_0x591d('0x49')]['id']['toString'](),'CampaignId')[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))['field']('NOW()',_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))[_0x591d('0x3c')](_0x591d('0x75'))[_0x591d('0x3c')]('ListId\x20=\x20?',_0x196dc8['CmListId']['toString']())[_0x591d('0x3c')](_0x591d('0x76'))[_0x591d('0x3c')](_0x591d('0x77'),squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x79'))[_0x591d('0x73')](_0x591d('0x7a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093['params']['id'][_0x591d('0x7c')]()))['where'](_0x591d('0x77'),squel['select']()[_0x591d('0x6f')](_0x591d('0x7d'))[_0x591d('0x73')](_0x591d('0x6a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093[_0x591d('0x49')]['id'][_0x591d('0x7c')]())))[_0x591d('0x7c')]();break;case _0x591d('0x7e'):_0x19e070=squel[_0x591d('0x68')]()[_0x591d('0x69')](_0x591d('0x6a'))[_0x591d('0x6b')]([_0x591d('0x70'),_0x591d('0x6c'),_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x70'),_0x591d('0x70'))[_0x591d('0x6f')](_0x591d('0x71'),'scheduledAt')[_0x591d('0x6f')]('id',_0x591d('0x6d'))[_0x591d('0x6f')](_0x196dc8[_0x591d('0x72')]['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093['params']['id'][_0x591d('0x7c')](),_0x591d('0x5c'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))['field'](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))['where'](_0x591d('0x75'))[_0x591d('0x3c')](_0x591d('0x7f'),_0x196dc8['CmListId']['toString']())[_0x591d('0x3c')](_0x591d('0x76'))['where'](_0x591d('0x77'),squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x7d'))['from'](_0x591d('0x6a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093[_0x591d('0x49')]['id'][_0x591d('0x7c')]())))['toString']();break;default:_0x19e070=squel['insert']()['into'](_0x591d('0x6a'))[_0x591d('0x6b')]([_0x591d('0x70'),_0x591d('0x6c'),'ContactId','ListId',_0x591d('0x5c'),_0x591d('0x57'),'updatedAt'],squel[_0x591d('0x78')]()['field'](_0x591d('0x70'),_0x591d('0x70'))['field'](_0x591d('0x71'),_0x591d('0x6c'))['field']('id','ContactId')['field'](_0x196dc8['CmListId']['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093['params']['id'][_0x591d('0x7c')](),_0x591d('0x5c'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))['where'](_0x591d('0x75'))[_0x591d('0x3c')](_0x591d('0x7f'),_0x196dc8[_0x591d('0x72')][_0x591d('0x7c')]())[_0x591d('0x3c')](_0x591d('0x76')))['toString']();}_0x276a4f[_0x591d('0x80')](db[_0x591d('0x81')][_0x591d('0x32')](_0x19e070));}return BPromise[_0x591d('0x82')](_0x276a4f);}})[_0x591d('0x24')](function(){return _0x2432f7;})[_0x591d('0x24')](respondWithResult(_0x1dee81,null))['catch'](handleError(_0x1dee81,null));};exports[_0x591d('0x83')]=function(_0x347971,_0x2b585a,_0x13322e){return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x347971[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x2b585a,null))['then'](function(_0xa31410){if(_0xa31410){return _0xa31410[_0x591d('0x83')](_0x347971[_0x591d('0x32')][_0x591d('0x65')]);}})[_0x591d('0x24')](function(_0x51f1c4){if(_0x51f1c4){return db[_0x591d('0x5b')][_0x591d('0x25')]({'where':{'ListId':_0x347971[_0x591d('0x32')][_0x591d('0x65')],'CampaignId':_0x347971['params']['id']}})[_0x591d('0x24')](function(){return _0x51f1c4;});}})[_0x591d('0x24')](respondWithStatusCode(_0x2b585a,null))[_0x591d('0x47')](handleError(_0x2b585a,null));};exports[_0x591d('0x84')]=function(_0x541d96,_0xeb1f2,_0x518d6a){var _0x71d2b5={};var _0x2552d6={};var _0x53aaad;var _0x45af5a;return db[_0x591d('0x43')]['findOne']({'where':{'id':_0x541d96[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0xeb1f2,null))[_0x591d('0x24')](function(_0x120c24){if(_0x120c24){_0x53aaad=_0x120c24;_0x2552d6[_0x591d('0x35')]=_[_0x591d('0x31')](db['CmList'][_0x591d('0x2e')]);_0x2552d6[_0x591d('0x32')]=_[_0x591d('0x31')](_0x541d96['query']);_0x2552d6[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x2552d6[_0x591d('0x35')],_0x2552d6[_0x591d('0x32')]);_0x71d2b5[_0x591d('0x34')]=_[_0x591d('0x33')](_0x2552d6[_0x591d('0x35')],qs[_0x591d('0x36')](_0x541d96['query'][_0x591d('0x36')]));_0x71d2b5[_0x591d('0x34')]=_0x71d2b5[_0x591d('0x34')][_0x591d('0x37')]?_0x71d2b5['attributes']:_0x2552d6[_0x591d('0x35')];_0x71d2b5['order']=qs[_0x591d('0x3b')](_0x541d96[_0x591d('0x32')]['sort']);_0x71d2b5[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_[_0x591d('0x3e')](_0x541d96[_0x591d('0x32')],_0x2552d6[_0x591d('0x3d')]));if(_0x541d96[_0x591d('0x32')][_0x591d('0x3f')]){_0x71d2b5[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x71d2b5[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x71d2b5[_0x591d('0x34')],function(_0x16d41){var _0x356cf2={};_0x356cf2[_0x16d41]={'$like':'%'+_0x541d96[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x356cf2;})});}_0x71d2b5=_[_0x591d('0x40')]({},_0x71d2b5,_0x541d96[_0x591d('0x42')]);return _0x53aaad['getBlackLists'](_0x71d2b5);}})['then'](function(_0x144c22){if(_0x144c22){_0x45af5a=_0x144c22[_0x591d('0x37')];if(!_0x541d96[_0x591d('0x32')][_0x591d('0x38')]('nolimit')){_0x71d2b5[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x541d96[_0x591d('0x32')][_0x591d('0x1e')]);_0x71d2b5['offset']=qs[_0x591d('0x1b')](_0x541d96[_0x591d('0x32')]['offset']);}return _0x53aaad[_0x591d('0x84')](_0x71d2b5);}})[_0x591d('0x24')](function(_0x2df9a7){if(_0x2df9a7){return _0x2df9a7?{'count':_0x45af5a,'rows':_0x2df9a7}:null;}})[_0x591d('0x24')](respondWithResult(_0xeb1f2,null))[_0x591d('0x47')](handleError(_0xeb1f2,null));};exports[_0x591d('0x85')]=function(_0x25ca14,_0x2cf54e,_0x8f6e7){var _0x21f54d,_0x59681b;return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x25ca14[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cf54e,null))['then'](function(_0x1d11de){if(_0x1d11de){_0x59681b=_0x1d11de;return _0x1d11de[_0x591d('0x85')](_0x25ca14[_0x591d('0x58')]['ids'],_[_0x591d('0x56')](_0x25ca14[_0x591d('0x58')],[_0x591d('0x65'),'id'])||{});}return null;})[_0x591d('0x66')](function(_0x338ff9){var _0x13bd81;_0x21f54d=_0x338ff9||[];var _0x1676fb=[];if(_0x338ff9){for(var _0x4ebf73=0x0;_0x4ebf73<_0x338ff9['length'];_0x4ebf73+=0x1){var _0x1f2825=_0x338ff9[_0x4ebf73][_0x591d('0x26')]({'plain':!![]});_0x13bd81=squel[_0x591d('0x68')]()['into'](_0x591d('0x86'))[_0x591d('0x6b')](['phone',_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x70'),'phone')['field']('id',_0x591d('0x6d'))['field'](_0x1f2825[_0x591d('0x72')][_0x591d('0x7c')](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x25ca14[_0x591d('0x49')]['id']['toString'](),'CampaignId')[_0x591d('0x6f')](_0x591d('0x71'),'createdAt')[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))[_0x591d('0x3c')](_0x591d('0x75'))[_0x591d('0x3c')]('ListId\x20=\x20?',_0x1f2825[_0x591d('0x72')][_0x591d('0x7c')]())['where'](_0x591d('0x76')))[_0x591d('0x7c')]();_0x1676fb[_0x591d('0x80')](db[_0x591d('0x81')]['query'](_0x13bd81));}return BPromise[_0x591d('0x82')](_0x1676fb);}})['then'](function(){return _0x21f54d;})['then'](respondWithResult(_0x2cf54e,null))[_0x591d('0x47')](handleError(_0x2cf54e,null));};exports[_0x591d('0x87')]=function(_0x5317a6,_0x58788a,_0x21b1c2){return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x5317a6[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x58788a,null))[_0x591d('0x24')](function(_0x308df8){if(_0x308df8){return _0x308df8['removeBlackLists'](_0x5317a6[_0x591d('0x32')][_0x591d('0x65')]);}})[_0x591d('0x24')](function(_0x566b58){if(_0x566b58){return db[_0x591d('0x61')][_0x591d('0x25')]({'where':{'ListId':_0x5317a6[_0x591d('0x32')][_0x591d('0x65')],'CampaignId':_0x5317a6[_0x591d('0x49')]['id']}})[_0x591d('0x24')](function(){return _0x566b58;});}})['then'](respondWithStatusCode(_0x58788a,null))[_0x591d('0x47')](handleError(_0x58788a,null));}; \ No newline at end of file +var _0xe768=['CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','push','sequelize','getBlackLists','addBlackLists','omit','all','removeBlackLists','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','then','get','destroy','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','user','userProfileId','update','getHoppers','findOne','CampaignId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe768,0x1c3));var _0x8e76=function(_0xa30614,_0x617839){_0xa30614=_0xa30614-0x0;var _0x50e61b=_0xe768[_0xa30614];return _0x50e61b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e76('0x0'));var zipdir=require(_0x8e76('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e76('0x2'));var moment=require(_0x8e76('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8e76('0x4'));var util=require(_0x8e76('0x5'));var path=require(_0x8e76('0x6'));var sox=require(_0x8e76('0x7'));var csv=require(_0x8e76('0x8'));var ejs=require(_0x8e76('0x9'));var fs=require('fs');var fs_extra=require(_0x8e76('0xa'));var _=require(_0x8e76('0xb'));var squel=require(_0x8e76('0xc'));var crypto=require(_0x8e76('0xd'));var jsforce=require(_0x8e76('0xe'));var deskjs=require(_0x8e76('0xf'));var toCsv=require(_0x8e76('0x8'));var querystring=require(_0x8e76('0x10'));var Papa=require(_0x8e76('0x11'));var Redis=require(_0x8e76('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e76('0x13'));var as=require(_0x8e76('0x14'));var hardwareService=require(_0x8e76('0x15'));var logger=require(_0x8e76('0x16'))(_0x8e76('0x17'));var utils=require(_0x8e76('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8e76('0x19'));var db=require(_0x8e76('0x1a'))['db'];function respondWithStatusCode(_0x3b3d68,_0x3fadb1){_0x3fadb1=_0x3fadb1||0xcc;return function(_0x4b525f){if(_0x4b525f){return _0x3b3d68[_0x8e76('0x1b')](_0x3fadb1);}return _0x3b3d68[_0x8e76('0x1c')](_0x3fadb1)[_0x8e76('0x1d')]();};}function respondWithResult(_0x17f2cb,_0x3187ae){_0x3187ae=_0x3187ae||0xc8;return function(_0xa40b27){if(_0xa40b27){return _0x17f2cb[_0x8e76('0x1c')](_0x3187ae)['json'](_0xa40b27);}};}function respondWithFilteredResult(_0x53a638,_0x54a71e){return function(_0x5605bc){if(_0x5605bc){var _0x3a637e=typeof _0x54a71e['offset']===_0x8e76('0x1e')&&typeof _0x54a71e[_0x8e76('0x1f')]===_0x8e76('0x1e');var _0x10e777=_0x5605bc[_0x8e76('0x20')];var _0x10722d=_0x3a637e?0x0:_0x54a71e[_0x8e76('0x21')];var _0x4ad113=_0x3a637e?_0x5605bc[_0x8e76('0x20')]:_0x54a71e[_0x8e76('0x21')]+_0x54a71e[_0x8e76('0x1f')];var _0x3c055a;if(_0x4ad113>=_0x10e777){_0x4ad113=_0x10e777;_0x3c055a=0xc8;}else{_0x3c055a=0xce;}_0x53a638['status'](_0x3c055a);return _0x53a638[_0x8e76('0x22')]('Content-Range',_0x10722d+'-'+_0x4ad113+'/'+_0x10e777)['json'](_0x5605bc);}return null;};}function patchUpdates(_0x50dfa8){return function(_0x1476d3){try{jsonpatch[_0x8e76('0x23')](_0x1476d3,_0x50dfa8,!![]);}catch(_0x103c0f){return BPromise[_0x8e76('0x24')](_0x103c0f);}return _0x1476d3[_0x8e76('0x25')]();};}function saveUpdates(_0x294280,_0x1fe63a){return function(_0x38cfc2){if(_0x38cfc2){return _0x38cfc2['update'](_0x294280)[_0x8e76('0x26')](function(_0xf226fe){return _0xf226fe;});}return null;};}function removeEntity(_0xf81942,_0x369470){return function(_0x5ac4ba){if(_0x5ac4ba){return _0x5ac4ba['destroy']()['then'](function(){var _0x4e944a=_0x5ac4ba[_0x8e76('0x27')]({'plain':!![]});var _0x53f9ba='IvrCampaigns';return db['UserProfileResource'][_0x8e76('0x28')]({'where':{'type':_0x53f9ba,'resourceId':_0x4e944a['id']}})[_0x8e76('0x26')](function(){return _0x5ac4ba;});})[_0x8e76('0x26')](function(){_0xf81942[_0x8e76('0x1c')](0xcc)[_0x8e76('0x1d')]();});}};}function handleEntityNotFound(_0x699c04,_0x1c8637){return function(_0x792c86){if(!_0x792c86){_0x699c04['sendStatus'](0x194);}return _0x792c86;};}function handleError(_0x1ceb9e,_0x1dba41){_0x1dba41=_0x1dba41||0x1f4;return function(_0x834913){logger['error'](_0x834913['stack']);if(_0x834913[_0x8e76('0x29')]){delete _0x834913[_0x8e76('0x29')];}_0x1ceb9e[_0x8e76('0x1c')](_0x1dba41)['send'](_0x834913);};}exports[_0x8e76('0x2a')]=function(_0x30b722,_0x1688b2){var _0x1653f4={},_0x97f7e9={},_0x1d21c0={'count':0x0,'rows':[]};var _0x5305a8=_[_0x8e76('0x2b')](db['Campaign'][_0x8e76('0x2c')],function(_0x3aad07){return{'name':_0x3aad07['fieldName'],'type':_0x3aad07[_0x8e76('0x2d')][_0x8e76('0x2e')]};});_0x97f7e9[_0x8e76('0x2f')]=_[_0x8e76('0x2b')](_0x5305a8,_0x8e76('0x29'));_0x97f7e9[_0x8e76('0x30')]=_['keys'](_0x30b722['query']);_0x97f7e9[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x97f7e9[_0x8e76('0x2f')],_0x97f7e9[_0x8e76('0x30')]);_0x1653f4[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x97f7e9[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x34')]));_0x1653f4['attributes']=_0x1653f4[_0x8e76('0x33')][_0x8e76('0x35')]?_0x1653f4[_0x8e76('0x33')]:_0x97f7e9['model'];if(!_0x30b722['query'][_0x8e76('0x36')](_0x8e76('0x37'))){_0x1653f4[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x1653f4[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x1653f4[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x30b722[_0x8e76('0x30')]['sort']);_0x1653f4[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x30b722[_0x8e76('0x30')],_0x97f7e9[_0x8e76('0x31')]),_0x5305a8);if(_0x30b722[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x1653f4[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x1653f4[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x5305a8,function(_0x587faf){if(_0x587faf[_0x8e76('0x2d')]!==_0x8e76('0x3e')){var _0x16700c={};_0x16700c[_0x587faf[_0x8e76('0x29')]]={'$like':'%'+_0x30b722[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x16700c;}})});}_0x1653f4=_[_0x8e76('0x3d')]({},_0x1653f4,_0x30b722[_0x8e76('0x3f')]);var _0x55cfaa={'where':_0x1653f4[_0x8e76('0x3a')]};return db[_0x8e76('0x40')][_0x8e76('0x20')](_0x55cfaa)[_0x8e76('0x26')](function(_0x37f4be){_0x1d21c0['count']=_0x37f4be;if(_0x30b722['query'][_0x8e76('0x41')]){_0x1653f4[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x40')]['findAll'](_0x1653f4);})['then'](function(_0xf3bfa4){_0x1d21c0['rows']=_0xf3bfa4;return _0x1d21c0;})[_0x8e76('0x26')](respondWithFilteredResult(_0x1688b2,_0x1653f4))[_0x8e76('0x43')](handleError(_0x1688b2,null));};exports[_0x8e76('0x44')]=function(_0xf821d0,_0x39846c){var _0x18b6bb={'raw':![],'where':{'id':_0xf821d0['params']['id']}},_0x424c5e={};_0x424c5e['model']=_[_0x8e76('0x45')](db[_0x8e76('0x40')]['rawAttributes']);_0x424c5e[_0x8e76('0x30')]=_['keys'](_0xf821d0[_0x8e76('0x30')]);_0x424c5e['filters']=_[_0x8e76('0x32')](_0x424c5e[_0x8e76('0x2f')],_0x424c5e[_0x8e76('0x30')]);_0x18b6bb[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x424c5e[_0x8e76('0x2f')],qs['fields'](_0xf821d0['query'][_0x8e76('0x34')]));_0x18b6bb[_0x8e76('0x33')]=_0x18b6bb[_0x8e76('0x33')][_0x8e76('0x35')]?_0x18b6bb[_0x8e76('0x33')]:_0x424c5e['model'];if(_0xf821d0[_0x8e76('0x30')][_0x8e76('0x41')]){_0x18b6bb[_0x8e76('0x42')]=[{'all':!![]}];}_0x18b6bb=_[_0x8e76('0x3d')]({},_0x18b6bb,_0xf821d0[_0x8e76('0x3f')]);return db[_0x8e76('0x40')][_0x8e76('0x46')](_0x18b6bb)[_0x8e76('0x26')](handleEntityNotFound(_0x39846c,null))[_0x8e76('0x26')](respondWithResult(_0x39846c,null))[_0x8e76('0x43')](handleError(_0x39846c,null));};exports[_0x8e76('0x47')]=function(_0x5f2897,_0x511ff2){return db[_0x8e76('0x40')][_0x8e76('0x47')](_0x5f2897[_0x8e76('0x48')],{})[_0x8e76('0x26')](function(_0x20e1df){var _0xa5745e=_0x5f2897['user'][_0x8e76('0x27')]({'plain':!![]});if(!_0xa5745e)throw new Error(_0x8e76('0x49'));if(_0xa5745e[_0x8e76('0x4a')]==='user'){var _0x3142b8=_0x20e1df['get']({'plain':!![]});var _0x94c52c=_0x8e76('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x94c52c,'userProfileId':_0xa5745e['userProfileId']},'raw':!![]})['then'](function(_0xe375b6){if(_0xe375b6&&_0xe375b6[_0x8e76('0x4c')]===0x0){return db[_0x8e76('0x4d')][_0x8e76('0x47')]({'name':_0x3142b8[_0x8e76('0x29')],'resourceId':_0x3142b8['id'],'type':_0xe375b6[_0x8e76('0x29')],'sectionId':_0xe375b6['id']},{})[_0x8e76('0x26')](function(){return _0x20e1df;});}else{return _0x20e1df;}})['catch'](function(_0x5d07ab){logger[_0x8e76('0x4e')](_0x8e76('0x4f'),_0x5d07ab);throw _0x5d07ab;});}return _0x20e1df;})[_0x8e76('0x26')](respondWithResult(_0x511ff2,0xc9))[_0x8e76('0x43')](handleError(_0x511ff2,null));};exports['clone']=function(_0x3aa27c,_0x23aa91){var _0x575a={'where':{'id':_0x3aa27c[_0x8e76('0x50')]['id']}},_0x4171ed={};_0x4171ed[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x40')]['rawAttributes']);_0x575a['attributes']=_['intersection'](_0x4171ed[_0x8e76('0x2f')],qs['fields'](_0x3aa27c[_0x8e76('0x30')][_0x8e76('0x34')]));_0x575a[_0x8e76('0x33')]=_0x575a['attributes'][_0x8e76('0x35')]?_0x575a[_0x8e76('0x33')]:_0x4171ed[_0x8e76('0x2f')];if(_0x3aa27c[_0x8e76('0x30')]['includeAll']){_0x575a[_0x8e76('0x42')]=[{'all':!![]}];}_0x575a=_['merge']({},_0x575a,_0x3aa27c[_0x8e76('0x3f')]);return db[_0x8e76('0x40')][_0x8e76('0x46')](_0x575a)[_0x8e76('0x26')](handleEntityNotFound(_0x23aa91,null))[_0x8e76('0x26')](function(_0x24ff99){if(_0x24ff99){var _0x382525=_0x24ff99[_0x8e76('0x27')]({'plain':!![]});_0x382525=qs['omit'](_0x382525,['id',_0x8e76('0x51'),_0x8e76('0x52')]);_0x3aa27c[_0x8e76('0x48')]=_['omit'](_0x3aa27c[_0x8e76('0x48')],['id',_0x8e76('0x51'),'updatedAt']);return db[_0x8e76('0x40')][_0x8e76('0x47')](_[_0x8e76('0x3d')](_0x382525,_0x3aa27c[_0x8e76('0x48')]),{'include':_0x3aa27c['query']['includeAll']?[{'all':!![]}]:undefined})[_0x8e76('0x26')](function(_0x160b60){var _0x1e38a1=_0x3aa27c[_0x8e76('0x53')][_0x8e76('0x27')]({'plain':!![]});if(!_0x1e38a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e38a1['role']==='user'){var _0x56f2d9=_0x160b60['get']({'plain':!![]});var _0x48d953='IvrCampaigns';return db['UserProfileSection'][_0x8e76('0x46')]({'where':{'name':_0x48d953,'userProfileId':_0x1e38a1[_0x8e76('0x54')]},'raw':!![]})[_0x8e76('0x26')](function(_0x5b1a97){if(_0x5b1a97&&_0x5b1a97[_0x8e76('0x4c')]===0x0){return db['UserProfileResource'][_0x8e76('0x47')]({'name':_0x56f2d9[_0x8e76('0x29')],'resourceId':_0x56f2d9['id'],'type':_0x5b1a97['name'],'sectionId':_0x5b1a97['id']},{})[_0x8e76('0x26')](function(){return _0x160b60;});}else{return _0x160b60;}})[_0x8e76('0x43')](function(_0xc312e2){logger[_0x8e76('0x4e')](_0x8e76('0x4f'),_0xc312e2);throw _0xc312e2;});}return _0x160b60;});}})['then'](respondWithResult(_0x23aa91,0xc9))[_0x8e76('0x43')](handleError(_0x23aa91,null));};exports[_0x8e76('0x55')]=function(_0x1eeb7b,_0x28de34){if(_0x1eeb7b[_0x8e76('0x48')]['id']){delete _0x1eeb7b[_0x8e76('0x48')]['id'];}return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x1eeb7b['params']['id']}})['then'](handleEntityNotFound(_0x28de34,null))[_0x8e76('0x26')](saveUpdates(_0x1eeb7b['body'],null))[_0x8e76('0x26')](respondWithResult(_0x28de34,null))['catch'](handleError(_0x28de34,null));};exports[_0x8e76('0x28')]=function(_0x5ee949,_0x2fab8b){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x5ee949['params']['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x2fab8b,null))[_0x8e76('0x26')](removeEntity(_0x2fab8b,null))['catch'](handleError(_0x2fab8b,null));};exports[_0x8e76('0x56')]=function(_0x5c8fcd,_0x33bcbc,_0x38e2be){var _0x154605={'raw':!![],'where':{}};var _0x213595={};var _0x5f0b68={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x5c8fcd[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x33bcbc,null))[_0x8e76('0x26')](function(_0x558a95){if(_0x558a95){_0x213595[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db['CmHopper']['rawAttributes']);_0x213595[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x5c8fcd[_0x8e76('0x30')]);_0x213595[_0x8e76('0x31')]=_['intersection'](_0x213595[_0x8e76('0x2f')],_0x213595[_0x8e76('0x30')]);_0x154605[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x213595[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x5c8fcd['query'][_0x8e76('0x34')]));_0x154605['attributes']=_0x154605[_0x8e76('0x33')][_0x8e76('0x35')]?_0x154605['attributes']:_0x213595[_0x8e76('0x2f')];if(!_0x5c8fcd['query'][_0x8e76('0x36')]('nolimit')){_0x154605[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x154605[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x5c8fcd[_0x8e76('0x30')]['offset']);}_0x154605[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x39')]);_0x154605['where']=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x5c8fcd[_0x8e76('0x30')],_0x213595['filters']));_0x154605[_0x8e76('0x3a')][_0x8e76('0x58')]=_0x558a95['id'];if(_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x154605[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x154605[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x154605[_0x8e76('0x33')],function(_0x3e0276){var _0x7f2666={};_0x7f2666[_0x3e0276]={'$like':'%'+_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x7f2666;})});}_0x154605=_[_0x8e76('0x3d')]({},_0x154605,_0x5c8fcd[_0x8e76('0x3f')]);return db[_0x8e76('0x59')]['count']({'where':_0x154605[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x4be46a){_0x5f0b68['count']=_0x4be46a;if(_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x41')]){_0x154605['include']=[{'all':!![]}];}return db[_0x8e76('0x59')][_0x8e76('0x5a')](_0x154605);})[_0x8e76('0x26')](function(_0x9e48c0){_0x5f0b68[_0x8e76('0x5b')]=_0x9e48c0;return _0x5f0b68;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x33bcbc,_0x154605))[_0x8e76('0x43')](handleError(_0x33bcbc,null));};exports[_0x8e76('0x5c')]=function(_0x56f5b0,_0x37c411,_0x435f87){var _0x4b268a={'raw':!![],'where':{}};var _0x2ae6fb={};var _0xe91b5d={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x56f5b0[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x37c411,null))[_0x8e76('0x26')](function(_0x1b14cd){if(_0x1b14cd){_0x2ae6fb[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x5d')]['rawAttributes']);_0x2ae6fb[_0x8e76('0x30')]=_['keys'](_0x56f5b0[_0x8e76('0x30')]);_0x2ae6fb[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x2ae6fb[_0x8e76('0x2f')],_0x2ae6fb[_0x8e76('0x30')]);_0x4b268a[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x2ae6fb[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x34')]));_0x4b268a[_0x8e76('0x33')]=_0x4b268a[_0x8e76('0x33')][_0x8e76('0x35')]?_0x4b268a[_0x8e76('0x33')]:_0x2ae6fb[_0x8e76('0x2f')];if(!_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x36')](_0x8e76('0x37'))){_0x4b268a[_0x8e76('0x1f')]=qs['limit'](_0x56f5b0[_0x8e76('0x30')]['limit']);_0x4b268a[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x4b268a[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x39')]);_0x4b268a[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x56f5b0[_0x8e76('0x30')],_0x2ae6fb[_0x8e76('0x31')]));_0x4b268a[_0x8e76('0x3a')]['CampaignId']=_0x1b14cd['id'];if(_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x4b268a['where']=_[_0x8e76('0x3d')](_0x4b268a[_0x8e76('0x3a')],{'$or':_['map'](_0x4b268a[_0x8e76('0x33')],function(_0x35359d){var _0x3daf2d={};_0x3daf2d[_0x35359d]={'$like':'%'+_0x56f5b0['query'][_0x8e76('0x3c')]+'%'};return _0x3daf2d;})});}_0x4b268a=_[_0x8e76('0x3d')]({},_0x4b268a,_0x56f5b0[_0x8e76('0x3f')]);return db[_0x8e76('0x5d')][_0x8e76('0x20')]({'where':_0x4b268a[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x2ea8fe){_0xe91b5d[_0x8e76('0x20')]=_0x2ea8fe;if(_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x41')]){_0x4b268a[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x5d')]['findAll'](_0x4b268a);})[_0x8e76('0x26')](function(_0x5cca97){_0xe91b5d['rows']=_0x5cca97;return _0xe91b5d;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x37c411,_0x4b268a))[_0x8e76('0x43')](handleError(_0x37c411,null));};exports[_0x8e76('0x5e')]=function(_0x297609,_0x17eb20,_0x2ffc68){var _0x43bb46={'raw':!![],'where':{}};var _0xb305a={};var _0x2cc50c={'count':0x0,'rows':[]};return db[_0x8e76('0x40')]['findOne']({'where':{'id':_0x297609['params']['id']}})['then'](handleEntityNotFound(_0x17eb20,null))['then'](function(_0xd27f82){if(_0xd27f82){_0xb305a['model']=_[_0x8e76('0x45')](db[_0x8e76('0x5f')][_0x8e76('0x2c')]);_0xb305a[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x297609[_0x8e76('0x30')]);_0xb305a[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0xb305a['model'],_0xb305a[_0x8e76('0x30')]);_0x43bb46[_0x8e76('0x33')]=_['intersection'](_0xb305a['model'],qs['fields'](_0x297609[_0x8e76('0x30')]['fields']));_0x43bb46[_0x8e76('0x33')]=_0x43bb46['attributes']['length']?_0x43bb46['attributes']:_0xb305a['model'];if(!_0x297609['query'][_0x8e76('0x36')]('nolimit')){_0x43bb46['limit']=qs['limit'](_0x297609[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x43bb46[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x297609[_0x8e76('0x30')]['offset']);}_0x43bb46['order']=qs['sort'](_0x297609['query'][_0x8e76('0x39')]);_0x43bb46[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x297609[_0x8e76('0x30')],_0xb305a[_0x8e76('0x31')]));_0x43bb46['where'][_0x8e76('0x58')]=_0xd27f82['id'];if(_0x297609[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x43bb46[_0x8e76('0x3a')]=_['merge'](_0x43bb46[_0x8e76('0x3a')],{'$or':_['map'](_0x43bb46[_0x8e76('0x33')],function(_0x4e5d65){var _0x44f800={};_0x44f800[_0x4e5d65]={'$like':'%'+_0x297609[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x44f800;})});}_0x43bb46=_[_0x8e76('0x3d')]({},_0x43bb46,_0x297609[_0x8e76('0x3f')]);return db[_0x8e76('0x5f')][_0x8e76('0x20')]({'where':_0x43bb46[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x5f5a49){_0x2cc50c[_0x8e76('0x20')]=_0x5f5a49;if(_0x297609['query'][_0x8e76('0x41')]){_0x43bb46['include']=[{'all':!![]}];}return db[_0x8e76('0x5f')][_0x8e76('0x5a')](_0x43bb46);})[_0x8e76('0x26')](function(_0x3c7c32){_0x2cc50c[_0x8e76('0x5b')]=_0x3c7c32;return _0x2cc50c;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x17eb20,_0x43bb46))[_0x8e76('0x43')](handleError(_0x17eb20,null));};exports[_0x8e76('0x60')]=function(_0x240448,_0x208394,_0x14cb82){var _0x30c240={'raw':!![],'where':{}};var _0x99ebbd={};var _0x405051={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x240448['params']['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x208394,null))[_0x8e76('0x26')](function(_0xf93e3a){if(_0xf93e3a){_0x99ebbd[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x61')]['rawAttributes']);_0x99ebbd['query']=_[_0x8e76('0x45')](_0x240448[_0x8e76('0x30')]);_0x99ebbd[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x99ebbd[_0x8e76('0x2f')],_0x99ebbd['query']);_0x30c240['attributes']=_[_0x8e76('0x32')](_0x99ebbd['model'],qs[_0x8e76('0x34')](_0x240448[_0x8e76('0x30')][_0x8e76('0x34')]));_0x30c240[_0x8e76('0x33')]=_0x30c240[_0x8e76('0x33')][_0x8e76('0x35')]?_0x30c240[_0x8e76('0x33')]:_0x99ebbd[_0x8e76('0x2f')];if(!_0x240448[_0x8e76('0x30')]['hasOwnProperty'](_0x8e76('0x37'))){_0x30c240[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x240448[_0x8e76('0x30')]['limit']);_0x30c240['offset']=qs[_0x8e76('0x21')](_0x240448[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x30c240[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x240448[_0x8e76('0x30')][_0x8e76('0x39')]);_0x30c240['where']=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x240448['query'],_0x99ebbd[_0x8e76('0x31')]));_0x30c240['where'][_0x8e76('0x58')]=_0xf93e3a['id'];if(_0x240448['query'][_0x8e76('0x3c')]){_0x30c240[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x30c240[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x30c240[_0x8e76('0x33')],function(_0x3fb6d1){var _0x3c8fa8={};_0x3c8fa8[_0x3fb6d1]={'$like':'%'+_0x240448[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x3c8fa8;})});}_0x30c240=_[_0x8e76('0x3d')]({},_0x30c240,_0x240448['options']);return db['CmHopperBlack']['count']({'where':_0x30c240[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x4b02c1){_0x405051[_0x8e76('0x20')]=_0x4b02c1;if(_0x240448[_0x8e76('0x30')][_0x8e76('0x41')]){_0x30c240[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x61')]['findAll'](_0x30c240);})[_0x8e76('0x26')](function(_0xe38746){_0x405051[_0x8e76('0x5b')]=_0xe38746;return _0x405051;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x208394,_0x30c240))[_0x8e76('0x43')](handleError(_0x208394,null));};exports[_0x8e76('0x62')]=function(_0x109a66,_0x6b2d77,_0xf1125c){var _0x44ce4b={};var _0xd54609={};var _0x175188;var _0x2a8010;return db[_0x8e76('0x40')]['findOne']({'where':{'id':_0x109a66[_0x8e76('0x50')]['id']}})['then'](handleEntityNotFound(_0x6b2d77,null))[_0x8e76('0x26')](function(_0x11e55a){if(_0x11e55a){_0x175188=_0x11e55a;_0xd54609[_0x8e76('0x2f')]=_['keys'](db[_0x8e76('0x63')][_0x8e76('0x2c')]);_0xd54609[_0x8e76('0x30')]=_['keys'](_0x109a66[_0x8e76('0x30')]);_0xd54609[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0xd54609[_0x8e76('0x2f')],_0xd54609[_0x8e76('0x30')]);_0x44ce4b[_0x8e76('0x33')]=_['intersection'](_0xd54609[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x109a66[_0x8e76('0x30')][_0x8e76('0x34')]));_0x44ce4b[_0x8e76('0x33')]=_0x44ce4b[_0x8e76('0x33')][_0x8e76('0x35')]?_0x44ce4b[_0x8e76('0x33')]:_0xd54609[_0x8e76('0x2f')];_0x44ce4b[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x109a66[_0x8e76('0x30')][_0x8e76('0x39')]);_0x44ce4b[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x109a66[_0x8e76('0x30')],_0xd54609[_0x8e76('0x31')]));if(_0x109a66[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x44ce4b['where']=_[_0x8e76('0x3d')](_0x44ce4b[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x44ce4b[_0x8e76('0x33')],function(_0x4b3ba){var _0x530c84={};_0x530c84[_0x4b3ba]={'$like':'%'+_0x109a66[_0x8e76('0x30')]['filter']+'%'};return _0x530c84;})});}_0x44ce4b=_[_0x8e76('0x3d')]({},_0x44ce4b,_0x109a66[_0x8e76('0x3f')]);return _0x175188['getLists'](_0x44ce4b);}})[_0x8e76('0x26')](function(_0x286679){if(_0x286679){_0x2a8010=_0x286679[_0x8e76('0x35')];if(!_0x109a66[_0x8e76('0x30')][_0x8e76('0x36')](_0x8e76('0x37'))){_0x44ce4b[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x109a66['query'][_0x8e76('0x1f')]);_0x44ce4b['offset']=qs['offset'](_0x109a66['query']['offset']);}return _0x175188[_0x8e76('0x62')](_0x44ce4b);}})[_0x8e76('0x26')](function(_0x5806be){if(_0x5806be){return _0x5806be?{'count':_0x2a8010,'rows':_0x5806be}:null;}})['then'](respondWithResult(_0x6b2d77,null))[_0x8e76('0x43')](handleError(_0x6b2d77,null));};exports[_0x8e76('0x64')]=function(_0x5ed91d,_0x205c8e,_0x2c37ca){var _0x222c18,_0x40bb8a;return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x5ed91d[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x205c8e,null))[_0x8e76('0x26')](function(_0x2522ac){if(_0x2522ac){_0x40bb8a=_0x2522ac;return _0x2522ac[_0x8e76('0x64')](_0x5ed91d['body']['ids'],_['omit'](_0x5ed91d[_0x8e76('0x48')],[_0x8e76('0x65'),'id'])||{});}return null;})[_0x8e76('0x66')](function(_0x620ec2){var _0x435374;_0x222c18=_0x620ec2||[];var _0x3a308b=[];if(_0x620ec2){for(var _0x38e042=0x0;_0x38e042<_0x620ec2[_0x8e76('0x35')];_0x38e042+=0x1){var _0x105965=_0x620ec2[_0x38e042][_0x8e76('0x27')]({'plain':!![]});_0x40bb8a[_0x8e76('0x67')]=_0x5ed91d['body'][_0x8e76('0x67')]?_0x5ed91d[_0x8e76('0x48')][_0x8e76('0x67')]:_0x40bb8a[_0x8e76('0x67')];switch(_0x40bb8a[_0x8e76('0x67')]){case _0x8e76('0x68'):_0x435374=squel[_0x8e76('0x69')]()[_0x8e76('0x6a')](_0x8e76('0x6b'))['fromQuery']([_0x8e76('0x6c'),'scheduledAt',_0x8e76('0x6d'),_0x8e76('0x6e'),_0x8e76('0x58'),'createdAt',_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),'phone')['field'](_0x8e76('0x71'),_0x8e76('0x72'))[_0x8e76('0x70')]('id',_0x8e76('0x6d'))['field'](_0x105965[_0x8e76('0x73')][_0x8e76('0x74')](),'ListId')[_0x8e76('0x70')](_0x5ed91d[_0x8e76('0x50')]['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x51'))['field'](_0x8e76('0x71'),'updatedAt')[_0x8e76('0x75')](_0x8e76('0x76'))[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')](_0x8e76('0x78'),_0x105965[_0x8e76('0x73')][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79'))[_0x8e76('0x3a')](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7b'))[_0x8e76('0x75')]('cm_hopper_final')[_0x8e76('0x3a')](_0x8e76('0x7c'),_0x5ed91d[_0x8e76('0x50')]['id'][_0x8e76('0x74')]()))['where'](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7d'))[_0x8e76('0x75')](_0x8e76('0x6b'))[_0x8e76('0x3a')](_0x8e76('0x7c'),_0x5ed91d[_0x8e76('0x50')]['id']['toString']())))[_0x8e76('0x74')]();break;case _0x8e76('0x7e'):_0x435374=squel[_0x8e76('0x69')]()[_0x8e76('0x6a')](_0x8e76('0x6b'))[_0x8e76('0x7f')]([_0x8e76('0x6c'),_0x8e76('0x72'),_0x8e76('0x6d'),_0x8e76('0x6e'),'CampaignId',_0x8e76('0x51'),_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')]('phone','phone')[_0x8e76('0x70')](_0x8e76('0x71'),'scheduledAt')[_0x8e76('0x70')]('id','ContactId')[_0x8e76('0x70')](_0x105965['CmListId'][_0x8e76('0x74')](),_0x8e76('0x6e'))[_0x8e76('0x70')](_0x5ed91d['params']['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')]('NOW()',_0x8e76('0x51'))[_0x8e76('0x70')]('NOW()',_0x8e76('0x52'))[_0x8e76('0x75')](_0x8e76('0x76'))[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')]('ListId\x20=\x20?',_0x105965[_0x8e76('0x73')][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79'))[_0x8e76('0x3a')](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7d'))[_0x8e76('0x75')](_0x8e76('0x6b'))[_0x8e76('0x3a')]('CampaignId\x20=\x20?',_0x5ed91d['params']['id'][_0x8e76('0x74')]())))[_0x8e76('0x74')]();break;default:_0x435374=squel['insert']()[_0x8e76('0x6a')]('cm_hopper')['fromQuery']([_0x8e76('0x6c'),_0x8e76('0x72'),_0x8e76('0x6d'),_0x8e76('0x6e'),_0x8e76('0x58'),_0x8e76('0x51'),'updatedAt'],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),_0x8e76('0x6c'))['field'](_0x8e76('0x71'),_0x8e76('0x72'))['field']('id',_0x8e76('0x6d'))['field'](_0x105965[_0x8e76('0x73')][_0x8e76('0x74')](),'ListId')[_0x8e76('0x70')](_0x5ed91d['params']['id']['toString'](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x51'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x52'))[_0x8e76('0x75')]('cm_contacts')[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')](_0x8e76('0x78'),_0x105965['CmListId'][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79')))[_0x8e76('0x74')]();}_0x3a308b[_0x8e76('0x80')](db[_0x8e76('0x81')][_0x8e76('0x30')](_0x435374));}return BPromise['all'](_0x3a308b);}})[_0x8e76('0x26')](function(){return _0x222c18;})['then'](respondWithResult(_0x205c8e,null))[_0x8e76('0x43')](handleError(_0x205c8e,null));};exports['removeLists']=function(_0x1f0f8b,_0x47c365,_0x30abce){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x1f0f8b[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x47c365,null))[_0x8e76('0x26')](function(_0xe29548){if(_0xe29548){return _0xe29548['removeLists'](_0x1f0f8b[_0x8e76('0x30')][_0x8e76('0x65')]);}})['then'](function(_0x5ab76d){if(_0x5ab76d){return db['CmHopper']['destroy']({'where':{'ListId':_0x1f0f8b[_0x8e76('0x30')][_0x8e76('0x65')],'CampaignId':_0x1f0f8b[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](function(){return _0x5ab76d;});}})[_0x8e76('0x26')](respondWithStatusCode(_0x47c365,null))[_0x8e76('0x43')](handleError(_0x47c365,null));};exports[_0x8e76('0x82')]=function(_0x24d7f3,_0x180aaa,_0x41bec1){var _0x5cb487={};var _0x7e84ee={};var _0x40e2e3;var _0x4afe55;return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x24d7f3[_0x8e76('0x50')]['id']}})['then'](handleEntityNotFound(_0x180aaa,null))[_0x8e76('0x26')](function(_0x24144b){if(_0x24144b){_0x40e2e3=_0x24144b;_0x7e84ee[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x63')][_0x8e76('0x2c')]);_0x7e84ee[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x24d7f3['query']);_0x7e84ee[_0x8e76('0x31')]=_['intersection'](_0x7e84ee[_0x8e76('0x2f')],_0x7e84ee[_0x8e76('0x30')]);_0x5cb487['attributes']=_[_0x8e76('0x32')](_0x7e84ee[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x24d7f3['query']['fields']));_0x5cb487[_0x8e76('0x33')]=_0x5cb487['attributes'][_0x8e76('0x35')]?_0x5cb487['attributes']:_0x7e84ee['model'];_0x5cb487[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x24d7f3[_0x8e76('0x30')][_0x8e76('0x39')]);_0x5cb487[_0x8e76('0x3a')]=qs['filters'](_['pick'](_0x24d7f3[_0x8e76('0x30')],_0x7e84ee[_0x8e76('0x31')]));if(_0x24d7f3['query'][_0x8e76('0x3c')]){_0x5cb487['where']=_[_0x8e76('0x3d')](_0x5cb487[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x5cb487[_0x8e76('0x33')],function(_0xad1c4b){var _0x1dc6ed={};_0x1dc6ed[_0xad1c4b]={'$like':'%'+_0x24d7f3['query']['filter']+'%'};return _0x1dc6ed;})});}_0x5cb487=_[_0x8e76('0x3d')]({},_0x5cb487,_0x24d7f3[_0x8e76('0x3f')]);return _0x40e2e3[_0x8e76('0x82')](_0x5cb487);}})[_0x8e76('0x26')](function(_0x48d497){if(_0x48d497){_0x4afe55=_0x48d497[_0x8e76('0x35')];if(!_0x24d7f3[_0x8e76('0x30')]['hasOwnProperty'](_0x8e76('0x37'))){_0x5cb487[_0x8e76('0x1f')]=qs['limit'](_0x24d7f3[_0x8e76('0x30')]['limit']);_0x5cb487[_0x8e76('0x21')]=qs['offset'](_0x24d7f3[_0x8e76('0x30')]['offset']);}return _0x40e2e3['getBlackLists'](_0x5cb487);}})[_0x8e76('0x26')](function(_0x27a4da){if(_0x27a4da){return _0x27a4da?{'count':_0x4afe55,'rows':_0x27a4da}:null;}})[_0x8e76('0x26')](respondWithResult(_0x180aaa,null))[_0x8e76('0x43')](handleError(_0x180aaa,null));};exports['addBlackLists']=function(_0xe01e77,_0x133f80,_0x5b8b0c){var _0x3d5610,_0x38f082;return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0xe01e77[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x133f80,null))[_0x8e76('0x26')](function(_0x5952df){if(_0x5952df){_0x38f082=_0x5952df;return _0x5952df[_0x8e76('0x83')](_0xe01e77[_0x8e76('0x48')]['ids'],_[_0x8e76('0x84')](_0xe01e77['body'],[_0x8e76('0x65'),'id'])||{});}return null;})[_0x8e76('0x66')](function(_0xe8839e){var _0x16cb93;_0x3d5610=_0xe8839e||[];var _0x169dbe=[];if(_0xe8839e){for(var _0x5db63e=0x0;_0x5db63e<_0xe8839e[_0x8e76('0x35')];_0x5db63e+=0x1){var _0x2a1386=_0xe8839e[_0x5db63e]['get']({'plain':!![]});_0x16cb93=squel['insert']()[_0x8e76('0x6a')]('cm_hopper_black')[_0x8e76('0x7f')](['phone',_0x8e76('0x6d'),'ListId',_0x8e76('0x58'),_0x8e76('0x51'),_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),_0x8e76('0x6c'))['field']('id',_0x8e76('0x6d'))[_0x8e76('0x70')](_0x2a1386['CmListId']['toString'](),'ListId')['field'](_0xe01e77[_0x8e76('0x50')]['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),'createdAt')[_0x8e76('0x70')]('NOW()',_0x8e76('0x52'))[_0x8e76('0x75')]('cm_contacts')[_0x8e76('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x8e76('0x78'),_0x2a1386[_0x8e76('0x73')]['toString']())[_0x8e76('0x3a')](_0x8e76('0x79')))[_0x8e76('0x74')]();_0x169dbe['push'](db[_0x8e76('0x81')]['query'](_0x16cb93));}return BPromise[_0x8e76('0x85')](_0x169dbe);}})[_0x8e76('0x26')](function(){return _0x3d5610;})['then'](respondWithResult(_0x133f80,null))[_0x8e76('0x43')](handleError(_0x133f80,null));};exports['removeBlackLists']=function(_0x230421,_0x4fc4a8,_0xe6b6bd){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x230421[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x4fc4a8,null))['then'](function(_0x7c276f){if(_0x7c276f){return _0x7c276f[_0x8e76('0x86')](_0x230421['query'][_0x8e76('0x65')]);}})[_0x8e76('0x26')](function(_0x5ee8f4){if(_0x5ee8f4){return db[_0x8e76('0x61')]['destroy']({'where':{'ListId':_0x230421[_0x8e76('0x30')][_0x8e76('0x65')],'CampaignId':_0x230421[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](function(){return _0x5ee8f4;});}})['then'](respondWithStatusCode(_0x4fc4a8,null))[_0x8e76('0x43')](handleError(_0x4fc4a8,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 9d6f67c..580445e 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x226aea,_0x78e3ed){var _0x229e93=function(_0x2166a9){while(--_0x2166a9){_0x226aea['push'](_0x226aea['shift']());}};_0x229e93(++_0x78e3ed);}(_0x7a54,0x106));var _0x47a5=function(_0x4d2ce4,_0x25c284){_0x4d2ce4=_0x4d2ce4-0x0;var _0x18dc04=_0x7a54[_0x4d2ce4];return _0x18dc04;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x21712c,_0x2dedd8){var _0x3bcfda=function(_0x4c1803){while(--_0x4c1803){_0x21712c['push'](_0x21712c['shift']());}};_0x3bcfda(++_0x2dedd8);}(_0x7a54,0x106));var _0x47a5=function(_0x358a36,_0x4ac4aa){_0x358a36=_0x358a36-0x0;var _0x87f289=_0x7a54[_0x358a36];return _0x87f289;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index eb700c7..1db4dd2 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ef0=['Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','map','model','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info'];(function(_0x2433e0,_0x2db0de){var _0x36cfff=function(_0x52a747){while(--_0x52a747){_0x2433e0['push'](_0x2433e0['shift']());}};_0x36cfff(++_0x2db0de);}(_0x3ef0,0x19a));var _0x03ef=function(_0x164e31,_0x470195){_0x164e31=_0x164e31-0x0;var _0x1d2ad2=_0x3ef0[_0x164e31];return _0x1d2ad2;};'use strict';var _=require(_0x03ef('0x0'));var util=require('util');var moment=require(_0x03ef('0x1'));var BPromise=require('bluebird');var rs=require(_0x03ef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03ef('0x3'))['db'];var utils=require(_0x03ef('0x4'));var logger=require(_0x03ef('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x03ef('0x6'));var client=jayson[_0x03ef('0x7')][_0x03ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47e561,_0x357971,_0x3c06ee){return new BPromise(function(_0x2d54e7,_0x61669){return client['request'](_0x47e561,_0x3c06ee)['then'](function(_0x399e94){logger[_0x03ef('0x9')](_0x03ef('0xa'),_0x357971,'request\x20sent');logger[_0x03ef('0xb')](_0x03ef('0xc'),_0x357971,'request\x20sent',JSON[_0x03ef('0xd')](_0x399e94));if(_0x399e94[_0x03ef('0xe')]){if(_0x399e94[_0x03ef('0xe')]['code']===0x1f4){logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x357971,_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);return _0x61669(_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);}logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x357971,_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);return _0x2d54e7(_0x399e94[_0x03ef('0xe')]['message']);}else{logger['info'](_0x03ef('0xa'),_0x357971,_0x03ef('0x10'));_0x2d54e7(_0x399e94[_0x03ef('0x11')][_0x03ef('0xf')]);}})[_0x03ef('0x12')](function(_0x590152){logger['error'](_0x03ef('0xa'),_0x357971,_0x590152);_0x61669(_0x590152);});});}exports[_0x03ef('0x13')]=function(_0x501d87){var _0x4a4e96=this;return new Promise(function(_0x277f0d,_0xa3ba09){return db[_0x03ef('0x14')][_0x03ef('0x15')]({'raw':_0x501d87[_0x03ef('0x16')]?_0x501d87['options'][_0x03ef('0x17')]===undefined?!![]:![]:!![],'where':_0x501d87[_0x03ef('0x16')]?_0x501d87['options'][_0x03ef('0x18')]||null:null,'attributes':_0x501d87[_0x03ef('0x16')]?_0x501d87[_0x03ef('0x16')][_0x03ef('0x19')]||null:null,'limit':_0x501d87[_0x03ef('0x16')]?_0x501d87['options']['limit']||null:null,'include':_0x501d87[_0x03ef('0x16')]?_0x501d87[_0x03ef('0x16')][_0x03ef('0x1a')]?_['map'](_0x501d87['options'][_0x03ef('0x1a')],function(_0x27ac0d){return{'model':db[_0x27ac0d['model']],'as':_0x27ac0d['as'],'attributes':_0x27ac0d['attributes'],'include':_0x27ac0d[_0x03ef('0x1a')]?_[_0x03ef('0x1b')](_0x27ac0d['include'],function(_0x305829){return{'model':db[_0x305829[_0x03ef('0x1c')]],'as':_0x305829['as'],'attributes':_0x305829[_0x03ef('0x19')],'include':_0x305829['include']?_[_0x03ef('0x1b')](_0x305829[_0x03ef('0x1a')],function(_0x31fd6f){return{'model':db[_0x31fd6f[_0x03ef('0x1c')]],'as':_0x31fd6f['as'],'attributes':_0x31fd6f[_0x03ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x03ef('0x1d')](function(_0x538a5d){logger['info'](_0x03ef('0x13'),_0x501d87);logger['debug'](_0x03ef('0x13'),_0x501d87,JSON[_0x03ef('0xd')](_0x538a5d));_0x277f0d(_0x538a5d);})[_0x03ef('0x12')](function(_0x4d9e6a){logger[_0x03ef('0xe')](_0x03ef('0x13'),_0x4d9e6a[_0x03ef('0xf')],_0x501d87);_0xa3ba09(_0x4a4e96[_0x03ef('0xe')](0x1f4,_0x4d9e6a['message']));});});}; \ No newline at end of file +var _0xf430=['limit','include','model','map','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf430,0x1e4));var _0x0f43=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0xf430[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x0f43('0x0'));var util=require(_0x0f43('0x1'));var moment=require(_0x0f43('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f43('0x3'));var fs=require('fs');var Redis=require(_0x0f43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f43('0x5'))(_0x0f43('0x6'));var config=require(_0x0f43('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0f43('0x8')][_0x0f43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x490bc1,_0x562cf2,_0x2e8f68){return new BPromise(function(_0x39bc4c,_0x18e735){return client['request'](_0x490bc1,_0x2e8f68)[_0x0f43('0xa')](function(_0x59508b){logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');logger['debug'](_0x0f43('0xd'),_0x562cf2,_0x0f43('0xe'),JSON[_0x0f43('0xf')](_0x59508b));if(_0x59508b[_0x0f43('0x10')]){if(_0x59508b[_0x0f43('0x10')]['code']===0x1f4){logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x18e735(_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);}logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x39bc4c(_0x59508b[_0x0f43('0x10')]['message']);}else{logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');_0x39bc4c(_0x59508b[_0x0f43('0x12')][_0x0f43('0x11')]);}})[_0x0f43('0x13')](function(_0x5631e1){logger[_0x0f43('0x10')]('Campaign,\x20%s,\x20%s',_0x562cf2,_0x5631e1);_0x18e735(_0x5631e1);});});}exports[_0x0f43('0x14')]=function(_0x5617c3){var _0x4e294b=this;return new Promise(function(_0x3e25fa,_0x5a7351){return db[_0x0f43('0x15')]['findAll']({'raw':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x17')]===undefined?!![]:![]:!![],'where':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x18')]||null:null,'attributes':_0x5617c3['options']?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x19')]||null:null,'limit':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x1a')]||null:null,'include':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x1b')]?_['map'](_0x5617c3['options'][_0x0f43('0x1b')],function(_0x5c4b61){return{'model':db[_0x5c4b61[_0x0f43('0x1c')]],'as':_0x5c4b61['as'],'attributes':_0x5c4b61[_0x0f43('0x19')],'include':_0x5c4b61[_0x0f43('0x1b')]?_[_0x0f43('0x1d')](_0x5c4b61['include'],function(_0x227f03){return{'model':db[_0x227f03[_0x0f43('0x1c')]],'as':_0x227f03['as'],'attributes':_0x227f03[_0x0f43('0x19')],'include':_0x227f03['include']?_['map'](_0x227f03['include'],function(_0x489fe5){return{'model':db[_0x489fe5[_0x0f43('0x1c')]],'as':_0x489fe5['as'],'attributes':_0x489fe5[_0x0f43('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0f43('0xa')](function(_0x1494e4){logger[_0x0f43('0xb')](_0x0f43('0x14'),_0x5617c3);logger['debug'](_0x0f43('0x14'),_0x5617c3,JSON[_0x0f43('0xf')](_0x1494e4));_0x3e25fa(_0x1494e4);})[_0x0f43('0x13')](function(_0x29e89f){logger[_0x0f43('0x10')]('GetCampaign',_0x29e89f[_0x0f43('0x11')],_0x5617c3);_0x5a7351(_0x4e294b[_0x0f43('0x10')](0x1f4,_0x29e89f[_0x0f43('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 130e373..f6bf451 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fea=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','addLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x0fea,0x80));var _0xa0fe=function(_0x53a456,_0x1c3d73){_0x53a456=_0x53a456-0x0;var _0x19bf77=_0x0fea[_0x53a456];return _0x19bf77;};'use strict';var multer=require(_0xa0fe('0x0'));var util=require(_0xa0fe('0x1'));var path=require(_0xa0fe('0x2'));var timeout=require(_0xa0fe('0x3'));var express=require(_0xa0fe('0x4'));var router=express[_0xa0fe('0x5')]();var fs_extra=require(_0xa0fe('0x6'));var auth=require(_0xa0fe('0x7'));var interaction=require(_0xa0fe('0x8'));var config=require(_0xa0fe('0x9'));var controller=require(_0xa0fe('0xa'));router['get']('/',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0xc')]);router[_0xa0fe('0xd')](_0xa0fe('0xe'),auth['isAuthenticated'](),controller[_0xa0fe('0xf')]);router[_0xa0fe('0xd')](_0xa0fe('0x10'),auth['isAuthenticated'](),controller[_0xa0fe('0x11')]);router[_0xa0fe('0xd')](_0xa0fe('0x12'),auth[_0xa0fe('0xb')](),controller['getHopperHistories']);router[_0xa0fe('0xd')]('/:id/hopper_finals',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x13')]);router[_0xa0fe('0xd')](_0xa0fe('0x14'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xa0fe('0xd')](_0xa0fe('0x15'),auth[_0xa0fe('0xb')](),controller['getLists']);router[_0xa0fe('0xd')](_0xa0fe('0x16'),auth['isAuthenticated'](),controller[_0xa0fe('0x17')]);router[_0xa0fe('0x18')]('/',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x19')]);router[_0xa0fe('0x18')]('/:id/clone',auth[_0xa0fe('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1a')]);router[_0xa0fe('0x18')]('/:id/blacklists',auth[_0xa0fe('0xb')](),controller['addBlackLists']);router[_0xa0fe('0x1b')]('/:id',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1c')]);router[_0xa0fe('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xa0fe('0x1e')]);router[_0xa0fe('0x1d')](_0xa0fe('0x15'),auth[_0xa0fe('0xb')](),controller['removeLists']);router[_0xa0fe('0x1d')](_0xa0fe('0x16'),auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1f')]);module[_0xa0fe('0x20')]=router; \ No newline at end of file +var _0xe3e0=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/blacklists','create','post','clone','/:id/lists','addLists','put','/:id','delete','removeLists','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','isAuthenticated','/:id/hopper_histories'];(function(_0xaa0be9,_0x4506b4){var _0x4e0a8b=function(_0x150b48){while(--_0x150b48){_0xaa0be9['push'](_0xaa0be9['shift']());}};_0x4e0a8b(++_0x4506b4);}(_0xe3e0,0x188));var _0x0e3e=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xe3e0[_0x1bd323];return _0x13097b;};'use strict';var multer=require('multer');var util=require(_0x0e3e('0x0'));var path=require(_0x0e3e('0x1'));var timeout=require(_0x0e3e('0x2'));var express=require(_0x0e3e('0x3'));var router=express['Router']();var fs_extra=require(_0x0e3e('0x4'));var auth=require(_0x0e3e('0x5'));var interaction=require(_0x0e3e('0x6'));var config=require(_0x0e3e('0x7'));var controller=require(_0x0e3e('0x8'));router[_0x0e3e('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e3e('0xa')]);router[_0x0e3e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0e3e('0xb')]);router[_0x0e3e('0x9')]('/:id/hoppers',auth[_0x0e3e('0xc')](),controller['getHoppers']);router[_0x0e3e('0x9')](_0x0e3e('0xd'),auth['isAuthenticated'](),controller[_0x0e3e('0xe')]);router[_0x0e3e('0x9')](_0x0e3e('0xf'),auth['isAuthenticated'](),controller[_0x0e3e('0x10')]);router[_0x0e3e('0x9')](_0x0e3e('0x11'),auth[_0x0e3e('0xc')](),controller['getHopperBlacks']);router[_0x0e3e('0x9')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x0e3e('0x9')](_0x0e3e('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x13')]);router[_0x0e3e('0x14')]('/:id/clone',auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x15')]);router[_0x0e3e('0x14')](_0x0e3e('0x16'),auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x17')]);router[_0x0e3e('0x14')](_0x0e3e('0x12'),auth[_0x0e3e('0xc')](),controller['addBlackLists']);router[_0x0e3e('0x18')](_0x0e3e('0x19'),auth[_0x0e3e('0xc')](),controller['update']);router[_0x0e3e('0x1a')](_0x0e3e('0x19'),auth[_0x0e3e('0xc')](),controller['destroy']);router[_0x0e3e('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x0e3e('0x1b')]);router[_0x0e3e('0x1a')](_0x0e3e('0x12'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x0e3e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 88ef8e5..4af9a78 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18f0=['getDataValue','key','STRING','TEXT','VIRTUAL'];(function(_0x237b6a,_0x2ebc92){var _0x93c494=function(_0x4c3f50){while(--_0x4c3f50){_0x237b6a['push'](_0x237b6a['shift']());}};_0x93c494(++_0x2ebc92);}(_0x18f0,0x1d8));var _0x018f=function(_0x1c72ac,_0x380a0e){_0x1c72ac=_0x1c72ac-0x0;var _0x274e46=_0x18f0[_0x1c72ac];return _0x274e46;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x018f('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x018f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x018f('0x0')]},'name':{'type':Sequelize[_0x018f('0x2')],'get':function(){return this[_0x018f('0x3')](_0x018f('0x4'));}}}; \ No newline at end of file +var _0x0f64=['key','sequelize','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x229383,_0x1408a7){var _0x2eec0=function(_0x360d7e){while(--_0x360d7e){_0x229383['push'](_0x229383['shift']());}};_0x2eec0(++_0x1408a7);}(_0x0f64,0xc1));var _0x40f6=function(_0x2abd90,_0x5178b3){_0x2abd90=_0x2abd90-0x0;var _0x587278=_0x0f64[_0x2abd90];return _0x587278;};'use strict';var Sequelize=require(_0x40f6('0x0'));module['exports']={'key':{'type':Sequelize[_0x40f6('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x40f6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x40f6('0x1')]},'name':{'type':Sequelize[_0x40f6('0x3')],'get':function(){return this[_0x40f6('0x4')](_0x40f6('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index dda30c7..287fd4a 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4089=['Content-Range','json','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','index','CannedAnswer','rawAttributes','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4089,0x138));var _0x9408=function(_0x29baf6,_0x44f0e0){_0x29baf6=_0x29baf6-0x0;var _0x29e760=_0x4089[_0x29baf6];return _0x29e760;};'use strict';var emlformat=require(_0x9408('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9408('0x1'));var jsonpatch=require(_0x9408('0x2'));var rp=require('request-promise');var moment=require(_0x9408('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9408('0x4'));var util=require('util');var path=require(_0x9408('0x5'));var sox=require(_0x9408('0x6'));var csv=require(_0x9408('0x7'));var ejs=require(_0x9408('0x8'));var fs=require('fs');var fs_extra=require(_0x9408('0x9'));var _=require(_0x9408('0xa'));var squel=require(_0x9408('0xb'));var crypto=require('crypto');var jsforce=require(_0x9408('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9408('0x7'));var querystring=require(_0x9408('0xd'));var Papa=require(_0x9408('0xe'));var Redis=require(_0x9408('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9408('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9408('0x11'))('api');var utils=require(_0x9408('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9408('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa75044,_0x4d8876){_0x4d8876=_0x4d8876||0xcc;return function(_0x334686){if(_0x334686){return _0xa75044[_0x9408('0x14')](_0x4d8876);}return _0xa75044[_0x9408('0x15')](_0x4d8876)[_0x9408('0x16')]();};}function respondWithResult(_0x234c97,_0x292984){_0x292984=_0x292984||0xc8;return function(_0x590d6b){if(_0x590d6b){return _0x234c97['status'](_0x292984)['json'](_0x590d6b);}};}function respondWithFilteredResult(_0x1f1160,_0x526718){return function(_0x12c4c5){if(_0x12c4c5){var _0x455adf=typeof _0x526718[_0x9408('0x17')]===_0x9408('0x18')&&typeof _0x526718[_0x9408('0x19')]==='undefined';var _0x3b66f7=_0x12c4c5[_0x9408('0x1a')];var _0x244978=_0x455adf?0x0:_0x526718['offset'];var _0x46261f=_0x455adf?_0x12c4c5[_0x9408('0x1a')]:_0x526718[_0x9408('0x17')]+_0x526718[_0x9408('0x19')];var _0x20cad4;if(_0x46261f>=_0x3b66f7){_0x46261f=_0x3b66f7;_0x20cad4=0xc8;}else{_0x20cad4=0xce;}_0x1f1160[_0x9408('0x15')](_0x20cad4);return _0x1f1160[_0x9408('0x1b')](_0x9408('0x1c'),_0x244978+'-'+_0x46261f+'/'+_0x3b66f7)[_0x9408('0x1d')](_0x12c4c5);}return null;};}function patchUpdates(_0x360778){return function(_0x3192e9){try{jsonpatch[_0x9408('0x1e')](_0x3192e9,_0x360778,!![]);}catch(_0x4ea92b){return BPromise['reject'](_0x4ea92b);}return _0x3192e9[_0x9408('0x1f')]();};}function saveUpdates(_0xdf8323,_0x54746b){return function(_0x15fca7){if(_0x15fca7){return _0x15fca7[_0x9408('0x20')](_0xdf8323)[_0x9408('0x21')](function(_0x2a8bbb){return _0x2a8bbb;});}return null;};}function removeEntity(_0x5e662c,_0x20faf3){return function(_0x3be715){if(_0x3be715){return _0x3be715[_0x9408('0x22')]()[_0x9408('0x21')](function(){var _0x976859=_0x3be715[_0x9408('0x23')]({'plain':!![]});var _0x34e98a=_0x9408('0x24');return db[_0x9408('0x25')]['destroy']({'where':{'type':_0x34e98a,'resourceId':_0x976859['id']}})[_0x9408('0x21')](function(){return _0x3be715;});})[_0x9408('0x21')](function(){_0x5e662c[_0x9408('0x15')](0xcc)[_0x9408('0x16')]();});}};}function handleEntityNotFound(_0x469e60,_0x3fde40){return function(_0x491bbb){if(!_0x491bbb){_0x469e60[_0x9408('0x14')](0x194);}return _0x491bbb;};}function handleError(_0x1fb27c,_0x3a5213){_0x3a5213=_0x3a5213||0x1f4;return function(_0x30bef){logger[_0x9408('0x26')](_0x30bef[_0x9408('0x27')]);if(_0x30bef['name']){delete _0x30bef['name'];}_0x1fb27c[_0x9408('0x15')](_0x3a5213)['send'](_0x30bef);};}exports[_0x9408('0x28')]=function(_0x53f933,_0xda58d){var _0x528695={},_0x54b88f={},_0x1ec335={'count':0x0,'rows':[]};var _0x4b6e34=_['map'](db[_0x9408('0x29')][_0x9408('0x2a')],function(_0x20368b){return{'name':_0x20368b['fieldName'],'type':_0x20368b[_0x9408('0x2b')]['key']};});_0x54b88f[_0x9408('0x2c')]=_[_0x9408('0x2d')](_0x4b6e34,_0x9408('0x2e'));_0x54b88f[_0x9408('0x2f')]=_[_0x9408('0x30')](_0x53f933[_0x9408('0x2f')]);_0x54b88f[_0x9408('0x31')]=_[_0x9408('0x32')](_0x54b88f[_0x9408('0x2c')],_0x54b88f[_0x9408('0x2f')]);_0x528695[_0x9408('0x33')]=_[_0x9408('0x32')](_0x54b88f[_0x9408('0x2c')],qs[_0x9408('0x34')](_0x53f933['query'][_0x9408('0x34')]));_0x528695[_0x9408('0x33')]=_0x528695[_0x9408('0x33')][_0x9408('0x35')]?_0x528695[_0x9408('0x33')]:_0x54b88f['model'];if(!_0x53f933[_0x9408('0x2f')][_0x9408('0x36')](_0x9408('0x37'))){_0x528695['limit']=qs[_0x9408('0x19')](_0x53f933[_0x9408('0x2f')]['limit']);_0x528695[_0x9408('0x17')]=qs[_0x9408('0x17')](_0x53f933[_0x9408('0x2f')][_0x9408('0x17')]);}_0x528695[_0x9408('0x38')]=qs[_0x9408('0x39')](_0x53f933['query'][_0x9408('0x39')]);_0x528695[_0x9408('0x3a')]=qs[_0x9408('0x31')](_[_0x9408('0x3b')](_0x53f933[_0x9408('0x2f')],_0x54b88f[_0x9408('0x31')]),_0x4b6e34);if(_0x53f933[_0x9408('0x2f')]['filter']){_0x528695[_0x9408('0x3a')]=_['merge'](_0x528695[_0x9408('0x3a')],{'$or':[{'key':{'$like':'%'+_0x53f933[_0x9408('0x2f')][_0x9408('0x3c')]+'%'}},{'value':{'$like':'%'+_0x53f933[_0x9408('0x2f')][_0x9408('0x3c')]+'%'}}]});}_0x528695=_[_0x9408('0x3d')]({},_0x528695,_0x53f933[_0x9408('0x3e')]);var _0xfcedfd={'where':_0x528695[_0x9408('0x3a')]};return db[_0x9408('0x29')][_0x9408('0x1a')](_0xfcedfd)[_0x9408('0x21')](function(_0x80255c){_0x1ec335[_0x9408('0x1a')]=_0x80255c;if(_0x53f933[_0x9408('0x2f')]['includeAll']){_0x528695[_0x9408('0x3f')]=[{'all':!![]}];}return db[_0x9408('0x29')][_0x9408('0x40')](_0x528695);})[_0x9408('0x21')](function(_0x1ade22){_0x1ec335[_0x9408('0x41')]=_0x1ade22;return _0x1ec335;})['then'](respondWithFilteredResult(_0xda58d,_0x528695))[_0x9408('0x42')](handleError(_0xda58d,null));};exports[_0x9408('0x43')]=function(_0x55085d,_0x4ca464){var _0x1afe65={'raw':!![],'where':{'id':_0x55085d[_0x9408('0x44')]['id']}},_0x2c3efa={};_0x2c3efa[_0x9408('0x2c')]=_['keys'](db['CannedAnswer'][_0x9408('0x2a')]);_0x2c3efa[_0x9408('0x2f')]=_[_0x9408('0x30')](_0x55085d[_0x9408('0x2f')]);_0x2c3efa[_0x9408('0x31')]=_[_0x9408('0x32')](_0x2c3efa[_0x9408('0x2c')],_0x2c3efa[_0x9408('0x2f')]);_0x1afe65['attributes']=_[_0x9408('0x32')](_0x2c3efa['model'],qs['fields'](_0x55085d['query'][_0x9408('0x34')]));_0x1afe65[_0x9408('0x33')]=_0x1afe65[_0x9408('0x33')][_0x9408('0x35')]?_0x1afe65[_0x9408('0x33')]:_0x2c3efa[_0x9408('0x2c')];if(_0x55085d['query'][_0x9408('0x45')]){_0x1afe65[_0x9408('0x3f')]=[{'all':!![]}];}_0x1afe65=_[_0x9408('0x3d')]({},_0x1afe65,_0x55085d[_0x9408('0x3e')]);return db[_0x9408('0x29')][_0x9408('0x46')](_0x1afe65)['then'](handleEntityNotFound(_0x4ca464,null))[_0x9408('0x21')](respondWithResult(_0x4ca464,null))[_0x9408('0x42')](handleError(_0x4ca464,null));};exports[_0x9408('0x20')]=function(_0x44e30b,_0x5abb19){if(_0x44e30b[_0x9408('0x47')]['id']){delete _0x44e30b[_0x9408('0x47')]['id'];}return db['CannedAnswer'][_0x9408('0x46')]({'where':{'id':_0x44e30b[_0x9408('0x44')]['id']}})['then'](handleEntityNotFound(_0x5abb19,null))[_0x9408('0x21')](saveUpdates(_0x44e30b[_0x9408('0x47')],null))[_0x9408('0x21')](respondWithResult(_0x5abb19,null))[_0x9408('0x42')](handleError(_0x5abb19,null));};exports[_0x9408('0x22')]=function(_0x2e471e,_0x2f32af){return db['CannedAnswer'][_0x9408('0x46')]({'where':{'id':_0x2e471e[_0x9408('0x44')]['id']}})[_0x9408('0x21')](handleEntityNotFound(_0x2f32af,null))[_0x9408('0x21')](removeEntity(_0x2f32af,null))['catch'](handleError(_0x2f32af,null));};exports[_0x9408('0x48')]=function(_0xe5dde1,_0x3215ee){var _0x3808df={'key':_0xe5dde1['body'][_0x9408('0x49')]};if(_0xe5dde1[_0x9408('0x47')][_0x9408('0x4a')]){_0x3808df[_0x9408('0x4a')]=_0xe5dde1[_0x9408('0x47')][_0x9408('0x4a')];}else if(_0xe5dde1[_0x9408('0x47')]['SmsAccountId']){_0x3808df[_0x9408('0x4b')]=_0xe5dde1['body'][_0x9408('0x4b')];}else if(_0xe5dde1['body']['OpenchannelAccountId']){_0x3808df[_0x9408('0x4c')]=_0xe5dde1[_0x9408('0x47')][_0x9408('0x4c')];}else if(_0xe5dde1['body'][_0x9408('0x4d')]){_0x3808df[_0x9408('0x4d')]=_0xe5dde1['body'][_0x9408('0x4d')];}return db[_0x9408('0x29')][_0x9408('0x46')]({'where':_0x3808df})[_0x9408('0x21')](function(_0x19fcb5){if(_0x19fcb5){throw new db[(_0x9408('0x4e'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x9408('0x48')](_0xe5dde1['body']);})['then'](function(_0x4256f3){var _0x84f5fd=_0xe5dde1[_0x9408('0x4f')][_0x9408('0x23')]({'plain':!![]});if(!_0x84f5fd)throw new Error(_0x9408('0x50'));if(_0x84f5fd['role']===_0x9408('0x4f')){var _0x2a46c9=_0x4256f3[_0x9408('0x23')]({'plain':!![]});return db[_0x9408('0x51')][_0x9408('0x46')]({'where':{'name':_0x9408('0x24'),'userProfileId':_0x84f5fd[_0x9408('0x52')]},'raw':!![]})['then'](function(_0xd24848){if(_0xd24848&&_0xd24848[_0x9408('0x53')]===0x0){return db[_0x9408('0x25')][_0x9408('0x48')]({'name':_0x2a46c9[_0x9408('0x2e')],'resourceId':_0x2a46c9['id'],'type':_0xd24848[_0x9408('0x2e')],'sectionId':_0xd24848['id']},{})['then'](function(){return _0x4256f3;});}else{return _0x4256f3;}})[_0x9408('0x42')](function(_0x1a4099){logger[_0x9408('0x26')](_0x9408('0x54'),_0x1a4099);throw _0x1a4099;});}return _0x4256f3;})[_0x9408('0x21')](respondWithResult(_0x3215ee,0xc9))['catch'](handleError(_0x3215ee,null));}; \ No newline at end of file +var _0xccac=['body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xccac,0x171));var _0xccca=function(_0x508ac6,_0x4d9a97){_0x508ac6=_0x508ac6-0x0;var _0x25d22a=_0xccac[_0x508ac6];return _0x25d22a;};'use strict';var emlformat=require(_0xccca('0x0'));var rimraf=require(_0xccca('0x1'));var zipdir=require(_0xccca('0x2'));var jsonpatch=require(_0xccca('0x3'));var rp=require('request-promise');var moment=require(_0xccca('0x4'));var BPromise=require(_0xccca('0x5'));var Mustache=require(_0xccca('0x6'));var util=require(_0xccca('0x7'));var path=require(_0xccca('0x8'));var sox=require(_0xccca('0x9'));var csv=require(_0xccca('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccca('0xb'));var crypto=require('crypto');var jsforce=require(_0xccca('0xc'));var deskjs=require(_0xccca('0xd'));var toCsv=require(_0xccca('0xa'));var querystring=require(_0xccca('0xe'));var Papa=require(_0xccca('0xf'));var Redis=require('ioredis');var authService=require(_0xccca('0x10'));var qs=require(_0xccca('0x11'));var as=require(_0xccca('0x12'));var hardwareService=require(_0xccca('0x13'));var logger=require(_0xccca('0x14'))(_0xccca('0x15'));var utils=require(_0xccca('0x16'));var config=require(_0xccca('0x17'));var licenseUtil=require(_0xccca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18cb99,_0x443648){_0x443648=_0x443648||0xcc;return function(_0xfb7ac3){if(_0xfb7ac3){return _0x18cb99[_0xccca('0x19')](_0x443648);}return _0x18cb99[_0xccca('0x1a')](_0x443648)[_0xccca('0x1b')]();};}function respondWithResult(_0x472053,_0x2fbbad){_0x2fbbad=_0x2fbbad||0xc8;return function(_0x1d1c9a){if(_0x1d1c9a){return _0x472053[_0xccca('0x1a')](_0x2fbbad)[_0xccca('0x1c')](_0x1d1c9a);}};}function respondWithFilteredResult(_0x1daa8d,_0x5137ba){return function(_0x105806){if(_0x105806){var _0xaa2e98=typeof _0x5137ba[_0xccca('0x1d')]==='undefined'&&typeof _0x5137ba['limit']==='undefined';var _0x1633a8=_0x105806[_0xccca('0x1e')];var _0x119878=_0xaa2e98?0x0:_0x5137ba[_0xccca('0x1d')];var _0x12fd81=_0xaa2e98?_0x105806['count']:_0x5137ba['offset']+_0x5137ba[_0xccca('0x1f')];var _0x4f6665;if(_0x12fd81>=_0x1633a8){_0x12fd81=_0x1633a8;_0x4f6665=0xc8;}else{_0x4f6665=0xce;}_0x1daa8d['status'](_0x4f6665);return _0x1daa8d[_0xccca('0x20')](_0xccca('0x21'),_0x119878+'-'+_0x12fd81+'/'+_0x1633a8)[_0xccca('0x1c')](_0x105806);}return null;};}function patchUpdates(_0x583aeb){return function(_0x242897){try{jsonpatch['apply'](_0x242897,_0x583aeb,!![]);}catch(_0xa0518c){return BPromise[_0xccca('0x22')](_0xa0518c);}return _0x242897[_0xccca('0x23')]();};}function saveUpdates(_0x3b99cc,_0x3a657f){return function(_0x2e59b0){if(_0x2e59b0){return _0x2e59b0[_0xccca('0x24')](_0x3b99cc)['then'](function(_0x10a364){return _0x10a364;});}return null;};}function removeEntity(_0x11d4e0,_0x5b0863){return function(_0x1b6b94){if(_0x1b6b94){return _0x1b6b94[_0xccca('0x25')]()[_0xccca('0x26')](function(){var _0x864e46=_0x1b6b94[_0xccca('0x27')]({'plain':!![]});var _0x4e6327=_0xccca('0x28');return db[_0xccca('0x29')][_0xccca('0x25')]({'where':{'type':_0x4e6327,'resourceId':_0x864e46['id']}})[_0xccca('0x26')](function(){return _0x1b6b94;});})[_0xccca('0x26')](function(){_0x11d4e0[_0xccca('0x1a')](0xcc)[_0xccca('0x1b')]();});}};}function handleEntityNotFound(_0x1df57a,_0x10344c){return function(_0x1161f8){if(!_0x1161f8){_0x1df57a[_0xccca('0x19')](0x194);}return _0x1161f8;};}function handleError(_0x4a4288,_0x2c65ae){_0x2c65ae=_0x2c65ae||0x1f4;return function(_0x57cd15){logger[_0xccca('0x2a')](_0x57cd15[_0xccca('0x2b')]);if(_0x57cd15['name']){delete _0x57cd15[_0xccca('0x2c')];}_0x4a4288[_0xccca('0x1a')](_0x2c65ae)['send'](_0x57cd15);};}exports['index']=function(_0x32c4a5,_0x14cab5){var _0x25e7db={},_0x4ff944={},_0x258208={'count':0x0,'rows':[]};var _0x3bf5ae=_[_0xccca('0x2d')](db['CannedAnswer'][_0xccca('0x2e')],function(_0x4ea0bd){return{'name':_0x4ea0bd[_0xccca('0x2f')],'type':_0x4ea0bd[_0xccca('0x30')][_0xccca('0x31')]};});_0x4ff944[_0xccca('0x32')]=_[_0xccca('0x2d')](_0x3bf5ae,_0xccca('0x2c'));_0x4ff944[_0xccca('0x33')]=_[_0xccca('0x34')](_0x32c4a5['query']);_0x4ff944[_0xccca('0x35')]=_[_0xccca('0x36')](_0x4ff944[_0xccca('0x32')],_0x4ff944[_0xccca('0x33')]);_0x25e7db[_0xccca('0x37')]=_[_0xccca('0x36')](_0x4ff944[_0xccca('0x32')],qs[_0xccca('0x38')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x38')]));_0x25e7db[_0xccca('0x37')]=_0x25e7db[_0xccca('0x37')][_0xccca('0x39')]?_0x25e7db[_0xccca('0x37')]:_0x4ff944[_0xccca('0x32')];if(!_0x32c4a5[_0xccca('0x33')][_0xccca('0x3a')](_0xccca('0x3b'))){_0x25e7db[_0xccca('0x1f')]=qs[_0xccca('0x1f')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x1f')]);_0x25e7db[_0xccca('0x1d')]=qs[_0xccca('0x1d')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x1d')]);}_0x25e7db[_0xccca('0x3c')]=qs[_0xccca('0x3d')](_0x32c4a5['query'][_0xccca('0x3d')]);_0x25e7db['where']=qs['filters'](_[_0xccca('0x3e')](_0x32c4a5[_0xccca('0x33')],_0x4ff944[_0xccca('0x35')]),_0x3bf5ae);if(_0x32c4a5[_0xccca('0x33')][_0xccca('0x3f')]){_0x25e7db[_0xccca('0x40')]=_[_0xccca('0x41')](_0x25e7db[_0xccca('0x40')],{'$or':[{'key':{'$like':'%'+_0x32c4a5[_0xccca('0x33')][_0xccca('0x3f')]+'%'}},{'value':{'$like':'%'+_0x32c4a5['query']['filter']+'%'}}]});}_0x25e7db=_[_0xccca('0x41')]({},_0x25e7db,_0x32c4a5[_0xccca('0x42')]);var _0x5a97df={'where':_0x25e7db[_0xccca('0x40')]};return db[_0xccca('0x43')][_0xccca('0x1e')](_0x5a97df)[_0xccca('0x26')](function(_0xb9bc04){_0x258208['count']=_0xb9bc04;if(_0x32c4a5[_0xccca('0x33')][_0xccca('0x44')]){_0x25e7db['include']=[{'all':!![]}];}return db[_0xccca('0x43')][_0xccca('0x45')](_0x25e7db);})[_0xccca('0x26')](function(_0x4ecf89){_0x258208[_0xccca('0x46')]=_0x4ecf89;return _0x258208;})[_0xccca('0x26')](respondWithFilteredResult(_0x14cab5,_0x25e7db))[_0xccca('0x47')](handleError(_0x14cab5,null));};exports[_0xccca('0x48')]=function(_0x4907cb,_0x232f0d){var _0x1b1849={'raw':!![],'where':{'id':_0x4907cb[_0xccca('0x49')]['id']}},_0x3890e4={};_0x3890e4[_0xccca('0x32')]=_[_0xccca('0x34')](db[_0xccca('0x43')][_0xccca('0x2e')]);_0x3890e4[_0xccca('0x33')]=_[_0xccca('0x34')](_0x4907cb[_0xccca('0x33')]);_0x3890e4[_0xccca('0x35')]=_[_0xccca('0x36')](_0x3890e4['model'],_0x3890e4[_0xccca('0x33')]);_0x1b1849['attributes']=_[_0xccca('0x36')](_0x3890e4['model'],qs['fields'](_0x4907cb['query']['fields']));_0x1b1849['attributes']=_0x1b1849['attributes'][_0xccca('0x39')]?_0x1b1849[_0xccca('0x37')]:_0x3890e4[_0xccca('0x32')];if(_0x4907cb[_0xccca('0x33')][_0xccca('0x44')]){_0x1b1849[_0xccca('0x4a')]=[{'all':!![]}];}_0x1b1849=_[_0xccca('0x41')]({},_0x1b1849,_0x4907cb[_0xccca('0x42')]);return db[_0xccca('0x43')][_0xccca('0x4b')](_0x1b1849)['then'](handleEntityNotFound(_0x232f0d,null))[_0xccca('0x26')](respondWithResult(_0x232f0d,null))[_0xccca('0x47')](handleError(_0x232f0d,null));};exports['update']=function(_0x2331e0,_0x2f7613){if(_0x2331e0[_0xccca('0x4c')]['id']){delete _0x2331e0[_0xccca('0x4c')]['id'];}return db[_0xccca('0x43')][_0xccca('0x4b')]({'where':{'id':_0x2331e0[_0xccca('0x49')]['id']}})['then'](handleEntityNotFound(_0x2f7613,null))[_0xccca('0x26')](saveUpdates(_0x2331e0[_0xccca('0x4c')],null))[_0xccca('0x26')](respondWithResult(_0x2f7613,null))[_0xccca('0x47')](handleError(_0x2f7613,null));};exports[_0xccca('0x25')]=function(_0x5ab9da,_0x537e0d){return db[_0xccca('0x43')][_0xccca('0x4b')]({'where':{'id':_0x5ab9da['params']['id']}})['then'](handleEntityNotFound(_0x537e0d,null))['then'](removeEntity(_0x537e0d,null))[_0xccca('0x47')](handleError(_0x537e0d,null));};exports[_0xccca('0x4d')]=function(_0x5bdb61,_0x523be0){var _0x4bfa50={'key':_0x5bdb61[_0xccca('0x4c')][_0xccca('0x31')]};if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x4e')]){_0x4bfa50[_0xccca('0x4e')]=_0x5bdb61['body'][_0xccca('0x4e')];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x4f')]){_0x4bfa50[_0xccca('0x4f')]=_0x5bdb61[_0xccca('0x4c')]['SmsAccountId'];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x50')]){_0x4bfa50[_0xccca('0x50')]=_0x5bdb61[_0xccca('0x4c')]['OpenchannelAccountId'];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x51')]){_0x4bfa50[_0xccca('0x51')]=_0x5bdb61[_0xccca('0x4c')][_0xccca('0x51')];}return db['CannedAnswer'][_0xccca('0x4b')]({'where':_0x4bfa50})['then'](function(_0x31a1ec){if(_0x31a1ec){throw new db[(_0xccca('0x52'))][(_0xccca('0x53'))](_0xccca('0x54'));}return db[_0xccca('0x43')][_0xccca('0x4d')](_0x5bdb61[_0xccca('0x4c')]);})[_0xccca('0x26')](function(_0x14ddb9){var _0x42a98e=_0x5bdb61[_0xccca('0x55')][_0xccca('0x27')]({'plain':!![]});if(!_0x42a98e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42a98e[_0xccca('0x56')]===_0xccca('0x55')){var _0x2f4460=_0x14ddb9[_0xccca('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xccca('0x28'),'userProfileId':_0x42a98e[_0xccca('0x57')]},'raw':!![]})[_0xccca('0x26')](function(_0x16c455){if(_0x16c455&&_0x16c455['autoAssociation']===0x0){return db[_0xccca('0x29')]['create']({'name':_0x2f4460[_0xccca('0x2c')],'resourceId':_0x2f4460['id'],'type':_0x16c455[_0xccca('0x2c')],'sectionId':_0x16c455['id']},{})[_0xccca('0x26')](function(){return _0x14ddb9;});}else{return _0x14ddb9;}})[_0xccca('0x47')](function(_0x13b1ad){logger[_0xccca('0x2a')](_0xccca('0x58'),_0x13b1ad);throw _0x13b1ad;});}return _0x14ddb9;})[_0xccca('0x26')](respondWithResult(_0x523be0,0xc9))[_0xccca('0x47')](handleError(_0x523be0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3355664..2fbf212 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8f5=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','rimraf','../../config/environment','CannedAnswer'];(function(_0x134a29,_0x582b4d){var _0x467d55=function(_0x95b0e5){while(--_0x95b0e5){_0x134a29['push'](_0x134a29['shift']());}};_0x467d55(++_0x582b4d);}(_0xe8f5,0x159));var _0x5e8f=function(_0x1d4944,_0x3a0b91){_0x1d4944=_0x1d4944-0x0;var _0x40b72b=_0xe8f5[_0x1d4944];return _0x40b72b;};'use strict';var _=require(_0x5e8f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e8f('0x1'));var moment=require(_0x5e8f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8f('0x3'));var config=require(_0x5e8f('0x4'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x1011b6,_0x24323b){return _0x1011b6['define'](_0x5e8f('0x5'),attributes,{'tableName':_0x5e8f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e8f('0x7'),'collate':_0x5e8f('0x8')});}; \ No newline at end of file +var _0x7f97=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4'];(function(_0x1dd8bf,_0x99155f){var _0x3ca4b4=function(_0x557813){while(--_0x557813){_0x1dd8bf['push'](_0x1dd8bf['shift']());}};_0x3ca4b4(++_0x99155f);}(_0x7f97,0x11f));var _0x77f9=function(_0x200dee,_0x3259fb){_0x200dee=_0x200dee-0x0;var _0x3f0123=_0x7f97[_0x200dee];return _0x3f0123;};'use strict';var _=require('lodash');var util=require(_0x77f9('0x0'));var logger=require('../../config/logger')(_0x77f9('0x1'));var moment=require(_0x77f9('0x2'));var BPromise=require(_0x77f9('0x3'));var rp=require(_0x77f9('0x4'));var fs=require('fs');var path=require(_0x77f9('0x5'));var rimraf=require(_0x77f9('0x6'));var config=require(_0x77f9('0x7'));var attributes=require(_0x77f9('0x8'));module['exports']=function(_0x17794d,_0x4d562b){return _0x17794d[_0x77f9('0x9')](_0x77f9('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77f9('0xb'),'collate':_0x77f9('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d99c6b5..3157029 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39ff7f,_0x439fe5){var _0x3ef5f=function(_0x2a10e4){while(--_0x2a10e4){_0x39ff7f['push'](_0x39ff7f['shift']());}};_0x3ef5f(++_0x439fe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b8dfd,_0x16d02f){var _0x3f343f=function(_0x5cbcff){while(--_0x5cbcff){_0x2b8dfd['push'](_0x2b8dfd['shift']());}};_0x3f343f(++_0x16d02f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index ce703cc..845c852 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b4b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','put','destroy','multer','util','path','connect-timeout'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x3b4b,0x84));var _0xb3b4=function(_0x32fab2,_0x4c3cad){_0x32fab2=_0x32fab2-0x0;var _0x166bf4=_0x3b4b[_0x32fab2];return _0x166bf4;};'use strict';var multer=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var path=require(_0xb3b4('0x2'));var timeout=require(_0xb3b4('0x3'));var express=require(_0xb3b4('0x4'));var router=express[_0xb3b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b4('0x6'));var interaction=require(_0xb3b4('0x7'));var config=require(_0xb3b4('0x8'));var controller=require(_0xb3b4('0x9'));router[_0xb3b4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3b4('0xa')](_0xb3b4('0xb'),auth[_0xb3b4('0xc')](),controller[_0xb3b4('0xd')]);router[_0xb3b4('0xe')]('/',auth[_0xb3b4('0xc')](),controller['create']);router[_0xb3b4('0xf')]('/:id',auth[_0xb3b4('0xc')](),controller['update']);router['delete'](_0xb3b4('0xb'),auth[_0xb3b4('0xc')](),controller[_0xb3b4('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd3da=['Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5b262d,_0x27ad12){var _0x238a1b=function(_0x50f3d4){while(--_0x50f3d4){_0x5b262d['push'](_0x5b262d['shift']());}};_0x238a1b(++_0x27ad12);}(_0xd3da,0x12e));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xad3d('0x0'));var util=require(_0xad3d('0x1'));var path=require(_0xad3d('0x2'));var timeout=require(_0xad3d('0x3'));var express=require('express');var router=express[_0xad3d('0x4')]();var fs_extra=require(_0xad3d('0x5'));var auth=require(_0xad3d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad3d('0x7'));var controller=require('./cannedAnswer.controller');router[_0xad3d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad3d('0x8')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0xb')]);router['post']('/',auth[_0xad3d('0xa')](),controller[_0xad3d('0xc')]);router[_0xad3d('0xd')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0xe')]);router[_0xad3d('0xf')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index dccdc43..e296e2c 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e3d=['STRING','INTEGER','sequelize','1970-01-01\x2000:00:01'];(function(_0x502417,_0x4d0bf1){var _0x5d0686=function(_0xfd75b3){while(--_0xfd75b3){_0x502417['push'](_0x502417['shift']());}};_0x5d0686(++_0x4d0bf1);}(_0x2e3d,0x1be));var _0xd2e3=function(_0xc99308,_0x194663){_0xc99308=_0xc99308-0x0;var _0x5f4aec=_0x2e3d[_0xc99308];return _0x5f4aec;};'use strict';var Sequelize=require(_0xd2e3('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd2e3('0x1')},'clid':{'type':Sequelize[_0xd2e3('0x2')]},'src':{'type':Sequelize[_0xd2e3('0x2')]},'dst':{'type':Sequelize[_0xd2e3('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xd2e3('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd2e3('0x2')]},'duration':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd2e3('0x2')]},'amaflags':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd2e3('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd2e3('0x2')]},'linkedid':{'type':Sequelize[_0xd2e3('0x2')]},'sequence':{'type':Sequelize[_0xd2e3('0x2')]},'peeraccount':{'type':Sequelize[_0xd2e3('0x2')]},'type':{'type':Sequelize[_0xd2e3('0x2')]},'tag':{'type':Sequelize[_0xd2e3('0x2')]}}; \ No newline at end of file +var _0x6c38=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x969f02,_0x448275){var _0x593798=function(_0x2d291b){while(--_0x2d291b){_0x969f02['push'](_0x969f02['shift']());}};_0x593798(++_0x448275);}(_0x6c38,0x8f));var _0x86c3=function(_0x2c85d4,_0x196197){_0x2c85d4=_0x2c85d4-0x0;var _0x5c1b31=_0x6c38[_0x2c85d4];return _0x5c1b31;};'use strict';var Sequelize=require(_0x86c3('0x0'));module[_0x86c3('0x1')]={'calldate':{'type':Sequelize[_0x86c3('0x2')],'allowNull':![],'defaultValue':_0x86c3('0x3')},'clid':{'type':Sequelize[_0x86c3('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x86c3('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x86c3('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x86c3('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x86c3('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x86c3('0x4')]},'userfield':{'type':Sequelize[_0x86c3('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x86c3('0x4')]},'sequence':{'type':Sequelize[_0x86c3('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 7d8fe9f..d1e9e4f 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x2de9de,_0xd46ad){var _0x34be8c=function(_0x294df0){while(--_0x294df0){_0x2de9de['push'](_0x2de9de['shift']());}};_0x34be8c(++_0xd46ad);}(_0xe181,0x68));var _0x1e18=function(_0x51d4ee,_0xdead36){_0x51d4ee=_0x51d4ee-0x0;var _0x2939b0=_0xe181[_0x51d4ee];return _0x2939b0;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['Cdr'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));}; \ No newline at end of file +var _0x236d=['undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','destroy','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4e7b37,_0x33b1fa){var _0x20b707=function(_0x1fb9ff){while(--_0x1fb9ff){_0x4e7b37['push'](_0x4e7b37['shift']());}};_0x20b707(++_0x33b1fa);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd236('0x0'));var rimraf=require(_0xd236('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd236('0x2'));var rp=require('request-promise');var moment=require(_0xd236('0x3'));var BPromise=require(_0xd236('0x4'));var Mustache=require(_0xd236('0x5'));var util=require(_0xd236('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd236('0x7'));var ejs=require(_0xd236('0x8'));var fs=require('fs');var fs_extra=require(_0xd236('0x9'));var _=require(_0xd236('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd236('0xb'));var deskjs=require(_0xd236('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd236('0xd'));var Papa=require(_0xd236('0xe'));var Redis=require('ioredis');var authService=require(_0xd236('0xf'));var qs=require(_0xd236('0x10'));var as=require(_0xd236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd236('0x12'))(_0xd236('0x13'));var utils=require(_0xd236('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd236('0x15'));var db=require(_0xd236('0x16'))['db'];function respondWithStatusCode(_0x3d1076,_0x160cb1){_0x160cb1=_0x160cb1||0xcc;return function(_0x21f27b){if(_0x21f27b){return _0x3d1076[_0xd236('0x17')](_0x160cb1);}return _0x3d1076[_0xd236('0x18')](_0x160cb1)[_0xd236('0x19')]();};}function respondWithResult(_0x22435c,_0x3d7465){_0x3d7465=_0x3d7465||0xc8;return function(_0x348734){if(_0x348734){return _0x22435c[_0xd236('0x18')](_0x3d7465)[_0xd236('0x1a')](_0x348734);}};}function respondWithFilteredResult(_0x3b60a7,_0xd851b5){return function(_0x3b2535){if(_0x3b2535){var _0x2a076d=typeof _0xd851b5[_0xd236('0x1b')]===_0xd236('0x1c')&&typeof _0xd851b5[_0xd236('0x1d')]==='undefined';var _0x4f06c6=_0x3b2535[_0xd236('0x1e')];var _0x1b02a5=_0x2a076d?0x0:_0xd851b5['offset'];var _0x11c6ec=_0x2a076d?_0x3b2535[_0xd236('0x1e')]:_0xd851b5[_0xd236('0x1b')]+_0xd851b5['limit'];var _0x355b65;if(_0x11c6ec>=_0x4f06c6){_0x11c6ec=_0x4f06c6;_0x355b65=0xc8;}else{_0x355b65=0xce;}_0x3b60a7[_0xd236('0x18')](_0x355b65);return _0x3b60a7[_0xd236('0x1f')]('Content-Range',_0x1b02a5+'-'+_0x11c6ec+'/'+_0x4f06c6)[_0xd236('0x1a')](_0x3b2535);}return null;};}function patchUpdates(_0x3b0a27){return function(_0x26c758){try{jsonpatch[_0xd236('0x20')](_0x26c758,_0x3b0a27,!![]);}catch(_0x2f512d){return BPromise['reject'](_0x2f512d);}return _0x26c758[_0xd236('0x21')]();};}function saveUpdates(_0x30e7aa,_0x1e4ddb){return function(_0x3d1e4e){if(_0x3d1e4e){return _0x3d1e4e[_0xd236('0x22')](_0x30e7aa)['then'](function(_0x4a35d0){return _0x4a35d0;});}return null;};}function removeEntity(_0x257f27,_0x4be5ac){return function(_0x22924d){if(_0x22924d){return _0x22924d['destroy']()[_0xd236('0x23')](function(){_0x257f27[_0xd236('0x18')](0xcc)[_0xd236('0x19')]();});}};}function handleEntityNotFound(_0x49d822,_0x41049a){return function(_0x339b08){if(!_0x339b08){_0x49d822[_0xd236('0x17')](0x194);}return _0x339b08;};}function handleError(_0x13ba7a,_0x3a30d8){_0x3a30d8=_0x3a30d8||0x1f4;return function(_0x17f927){logger[_0xd236('0x24')](_0x17f927[_0xd236('0x25')]);if(_0x17f927[_0xd236('0x26')]){delete _0x17f927[_0xd236('0x26')];}_0x13ba7a[_0xd236('0x18')](_0x3a30d8)[_0xd236('0x27')](_0x17f927);};}exports[_0xd236('0x28')]=function(_0x23714d,_0x3108f4){var _0x28175d={},_0x436a19={},_0x471ed6={'count':0x0,'rows':[]};var _0x463fc8=_[_0xd236('0x29')](db[_0xd236('0x2a')][_0xd236('0x2b')],function(_0x3c1617){return{'name':_0x3c1617[_0xd236('0x2c')],'type':_0x3c1617[_0xd236('0x2d')][_0xd236('0x2e')]};});_0x436a19[_0xd236('0x2f')]=_[_0xd236('0x29')](_0x463fc8,_0xd236('0x26'));_0x436a19['query']=_[_0xd236('0x30')](_0x23714d['query']);_0x436a19[_0xd236('0x31')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],_0x436a19['query']);_0x28175d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x23714d[_0xd236('0x35')][_0xd236('0x34')]));_0x28175d[_0xd236('0x33')]=_0x28175d['attributes'][_0xd236('0x36')]?_0x28175d['attributes']:_0x436a19[_0xd236('0x2f')];if(!_0x23714d['query'][_0xd236('0x37')](_0xd236('0x38'))){_0x28175d[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x23714d[_0xd236('0x35')][_0xd236('0x1d')]);_0x28175d[_0xd236('0x1b')]=qs[_0xd236('0x1b')](_0x23714d[_0xd236('0x35')][_0xd236('0x1b')]);}_0x28175d[_0xd236('0x39')]=qs[_0xd236('0x3a')](_0x23714d[_0xd236('0x35')]['sort']);_0x28175d[_0xd236('0x3b')]=qs[_0xd236('0x31')](_[_0xd236('0x3c')](_0x23714d['query'],_0x436a19[_0xd236('0x31')]),_0x463fc8);if(_0x23714d[_0xd236('0x35')][_0xd236('0x3d')]){_0x28175d[_0xd236('0x3b')]=_[_0xd236('0x3e')](_0x28175d[_0xd236('0x3b')],{'$or':_['map'](_0x463fc8,function(_0x696bed){if(_0x696bed[_0xd236('0x2d')]!==_0xd236('0x3f')){var _0x3c798f={};_0x3c798f[_0x696bed[_0xd236('0x26')]]={'$like':'%'+_0x23714d[_0xd236('0x35')]['filter']+'%'};return _0x3c798f;}})});}_0x28175d=_[_0xd236('0x3e')]({},_0x28175d,_0x23714d[_0xd236('0x40')]);var _0x2ba3ae={'where':_0x28175d['where']};return db[_0xd236('0x2a')]['count'](_0x2ba3ae)[_0xd236('0x23')](function(_0x5793bf){_0x471ed6['count']=_0x5793bf;if(_0x23714d[_0xd236('0x35')][_0xd236('0x41')]){_0x28175d[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2a')][_0xd236('0x43')](_0x28175d);})['then'](function(_0x4d0d65){_0x471ed6[_0xd236('0x44')]=_0x4d0d65;return _0x471ed6;})[_0xd236('0x23')](respondWithFilteredResult(_0x3108f4,_0x28175d))['catch'](handleError(_0x3108f4,null));};exports[_0xd236('0x45')]=function(_0x342fd5,_0x2d815b){var _0x55007d={'raw':!![],'where':{'id':_0x342fd5['params']['id']}},_0x58a93a={};_0x58a93a[_0xd236('0x2f')]=_['keys'](db['Cdr'][_0xd236('0x2b')]);_0x58a93a[_0xd236('0x35')]=_[_0xd236('0x30')](_0x342fd5[_0xd236('0x35')]);_0x58a93a[_0xd236('0x31')]=_['intersection'](_0x58a93a['model'],_0x58a93a[_0xd236('0x35')]);_0x55007d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x58a93a[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x342fd5[_0xd236('0x35')]['fields']));_0x55007d[_0xd236('0x33')]=_0x55007d['attributes'][_0xd236('0x36')]?_0x55007d[_0xd236('0x33')]:_0x58a93a['model'];if(_0x342fd5['query']['includeAll']){_0x55007d['include']=[{'all':!![]}];}_0x55007d=_[_0xd236('0x3e')]({},_0x55007d,_0x342fd5[_0xd236('0x40')]);return db[_0xd236('0x2a')][_0xd236('0x46')](_0x55007d)[_0xd236('0x23')](handleEntityNotFound(_0x2d815b,null))['then'](respondWithResult(_0x2d815b,null))['catch'](handleError(_0x2d815b,null));};exports[_0xd236('0x47')]=function(_0x7c0650,_0xbf4ba9){return db[_0xd236('0x2a')][_0xd236('0x47')](_0x7c0650[_0xd236('0x48')],{})['then'](respondWithResult(_0xbf4ba9,0xc9))[_0xd236('0x49')](handleError(_0xbf4ba9,null));};exports['update']=function(_0x223a14,_0x2c8861){if(_0x223a14['body']['id']){delete _0x223a14[_0xd236('0x48')]['id'];}return db[_0xd236('0x2a')]['find']({'where':{'id':_0x223a14['params']['id']}})[_0xd236('0x23')](handleEntityNotFound(_0x2c8861,null))[_0xd236('0x23')](saveUpdates(_0x223a14[_0xd236('0x48')],null))[_0xd236('0x23')](respondWithResult(_0x2c8861,null))['catch'](handleError(_0x2c8861,null));};exports[_0xd236('0x4a')]=function(_0x43c12b,_0x3d8ca6){return db[_0xd236('0x2a')][_0xd236('0x46')]({'where':{'id':_0x43c12b[_0xd236('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d8ca6,null))['then'](removeEntity(_0x3d8ca6,null))[_0xd236('0x49')](handleError(_0x3d8ca6,null));};exports['describe']=function(_0xa39da6,_0x30c336){return db['Cdr'][_0xd236('0x4c')]()[_0xd236('0x23')](respondWithResult(_0x30c336,null))['catch'](handleError(_0x30c336,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 556e3be..2b0c0d3 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5735d0,_0x423963){var _0x5e1c52=function(_0x55d80a){while(--_0x55d80a){_0x5735d0['push'](_0x5735d0['shift']());}};_0x5e1c52(++_0x423963);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x25e625,_0x2a97e2){var _0x3312cb=function(_0x3294e8){while(--_0x3294e8){_0x25e625['push'](_0x25e625['shift']());}};_0x3312cb(++_0x2a97e2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5fdde5a..4e081dc 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd320=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x551b1c,_0x3584f9){var _0x131273=function(_0x553185){while(--_0x553185){_0x551b1c['push'](_0x551b1c['shift']());}};_0x131273(++_0x3584f9);}(_0xd320,0x172));var _0x0d32=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xd320[_0x146a97];return _0x259d5c;};'use strict';var _=require(_0x0d32('0x0'));var util=require(_0x0d32('0x1'));var moment=require(_0x0d32('0x2'));var BPromise=require(_0x0d32('0x3'));var rs=require(_0x0d32('0x4'));var fs=require('fs');var Redis=require(_0x0d32('0x5'));var db=require(_0x0d32('0x6'))['db'];var utils=require(_0x0d32('0x7'));var logger=require(_0x0d32('0x8'))(_0x0d32('0x9'));var config=require(_0x0d32('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0d32('0xb')][_0x0d32('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46d1b9,_0xe62416,_0x354311){return new BPromise(function(_0x11cc33,_0x532215){return client[_0x0d32('0xd')](_0x46d1b9,_0x354311)[_0x0d32('0xe')](function(_0x213c6b){logger[_0x0d32('0xf')](_0x0d32('0x10'),_0xe62416,_0x0d32('0x11'));logger[_0x0d32('0x12')]('Cdr,\x20%s,\x20%s,\x20%s',_0xe62416,_0x0d32('0x11'),JSON[_0x0d32('0x13')](_0x213c6b));if(_0x213c6b[_0x0d32('0x14')]){if(_0x213c6b[_0x0d32('0x14')][_0x0d32('0x15')]===0x1f4){logger['error'](_0x0d32('0x10'),_0xe62416,_0x213c6b[_0x0d32('0x14')]['message']);return _0x532215(_0x213c6b[_0x0d32('0x14')][_0x0d32('0x16')]);}logger[_0x0d32('0x14')]('Cdr,\x20%s,\x20%s',_0xe62416,_0x213c6b[_0x0d32('0x14')][_0x0d32('0x16')]);return _0x11cc33(_0x213c6b[_0x0d32('0x14')]['message']);}else{logger[_0x0d32('0xf')](_0x0d32('0x10'),_0xe62416,'request\x20sent');_0x11cc33(_0x213c6b[_0x0d32('0x17')][_0x0d32('0x16')]);}})[_0x0d32('0x18')](function(_0x2b11ea){logger[_0x0d32('0x14')]('Cdr,\x20%s,\x20%s',_0xe62416,_0x2b11ea);_0x532215(_0x2b11ea);});});} \ No newline at end of file +var _0x28cb=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x28cb,0x19c));var _0xb28c=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x28cb[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xb28c('0x0'));var util=require(_0xb28c('0x1'));var moment=require('moment');var BPromise=require(_0xb28c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb28c('0x3'));var db=require(_0xb28c('0x4'))['db'];var utils=require(_0xb28c('0x5'));var logger=require(_0xb28c('0x6'))(_0xb28c('0x7'));var config=require(_0xb28c('0x8'));var jayson=require(_0xb28c('0x9'));var client=jayson[_0xb28c('0xa')][_0xb28c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fb836,_0x306c3f,_0x583878){return new BPromise(function(_0x31fc92,_0x2af86c){return client['request'](_0x1fb836,_0x583878)[_0xb28c('0xc')](function(_0x7de905){logger[_0xb28c('0xd')](_0xb28c('0xe'),_0x306c3f,_0xb28c('0xf'));logger[_0xb28c('0x10')](_0xb28c('0x11'),_0x306c3f,'request\x20sent',JSON[_0xb28c('0x12')](_0x7de905));if(_0x7de905[_0xb28c('0x13')]){if(_0x7de905[_0xb28c('0x13')][_0xb28c('0x14')]===0x1f4){logger[_0xb28c('0x13')]('Cdr,\x20%s,\x20%s',_0x306c3f,_0x7de905['error'][_0xb28c('0x15')]);return _0x2af86c(_0x7de905[_0xb28c('0x13')]['message']);}logger[_0xb28c('0x13')](_0xb28c('0xe'),_0x306c3f,_0x7de905[_0xb28c('0x13')][_0xb28c('0x15')]);return _0x31fc92(_0x7de905['error'][_0xb28c('0x15')]);}else{logger[_0xb28c('0xd')](_0xb28c('0xe'),_0x306c3f,'request\x20sent');_0x31fc92(_0x7de905[_0xb28c('0x16')]['message']);}})[_0xb28c('0x17')](function(_0x456717){logger['error'](_0xb28c('0xe'),_0x306c3f,_0x456717);_0x2af86c(_0x456717);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a290e55..0245bb8 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x44365d,_0x44e0cb){var _0x1a4a9e=function(_0x198df9){while(--_0x198df9){_0x44365d['push'](_0x44365d['shift']());}};_0x1a4a9e(++_0x44e0cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 89bc788..0e685ce 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e27=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x136dac,_0x5bab21){var _0x2cd80e=function(_0x29ffd){while(--_0x29ffd){_0x136dac['push'](_0x136dac['shift']());}};_0x2cd80e(++_0x5bab21);}(_0x6e27,0x14d));var _0x76e2=function(_0x495ee7,_0x1f8218){_0x495ee7=_0x495ee7-0x0;var _0x27e06d=_0x6e27[_0x495ee7];return _0x27e06d;};'use strict';var Sequelize=require(_0x76e2('0x0'));module[_0x76e2('0x1')]={'priority':{'type':Sequelize[_0x76e2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x76e2('0x3')],'allowNull':![],'defaultValue':_0x76e2('0x4')},'appdata':{'type':Sequelize[_0x76e2('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x76e2('0x3')],'defaultValue':_0x76e2('0x6')}}; \ No newline at end of file +var _0x5ccb=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3fa5bc,_0x57d31a){var _0x4fb864=function(_0x37d810){while(--_0x37d810){_0x3fa5bc['push'](_0x3fa5bc['shift']());}};_0x4fb864(++_0x57d31a);}(_0x5ccb,0xb6));var _0xb5cc=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0x5ccb[_0x11309c];return _0x3fea9c;};'use strict';var Sequelize=require(_0xb5cc('0x0'));module[_0xb5cc('0x1')]={'priority':{'type':Sequelize[_0xb5cc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb5cc('0x3')],'allowNull':![],'defaultValue':_0xb5cc('0x4')},'appdata':{'type':Sequelize[_0xb5cc('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb5cc('0x3')],'defaultValue':_0xb5cc('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 042a6f0..c342346 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f3a=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','name','show','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','length','include','find','catch','params','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3db6b0,_0x1160bf){var _0x31d940=function(_0xb16cfd){while(--_0xb16cfd){_0x3db6b0['push'](_0x3db6b0['shift']());}};_0x31d940(++_0x1160bf);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x56047d,_0x11fb7c){_0x56047d=_0x56047d-0x0;var _0x4987=_0x2f3a[_0x56047d];return _0x4987;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x2e6332,_0x1be0c1){return function(_0x5347de){if(!_0x5347de){_0x2e6332['sendStatus'](0x194);}return _0x5347de;};}function handleError(_0x2f4248,_0x4319f3){_0x4319f3=_0x4319f3||0x1f4;return function(_0x1dd4ec){logger[_0xa2f3('0x25')](_0x1dd4ec['stack']);if(_0x1dd4ec[_0xa2f3('0x26')]){delete _0x1dd4ec[_0xa2f3('0x26')];}_0x2f4248[_0xa2f3('0x19')](_0x4319f3)['send'](_0x1dd4ec);};}exports[_0xa2f3('0x27')]=function(_0x4ec4ab,_0x1ceea4){var _0x5b868c={'raw':!![],'where':{'id':_0x4ec4ab['params']['id']}},_0x452142={};_0x452142[_0xa2f3('0x28')]=_['keys'](db[_0xa2f3('0x29')][_0xa2f3('0x2a')]);_0x452142[_0xa2f3('0x2b')]=_[_0xa2f3('0x2c')](_0x4ec4ab[_0xa2f3('0x2b')]);_0x452142['filters']=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],_0x452142[_0xa2f3('0x2b')]);_0x5b868c[_0xa2f3('0x2e')]=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],qs[_0xa2f3('0x2f')](_0x4ec4ab[_0xa2f3('0x2b')][_0xa2f3('0x2f')]));_0x5b868c['attributes']=_0x5b868c[_0xa2f3('0x2e')][_0xa2f3('0x30')]?_0x5b868c[_0xa2f3('0x2e')]:_0x452142[_0xa2f3('0x28')];if(_0x4ec4ab[_0xa2f3('0x2b')]['includeAll']){_0x5b868c[_0xa2f3('0x31')]=[{'all':!![]}];}_0x5b868c=_['merge']({},_0x5b868c,_0x4ec4ab['options']);return db[_0xa2f3('0x29')][_0xa2f3('0x32')](_0x5b868c)['then'](handleEntityNotFound(_0x1ceea4,null))[_0xa2f3('0x23')](respondWithResult(_0x1ceea4,null))[_0xa2f3('0x33')](handleError(_0x1ceea4,null));};exports['update']=function(_0x386f66,_0x3cb618){if(_0x386f66['body']['id']){delete _0x386f66['body']['id'];}return db[_0xa2f3('0x29')][_0xa2f3('0x32')]({'where':{'id':_0x386f66[_0xa2f3('0x34')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x3cb618,null))['then'](saveUpdates(_0x386f66[_0xa2f3('0x35')],null))['then'](respondWithResult(_0x3cb618,null))[_0xa2f3('0x33')](handleError(_0x3cb618,null));};exports['destroy']=function(_0x5ac995,_0x37cd82){return db[_0xa2f3('0x29')]['find']({'where':{'id':_0x5ac995[_0xa2f3('0x34')]['id']}})['then'](handleEntityNotFound(_0x37cd82,null))[_0xa2f3('0x23')](removeEntity(_0x37cd82,null))[_0xa2f3('0x33')](handleError(_0x37cd82,null));}; \ No newline at end of file +var _0x9000=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','ChatApplication','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x10628b,_0xcc6030){var _0xd18e2d=function(_0x402976){while(--_0x402976){_0x10628b['push'](_0x10628b['shift']());}};_0xd18e2d(++_0xcc6030);}(_0x9000,0x19e));var _0x0900=function(_0xec1b03,_0x1ed76f){_0xec1b03=_0xec1b03-0x0;var _0x140c51=_0x9000[_0xec1b03];return _0x140c51;};'use strict';var emlformat=require(_0x0900('0x0'));var rimraf=require(_0x0900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0900('0x2'));var rp=require(_0x0900('0x3'));var moment=require(_0x0900('0x4'));var BPromise=require(_0x0900('0x5'));var Mustache=require(_0x0900('0x6'));var util=require(_0x0900('0x7'));var path=require(_0x0900('0x8'));var sox=require(_0x0900('0x9'));var csv=require(_0x0900('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0900('0xb'));var _=require('lodash');var squel=require(_0x0900('0xc'));var crypto=require(_0x0900('0xd'));var jsforce=require(_0x0900('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0900('0xf'));var Papa=require(_0x0900('0x10'));var Redis=require(_0x0900('0x11'));var authService=require(_0x0900('0x12'));var qs=require(_0x0900('0x13'));var as=require(_0x0900('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0900('0x15'))(_0x0900('0x16'));var utils=require(_0x0900('0x17'));var config=require(_0x0900('0x18'));var licenseUtil=require(_0x0900('0x19'));var db=require(_0x0900('0x1a'))['db'];function respondWithStatusCode(_0xe8ae24,_0x11d1b6){_0x11d1b6=_0x11d1b6||0xcc;return function(_0x3a235b){if(_0x3a235b){return _0xe8ae24[_0x0900('0x1b')](_0x11d1b6);}return _0xe8ae24['status'](_0x11d1b6)[_0x0900('0x1c')]();};}function respondWithResult(_0x183ca6,_0x4ea071){_0x4ea071=_0x4ea071||0xc8;return function(_0x52bb65){if(_0x52bb65){return _0x183ca6[_0x0900('0x1d')](_0x4ea071)['json'](_0x52bb65);}};}function respondWithFilteredResult(_0x3d58eb,_0x4f5eee){return function(_0x35dbd6){if(_0x35dbd6){var _0xb184b6=typeof _0x4f5eee[_0x0900('0x1e')]===_0x0900('0x1f')&&typeof _0x4f5eee['limit']==='undefined';var _0x2a6b91=_0x35dbd6[_0x0900('0x20')];var _0x3f09ee=_0xb184b6?0x0:_0x4f5eee[_0x0900('0x1e')];var _0x5bc7ec=_0xb184b6?_0x35dbd6[_0x0900('0x20')]:_0x4f5eee[_0x0900('0x1e')]+_0x4f5eee[_0x0900('0x21')];var _0x34968a;if(_0x5bc7ec>=_0x2a6b91){_0x5bc7ec=_0x2a6b91;_0x34968a=0xc8;}else{_0x34968a=0xce;}_0x3d58eb[_0x0900('0x1d')](_0x34968a);return _0x3d58eb[_0x0900('0x22')](_0x0900('0x23'),_0x3f09ee+'-'+_0x5bc7ec+'/'+_0x2a6b91)[_0x0900('0x24')](_0x35dbd6);}return null;};}function patchUpdates(_0x4de1d3){return function(_0x5ed4e8){try{jsonpatch[_0x0900('0x25')](_0x5ed4e8,_0x4de1d3,!![]);}catch(_0x5c54a9){return BPromise[_0x0900('0x26')](_0x5c54a9);}return _0x5ed4e8['save']();};}function saveUpdates(_0x41b74a,_0x1f3738){return function(_0x3dc6bc){if(_0x3dc6bc){return _0x3dc6bc['update'](_0x41b74a)[_0x0900('0x27')](function(_0x492a51){return _0x492a51;});}return null;};}function removeEntity(_0x2fd307,_0x369f5a){return function(_0xce8f6e){if(_0xce8f6e){return _0xce8f6e[_0x0900('0x28')]()[_0x0900('0x27')](function(){_0x2fd307[_0x0900('0x1d')](0xcc)[_0x0900('0x1c')]();});}};}function handleEntityNotFound(_0x51fe9f,_0x7b6765){return function(_0x34d63f){if(!_0x34d63f){_0x51fe9f[_0x0900('0x1b')](0x194);}return _0x34d63f;};}function handleError(_0x569856,_0x574307){_0x574307=_0x574307||0x1f4;return function(_0x51ee3a){logger['error'](_0x51ee3a[_0x0900('0x29')]);if(_0x51ee3a[_0x0900('0x2a')]){delete _0x51ee3a['name'];}_0x569856[_0x0900('0x1d')](_0x574307)['send'](_0x51ee3a);};}exports[_0x0900('0x2b')]=function(_0x13fa35,_0x2a8a71){var _0x257914={'raw':!![],'where':{'id':_0x13fa35[_0x0900('0x2c')]['id']}},_0x3fbd95={};_0x3fbd95['model']=_[_0x0900('0x2d')](db['ChatApplication'][_0x0900('0x2e')]);_0x3fbd95[_0x0900('0x2f')]=_[_0x0900('0x2d')](_0x13fa35['query']);_0x3fbd95[_0x0900('0x30')]=_[_0x0900('0x31')](_0x3fbd95[_0x0900('0x32')],_0x3fbd95[_0x0900('0x2f')]);_0x257914['attributes']=_[_0x0900('0x31')](_0x3fbd95['model'],qs[_0x0900('0x33')](_0x13fa35[_0x0900('0x2f')][_0x0900('0x33')]));_0x257914[_0x0900('0x34')]=_0x257914[_0x0900('0x34')][_0x0900('0x35')]?_0x257914['attributes']:_0x3fbd95[_0x0900('0x32')];if(_0x13fa35[_0x0900('0x2f')][_0x0900('0x36')]){_0x257914['include']=[{'all':!![]}];}_0x257914=_[_0x0900('0x37')]({},_0x257914,_0x13fa35[_0x0900('0x38')]);return db[_0x0900('0x39')][_0x0900('0x3a')](_0x257914)[_0x0900('0x27')](handleEntityNotFound(_0x2a8a71,null))[_0x0900('0x27')](respondWithResult(_0x2a8a71,null))[_0x0900('0x3b')](handleError(_0x2a8a71,null));};exports[_0x0900('0x3c')]=function(_0x4b06e2,_0x4d67ad){if(_0x4b06e2['body']['id']){delete _0x4b06e2[_0x0900('0x3d')]['id'];}return db[_0x0900('0x39')][_0x0900('0x3a')]({'where':{'id':_0x4b06e2['params']['id']}})['then'](handleEntityNotFound(_0x4d67ad,null))[_0x0900('0x27')](saveUpdates(_0x4b06e2[_0x0900('0x3d')],null))[_0x0900('0x27')](respondWithResult(_0x4d67ad,null))['catch'](handleError(_0x4d67ad,null));};exports[_0x0900('0x28')]=function(_0x2622d1,_0x108d1a){return db[_0x0900('0x39')][_0x0900('0x3a')]({'where':{'id':_0x2622d1[_0x0900('0x2c')]['id']}})[_0x0900('0x27')](handleEntityNotFound(_0x108d1a,null))[_0x0900('0x27')](removeEntity(_0x108d1a,null))[_0x0900('0x3b')](handleError(_0x108d1a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index de7ea2a..edff7ca 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1061=['./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x1061,0x1b5));var _0x1106=function(_0x3c0976,_0x3a6f0b){_0x3c0976=_0x3c0976-0x0;var _0x54b6e0=_0x1061[_0x3c0976];return _0x54b6e0;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var fs=require('fs');var path=require(_0x1106('0x4'));var rimraf=require(_0x1106('0x5'));var config=require(_0x1106('0x6'));var attributes=require(_0x1106('0x7'));module[_0x1106('0x8')]=function(_0x5120c6,_0x1f098a){return _0x5120c6[_0x1106('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1106('0xa'),'collate':_0x1106('0xb')});}; \ No newline at end of file +var _0x1f71=['path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','api','bluebird'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x1f71,0xfa));var _0x11f7=function(_0x371902,_0x1296e1){_0x371902=_0x371902-0x0;var _0xb57653=_0x1f71[_0x371902];return _0xb57653;};'use strict';var _=require(_0x11f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x11f7('0x1'));var moment=require('moment');var BPromise=require(_0x11f7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11f7('0x3'));var rimraf=require(_0x11f7('0x4'));var config=require('../../config/environment');var attributes=require(_0x11f7('0x5'));module[_0x11f7('0x6')]=function(_0x2d0ec5,_0x4b5821){return _0x2d0ec5[_0x11f7('0x7')](_0x11f7('0x8'),attributes,{'tableName':_0x11f7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x11f7('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b3c29fd..2f38d51 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95cd=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x95cd,0xbb));var _0xd95c=function(_0x2686f3,_0x3ee836){_0x2686f3=_0x2686f3-0x0;var _0x3f08f=_0x95cd[_0x2686f3];return _0x3f08f;};'use strict';var _=require('lodash');var util=require(_0xd95c('0x0'));var moment=require(_0xd95c('0x1'));var BPromise=require(_0xd95c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd95c('0x3'));var db=require(_0xd95c('0x4'))['db'];var utils=require(_0xd95c('0x5'));var logger=require(_0xd95c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd95c('0x7'));var client=jayson['client'][_0xd95c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9d807b,_0x366083,_0x56ede8){return new BPromise(function(_0x17f34d,_0x2f2092){return client['request'](_0x9d807b,_0x56ede8)[_0xd95c('0x9')](function(_0x29ab56){logger[_0xd95c('0xa')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0xd95c('0xb'));logger[_0xd95c('0xc')](_0xd95c('0xd'),_0x366083,_0xd95c('0xb'),JSON[_0xd95c('0xe')](_0x29ab56));if(_0x29ab56[_0xd95c('0xf')]){if(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x10')]===0x1f4){logger[_0xd95c('0xf')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0x29ab56['error'][_0xd95c('0x11')]);return _0x2f2092(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x11')]);}logger['error'](_0xd95c('0x12'),_0x366083,_0x29ab56['error'][_0xd95c('0x11')]);return _0x17f34d(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x11')]);}else{logger[_0xd95c('0xa')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0xd95c('0xb'));_0x17f34d(_0x29ab56['result'][_0xd95c('0x11')]);}})[_0xd95c('0x13')](function(_0x4d8d40){logger[_0xd95c('0xf')](_0xd95c('0x12'),_0x366083,_0x4d8d40);_0x2f2092(_0x4d8d40);});});} \ No newline at end of file +var _0xee06=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2eb4ce,_0x245271){var _0x2cb386=function(_0x20bf4d){while(--_0x20bf4d){_0x2eb4ce['push'](_0x2eb4ce['shift']());}};_0x2cb386(++_0x245271);}(_0xee06,0x16b));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ee0('0x0'));var util=require(_0x6ee0('0x1'));var moment=require(_0x6ee0('0x2'));var BPromise=require(_0x6ee0('0x3'));var rs=require(_0x6ee0('0x4'));var fs=require('fs');var Redis=require(_0x6ee0('0x5'));var db=require(_0x6ee0('0x6'))['db'];var utils=require(_0x6ee0('0x7'));var logger=require(_0x6ee0('0x8'))(_0x6ee0('0x9'));var config=require(_0x6ee0('0xa'));var jayson=require(_0x6ee0('0xb'));var client=jayson[_0x6ee0('0xc')][_0x6ee0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28bea2,_0x4201c4,_0x3f1c51){return new BPromise(function(_0x4a307c,_0x2b0823){return client[_0x6ee0('0xe')](_0x28bea2,_0x3f1c51)[_0x6ee0('0xf')](function(_0x38806f){logger[_0x6ee0('0x10')](_0x6ee0('0x11'),_0x4201c4,_0x6ee0('0x12'));logger['debug'](_0x6ee0('0x13'),_0x4201c4,_0x6ee0('0x12'),JSON['stringify'](_0x38806f));if(_0x38806f[_0x6ee0('0x14')]){if(_0x38806f[_0x6ee0('0x14')][_0x6ee0('0x15')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4201c4,_0x38806f[_0x6ee0('0x14')]['message']);return _0x2b0823(_0x38806f[_0x6ee0('0x14')][_0x6ee0('0x16')]);}logger['error'](_0x6ee0('0x11'),_0x4201c4,_0x38806f[_0x6ee0('0x14')]['message']);return _0x4a307c(_0x38806f[_0x6ee0('0x14')]['message']);}else{logger[_0x6ee0('0x10')](_0x6ee0('0x11'),_0x4201c4,_0x6ee0('0x12'));_0x4a307c(_0x38806f[_0x6ee0('0x17')][_0x6ee0('0x16')]);}})[_0x6ee0('0x18')](function(_0x5ed815){logger['error'](_0x6ee0('0x11'),_0x4201c4,_0x5ed815);_0x2b0823(_0x5ed815);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index ba40703..60c2f31 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65fe=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x5d92f1,_0x30e8a2){var _0x3d1ead=function(_0x164a74){while(--_0x164a74){_0x5d92f1['push'](_0x5d92f1['shift']());}};_0x3d1ead(++_0x30e8a2);}(_0x65fe,0x17a));var _0xe65f=function(_0x208980,_0x2ed68d){_0x208980=_0x208980-0x0;var _0x4b03a6=_0x65fe[_0x208980];return _0x4b03a6;};'use strict';var multer=require('multer');var util=require(_0xe65f('0x0'));var path=require(_0xe65f('0x1'));var timeout=require(_0xe65f('0x2'));var express=require(_0xe65f('0x3'));var router=express[_0xe65f('0x4')]();var fs_extra=require(_0xe65f('0x5'));var auth=require(_0xe65f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe65f('0x7'));var controller=require(_0xe65f('0x8'));router[_0xe65f('0x9')](_0xe65f('0xa'),auth[_0xe65f('0xb')](),controller[_0xe65f('0xc')]);router['put'](_0xe65f('0xa'),auth['isAuthenticated'](),controller[_0xe65f('0xd')]);router[_0xe65f('0xe')](_0xe65f('0xa'),auth['isAuthenticated'](),controller[_0xe65f('0xf')]);module[_0xe65f('0x10')]=router; \ No newline at end of file +var _0x2d7e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','path'];(function(_0x4442bc,_0x1dd441){var _0x1b87f8=function(_0x3b191c){while(--_0x3b191c){_0x4442bc['push'](_0x4442bc['shift']());}};_0x1b87f8(++_0x1dd441);}(_0x2d7e,0x7c));var _0xe2d7=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2d7e[_0x4b2863];return _0x567d67;};'use strict';var multer=require(_0xe2d7('0x0'));var util=require('util');var path=require(_0xe2d7('0x1'));var timeout=require(_0xe2d7('0x2'));var express=require(_0xe2d7('0x3'));var router=express['Router']();var fs_extra=require(_0xe2d7('0x4'));var auth=require(_0xe2d7('0x5'));var interaction=require(_0xe2d7('0x6'));var config=require(_0xe2d7('0x7'));var controller=require(_0xe2d7('0x8'));router[_0xe2d7('0x9')](_0xe2d7('0xa'),auth['isAuthenticated'](),controller[_0xe2d7('0xb')]);router[_0xe2d7('0xc')]('/:id',auth[_0xe2d7('0xd')](),controller[_0xe2d7('0xe')]);router[_0xe2d7('0xf')](_0xe2d7('0xa'),auth[_0xe2d7('0xd')](),controller[_0xe2d7('0x10')]);module[_0xe2d7('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4e86f63..d0f454b 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59cd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3cc1ce,_0x45d6ef){var _0x166858=function(_0x137f85){while(--_0x137f85){_0x3cc1ce['push'](_0x3cc1ce['shift']());}};_0x166858(++_0x45d6ef);}(_0x59cd,0x108));var _0xd59c=function(_0x480f4a,_0x2ea3f8){_0x480f4a=_0x480f4a-0x0;var _0xdccb7d=_0x59cd[_0x480f4a];return _0xdccb7d;};'use strict';var Sequelize=require(_0xd59c('0x0'));module[_0xd59c('0x1')]={'name':{'type':Sequelize[_0xd59c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd59c('0x2')]},'write':{'type':Sequelize[_0xd59c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6e2e=['BOOLEAN','sequelize','STRING'];(function(_0x555317,_0x12c7ce){var _0x1773ce=function(_0x5a889b){while(--_0x5a889b){_0x555317['push'](_0x555317['shift']());}};_0x1773ce(++_0x12c7ce);}(_0x6e2e,0xd9));var _0xe6e2=function(_0x1c86cf,_0xd758df){_0x1c86cf=_0x1c86cf-0x0;var _0x22c104=_0x6e2e[_0x1c86cf];return _0x22c104;};'use strict';var Sequelize=require(_0xe6e2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6e2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe6e2('0x1')]},'write':{'type':Sequelize[_0xe6e2('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index fbc89af..f00e351 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x424b=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5d2cb7,_0x4519f6){var _0x4828f6=function(_0x1f9a53){while(--_0x1f9a53){_0x5d2cb7['push'](_0x5d2cb7['shift']());}};_0x4828f6(++_0x4519f6);}(_0x424b,0x1f2));var _0xb424=function(_0xc5d10e,_0x2d0e97){_0xc5d10e=_0xc5d10e-0x0;var _0x56b61d=_0x424b[_0xc5d10e];return _0x56b61d;};'use strict';var emlformat=require(_0xb424('0x0'));var rimraf=require(_0xb424('0x1'));var zipdir=require(_0xb424('0x2'));var jsonpatch=require(_0xb424('0x3'));var rp=require(_0xb424('0x4'));var moment=require(_0xb424('0x5'));var BPromise=require(_0xb424('0x6'));var Mustache=require(_0xb424('0x7'));var util=require(_0xb424('0x8'));var path=require(_0xb424('0x9'));var sox=require(_0xb424('0xa'));var csv=require(_0xb424('0xb'));var ejs=require(_0xb424('0xc'));var fs=require('fs');var fs_extra=require(_0xb424('0xd'));var _=require(_0xb424('0xe'));var squel=require(_0xb424('0xf'));var crypto=require(_0xb424('0x10'));var jsforce=require(_0xb424('0x11'));var deskjs=require(_0xb424('0x12'));var toCsv=require(_0xb424('0xb'));var querystring=require(_0xb424('0x13'));var Papa=require('papaparse');var Redis=require(_0xb424('0x14'));var authService=require(_0xb424('0x15'));var qs=require(_0xb424('0x16'));var as=require(_0xb424('0x17'));var hardwareService=require(_0xb424('0x18'));var logger=require(_0xb424('0x19'))(_0xb424('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb424('0x1b'));var db=require(_0xb424('0x1c'))['db'];config['redis']=_[_0xb424('0x1d')](config[_0xb424('0x1e')],{'host':_0xb424('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb424('0x1e')]));require('./chatGroup.socket')[_0xb424('0x20')](socket);function respondWithStatusCode(_0x157932,_0x12d767){_0x12d767=_0x12d767||0xcc;return function(_0x13b22b){if(_0x13b22b){return _0x157932['sendStatus'](_0x12d767);}return _0x157932[_0xb424('0x21')](_0x12d767)[_0xb424('0x22')]();};}function respondWithResult(_0xf53a0f,_0x723832){_0x723832=_0x723832||0xc8;return function(_0x4abeb7){if(_0x4abeb7){return _0xf53a0f[_0xb424('0x21')](_0x723832)[_0xb424('0x23')](_0x4abeb7);}};}function respondWithFilteredResult(_0x4d7212,_0x1e6b9d){return function(_0x306926){if(_0x306926){var _0x59af49=typeof _0x1e6b9d[_0xb424('0x24')]===_0xb424('0x25')&&typeof _0x1e6b9d[_0xb424('0x26')]==='undefined';var _0x38ea5d=_0x306926[_0xb424('0x27')];var _0x946359=_0x59af49?0x0:_0x1e6b9d[_0xb424('0x24')];var _0x5c8e06=_0x59af49?_0x306926[_0xb424('0x27')]:_0x1e6b9d['offset']+_0x1e6b9d['limit'];var _0x390c6f;if(_0x5c8e06>=_0x38ea5d){_0x5c8e06=_0x38ea5d;_0x390c6f=0xc8;}else{_0x390c6f=0xce;}_0x4d7212['status'](_0x390c6f);return _0x4d7212[_0xb424('0x28')](_0xb424('0x29'),_0x946359+'-'+_0x5c8e06+'/'+_0x38ea5d)['json'](_0x306926);}return null;};}function patchUpdates(_0x5160bc){return function(_0x16fb61){try{jsonpatch[_0xb424('0x2a')](_0x16fb61,_0x5160bc,!![]);}catch(_0x3e4070){return BPromise[_0xb424('0x2b')](_0x3e4070);}return _0x16fb61[_0xb424('0x2c')]();};}function saveUpdates(_0x941562,_0xbe4264){return function(_0xbbcf86){if(_0xbbcf86){return _0xbbcf86[_0xb424('0x2d')](_0x941562)[_0xb424('0x2e')](function(_0x1eb51e){return _0x1eb51e;});}return null;};}function removeEntity(_0x27e72b,_0x3c2a27){return function(_0x2e1cdc){if(_0x2e1cdc){return _0x2e1cdc[_0xb424('0x2f')]()[_0xb424('0x2e')](function(){_0x27e72b[_0xb424('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392e56,_0x18d2ef){return function(_0x2036ca){if(!_0x2036ca){_0x392e56[_0xb424('0x30')](0x194);}return _0x2036ca;};}function handleError(_0x42ff17,_0x42df08){_0x42df08=_0x42df08||0x1f4;return function(_0x4db91e){logger[_0xb424('0x31')](_0x4db91e['stack']);if(_0x4db91e[_0xb424('0x32')]){delete _0x4db91e[_0xb424('0x32')];}_0x42ff17[_0xb424('0x21')](_0x42df08)[_0xb424('0x33')](_0x4db91e);};}exports[_0xb424('0x34')]=function(_0x25e943,_0x406e0e){var _0x5af26e={},_0x8aa951={},_0x168eff={'count':0x0,'rows':[]};var _0x117596=_[_0xb424('0x35')](db[_0xb424('0x36')][_0xb424('0x37')],function(_0x16abaf){return{'name':_0x16abaf['fieldName'],'type':_0x16abaf[_0xb424('0x38')][_0xb424('0x39')]};});_0x8aa951[_0xb424('0x3a')]=_['map'](_0x117596,_0xb424('0x32'));_0x8aa951['query']=_[_0xb424('0x3b')](_0x25e943['query']);_0x8aa951[_0xb424('0x3c')]=_[_0xb424('0x3d')](_0x8aa951[_0xb424('0x3a')],_0x8aa951[_0xb424('0x3e')]);_0x5af26e[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x8aa951[_0xb424('0x3a')],qs['fields'](_0x25e943[_0xb424('0x3e')][_0xb424('0x40')]));_0x5af26e['attributes']=_0x5af26e[_0xb424('0x3f')][_0xb424('0x41')]?_0x5af26e[_0xb424('0x3f')]:_0x8aa951[_0xb424('0x3a')];if(!_0x25e943[_0xb424('0x3e')]['hasOwnProperty'](_0xb424('0x42'))){_0x5af26e[_0xb424('0x26')]=qs[_0xb424('0x26')](_0x25e943[_0xb424('0x3e')][_0xb424('0x26')]);_0x5af26e['offset']=qs[_0xb424('0x24')](_0x25e943[_0xb424('0x3e')][_0xb424('0x24')]);}_0x5af26e[_0xb424('0x43')]=qs[_0xb424('0x44')](_0x25e943[_0xb424('0x3e')][_0xb424('0x44')]);_0x5af26e['where']=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x25e943['query'],_0x8aa951[_0xb424('0x3c')]),_0x117596);if(_0x25e943[_0xb424('0x3e')][_0xb424('0x46')]){_0x5af26e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x5af26e[_0xb424('0x47')],{'$or':_[_0xb424('0x35')](_0x117596,function(_0x1d9f85){if(_0x1d9f85[_0xb424('0x38')]!=='VIRTUAL'){var _0x393c9f={};_0x393c9f[_0x1d9f85['name']]={'$like':'%'+_0x25e943[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x393c9f;}})});}_0x5af26e=_[_0xb424('0x48')]({},_0x5af26e,_0x25e943[_0xb424('0x49')]);var _0x5d7488={'where':_0x5af26e['where']};return db['ChatGroup'][_0xb424('0x27')](_0x5d7488)[_0xb424('0x2e')](function(_0x38a702){_0x168eff[_0xb424('0x27')]=_0x38a702;if(_0x25e943['query']['includeAll']){_0x5af26e[_0xb424('0x4a')]=[{'all':!![]}];}return db[_0xb424('0x36')][_0xb424('0x4b')](_0x5af26e);})[_0xb424('0x2e')](function(_0x254bff){_0x168eff[_0xb424('0x4c')]=_0x254bff;return _0x168eff;})['then'](respondWithFilteredResult(_0x406e0e,_0x5af26e))[_0xb424('0x4d')](handleError(_0x406e0e,null));};exports[_0xb424('0x4e')]=function(_0x50dbdb,_0x17eb21){var _0x2ab3ef={'raw':!![],'where':{'id':_0x50dbdb['params']['id']}},_0x10ecd1={};_0x10ecd1[_0xb424('0x3a')]=_[_0xb424('0x3b')](db[_0xb424('0x36')][_0xb424('0x37')]);_0x10ecd1[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x50dbdb[_0xb424('0x3e')]);_0x10ecd1[_0xb424('0x3c')]=_['intersection'](_0x10ecd1['model'],_0x10ecd1['query']);_0x2ab3ef[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x10ecd1[_0xb424('0x3a')],qs[_0xb424('0x40')](_0x50dbdb[_0xb424('0x3e')][_0xb424('0x40')]));_0x2ab3ef['attributes']=_0x2ab3ef['attributes'][_0xb424('0x41')]?_0x2ab3ef[_0xb424('0x3f')]:_0x10ecd1[_0xb424('0x3a')];if(_0x50dbdb['query'][_0xb424('0x4f')]){_0x2ab3ef['include']=[{'all':!![]}];}_0x2ab3ef=_['merge']({},_0x2ab3ef,_0x50dbdb['options']);return db[_0xb424('0x36')][_0xb424('0x50')](_0x2ab3ef)[_0xb424('0x2e')](handleEntityNotFound(_0x17eb21,null))['then'](respondWithResult(_0x17eb21,null))[_0xb424('0x4d')](handleError(_0x17eb21,null));};exports[_0xb424('0x51')]=function(_0x3cffb4,_0x4b47aa){return db[_0xb424('0x36')]['create'](_0x3cffb4[_0xb424('0x52')],{})['then'](respondWithResult(_0x4b47aa,0xc9))[_0xb424('0x4d')](handleError(_0x4b47aa,null));};exports[_0xb424('0x2d')]=function(_0x364165,_0x35af17){if(_0x364165['body']['id']){delete _0x364165[_0xb424('0x52')]['id'];}return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x364165[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x35af17,null))[_0xb424('0x2e')](saveUpdates(_0x364165[_0xb424('0x52')],null))[_0xb424('0x2e')](respondWithResult(_0x35af17,null))[_0xb424('0x4d')](handleError(_0x35af17,null));};exports[_0xb424('0x2f')]=function(_0x28312b,_0xd4dfa){return db['ChatGroup']['find']({'where':{'id':_0x28312b[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0xd4dfa,null))[_0xb424('0x2e')](removeEntity(_0xd4dfa,null))[_0xb424('0x4d')](handleError(_0xd4dfa,null));};exports[_0xb424('0x54')]=function(_0x439aaa,_0x14972c){return db[_0xb424('0x36')][_0xb424('0x54')]()[_0xb424('0x2e')](respondWithResult(_0x14972c,null))[_0xb424('0x4d')](handleError(_0x14972c,null));};exports['getUnread']=function(_0xe5e196,_0xc4bde,_0x4965e2){return db['ChatInternalMessage'][_0xb424('0x27')]({'where':{'ChatGroupId':_0xe5e196[_0xb424('0x53')]['id'],'ToId':_0xe5e196[_0xb424('0x55')]['id'],'read':![]}})['then'](function(_0x14593a){return{'id':_[_0xb424('0x56')](_0xe5e196[_0xb424('0x53')]['id']),'count':_0x14593a};})['then'](respondWithResult(_0xc4bde,null))[_0xb424('0x4d')](handleError(_0xc4bde,null));};exports[_0xb424('0x57')]=function(_0x5bf52d,_0x577365,_0x14fbc4){return db['ChatGroup'][_0xb424('0x50')]({'where':{'id':_0x5bf52d['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x577365,null))['then'](function(_0x5296b3){if(_0x5296b3){return _0x5296b3[_0xb424('0x57')](_0x5bf52d[_0xb424('0x52')][_0xb424('0x58')],_[_0xb424('0x59')](_0x5bf52d[_0xb424('0x52')],[_0xb424('0x58'),'id'])||{});}})[_0xb424('0x2e')](respondWithResult(_0x577365,null))[_0xb424('0x4d')](handleError(_0x577365,null));};exports[_0xb424('0x5a')]=function(_0x355289,_0x506019,_0x12c44d){var _0x1b3800={};var _0x4c1882={};var _0x7ca24b;var _0x45c006;return db[_0xb424('0x36')][_0xb424('0x5b')]({'where':{'id':_0x355289['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x506019,null))['then'](function(_0x44cc00){if(_0x44cc00){_0x7ca24b=_0x44cc00;_0x4c1882[_0xb424('0x3a')]=_['keys'](db[_0xb424('0x5c')][_0xb424('0x37')]);_0x4c1882[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x355289[_0xb424('0x3e')]);_0x4c1882[_0xb424('0x3c')]=_['intersection'](_0x4c1882[_0xb424('0x3a')],_0x4c1882[_0xb424('0x3e')]);_0x1b3800[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x4c1882[_0xb424('0x3a')],qs['fields'](_0x355289['query'][_0xb424('0x40')]));_0x1b3800[_0xb424('0x3f')]=_0x1b3800[_0xb424('0x3f')][_0xb424('0x41')]?_0x1b3800['attributes']:_0x4c1882[_0xb424('0x3a')];_0x1b3800[_0xb424('0x43')]=qs['sort'](_0x355289[_0xb424('0x3e')][_0xb424('0x44')]);_0x1b3800[_0xb424('0x47')]=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x355289[_0xb424('0x3e')],_0x4c1882[_0xb424('0x3c')]));if(_0x355289[_0xb424('0x3e')][_0xb424('0x46')]){_0x1b3800[_0xb424('0x47')]=_[_0xb424('0x48')](_0x1b3800[_0xb424('0x47')],{'$or':_['map'](_0x1b3800[_0xb424('0x3f')],function(_0xc8b3b1){var _0x46bd55={};_0x46bd55[_0xc8b3b1]={'$like':'%'+_0x355289[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x46bd55;})});}_0x1b3800=_[_0xb424('0x48')]({},_0x1b3800,_0x355289[_0xb424('0x49')]);return _0x7ca24b[_0xb424('0x5a')](_0x1b3800);}})[_0xb424('0x2e')](function(_0x315661){if(_0x315661){_0x45c006=_0x315661['length'];if(!_0x355289[_0xb424('0x3e')][_0xb424('0x5d')](_0xb424('0x42'))){_0x1b3800[_0xb424('0x26')]=qs['limit'](_0x355289['query']['limit']);_0x1b3800[_0xb424('0x24')]=qs[_0xb424('0x24')](_0x355289[_0xb424('0x3e')][_0xb424('0x24')]);}return _0x7ca24b['getMembers'](_0x1b3800);}})[_0xb424('0x2e')](function(_0x2a44cb){if(_0x2a44cb){return _0x2a44cb?{'count':_0x45c006,'rows':_0x2a44cb}:null;}})[_0xb424('0x2e')](respondWithResult(_0x506019,null))[_0xb424('0x4d')](handleError(_0x506019,null));};exports[_0xb424('0x5e')]=function(_0x46bdf1,_0x5d4e40,_0x44e7b0){return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x46bdf1[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x5d4e40,null))['then'](function(_0x1ac852){if(_0x1ac852){return _0x1ac852[_0xb424('0x5e')](_0x46bdf1['query'][_0xb424('0x58')]);}})[_0xb424('0x2e')](respondWithStatusCode(_0x5d4e40,null))['catch'](handleError(_0x5d4e40,null));};exports['addMessage']=function(_0x5a7755,_0x4740ea,_0x49063e){if(_0x5a7755['body']['id']){delete _0x5a7755[_0xb424('0x52')]['id'];}return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x5a7755['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x4740ea,null))[_0xb424('0x2e')](function(_0x83d32f){if(_0x83d32f){_0x5a7755['body'][_0xb424('0x5f')]=_0x83d32f['id'];return db[_0xb424('0x60')]['create'](_0x5a7755[_0xb424('0x52')]);}})[_0xb424('0x2e')](respondWithResult(_0x4740ea,null))['catch'](handleError(_0x4740ea,null));};exports[_0xb424('0x61')]=function(_0x5b1d26,_0x4ab23a,_0x25bac1){var _0x47b27e={};var _0x5ce242={};var _0x13979f;var _0x18f90e;return db['ChatGroup'][_0xb424('0x5b')]({'where':{'id':_0x5b1d26['params']['id']}})['then'](handleEntityNotFound(_0x4ab23a,null))[_0xb424('0x2e')](function(_0x47626a){if(_0x47626a){_0x13979f=_0x47626a;_0x5ce242[_0xb424('0x3a')]=_['keys'](db['ChatInternalMessage'][_0xb424('0x37')]);_0x5ce242[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x5b1d26[_0xb424('0x3e')]);_0x5ce242[_0xb424('0x3c')]=_[_0xb424('0x3d')](_0x5ce242[_0xb424('0x3a')],_0x5ce242[_0xb424('0x3e')]);_0x47b27e[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x5ce242[_0xb424('0x3a')],qs[_0xb424('0x40')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x40')]));_0x47b27e[_0xb424('0x3f')]=_0x47b27e['attributes']['length']?_0x47b27e[_0xb424('0x3f')]:_0x5ce242[_0xb424('0x3a')];_0x47b27e[_0xb424('0x43')]=qs[_0xb424('0x44')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x44')]);_0x47b27e['where']=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x5b1d26[_0xb424('0x3e')],_0x5ce242[_0xb424('0x3c')]));if(_0x5b1d26[_0xb424('0x3e')][_0xb424('0x46')]){_0x47b27e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x47b27e[_0xb424('0x47')],{'$or':_[_0xb424('0x35')](_0x47b27e[_0xb424('0x3f')],function(_0x2bf732){var _0x44f9a7={};_0x44f9a7[_0x2bf732]={'$like':'%'+_0x5b1d26[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x44f9a7;})});}if(_0x5b1d26[_0xb424('0x3e')][_0xb424('0x62')]){var _0x45be19=_0x5b1d26[_0xb424('0x3e')]['$gte'][_0xb424('0x63')](',');var _0x755b76={};_0x755b76[_0x45be19[0x0]]={'$gte':moment(_0x45be19[0x1])[_0xb424('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};_0x47b27e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x47b27e[_0xb424('0x47')],_0x755b76);}_0x47b27e=_[_0xb424('0x48')]({},_0x47b27e,_0x5b1d26['options']);return _0x13979f[_0xb424('0x61')](_0x47b27e);}})[_0xb424('0x2e')](function(_0x1eb85d){if(_0x1eb85d){_0x18f90e=_0x1eb85d[_0xb424('0x41')];if(!_0x5b1d26[_0xb424('0x3e')][_0xb424('0x5d')]('nolimit')){_0x47b27e[_0xb424('0x26')]=qs[_0xb424('0x26')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x26')]);_0x47b27e['offset']=qs[_0xb424('0x24')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x24')]);}return _0x13979f['getMessages'](_0x47b27e);}})[_0xb424('0x2e')](function(_0x5722dc){if(_0x5722dc){return _0x5722dc?{'count':_0x18f90e,'rows':_0x5722dc}:null;}})['then'](respondWithResult(_0x4ab23a,null))[_0xb424('0x4d')](handleError(_0x4ab23a,null));}; \ No newline at end of file +var _0x9baa=['error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','User','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x2370db,_0x592999){var _0x47585c=function(_0xb6899e){while(--_0xb6899e){_0x2370db['push'](_0x2370db['shift']());}};_0x47585c(++_0x592999);}(_0x9baa,0x95));var _0xa9ba=function(_0x14f8f0,_0x5e2d51){_0x14f8f0=_0x14f8f0-0x0;var _0x5a1286=_0x9baa[_0x14f8f0];return _0x5a1286;};'use strict';var emlformat=require(_0xa9ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9ba('0x1'));var jsonpatch=require(_0xa9ba('0x2'));var rp=require('request-promise');var moment=require(_0xa9ba('0x3'));var BPromise=require(_0xa9ba('0x4'));var Mustache=require(_0xa9ba('0x5'));var util=require('util');var path=require(_0xa9ba('0x6'));var sox=require(_0xa9ba('0x7'));var csv=require(_0xa9ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa9ba('0x9'));var squel=require('squel');var crypto=require(_0xa9ba('0xa'));var jsforce=require(_0xa9ba('0xb'));var deskjs=require(_0xa9ba('0xc'));var toCsv=require(_0xa9ba('0x8'));var querystring=require('querystring');var Papa=require(_0xa9ba('0xd'));var Redis=require(_0xa9ba('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9ba('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ba('0x10'))(_0xa9ba('0x11'));var utils=require(_0xa9ba('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa9ba('0x13'));var db=require('../../mysqldb')['db'];config[_0xa9ba('0x14')]=_[_0xa9ba('0x15')](config[_0xa9ba('0x14')],{'host':_0xa9ba('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9ba('0x14')]));require(_0xa9ba('0x17'))[_0xa9ba('0x18')](socket);function respondWithStatusCode(_0x385b85,_0x2d1992){_0x2d1992=_0x2d1992||0xcc;return function(_0x2437c5){if(_0x2437c5){return _0x385b85[_0xa9ba('0x19')](_0x2d1992);}return _0x385b85['status'](_0x2d1992)[_0xa9ba('0x1a')]();};}function respondWithResult(_0x2daba5,_0x20c0ac){_0x20c0ac=_0x20c0ac||0xc8;return function(_0x1ab3b0){if(_0x1ab3b0){return _0x2daba5[_0xa9ba('0x1b')](_0x20c0ac)[_0xa9ba('0x1c')](_0x1ab3b0);}};}function respondWithFilteredResult(_0x35d723,_0x533cb6){return function(_0x43e195){if(_0x43e195){var _0x1e3542=typeof _0x533cb6[_0xa9ba('0x1d')]===_0xa9ba('0x1e')&&typeof _0x533cb6['limit']===_0xa9ba('0x1e');var _0x578c97=_0x43e195[_0xa9ba('0x1f')];var _0x323656=_0x1e3542?0x0:_0x533cb6['offset'];var _0x295f5b=_0x1e3542?_0x43e195[_0xa9ba('0x1f')]:_0x533cb6[_0xa9ba('0x1d')]+_0x533cb6['limit'];var _0x222fb7;if(_0x295f5b>=_0x578c97){_0x295f5b=_0x578c97;_0x222fb7=0xc8;}else{_0x222fb7=0xce;}_0x35d723[_0xa9ba('0x1b')](_0x222fb7);return _0x35d723[_0xa9ba('0x20')](_0xa9ba('0x21'),_0x323656+'-'+_0x295f5b+'/'+_0x578c97)['json'](_0x43e195);}return null;};}function patchUpdates(_0x10a322){return function(_0x9e8e25){try{jsonpatch[_0xa9ba('0x22')](_0x9e8e25,_0x10a322,!![]);}catch(_0x7009d0){return BPromise[_0xa9ba('0x23')](_0x7009d0);}return _0x9e8e25[_0xa9ba('0x24')]();};}function saveUpdates(_0x33de21,_0x435627){return function(_0x1c6f3e){if(_0x1c6f3e){return _0x1c6f3e[_0xa9ba('0x25')](_0x33de21)[_0xa9ba('0x26')](function(_0xe2eeca){return _0xe2eeca;});}return null;};}function removeEntity(_0x3ba956,_0x3f32d9){return function(_0x3002c0){if(_0x3002c0){return _0x3002c0['destroy']()[_0xa9ba('0x26')](function(){_0x3ba956[_0xa9ba('0x1b')](0xcc)[_0xa9ba('0x1a')]();});}};}function handleEntityNotFound(_0x17905f,_0x1a6178){return function(_0xe83c0c){if(!_0xe83c0c){_0x17905f['sendStatus'](0x194);}return _0xe83c0c;};}function handleError(_0x20a489,_0x56b28c){_0x56b28c=_0x56b28c||0x1f4;return function(_0xf89189){logger[_0xa9ba('0x27')](_0xf89189['stack']);if(_0xf89189['name']){delete _0xf89189[_0xa9ba('0x28')];}_0x20a489[_0xa9ba('0x1b')](_0x56b28c)[_0xa9ba('0x29')](_0xf89189);};}exports[_0xa9ba('0x2a')]=function(_0x2d13fb,_0x29d272){var _0x45a378={},_0xc05f4a={},_0x273a22={'count':0x0,'rows':[]};var _0x296363=_[_0xa9ba('0x2b')](db[_0xa9ba('0x2c')][_0xa9ba('0x2d')],function(_0x469fd5){return{'name':_0x469fd5[_0xa9ba('0x2e')],'type':_0x469fd5[_0xa9ba('0x2f')]['key']};});_0xc05f4a['model']=_[_0xa9ba('0x2b')](_0x296363,_0xa9ba('0x28'));_0xc05f4a['query']=_[_0xa9ba('0x30')](_0x2d13fb['query']);_0xc05f4a[_0xa9ba('0x31')]=_['intersection'](_0xc05f4a['model'],_0xc05f4a[_0xa9ba('0x32')]);_0x45a378[_0xa9ba('0x33')]=_[_0xa9ba('0x34')](_0xc05f4a[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x2d13fb['query'][_0xa9ba('0x36')]));_0x45a378[_0xa9ba('0x33')]=_0x45a378[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x45a378[_0xa9ba('0x33')]:_0xc05f4a[_0xa9ba('0x35')];if(!_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x38')](_0xa9ba('0x39'))){_0x45a378[_0xa9ba('0x3a')]=qs[_0xa9ba('0x3a')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x3a')]);_0x45a378[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}_0x45a378[_0xa9ba('0x3b')]=qs[_0xa9ba('0x3c')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x3c')]);_0x45a378[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x2d13fb[_0xa9ba('0x32')],_0xc05f4a[_0xa9ba('0x31')]),_0x296363);if(_0x2d13fb['query'][_0xa9ba('0x3f')]){_0x45a378[_0xa9ba('0x3d')]=_['merge'](_0x45a378[_0xa9ba('0x3d')],{'$or':_[_0xa9ba('0x2b')](_0x296363,function(_0x57ea4a){if(_0x57ea4a[_0xa9ba('0x2f')]!==_0xa9ba('0x40')){var _0xa3500a={};_0xa3500a[_0x57ea4a[_0xa9ba('0x28')]]={'$like':'%'+_0x2d13fb[_0xa9ba('0x32')]['filter']+'%'};return _0xa3500a;}})});}_0x45a378=_[_0xa9ba('0x41')]({},_0x45a378,_0x2d13fb['options']);var _0x47069e={'where':_0x45a378[_0xa9ba('0x3d')]};return db[_0xa9ba('0x2c')][_0xa9ba('0x1f')](_0x47069e)[_0xa9ba('0x26')](function(_0x301c1c){_0x273a22[_0xa9ba('0x1f')]=_0x301c1c;if(_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x42')]){_0x45a378[_0xa9ba('0x43')]=[{'all':!![]}];}return db[_0xa9ba('0x2c')][_0xa9ba('0x44')](_0x45a378);})['then'](function(_0x5eab8e){_0x273a22[_0xa9ba('0x45')]=_0x5eab8e;return _0x273a22;})['then'](respondWithFilteredResult(_0x29d272,_0x45a378))[_0xa9ba('0x46')](handleError(_0x29d272,null));};exports[_0xa9ba('0x47')]=function(_0x3745ee,_0x773ba5){var _0x3f1153={'raw':!![],'where':{'id':_0x3745ee[_0xa9ba('0x48')]['id']}},_0x241cae={};_0x241cae[_0xa9ba('0x35')]=_[_0xa9ba('0x30')](db[_0xa9ba('0x2c')][_0xa9ba('0x2d')]);_0x241cae[_0xa9ba('0x32')]=_[_0xa9ba('0x30')](_0x3745ee[_0xa9ba('0x32')]);_0x241cae[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x241cae[_0xa9ba('0x35')],_0x241cae['query']);_0x3f1153['attributes']=_[_0xa9ba('0x34')](_0x241cae['model'],qs[_0xa9ba('0x36')](_0x3745ee['query'][_0xa9ba('0x36')]));_0x3f1153['attributes']=_0x3f1153[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3f1153[_0xa9ba('0x33')]:_0x241cae['model'];if(_0x3745ee[_0xa9ba('0x32')][_0xa9ba('0x42')]){_0x3f1153[_0xa9ba('0x43')]=[{'all':!![]}];}_0x3f1153=_[_0xa9ba('0x41')]({},_0x3f1153,_0x3745ee[_0xa9ba('0x49')]);return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')](_0x3f1153)[_0xa9ba('0x26')](handleEntityNotFound(_0x773ba5,null))['then'](respondWithResult(_0x773ba5,null))[_0xa9ba('0x46')](handleError(_0x773ba5,null));};exports[_0xa9ba('0x4b')]=function(_0x48fa08,_0x3fa284){return db[_0xa9ba('0x2c')][_0xa9ba('0x4b')](_0x48fa08[_0xa9ba('0x4c')],{})[_0xa9ba('0x26')](respondWithResult(_0x3fa284,0xc9))[_0xa9ba('0x46')](handleError(_0x3fa284,null));};exports[_0xa9ba('0x25')]=function(_0x4180f2,_0xeefa90){if(_0x4180f2[_0xa9ba('0x4c')]['id']){delete _0x4180f2[_0xa9ba('0x4c')]['id'];}return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x4180f2[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0xeefa90,null))[_0xa9ba('0x26')](saveUpdates(_0x4180f2[_0xa9ba('0x4c')],null))['then'](respondWithResult(_0xeefa90,null))[_0xa9ba('0x46')](handleError(_0xeefa90,null));};exports[_0xa9ba('0x4d')]=function(_0x5c918,_0x1a934d){return db['ChatGroup']['find']({'where':{'id':_0x5c918[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x1a934d,null))[_0xa9ba('0x26')](removeEntity(_0x1a934d,null))['catch'](handleError(_0x1a934d,null));};exports[_0xa9ba('0x4e')]=function(_0x3dcc80,_0xab7263){return db[_0xa9ba('0x2c')][_0xa9ba('0x4e')]()['then'](respondWithResult(_0xab7263,null))['catch'](handleError(_0xab7263,null));};exports['getUnread']=function(_0x58dda5,_0x4e9d08,_0x3ae1e9){return db[_0xa9ba('0x4f')][_0xa9ba('0x1f')]({'where':{'ChatGroupId':_0x58dda5[_0xa9ba('0x48')]['id'],'ToId':_0x58dda5[_0xa9ba('0x50')]['id'],'read':![]}})[_0xa9ba('0x26')](function(_0x3d0abd){return{'id':_[_0xa9ba('0x51')](_0x58dda5['params']['id']),'count':_0x3d0abd};})[_0xa9ba('0x26')](respondWithResult(_0x4e9d08,null))[_0xa9ba('0x46')](handleError(_0x4e9d08,null));};exports[_0xa9ba('0x52')]=function(_0x2ba5ca,_0x509790,_0x380193){return db[_0xa9ba('0x2c')]['find']({'where':{'id':_0x2ba5ca[_0xa9ba('0x48')]['id']}})['then'](handleEntityNotFound(_0x509790,null))['then'](function(_0x444e33){if(_0x444e33){return _0x444e33[_0xa9ba('0x52')](_0x2ba5ca[_0xa9ba('0x4c')]['ids'],_[_0xa9ba('0x53')](_0x2ba5ca[_0xa9ba('0x4c')],[_0xa9ba('0x54'),'id'])||{});}})[_0xa9ba('0x26')](respondWithResult(_0x509790,null))[_0xa9ba('0x46')](handleError(_0x509790,null));};exports[_0xa9ba('0x55')]=function(_0x529320,_0x151e72,_0x4a1f46){var _0x3d8ce6={};var _0x1038a2={};var _0x54fb76;var _0x1e42ff;return db[_0xa9ba('0x2c')]['findOne']({'where':{'id':_0x529320['params']['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x151e72,null))[_0xa9ba('0x26')](function(_0x533dec){if(_0x533dec){_0x54fb76=_0x533dec;_0x1038a2[_0xa9ba('0x35')]=_[_0xa9ba('0x30')](db[_0xa9ba('0x56')][_0xa9ba('0x2d')]);_0x1038a2[_0xa9ba('0x32')]=_[_0xa9ba('0x30')](_0x529320['query']);_0x1038a2[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x1038a2[_0xa9ba('0x35')],_0x1038a2[_0xa9ba('0x32')]);_0x3d8ce6['attributes']=_[_0xa9ba('0x34')](_0x1038a2[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x36')]));_0x3d8ce6['attributes']=_0x3d8ce6[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3d8ce6[_0xa9ba('0x33')]:_0x1038a2[_0xa9ba('0x35')];_0x3d8ce6['order']=qs[_0xa9ba('0x3c')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x3c')]);_0x3d8ce6[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x529320[_0xa9ba('0x32')],_0x1038a2[_0xa9ba('0x31')]));if(_0x529320['query']['filter']){_0x3d8ce6[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3d8ce6[_0xa9ba('0x3d')],{'$or':_['map'](_0x3d8ce6[_0xa9ba('0x33')],function(_0x17ca93){var _0x4a3c43={};_0x4a3c43[_0x17ca93]={'$like':'%'+_0x529320['query'][_0xa9ba('0x3f')]+'%'};return _0x4a3c43;})});}_0x3d8ce6=_[_0xa9ba('0x41')]({},_0x3d8ce6,_0x529320[_0xa9ba('0x49')]);return _0x54fb76[_0xa9ba('0x55')](_0x3d8ce6);}})[_0xa9ba('0x26')](function(_0x3cc657){if(_0x3cc657){_0x1e42ff=_0x3cc657[_0xa9ba('0x37')];if(!_0x529320[_0xa9ba('0x32')]['hasOwnProperty'](_0xa9ba('0x39'))){_0x3d8ce6['limit']=qs[_0xa9ba('0x3a')](_0x529320[_0xa9ba('0x32')]['limit']);_0x3d8ce6[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}return _0x54fb76[_0xa9ba('0x55')](_0x3d8ce6);}})[_0xa9ba('0x26')](function(_0x271612){if(_0x271612){return _0x271612?{'count':_0x1e42ff,'rows':_0x271612}:null;}})[_0xa9ba('0x26')](respondWithResult(_0x151e72,null))[_0xa9ba('0x46')](handleError(_0x151e72,null));};exports[_0xa9ba('0x57')]=function(_0x436f70,_0x16ab4a,_0x332c83){return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x436f70[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x16ab4a,null))['then'](function(_0xebec15){if(_0xebec15){return _0xebec15[_0xa9ba('0x57')](_0x436f70[_0xa9ba('0x32')][_0xa9ba('0x54')]);}})[_0xa9ba('0x26')](respondWithStatusCode(_0x16ab4a,null))[_0xa9ba('0x46')](handleError(_0x16ab4a,null));};exports['addMessage']=function(_0x31330b,_0x402910,_0x303308){if(_0x31330b['body']['id']){delete _0x31330b['body']['id'];}return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x31330b['params']['id']}})['then'](handleEntityNotFound(_0x402910,null))[_0xa9ba('0x26')](function(_0x55533f){if(_0x55533f){_0x31330b[_0xa9ba('0x4c')][_0xa9ba('0x58')]=_0x55533f['id'];return db['ChatInternalMessage'][_0xa9ba('0x4b')](_0x31330b[_0xa9ba('0x4c')]);}})['then'](respondWithResult(_0x402910,null))[_0xa9ba('0x46')](handleError(_0x402910,null));};exports[_0xa9ba('0x59')]=function(_0x2064ab,_0x32689e,_0x46f725){var _0x3ccd8e={};var _0x47a162={};var _0x134364;var _0x25eb1a;return db[_0xa9ba('0x2c')][_0xa9ba('0x5a')]({'where':{'id':_0x2064ab['params']['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x32689e,null))['then'](function(_0x2c54d7){if(_0x2c54d7){_0x134364=_0x2c54d7;_0x47a162['model']=_['keys'](db[_0xa9ba('0x4f')][_0xa9ba('0x2d')]);_0x47a162['query']=_[_0xa9ba('0x30')](_0x2064ab['query']);_0x47a162[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x47a162[_0xa9ba('0x35')],_0x47a162[_0xa9ba('0x32')]);_0x3ccd8e['attributes']=_['intersection'](_0x47a162[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x2064ab[_0xa9ba('0x32')]['fields']));_0x3ccd8e[_0xa9ba('0x33')]=_0x3ccd8e[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3ccd8e['attributes']:_0x47a162[_0xa9ba('0x35')];_0x3ccd8e['order']=qs[_0xa9ba('0x3c')](_0x2064ab[_0xa9ba('0x32')]['sort']);_0x3ccd8e[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x2064ab[_0xa9ba('0x32')],_0x47a162['filters']));if(_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x3f')]){_0x3ccd8e[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3ccd8e[_0xa9ba('0x3d')],{'$or':_[_0xa9ba('0x2b')](_0x3ccd8e[_0xa9ba('0x33')],function(_0x4354c2){var _0x21517d={};_0x21517d[_0x4354c2]={'$like':'%'+_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x3f')]+'%'};return _0x21517d;})});}if(_0x2064ab[_0xa9ba('0x32')]['$gte']){var _0x2f75a5=_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x5b')]['split'](',');var _0xb59b4d={};_0xb59b4d[_0x2f75a5[0x0]]={'$gte':moment(_0x2f75a5[0x1])[_0xa9ba('0x5c')](_0xa9ba('0x5d'))};_0x3ccd8e[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3ccd8e[_0xa9ba('0x3d')],_0xb59b4d);}_0x3ccd8e=_[_0xa9ba('0x41')]({},_0x3ccd8e,_0x2064ab['options']);return _0x134364[_0xa9ba('0x59')](_0x3ccd8e);}})[_0xa9ba('0x26')](function(_0x1621ec){if(_0x1621ec){_0x25eb1a=_0x1621ec[_0xa9ba('0x37')];if(!_0x2064ab['query'][_0xa9ba('0x38')]('nolimit')){_0x3ccd8e[_0xa9ba('0x3a')]=qs['limit'](_0x2064ab['query'][_0xa9ba('0x3a')]);_0x3ccd8e[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}return _0x134364[_0xa9ba('0x59')](_0x3ccd8e);}})[_0xa9ba('0x26')](function(_0x2cdf69){if(_0x2cdf69){return _0x2cdf69?{'count':_0x25eb1a,'rows':_0x2cdf69}:null;}})['then'](respondWithResult(_0x32689e,null))['catch'](handleError(_0x32689e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index acebc97..4a1b773 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3d4=['emit','events','save','remove'];(function(_0x5d10c2,_0x4b0a49){var _0x57c7c4=function(_0x38ab70){while(--_0x38ab70){_0x5d10c2['push'](_0x5d10c2['shift']());}};_0x57c7c4(++_0x4b0a49);}(_0xf3d4,0x71));var _0x4f3d=function(_0x171d12,_0x37e7e6){_0x171d12=_0x171d12-0x0;var _0x118219=_0xf3d4[_0x171d12];return _0x118219;};'use strict';var EventEmitter=require(_0x4f3d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f3d('0x1'),'afterUpdate':'update','afterDestroy':_0x4f3d('0x2')};function emitEvent(_0x76a88d){return function(_0x189bba,_0x19791b,_0x470f2c){ChatGroupEvents['emit'](_0x76a88d+':'+_0x189bba['id'],_0x189bba);ChatGroupEvents[_0x4f3d('0x3')](_0x76a88d,_0x189bba);_0x470f2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xe797=['emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3f889c,_0x1c16af){var _0x5edf2a=function(_0x5adbc1){while(--_0x5adbc1){_0x3f889c['push'](_0x3f889c['shift']());}};_0x5edf2a(++_0x1c16af);}(_0xe797,0x12a));var _0x7e79=function(_0x262ead,_0x2737bd){_0x262ead=_0x262ead-0x0;var _0x334322=_0xe797[_0x262ead];return _0x334322;};'use strict';var EventEmitter=require(_0x7e79('0x0'));var ChatGroup=require(_0x7e79('0x1'))['db'][_0x7e79('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7e79('0x3')](0x0);var events={'afterCreate':_0x7e79('0x4'),'afterUpdate':_0x7e79('0x5'),'afterDestroy':'remove'};function emitEvent(_0x214cdc){return function(_0x22a597,_0x5ba3bf,_0x2053c1){ChatGroupEvents[_0x7e79('0x6')](_0x214cdc+':'+_0x22a597['id'],_0x22a597);ChatGroupEvents[_0x7e79('0x6')](_0x214cdc,_0x22a597);_0x2053c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7e79('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 263af48..559b7aa 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75bb=['ChatGroup','lodash','util','api','moment','path','../../config/environment','exports','define'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x75bb,0x91));var _0xb75b=function(_0x9ad6d2,_0x183d43){_0x9ad6d2=_0x9ad6d2-0x0;var _0x5087e6=_0x75bb[_0x9ad6d2];return _0x5087e6;};'use strict';var _=require(_0xb75b('0x0'));var util=require(_0xb75b('0x1'));var logger=require('../../config/logger')(_0xb75b('0x2'));var moment=require(_0xb75b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb75b('0x4'));var rimraf=require('rimraf');var config=require(_0xb75b('0x5'));var attributes=require('./chatGroup.attributes');module[_0xb75b('0x6')]=function(_0x190d7b,_0x5d59b6){return _0x190d7b[_0xb75b('0x7')](_0xb75b('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d9a=['../../config/logger','api','moment','./chatGroup.attributes','define','ChatGroup'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x4d9a,0xea));var _0xa4d9=function(_0x316bea,_0x99a1b){_0x316bea=_0x316bea-0x0;var _0x501d3f=_0x4d9a[_0x316bea];return _0x501d3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4d9('0x0'))(_0xa4d9('0x1'));var moment=require(_0xa4d9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa4d9('0x3'));module['exports']=function(_0x2b905d,_0x5598e2){return _0x2b905d[_0xa4d9('0x4')](_0xa4d9('0x5'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index cad1adb..f7d8889 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9362=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1d070d,_0x44b1dc){var _0x150d9f=function(_0x378b25){while(--_0x378b25){_0x1d070d['push'](_0x1d070d['shift']());}};_0x150d9f(++_0x44b1dc);}(_0x9362,0x169));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2936('0x0'));var util=require('util');var moment=require(_0x2936('0x1'));var BPromise=require('bluebird');var rs=require(_0x2936('0x2'));var fs=require('fs');var Redis=require(_0x2936('0x3'));var db=require(_0x2936('0x4'))['db'];var utils=require(_0x2936('0x5'));var logger=require('../../config/logger')(_0x2936('0x6'));var config=require('../../config/environment');var jayson=require(_0x2936('0x7'));var client=jayson[_0x2936('0x8')][_0x2936('0x9')]({'port':0x232a});config[_0x2936('0xa')]=_['defaults'](config['redis'],{'host':_0x2936('0xb'),'port':0x18eb});var socket=require(_0x2936('0xc'))(new Redis(config[_0x2936('0xa')]));require('./chatGroup.socket')[_0x2936('0xd')](socket);function respondWithRpcPromise(_0x2e32c3,_0x1c3a06,_0x29075d){return new BPromise(function(_0x4da5a5,_0x43ed5f){return client[_0x2936('0xe')](_0x2e32c3,_0x29075d)[_0x2936('0xf')](function(_0x6e1b66){logger[_0x2936('0x10')](_0x2936('0x11'),_0x1c3a06,_0x2936('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c3a06,_0x2936('0x12'),JSON[_0x2936('0x13')](_0x6e1b66));if(_0x6e1b66[_0x2936('0x14')]){if(_0x6e1b66['error'][_0x2936('0x15')]===0x1f4){logger[_0x2936('0x14')](_0x2936('0x11'),_0x1c3a06,_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);return _0x43ed5f(_0x6e1b66[_0x2936('0x14')]['message']);}logger['error'](_0x2936('0x11'),_0x1c3a06,_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);return _0x4da5a5(_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);}else{logger['info'](_0x2936('0x11'),_0x1c3a06,'request\x20sent');_0x4da5a5(_0x6e1b66['result']['message']);}})[_0x2936('0x17')](function(_0x428e41){logger[_0x2936('0x14')](_0x2936('0x11'),_0x1c3a06,_0x428e41);_0x43ed5f(_0x428e41);});});} \ No newline at end of file +var _0x2f7e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x2f7e,0x122));var _0xe2f7=function(_0x85f630,_0x361b78){_0x85f630=_0x85f630-0x0;var _0x421655=_0x2f7e[_0x85f630];return _0x421655;};'use strict';var _=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var moment=require('moment');var BPromise=require(_0xe2f7('0x2'));var rs=require(_0xe2f7('0x3'));var fs=require('fs');var Redis=require(_0xe2f7('0x4'));var db=require(_0xe2f7('0x5'))['db'];var utils=require(_0xe2f7('0x6'));var logger=require(_0xe2f7('0x7'))(_0xe2f7('0x8'));var config=require(_0xe2f7('0x9'));var jayson=require(_0xe2f7('0xa'));var client=jayson[_0xe2f7('0xb')]['http']({'port':0x232a});config[_0xe2f7('0xc')]=_[_0xe2f7('0xd')](config[_0xe2f7('0xc')],{'host':_0xe2f7('0xe'),'port':0x18eb});var socket=require(_0xe2f7('0xf'))(new Redis(config[_0xe2f7('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x376da4,_0x2c92f3,_0x5649a3){return new BPromise(function(_0x3986bb,_0x97c8d2){return client[_0xe2f7('0x10')](_0x376da4,_0x5649a3)[_0xe2f7('0x11')](function(_0x18e94b){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));logger[_0xe2f7('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'),JSON[_0xe2f7('0x14')](_0x18e94b));if(_0x18e94b[_0xe2f7('0x15')]){if(_0x18e94b['error']['code']===0x1f4){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x97c8d2(_0x18e94b[_0xe2f7('0x15')]['message']);}logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x3986bb(_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);}else{logger[_0xe2f7('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));_0x3986bb(_0x18e94b[_0xe2f7('0x19')][_0xe2f7('0x17')]);}})[_0xe2f7('0x1a')](function(_0x4cd325){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x4cd325);_0x97c8d2(_0x4cd325);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6bdef74..d909217 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9369=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x2ad3ca,_0x1f7baf){var _0x2e98c4=function(_0x2b2639){while(--_0x2b2639){_0x2ad3ca['push'](_0x2ad3ca['shift']());}};_0x2e98c4(++_0x1f7baf);}(_0x9369,0x1e1));var _0x9936=function(_0x277031,_0x1accda){_0x277031=_0x277031-0x0;var _0x555017=_0x9369[_0x277031];return _0x555017;};'use strict';var ChatGroupEvents=require(_0x9936('0x0'));var events=[_0x9936('0x1'),_0x9936('0x2'),_0x9936('0x3')];function createListener(_0x517be3,_0x3c049f){return function(_0x148d5b){_0x3c049f[_0x9936('0x4')](_0x517be3,_0x148d5b);};}function removeListener(_0x11948f,_0x6b8c2b){return function(){ChatGroupEvents[_0x9936('0x5')](_0x11948f,_0x6b8c2b);};}exports[_0x9936('0x6')]=function(_0x1ed24f){for(var _0x3fd052=0x0,_0x896bdb=events[_0x9936('0x7')];_0x3fd052<_0x896bdb;_0x3fd052++){var _0x20ed7a=events[_0x3fd052];var _0x5457ba=createListener(_0x9936('0x8')+_0x20ed7a,_0x1ed24f);ChatGroupEvents['on'](_0x20ed7a,_0x5457ba);}}; \ No newline at end of file +var _0x658f=['update','emit','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1481d2,_0x2c97b0){var _0xeaa21f=function(_0x3fe4c2){while(--_0x3fe4c2){_0x1481d2['push'](_0x1481d2['shift']());}};_0xeaa21f(++_0x2c97b0);}(_0x658f,0x105));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xf658('0x0'));var events=[_0xf658('0x1'),_0xf658('0x2'),_0xf658('0x3')];function createListener(_0x1f01c5,_0x213b16){return function(_0x21ec55){_0x213b16[_0xf658('0x4')](_0x1f01c5,_0x21ec55);};}function removeListener(_0x1b93bf,_0x3ea0ab){return function(){ChatGroupEvents['removeListener'](_0x1b93bf,_0x3ea0ab);};}exports[_0xf658('0x5')]=function(_0xa82647){for(var _0x1e5dde=0x0,_0x20290c=events[_0xf658('0x6')];_0x1e5dde<_0x20290c;_0x1e5dde++){var _0x44e1ca=events[_0x1e5dde];var _0x2c42b7=createListener(_0xf658('0x7')+_0x44e1ca,_0xa82647);ChatGroupEvents['on'](_0x44e1ca,_0x2c42b7);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 09df809..1b30fc4 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4e=['addMembers','update','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','post','create'];(function(_0x3b5a4a,_0x4096e5){var _0xaaec44=function(_0x30ca60){while(--_0x30ca60){_0x3b5a4a['push'](_0x3b5a4a['shift']());}};_0xaaec44(++_0x4096e5);}(_0xac4e,0xbb));var _0xeac4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xac4e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xeac4('0x0'));var util=require(_0xeac4('0x1'));var path=require(_0xeac4('0x2'));var timeout=require(_0xeac4('0x3'));var express=require(_0xeac4('0x4'));var router=express[_0xeac4('0x5')]();var fs_extra=require(_0xeac4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeac4('0x7'));var config=require(_0xeac4('0x8'));var controller=require(_0xeac4('0x9'));router[_0xeac4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeac4('0xa')](_0xeac4('0xb'),auth[_0xeac4('0xc')](),controller['describe']);router[_0xeac4('0xa')](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0xe')]);router[_0xeac4('0xa')](_0xeac4('0xf'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x10')]);router[_0xeac4('0xa')](_0xeac4('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xeac4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xeac4('0x12')]);router[_0xeac4('0x13')]('/',auth[_0xeac4('0xc')](),controller[_0xeac4('0x14')]);router['post'](_0xeac4('0x11'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x15')]);router[_0xeac4('0x13')]('/:id/messages',auth[_0xeac4('0xc')](),controller['addMessage']);router['put'](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x16')]);router['delete'](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x17')]);router[_0xeac4('0x18')](_0xeac4('0x11'),auth[_0xeac4('0xc')](),controller['removeMembers']);module[_0xeac4('0x19')]=router; \ No newline at end of file +var _0x5509=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','destroy','delete','removeMembers','exports','path','connect-timeout','express'];(function(_0x1e022e,_0x2f02af){var _0x24f8ec=function(_0x3c733c){while(--_0x3c733c){_0x1e022e['push'](_0x1e022e['shift']());}};_0x24f8ec(++_0x2f02af);}(_0x5509,0x193));var _0x9550=function(_0x2f6dce,_0x166be3){_0x2f6dce=_0x2f6dce-0x0;var _0x5bf95e=_0x5509[_0x2f6dce];return _0x5bf95e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9550('0x0'));var timeout=require(_0x9550('0x1'));var express=require(_0x9550('0x2'));var router=express[_0x9550('0x3')]();var fs_extra=require(_0x9550('0x4'));var auth=require(_0x9550('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9550('0x6'));var controller=require(_0x9550('0x7'));router[_0x9550('0x8')]('/',auth['isAuthenticated'](),controller[_0x9550('0x9')]);router[_0x9550('0x8')](_0x9550('0xa'),auth[_0x9550('0xb')](),controller[_0x9550('0xc')]);router[_0x9550('0x8')](_0x9550('0xd'),auth[_0x9550('0xb')](),controller['show']);router['get'](_0x9550('0xe'),auth[_0x9550('0xb')](),controller[_0x9550('0xf')]);router[_0x9550('0x8')](_0x9550('0x10'),auth[_0x9550('0xb')](),controller[_0x9550('0x11')]);router[_0x9550('0x8')](_0x9550('0x12'),auth[_0x9550('0xb')](),controller[_0x9550('0x13')]);router[_0x9550('0x14')]('/',auth[_0x9550('0xb')](),controller[_0x9550('0x15')]);router['post']('/:id/members',auth[_0x9550('0xb')](),controller[_0x9550('0x16')]);router[_0x9550('0x14')](_0x9550('0x12'),auth[_0x9550('0xb')](),controller['addMessage']);router[_0x9550('0x17')]('/:id',auth[_0x9550('0xb')](),controller[_0x9550('0x18')]);router['delete'](_0x9550('0xd'),auth[_0x9550('0xb')](),controller[_0x9550('0x19')]);router[_0x9550('0x1a')]('/:id/members',auth[_0x9550('0xb')](),controller[_0x9550('0x1b')]);module[_0x9550('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index e61fcd5..d225f1b 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9158=['ENUM','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x320758,_0x48f21c){var _0x4feb48=function(_0x725394){while(--_0x725394){_0x320758['push'](_0x320758['shift']());}};_0x4feb48(++_0x48f21c);}(_0x9158,0x16e));var _0x8915=function(_0x1f68c6,_0x21f3be){_0x1f68c6=_0x1f68c6-0x0;var _0x333007=_0x9158[_0x1f68c6];return _0x333007;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'closed':{'type':Sequelize[_0x8915('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x8915('0x3')]('star',_0x8915('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x8915('0x5')]},'mailTranscript':{'type':Sequelize[_0x8915('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8915('0x7')]},'disposition':{'type':Sequelize[_0x8915('0x6')]},'secondDisposition':{'type':Sequelize[_0x8915('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8915('0x6')]},'note':{'type':Sequelize[_0x8915('0x6')]},'browserName':{'type':Sequelize[_0x8915('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8915('0x6')]},'osVersion':{'type':Sequelize[_0x8915('0x6')]},'deviceModel':{'type':Sequelize[_0x8915('0x6')]},'deviceVendor':{'type':Sequelize[_0x8915('0x6')]},'deviceType':{'type':Sequelize[_0x8915('0x6')]},'referer':{'type':Sequelize[_0x8915('0x5')]},'customerIp':{'type':Sequelize[_0x8915('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x8915('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8915('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8915('0x3')]('in',_0x8915('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8915('0x6')]},'customerPort':{'type':Sequelize[_0x8915('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8915('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0664=['thumb','star','TEXT','STRING','DATE','long','BOOLEAN','exports','INTEGER','ENUM'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0x0664,0x93));var _0x4066=function(_0x2e84e5,_0x11c0e9){_0x2e84e5=_0x2e84e5-0x0;var _0x281a09=_0x0664[_0x2e84e5];return _0x281a09;};'use strict';var Sequelize=require('sequelize');module[_0x4066('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4066('0x1')]},'ratingType':{'type':Sequelize[_0x4066('0x2')]('star',_0x4066('0x3')),'defaultValue':_0x4066('0x4')},'ratingMessage':{'type':Sequelize[_0x4066('0x5')]},'pathTranscript':{'type':Sequelize[_0x4066('0x5')]},'mailTranscript':{'type':Sequelize[_0x4066('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4066('0x7')]},'disposition':{'type':Sequelize[_0x4066('0x6')]},'secondDisposition':{'type':Sequelize[_0x4066('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4066('0x6')]},'note':{'type':Sequelize[_0x4066('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4066('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4066('0x6')]},'deviceModel':{'type':Sequelize[_0x4066('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4066('0x5')]},'customerIp':{'type':Sequelize[_0x4066('0x6')]},'formData':{'type':Sequelize[_0x4066('0x5')](_0x4066('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4066('0x6')]},'customerPort':{'type':Sequelize[_0x4066('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4066('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4066('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c184e44..42c28f5 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e5a=['send','render','merge','body','contact','agent','interaction','Users','map','TagIds','Tags','split','forEach','push','unmanaged','abandoned','UserId','waiting','closed','talking','disposition','answered','total','index','ChatInteraction','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.internal','ChatInteractionId','show','rawAttributes','intersection','includeAll','include','create','destroy','params','describe','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ChatWebsite','format','agentAlias','System','Visitor','agentIdentifier','website_alias','%s%d','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','includeAgent','setTags','spread','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','renderFile','views','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','save','update','sendStatus','stack','name'];(function(_0x294d98,_0xf2b8f9){var _0xa4d95=function(_0x11a31b){while(--_0x11a31b){_0x294d98['push'](_0x294d98['shift']());}};_0xa4d95(++_0xf2b8f9);}(_0x9e5a,0x101));var _0xa9e5=function(_0x4df522,_0x467f15){_0x4df522=_0x4df522-0x0;var _0x1b5ad2=_0x9e5a[_0x4df522];return _0x1b5ad2;};'use strict';var emlformat=require(_0xa9e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9e5('0x1'));var jsonpatch=require(_0xa9e5('0x2'));var rp=require(_0xa9e5('0x3'));var moment=require('moment');var BPromise=require(_0xa9e5('0x4'));var Mustache=require('mustache');var util=require(_0xa9e5('0x5'));var path=require(_0xa9e5('0x6'));var sox=require(_0xa9e5('0x7'));var csv=require('to-csv');var ejs=require(_0xa9e5('0x8'));var fs=require('fs');var fs_extra=require(_0xa9e5('0x9'));var _=require(_0xa9e5('0xa'));var squel=require(_0xa9e5('0xb'));var crypto=require(_0xa9e5('0xc'));var jsforce=require(_0xa9e5('0xd'));var deskjs=require(_0xa9e5('0xe'));var toCsv=require(_0xa9e5('0xf'));var querystring=require(_0xa9e5('0x10'));var Papa=require(_0xa9e5('0x11'));var Redis=require(_0xa9e5('0x12'));var authService=require(_0xa9e5('0x13'));var qs=require(_0xa9e5('0x14'));var as=require(_0xa9e5('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa9e5('0x16'));var logger=require(_0xa9e5('0x17'))(_0xa9e5('0x18'));var utils=require(_0xa9e5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa9e5('0x1a'))['db'];config[_0xa9e5('0x1b')]=_[_0xa9e5('0x1c')](config[_0xa9e5('0x1b')],{'host':_0xa9e5('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9e5('0x1b')]));require(_0xa9e5('0x1e'))['register'](socket);var jayson=require(_0xa9e5('0x1f'));var client=jayson[_0xa9e5('0x20')][_0xa9e5('0x21')]({'port':0x232b});var client9004=jayson[_0xa9e5('0x20')][_0xa9e5('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x38d30f,_0x465644,_0xbcfae1,_0x18d461){return new BPromise(function(_0x350c42,_0x438fe1){var _0x17fdf3=_0x18d461||client;return _0x17fdf3[_0xa9e5('0x22')](_0x38d30f,_0xbcfae1)[_0xa9e5('0x23')](function(_0x1f298b){logger[_0xa9e5('0x24')](_0xa9e5('0x25'),_0x465644,_0xa9e5('0x26'));logger[_0xa9e5('0x27')](_0xa9e5('0x28'),_0x465644,_0xa9e5('0x26'),JSON[_0xa9e5('0x29')](_0x1f298b));if(_0x1f298b['error']){if(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2b')]===0x1f4){logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);return _0x438fe1(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);}logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);return _0x350c42(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);}else{logger[_0xa9e5('0x24')](_0xa9e5('0x25'),_0x465644,'request\x20sent');_0x350c42(_0x1f298b[_0xa9e5('0x2d')]['message']);}})[_0xa9e5('0x2e')](function(_0x47ee57){logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x47ee57);_0x438fe1(_0x47ee57);});});}function respondWithStatusCode(_0x37a306,_0x446957){_0x446957=_0x446957||0xcc;return function(_0x36ce56){if(_0x36ce56){return _0x37a306['sendStatus'](_0x446957);}return _0x37a306['status'](_0x446957)[_0xa9e5('0x2f')]();};}function respondWithResult(_0x1e799f,_0x4671dd){_0x4671dd=_0x4671dd||0xc8;return function(_0xdcb7c9){if(_0xdcb7c9){return _0x1e799f[_0xa9e5('0x30')](_0x4671dd)[_0xa9e5('0x31')](_0xdcb7c9);}};}function respondWithFilteredResult(_0x1c9a5a,_0xdbff89){return function(_0x326875){if(_0x326875){var _0x17ff59=typeof _0xdbff89[_0xa9e5('0x32')]===_0xa9e5('0x33')&&typeof _0xdbff89['limit']===_0xa9e5('0x33');var _0x3e5842=_0x326875['count'];var _0x988f01=_0x17ff59?0x0:_0xdbff89[_0xa9e5('0x32')];var _0xe1aaf6=_0x17ff59?_0x326875[_0xa9e5('0x34')]:_0xdbff89['offset']+_0xdbff89[_0xa9e5('0x35')];var _0x1ab5c7;if(_0xe1aaf6>=_0x3e5842){_0xe1aaf6=_0x3e5842;_0x1ab5c7=0xc8;}else{_0x1ab5c7=0xce;}_0x1c9a5a[_0xa9e5('0x30')](_0x1ab5c7);return _0x1c9a5a[_0xa9e5('0x36')]('Content-Range',_0x988f01+'-'+_0xe1aaf6+'/'+_0x3e5842)[_0xa9e5('0x31')](_0x326875);}return null;};}function patchUpdates(_0xa8213e){return function(_0x3cb5b9){try{jsonpatch['apply'](_0x3cb5b9,_0xa8213e,!![]);}catch(_0x1a989d){return BPromise['reject'](_0x1a989d);}return _0x3cb5b9[_0xa9e5('0x37')]();};}function saveUpdates(_0x55e1ce,_0x1e5f71){return function(_0x3afb73){if(_0x3afb73){return _0x3afb73[_0xa9e5('0x38')](_0x55e1ce)['then'](function(_0x2dd2a7){return _0x2dd2a7;});}return null;};}function removeEntity(_0x2c5e6a,_0x2de878){return function(_0x308558){if(_0x308558){return _0x308558['destroy']()[_0xa9e5('0x23')](function(){_0x2c5e6a['status'](0xcc)[_0xa9e5('0x2f')]();});}};}function handleEntityNotFound(_0x25d7d3,_0x4978a1){return function(_0x14f082){if(!_0x14f082){_0x25d7d3[_0xa9e5('0x39')](0x194);}return _0x14f082;};}function handleError(_0x2aec95,_0x331121){_0x331121=_0x331121||0x1f4;return function(_0x22c57e){logger[_0xa9e5('0x2a')](_0x22c57e[_0xa9e5('0x3a')]);if(_0x22c57e[_0xa9e5('0x3b')]){delete _0x22c57e['name'];}_0x2aec95['status'](_0x331121)[_0xa9e5('0x3c')](_0x22c57e);};}function getMustacheRender(_0xb25f65,_0x5efd1f){return Mustache[_0xa9e5('0x3d')](_0xb25f65,_[_0xa9e5('0x3e')](_0x5efd1f[_0xa9e5('0x3f')],{'contact':_0x5efd1f[_0xa9e5('0x40')],'message':_0x5efd1f[_0xa9e5('0x2c')],'agent':_0x5efd1f[_0xa9e5('0x41')],'interaction':_0x5efd1f[_0xa9e5('0x42')],'account':_0x5efd1f['account']}))||'';}function getInteractionUsers(_0x2da11e,_0x100a64){return new BPromise(function(_0x5992e3,_0x486bb4){try{if(_0x100a64[_0x2da11e['id']]){_0x2da11e[_0xa9e5('0x43')]=_[_0xa9e5('0x44')](_0x100a64[_0x2da11e['id']],function(_0x1cf827){return{'id':_0x1cf827['id'],'fullname':_0x1cf827['fullname']};});}}catch(_0x510b1b){_0x486bb4(_0x510b1b);}_0x5992e3(_0x2da11e);});}function getInteractionTags(_0x262f87,_0x1e0f80){return new BPromise(function(_0x57d415,_0x5381d0){try{if(_0x262f87[_0xa9e5('0x45')]){_0x262f87[_0xa9e5('0x46')]=[];_0x262f87[_0xa9e5('0x45')][_0xa9e5('0x47')](',')[_0xa9e5('0x48')](function(_0x5ba710){_0x262f87[_0xa9e5('0x46')][_0xa9e5('0x49')](_0x1e0f80[_0x5ba710]);});}delete _0x262f87[_0xa9e5('0x45')];}catch(_0x661954){_0x5381d0(_0x661954);}_0x57d415(_0x262f87);});}function updateChatInteraction(_0x1dc6c8,_0x413f25,_0x2de556){return new BPromise(function(_0x524b55,_0x4a9226){return getInteractionUsers(_0x1dc6c8,_0x2de556)[_0xa9e5('0x23')](function(_0x22f72e){return getInteractionTags(_0x22f72e,_0x413f25);})[_0xa9e5('0x23')](function(_0x378052){return getStateInteraction(_0x378052);})[_0xa9e5('0x23')](function(_0x434b71){_0x524b55(_0x434b71);})[_0xa9e5('0x2e')](function(_0x1d4cfa){_0x4a9226(_0x1d4cfa);});});}function getStateInteraction(_0x47d73f){return new BPromise(function(_0x57487c){_0x47d73f['waiting']=0x0;_0x47d73f['talking']=0x0;_0x47d73f['answered']=0x0;_0x47d73f[_0xa9e5('0x4a')]=0x0;_0x47d73f[_0xa9e5('0x4b')]=0x0;_0x47d73f['total']=0x0;if(!_0x47d73f['closed']&&!_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x4d')]+=0x1;}if(!_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x4f')]+=0x1;if(_0x47d73f[_0xa9e5('0x4d')]){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}if(_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x50')]===_0xa9e5('0x4b')){_0x47d73f[_0xa9e5('0x4b')]+=0x1;if(_0x47d73f['waiting']){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}else if(_0x47d73f[_0xa9e5('0x4e')]&&!_0x47d73f[_0xa9e5('0x4c')]&&_0x47d73f[_0xa9e5('0x50')]){_0x47d73f[_0xa9e5('0x4a')]+=0x1;if(_0x47d73f[_0xa9e5('0x4d')]){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}else if(_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x51')]+=0x1;if(_0x47d73f['talking']){_0x47d73f[_0xa9e5('0x4f')]-=0x1;}}_0x47d73f[_0xa9e5('0x52')]+=0x1;_0x57487c(_0x47d73f);});}exports[_0xa9e5('0x53')]=function(_0xba42f5,_0x27c5e7){var _0x1bb9b3={},_0x527c99={},_0x141d65={'count':0x0,'rows':[]};var _0x28db5c=_[_0xa9e5('0x44')](db[_0xa9e5('0x54')]['rawAttributes'],function(_0x58189b){return{'name':_0x58189b[_0xa9e5('0x55')],'type':_0x58189b[_0xa9e5('0x56')]['key']};});_0x527c99[_0xa9e5('0x57')]=_[_0xa9e5('0x44')](_0x28db5c,_0xa9e5('0x3b'));_0x527c99[_0xa9e5('0x58')]=_[_0xa9e5('0x59')](_0xba42f5['query']);_0x527c99[_0xa9e5('0x5a')]=_['intersection'](_0x527c99[_0xa9e5('0x57')],_0x527c99[_0xa9e5('0x58')]);_0x1bb9b3[_0xa9e5('0x5b')]=_['intersection'](_0x527c99['model'],qs[_0xa9e5('0x5c')](_0xba42f5['query'][_0xa9e5('0x5c')]));_0x1bb9b3['attributes']=_0x1bb9b3[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0x1bb9b3['attributes']:_0x527c99['model'];if(!_0xba42f5['query']['hasOwnProperty'](_0xa9e5('0x5e'))){_0x1bb9b3[_0xa9e5('0x35')]=qs[_0xa9e5('0x35')](_0xba42f5['query'][_0xa9e5('0x35')]);_0x1bb9b3[_0xa9e5('0x32')]=qs[_0xa9e5('0x32')](_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x32')]);}_0x1bb9b3[_0xa9e5('0x5f')]=qs[_0xa9e5('0x60')](_0xba42f5['query']['sort']);_0x1bb9b3[_0xa9e5('0x61')]=qs['filters'](_[_0xa9e5('0x62')](_0xba42f5[_0xa9e5('0x58')],_0x527c99[_0xa9e5('0x5a')]),_0x28db5c);var _0x534bbf=[];var _0x3b1896=squel[_0xa9e5('0x63')]()[_0xa9e5('0x64')]('id')[_0xa9e5('0x64')](_0xa9e5('0x3b'))['field'](_0xa9e5('0x65'))[_0xa9e5('0x66')](_0xa9e5('0x67'));var _0x450f1f=squel['select']()[_0xa9e5('0x64')](_0xa9e5('0x68'))[_0xa9e5('0x64')]('u.fullname')[_0xa9e5('0x64')]('ui.ChatInteractionId')[_0xa9e5('0x66')](_0xa9e5('0x69'),'ui')['left_join'](_0xa9e5('0x6a'),'u',_0xa9e5('0x6b'));var _0x3658f6=squel[_0xa9e5('0x63')]()[_0xa9e5('0x66')](_0xa9e5('0x6c'),'i')['left_join'](_0xa9e5('0x6d'),'c',_0xa9e5('0x6e'))[_0xa9e5('0x6f')](_0xa9e5('0x6a'),'o','o.id\x20=\x20i.UserId')[_0xa9e5('0x6f')](_0xa9e5('0x70'),'a',_0xa9e5('0x71'))['left_join'](_0xa9e5('0x72'),'me',_0xa9e5('0x73'))[_0xa9e5('0x6f')](_0xa9e5('0x74'),'it',_0xa9e5('0x75'))[_0xa9e5('0x6f')]('tools_tags','t',_0xa9e5('0x76'));var _0x5265b9=squel[_0xa9e5('0x77')]();var _0x2cb45c=[];var _0x51d0f4=squel[_0xa9e5('0x77')]();var _0x44fda2;if(_0xba42f5['query'][_0xa9e5('0x78')]){_0x44fda2=as[_0xa9e5('0x79')](_0xba42f5['query']['search']);var _0x39a45a=_0x44fda2['sqlOperator'];for(var _0x2cb9b3=0x0;_0x2cb9b3<_0x44fda2[_0xa9e5('0x7a')][_0xa9e5('0x5d')];_0x2cb9b3++){var _0x4c60e3=_0x44fda2[_0xa9e5('0x7a')][_0x2cb9b3];var _0x1c6739='i';var _0x2421a2=_[_0xa9e5('0x7b')](_0x28db5c,[_0xa9e5('0x3b'),_0x4c60e3[_0xa9e5('0x64')]]);if(!_0x2421a2){switch(_0x4c60e3[_0xa9e5('0x64')]){case'unreadMessages':if(_0x4c60e3[_0xa9e5('0x7c')]==0x1){_0x3658f6[_0xa9e5('0x7d')]('`'+_0x4c60e3[_0xa9e5('0x64')]+_0xa9e5('0x7e'));}else{_0x3658f6[_0xa9e5('0x7d')]('`'+_0x4c60e3['field']+'`\x20>\x200');}break;case _0xa9e5('0x7f'):if(_0x4c60e3[_0xa9e5('0x80')]===_0xa9e5('0x81')){if(_0x4c60e3['value']['split']('\x20')[_0xa9e5('0x5d')]>0x1){_0x5265b9[_0x39a45a](_0xa9e5('0x82'),qs[_0xa9e5('0x83')](_0x4c60e3[_0xa9e5('0x7c')]),null);}else{var _0xef0f86='%'+_0x4c60e3[_0xa9e5('0x7c')]+'%';_0x5265b9[_0x39a45a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xef0f86,_0xef0f86,_0xef0f86);}}else{_0x2421a2=_[_0xa9e5('0x7b')](_0x28db5c,[_0xa9e5('0x3b'),_0xa9e5('0x84')]);_0x4c60e3[_0xa9e5('0x64')]=_0xa9e5('0x84');_0x163f65=as['buildExpression'](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x2f')]);}break;case _0xa9e5('0x87'):var _0x5bc5e3=_0x4c60e3[_0xa9e5('0x7c')][_0xa9e5('0x47')](',')[_0xa9e5('0x44')](function(_0x1e6a09){return Number(_0x1e6a09);});_0x5bc5e3['forEach'](function(_0x18eaf7){_0x51d0f4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18eaf7+',%');});_0x2cb45c=_['union'](_0x2cb45c,_0x5bc5e3);break;case _0xa9e5('0x88'):if(_0x4c60e3[_0xa9e5('0x80')]===_0xa9e5('0x81')){_0x5265b9[_0x39a45a](_0xa9e5('0x89'),'%'+_0x4c60e3[_0xa9e5('0x7c')]+'%',null);}else{_0x2421a2=_['find'](_0x28db5c,[_0xa9e5('0x3b'),_0xa9e5('0x4c')]);_0x4c60e3[_0xa9e5('0x64')]=_0xa9e5('0x4c');_0x163f65=as[_0xa9e5('0x8a')](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x2f')]);}break;case _0xa9e5('0x3f'):_0x163f65=as[_0xa9e5('0x8a')]('me',null,_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')]['start'],_0x163f65[_0xa9e5('0x7c')]['end']);break;}}else{var _0x163f65=as[_0xa9e5('0x8a')](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65['value'][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')]['end']);}}}else{var _0x26b35d=_(_0xba42f5[_0xa9e5('0x58')])['keys']()[_0xa9e5('0x44')](function(_0x2703a9){return _[_0xa9e5('0x8b')](_0x28db5c,[_0xa9e5('0x3b'),_0x2703a9])?_0x2703a9:undefined;})['compact']()[_0xa9e5('0x7c')]();if(!_['isEmpty'](_0x26b35d)){_0x26b35d[_0xa9e5('0x48')](function(_0x1e27ca){if(_0x1e27ca===_0xa9e5('0x8c')){_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0x8d'),[][_0xa9e5('0x8e')](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca]));}else if(_0x1e27ca===_0xa9e5('0x8f')){var _0x2aafdf=JSON[_0xa9e5('0x90')](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca])['$gte'];var _0x449684=JSON['parse'](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca])[_0xa9e5('0x91')];_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0x92'),_0x2aafdf,_0x449684);}else{if(_0xba42f5['query'][_0x1e27ca]===_0xa9e5('0x93')){_0x3658f6[_0xa9e5('0x61')]('i.'+_0x1e27ca+_0xa9e5('0x94'));}else{_0x3658f6[_0xa9e5('0x61')]('i.'+_0x1e27ca+'\x20=\x20?',_0xba42f5[_0xa9e5('0x58')][_0x1e27ca]);}}});}if(_0xba42f5[_0xa9e5('0x58')]['read']){if(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x95')]==0x1){_0x3658f6['having'](_0xa9e5('0x96'));}else{_0x3658f6[_0xa9e5('0x7d')](_0xa9e5('0x97'));}}if(_0xba42f5[_0xa9e5('0x58')]['tag']){_0x2cb45c=_[_0xa9e5('0x98')](_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x99')])?_0xba42f5[_0xa9e5('0x58')]['tag']:new Array(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x99')]);_0x2cb45c[_0xa9e5('0x48')](function(_0x587261){_0x51d0f4['or'](_0xa9e5('0x9a'),'%,'+_0x587261+',%');});}if(_0xba42f5['query'][_0xa9e5('0x9b')]){var _0xdff0d2=_0xba42f5['query']['filter'][_0xa9e5('0x9c')]('\x5c','\x5c\x5c')[_0xa9e5('0x9c')](/'/g,'\x27\x27');if(qs[_0xa9e5('0x9d')](_0xdff0d2)){_0x5265b9['or'](_0xa9e5('0x9e'),_0xdff0d2+'%');}else{_0x5265b9['or'](_0xa9e5('0x9f'),qs[_0xa9e5('0x83')](_0xdff0d2))['or'](_0xa9e5('0xa0'),_0xdff0d2+'%');}}}_0x3658f6[_0xa9e5('0x61')](_0x5265b9);_0x3658f6[_0xa9e5('0xa1')](_0xa9e5('0xa2'));var _0x63e3ce={'type':db[_0xa9e5('0xa3')][_0xa9e5('0xa4')]['SELECT'],'raw':!![]};var _0x233d2b=_0x3658f6[_0xa9e5('0xa5')]();_0x233d2b[_0xa9e5('0x64')]('i.id');_0x233d2b[_0xa9e5('0x64')](_0xa9e5('0xa6'),_0xa9e5('0xa7'));if(_0x1bb9b3['order']){_0x1bb9b3[_0xa9e5('0x5f')][_0xa9e5('0x48')](function(_0x30a937){var _0x5095a4=_0x30a937[0x0]===_0xa9e5('0xa8')?_0x30a937[0x0]:'i.'+_0x30a937[0x0];_0x3658f6[_0xa9e5('0x5f')](_0x5095a4,_0x30a937[0x1]===_0xa9e5('0xa9')?![]:!![]);});}if(!_[_0xa9e5('0xaa')](_0x2cb45c)){_0x3658f6['having'](_0x51d0f4);_0x233d2b[_0xa9e5('0x61')](_0xa9e5('0xab'),_0x2cb45c);}BPromise[_0xa9e5('0xac')]()[_0xa9e5('0x23')](function(){if(!_0x44fda2){if(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x8c')])return;_0x233d2b['where'](_0xa9e5('0xad'));_0x3658f6['where'](_0xa9e5('0xad'));return;}if(_0xba42f5[_0xa9e5('0xae')]['role']!=='agent')return;return _0xba42f5[_0xa9e5('0xae')][_0xa9e5('0xaf')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2b2a37){if(_[_0xa9e5('0xaa')](_0x2b2a37)){_0x233d2b['where'](_0xa9e5('0xb0'));_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0xb0'));}else{_0x233d2b[_0xa9e5('0x61')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x2b2a37,'id'));_0x3658f6['where'](_0xa9e5('0x8d'),_[_0xa9e5('0x44')](_0x2b2a37,'id'));}});})[_0xa9e5('0x23')](function(){if(_0xba42f5[_0xa9e5('0xae')][_0xa9e5('0xb1')]===_0xa9e5('0x41')&&!_0x44fda2&&!_0xba42f5[_0xa9e5('0x58')]['ChatWebsiteId'])return[];return db[_0xa9e5('0xb2')][_0xa9e5('0x58')](_0x233d2b[_0xa9e5('0xb3')](),_0x63e3ce);})[_0xa9e5('0x23')](function(_0x4af092){_0x141d65[_0xa9e5('0x34')]=_0x4af092[_0xa9e5('0x5d')];if(_0x141d65[_0xa9e5('0x34')]===0x0)return[];return db[_0xa9e5('0xb2')][_0xa9e5('0x58')](_0x3b1896[_0xa9e5('0xb3')](),_0x63e3ce)[_0xa9e5('0x23')](function(_0x3886c8){_0x534bbf=_[_0xa9e5('0xb4')](_0x3886c8,'id');_0x63e3ce=_[_0xa9e5('0x3e')](_0x63e3ce,{'model':db[_0xa9e5('0x54')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xba42f5['query'][_0xa9e5('0x5c')]){_0x1bb9b3[_0xa9e5('0x5b')][_0xa9e5('0x48')](function(_0x59db22){_0x3658f6['field']('i.'+_0x59db22);});}else{_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xa6'),_0xa9e5('0xa7'));_0x3658f6['field'](_0xa9e5('0xb5'),_0xa9e5('0xb6'));_0x3658f6['field'](_0xa9e5('0xb7'),_0xa9e5('0xb8'));_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xb9'),_0xa9e5('0xa8'));_0x3658f6[_0xa9e5('0x64')]('i.*');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xba'),'Contact.firstName');_0x3658f6[_0xa9e5('0x64')]('c.lastName','Contact.lastName');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbb'),_0xa9e5('0xbc'));_0x3658f6[_0xa9e5('0x64')]('c.phone',_0xa9e5('0xbd'));_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbe'),'Contact.mobile');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbf'),_0xa9e5('0xc0'));_0x3658f6[_0xa9e5('0x64')]('o.fullname','Owner.fullname');_0x3658f6[_0xa9e5('0x64')]('o.internal',_0xa9e5('0xc1'));_0x3658f6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa9e5('0x45'));}if(_0x1bb9b3[_0xa9e5('0x35')])_0x3658f6[_0xa9e5('0x35')](_0x1bb9b3[_0xa9e5('0x35')]);if(_0x1bb9b3[_0xa9e5('0x32')])_0x3658f6[_0xa9e5('0x32')](_0x1bb9b3[_0xa9e5('0x32')]);return db['sequelize'][_0xa9e5('0x58')](_0x3658f6[_0xa9e5('0xb3')](),_0x63e3ce);})[_0xa9e5('0x23')](function(_0x35ca83){if(_0x35ca83[_0xa9e5('0x5d')]>0x0)_0x450f1f[_0xa9e5('0x61')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa9e5('0x44')](_0x35ca83,'id'));return db[_0xa9e5('0xb2')]['query'](_0x450f1f[_0xa9e5('0xb3')](),_0x63e3ce)['then'](function(_0x15fd35){var _0x1cca96=_['groupBy'](_0x15fd35,_0xa9e5('0xc2'));var _0x320917=[];_0x35ca83[_0xa9e5('0x48')](function(_0x24b1f8){_0x320917['push'](updateChatInteraction(_0x24b1f8,_0x534bbf,_0x1cca96));});return BPromise['all'](_0x320917);});});})[_0xa9e5('0x23')](function(_0x488eb0){_0x141d65['rows']=_0x488eb0;return _0x141d65;})[_0xa9e5('0x23')](respondWithFilteredResult(_0x27c5e7,_0x1bb9b3))['catch'](handleError(_0x27c5e7,null));};exports[_0xa9e5('0xc3')]=function(_0x4f627a,_0x472a1c){var _0x5f40aa={'raw':![],'where':{'id':_0x4f627a['params']['id']}},_0x3eefb6={};_0x3eefb6[_0xa9e5('0x57')]=_[_0xa9e5('0x59')](db[_0xa9e5('0x54')][_0xa9e5('0xc4')]);_0x3eefb6[_0xa9e5('0x58')]=_['keys'](_0x4f627a[_0xa9e5('0x58')]);_0x3eefb6[_0xa9e5('0x5a')]=_['intersection'](_0x3eefb6[_0xa9e5('0x57')],_0x3eefb6['query']);_0x5f40aa['attributes']=_[_0xa9e5('0xc5')](_0x3eefb6['model'],qs['fields'](_0x4f627a['query'][_0xa9e5('0x5c')]));_0x5f40aa[_0xa9e5('0x5b')]=_0x5f40aa[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0x5f40aa[_0xa9e5('0x5b')]:_0x3eefb6[_0xa9e5('0x57')];if(_0x4f627a[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0x5f40aa[_0xa9e5('0xc7')]=[{'all':!![]}];}_0x5f40aa=_[_0xa9e5('0x3e')]({},_0x5f40aa,_0x4f627a['options']);return db[_0xa9e5('0x54')][_0xa9e5('0x7b')](_0x5f40aa)[_0xa9e5('0x23')](handleEntityNotFound(_0x472a1c,null))[_0xa9e5('0x23')](respondWithResult(_0x472a1c,null))['catch'](handleError(_0x472a1c,null));};exports[_0xa9e5('0xc8')]=function(_0x58ce0e,_0x38f094){return db['ChatInteraction'][_0xa9e5('0xc8')](_0x58ce0e['body'],{})[_0xa9e5('0x23')](respondWithResult(_0x38f094,0xc9))[_0xa9e5('0x2e')](handleError(_0x38f094,null));};exports[_0xa9e5('0x38')]=function(_0x3a06a6,_0x336a54){if(_0x3a06a6[_0xa9e5('0x3f')]['id']){delete _0x3a06a6[_0xa9e5('0x3f')]['id'];}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x3a06a6['params']['id']}})['then'](handleEntityNotFound(_0x336a54,null))['then'](saveUpdates(_0x3a06a6['body'],null))[_0xa9e5('0x23')](respondWithResult(_0x336a54,null))[_0xa9e5('0x2e')](handleError(_0x336a54,null));};exports[_0xa9e5('0xc9')]=function(_0x2135d8,_0x52222e){return db[_0xa9e5('0x54')][_0xa9e5('0x7b')]({'where':{'id':_0x2135d8[_0xa9e5('0xca')]['id']}})['then'](handleEntityNotFound(_0x52222e,null))[_0xa9e5('0x23')](removeEntity(_0x52222e,null))['catch'](handleError(_0x52222e,null));};exports[_0xa9e5('0xcb')]=function(_0x4b5d61,_0x5cc2c3){return db['ChatInteraction'][_0xa9e5('0xcb')]()[_0xa9e5('0x23')](respondWithResult(_0x5cc2c3,null))[_0xa9e5('0x2e')](handleError(_0x5cc2c3,null));};exports['createVidaooSession']=function(_0x422241,_0x5aee5b){var _0x39f653=_0x422241['params']['id'];var _0x2d9183;var _0x396f47;var _0x1c120e;return db['ChatInteraction'][_0xa9e5('0xcc')]({'where':{'id':_0x39f653}})[_0xa9e5('0x23')](function(_0x2f67e3){_0x2d9183=_0x2f67e3;return db['ChatWebsite'][_0xa9e5('0xcc')]({'where':{'id':_0x2f67e3[_0xa9e5('0x8c')]},'attributes':['id',_0xa9e5('0xcd'),_0xa9e5('0xce'),_0xa9e5('0xcf'),_0xa9e5('0xd0'),'vidaooMetadata'],'raw':!![]});})[_0xa9e5('0x23')](function(_0x86c45f){if(_0x86c45f&&_0x86c45f[_0xa9e5('0xcd')]&&_0x86c45f[_0xa9e5('0xce')]){_0x396f47=_0x86c45f;var _0x505491={'interaction':{'id':_0x39f653},'agent':{'id':_0x422241[_0xa9e5('0xae')]['id'],'name':_0x422241[_0xa9e5('0xae')][_0xa9e5('0x3b')],'fullname':_0x422241[_0xa9e5('0xae')][_0xa9e5('0xd1')],'email':_0x422241['user']['email']},'contact':_0x422241[_0xa9e5('0x3f')][_0xa9e5('0x40')],'account':_0x422241['body'][_0xa9e5('0xd2')]};var _0x197b0e={'rejectUnauthorized':![],'method':_0xa9e5('0xd3'),'url':_0xa9e5('0xd4'),'headers':{'X-APIKEY':_0x86c45f[_0xa9e5('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x422241['user']['email']],'buttons':null,'topic':_0x396f47['vidaooTopic'],'note':_[_0xa9e5('0xd5')](_0x396f47[_0xa9e5('0xd0')])?null:getMustacheRender(_0x396f47[_0xa9e5('0xd0')],_0x505491),'metadata':null},'redirect':_0xa9e5('0xd6'),'json':!![]};try{if(!_[_0xa9e5('0xd5')](_0x396f47['vidaooMetadata'])){var _0x592773=getMustacheRender(_0x396f47['vidaooMetadata'],_0x505491);var _0x43604a=JSON[_0xa9e5('0x90')](_0x592773);_0x197b0e[_0xa9e5('0x3f')]['metadata']=_0x43604a;}}catch(_0x413e06){throw new db['Sequelize'][(_0xa9e5('0xd7'))](_0xa9e5('0xd8'));}return rp(_0x197b0e);}else{throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa9e5('0x23')](function(_0x476fbb){_0x1c120e=_0x476fbb;if(_0x1c120e['id']){var _0xddd1e3={'body':_0x1c120e[_0xa9e5('0xd9')],'ChatWebsiteId':_0x396f47['id'],'ChatInteractionId':_0x2d9183['id'],'direction':_0xa9e5('0xda'),'UserId':_0x422241[_0xa9e5('0xae')]['id']};return db['ChatMessage']['create'](_0xddd1e3,{});}else{throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa9e5('0x23')](function(){return _0x2d9183[_0xa9e5('0xdb')]({'vidaooSessionId':_0x1c120e['id']});})['then'](respondWithResult(_0x5aee5b,null))['catch'](handleError(_0x5aee5b,null));};exports[_0xa9e5('0xdc')]=function(_0x190f0f,_0xf4a21a){if(_0x190f0f[_0xa9e5('0x3f')]['id']){delete _0x190f0f[_0xa9e5('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x190f0f[_0xa9e5('0xca')]['id']},'include':[{'model':db[_0xa9e5('0xdd')],'as':_0xa9e5('0x7f')}]})[_0xa9e5('0x23')](handleEntityNotFound(_0xf4a21a,null))[_0xa9e5('0x23')](saveUpdates(_0x190f0f['body'],null))['then'](respondWithResult(_0xf4a21a,null))[_0xa9e5('0x2e')](handleError(_0xf4a21a,null));};exports['abandon']=function(_0x2d91c2,_0x138c54,_0x1f7b39){if(_0x2d91c2[_0xa9e5('0x3f')]['id']){delete _0x2d91c2[_0xa9e5('0x3f')]['id'];}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x2d91c2[_0xa9e5('0xca')]['id']}})['then'](function(_0x4fc516){if(!_0x4fc516){logger[_0xa9e5('0x2a')](_0xa9e5('0xde'),_0xa9e5('0xdf'),0x194,_0xa9e5('0xe0'));_0x138c54['sendStatus'](0x194);}else{if(_0x4fc516[_0xa9e5('0x4c')]){throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))](_0xa9e5('0xe1'));}}return _0x4fc516;})[_0xa9e5('0x23')](function(_0x4a245d){if(_0x4a245d){return _0x4a245d[_0xa9e5('0x38')]({'closed':_0x2d91c2[_0xa9e5('0x3f')][_0xa9e5('0x4e')],'disposition':_0x2d91c2[_0xa9e5('0x3f')][_0xa9e5('0x50')]})['then'](function(_0x567872){return _0x567872;});}})[_0xa9e5('0x23')](function(_0x37e56c){return respondWithRpcPromise('AbandonInteraction',_0xa9e5('0xdf'),_0x2d91c2[_0xa9e5('0x3f')],client9004);})[_0xa9e5('0x23')](respondWithResult(_0x138c54,null))[_0xa9e5('0x2e')](handleError(_0x138c54,null));};exports[_0xa9e5('0xe2')]=function(_0x4ed4dc,_0x548cd0,_0x2f926e){_0x4ed4dc[_0xa9e5('0x3f')][_0xa9e5('0x3b')]=_0x4ed4dc[_0xa9e5('0xe3')]['originalname'];_0x4ed4dc[_0xa9e5('0x3f')][_0xa9e5('0xe4')]=_0x4ed4dc['file'][_0xa9e5('0xe5')];_0x4ed4dc[_0xa9e5('0x3f')]['type']=_0x4ed4dc[_0xa9e5('0xe3')][_0xa9e5('0xe6')];return db[_0xa9e5('0xe7')][_0xa9e5('0xc8')](_0x4ed4dc['body'])[_0xa9e5('0x23')](respondWithResult(_0x548cd0,0xc9))[_0xa9e5('0x2e')](handleError(_0x548cd0,null));};exports[_0xa9e5('0xe8')]=function(_0x4d135b,_0x38806b,_0x12ce70){return db[_0xa9e5('0x54')][_0xa9e5('0xcc')]({'where':{'id':_0x4d135b[_0xa9e5('0xca')]['id']},'raw':!![]})[_0xa9e5('0x23')](handleEntityNotFound(_0x38806b,null))[_0xa9e5('0x23')](function(_0x4153fc){if(_0x4153fc){if(_0x4153fc[_0xa9e5('0x4e')]){return _0x38806b[_0xa9e5('0x30')](0x193)[_0xa9e5('0x31')]({'status':0x193,'message':_0xa9e5('0xe9')});}return db[_0xa9e5('0xe7')][_0xa9e5('0xcc')]({'where':{'id':_0x4d135b[_0xa9e5('0x58')][_0xa9e5('0xea')]},'raw':!![]})[_0xa9e5('0x23')](handleEntityNotFound(_0x38806b,null));}})[_0xa9e5('0x23')](function(_0x2781e9){if(_0x2781e9){var _0x5c087a=_0x2781e9[_0xa9e5('0xeb')]!==null;var _0x40e65f=path['join'](config[_0xa9e5('0xec')],'server/files/attachments/');if(_0x5c087a){_0x40e65f=path[_0xa9e5('0xed')](_0x40e65f,'offline-chat/');}var _0x271069=path[_0xa9e5('0xed')](_0x40e65f,_0x2781e9[_0xa9e5('0xe4')]);return _0x38806b[_0xa9e5('0xee')](_0x271069);}})[_0xa9e5('0x2e')](handleError(_0x38806b,null));};exports[_0xa9e5('0xef')]=function(_0x22ce35,_0x473457){var _0x412307=null;var _0x57ee96=null;var _0x34813e=null;var _0x33d574=null;if(_0x22ce35[_0xa9e5('0x3f')]['id']){delete _0x22ce35['body']['id'];}if(_0x22ce35['body'][_0xa9e5('0xf0')]){_0x33d574=path[_0xa9e5('0xed')](config['root'],_0xa9e5('0xf1'),util['format'](_0xa9e5('0xf2'),Date['now']()));_0x22ce35[_0xa9e5('0x3f')][_0xa9e5('0xf3')]=_0x33d574;}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x22ce35['params']['id']},'include':[{'model':db[_0xa9e5('0xf4')],'as':_0xa9e5('0xf5'),'include':[{'model':db[_0xa9e5('0x88')],'as':_0xa9e5('0x88')}]}]})[_0xa9e5('0x23')](handleEntityNotFound(_0x473457,null))[_0xa9e5('0x23')](saveUpdates(_0x22ce35[_0xa9e5('0x3f')],null))[_0xa9e5('0x23')](function(_0x187f26){if(_0x187f26){_0x412307=_0x187f26;return db[_0xa9e5('0xf6')][_0xa9e5('0x7b')]({'where':{'id':_0x412307['ChatWebsiteId']}});}})[_0xa9e5('0x23')](function(_0x2b731c){if(_0x2b731c){_0x34813e=_0x2b731c;return db[_0xa9e5('0xdd')][_0xa9e5('0x7b')]({'where':{'id':_0x412307[_0xa9e5('0x84')]}});}})[_0xa9e5('0x23')](function(_0x159ca7){if(_0x159ca7){_0x57ee96=_0x159ca7;if(_0x33d574){var _0x3cf2c2=null;for(var _0x1ec62c=0x1;_0x1ec62c<_0x412307[_0xa9e5('0xf5')][_0xa9e5('0x5d')];++_0x1ec62c){_0x3cf2c2=_0x412307[_0xa9e5('0xf5')][_0x1ec62c];var _0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?util[_0xa9e5('0xf7')]('%s%d',_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2['UserId']):_0xa9e5('0xf9');var _0x251fe2=_0x22ce35[_0xa9e5('0x3f')]['customer']||util[_0xa9e5('0xf7')]('%s%d',_0xa9e5('0xfa'),_0x3cf2c2[_0xa9e5('0x84')]);switch(_0x34813e[_0xa9e5('0xfb')]){case _0xa9e5('0xfc'):_0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?util[_0xa9e5('0xf7')](_0xa9e5('0xfd'),_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2[_0xa9e5('0x4c')]):'System';break;case'agent_alias':_0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?_0x3cf2c2['User'][_0xa9e5('0xfe')]||_0x3cf2c2[_0xa9e5('0x88')][_0xa9e5('0xd1')]:'System';break;case _0xa9e5('0xff'):_0x4ab78a=_0x3cf2c2['UserId']?_0x3cf2c2[_0xa9e5('0x88')][_0xa9e5('0xd1')]:_0xa9e5('0xf9');break;default:_0x4ab78a=_0x3cf2c2['UserId']?util['format'](_0xa9e5('0xfd'),_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2[_0xa9e5('0x4c')]):'System';}var _0x4a1468=util[_0xa9e5('0xf7')](_0xa9e5('0x100'),moment(_0x3cf2c2[_0xa9e5('0x8f')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x3cf2c2[_0xa9e5('0x101')]==='in'?_0x251fe2:_0x4ab78a,_0x3cf2c2[_0xa9e5('0x3f')]);if(!_0x3cf2c2[_0xa9e5('0x102')]){fs[_0xa9e5('0x103')](_0x33d574,_0x4a1468);}}return db[_0xa9e5('0x104')][_0xa9e5('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0xa9e5('0x105')],'as':_0xa9e5('0x106'),'raw':!![]}]});}}})[_0xa9e5('0x23')](function(_0x2fd957){if(_0x2fd957&&_0x2fd957['Smtp']&&_0x22ce35[_0xa9e5('0x3f')]){var _0x11dd08={'tls':{'rejectUnauthorized':![]}};if(_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x107')]){_0x11dd08[_0xa9e5('0x107')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x107')];}else{_0x11dd08[_0xa9e5('0x108')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x108')];_0x11dd08[_0xa9e5('0x109')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x109')];_0x11dd08[_0xa9e5('0x10a')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x10a')];}if(_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x10b')]){_0x11dd08[_0xa9e5('0x10c')]={'user':_0x2fd957['Smtp'][_0xa9e5('0xae')],'pass':_0x2fd957['Smtp'][_0xa9e5('0x10d')]};}return respondWithRpcPromise(_0xa9e5('0x10e'),'sendMail',{'account':_0x11dd08,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2fd957[_0xa9e5('0x3b')],_0x2fd957['email']||_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0xae')]),'to':_0x22ce35[_0xa9e5('0x3f')][_0xa9e5('0xf0')],'subject':_0xa9e5('0x10f'),'text':util[_0xa9e5('0xf7')](_0xa9e5('0x110'),_0x22ce35['body'][_0xa9e5('0xf0')]),'attachments':[{'path':_0x33d574}]}})[_0xa9e5('0x23')](function(){return _0x412307;})[_0xa9e5('0x2e')](function(_0x10e7ac){console[_0xa9e5('0x2a')](_0x10e7ac);});}else{return _0x412307;}})[_0xa9e5('0x23')](respondWithStatusCode(_0x473457,0xc8))[_0xa9e5('0x2e')](handleError(_0x473457,null));};exports[_0xa9e5('0x111')]=function(_0x36304e,_0x2e0150,_0x4c9296){return db[_0xa9e5('0xf4')][_0xa9e5('0x7b')]({'where':{'id':_0x36304e[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x2e0150,null))[_0xa9e5('0x23')](function(_0x2ff0e3){if(_0x2ff0e3){return _0x2ff0e3[_0xa9e5('0x111')](_0x36304e['body'][_0xa9e5('0x112')],_[_0xa9e5('0x113')](_0x36304e[_0xa9e5('0x3f')],[_0xa9e5('0x112'),'id'])||{});}})[_0xa9e5('0x23')](respondWithResult(_0x2e0150,null))[_0xa9e5('0x2e')](handleError(_0x2e0150,null));};exports['getMessages']=function(_0x15c12b,_0x1a87f7,_0x1ea1cc){var _0x408e41={'raw':![],'where':{}};var _0xf70e9f={};var _0x391b35={'count':0x0,'rows':[]};return db[_0xa9e5('0x54')]['findOne']({'where':{'id':_0x15c12b[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x1a87f7,null))[_0xa9e5('0x23')](function(_0x1ceaa2){if(_0x1ceaa2){_0xf70e9f['model']=_['keys'](db[_0xa9e5('0xf4')][_0xa9e5('0xc4')]);_0xf70e9f['query']=_[_0xa9e5('0x59')](_0x15c12b[_0xa9e5('0x58')]);_0xf70e9f[_0xa9e5('0x5a')]=_[_0xa9e5('0xc5')](_0xf70e9f['model'],_0xf70e9f[_0xa9e5('0x58')]);_0x408e41[_0xa9e5('0x5b')]=_[_0xa9e5('0xc5')](_0xf70e9f[_0xa9e5('0x57')],qs[_0xa9e5('0x5c')](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x5c')]));_0x408e41[_0xa9e5('0x5b')]=_0x408e41['attributes'][_0xa9e5('0x5d')]?_0x408e41[_0xa9e5('0x5b')]:_0xf70e9f[_0xa9e5('0x57')];if(!_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x114')](_0xa9e5('0x5e'))){_0x408e41[_0xa9e5('0x35')]=qs[_0xa9e5('0x35')](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x35')]);_0x408e41[_0xa9e5('0x32')]=qs['offset'](_0x15c12b['query']['offset']);}_0x408e41[_0xa9e5('0x5f')]=qs['sort'](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x60')]);_0x408e41['where']=qs[_0xa9e5('0x5a')](_['pick'](_0x15c12b['query'],_0xf70e9f[_0xa9e5('0x5a')]));_0x408e41[_0xa9e5('0x61')]['ChatInteractionId']=_0x1ceaa2['id'];if(_0x15c12b[_0xa9e5('0x58')]['filter']){_0x408e41[_0xa9e5('0x61')]=_[_0xa9e5('0x3e')](_0x408e41['where'],{'$or':_[_0xa9e5('0x44')](_0x408e41[_0xa9e5('0x5b')],function(_0x449121){var _0x2c976a={};_0x2c976a[_0x449121]={'$like':'%'+_0x15c12b['query'][_0xa9e5('0x9b')]+'%'};return _0x2c976a;})});}if(_0x15c12b[_0xa9e5('0x58')]['$gte']){var _0x3a7b7b=_0x15c12b[_0xa9e5('0x58')]['$gte']['split'](',');var _0x5cf248={};_0x5cf248[_0x3a7b7b[0x0]]={'$gte':moment(_0x3a7b7b[0x1])[_0xa9e5('0xf7')](_0xa9e5('0x115'))};_0x408e41[_0xa9e5('0x61')]=_[_0xa9e5('0x3e')](_0x408e41['where'],_0x5cf248);}_0x408e41=_[_0xa9e5('0x3e')]({},_0x408e41,_0x15c12b[_0xa9e5('0x116')]);return db[_0xa9e5('0xf4')]['count']({'where':_0x408e41[_0xa9e5('0x61')]})[_0xa9e5('0x23')](function(_0x237439){_0x391b35[_0xa9e5('0x34')]=_0x237439;if(_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0x408e41[_0xa9e5('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xa9e5('0x117')](_0x408e41);})[_0xa9e5('0x23')](function(_0x16061b){_0x391b35[_0xa9e5('0x118')]=_0x16061b;return _0x391b35;});}})['then'](respondWithFilteredResult(_0x1a87f7,_0x408e41))[_0xa9e5('0x2e')](handleError(_0x1a87f7,null));};exports[_0xa9e5('0x119')]=function(_0x3ec150,_0x2a03c2,_0x3b9edb){var _0xe2f2e9={'where':{}},_0x17814e={},_0x3fac9b={'count':0x0,'rows':[]};return db[_0xa9e5('0x54')][_0xa9e5('0xcc')]({'where':{'id':_0x3ec150[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x2a03c2,null))[_0xa9e5('0x23')](function(_0x22c1c0){if(_0x22c1c0){_0x17814e[_0xa9e5('0x57')]=_[_0xa9e5('0x59')](db[_0xa9e5('0xf4')][_0xa9e5('0xc4')]);_0x17814e[_0xa9e5('0x58')]=_[_0xa9e5('0x59')](_0x3ec150['query']);_0x17814e[_0xa9e5('0x5a')]=_['intersection'](_0x17814e[_0xa9e5('0x57')],_0x17814e[_0xa9e5('0x58')]);_0xe2f2e9[_0xa9e5('0x5b')]=_['intersection'](_0x17814e[_0xa9e5('0x57')],qs[_0xa9e5('0x5c')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x5c')]));_0xe2f2e9[_0xa9e5('0x5b')]=_0xe2f2e9[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0xe2f2e9['attributes']:_0x17814e[_0xa9e5('0x57')];if(!_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x114')](_0xa9e5('0x5e'))){_0xe2f2e9['limit']=qs[_0xa9e5('0x35')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x35')]);_0xe2f2e9[_0xa9e5('0x32')]=qs['offset'](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x32')]);}_0xe2f2e9[_0xa9e5('0x5f')]=qs[_0xa9e5('0x60')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x60')]);_0xe2f2e9[_0xa9e5('0x61')]=qs[_0xa9e5('0x5a')](_[_0xa9e5('0x62')](_0x3ec150[_0xa9e5('0x58')],_0x17814e['filters']));_0xe2f2e9[_0xa9e5('0x61')][_0xa9e5('0xc2')]=_0x22c1c0['id'];if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x9b')]){_0xe2f2e9['where']=_['merge'](_0xe2f2e9[_0xa9e5('0x61')],{'$or':_['map'](_0xe2f2e9[_0xa9e5('0x5b')],function(_0x365c19){var _0x2a7345={};_0x2a7345[_0x365c19]={'$like':'%'+_0x3ec150['query']['filter']+'%'};return _0x2a7345;})});}_0xe2f2e9[_0xa9e5('0x61')]['secret']=![];if(_0x3ec150[_0xa9e5('0x58')]['id']){_0xe2f2e9[_0xa9e5('0x61')]['id']={'$gt':_0x3ec150[_0xa9e5('0x58')]['id']};}_0xe2f2e9=_[_0xa9e5('0x3e')]({},_0xe2f2e9,_0x3ec150[_0xa9e5('0x116')]);return db[_0xa9e5('0xf4')][_0xa9e5('0x34')]({'where':_0xe2f2e9[_0xa9e5('0x61')]})['then'](function(_0x18ff5d){_0x3fac9b[_0xa9e5('0x34')]=_0x18ff5d;_0xe2f2e9[_0xa9e5('0xc7')]=[];if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x11a')]){_0xe2f2e9[_0xa9e5('0xc7')][_0xa9e5('0x49')]({'model':db['User'],'as':_0xa9e5('0x88'),'attributes':['id',_0xa9e5('0xd1'),_0xa9e5('0xfe')]});}if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0xe2f2e9[_0xa9e5('0xc7')]=[{'all':!![]}];}return db[_0xa9e5('0xf4')][_0xa9e5('0x117')](_0xe2f2e9);})['then'](function(_0x7ff0f1){_0x3fac9b['rows']=_0x7ff0f1;return _0x3fac9b;});}})[_0xa9e5('0x23')](respondWithFilteredResult(_0x2a03c2,_0xe2f2e9))[_0xa9e5('0x2e')](handleError(_0x2a03c2,null));};exports['addTags']=function(_0x5b1036,_0x27e856,_0x5c1a0f){return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x5b1036['params']['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x27e856,null))[_0xa9e5('0x23')](function(_0x38f9f4){if(_0x38f9f4){return _0x38f9f4[_0xa9e5('0x11b')](_0x5b1036[_0xa9e5('0x3f')][_0xa9e5('0x112')],_['omit'](_0x5b1036['body'],[_0xa9e5('0x112'),'id'])||{})[_0xa9e5('0x11c')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa9e5('0x3b'),_0xa9e5('0x65')],'where':{'id':_0x5b1036[_0xa9e5('0x3f')][_0xa9e5('0x112')]}});})[_0xa9e5('0x23')](function(_0x253924){socket['emit'](_0xa9e5('0x11d'),{'id':Number(_0x5b1036['params']['id']),'tags':_0x253924||[]});return{'id':Number(_0x5b1036['params']['id']),'tags':_0x253924||[]};});}})['then'](respondWithResult(_0x27e856,null))['catch'](handleError(_0x27e856,null));};exports[_0xa9e5('0x11e')]=function(_0x732c5,_0xa27c71,_0x359090){return db[_0xa9e5('0x54')][_0xa9e5('0x7b')]({'where':{'id':_0x732c5[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0xa27c71,null))[_0xa9e5('0x23')](function(_0x374955){if(_0x374955){return _0x374955[_0xa9e5('0x11e')](_0x732c5['query'][_0xa9e5('0x112')]);}})['then'](respondWithStatusCode(_0xa27c71,null))['catch'](handleError(_0xa27c71,null));};exports[_0xa9e5('0xee')]=function(_0x37c939,_0x5e49cd){var _0x394cda=moment()[_0xa9e5('0x11f')]()[_0xa9e5('0xb3')]();var _0x453e81=path[_0xa9e5('0xed')](config['root'],_0xa9e5('0x120'),_0xa9e5('0x121'),_0xa9e5('0x122'));var _0x216f07=path[_0xa9e5('0xed')](config[_0xa9e5('0xec')],_0xa9e5('0x120'),_0xa9e5('0x121'),_0xa9e5('0x123'));var _0x24fef8=path[_0xa9e5('0xed')](_0x453e81,_0x394cda);var _0x2054c7=util[_0xa9e5('0xf7')](_0xa9e5('0x124'),_0x37c939[_0xa9e5('0xca')]['id'],_0x394cda);var _0xec6dbb=path[_0xa9e5('0xed')](_0x453e81,_0x2054c7);var _0x1849f4=[];_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0x88')],'as':_0xa9e5('0x88'),'attributes':['id',_0xa9e5('0xd1')],'raw':!![]});_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xdd')],'as':_0xa9e5('0x7f'),'attributes':['id',_0xa9e5('0x125'),'lastName'],'raw':!![]});if(_0x37c939['query'][_0xa9e5('0x123')]){_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xe7')],'as':_0xa9e5('0xe7'),'raw':!![]});}var _0xe5b2b0=[{'model':db[_0xa9e5('0xf4')],'as':'Messages','attributes':['id',_0xa9e5('0x3f'),_0xa9e5('0x8f'),_0xa9e5('0x101'),_0xa9e5('0x102'),_0xa9e5('0x95')],'include':_0x1849f4}];_0xe5b2b0[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xf6')],'as':_0xa9e5('0x126'),'attributes':['id',_0xa9e5('0x3b')]});_0xe5b2b0[_0xa9e5('0x49')]({'model':db[_0xa9e5('0x88')],'as':'Owner','attributes':['id',_0xa9e5('0xd1')]});return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x37c939['params']['id']},'include':_0xe5b2b0})[_0xa9e5('0x23')](handleEntityNotFound(_0x5e49cd,null))['then'](function(_0x247f89){if(_0x247f89){var _0x15134d=_0x247f89[_0xa9e5('0x127')]({'plain':!![]});fs[_0xa9e5('0x128')](_0x24fef8);var _0x467bc4={'channel':'Chat','account':_0x15134d[_0xa9e5('0x126')][_0xa9e5('0x3b')],'agent':_0x15134d[_0xa9e5('0x129')]?_0x15134d['Owner'][_0xa9e5('0xd1')]:_0xa9e5('0x12a'),'createdAt':moment(_0x15134d[_0xa9e5('0x8f')])[_0xa9e5('0xf7')](_0xa9e5('0x115'))[_0xa9e5('0xb3')](),'closedAt':_0x15134d[_0xa9e5('0x4e')]?moment(_0x15134d[_0xa9e5('0x12b')])[_0xa9e5('0xf7')](_0xa9e5('0x115'))['toString']():'','disposition':_0x15134d[_0xa9e5('0x50')],'chatInfo':{'browser':_0x15134d[_0xa9e5('0x12c')],'os':_0x15134d[_0xa9e5('0x12d')],'referer':_0x15134d['referer'],'customerIp':_0x15134d[_0xa9e5('0x12e')],'customerPort':_0x15134d[_0xa9e5('0x12f')]?_0x15134d['customerPort']:'N.A.'},'messages':_(_0x15134d[_0xa9e5('0xf5')])[_0xa9e5('0x130')]()[_0xa9e5('0x9b')]({'secret':![]})['map'](function(_0x4cda34){if(_0x4cda34[_0xa9e5('0xe7')]){var _0x4c44d3=path[_0xa9e5('0xed')](_0x216f07,_0x4cda34[_0xa9e5('0xe7')][_0xa9e5('0xe4')]);if(fs[_0xa9e5('0x131')](_0x4c44d3)){fs[_0xa9e5('0x132')](_0x4c44d3)[_0xa9e5('0x133')](fs['createWriteStream'](path['join'](_0x24fef8,_0x4cda34[_0xa9e5('0xe7')][_0xa9e5('0xe4')])));}}return{'date':moment(_0x4cda34['createdAt'])[_0xa9e5('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa9e5('0xb3')](),'sender':_0x4cda34[_0xa9e5('0x101')]===_0xa9e5('0xda')?_0x4cda34[_0xa9e5('0x88')]?_0x4cda34['User'][_0xa9e5('0xd1')]:'System':_0x4cda34['Contact']['firstName']+(_0x4cda34[_0xa9e5('0x7f')][_0xa9e5('0x134')]?'\x20'+_0x4cda34['Contact'][_0xa9e5('0x134')]:''),'body':_0x4cda34[_0xa9e5('0xe7')]?_0x4cda34[_0xa9e5('0xe7')]['basename']:_0x4cda34[_0xa9e5('0x3f')],'direction':_0x4cda34[_0xa9e5('0x101')]===_0xa9e5('0xda')?'A':'C','secret':_0x4cda34[_0xa9e5('0x102')],'read':_0x4cda34[_0xa9e5('0x95')],'attachment':_0x4cda34[_0xa9e5('0xe7')]};})[_0xa9e5('0x7c')]()};return ejs[_0xa9e5('0x135')](path[_0xa9e5('0xed')](config[_0xa9e5('0xec')],_0xa9e5('0x120'),_0xa9e5('0x136'),_0xa9e5('0x137')),{'interaction':_0x467bc4})['then'](function(_0x5ad946){var _0x4ff8d7=path[_0xa9e5('0xed')](_0x24fef8,_0xa9e5('0x138')+_0x15134d['id']+'-'+_0x394cda+'.pdf');var _0xb4d2ab={'path':_0x4ff8d7,'channel':_0xa9e5('0x139'),'interactionId':_0x15134d['id']};return pdf[_0xa9e5('0x13a')](_0x5ad946,_0xb4d2ab);})[_0xa9e5('0x23')](function(){return new BPromise(function(_0x3f6e54,_0x5c45d4){zipdir(_0x24fef8,{'saveTo':_0xec6dbb},function(_0x115b23,_0x1454d3){if(_0x115b23)return _0x5c45d4(_0x115b23);return _0x3f6e54(_0x1454d3);});})['then'](function(){return new BPromise(function(_0x303e1c,_0x344cd4){rimraf(_0x24fef8,function(_0x1d21fb){if(_0x1d21fb)_0x344cd4(_0x1d21fb);return _0x303e1c();});});})[_0xa9e5('0x23')](function(){return _0x5e49cd[_0xa9e5('0xee')](_0xec6dbb,_0x2054c7,function(_0xf95535){if(_0xf95535){console[_0xa9e5('0x13b')](_0xa9e5('0x13c'),_0xf95535);}else{fs['unlinkSync'](_0xec6dbb);}});});});}else{return _0x5e49cd[_0xa9e5('0x39')](0xc8);}})[_0xa9e5('0x2e')](handleError(_0x5e49cd,null));}; \ No newline at end of file +var _0xb2b9=['contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','count','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','groupBy','ChatInteractionId','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','abandon','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','secret','includeAgent','spread','Tag','emit','chatInteractionTags:save','removeTags','server','files','attachments','CmContact','firstName','lastName','get','Chat','Account','Owner','closedAt','osName','referer','N.A.','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','render','merge','body','agent','interaction','map','fullname','TagIds','split','forEach','Tags','push','catch','answered','unmanaged','abandoned','total','UserId','waiting','closed','talking','disposition','index','ChatInteraction','rawAttributes','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)'];(function(_0x1bf855,_0xed7250){var _0x1fd120=function(_0x4aefb1){while(--_0x4aefb1){_0x1bf855['push'](_0x1bf855['shift']());}};_0x1fd120(++_0xed7250);}(_0xb2b9,0x1c4));var _0x9b2b=function(_0x1e5dd5,_0x18c0e9){_0x1e5dd5=_0x1e5dd5-0x0;var _0x2af63e=_0xb2b9[_0x1e5dd5];return _0x2af63e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b2b('0x0'));var jsonpatch=require(_0x9b2b('0x1'));var rp=require(_0x9b2b('0x2'));var moment=require(_0x9b2b('0x3'));var BPromise=require(_0x9b2b('0x4'));var Mustache=require(_0x9b2b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9b2b('0x6'));var csv=require(_0x9b2b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b2b('0x8'));var _=require(_0x9b2b('0x9'));var squel=require(_0x9b2b('0xa'));var crypto=require(_0x9b2b('0xb'));var jsforce=require(_0x9b2b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b2b('0x7'));var querystring=require(_0x9b2b('0xd'));var Papa=require(_0x9b2b('0xe'));var Redis=require('ioredis');var authService=require(_0x9b2b('0xf'));var qs=require(_0x9b2b('0x10'));var as=require(_0x9b2b('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x9b2b('0x12'));var logger=require(_0x9b2b('0x13'))(_0x9b2b('0x14'));var utils=require(_0x9b2b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9b2b('0x16'));var db=require(_0x9b2b('0x17'))['db'];config[_0x9b2b('0x18')]=_[_0x9b2b('0x19')](config[_0x9b2b('0x18')],{'host':_0x9b2b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b2b('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x9b2b('0x1b'));var client=jayson['client'][_0x9b2b('0x1c')]({'port':0x232b});var client9004=jayson[_0x9b2b('0x1d')][_0x9b2b('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0xef058a,_0x1a9189,_0x52412b,_0x2ae114){return new BPromise(function(_0x4dfeb9,_0x46960d){var _0x50b194=_0x2ae114||client;return _0x50b194[_0x9b2b('0x1e')](_0xef058a,_0x52412b)[_0x9b2b('0x1f')](function(_0x147630){logger[_0x9b2b('0x20')](_0x9b2b('0x21'),_0x1a9189,_0x9b2b('0x22'));logger[_0x9b2b('0x23')](_0x9b2b('0x24'),_0x1a9189,_0x9b2b('0x22'),JSON[_0x9b2b('0x25')](_0x147630));if(_0x147630[_0x9b2b('0x26')]){if(_0x147630[_0x9b2b('0x26')]['code']===0x1f4){logger[_0x9b2b('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x1a9189,_0x147630[_0x9b2b('0x26')]['message']);return _0x46960d(_0x147630[_0x9b2b('0x26')]['message']);}logger['error'](_0x9b2b('0x21'),_0x1a9189,_0x147630[_0x9b2b('0x26')][_0x9b2b('0x27')]);return _0x4dfeb9(_0x147630[_0x9b2b('0x26')][_0x9b2b('0x27')]);}else{logger['info'](_0x9b2b('0x21'),_0x1a9189,_0x9b2b('0x22'));_0x4dfeb9(_0x147630[_0x9b2b('0x28')]['message']);}})['catch'](function(_0x35a6e0){logger['error'](_0x9b2b('0x21'),_0x1a9189,_0x35a6e0);_0x46960d(_0x35a6e0);});});}function respondWithStatusCode(_0x554b5a,_0x4bc330){_0x4bc330=_0x4bc330||0xcc;return function(_0x1044b9){if(_0x1044b9){return _0x554b5a[_0x9b2b('0x29')](_0x4bc330);}return _0x554b5a[_0x9b2b('0x2a')](_0x4bc330)[_0x9b2b('0x2b')]();};}function respondWithResult(_0x271253,_0x2dde22){_0x2dde22=_0x2dde22||0xc8;return function(_0x2be708){if(_0x2be708){return _0x271253[_0x9b2b('0x2a')](_0x2dde22)[_0x9b2b('0x2c')](_0x2be708);}};}function respondWithFilteredResult(_0x3e0d4b,_0x3cbd1e){return function(_0x2bbe17){if(_0x2bbe17){var _0x35a0fe=typeof _0x3cbd1e['offset']==='undefined'&&typeof _0x3cbd1e[_0x9b2b('0x2d')]===_0x9b2b('0x2e');var _0x1dbb0c=_0x2bbe17['count'];var _0x54c4ee=_0x35a0fe?0x0:_0x3cbd1e[_0x9b2b('0x2f')];var _0x56a8f0=_0x35a0fe?_0x2bbe17['count']:_0x3cbd1e['offset']+_0x3cbd1e[_0x9b2b('0x2d')];var _0xe8ed01;if(_0x56a8f0>=_0x1dbb0c){_0x56a8f0=_0x1dbb0c;_0xe8ed01=0xc8;}else{_0xe8ed01=0xce;}_0x3e0d4b['status'](_0xe8ed01);return _0x3e0d4b[_0x9b2b('0x30')](_0x9b2b('0x31'),_0x54c4ee+'-'+_0x56a8f0+'/'+_0x1dbb0c)['json'](_0x2bbe17);}return null;};}function patchUpdates(_0x3db298){return function(_0x131dcb){try{jsonpatch[_0x9b2b('0x32')](_0x131dcb,_0x3db298,!![]);}catch(_0x13de9a){return BPromise['reject'](_0x13de9a);}return _0x131dcb[_0x9b2b('0x33')]();};}function saveUpdates(_0x20384b,_0x5bbf5d){return function(_0x1d3408){if(_0x1d3408){return _0x1d3408[_0x9b2b('0x34')](_0x20384b)['then'](function(_0xdcf378){return _0xdcf378;});}return null;};}function removeEntity(_0x3432a2,_0x261c8b){return function(_0x3c21e0){if(_0x3c21e0){return _0x3c21e0[_0x9b2b('0x35')]()[_0x9b2b('0x1f')](function(){_0x3432a2[_0x9b2b('0x2a')](0xcc)[_0x9b2b('0x2b')]();});}};}function handleEntityNotFound(_0x2dba3b,_0x272d12){return function(_0x1b9e64){if(!_0x1b9e64){_0x2dba3b[_0x9b2b('0x29')](0x194);}return _0x1b9e64;};}function handleError(_0x51f683,_0x2a57dc){_0x2a57dc=_0x2a57dc||0x1f4;return function(_0x50cac5){logger[_0x9b2b('0x26')](_0x50cac5[_0x9b2b('0x36')]);if(_0x50cac5[_0x9b2b('0x37')]){delete _0x50cac5[_0x9b2b('0x37')];}_0x51f683[_0x9b2b('0x2a')](_0x2a57dc)[_0x9b2b('0x38')](_0x50cac5);};}function getMustacheRender(_0x418e02,_0xb8fa2d){return Mustache[_0x9b2b('0x39')](_0x418e02,_[_0x9b2b('0x3a')](_0xb8fa2d[_0x9b2b('0x3b')],{'contact':_0xb8fa2d['contact'],'message':_0xb8fa2d['message'],'agent':_0xb8fa2d[_0x9b2b('0x3c')],'interaction':_0xb8fa2d[_0x9b2b('0x3d')],'account':_0xb8fa2d['account']}))||'';}function getInteractionUsers(_0x32f6d9,_0x4067c1){return new BPromise(function(_0x4d4740,_0x509462){try{if(_0x4067c1[_0x32f6d9['id']]){_0x32f6d9['Users']=_[_0x9b2b('0x3e')](_0x4067c1[_0x32f6d9['id']],function(_0x4e3733){return{'id':_0x4e3733['id'],'fullname':_0x4e3733[_0x9b2b('0x3f')]};});}}catch(_0x277dbc){_0x509462(_0x277dbc);}_0x4d4740(_0x32f6d9);});}function getInteractionTags(_0x404f42,_0x148170){return new BPromise(function(_0x369b1b,_0x42168f){try{if(_0x404f42[_0x9b2b('0x40')]){_0x404f42['Tags']=[];_0x404f42[_0x9b2b('0x40')][_0x9b2b('0x41')](',')[_0x9b2b('0x42')](function(_0x3f315c){_0x404f42[_0x9b2b('0x43')][_0x9b2b('0x44')](_0x148170[_0x3f315c]);});}delete _0x404f42['TagIds'];}catch(_0x2003b0){_0x42168f(_0x2003b0);}_0x369b1b(_0x404f42);});}function updateChatInteraction(_0xbce19c,_0x29e75b,_0x46576b){return new BPromise(function(_0x1167a9,_0xe459f5){return getInteractionUsers(_0xbce19c,_0x46576b)[_0x9b2b('0x1f')](function(_0x2e6f82){return getInteractionTags(_0x2e6f82,_0x29e75b);})[_0x9b2b('0x1f')](function(_0x2dec08){return getStateInteraction(_0x2dec08);})['then'](function(_0x5d7447){_0x1167a9(_0x5d7447);})[_0x9b2b('0x45')](function(_0x7747dd){_0xe459f5(_0x7747dd);});});}function getStateInteraction(_0x539eb7){return new BPromise(function(_0x599e51){_0x539eb7['waiting']=0x0;_0x539eb7['talking']=0x0;_0x539eb7[_0x9b2b('0x46')]=0x0;_0x539eb7[_0x9b2b('0x47')]=0x0;_0x539eb7[_0x9b2b('0x48')]=0x0;_0x539eb7[_0x9b2b('0x49')]=0x0;if(!_0x539eb7['closed']&&!_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x4b')]+=0x1;}if(!_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x4d')]+=0x1;if(_0x539eb7[_0x9b2b('0x4b')]){_0x539eb7[_0x9b2b('0x4b')]-=0x1;}}if(_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4e')]===_0x9b2b('0x48')){_0x539eb7[_0x9b2b('0x48')]+=0x1;if(_0x539eb7[_0x9b2b('0x4b')]){_0x539eb7[_0x9b2b('0x4b')]-=0x1;}}else if(_0x539eb7[_0x9b2b('0x4c')]&&!_0x539eb7[_0x9b2b('0x4a')]&&_0x539eb7[_0x9b2b('0x4e')]){_0x539eb7[_0x9b2b('0x47')]+=0x1;if(_0x539eb7['waiting']){_0x539eb7['waiting']-=0x1;}}else if(_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x46')]+=0x1;if(_0x539eb7['talking']){_0x539eb7[_0x9b2b('0x4d')]-=0x1;}}_0x539eb7[_0x9b2b('0x49')]+=0x1;_0x599e51(_0x539eb7);});}exports[_0x9b2b('0x4f')]=function(_0x2b7784,_0x2a3702){var _0x757ab2={},_0x7674e={},_0x49ac39={'count':0x0,'rows':[]};var _0x216156=_[_0x9b2b('0x3e')](db[_0x9b2b('0x50')][_0x9b2b('0x51')],function(_0x59a83e){return{'name':_0x59a83e['fieldName'],'type':_0x59a83e[_0x9b2b('0x52')]['key']};});_0x7674e['model']=_[_0x9b2b('0x3e')](_0x216156,_0x9b2b('0x37'));_0x7674e[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x2b7784[_0x9b2b('0x53')]);_0x7674e[_0x9b2b('0x55')]=_['intersection'](_0x7674e[_0x9b2b('0x56')],_0x7674e['query']);_0x757ab2['attributes']=_[_0x9b2b('0x57')](_0x7674e[_0x9b2b('0x56')],qs[_0x9b2b('0x58')](_0x2b7784[_0x9b2b('0x53')]['fields']));_0x757ab2['attributes']=_0x757ab2[_0x9b2b('0x59')]['length']?_0x757ab2[_0x9b2b('0x59')]:_0x7674e['model'];if(!_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x5a')]('nolimit')){_0x757ab2[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0x757ab2['offset']=qs[_0x9b2b('0x2f')](_0x2b7784['query'][_0x9b2b('0x2f')]);}_0x757ab2[_0x9b2b('0x5b')]=qs[_0x9b2b('0x5c')](_0x2b7784['query'][_0x9b2b('0x5c')]);_0x757ab2[_0x9b2b('0x5d')]=qs['filters'](_[_0x9b2b('0x5e')](_0x2b7784[_0x9b2b('0x53')],_0x7674e[_0x9b2b('0x55')]),_0x216156);var _0x6917cb=[];var _0x1070ab=squel[_0x9b2b('0x5f')]()[_0x9b2b('0x60')]('id')[_0x9b2b('0x60')]('name')[_0x9b2b('0x60')](_0x9b2b('0x61'))[_0x9b2b('0x62')]('tools_tags');var _0x348ab2=squel['select']()[_0x9b2b('0x60')](_0x9b2b('0x63'))[_0x9b2b('0x60')](_0x9b2b('0x64'))[_0x9b2b('0x60')](_0x9b2b('0x65'))['from']('user_has_chat_interactions','ui')[_0x9b2b('0x66')](_0x9b2b('0x67'),'u',_0x9b2b('0x68'));var _0x56aa09=squel['select']()[_0x9b2b('0x62')](_0x9b2b('0x69'),'i')['left_join'](_0x9b2b('0x6a'),'c',_0x9b2b('0x6b'))[_0x9b2b('0x66')](_0x9b2b('0x67'),'o','o.id\x20=\x20i.UserId')[_0x9b2b('0x66')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x9b2b('0x66')]('chat_messages','me',_0x9b2b('0x6c'))[_0x9b2b('0x66')]('chat_interaction_has_tags','it',_0x9b2b('0x6d'))[_0x9b2b('0x66')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5d2f65=squel[_0x9b2b('0x6e')]();var _0x3c72f5=[];var _0x58855f=squel['expr']();var _0x43e42b;if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x6f')]){_0x43e42b=as[_0x9b2b('0x70')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x6f')]);var _0x23b5d7=_0x43e42b['sqlOperator'];for(var _0x2b2b48=0x0;_0x2b2b48<_0x43e42b['conditions'][_0x9b2b('0x71')];_0x2b2b48++){var _0xafd71=_0x43e42b[_0x9b2b('0x72')][_0x2b2b48];var _0x26ea67='i';var _0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,['name',_0xafd71['field']]);if(!_0x4f9ac3){switch(_0xafd71['field']){case _0x9b2b('0x74'):if(_0xafd71[_0x9b2b('0x75')]==0x1){_0x56aa09['having']('`'+_0xafd71[_0x9b2b('0x60')]+_0x9b2b('0x76'));}else{_0x56aa09[_0x9b2b('0x77')]('`'+_0xafd71[_0x9b2b('0x60')]+_0x9b2b('0x78'));}break;case _0x9b2b('0x79'):if(_0xafd71[_0x9b2b('0x7a')]===_0x9b2b('0x7b')){if(_0xafd71['value'][_0x9b2b('0x41')]('\x20')[_0x9b2b('0x71')]>0x1){_0x5d2f65[_0x23b5d7](_0x9b2b('0x7c'),qs[_0x9b2b('0x7d')](_0xafd71[_0x9b2b('0x75')]),null);}else{var _0x38da68='%'+_0xafd71[_0x9b2b('0x75')]+'%';_0x5d2f65[_0x23b5d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x38da68,_0x38da68,_0x38da68);}}else{_0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,[_0x9b2b('0x37'),_0x9b2b('0x7e')]);_0xafd71[_0x9b2b('0x60')]=_0x9b2b('0x7e');_0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3[_0x9b2b('0x52')],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x81')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x2b')]);}break;case'Tag':var _0x373d90=_0xafd71[_0x9b2b('0x75')][_0x9b2b('0x41')](',')['map'](function(_0x12087d){return Number(_0x12087d);});_0x373d90[_0x9b2b('0x42')](function(_0x5ed7d0){_0x58855f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ed7d0+',%');});_0x3c72f5=_[_0x9b2b('0x82')](_0x3c72f5,_0x373d90);break;case _0x9b2b('0x83'):if(_0xafd71[_0x9b2b('0x7a')]===_0x9b2b('0x7b')){_0x5d2f65[_0x23b5d7](_0x9b2b('0x84'),'%'+_0xafd71[_0x9b2b('0x75')]+'%',null);}else{_0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,['name',_0x9b2b('0x4a')]);_0xafd71[_0x9b2b('0x60')]=_0x9b2b('0x4a');_0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3['type'],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')]['start'],_0x44205e['value']['end']);}break;case _0x9b2b('0x3b'):_0x44205e=as[_0x9b2b('0x7f')]('me',null,_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e['value'][_0x9b2b('0x81')],_0x44205e['value'][_0x9b2b('0x2b')]);break;}}else{var _0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3[_0x9b2b('0x52')],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x81')],_0x44205e['value']['end']);}}}else{var _0xf6b0be=_(_0x2b7784[_0x9b2b('0x53')])['keys']()[_0x9b2b('0x3e')](function(_0x2d696c){return _[_0x9b2b('0x85')](_0x216156,[_0x9b2b('0x37'),_0x2d696c])?_0x2d696c:undefined;})[_0x9b2b('0x86')]()[_0x9b2b('0x75')]();if(!_[_0x9b2b('0x87')](_0xf6b0be)){_0xf6b0be[_0x9b2b('0x42')](function(_0x2842e4){if(_0x2842e4===_0x9b2b('0x88')){_0x56aa09[_0x9b2b('0x5d')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x2b7784[_0x9b2b('0x53')][_0x2842e4]));}else if(_0x2842e4===_0x9b2b('0x89')){var _0x3d9c09=JSON[_0x9b2b('0x8a')](_0x2b7784[_0x9b2b('0x53')][_0x2842e4])[_0x9b2b('0x8b')];var _0x17efba=JSON[_0x9b2b('0x8a')](_0x2b7784[_0x9b2b('0x53')][_0x2842e4])['$lte'];_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0x8c'),_0x3d9c09,_0x17efba);}else{if(_0x2b7784[_0x9b2b('0x53')][_0x2842e4]==='null'){_0x56aa09[_0x9b2b('0x5d')]('i.'+_0x2842e4+'\x20IS\x20NULL');}else{_0x56aa09[_0x9b2b('0x5d')]('i.'+_0x2842e4+_0x9b2b('0x8d'),_0x2b7784['query'][_0x2842e4]);}}});}if(_0x2b7784['query'][_0x9b2b('0x8e')]){if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x8e')]==0x1){_0x56aa09[_0x9b2b('0x77')](_0x9b2b('0x8f'));}else{_0x56aa09[_0x9b2b('0x77')]('`unreadMessages`\x20>\x200');}}if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')]){_0x3c72f5=_[_0x9b2b('0x91')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')])?_0x2b7784['query'][_0x9b2b('0x90')]:new Array(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')]);_0x3c72f5[_0x9b2b('0x42')](function(_0xb2037f){_0x58855f['or'](_0x9b2b('0x92'),'%,'+_0xb2037f+',%');});}if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x93')]){var _0x3e325=_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x93')][_0x9b2b('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9b2b('0x95')](_0x3e325)){_0x5d2f65['or'](_0x9b2b('0x96'),_0x3e325+'%');}else{_0x5d2f65['or'](_0x9b2b('0x97'),qs[_0x9b2b('0x7d')](_0x3e325))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e325+'%');}}}_0x56aa09[_0x9b2b('0x5d')](_0x5d2f65);_0x56aa09[_0x9b2b('0x98')](_0x9b2b('0x99'));var _0x38d4ba={'type':db[_0x9b2b('0x9a')][_0x9b2b('0x9b')][_0x9b2b('0x9c')],'raw':!![]};var _0x22e32c=_0x56aa09['clone']();_0x22e32c[_0x9b2b('0x60')](_0x9b2b('0x99'));_0x22e32c['field'](_0x9b2b('0x9d'),_0x9b2b('0x74'));if(_0x757ab2[_0x9b2b('0x5b')]){_0x757ab2[_0x9b2b('0x5b')]['forEach'](function(_0x15a3fb){var _0x2b94f2=_0x15a3fb[0x0]===_0x9b2b('0x9e')?_0x15a3fb[0x0]:'i.'+_0x15a3fb[0x0];_0x56aa09[_0x9b2b('0x5b')](_0x2b94f2,_0x15a3fb[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3c72f5)){_0x56aa09[_0x9b2b('0x77')](_0x58855f);_0x22e32c['where'](_0x9b2b('0x9f'),_0x3c72f5);}BPromise['resolve']()[_0x9b2b('0x1f')](function(){if(!_0x43e42b){if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x88')])return;_0x22e32c[_0x9b2b('0x5d')](_0x9b2b('0xa0'));_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0xa0'));return;}if(_0x2b7784['user'][_0x9b2b('0xa1')]!==_0x9b2b('0x3c'))return;return _0x2b7784[_0x9b2b('0xa2')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x9b2b('0x1f')](function(_0x4c79d1){if(_[_0x9b2b('0x87')](_0x4c79d1)){_0x22e32c[_0x9b2b('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0xa3'));}else{_0x22e32c[_0x9b2b('0x5d')](_0x9b2b('0xa4'),_[_0x9b2b('0x3e')](_0x4c79d1,'id'));_0x56aa09['where'](_0x9b2b('0xa4'),_[_0x9b2b('0x3e')](_0x4c79d1,'id'));}});})[_0x9b2b('0x1f')](function(){if(_0x2b7784[_0x9b2b('0xa2')][_0x9b2b('0xa1')]===_0x9b2b('0x3c')&&!_0x43e42b&&!_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x88')])return[];return db['sequelize'][_0x9b2b('0x53')](_0x22e32c[_0x9b2b('0xa5')](),_0x38d4ba);})['then'](function(_0x403eb7){_0x49ac39[_0x9b2b('0xa6')]=_0x403eb7[_0x9b2b('0x71')];if(_0x49ac39[_0x9b2b('0xa6')]===0x0)return[];return db[_0x9b2b('0xa7')][_0x9b2b('0x53')](_0x1070ab[_0x9b2b('0xa5')](),_0x38d4ba)[_0x9b2b('0x1f')](function(_0x265987){_0x6917cb=_[_0x9b2b('0xa8')](_0x265987,'id');_0x38d4ba=_[_0x9b2b('0x3a')](_0x38d4ba,{'model':db[_0x9b2b('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x58')]){_0x757ab2[_0x9b2b('0x59')][_0x9b2b('0x42')](function(_0x1725cf){_0x56aa09['field']('i.'+_0x1725cf);});}else{_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0x9d'),'unreadMessages');_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xa9'),'Account.key');_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xaa'),_0x9b2b('0xab'));_0x56aa09[_0x9b2b('0x60')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x9b2b('0x9e'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xac'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xad'),_0x9b2b('0xae'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xaf'),_0x9b2b('0xb0'));_0x56aa09[_0x9b2b('0x60')]('c.email',_0x9b2b('0xb1'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xb2'),_0x9b2b('0xb3'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xb4'),_0x9b2b('0xb5'));_0x56aa09['field'](_0x9b2b('0xb6'),_0x9b2b('0xb7'));_0x56aa09['field']('o.fullname',_0x9b2b('0xb8'));_0x56aa09[_0x9b2b('0x60')]('o.internal',_0x9b2b('0xb9'));_0x56aa09[_0x9b2b('0x60')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9b2b('0x40'));}if(_0x757ab2[_0x9b2b('0x2d')])_0x56aa09[_0x9b2b('0x2d')](_0x757ab2[_0x9b2b('0x2d')]);if(_0x757ab2[_0x9b2b('0x2f')])_0x56aa09[_0x9b2b('0x2f')](_0x757ab2['offset']);return db[_0x9b2b('0xa7')]['query'](_0x56aa09[_0x9b2b('0xa5')](),_0x38d4ba);})[_0x9b2b('0x1f')](function(_0x4a0a0f){if(_0x4a0a0f[_0x9b2b('0x71')]>0x0)_0x348ab2['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x9b2b('0x3e')](_0x4a0a0f,'id'));return db[_0x9b2b('0xa7')][_0x9b2b('0x53')](_0x348ab2[_0x9b2b('0xa5')](),_0x38d4ba)[_0x9b2b('0x1f')](function(_0x20b53b){var _0x57b442=_[_0x9b2b('0xba')](_0x20b53b,_0x9b2b('0xbb'));var _0x16e221=[];_0x4a0a0f[_0x9b2b('0x42')](function(_0x1e966b){_0x16e221[_0x9b2b('0x44')](updateChatInteraction(_0x1e966b,_0x6917cb,_0x57b442));});return BPromise['all'](_0x16e221);});});})[_0x9b2b('0x1f')](function(_0x2a43ca){_0x49ac39['rows']=_0x2a43ca;return _0x49ac39;})[_0x9b2b('0x1f')](respondWithFilteredResult(_0x2a3702,_0x757ab2))['catch'](handleError(_0x2a3702,null));};exports[_0x9b2b('0xbc')]=function(_0xb2ca56,_0x4c43e8){var _0x84b41c={'raw':![],'where':{'id':_0xb2ca56[_0x9b2b('0xbd')]['id']}},_0xca7059={};_0xca7059[_0x9b2b('0x56')]=_[_0x9b2b('0x54')](db[_0x9b2b('0x50')][_0x9b2b('0x51')]);_0xca7059['query']=_[_0x9b2b('0x54')](_0xb2ca56[_0x9b2b('0x53')]);_0xca7059['filters']=_[_0x9b2b('0x57')](_0xca7059[_0x9b2b('0x56')],_0xca7059[_0x9b2b('0x53')]);_0x84b41c['attributes']=_['intersection'](_0xca7059[_0x9b2b('0x56')],qs['fields'](_0xb2ca56['query']['fields']));_0x84b41c[_0x9b2b('0x59')]=_0x84b41c[_0x9b2b('0x59')][_0x9b2b('0x71')]?_0x84b41c[_0x9b2b('0x59')]:_0xca7059[_0x9b2b('0x56')];if(_0xb2ca56[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0x84b41c[_0x9b2b('0xbf')]=[{'all':!![]}];}_0x84b41c=_[_0x9b2b('0x3a')]({},_0x84b41c,_0xb2ca56[_0x9b2b('0xc0')]);return db[_0x9b2b('0x50')][_0x9b2b('0x73')](_0x84b41c)[_0x9b2b('0x1f')](handleEntityNotFound(_0x4c43e8,null))['then'](respondWithResult(_0x4c43e8,null))[_0x9b2b('0x45')](handleError(_0x4c43e8,null));};exports[_0x9b2b('0xc1')]=function(_0x41944a,_0x1147c3){return db[_0x9b2b('0x50')][_0x9b2b('0xc1')](_0x41944a[_0x9b2b('0x3b')],{})['then'](respondWithResult(_0x1147c3,0xc9))[_0x9b2b('0x45')](handleError(_0x1147c3,null));};exports[_0x9b2b('0x34')]=function(_0xdecf20,_0x4d0b68){if(_0xdecf20[_0x9b2b('0x3b')]['id']){delete _0xdecf20['body']['id'];}return db['ChatInteraction'][_0x9b2b('0x73')]({'where':{'id':_0xdecf20['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x4d0b68,null))[_0x9b2b('0x1f')](saveUpdates(_0xdecf20[_0x9b2b('0x3b')],null))[_0x9b2b('0x1f')](respondWithResult(_0x4d0b68,null))[_0x9b2b('0x45')](handleError(_0x4d0b68,null));};exports[_0x9b2b('0x35')]=function(_0x1cb102,_0x46e6e4){return db[_0x9b2b('0x50')]['find']({'where':{'id':_0x1cb102['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x46e6e4,null))[_0x9b2b('0x1f')](removeEntity(_0x46e6e4,null))[_0x9b2b('0x45')](handleError(_0x46e6e4,null));};exports['describe']=function(_0x1e57b2,_0x41b074){return db[_0x9b2b('0x50')][_0x9b2b('0xc2')]()[_0x9b2b('0x1f')](respondWithResult(_0x41b074,null))['catch'](handleError(_0x41b074,null));};exports[_0x9b2b('0xc3')]=function(_0x35746b,_0x3604ed){var _0x40d978=_0x35746b[_0x9b2b('0xbd')]['id'];var _0x4f8423;var _0x398cc6;var _0x4b8221;return db[_0x9b2b('0x50')][_0x9b2b('0xc4')]({'where':{'id':_0x40d978}})[_0x9b2b('0x1f')](function(_0x15436c){_0x4f8423=_0x15436c;return db[_0x9b2b('0xc5')]['findOne']({'where':{'id':_0x15436c[_0x9b2b('0x88')]},'attributes':['id',_0x9b2b('0xc6'),_0x9b2b('0xc7'),_0x9b2b('0xc8'),_0x9b2b('0xc9'),'vidaooMetadata'],'raw':!![]});})[_0x9b2b('0x1f')](function(_0x34c020){if(_0x34c020&&_0x34c020[_0x9b2b('0xc6')]&&_0x34c020[_0x9b2b('0xc7')]){_0x398cc6=_0x34c020;var _0x16bd6e={'interaction':{'id':_0x40d978},'agent':{'id':_0x35746b[_0x9b2b('0xa2')]['id'],'name':_0x35746b[_0x9b2b('0xa2')]['name'],'fullname':_0x35746b['user'][_0x9b2b('0x3f')],'email':_0x35746b[_0x9b2b('0xa2')][_0x9b2b('0xca')]},'contact':_0x35746b[_0x9b2b('0x3b')][_0x9b2b('0xcb')],'account':_0x35746b[_0x9b2b('0x3b')]['account']};var _0x296702={'rejectUnauthorized':![],'method':_0x9b2b('0xcc'),'url':_0x9b2b('0xcd'),'headers':{'X-APIKEY':_0x34c020['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35746b['user']['email']],'buttons':null,'topic':_0x398cc6[_0x9b2b('0xc8')],'note':_[_0x9b2b('0xce')](_0x398cc6[_0x9b2b('0xc9')])?null:getMustacheRender(_0x398cc6[_0x9b2b('0xc9')],_0x16bd6e),'metadata':null},'redirect':_0x9b2b('0xcf'),'json':!![]};try{if(!_[_0x9b2b('0xce')](_0x398cc6['vidaooMetadata'])){var _0x403c37=getMustacheRender(_0x398cc6[_0x9b2b('0xd0')],_0x16bd6e);var _0x399ce2=JSON['parse'](_0x403c37);_0x296702[_0x9b2b('0x3b')][_0x9b2b('0xd1')]=_0x399ce2;}}catch(_0x2c2cfd){throw new db['Sequelize'][(_0x9b2b('0xd2'))](_0x9b2b('0xd3'));}return rp(_0x296702);}else{throw new db[(_0x9b2b('0x9a'))][(_0x9b2b('0xd2'))](_0x9b2b('0xd4'));}})[_0x9b2b('0x1f')](function(_0x3217e4){_0x4b8221=_0x3217e4;if(_0x4b8221['id']){var _0x18e9d5={'body':_0x4b8221[_0x9b2b('0xd5')],'ChatWebsiteId':_0x398cc6['id'],'ChatInteractionId':_0x4f8423['id'],'direction':_0x9b2b('0xd6'),'UserId':_0x35746b['user']['id']};return db[_0x9b2b('0xd7')][_0x9b2b('0xc1')](_0x18e9d5,{});}else{throw new db[(_0x9b2b('0x9a'))][(_0x9b2b('0xd2'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x9b2b('0x1f')](function(){return _0x4f8423[_0x9b2b('0xd8')]({'vidaooSessionId':_0x4b8221['id']});})[_0x9b2b('0x1f')](respondWithResult(_0x3604ed,null))[_0x9b2b('0x45')](handleError(_0x3604ed,null));};exports[_0x9b2b('0xd9')]=function(_0x2fed56,_0x4698f5){if(_0x2fed56[_0x9b2b('0x3b')]['id']){delete _0x2fed56['body']['id'];}return db[_0x9b2b('0x50')]['find']({'where':{'id':_0x2fed56[_0x9b2b('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x4698f5,null))['then'](saveUpdates(_0x2fed56['body'],null))[_0x9b2b('0x1f')](respondWithResult(_0x4698f5,null))[_0x9b2b('0x45')](handleError(_0x4698f5,null));};exports[_0x9b2b('0xda')]=function(_0x29163f,_0x31e8e2,_0x33940b){if(_0x29163f[_0x9b2b('0x3b')]['id']){delete _0x29163f[_0x9b2b('0x3b')]['id'];}return db['ChatInteraction'][_0x9b2b('0x73')]({'where':{'id':_0x29163f[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](function(_0x1ac214){if(!_0x1ac214){logger[_0x9b2b('0x26')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x9b2b('0xda'),0x194,'entity\x20not\x20found');_0x31e8e2[_0x9b2b('0x29')](0x194);}else{if(_0x1ac214[_0x9b2b('0x4a')]){throw new db[(_0x9b2b('0x9a'))]['ValidationError'](_0x9b2b('0xdb'));}}return _0x1ac214;})[_0x9b2b('0x1f')](function(_0xaee2a6){if(_0xaee2a6){return _0xaee2a6[_0x9b2b('0x34')]({'closed':_0x29163f[_0x9b2b('0x3b')]['closed'],'disposition':_0x29163f['body']['disposition']})['then'](function(_0x5a2ec3){return _0x5a2ec3;});}})[_0x9b2b('0x1f')](function(_0x85fe90){return respondWithRpcPromise('AbandonInteraction',_0x9b2b('0xda'),_0x29163f['body'],client9004);})[_0x9b2b('0x1f')](respondWithResult(_0x31e8e2,null))['catch'](handleError(_0x31e8e2,null));};exports[_0x9b2b('0xdc')]=function(_0x1bfb91,_0x4bd0be,_0x16ff41){_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0x37')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xde')];_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0xdf')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xe0')];_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0x52')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xe1')];return db[_0x9b2b('0xe2')][_0x9b2b('0xc1')](_0x1bfb91[_0x9b2b('0x3b')])['then'](respondWithResult(_0x4bd0be,0xc9))[_0x9b2b('0x45')](handleError(_0x4bd0be,null));};exports['attachmentDownload']=function(_0x4317ce,_0x2025fb,_0x5c66d9){return db['ChatInteraction']['findOne']({'where':{'id':_0x4317ce[_0x9b2b('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2025fb,null))[_0x9b2b('0x1f')](function(_0x3f793a){if(_0x3f793a){if(_0x3f793a[_0x9b2b('0x4c')]){return _0x2025fb['status'](0x193)[_0x9b2b('0x2c')]({'status':0x193,'message':_0x9b2b('0xe3')});}return db['Attachment'][_0x9b2b('0xc4')]({'where':{'id':_0x4317ce[_0x9b2b('0x53')][_0x9b2b('0xe4')]},'raw':!![]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x2025fb,null));}})[_0x9b2b('0x1f')](function(_0x4653f5){if(_0x4653f5){var _0x4a0a0a=_0x4653f5[_0x9b2b('0xe5')]!==null;var _0x246f80=path[_0x9b2b('0xe6')](config['root'],_0x9b2b('0xe7'));if(_0x4a0a0a){_0x246f80=path[_0x9b2b('0xe6')](_0x246f80,_0x9b2b('0xe8'));}var _0x323944=path['join'](_0x246f80,_0x4653f5['basename']);return _0x2025fb[_0x9b2b('0xe9')](_0x323944);}})[_0x9b2b('0x45')](handleError(_0x2025fb,null));};exports['close']=function(_0x4bd1b6,_0x301c8e){var _0x503573=null;var _0x1f8714=null;var _0x3072a8=null;var _0x3d9ad4=null;if(_0x4bd1b6[_0x9b2b('0x3b')]['id']){delete _0x4bd1b6['body']['id'];}if(_0x4bd1b6[_0x9b2b('0x3b')][_0x9b2b('0xea')]){_0x3d9ad4=path['join'](config[_0x9b2b('0xeb')],_0x9b2b('0xec'),util[_0x9b2b('0xed')]('transcript-%s.txt',Date[_0x9b2b('0xee')]()));_0x4bd1b6[_0x9b2b('0x3b')]['pathTranscript']=_0x3d9ad4;}return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x4bd1b6[_0x9b2b('0xbd')]['id']},'include':[{'model':db[_0x9b2b('0xd7')],'as':'Messages','include':[{'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83')}]}]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x301c8e,null))[_0x9b2b('0x1f')](saveUpdates(_0x4bd1b6[_0x9b2b('0x3b')],null))['then'](function(_0x1b1261){if(_0x1b1261){_0x503573=_0x1b1261;return db[_0x9b2b('0xc5')][_0x9b2b('0x73')]({'where':{'id':_0x503573['ChatWebsiteId']}});}})[_0x9b2b('0x1f')](function(_0x1bb199){if(_0x1bb199){_0x3072a8=_0x1bb199;return db['CmContact']['find']({'where':{'id':_0x503573[_0x9b2b('0x7e')]}});}})[_0x9b2b('0x1f')](function(_0x107b50){if(_0x107b50){_0x1f8714=_0x107b50;if(_0x3d9ad4){var _0x2d35bf=null;for(var _0x4a9949=0x1;_0x4a9949<_0x503573[_0x9b2b('0xef')][_0x9b2b('0x71')];++_0x4a9949){_0x2d35bf=_0x503573[_0x9b2b('0xef')][_0x4a9949];var _0x149183=_0x2d35bf['UserId']?util[_0x9b2b('0xed')](_0x9b2b('0xf0'),_0x3072a8[_0x9b2b('0xf1')],_0x2d35bf[_0x9b2b('0x4a')]):_0x9b2b('0xf2');var _0x3a8dcc=_0x4bd1b6[_0x9b2b('0x3b')][_0x9b2b('0xf3')]||util[_0x9b2b('0xed')](_0x9b2b('0xf0'),_0x9b2b('0xf4'),_0x2d35bf[_0x9b2b('0x7e')]);switch(_0x3072a8[_0x9b2b('0xf5')]){case _0x9b2b('0xf6'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?util['format'](_0x9b2b('0xf0'),_0x3072a8[_0x9b2b('0xf1')],_0x2d35bf[_0x9b2b('0x4a')]):'System';break;case _0x9b2b('0xf7'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0xf8')]||_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0x3f')]:_0x9b2b('0xf2');break;case _0x9b2b('0xf9'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0x3f')]:_0x9b2b('0xf2');break;default:_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?util[_0x9b2b('0xed')]('%s%d',_0x3072a8['agentAlias'],_0x2d35bf[_0x9b2b('0x4a')]):_0x9b2b('0xf2');}var _0x12b9eb=util[_0x9b2b('0xed')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2d35bf[_0x9b2b('0x89')])['format'](_0x9b2b('0xfa')),_0x2d35bf[_0x9b2b('0xfb')]==='in'?_0x3a8dcc:_0x149183,_0x2d35bf[_0x9b2b('0x3b')]);if(!_0x2d35bf['secret']){fs[_0x9b2b('0xfc')](_0x3d9ad4,_0x12b9eb);}}return db[_0x9b2b('0xfd')][_0x9b2b('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x9b2b('0xfe'),'raw':!![]}]});}}})[_0x9b2b('0x1f')](function(_0x38eb91){if(_0x38eb91&&_0x38eb91['Smtp']&&_0x4bd1b6[_0x9b2b('0x3b')]){var _0xc21c6b={'tls':{'rejectUnauthorized':![]}};if(_0x38eb91[_0x9b2b('0xfe')]['service']){_0xc21c6b['service']=_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0xff')];}else{_0xc21c6b[_0x9b2b('0x100')]=_0x38eb91['Smtp']['host'];_0xc21c6b[_0x9b2b('0x101')]=_0x38eb91['Smtp'][_0x9b2b('0x101')];_0xc21c6b['secure']=_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x102')];}if(_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x103')]){_0xc21c6b['auth']={'user':_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0xa2')],'pass':_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x104')]};}return respondWithRpcPromise(_0x9b2b('0x105'),_0x9b2b('0x106'),{'account':_0xc21c6b,'message':{'from':util[_0x9b2b('0xed')]('\x22%s\x22\x20<%s>',_0x38eb91[_0x9b2b('0x37')],_0x38eb91[_0x9b2b('0xca')]||_0x38eb91[_0x9b2b('0xfe')]['user']),'to':_0x4bd1b6['body'][_0x9b2b('0xea')],'subject':_0x9b2b('0x107'),'text':util[_0x9b2b('0xed')](_0x9b2b('0x108'),_0x4bd1b6['body'][_0x9b2b('0xea')]),'attachments':[{'path':_0x3d9ad4}]}})[_0x9b2b('0x1f')](function(){return _0x503573;})[_0x9b2b('0x45')](function(_0x36b0c8){console[_0x9b2b('0x26')](_0x36b0c8);});}else{return _0x503573;}})[_0x9b2b('0x1f')](respondWithStatusCode(_0x301c8e,0xc8))[_0x9b2b('0x45')](handleError(_0x301c8e,null));};exports[_0x9b2b('0x109')]=function(_0x20a0f8,_0x5ca7b9,_0xc99354){return db[_0x9b2b('0xd7')][_0x9b2b('0x73')]({'where':{'id':_0x20a0f8[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x5ca7b9,null))[_0x9b2b('0x1f')](function(_0x18a5f0){if(_0x18a5f0){return _0x18a5f0['addMessage'](_0x20a0f8[_0x9b2b('0x3b')][_0x9b2b('0x10a')],_[_0x9b2b('0x10b')](_0x20a0f8[_0x9b2b('0x3b')],[_0x9b2b('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x5ca7b9,null))[_0x9b2b('0x45')](handleError(_0x5ca7b9,null));};exports['getMessages']=function(_0x2b8438,_0x625367,_0x4ac1fe){var _0xbf645={'raw':![],'where':{}};var _0x413bf2={};var _0x594652={'count':0x0,'rows':[]};return db[_0x9b2b('0x50')]['findOne']({'where':{'id':_0x2b8438['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x625367,null))['then'](function(_0x2839e1){if(_0x2839e1){_0x413bf2['model']=_[_0x9b2b('0x54')](db[_0x9b2b('0xd7')][_0x9b2b('0x51')]);_0x413bf2[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x2b8438[_0x9b2b('0x53')]);_0x413bf2['filters']=_['intersection'](_0x413bf2['model'],_0x413bf2['query']);_0xbf645[_0x9b2b('0x59')]=_[_0x9b2b('0x57')](_0x413bf2[_0x9b2b('0x56')],qs[_0x9b2b('0x58')](_0x2b8438[_0x9b2b('0x53')]['fields']));_0xbf645['attributes']=_0xbf645[_0x9b2b('0x59')][_0x9b2b('0x71')]?_0xbf645[_0x9b2b('0x59')]:_0x413bf2[_0x9b2b('0x56')];if(!_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x5a')](_0x9b2b('0x10c'))){_0xbf645[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0xbf645[_0x9b2b('0x2f')]=qs[_0x9b2b('0x2f')](_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x2f')]);}_0xbf645[_0x9b2b('0x5b')]=qs[_0x9b2b('0x5c')](_0x2b8438[_0x9b2b('0x53')]['sort']);_0xbf645[_0x9b2b('0x5d')]=qs[_0x9b2b('0x55')](_[_0x9b2b('0x5e')](_0x2b8438['query'],_0x413bf2[_0x9b2b('0x55')]));_0xbf645[_0x9b2b('0x5d')]['ChatInteractionId']=_0x2839e1['id'];if(_0x2b8438['query'][_0x9b2b('0x93')]){_0xbf645[_0x9b2b('0x5d')]=_[_0x9b2b('0x3a')](_0xbf645[_0x9b2b('0x5d')],{'$or':_['map'](_0xbf645[_0x9b2b('0x59')],function(_0x5d8a41){var _0x47266e={};_0x47266e[_0x5d8a41]={'$like':'%'+_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x93')]+'%'};return _0x47266e;})});}if(_0x2b8438[_0x9b2b('0x53')]['$gte']){var _0x5a1b92=_0x2b8438['query'][_0x9b2b('0x8b')]['split'](',');var _0x5e46a9={};_0x5e46a9[_0x5a1b92[0x0]]={'$gte':moment(_0x5a1b92[0x1])[_0x9b2b('0xed')](_0x9b2b('0x10d'))};_0xbf645['where']=_[_0x9b2b('0x3a')](_0xbf645[_0x9b2b('0x5d')],_0x5e46a9);}_0xbf645=_[_0x9b2b('0x3a')]({},_0xbf645,_0x2b8438[_0x9b2b('0xc0')]);return db['ChatMessage'][_0x9b2b('0xa6')]({'where':_0xbf645['where']})[_0x9b2b('0x1f')](function(_0x8b8174){_0x594652[_0x9b2b('0xa6')]=_0x8b8174;if(_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0xbf645['include']=[{'all':!![]}];}return db[_0x9b2b('0xd7')][_0x9b2b('0x10e')](_0xbf645);})[_0x9b2b('0x1f')](function(_0x3cb18f){_0x594652[_0x9b2b('0x10f')]=_0x3cb18f;return _0x594652;});}})['then'](respondWithFilteredResult(_0x625367,_0xbf645))[_0x9b2b('0x45')](handleError(_0x625367,null));};exports[_0x9b2b('0x110')]=function(_0x573aa6,_0x1ee949,_0x57ebff){var _0x4b703e={'where':{}},_0x46e3da={},_0x2155c7={'count':0x0,'rows':[]};return db[_0x9b2b('0x50')]['findOne']({'where':{'id':_0x573aa6[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x1ee949,null))[_0x9b2b('0x1f')](function(_0x428629){if(_0x428629){_0x46e3da[_0x9b2b('0x56')]=_[_0x9b2b('0x54')](db['ChatMessage'][_0x9b2b('0x51')]);_0x46e3da[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x573aa6['query']);_0x46e3da['filters']=_[_0x9b2b('0x57')](_0x46e3da[_0x9b2b('0x56')],_0x46e3da[_0x9b2b('0x53')]);_0x4b703e[_0x9b2b('0x59')]=_[_0x9b2b('0x57')](_0x46e3da['model'],qs['fields'](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x58')]));_0x4b703e['attributes']=_0x4b703e['attributes']['length']?_0x4b703e['attributes']:_0x46e3da[_0x9b2b('0x56')];if(!_0x573aa6[_0x9b2b('0x53')]['hasOwnProperty'](_0x9b2b('0x10c'))){_0x4b703e[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0x4b703e['offset']=qs[_0x9b2b('0x2f')](_0x573aa6[_0x9b2b('0x53')]['offset']);}_0x4b703e['order']=qs[_0x9b2b('0x5c')](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x5c')]);_0x4b703e['where']=qs[_0x9b2b('0x55')](_['pick'](_0x573aa6[_0x9b2b('0x53')],_0x46e3da[_0x9b2b('0x55')]));_0x4b703e[_0x9b2b('0x5d')][_0x9b2b('0xbb')]=_0x428629['id'];if(_0x573aa6[_0x9b2b('0x53')]['filter']){_0x4b703e[_0x9b2b('0x5d')]=_[_0x9b2b('0x3a')](_0x4b703e[_0x9b2b('0x5d')],{'$or':_['map'](_0x4b703e[_0x9b2b('0x59')],function(_0x555f5f){var _0x2ec2ec={};_0x2ec2ec[_0x555f5f]={'$like':'%'+_0x573aa6['query'][_0x9b2b('0x93')]+'%'};return _0x2ec2ec;})});}_0x4b703e[_0x9b2b('0x5d')][_0x9b2b('0x111')]=![];if(_0x573aa6[_0x9b2b('0x53')]['id']){_0x4b703e['where']['id']={'$gt':_0x573aa6[_0x9b2b('0x53')]['id']};}_0x4b703e=_[_0x9b2b('0x3a')]({},_0x4b703e,_0x573aa6[_0x9b2b('0xc0')]);return db[_0x9b2b('0xd7')]['count']({'where':_0x4b703e[_0x9b2b('0x5d')]})[_0x9b2b('0x1f')](function(_0x574a32){_0x2155c7[_0x9b2b('0xa6')]=_0x574a32;_0x4b703e['include']=[];if(_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x112')]){_0x4b703e[_0x9b2b('0xbf')][_0x9b2b('0x44')]({'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83'),'attributes':['id',_0x9b2b('0x3f'),_0x9b2b('0xf8')]});}if(_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0x4b703e[_0x9b2b('0xbf')]=[{'all':!![]}];}return db[_0x9b2b('0xd7')]['findAll'](_0x4b703e);})[_0x9b2b('0x1f')](function(_0x223865){_0x2155c7['rows']=_0x223865;return _0x2155c7;});}})[_0x9b2b('0x1f')](respondWithFilteredResult(_0x1ee949,_0x4b703e))[_0x9b2b('0x45')](handleError(_0x1ee949,null));};exports['addTags']=function(_0x448574,_0x3a9cb8,_0x4cc1f6){return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x448574['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x3a9cb8,null))[_0x9b2b('0x1f')](function(_0x105265){if(_0x105265){return _0x105265['setTags'](_0x448574[_0x9b2b('0x3b')][_0x9b2b('0x10a')],_['omit'](_0x448574[_0x9b2b('0x3b')],[_0x9b2b('0x10a'),'id'])||{})[_0x9b2b('0x113')](function(){return db[_0x9b2b('0x114')]['findAll']({'attributes':['id','name',_0x9b2b('0x61')],'where':{'id':_0x448574[_0x9b2b('0x3b')]['ids']}});})['then'](function(_0x4ee495){socket[_0x9b2b('0x115')](_0x9b2b('0x116'),{'id':Number(_0x448574[_0x9b2b('0xbd')]['id']),'tags':_0x4ee495||[]});return{'id':Number(_0x448574['params']['id']),'tags':_0x4ee495||[]};});}})[_0x9b2b('0x1f')](respondWithResult(_0x3a9cb8,null))['catch'](handleError(_0x3a9cb8,null));};exports['removeTags']=function(_0x34b3f9,_0x1ed58f,_0x631743){return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x34b3f9[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x1ed58f,null))['then'](function(_0x439a5e){if(_0x439a5e){return _0x439a5e[_0x9b2b('0x117')](_0x34b3f9[_0x9b2b('0x53')]['ids']);}})[_0x9b2b('0x1f')](respondWithStatusCode(_0x1ed58f,null))[_0x9b2b('0x45')](handleError(_0x1ed58f,null));};exports[_0x9b2b('0xe9')]=function(_0x37321f,_0x42dc53){var _0x24a87a=moment()['unix']()[_0x9b2b('0xa5')]();var _0x72f048=path[_0x9b2b('0xe6')](config[_0x9b2b('0xeb')],_0x9b2b('0x118'),_0x9b2b('0x119'),'tmp');var _0xd8ab94=path['join'](config[_0x9b2b('0xeb')],_0x9b2b('0x118'),_0x9b2b('0x119'),_0x9b2b('0x11a'));var _0x193f15=path[_0x9b2b('0xe6')](_0x72f048,_0x24a87a);var _0x147dec=util[_0x9b2b('0xed')]('transcript-%d-%s.zip',_0x37321f[_0x9b2b('0xbd')]['id'],_0x24a87a);var _0x2c6f0c=path[_0x9b2b('0xe6')](_0x72f048,_0x147dec);var _0xf9b24b=[];_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83'),'attributes':['id',_0x9b2b('0x3f')],'raw':!![]});_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0x11b')],'as':_0x9b2b('0x79'),'attributes':['id',_0x9b2b('0x11c'),_0x9b2b('0x11d')],'raw':!![]});if(_0x37321f[_0x9b2b('0x53')][_0x9b2b('0x11a')]){_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0xe2')],'as':_0x9b2b('0xe2'),'raw':!![]});}var _0x20868c=[{'model':db[_0x9b2b('0xd7')],'as':'Messages','attributes':['id',_0x9b2b('0x3b'),'createdAt',_0x9b2b('0xfb'),'secret',_0x9b2b('0x8e')],'include':_0xf9b24b}];_0x20868c['push']({'model':db[_0x9b2b('0xc5')],'as':'Account','attributes':['id',_0x9b2b('0x37')]});_0x20868c[_0x9b2b('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0x9b2b('0x3f')]});return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x37321f[_0x9b2b('0xbd')]['id']},'include':_0x20868c})['then'](handleEntityNotFound(_0x42dc53,null))[_0x9b2b('0x1f')](function(_0x11c2d6){if(_0x11c2d6){var _0xabb55=_0x11c2d6[_0x9b2b('0x11e')]({'plain':!![]});fs['mkdirSync'](_0x193f15);var _0x31ee52={'channel':_0x9b2b('0x11f'),'account':_0xabb55[_0x9b2b('0x120')][_0x9b2b('0x37')],'agent':_0xabb55[_0x9b2b('0x121')]?_0xabb55[_0x9b2b('0x121')][_0x9b2b('0x3f')]:'N.A.','createdAt':moment(_0xabb55[_0x9b2b('0x89')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))['toString'](),'closedAt':_0xabb55['closed']?moment(_0xabb55[_0x9b2b('0x122')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))['toString']():'','disposition':_0xabb55[_0x9b2b('0x4e')],'chatInfo':{'browser':_0xabb55['browserName'],'os':_0xabb55[_0x9b2b('0x123')],'referer':_0xabb55[_0x9b2b('0x124')],'customerIp':_0xabb55['customerIp'],'customerPort':_0xabb55['customerPort']?_0xabb55['customerPort']:_0x9b2b('0x125')},'messages':_(_0xabb55['Messages'])[_0x9b2b('0x126')]()[_0x9b2b('0x93')]({'secret':![]})['map'](function(_0x49e2aa){if(_0x49e2aa[_0x9b2b('0xe2')]){var _0x26b1af=path[_0x9b2b('0xe6')](_0xd8ab94,_0x49e2aa[_0x9b2b('0xe2')][_0x9b2b('0xdf')]);if(fs[_0x9b2b('0x127')](_0x26b1af)){fs[_0x9b2b('0x128')](_0x26b1af)[_0x9b2b('0x129')](fs['createWriteStream'](path['join'](_0x193f15,_0x49e2aa[_0x9b2b('0xe2')][_0x9b2b('0xdf')])));}}return{'date':moment(_0x49e2aa[_0x9b2b('0x89')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))[_0x9b2b('0xa5')](),'sender':_0x49e2aa[_0x9b2b('0xfb')]==='out'?_0x49e2aa[_0x9b2b('0x83')]?_0x49e2aa['User']['fullname']:'System':_0x49e2aa['Contact']['firstName']+(_0x49e2aa[_0x9b2b('0x79')][_0x9b2b('0x11d')]?'\x20'+_0x49e2aa[_0x9b2b('0x79')]['lastName']:''),'body':_0x49e2aa[_0x9b2b('0xe2')]?_0x49e2aa[_0x9b2b('0xe2')]['basename']:_0x49e2aa[_0x9b2b('0x3b')],'direction':_0x49e2aa[_0x9b2b('0xfb')]==='out'?'A':'C','secret':_0x49e2aa[_0x9b2b('0x111')],'read':_0x49e2aa[_0x9b2b('0x8e')],'attachment':_0x49e2aa[_0x9b2b('0xe2')]};})[_0x9b2b('0x75')]()};return ejs[_0x9b2b('0x12a')](path[_0x9b2b('0xe6')](config['root'],'server',_0x9b2b('0x12b'),_0x9b2b('0x12c')),{'interaction':_0x31ee52})['then'](function(_0x395eb9){var _0x3fdac5=path[_0x9b2b('0xe6')](_0x193f15,_0x9b2b('0x12d')+_0xabb55['id']+'-'+_0x24a87a+_0x9b2b('0x12e'));var _0x54ccf4={'path':_0x3fdac5,'channel':_0x9b2b('0x11f'),'interactionId':_0xabb55['id']};return pdf['createPdfFromHTML'](_0x395eb9,_0x54ccf4);})[_0x9b2b('0x1f')](function(){return new BPromise(function(_0x2f3215,_0x5150f3){zipdir(_0x193f15,{'saveTo':_0x2c6f0c},function(_0x47c404,_0x244d8a){if(_0x47c404)return _0x5150f3(_0x47c404);return _0x2f3215(_0x244d8a);});})['then'](function(){return new BPromise(function(_0x1b0fea,_0x48c0c0){rimraf(_0x193f15,function(_0x164d14){if(_0x164d14)_0x48c0c0(_0x164d14);return _0x1b0fea();});});})['then'](function(){return _0x42dc53[_0x9b2b('0xe9')](_0x2c6f0c,_0x147dec,function(_0x535758){if(_0x535758){console[_0x9b2b('0x12f')]('err',_0x535758);}else{fs[_0x9b2b('0x130')](_0x2c6f0c);}});});});}else{return _0x42dc53[_0x9b2b('0x29')](0xc8);}})[_0x9b2b('0x45')](handleError(_0x42dc53,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2bdb426..955011a 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2005=['emit','catch','hook','exports','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll','unreadMessages'];(function(_0x3be492,_0x239dbb){var _0x2c65c1=function(_0x283a46){while(--_0x283a46){_0x3be492['push'](_0x3be492['shift']());}};_0x2c65c1(++_0x239dbb);}(_0x2005,0x16c));var _0x5200=function(_0x493b70,_0x168e73){_0x493b70=_0x493b70-0x0;var _0x4c2355=_0x2005[_0x493b70];return _0x4c2355;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x5200('0x0')];var ChatMessage=require(_0x5200('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5200('0x2')](0x0);var events={'afterCreate':_0x5200('0x3'),'afterUpdate':_0x5200('0x4'),'afterDestroy':_0x5200('0x5')};function emitEvent(_0x14a243){return function(_0x193b20,_0x20ca28,_0x3ffbbc){_0x193b20['getUsers']({'attributes':['id'],'raw':!![]})[_0x5200('0x6')](function(_0x1a0739){_0x193b20[_0x5200('0x7')](_0x5200('0x8'),_0x1a0739['map'](function(_0x3f33d1){return{'id':_0x3f33d1['id']};}));return ChatMessage[_0x5200('0x9')]({'where':{'ChatInteractionId':_0x193b20['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5200('0x6')](function(_0x362977){_0x193b20[_0x5200('0x7')](_0x5200('0xa'),_0x362977['length']);ChatInteractionEvents[_0x5200('0xb')](_0x14a243+':'+_0x193b20['id'],_0x193b20);ChatInteractionEvents[_0x5200('0xb')](_0x14a243,_0x193b20);_0x3ffbbc(null);})[_0x5200('0xc')](_0x3ffbbc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5200('0xd')](e,emitEvent(event));}}module[_0x5200('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x9090=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x9090,0xa8));var _0x0909=function(_0x37deac,_0x5c291e){_0x37deac=_0x37deac-0x0;var _0x31fa76=_0x9090[_0x37deac];return _0x31fa76;};'use strict';var EventEmitter=require(_0x0909('0x0'));var ChatInteraction=require(_0x0909('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x0909('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0909('0x2')](0x0);var events={'afterCreate':_0x0909('0x3'),'afterUpdate':_0x0909('0x4'),'afterDestroy':_0x0909('0x5')};function emitEvent(_0x39cae1){return function(_0xf83cb6,_0x48480a,_0x1f8157){_0xf83cb6['getUsers']({'attributes':['id'],'raw':!![]})[_0x0909('0x6')](function(_0x526f44){_0xf83cb6[_0x0909('0x7')](_0x0909('0x8'),_0x526f44[_0x0909('0x9')](function(_0x26b0ae){return{'id':_0x26b0ae['id']};}));return ChatMessage[_0x0909('0xa')]({'where':{'ChatInteractionId':_0xf83cb6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0909('0x6')](function(_0x9cfcad){_0xf83cb6['setDataValue'](_0x0909('0xb'),_0x9cfcad[_0x0909('0xc')]);ChatInteractionEvents[_0x0909('0xd')](_0x39cae1+':'+_0xf83cb6['id'],_0xf83cb6);ChatInteractionEvents[_0x0909('0xd')](_0x39cae1,_0xf83cb6);_0x1f8157(null);})[_0x0909('0xe')](_0x1f8157(null));};}for(var e in events){if(events[_0x0909('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x0909('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 36008f8..d02f27f 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed65=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2f4f8f,_0x4394ce){var _0x2b01a1=function(_0x4ee5e6){while(--_0x4ee5e6){_0x2f4f8f['push'](_0x2f4f8f['shift']());}};_0x2b01a1(++_0x4394ce);}(_0xed65,0x8a));var _0x5ed6=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0xed65[_0x24b852];return _0x180ad2;};'use strict';var _=require(_0x5ed6('0x0'));var util=require(_0x5ed6('0x1'));var logger=require(_0x5ed6('0x2'))('api');var moment=require(_0x5ed6('0x3'));var BPromise=require(_0x5ed6('0x4'));var rp=require(_0x5ed6('0x5'));var fs=require('fs');var path=require(_0x5ed6('0x6'));var rimraf=require(_0x5ed6('0x7'));var config=require(_0x5ed6('0x8'));var attributes=require(_0x5ed6('0x9'));module[_0x5ed6('0xa')]=function(_0x4bd85a,_0x1fa8c8){return _0x4bd85a[_0x5ed6('0xb')]('ChatInteraction',attributes,{'tableName':_0x5ed6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b4a02,_0x1e6d6f,_0x2c85c2){if(_0x4b4a02[_0x5ed6('0xd')](_0x5ed6('0xe'))){_0x4b4a02[_0x5ed6('0xf')]=moment()[_0x5ed6('0x10')](_0x5ed6('0x11'));}_0x2c85c2(null,_0x4b4a02);}},'charset':_0x5ed6('0x12'),'collate':_0x5ed6('0x13')});}; \ No newline at end of file +var _0xad80=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed'];(function(_0x1c1259,_0x2db8ee){var _0x1dab5c=function(_0x5d2670){while(--_0x5d2670){_0x1c1259['push'](_0x1c1259['shift']());}};_0x1dab5c(++_0x2db8ee);}(_0xad80,0x1c5));var _0x0ad8=function(_0x4c04ba,_0xa9637c){_0x4c04ba=_0x4c04ba-0x0;var _0x2b835e=_0xad80[_0x4c04ba];return _0x2b835e;};'use strict';var _=require(_0x0ad8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ad8('0x2'));var fs=require('fs');var path=require(_0x0ad8('0x3'));var rimraf=require('rimraf');var config=require(_0x0ad8('0x4'));var attributes=require(_0x0ad8('0x5'));module[_0x0ad8('0x6')]=function(_0x3c1c10,_0x27d7c5){return _0x3c1c10[_0x0ad8('0x7')]('ChatInteraction',attributes,{'tableName':_0x0ad8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x266339,_0x2dcf12,_0x21aff1){if(_0x266339[_0x0ad8('0x9')](_0x0ad8('0xa'))){_0x266339[_0x0ad8('0xb')]=moment()[_0x0ad8('0xc')](_0x0ad8('0xd'));}_0x21aff1(null,_0x266339);}},'charset':_0x0ad8('0xe'),'collate':_0x0ad8('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 0234922..37e5bb7 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddde=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0xddde,0x16f));var _0xeddd=function(_0x42653f,_0x531aed){_0x42653f=_0x42653f-0x0;var _0x55185f=_0xddde[_0x42653f];return _0x55185f;};'use strict';var _=require(_0xeddd('0x0'));var util=require(_0xeddd('0x1'));var moment=require(_0xeddd('0x2'));var BPromise=require('bluebird');var rs=require(_0xeddd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeddd('0x4'));var logger=require(_0xeddd('0x5'))(_0xeddd('0x6'));var config=require(_0xeddd('0x7'));var jayson=require(_0xeddd('0x8'));var client=jayson[_0xeddd('0x9')]['http']({'port':0x232a});config[_0xeddd('0xa')]=_[_0xeddd('0xb')](config[_0xeddd('0xa')],{'host':_0xeddd('0xc'),'port':0x18eb});var socket=require(_0xeddd('0xd'))(new Redis(config[_0xeddd('0xa')]));require(_0xeddd('0xe'))['register'](socket);function respondWithRpcPromise(_0x5b5c76,_0x4d0e77,_0x7a7011){return new BPromise(function(_0x4d925e,_0x43ce8f){return client[_0xeddd('0xf')](_0x5b5c76,_0x7a7011)[_0xeddd('0x10')](function(_0x409adb){logger[_0xeddd('0x11')](_0xeddd('0x12'),_0x4d0e77,_0xeddd('0x13'));logger['debug'](_0xeddd('0x14'),_0x4d0e77,_0xeddd('0x13'),JSON[_0xeddd('0x15')](_0x409adb));if(_0x409adb[_0xeddd('0x16')]){if(_0x409adb[_0xeddd('0x16')]['code']===0x1f4){logger[_0xeddd('0x16')](_0xeddd('0x12'),_0x4d0e77,_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);return _0x43ce8f(_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);}logger['error'](_0xeddd('0x12'),_0x4d0e77,_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);return _0x4d925e(_0x409adb['error'][_0xeddd('0x17')]);}else{logger[_0xeddd('0x11')](_0xeddd('0x12'),_0x4d0e77,_0xeddd('0x13'));_0x4d925e(_0x409adb[_0xeddd('0x18')][_0xeddd('0x17')]);}})[_0xeddd('0x19')](function(_0x3245d5){logger['error'](_0xeddd('0x12'),_0x4d0e77,_0x3245d5);_0x43ce8f(_0x3245d5);});});}exports[_0xeddd('0x1a')]=function(_0x4ce473){var _0x4108e2=this;return new Promise(function(_0x33de03,_0x3784dd){return db[_0xeddd('0x1b')][_0xeddd('0x1c')](_0x4ce473[_0xeddd('0x1d')],{'raw':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473[_0xeddd('0x1e')][_0xeddd('0x1f')]||null:null,'attributes':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473['options'][_0xeddd('0x20')]||null:null,'limit':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473[_0xeddd('0x1e')]['limit']||null:null})[_0xeddd('0x10')](function(_0x1ad2e8){logger[_0xeddd('0x11')]('UpdateChatInteraction',_0x4ce473);logger[_0xeddd('0x21')](_0xeddd('0x1a'),_0x4ce473,JSON[_0xeddd('0x15')](_0x1ad2e8));_0x33de03(_0x1ad2e8);})[_0xeddd('0x19')](function(_0x396b8e){logger[_0xeddd('0x16')](_0xeddd('0x1a'),_0x396b8e[_0xeddd('0x17')],_0x4ce473);_0x3784dd(_0x4108e2[_0xeddd('0x16')](0x1f4,_0x396b8e['message']));});});};exports[_0xeddd('0x22')]=function(_0x468ef5){return new Promise(function(_0xaef21a,_0x5f3213){return db[_0xeddd('0x1b')][_0xeddd('0x23')]({'where':_0x468ef5['options']?_0x468ef5['options']['where']||null:null})['then'](function(_0x9f3320){if(_0x9f3320){return _0x9f3320[_0xeddd('0x24')](_0x468ef5[_0xeddd('0x1d')][_0xeddd('0x25')],_[_0xeddd('0x26')](_0x468ef5[_0xeddd('0x1d')],[_0xeddd('0x25'),'id'])||{});}})[_0xeddd('0x27')](function(_0x18e963){logger[_0xeddd('0x11')](_0xeddd('0x28'),_0x468ef5);logger['debug'](_0xeddd('0x28'),_0x468ef5,JSON[_0xeddd('0x15')](_0x18e963));_0xaef21a(_0x18e963);})[_0xeddd('0x19')](function(_0x32a078){logger[_0xeddd('0x16')](_0xeddd('0x28'),_0x32a078[_0xeddd('0x17')],_0x468ef5);_0x5f3213(_this[_0xeddd('0x16')](0x1f4,_0x32a078[_0xeddd('0x17')]));});});}; \ No newline at end of file +var _0x0003=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatInteraction','body','raw','options','where','attributes','limit','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ids','AddTags','lodash','util','moment','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0003,0x164));var _0x3000=function(_0x2be7b2,_0x21c75a){_0x2be7b2=_0x2be7b2-0x0;var _0x31b0a1=_0x0003[_0x2be7b2];return _0x31b0a1;};'use strict';var _=require(_0x3000('0x0'));var util=require(_0x3000('0x1'));var moment=require(_0x3000('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3000('0x3'));var db=require(_0x3000('0x4'))['db'];var utils=require(_0x3000('0x5'));var logger=require(_0x3000('0x6'))(_0x3000('0x7'));var config=require(_0x3000('0x8'));var jayson=require(_0x3000('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3000('0xa')]=_['defaults'](config['redis'],{'host':_0x3000('0xb'),'port':0x18eb});var socket=require(_0x3000('0xc'))(new Redis(config['redis']));require(_0x3000('0xd'))['register'](socket);function respondWithRpcPromise(_0xac17db,_0x54658d,_0x245273){return new BPromise(function(_0x17421b,_0x56cdfb){return client['request'](_0xac17db,_0x245273)['then'](function(_0x44496f){logger[_0x3000('0xe')](_0x3000('0xf'),_0x54658d,_0x3000('0x10'));logger['debug'](_0x3000('0x11'),_0x54658d,'request\x20sent',JSON[_0x3000('0x12')](_0x44496f));if(_0x44496f[_0x3000('0x13')]){if(_0x44496f[_0x3000('0x13')]['code']===0x1f4){logger[_0x3000('0x13')](_0x3000('0xf'),_0x54658d,_0x44496f['error']['message']);return _0x56cdfb(_0x44496f[_0x3000('0x13')][_0x3000('0x14')]);}logger[_0x3000('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x54658d,_0x44496f['error'][_0x3000('0x14')]);return _0x17421b(_0x44496f[_0x3000('0x13')]['message']);}else{logger['info'](_0x3000('0xf'),_0x54658d,_0x3000('0x10'));_0x17421b(_0x44496f[_0x3000('0x15')][_0x3000('0x14')]);}})[_0x3000('0x16')](function(_0x39bbbf){logger[_0x3000('0x13')](_0x3000('0xf'),_0x54658d,_0x39bbbf);_0x56cdfb(_0x39bbbf);});});}exports['UpdateChatInteraction']=function(_0x57de92){var _0x2452e8=this;return new Promise(function(_0x42d08b,_0x5904cb){return db[_0x3000('0x17')]['update'](_0x57de92[_0x3000('0x18')],{'raw':_0x57de92['options']?_0x57de92['options'][_0x3000('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1b')]||null:null,'attributes':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1c')]||null:null,'limit':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1d')]||null:null})[_0x3000('0x1e')](function(_0x274e5a){logger[_0x3000('0xe')](_0x3000('0x1f'),_0x57de92);logger[_0x3000('0x20')](_0x3000('0x1f'),_0x57de92,JSON[_0x3000('0x12')](_0x274e5a));_0x42d08b(_0x274e5a);})[_0x3000('0x16')](function(_0x4d03a9){logger[_0x3000('0x13')](_0x3000('0x1f'),_0x4d03a9[_0x3000('0x14')],_0x57de92);_0x5904cb(_0x2452e8[_0x3000('0x13')](0x1f4,_0x4d03a9['message']));});});};exports[_0x3000('0x21')]=function(_0x42547a){return new Promise(function(_0x403500,_0x41d153){return db[_0x3000('0x17')]['find']({'where':_0x42547a[_0x3000('0x1a')]?_0x42547a[_0x3000('0x1a')]['where']||null:null})['then'](function(_0x564dfc){if(_0x564dfc){return _0x564dfc['addTags'](_0x42547a[_0x3000('0x18')][_0x3000('0x22')],_['omit'](_0x42547a[_0x3000('0x18')],['ids','id'])||{});}})['spread'](function(_0x5bf7d3){logger[_0x3000('0xe')]('AddTags',_0x42547a);logger[_0x3000('0x20')]('AddTags',_0x42547a,JSON['stringify'](_0x5bf7d3));_0x403500(_0x5bf7d3);})['catch'](function(_0xc6217a){logger[_0x3000('0x13')](_0x3000('0x23'),_0xc6217a['message'],_0x42547a);_0x41d153(_this[_0x3000('0x13')](0x1f4,_0xc6217a[_0x3000('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 119bd9b..46e3bcb 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18dd=['./chatInteraction.events','remove','emit','removeListener','length','chatInteraction:'];(function(_0x1fdd66,_0x40d3e5){var _0x3f5d8f=function(_0x54333e){while(--_0x54333e){_0x1fdd66['push'](_0x1fdd66['shift']());}};_0x3f5d8f(++_0x40d3e5);}(_0x18dd,0x6c));var _0xd18d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x18dd[_0x8c43de];return _0xa6591b;};'use strict';var ChatInteractionEvents=require(_0xd18d('0x0'));var events=['save',_0xd18d('0x1'),'update'];function createListener(_0x314dd9,_0x2670de){return function(_0x47e03f){_0x2670de[_0xd18d('0x2')](_0x314dd9,_0x47e03f);};}function removeListener(_0x80b0c6,_0xdc3221){return function(){ChatInteractionEvents[_0xd18d('0x3')](_0x80b0c6,_0xdc3221);};}exports['register']=function(_0x3cea88){for(var _0xc8a428=0x0,_0x4de3da=events[_0xd18d('0x4')];_0xc8a428<_0x4de3da;_0xc8a428++){var _0xb1b216=events[_0xc8a428];var _0x1f65f3=createListener(_0xd18d('0x5')+_0xb1b216,_0x3cea88);ChatInteractionEvents['on'](_0xb1b216,_0x1f65f3);}}; \ No newline at end of file +var _0x6608=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','register'];(function(_0x45bf0f,_0x16c557){var _0x4c57e6=function(_0x1220c2){while(--_0x1220c2){_0x45bf0f['push'](_0x45bf0f['shift']());}};_0x4c57e6(++_0x16c557);}(_0x6608,0x1ca));var _0x8660=function(_0x163259,_0x4bd808){_0x163259=_0x163259-0x0;var _0x311a21=_0x6608[_0x163259];return _0x311a21;};'use strict';var ChatInteractionEvents=require(_0x8660('0x0'));var events=[_0x8660('0x1'),_0x8660('0x2'),_0x8660('0x3')];function createListener(_0x24e461,_0x4486ba){return function(_0xcb931a){_0x4486ba[_0x8660('0x4')](_0x24e461,_0xcb931a);};}function removeListener(_0xd97956,_0x513d40){return function(){ChatInteractionEvents['removeListener'](_0xd97956,_0x513d40);};}exports[_0x8660('0x5')]=function(_0x3ccc5d){for(var _0x26e0cf=0x0,_0x357d52=events[_0x8660('0x6')];_0x26e0cf<_0x357d52;_0x26e0cf++){var _0x45b83a=events[_0x26e0cf];var _0x382ba6=createListener(_0x8660('0x7')+_0x45b83a,_0x3ccc5d);ChatInteractionEvents['on'](_0x45b83a,_0x382ba6);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index d15fb69..7034f97 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeded=['abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate'];(function(_0x43f5b4,_0x4bb4f0){var _0x3bd82d=function(_0x2f21b4){while(--_0x2f21b4){_0x43f5b4['push'](_0x43f5b4['shift']());}};_0x3bd82d(++_0x4bb4f0);}(_0xeded,0x6e));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var path=require('path');var timeout=require(_0xdede('0x2'));var express=require(_0xdede('0x3'));var router=express[_0xdede('0x4')]();var fs_extra=require(_0xdede('0x5'));var auth=require(_0xdede('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdede('0x7'));var controller=require(_0xdede('0x8'));router[_0xdede('0x9')]('/',auth[_0xdede('0xa')](),controller[_0xdede('0xb')]);router[_0xdede('0x9')]('/describe',auth[_0xdede('0xa')](),controller[_0xdede('0xc')]);router[_0xdede('0x9')]('/:id',auth[_0xdede('0xd')](),controller['show']);router[_0xdede('0x9')]('/:id/attachment_download',auth[_0xdede('0xd')](),controller[_0xdede('0xe')]);router[_0xdede('0x9')](_0xdede('0xf'),auth[_0xdede('0xa')](),controller['getMessages']);router[_0xdede('0x9')](_0xdede('0x10'),auth[_0xdede('0xd')](),controller['getMyMessages']);router[_0xdede('0x9')](_0xdede('0x11'),auth[_0xdede('0xa')](),controller[_0xdede('0x12')]);router[_0xdede('0x13')]('/',auth['isAuthenticated'](),controller[_0xdede('0x14')]);router[_0xdede('0x13')]('/:id/vidaoo',auth[_0xdede('0xa')](),controller[_0xdede('0x15')]);var upload=multer({'storage':multer[_0xdede('0x16')]({'destination':function(_0x3d602c,_0x34a66f,_0x1b95a3){_0x1b95a3(null,path[_0xdede('0x17')](config[_0xdede('0x18')],_0xdede('0x19')));},'filename':function(_0x183e83,_0x2b5008,_0x5d894c){_0x5d894c(null,util[_0xdede('0x1a')](_0xdede('0x1b'),Date['now'](),_0x2b5008[_0xdede('0x1c')][_0xdede('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xdede('0x1e'),upload[_0xdede('0x1f')](_0xdede('0x20')),controller['attachmentUpload']);router[_0xdede('0x13')](_0xdede('0xf'),auth[_0xdede('0xd')](),controller['addMessage']);router[_0xdede('0x13')]('/:id/tags',auth[_0xdede('0xa')](),interaction[_0xdede('0x21')](_0xdede('0x22'),_0xdede('0x23')),controller[_0xdede('0x24')]);router[_0xdede('0x25')](_0xdede('0x26'),auth['isAuthenticated'](),interaction[_0xdede('0x21')]('chat',_0xdede('0x27')),controller[_0xdede('0x28')]);router[_0xdede('0x25')](_0xdede('0x29'),controller[_0xdede('0x2a')]);router[_0xdede('0x25')]('/:id/abandon',auth[_0xdede('0xd')](),controller[_0xdede('0x2b')]);router[_0xdede('0x25')](_0xdede('0x2c'),controller['close']);router[_0xdede('0x2d')](_0xdede('0x26'),auth[_0xdede('0xa')](),interaction[_0xdede('0x21')](_0xdede('0x22'),_0xdede('0x2e')),controller[_0xdede('0x2f')]);router['delete'](_0xdede('0x30'),auth[_0xdede('0xa')](),controller[_0xdede('0x31')]);module[_0xdede('0x32')]=router; \ No newline at end of file +var _0x1240=['%s-%s','now','replace','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format'];(function(_0x9ad6fc,_0x164f6c){var _0x2a0830=function(_0x348b88){while(--_0x348b88){_0x9ad6fc['push'](_0x9ad6fc['shift']());}};_0x2a0830(++_0x164f6c);}(_0x1240,0xb8));var _0x0124=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1240[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x0124('0x0'));var util=require(_0x0124('0x1'));var path=require(_0x0124('0x2'));var timeout=require(_0x0124('0x3'));var express=require('express');var router=express[_0x0124('0x4')]();var fs_extra=require(_0x0124('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0124('0x6'));var config=require(_0x0124('0x7'));var controller=require('./chatInteraction.controller');router[_0x0124('0x8')]('/',auth[_0x0124('0x9')](),controller['index']);router['get'](_0x0124('0xa'),auth['isAuthenticated'](),controller[_0x0124('0xb')]);router['get'](_0x0124('0xc'),auth[_0x0124('0xd')](),controller['show']);router[_0x0124('0x8')](_0x0124('0xe'),auth[_0x0124('0xd')](),controller[_0x0124('0xf')]);router[_0x0124('0x8')]('/:id/messages',auth[_0x0124('0x9')](),controller[_0x0124('0x10')]);router[_0x0124('0x8')](_0x0124('0x11'),auth[_0x0124('0xd')](),controller[_0x0124('0x12')]);router[_0x0124('0x8')](_0x0124('0x13'),auth[_0x0124('0x9')](),controller['download']);router[_0x0124('0x14')]('/',auth[_0x0124('0x9')](),controller[_0x0124('0x15')]);router[_0x0124('0x14')](_0x0124('0x16'),auth[_0x0124('0x9')](),controller[_0x0124('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ba093,_0x554eec,_0xabb7b9){_0xabb7b9(null,path[_0x0124('0x18')](config[_0x0124('0x19')],_0x0124('0x1a')));},'filename':function(_0x58d02e,_0xff8a87,_0x56f02b){_0x56f02b(null,util[_0x0124('0x1b')](_0x0124('0x1c'),Date[_0x0124('0x1d')](),_0xff8a87['originalname'][_0x0124('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x0124('0x1f')](_0x0124('0x20')),controller[_0x0124('0x21')]);router[_0x0124('0x14')](_0x0124('0x22'),auth[_0x0124('0xd')](),controller[_0x0124('0x23')]);router[_0x0124('0x14')](_0x0124('0x24'),auth[_0x0124('0x9')](),interaction['tracked']('chat',_0x0124('0x25')),controller[_0x0124('0x26')]);router[_0x0124('0x27')](_0x0124('0xc'),auth[_0x0124('0x9')](),interaction[_0x0124('0x28')](_0x0124('0x29'),_0x0124('0x2a')),controller[_0x0124('0x2b')]);router[_0x0124('0x27')](_0x0124('0x2c'),controller[_0x0124('0x2d')]);router[_0x0124('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x0124('0x2e')]);router[_0x0124('0x27')](_0x0124('0x2f'),controller[_0x0124('0x30')]);router[_0x0124('0x31')](_0x0124('0xc'),auth[_0x0124('0x9')](),interaction[_0x0124('0x28')]('chat',_0x0124('0x32')),controller['destroy']);router[_0x0124('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0124('0x33')]);module[_0x0124('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7f34aa7..32443b1 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6d7=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xb6d7,0x150));var _0x7b6d=function(_0x43a2e4,_0x5bd47b){_0x43a2e4=_0x43a2e4-0x0;var _0x55f73d=_0xb6d7[_0x43a2e4];return _0x55f73d;};'use strict';var Sequelize=require(_0x7b6d('0x0'));module[_0x7b6d('0x1')]={'body':{'type':Sequelize[_0x7b6d('0x2')](_0x7b6d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7b6d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7b6d('0x5')]}}; \ No newline at end of file +var _0x7227=['exports','TEXT','medium','INTEGER'];(function(_0x148271,_0x1ba6b0){var _0x1b4dbf=function(_0x2db098){while(--_0x2db098){_0x148271['push'](_0x148271['shift']());}};_0x1b4dbf(++_0x1ba6b0);}(_0x7227,0xa0));var _0x7722=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x7227[_0x42235f];return _0x3f5fab;};'use strict';var Sequelize=require('sequelize');module[_0x7722('0x0')]={'body':{'type':Sequelize[_0x7722('0x1')](_0x7722('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7722('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ca3d342..c09528d 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e6=['moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','catch','show','find','create','body','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','role','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','UserProfileResource','resourceId','push','agent','FromId','read','all','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2df002,_0x48b5e0){var _0x3ab9dd=function(_0x5035b1){while(--_0x5035b1){_0x2df002['push'](_0x2df002['shift']());}};_0x3ab9dd(++_0x48b5e0);}(_0x34e6,0x1a4));var _0x634e=function(_0x532656,_0x5c6fb1){_0x532656=_0x532656-0x0;var _0x112890=_0x34e6[_0x532656];return _0x112890;};'use strict';var emlformat=require(_0x634e('0x0'));var rimraf=require(_0x634e('0x1'));var zipdir=require(_0x634e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x634e('0x3'));var moment=require(_0x634e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x634e('0x5'));var util=require(_0x634e('0x6'));var path=require(_0x634e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x634e('0x8'));var fs=require('fs');var fs_extra=require(_0x634e('0x9'));var _=require(_0x634e('0xa'));var squel=require(_0x634e('0xb'));var crypto=require(_0x634e('0xc'));var jsforce=require(_0x634e('0xd'));var deskjs=require(_0x634e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x634e('0xf'));var Papa=require(_0x634e('0x10'));var Redis=require(_0x634e('0x11'));var authService=require(_0x634e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x634e('0x13'));var hardwareService=require(_0x634e('0x14'));var logger=require('../../config/logger')(_0x634e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x634e('0x16'));var db=require(_0x634e('0x17'))['db'];config[_0x634e('0x18')]=_[_0x634e('0x19')](config[_0x634e('0x18')],{'host':_0x634e('0x1a'),'port':0x18eb});var socket=require(_0x634e('0x1b'))(new Redis(config[_0x634e('0x18')]));require(_0x634e('0x1c'))[_0x634e('0x1d')](socket);function respondWithStatusCode(_0x3ff9d5,_0x1c6b36){_0x1c6b36=_0x1c6b36||0xcc;return function(_0x2c7dd2){if(_0x2c7dd2){return _0x3ff9d5[_0x634e('0x1e')](_0x1c6b36);}return _0x3ff9d5[_0x634e('0x1f')](_0x1c6b36)[_0x634e('0x20')]();};}function respondWithResult(_0x22dd62,_0x301538){_0x301538=_0x301538||0xc8;return function(_0x5c7414){if(_0x5c7414){return _0x22dd62[_0x634e('0x1f')](_0x301538)[_0x634e('0x21')](_0x5c7414);}};}function respondWithFilteredResult(_0x227fbe,_0x344f7a){return function(_0x5d465b){if(_0x5d465b){var _0x1c1dcd=typeof _0x344f7a[_0x634e('0x22')]===_0x634e('0x23')&&typeof _0x344f7a[_0x634e('0x24')]==='undefined';var _0x5e3c1b=_0x5d465b[_0x634e('0x25')];var _0x18c8a9=_0x1c1dcd?0x0:_0x344f7a['offset'];var _0x403dda=_0x1c1dcd?_0x5d465b[_0x634e('0x25')]:_0x344f7a['offset']+_0x344f7a[_0x634e('0x24')];var _0xa20803;if(_0x403dda>=_0x5e3c1b){_0x403dda=_0x5e3c1b;_0xa20803=0xc8;}else{_0xa20803=0xce;}_0x227fbe[_0x634e('0x1f')](_0xa20803);return _0x227fbe[_0x634e('0x26')](_0x634e('0x27'),_0x18c8a9+'-'+_0x403dda+'/'+_0x5e3c1b)[_0x634e('0x21')](_0x5d465b);}return null;};}function patchUpdates(_0x52a09c){return function(_0x54a70f){try{jsonpatch[_0x634e('0x28')](_0x54a70f,_0x52a09c,!![]);}catch(_0x42ed3f){return BPromise[_0x634e('0x29')](_0x42ed3f);}return _0x54a70f[_0x634e('0x2a')]();};}function saveUpdates(_0x5d7847,_0x168638){return function(_0x1e274d){if(_0x1e274d){return _0x1e274d[_0x634e('0x2b')](_0x5d7847)[_0x634e('0x2c')](function(_0x595921){return _0x595921;});}return null;};}function removeEntity(_0x1e9d8f,_0x5efe4b){return function(_0x56540e){if(_0x56540e){return _0x56540e['destroy']()[_0x634e('0x2c')](function(){_0x1e9d8f['status'](0xcc)[_0x634e('0x20')]();});}};}function handleEntityNotFound(_0x4873c7,_0x91ebba){return function(_0x678ba3){if(!_0x678ba3){_0x4873c7[_0x634e('0x1e')](0x194);}return _0x678ba3;};}function handleError(_0x26452d,_0x33a1e2){_0x33a1e2=_0x33a1e2||0x1f4;return function(_0x197be2){logger['error'](_0x197be2[_0x634e('0x2d')]);if(_0x197be2[_0x634e('0x2e')]){delete _0x197be2[_0x634e('0x2e')];}_0x26452d[_0x634e('0x1f')](_0x33a1e2)[_0x634e('0x2f')](_0x197be2);};}exports['index']=function(_0x5e23a,_0x5a1d46){var _0x126fed={},_0x3dff4e={},_0x502fb8={'count':0x0,'rows':[]};var _0x1012ab=_['map'](db[_0x634e('0x30')][_0x634e('0x31')],function(_0x58f8b0){return{'name':_0x58f8b0[_0x634e('0x32')],'type':_0x58f8b0[_0x634e('0x33')][_0x634e('0x34')]};});_0x3dff4e[_0x634e('0x35')]=_[_0x634e('0x36')](_0x1012ab,_0x634e('0x2e'));_0x3dff4e[_0x634e('0x37')]=_[_0x634e('0x38')](_0x5e23a[_0x634e('0x37')]);_0x3dff4e[_0x634e('0x39')]=_[_0x634e('0x3a')](_0x3dff4e[_0x634e('0x35')],_0x3dff4e[_0x634e('0x37')]);_0x126fed[_0x634e('0x3b')]=_[_0x634e('0x3a')](_0x3dff4e['model'],qs[_0x634e('0x3c')](_0x5e23a['query'][_0x634e('0x3c')]));_0x126fed[_0x634e('0x3b')]=_0x126fed[_0x634e('0x3b')][_0x634e('0x3d')]?_0x126fed[_0x634e('0x3b')]:_0x3dff4e[_0x634e('0x35')];if(!_0x5e23a[_0x634e('0x37')][_0x634e('0x3e')](_0x634e('0x3f'))){_0x126fed[_0x634e('0x24')]=qs[_0x634e('0x24')](_0x5e23a[_0x634e('0x37')][_0x634e('0x24')]);_0x126fed[_0x634e('0x22')]=qs[_0x634e('0x22')](_0x5e23a[_0x634e('0x37')][_0x634e('0x22')]);}_0x126fed[_0x634e('0x40')]=qs[_0x634e('0x41')](_0x5e23a[_0x634e('0x37')][_0x634e('0x41')]);_0x126fed[_0x634e('0x42')]=qs['filters'](_['pick'](_0x5e23a['query'],_0x3dff4e[_0x634e('0x39')]),_0x1012ab);if(_0x5e23a[_0x634e('0x37')]['filter']){_0x126fed[_0x634e('0x42')]=_[_0x634e('0x43')](_0x126fed[_0x634e('0x42')],{'$or':_['map'](_0x1012ab,function(_0x31312e){if(_0x31312e[_0x634e('0x33')]!==_0x634e('0x44')){var _0x2be8c2={};_0x2be8c2[_0x31312e[_0x634e('0x2e')]]={'$like':'%'+_0x5e23a[_0x634e('0x37')][_0x634e('0x45')]+'%'};return _0x2be8c2;}})});}_0x126fed=_['merge']({},_0x126fed,_0x5e23a['options']);var _0xe3e89b={'where':_0x126fed[_0x634e('0x42')]};return db[_0x634e('0x30')][_0x634e('0x25')](_0xe3e89b)[_0x634e('0x2c')](function(_0x4633ed){_0x502fb8[_0x634e('0x25')]=_0x4633ed;if(_0x5e23a[_0x634e('0x37')]['includeAll']){_0x126fed[_0x634e('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x634e('0x47')](_0x126fed);})['then'](function(_0x3dcc64){_0x502fb8['rows']=_0x3dcc64;return _0x502fb8;})[_0x634e('0x2c')](respondWithFilteredResult(_0x5a1d46,_0x126fed))[_0x634e('0x48')](handleError(_0x5a1d46,null));};exports[_0x634e('0x49')]=function(_0x5c54e4,_0x127a33){var _0x5ab12d={'raw':!![],'where':{'id':_0x5c54e4['params']['id']}},_0x38e77b={};_0x38e77b[_0x634e('0x35')]=_['keys'](db[_0x634e('0x30')][_0x634e('0x31')]);_0x38e77b[_0x634e('0x37')]=_['keys'](_0x5c54e4[_0x634e('0x37')]);_0x38e77b['filters']=_[_0x634e('0x3a')](_0x38e77b[_0x634e('0x35')],_0x38e77b[_0x634e('0x37')]);_0x5ab12d['attributes']=_[_0x634e('0x3a')](_0x38e77b[_0x634e('0x35')],qs['fields'](_0x5c54e4[_0x634e('0x37')][_0x634e('0x3c')]));_0x5ab12d[_0x634e('0x3b')]=_0x5ab12d[_0x634e('0x3b')]['length']?_0x5ab12d[_0x634e('0x3b')]:_0x38e77b[_0x634e('0x35')];if(_0x5c54e4['query']['includeAll']){_0x5ab12d[_0x634e('0x46')]=[{'all':!![]}];}_0x5ab12d=_['merge']({},_0x5ab12d,_0x5c54e4['options']);return db[_0x634e('0x30')][_0x634e('0x4a')](_0x5ab12d)['then'](handleEntityNotFound(_0x127a33,null))[_0x634e('0x2c')](respondWithResult(_0x127a33,null))['catch'](handleError(_0x127a33,null));};exports[_0x634e('0x4b')]=function(_0x47dd84,_0x2a9f7a){return db[_0x634e('0x30')][_0x634e('0x4b')](_0x47dd84[_0x634e('0x4c')],{})[_0x634e('0x2c')](respondWithResult(_0x2a9f7a,0xc9))[_0x634e('0x48')](handleError(_0x2a9f7a,null));};exports[_0x634e('0x2b')]=function(_0x297e32,_0x1fbacf){if(_0x297e32[_0x634e('0x4c')]['id']){delete _0x297e32[_0x634e('0x4c')]['id'];}return db[_0x634e('0x30')]['find']({'where':{'id':_0x297e32[_0x634e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1fbacf,null))['then'](saveUpdates(_0x297e32['body'],null))[_0x634e('0x2c')](respondWithResult(_0x1fbacf,null))[_0x634e('0x48')](handleError(_0x1fbacf,null));};exports[_0x634e('0x4e')]=function(_0x83ae1d,_0x2b5e65){return db[_0x634e('0x30')][_0x634e('0x4a')]({'where':{'id':_0x83ae1d[_0x634e('0x4d')]['id']}})[_0x634e('0x2c')](handleEntityNotFound(_0x2b5e65,null))[_0x634e('0x2c')](removeEntity(_0x2b5e65,null))[_0x634e('0x48')](handleError(_0x2b5e65,null));};exports[_0x634e('0x4f')]=function(_0x3118d8,_0x27c347){return db[_0x634e('0x30')]['describe']()[_0x634e('0x2c')](respondWithResult(_0x27c347,null))['catch'](handleError(_0x27c347,null));};function wrapUser(_0x5a524d){return function(_0x1ab117){var _0x10c4c7=_0x5a524d[_0x634e('0x50')]({'plain':!![]});_0x10c4c7[_0x634e('0x51')]=[];if(_0x1ab117){_0x10c4c7[_0x634e('0x52')]=_0x1ab117[_0x634e('0x53')];_0x10c4c7[_0x634e('0x54')]=_0x1ab117;}else{_0x10c4c7[_0x634e('0x52')]=moment(0x0)[_0x634e('0x55')](_0x634e('0x56'));_0x10c4c7[_0x634e('0x54')]={};}return _0x10c4c7;};}exports[_0x634e('0x57')]=function(_0x16e6e7,_0x118331,_0x2cd8ab){var _0x1a0bb0=[];return db['User'][_0x634e('0x47')]({'where':{'role':['agent',_0x634e('0x58'),_0x634e('0x59')]},'attributes':['id','fullname',_0x634e('0x2e'),_0x634e('0x5a'),_0x634e('0x5b'),_0x634e('0x5c'),'online','lastLoginAt','allowmessenger',_0x634e('0x5d')],'order':qs[_0x634e('0x41')](_0x634e('0x5e')),'include':[{'model':db[_0x634e('0x5f')],'as':_0x634e('0x60'),'attributes':['id',_0x634e('0x2e'),_0x634e('0x33')],'through':{'attributes':[]}}]})[_0x634e('0x2c')](function(_0x2b229e){if(_0x2b229e){var _0x420180=_0x16e6e7['user'][_0x634e('0x50')]({'plain':!![]});if(!_0x420180)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x420180['role']===_0x634e('0x59')){return db[_0x634e('0x61')][_0x634e('0x4a')]({'where':{'name':'Agents','userProfileId':_0x420180[_0x634e('0x62')]},'raw':!![]})['then'](function(_0x3b8c42){if(_0x3b8c42){if(_0x3b8c42['autoAssociation']===0x0){return db[_0x634e('0x63')][_0x634e('0x47')]({'where':{'sectionId':_0x3b8c42['id']},'raw':!![]})[_0x634e('0x2c')](function(_0x9e87d5){var _0x16137b=[];if(_['isEmpty'](_0x9e87d5)){_0x16137b=_['filter'](_0x2b229e,function(_0x19f21c){if(_0x19f21c[_0x634e('0x5a')]!=='agent'){return _0x19f21c;}});return _0x16137b;}else{for(var _0x3a2032=0x0;_0x3a2032<_0x2b229e[_0x634e('0x3d')];_0x3a2032++){var _0x36313f=_0x2b229e[_0x3a2032];if(_0x36313f[_0x634e('0x5a')]==='agent'){var _0x611a35=_['find'](_0x9e87d5,function(_0xe63a49){return _0xe63a49[_0x634e('0x64')]===_0x36313f['id'];});if(_0x611a35)_0x16137b[_0x634e('0x65')](_0x36313f);}else{_0x16137b[_0x634e('0x65')](_0x36313f);}}return _0x16137b;}});}else{return _0x2b229e;}}else{var _0x23465d=_[_0x634e('0x45')](_0x2b229e,function(_0x33e0c4){if(_0x33e0c4[_0x634e('0x5a')]!==_0x634e('0x66')){return _0x33e0c4;}});return _0x23465d;}});}else{return _0x2b229e;}}})[_0x634e('0x2c')](function(_0x3e6cf4){var _0x28c25c=[];if(_0x3e6cf4){_0x1a0bb0=_0x3e6cf4;for(var _0x759cba=0x0;_0x759cba<_0x3e6cf4['length'];_0x759cba+=0x1){_0x1a0bb0[_0x759cba]['messages']=[];_0x28c25c[_0x634e('0x65')](db[_0x634e('0x30')][_0x634e('0x4a')]({'where':{'FromId':[_0x16e6e7[_0x634e('0x59')]['id'],_0x3e6cf4[_0x759cba]['id']],'ToId':[_0x16e6e7[_0x634e('0x59')]['id'],_0x3e6cf4[_0x759cba]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x634e('0x67'),'ToId',_0x634e('0x68'),'body'],'order':qs[_0x634e('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3e6cf4[_0x759cba])));}return BPromise[_0x634e('0x69')](_0x28c25c);}return[];})[_0x634e('0x2c')](function(_0x48940f){return{'rows':_0x48940f,'count':_0x48940f[_0x634e('0x3d')]};})['then'](respondWithResult(_0x118331,null))['catch'](handleError(_0x118331,null));}; \ No newline at end of file +var _0xe19e=['push','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId'];(function(_0x4cea31,_0x54ef05){var _0x30bf16=function(_0x1530a7){while(--_0x1530a7){_0x4cea31['push'](_0x4cea31['shift']());}};_0x30bf16(++_0x54ef05);}(_0xe19e,0xdb));var _0xee19=function(_0x2d8533,_0x1ab88e){_0x2d8533=_0x2d8533-0x0;var _0x4383ab=_0xe19e[_0x2d8533];return _0x4383ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee19('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee19('0x1'));var rp=require(_0xee19('0x2'));var moment=require(_0xee19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xee19('0x4'));var util=require(_0xee19('0x5'));var path=require(_0xee19('0x6'));var sox=require('sox');var csv=require(_0xee19('0x7'));var ejs=require(_0xee19('0x8'));var fs=require('fs');var fs_extra=require(_0xee19('0x9'));var _=require('lodash');var squel=require(_0xee19('0xa'));var crypto=require(_0xee19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee19('0xc'));var toCsv=require(_0xee19('0x7'));var querystring=require('querystring');var Papa=require(_0xee19('0xd'));var Redis=require(_0xee19('0xe'));var authService=require(_0xee19('0xf'));var qs=require(_0xee19('0x10'));var as=require(_0xee19('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee19('0x12'))(_0xee19('0x13'));var utils=require(_0xee19('0x14'));var config=require(_0xee19('0x15'));var licenseUtil=require(_0xee19('0x16'));var db=require('../../mysqldb')['db'];config[_0xee19('0x17')]=_['defaults'](config[_0xee19('0x17')],{'host':_0xee19('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee19('0x17')]));require(_0xee19('0x19'))[_0xee19('0x1a')](socket);function respondWithStatusCode(_0x33591f,_0x13dffb){_0x13dffb=_0x13dffb||0xcc;return function(_0x5b3e14){if(_0x5b3e14){return _0x33591f[_0xee19('0x1b')](_0x13dffb);}return _0x33591f[_0xee19('0x1c')](_0x13dffb)[_0xee19('0x1d')]();};}function respondWithResult(_0x1b98c1,_0x526e72){_0x526e72=_0x526e72||0xc8;return function(_0x5f5131){if(_0x5f5131){return _0x1b98c1[_0xee19('0x1c')](_0x526e72)[_0xee19('0x1e')](_0x5f5131);}};}function respondWithFilteredResult(_0x567bbc,_0x3d95cb){return function(_0x1734c1){if(_0x1734c1){var _0x320234=typeof _0x3d95cb[_0xee19('0x1f')]===_0xee19('0x20')&&typeof _0x3d95cb[_0xee19('0x21')]==='undefined';var _0x4d5cd9=_0x1734c1[_0xee19('0x22')];var _0x445e4f=_0x320234?0x0:_0x3d95cb[_0xee19('0x1f')];var _0x3ce468=_0x320234?_0x1734c1[_0xee19('0x22')]:_0x3d95cb[_0xee19('0x1f')]+_0x3d95cb[_0xee19('0x21')];var _0x31ed17;if(_0x3ce468>=_0x4d5cd9){_0x3ce468=_0x4d5cd9;_0x31ed17=0xc8;}else{_0x31ed17=0xce;}_0x567bbc[_0xee19('0x1c')](_0x31ed17);return _0x567bbc[_0xee19('0x23')]('Content-Range',_0x445e4f+'-'+_0x3ce468+'/'+_0x4d5cd9)['json'](_0x1734c1);}return null;};}function patchUpdates(_0x1f5c65){return function(_0x183527){try{jsonpatch[_0xee19('0x24')](_0x183527,_0x1f5c65,!![]);}catch(_0x36242d){return BPromise[_0xee19('0x25')](_0x36242d);}return _0x183527['save']();};}function saveUpdates(_0x527db0,_0x5db768){return function(_0xb3921a){if(_0xb3921a){return _0xb3921a['update'](_0x527db0)[_0xee19('0x26')](function(_0x324a44){return _0x324a44;});}return null;};}function removeEntity(_0x4fd14d,_0x3444c4){return function(_0x59f975){if(_0x59f975){return _0x59f975[_0xee19('0x27')]()[_0xee19('0x26')](function(){_0x4fd14d['status'](0xcc)[_0xee19('0x1d')]();});}};}function handleEntityNotFound(_0x484c6d,_0x5025e3){return function(_0x50dab){if(!_0x50dab){_0x484c6d['sendStatus'](0x194);}return _0x50dab;};}function handleError(_0xb6bbe6,_0x321ce5){_0x321ce5=_0x321ce5||0x1f4;return function(_0x24f09a){logger[_0xee19('0x28')](_0x24f09a['stack']);if(_0x24f09a[_0xee19('0x29')]){delete _0x24f09a[_0xee19('0x29')];}_0xb6bbe6[_0xee19('0x1c')](_0x321ce5)[_0xee19('0x2a')](_0x24f09a);};}exports[_0xee19('0x2b')]=function(_0x1f6f9c,_0x936f80){var _0x3ff0bf={},_0x3fc1bf={},_0x48bbd0={'count':0x0,'rows':[]};var _0x2ae37d=_[_0xee19('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x2a96bc){return{'name':_0x2a96bc[_0xee19('0x2d')],'type':_0x2a96bc[_0xee19('0x2e')][_0xee19('0x2f')]};});_0x3fc1bf['model']=_[_0xee19('0x2c')](_0x2ae37d,'name');_0x3fc1bf[_0xee19('0x30')]=_['keys'](_0x1f6f9c['query']);_0x3fc1bf[_0xee19('0x31')]=_['intersection'](_0x3fc1bf['model'],_0x3fc1bf[_0xee19('0x30')]);_0x3ff0bf['attributes']=_[_0xee19('0x32')](_0x3fc1bf[_0xee19('0x33')],qs[_0xee19('0x34')](_0x1f6f9c[_0xee19('0x30')][_0xee19('0x34')]));_0x3ff0bf[_0xee19('0x35')]=_0x3ff0bf['attributes'][_0xee19('0x36')]?_0x3ff0bf[_0xee19('0x35')]:_0x3fc1bf[_0xee19('0x33')];if(!_0x1f6f9c[_0xee19('0x30')]['hasOwnProperty'](_0xee19('0x37'))){_0x3ff0bf[_0xee19('0x21')]=qs[_0xee19('0x21')](_0x1f6f9c[_0xee19('0x30')]['limit']);_0x3ff0bf['offset']=qs[_0xee19('0x1f')](_0x1f6f9c['query'][_0xee19('0x1f')]);}_0x3ff0bf['order']=qs[_0xee19('0x38')](_0x1f6f9c[_0xee19('0x30')][_0xee19('0x38')]);_0x3ff0bf['where']=qs[_0xee19('0x31')](_[_0xee19('0x39')](_0x1f6f9c['query'],_0x3fc1bf['filters']),_0x2ae37d);if(_0x1f6f9c[_0xee19('0x30')][_0xee19('0x3a')]){_0x3ff0bf[_0xee19('0x3b')]=_[_0xee19('0x3c')](_0x3ff0bf[_0xee19('0x3b')],{'$or':_[_0xee19('0x2c')](_0x2ae37d,function(_0x422c5a){if(_0x422c5a[_0xee19('0x2e')]!==_0xee19('0x3d')){var _0x5e9b59={};_0x5e9b59[_0x422c5a[_0xee19('0x29')]]={'$like':'%'+_0x1f6f9c[_0xee19('0x30')][_0xee19('0x3a')]+'%'};return _0x5e9b59;}})});}_0x3ff0bf=_[_0xee19('0x3c')]({},_0x3ff0bf,_0x1f6f9c[_0xee19('0x3e')]);var _0x11ee1f={'where':_0x3ff0bf[_0xee19('0x3b')]};return db[_0xee19('0x3f')][_0xee19('0x22')](_0x11ee1f)[_0xee19('0x26')](function(_0x19507f){_0x48bbd0[_0xee19('0x22')]=_0x19507f;if(_0x1f6f9c[_0xee19('0x30')]['includeAll']){_0x3ff0bf[_0xee19('0x40')]=[{'all':!![]}];}return db[_0xee19('0x3f')][_0xee19('0x41')](_0x3ff0bf);})['then'](function(_0x15abbf){_0x48bbd0[_0xee19('0x42')]=_0x15abbf;return _0x48bbd0;})['then'](respondWithFilteredResult(_0x936f80,_0x3ff0bf))['catch'](handleError(_0x936f80,null));};exports['show']=function(_0x22bc3a,_0x3c7d5f){var _0x3e6d28={'raw':!![],'where':{'id':_0x22bc3a[_0xee19('0x43')]['id']}},_0x41d3c9={};_0x41d3c9['model']=_[_0xee19('0x44')](db[_0xee19('0x3f')][_0xee19('0x45')]);_0x41d3c9['query']=_[_0xee19('0x44')](_0x22bc3a[_0xee19('0x30')]);_0x41d3c9[_0xee19('0x31')]=_[_0xee19('0x32')](_0x41d3c9[_0xee19('0x33')],_0x41d3c9['query']);_0x3e6d28[_0xee19('0x35')]=_[_0xee19('0x32')](_0x41d3c9[_0xee19('0x33')],qs['fields'](_0x22bc3a['query'][_0xee19('0x34')]));_0x3e6d28[_0xee19('0x35')]=_0x3e6d28[_0xee19('0x35')]['length']?_0x3e6d28['attributes']:_0x41d3c9[_0xee19('0x33')];if(_0x22bc3a[_0xee19('0x30')]['includeAll']){_0x3e6d28[_0xee19('0x40')]=[{'all':!![]}];}_0x3e6d28=_[_0xee19('0x3c')]({},_0x3e6d28,_0x22bc3a[_0xee19('0x3e')]);return db[_0xee19('0x3f')][_0xee19('0x46')](_0x3e6d28)[_0xee19('0x26')](handleEntityNotFound(_0x3c7d5f,null))[_0xee19('0x26')](respondWithResult(_0x3c7d5f,null))[_0xee19('0x47')](handleError(_0x3c7d5f,null));};exports[_0xee19('0x48')]=function(_0x32333b,_0x35bc2a){return db[_0xee19('0x3f')][_0xee19('0x48')](_0x32333b[_0xee19('0x49')],{})[_0xee19('0x26')](respondWithResult(_0x35bc2a,0xc9))[_0xee19('0x47')](handleError(_0x35bc2a,null));};exports[_0xee19('0x4a')]=function(_0x2cc732,_0x49096e){if(_0x2cc732['body']['id']){delete _0x2cc732[_0xee19('0x49')]['id'];}return db[_0xee19('0x3f')]['find']({'where':{'id':_0x2cc732[_0xee19('0x43')]['id']}})[_0xee19('0x26')](handleEntityNotFound(_0x49096e,null))[_0xee19('0x26')](saveUpdates(_0x2cc732[_0xee19('0x49')],null))[_0xee19('0x26')](respondWithResult(_0x49096e,null))[_0xee19('0x47')](handleError(_0x49096e,null));};exports['destroy']=function(_0x5c51ce,_0x454624){return db['ChatInternalMessage'][_0xee19('0x46')]({'where':{'id':_0x5c51ce[_0xee19('0x43')]['id']}})[_0xee19('0x26')](handleEntityNotFound(_0x454624,null))[_0xee19('0x26')](removeEntity(_0x454624,null))[_0xee19('0x47')](handleError(_0x454624,null));};exports[_0xee19('0x4b')]=function(_0x169bdb,_0x121a0a){return db['ChatInternalMessage']['describe']()[_0xee19('0x26')](respondWithResult(_0x121a0a,null))[_0xee19('0x47')](handleError(_0x121a0a,null));};function wrapUser(_0x28f834){return function(_0x421763){var _0x2686e3=_0x28f834[_0xee19('0x4c')]({'plain':!![]});_0x2686e3[_0xee19('0x4d')]=[];if(_0x421763){_0x2686e3[_0xee19('0x4e')]=_0x421763[_0xee19('0x4f')];_0x2686e3[_0xee19('0x50')]=_0x421763;}else{_0x2686e3[_0xee19('0x4e')]=moment(0x0)[_0xee19('0x51')](_0xee19('0x52'));_0x2686e3[_0xee19('0x50')]={};}return _0x2686e3;};}exports['getUsers']=function(_0x102551,_0x221195,_0x4ec321){var _0x8d0a08=[];return db[_0xee19('0x53')][_0xee19('0x41')]({'where':{'role':[_0xee19('0x54'),_0xee19('0x55'),_0xee19('0x56')]},'attributes':['id','fullname',_0xee19('0x29'),_0xee19('0x57'),_0xee19('0x58'),'internal','online',_0xee19('0x59'),_0xee19('0x5a'),_0xee19('0x5b')],'order':qs[_0xee19('0x38')](_0xee19('0x5c')),'include':[{'model':db[_0xee19('0x5d')],'as':_0xee19('0x5e'),'attributes':['id',_0xee19('0x29'),_0xee19('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x361656){if(_0x361656){var _0x1fc327=_0x102551[_0xee19('0x56')]['get']({'plain':!![]});if(!_0x1fc327)throw new Error(_0xee19('0x5f'));if(_0x1fc327['role']===_0xee19('0x56')){return db[_0xee19('0x60')][_0xee19('0x46')]({'where':{'name':_0xee19('0x61'),'userProfileId':_0x1fc327[_0xee19('0x62')]},'raw':!![]})[_0xee19('0x26')](function(_0x1e1e1b){if(_0x1e1e1b){if(_0x1e1e1b['autoAssociation']===0x0){return db[_0xee19('0x63')][_0xee19('0x41')]({'where':{'sectionId':_0x1e1e1b['id']},'raw':!![]})[_0xee19('0x26')](function(_0x36a5f0){var _0x432e9a=[];if(_[_0xee19('0x64')](_0x36a5f0)){_0x432e9a=_[_0xee19('0x3a')](_0x361656,function(_0x3cbe7c){if(_0x3cbe7c[_0xee19('0x57')]!=='agent'){return _0x3cbe7c;}});return _0x432e9a;}else{for(var _0x15715c=0x0;_0x15715c<_0x361656[_0xee19('0x36')];_0x15715c++){var _0x94da7e=_0x361656[_0x15715c];if(_0x94da7e[_0xee19('0x57')]===_0xee19('0x54')){var _0x1385e8=_[_0xee19('0x46')](_0x36a5f0,function(_0x1afce7){return _0x1afce7[_0xee19('0x65')]===_0x94da7e['id'];});if(_0x1385e8)_0x432e9a[_0xee19('0x66')](_0x94da7e);}else{_0x432e9a[_0xee19('0x66')](_0x94da7e);}}return _0x432e9a;}});}else{return _0x361656;}}else{var _0x1b950=_[_0xee19('0x3a')](_0x361656,function(_0x5664a2){if(_0x5664a2[_0xee19('0x57')]!==_0xee19('0x54')){return _0x5664a2;}});return _0x1b950;}});}else{return _0x361656;}}})[_0xee19('0x26')](function(_0x22daca){var _0x4c327b=[];if(_0x22daca){_0x8d0a08=_0x22daca;for(var _0x45f8d0=0x0;_0x45f8d0<_0x22daca[_0xee19('0x36')];_0x45f8d0+=0x1){_0x8d0a08[_0x45f8d0][_0xee19('0x4d')]=[];_0x4c327b[_0xee19('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x102551['user']['id'],_0x22daca[_0x45f8d0]['id']],'ToId':[_0x102551[_0xee19('0x56')]['id'],_0x22daca[_0x45f8d0]['id']],'ChatGroupId':null},'attributes':['id',_0xee19('0x4f'),'FromId',_0xee19('0x67'),_0xee19('0x68'),_0xee19('0x49')],'order':qs['sort'](_0xee19('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xee19('0x26')](wrapUser(_0x22daca[_0x45f8d0])));}return BPromise[_0xee19('0x6a')](_0x4c327b);}return[];})[_0xee19('0x26')](function(_0x26d419){return{'rows':_0x26d419,'count':_0x26d419[_0xee19('0x36')]};})[_0xee19('0x26')](respondWithResult(_0x221195,null))[_0xee19('0x47')](handleError(_0x221195,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index e75dec9..db49987 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef4=['exports','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x5ca6cb,_0x3872b4){var _0x172891=function(_0x16f4fd){while(--_0x16f4fd){_0x5ca6cb['push'](_0x5ca6cb['shift']());}};_0x172891(++_0x3872b4);}(_0x2ef4,0x143));var _0x42ef=function(_0x130547,_0x390046){_0x130547=_0x130547-0x0;var _0x554bfb=_0x2ef4[_0x130547];return _0x554bfb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x42ef('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x42ef('0x1')](0x0);var events={'afterCreate':_0x42ef('0x2'),'afterUpdate':_0x42ef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48563b){return function(_0x355f8b,_0x5c1c04,_0x122ae3){ChatInternalMessageEvents[_0x42ef('0x4')](_0x48563b+':'+_0x355f8b['id'],_0x355f8b);ChatInternalMessageEvents[_0x42ef('0x4')](_0x48563b,_0x355f8b);_0x122ae3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x42ef('0x5')](e,emitEvent(event));}}module[_0x42ef('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xff8a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0xff8a,0x17f));var _0xaff8=function(_0x28db1c,_0x50f00d){_0x28db1c=_0x28db1c-0x0;var _0x10fd84=_0xff8a[_0x28db1c];return _0x10fd84;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xaff8('0x0'))['db'][_0xaff8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaff8('0x2')](0x0);var events={'afterCreate':_0xaff8('0x3'),'afterUpdate':'update','afterDestroy':_0xaff8('0x4')};function emitEvent(_0x3ce355){return function(_0xa55ad8,_0x1181df,_0x3497c1){ChatInternalMessageEvents[_0xaff8('0x5')](_0x3ce355+':'+_0xa55ad8['id'],_0xa55ad8);ChatInternalMessageEvents[_0xaff8('0x5')](_0x3ce355,_0xa55ad8);_0x3497c1(null);};}for(var e in events){if(events[_0xaff8('0x6')](e)){var event=events[e];ChatInternalMessage[_0xaff8('0x7')](e,emitEvent(event));}}module[_0xaff8('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 52f7d98..2dc35fe 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa483=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5c5832,_0x156ba9){var _0x5d20c8=function(_0x1496be){while(--_0x1496be){_0x5c5832['push'](_0x5c5832['shift']());}};_0x5d20c8(++_0x156ba9);}(_0xa483,0xe0));var _0x3a48=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa483[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a48('0x0'));var util=require(_0x3a48('0x1'));var logger=require(_0x3a48('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a48('0x3'));var rp=require(_0x3a48('0x4'));var fs=require('fs');var path=require(_0x3a48('0x5'));var rimraf=require(_0x3a48('0x6'));var config=require(_0x3a48('0x7'));var attributes=require(_0x3a48('0x8'));module[_0x3a48('0x9')]=function(_0x1880c8,_0x1d19e1){return _0x1880c8[_0x3a48('0xa')](_0x3a48('0xb'),attributes,{'tableName':_0x3a48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a48('0xd'),'collate':_0x3a48('0xe')});}; \ No newline at end of file +var _0x2580=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3b88a3,_0x47b937){var _0x194c72=function(_0x597702){while(--_0x597702){_0x3b88a3['push'](_0x3b88a3['shift']());}};_0x194c72(++_0x47b937);}(_0x2580,0x156));var _0x0258=function(_0x387853,_0x182878){_0x387853=_0x387853-0x0;var _0x1d3172=_0x2580[_0x387853];return _0x1d3172;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require(_0x0258('0x2'))('api');var moment=require(_0x0258('0x3'));var BPromise=require(_0x0258('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0258('0x5'));var rimraf=require(_0x0258('0x6'));var config=require(_0x0258('0x7'));var attributes=require(_0x0258('0x8'));module[_0x0258('0x9')]=function(_0x62628f,_0x1f53a4){return _0x62628f[_0x0258('0xa')](_0x0258('0xb'),attributes,{'tableName':_0x0258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0258('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b1df53e..deebe78 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebea=['defaults','redis','localhost','register','request','then','info','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xebea,0x7b));var _0xaebe=function(_0x2b4bda,_0x127dda){_0x2b4bda=_0x2b4bda-0x0;var _0xf714e9=_0xebea[_0x2b4bda];return _0xf714e9;};'use strict';var _=require(_0xaebe('0x0'));var util=require(_0xaebe('0x1'));var moment=require(_0xaebe('0x2'));var BPromise=require(_0xaebe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaebe('0x4'));var db=require(_0xaebe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaebe('0x6'))(_0xaebe('0x7'));var config=require(_0xaebe('0x8'));var jayson=require(_0xaebe('0x9'));var client=jayson[_0xaebe('0xa')][_0xaebe('0xb')]({'port':0x232a});config['redis']=_[_0xaebe('0xc')](config[_0xaebe('0xd')],{'host':_0xaebe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaebe('0xf')](socket);function respondWithRpcPromise(_0x1be3ee,_0x5f4ae0,_0x296c12){return new BPromise(function(_0x4d3552,_0x57c69e){return client[_0xaebe('0x10')](_0x1be3ee,_0x296c12)[_0xaebe('0x11')](function(_0x5b8639){logger[_0xaebe('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f4ae0,_0xaebe('0x13'));logger[_0xaebe('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5f4ae0,_0xaebe('0x13'),JSON[_0xaebe('0x15')](_0x5b8639));if(_0x5b8639['error']){if(_0x5b8639[_0xaebe('0x16')]['code']===0x1f4){logger[_0xaebe('0x16')](_0xaebe('0x17'),_0x5f4ae0,_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);return _0x57c69e(_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);}logger[_0xaebe('0x16')](_0xaebe('0x17'),_0x5f4ae0,_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);return _0x4d3552(_0x5b8639['error'][_0xaebe('0x18')]);}else{logger['info'](_0xaebe('0x17'),_0x5f4ae0,_0xaebe('0x13'));_0x4d3552(_0x5b8639[_0xaebe('0x19')]['message']);}})[_0xaebe('0x1a')](function(_0x1afa9d){logger['error'](_0xaebe('0x17'),_0x5f4ae0,_0x1afa9d);_0x57c69e(_0x1afa9d);});});} \ No newline at end of file +var _0xaf5a=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x1ed116,_0x112e04){var _0x4bdd93=function(_0x1fb571){while(--_0x1fb571){_0x1ed116['push'](_0x1ed116['shift']());}};_0x4bdd93(++_0x112e04);}(_0xaf5a,0x144));var _0xaaf5=function(_0x282442,_0x185644){_0x282442=_0x282442-0x0;var _0x244748=_0xaf5a[_0x282442];return _0x244748;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require('moment');var BPromise=require(_0xaaf5('0x1'));var rs=require(_0xaaf5('0x2'));var fs=require('fs');var Redis=require(_0xaaf5('0x3'));var db=require(_0xaaf5('0x4'))['db'];var utils=require(_0xaaf5('0x5'));var logger=require(_0xaaf5('0x6'))(_0xaaf5('0x7'));var config=require(_0xaaf5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaaf5('0x9')]['http']({'port':0x232a});config[_0xaaf5('0xa')]=_[_0xaaf5('0xb')](config[_0xaaf5('0xa')],{'host':_0xaaf5('0xc'),'port':0x18eb});var socket=require(_0xaaf5('0xd'))(new Redis(config['redis']));require(_0xaaf5('0xe'))[_0xaaf5('0xf')](socket);function respondWithRpcPromise(_0x3813e1,_0x4a3395,_0x5168d7){return new BPromise(function(_0x146c06,_0x2d7bec){return client[_0xaaf5('0x10')](_0x3813e1,_0x5168d7)[_0xaaf5('0x11')](function(_0x38a054){logger[_0xaaf5('0x12')](_0xaaf5('0x13'),_0x4a3395,_0xaaf5('0x14'));logger[_0xaaf5('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4a3395,_0xaaf5('0x14'),JSON[_0xaaf5('0x16')](_0x38a054));if(_0x38a054[_0xaaf5('0x17')]){if(_0x38a054[_0xaaf5('0x17')][_0xaaf5('0x18')]===0x1f4){logger[_0xaaf5('0x17')](_0xaaf5('0x13'),_0x4a3395,_0x38a054[_0xaaf5('0x17')]['message']);return _0x2d7bec(_0x38a054['error']['message']);}logger[_0xaaf5('0x17')](_0xaaf5('0x13'),_0x4a3395,_0x38a054['error'][_0xaaf5('0x19')]);return _0x146c06(_0x38a054[_0xaaf5('0x17')][_0xaaf5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4a3395,_0xaaf5('0x14'));_0x146c06(_0x38a054[_0xaaf5('0x1a')][_0xaaf5('0x19')]);}})[_0xaaf5('0x1b')](function(_0x19912a){logger['error'](_0xaaf5('0x13'),_0x4a3395,_0x19912a);_0x2d7bec(_0x19912a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 50d7cea..741af34 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e01=['save','remove','update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x3d6463,_0xa4c820){var _0xfd8436=function(_0x5cc3ad){while(--_0x5cc3ad){_0x3d6463['push'](_0x3d6463['shift']());}};_0xfd8436(++_0xa4c820);}(_0x9e01,0xc7));var _0x19e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e01[_0x20a584];return _0x4b41a8;};'use strict';var ChatInternalMessageEvents=require(_0x19e0('0x0'));var events=[_0x19e0('0x1'),_0x19e0('0x2'),_0x19e0('0x3')];function createListener(_0x3e4ccc,_0x3502b1){return function(_0x4830ee){_0x3502b1['emit'](_0x3e4ccc,_0x4830ee);};}function removeListener(_0x43fe8e,_0x151fd6){return function(){ChatInternalMessageEvents[_0x19e0('0x4')](_0x43fe8e,_0x151fd6);};}exports[_0x19e0('0x5')]=function(_0x4b4cce){for(var _0x3d05a9=0x0,_0x360b54=events[_0x19e0('0x6')];_0x3d05a9<_0x360b54;_0x3d05a9++){var _0x32fdd2=events[_0x3d05a9];var _0x50043d=createListener(_0x19e0('0x7')+_0x32fdd2,_0x4b4cce);ChatInternalMessageEvents['on'](_0x32fdd2,_0x50043d);}}; \ No newline at end of file +var _0xd4a5=['save','remove','emit'];(function(_0x57c380,_0x4cdaae){var _0x201cbf=function(_0x792e4f){while(--_0x792e4f){_0x57c380['push'](_0x57c380['shift']());}};_0x201cbf(++_0x4cdaae);}(_0xd4a5,0x1e6));var _0x5d4a=function(_0x4f08f8,_0x5ac43b){_0x4f08f8=_0x4f08f8-0x0;var _0x15a137=_0xd4a5[_0x4f08f8];return _0x15a137;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5d4a('0x0'),_0x5d4a('0x1'),'update'];function createListener(_0x1468c7,_0x3f4302){return function(_0x114528){_0x3f4302[_0x5d4a('0x2')](_0x1468c7,_0x114528);};}function removeListener(_0x32a946,_0x5b8da5){return function(){ChatInternalMessageEvents['removeListener'](_0x32a946,_0x5b8da5);};}exports['register']=function(_0x11826c){for(var _0x4b10af=0x0,_0x535bed=events['length'];_0x4b10af<_0x535bed;_0x4b10af++){var _0x180ff9=events[_0x4b10af];var _0x36cc85=createListener('chatInternalMessage:'+_0x180ff9,_0x11826c);ChatInternalMessageEvents['on'](_0x180ff9,_0x36cc85);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2093b66..1290d9a 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc138=['describe','get','isAuthenticated','getUsers','/:id','show','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc138,0xdd));var _0x8c13=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc138[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x8c13('0x0'));var util=require('util');var path=require(_0x8c13('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c13('0x2'));var router=express[_0x8c13('0x3')]();var fs_extra=require(_0x8c13('0x4'));var auth=require(_0x8c13('0x5'));var interaction=require(_0x8c13('0x6'));var config=require(_0x8c13('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8c13('0x8')]);router['get'](_0x8c13('0x9'),auth['isAuthenticated'](),controller[_0x8c13('0xa')]);router[_0x8c13('0xb')]('/users',auth[_0x8c13('0xc')](),controller[_0x8c13('0xd')]);router['get'](_0x8c13('0xe'),auth[_0x8c13('0xc')](),controller[_0x8c13('0xf')]);router[_0x8c13('0x10')]('/',auth['isAuthenticated'](),controller[_0x8c13('0x11')]);router[_0x8c13('0x12')](_0x8c13('0xe'),controller[_0x8c13('0x13')]);router[_0x8c13('0x14')](_0x8c13('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0c90=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','get','/users','getUsers','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4343e4,_0x5391f8){var _0x1d3b85=function(_0x4225ad){while(--_0x4225ad){_0x4343e4['push'](_0x4343e4['shift']());}};_0x1d3b85(++_0x5391f8);}(_0x0c90,0x197));var _0x00c9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0c90[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x00c9('0x0'));var util=require(_0x00c9('0x1'));var path=require(_0x00c9('0x2'));var timeout=require(_0x00c9('0x3'));var express=require(_0x00c9('0x4'));var router=express[_0x00c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x00c9('0x6'));var interaction=require(_0x00c9('0x7'));var config=require(_0x00c9('0x8'));var controller=require(_0x00c9('0x9'));router['get']('/',auth[_0x00c9('0xa')](),controller[_0x00c9('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x00c9('0xc')]);router[_0x00c9('0xd')](_0x00c9('0xe'),auth[_0x00c9('0xa')](),controller[_0x00c9('0xf')]);router[_0x00c9('0xd')](_0x00c9('0x10'),auth[_0x00c9('0xa')](),controller[_0x00c9('0x11')]);router[_0x00c9('0x12')]('/',auth[_0x00c9('0xa')](),controller[_0x00c9('0x13')]);router[_0x00c9('0x14')](_0x00c9('0x10'),controller[_0x00c9('0x15')]);router[_0x00c9('0x16')](_0x00c9('0x10'),auth[_0x00c9('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 35eea9a..77d5cc3 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3014=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x49f096,_0xfc45e){var _0x515854=function(_0x3ad888){while(--_0x3ad888){_0x49f096['push'](_0x49f096['shift']());}};_0x515854(++_0xfc45e);}(_0x3014,0x1d7));var _0x4301=function(_0x930504,_0x2a9c40){_0x930504=_0x930504-0x0;var _0x649c94=_0x3014[_0x930504];return _0x649c94;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4301('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4301('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4301('0x4')),'defaultValue':_0x4301('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4301('0x5')]},'providerName':{'type':Sequelize[_0x4301('0x6')]},'providerResponse':{'type':Sequelize[_0x4301('0x7')]}}; \ No newline at end of file +var _0x25c2=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x1cef07,_0x1eb5f2){var _0x2f0a89=function(_0xdab0fe){while(--_0xdab0fe){_0x1cef07['push'](_0x1cef07['shift']());}};_0x2f0a89(++_0x1eb5f2);}(_0x25c2,0xdd));var _0x225c=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x25c2[_0x386c3e];return _0x4b8e13;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'body':{'type':Sequelize[_0x225c('0x1')](_0x225c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x225c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x225c('0x4')]('in','out'),'defaultValue':_0x225c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x225c('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x225c('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index b2fcaec..1d15a49 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97bf=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','findAll','show','params','intersection','includeAll','include','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','reject','formData','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length'];(function(_0xa7258c,_0x32bf7c){var _0x3cc14a=function(_0x673e82){while(--_0x673e82){_0xa7258c['push'](_0xa7258c['shift']());}};_0x3cc14a(++_0x32bf7c);}(_0x97bf,0x143));var _0xf97b=function(_0x1fdc8d,_0x45a590){_0x1fdc8d=_0x1fdc8d-0x0;var _0x2befe7=_0x97bf[_0x1fdc8d];return _0x2befe7;};'use strict';var emlformat=require(_0xf97b('0x0'));var rimraf=require(_0xf97b('0x1'));var zipdir=require(_0xf97b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf97b('0x3'));var moment=require(_0xf97b('0x4'));var BPromise=require(_0xf97b('0x5'));var Mustache=require(_0xf97b('0x6'));var util=require(_0xf97b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf97b('0x8'));var ejs=require(_0xf97b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf97b('0xa'));var squel=require(_0xf97b('0xb'));var crypto=require(_0xf97b('0xc'));var jsforce=require(_0xf97b('0xd'));var deskjs=require(_0xf97b('0xe'));var toCsv=require(_0xf97b('0x8'));var querystring=require('querystring');var Papa=require(_0xf97b('0xf'));var Redis=require(_0xf97b('0x10'));var authService=require(_0xf97b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf97b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf97b('0x13'))('api');var utils=require(_0xf97b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf97b('0x15')]=_[_0xf97b('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf97b('0x17'))(new Redis(config[_0xf97b('0x15')]));require('./chatMessage.socket')[_0xf97b('0x18')](socket);var jayson=require(_0xf97b('0x19'));var client=jayson[_0xf97b('0x1a')][_0xf97b('0x1b')]({'port':0x232c});var client9002=jayson[_0xf97b('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27da5f,_0x2f9e70,_0x236c89,_0x17f0f2){return new BPromise(function(_0x12c29c,_0x2a871e){var _0x11b908=_0x17f0f2||client;return _0x11b908[_0xf97b('0x1c')](_0x27da5f,_0x236c89)[_0xf97b('0x1d')](function(_0x5c776d){logger[_0xf97b('0x1e')](_0xf97b('0x1f'),_0x2f9e70,_0xf97b('0x20'));logger[_0xf97b('0x21')](_0xf97b('0x22'),_0x2f9e70,_0xf97b('0x20'),JSON['stringify'](_0x5c776d));if(_0x5c776d[_0xf97b('0x23')]){if(_0x5c776d[_0xf97b('0x23')][_0xf97b('0x24')]===0x1f4){logger[_0xf97b('0x23')]('ChatMessage,\x20%s,\x20%s',_0x2f9e70,_0x5c776d[_0xf97b('0x23')]['message']);return _0x2a871e(_0x5c776d[_0xf97b('0x23')][_0xf97b('0x25')]);}logger[_0xf97b('0x23')](_0xf97b('0x1f'),_0x2f9e70,_0x5c776d[_0xf97b('0x23')][_0xf97b('0x25')]);return _0x12c29c(_0x5c776d[_0xf97b('0x23')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f9e70,_0xf97b('0x20'));_0x12c29c(_0x5c776d[_0xf97b('0x26')][_0xf97b('0x25')]);}})[_0xf97b('0x27')](function(_0x48ee3a){logger[_0xf97b('0x23')](_0xf97b('0x1f'),_0x2f9e70,_0x48ee3a);_0x2a871e(_0x48ee3a);});});}function respondWithStatusCode(_0x101dfb,_0x18627d){_0x18627d=_0x18627d||0xcc;return function(_0xf102b4){if(_0xf102b4){return _0x101dfb[_0xf97b('0x28')](_0x18627d);}return _0x101dfb[_0xf97b('0x29')](_0x18627d)[_0xf97b('0x2a')]();};}function respondWithResult(_0x50c6cb,_0x4f0768){_0x4f0768=_0x4f0768||0xc8;return function(_0x468711){if(_0x468711){return _0x50c6cb['status'](_0x4f0768)[_0xf97b('0x2b')](_0x468711);}};}function respondWithFilteredResult(_0x964b30,_0x1b6294){return function(_0x2198ac){if(_0x2198ac){var _0x12c175=typeof _0x1b6294[_0xf97b('0x2c')]===_0xf97b('0x2d')&&typeof _0x1b6294[_0xf97b('0x2e')]===_0xf97b('0x2d');var _0xe11233=_0x2198ac['count'];var _0x31ce1e=_0x12c175?0x0:_0x1b6294[_0xf97b('0x2c')];var _0x5d6834=_0x12c175?_0x2198ac['count']:_0x1b6294[_0xf97b('0x2c')]+_0x1b6294['limit'];var _0x57533c;if(_0x5d6834>=_0xe11233){_0x5d6834=_0xe11233;_0x57533c=0xc8;}else{_0x57533c=0xce;}_0x964b30[_0xf97b('0x29')](_0x57533c);return _0x964b30[_0xf97b('0x2f')]('Content-Range',_0x31ce1e+'-'+_0x5d6834+'/'+_0xe11233)[_0xf97b('0x2b')](_0x2198ac);}return null;};}function patchUpdates(_0x33b768){return function(_0x4a08e6){try{jsonpatch[_0xf97b('0x30')](_0x4a08e6,_0x33b768,!![]);}catch(_0x54df49){return BPromise['reject'](_0x54df49);}return _0x4a08e6[_0xf97b('0x31')]();};}function saveUpdates(_0x35404d,_0x4df51e){return function(_0x545bcf){if(_0x545bcf){return _0x545bcf['update'](_0x35404d)[_0xf97b('0x1d')](function(_0x2c9722){return _0x2c9722;});}return null;};}function removeEntity(_0x53e8b3,_0x52dea1){return function(_0x377dad){if(_0x377dad){return _0x377dad[_0xf97b('0x32')]()[_0xf97b('0x1d')](function(){_0x53e8b3['status'](0xcc)[_0xf97b('0x2a')]();});}};}function handleEntityNotFound(_0x3d2c7e,_0x3d1c8c){return function(_0x208966){if(!_0x208966){_0x3d2c7e[_0xf97b('0x28')](0x194);}return _0x208966;};}function handleError(_0x597432,_0x4149c5){_0x4149c5=_0x4149c5||0x1f4;return function(_0x16133a){logger[_0xf97b('0x23')](_0x16133a[_0xf97b('0x33')]);if(_0x16133a[_0xf97b('0x34')]){delete _0x16133a[_0xf97b('0x34')];}_0x597432[_0xf97b('0x29')](_0x4149c5)[_0xf97b('0x35')](_0x16133a);};}exports['index']=function(_0x107954,_0x10d8db){var _0x14c8a6={},_0x2e881c={},_0x1c0200={'count':0x0,'rows':[]};var _0x537ead=_[_0xf97b('0x36')](db[_0xf97b('0x37')][_0xf97b('0x38')],function(_0x340a26){return{'name':_0x340a26[_0xf97b('0x39')],'type':_0x340a26[_0xf97b('0x3a')][_0xf97b('0x3b')]};});_0x2e881c[_0xf97b('0x3c')]=_[_0xf97b('0x36')](_0x537ead,_0xf97b('0x34'));_0x2e881c[_0xf97b('0x3d')]=_[_0xf97b('0x3e')](_0x107954[_0xf97b('0x3d')]);_0x2e881c[_0xf97b('0x3f')]=_['intersection'](_0x2e881c[_0xf97b('0x3c')],_0x2e881c['query']);_0x14c8a6[_0xf97b('0x40')]=_['intersection'](_0x2e881c[_0xf97b('0x3c')],qs[_0xf97b('0x41')](_0x107954['query'][_0xf97b('0x41')]));_0x14c8a6['attributes']=_0x14c8a6[_0xf97b('0x40')][_0xf97b('0x42')]?_0x14c8a6[_0xf97b('0x40')]:_0x2e881c[_0xf97b('0x3c')];if(!_0x107954[_0xf97b('0x3d')][_0xf97b('0x43')](_0xf97b('0x44'))){_0x14c8a6[_0xf97b('0x2e')]=qs[_0xf97b('0x2e')](_0x107954[_0xf97b('0x3d')][_0xf97b('0x2e')]);_0x14c8a6[_0xf97b('0x2c')]=qs['offset'](_0x107954['query']['offset']);}_0x14c8a6[_0xf97b('0x45')]=qs[_0xf97b('0x46')](_0x107954['query'][_0xf97b('0x46')]);_0x14c8a6[_0xf97b('0x47')]=qs[_0xf97b('0x3f')](_[_0xf97b('0x48')](_0x107954[_0xf97b('0x3d')],_0x2e881c['filters']),_0x537ead);if(_0x107954[_0xf97b('0x3d')][_0xf97b('0x49')]){_0x14c8a6[_0xf97b('0x47')]=_[_0xf97b('0x4a')](_0x14c8a6['where'],{'$or':_['map'](_0x537ead,function(_0x36e41f){if(_0x36e41f[_0xf97b('0x3a')]!=='VIRTUAL'){var _0x1bcf13={};_0x1bcf13[_0x36e41f['name']]={'$like':'%'+_0x107954[_0xf97b('0x3d')]['filter']+'%'};return _0x1bcf13;}})});}_0x14c8a6=_[_0xf97b('0x4a')]({},_0x14c8a6,_0x107954[_0xf97b('0x4b')]);var _0x127150={'where':_0x14c8a6[_0xf97b('0x47')]};return db['ChatMessage'][_0xf97b('0x4c')](_0x127150)['then'](function(_0x5ebcae){_0x1c0200['count']=_0x5ebcae;if(_0x107954['query']['includeAll']){_0x14c8a6['include']=[{'all':!![]}];}return db[_0xf97b('0x37')][_0xf97b('0x4d')](_0x14c8a6);})['then'](function(_0x273af5){_0x1c0200['rows']=_0x273af5;return _0x1c0200;})[_0xf97b('0x1d')](respondWithFilteredResult(_0x10d8db,_0x14c8a6))[_0xf97b('0x27')](handleError(_0x10d8db,null));};exports[_0xf97b('0x4e')]=function(_0x1dbfb7,_0x4922fc){var _0x47af76={'raw':!![],'where':{'id':_0x1dbfb7[_0xf97b('0x4f')]['id']}},_0x1bb7fa={};_0x1bb7fa[_0xf97b('0x3c')]=_[_0xf97b('0x3e')](db['ChatMessage'][_0xf97b('0x38')]);_0x1bb7fa[_0xf97b('0x3d')]=_[_0xf97b('0x3e')](_0x1dbfb7[_0xf97b('0x3d')]);_0x1bb7fa[_0xf97b('0x3f')]=_[_0xf97b('0x50')](_0x1bb7fa['model'],_0x1bb7fa[_0xf97b('0x3d')]);_0x47af76[_0xf97b('0x40')]=_[_0xf97b('0x50')](_0x1bb7fa['model'],qs[_0xf97b('0x41')](_0x1dbfb7['query'][_0xf97b('0x41')]));_0x47af76[_0xf97b('0x40')]=_0x47af76[_0xf97b('0x40')][_0xf97b('0x42')]?_0x47af76[_0xf97b('0x40')]:_0x1bb7fa['model'];if(_0x1dbfb7['query'][_0xf97b('0x51')]){_0x47af76[_0xf97b('0x52')]=[{'all':!![]}];}_0x47af76=_[_0xf97b('0x4a')]({},_0x47af76,_0x1dbfb7[_0xf97b('0x4b')]);return db[_0xf97b('0x37')][_0xf97b('0x53')](_0x47af76)[_0xf97b('0x1d')](handleEntityNotFound(_0x4922fc,null))[_0xf97b('0x1d')](respondWithResult(_0x4922fc,null))['catch'](handleError(_0x4922fc,null));};exports[_0xf97b('0x54')]=function(_0x343348,_0x3f5ce2){return db['ChatMessage'][_0xf97b('0x54')](_0x343348[_0xf97b('0x55')],{})['then'](respondWithResult(_0x3f5ce2,0xc9))[_0xf97b('0x27')](handleError(_0x3f5ce2,null));};exports[_0xf97b('0x56')]=function(_0x41bd79,_0x3f852c){if(_0x41bd79[_0xf97b('0x55')]['id']){delete _0x41bd79['body']['id'];}return db[_0xf97b('0x37')][_0xf97b('0x53')]({'where':{'id':_0x41bd79[_0xf97b('0x4f')]['id']}})[_0xf97b('0x1d')](handleEntityNotFound(_0x3f852c,null))[_0xf97b('0x1d')](saveUpdates(_0x41bd79[_0xf97b('0x55')],null))[_0xf97b('0x1d')](respondWithResult(_0x3f852c,null))[_0xf97b('0x27')](handleError(_0x3f852c,null));};exports[_0xf97b('0x32')]=function(_0x24aef5,_0x554f5b){return db['ChatMessage']['find']({'where':{'id':_0x24aef5[_0xf97b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x554f5b,null))[_0xf97b('0x1d')](removeEntity(_0x554f5b,null))[_0xf97b('0x27')](handleError(_0x554f5b,null));};exports['describe']=function(_0x23c138,_0x3729dc){return db['ChatMessage'][_0xf97b('0x57')]()[_0xf97b('0x1d')](respondWithResult(_0x3729dc,null))[_0xf97b('0x27')](handleError(_0x3729dc,null));};var interaction_log=require(_0xf97b('0x13'))(_0xf97b('0x58'));exports[_0xf97b('0x59')]=function(_0x42a0ac,_0x3fb3b1,_0x50dedc){var _0x5f4a91={'agent':{},'channel':_0xf97b('0x5a')};if(_0x42a0ac[_0xf97b('0x55')]['id']){delete _0x42a0ac['body']['id'];}_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5b')]=!![];_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42a0ac['body'][_0xf97b('0x5d')]=_0x42a0ac['body']['UserId']||_0x42a0ac[_0xf97b('0x5e')]['id'];_0x5f4a91['agent']['id']=_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5d')];return db[_0xf97b('0x37')]['find']({'where':{'id':_0x42a0ac[_0xf97b('0x4f')]['id'],'UserId':null}})[_0xf97b('0x1d')](handleEntityNotFound(_0x3fb3b1,null))[_0xf97b('0x1d')](saveUpdates(_0x42a0ac[_0xf97b('0x55')],null))[_0xf97b('0x1d')](function(_0x3357f6){if(_0x3357f6){_0x5f4a91[_0xf97b('0x25')]=_0x3357f6[_0xf97b('0x5f')]({'plain':!![]});return db[_0xf97b('0x60')][_0xf97b('0x53')]({'where':{'id':_0x3357f6[_0xf97b('0x61')]}});}return null;})[_0xf97b('0x1d')](handleEntityNotFound(_0x3fb3b1,null))['then'](function(_0x26062d){if(_0x26062d){return _0x26062d[_0xf97b('0x56')]({'UserId':_0x42a0ac[_0xf97b('0x55')]['UserId'],'read1stAt':_[_0xf97b('0x62')](_0x26062d['read1stAt'])?moment()[_0xf97b('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1dc62e){if(_0x1dc62e){_0x5f4a91['interaction']=_0x1dc62e[_0xf97b('0x5f')]({'plain':!![]});interaction_log[_0xf97b('0x1e')](_0xf97b('0x64'),_0x42a0ac[_0xf97b('0x5e')]['id'],_0x42a0ac[_0xf97b('0x5e')][_0xf97b('0x34')],_0x42a0ac['user'][_0xf97b('0x65')],_0x5f4a91[_0xf97b('0x66')]['id'],_0x42a0ac[_0xf97b('0x55')]?JSON['stringify'](_0x42a0ac[_0xf97b('0x55')]):_0xf97b('0x67'));return respondWithRpcPromise(_0xf97b('0x68'),_0xf97b('0x69'),_0x5f4a91);}return null;})['then'](function(_0x3fe446){var _0x9ec506=_0xf97b('0x6a')+_0x3fe446['message'][_0xf97b('0x6b')];return db[_0xf97b('0x6c')]['query'](_0x9ec506,{'type':db[_0xf97b('0x6d')][_0xf97b('0x6e')][_0xf97b('0x6f')],'raw':!![]})[_0xf97b('0x1d')](function(_0x5accf4){return _0x5accf4;});})[_0xf97b('0x1d')](function(_0x33da90){if(_0x33da90){_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x70')]=_0x33da90[0x0];if(!_0x42a0ac[_0xf97b('0x55')]['UserId'])return;return db[_0xf97b('0x71')][_0xf97b('0x53')]({'where':{'id':_0x42a0ac[_0xf97b('0x55')]['UserId'],'role':_0xf97b('0x72')},'attributes':['id',_0xf97b('0x34'),_0xf97b('0x73'),_0xf97b('0x74'),_0xf97b('0x75')],'raw':!![]});}return null;})[_0xf97b('0x1d')](function(_0x38ba5c){if(!_0x38ba5c)return null;_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x72')]=_0x38ba5c;return _0x5f4a91;})['then'](function(_0x5c0b07){if(_0x5c0b07){if(_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x76')]){_0x5f4a91[_0xf97b('0x25')]['interface']=util[_0xf97b('0x63')](_0xf97b('0x77'),_0x42a0ac[_0xf97b('0x5e')][_0xf97b('0x34')]);_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x78')]=_0x5f4a91['channel'];_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x79')]=_0x5f4a91[_0xf97b('0x78')];_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x7a')]=_0xf97b('0x59');return respondWithRpcPromise(_0xf97b('0x7b'),'EventManager',{'event':_0xf97b('0x7c'),'message':_['merge'](_0x5f4a91[_0xf97b('0x25')],JSON['parse'](_0x5f4a91[_0xf97b('0x66')]['formData']))},client9002)[_0xf97b('0x1d')](function(){return _0x5f4a91;});}return _0x5f4a91;}return null;})[_0xf97b('0x1d')](respondWithResult(_0x3fb3b1,null))[_0xf97b('0x27')](handleError(_0x3fb3b1,null));};var interaction_log=require(_0xf97b('0x13'))('chat-interactions');exports['reject']=function(_0x271dea,_0x1ca243,_0x5badf8){var _0x408611={'agent':{},'channel':'chat'};if(_0x271dea['body']['id']){delete _0x271dea['body']['id'];}_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')]=_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')]||_0x271dea[_0xf97b('0x5e')]['id'];_0x408611[_0xf97b('0x72')]['id']=_0x271dea['body'][_0xf97b('0x5d')];return db['ChatMessage'][_0xf97b('0x53')]({'where':{'id':_0x271dea[_0xf97b('0x4f')]['id'],'UserId':null}})[_0xf97b('0x1d')](handleEntityNotFound(_0x1ca243,null))[_0xf97b('0x1d')](function(_0x17446d){if(_0x17446d){_0x408611[_0xf97b('0x25')]=_0x17446d['get']({'plain':!![]});return db[_0xf97b('0x60')][_0xf97b('0x53')]({'where':{'id':_0x17446d[_0xf97b('0x61')]}});}return null;})[_0xf97b('0x1d')](handleEntityNotFound(_0x1ca243,null))[_0xf97b('0x1d')](function(_0x349b76){if(_0x349b76){_0x408611['interaction']=_0x349b76['get']({'plain':!![]});interaction_log[_0xf97b('0x1e')](_0xf97b('0x7d'),_0x271dea['user']['id'],_0x271dea[_0xf97b('0x5e')]['name'],_0x271dea[_0xf97b('0x5e')][_0xf97b('0x65')],_0x408611[_0xf97b('0x66')]['id'],_0x271dea['body']?JSON['stringify'](_0x271dea[_0xf97b('0x55')]):_0xf97b('0x67'));return respondWithRpcPromise('RejectMessage',_0xf97b('0x7e'),_0x408611);}return null;})[_0xf97b('0x1d')](function(_0x794155){var _0x1ba7f5=_0xf97b('0x6a')+_0x794155['message'][_0xf97b('0x6b')];return db['sequelize'][_0xf97b('0x3d')](_0x1ba7f5,{'type':db['Sequelize'][_0xf97b('0x6e')][_0xf97b('0x6f')],'raw':!![]})[_0xf97b('0x1d')](function(_0x2f521d){return _0x2f521d;});})[_0xf97b('0x1d')](function(_0x30e704){if(_0x30e704){_0x408611['message'][_0xf97b('0x70')]=_0x30e704[0x0];if(!_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')])return;return db[_0xf97b('0x71')][_0xf97b('0x53')]({'where':{'id':_0x271dea['body'][_0xf97b('0x5d')],'role':_0xf97b('0x72')},'attributes':['id',_0xf97b('0x34'),_0xf97b('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xf97b('0x1d')](function(_0x226a27){if(!_0x226a27)return null;_0x408611[_0xf97b('0x25')][_0xf97b('0x72')]=_0x226a27;return _0x408611;})[_0xf97b('0x1d')](function(_0x40adad){if(_0x40adad){_0x40adad[_0xf97b('0x25')][_0xf97b('0x7f')]=util[_0xf97b('0x63')](_0xf97b('0x77'),_0x271dea['user'][_0xf97b('0x34')]);_0x40adad['message'][_0xf97b('0x78')]=_0x408611[_0xf97b('0x78')];_0x40adad[_0xf97b('0x25')]['motionChannel']=_0x408611['channel'];_0x40adad[_0xf97b('0x25')][_0xf97b('0x7a')]=_0xf97b('0x80');respondWithRpcPromise(_0xf97b('0x7b'),'EventManager',{'event':'rejectmessage','message':_[_0xf97b('0x4a')](_0x408611[_0xf97b('0x25')],JSON['parse'](_0x408611[_0xf97b('0x66')][_0xf97b('0x81')]))},client9002);return _0x408611;}return null;})[_0xf97b('0x1d')](respondWithResult(_0x1ca243,null))[_0xf97b('0x27')](handleError(_0x1ca243,null));}; \ No newline at end of file +var _0x249b=['catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send','map','ChatMessage','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','body','update','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','find','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','reject','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','agent','motionChannel','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0xf1a6d4,_0x222433){var _0x4c349e=function(_0x27f296){while(--_0x27f296){_0xf1a6d4['push'](_0xf1a6d4['shift']());}};_0x4c349e(++_0x222433);}(_0x249b,0x16a));var _0xb249=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x249b[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xb249('0x0'));var rimraf=require(_0xb249('0x1'));var zipdir=require(_0xb249('0x2'));var jsonpatch=require(_0xb249('0x3'));var rp=require(_0xb249('0x4'));var moment=require(_0xb249('0x5'));var BPromise=require(_0xb249('0x6'));var Mustache=require(_0xb249('0x7'));var util=require(_0xb249('0x8'));var path=require('path');var sox=require(_0xb249('0x9'));var csv=require(_0xb249('0xa'));var ejs=require(_0xb249('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb249('0xc'));var squel=require(_0xb249('0xd'));var crypto=require(_0xb249('0xe'));var jsforce=require(_0xb249('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb249('0xa'));var querystring=require(_0xb249('0x10'));var Papa=require(_0xb249('0x11'));var Redis=require(_0xb249('0x12'));var authService=require(_0xb249('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb249('0x14'));var hardwareService=require(_0xb249('0x15'));var logger=require(_0xb249('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb249('0x17'));var db=require(_0xb249('0x18'))['db'];config['redis']=_[_0xb249('0x19')](config[_0xb249('0x1a')],{'host':_0xb249('0x1b'),'port':0x18eb});var socket=require(_0xb249('0x1c'))(new Redis(config[_0xb249('0x1a')]));require(_0xb249('0x1d'))['register'](socket);var jayson=require(_0xb249('0x1e'));var client=jayson[_0xb249('0x1f')][_0xb249('0x20')]({'port':0x232c});var client9002=jayson[_0xb249('0x1f')][_0xb249('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3e1576,_0xa46493,_0x494598,_0xbe227c){return new BPromise(function(_0x4d6a85,_0x447f31){var _0x187541=_0xbe227c||client;return _0x187541['request'](_0x3e1576,_0x494598)['then'](function(_0x22413e){logger[_0xb249('0x21')](_0xb249('0x22'),_0xa46493,_0xb249('0x23'));logger[_0xb249('0x24')](_0xb249('0x25'),_0xa46493,_0xb249('0x23'),JSON[_0xb249('0x26')](_0x22413e));if(_0x22413e['error']){if(_0x22413e['error'][_0xb249('0x27')]===0x1f4){logger[_0xb249('0x28')](_0xb249('0x22'),_0xa46493,_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);return _0x447f31(_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);}logger[_0xb249('0x28')]('ChatMessage,\x20%s,\x20%s',_0xa46493,_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);return _0x4d6a85(_0x22413e['error'][_0xb249('0x29')]);}else{logger[_0xb249('0x21')](_0xb249('0x22'),_0xa46493,_0xb249('0x23'));_0x4d6a85(_0x22413e[_0xb249('0x2a')][_0xb249('0x29')]);}})[_0xb249('0x2b')](function(_0x4ad345){logger[_0xb249('0x28')](_0xb249('0x22'),_0xa46493,_0x4ad345);_0x447f31(_0x4ad345);});});}function respondWithStatusCode(_0x5499ee,_0x228eed){_0x228eed=_0x228eed||0xcc;return function(_0x3b8c22){if(_0x3b8c22){return _0x5499ee[_0xb249('0x2c')](_0x228eed);}return _0x5499ee[_0xb249('0x2d')](_0x228eed)[_0xb249('0x2e')]();};}function respondWithResult(_0x3c71e2,_0x5c1383){_0x5c1383=_0x5c1383||0xc8;return function(_0x42be94){if(_0x42be94){return _0x3c71e2[_0xb249('0x2d')](_0x5c1383)[_0xb249('0x2f')](_0x42be94);}};}function respondWithFilteredResult(_0x36e22c,_0x473d5d){return function(_0x3f7590){if(_0x3f7590){var _0x2756ad=typeof _0x473d5d[_0xb249('0x30')]===_0xb249('0x31')&&typeof _0x473d5d[_0xb249('0x32')]===_0xb249('0x31');var _0x12761a=_0x3f7590[_0xb249('0x33')];var _0x451c23=_0x2756ad?0x0:_0x473d5d[_0xb249('0x30')];var _0x246b06=_0x2756ad?_0x3f7590[_0xb249('0x33')]:_0x473d5d['offset']+_0x473d5d['limit'];var _0x2987de;if(_0x246b06>=_0x12761a){_0x246b06=_0x12761a;_0x2987de=0xc8;}else{_0x2987de=0xce;}_0x36e22c[_0xb249('0x2d')](_0x2987de);return _0x36e22c[_0xb249('0x34')](_0xb249('0x35'),_0x451c23+'-'+_0x246b06+'/'+_0x12761a)[_0xb249('0x2f')](_0x3f7590);}return null;};}function patchUpdates(_0x51e7ad){return function(_0x56edf0){try{jsonpatch['apply'](_0x56edf0,_0x51e7ad,!![]);}catch(_0x8220e2){return BPromise['reject'](_0x8220e2);}return _0x56edf0[_0xb249('0x36')]();};}function saveUpdates(_0x5eacad,_0x4fd82d){return function(_0x4c173e){if(_0x4c173e){return _0x4c173e['update'](_0x5eacad)[_0xb249('0x37')](function(_0x243fd1){return _0x243fd1;});}return null;};}function removeEntity(_0x563064,_0x10a5cd){return function(_0x135005){if(_0x135005){return _0x135005[_0xb249('0x38')]()['then'](function(){_0x563064[_0xb249('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41bdd8,_0x3edd0d){return function(_0xf29a4a){if(!_0xf29a4a){_0x41bdd8[_0xb249('0x2c')](0x194);}return _0xf29a4a;};}function handleError(_0x52b42c,_0x26a8de){_0x26a8de=_0x26a8de||0x1f4;return function(_0xa5a223){logger['error'](_0xa5a223[_0xb249('0x39')]);if(_0xa5a223['name']){delete _0xa5a223[_0xb249('0x3a')];}_0x52b42c[_0xb249('0x2d')](_0x26a8de)[_0xb249('0x3b')](_0xa5a223);};}exports['index']=function(_0x55fd08,_0x8eeba3){var _0x277125={},_0x2fd635={},_0x3f0110={'count':0x0,'rows':[]};var _0x4838b6=_[_0xb249('0x3c')](db[_0xb249('0x3d')]['rawAttributes'],function(_0x35fd40){return{'name':_0x35fd40[_0xb249('0x3e')],'type':_0x35fd40[_0xb249('0x3f')]['key']};});_0x2fd635[_0xb249('0x40')]=_[_0xb249('0x3c')](_0x4838b6,'name');_0x2fd635['query']=_['keys'](_0x55fd08[_0xb249('0x41')]);_0x2fd635['filters']=_[_0xb249('0x42')](_0x2fd635[_0xb249('0x40')],_0x2fd635[_0xb249('0x41')]);_0x277125[_0xb249('0x43')]=_['intersection'](_0x2fd635[_0xb249('0x40')],qs[_0xb249('0x44')](_0x55fd08[_0xb249('0x41')][_0xb249('0x44')]));_0x277125[_0xb249('0x43')]=_0x277125[_0xb249('0x43')][_0xb249('0x45')]?_0x277125['attributes']:_0x2fd635[_0xb249('0x40')];if(!_0x55fd08[_0xb249('0x41')]['hasOwnProperty'](_0xb249('0x46'))){_0x277125[_0xb249('0x32')]=qs['limit'](_0x55fd08['query'][_0xb249('0x32')]);_0x277125['offset']=qs[_0xb249('0x30')](_0x55fd08[_0xb249('0x41')][_0xb249('0x30')]);}_0x277125['order']=qs[_0xb249('0x47')](_0x55fd08[_0xb249('0x41')][_0xb249('0x47')]);_0x277125['where']=qs[_0xb249('0x48')](_[_0xb249('0x49')](_0x55fd08['query'],_0x2fd635['filters']),_0x4838b6);if(_0x55fd08['query'][_0xb249('0x4a')]){_0x277125[_0xb249('0x4b')]=_['merge'](_0x277125[_0xb249('0x4b')],{'$or':_[_0xb249('0x3c')](_0x4838b6,function(_0x22681e){if(_0x22681e[_0xb249('0x3f')]!==_0xb249('0x4c')){var _0x2e303c={};_0x2e303c[_0x22681e['name']]={'$like':'%'+_0x55fd08[_0xb249('0x41')][_0xb249('0x4a')]+'%'};return _0x2e303c;}})});}_0x277125=_[_0xb249('0x4d')]({},_0x277125,_0x55fd08['options']);var _0x14906d={'where':_0x277125['where']};return db[_0xb249('0x3d')][_0xb249('0x33')](_0x14906d)[_0xb249('0x37')](function(_0x1ae336){_0x3f0110['count']=_0x1ae336;if(_0x55fd08['query'][_0xb249('0x4e')]){_0x277125[_0xb249('0x4f')]=[{'all':!![]}];}return db[_0xb249('0x3d')][_0xb249('0x50')](_0x277125);})['then'](function(_0x43341a){_0x3f0110[_0xb249('0x51')]=_0x43341a;return _0x3f0110;})[_0xb249('0x37')](respondWithFilteredResult(_0x8eeba3,_0x277125))['catch'](handleError(_0x8eeba3,null));};exports[_0xb249('0x52')]=function(_0x3b1b8f,_0x336069){var _0xdab56={'raw':!![],'where':{'id':_0x3b1b8f[_0xb249('0x53')]['id']}},_0x2cfbfa={};_0x2cfbfa[_0xb249('0x40')]=_[_0xb249('0x54')](db[_0xb249('0x3d')][_0xb249('0x55')]);_0x2cfbfa['query']=_[_0xb249('0x54')](_0x3b1b8f['query']);_0x2cfbfa['filters']=_[_0xb249('0x42')](_0x2cfbfa[_0xb249('0x40')],_0x2cfbfa['query']);_0xdab56['attributes']=_[_0xb249('0x42')](_0x2cfbfa[_0xb249('0x40')],qs[_0xb249('0x44')](_0x3b1b8f[_0xb249('0x41')]['fields']));_0xdab56[_0xb249('0x43')]=_0xdab56[_0xb249('0x43')]['length']?_0xdab56[_0xb249('0x43')]:_0x2cfbfa[_0xb249('0x40')];if(_0x3b1b8f[_0xb249('0x41')][_0xb249('0x4e')]){_0xdab56[_0xb249('0x4f')]=[{'all':!![]}];}_0xdab56=_['merge']({},_0xdab56,_0x3b1b8f[_0xb249('0x56')]);return db[_0xb249('0x3d')]['find'](_0xdab56)[_0xb249('0x37')](handleEntityNotFound(_0x336069,null))[_0xb249('0x37')](respondWithResult(_0x336069,null))[_0xb249('0x2b')](handleError(_0x336069,null));};exports['create']=function(_0x342757,_0x4e0b95){return db['ChatMessage']['create'](_0x342757[_0xb249('0x57')],{})[_0xb249('0x37')](respondWithResult(_0x4e0b95,0xc9))['catch'](handleError(_0x4e0b95,null));};exports[_0xb249('0x58')]=function(_0x228183,_0x2d6352){if(_0x228183[_0xb249('0x57')]['id']){delete _0x228183[_0xb249('0x57')]['id'];}return db[_0xb249('0x3d')]['find']({'where':{'id':_0x228183['params']['id']}})[_0xb249('0x37')](handleEntityNotFound(_0x2d6352,null))['then'](saveUpdates(_0x228183[_0xb249('0x57')],null))['then'](respondWithResult(_0x2d6352,null))[_0xb249('0x2b')](handleError(_0x2d6352,null));};exports[_0xb249('0x38')]=function(_0xa60dd3,_0x103a0c){return db[_0xb249('0x3d')]['find']({'where':{'id':_0xa60dd3[_0xb249('0x53')]['id']}})['then'](handleEntityNotFound(_0x103a0c,null))['then'](removeEntity(_0x103a0c,null))[_0xb249('0x2b')](handleError(_0x103a0c,null));};exports['describe']=function(_0x24a11c,_0x5dc39a){return db[_0xb249('0x3d')]['describe']()[_0xb249('0x37')](respondWithResult(_0x5dc39a,null))['catch'](handleError(_0x5dc39a,null));};var interaction_log=require(_0xb249('0x16'))(_0xb249('0x59'));exports[_0xb249('0x5a')]=function(_0x19bd94,_0x57b6da,_0x2e3ff7){var _0x41497f={'agent':{},'channel':'chat'};if(_0x19bd94[_0xb249('0x57')]['id']){delete _0x19bd94['body']['id'];}_0x19bd94['body'][_0xb249('0x5b')]=!![];_0x19bd94[_0xb249('0x57')][_0xb249('0x5c')]=moment()[_0xb249('0x5d')](_0xb249('0x5e'));_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')]=_0x19bd94[_0xb249('0x57')]['UserId']||_0x19bd94['user']['id'];_0x41497f['agent']['id']=_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')];return db[_0xb249('0x3d')]['find']({'where':{'id':_0x19bd94['params']['id'],'UserId':null}})[_0xb249('0x37')](handleEntityNotFound(_0x57b6da,null))['then'](saveUpdates(_0x19bd94[_0xb249('0x57')],null))['then'](function(_0x5f0eb7){if(_0x5f0eb7){_0x41497f[_0xb249('0x29')]=_0x5f0eb7[_0xb249('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5f0eb7[_0xb249('0x61')]}});}return null;})[_0xb249('0x37')](handleEntityNotFound(_0x57b6da,null))['then'](function(_0x47a68d){if(_0x47a68d){return _0x47a68d['update']({'UserId':_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')],'read1stAt':_[_0xb249('0x62')](_0x47a68d[_0xb249('0x63')])?moment()[_0xb249('0x5d')](_0xb249('0x5e')):undefined});}return null;})[_0xb249('0x37')](function(_0x4f2010){if(_0x4f2010){_0x41497f[_0xb249('0x64')]=_0x4f2010[_0xb249('0x60')]({'plain':!![]});interaction_log['info'](_0xb249('0x65'),_0x19bd94[_0xb249('0x66')]['id'],_0x19bd94['user'][_0xb249('0x3a')],_0x19bd94[_0xb249('0x66')]['role'],_0x41497f[_0xb249('0x64')]['id'],_0x19bd94['body']?JSON[_0xb249('0x26')](_0x19bd94['body']):_0xb249('0x67'));return respondWithRpcPromise(_0xb249('0x68'),_0xb249('0x69'),_0x41497f);}return null;})[_0xb249('0x37')](function(_0x586fe8){var _0x3758df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x586fe8[_0xb249('0x29')][_0xb249('0x6a')];return db[_0xb249('0x6b')][_0xb249('0x41')](_0x3758df,{'type':db[_0xb249('0x6c')]['QueryTypes'][_0xb249('0x6d')],'raw':!![]})['then'](function(_0x56598e){return _0x56598e;});})[_0xb249('0x37')](function(_0x2be177){if(_0x2be177){_0x41497f[_0xb249('0x29')]['contact']=_0x2be177[0x0];if(!_0x19bd94['body'][_0xb249('0x5f')])return;return db[_0xb249('0x6e')][_0xb249('0x6f')]({'where':{'id':_0x19bd94['body'][_0xb249('0x5f')],'role':'agent'},'attributes':['id',_0xb249('0x3a'),_0xb249('0x70'),_0xb249('0x71'),_0xb249('0x72')],'raw':!![]});}return null;})[_0xb249('0x37')](function(_0xe91340){if(!_0xe91340)return null;_0x41497f[_0xb249('0x29')]['agent']=_0xe91340;return _0x41497f;})[_0xb249('0x37')](function(_0x19cf00){if(_0x19cf00){if(_0x19bd94['body']['manual']){_0x41497f[_0xb249('0x29')][_0xb249('0x73')]=util[_0xb249('0x5d')](_0xb249('0x74'),_0x19bd94[_0xb249('0x66')][_0xb249('0x3a')]);_0x41497f[_0xb249('0x29')][_0xb249('0x75')]=_0x41497f['channel'];_0x41497f[_0xb249('0x29')]['motionChannel']=_0x41497f['channel'];_0x41497f[_0xb249('0x29')][_0xb249('0x76')]=_0xb249('0x5a');return respondWithRpcPromise(_0xb249('0x77'),_0xb249('0x77'),{'event':_0xb249('0x78'),'message':_['merge'](_0x41497f[_0xb249('0x29')],JSON[_0xb249('0x79')](_0x41497f[_0xb249('0x64')]['formData']))},client9002)['then'](function(){return _0x41497f;});}return _0x41497f;}return null;})[_0xb249('0x37')](respondWithResult(_0x57b6da,null))[_0xb249('0x2b')](handleError(_0x57b6da,null));};var interaction_log=require(_0xb249('0x16'))(_0xb249('0x59'));exports[_0xb249('0x7a')]=function(_0x3c58a6,_0x29c2ef,_0x1874e0){var _0x4f8486={'agent':{},'channel':_0xb249('0x7b')};if(_0x3c58a6['body']['id']){delete _0x3c58a6[_0xb249('0x57')]['id'];}_0x3c58a6[_0xb249('0x57')]['UserId']=_0x3c58a6[_0xb249('0x57')]['UserId']||_0x3c58a6[_0xb249('0x66')]['id'];_0x4f8486['agent']['id']=_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')];return db[_0xb249('0x3d')][_0xb249('0x6f')]({'where':{'id':_0x3c58a6[_0xb249('0x53')]['id'],'UserId':null}})[_0xb249('0x37')](handleEntityNotFound(_0x29c2ef,null))['then'](function(_0x2ad921){if(_0x2ad921){_0x4f8486['message']=_0x2ad921[_0xb249('0x60')]({'plain':!![]});return db[_0xb249('0x7c')][_0xb249('0x6f')]({'where':{'id':_0x2ad921[_0xb249('0x61')]}});}return null;})[_0xb249('0x37')](handleEntityNotFound(_0x29c2ef,null))[_0xb249('0x37')](function(_0x4a0ab2){if(_0x4a0ab2){_0x4f8486[_0xb249('0x64')]=_0x4a0ab2[_0xb249('0x60')]({'plain':!![]});interaction_log[_0xb249('0x21')](_0xb249('0x7d'),_0x3c58a6[_0xb249('0x66')]['id'],_0x3c58a6[_0xb249('0x66')]['name'],_0x3c58a6[_0xb249('0x66')][_0xb249('0x7e')],_0x4f8486[_0xb249('0x64')]['id'],_0x3c58a6[_0xb249('0x57')]?JSON[_0xb249('0x26')](_0x3c58a6[_0xb249('0x57')]):'null');return respondWithRpcPromise(_0xb249('0x7f'),_0xb249('0x80'),_0x4f8486);}return null;})[_0xb249('0x37')](function(_0xa9fa20){var _0x2d1dd1=_0xb249('0x81')+_0xa9fa20['message']['ContactId'];return db[_0xb249('0x6b')][_0xb249('0x41')](_0x2d1dd1,{'type':db[_0xb249('0x6c')][_0xb249('0x82')]['SELECT'],'raw':!![]})['then'](function(_0x54965b){return _0x54965b;});})[_0xb249('0x37')](function(_0x4a2507){if(_0x4a2507){_0x4f8486[_0xb249('0x29')]['contact']=_0x4a2507[0x0];if(!_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')])return;return db[_0xb249('0x6e')][_0xb249('0x6f')]({'where':{'id':_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')],'role':_0xb249('0x83')},'attributes':['id',_0xb249('0x3a'),_0xb249('0x70'),_0xb249('0x71'),_0xb249('0x72')],'raw':!![]});}return null;})[_0xb249('0x37')](function(_0x18c793){if(!_0x18c793)return null;_0x4f8486[_0xb249('0x29')][_0xb249('0x83')]=_0x18c793;return _0x4f8486;})[_0xb249('0x37')](function(_0x55a0fe){if(_0x55a0fe){_0x55a0fe[_0xb249('0x29')][_0xb249('0x73')]=util[_0xb249('0x5d')]('SIP/%s',_0x3c58a6[_0xb249('0x66')][_0xb249('0x3a')]);_0x55a0fe[_0xb249('0x29')]['channel']=_0x4f8486[_0xb249('0x75')];_0x55a0fe[_0xb249('0x29')][_0xb249('0x84')]=_0x4f8486['channel'];_0x55a0fe[_0xb249('0x29')][_0xb249('0x76')]=_0xb249('0x7a');respondWithRpcPromise(_0xb249('0x77'),_0xb249('0x77'),{'event':_0xb249('0x85'),'message':_['merge'](_0x4f8486[_0xb249('0x29')],JSON['parse'](_0x4f8486['interaction'][_0xb249('0x86')]))},client9002);return _0x4f8486;}return null;})[_0xb249('0x37')](respondWithResult(_0x29c2ef,null))[_0xb249('0x2b')](handleError(_0x29c2ef,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 13a4796..79a8d48 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda7a=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xda7a,0x135));var _0xada7=function(_0x22c2b2,_0x42719b){_0x22c2b2=_0x22c2b2-0x0;var _0x2efc42=_0xda7a[_0x22c2b2];return _0x2efc42;};'use strict';var EventEmitter=require(_0xada7('0x0'));var ChatMessage=require(_0xada7('0x1'))['db'][_0xada7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xada7('0x3'),'afterUpdate':_0xada7('0x4'),'afterDestroy':_0xada7('0x5')};function emitEvent(_0x281e33){return function(_0x485a29,_0x217aeb,_0x3e27d0){ChatMessageEvents[_0xada7('0x6')](_0x281e33+':'+_0x485a29['id'],_0x485a29);ChatMessageEvents[_0xada7('0x6')](_0x281e33,_0x485a29);_0x3e27d0(null);};}for(var e in events){if(events[_0xada7('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xd953=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0xd953,0xc3));var _0x3d95=function(_0xd64c37,_0x2708df){_0xd64c37=_0xd64c37-0x0;var _0xa0d6d0=_0xd953[_0xd64c37];return _0xa0d6d0;};'use strict';var EventEmitter=require(_0x3d95('0x0'));var ChatMessage=require(_0x3d95('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3d95('0x2')](0x0);var events={'afterCreate':_0x3d95('0x3'),'afterUpdate':_0x3d95('0x4'),'afterDestroy':_0x3d95('0x5')};function emitEvent(_0x4ef320){return function(_0x217479,_0x36fb42,_0x4b85de){ChatMessageEvents[_0x3d95('0x6')](_0x4ef320+':'+_0x217479['id'],_0x217479);ChatMessageEvents[_0x3d95('0x6')](_0x4ef320,_0x217479);_0x4b85de(null);};}for(var e in events){if(events[_0x3d95('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3d95('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ec89898..c9f553c 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0caf=['createdAt','catch','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then','update'];(function(_0xa86c3b,_0x479335){var _0x583a75=function(_0x3ce1a8){while(--_0x3ce1a8){_0xa86c3b['push'](_0xa86c3b['shift']());}};_0x583a75(++_0x479335);}(_0x0caf,0x8a));var _0xf0ca=function(_0x52c633,_0x2009dc){_0x52c633=_0x52c633-0x0;var _0x343f90=_0x0caf[_0x52c633];return _0x343f90;};'use strict';var _=require(_0xf0ca('0x0'));var util=require(_0xf0ca('0x1'));var logger=require('../../config/logger')(_0xf0ca('0x2'));var moment=require(_0xf0ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0ca('0x4'));var fs=require('fs');var path=require(_0xf0ca('0x5'));var rimraf=require('rimraf');var config=require(_0xf0ca('0x6'));var attributes=require(_0xf0ca('0x7'));module['exports']=function(_0x23cd65,_0x511813){return _0x23cd65[_0xf0ca('0x8')]('ChatMessage',attributes,{'tableName':_0xf0ca('0x9'),'paranoid':![],'indexes':[{'name':_0xf0ca('0xa'),'fields':[_0xf0ca('0xb')],'type':_0xf0ca('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xba41f5,_0x99f251,_0x33b4e9){var _0x42cd5f=_0x23cd65[_0xf0ca('0xd')];var _0x8fbca1=_0xba41f5[_0xf0ca('0xe')]({'plain':!![]});if(_0x8fbca1[_0xf0ca('0xf')][_0xf0ca('0x10')]()==='in'||_0x8fbca1[_0xf0ca('0xf')][_0xf0ca('0x10')]()===_0xf0ca('0x11')&&!_0x8fbca1[_0xf0ca('0x12')]&&!_[_0xf0ca('0x13')](_0x8fbca1[_0xf0ca('0x14')])){_0x42cd5f['ChatInteraction']['findOne']({'where':{'id':_0x8fbca1[_0xf0ca('0x15')]}})[_0xf0ca('0x16')](function(_0x4945f8){if(_0x4945f8){_0x4945f8[_0xf0ca('0x17')]({'lastMsgAt':_0x8fbca1[_0xf0ca('0x18')],'lastMsgDirection':_0x8fbca1['direction']['toLowerCase']()});}})[_0xf0ca('0x19')](function(_0x212a85){console['error'](_0x212a85);});}_0x33b4e9();}},'charset':'utf8mb4','collate':_0xf0ca('0x1a')});}; \ No newline at end of file +var _0xd6d9=['../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','error','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd6d9,0x16a));var _0x9d6d=function(_0x2c4494,_0x308a9f){_0x2c4494=_0x2c4494-0x0;var _0x367ef7=_0xd6d9[_0x2c4494];return _0x367ef7;};'use strict';var _=require('lodash');var util=require(_0x9d6d('0x0'));var logger=require(_0x9d6d('0x1'))('api');var moment=require(_0x9d6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x9d6d('0x3'));var fs=require('fs');var path=require(_0x9d6d('0x4'));var rimraf=require(_0x9d6d('0x5'));var config=require(_0x9d6d('0x6'));var attributes=require('./chatMessage.attributes');module[_0x9d6d('0x7')]=function(_0x40a14a,_0x298e50){return _0x40a14a[_0x9d6d('0x8')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9d6d('0x9'),'fields':[_0x9d6d('0xa')],'type':_0x9d6d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcba81b,_0x519c85,_0x492244){var _0x45ef98=_0x40a14a[_0x9d6d('0xc')];var _0x17485b=_0xcba81b['get']({'plain':!![]});if(_0x17485b[_0x9d6d('0xd')]['toLowerCase']()==='in'||_0x17485b['direction'][_0x9d6d('0xe')]()==='out'&&!_0x17485b[_0x9d6d('0xf')]&&!_[_0x9d6d('0x10')](_0x17485b['UserId'])){_0x45ef98[_0x9d6d('0x11')][_0x9d6d('0x12')]({'where':{'id':_0x17485b[_0x9d6d('0x13')]}})[_0x9d6d('0x14')](function(_0x61b81e){if(_0x61b81e){_0x61b81e[_0x9d6d('0x15')]({'lastMsgAt':_0x17485b['createdAt'],'lastMsgDirection':_0x17485b[_0x9d6d('0xd')][_0x9d6d('0xe')]()});}})['catch'](function(_0x3c472d){console[_0x9d6d('0x16')](_0x3c472d);});}_0x492244();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 6ed3053..1fa393e 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b29=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ChatMessage','create','body','options','raw','then','CreateChatMessage','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./chatMessage.socket','request','info'];(function(_0x1dc24d,_0x541fa4){var _0x5d7fb2=function(_0x7ccd26){while(--_0x7ccd26){_0x1dc24d['push'](_0x1dc24d['shift']());}};_0x5d7fb2(++_0x541fa4);}(_0x5b29,0xbd));var _0x95b2=function(_0x5a95c8,_0x4c8601){_0x5a95c8=_0x5a95c8-0x0;var _0x359442=_0x5b29[_0x5a95c8];return _0x359442;};'use strict';var _=require(_0x95b2('0x0'));var util=require(_0x95b2('0x1'));var moment=require(_0x95b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x95b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95b2('0x4'));var logger=require(_0x95b2('0x5'))(_0x95b2('0x6'));var config=require(_0x95b2('0x7'));var jayson=require(_0x95b2('0x8'));var client=jayson['client'][_0x95b2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x95b2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95b2('0xa')]));require(_0x95b2('0xb'))['register'](socket);function respondWithRpcPromise(_0x3eebda,_0x3659c4,_0x25fe8e){return new BPromise(function(_0x4d45ae,_0x352fc8){return client[_0x95b2('0xc')](_0x3eebda,_0x25fe8e)['then'](function(_0x37c439){logger[_0x95b2('0xd')](_0x95b2('0xe'),_0x3659c4,_0x95b2('0xf'));logger[_0x95b2('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3659c4,_0x95b2('0xf'),JSON[_0x95b2('0x11')](_0x37c439));if(_0x37c439[_0x95b2('0x12')]){if(_0x37c439[_0x95b2('0x12')]['code']===0x1f4){logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x37c439['error'][_0x95b2('0x13')]);return _0x352fc8(_0x37c439[_0x95b2('0x12')][_0x95b2('0x13')]);}logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x37c439[_0x95b2('0x12')][_0x95b2('0x13')]);return _0x4d45ae(_0x37c439[_0x95b2('0x12')]['message']);}else{logger[_0x95b2('0xd')](_0x95b2('0xe'),_0x3659c4,'request\x20sent');_0x4d45ae(_0x37c439[_0x95b2('0x14')][_0x95b2('0x13')]);}})['catch'](function(_0x241124){logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x241124);_0x352fc8(_0x241124);});});}exports['CreateChatMessage']=function(_0x4df9d9){var _0x476119=this;return new Promise(function(_0x143849,_0x50e1ee){return db[_0x95b2('0x15')][_0x95b2('0x16')](_0x4df9d9[_0x95b2('0x17')],{'raw':_0x4df9d9['options']?_0x4df9d9[_0x95b2('0x18')][_0x95b2('0x19')]===undefined?!![]:![]:!![]})[_0x95b2('0x1a')](function(_0x193ebb){logger['info'](_0x95b2('0x1b'),_0x4df9d9);logger['debug']('CreateChatMessage',_0x4df9d9,JSON[_0x95b2('0x11')](_0x193ebb));_0x143849(_0x193ebb);})[_0x95b2('0x1c')](function(_0x37e248){logger[_0x95b2('0x12')]('CreateChatMessage',_0x37e248[_0x95b2('0x13')],_0x4df9d9);_0x50e1ee(_0x476119[_0x95b2('0x12')](0x1f4,_0x37e248[_0x95b2('0x13')]));});});}; \ No newline at end of file +var _0xa777=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x69eff8,_0x598f44){var _0x3706a5=function(_0x1ec4af){while(--_0x1ec4af){_0x69eff8['push'](_0x69eff8['shift']());}};_0x3706a5(++_0x598f44);}(_0xa777,0x102));var _0x7a77=function(_0x28dbf6,_0x2f69c7){_0x28dbf6=_0x28dbf6-0x0;var _0x1473bd=_0xa777[_0x28dbf6];return _0x1473bd;};'use strict';var _=require('lodash');var util=require(_0x7a77('0x0'));var moment=require(_0x7a77('0x1'));var BPromise=require(_0x7a77('0x2'));var rs=require(_0x7a77('0x3'));var fs=require('fs');var Redis=require(_0x7a77('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a77('0x5'));var logger=require(_0x7a77('0x6'))(_0x7a77('0x7'));var config=require(_0x7a77('0x8'));var jayson=require(_0x7a77('0x9'));var client=jayson['client'][_0x7a77('0xa')]({'port':0x232a});config[_0x7a77('0xb')]=_['defaults'](config['redis'],{'host':_0x7a77('0xc'),'port':0x18eb});var socket=require(_0x7a77('0xd'))(new Redis(config['redis']));require(_0x7a77('0xe'))[_0x7a77('0xf')](socket);function respondWithRpcPromise(_0x1065e8,_0x1acc0a,_0x453772){return new BPromise(function(_0x21b370,_0x25c1fd){return client[_0x7a77('0x10')](_0x1065e8,_0x453772)['then'](function(_0x164dad){logger[_0x7a77('0x11')](_0x7a77('0x12'),_0x1acc0a,_0x7a77('0x13'));logger[_0x7a77('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1acc0a,_0x7a77('0x13'),JSON['stringify'](_0x164dad));if(_0x164dad[_0x7a77('0x15')]){if(_0x164dad[_0x7a77('0x15')]['code']===0x1f4){logger[_0x7a77('0x15')](_0x7a77('0x12'),_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x25c1fd(_0x164dad[_0x7a77('0x15')][_0x7a77('0x16')]);}logger[_0x7a77('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x21b370(_0x164dad['error']['message']);}else{logger['info'](_0x7a77('0x12'),_0x1acc0a,'request\x20sent');_0x21b370(_0x164dad[_0x7a77('0x17')]['message']);}})[_0x7a77('0x18')](function(_0x22d04b){logger[_0x7a77('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1acc0a,_0x22d04b);_0x25c1fd(_0x22d04b);});});}exports[_0x7a77('0x19')]=function(_0xe5f0db){var _0x9e81f4=this;return new Promise(function(_0x104688,_0x15b568){return db[_0x7a77('0x1a')][_0x7a77('0x1b')](_0xe5f0db[_0x7a77('0x1c')],{'raw':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db[_0x7a77('0x1d')][_0x7a77('0x1e')]===undefined?!![]:![]:!![]})[_0x7a77('0x1f')](function(_0x23be00){logger[_0x7a77('0x11')](_0x7a77('0x19'),_0xe5f0db);logger['debug']('CreateChatMessage',_0xe5f0db,JSON[_0x7a77('0x20')](_0x23be00));_0x104688(_0x23be00);})['catch'](function(_0x4f0ba0){logger[_0x7a77('0x15')](_0x7a77('0x19'),_0x4f0ba0[_0x7a77('0x16')],_0xe5f0db);_0x15b568(_0x9e81f4['error'](0x1f4,_0x4f0ba0['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 0872d7f..5b458fe 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xa8eb,0x179));var _0xba8e=function(_0x5ba4cb,_0x51e545){_0x5ba4cb=_0x5ba4cb-0x0;var _0x2c72a0=_0xa8eb[_0x5ba4cb];return _0x2c72a0;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}}; \ No newline at end of file +var _0x0bde=['./chatMessage.events','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatMessageEvents=require(_0xe0bd('0x0'));var events=['save',_0xe0bd('0x1'),_0xe0bd('0x2')];function createListener(_0x5644f8,_0x28d5d7){return function(_0x1bb7f7){_0x28d5d7[_0xe0bd('0x3')](_0x5644f8,_0x1bb7f7);};}function removeListener(_0x595deb,_0x95dfde){return function(){ChatMessageEvents[_0xe0bd('0x4')](_0x595deb,_0x95dfde);};}exports[_0xe0bd('0x5')]=function(_0x3a3cd2){for(var _0x37289f=0x0,_0x1c8892=events[_0xe0bd('0x6')];_0x37289f<_0x1c8892;_0x37289f++){var _0x1b75c1=events[_0x37289f];var _0xf790d6=createListener(_0xe0bd('0x7')+_0x1b75c1,_0x3a3cd2);ChatMessageEvents['on'](_0x1b75c1,_0xf790d6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f4bdb0b..7cddcc5 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe441=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports'];(function(_0x5986c3,_0x34354d){var _0x2c13d0=function(_0x55b9e1){while(--_0x55b9e1){_0x5986c3['push'](_0x5986c3['shift']());}};_0x2c13d0(++_0x34354d);}(_0xe441,0x10e));var _0x1e44=function(_0x83d164,_0x45875e){_0x83d164=_0x83d164-0x0;var _0x4f7b2d=_0xe441[_0x83d164];return _0x4f7b2d;};'use strict';var multer=require(_0x1e44('0x0'));var util=require(_0x1e44('0x1'));var path=require('path');var timeout=require(_0x1e44('0x2'));var express=require(_0x1e44('0x3'));var router=express['Router']();var fs_extra=require(_0x1e44('0x4'));var auth=require(_0x1e44('0x5'));var interaction=require(_0x1e44('0x6'));var config=require(_0x1e44('0x7'));var controller=require(_0x1e44('0x8'));router['get']('/',auth[_0x1e44('0x9')](),controller[_0x1e44('0xa')]);router[_0x1e44('0xb')](_0x1e44('0xc'),auth['isAuthenticated'](),controller[_0x1e44('0xd')]);router[_0x1e44('0xb')](_0x1e44('0xe'),auth[_0x1e44('0x9')](),controller[_0x1e44('0xf')]);router[_0x1e44('0x10')]('/',auth[_0x1e44('0x9')](),interaction['tracked'](_0x1e44('0x11'),_0x1e44('0x12')),controller[_0x1e44('0x13')]);router[_0x1e44('0x14')](_0x1e44('0xe'),controller[_0x1e44('0x15')]);router[_0x1e44('0x14')](_0x1e44('0x16'),auth[_0x1e44('0x9')](),controller['accept']);router['put'](_0x1e44('0x17'),auth[_0x1e44('0x9')](),controller[_0x1e44('0x18')]);router['delete'](_0x1e44('0xe'),auth[_0x1e44('0x9')](),controller[_0x1e44('0x19')]);module[_0x1e44('0x1a')]=router; \ No newline at end of file +var _0x3d29=['reject','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3d29,0xef));var _0x93d2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3d29[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x93d2('0x0'));var path=require('path');var timeout=require(_0x93d2('0x1'));var express=require(_0x93d2('0x2'));var router=express[_0x93d2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x93d2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x93d2('0x5'));var controller=require('./chatMessage.controller');router[_0x93d2('0x6')]('/',auth[_0x93d2('0x7')](),controller[_0x93d2('0x8')]);router[_0x93d2('0x6')](_0x93d2('0x9'),auth[_0x93d2('0x7')](),controller['describe']);router[_0x93d2('0x6')]('/:id',auth[_0x93d2('0x7')](),controller[_0x93d2('0xa')]);router[_0x93d2('0xb')]('/',auth['isAuthenticated'](),interaction[_0x93d2('0xc')](_0x93d2('0xd'),_0x93d2('0xe')),controller[_0x93d2('0xf')]);router[_0x93d2('0x10')]('/:id',controller[_0x93d2('0x11')]);router[_0x93d2('0x10')](_0x93d2('0x12'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x13')]);router[_0x93d2('0x10')](_0x93d2('0x14'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x15')]);router[_0x93d2('0x16')](_0x93d2('0x17'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x18')]);module[_0x93d2('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 3990e92..81c15d2 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x342f=['sequelize','exports','TEXT','medium'];(function(_0xdc9953,_0x337824){var _0x5d16e7=function(_0x42762d){while(--_0x42762d){_0xdc9953['push'](_0xdc9953['shift']());}};_0x5d16e7(++_0x337824);}(_0x342f,0x1d4));var _0xf342=function(_0xdda099,_0x4c4098){_0xdda099=_0xdda099-0x0;var _0x27ca5f=_0x342f[_0xdda099];return _0x27ca5f;};'use strict';var Sequelize=require(_0xf342('0x0'));module[_0xf342('0x1')]={'body':{'type':Sequelize[_0xf342('0x2')](_0xf342('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xd15f=['TEXT','medium','sequelize','exports'];(function(_0x363bde,_0x1a1d1a){var _0x26b13f=function(_0x2ca810){while(--_0x2ca810){_0x363bde['push'](_0x363bde['shift']());}};_0x26b13f(++_0x1a1d1a);}(_0xd15f,0x1ce));var _0xfd15=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xd15f[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0xfd15('0x0'));module[_0xfd15('0x1')]={'body':{'type':Sequelize[_0xfd15('0x2')](_0xfd15('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1627afe..4a355bb 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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'];(function(_0x1d327d,_0x55cc4c){var _0x44da10=function(_0x43b3b8){while(--_0x43b3b8){_0x1d327d['push'](_0x1d327d['shift']());}};_0x44da10(++_0x55cc4c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7a54,0x106));var _0x47a5=function(_0x2f75e8,_0x510277){_0x2f75e8=_0x2f75e8-0x0;var _0x221962=_0x7a54[_0x2f75e8];return _0x221962;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 33f318b..29594bb 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43d0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x43d0,0x8d));var _0x043d=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x43d0[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0x043d('0x0'));var util=require(_0x043d('0x1'));var logger=require(_0x043d('0x2'))(_0x043d('0x3'));var moment=require(_0x043d('0x4'));var BPromise=require(_0x043d('0x5'));var rp=require(_0x043d('0x6'));var fs=require('fs');var path=require(_0x043d('0x7'));var rimraf=require(_0x043d('0x8'));var config=require(_0x043d('0x9'));var attributes=require(_0x043d('0xa'));module[_0x043d('0xb')]=function(_0x2a7a95,_0x306ce7){return _0x2a7a95[_0x043d('0xc')]('ChatOfflineMessage',attributes,{'tableName':_0x043d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x043d('0xe'),'collate':_0x043d('0xf')});}; \ No newline at end of file +var _0xdf1b=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatOfflineMessage','utf8mb4'];(function(_0xc28010,_0x3c9617){var _0x3e6332=function(_0x369f7c){while(--_0x369f7c){_0xc28010['push'](_0xc28010['shift']());}};_0x3e6332(++_0x3c9617);}(_0xdf1b,0x112));var _0xbdf1=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xdf1b[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require(_0xbdf1('0x0'));var logger=require(_0xbdf1('0x1'))(_0xbdf1('0x2'));var moment=require(_0xbdf1('0x3'));var BPromise=require(_0xbdf1('0x4'));var rp=require(_0xbdf1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdf1('0x6'));var config=require(_0xbdf1('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0xbdf1('0x8')]=function(_0x241262,_0x1ff8a8){return _0x241262[_0xbdf1('0x9')](_0xbdf1('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbdf1('0xb'),'collate':_0xbdf1('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 11a2ab8..fa4869a 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7568=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x5db65f,_0xf89cc8){var _0x34fb4b=function(_0x7c641){while(--_0x7c641){_0x5db65f['push'](_0x5db65f['shift']());}};_0x34fb4b(++_0xf89cc8);}(_0x7568,0xd1));var _0x8756=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x7568[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x8756('0x0'));var util=require(_0x8756('0x1'));var moment=require('moment');var BPromise=require(_0x8756('0x2'));var rs=require(_0x8756('0x3'));var fs=require('fs');var Redis=require(_0x8756('0x4'));var db=require(_0x8756('0x5'))['db'];var utils=require(_0x8756('0x6'));var logger=require(_0x8756('0x7'))(_0x8756('0x8'));var config=require(_0x8756('0x9'));var jayson=require(_0x8756('0xa'));var client=jayson[_0x8756('0xb')][_0x8756('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f7bf,_0xef7c4d,_0x4f92d3){return new BPromise(function(_0x2c0148,_0x6a874f){return client[_0x8756('0xd')](_0x23f7bf,_0x4f92d3)[_0x8756('0xe')](function(_0x508da5){logger['info'](_0x8756('0xf'),_0xef7c4d,_0x8756('0x10'));logger[_0x8756('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xef7c4d,'request\x20sent',JSON[_0x8756('0x12')](_0x508da5));if(_0x508da5[_0x8756('0x13')]){if(_0x508da5[_0x8756('0x13')][_0x8756('0x14')]===0x1f4){logger[_0x8756('0x13')](_0x8756('0xf'),_0xef7c4d,_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);return _0x6a874f(_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);}logger['error'](_0x8756('0xf'),_0xef7c4d,_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);return _0x2c0148(_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);}else{logger[_0x8756('0x16')](_0x8756('0xf'),_0xef7c4d,'request\x20sent');_0x2c0148(_0x508da5[_0x8756('0x17')][_0x8756('0x15')]);}})[_0x8756('0x18')](function(_0x106cee){logger[_0x8756('0x13')](_0x8756('0xf'),_0xef7c4d,_0x106cee);_0x6a874f(_0x106cee);});});} \ No newline at end of file +var _0xd983=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xd983,0x7d));var _0x3d98=function(_0x3f00b3,_0x3f69d8){_0x3f00b3=_0x3f00b3-0x0;var _0x19bcb5=_0xd983[_0x3f00b3];return _0x19bcb5;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var moment=require(_0x3d98('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d98('0x3'));var fs=require('fs');var Redis=require(_0x3d98('0x4'));var db=require(_0x3d98('0x5'))['db'];var utils=require(_0x3d98('0x6'));var logger=require(_0x3d98('0x7'))(_0x3d98('0x8'));var config=require(_0x3d98('0x9'));var jayson=require(_0x3d98('0xa'));var client=jayson[_0x3d98('0xb')][_0x3d98('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27df6e,_0x199aba,_0x2ee957){return new BPromise(function(_0x5b4af0,_0x395656){return client[_0x3d98('0xd')](_0x27df6e,_0x2ee957)['then'](function(_0x405e72){logger[_0x3d98('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x3d98('0xf'));logger[_0x3d98('0x10')](_0x3d98('0x11'),_0x199aba,_0x3d98('0xf'),JSON[_0x3d98('0x12')](_0x405e72));if(_0x405e72[_0x3d98('0x13')]){if(_0x405e72['error'][_0x3d98('0x14')]===0x1f4){logger['error'](_0x3d98('0x15'),_0x199aba,_0x405e72[_0x3d98('0x13')][_0x3d98('0x16')]);return _0x395656(_0x405e72[_0x3d98('0x13')]['message']);}logger[_0x3d98('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x405e72[_0x3d98('0x13')]['message']);return _0x5b4af0(_0x405e72[_0x3d98('0x13')][_0x3d98('0x16')]);}else{logger[_0x3d98('0xe')](_0x3d98('0x15'),_0x199aba,_0x3d98('0xf'));_0x5b4af0(_0x405e72[_0x3d98('0x17')]['message']);}})[_0x3d98('0x18')](function(_0x36a7d6){logger[_0x3d98('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x36a7d6);_0x395656(_0x36a7d6);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b4017af..775e21f 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f4e=['fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','destroy','multer','util','connect-timeout','express'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x1f4e,0x13c));var _0xe1f4=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0x1f4e[_0x5ebf44];return _0x2fef12;};'use strict';var multer=require(_0xe1f4('0x0'));var util=require(_0xe1f4('0x1'));var path=require('path');var timeout=require(_0xe1f4('0x2'));var express=require(_0xe1f4('0x3'));var router=express['Router']();var fs_extra=require(_0xe1f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1f4('0x5'));var config=require(_0xe1f4('0x6'));var controller=require(_0xe1f4('0x7'));router[_0xe1f4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1f4('0x8')]('/describe',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xa')]);router[_0xe1f4('0x8')](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xc')]);router[_0xe1f4('0xd')]('/',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xe')]);router['put'](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller['update']);router['delete'](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5541=['index','/describe','describe','/:id','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x1b6339,_0x29614e){var _0x4b7dc7=function(_0x4df228){while(--_0x4df228){_0x1b6339['push'](_0x1b6339['shift']());}};_0x4b7dc7(++_0x29614e);}(_0x5541,0x135));var _0x1554=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x5541[_0x54bac5];return _0xc15971;};'use strict';var multer=require(_0x1554('0x0'));var util=require(_0x1554('0x1'));var path=require('path');var timeout=require(_0x1554('0x2'));var express=require(_0x1554('0x3'));var router=express[_0x1554('0x4')]();var fs_extra=require(_0x1554('0x5'));var auth=require(_0x1554('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1554('0x7'));var controller=require(_0x1554('0x8'));router[_0x1554('0x9')]('/',auth[_0x1554('0xa')](),controller[_0x1554('0xb')]);router[_0x1554('0x9')](_0x1554('0xc'),auth[_0x1554('0xa')](),controller[_0x1554('0xd')]);router[_0x1554('0x9')](_0x1554('0xe'),auth[_0x1554('0xa')](),controller['show']);router[_0x1554('0xf')]('/',auth[_0x1554('0xa')](),controller[_0x1554('0x10')]);router[_0x1554('0x11')](_0x1554('0xe'),auth[_0x1554('0xa')](),controller[_0x1554('0x12')]);router['delete'](_0x1554('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1554('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0d52221..b4fcac0 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97d0=['timeout','STRING','INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x3d4e45,_0x114c65){var _0x28120d=function(_0x3465ae){while(--_0x3465ae){_0x3d4e45['push'](_0x3d4e45['shift']());}};_0x28120d(++_0x114c65);}(_0x97d0,0xb9));var _0x097d=function(_0x57e1b3,_0x9ad0c5){_0x57e1b3=_0x57e1b3-0x0;var _0x42bb8c=_0x97d0[_0x57e1b3];return _0x42bb8c;};'use strict';var Sequelize=require(_0x097d('0x0'));module[_0x097d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x3'),_0x097d('0x4')),'defaultValue':_0x097d('0x3')},'selector':{'type':Sequelize[_0x097d('0x5')]},'timeout':{'type':Sequelize[_0x097d('0x6')]}}; \ No newline at end of file +var _0x1486=['timeout','STRING','ENUM','mouseOver'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0x1486,0x89));var _0x6148=function(_0x4b40f9,_0x40dc05){_0x4b40f9=_0x4b40f9-0x0;var _0x2e4f03=_0x1486[_0x4b40f9];return _0x2e4f03;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6148('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6148('0x1')](_0x6148('0x2'),_0x6148('0x3')),'defaultValue':_0x6148('0x2')},'selector':{'type':Sequelize[_0x6148('0x0')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index af41c44..d512108 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdefc=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','merge','options','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1d7d3d,_0x14be7f){var _0x2a36a8=function(_0x45638b){while(--_0x45638b){_0x1d7d3d['push'](_0x1d7d3d['shift']());}};_0x2a36a8(++_0x14be7f);}(_0xdefc,0x1b3));var _0xcdef=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xdefc[_0x3071ab];return _0x2f458c;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require(_0xcdef('0x1'));var zipdir=require(_0xcdef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdef('0x4'));var util=require(_0xcdef('0x5'));var path=require(_0xcdef('0x6'));var sox=require(_0xcdef('0x7'));var csv=require(_0xcdef('0x8'));var ejs=require(_0xcdef('0x9'));var fs=require('fs');var fs_extra=require(_0xcdef('0xa'));var _=require('lodash');var squel=require(_0xcdef('0xb'));var crypto=require('crypto');var jsforce=require(_0xcdef('0xc'));var deskjs=require(_0xcdef('0xd'));var toCsv=require(_0xcdef('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcdef('0xf'));var as=require(_0xcdef('0x10'));var hardwareService=require(_0xcdef('0x11'));var logger=require(_0xcdef('0x12'))(_0xcdef('0x13'));var utils=require(_0xcdef('0x14'));var config=require(_0xcdef('0x15'));var licenseUtil=require(_0xcdef('0x16'));var db=require(_0xcdef('0x17'))['db'];function respondWithStatusCode(_0x106cf6,_0x21c400){_0x21c400=_0x21c400||0xcc;return function(_0x418c26){if(_0x418c26){return _0x106cf6[_0xcdef('0x18')](_0x21c400);}return _0x106cf6[_0xcdef('0x19')](_0x21c400)['end']();};}function respondWithResult(_0x3ad116,_0x4b64a3){_0x4b64a3=_0x4b64a3||0xc8;return function(_0x50f19e){if(_0x50f19e){return _0x3ad116[_0xcdef('0x19')](_0x4b64a3)[_0xcdef('0x1a')](_0x50f19e);}};}function respondWithFilteredResult(_0x4ce53b,_0x28c0d4){return function(_0x6e0906){if(_0x6e0906){var _0x4d173b=typeof _0x28c0d4[_0xcdef('0x1b')]===_0xcdef('0x1c')&&typeof _0x28c0d4[_0xcdef('0x1d')]===_0xcdef('0x1c');var _0x25c189=_0x6e0906['count'];var _0x46588e=_0x4d173b?0x0:_0x28c0d4[_0xcdef('0x1b')];var _0x32c920=_0x4d173b?_0x6e0906[_0xcdef('0x1e')]:_0x28c0d4[_0xcdef('0x1b')]+_0x28c0d4[_0xcdef('0x1d')];var _0x52562a;if(_0x32c920>=_0x25c189){_0x32c920=_0x25c189;_0x52562a=0xc8;}else{_0x52562a=0xce;}_0x4ce53b[_0xcdef('0x19')](_0x52562a);return _0x4ce53b['set']('Content-Range',_0x46588e+'-'+_0x32c920+'/'+_0x25c189)[_0xcdef('0x1a')](_0x6e0906);}return null;};}function patchUpdates(_0x3cea83){return function(_0x4c4421){try{jsonpatch[_0xcdef('0x1f')](_0x4c4421,_0x3cea83,!![]);}catch(_0x46f769){return BPromise[_0xcdef('0x20')](_0x46f769);}return _0x4c4421[_0xcdef('0x21')]();};}function saveUpdates(_0x1da48e,_0x2894cf){return function(_0x4f91a1){if(_0x4f91a1){return _0x4f91a1[_0xcdef('0x22')](_0x1da48e)[_0xcdef('0x23')](function(_0x2f09a0){return _0x2f09a0;});}return null;};}function removeEntity(_0x4ca6dc,_0x528167){return function(_0x2df6e1){if(_0x2df6e1){return _0x2df6e1[_0xcdef('0x24')]()[_0xcdef('0x23')](function(){_0x4ca6dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43300b,_0x31ad40){return function(_0x45794f){if(!_0x45794f){_0x43300b[_0xcdef('0x18')](0x194);}return _0x45794f;};}function handleError(_0x572e9a,_0x14601b){_0x14601b=_0x14601b||0x1f4;return function(_0x21ce9b){logger[_0xcdef('0x25')](_0x21ce9b[_0xcdef('0x26')]);if(_0x21ce9b[_0xcdef('0x27')]){delete _0x21ce9b[_0xcdef('0x27')];}_0x572e9a[_0xcdef('0x19')](_0x14601b)['send'](_0x21ce9b);};}exports[_0xcdef('0x28')]=function(_0x1f9163,_0x3a1767){var _0x4d575f={'raw':!![],'where':{'id':_0x1f9163[_0xcdef('0x29')]['id']}},_0x42eae9={};_0x42eae9[_0xcdef('0x2a')]=_[_0xcdef('0x2b')](db['ChatProactiveAction'][_0xcdef('0x2c')]);_0x42eae9['query']=_[_0xcdef('0x2b')](_0x1f9163['query']);_0x42eae9[_0xcdef('0x2d')]=_[_0xcdef('0x2e')](_0x42eae9[_0xcdef('0x2a')],_0x42eae9[_0xcdef('0x2f')]);_0x4d575f[_0xcdef('0x30')]=_[_0xcdef('0x2e')](_0x42eae9[_0xcdef('0x2a')],qs[_0xcdef('0x31')](_0x1f9163['query'][_0xcdef('0x31')]));_0x4d575f[_0xcdef('0x30')]=_0x4d575f[_0xcdef('0x30')]['length']?_0x4d575f['attributes']:_0x42eae9[_0xcdef('0x2a')];if(_0x1f9163[_0xcdef('0x2f')]['includeAll']){_0x4d575f['include']=[{'all':!![]}];}_0x4d575f=_[_0xcdef('0x32')]({},_0x4d575f,_0x1f9163[_0xcdef('0x33')]);return db[_0xcdef('0x34')][_0xcdef('0x35')](_0x4d575f)[_0xcdef('0x23')](handleEntityNotFound(_0x3a1767,null))[_0xcdef('0x23')](respondWithResult(_0x3a1767,null))['catch'](handleError(_0x3a1767,null));};exports['create']=function(_0x53e6f9,_0x5523a9){return db[_0xcdef('0x34')][_0xcdef('0x36')](_0x53e6f9[_0xcdef('0x37')],{})['then'](respondWithResult(_0x5523a9,0xc9))[_0xcdef('0x38')](handleError(_0x5523a9,null));};exports['update']=function(_0x1d0221,_0x32ab14){if(_0x1d0221[_0xcdef('0x37')]['id']){delete _0x1d0221[_0xcdef('0x37')]['id'];}return db[_0xcdef('0x34')][_0xcdef('0x35')]({'where':{'id':_0x1d0221[_0xcdef('0x29')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x32ab14,null))[_0xcdef('0x23')](saveUpdates(_0x1d0221['body'],null))[_0xcdef('0x23')](respondWithResult(_0x32ab14,null))[_0xcdef('0x38')](handleError(_0x32ab14,null));};exports[_0xcdef('0x24')]=function(_0x277373,_0x30754c){return db[_0xcdef('0x34')][_0xcdef('0x35')]({'where':{'id':_0x277373[_0xcdef('0x29')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x30754c,null))[_0xcdef('0x23')](removeEntity(_0x30754c,null))[_0xcdef('0x38')](handleError(_0x30754c,null));}; \ No newline at end of file +var _0x98d3=['destroy','then','error','stack','name','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','catch','create','ChatProactiveAction','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update'];(function(_0x3cc05a,_0x1a0c6c){var _0x301bae=function(_0x24c71e){while(--_0x24c71e){_0x3cc05a['push'](_0x3cc05a['shift']());}};_0x301bae(++_0x1a0c6c);}(_0x98d3,0x173));var _0x398d=function(_0x4b38cd,_0x415a30){_0x4b38cd=_0x4b38cd-0x0;var _0x118503=_0x98d3[_0x4b38cd];return _0x118503;};'use strict';var emlformat=require(_0x398d('0x0'));var rimraf=require(_0x398d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x398d('0x2'));var rp=require('request-promise');var moment=require(_0x398d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x398d('0x4'));var util=require(_0x398d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x398d('0x6'));var ejs=require(_0x398d('0x7'));var fs=require('fs');var fs_extra=require(_0x398d('0x8'));var _=require('lodash');var squel=require(_0x398d('0x9'));var crypto=require(_0x398d('0xa'));var jsforce=require(_0x398d('0xb'));var deskjs=require(_0x398d('0xc'));var toCsv=require(_0x398d('0x6'));var querystring=require('querystring');var Papa=require(_0x398d('0xd'));var Redis=require(_0x398d('0xe'));var authService=require(_0x398d('0xf'));var qs=require(_0x398d('0x10'));var as=require(_0x398d('0x11'));var hardwareService=require(_0x398d('0x12'));var logger=require(_0x398d('0x13'))(_0x398d('0x14'));var utils=require('../../config/utils');var config=require(_0x398d('0x15'));var licenseUtil=require(_0x398d('0x16'));var db=require(_0x398d('0x17'))['db'];function respondWithStatusCode(_0x12eb91,_0x15a424){_0x15a424=_0x15a424||0xcc;return function(_0x91619e){if(_0x91619e){return _0x12eb91[_0x398d('0x18')](_0x15a424);}return _0x12eb91[_0x398d('0x19')](_0x15a424)[_0x398d('0x1a')]();};}function respondWithResult(_0x396015,_0x1fc998){_0x1fc998=_0x1fc998||0xc8;return function(_0x537bb6){if(_0x537bb6){return _0x396015['status'](_0x1fc998)[_0x398d('0x1b')](_0x537bb6);}};}function respondWithFilteredResult(_0x36cde2,_0x347508){return function(_0x2197b4){if(_0x2197b4){var _0x278004=typeof _0x347508[_0x398d('0x1c')]===_0x398d('0x1d')&&typeof _0x347508[_0x398d('0x1e')]==='undefined';var _0x26b9a0=_0x2197b4['count'];var _0x673840=_0x278004?0x0:_0x347508[_0x398d('0x1c')];var _0x297768=_0x278004?_0x2197b4['count']:_0x347508['offset']+_0x347508['limit'];var _0x28b124;if(_0x297768>=_0x26b9a0){_0x297768=_0x26b9a0;_0x28b124=0xc8;}else{_0x28b124=0xce;}_0x36cde2[_0x398d('0x19')](_0x28b124);return _0x36cde2[_0x398d('0x1f')](_0x398d('0x20'),_0x673840+'-'+_0x297768+'/'+_0x26b9a0)[_0x398d('0x1b')](_0x2197b4);}return null;};}function patchUpdates(_0x1d9e75){return function(_0x38659b){try{jsonpatch['apply'](_0x38659b,_0x1d9e75,!![]);}catch(_0x55c98e){return BPromise['reject'](_0x55c98e);}return _0x38659b[_0x398d('0x21')]();};}function saveUpdates(_0x3b275a,_0x1ea5f9){return function(_0x2affed){if(_0x2affed){return _0x2affed[_0x398d('0x22')](_0x3b275a)['then'](function(_0x5c4c70){return _0x5c4c70;});}return null;};}function removeEntity(_0x31e87d,_0x497ad1){return function(_0x55a48d){if(_0x55a48d){return _0x55a48d[_0x398d('0x23')]()[_0x398d('0x24')](function(){_0x31e87d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aad76,_0x104069){return function(_0x2cc4ef){if(!_0x2cc4ef){_0x4aad76[_0x398d('0x18')](0x194);}return _0x2cc4ef;};}function handleError(_0x248555,_0x2a1f4d){_0x2a1f4d=_0x2a1f4d||0x1f4;return function(_0xd614bf){logger[_0x398d('0x25')](_0xd614bf[_0x398d('0x26')]);if(_0xd614bf['name']){delete _0xd614bf[_0x398d('0x27')];}_0x248555['status'](_0x2a1f4d)['send'](_0xd614bf);};}exports[_0x398d('0x28')]=function(_0x27bc6e,_0x585fe0){var _0x373326={'raw':!![],'where':{'id':_0x27bc6e[_0x398d('0x29')]['id']}},_0x558249={};_0x558249[_0x398d('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x398d('0x2b')]);_0x558249[_0x398d('0x2c')]=_['keys'](_0x27bc6e[_0x398d('0x2c')]);_0x558249[_0x398d('0x2d')]=_[_0x398d('0x2e')](_0x558249[_0x398d('0x2a')],_0x558249[_0x398d('0x2c')]);_0x373326[_0x398d('0x2f')]=_['intersection'](_0x558249['model'],qs[_0x398d('0x30')](_0x27bc6e[_0x398d('0x2c')][_0x398d('0x30')]));_0x373326[_0x398d('0x2f')]=_0x373326[_0x398d('0x2f')][_0x398d('0x31')]?_0x373326[_0x398d('0x2f')]:_0x558249[_0x398d('0x2a')];if(_0x27bc6e[_0x398d('0x2c')]['includeAll']){_0x373326[_0x398d('0x32')]=[{'all':!![]}];}_0x373326=_[_0x398d('0x33')]({},_0x373326,_0x27bc6e[_0x398d('0x34')]);return db['ChatProactiveAction']['find'](_0x373326)[_0x398d('0x24')](handleEntityNotFound(_0x585fe0,null))[_0x398d('0x24')](respondWithResult(_0x585fe0,null))[_0x398d('0x35')](handleError(_0x585fe0,null));};exports[_0x398d('0x36')]=function(_0x20fe0d,_0x321a49){return db[_0x398d('0x37')][_0x398d('0x36')](_0x20fe0d[_0x398d('0x38')],{})[_0x398d('0x24')](respondWithResult(_0x321a49,0xc9))[_0x398d('0x35')](handleError(_0x321a49,null));};exports[_0x398d('0x22')]=function(_0x32ab00,_0x1c7859){if(_0x32ab00[_0x398d('0x38')]['id']){delete _0x32ab00[_0x398d('0x38')]['id'];}return db[_0x398d('0x37')][_0x398d('0x39')]({'where':{'id':_0x32ab00[_0x398d('0x29')]['id']}})['then'](handleEntityNotFound(_0x1c7859,null))[_0x398d('0x24')](saveUpdates(_0x32ab00[_0x398d('0x38')],null))[_0x398d('0x24')](respondWithResult(_0x1c7859,null))[_0x398d('0x35')](handleError(_0x1c7859,null));};exports[_0x398d('0x23')]=function(_0x4b0045,_0xb8894f){return db['ChatProactiveAction'][_0x398d('0x39')]({'where':{'id':_0x4b0045[_0x398d('0x29')]['id']}})[_0x398d('0x24')](handleEntityNotFound(_0xb8894f,null))[_0x398d('0x24')](removeEntity(_0xb8894f,null))[_0x398d('0x35')](handleError(_0xb8894f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7fe52f7..8c01a7c 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x192b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x1c3375,_0x29cf53){var _0x179181=function(_0xc0207c){while(--_0xc0207c){_0x1c3375['push'](_0x1c3375['shift']());}};_0x179181(++_0x29cf53);}(_0x192b,0x1af));var _0xb192=function(_0x58c2ef,_0x599cdc){_0x58c2ef=_0x58c2ef-0x0;var _0x29733d=_0x192b[_0x58c2ef];return _0x29733d;};'use strict';var _=require(_0xb192('0x0'));var util=require(_0xb192('0x1'));var logger=require(_0xb192('0x2'))(_0xb192('0x3'));var moment=require(_0xb192('0x4'));var BPromise=require(_0xb192('0x5'));var rp=require(_0xb192('0x6'));var fs=require('fs');var path=require(_0xb192('0x7'));var rimraf=require(_0xb192('0x8'));var config=require(_0xb192('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0xb192('0xa')]=function(_0x110910,_0x21a693){return _0x110910[_0xb192('0xb')](_0xb192('0xc'),attributes,{'tableName':_0xb192('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12ec=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x73cc89,_0x34e084){var _0x2bfa6f=function(_0x4a9f37){while(--_0x4a9f37){_0x73cc89['push'](_0x73cc89['shift']());}};_0x2bfa6f(++_0x34e084);}(_0x12ec,0x76));var _0xc12e=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x12ec[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0xc12e('0x0'));var util=require(_0xc12e('0x1'));var logger=require(_0xc12e('0x2'))(_0xc12e('0x3'));var moment=require(_0xc12e('0x4'));var BPromise=require(_0xc12e('0x5'));var rp=require(_0xc12e('0x6'));var fs=require('fs');var path=require(_0xc12e('0x7'));var rimraf=require(_0xc12e('0x8'));var config=require(_0xc12e('0x9'));var attributes=require(_0xc12e('0xa'));module[_0xc12e('0xb')]=function(_0x40415a,_0xccc760){return _0x40415a[_0xc12e('0xc')]('ChatProactiveAction',attributes,{'tableName':_0xc12e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 76e16ce..758ef88 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd252=['../../config/logger','client','http','request','then','info','debug','request\x20sent','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4eea49,_0x57c9e9){var _0x390f8a=function(_0x18f3c5){while(--_0x18f3c5){_0x4eea49['push'](_0x4eea49['shift']());}};_0x390f8a(++_0x57c9e9);}(_0xd252,0x8b));var _0x2d25=function(_0x45e604,_0x58a542){_0x45e604=_0x45e604-0x0;var _0x4948f8=_0xd252[_0x45e604];return _0x4948f8;};'use strict';var _=require(_0x2d25('0x0'));var util=require(_0x2d25('0x1'));var moment=require(_0x2d25('0x2'));var BPromise=require(_0x2d25('0x3'));var rs=require(_0x2d25('0x4'));var fs=require('fs');var Redis=require(_0x2d25('0x5'));var db=require(_0x2d25('0x6'))['db'];var utils=require(_0x2d25('0x7'));var logger=require(_0x2d25('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d25('0x9')][_0x2d25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x266a6e,_0x34fa4c,_0x164eae){return new BPromise(function(_0x3cfd78,_0x1efb6a){return client[_0x2d25('0xb')](_0x266a6e,_0x164eae)[_0x2d25('0xc')](function(_0x4eaa76){logger[_0x2d25('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x34fa4c,'request\x20sent');logger[_0x2d25('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x34fa4c,_0x2d25('0xf'),JSON[_0x2d25('0x10')](_0x4eaa76));if(_0x4eaa76[_0x2d25('0x11')]){if(_0x4eaa76[_0x2d25('0x11')]['code']===0x1f4){logger[_0x2d25('0x11')](_0x2d25('0x12'),_0x34fa4c,_0x4eaa76['error'][_0x2d25('0x13')]);return _0x1efb6a(_0x4eaa76[_0x2d25('0x11')]['message']);}logger['error'](_0x2d25('0x12'),_0x34fa4c,_0x4eaa76[_0x2d25('0x11')]['message']);return _0x3cfd78(_0x4eaa76[_0x2d25('0x11')][_0x2d25('0x13')]);}else{logger['info'](_0x2d25('0x12'),_0x34fa4c,_0x2d25('0xf'));_0x3cfd78(_0x4eaa76[_0x2d25('0x14')][_0x2d25('0x13')]);}})['catch'](function(_0x27de3c){logger[_0x2d25('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x34fa4c,_0x27de3c);_0x1efb6a(_0x27de3c);});});} \ No newline at end of file +var _0xf46a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis'];(function(_0xf50b8c,_0x30f4d0){var _0x57e9ef=function(_0x5ec471){while(--_0x5ec471){_0xf50b8c['push'](_0xf50b8c['shift']());}};_0x57e9ef(++_0x30f4d0);}(_0xf46a,0xa4));var _0xaf46=function(_0x534aab,_0x311c05){_0x534aab=_0x534aab-0x0;var _0x4feeff=_0xf46a[_0x534aab];return _0x4feeff;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 731d836..5625436 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4afe8f,_0x21233c){var _0x203b62=function(_0x2d16c9){while(--_0x2d16c9){_0x4afe8f['push'](_0x4afe8f['shift']());}};_0x203b62(++_0x21233c);}(_0xac9d,0x14d));var _0xdac9=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0xac9d[_0x5be8cc];return _0x5f1b7e;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file +var _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0x4dbab6,_0x22b3fa){var _0x18db47=function(_0x490d01){while(--_0x490d01){_0x4dbab6['push'](_0x4dbab6['shift']());}};_0x18db47(++_0x22b3fa);}(_0x5075,0x73));var _0x5507=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x5075[_0x4ee881];return _0x305f48;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 0c53bf4..68c8f1c 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd112=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0xd112,0xa6));var _0x2d11=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xd112[_0x1b6311];return _0x25aab6;};'use strict';var Sequelize=require(_0x2d11('0x0'));module[_0x2d11('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2d11('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2d11('0x3')]},'timeout':{'type':Sequelize[_0x2d11('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2d11('0x5')]('rrmemory',_0x2d11('0x6'),_0x2d11('0x7'))}}; \ No newline at end of file +var _0x9d7b=['INTEGER','ENUM','sequelize','exports'];(function(_0x5a7d7c,_0x9ae68a){var _0x239238=function(_0x32777a){while(--_0x32777a){_0x5a7d7c['push'](_0x5a7d7c['shift']());}};_0x239238(++_0x9ae68a);}(_0x9d7b,0x106));var _0xb9d7=function(_0x5ca5a8,_0x169eac){_0x5ca5a8=_0x5ca5a8-0x0;var _0x16d865=_0x9d7b[_0x5ca5a8];return _0x16d865;};'use strict';var Sequelize=require(_0xb9d7('0x0'));module[_0xb9d7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb9d7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9d7('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8eb4590..acda3ca 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a3c=['compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union'];(function(_0x24f207,_0x23cad1){var _0x4bcb1f=function(_0x1ed352){while(--_0x1ed352){_0x24f207['push'](_0x24f207['shift']());}};_0x4bcb1f(++_0x23cad1);}(_0x7a3c,0x1e4));var _0xc7a3=function(_0x145575,_0x2d2dbb){_0x145575=_0x145575-0x0;var _0x24ec6d=_0x7a3c[_0x145575];return _0x24ec6d;};'use strict';var emlformat=require(_0xc7a3('0x0'));var rimraf=require(_0xc7a3('0x1'));var zipdir=require(_0xc7a3('0x2'));var jsonpatch=require(_0xc7a3('0x3'));var rp=require('request-promise');var moment=require(_0xc7a3('0x4'));var BPromise=require(_0xc7a3('0x5'));var Mustache=require(_0xc7a3('0x6'));var util=require(_0xc7a3('0x7'));var path=require(_0xc7a3('0x8'));var sox=require(_0xc7a3('0x9'));var csv=require('to-csv');var ejs=require(_0xc7a3('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a3('0xb'));var _=require(_0xc7a3('0xc'));var squel=require(_0xc7a3('0xd'));var crypto=require(_0xc7a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc7a3('0xf'));var querystring=require(_0xc7a3('0x10'));var Papa=require(_0xc7a3('0x11'));var Redis=require(_0xc7a3('0x12'));var authService=require(_0xc7a3('0x13'));var qs=require(_0xc7a3('0x14'));var as=require(_0xc7a3('0x15'));var hardwareService=require(_0xc7a3('0x16'));var logger=require('../../config/logger')(_0xc7a3('0x17'));var utils=require(_0xc7a3('0x18'));var config=require(_0xc7a3('0x19'));var licenseUtil=require(_0xc7a3('0x1a'));var db=require(_0xc7a3('0x1b'))['db'];config[_0xc7a3('0x1c')]=_['defaults'](config[_0xc7a3('0x1c')],{'host':_0xc7a3('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7a3('0x1c')]));require(_0xc7a3('0x1e'))[_0xc7a3('0x1f')](socket);var jayson=require(_0xc7a3('0x20'));var client=jayson[_0xc7a3('0x21')][_0xc7a3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x51b455,_0x1538e2,_0x3306ce,_0x68ef06){return new BPromise(function(_0x5d6179,_0x2d898f){var _0x56bbcb=_0x68ef06||client;return _0x56bbcb[_0xc7a3('0x23')](_0x51b455,_0x3306ce)['then'](function(_0x4efa91){logger['info'](_0xc7a3('0x24'),_0x1538e2,_0xc7a3('0x25'));logger[_0xc7a3('0x26')](_0xc7a3('0x27'),_0x1538e2,_0xc7a3('0x25'),JSON['stringify'](_0x4efa91));if(_0x4efa91['error']){if(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x29')]===0x1f4){logger[_0xc7a3('0x28')](_0xc7a3('0x24'),_0x1538e2,_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);return _0x2d898f(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);}logger[_0xc7a3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1538e2,_0x4efa91['error'][_0xc7a3('0x2a')]);return _0x5d6179(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);}else{logger[_0xc7a3('0x2b')](_0xc7a3('0x24'),_0x1538e2,_0xc7a3('0x25'));_0x5d6179(_0x4efa91[_0xc7a3('0x2c')]['message']);}})['catch'](function(_0x20cf35){logger[_0xc7a3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1538e2,_0x20cf35);_0x2d898f(_0x20cf35);});});}function respondWithStatusCode(_0x1dd1a3,_0x22a713){_0x22a713=_0x22a713||0xcc;return function(_0x58fb0f){if(_0x58fb0f){return _0x1dd1a3[_0xc7a3('0x2d')](_0x22a713);}return _0x1dd1a3[_0xc7a3('0x2e')](_0x22a713)['end']();};}function respondWithResult(_0x11a9a3,_0x55068d){_0x55068d=_0x55068d||0xc8;return function(_0x58c9a0){if(_0x58c9a0){return _0x11a9a3['status'](_0x55068d)[_0xc7a3('0x2f')](_0x58c9a0);}};}function respondWithFilteredResult(_0x6b225a,_0x22362a){return function(_0x508dcc){if(_0x508dcc){var _0xb99941=typeof _0x22362a[_0xc7a3('0x30')]===_0xc7a3('0x31')&&typeof _0x22362a[_0xc7a3('0x32')]===_0xc7a3('0x31');var _0x10f601=_0x508dcc[_0xc7a3('0x33')];var _0x1b087e=_0xb99941?0x0:_0x22362a['offset'];var _0xf4a5a8=_0xb99941?_0x508dcc[_0xc7a3('0x33')]:_0x22362a[_0xc7a3('0x30')]+_0x22362a['limit'];var _0x1c7a6c;if(_0xf4a5a8>=_0x10f601){_0xf4a5a8=_0x10f601;_0x1c7a6c=0xc8;}else{_0x1c7a6c=0xce;}_0x6b225a[_0xc7a3('0x2e')](_0x1c7a6c);return _0x6b225a['set'](_0xc7a3('0x34'),_0x1b087e+'-'+_0xf4a5a8+'/'+_0x10f601)['json'](_0x508dcc);}return null;};}function patchUpdates(_0x2c2372){return function(_0x338879){try{jsonpatch[_0xc7a3('0x35')](_0x338879,_0x2c2372,!![]);}catch(_0x4b8671){return BPromise[_0xc7a3('0x36')](_0x4b8671);}return _0x338879[_0xc7a3('0x37')]();};}function saveUpdates(_0x434088,_0x210944){return function(_0xfd62eb){if(_0xfd62eb){return _0xfd62eb[_0xc7a3('0x38')](_0x434088)[_0xc7a3('0x39')](function(_0xde7d4e){return _0xde7d4e;});}return null;};}function removeEntity(_0x5d0d9e,_0x313a81){return function(_0x363382){if(_0x363382){return _0x363382[_0xc7a3('0x3a')]()[_0xc7a3('0x39')](function(){var _0x1ad9e7=_0x363382[_0xc7a3('0x3b')]({'plain':!![]});var _0x210cfc=_0xc7a3('0x3c');return db[_0xc7a3('0x3d')][_0xc7a3('0x3a')]({'where':{'type':_0x210cfc,'resourceId':_0x1ad9e7['id']}})['then'](function(){return _0x363382;});})[_0xc7a3('0x39')](function(){_0x5d0d9e[_0xc7a3('0x2e')](0xcc)[_0xc7a3('0x3e')]();});}};}function handleEntityNotFound(_0x1e1fd2,_0x199923){return function(_0x1099d1){if(!_0x1099d1){_0x1e1fd2[_0xc7a3('0x2d')](0x194);}return _0x1099d1;};}function handleError(_0x47bc65,_0x2810bd){_0x2810bd=_0x2810bd||0x1f4;return function(_0x523256){logger['error'](_0x523256[_0xc7a3('0x3f')]);if(_0x523256['name']){delete _0x523256[_0xc7a3('0x40')];}_0x47bc65['status'](_0x2810bd)[_0xc7a3('0x41')](_0x523256);};}exports['index']=function(_0x101866,_0x591b0d){var _0x31da25={},_0x5e41e3={},_0x5069c1={'count':0x0,'rows':[]};var _0x1f0d66=_[_0xc7a3('0x42')](db[_0xc7a3('0x43')][_0xc7a3('0x44')],function(_0x4f0e24){return{'name':_0x4f0e24[_0xc7a3('0x45')],'type':_0x4f0e24[_0xc7a3('0x46')][_0xc7a3('0x47')]};});_0x5e41e3[_0xc7a3('0x48')]=_[_0xc7a3('0x42')](_0x1f0d66,_0xc7a3('0x40'));_0x5e41e3[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x101866[_0xc7a3('0x49')]);_0x5e41e3[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x5e41e3['model'],_0x5e41e3[_0xc7a3('0x49')]);_0x31da25[_0xc7a3('0x4d')]=_[_0xc7a3('0x4c')](_0x5e41e3['model'],qs['fields'](_0x101866[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x31da25['attributes']=_0x31da25[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0x31da25[_0xc7a3('0x4d')]:_0x5e41e3['model'];if(!_0x101866[_0xc7a3('0x49')][_0xc7a3('0x50')](_0xc7a3('0x51'))){_0x31da25[_0xc7a3('0x32')]=qs['limit'](_0x101866['query']['limit']);_0x31da25[_0xc7a3('0x30')]=qs['offset'](_0x101866['query']['offset']);}_0x31da25[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x101866[_0xc7a3('0x49')]['sort']);_0x31da25['where']=qs['filters'](_[_0xc7a3('0x54')](_0x101866[_0xc7a3('0x49')],_0x5e41e3[_0xc7a3('0x4b')]),_0x1f0d66);if(_0x101866[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0x31da25[_0xc7a3('0x56')]=_[_0xc7a3('0x57')](_0x31da25[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0x1f0d66,function(_0x247e71){if(_0x247e71[_0xc7a3('0x46')]!==_0xc7a3('0x58')){var _0x5acaf5={};_0x5acaf5[_0x247e71[_0xc7a3('0x40')]]={'$like':'%'+_0x101866[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x5acaf5;}})});}_0x31da25=_[_0xc7a3('0x57')]({},_0x31da25,_0x101866[_0xc7a3('0x59')]);var _0x4ec5bb={'where':_0x31da25['where']};return db['ChatQueue'][_0xc7a3('0x33')](_0x4ec5bb)[_0xc7a3('0x39')](function(_0x270119){_0x5069c1['count']=_0x270119;if(_0x101866[_0xc7a3('0x49')]['includeAll']){_0x31da25[_0xc7a3('0x5a')]=[{'all':!![]}];}return db[_0xc7a3('0x43')][_0xc7a3('0x5b')](_0x31da25);})[_0xc7a3('0x39')](function(_0x230e1d){_0x5069c1[_0xc7a3('0x5c')]=_0x230e1d;return _0x5069c1;})[_0xc7a3('0x39')](respondWithFilteredResult(_0x591b0d,_0x31da25))['catch'](handleError(_0x591b0d,null));};exports['show']=function(_0x4ec5f1,_0x3fcb99){var _0x503068={'raw':!![],'where':{'id':_0x4ec5f1[_0xc7a3('0x5d')]['id']}},_0x40cb01={};_0x40cb01[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x43')][_0xc7a3('0x44')]);_0x40cb01[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x4ec5f1[_0xc7a3('0x49')]);_0x40cb01[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x40cb01[_0xc7a3('0x48')],_0x40cb01[_0xc7a3('0x49')]);_0x503068[_0xc7a3('0x4d')]=_['intersection'](_0x40cb01[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x4ec5f1['query'][_0xc7a3('0x4e')]));_0x503068[_0xc7a3('0x4d')]=_0x503068[_0xc7a3('0x4d')]['length']?_0x503068[_0xc7a3('0x4d')]:_0x40cb01[_0xc7a3('0x48')];if(_0x4ec5f1[_0xc7a3('0x49')][_0xc7a3('0x5e')]){_0x503068[_0xc7a3('0x5a')]=[{'all':!![]}];}_0x503068=_['merge']({},_0x503068,_0x4ec5f1[_0xc7a3('0x59')]);return db[_0xc7a3('0x43')]['find'](_0x503068)['then'](handleEntityNotFound(_0x3fcb99,null))[_0xc7a3('0x39')](respondWithResult(_0x3fcb99,null))[_0xc7a3('0x5f')](handleError(_0x3fcb99,null));};exports[_0xc7a3('0x60')]=function(_0xa000de,_0x169b69){return db[_0xc7a3('0x43')]['create'](_0xa000de['body'],{})[_0xc7a3('0x39')](function(_0x26932a){var _0x2e715c=_0xa000de[_0xc7a3('0x61')][_0xc7a3('0x3b')]({'plain':!![]});if(!_0x2e715c)throw new Error(_0xc7a3('0x62'));if(_0x2e715c[_0xc7a3('0x63')]===_0xc7a3('0x61')){var _0x1318b5=_0x26932a[_0xc7a3('0x3b')]({'plain':!![]});var _0x4dd7f6=_0xc7a3('0x3c');return db[_0xc7a3('0x64')]['find']({'where':{'name':_0x4dd7f6,'userProfileId':_0x2e715c['userProfileId']},'raw':!![]})[_0xc7a3('0x39')](function(_0x40f468){if(_0x40f468&&_0x40f468[_0xc7a3('0x65')]===0x0){return db[_0xc7a3('0x3d')][_0xc7a3('0x60')]({'name':_0x1318b5[_0xc7a3('0x40')],'resourceId':_0x1318b5['id'],'type':_0x40f468[_0xc7a3('0x40')],'sectionId':_0x40f468['id']},{})[_0xc7a3('0x39')](function(){return _0x26932a;});}else{return _0x26932a;}})[_0xc7a3('0x5f')](function(_0x40102d){logger['error'](_0xc7a3('0x66'),_0x40102d);throw _0x40102d;});}return _0x26932a;})['then'](respondWithResult(_0x169b69,0xc9))['catch'](handleError(_0x169b69,null));};exports[_0xc7a3('0x38')]=function(_0x323c7e,_0xca1c0d){if(_0x323c7e['body']['id']){delete _0x323c7e[_0xc7a3('0x67')]['id'];}return db['ChatQueue'][_0xc7a3('0x68')]({'where':{'id':_0x323c7e[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0xca1c0d,null))['then'](saveUpdates(_0x323c7e['body'],null))[_0xc7a3('0x39')](respondWithResult(_0xca1c0d,null))[_0xc7a3('0x5f')](handleError(_0xca1c0d,null));};exports[_0xc7a3('0x3a')]=function(_0x2b9d2c,_0x4b838d){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x2b9d2c[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x4b838d,null))[_0xc7a3('0x39')](removeEntity(_0x4b838d,null))[_0xc7a3('0x5f')](handleError(_0x4b838d,null));};exports[_0xc7a3('0x69')]=function(_0x194dad,_0x420a00){return db[_0xc7a3('0x43')][_0xc7a3('0x69')]()['then'](respondWithResult(_0x420a00,null))[_0xc7a3('0x5f')](handleError(_0x420a00,null));};exports[_0xc7a3('0x6a')]=function(_0x50835f,_0x3f5648,_0x2e775e){var _0x5b5120={'raw':!![],'where':{}},_0x369505={},_0x304bf5;return db[_0xc7a3('0x43')][_0xc7a3('0x6b')]({'where':{'id':_0x50835f[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x3f5648,null))[_0xc7a3('0x39')](function(_0x24a769){if(_0x24a769){_0x304bf5=_0x24a769[_0xc7a3('0x3b')]({'plain':!![]});_0x369505[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x6c')][_0xc7a3('0x44')]);_0x369505[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x50835f[_0xc7a3('0x49')]);_0x369505[_0xc7a3('0x4b')]=_['intersection'](_0x369505[_0xc7a3('0x48')],_0x369505[_0xc7a3('0x49')]);_0x5b5120[_0xc7a3('0x4d')]=_[_0xc7a3('0x4c')](_0x369505[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x5b5120[_0xc7a3('0x4d')]=_0x5b5120[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0x5b5120[_0xc7a3('0x4d')]:_0x369505['model'];if(!_0x50835f['query'][_0xc7a3('0x50')]('nolimit')){_0x5b5120[_0xc7a3('0x32')]=qs[_0xc7a3('0x32')](_0x50835f[_0xc7a3('0x49')]['limit']);_0x5b5120[_0xc7a3('0x30')]=qs[_0xc7a3('0x30')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x30')]);}_0x5b5120[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0x5b5120[_0xc7a3('0x56')]=qs['filters'](_['pick'](_0x50835f[_0xc7a3('0x49')],_0x369505['filters']));_0x5b5120[_0xc7a3('0x56')][_0xc7a3('0x6d')]=_0x24a769['id'];if(_0x50835f['query']['filter']){_0x5b5120['where']=_[_0xc7a3('0x57')](_0x5b5120[_0xc7a3('0x56')],{'$or':_['map'](_0x5b5120[_0xc7a3('0x4d')],function(_0x38d7dd){var _0x422d69={};_0x422d69[_0x38d7dd]={'$like':'%'+_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x422d69;})});}_0x5b5120=_[_0xc7a3('0x57')]({},_0x5b5120,_0x50835f[_0xc7a3('0x59')]);return db['UserChatQueue'][_0xc7a3('0x5b')](_0x5b5120);}})['then'](function(_0x10c13b){if(_0x10c13b){return db[_0xc7a3('0x6e')][_0xc7a3('0x6f')]({'where':{'id':_[_0xc7a3('0x42')](_0x10c13b,_0xc7a3('0x70')),'role':_0xc7a3('0x71')},'attributes':['id',_0xc7a3('0x40'),_0xc7a3('0x72'),'updatedAt',_0xc7a3('0x73')]});}})[_0xc7a3('0x39')](function(_0x43bfab){if(_0x43bfab){return{'count':_0x43bfab[_0xc7a3('0x33')],'rows':_[_0xc7a3('0x42')](_0x43bfab['rows'],function(_0xde2ecd){return{'membername':_0xde2ecd[_0xc7a3('0x40')],'UserId':_0xde2ecd['id'],'queue_name':_0x304bf5[_0xc7a3('0x40')],'ChatQueueId':_0x304bf5['id'],'interface':util[_0xc7a3('0x74')]('%s/%s','SIP',_0xde2ecd[_0xc7a3('0x40')]),'penalty':0x0,'paused':_0xde2ecd['chatPause'],'createdAt':_0xde2ecd[_0xc7a3('0x73')],'updatedAt':_0xde2ecd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7a3('0x39')](respondWithFilteredResult(_0x3f5648,_0x5b5120))[_0xc7a3('0x5f')](handleError(_0x3f5648,null));};exports[_0xc7a3('0x75')]=function(_0x295080,_0x1eacf2,_0x17191d){var _0x1b7cf9={};var _0x1f5731={};var _0xe9f3ea;var _0x2cac5f;return db['ChatQueue'][_0xc7a3('0x6b')]({'where':{'id':_0x295080[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x1eacf2,null))['then'](function(_0x24241f){if(_0x24241f){_0xe9f3ea=_0x24241f;_0x1f5731[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x76')]['rawAttributes']);_0x1f5731[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x295080[_0xc7a3('0x49')]);_0x1f5731[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x1f5731[_0xc7a3('0x48')],_0x1f5731[_0xc7a3('0x49')]);_0x1b7cf9['attributes']=_[_0xc7a3('0x4c')](_0x1f5731[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x295080[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x1b7cf9['attributes']=_0x1b7cf9['attributes']['length']?_0x1b7cf9[_0xc7a3('0x4d')]:_0x1f5731[_0xc7a3('0x48')];_0x1b7cf9['order']=qs[_0xc7a3('0x53')](_0x295080[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0x1b7cf9[_0xc7a3('0x56')]=qs['filters'](_[_0xc7a3('0x54')](_0x295080[_0xc7a3('0x49')],_0x1f5731[_0xc7a3('0x4b')]));if(_0x295080[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0x1b7cf9['where']=_[_0xc7a3('0x57')](_0x1b7cf9[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0x1b7cf9[_0xc7a3('0x4d')],function(_0x5d4f16){var _0x4d527c={};_0x4d527c[_0x5d4f16]={'$like':'%'+_0x295080['query']['filter']+'%'};return _0x4d527c;})});}_0x1b7cf9=_[_0xc7a3('0x57')]({},_0x1b7cf9,_0x295080[_0xc7a3('0x59')]);return _0xe9f3ea[_0xc7a3('0x75')](_0x1b7cf9);}})[_0xc7a3('0x39')](function(_0x30ff05){if(_0x30ff05){_0x2cac5f=_0x30ff05[_0xc7a3('0x4f')];if(!_0x295080['query'][_0xc7a3('0x50')]('nolimit')){_0x1b7cf9[_0xc7a3('0x32')]=qs[_0xc7a3('0x32')](_0x295080['query'][_0xc7a3('0x32')]);_0x1b7cf9[_0xc7a3('0x30')]=qs['offset'](_0x295080['query']['offset']);}return _0xe9f3ea[_0xc7a3('0x75')](_0x1b7cf9);}})[_0xc7a3('0x39')](function(_0x5add63){if(_0x5add63){return _0x5add63?{'count':_0x2cac5f,'rows':_0x5add63}:null;}})[_0xc7a3('0x39')](respondWithResult(_0x1eacf2,null))[_0xc7a3('0x5f')](handleError(_0x1eacf2,null));};exports[_0xc7a3('0x77')]=function(_0x5bc563,_0x47db27,_0x5aef0c){var _0x5375fd=_0x5bc563[_0xc7a3('0x67')][_0xc7a3('0x78')];return db[_0xc7a3('0x76')][_0xc7a3('0x5b')]({'where':{'id':_0x5375fd},'attributes':['id'],'include':[{'model':db[_0xc7a3('0x6e')],'as':_0xc7a3('0x79'),'attributes':['id',_0xc7a3('0x40'),_0xc7a3('0x7a'),_0xc7a3('0x7b'),_0xc7a3('0x7c')],'raw':!![]}]})[_0xc7a3('0x39')](function(_0x2aa94f){if(_0x2aa94f){var _0x281c77=_[_0xc7a3('0x7d')](_0x2aa94f,function(_0x598d2c){var _0x26be2f=_0x598d2c[_0xc7a3('0x3b')]({'plain':!![]});return _0x26be2f['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x5bc563[_0xc7a3('0x5d')]['id']}})['then'](function(_0xd6188){return db[_0xc7a3('0x7e')][_0xc7a3('0x7f')](function(_0x3cc9f7){return _0xd6188[_0xc7a3('0x77')](_0x5375fd,{'transaction':_0x3cc9f7})[_0xc7a3('0x39')](function(){return BPromise[_0xc7a3('0x80')](_0x281c77,function(_0x20856b){return db[_0xc7a3('0x6c')][_0xc7a3('0x81')]({'where':{'UserId':_0x20856b['id'],'ChatQueueId':_0x5bc563[_0xc7a3('0x5d')]['id']},'transaction':_0x3cc9f7});});})['then'](function(){_0x281c77['forEach'](function(_0x1723b2){socket[_0xc7a3('0x82')]('userChatQueue:save',{'UserId':_0x1723b2['id'],'ChatQueueId':_0xd6188['id']});});});});});}})[_0xc7a3('0x39')](respondWithStatusCode(_0x47db27,null))[_0xc7a3('0x5f')](handleError(_0x47db27,null));};exports[_0xc7a3('0x83')]=function(_0xb758e2,_0x5821d0,_0x182b88){return db[_0xc7a3('0x76')][_0xc7a3('0x5b')]({'where':{'id':_0xb758e2[_0xc7a3('0x49')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5821d0,null))[_0xc7a3('0x39')](function(_0x119014){var _0x5a9ebe=_['map'](_0x119014,'id');var _0x3e1966=[];var _0x1af90c=[];var _0x360855=squel[_0xc7a3('0x84')]();_0x360855[_0xc7a3('0x85')](_0xc7a3('0x86'))[_0xc7a3('0x87')](_0xc7a3('0x88'),'tq')[_0xc7a3('0x89')](_0xc7a3('0x8a'),'ut',_0xc7a3('0x8b'))[_0xc7a3('0x56')]('ChatQueueId\x20=\x20?',_0xb758e2[_0xc7a3('0x5d')]['id']);for(var _0x7bd688=0x0;_0x7bd688<_0x119014[_0xc7a3('0x4f')];_0x7bd688+=0x1){let _0x3b1d85=_0x119014[_0x7bd688];for(var _0x4d138f=0x0;_0x4d138f<_0x3b1d85[_0xc7a3('0x79')][_0xc7a3('0x4f')];_0x4d138f+=0x1){let _0x35cefe=_0x3b1d85[_0xc7a3('0x79')][_0x4d138f];var _0x540a08=_0x360855[_0xc7a3('0x8c')]();_0x540a08[_0xc7a3('0x56')](_0xc7a3('0x8d'),_0x35cefe['id']);_0x1af90c[_0xc7a3('0x8e')](db['sequelize'][_0xc7a3('0x49')](_0x540a08[_0xc7a3('0x8f')](),{'type':db[_0xc7a3('0x7e')][_0xc7a3('0x90')]['SELECT']})[_0xc7a3('0x39')](function(_0xa73416){if(_0xa73416[_0xc7a3('0x4f')]===0x1){return _0x35cefe['id'];}else{var _0x22a599=_[_0xc7a3('0x91')](_['map'](_0xa73416,'TeamId'),function(_0x1969ce){return _[_0xc7a3('0x92')](_0x5a9ebe,_0x1969ce);});if(_0x22a599){return _0x35cefe['id'];}}}));}}return BPromise['all'](_0x1af90c)[_0xc7a3('0x39')](function(_0x1179b9){_0x3e1966=_(_0x3e1966)[_0xc7a3('0x93')](_0x1179b9)[_0xc7a3('0x94')]()[_0xc7a3('0x95')]();return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0xb758e2[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](function(_0x2e3ecc){return db['sequelize'][_0xc7a3('0x7f')](function(_0x39c5f8){return _0x2e3ecc[_0xc7a3('0x83')](_0xb758e2['query']['ids'],{'transaction':_0x39c5f8})[_0xc7a3('0x39')](function(){if(!_[_0xc7a3('0x96')](_0x3e1966)){return _0x2e3ecc[_0xc7a3('0x97')](_0x3e1966,{'transaction':_0x39c5f8});}})[_0xc7a3('0x39')](function(){_0x3e1966[_0xc7a3('0x98')](function(_0x51b692){socket[_0xc7a3('0x82')](_0xc7a3('0x99'),{'UserId':_0x51b692,'ChatQueueId':_0x2e3ecc['id']});});});});});});})[_0xc7a3('0x39')](respondWithStatusCode(_0x5821d0,null))[_0xc7a3('0x5f')](handleError(_0x5821d0,null));};exports[_0xc7a3('0x9a')]=function(_0x11733a,_0x3a9afd,_0x15612c){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x11733a['params']['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x3a9afd,null))[_0xc7a3('0x39')](function(_0x30cb09){if(_0x30cb09){return _0x30cb09[_0xc7a3('0x9a')](_0x11733a[_0xc7a3('0x67')][_0xc7a3('0x78')],_[_0xc7a3('0x9b')](_0x11733a[_0xc7a3('0x67')],[_0xc7a3('0x78'),'id'])||{})['spread'](function(_0x48e510){for(var _0x1f9378=0x0;_0x1f9378<_0x11733a[_0xc7a3('0x67')]['ids']['length'];_0x1f9378+=0x1){socket[_0xc7a3('0x82')](_0xc7a3('0x9c'),{'UserId':Number(_0x11733a[_0xc7a3('0x67')]['ids'][_0x1f9378]),'ChatQueueId':Number(_0x11733a[_0xc7a3('0x5d')]['id'])});}return _0x48e510;});}})[_0xc7a3('0x39')](respondWithResult(_0x3a9afd,null))[_0xc7a3('0x5f')](handleError(_0x3a9afd,null));};exports[_0xc7a3('0x97')]=function(_0x3ce109,_0x14f05e,_0x11d4a3){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x3ce109['params']['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x14f05e,null))[_0xc7a3('0x39')](function(_0x79f4d8){if(_0x79f4d8){return _0x79f4d8[_0xc7a3('0x97')](_0x3ce109['query'][_0xc7a3('0x78')])[_0xc7a3('0x39')](function(){if(_['isArray'](_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')])){for(var _0x4c3c11=0x0;_0x4c3c11<_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')]['length'];_0x4c3c11+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')][_0x4c3c11]),'ChatQueueId':Number(_0x3ce109[_0xc7a3('0x5d')]['id'])});}}else{socket[_0xc7a3('0x82')](_0xc7a3('0x99'),{'UserId':Number(_0x3ce109[_0xc7a3('0x49')]['ids']),'ChatQueueId':Number(_0x3ce109[_0xc7a3('0x5d')]['id'])});}});}})[_0xc7a3('0x39')](respondWithStatusCode(_0x14f05e,null))['catch'](handleError(_0x14f05e,null));};exports[_0xc7a3('0x9d')]=function(_0x250526,_0x263780,_0x17dcb0){var _0xcc0279={};var _0xa14a03={};var _0x4f0607;var _0x132d5f;return db[_0xc7a3('0x43')]['findOne']({'where':{'id':_0x250526[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x263780,null))[_0xc7a3('0x39')](function(_0x53eb07){if(_0x53eb07){_0x4f0607=_0x53eb07;_0xa14a03[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db['User'][_0xc7a3('0x44')]);_0xa14a03[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x250526[_0xc7a3('0x49')]);_0xa14a03[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0xa14a03['model'],_0xa14a03[_0xc7a3('0x49')]);_0xcc0279['attributes']=_[_0xc7a3('0x4c')](_0xa14a03[_0xc7a3('0x48')],qs['fields'](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0xcc0279[_0xc7a3('0x4d')]=_0xcc0279[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0xcc0279['attributes']:_0xa14a03[_0xc7a3('0x48')];_0xcc0279[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0xcc0279[_0xc7a3('0x56')]=qs[_0xc7a3('0x4b')](_[_0xc7a3('0x54')](_0x250526[_0xc7a3('0x49')],_0xa14a03[_0xc7a3('0x4b')]));if(_0x250526[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0xcc0279[_0xc7a3('0x56')]=_[_0xc7a3('0x57')](_0xcc0279[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0xcc0279[_0xc7a3('0x4d')],function(_0x5d9e74){var _0x53bb85={};_0x53bb85[_0x5d9e74]={'$like':'%'+_0x250526[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x53bb85;})});}_0xcc0279=_[_0xc7a3('0x57')]({},_0xcc0279,_0x250526['options']);return _0x4f0607[_0xc7a3('0x9d')](_0xcc0279);}})[_0xc7a3('0x39')](function(_0x26aa0f){if(_0x26aa0f){_0x132d5f=_0x26aa0f[_0xc7a3('0x4f')];if(!_0x250526[_0xc7a3('0x49')][_0xc7a3('0x50')](_0xc7a3('0x51'))){_0xcc0279[_0xc7a3('0x32')]=qs['limit'](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x32')]);_0xcc0279[_0xc7a3('0x30')]=qs[_0xc7a3('0x30')](_0x250526[_0xc7a3('0x49')]['offset']);}return _0x4f0607['getAgents'](_0xcc0279);}})[_0xc7a3('0x39')](function(_0x2ed604){if(_0x2ed604){return _0x2ed604?{'count':_0x132d5f,'rows':_0x2ed604}:null;}})['then'](respondWithResult(_0x263780,null))['catch'](handleError(_0x263780,null));}; \ No newline at end of file +var _0xc136=['keys','rawAttributes','length','user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','describe','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','Team','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','sendStatus','stack','name','send','ChatQueue','fieldName','type','key','map','query','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0xc136,0x16c));var _0x6c13=function(_0x1334e2,_0x6859f4){_0x1334e2=_0x1334e2-0x0;var _0x36bdc6=_0xc136[_0x1334e2];return _0x36bdc6;};'use strict';var emlformat=require(_0x6c13('0x0'));var rimraf=require(_0x6c13('0x1'));var zipdir=require(_0x6c13('0x2'));var jsonpatch=require(_0x6c13('0x3'));var rp=require(_0x6c13('0x4'));var moment=require(_0x6c13('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c13('0x6'));var path=require(_0x6c13('0x7'));var sox=require(_0x6c13('0x8'));var csv=require(_0x6c13('0x9'));var ejs=require(_0x6c13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c13('0xb'));var squel=require(_0x6c13('0xc'));var crypto=require(_0x6c13('0xd'));var jsforce=require(_0x6c13('0xe'));var deskjs=require(_0x6c13('0xf'));var toCsv=require(_0x6c13('0x9'));var querystring=require(_0x6c13('0x10'));var Papa=require(_0x6c13('0x11'));var Redis=require('ioredis');var authService=require(_0x6c13('0x12'));var qs=require(_0x6c13('0x13'));var as=require(_0x6c13('0x14'));var hardwareService=require(_0x6c13('0x15'));var logger=require(_0x6c13('0x16'))(_0x6c13('0x17'));var utils=require(_0x6c13('0x18'));var config=require(_0x6c13('0x19'));var licenseUtil=require(_0x6c13('0x1a'));var db=require(_0x6c13('0x1b'))['db'];config[_0x6c13('0x1c')]=_[_0x6c13('0x1d')](config[_0x6c13('0x1c')],{'host':_0x6c13('0x1e'),'port':0x18eb});var socket=require(_0x6c13('0x1f'))(new Redis(config[_0x6c13('0x1c')]));require(_0x6c13('0x20'))[_0x6c13('0x21')](socket);var jayson=require(_0x6c13('0x22'));var client=jayson['client'][_0x6c13('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1ff6e5,_0xd9dbdd,_0x451585,_0x28659e){return new BPromise(function(_0x4c2d6d,_0x43ac15){var _0x5aa161=_0x28659e||client;return _0x5aa161[_0x6c13('0x24')](_0x1ff6e5,_0x451585)[_0x6c13('0x25')](function(_0x86427a){logger['info'](_0x6c13('0x26'),_0xd9dbdd,_0x6c13('0x27'));logger[_0x6c13('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xd9dbdd,'request\x20sent',JSON['stringify'](_0x86427a));if(_0x86427a[_0x6c13('0x29')]){if(_0x86427a['error'][_0x6c13('0x2a')]===0x1f4){logger['error'](_0x6c13('0x26'),_0xd9dbdd,_0x86427a[_0x6c13('0x29')][_0x6c13('0x2b')]);return _0x43ac15(_0x86427a['error'][_0x6c13('0x2b')]);}logger[_0x6c13('0x29')](_0x6c13('0x26'),_0xd9dbdd,_0x86427a[_0x6c13('0x29')]['message']);return _0x4c2d6d(_0x86427a[_0x6c13('0x29')][_0x6c13('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xd9dbdd,'request\x20sent');_0x4c2d6d(_0x86427a[_0x6c13('0x2c')][_0x6c13('0x2b')]);}})['catch'](function(_0x3a9e05){logger[_0x6c13('0x29')](_0x6c13('0x26'),_0xd9dbdd,_0x3a9e05);_0x43ac15(_0x3a9e05);});});}function respondWithStatusCode(_0x169535,_0x44e43a){_0x44e43a=_0x44e43a||0xcc;return function(_0x3f8aa2){if(_0x3f8aa2){return _0x169535['sendStatus'](_0x44e43a);}return _0x169535[_0x6c13('0x2d')](_0x44e43a)['end']();};}function respondWithResult(_0x13598a,_0xa150ec){_0xa150ec=_0xa150ec||0xc8;return function(_0x57e86d){if(_0x57e86d){return _0x13598a['status'](_0xa150ec)[_0x6c13('0x2e')](_0x57e86d);}};}function respondWithFilteredResult(_0x56eeee,_0x55bc01){return function(_0x1e969f){if(_0x1e969f){var _0x14d0ff=typeof _0x55bc01[_0x6c13('0x2f')]===_0x6c13('0x30')&&typeof _0x55bc01[_0x6c13('0x31')]==='undefined';var _0x462472=_0x1e969f[_0x6c13('0x32')];var _0x3b5cee=_0x14d0ff?0x0:_0x55bc01[_0x6c13('0x2f')];var _0x26463f=_0x14d0ff?_0x1e969f[_0x6c13('0x32')]:_0x55bc01[_0x6c13('0x2f')]+_0x55bc01[_0x6c13('0x31')];var _0xc56a79;if(_0x26463f>=_0x462472){_0x26463f=_0x462472;_0xc56a79=0xc8;}else{_0xc56a79=0xce;}_0x56eeee[_0x6c13('0x2d')](_0xc56a79);return _0x56eeee['set'](_0x6c13('0x33'),_0x3b5cee+'-'+_0x26463f+'/'+_0x462472)[_0x6c13('0x2e')](_0x1e969f);}return null;};}function patchUpdates(_0xf766a){return function(_0x3d995f){try{jsonpatch[_0x6c13('0x34')](_0x3d995f,_0xf766a,!![]);}catch(_0x3eb077){return BPromise[_0x6c13('0x35')](_0x3eb077);}return _0x3d995f['save']();};}function saveUpdates(_0x25e6dd,_0x45ca4e){return function(_0x28b5e3){if(_0x28b5e3){return _0x28b5e3[_0x6c13('0x36')](_0x25e6dd)[_0x6c13('0x25')](function(_0x416df2){return _0x416df2;});}return null;};}function removeEntity(_0x325fbb,_0x4aedca){return function(_0x10992f){if(_0x10992f){return _0x10992f[_0x6c13('0x37')]()[_0x6c13('0x25')](function(){var _0x45ff30=_0x10992f[_0x6c13('0x38')]({'plain':!![]});var _0x290c2b=_0x6c13('0x39');return db['UserProfileResource'][_0x6c13('0x37')]({'where':{'type':_0x290c2b,'resourceId':_0x45ff30['id']}})['then'](function(){return _0x10992f;});})[_0x6c13('0x25')](function(){_0x325fbb[_0x6c13('0x2d')](0xcc)[_0x6c13('0x3a')]();});}};}function handleEntityNotFound(_0x84256e,_0x176cbe){return function(_0x3e331e){if(!_0x3e331e){_0x84256e[_0x6c13('0x3b')](0x194);}return _0x3e331e;};}function handleError(_0x5c405c,_0x25df21){_0x25df21=_0x25df21||0x1f4;return function(_0x434f16){logger[_0x6c13('0x29')](_0x434f16[_0x6c13('0x3c')]);if(_0x434f16[_0x6c13('0x3d')]){delete _0x434f16[_0x6c13('0x3d')];}_0x5c405c[_0x6c13('0x2d')](_0x25df21)[_0x6c13('0x3e')](_0x434f16);};}exports['index']=function(_0xea5bcc,_0x3a1391){var _0xe2f74a={},_0x41f67e={},_0x255783={'count':0x0,'rows':[]};var _0x27af50=_['map'](db[_0x6c13('0x3f')]['rawAttributes'],function(_0x80e256){return{'name':_0x80e256[_0x6c13('0x40')],'type':_0x80e256[_0x6c13('0x41')][_0x6c13('0x42')]};});_0x41f67e['model']=_[_0x6c13('0x43')](_0x27af50,_0x6c13('0x3d'));_0x41f67e[_0x6c13('0x44')]=_['keys'](_0xea5bcc['query']);_0x41f67e['filters']=_[_0x6c13('0x45')](_0x41f67e['model'],_0x41f67e[_0x6c13('0x44')]);_0xe2f74a[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x41f67e[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x48')]));_0xe2f74a['attributes']=_0xe2f74a[_0x6c13('0x46')]['length']?_0xe2f74a[_0x6c13('0x46')]:_0x41f67e[_0x6c13('0x47')];if(!_0xea5bcc['query'][_0x6c13('0x49')]('nolimit')){_0xe2f74a[_0x6c13('0x31')]=qs[_0x6c13('0x31')](_0xea5bcc['query'][_0x6c13('0x31')]);_0xe2f74a[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x2f')]);}_0xe2f74a[_0x6c13('0x4a')]=qs[_0x6c13('0x4b')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x4b')]);_0xe2f74a[_0x6c13('0x4c')]=qs[_0x6c13('0x4d')](_[_0x6c13('0x4e')](_0xea5bcc[_0x6c13('0x44')],_0x41f67e[_0x6c13('0x4d')]),_0x27af50);if(_0xea5bcc['query'][_0x6c13('0x4f')]){_0xe2f74a[_0x6c13('0x4c')]=_[_0x6c13('0x50')](_0xe2f74a[_0x6c13('0x4c')],{'$or':_[_0x6c13('0x43')](_0x27af50,function(_0x47988f){if(_0x47988f[_0x6c13('0x41')]!==_0x6c13('0x51')){var _0x3c9dde={};_0x3c9dde[_0x47988f[_0x6c13('0x3d')]]={'$like':'%'+_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x4f')]+'%'};return _0x3c9dde;}})});}_0xe2f74a=_['merge']({},_0xe2f74a,_0xea5bcc[_0x6c13('0x52')]);var _0x4acc28={'where':_0xe2f74a['where']};return db[_0x6c13('0x3f')][_0x6c13('0x32')](_0x4acc28)[_0x6c13('0x25')](function(_0x5cd64e){_0x255783[_0x6c13('0x32')]=_0x5cd64e;if(_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x53')]){_0xe2f74a[_0x6c13('0x54')]=[{'all':!![]}];}return db[_0x6c13('0x3f')][_0x6c13('0x55')](_0xe2f74a);})['then'](function(_0x4b4a80){_0x255783[_0x6c13('0x56')]=_0x4b4a80;return _0x255783;})[_0x6c13('0x25')](respondWithFilteredResult(_0x3a1391,_0xe2f74a))[_0x6c13('0x57')](handleError(_0x3a1391,null));};exports['show']=function(_0x1cd566,_0x3d0975){var _0x4b0e4b={'raw':!![],'where':{'id':_0x1cd566[_0x6c13('0x58')]['id']}},_0x47caa6={};_0x47caa6[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x3f')][_0x6c13('0x5a')]);_0x47caa6[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x1cd566[_0x6c13('0x44')]);_0x47caa6[_0x6c13('0x4d')]=_['intersection'](_0x47caa6['model'],_0x47caa6[_0x6c13('0x44')]);_0x4b0e4b[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x47caa6[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x1cd566[_0x6c13('0x44')][_0x6c13('0x48')]));_0x4b0e4b[_0x6c13('0x46')]=_0x4b0e4b[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x4b0e4b[_0x6c13('0x46')]:_0x47caa6[_0x6c13('0x47')];if(_0x1cd566['query'][_0x6c13('0x53')]){_0x4b0e4b[_0x6c13('0x54')]=[{'all':!![]}];}_0x4b0e4b=_[_0x6c13('0x50')]({},_0x4b0e4b,_0x1cd566[_0x6c13('0x52')]);return db[_0x6c13('0x3f')]['find'](_0x4b0e4b)[_0x6c13('0x25')](handleEntityNotFound(_0x3d0975,null))['then'](respondWithResult(_0x3d0975,null))[_0x6c13('0x57')](handleError(_0x3d0975,null));};exports['create']=function(_0x585803,_0x202a34){return db[_0x6c13('0x3f')]['create'](_0x585803['body'],{})[_0x6c13('0x25')](function(_0x759769){var _0x21b915=_0x585803[_0x6c13('0x5c')]['get']({'plain':!![]});if(!_0x21b915)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21b915[_0x6c13('0x5d')]===_0x6c13('0x5c')){var _0xd0a14b=_0x759769['get']({'plain':!![]});var _0x368ba5=_0x6c13('0x39');return db[_0x6c13('0x5e')]['find']({'where':{'name':_0x368ba5,'userProfileId':_0x21b915[_0x6c13('0x5f')]},'raw':!![]})['then'](function(_0x3b24f9){if(_0x3b24f9&&_0x3b24f9['autoAssociation']===0x0){return db[_0x6c13('0x60')][_0x6c13('0x61')]({'name':_0xd0a14b[_0x6c13('0x3d')],'resourceId':_0xd0a14b['id'],'type':_0x3b24f9['name'],'sectionId':_0x3b24f9['id']},{})[_0x6c13('0x25')](function(){return _0x759769;});}else{return _0x759769;}})[_0x6c13('0x57')](function(_0x5df913){logger[_0x6c13('0x29')](_0x6c13('0x62'),_0x5df913);throw _0x5df913;});}return _0x759769;})[_0x6c13('0x25')](respondWithResult(_0x202a34,0xc9))[_0x6c13('0x57')](handleError(_0x202a34,null));};exports[_0x6c13('0x36')]=function(_0x33051f,_0x40796f){if(_0x33051f['body']['id']){delete _0x33051f['body']['id'];}return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x33051f['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x40796f,null))[_0x6c13('0x25')](saveUpdates(_0x33051f[_0x6c13('0x64')],null))['then'](respondWithResult(_0x40796f,null))[_0x6c13('0x57')](handleError(_0x40796f,null));};exports[_0x6c13('0x37')]=function(_0x429b7a,_0x892da3){return db[_0x6c13('0x3f')]['find']({'where':{'id':_0x429b7a[_0x6c13('0x58')]['id']}})['then'](handleEntityNotFound(_0x892da3,null))[_0x6c13('0x25')](removeEntity(_0x892da3,null))[_0x6c13('0x57')](handleError(_0x892da3,null));};exports[_0x6c13('0x65')]=function(_0x5484ce,_0x373d77){return db[_0x6c13('0x3f')][_0x6c13('0x65')]()[_0x6c13('0x25')](respondWithResult(_0x373d77,null))[_0x6c13('0x57')](handleError(_0x373d77,null));};exports['getMembers']=function(_0x17dc1f,_0x202b1e,_0xb894be){var _0x246bcc={'raw':!![],'where':{}},_0x566392={},_0x496b27;return db[_0x6c13('0x3f')][_0x6c13('0x66')]({'where':{'id':_0x17dc1f['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x202b1e,null))['then'](function(_0x3a89eb){if(_0x3a89eb){_0x496b27=_0x3a89eb[_0x6c13('0x38')]({'plain':!![]});_0x566392[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x67')][_0x6c13('0x5a')]);_0x566392[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x17dc1f[_0x6c13('0x44')]);_0x566392[_0x6c13('0x4d')]=_[_0x6c13('0x45')](_0x566392['model'],_0x566392[_0x6c13('0x44')]);_0x246bcc[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x566392['model'],qs[_0x6c13('0x48')](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x48')]));_0x246bcc[_0x6c13('0x46')]=_0x246bcc[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x246bcc[_0x6c13('0x46')]:_0x566392[_0x6c13('0x47')];if(!_0x17dc1f['query'][_0x6c13('0x49')](_0x6c13('0x68'))){_0x246bcc[_0x6c13('0x31')]=qs['limit'](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x31')]);_0x246bcc[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0x17dc1f[_0x6c13('0x44')]['offset']);}_0x246bcc[_0x6c13('0x4a')]=qs['sort'](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4b')]);_0x246bcc['where']=qs['filters'](_[_0x6c13('0x4e')](_0x17dc1f['query'],_0x566392[_0x6c13('0x4d')]));_0x246bcc[_0x6c13('0x4c')][_0x6c13('0x69')]=_0x3a89eb['id'];if(_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4f')]){_0x246bcc[_0x6c13('0x4c')]=_['merge'](_0x246bcc['where'],{'$or':_[_0x6c13('0x43')](_0x246bcc[_0x6c13('0x46')],function(_0x24344c){var _0x4204da={};_0x4204da[_0x24344c]={'$like':'%'+_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4f')]+'%'};return _0x4204da;})});}_0x246bcc=_[_0x6c13('0x50')]({},_0x246bcc,_0x17dc1f['options']);return db['UserChatQueue'][_0x6c13('0x55')](_0x246bcc);}})[_0x6c13('0x25')](function(_0x518dea){if(_0x518dea){return db[_0x6c13('0x6a')][_0x6c13('0x6b')]({'where':{'id':_[_0x6c13('0x43')](_0x518dea,'UserId'),'role':_0x6c13('0x6c')},'attributes':['id',_0x6c13('0x3d'),_0x6c13('0x6d'),'updatedAt','createdAt']});}})[_0x6c13('0x25')](function(_0x205675){if(_0x205675){return{'count':_0x205675[_0x6c13('0x32')],'rows':_[_0x6c13('0x43')](_0x205675[_0x6c13('0x56')],function(_0x99d3fc){return{'membername':_0x99d3fc[_0x6c13('0x3d')],'UserId':_0x99d3fc['id'],'queue_name':_0x496b27[_0x6c13('0x3d')],'ChatQueueId':_0x496b27['id'],'interface':util['format'](_0x6c13('0x6e'),_0x6c13('0x6f'),_0x99d3fc['name']),'penalty':0x0,'paused':_0x99d3fc[_0x6c13('0x6d')],'createdAt':_0x99d3fc[_0x6c13('0x70')],'updatedAt':_0x99d3fc[_0x6c13('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6c13('0x25')](respondWithFilteredResult(_0x202b1e,_0x246bcc))[_0x6c13('0x57')](handleError(_0x202b1e,null));};exports[_0x6c13('0x72')]=function(_0x5de91a,_0x34a169,_0x26e935){var _0x15c08a={};var _0x5dbbe8={};var _0x39867b;var _0x537103;return db['ChatQueue'][_0x6c13('0x66')]({'where':{'id':_0x5de91a[_0x6c13('0x58')]['id']}})['then'](handleEntityNotFound(_0x34a169,null))[_0x6c13('0x25')](function(_0x16f4ec){if(_0x16f4ec){_0x39867b=_0x16f4ec;_0x5dbbe8['model']=_['keys'](db['Team'][_0x6c13('0x5a')]);_0x5dbbe8[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x5de91a['query']);_0x5dbbe8[_0x6c13('0x4d')]=_[_0x6c13('0x45')](_0x5dbbe8[_0x6c13('0x47')],_0x5dbbe8[_0x6c13('0x44')]);_0x15c08a['attributes']=_[_0x6c13('0x45')](_0x5dbbe8[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x5de91a['query'][_0x6c13('0x48')]));_0x15c08a[_0x6c13('0x46')]=_0x15c08a[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x15c08a['attributes']:_0x5dbbe8[_0x6c13('0x47')];_0x15c08a[_0x6c13('0x4a')]=qs[_0x6c13('0x4b')](_0x5de91a[_0x6c13('0x44')][_0x6c13('0x4b')]);_0x15c08a[_0x6c13('0x4c')]=qs['filters'](_[_0x6c13('0x4e')](_0x5de91a['query'],_0x5dbbe8[_0x6c13('0x4d')]));if(_0x5de91a['query'][_0x6c13('0x4f')]){_0x15c08a['where']=_[_0x6c13('0x50')](_0x15c08a['where'],{'$or':_[_0x6c13('0x43')](_0x15c08a[_0x6c13('0x46')],function(_0xf26a1f){var _0x49803c={};_0x49803c[_0xf26a1f]={'$like':'%'+_0x5de91a['query'][_0x6c13('0x4f')]+'%'};return _0x49803c;})});}_0x15c08a=_[_0x6c13('0x50')]({},_0x15c08a,_0x5de91a[_0x6c13('0x52')]);return _0x39867b[_0x6c13('0x72')](_0x15c08a);}})[_0x6c13('0x25')](function(_0x5cb5a2){if(_0x5cb5a2){_0x537103=_0x5cb5a2[_0x6c13('0x5b')];if(!_0x5de91a[_0x6c13('0x44')]['hasOwnProperty']('nolimit')){_0x15c08a[_0x6c13('0x31')]=qs['limit'](_0x5de91a['query']['limit']);_0x15c08a['offset']=qs[_0x6c13('0x2f')](_0x5de91a[_0x6c13('0x44')][_0x6c13('0x2f')]);}return _0x39867b[_0x6c13('0x72')](_0x15c08a);}})[_0x6c13('0x25')](function(_0x5af7cb){if(_0x5af7cb){return _0x5af7cb?{'count':_0x537103,'rows':_0x5af7cb}:null;}})[_0x6c13('0x25')](respondWithResult(_0x34a169,null))[_0x6c13('0x57')](handleError(_0x34a169,null));};exports[_0x6c13('0x73')]=function(_0x34f935,_0xefe9ea,_0x44bb77){var _0x577065=_0x34f935[_0x6c13('0x64')]['ids'];return db['Team'][_0x6c13('0x55')]({'where':{'id':_0x577065},'attributes':['id'],'include':[{'model':db[_0x6c13('0x6a')],'as':_0x6c13('0x74'),'attributes':['id','name',_0x6c13('0x75'),_0x6c13('0x76'),_0x6c13('0x77')],'raw':!![]}]})['then'](function(_0x31a451){if(_0x31a451){var _0x508aa5=_['flatMap'](_0x31a451,function(_0xb738a9){var _0x31f9f8=_0xb738a9[_0x6c13('0x38')]({'plain':!![]});return _0x31f9f8['Agents'];});return db[_0x6c13('0x3f')][_0x6c13('0x63')]({'where':{'id':_0x34f935[_0x6c13('0x58')]['id']}})['then'](function(_0x26497a){return db[_0x6c13('0x78')][_0x6c13('0x79')](function(_0x4cf6ff){return _0x26497a['addTeams'](_0x577065,{'transaction':_0x4cf6ff})['then'](function(){return BPromise['each'](_0x508aa5,function(_0x4fc8b6){return db[_0x6c13('0x67')][_0x6c13('0x7a')]({'where':{'UserId':_0x4fc8b6['id'],'ChatQueueId':_0x34f935[_0x6c13('0x58')]['id']},'transaction':_0x4cf6ff});});})[_0x6c13('0x25')](function(){_0x508aa5[_0x6c13('0x7b')](function(_0x2185b8){socket[_0x6c13('0x7c')]('userChatQueue:save',{'UserId':_0x2185b8['id'],'ChatQueueId':_0x26497a['id']});});});});});}})[_0x6c13('0x25')](respondWithStatusCode(_0xefe9ea,null))[_0x6c13('0x57')](handleError(_0xefe9ea,null));};exports['removeTeams']=function(_0x5b446f,_0x2c1361,_0x38901a){return db[_0x6c13('0x7d')][_0x6c13('0x55')]({'where':{'id':_0x5b446f[_0x6c13('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6c13('0x6a')],'as':_0x6c13('0x74'),'attributes':['id'],'raw':!![]}]})[_0x6c13('0x25')](handleEntityNotFound(_0x2c1361,null))[_0x6c13('0x25')](function(_0x475642){var _0x4cfe66=_[_0x6c13('0x43')](_0x475642,'id');var _0x536625=[];var _0x38c7c4=[];var _0x444bf1=squel['select']();_0x444bf1['field'](_0x6c13('0x7e'))['from'](_0x6c13('0x7f'),'tq')[_0x6c13('0x80')](_0x6c13('0x81'),'ut',_0x6c13('0x82'))[_0x6c13('0x4c')](_0x6c13('0x83'),_0x5b446f[_0x6c13('0x58')]['id']);for(var _0x22bb1a=0x0;_0x22bb1a<_0x475642[_0x6c13('0x5b')];_0x22bb1a+=0x1){let _0x1e0193=_0x475642[_0x22bb1a];for(var _0x5ce7cb=0x0;_0x5ce7cb<_0x1e0193[_0x6c13('0x74')]['length'];_0x5ce7cb+=0x1){let _0x50987a=_0x1e0193[_0x6c13('0x74')][_0x5ce7cb];var _0xff70f0=_0x444bf1[_0x6c13('0x84')]();_0xff70f0[_0x6c13('0x4c')]('ut.UserId\x20=\x20?',_0x50987a['id']);_0x38c7c4[_0x6c13('0x85')](db[_0x6c13('0x78')][_0x6c13('0x44')](_0xff70f0[_0x6c13('0x86')](),{'type':db[_0x6c13('0x78')][_0x6c13('0x87')]['SELECT']})[_0x6c13('0x25')](function(_0x43f1cf){if(_0x43f1cf[_0x6c13('0x5b')]===0x1){return _0x50987a['id'];}else{var _0x5d355d=_['every'](_[_0x6c13('0x43')](_0x43f1cf,_0x6c13('0x88')),function(_0x23a172){return _[_0x6c13('0x89')](_0x4cfe66,_0x23a172);});if(_0x5d355d){return _0x50987a['id'];}}}));}}return BPromise[_0x6c13('0x8a')](_0x38c7c4)[_0x6c13('0x25')](function(_0x20620e){_0x536625=_(_0x536625)[_0x6c13('0x8b')](_0x20620e)[_0x6c13('0x8c')]()[_0x6c13('0x8d')]();return db[_0x6c13('0x3f')][_0x6c13('0x63')]({'where':{'id':_0x5b446f[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](function(_0x3ffe50){return db[_0x6c13('0x78')][_0x6c13('0x79')](function(_0x54e875){return _0x3ffe50[_0x6c13('0x8e')](_0x5b446f[_0x6c13('0x44')][_0x6c13('0x8f')],{'transaction':_0x54e875})[_0x6c13('0x25')](function(){if(!_[_0x6c13('0x90')](_0x536625)){return _0x3ffe50[_0x6c13('0x91')](_0x536625,{'transaction':_0x54e875});}})[_0x6c13('0x25')](function(){_0x536625['forEach'](function(_0x17e1da){socket['emit'](_0x6c13('0x92'),{'UserId':_0x17e1da,'ChatQueueId':_0x3ffe50['id']});});});});});});})['then'](respondWithStatusCode(_0x2c1361,null))[_0x6c13('0x57')](handleError(_0x2c1361,null));};exports[_0x6c13('0x93')]=function(_0x5a5884,_0x105b30,_0xc733e7){return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x5a5884[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x105b30,null))[_0x6c13('0x25')](function(_0x456f55){if(_0x456f55){return _0x456f55[_0x6c13('0x93')](_0x5a5884[_0x6c13('0x64')][_0x6c13('0x8f')],_['omit'](_0x5a5884[_0x6c13('0x64')],[_0x6c13('0x8f'),'id'])||{})[_0x6c13('0x94')](function(_0x41c941){for(var _0x30dfa6=0x0;_0x30dfa6<_0x5a5884['body'][_0x6c13('0x8f')][_0x6c13('0x5b')];_0x30dfa6+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x5a5884[_0x6c13('0x64')][_0x6c13('0x8f')][_0x30dfa6]),'ChatQueueId':Number(_0x5a5884[_0x6c13('0x58')]['id'])});}return _0x41c941;});}})[_0x6c13('0x25')](respondWithResult(_0x105b30,null))[_0x6c13('0x57')](handleError(_0x105b30,null));};exports[_0x6c13('0x91')]=function(_0x409c48,_0xc0f4d3,_0x35d00b){return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x409c48[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0xc0f4d3,null))[_0x6c13('0x25')](function(_0x4e028d){if(_0x4e028d){return _0x4e028d['removeAgents'](_0x409c48['query'][_0x6c13('0x8f')])['then'](function(){if(_[_0x6c13('0x95')](_0x409c48[_0x6c13('0x44')][_0x6c13('0x8f')])){for(var _0x2626d6=0x0;_0x2626d6<_0x409c48['query'][_0x6c13('0x8f')][_0x6c13('0x5b')];_0x2626d6+=0x1){socket[_0x6c13('0x7c')](_0x6c13('0x92'),{'UserId':Number(_0x409c48['query'][_0x6c13('0x8f')][_0x2626d6]),'ChatQueueId':Number(_0x409c48[_0x6c13('0x58')]['id'])});}}else{socket[_0x6c13('0x7c')](_0x6c13('0x92'),{'UserId':Number(_0x409c48['query']['ids']),'ChatQueueId':Number(_0x409c48[_0x6c13('0x58')]['id'])});}});}})[_0x6c13('0x25')](respondWithStatusCode(_0xc0f4d3,null))[_0x6c13('0x57')](handleError(_0xc0f4d3,null));};exports[_0x6c13('0x96')]=function(_0x5f274c,_0x310ee1,_0xd06892){var _0x83cccf={};var _0x4c4f2b={};var _0x1c93fd;var _0x2ae5bf;return db['ChatQueue']['findOne']({'where':{'id':_0x5f274c['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x310ee1,null))[_0x6c13('0x25')](function(_0x15994c){if(_0x15994c){_0x1c93fd=_0x15994c;_0x4c4f2b[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x6a')]['rawAttributes']);_0x4c4f2b[_0x6c13('0x44')]=_['keys'](_0x5f274c[_0x6c13('0x44')]);_0x4c4f2b[_0x6c13('0x4d')]=_['intersection'](_0x4c4f2b[_0x6c13('0x47')],_0x4c4f2b['query']);_0x83cccf['attributes']=_[_0x6c13('0x45')](_0x4c4f2b[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x5f274c[_0x6c13('0x44')][_0x6c13('0x48')]));_0x83cccf['attributes']=_0x83cccf[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x83cccf[_0x6c13('0x46')]:_0x4c4f2b[_0x6c13('0x47')];_0x83cccf[_0x6c13('0x4a')]=qs['sort'](_0x5f274c[_0x6c13('0x44')]['sort']);_0x83cccf[_0x6c13('0x4c')]=qs[_0x6c13('0x4d')](_[_0x6c13('0x4e')](_0x5f274c[_0x6c13('0x44')],_0x4c4f2b[_0x6c13('0x4d')]));if(_0x5f274c[_0x6c13('0x44')]['filter']){_0x83cccf[_0x6c13('0x4c')]=_[_0x6c13('0x50')](_0x83cccf['where'],{'$or':_[_0x6c13('0x43')](_0x83cccf[_0x6c13('0x46')],function(_0x169c94){var _0xf946e7={};_0xf946e7[_0x169c94]={'$like':'%'+_0x5f274c[_0x6c13('0x44')]['filter']+'%'};return _0xf946e7;})});}_0x83cccf=_[_0x6c13('0x50')]({},_0x83cccf,_0x5f274c[_0x6c13('0x52')]);return _0x1c93fd[_0x6c13('0x96')](_0x83cccf);}})['then'](function(_0x151228){if(_0x151228){_0x2ae5bf=_0x151228[_0x6c13('0x5b')];if(!_0x5f274c[_0x6c13('0x44')][_0x6c13('0x49')](_0x6c13('0x68'))){_0x83cccf[_0x6c13('0x31')]=qs[_0x6c13('0x31')](_0x5f274c[_0x6c13('0x44')][_0x6c13('0x31')]);_0x83cccf[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0x5f274c[_0x6c13('0x44')]['offset']);}return _0x1c93fd['getAgents'](_0x83cccf);}})[_0x6c13('0x25')](function(_0x537521){if(_0x537521){return _0x537521?{'count':_0x2ae5bf,'rows':_0x537521}:null;}})[_0x6c13('0x25')](respondWithResult(_0x310ee1,null))[_0x6c13('0x57')](handleError(_0x310ee1,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 3df46b2..35e5536 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x028d=['hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0xdad15f,_0x2c1f8c){var _0x129e37=function(_0x5449e6){while(--_0x5449e6){_0xdad15f['push'](_0xdad15f['shift']());}};_0x129e37(++_0x2c1f8c);}(_0x028d,0xff));var _0xd028=function(_0x557b3e,_0x29b942){_0x557b3e=_0x557b3e-0x0;var _0x3f3712=_0x028d[_0x557b3e];return _0x3f3712;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xd028('0x0'))['db'][_0xd028('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd028('0x2'),'afterUpdate':_0xd028('0x3'),'afterDestroy':_0xd028('0x4')};function emitEvent(_0x33a4b7){return function(_0x2dc43c,_0x67d150,_0x5094d8){ChatQueueEvents[_0xd028('0x5')](_0x33a4b7+':'+_0x2dc43c['id'],_0x2dc43c);ChatQueueEvents[_0xd028('0x5')](_0x33a4b7,_0x2dc43c);_0x5094d8(null);};}for(var e in events){if(events[_0xd028('0x6')](e)){var event=events[e];ChatQueue[_0xd028('0x7')](e,emitEvent(event));}}module[_0xd028('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xcf7d=['update','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0xcf7d,0x8a));var _0xdcf7=function(_0x895ef4,_0x9fbb78){_0x895ef4=_0x895ef4-0x0;var _0x3d62fd=_0xcf7d[_0x895ef4];return _0x3d62fd;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xdcf7('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdcf7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdcf7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x13821d){return function(_0x5502a8,_0x29cdf4,_0x27868c){ChatQueueEvents[_0xdcf7('0x3')](_0x13821d+':'+_0x5502a8['id'],_0x5502a8);ChatQueueEvents[_0xdcf7('0x3')](_0x13821d,_0x5502a8);_0x27868c(null);};}for(var e in events){if(events[_0xdcf7('0x4')](e)){var event=events[e];ChatQueue[_0xdcf7('0x5')](e,emitEvent(event));}}module[_0xdcf7('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d4c5c1f..2b6da86 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfe9=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x2c2596,_0x26f279){var _0x269abc=function(_0x5c19c9){while(--_0x5c19c9){_0x2c2596['push'](_0x2c2596['shift']());}};_0x269abc(++_0x26f279);}(_0xcfe9,0x72));var _0x9cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9cfe('0x0'));var util=require(_0x9cfe('0x1'));var logger=require(_0x9cfe('0x2'))(_0x9cfe('0x3'));var moment=require(_0x9cfe('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cfe('0x5'));var fs=require('fs');var path=require(_0x9cfe('0x6'));var rimraf=require(_0x9cfe('0x7'));var config=require(_0x9cfe('0x8'));var attributes=require('./chatQueue.attributes');module[_0x9cfe('0x9')]=function(_0x49a3e7,_0x289ae5){return _0x49a3e7[_0x9cfe('0xa')](_0x9cfe('0xb'),attributes,{'tableName':_0x9cfe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe24=['exports','define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes'];(function(_0x5bf4c5,_0x2f7cab){var _0x10dfdd=function(_0x319a08){while(--_0x319a08){_0x5bf4c5['push'](_0x5bf4c5['shift']());}};_0x10dfdd(++_0x2f7cab);}(_0xbe24,0x16b));var _0x4be2=function(_0x3ed7aa,_0x3d556c){_0x3ed7aa=_0x3ed7aa-0x0;var _0x503cce=_0xbe24[_0x3ed7aa];return _0x503cce;};'use strict';var _=require(_0x4be2('0x0'));var util=require(_0x4be2('0x1'));var logger=require(_0x4be2('0x2'))(_0x4be2('0x3'));var moment=require(_0x4be2('0x4'));var BPromise=require(_0x4be2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4be2('0x6'));var rimraf=require('rimraf');var config=require(_0x4be2('0x7'));var attributes=require(_0x4be2('0x8'));module[_0x4be2('0x9')]=function(_0x29d655,_0x306a5e){return _0x29d655[_0x4be2('0xa')](_0x4be2('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 38d1011..2b28537 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e27=['error','code','ChatQueue,\x20%s,\x20%s','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','catch','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','request\x20sent','debug'];(function(_0x1f68c6,_0x36a94d){var _0x2374df=function(_0x131a75){while(--_0x131a75){_0x1f68c6['push'](_0x1f68c6['shift']());}};_0x2374df(++_0x36a94d);}(_0x7e27,0xdd));var _0x77e2=function(_0x36e3ba,_0x1912e8){_0x36e3ba=_0x36e3ba-0x0;var _0x7972c7=_0x7e27[_0x36e3ba];return _0x7972c7;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});config[_0x77e2('0xa')]=_[_0x77e2('0xb')](config['redis'],{'host':_0x77e2('0xc'),'port':0x18eb});var socket=require(_0x77e2('0xd'))(new Redis(config[_0x77e2('0xa')]));require(_0x77e2('0xe'))[_0x77e2('0xf')](socket);function respondWithRpcPromise(_0x1907e9,_0x23583e,_0x5a5789){return new BPromise(function(_0x5022db,_0x1b4740){return client['request'](_0x1907e9,_0x5a5789)[_0x77e2('0x10')](function(_0xf8293f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'));logger[_0x77e2('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'),JSON['stringify'](_0xf8293f));if(_0xf8293f['error']){if(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x14')]===0x1f4){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')]['message']);return _0x1b4740(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}logger['error'](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);return _0x5022db(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}else{logger[_0x77e2('0x17')](_0x77e2('0x15'),_0x23583e,_0x77e2('0x11'));_0x5022db(_0xf8293f[_0x77e2('0x18')][_0x77e2('0x16')]);}})['catch'](function(_0x375fb0){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0x375fb0);_0x1b4740(_0x375fb0);});});}exports[_0x77e2('0x19')]=function(_0x3774b3){var _0x2aae6c=this;return new Promise(function(_0x1a5415,_0x1e5273){return db[_0x77e2('0x1a')][_0x77e2('0x1b')]({'raw':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options'][_0x77e2('0x1d')]===undefined?!![]:![]:!![],'where':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options'][_0x77e2('0x1e')]||null:null,'attributes':_0x3774b3['options']?_0x3774b3['options'][_0x77e2('0x1f')]||null:null,'limit':_0x3774b3['options']?_0x3774b3[_0x77e2('0x1c')][_0x77e2('0x20')]||null:null,'include':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options']['include']?_[_0x77e2('0x21')](_0x3774b3['options'][_0x77e2('0x22')],function(_0x370dca){return{'model':db[_0x370dca[_0x77e2('0x23')]],'as':_0x370dca['as'],'attributes':_0x370dca['attributes'],'include':_0x370dca[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x370dca[_0x77e2('0x22')],function(_0xa2a50f){return{'model':db[_0xa2a50f[_0x77e2('0x23')]],'as':_0xa2a50f['as'],'attributes':_0xa2a50f['attributes'],'include':_0xa2a50f[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0xa2a50f['include'],function(_0x362730){return{'model':db[_0x362730[_0x77e2('0x23')]],'as':_0x362730['as'],'attributes':_0x362730[_0x77e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77e2('0x10')](function(_0x586919){logger['info'](_0x77e2('0x19'),_0x3774b3);logger['debug']('GetChatQueue',_0x3774b3,JSON[_0x77e2('0x24')](_0x586919));_0x1a5415(_0x586919);})[_0x77e2('0x25')](function(_0x4036aa){logger[_0x77e2('0x13')]('GetChatQueue',_0x4036aa[_0x77e2('0x16')],_0x3774b3);_0x1e5273(_0x2aae6c['error'](0x1f4,_0x4036aa['message']));});});};exports['ShowChatQueue']=function(_0x2b9918){var _0x58dcb0=this;return new Promise(function(_0x5ad13e,_0x53d01a){return db[_0x77e2('0x1a')][_0x77e2('0x26')]({'raw':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918[_0x77e2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918['options'][_0x77e2('0x1e')]||null:null,'attributes':_0x2b9918['options']?_0x2b9918[_0x77e2('0x1c')][_0x77e2('0x1f')]||null:null,'include':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918[_0x77e2('0x1c')][_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x2b9918[_0x77e2('0x1c')]['include'],function(_0x239568){return{'model':db[_0x239568[_0x77e2('0x23')]],'as':_0x239568['as'],'attributes':_0x239568[_0x77e2('0x1f')],'include':_0x239568[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x239568[_0x77e2('0x22')],function(_0xcbca0a){return{'model':db[_0xcbca0a[_0x77e2('0x23')]],'as':_0xcbca0a['as'],'attributes':_0xcbca0a[_0x77e2('0x1f')],'include':_0xcbca0a[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0xcbca0a[_0x77e2('0x22')],function(_0x20ea20){return{'model':db[_0x20ea20['model']],'as':_0x20ea20['as'],'attributes':_0x20ea20[_0x77e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77e2('0x10')](function(_0x3d0bf6){logger['info']('ShowChatQueue',_0x2b9918);logger[_0x77e2('0x12')](_0x77e2('0x27'),_0x2b9918,JSON[_0x77e2('0x24')](_0x3d0bf6));_0x5ad13e(_0x3d0bf6);})['catch'](function(_0x4a629d){logger[_0x77e2('0x13')](_0x77e2('0x27'),_0x4a629d[_0x77e2('0x16')],_0x2b9918);_0x53d01a(_0x58dcb0[_0x77e2('0x13')](0x1f4,_0x4a629d[_0x77e2('0x16')]));});});}; \ No newline at end of file +var _0x10b8=['where','attributes','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options'];(function(_0x38599c,_0x5b0424){var _0x149499=function(_0x5a6e25){while(--_0x5a6e25){_0x38599c['push'](_0x38599c['shift']());}};_0x149499(++_0x5b0424);}(_0x10b8,0x166));var _0x810b=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x10b8[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var moment=require(_0x810b('0x2'));var BPromise=require(_0x810b('0x3'));var rs=require(_0x810b('0x4'));var fs=require('fs');var Redis=require(_0x810b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x810b('0x6'));var logger=require(_0x810b('0x7'))(_0x810b('0x8'));var config=require('../../config/environment');var jayson=require(_0x810b('0x9'));var client=jayson[_0x810b('0xa')][_0x810b('0xb')]({'port':0x232a});config[_0x810b('0xc')]=_[_0x810b('0xd')](config[_0x810b('0xc')],{'host':_0x810b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x810b('0xc')]));require('./chatQueue.socket')[_0x810b('0xf')](socket);function respondWithRpcPromise(_0x3cf5cc,_0x2882aa,_0x6260ea){return new BPromise(function(_0x28be6f,_0x48101e){return client[_0x810b('0x10')](_0x3cf5cc,_0x6260ea)[_0x810b('0x11')](function(_0x288ad9){logger[_0x810b('0x12')]('ChatQueue,\x20%s,\x20%s',_0x2882aa,_0x810b('0x13'));logger[_0x810b('0x14')](_0x810b('0x15'),_0x2882aa,_0x810b('0x13'),JSON[_0x810b('0x16')](_0x288ad9));if(_0x288ad9[_0x810b('0x17')]){if(_0x288ad9[_0x810b('0x17')][_0x810b('0x18')]===0x1f4){logger[_0x810b('0x17')](_0x810b('0x19'),_0x2882aa,_0x288ad9['error']['message']);return _0x48101e(_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);}logger[_0x810b('0x17')](_0x810b('0x19'),_0x2882aa,_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);return _0x28be6f(_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);}else{logger[_0x810b('0x12')](_0x810b('0x19'),_0x2882aa,'request\x20sent');_0x28be6f(_0x288ad9[_0x810b('0x1b')]['message']);}})[_0x810b('0x1c')](function(_0x22e695){logger[_0x810b('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2882aa,_0x22e695);_0x48101e(_0x22e695);});});}exports[_0x810b('0x1d')]=function(_0x569814){var _0x1ee0a0=this;return new Promise(function(_0x4ba246,_0x2906df){return db['ChatQueue'][_0x810b('0x1e')]({'raw':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x569814[_0x810b('0x1f')]?_0x569814['options'][_0x810b('0x20')]||null:null,'attributes':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')][_0x810b('0x21')]||null:null,'limit':_0x569814['options']?_0x569814[_0x810b('0x1f')]['limit']||null:null,'include':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')][_0x810b('0x22')]?_[_0x810b('0x23')](_0x569814['options'][_0x810b('0x22')],function(_0x4bd4f9){return{'model':db[_0x4bd4f9[_0x810b('0x24')]],'as':_0x4bd4f9['as'],'attributes':_0x4bd4f9[_0x810b('0x21')],'include':_0x4bd4f9[_0x810b('0x22')]?_['map'](_0x4bd4f9[_0x810b('0x22')],function(_0x817fd6){return{'model':db[_0x817fd6[_0x810b('0x24')]],'as':_0x817fd6['as'],'attributes':_0x817fd6[_0x810b('0x21')],'include':_0x817fd6[_0x810b('0x22')]?_[_0x810b('0x23')](_0x817fd6['include'],function(_0x4eb0f3){return{'model':db[_0x4eb0f3[_0x810b('0x24')]],'as':_0x4eb0f3['as'],'attributes':_0x4eb0f3[_0x810b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x810b('0x11')](function(_0x51352e){logger[_0x810b('0x12')]('GetChatQueue',_0x569814);logger[_0x810b('0x14')](_0x810b('0x1d'),_0x569814,JSON[_0x810b('0x16')](_0x51352e));_0x4ba246(_0x51352e);})[_0x810b('0x1c')](function(_0x83448b){logger[_0x810b('0x17')]('GetChatQueue',_0x83448b[_0x810b('0x1a')],_0x569814);_0x2906df(_0x1ee0a0['error'](0x1f4,_0x83448b[_0x810b('0x1a')]));});});};exports[_0x810b('0x25')]=function(_0x450925){var _0x551209=this;return new Promise(function(_0x41264c,_0x223b44){return db['ChatQueue'][_0x810b('0x26')]({'raw':_0x450925[_0x810b('0x1f')]?_0x450925[_0x810b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x450925[_0x810b('0x1f')]?_0x450925[_0x810b('0x1f')][_0x810b('0x20')]||null:null,'attributes':_0x450925['options']?_0x450925[_0x810b('0x1f')]['attributes']||null:null,'include':_0x450925[_0x810b('0x1f')]?_0x450925['options'][_0x810b('0x22')]?_[_0x810b('0x23')](_0x450925[_0x810b('0x1f')]['include'],function(_0x3cbe75){return{'model':db[_0x3cbe75[_0x810b('0x24')]],'as':_0x3cbe75['as'],'attributes':_0x3cbe75[_0x810b('0x21')],'include':_0x3cbe75[_0x810b('0x22')]?_[_0x810b('0x23')](_0x3cbe75[_0x810b('0x22')],function(_0x3e8ffd){return{'model':db[_0x3e8ffd[_0x810b('0x24')]],'as':_0x3e8ffd['as'],'attributes':_0x3e8ffd['attributes'],'include':_0x3e8ffd[_0x810b('0x22')]?_[_0x810b('0x23')](_0x3e8ffd[_0x810b('0x22')],function(_0x30cfc6){return{'model':db[_0x30cfc6['model']],'as':_0x30cfc6['as'],'attributes':_0x30cfc6[_0x810b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x810b('0x11')](function(_0x6a5fc3){logger[_0x810b('0x12')](_0x810b('0x25'),_0x450925);logger[_0x810b('0x14')]('ShowChatQueue',_0x450925,JSON[_0x810b('0x16')](_0x6a5fc3));_0x41264c(_0x6a5fc3);})[_0x810b('0x1c')](function(_0x2b380f){logger[_0x810b('0x17')](_0x810b('0x25'),_0x2b380f['message'],_0x450925);_0x223b44(_0x551209['error'](0x1f4,_0x2b380f[_0x810b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f1fb1a9..26e64ab 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x1a399b,_0x362692){var _0x4a555b=function(_0x5bd027){while(--_0x5bd027){_0x1a399b['push'](_0x1a399b['shift']());}};_0x4a555b(++_0x362692);}(_0x3140,0xaf));var _0x0314=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x3140[_0x52980f];return _0x1f52a1;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}}; \ No newline at end of file +var _0xc3b5=['length','remove','update','emit','register'];(function(_0x8536bc,_0xcce2c8){var _0x3ef537=function(_0x4fdde4){while(--_0x4fdde4){_0x8536bc['push'](_0x8536bc['shift']());}};_0x3ef537(++_0xcce2c8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x49bf20,_0x573d06){_0x49bf20=_0x49bf20-0x0;var _0x2cef40=_0xc3b5[_0x49bf20];return _0x2cef40;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index cf213bb..d2453f1 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x42037b,_0xcd2d32){var _0x1e2dbc=function(_0x178c8b){while(--_0x178c8b){_0x42037b['push'](_0x42037b['shift']());}};_0x1e2dbc(++_0xcd2d32);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x470abd,_0x17ef85){var _0x4122c6=function(_0x670550){while(--_0x670550){_0x470abd['push'](_0x470abd['shift']());}};_0x4122c6(++_0x17ef85);}(_0x814b,0x1a2));var _0xb814=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x814b[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 73a468e..ada80e5 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc2e=['STRING','DATE','moment','sequelize'];(function(_0x449f40,_0x4ca207){var _0x20e4f6=function(_0x46f984){while(--_0x46f984){_0x449f40['push'](_0x449f40['shift']());}};_0x20e4f6(++_0x4ca207);}(_0xcc2e,0x112));var _0xecc2=function(_0x114a7e,_0x4049a7){_0x114a7e=_0x114a7e-0x0;var _0x2f6cb4=_0xcc2e[_0x114a7e];return _0x2f6cb4;};'use strict';var moment=require(_0xecc2('0x0'));var Sequelize=require(_0xecc2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xecc2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xecc2('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xecc2('0x3')]},'exitAt':{'type':Sequelize[_0xecc2('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa2d7=['STRING','DATE','moment','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa2d7,0xbb));var _0x7a2d=function(_0x517587,_0x564c30){_0x517587=_0x517587-0x0;var _0x330f2b=_0xa2d7[_0x517587];return _0x330f2b;};'use strict';var moment=require(_0x7a2d('0x0'));var Sequelize=require(_0x7a2d('0x1'));module[_0x7a2d('0x2')]={'uniqueid':{'type':Sequelize[_0x7a2d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7a2d('0x4')]},'leaveAt':{'type':Sequelize[_0x7a2d('0x4')]},'acceptAt':{'type':Sequelize[_0x7a2d('0x4')]},'exitAt':{'type':Sequelize[_0x7a2d('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c43097a..71c5ff3 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee3c=['VIRTUAL','then','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x549277,_0x11af15){var _0x2f8004=function(_0x5a8413){while(--_0x5a8413){_0x549277['push'](_0x549277['shift']());}};_0x2f8004(++_0x11af15);}(_0xee3c,0x14a));var _0xcee3=function(_0x329ee0,_0x47c6e9){_0x329ee0=_0x329ee0-0x0;var _0x4b3486=_0xee3c[_0x329ee0];return _0x4b3486;};'use strict';var emlformat=require(_0xcee3('0x0'));var rimraf=require(_0xcee3('0x1'));var zipdir=require(_0xcee3('0x2'));var jsonpatch=require(_0xcee3('0x3'));var rp=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcee3('0x6'));var path=require(_0xcee3('0x7'));var sox=require(_0xcee3('0x8'));var csv=require(_0xcee3('0x9'));var ejs=require(_0xcee3('0xa'));var fs=require('fs');var fs_extra=require(_0xcee3('0xb'));var _=require(_0xcee3('0xc'));var squel=require(_0xcee3('0xd'));var crypto=require(_0xcee3('0xe'));var jsforce=require(_0xcee3('0xf'));var deskjs=require(_0xcee3('0x10'));var toCsv=require(_0xcee3('0x9'));var querystring=require(_0xcee3('0x11'));var Papa=require(_0xcee3('0x12'));var Redis=require(_0xcee3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcee3('0x14'));var as=require(_0xcee3('0x15'));var hardwareService=require(_0xcee3('0x16'));var logger=require(_0xcee3('0x17'))(_0xcee3('0x18'));var utils=require(_0xcee3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xcee3('0x1a'));var db=require(_0xcee3('0x1b'))['db'];function respondWithStatusCode(_0x2db8ff,_0x1a47e1){_0x1a47e1=_0x1a47e1||0xcc;return function(_0xc4f4f2){if(_0xc4f4f2){return _0x2db8ff['sendStatus'](_0x1a47e1);}return _0x2db8ff[_0xcee3('0x1c')](_0x1a47e1)['end']();};}function respondWithResult(_0x559250,_0x53c810){_0x53c810=_0x53c810||0xc8;return function(_0x3ea063){if(_0x3ea063){return _0x559250[_0xcee3('0x1c')](_0x53c810)['json'](_0x3ea063);}};}function respondWithFilteredResult(_0x50bbf2,_0x34854a){return function(_0x505f09){if(_0x505f09){var _0x420b46=typeof _0x34854a['offset']===_0xcee3('0x1d')&&typeof _0x34854a[_0xcee3('0x1e')]==='undefined';var _0xc139b5=_0x505f09[_0xcee3('0x1f')];var _0x40cb8b=_0x420b46?0x0:_0x34854a[_0xcee3('0x20')];var _0x50bf6e=_0x420b46?_0x505f09[_0xcee3('0x1f')]:_0x34854a[_0xcee3('0x20')]+_0x34854a[_0xcee3('0x1e')];var _0x11bf37;if(_0x50bf6e>=_0xc139b5){_0x50bf6e=_0xc139b5;_0x11bf37=0xc8;}else{_0x11bf37=0xce;}_0x50bbf2['status'](_0x11bf37);return _0x50bbf2[_0xcee3('0x21')](_0xcee3('0x22'),_0x40cb8b+'-'+_0x50bf6e+'/'+_0xc139b5)[_0xcee3('0x23')](_0x505f09);}return null;};}function patchUpdates(_0x8b2470){return function(_0x11d116){try{jsonpatch[_0xcee3('0x24')](_0x11d116,_0x8b2470,!![]);}catch(_0x195ba9){return BPromise[_0xcee3('0x25')](_0x195ba9);}return _0x11d116[_0xcee3('0x26')]();};}function saveUpdates(_0x46d7a9,_0x40dd10){return function(_0xa1efbf){if(_0xa1efbf){return _0xa1efbf[_0xcee3('0x27')](_0x46d7a9)['then'](function(_0x1fee89){return _0x1fee89;});}return null;};}function removeEntity(_0x277194,_0x240736){return function(_0x1ee247){if(_0x1ee247){return _0x1ee247[_0xcee3('0x28')]()['then'](function(){_0x277194['status'](0xcc)[_0xcee3('0x29')]();});}};}function handleEntityNotFound(_0x5b92ba,_0x544509){return function(_0x228ff6){if(!_0x228ff6){_0x5b92ba['sendStatus'](0x194);}return _0x228ff6;};}function handleError(_0x452837,_0x202bfd){_0x202bfd=_0x202bfd||0x1f4;return function(_0x19a15e){logger['error'](_0x19a15e[_0xcee3('0x2a')]);if(_0x19a15e['name']){delete _0x19a15e[_0xcee3('0x2b')];}_0x452837['status'](_0x202bfd)[_0xcee3('0x2c')](_0x19a15e);};}exports[_0xcee3('0x2d')]=function(_0x5d965d,_0x3a2532){var _0x1efb1b={},_0x5c1a32={},_0x400cfe={'count':0x0,'rows':[]};var _0x4ef9da=_['map'](db[_0xcee3('0x2e')]['rawAttributes'],function(_0x22e342){return{'name':_0x22e342[_0xcee3('0x2f')],'type':_0x22e342[_0xcee3('0x30')][_0xcee3('0x31')]};});_0x5c1a32[_0xcee3('0x32')]=_[_0xcee3('0x33')](_0x4ef9da,_0xcee3('0x2b'));_0x5c1a32['query']=_[_0xcee3('0x34')](_0x5d965d['query']);_0x5c1a32[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],_0x5c1a32[_0xcee3('0x37')]);_0x1efb1b[_0xcee3('0x38')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],qs[_0xcee3('0x39')](_0x5d965d['query'][_0xcee3('0x39')]));_0x1efb1b[_0xcee3('0x38')]=_0x1efb1b[_0xcee3('0x38')]['length']?_0x1efb1b[_0xcee3('0x38')]:_0x5c1a32[_0xcee3('0x32')];if(!_0x5d965d['query'][_0xcee3('0x3a')]('nolimit')){_0x1efb1b[_0xcee3('0x1e')]=qs['limit'](_0x5d965d['query'][_0xcee3('0x1e')]);_0x1efb1b['offset']=qs[_0xcee3('0x20')](_0x5d965d[_0xcee3('0x37')][_0xcee3('0x20')]);}_0x1efb1b[_0xcee3('0x3b')]=qs['sort'](_0x5d965d['query'][_0xcee3('0x3c')]);_0x1efb1b[_0xcee3('0x3d')]=qs['filters'](_[_0xcee3('0x3e')](_0x5d965d[_0xcee3('0x37')],_0x5c1a32['filters']),_0x4ef9da);if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]){_0x1efb1b[_0xcee3('0x3d')]=_[_0xcee3('0x40')](_0x1efb1b[_0xcee3('0x3d')],{'$or':_[_0xcee3('0x33')](_0x4ef9da,function(_0x49f1dc){if(_0x49f1dc[_0xcee3('0x30')]!==_0xcee3('0x41')){var _0x28e726={};_0x28e726[_0x49f1dc[_0xcee3('0x2b')]]={'$like':'%'+_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]+'%'};return _0x28e726;}})});}_0x1efb1b=_[_0xcee3('0x40')]({},_0x1efb1b,_0x5d965d['options']);var _0x139ddc={'where':_0x1efb1b[_0xcee3('0x3d')]};return db[_0xcee3('0x2e')]['count'](_0x139ddc)[_0xcee3('0x42')](function(_0x436961){_0x400cfe['count']=_0x436961;if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x43')]){_0x1efb1b[_0xcee3('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xcee3('0x45')](_0x1efb1b);})[_0xcee3('0x42')](function(_0x1bb4a8){_0x400cfe[_0xcee3('0x46')]=_0x1bb4a8;return _0x400cfe;})[_0xcee3('0x42')](respondWithFilteredResult(_0x3a2532,_0x1efb1b))['catch'](handleError(_0x3a2532,null));};exports['show']=function(_0x42e197,_0x41cd61){var _0x45df47={'raw':!![],'where':{'id':_0x42e197[_0xcee3('0x47')]['id']}},_0x47159f={};_0x47159f[_0xcee3('0x32')]=_[_0xcee3('0x34')](db[_0xcee3('0x2e')]['rawAttributes']);_0x47159f[_0xcee3('0x37')]=_[_0xcee3('0x34')](_0x42e197[_0xcee3('0x37')]);_0x47159f[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x47159f[_0xcee3('0x32')],_0x47159f[_0xcee3('0x37')]);_0x45df47['attributes']=_[_0xcee3('0x36')](_0x47159f['model'],qs[_0xcee3('0x39')](_0x42e197[_0xcee3('0x37')]['fields']));_0x45df47[_0xcee3('0x38')]=_0x45df47[_0xcee3('0x38')][_0xcee3('0x48')]?_0x45df47[_0xcee3('0x38')]:_0x47159f[_0xcee3('0x32')];if(_0x42e197[_0xcee3('0x37')][_0xcee3('0x43')]){_0x45df47[_0xcee3('0x44')]=[{'all':!![]}];}_0x45df47=_[_0xcee3('0x40')]({},_0x45df47,_0x42e197[_0xcee3('0x49')]);return db['ChatQueueReport'][_0xcee3('0x4a')](_0x45df47)[_0xcee3('0x42')](handleEntityNotFound(_0x41cd61,null))['then'](respondWithResult(_0x41cd61,null))[_0xcee3('0x4b')](handleError(_0x41cd61,null));};exports[_0xcee3('0x4c')]=function(_0x31393e,_0x2726d9){return db[_0xcee3('0x2e')][_0xcee3('0x4c')](_0x31393e[_0xcee3('0x4d')],{})['then'](respondWithResult(_0x2726d9,0xc9))[_0xcee3('0x4b')](handleError(_0x2726d9,null));};exports[_0xcee3('0x27')]=function(_0x20bfc5,_0x27022b){if(_0x20bfc5[_0xcee3('0x4d')]['id']){delete _0x20bfc5[_0xcee3('0x4d')]['id'];}return db['ChatQueueReport'][_0xcee3('0x4a')]({'where':{'id':_0x20bfc5['params']['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x27022b,null))[_0xcee3('0x42')](saveUpdates(_0x20bfc5[_0xcee3('0x4d')],null))['then'](respondWithResult(_0x27022b,null))['catch'](handleError(_0x27022b,null));};exports[_0xcee3('0x28')]=function(_0x319c25,_0x47c149){return db[_0xcee3('0x2e')]['find']({'where':{'id':_0x319c25[_0xcee3('0x47')]['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x47c149,null))[_0xcee3('0x42')](removeEntity(_0x47c149,null))[_0xcee3('0x4b')](handleError(_0x47c149,null));};exports['describe']=function(_0x5b1d42,_0x491ca0){return db[_0xcee3('0x2e')][_0xcee3('0x4e')]()[_0xcee3('0x42')](respondWithResult(_0x491ca0,null))['catch'](handleError(_0x491ca0,null));}; \ No newline at end of file +var _0xc17d=['moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','ChatQueueReport','key','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','intersection','includeAll','options','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x57a6bd,_0x19ec0d){var _0x54bfa2=function(_0xd3e40){while(--_0xd3e40){_0x57a6bd['push'](_0x57a6bd['shift']());}};_0x54bfa2(++_0x19ec0d);}(_0xc17d,0x96));var _0xdc17=function(_0x3436a6,_0x165ac2){_0x3436a6=_0x3436a6-0x0;var _0x4d783a=_0xc17d[_0x3436a6];return _0x4d783a;};'use strict';var emlformat=require(_0xdc17('0x0'));var rimraf=require(_0xdc17('0x1'));var zipdir=require(_0xdc17('0x2'));var jsonpatch=require(_0xdc17('0x3'));var rp=require('request-promise');var moment=require(_0xdc17('0x4'));var BPromise=require(_0xdc17('0x5'));var Mustache=require(_0xdc17('0x6'));var util=require(_0xdc17('0x7'));var path=require('path');var sox=require(_0xdc17('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc17('0x9'));var _=require('lodash');var squel=require(_0xdc17('0xa'));var crypto=require(_0xdc17('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc17('0xc'));var querystring=require(_0xdc17('0xd'));var Papa=require(_0xdc17('0xe'));var Redis=require(_0xdc17('0xf'));var authService=require(_0xdc17('0x10'));var qs=require(_0xdc17('0x11'));var as=require(_0xdc17('0x12'));var hardwareService=require(_0xdc17('0x13'));var logger=require('../../config/logger')(_0xdc17('0x14'));var utils=require(_0xdc17('0x15'));var config=require(_0xdc17('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc17('0x17'))['db'];function respondWithStatusCode(_0x4ddfba,_0x137250){_0x137250=_0x137250||0xcc;return function(_0x954b82){if(_0x954b82){return _0x4ddfba['sendStatus'](_0x137250);}return _0x4ddfba[_0xdc17('0x18')](_0x137250)[_0xdc17('0x19')]();};}function respondWithResult(_0x49d6fd,_0x2bb5b2){_0x2bb5b2=_0x2bb5b2||0xc8;return function(_0x59c100){if(_0x59c100){return _0x49d6fd[_0xdc17('0x18')](_0x2bb5b2)[_0xdc17('0x1a')](_0x59c100);}};}function respondWithFilteredResult(_0x5631b6,_0xb3a102){return function(_0x428c8c){if(_0x428c8c){var _0x17ff01=typeof _0xb3a102[_0xdc17('0x1b')]===_0xdc17('0x1c')&&typeof _0xb3a102[_0xdc17('0x1d')]==='undefined';var _0x324272=_0x428c8c[_0xdc17('0x1e')];var _0x1ac85b=_0x17ff01?0x0:_0xb3a102[_0xdc17('0x1b')];var _0x172a20=_0x17ff01?_0x428c8c[_0xdc17('0x1e')]:_0xb3a102['offset']+_0xb3a102[_0xdc17('0x1d')];var _0xd0886e;if(_0x172a20>=_0x324272){_0x172a20=_0x324272;_0xd0886e=0xc8;}else{_0xd0886e=0xce;}_0x5631b6[_0xdc17('0x18')](_0xd0886e);return _0x5631b6[_0xdc17('0x1f')](_0xdc17('0x20'),_0x1ac85b+'-'+_0x172a20+'/'+_0x324272)[_0xdc17('0x1a')](_0x428c8c);}return null;};}function patchUpdates(_0x5650ad){return function(_0x35662c){try{jsonpatch[_0xdc17('0x21')](_0x35662c,_0x5650ad,!![]);}catch(_0x572232){return BPromise[_0xdc17('0x22')](_0x572232);}return _0x35662c[_0xdc17('0x23')]();};}function saveUpdates(_0x218a5d,_0x687339){return function(_0x3e8d98){if(_0x3e8d98){return _0x3e8d98['update'](_0x218a5d)[_0xdc17('0x24')](function(_0x42c341){return _0x42c341;});}return null;};}function removeEntity(_0x595320,_0x5c01aa){return function(_0x1b4706){if(_0x1b4706){return _0x1b4706['destroy']()[_0xdc17('0x24')](function(){_0x595320['status'](0xcc)[_0xdc17('0x19')]();});}};}function handleEntityNotFound(_0x519795,_0x4d936e){return function(_0x4573a0){if(!_0x4573a0){_0x519795[_0xdc17('0x25')](0x194);}return _0x4573a0;};}function handleError(_0x25930f,_0x177ee){_0x177ee=_0x177ee||0x1f4;return function(_0x3a9fc9){logger[_0xdc17('0x26')](_0x3a9fc9[_0xdc17('0x27')]);if(_0x3a9fc9[_0xdc17('0x28')]){delete _0x3a9fc9[_0xdc17('0x28')];}_0x25930f['status'](_0x177ee)[_0xdc17('0x29')](_0x3a9fc9);};}exports['index']=function(_0x879d4b,_0xc167e5){var _0x10f197={},_0x49fd56={},_0x45b68d={'count':0x0,'rows':[]};var _0x391538=_['map'](db[_0xdc17('0x2a')]['rawAttributes'],function(_0x3df4b7){return{'name':_0x3df4b7['fieldName'],'type':_0x3df4b7['type'][_0xdc17('0x2b')]};});_0x49fd56['model']=_['map'](_0x391538,_0xdc17('0x28'));_0x49fd56[_0xdc17('0x2c')]=_['keys'](_0x879d4b['query']);_0x49fd56['filters']=_['intersection'](_0x49fd56[_0xdc17('0x2d')],_0x49fd56['query']);_0x10f197['attributes']=_['intersection'](_0x49fd56[_0xdc17('0x2d')],qs['fields'](_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x2e')]));_0x10f197[_0xdc17('0x2f')]=_0x10f197['attributes'][_0xdc17('0x30')]?_0x10f197['attributes']:_0x49fd56[_0xdc17('0x2d')];if(!_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x31')](_0xdc17('0x32'))){_0x10f197[_0xdc17('0x1d')]=qs[_0xdc17('0x1d')](_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x1d')]);_0x10f197[_0xdc17('0x1b')]=qs[_0xdc17('0x1b')](_0x879d4b['query'][_0xdc17('0x1b')]);}_0x10f197[_0xdc17('0x33')]=qs[_0xdc17('0x34')](_0x879d4b['query'][_0xdc17('0x34')]);_0x10f197[_0xdc17('0x35')]=qs[_0xdc17('0x36')](_[_0xdc17('0x37')](_0x879d4b[_0xdc17('0x2c')],_0x49fd56[_0xdc17('0x36')]),_0x391538);if(_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x38')]){_0x10f197[_0xdc17('0x35')]=_[_0xdc17('0x39')](_0x10f197[_0xdc17('0x35')],{'$or':_[_0xdc17('0x3a')](_0x391538,function(_0x14b814){if(_0x14b814[_0xdc17('0x3b')]!==_0xdc17('0x3c')){var _0x1dcf3b={};_0x1dcf3b[_0x14b814[_0xdc17('0x28')]]={'$like':'%'+_0x879d4b[_0xdc17('0x2c')]['filter']+'%'};return _0x1dcf3b;}})});}_0x10f197=_[_0xdc17('0x39')]({},_0x10f197,_0x879d4b['options']);var _0x30679b={'where':_0x10f197['where']};return db[_0xdc17('0x2a')][_0xdc17('0x1e')](_0x30679b)[_0xdc17('0x24')](function(_0x36ca97){_0x45b68d[_0xdc17('0x1e')]=_0x36ca97;if(_0x879d4b[_0xdc17('0x2c')]['includeAll']){_0x10f197[_0xdc17('0x3d')]=[{'all':!![]}];}return db[_0xdc17('0x2a')][_0xdc17('0x3e')](_0x10f197);})[_0xdc17('0x24')](function(_0x687bf3){_0x45b68d[_0xdc17('0x3f')]=_0x687bf3;return _0x45b68d;})[_0xdc17('0x24')](respondWithFilteredResult(_0xc167e5,_0x10f197))[_0xdc17('0x40')](handleError(_0xc167e5,null));};exports[_0xdc17('0x41')]=function(_0x48a061,_0x2e9928){var _0x45d642={'raw':!![],'where':{'id':_0x48a061[_0xdc17('0x42')]['id']}},_0x51f6b4={};_0x51f6b4[_0xdc17('0x2d')]=_[_0xdc17('0x43')](db[_0xdc17('0x2a')]['rawAttributes']);_0x51f6b4['query']=_[_0xdc17('0x43')](_0x48a061[_0xdc17('0x2c')]);_0x51f6b4[_0xdc17('0x36')]=_[_0xdc17('0x44')](_0x51f6b4[_0xdc17('0x2d')],_0x51f6b4['query']);_0x45d642[_0xdc17('0x2f')]=_[_0xdc17('0x44')](_0x51f6b4[_0xdc17('0x2d')],qs[_0xdc17('0x2e')](_0x48a061[_0xdc17('0x2c')][_0xdc17('0x2e')]));_0x45d642[_0xdc17('0x2f')]=_0x45d642[_0xdc17('0x2f')][_0xdc17('0x30')]?_0x45d642[_0xdc17('0x2f')]:_0x51f6b4['model'];if(_0x48a061[_0xdc17('0x2c')][_0xdc17('0x45')]){_0x45d642[_0xdc17('0x3d')]=[{'all':!![]}];}_0x45d642=_['merge']({},_0x45d642,_0x48a061[_0xdc17('0x46')]);return db[_0xdc17('0x2a')]['find'](_0x45d642)[_0xdc17('0x24')](handleEntityNotFound(_0x2e9928,null))[_0xdc17('0x24')](respondWithResult(_0x2e9928,null))[_0xdc17('0x40')](handleError(_0x2e9928,null));};exports['create']=function(_0x1a3f5d,_0x23d535){return db['ChatQueueReport'][_0xdc17('0x47')](_0x1a3f5d[_0xdc17('0x48')],{})['then'](respondWithResult(_0x23d535,0xc9))['catch'](handleError(_0x23d535,null));};exports[_0xdc17('0x49')]=function(_0x22048b,_0x5a2ca2){if(_0x22048b[_0xdc17('0x48')]['id']){delete _0x22048b[_0xdc17('0x48')]['id'];}return db[_0xdc17('0x2a')][_0xdc17('0x4a')]({'where':{'id':_0x22048b[_0xdc17('0x42')]['id']}})[_0xdc17('0x24')](handleEntityNotFound(_0x5a2ca2,null))[_0xdc17('0x24')](saveUpdates(_0x22048b['body'],null))[_0xdc17('0x24')](respondWithResult(_0x5a2ca2,null))[_0xdc17('0x40')](handleError(_0x5a2ca2,null));};exports[_0xdc17('0x4b')]=function(_0x3a864c,_0x1368e1){return db[_0xdc17('0x2a')]['find']({'where':{'id':_0x3a864c[_0xdc17('0x42')]['id']}})[_0xdc17('0x24')](handleEntityNotFound(_0x1368e1,null))[_0xdc17('0x24')](removeEntity(_0x1368e1,null))[_0xdc17('0x40')](handleError(_0x1368e1,null));};exports[_0xdc17('0x4c')]=function(_0x1be1ca,_0x4417bd){return db[_0xdc17('0x2a')]['describe']()['then'](respondWithResult(_0x4417bd,null))[_0xdc17('0x40')](handleError(_0x4417bd,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 789695f..2e96f3d 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3911a0,_0x244e17){var _0x55e9b9=function(_0xb90aad){while(--_0xb90aad){_0x3911a0['push'](_0x3911a0['shift']());}};_0x55e9b9(++_0x244e17);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a778b,_0x717daa){_0x5a778b=_0x5a778b-0x0;var _0x32f0da=_0xb10b[_0x5a778b];return _0x32f0da;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 50124e8..8877fad 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84e7=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring'];(function(_0x3f5491,_0x9344ba){var _0x4a364d=function(_0x4dfe73){while(--_0x4dfe73){_0x3f5491['push'](_0x3f5491['shift']());}};_0x4a364d(++_0x9344ba);}(_0x84e7,0x171));var _0x784e=function(_0x8ed86a,_0x3d55cf){_0x8ed86a=_0x8ed86a-0x0;var _0x57d8a4=_0x84e7[_0x8ed86a];return _0x57d8a4;};'use strict';var _=require(_0x784e('0x0'));var util=require('util');var moment=require(_0x784e('0x1'));var BPromise=require('bluebird');var rs=require(_0x784e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x784e('0x3'));var logger=require(_0x784e('0x4'))(_0x784e('0x5'));var config=require(_0x784e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x784e('0x7')][_0x784e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26d18a,_0x5a1706,_0x4bf15f){return new BPromise(function(_0x5b1b5a,_0x28b301){return client[_0x784e('0x9')](_0x26d18a,_0x4bf15f)[_0x784e('0xa')](function(_0x2145bd){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5a1706,'request\x20sent');logger[_0x784e('0xb')](_0x784e('0xc'),_0x5a1706,_0x784e('0xd'),JSON[_0x784e('0xe')](_0x2145bd));if(_0x2145bd[_0x784e('0xf')]){if(_0x2145bd['error'][_0x784e('0x10')]===0x1f4){logger[_0x784e('0xf')](_0x784e('0x11'),_0x5a1706,_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);return _0x28b301(_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);}logger[_0x784e('0xf')](_0x784e('0x11'),_0x5a1706,_0x2145bd[_0x784e('0xf')]['message']);return _0x5b1b5a(_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);}else{logger['info'](_0x784e('0x11'),_0x5a1706,'request\x20sent');_0x5b1b5a(_0x2145bd[_0x784e('0x13')]['message']);}})[_0x784e('0x14')](function(_0x1782e7){logger[_0x784e('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5a1706,_0x1782e7);_0x28b301(_0x1782e7);});});}exports[_0x784e('0x15')]=function(_0x1bad48){var _0x477d0f=this;return new Promise(function(_0x4b4430,_0xaf8c64){return db[_0x784e('0x16')][_0x784e('0x17')](_0x1bad48[_0x784e('0x18')],{'raw':_0x1bad48[_0x784e('0x19')]?_0x1bad48[_0x784e('0x19')][_0x784e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x21eb3f){logger['info']('CreateChatQueueReport',_0x1bad48);logger[_0x784e('0xb')]('CreateChatQueueReport',_0x1bad48,JSON[_0x784e('0xe')](_0x21eb3f));_0x4b4430(_0x21eb3f);})[_0x784e('0x14')](function(_0x21127f){logger[_0x784e('0xf')](_0x784e('0x15'),_0x21127f['message'],_0x1bad48);_0xaf8c64(_0x477d0f['error'](0x1f4,_0x21127f[_0x784e('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x462710){var _0x487fb0=this;return new Promise(function(_0x1a2dba,_0x1decd3){return db[_0x784e('0x16')]['update'](_0x462710[_0x784e('0x18')],{'raw':_0x462710[_0x784e('0x19')]?_0x462710['options'][_0x784e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462710['options']?_0x462710[_0x784e('0x19')][_0x784e('0x1b')]||null:null,'attributes':_0x462710['options']?_0x462710[_0x784e('0x19')][_0x784e('0x1c')]||null:null,'limit':_0x462710['options']?_0x462710['options'][_0x784e('0x1d')]||null:null})[_0x784e('0xa')](function(_0x46a05f){logger['info'](_0x784e('0x1e'),_0x462710);logger['debug'](_0x784e('0x1e'),_0x462710,JSON[_0x784e('0xe')](_0x46a05f));_0x1a2dba(_0x46a05f);})[_0x784e('0x14')](function(_0x8645f1){logger[_0x784e('0xf')](_0x784e('0x1e'),_0x8645f1[_0x784e('0x12')],_0x462710);_0x1decd3(_0x487fb0[_0x784e('0xf')](0x1f4,_0x8645f1['message']));});});}; \ No newline at end of file +var _0xe747=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueueReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','info','debug','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird'];(function(_0x31ea98,_0x17eb21){var _0x1a735f=function(_0x4aeeac){while(--_0x4aeeac){_0x31ea98['push'](_0x31ea98['shift']());}};_0x1a735f(++_0x17eb21);}(_0xe747,0x13d));var _0x7e74=function(_0xd557b3,_0x36dcd4){_0xd557b3=_0xd557b3-0x0;var _0x22d5bd=_0xe747[_0xd557b3];return _0x22d5bd;};'use strict';var _=require(_0x7e74('0x0'));var util=require(_0x7e74('0x1'));var moment=require('moment');var BPromise=require(_0x7e74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e74('0x3'));var db=require(_0x7e74('0x4'))['db'];var utils=require(_0x7e74('0x5'));var logger=require(_0x7e74('0x6'))(_0x7e74('0x7'));var config=require(_0x7e74('0x8'));var jayson=require(_0x7e74('0x9'));var client=jayson[_0x7e74('0xa')][_0x7e74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4edfd5,_0x549587,_0x1aba42){return new BPromise(function(_0x632af6,_0x2c4d18){return client[_0x7e74('0xc')](_0x4edfd5,_0x1aba42)[_0x7e74('0xd')](function(_0x2fa3d0){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x549587,'request\x20sent');logger['debug'](_0x7e74('0xe'),_0x549587,'request\x20sent',JSON[_0x7e74('0xf')](_0x2fa3d0));if(_0x2fa3d0[_0x7e74('0x10')]){if(_0x2fa3d0[_0x7e74('0x10')]['code']===0x1f4){logger[_0x7e74('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x549587,_0x2fa3d0['error'][_0x7e74('0x11')]);return _0x2c4d18(_0x2fa3d0[_0x7e74('0x10')]['message']);}logger[_0x7e74('0x10')](_0x7e74('0x12'),_0x549587,_0x2fa3d0['error'][_0x7e74('0x11')]);return _0x632af6(_0x2fa3d0['error'][_0x7e74('0x11')]);}else{logger['info'](_0x7e74('0x12'),_0x549587,_0x7e74('0x13'));_0x632af6(_0x2fa3d0[_0x7e74('0x14')][_0x7e74('0x11')]);}})[_0x7e74('0x15')](function(_0xa9ca1d){logger['error'](_0x7e74('0x12'),_0x549587,_0xa9ca1d);_0x2c4d18(_0xa9ca1d);});});}exports[_0x7e74('0x16')]=function(_0x1c7c9f){var _0x3ab129=this;return new Promise(function(_0x59faec,_0xf3ff8e){return db[_0x7e74('0x17')][_0x7e74('0x18')](_0x1c7c9f['body'],{'raw':_0x1c7c9f[_0x7e74('0x19')]?_0x1c7c9f[_0x7e74('0x19')][_0x7e74('0x1a')]===undefined?!![]:![]:!![]})[_0x7e74('0xd')](function(_0x368a94){logger[_0x7e74('0x1b')](_0x7e74('0x16'),_0x1c7c9f);logger[_0x7e74('0x1c')](_0x7e74('0x16'),_0x1c7c9f,JSON[_0x7e74('0xf')](_0x368a94));_0x59faec(_0x368a94);})[_0x7e74('0x15')](function(_0xa82087){logger[_0x7e74('0x10')](_0x7e74('0x16'),_0xa82087[_0x7e74('0x11')],_0x1c7c9f);_0xf3ff8e(_0x3ab129[_0x7e74('0x10')](0x1f4,_0xa82087['message']));});});};exports[_0x7e74('0x1d')]=function(_0x3c9be6){var _0x4fcffa=this;return new Promise(function(_0x52c86b,_0x14a181){return db[_0x7e74('0x17')]['update'](_0x3c9be6['body'],{'raw':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6['options'][_0x7e74('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9be6['options']?_0x3c9be6[_0x7e74('0x19')]['where']||null:null,'attributes':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6[_0x7e74('0x19')][_0x7e74('0x1e')]||null:null,'limit':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6[_0x7e74('0x19')][_0x7e74('0x1f')]||null:null})[_0x7e74('0xd')](function(_0x2d3c52){logger['info'](_0x7e74('0x1d'),_0x3c9be6);logger[_0x7e74('0x1c')](_0x7e74('0x1d'),_0x3c9be6,JSON['stringify'](_0x2d3c52));_0x52c86b(_0x2d3c52);})[_0x7e74('0x15')](function(_0x2b539c){logger[_0x7e74('0x10')]('UpdateChatQueueReport',_0x2b539c[_0x7e74('0x11')],_0x3c9be6);_0x14a181(_0x4fcffa[_0x7e74('0x10')](0x1f4,_0x2b539c[_0x7e74('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index a16025e..fc09b27 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x044b=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1c21c9,_0x46b430){var _0x113bb4=function(_0x57b175){while(--_0x57b175){_0x1c21c9['push'](_0x1c21c9['shift']());}};_0x113bb4(++_0x46b430);}(_0x044b,0x1c2));var _0xb044=function(_0x2746a3,_0x37242e){_0x2746a3=_0x2746a3-0x0;var _0x5899f7=_0x044b[_0x2746a3];return _0x5899f7;};'use strict';var multer=require(_0xb044('0x0'));var util=require('util');var path=require(_0xb044('0x1'));var timeout=require(_0xb044('0x2'));var express=require(_0xb044('0x3'));var router=express[_0xb044('0x4')]();var fs_extra=require(_0xb044('0x5'));var auth=require(_0xb044('0x6'));var interaction=require(_0xb044('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xb044('0x8')](),controller[_0xb044('0x9')]);router[_0xb044('0xa')](_0xb044('0xb'),auth[_0xb044('0x8')](),controller[_0xb044('0xc')]);router['get']('/:id',auth[_0xb044('0x8')](),controller[_0xb044('0xd')]);router[_0xb044('0xe')]('/',auth[_0xb044('0x8')](),controller['create']);router['put'](_0xb044('0xf'),auth[_0xb044('0x8')](),controller[_0xb044('0x10')]);router[_0xb044('0x11')](_0xb044('0xf'),auth[_0xb044('0x8')](),controller['destroy']);module[_0xb044('0x12')]=router; \ No newline at end of file +var _0x0c3c=['post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x305244,_0xcf3eb0){var _0x49e99e=function(_0x20f6c2){while(--_0x20f6c2){_0x305244['push'](_0x305244['shift']());}};_0x49e99e(++_0xcf3eb0);}(_0x0c3c,0x92));var _0xc0c3=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x0c3c[_0x562faf];return _0x22c1f6;};'use strict';var multer=require(_0xc0c3('0x0'));var util=require(_0xc0c3('0x1'));var path=require(_0xc0c3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c3('0x3'));var router=express['Router']();var fs_extra=require(_0xc0c3('0x4'));var auth=require(_0xc0c3('0x5'));var interaction=require(_0xc0c3('0x6'));var config=require(_0xc0c3('0x7'));var controller=require(_0xc0c3('0x8'));router[_0xc0c3('0x9')]('/',auth[_0xc0c3('0xa')](),controller[_0xc0c3('0xb')]);router[_0xc0c3('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc0c3('0xc')]);router[_0xc0c3('0x9')](_0xc0c3('0xd'),auth[_0xc0c3('0xa')](),controller['show']);router[_0xc0c3('0xe')]('/',auth['isAuthenticated'](),controller[_0xc0c3('0xf')]);router[_0xc0c3('0x10')]('/:id',auth[_0xc0c3('0xa')](),controller['update']);router[_0xc0c3('0x11')](_0xc0c3('0xd'),auth[_0xc0c3('0xa')](),controller[_0xc0c3('0x12')]);module[_0xc0c3('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 276f76e..574b379 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4be563,_0x371f7d){var _0xa7d890=function(_0xe80d67){while(--_0xe80d67){_0x4be563['push'](_0x4be563['shift']());}};_0xa7d890(++_0x371f7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x30b58,_0x48df3b){var _0x9d210d=function(_0x46fffd){while(--_0x46fffd){_0x30b58['push'](_0x30b58['shift']());}};_0x9d210d(++_0x48df3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 8a0d895..3cd3c80 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b25=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x4445e3,_0x4aba46){var _0x3a4867=function(_0x1c9a4e){while(--_0x1c9a4e){_0x4445e3['push'](_0x4445e3['shift']());}};_0x3a4867(++_0x4aba46);}(_0x5b25,0x88));var _0x55b2=function(_0x490db0,_0x3492c7){_0x490db0=_0x490db0-0x0;var _0x5db0ed=_0x5b25[_0x490db0];return _0x5db0ed;};'use strict';var emlformat=require(_0x55b2('0x0'));var rimraf=require(_0x55b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55b2('0x2'));var rp=require(_0x55b2('0x3'));var moment=require(_0x55b2('0x4'));var BPromise=require(_0x55b2('0x5'));var Mustache=require(_0x55b2('0x6'));var util=require(_0x55b2('0x7'));var path=require(_0x55b2('0x8'));var sox=require(_0x55b2('0x9'));var csv=require(_0x55b2('0xa'));var ejs=require(_0x55b2('0xb'));var fs=require('fs');var fs_extra=require(_0x55b2('0xc'));var _=require(_0x55b2('0xd'));var squel=require(_0x55b2('0xe'));var crypto=require(_0x55b2('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x55b2('0x10'));var Papa=require(_0x55b2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x55b2('0x12'));var as=require(_0x55b2('0x13'));var hardwareService=require(_0x55b2('0x14'));var logger=require(_0x55b2('0x15'))(_0x55b2('0x16'));var utils=require(_0x55b2('0x17'));var config=require(_0x55b2('0x18'));var licenseUtil=require(_0x55b2('0x19'));var db=require(_0x55b2('0x1a'))['db'];function respondWithStatusCode(_0x480b67,_0x49dd9b){_0x49dd9b=_0x49dd9b||0xcc;return function(_0x409cbc){if(_0x409cbc){return _0x480b67[_0x55b2('0x1b')](_0x49dd9b);}return _0x480b67[_0x55b2('0x1c')](_0x49dd9b)[_0x55b2('0x1d')]();};}function respondWithResult(_0x536fb9,_0x4f4b0e){_0x4f4b0e=_0x4f4b0e||0xc8;return function(_0x26c47d){if(_0x26c47d){return _0x536fb9[_0x55b2('0x1c')](_0x4f4b0e)['json'](_0x26c47d);}};}function respondWithFilteredResult(_0x522557,_0x31d2e1){return function(_0x53e458){if(_0x53e458){var _0x22de2e=typeof _0x31d2e1['offset']==='undefined'&&typeof _0x31d2e1[_0x55b2('0x1e')]==='undefined';var _0x16b340=_0x53e458[_0x55b2('0x1f')];var _0xb6887d=_0x22de2e?0x0:_0x31d2e1['offset'];var _0x3a750d=_0x22de2e?_0x53e458[_0x55b2('0x1f')]:_0x31d2e1[_0x55b2('0x20')]+_0x31d2e1[_0x55b2('0x1e')];var _0x7340a0;if(_0x3a750d>=_0x16b340){_0x3a750d=_0x16b340;_0x7340a0=0xc8;}else{_0x7340a0=0xce;}_0x522557['status'](_0x7340a0);return _0x522557[_0x55b2('0x21')]('Content-Range',_0xb6887d+'-'+_0x3a750d+'/'+_0x16b340)[_0x55b2('0x22')](_0x53e458);}return null;};}function patchUpdates(_0x4285b4){return function(_0x28db47){try{jsonpatch[_0x55b2('0x23')](_0x28db47,_0x4285b4,!![]);}catch(_0x4db407){return BPromise[_0x55b2('0x24')](_0x4db407);}return _0x28db47[_0x55b2('0x25')]();};}function saveUpdates(_0x31fa65,_0x505c4c){return function(_0x27f799){if(_0x27f799){return _0x27f799[_0x55b2('0x26')](_0x31fa65)[_0x55b2('0x27')](function(_0x4050e1){return _0x4050e1;});}return null;};}function removeEntity(_0x53efb3,_0x159bc1){return function(_0x5656cd){if(_0x5656cd){return _0x5656cd[_0x55b2('0x28')]()[_0x55b2('0x27')](function(){_0x53efb3['status'](0xcc)[_0x55b2('0x1d')]();});}};}function handleEntityNotFound(_0x5bdefd,_0x307fa8){return function(_0x516ba8){if(!_0x516ba8){_0x5bdefd['sendStatus'](0x194);}return _0x516ba8;};}function handleError(_0x24af40,_0x494b73){_0x494b73=_0x494b73||0x1f4;return function(_0x3cc390){logger[_0x55b2('0x29')](_0x3cc390['stack']);if(_0x3cc390[_0x55b2('0x2a')]){delete _0x3cc390[_0x55b2('0x2a')];}_0x24af40[_0x55b2('0x1c')](_0x494b73)['send'](_0x3cc390);};}exports[_0x55b2('0x2b')]=function(_0x5a7de2,_0x25694e){var _0x4e3953={},_0xbd1399={},_0x5d191c={'count':0x0,'rows':[]};var _0x18d7fa=_[_0x55b2('0x2c')](db[_0x55b2('0x2d')][_0x55b2('0x2e')],function(_0x209bda){return{'name':_0x209bda[_0x55b2('0x2f')],'type':_0x209bda['type']['key']};});_0xbd1399[_0x55b2('0x30')]=_[_0x55b2('0x2c')](_0x18d7fa,_0x55b2('0x2a'));_0xbd1399[_0x55b2('0x31')]=_['keys'](_0x5a7de2[_0x55b2('0x31')]);_0xbd1399['filters']=_[_0x55b2('0x32')](_0xbd1399[_0x55b2('0x30')],_0xbd1399[_0x55b2('0x31')]);_0x4e3953['attributes']=_['intersection'](_0xbd1399[_0x55b2('0x30')],qs[_0x55b2('0x33')](_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x33')]));_0x4e3953[_0x55b2('0x34')]=_0x4e3953[_0x55b2('0x34')][_0x55b2('0x35')]?_0x4e3953['attributes']:_0xbd1399[_0x55b2('0x30')];if(!_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x36')](_0x55b2('0x37'))){_0x4e3953[_0x55b2('0x1e')]=qs[_0x55b2('0x1e')](_0x5a7de2['query'][_0x55b2('0x1e')]);_0x4e3953[_0x55b2('0x20')]=qs[_0x55b2('0x20')](_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x20')]);}_0x4e3953[_0x55b2('0x38')]=qs[_0x55b2('0x39')](_0x5a7de2['query'][_0x55b2('0x39')]);_0x4e3953[_0x55b2('0x3a')]=qs[_0x55b2('0x3b')](_[_0x55b2('0x3c')](_0x5a7de2[_0x55b2('0x31')],_0xbd1399[_0x55b2('0x3b')]),_0x18d7fa);if(_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x3d')]){_0x4e3953['where']=_[_0x55b2('0x3e')](_0x4e3953[_0x55b2('0x3a')],{'$or':_[_0x55b2('0x2c')](_0x18d7fa,function(_0x10a4df){if(_0x10a4df[_0x55b2('0x3f')]!=='VIRTUAL'){var _0x3215df={};_0x3215df[_0x10a4df[_0x55b2('0x2a')]]={'$like':'%'+_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x3d')]+'%'};return _0x3215df;}})});}_0x4e3953=_['merge']({},_0x4e3953,_0x5a7de2[_0x55b2('0x40')]);var _0xa339f8={'where':_0x4e3953['where']};return db[_0x55b2('0x2d')][_0x55b2('0x1f')](_0xa339f8)[_0x55b2('0x27')](function(_0x1e0907){_0x5d191c[_0x55b2('0x1f')]=_0x1e0907;if(_0x5a7de2['query'][_0x55b2('0x41')]){_0x4e3953[_0x55b2('0x42')]=[{'all':!![]}];}return db[_0x55b2('0x2d')][_0x55b2('0x43')](_0x4e3953);})[_0x55b2('0x27')](function(_0x328f03){_0x5d191c[_0x55b2('0x44')]=_0x328f03;return _0x5d191c;})[_0x55b2('0x27')](respondWithFilteredResult(_0x25694e,_0x4e3953))['catch'](handleError(_0x25694e,null));};exports[_0x55b2('0x45')]=function(_0x1fec54,_0x3b0f6b){var _0x33373e={'raw':!![],'where':{'id':_0x1fec54[_0x55b2('0x46')]['id']}},_0x1abded={};_0x1abded['model']=_[_0x55b2('0x47')](db[_0x55b2('0x2d')]['rawAttributes']);_0x1abded[_0x55b2('0x31')]=_[_0x55b2('0x47')](_0x1fec54[_0x55b2('0x31')]);_0x1abded[_0x55b2('0x3b')]=_[_0x55b2('0x32')](_0x1abded[_0x55b2('0x30')],_0x1abded[_0x55b2('0x31')]);_0x33373e[_0x55b2('0x34')]=_[_0x55b2('0x32')](_0x1abded[_0x55b2('0x30')],qs[_0x55b2('0x33')](_0x1fec54[_0x55b2('0x31')][_0x55b2('0x33')]));_0x33373e[_0x55b2('0x34')]=_0x33373e['attributes']['length']?_0x33373e[_0x55b2('0x34')]:_0x1abded[_0x55b2('0x30')];if(_0x1fec54['query'][_0x55b2('0x41')]){_0x33373e[_0x55b2('0x42')]=[{'all':!![]}];}_0x33373e=_[_0x55b2('0x3e')]({},_0x33373e,_0x1fec54[_0x55b2('0x40')]);return db[_0x55b2('0x2d')][_0x55b2('0x48')](_0x33373e)['then'](handleEntityNotFound(_0x3b0f6b,null))['then'](respondWithResult(_0x3b0f6b,null))[_0x55b2('0x49')](handleError(_0x3b0f6b,null));};exports[_0x55b2('0x4a')]=function(_0x461033,_0x4bd6f0){return db['ChatTransferReport'][_0x55b2('0x4a')](_0x461033[_0x55b2('0x4b')],{})[_0x55b2('0x27')](respondWithResult(_0x4bd6f0,0xc9))[_0x55b2('0x49')](handleError(_0x4bd6f0,null));};exports[_0x55b2('0x26')]=function(_0x496376,_0x1042d2){if(_0x496376['body']['id']){delete _0x496376[_0x55b2('0x4b')]['id'];}return db[_0x55b2('0x2d')][_0x55b2('0x48')]({'where':{'id':_0x496376[_0x55b2('0x46')]['id']}})[_0x55b2('0x27')](handleEntityNotFound(_0x1042d2,null))[_0x55b2('0x27')](saveUpdates(_0x496376[_0x55b2('0x4b')],null))[_0x55b2('0x27')](respondWithResult(_0x1042d2,null))[_0x55b2('0x49')](handleError(_0x1042d2,null));};exports['destroy']=function(_0x3fc01e,_0x4b4a99){return db[_0x55b2('0x2d')][_0x55b2('0x48')]({'where':{'id':_0x3fc01e[_0x55b2('0x46')]['id']}})[_0x55b2('0x27')](handleEntityNotFound(_0x4b4a99,null))[_0x55b2('0x27')](removeEntity(_0x4b4a99,null))[_0x55b2('0x49')](handleError(_0x4b4a99,null));};exports[_0x55b2('0x4c')]=function(_0x4a0d0d,_0x17b4c5){return db[_0x55b2('0x2d')][_0x55b2('0x4c')]()[_0x55b2('0x27')](respondWithResult(_0x17b4c5,null))[_0x55b2('0x49')](handleError(_0x17b4c5,null));}; \ No newline at end of file +var _0x7c43=['params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','fs-extra','lodash','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','ChatTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','catch','show'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x7c43,0x11f));var _0x37c4=function(_0x50c5d5,_0x4ef853){_0x50c5d5=_0x50c5d5-0x0;var _0x466c90=_0x7c43[_0x50c5d5];return _0x466c90;};'use strict';var emlformat=require(_0x37c4('0x0'));var rimraf=require(_0x37c4('0x1'));var zipdir=require(_0x37c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x37c4('0x3'));var BPromise=require(_0x37c4('0x4'));var Mustache=require('mustache');var util=require(_0x37c4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x37c4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37c4('0x7'));var _=require(_0x37c4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37c4('0x9'));var toCsv=require(_0x37c4('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37c4('0xa'));var qs=require(_0x37c4('0xb'));var as=require(_0x37c4('0xc'));var hardwareService=require(_0x37c4('0xd'));var logger=require(_0x37c4('0xe'))(_0x37c4('0xf'));var utils=require(_0x37c4('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x37c4('0x11'));var db=require(_0x37c4('0x12'))['db'];function respondWithStatusCode(_0x54f229,_0x313789){_0x313789=_0x313789||0xcc;return function(_0x27c54b){if(_0x27c54b){return _0x54f229[_0x37c4('0x13')](_0x313789);}return _0x54f229[_0x37c4('0x14')](_0x313789)[_0x37c4('0x15')]();};}function respondWithResult(_0x30c4ab,_0x3611fe){_0x3611fe=_0x3611fe||0xc8;return function(_0x379a41){if(_0x379a41){return _0x30c4ab[_0x37c4('0x14')](_0x3611fe)[_0x37c4('0x16')](_0x379a41);}};}function respondWithFilteredResult(_0x2fb9c3,_0x40ce92){return function(_0x29809a){if(_0x29809a){var _0xaf7799=typeof _0x40ce92['offset']===_0x37c4('0x17')&&typeof _0x40ce92[_0x37c4('0x18')]===_0x37c4('0x17');var _0x419c7b=_0x29809a[_0x37c4('0x19')];var _0x3f2680=_0xaf7799?0x0:_0x40ce92[_0x37c4('0x1a')];var _0x387b86=_0xaf7799?_0x29809a[_0x37c4('0x19')]:_0x40ce92['offset']+_0x40ce92[_0x37c4('0x18')];var _0x663c7;if(_0x387b86>=_0x419c7b){_0x387b86=_0x419c7b;_0x663c7=0xc8;}else{_0x663c7=0xce;}_0x2fb9c3[_0x37c4('0x14')](_0x663c7);return _0x2fb9c3[_0x37c4('0x1b')](_0x37c4('0x1c'),_0x3f2680+'-'+_0x387b86+'/'+_0x419c7b)[_0x37c4('0x16')](_0x29809a);}return null;};}function patchUpdates(_0x4f8643){return function(_0x444f4b){try{jsonpatch[_0x37c4('0x1d')](_0x444f4b,_0x4f8643,!![]);}catch(_0x1bf3d7){return BPromise[_0x37c4('0x1e')](_0x1bf3d7);}return _0x444f4b[_0x37c4('0x1f')]();};}function saveUpdates(_0x3437e4,_0x546a59){return function(_0x3630d9){if(_0x3630d9){return _0x3630d9['update'](_0x3437e4)[_0x37c4('0x20')](function(_0x1faf29){return _0x1faf29;});}return null;};}function removeEntity(_0x3fb043,_0x134a8f){return function(_0x586532){if(_0x586532){return _0x586532[_0x37c4('0x21')]()[_0x37c4('0x20')](function(){_0x3fb043['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e914,_0x4d6473){return function(_0xdf13e2){if(!_0xdf13e2){_0x45e914[_0x37c4('0x13')](0x194);}return _0xdf13e2;};}function handleError(_0x3dc7e1,_0x454f8f){_0x454f8f=_0x454f8f||0x1f4;return function(_0x4f98b2){logger[_0x37c4('0x22')](_0x4f98b2[_0x37c4('0x23')]);if(_0x4f98b2[_0x37c4('0x24')]){delete _0x4f98b2['name'];}_0x3dc7e1['status'](_0x454f8f)['send'](_0x4f98b2);};}exports['index']=function(_0xdacfb8,_0x1d0639){var _0x5c9e85={},_0x1185f5={},_0x5d74ac={'count':0x0,'rows':[]};var _0x41060f=_['map'](db[_0x37c4('0x25')][_0x37c4('0x26')],function(_0xb97900){return{'name':_0xb97900[_0x37c4('0x27')],'type':_0xb97900['type'][_0x37c4('0x28')]};});_0x1185f5[_0x37c4('0x29')]=_[_0x37c4('0x2a')](_0x41060f,_0x37c4('0x24'));_0x1185f5['query']=_[_0x37c4('0x2b')](_0xdacfb8[_0x37c4('0x2c')]);_0x1185f5[_0x37c4('0x2d')]=_[_0x37c4('0x2e')](_0x1185f5[_0x37c4('0x29')],_0x1185f5[_0x37c4('0x2c')]);_0x5c9e85[_0x37c4('0x2f')]=_[_0x37c4('0x2e')](_0x1185f5['model'],qs[_0x37c4('0x30')](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x30')]));_0x5c9e85['attributes']=_0x5c9e85[_0x37c4('0x2f')][_0x37c4('0x31')]?_0x5c9e85[_0x37c4('0x2f')]:_0x1185f5[_0x37c4('0x29')];if(!_0xdacfb8[_0x37c4('0x2c')]['hasOwnProperty'](_0x37c4('0x32'))){_0x5c9e85[_0x37c4('0x18')]=qs[_0x37c4('0x18')](_0xdacfb8['query'][_0x37c4('0x18')]);_0x5c9e85[_0x37c4('0x1a')]=qs[_0x37c4('0x1a')](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x1a')]);}_0x5c9e85[_0x37c4('0x33')]=qs['sort'](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x34')]);_0x5c9e85[_0x37c4('0x35')]=qs['filters'](_[_0x37c4('0x36')](_0xdacfb8[_0x37c4('0x2c')],_0x1185f5[_0x37c4('0x2d')]),_0x41060f);if(_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x37')]){_0x5c9e85[_0x37c4('0x35')]=_[_0x37c4('0x38')](_0x5c9e85['where'],{'$or':_['map'](_0x41060f,function(_0x26d2f0){if(_0x26d2f0[_0x37c4('0x39')]!=='VIRTUAL'){var _0x4b5b88={};_0x4b5b88[_0x26d2f0[_0x37c4('0x24')]]={'$like':'%'+_0xdacfb8[_0x37c4('0x2c')]['filter']+'%'};return _0x4b5b88;}})});}_0x5c9e85=_[_0x37c4('0x38')]({},_0x5c9e85,_0xdacfb8[_0x37c4('0x3a')]);var _0x3963ad={'where':_0x5c9e85[_0x37c4('0x35')]};return db[_0x37c4('0x25')][_0x37c4('0x19')](_0x3963ad)['then'](function(_0x536639){_0x5d74ac[_0x37c4('0x19')]=_0x536639;if(_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x3b')]){_0x5c9e85['include']=[{'all':!![]}];}return db[_0x37c4('0x25')][_0x37c4('0x3c')](_0x5c9e85);})[_0x37c4('0x20')](function(_0x51137f){_0x5d74ac['rows']=_0x51137f;return _0x5d74ac;})[_0x37c4('0x20')](respondWithFilteredResult(_0x1d0639,_0x5c9e85))[_0x37c4('0x3d')](handleError(_0x1d0639,null));};exports[_0x37c4('0x3e')]=function(_0x146577,_0x1ffcec){var _0x25e2d6={'raw':!![],'where':{'id':_0x146577[_0x37c4('0x3f')]['id']}},_0x22479d={};_0x22479d[_0x37c4('0x29')]=_[_0x37c4('0x2b')](db['ChatTransferReport'][_0x37c4('0x26')]);_0x22479d[_0x37c4('0x2c')]=_[_0x37c4('0x2b')](_0x146577[_0x37c4('0x2c')]);_0x22479d[_0x37c4('0x2d')]=_[_0x37c4('0x2e')](_0x22479d['model'],_0x22479d[_0x37c4('0x2c')]);_0x25e2d6['attributes']=_[_0x37c4('0x2e')](_0x22479d['model'],qs[_0x37c4('0x30')](_0x146577[_0x37c4('0x2c')][_0x37c4('0x30')]));_0x25e2d6['attributes']=_0x25e2d6[_0x37c4('0x2f')][_0x37c4('0x31')]?_0x25e2d6['attributes']:_0x22479d[_0x37c4('0x29')];if(_0x146577[_0x37c4('0x2c')][_0x37c4('0x3b')]){_0x25e2d6[_0x37c4('0x40')]=[{'all':!![]}];}_0x25e2d6=_[_0x37c4('0x38')]({},_0x25e2d6,_0x146577[_0x37c4('0x3a')]);return db[_0x37c4('0x25')][_0x37c4('0x41')](_0x25e2d6)[_0x37c4('0x20')](handleEntityNotFound(_0x1ffcec,null))[_0x37c4('0x20')](respondWithResult(_0x1ffcec,null))[_0x37c4('0x3d')](handleError(_0x1ffcec,null));};exports[_0x37c4('0x42')]=function(_0x3809d9,_0x312b12){return db[_0x37c4('0x25')][_0x37c4('0x42')](_0x3809d9[_0x37c4('0x43')],{})[_0x37c4('0x20')](respondWithResult(_0x312b12,0xc9))['catch'](handleError(_0x312b12,null));};exports[_0x37c4('0x44')]=function(_0x5ca3a0,_0x391b29){if(_0x5ca3a0['body']['id']){delete _0x5ca3a0['body']['id'];}return db[_0x37c4('0x25')][_0x37c4('0x41')]({'where':{'id':_0x5ca3a0[_0x37c4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x391b29,null))['then'](saveUpdates(_0x5ca3a0['body'],null))[_0x37c4('0x20')](respondWithResult(_0x391b29,null))['catch'](handleError(_0x391b29,null));};exports[_0x37c4('0x21')]=function(_0x5ba1e6,_0x5baf1f){return db[_0x37c4('0x25')]['find']({'where':{'id':_0x5ba1e6[_0x37c4('0x3f')]['id']}})[_0x37c4('0x20')](handleEntityNotFound(_0x5baf1f,null))[_0x37c4('0x20')](removeEntity(_0x5baf1f,null))['catch'](handleError(_0x5baf1f,null));};exports['describe']=function(_0x191ddd,_0xab2a55){return db['ChatTransferReport'][_0x37c4('0x45')]()[_0x37c4('0x20')](respondWithResult(_0xab2a55,null))[_0x37c4('0x3d')](handleError(_0xab2a55,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index c5fd67b..b97d4e0 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10f6=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x10f6,0x1da));var _0x610f=function(_0x5de6b0,_0x50421d){_0x5de6b0=_0x5de6b0-0x0;var _0x397b9e=_0x10f6[_0x5de6b0];return _0x397b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x610f('0x0'))(_0x610f('0x1'));var moment=require(_0x610f('0x2'));var BPromise=require(_0x610f('0x3'));var rp=require(_0x610f('0x4'));var fs=require('fs');var path=require(_0x610f('0x5'));var rimraf=require('rimraf');var config=require(_0x610f('0x6'));var attributes=require(_0x610f('0x7'));module[_0x610f('0x8')]=function(_0x672ed2,_0x2624a2){return _0x672ed2[_0x610f('0x9')](_0x610f('0xa'),attributes,{'tableName':_0x610f('0xb'),'paranoid':![],'indexes':[{'name':_0x610f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xca0c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x1d8e86,_0x536855){var _0x43b5f1=function(_0x3a3230){while(--_0x3a3230){_0x1d8e86['push'](_0x1d8e86['shift']());}};_0x43b5f1(++_0x536855);}(_0xca0c,0x1da));var _0xcca0=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xca0c[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xcca0('0x0'));var util=require(_0xcca0('0x1'));var logger=require('../../config/logger')(_0xcca0('0x2'));var moment=require(_0xcca0('0x3'));var BPromise=require(_0xcca0('0x4'));var rp=require(_0xcca0('0x5'));var fs=require('fs');var path=require(_0xcca0('0x6'));var rimraf=require(_0xcca0('0x7'));var config=require(_0xcca0('0x8'));var attributes=require(_0xcca0('0x9'));module[_0xcca0('0xa')]=function(_0x2b6056,_0x2e1333){return _0x2b6056['define'](_0xcca0('0xb'),attributes,{'tableName':_0xcca0('0xc'),'paranoid':![],'indexes':[{'name':_0xcca0('0xd'),'fields':[_0xcca0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index de7c53f..f7d072c 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a0d=['catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x1a4ac6,_0x1c8f2f){var _0x1ab98e=function(_0x14b761){while(--_0x14b761){_0x1a4ac6['push'](_0x1a4ac6['shift']());}};_0x1ab98e(++_0x1c8f2f);}(_0x4a0d,0xa9));var _0xd4a0=function(_0x4ed37d,_0x1a84c9){_0x4ed37d=_0x4ed37d-0x0;var _0x4fb2c5=_0x4a0d[_0x4ed37d];return _0x4fb2c5;};'use strict';var _=require(_0xd4a0('0x0'));var util=require('util');var moment=require(_0xd4a0('0x1'));var BPromise=require(_0xd4a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4a0('0x4'))(_0xd4a0('0x5'));var config=require(_0xd4a0('0x6'));var jayson=require(_0xd4a0('0x7'));var client=jayson[_0xd4a0('0x8')][_0xd4a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe752f,_0x401f9d,_0x5a9499){return new BPromise(function(_0x420e99,_0x10652b){return client[_0xd4a0('0xa')](_0xbe752f,_0x5a9499)[_0xd4a0('0xb')](function(_0x39e66b){logger[_0xd4a0('0xc')](_0xd4a0('0xd'),_0x401f9d,'request\x20sent');logger[_0xd4a0('0xe')](_0xd4a0('0xf'),_0x401f9d,_0xd4a0('0x10'),JSON['stringify'](_0x39e66b));if(_0x39e66b[_0xd4a0('0x11')]){if(_0x39e66b['error']['code']===0x1f4){logger[_0xd4a0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0x39e66b['error'][_0xd4a0('0x12')]);return _0x10652b(_0x39e66b[_0xd4a0('0x11')][_0xd4a0('0x12')]);}logger[_0xd4a0('0x11')](_0xd4a0('0xd'),_0x401f9d,_0x39e66b[_0xd4a0('0x11')]['message']);return _0x420e99(_0x39e66b[_0xd4a0('0x11')]['message']);}else{logger[_0xd4a0('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0xd4a0('0x10'));_0x420e99(_0x39e66b[_0xd4a0('0x13')][_0xd4a0('0x12')]);}})[_0xd4a0('0x14')](function(_0x1a6de7){logger[_0xd4a0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0x1a6de7);_0x10652b(_0x1a6de7);});});} \ No newline at end of file +var _0xb7e0=['code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf2efae,_0x307737){var _0x241311=function(_0x5ba928){while(--_0x5ba928){_0xf2efae['push'](_0xf2efae['shift']());}};_0x241311(++_0x307737);}(_0xb7e0,0x16b));var _0x0b7e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb7e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0b7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b7e('0x1'));var rs=require(_0x0b7e('0x2'));var fs=require('fs');var Redis=require(_0x0b7e('0x3'));var db=require(_0x0b7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b7e('0x5'));var config=require(_0x0b7e('0x6'));var jayson=require(_0x0b7e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8bd431,_0x26cee6,_0x157417){return new BPromise(function(_0xbfbf6f,_0x11b2e5){return client[_0x0b7e('0x8')](_0x8bd431,_0x157417)[_0x0b7e('0x9')](function(_0x8e7596){logger[_0x0b7e('0xa')](_0x0b7e('0xb'),_0x26cee6,'request\x20sent');logger[_0x0b7e('0xc')](_0x0b7e('0xd'),_0x26cee6,_0x0b7e('0xe'),JSON[_0x0b7e('0xf')](_0x8e7596));if(_0x8e7596[_0x0b7e('0x10')]){if(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x11')]===0x1f4){logger['error'](_0x0b7e('0xb'),_0x26cee6,_0x8e7596['error']['message']);return _0x11b2e5(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);}logger[_0x0b7e('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);return _0xbfbf6f(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);}else{logger[_0x0b7e('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,'request\x20sent');_0xbfbf6f(_0x8e7596[_0x0b7e('0x13')]['message']);}})['catch'](function(_0x4ff5c4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,_0x4ff5c4);_0x11b2e5(_0x4ff5c4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9a53b57..382435c 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8c7=['describe','/:id','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x151b2a,_0x2b88b8){var _0x5c2c04=function(_0x1786d0){while(--_0x1786d0){_0x151b2a['push'](_0x151b2a['shift']());}};_0x5c2c04(++_0x2b88b8);}(_0xe8c7,0xfe));var _0x7e8c=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xe8c7[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e8c('0x0'));var timeout=require('connect-timeout');var express=require(_0x7e8c('0x1'));var router=express[_0x7e8c('0x2')]();var fs_extra=require(_0x7e8c('0x3'));var auth=require(_0x7e8c('0x4'));var interaction=require(_0x7e8c('0x5'));var config=require(_0x7e8c('0x6'));var controller=require(_0x7e8c('0x7'));router[_0x7e8c('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e8c('0x9')]);router[_0x7e8c('0x8')](_0x7e8c('0xa'),auth[_0x7e8c('0xb')](),controller[_0x7e8c('0xc')]);router[_0x7e8c('0x8')](_0x7e8c('0xd'),auth[_0x7e8c('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7e8c('0xe')]('/:id',auth[_0x7e8c('0xb')](),controller[_0x7e8c('0xf')]);router[_0x7e8c('0x10')](_0x7e8c('0xd'),auth[_0x7e8c('0xb')](),controller[_0x7e8c('0x11')]);module[_0x7e8c('0x12')]=router; \ No newline at end of file +var _0x3bcf=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bcf,0x134));var _0xf3bc=function(_0x8e6b66,_0x1919e1){_0x8e6b66=_0x8e6b66-0x0;var _0x58050e=_0x3bcf[_0x8e6b66];return _0x58050e;};'use strict';var multer=require(_0xf3bc('0x0'));var util=require(_0xf3bc('0x1'));var path=require(_0xf3bc('0x2'));var timeout=require(_0xf3bc('0x3'));var express=require(_0xf3bc('0x4'));var router=express['Router']();var fs_extra=require(_0xf3bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf3bc('0x6'));var config=require(_0xf3bc('0x7'));var controller=require(_0xf3bc('0x8'));router['get']('/',auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xa')]);router[_0xf3bc('0xb')](_0xf3bc('0xc'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xd')]);router[_0xf3bc('0xb')]('/:id',auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xe')]);router[_0xf3bc('0xf')]('/',auth['isAuthenticated'](),controller[_0xf3bc('0x10')]);router[_0xf3bc('0x11')](_0xf3bc('0x12'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0x13')]);router['delete'](_0xf3bc('0x12'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8daf259..212f687 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f51=['setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','name','text','input','getDataValue','onlineForm','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x43785a,_0x322357){var _0x3cbbbe=function(_0x367421){while(--_0x367421){_0x43785a['push'](_0x43785a['shift']());}};_0x3cbbbe(++_0x322357);}(_0x5f51,0x1ed));var _0x15f5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5f51[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x15f5('0x0'));var rs=require(_0x15f5('0x1'));module[_0x15f5('0x2')]={'name':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'unique':_0x15f5('0x4')},'description':{'type':Sequelize[_0x15f5('0x3')]},'mapKey':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x5')},'mapKeyOffline':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15f5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15f5('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':_0x15f5('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x15f5('0x9')](_0x15f5('0xa'),_0x15f5('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0xd')},'offline_chat_button':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0xe')},'download_transcript':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x15f5('0x11')]},'closingQuestion':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x15')},'closingMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x17')},'conditionAgreement':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x18')},'ratingType':{'type':Sequelize[_0x15f5('0x9')]('star',_0x15f5('0x19')),'defaultValue':_0x15f5('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return JSON[_0x15f5('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x15f5('0x1c'),'type':_0x15f5('0x1d'),'required':!![]},'props':{'title':_0x15f5('0x1c'),'helpText':''}},{'type':_0x15f5('0x1e'),'props':{'title':_0x15f5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x15f5('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x15f5('0x1f')](_0x15f5('0x20'))?JSON['parse'](this['getDataValue'](_0x15f5('0x20'))):{};},'set':function(_0x211a1c){return this['setDataValue'](_0x15f5('0x20'),JSON[_0x15f5('0x1b')](_0x211a1c));}},'offlineForm':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return JSON[_0x15f5('0x1b')]({'items':[{'type':_0x15f5('0x1e'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x15f5('0x5'),'type':'email'},'variable':null},{'type':_0x15f5('0x21'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x15f5('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x15f5('0x1f')](_0x15f5('0x23'))?JSON['parse'](this[_0x15f5('0x1f')](_0x15f5('0x23'))):{};},'set':function(_0x274495){return this['setDataValue']('offlineForm',JSON[_0x15f5('0x1b')](_0x274495));}},'token':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':function(){return rs[_0x15f5('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x15f5('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x25')},'waitingMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x26')},'offlineMessageBody':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x15f5('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x15f5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return _0x15f5('0x29');}},'notificationSound':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2b')},'verticalAlignment':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2c')},'messagesAlignment':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x15f5('0x3')]},'customerAvatar':{'type':Sequelize[_0x15f5('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x15f5('0x8')],'comment':_0x15f5('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16be02){if(!_0x16be02)this[_0x15f5('0x2e')]('mandatoryDispositionPauseId',null);this[_0x15f5('0x2e')](_0x15f5('0x2f'),_0x16be02);}},'vidaooEscalation':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':_0x15f5('0x30')},'vidaooNote':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x15f5('0x11')]}}; \ No newline at end of file +var _0xec01=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','star','input','text','name','getDataValue','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x8df78,_0xdfee63){var _0xde4b55=function(_0x16c846){while(--_0x16c846){_0x8df78['push'](_0x8df78['shift']());}};_0xde4b55(++_0xdfee63);}(_0xec01,0x1a8));var _0x1ec0=function(_0x1b2bb7,_0x367e74){_0x1b2bb7=_0x1b2bb7-0x0;var _0x2489a7=_0xec01[_0x1b2bb7];return _0x2489a7;};'use strict';var Sequelize=require(_0x1ec0('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'unique':_0x1ec0('0x2')},'description':{'type':Sequelize[_0x1ec0('0x1')]},'mapKey':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x3')},'key':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1ec0('0x4')},'customerAlias':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':_0x1ec0('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec0('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ec0('0x1')]},'animation':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x1ec0('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x9')},'start_chat_button':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xa')},'offline_chat_button':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xb')},'header_offline':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xc')},'download_transcript':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1ec0('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ec0('0xe')]},'closingQuestion':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x12')},'closingMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xb')},'skipMessageButton':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x13')},'conditionAgreement':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x14')},'ratingType':{'type':Sequelize[_0x1ec0('0x15')]('star',_0x1ec0('0x16')),'defaultValue':_0x1ec0('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1ec0('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x1ec0('0x19'),'required':!![]},'props':{'title':_0x1ec0('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x1ec0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1ec0('0x3'),'type':_0x1ec0('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ec0('0x1b')](_0x1ec0('0x1c'))?JSON['parse'](this[_0x1ec0('0x1b')](_0x1ec0('0x1c'))):{};},'set':function(_0x136abe){return this['setDataValue'](_0x1ec0('0x1c'),JSON[_0x1ec0('0x1d')](_0x136abe));}},'offlineForm':{'type':Sequelize[_0x1ec0('0xe')],'defaultValue':function(){return JSON[_0x1ec0('0x1d')]({'items':[{'type':_0x1ec0('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ec0('0x3'),'type':_0x1ec0('0x3')},'variable':null},{'type':_0x1ec0('0x1e'),'config':{'placeholder':_0x1ec0('0x1f')},'props':{'title':_0x1ec0('0x1f'),'helpText':_0x1ec0('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1ec0('0x1b')](_0x1ec0('0x21'))?JSON['parse'](this[_0x1ec0('0x1b')](_0x1ec0('0x21'))):{};},'set':function(_0x2cf672){return this['setDataValue'](_0x1ec0('0x21'),JSON[_0x1ec0('0x1d')](_0x2cf672));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1ec0('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1ec0('0x1')]},'forwardOffline':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x23')},'waitingMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x24')},'offlineMessageBody':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x25')},'skipUnmanaged':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x13')},'sendUnmanaged':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1ec0('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ec0('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x26')},'verticalAlignment':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x1ec0('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec0('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ec0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ec0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x28')},'systemAvatar':{'type':Sequelize[_0x1ec0('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ec0('0x6')],'comment':_0x1ec0('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![],'comment':_0x1ec0('0x2a'),'set':function(_0xe913d2){if(!_0xe913d2)this['setDataValue'](_0x1ec0('0x2b'),null);this['setDataValue'](_0x1ec0('0x2c'),_0xe913d2);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':_0x1ec0('0x2d')},'vidaooNote':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':function(){return _0x1ec0('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x1ec0('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1ec0('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 52e60a6..6cb059d 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','fields','nolimit','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','chat','Sequelize','createdAt','updatedAt','difference','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','CmContact','contact','customerIp','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','originalname','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','Transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','end','stack','name','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatWebsite','includeAll','include','rows','show','params','Pause','find','catch','create','body','user'];(function(_0x13ea78,_0x4fc7e3){var _0x19fe58=function(_0xfbc7c2){while(--_0xfbc7c2){_0x13ea78['push'](_0x13ea78['shift']());}};_0x19fe58(++_0x4fc7e3);}(_0x01d3,0xdb));var _0x301d=function(_0x2316bb,_0x469930){_0x2316bb=_0x2316bb-0x0;var _0x57041d=_0x01d3[_0x2316bb];return _0x57041d;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x301d('0x0'));var path=require(_0x301d('0x1'));var ejs=require(_0x301d('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x301d('0x3'));var querystring=require(_0x301d('0x4'));var Redis=require(_0x301d('0x5'));var qs=require(_0x301d('0x6'));var logger=require(_0x301d('0x7'))('api');var config=require(_0x301d('0x8'));var db=require(_0x301d('0x9'))['db'];config[_0x301d('0xa')]=_[_0x301d('0xb')](config[_0x301d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x301d('0xc'))(new Redis(config[_0x301d('0xa')]));require(_0x301d('0xd'))[_0x301d('0xe')](socket);var jayson=require(_0x301d('0xf'));var client=jayson[_0x301d('0x10')][_0x301d('0x11')]({'port':0x232c});var client9002=jayson[_0x301d('0x10')][_0x301d('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x301d('0x11')]({'port':0x232b});var client9001=jayson[_0x301d('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x8a1fd0,_0x36a7aa,_0x2eb3af,_0x53bfe2){return new BPromise(function(_0x496f0c,_0x175871){var _0x3218dc=_0x53bfe2||client;return _0x3218dc[_0x301d('0x12')](_0x8a1fd0,_0x2eb3af)[_0x301d('0x13')](function(_0x11bacf){logger[_0x301d('0x14')](_0x301d('0x15'),_0x36a7aa,'request\x20sent');logger[_0x301d('0x16')](_0x301d('0x17'),_0x36a7aa,'request\x20sent',JSON[_0x301d('0x18')](_0x11bacf));if(_0x11bacf[_0x301d('0x19')]){if(_0x11bacf[_0x301d('0x19')][_0x301d('0x1a')]===0x1f4){logger[_0x301d('0x19')](_0x301d('0x15'),_0x36a7aa,_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);return _0x175871(_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);}logger[_0x301d('0x19')](_0x301d('0x15'),_0x36a7aa,_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);return _0x496f0c(_0x11bacf[_0x301d('0x19')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x36a7aa,_0x301d('0x1c'));_0x496f0c(_0x11bacf[_0x301d('0x1d')][_0x301d('0x1b')]);}})['catch'](function(_0x18495a){logger[_0x301d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x36a7aa,_0x18495a);_0x175871(_0x18495a);});});}function respondWithStatusCode(_0x485f96,_0x292c89){_0x292c89=_0x292c89||0xcc;return function(_0x30569e){if(_0x30569e){return _0x485f96[_0x301d('0x1e')](_0x292c89);}return _0x485f96[_0x301d('0x1f')](_0x292c89)['end']();};}function respondWithResult(_0x1119da,_0x2491b8){_0x2491b8=_0x2491b8||0xc8;return function(_0x10dd5a){if(_0x10dd5a){return _0x1119da[_0x301d('0x1f')](_0x2491b8)[_0x301d('0x20')](_0x10dd5a);}};}function respondWithFilteredResult(_0x28bef6,_0x4fae3d){return function(_0x470b7a){if(_0x470b7a){var _0xb315b6=typeof _0x4fae3d[_0x301d('0x21')]===_0x301d('0x22')&&typeof _0x4fae3d[_0x301d('0x23')]===_0x301d('0x22');var _0x396338=_0x470b7a[_0x301d('0x24')];var _0x5d05db=_0xb315b6?0x0:_0x4fae3d[_0x301d('0x21')];var _0x4feba8=_0xb315b6?_0x470b7a['count']:_0x4fae3d[_0x301d('0x21')]+_0x4fae3d['limit'];var _0x326722;if(_0x4feba8>=_0x396338){_0x4feba8=_0x396338;_0x326722=0xc8;}else{_0x326722=0xce;}_0x28bef6[_0x301d('0x1f')](_0x326722);return _0x28bef6[_0x301d('0x25')](_0x301d('0x26'),_0x5d05db+'-'+_0x4feba8+'/'+_0x396338)[_0x301d('0x20')](_0x470b7a);}return null;};}function saveUpdates(_0x5aaa61){return function(_0xa53d39){if(_0xa53d39){return _0xa53d39[_0x301d('0x27')](_0x5aaa61)[_0x301d('0x13')](function(_0x24b1d5){return _0x24b1d5;});}return null;};}function removeEntity(_0x4a8356){return function(_0x5b4930){if(_0x5b4930){return _0x5b4930['destroy']()['then'](function(){var _0x1cf0bb=_0x5b4930[_0x301d('0x28')]({'plain':!![]});var _0x27c3a1=_0x301d('0x29');return db[_0x301d('0x2a')][_0x301d('0x2b')]({'where':{'type':_0x27c3a1,'resourceId':_0x1cf0bb['id']}})[_0x301d('0x13')](function(){return _0x5b4930;});})[_0x301d('0x13')](function(){_0x4a8356[_0x301d('0x1f')](0xcc)[_0x301d('0x2c')]();});}};}function handleEntityNotFound(_0x4fa080){return function(_0x3032d1){if(!_0x3032d1){_0x4fa080[_0x301d('0x1e')](0x194);}return _0x3032d1;};}function handleError(_0x60949,_0x14aa4a){_0x14aa4a=_0x14aa4a||0x1f4;return function(_0x20b723){logger[_0x301d('0x19')](_0x20b723[_0x301d('0x2d')]);if(_0x20b723[_0x301d('0x2e')]){delete _0x20b723[_0x301d('0x2e')];}_0x60949[_0x301d('0x1f')](_0x14aa4a)['send'](_0x20b723);};}exports['index']=function(_0x42d663,_0x197402){var _0x335800={'include':[{'model':db['Pause'],'as':_0x301d('0x2f')}]},_0x2777a7={},_0x362e53={'count':0x0,'rows':[]};var _0x143a57=_[_0x301d('0x30')](db['ChatWebsite'][_0x301d('0x31')],function(_0x4b5acd){return{'name':_0x4b5acd[_0x301d('0x32')],'type':_0x4b5acd[_0x301d('0x33')][_0x301d('0x34')]};});_0x2777a7[_0x301d('0x35')]=_[_0x301d('0x30')](_0x143a57,_0x301d('0x2e'));_0x2777a7[_0x301d('0x36')]=_[_0x301d('0x37')](_0x42d663['query']);_0x2777a7[_0x301d('0x38')]=_[_0x301d('0x39')](_0x2777a7[_0x301d('0x35')],_0x2777a7[_0x301d('0x36')]);_0x335800[_0x301d('0x3a')]=_['intersection'](_0x2777a7['model'],qs['fields'](_0x42d663[_0x301d('0x36')]['fields']));_0x335800[_0x301d('0x3a')]=_0x335800[_0x301d('0x3a')][_0x301d('0x3b')]?_0x335800[_0x301d('0x3a')]:_0x2777a7[_0x301d('0x35')];if(!_0x42d663['query'][_0x301d('0x3c')]('nolimit')){_0x335800['limit']=qs[_0x301d('0x23')](_0x42d663['query']['limit']);_0x335800[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x42d663[_0x301d('0x36')][_0x301d('0x21')]);}_0x335800[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x42d663['query'][_0x301d('0x3e')]);_0x335800[_0x301d('0x3f')]=qs[_0x301d('0x38')](_[_0x301d('0x40')](_0x42d663[_0x301d('0x36')],_0x2777a7[_0x301d('0x38')]),_0x143a57);if(_0x42d663[_0x301d('0x36')]['filter']){_0x335800[_0x301d('0x3f')]=_['merge'](_0x335800['where'],{'$or':_[_0x301d('0x30')](_0x143a57,function(_0x141062){if(_0x141062['type']!==_0x301d('0x41')){var _0x54436f={};_0x54436f[_0x141062['name']]={'$like':'%'+_0x42d663['query'][_0x301d('0x42')]+'%'};return _0x54436f;}})});}_0x335800=_[_0x301d('0x43')]({},_0x335800,_0x42d663[_0x301d('0x44')]);var _0x4e8072={'where':_0x335800['where']};return db[_0x301d('0x45')][_0x301d('0x24')](_0x4e8072)[_0x301d('0x13')](function(_0x3f4a01){_0x362e53[_0x301d('0x24')]=_0x3f4a01;if(_0x42d663['query'][_0x301d('0x46')]){_0x335800[_0x301d('0x47')]=[{'all':!![]}];}return db[_0x301d('0x45')]['findAll'](_0x335800);})[_0x301d('0x13')](function(_0x331c4b){_0x362e53[_0x301d('0x48')]=_0x331c4b;return _0x362e53;})[_0x301d('0x13')](respondWithFilteredResult(_0x197402,_0x335800))['catch'](handleError(_0x197402,null));};exports[_0x301d('0x49')]=function(_0x587338,_0xe368b8){var _0x5dac87={'raw':![],'where':{'id':_0x587338[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x4b')],'as':_0x301d('0x2f')}]},_0x1e9a22={};_0x1e9a22[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x45')][_0x301d('0x31')]);_0x1e9a22[_0x301d('0x36')]=_['keys'](_0x587338[_0x301d('0x36')]);_0x1e9a22[_0x301d('0x38')]=_[_0x301d('0x39')](_0x1e9a22[_0x301d('0x35')],_0x1e9a22['query']);_0x5dac87[_0x301d('0x3a')]=_['intersection'](_0x1e9a22['model'],qs['fields'](_0x587338[_0x301d('0x36')]['fields']));_0x5dac87['attributes']=_0x5dac87[_0x301d('0x3a')][_0x301d('0x3b')]?_0x5dac87[_0x301d('0x3a')]:_0x1e9a22[_0x301d('0x35')];if(_0x587338[_0x301d('0x36')][_0x301d('0x46')]){_0x5dac87[_0x301d('0x47')]=[{'all':!![]}];}_0x5dac87=_[_0x301d('0x43')]({},_0x5dac87,_0x587338[_0x301d('0x44')]);return db[_0x301d('0x45')][_0x301d('0x4c')](_0x5dac87)[_0x301d('0x13')](handleEntityNotFound(_0xe368b8,null))[_0x301d('0x13')](respondWithResult(_0xe368b8,null))[_0x301d('0x4d')](handleError(_0xe368b8,null));};exports[_0x301d('0x4e')]=function(_0x1aabbc,_0xd17e9b){return db[_0x301d('0x45')]['create'](_0x1aabbc[_0x301d('0x4f')],{})[_0x301d('0x13')](function(_0xa0535f){var _0x3d24fd=_0x1aabbc[_0x301d('0x50')][_0x301d('0x28')]({'plain':!![]});if(!_0x3d24fd)throw new Error(_0x301d('0x51'));if(_0x3d24fd['role']===_0x301d('0x50')){var _0x1f6117=_0xa0535f['get']({'plain':!![]});var _0x29eafe='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x29eafe,'userProfileId':_0x3d24fd[_0x301d('0x52')]},'raw':!![]})[_0x301d('0x13')](function(_0x206a75){if(_0x206a75&&_0x206a75['autoAssociation']===0x0){return db[_0x301d('0x2a')]['create']({'name':_0x1f6117[_0x301d('0x2e')],'resourceId':_0x1f6117['id'],'type':_0x206a75[_0x301d('0x2e')],'sectionId':_0x206a75['id']},{})[_0x301d('0x13')](function(){return _0xa0535f;});}else{return _0xa0535f;}})[_0x301d('0x4d')](function(_0x398419){logger[_0x301d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x398419);throw _0x398419;});}return _0xa0535f;})[_0x301d('0x13')](respondWithResult(_0xd17e9b,0xc9))['catch'](handleError(_0xd17e9b,null));};exports[_0x301d('0x27')]=function(_0x103f75,_0x9b8306){if(_0x103f75['body']['id']){delete _0x103f75['body']['id'];}return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x103f75[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x4b')],'as':'mandatoryDispositionPause'}]})[_0x301d('0x13')](handleEntityNotFound(_0x9b8306,null))[_0x301d('0x13')](saveUpdates(_0x103f75[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x9b8306,null))['catch'](handleError(_0x9b8306,null));};exports[_0x301d('0x2b')]=function(_0x48d5e8,_0x2e19e5){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x48d5e8['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2e19e5,null))[_0x301d('0x13')](removeEntity(_0x2e19e5,null))[_0x301d('0x4d')](handleError(_0x2e19e5,null));};exports[_0x301d('0x53')]=function(_0x5c39f7,_0x46438c){return db[_0x301d('0x45')][_0x301d('0x53')]()[_0x301d('0x13')](respondWithResult(_0x46438c,null))[_0x301d('0x4d')](handleError(_0x46438c,null));};exports[_0x301d('0x54')]=function(_0x4ca952,_0x26b920){if(_0x4ca952[_0x301d('0x4f')]['id']){delete _0x4ca952[_0x301d('0x4f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4ca952['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x26b920,null))[_0x301d('0x13')](function(_0xac7a6d){if(_0xac7a6d){_0x4ca952[_0x301d('0x4f')][_0x301d('0x55')]=_0xac7a6d['id'];return db[_0x301d('0x56')]['create'](_0x4ca952['body']);}})[_0x301d('0x13')](respondWithResult(_0x26b920,null))[_0x301d('0x4d')](handleError(_0x26b920,null));};exports[_0x301d('0x57')]=function(_0x39e9cc,_0x1da4ca){var _0x53ff42={'raw':![],'where':{}};var _0x3822c8={};var _0x4e8423={'count':0x0,'rows':[]};return db[_0x301d('0x45')]['findOne']({'where':{'id':_0x39e9cc[_0x301d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1da4ca,null))[_0x301d('0x13')](function(_0x5dbe3c){if(_0x5dbe3c){_0x3822c8['model']=_[_0x301d('0x37')](db['Disposition'][_0x301d('0x31')]);_0x3822c8[_0x301d('0x36')]=_[_0x301d('0x37')](_0x39e9cc[_0x301d('0x36')]);_0x3822c8[_0x301d('0x38')]=_[_0x301d('0x39')](_0x3822c8['model'],_0x3822c8[_0x301d('0x36')]);_0x53ff42[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x3822c8[_0x301d('0x35')],qs[_0x301d('0x58')](_0x39e9cc[_0x301d('0x36')][_0x301d('0x58')]));_0x53ff42['attributes']=_0x53ff42[_0x301d('0x3a')][_0x301d('0x3b')]?_0x53ff42[_0x301d('0x3a')]:_0x3822c8[_0x301d('0x35')];if(!_0x39e9cc[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x53ff42['limit']=qs[_0x301d('0x23')](_0x39e9cc[_0x301d('0x36')][_0x301d('0x23')]);_0x53ff42[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x39e9cc['query'][_0x301d('0x21')]);}_0x53ff42['order']=qs['sort'](_0x39e9cc[_0x301d('0x36')]['sort']);_0x53ff42[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x39e9cc[_0x301d('0x36')],_0x3822c8[_0x301d('0x38')]));_0x53ff42[_0x301d('0x3f')][_0x301d('0x55')]=_0x5dbe3c['id'];if(_0x39e9cc['query'][_0x301d('0x42')]){_0x53ff42[_0x301d('0x3f')]=_['merge'](_0x53ff42[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x53ff42[_0x301d('0x3a')],function(_0x1a83d5){var _0x136370={};_0x136370[_0x1a83d5]={'$like':'%'+_0x39e9cc[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x136370;})});}_0x53ff42=_['merge']({},_0x53ff42,_0x39e9cc[_0x301d('0x44')]);return db[_0x301d('0x56')]['count']({'where':_0x53ff42[_0x301d('0x3f')]})['then'](function(_0x13222e){_0x4e8423[_0x301d('0x24')]=_0x13222e;if(_0x39e9cc[_0x301d('0x36')]['includeAll']){_0x53ff42[_0x301d('0x47')]=[{'all':!![]}];}return db[_0x301d('0x56')][_0x301d('0x5a')](_0x53ff42);})[_0x301d('0x13')](function(_0x7b0ccb){_0x4e8423[_0x301d('0x48')]=_0x7b0ccb;return _0x4e8423;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x1da4ca,_0x53ff42))[_0x301d('0x4d')](handleError(_0x1da4ca,null));};exports[_0x301d('0x5b')]=function(_0x315226,_0x133cfa){return db[_0x301d('0x45')]['find']({'where':{'id':_0x315226[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x133cfa,null))[_0x301d('0x13')](function(_0x220a49){if(_0x220a49){return _0x220a49[_0x301d('0x5b')](_0x315226[_0x301d('0x36')][_0x301d('0x5c')]);}})[_0x301d('0x13')](respondWithStatusCode(_0x133cfa,null))[_0x301d('0x4d')](handleError(_0x133cfa,null));};exports[_0x301d('0x5d')]=function(_0x517751,_0xb8e07d){if(_0x517751['body']['id']){delete _0x517751[_0x301d('0x4f')]['id'];}return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x517751[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0xb8e07d,null))[_0x301d('0x13')](function(_0x2175ae){if(_0x2175ae){_0x517751[_0x301d('0x4f')][_0x301d('0x55')]=_0x2175ae['id'];return db['CannedAnswer']['create'](_0x517751['body']);}})[_0x301d('0x13')](respondWithResult(_0xb8e07d,null))['catch'](handleError(_0xb8e07d,null));};exports[_0x301d('0x5e')]=function(_0x31377b,_0x3887fe){var _0x25749f={'raw':![],'where':{}};var _0x3ccaf8={};var _0x1fcf00={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x31377b[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x3887fe,null))['then'](function(_0x5e1403){if(_0x5e1403){_0x3ccaf8[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x60')][_0x301d('0x31')]);_0x3ccaf8[_0x301d('0x36')]=_[_0x301d('0x37')](_0x31377b['query']);_0x3ccaf8[_0x301d('0x38')]=_[_0x301d('0x39')](_0x3ccaf8[_0x301d('0x35')],_0x3ccaf8['query']);_0x25749f[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x3ccaf8[_0x301d('0x35')],qs[_0x301d('0x58')](_0x31377b[_0x301d('0x36')][_0x301d('0x58')]));_0x25749f[_0x301d('0x3a')]=_0x25749f['attributes'][_0x301d('0x3b')]?_0x25749f[_0x301d('0x3a')]:_0x3ccaf8['model'];if(!_0x31377b['query']['hasOwnProperty'](_0x301d('0x59'))){_0x25749f[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x31377b[_0x301d('0x36')][_0x301d('0x23')]);_0x25749f[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x31377b[_0x301d('0x36')]['offset']);}_0x25749f[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x31377b[_0x301d('0x36')][_0x301d('0x3e')]);_0x25749f[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x31377b[_0x301d('0x36')],_0x3ccaf8['filters']));_0x25749f[_0x301d('0x3f')][_0x301d('0x55')]=_0x5e1403['id'];if(_0x31377b['query'][_0x301d('0x42')]){_0x25749f[_0x301d('0x3f')]=_['merge'](_0x25749f[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x25749f[_0x301d('0x3a')],function(_0x401cfd){var _0x32f69b={};_0x32f69b[_0x401cfd]={'$like':'%'+_0x31377b[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x32f69b;})});}_0x25749f=_[_0x301d('0x43')]({},_0x25749f,_0x31377b[_0x301d('0x44')]);return db[_0x301d('0x60')][_0x301d('0x24')]({'where':_0x25749f[_0x301d('0x3f')]})['then'](function(_0x438cca){_0x1fcf00[_0x301d('0x24')]=_0x438cca;if(_0x31377b[_0x301d('0x36')]['includeAll']){_0x25749f[_0x301d('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0x301d('0x5a')](_0x25749f);})[_0x301d('0x13')](function(_0x14a3ac){_0x1fcf00['rows']=_0x14a3ac;return _0x1fcf00;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x3887fe,_0x25749f))['catch'](handleError(_0x3887fe,null));};exports['removeAnswers']=function(_0x4de203,_0x5ab5c4){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x4de203[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x5ab5c4,null))[_0x301d('0x13')](function(_0x312478){if(_0x312478){return _0x312478[_0x301d('0x61')](_0x4de203[_0x301d('0x36')][_0x301d('0x5c')]);}})[_0x301d('0x13')](respondWithStatusCode(_0x5ab5c4,null))[_0x301d('0x4d')](handleError(_0x5ab5c4,null));};exports['addLogo']=function(_0x76bb65,_0x27dc8d){_0x76bb65[_0x301d('0x4f')]['sitepic']=_0x76bb65[_0x301d('0x62')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x76bb65[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x27dc8d,null))[_0x301d('0x13')](saveUpdates(_0x76bb65[_0x301d('0x4f')],null))['then'](respondWithResult(_0x27dc8d,null))[_0x301d('0x4d')](handleError(_0x27dc8d,null));};exports[_0x301d('0x63')]=function(_0x12411e,_0x5e5dd1){_0x12411e[_0x301d('0x4f')][_0x301d('0x64')]=_0x12411e[_0x301d('0x62')][_0x301d('0x65')];return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x12411e[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x5e5dd1,null))['then'](saveUpdates(_0x12411e[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x5e5dd1,null))[_0x301d('0x4d')](handleError(_0x5e5dd1,null));};exports[_0x301d('0x66')]=function(_0x13e763,_0x5010f9){_0x13e763[_0x301d('0x4f')][_0x301d('0x67')]=_0x13e763['file'][_0x301d('0x65')];return db[_0x301d('0x45')]['find']({'where':{'id':_0x13e763['params']['id']}})['then'](handleEntityNotFound(_0x5010f9,null))['then'](saveUpdates(_0x13e763[_0x301d('0x4f')],null))['then'](respondWithResult(_0x5010f9,null))[_0x301d('0x4d')](handleError(_0x5010f9,null));};exports[_0x301d('0x68')]=function(_0x5898aa,_0x459129){_0x5898aa[_0x301d('0x4f')][_0x301d('0x69')]=_0x5898aa['file']['filename'];return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x5898aa['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x459129,null))[_0x301d('0x13')](saveUpdates(_0x5898aa[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x459129,null))['catch'](handleError(_0x459129,null));};exports[_0x301d('0x6a')]=function(_0x2735d0,_0x49120f){var _0x1fd44b=path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/logos/default_logo.svg');var _0x184e90={'where':{'id':_0x2735d0[_0x301d('0x4a')]['id']},'attributes':['id',_0x301d('0x6d')],'raw':!![]};var _0x39082d=![];return require(_0x301d('0x6e'))[_0x301d('0x6f')]()[_0x301d('0x13')](function(_0x1350e9){if(_0x1350e9){_0x39082d=_0x1350e9[_0x301d('0x70')];}})[_0x301d('0x13')](function(){return db['ChatWebsite'][_0x301d('0x4c')](_0x184e90);})[_0x301d('0x13')](handleEntityNotFound(_0x49120f,null))['then'](function(_0x5adfb7){if(_0x5adfb7){if(!_[_0x301d('0x71')](_0x5adfb7['sitepic'])){if(fs['existsSync'](path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/logos/',_0x5adfb7[_0x301d('0x6d')]))&&_0x39082d){_0x1fd44b=path['join'](config['root'],_0x301d('0x72'),_0x5adfb7['sitepic']);}}return _0x49120f[_0x301d('0x73')](_0x1fd44b);}})[_0x301d('0x4d')](handleError(_0x49120f,null));};exports['getAvatar']=function(_0xa0485f,_0x467f4f){var _0x2cf40d=path[_0x301d('0x6b')](config['root'],_0x301d('0x74'));var _0x5761ce={'where':{'id':_0xa0485f[_0x301d('0x4a')]['id']},'attributes':['id',_0x301d('0x64')],'raw':!![]};return db[_0x301d('0x45')]['find'](_0x5761ce)[_0x301d('0x13')](handleEntityNotFound(_0x467f4f,null))[_0x301d('0x13')](function(_0x43c643){if(_0x43c643){if(!_['isNil'](_0x43c643['agentAvatar'])){if(fs[_0x301d('0x75')](path[_0x301d('0x6b')](config['root'],_0x301d('0x76'),_0x43c643[_0x301d('0x64')]))){_0x2cf40d=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x76'),_0x43c643['agentAvatar']);}}return _0x467f4f['download'](_0x2cf40d);}})['catch'](handleError(_0x467f4f,null));};exports['getCustomerAvatar']=function(_0x30118b,_0x2677d2){var _0x359138=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x77'));var _0x305ac9={'where':{'id':_0x30118b['params']['id']},'attributes':['id','customerAvatar',_0x301d('0x78')],'raw':!![]};return db[_0x301d('0x45')]['find'](_0x305ac9)[_0x301d('0x13')](handleEntityNotFound(_0x2677d2,null))['then'](function(_0x1fb5a9){if(_0x1fb5a9){if(!_[_0x301d('0x71')](_0x1fb5a9[_0x301d('0x67')])){if(fs[_0x301d('0x75')](path['join'](config[_0x301d('0x6c')],'server/files/images/avatars/',_0x1fb5a9[_0x301d('0x67')]))&&_0x1fb5a9[_0x301d('0x78')]){_0x359138=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x76'),_0x1fb5a9[_0x301d('0x67')]);}}return _0x2677d2['download'](_0x359138);}})[_0x301d('0x4d')](handleError(_0x2677d2,null));};exports['getSystemAvatar']=function(_0x2b81c3,_0x577e43){var _0x43c774=path['join'](config[_0x301d('0x6c')],_0x301d('0x79'));var _0x4d7e36={'where':{'id':_0x2b81c3[_0x301d('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x301d('0x45')][_0x301d('0x4c')](_0x4d7e36)['then'](handleEntityNotFound(_0x577e43,null))[_0x301d('0x13')](function(_0x46d1d5){if(_0x46d1d5){if(!_[_0x301d('0x71')](_0x46d1d5['systemAvatar'])){if(fs['existsSync'](path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/avatars/',_0x46d1d5[_0x301d('0x69')]))){_0x43c774=path[_0x301d('0x6b')](config['root'],_0x301d('0x76'),_0x46d1d5[_0x301d('0x69')]);}}return _0x577e43[_0x301d('0x73')](_0x43c774);}})[_0x301d('0x4d')](handleError(_0x577e43,null));};exports['notify']=function(_0x3fb656,_0x1a5088){var _0x52224=require(_0x301d('0x7a'));var _0xe5fb36=new _0x52224();var _0x453ae3=_0xe5fb36[_0x301d('0x7b')](_0x3fb656[_0x301d('0x7c')]['user-agent'])['getResult']();var _0x3dd836={'body':_0x3fb656['body'],'channel':_0x301d('0x7d')};var _0xe445ba=[];var _0x2fd529=[];var _0x2d7df9={};var _0x29423d=![];return db['CmContact'][_0x301d('0x53')]()[_0x301d('0x13')](function(_0x214d8e){if(!_0x214d8e){throw new db[(_0x301d('0x7e'))]['ValidationError']('no\x20available\x20attributes');}_0xe445ba=_['difference'](_[_0x301d('0x37')](_0x214d8e),[_0x301d('0x7f'),_0x301d('0x80')]);_0x2fd529=_[_0x301d('0x81')](_[_0x301d('0x37')](_0x214d8e),['createdAt',_0x301d('0x80'),_0x301d('0x82'),_0x301d('0x83')]);if(_0x3fb656['body']['id']){delete _0x3fb656[_0x301d('0x4f')]['id'];}if(_[_0x301d('0x71')](_0x3fb656['body'][_0x301d('0x84')])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))]('from\x20is\x20mandatory');}if(_[_0x301d('0x71')](_0x3fb656[_0x301d('0x4f')][_0x301d('0x4f')])||_0x3fb656[_0x301d('0x4f')]['body']===''){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x86'));}if(_['isNil'](_0x3fb656[_0x301d('0x4f')]['mapKey'])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x87')+_0x2fd529);}if(!_[_0x301d('0x88')](_0x2fd529,_0x3fb656[_0x301d('0x4f')]['mapKey'])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x89')+_0x2fd529);}_0x2d7df9[_0x3fb656[_0x301d('0x4f')][_0x301d('0x8a')]]=_0x3fb656[_0x301d('0x4f')][_0x301d('0x84')];})[_0x301d('0x13')](function(){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x3fb656[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x8b')],'as':_0x301d('0x8c'),'include':[{'model':db['CmContact'],'as':_0x301d('0x8d'),'where':_0x2d7df9,'limit':0x1,'order':[[_0x301d('0x80'),_0x301d('0x8e')]]}]},{'model':db[_0x301d('0x8f')],'as':_0x301d('0x90')}]});})['then'](handleEntityNotFound(_0x1a5088,null))['then'](function(_0x312093){if(_0x312093&&_0x312093[_0x301d('0x8c')]){_0x3dd836[_0x301d('0x91')]=_0x312093;_0x3dd836[_0x301d('0x92')]=_0x312093[_0x301d('0x90')];_0x3dd836['list']=_0x312093[_0x301d('0x8c')];_0x3dd836[_0x301d('0x92')]=_[_0x301d('0x93')](_0x3dd836[_0x301d('0x92')],[_0x301d('0x94')],[_0x301d('0x95')]);if(_0x3dd836[_0x301d('0x91')][_0x301d('0x90')]){delete _0x3dd836[_0x301d('0x91')][_0x301d('0x90')];}if(_0x3dd836[_0x301d('0x91')][_0x301d('0x8c')]&&_0x3dd836[_0x301d('0x91')][_0x301d('0x8c')][_0x301d('0x8d')][_0x301d('0x3b')]){return _0x3dd836['account'][_0x301d('0x8c')][_0x301d('0x8d')][0x0];}var _0x36b4bd=_[_0x301d('0xb')](_0x3fb656[_0x301d('0x4f')],{'firstName':_0x3fb656['body'][_0x301d('0x84')],'ListId':_0x312093[_0x301d('0x83')]});_0x36b4bd[_0x3fb656[_0x301d('0x4f')]['mapKey']]=_0x3fb656['body'][_0x301d('0x84')];return db[_0x301d('0x96')]['create'](_0x36b4bd,{'fields':_0xe445ba,'raw':!![]});}})[_0x301d('0x13')](handleEntityNotFound(_0x1a5088,null))[_0x301d('0x13')](function(_0xa6f5dc){_0x3dd836[_0x301d('0x97')]=_0xa6f5dc;var _0x9f089b=_0x3fb656['body'][_0x301d('0x98')];if(_0x3fb656[_0x301d('0x7c')]['cf-connecting-ip']){_0x9f089b=_0x3fb656[_0x301d('0x7c')]['cf-connecting-ip'];}else if(_0x3fb656[_0x301d('0x7c')]['x-forwarded-for']){_0x9f089b=_[_0x301d('0x99')](_0x3fb656['headers'][_0x301d('0x9a')][_0x301d('0x9b')](','));}if(_0xa6f5dc){var _0xb5f2f0={'ContactId':_0xa6f5dc['id'],'ChatWebsiteId':_0x3fb656[_0x301d('0x4a')]['id'],'from':(_0xa6f5dc[_0x301d('0x9c')]||'')+'\x20'+(_0xa6f5dc[_0x301d('0x9d')]||''),'customerIp':_0x9f089b,'customerPort':_0x3fb656[_0x301d('0x7c')][_0x301d('0x9e')]?_0x3fb656[_0x301d('0x7c')]['x-real-port']:null,'referer':_0x3fb656[_0x301d('0x4f')][_0x301d('0x9f')],'browserName':_0x453ae3[_0x301d('0xa0')][_0x301d('0x2e')]&&_0x453ae3[_0x301d('0xa0')]['version']?util[_0x301d('0xa1')](_0x301d('0xa2'),_0x453ae3[_0x301d('0xa0')]['name'],_0x453ae3[_0x301d('0xa0')]['version']):_0x301d('0xa3'),'browserVersion':_0x453ae3[_0x301d('0xa0')][_0x301d('0xa4')]||_0x301d('0xa3'),'osName':util['format']('%s\x20%s',_0x453ae3['os'][_0x301d('0x2e')],_0x453ae3['os']['version']),'osVersion':_0x453ae3['os']['version'],'deviceModel':_0x453ae3[_0x301d('0xa5')][_0x301d('0x35')]&&_0x453ae3[_0x301d('0xa5')][_0x301d('0xa6')]?util[_0x301d('0xa1')]('%s\x20%s\x20%s',_0x453ae3['device'][_0x301d('0x35')],_0x453ae3['device'][_0x301d('0xa6')],_0x453ae3['device'][_0x301d('0x33')]):null,'deviceVendor':_0x453ae3['device']['vendor'],'deviceType':_0x453ae3[_0x301d('0xa5')][_0x301d('0x33')],'formData':JSON[_0x301d('0x18')](_0x3fb656[_0x301d('0x4f')])};var _0x1274d0={'ChatWebsiteId':_0x3fb656['params']['id'],'closed':![]};if(_0x3fb656[_0x301d('0x4f')][_0x301d('0xa7')]){_0x1274d0[_0x301d('0xa7')]=_0x3fb656[_0x301d('0x4f')][_0x301d('0xa7')];return db['ChatInteraction'][_0x301d('0x4c')]({'where':_0x1274d0})[_0x301d('0x13')](function(_0xd8f0b8){if(_0xd8f0b8){return[_0xd8f0b8,![]];}_0xb5f2f0[_0x301d('0xa7')]=_0x3fb656['body'][_0x301d('0xa7')];_0xb5f2f0[_0x301d('0xa8')]=_0x3fb656[_0x301d('0x4f')][_0x301d('0xa8')];return db[_0x301d('0xa9')][_0x301d('0x4e')](_0xb5f2f0)[_0x301d('0x13')](function(_0x3aa82f){return[_0x3aa82f,!![]];});});}_0x1274d0[_0x301d('0xaa')]=_0xa6f5dc['id'];if(_0x3fb656[_0x301d('0x4f')][_0x301d('0xab')]&&_0x3fb656['body'][_0x301d('0xab')]['id']){_0x1274d0['id']=_0x3fb656[_0x301d('0x4f')][_0x301d('0xab')]['id'];return db['ChatInteraction'][_0x301d('0x4c')]({'where':_0x1274d0})[_0x301d('0x13')](function(_0x18a18a){if(_0x18a18a){return[_0x18a18a,![]];}return db[_0x301d('0xa9')]['create'](_0xb5f2f0)['then'](function(_0x1f81b2){return[_0x1f81b2,!![]];});});}return db[_0x301d('0xa9')][_0x301d('0x4e')](_0xb5f2f0)['then'](function(_0x56befc){return[_0x56befc,!![]];});}})[_0x301d('0xac')](function(_0x71c2a8,_0x18221a){if(_0x71c2a8){_0x29423d=_0x18221a;if(!_0x18221a){var _0x4f6b0a={'from':(_0x3dd836['contact']['firstName']||'')+'\x20'+(_0x3dd836[_0x301d('0x97')]['lastName']||'')};if(_0x3fb656['body'][_0x301d('0xa7')]&&_0x3fb656[_0x301d('0x4f')][_0x301d('0xad')]&&_0x3fb656['body']['threadId']!=_0x3fb656[_0x301d('0x4f')][_0x301d('0xad')]){_0x4f6b0a[_0x301d('0xa7')]=_0x3fb656['body'][_0x301d('0xad')];}return _0x71c2a8[_0x301d('0x27')](_0x4f6b0a);}else{return _0x71c2a8;}}})[_0x301d('0x13')](function(_0x3d7cb7){_0x3dd836[_0x301d('0xab')]=_0x3d7cb7[_0x301d('0x28')]({'plain':!![]});_0x3dd836['interaction'][_0x301d('0xae')]=_0x29423d;if(_0x3dd836[_0x301d('0xab')][_0x301d('0xae')]){if(_0x3dd836['account'][_0x301d('0xaf')]){_0x3dd836[_0x301d('0x92')][_0x301d('0xb0')]({'id':0x0,'priority':_0x3dd836[_0x301d('0x92')]['length']+0x1,'app':'close','appdata':_0x301d('0xb1'),'interval':_0x301d('0xb2')});}}return db[_0x301d('0xb3')]['create']({'body':_0x3fb656[_0x301d('0x4f')][_0x301d('0x4f')],'ChatWebsiteId':_0x3fb656[_0x301d('0x4a')]['id'],'ChatInteractionId':_0x3d7cb7['id'],'direction':'in','ContactId':_0x3dd836[_0x301d('0x97')]['id'],'AttachmentId':_0x3fb656[_0x301d('0x4f')][_0x301d('0xb4')]});})['then'](function(_0x24f27d){_0x3dd836[_0x301d('0x1b')]=_0x24f27d;if(_0x3dd836['interaction'][_0x301d('0xb5')]){return db['User'][_0x301d('0x4c')]({'attributes':['id','name'],'where':{'id':_0x3dd836[_0x301d('0xab')][_0x301d('0xb5')]}})[_0x301d('0x13')](function(_0x38298b){if(_0x38298b){_0x3dd836[_0x301d('0x92')][_0x301d('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x38298b[_0x301d('0x2e')]+','+(_0x3dd836[_0x301d('0x91')][_0x301d('0xb7')]||0xa),'interval':'*,*,*,*'});_0x3dd836[_0x301d('0xb8')]=!![];}return respondWithRpcPromise(_0x301d('0xb9'),_0x301d('0xba'),_0x3dd836);});}return respondWithRpcPromise(_0x301d('0xb9'),_0x301d('0xba'),_0x3dd836);})[_0x301d('0x13')](function(_0x21db96){respondWithRpcPromise(_0x301d('0xbb'),_0x301d('0xbb'),{'event':_0x301d('0xbc'),'message':_0x21db96},client9002);return _0x21db96;})[_0x301d('0x13')](respondWithResult(_0x1a5088,null))[_0x301d('0x4d')](handleError(_0x1a5088,null));};exports[_0x301d('0xbd')]=function(_0x247516,_0xa43c31){var _0x1bcf6f,_0xa4bd83,_0x24145f;var _0x1f1958=[];var _0xc0e836={};var _0x3eeaed=_0x247516[_0x301d('0xbe')]||[];var _0xbacdbb=[];var _0x258019;return db[_0x301d('0x96')]['describe']()[_0x301d('0x13')](function(_0x1c9a68){if(!_0x1c9a68){throw new db['Sequelize'][(_0x301d('0x85'))]('no\x20available\x20attributes');}_0x1f1958=_[_0x301d('0x81')](_[_0x301d('0x37')](_0x1c9a68),[_0x301d('0x7f'),'updatedAt',_0x301d('0x82'),_0x301d('0x83')]);if(_0x247516[_0x301d('0x4f')]['id']){delete _0x247516['body']['id'];}if(_['isNil'](_0x247516[_0x301d('0x4f')]['from'])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)[_0x301d('0xbf')](new db['Sequelize'][(_0x301d('0x85'))]('from\x20is\x20mandatory'));}if(_[_0x301d('0x71')](_0x247516[_0x301d('0x4f')][_0x301d('0x4f')])||_0x247516[_0x301d('0x4f')][_0x301d('0x4f')]===''){throw _0xa43c31[_0x301d('0x1f')](0x1f4)['send'](new db[(_0x301d('0x7e'))]['ValidationError'](_0x301d('0x86')));}if(_[_0x301d('0x71')](_0x247516[_0x301d('0x4f')]['mapKeyOffline'])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)['send'](new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0xc0')+_0x1f1958));}if(!_[_0x301d('0x88')](_0x1f1958,_0x247516[_0x301d('0x4f')][_0x301d('0xc1')])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)[_0x301d('0xbf')](new db['Sequelize']['ValidationError'](_0x301d('0xc2')+_0x1f1958));}_0xc0e836[_0x247516['body']['mapKeyOffline']]=_0x247516[_0x301d('0x4f')][_0x301d('0x84')];})[_0x301d('0x13')](function(){return db[_0x301d('0x45')]['find']({'where':{'id':_0x247516[_0x301d('0x4a')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x301d('0xc3')}]});})['then'](handleEntityNotFound(_0xa43c31,null))[_0x301d('0x13')](function(_0x1718de){if(_0x1718de&&_0x1718de[_0x301d('0x8c')]){_0xa4bd83=_0x1718de;var _0x5db850=_[_0x301d('0xb')](_0x247516[_0x301d('0x4f')],{'firstName':_0x247516[_0x301d('0x4f')][_0x301d('0x84')],'phone':_0x247516[_0x301d('0x4f')]['from'],'ListId':_0x1718de[_0x301d('0x83')]});_0x5db850[_0x247516[_0x301d('0x4f')][_0x301d('0xc1')]]=_0x247516[_0x301d('0x4f')][_0x301d('0x84')];return db[_0x301d('0x96')]['findOrCreate']({'where':_0xc0e836,'defaults':_0x5db850});}})['spread'](function(_0x2f0426){if(_0x2f0426){_0x24145f=_0x2f0426;var _0x101a0d=fs[_0x301d('0xc4')](path[_0x301d('0x6b')](config['root'],_0x301d('0xc5')),_0x301d('0xc6'));var _0x54eafe=ejs[_0x301d('0xc7')](_0x101a0d,{'body':_['toPairs'](_0x247516['body'][_0x301d('0x4f')]),'bodyTitle':_0xa4bd83[_0x301d('0xc8')]});return db['ChatOfflineMessage']['create']({'body':_0x54eafe,'ContactId':_0x2f0426['id'],'ChatWebsiteId':_0xa4bd83['id']});}})[_0x301d('0x13')](function(_0x49d40f){_0x258019=_0x49d40f;if(_0x3eeaed[_0x301d('0x3b')]){var _0x216778=_0x3eeaed[_0x301d('0x30')](function(_0x38e7db){return{'name':_0x38e7db[_0x301d('0xc9')],'basename':_0x38e7db[_0x301d('0x65')],'type':_0x38e7db['mimetype'],'ChatOfflineMessageId':_0x49d40f['id']};});_0xbacdbb=_0x216778[_0x301d('0x30')](_0x33cb22=>{var _0x5ee26f={'filename':_0x33cb22[_0x301d('0x2e')],'path':path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server','files','attachments',_0x301d('0xca'),_0x33cb22['basename'])};return _0x5ee26f;});if(!_0xa4bd83[_0x301d('0xcb')]){return db[_0x301d('0xcc')][_0x301d('0xcd')](function(_0x2c160f){return db[_0x301d('0xce')][_0x301d('0xcf')](_0x216778,{'transaction':_0x2c160f});});}}})[_0x301d('0x13')](function(){if(_0x258019){_0x1bcf6f=_0x258019;return db[_0x301d('0xc3')][_0x301d('0x5f')]({'where':{'active':!![]},'include':[{'model':db[_0x301d('0xd0')],'as':_0x301d('0xd1'),'raw':!![]}]});}})[_0x301d('0x13')](function(_0x13a4b0){if(_0x13a4b0&&_0x13a4b0['Smtp']&&_0xa4bd83['forwardOffline']&&_0xa4bd83[_0x301d('0xd2')]){var _0x56862b={'tls':{'rejectUnauthorized':![]}};if(_0x13a4b0['Smtp']['service']){_0x56862b['service']=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd3')];}else{_0x56862b['host']=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd4')];_0x56862b[_0x301d('0xd5')]=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd5')];_0x56862b[_0x301d('0xd6')]=_0x13a4b0['Smtp']['secure'];}if(_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd7')]){_0x56862b[_0x301d('0xd8')]={'user':_0x13a4b0[_0x301d('0xd1')]['user'],'pass':_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd9')]};}return respondWithRpcPromise('SendMail',_0x301d('0xda'),{'account':_0x56862b,'message':{'from':util['format'](_0x301d('0xdb'),_0x13a4b0[_0x301d('0x2e')],_0x13a4b0[_0x301d('0xdc')]||_0x13a4b0[_0x301d('0xd1')][_0x301d('0x50')]),'to':_0xa4bd83[_0x301d('0xd2')],'subject':_0xa4bd83[_0x301d('0xdd')],'html':_0x1bcf6f['body'],'attachments':_0xbacdbb}},client9003)['then'](function(){return _0x1bcf6f;})[_0x301d('0x4d')](function(_0x2d6bc2){console[_0x301d('0x19')](_0x2d6bc2);});}})['then'](function(){if(_0xa4bd83&&_0xa4bd83[_0x301d('0xcb')]&&_0xa4bd83[_0x301d('0xde')]){var _0xae4f07=[];if(_0x3eeaed[_0x301d('0x3b')]){_0xae4f07=_0x3eeaed[_0x301d('0x30')](function(_0x562b3e){return{'name':_0x562b3e[_0x301d('0xc9')],'basename':_0x562b3e[_0x301d('0x65')],'type':_0x562b3e[_0x301d('0xdf')],'ChatOfflineMessageId':_0x258019['id']};});}var _0x3386d3;if(!_[_0x301d('0x71')](_0xa4bd83[_0x301d('0xe0')])){var _0x482b3d=_[_0x301d('0x30')](_0x247516[_0x301d('0x4f')],function(_0x17f2ae){return _0x17f2ae;});var _0x2649d1=_[_0x301d('0xe1')](_0x482b3d)[0x0];var _0x516a9c=_[_0x301d('0xe2')](_0x2649d1,function(_0x25b9b5){return _0x25b9b5;});_0x3386d3=_0x516a9c[0x1][_0xa4bd83[_0x301d('0xe0')]];}var _0x211e1e={'from':_0x24145f['email'],'firstName':_0x24145f[_0x301d('0x9c')],'lastName':_0x24145f[_0x301d('0x9d')],'mapKey':_0x301d('0xdc'),'message':{'from':_0x24145f[_0x301d('0xdc')],'to':_0xa4bd83[_0x301d('0xc3')]['email'],'cc':'','subject':_[_0x301d('0x71')](_0x3386d3)?_0xa4bd83[_0x301d('0xdd')]:_0x3386d3,'messageId':'','sentAt':new Date(),'attach':_0xae4f07[_0x301d('0x3b')],'attachments':_0xae4f07,'originChannel':_0x301d('0xe3'),'ChatWebsiteId':_0xa4bd83['id'],'ChatOfflineMessageId':_0x1bcf6f['id'],'originTo':_0xa4bd83[_0x301d('0xc3')][_0x301d('0xdc')]},'body':_0x1bcf6f[_0x301d('0x4f')]};var _0x243bc9={'account':{'id':_0xa4bd83['MailAccountId']},'body':_0x211e1e,'log':_0x301d('0xe4')};return respondWithRpcPromise(_0x301d('0xe4'),_0x301d('0xe5'),_0x243bc9,client9001)['then'](function(){return _0x1bcf6f;})[_0x301d('0x4d')](function(_0x215581){console['error'](_0x215581);});}return;})[_0x301d('0x13')](function(){if(_0x1bcf6f){return _0x1bcf6f;}})[_0x301d('0x13')](respondWithResult(_0xa43c31,null))[_0x301d('0x4d')](function(_0x1151e7){console['error']('catch',_0x1151e7);for(var _0x33322e of _0x3eeaed){var _0x8ae128=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0xe6'),'files',_0x301d('0xe7'),_0x301d('0xca'),_0x33322e[_0x301d('0x65')]);fs_extra[_0x301d('0xe8')](_0x8ae128)[_0x301d('0x4d')](function(_0x326fe0){console[_0x301d('0x19')](_0x301d('0xe9'),_0x8ae128,_0x326fe0);});}});};exports[_0x301d('0xea')]=function(_0x420654,_0x4a0d0d){return db[_0x301d('0xa9')][_0x301d('0x4c')]({'where':{'id':_0x420654[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x4a0d0d,null))['then'](function(_0x4e670f){if(_0x4e670f){return _0x4e670f[_0x301d('0xea')](_0x420654[_0x301d('0x4f')]['ids'],_[_0x301d('0xeb')](_0x420654['body'],[_0x301d('0x5c'),'id'])||{});}})[_0x301d('0x13')](respondWithResult(_0x4a0d0d,null))[_0x301d('0x4d')](handleError(_0x4a0d0d,null));};exports[_0x301d('0xec')]=function(_0x68670c,_0x1a000e){var _0x379b5d={'raw':![],'where':{}};var _0x311881={};var _0x293c1d={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x68670c[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x1a000e,null))[_0x301d('0x13')](function(_0x460e2f){if(_0x460e2f){_0x311881[_0x301d('0x35')]=_['keys'](db[_0x301d('0xa9')][_0x301d('0x31')]);_0x311881[_0x301d('0x36')]=_[_0x301d('0x37')](_0x68670c['query']);_0x311881[_0x301d('0x38')]=_[_0x301d('0x39')](_0x311881[_0x301d('0x35')],_0x311881['query']);_0x379b5d['attributes']=_[_0x301d('0x39')](_0x311881['model'],qs[_0x301d('0x58')](_0x68670c[_0x301d('0x36')][_0x301d('0x58')]));_0x379b5d['attributes']=_0x379b5d[_0x301d('0x3a')][_0x301d('0x3b')]?_0x379b5d[_0x301d('0x3a')]:_0x311881[_0x301d('0x35')];if(!_0x68670c['query'][_0x301d('0x3c')](_0x301d('0x59'))){_0x379b5d[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x68670c[_0x301d('0x36')][_0x301d('0x23')]);_0x379b5d[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x68670c['query'][_0x301d('0x21')]);}_0x379b5d[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x68670c[_0x301d('0x36')][_0x301d('0x3e')]);_0x379b5d[_0x301d('0x3f')]=qs['filters'](_[_0x301d('0x40')](_0x68670c[_0x301d('0x36')],_0x311881['filters']));_0x379b5d[_0x301d('0x3f')]['ChatWebsiteId']=_0x460e2f['id'];if(_0x68670c[_0x301d('0x36')][_0x301d('0x42')]){_0x379b5d[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x379b5d[_0x301d('0x3f')],{'$or':_['map'](_0x379b5d['attributes'],function(_0x58f8b4){var _0x223d85={};_0x223d85[_0x58f8b4]={'$like':'%'+_0x68670c[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x223d85;})});}_0x379b5d=_[_0x301d('0x43')]({},_0x379b5d,_0x68670c[_0x301d('0x44')]);return db['ChatInteraction']['count']({'where':_0x379b5d[_0x301d('0x3f')]})['then'](function(_0x56b3bc){_0x293c1d[_0x301d('0x24')]=_0x56b3bc;if(_0x68670c[_0x301d('0x36')][_0x301d('0x46')]){_0x379b5d[_0x301d('0x47')]=[{'model':db['CmContact'],'as':_0x301d('0xed'),'required':![]},{'model':db[_0x301d('0xee')],'as':_0x301d('0xef'),'attributes':[_0x301d('0x2e'),_0x301d('0xf0'),_0x301d('0xf1')],'required':![]},{'model':db[_0x301d('0xf2')],'as':_0x301d('0xf3'),'attributes':['id','name',_0x301d('0xf4')],'where':_0x68670c[_0x301d('0x36')][_0x301d('0xf5')]?{'id':_0x68670c['query']['tag']}:undefined,'required':_0x68670c[_0x301d('0x36')][_0x301d('0xf5')]?!![]:![]}];}return db[_0x301d('0xa9')][_0x301d('0x5a')](_0x379b5d);})[_0x301d('0x13')](function(_0x42bbee){_0x293c1d[_0x301d('0x48')]=_0x42bbee;return _0x293c1d;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x1a000e,_0x379b5d))['catch'](handleError(_0x1a000e,null));};function iftimePromise(_0x2ccabe,_0x3424ff){return respondWithRpcPromise(_0x301d('0xf6'),'getSnippet',{'command':_0x3424ff[_0x301d('0xf7')]?util[_0x301d('0xa1')](_0x301d('0xf8'),_0x2ccabe[_0x301d('0xf9')],_0x3424ff[_0x301d('0xf7')]):util[_0x301d('0xa1')](_0x301d('0xfa'),_0x2ccabe[_0x301d('0xf9')])},client9002)[_0x301d('0x13')](function(_0x218748){var _0x41fb53=_0x218748&&_0x218748[_0x301d('0xfb')](_0x301d('0xfc'))>=0x0?!![]:![];logger[_0x301d('0x14')](_0x301d('0xfd'),_0x3424ff['id'],_0x2ccabe['id'],_0x2ccabe[_0x301d('0xf9')],_0x41fb53?_0x301d('0xfe'):_0x301d('0xff'),_0x3424ff[_0x301d('0xf7')]?_0x3424ff[_0x301d('0xf7')]:_0x301d('0x100'));return _0x41fb53;})['catch'](function(_0x3cdc0c){logger['error'](_0x301d('0xfd'),_0x3424ff['id'],_0x2ccabe['id'],_0x2ccabe[_0x301d('0xf9')],util[_0x301d('0x101')](_0x3cdc0c,{'showHidden':![],'depth':null}),_0x3424ff[_0x301d('0xf7')]?_0x3424ff['timezone']:_0x301d('0x100'));return![];});}exports[_0x301d('0x102')]=function(_0x5c46c9,_0x3f1432){var _0x31d2f4=0x0;var _0x3af862=0x0;var _0x3858f7=![];var _0x57bf9c;var _0x360424;return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x5c46c9[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x103')],'as':_0x301d('0x103'),'include':[{'model':db[_0x301d('0x103')],'as':_0x301d('0x104'),'attributes':['id',_0x301d('0xf9')],'raw':!![]}]}]})[_0x301d('0x13')](handleEntityNotFound(_0x3f1432,null))[_0x301d('0x13')](function(_0x32426f){if(_0x32426f){_0x57bf9c=_0x32426f;return _0x32426f[_0x301d('0x105')]({'raw':!![]});}})[_0x301d('0x13')](function(_0x1ace00){if(_0x57bf9c){if(_0x1ace00){_0x360424=_0x1ace00;}}return require(_0x301d('0x6e'))[_0x301d('0x6f')]();})[_0x301d('0x13')](function(_0x43d462){if(_0x43d462){_0x3af862=_0x43d462[_0x301d('0x106')];_0x3858f7=_0x43d462[_0x301d('0x70')];}})['then'](function(){return db['ChatInteraction'][_0x301d('0x24')]({'where':{'closed':![]}});})['then'](function(_0x239b96){_0x31d2f4=_0x239b96;if(_0x3af862&&_0x239b96>_0x3af862){return db[_0x301d('0x107')][_0x301d('0x5f')]({'where':{'id':0x1}})['then'](function(_0x499bee){if(_0x499bee){_0x499bee[_0x301d('0x108')](_0x301d('0x109'));}});}})[_0x301d('0x13')](function(){if(_0x57bf9c[_0x301d('0x103')]&&_0x57bf9c['Interval'][_0x301d('0x104')]){var _0x409d2d=[];for(var _0x310ddd=0x0;_0x310ddd<_0x57bf9c[_0x301d('0x103')][_0x301d('0x104')][_0x301d('0x3b')];_0x310ddd++){var _0x33e311=_0x57bf9c[_0x301d('0x103')]['Intervals'][_0x310ddd][_0x301d('0x28')]({'plain':!![]});_0x409d2d[_0x301d('0xb0')](iftimePromise(_0x33e311,_0x57bf9c));}return BPromise[_0x301d('0x10a')](_0x409d2d)['then'](function(_0x613882){return _[_0x301d('0x10b')](_0x613882);});}else{return!![];}})[_0x301d('0x13')](function(_0x147b5a){var _0x11acea=fs[_0x301d('0xc4')](path['join'](config[_0x301d('0x6c')],'server/files/chat/iframe.ejs'),_0x301d('0xc6'));var _0x1b121b={'remote':_0x57bf9c[_0x301d('0x10c')],'query':querystring[_0x301d('0x18')](_['merge'](_0x57bf9c['get']({'plain':!![]}),{'customerIp':_0x5c46c9[_0x301d('0x7c')][_0x301d('0x9a')]||_0x5c46c9[_0x301d('0x7c')][_0x301d('0x10d')]||_0x5c46c9[_0x301d('0x10e')][_0x301d('0x10f')]||_0x5c46c9['ip'],'referer':_0x5c46c9[_0x301d('0x7c')][_0x301d('0x9f')],'openedInteractions':_0x31d2f4,'maxInteractions':_0x3af862,'virtual':_0x3858f7[_0x301d('0x106')],'online':_0x147b5a,'custom':_0x3858f7}))[_0x301d('0x110')](/'/g,'\x5c\x27')};_0x3f1432[_0x301d('0xbf')](ejs['render'](Mustache[_0x301d('0xc7')](_0x11acea,_0x1b121b),{'proactiveActions':_0x360424,'alignment':_0x57bf9c[_0x301d('0x111')],'verticalAlignment':_0x57bf9c[_0x301d('0x112')],'div_color':_0x57bf9c['color'],'labelText':_0x57bf9c[_0x301d('0x113')],'text_color':_0x57bf9c[_0x301d('0x114')],'button_color':_0x57bf9c[_0x301d('0x115')],'background_color':_0x57bf9c[_0x301d('0x116')]}));})[_0x301d('0x4d')](handleError(_0x3f1432,null));};exports['addApplications']=function(_0x875ed2,_0x3fe2cb){var _0xb7908d=_0x875ed2[_0x301d('0x4a')]['id'];var _0x322560=_0x875ed2[_0x301d('0x4f')];var _0x246b7b=0xc8;var _0x3149df=null;return db[_0x301d('0xcc')]['transaction']({'isolationLevel':db[_0x301d('0xcc')][_0x301d('0x117')]['ISOLATION_LEVELS'][_0x301d('0x118')]},function(_0x314319){return db[_0x301d('0x45')]['findOne']({'where':{'id':_0xb7908d},'transaction':_0x314319})[_0x301d('0x13')](function(_0x2dd5d3){if(_0x2dd5d3){return db[_0x301d('0x8f')][_0x301d('0x2b')]({'where':{'ChatWebsiteId':_0xb7908d},'transaction':_0x314319})[_0x301d('0x13')](function(){var _0x433a70=_[_0x301d('0x30')](_0x322560,function(_0x82cf1f){_0x82cf1f[_0x301d('0x55')]=_0xb7908d;return _0x82cf1f;});return db[_0x301d('0x8f')][_0x301d('0xcf')](_0x433a70,{'transaction':_0x314319});});}else{_0x246b7b=0x194;_0x3149df=[];}});})[_0x301d('0x13')](function(){if(_0x246b7b!==0x194){return db[_0x301d('0x8f')][_0x301d('0x119')]({'where':{'ChatWebsiteId':_0xb7908d},'order':_0x301d('0x94')})[_0x301d('0x13')](function(_0x3ce571){_0x3149df=_0x3ce571;});}})[_0x301d('0x4d')](function(_0x3ff569){_0x246b7b=0x1f4;logger[_0x301d('0x19')](_0x3ff569['stack']);if(_0x3ff569['name']){delete _0x3ff569['name'];}_0x3149df=_0x3ff569;})['finally'](function(){if(_0x3149df===null){_0x3fe2cb[_0x301d('0x1e')](_0x246b7b);}else{if(_0x246b7b===0x1f4){_0x3fe2cb[_0x301d('0x1f')](_0x246b7b)[_0x301d('0xbf')](_0x3149df);}else{_0x3fe2cb[_0x301d('0x1f')](_0x246b7b)[_0x301d('0x20')](_0x3149df);}}});};exports[_0x301d('0x11a')]=function(_0x5aaa2c,_0x406475){var _0x5048be={};var _0x80a996={};var _0x46c892;var _0x20b02b;return db[_0x301d('0x45')]['findOne']({'where':{'id':_0x5aaa2c[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x406475,null))[_0x301d('0x13')](function(_0x13955e){if(_0x13955e){_0x46c892=_0x13955e;_0x80a996['model']=_[_0x301d('0x37')](db['ChatApplication'][_0x301d('0x31')]);_0x80a996['query']=_[_0x301d('0x37')](_0x5aaa2c['query']);_0x80a996['filters']=_[_0x301d('0x39')](_0x80a996[_0x301d('0x35')],_0x80a996[_0x301d('0x36')]);_0x5048be['attributes']=_[_0x301d('0x39')](_0x80a996[_0x301d('0x35')],qs['fields'](_0x5aaa2c['query'][_0x301d('0x58')]));_0x5048be[_0x301d('0x3a')]=_0x5048be[_0x301d('0x3a')][_0x301d('0x3b')]?_0x5048be['attributes']:_0x80a996[_0x301d('0x35')];_0x5048be[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x3e')]);_0x5048be[_0x301d('0x3f')]=qs[_0x301d('0x38')](_[_0x301d('0x40')](_0x5aaa2c[_0x301d('0x36')],_0x80a996['filters']));if(_0x5aaa2c[_0x301d('0x36')][_0x301d('0x42')]){_0x5048be[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x5048be[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x5048be[_0x301d('0x3a')],function(_0x842929){var _0x3d00f1={};_0x3d00f1[_0x842929]={'$like':'%'+_0x5aaa2c[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x3d00f1;})});}_0x5048be=_[_0x301d('0x43')]({},_0x5048be,_0x5aaa2c[_0x301d('0x44')]);return _0x46c892[_0x301d('0x11a')](_0x5048be);}})[_0x301d('0x13')](function(_0x4cc5e9){if(_0x4cc5e9){_0x20b02b=_0x4cc5e9[_0x301d('0x3b')];if(!_0x5aaa2c['query'][_0x301d('0x3c')](_0x301d('0x59'))){_0x5048be[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x23')]);_0x5048be[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x21')]);}return _0x46c892[_0x301d('0x11a')](_0x5048be);}})[_0x301d('0x13')](function(_0x131e79){if(_0x131e79){return _0x131e79?{'count':_0x20b02b,'rows':_0x131e79}:null;}})[_0x301d('0x13')](respondWithResult(_0x406475,null))[_0x301d('0x4d')](handleError(_0x406475,null));};exports['addProactiveActions']=function(_0x80dae1,_0x2a135e){return db['chatProactiveAction'][_0x301d('0x4c')]({'where':{'id':_0x80dae1[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2a135e,null))[_0x301d('0x13')](function(_0x4bca96){if(_0x4bca96){return _0x4bca96[_0x301d('0x11b')](_0x80dae1[_0x301d('0x4f')][_0x301d('0x5c')],_[_0x301d('0xeb')](_0x80dae1['body'],['ids','id'])||{});}})[_0x301d('0x13')](respondWithResult(_0x2a135e,null))[_0x301d('0x4d')](handleError(_0x2a135e,null));};exports[_0x301d('0x105')]=function(_0x950ee,_0x2a3af7){var _0x54d7d7={};var _0x134691={};var _0x148463;var _0x543225;return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x950ee[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2a3af7,null))['then'](function(_0x4408c0){if(_0x4408c0){_0x148463=_0x4408c0;_0x134691[_0x301d('0x35')]=_[_0x301d('0x37')](db['ChatProactiveAction'][_0x301d('0x31')]);_0x134691[_0x301d('0x36')]=_[_0x301d('0x37')](_0x950ee[_0x301d('0x36')]);_0x134691[_0x301d('0x38')]=_[_0x301d('0x39')](_0x134691['model'],_0x134691[_0x301d('0x36')]);_0x54d7d7[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x134691[_0x301d('0x35')],qs[_0x301d('0x58')](_0x950ee[_0x301d('0x36')]['fields']));_0x54d7d7[_0x301d('0x3a')]=_0x54d7d7[_0x301d('0x3a')][_0x301d('0x3b')]?_0x54d7d7[_0x301d('0x3a')]:_0x134691['model'];_0x54d7d7[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x950ee[_0x301d('0x36')][_0x301d('0x3e')]);_0x54d7d7['where']=qs['filters'](_[_0x301d('0x40')](_0x950ee[_0x301d('0x36')],_0x134691[_0x301d('0x38')]));if(_0x950ee[_0x301d('0x36')][_0x301d('0x42')]){_0x54d7d7[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x54d7d7[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x54d7d7[_0x301d('0x3a')],function(_0x3c1189){var _0x3a95aa={};_0x3a95aa[_0x3c1189]={'$like':'%'+_0x950ee[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x3a95aa;})});}_0x54d7d7=_['merge']({},_0x54d7d7,_0x950ee['options']);return _0x148463['getProactiveActions'](_0x54d7d7);}})['then'](function(_0x199ab1){if(_0x199ab1){_0x543225=_0x199ab1[_0x301d('0x3b')];if(!_0x950ee[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x54d7d7[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x950ee['query'][_0x301d('0x23')]);_0x54d7d7[_0x301d('0x21')]=qs['offset'](_0x950ee[_0x301d('0x36')][_0x301d('0x21')]);}return _0x148463[_0x301d('0x105')](_0x54d7d7);}})[_0x301d('0x13')](function(_0x1e4d10){if(_0x1e4d10){return _0x1e4d10?{'count':_0x543225,'rows':_0x1e4d10}:null;}})['then'](respondWithResult(_0x2a3af7,null))[_0x301d('0x4d')](handleError(_0x2a3af7,null));};exports[_0x301d('0x11c')]=function(_0x183404,_0x563e23){var _0x2b3d5c=_0x183404[_0x301d('0x36')][_0x301d('0x11d')]===_0x301d('0x11e')?_0x301d('0x11f'):_0x301d('0x120');return db[_0x301d('0x45')][_0x301d('0x4c')]({'attributes':['id',_0x2b3d5c],'where':{'id':_0x183404[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x563e23,null))[_0x301d('0x13')](function(_0x5d047e){if(_0x5d047e){var _0x3f3871=_0x5d047e[_0x2b3d5c];var _0x54be7c=_0x3f3871&&_0x3f3871[_0x301d('0x121')]?_0x3f3871[_0x301d('0x121')]:[];_0x563e23['send']({'fromKey':_[_0x301d('0x71')](_0x3f3871[_0x301d('0x122')])?undefined:_0x3f3871[_0x301d('0x122')],'count':_0x54be7c[_0x301d('0x3b')],'rows':_0x54be7c});}})[_0x301d('0x4d')](handleError(_0x563e23,null));};exports[_0x301d('0x123')]=function(_0xfb864d,_0x3bba5b){var _0x33cbfc={'raw':![],'where':{}};var _0x257d5f={};var _0x3c3b51={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0xfb864d[_0x301d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3bba5b,null))[_0x301d('0x13')](function(_0xfdb7d2){if(_0xfdb7d2){_0x257d5f[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x124')][_0x301d('0x31')]);_0x257d5f[_0x301d('0x36')]=_['keys'](_0xfb864d[_0x301d('0x36')]);_0x257d5f['filters']=_[_0x301d('0x39')](_0x257d5f[_0x301d('0x35')],_0x257d5f[_0x301d('0x36')]);_0x33cbfc['attributes']=_['intersection'](_0x257d5f[_0x301d('0x35')],qs[_0x301d('0x58')](_0xfb864d[_0x301d('0x36')][_0x301d('0x58')]));_0x33cbfc[_0x301d('0x3a')]=_0x33cbfc[_0x301d('0x3a')][_0x301d('0x3b')]?_0x33cbfc[_0x301d('0x3a')]:_0x257d5f[_0x301d('0x35')];if(!_0xfb864d['query']['hasOwnProperty'](_0x301d('0x59'))){_0x33cbfc[_0x301d('0x23')]=qs[_0x301d('0x23')](_0xfb864d[_0x301d('0x36')][_0x301d('0x23')]);_0x33cbfc[_0x301d('0x21')]=qs[_0x301d('0x21')](_0xfb864d[_0x301d('0x36')]['offset']);}_0x33cbfc[_0x301d('0x3d')]=qs['sort'](_0xfb864d[_0x301d('0x36')][_0x301d('0x3e')]);_0x33cbfc[_0x301d('0x3f')]=qs['filters'](_['pick'](_0xfb864d[_0x301d('0x36')],_0x257d5f['filters']));_0x33cbfc['where'][_0x301d('0x55')]=_0xfdb7d2['id'];if(_0xfb864d['query'][_0x301d('0x42')]){_0x33cbfc[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x33cbfc[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x33cbfc[_0x301d('0x3a')],function(_0x82d8ec){var _0x52948d={};_0x52948d[_0x82d8ec]={'$like':'%'+_0xfb864d[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x52948d;})});}_0x33cbfc=_[_0x301d('0x43')]({},_0x33cbfc,_0xfb864d['options']);return db[_0x301d('0x124')][_0x301d('0x24')]({'where':_0x33cbfc[_0x301d('0x3f')]})['then'](function(_0x132c71){_0x3c3b51['count']=_0x132c71;if(_0xfb864d[_0x301d('0x36')][_0x301d('0x46')]){_0x33cbfc[_0x301d('0x47')]=[{'all':!![]}];}else{_0x33cbfc[_0x301d('0x47')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x301d('0x124')]['findAll'](_0x33cbfc);})[_0x301d('0x13')](function(_0x267372){_0x3c3b51['rows']=_0x267372;return _0x3c3b51;});}})['then'](respondWithFilteredResult(_0x3bba5b,_0x33cbfc))[_0x301d('0x4d')](handleError(_0x3bba5b,null));};exports[_0x301d('0x125')]=function(_0x16a1f7,_0x1d9fd3){return db['ChatWebsite']['find']({'where':{'id':_0x16a1f7['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x1d9fd3,null))['then'](function(_0x1d3069){if(_0x1d3069){return _0x1d3069[_0x301d('0x125')](_0x16a1f7['body']['ids'],_[_0x301d('0xeb')](_0x16a1f7['body'],[_0x301d('0x5c'),'id'])||{})[_0x301d('0xac')](function(_0x4f0236){for(var _0x400469=0x0;_0x400469<_0x16a1f7[_0x301d('0x4f')][_0x301d('0x5c')][_0x301d('0x3b')];_0x400469+=0x1){socket[_0x301d('0x126')](_0x301d('0x127'),{'UserId':Number(_0x16a1f7[_0x301d('0x4f')][_0x301d('0x5c')][_0x400469]),'ChatWebsiteId':Number(_0x16a1f7[_0x301d('0x4a')]['id'])});}return _0x4f0236;});}})[_0x301d('0x13')](respondWithResult(_0x1d9fd3,null))[_0x301d('0x4d')](handleError(_0x1d9fd3,null));};exports[_0x301d('0x128')]=function(_0x222ac8,_0x537b6b){return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x222ac8[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x537b6b,null))[_0x301d('0x13')](function(_0x571a18){if(_0x571a18){return _0x571a18['removeAgents'](_0x222ac8[_0x301d('0x36')][_0x301d('0x5c')])[_0x301d('0x13')](function(){if(_[_0x301d('0x129')](_0x222ac8[_0x301d('0x36')][_0x301d('0x5c')])){for(var _0x2570b5=0x0;_0x2570b5<_0x222ac8['query'][_0x301d('0x5c')]['length'];_0x2570b5+=0x1){socket[_0x301d('0x126')](_0x301d('0x12a'),{'UserId':Number(_0x222ac8[_0x301d('0x36')]['ids'][_0x2570b5]),'ChatWebsiteId':Number(_0x222ac8[_0x301d('0x4a')]['id'])});}}else{socket[_0x301d('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x222ac8[_0x301d('0x36')]['ids']),'ChatWebsiteId':Number(_0x222ac8[_0x301d('0x4a')]['id'])});}});}})[_0x301d('0x13')](respondWithStatusCode(_0x537b6b,null))['catch'](handleError(_0x537b6b,null));};exports['getAgents']=function(_0x10d333,_0x2fefb8){var _0x3ca522={};var _0x337d56={};var _0xe4bcb7;var _0x481a41;return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x10d333[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2fefb8,null))['then'](function(_0x2c9381){if(_0x2c9381){_0xe4bcb7=_0x2c9381;_0x337d56[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0xee')][_0x301d('0x31')]);_0x337d56[_0x301d('0x36')]=_['keys'](_0x10d333[_0x301d('0x36')]);_0x337d56['filters']=_['intersection'](_0x337d56[_0x301d('0x35')],_0x337d56['query']);_0x3ca522[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x337d56[_0x301d('0x35')],qs[_0x301d('0x58')](_0x10d333[_0x301d('0x36')][_0x301d('0x58')]));_0x3ca522[_0x301d('0x3a')]=_0x3ca522[_0x301d('0x3a')]['length']?_0x3ca522[_0x301d('0x3a')]:_0x337d56[_0x301d('0x35')];_0x3ca522[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x10d333[_0x301d('0x36')][_0x301d('0x3e')]);_0x3ca522[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x10d333[_0x301d('0x36')],_0x337d56['filters']));if(_0x10d333['query'][_0x301d('0x42')]){_0x3ca522[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x3ca522[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x3ca522[_0x301d('0x3a')],function(_0x19ddf7){var _0x5790d2={};_0x5790d2[_0x19ddf7]={'$like':'%'+_0x10d333[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x5790d2;})});}_0x3ca522=_[_0x301d('0x43')]({},_0x3ca522,_0x10d333[_0x301d('0x44')]);return _0xe4bcb7[_0x301d('0x12b')](_0x3ca522);}})['then'](function(_0x3033f8){if(_0x3033f8){_0x481a41=_0x3033f8[_0x301d('0x3b')];if(!_0x10d333[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x3ca522[_0x301d('0x23')]=qs['limit'](_0x10d333[_0x301d('0x36')][_0x301d('0x23')]);_0x3ca522[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x10d333[_0x301d('0x36')][_0x301d('0x21')]);}return _0xe4bcb7[_0x301d('0x12b')](_0x3ca522);}})[_0x301d('0x13')](function(_0x2561ae){if(_0x2561ae){return _0x2561ae?{'count':_0x481a41,'rows':_0x2561ae}:null;}})[_0x301d('0x13')](respondWithResult(_0x2fefb8,null))[_0x301d('0x4d')](handleError(_0x2fefb8,null));}; \ No newline at end of file +var _0x045f=['Disposition','getDispositions','findOne','rawAttributes','rows','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','account','contact','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','offline','files','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','findOrCreate','spread','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','offline-chat','openNewInteraction','transaction','Attachment','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','all','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','referer','virtual','alignment','verticalAlignment','labelText','textColor','backgroundColor','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','onlineForm','items','fromKey','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','json','offset','undefined','count','limit','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition'];(function(_0x420ec3,_0x38e80f){var _0x57be6b=function(_0x3d04c7){while(--_0x3d04c7){_0x420ec3['push'](_0x420ec3['shift']());}};_0x57be6b(++_0x38e80f);}(_0x045f,0xce));var _0xf045=function(_0x1fa3f4,_0x56868e){_0x1fa3f4=_0x1fa3f4-0x0;var _0x491768=_0x045f[_0x1fa3f4];return _0x491768;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xf045('0x0'));var util=require('util');var path=require(_0xf045('0x1'));var ejs=require(_0xf045('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf045('0x3'));var querystring=require(_0xf045('0x4'));var Redis=require(_0xf045('0x5'));var qs=require(_0xf045('0x6'));var logger=require(_0xf045('0x7'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf045('0x8')]=_[_0xf045('0x9')](config[_0xf045('0x8')],{'host':_0xf045('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf045('0x8')]));require(_0xf045('0xb'))[_0xf045('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf045('0xd')][_0xf045('0xe')]({'port':0x232c});var client9002=jayson[_0xf045('0xd')][_0xf045('0xe')]({'port':0x232a});var client9003=jayson[_0xf045('0xd')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x475f75,_0x36dc4c,_0x347e10,_0x560a8f){return new BPromise(function(_0x2dc02b,_0x46fc86){var _0x354655=_0x560a8f||client;return _0x354655[_0xf045('0xf')](_0x475f75,_0x347e10)['then'](function(_0x1d5d46){logger[_0xf045('0x10')](_0xf045('0x11'),_0x36dc4c,'request\x20sent');logger[_0xf045('0x12')](_0xf045('0x13'),_0x36dc4c,_0xf045('0x14'),JSON['stringify'](_0x1d5d46));if(_0x1d5d46[_0xf045('0x15')]){if(_0x1d5d46['error']['code']===0x1f4){logger['error'](_0xf045('0x11'),_0x36dc4c,_0x1d5d46[_0xf045('0x15')][_0xf045('0x16')]);return _0x46fc86(_0x1d5d46[_0xf045('0x15')][_0xf045('0x16')]);}logger[_0xf045('0x15')](_0xf045('0x11'),_0x36dc4c,_0x1d5d46[_0xf045('0x15')]['message']);return _0x2dc02b(_0x1d5d46[_0xf045('0x15')]['message']);}else{logger['info'](_0xf045('0x11'),_0x36dc4c,_0xf045('0x14'));_0x2dc02b(_0x1d5d46['result'][_0xf045('0x16')]);}})[_0xf045('0x17')](function(_0x30fb75){logger[_0xf045('0x15')](_0xf045('0x11'),_0x36dc4c,_0x30fb75);_0x46fc86(_0x30fb75);});});}function respondWithStatusCode(_0x33c887,_0x1c2956){_0x1c2956=_0x1c2956||0xcc;return function(_0x1ee45e){if(_0x1ee45e){return _0x33c887[_0xf045('0x18')](_0x1c2956);}return _0x33c887[_0xf045('0x19')](_0x1c2956)['end']();};}function respondWithResult(_0x1c8698,_0x26ea50){_0x26ea50=_0x26ea50||0xc8;return function(_0xba7979){if(_0xba7979){return _0x1c8698[_0xf045('0x19')](_0x26ea50)[_0xf045('0x1a')](_0xba7979);}};}function respondWithFilteredResult(_0x21d702,_0x6feb6e){return function(_0x1533dd){if(_0x1533dd){var _0x83e07c=typeof _0x6feb6e[_0xf045('0x1b')]===_0xf045('0x1c')&&typeof _0x6feb6e['limit']===_0xf045('0x1c');var _0x1017c1=_0x1533dd[_0xf045('0x1d')];var _0x4175ab=_0x83e07c?0x0:_0x6feb6e['offset'];var _0x5d339e=_0x83e07c?_0x1533dd[_0xf045('0x1d')]:_0x6feb6e['offset']+_0x6feb6e[_0xf045('0x1e')];var _0x34e5f0;if(_0x5d339e>=_0x1017c1){_0x5d339e=_0x1017c1;_0x34e5f0=0xc8;}else{_0x34e5f0=0xce;}_0x21d702[_0xf045('0x19')](_0x34e5f0);return _0x21d702['set']('Content-Range',_0x4175ab+'-'+_0x5d339e+'/'+_0x1017c1)[_0xf045('0x1a')](_0x1533dd);}return null;};}function saveUpdates(_0x3e4ae2){return function(_0x528fc0){if(_0x528fc0){return _0x528fc0[_0xf045('0x1f')](_0x3e4ae2)[_0xf045('0x20')](function(_0x28c7f9){return _0x28c7f9;});}return null;};}function removeEntity(_0x1069cc){return function(_0x48fcd0){if(_0x48fcd0){return _0x48fcd0[_0xf045('0x21')]()['then'](function(){var _0x477901=_0x48fcd0[_0xf045('0x22')]({'plain':!![]});var _0x1aebda=_0xf045('0x23');return db[_0xf045('0x24')][_0xf045('0x21')]({'where':{'type':_0x1aebda,'resourceId':_0x477901['id']}})[_0xf045('0x20')](function(){return _0x48fcd0;});})[_0xf045('0x20')](function(){_0x1069cc['status'](0xcc)[_0xf045('0x25')]();});}};}function handleEntityNotFound(_0x3e7840){return function(_0x5116e1){if(!_0x5116e1){_0x3e7840[_0xf045('0x18')](0x194);}return _0x5116e1;};}function handleError(_0x4045b8,_0x10d00e){_0x10d00e=_0x10d00e||0x1f4;return function(_0x36cba2){logger[_0xf045('0x15')](_0x36cba2[_0xf045('0x26')]);if(_0x36cba2[_0xf045('0x27')]){delete _0x36cba2[_0xf045('0x27')];}_0x4045b8[_0xf045('0x19')](_0x10d00e)[_0xf045('0x28')](_0x36cba2);};}exports[_0xf045('0x29')]=function(_0x59a12e,_0x159e5c){var _0x190b8a={'include':[{'model':db[_0xf045('0x2a')],'as':_0xf045('0x2b')}]},_0x41b8e6={},_0x563d3c={'count':0x0,'rows':[]};var _0x1fa12e=_[_0xf045('0x2c')](db[_0xf045('0x2d')]['rawAttributes'],function(_0x32fdee){return{'name':_0x32fdee[_0xf045('0x2e')],'type':_0x32fdee['type']['key']};});_0x41b8e6['model']=_[_0xf045('0x2c')](_0x1fa12e,_0xf045('0x27'));_0x41b8e6[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x59a12e['query']);_0x41b8e6[_0xf045('0x31')]=_['intersection'](_0x41b8e6[_0xf045('0x32')],_0x41b8e6['query']);_0x190b8a[_0xf045('0x33')]=_[_0xf045('0x34')](_0x41b8e6[_0xf045('0x32')],qs[_0xf045('0x35')](_0x59a12e[_0xf045('0x2f')][_0xf045('0x35')]));_0x190b8a[_0xf045('0x33')]=_0x190b8a[_0xf045('0x33')][_0xf045('0x36')]?_0x190b8a[_0xf045('0x33')]:_0x41b8e6['model'];if(!_0x59a12e[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x190b8a[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x59a12e[_0xf045('0x2f')]['limit']);_0x190b8a[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0x59a12e['query'][_0xf045('0x1b')]);}_0x190b8a[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x59a12e[_0xf045('0x2f')][_0xf045('0x3a')]);_0x190b8a[_0xf045('0x3b')]=qs['filters'](_[_0xf045('0x3c')](_0x59a12e[_0xf045('0x2f')],_0x41b8e6['filters']),_0x1fa12e);if(_0x59a12e['query']['filter']){_0x190b8a['where']=_[_0xf045('0x3d')](_0x190b8a['where'],{'$or':_[_0xf045('0x2c')](_0x1fa12e,function(_0x34898a){if(_0x34898a[_0xf045('0x3e')]!==_0xf045('0x3f')){var _0x47c3b5={};_0x47c3b5[_0x34898a[_0xf045('0x27')]]={'$like':'%'+_0x59a12e['query'][_0xf045('0x40')]+'%'};return _0x47c3b5;}})});}_0x190b8a=_[_0xf045('0x3d')]({},_0x190b8a,_0x59a12e['options']);var _0x15ab8f={'where':_0x190b8a['where']};return db['ChatWebsite'][_0xf045('0x1d')](_0x15ab8f)['then'](function(_0x243670){_0x563d3c[_0xf045('0x1d')]=_0x243670;if(_0x59a12e['query'][_0xf045('0x41')]){_0x190b8a[_0xf045('0x42')]=[{'all':!![]}];}return db[_0xf045('0x2d')][_0xf045('0x43')](_0x190b8a);})[_0xf045('0x20')](function(_0x12a3be){_0x563d3c['rows']=_0x12a3be;return _0x563d3c;})['then'](respondWithFilteredResult(_0x159e5c,_0x190b8a))[_0xf045('0x17')](handleError(_0x159e5c,null));};exports[_0xf045('0x44')]=function(_0xb6d1e8,_0x3281c0){var _0x53fc2a={'raw':![],'where':{'id':_0xb6d1e8[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0x2a')],'as':'mandatoryDispositionPause'}]},_0x2f43f1={};_0x2f43f1[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x2d')]['rawAttributes']);_0x2f43f1[_0xf045('0x2f')]=_[_0xf045('0x30')](_0xb6d1e8[_0xf045('0x2f')]);_0x2f43f1[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2f43f1[_0xf045('0x32')],_0x2f43f1[_0xf045('0x2f')]);_0x53fc2a[_0xf045('0x33')]=_[_0xf045('0x34')](_0x2f43f1[_0xf045('0x32')],qs[_0xf045('0x35')](_0xb6d1e8['query'][_0xf045('0x35')]));_0x53fc2a[_0xf045('0x33')]=_0x53fc2a[_0xf045('0x33')][_0xf045('0x36')]?_0x53fc2a[_0xf045('0x33')]:_0x2f43f1[_0xf045('0x32')];if(_0xb6d1e8[_0xf045('0x2f')][_0xf045('0x41')]){_0x53fc2a['include']=[{'all':!![]}];}_0x53fc2a=_[_0xf045('0x3d')]({},_0x53fc2a,_0xb6d1e8[_0xf045('0x46')]);return db[_0xf045('0x2d')][_0xf045('0x47')](_0x53fc2a)[_0xf045('0x20')](handleEntityNotFound(_0x3281c0,null))[_0xf045('0x20')](respondWithResult(_0x3281c0,null))[_0xf045('0x17')](handleError(_0x3281c0,null));};exports['create']=function(_0x3782a1,_0xd7cdb7){return db[_0xf045('0x2d')]['create'](_0x3782a1['body'],{})[_0xf045('0x20')](function(_0x4d62d4){var _0x588eae=_0x3782a1[_0xf045('0x48')]['get']({'plain':!![]});if(!_0x588eae)throw new Error(_0xf045('0x49'));if(_0x588eae[_0xf045('0x4a')]===_0xf045('0x48')){var _0x1b28fd=_0x4d62d4[_0xf045('0x22')]({'plain':!![]});var _0x4cf450=_0xf045('0x23');return db[_0xf045('0x4b')][_0xf045('0x47')]({'where':{'name':_0x4cf450,'userProfileId':_0x588eae[_0xf045('0x4c')]},'raw':!![]})[_0xf045('0x20')](function(_0x59f7b2){if(_0x59f7b2&&_0x59f7b2[_0xf045('0x4d')]===0x0){return db['UserProfileResource'][_0xf045('0x4e')]({'name':_0x1b28fd[_0xf045('0x27')],'resourceId':_0x1b28fd['id'],'type':_0x59f7b2[_0xf045('0x27')],'sectionId':_0x59f7b2['id']},{})[_0xf045('0x20')](function(){return _0x4d62d4;});}else{return _0x4d62d4;}})['catch'](function(_0x1f024c){logger[_0xf045('0x15')](_0xf045('0x4f'),_0x1f024c);throw _0x1f024c;});}return _0x4d62d4;})['then'](respondWithResult(_0xd7cdb7,0xc9))[_0xf045('0x17')](handleError(_0xd7cdb7,null));};exports['update']=function(_0x324d9e,_0x582e30){if(_0x324d9e['body']['id']){delete _0x324d9e[_0xf045('0x50')]['id'];}return db[_0xf045('0x2d')]['find']({'where':{'id':_0x324d9e[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0x2a')],'as':_0xf045('0x2b')}]})['then'](handleEntityNotFound(_0x582e30,null))[_0xf045('0x20')](saveUpdates(_0x324d9e['body'],null))[_0xf045('0x20')](respondWithResult(_0x582e30,null))['catch'](handleError(_0x582e30,null));};exports[_0xf045('0x21')]=function(_0x5a6611,_0x47ef8c){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x5a6611[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x47ef8c,null))[_0xf045('0x20')](removeEntity(_0x47ef8c,null))[_0xf045('0x17')](handleError(_0x47ef8c,null));};exports[_0xf045('0x51')]=function(_0x261253,_0x8fdd06){return db[_0xf045('0x2d')][_0xf045('0x51')]()[_0xf045('0x20')](respondWithResult(_0x8fdd06,null))[_0xf045('0x17')](handleError(_0x8fdd06,null));};exports[_0xf045('0x52')]=function(_0x120953,_0x1a2bda){if(_0x120953['body']['id']){delete _0x120953[_0xf045('0x50')]['id'];}return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x120953[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x1a2bda,null))[_0xf045('0x20')](function(_0x400873){if(_0x400873){_0x120953[_0xf045('0x50')]['ChatWebsiteId']=_0x400873['id'];return db[_0xf045('0x53')][_0xf045('0x4e')](_0x120953[_0xf045('0x50')]);}})['then'](respondWithResult(_0x1a2bda,null))['catch'](handleError(_0x1a2bda,null));};exports[_0xf045('0x54')]=function(_0x2c408e,_0x45fbc9){var _0x1732e9={'raw':![],'where':{}};var _0xcecc12={};var _0x56e9bb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf045('0x55')]({'where':{'id':_0x2c408e['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x45fbc9,null))[_0xf045('0x20')](function(_0x3df0e5){if(_0x3df0e5){_0xcecc12[_0xf045('0x32')]=_[_0xf045('0x30')](db['Disposition'][_0xf045('0x56')]);_0xcecc12['query']=_[_0xf045('0x30')](_0x2c408e['query']);_0xcecc12[_0xf045('0x31')]=_[_0xf045('0x34')](_0xcecc12['model'],_0xcecc12[_0xf045('0x2f')]);_0x1732e9[_0xf045('0x33')]=_[_0xf045('0x34')](_0xcecc12['model'],qs[_0xf045('0x35')](_0x2c408e[_0xf045('0x2f')][_0xf045('0x35')]));_0x1732e9[_0xf045('0x33')]=_0x1732e9[_0xf045('0x33')][_0xf045('0x36')]?_0x1732e9[_0xf045('0x33')]:_0xcecc12[_0xf045('0x32')];if(!_0x2c408e[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x1732e9['limit']=qs['limit'](_0x2c408e[_0xf045('0x2f')][_0xf045('0x1e')]);_0x1732e9[_0xf045('0x1b')]=qs['offset'](_0x2c408e[_0xf045('0x2f')][_0xf045('0x1b')]);}_0x1732e9['order']=qs['sort'](_0x2c408e['query'][_0xf045('0x3a')]);_0x1732e9[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x2c408e[_0xf045('0x2f')],_0xcecc12['filters']));_0x1732e9[_0xf045('0x3b')]['ChatWebsiteId']=_0x3df0e5['id'];if(_0x2c408e[_0xf045('0x2f')][_0xf045('0x40')]){_0x1732e9[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x1732e9[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x1732e9[_0xf045('0x33')],function(_0x4549f3){var _0x2336b6={};_0x2336b6[_0x4549f3]={'$like':'%'+_0x2c408e[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x2336b6;})});}_0x1732e9=_['merge']({},_0x1732e9,_0x2c408e[_0xf045('0x46')]);return db['Disposition'][_0xf045('0x1d')]({'where':_0x1732e9[_0xf045('0x3b')]})[_0xf045('0x20')](function(_0x3804ee){_0x56e9bb['count']=_0x3804ee;if(_0x2c408e[_0xf045('0x2f')][_0xf045('0x41')]){_0x1732e9['include']=[{'all':!![]}];}return db[_0xf045('0x53')][_0xf045('0x43')](_0x1732e9);})[_0xf045('0x20')](function(_0x414cce){_0x56e9bb[_0xf045('0x57')]=_0x414cce;return _0x56e9bb;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x45fbc9,_0x1732e9))['catch'](handleError(_0x45fbc9,null));};exports[_0xf045('0x58')]=function(_0x52c11a,_0x17d0fb){return db[_0xf045('0x2d')]['find']({'where':{'id':_0x52c11a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x17d0fb,null))[_0xf045('0x20')](function(_0x10c09e){if(_0x10c09e){return _0x10c09e[_0xf045('0x58')](_0x52c11a[_0xf045('0x2f')][_0xf045('0x59')]);}})['then'](respondWithStatusCode(_0x17d0fb,null))[_0xf045('0x17')](handleError(_0x17d0fb,null));};exports[_0xf045('0x5a')]=function(_0x1dd43a,_0x57f91a){if(_0x1dd43a['body']['id']){delete _0x1dd43a['body']['id'];}return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x1dd43a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x57f91a,null))['then'](function(_0x37d94b){if(_0x37d94b){_0x1dd43a[_0xf045('0x50')][_0xf045('0x5b')]=_0x37d94b['id'];return db[_0xf045('0x5c')][_0xf045('0x4e')](_0x1dd43a[_0xf045('0x50')]);}})['then'](respondWithResult(_0x57f91a,null))[_0xf045('0x17')](handleError(_0x57f91a,null));};exports[_0xf045('0x5d')]=function(_0x1d3e88,_0x549a53){var _0x544684={'raw':![],'where':{}};var _0x189687={};var _0x55d839={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0x1d3e88[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x549a53,null))[_0xf045('0x20')](function(_0x1db620){if(_0x1db620){_0x189687[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x5c')][_0xf045('0x56')]);_0x189687[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x1d3e88['query']);_0x189687['filters']=_['intersection'](_0x189687['model'],_0x189687[_0xf045('0x2f')]);_0x544684[_0xf045('0x33')]=_['intersection'](_0x189687[_0xf045('0x32')],qs[_0xf045('0x35')](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x35')]));_0x544684['attributes']=_0x544684[_0xf045('0x33')][_0xf045('0x36')]?_0x544684[_0xf045('0x33')]:_0x189687[_0xf045('0x32')];if(!_0x1d3e88['query'][_0xf045('0x37')]('nolimit')){_0x544684['limit']=qs['limit'](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x1e')]);_0x544684[_0xf045('0x1b')]=qs['offset'](_0x1d3e88[_0xf045('0x2f')]['offset']);}_0x544684[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x3a')]);_0x544684[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x1d3e88[_0xf045('0x2f')],_0x189687[_0xf045('0x31')]));_0x544684['where'][_0xf045('0x5b')]=_0x1db620['id'];if(_0x1d3e88[_0xf045('0x2f')][_0xf045('0x40')]){_0x544684[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x544684['where'],{'$or':_[_0xf045('0x2c')](_0x544684['attributes'],function(_0x134371){var _0x1595b7={};_0x1595b7[_0x134371]={'$like':'%'+_0x1d3e88['query']['filter']+'%'};return _0x1595b7;})});}_0x544684=_[_0xf045('0x3d')]({},_0x544684,_0x1d3e88[_0xf045('0x46')]);return db[_0xf045('0x5c')][_0xf045('0x1d')]({'where':_0x544684[_0xf045('0x3b')]})[_0xf045('0x20')](function(_0x537170){_0x55d839['count']=_0x537170;if(_0x1d3e88[_0xf045('0x2f')][_0xf045('0x41')]){_0x544684[_0xf045('0x42')]=[{'all':!![]}];}return db[_0xf045('0x5c')][_0xf045('0x43')](_0x544684);})[_0xf045('0x20')](function(_0x34ef4c){_0x55d839[_0xf045('0x57')]=_0x34ef4c;return _0x55d839;});}})['then'](respondWithFilteredResult(_0x549a53,_0x544684))[_0xf045('0x17')](handleError(_0x549a53,null));};exports[_0xf045('0x5e')]=function(_0x2452d2,_0xa9000e){return db[_0xf045('0x2d')]['find']({'where':{'id':_0x2452d2[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0xa9000e,null))['then'](function(_0x18f84e){if(_0x18f84e){return _0x18f84e['removeAnswers'](_0x2452d2[_0xf045('0x2f')][_0xf045('0x59')]);}})['then'](respondWithStatusCode(_0xa9000e,null))[_0xf045('0x17')](handleError(_0xa9000e,null));};exports['addLogo']=function(_0x1a9195,_0x3f70b1){_0x1a9195[_0xf045('0x50')][_0xf045('0x5f')]=_0x1a9195[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x1a9195[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x3f70b1,null))[_0xf045('0x20')](saveUpdates(_0x1a9195[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x3f70b1,null))[_0xf045('0x17')](handleError(_0x3f70b1,null));};exports['addAvatar']=function(_0x1cc649,_0x2020e2){_0x1cc649[_0xf045('0x50')][_0xf045('0x62')]=_0x1cc649[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x1cc649[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2020e2,null))[_0xf045('0x20')](saveUpdates(_0x1cc649[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x2020e2,null))[_0xf045('0x17')](handleError(_0x2020e2,null));};exports[_0xf045('0x63')]=function(_0x533099,_0xbe3756){_0x533099[_0xf045('0x50')]['customerAvatar']=_0x533099[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x533099[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0xbe3756,null))[_0xf045('0x20')](saveUpdates(_0x533099['body'],null))[_0xf045('0x20')](respondWithResult(_0xbe3756,null))['catch'](handleError(_0xbe3756,null));};exports[_0xf045('0x64')]=function(_0x32008c,_0x2d7ad4){_0x32008c[_0xf045('0x50')][_0xf045('0x65')]=_0x32008c[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x32008c['params']['id']}})['then'](handleEntityNotFound(_0x2d7ad4,null))[_0xf045('0x20')](saveUpdates(_0x32008c[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x2d7ad4,null))[_0xf045('0x17')](handleError(_0x2d7ad4,null));};exports[_0xf045('0x66')]=function(_0x28e220,_0x2cef2d){var _0xc424cb=path[_0xf045('0x67')](config['root'],_0xf045('0x68'));var _0x454c0b={'where':{'id':_0x28e220[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x5f')],'raw':!![]};var _0xf4035e=![];return require('../../config/license/util')[_0xf045('0x69')]()[_0xf045('0x20')](function(_0xaa1e91){if(_0xaa1e91){_0xf4035e=_0xaa1e91[_0xf045('0x6a')];}})[_0xf045('0x20')](function(){return db['ChatWebsite'][_0xf045('0x47')](_0x454c0b);})['then'](handleEntityNotFound(_0x2cef2d,null))[_0xf045('0x20')](function(_0x313c65){if(_0x313c65){if(!_[_0xf045('0x6b')](_0x313c65['sitepic'])){if(fs[_0xf045('0x6c')](path['join'](config[_0xf045('0x6d')],_0xf045('0x6e'),_0x313c65[_0xf045('0x5f')]))&&_0xf4035e){_0xc424cb=path[_0xf045('0x67')](config['root'],'server/files/images/logos/',_0x313c65[_0xf045('0x5f')]);}}return _0x2cef2d[_0xf045('0x6f')](_0xc424cb);}})['catch'](handleError(_0x2cef2d,null));};exports[_0xf045('0x70')]=function(_0x42879f,_0x123140){var _0x30ce1f=path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x71'));var _0x447048={'where':{'id':_0x42879f[_0xf045('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x447048)['then'](handleEntityNotFound(_0x123140,null))[_0xf045('0x20')](function(_0x42520a){if(_0x42520a){if(!_[_0xf045('0x6b')](_0x42520a[_0xf045('0x62')])){if(fs[_0xf045('0x6c')](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x72'),_0x42520a['agentAvatar']))){_0x30ce1f=path[_0xf045('0x67')](config[_0xf045('0x6d')],'server/files/images/avatars/',_0x42520a[_0xf045('0x62')]);}}return _0x123140[_0xf045('0x6f')](_0x30ce1f);}})[_0xf045('0x17')](handleError(_0x123140,null));};exports[_0xf045('0x73')]=function(_0x1f612f,_0x1f572c){var _0x183b5c=path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x74'));var _0x351260={'where':{'id':_0x1f612f[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x75'),_0xf045('0x76')],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x351260)['then'](handleEntityNotFound(_0x1f572c,null))[_0xf045('0x20')](function(_0x517a86){if(_0x517a86){if(!_[_0xf045('0x6b')](_0x517a86[_0xf045('0x75')])){if(fs['existsSync'](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x72'),_0x517a86[_0xf045('0x75')]))&&_0x517a86[_0xf045('0x76')]){_0x183b5c=path['join'](config['root'],_0xf045('0x72'),_0x517a86['customerAvatar']);}}return _0x1f572c[_0xf045('0x6f')](_0x183b5c);}})[_0xf045('0x17')](handleError(_0x1f572c,null));};exports[_0xf045('0x77')]=function(_0x45a1e8,_0x519b68){var _0x141e7f=path[_0xf045('0x67')](config['root'],_0xf045('0x78'));var _0x57141a={'where':{'id':_0x45a1e8[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x65')],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x57141a)[_0xf045('0x20')](handleEntityNotFound(_0x519b68,null))[_0xf045('0x20')](function(_0x308fb5){if(_0x308fb5){if(!_[_0xf045('0x6b')](_0x308fb5[_0xf045('0x65')])){if(fs[_0xf045('0x6c')](path['join'](config[_0xf045('0x6d')],_0xf045('0x72'),_0x308fb5[_0xf045('0x65')]))){_0x141e7f=path['join'](config['root'],'server/files/images/avatars/',_0x308fb5[_0xf045('0x65')]);}}return _0x519b68['download'](_0x141e7f);}})[_0xf045('0x17')](handleError(_0x519b68,null));};exports[_0xf045('0x79')]=function(_0x3d2e23,_0x30629d){var _0x562f94=require(_0xf045('0x7a'));var _0xb4eafd=new _0x562f94();var _0x177a3f=_0xb4eafd['setUA'](_0x3d2e23['headers'][_0xf045('0x7b')])['getResult']();var _0x35cad6={'body':_0x3d2e23[_0xf045('0x50')],'channel':_0xf045('0x7c')};var _0x4a8c1f=[];var _0x32088c=[];var _0x7bc27d={};var _0x6a449f=![];return db[_0xf045('0x7d')]['describe']()['then'](function(_0x25ecd5){if(!_0x25ecd5){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x80'));}_0x4a8c1f=_[_0xf045('0x81')](_[_0xf045('0x30')](_0x25ecd5),[_0xf045('0x82'),_0xf045('0x83')]);_0x32088c=_[_0xf045('0x81')](_[_0xf045('0x30')](_0x25ecd5),[_0xf045('0x82'),_0xf045('0x83'),_0xf045('0x84'),'ListId']);if(_0x3d2e23[_0xf045('0x50')]['id']){delete _0x3d2e23[_0xf045('0x50')]['id'];}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x85')])){throw new db[(_0xf045('0x7e'))]['ValidationError'](_0xf045('0x86'));}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')])||_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')]===''){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x87')])){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x88')+_0x32088c);}if(!_[_0xf045('0x89')](_0x32088c,_0x3d2e23['body'][_0xf045('0x87')])){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x8a')+_0x32088c);}_0x7bc27d[_0x3d2e23[_0xf045('0x50')]['mapKey']]=_0x3d2e23[_0xf045('0x50')][_0xf045('0x85')];})[_0xf045('0x20')](function(){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x3d2e23['params']['id']},'include':[{'model':db[_0xf045('0x8b')],'as':_0xf045('0x8c'),'include':[{'model':db['CmContact'],'as':_0xf045('0x8d'),'where':_0x7bc27d,'limit':0x1,'order':[[_0xf045('0x83'),_0xf045('0x8e')]]}]},{'model':db[_0xf045('0x8f')],'as':_0xf045('0x90')}]});})[_0xf045('0x20')](handleEntityNotFound(_0x30629d,null))['then'](function(_0x28497c){if(_0x28497c&&_0x28497c[_0xf045('0x8c')]){_0x35cad6['account']=_0x28497c;_0x35cad6[_0xf045('0x91')]=_0x28497c[_0xf045('0x90')];_0x35cad6[_0xf045('0x92')]=_0x28497c['List'];_0x35cad6['applications']=_[_0xf045('0x93')](_0x35cad6['applications'],['priority'],['asc']);if(_0x35cad6['account']['Applications']){delete _0x35cad6[_0xf045('0x94')]['Applications'];}if(_0x35cad6[_0xf045('0x94')][_0xf045('0x8c')]&&_0x35cad6[_0xf045('0x94')][_0xf045('0x8c')][_0xf045('0x8d')][_0xf045('0x36')]){return _0x35cad6[_0xf045('0x94')][_0xf045('0x8c')]['Contacts'][0x0];}var _0xc4fc74=_[_0xf045('0x9')](_0x3d2e23[_0xf045('0x50')],{'firstName':_0x3d2e23[_0xf045('0x50')]['from'],'ListId':_0x28497c['ListId']});_0xc4fc74[_0x3d2e23[_0xf045('0x50')][_0xf045('0x87')]]=_0x3d2e23['body'][_0xf045('0x85')];return db['CmContact'][_0xf045('0x4e')](_0xc4fc74,{'fields':_0x4a8c1f,'raw':!![]});}})[_0xf045('0x20')](handleEntityNotFound(_0x30629d,null))[_0xf045('0x20')](function(_0x366d6d){_0x35cad6[_0xf045('0x95')]=_0x366d6d;var _0x3b9450=_0x3d2e23[_0xf045('0x50')]['customerIp'];if(_0x3d2e23[_0xf045('0x96')][_0xf045('0x97')]){_0x3b9450=_0x3d2e23[_0xf045('0x96')][_0xf045('0x97')];}else if(_0x3d2e23[_0xf045('0x96')]['x-forwarded-for']){_0x3b9450=_[_0xf045('0x98')](_0x3d2e23[_0xf045('0x96')]['x-forwarded-for'][_0xf045('0x99')](','));}if(_0x366d6d){var _0x4bdb35={'ContactId':_0x366d6d['id'],'ChatWebsiteId':_0x3d2e23['params']['id'],'from':(_0x366d6d[_0xf045('0x9a')]||'')+'\x20'+(_0x366d6d[_0xf045('0x9b')]||''),'customerIp':_0x3b9450,'customerPort':_0x3d2e23[_0xf045('0x96')]['x-real-port']?_0x3d2e23[_0xf045('0x96')][_0xf045('0x9c')]:null,'referer':_0x3d2e23[_0xf045('0x50')]['referer'],'browserName':_0x177a3f['browser'][_0xf045('0x27')]&&_0x177a3f[_0xf045('0x9d')][_0xf045('0x9e')]?util['format']('%s\x20%s',_0x177a3f[_0xf045('0x9d')]['name'],_0x177a3f[_0xf045('0x9d')][_0xf045('0x9e')]):_0xf045('0x9f'),'browserVersion':_0x177a3f[_0xf045('0x9d')]['version']||_0xf045('0x9f'),'osName':util[_0xf045('0xa0')](_0xf045('0xa1'),_0x177a3f['os'][_0xf045('0x27')],_0x177a3f['os']['version']),'osVersion':_0x177a3f['os'][_0xf045('0x9e')],'deviceModel':_0x177a3f[_0xf045('0xa2')][_0xf045('0x32')]&&_0x177a3f[_0xf045('0xa2')][_0xf045('0xa3')]?util['format'](_0xf045('0xa4'),_0x177a3f[_0xf045('0xa2')][_0xf045('0x32')],_0x177a3f[_0xf045('0xa2')][_0xf045('0xa3')],_0x177a3f[_0xf045('0xa2')][_0xf045('0x3e')]):null,'deviceVendor':_0x177a3f[_0xf045('0xa2')]['vendor'],'deviceType':_0x177a3f[_0xf045('0xa2')][_0xf045('0x3e')],'formData':JSON[_0xf045('0xa5')](_0x3d2e23[_0xf045('0x50')])};var _0x44c1ac={'ChatWebsiteId':_0x3d2e23['params']['id'],'closed':![]};if(_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')]){_0x44c1ac[_0xf045('0xa6')]=_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')];return db[_0xf045('0xa7')]['find']({'where':_0x44c1ac})['then'](function(_0x4c3691){if(_0x4c3691){return[_0x4c3691,![]];}_0x4bdb35[_0xf045('0xa6')]=_0x3d2e23[_0xf045('0x50')]['threadId'];_0x4bdb35['externalUrl']=_0x3d2e23[_0xf045('0x50')]['externalUrl'];return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)[_0xf045('0x20')](function(_0x11c346){return[_0x11c346,!![]];});});}_0x44c1ac[_0xf045('0xa8')]=_0x366d6d['id'];if(_0x3d2e23['body'][_0xf045('0xa9')]&&_0x3d2e23[_0xf045('0x50')][_0xf045('0xa9')]['id']){_0x44c1ac['id']=_0x3d2e23[_0xf045('0x50')][_0xf045('0xa9')]['id'];return db[_0xf045('0xa7')][_0xf045('0x47')]({'where':_0x44c1ac})['then'](function(_0x511726){if(_0x511726){return[_0x511726,![]];}return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)[_0xf045('0x20')](function(_0x3686b9){return[_0x3686b9,!![]];});});}return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)['then'](function(_0xbb2d8){return[_0xbb2d8,!![]];});}})['spread'](function(_0x495403,_0x569e32){if(_0x495403){_0x6a449f=_0x569e32;if(!_0x569e32){var _0x5ac1ee={'from':(_0x35cad6[_0xf045('0x95')][_0xf045('0x9a')]||'')+'\x20'+(_0x35cad6['contact'][_0xf045('0x9b')]||'')};if(_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')]&&_0x3d2e23[_0xf045('0x50')][_0xf045('0xaa')]&&_0x3d2e23[_0xf045('0x50')]['threadId']!=_0x3d2e23[_0xf045('0x50')][_0xf045('0xaa')]){_0x5ac1ee[_0xf045('0xa6')]=_0x3d2e23['body'][_0xf045('0xaa')];}return _0x495403[_0xf045('0x1f')](_0x5ac1ee);}else{return _0x495403;}}})[_0xf045('0x20')](function(_0x1cf1e3){_0x35cad6[_0xf045('0xa9')]=_0x1cf1e3[_0xf045('0x22')]({'plain':!![]});_0x35cad6[_0xf045('0xa9')][_0xf045('0xab')]=_0x6a449f;if(_0x35cad6[_0xf045('0xa9')][_0xf045('0xab')]){if(_0x35cad6[_0xf045('0x94')][_0xf045('0xac')]){_0x35cad6['applications'][_0xf045('0xad')]({'id':0x0,'priority':_0x35cad6['applications'][_0xf045('0x36')]+0x1,'app':_0xf045('0xae'),'appdata':_0xf045('0xaf'),'interval':'*,*,*,*'});}}return db[_0xf045('0xb0')][_0xf045('0x4e')]({'body':_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')],'ChatWebsiteId':_0x3d2e23[_0xf045('0x45')]['id'],'ChatInteractionId':_0x1cf1e3['id'],'direction':'in','ContactId':_0x35cad6[_0xf045('0x95')]['id'],'AttachmentId':_0x3d2e23['body'][_0xf045('0xb1')]});})[_0xf045('0x20')](function(_0x23e435){_0x35cad6['message']=_0x23e435;if(_0x35cad6[_0xf045('0xa9')][_0xf045('0xb2')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x35cad6['interaction'][_0xf045('0xb2')]}})[_0xf045('0x20')](function(_0x24496c){if(_0x24496c){_0x35cad6['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf045('0xb3'),'appdata':_0x24496c[_0xf045('0x27')]+','+(_0x35cad6['account'][_0xf045('0xb4')]||0xa),'interval':_0xf045('0xb5')});_0x35cad6[_0xf045('0xb6')]=!![];}return respondWithRpcPromise(_0xf045('0xb7'),_0xf045('0xb8'),_0x35cad6);});}return respondWithRpcPromise(_0xf045('0xb7'),_0xf045('0xb8'),_0x35cad6);})['then'](function(_0x36c3c2){respondWithRpcPromise('EventManager','EventManager',{'event':_0xf045('0x79'),'message':_0x36c3c2},client9002);return _0x36c3c2;})[_0xf045('0x20')](respondWithResult(_0x30629d,null))[_0xf045('0x17')](handleError(_0x30629d,null));};exports[_0xf045('0xb9')]=function(_0x2a2ac2,_0x59bd1c){var _0x414760,_0x376a8d,_0x17190d;var _0x3e6800=[];var _0x3e14e6={};var _0x2412f6=_0x2a2ac2[_0xf045('0xba')]||[];var _0xecfb87=[];var _0x587da3;return db[_0xf045('0x7d')][_0xf045('0x51')]()[_0xf045('0x20')](function(_0x44644e){if(!_0x44644e){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x80'));}_0x3e6800=_['difference'](_[_0xf045('0x30')](_0x44644e),['createdAt',_0xf045('0x83'),'CompanyId',_0xf045('0xbb')]);if(_0x2a2ac2[_0xf045('0x50')]['id']){delete _0x2a2ac2['body']['id'];}if(_[_0xf045('0x6b')](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')])){throw _0x59bd1c[_0xf045('0x19')](0x1f4)['send'](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x86')));}if(_['isNil'](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x50')])||_0x2a2ac2['body']['body']===''){throw _0x59bd1c[_0xf045('0x19')](0x1f4)[_0xf045('0x28')](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0xbc')));}if(_['isNil'](_0x2a2ac2['body'][_0xf045('0xbd')])){throw _0x59bd1c[_0xf045('0x19')](0x1f4)['send'](new db['Sequelize'][(_0xf045('0x7f'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e6800));}if(!_[_0xf045('0x89')](_0x3e6800,_0x2a2ac2[_0xf045('0x50')][_0xf045('0xbd')])){throw _0x59bd1c['status'](0x1f4)[_0xf045('0x28')](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e6800));}_0x3e14e6[_0x2a2ac2['body'][_0xf045('0xbd')]]=_0x2a2ac2[_0xf045('0x50')]['from'];})[_0xf045('0x20')](function(){return db['ChatWebsite'][_0xf045('0x47')]({'where':{'id':_0x2a2ac2[_0xf045('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0xf045('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xf045('0x20')](handleEntityNotFound(_0x59bd1c,null))[_0xf045('0x20')](function(_0x4495ce){if(_0x4495ce&&_0x4495ce[_0xf045('0x8c')]){_0x376a8d=_0x4495ce;var _0x4ae8ec=_[_0xf045('0x9')](_0x2a2ac2[_0xf045('0x50')],{'firstName':_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')],'phone':_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')],'ListId':_0x4495ce[_0xf045('0xbb')]});_0x4ae8ec[_0x2a2ac2[_0xf045('0x50')][_0xf045('0xbd')]]=_0x2a2ac2['body']['from'];return db[_0xf045('0x7d')][_0xf045('0xbe')]({'where':_0x3e14e6,'defaults':_0x4ae8ec});}})[_0xf045('0xbf')](function(_0x389949){if(_0x389949){_0x17190d=_0x389949;var _0x52a35c=fs[_0xf045('0xc0')](path[_0xf045('0x67')](config[_0xf045('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x53ffa3=ejs[_0xf045('0xc1')](_0x52a35c,{'body':_[_0xf045('0xc2')](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x50')]),'bodyTitle':_0x376a8d[_0xf045('0xc3')]});return db[_0xf045('0xc4')][_0xf045('0x4e')]({'body':_0x53ffa3,'ContactId':_0x389949['id'],'ChatWebsiteId':_0x376a8d['id']});}})['then'](function(_0x5b4281){_0x587da3=_0x5b4281;if(_0x2412f6[_0xf045('0x36')]){var _0x4cd580=_0x2412f6[_0xf045('0x2c')](function(_0xae463d){return{'name':_0xae463d[_0xf045('0xc5')],'basename':_0xae463d[_0xf045('0x61')],'type':_0xae463d[_0xf045('0xc6')],'ChatOfflineMessageId':_0x5b4281['id']};});_0xecfb87=_0x4cd580[_0xf045('0x2c')](_0x5d08b6=>{var _0x4bf008={'filename':_0x5d08b6[_0xf045('0x27')],'path':path['join'](config['root'],'server',_0xf045('0xba'),'attachments',_0xf045('0xc7'),_0x5d08b6['basename'])};return _0x4bf008;});if(!_0x376a8d[_0xf045('0xc8')]){return db['sequelize'][_0xf045('0xc9')](function(_0x4fd11c){return db[_0xf045('0xca')]['bulkCreate'](_0x4cd580,{'transaction':_0x4fd11c});});}}})['then'](function(){if(_0x587da3){_0x414760=_0x587da3;return db[_0xf045('0xcb')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xf045('0xcc')],'as':_0xf045('0xcd'),'raw':!![]}]});}})[_0xf045('0x20')](function(_0x3c6bd1){if(_0x3c6bd1&&_0x3c6bd1[_0xf045('0xcd')]&&_0x376a8d[_0xf045('0xce')]&&_0x376a8d[_0xf045('0xcf')]){var _0x3f76a9={'tls':{'rejectUnauthorized':![]}};if(_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd0')]){_0x3f76a9[_0xf045('0xd0')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd0')];}else{_0x3f76a9[_0xf045('0xd1')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd1')];_0x3f76a9[_0xf045('0xd2')]=_0x3c6bd1[_0xf045('0xcd')]['port'];_0x3f76a9[_0xf045('0xd3')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd3')];}if(_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd4')]){_0x3f76a9['auth']={'user':_0x3c6bd1[_0xf045('0xcd')][_0xf045('0x48')],'pass':_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd5')]};}return respondWithRpcPromise('SendMail',_0xf045('0xd6'),{'account':_0x3f76a9,'message':{'from':util[_0xf045('0xa0')](_0xf045('0xd7'),_0x3c6bd1['name'],_0x3c6bd1[_0xf045('0xd8')]||_0x3c6bd1['Smtp'][_0xf045('0x48')]),'to':_0x376a8d[_0xf045('0xcf')],'subject':_0x376a8d[_0xf045('0xd9')],'html':_0x414760[_0xf045('0x50')],'attachments':_0xecfb87}},client9003)[_0xf045('0x20')](function(){return _0x414760;})[_0xf045('0x17')](function(_0x53a7c0){console['error'](_0x53a7c0);});}})[_0xf045('0x20')](function(){if(_0x376a8d&&_0x376a8d[_0xf045('0xc8')]&&_0x376a8d[_0xf045('0xda')]){var _0x41ee34=[];if(_0x2412f6['length']){_0x41ee34=_0x2412f6[_0xf045('0x2c')](function(_0x410e76){return{'name':_0x410e76['originalname'],'basename':_0x410e76[_0xf045('0x61')],'type':_0x410e76[_0xf045('0xc6')],'ChatOfflineMessageId':_0x587da3['id']};});}var _0x5d1af2;if(!_[_0xf045('0x6b')](_0x376a8d['subjectOffline'])){var _0x29212b=_[_0xf045('0x2c')](_0x2a2ac2[_0xf045('0x50')],function(_0x351f62){return _0x351f62;});var _0x13d5d3=_[_0xf045('0xdb')](_0x29212b)[0x0];var _0x567985=_[_0xf045('0xdc')](_0x13d5d3,function(_0x3393d4){return _0x3393d4;});_0x5d1af2=_0x567985[0x1][_0x376a8d[_0xf045('0xdd')]];}var _0x37589f={'from':_0x17190d[_0xf045('0xd8')],'firstName':_0x17190d[_0xf045('0x9a')],'lastName':_0x17190d['lastName'],'mapKey':_0xf045('0xd8'),'message':{'from':_0x17190d['email'],'to':_0x376a8d[_0xf045('0xcb')][_0xf045('0xd8')],'cc':'','subject':_[_0xf045('0x6b')](_0x5d1af2)?_0x376a8d[_0xf045('0xd9')]:_0x5d1af2,'messageId':'','sentAt':new Date(),'attach':_0x41ee34['length'],'attachments':_0x41ee34,'originChannel':_0xf045('0xde'),'ChatWebsiteId':_0x376a8d['id'],'ChatOfflineMessageId':_0x414760['id'],'originTo':_0x376a8d['MailAccount'][_0xf045('0xd8')]},'body':_0x414760[_0xf045('0x50')]};var _0x3c7bce={'account':{'id':_0x376a8d[_0xf045('0xda')]},'body':_0x37589f,'log':_0xf045('0xdf')};return respondWithRpcPromise(_0xf045('0xdf'),'notifyMail',_0x3c7bce,client9001)[_0xf045('0x20')](function(){return _0x414760;})[_0xf045('0x17')](function(_0x26b103){console[_0xf045('0x15')](_0x26b103);});}return;})[_0xf045('0x20')](function(){if(_0x414760){return _0x414760;}})[_0xf045('0x20')](respondWithResult(_0x59bd1c,null))[_0xf045('0x17')](function(_0x17d71e){console[_0xf045('0x15')]('catch',_0x17d71e);for(var _0x3eb01b of _0x2412f6){var _0x2bb50a=path[_0xf045('0x67')](config['root'],'server',_0xf045('0xba'),'attachments','offline-chat',_0x3eb01b['filename']);fs_extra['remove'](_0x2bb50a)[_0xf045('0x17')](function(_0x5d0390){console[_0xf045('0x15')]('Could\x20not\x20remove\x20attachment\x20file',_0x2bb50a,_0x5d0390);});}});};exports[_0xf045('0xe0')]=function(_0x17289e,_0x357444){return db[_0xf045('0xa7')][_0xf045('0x47')]({'where':{'id':_0x17289e['params']['id']}})['then'](handleEntityNotFound(_0x357444,null))[_0xf045('0x20')](function(_0x2500f4){if(_0x2500f4){return _0x2500f4['addInteraction'](_0x17289e[_0xf045('0x50')][_0xf045('0x59')],_['omit'](_0x17289e[_0xf045('0x50')],['ids','id'])||{});}})[_0xf045('0x20')](respondWithResult(_0x357444,null))[_0xf045('0x17')](handleError(_0x357444,null));};exports[_0xf045('0xe1')]=function(_0x4b1f0a,_0x2a7b08){var _0x4e967a={'raw':![],'where':{}};var _0x3c5a3a={};var _0x3f7f4f={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0x4b1f0a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2a7b08,null))[_0xf045('0x20')](function(_0x5d0910){if(_0x5d0910){_0x3c5a3a['model']=_[_0xf045('0x30')](db['ChatInteraction'][_0xf045('0x56')]);_0x3c5a3a['query']=_[_0xf045('0x30')](_0x4b1f0a[_0xf045('0x2f')]);_0x3c5a3a[_0xf045('0x31')]=_[_0xf045('0x34')](_0x3c5a3a[_0xf045('0x32')],_0x3c5a3a['query']);_0x4e967a['attributes']=_[_0xf045('0x34')](_0x3c5a3a['model'],qs['fields'](_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x35')]));_0x4e967a[_0xf045('0x33')]=_0x4e967a['attributes'][_0xf045('0x36')]?_0x4e967a[_0xf045('0x33')]:_0x3c5a3a[_0xf045('0x32')];if(!_0x4b1f0a[_0xf045('0x2f')]['hasOwnProperty']('nolimit')){_0x4e967a[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x4b1f0a[_0xf045('0x2f')]['limit']);_0x4e967a['offset']=qs['offset'](_0x4b1f0a[_0xf045('0x2f')]['offset']);}_0x4e967a[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x4b1f0a[_0xf045('0x2f')]['sort']);_0x4e967a[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x4b1f0a['query'],_0x3c5a3a[_0xf045('0x31')]));_0x4e967a[_0xf045('0x3b')][_0xf045('0x5b')]=_0x5d0910['id'];if(_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x40')]){_0x4e967a['where']=_[_0xf045('0x3d')](_0x4e967a[_0xf045('0x3b')],{'$or':_['map'](_0x4e967a['attributes'],function(_0x2d9531){var _0x373cda={};_0x373cda[_0x2d9531]={'$like':'%'+_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x373cda;})});}_0x4e967a=_['merge']({},_0x4e967a,_0x4b1f0a[_0xf045('0x46')]);return db[_0xf045('0xa7')]['count']({'where':_0x4e967a[_0xf045('0x3b')]})['then'](function(_0x25e6f9){_0x3f7f4f[_0xf045('0x1d')]=_0x25e6f9;if(_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x41')]){_0x4e967a[_0xf045('0x42')]=[{'model':db[_0xf045('0x7d')],'as':_0xf045('0xe2'),'required':![]},{'model':db[_0xf045('0xe3')],'as':_0xf045('0xe4'),'attributes':[_0xf045('0x27'),_0xf045('0xe5'),_0xf045('0xe6')],'required':![]},{'model':db[_0xf045('0xe7')],'as':_0xf045('0xe8'),'attributes':['id','name','color'],'where':_0x4b1f0a[_0xf045('0x2f')][_0xf045('0xe9')]?{'id':_0x4b1f0a[_0xf045('0x2f')]['tag']}:undefined,'required':_0x4b1f0a[_0xf045('0x2f')][_0xf045('0xe9')]?!![]:![]}];}return db[_0xf045('0xa7')][_0xf045('0x43')](_0x4e967a);})[_0xf045('0x20')](function(_0x487216){_0x3f7f4f[_0xf045('0x57')]=_0x487216;return _0x3f7f4f;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x2a7b08,_0x4e967a))[_0xf045('0x17')](handleError(_0x2a7b08,null));};function iftimePromise(_0x29dd8b,_0x54da53){return respondWithRpcPromise(_0xf045('0xea'),_0xf045('0xeb'),{'command':_0x54da53['timezone']?util['format'](_0xf045('0xec'),_0x29dd8b[_0xf045('0xed')],_0x54da53[_0xf045('0xee')]):util[_0xf045('0xa0')](_0xf045('0xef'),_0x29dd8b[_0xf045('0xed')])},client9002)['then'](function(_0x3454d5){var _0x20f859=_0x3454d5&&_0x3454d5[_0xf045('0xf0')](_0xf045('0xf1'))>=0x0?!![]:![];logger[_0xf045('0x10')](_0xf045('0xf2'),_0x54da53['id'],_0x29dd8b['id'],_0x29dd8b['interval'],_0x20f859?_0xf045('0xf3'):'OFFLINE',_0x54da53['timezone']?_0x54da53[_0xf045('0xee')]:_0xf045('0xf4'));return _0x20f859;})[_0xf045('0x17')](function(_0xf03a2f){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x54da53['id'],_0x29dd8b['id'],_0x29dd8b[_0xf045('0xed')],util[_0xf045('0xf5')](_0xf03a2f,{'showHidden':![],'depth':null}),_0x54da53[_0xf045('0xee')]?_0x54da53[_0xf045('0xee')]:_0xf045('0xf4'));return![];});}exports[_0xf045('0xeb')]=function(_0x3c3375,_0x23e908){var _0x23306b=0x0;var _0x59aabe=0x0;var _0x5549c4=![];var _0x2a50e3;var _0x19dc0c;return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x3c3375[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0xf6')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xf045('0xf7'),'attributes':['id',_0xf045('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x23e908,null))['then'](function(_0x295457){if(_0x295457){_0x2a50e3=_0x295457;return _0x295457[_0xf045('0xf8')]({'raw':!![]});}})[_0xf045('0x20')](function(_0x2abece){if(_0x2a50e3){if(_0x2abece){_0x19dc0c=_0x2abece;}}return require('../../config/license/util')[_0xf045('0x69')]();})[_0xf045('0x20')](function(_0xb43517){if(_0xb43517){_0x59aabe=_0xb43517['virtual'];_0x5549c4=_0xb43517[_0xf045('0x6a')];}})[_0xf045('0x20')](function(){return db[_0xf045('0xa7')][_0xf045('0x1d')]({'where':{'closed':![]}});})[_0xf045('0x20')](function(_0x35c59c){_0x23306b=_0x35c59c;if(_0x59aabe&&_0x35c59c>_0x59aabe){return db[_0xf045('0xf9')][_0xf045('0x55')]({'where':{'id':0x1}})[_0xf045('0x20')](function(_0x5aefe1){if(_0x5aefe1){_0x5aefe1['increment'](_0xf045('0xfa'));}});}})['then'](function(){if(_0x2a50e3['Interval']&&_0x2a50e3['Interval'][_0xf045('0xf7')]){var _0x1c3664=[];for(var _0x186472=0x0;_0x186472<_0x2a50e3[_0xf045('0xf6')][_0xf045('0xf7')][_0xf045('0x36')];_0x186472++){var _0x4c57c2=_0x2a50e3[_0xf045('0xf6')][_0xf045('0xf7')][_0x186472][_0xf045('0x22')]({'plain':!![]});_0x1c3664[_0xf045('0xad')](iftimePromise(_0x4c57c2,_0x2a50e3));}return BPromise[_0xf045('0xfb')](_0x1c3664)['then'](function(_0x215afe){return _['some'](_0x215afe);});}else{return!![];}})[_0xf045('0x20')](function(_0x3ef323){var _0x3c34d2=fs[_0xf045('0xc0')](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0xfc')),_0xf045('0xfd'));var _0x50757d={'remote':_0x2a50e3[_0xf045('0xfe')],'query':querystring[_0xf045('0xa5')](_[_0xf045('0x3d')](_0x2a50e3['get']({'plain':!![]}),{'customerIp':_0x3c3375[_0xf045('0x96')]['x-forwarded-for']||_0x3c3375[_0xf045('0x96')][_0xf045('0xff')]||_0x3c3375[_0xf045('0x100')][_0xf045('0x101')]||_0x3c3375['ip'],'referer':_0x3c3375[_0xf045('0x96')][_0xf045('0x102')],'openedInteractions':_0x23306b,'maxInteractions':_0x59aabe,'virtual':_0x5549c4[_0xf045('0x103')],'online':_0x3ef323,'custom':_0x5549c4}))['replace'](/'/g,'\x5c\x27')};_0x23e908[_0xf045('0x28')](ejs[_0xf045('0xc1')](Mustache[_0xf045('0xc1')](_0x3c34d2,_0x50757d),{'proactiveActions':_0x19dc0c,'alignment':_0x2a50e3[_0xf045('0x104')],'verticalAlignment':_0x2a50e3[_0xf045('0x105')],'div_color':_0x2a50e3['color'],'labelText':_0x2a50e3[_0xf045('0x106')],'text_color':_0x2a50e3[_0xf045('0x107')],'button_color':_0x2a50e3['color_button'],'background_color':_0x2a50e3[_0xf045('0x108')]}));})[_0xf045('0x17')](handleError(_0x23e908,null));};exports['addApplications']=function(_0x5db755,_0x136691){var _0x3d0211=_0x5db755[_0xf045('0x45')]['id'];var _0x5c25a2=_0x5db755[_0xf045('0x50')];var _0x431a96=0xc8;var _0x2140bb=null;return db[_0xf045('0x109')][_0xf045('0xc9')]({'isolationLevel':db[_0xf045('0x109')][_0xf045('0x10a')]['ISOLATION_LEVELS'][_0xf045('0x10b')]},function(_0xf9d973){return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x3d0211},'transaction':_0xf9d973})[_0xf045('0x20')](function(_0x1361eb){if(_0x1361eb){return db[_0xf045('0x8f')][_0xf045('0x21')]({'where':{'ChatWebsiteId':_0x3d0211},'transaction':_0xf9d973})['then'](function(){var _0x16a9aa=_[_0xf045('0x2c')](_0x5c25a2,function(_0x5cb875){_0x5cb875[_0xf045('0x5b')]=_0x3d0211;return _0x5cb875;});return db['ChatApplication'][_0xf045('0x10c')](_0x16a9aa,{'transaction':_0xf9d973});});}else{_0x431a96=0x194;_0x2140bb=[];}});})[_0xf045('0x20')](function(){if(_0x431a96!==0x194){return db[_0xf045('0x8f')][_0xf045('0x10d')]({'where':{'ChatWebsiteId':_0x3d0211},'order':_0xf045('0x10e')})['then'](function(_0x5b5291){_0x2140bb=_0x5b5291;});}})[_0xf045('0x17')](function(_0x1e3270){_0x431a96=0x1f4;logger[_0xf045('0x15')](_0x1e3270[_0xf045('0x26')]);if(_0x1e3270[_0xf045('0x27')]){delete _0x1e3270[_0xf045('0x27')];}_0x2140bb=_0x1e3270;})[_0xf045('0x10f')](function(){if(_0x2140bb===null){_0x136691[_0xf045('0x18')](_0x431a96);}else{if(_0x431a96===0x1f4){_0x136691['status'](_0x431a96)[_0xf045('0x28')](_0x2140bb);}else{_0x136691['status'](_0x431a96)[_0xf045('0x1a')](_0x2140bb);}}});};exports[_0xf045('0x110')]=function(_0x18f61f,_0x428456){var _0x258368={};var _0x9488df={};var _0x20a273;var _0xee9c92;return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x18f61f['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x428456,null))[_0xf045('0x20')](function(_0x427f96){if(_0x427f96){_0x20a273=_0x427f96;_0x9488df['model']=_[_0xf045('0x30')](db['ChatApplication'][_0xf045('0x56')]);_0x9488df[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x18f61f['query']);_0x9488df[_0xf045('0x31')]=_[_0xf045('0x34')](_0x9488df[_0xf045('0x32')],_0x9488df[_0xf045('0x2f')]);_0x258368[_0xf045('0x33')]=_[_0xf045('0x34')](_0x9488df['model'],qs[_0xf045('0x35')](_0x18f61f[_0xf045('0x2f')]['fields']));_0x258368['attributes']=_0x258368[_0xf045('0x33')]['length']?_0x258368[_0xf045('0x33')]:_0x9488df[_0xf045('0x32')];_0x258368[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x3a')]);_0x258368[_0xf045('0x3b')]=qs['filters'](_['pick'](_0x18f61f[_0xf045('0x2f')],_0x9488df['filters']));if(_0x18f61f[_0xf045('0x2f')]['filter']){_0x258368[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x258368[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x258368[_0xf045('0x33')],function(_0x365dea){var _0x2ab7da={};_0x2ab7da[_0x365dea]={'$like':'%'+_0x18f61f[_0xf045('0x2f')]['filter']+'%'};return _0x2ab7da;})});}_0x258368=_[_0xf045('0x3d')]({},_0x258368,_0x18f61f['options']);return _0x20a273['getApplications'](_0x258368);}})[_0xf045('0x20')](function(_0x311942){if(_0x311942){_0xee9c92=_0x311942[_0xf045('0x36')];if(!_0x18f61f[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x258368[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x1e')]);_0x258368[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x1b')]);}return _0x20a273[_0xf045('0x110')](_0x258368);}})['then'](function(_0x4e7008){if(_0x4e7008){return _0x4e7008?{'count':_0xee9c92,'rows':_0x4e7008}:null;}})['then'](respondWithResult(_0x428456,null))[_0xf045('0x17')](handleError(_0x428456,null));};exports[_0xf045('0x111')]=function(_0x5cd68e,_0x10c169){return db[_0xf045('0x112')]['find']({'where':{'id':_0x5cd68e['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x10c169,null))[_0xf045('0x20')](function(_0x596bd1){if(_0x596bd1){return _0x596bd1[_0xf045('0x111')](_0x5cd68e['body'][_0xf045('0x59')],_['omit'](_0x5cd68e['body'],['ids','id'])||{});}})[_0xf045('0x20')](respondWithResult(_0x10c169,null))[_0xf045('0x17')](handleError(_0x10c169,null));};exports[_0xf045('0xf8')]=function(_0x4ee990,_0x1d82a4){var _0x108897={};var _0x2ee613={};var _0x3dfb55;var _0x481ec2;return db['ChatWebsite'][_0xf045('0x55')]({'where':{'id':_0x4ee990[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x1d82a4,null))['then'](function(_0x6bbd78){if(_0x6bbd78){_0x3dfb55=_0x6bbd78;_0x2ee613[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x113')][_0xf045('0x56')]);_0x2ee613['query']=_[_0xf045('0x30')](_0x4ee990['query']);_0x2ee613[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2ee613[_0xf045('0x32')],_0x2ee613[_0xf045('0x2f')]);_0x108897[_0xf045('0x33')]=_[_0xf045('0x34')](_0x2ee613[_0xf045('0x32')],qs[_0xf045('0x35')](_0x4ee990['query'][_0xf045('0x35')]));_0x108897[_0xf045('0x33')]=_0x108897[_0xf045('0x33')][_0xf045('0x36')]?_0x108897[_0xf045('0x33')]:_0x2ee613[_0xf045('0x32')];_0x108897[_0xf045('0x39')]=qs['sort'](_0x4ee990[_0xf045('0x2f')][_0xf045('0x3a')]);_0x108897[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x4ee990[_0xf045('0x2f')],_0x2ee613['filters']));if(_0x4ee990[_0xf045('0x2f')][_0xf045('0x40')]){_0x108897[_0xf045('0x3b')]=_['merge'](_0x108897[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x108897[_0xf045('0x33')],function(_0x277b4c){var _0x1660f2={};_0x1660f2[_0x277b4c]={'$like':'%'+_0x4ee990[_0xf045('0x2f')]['filter']+'%'};return _0x1660f2;})});}_0x108897=_[_0xf045('0x3d')]({},_0x108897,_0x4ee990[_0xf045('0x46')]);return _0x3dfb55[_0xf045('0xf8')](_0x108897);}})[_0xf045('0x20')](function(_0x3146cb){if(_0x3146cb){_0x481ec2=_0x3146cb[_0xf045('0x36')];if(!_0x4ee990['query'][_0xf045('0x37')](_0xf045('0x38'))){_0x108897['limit']=qs['limit'](_0x4ee990[_0xf045('0x2f')][_0xf045('0x1e')]);_0x108897[_0xf045('0x1b')]=qs['offset'](_0x4ee990['query'][_0xf045('0x1b')]);}return _0x3dfb55[_0xf045('0xf8')](_0x108897);}})['then'](function(_0x2f6ce9){if(_0x2f6ce9){return _0x2f6ce9?{'count':_0x481ec2,'rows':_0x2f6ce9}:null;}})[_0xf045('0x20')](respondWithResult(_0x1d82a4,null))[_0xf045('0x17')](handleError(_0x1d82a4,null));};exports[_0xf045('0x114')]=function(_0x23b355,_0x2fc125){var _0x552c8c=_0x23b355['query']['online']==='false'?'offlineForm':_0xf045('0x115');return db[_0xf045('0x2d')][_0xf045('0x47')]({'attributes':['id',_0x552c8c],'where':{'id':_0x23b355[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2fc125,null))[_0xf045('0x20')](function(_0x2e8720){if(_0x2e8720){var _0x2fe3eb=_0x2e8720[_0x552c8c];var _0x138684=_0x2fe3eb&&_0x2fe3eb[_0xf045('0x116')]?_0x2fe3eb[_0xf045('0x116')]:[];_0x2fc125[_0xf045('0x28')]({'fromKey':_[_0xf045('0x6b')](_0x2fe3eb[_0xf045('0x117')])?undefined:_0x2fe3eb[_0xf045('0x117')],'count':_0x138684[_0xf045('0x36')],'rows':_0x138684});}})[_0xf045('0x17')](handleError(_0x2fc125,null));};exports['getOfflineMessages']=function(_0xb5379d,_0x4fb2b8){var _0x5d5d9b={'raw':![],'where':{}};var _0x5094d8={};var _0x296460={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0xb5379d[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x4fb2b8,null))[_0xf045('0x20')](function(_0x293c1a){if(_0x293c1a){_0x5094d8[_0xf045('0x32')]=_['keys'](db[_0xf045('0xc4')][_0xf045('0x56')]);_0x5094d8[_0xf045('0x2f')]=_['keys'](_0xb5379d['query']);_0x5094d8[_0xf045('0x31')]=_[_0xf045('0x34')](_0x5094d8[_0xf045('0x32')],_0x5094d8[_0xf045('0x2f')]);_0x5d5d9b[_0xf045('0x33')]=_[_0xf045('0x34')](_0x5094d8['model'],qs['fields'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x35')]));_0x5d5d9b[_0xf045('0x33')]=_0x5d5d9b[_0xf045('0x33')]['length']?_0x5d5d9b[_0xf045('0x33')]:_0x5094d8[_0xf045('0x32')];if(!_0xb5379d[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x5d5d9b[_0xf045('0x1e')]=qs['limit'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x1e')]);_0x5d5d9b[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0xb5379d[_0xf045('0x2f')][_0xf045('0x1b')]);}_0x5d5d9b[_0xf045('0x39')]=qs['sort'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x3a')]);_0x5d5d9b[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0xb5379d[_0xf045('0x2f')],_0x5094d8[_0xf045('0x31')]));_0x5d5d9b[_0xf045('0x3b')][_0xf045('0x5b')]=_0x293c1a['id'];if(_0xb5379d[_0xf045('0x2f')][_0xf045('0x40')]){_0x5d5d9b['where']=_[_0xf045('0x3d')](_0x5d5d9b['where'],{'$or':_[_0xf045('0x2c')](_0x5d5d9b[_0xf045('0x33')],function(_0x33d377){var _0x284868={};_0x284868[_0x33d377]={'$like':'%'+_0xb5379d[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x284868;})});}_0x5d5d9b=_[_0xf045('0x3d')]({},_0x5d5d9b,_0xb5379d['options']);return db[_0xf045('0xc4')][_0xf045('0x1d')]({'where':_0x5d5d9b['where']})[_0xf045('0x20')](function(_0x28f3ad){_0x296460['count']=_0x28f3ad;if(_0xb5379d['query']['includeAll']){_0x5d5d9b['include']=[{'all':!![]}];}else{_0x5d5d9b[_0xf045('0x42')]=[{'model':db['CmContact'],'as':_0xf045('0xe2'),'required':![]},{'model':db[_0xf045('0xca')],'as':_0xf045('0x118'),'required':![]}];}return db[_0xf045('0xc4')][_0xf045('0x43')](_0x5d5d9b);})[_0xf045('0x20')](function(_0xa7df1d){_0x296460[_0xf045('0x57')]=_0xa7df1d;return _0x296460;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x4fb2b8,_0x5d5d9b))[_0xf045('0x17')](handleError(_0x4fb2b8,null));};exports['addAgents']=function(_0xcdcd9a,_0x4dbb33){return db['ChatWebsite'][_0xf045('0x47')]({'where':{'id':_0xcdcd9a[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x4dbb33,null))[_0xf045('0x20')](function(_0x11a8fd){if(_0x11a8fd){return _0x11a8fd[_0xf045('0x119')](_0xcdcd9a[_0xf045('0x50')][_0xf045('0x59')],_[_0xf045('0x11a')](_0xcdcd9a[_0xf045('0x50')],['ids','id'])||{})[_0xf045('0xbf')](function(_0x5a4f0e){for(var _0x1cafea=0x0;_0x1cafea<_0xcdcd9a[_0xf045('0x50')]['ids'][_0xf045('0x36')];_0x1cafea+=0x1){socket[_0xf045('0x11b')](_0xf045('0x11c'),{'UserId':Number(_0xcdcd9a[_0xf045('0x50')][_0xf045('0x59')][_0x1cafea]),'ChatWebsiteId':Number(_0xcdcd9a[_0xf045('0x45')]['id'])});}return _0x5a4f0e;});}})[_0xf045('0x20')](respondWithResult(_0x4dbb33,null))['catch'](handleError(_0x4dbb33,null));};exports[_0xf045('0x11d')]=function(_0x512fee,_0x5edb80){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x512fee['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x5edb80,null))[_0xf045('0x20')](function(_0x28c10c){if(_0x28c10c){return _0x28c10c[_0xf045('0x11d')](_0x512fee['query'][_0xf045('0x59')])['then'](function(){if(_[_0xf045('0x11e')](_0x512fee['query'][_0xf045('0x59')])){for(var _0xb9d797=0x0;_0xb9d797<_0x512fee[_0xf045('0x2f')]['ids'][_0xf045('0x36')];_0xb9d797+=0x1){socket[_0xf045('0x11b')]('userChatWebsite:remove',{'UserId':Number(_0x512fee[_0xf045('0x2f')]['ids'][_0xb9d797]),'ChatWebsiteId':Number(_0x512fee[_0xf045('0x45')]['id'])});}}else{socket['emit'](_0xf045('0x11f'),{'UserId':Number(_0x512fee[_0xf045('0x2f')][_0xf045('0x59')]),'ChatWebsiteId':Number(_0x512fee[_0xf045('0x45')]['id'])});}});}})[_0xf045('0x20')](respondWithStatusCode(_0x5edb80,null))[_0xf045('0x17')](handleError(_0x5edb80,null));};exports[_0xf045('0x120')]=function(_0x313885,_0x2d7631){var _0x4df0fd={};var _0x2bafcf={};var _0x360cfa;var _0x45a6fa;return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x313885[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2d7631,null))[_0xf045('0x20')](function(_0x955e75){if(_0x955e75){_0x360cfa=_0x955e75;_0x2bafcf[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0xe3')][_0xf045('0x56')]);_0x2bafcf[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x313885[_0xf045('0x2f')]);_0x2bafcf[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2bafcf['model'],_0x2bafcf['query']);_0x4df0fd['attributes']=_[_0xf045('0x34')](_0x2bafcf[_0xf045('0x32')],qs[_0xf045('0x35')](_0x313885['query'][_0xf045('0x35')]));_0x4df0fd[_0xf045('0x33')]=_0x4df0fd[_0xf045('0x33')][_0xf045('0x36')]?_0x4df0fd['attributes']:_0x2bafcf[_0xf045('0x32')];_0x4df0fd[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x313885['query'][_0xf045('0x3a')]);_0x4df0fd[_0xf045('0x3b')]=qs['filters'](_[_0xf045('0x3c')](_0x313885['query'],_0x2bafcf[_0xf045('0x31')]));if(_0x313885['query'][_0xf045('0x40')]){_0x4df0fd[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x4df0fd[_0xf045('0x3b')],{'$or':_['map'](_0x4df0fd[_0xf045('0x33')],function(_0x4ced92){var _0x4df646={};_0x4df646[_0x4ced92]={'$like':'%'+_0x313885[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x4df646;})});}_0x4df0fd=_[_0xf045('0x3d')]({},_0x4df0fd,_0x313885[_0xf045('0x46')]);return _0x360cfa['getAgents'](_0x4df0fd);}})[_0xf045('0x20')](function(_0xc2d67b){if(_0xc2d67b){_0x45a6fa=_0xc2d67b[_0xf045('0x36')];if(!_0x313885['query']['hasOwnProperty'](_0xf045('0x38'))){_0x4df0fd[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x313885['query'][_0xf045('0x1e')]);_0x4df0fd['offset']=qs[_0xf045('0x1b')](_0x313885[_0xf045('0x2f')][_0xf045('0x1b')]);}return _0x360cfa[_0xf045('0x120')](_0x4df0fd);}})[_0xf045('0x20')](function(_0x5c7fb1){if(_0x5c7fb1){return _0x5c7fb1?{'count':_0x45a6fa,'rows':_0x5c7fb1}:null;}})[_0xf045('0x20')](respondWithResult(_0x2d7631,null))[_0xf045('0x17')](handleError(_0x2d7631,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 429721d..f255ea9 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfe7=['hook','exports','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x30da93,_0x41846a){var _0x24c197=function(_0x5c4a25){while(--_0x5c4a25){_0x30da93['push'](_0x30da93['shift']());}};_0x24c197(++_0x41846a);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x4caeca,_0x463cf8){_0x4caeca=_0x4caeca-0x0;var _0x426b1f=_0xdfe7[_0x4caeca];return _0x426b1f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x7dfe('0x0'))['db'][_0x7dfe('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7dfe('0x2'),'afterUpdate':_0x7dfe('0x3'),'afterDestroy':_0x7dfe('0x4')};function emitEvent(_0xb0b7fb){return function(_0x527490,_0x2c07d2,_0x23ac4c){ChatWebsiteEvents['emit'](_0xb0b7fb+':'+_0x527490['id'],_0x527490);ChatWebsiteEvents[_0x7dfe('0x5')](_0xb0b7fb,_0x527490);_0x23ac4c(null);};}for(var e in events){if(events[_0x7dfe('0x6')](e)){var event=events[e];ChatWebsite[_0x7dfe('0x7')](e,emitEvent(event));}}module[_0x7dfe('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1e69=['save','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x297633,_0x285ed9){var _0x45ab91=function(_0x483cd9){while(--_0x483cd9){_0x297633['push'](_0x297633['shift']());}};_0x45ab91(++_0x285ed9);}(_0x1e69,0x85));var _0x91e6=function(_0x22133a,_0x21dfc2){_0x22133a=_0x22133a-0x0;var _0xffab4c=_0x1e69[_0x22133a];return _0xffab4c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x91e6('0x0'))['db'][_0x91e6('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91e6('0x2')](0x0);var events={'afterCreate':_0x91e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x192f10){return function(_0x351c1d,_0x2b53b6,_0x15545c){ChatWebsiteEvents[_0x91e6('0x4')](_0x192f10+':'+_0x351c1d['id'],_0x351c1d);ChatWebsiteEvents[_0x91e6('0x4')](_0x192f10,_0x351c1d);_0x15545c(null);};}for(var e in events){if(events[_0x91e6('0x5')](e)){var event=events[e];ChatWebsite[_0x91e6('0x6')](e,emitEvent(event));}}module[_0x91e6('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 645d9fe..1be79b6 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a2=['path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger','api','bluebird'];(function(_0x40bfbe,_0x5ae0e0){var _0x843489=function(_0x3b5cc3){while(--_0x3b5cc3){_0x40bfbe['push'](_0x40bfbe['shift']());}};_0x843489(++_0x5ae0e0);}(_0x91a2,0xe2));var _0x291a=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0x91a2[_0x3da707];return _0x342ee7;};'use strict';var _=require('lodash');var util=require(_0x291a('0x0'));var logger=require(_0x291a('0x1'))(_0x291a('0x2'));var moment=require('moment');var BPromise=require(_0x291a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x291a('0x4'));var rimraf=require(_0x291a('0x5'));var config=require('../../config/environment');var attributes=require(_0x291a('0x6'));module[_0x291a('0x7')]=function(_0x5c4a21,_0x197367){return _0x5c4a21['define'](_0x291a('0x8'),attributes,{'tableName':_0x291a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe086=['exports','define','chat_websites','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x23bc85,_0x19addc){var _0x177dfd=function(_0x134ab5){while(--_0x134ab5){_0x23bc85['push'](_0x23bc85['shift']());}};_0x177dfd(++_0x19addc);}(_0xe086,0xb7));var _0x6e08=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe086[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e08('0x0'))(_0x6e08('0x1'));var moment=require(_0x6e08('0x2'));var BPromise=require(_0x6e08('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e08('0x4'));var config=require(_0x6e08('0x5'));var attributes=require(_0x6e08('0x6'));module[_0x6e08('0x7')]=function(_0xe9a5bd,_0x37fbb3){return _0xe9a5bd[_0x6e08('0x8')]('ChatWebsite',attributes,{'tableName':_0x6e08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 317102e..8f00082 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28e8=['stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x544305,_0x1332c4){var _0x1e7318=function(_0x380e15){while(--_0x380e15){_0x544305['push'](_0x544305['shift']());}};_0x1e7318(++_0x1332c4);}(_0x28e8,0xa7));var _0x828e=function(_0x1e42c3,_0x2c1032){_0x1e42c3=_0x1e42c3-0x0;var _0x1d31bf=_0x28e8[_0x1e42c3];return _0x1d31bf;};'use strict';var _=require(_0x828e('0x0'));var util=require('util');var moment=require(_0x828e('0x1'));var BPromise=require('bluebird');var rs=require(_0x828e('0x2'));var fs=require('fs');var Redis=require(_0x828e('0x3'));var db=require(_0x828e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x828e('0x5'))(_0x828e('0x6'));var config=require(_0x828e('0x7'));var jayson=require(_0x828e('0x8'));var client=jayson['client'][_0x828e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x828e('0xa'),'port':0x18eb});var socket=require(_0x828e('0xb'))(new Redis(config[_0x828e('0xc')]));require('./chatWebsite.socket')[_0x828e('0xd')](socket);function respondWithRpcPromise(_0xb11a4b,_0x1c7417,_0x111f79){return new BPromise(function(_0x5e2291,_0x573bfb){return client['request'](_0xb11a4b,_0x111f79)['then'](function(_0x5ec56d){logger['info'](_0x828e('0xe'),_0x1c7417,_0x828e('0xf'));logger['debug'](_0x828e('0x10'),_0x1c7417,'request\x20sent',JSON[_0x828e('0x11')](_0x5ec56d));if(_0x5ec56d['error']){if(_0x5ec56d['error']['code']===0x1f4){logger['error'](_0x828e('0xe'),_0x1c7417,_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);return _0x573bfb(_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);}logger[_0x828e('0x12')](_0x828e('0xe'),_0x1c7417,_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);return _0x5e2291(_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);}else{logger[_0x828e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1c7417,_0x828e('0xf'));_0x5e2291(_0x5ec56d[_0x828e('0x15')][_0x828e('0x13')]);}})[_0x828e('0x16')](function(_0x42a97c){logger[_0x828e('0x12')](_0x828e('0xe'),_0x1c7417,_0x42a97c);_0x573bfb(_0x42a97c);});});} \ No newline at end of file +var _0xbf96=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird'];(function(_0x855caa,_0x5624fa){var _0x25488a=function(_0x4407bd){while(--_0x4407bd){_0x855caa['push'](_0x855caa['shift']());}};_0x25488a(++_0x5624fa);}(_0xbf96,0x1d8));var _0x6bf9=function(_0x4ec1bd,_0x2bd250){_0x4ec1bd=_0x4ec1bd-0x0;var _0x1ef159=_0xbf96[_0x4ec1bd];return _0x1ef159;};'use strict';var _=require('lodash');var util=require(_0x6bf9('0x0'));var moment=require(_0x6bf9('0x1'));var BPromise=require(_0x6bf9('0x2'));var rs=require(_0x6bf9('0x3'));var fs=require('fs');var Redis=require(_0x6bf9('0x4'));var db=require(_0x6bf9('0x5'))['db'];var utils=require(_0x6bf9('0x6'));var logger=require('../../config/logger')(_0x6bf9('0x7'));var config=require(_0x6bf9('0x8'));var jayson=require(_0x6bf9('0x9'));var client=jayson[_0x6bf9('0xa')]['http']({'port':0x232a});config[_0x6bf9('0xb')]=_[_0x6bf9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6bf9('0xd'))[_0x6bf9('0xe')](socket);function respondWithRpcPromise(_0x40a630,_0x1017d9,_0x11bf0f){return new BPromise(function(_0x4e839a,_0x1468b4){return client[_0x6bf9('0xf')](_0x40a630,_0x11bf0f)[_0x6bf9('0x10')](function(_0x4bd9d2){logger[_0x6bf9('0x11')](_0x6bf9('0x12'),_0x1017d9,_0x6bf9('0x13'));logger['debug'](_0x6bf9('0x14'),_0x1017d9,_0x6bf9('0x13'),JSON['stringify'](_0x4bd9d2));if(_0x4bd9d2[_0x6bf9('0x15')]){if(_0x4bd9d2[_0x6bf9('0x15')][_0x6bf9('0x16')]===0x1f4){logger[_0x6bf9('0x15')](_0x6bf9('0x12'),_0x1017d9,_0x4bd9d2[_0x6bf9('0x15')]['message']);return _0x1468b4(_0x4bd9d2[_0x6bf9('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1017d9,_0x4bd9d2[_0x6bf9('0x15')]['message']);return _0x4e839a(_0x4bd9d2[_0x6bf9('0x15')][_0x6bf9('0x17')]);}else{logger[_0x6bf9('0x11')](_0x6bf9('0x12'),_0x1017d9,_0x6bf9('0x13'));_0x4e839a(_0x4bd9d2[_0x6bf9('0x18')]['message']);}})['catch'](function(_0x3b345f){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1017d9,_0x3b345f);_0x1468b4(_0x3b345f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e0cdcb3..72016cf 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc420=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xc420,0x156));var _0x0c42=function(_0x40eadc,_0x37af8d){_0x40eadc=_0x40eadc-0x0;var _0x6963b4=_0xc420[_0x40eadc];return _0x6963b4;};'use strict';var ChatWebsiteEvents=require(_0x0c42('0x0'));var events=[_0x0c42('0x1'),_0x0c42('0x2'),'update'];function createListener(_0x560cb1,_0x377a9e){return function(_0x5cf9d6){_0x377a9e[_0x0c42('0x3')](_0x560cb1,_0x5cf9d6);};}function removeListener(_0x3d0032,_0x44efdd){return function(){ChatWebsiteEvents[_0x0c42('0x4')](_0x3d0032,_0x44efdd);};}exports[_0x0c42('0x5')]=function(_0x339210){for(var _0x1bd4ba=0x0,_0x2acf81=events[_0x0c42('0x6')];_0x1bd4ba<_0x2acf81;_0x1bd4ba++){var _0x170603=events[_0x1bd4ba];var _0x1ba181=createListener(_0x0c42('0x7')+_0x170603,_0x339210);ChatWebsiteEvents['on'](_0x170603,_0x1ba181);}}; \ No newline at end of file +var _0xc2fb=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x4da73e,_0x328d03){var _0x483788=function(_0x332d02){while(--_0x332d02){_0x4da73e['push'](_0x4da73e['shift']());}};_0x483788(++_0x328d03);}(_0xc2fb,0x141));var _0xbc2f=function(_0x3d22f4,_0x2dcd7c){_0x3d22f4=_0x3d22f4-0x0;var _0x3bba0a=_0xc2fb[_0x3d22f4];return _0x3bba0a;};'use strict';var ChatWebsiteEvents=require(_0xbc2f('0x0'));var events=[_0xbc2f('0x1'),_0xbc2f('0x2'),'update'];function createListener(_0x234810,_0xa385d1){return function(_0x145479){_0xa385d1[_0xbc2f('0x3')](_0x234810,_0x145479);};}function removeListener(_0xb71daa,_0x54d39a){return function(){ChatWebsiteEvents[_0xbc2f('0x4')](_0xb71daa,_0x54d39a);};}exports[_0xbc2f('0x5')]=function(_0x1731dd){for(var _0x51db5b=0x0,_0x273f2c=events[_0xbc2f('0x6')];_0x51db5b<_0x273f2c;_0x51db5b++){var _0xb98d95=events[_0x51db5b];var _0x39bd7f=createListener(_0xbc2f('0x7')+_0xb98d95,_0x1731dd);ChatWebsiteEvents['on'](_0xb98d95,_0x39bd7f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index b81a7d1..9a2f9fd 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe72=['isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','%s-%s','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','destroy','delete','removeDispositions','removeAgents','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get'];(function(_0x44dfea,_0x3a370e){var _0x5087ee=function(_0x49f066){while(--_0x49f066){_0x44dfea['push'](_0x44dfea['shift']());}};_0x5087ee(++_0x3a370e);}(_0xfe72,0x83));var _0x2fe7=function(_0x3bd041,_0xc4a1b1){_0x3bd041=_0x3bd041-0x0;var _0xf921fc=_0xfe72[_0x3bd041];return _0xf921fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2fe7('0x0'));var timeout=require(_0x2fe7('0x1'));var express=require(_0x2fe7('0x2'));var router=express['Router']();var fs_extra=require(_0x2fe7('0x3'));var auth=require(_0x2fe7('0x4'));var interaction=require(_0x2fe7('0x5'));var config=require(_0x2fe7('0x6'));var controller=require(_0x2fe7('0x7'));router[_0x2fe7('0x8')]('/',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xa')]);router[_0x2fe7('0x8')]('/describe',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xb')]);router[_0x2fe7('0x8')]('/:id',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xc')]);router[_0x2fe7('0x8')](_0x2fe7('0xd'),auth['isAuthenticated'](),controller[_0x2fe7('0xe')]);router[_0x2fe7('0x8')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['getAnswers']);router[_0x2fe7('0x8')]('/:id/logo',controller['getLogo']);router[_0x2fe7('0x8')](_0x2fe7('0x10'),controller[_0x2fe7('0x11')]);router[_0x2fe7('0x8')](_0x2fe7('0x12'),controller['getCustomerAvatar']);router[_0x2fe7('0x8')](_0x2fe7('0x13'),controller[_0x2fe7('0x14')]);router[_0x2fe7('0x8')]('/:id/interactions',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x15')]);router[_0x2fe7('0x8')](_0x2fe7('0x16'),controller[_0x2fe7('0x17')]);router[_0x2fe7('0x8')](_0x2fe7('0x18'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x19')]);router[_0x2fe7('0x8')]('/:id/proactive_actions',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1a')]);router[_0x2fe7('0x8')]('/:id/fields',controller[_0x2fe7('0x1b')]);router[_0x2fe7('0x8')](_0x2fe7('0x1c'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1d')]);router[_0x2fe7('0x8')](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1f')]);router[_0x2fe7('0x20')]('/',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x21')]);router['post'](_0x2fe7('0xd'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x22')]);router[_0x2fe7('0x20')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2fe7('0x23')]({'destination':function(_0x4b4a7d,_0x27d139,_0x470db1){_0x470db1(null,path[_0x2fe7('0x24')](config[_0x2fe7('0x25')],_0x2fe7('0x26')));},'filename':function(_0xaf79a1,_0x5845e8,_0x267362){_0x267362(null,util['format']('%s-%s',Date['now'](),_0x5845e8['originalname']));}})});router['post'](_0x2fe7('0x27'),upload[_0x2fe7('0x28')](_0x2fe7('0x29')),controller[_0x2fe7('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1df052,_0x311a85,_0x3c3579){_0x3c3579(null,path['join'](config[_0x2fe7('0x25')],_0x2fe7('0x2b')));},'filename':function(_0x12f713,_0x59136b,_0x34ec55){_0x34ec55(null,util[_0x2fe7('0x2c')](_0x2fe7('0x2d'),Date[_0x2fe7('0x2e')](),_0x59136b[_0x2fe7('0x2f')]));}})});router['post'](_0x2fe7('0x10'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52a87e,_0x2d0f95,_0x3a4cb8){_0x3a4cb8(null,path['join'](config[_0x2fe7('0x25')],_0x2fe7('0x2b')));},'filename':function(_0x161103,_0x1743a5,_0x5bb6af){_0x5bb6af(null,util[_0x2fe7('0x2c')](_0x2fe7('0x2d'),Date['now'](),_0x1743a5[_0x2fe7('0x2f')]));}})});router[_0x2fe7('0x20')](_0x2fe7('0x12'),upload[_0x2fe7('0x28')](_0x2fe7('0x29')),controller[_0x2fe7('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x77d17d,_0x59f8ad,_0x11ff55){_0x11ff55(null,path[_0x2fe7('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x527b03,_0x108e36,_0x392be8){_0x392be8(null,util['format']('%s-%s',Date[_0x2fe7('0x2e')](),_0x108e36[_0x2fe7('0x2f')]));}})});router[_0x2fe7('0x20')](_0x2fe7('0x13'),upload[_0x2fe7('0x28')]('file'),controller[_0x2fe7('0x31')]);router['post'](_0x2fe7('0x32'),controller[_0x2fe7('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3a9577,_0x292787,_0x44b5e6){const _0xfafcd=path[_0x2fe7('0x24')](config['root'],'server/files',_0x2fe7('0x34'),_0x2fe7('0x35'));fs_extra[_0x2fe7('0x36')](_0xfafcd,function(){_0x44b5e6(null,_0xfafcd);});},'filename':function(_0x1b7151,_0x6c0c31,_0x30f7a6){const _0x3ff4d1=_0x6c0c31[_0x2fe7('0x2f')][_0x2fe7('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37a14c=path['extname'](_0x3ff4d1);const _0x176c68=Date[_0x2fe7('0x2e')]()+'-'+_0x3ff4d1['replace'](_0x37a14c,'')+_0x37a14c;_0x30f7a6(null,_0x176c68);}})});router[_0x2fe7('0x20')](_0x2fe7('0x38'),offlineUploadMulter[_0x2fe7('0x39')](),controller['offline']);router[_0x2fe7('0x20')](_0x2fe7('0x3a'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3b')]);router['post'](_0x2fe7('0x18'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3c')]);router[_0x2fe7('0x20')](_0x2fe7('0x3d'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3e')]);router['post'](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller['addAgents']);router[_0x2fe7('0x3f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2fe7('0x40'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x41')]);router[_0x2fe7('0x42')](_0x2fe7('0xd'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x43')]);router[_0x2fe7('0x42')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['removeAnswers']);router[_0x2fe7('0x42')](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x44')]);module[_0x2fe7('0x45')]=router; \ No newline at end of file +var _0x3abe=['removeAnswers','/:id/users','removeAgents','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','index','get','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','server/files/images/avatars/','file','addAvatar','single','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','/:id','update','destroy','delete'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x3abe,0x19c));var _0xe3ab=function(_0x59bd9c,_0x16661d){_0x59bd9c=_0x59bd9c-0x0;var _0x305d18=_0x3abe[_0x59bd9c];return _0x305d18;};'use strict';var multer=require(_0xe3ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe3ab('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe3ab('0x2'));var auth=require(_0xe3ab('0x3'));var interaction=require(_0xe3ab('0x4'));var config=require('../../config/environment');var controller=require(_0xe3ab('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3ab('0x6')]);router[_0xe3ab('0x7')](_0xe3ab('0x8'),auth[_0xe3ab('0x9')](),controller['describe']);router[_0xe3ab('0x7')]('/:id',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xa')]);router[_0xe3ab('0x7')](_0xe3ab('0xb'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xc')]);router['get'](_0xe3ab('0xd'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xe')]);router[_0xe3ab('0x7')](_0xe3ab('0xf'),controller[_0xe3ab('0x10')]);router['get'](_0xe3ab('0x11'),controller[_0xe3ab('0x12')]);router[_0xe3ab('0x7')](_0xe3ab('0x13'),controller[_0xe3ab('0x14')]);router[_0xe3ab('0x7')](_0xe3ab('0x15'),controller[_0xe3ab('0x16')]);router[_0xe3ab('0x7')](_0xe3ab('0x17'),auth[_0xe3ab('0x9')](),controller['getInteractions']);router[_0xe3ab('0x7')](_0xe3ab('0x18'),controller['getSnippet']);router[_0xe3ab('0x7')](_0xe3ab('0x19'),auth['isAuthenticated'](),controller[_0xe3ab('0x1a')]);router['get'](_0xe3ab('0x1b'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x1c')]);router[_0xe3ab('0x7')](_0xe3ab('0x1d'),controller[_0xe3ab('0x1e')]);router[_0xe3ab('0x7')]('/:id/offline_messages',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x1f')]);router[_0xe3ab('0x7')]('/:id/users',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x20')]);router[_0xe3ab('0x21')]('/',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x22')]);router[_0xe3ab('0x21')]('/:id/dispositions',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x23')]);router[_0xe3ab('0x21')](_0xe3ab('0xd'),auth['isAuthenticated'](),controller[_0xe3ab('0x24')]);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0xa6091f,_0x5664bf,_0x3ee296){_0x3ee296(null,path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],_0xe3ab('0x28')));},'filename':function(_0x59f579,_0x5dd873,_0x3524d7){_0x3524d7(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0x5dd873[_0xe3ab('0x2c')]));}})});router[_0xe3ab('0x21')](_0xe3ab('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x32be26,_0x1f37e1,_0x23a6cc){_0x23a6cc(null,path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],_0xe3ab('0x2d')));},'filename':function(_0x1e257c,_0x57c660,_0x3f0cf6){_0x3f0cf6(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0x57c660[_0xe3ab('0x2c')]));}})});router['post']('/:id/avatar',upload['single'](_0xe3ab('0x2e')),controller[_0xe3ab('0x2f')]);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x4641d3,_0x4a5485,_0x5ef298){_0x5ef298(null,path[_0xe3ab('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x763741,_0xcb1623,_0x5b96eb){_0x5b96eb(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0xcb1623[_0xe3ab('0x2c')]));}})});router[_0xe3ab('0x21')](_0xe3ab('0x13'),upload[_0xe3ab('0x30')](_0xe3ab('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x4fb2c6,_0x458fc2,_0x5304b0){_0x5304b0(null,path['join'](config[_0xe3ab('0x27')],'server/files/images/avatars/'));},'filename':function(_0x47ecd5,_0x5b675a,_0x1ceac7){_0x1ceac7(null,util[_0xe3ab('0x29')]('%s-%s',Date[_0xe3ab('0x2b')](),_0x5b675a['originalname']));}})});router[_0xe3ab('0x21')](_0xe3ab('0x15'),upload[_0xe3ab('0x30')](_0xe3ab('0x2e')),controller[_0xe3ab('0x31')]);router[_0xe3ab('0x21')](_0xe3ab('0x32'),controller[_0xe3ab('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3d9350,_0x161d00,_0x2e91d9){const _0x1ce654=path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],'server/files',_0xe3ab('0x34'),'offline-chat');fs_extra[_0xe3ab('0x35')](_0x1ce654,function(){_0x2e91d9(null,_0x1ce654);});},'filename':function(_0x2d265b,_0x357a37,_0x2d72da){const _0x8cacaa=_0x357a37['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a64e4=path['extname'](_0x8cacaa);const _0x4b353a=Date[_0xe3ab('0x2b')]()+'-'+_0x8cacaa['replace'](_0x4a64e4,'')+_0x4a64e4;_0x2d72da(null,_0x4b353a);}})});router[_0xe3ab('0x21')](_0xe3ab('0x36'),offlineUploadMulter['any'](),controller[_0xe3ab('0x37')]);router[_0xe3ab('0x21')](_0xe3ab('0x17'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x38')]);router[_0xe3ab('0x21')]('/:id/applications',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x39')]);router[_0xe3ab('0x21')]('/:id/proactive_actions',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3a')]);router[_0xe3ab('0x21')]('/:id/users',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3b')]);router['put'](_0xe3ab('0x3c'),auth['isAuthenticated'](),controller[_0xe3ab('0x3d')]);router['delete'](_0xe3ab('0x3c'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3e')]);router[_0xe3ab('0x3f')](_0xe3ab('0xb'),auth[_0xe3ab('0x9')](),controller['removeDispositions']);router[_0xe3ab('0x3f')](_0xe3ab('0xd'),auth['isAuthenticated'](),controller[_0xe3ab('0x40')]);router['delete'](_0xe3ab('0x41'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x42')]);module[_0xe3ab('0x43')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 90407b0..18e50e6 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb234=['STRING','sequelize','exports','ENUM','AmazonAWS','Google'];(function(_0x5ecbe8,_0x42522f){var _0x1c6e21=function(_0x593f92){while(--_0x593f92){_0x5ecbe8['push'](_0x5ecbe8['shift']());}};_0x1c6e21(++_0x42522f);}(_0xb234,0x13f));var _0x4b23=function(_0xa49733,_0x3c465d){_0xa49733=_0xa49733-0x0;var _0x2084fb=_0xb234[_0xa49733];return _0x2084fb;};'use strict';var Sequelize=require(_0x4b23('0x0'));module[_0x4b23('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4b23('0x2')](_0x4b23('0x3'),_0x4b23('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x4b23('0x5')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc59=['sequelize','exports','STRING','Google'];(function(_0x483cec,_0x2ccfda){var _0xa1147f=function(_0x4fff48){while(--_0x4fff48){_0x483cec['push'](_0x483cec['shift']());}};_0xa1147f(++_0x2ccfda);}(_0xdc59,0x12c));var _0x9dc5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xdc59[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0x9dc5('0x0'));module[_0x9dc5('0x1')]={'name':{'type':Sequelize[_0x9dc5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x9dc5('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9dc5('0x2')]},'data2':{'type':Sequelize[_0x9dc5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b02934a..32ca98e 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3a8077,_0x13fd8f){var _0x3301d8=function(_0x330421){while(--_0x330421){_0x3a8077['push'](_0x3a8077['shift']());}};_0x3301d8(++_0x13fd8f);}(_0x2ef3,0xba));var _0x32ef=function(_0xbdb771,_0x4d845b){_0xbdb771=_0xbdb771-0x0;var _0x4baab6=_0x2ef3[_0xbdb771];return _0x4baab6;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x845027,_0x1bbaf3){var _0x449735=function(_0x3a28b7){while(--_0x3a28b7){_0x845027['push'](_0x845027['shift']());}};_0x449735(++_0x1bbaf3);}(_0x7a54,0x106));var _0x47a5=function(_0x535b81,_0x23b191){_0x535b81=_0x535b81-0x0;var _0xcbd02d=_0x7a54[_0x535b81];return _0xcbd02d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 2e68990..06e2580 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1f7=['CloudProvider','cloud_providers','lodash','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xc1f7,0xda));var _0x7c1f=function(_0x55fd26,_0x53ce4f){_0x55fd26=_0x55fd26-0x0;var _0x3dfb52=_0xc1f7[_0x55fd26];return _0x3dfb52;};'use strict';var _=require(_0x7c1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7c1f('0x1'));var BPromise=require(_0x7c1f('0x2'));var rp=require(_0x7c1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1f('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x7c1f('0x5')]=function(_0x5c8b73,_0x3bca99){return _0x5c8b73[_0x7c1f('0x6')](_0x7c1f('0x7'),attributes,{'tableName':_0x7c1f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9016=['path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d4d04,_0x17cc3e){var _0x24620d=function(_0x72c5fb){while(--_0x72c5fb){_0x1d4d04['push'](_0x1d4d04['shift']());}};_0x24620d(++_0x17cc3e);}(_0x9016,0x1b6));var _0x6901=function(_0x31debc,_0x3eedad){_0x31debc=_0x31debc-0x0;var _0x16b31a=_0x9016[_0x31debc];return _0x16b31a;};'use strict';var _=require('lodash');var util=require(_0x6901('0x0'));var logger=require(_0x6901('0x1'))(_0x6901('0x2'));var moment=require(_0x6901('0x3'));var BPromise=require(_0x6901('0x4'));var rp=require(_0x6901('0x5'));var fs=require('fs');var path=require(_0x6901('0x6'));var rimraf=require('rimraf');var config=require(_0x6901('0x7'));var attributes=require(_0x6901('0x8'));module[_0x6901('0x9')]=function(_0x2b251c,_0xaddc95){return _0x2b251c[_0x6901('0xa')](_0x6901('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index ccfab60..fb82166 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e27=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x650d07,_0xacc99e){var _0x5f5737=function(_0x5c83c2){while(--_0x5c83c2){_0x650d07['push'](_0x650d07['shift']());}};_0x5f5737(++_0xacc99e);}(_0x7e27,0xdd));var _0x77e2=function(_0x2acca6,_0x43dfc7){_0x2acca6=_0x2acca6-0x0;var _0x385d27=_0x7e27[_0x2acca6];return _0x385d27;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101e56,_0x137a61,_0x502153){return new BPromise(function(_0x3c2b3f,_0x2cdfa3){return client[_0x77e2('0xa')](_0x101e56,_0x502153)[_0x77e2('0xb')](function(_0x3802ce){logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');logger['debug'](_0x77e2('0xe'),_0x137a61,'request\x20sent',JSON[_0x77e2('0xf')](_0x3802ce));if(_0x3802ce[_0x77e2('0x10')]){if(_0x3802ce['error']['code']===0x1f4){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce['error'][_0x77e2('0x11')]);return _0x2cdfa3(_0x3802ce['error']['message']);}logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce[_0x77e2('0x10')][_0x77e2('0x11')]);return _0x3c2b3f(_0x3802ce[_0x77e2('0x10')]['message']);}else{logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');_0x3c2b3f(_0x3802ce[_0x77e2('0x12')][_0x77e2('0x11')]);}})[_0x77e2('0x13')](function(_0x1352c1){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x1352c1);_0x2cdfa3(_0x1352c1);});});} \ No newline at end of file +var _0x457b=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3c920d,_0x4aab37){var _0x4891e0=function(_0x3dea11){while(--_0x3dea11){_0x3c920d['push'](_0x3c920d['shift']());}};_0x4891e0(++_0x4aab37);}(_0x457b,0xca));var _0xb457=function(_0x19e57f,_0x4ae750){_0x19e57f=_0x19e57f-0x0;var _0x469556=_0x457b[_0x19e57f];return _0x469556;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523e05,_0x5b8ba2,_0x13632b){return new BPromise(function(_0x2182d6,_0x48388c){return client['request'](_0x523e05,_0x13632b)[_0xb457('0xc')](function(_0x3baee8){logger[_0xb457('0xd')](_0xb457('0xe'),_0x5b8ba2,_0xb457('0xf'));logger[_0xb457('0x10')](_0xb457('0x11'),_0x5b8ba2,_0xb457('0xf'),JSON[_0xb457('0x12')](_0x3baee8));if(_0x3baee8[_0xb457('0x13')]){if(_0x3baee8[_0xb457('0x13')][_0xb457('0x14')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);return _0x48388c(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}logger[_0xb457('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8['error'][_0xb457('0x15')]);return _0x2182d6(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}else{logger[_0xb457('0xd')]('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0xb457('0xf'));_0x2182d6(_0x3baee8[_0xb457('0x16')][_0xb457('0x15')]);}})[_0xb457('0x17')](function(_0x250a02){logger[_0xb457('0x13')](_0xb457('0xe'),_0x5b8ba2,_0x250a02);_0x48388c(_0x250a02);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index df8ad9c..008fafe 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c0c=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x6c0c,0x18f));var _0xc6c0=function(_0x1c5266,_0x49986c){_0x1c5266=_0x1c5266-0x0;var _0x52b115=_0x6c0c[_0x1c5266];return _0x52b115;};'use strict';var multer=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc6c0('0x2'));var router=express['Router']();var fs_extra=require(_0xc6c0('0x3'));var auth=require(_0xc6c0('0x4'));var interaction=require(_0xc6c0('0x5'));var config=require(_0xc6c0('0x6'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0x8')]);router[_0xc6c0('0x9')](_0xc6c0('0xa'),auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xb')]);router[_0xc6c0('0xc')]('/',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xd')]);router['put']('/:id',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xe')]);router[_0xc6c0('0xf')](_0xc6c0('0xa'),auth[_0xc6c0('0x7')](),controller[_0xc6c0('0x10')]);module[_0xc6c0('0x11')]=router; \ No newline at end of file +var _0xe021=['path','connect-timeout','../../components/auth/service','../../config/environment','./cloudProvider.controller','index','get','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe021,0x10e));var _0x1e02=function(_0x251260,_0x9c45a5){_0x251260=_0x251260-0x0;var _0xf09928=_0xe021[_0x251260];return _0xf09928;};'use strict';var multer=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var path=require(_0x1e02('0x2'));var timeout=require(_0x1e02('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1e02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e02('0x5'));var controller=require(_0x1e02('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e02('0x7')]);router[_0x1e02('0x8')]('/:id',auth[_0x1e02('0x9')](),controller[_0x1e02('0xa')]);router[_0x1e02('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e02('0xc')]);router[_0x1e02('0xd')](_0x1e02('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1e02('0xe'),auth[_0x1e02('0x9')](),controller[_0x1e02('0xf')]);module[_0x1e02('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 2d87f6e..66372e2 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe62a=['exports','STRING','name','sequelize'];(function(_0x10504e,_0x4e282d){var _0x339624=function(_0x372c9c){while(--_0x372c9c){_0x10504e['push'](_0x10504e['shift']());}};_0x339624(++_0x4e282d);}(_0xe62a,0x16b));var _0xae62=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe62a[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xae62('0x0'));module[_0xae62('0x1')]={'name':{'type':Sequelize[_0xae62('0x2')],'unique':_0xae62('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xae62('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xae62('0x2')]},'fax':{'type':Sequelize[_0xae62('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xae62('0x2')]},'city':{'type':Sequelize[_0xae62('0x2')]},'country':{'type':Sequelize[_0xae62('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xae62('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xae62('0x2')]},'description':{'type':Sequelize[_0xae62('0x2')]}}; \ No newline at end of file +var _0x6b9d=['name','sequelize','exports','STRING'];(function(_0x5d2da5,_0x44c684){var _0x46df8c=function(_0xec9e01){while(--_0xec9e01){_0x5d2da5['push'](_0x5d2da5['shift']());}};_0x46df8c(++_0x44c684);}(_0x6b9d,0xed));var _0xd6b9=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x6b9d[_0x57dc85];return _0x563a2e;};'use strict';var Sequelize=require(_0xd6b9('0x0'));module[_0xd6b9('0x1')]={'name':{'type':Sequelize[_0xd6b9('0x2')],'unique':_0xd6b9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd6b9('0x2')]},'companyId':{'type':Sequelize[_0xd6b9('0x2')]},'website':{'type':Sequelize[_0xd6b9('0x2')]},'phone':{'type':Sequelize[_0xd6b9('0x2')]},'fax':{'type':Sequelize[_0xd6b9('0x2')]},'type':{'type':Sequelize[_0xd6b9('0x2')]},'street':{'type':Sequelize[_0xd6b9('0x2')]},'postalCode':{'type':Sequelize[_0xd6b9('0x2')]},'city':{'type':Sequelize[_0xd6b9('0x2')]},'country':{'type':Sequelize[_0xd6b9('0x2')]},'email':{'type':Sequelize[_0xd6b9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd6b9('0x2')]},'sPostalCode':{'type':Sequelize[_0xd6b9('0x2')]},'sCity':{'type':Sequelize[_0xd6b9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6b9('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1aaaafd..9d147d3 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53c2=['options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','sort','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','end','error','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','order','where','pick','filters','map','filter','merge'];(function(_0xb789ef,_0x1b2701){var _0x57d304=function(_0x5c0b53){while(--_0x5c0b53){_0xb789ef['push'](_0xb789ef['shift']());}};_0x57d304(++_0x1b2701);}(_0x53c2,0x122));var _0x253c=function(_0xbd8d83,_0x1451ff){_0xbd8d83=_0xbd8d83-0x0;var _0x21b6bf=_0x53c2[_0xbd8d83];return _0x21b6bf;};'use strict';var emlformat=require(_0x253c('0x0'));var rimraf=require(_0x253c('0x1'));var zipdir=require(_0x253c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x253c('0x3'));var moment=require(_0x253c('0x4'));var BPromise=require(_0x253c('0x5'));var Mustache=require(_0x253c('0x6'));var util=require(_0x253c('0x7'));var path=require(_0x253c('0x8'));var sox=require(_0x253c('0x9'));var csv=require(_0x253c('0xa'));var ejs=require(_0x253c('0xb'));var fs=require('fs');var fs_extra=require(_0x253c('0xc'));var _=require(_0x253c('0xd'));var squel=require(_0x253c('0xe'));var crypto=require(_0x253c('0xf'));var jsforce=require(_0x253c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x253c('0x11'));var Redis=require('ioredis');var authService=require(_0x253c('0x12'));var qs=require(_0x253c('0x13'));var as=require(_0x253c('0x14'));var hardwareService=require(_0x253c('0x15'));var logger=require('../../config/logger')(_0x253c('0x16'));var utils=require('../../config/utils');var config=require(_0x253c('0x17'));var licenseUtil=require(_0x253c('0x18'));var db=require(_0x253c('0x19'))['db'];function respondWithStatusCode(_0x638b51,_0x362c0c){_0x362c0c=_0x362c0c||0xcc;return function(_0x1b74d8){if(_0x1b74d8){return _0x638b51[_0x253c('0x1a')](_0x362c0c);}return _0x638b51[_0x253c('0x1b')](_0x362c0c)['end']();};}function respondWithResult(_0x355b72,_0x5e20be){_0x5e20be=_0x5e20be||0xc8;return function(_0x167cc9){if(_0x167cc9){return _0x355b72[_0x253c('0x1b')](_0x5e20be)[_0x253c('0x1c')](_0x167cc9);}};}function respondWithFilteredResult(_0x31ea08,_0x4cd3c8){return function(_0x3d9a32){if(_0x3d9a32){var _0x498935=typeof _0x4cd3c8[_0x253c('0x1d')]===_0x253c('0x1e')&&typeof _0x4cd3c8['limit']===_0x253c('0x1e');var _0x543026=_0x3d9a32[_0x253c('0x1f')];var _0x48b8b9=_0x498935?0x0:_0x4cd3c8[_0x253c('0x1d')];var _0x370c6e=_0x498935?_0x3d9a32[_0x253c('0x1f')]:_0x4cd3c8[_0x253c('0x1d')]+_0x4cd3c8[_0x253c('0x20')];var _0x172cc6;if(_0x370c6e>=_0x543026){_0x370c6e=_0x543026;_0x172cc6=0xc8;}else{_0x172cc6=0xce;}_0x31ea08[_0x253c('0x1b')](_0x172cc6);return _0x31ea08[_0x253c('0x21')](_0x253c('0x22'),_0x48b8b9+'-'+_0x370c6e+'/'+_0x543026)['json'](_0x3d9a32);}return null;};}function patchUpdates(_0x2168ff){return function(_0x112295){try{jsonpatch[_0x253c('0x23')](_0x112295,_0x2168ff,!![]);}catch(_0x3329ee){return BPromise[_0x253c('0x24')](_0x3329ee);}return _0x112295['save']();};}function saveUpdates(_0x4b293d,_0xe21392){return function(_0x15eb73){if(_0x15eb73){return _0x15eb73['update'](_0x4b293d)[_0x253c('0x25')](function(_0x28189d){return _0x28189d;});}return null;};}function removeEntity(_0x1fed74,_0x5b53e8){return function(_0x9b908){if(_0x9b908){return _0x9b908[_0x253c('0x26')]()[_0x253c('0x25')](function(){var _0x243acf=_0x9b908[_0x253c('0x27')]({'plain':!![]});var _0x38d9d3=_0x253c('0x28');return db[_0x253c('0x29')][_0x253c('0x26')]({'where':{'type':_0x38d9d3,'resourceId':_0x243acf['id']}})[_0x253c('0x25')](function(){return _0x9b908;});})['then'](function(){_0x1fed74['status'](0xcc)[_0x253c('0x2a')]();});}};}function handleEntityNotFound(_0x211659,_0x4519bf){return function(_0x173ac7){if(!_0x173ac7){_0x211659['sendStatus'](0x194);}return _0x173ac7;};}function handleError(_0x4cff1b,_0x5aafaf){_0x5aafaf=_0x5aafaf||0x1f4;return function(_0x19da89){logger[_0x253c('0x2b')](_0x19da89['stack']);if(_0x19da89[_0x253c('0x2c')]){delete _0x19da89[_0x253c('0x2c')];}_0x4cff1b[_0x253c('0x1b')](_0x5aafaf)[_0x253c('0x2d')](_0x19da89);};}exports['index']=function(_0x310d36,_0xb55b4a){var _0x59a187={},_0x3b35c7={},_0x313e8f={'count':0x0,'rows':[]};return db[_0x253c('0x2e')][_0x253c('0x2f')]()['then'](function(_0x527340){_0x3b35c7[_0x253c('0x30')]=_[_0x253c('0x31')](_0x527340);_0x3b35c7[_0x253c('0x32')]=_[_0x253c('0x31')](_0x310d36[_0x253c('0x32')]);_0x3b35c7['filters']=_[_0x253c('0x33')](_0x3b35c7[_0x253c('0x30')],_0x3b35c7[_0x253c('0x32')]);_0x59a187[_0x253c('0x34')]=_[_0x253c('0x33')](_0x3b35c7[_0x253c('0x30')],qs[_0x253c('0x35')](_0x310d36['query'][_0x253c('0x35')]));_0x59a187[_0x253c('0x34')]=_0x59a187['attributes']['length']?_0x59a187[_0x253c('0x34')]:_0x3b35c7[_0x253c('0x30')];if(!_0x310d36[_0x253c('0x32')]['hasOwnProperty'](_0x253c('0x36'))){_0x59a187['limit']=qs[_0x253c('0x20')](_0x310d36[_0x253c('0x32')][_0x253c('0x20')]);_0x59a187[_0x253c('0x1d')]=qs[_0x253c('0x1d')](_0x310d36[_0x253c('0x32')][_0x253c('0x1d')]);}_0x59a187[_0x253c('0x37')]=qs['sort'](_0x310d36[_0x253c('0x32')]['sort']);_0x59a187[_0x253c('0x38')]=qs['filters'](_[_0x253c('0x39')](_0x310d36[_0x253c('0x32')],_0x3b35c7[_0x253c('0x3a')]),_0x527340);if(_0x310d36[_0x253c('0x32')]['filter']){_0x59a187[_0x253c('0x38')]=_['merge'](_0x59a187[_0x253c('0x38')],{'$or':_[_0x253c('0x3b')](_0x59a187[_0x253c('0x34')],function(_0xa52b11){var _0x56a7f9={};_0x56a7f9[_0xa52b11]={'$like':'%'+_0x310d36[_0x253c('0x32')][_0x253c('0x3c')]+'%'};return _0x56a7f9;})});}_0x59a187=_[_0x253c('0x3d')]({},_0x59a187,_0x310d36[_0x253c('0x3e')]);var _0x323978={'where':_0x59a187[_0x253c('0x38')]};return db['CmCompany'][_0x253c('0x1f')](_0x323978)[_0x253c('0x25')](function(_0x43cfa7){_0x313e8f[_0x253c('0x1f')]=_0x43cfa7;if(_0x310d36[_0x253c('0x32')][_0x253c('0x3f')]){_0x59a187[_0x253c('0x40')]=[{'all':!![]}];}return db[_0x253c('0x2e')][_0x253c('0x41')](_0x59a187);})['then'](function(_0x9389ef){_0x313e8f[_0x253c('0x42')]=_0x9389ef;return _0x313e8f;})[_0x253c('0x25')](respondWithFilteredResult(_0xb55b4a,_0x59a187))[_0x253c('0x43')](handleError(_0xb55b4a,null));})[_0x253c('0x43')](handleError(_0xb55b4a,null));};exports[_0x253c('0x44')]=function(_0x3405ae,_0x32f239){var _0x5c7f4f={'raw':![],'where':{'id':_0x3405ae[_0x253c('0x45')]['id']}},_0x47d9d1={};_0x47d9d1[_0x253c('0x30')]=_[_0x253c('0x31')](db[_0x253c('0x2e')]['rawAttributes']);_0x47d9d1[_0x253c('0x32')]=_['keys'](_0x3405ae['query']);_0x47d9d1[_0x253c('0x3a')]=_[_0x253c('0x33')](_0x47d9d1['model'],_0x47d9d1[_0x253c('0x32')]);_0x5c7f4f[_0x253c('0x34')]=_[_0x253c('0x33')](_0x47d9d1[_0x253c('0x30')],qs[_0x253c('0x35')](_0x3405ae['query'][_0x253c('0x35')]));_0x5c7f4f[_0x253c('0x34')]=_0x5c7f4f[_0x253c('0x34')][_0x253c('0x46')]?_0x5c7f4f['attributes']:_0x47d9d1[_0x253c('0x30')];if(_0x3405ae[_0x253c('0x32')][_0x253c('0x3f')]){_0x5c7f4f[_0x253c('0x40')]=[{'all':!![]}];}_0x5c7f4f=_[_0x253c('0x3d')]({},_0x5c7f4f,_0x3405ae[_0x253c('0x3e')]);return db[_0x253c('0x2e')]['find'](_0x5c7f4f)[_0x253c('0x25')](handleEntityNotFound(_0x32f239,null))['then'](respondWithResult(_0x32f239,null))[_0x253c('0x43')](handleError(_0x32f239,null));};exports['create']=function(_0xe92478,_0x45407e){return db[_0x253c('0x2e')][_0x253c('0x47')](_0xe92478[_0x253c('0x48')],{})[_0x253c('0x25')](function(_0x1a1ea1){var _0x971d94=_0xe92478[_0x253c('0x49')]['get']({'plain':!![]});if(!_0x971d94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x971d94[_0x253c('0x4a')]===_0x253c('0x49')){var _0x12f84c=_0x1a1ea1['get']({'plain':!![]});var _0x3207ff=_0x253c('0x28');return db[_0x253c('0x4b')][_0x253c('0x4c')]({'where':{'name':_0x3207ff,'userProfileId':_0x971d94[_0x253c('0x4d')]},'raw':!![]})['then'](function(_0x13a982){if(_0x13a982&&_0x13a982[_0x253c('0x4e')]===0x0){return db[_0x253c('0x29')][_0x253c('0x47')]({'name':_0x12f84c['name'],'resourceId':_0x12f84c['id'],'type':_0x13a982[_0x253c('0x2c')],'sectionId':_0x13a982['id']},{})['then'](function(){return _0x1a1ea1;});}else{return _0x1a1ea1;}})[_0x253c('0x43')](function(_0x4c2567){logger['error'](_0x253c('0x4f'),_0x4c2567);throw _0x4c2567;});}return _0x1a1ea1;})[_0x253c('0x25')](respondWithResult(_0x45407e,0xc9))[_0x253c('0x43')](handleError(_0x45407e,null));};exports['update']=function(_0x117648,_0x51dd2d){if(_0x117648['body']['id']){delete _0x117648[_0x253c('0x48')]['id'];}return db[_0x253c('0x2e')]['find']({'where':{'id':_0x117648['params']['id']}})[_0x253c('0x25')](handleEntityNotFound(_0x51dd2d,null))[_0x253c('0x25')](saveUpdates(_0x117648[_0x253c('0x48')],null))[_0x253c('0x25')](respondWithResult(_0x51dd2d,null))['catch'](handleError(_0x51dd2d,null));};exports[_0x253c('0x26')]=function(_0x28ae8d,_0x17a4f1){return db[_0x253c('0x2e')][_0x253c('0x4c')]({'where':{'id':_0x28ae8d[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x17a4f1,null))[_0x253c('0x25')](removeEntity(_0x17a4f1,null))['catch'](handleError(_0x17a4f1,null));};exports[_0x253c('0x2f')]=function(_0x440cb6,_0x5dbf76){return db[_0x253c('0x2e')]['describe']()['then'](respondWithResult(_0x5dbf76,null))[_0x253c('0x43')](handleError(_0x5dbf76,null));};exports[_0x253c('0x50')]=function(_0x4d5fc2,_0x50de1f,_0x33f8b8){return db[_0x253c('0x51')]['find']({'where':{'id':_0x4d5fc2[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x50de1f,null))[_0x253c('0x25')](function(_0x3b3a4e){if(_0x3b3a4e){return _0x3b3a4e[_0x253c('0x50')](_0x4d5fc2[_0x253c('0x48')][_0x253c('0x52')],_[_0x253c('0x53')](_0x4d5fc2[_0x253c('0x48')],[_0x253c('0x52'),'id'])||{});}})[_0x253c('0x25')](respondWithResult(_0x50de1f,null))[_0x253c('0x43')](handleError(_0x50de1f,null));};exports[_0x253c('0x54')]=function(_0x480aa5,_0x380f5b,_0x2c41e1){var _0x2905b7={};var _0x2e657f={};var _0x55ba58;var _0x34f479;return db[_0x253c('0x2e')][_0x253c('0x55')]({'where':{'id':_0x480aa5[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x380f5b,null))[_0x253c('0x25')](function(_0x517ed7){if(_0x517ed7){_0x55ba58=_0x517ed7;_0x2e657f[_0x253c('0x30')]=_[_0x253c('0x31')](db[_0x253c('0x51')][_0x253c('0x56')]);_0x2e657f[_0x253c('0x32')]=_[_0x253c('0x31')](_0x480aa5[_0x253c('0x32')]);_0x2e657f[_0x253c('0x3a')]=_[_0x253c('0x33')](_0x2e657f[_0x253c('0x30')],_0x2e657f[_0x253c('0x32')]);_0x2905b7['attributes']=_[_0x253c('0x33')](_0x2e657f[_0x253c('0x30')],qs[_0x253c('0x35')](_0x480aa5[_0x253c('0x32')][_0x253c('0x35')]));_0x2905b7[_0x253c('0x34')]=_0x2905b7['attributes'][_0x253c('0x46')]?_0x2905b7[_0x253c('0x34')]:_0x2e657f[_0x253c('0x30')];_0x2905b7[_0x253c('0x37')]=qs[_0x253c('0x57')](_0x480aa5['query'][_0x253c('0x57')]);_0x2905b7[_0x253c('0x38')]=qs[_0x253c('0x3a')](_[_0x253c('0x39')](_0x480aa5[_0x253c('0x32')],_0x2e657f[_0x253c('0x3a')]));if(_0x480aa5[_0x253c('0x32')]['filter']){_0x2905b7[_0x253c('0x38')]=_['merge'](_0x2905b7[_0x253c('0x38')],{'$or':_['map'](_0x2905b7['attributes'],function(_0x40350a){var _0x29601f={};_0x29601f[_0x40350a]={'$like':'%'+_0x480aa5['query'][_0x253c('0x3c')]+'%'};return _0x29601f;})});}_0x2905b7=_[_0x253c('0x3d')]({},_0x2905b7,_0x480aa5[_0x253c('0x3e')]);return _0x55ba58['getContacts'](_0x2905b7);}})['then'](function(_0x5c8d55){if(_0x5c8d55){_0x34f479=_0x5c8d55[_0x253c('0x46')];if(!_0x480aa5[_0x253c('0x32')]['hasOwnProperty']('nolimit')){_0x2905b7[_0x253c('0x20')]=qs[_0x253c('0x20')](_0x480aa5[_0x253c('0x32')][_0x253c('0x20')]);_0x2905b7[_0x253c('0x1d')]=qs['offset'](_0x480aa5[_0x253c('0x32')][_0x253c('0x1d')]);}return _0x55ba58[_0x253c('0x54')](_0x2905b7);}})['then'](function(_0x5b0967){if(_0x5b0967){return _0x5b0967?{'count':_0x34f479,'rows':_0x5b0967}:null;}})[_0x253c('0x25')](respondWithResult(_0x380f5b,null))[_0x253c('0x43')](handleError(_0x380f5b,null));}; \ No newline at end of file +var _0x5252=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','Companies','end','error','stack','name','send','index','describe','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','CmCompany','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','CmContact','eml-format','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x3b1893,_0x146f1b){var _0x568540=function(_0x332c78){while(--_0x332c78){_0x3b1893['push'](_0x3b1893['shift']());}};_0x568540(++_0x146f1b);}(_0x5252,0xf2));var _0x2525=function(_0x4c0ebb,_0x3125c4){_0x4c0ebb=_0x4c0ebb-0x0;var _0x16a483=_0x5252[_0x4c0ebb];return _0x16a483;};'use strict';var emlformat=require(_0x2525('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2525('0x1'));var rp=require('request-promise');var moment=require(_0x2525('0x2'));var BPromise=require(_0x2525('0x3'));var Mustache=require(_0x2525('0x4'));var util=require(_0x2525('0x5'));var path=require(_0x2525('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2525('0x7'));var fs=require('fs');var fs_extra=require(_0x2525('0x8'));var _=require(_0x2525('0x9'));var squel=require(_0x2525('0xa'));var crypto=require(_0x2525('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2525('0xc'));var toCsv=require(_0x2525('0xd'));var querystring=require(_0x2525('0xe'));var Papa=require(_0x2525('0xf'));var Redis=require(_0x2525('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2525('0x11'))(_0x2525('0x12'));var utils=require(_0x2525('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2525('0x14'));var db=require(_0x2525('0x15'))['db'];function respondWithStatusCode(_0x3e9aea,_0x24b438){_0x24b438=_0x24b438||0xcc;return function(_0x457699){if(_0x457699){return _0x3e9aea[_0x2525('0x16')](_0x24b438);}return _0x3e9aea[_0x2525('0x17')](_0x24b438)['end']();};}function respondWithResult(_0x229b72,_0x633e0){_0x633e0=_0x633e0||0xc8;return function(_0x52260d){if(_0x52260d){return _0x229b72[_0x2525('0x17')](_0x633e0)[_0x2525('0x18')](_0x52260d);}};}function respondWithFilteredResult(_0x5b84ef,_0x295091){return function(_0x2ca852){if(_0x2ca852){var _0x3feb33=typeof _0x295091[_0x2525('0x19')]===_0x2525('0x1a')&&typeof _0x295091[_0x2525('0x1b')]===_0x2525('0x1a');var _0x35a69c=_0x2ca852[_0x2525('0x1c')];var _0x153a71=_0x3feb33?0x0:_0x295091['offset'];var _0x333b8e=_0x3feb33?_0x2ca852[_0x2525('0x1c')]:_0x295091[_0x2525('0x19')]+_0x295091[_0x2525('0x1b')];var _0x41072d;if(_0x333b8e>=_0x35a69c){_0x333b8e=_0x35a69c;_0x41072d=0xc8;}else{_0x41072d=0xce;}_0x5b84ef[_0x2525('0x17')](_0x41072d);return _0x5b84ef['set']('Content-Range',_0x153a71+'-'+_0x333b8e+'/'+_0x35a69c)[_0x2525('0x18')](_0x2ca852);}return null;};}function patchUpdates(_0x2add3b){return function(_0x4e3977){try{jsonpatch[_0x2525('0x1d')](_0x4e3977,_0x2add3b,!![]);}catch(_0x1145eb){return BPromise[_0x2525('0x1e')](_0x1145eb);}return _0x4e3977[_0x2525('0x1f')]();};}function saveUpdates(_0xcdeb9b,_0x1f3fcc){return function(_0x423e8c){if(_0x423e8c){return _0x423e8c[_0x2525('0x20')](_0xcdeb9b)[_0x2525('0x21')](function(_0x565f44){return _0x565f44;});}return null;};}function removeEntity(_0x8480cc,_0x1ad600){return function(_0x2a010a){if(_0x2a010a){return _0x2a010a[_0x2525('0x22')]()[_0x2525('0x21')](function(){var _0x1e683a=_0x2a010a['get']({'plain':!![]});var _0x20a510=_0x2525('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x20a510,'resourceId':_0x1e683a['id']}})['then'](function(){return _0x2a010a;});})[_0x2525('0x21')](function(){_0x8480cc['status'](0xcc)[_0x2525('0x24')]();});}};}function handleEntityNotFound(_0xe4a574,_0x1c7c2c){return function(_0x354da2){if(!_0x354da2){_0xe4a574[_0x2525('0x16')](0x194);}return _0x354da2;};}function handleError(_0x2fd657,_0x12d63a){_0x12d63a=_0x12d63a||0x1f4;return function(_0x25ce0e){logger[_0x2525('0x25')](_0x25ce0e[_0x2525('0x26')]);if(_0x25ce0e[_0x2525('0x27')]){delete _0x25ce0e[_0x2525('0x27')];}_0x2fd657[_0x2525('0x17')](_0x12d63a)[_0x2525('0x28')](_0x25ce0e);};}exports[_0x2525('0x29')]=function(_0xe68a67,_0x53848f){var _0x1051f7={},_0x4efa89={},_0x266ee={'count':0x0,'rows':[]};return db['CmCompany'][_0x2525('0x2a')]()[_0x2525('0x21')](function(_0x2a3dc6){_0x4efa89['model']=_[_0x2525('0x2b')](_0x2a3dc6);_0x4efa89[_0x2525('0x2c')]=_['keys'](_0xe68a67[_0x2525('0x2c')]);_0x4efa89[_0x2525('0x2d')]=_['intersection'](_0x4efa89[_0x2525('0x2e')],_0x4efa89[_0x2525('0x2c')]);_0x1051f7[_0x2525('0x2f')]=_['intersection'](_0x4efa89[_0x2525('0x2e')],qs[_0x2525('0x30')](_0xe68a67[_0x2525('0x2c')]['fields']));_0x1051f7[_0x2525('0x2f')]=_0x1051f7[_0x2525('0x2f')]['length']?_0x1051f7['attributes']:_0x4efa89[_0x2525('0x2e')];if(!_0xe68a67[_0x2525('0x2c')][_0x2525('0x31')](_0x2525('0x32'))){_0x1051f7[_0x2525('0x1b')]=qs[_0x2525('0x1b')](_0xe68a67['query'][_0x2525('0x1b')]);_0x1051f7[_0x2525('0x19')]=qs['offset'](_0xe68a67['query']['offset']);}_0x1051f7[_0x2525('0x33')]=qs[_0x2525('0x34')](_0xe68a67['query'][_0x2525('0x34')]);_0x1051f7[_0x2525('0x35')]=qs[_0x2525('0x2d')](_[_0x2525('0x36')](_0xe68a67[_0x2525('0x2c')],_0x4efa89[_0x2525('0x2d')]),_0x2a3dc6);if(_0xe68a67[_0x2525('0x2c')][_0x2525('0x37')]){_0x1051f7[_0x2525('0x35')]=_[_0x2525('0x38')](_0x1051f7[_0x2525('0x35')],{'$or':_[_0x2525('0x39')](_0x1051f7['attributes'],function(_0x4f9613){var _0x49f394={};_0x49f394[_0x4f9613]={'$like':'%'+_0xe68a67[_0x2525('0x2c')]['filter']+'%'};return _0x49f394;})});}_0x1051f7=_[_0x2525('0x38')]({},_0x1051f7,_0xe68a67[_0x2525('0x3a')]);var _0x46a84e={'where':_0x1051f7['where']};return db['CmCompany'][_0x2525('0x1c')](_0x46a84e)[_0x2525('0x21')](function(_0x3262e7){_0x266ee[_0x2525('0x1c')]=_0x3262e7;if(_0xe68a67['query'][_0x2525('0x3b')]){_0x1051f7[_0x2525('0x3c')]=[{'all':!![]}];}return db[_0x2525('0x3d')]['findAll'](_0x1051f7);})[_0x2525('0x21')](function(_0x44f3da){_0x266ee[_0x2525('0x3e')]=_0x44f3da;return _0x266ee;})[_0x2525('0x21')](respondWithFilteredResult(_0x53848f,_0x1051f7))['catch'](handleError(_0x53848f,null));})[_0x2525('0x3f')](handleError(_0x53848f,null));};exports[_0x2525('0x40')]=function(_0x5eb16d,_0x527231){var _0x9ca01a={'raw':![],'where':{'id':_0x5eb16d[_0x2525('0x41')]['id']}},_0x3a611c={};_0x3a611c[_0x2525('0x2e')]=_[_0x2525('0x2b')](db[_0x2525('0x3d')][_0x2525('0x42')]);_0x3a611c[_0x2525('0x2c')]=_[_0x2525('0x2b')](_0x5eb16d[_0x2525('0x2c')]);_0x3a611c[_0x2525('0x2d')]=_[_0x2525('0x43')](_0x3a611c['model'],_0x3a611c[_0x2525('0x2c')]);_0x9ca01a[_0x2525('0x2f')]=_[_0x2525('0x43')](_0x3a611c[_0x2525('0x2e')],qs[_0x2525('0x30')](_0x5eb16d[_0x2525('0x2c')][_0x2525('0x30')]));_0x9ca01a[_0x2525('0x2f')]=_0x9ca01a[_0x2525('0x2f')][_0x2525('0x44')]?_0x9ca01a[_0x2525('0x2f')]:_0x3a611c[_0x2525('0x2e')];if(_0x5eb16d[_0x2525('0x2c')][_0x2525('0x3b')]){_0x9ca01a[_0x2525('0x3c')]=[{'all':!![]}];}_0x9ca01a=_[_0x2525('0x38')]({},_0x9ca01a,_0x5eb16d[_0x2525('0x3a')]);return db[_0x2525('0x3d')][_0x2525('0x45')](_0x9ca01a)[_0x2525('0x21')](handleEntityNotFound(_0x527231,null))['then'](respondWithResult(_0x527231,null))['catch'](handleError(_0x527231,null));};exports[_0x2525('0x46')]=function(_0x3a79c0,_0x4a140e){return db[_0x2525('0x3d')][_0x2525('0x46')](_0x3a79c0[_0x2525('0x47')],{})[_0x2525('0x21')](function(_0x31f492){var _0x21d827=_0x3a79c0[_0x2525('0x48')]['get']({'plain':!![]});if(!_0x21d827)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21d827[_0x2525('0x49')]===_0x2525('0x48')){var _0x4242dc=_0x31f492['get']({'plain':!![]});var _0x2c073c=_0x2525('0x23');return db[_0x2525('0x4a')]['find']({'where':{'name':_0x2c073c,'userProfileId':_0x21d827['userProfileId']},'raw':!![]})['then'](function(_0xa76e2b){if(_0xa76e2b&&_0xa76e2b[_0x2525('0x4b')]===0x0){return db[_0x2525('0x4c')]['create']({'name':_0x4242dc[_0x2525('0x27')],'resourceId':_0x4242dc['id'],'type':_0xa76e2b['name'],'sectionId':_0xa76e2b['id']},{})[_0x2525('0x21')](function(){return _0x31f492;});}else{return _0x31f492;}})['catch'](function(_0x16e106){logger[_0x2525('0x25')](_0x2525('0x4d'),_0x16e106);throw _0x16e106;});}return _0x31f492;})[_0x2525('0x21')](respondWithResult(_0x4a140e,0xc9))[_0x2525('0x3f')](handleError(_0x4a140e,null));};exports[_0x2525('0x20')]=function(_0x31be0b,_0xc3bbbb){if(_0x31be0b[_0x2525('0x47')]['id']){delete _0x31be0b['body']['id'];}return db[_0x2525('0x3d')][_0x2525('0x45')]({'where':{'id':_0x31be0b[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0xc3bbbb,null))[_0x2525('0x21')](saveUpdates(_0x31be0b[_0x2525('0x47')],null))['then'](respondWithResult(_0xc3bbbb,null))[_0x2525('0x3f')](handleError(_0xc3bbbb,null));};exports[_0x2525('0x22')]=function(_0x558806,_0x158059){return db['CmCompany'][_0x2525('0x45')]({'where':{'id':_0x558806[_0x2525('0x41')]['id']}})[_0x2525('0x21')](handleEntityNotFound(_0x158059,null))['then'](removeEntity(_0x158059,null))[_0x2525('0x3f')](handleError(_0x158059,null));};exports['describe']=function(_0x3308ff,_0x18573c){return db[_0x2525('0x3d')][_0x2525('0x2a')]()[_0x2525('0x21')](respondWithResult(_0x18573c,null))['catch'](handleError(_0x18573c,null));};exports['addContacts']=function(_0x1d80ce,_0x52655d,_0x318ca7){return db['CmContact'][_0x2525('0x45')]({'where':{'id':_0x1d80ce[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0x52655d,null))['then'](function(_0x343c34){if(_0x343c34){return _0x343c34[_0x2525('0x4e')](_0x1d80ce[_0x2525('0x47')][_0x2525('0x4f')],_[_0x2525('0x50')](_0x1d80ce[_0x2525('0x47')],['ids','id'])||{});}})[_0x2525('0x21')](respondWithResult(_0x52655d,null))[_0x2525('0x3f')](handleError(_0x52655d,null));};exports[_0x2525('0x51')]=function(_0x5db492,_0x15e627,_0x419af9){var _0x5bc07f={};var _0x5f2fb9={};var _0x5bc64c;var _0x199b52;return db['CmCompany']['findOne']({'where':{'id':_0x5db492[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0x15e627,null))['then'](function(_0x3855fd){if(_0x3855fd){_0x5bc64c=_0x3855fd;_0x5f2fb9[_0x2525('0x2e')]=_[_0x2525('0x2b')](db[_0x2525('0x52')][_0x2525('0x42')]);_0x5f2fb9[_0x2525('0x2c')]=_[_0x2525('0x2b')](_0x5db492['query']);_0x5f2fb9[_0x2525('0x2d')]=_[_0x2525('0x43')](_0x5f2fb9[_0x2525('0x2e')],_0x5f2fb9[_0x2525('0x2c')]);_0x5bc07f[_0x2525('0x2f')]=_[_0x2525('0x43')](_0x5f2fb9[_0x2525('0x2e')],qs[_0x2525('0x30')](_0x5db492[_0x2525('0x2c')][_0x2525('0x30')]));_0x5bc07f['attributes']=_0x5bc07f[_0x2525('0x2f')][_0x2525('0x44')]?_0x5bc07f['attributes']:_0x5f2fb9[_0x2525('0x2e')];_0x5bc07f[_0x2525('0x33')]=qs[_0x2525('0x34')](_0x5db492[_0x2525('0x2c')][_0x2525('0x34')]);_0x5bc07f[_0x2525('0x35')]=qs['filters'](_[_0x2525('0x36')](_0x5db492[_0x2525('0x2c')],_0x5f2fb9[_0x2525('0x2d')]));if(_0x5db492[_0x2525('0x2c')][_0x2525('0x37')]){_0x5bc07f['where']=_[_0x2525('0x38')](_0x5bc07f['where'],{'$or':_[_0x2525('0x39')](_0x5bc07f[_0x2525('0x2f')],function(_0x1b06f1){var _0x520cc1={};_0x520cc1[_0x1b06f1]={'$like':'%'+_0x5db492[_0x2525('0x2c')][_0x2525('0x37')]+'%'};return _0x520cc1;})});}_0x5bc07f=_[_0x2525('0x38')]({},_0x5bc07f,_0x5db492[_0x2525('0x3a')]);return _0x5bc64c['getContacts'](_0x5bc07f);}})[_0x2525('0x21')](function(_0x5d3dd1){if(_0x5d3dd1){_0x199b52=_0x5d3dd1[_0x2525('0x44')];if(!_0x5db492[_0x2525('0x2c')][_0x2525('0x31')]('nolimit')){_0x5bc07f[_0x2525('0x1b')]=qs['limit'](_0x5db492['query']['limit']);_0x5bc07f['offset']=qs[_0x2525('0x19')](_0x5db492[_0x2525('0x2c')][_0x2525('0x19')]);}return _0x5bc64c['getContacts'](_0x5bc07f);}})[_0x2525('0x21')](function(_0x655aad){if(_0x655aad){return _0x655aad?{'count':_0x199b52,'rows':_0x655aad}:null;}})['then'](respondWithResult(_0x15e627,null))['catch'](handleError(_0x15e627,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ff7da5f..bbc138b 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc88=['exports','cm_companies','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0xfc88,0x1b2));var _0x8fc8=function(_0x1a5724,_0x1535ee){_0x1a5724=_0x1a5724-0x0;var _0x1cc99e=_0xfc88[_0x1a5724];return _0x1cc99e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8fc8('0x0'))(_0x8fc8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fc8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fc8('0x3'));var config=require(_0x8fc8('0x4'));var attributes=require(_0x8fc8('0x5'));module[_0x8fc8('0x6')]=function(_0x4d2f3a,_0x8a6152){return _0x4d2f3a['define']('CmCompany',attributes,{'tableName':_0x8fc8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9539=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x138688,_0x186edf){var _0x24b567=function(_0x519609){while(--_0x519609){_0x138688['push'](_0x138688['shift']());}};_0x24b567(++_0x186edf);}(_0x9539,0x179));var _0x9953=function(_0x5438d7,_0x19e07a){_0x5438d7=_0x5438d7-0x0;var _0x2519dd=_0x9539[_0x5438d7];return _0x2519dd;};'use strict';var _=require(_0x9953('0x0'));var util=require(_0x9953('0x1'));var logger=require(_0x9953('0x2'))(_0x9953('0x3'));var moment=require(_0x9953('0x4'));var BPromise=require(_0x9953('0x5'));var rp=require(_0x9953('0x6'));var fs=require('fs');var path=require(_0x9953('0x7'));var rimraf=require(_0x9953('0x8'));var config=require(_0x9953('0x9'));var attributes=require(_0x9953('0xa'));module[_0x9953('0xb')]=function(_0x52ec4f,_0x5dcc0d){return _0x52ec4f[_0x9953('0xc')](_0x9953('0xd'),attributes,{'tableName':_0x9953('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index fb9adb3..3cbd76d 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4a3=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46d13a,_0x21cd98){var _0x2c9e6a=function(_0x256a2d){while(--_0x256a2d){_0x46d13a['push'](_0x46d13a['shift']());}};_0x2c9e6a(++_0x21cd98);}(_0xe4a3,0x95));var _0x3e4a=function(_0x174bc8,_0x3d7c6e){_0x174bc8=_0x174bc8-0x0;var _0x4ebd5f=_0xe4a3[_0x174bc8];return _0x4ebd5f;};'use strict';var _=require(_0x3e4a('0x0'));var util=require('util');var moment=require(_0x3e4a('0x1'));var BPromise=require(_0x3e4a('0x2'));var rs=require(_0x3e4a('0x3'));var fs=require('fs');var Redis=require(_0x3e4a('0x4'));var db=require(_0x3e4a('0x5'))['db'];var utils=require(_0x3e4a('0x6'));var logger=require(_0x3e4a('0x7'))('rpc');var config=require(_0x3e4a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e4a('0x9')][_0x3e4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aaf3b,_0x1d99b6,_0x285870){return new BPromise(function(_0x27d6cc,_0x3ae3ee){return client[_0x3e4a('0xb')](_0x1aaf3b,_0x285870)['then'](function(_0x3b4bb6){logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x1d99b6,_0x3e4a('0xe'));logger['debug'](_0x3e4a('0xf'),_0x1d99b6,_0x3e4a('0xe'),JSON[_0x3e4a('0x10')](_0x3b4bb6));if(_0x3b4bb6[_0x3e4a('0x11')]){if(_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x12')]===0x1f4){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x1d99b6,_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x3ae3ee(_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x13')]);}logger[_0x3e4a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1d99b6,_0x3b4bb6[_0x3e4a('0x11')]['message']);return _0x27d6cc(_0x3b4bb6[_0x3e4a('0x11')]['message']);}else{logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x1d99b6,_0x3e4a('0xe'));_0x27d6cc(_0x3b4bb6['result'][_0x3e4a('0x13')]);}})[_0x3e4a('0x14')](function(_0x14db0b){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x1d99b6,_0x14db0b);_0x3ae3ee(_0x14db0b);});});} \ No newline at end of file +var _0x5b12=['message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x334688,_0xf68c2c){var _0x42dc15=function(_0x17f90a){while(--_0x17f90a){_0x334688['push'](_0x334688['shift']());}};_0x42dc15(++_0xf68c2c);}(_0x5b12,0x120));var _0x25b1=function(_0x26cc10,_0x24dd3b){_0x26cc10=_0x26cc10-0x0;var _0xb7cbec=_0x5b12[_0x26cc10];return _0xb7cbec;};'use strict';var _=require(_0x25b1('0x0'));var util=require('util');var moment=require(_0x25b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x25b1('0x3'));var logger=require(_0x25b1('0x4'))('rpc');var config=require(_0x25b1('0x5'));var jayson=require(_0x25b1('0x6'));var client=jayson['client'][_0x25b1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x515bdc,_0x3ef2a8,_0xa07613){return new BPromise(function(_0x46e462,_0x1ca7c7){return client[_0x25b1('0x8')](_0x515bdc,_0xa07613)[_0x25b1('0x9')](function(_0x359245){logger[_0x25b1('0xa')](_0x25b1('0xb'),_0x3ef2a8,_0x25b1('0xc'));logger[_0x25b1('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3ef2a8,'request\x20sent',JSON['stringify'](_0x359245));if(_0x359245[_0x25b1('0xe')]){if(_0x359245['error'][_0x25b1('0xf')]===0x1f4){logger[_0x25b1('0xe')](_0x25b1('0xb'),_0x3ef2a8,_0x359245[_0x25b1('0xe')][_0x25b1('0x10')]);return _0x1ca7c7(_0x359245['error']['message']);}logger[_0x25b1('0xe')]('CmCompany,\x20%s,\x20%s',_0x3ef2a8,_0x359245[_0x25b1('0xe')][_0x25b1('0x10')]);return _0x46e462(_0x359245['error'][_0x25b1('0x10')]);}else{logger[_0x25b1('0xa')](_0x25b1('0xb'),_0x3ef2a8,_0x25b1('0xc'));_0x46e462(_0x359245[_0x25b1('0x11')][_0x25b1('0x10')]);}})[_0x25b1('0x12')](function(_0x52a127){logger[_0x25b1('0xe')]('CmCompany,\x20%s,\x20%s',_0x3ef2a8,_0x52a127);_0x1ca7c7(_0x52a127);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 83320cc..a14050b 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b51=['describe','/:id','show','/:id/contacts','post','create','addContacts','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x24c308,_0x5f4765){var _0x5de5ae=function(_0x340d56){while(--_0x340d56){_0x24c308['push'](_0x24c308['shift']());}};_0x5de5ae(++_0x5f4765);}(_0x0b51,0xfd));var _0x10b5=function(_0x538c48,_0x169ec5){_0x538c48=_0x538c48-0x0;var _0x2fc4e4=_0x0b51[_0x538c48];return _0x2fc4e4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x10b5('0x0'));var timeout=require(_0x10b5('0x1'));var express=require('express');var router=express[_0x10b5('0x2')]();var fs_extra=require(_0x10b5('0x3'));var auth=require(_0x10b5('0x4'));var interaction=require(_0x10b5('0x5'));var config=require('../../config/environment');var controller=require(_0x10b5('0x6'));router[_0x10b5('0x7')]('/',auth[_0x10b5('0x8')](),controller[_0x10b5('0x9')]);router[_0x10b5('0x7')](_0x10b5('0xa'),auth['isAuthenticated'](),controller[_0x10b5('0xb')]);router[_0x10b5('0x7')](_0x10b5('0xc'),auth['isAuthenticated'](),controller[_0x10b5('0xd')]);router[_0x10b5('0x7')](_0x10b5('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x10b5('0xf')]('/',auth[_0x10b5('0x8')](),controller[_0x10b5('0x10')]);router[_0x10b5('0xf')]('/:id/contacts',auth[_0x10b5('0x8')](),controller[_0x10b5('0x11')]);router['put'](_0x10b5('0xc'),auth[_0x10b5('0x8')](),controller[_0x10b5('0x12')]);router[_0x10b5('0x13')](_0x10b5('0xc'),auth[_0x10b5('0x8')](),controller[_0x10b5('0x14')]);module[_0x10b5('0x15')]=router; \ No newline at end of file +var _0x470c=['put','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x470c,0x8e));var _0xc470=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x470c[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xc470('0x0'));var util=require(_0xc470('0x1'));var path=require('path');var timeout=require(_0xc470('0x2'));var express=require(_0xc470('0x3'));var router=express['Router']();var fs_extra=require(_0xc470('0x4'));var auth=require(_0xc470('0x5'));var interaction=require(_0xc470('0x6'));var config=require(_0xc470('0x7'));var controller=require(_0xc470('0x8'));router['get']('/',auth[_0xc470('0x9')](),controller[_0xc470('0xa')]);router[_0xc470('0xb')]('/describe',auth[_0xc470('0x9')](),controller['describe']);router['get'](_0xc470('0xc'),auth[_0xc470('0x9')](),controller[_0xc470('0xd')]);router[_0xc470('0xb')](_0xc470('0xe'),auth[_0xc470('0x9')](),controller['getContacts']);router[_0xc470('0xf')]('/',auth[_0xc470('0x9')](),controller[_0xc470('0x10')]);router['post'](_0xc470('0xe'),auth['isAuthenticated'](),controller[_0xc470('0x11')]);router[_0xc470('0x12')]('/:id',auth[_0xc470('0x9')](),controller['update']);router['delete']('/:id',auth[_0xc470('0x9')](),controller['destroy']);module[_0xc470('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 862aaee..2f4e270 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1475=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x14ad92,_0x3b4315){var _0x41ceae=function(_0x252cd1){while(--_0x252cd1){_0x14ad92['push'](_0x14ad92['shift']());}};_0x41ceae(++_0x3b4315);}(_0x1475,0x8a));var _0x5147=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x1475[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require(_0x5147('0x0'));var Sequelize=require(_0x5147('0x1'));module[_0x5147('0x2')]={'firstName':{'type':Sequelize[_0x5147('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5147('0x3')]},'postalCode':{'type':Sequelize[_0x5147('0x3')]},'city':{'type':Sequelize[_0x5147('0x3')]},'country':{'type':Sequelize[_0x5147('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5147('0x3')]},'description':{'type':Sequelize[_0x5147('0x4')]},'phone':{'type':Sequelize[_0x5147('0x3')]},'mobile':{'type':Sequelize[_0x5147('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5147('0x3')]},'url':{'type':Sequelize[_0x5147('0x3')]},'facebook':{'type':Sequelize[_0x5147('0x3')]},'fb_data':{'type':Sequelize[_0x5147('0x3')]},'twitter':{'type':Sequelize[_0x5147('0x3')]},'skype':{'type':Sequelize[_0x5147('0x3')]},'teams':{'type':Sequelize[_0x5147('0x3')]},'viber':{'type':Sequelize[_0x5147('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5147('0x3')]},'telegram':{'type':Sequelize[_0x5147('0x3')]},'UserId':{'type':Sequelize[_0x5147('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5147('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5147('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8744=['sequelize','exports','STRING','INTEGER','DATE','NOW','lodash'];(function(_0x4ca288,_0x254dd8){var _0x2362c1=function(_0x5504d8){while(--_0x5504d8){_0x4ca288['push'](_0x4ca288['shift']());}};_0x2362c1(++_0x254dd8);}(_0x8744,0x172));var _0x4874=function(_0xa70262,_0x32b588){_0xa70262=_0xa70262-0x0;var _0x285242=_0x8744[_0xa70262];return _0x285242;};'use strict';var _=require(_0x4874('0x0'));var Sequelize=require(_0x4874('0x1'));module[_0x4874('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x4874('0x3')]},'street':{'type':Sequelize[_0x4874('0x3')]},'postalCode':{'type':Sequelize[_0x4874('0x3')]},'city':{'type':Sequelize[_0x4874('0x3')]},'country':{'type':Sequelize[_0x4874('0x3')]},'dateOfBirth':{'type':Sequelize[_0x4874('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4874('0x3')]},'mobile':{'type':Sequelize[_0x4874('0x3')]},'fax':{'type':Sequelize[_0x4874('0x3')]},'email':{'type':Sequelize[_0x4874('0x3')]},'url':{'type':Sequelize[_0x4874('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4874('0x3')]},'twitter':{'type':Sequelize[_0x4874('0x3')]},'skype':{'type':Sequelize[_0x4874('0x3')]},'teams':{'type':Sequelize[_0x4874('0x3')]},'viber':{'type':Sequelize[_0x4874('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x4874('0x3')]},'UserId':{'type':Sequelize[_0x4874('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4874('0x5')],'defaultValue':Sequelize[_0x4874('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index f89cf8c..43928c5 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5542=['SELECT','clone','DESC','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','tags','columnName','displayName','analytics','alias','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','spread','show','params','$and','findAll','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','values','phone','rawAttributes','intersection','getTags','setTags','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','path','parse','import','binding','firstName','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','getJourney','chat','openchannel','fax','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','VoiceCallReport','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','key','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','startCase','Owner','all','flatten','sortBy','reverse','slice','bluebird','util','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','index','describe','keys','startsWith','cf_','CmCustomField','findOne','trimStart','length','fieldType','type','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','field','color','from','select','cm_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','dateOfBirth','datetime','buildExpression','text','start','hasOwnProperty','filter','isNil','Contact','push','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id'];(function(_0x22eebc,_0x267306){var _0x5e060e=function(_0x44697e){while(--_0x44697e){_0x22eebc['push'](_0x22eebc['shift']());}};_0x5e060e(++_0x267306);}(_0x5542,0x1cb));var _0x2554=function(_0x441fae,_0x3ab2ee){_0x441fae=_0x441fae-0x0;var _0x189025=_0x5542[_0x441fae];return _0x189025;};'use strict';var moment=require('moment');var BPromise=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x2554('0x2'));var squel=require(_0x2554('0x3'));var Papa=require(_0x2554('0x4'));var Redis=require('ioredis');var qs=require(_0x2554('0x5'));var as=require(_0x2554('0x6'));var logger=require(_0x2554('0x7'))('api');var config=require('../../config/environment');var db=require(_0x2554('0x8'))['db'];config[_0x2554('0x9')]=_['defaults'](config[_0x2554('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2554('0xa'))(new Redis(config[_0x2554('0x9')]));require(_0x2554('0xb'))[_0x2554('0xc')](socket);function respondWithResult(_0x5f53ef,_0x539520){_0x539520=_0x539520||0xc8;return function(_0x58a4fd){if(_0x58a4fd){return _0x5f53ef[_0x2554('0xd')](_0x539520)[_0x2554('0xe')](_0x58a4fd);}};}function respondWithFilteredResult(_0x2ddd1c,_0x4e399a){return function(_0x500898){if(_0x500898){var _0x3b80a1=typeof _0x4e399a[_0x2554('0xf')]===_0x2554('0x10')&&typeof _0x4e399a[_0x2554('0x11')]===_0x2554('0x10');var _0x52512c=_0x500898[_0x2554('0x12')];var _0xbe3d65=_0x3b80a1?0x0:_0x4e399a[_0x2554('0xf')];var _0x56ffec=_0x3b80a1?_0x500898[_0x2554('0x12')]:_0x4e399a['offset']+_0x4e399a[_0x2554('0x11')];var _0x1b8b9a;if(_0x56ffec>=_0x52512c){_0x56ffec=_0x52512c;_0x1b8b9a=0xc8;}else{_0x1b8b9a=0xce;}_0x2ddd1c[_0x2554('0xd')](_0x1b8b9a);return _0x2ddd1c[_0x2554('0x13')](_0x2554('0x14'),_0xbe3d65+'-'+_0x56ffec+'/'+_0x52512c)[_0x2554('0xe')](_0x500898);}return null;};}function saveUpdates(_0x333770){return function(_0x1069c9){if(_0x1069c9){return _0x1069c9[_0x2554('0x15')](_0x333770)[_0x2554('0x16')](function(_0x49602e){return _0x49602e;});}return null;};}function removeEntity(_0x8ca9d2){return function(_0x1e0ef7){if(_0x1e0ef7){return _0x1e0ef7[_0x2554('0x17')]()[_0x2554('0x16')](function(){_0x8ca9d2['status'](0xcc)[_0x2554('0x18')]();});}};}function handleEntityNotFound(_0x2872c1){return function(_0x390b07){if(!_0x390b07){_0x2872c1['sendStatus'](0x194);}return _0x390b07;};}function handleError(_0xa7bbc3,_0x20affc){_0x20affc=_0x20affc||0x1f4;return function(_0x2aec4d){logger[_0x2554('0x19')](_0x2aec4d['stack']);if(_0x2aec4d['name']){delete _0x2aec4d[_0x2554('0x1a')];}_0xa7bbc3['status'](_0x20affc)['send'](_0x2aec4d);};}exports[_0x2554('0x1b')]=function(_0x3e2b79,_0x3f32fd){var _0x3c80ab={},_0x4bb313={},_0x1f1280={'count':0x0,'rows':[]};return db['CmContact'][_0x2554('0x1c')]()['then'](function(_0x268438){var _0x3306b6=[];for(var _0x198331=0x0;_0x1983310x1){_0x498bfd['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2554('0x5a')](_0x4e6625),null);}else{if(qs[_0x2554('0x5b')](_0x4e6625)){_0x498bfd['or'](_0x2554('0x5c'),_0x4e6625+'%');_0x498bfd['or'](_0x2554('0x5d'),_0x4e6625+'%');_0x498bfd['or'](_0x2554('0x5e'),_0x4e6625+'%');_0x498bfd['or'](_0x2554('0x5f'),_0x4e6625+'%');}else if(qs[_0x2554('0x60')](_0x4e6625)){_0x498bfd['or'](_0x2554('0x61'),_0x4e6625+'%');}else{_0x498bfd['or'](_0x2554('0x62'),'%'+_0x4e6625+'%');_0x498bfd['or']('c.lastName\x20LIKE\x20?','%'+_0x4e6625+'%');_0x498bfd['or']('c.email\x20LIKE\x20?','%'+_0x4e6625+'%');}}}}_0x32789c[_0x2554('0x2e')](_0x498bfd);_0x32789c[_0x2554('0x63')](_0x2554('0x64'));var _0x519019={'type':db['Sequelize']['QueryTypes'][_0x2554('0x65')],'raw':!![]};var _0x451e3c=_0x32789c[_0x2554('0x66')]()[_0x2554('0x30')](_0x2554('0x64'));if(_0x3c80ab['order']){_0x3c80ab[_0x2554('0x2c')][_0x2554('0x45')](function(_0x36308c){_0x32789c[_0x2554('0x2c')]('c.'+_0x36308c[0x0],_0x36308c[0x1]===_0x2554('0x67')?![]:!![]);});}if(!_[_0x2554('0x53')](_0x54ec0e)){_0x32789c['having'](_0x2aa073);_0x451e3c[_0x2554('0x2e')](_0x2554('0x68'),_0x54ec0e);}BPromise[_0x2554('0x69')]()['then'](function(){if(!_0xacfcd5)return;if(_0x3e2b79['user'][_0x2554('0x6a')]!==_0x2554('0x6b'))return;if(!_[_0x2554('0x6c')](_0xacfcd5['conditions'],[_0x2554('0x30'),'User'])){return _0x3e2b79[_0x2554('0x6d')][_0x2554('0x6e')]({'attributes':['id'],'raw':!![]})[_0x2554('0x16')](function(_0x248e58){if(_['isEmpty'](_0x248e58)){_0x451e3c[_0x2554('0x2e')](_0x2554('0x6f'));_0x32789c[_0x2554('0x2e')](_0x2554('0x6f'));}else{_0x451e3c[_0x2554('0x2e')](_0x2554('0x54'),_[_0x2554('0x44')](_0x248e58,'id'));_0x32789c[_0x2554('0x2e')](_0x2554('0x54'),_[_0x2554('0x44')](_0x248e58,'id'));}});}})[_0x2554('0x16')](function(){if(_0x3e2b79[_0x2554('0x6d')][_0x2554('0x6a')]===_0x2554('0x6b')&&!_0xacfcd5&&!_0x3e2b79[_0x2554('0x27')][_0x2554('0x70')])return[];return db[_0x2554('0x71')]['query'](_0x451e3c[_0x2554('0x72')](),_0x519019);})[_0x2554('0x16')](function(_0x4d1aee){_0x1f1280['count']=_0x4d1aee[_0x2554('0x23')];if(_0x1f1280[_0x2554('0x12')]===0x0)return[];return db[_0x2554('0x71')]['query'](_0x2ad2ff[_0x2554('0x72')](),_0x519019)[_0x2554('0x16')](function(_0x244e06){_0xedd7ec=_[_0x2554('0x73')](_0x244e06,'id');_0x519019=_[_0x2554('0x74')](_0x519019,{'model':db[_0x2554('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e2b79[_0x2554('0x27')][_0x2554('0x2a')]){_0x3c80ab[_0x2554('0x29')][_0x2554('0x45')](function(_0x3ca789){_0x32789c[_0x2554('0x30')]('c.'+_0x3ca789);});}else{_0x32789c[_0x2554('0x30')]('c.id');_0x32789c['field'](_0x2554('0x76'));_0x32789c[_0x2554('0x30')](_0x2554('0x77'));_0x32789c[_0x2554('0x30')](_0x2554('0x78'));_0x32789c['field'](_0x2554('0x79'));_0x32789c[_0x2554('0x30')](_0x2554('0x7a'));_0x32789c['field'](_0x2554('0x7b'));_0x32789c[_0x2554('0x30')](_0x2554('0x7c'));_0x32789c[_0x2554('0x30')]('c.createdAt');_0x32789c['field'](_0x2554('0x7d'));_0x32789c[_0x2554('0x30')](_0x2554('0x7e'));_0x32789c[_0x2554('0x30')](_0x2554('0x7f'),_0x2554('0x80'));}if(_0x3c80ab[_0x2554('0x11')])_0x32789c[_0x2554('0x11')](_0x3c80ab[_0x2554('0x11')]);if(_0x3c80ab[_0x2554('0xf')])_0x32789c[_0x2554('0xf')](_0x3c80ab[_0x2554('0xf')]);return db[_0x2554('0x71')][_0x2554('0x27')](_0x32789c[_0x2554('0x72')](),_0x519019);});})[_0x2554('0x16')](function(_0x112567){_0x112567[_0x2554('0x45')](function(_0x5caeba){if(_0x5caeba[_0x2554('0x80')]){_0x5caeba[_0x2554('0x81')]=[];_0x5caeba['TagIds'][_0x2554('0x43')](',')[_0x2554('0x45')](function(_0x24d213){_0x5caeba[_0x2554('0x81')][_0x2554('0x52')](_0xedd7ec[_0x24d213]);});}delete _0x5caeba[_0x2554('0x80')];});_0x1f1280[_0x2554('0x82')]=_0x112567;return _0x1f1280;})[_0x2554('0x16')](respondWithFilteredResult(_0x3f32fd,_0x3c80ab));})[_0x2554('0x83')](handleError(_0x3f32fd,null));};exports[_0x2554('0x17')]=function(_0x4af9c2,_0x47b55f){return db[_0x2554('0x75')][_0x2554('0x40')]({'where':{'id':_0x4af9c2['params']['id']}})['then'](handleEntityNotFound(_0x47b55f,null))[_0x2554('0x16')](removeEntity(_0x47b55f,null))[_0x2554('0x83')](handleError(_0x47b55f,null));};exports[_0x2554('0x1c')]=function(_0x1b9e84,_0x16dbea){return db[_0x2554('0x75')][_0x2554('0x1c')]()['then'](function(_0x1da676){delete _0x1da676[_0x2554('0x84')];for(var _0x23eb55=0x0;_0x23eb55=_0x1c48eb){_0x2dc187=_0x1c48eb;_0x4f0cd8=0xc8;}else{_0x4f0cd8=0xce;}_0x569f57['status'](_0x4f0cd8);return _0x569f57[_0x8781('0x16')](_0x8781('0x17'),_0x1fcab5+'-'+_0x2dc187+'/'+_0x1c48eb)[_0x8781('0x11')](_0x290597);}return null;};}function saveUpdates(_0x4e996b){return function(_0x33e84e){if(_0x33e84e){return _0x33e84e['update'](_0x4e996b)[_0x8781('0x18')](function(_0x4f3169){return _0x4f3169;});}return null;};}function removeEntity(_0x1d006c){return function(_0x1d4fa){if(_0x1d4fa){return _0x1d4fa[_0x8781('0x19')]()[_0x8781('0x18')](function(){_0x1d006c[_0x8781('0x10')](0xcc)[_0x8781('0x1a')]();});}};}function handleEntityNotFound(_0x3f5964){return function(_0x59e869){if(!_0x59e869){_0x3f5964[_0x8781('0x1b')](0x194);}return _0x59e869;};}function handleError(_0x57e35b,_0x37eded){_0x37eded=_0x37eded||0x1f4;return function(_0x3c05f7){logger[_0x8781('0x1c')](_0x3c05f7[_0x8781('0x1d')]);if(_0x3c05f7['name']){delete _0x3c05f7[_0x8781('0x1e')];}_0x57e35b[_0x8781('0x10')](_0x37eded)[_0x8781('0x1f')](_0x3c05f7);};}exports[_0x8781('0x20')]=function(_0x477e52,_0x564470){var _0x4fc056={},_0x5bdfcb={},_0x249d12={'count':0x0,'rows':[]};return db[_0x8781('0x21')][_0x8781('0x22')]()[_0x8781('0x18')](function(_0x340135){var _0x1e45a3=[];for(var _0x596fd1=0x0;_0x596fd10x1){_0x254480['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8781('0x61')](_0x39d98a),null);}else{if(qs[_0x8781('0x62')](_0x39d98a)){_0x254480['or'](_0x8781('0x63'),_0x39d98a+'%');_0x254480['or']('c.phone\x20LIKE\x20?',_0x39d98a+'%');_0x254480['or'](_0x8781('0x64'),_0x39d98a+'%');_0x254480['or']('c.fax\x20LIKE\x20?',_0x39d98a+'%');}else if(qs[_0x8781('0x65')](_0x39d98a)){_0x254480['or'](_0x8781('0x66'),_0x39d98a+'%');}else{_0x254480['or'](_0x8781('0x67'),'%'+_0x39d98a+'%');_0x254480['or']('c.lastName\x20LIKE\x20?','%'+_0x39d98a+'%');_0x254480['or']('c.email\x20LIKE\x20?','%'+_0x39d98a+'%');}}}}_0x4e748c['where'](_0x254480);_0x4e748c[_0x8781('0x68')](_0x8781('0x69'));var _0x41472c={'type':db[_0x8781('0x6a')][_0x8781('0x6b')]['SELECT'],'raw':!![]};var _0x562c2c=_0x4e748c[_0x8781('0x6c')]()[_0x8781('0x38')](_0x8781('0x69'));if(_0x4fc056[_0x8781('0x34')]){_0x4fc056['order'][_0x8781('0x59')](function(_0x3d844e){_0x4e748c[_0x8781('0x34')]('c.'+_0x3d844e[0x0],_0x3d844e[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3c9b28)){_0x4e748c['having'](_0x4c68f7);_0x562c2c['where']('t.id\x20IN\x20?',_0x3c9b28);}BPromise[_0x8781('0x6d')]()['then'](function(){if(!_0x395f0e)return;if(_0x477e52[_0x8781('0x6e')]['role']!==_0x8781('0x6f'))return;if(!_[_0x8781('0x70')](_0x395f0e[_0x8781('0x46')],['field',_0x8781('0x4c')])){return _0x477e52[_0x8781('0x6e')][_0x8781('0x71')]({'attributes':['id'],'raw':!![]})[_0x8781('0x18')](function(_0x4bde1e){if(_[_0x8781('0x72')](_0x4bde1e)){_0x562c2c[_0x8781('0x41')]('c.ListId\x20IS\x20NULL');_0x4e748c[_0x8781('0x41')](_0x8781('0x73'));}else{_0x562c2c['where'](_0x8781('0x5b'),_[_0x8781('0x55')](_0x4bde1e,'id'));_0x4e748c[_0x8781('0x41')](_0x8781('0x5b'),_[_0x8781('0x55')](_0x4bde1e,'id'));}});}})['then'](function(){if(_0x477e52[_0x8781('0x6e')][_0x8781('0x74')]==='agent'&&!_0x395f0e&&!_0x477e52[_0x8781('0x2f')]['ListId'])return[];return db[_0x8781('0x75')]['query'](_0x562c2c[_0x8781('0x76')](),_0x41472c);})[_0x8781('0x18')](function(_0x54cfb8){_0x249d12[_0x8781('0x14')]=_0x54cfb8['length'];if(_0x249d12[_0x8781('0x14')]===0x0)return[];return db[_0x8781('0x75')][_0x8781('0x2f')](_0x30a16d[_0x8781('0x76')](),_0x41472c)[_0x8781('0x18')](function(_0xa32be0){_0x2a72b2=_[_0x8781('0x77')](_0xa32be0,'id');_0x41472c=_['merge'](_0x41472c,{'model':db[_0x8781('0x21')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x477e52[_0x8781('0x2f')][_0x8781('0x31')]){_0x4fc056[_0x8781('0x32')]['forEach'](function(_0x41a149){_0x4e748c[_0x8781('0x38')]('c.'+_0x41a149);});}else{_0x4e748c[_0x8781('0x38')](_0x8781('0x69'));_0x4e748c['field'](_0x8781('0x78'));_0x4e748c[_0x8781('0x38')](_0x8781('0x79'));_0x4e748c[_0x8781('0x38')](_0x8781('0x7a'));_0x4e748c[_0x8781('0x38')](_0x8781('0x7b'));_0x4e748c[_0x8781('0x38')](_0x8781('0x7c'));_0x4e748c[_0x8781('0x38')](_0x8781('0x7d'));_0x4e748c[_0x8781('0x38')]('c.ListId');_0x4e748c[_0x8781('0x38')](_0x8781('0x7e'));_0x4e748c['field']('c.deletedAt');_0x4e748c['field'](_0x8781('0x7f'));_0x4e748c[_0x8781('0x38')](_0x8781('0x80'),_0x8781('0x81'));}if(_0x4fc056[_0x8781('0x13')])_0x4e748c[_0x8781('0x13')](_0x4fc056[_0x8781('0x13')]);if(_0x4fc056[_0x8781('0x15')])_0x4e748c[_0x8781('0x15')](_0x4fc056['offset']);return db[_0x8781('0x75')][_0x8781('0x2f')](_0x4e748c[_0x8781('0x76')](),_0x41472c);});})['then'](function(_0x2ccfb5){_0x2ccfb5[_0x8781('0x59')](function(_0x5a737e){if(_0x5a737e['TagIds']){_0x5a737e[_0x8781('0x82')]=[];_0x5a737e['TagIds'][_0x8781('0x4a')](',')[_0x8781('0x59')](function(_0x2740d6){_0x5a737e[_0x8781('0x82')][_0x8781('0x27')](_0x2a72b2[_0x2740d6]);});}delete _0x5a737e[_0x8781('0x81')];});_0x249d12[_0x8781('0x83')]=_0x2ccfb5;return _0x249d12;})['then'](respondWithFilteredResult(_0x564470,_0x4fc056));})[_0x8781('0x84')](handleError(_0x564470,null));};exports[_0x8781('0x19')]=function(_0x737eb7,_0x4ff5d0){return db['CmContact'][_0x8781('0x47')]({'where':{'id':_0x737eb7['params']['id']}})[_0x8781('0x18')](handleEntityNotFound(_0x4ff5d0,null))[_0x8781('0x18')](removeEntity(_0x4ff5d0,null))[_0x8781('0x84')](handleError(_0x4ff5d0,null));};exports['describe']=function(_0x3bb294,_0x241825){return db[_0x8781('0x21')][_0x8781('0x22')]()[_0x8781('0x18')](function(_0x4d4e7){delete _0x4d4e7['tags'];for(var _0x4e9b27=0x0;_0x4e9b27{}\s\\|]/g,'-');_0x249fe2(null,util[_0x1349('0x1f')](_0x1349('0x20'),path[_0x1349('0x21')](_0x561abc['originalname'],path[_0x1349('0x22')](_0x561abc[_0x1349('0x1e')])),Date['now'](),path[_0x1349('0x22')](_0x561abc[_0x1349('0x1e')])));}})});router[_0x1349('0x16')](_0x1349('0x23'),upload[_0x1349('0x24')](_0x1349('0x25')),controller[_0x1349('0x26')]);var upload=multer({'storage':multer[_0x1349('0x1b')]({'destination':function(_0xde8abf,_0x1e3d9e,_0x13f8c0){_0x13f8c0(null,path[_0x1349('0x1c')](config[_0x1349('0x1d')],'server/files/tmp'));},'filename':function(_0x4a45dd,_0x497a97,_0x459133){_0x497a97[_0x1349('0x1e')]=_0x497a97[_0x1349('0x1e')][_0x1349('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x459133(null,util['format'](_0x1349('0x20'),path[_0x1349('0x21')](_0x497a97[_0x1349('0x1e')],path[_0x1349('0x22')](_0x497a97['originalname'])),Date[_0x1349('0x28')](),path[_0x1349('0x22')](_0x497a97['originalname'])));}})});router['post'](_0x1349('0x29'),upload[_0x1349('0x24')]('file'),controller[_0x1349('0x2a')]);router[_0x1349('0x16')](_0x1349('0x2b'),auth['isAuthenticated'](),controller[_0x1349('0x2c')]);router[_0x1349('0x2d')](_0x1349('0x2e'),auth[_0x1349('0x5')](),controller[_0x1349('0x2f')]);router[_0x1349('0x30')](_0x1349('0x2e'),auth[_0x1349('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc3de=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','setTags','join','root','server/files/tmp','originalname','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','diskStorage','replace','put','delete','util','path','connect-timeout','Router','fs-extra'];(function(_0x9f9ba3,_0x3a928a){var _0x21aeef=function(_0x163179){while(--_0x163179){_0x9f9ba3['push'](_0x9f9ba3['shift']());}};_0x21aeef(++_0x3a928a);}(_0xc3de,0x1d1));var _0xec3d=function(_0xed51f5,_0x1075c8){_0xed51f5=_0xed51f5-0x0;var _0x3fcdfb=_0xc3de[_0xed51f5];return _0x3fcdfb;};'use strict';var multer=require('multer');var util=require(_0xec3d('0x0'));var path=require(_0xec3d('0x1'));var timeout=require(_0xec3d('0x2'));var express=require('express');var router=express[_0xec3d('0x3')]();var fs_extra=require(_0xec3d('0x4'));var auth=require(_0xec3d('0x5'));var interaction=require(_0xec3d('0x6'));var config=require(_0xec3d('0x7'));var controller=require(_0xec3d('0x8'));router[_0xec3d('0x9')]('/',auth[_0xec3d('0xa')](),controller['index']);router[_0xec3d('0x9')](_0xec3d('0xb'),auth[_0xec3d('0xa')](),controller[_0xec3d('0xc')]);router[_0xec3d('0x9')](_0xec3d('0xd'),auth['isAuthenticated'](),controller[_0xec3d('0xe')]);router[_0xec3d('0x9')](_0xec3d('0xf'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x10')]);router[_0xec3d('0x9')](_0xec3d('0x11'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x12')]);router['get'](_0xec3d('0x13'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x14')]);router[_0xec3d('0x9')]('/:id/hopper_finals',auth[_0xec3d('0xa')](),controller['getHopperFinals']);router[_0xec3d('0x9')](_0xec3d('0x15'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x16')]);router[_0xec3d('0x9')](_0xec3d('0x17'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x18')]);router[_0xec3d('0x19')](_0xec3d('0x1a'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x1b')]);router[_0xec3d('0x19')]('/',auth[_0xec3d('0xa')](),controller[_0xec3d('0x1c')]);router[_0xec3d('0x19')]('/create_many',auth[_0xec3d('0xa')](),controller['bulkCreate']);router['post'](_0xec3d('0xf'),auth[_0xec3d('0xa')](),controller[_0xec3d('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa23f4f,_0x26178d,_0x251ab2){_0x251ab2(null,path[_0xec3d('0x1e')](config[_0xec3d('0x1f')],_0xec3d('0x20')));},'filename':function(_0x450313,_0x16790b,_0x5231fc){_0x16790b[_0xec3d('0x21')]=_0x16790b[_0xec3d('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5231fc(null,util[_0xec3d('0x22')](_0xec3d('0x23'),path[_0xec3d('0x24')](_0x16790b[_0xec3d('0x21')],path[_0xec3d('0x25')](_0x16790b[_0xec3d('0x21')])),Date[_0xec3d('0x26')](),path[_0xec3d('0x25')](_0x16790b[_0xec3d('0x21')])));}})});router[_0xec3d('0x19')](_0xec3d('0x27'),upload[_0xec3d('0x28')](_0xec3d('0x29')),controller[_0xec3d('0x2a')]);var upload=multer({'storage':multer[_0xec3d('0x2b')]({'destination':function(_0x2fbf69,_0x3ce738,_0x3f574e){_0x3f574e(null,path[_0xec3d('0x1e')](config[_0xec3d('0x1f')],_0xec3d('0x20')));},'filename':function(_0x109a69,_0x479992,_0x16d42c){_0x479992[_0xec3d('0x21')]=_0x479992[_0xec3d('0x21')][_0xec3d('0x2c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x16d42c(null,util['format']('%s-%s%s',path['basename'](_0x479992['originalname'],path[_0xec3d('0x25')](_0x479992[_0xec3d('0x21')])),Date[_0xec3d('0x26')](),path['extname'](_0x479992['originalname'])));}})});router[_0xec3d('0x19')]('/upload',upload[_0xec3d('0x28')](_0xec3d('0x29')),controller['upload']);router[_0xec3d('0x19')]('/upload/:id',auth[_0xec3d('0xa')](),controller['import']);router[_0xec3d('0x2d')](_0xec3d('0xd'),auth[_0xec3d('0xa')](),controller['update']);router[_0xec3d('0x2e')](_0xec3d('0xd'),auth[_0xec3d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d57b35c..9d786f2 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0567=['STRING','TEXT','type','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0567,0x119));var _0x7056=function(_0x3722f8,_0x3e8629){_0x3722f8=_0x3722f8-0x0;var _0x2967a0=_0x0567[_0x3722f8];return _0x2967a0;};'use strict';var Sequelize=require(_0x7056('0x0'));var _=require(_0x7056('0x1'));module[_0x7056('0x2')]={'name':{'type':Sequelize[_0x7056('0x3')],'get':function(_0x207c27){return this[_0x7056('0x4')](_0x7056('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4d5efb){this[_0x7056('0x6')](_0x7056('0x5'),_0x4d5efb?_0x4d5efb:this[_0x7056('0x4')](_0x7056('0x7')));}},'type':{'type':Sequelize[_0x7056('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x7056('0x9')]('long'),'get':function(){if(this[_0x7056('0x4')](_0x7056('0xa'))==='select'){return JSON[_0x7056('0xb')](this[_0x7056('0x4')](_0x7056('0xc')));}else{return this['getDataValue'](_0x7056('0xc'));}},'set':function(_0x58dbcb){if(Array[_0x7056('0xd')](_0x58dbcb)){this[_0x7056('0x6')](_0x7056('0xc'),JSON[_0x7056('0xe')](_0x58dbcb));}else{this['setDataValue'](_0x7056('0xc'),_0x58dbcb);}}},'required':{'type':Sequelize[_0x7056('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7056('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7056('0x10')]('voice')}}; \ No newline at end of file +var _0xed3d=['setDataValue','stringify','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','STRING','name','TEXT','long','type','parse','values'];(function(_0x2a801f,_0x23efc1){var _0x20cb01=function(_0x21918f){while(--_0x21918f){_0x2a801f['push'](_0x2a801f['shift']());}};_0x20cb01(++_0x23efc1);}(_0xed3d,0x1e4));var _0xded3=function(_0x1b071a,_0x45b996){_0x1b071a=_0x1b071a-0x0;var _0x16e2db=_0xed3d[_0x1b071a];return _0x16e2db;};'use strict';var Sequelize=require(_0xded3('0x0'));var _=require(_0xded3('0x1'));module['exports']={'name':{'type':Sequelize[_0xded3('0x2')],'get':function(_0x2e673d){return this[_0xded3('0x3')]('alias');}},'alias':{'type':Sequelize[_0xded3('0x4')],'allowNull':![],'set':function(_0x4c34da){this['setDataValue']('alias',_0x4c34da?_0x4c34da:this[_0xded3('0x3')](_0xded3('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xded3('0x6')](_0xded3('0x7')),'get':function(){if(this['getDataValue'](_0xded3('0x8'))==='select'){return JSON[_0xded3('0x9')](this[_0xded3('0x3')](_0xded3('0xa')));}else{return this[_0xded3('0x3')](_0xded3('0xa'));}},'set':function(_0x43b70e){if(Array['isArray'](_0x43b70e)){this[_0xded3('0xb')](_0xded3('0xa'),JSON[_0xded3('0xc')](_0x43b70e));}else{this[_0xded3('0xb')](_0xded3('0xa'),_0x43b70e);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xded3('0xd')](_0xded3('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4c738b5..ae8ae48 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ba1=['update','then','destroy','stack','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x1ba1,0xd8));var _0x11ba=function(_0x2350c0,_0x422b5f){_0x2350c0=_0x2350c0-0x0;var _0xfc82e5=_0x1ba1[_0x2350c0];return _0xfc82e5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11ba('0x0'));var jsonpatch=require(_0x11ba('0x1'));var rp=require(_0x11ba('0x2'));var moment=require(_0x11ba('0x3'));var BPromise=require(_0x11ba('0x4'));var Mustache=require(_0x11ba('0x5'));var util=require(_0x11ba('0x6'));var path=require(_0x11ba('0x7'));var sox=require(_0x11ba('0x8'));var csv=require('to-csv');var ejs=require(_0x11ba('0x9'));var fs=require('fs');var fs_extra=require(_0x11ba('0xa'));var _=require(_0x11ba('0xb'));var squel=require(_0x11ba('0xc'));var crypto=require('crypto');var jsforce=require(_0x11ba('0xd'));var deskjs=require(_0x11ba('0xe'));var toCsv=require('to-csv');var querystring=require(_0x11ba('0xf'));var Papa=require(_0x11ba('0x10'));var Redis=require(_0x11ba('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11ba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11ba('0x13'))('api');var utils=require(_0x11ba('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x11ba('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x134b8a,_0x120007){_0x120007=_0x120007||0xcc;return function(_0x385614){if(_0x385614){return _0x134b8a[_0x11ba('0x16')](_0x120007);}return _0x134b8a[_0x11ba('0x17')](_0x120007)[_0x11ba('0x18')]();};}function respondWithResult(_0x5c7abc,_0x2e508b){_0x2e508b=_0x2e508b||0xc8;return function(_0x5292d8){if(_0x5292d8){return _0x5c7abc['status'](_0x2e508b)[_0x11ba('0x19')](_0x5292d8);}};}function respondWithFilteredResult(_0x4428e7,_0x47ba6a){return function(_0x4e3e76){if(_0x4e3e76){var _0xe52d29=typeof _0x47ba6a['offset']===_0x11ba('0x1a')&&typeof _0x47ba6a[_0x11ba('0x1b')]===_0x11ba('0x1a');var _0x3d98a8=_0x4e3e76[_0x11ba('0x1c')];var _0x1b463f=_0xe52d29?0x0:_0x47ba6a[_0x11ba('0x1d')];var _0x3c58db=_0xe52d29?_0x4e3e76[_0x11ba('0x1c')]:_0x47ba6a['offset']+_0x47ba6a[_0x11ba('0x1b')];var _0x37c9d0;if(_0x3c58db>=_0x3d98a8){_0x3c58db=_0x3d98a8;_0x37c9d0=0xc8;}else{_0x37c9d0=0xce;}_0x4428e7[_0x11ba('0x17')](_0x37c9d0);return _0x4428e7[_0x11ba('0x1e')](_0x11ba('0x1f'),_0x1b463f+'-'+_0x3c58db+'/'+_0x3d98a8)[_0x11ba('0x19')](_0x4e3e76);}return null;};}function patchUpdates(_0x6acc26){return function(_0x6a8f07){try{jsonpatch[_0x11ba('0x20')](_0x6a8f07,_0x6acc26,!![]);}catch(_0x50c323){return BPromise['reject'](_0x50c323);}return _0x6a8f07['save']();};}function saveUpdates(_0x53889c,_0xade9b){return function(_0x753ae5){if(_0x753ae5){return _0x753ae5[_0x11ba('0x21')](_0x53889c)[_0x11ba('0x22')](function(_0x5bd4a7){return _0x5bd4a7;});}return null;};}function removeEntity(_0xdb6050,_0x1f48cd){return function(_0x1b9061){if(_0x1b9061){return _0x1b9061[_0x11ba('0x23')]()[_0x11ba('0x22')](function(){_0xdb6050[_0x11ba('0x17')](0xcc)[_0x11ba('0x18')]();});}};}function handleEntityNotFound(_0x381eb4,_0x4792b9){return function(_0x121e27){if(!_0x121e27){_0x381eb4[_0x11ba('0x16')](0x194);}return _0x121e27;};}function handleError(_0x122d80,_0x2ad798){_0x2ad798=_0x2ad798||0x1f4;return function(_0x4ee2ee){logger['error'](_0x4ee2ee[_0x11ba('0x24')]);if(_0x4ee2ee[_0x11ba('0x25')]){delete _0x4ee2ee[_0x11ba('0x25')];}_0x122d80[_0x11ba('0x17')](_0x2ad798)[_0x11ba('0x26')](_0x4ee2ee);};}exports[_0x11ba('0x27')]=function(_0x5ba434,_0x5ccbbd){var _0x4e4dc4={},_0x2f4687={},_0x592caf={'count':0x0,'rows':[]};var _0x3090ac=_[_0x11ba('0x28')](db[_0x11ba('0x29')]['rawAttributes'],function(_0x182983){return{'name':_0x182983[_0x11ba('0x2a')],'type':_0x182983[_0x11ba('0x2b')][_0x11ba('0x2c')]};});_0x2f4687[_0x11ba('0x2d')]=_[_0x11ba('0x2e')](_[_0x11ba('0x28')](_0x3090ac,'name'),[_0x11ba('0x25')]);_0x2f4687[_0x11ba('0x2f')]=_[_0x11ba('0x30')](_0x5ba434[_0x11ba('0x2f')]);_0x2f4687['filters']=_[_0x11ba('0x31')](_0x2f4687['model'],_0x2f4687[_0x11ba('0x2f')]);_0x4e4dc4[_0x11ba('0x32')]=_['intersection'](_0x2f4687['model'],qs[_0x11ba('0x33')](_0x5ba434['query']['fields']));_0x4e4dc4[_0x11ba('0x32')]=_0x4e4dc4[_0x11ba('0x32')]['length']?_0x4e4dc4[_0x11ba('0x32')]:_0x2f4687['model'];if(!_0x5ba434['query'][_0x11ba('0x34')](_0x11ba('0x35'))){_0x4e4dc4['limit']=qs['limit'](_0x5ba434[_0x11ba('0x2f')]['limit']);_0x4e4dc4[_0x11ba('0x1d')]=qs[_0x11ba('0x1d')](_0x5ba434['query'][_0x11ba('0x1d')]);}_0x4e4dc4['order']=qs[_0x11ba('0x36')](_0x5ba434[_0x11ba('0x2f')]['sort']);_0x4e4dc4[_0x11ba('0x37')]=qs[_0x11ba('0x38')](_[_0x11ba('0x39')](_0x5ba434[_0x11ba('0x2f')],_0x2f4687['filters']),_0x3090ac);if(_0x5ba434[_0x11ba('0x2f')][_0x11ba('0x3a')]){_0x4e4dc4[_0x11ba('0x37')]=_[_0x11ba('0x3b')](_0x4e4dc4[_0x11ba('0x37')],{'$or':_[_0x11ba('0x28')](_0x3090ac,function(_0x3ed7bd){if(_0x3ed7bd['type']!==_0x11ba('0x3c')){var _0x3c37f4={};_0x3c37f4[_0x3ed7bd[_0x11ba('0x25')]]={'$like':'%'+_0x5ba434[_0x11ba('0x2f')][_0x11ba('0x3a')]+'%'};return _0x3c37f4;}})});}_0x4e4dc4=_['merge']({},_0x4e4dc4,_0x5ba434[_0x11ba('0x3d')]);var _0x2d9166={'where':_0x4e4dc4[_0x11ba('0x37')]};return db[_0x11ba('0x29')][_0x11ba('0x1c')](_0x2d9166)[_0x11ba('0x22')](function(_0xf3063f){_0x592caf[_0x11ba('0x1c')]=_0xf3063f;if(_0x5ba434[_0x11ba('0x2f')]['includeAll']){_0x4e4dc4[_0x11ba('0x3e')]=[{'all':!![]}];}return db[_0x11ba('0x29')][_0x11ba('0x3f')](_0x4e4dc4);})[_0x11ba('0x22')](function(_0x17da31){_0x592caf[_0x11ba('0x40')]=_0x17da31;return _0x592caf;})[_0x11ba('0x22')](respondWithFilteredResult(_0x5ccbbd,_0x4e4dc4))[_0x11ba('0x41')](handleError(_0x5ccbbd,null));};exports['show']=function(_0x41251d,_0x19ce9e){var _0xa5a8c7={'raw':!![],'where':{'id':_0x41251d[_0x11ba('0x42')]['id']}},_0xa5bc60={};_0xa5bc60['model']=_[_0x11ba('0x30')](db[_0x11ba('0x29')]['rawAttributes']);_0xa5bc60[_0x11ba('0x2f')]=_[_0x11ba('0x30')](_0x41251d[_0x11ba('0x2f')]);_0xa5bc60[_0x11ba('0x38')]=_[_0x11ba('0x31')](_0xa5bc60[_0x11ba('0x2d')],_0xa5bc60[_0x11ba('0x2f')]);_0xa5a8c7['attributes']=_[_0x11ba('0x31')](_0xa5bc60['model'],qs[_0x11ba('0x33')](_0x41251d[_0x11ba('0x2f')][_0x11ba('0x33')]));_0xa5a8c7[_0x11ba('0x32')]=_0xa5a8c7[_0x11ba('0x32')][_0x11ba('0x43')]?_0xa5a8c7[_0x11ba('0x32')]:_0xa5bc60['model'];if(_0x41251d[_0x11ba('0x2f')][_0x11ba('0x44')]){_0xa5a8c7[_0x11ba('0x3e')]=[{'all':!![]}];}_0xa5a8c7=_[_0x11ba('0x3b')]({},_0xa5a8c7,_0x41251d[_0x11ba('0x3d')]);return db[_0x11ba('0x29')][_0x11ba('0x45')](_0xa5a8c7)[_0x11ba('0x22')](handleEntityNotFound(_0x19ce9e,null))['then'](respondWithResult(_0x19ce9e,null))[_0x11ba('0x41')](handleError(_0x19ce9e,null));};exports[_0x11ba('0x21')]=function(_0x384e9a,_0x1977c0){if(_0x384e9a[_0x11ba('0x46')]['id']){delete _0x384e9a['body']['id'];}return db[_0x11ba('0x29')][_0x11ba('0x45')]({'where':{'id':_0x384e9a['params']['id']}})[_0x11ba('0x22')](handleEntityNotFound(_0x1977c0,null))[_0x11ba('0x22')](saveUpdates(_0x384e9a['body'],null))[_0x11ba('0x22')](respondWithResult(_0x1977c0,null))[_0x11ba('0x41')](handleError(_0x1977c0,null));};exports[_0x11ba('0x23')]=function(_0x4a5184,_0x23fc0b){return db[_0x11ba('0x29')][_0x11ba('0x45')]({'where':{'id':_0x4a5184['params']['id']}})[_0x11ba('0x22')](handleEntityNotFound(_0x23fc0b,null))[_0x11ba('0x22')](removeEntity(_0x23fc0b,null))[_0x11ba('0x41')](handleError(_0x23fc0b,null));};exports[_0x11ba('0x47')]=function(_0x522fc9,_0x262a3b){var _0x304968;return db[_0x11ba('0x48')][_0x11ba('0x49')](function(_0x2e9918){return db[_0x11ba('0x29')][_0x11ba('0x47')](_0x522fc9['body'],{'transaction':_0x2e9918})[_0x11ba('0x22')](function(_0x2358e9){_0x304968=_0x2358e9;var _0x559567={'type':db[_0x11ba('0x4a')][_0x11ba('0x4b')],'transaction':_0x2e9918};switch(_0x522fc9[_0x11ba('0x46')][_0x11ba('0x2b')]){case'text':_0x559567[_0x11ba('0x2b')]=db[_0x11ba('0x4a')]['TEXT'];break;case'number':_0x559567[_0x11ba('0x2b')]=db[_0x11ba('0x4a')][_0x11ba('0x4c')];break;case _0x11ba('0x4d'):_0x559567[_0x11ba('0x2b')]=db[_0x11ba('0x4a')][_0x11ba('0x4e')];_0x559567['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x11ba('0x4f')](_0x11ba('0x50'),util[_0x11ba('0x51')](_0x11ba('0x52'),_0x304968['id']),_0x559567);})[_0x11ba('0x22')](function(){return _0x304968;});})[_0x11ba('0x22')](respondWithResult(_0x262a3b,0xc9))[_0x11ba('0x41')](handleError(_0x262a3b,null));}; \ No newline at end of file +var _0x6bde=['attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','length','find','body','params','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','CmCustomField','fieldName','type','key','model','differenceBy','map','keys','intersection','query','fields'];(function(_0x50fa9a,_0x1da236){var _0x2bff39=function(_0x1cdde1){while(--_0x1cdde1){_0x50fa9a['push'](_0x50fa9a['shift']());}};_0x2bff39(++_0x1da236);}(_0x6bde,0x77));var _0xe6bd=function(_0x998b8e,_0x31916b){_0x998b8e=_0x998b8e-0x0;var _0x4216c1=_0x6bde[_0x998b8e];return _0x4216c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe6bd('0x0'));var jsonpatch=require(_0xe6bd('0x1'));var rp=require('request-promise');var moment=require(_0xe6bd('0x2'));var BPromise=require(_0xe6bd('0x3'));var Mustache=require(_0xe6bd('0x4'));var util=require(_0xe6bd('0x5'));var path=require(_0xe6bd('0x6'));var sox=require(_0xe6bd('0x7'));var csv=require(_0xe6bd('0x8'));var ejs=require(_0xe6bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe6bd('0xa'));var _=require(_0xe6bd('0xb'));var squel=require(_0xe6bd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6bd('0xd'));var toCsv=require(_0xe6bd('0x8'));var querystring=require(_0xe6bd('0xe'));var Papa=require('papaparse');var Redis=require(_0xe6bd('0xf'));var authService=require(_0xe6bd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6bd('0x11'));var logger=require(_0xe6bd('0x12'))(_0xe6bd('0x13'));var utils=require(_0xe6bd('0x14'));var config=require(_0xe6bd('0x15'));var licenseUtil=require(_0xe6bd('0x16'));var db=require(_0xe6bd('0x17'))['db'];function respondWithStatusCode(_0x3402ec,_0x272ad5){_0x272ad5=_0x272ad5||0xcc;return function(_0x5b0936){if(_0x5b0936){return _0x3402ec[_0xe6bd('0x18')](_0x272ad5);}return _0x3402ec[_0xe6bd('0x19')](_0x272ad5)[_0xe6bd('0x1a')]();};}function respondWithResult(_0x53d8bd,_0x5a17b7){_0x5a17b7=_0x5a17b7||0xc8;return function(_0x408448){if(_0x408448){return _0x53d8bd[_0xe6bd('0x19')](_0x5a17b7)[_0xe6bd('0x1b')](_0x408448);}};}function respondWithFilteredResult(_0x3524d8,_0x315306){return function(_0x3d55ee){if(_0x3d55ee){var _0x1f7b8e=typeof _0x315306[_0xe6bd('0x1c')]===_0xe6bd('0x1d')&&typeof _0x315306['limit']===_0xe6bd('0x1d');var _0x599288=_0x3d55ee[_0xe6bd('0x1e')];var _0x173902=_0x1f7b8e?0x0:_0x315306[_0xe6bd('0x1c')];var _0x4e2892=_0x1f7b8e?_0x3d55ee[_0xe6bd('0x1e')]:_0x315306['offset']+_0x315306[_0xe6bd('0x1f')];var _0x5fac23;if(_0x4e2892>=_0x599288){_0x4e2892=_0x599288;_0x5fac23=0xc8;}else{_0x5fac23=0xce;}_0x3524d8['status'](_0x5fac23);return _0x3524d8[_0xe6bd('0x20')](_0xe6bd('0x21'),_0x173902+'-'+_0x4e2892+'/'+_0x599288)[_0xe6bd('0x1b')](_0x3d55ee);}return null;};}function patchUpdates(_0x511597){return function(_0x37ab2b){try{jsonpatch[_0xe6bd('0x22')](_0x37ab2b,_0x511597,!![]);}catch(_0x8c24ee){return BPromise[_0xe6bd('0x23')](_0x8c24ee);}return _0x37ab2b[_0xe6bd('0x24')]();};}function saveUpdates(_0x59865c,_0x1bfd91){return function(_0x23dc64){if(_0x23dc64){return _0x23dc64[_0xe6bd('0x25')](_0x59865c)['then'](function(_0x2e25ef){return _0x2e25ef;});}return null;};}function removeEntity(_0x2d5bf,_0x520e7b){return function(_0x5a6915){if(_0x5a6915){return _0x5a6915[_0xe6bd('0x26')]()[_0xe6bd('0x27')](function(){_0x2d5bf[_0xe6bd('0x19')](0xcc)[_0xe6bd('0x1a')]();});}};}function handleEntityNotFound(_0xd23cff,_0x228390){return function(_0x485b2c){if(!_0x485b2c){_0xd23cff['sendStatus'](0x194);}return _0x485b2c;};}function handleError(_0xcd4442,_0x4c68fb){_0x4c68fb=_0x4c68fb||0x1f4;return function(_0xfc1c19){logger[_0xe6bd('0x28')](_0xfc1c19['stack']);if(_0xfc1c19[_0xe6bd('0x29')]){delete _0xfc1c19[_0xe6bd('0x29')];}_0xcd4442[_0xe6bd('0x19')](_0x4c68fb)[_0xe6bd('0x2a')](_0xfc1c19);};}exports[_0xe6bd('0x2b')]=function(_0xe72057,_0x16c168){var _0x16f2e2={},_0x3d924a={},_0x25c940={'count':0x0,'rows':[]};var _0x5bec38=_['map'](db[_0xe6bd('0x2c')]['rawAttributes'],function(_0x3d2a9b){return{'name':_0x3d2a9b[_0xe6bd('0x2d')],'type':_0x3d2a9b[_0xe6bd('0x2e')][_0xe6bd('0x2f')]};});_0x3d924a[_0xe6bd('0x30')]=_[_0xe6bd('0x31')](_[_0xe6bd('0x32')](_0x5bec38,_0xe6bd('0x29')),[_0xe6bd('0x29')]);_0x3d924a['query']=_[_0xe6bd('0x33')](_0xe72057['query']);_0x3d924a['filters']=_[_0xe6bd('0x34')](_0x3d924a['model'],_0x3d924a[_0xe6bd('0x35')]);_0x16f2e2['attributes']=_[_0xe6bd('0x34')](_0x3d924a['model'],qs[_0xe6bd('0x36')](_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x36')]));_0x16f2e2['attributes']=_0x16f2e2[_0xe6bd('0x37')]['length']?_0x16f2e2[_0xe6bd('0x37')]:_0x3d924a[_0xe6bd('0x30')];if(!_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x38')](_0xe6bd('0x39'))){_0x16f2e2[_0xe6bd('0x1f')]=qs[_0xe6bd('0x1f')](_0xe72057['query'][_0xe6bd('0x1f')]);_0x16f2e2[_0xe6bd('0x1c')]=qs['offset'](_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x1c')]);}_0x16f2e2['order']=qs['sort'](_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x3a')]);_0x16f2e2[_0xe6bd('0x3b')]=qs[_0xe6bd('0x3c')](_[_0xe6bd('0x3d')](_0xe72057[_0xe6bd('0x35')],_0x3d924a[_0xe6bd('0x3c')]),_0x5bec38);if(_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x3e')]){_0x16f2e2[_0xe6bd('0x3b')]=_[_0xe6bd('0x3f')](_0x16f2e2[_0xe6bd('0x3b')],{'$or':_['map'](_0x5bec38,function(_0x2245a2){if(_0x2245a2[_0xe6bd('0x2e')]!==_0xe6bd('0x40')){var _0x1bb085={};_0x1bb085[_0x2245a2[_0xe6bd('0x29')]]={'$like':'%'+_0xe72057[_0xe6bd('0x35')][_0xe6bd('0x3e')]+'%'};return _0x1bb085;}})});}_0x16f2e2=_[_0xe6bd('0x3f')]({},_0x16f2e2,_0xe72057[_0xe6bd('0x41')]);var _0x5c2756={'where':_0x16f2e2['where']};return db[_0xe6bd('0x2c')]['count'](_0x5c2756)[_0xe6bd('0x27')](function(_0x1c43b6){_0x25c940[_0xe6bd('0x1e')]=_0x1c43b6;if(_0xe72057['query'][_0xe6bd('0x42')]){_0x16f2e2['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x16f2e2);})['then'](function(_0x47c87d){_0x25c940['rows']=_0x47c87d;return _0x25c940;})[_0xe6bd('0x27')](respondWithFilteredResult(_0x16c168,_0x16f2e2))[_0xe6bd('0x43')](handleError(_0x16c168,null));};exports[_0xe6bd('0x44')]=function(_0x113adf,_0x33f3ab){var _0x42cc89={'raw':!![],'where':{'id':_0x113adf['params']['id']}},_0x399fda={};_0x399fda[_0xe6bd('0x30')]=_[_0xe6bd('0x33')](db['CmCustomField']['rawAttributes']);_0x399fda[_0xe6bd('0x35')]=_['keys'](_0x113adf['query']);_0x399fda[_0xe6bd('0x3c')]=_[_0xe6bd('0x34')](_0x399fda[_0xe6bd('0x30')],_0x399fda[_0xe6bd('0x35')]);_0x42cc89[_0xe6bd('0x37')]=_[_0xe6bd('0x34')](_0x399fda[_0xe6bd('0x30')],qs[_0xe6bd('0x36')](_0x113adf[_0xe6bd('0x35')][_0xe6bd('0x36')]));_0x42cc89[_0xe6bd('0x37')]=_0x42cc89[_0xe6bd('0x37')][_0xe6bd('0x45')]?_0x42cc89['attributes']:_0x399fda[_0xe6bd('0x30')];if(_0x113adf[_0xe6bd('0x35')][_0xe6bd('0x42')]){_0x42cc89['include']=[{'all':!![]}];}_0x42cc89=_[_0xe6bd('0x3f')]({},_0x42cc89,_0x113adf[_0xe6bd('0x41')]);return db['CmCustomField'][_0xe6bd('0x46')](_0x42cc89)['then'](handleEntityNotFound(_0x33f3ab,null))[_0xe6bd('0x27')](respondWithResult(_0x33f3ab,null))['catch'](handleError(_0x33f3ab,null));};exports[_0xe6bd('0x25')]=function(_0xfcc4bb,_0x2feb1f){if(_0xfcc4bb[_0xe6bd('0x47')]['id']){delete _0xfcc4bb[_0xe6bd('0x47')]['id'];}return db[_0xe6bd('0x2c')]['find']({'where':{'id':_0xfcc4bb[_0xe6bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2feb1f,null))[_0xe6bd('0x27')](saveUpdates(_0xfcc4bb[_0xe6bd('0x47')],null))[_0xe6bd('0x27')](respondWithResult(_0x2feb1f,null))[_0xe6bd('0x43')](handleError(_0x2feb1f,null));};exports[_0xe6bd('0x26')]=function(_0x153454,_0x2e13ff){return db['CmCustomField'][_0xe6bd('0x46')]({'where':{'id':_0x153454[_0xe6bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e13ff,null))[_0xe6bd('0x27')](removeEntity(_0x2e13ff,null))['catch'](handleError(_0x2e13ff,null));};exports[_0xe6bd('0x49')]=function(_0x100631,_0x39d7a4){var _0x578b77;return db[_0xe6bd('0x4a')][_0xe6bd('0x4b')](function(_0x22afb){return db[_0xe6bd('0x2c')][_0xe6bd('0x49')](_0x100631['body'],{'transaction':_0x22afb})[_0xe6bd('0x27')](function(_0x3f345d){_0x578b77=_0x3f345d;var _0x268bb6={'type':db[_0xe6bd('0x4c')]['TEXT'],'transaction':_0x22afb};switch(_0x100631[_0xe6bd('0x47')][_0xe6bd('0x2e')]){case _0xe6bd('0x4d'):_0x268bb6[_0xe6bd('0x2e')]=db['Sequelize'][_0xe6bd('0x4e')];break;case _0xe6bd('0x4f'):_0x268bb6[_0xe6bd('0x2e')]=db[_0xe6bd('0x4c')][_0xe6bd('0x50')];break;case'switch':_0x268bb6[_0xe6bd('0x2e')]=db[_0xe6bd('0x4c')][_0xe6bd('0x51')];_0x268bb6[_0xe6bd('0x52')]=![];break;default:}return db[_0xe6bd('0x4a')][_0xe6bd('0x53')]['addColumn'](_0xe6bd('0x54'),util[_0xe6bd('0x55')](_0xe6bd('0x56'),_0x578b77['id']),_0x268bb6);})[_0xe6bd('0x27')](function(){return _0x578b77;});})[_0xe6bd('0x27')](respondWithResult(_0x39d7a4,0xc9))[_0xe6bd('0x43')](handleError(_0x39d7a4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 7ada755..15bf5d6 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x997b=['rimraf','../../config/environment','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3ffa6e,_0x17755b){var _0x3e927b=function(_0x4533d3){while(--_0x4533d3){_0x3ffa6e['push'](_0x3ffa6e['shift']());}};_0x3e927b(++_0x17755b);}(_0x997b,0x164));var _0xb997=function(_0x37ae5e,_0x54c1d1){_0x37ae5e=_0x37ae5e-0x0;var _0x538920=_0x997b[_0x37ae5e];return _0x538920;};'use strict';var _=require(_0xb997('0x0'));var util=require(_0xb997('0x1'));var logger=require(_0xb997('0x2'))(_0xb997('0x3'));var moment=require(_0xb997('0x4'));var BPromise=require(_0xb997('0x5'));var rp=require(_0xb997('0x6'));var fs=require('fs');var path=require(_0xb997('0x7'));var rimraf=require(_0xb997('0x8'));var config=require(_0xb997('0x9'));var attributes=require('./cmCustomField.attributes');module[_0xb997('0xa')]=function(_0x1c2e34,_0x15924f){return _0x1c2e34[_0xb997('0xb')]('CmCustomField',attributes,{'tableName':_0xb997('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7901=['util','api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x295ad9,_0x42be00){var _0x3627ad=function(_0x57251d){while(--_0x57251d){_0x295ad9['push'](_0x295ad9['shift']());}};_0x3627ad(++_0x42be00);}(_0x7901,0x83));var _0x1790=function(_0x17feba,_0x1792e9){_0x17feba=_0x17feba-0x0;var _0x4cc904=_0x7901[_0x17feba];return _0x4cc904;};'use strict';var _=require(_0x1790('0x0'));var util=require(_0x1790('0x1'));var logger=require('../../config/logger')(_0x1790('0x2'));var moment=require(_0x1790('0x3'));var BPromise=require('bluebird');var rp=require(_0x1790('0x4'));var fs=require('fs');var path=require(_0x1790('0x5'));var rimraf=require('rimraf');var config=require(_0x1790('0x6'));var attributes=require(_0x1790('0x7'));module[_0x1790('0x8')]=function(_0x14e1b8,_0x48a09f){return _0x14e1b8[_0x1790('0x9')](_0x1790('0xa'),attributes,{'tableName':_0x1790('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f3e7d1a..422b889 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93d2=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x3f490b,_0x5c176e){var _0x2399c0=function(_0x308b53){while(--_0x308b53){_0x3f490b['push'](_0x3f490b['shift']());}};_0x2399c0(++_0x5c176e);}(_0x93d2,0xc0));var _0x293d=function(_0x4e049b,_0x4b6046){_0x4e049b=_0x4e049b-0x0;var _0x2041b0=_0x93d2[_0x4e049b];return _0x2041b0;};'use strict';var _=require(_0x293d('0x0'));var util=require(_0x293d('0x1'));var moment=require('moment');var BPromise=require(_0x293d('0x2'));var rs=require(_0x293d('0x3'));var fs=require('fs');var Redis=require(_0x293d('0x4'));var db=require(_0x293d('0x5'))['db'];var utils=require(_0x293d('0x6'));var logger=require('../../config/logger')(_0x293d('0x7'));var config=require(_0x293d('0x8'));var jayson=require(_0x293d('0x9'));var client=jayson[_0x293d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x587c7e,_0x58a44c,_0x203d4d){return new BPromise(function(_0x5b1fa0,_0x1a0898){return client[_0x293d('0xb')](_0x587c7e,_0x203d4d)[_0x293d('0xc')](function(_0x6efddb){logger[_0x293d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x58a44c,_0x293d('0xe'));logger[_0x293d('0xf')](_0x293d('0x10'),_0x58a44c,'request\x20sent',JSON['stringify'](_0x6efddb));if(_0x6efddb[_0x293d('0x11')]){if(_0x6efddb[_0x293d('0x11')][_0x293d('0x12')]===0x1f4){logger[_0x293d('0x11')](_0x293d('0x13'),_0x58a44c,_0x6efddb[_0x293d('0x11')][_0x293d('0x14')]);return _0x1a0898(_0x6efddb[_0x293d('0x11')]['message']);}logger[_0x293d('0x11')]('CmCustomField,\x20%s,\x20%s',_0x58a44c,_0x6efddb[_0x293d('0x11')][_0x293d('0x14')]);return _0x5b1fa0(_0x6efddb[_0x293d('0x11')]['message']);}else{logger[_0x293d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x58a44c,_0x293d('0xe'));_0x5b1fa0(_0x6efddb[_0x293d('0x15')][_0x293d('0x14')]);}})[_0x293d('0x16')](function(_0x579c70){logger[_0x293d('0x11')](_0x293d('0x13'),_0x58a44c,_0x579c70);_0x1a0898(_0x579c70);});});} \ No newline at end of file +var _0xcf82=['stringify','error','message','result','catch','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xcf82,0x1c7));var _0x2cf8=function(_0x3d6c91,_0x185148){_0x3d6c91=_0x3d6c91-0x0;var _0x364043=_0xcf82[_0x3d6c91];return _0x364043;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2cf8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cf8('0x1'))['db'];var utils=require(_0x2cf8('0x2'));var logger=require('../../config/logger')(_0x2cf8('0x3'));var config=require('../../config/environment');var jayson=require(_0x2cf8('0x4'));var client=jayson[_0x2cf8('0x5')][_0x2cf8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5f13be,_0x150791,_0x227f4d){return new BPromise(function(_0x51c5ae,_0x15fab0){return client['request'](_0x5f13be,_0x227f4d)[_0x2cf8('0x7')](function(_0x46122){logger[_0x2cf8('0x8')](_0x2cf8('0x9'),_0x150791,'request\x20sent');logger[_0x2cf8('0xa')](_0x2cf8('0xb'),_0x150791,_0x2cf8('0xc'),JSON[_0x2cf8('0xd')](_0x46122));if(_0x46122[_0x2cf8('0xe')]){if(_0x46122[_0x2cf8('0xe')]['code']===0x1f4){logger[_0x2cf8('0xe')](_0x2cf8('0x9'),_0x150791,_0x46122[_0x2cf8('0xe')]['message']);return _0x15fab0(_0x46122['error'][_0x2cf8('0xf')]);}logger[_0x2cf8('0xe')](_0x2cf8('0x9'),_0x150791,_0x46122[_0x2cf8('0xe')][_0x2cf8('0xf')]);return _0x51c5ae(_0x46122['error']['message']);}else{logger[_0x2cf8('0x8')](_0x2cf8('0x9'),_0x150791,_0x2cf8('0xc'));_0x51c5ae(_0x46122[_0x2cf8('0x10')][_0x2cf8('0xf')]);}})[_0x2cf8('0x11')](function(_0x101106){logger['error'](_0x2cf8('0x9'),_0x150791,_0x101106);_0x15fab0(_0x101106);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d9dc1a3..a92376b 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x254a=['show','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x23ea03,_0x37149a){var _0x560fac=function(_0x3e7951){while(--_0x3e7951){_0x23ea03['push'](_0x23ea03['shift']());}};_0x560fac(++_0x37149a);}(_0x254a,0x138));var _0xa254=function(_0x4f1ff3,_0x2736a1){_0x4f1ff3=_0x4f1ff3-0x0;var _0x1768a5=_0x254a[_0x4f1ff3];return _0x1768a5;};'use strict';var multer=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var path=require(_0xa254('0x2'));var timeout=require('connect-timeout');var express=require(_0xa254('0x3'));var router=express[_0xa254('0x4')]();var fs_extra=require(_0xa254('0x5'));var auth=require(_0xa254('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa254('0x7'));var controller=require('./cmCustomField.controller');router[_0xa254('0x8')]('/',auth[_0xa254('0x9')](),controller[_0xa254('0xa')]);router['get']('/:id',auth[_0xa254('0x9')](),controller[_0xa254('0xb')]);router['post']('/',auth[_0xa254('0x9')](),controller['create']);router[_0xa254('0xc')](_0xa254('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa254('0xe')](_0xa254('0xd'),auth[_0xa254('0x9')](),controller[_0xa254('0xf')]);module[_0xa254('0x10')]=router; \ No newline at end of file +var _0x6548=['connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6548,0x133));var _0x8654=function(_0x229327,_0x225488){_0x229327=_0x229327-0x0;var _0x33ec21=_0x6548[_0x229327];return _0x33ec21;};'use strict';var multer=require(_0x8654('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8654('0x1'));var express=require(_0x8654('0x2'));var router=express[_0x8654('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8654('0x4'));var controller=require('./cmCustomField.controller');router[_0x8654('0x5')]('/',auth[_0x8654('0x6')](),controller[_0x8654('0x7')]);router[_0x8654('0x5')](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0x9')]);router['post']('/',auth[_0x8654('0x6')](),controller[_0x8654('0xa')]);router['put'](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0xb')]);router['delete']('/:id',auth[_0x8654('0x6')](),controller[_0x8654('0xc')]);module[_0x8654('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3f00824..c275313 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74a6=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN','DATE','format'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x74a6,0xa5));var _0x674a=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x74a6[_0x111e94];return _0x3de107;};'use strict';var moment=require(_0x674a('0x0'));var Sequelize=require(_0x674a('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x674a('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x674a('0x3')],'defaultValue':moment()[_0x674a('0x4')](_0x674a('0x5'))},'countbusyretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x674a('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x674a('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x674a('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x674a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x674a('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x674a('0x6')],'unique':_0x674a('0x9')},'ListId':{'type':Sequelize[_0x674a('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x674a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x674a('0x6')],'unique':_0x674a('0x9')},'CampaignId':{'type':Sequelize[_0x674a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x674a('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a60=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x0a60,0x7c));var _0x00a6=function(_0x261223,_0x5dcb9a){_0x261223=_0x261223-0x0;var _0x4668a2=_0x0a60[_0x261223];return _0x4668a2;};'use strict';var moment=require(_0x00a6('0x0'));var Sequelize=require(_0x00a6('0x1'));module[_0x00a6('0x2')]={'phone':{'type':Sequelize[_0x00a6('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x00a6('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x00a6('0x5')],'defaultValue':moment()[_0x00a6('0x6')](_0x00a6('0x7'))},'countbusyretry':{'type':Sequelize[_0x00a6('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x00a6('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x00a6('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x00a6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x00a6('0x5')]},'priority':{'type':Sequelize[_0x00a6('0x8')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x00a6('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x00a6('0x8')],'unique':_0x00a6('0x9')},'ListId':{'type':Sequelize[_0x00a6('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x00a6('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x00a6('0x9')},'CampaignId':{'type':Sequelize[_0x00a6('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x00a6('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x00a6('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 18b96e6..43706a5 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1502=['COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','Contact','CmCompany','Company','CmList','List','Queue','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$gt','$gte','$lt','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','rows','length','includeAll','find','create','body','catch','params','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','state','statedesc','campaign','user','UserId','deleted','format','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','calleridname','finally','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x1502,0x1c3));var _0x2150=function(_0x5ee612,_0x26f8d0){_0x5ee612=_0x5ee612-0x0;var _0x564461=_0x1502[_0x5ee612];return _0x564461;};'use strict';var emlformat=require(_0x2150('0x0'));var rimraf=require(_0x2150('0x1'));var zipdir=require(_0x2150('0x2'));var jsonpatch=require(_0x2150('0x3'));var rp=require(_0x2150('0x4'));var moment=require(_0x2150('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2150('0x6'));var util=require(_0x2150('0x7'));var path=require(_0x2150('0x8'));var sox=require(_0x2150('0x9'));var csv=require('to-csv');var ejs=require(_0x2150('0xa'));var fs=require('fs');var fs_extra=require(_0x2150('0xb'));var _=require('lodash');var squel=require(_0x2150('0xc'));var crypto=require(_0x2150('0xd'));var jsforce=require(_0x2150('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2150('0xf'));var querystring=require(_0x2150('0x10'));var Papa=require(_0x2150('0x11'));var Redis=require('ioredis');var authService=require(_0x2150('0x12'));var qs=require(_0x2150('0x13'));var as=require(_0x2150('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2150('0x15'))(_0x2150('0x16'));var utils=require(_0x2150('0x17'));var config=require(_0x2150('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x163808,_0x2ef660){_0x2ef660=_0x2ef660||0xcc;return function(_0x59d277){if(_0x59d277){return _0x163808['sendStatus'](_0x2ef660);}return _0x163808[_0x2150('0x19')](_0x2ef660)[_0x2150('0x1a')]();};}function respondWithResult(_0x378a35,_0x5ec834){_0x5ec834=_0x5ec834||0xc8;return function(_0x5d959e){if(_0x5d959e){return _0x378a35[_0x2150('0x19')](_0x5ec834)[_0x2150('0x1b')](_0x5d959e);}};}function respondWithFilteredResult(_0x4beabc,_0x13ad4b){return function(_0x3e187b){if(_0x3e187b){var _0x3543a1=typeof _0x13ad4b[_0x2150('0x1c')]===_0x2150('0x1d')&&typeof _0x13ad4b[_0x2150('0x1e')]===_0x2150('0x1d');var _0x22effb=_0x3e187b[_0x2150('0x1f')];var _0x2295f6=_0x3543a1?0x0:_0x13ad4b[_0x2150('0x1c')];var _0x25d2ca=_0x3543a1?_0x3e187b[_0x2150('0x1f')]:_0x13ad4b['offset']+_0x13ad4b['limit'];var _0x2b301b;if(_0x25d2ca>=_0x22effb){_0x25d2ca=_0x22effb;_0x2b301b=0xc8;}else{_0x2b301b=0xce;}_0x4beabc[_0x2150('0x19')](_0x2b301b);return _0x4beabc[_0x2150('0x20')](_0x2150('0x21'),_0x2295f6+'-'+_0x25d2ca+'/'+_0x22effb)['json'](_0x3e187b);}return null;};}function patchUpdates(_0x494bc1){return function(_0x2bebcc){try{jsonpatch['apply'](_0x2bebcc,_0x494bc1,!![]);}catch(_0xf5d6f5){return BPromise[_0x2150('0x22')](_0xf5d6f5);}return _0x2bebcc[_0x2150('0x23')]();};}function saveUpdates(_0x3ee323,_0x166593){return function(_0x4afe8c){if(_0x4afe8c){return _0x4afe8c[_0x2150('0x24')](_0x3ee323)[_0x2150('0x25')](function(_0x57ba9f){return _0x57ba9f;});}return null;};}function removeEntity(_0x559cb3,_0x3be894){return function(_0x26958e){if(_0x26958e){return _0x26958e[_0x2150('0x26')]()[_0x2150('0x25')](function(){_0x559cb3[_0x2150('0x19')](0xcc)[_0x2150('0x1a')]();});}};}function handleEntityNotFound(_0x164ba8,_0x4b4400){return function(_0x1915f6){if(!_0x1915f6){_0x164ba8['sendStatus'](0x194);}return _0x1915f6;};}function handleError(_0x5c1a09,_0x19e83b){_0x19e83b=_0x19e83b||0x1f4;return function(_0x399d79){logger['error'](_0x399d79['stack']);if(_0x399d79[_0x2150('0x27')]){delete _0x399d79['name'];}_0x5c1a09[_0x2150('0x19')](_0x19e83b)[_0x2150('0x28')](_0x399d79);};}exports[_0x2150('0x29')]=function(_0xb59e1d,_0x4d5b48){var _0x394c43={},_0x5f43ba={},_0x1b1d6a={'count':0x0,'rows':[]};var _0x58b983=_[_0x2150('0x2a')](db[_0x2150('0x2b')][_0x2150('0x2c')],function(_0x119e09){return{'name':_0x119e09[_0x2150('0x2d')],'type':_0x119e09[_0x2150('0x2e')][_0x2150('0x2f')]};});_0x5f43ba[_0x2150('0x30')]=_[_0x2150('0x2a')](_0x58b983,_0x2150('0x27'));_0x5f43ba[_0x2150('0x31')]=_[_0x2150('0x32')](_0xb59e1d[_0x2150('0x31')]);_0x5f43ba['filters']=_[_0x2150('0x33')](_0x5f43ba[_0x2150('0x30')],_0x5f43ba[_0x2150('0x31')]);_0x5f43ba[_0x2150('0x34')]=_[_0x2150('0x35')](_0x5f43ba[_0x2150('0x34')],['$and','$or',_0x2150('0x36'),_0x2150('0x37'),_0x2150('0x38'),'$lte',_0x2150('0x39'),_0x2150('0x3a'),_0x2150('0x3b'),'$between','$notBetween',_0x2150('0x3c'),_0x2150('0x3d'),_0x2150('0x3e'),_0x2150('0x3f'),_0x2150('0x40'),_0x2150('0x41'),_0x2150('0x3e'),_0x2150('0x42'),_0x2150('0x43'),_0x2150('0x44'),_0x2150('0x45')]);_0x394c43[_0x2150('0x46')]=_[_0x2150('0x33')](_0x5f43ba[_0x2150('0x30')],qs[_0x2150('0x47')](_0xb59e1d['query']['fields']));_0x394c43['attributes']=_0x394c43[_0x2150('0x46')]['length']?_0x394c43[_0x2150('0x46')]:_0x5f43ba['model'];if(!_0xb59e1d['query'][_0x2150('0x48')](_0x2150('0x49'))){_0x394c43[_0x2150('0x1e')]=qs[_0x2150('0x1e')](_0xb59e1d[_0x2150('0x31')]['limit']);_0x394c43[_0x2150('0x1c')]=qs[_0x2150('0x1c')](_0xb59e1d[_0x2150('0x31')]['offset']);}_0x394c43['order']=qs['sort'](_0xb59e1d[_0x2150('0x31')][_0x2150('0x4a')]);_0x394c43['where']=qs[_0x2150('0x34')](_[_0x2150('0x4b')](_0xb59e1d['query'],_0x5f43ba[_0x2150('0x34')]),_0x58b983);if(_0xb59e1d['query'][_0x2150('0x4c')]){_0x394c43['where']=_[_0x2150('0x4d')](_0x394c43[_0x2150('0x4e')],{'$or':_[_0x2150('0x2a')](_0x58b983,function(_0x13edb7){if(_0x13edb7[_0x2150('0x2e')]!==_0x2150('0x4f')){var _0x5d313f={};_0x5d313f[_0x13edb7[_0x2150('0x27')]]={'$like':'%'+_0xb59e1d['query'][_0x2150('0x4c')]+'%'};return _0x5d313f;}})});}_0x394c43=_[_0x2150('0x4d')]({},_0x394c43,_0xb59e1d[_0x2150('0x50')]);var _0x444072={'where':_0x394c43[_0x2150('0x4e')]};return db['CmHopper']['count'](_0x444072)['then'](function(_0x3a79ab){_0x1b1d6a[_0x2150('0x1f')]=_0x3a79ab;if(_0xb59e1d['query']['includeAll']){_0x394c43[_0x2150('0x51')]=[{'all':!![]}];}return db[_0x2150('0x2b')]['findAll'](_0x394c43);})[_0x2150('0x25')](function(_0x2891e8){_0x1b1d6a[_0x2150('0x52')]=_0x2891e8;return _0x1b1d6a;})[_0x2150('0x25')](respondWithFilteredResult(_0x4d5b48,_0x394c43))['catch'](handleError(_0x4d5b48,null));};exports['show']=function(_0x35610f,_0x1ac30e){var _0x1155f8={'raw':!![],'where':{'id':_0x35610f['params']['id']}},_0x2b2107={};_0x2b2107[_0x2150('0x30')]=_[_0x2150('0x32')](db[_0x2150('0x2b')][_0x2150('0x2c')]);_0x2b2107['query']=_['keys'](_0x35610f[_0x2150('0x31')]);_0x2b2107['filters']=_[_0x2150('0x33')](_0x2b2107[_0x2150('0x30')],_0x2b2107[_0x2150('0x31')]);_0x1155f8[_0x2150('0x46')]=_['intersection'](_0x2b2107[_0x2150('0x30')],qs[_0x2150('0x47')](_0x35610f['query'][_0x2150('0x47')]));_0x1155f8[_0x2150('0x46')]=_0x1155f8[_0x2150('0x46')][_0x2150('0x53')]?_0x1155f8[_0x2150('0x46')]:_0x2b2107[_0x2150('0x30')];if(_0x35610f[_0x2150('0x31')][_0x2150('0x54')]){_0x1155f8[_0x2150('0x51')]=[{'all':!![]}];}_0x1155f8=_[_0x2150('0x4d')]({},_0x1155f8,_0x35610f['options']);return db[_0x2150('0x2b')][_0x2150('0x55')](_0x1155f8)[_0x2150('0x25')](handleEntityNotFound(_0x1ac30e,null))['then'](respondWithResult(_0x1ac30e,null))['catch'](handleError(_0x1ac30e,null));};exports[_0x2150('0x56')]=function(_0x2be214,_0x17a100){return db[_0x2150('0x2b')][_0x2150('0x56')](_0x2be214[_0x2150('0x57')],{})[_0x2150('0x25')](respondWithResult(_0x17a100,0xc9))[_0x2150('0x58')](handleError(_0x17a100,null));};exports[_0x2150('0x24')]=function(_0x9cd1fd,_0x39e977){if(_0x9cd1fd[_0x2150('0x57')]['id']){delete _0x9cd1fd[_0x2150('0x57')]['id'];}return db[_0x2150('0x2b')][_0x2150('0x55')]({'where':{'id':_0x9cd1fd[_0x2150('0x59')]['id']}})[_0x2150('0x25')](handleEntityNotFound(_0x39e977,null))[_0x2150('0x25')](saveUpdates(_0x9cd1fd[_0x2150('0x57')],null))['then'](respondWithResult(_0x39e977,null))['catch'](handleError(_0x39e977,null));};exports[_0x2150('0x5a')]=function(_0x370682,_0x63ceb){return db['CmHopper']['describe']()[_0x2150('0x25')](respondWithResult(_0x63ceb,null))[_0x2150('0x58')](handleError(_0x63ceb,null));};exports['destroy']=function(_0x2e7347,_0x1842bb){var _0x2a39fd;return db[_0x2150('0x2b')][_0x2150('0x55')]({'where':{'id':_0x2e7347['params']['id']}})[_0x2150('0x25')](handleEntityNotFound(_0x1842bb,null))[_0x2150('0x25')](function(_0x336d47){if(_0x336d47){return _0x336d47[_0x2150('0x26')]()[_0x2150('0x25')](function(_0x299e50){return _0x299e50;});}})[_0x2150('0x25')](function(_0x1a5597){_0x2a39fd=_0x1a5597;if(_0x1a5597){if(_0x1a5597[_0x2150('0x5b')]||_0x1a5597['CampaignId']){return db[_0x1a5597[_0x2150('0x5b')]?_0x2150('0x5c'):_0x2150('0x5d')]['find']({'where':{'id':_0x1a5597[_0x2150('0x5b')]?_0x1a5597[_0x2150('0x5b')]:_0x1a5597[_0x2150('0x5e')]},'attributes':['id',_0x2150('0x27')],'raw':!![]});}}})['then'](function(_0x5133e9){var _0x786cfd={};if(_0x5133e9){_['merge'](_0x786cfd,_[_0x2150('0x5f')](_0x2a39fd[_0x2150('0x60')],['createdAt','updatedAt','id']));_0x786cfd[_0x2150('0x61')]=0x15;_0x786cfd[_0x2150('0x62')]='deleted';_0x786cfd[_0x2150('0x63')]=_0x5133e9[_0x2150('0x27')];_0x786cfd['membername']=_0x2e7347[_0x2150('0x64')][_0x2150('0x27')];_0x786cfd[_0x2150('0x65')]=_0x2e7347[_0x2150('0x64')]['id'];_0x786cfd[_0x2150('0x66')]=!![];_0x786cfd['deletedat']=moment()[_0x2150('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x786cfd['calleridnum']=_0x2a39fd[_0x2150('0x68')];_0x786cfd[_0x2150('0x69')]=_0x2a39fd[_0x2150('0x5b')]?_0x2150('0x6a'):_0x2150('0x6b');return db[_0x2150('0x6c')][_0x2150('0x55')]({'where':{'id':_0x786cfd[_0x2150('0x6d')]},'attributes':[_0x2150('0x6e'),_0x2150('0x6f')]})[_0x2150('0x25')](function(_0x383e23){if(!_['isNil'](_0x1842bb)&&!_['isNil'](_0x383e23[_0x2150('0x6e')])){_0x786cfd[_0x2150('0x70')]=_0x383e23[_0x2150('0x6e')];if(!_['isNil'](_0x383e23[_0x2150('0x6f')])){_0x786cfd[_0x2150('0x70')]+='\x20'+_0x383e23[_0x2150('0x6f')];}}})[_0x2150('0x71')](function(){return db['CmHopperFinal'][_0x2150('0x56')](_0x786cfd);});}})[_0x2150('0x25')](function(){return _0x1842bb[_0x2150('0x19')](0xcc)['end']();})[_0x2150('0x58')](handleError(_0x1842bb,null));};exports['getPreview']=function(_0x301e17,_0x399c39,_0x594e31){var _0x5d28c9=[];return db[_0x2150('0x6c')][_0x2150('0x5a')]()[_0x2150('0x25')](function(_0xc85ba0){_0x5d28c9=_[_0x2150('0x32')](_0xc85ba0);return _0x301e17[_0x2150('0x64')][_0x2150('0x72')]({'where':{'type':_0x2150('0x73'),'dialActive':!![],'dialMethod':_0x2150('0x74')},'attributes':['id',_0x2150('0x75'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x2150('0x25')](function(_0x50220c){if(_0x50220c&&_0x50220c[_0x2150('0x53')]){return db[_0x2150('0x76')][_0x2150('0x77')](function(_0x81ab87){var _0x1cf568={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2150('0x67')](_0x2150('0x78'))},'VoiceQueueId':{'$in':_['map'](_0x50220c,'id')},'$or':[{'UserId':null},{'UserId':_0x301e17[_0x2150('0x64')]['id']}]};var _0xf975bd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x50220c)['filter']([_0x2150('0x79'),0x0])[_0x2150('0x2a')]('id')[_0x2150('0x7a')]()},'$or':[{'UserId':null},{'UserId':_0x301e17[_0x2150('0x64')]['id']}]};var _0x1a620a={'$or':[_0x1cf568,_0xf975bd]};var _0x207636=[];if(_0x301e17[_0x2150('0x57')][_0x2150('0x7b')]&&_0x301e17[_0x2150('0x57')][_0x2150('0x7b')]===_0x2150('0x7c')){if(!_[_0x2150('0x7d')](_0x301e17[_0x2150('0x57')][_0x2150('0x7e')])){_0x1a620a['id']={'$in':_0x301e17[_0x2150('0x57')][_0x2150('0x7e')]};}_0x207636=[[_0x2150('0x7f'),_0x2150('0x80')],[_0x2150('0x81'),_0x50220c[0x0][_0x2150('0x75')]===_0x2150('0x80')?_0x2150('0x82'):_0x2150('0x80')],db[_0x2150('0x76')][_0x2150('0x83')](_0x2150('0x84')),['id',_0x2150('0x82')]];}else{if(!_[_0x2150('0x7d')](_0x301e17[_0x2150('0x57')][_0x2150('0x7e')])){_0x1a620a['id']={'$notIn':_0x301e17['body']['hopperIds']};}_0x207636=[[_0x2150('0x7f'),_0x2150('0x82')],[_0x2150('0x81'),_0x50220c[0x0][_0x2150('0x75')]],db[_0x2150('0x76')][_0x2150('0x83')](_0x2150('0x85')),['id',_0x2150('0x80')]];}return db['CmHopper'][_0x2150('0x86')]({'attributes':['id',_0x2150('0x87'),_0x2150('0x88')],'where':_0x1a620a,'order':_0x207636,'transaction':_0x81ab87,'lock':_0x81ab87['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x2150('0x89'),'attributes':_0x5d28c9,'include':[{'model':db[_0x2150('0x8a')],'as':_0x2150('0x8b'),'attributes':['id','name']}]},{'model':db[_0x2150('0x8c')],'as':_0x2150('0x8d'),'attributes':['id','name']},{'model':db[_0x2150('0x5c')],'as':_0x2150('0x8e'),'attributes':['id',_0x2150('0x27'),'dialActive']}]})[_0x2150('0x25')](function(_0x3b04c8){if(_0x3b04c8){return _0x3b04c8['update']({'UserId':_0x301e17['user']['id']},{'transaction':_0x81ab87});}});});}})['then'](handleEntityNotFound(_0x399c39,null))[_0x2150('0x25')](respondWithResult(_0x399c39,null))[_0x2150('0x58')](handleError(_0x399c39,null));};exports[_0x2150('0x8f')]=function(_0x589860,_0x49d052,_0x41cdc6){return _0x589860[_0x2150('0x64')][_0x2150('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x2150('0x74')},'attributes':['id'],'raw':!![]})[_0x2150('0x25')](function(_0x45537d){if(_0x45537d&&_0x45537d[_0x2150('0x53')]){return db[_0x2150('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2150('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x45537d,'id')},'$or':[{'UserId':null},{'UserId':_0x589860['user']['id']}]}});}return 0x0;})[_0x2150('0x25')](function(_0x50dff0){if(!_['isNil'](_0x50dff0)&&_['isNumber'](_0x50dff0)){return _0x49d052[_0x2150('0x19')](0xc8)[_0x2150('0x1b')]({'contacts':_0x50dff0});}else{logger['error'](_0x2150('0x90'),_0x2150('0x8f'),0x194,_0x2150('0x91'));_0x49d052['sendStatus'](0x194);}})[_0x2150('0x58')](handleError(_0x49d052,null));}; \ No newline at end of file +var _0xf257=['querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','key','query','filters','intersection','model','concat','$or','$gt','$gte','$lt','$lte','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','includeAll','create','body','describe','find','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','membername','user','deletedat','format','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','filter','value','prev','isEmpty','hopperIds','ASC','scheduledAt','dialOrderByScheduledAt','literal','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43ab24,_0x34f361){var _0x4144a9=function(_0x53b919){while(--_0x53b919){_0x43ab24['push'](_0x43ab24['shift']());}};_0x4144a9(++_0x34f361);}(_0xf257,0x82));var _0x7f25=function(_0x2ba3bd,_0x10d4aa){_0x2ba3bd=_0x2ba3bd-0x0;var _0x53a169=_0xf257[_0x2ba3bd];return _0x53a169;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f25('0x0'));var jsonpatch=require(_0x7f25('0x1'));var rp=require(_0x7f25('0x2'));var moment=require(_0x7f25('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7f25('0x4'));var util=require(_0x7f25('0x5'));var path=require(_0x7f25('0x6'));var sox=require(_0x7f25('0x7'));var csv=require(_0x7f25('0x8'));var ejs=require(_0x7f25('0x9'));var fs=require('fs');var fs_extra=require(_0x7f25('0xa'));var _=require(_0x7f25('0xb'));var squel=require(_0x7f25('0xc'));var crypto=require(_0x7f25('0xd'));var jsforce=require(_0x7f25('0xe'));var deskjs=require(_0x7f25('0xf'));var toCsv=require(_0x7f25('0x8'));var querystring=require(_0x7f25('0x10'));var Papa=require('papaparse');var Redis=require(_0x7f25('0x11'));var authService=require(_0x7f25('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f25('0x13'));var logger=require('../../config/logger')(_0x7f25('0x14'));var utils=require(_0x7f25('0x15'));var config=require(_0x7f25('0x16'));var licenseUtil=require(_0x7f25('0x17'));var db=require(_0x7f25('0x18'))['db'];function respondWithStatusCode(_0x1f7549,_0x2c960f){_0x2c960f=_0x2c960f||0xcc;return function(_0x5993ea){if(_0x5993ea){return _0x1f7549['sendStatus'](_0x2c960f);}return _0x1f7549[_0x7f25('0x19')](_0x2c960f)['end']();};}function respondWithResult(_0x397398,_0x19b76b){_0x19b76b=_0x19b76b||0xc8;return function(_0x3f8ed9){if(_0x3f8ed9){return _0x397398[_0x7f25('0x19')](_0x19b76b)[_0x7f25('0x1a')](_0x3f8ed9);}};}function respondWithFilteredResult(_0x4e00bf,_0x48778d){return function(_0x4eb36e){if(_0x4eb36e){var _0x3b5424=typeof _0x48778d[_0x7f25('0x1b')]===_0x7f25('0x1c')&&typeof _0x48778d[_0x7f25('0x1d')]===_0x7f25('0x1c');var _0x7cb17f=_0x4eb36e[_0x7f25('0x1e')];var _0x26d4aa=_0x3b5424?0x0:_0x48778d['offset'];var _0x23f30c=_0x3b5424?_0x4eb36e[_0x7f25('0x1e')]:_0x48778d[_0x7f25('0x1b')]+_0x48778d[_0x7f25('0x1d')];var _0x1647b9;if(_0x23f30c>=_0x7cb17f){_0x23f30c=_0x7cb17f;_0x1647b9=0xc8;}else{_0x1647b9=0xce;}_0x4e00bf[_0x7f25('0x19')](_0x1647b9);return _0x4e00bf['set']('Content-Range',_0x26d4aa+'-'+_0x23f30c+'/'+_0x7cb17f)[_0x7f25('0x1a')](_0x4eb36e);}return null;};}function patchUpdates(_0x57275e){return function(_0x18f978){try{jsonpatch[_0x7f25('0x1f')](_0x18f978,_0x57275e,!![]);}catch(_0x30be2f){return BPromise[_0x7f25('0x20')](_0x30be2f);}return _0x18f978[_0x7f25('0x21')]();};}function saveUpdates(_0x225948,_0x31bf5f){return function(_0x4be8b8){if(_0x4be8b8){return _0x4be8b8[_0x7f25('0x22')](_0x225948)[_0x7f25('0x23')](function(_0x456d84){return _0x456d84;});}return null;};}function removeEntity(_0x152fe9,_0x29039a){return function(_0x4955e0){if(_0x4955e0){return _0x4955e0[_0x7f25('0x24')]()[_0x7f25('0x23')](function(){_0x152fe9[_0x7f25('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b38c,_0x5372eb){return function(_0x467650){if(!_0x467650){_0x17b38c[_0x7f25('0x25')](0x194);}return _0x467650;};}function handleError(_0x217032,_0x1dad21){_0x1dad21=_0x1dad21||0x1f4;return function(_0x382fd4){logger[_0x7f25('0x26')](_0x382fd4[_0x7f25('0x27')]);if(_0x382fd4[_0x7f25('0x28')]){delete _0x382fd4[_0x7f25('0x28')];}_0x217032[_0x7f25('0x19')](_0x1dad21)['send'](_0x382fd4);};}exports['index']=function(_0x3a6b2f,_0x756b80){var _0x4934b4={},_0xa373ee={},_0x340f1b={'count':0x0,'rows':[]};var _0x2bc378=_[_0x7f25('0x29')](db[_0x7f25('0x2a')][_0x7f25('0x2b')],function(_0x574099){return{'name':_0x574099[_0x7f25('0x2c')],'type':_0x574099['type'][_0x7f25('0x2d')]};});_0xa373ee['model']=_[_0x7f25('0x29')](_0x2bc378,_0x7f25('0x28'));_0xa373ee[_0x7f25('0x2e')]=_['keys'](_0x3a6b2f[_0x7f25('0x2e')]);_0xa373ee[_0x7f25('0x2f')]=_[_0x7f25('0x30')](_0xa373ee[_0x7f25('0x31')],_0xa373ee[_0x7f25('0x2e')]);_0xa373ee[_0x7f25('0x2f')]=_[_0x7f25('0x32')](_0xa373ee[_0x7f25('0x2f')],['$and',_0x7f25('0x33'),_0x7f25('0x34'),_0x7f25('0x35'),_0x7f25('0x36'),_0x7f25('0x37'),'$ne','$eq','$not',_0x7f25('0x38'),_0x7f25('0x39'),_0x7f25('0x3a'),'$notIn',_0x7f25('0x3b'),_0x7f25('0x3c'),'$iLike',_0x7f25('0x3d'),'$like',_0x7f25('0x3e'),_0x7f25('0x3f'),'$contained',_0x7f25('0x40')]);_0x4934b4[_0x7f25('0x41')]=_[_0x7f25('0x30')](_0xa373ee[_0x7f25('0x31')],qs[_0x7f25('0x42')](_0x3a6b2f[_0x7f25('0x2e')]['fields']));_0x4934b4[_0x7f25('0x41')]=_0x4934b4[_0x7f25('0x41')][_0x7f25('0x43')]?_0x4934b4['attributes']:_0xa373ee[_0x7f25('0x31')];if(!_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x44')](_0x7f25('0x45'))){_0x4934b4[_0x7f25('0x1d')]=qs['limit'](_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x1d')]);_0x4934b4[_0x7f25('0x1b')]=qs[_0x7f25('0x1b')](_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x1b')]);}_0x4934b4[_0x7f25('0x46')]=qs[_0x7f25('0x47')](_0x3a6b2f['query'][_0x7f25('0x47')]);_0x4934b4['where']=qs[_0x7f25('0x2f')](_[_0x7f25('0x48')](_0x3a6b2f[_0x7f25('0x2e')],_0xa373ee[_0x7f25('0x2f')]),_0x2bc378);if(_0x3a6b2f[_0x7f25('0x2e')]['filter']){_0x4934b4[_0x7f25('0x49')]=_['merge'](_0x4934b4['where'],{'$or':_['map'](_0x2bc378,function(_0x25d4cd){if(_0x25d4cd['type']!==_0x7f25('0x4a')){var _0x169bc4={};_0x169bc4[_0x25d4cd[_0x7f25('0x28')]]={'$like':'%'+_0x3a6b2f['query']['filter']+'%'};return _0x169bc4;}})});}_0x4934b4=_[_0x7f25('0x4b')]({},_0x4934b4,_0x3a6b2f[_0x7f25('0x4c')]);var _0x30055c={'where':_0x4934b4[_0x7f25('0x49')]};return db['CmHopper'][_0x7f25('0x1e')](_0x30055c)['then'](function(_0x4fd21f){_0x340f1b['count']=_0x4fd21f;if(_0x3a6b2f[_0x7f25('0x2e')]['includeAll']){_0x4934b4[_0x7f25('0x4d')]=[{'all':!![]}];}return db[_0x7f25('0x2a')][_0x7f25('0x4e')](_0x4934b4);})[_0x7f25('0x23')](function(_0x2cfa07){_0x340f1b[_0x7f25('0x4f')]=_0x2cfa07;return _0x340f1b;})['then'](respondWithFilteredResult(_0x756b80,_0x4934b4))[_0x7f25('0x50')](handleError(_0x756b80,null));};exports['show']=function(_0x53a8c0,_0x5740b0){var _0x3b2440={'raw':!![],'where':{'id':_0x53a8c0[_0x7f25('0x51')]['id']}},_0x28a586={};_0x28a586[_0x7f25('0x31')]=_[_0x7f25('0x52')](db[_0x7f25('0x2a')]['rawAttributes']);_0x28a586['query']=_[_0x7f25('0x52')](_0x53a8c0[_0x7f25('0x2e')]);_0x28a586['filters']=_[_0x7f25('0x30')](_0x28a586[_0x7f25('0x31')],_0x28a586[_0x7f25('0x2e')]);_0x3b2440['attributes']=_[_0x7f25('0x30')](_0x28a586['model'],qs[_0x7f25('0x42')](_0x53a8c0[_0x7f25('0x2e')][_0x7f25('0x42')]));_0x3b2440['attributes']=_0x3b2440[_0x7f25('0x41')][_0x7f25('0x43')]?_0x3b2440[_0x7f25('0x41')]:_0x28a586[_0x7f25('0x31')];if(_0x53a8c0['query'][_0x7f25('0x53')]){_0x3b2440[_0x7f25('0x4d')]=[{'all':!![]}];}_0x3b2440=_[_0x7f25('0x4b')]({},_0x3b2440,_0x53a8c0['options']);return db[_0x7f25('0x2a')]['find'](_0x3b2440)['then'](handleEntityNotFound(_0x5740b0,null))['then'](respondWithResult(_0x5740b0,null))['catch'](handleError(_0x5740b0,null));};exports['create']=function(_0x1a8868,_0x20b808){return db[_0x7f25('0x2a')][_0x7f25('0x54')](_0x1a8868['body'],{})[_0x7f25('0x23')](respondWithResult(_0x20b808,0xc9))[_0x7f25('0x50')](handleError(_0x20b808,null));};exports[_0x7f25('0x22')]=function(_0x1dbf7e,_0x4ae270){if(_0x1dbf7e[_0x7f25('0x55')]['id']){delete _0x1dbf7e[_0x7f25('0x55')]['id'];}return db[_0x7f25('0x2a')]['find']({'where':{'id':_0x1dbf7e['params']['id']}})[_0x7f25('0x23')](handleEntityNotFound(_0x4ae270,null))[_0x7f25('0x23')](saveUpdates(_0x1dbf7e[_0x7f25('0x55')],null))[_0x7f25('0x23')](respondWithResult(_0x4ae270,null))['catch'](handleError(_0x4ae270,null));};exports[_0x7f25('0x56')]=function(_0x4e1370,_0x1b6e1c){return db[_0x7f25('0x2a')]['describe']()[_0x7f25('0x23')](respondWithResult(_0x1b6e1c,null))['catch'](handleError(_0x1b6e1c,null));};exports[_0x7f25('0x24')]=function(_0x49ffb1,_0x4e3322){var _0x4d2539;return db[_0x7f25('0x2a')][_0x7f25('0x57')]({'where':{'id':_0x49ffb1['params']['id']}})[_0x7f25('0x23')](handleEntityNotFound(_0x4e3322,null))[_0x7f25('0x23')](function(_0xd786de){if(_0xd786de){return _0xd786de['destroy']()['then'](function(_0x56cc73){return _0x56cc73;});}})['then'](function(_0x2631ed){_0x4d2539=_0x2631ed;if(_0x2631ed){if(_0x2631ed[_0x7f25('0x58')]||_0x2631ed[_0x7f25('0x59')]){return db[_0x2631ed[_0x7f25('0x58')]?_0x7f25('0x5a'):_0x7f25('0x5b')][_0x7f25('0x57')]({'where':{'id':_0x2631ed[_0x7f25('0x58')]?_0x2631ed[_0x7f25('0x58')]:_0x2631ed[_0x7f25('0x59')]},'attributes':['id',_0x7f25('0x28')],'raw':!![]});}}})[_0x7f25('0x23')](function(_0x2553b2){var _0xbbe14b={};if(_0x2553b2){_['merge'](_0xbbe14b,_[_0x7f25('0x5c')](_0x4d2539[_0x7f25('0x5d')],[_0x7f25('0x5e'),'updatedAt','id']));_0xbbe14b[_0x7f25('0x5f')]=0x15;_0xbbe14b[_0x7f25('0x60')]=_0x7f25('0x61');_0xbbe14b['campaign']=_0x2553b2['name'];_0xbbe14b[_0x7f25('0x62')]=_0x49ffb1['user']['name'];_0xbbe14b['UserId']=_0x49ffb1[_0x7f25('0x63')]['id'];_0xbbe14b[_0x7f25('0x61')]=!![];_0xbbe14b[_0x7f25('0x64')]=moment()[_0x7f25('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0xbbe14b[_0x7f25('0x66')]=_0x4d2539['phone'];_0xbbe14b[_0x7f25('0x67')]=_0x4d2539[_0x7f25('0x58')]?_0x7f25('0x68'):_0x7f25('0x69');return db[_0x7f25('0x6a')][_0x7f25('0x57')]({'where':{'id':_0xbbe14b['ContactId']},'attributes':[_0x7f25('0x6b'),_0x7f25('0x6c')]})[_0x7f25('0x23')](function(_0xb0aa08){if(!_[_0x7f25('0x6d')](_0x4e3322)&&!_[_0x7f25('0x6d')](_0xb0aa08['firstName'])){_0xbbe14b['calleridname']=_0xb0aa08['firstName'];if(!_[_0x7f25('0x6d')](_0xb0aa08[_0x7f25('0x6c')])){_0xbbe14b[_0x7f25('0x6e')]+='\x20'+_0xb0aa08['lastName'];}}})[_0x7f25('0x6f')](function(){return db['CmHopperFinal'][_0x7f25('0x54')](_0xbbe14b);});}})['then'](function(){return _0x4e3322[_0x7f25('0x19')](0xcc)['end']();})[_0x7f25('0x50')](handleError(_0x4e3322,null));};exports[_0x7f25('0x70')]=function(_0x4784d2,_0x3548f3,_0x28b983){var _0x3c9613=[];return db[_0x7f25('0x6a')][_0x7f25('0x56')]()[_0x7f25('0x23')](function(_0x342fe4){_0x3c9613=_['keys'](_0x342fe4);return _0x4784d2[_0x7f25('0x63')][_0x7f25('0x71')]({'where':{'type':_0x7f25('0x72'),'dialActive':!![],'dialMethod':_0x7f25('0x73')},'attributes':['id','dialOrderByScheduledAt',_0x7f25('0x74')],'raw':!![]});})[_0x7f25('0x23')](function(_0x36ef4f){if(_0x36ef4f&&_0x36ef4f['length']){return db[_0x7f25('0x75')][_0x7f25('0x76')](function(_0x1f2b3d){var _0x2e42d7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7f25('0x65')](_0x7f25('0x77'))},'VoiceQueueId':{'$in':_['map'](_0x36ef4f,'id')},'$or':[{'UserId':null},{'UserId':_0x4784d2[_0x7f25('0x63')]['id']}]};var _0x3e6cb5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x36ef4f)[_0x7f25('0x78')]([_0x7f25('0x74'),0x0])[_0x7f25('0x29')]('id')[_0x7f25('0x79')]()},'$or':[{'UserId':null},{'UserId':_0x4784d2['user']['id']}]};var _0x5cd1cc={'$or':[_0x2e42d7,_0x3e6cb5]};var _0x1a599d=[];if(_0x4784d2[_0x7f25('0x55')]['direction']&&_0x4784d2['body']['direction']===_0x7f25('0x7a')){if(!_[_0x7f25('0x7b')](_0x4784d2[_0x7f25('0x55')][_0x7f25('0x7c')])){_0x5cd1cc['id']={'$in':_0x4784d2[_0x7f25('0x55')][_0x7f25('0x7c')]};}_0x1a599d=[['priority',_0x7f25('0x7d')],[_0x7f25('0x7e'),_0x36ef4f[0x0][_0x7f25('0x7f')]===_0x7f25('0x7d')?'DESC':'ASC'],db[_0x7f25('0x75')][_0x7f25('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_['isEmpty'](_0x4784d2[_0x7f25('0x55')]['hopperIds'])){_0x5cd1cc['id']={'$notIn':_0x4784d2[_0x7f25('0x55')][_0x7f25('0x7c')]};}_0x1a599d=[[_0x7f25('0x81'),'DESC'],['scheduledAt',_0x36ef4f[0x0][_0x7f25('0x7f')]],db['sequelize'][_0x7f25('0x80')](_0x7f25('0x82')),['id','ASC']];}return db[_0x7f25('0x2a')][_0x7f25('0x83')]({'attributes':['id','scheduledat',_0x7f25('0x84')],'where':_0x5cd1cc,'order':_0x1a599d,'transaction':_0x1f2b3d,'lock':_0x1f2b3d[_0x7f25('0x85')][_0x7f25('0x86')],'include':[{'model':db[_0x7f25('0x6a')],'as':_0x7f25('0x87'),'attributes':_0x3c9613,'include':[{'model':db[_0x7f25('0x88')],'as':_0x7f25('0x89'),'attributes':['id',_0x7f25('0x28')]}]},{'model':db[_0x7f25('0x8a')],'as':_0x7f25('0x8b'),'attributes':['id',_0x7f25('0x28')]},{'model':db['VoiceQueue'],'as':_0x7f25('0x8c'),'attributes':['id',_0x7f25('0x28'),_0x7f25('0x8d')]}]})[_0x7f25('0x23')](function(_0x18be6a){if(_0x18be6a){return _0x18be6a[_0x7f25('0x22')]({'UserId':_0x4784d2[_0x7f25('0x63')]['id']},{'transaction':_0x1f2b3d});}});});}})[_0x7f25('0x23')](handleEntityNotFound(_0x3548f3,null))[_0x7f25('0x23')](respondWithResult(_0x3548f3,null))[_0x7f25('0x50')](handleError(_0x3548f3,null));};exports[_0x7f25('0x8e')]=function(_0x26db0b,_0x1d8852,_0x21656f){return _0x26db0b['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7f25('0x73')},'attributes':['id'],'raw':!![]})[_0x7f25('0x23')](function(_0x550bdb){if(_0x550bdb&&_0x550bdb[_0x7f25('0x43')]){return db['CmHopper'][_0x7f25('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7f25('0x77'))},'VoiceQueueId':{'$in':_[_0x7f25('0x29')](_0x550bdb,'id')},'$or':[{'UserId':null},{'UserId':_0x26db0b[_0x7f25('0x63')]['id']}]}});}return 0x0;})[_0x7f25('0x23')](function(_0x1b0daa){if(!_[_0x7f25('0x6d')](_0x1b0daa)&&_[_0x7f25('0x8f')](_0x1b0daa)){return _0x1d8852[_0x7f25('0x19')](0xc8)[_0x7f25('0x1a')]({'contacts':_0x1b0daa});}else{logger[_0x7f25('0x26')](_0x7f25('0x90'),_0x7f25('0x8e'),0x194,_0x7f25('0x91'));_0x1d8852[_0x7f25('0x25')](0x194);}})[_0x7f25('0x50')](handleError(_0x1d8852,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3f65f11..9823983 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','priority','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x326f,0xd1));var _0xf326=function(_0x56d877,_0x2fa83c){_0x56d877=_0x56d877-0x0;var _0x4d7c47=_0x326f[_0x56d877];return _0x4d7c47;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0xf326('0xe'),'fields':[_0xf326('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0xb92d49,_0x5d3424){var _0x3150f4=function(_0x42c820){while(--_0x42c820){_0xb92d49['push'](_0xb92d49['shift']());}};_0x3150f4(++_0x5d3424);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2cc594,_0x4d727b){_0x2cc594=_0x2cc594-0x0;var _0x4abff7=_0xfcf0[_0x2cc594];return _0x4abff7;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 9a53685..fd3f00e 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe149=['LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetCmHopper','CmHopper','findAll','options','limit','map','include','attributes','model','debug','ShowCmHopper','raw','where','catch','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order'];(function(_0x17d058,_0xab1bd3){var _0x4b9196=function(_0x33f5ae){while(--_0x33f5ae){_0x17d058['push'](_0x17d058['shift']());}};_0x4b9196(++_0xab1bd3);}(_0xe149,0x1d9));var _0x9e14=function(_0x3cd758,_0x1795ce){_0x3cd758=_0x3cd758-0x0;var _0xbd590f=_0xe149[_0x3cd758];return _0xbd590f;};'use strict';var _=require(_0x9e14('0x0'));var util=require(_0x9e14('0x1'));var moment=require(_0x9e14('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e14('0x3'));var fs=require('fs');var Redis=require(_0x9e14('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e14('0x5'));var logger=require(_0x9e14('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e14('0x7')][_0x9e14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x294a08,_0x34d354,_0xfe448f){return new BPromise(function(_0x1ac97e,_0x33742f){return client['request'](_0x294a08,_0xfe448f)[_0x9e14('0x9')](function(_0x4c840a){logger['info'](_0x9e14('0xa'),_0x34d354,_0x9e14('0xb'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x34d354,_0x9e14('0xb'),JSON[_0x9e14('0xc')](_0x4c840a));if(_0x4c840a['error']){if(_0x4c840a['error']['code']===0x1f4){logger[_0x9e14('0xd')](_0x9e14('0xa'),_0x34d354,_0x4c840a['error'][_0x9e14('0xe')]);return _0x33742f(_0x4c840a['error'][_0x9e14('0xe')]);}logger[_0x9e14('0xd')](_0x9e14('0xa'),_0x34d354,_0x4c840a[_0x9e14('0xd')][_0x9e14('0xe')]);return _0x1ac97e(_0x4c840a[_0x9e14('0xd')][_0x9e14('0xe')]);}else{logger[_0x9e14('0xf')](_0x9e14('0xa'),_0x34d354,_0x9e14('0xb'));_0x1ac97e(_0x4c840a[_0x9e14('0x10')][_0x9e14('0xe')]);}})['catch'](function(_0x31c414){logger[_0x9e14('0xd')]('CmHopper,\x20%s,\x20%s',_0x34d354,_0x31c414);_0x33742f(_0x31c414);});});}exports[_0x9e14('0x11')]=function(_0x1fa3b4){var _0x5ce012=this;return new Promise(function(_0x2f57d8,_0x28e028){return db[_0x9e14('0x12')][_0x9e14('0x13')]({'raw':_0x1fa3b4[_0x9e14('0x14')]?_0x1fa3b4[_0x9e14('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1fa3b4['options']?_0x1fa3b4['options']['where']||null:null,'attributes':_0x1fa3b4[_0x9e14('0x14')]?_0x1fa3b4['options']['attributes']||null:null,'limit':_0x1fa3b4[_0x9e14('0x14')]?_0x1fa3b4[_0x9e14('0x14')][_0x9e14('0x15')]||null:null,'include':_0x1fa3b4[_0x9e14('0x14')]?_0x1fa3b4[_0x9e14('0x14')]['include']?_[_0x9e14('0x16')](_0x1fa3b4[_0x9e14('0x14')][_0x9e14('0x17')],function(_0x4716a0){return{'model':db[_0x4716a0['model']],'as':_0x4716a0['as'],'attributes':_0x4716a0[_0x9e14('0x18')],'include':_0x4716a0[_0x9e14('0x17')]?_['map'](_0x4716a0[_0x9e14('0x17')],function(_0x4a420b){return{'model':db[_0x4a420b[_0x9e14('0x19')]],'as':_0x4a420b['as'],'attributes':_0x4a420b[_0x9e14('0x18')],'include':_0x4a420b[_0x9e14('0x17')]?_['map'](_0x4a420b[_0x9e14('0x17')],function(_0x3d332f){return{'model':db[_0x3d332f[_0x9e14('0x19')]],'as':_0x3d332f['as'],'attributes':_0x3d332f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x438ed8){logger[_0x9e14('0xf')]('GetCmHopper',_0x1fa3b4);logger[_0x9e14('0x1a')](_0x9e14('0x11'),_0x1fa3b4,JSON[_0x9e14('0xc')](_0x438ed8));_0x2f57d8(_0x438ed8);})['catch'](function(_0x43954){logger[_0x9e14('0xd')](_0x9e14('0x11'),_0x43954['message'],_0x1fa3b4);_0x28e028(_0x5ce012[_0x9e14('0xd')](0x1f4,_0x43954[_0x9e14('0xe')]));});});};exports[_0x9e14('0x1b')]=function(_0x1d0962){var _0x48ce53=this;return new Promise(function(_0x1fbafe,_0x3f7fda){return db[_0x9e14('0x12')]['find']({'raw':_0x1d0962[_0x9e14('0x14')]?_0x1d0962[_0x9e14('0x14')][_0x9e14('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d0962[_0x9e14('0x14')]?_0x1d0962[_0x9e14('0x14')][_0x9e14('0x1d')]||null:null,'attributes':_0x1d0962[_0x9e14('0x14')]?_0x1d0962['options'][_0x9e14('0x18')]||null:null,'include':_0x1d0962[_0x9e14('0x14')]?_0x1d0962[_0x9e14('0x14')]['include']?_['map'](_0x1d0962[_0x9e14('0x14')][_0x9e14('0x17')],function(_0x414237){return{'model':db[_0x414237[_0x9e14('0x19')]],'as':_0x414237['as'],'attributes':_0x414237['attributes'],'include':_0x414237[_0x9e14('0x17')]?_['map'](_0x414237[_0x9e14('0x17')],function(_0x19de7a){return{'model':db[_0x19de7a[_0x9e14('0x19')]],'as':_0x19de7a['as'],'attributes':_0x19de7a[_0x9e14('0x18')],'include':_0x19de7a[_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x19de7a[_0x9e14('0x17')],function(_0x3f999a){return{'model':db[_0x3f999a[_0x9e14('0x19')]],'as':_0x3f999a['as'],'attributes':_0x3f999a[_0x9e14('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e14('0x9')](function(_0x47289e){logger[_0x9e14('0xf')](_0x9e14('0x1b'),_0x1d0962);logger[_0x9e14('0x1a')](_0x9e14('0x1b'),_0x1d0962,JSON['stringify'](_0x47289e));_0x1fbafe(_0x47289e);})[_0x9e14('0x1e')](function(_0x34d3ff){logger[_0x9e14('0xd')](_0x9e14('0x1b'),_0x34d3ff['message'],_0x1d0962);_0x3f7fda(_0x48ce53[_0x9e14('0xd')](0x1f4,_0x34d3ff['message']));});});};exports[_0x9e14('0x1f')]=function(_0x2141c4){var _0x30e9da=this;return new Promise(function(_0x4afeca,_0x2644cd){return db['CmHopper'][_0x9e14('0x20')](_0x2141c4[_0x9e14('0x21')],{'raw':_0x2141c4[_0x9e14('0x14')]?_0x2141c4[_0x9e14('0x14')][_0x9e14('0x1c')]===undefined?!![]:![]:!![]})[_0x9e14('0x9')](function(_0x54a96a){logger['info'](_0x9e14('0x1f'),_0x2141c4);logger[_0x9e14('0x1a')](_0x9e14('0x1f'),_0x2141c4,JSON[_0x9e14('0xc')](_0x54a96a));_0x4afeca(_0x54a96a);})[_0x9e14('0x1e')](function(_0x582117){logger[_0x9e14('0xd')](_0x9e14('0x1f'),_0x582117[_0x9e14('0xe')],_0x2141c4);_0x2644cd(_0x30e9da[_0x9e14('0xd')](0x1f4,_0x582117[_0x9e14('0xe')]));});});};exports[_0x9e14('0x22')]=function(_0x351f7e){var _0x3b191b=this;return new Promise(function(_0x4b1205,_0x4efc06){return db[_0x9e14('0x12')][_0x9e14('0x23')](_0x351f7e['body'],{'raw':_0x351f7e[_0x9e14('0x14')]?_0x351f7e['options'][_0x9e14('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351f7e[_0x9e14('0x14')]?_0x351f7e['options'][_0x9e14('0x1d')]||null:null,'attributes':_0x351f7e[_0x9e14('0x14')]?_0x351f7e[_0x9e14('0x14')][_0x9e14('0x18')]||null:null,'limit':_0x351f7e['options']?_0x351f7e[_0x9e14('0x14')]['limit']||null:null})[_0x9e14('0x9')](function(_0x66f01e){logger[_0x9e14('0xf')](_0x9e14('0x22'),_0x351f7e);logger['info'](_0x9e14('0x24'),JSON['stringify'](_0x351f7e[_0x9e14('0x14')][_0x9e14('0x1d')]),_0x351f7e[_0x9e14('0x21')][_0x9e14('0x25')]);logger[_0x9e14('0x1a')](_0x9e14('0x22'),_0x351f7e,JSON[_0x9e14('0xc')](_0x66f01e));_0x4b1205(_0x66f01e);})[_0x9e14('0x1e')](function(_0xa6bdfd){logger['error']('UpdateCmHopper',_0xa6bdfd[_0x9e14('0xe')],_0x351f7e);_0x4efc06(_0x3b191b[_0x9e14('0xd')](0x1f4,_0xa6bdfd[_0x9e14('0xe')]));});});};exports[_0x9e14('0x26')]=function(_0xf4cb9){var _0x36fdde=this;return new Promise(function(_0x2a5e4c,_0x1352c1){return db[_0x9e14('0x12')][_0x9e14('0x27')]({'where':_0xf4cb9[_0x9e14('0x14')]?_0xf4cb9[_0x9e14('0x14')][_0x9e14('0x1d')]||null:null})[_0x9e14('0x9')](function(_0x398fac){logger['info'](_0x9e14('0x26'),_0xf4cb9);logger['debug'](_0x9e14('0x26'),_0xf4cb9,JSON['stringify'](_0x398fac));_0x2a5e4c(_0x398fac);})[_0x9e14('0x1e')](function(_0x3729db){logger['error'](_0x9e14('0x26'),_0x3729db[_0x9e14('0xe')],_0xf4cb9);_0x1352c1(_0x36fdde[_0x9e14('0xd')](0x1f4,_0x3729db[_0x9e14('0xe')]));});});};exports['GetContactDialer']=function(_0xad7e3e){var _0xb4d314=this;return new Promise(function(_0x2512b6,_0x208a4f){return db[_0x9e14('0x28')][_0x9e14('0x29')]()[_0x9e14('0x9')](function(_0x234572){return db[_0x9e14('0x2a')][_0x9e14('0x2b')](function(_0x1e45e2){return db[_0x9e14('0x12')][_0x9e14('0x13')]({'where':_0xad7e3e[_0x9e14('0x14')]?_0xad7e3e['options'][_0x9e14('0x1d')]||null:null,'attributes':_0xad7e3e[_0x9e14('0x14')]?_0xad7e3e[_0x9e14('0x14')][_0x9e14('0x18')]||null:null,'limit':_0xad7e3e[_0x9e14('0x14')]?_0xad7e3e[_0x9e14('0x14')]['limit']||null:null,'order':_0xad7e3e[_0x9e14('0x14')]?_0xad7e3e[_0x9e14('0x14')][_0x9e14('0x2c')]||null:null,'transaction':_0x1e45e2,'lock':_0x1e45e2[_0x9e14('0x2d')]['UPDATE'],'include':[{'model':db[_0x9e14('0x28')],'as':_0x9e14('0x2e'),'attributes':_[_0x9e14('0x2f')](_0x234572)},{'model':db[_0x9e14('0x30')],'as':_0x9e14('0x31'),'attributes':['id',_0x9e14('0x32'),_0x9e14('0x33')]}]})[_0x9e14('0x9')](function(_0x408bf8){var _0x3d282b=[];var _0x55cb95=[];for(var _0x496d54=0x0;_0x496d54<_0x408bf8[_0x9e14('0x34')];_0x496d54+=0x1){var _0x137d37=_0x408bf8[_0x496d54][_0x9e14('0x35')];if(_0x137d37===null){_0x3d282b[_0x9e14('0x36')](_0x408bf8[_0x496d54][_0x9e14('0x23')](_0xad7e3e['body'],{'transaction':_0x1e45e2}));}else if(!_0x55cb95[_0x9e14('0x37')](_0x137d37)){_0x55cb95[_0x9e14('0x36')](_0x137d37);_0x3d282b[_0x9e14('0x36')](_0x408bf8[_0x496d54]['update'](_0xad7e3e['body'],{'transaction':_0x1e45e2}));}}return BPromise[_0x9e14('0x38')](_0x3d282b);});})[_0x9e14('0x9')](function(_0x221432){logger[_0x9e14('0xf')]('GetContactDialer',_0xad7e3e);if(_0x221432[_0x9e14('0x34')]>0x0){logger[_0x9e14('0xf')](_0x9e14('0x39'),_0x221432[0x0]['dataValues']['id'],_0x221432[0x0][_0x9e14('0x3a')][_0x9e14('0x3b')],_0x221432[0x0][_0x9e14('0x3a')][_0x9e14('0x25')]);}logger['debug']('GetContactDialer',_0xad7e3e,JSON[_0x9e14('0xc')](_0x221432));_0x2512b6(_0x221432);})['catch'](function(_0x4aa8f1){logger['error'](_0x9e14('0x3c'),_0x4aa8f1['message'],_0xad7e3e);_0x208a4f(_0xb4d314[_0x9e14('0xd')](0x1f4,_0x4aa8f1[_0x9e14('0xe')]));});});});};exports[_0x9e14('0x3d')]=function(_0x5d7e09){var _0x14d30b=this;return new Promise(function(_0x1ec115,_0x2c1850){return db[_0x9e14('0x2a')][_0x9e14('0x2b')](function(_0x21fd86){return db[_0x9e14('0x3e')]['create'](_0x5d7e09[_0x9e14('0x21')],{'raw':_0x5d7e09['options']?_0x5d7e09[_0x9e14('0x14')][_0x9e14('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x21fd86})[_0x9e14('0x9')](function(){logger['info'](_0x9e14('0x3f'),JSON[_0x9e14('0xc')](_0x5d7e09[_0x9e14('0x14')]['where']),_0x5d7e09['options'][_0x9e14('0x1d')][_0x9e14('0x25')]);return db[_0x9e14('0x12')][_0x9e14('0x27')]({'where':_0x5d7e09[_0x9e14('0x14')]?_0x5d7e09['options']['where']||null:null,'transaction':_0x21fd86});});})['then'](function(_0x3a13f7){logger[_0x9e14('0xf')](_0x9e14('0x3d'),_0x5d7e09);logger[_0x9e14('0x1a')](_0x9e14('0x3d'),_0x5d7e09,JSON[_0x9e14('0xc')](_0x3a13f7));_0x1ec115(_0x3a13f7);})['catch'](function(_0x12c6bb){logger['error'](_0x9e14('0x3d'),_0x12c6bb[_0x9e14('0xe')],_0x5d7e09);_0x2c1850(_0x14d30b[_0x9e14('0xd')](0x1f4,_0x12c6bb['message']));});});};exports['CountReScheduled']=function(_0x2d41c8){var _0x3ddecc=this;return new Promise(function(_0x28f030,_0x4a49a2){return db[_0x9e14('0x12')][_0x9e14('0x13')]({'raw':_0x2d41c8[_0x9e14('0x14')]?_0x2d41c8[_0x9e14('0x14')][_0x9e14('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d41c8['options']?_0x2d41c8[_0x9e14('0x14')][_0x9e14('0x1d')]||null:null,'attributes':[[db[_0x9e14('0x2a')]['fn'](_0x9e14('0x40'),db[_0x9e14('0x2a')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0x9e14('0x41')](_0x9e14('0x42'),moment()['format'](_0x9e14('0x43')))+_0x9e14('0x44')))),'contactsRescheduled']]})[_0x9e14('0x9')](function(_0x2ee005){logger['info'](_0x9e14('0x45'),_0x2d41c8);logger[_0x9e14('0x1a')]('CountReScheduled',_0x2d41c8,JSON['stringify'](_0x2ee005));_0x28f030(_0x2ee005);})[_0x9e14('0x1e')](function(_0x424904){logger[_0x9e14('0xd')](_0x9e14('0x45'),_0x424904['message'],_0x2d41c8);_0x4a49a2(_0x3ddecc[_0x9e14('0xd')](0x1f4,_0x424904[_0x9e14('0xe')]));});});};exports[_0x9e14('0x46')]=function(_0x3d7e07){var _0x4f186f=this;return new Promise(function(_0x1d5e1b,_0x4d3ac6){return db['CmContact'][_0x9e14('0x29')]()[_0x9e14('0x9')](function(_0x460e43){return db['sequelize'][_0x9e14('0x2b')](function(_0x4d7d9a){return db[_0x9e14('0x12')]['findAll']({'where':_0x3d7e07[_0x9e14('0x14')]?_0x3d7e07[_0x9e14('0x14')][_0x9e14('0x1d')]||null:null,'attributes':_0x3d7e07[_0x9e14('0x14')]?_0x3d7e07['options'][_0x9e14('0x18')]||null:null,'limit':0x1,'order':_0x3d7e07['options']?_0x3d7e07[_0x9e14('0x14')][_0x9e14('0x2c')]||null:null,'group':db['CmHopper'][_0x9e14('0x35')],'transaction':_0x4d7d9a,'lock':_0x4d7d9a[_0x9e14('0x2d')][_0x9e14('0x47')],'include':_0x3d7e07['options']?_0x3d7e07[_0x9e14('0x14')][_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x3d7e07[_0x9e14('0x14')][_0x9e14('0x17')],function(_0x113647){return{'model':db[_0x113647[_0x9e14('0x19')]],'as':_0x113647['as'],'attributes':_0x113647[_0x9e14('0x18')],'include':_0x113647[_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x113647[_0x9e14('0x17')],function(_0x53c736){return{'model':db[_0x53c736[_0x9e14('0x19')]],'as':_0x53c736['as'],'attributes':_0x53c736[_0x9e14('0x18')],'include':_0x53c736[_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x53c736[_0x9e14('0x17')],function(_0x2504c1){return{'model':db[_0x2504c1['model']],'as':_0x2504c1['as'],'attributes':_0x2504c1[_0x9e14('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e14('0x9')](function(_0xa1c148){var _0x3a430b=[];for(var _0x5d4ce4=0x0;_0x5d4ce4<_0xa1c148['length'];_0x5d4ce4+=0x1){_0x3a430b[_0x9e14('0x36')](_0xa1c148[_0x5d4ce4][_0x9e14('0x23')](_0x3d7e07[_0x9e14('0x21')],{'transaction':_0x4d7d9a}));}return BPromise[_0x9e14('0x38')](_0x3a430b);});})[_0x9e14('0x9')](function(_0xa52c30){logger[_0x9e14('0xf')](_0x9e14('0x46'),_0x3d7e07);logger['debug'](_0x9e14('0x46'),_0x3d7e07,JSON['stringify'](_0xa52c30));_0x1d5e1b(_0xa52c30);})[_0x9e14('0x1e')](function(_0x57eaa6){logger['error'](_0x9e14('0x46'),_0x57eaa6[_0x9e14('0xe')],_0x3d7e07);_0x4d3ac6(_0x4f186f[_0x9e14('0xd')](0x1f4,_0x57eaa6['message']));});});});};exports[_0x9e14('0x48')]=function(_0x2edf2b){var _0x2900a8=this;return new Promise(function(_0x221fc5,_0x1ae261){db[_0x9e14('0x28')][_0x9e14('0x29')]()['then'](function(_0x104a42){return db[_0x9e14('0x12')][_0x9e14('0x13')]({'raw':_0x2edf2b[_0x9e14('0x14')]?_0x2edf2b[_0x9e14('0x14')][_0x9e14('0x1c')]===undefined?!![]:![]:!![],'where':_0x2edf2b['options']?_0x2edf2b['options']['where']||null:null,'attributes':_0x2edf2b[_0x9e14('0x14')]?_0x2edf2b[_0x9e14('0x14')][_0x9e14('0x18')]||null:null,'limit':_0x2edf2b[_0x9e14('0x14')]?_0x2edf2b[_0x9e14('0x14')][_0x9e14('0x15')]||null:null,'include':_0x2edf2b['options']?_0x2edf2b[_0x9e14('0x14')][_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x2edf2b[_0x9e14('0x14')][_0x9e14('0x17')],function(_0x4d8dfc){return{'model':db[_0x4d8dfc[_0x9e14('0x19')]],'as':_0x4d8dfc['as'],'attributes':_0x4d8dfc['as']===_0x9e14('0x2e')?_['keys'](_0x104a42):_0x4d8dfc[_0x9e14('0x18')],'include':_0x4d8dfc['include']?_['map'](_0x4d8dfc['include'],function(_0x20e36a){return{'model':db[_0x20e36a[_0x9e14('0x19')]],'as':_0x20e36a['as'],'attributes':_0x20e36a[_0x9e14('0x18')],'include':_0x20e36a[_0x9e14('0x17')]?_[_0x9e14('0x16')](_0x20e36a[_0x9e14('0x17')],function(_0x4e53cd){return{'model':db[_0x4e53cd[_0x9e14('0x19')]],'as':_0x4e53cd['as'],'attributes':_0x4e53cd[_0x9e14('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e14('0x9')](function(_0x521f44){logger[_0x9e14('0xf')](_0x9e14('0x11'),_0x2edf2b);logger['debug'](_0x9e14('0x11'),_0x2edf2b,JSON[_0x9e14('0xc')](_0x521f44));_0x221fc5(_0x521f44);})[_0x9e14('0x1e')](function(_0x4e2c8a){logger[_0x9e14('0xd')](_0x9e14('0x11'),_0x4e2c8a[_0x9e14('0xe')],_0x2edf2b);_0x1ae261(_0x2900a8[_0x9e14('0xd')](0x1f4,_0x4e2c8a['message']));});});});};exports[_0x9e14('0x49')]=function(_0x148851){var _0x404375=this;return new Promise(function(_0x4571f6,_0xe6fd3c){return db[_0x9e14('0x2a')][_0x9e14('0x2b')](function(_0x398179){return db[_0x9e14('0x12')]['update']({'active':![]},{'where':{},'transaction':_0x398179})['then'](function(_0x2eb66b){logger[_0x9e14('0xf')](_0x9e14('0x49'),_0x148851);logger[_0x9e14('0x1a')](_0x9e14('0x49'),_0x148851,JSON[_0x9e14('0xc')](_0x2eb66b));_0x4571f6(_0x2eb66b);})['catch'](function(_0x284ff7){logger[_0x9e14('0xd')](_0x9e14('0x49'),_0x284ff7['message'],_0x148851);_0xe6fd3c(_0x404375['error'](0x1f4,_0x284ff7[_0x9e14('0xe')]));});});});}; \ No newline at end of file +var _0xbc43=['active','DestroyCmHopper','GetContactDialer','describe','LOCK','Contact','keys','User','Agent','length','push','includes','all','ContactId','sequelize','transaction','CmHopperFinal','destroy','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','order','UPDATE','GetContactRecallMe','ResetActiveCalls','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','then','CmHopper','find','ShowCmHopper','create','body','raw','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]'];(function(_0x3ab8d7,_0x462b06){var _0x58092a=function(_0x331fc9){while(--_0x331fc9){_0x3ab8d7['push'](_0x3ab8d7['shift']());}};_0x58092a(++_0x462b06);}(_0xbc43,0xae));var _0x3bc4=function(_0x188826,_0x3abf8b){_0x188826=_0x188826-0x0;var _0x5ee0c2=_0xbc43[_0x188826];return _0x5ee0c2;};'use strict';var _=require(_0x3bc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bc4('0x1'));var db=require(_0x3bc4('0x2'))['db'];var utils=require(_0x3bc4('0x3'));var logger=require(_0x3bc4('0x4'))(_0x3bc4('0x5'));var config=require(_0x3bc4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3bc4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1134ef,_0x22538f,_0x1df764){return new BPromise(function(_0x4b2284,_0x59dde6){return client[_0x3bc4('0x8')](_0x1134ef,_0x1df764)['then'](function(_0x43f313){logger[_0x3bc4('0x9')](_0x3bc4('0xa'),_0x22538f,_0x3bc4('0xb'));logger[_0x3bc4('0xc')](_0x3bc4('0xd'),_0x22538f,_0x3bc4('0xb'),JSON[_0x3bc4('0xe')](_0x43f313));if(_0x43f313[_0x3bc4('0xf')]){if(_0x43f313['error']['code']===0x1f4){logger[_0x3bc4('0xf')](_0x3bc4('0xa'),_0x22538f,_0x43f313[_0x3bc4('0xf')]['message']);return _0x59dde6(_0x43f313[_0x3bc4('0xf')][_0x3bc4('0x10')]);}logger[_0x3bc4('0xf')](_0x3bc4('0xa'),_0x22538f,_0x43f313[_0x3bc4('0xf')][_0x3bc4('0x10')]);return _0x4b2284(_0x43f313[_0x3bc4('0xf')]['message']);}else{logger[_0x3bc4('0x9')](_0x3bc4('0xa'),_0x22538f,_0x3bc4('0xb'));_0x4b2284(_0x43f313[_0x3bc4('0x11')]['message']);}})[_0x3bc4('0x12')](function(_0x501491){logger[_0x3bc4('0xf')]('CmHopper,\x20%s,\x20%s',_0x22538f,_0x501491);_0x59dde6(_0x501491);});});}exports[_0x3bc4('0x13')]=function(_0x332fdd){var _0x57e8fd=this;return new Promise(function(_0x151565,_0x5892ab){return db['CmHopper'][_0x3bc4('0x14')]({'raw':_0x332fdd[_0x3bc4('0x15')]?_0x332fdd['options']['raw']===undefined?!![]:![]:!![],'where':_0x332fdd[_0x3bc4('0x15')]?_0x332fdd[_0x3bc4('0x15')][_0x3bc4('0x16')]||null:null,'attributes':_0x332fdd[_0x3bc4('0x15')]?_0x332fdd[_0x3bc4('0x15')][_0x3bc4('0x17')]||null:null,'limit':_0x332fdd[_0x3bc4('0x15')]?_0x332fdd['options'][_0x3bc4('0x18')]||null:null,'include':_0x332fdd[_0x3bc4('0x15')]?_0x332fdd['options'][_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x332fdd['options'][_0x3bc4('0x19')],function(_0xde1746){return{'model':db[_0xde1746['model']],'as':_0xde1746['as'],'attributes':_0xde1746['attributes'],'include':_0xde1746[_0x3bc4('0x19')]?_['map'](_0xde1746[_0x3bc4('0x19')],function(_0x4f7311){return{'model':db[_0x4f7311['model']],'as':_0x4f7311['as'],'attributes':_0x4f7311[_0x3bc4('0x17')],'include':_0x4f7311[_0x3bc4('0x19')]?_['map'](_0x4f7311[_0x3bc4('0x19')],function(_0x2c2e59){return{'model':db[_0x2c2e59[_0x3bc4('0x1b')]],'as':_0x2c2e59['as'],'attributes':_0x2c2e59['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bc4('0x1c')](function(_0x3949ca){logger['info'](_0x3bc4('0x13'),_0x332fdd);logger[_0x3bc4('0xc')](_0x3bc4('0x13'),_0x332fdd,JSON['stringify'](_0x3949ca));_0x151565(_0x3949ca);})['catch'](function(_0x3baf9a){logger[_0x3bc4('0xf')]('GetCmHopper',_0x3baf9a['message'],_0x332fdd);_0x5892ab(_0x57e8fd['error'](0x1f4,_0x3baf9a[_0x3bc4('0x10')]));});});};exports['ShowCmHopper']=function(_0x17323f){var _0x1b46a9=this;return new Promise(function(_0x12b90d,_0x38b5c3){return db[_0x3bc4('0x1d')][_0x3bc4('0x1e')]({'raw':_0x17323f['options']?_0x17323f[_0x3bc4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17323f[_0x3bc4('0x15')]?_0x17323f[_0x3bc4('0x15')][_0x3bc4('0x16')]||null:null,'attributes':_0x17323f[_0x3bc4('0x15')]?_0x17323f[_0x3bc4('0x15')][_0x3bc4('0x17')]||null:null,'include':_0x17323f['options']?_0x17323f[_0x3bc4('0x15')][_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x17323f['options']['include'],function(_0x50ff92){return{'model':db[_0x50ff92[_0x3bc4('0x1b')]],'as':_0x50ff92['as'],'attributes':_0x50ff92[_0x3bc4('0x17')],'include':_0x50ff92[_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x50ff92[_0x3bc4('0x19')],function(_0x3b03c2){return{'model':db[_0x3b03c2['model']],'as':_0x3b03c2['as'],'attributes':_0x3b03c2['attributes'],'include':_0x3b03c2[_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x3b03c2[_0x3bc4('0x19')],function(_0xc9bb66){return{'model':db[_0xc9bb66[_0x3bc4('0x1b')]],'as':_0xc9bb66['as'],'attributes':_0xc9bb66[_0x3bc4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3bc4('0x1c')](function(_0x3c1d4f){logger['info'](_0x3bc4('0x1f'),_0x17323f);logger[_0x3bc4('0xc')](_0x3bc4('0x1f'),_0x17323f,JSON[_0x3bc4('0xe')](_0x3c1d4f));_0x12b90d(_0x3c1d4f);})[_0x3bc4('0x12')](function(_0x46d4cc){logger[_0x3bc4('0xf')](_0x3bc4('0x1f'),_0x46d4cc[_0x3bc4('0x10')],_0x17323f);_0x38b5c3(_0x1b46a9[_0x3bc4('0xf')](0x1f4,_0x46d4cc[_0x3bc4('0x10')]));});});};exports['CreateCmHopper']=function(_0x2f283c){var _0x257517=this;return new Promise(function(_0x3cee1d,_0x117cf9){return db[_0x3bc4('0x1d')][_0x3bc4('0x20')](_0x2f283c[_0x3bc4('0x21')],{'raw':_0x2f283c['options']?_0x2f283c['options'][_0x3bc4('0x22')]===undefined?!![]:![]:!![]})[_0x3bc4('0x1c')](function(_0x390695){logger['info']('CreateCmHopper',_0x2f283c);logger[_0x3bc4('0xc')](_0x3bc4('0x23'),_0x2f283c,JSON[_0x3bc4('0xe')](_0x390695));_0x3cee1d(_0x390695);})[_0x3bc4('0x12')](function(_0x145372){logger[_0x3bc4('0xf')]('CreateCmHopper',_0x145372['message'],_0x2f283c);_0x117cf9(_0x257517[_0x3bc4('0xf')](0x1f4,_0x145372['message']));});});};exports[_0x3bc4('0x24')]=function(_0x37e5fe){var _0x430a8a=this;return new Promise(function(_0x5143d8,_0x44f9bf){return db['CmHopper'][_0x3bc4('0x25')](_0x37e5fe['body'],{'raw':_0x37e5fe['options']?_0x37e5fe[_0x3bc4('0x15')][_0x3bc4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37e5fe[_0x3bc4('0x15')]?_0x37e5fe['options']['where']||null:null,'attributes':_0x37e5fe['options']?_0x37e5fe[_0x3bc4('0x15')][_0x3bc4('0x17')]||null:null,'limit':_0x37e5fe[_0x3bc4('0x15')]?_0x37e5fe[_0x3bc4('0x15')]['limit']||null:null})['then'](function(_0x1daddc){logger[_0x3bc4('0x9')](_0x3bc4('0x24'),_0x37e5fe);logger['info'](_0x3bc4('0x26'),JSON[_0x3bc4('0xe')](_0x37e5fe[_0x3bc4('0x15')][_0x3bc4('0x16')]),_0x37e5fe[_0x3bc4('0x21')][_0x3bc4('0x27')]);logger[_0x3bc4('0xc')](_0x3bc4('0x24'),_0x37e5fe,JSON[_0x3bc4('0xe')](_0x1daddc));_0x5143d8(_0x1daddc);})[_0x3bc4('0x12')](function(_0x143370){logger[_0x3bc4('0xf')](_0x3bc4('0x24'),_0x143370['message'],_0x37e5fe);_0x44f9bf(_0x430a8a[_0x3bc4('0xf')](0x1f4,_0x143370[_0x3bc4('0x10')]));});});};exports[_0x3bc4('0x28')]=function(_0x3387c7){var _0x5bdb9b=this;return new Promise(function(_0x18365f,_0x1e8417){return db[_0x3bc4('0x1d')]['destroy']({'where':_0x3387c7['options']?_0x3387c7[_0x3bc4('0x15')]['where']||null:null})[_0x3bc4('0x1c')](function(_0x36bce6){logger[_0x3bc4('0x9')](_0x3bc4('0x28'),_0x3387c7);logger[_0x3bc4('0xc')](_0x3bc4('0x28'),_0x3387c7,JSON[_0x3bc4('0xe')](_0x36bce6));_0x18365f(_0x36bce6);})['catch'](function(_0x1dfa6e){logger[_0x3bc4('0xf')](_0x3bc4('0x28'),_0x1dfa6e['message'],_0x3387c7);_0x1e8417(_0x5bdb9b['error'](0x1f4,_0x1dfa6e[_0x3bc4('0x10')]));});});};exports[_0x3bc4('0x29')]=function(_0x2f97b4){var _0x3858be=this;return new Promise(function(_0x23c0f4,_0x37a7b4){return db['CmContact'][_0x3bc4('0x2a')]()['then'](function(_0x57abdc){return db['sequelize']['transaction'](function(_0x341c21){return db[_0x3bc4('0x1d')][_0x3bc4('0x14')]({'where':_0x2f97b4[_0x3bc4('0x15')]?_0x2f97b4['options']['where']||null:null,'attributes':_0x2f97b4[_0x3bc4('0x15')]?_0x2f97b4['options'][_0x3bc4('0x17')]||null:null,'limit':_0x2f97b4['options']?_0x2f97b4[_0x3bc4('0x15')][_0x3bc4('0x18')]||null:null,'order':_0x2f97b4['options']?_0x2f97b4[_0x3bc4('0x15')]['order']||null:null,'transaction':_0x341c21,'lock':_0x341c21[_0x3bc4('0x2b')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x3bc4('0x2c'),'attributes':_[_0x3bc4('0x2d')](_0x57abdc)},{'model':db[_0x3bc4('0x2e')],'as':_0x3bc4('0x2f'),'attributes':['id','name','voicePause']}]})['then'](function(_0x439c07){var _0x49ef74=[];var _0x39f1a9=[];for(var _0x878e4c=0x0;_0x878e4c<_0x439c07[_0x3bc4('0x30')];_0x878e4c+=0x1){var _0xcf0193=_0x439c07[_0x878e4c]['UserId'];if(_0xcf0193===null){_0x49ef74[_0x3bc4('0x31')](_0x439c07[_0x878e4c][_0x3bc4('0x25')](_0x2f97b4[_0x3bc4('0x21')],{'transaction':_0x341c21}));}else if(!_0x39f1a9[_0x3bc4('0x32')](_0xcf0193)){_0x39f1a9['push'](_0xcf0193);_0x49ef74['push'](_0x439c07[_0x878e4c]['update'](_0x2f97b4['body'],{'transaction':_0x341c21}));}}return BPromise[_0x3bc4('0x33')](_0x49ef74);});})[_0x3bc4('0x1c')](function(_0x104401){logger[_0x3bc4('0x9')]('GetContactDialer',_0x2f97b4);if(_0x104401['length']>0x0){logger[_0x3bc4('0x9')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x104401[0x0]['dataValues']['id'],_0x104401[0x0]['dataValues'][_0x3bc4('0x34')],_0x104401[0x0]['dataValues'][_0x3bc4('0x27')]);}logger[_0x3bc4('0xc')]('GetContactDialer',_0x2f97b4,JSON[_0x3bc4('0xe')](_0x104401));_0x23c0f4(_0x104401);})[_0x3bc4('0x12')](function(_0xaa8d79){logger[_0x3bc4('0xf')](_0x3bc4('0x29'),_0xaa8d79[_0x3bc4('0x10')],_0x2f97b4);_0x37a7b4(_0x3858be[_0x3bc4('0xf')](0x1f4,_0xaa8d79[_0x3bc4('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x1ad5d7){var _0x10ad7f=this;return new Promise(function(_0x12df2a,_0x29e95f){return db[_0x3bc4('0x35')][_0x3bc4('0x36')](function(_0x486af){return db[_0x3bc4('0x37')][_0x3bc4('0x20')](_0x1ad5d7[_0x3bc4('0x21')],{'raw':_0x1ad5d7['options']?_0x1ad5d7['options'][_0x3bc4('0x22')]===undefined?!![]:![]:!![],'transaction':_0x486af})['then'](function(){logger[_0x3bc4('0x9')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x3bc4('0xe')](_0x1ad5d7[_0x3bc4('0x15')][_0x3bc4('0x16')]),_0x1ad5d7[_0x3bc4('0x15')][_0x3bc4('0x16')][_0x3bc4('0x27')]);return db[_0x3bc4('0x1d')][_0x3bc4('0x38')]({'where':_0x1ad5d7[_0x3bc4('0x15')]?_0x1ad5d7[_0x3bc4('0x15')]['where']||null:null,'transaction':_0x486af});});})['then'](function(_0x4ad04e){logger[_0x3bc4('0x9')](_0x3bc4('0x39'),_0x1ad5d7);logger[_0x3bc4('0xc')]('MoveContactManagedDialer',_0x1ad5d7,JSON[_0x3bc4('0xe')](_0x4ad04e));_0x12df2a(_0x4ad04e);})[_0x3bc4('0x12')](function(_0x3af7ea){logger[_0x3bc4('0xf')](_0x3bc4('0x39'),_0x3af7ea[_0x3bc4('0x10')],_0x1ad5d7);_0x29e95f(_0x10ad7f[_0x3bc4('0xf')](0x1f4,_0x3af7ea['message']));});});};exports['CountReScheduled']=function(_0x756833){var _0x19f071=this;return new Promise(function(_0x233cc9,_0x91914a){return db[_0x3bc4('0x1d')]['findAll']({'raw':_0x756833['options']?_0x756833[_0x3bc4('0x15')][_0x3bc4('0x22')]===undefined?!![]:![]:!![],'where':_0x756833[_0x3bc4('0x15')]?_0x756833[_0x3bc4('0x15')][_0x3bc4('0x16')]||null:null,'attributes':[[db[_0x3bc4('0x35')]['fn'](_0x3bc4('0x3a'),db['sequelize']['fn']('IF',db[_0x3bc4('0x35')][_0x3bc4('0x3b')](_0x3bc4('0x3c')+util[_0x3bc4('0x3d')](_0x3bc4('0x3e'),moment()[_0x3bc4('0x3d')](_0x3bc4('0x3f')))+_0x3bc4('0x40')))),_0x3bc4('0x41')]]})[_0x3bc4('0x1c')](function(_0x1fca01){logger[_0x3bc4('0x9')](_0x3bc4('0x42'),_0x756833);logger[_0x3bc4('0xc')](_0x3bc4('0x42'),_0x756833,JSON[_0x3bc4('0xe')](_0x1fca01));_0x233cc9(_0x1fca01);})[_0x3bc4('0x12')](function(_0x2a76aa){logger[_0x3bc4('0xf')]('CountReScheduled',_0x2a76aa[_0x3bc4('0x10')],_0x756833);_0x91914a(_0x19f071[_0x3bc4('0xf')](0x1f4,_0x2a76aa[_0x3bc4('0x10')]));});});};exports['GetContactRecallMe']=function(_0x2ea823){var _0x13b144=this;return new Promise(function(_0x32c0cb,_0x3d4cac){return db['CmContact'][_0x3bc4('0x2a')]()[_0x3bc4('0x1c')](function(_0x4c67ea){return db[_0x3bc4('0x35')][_0x3bc4('0x36')](function(_0x5f5591){return db['CmHopper'][_0x3bc4('0x14')]({'where':_0x2ea823['options']?_0x2ea823[_0x3bc4('0x15')][_0x3bc4('0x16')]||null:null,'attributes':_0x2ea823[_0x3bc4('0x15')]?_0x2ea823['options'][_0x3bc4('0x17')]||null:null,'limit':0x1,'order':_0x2ea823['options']?_0x2ea823['options'][_0x3bc4('0x43')]||null:null,'group':db[_0x3bc4('0x1d')]['UserId'],'transaction':_0x5f5591,'lock':_0x5f5591['LOCK'][_0x3bc4('0x44')],'include':_0x2ea823[_0x3bc4('0x15')]?_0x2ea823['options'][_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x2ea823['options'][_0x3bc4('0x19')],function(_0x3d3b7e){return{'model':db[_0x3d3b7e[_0x3bc4('0x1b')]],'as':_0x3d3b7e['as'],'attributes':_0x3d3b7e[_0x3bc4('0x17')],'include':_0x3d3b7e[_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x3d3b7e['include'],function(_0x2641b3){return{'model':db[_0x2641b3[_0x3bc4('0x1b')]],'as':_0x2641b3['as'],'attributes':_0x2641b3[_0x3bc4('0x17')],'include':_0x2641b3['include']?_[_0x3bc4('0x1a')](_0x2641b3[_0x3bc4('0x19')],function(_0x472391){return{'model':db[_0x472391[_0x3bc4('0x1b')]],'as':_0x472391['as'],'attributes':_0x472391[_0x3bc4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3bc4('0x1c')](function(_0x5e37ab){var _0x549a6e=[];for(var _0x2097c6=0x0;_0x2097c6<_0x5e37ab[_0x3bc4('0x30')];_0x2097c6+=0x1){_0x549a6e['push'](_0x5e37ab[_0x2097c6][_0x3bc4('0x25')](_0x2ea823['body'],{'transaction':_0x5f5591}));}return BPromise['all'](_0x549a6e);});})[_0x3bc4('0x1c')](function(_0x4dff3a){logger[_0x3bc4('0x9')](_0x3bc4('0x45'),_0x2ea823);logger['debug'](_0x3bc4('0x45'),_0x2ea823,JSON[_0x3bc4('0xe')](_0x4dff3a));_0x32c0cb(_0x4dff3a);})[_0x3bc4('0x12')](function(_0x27c811){logger[_0x3bc4('0xf')](_0x3bc4('0x45'),_0x27c811[_0x3bc4('0x10')],_0x2ea823);_0x3d4cac(_0x13b144['error'](0x1f4,_0x27c811[_0x3bc4('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x1aa594){var _0x391a1a=this;return new Promise(function(_0x1f3b20,_0x304e57){db['CmContact']['describe']()[_0x3bc4('0x1c')](function(_0x1bcdd3){return db['CmHopper'][_0x3bc4('0x14')]({'raw':_0x1aa594[_0x3bc4('0x15')]?_0x1aa594[_0x3bc4('0x15')][_0x3bc4('0x22')]===undefined?!![]:![]:!![],'where':_0x1aa594['options']?_0x1aa594[_0x3bc4('0x15')][_0x3bc4('0x16')]||null:null,'attributes':_0x1aa594[_0x3bc4('0x15')]?_0x1aa594[_0x3bc4('0x15')][_0x3bc4('0x17')]||null:null,'limit':_0x1aa594['options']?_0x1aa594[_0x3bc4('0x15')][_0x3bc4('0x18')]||null:null,'include':_0x1aa594[_0x3bc4('0x15')]?_0x1aa594[_0x3bc4('0x15')]['include']?_[_0x3bc4('0x1a')](_0x1aa594[_0x3bc4('0x15')]['include'],function(_0x4ae406){return{'model':db[_0x4ae406[_0x3bc4('0x1b')]],'as':_0x4ae406['as'],'attributes':_0x4ae406['as']==='Contact'?_[_0x3bc4('0x2d')](_0x1bcdd3):_0x4ae406[_0x3bc4('0x17')],'include':_0x4ae406[_0x3bc4('0x19')]?_[_0x3bc4('0x1a')](_0x4ae406[_0x3bc4('0x19')],function(_0x52b4e3){return{'model':db[_0x52b4e3[_0x3bc4('0x1b')]],'as':_0x52b4e3['as'],'attributes':_0x52b4e3[_0x3bc4('0x17')],'include':_0x52b4e3[_0x3bc4('0x19')]?_['map'](_0x52b4e3[_0x3bc4('0x19')],function(_0x589a95){return{'model':db[_0x589a95[_0x3bc4('0x1b')]],'as':_0x589a95['as'],'attributes':_0x589a95[_0x3bc4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3bc4('0x1c')](function(_0xf73a23){logger['info']('GetCmHopper',_0x1aa594);logger['debug']('GetCmHopper',_0x1aa594,JSON[_0x3bc4('0xe')](_0xf73a23));_0x1f3b20(_0xf73a23);})['catch'](function(_0x4fffd6){logger[_0x3bc4('0xf')](_0x3bc4('0x13'),_0x4fffd6[_0x3bc4('0x10')],_0x1aa594);_0x304e57(_0x391a1a[_0x3bc4('0xf')](0x1f4,_0x4fffd6[_0x3bc4('0x10')]));});});});};exports[_0x3bc4('0x46')]=function(_0x11781f){var _0x57043c=this;return new Promise(function(_0x20fc01,_0x1f189b){return db[_0x3bc4('0x35')][_0x3bc4('0x36')](function(_0x50c2c9){return db[_0x3bc4('0x1d')]['update']({'active':![]},{'where':{},'transaction':_0x50c2c9})[_0x3bc4('0x1c')](function(_0x5f0b21){logger[_0x3bc4('0x9')](_0x3bc4('0x46'),_0x11781f);logger[_0x3bc4('0xc')]('ResetActiveCalls',_0x11781f,JSON[_0x3bc4('0xe')](_0x5f0b21));_0x20fc01(_0x5f0b21);})[_0x3bc4('0x12')](function(_0x3f878e){logger[_0x3bc4('0xf')](_0x3bc4('0x46'),_0x3f878e[_0x3bc4('0x10')],_0x11781f);_0x1f189b(_0x57043c['error'](0x1f4,_0x3f878e[_0x3bc4('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8b0e1b3..4cbab9f 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfec=['getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts'];(function(_0x1596e8,_0x529bb6){var _0x5aaf78=function(_0x1e0c0a){while(--_0x1e0c0a){_0x1596e8['push'](_0x1596e8['shift']());}};_0x5aaf78(++_0x529bb6);}(_0xcfec,0x1ed));var _0xccfe=function(_0x14ed2c,_0x2931af){_0x14ed2c=_0x14ed2c-0x0;var _0x3e2b64=_0xcfec[_0x14ed2c];return _0x3e2b64;};'use strict';var multer=require('multer');var util=require(_0xccfe('0x0'));var path=require('path');var timeout=require(_0xccfe('0x1'));var express=require(_0xccfe('0x2'));var router=express['Router']();var fs_extra=require(_0xccfe('0x3'));var auth=require(_0xccfe('0x4'));var interaction=require(_0xccfe('0x5'));var config=require(_0xccfe('0x6'));var controller=require('./cmHopper.controller');router[_0xccfe('0x7')]('/',auth[_0xccfe('0x8')](),controller[_0xccfe('0x9')]);router[_0xccfe('0x7')](_0xccfe('0xa'),auth[_0xccfe('0x8')](),controller[_0xccfe('0xb')]);router[_0xccfe('0x7')](_0xccfe('0xc'),auth['isAuthenticated'](),controller[_0xccfe('0xd')]);router[_0xccfe('0x7')](_0xccfe('0xe'),auth[_0xccfe('0x8')](),controller[_0xccfe('0xf')]);router['post']('/',auth[_0xccfe('0x8')](),controller['create']);router[_0xccfe('0x10')](_0xccfe('0x11'),auth['isAuthenticated'](),controller[_0xccfe('0x12')]);router[_0xccfe('0x13')](_0xccfe('0xe'),auth[_0xccfe('0x8')](),controller[_0xccfe('0x14')]);router[_0xccfe('0x15')](_0xccfe('0xe'),auth[_0xccfe('0x8')](),controller[_0xccfe('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2570=['util','path','connect-timeout','express','Router','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x324cb9,_0x281874){var _0x57ac23=function(_0x41c5d1){while(--_0x41c5d1){_0x324cb9['push'](_0x324cb9['shift']());}};_0x57ac23(++_0x281874);}(_0x2570,0x92));var _0x0257=function(_0x5476e6,_0x27955e){_0x5476e6=_0x5476e6-0x0;var _0x4cddb3=_0x2570[_0x5476e6];return _0x4cddb3;};'use strict';var multer=require(_0x0257('0x0'));var util=require(_0x0257('0x1'));var path=require(_0x0257('0x2'));var timeout=require(_0x0257('0x3'));var express=require(_0x0257('0x4'));var router=express[_0x0257('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0257('0x6'));var controller=require(_0x0257('0x7'));router[_0x0257('0x8')]('/',auth[_0x0257('0x9')](),controller[_0x0257('0xa')]);router[_0x0257('0x8')]('/describe',auth[_0x0257('0x9')](),controller['describe']);router[_0x0257('0x8')](_0x0257('0xb'),auth[_0x0257('0x9')](),controller['getOpenContacts']);router[_0x0257('0x8')](_0x0257('0xc'),auth[_0x0257('0x9')](),controller[_0x0257('0xd')]);router[_0x0257('0xe')]('/',auth['isAuthenticated'](),controller[_0x0257('0xf')]);router['post']('/preview',auth[_0x0257('0x9')](),controller['getPreview']);router[_0x0257('0x10')](_0x0257('0xc'),auth[_0x0257('0x9')](),controller[_0x0257('0x11')]);router[_0x0257('0x12')](_0x0257('0xc'),auth[_0x0257('0x9')](),controller[_0x0257('0x13')]);module[_0x0257('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e216118..0cd20be 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa751=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa751,0x175));var _0x1a75=function(_0xcd4d15,_0x474b0e){_0xcd4d15=_0xcd4d15-0x0;var _0x249316=_0xa751[_0xcd4d15];return _0x249316;};'use strict';var moment=require(_0x1a75('0x0'));var Sequelize=require(_0x1a75('0x1'));module[_0x1a75('0x2')]={'phone':{'type':Sequelize[_0x1a75('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x1a75('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1a75('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1a75('0x5')],'unique':_0x1a75('0x4')}}; \ No newline at end of file +var _0x2c24=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x291a25,_0x31ae01){var _0x380fab=function(_0x205298){while(--_0x205298){_0x291a25['push'](_0x291a25['shift']());}};_0x380fab(++_0x31ae01);}(_0x2c24,0x1e6));var _0x42c2=function(_0x56a08c,_0x3ae82c){_0x56a08c=_0x56a08c-0x0;var _0x57d0ef=_0x2c24[_0x56a08c];return _0x57d0ef;};'use strict';var moment=require(_0x42c2('0x0'));var Sequelize=require(_0x42c2('0x1'));module[_0x42c2('0x2')]={'phone':{'type':Sequelize[_0x42c2('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x42c2('0x4')],'unique':_0x42c2('0x5')},'ListId':{'type':Sequelize[_0x42c2('0x4')],'unique':_0x42c2('0x5')},'VoiceQueueId':{'type':Sequelize[_0x42c2('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index aeae0a6..0a39f3b 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9218=['name','send','index','map','CmHopperBlack','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','merge','options','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9218,0x10b));var _0x8921=function(_0x56cb64,_0x2d8cd7){_0x56cb64=_0x56cb64-0x0;var _0x32386b=_0x9218[_0x56cb64];return _0x32386b;};'use strict';var emlformat=require(_0x8921('0x0'));var rimraf=require(_0x8921('0x1'));var zipdir=require(_0x8921('0x2'));var jsonpatch=require(_0x8921('0x3'));var rp=require(_0x8921('0x4'));var moment=require(_0x8921('0x5'));var BPromise=require(_0x8921('0x6'));var Mustache=require(_0x8921('0x7'));var util=require(_0x8921('0x8'));var path=require(_0x8921('0x9'));var sox=require('sox');var csv=require(_0x8921('0xa'));var ejs=require(_0x8921('0xb'));var fs=require('fs');var fs_extra=require(_0x8921('0xc'));var _=require(_0x8921('0xd'));var squel=require(_0x8921('0xe'));var crypto=require(_0x8921('0xf'));var jsforce=require(_0x8921('0x10'));var deskjs=require(_0x8921('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8921('0x12'));var Papa=require('papaparse');var Redis=require(_0x8921('0x13'));var authService=require(_0x8921('0x14'));var qs=require(_0x8921('0x15'));var as=require(_0x8921('0x16'));var hardwareService=require(_0x8921('0x17'));var logger=require(_0x8921('0x18'))(_0x8921('0x19'));var utils=require(_0x8921('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x8921('0x1b'));var db=require(_0x8921('0x1c'))['db'];function respondWithStatusCode(_0x2a4fa9,_0x1a690){_0x1a690=_0x1a690||0xcc;return function(_0x2ddbe3){if(_0x2ddbe3){return _0x2a4fa9[_0x8921('0x1d')](_0x1a690);}return _0x2a4fa9[_0x8921('0x1e')](_0x1a690)[_0x8921('0x1f')]();};}function respondWithResult(_0x3944cb,_0x5d170f){_0x5d170f=_0x5d170f||0xc8;return function(_0x5d0808){if(_0x5d0808){return _0x3944cb[_0x8921('0x1e')](_0x5d170f)[_0x8921('0x20')](_0x5d0808);}};}function respondWithFilteredResult(_0x55f8f8,_0x1f1d21){return function(_0xd61be0){if(_0xd61be0){var _0x2bc262=typeof _0x1f1d21[_0x8921('0x21')]===_0x8921('0x22')&&typeof _0x1f1d21[_0x8921('0x23')]===_0x8921('0x22');var _0x3f9956=_0xd61be0[_0x8921('0x24')];var _0xa95bd4=_0x2bc262?0x0:_0x1f1d21[_0x8921('0x21')];var _0x17be49=_0x2bc262?_0xd61be0['count']:_0x1f1d21['offset']+_0x1f1d21[_0x8921('0x23')];var _0x286826;if(_0x17be49>=_0x3f9956){_0x17be49=_0x3f9956;_0x286826=0xc8;}else{_0x286826=0xce;}_0x55f8f8[_0x8921('0x1e')](_0x286826);return _0x55f8f8[_0x8921('0x25')](_0x8921('0x26'),_0xa95bd4+'-'+_0x17be49+'/'+_0x3f9956)[_0x8921('0x20')](_0xd61be0);}return null;};}function patchUpdates(_0x5d51f3){return function(_0x2c8ca6){try{jsonpatch['apply'](_0x2c8ca6,_0x5d51f3,!![]);}catch(_0xdb62eb){return BPromise[_0x8921('0x27')](_0xdb62eb);}return _0x2c8ca6[_0x8921('0x28')]();};}function saveUpdates(_0x5cd651,_0x55e80b){return function(_0x128243){if(_0x128243){return _0x128243[_0x8921('0x29')](_0x5cd651)[_0x8921('0x2a')](function(_0x19a5c1){return _0x19a5c1;});}return null;};}function removeEntity(_0x539d62,_0x579e6a){return function(_0x5ec6fd){if(_0x5ec6fd){return _0x5ec6fd['destroy']()[_0x8921('0x2a')](function(){_0x539d62[_0x8921('0x1e')](0xcc)[_0x8921('0x1f')]();});}};}function handleEntityNotFound(_0x36f2cc,_0x4b7fc6){return function(_0x1937d2){if(!_0x1937d2){_0x36f2cc[_0x8921('0x1d')](0x194);}return _0x1937d2;};}function handleError(_0x54fc93,_0x225a1a){_0x225a1a=_0x225a1a||0x1f4;return function(_0x6f923b){logger[_0x8921('0x2b')](_0x6f923b[_0x8921('0x2c')]);if(_0x6f923b[_0x8921('0x2d')]){delete _0x6f923b[_0x8921('0x2d')];}_0x54fc93[_0x8921('0x1e')](_0x225a1a)[_0x8921('0x2e')](_0x6f923b);};}exports[_0x8921('0x2f')]=function(_0x1eda6b,_0x54fce3){var _0x434090={},_0x54ff96={},_0x644d86={'count':0x0,'rows':[]};var _0x1668d4=_[_0x8921('0x30')](db[_0x8921('0x31')]['rawAttributes'],function(_0x257c68){return{'name':_0x257c68[_0x8921('0x32')],'type':_0x257c68[_0x8921('0x33')][_0x8921('0x34')]};});_0x54ff96[_0x8921('0x35')]=_[_0x8921('0x30')](_0x1668d4,_0x8921('0x2d'));_0x54ff96[_0x8921('0x36')]=_['keys'](_0x1eda6b[_0x8921('0x36')]);_0x54ff96[_0x8921('0x37')]=_[_0x8921('0x38')](_0x54ff96[_0x8921('0x35')],_0x54ff96[_0x8921('0x36')]);_0x434090['attributes']=_['intersection'](_0x54ff96[_0x8921('0x35')],qs[_0x8921('0x39')](_0x1eda6b[_0x8921('0x36')][_0x8921('0x39')]));_0x434090[_0x8921('0x3a')]=_0x434090['attributes'][_0x8921('0x3b')]?_0x434090[_0x8921('0x3a')]:_0x54ff96[_0x8921('0x35')];if(!_0x1eda6b[_0x8921('0x36')]['hasOwnProperty'](_0x8921('0x3c'))){_0x434090[_0x8921('0x23')]=qs['limit'](_0x1eda6b['query'][_0x8921('0x23')]);_0x434090[_0x8921('0x21')]=qs[_0x8921('0x21')](_0x1eda6b[_0x8921('0x36')][_0x8921('0x21')]);}_0x434090[_0x8921('0x3d')]=qs['sort'](_0x1eda6b[_0x8921('0x36')][_0x8921('0x3e')]);_0x434090[_0x8921('0x3f')]=qs[_0x8921('0x37')](_['pick'](_0x1eda6b['query'],_0x54ff96['filters']),_0x1668d4);if(_0x1eda6b[_0x8921('0x36')][_0x8921('0x40')]){_0x434090[_0x8921('0x3f')]=_['merge'](_0x434090[_0x8921('0x3f')],{'$or':_[_0x8921('0x30')](_0x1668d4,function(_0x5d6e31){if(_0x5d6e31[_0x8921('0x33')]!==_0x8921('0x41')){var _0x716219={};_0x716219[_0x5d6e31[_0x8921('0x2d')]]={'$like':'%'+_0x1eda6b[_0x8921('0x36')][_0x8921('0x40')]+'%'};return _0x716219;}})});}_0x434090=_['merge']({},_0x434090,_0x1eda6b['options']);var _0x2cc13d={'where':_0x434090['where']};return db[_0x8921('0x31')][_0x8921('0x24')](_0x2cc13d)[_0x8921('0x2a')](function(_0x4c78ed){_0x644d86[_0x8921('0x24')]=_0x4c78ed;if(_0x1eda6b['query'][_0x8921('0x42')]){_0x434090['include']=[{'all':!![]}];}return db[_0x8921('0x31')][_0x8921('0x43')](_0x434090);})[_0x8921('0x2a')](function(_0x129e8f){_0x644d86[_0x8921('0x44')]=_0x129e8f;return _0x644d86;})[_0x8921('0x2a')](respondWithFilteredResult(_0x54fce3,_0x434090))[_0x8921('0x45')](handleError(_0x54fce3,null));};exports[_0x8921('0x46')]=function(_0x4cbd22,_0x50779c){var _0x3a5e31={'raw':!![],'where':{'id':_0x4cbd22[_0x8921('0x47')]['id']}},_0x1c650a={};_0x1c650a['model']=_[_0x8921('0x48')](db['CmHopperBlack']['rawAttributes']);_0x1c650a[_0x8921('0x36')]=_[_0x8921('0x48')](_0x4cbd22[_0x8921('0x36')]);_0x1c650a['filters']=_[_0x8921('0x38')](_0x1c650a[_0x8921('0x35')],_0x1c650a['query']);_0x3a5e31['attributes']=_['intersection'](_0x1c650a[_0x8921('0x35')],qs[_0x8921('0x39')](_0x4cbd22[_0x8921('0x36')]['fields']));_0x3a5e31[_0x8921('0x3a')]=_0x3a5e31[_0x8921('0x3a')][_0x8921('0x3b')]?_0x3a5e31[_0x8921('0x3a')]:_0x1c650a['model'];if(_0x4cbd22[_0x8921('0x36')][_0x8921('0x42')]){_0x3a5e31['include']=[{'all':!![]}];}_0x3a5e31=_[_0x8921('0x49')]({},_0x3a5e31,_0x4cbd22[_0x8921('0x4a')]);return db['CmHopperBlack'][_0x8921('0x4b')](_0x3a5e31)[_0x8921('0x2a')](handleEntityNotFound(_0x50779c,null))[_0x8921('0x2a')](respondWithResult(_0x50779c,null))[_0x8921('0x45')](handleError(_0x50779c,null));};exports[_0x8921('0x29')]=function(_0x1d5509,_0x2bb61d){if(_0x1d5509['body']['id']){delete _0x1d5509['body']['id'];}return db[_0x8921('0x31')]['find']({'where':{'id':_0x1d5509[_0x8921('0x47')]['id']}})[_0x8921('0x2a')](handleEntityNotFound(_0x2bb61d,null))[_0x8921('0x2a')](saveUpdates(_0x1d5509[_0x8921('0x4c')],null))[_0x8921('0x2a')](respondWithResult(_0x2bb61d,null))[_0x8921('0x45')](handleError(_0x2bb61d,null));};exports[_0x8921('0x4d')]=function(_0x3869e2,_0x3b93d1){return db[_0x8921('0x31')][_0x8921('0x4b')]({'where':{'id':_0x3869e2[_0x8921('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b93d1,null))[_0x8921('0x2a')](removeEntity(_0x3b93d1,null))['catch'](handleError(_0x3b93d1,null));};exports['describe']=function(_0x52ed43,_0x96349f){return db[_0x8921('0x31')]['describe']()[_0x8921('0x2a')](respondWithResult(_0x96349f,null))[_0x8921('0x45')](handleError(_0x96349f,null));}; \ No newline at end of file +var _0x9dcf=['send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','CmHopperBlack','includeAll','rows','catch','show','params','keys','include','options','find','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name'];(function(_0x5eb1b3,_0x32c009){var _0x214976=function(_0x2630aa){while(--_0x2630aa){_0x5eb1b3['push'](_0x5eb1b3['shift']());}};_0x214976(++_0x32c009);}(_0x9dcf,0x103));var _0xf9dc=function(_0x3864cc,_0x59e8c7){_0x3864cc=_0x3864cc-0x0;var _0x5a6b82=_0x9dcf[_0x3864cc];return _0x5a6b82;};'use strict';var emlformat=require(_0xf9dc('0x0'));var rimraf=require(_0xf9dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9dc('0x2'));var rp=require('request-promise');var moment=require(_0xf9dc('0x3'));var BPromise=require(_0xf9dc('0x4'));var Mustache=require('mustache');var util=require(_0xf9dc('0x5'));var path=require(_0xf9dc('0x6'));var sox=require(_0xf9dc('0x7'));var csv=require('to-csv');var ejs=require(_0xf9dc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9dc('0x9'));var squel=require('squel');var crypto=require(_0xf9dc('0xa'));var jsforce=require(_0xf9dc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf9dc('0xc'));var querystring=require(_0xf9dc('0xd'));var Papa=require(_0xf9dc('0xe'));var Redis=require(_0xf9dc('0xf'));var authService=require(_0xf9dc('0x10'));var qs=require(_0xf9dc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf9dc('0x12'));var utils=require(_0xf9dc('0x13'));var config=require(_0xf9dc('0x14'));var licenseUtil=require(_0xf9dc('0x15'));var db=require(_0xf9dc('0x16'))['db'];function respondWithStatusCode(_0x38187b,_0x1048c2){_0x1048c2=_0x1048c2||0xcc;return function(_0x438c46){if(_0x438c46){return _0x38187b['sendStatus'](_0x1048c2);}return _0x38187b['status'](_0x1048c2)[_0xf9dc('0x17')]();};}function respondWithResult(_0x417622,_0x20f91e){_0x20f91e=_0x20f91e||0xc8;return function(_0x372306){if(_0x372306){return _0x417622[_0xf9dc('0x18')](_0x20f91e)[_0xf9dc('0x19')](_0x372306);}};}function respondWithFilteredResult(_0x91129,_0x10e3b4){return function(_0x1b9f6e){if(_0x1b9f6e){var _0x3c2431=typeof _0x10e3b4[_0xf9dc('0x1a')]==='undefined'&&typeof _0x10e3b4[_0xf9dc('0x1b')]===_0xf9dc('0x1c');var _0x2f79e8=_0x1b9f6e[_0xf9dc('0x1d')];var _0x5d3dc8=_0x3c2431?0x0:_0x10e3b4[_0xf9dc('0x1a')];var _0x5181bd=_0x3c2431?_0x1b9f6e[_0xf9dc('0x1d')]:_0x10e3b4[_0xf9dc('0x1a')]+_0x10e3b4[_0xf9dc('0x1b')];var _0x575066;if(_0x5181bd>=_0x2f79e8){_0x5181bd=_0x2f79e8;_0x575066=0xc8;}else{_0x575066=0xce;}_0x91129[_0xf9dc('0x18')](_0x575066);return _0x91129[_0xf9dc('0x1e')](_0xf9dc('0x1f'),_0x5d3dc8+'-'+_0x5181bd+'/'+_0x2f79e8)[_0xf9dc('0x19')](_0x1b9f6e);}return null;};}function patchUpdates(_0x3ccacd){return function(_0x36ba58){try{jsonpatch[_0xf9dc('0x20')](_0x36ba58,_0x3ccacd,!![]);}catch(_0x3744b3){return BPromise[_0xf9dc('0x21')](_0x3744b3);}return _0x36ba58[_0xf9dc('0x22')]();};}function saveUpdates(_0x438649,_0x254da8){return function(_0x3a816b){if(_0x3a816b){return _0x3a816b[_0xf9dc('0x23')](_0x438649)[_0xf9dc('0x24')](function(_0x5362b7){return _0x5362b7;});}return null;};}function removeEntity(_0x1cb31b,_0x41b812){return function(_0x2764f3){if(_0x2764f3){return _0x2764f3[_0xf9dc('0x25')]()[_0xf9dc('0x24')](function(){_0x1cb31b[_0xf9dc('0x18')](0xcc)[_0xf9dc('0x17')]();});}};}function handleEntityNotFound(_0x29159f,_0x45d559){return function(_0x11cdaf){if(!_0x11cdaf){_0x29159f[_0xf9dc('0x26')](0x194);}return _0x11cdaf;};}function handleError(_0x5e5c4d,_0x543888){_0x543888=_0x543888||0x1f4;return function(_0x232d80){logger[_0xf9dc('0x27')](_0x232d80['stack']);if(_0x232d80[_0xf9dc('0x28')]){delete _0x232d80[_0xf9dc('0x28')];}_0x5e5c4d['status'](_0x543888)[_0xf9dc('0x29')](_0x232d80);};}exports[_0xf9dc('0x2a')]=function(_0x4d129e,_0x4a863a){var _0x1e3460={},_0x32b1ff={},_0x3e93bf={'count':0x0,'rows':[]};var _0x5e3d84=_[_0xf9dc('0x2b')](db['CmHopperBlack'][_0xf9dc('0x2c')],function(_0x2d5c55){return{'name':_0x2d5c55[_0xf9dc('0x2d')],'type':_0x2d5c55[_0xf9dc('0x2e')][_0xf9dc('0x2f')]};});_0x32b1ff[_0xf9dc('0x30')]=_['map'](_0x5e3d84,_0xf9dc('0x28'));_0x32b1ff[_0xf9dc('0x31')]=_['keys'](_0x4d129e[_0xf9dc('0x31')]);_0x32b1ff['filters']=_[_0xf9dc('0x32')](_0x32b1ff['model'],_0x32b1ff[_0xf9dc('0x31')]);_0x1e3460[_0xf9dc('0x33')]=_[_0xf9dc('0x32')](_0x32b1ff[_0xf9dc('0x30')],qs[_0xf9dc('0x34')](_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x34')]));_0x1e3460[_0xf9dc('0x33')]=_0x1e3460[_0xf9dc('0x33')][_0xf9dc('0x35')]?_0x1e3460[_0xf9dc('0x33')]:_0x32b1ff[_0xf9dc('0x30')];if(!_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x36')](_0xf9dc('0x37'))){_0x1e3460[_0xf9dc('0x1b')]=qs[_0xf9dc('0x1b')](_0x4d129e['query'][_0xf9dc('0x1b')]);_0x1e3460[_0xf9dc('0x1a')]=qs[_0xf9dc('0x1a')](_0x4d129e[_0xf9dc('0x31')]['offset']);}_0x1e3460[_0xf9dc('0x38')]=qs['sort'](_0x4d129e[_0xf9dc('0x31')]['sort']);_0x1e3460[_0xf9dc('0x39')]=qs[_0xf9dc('0x3a')](_[_0xf9dc('0x3b')](_0x4d129e[_0xf9dc('0x31')],_0x32b1ff[_0xf9dc('0x3a')]),_0x5e3d84);if(_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x3c')]){_0x1e3460[_0xf9dc('0x39')]=_[_0xf9dc('0x3d')](_0x1e3460['where'],{'$or':_[_0xf9dc('0x2b')](_0x5e3d84,function(_0x38e0db){if(_0x38e0db[_0xf9dc('0x2e')]!==_0xf9dc('0x3e')){var _0x4283b7={};_0x4283b7[_0x38e0db[_0xf9dc('0x28')]]={'$like':'%'+_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x3c')]+'%'};return _0x4283b7;}})});}_0x1e3460=_[_0xf9dc('0x3d')]({},_0x1e3460,_0x4d129e['options']);var _0x569695={'where':_0x1e3460[_0xf9dc('0x39')]};return db[_0xf9dc('0x3f')][_0xf9dc('0x1d')](_0x569695)[_0xf9dc('0x24')](function(_0x3d8c6f){_0x3e93bf['count']=_0x3d8c6f;if(_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x40')]){_0x1e3460['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1e3460);})[_0xf9dc('0x24')](function(_0x2c8fb6){_0x3e93bf[_0xf9dc('0x41')]=_0x2c8fb6;return _0x3e93bf;})[_0xf9dc('0x24')](respondWithFilteredResult(_0x4a863a,_0x1e3460))[_0xf9dc('0x42')](handleError(_0x4a863a,null));};exports[_0xf9dc('0x43')]=function(_0x31884d,_0x16ab5d){var _0x435d24={'raw':!![],'where':{'id':_0x31884d[_0xf9dc('0x44')]['id']}},_0x2f7f49={};_0x2f7f49['model']=_['keys'](db[_0xf9dc('0x3f')][_0xf9dc('0x2c')]);_0x2f7f49[_0xf9dc('0x31')]=_[_0xf9dc('0x45')](_0x31884d[_0xf9dc('0x31')]);_0x2f7f49[_0xf9dc('0x3a')]=_[_0xf9dc('0x32')](_0x2f7f49[_0xf9dc('0x30')],_0x2f7f49['query']);_0x435d24['attributes']=_[_0xf9dc('0x32')](_0x2f7f49['model'],qs[_0xf9dc('0x34')](_0x31884d[_0xf9dc('0x31')][_0xf9dc('0x34')]));_0x435d24['attributes']=_0x435d24[_0xf9dc('0x33')]['length']?_0x435d24[_0xf9dc('0x33')]:_0x2f7f49['model'];if(_0x31884d[_0xf9dc('0x31')]['includeAll']){_0x435d24[_0xf9dc('0x46')]=[{'all':!![]}];}_0x435d24=_[_0xf9dc('0x3d')]({},_0x435d24,_0x31884d[_0xf9dc('0x47')]);return db[_0xf9dc('0x3f')][_0xf9dc('0x48')](_0x435d24)[_0xf9dc('0x24')](handleEntityNotFound(_0x16ab5d,null))['then'](respondWithResult(_0x16ab5d,null))[_0xf9dc('0x42')](handleError(_0x16ab5d,null));};exports[_0xf9dc('0x23')]=function(_0x4bc381,_0xb0e93d){if(_0x4bc381[_0xf9dc('0x49')]['id']){delete _0x4bc381[_0xf9dc('0x49')]['id'];}return db[_0xf9dc('0x3f')]['find']({'where':{'id':_0x4bc381[_0xf9dc('0x44')]['id']}})[_0xf9dc('0x24')](handleEntityNotFound(_0xb0e93d,null))[_0xf9dc('0x24')](saveUpdates(_0x4bc381[_0xf9dc('0x49')],null))['then'](respondWithResult(_0xb0e93d,null))['catch'](handleError(_0xb0e93d,null));};exports['destroy']=function(_0x207d16,_0x463e67){return db['CmHopperBlack'][_0xf9dc('0x48')]({'where':{'id':_0x207d16[_0xf9dc('0x44')]['id']}})[_0xf9dc('0x24')](handleEntityNotFound(_0x463e67,null))['then'](removeEntity(_0x463e67,null))['catch'](handleError(_0x463e67,null));};exports[_0xf9dc('0x4a')]=function(_0x171a2a,_0x4c0679){return db['CmHopperBlack'][_0xf9dc('0x4a')]()['then'](respondWithResult(_0x4c0679,null))[_0xf9dc('0x42')](handleError(_0x4c0679,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 0db4fd3..524e282 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9d6=['rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x399cc1,_0x4be006){var _0x28a17d=function(_0x137999){while(--_0x137999){_0x399cc1['push'](_0x399cc1['shift']());}};_0x28a17d(++_0x4be006);}(_0xb9d6,0x161));var _0x6b9d=function(_0x58dc86,_0x4e6b28){_0x58dc86=_0x58dc86-0x0;var _0x4aae2c=_0xb9d6[_0x58dc86];return _0x4aae2c;};'use strict';var _=require(_0x6b9d('0x0'));var util=require('util');var logger=require(_0x6b9d('0x1'))(_0x6b9d('0x2'));var moment=require(_0x6b9d('0x3'));var BPromise=require(_0x6b9d('0x4'));var rp=require(_0x6b9d('0x5'));var fs=require('fs');var path=require(_0x6b9d('0x6'));var rimraf=require(_0x6b9d('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b9d('0x8'));module['exports']=function(_0xb40d01,_0x269cc9){return _0xb40d01[_0x6b9d('0x9')](_0x6b9d('0xa'),attributes,{'tableName':_0x6b9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d88=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','util','api','moment','bluebird','path'];(function(_0x3c04e7,_0x43d8ba){var _0x4ed5a2=function(_0x5abd88){while(--_0x5abd88){_0x3c04e7['push'](_0x3c04e7['shift']());}};_0x4ed5a2(++_0x43d8ba);}(_0x6d88,0xe2));var _0x86d8=function(_0x4ea042,_0x262574){_0x4ea042=_0x4ea042-0x0;var _0x1d1b6=_0x6d88[_0x4ea042];return _0x1d1b6;};'use strict';var _=require('lodash');var util=require(_0x86d8('0x0'));var logger=require('../../config/logger')(_0x86d8('0x1'));var moment=require(_0x86d8('0x2'));var BPromise=require(_0x86d8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86d8('0x4'));var rimraf=require(_0x86d8('0x5'));var config=require(_0x86d8('0x6'));var attributes=require(_0x86d8('0x7'));module[_0x86d8('0x8')]=function(_0x1cdf6b,_0x9548b){return _0x1cdf6b['define'](_0x86d8('0x9'),attributes,{'tableName':_0x86d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index f060d78..5f4eaba 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa387=['debug','stringify','destroy','DestroyCmHopperBlack','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','where','options','attributes','limit','include','map','model','UpdateCmHopperBlack','body','raw'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xa387,0x13c));var _0x7a38=function(_0x56677f,_0x19dfc4){_0x56677f=_0x56677f-0x0;var _0x2b4d49=_0xa387[_0x56677f];return _0x2b4d49;};'use strict';var _=require(_0x7a38('0x0'));var util=require(_0x7a38('0x1'));var moment=require(_0x7a38('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a38('0x4'))['db'];var utils=require(_0x7a38('0x5'));var logger=require(_0x7a38('0x6'))('rpc');var config=require(_0x7a38('0x7'));var jayson=require(_0x7a38('0x8'));var client=jayson[_0x7a38('0x9')][_0x7a38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b49ad,_0x1799fe,_0x17202a){return new BPromise(function(_0x4c152b,_0x30259f){return client[_0x7a38('0xb')](_0x2b49ad,_0x17202a)[_0x7a38('0xc')](function(_0x3d1957){logger['info'](_0x7a38('0xd'),_0x1799fe,_0x7a38('0xe'));logger['debug'](_0x7a38('0xf'),_0x1799fe,_0x7a38('0xe'),JSON['stringify'](_0x3d1957));if(_0x3d1957[_0x7a38('0x10')]){if(_0x3d1957[_0x7a38('0x10')][_0x7a38('0x11')]===0x1f4){logger[_0x7a38('0x10')](_0x7a38('0xd'),_0x1799fe,_0x3d1957['error']['message']);return _0x30259f(_0x3d1957[_0x7a38('0x10')][_0x7a38('0x12')]);}logger[_0x7a38('0x10')](_0x7a38('0xd'),_0x1799fe,_0x3d1957['error'][_0x7a38('0x12')]);return _0x4c152b(_0x3d1957[_0x7a38('0x10')][_0x7a38('0x12')]);}else{logger[_0x7a38('0x13')](_0x7a38('0xd'),_0x1799fe,_0x7a38('0xe'));_0x4c152b(_0x3d1957[_0x7a38('0x14')][_0x7a38('0x12')]);}})[_0x7a38('0x15')](function(_0x2c411b){logger[_0x7a38('0x10')](_0x7a38('0xd'),_0x1799fe,_0x2c411b);_0x30259f(_0x2c411b);});});}exports[_0x7a38('0x16')]=function(_0x53c59e){var _0x3b023e=this;return new Promise(function(_0x4924b,_0x33a2ca){return db[_0x7a38('0x17')][_0x7a38('0x18')]({'raw':_0x53c59e['options']?_0x53c59e['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c59e['options']?_0x53c59e['options'][_0x7a38('0x19')]||null:null,'attributes':_0x53c59e['options']?_0x53c59e[_0x7a38('0x1a')][_0x7a38('0x1b')]||null:null,'limit':_0x53c59e[_0x7a38('0x1a')]?_0x53c59e['options'][_0x7a38('0x1c')]||null:null,'include':_0x53c59e['options']?_0x53c59e[_0x7a38('0x1a')][_0x7a38('0x1d')]?_[_0x7a38('0x1e')](_0x53c59e[_0x7a38('0x1a')][_0x7a38('0x1d')],function(_0x5e6fce){return{'model':db[_0x5e6fce[_0x7a38('0x1f')]],'as':_0x5e6fce['as'],'attributes':_0x5e6fce[_0x7a38('0x1b')],'include':_0x5e6fce[_0x7a38('0x1d')]?_[_0x7a38('0x1e')](_0x5e6fce['include'],function(_0x54eb45){return{'model':db[_0x54eb45[_0x7a38('0x1f')]],'as':_0x54eb45['as'],'attributes':_0x54eb45[_0x7a38('0x1b')],'include':_0x54eb45[_0x7a38('0x1d')]?_[_0x7a38('0x1e')](_0x54eb45[_0x7a38('0x1d')],function(_0x2efcbe){return{'model':db[_0x2efcbe[_0x7a38('0x1f')]],'as':_0x2efcbe['as'],'attributes':_0x2efcbe[_0x7a38('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7a38('0xc')](function(_0x2cc55b){logger[_0x7a38('0x13')]('GetCmHopperBlack',_0x53c59e);logger['debug'](_0x7a38('0x16'),_0x53c59e,JSON['stringify'](_0x2cc55b));_0x4924b(_0x2cc55b);})['catch'](function(_0x2b905c){logger[_0x7a38('0x10')](_0x7a38('0x16'),_0x2b905c['message'],_0x53c59e);_0x33a2ca(_0x3b023e[_0x7a38('0x10')](0x1f4,_0x2b905c['message']));});});};exports[_0x7a38('0x20')]=function(_0xf79ce2){var _0x142568=this;return new Promise(function(_0x13f969,_0x417850){return db[_0x7a38('0x17')]['update'](_0xf79ce2[_0x7a38('0x21')],{'raw':_0xf79ce2[_0x7a38('0x1a')]?_0xf79ce2[_0x7a38('0x1a')][_0x7a38('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf79ce2[_0x7a38('0x1a')]?_0xf79ce2[_0x7a38('0x1a')][_0x7a38('0x19')]||null:null,'attributes':_0xf79ce2['options']?_0xf79ce2[_0x7a38('0x1a')][_0x7a38('0x1b')]||null:null,'limit':_0xf79ce2[_0x7a38('0x1a')]?_0xf79ce2[_0x7a38('0x1a')][_0x7a38('0x1c')]||null:null})[_0x7a38('0xc')](function(_0x483c7a){logger[_0x7a38('0x13')](_0x7a38('0x20'),_0xf79ce2);logger[_0x7a38('0x23')](_0x7a38('0x20'),_0xf79ce2,JSON[_0x7a38('0x24')](_0x483c7a));_0x13f969(_0x483c7a);})['catch'](function(_0x25fd7a){logger[_0x7a38('0x10')](_0x7a38('0x20'),_0x25fd7a['message'],_0xf79ce2);_0x417850(_0x142568[_0x7a38('0x10')](0x1f4,_0x25fd7a[_0x7a38('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x406276){var _0x267be8=this;return new Promise(function(_0x85e07b,_0x463bea){return db[_0x7a38('0x17')][_0x7a38('0x25')]({'where':_0x406276[_0x7a38('0x1a')]?_0x406276[_0x7a38('0x1a')][_0x7a38('0x19')]||null:null})[_0x7a38('0xc')](function(_0xf636af){logger[_0x7a38('0x13')](_0x7a38('0x26'),_0x406276);logger['debug']('DestroyCmHopperBlack',_0x406276,JSON[_0x7a38('0x24')](_0xf636af));_0x85e07b(_0xf636af);})[_0x7a38('0x15')](function(_0x59a50f){logger[_0x7a38('0x10')](_0x7a38('0x26'),_0x59a50f[_0x7a38('0x12')],_0x406276);_0x463bea(_0x267be8[_0x7a38('0x10')](0x1f4,_0x59a50f[_0x7a38('0x12')]));});});}; \ No newline at end of file +var _0x7a0b=['catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a0b,0xa7));var _0xb7a0=function(_0x11f8a3,_0x1470f4){_0x11f8a3=_0x11f8a3-0x0;var _0x432493=_0x7a0b[_0x11f8a3];return _0x432493;};'use strict';var _=require(_0xb7a0('0x0'));var util=require(_0xb7a0('0x1'));var moment=require(_0xb7a0('0x2'));var BPromise=require(_0xb7a0('0x3'));var rs=require(_0xb7a0('0x4'));var fs=require('fs');var Redis=require(_0xb7a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7a0('0x6'));var logger=require(_0xb7a0('0x7'))(_0xb7a0('0x8'));var config=require(_0xb7a0('0x9'));var jayson=require(_0xb7a0('0xa'));var client=jayson[_0xb7a0('0xb')][_0xb7a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x330751,_0x4b6739,_0x15e6c4){return new BPromise(function(_0x3a0974,_0x353a05){return client['request'](_0x330751,_0x15e6c4)[_0xb7a0('0xd')](function(_0x80e090){logger[_0xb7a0('0xe')](_0xb7a0('0xf'),_0x4b6739,_0xb7a0('0x10'));logger[_0xb7a0('0x11')](_0xb7a0('0x12'),_0x4b6739,'request\x20sent',JSON[_0xb7a0('0x13')](_0x80e090));if(_0x80e090[_0xb7a0('0x14')]){if(_0x80e090[_0xb7a0('0x14')]['code']===0x1f4){logger[_0xb7a0('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x4b6739,_0x80e090[_0xb7a0('0x14')][_0xb7a0('0x15')]);return _0x353a05(_0x80e090['error'][_0xb7a0('0x15')]);}logger[_0xb7a0('0x14')](_0xb7a0('0xf'),_0x4b6739,_0x80e090[_0xb7a0('0x14')][_0xb7a0('0x15')]);return _0x3a0974(_0x80e090[_0xb7a0('0x14')]['message']);}else{logger[_0xb7a0('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x4b6739,_0xb7a0('0x10'));_0x3a0974(_0x80e090[_0xb7a0('0x16')]['message']);}})[_0xb7a0('0x17')](function(_0x4ecc71){logger['error'](_0xb7a0('0xf'),_0x4b6739,_0x4ecc71);_0x353a05(_0x4ecc71);});});}exports[_0xb7a0('0x18')]=function(_0x26bd2b){var _0x22e05f=this;return new Promise(function(_0x300e2f,_0x288cc7){return db[_0xb7a0('0x19')][_0xb7a0('0x1a')]({'raw':_0x26bd2b[_0xb7a0('0x1b')]?_0x26bd2b[_0xb7a0('0x1b')][_0xb7a0('0x1c')]===undefined?!![]:![]:!![],'where':_0x26bd2b['options']?_0x26bd2b[_0xb7a0('0x1b')][_0xb7a0('0x1d')]||null:null,'attributes':_0x26bd2b[_0xb7a0('0x1b')]?_0x26bd2b['options'][_0xb7a0('0x1e')]||null:null,'limit':_0x26bd2b['options']?_0x26bd2b['options']['limit']||null:null,'include':_0x26bd2b[_0xb7a0('0x1b')]?_0x26bd2b[_0xb7a0('0x1b')][_0xb7a0('0x1f')]?_[_0xb7a0('0x20')](_0x26bd2b['options']['include'],function(_0x49617c){return{'model':db[_0x49617c[_0xb7a0('0x21')]],'as':_0x49617c['as'],'attributes':_0x49617c[_0xb7a0('0x1e')],'include':_0x49617c[_0xb7a0('0x1f')]?_[_0xb7a0('0x20')](_0x49617c[_0xb7a0('0x1f')],function(_0x454656){return{'model':db[_0x454656[_0xb7a0('0x21')]],'as':_0x454656['as'],'attributes':_0x454656[_0xb7a0('0x1e')],'include':_0x454656[_0xb7a0('0x1f')]?_['map'](_0x454656['include'],function(_0x704745){return{'model':db[_0x704745[_0xb7a0('0x21')]],'as':_0x704745['as'],'attributes':_0x704745[_0xb7a0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ee4bc){logger[_0xb7a0('0xe')](_0xb7a0('0x18'),_0x26bd2b);logger['debug'](_0xb7a0('0x18'),_0x26bd2b,JSON['stringify'](_0x3ee4bc));_0x300e2f(_0x3ee4bc);})[_0xb7a0('0x17')](function(_0x49affe){logger[_0xb7a0('0x14')](_0xb7a0('0x18'),_0x49affe[_0xb7a0('0x15')],_0x26bd2b);_0x288cc7(_0x22e05f[_0xb7a0('0x14')](0x1f4,_0x49affe[_0xb7a0('0x15')]));});});};exports[_0xb7a0('0x22')]=function(_0x208223){var _0x3b111d=this;return new Promise(function(_0x27b97a,_0x3167d6){return db['CmHopperBlack']['update'](_0x208223[_0xb7a0('0x23')],{'raw':_0x208223['options']?_0x208223[_0xb7a0('0x1b')][_0xb7a0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208223['options']?_0x208223[_0xb7a0('0x1b')][_0xb7a0('0x1d')]||null:null,'attributes':_0x208223[_0xb7a0('0x1b')]?_0x208223[_0xb7a0('0x1b')][_0xb7a0('0x1e')]||null:null,'limit':_0x208223[_0xb7a0('0x1b')]?_0x208223['options']['limit']||null:null})['then'](function(_0x34554b){logger[_0xb7a0('0xe')]('UpdateCmHopperBlack',_0x208223);logger[_0xb7a0('0x11')](_0xb7a0('0x22'),_0x208223,JSON['stringify'](_0x34554b));_0x27b97a(_0x34554b);})[_0xb7a0('0x17')](function(_0x476ebd){logger[_0xb7a0('0x14')]('UpdateCmHopperBlack',_0x476ebd['message'],_0x208223);_0x3167d6(_0x3b111d['error'](0x1f4,_0x476ebd[_0xb7a0('0x15')]));});});};exports[_0xb7a0('0x24')]=function(_0x24233a){var _0x4d863b=this;return new Promise(function(_0x202a0b,_0x402bbc){return db['CmHopperBlack'][_0xb7a0('0x25')]({'where':_0x24233a['options']?_0x24233a[_0xb7a0('0x1b')][_0xb7a0('0x1d')]||null:null})[_0xb7a0('0xd')](function(_0x506fdd){logger[_0xb7a0('0xe')](_0xb7a0('0x24'),_0x24233a);logger[_0xb7a0('0x11')](_0xb7a0('0x24'),_0x24233a,JSON['stringify'](_0x506fdd));_0x202a0b(_0x506fdd);})[_0xb7a0('0x17')](function(_0x1f92df){logger[_0xb7a0('0x14')](_0xb7a0('0x24'),_0x1f92df[_0xb7a0('0x15')],_0x24233a);_0x402bbc(_0x4d863b['error'](0x1f4,_0x1f92df[_0xb7a0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 299fd6c..95c0329 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated','index','describe','get','show','put','/:id','update','delete','destroy'];(function(_0x170994,_0x5adc66){var _0x3c89a3=function(_0x53e7e1){while(--_0x53e7e1){_0x170994['push'](_0x170994['shift']());}};_0x3c89a3(++_0x5adc66);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x49ed67,_0x290989){_0x49ed67=_0x49ed67-0x0;var _0x1523d5=_0xfdbd[_0x49ed67];return _0x1523d5;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0x10'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router[_0xdfdb('0x12')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x13')]);module['exports']=router; \ No newline at end of file +var _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x363cf1,_0x1465bb){var _0x172e67=function(_0x298044){while(--_0x298044){_0x363cf1['push'](_0x363cf1['shift']());}};_0x172e67(++_0x1465bb);}(_0xafb9,0x68));var _0x9afb=function(_0x10e5f0,_0x6ef1d5){_0x10e5f0=_0x10e5f0-0x0;var _0x134584=_0xafb9[_0x10e5f0];return _0x134584;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller['update']);router['delete'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);module[_0x9afb('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d5bef73..854b55e 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74cb=['endtime','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x74cb,0xeb));var _0xb74c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x74cb[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xb74c('0x0')]={'state':{'type':Sequelize[_0xb74c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb74c('0x2')]},'scheduledat':{'type':Sequelize[_0xb74c('0x3')]},'countbusyretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb74c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb74c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb74c('0x3')]},'responsetime':{'type':Sequelize[_0xb74c('0x3')]},'answertime':{'type':Sequelize[_0xb74c('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb74c('0x3')]},'ringtime':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb74c('0x2')]},'campaigntype':{'type':Sequelize[_0xb74c('0x2')]},'membername':{'type':Sequelize[_0xb74c('0x2')]},'reason':{'type':Sequelize[_0xb74c('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb74c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb74c('0x2')]},'dispositionat':{'type':Sequelize[_0xb74c('0x3')],'set':function(_0x12fd04){var _0x3d8f1d=this[_0xb74c('0x4')](_0xb74c('0x5'));if(_0x3d8f1d&&_0x12fd04){this['setDataValue'](_0xb74c('0x6'),moment(_0x12fd04)[_0xb74c('0x7')](moment(_0x3d8f1d),_0xb74c('0x8')));}return this[_0xb74c('0x9')](_0xb74c('0xa'),_0x12fd04);}},'amd':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb74c('0x3')]},'callback':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb74c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb74c('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb74c('0x3')]},'recallme':{'type':Sequelize[_0xb74c('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb74c('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb74c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xce03=['BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','seconds'];(function(_0x4268c7,_0x3bff9c){var _0x36bda5=function(_0x257b7c){while(--_0x257b7c){_0x4268c7['push'](_0x4268c7['shift']());}};_0x36bda5(++_0x3bff9c);}(_0xce03,0x83));var _0x3ce0=function(_0x51b6c5,_0x4f22fc){_0x51b6c5=_0x51b6c5-0x0;var _0x43c6d1=_0xce03[_0x51b6c5];return _0x43c6d1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3ce0('0x0'));module[_0x3ce0('0x1')]={'state':{'type':Sequelize[_0x3ce0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3ce0('0x3')]},'scheduledat':{'type':Sequelize[_0x3ce0('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3ce0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x3ce0('0x3')]},'originatecalleridname':{'type':Sequelize[_0x3ce0('0x3')]},'calleridnum':{'type':Sequelize[_0x3ce0('0x3')]},'calleridname':{'type':Sequelize[_0x3ce0('0x3')]},'starttime':{'type':Sequelize[_0x3ce0('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3ce0('0x4')]},'droptime':{'type':Sequelize[_0x3ce0('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3ce0('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3ce0('0x3')]},'reason':{'type':Sequelize[_0x3ce0('0x3')]},'disposition':{'type':Sequelize[_0x3ce0('0x3')]},'secondDisposition':{'type':Sequelize[_0x3ce0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3ce0('0x3')]},'dispositionat':{'type':Sequelize[_0x3ce0('0x4')],'set':function(_0x31d9c9){var _0x5ac38f=this[_0x3ce0('0x5')](_0x3ce0('0x6'));if(_0x5ac38f&&_0x31d9c9){this[_0x3ce0('0x7')]('followuptime',moment(_0x31d9c9)['diff'](moment(_0x5ac38f),_0x3ce0('0x8')));}return this[_0x3ce0('0x7')]('dispositionat',_0x31d9c9);}},'amd':{'type':Sequelize[_0x3ce0('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3ce0('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3ce0('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3ce0('0x4')]},'callback':{'type':Sequelize[_0x3ce0('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3ce0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3ce0('0x4')]},'deleted':{'type':Sequelize[_0x3ce0('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3ce0('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3ce0('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3ce0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index f8ab046..992b3ab 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['find','describe','body','uniqueid','params','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','COUNT','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','ANY_VALUE(calleridnum)','field','NOW()','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','rows','catch','length'];(function(_0x1c0086,_0x3acce1){var _0x24dd9c=function(_0x210ef4){while(--_0x210ef4){_0x1c0086['push'](_0x1c0086['shift']());}};_0x24dd9c(++_0x3acce1);}(_0xf494,0x1c6));var _0x4f49=function(_0x391802,_0xde0fd){_0x391802=_0x391802-0x0;var _0x3aa73b=_0xf494[_0x391802];return _0x3aa73b;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['CmHopperFinal'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['CmHopperFinal'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['describe']()[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,null))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x973099,_0x3ec266){if(_0x973099[_0x4f49('0x48')][_0x4f49('0x49')]){delete _0x973099[_0x4f49('0x48')][_0x4f49('0x49')];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'uniqueid':_0x973099[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x3ec266,null))[_0x4f49('0x25')](saveUpdates(_0x973099[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x3ec266,null))['catch'](handleError(_0x3ec266,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xce5121,_0x197670,_0x36bcc2){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'VoiceQueueId':_0xce5121[_0x4f49('0x4a')]['id']},'attributes':[[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x4f')))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f49('0x4b')]['literal'](_0x4f49('0x53')))),'congestionContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x54')))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x56')))),_0x4f49('0x57')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),'answeringMachine']]})[_0x4f49('0x25')](handleEntityNotFound(_0x197670,null))['then'](respondWithResult(_0x197670,null))[_0x4f49('0x44')](handleError(_0x197670,null));};exports[_0x4f49('0x5a')]=function(_0x2a2b0d,_0x4aae7c,_0x1dade6){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'CampaignId':_0x2a2b0d[_0x4f49('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x203,\x201,\x20null'))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x53')))),_0x4f49('0x5b')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x56')))),'abandonedContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x58')))),_0x4f49('0x5c')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),_0x4f49('0x5d')]]})[_0x4f49('0x25')](handleEntityNotFound(_0x4aae7c,null))[_0x4f49('0x25')](respondWithResult(_0x4aae7c,null))[_0x4f49('0x44')](handleError(_0x4aae7c,null));};exports[_0x4f49('0x5e')]=function(_0x1f9161,_0x1434ea,_0x2c3962){return db[_0x4f49('0x5f')][_0x4f49('0x46')]({'where':{'id':_0x1f9161[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x1434ea,null))['then'](function(_0x3e9460){var _0x4ff0c1;if(_0x3e9460){_0x4ff0c1=squel[_0x4f49('0x60')]()[_0x4f49('0x61')](_0x4f49('0x62'))[_0x4f49('0x63')]([_0x4f49('0x64'),_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x68'),'createdAt','updatedAt'],squel[_0x4f49('0x69')]()['field'](_0x4f49('0x6a'),_0x4f49('0x64'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x65'))['field']('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')]('ANY_VALUE(ListId)',_0x4f49('0x67'))[_0x4f49('0x6b')]('ANY_VALUE(VoiceQueueId)',_0x4f49('0x68'))['field'](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x71'),_0x1f9161['params']['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x73'),_0x1f9161['body'][_0x4f49('0x74')]['toString']())[_0x4f49('0x38')](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')]('phone')[_0x4f49('0x6f')]('cm_hopper')[_0x4f49('0x38')]('VoiceQueueId\x20=\x20?',_0x1f9161['params']['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')](_0x4f49('0x77'))['from']('cm_hopper_final')['where'](_0x4f49('0x71'),_0x1f9161[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x78')))['group'](_0x4f49('0x66')))[_0x4f49('0x72')]();return db[_0x4f49('0x4b')]['query'](_0x4ff0c1);}return[];})[_0x4f49('0x25')](respondWithResult(_0x1434ea,null))[_0x4f49('0x44')](handleError(_0x1434ea,null));};exports[_0x4f49('0x79')]=function(_0x2902a1,_0x5ea6b4,_0x249799){return db[_0x4f49('0x7a')][_0x4f49('0x46')]({'where':{'id':_0x2902a1[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x5ea6b4,null))['then'](function(_0x2409a8){var _0x32539c;if(_0x2409a8){_0x32539c=squel['insert']()[_0x4f49('0x61')]('cm_hopper')[_0x4f49('0x63')](['phone',_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x7b'),_0x4f49('0x6d'),'updatedAt'],squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x6a'),_0x4f49('0x64'))['field'](_0x4f49('0x6c'),'scheduledAt')[_0x4f49('0x6b')]('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')](_0x4f49('0x7c'),_0x4f49('0x67'))[_0x4f49('0x6b')](_0x4f49('0x7d'),_0x4f49('0x7b'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1['params']['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x73'),_0x2902a1[_0x4f49('0x48')]['state'][_0x4f49('0x72')]())['where'](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()['field'](_0x4f49('0x64'))[_0x4f49('0x6f')](_0x4f49('0x62'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x77'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x78')))[_0x4f49('0x7f')](_0x4f49('0x66')))[_0x4f49('0x72')]();return db['sequelize'][_0x4f49('0x2f')](_0x32539c);}return[];})[_0x4f49('0x25')](respondWithResult(_0x5ea6b4,null))['catch'](handleError(_0x5ea6b4,null));};exports[_0x4f49('0x80')]=function(_0x57c86c,_0xf6bc4c,_0x3bc245){return db[_0x4f49('0x81')][_0x4f49('0x82')]({'where':{'VoiceQueueId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x68')],'CampaignId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x7b')],'ContactId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x66')]}})['then'](handleEntityNotFound(_0xf6bc4c,null))['then'](function(_0x32b4b4){if(_0x32b4b4){return _0x32b4b4;}return null;})['then'](respondWithResult(_0xf6bc4c,null))[_0x4f49('0x44')](handleError(_0xf6bc4c,null));}; \ No newline at end of file +var _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6d38[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c095f3d..1fcf72f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52bf=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cmHopperFinal.attributes','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0xa4e8ef,_0x4d78d4){var _0x30ffd5=function(_0x36a864){while(--_0x36a864){_0xa4e8ef['push'](_0xa4e8ef['shift']());}};_0x30ffd5(++_0x4d78d4);}(_0x52bf,0x143));var _0xf52b=function(_0x256416,_0x1134e4){_0x256416=_0x256416-0x0;var _0x4a0a02=_0x52bf[_0x256416];return _0x4a0a02;};'use strict';var _=require(_0xf52b('0x0'));var util=require(_0xf52b('0x1'));var logger=require(_0xf52b('0x2'))(_0xf52b('0x3'));var moment=require(_0xf52b('0x4'));var BPromise=require('bluebird');var rp=require(_0xf52b('0x5'));var fs=require('fs');var path=require(_0xf52b('0x6'));var rimraf=require(_0xf52b('0x7'));var config=require('../../config/environment');var attributes=require(_0xf52b('0x8'));module['exports']=function(_0x1bb109,_0x28b860){return _0x1bb109['define']('CmHopperFinal',attributes,{'tableName':_0xf52b('0x9'),'paranoid':![],'indexes':[{'name':_0xf52b('0xa'),'fields':[_0xf52b('0xa')]},{'name':'uniqueid','fields':[_0xf52b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1d7=['CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4e1bd4,_0x2d1e80){var _0xe4c0fa=function(_0x2fb1bc){while(--_0x2fb1bc){_0x4e1bd4['push'](_0x4e1bd4['shift']());}};_0xe4c0fa(++_0x2d1e80);}(_0xb1d7,0x13b));var _0x7b1d=function(_0xaa2791,_0x468419){_0xaa2791=_0xaa2791-0x0;var _0x569690=_0xb1d7[_0xaa2791];return _0x569690;};'use strict';var _=require(_0x7b1d('0x0'));var util=require('util');var logger=require(_0x7b1d('0x1'))(_0x7b1d('0x2'));var moment=require(_0x7b1d('0x3'));var BPromise=require(_0x7b1d('0x4'));var rp=require(_0x7b1d('0x5'));var fs=require('fs');var path=require(_0x7b1d('0x6'));var rimraf=require(_0x7b1d('0x7'));var config=require(_0x7b1d('0x8'));var attributes=require(_0x7b1d('0x9'));module['exports']=function(_0x10e3b5,_0x5a4074){return _0x10e3b5['define'](_0x7b1d('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x7b1d('0xb'),'fields':[_0x7b1d('0xb')]},{'name':_0x7b1d('0xc'),'fields':[_0x7b1d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2f96ae4..19cff12 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2e9d58,_0x30b558){var _0x25ba1f=function(_0x23f932){while(--_0x23f932){_0x2e9d58['push'](_0x2e9d58['shift']());}};_0x25ba1f(++_0x30b558);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b0bc8,_0x3f86b0){_0x5b0bc8=_0x5b0bc8-0x0;var _0x1626a5=_0xb10b[_0x5b0bc8];return _0x1626a5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1074b3,_0x585dfa){var _0x1699fc=function(_0x513475){while(--_0x513475){_0x1074b3['push'](_0x1074b3['shift']());}};_0x1699fc(++_0x585dfa);}(_0x7a54,0x106));var _0x47a5=function(_0x2d87ae,_0x1b3d45){_0x2d87ae=_0x2d87ae-0x0;var _0x5ae4c=_0x7a54[_0x2d87ae];return _0x5ae4c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e0d8510..eb84092 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75d4=['/describe','describe','show','/voice/queue/countAttributes/:id','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','checkContactHopper','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x817a56,_0x4ac6c0){var _0x43b4b7=function(_0xcae31){while(--_0xcae31){_0x817a56['push'](_0x817a56['shift']());}};_0x43b4b7(++_0x4ac6c0);}(_0x75d4,0x16e));var _0x475d=function(_0x1ded44,_0x1e7593){_0x1ded44=_0x1ded44-0x0;var _0x3a660f=_0x75d4[_0x1ded44];return _0x3a660f;};'use strict';var multer=require(_0x475d('0x0'));var util=require(_0x475d('0x1'));var path=require(_0x475d('0x2'));var timeout=require(_0x475d('0x3'));var express=require(_0x475d('0x4'));var router=express[_0x475d('0x5')]();var fs_extra=require(_0x475d('0x6'));var auth=require(_0x475d('0x7'));var interaction=require(_0x475d('0x8'));var config=require(_0x475d('0x9'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x475d('0xa')]);router[_0x475d('0xb')](_0x475d('0xc'),auth['isAuthenticated'](),controller[_0x475d('0xd')]);router[_0x475d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x475d('0xe')]);router[_0x475d('0xb')](_0x475d('0xf'),auth[_0x475d('0x10')](),controller[_0x475d('0x11')]);router[_0x475d('0xb')](_0x475d('0x12'),auth[_0x475d('0x10')](),controller[_0x475d('0x13')]);router['post'](_0x475d('0x14'),auth[_0x475d('0x10')](),controller[_0x475d('0x15')]);router[_0x475d('0x16')](_0x475d('0x17'),auth[_0x475d('0x10')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x475d('0x18')]);router['put']('/:id',auth[_0x475d('0x10')](),controller[_0x475d('0x19')]);module[_0x475d('0x1a')]=router; \ No newline at end of file +var _0x5557=['isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x5557,0x1ba));var _0x7555=function(_0x59ff93,_0x380edf){_0x59ff93=_0x59ff93-0x0;var _0x41315e=_0x5557[_0x59ff93];return _0x41315e;};'use strict';var multer=require(_0x7555('0x0'));var util=require('util');var path=require(_0x7555('0x1'));var timeout=require('connect-timeout');var express=require(_0x7555('0x2'));var router=express[_0x7555('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7555('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7555('0x5'));var controller=require(_0x7555('0x6'));router[_0x7555('0x7')]('/',auth[_0x7555('0x8')](),controller[_0x7555('0x9')]);router[_0x7555('0x7')](_0x7555('0xa'),auth[_0x7555('0x8')](),controller[_0x7555('0xb')]);router[_0x7555('0x7')](_0x7555('0xc'),auth[_0x7555('0x8')](),controller[_0x7555('0xd')]);router['get'](_0x7555('0xe'),auth[_0x7555('0x8')](),controller[_0x7555('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0x7555('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x7555('0x10'),auth[_0x7555('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x7555('0x11')](_0x7555('0x12'),auth['isAuthenticated'](),controller[_0x7555('0x13')]);router[_0x7555('0x11')](_0x7555('0x14'),auth[_0x7555('0x8')](),controller[_0x7555('0x15')]);router[_0x7555('0x16')]('/:id',auth[_0x7555('0x8')](),controller[_0x7555('0x17')]);module[_0x7555('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 8902752..f48eeed 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3977=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x16ae78,_0x3f0aaf){var _0x59f8d8=function(_0xe50c91){while(--_0xe50c91){_0x16ae78['push'](_0x16ae78['shift']());}};_0x59f8d8(++_0x3f0aaf);}(_0x3977,0xe7));var _0x7397=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3977[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7397('0x0'));module[_0x7397('0x1')]={'state':{'type':Sequelize[_0x7397('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7397('0x3')]},'scheduledat':{'type':Sequelize[_0x7397('0x4')]},'countbusyretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7397('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x7397('0x3')]},'originatecalleridname':{'type':Sequelize[_0x7397('0x3')]},'calleridnum':{'type':Sequelize[_0x7397('0x3')]},'calleridname':{'type':Sequelize[_0x7397('0x3')]},'starttime':{'type':Sequelize[_0x7397('0x4')]},'responsetime':{'type':Sequelize[_0x7397('0x4')]},'answertime':{'type':Sequelize[_0x7397('0x4')]},'droptime':{'type':Sequelize[_0x7397('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7397('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7397('0x3')]},'reason':{'type':Sequelize[_0x7397('0x3')]},'amd':{'type':Sequelize[_0x7397('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7397('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x7397('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7397('0x4')]},'recallme':{'type':Sequelize[_0x7397('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7397('0x4')]},'edited':{'type':Sequelize[_0x7397('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfffa=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2f7901,_0x23d79a){var _0x27a10b=function(_0x151a2e){while(--_0x151a2e){_0x2f7901['push'](_0x2f7901['shift']());}};_0x27a10b(++_0x23d79a);}(_0xfffa,0x19f));var _0xafff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfffa[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xafff('0x0'));module[_0xafff('0x1')]={'state':{'type':Sequelize[_0xafff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xafff('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xafff('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xafff('0x3')]},'starttime':{'type':Sequelize[_0xafff('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xafff('0x4')]},'droptime':{'type':Sequelize[_0xafff('0x4')]},'endtime':{'type':Sequelize[_0xafff('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xafff('0x3')]},'campaign':{'type':Sequelize[_0xafff('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xafff('0x3')]},'reason':{'type':Sequelize[_0xafff('0x3')]},'amd':{'type':Sequelize[_0xafff('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xafff('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xafff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xafff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xafff('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xafff('0x4')]},'edited':{'type':Sequelize[_0xafff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xafff('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f8b7651..22c59ac 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab78=['name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperHistory','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0xab78,0x10f));var _0x8ab7=function(_0x5cf09e,_0x266304){_0x5cf09e=_0x5cf09e-0x0;var _0x8d326e=_0xab78[_0x5cf09e];return _0x8d326e;};'use strict';var emlformat=require(_0x8ab7('0x0'));var rimraf=require(_0x8ab7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ab7('0x2'));var moment=require(_0x8ab7('0x3'));var BPromise=require(_0x8ab7('0x4'));var Mustache=require(_0x8ab7('0x5'));var util=require(_0x8ab7('0x6'));var path=require(_0x8ab7('0x7'));var sox=require('sox');var csv=require(_0x8ab7('0x8'));var ejs=require(_0x8ab7('0x9'));var fs=require('fs');var fs_extra=require(_0x8ab7('0xa'));var _=require(_0x8ab7('0xb'));var squel=require('squel');var crypto=require(_0x8ab7('0xc'));var jsforce=require(_0x8ab7('0xd'));var deskjs=require(_0x8ab7('0xe'));var toCsv=require(_0x8ab7('0x8'));var querystring=require(_0x8ab7('0xf'));var Papa=require(_0x8ab7('0x10'));var Redis=require(_0x8ab7('0x11'));var authService=require(_0x8ab7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ab7('0x13'));var hardwareService=require(_0x8ab7('0x14'));var logger=require(_0x8ab7('0x15'))(_0x8ab7('0x16'));var utils=require(_0x8ab7('0x17'));var config=require(_0x8ab7('0x18'));var licenseUtil=require(_0x8ab7('0x19'));var db=require(_0x8ab7('0x1a'))['db'];function respondWithStatusCode(_0x2716e5,_0x5c27c9){_0x5c27c9=_0x5c27c9||0xcc;return function(_0x380be5){if(_0x380be5){return _0x2716e5[_0x8ab7('0x1b')](_0x5c27c9);}return _0x2716e5[_0x8ab7('0x1c')](_0x5c27c9)[_0x8ab7('0x1d')]();};}function respondWithResult(_0x2ea6e3,_0x4dad15){_0x4dad15=_0x4dad15||0xc8;return function(_0x588215){if(_0x588215){return _0x2ea6e3[_0x8ab7('0x1c')](_0x4dad15)[_0x8ab7('0x1e')](_0x588215);}};}function respondWithFilteredResult(_0x2ca7aa,_0x5086d3){return function(_0x201ce9){if(_0x201ce9){var _0xdad3dd=typeof _0x5086d3['offset']===_0x8ab7('0x1f')&&typeof _0x5086d3[_0x8ab7('0x20')]===_0x8ab7('0x1f');var _0x4c5bca=_0x201ce9[_0x8ab7('0x21')];var _0x520315=_0xdad3dd?0x0:_0x5086d3[_0x8ab7('0x22')];var _0x194aaa=_0xdad3dd?_0x201ce9[_0x8ab7('0x21')]:_0x5086d3[_0x8ab7('0x22')]+_0x5086d3[_0x8ab7('0x20')];var _0x2bdd77;if(_0x194aaa>=_0x4c5bca){_0x194aaa=_0x4c5bca;_0x2bdd77=0xc8;}else{_0x2bdd77=0xce;}_0x2ca7aa[_0x8ab7('0x1c')](_0x2bdd77);return _0x2ca7aa[_0x8ab7('0x23')](_0x8ab7('0x24'),_0x520315+'-'+_0x194aaa+'/'+_0x4c5bca)[_0x8ab7('0x1e')](_0x201ce9);}return null;};}function patchUpdates(_0x5df9a7){return function(_0x491204){try{jsonpatch[_0x8ab7('0x25')](_0x491204,_0x5df9a7,!![]);}catch(_0xa88ef1){return BPromise[_0x8ab7('0x26')](_0xa88ef1);}return _0x491204[_0x8ab7('0x27')]();};}function saveUpdates(_0x3f86b7,_0x81bcf1){return function(_0x51de0d){if(_0x51de0d){return _0x51de0d[_0x8ab7('0x28')](_0x3f86b7)[_0x8ab7('0x29')](function(_0x27aaee){return _0x27aaee;});}return null;};}function removeEntity(_0x14d114,_0x349339){return function(_0x43bc51){if(_0x43bc51){return _0x43bc51[_0x8ab7('0x2a')]()[_0x8ab7('0x29')](function(){_0x14d114[_0x8ab7('0x1c')](0xcc)[_0x8ab7('0x1d')]();});}};}function handleEntityNotFound(_0xd83c88,_0x550b33){return function(_0x2eebec){if(!_0x2eebec){_0xd83c88[_0x8ab7('0x1b')](0x194);}return _0x2eebec;};}function handleError(_0x2ebff,_0x35b46d){_0x35b46d=_0x35b46d||0x1f4;return function(_0x5a5593){logger[_0x8ab7('0x2b')](_0x5a5593[_0x8ab7('0x2c')]);if(_0x5a5593['name']){delete _0x5a5593[_0x8ab7('0x2d')];}_0x2ebff['status'](_0x35b46d)[_0x8ab7('0x2e')](_0x5a5593);};}exports[_0x8ab7('0x2f')]=function(_0x2db6b0,_0x310087){var _0x303318={},_0x25c287={},_0x253043={'count':0x0,'rows':[]};var _0x438464=_[_0x8ab7('0x30')](db['CmHopperHistory'][_0x8ab7('0x31')],function(_0x580e6c){return{'name':_0x580e6c[_0x8ab7('0x32')],'type':_0x580e6c[_0x8ab7('0x33')]['key']};});_0x25c287[_0x8ab7('0x34')]=_[_0x8ab7('0x30')](_0x438464,'name');_0x25c287[_0x8ab7('0x35')]=_[_0x8ab7('0x36')](_0x2db6b0[_0x8ab7('0x35')]);_0x25c287[_0x8ab7('0x37')]=_[_0x8ab7('0x38')](_0x25c287[_0x8ab7('0x34')],_0x25c287[_0x8ab7('0x35')]);_0x303318['attributes']=_[_0x8ab7('0x38')](_0x25c287['model'],qs[_0x8ab7('0x39')](_0x2db6b0[_0x8ab7('0x35')][_0x8ab7('0x39')]));_0x303318['attributes']=_0x303318[_0x8ab7('0x3a')]['length']?_0x303318['attributes']:_0x25c287[_0x8ab7('0x34')];if(!_0x2db6b0['query']['hasOwnProperty']('nolimit')){_0x303318[_0x8ab7('0x20')]=qs[_0x8ab7('0x20')](_0x2db6b0[_0x8ab7('0x35')][_0x8ab7('0x20')]);_0x303318['offset']=qs[_0x8ab7('0x22')](_0x2db6b0[_0x8ab7('0x35')][_0x8ab7('0x22')]);}_0x303318[_0x8ab7('0x3b')]=qs[_0x8ab7('0x3c')](_0x2db6b0[_0x8ab7('0x35')][_0x8ab7('0x3c')]);_0x303318[_0x8ab7('0x3d')]=qs[_0x8ab7('0x37')](_[_0x8ab7('0x3e')](_0x2db6b0[_0x8ab7('0x35')],_0x25c287[_0x8ab7('0x37')]),_0x438464);if(_0x2db6b0['query'][_0x8ab7('0x3f')]){_0x303318[_0x8ab7('0x3d')]=_['merge'](_0x303318[_0x8ab7('0x3d')],{'$or':_[_0x8ab7('0x30')](_0x438464,function(_0xf09f93){if(_0xf09f93[_0x8ab7('0x33')]!==_0x8ab7('0x40')){var _0x5e43d1={};_0x5e43d1[_0xf09f93['name']]={'$like':'%'+_0x2db6b0[_0x8ab7('0x35')][_0x8ab7('0x3f')]+'%'};return _0x5e43d1;}})});}_0x303318=_[_0x8ab7('0x41')]({},_0x303318,_0x2db6b0[_0x8ab7('0x42')]);var _0xe57037={'where':_0x303318[_0x8ab7('0x3d')]};return db[_0x8ab7('0x43')][_0x8ab7('0x21')](_0xe57037)[_0x8ab7('0x29')](function(_0x897e00){_0x253043[_0x8ab7('0x21')]=_0x897e00;if(_0x2db6b0[_0x8ab7('0x35')]['includeAll']){_0x303318[_0x8ab7('0x44')]=[{'all':!![]}];}return db[_0x8ab7('0x43')][_0x8ab7('0x45')](_0x303318);})['then'](function(_0x34dcf1){_0x253043[_0x8ab7('0x46')]=_0x34dcf1;return _0x253043;})[_0x8ab7('0x29')](respondWithFilteredResult(_0x310087,_0x303318))[_0x8ab7('0x47')](handleError(_0x310087,null));};exports[_0x8ab7('0x48')]=function(_0x2b92fe,_0x2af363){var _0x46abca={'raw':!![],'where':{'id':_0x2b92fe[_0x8ab7('0x49')]['id']}},_0x3ff347={};_0x3ff347[_0x8ab7('0x34')]=_['keys'](db['CmHopperHistory'][_0x8ab7('0x31')]);_0x3ff347['query']=_[_0x8ab7('0x36')](_0x2b92fe[_0x8ab7('0x35')]);_0x3ff347['filters']=_[_0x8ab7('0x38')](_0x3ff347[_0x8ab7('0x34')],_0x3ff347[_0x8ab7('0x35')]);_0x46abca[_0x8ab7('0x3a')]=_['intersection'](_0x3ff347[_0x8ab7('0x34')],qs[_0x8ab7('0x39')](_0x2b92fe[_0x8ab7('0x35')][_0x8ab7('0x39')]));_0x46abca[_0x8ab7('0x3a')]=_0x46abca[_0x8ab7('0x3a')]['length']?_0x46abca['attributes']:_0x3ff347[_0x8ab7('0x34')];if(_0x2b92fe[_0x8ab7('0x35')]['includeAll']){_0x46abca[_0x8ab7('0x44')]=[{'all':!![]}];}_0x46abca=_['merge']({},_0x46abca,_0x2b92fe[_0x8ab7('0x42')]);return db[_0x8ab7('0x43')]['find'](_0x46abca)['then'](handleEntityNotFound(_0x2af363,null))['then'](respondWithResult(_0x2af363,null))['catch'](handleError(_0x2af363,null));};exports['create']=function(_0x19cf31,_0x1f8509){return db[_0x8ab7('0x43')][_0x8ab7('0x4a')](_0x19cf31[_0x8ab7('0x4b')],{})[_0x8ab7('0x29')](respondWithResult(_0x1f8509,0xc9))[_0x8ab7('0x47')](handleError(_0x1f8509,null));};exports['describe']=function(_0x565b9c,_0x11703a){return db['CmHopperHistory'][_0x8ab7('0x4c')]()[_0x8ab7('0x29')](respondWithResult(_0x11703a,null))[_0x8ab7('0x47')](handleError(_0x11703a,null));};exports[_0x8ab7('0x28')]=function(_0x13773c,_0x3c4ea8){if(_0x13773c[_0x8ab7('0x4b')][_0x8ab7('0x4d')]){delete _0x13773c[_0x8ab7('0x4b')][_0x8ab7('0x4d')];}return db[_0x8ab7('0x43')][_0x8ab7('0x4e')]({'where':{'uniqueid':_0x13773c['params']['id']}})[_0x8ab7('0x29')](handleEntityNotFound(_0x3c4ea8,null))['then'](saveUpdates(_0x13773c[_0x8ab7('0x4b')],null))[_0x8ab7('0x29')](respondWithResult(_0x3c4ea8,null))[_0x8ab7('0x47')](handleError(_0x3c4ea8,null));}; \ No newline at end of file +var _0xd4b1=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x4d37ab,_0x40aaa3){var _0xdd63a2=function(_0x310baa){while(--_0x310baa){_0x4d37ab['push'](_0x4d37ab['shift']());}};_0xdd63a2(++_0x40aaa3);}(_0xd4b1,0x115));var _0x1d4b=function(_0x1b2ba3,_0x65dce0){_0x1b2ba3=_0x1b2ba3-0x0;var _0x17cf4e=_0xd4b1[_0x1b2ba3];return _0x17cf4e;};'use strict';var emlformat=require(_0x1d4b('0x0'));var rimraf=require(_0x1d4b('0x1'));var zipdir=require(_0x1d4b('0x2'));var jsonpatch=require(_0x1d4b('0x3'));var rp=require(_0x1d4b('0x4'));var moment=require(_0x1d4b('0x5'));var BPromise=require(_0x1d4b('0x6'));var Mustache=require(_0x1d4b('0x7'));var util=require('util');var path=require(_0x1d4b('0x8'));var sox=require('sox');var csv=require(_0x1d4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d4b('0xa'));var squel=require(_0x1d4b('0xb'));var crypto=require('crypto');var jsforce=require(_0x1d4b('0xc'));var deskjs=require(_0x1d4b('0xd'));var toCsv=require(_0x1d4b('0x9'));var querystring=require('querystring');var Papa=require(_0x1d4b('0xe'));var Redis=require(_0x1d4b('0xf'));var authService=require(_0x1d4b('0x10'));var qs=require(_0x1d4b('0x11'));var as=require(_0x1d4b('0x12'));var hardwareService=require(_0x1d4b('0x13'));var logger=require('../../config/logger')(_0x1d4b('0x14'));var utils=require(_0x1d4b('0x15'));var config=require(_0x1d4b('0x16'));var licenseUtil=require(_0x1d4b('0x17'));var db=require(_0x1d4b('0x18'))['db'];function respondWithStatusCode(_0xb80e11,_0x184c40){_0x184c40=_0x184c40||0xcc;return function(_0x5e17ab){if(_0x5e17ab){return _0xb80e11[_0x1d4b('0x19')](_0x184c40);}return _0xb80e11[_0x1d4b('0x1a')](_0x184c40)[_0x1d4b('0x1b')]();};}function respondWithResult(_0x48188c,_0x466a81){_0x466a81=_0x466a81||0xc8;return function(_0x3f0169){if(_0x3f0169){return _0x48188c[_0x1d4b('0x1a')](_0x466a81)['json'](_0x3f0169);}};}function respondWithFilteredResult(_0x47233d,_0x20f629){return function(_0x4a3c17){if(_0x4a3c17){var _0x3b7e59=typeof _0x20f629[_0x1d4b('0x1c')]===_0x1d4b('0x1d')&&typeof _0x20f629[_0x1d4b('0x1e')]===_0x1d4b('0x1d');var _0xa38d8b=_0x4a3c17[_0x1d4b('0x1f')];var _0x8fa7b3=_0x3b7e59?0x0:_0x20f629[_0x1d4b('0x1c')];var _0x451970=_0x3b7e59?_0x4a3c17['count']:_0x20f629['offset']+_0x20f629[_0x1d4b('0x1e')];var _0x5463e9;if(_0x451970>=_0xa38d8b){_0x451970=_0xa38d8b;_0x5463e9=0xc8;}else{_0x5463e9=0xce;}_0x47233d['status'](_0x5463e9);return _0x47233d['set'](_0x1d4b('0x20'),_0x8fa7b3+'-'+_0x451970+'/'+_0xa38d8b)[_0x1d4b('0x21')](_0x4a3c17);}return null;};}function patchUpdates(_0x1c80e4){return function(_0x5376ef){try{jsonpatch[_0x1d4b('0x22')](_0x5376ef,_0x1c80e4,!![]);}catch(_0x4e5957){return BPromise[_0x1d4b('0x23')](_0x4e5957);}return _0x5376ef[_0x1d4b('0x24')]();};}function saveUpdates(_0x3c290f,_0x1c3111){return function(_0x40c166){if(_0x40c166){return _0x40c166[_0x1d4b('0x25')](_0x3c290f)[_0x1d4b('0x26')](function(_0x2397bd){return _0x2397bd;});}return null;};}function removeEntity(_0x43cbb2,_0x2cf1bb){return function(_0x1b0ddf){if(_0x1b0ddf){return _0x1b0ddf['destroy']()[_0x1d4b('0x26')](function(){_0x43cbb2['status'](0xcc)[_0x1d4b('0x1b')]();});}};}function handleEntityNotFound(_0x39e35a,_0x5f139c){return function(_0x31004a){if(!_0x31004a){_0x39e35a[_0x1d4b('0x19')](0x194);}return _0x31004a;};}function handleError(_0xf093f6,_0x13c917){_0x13c917=_0x13c917||0x1f4;return function(_0x177ae6){logger[_0x1d4b('0x27')](_0x177ae6['stack']);if(_0x177ae6['name']){delete _0x177ae6[_0x1d4b('0x28')];}_0xf093f6[_0x1d4b('0x1a')](_0x13c917)[_0x1d4b('0x29')](_0x177ae6);};}exports[_0x1d4b('0x2a')]=function(_0x2a4f12,_0x546492){var _0x5b916c={},_0x2c1f4e={},_0x177395={'count':0x0,'rows':[]};var _0x4f894c=_[_0x1d4b('0x2b')](db[_0x1d4b('0x2c')][_0x1d4b('0x2d')],function(_0x2ed1bb){return{'name':_0x2ed1bb[_0x1d4b('0x2e')],'type':_0x2ed1bb[_0x1d4b('0x2f')]['key']};});_0x2c1f4e[_0x1d4b('0x30')]=_[_0x1d4b('0x2b')](_0x4f894c,_0x1d4b('0x28'));_0x2c1f4e[_0x1d4b('0x31')]=_[_0x1d4b('0x32')](_0x2a4f12[_0x1d4b('0x31')]);_0x2c1f4e['filters']=_['intersection'](_0x2c1f4e[_0x1d4b('0x30')],_0x2c1f4e[_0x1d4b('0x31')]);_0x5b916c[_0x1d4b('0x33')]=_[_0x1d4b('0x34')](_0x2c1f4e[_0x1d4b('0x30')],qs[_0x1d4b('0x35')](_0x2a4f12['query']['fields']));_0x5b916c[_0x1d4b('0x33')]=_0x5b916c[_0x1d4b('0x33')][_0x1d4b('0x36')]?_0x5b916c[_0x1d4b('0x33')]:_0x2c1f4e[_0x1d4b('0x30')];if(!_0x2a4f12['query']['hasOwnProperty'](_0x1d4b('0x37'))){_0x5b916c[_0x1d4b('0x1e')]=qs[_0x1d4b('0x1e')](_0x2a4f12[_0x1d4b('0x31')][_0x1d4b('0x1e')]);_0x5b916c['offset']=qs[_0x1d4b('0x1c')](_0x2a4f12[_0x1d4b('0x31')]['offset']);}_0x5b916c[_0x1d4b('0x38')]=qs[_0x1d4b('0x39')](_0x2a4f12[_0x1d4b('0x31')][_0x1d4b('0x39')]);_0x5b916c[_0x1d4b('0x3a')]=qs[_0x1d4b('0x3b')](_['pick'](_0x2a4f12[_0x1d4b('0x31')],_0x2c1f4e[_0x1d4b('0x3b')]),_0x4f894c);if(_0x2a4f12[_0x1d4b('0x31')][_0x1d4b('0x3c')]){_0x5b916c[_0x1d4b('0x3a')]=_['merge'](_0x5b916c[_0x1d4b('0x3a')],{'$or':_['map'](_0x4f894c,function(_0x5ccdc6){if(_0x5ccdc6[_0x1d4b('0x2f')]!==_0x1d4b('0x3d')){var _0x559da7={};_0x559da7[_0x5ccdc6[_0x1d4b('0x28')]]={'$like':'%'+_0x2a4f12['query'][_0x1d4b('0x3c')]+'%'};return _0x559da7;}})});}_0x5b916c=_[_0x1d4b('0x3e')]({},_0x5b916c,_0x2a4f12['options']);var _0x59bf3a={'where':_0x5b916c['where']};return db[_0x1d4b('0x2c')][_0x1d4b('0x1f')](_0x59bf3a)[_0x1d4b('0x26')](function(_0x86fcea){_0x177395[_0x1d4b('0x1f')]=_0x86fcea;if(_0x2a4f12['query'][_0x1d4b('0x3f')]){_0x5b916c[_0x1d4b('0x40')]=[{'all':!![]}];}return db[_0x1d4b('0x2c')][_0x1d4b('0x41')](_0x5b916c);})[_0x1d4b('0x26')](function(_0x160cdc){_0x177395['rows']=_0x160cdc;return _0x177395;})['then'](respondWithFilteredResult(_0x546492,_0x5b916c))['catch'](handleError(_0x546492,null));};exports[_0x1d4b('0x42')]=function(_0x91805e,_0x16e570){var _0x2af37d={'raw':!![],'where':{'id':_0x91805e[_0x1d4b('0x43')]['id']}},_0x1da0d6={};_0x1da0d6[_0x1d4b('0x30')]=_[_0x1d4b('0x32')](db['CmHopperHistory'][_0x1d4b('0x2d')]);_0x1da0d6[_0x1d4b('0x31')]=_['keys'](_0x91805e[_0x1d4b('0x31')]);_0x1da0d6['filters']=_[_0x1d4b('0x34')](_0x1da0d6[_0x1d4b('0x30')],_0x1da0d6[_0x1d4b('0x31')]);_0x2af37d[_0x1d4b('0x33')]=_[_0x1d4b('0x34')](_0x1da0d6[_0x1d4b('0x30')],qs[_0x1d4b('0x35')](_0x91805e[_0x1d4b('0x31')]['fields']));_0x2af37d[_0x1d4b('0x33')]=_0x2af37d[_0x1d4b('0x33')][_0x1d4b('0x36')]?_0x2af37d[_0x1d4b('0x33')]:_0x1da0d6['model'];if(_0x91805e[_0x1d4b('0x31')][_0x1d4b('0x3f')]){_0x2af37d[_0x1d4b('0x40')]=[{'all':!![]}];}_0x2af37d=_['merge']({},_0x2af37d,_0x91805e['options']);return db[_0x1d4b('0x2c')]['find'](_0x2af37d)[_0x1d4b('0x26')](handleEntityNotFound(_0x16e570,null))[_0x1d4b('0x26')](respondWithResult(_0x16e570,null))[_0x1d4b('0x44')](handleError(_0x16e570,null));};exports['create']=function(_0x250316,_0x8c26ea){return db[_0x1d4b('0x2c')][_0x1d4b('0x45')](_0x250316[_0x1d4b('0x46')],{})[_0x1d4b('0x26')](respondWithResult(_0x8c26ea,0xc9))[_0x1d4b('0x44')](handleError(_0x8c26ea,null));};exports['describe']=function(_0x34047f,_0x416fc7){return db[_0x1d4b('0x2c')][_0x1d4b('0x47')]()['then'](respondWithResult(_0x416fc7,null))['catch'](handleError(_0x416fc7,null));};exports[_0x1d4b('0x25')]=function(_0x32e755,_0x129672){if(_0x32e755[_0x1d4b('0x46')]['uniqueid']){delete _0x32e755[_0x1d4b('0x46')][_0x1d4b('0x48')];}return db[_0x1d4b('0x2c')]['find']({'where':{'uniqueid':_0x32e755['params']['id']}})[_0x1d4b('0x26')](handleEntityNotFound(_0x129672,null))[_0x1d4b('0x26')](saveUpdates(_0x32e755[_0x1d4b('0x46')],null))[_0x1d4b('0x26')](respondWithResult(_0x129672,null))[_0x1d4b('0x44')](handleError(_0x129672,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0b33304..edb1f62 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaebd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x1d919c,_0xe236d5){_0x1d919c=_0x1d919c-0x0;var _0x674661=_0xaebd[_0x1d919c];return _0x674661;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0xdaeb('0xc')]},{'name':_0xdaeb('0xd'),'fields':[_0xdaeb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9134=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','path'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x9134,0x87));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var logger=require(_0x4913('0x1'))(_0x4913('0x2'));var moment=require(_0x4913('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4913('0x4'));var rimraf=require(_0x4913('0x5'));var config=require(_0x4913('0x6'));var attributes=require(_0x4913('0x7'));module[_0x4913('0x8')]=function(_0x2ab455,_0x52f0cb){return _0x2ab455[_0x4913('0x9')](_0x4913('0xa'),attributes,{'tableName':_0x4913('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x4913('0xc')]},{'name':_0x4913('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d27b696..1a13fb4 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x692e=['literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','where','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','util','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','create','body','options','raw','debug','CmHopperHistory','findAll','sequelize','COUNT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x692e,0x6c));var _0xe692=function(_0x5e1e58,_0x5b5fcd){_0x5e1e58=_0x5e1e58-0x0;var _0x43cf56=_0x692e[_0x5e1e58];return _0x43cf56;};'use strict';var _=require('lodash');var util=require(_0xe692('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe692('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xe692('0x2'));var logger=require('../../config/logger')(_0xe692('0x3'));var config=require(_0xe692('0x4'));var jayson=require(_0xe692('0x5'));var client=jayson[_0xe692('0x6')][_0xe692('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x346020,_0x4dd902,_0x341b14){return new BPromise(function(_0x43a5ca,_0x3df493){return client[_0xe692('0x8')](_0x346020,_0x341b14)[_0xe692('0x9')](function(_0x8ada37){logger[_0xe692('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4dd902,'request\x20sent');logger['debug'](_0xe692('0xb'),_0x4dd902,_0xe692('0xc'),JSON[_0xe692('0xd')](_0x8ada37));if(_0x8ada37[_0xe692('0xe')]){if(_0x8ada37[_0xe692('0xe')][_0xe692('0xf')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4dd902,_0x8ada37[_0xe692('0xe')][_0xe692('0x10')]);return _0x3df493(_0x8ada37[_0xe692('0xe')]['message']);}logger[_0xe692('0xe')](_0xe692('0x11'),_0x4dd902,_0x8ada37['error'][_0xe692('0x10')]);return _0x43a5ca(_0x8ada37[_0xe692('0xe')][_0xe692('0x10')]);}else{logger[_0xe692('0xa')](_0xe692('0x11'),_0x4dd902,_0xe692('0xc'));_0x43a5ca(_0x8ada37[_0xe692('0x12')][_0xe692('0x10')]);}})[_0xe692('0x13')](function(_0x1328a4){logger[_0xe692('0xe')](_0xe692('0x11'),_0x4dd902,_0x1328a4);_0x3df493(_0x1328a4);});});}exports[_0xe692('0x14')]=function(_0x2ad3f5){var _0x5d87a8=this;return new Promise(function(_0x60ca67,_0x2187ef){return db['CmHopperHistory'][_0xe692('0x15')](_0x2ad3f5[_0xe692('0x16')],{'raw':_0x2ad3f5[_0xe692('0x17')]?_0x2ad3f5[_0xe692('0x17')][_0xe692('0x18')]===undefined?!![]:![]:!![]})[_0xe692('0x9')](function(_0x1b35af){logger[_0xe692('0xa')](_0xe692('0x14'),_0x2ad3f5);logger[_0xe692('0x19')](_0xe692('0x14'),_0x2ad3f5,JSON[_0xe692('0xd')](_0x1b35af));_0x60ca67(_0x1b35af);})[_0xe692('0x13')](function(_0x5f437e){logger[_0xe692('0xe')](_0xe692('0x14'),_0x5f437e[_0xe692('0x10')],_0x2ad3f5);_0x2187ef(_0x5d87a8[_0xe692('0xe')](0x1f4,_0x5f437e[_0xe692('0x10')]));});});};exports['AvgHandleTime']=function(_0x451597){var _0x3273cd=this;return new Promise(function(_0x6055d2,_0x540f9a){return db[_0xe692('0x1a')][_0xe692('0x1b')]({'raw':_0x451597[_0xe692('0x17')]?_0x451597[_0xe692('0x17')][_0xe692('0x18')]===undefined?!![]:![]:!![],'where':_0x451597[_0xe692('0x17')]?_0x451597[_0xe692('0x17')]['where']||null:null,'attributes':[[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x1f')))),_0xe692('0x20')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xe692('0x1e')](_0xe692('0x21')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe692('0x1c')]['fn'](_0xe692('0x22'),db[_0xe692('0x1c')]['fn']('IF',db['sequelize'][_0xe692('0x1e')](_0xe692('0x23')))),_0xe692('0x24')],[db['sequelize']['fn'](_0xe692('0x22'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x25')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x1169c9){logger['info']('AvgHandleTime',_0x451597);logger[_0xe692('0x19')](_0xe692('0x26'),_0x451597,JSON[_0xe692('0xd')](_0x1169c9));_0x6055d2(_0x1169c9);})[_0xe692('0x13')](function(_0xef3a57){logger[_0xe692('0xe')](_0xe692('0x26'),_0xef3a57[_0xe692('0x10')],_0x451597);_0x540f9a(_0x3273cd[_0xe692('0xe')](0x1f4,_0xef3a57[_0xe692('0x10')]));});});};exports[_0xe692('0x27')]=function(_0x583e5d){var _0x5e071c=this;return new Promise(function(_0x23d62d,_0x54d86c){return db['CmHopperHistory'][_0xe692('0x1b')]({'raw':_0x583e5d['options']?_0x583e5d[_0xe692('0x17')][_0xe692('0x18')]===undefined?!![]:![]:!![],'where':_0x583e5d[_0xe692('0x17')]?_0x583e5d[_0xe692('0x17')][_0xe692('0x28')]||null:null,'attributes':[['campaign',_0xe692('0x29')],[db['sequelize']['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')]['literal'](_0xe692('0x2a')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe692('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0xe692('0x2b')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db['sequelize'][_0xe692('0x1e')](_0xe692('0x2c')))),_0xe692('0x2d')],[db[_0xe692('0x1c')]['fn']('COUNT',db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x2e')))),'outboundBusyCallsDay'],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x2f')))),_0xe692('0x30')],[db['sequelize']['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x31')))),_0xe692('0x32')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xe692('0x1e')](_0xe692('0x33')))),_0xe692('0x34')],[db[_0xe692('0x1c')]['fn']('COUNT',db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x35')))),'outboundUnknownCallsDay'],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db['sequelize'][_0xe692('0x1e')](_0xe692('0x36')))),_0xe692('0x37')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x38')))),_0xe692('0x39')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')]['literal'](_0xe692('0x3a')))),_0xe692('0x3b')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db['sequelize']['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x3c')))),_0xe692('0x3d')],[db['sequelize']['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')]['literal'](_0xe692('0x3e')))),_0xe692('0x3f')]],'group':[_0xe692('0x40')]})[_0xe692('0x9')](function(_0x499251){logger[_0xe692('0xa')](_0xe692('0x27'),_0x583e5d);logger[_0xe692('0x19')](_0xe692('0x27'),_0x583e5d,JSON[_0xe692('0xd')](_0x499251));_0x23d62d(_0x499251);})[_0xe692('0x13')](function(_0x3290e6){logger[_0xe692('0xe')](_0xe692('0x27'),_0x3290e6['message'],_0x583e5d);_0x54d86c(_0x5e071c[_0xe692('0xe')](0x1f4,_0x3290e6['message']));});});};exports['GetCampaignHopperHistory']=function(_0x23ff95){var _0x5a3116=this;return new Promise(function(_0x1a61e6,_0x40d21c){return db[_0xe692('0x1a')][_0xe692('0x1b')]({'raw':_0x23ff95[_0xe692('0x17')]?_0x23ff95[_0xe692('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x23ff95[_0xe692('0x17')]?_0x23ff95[_0xe692('0x17')][_0xe692('0x28')]||null:null,'attributes':[[_0xe692('0x40'),_0xe692('0x29')],[db['sequelize']['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')][_0xe692('0x41')]('id')),_0xe692('0x42')],[db[_0xe692('0x1c')]['fn'](_0xe692('0x1d'),db[_0xe692('0x1c')]['fn']('IF',db[_0xe692('0x1c')][_0xe692('0x1e')](_0xe692('0x2c')))),_0xe692('0x43')]],'group':[_0xe692('0x40')]})[_0xe692('0x9')](function(_0x81d8f1){logger[_0xe692('0xa')](_0xe692('0x44'),_0x23ff95);logger[_0xe692('0x19')](_0xe692('0x44'),_0x23ff95,JSON['stringify'](_0x81d8f1));_0x1a61e6(_0x81d8f1);})['catch'](function(_0x2c1c29){logger[_0xe692('0xe')](_0xe692('0x44'),_0x2c1c29['message'],_0x23ff95);_0x40d21c(_0x5a3116[_0xe692('0xe')](0x1f4,_0x2c1c29[_0xe692('0x10')]));});});}; \ No newline at end of file +var _0xb43b=['`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','then','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG'];(function(_0x38e6bc,_0x831f3a){var _0x21ac83=function(_0x2c3cee){while(--_0x2c3cee){_0x38e6bc['push'](_0x38e6bc['shift']());}};_0x21ac83(++_0x831f3a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x467179,_0x5cf1e2){_0x467179=_0x467179-0x0;var _0x3fba37=_0xb43b[_0x467179];return _0x3fba37;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')](_0x2e3b43['body'],{'raw':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![]})[_0xbb43('0x1a')](function(_0x2bf2d4){logger['info'](_0xbb43('0x15'),_0x2e3b43);logger['debug'](_0xbb43('0x15'),_0x2e3b43,JSON['stringify'](_0x2bf2d4));_0x1c16d7(_0x2bf2d4);})[_0xbb43('0x14')](function(_0x565256){logger[_0xbb43('0x10')](_0xbb43('0x15'),_0x565256['message'],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x565256['message']));});});};exports[_0xbb43('0x1b')]=function(_0x298ce2){var _0x16384e=this;return new Promise(function(_0x4d6d77,_0x53f0d5){return db['CmHopperHistory'][_0xbb43('0x1c')]({'raw':_0x298ce2[_0xbb43('0x18')]?_0x298ce2['options'][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x298ce2[_0xbb43('0x18')]?_0x298ce2[_0xbb43('0x18')][_0xbb43('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xbb43('0x1e')][_0xbb43('0x1f')]('id')),_0xbb43('0x20')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xbb43('0x23')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xbb43('0x24')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x25')))),_0xbb43('0x26')],[db[_0xbb43('0x1e')]['fn']('AVG',db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x27')))),_0xbb43('0x28')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x29'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x2a')))),_0xbb43('0x2b')]]})[_0xbb43('0x1a')](function(_0x4015ec){logger[_0xbb43('0xb')](_0xbb43('0x1b'),_0x298ce2);logger[_0xbb43('0xd')](_0xbb43('0x1b'),_0x298ce2,JSON[_0xbb43('0xf')](_0x4015ec));_0x4d6d77(_0x4015ec);})[_0xbb43('0x14')](function(_0x18debb){logger[_0xbb43('0x10')](_0xbb43('0x1b'),_0x18debb[_0xbb43('0x12')],_0x298ce2);_0x53f0d5(_0x16384e[_0xbb43('0x10')](0x1f4,_0x18debb['message']));});});};exports[_0xbb43('0x2c')]=function(_0x2d2056){var _0x52a694=this;return new Promise(function(_0x285014,_0x2c9a7c){return db[_0xbb43('0x16')]['findAll']({'raw':_0x2d2056['options']?_0x2d2056['options'][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x2d2056[_0xbb43('0x18')]?_0x2d2056['options']['where']||null:null,'attributes':[[_0xbb43('0x2d'),_0xbb43('0x2e')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x2f')))),_0xbb43('0x30')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x31')))),_0xbb43('0x32')],[db['sequelize']['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x33')))),_0xbb43('0x34')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0xbb43('0x35')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x208,\x201,\x20null'))),_0xbb43('0x36')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbb43('0x37')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x38')))),_0xbb43('0x39')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbb43('0x3a')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x3b')))),_0xbb43('0x3c')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0xbb43('0x3d')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x3e')))),_0xbb43('0x3f')],[db[_0xbb43('0x1e')]['fn']('COUNT',db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbb43('0x3d')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xbb43('0x40')]],'group':['campaign']})[_0xbb43('0x1a')](function(_0xe0cdba){logger['info'](_0xbb43('0x2c'),_0x2d2056);logger[_0xbb43('0xd')](_0xbb43('0x2c'),_0x2d2056,JSON[_0xbb43('0xf')](_0xe0cdba));_0x285014(_0xe0cdba);})[_0xbb43('0x14')](function(_0x5cb3c6){logger[_0xbb43('0x10')]('GetVoiceQueueHopperHistory',_0x5cb3c6['message'],_0x2d2056);_0x2c9a7c(_0x52a694[_0xbb43('0x10')](0x1f4,_0x5cb3c6[_0xbb43('0x12')]));});});};exports[_0xbb43('0x41')]=function(_0x474cee){var _0x129ee6=this;return new Promise(function(_0x5db053,_0x53a525){return db[_0xbb43('0x16')][_0xbb43('0x1c')]({'raw':_0x474cee[_0xbb43('0x18')]?_0x474cee[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x474cee[_0xbb43('0x18')]?_0x474cee[_0xbb43('0x18')][_0xbb43('0x1d')]||null:null,'attributes':[[_0xbb43('0x2d'),'name'],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')][_0xbb43('0x1f')]('id')),_0xbb43('0x42')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xbb43('0x43')]],'group':[_0xbb43('0x2d')]})[_0xbb43('0x1a')](function(_0x3d4692){logger[_0xbb43('0xb')](_0xbb43('0x41'),_0x474cee);logger[_0xbb43('0xd')]('GetCampaignHopperHistory',_0x474cee,JSON[_0xbb43('0xf')](_0x3d4692));_0x5db053(_0x3d4692);})['catch'](function(_0x5a6ff0){logger[_0xbb43('0x10')](_0xbb43('0x41'),_0x5a6ff0[_0xbb43('0x12')],_0x474cee);_0x53a525(_0x129ee6[_0xbb43('0x10')](0x1f4,_0x5a6ff0[_0xbb43('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 811cade..23c0f75 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x005f=['/:id','show','post','isAuthenticated','create','put','update','exports','multer','connect-timeout','express','Router','../../config/environment','./cmHopperHistory.controller','get','describe'];(function(_0x593a33,_0x64bc56){var _0x11672d=function(_0x3e135c){while(--_0x3e135c){_0x593a33['push'](_0x593a33['shift']());}};_0x11672d(++_0x64bc56);}(_0x005f,0x178));var _0xf005=function(_0x1b9f2b,_0x9de504){_0x1b9f2b=_0x1b9f2b-0x0;var _0x211a3=_0x005f[_0x1b9f2b];return _0x211a3;};'use strict';var multer=require(_0xf005('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf005('0x1'));var express=require(_0xf005('0x2'));var router=express[_0xf005('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf005('0x4'));var controller=require(_0xf005('0x5'));router[_0xf005('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf005('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xf005('0x7')]);router[_0xf005('0x6')](_0xf005('0x8'),auth['isAuthenticated'](),controller[_0xf005('0x9')]);router[_0xf005('0xa')]('/',auth[_0xf005('0xb')](),controller[_0xf005('0xc')]);router[_0xf005('0xd')](_0xf005('0x8'),auth[_0xf005('0xb')](),controller[_0xf005('0xe')]);module[_0xf005('0xf')]=router; \ No newline at end of file +var _0xec04=['exports','multer','path','../../components/auth/service','./cmHopperHistory.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update'];(function(_0x43dfdf,_0x8a598f){var _0xa2a071=function(_0x55dd54){while(--_0x55dd54){_0x43dfdf['push'](_0x43dfdf['shift']());}};_0xa2a071(++_0x8a598f);}(_0xec04,0x178));var _0x4ec0=function(_0x7f9fb4,_0x33f740){_0x7f9fb4=_0x7f9fb4-0x0;var _0x3c9dbf=_0xec04[_0x7f9fb4];return _0x3c9dbf;};'use strict';var multer=require(_0x4ec0('0x0'));var util=require('util');var path=require(_0x4ec0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ec0('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ec0('0x3'));router['get']('/',auth[_0x4ec0('0x4')](),controller[_0x4ec0('0x5')]);router['get'](_0x4ec0('0x6'),auth[_0x4ec0('0x4')](),controller['describe']);router[_0x4ec0('0x7')](_0x4ec0('0x8'),auth['isAuthenticated'](),controller[_0x4ec0('0x9')]);router[_0x4ec0('0xa')]('/',auth['isAuthenticated'](),controller[_0x4ec0('0xb')]);router[_0x4ec0('0xc')](_0x4ec0('0x8'),auth['isAuthenticated'](),controller[_0x4ec0('0xd')]);module[_0x4ec0('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index efd89f4..7b068a5 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf767=['name','exports','STRING'];(function(_0x5f04bd,_0x9d3b6b){var _0x1e12b3=function(_0x321633){while(--_0x321633){_0x5f04bd['push'](_0x5f04bd['shift']());}};_0x1e12b3(++_0x9d3b6b);}(_0xf767,0x76));var _0x7f76=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xf767[_0x1e4f2d];return _0xd05ce5;};'use strict';var Sequelize=require('sequelize');module[_0x7f76('0x0')]={'name':{'type':Sequelize[_0x7f76('0x1')],'unique':_0x7f76('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7f76('0x1')]},'dialPrefix':{'type':Sequelize[_0x7f76('0x1')]}}; \ No newline at end of file +var _0x56e7=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56e7,0x7b));var _0x756e=function(_0x432295,_0x3de054){_0x432295=_0x432295-0x0;var _0x5a44e0=_0x56e7[_0x432295];return _0x5a44e0;};'use strict';var Sequelize=require('sequelize');module[_0x756e('0x0')]={'name':{'type':Sequelize[_0x756e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x756e('0x1')]},'dialPrefix':{'type':Sequelize[_0x756e('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 9515177..f53dd56 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4af=['text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','get','Lists','UserProfileResource','then','error','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','CmList','findAll','catch','show','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','find','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','filter','rows','removeDispositions','ids','addContacts','tags','join','isArray','push','each','CmContact','success','dataValues','message','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','cf_%d','getContacts','getContactsCsv','format','raw','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv'];(function(_0xf45a6c,_0x1281cc){var _0x221625=function(_0x8e91f8){while(--_0x8e91f8){_0xf45a6c['push'](_0xf45a6c['shift']());}};_0x221625(++_0x1281cc);}(_0xe4af,0xa9));var _0xfe4a=function(_0x56eaca,_0x3fb153){_0x56eaca=_0x56eaca-0x0;var _0x57fec0=_0xe4af[_0x56eaca];return _0x57fec0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfe4a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe4a('0x1'));var Mustache=require(_0xfe4a('0x2'));var util=require(_0xfe4a('0x3'));var path=require('path');var sox=require(_0xfe4a('0x4'));var csv=require(_0xfe4a('0x5'));var ejs=require(_0xfe4a('0x6'));var fs=require('fs');var fs_extra=require(_0xfe4a('0x7'));var _=require('lodash');var squel=require(_0xfe4a('0x8'));var crypto=require(_0xfe4a('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe4a('0x5'));var querystring=require('querystring');var Papa=require(_0xfe4a('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfe4a('0xb'));var as=require(_0xfe4a('0xc'));var hardwareService=require(_0xfe4a('0xd'));var logger=require(_0xfe4a('0xe'))(_0xfe4a('0xf'));var utils=require(_0xfe4a('0x10'));var config=require(_0xfe4a('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe4a('0x12'))['db'];config[_0xfe4a('0x13')]=_[_0xfe4a('0x14')](config[_0xfe4a('0x13')],{'host':_0xfe4a('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe4a('0x13')]));require(_0xfe4a('0x16'))[_0xfe4a('0x17')](socket);function respondWithStatusCode(_0x1cae42,_0x2dee4f){_0x2dee4f=_0x2dee4f||0xcc;return function(_0x3ab7c8){if(_0x3ab7c8){return _0x1cae42[_0xfe4a('0x18')](_0x2dee4f);}return _0x1cae42[_0xfe4a('0x19')](_0x2dee4f)[_0xfe4a('0x1a')]();};}function respondWithResult(_0x349932,_0x2f1868){_0x2f1868=_0x2f1868||0xc8;return function(_0xbbddd1){if(_0xbbddd1){return _0x349932[_0xfe4a('0x19')](_0x2f1868)[_0xfe4a('0x1b')](_0xbbddd1);}};}function respondWithFilteredResult(_0x290414,_0x4d693c){return function(_0x4ba215){if(_0x4ba215){var _0xc6b124=typeof _0x4d693c[_0xfe4a('0x1c')]===_0xfe4a('0x1d')&&typeof _0x4d693c['limit']===_0xfe4a('0x1d');var _0x3ff538=_0x4ba215[_0xfe4a('0x1e')];var _0x4b8769=_0xc6b124?0x0:_0x4d693c[_0xfe4a('0x1c')];var _0x6585f0=_0xc6b124?_0x4ba215['count']:_0x4d693c[_0xfe4a('0x1c')]+_0x4d693c[_0xfe4a('0x1f')];var _0x326f59;if(_0x6585f0>=_0x3ff538){_0x6585f0=_0x3ff538;_0x326f59=0xc8;}else{_0x326f59=0xce;}_0x290414[_0xfe4a('0x19')](_0x326f59);return _0x290414['set'](_0xfe4a('0x20'),_0x4b8769+'-'+_0x6585f0+'/'+_0x3ff538)['json'](_0x4ba215);}return null;};}function patchUpdates(_0x4060b1){return function(_0x39f314){try{jsonpatch[_0xfe4a('0x21')](_0x39f314,_0x4060b1,!![]);}catch(_0x27cc25){return BPromise[_0xfe4a('0x22')](_0x27cc25);}return _0x39f314['save']();};}function saveUpdates(_0x24ff03,_0x4f4c53){return function(_0x1b79e2){if(_0x1b79e2){return _0x1b79e2[_0xfe4a('0x23')](_0x24ff03)['then'](function(_0x482ab6){return _0x482ab6;});}return null;};}function removeEntity(_0x2c2c5a,_0x8f2a50){return function(_0x37d0b3){if(_0x37d0b3){return _0x37d0b3[_0xfe4a('0x24')]()['then'](function(){var _0x2566d5=_0x37d0b3[_0xfe4a('0x25')]({'plain':!![]});var _0x5ccb69=_0xfe4a('0x26');return db[_0xfe4a('0x27')][_0xfe4a('0x24')]({'where':{'type':_0x5ccb69,'resourceId':_0x2566d5['id']}})['then'](function(){return _0x37d0b3;});})[_0xfe4a('0x28')](function(){_0x2c2c5a[_0xfe4a('0x19')](0xcc)[_0xfe4a('0x1a')]();});}};}function handleEntityNotFound(_0x4fd024,_0x556720){return function(_0x43844d){if(!_0x43844d){_0x4fd024['sendStatus'](0x194);}return _0x43844d;};}function handleError(_0x2880d1,_0x5b6074){_0x5b6074=_0x5b6074||0x1f4;return function(_0x4eb58c){logger[_0xfe4a('0x29')](_0x4eb58c[_0xfe4a('0x2a')]);if(_0x4eb58c[_0xfe4a('0x2b')]){delete _0x4eb58c[_0xfe4a('0x2b')];}_0x2880d1[_0xfe4a('0x19')](_0x5b6074)[_0xfe4a('0x2c')](_0x4eb58c);};}exports[_0xfe4a('0x2d')]=function(_0x2c15b3,_0xba6a9d){var _0x5e32b4={},_0x4ee0cb={},_0x3be08c={'count':0x0,'rows':[]};var _0x25b013=_[_0xfe4a('0x2e')](db['CmList']['rawAttributes'],function(_0x31725c){return{'name':_0x31725c[_0xfe4a('0x2f')],'type':_0x31725c['type'][_0xfe4a('0x30')]};});_0x4ee0cb['model']=_[_0xfe4a('0x2e')](_0x25b013,_0xfe4a('0x2b'));_0x4ee0cb[_0xfe4a('0x31')]=_[_0xfe4a('0x32')](_0x2c15b3['query']);_0x4ee0cb[_0xfe4a('0x33')]=_[_0xfe4a('0x34')](_0x4ee0cb[_0xfe4a('0x35')],_0x4ee0cb[_0xfe4a('0x31')]);_0x5e32b4[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x4ee0cb[_0xfe4a('0x35')],qs['fields'](_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x37')]));_0x5e32b4['attributes']=_0x5e32b4['attributes']['length']?_0x5e32b4[_0xfe4a('0x36')]:_0x4ee0cb['model'];if(!_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x38')]('nolimit')){_0x5e32b4[_0xfe4a('0x1f')]=qs[_0xfe4a('0x1f')](_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x1f')]);_0x5e32b4[_0xfe4a('0x1c')]=qs['offset'](_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x1c')]);}_0x5e32b4[_0xfe4a('0x39')]=qs[_0xfe4a('0x3a')](_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x3a')]);_0x5e32b4[_0xfe4a('0x3b')]=qs[_0xfe4a('0x33')](_[_0xfe4a('0x3c')](_0x2c15b3[_0xfe4a('0x31')],_0x4ee0cb[_0xfe4a('0x33')]),_0x25b013);if(_0x2c15b3['query']['filter']){_0x5e32b4[_0xfe4a('0x3b')]=_[_0xfe4a('0x3d')](_0x5e32b4[_0xfe4a('0x3b')],{'$or':_[_0xfe4a('0x2e')](_0x25b013,function(_0x23bfbc){if(_0x23bfbc[_0xfe4a('0x3e')]!==_0xfe4a('0x3f')){var _0x3aa496={};_0x3aa496[_0x23bfbc[_0xfe4a('0x2b')]]={'$like':'%'+_0x2c15b3['query']['filter']+'%'};return _0x3aa496;}})});}_0x5e32b4=_['merge']({},_0x5e32b4,_0x2c15b3[_0xfe4a('0x40')]);var _0x5e6b05={'where':_0x5e32b4[_0xfe4a('0x3b')]};return db['CmList']['count'](_0x5e6b05)[_0xfe4a('0x28')](function(_0x4b4d36){_0x3be08c[_0xfe4a('0x1e')]=_0x4b4d36;if(_0x2c15b3[_0xfe4a('0x31')][_0xfe4a('0x41')]){_0x5e32b4[_0xfe4a('0x42')]=[{'all':!![]}];}return db[_0xfe4a('0x43')][_0xfe4a('0x44')](_0x5e32b4);})[_0xfe4a('0x28')](function(_0x4dec33){_0x3be08c['rows']=_0x4dec33;return _0x3be08c;})['then'](respondWithFilteredResult(_0xba6a9d,_0x5e32b4))[_0xfe4a('0x45')](handleError(_0xba6a9d,null));};exports[_0xfe4a('0x46')]=function(_0x48df8b,_0x32cab0){var _0x2c7e0c={'raw':![],'where':{'id':_0x48df8b[_0xfe4a('0x47')]['id']}},_0x335e03={};_0x335e03[_0xfe4a('0x35')]=_[_0xfe4a('0x32')](db[_0xfe4a('0x43')][_0xfe4a('0x48')]);_0x335e03[_0xfe4a('0x31')]=_[_0xfe4a('0x32')](_0x48df8b[_0xfe4a('0x31')]);_0x335e03['filters']=_[_0xfe4a('0x34')](_0x335e03['model'],_0x335e03[_0xfe4a('0x31')]);_0x2c7e0c[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x335e03[_0xfe4a('0x35')],qs[_0xfe4a('0x37')](_0x48df8b[_0xfe4a('0x31')][_0xfe4a('0x37')]));_0x2c7e0c['attributes']=_0x2c7e0c[_0xfe4a('0x36')][_0xfe4a('0x49')]?_0x2c7e0c[_0xfe4a('0x36')]:_0x335e03['model'];if(_0x48df8b['query']['includeAll']){_0x2c7e0c[_0xfe4a('0x42')]=[{'all':!![]}];}_0x2c7e0c=_['merge']({},_0x2c7e0c,_0x48df8b['options']);return db[_0xfe4a('0x43')]['find'](_0x2c7e0c)['then'](handleEntityNotFound(_0x32cab0,null))[_0xfe4a('0x28')](respondWithResult(_0x32cab0,null))[_0xfe4a('0x45')](handleError(_0x32cab0,null));};exports[_0xfe4a('0x4a')]=function(_0x459777,_0x2dfaca){return db[_0xfe4a('0x43')][_0xfe4a('0x4a')](_0x459777[_0xfe4a('0x4b')],{})[_0xfe4a('0x28')](function(_0x12098c){var _0x4d3325=_0x459777[_0xfe4a('0x4c')][_0xfe4a('0x25')]({'plain':!![]});if(!_0x4d3325)throw new Error(_0xfe4a('0x4d'));if(_0x4d3325[_0xfe4a('0x4e')]===_0xfe4a('0x4c')){var _0x246786=_0x12098c['get']({'plain':!![]});var _0x18201b=_0xfe4a('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x18201b,'userProfileId':_0x4d3325['userProfileId']},'raw':!![]})[_0xfe4a('0x28')](function(_0x5cddd7){if(_0x5cddd7&&_0x5cddd7[_0xfe4a('0x4f')]===0x0){return db[_0xfe4a('0x27')][_0xfe4a('0x4a')]({'name':_0x246786[_0xfe4a('0x2b')],'resourceId':_0x246786['id'],'type':_0x5cddd7['name'],'sectionId':_0x5cddd7['id']},{})[_0xfe4a('0x28')](function(){return _0x12098c;});}else{return _0x12098c;}})['catch'](function(_0x5ef34d){logger[_0xfe4a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ef34d);throw _0x5ef34d;});}return _0x12098c;})[_0xfe4a('0x28')](respondWithResult(_0x2dfaca,0xc9))[_0xfe4a('0x45')](handleError(_0x2dfaca,null));};exports[_0xfe4a('0x23')]=function(_0x17b6c0,_0x29f22c){if(_0x17b6c0[_0xfe4a('0x4b')]['id']){delete _0x17b6c0[_0xfe4a('0x4b')]['id'];}return db[_0xfe4a('0x43')]['find']({'where':{'id':_0x17b6c0[_0xfe4a('0x47')]['id']}})['then'](handleEntityNotFound(_0x29f22c,null))[_0xfe4a('0x28')](saveUpdates(_0x17b6c0[_0xfe4a('0x4b')],null))[_0xfe4a('0x28')](respondWithResult(_0x29f22c,null))['catch'](handleError(_0x29f22c,null));};exports['destroy']=function(_0x4cff35,_0x16583a){return db[_0xfe4a('0x43')][_0xfe4a('0x50')]({'where':{'id':_0x4cff35['params']['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x16583a,null))[_0xfe4a('0x28')](removeEntity(_0x16583a,null))[_0xfe4a('0x45')](handleError(_0x16583a,null));};exports[_0xfe4a('0x51')]=function(_0x3318ee,_0x3e7208){return db[_0xfe4a('0x43')][_0xfe4a('0x51')]()[_0xfe4a('0x28')](respondWithResult(_0x3e7208,null))['catch'](handleError(_0x3e7208,null));};exports[_0xfe4a('0x52')]=function(_0x40aefd,_0x13042e,_0x1a1a65){if(_0x40aefd[_0xfe4a('0x4b')]['id']){delete _0x40aefd[_0xfe4a('0x4b')]['id'];}return db[_0xfe4a('0x43')][_0xfe4a('0x50')]({'where':{'id':_0x40aefd[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x13042e,null))[_0xfe4a('0x28')](function(_0x5c789d){if(_0x5c789d){_0x40aefd['body'][_0xfe4a('0x53')]=_0x5c789d['id'];return db[_0xfe4a('0x54')]['create'](_0x40aefd[_0xfe4a('0x4b')]);}})['then'](respondWithResult(_0x13042e,null))[_0xfe4a('0x45')](handleError(_0x13042e,null));};exports[_0xfe4a('0x55')]=function(_0x33babd,_0x542383,_0x37d476){var _0x5cdb93={'raw':![],'where':{}};var _0x178880={};var _0x28ef14={'count':0x0,'rows':[]};return db[_0xfe4a('0x43')][_0xfe4a('0x56')]({'where':{'id':_0x33babd[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x542383,null))[_0xfe4a('0x28')](function(_0x207067){if(_0x207067){_0x178880[_0xfe4a('0x35')]=_[_0xfe4a('0x32')](db[_0xfe4a('0x54')]['rawAttributes']);_0x178880[_0xfe4a('0x31')]=_[_0xfe4a('0x32')](_0x33babd[_0xfe4a('0x31')]);_0x178880['filters']=_[_0xfe4a('0x34')](_0x178880['model'],_0x178880[_0xfe4a('0x31')]);_0x5cdb93[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x178880[_0xfe4a('0x35')],qs[_0xfe4a('0x37')](_0x33babd['query']['fields']));_0x5cdb93[_0xfe4a('0x36')]=_0x5cdb93[_0xfe4a('0x36')]['length']?_0x5cdb93['attributes']:_0x178880[_0xfe4a('0x35')];if(!_0x33babd[_0xfe4a('0x31')][_0xfe4a('0x38')](_0xfe4a('0x57'))){_0x5cdb93[_0xfe4a('0x1f')]=qs[_0xfe4a('0x1f')](_0x33babd[_0xfe4a('0x31')]['limit']);_0x5cdb93[_0xfe4a('0x1c')]=qs['offset'](_0x33babd[_0xfe4a('0x31')][_0xfe4a('0x1c')]);}_0x5cdb93[_0xfe4a('0x39')]=qs['sort'](_0x33babd['query'][_0xfe4a('0x3a')]);_0x5cdb93['where']=qs[_0xfe4a('0x33')](_['pick'](_0x33babd['query'],_0x178880[_0xfe4a('0x33')]));_0x5cdb93[_0xfe4a('0x3b')][_0xfe4a('0x53')]=_0x207067['id'];if(_0x33babd[_0xfe4a('0x31')][_0xfe4a('0x58')]){_0x5cdb93[_0xfe4a('0x3b')]=_[_0xfe4a('0x3d')](_0x5cdb93['where'],{'$or':_[_0xfe4a('0x2e')](_0x5cdb93[_0xfe4a('0x36')],function(_0x489a45){var _0x40dd45={};_0x40dd45[_0x489a45]={'$like':'%'+_0x33babd[_0xfe4a('0x31')][_0xfe4a('0x58')]+'%'};return _0x40dd45;})});}_0x5cdb93=_[_0xfe4a('0x3d')]({},_0x5cdb93,_0x33babd[_0xfe4a('0x40')]);return db[_0xfe4a('0x54')][_0xfe4a('0x1e')]({'where':_0x5cdb93[_0xfe4a('0x3b')]})[_0xfe4a('0x28')](function(_0x59ed0f){_0x28ef14[_0xfe4a('0x1e')]=_0x59ed0f;if(_0x33babd['query'][_0xfe4a('0x41')]){_0x5cdb93[_0xfe4a('0x42')]=[{'all':!![]}];}return db[_0xfe4a('0x54')]['findAll'](_0x5cdb93);})[_0xfe4a('0x28')](function(_0x21bad1){_0x28ef14[_0xfe4a('0x59')]=_0x21bad1;return _0x28ef14;});}})['then'](respondWithFilteredResult(_0x542383,_0x5cdb93))[_0xfe4a('0x45')](handleError(_0x542383,null));};exports[_0xfe4a('0x5a')]=function(_0x3b3356,_0x4fdbce,_0x47c90b){return db[_0xfe4a('0x43')]['find']({'where':{'id':_0x3b3356[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x4fdbce,null))[_0xfe4a('0x28')](function(_0x8f1716){if(_0x8f1716){return _0x8f1716[_0xfe4a('0x5a')](_0x3b3356[_0xfe4a('0x31')][_0xfe4a('0x5b')]);}})['then'](respondWithStatusCode(_0x4fdbce,null))[_0xfe4a('0x45')](handleError(_0x4fdbce,null));};exports[_0xfe4a('0x5c')]=function(_0x154486,_0x3dee22,_0x2e6131){return db[_0xfe4a('0x43')][_0xfe4a('0x50')]({'where':{'id':_0x154486[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x3dee22,null))['then'](function(_0x184073){if(_0x184073){var _0x125b5a=[];var _0x56fdcc={'success':[],'errors':[]};return db['CmContact'][_0xfe4a('0x51')]()[_0xfe4a('0x28')](function(_0xfe4388){if(_0x154486['body'][_0xfe4a('0x5d')]&&_['isArray'](_0x154486[_0xfe4a('0x4b')][_0xfe4a('0x5d')])){if(_0x154486['body']['tags'][_0xfe4a('0x49')]){_0x154486[_0xfe4a('0x4b')][_0xfe4a('0x5d')]=_0x154486[_0xfe4a('0x4b')]['tags'][_0xfe4a('0x5e')](';')+';';}else{_0x154486[_0xfe4a('0x4b')][_0xfe4a('0x5d')]=null;}}else{_0x154486[_0xfe4a('0x4b')][_0xfe4a('0x5d')]=null;}if(_0x154486['body']&&_[_0xfe4a('0x5f')](_0x154486[_0xfe4a('0x4b')])){for(var _0x40a408=0x0;_0x40a408<_0x154486[_0xfe4a('0x4b')][_0xfe4a('0x49')];_0x40a408+=0x1){_0x154486['body'][_0x40a408]['ListId']=_0x154486['params']['id'];_0x125b5a[_0xfe4a('0x60')](_0x154486[_0xfe4a('0x4b')][_0x40a408]);}return BPromise[_0xfe4a('0x61')](_0x125b5a,function(_0x4a7d46){return db[_0xfe4a('0x62')]['create'](_['omit'](_0x4a7d46,['ids','id'])||{},{'fields':_[_0xfe4a('0x32')](_0xfe4388),'raw':!![]})[_0xfe4a('0x28')](function(_0x89619f){_0x56fdcc[_0xfe4a('0x63')]['push'](_0x89619f[_0xfe4a('0x64')]);})[_0xfe4a('0x45')](function(_0x685e16){_0x56fdcc['errors'][_0xfe4a('0x60')]({'data':_0x4a7d46,'error':_0x685e16[_0xfe4a('0x65')]});});})[_0xfe4a('0x28')](function(_0x26e038){return _0x56fdcc;})[_0xfe4a('0x45')](function(_0x1b69af){return _0x1b69af;});}else{_0x3dee22[_0xfe4a('0x19')](0x190)['json']({'message':_0xfe4a('0x66')});}});}})[_0xfe4a('0x28')](respondWithResult(_0x3dee22,null))[_0xfe4a('0x45')](handleError(_0x3dee22,null));};exports['getContacts']=function(_0x3ce513,_0x416b4e,_0x451b0e){var _0xd192c9;return db['CmList'][_0xfe4a('0x50')]({'where':{'id':_0x3ce513[_0xfe4a('0x47')]['id']},'include':[{'model':db[_0xfe4a('0x67')],'as':'CustomFields'}]})[_0xfe4a('0x28')](handleEntityNotFound(_0x416b4e,null))[_0xfe4a('0x28')](function(_0x14eb0b){if(_0x14eb0b){_0xd192c9=_0x14eb0b;return db['CmContact'][_0xfe4a('0x48')];}})[_0xfe4a('0x28')](function(_0xefa5fa){if(_0xefa5fa){var _0x484100={};var _0x558375={};_0x558375[_0xfe4a('0x35')]=_[_0xfe4a('0x68')](_[_0xfe4a('0x32')](_0xefa5fa),_['map'](_0xd192c9[_0xfe4a('0x69')],function(_0x40ac4c){return util['format'](_0xfe4a('0x6a'),_0x40ac4c['id']);}));_0x558375['query']=_[_0xfe4a('0x32')](_0x3ce513[_0xfe4a('0x31')]);_0x558375[_0xfe4a('0x33')]=_[_0xfe4a('0x34')](_0x558375[_0xfe4a('0x35')],_0x558375[_0xfe4a('0x31')]);_0x484100[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x558375[_0xfe4a('0x35')],qs[_0xfe4a('0x37')](_0x3ce513[_0xfe4a('0x31')]['fields']));_0x484100[_0xfe4a('0x36')]=_0x484100[_0xfe4a('0x36')][_0xfe4a('0x49')]?_0x484100[_0xfe4a('0x36')]:_0x558375['model'];if(!_0x3ce513[_0xfe4a('0x31')][_0xfe4a('0x38')](_0xfe4a('0x57'))){_0x484100[_0xfe4a('0x1f')]=qs[_0xfe4a('0x1f')](_0x3ce513[_0xfe4a('0x31')]['limit']);_0x484100['offset']=qs[_0xfe4a('0x1c')](_0x3ce513['query']['offset']);}_0x484100[_0xfe4a('0x39')]=qs[_0xfe4a('0x3a')](_0x3ce513[_0xfe4a('0x31')][_0xfe4a('0x3a')]);_0x484100[_0xfe4a('0x3b')]=qs[_0xfe4a('0x33')](_[_0xfe4a('0x3c')](_0x3ce513[_0xfe4a('0x31')],_0x558375[_0xfe4a('0x33')]));_0x484100['raw']=!![];if(_0x3ce513[_0xfe4a('0x31')][_0xfe4a('0x58')]){_0x484100[_0xfe4a('0x3b')]=_[_0xfe4a('0x3d')](_0x484100[_0xfe4a('0x3b')],{'$or':_[_0xfe4a('0x2e')](_0x484100['attributes'],function(_0x5cf243){var _0x30f776={};_0x30f776[_0x5cf243]={'$like':'%'+_0x3ce513[_0xfe4a('0x31')][_0xfe4a('0x58')]+'%'};return _0x30f776;})});}_0x484100=_[_0xfe4a('0x3d')]({},_0x484100,_0x3ce513[_0xfe4a('0x40')]);return _0xd192c9[_0xfe4a('0x6b')](_0x484100);}})[_0xfe4a('0x28')](respondWithResult(_0x416b4e,null))[_0xfe4a('0x45')](handleError(_0x416b4e,null));};exports[_0xfe4a('0x6c')]=function(_0x50bd6e,_0x16b362,_0x53e696){var _0x566e45;return db['CmList'][_0xfe4a('0x50')]({'where':{'id':_0x50bd6e[_0xfe4a('0x47')]['id']},'include':[{'model':db[_0xfe4a('0x67')],'as':_0xfe4a('0x69')}]})[_0xfe4a('0x28')](handleEntityNotFound(_0x16b362,null))[_0xfe4a('0x28')](function(_0x19e3e3){if(_0x19e3e3){_0x566e45=_0x19e3e3;return db[_0xfe4a('0x62')][_0xfe4a('0x48')];}})[_0xfe4a('0x28')](function(_0x1865e4){if(_0x1865e4){var _0x4f0cb7={};var _0x2484af={};_0x2484af['model']=_['concat'](_[_0xfe4a('0x32')](_0x1865e4),_['map'](_0x566e45[_0xfe4a('0x69')],function(_0x52d2bb){return util[_0xfe4a('0x6d')](_0xfe4a('0x6a'),_0x52d2bb['id']);}));_0x2484af['query']=_[_0xfe4a('0x32')](_0x50bd6e[_0xfe4a('0x31')]);_0x2484af[_0xfe4a('0x33')]=_[_0xfe4a('0x34')](_0x2484af['model'],_0x2484af[_0xfe4a('0x31')]);_0x4f0cb7[_0xfe4a('0x36')]=_['intersection'](_0x2484af[_0xfe4a('0x35')],qs[_0xfe4a('0x37')](_0x50bd6e['query'][_0xfe4a('0x37')]));_0x4f0cb7[_0xfe4a('0x36')]=_0x4f0cb7[_0xfe4a('0x36')][_0xfe4a('0x49')]?_0x4f0cb7[_0xfe4a('0x36')]:_0x2484af[_0xfe4a('0x35')];if(!_0x50bd6e['query'][_0xfe4a('0x38')](_0xfe4a('0x57'))){_0x4f0cb7['limit']=qs['limit'](_0x50bd6e['query'][_0xfe4a('0x1f')]);_0x4f0cb7[_0xfe4a('0x1c')]=qs[_0xfe4a('0x1c')](_0x50bd6e[_0xfe4a('0x31')][_0xfe4a('0x1c')]);}_0x4f0cb7[_0xfe4a('0x39')]=qs[_0xfe4a('0x3a')](_0x50bd6e['query']['sort']);_0x4f0cb7[_0xfe4a('0x3b')]=qs['filters'](_[_0xfe4a('0x3c')](_0x50bd6e[_0xfe4a('0x31')],_0x2484af[_0xfe4a('0x33')]));_0x4f0cb7[_0xfe4a('0x6e')]=!![];if(_0x50bd6e[_0xfe4a('0x31')][_0xfe4a('0x58')]){_0x4f0cb7['where']=_[_0xfe4a('0x3d')](_0x4f0cb7[_0xfe4a('0x3b')],{'$or':_[_0xfe4a('0x2e')](_0x4f0cb7[_0xfe4a('0x36')],function(_0x2d79bb){var _0x314acc={};_0x314acc[_0x2d79bb]={'$like':'%'+_0x50bd6e[_0xfe4a('0x31')]['filter']+'%'};return _0x314acc;})});}_0x4f0cb7=_['merge']({},_0x4f0cb7,_0x50bd6e[_0xfe4a('0x40')]);return _0x566e45[_0xfe4a('0x6b')](_0x4f0cb7);}})[_0xfe4a('0x28')](function(_0xec6549){if(!_[_0xfe4a('0x6f')](_0xec6549)){var _0x4a425e=toCsv(_0xec6549);var _0x734375=Date['now']();fs[_0xfe4a('0x70')](util['format']('/tmp/list_%d_%s.csv',_0x566e45['id'],_0x734375),_0x4a425e);_0x16b362[_0xfe4a('0x71')](_0xfe4a('0x72'),_0xfe4a('0x73')+util[_0xfe4a('0x6d')](_0xfe4a('0x74'),_0x566e45['id'],_0x734375));_0x16b362['setHeader']('Content-type',_0xfe4a('0x75'));return _0x16b362[_0xfe4a('0x76')](util[_0xfe4a('0x6d')](_0xfe4a('0x77'),_0x566e45['id'],_0x734375));}else{return _0x16b362[_0xfe4a('0x18')](0xcc);}})[_0xfe4a('0x45')](handleError(_0x16b362,null));};exports[_0xfe4a('0x78')]=function(_0x5bc179,_0x541027,_0xccd000){var _0xf81a0e;delete _0x5bc179[_0xfe4a('0x4b')]['id'];return db[_0xfe4a('0x43')][_0xfe4a('0x56')]({'where':{'id':_0x5bc179[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x541027,null))[_0xfe4a('0x28')](function(_0x1eb6a4){if(_0x1eb6a4){return db[_0xfe4a('0x79')]['transaction'](function(_0x58e630){return db[_0xfe4a('0x67')][_0xfe4a('0x4a')](_0x5bc179[_0xfe4a('0x4b')],{'transaction':_0x58e630})[_0xfe4a('0x28')](function(_0xa12ce1){_0xf81a0e=_0xa12ce1;return _0x1eb6a4[_0xfe4a('0x7a')](_0xa12ce1,{'transaction':_0x58e630});})['then'](function(){var _0x4a73fd={'type':db[_0xfe4a('0x7b')]['TEXT'],'transaction':_0x58e630};switch(_0x5bc179[_0xfe4a('0x4b')][_0xfe4a('0x3e')]){case _0xfe4a('0x7c'):_0x4a73fd['type']=db[_0xfe4a('0x7b')][_0xfe4a('0x7d')];break;case _0xfe4a('0x7e'):_0x4a73fd[_0xfe4a('0x3e')]=db['Sequelize'][_0xfe4a('0x7f')];break;case _0xfe4a('0x80'):_0x4a73fd[_0xfe4a('0x3e')]=db[_0xfe4a('0x7b')]['BOOLEAN'];_0x4a73fd[_0xfe4a('0x81')]=![];break;default:}return db[_0xfe4a('0x79')]['queryInterface'][_0xfe4a('0x82')](_0xfe4a('0x83'),util['format']('cf_%s',_0xf81a0e['id']),_0x4a73fd);})[_0xfe4a('0x28')](function(){return _0xf81a0e;});});}})['then'](respondWithResult(_0x541027,null))['catch'](handleError(_0x541027,null));};exports[_0xfe4a('0x84')]=function(_0x13b1b8,_0x5e588f,_0x58bb1c){var _0x620303={};var _0x9945d={};var _0x153034;var _0x85cbd5;return db[_0xfe4a('0x43')][_0xfe4a('0x56')]({'where':{'id':_0x13b1b8['params']['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x5e588f,null))[_0xfe4a('0x28')](function(_0x2ce602){if(_0x2ce602){_0x153034=_0x2ce602;_0x9945d['model']=_[_0xfe4a('0x32')](db[_0xfe4a('0x67')][_0xfe4a('0x48')]);_0x9945d['query']=_[_0xfe4a('0x32')](_0x13b1b8[_0xfe4a('0x31')]);_0x9945d[_0xfe4a('0x33')]=_[_0xfe4a('0x34')](_0x9945d[_0xfe4a('0x35')],_0x9945d[_0xfe4a('0x31')]);_0x620303[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x9945d[_0xfe4a('0x35')],qs[_0xfe4a('0x37')](_0x13b1b8[_0xfe4a('0x31')][_0xfe4a('0x37')]));_0x620303[_0xfe4a('0x36')]=_0x620303[_0xfe4a('0x36')]['length']?_0x620303[_0xfe4a('0x36')]:_0x9945d['model'];_0x620303[_0xfe4a('0x39')]=qs[_0xfe4a('0x3a')](_0x13b1b8[_0xfe4a('0x31')][_0xfe4a('0x3a')]);_0x620303[_0xfe4a('0x3b')]=qs[_0xfe4a('0x33')](_['pick'](_0x13b1b8[_0xfe4a('0x31')],_0x9945d[_0xfe4a('0x33')]));_0x620303['where']=_[_0xfe4a('0x3d')](_0x620303[_0xfe4a('0x3b')],{'$or':[{'ListId':_0x2ce602['id']},{'ListId':null}]});if(_0x13b1b8[_0xfe4a('0x31')]['filter']){_0x620303['where']=_['merge'](_0x620303['where'],{'$or':_[_0xfe4a('0x2e')](_0x620303[_0xfe4a('0x36')],function(_0x2331e3){var _0x4fa5b0={};_0x4fa5b0[_0x2331e3]={'$like':'%'+_0x13b1b8[_0xfe4a('0x31')][_0xfe4a('0x58')]+'%'};return _0x4fa5b0;})});}_0x620303=_[_0xfe4a('0x3d')]({},_0x620303,_0x13b1b8['options']);return db[_0xfe4a('0x67')][_0xfe4a('0x85')](_0x620303);}})[_0xfe4a('0x28')](respondWithResult(_0x5e588f,null))[_0xfe4a('0x45')](handleError(_0x5e588f,null));};exports[_0xfe4a('0x86')]=function(_0x553298,_0xf51371,_0x3649ad){return db[_0xfe4a('0x43')][_0xfe4a('0x50')]({'where':{'id':_0x553298[_0xfe4a('0x47')]['id']}})['then'](handleEntityNotFound(_0xf51371,null))['then'](function(_0x1b8aa6){if(_0x1b8aa6){return _0x1b8aa6[_0xfe4a('0x86')](_0x553298[_0xfe4a('0x4b')]['ids'],_[_0xfe4a('0x87')](_0x553298[_0xfe4a('0x4b')],['ids','id'])||{})[_0xfe4a('0x88')](function(_0x250b81){for(var _0x1e5dad=0x0;_0x1e5dad<_0x553298[_0xfe4a('0x4b')]['ids'][_0xfe4a('0x49')];_0x1e5dad+=0x1){socket[_0xfe4a('0x89')](_0xfe4a('0x8a'),{'UserId':Number(_0x553298[_0xfe4a('0x4b')][_0xfe4a('0x5b')][_0x1e5dad]),'CmListId':Number(_0x553298[_0xfe4a('0x47')]['id'])});}return _0x250b81;});}})[_0xfe4a('0x28')](respondWithResult(_0xf51371,null))['catch'](handleError(_0xf51371,null));};exports[_0xfe4a('0x8b')]=function(_0x945502,_0x49f525,_0x4a3f31){return db['CmList'][_0xfe4a('0x50')]({'where':{'id':_0x945502[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x49f525,null))[_0xfe4a('0x28')](function(_0x177a67){if(_0x177a67){return _0x177a67[_0xfe4a('0x8b')](_0x945502[_0xfe4a('0x31')][_0xfe4a('0x5b')])[_0xfe4a('0x28')](function(){if(_[_0xfe4a('0x5f')](_0x945502[_0xfe4a('0x31')][_0xfe4a('0x5b')])){for(var _0x5f2a8d=0x0;_0x5f2a8d<_0x945502[_0xfe4a('0x31')][_0xfe4a('0x5b')][_0xfe4a('0x49')];_0x5f2a8d+=0x1){socket[_0xfe4a('0x89')](_0xfe4a('0x8c'),{'UserId':Number(_0x945502[_0xfe4a('0x31')][_0xfe4a('0x5b')][_0x5f2a8d]),'CmListId':Number(_0x945502[_0xfe4a('0x47')]['id'])});}}else{socket[_0xfe4a('0x89')](_0xfe4a('0x8c'),{'UserId':Number(_0x945502['query'][_0xfe4a('0x5b')]),'CmListId':Number(_0x945502[_0xfe4a('0x47')]['id'])});}});}})[_0xfe4a('0x28')](respondWithStatusCode(_0x49f525,null))['catch'](handleError(_0x49f525,null));};exports['getAgents']=function(_0x4c0963,_0x57b77a,_0x2f063e){var _0x57f360={};var _0x4e39e8={};var _0x26b6e5;var _0x53edcf;return db[_0xfe4a('0x43')][_0xfe4a('0x56')]({'where':{'id':_0x4c0963[_0xfe4a('0x47')]['id']}})[_0xfe4a('0x28')](handleEntityNotFound(_0x57b77a,null))[_0xfe4a('0x28')](function(_0xa5fc8d){if(_0xa5fc8d){_0x26b6e5=_0xa5fc8d;_0x4e39e8[_0xfe4a('0x35')]=_[_0xfe4a('0x32')](db[_0xfe4a('0x8d')][_0xfe4a('0x48')]);_0x4e39e8[_0xfe4a('0x31')]=_[_0xfe4a('0x32')](_0x4c0963['query']);_0x4e39e8['filters']=_[_0xfe4a('0x34')](_0x4e39e8[_0xfe4a('0x35')],_0x4e39e8['query']);_0x57f360[_0xfe4a('0x36')]=_[_0xfe4a('0x34')](_0x4e39e8['model'],qs['fields'](_0x4c0963[_0xfe4a('0x31')][_0xfe4a('0x37')]));_0x57f360['attributes']=_0x57f360[_0xfe4a('0x36')]['length']?_0x57f360[_0xfe4a('0x36')]:_0x4e39e8[_0xfe4a('0x35')];_0x57f360['order']=qs[_0xfe4a('0x3a')](_0x4c0963[_0xfe4a('0x31')][_0xfe4a('0x3a')]);_0x57f360[_0xfe4a('0x3b')]=qs[_0xfe4a('0x33')](_[_0xfe4a('0x3c')](_0x4c0963[_0xfe4a('0x31')],_0x4e39e8['filters']));if(_0x4c0963[_0xfe4a('0x31')]['filter']){_0x57f360['where']=_[_0xfe4a('0x3d')](_0x57f360[_0xfe4a('0x3b')],{'$or':_[_0xfe4a('0x2e')](_0x57f360[_0xfe4a('0x36')],function(_0x1a01a4){var _0x53c848={};_0x53c848[_0x1a01a4]={'$like':'%'+_0x4c0963[_0xfe4a('0x31')][_0xfe4a('0x58')]+'%'};return _0x53c848;})});}_0x57f360=_[_0xfe4a('0x3d')]({},_0x57f360,_0x4c0963[_0xfe4a('0x40')]);return _0x26b6e5[_0xfe4a('0x8e')](_0x57f360);}})[_0xfe4a('0x28')](function(_0x51d85f){if(_0x51d85f){_0x53edcf=_0x51d85f[_0xfe4a('0x49')];if(!_0x4c0963['query'][_0xfe4a('0x38')]('nolimit')){_0x57f360[_0xfe4a('0x1f')]=qs[_0xfe4a('0x1f')](_0x4c0963['query'][_0xfe4a('0x1f')]);_0x57f360['offset']=qs['offset'](_0x4c0963[_0xfe4a('0x31')]['offset']);}return _0x26b6e5[_0xfe4a('0x8e')](_0x57f360);}})[_0xfe4a('0x28')](function(_0x5ac5bf){if(_0x5ac5bf){return _0x5ac5bf?{'count':_0x53edcf,'rows':_0x5ac5bf}:null;}})['then'](respondWithResult(_0x57b77a,null))[_0xfe4a('0x45')](handleError(_0x57b77a,null));}; \ No newline at end of file +var _0x4c71=['message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','addCustomField','sequelize','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','getCustomFields','spread','emit','userCmList:save','isArray','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','addContacts','CmContact','tags','each','omit','push','dataValues','errors'];(function(_0x16de4c,_0x507b95){var _0x5f3b42=function(_0x1d4aa4){while(--_0x1d4aa4){_0x16de4c['push'](_0x16de4c['shift']());}};_0x5f3b42(++_0x507b95);}(_0x4c71,0xb0));var _0x14c7=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4c71[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0x14c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14c7('0x1'));var jsonpatch=require(_0x14c7('0x2'));var rp=require('request-promise');var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var Mustache=require(_0x14c7('0x5'));var util=require('util');var path=require(_0x14c7('0x6'));var sox=require(_0x14c7('0x7'));var csv=require('to-csv');var ejs=require(_0x14c7('0x8'));var fs=require('fs');var fs_extra=require(_0x14c7('0x9'));var _=require(_0x14c7('0xa'));var squel=require(_0x14c7('0xb'));var crypto=require(_0x14c7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x14c7('0xd'));var querystring=require(_0x14c7('0xe'));var Papa=require('papaparse');var Redis=require(_0x14c7('0xf'));var authService=require(_0x14c7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c7('0x11'));var logger=require('../../config/logger')(_0x14c7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14c7('0x13'));var db=require(_0x14c7('0x14'))['db'];config[_0x14c7('0x15')]=_['defaults'](config[_0x14c7('0x15')],{'host':_0x14c7('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x14c7('0x17'))[_0x14c7('0x18')](socket);function respondWithStatusCode(_0x187ee0,_0x18f326){_0x18f326=_0x18f326||0xcc;return function(_0x5cc2ca){if(_0x5cc2ca){return _0x187ee0[_0x14c7('0x19')](_0x18f326);}return _0x187ee0[_0x14c7('0x1a')](_0x18f326)[_0x14c7('0x1b')]();};}function respondWithResult(_0x19955c,_0x207a8e){_0x207a8e=_0x207a8e||0xc8;return function(_0x31ff26){if(_0x31ff26){return _0x19955c[_0x14c7('0x1a')](_0x207a8e)['json'](_0x31ff26);}};}function respondWithFilteredResult(_0x3ccc6e,_0x4041ba){return function(_0x5b5083){if(_0x5b5083){var _0x581635=typeof _0x4041ba[_0x14c7('0x1c')]===_0x14c7('0x1d')&&typeof _0x4041ba[_0x14c7('0x1e')]===_0x14c7('0x1d');var _0xd5593a=_0x5b5083[_0x14c7('0x1f')];var _0x8f58ea=_0x581635?0x0:_0x4041ba[_0x14c7('0x1c')];var _0xa0ba0=_0x581635?_0x5b5083[_0x14c7('0x1f')]:_0x4041ba[_0x14c7('0x1c')]+_0x4041ba[_0x14c7('0x1e')];var _0x385caa;if(_0xa0ba0>=_0xd5593a){_0xa0ba0=_0xd5593a;_0x385caa=0xc8;}else{_0x385caa=0xce;}_0x3ccc6e['status'](_0x385caa);return _0x3ccc6e[_0x14c7('0x20')]('Content-Range',_0x8f58ea+'-'+_0xa0ba0+'/'+_0xd5593a)[_0x14c7('0x21')](_0x5b5083);}return null;};}function patchUpdates(_0x412348){return function(_0x403bf9){try{jsonpatch[_0x14c7('0x22')](_0x403bf9,_0x412348,!![]);}catch(_0x3928a2){return BPromise[_0x14c7('0x23')](_0x3928a2);}return _0x403bf9[_0x14c7('0x24')]();};}function saveUpdates(_0x11fa4e,_0x1537c5){return function(_0x431684){if(_0x431684){return _0x431684['update'](_0x11fa4e)[_0x14c7('0x25')](function(_0x4ff7d9){return _0x4ff7d9;});}return null;};}function removeEntity(_0x5ae707,_0x2a1a51){return function(_0x5ea218){if(_0x5ea218){return _0x5ea218[_0x14c7('0x26')]()[_0x14c7('0x25')](function(){var _0x4fed11=_0x5ea218[_0x14c7('0x27')]({'plain':!![]});var _0x328c75=_0x14c7('0x28');return db[_0x14c7('0x29')]['destroy']({'where':{'type':_0x328c75,'resourceId':_0x4fed11['id']}})['then'](function(){return _0x5ea218;});})['then'](function(){_0x5ae707[_0x14c7('0x1a')](0xcc)[_0x14c7('0x1b')]();});}};}function handleEntityNotFound(_0x5232c5,_0x4c8ea4){return function(_0x240a7f){if(!_0x240a7f){_0x5232c5['sendStatus'](0x194);}return _0x240a7f;};}function handleError(_0x2b635e,_0x3e9438){_0x3e9438=_0x3e9438||0x1f4;return function(_0x4e59d0){logger[_0x14c7('0x2a')](_0x4e59d0[_0x14c7('0x2b')]);if(_0x4e59d0[_0x14c7('0x2c')]){delete _0x4e59d0[_0x14c7('0x2c')];}_0x2b635e['status'](_0x3e9438)[_0x14c7('0x2d')](_0x4e59d0);};}exports[_0x14c7('0x2e')]=function(_0x1f320a,_0x151e47){var _0x32d255={},_0x4a26b1={},_0x1a6e9f={'count':0x0,'rows':[]};var _0x4f8ef4=_[_0x14c7('0x2f')](db[_0x14c7('0x30')][_0x14c7('0x31')],function(_0x265e79){return{'name':_0x265e79[_0x14c7('0x32')],'type':_0x265e79[_0x14c7('0x33')][_0x14c7('0x34')]};});_0x4a26b1[_0x14c7('0x35')]=_[_0x14c7('0x2f')](_0x4f8ef4,_0x14c7('0x2c'));_0x4a26b1[_0x14c7('0x36')]=_[_0x14c7('0x37')](_0x1f320a[_0x14c7('0x36')]);_0x4a26b1[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x4a26b1[_0x14c7('0x35')],_0x4a26b1[_0x14c7('0x36')]);_0x32d255[_0x14c7('0x3a')]=_[_0x14c7('0x39')](_0x4a26b1['model'],qs[_0x14c7('0x3b')](_0x1f320a[_0x14c7('0x36')]['fields']));_0x32d255['attributes']=_0x32d255[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x32d255['attributes']:_0x4a26b1[_0x14c7('0x35')];if(!_0x1f320a[_0x14c7('0x36')][_0x14c7('0x3d')](_0x14c7('0x3e'))){_0x32d255[_0x14c7('0x1e')]=qs['limit'](_0x1f320a[_0x14c7('0x36')]['limit']);_0x32d255[_0x14c7('0x1c')]=qs[_0x14c7('0x1c')](_0x1f320a[_0x14c7('0x36')][_0x14c7('0x1c')]);}_0x32d255['order']=qs[_0x14c7('0x3f')](_0x1f320a[_0x14c7('0x36')][_0x14c7('0x3f')]);_0x32d255['where']=qs[_0x14c7('0x38')](_[_0x14c7('0x40')](_0x1f320a[_0x14c7('0x36')],_0x4a26b1['filters']),_0x4f8ef4);if(_0x1f320a['query'][_0x14c7('0x41')]){_0x32d255[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x32d255['where'],{'$or':_['map'](_0x4f8ef4,function(_0x13b728){if(_0x13b728[_0x14c7('0x33')]!==_0x14c7('0x44')){var _0x5ad738={};_0x5ad738[_0x13b728[_0x14c7('0x2c')]]={'$like':'%'+_0x1f320a[_0x14c7('0x36')]['filter']+'%'};return _0x5ad738;}})});}_0x32d255=_['merge']({},_0x32d255,_0x1f320a[_0x14c7('0x45')]);var _0xee623d={'where':_0x32d255['where']};return db[_0x14c7('0x30')][_0x14c7('0x1f')](_0xee623d)[_0x14c7('0x25')](function(_0x5b6767){_0x1a6e9f[_0x14c7('0x1f')]=_0x5b6767;if(_0x1f320a['query'][_0x14c7('0x46')]){_0x32d255[_0x14c7('0x47')]=[{'all':!![]}];}return db[_0x14c7('0x30')][_0x14c7('0x48')](_0x32d255);})[_0x14c7('0x25')](function(_0x8449c4){_0x1a6e9f['rows']=_0x8449c4;return _0x1a6e9f;})['then'](respondWithFilteredResult(_0x151e47,_0x32d255))[_0x14c7('0x49')](handleError(_0x151e47,null));};exports[_0x14c7('0x4a')]=function(_0x1af31f,_0x4ec05b){var _0x36a252={'raw':![],'where':{'id':_0x1af31f['params']['id']}},_0x1c912f={};_0x1c912f[_0x14c7('0x35')]=_[_0x14c7('0x37')](db['CmList']['rawAttributes']);_0x1c912f[_0x14c7('0x36')]=_['keys'](_0x1af31f[_0x14c7('0x36')]);_0x1c912f[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x1c912f[_0x14c7('0x35')],_0x1c912f['query']);_0x36a252[_0x14c7('0x3a')]=_[_0x14c7('0x39')](_0x1c912f[_0x14c7('0x35')],qs[_0x14c7('0x3b')](_0x1af31f[_0x14c7('0x36')][_0x14c7('0x3b')]));_0x36a252['attributes']=_0x36a252[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x36a252['attributes']:_0x1c912f[_0x14c7('0x35')];if(_0x1af31f[_0x14c7('0x36')]['includeAll']){_0x36a252[_0x14c7('0x47')]=[{'all':!![]}];}_0x36a252=_[_0x14c7('0x43')]({},_0x36a252,_0x1af31f[_0x14c7('0x45')]);return db['CmList'][_0x14c7('0x4b')](_0x36a252)['then'](handleEntityNotFound(_0x4ec05b,null))[_0x14c7('0x25')](respondWithResult(_0x4ec05b,null))[_0x14c7('0x49')](handleError(_0x4ec05b,null));};exports[_0x14c7('0x4c')]=function(_0x5041a3,_0xaa890f){return db[_0x14c7('0x30')]['create'](_0x5041a3[_0x14c7('0x4d')],{})[_0x14c7('0x25')](function(_0x3d29c1){var _0x1caee9=_0x5041a3[_0x14c7('0x4e')][_0x14c7('0x27')]({'plain':!![]});if(!_0x1caee9)throw new Error(_0x14c7('0x4f'));if(_0x1caee9[_0x14c7('0x50')]===_0x14c7('0x4e')){var _0x2ce41f=_0x3d29c1[_0x14c7('0x27')]({'plain':!![]});var _0x5840e4='Lists';return db[_0x14c7('0x51')][_0x14c7('0x4b')]({'where':{'name':_0x5840e4,'userProfileId':_0x1caee9[_0x14c7('0x52')]},'raw':!![]})[_0x14c7('0x25')](function(_0x3390e0){if(_0x3390e0&&_0x3390e0[_0x14c7('0x53')]===0x0){return db[_0x14c7('0x29')][_0x14c7('0x4c')]({'name':_0x2ce41f['name'],'resourceId':_0x2ce41f['id'],'type':_0x3390e0[_0x14c7('0x2c')],'sectionId':_0x3390e0['id']},{})[_0x14c7('0x25')](function(){return _0x3d29c1;});}else{return _0x3d29c1;}})['catch'](function(_0x521cf5){logger[_0x14c7('0x2a')](_0x14c7('0x54'),_0x521cf5);throw _0x521cf5;});}return _0x3d29c1;})[_0x14c7('0x25')](respondWithResult(_0xaa890f,0xc9))[_0x14c7('0x49')](handleError(_0xaa890f,null));};exports['update']=function(_0x3d0ead,_0x5051be){if(_0x3d0ead['body']['id']){delete _0x3d0ead[_0x14c7('0x4d')]['id'];}return db[_0x14c7('0x30')]['find']({'where':{'id':_0x3d0ead[_0x14c7('0x55')]['id']}})['then'](handleEntityNotFound(_0x5051be,null))[_0x14c7('0x25')](saveUpdates(_0x3d0ead[_0x14c7('0x4d')],null))[_0x14c7('0x25')](respondWithResult(_0x5051be,null))[_0x14c7('0x49')](handleError(_0x5051be,null));};exports['destroy']=function(_0x2c2deb,_0x2aa745){return db['CmList'][_0x14c7('0x4b')]({'where':{'id':_0x2c2deb['params']['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x2aa745,null))[_0x14c7('0x25')](removeEntity(_0x2aa745,null))['catch'](handleError(_0x2aa745,null));};exports[_0x14c7('0x56')]=function(_0x45932a,_0x344380){return db[_0x14c7('0x30')][_0x14c7('0x56')]()[_0x14c7('0x25')](respondWithResult(_0x344380,null))[_0x14c7('0x49')](handleError(_0x344380,null));};exports[_0x14c7('0x57')]=function(_0x2f1d17,_0x2a603e,_0x5a73a7){if(_0x2f1d17['body']['id']){delete _0x2f1d17[_0x14c7('0x4d')]['id'];}return db[_0x14c7('0x30')][_0x14c7('0x4b')]({'where':{'id':_0x2f1d17[_0x14c7('0x55')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x2a603e,null))[_0x14c7('0x25')](function(_0x67a11c){if(_0x67a11c){_0x2f1d17['body'][_0x14c7('0x58')]=_0x67a11c['id'];return db[_0x14c7('0x59')][_0x14c7('0x4c')](_0x2f1d17[_0x14c7('0x4d')]);}})['then'](respondWithResult(_0x2a603e,null))[_0x14c7('0x49')](handleError(_0x2a603e,null));};exports[_0x14c7('0x5a')]=function(_0x590358,_0x350986,_0x2f9e12){var _0x1acd54={'raw':![],'where':{}};var _0x4ff96a={};var _0xd7be4c={'count':0x0,'rows':[]};return db['CmList'][_0x14c7('0x5b')]({'where':{'id':_0x590358[_0x14c7('0x55')]['id']}})['then'](handleEntityNotFound(_0x350986,null))[_0x14c7('0x25')](function(_0x3d4daa){if(_0x3d4daa){_0x4ff96a[_0x14c7('0x35')]=_['keys'](db[_0x14c7('0x59')][_0x14c7('0x31')]);_0x4ff96a[_0x14c7('0x36')]=_['keys'](_0x590358[_0x14c7('0x36')]);_0x4ff96a[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x4ff96a[_0x14c7('0x35')],_0x4ff96a[_0x14c7('0x36')]);_0x1acd54[_0x14c7('0x3a')]=_['intersection'](_0x4ff96a[_0x14c7('0x35')],qs[_0x14c7('0x3b')](_0x590358['query'][_0x14c7('0x3b')]));_0x1acd54[_0x14c7('0x3a')]=_0x1acd54[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x1acd54[_0x14c7('0x3a')]:_0x4ff96a[_0x14c7('0x35')];if(!_0x590358[_0x14c7('0x36')][_0x14c7('0x3d')](_0x14c7('0x3e'))){_0x1acd54[_0x14c7('0x1e')]=qs[_0x14c7('0x1e')](_0x590358[_0x14c7('0x36')][_0x14c7('0x1e')]);_0x1acd54[_0x14c7('0x1c')]=qs[_0x14c7('0x1c')](_0x590358[_0x14c7('0x36')][_0x14c7('0x1c')]);}_0x1acd54[_0x14c7('0x5c')]=qs[_0x14c7('0x3f')](_0x590358[_0x14c7('0x36')][_0x14c7('0x3f')]);_0x1acd54[_0x14c7('0x42')]=qs[_0x14c7('0x38')](_['pick'](_0x590358[_0x14c7('0x36')],_0x4ff96a[_0x14c7('0x38')]));_0x1acd54[_0x14c7('0x42')][_0x14c7('0x58')]=_0x3d4daa['id'];if(_0x590358[_0x14c7('0x36')][_0x14c7('0x41')]){_0x1acd54[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x1acd54[_0x14c7('0x42')],{'$or':_['map'](_0x1acd54[_0x14c7('0x3a')],function(_0x20e13f){var _0x547290={};_0x547290[_0x20e13f]={'$like':'%'+_0x590358[_0x14c7('0x36')][_0x14c7('0x41')]+'%'};return _0x547290;})});}_0x1acd54=_[_0x14c7('0x43')]({},_0x1acd54,_0x590358['options']);return db[_0x14c7('0x59')]['count']({'where':_0x1acd54[_0x14c7('0x42')]})[_0x14c7('0x25')](function(_0x28075b){_0xd7be4c[_0x14c7('0x1f')]=_0x28075b;if(_0x590358['query'][_0x14c7('0x46')]){_0x1acd54[_0x14c7('0x47')]=[{'all':!![]}];}return db[_0x14c7('0x59')][_0x14c7('0x48')](_0x1acd54);})['then'](function(_0x1f869f){_0xd7be4c[_0x14c7('0x5d')]=_0x1f869f;return _0xd7be4c;});}})[_0x14c7('0x25')](respondWithFilteredResult(_0x350986,_0x1acd54))['catch'](handleError(_0x350986,null));};exports[_0x14c7('0x5e')]=function(_0x10a805,_0x1f4eec,_0xa22114){return db['CmList'][_0x14c7('0x4b')]({'where':{'id':_0x10a805[_0x14c7('0x55')]['id']}})['then'](handleEntityNotFound(_0x1f4eec,null))[_0x14c7('0x25')](function(_0x3a8b90){if(_0x3a8b90){return _0x3a8b90['removeDispositions'](_0x10a805[_0x14c7('0x36')][_0x14c7('0x5f')]);}})['then'](respondWithStatusCode(_0x1f4eec,null))[_0x14c7('0x49')](handleError(_0x1f4eec,null));};exports[_0x14c7('0x60')]=function(_0x52a3c0,_0x11d5d9,_0x5b937a){return db[_0x14c7('0x30')][_0x14c7('0x4b')]({'where':{'id':_0x52a3c0['params']['id']}})['then'](handleEntityNotFound(_0x11d5d9,null))[_0x14c7('0x25')](function(_0x484e60){if(_0x484e60){var _0x2cbe3b=[];var _0x327fad={'success':[],'errors':[]};return db[_0x14c7('0x61')][_0x14c7('0x56')]()['then'](function(_0x186081){if(_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')]&&_['isArray'](_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')])){if(_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')][_0x14c7('0x3c')]){_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')]=_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')]['join'](';')+';';}else{_0x52a3c0['body'][_0x14c7('0x62')]=null;}}else{_0x52a3c0[_0x14c7('0x4d')][_0x14c7('0x62')]=null;}if(_0x52a3c0[_0x14c7('0x4d')]&&_['isArray'](_0x52a3c0[_0x14c7('0x4d')])){for(var _0x8ab783=0x0;_0x8ab783<_0x52a3c0['body'][_0x14c7('0x3c')];_0x8ab783+=0x1){_0x52a3c0[_0x14c7('0x4d')][_0x8ab783][_0x14c7('0x58')]=_0x52a3c0[_0x14c7('0x55')]['id'];_0x2cbe3b['push'](_0x52a3c0[_0x14c7('0x4d')][_0x8ab783]);}return BPromise[_0x14c7('0x63')](_0x2cbe3b,function(_0x5d672d){return db[_0x14c7('0x61')][_0x14c7('0x4c')](_[_0x14c7('0x64')](_0x5d672d,[_0x14c7('0x5f'),'id'])||{},{'fields':_[_0x14c7('0x37')](_0x186081),'raw':!![]})[_0x14c7('0x25')](function(_0x43fed6){_0x327fad['success'][_0x14c7('0x65')](_0x43fed6[_0x14c7('0x66')]);})[_0x14c7('0x49')](function(_0x33a03a){_0x327fad[_0x14c7('0x67')][_0x14c7('0x65')]({'data':_0x5d672d,'error':_0x33a03a[_0x14c7('0x68')]});});})['then'](function(_0x190801){return _0x327fad;})[_0x14c7('0x49')](function(_0x26a5fd){return _0x26a5fd;});}else{_0x11d5d9[_0x14c7('0x1a')](0x190)[_0x14c7('0x21')]({'message':_0x14c7('0x69')});}});}})[_0x14c7('0x25')](respondWithResult(_0x11d5d9,null))[_0x14c7('0x49')](handleError(_0x11d5d9,null));};exports[_0x14c7('0x6a')]=function(_0x514433,_0x48a371,_0x1491c0){var _0x43c1bd;return db['CmList'][_0x14c7('0x4b')]({'where':{'id':_0x514433[_0x14c7('0x55')]['id']},'include':[{'model':db[_0x14c7('0x6b')],'as':_0x14c7('0x6c')}]})[_0x14c7('0x25')](handleEntityNotFound(_0x48a371,null))[_0x14c7('0x25')](function(_0x3d2ba8){if(_0x3d2ba8){_0x43c1bd=_0x3d2ba8;return db['CmContact'][_0x14c7('0x31')];}})[_0x14c7('0x25')](function(_0x4d2b2a){if(_0x4d2b2a){var _0x111371={};var _0x545713={};_0x545713[_0x14c7('0x35')]=_[_0x14c7('0x6d')](_[_0x14c7('0x37')](_0x4d2b2a),_['map'](_0x43c1bd['CustomFields'],function(_0x11e5c6){return util[_0x14c7('0x6e')](_0x14c7('0x6f'),_0x11e5c6['id']);}));_0x545713[_0x14c7('0x36')]=_[_0x14c7('0x37')](_0x514433[_0x14c7('0x36')]);_0x545713[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x545713[_0x14c7('0x35')],_0x545713['query']);_0x111371[_0x14c7('0x3a')]=_[_0x14c7('0x39')](_0x545713[_0x14c7('0x35')],qs[_0x14c7('0x3b')](_0x514433['query'][_0x14c7('0x3b')]));_0x111371[_0x14c7('0x3a')]=_0x111371[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x111371[_0x14c7('0x3a')]:_0x545713[_0x14c7('0x35')];if(!_0x514433[_0x14c7('0x36')][_0x14c7('0x3d')](_0x14c7('0x3e'))){_0x111371[_0x14c7('0x1e')]=qs[_0x14c7('0x1e')](_0x514433['query'][_0x14c7('0x1e')]);_0x111371['offset']=qs[_0x14c7('0x1c')](_0x514433[_0x14c7('0x36')]['offset']);}_0x111371['order']=qs[_0x14c7('0x3f')](_0x514433[_0x14c7('0x36')][_0x14c7('0x3f')]);_0x111371[_0x14c7('0x42')]=qs['filters'](_[_0x14c7('0x40')](_0x514433[_0x14c7('0x36')],_0x545713[_0x14c7('0x38')]));_0x111371[_0x14c7('0x70')]=!![];if(_0x514433[_0x14c7('0x36')]['filter']){_0x111371[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x111371['where'],{'$or':_[_0x14c7('0x2f')](_0x111371[_0x14c7('0x3a')],function(_0x9cba07){var _0x20f1ef={};_0x20f1ef[_0x9cba07]={'$like':'%'+_0x514433[_0x14c7('0x36')][_0x14c7('0x41')]+'%'};return _0x20f1ef;})});}_0x111371=_[_0x14c7('0x43')]({},_0x111371,_0x514433[_0x14c7('0x45')]);return _0x43c1bd[_0x14c7('0x6a')](_0x111371);}})['then'](respondWithResult(_0x48a371,null))['catch'](handleError(_0x48a371,null));};exports[_0x14c7('0x71')]=function(_0x321362,_0x372c4e,_0x3b9f42){var _0xb75fe6;return db[_0x14c7('0x30')]['find']({'where':{'id':_0x321362[_0x14c7('0x55')]['id']},'include':[{'model':db[_0x14c7('0x6b')],'as':'CustomFields'}]})[_0x14c7('0x25')](handleEntityNotFound(_0x372c4e,null))[_0x14c7('0x25')](function(_0xb6bfb9){if(_0xb6bfb9){_0xb75fe6=_0xb6bfb9;return db[_0x14c7('0x61')]['rawAttributes'];}})[_0x14c7('0x25')](function(_0x454d4c){if(_0x454d4c){var _0x54f109={};var _0x210aa2={};_0x210aa2[_0x14c7('0x35')]=_[_0x14c7('0x6d')](_[_0x14c7('0x37')](_0x454d4c),_[_0x14c7('0x2f')](_0xb75fe6[_0x14c7('0x6c')],function(_0x58ea22){return util['format'](_0x14c7('0x6f'),_0x58ea22['id']);}));_0x210aa2[_0x14c7('0x36')]=_[_0x14c7('0x37')](_0x321362[_0x14c7('0x36')]);_0x210aa2[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x210aa2['model'],_0x210aa2[_0x14c7('0x36')]);_0x54f109[_0x14c7('0x3a')]=_['intersection'](_0x210aa2[_0x14c7('0x35')],qs[_0x14c7('0x3b')](_0x321362[_0x14c7('0x36')][_0x14c7('0x3b')]));_0x54f109[_0x14c7('0x3a')]=_0x54f109[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x54f109[_0x14c7('0x3a')]:_0x210aa2['model'];if(!_0x321362[_0x14c7('0x36')][_0x14c7('0x3d')](_0x14c7('0x3e'))){_0x54f109['limit']=qs[_0x14c7('0x1e')](_0x321362[_0x14c7('0x36')][_0x14c7('0x1e')]);_0x54f109[_0x14c7('0x1c')]=qs[_0x14c7('0x1c')](_0x321362[_0x14c7('0x36')][_0x14c7('0x1c')]);}_0x54f109[_0x14c7('0x5c')]=qs[_0x14c7('0x3f')](_0x321362[_0x14c7('0x36')][_0x14c7('0x3f')]);_0x54f109['where']=qs['filters'](_[_0x14c7('0x40')](_0x321362[_0x14c7('0x36')],_0x210aa2['filters']));_0x54f109[_0x14c7('0x70')]=!![];if(_0x321362[_0x14c7('0x36')][_0x14c7('0x41')]){_0x54f109[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x54f109[_0x14c7('0x42')],{'$or':_[_0x14c7('0x2f')](_0x54f109[_0x14c7('0x3a')],function(_0x1ede76){var _0x1a128d={};_0x1a128d[_0x1ede76]={'$like':'%'+_0x321362['query']['filter']+'%'};return _0x1a128d;})});}_0x54f109=_[_0x14c7('0x43')]({},_0x54f109,_0x321362[_0x14c7('0x45')]);return _0xb75fe6[_0x14c7('0x6a')](_0x54f109);}})[_0x14c7('0x25')](function(_0x171936){if(!_['isEmpty'](_0x171936)){var _0x3a93e9=toCsv(_0x171936);var _0x5aa6e3=Date[_0x14c7('0x72')]();fs[_0x14c7('0x73')](util[_0x14c7('0x6e')](_0x14c7('0x74'),_0xb75fe6['id'],_0x5aa6e3),_0x3a93e9);_0x372c4e[_0x14c7('0x75')](_0x14c7('0x76'),'attachment;\x20filename='+util['format'](_0x14c7('0x77'),_0xb75fe6['id'],_0x5aa6e3));_0x372c4e[_0x14c7('0x75')](_0x14c7('0x78'),'text/csv');return _0x372c4e['download'](util[_0x14c7('0x6e')](_0x14c7('0x74'),_0xb75fe6['id'],_0x5aa6e3));}else{return _0x372c4e[_0x14c7('0x19')](0xcc);}})['catch'](handleError(_0x372c4e,null));};exports[_0x14c7('0x79')]=function(_0x5baba1,_0x537f18,_0x40ac0a){var _0x49df8a;delete _0x5baba1[_0x14c7('0x4d')]['id'];return db[_0x14c7('0x30')][_0x14c7('0x5b')]({'where':{'id':_0x5baba1[_0x14c7('0x55')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x537f18,null))['then'](function(_0x24633d){if(_0x24633d){return db[_0x14c7('0x7a')]['transaction'](function(_0x24ad09){return db[_0x14c7('0x6b')][_0x14c7('0x4c')](_0x5baba1[_0x14c7('0x4d')],{'transaction':_0x24ad09})[_0x14c7('0x25')](function(_0x5d7b00){_0x49df8a=_0x5d7b00;return _0x24633d['addCustomFields'](_0x5d7b00,{'transaction':_0x24ad09});})[_0x14c7('0x25')](function(){var _0x5e8213={'type':db[_0x14c7('0x7b')][_0x14c7('0x7c')],'transaction':_0x24ad09};switch(_0x5baba1[_0x14c7('0x4d')][_0x14c7('0x33')]){case _0x14c7('0x7d'):_0x5e8213[_0x14c7('0x33')]=db[_0x14c7('0x7b')][_0x14c7('0x7c')];break;case'number':_0x5e8213[_0x14c7('0x33')]=db['Sequelize'][_0x14c7('0x7e')];break;case _0x14c7('0x7f'):_0x5e8213[_0x14c7('0x33')]=db[_0x14c7('0x7b')][_0x14c7('0x80')];_0x5e8213[_0x14c7('0x81')]=![];break;default:}return db[_0x14c7('0x7a')]['queryInterface'][_0x14c7('0x82')](_0x14c7('0x83'),util[_0x14c7('0x6e')]('cf_%s',_0x49df8a['id']),_0x5e8213);})['then'](function(){return _0x49df8a;});});}})[_0x14c7('0x25')](respondWithResult(_0x537f18,null))[_0x14c7('0x49')](handleError(_0x537f18,null));};exports[_0x14c7('0x84')]=function(_0x2121d4,_0x3c3486,_0x9642de){var _0x8f8360={};var _0x516fbc={};var _0x52376e;var _0x5d37af;return db[_0x14c7('0x30')][_0x14c7('0x5b')]({'where':{'id':_0x2121d4[_0x14c7('0x55')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x3c3486,null))[_0x14c7('0x25')](function(_0x1aa5d8){if(_0x1aa5d8){_0x52376e=_0x1aa5d8;_0x516fbc['model']=_[_0x14c7('0x37')](db[_0x14c7('0x6b')]['rawAttributes']);_0x516fbc['query']=_['keys'](_0x2121d4[_0x14c7('0x36')]);_0x516fbc[_0x14c7('0x38')]=_[_0x14c7('0x39')](_0x516fbc[_0x14c7('0x35')],_0x516fbc['query']);_0x8f8360[_0x14c7('0x3a')]=_[_0x14c7('0x39')](_0x516fbc[_0x14c7('0x35')],qs[_0x14c7('0x3b')](_0x2121d4[_0x14c7('0x36')]['fields']));_0x8f8360[_0x14c7('0x3a')]=_0x8f8360[_0x14c7('0x3a')][_0x14c7('0x3c')]?_0x8f8360['attributes']:_0x516fbc[_0x14c7('0x35')];_0x8f8360[_0x14c7('0x5c')]=qs[_0x14c7('0x3f')](_0x2121d4[_0x14c7('0x36')]['sort']);_0x8f8360[_0x14c7('0x42')]=qs[_0x14c7('0x38')](_[_0x14c7('0x40')](_0x2121d4['query'],_0x516fbc[_0x14c7('0x38')]));_0x8f8360[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x8f8360[_0x14c7('0x42')],{'$or':[{'ListId':_0x1aa5d8['id']},{'ListId':null}]});if(_0x2121d4['query'][_0x14c7('0x41')]){_0x8f8360[_0x14c7('0x42')]=_[_0x14c7('0x43')](_0x8f8360[_0x14c7('0x42')],{'$or':_[_0x14c7('0x2f')](_0x8f8360['attributes'],function(_0x4e4158){var _0x40f651={};_0x40f651[_0x4e4158]={'$like':'%'+_0x2121d4[_0x14c7('0x36')][_0x14c7('0x41')]+'%'};return _0x40f651;})});}_0x8f8360=_[_0x14c7('0x43')]({},_0x8f8360,_0x2121d4[_0x14c7('0x45')]);return db[_0x14c7('0x6b')]['findAndCountAll'](_0x8f8360);}})[_0x14c7('0x25')](respondWithResult(_0x3c3486,null))[_0x14c7('0x49')](handleError(_0x3c3486,null));};exports['addAgents']=function(_0x1db4e1,_0x56c620,_0x884a21){return db[_0x14c7('0x30')]['find']({'where':{'id':_0x1db4e1[_0x14c7('0x55')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x56c620,null))[_0x14c7('0x25')](function(_0x43b3db){if(_0x43b3db){return _0x43b3db['addAgents'](_0x1db4e1[_0x14c7('0x4d')][_0x14c7('0x5f')],_['omit'](_0x1db4e1['body'],[_0x14c7('0x5f'),'id'])||{})[_0x14c7('0x85')](function(_0x910c08){for(var _0x2a852e=0x0;_0x2a852e<_0x1db4e1['body'][_0x14c7('0x5f')][_0x14c7('0x3c')];_0x2a852e+=0x1){socket[_0x14c7('0x86')](_0x14c7('0x87'),{'UserId':Number(_0x1db4e1[_0x14c7('0x4d')][_0x14c7('0x5f')][_0x2a852e]),'CmListId':Number(_0x1db4e1[_0x14c7('0x55')]['id'])});}return _0x910c08;});}})[_0x14c7('0x25')](respondWithResult(_0x56c620,null))[_0x14c7('0x49')](handleError(_0x56c620,null));};exports['removeAgents']=function(_0x5bbc5d,_0x3ddcc3,_0x40256f){return db['CmList']['find']({'where':{'id':_0x5bbc5d[_0x14c7('0x55')]['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0x3ddcc3,null))[_0x14c7('0x25')](function(_0x345d5a){if(_0x345d5a){return _0x345d5a['removeAgents'](_0x5bbc5d['query'][_0x14c7('0x5f')])[_0x14c7('0x25')](function(){if(_[_0x14c7('0x88')](_0x5bbc5d[_0x14c7('0x36')]['ids'])){for(var _0x5e288c=0x0;_0x5e288c<_0x5bbc5d[_0x14c7('0x36')][_0x14c7('0x5f')][_0x14c7('0x3c')];_0x5e288c+=0x1){socket[_0x14c7('0x86')](_0x14c7('0x89'),{'UserId':Number(_0x5bbc5d['query']['ids'][_0x5e288c]),'CmListId':Number(_0x5bbc5d[_0x14c7('0x55')]['id'])});}}else{socket[_0x14c7('0x86')](_0x14c7('0x89'),{'UserId':Number(_0x5bbc5d[_0x14c7('0x36')][_0x14c7('0x5f')]),'CmListId':Number(_0x5bbc5d[_0x14c7('0x55')]['id'])});}});}})[_0x14c7('0x25')](respondWithStatusCode(_0x3ddcc3,null))[_0x14c7('0x49')](handleError(_0x3ddcc3,null));};exports[_0x14c7('0x8a')]=function(_0xaa6bae,_0xa7fe70,_0x2c4bec){var _0x1cf441={};var _0x38ff1b={};var _0x6e68a4;var _0x18a037;return db[_0x14c7('0x30')][_0x14c7('0x5b')]({'where':{'id':_0xaa6bae['params']['id']}})[_0x14c7('0x25')](handleEntityNotFound(_0xa7fe70,null))[_0x14c7('0x25')](function(_0x3fb734){if(_0x3fb734){_0x6e68a4=_0x3fb734;_0x38ff1b['model']=_[_0x14c7('0x37')](db[_0x14c7('0x8b')][_0x14c7('0x31')]);_0x38ff1b[_0x14c7('0x36')]=_['keys'](_0xaa6bae[_0x14c7('0x36')]);_0x38ff1b['filters']=_[_0x14c7('0x39')](_0x38ff1b[_0x14c7('0x35')],_0x38ff1b[_0x14c7('0x36')]);_0x1cf441[_0x14c7('0x3a')]=_[_0x14c7('0x39')](_0x38ff1b['model'],qs[_0x14c7('0x3b')](_0xaa6bae[_0x14c7('0x36')][_0x14c7('0x3b')]));_0x1cf441[_0x14c7('0x3a')]=_0x1cf441['attributes']['length']?_0x1cf441[_0x14c7('0x3a')]:_0x38ff1b[_0x14c7('0x35')];_0x1cf441[_0x14c7('0x5c')]=qs[_0x14c7('0x3f')](_0xaa6bae[_0x14c7('0x36')]['sort']);_0x1cf441['where']=qs[_0x14c7('0x38')](_[_0x14c7('0x40')](_0xaa6bae[_0x14c7('0x36')],_0x38ff1b['filters']));if(_0xaa6bae['query'][_0x14c7('0x41')]){_0x1cf441['where']=_[_0x14c7('0x43')](_0x1cf441[_0x14c7('0x42')],{'$or':_[_0x14c7('0x2f')](_0x1cf441[_0x14c7('0x3a')],function(_0x263708){var _0x55c284={};_0x55c284[_0x263708]={'$like':'%'+_0xaa6bae[_0x14c7('0x36')][_0x14c7('0x41')]+'%'};return _0x55c284;})});}_0x1cf441=_[_0x14c7('0x43')]({},_0x1cf441,_0xaa6bae[_0x14c7('0x45')]);return _0x6e68a4[_0x14c7('0x8a')](_0x1cf441);}})[_0x14c7('0x25')](function(_0x424ee2){if(_0x424ee2){_0x18a037=_0x424ee2[_0x14c7('0x3c')];if(!_0xaa6bae[_0x14c7('0x36')][_0x14c7('0x3d')](_0x14c7('0x3e'))){_0x1cf441[_0x14c7('0x1e')]=qs[_0x14c7('0x1e')](_0xaa6bae[_0x14c7('0x36')][_0x14c7('0x1e')]);_0x1cf441[_0x14c7('0x1c')]=qs[_0x14c7('0x1c')](_0xaa6bae['query'][_0x14c7('0x1c')]);}return _0x6e68a4[_0x14c7('0x8a')](_0x1cf441);}})[_0x14c7('0x25')](function(_0x5352dc){if(_0x5352dc){return _0x5352dc?{'count':_0x18a037,'rows':_0x5352dc}:null;}})[_0x14c7('0x25')](respondWithResult(_0xa7fe70,null))['catch'](handleError(_0xa7fe70,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 71b2385..3ab5d28 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x137d80,_0x4ca815){var _0x406c15=function(_0x1f0e13){while(--_0x1f0e13){_0x137d80['push'](_0x137d80['shift']());}};_0x406c15(++_0x4ca815);}(_0x814b,0x1a2));var _0xb814=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x814b[_0x1b892b];return _0xa99e57;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x13eec2,_0xe78b42){var _0x46c367=function(_0x3f399a){while(--_0x3f399a){_0x13eec2['push'](_0x13eec2['shift']());}};_0x46c367(++_0xe78b42);}(_0x7217,0x19e));var _0x7721=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7217[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c64da8d..adaf816 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x4c1681,_0x32c811){var _0x1f9d98=function(_0x306402){while(--_0x306402){_0x4c1681['push'](_0x4c1681['shift']());}};_0x1f9d98(++_0x32c811);}(_0x5ff3,0x17d));var _0x35ff=function(_0x17ab4b,_0x246d34){_0x17ab4b=_0x17ab4b-0x0;var _0x4e3ef6=_0x5ff3[_0x17ab4b];return _0x4e3ef6;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6324=['define','cm_lists','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x25af2d,_0x2e5a53){var _0x4c6c5c=function(_0x4dc8c8){while(--_0x4dc8c8){_0x25af2d['push'](_0x25af2d['shift']());}};_0x4c6c5c(++_0x2e5a53);}(_0x6324,0x142));var _0x4632=function(_0x39e02f,_0x2f4a3c){_0x39e02f=_0x39e02f-0x0;var _0x9cf183=_0x6324[_0x39e02f];return _0x9cf183;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./cmList.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('CmList',attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 77006e7..a3154c0 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1566=['./cmList.socket','register','request','then','info','request\x20sent','debug','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','defaults','redis','socket.io-emitter'];(function(_0x2439f9,_0x4a9f64){var _0x934696=function(_0x18caa5){while(--_0x18caa5){_0x2439f9['push'](_0x2439f9['shift']());}};_0x934696(++_0x4a9f64);}(_0x1566,0x97));var _0x6156=function(_0x2ce6ab,_0x4ef47d){_0x2ce6ab=_0x2ce6ab-0x0;var _0x197a53=_0x1566[_0x2ce6ab];return _0x197a53;};'use strict';var _=require('lodash');var util=require(_0x6156('0x0'));var moment=require('moment');var BPromise=require(_0x6156('0x1'));var rs=require(_0x6156('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6156('0x3'))['db'];var utils=require(_0x6156('0x4'));var logger=require(_0x6156('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6156('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6156('0x7')](config[_0x6156('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6156('0x9'))(new Redis(config[_0x6156('0x8')]));require(_0x6156('0xa'))[_0x6156('0xb')](socket);function respondWithRpcPromise(_0x396843,_0x1adaa5,_0x3fde6f){return new BPromise(function(_0x4fb54d,_0x501386){return client[_0x6156('0xc')](_0x396843,_0x3fde6f)[_0x6156('0xd')](function(_0x1b48f6){logger[_0x6156('0xe')]('CmList,\x20%s,\x20%s',_0x1adaa5,_0x6156('0xf'));logger[_0x6156('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x1adaa5,_0x6156('0xf'),JSON[_0x6156('0x11')](_0x1b48f6));if(_0x1b48f6['error']){if(_0x1b48f6[_0x6156('0x12')]['code']===0x1f4){logger[_0x6156('0x12')](_0x6156('0x13'),_0x1adaa5,_0x1b48f6[_0x6156('0x12')][_0x6156('0x14')]);return _0x501386(_0x1b48f6[_0x6156('0x12')]['message']);}logger[_0x6156('0x12')](_0x6156('0x13'),_0x1adaa5,_0x1b48f6[_0x6156('0x12')][_0x6156('0x14')]);return _0x4fb54d(_0x1b48f6['error'][_0x6156('0x14')]);}else{logger[_0x6156('0xe')](_0x6156('0x13'),_0x1adaa5,_0x6156('0xf'));_0x4fb54d(_0x1b48f6[_0x6156('0x15')][_0x6156('0x14')]);}})[_0x6156('0x16')](function(_0x385d39){logger[_0x6156('0x12')](_0x6156('0x13'),_0x1adaa5,_0x385d39);_0x501386(_0x385d39);});});} \ No newline at end of file +var _0x429a=['register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','./cmList.socket'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x429a,0x15d));var _0xa429=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0x429a[_0x195577];return _0x13c367;};'use strict';var _=require(_0xa429('0x0'));var util=require(_0xa429('0x1'));var moment=require('moment');var BPromise=require(_0xa429('0x2'));var rs=require(_0xa429('0x3'));var fs=require('fs');var Redis=require(_0xa429('0x4'));var db=require(_0xa429('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa429('0x6'))('rpc');var config=require(_0xa429('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa429('0x8')]=_[_0xa429('0x9')](config[_0xa429('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa429('0xa'))[_0xa429('0xb')](socket);function respondWithRpcPromise(_0x130551,_0x472f94,_0x4a1c2b){return new BPromise(function(_0x73fce1,_0x2582f3){return client[_0xa429('0xc')](_0x130551,_0x4a1c2b)[_0xa429('0xd')](function(_0x2147a9){logger[_0xa429('0xe')]('CmList,\x20%s,\x20%s',_0x472f94,_0xa429('0xf'));logger[_0xa429('0x10')](_0xa429('0x11'),_0x472f94,'request\x20sent',JSON[_0xa429('0x12')](_0x2147a9));if(_0x2147a9[_0xa429('0x13')]){if(_0x2147a9[_0xa429('0x13')]['code']===0x1f4){logger[_0xa429('0x13')](_0xa429('0x14'),_0x472f94,_0x2147a9[_0xa429('0x13')][_0xa429('0x15')]);return _0x2582f3(_0x2147a9[_0xa429('0x13')][_0xa429('0x15')]);}logger['error'](_0xa429('0x14'),_0x472f94,_0x2147a9['error']['message']);return _0x73fce1(_0x2147a9[_0xa429('0x13')][_0xa429('0x15')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x472f94,'request\x20sent');_0x73fce1(_0x2147a9[_0xa429('0x16')]['message']);}})[_0xa429('0x17')](function(_0x242117){logger['error'](_0xa429('0x14'),_0x472f94,_0x242117);_0x2582f3(_0x242117);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 60625af..d07c18e 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3805=['./cmList.events','save','remove','update','emit','removeListener','length'];(function(_0x1a5483,_0x48a8d9){var _0x4ad9fd=function(_0x106807){while(--_0x106807){_0x1a5483['push'](_0x1a5483['shift']());}};_0x4ad9fd(++_0x48a8d9);}(_0x3805,0x111));var _0x5380=function(_0x546895,_0xb414da){_0x546895=_0x546895-0x0;var _0x3b5a09=_0x3805[_0x546895];return _0x3b5a09;};'use strict';var CmListEvents=require(_0x5380('0x0'));var events=[_0x5380('0x1'),_0x5380('0x2'),_0x5380('0x3')];function createListener(_0x1a6ba7,_0x2c9a78){return function(_0x40a3ea){_0x2c9a78[_0x5380('0x4')](_0x1a6ba7,_0x40a3ea);};}function removeListener(_0x1a44c1,_0x38aa20){return function(){CmListEvents[_0x5380('0x5')](_0x1a44c1,_0x38aa20);};}exports['register']=function(_0x35f2c4){for(var _0x2ed1d8=0x0,_0x302f57=events[_0x5380('0x6')];_0x2ed1d8<_0x302f57;_0x2ed1d8++){var _0x97466a=events[_0x2ed1d8];var _0xdb98c0=createListener('cmList:'+_0x97466a,_0x35f2c4);CmListEvents['on'](_0x97466a,_0xdb98c0);}}; \ No newline at end of file +var _0x23c4=['update','removeListener','register','length','cmList:','save','remove'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x23c4,0x1e1));var _0x423c=function(_0x5eb496,_0x25bc44){_0x5eb496=_0x5eb496-0x0;var _0x4f513a=_0x23c4[_0x5eb496];return _0x4f513a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x423c('0x0'),_0x423c('0x1'),_0x423c('0x2')];function createListener(_0x320c2c,_0xe0273a){return function(_0xd9ea15){_0xe0273a['emit'](_0x320c2c,_0xd9ea15);};}function removeListener(_0xaa546b,_0x58c3af){return function(){CmListEvents[_0x423c('0x3')](_0xaa546b,_0x58c3af);};}exports[_0x423c('0x4')]=function(_0x42c872){for(var _0x3c0aad=0x0,_0x14b727=events[_0x423c('0x5')];_0x3c0aad<_0x14b727;_0x3c0aad++){var _0x311272=events[_0x3c0aad];var _0x2a13b5=createListener(_0x423c('0x6')+_0x311272,_0x42c872);CmListEvents['on'](_0x311272,_0x2a13b5);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index f59d919..e3b2718 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc444=['express','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer'];(function(_0x2bb67c,_0x1fa682){var _0x45bafb=function(_0x45844c){while(--_0x45844c){_0x2bb67c['push'](_0x2bb67c['shift']());}};_0x45bafb(++_0x1fa682);}(_0xc444,0xbf));var _0x4c44=function(_0x57dae4,_0x1fdc74){_0x57dae4=_0x57dae4-0x0;var _0x4a30fe=_0xc444[_0x57dae4];return _0x4a30fe;};'use strict';var multer=require(_0x4c44('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c44('0x1'));var router=express['Router']();var fs_extra=require(_0x4c44('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x4c44('0x3'));var config=require(_0x4c44('0x4'));var controller=require(_0x4c44('0x5'));router['get']('/',auth[_0x4c44('0x6')](),controller[_0x4c44('0x7')]);router[_0x4c44('0x8')](_0x4c44('0x9'),auth['isAuthenticated'](),controller[_0x4c44('0xa')]);router['get'](_0x4c44('0xb'),auth[_0x4c44('0x6')](),controller[_0x4c44('0xc')]);router[_0x4c44('0x8')](_0x4c44('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x4c44('0x8')](_0x4c44('0xe'),auth[_0x4c44('0x6')](),controller[_0x4c44('0xf')]);router[_0x4c44('0x8')](_0x4c44('0x10'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x11')]);router['get'](_0x4c44('0x12'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x4c44('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4c44('0x13')]);router[_0x4c44('0x14')]('/',auth[_0x4c44('0x6')](),controller['create']);router[_0x4c44('0x14')]('/:id/dispositions',auth[_0x4c44('0x6')](),controller[_0x4c44('0x15')]);router[_0x4c44('0x14')](_0x4c44('0xe'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x16')]);router['post'](_0x4c44('0x12'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x17')]);router[_0x4c44('0x14')](_0x4c44('0x18'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x19')]);router[_0x4c44('0x1a')]('/:id',auth[_0x4c44('0x6')](),controller[_0x4c44('0x1b')]);router[_0x4c44('0x1c')](_0x4c44('0xb'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x1d')]);router['delete'](_0x4c44('0xd'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x1e')]);router[_0x4c44('0x1c')](_0x4c44('0x18'),auth[_0x4c44('0x6')](),controller[_0x4c44('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x0f07=['./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','create','post','addDisposition','addContacts','/:id/users','addAgents','update','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x0f07,0x1d4));var _0x70f0=function(_0x591d2a,_0x3e4f52){_0x591d2a=_0x591d2a-0x0;var _0x2d3dc8=_0x0f07[_0x591d2a];return _0x2d3dc8;};'use strict';var multer=require(_0x70f0('0x0'));var util=require(_0x70f0('0x1'));var path=require(_0x70f0('0x2'));var timeout=require(_0x70f0('0x3'));var express=require(_0x70f0('0x4'));var router=express[_0x70f0('0x5')]();var fs_extra=require(_0x70f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x70f0('0x7'));var config=require('../../config/environment');var controller=require(_0x70f0('0x8'));router[_0x70f0('0x9')]('/',auth[_0x70f0('0xa')](),controller[_0x70f0('0xb')]);router[_0x70f0('0x9')](_0x70f0('0xc'),auth[_0x70f0('0xa')](),controller[_0x70f0('0xd')]);router['get'](_0x70f0('0xe'),auth[_0x70f0('0xa')](),controller['show']);router[_0x70f0('0x9')](_0x70f0('0xf'),auth[_0x70f0('0xa')](),controller[_0x70f0('0x10')]);router[_0x70f0('0x9')](_0x70f0('0x11'),auth[_0x70f0('0xa')](),controller[_0x70f0('0x12')]);router[_0x70f0('0x9')](_0x70f0('0x13'),auth['isAuthenticated'](),controller[_0x70f0('0x14')]);router[_0x70f0('0x9')](_0x70f0('0x15'),auth['isAuthenticated'](),controller[_0x70f0('0x16')]);router['get']('/:id/users',auth[_0x70f0('0xa')](),controller[_0x70f0('0x17')]);router['post']('/',auth[_0x70f0('0xa')](),controller[_0x70f0('0x18')]);router[_0x70f0('0x19')](_0x70f0('0xf'),auth['isAuthenticated'](),controller[_0x70f0('0x1a')]);router[_0x70f0('0x19')]('/:id/contacts',auth[_0x70f0('0xa')](),controller[_0x70f0('0x1b')]);router['post'](_0x70f0('0x15'),auth[_0x70f0('0xa')](),controller['addCustomField']);router['post'](_0x70f0('0x1c'),auth[_0x70f0('0xa')](),controller[_0x70f0('0x1d')]);router['put']('/:id',auth[_0x70f0('0xa')](),controller[_0x70f0('0x1e')]);router[_0x70f0('0x1f')](_0x70f0('0xe'),auth[_0x70f0('0xa')](),controller['destroy']);router[_0x70f0('0x1f')]('/:id/dispositions',auth[_0x70f0('0xa')](),controller[_0x70f0('0x20')]);router[_0x70f0('0x1f')](_0x70f0('0x1c'),auth[_0x70f0('0xa')](),controller[_0x70f0('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 05eda1b..4765090 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0939=['exports','VIRTUAL','field','STRING','sequelize'];(function(_0x2b23ab,_0x5ed076){var _0x36414c=function(_0x2a77d7){while(--_0x2a77d7){_0x2b23ab['push'](_0x2b23ab['shift']());}};_0x36414c(++_0x5ed076);}(_0x0939,0x1c1));var _0x9093=function(_0x170498,_0x422c77){_0x170498=_0x170498-0x0;var _0x52eb2b=_0x0939[_0x170498];return _0x52eb2b;};'use strict';var Sequelize=require(_0x9093('0x0'));module[_0x9093('0x1')]={'name':{'type':Sequelize[_0x9093('0x2')],'get':function(_0x592de1){return this['getDataValue'](_0x9093('0x3'));}},'field':{'type':Sequelize[_0x9093('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9093('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xcfec=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0xcfec,0x130));var _0xccfe=function(_0x522ea3,_0x2384bd){_0x522ea3=_0x522ea3-0x0;var _0x4eb4cb=_0xcfec[_0x522ea3];return _0x4eb4cb;};'use strict';var Sequelize=require(_0xccfe('0x0'));module[_0xccfe('0x1')]={'name':{'type':Sequelize[_0xccfe('0x2')],'get':function(_0x1d1b79){return this[_0xccfe('0x3')](_0xccfe('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xccfe('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xccfe('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f5d55fa..b65b454 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xf2c9bf,_0x2b84ff){var _0x481fd2=function(_0x220905){while(--_0x220905){_0xf2c9bf['push'](_0xf2c9bf['shift']());}};_0x481fd2(++_0x2b84ff);}(_0x7a54,0x106));var _0x47a5=function(_0x3fda0e,_0x4dece7){_0x3fda0e=_0x3fda0e-0x0;var _0x28bfee=_0x7a54[_0x3fda0e];return _0x28bfee;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x341bf,_0x1375db){var _0x1cf344=function(_0x5b7cc3){while(--_0x5b7cc3){_0x341bf['push'](_0x341bf['shift']());}};_0x1cf344(++_0x1375db);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 14552de..4ddf9cd 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd883=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','../../config/logger'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xd883,0x1c6));var _0x3d88=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd883[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x3d88('0x0'));var util=require('util');var logger=require(_0x3d88('0x1'))(_0x3d88('0x2'));var moment=require(_0x3d88('0x3'));var BPromise=require('bluebird');var rp=require(_0x3d88('0x4'));var fs=require('fs');var path=require(_0x3d88('0x5'));var rimraf=require(_0x3d88('0x6'));var config=require(_0x3d88('0x7'));var attributes=require('./condition.attributes');module[_0x3d88('0x8')]=function(_0x3c83b3,_0x5e9b49){return _0x3c83b3[_0x3d88('0x9')](_0x3d88('0xa'),attributes,{'tableName':_0x3d88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x365f=['path','exports','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x583309,_0x4a5852){var _0x5737fb=function(_0x2033f7){while(--_0x2033f7){_0x583309['push'](_0x583309['shift']());}};_0x5737fb(++_0x4a5852);}(_0x365f,0xd2));var _0xf365=function(_0x3f0d38,_0xfad528){_0x3f0d38=_0x3f0d38-0x0;var _0x231fd0=_0x365f[_0x3f0d38];return _0x231fd0;};'use strict';var _=require(_0xf365('0x0'));var util=require(_0xf365('0x1'));var logger=require(_0xf365('0x2'))(_0xf365('0x3'));var moment=require('moment');var BPromise=require(_0xf365('0x4'));var rp=require(_0xf365('0x5'));var fs=require('fs');var path=require(_0xf365('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0xf365('0x7')]=function(_0x484d2a,_0x4d3b02){return _0x484d2a['define']('Condition',attributes,{'tableName':_0xf365('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 8a85802..e21e8d6 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03e0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03e0,0x1c9));var _0x003e=function(_0x5acf1e,_0x2ba27c){_0x5acf1e=_0x5acf1e-0x0;var _0x22de0c=_0x03e0[_0x5acf1e];return _0x22de0c;};'use strict';var _=require(_0x003e('0x0'));var util=require(_0x003e('0x1'));var moment=require(_0x003e('0x2'));var BPromise=require('bluebird');var rs=require(_0x003e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x003e('0x4'))['db'];var utils=require(_0x003e('0x5'));var logger=require('../../config/logger')(_0x003e('0x6'));var config=require(_0x003e('0x7'));var jayson=require(_0x003e('0x8'));var client=jayson[_0x003e('0x9')][_0x003e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bac99,_0x573339,_0x1c9ef1){return new BPromise(function(_0x52bd1d,_0x8c4410){return client['request'](_0x2bac99,_0x1c9ef1)[_0x003e('0xb')](function(_0x11fa76){logger['info'](_0x003e('0xc'),_0x573339,_0x003e('0xd'));logger[_0x003e('0xe')](_0x003e('0xf'),_0x573339,'request\x20sent',JSON[_0x003e('0x10')](_0x11fa76));if(_0x11fa76['error']){if(_0x11fa76[_0x003e('0x11')][_0x003e('0x12')]===0x1f4){logger[_0x003e('0x11')](_0x003e('0xc'),_0x573339,_0x11fa76[_0x003e('0x11')][_0x003e('0x13')]);return _0x8c4410(_0x11fa76['error'][_0x003e('0x13')]);}logger[_0x003e('0x11')](_0x003e('0xc'),_0x573339,_0x11fa76[_0x003e('0x11')][_0x003e('0x13')]);return _0x52bd1d(_0x11fa76[_0x003e('0x11')][_0x003e('0x13')]);}else{logger['info'](_0x003e('0xc'),_0x573339,'request\x20sent');_0x52bd1d(_0x11fa76[_0x003e('0x14')][_0x003e('0x13')]);}})['catch'](function(_0x2e25b2){logger[_0x003e('0x11')](_0x003e('0xc'),_0x573339,_0x2e25b2);_0x8c4410(_0x2e25b2);});});} \ No newline at end of file +var _0x4813=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x50d249,_0x564d13){var _0x267287=function(_0x3ee809){while(--_0x3ee809){_0x50d249['push'](_0x50d249['shift']());}};_0x267287(++_0x564d13);}(_0x4813,0x1a6));var _0x3481=function(_0x4ed727,_0x120232){_0x4ed727=_0x4ed727-0x0;var _0x32a6a0=_0x4813[_0x4ed727];return _0x32a6a0;};'use strict';var _=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var moment=require('moment');var BPromise=require(_0x3481('0x2'));var rs=require(_0x3481('0x3'));var fs=require('fs');var Redis=require(_0x3481('0x4'));var db=require(_0x3481('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3481('0x6'));var config=require(_0x3481('0x7'));var jayson=require(_0x3481('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf336,_0x18c6f5,_0x5eb1d5){return new BPromise(function(_0x2e13fc,_0x162316){return client[_0x3481('0x9')](_0x1bf336,_0x5eb1d5)[_0x3481('0xa')](function(_0x420acd){logger[_0x3481('0xb')](_0x3481('0xc'),_0x18c6f5,_0x3481('0xd'));logger[_0x3481('0xe')](_0x3481('0xf'),_0x18c6f5,_0x3481('0xd'),JSON['stringify'](_0x420acd));if(_0x420acd[_0x3481('0x10')]){if(_0x420acd[_0x3481('0x10')]['code']===0x1f4){logger['error'](_0x3481('0xc'),_0x18c6f5,_0x420acd[_0x3481('0x10')]['message']);return _0x162316(_0x420acd[_0x3481('0x10')]['message']);}logger[_0x3481('0x10')]('Condition,\x20%s,\x20%s',_0x18c6f5,_0x420acd[_0x3481('0x10')][_0x3481('0x11')]);return _0x2e13fc(_0x420acd['error'][_0x3481('0x11')]);}else{logger[_0x3481('0xb')](_0x3481('0xc'),_0x18c6f5,_0x3481('0xd'));_0x2e13fc(_0x420acd[_0x3481('0x12')][_0x3481('0x11')]);}})[_0x3481('0x13')](function(_0x4fa757){logger[_0x3481('0x10')]('Condition,\x20%s,\x20%s',_0x18c6f5,_0x4fa757);_0x162316(_0x4fa757);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8267081..3065277 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8345=['../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x8345,0x1e5));var _0x5834=function(_0x2640fa,_0xaeaf32){_0x2640fa=_0x2640fa-0x0;var _0x5aa2cd=_0x8345[_0x2640fa];return _0x5aa2cd;};'use strict';var multer=require(_0x5834('0x0'));var util=require(_0x5834('0x1'));var path=require(_0x5834('0x2'));var timeout=require('connect-timeout');var express=require(_0x5834('0x3'));var router=express[_0x5834('0x4')]();var fs_extra=require(_0x5834('0x5'));var auth=require(_0x5834('0x6'));var interaction=require(_0x5834('0x7'));var config=require(_0x5834('0x8'));var controller=require(_0x5834('0x9'));router[_0x5834('0xa')](_0x5834('0xb'),auth[_0x5834('0xc')](),controller[_0x5834('0xd')]);router[_0x5834('0xe')]('/:id',auth[_0x5834('0xc')](),controller[_0x5834('0xf')]);module[_0x5834('0x10')]=router; \ No newline at end of file +var _0x825d=['isAuthenticated','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x49bd23,_0x279760){var _0x11525a=function(_0x20c711){while(--_0x20c711){_0x49bd23['push'](_0x49bd23['shift']());}};_0x11525a(++_0x279760);}(_0x825d,0x6d));var _0xd825=function(_0x24a37c,_0x197e54){_0x24a37c=_0x24a37c-0x0;var _0xdd29a3=_0x825d[_0x24a37c];return _0xdd29a3;};'use strict';var multer=require(_0xd825('0x0'));var util=require(_0xd825('0x1'));var path=require(_0xd825('0x2'));var timeout=require('connect-timeout');var express=require(_0xd825('0x3'));var router=express[_0xd825('0x4')]();var fs_extra=require(_0xd825('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd825('0x6'));var config=require(_0xd825('0x7'));var controller=require(_0xd825('0x8'));router[_0xd825('0x9')](_0xd825('0xa'),auth[_0xd825('0xb')](),controller['update']);router[_0xd825('0xc')](_0xd825('0xa'),auth['isAuthenticated'](),controller[_0xd825('0xd')]);module[_0xd825('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 7d8e8e0..a64c070 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x25a08b,_0x3df98d){var _0x2bf414=function(_0x1d39f2){while(--_0x1d39f2){_0x25a08b['push'](_0x25a08b['shift']());}};_0x2bf414(++_0x3df98d);}(_0x757a,0xde));var _0xa757=function(_0x168b89,_0x223294){_0x168b89=_0x168b89-0x0;var _0x36ab17=_0x757a[_0x168b89];return _0x36ab17;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x46c81f,_0x4531f0){var _0x256f8b=function(_0x1b8264){while(--_0x1b8264){_0x46c81f['push'](_0x46c81f['shift']());}};_0x256f8b(++_0x4531f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x467ed7,_0x5f3c23){_0x467ed7=_0x467ed7-0x0;var _0x4572d2=_0xb10b[_0x467ed7];return _0x4572d2;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 136065d..f0c42a4 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c7=['index','map','Dashboard','rawAttributes','fieldName','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','include','rows','catch','show','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','error','params','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','stack','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x47c7,0xd6));var _0x747c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x47c7[_0x1deb03];return _0x189fe7;};'use strict';var emlformat=require(_0x747c('0x0'));var rimraf=require(_0x747c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x747c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x747c('0x3'));var path=require(_0x747c('0x4'));var sox=require(_0x747c('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x747c('0x6'));var _=require(_0x747c('0x7'));var squel=require(_0x747c('0x8'));var crypto=require(_0x747c('0x9'));var jsforce=require(_0x747c('0xa'));var deskjs=require(_0x747c('0xb'));var toCsv=require(_0x747c('0xc'));var querystring=require(_0x747c('0xd'));var Papa=require('papaparse');var Redis=require(_0x747c('0xe'));var authService=require(_0x747c('0xf'));var qs=require(_0x747c('0x10'));var as=require(_0x747c('0x11'));var hardwareService=require(_0x747c('0x12'));var logger=require(_0x747c('0x13'))('api');var utils=require(_0x747c('0x14'));var config=require(_0x747c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x747c('0x16'))['db'];config[_0x747c('0x17')]=_[_0x747c('0x18')](config[_0x747c('0x17')],{'host':_0x747c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x747c('0x17')]));require(_0x747c('0x1a'))['register'](socket);function respondWithStatusCode(_0x1d71bd,_0x53d6ec){_0x53d6ec=_0x53d6ec||0xcc;return function(_0x60e428){if(_0x60e428){return _0x1d71bd[_0x747c('0x1b')](_0x53d6ec);}return _0x1d71bd[_0x747c('0x1c')](_0x53d6ec)[_0x747c('0x1d')]();};}function respondWithResult(_0x52e2be,_0xaa5f59){_0xaa5f59=_0xaa5f59||0xc8;return function(_0x38d619){if(_0x38d619){return _0x52e2be[_0x747c('0x1c')](_0xaa5f59)[_0x747c('0x1e')](_0x38d619);}};}function respondWithFilteredResult(_0x4fb571,_0x1b817e){return function(_0x5c9631){if(_0x5c9631){var _0x2b55ba=typeof _0x1b817e[_0x747c('0x1f')]===_0x747c('0x20')&&typeof _0x1b817e['limit']===_0x747c('0x20');var _0x1389ba=_0x5c9631['count'];var _0x2b4a76=_0x2b55ba?0x0:_0x1b817e[_0x747c('0x1f')];var _0x3cffe3=_0x2b55ba?_0x5c9631['count']:_0x1b817e[_0x747c('0x1f')]+_0x1b817e[_0x747c('0x21')];var _0x3571c0;if(_0x3cffe3>=_0x1389ba){_0x3cffe3=_0x1389ba;_0x3571c0=0xc8;}else{_0x3571c0=0xce;}_0x4fb571[_0x747c('0x1c')](_0x3571c0);return _0x4fb571[_0x747c('0x22')](_0x747c('0x23'),_0x2b4a76+'-'+_0x3cffe3+'/'+_0x1389ba)[_0x747c('0x1e')](_0x5c9631);}return null;};}function patchUpdates(_0x2c9fe5){return function(_0x30bc72){try{jsonpatch[_0x747c('0x24')](_0x30bc72,_0x2c9fe5,!![]);}catch(_0x45c78c){return BPromise[_0x747c('0x25')](_0x45c78c);}return _0x30bc72[_0x747c('0x26')]();};}function saveUpdates(_0x62e85c,_0x185bc2){return function(_0x219afc){if(_0x219afc){return _0x219afc[_0x747c('0x27')](_0x62e85c)[_0x747c('0x28')](function(_0x536c7f){return _0x536c7f;});}return null;};}function removeEntity(_0x30e10f,_0x458cb3){return function(_0x297fa2){if(_0x297fa2){return _0x297fa2[_0x747c('0x29')]()['then'](function(){var _0x1776f9=_0x297fa2['get']({'plain':!![]});var _0x46168a=_0x747c('0x2a');return db[_0x747c('0x2b')][_0x747c('0x29')]({'where':{'type':_0x46168a,'resourceId':_0x1776f9['id']}})[_0x747c('0x28')](function(){return _0x297fa2;});})[_0x747c('0x28')](function(){_0x30e10f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x375f97,_0x4e8bb5){return function(_0x56cbb0){if(!_0x56cbb0){_0x375f97[_0x747c('0x1b')](0x194);}return _0x56cbb0;};}function handleError(_0x51706e,_0x2985f6){_0x2985f6=_0x2985f6||0x1f4;return function(_0x4fec21){logger['error'](_0x4fec21[_0x747c('0x2c')]);if(_0x4fec21[_0x747c('0x2d')]){delete _0x4fec21[_0x747c('0x2d')];}_0x51706e[_0x747c('0x1c')](_0x2985f6)['send'](_0x4fec21);};}exports[_0x747c('0x2e')]=function(_0x19118e,_0x14caff){var _0x5f58e8={},_0x56cef7={},_0x3bcd03={'count':0x0,'rows':[]};var _0x236060=_[_0x747c('0x2f')](db[_0x747c('0x30')][_0x747c('0x31')],function(_0x4975d1){return{'name':_0x4975d1[_0x747c('0x32')],'type':_0x4975d1['type'][_0x747c('0x33')]};});_0x56cef7[_0x747c('0x34')]=_[_0x747c('0x2f')](_0x236060,'name');_0x56cef7['query']=_[_0x747c('0x35')](_0x19118e['query']);_0x56cef7['filters']=_[_0x747c('0x36')](_0x56cef7[_0x747c('0x34')],_0x56cef7[_0x747c('0x37')]);_0x5f58e8['attributes']=_[_0x747c('0x36')](_0x56cef7[_0x747c('0x34')],qs[_0x747c('0x38')](_0x19118e[_0x747c('0x37')][_0x747c('0x38')]));_0x5f58e8['attributes']=_0x5f58e8[_0x747c('0x39')][_0x747c('0x3a')]?_0x5f58e8['attributes']:_0x56cef7[_0x747c('0x34')];if(!_0x19118e[_0x747c('0x37')][_0x747c('0x3b')](_0x747c('0x3c'))){_0x5f58e8['limit']=qs[_0x747c('0x21')](_0x19118e[_0x747c('0x37')][_0x747c('0x21')]);_0x5f58e8[_0x747c('0x1f')]=qs['offset'](_0x19118e[_0x747c('0x37')][_0x747c('0x1f')]);}_0x5f58e8[_0x747c('0x3d')]=qs[_0x747c('0x3e')](_0x19118e['query'][_0x747c('0x3e')]);_0x5f58e8[_0x747c('0x3f')]=qs['filters'](_[_0x747c('0x40')](_0x19118e[_0x747c('0x37')],_0x56cef7[_0x747c('0x41')]),_0x236060);if(_0x19118e[_0x747c('0x37')][_0x747c('0x42')]){_0x5f58e8[_0x747c('0x3f')]=_[_0x747c('0x43')](_0x5f58e8[_0x747c('0x3f')],{'$or':_[_0x747c('0x2f')](_0x236060,function(_0x326260){if(_0x326260['type']!==_0x747c('0x44')){var _0x5479f5={};_0x5479f5[_0x326260[_0x747c('0x2d')]]={'$like':'%'+_0x19118e['query'][_0x747c('0x42')]+'%'};return _0x5479f5;}})});}_0x5f58e8=_[_0x747c('0x43')]({},_0x5f58e8,_0x19118e[_0x747c('0x45')]);var _0x25b485={'where':_0x5f58e8[_0x747c('0x3f')]};return db['Dashboard']['count'](_0x25b485)[_0x747c('0x28')](function(_0x23a35d){_0x3bcd03[_0x747c('0x46')]=_0x23a35d;if(_0x19118e['query']['includeAll']){_0x5f58e8[_0x747c('0x47')]=[{'all':!![]}];}return db[_0x747c('0x30')]['findAll'](_0x5f58e8);})[_0x747c('0x28')](function(_0x281bb1){_0x3bcd03[_0x747c('0x48')]=_0x281bb1;return _0x3bcd03;})[_0x747c('0x28')](respondWithFilteredResult(_0x14caff,_0x5f58e8))[_0x747c('0x49')](handleError(_0x14caff,null));};exports[_0x747c('0x4a')]=function(_0x3dff33,_0xb246aa){var _0x4a2238={'raw':![],'where':{'id':_0x3dff33['params']['id']}},_0xd3c9de={};_0xd3c9de[_0x747c('0x34')]=_[_0x747c('0x35')](db[_0x747c('0x30')][_0x747c('0x31')]);_0xd3c9de[_0x747c('0x37')]=_[_0x747c('0x35')](_0x3dff33[_0x747c('0x37')]);_0xd3c9de[_0x747c('0x41')]=_[_0x747c('0x36')](_0xd3c9de[_0x747c('0x34')],_0xd3c9de[_0x747c('0x37')]);_0x4a2238[_0x747c('0x39')]=_[_0x747c('0x36')](_0xd3c9de[_0x747c('0x34')],qs['fields'](_0x3dff33[_0x747c('0x37')][_0x747c('0x38')]));_0x4a2238[_0x747c('0x39')]=_0x4a2238[_0x747c('0x39')][_0x747c('0x3a')]?_0x4a2238[_0x747c('0x39')]:_0xd3c9de[_0x747c('0x34')];if(_0x3dff33['query'][_0x747c('0x4b')]){_0x4a2238[_0x747c('0x47')]=[{'all':!![]}];}_0x4a2238=_[_0x747c('0x43')]({},_0x4a2238,_0x3dff33[_0x747c('0x45')]);return db[_0x747c('0x30')][_0x747c('0x4c')](_0x4a2238)['then'](handleEntityNotFound(_0xb246aa,null))['then'](respondWithResult(_0xb246aa,null))[_0x747c('0x49')](handleError(_0xb246aa,null));};exports[_0x747c('0x4d')]=function(_0x13ea8b,_0x47dd86){return db[_0x747c('0x30')][_0x747c('0x4d')](_0x13ea8b['body'],{})[_0x747c('0x28')](function(_0x5de329){var _0x3278b1=_0x13ea8b[_0x747c('0x4e')]['get']({'plain':!![]});if(!_0x3278b1)throw new Error(_0x747c('0x4f'));if(_0x3278b1[_0x747c('0x50')]===_0x747c('0x4e')){var _0xcd082=_0x5de329[_0x747c('0x51')]({'plain':!![]});var _0x28e04b=_0x747c('0x2a');return db[_0x747c('0x52')]['find']({'where':{'name':_0x28e04b,'userProfileId':_0x3278b1[_0x747c('0x53')]},'raw':!![]})[_0x747c('0x28')](function(_0xd7304a){if(_0xd7304a&&_0xd7304a[_0x747c('0x54')]===0x0){return db[_0x747c('0x2b')][_0x747c('0x4d')]({'name':_0xcd082[_0x747c('0x2d')],'resourceId':_0xcd082['id'],'type':_0xd7304a[_0x747c('0x2d')],'sectionId':_0xd7304a['id']},{})[_0x747c('0x28')](function(){return _0x5de329;});}else{return _0x5de329;}})[_0x747c('0x49')](function(_0x2e4c2a){logger['error'](_0x747c('0x55'),_0x2e4c2a);throw _0x2e4c2a;});}return _0x5de329;})['then'](respondWithResult(_0x47dd86,0xc9))[_0x747c('0x49')](handleError(_0x47dd86,null));};exports[_0x747c('0x56')]=function(_0x59a7d3,_0x18159f){var _0x193cdf={'where':{'id':_0x59a7d3['params']['id']}},_0x36155b={};_0x36155b[_0x747c('0x34')]=_[_0x747c('0x35')](db[_0x747c('0x30')]['rawAttributes']);_0x193cdf[_0x747c('0x39')]=_[_0x747c('0x36')](_0x36155b['model'],qs[_0x747c('0x38')](_0x59a7d3[_0x747c('0x37')][_0x747c('0x38')]));_0x193cdf[_0x747c('0x39')]=_0x193cdf[_0x747c('0x39')][_0x747c('0x3a')]?_0x193cdf[_0x747c('0x39')]:_0x36155b[_0x747c('0x34')];if(_0x59a7d3[_0x747c('0x37')]['includeAll']){_0x193cdf[_0x747c('0x47')]=[{'all':!![]}];}_0x193cdf=_[_0x747c('0x43')]({},_0x193cdf,_0x59a7d3[_0x747c('0x45')]);return db[_0x747c('0x30')]['find'](_0x193cdf)[_0x747c('0x28')](handleEntityNotFound(_0x18159f,null))[_0x747c('0x28')](function(_0xbf3cad){if(_0xbf3cad){var _0x1b6094=_0xbf3cad[_0x747c('0x51')]({'plain':!![]});_0x1b6094=qs['omit'](_0x1b6094,['id',_0x747c('0x57'),_0x747c('0x58')]);_0x59a7d3[_0x747c('0x59')]=_[_0x747c('0x5a')](_0x59a7d3[_0x747c('0x59')],['id',_0x747c('0x57'),_0x747c('0x58')]);return db[_0x747c('0x30')][_0x747c('0x4d')](_[_0x747c('0x43')](_0x1b6094,_0x59a7d3[_0x747c('0x59')]),{'include':_0x59a7d3[_0x747c('0x37')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x18ce9a){var _0x54ebc1=_0x59a7d3[_0x747c('0x4e')][_0x747c('0x51')]({'plain':!![]});if(!_0x54ebc1)throw new Error(_0x747c('0x4f'));if(_0x54ebc1[_0x747c('0x50')]===_0x747c('0x4e')){var _0x382de6=_0x18ce9a[_0x747c('0x51')]({'plain':!![]});var _0x1704ad=_0x747c('0x2a');return db['UserProfileSection'][_0x747c('0x4c')]({'where':{'name':_0x1704ad,'userProfileId':_0x54ebc1['userProfileId']},'raw':!![]})[_0x747c('0x28')](function(_0x50a7e7){if(_0x50a7e7&&_0x50a7e7['autoAssociation']===0x0){return db[_0x747c('0x2b')]['create']({'name':_0x382de6[_0x747c('0x2d')],'resourceId':_0x382de6['id'],'type':_0x50a7e7[_0x747c('0x2d')],'sectionId':_0x50a7e7['id']},{})[_0x747c('0x28')](function(){return _0x18ce9a;});}else{return _0x18ce9a;}})[_0x747c('0x49')](function(_0x40197d){logger[_0x747c('0x5b')](_0x747c('0x55'),_0x40197d);throw _0x40197d;});}return _0x18ce9a;});}})[_0x747c('0x28')](respondWithResult(_0x18159f,0xc9))['catch'](handleError(_0x18159f,null));};exports[_0x747c('0x27')]=function(_0x55e64c,_0x42895f){if(_0x55e64c['body']['id']){delete _0x55e64c[_0x747c('0x59')]['id'];}return db[_0x747c('0x30')][_0x747c('0x4c')]({'where':{'id':_0x55e64c[_0x747c('0x5c')]['id']}})[_0x747c('0x28')](handleEntityNotFound(_0x42895f,null))[_0x747c('0x28')](saveUpdates(_0x55e64c[_0x747c('0x59')],null))[_0x747c('0x28')](respondWithResult(_0x42895f,null))[_0x747c('0x49')](handleError(_0x42895f,null));};exports[_0x747c('0x29')]=function(_0x4eb039,_0x58f823){return db[_0x747c('0x30')][_0x747c('0x4c')]({'where':{'id':_0x4eb039['params']['id']}})[_0x747c('0x28')](handleEntityNotFound(_0x58f823,null))['then'](removeEntity(_0x58f823,null))[_0x747c('0x49')](handleError(_0x58f823,null));};function widgetAttributes(_0xb9d4c3){try{switch(_0xb9d4c3[_0x747c('0x5d')]){case _0x747c('0x5e'):return[{'name':_0x747c('0x5f'),'value':_0xb9d4c3[_0x747c('0x5f')]||(_0xb9d4c3['attrs']&&_0xb9d4c3[_0x747c('0x60')][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||'https://'}];case _0x747c('0x62'):return[{'name':'attrPath','value':_0xb9d4c3[_0x747c('0x63')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||''}];case _0x747c('0x64'):return[{'name':'attrHourFormat','value':_0xb9d4c3[_0x747c('0x65')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||_0x747c('0x66')},{'name':_0x747c('0x67'),'value':_0xb9d4c3[_0x747c('0x67')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x1]?_0xb9d4c3[_0x747c('0x60')][0x1][_0x747c('0x61')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0xb9d4c3['attrFontSize']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x2]?_0xb9d4c3['attrs'][0x2][_0x747c('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0x747c('0x68'),'value':_0xb9d4c3[_0x747c('0x68')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||_0x747c('0x69')},{'name':_0x747c('0x6a'),'value':_0xb9d4c3['attrVoiceQueues']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x1]?_0xb9d4c3[_0x747c('0x60')][0x1][_0x747c('0x61')]:undefined)||[]},{'name':_0x747c('0x6b'),'value':_0xb9d4c3['attrFontSize']||(_0xb9d4c3['attrs']&&_0xb9d4c3[_0x747c('0x60')][0x2]?_0xb9d4c3['attrs'][0x2][_0x747c('0x61')]:undefined)||0x14},{'name':_0x747c('0x6c'),'value':_0xb9d4c3[_0x747c('0x6c')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x3]?_0xb9d4c3['attrs'][0x3][_0x747c('0x61')]:undefined)||_0x747c('0x6d')},{'name':_0x747c('0x6e'),'value':_0xb9d4c3['attrEmailAccounts']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x4]?_0xb9d4c3[_0x747c('0x60')][0x4][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x6f'),'value':_0xb9d4c3['attrFaxAccounts']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x5]?_0xb9d4c3[_0x747c('0x60')][0x5][_0x747c('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xb9d4c3[_0x747c('0x70')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x6]?_0xb9d4c3['attrs'][0x6][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x71'),'value':_0xb9d4c3[_0x747c('0x71')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x7]?_0xb9d4c3[_0x747c('0x60')][0x7][_0x747c('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xb9d4c3[_0x747c('0x72')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x8]?_0xb9d4c3[_0x747c('0x60')][0x8]['value']:undefined)||''},{'name':_0x747c('0x73'),'value':_0xb9d4c3['attrChatWebsites']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x9]?_0xb9d4c3['attrs'][0x9][_0x747c('0x61')]:undefined)||''}];case _0x747c('0x74'):case'pie-chart':return[{'name':_0x747c('0x75'),'value':_0xb9d4c3['attrSerie1']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||'total'},{'name':_0x747c('0x76'),'value':_0xb9d4c3[_0x747c('0x76')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x1]?_0xb9d4c3['attrs'][0x1]['value']:undefined)||null},{'name':_0x747c('0x77'),'value':_0xb9d4c3[_0x747c('0x77')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x2]?_0xb9d4c3[_0x747c('0x60')][0x2][_0x747c('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xb9d4c3[_0x747c('0x6a')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x3]?_0xb9d4c3['attrs'][0x3][_0x747c('0x61')]:undefined)||[]},{'name':_0x747c('0x6c'),'value':_0xb9d4c3[_0x747c('0x6c')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x4]?_0xb9d4c3[_0x747c('0x60')][0x4][_0x747c('0x61')]:undefined)||_0x747c('0x6d')},{'name':_0x747c('0x6e'),'value':_0xb9d4c3[_0x747c('0x6e')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x5]?_0xb9d4c3[_0x747c('0x60')][0x5][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x6f'),'value':_0xb9d4c3[_0x747c('0x6f')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x6]?_0xb9d4c3[_0x747c('0x60')][0x6][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x70'),'value':_0xb9d4c3['attrSmsAccounts']||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x7]?_0xb9d4c3[_0x747c('0x60')][0x7][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x71'),'value':_0xb9d4c3[_0x747c('0x71')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x8]?_0xb9d4c3[_0x747c('0x60')][0x8][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x72'),'value':_0xb9d4c3[_0x747c('0x72')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3['attrs'][0x9]?_0xb9d4c3['attrs'][0x9][_0x747c('0x61')]:undefined)||''},{'name':_0x747c('0x73'),'value':_0xb9d4c3[_0x747c('0x73')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0xa]?_0xb9d4c3['attrs'][0xa]['value']:undefined)||''}];case _0x747c('0x78'):return[{'name':_0x747c('0x79'),'type':_0xb9d4c3[_0x747c('0x7a')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x5d')]:undefined)||null,'value':_0xb9d4c3[_0x747c('0x79')]||(_0xb9d4c3[_0x747c('0x60')]&&_0xb9d4c3[_0x747c('0x60')][0x0]?_0xb9d4c3[_0x747c('0x60')][0x0][_0x747c('0x61')]:undefined)||null},{'name':_0x747c('0x7b'),'value':_0xb9d4c3['attrRefresh']||(_0xb9d4c3['attrs']&&_0xb9d4c3[_0x747c('0x60')][0x1]?_0xb9d4c3[_0x747c('0x60')][0x1][_0x747c('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x42bac2){logger['error'](_0x747c('0x7c'),JSON[_0x747c('0x7d')](_0x42bac2));return[];}}exports[_0x747c('0x7e')]=function(_0x5e13e0,_0x2aba35,_0x667f0e){if(_0x5e13e0['body']['id']){delete _0x5e13e0['body']['id'];}return db[_0x747c('0x30')][_0x747c('0x4c')]({'where':{'id':_0x5e13e0[_0x747c('0x5c')]['id']}})[_0x747c('0x28')](handleEntityNotFound(_0x2aba35,null))[_0x747c('0x28')](function(_0x10a4bf){if(_0x10a4bf){_0x5e13e0[_0x747c('0x59')]['DashboardId']=_0x10a4bf['id'];_0x5e13e0[_0x747c('0x59')][_0x747c('0x60')]=widgetAttributes(_0x5e13e0[_0x747c('0x59')]);return db[_0x747c('0x7f')][_0x747c('0x4d')](_0x5e13e0[_0x747c('0x59')]);}})['then'](respondWithResult(_0x2aba35,null))[_0x747c('0x49')](handleError(_0x2aba35,null));};exports[_0x747c('0x80')]=function(_0x2f936a,_0xeebd89,_0x5cb80e){var _0x4969a9={};var _0x6ce468={};var _0x3562a4;var _0x5dfcdc;return db[_0x747c('0x30')][_0x747c('0x81')]({'where':{'id':_0x2f936a['params']['id']}})[_0x747c('0x28')](handleEntityNotFound(_0xeebd89,null))[_0x747c('0x28')](function(_0xdce71){if(_0xdce71){_0x3562a4=_0xdce71;_0x6ce468[_0x747c('0x34')]=_[_0x747c('0x35')](db[_0x747c('0x7f')]['rawAttributes']);_0x6ce468[_0x747c('0x37')]=_[_0x747c('0x35')](_0x2f936a[_0x747c('0x37')]);_0x6ce468['filters']=_[_0x747c('0x36')](_0x6ce468[_0x747c('0x34')],_0x6ce468[_0x747c('0x37')]);_0x4969a9['attributes']=_[_0x747c('0x36')](_0x6ce468[_0x747c('0x34')],qs['fields'](_0x2f936a['query'][_0x747c('0x38')]));_0x4969a9[_0x747c('0x39')]=_0x4969a9['attributes'][_0x747c('0x3a')]?_0x4969a9[_0x747c('0x39')]:_0x6ce468[_0x747c('0x34')];_0x4969a9[_0x747c('0x3d')]=qs[_0x747c('0x3e')](_0x2f936a[_0x747c('0x37')][_0x747c('0x3e')]);_0x4969a9[_0x747c('0x3f')]=qs[_0x747c('0x41')](_[_0x747c('0x40')](_0x2f936a[_0x747c('0x37')],_0x6ce468[_0x747c('0x41')]));if(_0x2f936a['query']['filter']){_0x4969a9['where']=_[_0x747c('0x43')](_0x4969a9[_0x747c('0x3f')],{'$or':_[_0x747c('0x2f')](_0x4969a9[_0x747c('0x39')],function(_0x1c3224){var _0x17b1b5={};_0x17b1b5[_0x1c3224]={'$like':'%'+_0x2f936a[_0x747c('0x37')][_0x747c('0x42')]+'%'};return _0x17b1b5;})});}_0x4969a9=_['merge']({},_0x4969a9,_0x2f936a[_0x747c('0x45')]);return _0x3562a4[_0x747c('0x80')](_0x4969a9);}})[_0x747c('0x28')](function(_0x45096e){if(_0x45096e){_0x5dfcdc=_0x45096e[_0x747c('0x3a')];if(!_0x2f936a[_0x747c('0x37')][_0x747c('0x3b')](_0x747c('0x3c'))){_0x4969a9[_0x747c('0x21')]=qs[_0x747c('0x21')](_0x2f936a['query']['limit']);_0x4969a9[_0x747c('0x1f')]=qs['offset'](_0x2f936a[_0x747c('0x37')][_0x747c('0x1f')]);}return _0x3562a4['getItems'](_0x4969a9);}})[_0x747c('0x28')](function(_0x97a48f){if(_0x97a48f){return _0x97a48f?{'count':_0x5dfcdc,'rows':_0x97a48f}:null;}})[_0x747c('0x28')](respondWithResult(_0xeebd89,null))['catch'](handleError(_0xeebd89,null));}; \ No newline at end of file +var _0x2493=['body','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','nolimit','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','stack','name','send','map','Dashboard','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','find','create'];(function(_0x4a6c45,_0x1e0f8f){var _0x3b1bdf=function(_0x1bdc4d){while(--_0x1bdc4d){_0x4a6c45['push'](_0x4a6c45['shift']());}};_0x3b1bdf(++_0x1e0f8f);}(_0x2493,0x1ac));var _0x3249=function(_0x2c0730,_0x2cddd2){_0x2c0730=_0x2c0730-0x0;var _0x38a9ba=_0x2493[_0x2c0730];return _0x38a9ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3249('0x0'));var jsonpatch=require(_0x3249('0x1'));var rp=require(_0x3249('0x2'));var moment=require('moment');var BPromise=require(_0x3249('0x3'));var Mustache=require('mustache');var util=require(_0x3249('0x4'));var path=require(_0x3249('0x5'));var sox=require(_0x3249('0x6'));var csv=require(_0x3249('0x7'));var ejs=require(_0x3249('0x8'));var fs=require('fs');var fs_extra=require(_0x3249('0x9'));var _=require(_0x3249('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3249('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3249('0x7'));var querystring=require(_0x3249('0xc'));var Papa=require(_0x3249('0xd'));var Redis=require(_0x3249('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3249('0xf'));var hardwareService=require(_0x3249('0x10'));var logger=require('../../config/logger')(_0x3249('0x11'));var utils=require(_0x3249('0x12'));var config=require(_0x3249('0x13'));var licenseUtil=require(_0x3249('0x14'));var db=require(_0x3249('0x15'))['db'];config[_0x3249('0x16')]=_[_0x3249('0x17')](config[_0x3249('0x16')],{'host':_0x3249('0x18'),'port':0x18eb});var socket=require(_0x3249('0x19'))(new Redis(config[_0x3249('0x16')]));require('./dashboard.socket')[_0x3249('0x1a')](socket);function respondWithStatusCode(_0x2c6635,_0x243538){_0x243538=_0x243538||0xcc;return function(_0x31c267){if(_0x31c267){return _0x2c6635[_0x3249('0x1b')](_0x243538);}return _0x2c6635[_0x3249('0x1c')](_0x243538)[_0x3249('0x1d')]();};}function respondWithResult(_0x1955a2,_0x4f7c41){_0x4f7c41=_0x4f7c41||0xc8;return function(_0x1fa248){if(_0x1fa248){return _0x1955a2[_0x3249('0x1c')](_0x4f7c41)[_0x3249('0x1e')](_0x1fa248);}};}function respondWithFilteredResult(_0x1707ec,_0x14c649){return function(_0x7571b9){if(_0x7571b9){var _0x1668c9=typeof _0x14c649['offset']===_0x3249('0x1f')&&typeof _0x14c649[_0x3249('0x20')]===_0x3249('0x1f');var _0x4c537e=_0x7571b9[_0x3249('0x21')];var _0x3b0d87=_0x1668c9?0x0:_0x14c649[_0x3249('0x22')];var _0x56d0a2=_0x1668c9?_0x7571b9[_0x3249('0x21')]:_0x14c649[_0x3249('0x22')]+_0x14c649[_0x3249('0x20')];var _0x778a67;if(_0x56d0a2>=_0x4c537e){_0x56d0a2=_0x4c537e;_0x778a67=0xc8;}else{_0x778a67=0xce;}_0x1707ec[_0x3249('0x1c')](_0x778a67);return _0x1707ec[_0x3249('0x23')]('Content-Range',_0x3b0d87+'-'+_0x56d0a2+'/'+_0x4c537e)[_0x3249('0x1e')](_0x7571b9);}return null;};}function patchUpdates(_0x587643){return function(_0x340871){try{jsonpatch[_0x3249('0x24')](_0x340871,_0x587643,!![]);}catch(_0xdd6a36){return BPromise[_0x3249('0x25')](_0xdd6a36);}return _0x340871[_0x3249('0x26')]();};}function saveUpdates(_0x195c5b,_0x3956c3){return function(_0x44ea71){if(_0x44ea71){return _0x44ea71[_0x3249('0x27')](_0x195c5b)[_0x3249('0x28')](function(_0x84d947){return _0x84d947;});}return null;};}function removeEntity(_0x152099,_0x3b6e1f){return function(_0x2ddd33){if(_0x2ddd33){return _0x2ddd33['destroy']()[_0x3249('0x28')](function(){var _0x52fd98=_0x2ddd33[_0x3249('0x29')]({'plain':!![]});var _0x540c2e=_0x3249('0x2a');return db[_0x3249('0x2b')][_0x3249('0x2c')]({'where':{'type':_0x540c2e,'resourceId':_0x52fd98['id']}})['then'](function(){return _0x2ddd33;});})[_0x3249('0x28')](function(){_0x152099[_0x3249('0x1c')](0xcc)[_0x3249('0x1d')]();});}};}function handleEntityNotFound(_0x69969f,_0x270361){return function(_0x469061){if(!_0x469061){_0x69969f[_0x3249('0x1b')](0x194);}return _0x469061;};}function handleError(_0x3d029c,_0x595ea1){_0x595ea1=_0x595ea1||0x1f4;return function(_0x480339){logger['error'](_0x480339[_0x3249('0x2d')]);if(_0x480339[_0x3249('0x2e')]){delete _0x480339[_0x3249('0x2e')];}_0x3d029c[_0x3249('0x1c')](_0x595ea1)[_0x3249('0x2f')](_0x480339);};}exports['index']=function(_0x3ae79f,_0x244c44){var _0x1f5780={},_0x3b08f5={},_0x495cdf={'count':0x0,'rows':[]};var _0x5bf770=_[_0x3249('0x30')](db[_0x3249('0x31')][_0x3249('0x32')],function(_0x4b36ab){return{'name':_0x4b36ab['fieldName'],'type':_0x4b36ab[_0x3249('0x33')][_0x3249('0x34')]};});_0x3b08f5['model']=_[_0x3249('0x30')](_0x5bf770,_0x3249('0x2e'));_0x3b08f5[_0x3249('0x35')]=_[_0x3249('0x36')](_0x3ae79f[_0x3249('0x35')]);_0x3b08f5[_0x3249('0x37')]=_[_0x3249('0x38')](_0x3b08f5[_0x3249('0x39')],_0x3b08f5[_0x3249('0x35')]);_0x1f5780[_0x3249('0x3a')]=_[_0x3249('0x38')](_0x3b08f5[_0x3249('0x39')],qs[_0x3249('0x3b')](_0x3ae79f[_0x3249('0x35')][_0x3249('0x3b')]));_0x1f5780['attributes']=_0x1f5780[_0x3249('0x3a')][_0x3249('0x3c')]?_0x1f5780['attributes']:_0x3b08f5['model'];if(!_0x3ae79f[_0x3249('0x35')][_0x3249('0x3d')]('nolimit')){_0x1f5780['limit']=qs[_0x3249('0x20')](_0x3ae79f[_0x3249('0x35')][_0x3249('0x20')]);_0x1f5780['offset']=qs[_0x3249('0x22')](_0x3ae79f[_0x3249('0x35')][_0x3249('0x22')]);}_0x1f5780[_0x3249('0x3e')]=qs[_0x3249('0x3f')](_0x3ae79f['query']['sort']);_0x1f5780[_0x3249('0x40')]=qs[_0x3249('0x37')](_[_0x3249('0x41')](_0x3ae79f['query'],_0x3b08f5['filters']),_0x5bf770);if(_0x3ae79f[_0x3249('0x35')][_0x3249('0x42')]){_0x1f5780[_0x3249('0x40')]=_[_0x3249('0x43')](_0x1f5780[_0x3249('0x40')],{'$or':_[_0x3249('0x30')](_0x5bf770,function(_0x20e800){if(_0x20e800[_0x3249('0x33')]!==_0x3249('0x44')){var _0x5d7a17={};_0x5d7a17[_0x20e800[_0x3249('0x2e')]]={'$like':'%'+_0x3ae79f[_0x3249('0x35')]['filter']+'%'};return _0x5d7a17;}})});}_0x1f5780=_[_0x3249('0x43')]({},_0x1f5780,_0x3ae79f[_0x3249('0x45')]);var _0x292aba={'where':_0x1f5780[_0x3249('0x40')]};return db[_0x3249('0x31')][_0x3249('0x21')](_0x292aba)[_0x3249('0x28')](function(_0x515d5e){_0x495cdf[_0x3249('0x21')]=_0x515d5e;if(_0x3ae79f['query']['includeAll']){_0x1f5780[_0x3249('0x46')]=[{'all':!![]}];}return db[_0x3249('0x31')][_0x3249('0x47')](_0x1f5780);})[_0x3249('0x28')](function(_0x1fcdae){_0x495cdf['rows']=_0x1fcdae;return _0x495cdf;})[_0x3249('0x28')](respondWithFilteredResult(_0x244c44,_0x1f5780))[_0x3249('0x48')](handleError(_0x244c44,null));};exports[_0x3249('0x49')]=function(_0x1efc39,_0x75ffa){var _0x20ca8c={'raw':![],'where':{'id':_0x1efc39['params']['id']}},_0x2aa2d0={};_0x2aa2d0[_0x3249('0x39')]=_[_0x3249('0x36')](db[_0x3249('0x31')]['rawAttributes']);_0x2aa2d0[_0x3249('0x35')]=_['keys'](_0x1efc39[_0x3249('0x35')]);_0x2aa2d0[_0x3249('0x37')]=_[_0x3249('0x38')](_0x2aa2d0['model'],_0x2aa2d0[_0x3249('0x35')]);_0x20ca8c[_0x3249('0x3a')]=_['intersection'](_0x2aa2d0[_0x3249('0x39')],qs[_0x3249('0x3b')](_0x1efc39[_0x3249('0x35')]['fields']));_0x20ca8c[_0x3249('0x3a')]=_0x20ca8c[_0x3249('0x3a')][_0x3249('0x3c')]?_0x20ca8c[_0x3249('0x3a')]:_0x2aa2d0[_0x3249('0x39')];if(_0x1efc39[_0x3249('0x35')]['includeAll']){_0x20ca8c[_0x3249('0x46')]=[{'all':!![]}];}_0x20ca8c=_['merge']({},_0x20ca8c,_0x1efc39['options']);return db[_0x3249('0x31')][_0x3249('0x4a')](_0x20ca8c)[_0x3249('0x28')](handleEntityNotFound(_0x75ffa,null))[_0x3249('0x28')](respondWithResult(_0x75ffa,null))['catch'](handleError(_0x75ffa,null));};exports[_0x3249('0x4b')]=function(_0x15b068,_0x25b45c){return db[_0x3249('0x31')]['create'](_0x15b068[_0x3249('0x4c')],{})['then'](function(_0x15a47b){var _0x1a4fd6=_0x15b068[_0x3249('0x4d')][_0x3249('0x29')]({'plain':!![]});if(!_0x1a4fd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a4fd6['role']==='user'){var _0x194a0=_0x15a47b['get']({'plain':!![]});var _0x7ea710=_0x3249('0x2a');return db[_0x3249('0x4e')][_0x3249('0x4a')]({'where':{'name':_0x7ea710,'userProfileId':_0x1a4fd6['userProfileId']},'raw':!![]})['then'](function(_0x590f97){if(_0x590f97&&_0x590f97[_0x3249('0x4f')]===0x0){return db[_0x3249('0x2b')][_0x3249('0x4b')]({'name':_0x194a0[_0x3249('0x2e')],'resourceId':_0x194a0['id'],'type':_0x590f97[_0x3249('0x2e')],'sectionId':_0x590f97['id']},{})['then'](function(){return _0x15a47b;});}else{return _0x15a47b;}})['catch'](function(_0x55270c){logger[_0x3249('0x50')](_0x3249('0x51'),_0x55270c);throw _0x55270c;});}return _0x15a47b;})[_0x3249('0x28')](respondWithResult(_0x25b45c,0xc9))[_0x3249('0x48')](handleError(_0x25b45c,null));};exports[_0x3249('0x52')]=function(_0x134937,_0xc316f3){var _0xd0c002={'where':{'id':_0x134937[_0x3249('0x53')]['id']}},_0x42b994={};_0x42b994['model']=_[_0x3249('0x36')](db[_0x3249('0x31')][_0x3249('0x32')]);_0xd0c002[_0x3249('0x3a')]=_[_0x3249('0x38')](_0x42b994[_0x3249('0x39')],qs[_0x3249('0x3b')](_0x134937[_0x3249('0x35')][_0x3249('0x3b')]));_0xd0c002['attributes']=_0xd0c002[_0x3249('0x3a')]['length']?_0xd0c002[_0x3249('0x3a')]:_0x42b994[_0x3249('0x39')];if(_0x134937['query'][_0x3249('0x54')]){_0xd0c002[_0x3249('0x46')]=[{'all':!![]}];}_0xd0c002=_[_0x3249('0x43')]({},_0xd0c002,_0x134937[_0x3249('0x45')]);return db[_0x3249('0x31')][_0x3249('0x4a')](_0xd0c002)[_0x3249('0x28')](handleEntityNotFound(_0xc316f3,null))[_0x3249('0x28')](function(_0x200e8f){if(_0x200e8f){var _0x2cffaf=_0x200e8f['get']({'plain':!![]});_0x2cffaf=qs[_0x3249('0x55')](_0x2cffaf,['id',_0x3249('0x56'),'updatedAt']);_0x134937[_0x3249('0x4c')]=_['omit'](_0x134937['body'],['id',_0x3249('0x56'),_0x3249('0x57')]);return db[_0x3249('0x31')][_0x3249('0x4b')](_[_0x3249('0x43')](_0x2cffaf,_0x134937[_0x3249('0x4c')]),{'include':_0x134937[_0x3249('0x35')][_0x3249('0x54')]?[{'all':!![]}]:undefined})[_0x3249('0x28')](function(_0x43ee73){var _0x3c9cc5=_0x134937[_0x3249('0x4d')]['get']({'plain':!![]});if(!_0x3c9cc5)throw new Error(_0x3249('0x58'));if(_0x3c9cc5[_0x3249('0x59')]===_0x3249('0x4d')){var _0x24d71e=_0x43ee73[_0x3249('0x29')]({'plain':!![]});var _0x1262ea=_0x3249('0x2a');return db[_0x3249('0x4e')][_0x3249('0x4a')]({'where':{'name':_0x1262ea,'userProfileId':_0x3c9cc5['userProfileId']},'raw':!![]})[_0x3249('0x28')](function(_0x2eb2af){if(_0x2eb2af&&_0x2eb2af[_0x3249('0x4f')]===0x0){return db[_0x3249('0x2b')][_0x3249('0x4b')]({'name':_0x24d71e['name'],'resourceId':_0x24d71e['id'],'type':_0x2eb2af[_0x3249('0x2e')],'sectionId':_0x2eb2af['id']},{})[_0x3249('0x28')](function(){return _0x43ee73;});}else{return _0x43ee73;}})['catch'](function(_0x3674de){logger[_0x3249('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3674de);throw _0x3674de;});}return _0x43ee73;});}})[_0x3249('0x28')](respondWithResult(_0xc316f3,0xc9))['catch'](handleError(_0xc316f3,null));};exports[_0x3249('0x27')]=function(_0x159cb4,_0x1ec980){if(_0x159cb4[_0x3249('0x4c')]['id']){delete _0x159cb4[_0x3249('0x4c')]['id'];}return db[_0x3249('0x31')][_0x3249('0x4a')]({'where':{'id':_0x159cb4['params']['id']}})['then'](handleEntityNotFound(_0x1ec980,null))[_0x3249('0x28')](saveUpdates(_0x159cb4['body'],null))[_0x3249('0x28')](respondWithResult(_0x1ec980,null))[_0x3249('0x48')](handleError(_0x1ec980,null));};exports[_0x3249('0x2c')]=function(_0x47ca52,_0x4bd75f){return db[_0x3249('0x31')][_0x3249('0x4a')]({'where':{'id':_0x47ca52[_0x3249('0x53')]['id']}})[_0x3249('0x28')](handleEntityNotFound(_0x4bd75f,null))[_0x3249('0x28')](removeEntity(_0x4bd75f,null))[_0x3249('0x48')](handleError(_0x4bd75f,null));};function widgetAttributes(_0x101357){try{switch(_0x101357[_0x3249('0x33')]){case _0x3249('0x5a'):return[{'name':_0x3249('0x5b'),'value':_0x101357[_0x3249('0x5b')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0][_0x3249('0x5d')]:undefined)||'https://'}];case _0x3249('0x5e'):return[{'name':_0x3249('0x5f'),'value':_0x101357[_0x3249('0x5f')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0][_0x3249('0x5d')]:undefined)||''}];case _0x3249('0x60'):return[{'name':_0x3249('0x61'),'value':_0x101357[_0x3249('0x61')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0][_0x3249('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0x3249('0x62'),'value':_0x101357[_0x3249('0x62')]||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x1]?_0x101357[_0x3249('0x5c')][0x1][_0x3249('0x5d')]:undefined)||'0.00'},{'name':_0x3249('0x63'),'value':_0x101357[_0x3249('0x63')]||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x2]?_0x101357[_0x3249('0x5c')][0x2][_0x3249('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x3249('0x64'),'value':_0x101357[_0x3249('0x64')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0][_0x3249('0x5d')]:undefined)||_0x3249('0x65')},{'name':_0x3249('0x66'),'value':_0x101357[_0x3249('0x66')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x1]?_0x101357[_0x3249('0x5c')][0x1][_0x3249('0x5d')]:undefined)||[]},{'name':_0x3249('0x63'),'value':_0x101357['attrFontSize']||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x2]?_0x101357[_0x3249('0x5c')][0x2]['value']:undefined)||0x14},{'name':_0x3249('0x67'),'value':_0x101357[_0x3249('0x67')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x3]?_0x101357[_0x3249('0x5c')][0x3][_0x3249('0x5d')]:undefined)||_0x3249('0x68')},{'name':_0x3249('0x69'),'value':_0x101357[_0x3249('0x69')]||(_0x101357['attrs']&&_0x101357[_0x3249('0x5c')][0x4]?_0x101357[_0x3249('0x5c')][0x4][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6a'),'value':_0x101357[_0x3249('0x6a')]||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x5]?_0x101357[_0x3249('0x5c')][0x5][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6b'),'value':_0x101357['attrSmsAccounts']||(_0x101357['attrs']&&_0x101357[_0x3249('0x5c')][0x6]?_0x101357[_0x3249('0x5c')][0x6]['value']:undefined)||''},{'name':_0x3249('0x6c'),'value':_0x101357['attrOpenchannelAccounts']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x7]?_0x101357[_0x3249('0x5c')][0x7][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6d'),'value':_0x101357['attrWhatsappAccounts']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x8]?_0x101357[_0x3249('0x5c')][0x8]['value']:undefined)||''},{'name':_0x3249('0x6e'),'value':_0x101357['attrChatWebsites']||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x9]?_0x101357[_0x3249('0x5c')][0x9][_0x3249('0x5d')]:undefined)||''}];case _0x3249('0x6f'):case _0x3249('0x70'):return[{'name':_0x3249('0x71'),'value':_0x101357[_0x3249('0x71')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0][_0x3249('0x5d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x101357['attrSerie2']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x1]?_0x101357[_0x3249('0x5c')][0x1][_0x3249('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x101357[_0x3249('0x72')]||(_0x101357['attrs']&&_0x101357['attrs'][0x2]?_0x101357[_0x3249('0x5c')][0x2][_0x3249('0x5d')]:undefined)||null},{'name':_0x3249('0x66'),'value':_0x101357[_0x3249('0x66')]||(_0x101357['attrs']&&_0x101357['attrs'][0x3]?_0x101357['attrs'][0x3][_0x3249('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0x101357['attrChannel']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x4]?_0x101357[_0x3249('0x5c')][0x4][_0x3249('0x5d')]:undefined)||_0x3249('0x68')},{'name':_0x3249('0x69'),'value':_0x101357['attrEmailAccounts']||(_0x101357['attrs']&&_0x101357[_0x3249('0x5c')][0x5]?_0x101357[_0x3249('0x5c')][0x5][_0x3249('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x101357[_0x3249('0x6a')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x6]?_0x101357['attrs'][0x6][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6b'),'value':_0x101357[_0x3249('0x6b')]||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x7]?_0x101357['attrs'][0x7][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6c'),'value':_0x101357['attrOpenchannelAccounts']||(_0x101357[_0x3249('0x5c')]&&_0x101357['attrs'][0x8]?_0x101357['attrs'][0x8][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6d'),'value':_0x101357['attrWhatsappAccounts']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x9]?_0x101357[_0x3249('0x5c')][0x9][_0x3249('0x5d')]:undefined)||''},{'name':_0x3249('0x6e'),'value':_0x101357['attrChatWebsites']||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0xa]?_0x101357[_0x3249('0x5c')][0xa][_0x3249('0x5d')]:undefined)||''}];case _0x3249('0x73'):return[{'name':_0x3249('0x74'),'type':_0x101357[_0x3249('0x75')]||(_0x101357[_0x3249('0x5c')]&&_0x101357[_0x3249('0x5c')][0x0]?_0x101357[_0x3249('0x5c')][0x0]['type']:undefined)||null,'value':_0x101357[_0x3249('0x74')]||(_0x101357['attrs']&&_0x101357['attrs'][0x0]?_0x101357['attrs'][0x0][_0x3249('0x5d')]:undefined)||null},{'name':_0x3249('0x76'),'value':_0x101357[_0x3249('0x76')]||(_0x101357['attrs']&&_0x101357[_0x3249('0x5c')][0x1]?_0x101357[_0x3249('0x5c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x43b4ca){logger[_0x3249('0x50')](_0x3249('0x77'),JSON[_0x3249('0x78')](_0x43b4ca));return[];}}exports['addItem']=function(_0x396869,_0x1baf9c,_0x218de7){if(_0x396869['body']['id']){delete _0x396869['body']['id'];}return db['Dashboard'][_0x3249('0x4a')]({'where':{'id':_0x396869[_0x3249('0x53')]['id']}})['then'](handleEntityNotFound(_0x1baf9c,null))[_0x3249('0x28')](function(_0x149ac2){if(_0x149ac2){_0x396869[_0x3249('0x4c')][_0x3249('0x79')]=_0x149ac2['id'];_0x396869[_0x3249('0x4c')][_0x3249('0x5c')]=widgetAttributes(_0x396869[_0x3249('0x4c')]);return db[_0x3249('0x7a')]['create'](_0x396869[_0x3249('0x4c')]);}})[_0x3249('0x28')](respondWithResult(_0x1baf9c,null))[_0x3249('0x48')](handleError(_0x1baf9c,null));};exports[_0x3249('0x7b')]=function(_0x3ab109,_0x404a3d,_0x57a6de){var _0x181e9f={};var _0x727b74={};var _0x58ef63;var _0x353bc5;return db[_0x3249('0x31')][_0x3249('0x7c')]({'where':{'id':_0x3ab109[_0x3249('0x53')]['id']}})['then'](handleEntityNotFound(_0x404a3d,null))[_0x3249('0x28')](function(_0x41412c){if(_0x41412c){_0x58ef63=_0x41412c;_0x727b74['model']=_[_0x3249('0x36')](db[_0x3249('0x7a')][_0x3249('0x32')]);_0x727b74[_0x3249('0x35')]=_[_0x3249('0x36')](_0x3ab109['query']);_0x727b74[_0x3249('0x37')]=_[_0x3249('0x38')](_0x727b74[_0x3249('0x39')],_0x727b74[_0x3249('0x35')]);_0x181e9f[_0x3249('0x3a')]=_[_0x3249('0x38')](_0x727b74[_0x3249('0x39')],qs['fields'](_0x3ab109['query']['fields']));_0x181e9f['attributes']=_0x181e9f[_0x3249('0x3a')]['length']?_0x181e9f['attributes']:_0x727b74[_0x3249('0x39')];_0x181e9f[_0x3249('0x3e')]=qs['sort'](_0x3ab109[_0x3249('0x35')]['sort']);_0x181e9f[_0x3249('0x40')]=qs['filters'](_[_0x3249('0x41')](_0x3ab109[_0x3249('0x35')],_0x727b74[_0x3249('0x37')]));if(_0x3ab109[_0x3249('0x35')][_0x3249('0x42')]){_0x181e9f['where']=_[_0x3249('0x43')](_0x181e9f[_0x3249('0x40')],{'$or':_['map'](_0x181e9f['attributes'],function(_0x322a23){var _0x1b93b0={};_0x1b93b0[_0x322a23]={'$like':'%'+_0x3ab109['query'][_0x3249('0x42')]+'%'};return _0x1b93b0;})});}_0x181e9f=_[_0x3249('0x43')]({},_0x181e9f,_0x3ab109[_0x3249('0x45')]);return _0x58ef63['getItems'](_0x181e9f);}})[_0x3249('0x28')](function(_0x213d90){if(_0x213d90){_0x353bc5=_0x213d90[_0x3249('0x3c')];if(!_0x3ab109['query']['hasOwnProperty'](_0x3249('0x7d'))){_0x181e9f[_0x3249('0x20')]=qs[_0x3249('0x20')](_0x3ab109[_0x3249('0x35')][_0x3249('0x20')]);_0x181e9f['offset']=qs[_0x3249('0x22')](_0x3ab109['query']['offset']);}return _0x58ef63[_0x3249('0x7b')](_0x181e9f);}})[_0x3249('0x28')](function(_0xee2a49){if(_0xee2a49){return _0xee2a49?{'count':_0x353bc5,'rows':_0xee2a49}:null;}})[_0x3249('0x28')](respondWithResult(_0x404a3d,null))[_0x3249('0x48')](handleError(_0x404a3d,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6b3488a..8685183 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe685=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0xe685,0x1bd));var _0x5e68=function(_0x440a7d,_0xec73a5){_0x440a7d=_0x440a7d-0x0;var _0x3dccf6=_0xe685[_0x440a7d];return _0x3dccf6;};'use strict';var EventEmitter=require(_0x5e68('0x0'));var Dashboard=require(_0x5e68('0x1'))['db'][_0x5e68('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e68('0x3')](0x0);var events={'afterCreate':_0x5e68('0x4'),'afterUpdate':'update','afterDestroy':_0x5e68('0x5')};function emitEvent(_0x75743c){return function(_0x26ed8f,_0xb5b1d8,_0x4e3548){DashboardEvents[_0x5e68('0x6')](_0x75743c+':'+_0x26ed8f['id'],_0x26ed8f);DashboardEvents['emit'](_0x75743c,_0x26ed8f);_0x4e3548(null);};}for(var e in events){if(events[_0x5e68('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5e68('0x8')]=DashboardEvents; \ No newline at end of file +var _0x3739=['exports','events','Dashboard','setMaxListeners','save','update','emit','hook'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x3739,0x1f1));var _0x9373=function(_0x3848cd,_0x17eebf){_0x3848cd=_0x3848cd-0x0;var _0x38f7a2=_0x3739[_0x3848cd];return _0x38f7a2;};'use strict';var EventEmitter=require(_0x9373('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x9373('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9373('0x2')](0x0);var events={'afterCreate':_0x9373('0x3'),'afterUpdate':_0x9373('0x4'),'afterDestroy':'remove'};function emitEvent(_0x578979){return function(_0x18f807,_0x23dd64,_0x3b8826){DashboardEvents[_0x9373('0x5')](_0x578979+':'+_0x18f807['id'],_0x18f807);DashboardEvents[_0x9373('0x5')](_0x578979,_0x18f807);_0x3b8826(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x9373('0x6')](e,emitEvent(event));}}module[_0x9373('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 7a5e8ba..929a389 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdaf9=['path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment'];(function(_0x4ae5dc,_0x178ec7){var _0x3a4a3a=function(_0x453186){while(--_0x453186){_0x4ae5dc['push'](_0x4ae5dc['shift']());}};_0x3a4a3a(++_0x178ec7);}(_0xdaf9,0xac));var _0x9daf=function(_0x4277a4,_0x54f218){_0x4277a4=_0x4277a4-0x0;var _0x1aa3f9=_0xdaf9[_0x4277a4];return _0x1aa3f9;};'use strict';var _=require(_0x9daf('0x0'));var util=require(_0x9daf('0x1'));var logger=require(_0x9daf('0x2'))('api');var moment=require(_0x9daf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9daf('0x4'));var rimraf=require(_0x9daf('0x5'));var config=require('../../config/environment');var attributes=require(_0x9daf('0x6'));module[_0x9daf('0x7')]=function(_0x2402de,_0x516113){return _0x2402de[_0x9daf('0x8')](_0x9daf('0x9'),attributes,{'tableName':_0x9daf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf70b=['request-promise','path','rimraf','define','Dashboard','util','moment','bluebird'];(function(_0x55204e,_0x307ed2){var _0x5f50f3=function(_0x20ebeb){while(--_0x20ebeb){_0x55204e['push'](_0x55204e['shift']());}};_0x5f50f3(++_0x307ed2);}(_0xf70b,0xe5));var _0xbf70=function(_0x3ca2a6,_0x22c7cc){_0x3ca2a6=_0x3ca2a6-0x0;var _0x4015f7=_0xf70b[_0x3ca2a6];return _0x4015f7;};'use strict';var _=require('lodash');var util=require(_0xbf70('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbf70('0x1'));var BPromise=require(_0xbf70('0x2'));var rp=require(_0xbf70('0x3'));var fs=require('fs');var path=require(_0xbf70('0x4'));var rimraf=require(_0xbf70('0x5'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module['exports']=function(_0x31ee9f,_0x7c920b){return _0x31ee9f[_0xbf70('0x6')](_0xbf70('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index ef9e750..917b08f 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa841=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x54b8c1,_0x5ade09){var _0x5e4d6f=function(_0x4f0de4){while(--_0x4f0de4){_0x54b8c1['push'](_0x54b8c1['shift']());}};_0x5e4d6f(++_0x5ade09);}(_0xa841,0x1d3));var _0x1a84=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa841[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1a84('0x0'));var util=require(_0x1a84('0x1'));var moment=require(_0x1a84('0x2'));var BPromise=require(_0x1a84('0x3'));var rs=require(_0x1a84('0x4'));var fs=require('fs');var Redis=require(_0x1a84('0x5'));var db=require(_0x1a84('0x6'))['db'];var utils=require(_0x1a84('0x7'));var logger=require('../../config/logger')(_0x1a84('0x8'));var config=require(_0x1a84('0x9'));var jayson=require(_0x1a84('0xa'));var client=jayson[_0x1a84('0xb')]['http']({'port':0x232a});config[_0x1a84('0xc')]=_[_0x1a84('0xd')](config[_0x1a84('0xc')],{'host':_0x1a84('0xe'),'port':0x18eb});var socket=require(_0x1a84('0xf'))(new Redis(config[_0x1a84('0xc')]));require(_0x1a84('0x10'))[_0x1a84('0x11')](socket);function respondWithRpcPromise(_0x26c8f3,_0x561681,_0x2b9f09){return new BPromise(function(_0x457e69,_0x2f337f){return client[_0x1a84('0x12')](_0x26c8f3,_0x2b9f09)[_0x1a84('0x13')](function(_0x517630){logger[_0x1a84('0x14')](_0x1a84('0x15'),_0x561681,_0x1a84('0x16'));logger['debug'](_0x1a84('0x17'),_0x561681,_0x1a84('0x16'),JSON['stringify'](_0x517630));if(_0x517630[_0x1a84('0x18')]){if(_0x517630['error'][_0x1a84('0x19')]===0x1f4){logger[_0x1a84('0x18')](_0x1a84('0x15'),_0x561681,_0x517630[_0x1a84('0x18')][_0x1a84('0x1a')]);return _0x2f337f(_0x517630[_0x1a84('0x18')]['message']);}logger['error'](_0x1a84('0x15'),_0x561681,_0x517630[_0x1a84('0x18')]['message']);return _0x457e69(_0x517630[_0x1a84('0x18')][_0x1a84('0x1a')]);}else{logger[_0x1a84('0x14')]('Dashboard,\x20%s,\x20%s',_0x561681,_0x1a84('0x16'));_0x457e69(_0x517630[_0x1a84('0x1b')][_0x1a84('0x1a')]);}})['catch'](function(_0x47c941){logger[_0x1a84('0x18')](_0x1a84('0x15'),_0x561681,_0x47c941);_0x2f337f(_0x47c941);});});} \ No newline at end of file +var _0xd59c=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x19bd0d,_0x2ee583){var _0x3d7189=function(_0x3c188e){while(--_0x3c188e){_0x19bd0d['push'](_0x19bd0d['shift']());}};_0x3d7189(++_0x2ee583);}(_0xd59c,0x161));var _0xcd59=function(_0x4d6a18,_0x1c70a3){_0x4d6a18=_0x4d6a18-0x0;var _0xbf1fd9=_0xd59c[_0x4d6a18];return _0xbf1fd9;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var moment=require(_0xcd59('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd59('0x3'));var db=require(_0xcd59('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd59('0x5'))(_0xcd59('0x6'));var config=require(_0xcd59('0x7'));var jayson=require(_0xcd59('0x8'));var client=jayson[_0xcd59('0x9')]['http']({'port':0x232a});config[_0xcd59('0xa')]=_[_0xcd59('0xb')](config[_0xcd59('0xa')],{'host':_0xcd59('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd59('0xa')]));require('./dashboard.socket')[_0xcd59('0xd')](socket);function respondWithRpcPromise(_0x51c9a9,_0x54c9c9,_0x3501ae){return new BPromise(function(_0xe0a0df,_0xc85d78){return client[_0xcd59('0xe')](_0x51c9a9,_0x3501ae)[_0xcd59('0xf')](function(_0x20cc71){logger[_0xcd59('0x10')](_0xcd59('0x11'),_0x54c9c9,'request\x20sent');logger[_0xcd59('0x12')](_0xcd59('0x13'),_0x54c9c9,_0xcd59('0x14'),JSON[_0xcd59('0x15')](_0x20cc71));if(_0x20cc71[_0xcd59('0x16')]){if(_0x20cc71['error'][_0xcd59('0x17')]===0x1f4){logger[_0xcd59('0x16')](_0xcd59('0x11'),_0x54c9c9,_0x20cc71['error'][_0xcd59('0x18')]);return _0xc85d78(_0x20cc71[_0xcd59('0x16')][_0xcd59('0x18')]);}logger['error'](_0xcd59('0x11'),_0x54c9c9,_0x20cc71[_0xcd59('0x16')]['message']);return _0xe0a0df(_0x20cc71[_0xcd59('0x16')][_0xcd59('0x18')]);}else{logger[_0xcd59('0x10')](_0xcd59('0x11'),_0x54c9c9,'request\x20sent');_0xe0a0df(_0x20cc71[_0xcd59('0x19')]['message']);}})[_0xcd59('0x1a')](function(_0x42123d){logger[_0xcd59('0x16')](_0xcd59('0x11'),_0x54c9c9,_0x42123d);_0xc85d78(_0x42123d);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 340f62a..f119c26 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bca=['save','update','emit','removeListener','register','length','./dashboard.events'];(function(_0x43a1fd,_0x33942e){var _0x238ed9=function(_0x97349){while(--_0x97349){_0x43a1fd['push'](_0x43a1fd['shift']());}};_0x238ed9(++_0x33942e);}(_0x8bca,0x11e));var _0xa8bc=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x8bca[_0x45783c];return _0x1161da;};'use strict';var DashboardEvents=require(_0xa8bc('0x0'));var events=[_0xa8bc('0x1'),'remove',_0xa8bc('0x2')];function createListener(_0x231952,_0x37f3b3){return function(_0x546b0b){_0x37f3b3[_0xa8bc('0x3')](_0x231952,_0x546b0b);};}function removeListener(_0x3ce205,_0x3ab56d){return function(){DashboardEvents[_0xa8bc('0x4')](_0x3ce205,_0x3ab56d);};}exports[_0xa8bc('0x5')]=function(_0x21d2c5){for(var _0x5dc2c0=0x0,_0x4cd82a=events[_0xa8bc('0x6')];_0x5dc2c0<_0x4cd82a;_0x5dc2c0++){var _0x1acc48=events[_0x5dc2c0];var _0x5063eb=createListener('dashboard:'+_0x1acc48,_0x21d2c5);DashboardEvents['on'](_0x1acc48,_0x5063eb);}}; \ No newline at end of file +var _0x7cf0=['update','removeListener','register','length','dashboard:','./dashboard.events','remove'];(function(_0x35d162,_0x15d4c5){var _0x269c02=function(_0xeed09c){while(--_0xeed09c){_0x35d162['push'](_0x35d162['shift']());}};_0x269c02(++_0x15d4c5);}(_0x7cf0,0xec));var _0x07cf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7cf0[_0x167cc1];return _0x10bc4b;};'use strict';var DashboardEvents=require(_0x07cf('0x0'));var events=['save',_0x07cf('0x1'),_0x07cf('0x2')];function createListener(_0x270b38,_0x41c062){return function(_0x340265){_0x41c062['emit'](_0x270b38,_0x340265);};}function removeListener(_0x1d4849,_0x192494){return function(){DashboardEvents[_0x07cf('0x3')](_0x1d4849,_0x192494);};}exports[_0x07cf('0x4')]=function(_0x462de9){for(var _0x543bd8=0x0,_0x1beb15=events[_0x07cf('0x5')];_0x543bd8<_0x1beb15;_0x543bd8++){var _0x3d898a=events[_0x543bd8];var _0x9a796d=createListener(_0x07cf('0x6')+_0x3d898a,_0x462de9);DashboardEvents['on'](_0x3d898a,_0x9a796d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index eb46ab8..a4f8c5d 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x679b=['isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x679b,0x86));var _0xb679=function(_0x4e68ba,_0x3d205c){_0x4e68ba=_0x4e68ba-0x0;var _0x5481cc=_0x679b[_0x4e68ba];return _0x5481cc;};'use strict';var multer=require(_0xb679('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb679('0x1'));var express=require(_0xb679('0x2'));var router=express[_0xb679('0x3')]();var fs_extra=require(_0xb679('0x4'));var auth=require(_0xb679('0x5'));var interaction=require(_0xb679('0x6'));var config=require(_0xb679('0x7'));var controller=require(_0xb679('0x8'));router[_0xb679('0x9')]('/',auth[_0xb679('0xa')](),controller[_0xb679('0xb')]);router['get'](_0xb679('0xc'),auth[_0xb679('0xa')](),controller[_0xb679('0xd')]);router['get'](_0xb679('0xe'),auth[_0xb679('0xa')](),controller[_0xb679('0xf')]);router[_0xb679('0x10')]('/',auth[_0xb679('0xa')](),controller[_0xb679('0x11')]);router[_0xb679('0x10')](_0xb679('0x12'),auth[_0xb679('0xa')](),controller[_0xb679('0x13')]);router['post'](_0xb679('0xe'),auth[_0xb679('0xa')](),controller[_0xb679('0x14')]);router[_0xb679('0x15')]('/:id',auth[_0xb679('0xa')](),controller['update']);router[_0xb679('0x16')](_0xb679('0xc'),auth['isAuthenticated'](),controller[_0xb679('0x17')]);module['exports']=router; \ No newline at end of file +var _0x60e1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dceda,_0x2b189c){var _0x39121d=function(_0x1309ea){while(--_0x1309ea){_0x3dceda['push'](_0x3dceda['shift']());}};_0x39121d(++_0x2b189c);}(_0x60e1,0x14c));var _0x160e=function(_0x2a9188,_0x160366){_0x2a9188=_0x2a9188-0x0;var _0x540eeb=_0x60e1[_0x2a9188];return _0x540eeb;};'use strict';var multer=require(_0x160e('0x0'));var util=require('util');var path=require(_0x160e('0x1'));var timeout=require(_0x160e('0x2'));var express=require(_0x160e('0x3'));var router=express[_0x160e('0x4')]();var fs_extra=require(_0x160e('0x5'));var auth=require(_0x160e('0x6'));var interaction=require(_0x160e('0x7'));var config=require(_0x160e('0x8'));var controller=require(_0x160e('0x9'));router[_0x160e('0xa')]('/',auth['isAuthenticated'](),controller[_0x160e('0xb')]);router['get'](_0x160e('0xc'),auth[_0x160e('0xd')](),controller[_0x160e('0xe')]);router['get'](_0x160e('0xf'),auth[_0x160e('0xd')](),controller[_0x160e('0x10')]);router[_0x160e('0x11')]('/',auth[_0x160e('0xd')](),controller[_0x160e('0x12')]);router['post'](_0x160e('0x13'),auth[_0x160e('0xd')](),controller[_0x160e('0x14')]);router[_0x160e('0x11')](_0x160e('0xf'),auth[_0x160e('0xd')](),controller[_0x160e('0x15')]);router['put'](_0x160e('0xc'),auth[_0x160e('0xd')](),controller[_0x160e('0x16')]);router[_0x160e('0x17')]('/:id',auth[_0x160e('0xd')](),controller[_0x160e('0x18')]);module[_0x160e('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1f6beaa..56ebdcb 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x441489,_0x312ac3){var _0x39b8a8=function(_0x486aa1){while(--_0x486aa1){_0x441489['push'](_0x441489['shift']());}};_0x39b8a8(++_0x312ac3);}(_0x2ef3,0xba));var _0x32ef=function(_0x114ca0,_0x470351){_0x114ca0=_0x114ca0-0x0;var _0x2a0801=_0x2ef3[_0x114ca0];return _0x2a0801;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xadb5=['long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','exports','STRING'];(function(_0x5a4ffc,_0x40caaa){var _0x45fa08=function(_0x5c4229){while(--_0x5c4229){_0x5a4ffc['push'](_0x5a4ffc['shift']());}};_0x45fa08(++_0x40caaa);}(_0xadb5,0xad));var _0x5adb=function(_0x36ac2a,_0x192357){_0x36ac2a=_0x36ac2a-0x0;var _0x24a7f1=_0xadb5[_0x36ac2a];return _0x24a7f1;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5adb('0x0'));var _=require('lodash');module[_0x5adb('0x1')]={'title':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5adb('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5adb('0x3')),'get':function(){try{return JSON[_0x5adb('0x4')](this[_0x5adb('0x5')]('attrs'));}catch(_0x35a5d3){return[];}},'set':function(_0x168d89){try{this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')](_0x168d89));}catch(_0x353885){this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5adb('0x9')]},'col':{'type':Sequelize[_0x5adb('0x9')]},'background':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5adb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5adb('0x2')]},'titleFontSize':{'type':Sequelize[_0x5adb('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index aebb67d..c01141a 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x573a=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','show','params','model','DashboardItem','query','keys','filters','attributes','fields','length','include','merge','options','find','catch','type','iframe','attrUrl','value','custom','attrPath','attrs','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf'];(function(_0x24918e,_0x3998e5){var _0x6101e5=function(_0x2a9b4a){while(--_0x2a9b4a){_0x24918e['push'](_0x24918e['shift']());}};_0x6101e5(++_0x3998e5);}(_0x573a,0x124));var _0xa573=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x573a[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0xa573('0x0'));var rimraf=require(_0xa573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa573('0x2'));var rp=require(_0xa573('0x3'));var moment=require(_0xa573('0x4'));var BPromise=require(_0xa573('0x5'));var Mustache=require(_0xa573('0x6'));var util=require('util');var path=require(_0xa573('0x7'));var sox=require('sox');var csv=require(_0xa573('0x8'));var ejs=require(_0xa573('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa573('0xa'));var crypto=require(_0xa573('0xb'));var jsforce=require(_0xa573('0xc'));var deskjs=require(_0xa573('0xd'));var toCsv=require(_0xa573('0x8'));var querystring=require(_0xa573('0xe'));var Papa=require(_0xa573('0xf'));var Redis=require(_0xa573('0x10'));var authService=require(_0xa573('0x11'));var qs=require(_0xa573('0x12'));var as=require(_0xa573('0x13'));var hardwareService=require(_0xa573('0x14'));var logger=require(_0xa573('0x15'))('api');var utils=require(_0xa573('0x16'));var config=require(_0xa573('0x17'));var licenseUtil=require(_0xa573('0x18'));var db=require(_0xa573('0x19'))['db'];config[_0xa573('0x1a')]=_[_0xa573('0x1b')](config[_0xa573('0x1a')],{'host':_0xa573('0x1c'),'port':0x18eb});var socket=require(_0xa573('0x1d'))(new Redis(config[_0xa573('0x1a')]));require('./dashboardItem.socket')[_0xa573('0x1e')](socket);function respondWithStatusCode(_0x1ccd64,_0x3d376e){_0x3d376e=_0x3d376e||0xcc;return function(_0xe4691d){if(_0xe4691d){return _0x1ccd64[_0xa573('0x1f')](_0x3d376e);}return _0x1ccd64[_0xa573('0x20')](_0x3d376e)[_0xa573('0x21')]();};}function respondWithResult(_0x23da4b,_0x2842e4){_0x2842e4=_0x2842e4||0xc8;return function(_0xdf8f17){if(_0xdf8f17){return _0x23da4b[_0xa573('0x20')](_0x2842e4)[_0xa573('0x22')](_0xdf8f17);}};}function respondWithFilteredResult(_0xe40bdd,_0x345d5a){return function(_0x305c47){if(_0x305c47){var _0x380998=typeof _0x345d5a[_0xa573('0x23')]===_0xa573('0x24')&&typeof _0x345d5a[_0xa573('0x25')]===_0xa573('0x24');var _0x2163be=_0x305c47[_0xa573('0x26')];var _0x25618e=_0x380998?0x0:_0x345d5a[_0xa573('0x23')];var _0x1efe25=_0x380998?_0x305c47[_0xa573('0x26')]:_0x345d5a['offset']+_0x345d5a['limit'];var _0x535e33;if(_0x1efe25>=_0x2163be){_0x1efe25=_0x2163be;_0x535e33=0xc8;}else{_0x535e33=0xce;}_0xe40bdd[_0xa573('0x20')](_0x535e33);return _0xe40bdd[_0xa573('0x27')](_0xa573('0x28'),_0x25618e+'-'+_0x1efe25+'/'+_0x2163be)[_0xa573('0x22')](_0x305c47);}return null;};}function patchUpdates(_0x333fd8){return function(_0x39860d){try{jsonpatch['apply'](_0x39860d,_0x333fd8,!![]);}catch(_0x568baa){return BPromise[_0xa573('0x29')](_0x568baa);}return _0x39860d['save']();};}function saveUpdates(_0x424270,_0x2e28c1){return function(_0x29e42b){if(_0x29e42b){return _0x29e42b[_0xa573('0x2a')](_0x424270)[_0xa573('0x2b')](function(_0x533747){return _0x533747;});}return null;};}function removeEntity(_0x4bf797,_0x5842b3){return function(_0x16f9cb){if(_0x16f9cb){return _0x16f9cb['destroy']()['then'](function(){_0x4bf797[_0xa573('0x20')](0xcc)[_0xa573('0x21')]();});}};}function handleEntityNotFound(_0x431a04,_0x32f027){return function(_0x501919){if(!_0x501919){_0x431a04['sendStatus'](0x194);}return _0x501919;};}function handleError(_0x3654c8,_0x5ba4d4){_0x5ba4d4=_0x5ba4d4||0x1f4;return function(_0x3f4631){logger[_0xa573('0x2c')](_0x3f4631[_0xa573('0x2d')]);if(_0x3f4631[_0xa573('0x2e')]){delete _0x3f4631[_0xa573('0x2e')];}_0x3654c8[_0xa573('0x20')](_0x5ba4d4)[_0xa573('0x2f')](_0x3f4631);};}exports[_0xa573('0x30')]=function(_0x607bc7,_0x2aa460){var _0x154365={'raw':![],'where':{'id':_0x607bc7[_0xa573('0x31')]['id']}},_0x3b8ca8={};_0x3b8ca8[_0xa573('0x32')]=_['keys'](db[_0xa573('0x33')]['rawAttributes']);_0x3b8ca8[_0xa573('0x34')]=_[_0xa573('0x35')](_0x607bc7[_0xa573('0x34')]);_0x3b8ca8[_0xa573('0x36')]=_['intersection'](_0x3b8ca8[_0xa573('0x32')],_0x3b8ca8['query']);_0x154365[_0xa573('0x37')]=_['intersection'](_0x3b8ca8[_0xa573('0x32')],qs[_0xa573('0x38')](_0x607bc7[_0xa573('0x34')][_0xa573('0x38')]));_0x154365[_0xa573('0x37')]=_0x154365[_0xa573('0x37')][_0xa573('0x39')]?_0x154365[_0xa573('0x37')]:_0x3b8ca8[_0xa573('0x32')];if(_0x607bc7[_0xa573('0x34')]['includeAll']){_0x154365[_0xa573('0x3a')]=[{'all':!![]}];}_0x154365=_[_0xa573('0x3b')]({},_0x154365,_0x607bc7[_0xa573('0x3c')]);return db['DashboardItem'][_0xa573('0x3d')](_0x154365)['then'](handleEntityNotFound(_0x2aa460,null))[_0xa573('0x2b')](respondWithResult(_0x2aa460,null))['catch'](handleError(_0x2aa460,null));};exports['destroy']=function(_0xcd9681,_0x2fc42c){return db[_0xa573('0x33')][_0xa573('0x3d')]({'where':{'id':_0xcd9681[_0xa573('0x31')]['id']}})['then'](handleEntityNotFound(_0x2fc42c,null))['then'](removeEntity(_0x2fc42c,null))[_0xa573('0x3e')](handleError(_0x2fc42c,null));};function widgetAttributes(_0xcfb63f){try{switch(_0xcfb63f[_0xa573('0x3f')]){case _0xa573('0x40'):return[{'name':'attrUrl','value':_0xcfb63f[_0xa573('0x41')]||(_0xcfb63f['attrs']&&_0xcfb63f['attrs'][0x0]?_0xcfb63f['attrs'][0x0][_0xa573('0x42')]:undefined)||'https://'}];case _0xa573('0x43'):return[{'name':_0xa573('0x44'),'value':_0xcfb63f[_0xa573('0x44')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x0]?_0xcfb63f[_0xa573('0x45')][0x0][_0xa573('0x42')]:undefined)||''}];case _0xa573('0x46'):return[{'name':_0xa573('0x47'),'value':_0xcfb63f[_0xa573('0x47')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x0]?_0xcfb63f['attrs'][0x0][_0xa573('0x42')]:undefined)||_0xa573('0x48')},{'name':_0xa573('0x49'),'value':_0xcfb63f[_0xa573('0x49')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x1]?_0xcfb63f[_0xa573('0x45')][0x1][_0xa573('0x42')]:undefined)||_0xa573('0x4a')},{'name':_0xa573('0x4b'),'value':_0xcfb63f[_0xa573('0x4b')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x2]?_0xcfb63f[_0xa573('0x45')][0x2][_0xa573('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0xa573('0x4c'),'value':_0xcfb63f['attrMetric']||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0x0]?_0xcfb63f['attrs'][0x0][_0xa573('0x42')]:undefined)||_0xa573('0x4d')},{'name':_0xa573('0x4e'),'value':_0xcfb63f[_0xa573('0x4e')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x1]?_0xcfb63f[_0xa573('0x45')][0x1]['value']:undefined)||[]},{'name':_0xa573('0x4b'),'value':_0xcfb63f[_0xa573('0x4b')]||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0x2]?_0xcfb63f[_0xa573('0x45')][0x2][_0xa573('0x42')]:undefined)||0x14},{'name':_0xa573('0x4f'),'value':_0xcfb63f[_0xa573('0x4f')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f['attrs'][0x3]?_0xcfb63f[_0xa573('0x45')][0x3][_0xa573('0x42')]:undefined)||_0xa573('0x50')},{'name':_0xa573('0x51'),'value':_0xcfb63f['attrEmailAccounts']||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x4]?_0xcfb63f[_0xa573('0x45')][0x4][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x52'),'value':_0xcfb63f[_0xa573('0x52')]||(_0xcfb63f['attrs']&&_0xcfb63f['attrs'][0x5]?_0xcfb63f[_0xa573('0x45')][0x5][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x53'),'value':_0xcfb63f[_0xa573('0x53')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f['attrs'][0x6]?_0xcfb63f[_0xa573('0x45')][0x6][_0xa573('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xcfb63f[_0xa573('0x54')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x7]?_0xcfb63f[_0xa573('0x45')][0x7][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x55'),'value':_0xcfb63f[_0xa573('0x55')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x8]?_0xcfb63f['attrs'][0x8][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x56'),'value':_0xcfb63f['attrChatWebsites']||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x9]?_0xcfb63f[_0xa573('0x45')][0x9][_0xa573('0x42')]:undefined)||''}];case _0xa573('0x57'):case _0xa573('0x58'):return[{'name':_0xa573('0x59'),'value':_0xcfb63f[_0xa573('0x59')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x0]?_0xcfb63f[_0xa573('0x45')][0x0][_0xa573('0x42')]:undefined)||_0xa573('0x4d')},{'name':_0xa573('0x5a'),'value':_0xcfb63f['attrSerie2']||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x1]?_0xcfb63f[_0xa573('0x45')][0x1]['value']:undefined)||null},{'name':_0xa573('0x5b'),'value':_0xcfb63f[_0xa573('0x5b')]||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0x2]?_0xcfb63f['attrs'][0x2][_0xa573('0x42')]:undefined)||null},{'name':_0xa573('0x4e'),'value':_0xcfb63f['attrVoiceQueues']||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x3]?_0xcfb63f['attrs'][0x3][_0xa573('0x42')]:undefined)||[]},{'name':_0xa573('0x4f'),'value':_0xcfb63f[_0xa573('0x4f')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x4]?_0xcfb63f[_0xa573('0x45')][0x4][_0xa573('0x42')]:undefined)||_0xa573('0x50')},{'name':_0xa573('0x51'),'value':_0xcfb63f[_0xa573('0x51')]||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0x5]?_0xcfb63f[_0xa573('0x45')][0x5][_0xa573('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xcfb63f[_0xa573('0x52')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x6]?_0xcfb63f[_0xa573('0x45')][0x6]['value']:undefined)||''},{'name':_0xa573('0x53'),'value':_0xcfb63f['attrSmsAccounts']||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x7]?_0xcfb63f[_0xa573('0x45')][0x7][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x54'),'value':_0xcfb63f[_0xa573('0x54')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x8]?_0xcfb63f[_0xa573('0x45')][0x8][_0xa573('0x42')]:undefined)||''},{'name':_0xa573('0x55'),'value':_0xcfb63f[_0xa573('0x55')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f['attrs'][0x9]?_0xcfb63f['attrs'][0x9]['value']:undefined)||''},{'name':_0xa573('0x56'),'value':_0xcfb63f[_0xa573('0x56')]||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0xa]?_0xcfb63f[_0xa573('0x45')][0xa][_0xa573('0x42')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0xcfb63f[_0xa573('0x5c')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f['attrs'][0x0]?_0xcfb63f[_0xa573('0x45')][0x0][_0xa573('0x3f')]:undefined)||null,'value':_0xcfb63f[_0xa573('0x5d')]||(_0xcfb63f['attrs']&&_0xcfb63f[_0xa573('0x45')][0x0]?_0xcfb63f['attrs'][0x0][_0xa573('0x42')]:undefined)||null},{'name':_0xa573('0x5e'),'value':_0xcfb63f[_0xa573('0x5e')]||(_0xcfb63f[_0xa573('0x45')]&&_0xcfb63f[_0xa573('0x45')][0x1]?_0xcfb63f[_0xa573('0x45')][0x1][_0xa573('0x42')]:undefined)||0x0}];default:return[];}}catch(_0xa8ca58){logger[_0xa573('0x2c')](_0xa573('0x5f'),JSON['stringify'](_0xa8ca58));return[];}}exports[_0xa573('0x60')]=function(_0x4753c0,_0x39dab1){if(_0x4753c0[_0xa573('0x61')]){_0x4753c0[_0xa573('0x61')][_0xa573('0x45')]=widgetAttributes(_0x4753c0['body']);}return db[_0xa573('0x33')][_0xa573('0x60')](_0x4753c0[_0xa573('0x61')],{})['then'](respondWithResult(_0x39dab1,0xc9))[_0xa573('0x3e')](handleError(_0x39dab1,null));};exports[_0xa573('0x2a')]=function(_0x2ae8b,_0x467a78){if(_0x2ae8b[_0xa573('0x61')]['id']){delete _0x2ae8b[_0xa573('0x61')]['id'];}_0x2ae8b[_0xa573('0x61')][_0xa573('0x45')]=widgetAttributes(_0x2ae8b[_0xa573('0x61')]);return db[_0xa573('0x33')][_0xa573('0x3d')]({'where':{'id':_0x2ae8b[_0xa573('0x31')]['id']}})[_0xa573('0x2b')](handleEntityNotFound(_0x467a78,null))[_0xa573('0x2b')](saveUpdates(_0x2ae8b['body'],null))[_0xa573('0x2b')](respondWithResult(_0x467a78,null))[_0xa573('0x3e')](handleError(_0x467a78,null));}; \ No newline at end of file +var _0xbcc7=['show','params','model','keys','DashboardItem','query','intersection','attributes','fields','merge','options','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','send'];(function(_0x5aa3e9,_0x401e7d){var _0x4f1278=function(_0x4a38cc){while(--_0x4a38cc){_0x5aa3e9['push'](_0x5aa3e9['shift']());}};_0x4f1278(++_0x401e7d);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x69cf82,_0x55f630){_0x69cf82=_0x69cf82-0x0;var _0x3ec91e=_0xbcc7[_0x69cf82];return _0x3ec91e;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];config[_0x7bcc('0x16')]=_['defaults'](config[_0x7bcc('0x16')],{'host':_0x7bcc('0x17'),'port':0x18eb});var socket=require(_0x7bcc('0x18'))(new Redis(config[_0x7bcc('0x16')]));require(_0x7bcc('0x19'))[_0x7bcc('0x1a')](socket);function respondWithStatusCode(_0x4a2539,_0x3998c5){_0x3998c5=_0x3998c5||0xcc;return function(_0x16f0a8){if(_0x16f0a8){return _0x4a2539[_0x7bcc('0x1b')](_0x3998c5);}return _0x4a2539[_0x7bcc('0x1c')](_0x3998c5)[_0x7bcc('0x1d')]();};}function respondWithResult(_0x134d55,_0x432960){_0x432960=_0x432960||0xc8;return function(_0x49adcd){if(_0x49adcd){return _0x134d55[_0x7bcc('0x1c')](_0x432960)['json'](_0x49adcd);}};}function respondWithFilteredResult(_0x3156f3,_0x43dfc4){return function(_0x340bd6){if(_0x340bd6){var _0x323525=typeof _0x43dfc4['offset']==='undefined'&&typeof _0x43dfc4[_0x7bcc('0x1e')]===_0x7bcc('0x1f');var _0x1a1b7f=_0x340bd6[_0x7bcc('0x20')];var _0x1df8ad=_0x323525?0x0:_0x43dfc4[_0x7bcc('0x21')];var _0x3e8d47=_0x323525?_0x340bd6[_0x7bcc('0x20')]:_0x43dfc4[_0x7bcc('0x21')]+_0x43dfc4['limit'];var _0x553865;if(_0x3e8d47>=_0x1a1b7f){_0x3e8d47=_0x1a1b7f;_0x553865=0xc8;}else{_0x553865=0xce;}_0x3156f3[_0x7bcc('0x1c')](_0x553865);return _0x3156f3[_0x7bcc('0x22')](_0x7bcc('0x23'),_0x1df8ad+'-'+_0x3e8d47+'/'+_0x1a1b7f)[_0x7bcc('0x24')](_0x340bd6);}return null;};}function patchUpdates(_0x201f40){return function(_0x2ba4bf){try{jsonpatch[_0x7bcc('0x25')](_0x2ba4bf,_0x201f40,!![]);}catch(_0x345671){return BPromise[_0x7bcc('0x26')](_0x345671);}return _0x2ba4bf['save']();};}function saveUpdates(_0x2d25b8,_0x2b3d01){return function(_0x226fb9){if(_0x226fb9){return _0x226fb9[_0x7bcc('0x27')](_0x2d25b8)[_0x7bcc('0x28')](function(_0x1d085c){return _0x1d085c;});}return null;};}function removeEntity(_0x4f8562,_0x48b296){return function(_0x345dd8){if(_0x345dd8){return _0x345dd8['destroy']()['then'](function(){_0x4f8562[_0x7bcc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f79a0,_0xe594c6){return function(_0x1725e5){if(!_0x1725e5){_0x3f79a0['sendStatus'](0x194);}return _0x1725e5;};}function handleError(_0x17c3ce,_0x1dea55){_0x1dea55=_0x1dea55||0x1f4;return function(_0x2e92e1){logger[_0x7bcc('0x29')](_0x2e92e1[_0x7bcc('0x2a')]);if(_0x2e92e1[_0x7bcc('0x2b')]){delete _0x2e92e1[_0x7bcc('0x2b')];}_0x17c3ce['status'](_0x1dea55)[_0x7bcc('0x2c')](_0x2e92e1);};}exports[_0x7bcc('0x2d')]=function(_0x51105b,_0x5d4131){var _0x472b73={'raw':![],'where':{'id':_0x51105b[_0x7bcc('0x2e')]['id']}},_0x5010ab={};_0x5010ab[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](db[_0x7bcc('0x31')]['rawAttributes']);_0x5010ab[_0x7bcc('0x32')]=_[_0x7bcc('0x30')](_0x51105b[_0x7bcc('0x32')]);_0x5010ab['filters']=_[_0x7bcc('0x33')](_0x5010ab[_0x7bcc('0x2f')],_0x5010ab[_0x7bcc('0x32')]);_0x472b73[_0x7bcc('0x34')]=_[_0x7bcc('0x33')](_0x5010ab[_0x7bcc('0x2f')],qs[_0x7bcc('0x35')](_0x51105b[_0x7bcc('0x32')][_0x7bcc('0x35')]));_0x472b73[_0x7bcc('0x34')]=_0x472b73[_0x7bcc('0x34')]['length']?_0x472b73[_0x7bcc('0x34')]:_0x5010ab[_0x7bcc('0x2f')];if(_0x51105b[_0x7bcc('0x32')]['includeAll']){_0x472b73['include']=[{'all':!![]}];}_0x472b73=_[_0x7bcc('0x36')]({},_0x472b73,_0x51105b[_0x7bcc('0x37')]);return db[_0x7bcc('0x31')][_0x7bcc('0x38')](_0x472b73)[_0x7bcc('0x28')](handleEntityNotFound(_0x5d4131,null))[_0x7bcc('0x28')](respondWithResult(_0x5d4131,null))[_0x7bcc('0x39')](handleError(_0x5d4131,null));};exports['destroy']=function(_0x5bbb4b,_0x5584f6){return db['DashboardItem'][_0x7bcc('0x38')]({'where':{'id':_0x5bbb4b[_0x7bcc('0x2e')]['id']}})[_0x7bcc('0x28')](handleEntityNotFound(_0x5584f6,null))['then'](removeEntity(_0x5584f6,null))[_0x7bcc('0x39')](handleError(_0x5584f6,null));};function widgetAttributes(_0x1a7ba2){try{switch(_0x1a7ba2[_0x7bcc('0x3a')]){case'iframe':return[{'name':'attrUrl','value':_0x1a7ba2[_0x7bcc('0x3b')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2['attrs'][0x0]['value']:undefined)||_0x7bcc('0x3d')}];case _0x7bcc('0x3e'):return[{'name':_0x7bcc('0x3f'),'value':_0x1a7ba2['attrPath']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x40')]:undefined)||''}];case _0x7bcc('0x41'):return[{'name':_0x7bcc('0x42'),'value':_0x1a7ba2['attrHourFormat']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2['attrs'][0x0][_0x7bcc('0x40')]:undefined)||_0x7bcc('0x43')},{'name':_0x7bcc('0x44'),'value':_0x1a7ba2[_0x7bcc('0x44')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2[_0x7bcc('0x3c')][0x1][_0x7bcc('0x40')]:undefined)||'0.00'},{'name':_0x7bcc('0x45'),'value':_0x1a7ba2[_0x7bcc('0x45')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2[_0x7bcc('0x3c')][0x2][_0x7bcc('0x40')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1a7ba2[_0x7bcc('0x46')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x40')]:undefined)||_0x7bcc('0x47')},{'name':_0x7bcc('0x48'),'value':_0x1a7ba2[_0x7bcc('0x48')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2['attrs'][0x1][_0x7bcc('0x40')]:undefined)||[]},{'name':_0x7bcc('0x45'),'value':_0x1a7ba2[_0x7bcc('0x45')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2['attrs'][0x2][_0x7bcc('0x40')]:undefined)||0x14},{'name':_0x7bcc('0x49'),'value':_0x1a7ba2['attrChannel']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x3]?_0x1a7ba2[_0x7bcc('0x3c')][0x3]['value']:undefined)||_0x7bcc('0x4a')},{'name':_0x7bcc('0x4b'),'value':_0x1a7ba2['attrEmailAccounts']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x4]?_0x1a7ba2[_0x7bcc('0x3c')][0x4][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4c'),'value':_0x1a7ba2['attrFaxAccounts']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x5]?_0x1a7ba2['attrs'][0x5][_0x7bcc('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a7ba2[_0x7bcc('0x4d')]||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x6]?_0x1a7ba2['attrs'][0x6]['value']:undefined)||''},{'name':_0x7bcc('0x4e'),'value':_0x1a7ba2[_0x7bcc('0x4e')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x7]?_0x1a7ba2[_0x7bcc('0x3c')][0x7][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4f'),'value':_0x1a7ba2[_0x7bcc('0x4f')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x8]?_0x1a7ba2[_0x7bcc('0x3c')][0x8][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x50'),'value':_0x1a7ba2[_0x7bcc('0x50')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x9]?_0x1a7ba2[_0x7bcc('0x3c')][0x9][_0x7bcc('0x40')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x7bcc('0x51'),'value':_0x1a7ba2[_0x7bcc('0x51')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x7bcc('0x52'),'value':_0x1a7ba2[_0x7bcc('0x52')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x1]?_0x1a7ba2[_0x7bcc('0x3c')][0x1][_0x7bcc('0x40')]:undefined)||null},{'name':_0x7bcc('0x53'),'value':_0x1a7ba2[_0x7bcc('0x53')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2['attrs'][0x2]['value']:undefined)||null},{'name':_0x7bcc('0x48'),'value':_0x1a7ba2[_0x7bcc('0x48')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x3]?_0x1a7ba2['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1a7ba2[_0x7bcc('0x49')]||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x4]?_0x1a7ba2[_0x7bcc('0x3c')][0x4][_0x7bcc('0x40')]:undefined)||'voice'},{'name':_0x7bcc('0x4b'),'value':_0x1a7ba2['attrEmailAccounts']||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x5]?_0x1a7ba2[_0x7bcc('0x3c')][0x5][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4c'),'value':_0x1a7ba2[_0x7bcc('0x4c')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x6]?_0x1a7ba2[_0x7bcc('0x3c')][0x6][_0x7bcc('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a7ba2[_0x7bcc('0x4d')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x7]?_0x1a7ba2['attrs'][0x7][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4e'),'value':_0x1a7ba2[_0x7bcc('0x4e')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x8]?_0x1a7ba2[_0x7bcc('0x3c')][0x8][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4f'),'value':_0x1a7ba2[_0x7bcc('0x4f')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x9]?_0x1a7ba2[_0x7bcc('0x3c')][0x9][_0x7bcc('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a7ba2[_0x7bcc('0x50')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0xa]?_0x1a7ba2['attrs'][0xa][_0x7bcc('0x40')]:undefined)||''}];case'web-report':return[{'name':_0x7bcc('0x54'),'type':_0x1a7ba2[_0x7bcc('0x55')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x3a')]:undefined)||null,'value':_0x1a7ba2[_0x7bcc('0x54')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0]['value']:undefined)||null},{'name':_0x7bcc('0x56'),'value':_0x1a7ba2[_0x7bcc('0x56')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2['attrs'][0x1][_0x7bcc('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3c8242){logger[_0x7bcc('0x29')](_0x7bcc('0x57'),JSON[_0x7bcc('0x58')](_0x3c8242));return[];}}exports[_0x7bcc('0x59')]=function(_0x35d559,_0x25e9d6){if(_0x35d559[_0x7bcc('0x5a')]){_0x35d559[_0x7bcc('0x5a')][_0x7bcc('0x3c')]=widgetAttributes(_0x35d559['body']);}return db['DashboardItem']['create'](_0x35d559[_0x7bcc('0x5a')],{})['then'](respondWithResult(_0x25e9d6,0xc9))[_0x7bcc('0x39')](handleError(_0x25e9d6,null));};exports['update']=function(_0x38ed53,_0x41a669){if(_0x38ed53[_0x7bcc('0x5a')]['id']){delete _0x38ed53[_0x7bcc('0x5a')]['id'];}_0x38ed53[_0x7bcc('0x5a')][_0x7bcc('0x3c')]=widgetAttributes(_0x38ed53[_0x7bcc('0x5a')]);return db['DashboardItem'][_0x7bcc('0x38')]({'where':{'id':_0x38ed53[_0x7bcc('0x2e')]['id']}})['then'](handleEntityNotFound(_0x41a669,null))[_0x7bcc('0x28')](saveUpdates(_0x38ed53['body'],null))[_0x7bcc('0x28')](respondWithResult(_0x41a669,null))['catch'](handleError(_0x41a669,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e32dacf..bd7e00c 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce22=['update','remove','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x3df82d,_0x564342){var _0xd825fb=function(_0x3e00a3){while(--_0x3e00a3){_0x3df82d['push'](_0x3df82d['shift']());}};_0xd825fb(++_0x564342);}(_0xce22,0x137));var _0x2ce2=function(_0x5744d0,_0x281507){_0x5744d0=_0x5744d0-0x0;var _0x7f5a59=_0xce22[_0x5744d0];return _0x7f5a59;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x2ce2('0x0'))['db'][_0x2ce2('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2ce2('0x2')](0x0);var events={'afterCreate':_0x2ce2('0x3'),'afterUpdate':_0x2ce2('0x4'),'afterDestroy':_0x2ce2('0x5')};function emitEvent(_0x19103f){return function(_0x2a681d,_0x204975,_0x454dd5){DashboardItemEvents['emit'](_0x19103f+':'+_0x2a681d['id'],_0x2a681d);DashboardItemEvents['emit'](_0x19103f,_0x2a681d);_0x454dd5(null);};}for(var e in events){if(events[_0x2ce2('0x6')](e)){var event=events[e];DashboardItem[_0x2ce2('0x7')](e,emitEvent(event));}}module[_0x2ce2('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x7f6f=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1689a2,_0x374a60){var _0x6626fc=function(_0x169e15){while(--_0x169e15){_0x1689a2['push'](_0x1689a2['shift']());}};_0x6626fc(++_0x374a60);}(_0x7f6f,0x6c));var _0xf7f6=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0x7f6f[_0x4a232c];return _0xb5807f;};'use strict';var EventEmitter=require(_0xf7f6('0x0'));var DashboardItem=require(_0xf7f6('0x1'))['db'][_0xf7f6('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf7f6('0x3')](0x0);var events={'afterCreate':_0xf7f6('0x4'),'afterUpdate':_0xf7f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x561993){return function(_0x2baf16,_0x323719,_0x1c267a){DashboardItemEvents[_0xf7f6('0x6')](_0x561993+':'+_0x2baf16['id'],_0x2baf16);DashboardItemEvents[_0xf7f6('0x6')](_0x561993,_0x2baf16);_0x1c267a(null);};}for(var e in events){if(events[_0xf7f6('0x7')](e)){var event=events[e];DashboardItem[_0xf7f6('0x8')](e,emitEvent(event));}}module[_0xf7f6('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2c50a9e..9a95f80 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4f2=['path','../../config/environment','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xa4f2,0x1d3));var _0x2a4f=function(_0x5941f8,_0x4aee3e){_0x5941f8=_0x5941f8-0x0;var _0xb94b96=_0xa4f2[_0x5941f8];return _0xb94b96;};'use strict';var _=require(_0x2a4f('0x0'));var util=require(_0x2a4f('0x1'));var logger=require(_0x2a4f('0x2'))('api');var moment=require(_0x2a4f('0x3'));var BPromise=require(_0x2a4f('0x4'));var rp=require(_0x2a4f('0x5'));var fs=require('fs');var path=require(_0x2a4f('0x6'));var rimraf=require('rimraf');var config=require(_0x2a4f('0x7'));var attributes=require(_0x2a4f('0x8'));module[_0x2a4f('0x9')]=function(_0x3c5d64,_0x588132){return _0x3c5d64['define']('DashboardItem',attributes,{'tableName':_0x2a4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc551=['define','dashboard_items','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xc551,0xbd));var _0x1c55=function(_0x4b9e5c,_0x133531){_0x4b9e5c=_0x4b9e5c-0x0;var _0x49bc23=_0xc551[_0x4b9e5c];return _0x49bc23;};'use strict';var _=require(_0x1c55('0x0'));var util=require('util');var logger=require(_0x1c55('0x1'))('api');var moment=require(_0x1c55('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c55('0x3'));var fs=require('fs');var path=require(_0x1c55('0x4'));var rimraf=require(_0x1c55('0x5'));var config=require(_0x1c55('0x6'));var attributes=require(_0x1c55('0x7'));module[_0x1c55('0x8')]=function(_0x1c28ba,_0x4fdfbc){return _0x1c28ba[_0x1c55('0x9')]('DashboardItem',attributes,{'tableName':_0x1c55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index f58d6e4..c1b8ff5 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ada=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x8ada,0x7c));var _0xa8ad=function(_0x5a17d6,_0x514820){_0x5a17d6=_0x5a17d6-0x0;var _0x409d71=_0x8ada[_0x5a17d6];return _0x409d71;};'use strict';var _=require(_0xa8ad('0x0'));var util=require(_0xa8ad('0x1'));var moment=require(_0xa8ad('0x2'));var BPromise=require(_0xa8ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8ad('0x5'));var logger=require(_0xa8ad('0x6'))(_0xa8ad('0x7'));var config=require(_0xa8ad('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa8ad('0x9')]({'port':0x232a});config[_0xa8ad('0xa')]=_[_0xa8ad('0xb')](config[_0xa8ad('0xa')],{'host':_0xa8ad('0xc'),'port':0x18eb});var socket=require(_0xa8ad('0xd'))(new Redis(config[_0xa8ad('0xa')]));require(_0xa8ad('0xe'))[_0xa8ad('0xf')](socket);function respondWithRpcPromise(_0x5c043b,_0x176436,_0x1c1cfd){return new BPromise(function(_0x123985,_0x326b14){return client[_0xa8ad('0x10')](_0x5c043b,_0x1c1cfd)[_0xa8ad('0x11')](function(_0x15eebe){logger[_0xa8ad('0x12')](_0xa8ad('0x13'),_0x176436,_0xa8ad('0x14'));logger['debug'](_0xa8ad('0x15'),_0x176436,_0xa8ad('0x14'),JSON[_0xa8ad('0x16')](_0x15eebe));if(_0x15eebe[_0xa8ad('0x17')]){if(_0x15eebe['error'][_0xa8ad('0x18')]===0x1f4){logger[_0xa8ad('0x17')](_0xa8ad('0x13'),_0x176436,_0x15eebe[_0xa8ad('0x17')][_0xa8ad('0x19')]);return _0x326b14(_0x15eebe[_0xa8ad('0x17')]['message']);}logger[_0xa8ad('0x17')](_0xa8ad('0x13'),_0x176436,_0x15eebe[_0xa8ad('0x17')]['message']);return _0x123985(_0x15eebe[_0xa8ad('0x17')][_0xa8ad('0x19')]);}else{logger[_0xa8ad('0x12')]('DashboardItem,\x20%s,\x20%s',_0x176436,_0xa8ad('0x14'));_0x123985(_0x15eebe[_0xa8ad('0x1a')][_0xa8ad('0x19')]);}})[_0xa8ad('0x1b')](function(_0x422c91){logger[_0xa8ad('0x17')](_0xa8ad('0x13'),_0x176436,_0x422c91);_0x326b14(_0x422c91);});});} \ No newline at end of file +var _0xd963=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x935015,_0x535652){var _0x54fe7c=function(_0x54af9c){while(--_0x54af9c){_0x935015['push'](_0x935015['shift']());}};_0x54fe7c(++_0x535652);}(_0xd963,0x19a));var _0x3d96=function(_0x38051b,_0x46cf1e){_0x38051b=_0x38051b-0x0;var _0x349422=_0xd963[_0x38051b];return _0x349422;};'use strict';var _=require(_0x3d96('0x0'));var util=require(_0x3d96('0x1'));var moment=require(_0x3d96('0x2'));var BPromise=require(_0x3d96('0x3'));var rs=require(_0x3d96('0x4'));var fs=require('fs');var Redis=require(_0x3d96('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d96('0x6'));var logger=require(_0x3d96('0x7'))(_0x3d96('0x8'));var config=require(_0x3d96('0x9'));var jayson=require(_0x3d96('0xa'));var client=jayson[_0x3d96('0xb')][_0x3d96('0xc')]({'port':0x232a});config['redis']=_[_0x3d96('0xd')](config['redis'],{'host':_0x3d96('0xe'),'port':0x18eb});var socket=require(_0x3d96('0xf'))(new Redis(config[_0x3d96('0x10')]));require('./dashboardItem.socket')[_0x3d96('0x11')](socket);function respondWithRpcPromise(_0x4486ec,_0x320427,_0x4f45c1){return new BPromise(function(_0x3a9519,_0x278ff1){return client[_0x3d96('0x12')](_0x4486ec,_0x4f45c1)[_0x3d96('0x13')](function(_0x1e16b9){logger[_0x3d96('0x14')](_0x3d96('0x15'),_0x320427,_0x3d96('0x16'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x320427,'request\x20sent',JSON['stringify'](_0x1e16b9));if(_0x1e16b9[_0x3d96('0x17')]){if(_0x1e16b9[_0x3d96('0x17')][_0x3d96('0x18')]===0x1f4){logger[_0x3d96('0x17')](_0x3d96('0x15'),_0x320427,_0x1e16b9['error'][_0x3d96('0x19')]);return _0x278ff1(_0x1e16b9['error'][_0x3d96('0x19')]);}logger['error'](_0x3d96('0x15'),_0x320427,_0x1e16b9[_0x3d96('0x17')][_0x3d96('0x19')]);return _0x3a9519(_0x1e16b9[_0x3d96('0x17')][_0x3d96('0x19')]);}else{logger[_0x3d96('0x14')](_0x3d96('0x15'),_0x320427,'request\x20sent');_0x3a9519(_0x1e16b9['result'][_0x3d96('0x19')]);}})[_0x3d96('0x1a')](function(_0x27ca01){logger[_0x3d96('0x17')]('DashboardItem,\x20%s,\x20%s',_0x320427,_0x27ca01);_0x278ff1(_0x27ca01);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5755ab9..f173a32 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88ed=['dashboardItem:','save','remove','emit','removeListener'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x88ed,0x132));var _0xd88e=function(_0xb3f14a,_0x259936){_0xb3f14a=_0xb3f14a-0x0;var _0x3b8df3=_0x88ed[_0xb3f14a];return _0x3b8df3;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xd88e('0x0'),_0xd88e('0x1'),'update'];function createListener(_0x4ee03b,_0x3852ff){return function(_0x4d623a){_0x3852ff[_0xd88e('0x2')](_0x4ee03b,_0x4d623a);};}function removeListener(_0x3bd1d3,_0x20aab4){return function(){DashboardItemEvents[_0xd88e('0x3')](_0x3bd1d3,_0x20aab4);};}exports['register']=function(_0x509413){for(var _0x83e489=0x0,_0x52bf00=events['length'];_0x83e489<_0x52bf00;_0x83e489++){var _0x416eb1=events[_0x83e489];var _0x472661=createListener(_0xd88e('0x4')+_0x416eb1,_0x509413);DashboardItemEvents['on'](_0x416eb1,_0x472661);}}; \ No newline at end of file +var _0x7110=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','register'];(function(_0xb3abe6,_0x215c00){var _0x11baad=function(_0x2727c0){while(--_0x2727c0){_0xb3abe6['push'](_0xb3abe6['shift']());}};_0x11baad(++_0x215c00);}(_0x7110,0x112));var _0x0711=function(_0x120482,_0x321bb0){_0x120482=_0x120482-0x0;var _0x13efef=_0x7110[_0x120482];return _0x13efef;};'use strict';var DashboardItemEvents=require(_0x0711('0x0'));var events=[_0x0711('0x1'),_0x0711('0x2'),_0x0711('0x3')];function createListener(_0x2eecc5,_0x1e3083){return function(_0x20ebc4){_0x1e3083[_0x0711('0x4')](_0x2eecc5,_0x20ebc4);};}function removeListener(_0x357974,_0x562199){return function(){DashboardItemEvents['removeListener'](_0x357974,_0x562199);};}exports[_0x0711('0x5')]=function(_0x1a8339){for(var _0xb437=0x0,_0x473b9e=events[_0x0711('0x6')];_0xb437<_0x473b9e;_0xb437++){var _0x51fa12=events[_0xb437];var _0x2137ea=createListener(_0x0711('0x7')+_0x51fa12,_0x1a8339);DashboardItemEvents['on'](_0x51fa12,_0x2137ea);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f58b5e7..2dc76f9 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc22e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4ed7,_0x14f3ba){var _0x584b32=function(_0x3203f4){while(--_0x3203f4){_0x4ed7['push'](_0x4ed7['shift']());}};_0x584b32(++_0x14f3ba);}(_0xc22e,0x13f));var _0xec22=function(_0x4514a2,_0x4c2011){_0x4514a2=_0x4514a2-0x0;var _0x1474a8=_0xc22e[_0x4514a2];return _0x1474a8;};'use strict';var multer=require(_0xec22('0x0'));var util=require(_0xec22('0x1'));var path=require('path');var timeout=require(_0xec22('0x2'));var express=require(_0xec22('0x3'));var router=express[_0xec22('0x4')]();var fs_extra=require(_0xec22('0x5'));var auth=require(_0xec22('0x6'));var interaction=require(_0xec22('0x7'));var config=require(_0xec22('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0xec22('0x9'),auth[_0xec22('0xa')](),controller['show']);router[_0xec22('0xb')]('/',auth[_0xec22('0xa')](),controller[_0xec22('0xc')]);router['put'](_0xec22('0x9'),auth[_0xec22('0xa')](),controller[_0xec22('0xd')]);router[_0xec22('0xe')](_0xec22('0x9'),auth[_0xec22('0xa')](),controller[_0xec22('0xf')]);module[_0xec22('0x10')]=router; \ No newline at end of file +var _0x3dfc=['delete','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create'];(function(_0x483b1a,_0x4d99ec){var _0xfd552f=function(_0x209087){while(--_0x209087){_0x483b1a['push'](_0x483b1a['shift']());}};_0xfd552f(++_0x4d99ec);}(_0x3dfc,0x1f2));var _0xc3df=function(_0x55a802,_0x10ab3a){_0x55a802=_0x55a802-0x0;var _0x1a0461=_0x3dfc[_0x55a802];return _0x1a0461;};'use strict';var multer=require(_0xc3df('0x0'));var util=require(_0xc3df('0x1'));var path=require(_0xc3df('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc3df('0x4'));var config=require(_0xc3df('0x5'));var controller=require('./dashboardItem.controller');router[_0xc3df('0x6')](_0xc3df('0x7'),auth['isAuthenticated'](),controller[_0xc3df('0x8')]);router[_0xc3df('0x9')]('/',auth[_0xc3df('0xa')](),controller[_0xc3df('0xb')]);router['put'](_0xc3df('0x7'),auth[_0xc3df('0xa')](),controller['update']);router[_0xc3df('0xc')]('/:id',auth[_0xc3df('0xa')](),controller[_0xc3df('0xd')]);module[_0xc3df('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 4a6cf28..de67a71 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56de=['third','first','STRING','sequelize','second'];(function(_0x2c74e2,_0x78daf1){var _0x14e004=function(_0x53ed83){while(--_0x53ed83){_0x2c74e2['push'](_0x2c74e2['shift']());}};_0x14e004(++_0x78daf1);}(_0x56de,0x13e));var _0xe56d=function(_0x517c05,_0x50ba19){_0x517c05=_0x517c05-0x0;var _0x2ff592=_0x56de[_0x517c05];return _0x2ff592;};'use strict';var Sequelize=require(_0xe56d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xe56d('0x1'),_0xe56d('0x2')),'allowNull':![],'defaultValue':_0xe56d('0x3')},'description':{'type':Sequelize[_0xe56d('0x4')]}}; \ No newline at end of file +var _0x65ad=['first','second','third','exports','STRING','ENUM'];(function(_0x13d9b8,_0x187ab0){var _0x1f5667=function(_0x35a6bb){while(--_0x35a6bb){_0x13d9b8['push'](_0x13d9b8['shift']());}};_0x1f5667(++_0x187ab0);}(_0x65ad,0x16b));var _0xd65a=function(_0x3a2eae,_0x4a138f){_0x3a2eae=_0x3a2eae-0x0;var _0x1c8828=_0x65ad[_0x3a2eae];return _0x1c8828;};'use strict';var Sequelize=require('sequelize');module[_0xd65a('0x0')]={'name':{'type':Sequelize[_0xd65a('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xd65a('0x2')](_0xd65a('0x3'),_0xd65a('0x4'),_0xd65a('0x5')),'allowNull':![],'defaultValue':_0xd65a('0x3')},'description':{'type':Sequelize[_0xd65a('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 1ee2098..32236ae 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89c9=['create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','Dispositions','then','error','stack','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find'];(function(_0x480801,_0x2f27e1){var _0x4f86a0=function(_0x5ae72c){while(--_0x5ae72c){_0x480801['push'](_0x480801['shift']());}};_0x4f86a0(++_0x2f27e1);}(_0x89c9,0xb0));var _0x989c=function(_0x323591,_0x518650){_0x323591=_0x323591-0x0;var _0x423982=_0x89c9[_0x323591];return _0x423982;};'use strict';var emlformat=require(_0x989c('0x0'));var rimraf=require(_0x989c('0x1'));var zipdir=require(_0x989c('0x2'));var jsonpatch=require(_0x989c('0x3'));var rp=require(_0x989c('0x4'));var moment=require(_0x989c('0x5'));var BPromise=require(_0x989c('0x6'));var Mustache=require(_0x989c('0x7'));var util=require(_0x989c('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x989c('0x9'));var fs=require('fs');var fs_extra=require(_0x989c('0xa'));var _=require(_0x989c('0xb'));var squel=require(_0x989c('0xc'));var crypto=require(_0x989c('0xd'));var jsforce=require(_0x989c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x989c('0xf'));var querystring=require(_0x989c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x989c('0x11'));var qs=require(_0x989c('0x12'));var as=require(_0x989c('0x13'));var hardwareService=require(_0x989c('0x14'));var logger=require(_0x989c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x989c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55876c,_0x44d1d){_0x44d1d=_0x44d1d||0xcc;return function(_0x459101){if(_0x459101){return _0x55876c[_0x989c('0x17')](_0x44d1d);}return _0x55876c[_0x989c('0x18')](_0x44d1d)[_0x989c('0x19')]();};}function respondWithResult(_0x18ecdd,_0x2bec9f){_0x2bec9f=_0x2bec9f||0xc8;return function(_0x4c1f44){if(_0x4c1f44){return _0x18ecdd['status'](_0x2bec9f)[_0x989c('0x1a')](_0x4c1f44);}};}function respondWithFilteredResult(_0x40259c,_0x44653f){return function(_0x462397){if(_0x462397){var _0x2d3381=typeof _0x44653f[_0x989c('0x1b')]===_0x989c('0x1c')&&typeof _0x44653f[_0x989c('0x1d')]===_0x989c('0x1c');var _0x254283=_0x462397[_0x989c('0x1e')];var _0x489def=_0x2d3381?0x0:_0x44653f['offset'];var _0x5acdfe=_0x2d3381?_0x462397[_0x989c('0x1e')]:_0x44653f['offset']+_0x44653f['limit'];var _0x442daa;if(_0x5acdfe>=_0x254283){_0x5acdfe=_0x254283;_0x442daa=0xc8;}else{_0x442daa=0xce;}_0x40259c['status'](_0x442daa);return _0x40259c[_0x989c('0x1f')]('Content-Range',_0x489def+'-'+_0x5acdfe+'/'+_0x254283)[_0x989c('0x1a')](_0x462397);}return null;};}function patchUpdates(_0x4011d7){return function(_0x36c3e1){try{jsonpatch[_0x989c('0x20')](_0x36c3e1,_0x4011d7,!![]);}catch(_0x265e88){return BPromise[_0x989c('0x21')](_0x265e88);}return _0x36c3e1[_0x989c('0x22')]();};}function saveUpdates(_0x4ed901,_0x55716e){return function(_0xeb1d9d){if(_0xeb1d9d){return _0xeb1d9d[_0x989c('0x23')](_0x4ed901)['then'](function(_0xdbfd7b){return _0xdbfd7b;});}return null;};}function removeEntity(_0x3e5e17,_0x14aaf1){return function(_0x33303f){if(_0x33303f){return _0x33303f[_0x989c('0x24')]()['then'](function(){var _0x5130a7=_0x33303f[_0x989c('0x25')]({'plain':!![]});var _0x5bf397=_0x989c('0x26');return db['UserProfileResource'][_0x989c('0x24')]({'where':{'type':_0x5bf397,'resourceId':_0x5130a7['id']}})[_0x989c('0x27')](function(){return _0x33303f;});})['then'](function(){_0x3e5e17[_0x989c('0x18')](0xcc)[_0x989c('0x19')]();});}};}function handleEntityNotFound(_0x387f2c,_0x2027ee){return function(_0x32cef8){if(!_0x32cef8){_0x387f2c[_0x989c('0x17')](0x194);}return _0x32cef8;};}function handleError(_0x81318f,_0x13e973){_0x13e973=_0x13e973||0x1f4;return function(_0xdc49d6){logger[_0x989c('0x28')](_0xdc49d6[_0x989c('0x29')]);if(_0xdc49d6['name']){delete _0xdc49d6['name'];}_0x81318f['status'](_0x13e973)[_0x989c('0x2a')](_0xdc49d6);};}exports[_0x989c('0x2b')]=function(_0x399d8d,_0x3306c8){var _0x39e5d1={},_0xcd538a={},_0xad445d={'count':0x0,'rows':[]};var _0x311433=_['map'](db[_0x989c('0x2c')][_0x989c('0x2d')],function(_0x20530a){return{'name':_0x20530a[_0x989c('0x2e')],'type':_0x20530a[_0x989c('0x2f')][_0x989c('0x30')]};});_0xcd538a[_0x989c('0x31')]=_[_0x989c('0x32')](_0x311433,_0x989c('0x33'));_0xcd538a[_0x989c('0x34')]=_[_0x989c('0x35')](_0x399d8d[_0x989c('0x34')]);_0xcd538a[_0x989c('0x36')]=_[_0x989c('0x37')](_0xcd538a[_0x989c('0x31')],_0xcd538a[_0x989c('0x34')]);_0x39e5d1[_0x989c('0x38')]=_['intersection'](_0xcd538a['model'],qs['fields'](_0x399d8d[_0x989c('0x34')][_0x989c('0x39')]));_0x39e5d1[_0x989c('0x38')]=_0x39e5d1['attributes'][_0x989c('0x3a')]?_0x39e5d1[_0x989c('0x38')]:_0xcd538a[_0x989c('0x31')];if(!_0x399d8d[_0x989c('0x34')][_0x989c('0x3b')](_0x989c('0x3c'))){_0x39e5d1[_0x989c('0x1d')]=qs[_0x989c('0x1d')](_0x399d8d[_0x989c('0x34')][_0x989c('0x1d')]);_0x39e5d1[_0x989c('0x1b')]=qs[_0x989c('0x1b')](_0x399d8d[_0x989c('0x34')]['offset']);}_0x39e5d1[_0x989c('0x3d')]=qs[_0x989c('0x3e')](_0x399d8d[_0x989c('0x34')][_0x989c('0x3e')]);_0x39e5d1[_0x989c('0x3f')]=qs[_0x989c('0x36')](_[_0x989c('0x40')](_0x399d8d['query'],_0xcd538a[_0x989c('0x36')]),_0x311433);if(_0x399d8d[_0x989c('0x34')][_0x989c('0x41')]){_0x39e5d1[_0x989c('0x3f')]=_['merge'](_0x39e5d1[_0x989c('0x3f')],{'$or':_['map'](_0x311433,function(_0x776aa7){if(_0x776aa7[_0x989c('0x2f')]!=='VIRTUAL'){var _0x6953e3={};_0x6953e3[_0x776aa7[_0x989c('0x33')]]={'$like':'%'+_0x399d8d[_0x989c('0x34')][_0x989c('0x41')]+'%'};return _0x6953e3;}})});}_0x39e5d1=_[_0x989c('0x42')]({},_0x39e5d1,_0x399d8d['options']);var _0x4888a9={'where':_0x39e5d1[_0x989c('0x3f')]};return db[_0x989c('0x2c')][_0x989c('0x1e')](_0x4888a9)[_0x989c('0x27')](function(_0x2523b7){_0xad445d[_0x989c('0x1e')]=_0x2523b7;if(_0x399d8d[_0x989c('0x34')][_0x989c('0x43')]){_0x39e5d1[_0x989c('0x44')]=[{'all':!![]}];}return db[_0x989c('0x2c')][_0x989c('0x45')](_0x39e5d1);})['then'](function(_0x5bca11){_0xad445d[_0x989c('0x46')]=_0x5bca11;return _0xad445d;})[_0x989c('0x27')](respondWithFilteredResult(_0x3306c8,_0x39e5d1))[_0x989c('0x47')](handleError(_0x3306c8,null));};exports[_0x989c('0x48')]=function(_0x44b936,_0x3e2754){var _0x51cdb3={'raw':!![],'where':{'id':_0x44b936[_0x989c('0x49')]['id']}},_0x2596f6={};_0x2596f6['model']=_[_0x989c('0x35')](db[_0x989c('0x2c')][_0x989c('0x2d')]);_0x2596f6[_0x989c('0x34')]=_[_0x989c('0x35')](_0x44b936[_0x989c('0x34')]);_0x2596f6['filters']=_['intersection'](_0x2596f6[_0x989c('0x31')],_0x2596f6[_0x989c('0x34')]);_0x51cdb3['attributes']=_[_0x989c('0x37')](_0x2596f6[_0x989c('0x31')],qs['fields'](_0x44b936[_0x989c('0x34')][_0x989c('0x39')]));_0x51cdb3['attributes']=_0x51cdb3[_0x989c('0x38')][_0x989c('0x3a')]?_0x51cdb3[_0x989c('0x38')]:_0x2596f6[_0x989c('0x31')];if(_0x44b936[_0x989c('0x34')][_0x989c('0x43')]){_0x51cdb3['include']=[{'all':!![]}];}_0x51cdb3=_[_0x989c('0x42')]({},_0x51cdb3,_0x44b936[_0x989c('0x4a')]);return db[_0x989c('0x2c')][_0x989c('0x4b')](_0x51cdb3)['then'](handleEntityNotFound(_0x3e2754,null))[_0x989c('0x27')](respondWithResult(_0x3e2754,null))['catch'](handleError(_0x3e2754,null));};exports[_0x989c('0x4c')]=function(_0x39db14,_0xd65433){return db[_0x989c('0x2c')][_0x989c('0x4c')](_0x39db14[_0x989c('0x4d')],{})[_0x989c('0x27')](function(_0x43457e){var _0x4017fb=_0x39db14[_0x989c('0x4e')][_0x989c('0x25')]({'plain':!![]});if(!_0x4017fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4017fb['role']==='user'){var _0xfa39bf=_0x43457e[_0x989c('0x25')]({'plain':!![]});var _0x7715e1=_0x989c('0x26');return db[_0x989c('0x4f')][_0x989c('0x4b')]({'where':{'name':_0x7715e1,'userProfileId':_0x4017fb[_0x989c('0x50')]},'raw':!![]})['then'](function(_0xa8e338){if(_0xa8e338&&_0xa8e338[_0x989c('0x51')]===0x0){return db[_0x989c('0x52')]['create']({'name':_0xfa39bf[_0x989c('0x33')],'resourceId':_0xfa39bf['id'],'type':_0xa8e338[_0x989c('0x33')],'sectionId':_0xa8e338['id']},{})['then'](function(){return _0x43457e;});}else{return _0x43457e;}})[_0x989c('0x47')](function(_0x492c11){logger[_0x989c('0x28')](_0x989c('0x53'),_0x492c11);throw _0x492c11;});}return _0x43457e;})[_0x989c('0x27')](respondWithResult(_0xd65433,0xc9))[_0x989c('0x47')](handleError(_0xd65433,null));};exports[_0x989c('0x23')]=function(_0x2e99a1,_0xa8733e){if(_0x2e99a1[_0x989c('0x4d')]['id']){delete _0x2e99a1[_0x989c('0x4d')]['id'];}return db[_0x989c('0x2c')][_0x989c('0x4b')]({'where':{'id':_0x2e99a1[_0x989c('0x49')]['id']}})[_0x989c('0x27')](handleEntityNotFound(_0xa8733e,null))['then'](saveUpdates(_0x2e99a1[_0x989c('0x4d')],null))[_0x989c('0x27')](respondWithResult(_0xa8733e,null))[_0x989c('0x47')](handleError(_0xa8733e,null));};exports[_0x989c('0x24')]=function(_0x1b2d74,_0x15fa8f){return db[_0x989c('0x2c')][_0x989c('0x4b')]({'where':{'id':_0x1b2d74['params']['id']}})[_0x989c('0x27')](handleEntityNotFound(_0x15fa8f,null))[_0x989c('0x27')](removeEntity(_0x15fa8f,null))['catch'](handleError(_0x15fa8f,null));}; \ No newline at end of file +var _0xd6bb=['rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','get','Dispositions','UserProfileResource','destroy','stack','name','send','index','map','Disposition'];(function(_0x232e87,_0x203795){var _0x18c3ba=function(_0x102683){while(--_0x102683){_0x232e87['push'](_0x232e87['shift']());}};_0x18c3ba(++_0x203795);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xd6bb[_0x1d5400];return _0x21d9fe;};'use strict';var emlformat=require(_0xbd6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd6b('0x1'));var jsonpatch=require(_0xbd6b('0x2'));var rp=require(_0xbd6b('0x3'));var moment=require(_0xbd6b('0x4'));var BPromise=require(_0xbd6b('0x5'));var Mustache=require('mustache');var util=require(_0xbd6b('0x6'));var path=require(_0xbd6b('0x7'));var sox=require(_0xbd6b('0x8'));var csv=require('to-csv');var ejs=require(_0xbd6b('0x9'));var fs=require('fs');var fs_extra=require(_0xbd6b('0xa'));var _=require(_0xbd6b('0xb'));var squel=require(_0xbd6b('0xc'));var crypto=require(_0xbd6b('0xd'));var jsforce=require(_0xbd6b('0xe'));var deskjs=require(_0xbd6b('0xf'));var toCsv=require(_0xbd6b('0x10'));var querystring=require(_0xbd6b('0x11'));var Papa=require(_0xbd6b('0x12'));var Redis=require(_0xbd6b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbd6b('0x14'));var as=require(_0xbd6b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd6b('0x16'))(_0xbd6b('0x17'));var utils=require('../../config/utils');var config=require(_0xbd6b('0x18'));var licenseUtil=require(_0xbd6b('0x19'));var db=require(_0xbd6b('0x1a'))['db'];function respondWithStatusCode(_0x34992e,_0x372139){_0x372139=_0x372139||0xcc;return function(_0x5225ea){if(_0x5225ea){return _0x34992e[_0xbd6b('0x1b')](_0x372139);}return _0x34992e[_0xbd6b('0x1c')](_0x372139)[_0xbd6b('0x1d')]();};}function respondWithResult(_0x4952ed,_0x504785){_0x504785=_0x504785||0xc8;return function(_0x557820){if(_0x557820){return _0x4952ed[_0xbd6b('0x1c')](_0x504785)[_0xbd6b('0x1e')](_0x557820);}};}function respondWithFilteredResult(_0xecaf18,_0x13e93a){return function(_0xa40969){if(_0xa40969){var _0x2208de=typeof _0x13e93a['offset']===_0xbd6b('0x1f')&&typeof _0x13e93a['limit']==='undefined';var _0x5437c1=_0xa40969[_0xbd6b('0x20')];var _0x1c0cad=_0x2208de?0x0:_0x13e93a[_0xbd6b('0x21')];var _0x50d857=_0x2208de?_0xa40969[_0xbd6b('0x20')]:_0x13e93a[_0xbd6b('0x21')]+_0x13e93a['limit'];var _0x11b28f;if(_0x50d857>=_0x5437c1){_0x50d857=_0x5437c1;_0x11b28f=0xc8;}else{_0x11b28f=0xce;}_0xecaf18[_0xbd6b('0x1c')](_0x11b28f);return _0xecaf18[_0xbd6b('0x22')](_0xbd6b('0x23'),_0x1c0cad+'-'+_0x50d857+'/'+_0x5437c1)[_0xbd6b('0x1e')](_0xa40969);}return null;};}function patchUpdates(_0x59aa3f){return function(_0x1233a4){try{jsonpatch[_0xbd6b('0x24')](_0x1233a4,_0x59aa3f,!![]);}catch(_0x2389c1){return BPromise[_0xbd6b('0x25')](_0x2389c1);}return _0x1233a4[_0xbd6b('0x26')]();};}function saveUpdates(_0x447b7a,_0x5e0be3){return function(_0x24ce5b){if(_0x24ce5b){return _0x24ce5b['update'](_0x447b7a)[_0xbd6b('0x27')](function(_0x34c452){return _0x34c452;});}return null;};}function removeEntity(_0x3ece0f,_0x5d6329){return function(_0x314526){if(_0x314526){return _0x314526['destroy']()[_0xbd6b('0x27')](function(){var _0x304bcd=_0x314526[_0xbd6b('0x28')]({'plain':!![]});var _0x323964=_0xbd6b('0x29');return db[_0xbd6b('0x2a')][_0xbd6b('0x2b')]({'where':{'type':_0x323964,'resourceId':_0x304bcd['id']}})[_0xbd6b('0x27')](function(){return _0x314526;});})[_0xbd6b('0x27')](function(){_0x3ece0f[_0xbd6b('0x1c')](0xcc)[_0xbd6b('0x1d')]();});}};}function handleEntityNotFound(_0x61c2ed,_0x3ec15e){return function(_0x2bcbee){if(!_0x2bcbee){_0x61c2ed['sendStatus'](0x194);}return _0x2bcbee;};}function handleError(_0x1ab650,_0x2ed9e7){_0x2ed9e7=_0x2ed9e7||0x1f4;return function(_0x391b59){logger['error'](_0x391b59[_0xbd6b('0x2c')]);if(_0x391b59[_0xbd6b('0x2d')]){delete _0x391b59[_0xbd6b('0x2d')];}_0x1ab650['status'](_0x2ed9e7)[_0xbd6b('0x2e')](_0x391b59);};}exports[_0xbd6b('0x2f')]=function(_0x103d59,_0x452248){var _0x229278={},_0x2a3b2f={},_0xe346a={'count':0x0,'rows':[]};var _0x1f342=_[_0xbd6b('0x30')](db[_0xbd6b('0x31')][_0xbd6b('0x32')],function(_0x22be2f){return{'name':_0x22be2f[_0xbd6b('0x33')],'type':_0x22be2f['type'][_0xbd6b('0x34')]};});_0x2a3b2f[_0xbd6b('0x35')]=_[_0xbd6b('0x30')](_0x1f342,_0xbd6b('0x2d'));_0x2a3b2f[_0xbd6b('0x36')]=_[_0xbd6b('0x37')](_0x103d59[_0xbd6b('0x36')]);_0x2a3b2f['filters']=_[_0xbd6b('0x38')](_0x2a3b2f[_0xbd6b('0x35')],_0x2a3b2f[_0xbd6b('0x36')]);_0x229278[_0xbd6b('0x39')]=_[_0xbd6b('0x38')](_0x2a3b2f[_0xbd6b('0x35')],qs[_0xbd6b('0x3a')](_0x103d59[_0xbd6b('0x36')]['fields']));_0x229278[_0xbd6b('0x39')]=_0x229278['attributes'][_0xbd6b('0x3b')]?_0x229278[_0xbd6b('0x39')]:_0x2a3b2f[_0xbd6b('0x35')];if(!_0x103d59[_0xbd6b('0x36')][_0xbd6b('0x3c')]('nolimit')){_0x229278['limit']=qs[_0xbd6b('0x3d')](_0x103d59['query'][_0xbd6b('0x3d')]);_0x229278[_0xbd6b('0x21')]=qs[_0xbd6b('0x21')](_0x103d59[_0xbd6b('0x36')][_0xbd6b('0x21')]);}_0x229278['order']=qs[_0xbd6b('0x3e')](_0x103d59['query']['sort']);_0x229278[_0xbd6b('0x3f')]=qs[_0xbd6b('0x40')](_[_0xbd6b('0x41')](_0x103d59[_0xbd6b('0x36')],_0x2a3b2f[_0xbd6b('0x40')]),_0x1f342);if(_0x103d59['query'][_0xbd6b('0x42')]){_0x229278[_0xbd6b('0x3f')]=_[_0xbd6b('0x43')](_0x229278['where'],{'$or':_[_0xbd6b('0x30')](_0x1f342,function(_0x3f885f){if(_0x3f885f[_0xbd6b('0x44')]!=='VIRTUAL'){var _0x1a95b9={};_0x1a95b9[_0x3f885f[_0xbd6b('0x2d')]]={'$like':'%'+_0x103d59['query'][_0xbd6b('0x42')]+'%'};return _0x1a95b9;}})});}_0x229278=_['merge']({},_0x229278,_0x103d59[_0xbd6b('0x45')]);var _0x20279c={'where':_0x229278['where']};return db['Disposition'][_0xbd6b('0x20')](_0x20279c)[_0xbd6b('0x27')](function(_0x37dc25){_0xe346a['count']=_0x37dc25;if(_0x103d59['query'][_0xbd6b('0x46')]){_0x229278[_0xbd6b('0x47')]=[{'all':!![]}];}return db[_0xbd6b('0x31')]['findAll'](_0x229278);})[_0xbd6b('0x27')](function(_0x179245){_0xe346a[_0xbd6b('0x48')]=_0x179245;return _0xe346a;})[_0xbd6b('0x27')](respondWithFilteredResult(_0x452248,_0x229278))['catch'](handleError(_0x452248,null));};exports[_0xbd6b('0x49')]=function(_0x580953,_0x2a799c){var _0x58a695={'raw':!![],'where':{'id':_0x580953[_0xbd6b('0x4a')]['id']}},_0x36b440={};_0x36b440[_0xbd6b('0x35')]=_['keys'](db['Disposition'][_0xbd6b('0x32')]);_0x36b440[_0xbd6b('0x36')]=_[_0xbd6b('0x37')](_0x580953['query']);_0x36b440[_0xbd6b('0x40')]=_[_0xbd6b('0x38')](_0x36b440[_0xbd6b('0x35')],_0x36b440[_0xbd6b('0x36')]);_0x58a695[_0xbd6b('0x39')]=_[_0xbd6b('0x38')](_0x36b440[_0xbd6b('0x35')],qs[_0xbd6b('0x3a')](_0x580953[_0xbd6b('0x36')]['fields']));_0x58a695['attributes']=_0x58a695[_0xbd6b('0x39')]['length']?_0x58a695[_0xbd6b('0x39')]:_0x36b440[_0xbd6b('0x35')];if(_0x580953[_0xbd6b('0x36')][_0xbd6b('0x46')]){_0x58a695[_0xbd6b('0x47')]=[{'all':!![]}];}_0x58a695=_[_0xbd6b('0x43')]({},_0x58a695,_0x580953[_0xbd6b('0x45')]);return db['Disposition'][_0xbd6b('0x4b')](_0x58a695)[_0xbd6b('0x27')](handleEntityNotFound(_0x2a799c,null))[_0xbd6b('0x27')](respondWithResult(_0x2a799c,null))[_0xbd6b('0x4c')](handleError(_0x2a799c,null));};exports['create']=function(_0x4e2975,_0x2aa0c6){return db[_0xbd6b('0x31')][_0xbd6b('0x4d')](_0x4e2975[_0xbd6b('0x4e')],{})['then'](function(_0x32ecd8){var _0x49edb6=_0x4e2975['user'][_0xbd6b('0x28')]({'plain':!![]});if(!_0x49edb6)throw new Error(_0xbd6b('0x4f'));if(_0x49edb6[_0xbd6b('0x50')]==='user'){var _0x5a2fdd=_0x32ecd8[_0xbd6b('0x28')]({'plain':!![]});var _0x57724c=_0xbd6b('0x29');return db[_0xbd6b('0x51')][_0xbd6b('0x4b')]({'where':{'name':_0x57724c,'userProfileId':_0x49edb6[_0xbd6b('0x52')]},'raw':!![]})[_0xbd6b('0x27')](function(_0x177931){if(_0x177931&&_0x177931[_0xbd6b('0x53')]===0x0){return db[_0xbd6b('0x2a')]['create']({'name':_0x5a2fdd[_0xbd6b('0x2d')],'resourceId':_0x5a2fdd['id'],'type':_0x177931[_0xbd6b('0x2d')],'sectionId':_0x177931['id']},{})['then'](function(){return _0x32ecd8;});}else{return _0x32ecd8;}})[_0xbd6b('0x4c')](function(_0x3bcd5b){logger['error'](_0xbd6b('0x54'),_0x3bcd5b);throw _0x3bcd5b;});}return _0x32ecd8;})[_0xbd6b('0x27')](respondWithResult(_0x2aa0c6,0xc9))[_0xbd6b('0x4c')](handleError(_0x2aa0c6,null));};exports['update']=function(_0x1da6f8,_0x44b16d){if(_0x1da6f8[_0xbd6b('0x4e')]['id']){delete _0x1da6f8[_0xbd6b('0x4e')]['id'];}return db['Disposition']['find']({'where':{'id':_0x1da6f8[_0xbd6b('0x4a')]['id']}})[_0xbd6b('0x27')](handleEntityNotFound(_0x44b16d,null))[_0xbd6b('0x27')](saveUpdates(_0x1da6f8[_0xbd6b('0x4e')],null))[_0xbd6b('0x27')](respondWithResult(_0x44b16d,null))[_0xbd6b('0x4c')](handleError(_0x44b16d,null));};exports['destroy']=function(_0x20b9d4,_0x2002ce){return db['Disposition'][_0xbd6b('0x4b')]({'where':{'id':_0x20b9d4[_0xbd6b('0x4a')]['id']}})[_0xbd6b('0x27')](handleEntityNotFound(_0x2002ce,null))[_0xbd6b('0x27')](removeEntity(_0x2002ce,null))[_0xbd6b('0x4c')](handleError(_0x2002ce,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index ef81700..821cdfa 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2700=['OpenchannelAccountId','util','../../config/logger','api','moment','request-promise','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','SmsAccountId','name_openchannel'];(function(_0x5eb386,_0x20aa29){var _0x223a3c=function(_0x218b97){while(--_0x218b97){_0x5eb386['push'](_0x5eb386['shift']());}};_0x223a3c(++_0x20aa29);}(_0x2700,0xd2));var _0x0270=function(_0x57c741,_0x26dcc5){_0x57c741=_0x57c741-0x0;var _0x248821=_0x2700[_0x57c741];return _0x248821;};'use strict';var _=require('lodash');var util=require(_0x0270('0x0'));var logger=require(_0x0270('0x1'))(_0x0270('0x2'));var moment=require(_0x0270('0x3'));var BPromise=require('bluebird');var rp=require(_0x0270('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0270('0x5'));var config=require('../../config/environment');var attributes=require(_0x0270('0x6'));module[_0x0270('0x7')]=function(_0x2478f5,_0x20e833){return _0x2478f5['define'](_0x0270('0x8'),attributes,{'tableName':_0x0270('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0270('0xa'),'fields':[_0x0270('0xb'),_0x0270('0xc')]},{'unique':!![],'name':_0x0270('0xd'),'fields':['name',_0x0270('0xe')]},{'unique':!![],'name':_0x0270('0xf'),'fields':[_0x0270('0xb'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x0270('0xb'),_0x0270('0x10')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0x0270('0x11'),'fields':['name',_0x0270('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x0270('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x281e=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel','WhatsappAccountId','lodash','util','../../config/logger','../../config/environment','exports'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x281e,0x13f));var _0xe281=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x281e[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0xe281('0x0'));var util=require(_0xe281('0x1'));var logger=require(_0xe281('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe281('0x3'));var attributes=require('./disposition.attributes');module[_0xe281('0x4')]=function(_0x21eecd,_0x3c2daa){return _0x21eecd['define'](_0xe281('0x5'),attributes,{'tableName':_0xe281('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe281('0x7'),'fields':[_0xe281('0x8'),_0xe281('0x9')]},{'unique':!![],'name':_0xe281('0xa'),'fields':[_0xe281('0x8'),_0xe281('0xb')]},{'unique':!![],'name':_0xe281('0xc'),'fields':[_0xe281('0x8'),_0xe281('0xd')]},{'unique':!![],'name':_0xe281('0xe'),'fields':[_0xe281('0x8'),'SmsAccountId']},{'unique':!![],'name':_0xe281('0xf'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xe281('0x10'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xe281('0x8'),_0xe281('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 45735c6..a9d72d4 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27d114,_0x144093){var _0x587794=function(_0x22e8a0){while(--_0x22e8a0){_0x27d114['push'](_0x27d114['shift']());}};_0x587794(++_0x144093);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x73ba6c,_0x144dbe){var _0x43f8b1=function(_0x567e61){while(--_0x567e61){_0x73ba6c['push'](_0x73ba6c['shift']());}};_0x43f8b1(++_0x144dbe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 6c9af4f..cf300c5 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6107=['get','/:id','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x6107,0x114));var _0x7610=function(_0x211de3,_0x1112e2){_0x211de3=_0x211de3-0x0;var _0x3a6b12=_0x6107[_0x211de3];return _0x3a6b12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7610('0x0'));var timeout=require('connect-timeout');var express=require(_0x7610('0x1'));var router=express[_0x7610('0x2')]();var fs_extra=require(_0x7610('0x3'));var auth=require(_0x7610('0x4'));var interaction=require(_0x7610('0x5'));var config=require(_0x7610('0x6'));var controller=require(_0x7610('0x7'));router['get']('/',auth[_0x7610('0x8')](),controller[_0x7610('0x9')]);router[_0x7610('0xa')](_0x7610('0xb'),auth[_0x7610('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7610('0xc')](_0x7610('0xb'),auth[_0x7610('0x8')](),controller['update']);router['delete']('/:id',auth[_0x7610('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd812=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd812,0x1a5));var _0x2d81=function(_0x5a25f6,_0x3db5cb){_0x5a25f6=_0x5a25f6-0x0;var _0x5a524d=_0xd812[_0x5a25f6];return _0x5a524d;};'use strict';var multer=require(_0x2d81('0x0'));var util=require(_0x2d81('0x1'));var path=require(_0x2d81('0x2'));var timeout=require(_0x2d81('0x3'));var express=require(_0x2d81('0x4'));var router=express[_0x2d81('0x5')]();var fs_extra=require(_0x2d81('0x6'));var auth=require(_0x2d81('0x7'));var interaction=require(_0x2d81('0x8'));var config=require('../../config/environment');var controller=require(_0x2d81('0x9'));router[_0x2d81('0xa')]('/',auth[_0x2d81('0xb')](),controller[_0x2d81('0xc')]);router[_0x2d81('0xa')](_0x2d81('0xd'),auth[_0x2d81('0xb')](),controller['show']);router['post']('/',auth[_0x2d81('0xb')](),controller[_0x2d81('0xe')]);router[_0x2d81('0xf')](_0x2d81('0xd'),auth[_0x2d81('0xb')](),controller[_0x2d81('0x10')]);router[_0x2d81('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2d81('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index cb7a46f..ef8276a 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa81c=['SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','DADHI'];(function(_0x28887d,_0x1247e6){var _0x29762b=function(_0x3f43f2){while(--_0x3f43f2){_0x28887d['push'](_0x28887d['shift']());}};_0x29762b(++_0x1247e6);}(_0xa81c,0xb7));var _0xca81=function(_0x171036,_0x2d43e5){_0x171036=_0x171036-0x0;var _0x337c5e=_0xa81c[_0x171036];return _0x337c5e;};'use strict';var Sequelize=require('sequelize');module[_0xca81('0x0')]={'name':{'type':Sequelize[_0xca81('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xca81('0x2')},'headerinfo':{'type':Sequelize[_0xca81('0x1')],'defaultValue':_0xca81('0x3')},'localstationid':{'type':Sequelize[_0xca81('0x1')],'unique':_0xca81('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xca81('0x5'),_0xca81('0x6'),_0xca81('0x7'),_0xca81('0x8'),_0xca81('0x9'),_0xca81('0xa')),'defaultValue':_0xca81('0x6')},'maxrate':{'type':Sequelize[_0xca81('0xb')](_0xca81('0x5'),_0xca81('0x6'),'7200',_0xca81('0x8'),'12000',_0xca81('0xa')),'defaultValue':_0xca81('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xca81('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xca81('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xca81('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xca81('0xb')]('SIP','IAX',_0xca81('0xe'),'KHOMP'),'defaultValue':_0xca81('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xca81('0x10')],'defaultValue':function(){return _0xca81('0x11');}},'notificationSound':{'type':Sequelize[_0xca81('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca81('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca81('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca81('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca81('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca81('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xca81('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xca81('0x14'),'set':function(_0x45a09b){if(!_0x45a09b)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xca81('0x15'),_0x45a09b);}}}; \ No newline at end of file +var _0x14f6=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','7200','12000','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x3cb827,_0x12b96c){var _0x55e5d2=function(_0x203ec5){while(--_0x203ec5){_0x3cb827['push'](_0x3cb827['shift']());}};_0x55e5d2(++_0x12b96c);}(_0x14f6,0xbc));var _0x614f=function(_0x409fa0,_0x3e5ae2){_0x409fa0=_0x409fa0-0x0;var _0x125054=_0x14f6[_0x409fa0];return _0x125054;};'use strict';var Sequelize=require(_0x614f('0x0'));module[_0x614f('0x1')]={'name':{'type':Sequelize[_0x614f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x614f('0x3')](_0x614f('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x614f('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x614f('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x614f('0x6'),'4800',_0x614f('0x7'),'9600',_0x614f('0x8'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x614f('0x3')]('2400','4800',_0x614f('0x7'),'9600',_0x614f('0x8'),_0x614f('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x614f('0x2')],'defaultValue':_0x614f('0xa')},'gateway':{'type':Sequelize[_0x614f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x614f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x614f('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x614f('0x3')](_0x614f('0xc'),'IAX',_0x614f('0xd'),_0x614f('0xe')),'defaultValue':_0x614f('0xc')},'key':{'type':Sequelize[_0x614f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x614f('0xf')],'defaultValue':function(){return _0x614f('0x10');}},'notificationSound':{'type':Sequelize[_0x614f('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x614f('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x614f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x614f('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x614f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x614f('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x614f('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x614f('0x11')],'defaultValue':![],'comment':_0x614f('0x13'),'set':function(_0x1c87c5){if(!_0x1c87c5)this['setDataValue'](_0x614f('0x14'),null);this[_0x614f('0x15')](_0x614f('0x16'),_0x1c87c5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4cbf79b..75c21ba 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1df=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','mandatoryDispositionPause','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','ids','getInteractions','CmContact','Contact','fullname','internal','Tags','color','tag','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','out','filename','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes'];(function(_0x2712b2,_0x13def1){var _0x3f48af=function(_0x2d21ba){while(--_0x2d21ba){_0x2712b2['push'](_0x2712b2['shift']());}};_0x3f48af(++_0x13def1);}(_0xa1df,0x80));var _0xfa1d=function(_0x20343d,_0x17c303){_0x20343d=_0x20343d-0x0;var _0x14913b=_0xa1df[_0x20343d];return _0x14913b;};'use strict';var emlformat=require(_0xfa1d('0x0'));var rimraf=require(_0xfa1d('0x1'));var zipdir=require(_0xfa1d('0x2'));var jsonpatch=require(_0xfa1d('0x3'));var rp=require(_0xfa1d('0x4'));var moment=require(_0xfa1d('0x5'));var BPromise=require(_0xfa1d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa1d('0x7'));var sox=require(_0xfa1d('0x8'));var csv=require(_0xfa1d('0x9'));var ejs=require(_0xfa1d('0xa'));var fs=require('fs');var fs_extra=require(_0xfa1d('0xb'));var _=require(_0xfa1d('0xc'));var squel=require('squel');var crypto=require(_0xfa1d('0xd'));var jsforce=require(_0xfa1d('0xe'));var deskjs=require(_0xfa1d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfa1d('0x10'));var Redis=require(_0xfa1d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa1d('0x12'))('api');var utils=require(_0xfa1d('0x13'));var config=require(_0xfa1d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa1d('0x15'))['db'];config[_0xfa1d('0x16')]=_[_0xfa1d('0x17')](config[_0xfa1d('0x16')],{'host':_0xfa1d('0x18'),'port':0x18eb});var socket=require(_0xfa1d('0x19'))(new Redis(config[_0xfa1d('0x16')]));require(_0xfa1d('0x1a'))[_0xfa1d('0x1b')](socket);var jayson=require(_0xfa1d('0x1c'));var client=jayson[_0xfa1d('0x1d')][_0xfa1d('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xfa1d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1e0c4d,_0x493eb9,_0x308d57,_0x2095bb){return new BPromise(function(_0x397b37,_0xb31736){var _0x5ebbc7=_0x2095bb||client;return _0x5ebbc7[_0xfa1d('0x1f')](_0x1e0c4d,_0x308d57)[_0xfa1d('0x20')](function(_0x5c5dc9){logger[_0xfa1d('0x21')](_0xfa1d('0x22'),_0x493eb9,'request\x20sent');logger[_0xfa1d('0x23')](_0xfa1d('0x24'),_0x493eb9,_0xfa1d('0x25'),JSON[_0xfa1d('0x26')](_0x5c5dc9));if(_0x5c5dc9[_0xfa1d('0x27')]){if(_0x5c5dc9[_0xfa1d('0x27')][_0xfa1d('0x28')]===0x1f4){logger['error'](_0xfa1d('0x22'),_0x493eb9,_0x5c5dc9[_0xfa1d('0x27')][_0xfa1d('0x29')]);return _0xb31736(_0x5c5dc9[_0xfa1d('0x27')][_0xfa1d('0x29')]);}logger[_0xfa1d('0x27')]('FaxAccount,\x20%s,\x20%s',_0x493eb9,_0x5c5dc9[_0xfa1d('0x27')][_0xfa1d('0x29')]);return _0x397b37(_0x5c5dc9[_0xfa1d('0x27')][_0xfa1d('0x29')]);}else{logger[_0xfa1d('0x21')]('FaxAccount,\x20%s,\x20%s',_0x493eb9,_0xfa1d('0x25'));_0x397b37(_0x5c5dc9[_0xfa1d('0x2a')]['message']);}})[_0xfa1d('0x2b')](function(_0x546b51){logger[_0xfa1d('0x27')](_0xfa1d('0x22'),_0x493eb9,_0x546b51);_0xb31736(_0x546b51);});});}function respondWithStatusCode(_0x2bb36b,_0x4df7a1){_0x4df7a1=_0x4df7a1||0xcc;return function(_0x1e3c61){if(_0x1e3c61){return _0x2bb36b[_0xfa1d('0x2c')](_0x4df7a1);}return _0x2bb36b['status'](_0x4df7a1)[_0xfa1d('0x2d')]();};}function respondWithResult(_0x3b0097,_0x129431){_0x129431=_0x129431||0xc8;return function(_0x2193ec){if(_0x2193ec){return _0x3b0097[_0xfa1d('0x2e')](_0x129431)['json'](_0x2193ec);}};}function respondWithFilteredResult(_0x33aef2,_0x418733){return function(_0x5a3f28){if(_0x5a3f28){var _0x326c10=typeof _0x418733[_0xfa1d('0x2f')]===_0xfa1d('0x30')&&typeof _0x418733['limit']==='undefined';var _0x2f9510=_0x5a3f28[_0xfa1d('0x31')];var _0x280b5b=_0x326c10?0x0:_0x418733[_0xfa1d('0x2f')];var _0x2dd47a=_0x326c10?_0x5a3f28[_0xfa1d('0x31')]:_0x418733[_0xfa1d('0x2f')]+_0x418733[_0xfa1d('0x32')];var _0x264429;if(_0x2dd47a>=_0x2f9510){_0x2dd47a=_0x2f9510;_0x264429=0xc8;}else{_0x264429=0xce;}_0x33aef2['status'](_0x264429);return _0x33aef2[_0xfa1d('0x33')](_0xfa1d('0x34'),_0x280b5b+'-'+_0x2dd47a+'/'+_0x2f9510)[_0xfa1d('0x35')](_0x5a3f28);}return null;};}function patchUpdates(_0x1febec){return function(_0x4a4c1e){try{jsonpatch[_0xfa1d('0x36')](_0x4a4c1e,_0x1febec,!![]);}catch(_0x7df0bf){return BPromise['reject'](_0x7df0bf);}return _0x4a4c1e[_0xfa1d('0x37')]();};}function saveUpdates(_0x967414,_0x3916b3){return function(_0x11908e){if(_0x11908e){return _0x11908e[_0xfa1d('0x38')](_0x967414)[_0xfa1d('0x20')](function(_0x57e930){return _0x57e930;});}return null;};}function removeEntity(_0x2e8542,_0x576dbc){return function(_0xd9550d){if(_0xd9550d){return _0xd9550d['destroy']()[_0xfa1d('0x20')](function(){var _0x241440=_0xd9550d['get']({'plain':!![]});var _0x536f5a=_0xfa1d('0x39');return db[_0xfa1d('0x3a')][_0xfa1d('0x3b')]({'where':{'type':_0x536f5a,'resourceId':_0x241440['id']}})[_0xfa1d('0x20')](function(){return _0xd9550d;});})[_0xfa1d('0x20')](function(){_0x2e8542['status'](0xcc)[_0xfa1d('0x2d')]();});}};}function handleEntityNotFound(_0x3f57b9,_0x9f279f){return function(_0x10bf8e){if(!_0x10bf8e){_0x3f57b9[_0xfa1d('0x2c')](0x194);}return _0x10bf8e;};}function handleError(_0x6fb6b5,_0x51dafc){_0x51dafc=_0x51dafc||0x1f4;return function(_0x418349){logger[_0xfa1d('0x27')](_0x418349[_0xfa1d('0x3c')]);if(_0x418349['name']){delete _0x418349[_0xfa1d('0x3d')];}_0x6fb6b5['status'](_0x51dafc)[_0xfa1d('0x3e')](_0x418349);};}exports[_0xfa1d('0x3f')]=function(_0x1158f9,_0x5a96a0){var _0x54b604={'include':[{'model':db[_0xfa1d('0x40')],'as':'mandatoryDispositionPause'}]},_0x5d2288={},_0x20414d={'count':0x0,'rows':[]};var _0x3847e0=_[_0xfa1d('0x41')](db[_0xfa1d('0x42')][_0xfa1d('0x43')],function(_0x179f7b){return{'name':_0x179f7b[_0xfa1d('0x44')],'type':_0x179f7b[_0xfa1d('0x45')][_0xfa1d('0x46')]};});_0x5d2288['model']=_['map'](_0x3847e0,_0xfa1d('0x3d'));_0x5d2288[_0xfa1d('0x47')]=_['keys'](_0x1158f9[_0xfa1d('0x47')]);_0x5d2288[_0xfa1d('0x48')]=_[_0xfa1d('0x49')](_0x5d2288[_0xfa1d('0x4a')],_0x5d2288['query']);_0x54b604['attributes']=_[_0xfa1d('0x49')](_0x5d2288[_0xfa1d('0x4a')],qs['fields'](_0x1158f9['query'][_0xfa1d('0x4b')]));_0x54b604[_0xfa1d('0x4c')]=_0x54b604[_0xfa1d('0x4c')][_0xfa1d('0x4d')]?_0x54b604['attributes']:_0x5d2288[_0xfa1d('0x4a')];if(!_0x1158f9['query'][_0xfa1d('0x4e')](_0xfa1d('0x4f'))){_0x54b604[_0xfa1d('0x32')]=qs[_0xfa1d('0x32')](_0x1158f9['query'][_0xfa1d('0x32')]);_0x54b604[_0xfa1d('0x2f')]=qs[_0xfa1d('0x2f')](_0x1158f9[_0xfa1d('0x47')][_0xfa1d('0x2f')]);}_0x54b604[_0xfa1d('0x50')]=qs[_0xfa1d('0x51')](_0x1158f9['query'][_0xfa1d('0x51')]);_0x54b604[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0x1158f9[_0xfa1d('0x47')],_0x5d2288[_0xfa1d('0x48')]),_0x3847e0);if(_0x1158f9[_0xfa1d('0x47')][_0xfa1d('0x54')]){_0x54b604[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x54b604[_0xfa1d('0x52')],{'$or':_['map'](_0x3847e0,function(_0x3738bf){if(_0x3738bf['type']!==_0xfa1d('0x56')){var _0xb4c14b={};_0xb4c14b[_0x3738bf['name']]={'$like':'%'+_0x1158f9[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0xb4c14b;}})});}_0x54b604=_[_0xfa1d('0x55')]({},_0x54b604,_0x1158f9[_0xfa1d('0x57')]);var _0x33b821={'where':_0x54b604[_0xfa1d('0x52')]};return db[_0xfa1d('0x42')][_0xfa1d('0x31')](_0x33b821)['then'](function(_0x19d563){_0x20414d[_0xfa1d('0x31')]=_0x19d563;if(_0x1158f9[_0xfa1d('0x47')][_0xfa1d('0x58')]){_0x54b604[_0xfa1d('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0xfa1d('0x5a')](_0x54b604);})[_0xfa1d('0x20')](function(_0x554599){_0x20414d['rows']=_0x554599;return _0x20414d;})[_0xfa1d('0x20')](respondWithFilteredResult(_0x5a96a0,_0x54b604))[_0xfa1d('0x2b')](handleError(_0x5a96a0,null));};exports[_0xfa1d('0x5b')]=function(_0xf82c83,_0x3cbaae){var _0x17368b={'raw':![],'where':{'id':_0xf82c83[_0xfa1d('0x5c')]['id']},'include':[{'model':db[_0xfa1d('0x40')],'as':_0xfa1d('0x5d')}]},_0x30485b={};_0x30485b[_0xfa1d('0x4a')]=_['keys'](db[_0xfa1d('0x42')][_0xfa1d('0x43')]);_0x30485b[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0xf82c83[_0xfa1d('0x47')]);_0x30485b['filters']=_[_0xfa1d('0x49')](_0x30485b[_0xfa1d('0x4a')],_0x30485b['query']);_0x17368b[_0xfa1d('0x4c')]=_[_0xfa1d('0x49')](_0x30485b[_0xfa1d('0x4a')],qs[_0xfa1d('0x4b')](_0xf82c83[_0xfa1d('0x47')][_0xfa1d('0x4b')]));_0x17368b[_0xfa1d('0x4c')]=_0x17368b['attributes'][_0xfa1d('0x4d')]?_0x17368b[_0xfa1d('0x4c')]:_0x30485b[_0xfa1d('0x4a')];if(_0xf82c83['query'][_0xfa1d('0x58')]){_0x17368b[_0xfa1d('0x59')]=[{'all':!![]}];}_0x17368b=_['merge']({},_0x17368b,_0xf82c83['options']);return db[_0xfa1d('0x42')][_0xfa1d('0x5f')](_0x17368b)[_0xfa1d('0x20')](handleEntityNotFound(_0x3cbaae,null))[_0xfa1d('0x20')](respondWithResult(_0x3cbaae,null))[_0xfa1d('0x2b')](handleError(_0x3cbaae,null));};exports[_0xfa1d('0x60')]=function(_0x175580,_0x3abf99){return db['FaxAccount'][_0xfa1d('0x60')](_0x175580[_0xfa1d('0x61')],{})['then'](function(_0x3a4695){var _0x378980=_0x175580['user'][_0xfa1d('0x62')]({'plain':!![]});if(!_0x378980)throw new Error(_0xfa1d('0x63'));if(_0x378980[_0xfa1d('0x64')]===_0xfa1d('0x65')){var _0x3afeda=_0x3a4695['get']({'plain':!![]});var _0x586c2b='FaxAccounts';return db[_0xfa1d('0x66')][_0xfa1d('0x5f')]({'where':{'name':_0x586c2b,'userProfileId':_0x378980[_0xfa1d('0x67')]},'raw':!![]})['then'](function(_0x879ea4){if(_0x879ea4&&_0x879ea4[_0xfa1d('0x68')]===0x0){return db[_0xfa1d('0x3a')][_0xfa1d('0x60')]({'name':_0x3afeda[_0xfa1d('0x3d')],'resourceId':_0x3afeda['id'],'type':_0x879ea4['name'],'sectionId':_0x879ea4['id']},{})['then'](function(){return _0x3a4695;});}else{return _0x3a4695;}})[_0xfa1d('0x2b')](function(_0x4fc2a0){logger['error'](_0xfa1d('0x69'),_0x4fc2a0);throw _0x4fc2a0;});}return _0x3a4695;})['then'](respondWithResult(_0x3abf99,0xc9))[_0xfa1d('0x2b')](handleError(_0x3abf99,null));};exports[_0xfa1d('0x38')]=function(_0x645c33,_0xc260e7){if(_0x645c33[_0xfa1d('0x61')]['id']){delete _0x645c33[_0xfa1d('0x61')]['id'];}return db['FaxAccount'][_0xfa1d('0x5f')]({'where':{'id':_0x645c33[_0xfa1d('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xc260e7,null))['then'](saveUpdates(_0x645c33[_0xfa1d('0x61')],null))[_0xfa1d('0x20')](respondWithResult(_0xc260e7,null))[_0xfa1d('0x2b')](handleError(_0xc260e7,null));};exports['destroy']=function(_0x340a1e,_0x99823c){return db[_0xfa1d('0x42')][_0xfa1d('0x5f')]({'where':{'id':_0x340a1e[_0xfa1d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x99823c,null))[_0xfa1d('0x20')](removeEntity(_0x99823c,null))['catch'](handleError(_0x99823c,null));};exports[_0xfa1d('0x6a')]=function(_0x2ec7a5,_0x2923b6){return db[_0xfa1d('0x42')][_0xfa1d('0x6a')]()[_0xfa1d('0x20')](respondWithResult(_0x2923b6,null))[_0xfa1d('0x2b')](handleError(_0x2923b6,null));};exports['addDisposition']=function(_0x20c95f,_0x15db05,_0x50dbee){if(_0x20c95f[_0xfa1d('0x61')]['id']){delete _0x20c95f[_0xfa1d('0x61')]['id'];}return db['FaxAccount'][_0xfa1d('0x5f')]({'where':{'id':_0x20c95f[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x15db05,null))[_0xfa1d('0x20')](function(_0x89b45e){if(_0x89b45e){_0x20c95f[_0xfa1d('0x61')][_0xfa1d('0x6b')]=_0x89b45e['id'];return db[_0xfa1d('0x6c')]['create'](_0x20c95f[_0xfa1d('0x61')]);}})[_0xfa1d('0x20')](respondWithResult(_0x15db05,null))['catch'](handleError(_0x15db05,null));};exports[_0xfa1d('0x6d')]=function(_0x54f8cc,_0xad2b00,_0x4c654b){var _0x36ec37={'raw':![],'where':{}};var _0xeec1ce={};var _0x505739={'count':0x0,'rows':[]};return db[_0xfa1d('0x42')][_0xfa1d('0x6e')]({'where':{'id':_0x54f8cc[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0xad2b00,null))[_0xfa1d('0x20')](function(_0x3bba27){if(_0x3bba27){_0xeec1ce[_0xfa1d('0x4a')]=_['keys'](db[_0xfa1d('0x6c')][_0xfa1d('0x43')]);_0xeec1ce[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0x54f8cc[_0xfa1d('0x47')]);_0xeec1ce[_0xfa1d('0x48')]=_[_0xfa1d('0x49')](_0xeec1ce[_0xfa1d('0x4a')],_0xeec1ce['query']);_0x36ec37[_0xfa1d('0x4c')]=_['intersection'](_0xeec1ce['model'],qs[_0xfa1d('0x4b')](_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x4b')]));_0x36ec37[_0xfa1d('0x4c')]=_0x36ec37[_0xfa1d('0x4c')]['length']?_0x36ec37[_0xfa1d('0x4c')]:_0xeec1ce[_0xfa1d('0x4a')];if(!_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x4e')](_0xfa1d('0x4f'))){_0x36ec37[_0xfa1d('0x32')]=qs[_0xfa1d('0x32')](_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x32')]);_0x36ec37[_0xfa1d('0x2f')]=qs['offset'](_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x2f')]);}_0x36ec37['order']=qs[_0xfa1d('0x51')](_0x54f8cc['query'][_0xfa1d('0x51')]);_0x36ec37[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0x54f8cc[_0xfa1d('0x47')],_0xeec1ce[_0xfa1d('0x48')]));_0x36ec37[_0xfa1d('0x52')][_0xfa1d('0x6b')]=_0x3bba27['id'];if(_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x54')]){_0x36ec37[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x36ec37[_0xfa1d('0x52')],{'$or':_[_0xfa1d('0x41')](_0x36ec37[_0xfa1d('0x4c')],function(_0x2f9d59){var _0x2fbccc={};_0x2fbccc[_0x2f9d59]={'$like':'%'+_0x54f8cc[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0x2fbccc;})});}_0x36ec37=_['merge']({},_0x36ec37,_0x54f8cc[_0xfa1d('0x57')]);return db[_0xfa1d('0x6c')][_0xfa1d('0x31')]({'where':_0x36ec37[_0xfa1d('0x52')]})[_0xfa1d('0x20')](function(_0x177f34){_0x505739['count']=_0x177f34;if(_0x54f8cc['query'][_0xfa1d('0x58')]){_0x36ec37['include']=[{'all':!![]}];}return db['Disposition'][_0xfa1d('0x5a')](_0x36ec37);})['then'](function(_0x3e2450){_0x505739[_0xfa1d('0x6f')]=_0x3e2450;return _0x505739;});}})['then'](respondWithFilteredResult(_0xad2b00,_0x36ec37))[_0xfa1d('0x2b')](handleError(_0xad2b00,null));};exports[_0xfa1d('0x70')]=function(_0x2675ca,_0x1d2971,_0x4c38b9){return db[_0xfa1d('0x42')][_0xfa1d('0x5f')]({'where':{'id':_0x2675ca[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x1d2971,null))['then'](function(_0x59b865){if(_0x59b865){return _0x59b865['removeDispositions'](_0x2675ca[_0xfa1d('0x47')]['ids']);}})[_0xfa1d('0x20')](respondWithStatusCode(_0x1d2971,null))['catch'](handleError(_0x1d2971,null));};exports[_0xfa1d('0x71')]=function(_0x215369,_0x1e64ad,_0xbea635){if(_0x215369[_0xfa1d('0x61')]['id']){delete _0x215369[_0xfa1d('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x215369['params']['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x1e64ad,null))[_0xfa1d('0x20')](function(_0x4d8999){if(_0x4d8999){_0x215369[_0xfa1d('0x61')][_0xfa1d('0x6b')]=_0x4d8999['id'];return db[_0xfa1d('0x72')]['create'](_0x215369['body']);}})['then'](respondWithResult(_0x1e64ad,null))['catch'](handleError(_0x1e64ad,null));};exports['getAnswers']=function(_0xc17075,_0x202832,_0x8b437){var _0x19400b={'raw':![],'where':{}};var _0x1c9fbf={};var _0x346093={'count':0x0,'rows':[]};return db[_0xfa1d('0x42')][_0xfa1d('0x6e')]({'where':{'id':_0xc17075[_0xfa1d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x202832,null))[_0xfa1d('0x20')](function(_0x139a3c){if(_0x139a3c){_0x1c9fbf[_0xfa1d('0x4a')]=_[_0xfa1d('0x5e')](db[_0xfa1d('0x72')][_0xfa1d('0x43')]);_0x1c9fbf[_0xfa1d('0x47')]=_['keys'](_0xc17075['query']);_0x1c9fbf[_0xfa1d('0x48')]=_[_0xfa1d('0x49')](_0x1c9fbf[_0xfa1d('0x4a')],_0x1c9fbf[_0xfa1d('0x47')]);_0x19400b['attributes']=_['intersection'](_0x1c9fbf[_0xfa1d('0x4a')],qs['fields'](_0xc17075[_0xfa1d('0x47')][_0xfa1d('0x4b')]));_0x19400b[_0xfa1d('0x4c')]=_0x19400b['attributes']['length']?_0x19400b[_0xfa1d('0x4c')]:_0x1c9fbf[_0xfa1d('0x4a')];if(!_0xc17075[_0xfa1d('0x47')][_0xfa1d('0x4e')](_0xfa1d('0x4f'))){_0x19400b[_0xfa1d('0x32')]=qs['limit'](_0xc17075['query'][_0xfa1d('0x32')]);_0x19400b[_0xfa1d('0x2f')]=qs['offset'](_0xc17075['query'][_0xfa1d('0x2f')]);}_0x19400b[_0xfa1d('0x50')]=qs[_0xfa1d('0x51')](_0xc17075[_0xfa1d('0x47')][_0xfa1d('0x51')]);_0x19400b[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0xc17075[_0xfa1d('0x47')],_0x1c9fbf[_0xfa1d('0x48')]));_0x19400b[_0xfa1d('0x52')]['FaxAccountId']=_0x139a3c['id'];if(_0xc17075['query'][_0xfa1d('0x54')]){_0x19400b[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x19400b[_0xfa1d('0x52')],{'$or':_['map'](_0x19400b[_0xfa1d('0x4c')],function(_0x2ea30f){var _0x5bf061={};_0x5bf061[_0x2ea30f]={'$like':'%'+_0xc17075[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0x5bf061;})});}_0x19400b=_['merge']({},_0x19400b,_0xc17075[_0xfa1d('0x57')]);return db[_0xfa1d('0x72')][_0xfa1d('0x31')]({'where':_0x19400b[_0xfa1d('0x52')]})[_0xfa1d('0x20')](function(_0x2ba395){_0x346093[_0xfa1d('0x31')]=_0x2ba395;if(_0xc17075['query'][_0xfa1d('0x58')]){_0x19400b[_0xfa1d('0x59')]=[{'all':!![]}];}return db[_0xfa1d('0x72')][_0xfa1d('0x5a')](_0x19400b);})['then'](function(_0x6c9b1f){_0x346093['rows']=_0x6c9b1f;return _0x346093;});}})[_0xfa1d('0x20')](respondWithFilteredResult(_0x202832,_0x19400b))[_0xfa1d('0x2b')](handleError(_0x202832,null));};exports[_0xfa1d('0x73')]=function(_0x15c0f1,_0x22e93a,_0x3f9994){return db['FaxAccount'][_0xfa1d('0x5f')]({'where':{'id':_0x15c0f1[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x22e93a,null))[_0xfa1d('0x20')](function(_0x35502a){if(_0x35502a){return _0x35502a[_0xfa1d('0x73')](_0x15c0f1[_0xfa1d('0x47')]['ids']);}})[_0xfa1d('0x20')](respondWithStatusCode(_0x22e93a,null))[_0xfa1d('0x2b')](handleError(_0x22e93a,null));};exports['addInteraction']=function(_0x549574,_0x4912a4,_0x377a24){return db[_0xfa1d('0x74')][_0xfa1d('0x5f')]({'where':{'id':_0x549574[_0xfa1d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4912a4,null))[_0xfa1d('0x20')](function(_0xaad80a){if(_0xaad80a){return _0xaad80a[_0xfa1d('0x75')](_0x549574[_0xfa1d('0x61')]['ids'],_['omit'](_0x549574[_0xfa1d('0x61')],[_0xfa1d('0x76'),'id'])||{});}})['then'](respondWithResult(_0x4912a4,null))[_0xfa1d('0x2b')](handleError(_0x4912a4,null));};exports[_0xfa1d('0x77')]=function(_0x17c4ce,_0x42a17b,_0x5e42f1){var _0x5e014d={'raw':![],'where':{}};var _0x5130dd={};var _0x330fd4={'count':0x0,'rows':[]};return db[_0xfa1d('0x42')]['findOne']({'where':{'id':_0x17c4ce[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x42a17b,null))[_0xfa1d('0x20')](function(_0x5bd276){if(_0x5bd276){_0x5130dd[_0xfa1d('0x4a')]=_[_0xfa1d('0x5e')](db['FaxInteraction'][_0xfa1d('0x43')]);_0x5130dd[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0x17c4ce[_0xfa1d('0x47')]);_0x5130dd[_0xfa1d('0x48')]=_['intersection'](_0x5130dd[_0xfa1d('0x4a')],_0x5130dd[_0xfa1d('0x47')]);_0x5e014d[_0xfa1d('0x4c')]=_['intersection'](_0x5130dd[_0xfa1d('0x4a')],qs['fields'](_0x17c4ce['query'][_0xfa1d('0x4b')]));_0x5e014d[_0xfa1d('0x4c')]=_0x5e014d[_0xfa1d('0x4c')][_0xfa1d('0x4d')]?_0x5e014d[_0xfa1d('0x4c')]:_0x5130dd[_0xfa1d('0x4a')];if(!_0x17c4ce[_0xfa1d('0x47')][_0xfa1d('0x4e')]('nolimit')){_0x5e014d[_0xfa1d('0x32')]=qs[_0xfa1d('0x32')](_0x17c4ce[_0xfa1d('0x47')][_0xfa1d('0x32')]);_0x5e014d[_0xfa1d('0x2f')]=qs[_0xfa1d('0x2f')](_0x17c4ce['query'][_0xfa1d('0x2f')]);}_0x5e014d['order']=qs[_0xfa1d('0x51')](_0x17c4ce['query'][_0xfa1d('0x51')]);_0x5e014d[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_['pick'](_0x17c4ce[_0xfa1d('0x47')],_0x5130dd[_0xfa1d('0x48')]));_0x5e014d[_0xfa1d('0x52')]['FaxAccountId']=_0x5bd276['id'];if(_0x17c4ce[_0xfa1d('0x47')][_0xfa1d('0x54')]){_0x5e014d[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x5e014d[_0xfa1d('0x52')],{'$or':_[_0xfa1d('0x41')](_0x5e014d['attributes'],function(_0x4b262a){var _0x2b13b4={};_0x2b13b4[_0x4b262a]={'$like':'%'+_0x17c4ce[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0x2b13b4;})});}_0x5e014d=_[_0xfa1d('0x55')]({},_0x5e014d,_0x17c4ce['options']);return db[_0xfa1d('0x74')]['count']({'where':_0x5e014d[_0xfa1d('0x52')]})['then'](function(_0x4dcfe5){_0x330fd4[_0xfa1d('0x31')]=_0x4dcfe5;if(_0x17c4ce['query']['includeAll']){_0x5e014d['include']=[{'model':db[_0xfa1d('0x78')],'as':_0xfa1d('0x79'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xfa1d('0x3d'),_0xfa1d('0x7a'),_0xfa1d('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xfa1d('0x7c'),'attributes':['id',_0xfa1d('0x3d'),_0xfa1d('0x7d')],'where':_0x17c4ce[_0xfa1d('0x47')][_0xfa1d('0x7e')]?{'id':_0x17c4ce[_0xfa1d('0x47')]['tag']}:undefined,'required':_0x17c4ce['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0xfa1d('0x5a')](_0x5e014d);})[_0xfa1d('0x20')](function(_0x11d58d){_0x330fd4[_0xfa1d('0x6f')]=_0x11d58d;return _0x330fd4;});}})[_0xfa1d('0x20')](respondWithFilteredResult(_0x42a17b,_0x5e014d))[_0xfa1d('0x2b')](handleError(_0x42a17b,null));};exports['addApplications']=function(_0x201d78,_0x80366b){var _0x539692=_0x201d78[_0xfa1d('0x5c')]['id'];var _0x326c1a=_0x201d78[_0xfa1d('0x61')];var _0x4fc564=0xc8;var _0x3ff976=null;return db[_0xfa1d('0x7f')]['transaction']({'isolationLevel':db[_0xfa1d('0x7f')]['Transaction'][_0xfa1d('0x80')][_0xfa1d('0x81')]},function(_0x3f5581){return db[_0xfa1d('0x42')][_0xfa1d('0x6e')]({'where':{'id':_0x539692},'transaction':_0x3f5581})[_0xfa1d('0x20')](function(_0x661b41){if(_0x661b41){return db[_0xfa1d('0x82')][_0xfa1d('0x3b')]({'where':{'FaxAccountId':_0x539692},'transaction':_0x3f5581})[_0xfa1d('0x20')](function(){var _0x52072d=_[_0xfa1d('0x41')](_0x326c1a,function(_0x3e2c1e){_0x3e2c1e[_0xfa1d('0x6b')]=_0x539692;return _0x3e2c1e;});return db[_0xfa1d('0x82')][_0xfa1d('0x83')](_0x52072d,{'transaction':_0x3f5581});});}else{_0x4fc564=0x194;_0x3ff976=[];}});})[_0xfa1d('0x20')](function(){if(_0x4fc564!==0x194){return db[_0xfa1d('0x82')][_0xfa1d('0x84')]({'where':{'FaxAccountId':_0x539692},'order':_0xfa1d('0x85')})[_0xfa1d('0x20')](function(_0x426b98){_0x3ff976=_0x426b98;});}})['catch'](function(_0x348c28){_0x4fc564=0x1f4;logger[_0xfa1d('0x27')](_0x348c28[_0xfa1d('0x3c')]);if(_0x348c28[_0xfa1d('0x3d')]){delete _0x348c28[_0xfa1d('0x3d')];}_0x3ff976=_0x348c28;})[_0xfa1d('0x86')](function(){if(_0x3ff976===null){_0x80366b['sendStatus'](_0x4fc564);}else{if(_0x4fc564===0x1f4){_0x80366b[_0xfa1d('0x2e')](_0x4fc564)['send'](_0x3ff976);}else{_0x80366b[_0xfa1d('0x2e')](_0x4fc564)['json'](_0x3ff976);}}});};exports['getApplications']=function(_0x19fd00,_0x56b67f,_0x11c79a){var _0x29438e={};var _0x4063e6={};var _0x7b81c1;var _0x3116e3;return db[_0xfa1d('0x42')]['findOne']({'where':{'id':_0x19fd00['params']['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x56b67f,null))['then'](function(_0x51dd10){if(_0x51dd10){_0x7b81c1=_0x51dd10;_0x4063e6[_0xfa1d('0x4a')]=_[_0xfa1d('0x5e')](db[_0xfa1d('0x82')][_0xfa1d('0x43')]);_0x4063e6[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0x19fd00[_0xfa1d('0x47')]);_0x4063e6[_0xfa1d('0x48')]=_['intersection'](_0x4063e6[_0xfa1d('0x4a')],_0x4063e6[_0xfa1d('0x47')]);_0x29438e[_0xfa1d('0x4c')]=_['intersection'](_0x4063e6[_0xfa1d('0x4a')],qs['fields'](_0x19fd00[_0xfa1d('0x47')]['fields']));_0x29438e[_0xfa1d('0x4c')]=_0x29438e['attributes']['length']?_0x29438e[_0xfa1d('0x4c')]:_0x4063e6[_0xfa1d('0x4a')];_0x29438e['order']=qs[_0xfa1d('0x51')](_0x19fd00['query']['sort']);_0x29438e['where']=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0x19fd00[_0xfa1d('0x47')],_0x4063e6[_0xfa1d('0x48')]));if(_0x19fd00[_0xfa1d('0x47')][_0xfa1d('0x54')]){_0x29438e['where']=_['merge'](_0x29438e[_0xfa1d('0x52')],{'$or':_[_0xfa1d('0x41')](_0x29438e['attributes'],function(_0x1dbf4f){var _0xd6c9ee={};_0xd6c9ee[_0x1dbf4f]={'$like':'%'+_0x19fd00[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0xd6c9ee;})});}_0x29438e=_[_0xfa1d('0x55')]({},_0x29438e,_0x19fd00['options']);return _0x7b81c1['getApplications'](_0x29438e);}})[_0xfa1d('0x20')](function(_0x2b61ad){if(_0x2b61ad){_0x3116e3=_0x2b61ad[_0xfa1d('0x4d')];if(!_0x19fd00[_0xfa1d('0x47')]['hasOwnProperty'](_0xfa1d('0x4f'))){_0x29438e[_0xfa1d('0x32')]=qs['limit'](_0x19fd00[_0xfa1d('0x47')][_0xfa1d('0x32')]);_0x29438e[_0xfa1d('0x2f')]=qs[_0xfa1d('0x2f')](_0x19fd00[_0xfa1d('0x47')]['offset']);}return _0x7b81c1[_0xfa1d('0x87')](_0x29438e);}})[_0xfa1d('0x20')](function(_0x341d7b){if(_0x341d7b){return _0x341d7b?{'count':_0x3116e3,'rows':_0x341d7b}:null;}})[_0xfa1d('0x20')](respondWithResult(_0x56b67f,null))[_0xfa1d('0x2b')](handleError(_0x56b67f,null));};function Extension(_0x37aaf7,_0x3ea79f,_0x44bcbd,_0x4f1ff4){this[_0xfa1d('0x88')]=_0xfa1d('0x89');this[_0xfa1d('0x8a')]=_0x37aaf7[_0xfa1d('0x8b')];this[_0xfa1d('0x8c')]=_0x4f1ff4;this[_0xfa1d('0x45')]='system';this['description']=_0xfa1d('0x8d');this[_0xfa1d('0x6b')]=_0x37aaf7['id'];this[_0xfa1d('0x85')]=_0x3ea79f;this[_0xfa1d('0x8e')]=_0x44bcbd;}function createExtensionsReciveFax(_0x2662e3){var _0x298792=0x1;var _0x1ed2ab=[];_0x1ed2ab[_0xfa1d('0x8f')](new Extension(_0x2662e3,_0x298792,'',_0xfa1d('0x90')));_0x298792+=0x1;_0x1ed2ab[_0xfa1d('0x8f')](new Extension(_0x2662e3,_0x298792,_0xfa1d('0x91'),_0xfa1d('0x92')));_0x298792+=0x1;for(var _0x226600 in _0x2662e3){if(_0x2662e3[_0xfa1d('0x4e')](_0x226600)&&(_0x226600===_0xfa1d('0x93')||_0x226600===_0xfa1d('0x8b')||_0x226600===_0xfa1d('0x94')||_0x226600===_0xfa1d('0x95')||_0x226600===_0xfa1d('0x96')||_0x226600===_0xfa1d('0x97')||_0x226600===_0xfa1d('0x98')||_0x226600===_0xfa1d('0x99')||_0x226600===_0xfa1d('0x9a'))){_0x1ed2ab['push'](new Extension(_0x2662e3,_0x298792,_0xfa1d('0x9b')+_0x226600+')='+_0x2662e3[_0x226600],'Set'));_0x298792+=0x1;}}_0x1ed2ab[_0xfa1d('0x8f')](new Extension(_0x2662e3,_0x298792,'6','Wait'));_0x298792+=0x1;_0x1ed2ab[_0xfa1d('0x8f')](new Extension(_0x2662e3,_0x298792,_0xfa1d('0x9c'),_0xfa1d('0x9d')));_0x298792=0x0;return _0x1ed2ab;}exports[_0xfa1d('0x9e')]=function(_0x576f62,_0x18a9be,_0x4368e6){var _0x425c2c;return db['sequelize'][_0xfa1d('0x9f')](function(_0x191342){return db[_0xfa1d('0x42')][_0xfa1d('0x60')](_0x576f62[_0xfa1d('0x61')],{'transaction':_0x191342})[_0xfa1d('0x20')](function(_0x5bdfef){_0x425c2c=_0x5bdfef[_0xfa1d('0x62')]({'plain':!![]});return db[_0xfa1d('0xa0')][_0xfa1d('0x83')](createExtensionsReciveFax(_0x425c2c),{'transaction':_0x191342});});})[_0xfa1d('0x20')](function(){return _0x425c2c;})[_0xfa1d('0x20')](respondWithResult(_0x18a9be,null))[_0xfa1d('0x2b')](handleError(_0x18a9be,null));};exports[_0xfa1d('0xa1')]=function(_0x4c3c51,_0x211b08,_0x6f9347){var _0x5e2d29;return db[_0xfa1d('0x7f')][_0xfa1d('0x9f')](function(_0x34666c){return db[_0xfa1d('0x42')][_0xfa1d('0x38')](_0x4c3c51['body'],{'where':{'id':_0x4c3c51[_0xfa1d('0x61')]['id']},'transaction':_0x34666c})[_0xfa1d('0x20')](function(_0x2a6ef2){return db[_0xfa1d('0xa0')][_0xfa1d('0x3b')]({'where':{'FaxAccountId':_0x4c3c51[_0xfa1d('0x61')]['id']},'transaction':_0x34666c})['then'](function(_0x2907c4){return db['VoiceExtension'][_0xfa1d('0x83')](createExtensionsReciveFax(_[_0xfa1d('0xa2')](_0x4c3c51[_0xfa1d('0x61')],[_0xfa1d('0xa3'),_0xfa1d('0x46'),_0xfa1d('0xa4'),_0xfa1d('0xa5'),_0xfa1d('0xa6'),_0xfa1d('0xa7')])),{'transaction':_0x34666c});});});})[_0xfa1d('0x20')](function(){return db[_0xfa1d('0x42')][_0xfa1d('0xa8')](_0x4c3c51[_0xfa1d('0x61')]['id']);})[_0xfa1d('0x20')](respondWithResult(_0x211b08,null))[_0xfa1d('0x2b')](handleError(_0x211b08,null));};exports[_0xfa1d('0xa9')]=function(_0x1b7d27,_0xd3fa09,_0x1c7a1e){var _0x49a718={'raw':!![],'where':{}};var _0x4ea078={};var _0x4da503={'count':0x0,'rows':[]};return db['FaxAccount'][_0xfa1d('0x6e')]({'where':{'id':_0x1b7d27[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0xd3fa09,null))['then'](function(_0x1a35ba){if(_0x1a35ba){_0x4ea078[_0xfa1d('0x4a')]=_[_0xfa1d('0x5e')](db[_0xfa1d('0xaa')][_0xfa1d('0x43')]);_0x4ea078[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0x1b7d27['query']);_0x4ea078[_0xfa1d('0x48')]=_[_0xfa1d('0x49')](_0x4ea078[_0xfa1d('0x4a')],_0x4ea078[_0xfa1d('0x47')]);_0x49a718[_0xfa1d('0x4c')]=_[_0xfa1d('0x49')](_0x4ea078[_0xfa1d('0x4a')],qs['fields'](_0x1b7d27[_0xfa1d('0x47')]['fields']));_0x49a718['attributes']=_0x49a718[_0xfa1d('0x4c')][_0xfa1d('0x4d')]?_0x49a718['attributes']:_0x4ea078[_0xfa1d('0x4a')];if(!_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0x4e')](_0xfa1d('0x4f'))){_0x49a718['limit']=qs[_0xfa1d('0x32')](_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0x32')]);_0x49a718[_0xfa1d('0x2f')]=qs[_0xfa1d('0x2f')](_0x1b7d27[_0xfa1d('0x47')]['offset']);}_0x49a718[_0xfa1d('0x50')]=qs[_0xfa1d('0x51')](_0x1b7d27['query']['sort']);_0x49a718[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0x1b7d27['query'],_0x4ea078[_0xfa1d('0x48')]));_0x49a718['where'][_0xfa1d('0x6b')]=_0x1a35ba['id'];if(_0x1b7d27['query']['filter']){_0x49a718[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x49a718[_0xfa1d('0x52')],{'$or':_[_0xfa1d('0x41')](_0x49a718['attributes'],function(_0x416e6f){var _0x4728f0={};_0x4728f0[_0x416e6f]={'$like':'%'+_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0x4728f0;})});}if(_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0xab')]){var _0x73e08c=_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0xab')][_0xfa1d('0xac')](',');var _0x4e06da={};_0x4e06da[_0x73e08c[0x0]]={'$gte':moment(_0x73e08c[0x1])[_0xfa1d('0xad')](_0xfa1d('0xae'))};_0x49a718[_0xfa1d('0x52')]=_[_0xfa1d('0x55')](_0x49a718['where'],_0x4e06da);}_0x49a718=_[_0xfa1d('0x55')]({},_0x49a718,_0x1b7d27[_0xfa1d('0x57')]);return db['FaxMessage'][_0xfa1d('0x31')]({'where':_0x49a718[_0xfa1d('0x52')]})[_0xfa1d('0x20')](function(_0x69f15b){_0x4da503[_0xfa1d('0x31')]=_0x69f15b;if(_0x1b7d27[_0xfa1d('0x47')][_0xfa1d('0x58')]){_0x49a718[_0xfa1d('0x59')]=[{'all':!![]}];}return db[_0xfa1d('0xaa')][_0xfa1d('0x5a')](_0x49a718);})[_0xfa1d('0x20')](function(_0x1da081){_0x4da503['rows']=_0x1da081;return _0x4da503;});}})[_0xfa1d('0x20')](respondWithFilteredResult(_0xd3fa09,_0x49a718))[_0xfa1d('0x2b')](handleError(_0xd3fa09,null));};exports['send']=function(_0x5260f3,_0x52ba92,_0x4dc695){var _0x10bc0a,_0x5302c5={},_0x1b27b6;if(_0x5260f3[_0xfa1d('0x61')]['to']){_0x1b27b6=_0x5260f3[_0xfa1d('0x61')]['to'][0x0];}return db[_0xfa1d('0x42')]['find']({'where':{'id':_0x5260f3[_0xfa1d('0x5c')]['id']},'include':[{'model':db[_0xfa1d('0xaf')],'as':'List','include':[{'model':db['CmContact'],'as':_0xfa1d('0xb0'),'where':{'fax':_0x1b27b6},'limit':0x1,'order':[[_0xfa1d('0xa5'),_0xfa1d('0xb1')]]}]}]})['then'](handleEntityNotFound(_0x52ba92,null))['then'](function(_0x159f78){_0x10bc0a=_0x159f78;if(_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')]&&_0x5260f3['body']['attachments'][_0xfa1d('0x4d')]){for(var _0x1f72d4=0x0;_0x1f72d4<_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][_0xfa1d('0x4d')];_0x1f72d4+=0x1){_0x5260f3[_0xfa1d('0x61')]['attachments'][_0x1f72d4]={'filename':_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][_0x1f72d4][_0xfa1d('0x3d')],'id':_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][_0x1f72d4]['id'],'path':path['join'](config[_0xfa1d('0xb3')],_0xfa1d('0xb4'),_0x5260f3[_0xfa1d('0x61')]['attachments'][_0x1f72d4][_0xfa1d('0xb5')])};}}return respondWithRpcPromise(_0xfa1d('0xb6'),_0xfa1d('0xb6'),{'FaxAccountId':_[_0xfa1d('0xb7')](_0x5260f3[_0xfa1d('0x5c')]['id'])?undefined:_0x5260f3[_0xfa1d('0x5c')]['id'],'path':_[_0xfa1d('0xb7')](_0x5260f3[_0xfa1d('0x61')]['attachments'][0x0][_0xfa1d('0x7')])?undefined:_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0][_0xfa1d('0x7')],'fax':_[_0xfa1d('0xb7')](_0x5260f3[_0xfa1d('0x61')]['to'][0x0])?undefined:_0x5260f3[_0xfa1d('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x10bc0a){if(_['isNil'](_0x5260f3['body']['from'])){_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb8')]=util[_0xfa1d('0xad')](_0xfa1d('0xb9'),_0x10bc0a[_0xfa1d('0x3d')],_0x10bc0a[_0xfa1d('0xba')]);}if(_0x10bc0a['List']){if(_0x10bc0a[_0xfa1d('0xbb')][_0xfa1d('0xb0')]['length']){return _0x10bc0a[_0xfa1d('0xbb')]['Contacts'][0x0];}else{return db[_0xfa1d('0x78')][_0xfa1d('0x60')](_[_0xfa1d('0x17')](_0x5260f3[_0xfa1d('0x61')],{'firstName':_0x5260f3[_0xfa1d('0x61')]['to'][0x0],'phone':_0x5260f3['body']['to'][0x0],'fax':_0x5260f3[_0xfa1d('0x61')]['to'][0x0],'ListId':_0x10bc0a[_0xfa1d('0xa7')]}));}}else{throw new Error(_0xfa1d('0xbc'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xfa1d('0x20')](function(_0x1be6ba){if(_0x1be6ba){return db['FaxInteraction'][_0xfa1d('0x5f')]({'where':{'ContactId':_0x1be6ba['id'],'closed':![],'FaxAccountId':_0x10bc0a['id']}})[_0xfa1d('0x20')](function(_0x1934ca){if(_0x1934ca){return[_0x1934ca,![]];}return db[_0xfa1d('0x74')][_0xfa1d('0x60')]({'UserId':_0x5260f3[_0xfa1d('0x65')]['id'],'ContactId':_0x1be6ba['id'],'FaxAccountId':_0x10bc0a['id'],'fax':_0x5260f3[_0xfa1d('0x61')]['to'][0x0],'firstMsgDirection':_0xfa1d('0xbd'),'Messages':[_[_0xfa1d('0x55')](_0x5260f3['body'],{'read':![],'body':_0x5260f3['body']['attachments'][0x0][_0xfa1d('0xbe')],'FaxAccountId':_0x10bc0a['id'],'UserId':_0x5260f3[_0xfa1d('0x65')]['id'],'ContactId':_0x1be6ba['id'],'AttachmentId':_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xfa1d('0x20')](function(_0x34fe6c){return[_0x34fe6c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfa1d('0xbf')](function(_0x4cc702,_0x413704){if(_0x413704){return _0x4cc702;}return db['FaxMessage'][_0xfa1d('0x60')]({'direction':_0xfa1d('0xbd'),'read':![],'body':_0x5260f3[_0xfa1d('0x61')]['attachments'][0x0]['filename'],'FaxAccountId':_0x10bc0a['id'],'FaxInteractionId':_0x4cc702['id'],'UserId':_0x5260f3[_0xfa1d('0x65')]['id'],'ContactId':_0x4cc702[_0xfa1d('0xc0')],'AttachmentId':_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0]['id']})[_0xfa1d('0x20')](function(_0x145c6b){_0x4cc702['dataValues'][_0xfa1d('0xc1')]=[];_0x4cc702[_0xfa1d('0xc2')][_0xfa1d('0xc1')]['push'](_0x145c6b['dataValues']);return _0x4cc702;});})['then'](function(_0x1c53aa){respondWithRpcPromise(_0xfa1d('0xc3'),_0xfa1d('0xc3'),{'FaxAccountId':_[_0xfa1d('0xb7')](_0x5260f3['params']['id'])?undefined:_0x5260f3[_0xfa1d('0x5c')]['id'],'path':_[_0xfa1d('0xb7')](_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0]['path'])?undefined:_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0]['path'],'fax':_['isNil'](_0x5260f3['body']['to'][0x0])?undefined:_0x5260f3[_0xfa1d('0x61')]['to'][0x0],'AttachmentId':_0x5260f3[_0xfa1d('0x61')][_0xfa1d('0xb2')][0x0]['id']},client9002)[_0xfa1d('0x20')](function(_0x18d4e8){logger[_0xfa1d('0x21')](_0xfa1d('0xc4'),_0x18d4e8);})['catch'](function(_0xcb9fde){logger[_0xfa1d('0x21')](_0xfa1d('0xc4'),_0xcb9fde);});return _0x1c53aa;})[_0xfa1d('0x20')](respondWithResult(_0x52ba92,null))[_0xfa1d('0x2b')](handleError(_0x52ba92,null));};exports['addAgents']=function(_0x56a292,_0x35bb7e,_0x28515f){return db[_0xfa1d('0x42')][_0xfa1d('0x5f')]({'where':{'id':_0x56a292[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x35bb7e,null))[_0xfa1d('0x20')](function(_0x56282d){if(_0x56282d){return _0x56282d[_0xfa1d('0xc5')](_0x56a292[_0xfa1d('0x61')][_0xfa1d('0x76')],_['omit'](_0x56a292['body'],[_0xfa1d('0x76'),'id'])||{})[_0xfa1d('0xbf')](function(_0x334a1b){for(var _0x129cb3=0x0;_0x129cb3<_0x56a292[_0xfa1d('0x61')][_0xfa1d('0x76')][_0xfa1d('0x4d')];_0x129cb3+=0x1){socket[_0xfa1d('0xc6')](_0xfa1d('0xc7'),{'UserId':Number(_0x56a292['body'][_0xfa1d('0x76')][_0x129cb3]),'FaxAccountId':Number(_0x56a292['params']['id'])});}return _0x334a1b;});}})[_0xfa1d('0x20')](respondWithResult(_0x35bb7e,null))['catch'](handleError(_0x35bb7e,null));};exports[_0xfa1d('0xc8')]=function(_0x174c60,_0x29b3eb,_0x2db553){return db[_0xfa1d('0x42')][_0xfa1d('0x5f')]({'where':{'id':_0x174c60[_0xfa1d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x29b3eb,null))[_0xfa1d('0x20')](function(_0x52657c){if(_0x52657c){return _0x52657c[_0xfa1d('0xc8')](_0x174c60[_0xfa1d('0x47')][_0xfa1d('0x76')])[_0xfa1d('0x20')](function(){if(_[_0xfa1d('0xc9')](_0x174c60[_0xfa1d('0x47')]['ids'])){for(var _0x4b27db=0x0;_0x4b27db<_0x174c60[_0xfa1d('0x47')][_0xfa1d('0x76')][_0xfa1d('0x4d')];_0x4b27db+=0x1){socket[_0xfa1d('0xc6')](_0xfa1d('0xca'),{'UserId':Number(_0x174c60[_0xfa1d('0x47')][_0xfa1d('0x76')][_0x4b27db]),'FaxAccountId':Number(_0x174c60[_0xfa1d('0x5c')]['id'])});}}else{socket[_0xfa1d('0xc6')](_0xfa1d('0xca'),{'UserId':Number(_0x174c60[_0xfa1d('0x47')][_0xfa1d('0x76')]),'FaxAccountId':Number(_0x174c60['params']['id'])});}});}})[_0xfa1d('0x20')](respondWithStatusCode(_0x29b3eb,null))[_0xfa1d('0x2b')](handleError(_0x29b3eb,null));};exports[_0xfa1d('0xcb')]=function(_0x164250,_0x2a6e94,_0x2c0d55){var _0x3b8f81={};var _0x5048f0={};var _0xe7e0de;var _0x4e9a36;return db[_0xfa1d('0x42')][_0xfa1d('0x6e')]({'where':{'id':_0x164250[_0xfa1d('0x5c')]['id']}})[_0xfa1d('0x20')](handleEntityNotFound(_0x2a6e94,null))[_0xfa1d('0x20')](function(_0x59021d){if(_0x59021d){_0xe7e0de=_0x59021d;_0x5048f0[_0xfa1d('0x4a')]=_[_0xfa1d('0x5e')](db[_0xfa1d('0xcc')][_0xfa1d('0x43')]);_0x5048f0[_0xfa1d('0x47')]=_[_0xfa1d('0x5e')](_0x164250['query']);_0x5048f0['filters']=_[_0xfa1d('0x49')](_0x5048f0[_0xfa1d('0x4a')],_0x5048f0[_0xfa1d('0x47')]);_0x3b8f81['attributes']=_[_0xfa1d('0x49')](_0x5048f0['model'],qs[_0xfa1d('0x4b')](_0x164250[_0xfa1d('0x47')][_0xfa1d('0x4b')]));_0x3b8f81[_0xfa1d('0x4c')]=_0x3b8f81[_0xfa1d('0x4c')][_0xfa1d('0x4d')]?_0x3b8f81[_0xfa1d('0x4c')]:_0x5048f0[_0xfa1d('0x4a')];_0x3b8f81[_0xfa1d('0x50')]=qs[_0xfa1d('0x51')](_0x164250[_0xfa1d('0x47')][_0xfa1d('0x51')]);_0x3b8f81[_0xfa1d('0x52')]=qs[_0xfa1d('0x48')](_[_0xfa1d('0x53')](_0x164250[_0xfa1d('0x47')],_0x5048f0[_0xfa1d('0x48')]));if(_0x164250[_0xfa1d('0x47')]['filter']){_0x3b8f81[_0xfa1d('0x52')]=_['merge'](_0x3b8f81[_0xfa1d('0x52')],{'$or':_['map'](_0x3b8f81[_0xfa1d('0x4c')],function(_0x34de9c){var _0x2223ae={};_0x2223ae[_0x34de9c]={'$like':'%'+_0x164250[_0xfa1d('0x47')][_0xfa1d('0x54')]+'%'};return _0x2223ae;})});}_0x3b8f81=_[_0xfa1d('0x55')]({},_0x3b8f81,_0x164250[_0xfa1d('0x57')]);return _0xe7e0de[_0xfa1d('0xcb')](_0x3b8f81);}})[_0xfa1d('0x20')](function(_0x254cbc){if(_0x254cbc){_0x4e9a36=_0x254cbc[_0xfa1d('0x4d')];if(!_0x164250['query']['hasOwnProperty']('nolimit')){_0x3b8f81[_0xfa1d('0x32')]=qs[_0xfa1d('0x32')](_0x164250['query'][_0xfa1d('0x32')]);_0x3b8f81[_0xfa1d('0x2f')]=qs['offset'](_0x164250[_0xfa1d('0x47')][_0xfa1d('0x2f')]);}return _0xe7e0de[_0xfa1d('0xcb')](_0x3b8f81);}})['then'](function(_0x53d5a6){if(_0x53d5a6){return _0x53d5a6?{'count':_0x4e9a36,'rows':_0x53d5a6}:null;}})['then'](respondWithResult(_0x2a6e94,null))['catch'](handleError(_0x2a6e94,null));}; \ No newline at end of file +var _0x9f1a=['FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','FaxAccount','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','rows','catch','show','params','mandatoryDispositionPause','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','filter','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','User','internal','Tag','Tags','color','tag','transaction','sequelize','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x4e3843,_0x571529){var _0x2537db=function(_0x853ee9){while(--_0x853ee9){_0x4e3843['push'](_0x4e3843['shift']());}};_0x2537db(++_0x571529);}(_0x9f1a,0x9d));var _0xa9f1=function(_0x417630,_0x81e716){_0x417630=_0x417630-0x0;var _0x422790=_0x9f1a[_0x417630];return _0x422790;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa9f1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9f1('0x1'));var moment=require(_0xa9f1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa9f1('0x3'));var util=require(_0xa9f1('0x4'));var path=require(_0xa9f1('0x5'));var sox=require(_0xa9f1('0x6'));var csv=require(_0xa9f1('0x7'));var ejs=require(_0xa9f1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa9f1('0x9'));var crypto=require(_0xa9f1('0xa'));var jsforce=require(_0xa9f1('0xb'));var deskjs=require(_0xa9f1('0xc'));var toCsv=require(_0xa9f1('0x7'));var querystring=require(_0xa9f1('0xd'));var Papa=require(_0xa9f1('0xe'));var Redis=require('ioredis');var authService=require(_0xa9f1('0xf'));var qs=require(_0xa9f1('0x10'));var as=require(_0xa9f1('0x11'));var hardwareService=require(_0xa9f1('0x12'));var logger=require(_0xa9f1('0x13'))(_0xa9f1('0x14'));var utils=require(_0xa9f1('0x15'));var config=require(_0xa9f1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa9f1('0x17')]=_['defaults'](config[_0xa9f1('0x17')],{'host':_0xa9f1('0x18'),'port':0x18eb});var socket=require(_0xa9f1('0x19'))(new Redis(config[_0xa9f1('0x17')]));require(_0xa9f1('0x1a'))[_0xa9f1('0x1b')](socket);var jayson=require(_0xa9f1('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa9f1('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c5ec5,_0x93b25,_0x206d7b,_0x4ea3d3){return new BPromise(function(_0x3cbc67,_0x45ba18){var _0x3a3670=_0x4ea3d3||client;return _0x3a3670[_0xa9f1('0x1e')](_0x4c5ec5,_0x206d7b)[_0xa9f1('0x1f')](function(_0x1ba987){logger[_0xa9f1('0x20')]('FaxAccount,\x20%s,\x20%s',_0x93b25,_0xa9f1('0x21'));logger[_0xa9f1('0x22')](_0xa9f1('0x23'),_0x93b25,'request\x20sent',JSON['stringify'](_0x1ba987));if(_0x1ba987[_0xa9f1('0x24')]){if(_0x1ba987[_0xa9f1('0x24')][_0xa9f1('0x25')]===0x1f4){logger[_0xa9f1('0x24')](_0xa9f1('0x26'),_0x93b25,_0x1ba987['error'][_0xa9f1('0x27')]);return _0x45ba18(_0x1ba987[_0xa9f1('0x24')][_0xa9f1('0x27')]);}logger[_0xa9f1('0x24')](_0xa9f1('0x26'),_0x93b25,_0x1ba987[_0xa9f1('0x24')]['message']);return _0x3cbc67(_0x1ba987[_0xa9f1('0x24')][_0xa9f1('0x27')]);}else{logger['info'](_0xa9f1('0x26'),_0x93b25,'request\x20sent');_0x3cbc67(_0x1ba987[_0xa9f1('0x28')][_0xa9f1('0x27')]);}})['catch'](function(_0x955b68){logger[_0xa9f1('0x24')](_0xa9f1('0x26'),_0x93b25,_0x955b68);_0x45ba18(_0x955b68);});});}function respondWithStatusCode(_0x10c543,_0xb3eda1){_0xb3eda1=_0xb3eda1||0xcc;return function(_0x5970e5){if(_0x5970e5){return _0x10c543['sendStatus'](_0xb3eda1);}return _0x10c543[_0xa9f1('0x29')](_0xb3eda1)['end']();};}function respondWithResult(_0x27ba61,_0x56d057){_0x56d057=_0x56d057||0xc8;return function(_0x56b56e){if(_0x56b56e){return _0x27ba61[_0xa9f1('0x29')](_0x56d057)['json'](_0x56b56e);}};}function respondWithFilteredResult(_0x5f5b4a,_0x15bdc2){return function(_0x261fd9){if(_0x261fd9){var _0x27c36b=typeof _0x15bdc2[_0xa9f1('0x2a')]===_0xa9f1('0x2b')&&typeof _0x15bdc2['limit']===_0xa9f1('0x2b');var _0xa088c5=_0x261fd9[_0xa9f1('0x2c')];var _0x576d04=_0x27c36b?0x0:_0x15bdc2[_0xa9f1('0x2a')];var _0x86a87e=_0x27c36b?_0x261fd9['count']:_0x15bdc2[_0xa9f1('0x2a')]+_0x15bdc2[_0xa9f1('0x2d')];var _0x249a57;if(_0x86a87e>=_0xa088c5){_0x86a87e=_0xa088c5;_0x249a57=0xc8;}else{_0x249a57=0xce;}_0x5f5b4a[_0xa9f1('0x29')](_0x249a57);return _0x5f5b4a['set'](_0xa9f1('0x2e'),_0x576d04+'-'+_0x86a87e+'/'+_0xa088c5)[_0xa9f1('0x2f')](_0x261fd9);}return null;};}function patchUpdates(_0x4f3fc1){return function(_0x4d39a){try{jsonpatch['apply'](_0x4d39a,_0x4f3fc1,!![]);}catch(_0x4a20b8){return BPromise[_0xa9f1('0x30')](_0x4a20b8);}return _0x4d39a[_0xa9f1('0x31')]();};}function saveUpdates(_0x1daacb,_0x33827b){return function(_0x21e6e0){if(_0x21e6e0){return _0x21e6e0[_0xa9f1('0x32')](_0x1daacb)['then'](function(_0x56926d){return _0x56926d;});}return null;};}function removeEntity(_0x64f689,_0x9dbfbb){return function(_0x1bf676){if(_0x1bf676){return _0x1bf676[_0xa9f1('0x33')]()[_0xa9f1('0x1f')](function(){var _0x5a3845=_0x1bf676[_0xa9f1('0x34')]({'plain':!![]});var _0xa4acef='FaxAccounts';return db[_0xa9f1('0x35')]['destroy']({'where':{'type':_0xa4acef,'resourceId':_0x5a3845['id']}})[_0xa9f1('0x1f')](function(){return _0x1bf676;});})[_0xa9f1('0x1f')](function(){_0x64f689[_0xa9f1('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490ea6,_0x687d13){return function(_0x4011f9){if(!_0x4011f9){_0x490ea6[_0xa9f1('0x36')](0x194);}return _0x4011f9;};}function handleError(_0x302fd4,_0x4c2543){_0x4c2543=_0x4c2543||0x1f4;return function(_0x3221cd){logger['error'](_0x3221cd[_0xa9f1('0x37')]);if(_0x3221cd[_0xa9f1('0x38')]){delete _0x3221cd[_0xa9f1('0x38')];}_0x302fd4['status'](_0x4c2543)[_0xa9f1('0x39')](_0x3221cd);};}exports[_0xa9f1('0x3a')]=function(_0x43e2e1,_0x399626){var _0x3829f9={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x501222={},_0x16f912={'count':0x0,'rows':[]};var _0x361649=_[_0xa9f1('0x3b')](db[_0xa9f1('0x3c')][_0xa9f1('0x3d')],function(_0x12b049){return{'name':_0x12b049['fieldName'],'type':_0x12b049[_0xa9f1('0x3e')][_0xa9f1('0x3f')]};});_0x501222[_0xa9f1('0x40')]=_[_0xa9f1('0x3b')](_0x361649,_0xa9f1('0x38'));_0x501222[_0xa9f1('0x41')]=_['keys'](_0x43e2e1[_0xa9f1('0x41')]);_0x501222['filters']=_['intersection'](_0x501222[_0xa9f1('0x40')],_0x501222[_0xa9f1('0x41')]);_0x3829f9[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0x501222[_0xa9f1('0x40')],qs['fields'](_0x43e2e1[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x3829f9[_0xa9f1('0x42')]=_0x3829f9['attributes'][_0xa9f1('0x45')]?_0x3829f9['attributes']:_0x501222['model'];if(!_0x43e2e1['query'][_0xa9f1('0x46')]('nolimit')){_0x3829f9[_0xa9f1('0x2d')]=qs['limit'](_0x43e2e1[_0xa9f1('0x41')]['limit']);_0x3829f9[_0xa9f1('0x2a')]=qs['offset'](_0x43e2e1[_0xa9f1('0x41')]['offset']);}_0x3829f9[_0xa9f1('0x47')]=qs[_0xa9f1('0x48')](_0x43e2e1[_0xa9f1('0x41')]['sort']);_0x3829f9[_0xa9f1('0x49')]=qs[_0xa9f1('0x4a')](_[_0xa9f1('0x4b')](_0x43e2e1[_0xa9f1('0x41')],_0x501222[_0xa9f1('0x4a')]),_0x361649);if(_0x43e2e1[_0xa9f1('0x41')]['filter']){_0x3829f9[_0xa9f1('0x49')]=_['merge'](_0x3829f9[_0xa9f1('0x49')],{'$or':_[_0xa9f1('0x3b')](_0x361649,function(_0x356255){if(_0x356255[_0xa9f1('0x3e')]!==_0xa9f1('0x4c')){var _0x51713d={};_0x51713d[_0x356255[_0xa9f1('0x38')]]={'$like':'%'+_0x43e2e1[_0xa9f1('0x41')]['filter']+'%'};return _0x51713d;}})});}_0x3829f9=_[_0xa9f1('0x4d')]({},_0x3829f9,_0x43e2e1[_0xa9f1('0x4e')]);var _0x44ad16={'where':_0x3829f9[_0xa9f1('0x49')]};return db['FaxAccount'][_0xa9f1('0x2c')](_0x44ad16)['then'](function(_0x1f6f4b){_0x16f912['count']=_0x1f6f4b;if(_0x43e2e1['query'][_0xa9f1('0x4f')]){_0x3829f9['include']=[{'all':!![]}];}return db[_0xa9f1('0x3c')]['findAll'](_0x3829f9);})[_0xa9f1('0x1f')](function(_0x471a9c){_0x16f912[_0xa9f1('0x50')]=_0x471a9c;return _0x16f912;})[_0xa9f1('0x1f')](respondWithFilteredResult(_0x399626,_0x3829f9))[_0xa9f1('0x51')](handleError(_0x399626,null));};exports[_0xa9f1('0x52')]=function(_0x637a9d,_0x327632){var _0x1b91dc={'raw':![],'where':{'id':_0x637a9d[_0xa9f1('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xa9f1('0x54')}]},_0x1dc7a7={};_0x1dc7a7[_0xa9f1('0x40')]=_[_0xa9f1('0x55')](db[_0xa9f1('0x3c')][_0xa9f1('0x3d')]);_0x1dc7a7['query']=_[_0xa9f1('0x55')](_0x637a9d[_0xa9f1('0x41')]);_0x1dc7a7[_0xa9f1('0x4a')]=_[_0xa9f1('0x43')](_0x1dc7a7[_0xa9f1('0x40')],_0x1dc7a7[_0xa9f1('0x41')]);_0x1b91dc[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0x1dc7a7[_0xa9f1('0x40')],qs[_0xa9f1('0x44')](_0x637a9d[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x1b91dc['attributes']=_0x1b91dc[_0xa9f1('0x42')][_0xa9f1('0x45')]?_0x1b91dc[_0xa9f1('0x42')]:_0x1dc7a7[_0xa9f1('0x40')];if(_0x637a9d[_0xa9f1('0x41')]['includeAll']){_0x1b91dc[_0xa9f1('0x56')]=[{'all':!![]}];}_0x1b91dc=_[_0xa9f1('0x4d')]({},_0x1b91dc,_0x637a9d['options']);return db[_0xa9f1('0x3c')][_0xa9f1('0x57')](_0x1b91dc)['then'](handleEntityNotFound(_0x327632,null))[_0xa9f1('0x1f')](respondWithResult(_0x327632,null))[_0xa9f1('0x51')](handleError(_0x327632,null));};exports[_0xa9f1('0x58')]=function(_0x1a0467,_0x395237){return db['FaxAccount'][_0xa9f1('0x58')](_0x1a0467['body'],{})[_0xa9f1('0x1f')](function(_0x51e40d){var _0x34fa4=_0x1a0467[_0xa9f1('0x59')]['get']({'plain':!![]});if(!_0x34fa4)throw new Error(_0xa9f1('0x5a'));if(_0x34fa4[_0xa9f1('0x5b')]===_0xa9f1('0x59')){var _0x24955d=_0x51e40d['get']({'plain':!![]});var _0x29dd66=_0xa9f1('0x5c');return db['UserProfileSection'][_0xa9f1('0x57')]({'where':{'name':_0x29dd66,'userProfileId':_0x34fa4[_0xa9f1('0x5d')]},'raw':!![]})['then'](function(_0x575ffb){if(_0x575ffb&&_0x575ffb[_0xa9f1('0x5e')]===0x0){return db[_0xa9f1('0x35')][_0xa9f1('0x58')]({'name':_0x24955d[_0xa9f1('0x38')],'resourceId':_0x24955d['id'],'type':_0x575ffb[_0xa9f1('0x38')],'sectionId':_0x575ffb['id']},{})[_0xa9f1('0x1f')](function(){return _0x51e40d;});}else{return _0x51e40d;}})[_0xa9f1('0x51')](function(_0x354dfa){logger['error'](_0xa9f1('0x5f'),_0x354dfa);throw _0x354dfa;});}return _0x51e40d;})[_0xa9f1('0x1f')](respondWithResult(_0x395237,0xc9))[_0xa9f1('0x51')](handleError(_0x395237,null));};exports[_0xa9f1('0x32')]=function(_0x261830,_0x3edd9d){if(_0x261830[_0xa9f1('0x60')]['id']){delete _0x261830[_0xa9f1('0x60')]['id'];}return db['FaxAccount'][_0xa9f1('0x57')]({'where':{'id':_0x261830['params']['id']},'include':[{'model':db['Pause'],'as':_0xa9f1('0x54')}]})['then'](handleEntityNotFound(_0x3edd9d,null))['then'](saveUpdates(_0x261830['body'],null))[_0xa9f1('0x1f')](respondWithResult(_0x3edd9d,null))['catch'](handleError(_0x3edd9d,null));};exports[_0xa9f1('0x33')]=function(_0x7d2fdc,_0x5a6205){return db['FaxAccount']['find']({'where':{'id':_0x7d2fdc[_0xa9f1('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a6205,null))[_0xa9f1('0x1f')](removeEntity(_0x5a6205,null))[_0xa9f1('0x51')](handleError(_0x5a6205,null));};exports[_0xa9f1('0x61')]=function(_0x699fbd,_0x269491){return db[_0xa9f1('0x3c')][_0xa9f1('0x61')]()[_0xa9f1('0x1f')](respondWithResult(_0x269491,null))['catch'](handleError(_0x269491,null));};exports[_0xa9f1('0x62')]=function(_0x47f7b2,_0x500405,_0x5acb5a){if(_0x47f7b2[_0xa9f1('0x60')]['id']){delete _0x47f7b2[_0xa9f1('0x60')]['id'];}return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x47f7b2['params']['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x500405,null))['then'](function(_0x4cf2e4){if(_0x4cf2e4){_0x47f7b2['body'][_0xa9f1('0x63')]=_0x4cf2e4['id'];return db[_0xa9f1('0x64')][_0xa9f1('0x58')](_0x47f7b2['body']);}})['then'](respondWithResult(_0x500405,null))[_0xa9f1('0x51')](handleError(_0x500405,null));};exports[_0xa9f1('0x65')]=function(_0xf729b,_0x2cb86d,_0x32e0aa){var _0x291432={'raw':![],'where':{}};var _0xab6e46={};var _0x2d7e6e={'count':0x0,'rows':[]};return db[_0xa9f1('0x3c')][_0xa9f1('0x66')]({'where':{'id':_0xf729b['params']['id']}})['then'](handleEntityNotFound(_0x2cb86d,null))[_0xa9f1('0x1f')](function(_0x1d6e78){if(_0x1d6e78){_0xab6e46[_0xa9f1('0x40')]=_[_0xa9f1('0x55')](db[_0xa9f1('0x64')][_0xa9f1('0x3d')]);_0xab6e46[_0xa9f1('0x41')]=_[_0xa9f1('0x55')](_0xf729b[_0xa9f1('0x41')]);_0xab6e46[_0xa9f1('0x4a')]=_[_0xa9f1('0x43')](_0xab6e46['model'],_0xab6e46[_0xa9f1('0x41')]);_0x291432[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0xab6e46[_0xa9f1('0x40')],qs['fields'](_0xf729b[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x291432[_0xa9f1('0x42')]=_0x291432[_0xa9f1('0x42')]['length']?_0x291432['attributes']:_0xab6e46['model'];if(!_0xf729b['query'][_0xa9f1('0x46')](_0xa9f1('0x67'))){_0x291432[_0xa9f1('0x2d')]=qs['limit'](_0xf729b[_0xa9f1('0x41')][_0xa9f1('0x2d')]);_0x291432[_0xa9f1('0x2a')]=qs['offset'](_0xf729b[_0xa9f1('0x41')][_0xa9f1('0x2a')]);}_0x291432[_0xa9f1('0x47')]=qs[_0xa9f1('0x48')](_0xf729b['query'][_0xa9f1('0x48')]);_0x291432['where']=qs[_0xa9f1('0x4a')](_['pick'](_0xf729b[_0xa9f1('0x41')],_0xab6e46[_0xa9f1('0x4a')]));_0x291432[_0xa9f1('0x49')][_0xa9f1('0x63')]=_0x1d6e78['id'];if(_0xf729b[_0xa9f1('0x41')]['filter']){_0x291432[_0xa9f1('0x49')]=_['merge'](_0x291432[_0xa9f1('0x49')],{'$or':_[_0xa9f1('0x3b')](_0x291432['attributes'],function(_0x79e806){var _0x198d5d={};_0x198d5d[_0x79e806]={'$like':'%'+_0xf729b[_0xa9f1('0x41')]['filter']+'%'};return _0x198d5d;})});}_0x291432=_[_0xa9f1('0x4d')]({},_0x291432,_0xf729b['options']);return db[_0xa9f1('0x64')]['count']({'where':_0x291432[_0xa9f1('0x49')]})[_0xa9f1('0x1f')](function(_0x4c5309){_0x2d7e6e[_0xa9f1('0x2c')]=_0x4c5309;if(_0xf729b[_0xa9f1('0x41')][_0xa9f1('0x4f')]){_0x291432['include']=[{'all':!![]}];}return db[_0xa9f1('0x64')][_0xa9f1('0x68')](_0x291432);})['then'](function(_0x32a1d7){_0x2d7e6e['rows']=_0x32a1d7;return _0x2d7e6e;});}})[_0xa9f1('0x1f')](respondWithFilteredResult(_0x2cb86d,_0x291432))[_0xa9f1('0x51')](handleError(_0x2cb86d,null));};exports['removeDispositions']=function(_0x27c6a9,_0x30ad8b,_0x500b78){return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x27c6a9[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x30ad8b,null))[_0xa9f1('0x1f')](function(_0x21e8da){if(_0x21e8da){return _0x21e8da[_0xa9f1('0x69')](_0x27c6a9[_0xa9f1('0x41')][_0xa9f1('0x6a')]);}})[_0xa9f1('0x1f')](respondWithStatusCode(_0x30ad8b,null))[_0xa9f1('0x51')](handleError(_0x30ad8b,null));};exports[_0xa9f1('0x6b')]=function(_0xd9dc21,_0x4681f2,_0xbef85c){if(_0xd9dc21[_0xa9f1('0x60')]['id']){delete _0xd9dc21[_0xa9f1('0x60')]['id'];}return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0xd9dc21[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x4681f2,null))['then'](function(_0x275075){if(_0x275075){_0xd9dc21[_0xa9f1('0x60')][_0xa9f1('0x63')]=_0x275075['id'];return db['CannedAnswer'][_0xa9f1('0x58')](_0xd9dc21['body']);}})[_0xa9f1('0x1f')](respondWithResult(_0x4681f2,null))[_0xa9f1('0x51')](handleError(_0x4681f2,null));};exports['getAnswers']=function(_0x1191da,_0x3bb57a,_0x1fc071){var _0xc85ef3={'raw':![],'where':{}};var _0x1c8429={};var _0x353a74={'count':0x0,'rows':[]};return db[_0xa9f1('0x3c')][_0xa9f1('0x66')]({'where':{'id':_0x1191da[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x3bb57a,null))['then'](function(_0x17a281){if(_0x17a281){_0x1c8429[_0xa9f1('0x40')]=_[_0xa9f1('0x55')](db[_0xa9f1('0x6c')][_0xa9f1('0x3d')]);_0x1c8429[_0xa9f1('0x41')]=_['keys'](_0x1191da[_0xa9f1('0x41')]);_0x1c8429[_0xa9f1('0x4a')]=_['intersection'](_0x1c8429[_0xa9f1('0x40')],_0x1c8429['query']);_0xc85ef3['attributes']=_[_0xa9f1('0x43')](_0x1c8429[_0xa9f1('0x40')],qs[_0xa9f1('0x44')](_0x1191da['query'][_0xa9f1('0x44')]));_0xc85ef3['attributes']=_0xc85ef3[_0xa9f1('0x42')][_0xa9f1('0x45')]?_0xc85ef3[_0xa9f1('0x42')]:_0x1c8429[_0xa9f1('0x40')];if(!_0x1191da[_0xa9f1('0x41')]['hasOwnProperty'](_0xa9f1('0x67'))){_0xc85ef3[_0xa9f1('0x2d')]=qs[_0xa9f1('0x2d')](_0x1191da[_0xa9f1('0x41')][_0xa9f1('0x2d')]);_0xc85ef3[_0xa9f1('0x2a')]=qs[_0xa9f1('0x2a')](_0x1191da[_0xa9f1('0x41')][_0xa9f1('0x2a')]);}_0xc85ef3[_0xa9f1('0x47')]=qs[_0xa9f1('0x48')](_0x1191da['query'][_0xa9f1('0x48')]);_0xc85ef3['where']=qs[_0xa9f1('0x4a')](_[_0xa9f1('0x4b')](_0x1191da[_0xa9f1('0x41')],_0x1c8429[_0xa9f1('0x4a')]));_0xc85ef3[_0xa9f1('0x49')][_0xa9f1('0x63')]=_0x17a281['id'];if(_0x1191da[_0xa9f1('0x41')][_0xa9f1('0x6d')]){_0xc85ef3[_0xa9f1('0x49')]=_['merge'](_0xc85ef3[_0xa9f1('0x49')],{'$or':_[_0xa9f1('0x3b')](_0xc85ef3[_0xa9f1('0x42')],function(_0x4c11ca){var _0x1d056a={};_0x1d056a[_0x4c11ca]={'$like':'%'+_0x1191da[_0xa9f1('0x41')][_0xa9f1('0x6d')]+'%'};return _0x1d056a;})});}_0xc85ef3=_[_0xa9f1('0x4d')]({},_0xc85ef3,_0x1191da[_0xa9f1('0x4e')]);return db[_0xa9f1('0x6c')][_0xa9f1('0x2c')]({'where':_0xc85ef3[_0xa9f1('0x49')]})[_0xa9f1('0x1f')](function(_0x633c8e){_0x353a74[_0xa9f1('0x2c')]=_0x633c8e;if(_0x1191da[_0xa9f1('0x41')][_0xa9f1('0x4f')]){_0xc85ef3['include']=[{'all':!![]}];}return db[_0xa9f1('0x6c')][_0xa9f1('0x68')](_0xc85ef3);})[_0xa9f1('0x1f')](function(_0x1e38e7){_0x353a74[_0xa9f1('0x50')]=_0x1e38e7;return _0x353a74;});}})[_0xa9f1('0x1f')](respondWithFilteredResult(_0x3bb57a,_0xc85ef3))[_0xa9f1('0x51')](handleError(_0x3bb57a,null));};exports[_0xa9f1('0x6e')]=function(_0x896691,_0x117831,_0x4691b8){return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x896691[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x117831,null))['then'](function(_0x110fc4){if(_0x110fc4){return _0x110fc4[_0xa9f1('0x6e')](_0x896691['query'][_0xa9f1('0x6a')]);}})[_0xa9f1('0x1f')](respondWithStatusCode(_0x117831,null))[_0xa9f1('0x51')](handleError(_0x117831,null));};exports[_0xa9f1('0x6f')]=function(_0x229064,_0xf39ec7,_0x2edfad){return db[_0xa9f1('0x70')]['find']({'where':{'id':_0x229064[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0xf39ec7,null))[_0xa9f1('0x1f')](function(_0x4e9638){if(_0x4e9638){return _0x4e9638['addInteraction'](_0x229064[_0xa9f1('0x60')][_0xa9f1('0x6a')],_[_0xa9f1('0x71')](_0x229064['body'],['ids','id'])||{});}})[_0xa9f1('0x1f')](respondWithResult(_0xf39ec7,null))[_0xa9f1('0x51')](handleError(_0xf39ec7,null));};exports['getInteractions']=function(_0x1cd781,_0x33d263,_0x44aaaf){var _0x58bd76={'raw':![],'where':{}};var _0x18848c={};var _0x29758c={'count':0x0,'rows':[]};return db[_0xa9f1('0x3c')]['findOne']({'where':{'id':_0x1cd781[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x33d263,null))[_0xa9f1('0x1f')](function(_0x51daf0){if(_0x51daf0){_0x18848c[_0xa9f1('0x40')]=_[_0xa9f1('0x55')](db[_0xa9f1('0x70')][_0xa9f1('0x3d')]);_0x18848c['query']=_[_0xa9f1('0x55')](_0x1cd781['query']);_0x18848c[_0xa9f1('0x4a')]=_[_0xa9f1('0x43')](_0x18848c[_0xa9f1('0x40')],_0x18848c[_0xa9f1('0x41')]);_0x58bd76[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0x18848c[_0xa9f1('0x40')],qs['fields'](_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x58bd76[_0xa9f1('0x42')]=_0x58bd76[_0xa9f1('0x42')][_0xa9f1('0x45')]?_0x58bd76[_0xa9f1('0x42')]:_0x18848c[_0xa9f1('0x40')];if(!_0x1cd781[_0xa9f1('0x41')]['hasOwnProperty'](_0xa9f1('0x67'))){_0x58bd76[_0xa9f1('0x2d')]=qs['limit'](_0x1cd781[_0xa9f1('0x41')]['limit']);_0x58bd76[_0xa9f1('0x2a')]=qs[_0xa9f1('0x2a')](_0x1cd781['query']['offset']);}_0x58bd76[_0xa9f1('0x47')]=qs['sort'](_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x48')]);_0x58bd76[_0xa9f1('0x49')]=qs[_0xa9f1('0x4a')](_[_0xa9f1('0x4b')](_0x1cd781[_0xa9f1('0x41')],_0x18848c[_0xa9f1('0x4a')]));_0x58bd76[_0xa9f1('0x49')][_0xa9f1('0x63')]=_0x51daf0['id'];if(_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x6d')]){_0x58bd76['where']=_[_0xa9f1('0x4d')](_0x58bd76[_0xa9f1('0x49')],{'$or':_['map'](_0x58bd76['attributes'],function(_0x16efd1){var _0x24c2ff={};_0x24c2ff[_0x16efd1]={'$like':'%'+_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x6d')]+'%'};return _0x24c2ff;})});}_0x58bd76=_[_0xa9f1('0x4d')]({},_0x58bd76,_0x1cd781['options']);return db[_0xa9f1('0x70')][_0xa9f1('0x2c')]({'where':_0x58bd76[_0xa9f1('0x49')]})[_0xa9f1('0x1f')](function(_0x214636){_0x29758c[_0xa9f1('0x2c')]=_0x214636;if(_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x4f')]){_0x58bd76[_0xa9f1('0x56')]=[{'model':db[_0xa9f1('0x72')],'as':'Contact','required':![]},{'model':db[_0xa9f1('0x73')],'as':'Owner','attributes':[_0xa9f1('0x38'),'fullname',_0xa9f1('0x74')],'required':![]},{'model':db[_0xa9f1('0x75')],'as':_0xa9f1('0x76'),'attributes':['id',_0xa9f1('0x38'),_0xa9f1('0x77')],'where':_0x1cd781[_0xa9f1('0x41')]['tag']?{'id':_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x78')]}:undefined,'required':_0x1cd781[_0xa9f1('0x41')][_0xa9f1('0x78')]?!![]:![]}];}return db[_0xa9f1('0x70')]['findAll'](_0x58bd76);})['then'](function(_0x2b43ce){_0x29758c['rows']=_0x2b43ce;return _0x29758c;});}})[_0xa9f1('0x1f')](respondWithFilteredResult(_0x33d263,_0x58bd76))[_0xa9f1('0x51')](handleError(_0x33d263,null));};exports['addApplications']=function(_0x1dc43b,_0x1e0f0d){var _0x2bbd06=_0x1dc43b[_0xa9f1('0x53')]['id'];var _0x35e194=_0x1dc43b[_0xa9f1('0x60')];var _0x2142c8=0xc8;var _0x17658d=null;return db['sequelize'][_0xa9f1('0x79')]({'isolationLevel':db[_0xa9f1('0x7a')]['Transaction']['ISOLATION_LEVELS'][_0xa9f1('0x7b')]},function(_0x312397){return db[_0xa9f1('0x3c')][_0xa9f1('0x66')]({'where':{'id':_0x2bbd06},'transaction':_0x312397})[_0xa9f1('0x1f')](function(_0x45b16c){if(_0x45b16c){return db[_0xa9f1('0x7c')][_0xa9f1('0x33')]({'where':{'FaxAccountId':_0x2bbd06},'transaction':_0x312397})[_0xa9f1('0x1f')](function(){var _0xef312d=_[_0xa9f1('0x3b')](_0x35e194,function(_0x4f0927){_0x4f0927['FaxAccountId']=_0x2bbd06;return _0x4f0927;});return db['FaxApplication']['bulkCreate'](_0xef312d,{'transaction':_0x312397});});}else{_0x2142c8=0x194;_0x17658d=[];}});})[_0xa9f1('0x1f')](function(){if(_0x2142c8!==0x194){return db['FaxApplication'][_0xa9f1('0x7d')]({'where':{'FaxAccountId':_0x2bbd06},'order':_0xa9f1('0x7e')})['then'](function(_0x362ec4){_0x17658d=_0x362ec4;});}})[_0xa9f1('0x51')](function(_0x9dfbaf){_0x2142c8=0x1f4;logger['error'](_0x9dfbaf[_0xa9f1('0x37')]);if(_0x9dfbaf[_0xa9f1('0x38')]){delete _0x9dfbaf[_0xa9f1('0x38')];}_0x17658d=_0x9dfbaf;})[_0xa9f1('0x7f')](function(){if(_0x17658d===null){_0x1e0f0d[_0xa9f1('0x36')](_0x2142c8);}else{if(_0x2142c8===0x1f4){_0x1e0f0d['status'](_0x2142c8)[_0xa9f1('0x39')](_0x17658d);}else{_0x1e0f0d[_0xa9f1('0x29')](_0x2142c8)[_0xa9f1('0x2f')](_0x17658d);}}});};exports['getApplications']=function(_0x3cc4b4,_0x413eb4,_0x1099cf){var _0x479be6={};var _0x74fa39={};var _0x1b349c;var _0x32b8a2;return db[_0xa9f1('0x3c')]['findOne']({'where':{'id':_0x3cc4b4[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x413eb4,null))['then'](function(_0x342f5a){if(_0x342f5a){_0x1b349c=_0x342f5a;_0x74fa39[_0xa9f1('0x40')]=_[_0xa9f1('0x55')](db[_0xa9f1('0x7c')]['rawAttributes']);_0x74fa39['query']=_['keys'](_0x3cc4b4[_0xa9f1('0x41')]);_0x74fa39['filters']=_['intersection'](_0x74fa39[_0xa9f1('0x40')],_0x74fa39['query']);_0x479be6[_0xa9f1('0x42')]=_['intersection'](_0x74fa39[_0xa9f1('0x40')],qs[_0xa9f1('0x44')](_0x3cc4b4[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x479be6[_0xa9f1('0x42')]=_0x479be6[_0xa9f1('0x42')][_0xa9f1('0x45')]?_0x479be6[_0xa9f1('0x42')]:_0x74fa39[_0xa9f1('0x40')];_0x479be6['order']=qs[_0xa9f1('0x48')](_0x3cc4b4[_0xa9f1('0x41')][_0xa9f1('0x48')]);_0x479be6[_0xa9f1('0x49')]=qs[_0xa9f1('0x4a')](_[_0xa9f1('0x4b')](_0x3cc4b4[_0xa9f1('0x41')],_0x74fa39[_0xa9f1('0x4a')]));if(_0x3cc4b4[_0xa9f1('0x41')][_0xa9f1('0x6d')]){_0x479be6[_0xa9f1('0x49')]=_['merge'](_0x479be6[_0xa9f1('0x49')],{'$or':_['map'](_0x479be6[_0xa9f1('0x42')],function(_0x202a4c){var _0x4797fc={};_0x4797fc[_0x202a4c]={'$like':'%'+_0x3cc4b4[_0xa9f1('0x41')][_0xa9f1('0x6d')]+'%'};return _0x4797fc;})});}_0x479be6=_[_0xa9f1('0x4d')]({},_0x479be6,_0x3cc4b4[_0xa9f1('0x4e')]);return _0x1b349c[_0xa9f1('0x80')](_0x479be6);}})[_0xa9f1('0x1f')](function(_0x209999){if(_0x209999){_0x32b8a2=_0x209999[_0xa9f1('0x45')];if(!_0x3cc4b4['query']['hasOwnProperty'](_0xa9f1('0x67'))){_0x479be6[_0xa9f1('0x2d')]=qs[_0xa9f1('0x2d')](_0x3cc4b4[_0xa9f1('0x41')]['limit']);_0x479be6[_0xa9f1('0x2a')]=qs['offset'](_0x3cc4b4[_0xa9f1('0x41')][_0xa9f1('0x2a')]);}return _0x1b349c[_0xa9f1('0x80')](_0x479be6);}})['then'](function(_0x311306){if(_0x311306){return _0x311306?{'count':_0x32b8a2,'rows':_0x311306}:null;}})['then'](respondWithResult(_0x413eb4,null))[_0xa9f1('0x51')](handleError(_0x413eb4,null));};function Extension(_0x4a1094,_0x162643,_0x28cd62,_0x383835){this[_0xa9f1('0x81')]=_0xa9f1('0x82');this[_0xa9f1('0x83')]=_0x4a1094[_0xa9f1('0x84')];this[_0xa9f1('0x85')]=_0x383835;this[_0xa9f1('0x3e')]='system';this[_0xa9f1('0x86')]=_0xa9f1('0x87');this[_0xa9f1('0x63')]=_0x4a1094['id'];this['priority']=_0x162643;this['appdata']=_0x28cd62;}function createExtensionsReciveFax(_0x4e95fe){var _0x2398bf=0x1;var _0x9c3ac7=[];_0x9c3ac7[_0xa9f1('0x88')](new Extension(_0x4e95fe,_0x2398bf,'',_0xa9f1('0x89')));_0x2398bf+=0x1;_0x9c3ac7[_0xa9f1('0x88')](new Extension(_0x4e95fe,_0x2398bf,_0xa9f1('0x8a'),'Set'));_0x2398bf+=0x1;for(var _0x31865c in _0x4e95fe){if(_0x4e95fe[_0xa9f1('0x46')](_0x31865c)&&(_0x31865c===_0xa9f1('0x8b')||_0x31865c===_0xa9f1('0x84')||_0x31865c===_0xa9f1('0x8c')||_0x31865c===_0xa9f1('0x8d')||_0x31865c===_0xa9f1('0x8e')||_0x31865c==='maxrate'||_0x31865c===_0xa9f1('0x8f')||_0x31865c===_0xa9f1('0x90')||_0x31865c===_0xa9f1('0x91'))){_0x9c3ac7[_0xa9f1('0x88')](new Extension(_0x4e95fe,_0x2398bf,_0xa9f1('0x92')+_0x31865c+')='+_0x4e95fe[_0x31865c],_0xa9f1('0x93')));_0x2398bf+=0x1;}}_0x9c3ac7[_0xa9f1('0x88')](new Extension(_0x4e95fe,_0x2398bf,'6',_0xa9f1('0x94')));_0x2398bf+=0x1;_0x9c3ac7[_0xa9f1('0x88')](new Extension(_0x4e95fe,_0x2398bf,_0xa9f1('0x95'),_0xa9f1('0x96')));_0x2398bf=0x0;return _0x9c3ac7;}exports[_0xa9f1('0x97')]=function(_0x3fbf25,_0xe64289,_0x5c84c5){var _0x267168;return db['sequelize'][_0xa9f1('0x79')](function(_0x528de9){return db[_0xa9f1('0x3c')]['create'](_0x3fbf25[_0xa9f1('0x60')],{'transaction':_0x528de9})[_0xa9f1('0x1f')](function(_0x1a505c){_0x267168=_0x1a505c[_0xa9f1('0x34')]({'plain':!![]});return db['VoiceExtension'][_0xa9f1('0x98')](createExtensionsReciveFax(_0x267168),{'transaction':_0x528de9});});})[_0xa9f1('0x1f')](function(){return _0x267168;})[_0xa9f1('0x1f')](respondWithResult(_0xe64289,null))[_0xa9f1('0x51')](handleError(_0xe64289,null));};exports[_0xa9f1('0x99')]=function(_0x4de73f,_0x397fed,_0x38e00c){var _0x15e01c;return db[_0xa9f1('0x7a')]['transaction'](function(_0x22e0d2){return db['FaxAccount']['update'](_0x4de73f[_0xa9f1('0x60')],{'where':{'id':_0x4de73f['body']['id']},'transaction':_0x22e0d2})['then'](function(_0xb41af7){return db[_0xa9f1('0x9a')][_0xa9f1('0x33')]({'where':{'FaxAccountId':_0x4de73f[_0xa9f1('0x60')]['id']},'transaction':_0x22e0d2})['then'](function(_0xf42cc4){return db[_0xa9f1('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0xa9f1('0x71')](_0x4de73f[_0xa9f1('0x60')],[_0xa9f1('0x9b'),_0xa9f1('0x3f'),'createdAt',_0xa9f1('0x9c'),_0xa9f1('0x9d'),_0xa9f1('0x9e')])),{'transaction':_0x22e0d2});});});})[_0xa9f1('0x1f')](function(){return db['FaxAccount'][_0xa9f1('0x9f')](_0x4de73f['body']['id']);})[_0xa9f1('0x1f')](respondWithResult(_0x397fed,null))[_0xa9f1('0x51')](handleError(_0x397fed,null));};exports['getMessages']=function(_0x57358d,_0x36c7dc,_0x2f6e76){var _0x2131da={'raw':!![],'where':{}};var _0x3dcdca={};var _0x134076={'count':0x0,'rows':[]};return db[_0xa9f1('0x3c')]['findOne']({'where':{'id':_0x57358d[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x36c7dc,null))[_0xa9f1('0x1f')](function(_0x44d86b){if(_0x44d86b){_0x3dcdca['model']=_[_0xa9f1('0x55')](db[_0xa9f1('0xa0')][_0xa9f1('0x3d')]);_0x3dcdca[_0xa9f1('0x41')]=_['keys'](_0x57358d[_0xa9f1('0x41')]);_0x3dcdca[_0xa9f1('0x4a')]=_[_0xa9f1('0x43')](_0x3dcdca['model'],_0x3dcdca['query']);_0x2131da[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0x3dcdca[_0xa9f1('0x40')],qs[_0xa9f1('0x44')](_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x2131da[_0xa9f1('0x42')]=_0x2131da[_0xa9f1('0x42')][_0xa9f1('0x45')]?_0x2131da['attributes']:_0x3dcdca[_0xa9f1('0x40')];if(!_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x46')](_0xa9f1('0x67'))){_0x2131da[_0xa9f1('0x2d')]=qs['limit'](_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x2d')]);_0x2131da[_0xa9f1('0x2a')]=qs['offset'](_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x2a')]);}_0x2131da[_0xa9f1('0x47')]=qs[_0xa9f1('0x48')](_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x48')]);_0x2131da[_0xa9f1('0x49')]=qs['filters'](_[_0xa9f1('0x4b')](_0x57358d[_0xa9f1('0x41')],_0x3dcdca[_0xa9f1('0x4a')]));_0x2131da['where'][_0xa9f1('0x63')]=_0x44d86b['id'];if(_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x6d')]){_0x2131da[_0xa9f1('0x49')]=_[_0xa9f1('0x4d')](_0x2131da['where'],{'$or':_[_0xa9f1('0x3b')](_0x2131da[_0xa9f1('0x42')],function(_0x3fd1bb){var _0x19e059={};_0x19e059[_0x3fd1bb]={'$like':'%'+_0x57358d[_0xa9f1('0x41')][_0xa9f1('0x6d')]+'%'};return _0x19e059;})});}if(_0x57358d[_0xa9f1('0x41')]['$gte']){var _0x20e64b=_0x57358d['query']['$gte'][_0xa9f1('0xa1')](',');var _0x1e41ed={};_0x1e41ed[_0x20e64b[0x0]]={'$gte':moment(_0x20e64b[0x1])[_0xa9f1('0xa2')](_0xa9f1('0xa3'))};_0x2131da[_0xa9f1('0x49')]=_[_0xa9f1('0x4d')](_0x2131da[_0xa9f1('0x49')],_0x1e41ed);}_0x2131da=_[_0xa9f1('0x4d')]({},_0x2131da,_0x57358d['options']);return db['FaxMessage']['count']({'where':_0x2131da[_0xa9f1('0x49')]})[_0xa9f1('0x1f')](function(_0x692ec5){_0x134076[_0xa9f1('0x2c')]=_0x692ec5;if(_0x57358d[_0xa9f1('0x41')]['includeAll']){_0x2131da['include']=[{'all':!![]}];}return db[_0xa9f1('0xa0')][_0xa9f1('0x68')](_0x2131da);})[_0xa9f1('0x1f')](function(_0x943574){_0x134076['rows']=_0x943574;return _0x134076;});}})[_0xa9f1('0x1f')](respondWithFilteredResult(_0x36c7dc,_0x2131da))['catch'](handleError(_0x36c7dc,null));};exports[_0xa9f1('0x39')]=function(_0x2c054f,_0x41449e,_0x3cfab1){var _0x5c9852,_0x32530c={},_0x5d1083;if(_0x2c054f[_0xa9f1('0x60')]['to']){_0x5d1083=_0x2c054f[_0xa9f1('0x60')]['to'][0x0];}return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x2c054f[_0xa9f1('0x53')]['id']},'include':[{'model':db[_0xa9f1('0xa4')],'as':_0xa9f1('0xa5'),'include':[{'model':db['CmContact'],'as':_0xa9f1('0xa6'),'where':{'fax':_0x5d1083},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x41449e,null))[_0xa9f1('0x1f')](function(_0x50b9e6){_0x5c9852=_0x50b9e6;if(_0x2c054f[_0xa9f1('0x60')]['attachments']&&_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')]['length']){for(var _0x452c1a=0x0;_0x452c1a<_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][_0xa9f1('0x45')];_0x452c1a+=0x1){_0x2c054f[_0xa9f1('0x60')]['attachments'][_0x452c1a]={'filename':_0x2c054f['body'][_0xa9f1('0xa7')][_0x452c1a]['name'],'id':_0x2c054f['body']['attachments'][_0x452c1a]['id'],'path':path[_0xa9f1('0xa8')](config[_0xa9f1('0xa9')],_0xa9f1('0xaa'),_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][_0x452c1a][_0xa9f1('0xab')])};}}return respondWithRpcPromise(_0xa9f1('0xac'),_0xa9f1('0xac'),{'FaxAccountId':_[_0xa9f1('0xad')](_0x2c054f[_0xa9f1('0x53')]['id'])?undefined:_0x2c054f['params']['id'],'path':_[_0xa9f1('0xad')](_0x2c054f['body'][_0xa9f1('0xa7')][0x0][_0xa9f1('0x5')])?undefined:_0x2c054f['body']['attachments'][0x0][_0xa9f1('0x5')],'fax':_[_0xa9f1('0xad')](_0x2c054f[_0xa9f1('0x60')]['to'][0x0])?undefined:_0x2c054f['body']['to'][0x0]},client9002);})['then'](function(){if(_0x5c9852){if(_['isNil'](_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xae')])){_0x2c054f[_0xa9f1('0x60')]['from']=util[_0xa9f1('0xa2')](_0xa9f1('0xaf'),_0x5c9852[_0xa9f1('0x38')],_0x5c9852['fax']);}if(_0x5c9852[_0xa9f1('0xa5')]){if(_0x5c9852[_0xa9f1('0xa5')]['Contacts'][_0xa9f1('0x45')]){return _0x5c9852['List'][_0xa9f1('0xa6')][0x0];}else{return db[_0xa9f1('0x72')]['create'](_[_0xa9f1('0xb0')](_0x2c054f[_0xa9f1('0x60')],{'firstName':_0x2c054f['body']['to'][0x0],'phone':_0x2c054f[_0xa9f1('0x60')]['to'][0x0],'fax':_0x2c054f[_0xa9f1('0x60')]['to'][0x0],'ListId':_0x5c9852[_0xa9f1('0x9e')]}));}}else{throw new Error(_0xa9f1('0xb1'));}}else{throw new Error(_0xa9f1('0xb2'));}})[_0xa9f1('0x1f')](function(_0x304876){if(_0x304876){return db[_0xa9f1('0x70')][_0xa9f1('0x57')]({'where':{'ContactId':_0x304876['id'],'closed':![],'FaxAccountId':_0x5c9852['id']}})['then'](function(_0x4d0f97){if(_0x4d0f97){return[_0x4d0f97,![]];}return db[_0xa9f1('0x70')][_0xa9f1('0x58')]({'UserId':_0x2c054f['user']['id'],'ContactId':_0x304876['id'],'FaxAccountId':_0x5c9852['id'],'fax':_0x2c054f['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa9f1('0x4d')](_0x2c054f['body'],{'read':![],'body':_0x2c054f['body'][_0xa9f1('0xa7')][0x0][_0xa9f1('0xb3')],'FaxAccountId':_0x5c9852['id'],'UserId':_0x2c054f['user']['id'],'ContactId':_0x304876['id'],'AttachmentId':_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xa9f1('0xa0')],'as':'Messages'}]})['then'](function(_0x2d0dc4){return[_0x2d0dc4,!![]];});});}else{throw new Error(_0xa9f1('0xb4'));}})[_0xa9f1('0xb5')](function(_0x7fd8a8,_0x1a17d6){if(_0x1a17d6){return _0x7fd8a8;}return db[_0xa9f1('0xa0')][_0xa9f1('0x58')]({'direction':'out','read':![],'body':_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][0x0][_0xa9f1('0xb3')],'FaxAccountId':_0x5c9852['id'],'FaxInteractionId':_0x7fd8a8['id'],'UserId':_0x2c054f[_0xa9f1('0x59')]['id'],'ContactId':_0x7fd8a8[_0xa9f1('0xb6')],'AttachmentId':_0x2c054f['body'][_0xa9f1('0xa7')][0x0]['id']})[_0xa9f1('0x1f')](function(_0x53d566){_0x7fd8a8[_0xa9f1('0xb7')]['Messages']=[];_0x7fd8a8[_0xa9f1('0xb7')][_0xa9f1('0xb8')][_0xa9f1('0x88')](_0x53d566[_0xa9f1('0xb7')]);return _0x7fd8a8;});})[_0xa9f1('0x1f')](function(_0x41f0bb){respondWithRpcPromise(_0xa9f1('0xb9'),'SendFax',{'FaxAccountId':_['isNil'](_0x2c054f[_0xa9f1('0x53')]['id'])?undefined:_0x2c054f[_0xa9f1('0x53')]['id'],'path':_[_0xa9f1('0xad')](_0x2c054f[_0xa9f1('0x60')]['attachments'][0x0][_0xa9f1('0x5')])?undefined:_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][0x0][_0xa9f1('0x5')],'fax':_['isNil'](_0x2c054f['body']['to'][0x0])?undefined:_0x2c054f[_0xa9f1('0x60')]['to'][0x0],'AttachmentId':_0x2c054f[_0xa9f1('0x60')][_0xa9f1('0xa7')][0x0]['id']},client9002)[_0xa9f1('0x1f')](function(_0x5a7f96){logger[_0xa9f1('0x20')](_0xa9f1('0xba'),_0x5a7f96);})[_0xa9f1('0x51')](function(_0x514cb9){logger[_0xa9f1('0x20')]('SendFaxRpc,\x20%s',_0x514cb9);});return _0x41f0bb;})[_0xa9f1('0x1f')](respondWithResult(_0x41449e,null))['catch'](handleError(_0x41449e,null));};exports['addAgents']=function(_0x41e82f,_0x33a845,_0x35c983){return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x41e82f[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x33a845,null))[_0xa9f1('0x1f')](function(_0x18e5fc){if(_0x18e5fc){return _0x18e5fc['addAgents'](_0x41e82f[_0xa9f1('0x60')][_0xa9f1('0x6a')],_[_0xa9f1('0x71')](_0x41e82f['body'],[_0xa9f1('0x6a'),'id'])||{})[_0xa9f1('0xb5')](function(_0x5493fb){for(var _0x3dd727=0x0;_0x3dd727<_0x41e82f[_0xa9f1('0x60')][_0xa9f1('0x6a')][_0xa9f1('0x45')];_0x3dd727+=0x1){socket[_0xa9f1('0xbb')]('userFaxAccount:save',{'UserId':Number(_0x41e82f[_0xa9f1('0x60')][_0xa9f1('0x6a')][_0x3dd727]),'FaxAccountId':Number(_0x41e82f[_0xa9f1('0x53')]['id'])});}return _0x5493fb;});}})[_0xa9f1('0x1f')](respondWithResult(_0x33a845,null))[_0xa9f1('0x51')](handleError(_0x33a845,null));};exports[_0xa9f1('0xbc')]=function(_0x294b8d,_0x45c1c2,_0x20b107){return db[_0xa9f1('0x3c')][_0xa9f1('0x57')]({'where':{'id':_0x294b8d[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x45c1c2,null))[_0xa9f1('0x1f')](function(_0x5940ad){if(_0x5940ad){return _0x5940ad[_0xa9f1('0xbc')](_0x294b8d[_0xa9f1('0x41')]['ids'])[_0xa9f1('0x1f')](function(){if(_[_0xa9f1('0xbd')](_0x294b8d[_0xa9f1('0x41')][_0xa9f1('0x6a')])){for(var _0xdb0a2b=0x0;_0xdb0a2b<_0x294b8d[_0xa9f1('0x41')][_0xa9f1('0x6a')][_0xa9f1('0x45')];_0xdb0a2b+=0x1){socket[_0xa9f1('0xbb')](_0xa9f1('0xbe'),{'UserId':Number(_0x294b8d['query'][_0xa9f1('0x6a')][_0xdb0a2b]),'FaxAccountId':Number(_0x294b8d[_0xa9f1('0x53')]['id'])});}}else{socket['emit'](_0xa9f1('0xbe'),{'UserId':Number(_0x294b8d[_0xa9f1('0x41')][_0xa9f1('0x6a')]),'FaxAccountId':Number(_0x294b8d[_0xa9f1('0x53')]['id'])});}});}})[_0xa9f1('0x1f')](respondWithStatusCode(_0x45c1c2,null))['catch'](handleError(_0x45c1c2,null));};exports[_0xa9f1('0xbf')]=function(_0xab0bed,_0x350291,_0x58cac7){var _0x8ce794={};var _0x425a18={};var _0x247849;var _0x52c39d;return db[_0xa9f1('0x3c')][_0xa9f1('0x66')]({'where':{'id':_0xab0bed[_0xa9f1('0x53')]['id']}})[_0xa9f1('0x1f')](handleEntityNotFound(_0x350291,null))[_0xa9f1('0x1f')](function(_0x5e42ae){if(_0x5e42ae){_0x247849=_0x5e42ae;_0x425a18[_0xa9f1('0x40')]=_['keys'](db[_0xa9f1('0x73')][_0xa9f1('0x3d')]);_0x425a18[_0xa9f1('0x41')]=_[_0xa9f1('0x55')](_0xab0bed['query']);_0x425a18[_0xa9f1('0x4a')]=_['intersection'](_0x425a18['model'],_0x425a18[_0xa9f1('0x41')]);_0x8ce794[_0xa9f1('0x42')]=_[_0xa9f1('0x43')](_0x425a18[_0xa9f1('0x40')],qs[_0xa9f1('0x44')](_0xab0bed[_0xa9f1('0x41')][_0xa9f1('0x44')]));_0x8ce794[_0xa9f1('0x42')]=_0x8ce794['attributes'][_0xa9f1('0x45')]?_0x8ce794['attributes']:_0x425a18[_0xa9f1('0x40')];_0x8ce794[_0xa9f1('0x47')]=qs[_0xa9f1('0x48')](_0xab0bed['query'][_0xa9f1('0x48')]);_0x8ce794[_0xa9f1('0x49')]=qs[_0xa9f1('0x4a')](_[_0xa9f1('0x4b')](_0xab0bed['query'],_0x425a18[_0xa9f1('0x4a')]));if(_0xab0bed['query'][_0xa9f1('0x6d')]){_0x8ce794[_0xa9f1('0x49')]=_[_0xa9f1('0x4d')](_0x8ce794['where'],{'$or':_['map'](_0x8ce794[_0xa9f1('0x42')],function(_0xd5fe80){var _0x145534={};_0x145534[_0xd5fe80]={'$like':'%'+_0xab0bed['query']['filter']+'%'};return _0x145534;})});}_0x8ce794=_[_0xa9f1('0x4d')]({},_0x8ce794,_0xab0bed[_0xa9f1('0x4e')]);return _0x247849[_0xa9f1('0xbf')](_0x8ce794);}})['then'](function(_0x2908d5){if(_0x2908d5){_0x52c39d=_0x2908d5[_0xa9f1('0x45')];if(!_0xab0bed[_0xa9f1('0x41')][_0xa9f1('0x46')](_0xa9f1('0x67'))){_0x8ce794[_0xa9f1('0x2d')]=qs[_0xa9f1('0x2d')](_0xab0bed[_0xa9f1('0x41')][_0xa9f1('0x2d')]);_0x8ce794[_0xa9f1('0x2a')]=qs[_0xa9f1('0x2a')](_0xab0bed['query'][_0xa9f1('0x2a')]);}return _0x247849[_0xa9f1('0xbf')](_0x8ce794);}})[_0xa9f1('0x1f')](function(_0x575156){if(_0x575156){return _0x575156?{'count':_0x52c39d,'rows':_0x575156}:null;}})[_0xa9f1('0x1f')](respondWithResult(_0x350291,null))['catch'](handleError(_0x350291,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ab642a1..e8d9be9 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xba40c,_0x1eabd9){var _0x438f0c=function(_0x522fa2){while(--_0x522fa2){_0xba40c['push'](_0xba40c['shift']());}};_0x438f0c(++_0x1eabd9);}(_0xbca0,0x8b));var _0x0bca=function(_0x1a7af1,_0x5d18be){_0x1a7af1=_0x1a7af1-0x0;var _0x2fdb53=_0xbca0[_0x1a7af1];return _0x2fdb53;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var FaxAccount=require(_0x0bca('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){FaxAccountEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);FaxAccountEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];FaxAccount[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x4aec=['remove','emit','hook','events','../../mysqldb','update'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x4aec,0x1ad));var _0xc4ae=function(_0x328f46,_0x1f873c){_0x328f46=_0x328f46-0x0;var _0x597efb=_0x4aec[_0x328f46];return _0x597efb;};'use strict';var EventEmitter=require(_0xc4ae('0x0'));var FaxAccount=require(_0xc4ae('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc4ae('0x2'),'afterDestroy':_0xc4ae('0x3')};function emitEvent(_0x553c89){return function(_0x1fd01c,_0x311667,_0x2864a9){FaxAccountEvents[_0xc4ae('0x4')](_0x553c89+':'+_0x1fd01c['id'],_0x1fd01c);FaxAccountEvents[_0xc4ae('0x4')](_0x553c89,_0x1fd01c);_0x2864a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xc4ae('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f64fe1f..41f1a39 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e1c=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15de84,_0x10b96e){var _0x261be8=function(_0x4b7391){while(--_0x4b7391){_0x15de84['push'](_0x15de84['shift']());}};_0x261be8(++_0x10b96e);}(_0x8e1c,0x89));var _0xc8e1=function(_0xc048e2,_0x3825ef){_0xc048e2=_0xc048e2-0x0;var _0x4012ed=_0x8e1c[_0xc048e2];return _0x4012ed;};'use strict';var _=require(_0xc8e1('0x0'));var util=require(_0xc8e1('0x1'));var logger=require(_0xc8e1('0x2'))(_0xc8e1('0x3'));var moment=require(_0xc8e1('0x4'));var BPromise=require(_0xc8e1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8e1('0x6'));var rimraf=require(_0xc8e1('0x7'));var config=require(_0xc8e1('0x8'));var attributes=require(_0xc8e1('0x9'));module[_0xc8e1('0xa')]=function(_0x261dba,_0x241400){return _0x261dba['define'](_0xc8e1('0xb'),attributes,{'tableName':_0xc8e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3d9=['moment','bluebird','request-promise','rimraf','exports','FaxAccount','lodash','util','../../config/logger'];(function(_0x5075fd,_0x164009){var _0x70535f=function(_0x20a576){while(--_0x20a576){_0x5075fd['push'](_0x5075fd['shift']());}};_0x70535f(++_0x164009);}(_0xc3d9,0xf0));var _0x9c3d=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xc3d9[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x9c3d('0x0'));var util=require(_0x9c3d('0x1'));var logger=require(_0x9c3d('0x2'))('api');var moment=require(_0x9c3d('0x3'));var BPromise=require(_0x9c3d('0x4'));var rp=require(_0x9c3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c3d('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x9c3d('0x7')]=function(_0x45ad19,_0x48dc6f){return _0x45ad19['define'](_0x9c3d('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 7618a26..6460d91 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7212=['attributes','limit','include','map','model','info','NotifyFaxAccount','body','fax','CmContact','describe','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','options','raw'];(function(_0x26dc79,_0x2a0deb){var _0x2997fe=function(_0x3401b8){while(--_0x3401b8){_0x26dc79['push'](_0x26dc79['shift']());}};_0x2997fe(++_0x2a0deb);}(_0x7212,0x9b));var _0x2721=function(_0x2ba08e,_0x40e520){_0x2ba08e=_0x2ba08e-0x0;var _0x15ec6b=_0x7212[_0x2ba08e];return _0x15ec6b;};'use strict';var _=require(_0x2721('0x0'));var util=require(_0x2721('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2721('0x2'));var fs=require('fs');var Redis=require(_0x2721('0x3'));var db=require(_0x2721('0x4'))['db'];var utils=require(_0x2721('0x5'));var logger=require(_0x2721('0x6'))(_0x2721('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2721('0x8')][_0x2721('0x9')]({'port':0x232c});config[_0x2721('0xa')]=_[_0x2721('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2721('0xc'))[_0x2721('0xd')](socket);function respondWithRpcPromise(_0x243504,_0x4d2b4f,_0x114a1d){return new BPromise(function(_0x3a591d,_0x5c279b){return client[_0x2721('0xe')](_0x243504,_0x114a1d)['then'](function(_0x396c10){logger['info'](_0x2721('0xf'),_0x4d2b4f,_0x2721('0x10'));logger[_0x2721('0x11')](_0x2721('0x12'),_0x4d2b4f,_0x2721('0x10'),JSON[_0x2721('0x13')](_0x396c10));if(_0x396c10[_0x2721('0x14')]){if(_0x396c10[_0x2721('0x14')][_0x2721('0x15')]===0x1f4){logger[_0x2721('0x14')](_0x2721('0xf'),_0x4d2b4f,_0x396c10[_0x2721('0x14')][_0x2721('0x16')]);return _0x5c279b(_0x396c10['error'][_0x2721('0x16')]);}logger[_0x2721('0x14')]('FaxAccount,\x20%s,\x20%s',_0x4d2b4f,_0x396c10[_0x2721('0x14')][_0x2721('0x16')]);return _0x3a591d(_0x396c10[_0x2721('0x14')][_0x2721('0x16')]);}else{logger['info'](_0x2721('0xf'),_0x4d2b4f,_0x2721('0x10'));_0x3a591d(_0x396c10[_0x2721('0x17')][_0x2721('0x16')]);}})['catch'](function(_0x1af7a0){logger[_0x2721('0x14')](_0x2721('0xf'),_0x4d2b4f,_0x1af7a0);_0x5c279b(_0x1af7a0);});});}exports[_0x2721('0x18')]=function(_0x30a3be){var _0x1ad3d2=this;return new Promise(function(_0x319a12,_0x5f4c08){return db['FaxAccount']['findAll']({'raw':_0x30a3be[_0x2721('0x19')]?_0x30a3be['options'][_0x2721('0x1a')]===undefined?!![]:![]:!![],'where':_0x30a3be[_0x2721('0x19')]?_0x30a3be[_0x2721('0x19')]['where']||null:null,'attributes':_0x30a3be[_0x2721('0x19')]?_0x30a3be[_0x2721('0x19')][_0x2721('0x1b')]||null:null,'limit':_0x30a3be[_0x2721('0x19')]?_0x30a3be['options'][_0x2721('0x1c')]||null:null,'include':_0x30a3be['options']?_0x30a3be[_0x2721('0x19')][_0x2721('0x1d')]?_[_0x2721('0x1e')](_0x30a3be[_0x2721('0x19')][_0x2721('0x1d')],function(_0x2be9ed){return{'model':db[_0x2be9ed[_0x2721('0x1f')]],'as':_0x2be9ed['as'],'attributes':_0x2be9ed[_0x2721('0x1b')],'include':_0x2be9ed['include']?_[_0x2721('0x1e')](_0x2be9ed[_0x2721('0x1d')],function(_0x1df985){return{'model':db[_0x1df985['model']],'as':_0x1df985['as'],'attributes':_0x1df985['attributes'],'include':_0x1df985['include']?_[_0x2721('0x1e')](_0x1df985[_0x2721('0x1d')],function(_0x9a9fe9){return{'model':db[_0x9a9fe9['model']],'as':_0x9a9fe9['as'],'attributes':_0x9a9fe9[_0x2721('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x493d73){logger[_0x2721('0x20')](_0x2721('0x18'),_0x30a3be);logger[_0x2721('0x11')](_0x2721('0x18'),_0x30a3be,JSON['stringify'](_0x493d73));_0x319a12(_0x493d73);})['catch'](function(_0x3b40e8){logger[_0x2721('0x14')](_0x2721('0x18'),_0x3b40e8[_0x2721('0x16')],_0x30a3be);_0x5f4c08(_0x1ad3d2[_0x2721('0x14')](0x1f4,_0x3b40e8['message']));});});};exports[_0x2721('0x21')]=function(_0x3bfb34,_0x4ff6c9,_0x2e85c4){var _0x118c7f=this;return new Promise(function(_0xc388f0,_0x3c22f2){var _0x58f112={'body':_0x3bfb34[_0x2721('0x22')],'channel':_0x2721('0x23')};var _0x52f49c=[];var _0x478160=[];var _0x2bca81={};return db[_0x2721('0x24')][_0x2721('0x25')]()[_0x2721('0x26')](function(_0x42b7e7){if(!_0x42b7e7){throw new db[(_0x2721('0x27'))][(_0x2721('0x28'))](_0x2721('0x29'));}_0x52f49c=_[_0x2721('0x2a')](_[_0x2721('0x2b')](_0x42b7e7),[_0x2721('0x2c'),_0x2721('0x2d')]);_0x478160=_[_0x2721('0x2a')](_[_0x2721('0x2b')](_0x42b7e7),[_0x2721('0x2c'),_0x2721('0x2d'),'CompanyId','ListId']);if(_0x3bfb34['body']['id']){delete _0x3bfb34[_0x2721('0x22')]['id'];}if(_[_0x2721('0x2e')](_0x3bfb34['body'][_0x2721('0x2f')])){throw new db[(_0x2721('0x27'))][(_0x2721('0x28'))](_0x2721('0x30'));}if(_[_0x2721('0x2e')](_0x3bfb34[_0x2721('0x22')][_0x2721('0x22')])||_0x3bfb34[_0x2721('0x22')][_0x2721('0x22')]===''){throw new db[(_0x2721('0x27'))][(_0x2721('0x28'))](_0x2721('0x31'));}if(_[_0x2721('0x2e')](_0x3bfb34[_0x2721('0x22')][_0x2721('0x32')])){throw new db['Sequelize'][(_0x2721('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x478160);}if(!_['includes'](_0x478160,_0x3bfb34['body'][_0x2721('0x32')])){throw new db[(_0x2721('0x27'))][(_0x2721('0x28'))](_0x2721('0x33')+_0x478160);}_0x2bca81[_0x3bfb34[_0x2721('0x22')][_0x2721('0x32')]]=_0x3bfb34['body'][_0x2721('0x2f')];})[_0x2721('0x26')](function(){return db[_0x2721('0x34')][_0x2721('0x35')]({'where':{'id':_0x3bfb34[_0x2721('0x36')]['id']},'include':[{'model':db[_0x2721('0x37')],'as':_0x2721('0x38'),'include':[{'model':db[_0x2721('0x24')],'as':'Contacts','where':_0x2bca81,'limit':0x1,'order':[['updatedAt',_0x2721('0x39')]]}]},{'model':db[_0x2721('0x3a')],'as':_0x2721('0x3b')}]});})[_0x2721('0x26')](function(_0x57c8ba){if(_0x57c8ba&&_0x57c8ba[_0x2721('0x38')]){var _0x174c39=_0x57c8ba[_0x2721('0x3c')]({'plain':!![]});_0x58f112['account']=_0x174c39;_0x58f112[_0x2721('0x3d')]=_0x174c39['Applications'];_0x58f112[_0x2721('0x3e')]=_0x174c39[_0x2721('0x38')];_0x58f112['applications']=_[_0x2721('0x3f')](_0x58f112[_0x2721('0x3d')],[_0x2721('0x40')],[_0x2721('0x41')]);if(_0x58f112['account'][_0x2721('0x3b')]){delete _0x58f112['account'][_0x2721('0x3b')];}if(_0x58f112[_0x2721('0x36')][_0x2721('0x38')]&&_0x58f112['account'][_0x2721('0x38')][_0x2721('0x42')][_0x2721('0x43')]){return _0x58f112[_0x2721('0x36')][_0x2721('0x38')]['Contacts'][0x0];}var _0x4814d6=_[_0x2721('0xb')](_0x3bfb34['body'],{'firstName':_0x3bfb34[_0x2721('0x22')][_0x2721('0x2f')],'ListId':_0x174c39['ListId']});_0x4814d6[_0x3bfb34[_0x2721('0x22')][_0x2721('0x32')]]=_0x3bfb34[_0x2721('0x22')][_0x2721('0x2f')];return db[_0x2721('0x24')][_0x2721('0x44')](_0x4814d6,{'fields':_0x52f49c,'raw':!![]});}})[_0x2721('0x26')](function(_0x386502){_0x58f112[_0x2721('0x45')]=_0x386502;if(_0x386502){var _0x507c96={'ContactId':_0x386502['id'],'FaxAccountId':_0x3bfb34['account']['id'],'fax':_0x386502[_0x2721('0x23')]};return db['FaxInteraction'][_0x2721('0x35')]({'where':{'ContactId':_0x386502['id'],'closed':![],'FaxAccountId':_0x3bfb34['account']['id']}})[_0x2721('0x26')](function(_0x28f083){if(_0x28f083){return[_0x28f083,![]];}return db[_0x2721('0x46')][_0x2721('0x44')](_0x507c96)[_0x2721('0x26')](function(_0x5dd8c7){return[_0x5dd8c7,!![]];});});}else{throw new Error(_0x2721('0x47'));}})[_0x2721('0x48')](function(_0x2d01f1,_0x26c13b){var _0x26a69e=_0x2d01f1['get']({'plain':!![]});if(_0x26c13b){if(_0x58f112['account'][_0x2721('0x49')]){_0x58f112[_0x2721('0x3d')][_0x2721('0x4a')]({'id':0x0,'priority':_0x58f112[_0x2721('0x3d')][_0x2721('0x43')]+0x1,'app':_0x2721('0x4b'),'appdata':_0x2721('0x4c'),'interval':'*,*,*,*'});}_0x26a69e['created']=!![];}else{_0x26a69e[_0x2721('0x4d')]=![];}_0x58f112[_0x2721('0x4e')]=_0x26a69e;return db[_0x2721('0x4f')][_0x2721('0x44')]({'body':_0x3bfb34[_0x2721('0x22')]['body'],'FaxAccountId':_0x3bfb34[_0x2721('0x36')]['id'],'FaxInteractionId':_0x2d01f1['id'],'direction':'in','ContactId':_0x2d01f1[_0x2721('0x50')],'AttachmentId':_0x3bfb34['body'][_0x2721('0x51')]});})[_0x2721('0x26')](function(_0x189382){_0x58f112['message']=_0x189382;if(_0x58f112[_0x2721('0x4e')][_0x2721('0x52')]){return db[_0x2721('0x53')][_0x2721('0x35')]({'attributes':['id',_0x2721('0x54')],'where':{'id':_0x58f112['interaction'][_0x2721('0x52')]}})[_0x2721('0x26')](function(_0x4c8cca){if(_0x4c8cca){_0x58f112[_0x2721('0x3d')][_0x2721('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c8cca['name']+','+(_0x58f112[_0x2721('0x36')][_0x2721('0x56')]||0xa),'interval':_0x2721('0x57')});}return respondWithRpcPromise(_0x2721('0x58'),_0x2721('0x59'),_0x58f112);});}return respondWithRpcPromise(_0x2721('0x58'),_0x2721('0x59'),_0x58f112);})['then'](function(_0x5698da){_0xc388f0(_0x5698da);})[_0x2721('0x5a')](function(_0x2c43d1){_0x3c22f2(_0x118c7f[_0x2721('0x14')](0x1f4,_0x2c43d1[_0x2721('0x16')]));});});}; \ No newline at end of file +var _0xa9e5=['UserId','User','unshift','agent','name','*,*,*,*','startRouting','Start','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','map','include','model','then','NotifyFaxAccount','body','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','List','CmContact','FaxApplication','applications','Applications','list','orderBy','priority','asc','Contacts','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','length','close','unmanaged','interaction','FaxMessage','ContactId'];(function(_0x3c895f,_0x508bfb){var _0x1525ff=function(_0x2326db){while(--_0x2326db){_0x3c895f['push'](_0x3c895f['shift']());}};_0x1525ff(++_0x508bfb);}(_0xa9e5,0x1c5));var _0x5a9e=function(_0x45a7fd,_0xcbe739){_0x45a7fd=_0x45a7fd-0x0;var _0xb50ccb=_0xa9e5[_0x45a7fd];return _0xb50ccb;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var moment=require(_0x5a9e('0x2'));var BPromise=require(_0x5a9e('0x3'));var rs=require(_0x5a9e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a9e('0x5'));var logger=require('../../config/logger')(_0x5a9e('0x6'));var config=require('../../config/environment');var jayson=require(_0x5a9e('0x7'));var client=jayson['client'][_0x5a9e('0x8')]({'port':0x232c});config[_0x5a9e('0x9')]=_[_0x5a9e('0xa')](config[_0x5a9e('0x9')],{'host':_0x5a9e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5a9e('0xc'))[_0x5a9e('0xd')](socket);function respondWithRpcPromise(_0xeef2b1,_0x16f7f7,_0x262800){return new BPromise(function(_0x177dfd,_0x4623e8){return client[_0x5a9e('0xe')](_0xeef2b1,_0x262800)['then'](function(_0x17b8fb){logger[_0x5a9e('0xf')](_0x5a9e('0x10'),_0x16f7f7,'request\x20sent');logger[_0x5a9e('0x11')](_0x5a9e('0x12'),_0x16f7f7,_0x5a9e('0x13'),JSON[_0x5a9e('0x14')](_0x17b8fb));if(_0x17b8fb['error']){if(_0x17b8fb[_0x5a9e('0x15')][_0x5a9e('0x16')]===0x1f4){logger['error'](_0x5a9e('0x10'),_0x16f7f7,_0x17b8fb['error'][_0x5a9e('0x17')]);return _0x4623e8(_0x17b8fb['error']['message']);}logger[_0x5a9e('0x15')]('FaxAccount,\x20%s,\x20%s',_0x16f7f7,_0x17b8fb[_0x5a9e('0x15')][_0x5a9e('0x17')]);return _0x177dfd(_0x17b8fb['error'][_0x5a9e('0x17')]);}else{logger[_0x5a9e('0xf')](_0x5a9e('0x10'),_0x16f7f7,_0x5a9e('0x13'));_0x177dfd(_0x17b8fb[_0x5a9e('0x18')][_0x5a9e('0x17')]);}})[_0x5a9e('0x19')](function(_0x5b8dd1){logger[_0x5a9e('0x15')]('FaxAccount,\x20%s,\x20%s',_0x16f7f7,_0x5b8dd1);_0x4623e8(_0x5b8dd1);});});}exports[_0x5a9e('0x1a')]=function(_0x1a90a5){var _0x368cb0=this;return new Promise(function(_0x5ae8e7,_0x232542){return db[_0x5a9e('0x1b')][_0x5a9e('0x1c')]({'raw':_0x1a90a5[_0x5a9e('0x1d')]?_0x1a90a5['options'][_0x5a9e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a90a5[_0x5a9e('0x1d')]?_0x1a90a5[_0x5a9e('0x1d')]['where']||null:null,'attributes':_0x1a90a5['options']?_0x1a90a5[_0x5a9e('0x1d')][_0x5a9e('0x1f')]||null:null,'limit':_0x1a90a5['options']?_0x1a90a5[_0x5a9e('0x1d')]['limit']||null:null,'include':_0x1a90a5['options']?_0x1a90a5[_0x5a9e('0x1d')]['include']?_[_0x5a9e('0x20')](_0x1a90a5[_0x5a9e('0x1d')][_0x5a9e('0x21')],function(_0x34033f){return{'model':db[_0x34033f[_0x5a9e('0x22')]],'as':_0x34033f['as'],'attributes':_0x34033f[_0x5a9e('0x1f')],'include':_0x34033f[_0x5a9e('0x21')]?_['map'](_0x34033f[_0x5a9e('0x21')],function(_0x315b30){return{'model':db[_0x315b30[_0x5a9e('0x22')]],'as':_0x315b30['as'],'attributes':_0x315b30[_0x5a9e('0x1f')],'include':_0x315b30[_0x5a9e('0x21')]?_['map'](_0x315b30['include'],function(_0x34450a){return{'model':db[_0x34450a['model']],'as':_0x34450a['as'],'attributes':_0x34450a[_0x5a9e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5a9e('0x23')](function(_0x40b6ea){logger['info'](_0x5a9e('0x1a'),_0x1a90a5);logger[_0x5a9e('0x11')]('GetFaxAccount',_0x1a90a5,JSON[_0x5a9e('0x14')](_0x40b6ea));_0x5ae8e7(_0x40b6ea);})[_0x5a9e('0x19')](function(_0x26d0df){logger[_0x5a9e('0x15')]('GetFaxAccount',_0x26d0df[_0x5a9e('0x17')],_0x1a90a5);_0x232542(_0x368cb0[_0x5a9e('0x15')](0x1f4,_0x26d0df[_0x5a9e('0x17')]));});});};exports[_0x5a9e('0x24')]=function(_0x41909c,_0x144c6b,_0x51297b){var _0x30c8ed=this;return new Promise(function(_0x46b633,_0x3e53f3){var _0x343827={'body':_0x41909c[_0x5a9e('0x25')],'channel':'fax'};var _0x3e528b=[];var _0x37faca=[];var _0x40b7d5={};return db['CmContact']['describe']()[_0x5a9e('0x23')](function(_0x38830b){if(!_0x38830b){throw new db[(_0x5a9e('0x26'))]['ValidationError'](_0x5a9e('0x27'));}_0x3e528b=_[_0x5a9e('0x28')](_[_0x5a9e('0x29')](_0x38830b),[_0x5a9e('0x2a'),_0x5a9e('0x2b')]);_0x37faca=_['difference'](_['keys'](_0x38830b),[_0x5a9e('0x2a'),_0x5a9e('0x2b'),'CompanyId',_0x5a9e('0x2c')]);if(_0x41909c[_0x5a9e('0x25')]['id']){delete _0x41909c[_0x5a9e('0x25')]['id'];}if(_[_0x5a9e('0x2d')](_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x2e')])){throw new db['Sequelize']['ValidationError'](_0x5a9e('0x2f'));}if(_[_0x5a9e('0x2d')](_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x25')])||_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x25')]===''){throw new db['Sequelize']['ValidationError'](_0x5a9e('0x30'));}if(_[_0x5a9e('0x2d')](_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x31')])){throw new db[(_0x5a9e('0x26'))][(_0x5a9e('0x32'))](_0x5a9e('0x33')+_0x37faca);}if(!_[_0x5a9e('0x34')](_0x37faca,_0x41909c[_0x5a9e('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x5a9e('0x32'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x37faca);}_0x40b7d5[_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x31')]]=_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x2e')];})[_0x5a9e('0x23')](function(){return db[_0x5a9e('0x1b')][_0x5a9e('0x35')]({'where':{'id':_0x41909c[_0x5a9e('0x36')]['id']},'include':[{'model':db[_0x5a9e('0x37')],'as':_0x5a9e('0x38'),'include':[{'model':db[_0x5a9e('0x39')],'as':'Contacts','where':_0x40b7d5,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5a9e('0x3a')],'as':'Applications'}]});})[_0x5a9e('0x23')](function(_0x40f1e6){if(_0x40f1e6&&_0x40f1e6[_0x5a9e('0x38')]){var _0x647646=_0x40f1e6['get']({'plain':!![]});_0x343827['account']=_0x647646;_0x343827[_0x5a9e('0x3b')]=_0x647646[_0x5a9e('0x3c')];_0x343827[_0x5a9e('0x3d')]=_0x647646[_0x5a9e('0x38')];_0x343827[_0x5a9e('0x3b')]=_[_0x5a9e('0x3e')](_0x343827[_0x5a9e('0x3b')],[_0x5a9e('0x3f')],[_0x5a9e('0x40')]);if(_0x343827[_0x5a9e('0x36')][_0x5a9e('0x3c')]){delete _0x343827[_0x5a9e('0x36')][_0x5a9e('0x3c')];}if(_0x343827['account']['List']&&_0x343827[_0x5a9e('0x36')]['List'][_0x5a9e('0x41')]['length']){return _0x343827[_0x5a9e('0x36')][_0x5a9e('0x38')]['Contacts'][0x0];}var _0x5626b3=_['defaults'](_0x41909c[_0x5a9e('0x25')],{'firstName':_0x41909c[_0x5a9e('0x25')]['from'],'ListId':_0x647646['ListId']});_0x5626b3[_0x41909c[_0x5a9e('0x25')]['mapKey']]=_0x41909c['body'][_0x5a9e('0x2e')];return db['CmContact'][_0x5a9e('0x42')](_0x5626b3,{'fields':_0x3e528b,'raw':!![]});}})['then'](function(_0x3ace96){_0x343827[_0x5a9e('0x43')]=_0x3ace96;if(_0x3ace96){var _0x30376c={'ContactId':_0x3ace96['id'],'FaxAccountId':_0x41909c[_0x5a9e('0x36')]['id'],'fax':_0x3ace96[_0x5a9e('0x44')]};return db[_0x5a9e('0x45')][_0x5a9e('0x35')]({'where':{'ContactId':_0x3ace96['id'],'closed':![],'FaxAccountId':_0x41909c[_0x5a9e('0x36')]['id']}})['then'](function(_0xc35734){if(_0xc35734){return[_0xc35734,![]];}return db[_0x5a9e('0x45')][_0x5a9e('0x42')](_0x30376c)[_0x5a9e('0x23')](function(_0x43f9ac){return[_0x43f9ac,!![]];});});}else{throw new Error(_0x5a9e('0x46'));}})[_0x5a9e('0x47')](function(_0x5f3b51,_0x4a3ec1){var _0x5a0244=_0x5f3b51[_0x5a9e('0x48')]({'plain':!![]});if(_0x4a3ec1){if(_0x343827[_0x5a9e('0x36')][_0x5a9e('0x49')]){_0x343827[_0x5a9e('0x3b')][_0x5a9e('0x4a')]({'id':0x0,'priority':_0x343827[_0x5a9e('0x3b')][_0x5a9e('0x4b')]+0x1,'app':_0x5a9e('0x4c'),'appdata':_0x5a9e('0x4d'),'interval':'*,*,*,*'});}_0x5a0244['created']=!![];}else{_0x5a0244['created']=![];}_0x343827[_0x5a9e('0x4e')]=_0x5a0244;return db[_0x5a9e('0x4f')][_0x5a9e('0x42')]({'body':_0x41909c[_0x5a9e('0x25')][_0x5a9e('0x25')],'FaxAccountId':_0x41909c[_0x5a9e('0x36')]['id'],'FaxInteractionId':_0x5f3b51['id'],'direction':'in','ContactId':_0x5f3b51[_0x5a9e('0x50')],'AttachmentId':_0x41909c[_0x5a9e('0x25')]['AttachmentId']});})[_0x5a9e('0x23')](function(_0x4380a5){_0x343827[_0x5a9e('0x17')]=_0x4380a5;if(_0x343827['interaction'][_0x5a9e('0x51')]){return db[_0x5a9e('0x52')][_0x5a9e('0x35')]({'attributes':['id','name'],'where':{'id':_0x343827[_0x5a9e('0x4e')][_0x5a9e('0x51')]}})[_0x5a9e('0x23')](function(_0x573ce6){if(_0x573ce6){_0x343827[_0x5a9e('0x3b')][_0x5a9e('0x53')]({'id':0x0,'priority':0x0,'app':_0x5a9e('0x54'),'appdata':_0x573ce6[_0x5a9e('0x55')]+','+(_0x343827[_0x5a9e('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x5a9e('0x56')});}return respondWithRpcPromise('Start',_0x5a9e('0x57'),_0x343827);});}return respondWithRpcPromise(_0x5a9e('0x58'),_0x5a9e('0x57'),_0x343827);})[_0x5a9e('0x23')](function(_0x4aa138){_0x46b633(_0x4aa138);})[_0x5a9e('0x19')](function(_0x369b38){_0x3e53f3(_0x30c8ed[_0x5a9e('0x15')](0x1f4,_0x369b38['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f338567..dfa8539 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf512=['update','emit','removeListener','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x30889f,_0x4d857a){var _0x55d466=function(_0xbeb4f3){while(--_0xbeb4f3){_0x30889f['push'](_0x30889f['shift']());}};_0x55d466(++_0x4d857a);}(_0xf512,0x165));var _0x2f51=function(_0x475080,_0x378fe2){_0x475080=_0x475080-0x0;var _0x2eb128=_0xf512[_0x475080];return _0x2eb128;};'use strict';var FaxAccountEvents=require(_0x2f51('0x0'));var events=[_0x2f51('0x1'),_0x2f51('0x2'),_0x2f51('0x3')];function createListener(_0x1720ee,_0x4ca67a){return function(_0x1f476a){_0x4ca67a[_0x2f51('0x4')](_0x1720ee,_0x1f476a);};}function removeListener(_0x4d0588,_0x455621){return function(){FaxAccountEvents[_0x2f51('0x5')](_0x4d0588,_0x455621);};}exports['register']=function(_0x22d792){for(var _0x1da1a5=0x0,_0xf5b439=events[_0x2f51('0x6')];_0x1da1a5<_0xf5b439;_0x1da1a5++){var _0x3f4dfc=events[_0x1da1a5];var _0x3489e7=createListener(_0x2f51('0x7')+_0x3f4dfc,_0x22d792);FaxAccountEvents['on'](_0x3f4dfc,_0x3489e7);}}; \ No newline at end of file +var _0x3ccf=['emit','removeListener','register','length','save','remove','update'];(function(_0x40a85a,_0x5393c8){var _0x4c1213=function(_0x540e3c){while(--_0x540e3c){_0x40a85a['push'](_0x40a85a['shift']());}};_0x4c1213(++_0x5393c8);}(_0x3ccf,0x1e7));var _0xf3cc=function(_0x2fe7d6,_0x25ac80){_0x2fe7d6=_0x2fe7d6-0x0;var _0x191db1=_0x3ccf[_0x2fe7d6];return _0x191db1;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf3cc('0x0'),_0xf3cc('0x1'),_0xf3cc('0x2')];function createListener(_0x1274cc,_0x448377){return function(_0xd1b99d){_0x448377[_0xf3cc('0x3')](_0x1274cc,_0xd1b99d);};}function removeListener(_0x4f686c,_0x288387){return function(){FaxAccountEvents[_0xf3cc('0x4')](_0x4f686c,_0x288387);};}exports[_0xf3cc('0x5')]=function(_0x187745){for(var _0x585e55=0x0,_0xaaa586=events[_0xf3cc('0x6')];_0x585e55<_0xaaa586;_0x585e55++){var _0x1c8e69=events[_0x585e55];var _0x3fa9d7=createListener('faxAccount:'+_0x1c8e69,_0x187745);FaxAccountEvents['on'](_0x1c8e69,_0x3fa9d7);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 99c1705..f22144d 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x374ba3,_0x4af646){var _0x51d852=function(_0x131009){while(--_0x131009){_0x374ba3['push'](_0x374ba3['shift']());}};_0x51d852(++_0x4af646);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5d743a,_0x386cc3){var _0x2f0fec=function(_0x48b71e){while(--_0x48b71e){_0x5d743a['push'](_0x5d743a['shift']());}};_0x2f0fec(++_0x386cc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 656ba2d..33f1b79 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a0e=['INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x25e19b,_0x5135cf){var _0x1055cf=function(_0x3ab6f1){while(--_0x3ab6f1){_0x25e19b['push'](_0x25e19b['shift']());}};_0x1055cf(++_0x5135cf);}(_0x5a0e,0x11c));var _0xe5a0=function(_0x2f1171,_0x128d87){_0x2f1171=_0x2f1171-0x0;var _0x561e07=_0x5a0e[_0x2f1171];return _0x561e07;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xe5a0('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe5a0('0x1')]()},'description':{'type':Sequelize[_0xe5a0('0x2')]},'interval':{'type':Sequelize[_0xe5a0('0x2')],'defaultValue':_0xe5a0('0x3')}}; \ No newline at end of file +var _0xe3fb=['TEXT','STRING','sequelize','exports','INTEGER','noop'];(function(_0x452d31,_0x2aebd5){var _0x5c2a19=function(_0x15b3f8){while(--_0x15b3f8){_0x452d31['push'](_0x452d31['shift']());}};_0x5c2a19(++_0x2aebd5);}(_0xe3fb,0x6e));var _0xbe3f=function(_0x3a6c22,_0x25539e){_0x3a6c22=_0x3a6c22-0x0;var _0x61930a=_0xe3fb[_0x3a6c22];return _0x61930a;};'use strict';var Sequelize=require(_0xbe3f('0x0'));module[_0xbe3f('0x1')]={'priority':{'type':Sequelize[_0xbe3f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe3f('0x3')},'appdata':{'type':Sequelize[_0xbe3f('0x4')]()},'description':{'type':Sequelize[_0xbe3f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 24ba313..3275922 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34f4=['offset','order','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','apply','save','update','then','destroy','name','index','map','FaxApplication','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x34f4,0x1af));var _0x434f=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x34f4[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x434f('0x0'));var rimraf=require(_0x434f('0x1'));var zipdir=require(_0x434f('0x2'));var jsonpatch=require(_0x434f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x434f('0x4'));var Mustache=require(_0x434f('0x5'));var util=require(_0x434f('0x6'));var path=require('path');var sox=require(_0x434f('0x7'));var csv=require(_0x434f('0x8'));var ejs=require(_0x434f('0x9'));var fs=require('fs');var fs_extra=require(_0x434f('0xa'));var _=require(_0x434f('0xb'));var squel=require(_0x434f('0xc'));var crypto=require(_0x434f('0xd'));var jsforce=require(_0x434f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x434f('0x8'));var querystring=require('querystring');var Papa=require(_0x434f('0xf'));var Redis=require(_0x434f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x434f('0x11'));var as=require(_0x434f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x434f('0x13'))(_0x434f('0x14'));var utils=require(_0x434f('0x15'));var config=require(_0x434f('0x16'));var licenseUtil=require(_0x434f('0x17'));var db=require(_0x434f('0x18'))['db'];function respondWithStatusCode(_0x24c5b0,_0x3a0dcb){_0x3a0dcb=_0x3a0dcb||0xcc;return function(_0x556c89){if(_0x556c89){return _0x24c5b0[_0x434f('0x19')](_0x3a0dcb);}return _0x24c5b0[_0x434f('0x1a')](_0x3a0dcb)[_0x434f('0x1b')]();};}function respondWithResult(_0x4393b1,_0x456be5){_0x456be5=_0x456be5||0xc8;return function(_0x237d26){if(_0x237d26){return _0x4393b1[_0x434f('0x1a')](_0x456be5)[_0x434f('0x1c')](_0x237d26);}};}function respondWithFilteredResult(_0xbc2adf,_0x1d835a){return function(_0x477ac8){if(_0x477ac8){var _0x32f09b=typeof _0x1d835a['offset']==='undefined'&&typeof _0x1d835a['limit']===_0x434f('0x1d');var _0x21bc9f=_0x477ac8[_0x434f('0x1e')];var _0x1e2eb9=_0x32f09b?0x0:_0x1d835a['offset'];var _0x26c5c0=_0x32f09b?_0x477ac8[_0x434f('0x1e')]:_0x1d835a['offset']+_0x1d835a['limit'];var _0x28e390;if(_0x26c5c0>=_0x21bc9f){_0x26c5c0=_0x21bc9f;_0x28e390=0xc8;}else{_0x28e390=0xce;}_0xbc2adf[_0x434f('0x1a')](_0x28e390);return _0xbc2adf['set']('Content-Range',_0x1e2eb9+'-'+_0x26c5c0+'/'+_0x21bc9f)['json'](_0x477ac8);}return null;};}function patchUpdates(_0x540591){return function(_0x5adb04){try{jsonpatch[_0x434f('0x1f')](_0x5adb04,_0x540591,!![]);}catch(_0x33168d){return BPromise['reject'](_0x33168d);}return _0x5adb04[_0x434f('0x20')]();};}function saveUpdates(_0xf37c8d,_0x816e3d){return function(_0x2d4da1){if(_0x2d4da1){return _0x2d4da1[_0x434f('0x21')](_0xf37c8d)[_0x434f('0x22')](function(_0x507859){return _0x507859;});}return null;};}function removeEntity(_0x28d735,_0x3c053c){return function(_0x3e205b){if(_0x3e205b){return _0x3e205b[_0x434f('0x23')]()[_0x434f('0x22')](function(){_0x28d735['status'](0xcc)[_0x434f('0x1b')]();});}};}function handleEntityNotFound(_0x38c214,_0x208edc){return function(_0x2bafcc){if(!_0x2bafcc){_0x38c214[_0x434f('0x19')](0x194);}return _0x2bafcc;};}function handleError(_0x3ecfd1,_0x2037f6){_0x2037f6=_0x2037f6||0x1f4;return function(_0x5ea383){logger['error'](_0x5ea383['stack']);if(_0x5ea383[_0x434f('0x24')]){delete _0x5ea383[_0x434f('0x24')];}_0x3ecfd1[_0x434f('0x1a')](_0x2037f6)['send'](_0x5ea383);};}exports[_0x434f('0x25')]=function(_0x7dba45,_0x399507){var _0xdcb2a3={},_0x52340e={},_0x45fdac={'count':0x0,'rows':[]};var _0x23f2e4=_[_0x434f('0x26')](db[_0x434f('0x27')][_0x434f('0x28')],function(_0x57004c){return{'name':_0x57004c[_0x434f('0x29')],'type':_0x57004c['type'][_0x434f('0x2a')]};});_0x52340e[_0x434f('0x2b')]=_[_0x434f('0x26')](_0x23f2e4,_0x434f('0x24'));_0x52340e[_0x434f('0x2c')]=_['keys'](_0x7dba45[_0x434f('0x2c')]);_0x52340e[_0x434f('0x2d')]=_[_0x434f('0x2e')](_0x52340e['model'],_0x52340e['query']);_0xdcb2a3[_0x434f('0x2f')]=_['intersection'](_0x52340e[_0x434f('0x2b')],qs[_0x434f('0x30')](_0x7dba45[_0x434f('0x2c')][_0x434f('0x30')]));_0xdcb2a3['attributes']=_0xdcb2a3[_0x434f('0x2f')][_0x434f('0x31')]?_0xdcb2a3[_0x434f('0x2f')]:_0x52340e['model'];if(!_0x7dba45[_0x434f('0x2c')][_0x434f('0x32')]('nolimit')){_0xdcb2a3[_0x434f('0x33')]=qs[_0x434f('0x33')](_0x7dba45['query'][_0x434f('0x33')]);_0xdcb2a3[_0x434f('0x34')]=qs[_0x434f('0x34')](_0x7dba45[_0x434f('0x2c')]['offset']);}_0xdcb2a3[_0x434f('0x35')]=qs[_0x434f('0x36')](_0x7dba45[_0x434f('0x2c')][_0x434f('0x36')]);_0xdcb2a3[_0x434f('0x37')]=qs[_0x434f('0x2d')](_[_0x434f('0x38')](_0x7dba45[_0x434f('0x2c')],_0x52340e[_0x434f('0x2d')]),_0x23f2e4);if(_0x7dba45['query'][_0x434f('0x39')]){_0xdcb2a3[_0x434f('0x37')]=_[_0x434f('0x3a')](_0xdcb2a3['where'],{'$or':_[_0x434f('0x26')](_0x23f2e4,function(_0x450b15){if(_0x450b15['type']!=='VIRTUAL'){var _0x760c8b={};_0x760c8b[_0x450b15[_0x434f('0x24')]]={'$like':'%'+_0x7dba45[_0x434f('0x2c')][_0x434f('0x39')]+'%'};return _0x760c8b;}})});}_0xdcb2a3=_[_0x434f('0x3a')]({},_0xdcb2a3,_0x7dba45[_0x434f('0x3b')]);var _0x4177d9={'where':_0xdcb2a3['where']};return db[_0x434f('0x27')]['count'](_0x4177d9)['then'](function(_0x4152b5){_0x45fdac[_0x434f('0x1e')]=_0x4152b5;if(_0x7dba45[_0x434f('0x2c')][_0x434f('0x3c')]){_0xdcb2a3['include']=[{'all':!![]}];}return db[_0x434f('0x27')]['findAll'](_0xdcb2a3);})[_0x434f('0x22')](function(_0x116efc){_0x45fdac['rows']=_0x116efc;return _0x45fdac;})[_0x434f('0x22')](respondWithFilteredResult(_0x399507,_0xdcb2a3))[_0x434f('0x3d')](handleError(_0x399507,null));};exports[_0x434f('0x3e')]=function(_0x2c173d,_0x5252bd){var _0x6c57c7={'raw':!![],'where':{'id':_0x2c173d[_0x434f('0x3f')]['id']}},_0x4d1fe9={};_0x4d1fe9['model']=_[_0x434f('0x40')](db[_0x434f('0x27')][_0x434f('0x28')]);_0x4d1fe9['query']=_[_0x434f('0x40')](_0x2c173d[_0x434f('0x2c')]);_0x4d1fe9['filters']=_['intersection'](_0x4d1fe9[_0x434f('0x2b')],_0x4d1fe9['query']);_0x6c57c7['attributes']=_[_0x434f('0x2e')](_0x4d1fe9[_0x434f('0x2b')],qs['fields'](_0x2c173d['query'][_0x434f('0x30')]));_0x6c57c7[_0x434f('0x2f')]=_0x6c57c7['attributes']['length']?_0x6c57c7[_0x434f('0x2f')]:_0x4d1fe9['model'];if(_0x2c173d[_0x434f('0x2c')][_0x434f('0x3c')]){_0x6c57c7[_0x434f('0x41')]=[{'all':!![]}];}_0x6c57c7=_[_0x434f('0x3a')]({},_0x6c57c7,_0x2c173d['options']);return db['FaxApplication']['find'](_0x6c57c7)[_0x434f('0x22')](handleEntityNotFound(_0x5252bd,null))[_0x434f('0x22')](respondWithResult(_0x5252bd,null))[_0x434f('0x3d')](handleError(_0x5252bd,null));};exports[_0x434f('0x42')]=function(_0x525616,_0x467df4){return db[_0x434f('0x27')][_0x434f('0x42')](_0x525616[_0x434f('0x43')],{})[_0x434f('0x22')](respondWithResult(_0x467df4,0xc9))[_0x434f('0x3d')](handleError(_0x467df4,null));};exports[_0x434f('0x21')]=function(_0x3c6cc9,_0x2cb801){if(_0x3c6cc9['body']['id']){delete _0x3c6cc9[_0x434f('0x43')]['id'];}return db[_0x434f('0x27')][_0x434f('0x44')]({'where':{'id':_0x3c6cc9[_0x434f('0x3f')]['id']}})[_0x434f('0x22')](handleEntityNotFound(_0x2cb801,null))[_0x434f('0x22')](saveUpdates(_0x3c6cc9['body'],null))[_0x434f('0x22')](respondWithResult(_0x2cb801,null))[_0x434f('0x3d')](handleError(_0x2cb801,null));};exports['destroy']=function(_0x439a6c,_0x829391){return db[_0x434f('0x27')][_0x434f('0x44')]({'where':{'id':_0x439a6c[_0x434f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x829391,null))[_0x434f('0x22')](removeEntity(_0x829391,null))[_0x434f('0x3d')](handleError(_0x829391,null));}; \ No newline at end of file +var _0x6e87=['apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','type','merge','options','FaxApplication','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x594552,_0x36b7c4){var _0x51d788=function(_0x2825d6){while(--_0x2825d6){_0x594552['push'](_0x594552['shift']());}};_0x51d788(++_0x36b7c4);}(_0x6e87,0x15b));var _0x76e8=function(_0x493e52,_0xea02e6){_0x493e52=_0x493e52-0x0;var _0x111175=_0x6e87[_0x493e52];return _0x111175;};'use strict';var emlformat=require(_0x76e8('0x0'));var rimraf=require(_0x76e8('0x1'));var zipdir=require(_0x76e8('0x2'));var jsonpatch=require(_0x76e8('0x3'));var rp=require(_0x76e8('0x4'));var moment=require(_0x76e8('0x5'));var BPromise=require(_0x76e8('0x6'));var Mustache=require('mustache');var util=require(_0x76e8('0x7'));var path=require(_0x76e8('0x8'));var sox=require(_0x76e8('0x9'));var csv=require(_0x76e8('0xa'));var ejs=require(_0x76e8('0xb'));var fs=require('fs');var fs_extra=require(_0x76e8('0xc'));var _=require('lodash');var squel=require(_0x76e8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x76e8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x76e8('0xf'));var Papa=require(_0x76e8('0x10'));var Redis=require(_0x76e8('0x11'));var authService=require(_0x76e8('0x12'));var qs=require(_0x76e8('0x13'));var as=require(_0x76e8('0x14'));var hardwareService=require(_0x76e8('0x15'));var logger=require(_0x76e8('0x16'))(_0x76e8('0x17'));var utils=require(_0x76e8('0x18'));var config=require(_0x76e8('0x19'));var licenseUtil=require(_0x76e8('0x1a'));var db=require(_0x76e8('0x1b'))['db'];function respondWithStatusCode(_0xa749fa,_0x24ad5d){_0x24ad5d=_0x24ad5d||0xcc;return function(_0xffb093){if(_0xffb093){return _0xa749fa[_0x76e8('0x1c')](_0x24ad5d);}return _0xa749fa['status'](_0x24ad5d)[_0x76e8('0x1d')]();};}function respondWithResult(_0x4edec1,_0x1de6f6){_0x1de6f6=_0x1de6f6||0xc8;return function(_0x4ff9f3){if(_0x4ff9f3){return _0x4edec1[_0x76e8('0x1e')](_0x1de6f6)[_0x76e8('0x1f')](_0x4ff9f3);}};}function respondWithFilteredResult(_0x35bb88,_0x35dc5b){return function(_0x134e8f){if(_0x134e8f){var _0x6611dc=typeof _0x35dc5b['offset']===_0x76e8('0x20')&&typeof _0x35dc5b[_0x76e8('0x21')]===_0x76e8('0x20');var _0x30084e=_0x134e8f[_0x76e8('0x22')];var _0x19aa10=_0x6611dc?0x0:_0x35dc5b[_0x76e8('0x23')];var _0xcec31f=_0x6611dc?_0x134e8f[_0x76e8('0x22')]:_0x35dc5b[_0x76e8('0x23')]+_0x35dc5b[_0x76e8('0x21')];var _0x375392;if(_0xcec31f>=_0x30084e){_0xcec31f=_0x30084e;_0x375392=0xc8;}else{_0x375392=0xce;}_0x35bb88['status'](_0x375392);return _0x35bb88[_0x76e8('0x24')](_0x76e8('0x25'),_0x19aa10+'-'+_0xcec31f+'/'+_0x30084e)[_0x76e8('0x1f')](_0x134e8f);}return null;};}function patchUpdates(_0x48105b){return function(_0xf52259){try{jsonpatch[_0x76e8('0x26')](_0xf52259,_0x48105b,!![]);}catch(_0xc65c71){return BPromise['reject'](_0xc65c71);}return _0xf52259['save']();};}function saveUpdates(_0xcfd16b,_0x4a2484){return function(_0x441c32){if(_0x441c32){return _0x441c32[_0x76e8('0x27')](_0xcfd16b)[_0x76e8('0x28')](function(_0x4a3d13){return _0x4a3d13;});}return null;};}function removeEntity(_0x268a86,_0x197543){return function(_0x428321){if(_0x428321){return _0x428321[_0x76e8('0x29')]()['then'](function(){_0x268a86[_0x76e8('0x1e')](0xcc)[_0x76e8('0x1d')]();});}};}function handleEntityNotFound(_0x5ee66a,_0x53042d){return function(_0x1ba538){if(!_0x1ba538){_0x5ee66a[_0x76e8('0x1c')](0x194);}return _0x1ba538;};}function handleError(_0x2ba234,_0x1c3428){_0x1c3428=_0x1c3428||0x1f4;return function(_0x3aaee0){logger[_0x76e8('0x2a')](_0x3aaee0[_0x76e8('0x2b')]);if(_0x3aaee0[_0x76e8('0x2c')]){delete _0x3aaee0[_0x76e8('0x2c')];}_0x2ba234['status'](_0x1c3428)[_0x76e8('0x2d')](_0x3aaee0);};}exports[_0x76e8('0x2e')]=function(_0xd200f2,_0x520ce4){var _0x27d3df={},_0x50616b={},_0x15ef92={'count':0x0,'rows':[]};var _0xf0acf9=_[_0x76e8('0x2f')](db['FaxApplication'][_0x76e8('0x30')],function(_0x573725){return{'name':_0x573725[_0x76e8('0x31')],'type':_0x573725['type']['key']};});_0x50616b[_0x76e8('0x32')]=_[_0x76e8('0x2f')](_0xf0acf9,_0x76e8('0x2c'));_0x50616b[_0x76e8('0x33')]=_[_0x76e8('0x34')](_0xd200f2[_0x76e8('0x33')]);_0x50616b[_0x76e8('0x35')]=_[_0x76e8('0x36')](_0x50616b[_0x76e8('0x32')],_0x50616b[_0x76e8('0x33')]);_0x27d3df[_0x76e8('0x37')]=_['intersection'](_0x50616b[_0x76e8('0x32')],qs['fields'](_0xd200f2[_0x76e8('0x33')]['fields']));_0x27d3df[_0x76e8('0x37')]=_0x27d3df[_0x76e8('0x37')][_0x76e8('0x38')]?_0x27d3df['attributes']:_0x50616b['model'];if(!_0xd200f2['query']['hasOwnProperty']('nolimit')){_0x27d3df[_0x76e8('0x21')]=qs[_0x76e8('0x21')](_0xd200f2[_0x76e8('0x33')][_0x76e8('0x21')]);_0x27d3df[_0x76e8('0x23')]=qs[_0x76e8('0x23')](_0xd200f2[_0x76e8('0x33')][_0x76e8('0x23')]);}_0x27d3df[_0x76e8('0x39')]=qs[_0x76e8('0x3a')](_0xd200f2[_0x76e8('0x33')]['sort']);_0x27d3df[_0x76e8('0x3b')]=qs[_0x76e8('0x35')](_[_0x76e8('0x3c')](_0xd200f2['query'],_0x50616b[_0x76e8('0x35')]),_0xf0acf9);if(_0xd200f2[_0x76e8('0x33')][_0x76e8('0x3d')]){_0x27d3df[_0x76e8('0x3b')]=_['merge'](_0x27d3df[_0x76e8('0x3b')],{'$or':_[_0x76e8('0x2f')](_0xf0acf9,function(_0x1af228){if(_0x1af228[_0x76e8('0x3e')]!=='VIRTUAL'){var _0x87e97b={};_0x87e97b[_0x1af228[_0x76e8('0x2c')]]={'$like':'%'+_0xd200f2[_0x76e8('0x33')][_0x76e8('0x3d')]+'%'};return _0x87e97b;}})});}_0x27d3df=_[_0x76e8('0x3f')]({},_0x27d3df,_0xd200f2[_0x76e8('0x40')]);var _0x43d418={'where':_0x27d3df[_0x76e8('0x3b')]};return db[_0x76e8('0x41')][_0x76e8('0x22')](_0x43d418)['then'](function(_0x5ca0af){_0x15ef92[_0x76e8('0x22')]=_0x5ca0af;if(_0xd200f2[_0x76e8('0x33')][_0x76e8('0x42')]){_0x27d3df[_0x76e8('0x43')]=[{'all':!![]}];}return db[_0x76e8('0x41')][_0x76e8('0x44')](_0x27d3df);})[_0x76e8('0x28')](function(_0xee1857){_0x15ef92[_0x76e8('0x45')]=_0xee1857;return _0x15ef92;})[_0x76e8('0x28')](respondWithFilteredResult(_0x520ce4,_0x27d3df))[_0x76e8('0x46')](handleError(_0x520ce4,null));};exports[_0x76e8('0x47')]=function(_0xc9a89a,_0x425b53){var _0x3bf7c3={'raw':!![],'where':{'id':_0xc9a89a[_0x76e8('0x48')]['id']}},_0x456ab1={};_0x456ab1[_0x76e8('0x32')]=_['keys'](db[_0x76e8('0x41')][_0x76e8('0x30')]);_0x456ab1[_0x76e8('0x33')]=_['keys'](_0xc9a89a['query']);_0x456ab1[_0x76e8('0x35')]=_['intersection'](_0x456ab1[_0x76e8('0x32')],_0x456ab1[_0x76e8('0x33')]);_0x3bf7c3[_0x76e8('0x37')]=_['intersection'](_0x456ab1[_0x76e8('0x32')],qs[_0x76e8('0x49')](_0xc9a89a[_0x76e8('0x33')]['fields']));_0x3bf7c3['attributes']=_0x3bf7c3[_0x76e8('0x37')][_0x76e8('0x38')]?_0x3bf7c3[_0x76e8('0x37')]:_0x456ab1['model'];if(_0xc9a89a[_0x76e8('0x33')][_0x76e8('0x42')]){_0x3bf7c3[_0x76e8('0x43')]=[{'all':!![]}];}_0x3bf7c3=_[_0x76e8('0x3f')]({},_0x3bf7c3,_0xc9a89a[_0x76e8('0x40')]);return db[_0x76e8('0x41')][_0x76e8('0x4a')](_0x3bf7c3)[_0x76e8('0x28')](handleEntityNotFound(_0x425b53,null))['then'](respondWithResult(_0x425b53,null))[_0x76e8('0x46')](handleError(_0x425b53,null));};exports[_0x76e8('0x4b')]=function(_0x2e7dbe,_0x3993c1){return db['FaxApplication'][_0x76e8('0x4b')](_0x2e7dbe['body'],{})[_0x76e8('0x28')](respondWithResult(_0x3993c1,0xc9))['catch'](handleError(_0x3993c1,null));};exports[_0x76e8('0x27')]=function(_0x12abb6,_0x4bdac6){if(_0x12abb6[_0x76e8('0x4c')]['id']){delete _0x12abb6[_0x76e8('0x4c')]['id'];}return db['FaxApplication'][_0x76e8('0x4a')]({'where':{'id':_0x12abb6[_0x76e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bdac6,null))[_0x76e8('0x28')](saveUpdates(_0x12abb6['body'],null))[_0x76e8('0x28')](respondWithResult(_0x4bdac6,null))[_0x76e8('0x46')](handleError(_0x4bdac6,null));};exports['destroy']=function(_0x16d741,_0x192607){return db[_0x76e8('0x41')][_0x76e8('0x4a')]({'where':{'id':_0x16d741['params']['id']}})[_0x76e8('0x28')](handleEntityNotFound(_0x192607,null))[_0x76e8('0x28')](removeEntity(_0x192607,null))[_0x76e8('0x46')](handleError(_0x192607,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 5c56a62..b8037e9 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd23=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2b4b6b,_0x5f0a17){var _0x56dc1e=function(_0x407c62){while(--_0x407c62){_0x2b4b6b['push'](_0x2b4b6b['shift']());}};_0x56dc1e(++_0x5f0a17);}(_0xbd23,0xbf));var _0x3bd2=function(_0x182f4a,_0xb40b93){_0x182f4a=_0x182f4a-0x0;var _0x584933=_0xbd23[_0x182f4a];return _0x584933;};'use strict';var _=require(_0x3bd2('0x0'));var util=require('util');var logger=require(_0x3bd2('0x1'))(_0x3bd2('0x2'));var moment=require(_0x3bd2('0x3'));var BPromise=require(_0x3bd2('0x4'));var rp=require(_0x3bd2('0x5'));var fs=require('fs');var path=require(_0x3bd2('0x6'));var rimraf=require(_0x3bd2('0x7'));var config=require(_0x3bd2('0x8'));var attributes=require(_0x3bd2('0x9'));module['exports']=function(_0x4ddcbb,_0xa60ece){return _0x4ddcbb[_0x3bd2('0xa')](_0x3bd2('0xb'),attributes,{'tableName':_0x3bd2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3bd2('0xd')});}; \ No newline at end of file +var _0x3c81=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxApplication','fax_applications'];(function(_0x3a69b4,_0x44459f){var _0x51da54=function(_0x2b0f91){while(--_0x2b0f91){_0x3a69b4['push'](_0x3a69b4['shift']());}};_0x51da54(++_0x44459f);}(_0x3c81,0xfe));var _0x13c8=function(_0x47cd91,_0x1ff729){_0x47cd91=_0x47cd91-0x0;var _0x54d3d6=_0x3c81[_0x47cd91];return _0x54d3d6;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require(_0x13c8('0x4'));var rp=require(_0x13c8('0x5'));var fs=require('fs');var path=require(_0x13c8('0x6'));var rimraf=require(_0x13c8('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x13c8('0x8')]=function(_0x3b2ca7,_0x369749){return _0x3b2ca7[_0x13c8('0x9')](_0x13c8('0xa'),attributes,{'tableName':_0x13c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13c8('0xc'),'collate':_0x13c8('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 25fd7e8..4e20c9e 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3769=['raw','where','attributes','limit','UpdateFaxApplication','debug','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','FaxApplication','update','body','options'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x3769,0x15c));var _0x9376=function(_0x27abe3,_0x26bac1){_0x27abe3=_0x27abe3-0x0;var _0x1738d9=_0x3769[_0x27abe3];return _0x1738d9;};'use strict';var _=require(_0x9376('0x0'));var util=require('util');var moment=require(_0x9376('0x1'));var BPromise=require(_0x9376('0x2'));var rs=require(_0x9376('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9376('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9376('0x5'))(_0x9376('0x6'));var config=require(_0x9376('0x7'));var jayson=require(_0x9376('0x8'));var client=jayson[_0x9376('0x9')][_0x9376('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fb666,_0x489455,_0x46c3bd){return new BPromise(function(_0x236aeb,_0x170d15){return client[_0x9376('0xb')](_0x2fb666,_0x46c3bd)[_0x9376('0xc')](function(_0x3a60b8){logger['info'](_0x9376('0xd'),_0x489455,_0x9376('0xe'));logger['debug'](_0x9376('0xf'),_0x489455,_0x9376('0xe'),JSON['stringify'](_0x3a60b8));if(_0x3a60b8['error']){if(_0x3a60b8[_0x9376('0x10')]['code']===0x1f4){logger[_0x9376('0x10')](_0x9376('0xd'),_0x489455,_0x3a60b8[_0x9376('0x10')][_0x9376('0x11')]);return _0x170d15(_0x3a60b8[_0x9376('0x10')][_0x9376('0x11')]);}logger[_0x9376('0x10')](_0x9376('0xd'),_0x489455,_0x3a60b8[_0x9376('0x10')][_0x9376('0x11')]);return _0x236aeb(_0x3a60b8[_0x9376('0x10')]['message']);}else{logger[_0x9376('0x12')]('FaxApplication,\x20%s,\x20%s',_0x489455,_0x9376('0xe'));_0x236aeb(_0x3a60b8[_0x9376('0x13')][_0x9376('0x11')]);}})['catch'](function(_0x34fced){logger[_0x9376('0x10')]('FaxApplication,\x20%s,\x20%s',_0x489455,_0x34fced);_0x170d15(_0x34fced);});});}exports['UpdateFaxApplication']=function(_0x5d85e9){var _0x4634d7=this;return new Promise(function(_0x57c6fd,_0x25ed5a){return db[_0x9376('0x14')][_0x9376('0x15')](_0x5d85e9[_0x9376('0x16')],{'raw':_0x5d85e9[_0x9376('0x17')]?_0x5d85e9[_0x9376('0x17')][_0x9376('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d85e9[_0x9376('0x17')]?_0x5d85e9['options'][_0x9376('0x19')]||null:null,'attributes':_0x5d85e9[_0x9376('0x17')]?_0x5d85e9[_0x9376('0x17')][_0x9376('0x1a')]||null:null,'limit':_0x5d85e9[_0x9376('0x17')]?_0x5d85e9['options'][_0x9376('0x1b')]||null:null})['then'](function(_0xc11107){logger['info'](_0x9376('0x1c'),_0x5d85e9);logger[_0x9376('0x1d')](_0x9376('0x1c'),_0x5d85e9,JSON[_0x9376('0x1e')](_0xc11107));_0x57c6fd(_0xc11107);})['catch'](function(_0x10a1a0){logger['error'](_0x9376('0x1c'),_0x10a1a0['message'],_0x5d85e9);_0x25ed5a(_0x4634d7[_0x9376('0x10')](0x1f4,_0x10a1a0['message']));});});}; \ No newline at end of file +var _0xb9bc=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','UpdateFaxApplication','update','body','options','where','attributes','catch'];(function(_0x4eb10e,_0x49c2df){var _0x36b18e=function(_0x16ae74){while(--_0x16ae74){_0x4eb10e['push'](_0x4eb10e['shift']());}};_0x36b18e(++_0x49c2df);}(_0xb9bc,0x144));var _0xcb9b=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xb9bc[_0x471448];return _0x38190b;};'use strict';var _=require(_0xcb9b('0x0'));var util=require(_0xcb9b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb9b('0x2'));var fs=require('fs');var Redis=require(_0xcb9b('0x3'));var db=require(_0xcb9b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb9b('0x5'))(_0xcb9b('0x6'));var config=require('../../config/environment');var jayson=require(_0xcb9b('0x7'));var client=jayson[_0xcb9b('0x8')][_0xcb9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x260760,_0x50a344,_0x476e11){return new BPromise(function(_0x388177,_0x482c34){return client[_0xcb9b('0xa')](_0x260760,_0x476e11)[_0xcb9b('0xb')](function(_0x20af9c){logger['info']('FaxApplication,\x20%s,\x20%s',_0x50a344,'request\x20sent');logger[_0xcb9b('0xc')](_0xcb9b('0xd'),_0x50a344,'request\x20sent',JSON[_0xcb9b('0xe')](_0x20af9c));if(_0x20af9c[_0xcb9b('0xf')]){if(_0x20af9c['error'][_0xcb9b('0x10')]===0x1f4){logger[_0xcb9b('0xf')](_0xcb9b('0x11'),_0x50a344,_0x20af9c[_0xcb9b('0xf')][_0xcb9b('0x12')]);return _0x482c34(_0x20af9c[_0xcb9b('0xf')]['message']);}logger[_0xcb9b('0xf')](_0xcb9b('0x11'),_0x50a344,_0x20af9c[_0xcb9b('0xf')][_0xcb9b('0x12')]);return _0x388177(_0x20af9c[_0xcb9b('0xf')][_0xcb9b('0x12')]);}else{logger[_0xcb9b('0x13')]('FaxApplication,\x20%s,\x20%s',_0x50a344,'request\x20sent');_0x388177(_0x20af9c['result'][_0xcb9b('0x12')]);}})['catch'](function(_0x4cb0a2){logger[_0xcb9b('0xf')](_0xcb9b('0x11'),_0x50a344,_0x4cb0a2);_0x482c34(_0x4cb0a2);});});}exports[_0xcb9b('0x14')]=function(_0x4402c3){var _0x52d826=this;return new Promise(function(_0x362d69,_0x578c09){return db['FaxApplication'][_0xcb9b('0x15')](_0x4402c3[_0xcb9b('0x16')],{'raw':_0x4402c3['options']?_0x4402c3[_0xcb9b('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4402c3[_0xcb9b('0x17')]?_0x4402c3[_0xcb9b('0x17')][_0xcb9b('0x18')]||null:null,'attributes':_0x4402c3[_0xcb9b('0x17')]?_0x4402c3['options'][_0xcb9b('0x19')]||null:null,'limit':_0x4402c3[_0xcb9b('0x17')]?_0x4402c3['options']['limit']||null:null})['then'](function(_0x4a2a2f){logger[_0xcb9b('0x13')](_0xcb9b('0x14'),_0x4402c3);logger[_0xcb9b('0xc')]('UpdateFaxApplication',_0x4402c3,JSON[_0xcb9b('0xe')](_0x4a2a2f));_0x362d69(_0x4a2a2f);})[_0xcb9b('0x1a')](function(_0x3ca91c){logger[_0xcb9b('0xf')](_0xcb9b('0x14'),_0x3ca91c[_0xcb9b('0x12')],_0x4402c3);_0x578c09(_0x52d826['error'](0x1f4,_0x3ca91c[_0xcb9b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ed90217..c137f67 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x10dc94,_0x2fed4f){var _0x4a462d=function(_0x5181bd){while(--_0x5181bd){_0x10dc94['push'](_0x10dc94['shift']());}};_0x4a462d(++_0x2fed4f);}(_0xda3f,0xec));var _0xfda3=function(_0x2d6470,_0x1e19c1){_0x2d6470=_0x2d6470-0x0;var _0xb8a30b=_0xda3f[_0x2d6470];return _0xb8a30b;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0x1eba=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38c2b5,_0x4de8fa){var _0x46deb3=function(_0x49dd48){while(--_0x49dd48){_0x38c2b5['push'](_0x38c2b5['shift']());}};_0x46deb3(++_0x4de8fa);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x1eba[_0x44cb92];return _0x56b9e6;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0xf')]);router['put'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router['delete'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x11')]);module[_0xa1eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 77b9b32..2c8e6ef 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc150=['STRING','out','ENUM','exports','BOOLEAN','DATE'];(function(_0x4bb99d,_0x1c4159){var _0x4a9481=function(_0x28cd4b){while(--_0x28cd4b){_0x4bb99d['push'](_0x4bb99d['shift']());}};_0x4a9481(++_0x1c4159);}(_0xc150,0x189));var _0x0c15=function(_0x260a08,_0x1be714){_0x260a08=_0x260a08-0x0;var _0x1d91b8=_0xc150[_0x260a08];return _0x1d91b8;};'use strict';var Sequelize=require('sequelize');module[_0x0c15('0x0')]={'closed':{'type':Sequelize[_0x0c15('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0c15('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0c15('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0c15('0x3')]},'read1stAt':{'type':Sequelize[_0x0c15('0x2')]},'fax':{'type':Sequelize[_0x0c15('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0c15('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0c15('0x5')]('in',_0x0c15('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd464=['sequelize','DATE','STRING','ENUM','out'];(function(_0x1dbb06,_0x59b845){var _0x34ddb4=function(_0x7667ec){while(--_0x7667ec){_0x1dbb06['push'](_0x1dbb06['shift']());}};_0x34ddb4(++_0x59b845);}(_0xd464,0x8c));var _0x4d46=function(_0x22d4ca,_0x3bc7af){_0x22d4ca=_0x22d4ca-0x0;var _0x35e2cb=_0xd464[_0x22d4ca];return _0x35e2cb;};'use strict';var Sequelize=require(_0x4d46('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4d46('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4d46('0x2')]},'note':{'type':Sequelize[_0x4d46('0x2')]},'read1stAt':{'type':Sequelize[_0x4d46('0x1')]},'fax':{'type':Sequelize[_0x4d46('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4d46('0x3')]('in',_0x4d46('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4d46('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index e68f5f1..7f6621b 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62bf=['split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','show','includeAll','include','options','create','body','params','destroy','describe','addMessage','FaxMessage','ids','omit','findOne','format','findAll','rows','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','get','mkdirSync','Messages','basename','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','error','stack','name','send','Users','map','TagIds','Tags','then','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0x62bf,0x15c));var _0xf62b=function(_0x1ae850,_0x2d4283){_0x1ae850=_0x1ae850-0x0;var _0x4a124b=_0x62bf[_0x1ae850];return _0x4a124b;};'use strict';var emlformat=require(_0xf62b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf62b('0x1'));var jsonpatch=require(_0xf62b('0x2'));var rp=require(_0xf62b('0x3'));var moment=require(_0xf62b('0x4'));var BPromise=require(_0xf62b('0x5'));var Mustache=require(_0xf62b('0x6'));var util=require(_0xf62b('0x7'));var path=require(_0xf62b('0x8'));var sox=require(_0xf62b('0x9'));var csv=require(_0xf62b('0xa'));var ejs=require(_0xf62b('0xb'));var fs=require('fs');var fs_extra=require(_0xf62b('0xc'));var _=require(_0xf62b('0xd'));var squel=require('squel');var crypto=require(_0xf62b('0xe'));var jsforce=require(_0xf62b('0xf'));var deskjs=require(_0xf62b('0x10'));var toCsv=require(_0xf62b('0xa'));var querystring=require('querystring');var Papa=require(_0xf62b('0x11'));var Redis=require(_0xf62b('0x12'));var authService=require(_0xf62b('0x13'));var qs=require(_0xf62b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf62b('0x15'));var logger=require(_0xf62b('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf62b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf62b('0x18'))['db'];config['redis']=_[_0xf62b('0x19')](config[_0xf62b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf62b('0x1b'))[_0xf62b('0x1c')](socket);function respondWithStatusCode(_0x12419d,_0x484f6f){_0x484f6f=_0x484f6f||0xcc;return function(_0x2bcbbd){if(_0x2bcbbd){return _0x12419d[_0xf62b('0x1d')](_0x484f6f);}return _0x12419d[_0xf62b('0x1e')](_0x484f6f)[_0xf62b('0x1f')]();};}function respondWithResult(_0x3533b6,_0x4652c4){_0x4652c4=_0x4652c4||0xc8;return function(_0x5bc15a){if(_0x5bc15a){return _0x3533b6[_0xf62b('0x1e')](_0x4652c4)[_0xf62b('0x20')](_0x5bc15a);}};}function respondWithFilteredResult(_0x23c428,_0x1280b4){return function(_0x595109){if(_0x595109){var _0x3eb9e6=typeof _0x1280b4[_0xf62b('0x21')]===_0xf62b('0x22')&&typeof _0x1280b4[_0xf62b('0x23')]===_0xf62b('0x22');var _0x20001a=_0x595109[_0xf62b('0x24')];var _0x18818f=_0x3eb9e6?0x0:_0x1280b4[_0xf62b('0x21')];var _0x5ca734=_0x3eb9e6?_0x595109[_0xf62b('0x24')]:_0x1280b4[_0xf62b('0x21')]+_0x1280b4[_0xf62b('0x23')];var _0x49620c;if(_0x5ca734>=_0x20001a){_0x5ca734=_0x20001a;_0x49620c=0xc8;}else{_0x49620c=0xce;}_0x23c428[_0xf62b('0x1e')](_0x49620c);return _0x23c428[_0xf62b('0x25')]('Content-Range',_0x18818f+'-'+_0x5ca734+'/'+_0x20001a)[_0xf62b('0x20')](_0x595109);}return null;};}function patchUpdates(_0xc1f81c){return function(_0x53ffce){try{jsonpatch[_0xf62b('0x26')](_0x53ffce,_0xc1f81c,!![]);}catch(_0x52e8c5){return BPromise[_0xf62b('0x27')](_0x52e8c5);}return _0x53ffce[_0xf62b('0x28')]();};}function saveUpdates(_0x2e84fd,_0x16a408){return function(_0x48f1d0){if(_0x48f1d0){return _0x48f1d0[_0xf62b('0x29')](_0x2e84fd)['then'](function(_0x19321d){return _0x19321d;});}return null;};}function removeEntity(_0x565445,_0x1c3b3e){return function(_0x44b98a){if(_0x44b98a){return _0x44b98a['destroy']()['then'](function(){_0x565445['status'](0xcc)[_0xf62b('0x1f')]();});}};}function handleEntityNotFound(_0x1afc59,_0x5b193d){return function(_0x3333a6){if(!_0x3333a6){_0x1afc59['sendStatus'](0x194);}return _0x3333a6;};}function handleError(_0x782fc0,_0xdca523){_0xdca523=_0xdca523||0x1f4;return function(_0x48928b){logger[_0xf62b('0x2a')](_0x48928b[_0xf62b('0x2b')]);if(_0x48928b[_0xf62b('0x2c')]){delete _0x48928b['name'];}_0x782fc0[_0xf62b('0x1e')](_0xdca523)[_0xf62b('0x2d')](_0x48928b);};}function getInteractionUsers(_0x276c5f,_0x44fafd){return new BPromise(function(_0xb7515,_0x48fe9d){try{if(_0x44fafd[_0x276c5f['id']]){_0x276c5f[_0xf62b('0x2e')]=_[_0xf62b('0x2f')](_0x44fafd[_0x276c5f['id']],function(_0x3098c5){return{'id':_0x3098c5['id'],'fullname':_0x3098c5['fullname']};});}}catch(_0x3e497d){_0x48fe9d(_0x3e497d);}_0xb7515(_0x276c5f);});}function getInteractionTags(_0x4290a3,_0x193018){return new BPromise(function(_0x42700b,_0xcb8fce){try{if(_0x4290a3[_0xf62b('0x30')]){_0x4290a3[_0xf62b('0x31')]=[];_0x4290a3[_0xf62b('0x30')]['split'](',')['forEach'](function(_0x2b26b1){_0x4290a3[_0xf62b('0x31')]['push'](_0x193018[_0x2b26b1]);});}delete _0x4290a3[_0xf62b('0x30')];}catch(_0x598aaf){_0xcb8fce(_0x598aaf);}_0x42700b(_0x4290a3);});}function updateFaxInteraction(_0x1b620b,_0x1ee581,_0x520906){return new BPromise(function(_0x23d8ac,_0x15bdbd){return getInteractionUsers(_0x1b620b,_0x520906)['then'](function(_0x16d158){return getInteractionTags(_0x16d158,_0x1ee581);})[_0xf62b('0x32')](function(_0x3a37b7){return getStateInteraction(_0x3a37b7);})[_0xf62b('0x32')](function(_0x1dc781){_0x23d8ac(_0x1dc781);})[_0xf62b('0x33')](function(_0x56f978){_0x15bdbd(_0x56f978);});});}function getStateInteraction(_0x57524a){return new BPromise(function(_0x454e8e){_0x57524a[_0xf62b('0x34')]=0x0;_0x57524a[_0xf62b('0x35')]=0x0;_0x57524a[_0xf62b('0x36')]=0x0;_0x57524a[_0xf62b('0x37')]=0x0;_0x57524a['total']=0x0;if(!_0x57524a[_0xf62b('0x38')]&&!_0x57524a[_0xf62b('0x39')]){_0x57524a['waiting']+=0x1;}if(!_0x57524a[_0xf62b('0x38')]&&_0x57524a[_0xf62b('0x39')]){_0x57524a['talking']+=0x1;if(_0x57524a['waiting']){_0x57524a['waiting']-=0x1;}}if(_0x57524a['closed']&&_0x57524a['UserId']){_0x57524a['answered']+=0x1;if(_0x57524a['talking']){_0x57524a['talking']-=0x1;}}if(_0x57524a['closed']&&!_0x57524a[_0xf62b('0x39')]){_0x57524a[_0xf62b('0x37')]+=0x1;if(_0x57524a[_0xf62b('0x34')]){_0x57524a[_0xf62b('0x34')]-=0x1;}}_0x57524a[_0xf62b('0x3a')]+=0x1;_0x454e8e(_0x57524a);});}exports[_0xf62b('0x3b')]=function(_0x5b6769,_0x3dc8bc){var _0x5ca63b={},_0x50c01b={},_0x1c5b57={'count':0x0,'rows':[]};var _0x4b5359=_[_0xf62b('0x2f')](db[_0xf62b('0x3c')][_0xf62b('0x3d')],function(_0xe4bbcf){return{'name':_0xe4bbcf[_0xf62b('0x3e')],'type':_0xe4bbcf[_0xf62b('0x3f')][_0xf62b('0x40')]};});_0x50c01b[_0xf62b('0x41')]=_[_0xf62b('0x2f')](_0x4b5359,_0xf62b('0x2c'));_0x50c01b[_0xf62b('0x42')]=_[_0xf62b('0x43')](_0x5b6769[_0xf62b('0x42')]);_0x50c01b[_0xf62b('0x44')]=_[_0xf62b('0x45')](_0x50c01b['model'],_0x50c01b[_0xf62b('0x42')]);_0x5ca63b[_0xf62b('0x46')]=_[_0xf62b('0x45')](_0x50c01b[_0xf62b('0x41')],qs[_0xf62b('0x47')](_0x5b6769[_0xf62b('0x42')][_0xf62b('0x47')]));_0x5ca63b[_0xf62b('0x46')]=_0x5ca63b[_0xf62b('0x46')][_0xf62b('0x48')]?_0x5ca63b[_0xf62b('0x46')]:_0x50c01b[_0xf62b('0x41')];if(!_0x5b6769[_0xf62b('0x42')][_0xf62b('0x49')](_0xf62b('0x4a'))){_0x5ca63b[_0xf62b('0x23')]=qs[_0xf62b('0x23')](_0x5b6769[_0xf62b('0x42')][_0xf62b('0x23')]);_0x5ca63b['offset']=qs[_0xf62b('0x21')](_0x5b6769[_0xf62b('0x42')]['offset']);}_0x5ca63b[_0xf62b('0x4b')]=qs[_0xf62b('0x4c')](_0x5b6769[_0xf62b('0x42')][_0xf62b('0x4c')]);_0x5ca63b[_0xf62b('0x4d')]=qs['filters'](_[_0xf62b('0x4e')](_0x5b6769[_0xf62b('0x42')],_0x50c01b[_0xf62b('0x44')]),_0x4b5359);var _0x2dea25=[];var _0x9a8c0f=squel[_0xf62b('0x4f')]()['field']('id')[_0xf62b('0x50')](_0xf62b('0x2c'))[_0xf62b('0x50')](_0xf62b('0x51'))['from']('tools_tags');var _0x574e1d=squel[_0xf62b('0x4f')]()[_0xf62b('0x50')](_0xf62b('0x52'))[_0xf62b('0x50')](_0xf62b('0x53'))[_0xf62b('0x50')](_0xf62b('0x54'))[_0xf62b('0x55')](_0xf62b('0x56'),'ui')[_0xf62b('0x57')](_0xf62b('0x58'),'u',_0xf62b('0x59'));var _0x3f0ccc=squel[_0xf62b('0x4f')]()[_0xf62b('0x55')]('fax_interactions','i')[_0xf62b('0x57')](_0xf62b('0x5a'),'c',_0xf62b('0x5b'))['left_join'](_0xf62b('0x58'),'o',_0xf62b('0x5c'))[_0xf62b('0x57')](_0xf62b('0x5d'),'a',_0xf62b('0x5e'))[_0xf62b('0x57')](_0xf62b('0x5f'),'me',_0xf62b('0x60'))[_0xf62b('0x57')]('fax_interaction_has_tags','it',_0xf62b('0x61'))['left_join'](_0xf62b('0x62'),'t',_0xf62b('0x63'));var _0x4b6be8=squel['expr']();var _0x19614f=[];var _0x13f19b=squel[_0xf62b('0x64')]();var _0x2ccbe2;if(_0x5b6769[_0xf62b('0x42')][_0xf62b('0x65')]){_0x2ccbe2=as[_0xf62b('0x66')](_0x5b6769['query'][_0xf62b('0x65')]);var _0x5b93a8=_0x2ccbe2[_0xf62b('0x67')];for(var _0xc05d05=0x0;_0xc05d05<_0x2ccbe2[_0xf62b('0x68')][_0xf62b('0x48')];_0xc05d05++){var _0x26ad89=_0x2ccbe2[_0xf62b('0x68')][_0xc05d05];var _0x179bca='i';var _0x21bc1f=_[_0xf62b('0x69')](_0x4b5359,[_0xf62b('0x2c'),_0x26ad89[_0xf62b('0x50')]]);if(!_0x21bc1f){switch(_0x26ad89[_0xf62b('0x50')]){case _0xf62b('0x6a'):if(_0x26ad89['value']==0x1){_0x3f0ccc[_0xf62b('0x6b')]('`'+_0x26ad89[_0xf62b('0x50')]+_0xf62b('0x6c'));}else{_0x3f0ccc[_0xf62b('0x6b')]('`'+_0x26ad89[_0xf62b('0x50')]+_0xf62b('0x6d'));}break;case _0xf62b('0x6e'):if(_0x26ad89[_0xf62b('0x6f')]===_0xf62b('0x70')){if(_0x26ad89[_0xf62b('0x71')][_0xf62b('0x72')]('\x20')[_0xf62b('0x48')]>0x1){_0x4b6be8[_0x5b93a8](_0xf62b('0x73'),qs[_0xf62b('0x74')](_0x26ad89[_0xf62b('0x71')]),null);}else{var _0x5df25d='%'+_0x26ad89['value']+'%';_0x4b6be8[_0x5b93a8](_0xf62b('0x75'),_0x5df25d,_0x5df25d,_0x5df25d);}}else{_0x21bc1f=_[_0xf62b('0x69')](_0x4b5359,[_0xf62b('0x2c'),'ContactId']);_0x26ad89['field']=_0xf62b('0x76');_0x2ba686=as[_0xf62b('0x77')](_0x179bca,_0x21bc1f['type'],_0x26ad89);_0x4b6be8[_0x5b93a8](_0x2ba686[_0xf62b('0x78')],_0x2ba686[_0xf62b('0x71')][_0xf62b('0x79')],_0x2ba686[_0xf62b('0x71')][_0xf62b('0x1f')]);}break;case _0xf62b('0x7a'):var _0x137508=_0x26ad89[_0xf62b('0x71')][_0xf62b('0x72')](',')['map'](function(_0x287276){return Number(_0x287276);});_0x137508[_0xf62b('0x7b')](function(_0x223cc1){_0x13f19b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x223cc1+',%');});_0x19614f=_[_0xf62b('0x7c')](_0x19614f,_0x137508);break;case _0xf62b('0x7d'):if(_0x26ad89[_0xf62b('0x6f')]===_0xf62b('0x70')){_0x4b6be8[_0x5b93a8](_0xf62b('0x7e'),'%'+_0x26ad89[_0xf62b('0x71')]+'%',null);}else{_0x21bc1f=_[_0xf62b('0x69')](_0x4b5359,[_0xf62b('0x2c'),'UserId']);_0x26ad89['field']=_0xf62b('0x39');_0x2ba686=as[_0xf62b('0x77')](_0x179bca,_0x21bc1f[_0xf62b('0x3f')],_0x26ad89);_0x4b6be8[_0x5b93a8](_0x2ba686[_0xf62b('0x78')],_0x2ba686[_0xf62b('0x71')]['start'],_0x2ba686[_0xf62b('0x71')][_0xf62b('0x1f')]);}break;case'body':_0x2ba686=as[_0xf62b('0x77')]('me',null,_0x26ad89);_0x4b6be8[_0x5b93a8](_0x2ba686[_0xf62b('0x78')],_0x2ba686['value'][_0xf62b('0x79')],_0x2ba686[_0xf62b('0x71')][_0xf62b('0x1f')]);break;}}else{var _0x2ba686=as['buildExpression'](_0x179bca,_0x21bc1f[_0xf62b('0x3f')],_0x26ad89);_0x4b6be8[_0x5b93a8](_0x2ba686['text'],_0x2ba686['value'][_0xf62b('0x79')],_0x2ba686['value'][_0xf62b('0x1f')]);}}}else{var _0x41279c=_(_0x5b6769[_0xf62b('0x42')])[_0xf62b('0x43')]()[_0xf62b('0x2f')](function(_0xfa1e77){return _[_0xf62b('0x7f')](_0x4b5359,[_0xf62b('0x2c'),_0xfa1e77])?_0xfa1e77:undefined;})[_0xf62b('0x80')]()[_0xf62b('0x71')]();if(!_[_0xf62b('0x81')](_0x41279c)){_0x41279c[_0xf62b('0x7b')](function(_0x5e2c64){if(_0x5e2c64===_0xf62b('0x82')){_0x3f0ccc[_0xf62b('0x4d')](_0xf62b('0x83'),[][_0xf62b('0x84')](_0x5b6769[_0xf62b('0x42')][_0x5e2c64]));}else if(_0x5e2c64===_0xf62b('0x85')){var _0x45054a=JSON['parse'](_0x5b6769[_0xf62b('0x42')][_0x5e2c64])[_0xf62b('0x86')];var _0x24cb22=JSON[_0xf62b('0x87')](_0x5b6769[_0xf62b('0x42')][_0x5e2c64])[_0xf62b('0x88')];_0x3f0ccc['where'](_0xf62b('0x89'),_0x45054a,_0x24cb22);}else{if(_0x5b6769[_0xf62b('0x42')][_0x5e2c64]===_0xf62b('0x8a')){_0x3f0ccc[_0xf62b('0x4d')]('i.'+_0x5e2c64+_0xf62b('0x8b'));}else{_0x3f0ccc[_0xf62b('0x4d')]('i.'+_0x5e2c64+_0xf62b('0x8c'),_0x5b6769[_0xf62b('0x42')][_0x5e2c64]);}}});}if(_0x5b6769['query'][_0xf62b('0x8d')]){if(_0x5b6769['query'][_0xf62b('0x8d')]==0x1){_0x3f0ccc['having'](_0xf62b('0x8e'));}else{_0x3f0ccc[_0xf62b('0x6b')](_0xf62b('0x8f'));}}if(_0x5b6769[_0xf62b('0x42')]['tag']){_0x19614f=_[_0xf62b('0x90')](_0x5b6769[_0xf62b('0x42')][_0xf62b('0x91')])?_0x5b6769[_0xf62b('0x42')][_0xf62b('0x91')]:new Array(_0x5b6769['query'][_0xf62b('0x91')]);_0x19614f[_0xf62b('0x7b')](function(_0x5aa06a){_0x13f19b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5aa06a+',%');});}if(_0x5b6769[_0xf62b('0x42')]['filter']){var _0x5c3464=_0x5b6769[_0xf62b('0x42')][_0xf62b('0x92')][_0xf62b('0x93')]('\x5c','\x5c\x5c')[_0xf62b('0x93')](/'/g,'\x27\x27');if(qs[_0xf62b('0x94')](_0x5c3464)){_0x4b6be8['or']('i.id\x20LIKE\x20?',_0x5c3464+'%')['or']('i.fax\x20LIKE\x20?',_0x5c3464+'%');}_0x4b6be8['or'](_0xf62b('0x95'),_0x5c3464+'%');}}_0x3f0ccc[_0xf62b('0x4d')](_0x4b6be8);_0x3f0ccc[_0xf62b('0x96')](_0xf62b('0x97'));var _0x466ad7={'type':db[_0xf62b('0x98')][_0xf62b('0x99')][_0xf62b('0x9a')],'raw':!![]};var _0x22350f=_0x3f0ccc[_0xf62b('0x9b')]();_0x22350f[_0xf62b('0x50')](_0xf62b('0x97'));_0x22350f['field'](_0xf62b('0x9c'),_0xf62b('0x6a'));if(_0x5ca63b[_0xf62b('0x4b')]){_0x5ca63b[_0xf62b('0x4b')][_0xf62b('0x7b')](function(_0x166c98){var _0x4e68f3=_0x166c98[0x0]===_0xf62b('0x9d')?_0x166c98[0x0]:'i.'+_0x166c98[0x0];_0x3f0ccc[_0xf62b('0x4b')](_0x4e68f3,_0x166c98[0x1]==='DESC'?![]:!![]);});}if(!_[_0xf62b('0x81')](_0x19614f)){_0x3f0ccc[_0xf62b('0x6b')](_0x13f19b);_0x22350f[_0xf62b('0x4d')](_0xf62b('0x9e'),_0x19614f);}BPromise['resolve']()['then'](function(){if(!_0x2ccbe2){if(_0x5b6769[_0xf62b('0x42')][_0xf62b('0x82')])return;_0x22350f['where'](_0xf62b('0x9f'));_0x3f0ccc[_0xf62b('0x4d')](_0xf62b('0x9f'));return;}if(_0x5b6769[_0xf62b('0xa0')][_0xf62b('0xa1')]!=='agent')return;return _0x5b6769[_0xf62b('0xa0')][_0xf62b('0xa2')]({'attributes':['id'],'raw':!![]})[_0xf62b('0x32')](function(_0x1d0047){if(_['isEmpty'](_0x1d0047)){_0x22350f['where'](_0xf62b('0xa3'));_0x3f0ccc[_0xf62b('0x4d')](_0xf62b('0xa3'));}else{_0x22350f[_0xf62b('0x4d')](_0xf62b('0x83'),_[_0xf62b('0x2f')](_0x1d0047,'id'));_0x3f0ccc[_0xf62b('0x4d')](_0xf62b('0x83'),_['map'](_0x1d0047,'id'));}});})[_0xf62b('0x32')](function(){if(_0x5b6769['user']['role']==='agent'&&!_0x2ccbe2&&!_0x5b6769[_0xf62b('0x42')]['FaxAccountId'])return[];return db['sequelize'][_0xf62b('0x42')](_0x22350f[_0xf62b('0xa4')](),_0x466ad7);})['then'](function(_0x3c564f){_0x1c5b57['count']=_0x3c564f[_0xf62b('0x48')];if(_0x1c5b57[_0xf62b('0x24')]===0x0)return[];return db[_0xf62b('0xa5')][_0xf62b('0x42')](_0x9a8c0f[_0xf62b('0xa4')](),_0x466ad7)['then'](function(_0x3b35b0){_0x2dea25=_[_0xf62b('0xa6')](_0x3b35b0,'id');_0x466ad7=_[_0xf62b('0xa7')](_0x466ad7,{'model':db[_0xf62b('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b6769[_0xf62b('0x42')][_0xf62b('0x47')]){_0x5ca63b[_0xf62b('0x46')]['forEach'](function(_0x4c8747){_0x3f0ccc['field']('i.'+_0x4c8747);});}else{_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0x9c'),'unreadMessages');_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xa8'),_0xf62b('0xa9'));_0x3f0ccc['field'](_0xf62b('0xaa'),_0xf62b('0xab'));_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xac'),'contactName');_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xad'));_0x3f0ccc['field'](_0xf62b('0xae'),'Contact.firstName');_0x3f0ccc['field'](_0xf62b('0xaf'),_0xf62b('0xb0'));_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xb1'),'Contact.email');_0x3f0ccc['field']('c.phone',_0xf62b('0xb2'));_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xb3'),'Contact.mobile');_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xb4'),_0xf62b('0xb5'));_0x3f0ccc[_0xf62b('0x50')]('o.fullname','Owner.fullname');_0x3f0ccc['field'](_0xf62b('0xb6'),_0xf62b('0xb7'));_0x3f0ccc[_0xf62b('0x50')](_0xf62b('0xb8'),_0xf62b('0x30'));}if(_0x5ca63b[_0xf62b('0x23')])_0x3f0ccc[_0xf62b('0x23')](_0x5ca63b[_0xf62b('0x23')]);if(_0x5ca63b[_0xf62b('0x21')])_0x3f0ccc[_0xf62b('0x21')](_0x5ca63b[_0xf62b('0x21')]);return db[_0xf62b('0xa5')]['query'](_0x3f0ccc[_0xf62b('0xa4')](),_0x466ad7);})[_0xf62b('0x32')](function(_0x2009ba){if(_0x2009ba[_0xf62b('0x48')]>0x0)_0x574e1d[_0xf62b('0x4d')](_0xf62b('0xb9'),_['map'](_0x2009ba,'id'));return db[_0xf62b('0xa5')]['query'](_0x574e1d[_0xf62b('0xa4')](),_0x466ad7)['then'](function(_0x369bbf){var _0x20936a=_[_0xf62b('0xba')](_0x369bbf,_0xf62b('0xbb'));var _0x5988ae=[];_0x2009ba[_0xf62b('0x7b')](function(_0x3a4249){_0x5988ae[_0xf62b('0xbc')](updateFaxInteraction(_0x3a4249,_0x2dea25,_0x20936a));});return BPromise[_0xf62b('0xbd')](_0x5988ae);});});})['then'](function(_0x5daee6){_0x1c5b57['rows']=_0x5daee6;return _0x1c5b57;})[_0xf62b('0x32')](respondWithFilteredResult(_0x3dc8bc,_0x5ca63b))['catch'](handleError(_0x3dc8bc,null));};exports[_0xf62b('0xbe')]=function(_0x25267c,_0x1a34c0){var _0x4edef7={'raw':![],'where':{'id':_0x25267c['params']['id']}},_0xfa1862={};_0xfa1862[_0xf62b('0x41')]=_[_0xf62b('0x43')](db[_0xf62b('0x3c')]['rawAttributes']);_0xfa1862['query']=_[_0xf62b('0x43')](_0x25267c[_0xf62b('0x42')]);_0xfa1862['filters']=_[_0xf62b('0x45')](_0xfa1862[_0xf62b('0x41')],_0xfa1862[_0xf62b('0x42')]);_0x4edef7[_0xf62b('0x46')]=_[_0xf62b('0x45')](_0xfa1862[_0xf62b('0x41')],qs[_0xf62b('0x47')](_0x25267c['query']['fields']));_0x4edef7['attributes']=_0x4edef7[_0xf62b('0x46')][_0xf62b('0x48')]?_0x4edef7[_0xf62b('0x46')]:_0xfa1862['model'];if(_0x25267c[_0xf62b('0x42')][_0xf62b('0xbf')]){_0x4edef7[_0xf62b('0xc0')]=[{'all':!![]}];}_0x4edef7=_[_0xf62b('0xa7')]({},_0x4edef7,_0x25267c[_0xf62b('0xc1')]);return db['FaxInteraction'][_0xf62b('0x69')](_0x4edef7)['then'](handleEntityNotFound(_0x1a34c0,null))[_0xf62b('0x32')](respondWithResult(_0x1a34c0,null))[_0xf62b('0x33')](handleError(_0x1a34c0,null));};exports['create']=function(_0xbdc6b,_0x54a157){return db[_0xf62b('0x3c')][_0xf62b('0xc2')](_0xbdc6b[_0xf62b('0xc3')],{})['then'](respondWithResult(_0x54a157,0xc9))[_0xf62b('0x33')](handleError(_0x54a157,null));};exports[_0xf62b('0x29')]=function(_0x366af4,_0x3e1bb6){if(_0x366af4[_0xf62b('0xc3')]['id']){delete _0x366af4[_0xf62b('0xc3')]['id'];}return db['FaxInteraction'][_0xf62b('0x69')]({'where':{'id':_0x366af4[_0xf62b('0xc4')]['id']}})[_0xf62b('0x32')](handleEntityNotFound(_0x3e1bb6,null))[_0xf62b('0x32')](saveUpdates(_0x366af4[_0xf62b('0xc3')],null))[_0xf62b('0x32')](respondWithResult(_0x3e1bb6,null))['catch'](handleError(_0x3e1bb6,null));};exports[_0xf62b('0xc5')]=function(_0x1571e5,_0x158454){return db[_0xf62b('0x3c')][_0xf62b('0x69')]({'where':{'id':_0x1571e5[_0xf62b('0xc4')]['id']}})['then'](handleEntityNotFound(_0x158454,null))[_0xf62b('0x32')](removeEntity(_0x158454,null))[_0xf62b('0x33')](handleError(_0x158454,null));};exports[_0xf62b('0xc6')]=function(_0x2bdbba,_0x18a1dd){return db['FaxInteraction'][_0xf62b('0xc6')]()[_0xf62b('0x32')](respondWithResult(_0x18a1dd,null))['catch'](handleError(_0x18a1dd,null));};exports[_0xf62b('0xc7')]=function(_0x56ade5,_0x325057,_0x47675d){return db[_0xf62b('0xc8')]['find']({'where':{'id':_0x56ade5[_0xf62b('0xc4')]['id']}})[_0xf62b('0x32')](handleEntityNotFound(_0x325057,null))[_0xf62b('0x32')](function(_0x4fd860){if(_0x4fd860){return _0x4fd860['addMessage'](_0x56ade5[_0xf62b('0xc3')][_0xf62b('0xc9')],_[_0xf62b('0xca')](_0x56ade5[_0xf62b('0xc3')],[_0xf62b('0xc9'),'id'])||{});}})[_0xf62b('0x32')](respondWithResult(_0x325057,null))[_0xf62b('0x33')](handleError(_0x325057,null));};exports['getMessages']=function(_0x1f30fa,_0x26a466,_0x3ccc8b){var _0x344b72={'raw':![],'where':{}};var _0xb0de0c={};var _0x55d07c={'count':0x0,'rows':[]};return db[_0xf62b('0x3c')][_0xf62b('0xcb')]({'where':{'id':_0x1f30fa[_0xf62b('0xc4')]['id']}})['then'](handleEntityNotFound(_0x26a466,null))['then'](function(_0x56346a){if(_0x56346a){_0xb0de0c[_0xf62b('0x41')]=_[_0xf62b('0x43')](db[_0xf62b('0xc8')][_0xf62b('0x3d')]);_0xb0de0c[_0xf62b('0x42')]=_[_0xf62b('0x43')](_0x1f30fa[_0xf62b('0x42')]);_0xb0de0c[_0xf62b('0x44')]=_['intersection'](_0xb0de0c['model'],_0xb0de0c[_0xf62b('0x42')]);_0x344b72[_0xf62b('0x46')]=_[_0xf62b('0x45')](_0xb0de0c[_0xf62b('0x41')],qs[_0xf62b('0x47')](_0x1f30fa[_0xf62b('0x42')][_0xf62b('0x47')]));_0x344b72[_0xf62b('0x46')]=_0x344b72[_0xf62b('0x46')][_0xf62b('0x48')]?_0x344b72[_0xf62b('0x46')]:_0xb0de0c[_0xf62b('0x41')];if(!_0x1f30fa[_0xf62b('0x42')][_0xf62b('0x49')](_0xf62b('0x4a'))){_0x344b72[_0xf62b('0x23')]=qs[_0xf62b('0x23')](_0x1f30fa[_0xf62b('0x42')]['limit']);_0x344b72[_0xf62b('0x21')]=qs[_0xf62b('0x21')](_0x1f30fa[_0xf62b('0x42')][_0xf62b('0x21')]);}_0x344b72[_0xf62b('0x4b')]=qs[_0xf62b('0x4c')](_0x1f30fa[_0xf62b('0x42')]['sort']);_0x344b72[_0xf62b('0x4d')]=qs['filters'](_['pick'](_0x1f30fa['query'],_0xb0de0c[_0xf62b('0x44')]));_0x344b72[_0xf62b('0x4d')]['FaxInteractionId']=_0x56346a['id'];if(_0x1f30fa[_0xf62b('0x42')]['filter']){_0x344b72[_0xf62b('0x4d')]=_['merge'](_0x344b72['where'],{'$or':_['map'](_0x344b72[_0xf62b('0x46')],function(_0x3bea82){var _0x38efb7={};_0x38efb7[_0x3bea82]={'$like':'%'+_0x1f30fa['query'][_0xf62b('0x92')]+'%'};return _0x38efb7;})});}if(_0x1f30fa[_0xf62b('0x42')][_0xf62b('0x86')]){var _0x312284=_0x1f30fa[_0xf62b('0x42')][_0xf62b('0x86')]['split'](',');var _0x2aa237={};_0x2aa237[_0x312284[0x0]]={'$gte':moment(_0x312284[0x1])[_0xf62b('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x344b72['where']=_[_0xf62b('0xa7')](_0x344b72[_0xf62b('0x4d')],_0x2aa237);}_0x344b72=_[_0xf62b('0xa7')]({},_0x344b72,_0x1f30fa[_0xf62b('0xc1')]);return db['FaxMessage'][_0xf62b('0x24')]({'where':_0x344b72['where']})[_0xf62b('0x32')](function(_0x1d4e5c){_0x55d07c['count']=_0x1d4e5c;if(_0x1f30fa[_0xf62b('0x42')][_0xf62b('0xbf')]){_0x344b72[_0xf62b('0xc0')]=[{'all':!![]}];}return db['FaxMessage'][_0xf62b('0xcd')](_0x344b72);})[_0xf62b('0x32')](function(_0x4bc3c9){_0x55d07c[_0xf62b('0xce')]=_0x4bc3c9;return _0x55d07c;});}})[_0xf62b('0x32')](respondWithFilteredResult(_0x26a466,_0x344b72))[_0xf62b('0x33')](handleError(_0x26a466,null));};exports[_0xf62b('0xcf')]=function(_0x514375,_0x4209ce,_0x37bad2){return db[_0xf62b('0x3c')]['find']({'where':{'id':_0x514375[_0xf62b('0xc4')]['id']}})[_0xf62b('0x32')](handleEntityNotFound(_0x4209ce,null))[_0xf62b('0x32')](function(_0x1503cd){if(_0x1503cd){return _0x1503cd[_0xf62b('0xd0')](_0x514375['body'][_0xf62b('0xc9')],_['omit'](_0x514375[_0xf62b('0xc3')],[_0xf62b('0xc9'),'id'])||{})[_0xf62b('0xd1')](function(){return db[_0xf62b('0x7a')][_0xf62b('0xcd')]({'attributes':['id',_0xf62b('0x2c'),'color'],'where':{'id':_0x514375[_0xf62b('0xc3')]['ids']}});})[_0xf62b('0x32')](function(_0x28e701){socket[_0xf62b('0xd2')](_0xf62b('0xd3'),{'id':Number(_0x514375['params']['id']),'tags':_0x28e701||[]});return{'id':Number(_0x514375[_0xf62b('0xc4')]['id']),'tags':_0x28e701||[]};});}})[_0xf62b('0x32')](respondWithResult(_0x4209ce,null))['catch'](handleError(_0x4209ce,null));};exports[_0xf62b('0xd4')]=function(_0x4436cd,_0x34f679,_0x4ca09f){return db['FaxInteraction'][_0xf62b('0x69')]({'where':{'id':_0x4436cd[_0xf62b('0xc4')]['id']}})[_0xf62b('0x32')](handleEntityNotFound(_0x34f679,null))[_0xf62b('0x32')](function(_0x16fefd){if(_0x16fefd){return _0x16fefd[_0xf62b('0xd4')](_0x4436cd[_0xf62b('0x42')]['ids']);}})[_0xf62b('0x32')](respondWithStatusCode(_0x34f679,null))['catch'](handleError(_0x34f679,null));};exports['download']=function(_0x2a0a05,_0x15ff74){var _0x5bc37f=moment()['unix']()[_0xf62b('0xa4')]();var _0x2a3b52=path[_0xf62b('0xd5')](config[_0xf62b('0xd6')],'server',_0xf62b('0xd7'),_0xf62b('0xd8'));var _0x5a13cf=path['join'](config[_0xf62b('0xd6')],_0xf62b('0xd9'),_0xf62b('0xd7'),_0xf62b('0xda'));var _0x496526=path['join'](_0x2a3b52,_0x5bc37f);var _0x36a24c=util['format'](_0xf62b('0xdb'),_0x2a0a05['params']['id'],_0x5bc37f);var _0x3c715e=path[_0xf62b('0xd5')](_0x2a3b52,_0x36a24c);var _0x394375=[];_0x394375['push']({'model':db[_0xf62b('0xdc')],'as':_0xf62b('0xdc'),'raw':!![]});var _0x2376fa=[{'model':db[_0xf62b('0xc8')],'as':'Messages','attributes':['id',_0xf62b('0xc3'),_0xf62b('0x85')],'include':_0x394375}];return db['FaxInteraction'][_0xf62b('0x69')]({'where':{'id':_0x2a0a05['params']['id']},'include':_0x2376fa})[_0xf62b('0x32')](handleEntityNotFound(_0x15ff74,null))[_0xf62b('0x32')](function(_0xa053b6){if(_0xa053b6&&_0xa053b6['Messages']){var _0x3946ea=_0xa053b6[_0xf62b('0xdd')]({'plain':!![]});fs[_0xf62b('0xde')](_0x496526);for(var _0x699007=0x0;_0x699007<_0x3946ea['Messages']['length'];_0x699007++){var _0x49b38e=_0x3946ea[_0xf62b('0xdf')][_0x699007][_0xf62b('0xdc')];if(_0x49b38e){var _0x438d61=path[_0xf62b('0xd5')](_0x5a13cf,_0x49b38e[_0xf62b('0xe0')]);if(fs['existsSync'](_0x438d61)){fs[_0xf62b('0xe1')](_0x438d61)[_0xf62b('0xe2')](fs[_0xf62b('0xe3')](path['join'](_0x496526,_0x49b38e['basename'])));}}}return BPromise[_0xf62b('0xe4')]()[_0xf62b('0x32')](function(){return new BPromise(function(_0x3f83ab,_0x508bef){zipdir(_0x496526,{'saveTo':_0x3c715e},function(_0xd18cf3,_0x839064){if(_0xd18cf3)return _0x508bef(_0xd18cf3);return _0x3f83ab(_0x839064);});})[_0xf62b('0x32')](function(){return new BPromise(function(_0x44a681,_0x14bbd3){rimraf(_0x496526,function(_0x56f7db){if(_0x56f7db)_0x14bbd3(_0x56f7db);return _0x44a681();});});})[_0xf62b('0x32')](function(){return _0x15ff74['download'](_0x3c715e,_0x36a24c,function(_0x4fe61e){if(_0x4fe61e){console[_0xf62b('0xe5')]('err',_0x4fe61e);}else{fs[_0xf62b('0xe6')](_0x3c715e);}});});});}else{return _0x15ff74['sendStatus'](0xc8);}})['catch'](handleError(_0x15ff74,null));}; \ No newline at end of file +var _0x20dc=['sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','TagIds','Tags','push','waiting','talking','total','closed','UserId','answered','unmanaged','index','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','pick','select','color','tools_tags','field','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','having','`\x20=\x200','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','text','some','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','unreadMessages','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','catch','show','keys','includeAll','options','params','describe','addMessage','FaxMessage','body','ids','omit','getMessages','findOne','hasOwnProperty','sort','filter','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x1fb964,_0x5751ad){var _0x5f0792=function(_0x355732){while(--_0x355732){_0x1fb964['push'](_0x1fb964['shift']());}};_0x5f0792(++_0x5751ad);}(_0x20dc,0x1ab));var _0xc20d=function(_0x129a9f,_0x3cb0d5){_0x129a9f=_0x129a9f-0x0;var _0x34ee99=_0x20dc[_0x129a9f];return _0x34ee99;};'use strict';var emlformat=require(_0xc20d('0x0'));var rimraf=require(_0xc20d('0x1'));var zipdir=require(_0xc20d('0x2'));var jsonpatch=require(_0xc20d('0x3'));var rp=require(_0xc20d('0x4'));var moment=require(_0xc20d('0x5'));var BPromise=require(_0xc20d('0x6'));var Mustache=require(_0xc20d('0x7'));var util=require(_0xc20d('0x8'));var path=require(_0xc20d('0x9'));var sox=require(_0xc20d('0xa'));var csv=require(_0xc20d('0xb'));var ejs=require(_0xc20d('0xc'));var fs=require('fs');var fs_extra=require(_0xc20d('0xd'));var _=require(_0xc20d('0xe'));var squel=require(_0xc20d('0xf'));var crypto=require(_0xc20d('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xc20d('0x11'));var toCsv=require(_0xc20d('0xb'));var querystring=require(_0xc20d('0x12'));var Papa=require(_0xc20d('0x13'));var Redis=require(_0xc20d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc20d('0x15'));var logger=require('../../config/logger')(_0xc20d('0x16'));var utils=require(_0xc20d('0x17'));var config=require(_0xc20d('0x18'));var licenseUtil=require(_0xc20d('0x19'));var db=require('../../mysqldb')['db'];config[_0xc20d('0x1a')]=_['defaults'](config[_0xc20d('0x1a')],{'host':_0xc20d('0x1b'),'port':0x18eb});var socket=require(_0xc20d('0x1c'))(new Redis(config[_0xc20d('0x1a')]));require(_0xc20d('0x1d'))[_0xc20d('0x1e')](socket);function respondWithStatusCode(_0x194586,_0x578f30){_0x578f30=_0x578f30||0xcc;return function(_0x49fa0f){if(_0x49fa0f){return _0x194586[_0xc20d('0x1f')](_0x578f30);}return _0x194586[_0xc20d('0x20')](_0x578f30)['end']();};}function respondWithResult(_0x5efc75,_0x19c280){_0x19c280=_0x19c280||0xc8;return function(_0x2fd4b4){if(_0x2fd4b4){return _0x5efc75[_0xc20d('0x20')](_0x19c280)[_0xc20d('0x21')](_0x2fd4b4);}};}function respondWithFilteredResult(_0x305f86,_0x272c24){return function(_0x7a01cc){if(_0x7a01cc){var _0x25cbd0=typeof _0x272c24[_0xc20d('0x22')]===_0xc20d('0x23')&&typeof _0x272c24['limit']===_0xc20d('0x23');var _0x5ddd2b=_0x7a01cc['count'];var _0x32a483=_0x25cbd0?0x0:_0x272c24[_0xc20d('0x22')];var _0x32ae23=_0x25cbd0?_0x7a01cc[_0xc20d('0x24')]:_0x272c24[_0xc20d('0x22')]+_0x272c24[_0xc20d('0x25')];var _0x2319c6;if(_0x32ae23>=_0x5ddd2b){_0x32ae23=_0x5ddd2b;_0x2319c6=0xc8;}else{_0x2319c6=0xce;}_0x305f86[_0xc20d('0x20')](_0x2319c6);return _0x305f86[_0xc20d('0x26')](_0xc20d('0x27'),_0x32a483+'-'+_0x32ae23+'/'+_0x5ddd2b)[_0xc20d('0x21')](_0x7a01cc);}return null;};}function patchUpdates(_0x8d12c8){return function(_0x154aa4){try{jsonpatch[_0xc20d('0x28')](_0x154aa4,_0x8d12c8,!![]);}catch(_0x2fb616){return BPromise[_0xc20d('0x29')](_0x2fb616);}return _0x154aa4['save']();};}function saveUpdates(_0x15e7fa,_0x2eaa2a){return function(_0x4dd016){if(_0x4dd016){return _0x4dd016[_0xc20d('0x2a')](_0x15e7fa)[_0xc20d('0x2b')](function(_0x50bfd1){return _0x50bfd1;});}return null;};}function removeEntity(_0x42873b,_0x41cc01){return function(_0x5d536f){if(_0x5d536f){return _0x5d536f[_0xc20d('0x2c')]()[_0xc20d('0x2b')](function(){_0x42873b[_0xc20d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f77c8,_0x45217c){return function(_0xcd5a2c){if(!_0xcd5a2c){_0x2f77c8['sendStatus'](0x194);}return _0xcd5a2c;};}function handleError(_0x30a9c7,_0xd0ebe1){_0xd0ebe1=_0xd0ebe1||0x1f4;return function(_0xc1ea67){logger[_0xc20d('0x2d')](_0xc1ea67[_0xc20d('0x2e')]);if(_0xc1ea67[_0xc20d('0x2f')]){delete _0xc1ea67[_0xc20d('0x2f')];}_0x30a9c7[_0xc20d('0x20')](_0xd0ebe1)['send'](_0xc1ea67);};}function getInteractionUsers(_0x25878b,_0x1454f7){return new BPromise(function(_0x5c3837,_0x546852){try{if(_0x1454f7[_0x25878b['id']]){_0x25878b['Users']=_['map'](_0x1454f7[_0x25878b['id']],function(_0x3c5a7a){return{'id':_0x3c5a7a['id'],'fullname':_0x3c5a7a['fullname']};});}}catch(_0x2d4501){_0x546852(_0x2d4501);}_0x5c3837(_0x25878b);});}function getInteractionTags(_0x1c6fbd,_0x5b5d52){return new BPromise(function(_0x1bf206,_0x1588db){try{if(_0x1c6fbd[_0xc20d('0x30')]){_0x1c6fbd[_0xc20d('0x31')]=[];_0x1c6fbd[_0xc20d('0x30')]['split'](',')['forEach'](function(_0x54defd){_0x1c6fbd[_0xc20d('0x31')][_0xc20d('0x32')](_0x5b5d52[_0x54defd]);});}delete _0x1c6fbd[_0xc20d('0x30')];}catch(_0x4a86df){_0x1588db(_0x4a86df);}_0x1bf206(_0x1c6fbd);});}function updateFaxInteraction(_0x5aeee7,_0x9294dd,_0x4bc2e7){return new BPromise(function(_0x345ae0,_0x2cb8aa){return getInteractionUsers(_0x5aeee7,_0x4bc2e7)[_0xc20d('0x2b')](function(_0x2325bd){return getInteractionTags(_0x2325bd,_0x9294dd);})[_0xc20d('0x2b')](function(_0x5c0942){return getStateInteraction(_0x5c0942);})[_0xc20d('0x2b')](function(_0x108638){_0x345ae0(_0x108638);})['catch'](function(_0x296fe8){_0x2cb8aa(_0x296fe8);});});}function getStateInteraction(_0x3a867a){return new BPromise(function(_0x4e0c9b){_0x3a867a[_0xc20d('0x33')]=0x0;_0x3a867a[_0xc20d('0x34')]=0x0;_0x3a867a['answered']=0x0;_0x3a867a['unmanaged']=0x0;_0x3a867a[_0xc20d('0x35')]=0x0;if(!_0x3a867a[_0xc20d('0x36')]&&!_0x3a867a['UserId']){_0x3a867a[_0xc20d('0x33')]+=0x1;}if(!_0x3a867a[_0xc20d('0x36')]&&_0x3a867a['UserId']){_0x3a867a[_0xc20d('0x34')]+=0x1;if(_0x3a867a['waiting']){_0x3a867a['waiting']-=0x1;}}if(_0x3a867a[_0xc20d('0x36')]&&_0x3a867a[_0xc20d('0x37')]){_0x3a867a[_0xc20d('0x38')]+=0x1;if(_0x3a867a['talking']){_0x3a867a[_0xc20d('0x34')]-=0x1;}}if(_0x3a867a[_0xc20d('0x36')]&&!_0x3a867a[_0xc20d('0x37')]){_0x3a867a[_0xc20d('0x39')]+=0x1;if(_0x3a867a[_0xc20d('0x33')]){_0x3a867a[_0xc20d('0x33')]-=0x1;}}_0x3a867a[_0xc20d('0x35')]+=0x1;_0x4e0c9b(_0x3a867a);});}exports[_0xc20d('0x3a')]=function(_0x1cb344,_0x26a8ee){var _0x3faa16={},_0x1613ca={},_0x530cc1={'count':0x0,'rows':[]};var _0x588490=_[_0xc20d('0x3b')](db['FaxInteraction'][_0xc20d('0x3c')],function(_0x28a3f7){return{'name':_0x28a3f7['fieldName'],'type':_0x28a3f7['type'][_0xc20d('0x3d')]};});_0x1613ca['model']=_[_0xc20d('0x3b')](_0x588490,_0xc20d('0x2f'));_0x1613ca['query']=_['keys'](_0x1cb344[_0xc20d('0x3e')]);_0x1613ca[_0xc20d('0x3f')]=_[_0xc20d('0x40')](_0x1613ca[_0xc20d('0x41')],_0x1613ca[_0xc20d('0x3e')]);_0x3faa16[_0xc20d('0x42')]=_[_0xc20d('0x40')](_0x1613ca[_0xc20d('0x41')],qs[_0xc20d('0x43')](_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x43')]));_0x3faa16[_0xc20d('0x42')]=_0x3faa16['attributes'][_0xc20d('0x44')]?_0x3faa16[_0xc20d('0x42')]:_0x1613ca[_0xc20d('0x41')];if(!_0x1cb344[_0xc20d('0x3e')]['hasOwnProperty'](_0xc20d('0x45'))){_0x3faa16[_0xc20d('0x25')]=qs[_0xc20d('0x25')](_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x25')]);_0x3faa16[_0xc20d('0x22')]=qs['offset'](_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x22')]);}_0x3faa16[_0xc20d('0x46')]=qs['sort'](_0x1cb344[_0xc20d('0x3e')]['sort']);_0x3faa16['where']=qs[_0xc20d('0x3f')](_[_0xc20d('0x47')](_0x1cb344[_0xc20d('0x3e')],_0x1613ca[_0xc20d('0x3f')]),_0x588490);var _0x548e06=[];var _0x407e93=squel[_0xc20d('0x48')]()['field']('id')['field']('name')['field'](_0xc20d('0x49'))['from'](_0xc20d('0x4a'));var _0x2ba88f=squel[_0xc20d('0x48')]()[_0xc20d('0x4b')](_0xc20d('0x4c'))[_0xc20d('0x4b')]('u.fullname')[_0xc20d('0x4b')](_0xc20d('0x4d'))['from'](_0xc20d('0x4e'),'ui')[_0xc20d('0x4f')](_0xc20d('0x50'),'u',_0xc20d('0x51'));var _0x1c00bf=squel[_0xc20d('0x48')]()[_0xc20d('0x52')](_0xc20d('0x53'),'i')[_0xc20d('0x4f')](_0xc20d('0x54'),'c',_0xc20d('0x55'))[_0xc20d('0x4f')](_0xc20d('0x50'),'o','o.id\x20=\x20i.UserId')[_0xc20d('0x4f')]('fax_accounts','a',_0xc20d('0x56'))[_0xc20d('0x4f')](_0xc20d('0x57'),'me',_0xc20d('0x58'))['left_join'](_0xc20d('0x59'),'it',_0xc20d('0x5a'))[_0xc20d('0x4f')](_0xc20d('0x4a'),'t',_0xc20d('0x5b'));var _0x46a219=squel[_0xc20d('0x5c')]();var _0x20b7ed=[];var _0x1cfd5e=squel[_0xc20d('0x5c')]();var _0x261d68;if(_0x1cb344['query'][_0xc20d('0x5d')]){_0x261d68=as['parseSearch'](_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x5d')]);var _0xbe82ce=_0x261d68['sqlOperator'];for(var _0x4ee6dd=0x0;_0x4ee6dd<_0x261d68['conditions'][_0xc20d('0x44')];_0x4ee6dd++){var _0x5d5d75=_0x261d68[_0xc20d('0x5e')][_0x4ee6dd];var _0x4b8f50='i';var _0x4738f9=_['find'](_0x588490,[_0xc20d('0x2f'),_0x5d5d75[_0xc20d('0x4b')]]);if(!_0x4738f9){switch(_0x5d5d75[_0xc20d('0x4b')]){case'unreadMessages':if(_0x5d5d75['value']==0x1){_0x1c00bf[_0xc20d('0x5f')]('`'+_0x5d5d75[_0xc20d('0x4b')]+_0xc20d('0x60'));}else{_0x1c00bf[_0xc20d('0x5f')]('`'+_0x5d5d75[_0xc20d('0x4b')]+'`\x20>\x200');}break;case'Contact':if(_0x5d5d75[_0xc20d('0x61')]===_0xc20d('0x62')){if(_0x5d5d75[_0xc20d('0x63')][_0xc20d('0x64')]('\x20')[_0xc20d('0x44')]>0x1){_0x46a219[_0xbe82ce]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc20d('0x65')](_0x5d5d75[_0xc20d('0x63')]),null);}else{var _0x5b75f2='%'+_0x5d5d75[_0xc20d('0x63')]+'%';_0x46a219[_0xbe82ce](_0xc20d('0x66'),_0x5b75f2,_0x5b75f2,_0x5b75f2);}}else{_0x4738f9=_['find'](_0x588490,[_0xc20d('0x2f'),_0xc20d('0x67')]);_0x5d5d75[_0xc20d('0x4b')]='ContactId';_0x275c61=as[_0xc20d('0x68')](_0x4b8f50,_0x4738f9[_0xc20d('0x69')],_0x5d5d75);_0x46a219[_0xbe82ce](_0x275c61['text'],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6a')],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6b')]);}break;case _0xc20d('0x6c'):var _0x47b680=_0x5d5d75[_0xc20d('0x63')][_0xc20d('0x64')](',')[_0xc20d('0x3b')](function(_0x35b2cb){return Number(_0x35b2cb);});_0x47b680[_0xc20d('0x6d')](function(_0xec4274){_0x1cfd5e['or'](_0xc20d('0x6e'),'%,'+_0xec4274+',%');});_0x20b7ed=_[_0xc20d('0x6f')](_0x20b7ed,_0x47b680);break;case _0xc20d('0x70'):if(_0x5d5d75[_0xc20d('0x61')]==='$substring'){_0x46a219[_0xbe82ce](_0xc20d('0x71'),'%'+_0x5d5d75[_0xc20d('0x63')]+'%',null);}else{_0x4738f9=_[_0xc20d('0x72')](_0x588490,[_0xc20d('0x2f'),_0xc20d('0x37')]);_0x5d5d75[_0xc20d('0x4b')]=_0xc20d('0x37');_0x275c61=as['buildExpression'](_0x4b8f50,_0x4738f9[_0xc20d('0x69')],_0x5d5d75);_0x46a219[_0xbe82ce](_0x275c61[_0xc20d('0x73')],_0x275c61['value']['start'],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6b')]);}break;case'body':_0x275c61=as[_0xc20d('0x68')]('me',null,_0x5d5d75);_0x46a219[_0xbe82ce](_0x275c61['text'],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6a')],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6b')]);break;}}else{var _0x275c61=as[_0xc20d('0x68')](_0x4b8f50,_0x4738f9[_0xc20d('0x69')],_0x5d5d75);_0x46a219[_0xbe82ce](_0x275c61[_0xc20d('0x73')],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6a')],_0x275c61[_0xc20d('0x63')][_0xc20d('0x6b')]);}}}else{var _0x4f456e=_(_0x1cb344[_0xc20d('0x3e')])['keys']()[_0xc20d('0x3b')](function(_0x19124e){return _[_0xc20d('0x74')](_0x588490,[_0xc20d('0x2f'),_0x19124e])?_0x19124e:undefined;})[_0xc20d('0x75')]()['value']();if(!_['isEmpty'](_0x4f456e)){_0x4f456e[_0xc20d('0x6d')](function(_0x6ed435){if(_0x6ed435===_0xc20d('0x76')){_0x1c00bf[_0xc20d('0x77')](_0xc20d('0x78'),[][_0xc20d('0x79')](_0x1cb344[_0xc20d('0x3e')][_0x6ed435]));}else if(_0x6ed435==='createdAt'){var _0x4785a0=JSON['parse'](_0x1cb344[_0xc20d('0x3e')][_0x6ed435])[_0xc20d('0x7a')];var _0x54f98d=JSON[_0xc20d('0x7b')](_0x1cb344[_0xc20d('0x3e')][_0x6ed435])['$lte'];_0x1c00bf[_0xc20d('0x77')](_0xc20d('0x7c'),_0x4785a0,_0x54f98d);}else{if(_0x1cb344[_0xc20d('0x3e')][_0x6ed435]===_0xc20d('0x7d')){_0x1c00bf['where']('i.'+_0x6ed435+_0xc20d('0x7e'));}else{_0x1c00bf[_0xc20d('0x77')]('i.'+_0x6ed435+_0xc20d('0x7f'),_0x1cb344[_0xc20d('0x3e')][_0x6ed435]);}}});}if(_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x80')]){if(_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x80')]==0x1){_0x1c00bf['having'](_0xc20d('0x81'));}else{_0x1c00bf['having'](_0xc20d('0x82'));}}if(_0x1cb344['query'][_0xc20d('0x83')]){_0x20b7ed=_[_0xc20d('0x84')](_0x1cb344['query'][_0xc20d('0x83')])?_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x83')]:new Array(_0x1cb344['query'][_0xc20d('0x83')]);_0x20b7ed[_0xc20d('0x6d')](function(_0xb7b07){_0x1cfd5e['or'](_0xc20d('0x6e'),'%,'+_0xb7b07+',%');});}if(_0x1cb344['query']['filter']){var _0x5ba996=_0x1cb344[_0xc20d('0x3e')]['filter'][_0xc20d('0x85')]('\x5c','\x5c\x5c')[_0xc20d('0x85')](/'/g,'\x27\x27');if(qs[_0xc20d('0x86')](_0x5ba996)){_0x46a219['or'](_0xc20d('0x87'),_0x5ba996+'%')['or'](_0xc20d('0x88'),_0x5ba996+'%');}_0x46a219['or'](_0xc20d('0x89'),_0x5ba996+'%');}}_0x1c00bf[_0xc20d('0x77')](_0x46a219);_0x1c00bf[_0xc20d('0x8a')](_0xc20d('0x8b'));var _0x56a557={'type':db[_0xc20d('0x8c')][_0xc20d('0x8d')]['SELECT'],'raw':!![]};var _0x45450b=_0x1c00bf[_0xc20d('0x8e')]();_0x45450b['field'](_0xc20d('0x8b'));_0x45450b[_0xc20d('0x4b')](_0xc20d('0x8f'),'unreadMessages');if(_0x3faa16['order']){_0x3faa16[_0xc20d('0x46')][_0xc20d('0x6d')](function(_0x25d778){var _0x409703=_0x25d778[0x0]==='contactName'?_0x25d778[0x0]:'i.'+_0x25d778[0x0];_0x1c00bf['order'](_0x409703,_0x25d778[0x1]===_0xc20d('0x90')?![]:!![]);});}if(!_[_0xc20d('0x91')](_0x20b7ed)){_0x1c00bf[_0xc20d('0x5f')](_0x1cfd5e);_0x45450b[_0xc20d('0x77')](_0xc20d('0x92'),_0x20b7ed);}BPromise[_0xc20d('0x93')]()[_0xc20d('0x2b')](function(){if(!_0x261d68){if(_0x1cb344[_0xc20d('0x3e')]['FaxAccountId'])return;_0x45450b[_0xc20d('0x77')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1c00bf[_0xc20d('0x77')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1cb344[_0xc20d('0x94')][_0xc20d('0x95')]!==_0xc20d('0x96'))return;return _0x1cb344[_0xc20d('0x94')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xc20d('0x2b')](function(_0x30afdf){if(_[_0xc20d('0x91')](_0x30afdf)){_0x45450b[_0xc20d('0x77')](_0xc20d('0x97'));_0x1c00bf[_0xc20d('0x77')](_0xc20d('0x97'));}else{_0x45450b[_0xc20d('0x77')](_0xc20d('0x78'),_[_0xc20d('0x3b')](_0x30afdf,'id'));_0x1c00bf['where']('i.FaxAccountId\x20IN\x20?',_[_0xc20d('0x3b')](_0x30afdf,'id'));}});})[_0xc20d('0x2b')](function(){if(_0x1cb344['user'][_0xc20d('0x95')]===_0xc20d('0x96')&&!_0x261d68&&!_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x76')])return[];return db[_0xc20d('0x98')][_0xc20d('0x3e')](_0x45450b['toString'](),_0x56a557);})['then'](function(_0x2944b0){_0x530cc1[_0xc20d('0x24')]=_0x2944b0[_0xc20d('0x44')];if(_0x530cc1[_0xc20d('0x24')]===0x0)return[];return db[_0xc20d('0x98')]['query'](_0x407e93[_0xc20d('0x99')](),_0x56a557)[_0xc20d('0x2b')](function(_0x4d3371){_0x548e06=_[_0xc20d('0x9a')](_0x4d3371,'id');_0x56a557=_[_0xc20d('0x9b')](_0x56a557,{'model':db[_0xc20d('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1cb344[_0xc20d('0x3e')][_0xc20d('0x43')]){_0x3faa16[_0xc20d('0x42')][_0xc20d('0x6d')](function(_0x38819d){_0x1c00bf[_0xc20d('0x4b')]('i.'+_0x38819d);});}else{_0x1c00bf[_0xc20d('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc20d('0x9d'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0x9e'),'Account.key');_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0x9f'),'Account.mandatoryDisposition');_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa0'),_0xc20d('0xa1'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa2'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa3'),_0xc20d('0xa4'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa5'),'Contact.lastName');_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa6'),_0xc20d('0xa7'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xa8'),_0xc20d('0xa9'));_0x1c00bf['field']('c.mobile',_0xc20d('0xaa'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xab'),_0xc20d('0xac'));_0x1c00bf['field'](_0xc20d('0xad'),_0xc20d('0xae'));_0x1c00bf[_0xc20d('0x4b')](_0xc20d('0xaf'),_0xc20d('0xb0'));_0x1c00bf['field'](_0xc20d('0xb1'),_0xc20d('0x30'));}if(_0x3faa16[_0xc20d('0x25')])_0x1c00bf[_0xc20d('0x25')](_0x3faa16[_0xc20d('0x25')]);if(_0x3faa16[_0xc20d('0x22')])_0x1c00bf[_0xc20d('0x22')](_0x3faa16[_0xc20d('0x22')]);return db[_0xc20d('0x98')][_0xc20d('0x3e')](_0x1c00bf[_0xc20d('0x99')](),_0x56a557);})['then'](function(_0x308c41){if(_0x308c41['length']>0x0)_0x2ba88f[_0xc20d('0x77')](_0xc20d('0xb2'),_[_0xc20d('0x3b')](_0x308c41,'id'));return db[_0xc20d('0x98')][_0xc20d('0x3e')](_0x2ba88f[_0xc20d('0x99')](),_0x56a557)[_0xc20d('0x2b')](function(_0x433176){var _0x1a16d5=_['groupBy'](_0x433176,_0xc20d('0xb3'));var _0x5d67d4=[];_0x308c41[_0xc20d('0x6d')](function(_0x3e6558){_0x5d67d4[_0xc20d('0x32')](updateFaxInteraction(_0x3e6558,_0x548e06,_0x1a16d5));});return BPromise[_0xc20d('0xb4')](_0x5d67d4);});});})['then'](function(_0x9be47){_0x530cc1[_0xc20d('0xb5')]=_0x9be47;return _0x530cc1;})[_0xc20d('0x2b')](respondWithFilteredResult(_0x26a8ee,_0x3faa16))[_0xc20d('0xb6')](handleError(_0x26a8ee,null));};exports[_0xc20d('0xb7')]=function(_0x41dcc6,_0x1173d6){var _0x108ae6={'raw':![],'where':{'id':_0x41dcc6['params']['id']}},_0x32dc69={};_0x32dc69['model']=_[_0xc20d('0xb8')](db[_0xc20d('0x9c')]['rawAttributes']);_0x32dc69['query']=_[_0xc20d('0xb8')](_0x41dcc6[_0xc20d('0x3e')]);_0x32dc69[_0xc20d('0x3f')]=_['intersection'](_0x32dc69['model'],_0x32dc69[_0xc20d('0x3e')]);_0x108ae6['attributes']=_[_0xc20d('0x40')](_0x32dc69[_0xc20d('0x41')],qs[_0xc20d('0x43')](_0x41dcc6['query']['fields']));_0x108ae6['attributes']=_0x108ae6[_0xc20d('0x42')][_0xc20d('0x44')]?_0x108ae6[_0xc20d('0x42')]:_0x32dc69[_0xc20d('0x41')];if(_0x41dcc6[_0xc20d('0x3e')][_0xc20d('0xb9')]){_0x108ae6['include']=[{'all':!![]}];}_0x108ae6=_[_0xc20d('0x9b')]({},_0x108ae6,_0x41dcc6[_0xc20d('0xba')]);return db['FaxInteraction'][_0xc20d('0x72')](_0x108ae6)['then'](handleEntityNotFound(_0x1173d6,null))[_0xc20d('0x2b')](respondWithResult(_0x1173d6,null))[_0xc20d('0xb6')](handleError(_0x1173d6,null));};exports['create']=function(_0x45e56e,_0x51905c){return db['FaxInteraction']['create'](_0x45e56e['body'],{})['then'](respondWithResult(_0x51905c,0xc9))[_0xc20d('0xb6')](handleError(_0x51905c,null));};exports[_0xc20d('0x2a')]=function(_0x2694e5,_0x4f8b11){if(_0x2694e5['body']['id']){delete _0x2694e5['body']['id'];}return db[_0xc20d('0x9c')][_0xc20d('0x72')]({'where':{'id':_0x2694e5[_0xc20d('0xbb')]['id']}})['then'](handleEntityNotFound(_0x4f8b11,null))[_0xc20d('0x2b')](saveUpdates(_0x2694e5['body'],null))[_0xc20d('0x2b')](respondWithResult(_0x4f8b11,null))[_0xc20d('0xb6')](handleError(_0x4f8b11,null));};exports[_0xc20d('0x2c')]=function(_0x1f071d,_0x1b375f){return db[_0xc20d('0x9c')][_0xc20d('0x72')]({'where':{'id':_0x1f071d['params']['id']}})[_0xc20d('0x2b')](handleEntityNotFound(_0x1b375f,null))[_0xc20d('0x2b')](removeEntity(_0x1b375f,null))['catch'](handleError(_0x1b375f,null));};exports[_0xc20d('0xbc')]=function(_0x1645c2,_0x4aa8c1){return db[_0xc20d('0x9c')][_0xc20d('0xbc')]()[_0xc20d('0x2b')](respondWithResult(_0x4aa8c1,null))[_0xc20d('0xb6')](handleError(_0x4aa8c1,null));};exports[_0xc20d('0xbd')]=function(_0x28cbf1,_0x2b7d36,_0x48ce99){return db[_0xc20d('0xbe')][_0xc20d('0x72')]({'where':{'id':_0x28cbf1[_0xc20d('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2b7d36,null))['then'](function(_0x1d44cc){if(_0x1d44cc){return _0x1d44cc['addMessage'](_0x28cbf1[_0xc20d('0xbf')][_0xc20d('0xc0')],_[_0xc20d('0xc1')](_0x28cbf1['body'],[_0xc20d('0xc0'),'id'])||{});}})[_0xc20d('0x2b')](respondWithResult(_0x2b7d36,null))[_0xc20d('0xb6')](handleError(_0x2b7d36,null));};exports[_0xc20d('0xc2')]=function(_0x80a19f,_0x450c76,_0x54f176){var _0x372737={'raw':![],'where':{}};var _0xa2fd80={};var _0x1783f1={'count':0x0,'rows':[]};return db[_0xc20d('0x9c')][_0xc20d('0xc3')]({'where':{'id':_0x80a19f[_0xc20d('0xbb')]['id']}})[_0xc20d('0x2b')](handleEntityNotFound(_0x450c76,null))['then'](function(_0x39499d){if(_0x39499d){_0xa2fd80[_0xc20d('0x41')]=_[_0xc20d('0xb8')](db[_0xc20d('0xbe')][_0xc20d('0x3c')]);_0xa2fd80[_0xc20d('0x3e')]=_['keys'](_0x80a19f[_0xc20d('0x3e')]);_0xa2fd80[_0xc20d('0x3f')]=_[_0xc20d('0x40')](_0xa2fd80[_0xc20d('0x41')],_0xa2fd80[_0xc20d('0x3e')]);_0x372737['attributes']=_[_0xc20d('0x40')](_0xa2fd80[_0xc20d('0x41')],qs['fields'](_0x80a19f['query'][_0xc20d('0x43')]));_0x372737[_0xc20d('0x42')]=_0x372737[_0xc20d('0x42')][_0xc20d('0x44')]?_0x372737[_0xc20d('0x42')]:_0xa2fd80[_0xc20d('0x41')];if(!_0x80a19f[_0xc20d('0x3e')][_0xc20d('0xc4')](_0xc20d('0x45'))){_0x372737[_0xc20d('0x25')]=qs[_0xc20d('0x25')](_0x80a19f['query'][_0xc20d('0x25')]);_0x372737[_0xc20d('0x22')]=qs[_0xc20d('0x22')](_0x80a19f['query'][_0xc20d('0x22')]);}_0x372737['order']=qs[_0xc20d('0xc5')](_0x80a19f[_0xc20d('0x3e')][_0xc20d('0xc5')]);_0x372737[_0xc20d('0x77')]=qs[_0xc20d('0x3f')](_[_0xc20d('0x47')](_0x80a19f[_0xc20d('0x3e')],_0xa2fd80[_0xc20d('0x3f')]));_0x372737['where'][_0xc20d('0xb3')]=_0x39499d['id'];if(_0x80a19f[_0xc20d('0x3e')][_0xc20d('0xc6')]){_0x372737[_0xc20d('0x77')]=_[_0xc20d('0x9b')](_0x372737['where'],{'$or':_['map'](_0x372737[_0xc20d('0x42')],function(_0x5f2a91){var _0x4ad3c5={};_0x4ad3c5[_0x5f2a91]={'$like':'%'+_0x80a19f['query'][_0xc20d('0xc6')]+'%'};return _0x4ad3c5;})});}if(_0x80a19f[_0xc20d('0x3e')][_0xc20d('0x7a')]){var _0xd79fdd=_0x80a19f[_0xc20d('0x3e')][_0xc20d('0x7a')][_0xc20d('0x64')](',');var _0x5583b3={};_0x5583b3[_0xd79fdd[0x0]]={'$gte':moment(_0xd79fdd[0x1])[_0xc20d('0xc7')](_0xc20d('0xc8'))};_0x372737[_0xc20d('0x77')]=_['merge'](_0x372737[_0xc20d('0x77')],_0x5583b3);}_0x372737=_[_0xc20d('0x9b')]({},_0x372737,_0x80a19f[_0xc20d('0xba')]);return db[_0xc20d('0xbe')][_0xc20d('0x24')]({'where':_0x372737['where']})[_0xc20d('0x2b')](function(_0x5d9904){_0x1783f1['count']=_0x5d9904;if(_0x80a19f['query'][_0xc20d('0xb9')]){_0x372737[_0xc20d('0xc9')]=[{'all':!![]}];}return db[_0xc20d('0xbe')][_0xc20d('0xca')](_0x372737);})['then'](function(_0x1d6a8e){_0x1783f1['rows']=_0x1d6a8e;return _0x1783f1;});}})[_0xc20d('0x2b')](respondWithFilteredResult(_0x450c76,_0x372737))[_0xc20d('0xb6')](handleError(_0x450c76,null));};exports[_0xc20d('0xcb')]=function(_0x18a6ec,_0x3d8f4a,_0x1b3bf2){return db[_0xc20d('0x9c')]['find']({'where':{'id':_0x18a6ec['params']['id']}})[_0xc20d('0x2b')](handleEntityNotFound(_0x3d8f4a,null))[_0xc20d('0x2b')](function(_0x2ad6ac){if(_0x2ad6ac){return _0x2ad6ac[_0xc20d('0xcc')](_0x18a6ec[_0xc20d('0xbf')][_0xc20d('0xc0')],_[_0xc20d('0xc1')](_0x18a6ec['body'],['ids','id'])||{})[_0xc20d('0xcd')](function(){return db[_0xc20d('0x6c')]['findAll']({'attributes':['id','name',_0xc20d('0x49')],'where':{'id':_0x18a6ec[_0xc20d('0xbf')][_0xc20d('0xc0')]}});})[_0xc20d('0x2b')](function(_0x2cd9ce){socket['emit'](_0xc20d('0xce'),{'id':Number(_0x18a6ec[_0xc20d('0xbb')]['id']),'tags':_0x2cd9ce||[]});return{'id':Number(_0x18a6ec[_0xc20d('0xbb')]['id']),'tags':_0x2cd9ce||[]};});}})[_0xc20d('0x2b')](respondWithResult(_0x3d8f4a,null))[_0xc20d('0xb6')](handleError(_0x3d8f4a,null));};exports[_0xc20d('0xcf')]=function(_0x2a25b9,_0x2e3b2f,_0x15a27c){return db[_0xc20d('0x9c')][_0xc20d('0x72')]({'where':{'id':_0x2a25b9[_0xc20d('0xbb')]['id']}})[_0xc20d('0x2b')](handleEntityNotFound(_0x2e3b2f,null))['then'](function(_0x31381a){if(_0x31381a){return _0x31381a[_0xc20d('0xcf')](_0x2a25b9['query'][_0xc20d('0xc0')]);}})[_0xc20d('0x2b')](respondWithStatusCode(_0x2e3b2f,null))[_0xc20d('0xb6')](handleError(_0x2e3b2f,null));};exports[_0xc20d('0xd0')]=function(_0x529386,_0x279048){var _0x229344=moment()[_0xc20d('0xd1')]()['toString']();var _0x39be3d=path['join'](config[_0xc20d('0xd2')],_0xc20d('0xd3'),_0xc20d('0xd4'),_0xc20d('0xd5'));var _0x47960=path[_0xc20d('0xd6')](config[_0xc20d('0xd2')],_0xc20d('0xd3'),_0xc20d('0xd4'),_0xc20d('0xd7'));var _0x50cd54=path['join'](_0x39be3d,_0x229344);var _0x4b3019=util[_0xc20d('0xc7')](_0xc20d('0xd8'),_0x529386[_0xc20d('0xbb')]['id'],_0x229344);var _0x1b48c8=path['join'](_0x39be3d,_0x4b3019);var _0x269ee2=[];_0x269ee2[_0xc20d('0x32')]({'model':db['Attachment'],'as':_0xc20d('0xd9'),'raw':!![]});var _0x134bb7=[{'model':db[_0xc20d('0xbe')],'as':_0xc20d('0xda'),'attributes':['id','body',_0xc20d('0xdb')],'include':_0x269ee2}];return db['FaxInteraction']['find']({'where':{'id':_0x529386['params']['id']},'include':_0x134bb7})['then'](handleEntityNotFound(_0x279048,null))['then'](function(_0x536e9b){if(_0x536e9b&&_0x536e9b[_0xc20d('0xda')]){var _0x347c28=_0x536e9b[_0xc20d('0xdc')]({'plain':!![]});fs[_0xc20d('0xdd')](_0x50cd54);for(var _0x559f6a=0x0;_0x559f6a<_0x347c28[_0xc20d('0xda')][_0xc20d('0x44')];_0x559f6a++){var _0x44671d=_0x347c28[_0xc20d('0xda')][_0x559f6a]['Attachment'];if(_0x44671d){var _0x3ec727=path[_0xc20d('0xd6')](_0x47960,_0x44671d[_0xc20d('0xde')]);if(fs[_0xc20d('0xdf')](_0x3ec727)){fs['createReadStream'](_0x3ec727)[_0xc20d('0xe0')](fs[_0xc20d('0xe1')](path[_0xc20d('0xd6')](_0x50cd54,_0x44671d[_0xc20d('0xde')])));}}}return BPromise[_0xc20d('0x93')]()[_0xc20d('0x2b')](function(){return new BPromise(function(_0x32cfdf,_0x4b05e2){zipdir(_0x50cd54,{'saveTo':_0x1b48c8},function(_0x596504,_0x35215a){if(_0x596504)return _0x4b05e2(_0x596504);return _0x32cfdf(_0x35215a);});})[_0xc20d('0x2b')](function(){return new BPromise(function(_0x887c8f,_0x182768){rimraf(_0x50cd54,function(_0x452aa6){if(_0x452aa6)_0x182768(_0x452aa6);return _0x887c8f();});});})[_0xc20d('0x2b')](function(){return _0x279048[_0xc20d('0xd0')](_0x1b48c8,_0x4b3019,function(_0x1f0f79){if(_0x1f0f79){console[_0xc20d('0xe2')](_0xc20d('0xe3'),_0x1f0f79);}else{fs[_0xc20d('0xe4')](_0x1b48c8);}});});});}else{return _0x279048[_0xc20d('0x1f')](0xc8);}})[_0xc20d('0xb6')](handleError(_0x279048,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8dbfd41..4ee6756 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed07=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x4754b9,_0x50664f){var _0x2fec82=function(_0x3ad416){while(--_0x3ad416){_0x4754b9['push'](_0x4754b9['shift']());}};_0x2fec82(++_0x50664f);}(_0xed07,0x14f));var _0x7ed0=function(_0x27e91c,_0xfcf5da){_0x27e91c=_0x27e91c-0x0;var _0x126cea=_0xed07[_0x27e91c];return _0x126cea;};'use strict';var EventEmitter=require(_0x7ed0('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x7ed0('0x1'))['db'][_0x7ed0('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7ed0('0x3')](0x0);var events={'afterCreate':_0x7ed0('0x4'),'afterUpdate':_0x7ed0('0x5'),'afterDestroy':_0x7ed0('0x6')};function emitEvent(_0x105e82){return function(_0xbeb7cb,_0x1d1390,_0x3f04b8){_0xbeb7cb[_0x7ed0('0x7')]({'attributes':['id'],'raw':!![]})[_0x7ed0('0x8')](function(_0x43b315){_0xbeb7cb[_0x7ed0('0x9')]('Users',_0x43b315['map'](function(_0x11198a){return{'id':_0x11198a['id']};}));return FaxMessage[_0x7ed0('0xa')]({'where':{'FaxInteractionId':_0xbeb7cb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7ed0('0x8')](function(_0x164baa){_0xbeb7cb[_0x7ed0('0x9')](_0x7ed0('0xb'),_0x164baa[_0x7ed0('0xc')]);FaxInteractionEvents[_0x7ed0('0xd')](_0x105e82+':'+_0xbeb7cb['id'],_0xbeb7cb);FaxInteractionEvents[_0x7ed0('0xd')](_0x105e82,_0xbeb7cb);_0x3f04b8(null);})['catch'](_0x3f04b8(null));};}for(var e in events){if(events[_0x7ed0('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7ed0('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x5285=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5285,0x175));var _0x5528=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x5285[_0x343090];return _0x3ff3e8;};'use strict';var EventEmitter=require(_0x5528('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x5528('0x1'))['db'][_0x5528('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5528('0x3')](0x0);var events={'afterCreate':_0x5528('0x4'),'afterUpdate':_0x5528('0x5'),'afterDestroy':_0x5528('0x6')};function emitEvent(_0x3e808b){return function(_0x2511ff,_0x48e7b2,_0x373e1){_0x2511ff['getUsers']({'attributes':['id'],'raw':!![]})[_0x5528('0x7')](function(_0x5c0bf7){_0x2511ff[_0x5528('0x8')](_0x5528('0x9'),_0x5c0bf7[_0x5528('0xa')](function(_0x346c53){return{'id':_0x346c53['id']};}));return FaxMessage[_0x5528('0xb')]({'where':{'FaxInteractionId':_0x2511ff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a2357){_0x2511ff[_0x5528('0x8')]('unreadMessages',_0x2a2357[_0x5528('0xc')]);FaxInteractionEvents[_0x5528('0xd')](_0x3e808b+':'+_0x2511ff['id'],_0x2511ff);FaxInteractionEvents[_0x5528('0xd')](_0x3e808b,_0x2511ff);_0x373e1(null);})['catch'](_0x373e1(null));};}for(var e in events){if(events[_0x5528('0xe')](e)){var event=events[e];FaxInteraction[_0x5528('0xf')](e,emitEvent(event));}}module[_0x5528('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index cd5115b..386d6f9 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58b6=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x20670a,_0x28e7d0){var _0x2f0ab8=function(_0x57e5cb){while(--_0x57e5cb){_0x20670a['push'](_0x20670a['shift']());}};_0x2f0ab8(++_0x28e7d0);}(_0x58b6,0x103));var _0x658b=function(_0x29ab0e,_0x5dfe22){_0x29ab0e=_0x29ab0e-0x0;var _0x29303a=_0x58b6[_0x29ab0e];return _0x29303a;};'use strict';var _=require(_0x658b('0x0'));var util=require(_0x658b('0x1'));var logger=require(_0x658b('0x2'))(_0x658b('0x3'));var moment=require(_0x658b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x658b('0x5'));var rimraf=require(_0x658b('0x6'));var config=require(_0x658b('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x658b('0x8')]=function(_0x3605bf,_0x3efa4a){return _0x3605bf[_0x658b('0x9')](_0x658b('0xa'),attributes,{'tableName':_0x658b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x513344,_0x27d721,_0x5bcda5){if(_0x513344[_0x658b('0xc')](_0x658b('0xd'))){_0x513344['closedAt']=moment()[_0x658b('0xe')](_0x658b('0xf'));}_0x5bcda5(null,_0x513344);}}});}; \ No newline at end of file +var _0xb1a6=['../../config/environment','./faxInteraction.attributes','define','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x451309,_0x494b21){var _0x330ab3=function(_0x2861ef){while(--_0x2861ef){_0x451309['push'](_0x451309['shift']());}};_0x330ab3(++_0x494b21);}(_0xb1a6,0x143));var _0x6b1a=function(_0xea6c44,_0xe4391f){_0xea6c44=_0xea6c44-0x0;var _0x4e3051=_0xb1a6[_0xea6c44];return _0x4e3051;};'use strict';var _=require(_0x6b1a('0x0'));var util=require(_0x6b1a('0x1'));var logger=require(_0x6b1a('0x2'))('api');var moment=require(_0x6b1a('0x3'));var BPromise=require(_0x6b1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b1a('0x5'));var rimraf=require(_0x6b1a('0x6'));var config=require(_0x6b1a('0x7'));var attributes=require(_0x6b1a('0x8'));module['exports']=function(_0x3ac112,_0x8b9422){return _0x3ac112[_0x6b1a('0x9')]('FaxInteraction',attributes,{'tableName':_0x6b1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c89df,_0x652a97,_0x470e9d){if(_0x1c89df['changed'](_0x6b1a('0xb'))){_0x1c89df[_0x6b1a('0xc')]=moment()[_0x6b1a('0xd')](_0x6b1a('0xe'));}_0x470e9d(null,_0x1c89df);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1033c62..729e14c 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x268b=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateFaxInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','AddTags','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x268b,0x1f3));var _0xb268=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0x268b[_0xec034];return _0x2c5a19;};'use strict';var _=require('lodash');var util=require(_0xb268('0x0'));var moment=require('moment');var BPromise=require(_0xb268('0x1'));var rs=require(_0xb268('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb268('0x3'))['db'];var utils=require(_0xb268('0x4'));var logger=require('../../config/logger')(_0xb268('0x5'));var config=require(_0xb268('0x6'));var jayson=require(_0xb268('0x7'));var client=jayson[_0xb268('0x8')][_0xb268('0x9')]({'port':0x232a});config[_0xb268('0xa')]=_[_0xb268('0xb')](config['redis'],{'host':_0xb268('0xc'),'port':0x18eb});var socket=require(_0xb268('0xd'))(new Redis(config[_0xb268('0xa')]));require('./faxInteraction.socket')[_0xb268('0xe')](socket);function respondWithRpcPromise(_0x4016c9,_0x2bf38c,_0x7346d5){return new BPromise(function(_0x3d82be,_0x3085c0){return client[_0xb268('0xf')](_0x4016c9,_0x7346d5)[_0xb268('0x10')](function(_0x20ec52){logger[_0xb268('0x11')](_0xb268('0x12'),_0x2bf38c,_0xb268('0x13'));logger[_0xb268('0x14')](_0xb268('0x15'),_0x2bf38c,'request\x20sent',JSON['stringify'](_0x20ec52));if(_0x20ec52[_0xb268('0x16')]){if(_0x20ec52[_0xb268('0x16')]['code']===0x1f4){logger['error'](_0xb268('0x12'),_0x2bf38c,_0x20ec52[_0xb268('0x16')][_0xb268('0x17')]);return _0x3085c0(_0x20ec52[_0xb268('0x16')][_0xb268('0x17')]);}logger[_0xb268('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x2bf38c,_0x20ec52[_0xb268('0x16')][_0xb268('0x17')]);return _0x3d82be(_0x20ec52[_0xb268('0x16')][_0xb268('0x17')]);}else{logger[_0xb268('0x11')](_0xb268('0x12'),_0x2bf38c,_0xb268('0x13'));_0x3d82be(_0x20ec52['result'][_0xb268('0x17')]);}})['catch'](function(_0x5b3bf1){logger[_0xb268('0x16')](_0xb268('0x12'),_0x2bf38c,_0x5b3bf1);_0x3085c0(_0x5b3bf1);});});}exports[_0xb268('0x18')]=function(_0x283509){var _0x1ea5d6=this;return new Promise(function(_0x219e38,_0xd75d8a){return db['FaxInteraction']['update'](_0x283509[_0xb268('0x19')],{'raw':_0x283509[_0xb268('0x1a')]?_0x283509[_0xb268('0x1a')][_0xb268('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x283509[_0xb268('0x1a')]?_0x283509[_0xb268('0x1a')][_0xb268('0x1c')]||null:null,'attributes':_0x283509[_0xb268('0x1a')]?_0x283509[_0xb268('0x1a')][_0xb268('0x1d')]||null:null,'limit':_0x283509[_0xb268('0x1a')]?_0x283509['options'][_0xb268('0x1e')]||null:null})[_0xb268('0x10')](function(_0xfaa4ef){logger[_0xb268('0x11')](_0xb268('0x18'),_0x283509);logger[_0xb268('0x14')]('UpdateFaxInteraction',_0x283509,JSON['stringify'](_0xfaa4ef));_0x219e38(_0xfaa4ef);})[_0xb268('0x1f')](function(_0xb8df6a){logger[_0xb268('0x16')](_0xb268('0x18'),_0xb8df6a[_0xb268('0x17')],_0x283509);_0xd75d8a(_0x1ea5d6[_0xb268('0x16')](0x1f4,_0xb8df6a[_0xb268('0x17')]));});});};exports[_0xb268('0x20')]=function(_0x52c76a){return new Promise(function(_0xcc4b88,_0x4fd56c){return db[_0xb268('0x21')][_0xb268('0x22')]({'where':_0x52c76a[_0xb268('0x1a')]?_0x52c76a[_0xb268('0x1a')][_0xb268('0x1c')]||null:null})[_0xb268('0x10')](function(_0x372922){if(_0x372922){return _0x372922[_0xb268('0x23')](_0x52c76a[_0xb268('0x19')][_0xb268('0x24')],_[_0xb268('0x25')](_0x52c76a[_0xb268('0x19')],['ids','id'])||{});}})['spread'](function(_0x15638a){logger['info'](_0xb268('0x26'),_0x52c76a);logger['debug']('AddTags',_0x52c76a,JSON[_0xb268('0x27')](_0x15638a));_0xcc4b88(_0x15638a);})[_0xb268('0x1f')](function(_0x11b46b){logger[_0xb268('0x16')]('AddTags',_0x11b46b[_0xb268('0x17')],_0x52c76a);_0x4fd56c(_this[_0xb268('0x16')](0x1f4,_0x11b46b[_0xb268('0x17')]));});});}; \ No newline at end of file +var _0x2674=['localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','catch','find','addTags','ids','omit','spread','AddTags','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x15f9c6,_0x4a344e){var _0xe1874e=function(_0x1149f0){while(--_0x1149f0){_0x15f9c6['push'](_0x15f9c6['shift']());}};_0xe1874e(++_0x4a344e);}(_0x2674,0x114));var _0x4267=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2674[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x4267('0x0'));var util=require('util');var moment=require(_0x4267('0x1'));var BPromise=require(_0x4267('0x2'));var rs=require(_0x4267('0x3'));var fs=require('fs');var Redis=require(_0x4267('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4267('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4267('0x6'));var jayson=require(_0x4267('0x7'));var client=jayson[_0x4267('0x8')]['http']({'port':0x232a});config[_0x4267('0x9')]=_[_0x4267('0xa')](config['redis'],{'host':_0x4267('0xb'),'port':0x18eb});var socket=require(_0x4267('0xc'))(new Redis(config[_0x4267('0x9')]));require(_0x4267('0xd'))[_0x4267('0xe')](socket);function respondWithRpcPromise(_0x5b86d0,_0x52b78d,_0x214b80){return new BPromise(function(_0x27b914,_0x406845){return client[_0x4267('0xf')](_0x5b86d0,_0x214b80)[_0x4267('0x10')](function(_0x27e08a){logger[_0x4267('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x52b78d,_0x4267('0x12'));logger['debug'](_0x4267('0x13'),_0x52b78d,_0x4267('0x12'),JSON[_0x4267('0x14')](_0x27e08a));if(_0x27e08a[_0x4267('0x15')]){if(_0x27e08a[_0x4267('0x15')][_0x4267('0x16')]===0x1f4){logger['error'](_0x4267('0x17'),_0x52b78d,_0x27e08a[_0x4267('0x15')][_0x4267('0x18')]);return _0x406845(_0x27e08a[_0x4267('0x15')][_0x4267('0x18')]);}logger[_0x4267('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x52b78d,_0x27e08a[_0x4267('0x15')][_0x4267('0x18')]);return _0x27b914(_0x27e08a[_0x4267('0x15')][_0x4267('0x18')]);}else{logger['info'](_0x4267('0x17'),_0x52b78d,_0x4267('0x12'));_0x27b914(_0x27e08a['result']['message']);}})['catch'](function(_0x3f1b84){logger[_0x4267('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x52b78d,_0x3f1b84);_0x406845(_0x3f1b84);});});}exports[_0x4267('0x19')]=function(_0x531c7d){var _0x14915a=this;return new Promise(function(_0x4eb188,_0x5e4501){return db[_0x4267('0x1a')][_0x4267('0x1b')](_0x531c7d[_0x4267('0x1c')],{'raw':_0x531c7d['options']?_0x531c7d[_0x4267('0x1d')][_0x4267('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531c7d[_0x4267('0x1d')]?_0x531c7d['options'][_0x4267('0x1f')]||null:null,'attributes':_0x531c7d[_0x4267('0x1d')]?_0x531c7d[_0x4267('0x1d')][_0x4267('0x20')]||null:null,'limit':_0x531c7d[_0x4267('0x1d')]?_0x531c7d['options']['limit']||null:null})[_0x4267('0x10')](function(_0x437f40){logger['info'](_0x4267('0x19'),_0x531c7d);logger['debug'](_0x4267('0x19'),_0x531c7d,JSON[_0x4267('0x14')](_0x437f40));_0x4eb188(_0x437f40);})[_0x4267('0x21')](function(_0x5318aa){logger[_0x4267('0x15')](_0x4267('0x19'),_0x5318aa['message'],_0x531c7d);_0x5e4501(_0x14915a[_0x4267('0x15')](0x1f4,_0x5318aa[_0x4267('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x536bd4){return new Promise(function(_0x4095a3,_0x191ac5){return db['FaxInteraction'][_0x4267('0x22')]({'where':_0x536bd4[_0x4267('0x1d')]?_0x536bd4[_0x4267('0x1d')]['where']||null:null})['then'](function(_0x11150b){if(_0x11150b){return _0x11150b[_0x4267('0x23')](_0x536bd4[_0x4267('0x1c')][_0x4267('0x24')],_[_0x4267('0x25')](_0x536bd4[_0x4267('0x1c')],['ids','id'])||{});}})[_0x4267('0x26')](function(_0x34106a){logger['info'](_0x4267('0x27'),_0x536bd4);logger[_0x4267('0x28')](_0x4267('0x27'),_0x536bd4,JSON[_0x4267('0x14')](_0x34106a));_0x4095a3(_0x34106a);})[_0x4267('0x21')](function(_0x414501){logger[_0x4267('0x15')]('AddTags',_0x414501[_0x4267('0x18')],_0x536bd4);_0x191ac5(_this[_0x4267('0x15')](0x1f4,_0x414501[_0x4267('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1edc48d..f2ffc10 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb5f=['remove','removeListener','register','length','faxInteraction:','save'];(function(_0x387354,_0x4ee322){var _0x3cb68e=function(_0x4075ff){while(--_0x4075ff){_0x387354['push'](_0x387354['shift']());}};_0x3cb68e(++_0x4ee322);}(_0xcb5f,0x1cd));var _0xfcb5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcb5f[_0x42cae2];return _0x5f256f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xfcb5('0x0'),_0xfcb5('0x1'),'update'];function createListener(_0x5ba9b7,_0x327824){return function(_0x224544){_0x327824['emit'](_0x5ba9b7,_0x224544);};}function removeListener(_0x6cc3d,_0x1e99ff){return function(){FaxInteractionEvents[_0xfcb5('0x2')](_0x6cc3d,_0x1e99ff);};}exports[_0xfcb5('0x3')]=function(_0x1fafae){for(var _0x50dc7e=0x0,_0x1c7c6d=events[_0xfcb5('0x4')];_0x50dc7e<_0x1c7c6d;_0x50dc7e++){var _0x3762e8=events[_0x50dc7e];var _0xeb13ef=createListener(_0xfcb5('0x5')+_0x3762e8,_0x1fafae);FaxInteractionEvents['on'](_0x3762e8,_0xeb13ef);}}; \ No newline at end of file +var _0x1aeb=['faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x1aeb,0xc9));var _0xb1ae=function(_0x3e1eeb,_0x75c706){_0x3e1eeb=_0x3e1eeb-0x0;var _0x4b7c01=_0x1aeb[_0x3e1eeb];return _0x4b7c01;};'use strict';var FaxInteractionEvents=require(_0xb1ae('0x0'));var events=[_0xb1ae('0x1'),_0xb1ae('0x2'),_0xb1ae('0x3')];function createListener(_0x32f0fe,_0x5c53ea){return function(_0x494a16){_0x5c53ea['emit'](_0x32f0fe,_0x494a16);};}function removeListener(_0x2f914b,_0x13dbf0){return function(){FaxInteractionEvents[_0xb1ae('0x4')](_0x2f914b,_0x13dbf0);};}exports[_0xb1ae('0x5')]=function(_0x46e2c7){for(var _0x3fc302=0x0,_0x3aabad=events[_0xb1ae('0x6')];_0x3fc302<_0x3aabad;_0x3fc302++){var _0x144635=events[_0x3fc302];var _0x3a7944=createListener(_0xb1ae('0x7')+_0x144635,_0x46e2c7);FaxInteractionEvents['on'](_0x144635,_0x3a7944);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d11bce5..7093bc7 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5fc=['removeTags','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb5fc,0x71));var _0xcb5f=function(_0x56d7c5,_0x369880){_0x56d7c5=_0x56d7c5-0x0;var _0x9dceea=_0xb5fc[_0x56d7c5];return _0x9dceea;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcb5f('0x0'));var router=express['Router']();var fs_extra=require(_0xcb5f('0x1'));var auth=require(_0xcb5f('0x2'));var interaction=require(_0xcb5f('0x3'));var config=require(_0xcb5f('0x4'));var controller=require(_0xcb5f('0x5'));router[_0xcb5f('0x6')]('/',auth[_0xcb5f('0x7')](),controller['index']);router[_0xcb5f('0x6')]('/describe',auth[_0xcb5f('0x7')](),controller[_0xcb5f('0x8')]);router[_0xcb5f('0x6')](_0xcb5f('0x9'),auth['isAuthenticated'](),controller[_0xcb5f('0xa')]);router[_0xcb5f('0x6')]('/:id/messages',auth[_0xcb5f('0x7')](),controller[_0xcb5f('0xb')]);router[_0xcb5f('0x6')](_0xcb5f('0xc'),auth[_0xcb5f('0x7')](),controller[_0xcb5f('0xd')]);router[_0xcb5f('0xe')]('/',auth[_0xcb5f('0x7')](),controller[_0xcb5f('0xf')]);router[_0xcb5f('0xe')](_0xcb5f('0x10'),auth[_0xcb5f('0x7')](),controller['addMessage']);router[_0xcb5f('0xe')](_0xcb5f('0x11'),auth[_0xcb5f('0x7')](),interaction[_0xcb5f('0x12')](_0xcb5f('0x13'),_0xcb5f('0x14')),controller[_0xcb5f('0x15')]);router['put']('/:id',auth[_0xcb5f('0x7')](),interaction[_0xcb5f('0x12')](_0xcb5f('0x13'),_0xcb5f('0x16')),controller[_0xcb5f('0x17')]);router[_0xcb5f('0x18')](_0xcb5f('0x9'),auth[_0xcb5f('0x7')](),interaction[_0xcb5f('0x12')](_0xcb5f('0x13'),_0xcb5f('0x19')),controller[_0xcb5f('0x1a')]);router[_0xcb5f('0x18')](_0xcb5f('0x11'),auth['isAuthenticated'](),controller[_0xcb5f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x7839=['fax','faxinteraction:addtags','tracked','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','show','/:id/messages','download','post','addMessage','/:id/tags'];(function(_0x10076c,_0x2734c7){var _0x24c3fa=function(_0xb98eb5){while(--_0xb98eb5){_0x10076c['push'](_0x10076c['shift']());}};_0x24c3fa(++_0x2734c7);}(_0x7839,0xa0));var _0x9783=function(_0x561918,_0x550311){_0x561918=_0x561918-0x0;var _0x4a446a=_0x7839[_0x561918];return _0x4a446a;};'use strict';var multer=require(_0x9783('0x0'));var util=require(_0x9783('0x1'));var path=require(_0x9783('0x2'));var timeout=require(_0x9783('0x3'));var express=require(_0x9783('0x4'));var router=express[_0x9783('0x5')]();var fs_extra=require(_0x9783('0x6'));var auth=require(_0x9783('0x7'));var interaction=require(_0x9783('0x8'));var config=require(_0x9783('0x9'));var controller=require(_0x9783('0xa'));router['get']('/',auth[_0x9783('0xb')](),controller['index']);router[_0x9783('0xc')](_0x9783('0xd'),auth[_0x9783('0xb')](),controller['describe']);router[_0x9783('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x9783('0xe')]);router[_0x9783('0xc')](_0x9783('0xf'),auth[_0x9783('0xb')](),controller['getMessages']);router[_0x9783('0xc')]('/:id/download',auth[_0x9783('0xb')](),controller[_0x9783('0x10')]);router[_0x9783('0x11')]('/',auth[_0x9783('0xb')](),controller['create']);router[_0x9783('0x11')](_0x9783('0xf'),auth['isAuthenticated'](),controller[_0x9783('0x12')]);router[_0x9783('0x11')](_0x9783('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x9783('0x14'),_0x9783('0x15')),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x9783('0x16')](_0x9783('0x14'),_0x9783('0x17')),controller[_0x9783('0x18')]);router[_0x9783('0x19')](_0x9783('0x1a'),auth[_0x9783('0xb')](),interaction[_0x9783('0x16')]('fax',_0x9783('0x1b')),controller['destroy']);router[_0x9783('0x19')](_0x9783('0x13'),auth[_0x9783('0xb')](),controller[_0x9783('0x1c')]);module[_0x9783('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d716a6a..4e8290e 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe630=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xe630,0x149));var _0x0e63=function(_0x34068f,_0x5758e4){_0x34068f=_0x34068f-0x0;var _0x351894=_0xe630[_0x34068f];return _0x351894;};'use strict';var Sequelize=require(_0x0e63('0x0'));module[_0x0e63('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0e63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0e63('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0e63('0x4')]('in','out'),'defaultValue':_0x0e63('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0e63('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0e63('0x7')]}}; \ No newline at end of file +var _0xc090=['out','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x137807,_0x3f2d18){var _0x227aff=function(_0x3e0a0f){while(--_0x3e0a0f){_0x137807['push'](_0x137807['shift']());}};_0x227aff(++_0x3f2d18);}(_0xc090,0x112));var _0x0c09=function(_0x36cbe1,_0x534206){_0x36cbe1=_0x36cbe1-0x0;var _0x844ce8=_0xc090[_0x36cbe1];return _0x844ce8;};'use strict';var Sequelize=require(_0x0c09('0x0'));module[_0x0c09('0x1')]={'body':{'type':Sequelize[_0x0c09('0x2')](_0x0c09('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0c09('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0c09('0x5')]('in',_0x0c09('0x6')),'defaultValue':_0x0c09('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 7e4acb3..bb7f2c1 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa34d=['mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','name','index','map','FaxMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','keys','length','include','body','find','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','fax-interactions','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','rejectmessage','create','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','root','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xa34d,0x1a4));var _0xda34=function(_0xe67ad3,_0x57cfd6){_0xe67ad3=_0xe67ad3-0x0;var _0x519baa=_0xa34d[_0xe67ad3];return _0x519baa;};'use strict';var emlformat=require(_0xda34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda34('0x1'));var jsonpatch=require(_0xda34('0x2'));var rp=require(_0xda34('0x3'));var moment=require(_0xda34('0x4'));var BPromise=require(_0xda34('0x5'));var Mustache=require(_0xda34('0x6'));var util=require(_0xda34('0x7'));var path=require('path');var sox=require(_0xda34('0x8'));var csv=require(_0xda34('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda34('0xa'));var _=require(_0xda34('0xb'));var squel=require(_0xda34('0xc'));var crypto=require(_0xda34('0xd'));var jsforce=require(_0xda34('0xe'));var deskjs=require(_0xda34('0xf'));var toCsv=require('to-csv');var querystring=require(_0xda34('0x10'));var Papa=require(_0xda34('0x11'));var Redis=require(_0xda34('0x12'));var authService=require(_0xda34('0x13'));var qs=require(_0xda34('0x14'));var as=require(_0xda34('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda34('0x16'))(_0xda34('0x17'));var utils=require(_0xda34('0x18'));var config=require(_0xda34('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xda34('0x1a'))['db'];config['redis']=_[_0xda34('0x1b')](config[_0xda34('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xda34('0x1d'))(new Redis(config[_0xda34('0x1c')]));require(_0xda34('0x1e'))[_0xda34('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xda34('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4da6ab,_0x260102,_0x43f429,_0x4dc0d2){return new BPromise(function(_0x20d362,_0x1556a0){var _0x2a2974=_0x4dc0d2||client;return _0x2a2974[_0xda34('0x21')](_0x4da6ab,_0x43f429)['then'](function(_0x4d5596){logger[_0xda34('0x22')](_0xda34('0x23'),_0x260102,_0xda34('0x24'));logger['debug'](_0xda34('0x25'),_0x260102,'request\x20sent',JSON[_0xda34('0x26')](_0x4d5596));if(_0x4d5596['error']){if(_0x4d5596[_0xda34('0x27')][_0xda34('0x28')]===0x1f4){logger[_0xda34('0x27')]('FaxMessage,\x20%s,\x20%s',_0x260102,_0x4d5596[_0xda34('0x27')][_0xda34('0x29')]);return _0x1556a0(_0x4d5596[_0xda34('0x27')][_0xda34('0x29')]);}logger[_0xda34('0x27')](_0xda34('0x23'),_0x260102,_0x4d5596[_0xda34('0x27')]['message']);return _0x20d362(_0x4d5596[_0xda34('0x27')][_0xda34('0x29')]);}else{logger[_0xda34('0x22')](_0xda34('0x23'),_0x260102,_0xda34('0x24'));_0x20d362(_0x4d5596[_0xda34('0x2a')][_0xda34('0x29')]);}})[_0xda34('0x2b')](function(_0x51817b){logger[_0xda34('0x27')](_0xda34('0x23'),_0x260102,_0x51817b);_0x1556a0(_0x51817b);});});}function respondWithStatusCode(_0x39e839,_0x110e0d){_0x110e0d=_0x110e0d||0xcc;return function(_0x1aa104){if(_0x1aa104){return _0x39e839[_0xda34('0x2c')](_0x110e0d);}return _0x39e839[_0xda34('0x2d')](_0x110e0d)[_0xda34('0x2e')]();};}function respondWithResult(_0x50b5b8,_0x381258){_0x381258=_0x381258||0xc8;return function(_0x3b3768){if(_0x3b3768){return _0x50b5b8[_0xda34('0x2d')](_0x381258)[_0xda34('0x2f')](_0x3b3768);}};}function respondWithFilteredResult(_0x36f769,_0x3f542e){return function(_0x4fdfdc){if(_0x4fdfdc){var _0x4d204e=typeof _0x3f542e[_0xda34('0x30')]===_0xda34('0x31')&&typeof _0x3f542e['limit']===_0xda34('0x31');var _0x1e4c3a=_0x4fdfdc[_0xda34('0x32')];var _0x388cc0=_0x4d204e?0x0:_0x3f542e[_0xda34('0x30')];var _0x531278=_0x4d204e?_0x4fdfdc['count']:_0x3f542e[_0xda34('0x30')]+_0x3f542e[_0xda34('0x33')];var _0x3cf68c;if(_0x531278>=_0x1e4c3a){_0x531278=_0x1e4c3a;_0x3cf68c=0xc8;}else{_0x3cf68c=0xce;}_0x36f769[_0xda34('0x2d')](_0x3cf68c);return _0x36f769[_0xda34('0x34')](_0xda34('0x35'),_0x388cc0+'-'+_0x531278+'/'+_0x1e4c3a)['json'](_0x4fdfdc);}return null;};}function patchUpdates(_0xa3907e){return function(_0x1e086a){try{jsonpatch['apply'](_0x1e086a,_0xa3907e,!![]);}catch(_0x27829e){return BPromise['reject'](_0x27829e);}return _0x1e086a[_0xda34('0x36')]();};}function saveUpdates(_0x1257ab,_0x400c9e){return function(_0x1891bf){if(_0x1891bf){return _0x1891bf[_0xda34('0x37')](_0x1257ab)[_0xda34('0x38')](function(_0x127cbc){return _0x127cbc;});}return null;};}function removeEntity(_0x5293f4,_0x21cc28){return function(_0x5d17db){if(_0x5d17db){return _0x5d17db[_0xda34('0x39')]()['then'](function(){_0x5293f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c62fb,_0x3c9b45){return function(_0x3df6aa){if(!_0x3df6aa){_0x3c62fb['sendStatus'](0x194);}return _0x3df6aa;};}function handleError(_0x42d7af,_0x5d7d05){_0x5d7d05=_0x5d7d05||0x1f4;return function(_0x3cb57a){logger[_0xda34('0x27')](_0x3cb57a['stack']);if(_0x3cb57a[_0xda34('0x3a')]){delete _0x3cb57a[_0xda34('0x3a')];}_0x42d7af[_0xda34('0x2d')](_0x5d7d05)['send'](_0x3cb57a);};}exports[_0xda34('0x3b')]=function(_0x20726c,_0x149f24){var _0x2a1278={},_0x544d64={},_0x23d8c9={'count':0x0,'rows':[]};var _0xd07d72=_[_0xda34('0x3c')](db[_0xda34('0x3d')]['rawAttributes'],function(_0x3ae54a){return{'name':_0x3ae54a[_0xda34('0x3e')],'type':_0x3ae54a[_0xda34('0x3f')][_0xda34('0x40')]};});_0x544d64[_0xda34('0x41')]=_[_0xda34('0x3c')](_0xd07d72,_0xda34('0x3a'));_0x544d64['query']=_['keys'](_0x20726c[_0xda34('0x42')]);_0x544d64[_0xda34('0x43')]=_[_0xda34('0x44')](_0x544d64[_0xda34('0x41')],_0x544d64[_0xda34('0x42')]);_0x2a1278[_0xda34('0x45')]=_[_0xda34('0x44')](_0x544d64[_0xda34('0x41')],qs['fields'](_0x20726c[_0xda34('0x42')][_0xda34('0x46')]));_0x2a1278['attributes']=_0x2a1278['attributes']['length']?_0x2a1278[_0xda34('0x45')]:_0x544d64['model'];if(!_0x20726c[_0xda34('0x42')][_0xda34('0x47')](_0xda34('0x48'))){_0x2a1278[_0xda34('0x33')]=qs[_0xda34('0x33')](_0x20726c['query']['limit']);_0x2a1278['offset']=qs[_0xda34('0x30')](_0x20726c[_0xda34('0x42')][_0xda34('0x30')]);}_0x2a1278[_0xda34('0x49')]=qs['sort'](_0x20726c[_0xda34('0x42')][_0xda34('0x4a')]);_0x2a1278[_0xda34('0x4b')]=qs[_0xda34('0x43')](_['pick'](_0x20726c[_0xda34('0x42')],_0x544d64[_0xda34('0x43')]),_0xd07d72);if(_0x20726c[_0xda34('0x42')]['filter']){_0x2a1278['where']=_[_0xda34('0x4c')](_0x2a1278[_0xda34('0x4b')],{'$or':_[_0xda34('0x3c')](_0xd07d72,function(_0x520479){if(_0x520479['type']!==_0xda34('0x4d')){var _0x3898f6={};_0x3898f6[_0x520479[_0xda34('0x3a')]]={'$like':'%'+_0x20726c['query'][_0xda34('0x4e')]+'%'};return _0x3898f6;}})});}_0x2a1278=_[_0xda34('0x4c')]({},_0x2a1278,_0x20726c[_0xda34('0x4f')]);var _0x4c4c2c={'where':_0x2a1278[_0xda34('0x4b')]};return db['FaxMessage'][_0xda34('0x32')](_0x4c4c2c)[_0xda34('0x38')](function(_0x370ef2){_0x23d8c9[_0xda34('0x32')]=_0x370ef2;if(_0x20726c[_0xda34('0x42')][_0xda34('0x50')]){_0x2a1278['include']=[{'all':!![]}];}return db['FaxMessage'][_0xda34('0x51')](_0x2a1278);})[_0xda34('0x38')](function(_0xca3ec3){_0x23d8c9[_0xda34('0x52')]=_0xca3ec3;return _0x23d8c9;})[_0xda34('0x38')](respondWithFilteredResult(_0x149f24,_0x2a1278))[_0xda34('0x2b')](handleError(_0x149f24,null));};exports[_0xda34('0x53')]=function(_0x232fbb,_0x3228aa){var _0x2b9315={'raw':!![],'where':{'id':_0x232fbb[_0xda34('0x54')]['id']}},_0x26c154={};_0x26c154[_0xda34('0x41')]=_['keys'](db[_0xda34('0x3d')][_0xda34('0x55')]);_0x26c154['query']=_[_0xda34('0x56')](_0x232fbb[_0xda34('0x42')]);_0x26c154[_0xda34('0x43')]=_[_0xda34('0x44')](_0x26c154[_0xda34('0x41')],_0x26c154['query']);_0x2b9315[_0xda34('0x45')]=_[_0xda34('0x44')](_0x26c154[_0xda34('0x41')],qs['fields'](_0x232fbb[_0xda34('0x42')]['fields']));_0x2b9315[_0xda34('0x45')]=_0x2b9315[_0xda34('0x45')][_0xda34('0x57')]?_0x2b9315['attributes']:_0x26c154[_0xda34('0x41')];if(_0x232fbb[_0xda34('0x42')]['includeAll']){_0x2b9315[_0xda34('0x58')]=[{'all':!![]}];}_0x2b9315=_[_0xda34('0x4c')]({},_0x2b9315,_0x232fbb[_0xda34('0x4f')]);return db['FaxMessage']['find'](_0x2b9315)['then'](handleEntityNotFound(_0x3228aa,null))['then'](respondWithResult(_0x3228aa,null))[_0xda34('0x2b')](handleError(_0x3228aa,null));};exports[_0xda34('0x37')]=function(_0x2190ce,_0x5e6d6b){if(_0x2190ce[_0xda34('0x59')]['id']){delete _0x2190ce[_0xda34('0x59')]['id'];}return db[_0xda34('0x3d')][_0xda34('0x5a')]({'where':{'id':_0x2190ce[_0xda34('0x54')]['id']}})[_0xda34('0x38')](handleEntityNotFound(_0x5e6d6b,null))['then'](saveUpdates(_0x2190ce[_0xda34('0x59')],null))[_0xda34('0x38')](respondWithResult(_0x5e6d6b,null))[_0xda34('0x2b')](handleError(_0x5e6d6b,null));};exports[_0xda34('0x39')]=function(_0x3df0aa,_0x1b90e6){return db[_0xda34('0x3d')][_0xda34('0x5a')]({'where':{'id':_0x3df0aa['params']['id']}})[_0xda34('0x38')](handleEntityNotFound(_0x1b90e6,null))[_0xda34('0x38')](removeEntity(_0x1b90e6,null))[_0xda34('0x2b')](handleError(_0x1b90e6,null));};exports['describe']=function(_0x35129b,_0xb43f53){return db['FaxMessage'][_0xda34('0x5b')]()[_0xda34('0x38')](respondWithResult(_0xb43f53,null))[_0xda34('0x2b')](handleError(_0xb43f53,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xda34('0x5c')]=function(_0x44dafe,_0xde441c,_0x33807d){var _0x33b7ad={'agent':{},'channel':_0xda34('0x5d')};if(_0x44dafe['body']['id']){delete _0x44dafe[_0xda34('0x59')]['id'];}_0x44dafe[_0xda34('0x59')][_0xda34('0x5e')]=!![];_0x44dafe[_0xda34('0x59')][_0xda34('0x5f')]=moment()[_0xda34('0x60')](_0xda34('0x61'));_0x44dafe[_0xda34('0x59')]['UserId']=_0x44dafe[_0xda34('0x59')][_0xda34('0x62')]||_0x44dafe['user']['id'];_0x33b7ad[_0xda34('0x63')]['id']=_0x44dafe[_0xda34('0x59')][_0xda34('0x62')];return db[_0xda34('0x3d')][_0xda34('0x5a')]({'where':{'id':_0x44dafe['params']['id'],'UserId':null}})[_0xda34('0x38')](handleEntityNotFound(_0xde441c,null))['then'](saveUpdates(_0x44dafe[_0xda34('0x59')],null))[_0xda34('0x38')](function(_0x4a02d1){if(_0x4a02d1){_0x33b7ad[_0xda34('0x29')]=_0x4a02d1['get']({'plain':!![]});return db[_0xda34('0x64')][_0xda34('0x5a')]({'where':{'id':_0x4a02d1[_0xda34('0x65')]}});}return null;})[_0xda34('0x38')](handleEntityNotFound(_0xde441c,null))[_0xda34('0x38')](function(_0x4bb242){if(_0x4bb242){return _0x4bb242[_0xda34('0x37')]({'UserId':_0x44dafe[_0xda34('0x59')]['UserId'],'read1stAt':_[_0xda34('0x66')](_0x4bb242['read1stAt'])?moment()[_0xda34('0x60')](_0xda34('0x61')):undefined});}return null;})['then'](function(_0x55d8db){if(_0x55d8db){_0x33b7ad[_0xda34('0x67')]=_0x55d8db[_0xda34('0x68')]({'plain':!![]});interaction_log[_0xda34('0x22')](_0xda34('0x69'),_0x44dafe[_0xda34('0x6a')]['id'],_0x44dafe[_0xda34('0x6a')][_0xda34('0x3a')],_0x44dafe['user'][_0xda34('0x6b')],_0x33b7ad[_0xda34('0x67')]['id'],_0x44dafe['body']?JSON[_0xda34('0x26')](_0x44dafe['body']):_0xda34('0x6c'));return respondWithRpcPromise(_0xda34('0x6d'),'acceptMessage',_0x33b7ad);}return null;})[_0xda34('0x38')](function(_0x4c6b96){var _0x231d3e=_0xda34('0x6e')+_0x4c6b96[_0xda34('0x29')][_0xda34('0x6f')];return db[_0xda34('0x70')][_0xda34('0x42')](_0x231d3e,{'type':db['Sequelize']['QueryTypes'][_0xda34('0x71')],'raw':!![]})[_0xda34('0x38')](function(_0x477f9c){return _0x477f9c;});})['then'](function(_0x51bc9b){if(_0x51bc9b){_0x33b7ad['message'][_0xda34('0x72')]=_0x51bc9b[0x0];if(!_0x44dafe['body'][_0xda34('0x62')])return;return db[_0xda34('0x73')][_0xda34('0x5a')]({'where':{'id':_0x44dafe[_0xda34('0x59')][_0xda34('0x62')],'role':_0xda34('0x63')},'attributes':['id',_0xda34('0x3a'),_0xda34('0x74'),'email',_0xda34('0x75')],'raw':!![]});}return null;})[_0xda34('0x38')](function(_0x3e3f2b){if(!_0x3e3f2b)return null;_0x33b7ad['message']['agent']=_0x3e3f2b;return _0x33b7ad;})[_0xda34('0x38')](function(_0x3abbf0){if(_0x3abbf0){if(_0x44dafe['body']['manual']){_0x33b7ad[_0xda34('0x29')][_0xda34('0x76')]=util[_0xda34('0x60')](_0xda34('0x77'),_0x44dafe[_0xda34('0x6a')][_0xda34('0x3a')]);_0x33b7ad[_0xda34('0x29')][_0xda34('0x78')]=_0x33b7ad['channel'];_0x33b7ad[_0xda34('0x29')][_0xda34('0x79')]=_0x33b7ad[_0xda34('0x78')];_0x33b7ad['message'][_0xda34('0x7a')]=_0xda34('0x5c');return respondWithRpcPromise(_0xda34('0x7b'),_0xda34('0x7b'),{'event':'acceptmessage','message':_0x33b7ad[_0xda34('0x29')]},client9002)[_0xda34('0x38')](function(){return _0x33b7ad;});}return _0x33b7ad;}return null;})[_0xda34('0x38')](respondWithResult(_0xde441c,null))[_0xda34('0x2b')](handleError(_0xde441c,null));};var interaction_log=require(_0xda34('0x16'))(_0xda34('0x7c'));exports[_0xda34('0x7d')]=function(_0x62a3af,_0x30f99e,_0x4bb996){var _0x471d09={'agent':{},'channel':_0xda34('0x5d')};if(_0x62a3af[_0xda34('0x59')]['id']){delete _0x62a3af['body']['id'];}_0x62a3af[_0xda34('0x59')][_0xda34('0x62')]=_0x62a3af['body'][_0xda34('0x62')]||_0x62a3af[_0xda34('0x6a')]['id'];_0x471d09[_0xda34('0x63')]['id']=_0x62a3af[_0xda34('0x59')]['UserId'];return db[_0xda34('0x3d')][_0xda34('0x5a')]({'where':{'id':_0x62a3af['params']['id'],'UserId':null}})[_0xda34('0x38')](handleEntityNotFound(_0x30f99e,null))[_0xda34('0x38')](function(_0x53633d){if(_0x53633d){_0x471d09[_0xda34('0x29')]=_0x53633d[_0xda34('0x68')]({'plain':!![]});return db['FaxInteraction'][_0xda34('0x5a')]({'where':{'id':_0x53633d['FaxInteractionId']}});}return null;})[_0xda34('0x38')](handleEntityNotFound(_0x30f99e,null))[_0xda34('0x38')](function(_0x104e03){if(_0x104e03){_0x471d09[_0xda34('0x67')]=_0x104e03[_0xda34('0x68')]({'plain':!![]});interaction_log[_0xda34('0x22')](_0xda34('0x7e'),_0x62a3af[_0xda34('0x6a')]['id'],_0x62a3af[_0xda34('0x6a')]['name'],_0x62a3af['user'][_0xda34('0x6b')],_0x471d09['interaction']['id'],_0x62a3af[_0xda34('0x59')]?JSON[_0xda34('0x26')](_0x62a3af[_0xda34('0x59')]):_0xda34('0x6c'));return respondWithRpcPromise(_0xda34('0x7f'),_0xda34('0x80'),_0x471d09);}return null;})['then'](function(_0x143c30){var _0x163070='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x143c30[_0xda34('0x29')][_0xda34('0x6f')];return db[_0xda34('0x70')][_0xda34('0x42')](_0x163070,{'type':db['Sequelize']['QueryTypes'][_0xda34('0x71')],'raw':!![]})[_0xda34('0x38')](function(_0x399b2c){return _0x399b2c;});})[_0xda34('0x38')](function(_0x85daf7){if(_0x85daf7){_0x471d09[_0xda34('0x29')]['contact']=_0x85daf7[0x0];if(!_0x62a3af[_0xda34('0x59')][_0xda34('0x62')])return;return db[_0xda34('0x73')][_0xda34('0x5a')]({'where':{'id':_0x62a3af[_0xda34('0x59')][_0xda34('0x62')],'role':'agent'},'attributes':['id',_0xda34('0x3a'),_0xda34('0x74'),_0xda34('0x81'),_0xda34('0x75')],'raw':!![]});}return null;})['then'](function(_0x445d92){if(!_0x445d92)return null;_0x471d09[_0xda34('0x29')][_0xda34('0x63')]=_0x445d92;return _0x471d09;})[_0xda34('0x38')](function(_0x4842b7){if(_0x4842b7){_0x4842b7[_0xda34('0x29')][_0xda34('0x76')]=util[_0xda34('0x60')]('SIP/%s',_0x62a3af[_0xda34('0x6a')][_0xda34('0x3a')]);_0x4842b7['message'][_0xda34('0x78')]=_0x471d09[_0xda34('0x78')];_0x4842b7[_0xda34('0x29')][_0xda34('0x79')]=_0x471d09[_0xda34('0x78')];_0x4842b7[_0xda34('0x29')][_0xda34('0x7a')]=_0xda34('0x7d');respondWithRpcPromise(_0xda34('0x7b'),_0xda34('0x7b'),{'event':_0xda34('0x82'),'message':_0x4842b7[_0xda34('0x29')]},client9002);return _0x471d09;}return null;})[_0xda34('0x38')](respondWithResult(_0x30f99e,null))[_0xda34('0x2b')](handleError(_0x30f99e,null));};exports[_0xda34('0x83')]=function(_0x55c14e,_0x8f88b8){var _0x3886cf;return db['FaxMessage'][_0xda34('0x83')](_0x55c14e['body'],{})[_0xda34('0x38')](function(_0x254562){_0x3886cf=_0x254562;return db['CmContact'][_0xda34('0x84')]({'where':{'id':_0x3886cf['ContactId']}});})[_0xda34('0x38')](function(_0x18f391){if(_[_0xda34('0x66')](_0x18f391)){return;}else{_0x3886cf['fax']=_0x18f391['fax'];return db['Attachment']['findOne']({'where':{'id':_0x3886cf[_0xda34('0x85')]}});}})[_0xda34('0x38')](function(_0x292f4d){return respondWithRpcPromise(_0xda34('0x86'),'SendFax',{'FaxAccountId':_[_0xda34('0x66')](_0x55c14e[_0xda34('0x59')])?undefined:_0x55c14e[_0xda34('0x59')][_0xda34('0x87')],'path':_[_0xda34('0x66')](_0x292f4d)?undefined:util[_0xda34('0x60')]('/var/opt/motion2/server/files/attachments/%s',_0x292f4d[_0xda34('0x88')]),'fax':_[_0xda34('0x66')](_0x3886cf[_0xda34('0x5d')])?undefined:_0x3886cf[_0xda34('0x5d')],'AttachmentId':_0x3886cf[_0xda34('0x85')]},client9002);})[_0xda34('0x38')](respondWithResult(_0x8f88b8,0xc9))[_0xda34('0x2b')](handleError(_0x8f88b8,null));};exports[_0xda34('0x89')]=function(_0x3cbd60,_0x55de0a){var _0x4c6a23=path['join'](config[_0xda34('0x8a')],_0xda34('0x8b'),_0xda34('0x8c'),_0xda34('0x8d'));return db[_0xda34('0x3d')][_0xda34('0x5a')]({'where':{'id':_0x3cbd60[_0xda34('0x54')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xda34('0x38')](handleEntityNotFound(_0x55de0a,null))[_0xda34('0x38')](function(_0x30e617){if(_0x30e617){return _0x55de0a[_0xda34('0x89')](path['join'](_0x4c6a23,_0x30e617['Attachment'][_0xda34('0x88')]));}})[_0xda34('0x2b')](handleError(_0x55de0a,null));}; \ No newline at end of file +var _0xecec=['jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','map','FaxMessage','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','agent','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','RejectMessage','rejectMessage','Sequelize','contact','internal','SIP/%s','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x3baf3c,_0x54f614){var _0x3a3ac3=function(_0x2db36d){while(--_0x2db36d){_0x3baf3c['push'](_0x3baf3c['shift']());}};_0x3a3ac3(++_0x54f614);}(_0xecec,0x109));var _0xcece=function(_0x20879f,_0x5d5515){_0x20879f=_0x20879f-0x0;var _0x359185=_0xecec[_0x20879f];return _0x359185;};'use strict';var emlformat=require(_0xcece('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcece('0x1'));var jsonpatch=require(_0xcece('0x2'));var rp=require(_0xcece('0x3'));var moment=require(_0xcece('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcece('0x5'));var path=require('path');var sox=require(_0xcece('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcece('0x7'));var _=require(_0xcece('0x8'));var squel=require('squel');var crypto=require(_0xcece('0x9'));var jsforce=require(_0xcece('0xa'));var deskjs=require(_0xcece('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcece('0xc'));var Papa=require(_0xcece('0xd'));var Redis=require(_0xcece('0xe'));var authService=require(_0xcece('0xf'));var qs=require(_0xcece('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcece('0x11'))(_0xcece('0x12'));var utils=require(_0xcece('0x13'));var config=require(_0xcece('0x14'));var licenseUtil=require(_0xcece('0x15'));var db=require(_0xcece('0x16'))['db'];config[_0xcece('0x17')]=_[_0xcece('0x18')](config['redis'],{'host':_0xcece('0x19'),'port':0x18eb});var socket=require(_0xcece('0x1a'))(new Redis(config[_0xcece('0x17')]));require(_0xcece('0x1b'))[_0xcece('0x1c')](socket);var jayson=require(_0xcece('0x1d'));var client=jayson[_0xcece('0x1e')][_0xcece('0x1f')]({'port':0x232c});var client9002=jayson[_0xcece('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec22a,_0x56eedf,_0x27cf98,_0x5c3b19){return new BPromise(function(_0xa305ff,_0x1adda4){var _0x572184=_0x5c3b19||client;return _0x572184[_0xcece('0x20')](_0x1ec22a,_0x27cf98)[_0xcece('0x21')](function(_0xb18085){logger[_0xcece('0x22')]('FaxMessage,\x20%s,\x20%s',_0x56eedf,_0xcece('0x23'));logger[_0xcece('0x24')](_0xcece('0x25'),_0x56eedf,_0xcece('0x23'),JSON[_0xcece('0x26')](_0xb18085));if(_0xb18085[_0xcece('0x27')]){if(_0xb18085[_0xcece('0x27')][_0xcece('0x28')]===0x1f4){logger[_0xcece('0x27')](_0xcece('0x29'),_0x56eedf,_0xb18085[_0xcece('0x27')][_0xcece('0x2a')]);return _0x1adda4(_0xb18085[_0xcece('0x27')][_0xcece('0x2a')]);}logger['error'](_0xcece('0x29'),_0x56eedf,_0xb18085[_0xcece('0x27')][_0xcece('0x2a')]);return _0xa305ff(_0xb18085[_0xcece('0x27')][_0xcece('0x2a')]);}else{logger[_0xcece('0x22')](_0xcece('0x29'),_0x56eedf,'request\x20sent');_0xa305ff(_0xb18085[_0xcece('0x2b')]['message']);}})[_0xcece('0x2c')](function(_0x4255ab){logger[_0xcece('0x27')](_0xcece('0x29'),_0x56eedf,_0x4255ab);_0x1adda4(_0x4255ab);});});}function respondWithStatusCode(_0x42fde9,_0x4c4f01){_0x4c4f01=_0x4c4f01||0xcc;return function(_0x33a0ad){if(_0x33a0ad){return _0x42fde9['sendStatus'](_0x4c4f01);}return _0x42fde9['status'](_0x4c4f01)['end']();};}function respondWithResult(_0x24cc05,_0x133671){_0x133671=_0x133671||0xc8;return function(_0xdc46b1){if(_0xdc46b1){return _0x24cc05[_0xcece('0x2d')](_0x133671)['json'](_0xdc46b1);}};}function respondWithFilteredResult(_0xc42b85,_0x126e56){return function(_0x10a3ff){if(_0x10a3ff){var _0x4f0070=typeof _0x126e56[_0xcece('0x2e')]===_0xcece('0x2f')&&typeof _0x126e56[_0xcece('0x30')]==='undefined';var _0x1f94b3=_0x10a3ff[_0xcece('0x31')];var _0x177801=_0x4f0070?0x0:_0x126e56[_0xcece('0x2e')];var _0x11fa75=_0x4f0070?_0x10a3ff['count']:_0x126e56['offset']+_0x126e56['limit'];var _0x8932dc;if(_0x11fa75>=_0x1f94b3){_0x11fa75=_0x1f94b3;_0x8932dc=0xc8;}else{_0x8932dc=0xce;}_0xc42b85[_0xcece('0x2d')](_0x8932dc);return _0xc42b85[_0xcece('0x32')](_0xcece('0x33'),_0x177801+'-'+_0x11fa75+'/'+_0x1f94b3)['json'](_0x10a3ff);}return null;};}function patchUpdates(_0x4ea4a6){return function(_0x251fa9){try{jsonpatch['apply'](_0x251fa9,_0x4ea4a6,!![]);}catch(_0x331c6d){return BPromise[_0xcece('0x34')](_0x331c6d);}return _0x251fa9[_0xcece('0x35')]();};}function saveUpdates(_0x5c05c2,_0x4009b5){return function(_0x262364){if(_0x262364){return _0x262364[_0xcece('0x36')](_0x5c05c2)[_0xcece('0x21')](function(_0x35fb49){return _0x35fb49;});}return null;};}function removeEntity(_0x92656c,_0x2ed503){return function(_0x138fb8){if(_0x138fb8){return _0x138fb8[_0xcece('0x37')]()[_0xcece('0x21')](function(){_0x92656c[_0xcece('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f114d,_0x1a0220){return function(_0x320ddd){if(!_0x320ddd){_0x2f114d[_0xcece('0x38')](0x194);}return _0x320ddd;};}function handleError(_0x14617a,_0xa336da){_0xa336da=_0xa336da||0x1f4;return function(_0x38dc06){logger[_0xcece('0x27')](_0x38dc06[_0xcece('0x39')]);if(_0x38dc06['name']){delete _0x38dc06[_0xcece('0x3a')];}_0x14617a[_0xcece('0x2d')](_0xa336da)['send'](_0x38dc06);};}exports[_0xcece('0x3b')]=function(_0x6367a1,_0x4a0c67){var _0x2435d3={},_0x5bc3c0={},_0x4964ad={'count':0x0,'rows':[]};var _0x544980=_[_0xcece('0x3c')](db[_0xcece('0x3d')]['rawAttributes'],function(_0xa82dae){return{'name':_0xa82dae[_0xcece('0x3e')],'type':_0xa82dae[_0xcece('0x3f')][_0xcece('0x40')]};});_0x5bc3c0[_0xcece('0x41')]=_['map'](_0x544980,_0xcece('0x3a'));_0x5bc3c0[_0xcece('0x42')]=_['keys'](_0x6367a1[_0xcece('0x42')]);_0x5bc3c0[_0xcece('0x43')]=_['intersection'](_0x5bc3c0[_0xcece('0x41')],_0x5bc3c0['query']);_0x2435d3[_0xcece('0x44')]=_[_0xcece('0x45')](_0x5bc3c0[_0xcece('0x41')],qs[_0xcece('0x46')](_0x6367a1[_0xcece('0x42')]['fields']));_0x2435d3['attributes']=_0x2435d3[_0xcece('0x44')]['length']?_0x2435d3[_0xcece('0x44')]:_0x5bc3c0[_0xcece('0x41')];if(!_0x6367a1[_0xcece('0x42')][_0xcece('0x47')](_0xcece('0x48'))){_0x2435d3[_0xcece('0x30')]=qs[_0xcece('0x30')](_0x6367a1['query']['limit']);_0x2435d3[_0xcece('0x2e')]=qs[_0xcece('0x2e')](_0x6367a1[_0xcece('0x42')][_0xcece('0x2e')]);}_0x2435d3[_0xcece('0x49')]=qs[_0xcece('0x4a')](_0x6367a1[_0xcece('0x42')]['sort']);_0x2435d3[_0xcece('0x4b')]=qs['filters'](_[_0xcece('0x4c')](_0x6367a1[_0xcece('0x42')],_0x5bc3c0[_0xcece('0x43')]),_0x544980);if(_0x6367a1[_0xcece('0x42')][_0xcece('0x4d')]){_0x2435d3[_0xcece('0x4b')]=_['merge'](_0x2435d3[_0xcece('0x4b')],{'$or':_[_0xcece('0x3c')](_0x544980,function(_0x5a10a0){if(_0x5a10a0['type']!==_0xcece('0x4e')){var _0x149a9f={};_0x149a9f[_0x5a10a0[_0xcece('0x3a')]]={'$like':'%'+_0x6367a1[_0xcece('0x42')]['filter']+'%'};return _0x149a9f;}})});}_0x2435d3=_[_0xcece('0x4f')]({},_0x2435d3,_0x6367a1['options']);var _0x3503b9={'where':_0x2435d3[_0xcece('0x4b')]};return db[_0xcece('0x3d')][_0xcece('0x31')](_0x3503b9)[_0xcece('0x21')](function(_0x266a03){_0x4964ad[_0xcece('0x31')]=_0x266a03;if(_0x6367a1[_0xcece('0x42')][_0xcece('0x50')]){_0x2435d3[_0xcece('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0xcece('0x52')](_0x2435d3);})[_0xcece('0x21')](function(_0x2f984d){_0x4964ad[_0xcece('0x53')]=_0x2f984d;return _0x4964ad;})[_0xcece('0x21')](respondWithFilteredResult(_0x4a0c67,_0x2435d3))[_0xcece('0x2c')](handleError(_0x4a0c67,null));};exports[_0xcece('0x54')]=function(_0x22bb74,_0x5d145a){var _0x1607ff={'raw':!![],'where':{'id':_0x22bb74[_0xcece('0x55')]['id']}},_0x3e7492={};_0x3e7492['model']=_[_0xcece('0x56')](db['FaxMessage'][_0xcece('0x57')]);_0x3e7492[_0xcece('0x42')]=_[_0xcece('0x56')](_0x22bb74['query']);_0x3e7492[_0xcece('0x43')]=_[_0xcece('0x45')](_0x3e7492[_0xcece('0x41')],_0x3e7492[_0xcece('0x42')]);_0x1607ff[_0xcece('0x44')]=_[_0xcece('0x45')](_0x3e7492['model'],qs['fields'](_0x22bb74['query'][_0xcece('0x46')]));_0x1607ff[_0xcece('0x44')]=_0x1607ff[_0xcece('0x44')][_0xcece('0x58')]?_0x1607ff[_0xcece('0x44')]:_0x3e7492[_0xcece('0x41')];if(_0x22bb74[_0xcece('0x42')][_0xcece('0x50')]){_0x1607ff[_0xcece('0x51')]=[{'all':!![]}];}_0x1607ff=_[_0xcece('0x4f')]({},_0x1607ff,_0x22bb74['options']);return db['FaxMessage'][_0xcece('0x59')](_0x1607ff)[_0xcece('0x21')](handleEntityNotFound(_0x5d145a,null))['then'](respondWithResult(_0x5d145a,null))[_0xcece('0x2c')](handleError(_0x5d145a,null));};exports[_0xcece('0x36')]=function(_0x421c3c,_0x263425){if(_0x421c3c['body']['id']){delete _0x421c3c[_0xcece('0x5a')]['id'];}return db[_0xcece('0x3d')][_0xcece('0x59')]({'where':{'id':_0x421c3c[_0xcece('0x55')]['id']}})['then'](handleEntityNotFound(_0x263425,null))[_0xcece('0x21')](saveUpdates(_0x421c3c[_0xcece('0x5a')],null))[_0xcece('0x21')](respondWithResult(_0x263425,null))[_0xcece('0x2c')](handleError(_0x263425,null));};exports[_0xcece('0x37')]=function(_0x296274,_0x4447d6){return db[_0xcece('0x3d')][_0xcece('0x59')]({'where':{'id':_0x296274['params']['id']}})['then'](handleEntityNotFound(_0x4447d6,null))[_0xcece('0x21')](removeEntity(_0x4447d6,null))[_0xcece('0x2c')](handleError(_0x4447d6,null));};exports[_0xcece('0x5b')]=function(_0x6f7da0,_0x3bc5f6){return db['FaxMessage'][_0xcece('0x5b')]()[_0xcece('0x21')](respondWithResult(_0x3bc5f6,null))[_0xcece('0x2c')](handleError(_0x3bc5f6,null));};var interaction_log=require(_0xcece('0x11'))(_0xcece('0x5c'));exports[_0xcece('0x5d')]=function(_0x4d1126,_0xd219cf,_0x52fb64){var _0x936dce={'agent':{},'channel':_0xcece('0x5e')};if(_0x4d1126['body']['id']){delete _0x4d1126[_0xcece('0x5a')]['id'];}_0x4d1126[_0xcece('0x5a')]['read']=!![];_0x4d1126['body'][_0xcece('0x5f')]=moment()[_0xcece('0x60')](_0xcece('0x61'));_0x4d1126['body']['UserId']=_0x4d1126[_0xcece('0x5a')][_0xcece('0x62')]||_0x4d1126[_0xcece('0x63')]['id'];_0x936dce['agent']['id']=_0x4d1126[_0xcece('0x5a')][_0xcece('0x62')];return db[_0xcece('0x3d')][_0xcece('0x59')]({'where':{'id':_0x4d1126['params']['id'],'UserId':null}})[_0xcece('0x21')](handleEntityNotFound(_0xd219cf,null))['then'](saveUpdates(_0x4d1126['body'],null))[_0xcece('0x21')](function(_0x1fabe7){if(_0x1fabe7){_0x936dce[_0xcece('0x2a')]=_0x1fabe7[_0xcece('0x64')]({'plain':!![]});return db[_0xcece('0x65')]['find']({'where':{'id':_0x1fabe7['FaxInteractionId']}});}return null;})[_0xcece('0x21')](handleEntityNotFound(_0xd219cf,null))[_0xcece('0x21')](function(_0x28d9ea){if(_0x28d9ea){return _0x28d9ea[_0xcece('0x36')]({'UserId':_0x4d1126[_0xcece('0x5a')][_0xcece('0x62')],'read1stAt':_['isNil'](_0x28d9ea[_0xcece('0x66')])?moment()[_0xcece('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcece('0x21')](function(_0x438099){if(_0x438099){_0x936dce[_0xcece('0x67')]=_0x438099[_0xcece('0x64')]({'plain':!![]});interaction_log[_0xcece('0x22')](_0xcece('0x68'),_0x4d1126[_0xcece('0x63')]['id'],_0x4d1126[_0xcece('0x63')]['name'],_0x4d1126['user'][_0xcece('0x69')],_0x936dce[_0xcece('0x67')]['id'],_0x4d1126[_0xcece('0x5a')]?JSON[_0xcece('0x26')](_0x4d1126['body']):_0xcece('0x6a'));return respondWithRpcPromise(_0xcece('0x6b'),_0xcece('0x6c'),_0x936dce);}return null;})[_0xcece('0x21')](function(_0x2c53a1){var _0x57dc46=_0xcece('0x6d')+_0x2c53a1[_0xcece('0x2a')][_0xcece('0x6e')];return db[_0xcece('0x6f')][_0xcece('0x42')](_0x57dc46,{'type':db['Sequelize'][_0xcece('0x70')][_0xcece('0x71')],'raw':!![]})[_0xcece('0x21')](function(_0x3b1603){return _0x3b1603;});})[_0xcece('0x21')](function(_0x393217){if(_0x393217){_0x936dce[_0xcece('0x2a')]['contact']=_0x393217[0x0];if(!_0x4d1126[_0xcece('0x5a')][_0xcece('0x62')])return;return db[_0xcece('0x72')]['find']({'where':{'id':_0x4d1126[_0xcece('0x5a')][_0xcece('0x62')],'role':_0xcece('0x73')},'attributes':['id',_0xcece('0x3a'),_0xcece('0x74'),_0xcece('0x75'),'internal'],'raw':!![]});}return null;})[_0xcece('0x21')](function(_0x5153ab){if(!_0x5153ab)return null;_0x936dce['message'][_0xcece('0x73')]=_0x5153ab;return _0x936dce;})[_0xcece('0x21')](function(_0x5cd549){if(_0x5cd549){if(_0x4d1126[_0xcece('0x5a')][_0xcece('0x76')]){_0x936dce[_0xcece('0x2a')][_0xcece('0x77')]=util['format']('SIP/%s',_0x4d1126['user']['name']);_0x936dce[_0xcece('0x2a')][_0xcece('0x78')]=_0x936dce['channel'];_0x936dce['message'][_0xcece('0x79')]=_0x936dce['channel'];_0x936dce['message'][_0xcece('0x7a')]=_0xcece('0x5d');return respondWithRpcPromise(_0xcece('0x7b'),'EventManager',{'event':_0xcece('0x7c'),'message':_0x936dce[_0xcece('0x2a')]},client9002)[_0xcece('0x21')](function(){return _0x936dce;});}return _0x936dce;}return null;})[_0xcece('0x21')](respondWithResult(_0xd219cf,null))['catch'](handleError(_0xd219cf,null));};var interaction_log=require('../../config/logger')(_0xcece('0x5c'));exports[_0xcece('0x34')]=function(_0xbd9255,_0x2ad89f,_0x4cd56a){var _0x262adf={'agent':{},'channel':_0xcece('0x5e')};if(_0xbd9255['body']['id']){delete _0xbd9255[_0xcece('0x5a')]['id'];}_0xbd9255[_0xcece('0x5a')][_0xcece('0x62')]=_0xbd9255[_0xcece('0x5a')]['UserId']||_0xbd9255[_0xcece('0x63')]['id'];_0x262adf['agent']['id']=_0xbd9255[_0xcece('0x5a')][_0xcece('0x62')];return db[_0xcece('0x3d')]['find']({'where':{'id':_0xbd9255[_0xcece('0x55')]['id'],'UserId':null}})[_0xcece('0x21')](handleEntityNotFound(_0x2ad89f,null))['then'](function(_0x37d2a2){if(_0x37d2a2){_0x262adf['message']=_0x37d2a2[_0xcece('0x64')]({'plain':!![]});return db[_0xcece('0x65')][_0xcece('0x59')]({'where':{'id':_0x37d2a2[_0xcece('0x7d')]}});}return null;})[_0xcece('0x21')](handleEntityNotFound(_0x2ad89f,null))['then'](function(_0x543ccd){if(_0x543ccd){_0x262adf[_0xcece('0x67')]=_0x543ccd['get']({'plain':!![]});interaction_log[_0xcece('0x22')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xbd9255[_0xcece('0x63')]['id'],_0xbd9255[_0xcece('0x63')][_0xcece('0x3a')],_0xbd9255[_0xcece('0x63')]['role'],_0x262adf['interaction']['id'],_0xbd9255[_0xcece('0x5a')]?JSON[_0xcece('0x26')](_0xbd9255[_0xcece('0x5a')]):_0xcece('0x6a'));return respondWithRpcPromise(_0xcece('0x7e'),_0xcece('0x7f'),_0x262adf);}return null;})[_0xcece('0x21')](function(_0x5a5713){var _0x259460=_0xcece('0x6d')+_0x5a5713[_0xcece('0x2a')][_0xcece('0x6e')];return db[_0xcece('0x6f')][_0xcece('0x42')](_0x259460,{'type':db[_0xcece('0x80')]['QueryTypes'][_0xcece('0x71')],'raw':!![]})[_0xcece('0x21')](function(_0x17c5bd){return _0x17c5bd;});})['then'](function(_0x36810a){if(_0x36810a){_0x262adf[_0xcece('0x2a')][_0xcece('0x81')]=_0x36810a[0x0];if(!_0xbd9255['body'][_0xcece('0x62')])return;return db[_0xcece('0x72')][_0xcece('0x59')]({'where':{'id':_0xbd9255['body'][_0xcece('0x62')],'role':'agent'},'attributes':['id',_0xcece('0x3a'),_0xcece('0x74'),_0xcece('0x75'),_0xcece('0x82')],'raw':!![]});}return null;})[_0xcece('0x21')](function(_0x574a34){if(!_0x574a34)return null;_0x262adf[_0xcece('0x2a')]['agent']=_0x574a34;return _0x262adf;})[_0xcece('0x21')](function(_0x109efc){if(_0x109efc){_0x109efc[_0xcece('0x2a')][_0xcece('0x77')]=util[_0xcece('0x60')](_0xcece('0x83'),_0xbd9255['user'][_0xcece('0x3a')]);_0x109efc['message']['channel']=_0x262adf[_0xcece('0x78')];_0x109efc[_0xcece('0x2a')][_0xcece('0x79')]=_0x262adf[_0xcece('0x78')];_0x109efc['message'][_0xcece('0x7a')]=_0xcece('0x34');respondWithRpcPromise(_0xcece('0x7b'),'EventManager',{'event':_0xcece('0x84'),'message':_0x109efc['message']},client9002);return _0x262adf;}return null;})[_0xcece('0x21')](respondWithResult(_0x2ad89f,null))[_0xcece('0x2c')](handleError(_0x2ad89f,null));};exports[_0xcece('0x85')]=function(_0x1122b3,_0x223d6c){var _0x5561f5;return db[_0xcece('0x3d')][_0xcece('0x85')](_0x1122b3[_0xcece('0x5a')],{})['then'](function(_0xe85796){_0x5561f5=_0xe85796;return db[_0xcece('0x86')][_0xcece('0x87')]({'where':{'id':_0x5561f5['ContactId']}});})[_0xcece('0x21')](function(_0x5eefbc){if(_[_0xcece('0x88')](_0x5eefbc)){return;}else{_0x5561f5[_0xcece('0x5e')]=_0x5eefbc['fax'];return db[_0xcece('0x89')][_0xcece('0x87')]({'where':{'id':_0x5561f5[_0xcece('0x8a')]}});}})[_0xcece('0x21')](function(_0x2c92c0){return respondWithRpcPromise(_0xcece('0x8b'),_0xcece('0x8b'),{'FaxAccountId':_['isNil'](_0x1122b3[_0xcece('0x5a')])?undefined:_0x1122b3[_0xcece('0x5a')][_0xcece('0x8c')],'path':_[_0xcece('0x88')](_0x2c92c0)?undefined:util[_0xcece('0x60')](_0xcece('0x8d'),_0x2c92c0[_0xcece('0x8e')]),'fax':_[_0xcece('0x88')](_0x5561f5[_0xcece('0x5e')])?undefined:_0x5561f5[_0xcece('0x5e')],'AttachmentId':_0x5561f5['AttachmentId']},client9002);})['then'](respondWithResult(_0x223d6c,0xc9))[_0xcece('0x2c')](handleError(_0x223d6c,null));};exports[_0xcece('0x8f')]=function(_0x26cc42,_0x2a1aeb){var _0x1babbf=path[_0xcece('0x90')](config[_0xcece('0x91')],'server','files',_0xcece('0x92'));return db['FaxMessage'][_0xcece('0x59')]({'where':{'id':_0x26cc42[_0xcece('0x55')]['id']},'include':[{'model':db[_0xcece('0x89')],'as':'Attachment'}]})[_0xcece('0x21')](handleEntityNotFound(_0x2a1aeb,null))[_0xcece('0x21')](function(_0x3d2c79){if(_0x3d2c79){return _0x2a1aeb[_0xcece('0x8f')](path['join'](_0x1babbf,_0x3d2c79[_0xcece('0x89')][_0xcece('0x8e')]));}})[_0xcece('0x2c')](handleError(_0x2a1aeb,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 0ca8162..a4a7c34 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf693=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x276866,_0x3715d0){var _0x24f217=function(_0x334a9){while(--_0x334a9){_0x276866['push'](_0x276866['shift']());}};_0x24f217(++_0x3715d0);}(_0xf693,0x181));var _0x3f69=function(_0x2c6832,_0x2431fb){_0x2c6832=_0x2c6832-0x0;var _0x232fd9=_0xf693[_0x2c6832];return _0x232fd9;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x3f69('0x0'))['db'][_0x3f69('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3f69('0x2')](0x0);var events={'afterCreate':_0x3f69('0x3'),'afterUpdate':_0x3f69('0x4'),'afterDestroy':_0x3f69('0x5')};function emitEvent(_0x414ca5){return function(_0x527646,_0xf2fdd8,_0x300282){FaxMessageEvents[_0x3f69('0x6')](_0x414ca5+':'+_0x527646['id'],_0x527646);FaxMessageEvents[_0x3f69('0x6')](_0x414ca5,_0x527646);_0x300282(null);};}for(var e in events){if(events[_0x3f69('0x7')](e)){var event=events[e];FaxMessage[_0x3f69('0x8')](e,emitEvent(event));}}module[_0x3f69('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xe1d3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x51da60,_0x5585f8){var _0x4f49cd=function(_0x4f6000){while(--_0x4f6000){_0x51da60['push'](_0x51da60['shift']());}};_0x4f49cd(++_0x5585f8);}(_0xe1d3,0x159));var _0x3e1d=function(_0x3aa3a2,_0x394bdd){_0x3aa3a2=_0x3aa3a2-0x0;var _0x1e5c93=_0xe1d3[_0x3aa3a2];return _0x1e5c93;};'use strict';var EventEmitter=require(_0x3e1d('0x0'));var FaxMessage=require(_0x3e1d('0x1'))['db'][_0x3e1d('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3e1d('0x3')](0x0);var events={'afterCreate':_0x3e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x3e1d('0x5')};function emitEvent(_0x4a0768){return function(_0x23f59b,_0x38df15,_0x4f6337){FaxMessageEvents['emit'](_0x4a0768+':'+_0x23f59b['id'],_0x23f59b);FaxMessageEvents[_0x3e1d('0x6')](_0x4a0768,_0x23f59b);_0x4f6337(null);};}for(var e in events){if(events[_0x3e1d('0x7')](e)){var event=events[e];FaxMessage[_0x3e1d('0x8')](e,emitEvent(event));}}module[_0x3e1d('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 7c7cb6c..97c4d57 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa59e=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa59e,0x123));var _0xea59=function(_0x50c83d,_0x30b497){_0x50c83d=_0x50c83d-0x0;var _0x5d1d3a=_0xa59e[_0x50c83d];return _0x5d1d3a;};'use strict';var _=require(_0xea59('0x0'));var util=require(_0xea59('0x1'));var logger=require(_0xea59('0x2'))(_0xea59('0x3'));var moment=require(_0xea59('0x4'));var BPromise=require(_0xea59('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea59('0x6'));var rimraf=require(_0xea59('0x7'));var config=require(_0xea59('0x8'));var attributes=require(_0xea59('0x9'));module[_0xea59('0xa')]=function(_0x375a44,_0x5a2a94){return _0x375a44[_0xea59('0xb')](_0xea59('0xc'),attributes,{'tableName':_0xea59('0xd'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xea59('0xe')],'type':_0xea59('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23ad6d,_0xc9585,_0x58f848){var _0x12aa11=_0x375a44[_0xea59('0x10')];var _0x14a988=_0x23ad6d['get']({'plain':!![]});if(_0x14a988[_0xea59('0x11')][_0xea59('0x12')]()==='in'||_0x14a988[_0xea59('0x11')][_0xea59('0x12')]()===_0xea59('0x13')&&!_0x14a988['secret']&&!_[_0xea59('0x14')](_0x14a988[_0xea59('0x15')])){_0x12aa11[_0xea59('0x16')][_0xea59('0x17')]({'where':{'id':_0x14a988[_0xea59('0x18')]}})['then'](function(_0x59eaef){if(_0x59eaef){_0x59eaef[_0xea59('0x19')]({'lastMsgAt':_0x14a988['createdAt'],'lastMsgDirection':_0x14a988['direction']['toLowerCase']()});}})[_0xea59('0x1a')](function(_0x3f923b){console[_0xea59('0x1b')](_0x3f923b);});}_0x58f848();}},'charset':_0xea59('0x1c'),'collate':_0xea59('0x1d')});}; \ No newline at end of file +var _0x2e3a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','FULLTEXT','models','get','toLowerCase','direction','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','utf8mb4','lodash','util','../../config/logger'];(function(_0x59ece4,_0xce6de0){var _0x56a0ba=function(_0x4df59c){while(--_0x4df59c){_0x59ece4['push'](_0x59ece4['shift']());}};_0x56a0ba(++_0xce6de0);}(_0x2e3a,0x1b0));var _0xa2e3=function(_0x1b0692,_0xcb7853){_0x1b0692=_0x1b0692-0x0;var _0x580b51=_0x2e3a[_0x1b0692];return _0x580b51;};'use strict';var _=require(_0xa2e3('0x0'));var util=require(_0xa2e3('0x1'));var logger=require(_0xa2e3('0x2'))(_0xa2e3('0x3'));var moment=require(_0xa2e3('0x4'));var BPromise=require(_0xa2e3('0x5'));var rp=require(_0xa2e3('0x6'));var fs=require('fs');var path=require(_0xa2e3('0x7'));var rimraf=require(_0xa2e3('0x8'));var config=require(_0xa2e3('0x9'));var attributes=require(_0xa2e3('0xa'));module[_0xa2e3('0xb')]=function(_0x42ec45,_0x2c8dcb){return _0x42ec45[_0xa2e3('0xc')](_0xa2e3('0xd'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xa2e3('0xe'),'fields':['body'],'type':_0xa2e3('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a0182,_0x3178ad,_0x43b23d){var _0xe2ba94=_0x42ec45[_0xa2e3('0x10')];var _0x415f3a=_0x4a0182[_0xa2e3('0x11')]({'plain':!![]});if(_0x415f3a['direction'][_0xa2e3('0x12')]()==='in'||_0x415f3a[_0xa2e3('0x13')]['toLowerCase']()==='out'&&!_0x415f3a[_0xa2e3('0x14')]&&!_['isNil'](_0x415f3a[_0xa2e3('0x15')])){_0xe2ba94[_0xa2e3('0x16')][_0xa2e3('0x17')]({'where':{'id':_0x415f3a[_0xa2e3('0x18')]}})[_0xa2e3('0x19')](function(_0x23ecca){if(_0x23ecca){_0x23ecca[_0xa2e3('0x1a')]({'lastMsgAt':_0x415f3a[_0xa2e3('0x1b')],'lastMsgDirection':_0x415f3a[_0xa2e3('0x13')][_0xa2e3('0x12')]()});}})['catch'](function(_0x3e3be9){console['error'](_0x3e3be9);});}_0x43b23d();}},'charset':_0xa2e3('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ee6951c..cfdb4ad 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81bd=['debug','request\x20sent','stringify','error','message','result','catch','CreateFaxMessage','create','body','options','raw','FaxMessage','update','limit','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s'];(function(_0x332fb2,_0x10dce5){var _0x20d58d=function(_0x50fbf6){while(--_0x50fbf6){_0x332fb2['push'](_0x332fb2['shift']());}};_0x20d58d(++_0x10dce5);}(_0x81bd,0x7c));var _0xd81b=function(_0x40686f,_0x3f24bf){_0x40686f=_0x40686f-0x0;var _0x53b21c=_0x81bd[_0x40686f];return _0x53b21c;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});config[_0xd81b('0xc')]=_['defaults'](config['redis'],{'host':_0xd81b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0xc')]));require(_0xd81b('0xe'))[_0xd81b('0xf')](socket);function respondWithRpcPromise(_0x86dab6,_0x17fba4,_0x1ff60f){return new BPromise(function(_0x4391be,_0x17e09f){return client[_0xd81b('0x10')](_0x86dab6,_0x1ff60f)[_0xd81b('0x11')](function(_0x215b92){logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,'request\x20sent');logger[_0xd81b('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x17fba4,_0xd81b('0x15'),JSON[_0xd81b('0x16')](_0x215b92));if(_0x215b92['error']){if(_0x215b92[_0xd81b('0x17')]['code']===0x1f4){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);return _0x17e09f(_0x215b92[_0xd81b('0x17')]['message']);}logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92['error'][_0xd81b('0x18')]);return _0x4391be(_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);}else{logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,_0xd81b('0x15'));_0x4391be(_0x215b92[_0xd81b('0x19')][_0xd81b('0x18')]);}})[_0xd81b('0x1a')](function(_0x285164){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x285164);_0x17e09f(_0x285164);});});}exports[_0xd81b('0x1b')]=function(_0x3518f0){var _0x156894=this;return new Promise(function(_0x4f8c0b,_0x5f101a){return db['FaxMessage'][_0xd81b('0x1c')](_0x3518f0[_0xd81b('0x1d')],{'raw':_0x3518f0[_0xd81b('0x1e')]?_0x3518f0['options'][_0xd81b('0x1f')]===undefined?!![]:![]:!![]})[_0xd81b('0x11')](function(_0x542ee2){logger[_0xd81b('0x12')](_0xd81b('0x1b'),_0x3518f0);logger[_0xd81b('0x14')](_0xd81b('0x1b'),_0x3518f0,JSON[_0xd81b('0x16')](_0x542ee2));_0x4f8c0b(_0x542ee2);})[_0xd81b('0x1a')](function(_0x255011){logger[_0xd81b('0x17')](_0xd81b('0x1b'),_0x255011[_0xd81b('0x18')],_0x3518f0);_0x5f101a(_0x156894[_0xd81b('0x17')](0x1f4,_0x255011[_0xd81b('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x28768f){var _0x99dbc9=this;return new Promise(function(_0xe3637a,_0x31b9fd){return db[_0xd81b('0x20')][_0xd81b('0x21')](_0x28768f[_0xd81b('0x1d')],{'raw':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28768f[_0xd81b('0x1e')]?_0x28768f['options']['where']||null:null,'attributes':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['attributes']||null:null,'limit':_0x28768f['options']?_0x28768f[_0xd81b('0x1e')][_0xd81b('0x22')]||null:null})[_0xd81b('0x11')](function(_0x289f54){logger[_0xd81b('0x12')](_0xd81b('0x23'),_0x28768f);logger['debug'](_0xd81b('0x23'),_0x28768f,JSON[_0xd81b('0x16')](_0x289f54));_0xe3637a(_0x289f54);})['catch'](function(_0x56d80b){logger[_0xd81b('0x17')](_0xd81b('0x23'),_0x56d80b['message'],_0x28768f);_0x31b9fd(_0x99dbc9['error'](0x1f4,_0x56d80b['message']));});});}; \ No newline at end of file +var _0xbec5=['then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x10d3e1,_0x2bf161){var _0x4f16e0=function(_0x5af245){while(--_0x5af245){_0x10d3e1['push'](_0x10d3e1['shift']());}};_0x4f16e0(++_0x2bf161);}(_0xbec5,0xe5));var _0x5bec=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xbec5[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('FaxMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')](_0x593786[_0x5bec('0x1d')],{'raw':_0x593786[_0x5bec('0x1e')]?_0x593786[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x5bec('0x10')](function(_0x4cfcb8){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger['debug'](_0x5bec('0x1a'),_0x593786,JSON[_0x5bec('0x14')](_0x4cfcb8));_0xab397b(_0x4cfcb8);})['catch'](function(_0x45afb7){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x45afb7[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x45afb7[_0x5bec('0x18')]));});});};exports[_0x5bec('0x1f')]=function(_0x4de66a){var _0x5b63ab=this;return new Promise(function(_0x5e44b3,_0x2961bd){return db[_0x5bec('0x1b')][_0x5bec('0x20')](_0x4de66a['body'],{'raw':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['where']||null:null,'attributes':_0x4de66a['options']?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x21')]||null:null,'limit':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x22')]||null:null})[_0x5bec('0x10')](function(_0x5d6621){logger[_0x5bec('0x11')]('UpdateFaxMessage',_0x4de66a);logger[_0x5bec('0x13')](_0x5bec('0x1f'),_0x4de66a,JSON[_0x5bec('0x14')](_0x5d6621));_0x5e44b3(_0x5d6621);})[_0x5bec('0x19')](function(_0x5128c0){logger[_0x5bec('0x15')](_0x5bec('0x1f'),_0x5128c0[_0x5bec('0x18')],_0x4de66a);_0x2961bd(_0x5b63ab['error'](0x1f4,_0x5128c0[_0x5bec('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ee38719..a6e3c4d 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5717=['save','length','faxMessage:','./faxMessage.events'];(function(_0x4d9a1c,_0x3992fb){var _0x3cc7d5=function(_0xa1f283){while(--_0xa1f283){_0x4d9a1c['push'](_0x4d9a1c['shift']());}};_0x3cc7d5(++_0x3992fb);}(_0x5717,0x1f3));var _0x7571=function(_0xe2bd44,_0x538f6c){_0xe2bd44=_0xe2bd44-0x0;var _0x29c0f2=_0x5717[_0xe2bd44];return _0x29c0f2;};'use strict';var FaxMessageEvents=require(_0x7571('0x0'));var events=[_0x7571('0x1'),'remove','update'];function createListener(_0x46f1df,_0x11fdf7){return function(_0x44d404){_0x11fdf7['emit'](_0x46f1df,_0x44d404);};}function removeListener(_0xd1668d,_0x53c3ba){return function(){FaxMessageEvents['removeListener'](_0xd1668d,_0x53c3ba);};}exports['register']=function(_0x1c00a1){for(var _0x27a1f4=0x0,_0x2dd9e8=events[_0x7571('0x2')];_0x27a1f4<_0x2dd9e8;_0x27a1f4++){var _0x17e437=events[_0x27a1f4];var _0x339a81=createListener(_0x7571('0x3')+_0x17e437,_0x1c00a1);FaxMessageEvents['on'](_0x17e437,_0x339a81);}}; \ No newline at end of file +var _0x0829=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','emit'];(function(_0x1fe6da,_0xca0cf8){var _0x548a42=function(_0x10d26c){while(--_0x10d26c){_0x1fe6da['push'](_0x1fe6da['shift']());}};_0x548a42(++_0xca0cf8);}(_0x0829,0x7c));var _0x9082=function(_0xe15714,_0xb4ca16){_0xe15714=_0xe15714-0x0;var _0x2b314d=_0x0829[_0xe15714];return _0x2b314d;};'use strict';var FaxMessageEvents=require(_0x9082('0x0'));var events=[_0x9082('0x1'),_0x9082('0x2'),'update'];function createListener(_0x4ea2c3,_0x4961d7){return function(_0x598100){_0x4961d7[_0x9082('0x3')](_0x4ea2c3,_0x598100);};}function removeListener(_0x4ea1c1,_0x14e411){return function(){FaxMessageEvents[_0x9082('0x4')](_0x4ea1c1,_0x14e411);};}exports[_0x9082('0x5')]=function(_0x33fe4a){for(var _0x19b0cc=0x0,_0x20729b=events[_0x9082('0x6')];_0x19b0cc<_0x20729b;_0x19b0cc++){var _0x18a221=events[_0x19b0cc];var _0x553c24=createListener(_0x9082('0x7')+_0x18a221,_0x33fe4a);FaxMessageEvents['on'](_0x18a221,_0x553c24);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4acf741..47d5113 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x222f=['/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','fax','create','put','update','/:id/accept'];(function(_0x17de86,_0x514d01){var _0xdc4ef4=function(_0x13daf6){while(--_0x13daf6){_0x17de86['push'](_0x17de86['shift']());}};_0xdc4ef4(++_0x514d01);}(_0x222f,0x1a4));var _0xf222=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x222f[_0x4ce028];return _0x583d0c;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./faxMessage.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/describe',auth[_0xf222('0xa')](),controller[_0xf222('0xb')]);router['get'](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0xd')]);router[_0xf222('0x8')](_0xf222('0xe'),auth[_0xf222('0xa')](),controller['download']);router[_0xf222('0xf')]('/',auth[_0xf222('0xa')](),interaction[_0xf222('0x10')](_0xf222('0x11'),'faxmessage:create'),controller[_0xf222('0x12')]);router[_0xf222('0x13')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x14')]);router[_0xf222('0x13')](_0xf222('0x15'),auth[_0xf222('0xa')](),controller['accept']);router['put'](_0xf222('0x16'),auth[_0xf222('0xa')](),controller['reject']);router[_0xf222('0x17')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x18')]);module[_0xf222('0x19')]=router; \ No newline at end of file +var _0xd64b=['tracked','fax','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','post'];(function(_0x12e57a,_0x3deb7b){var _0x41f238=function(_0x323e83){while(--_0x323e83){_0x12e57a['push'](_0x12e57a['shift']());}};_0x41f238(++_0x3deb7b);}(_0xd64b,0xc1));var _0xbd64=function(_0x49aa4e,_0x560eb7){_0x49aa4e=_0x49aa4e-0x0;var _0x58ed43=_0xd64b[_0x49aa4e];return _0x58ed43;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0x8')](_0xbd64('0xd'),auth[_0xbd64('0xa')](),controller['download']);router[_0xbd64('0xe')]('/',auth[_0xbd64('0xa')](),interaction[_0xbd64('0xf')](_0xbd64('0x10'),'faxmessage:create'),controller[_0xbd64('0x11')]);router['put'](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x12')]);router[_0xbd64('0x13')](_0xbd64('0x14'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x15')]);router[_0xbd64('0x13')](_0xbd64('0x16'),auth['isAuthenticated'](),controller[_0xbd64('0x17')]);router[_0xbd64('0x18')](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f26cec9..76c2f38 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd2e=['ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize','STRING'];(function(_0x36c435,_0x5e2806){var _0x4d3f05=function(_0x3f6ac0){while(--_0x3f6ac0){_0x36c435['push'](_0x36c435['shift']());}};_0x4d3f05(++_0x5e2806);}(_0xfd2e,0x6e));var _0xefd2=function(_0x4968ef,_0x6e7d33){_0x4968ef=_0x4968ef-0x0;var _0x317937=_0xfd2e[_0x4968ef];return _0x317937;};'use strict';var Sequelize=require(_0xefd2('0x0'));module['exports']={'name':{'type':Sequelize[_0xefd2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefd2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xefd2('0x2')](_0xefd2('0x3'),_0xefd2('0x4'),_0xefd2('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xefd2('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x40a4=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x185063,_0x3f0bb7){var _0x16d9d3=function(_0x1b3fe3){while(--_0x1b3fe3){_0x185063['push'](_0x185063['shift']());}};_0x16d9d3(++_0x3f0bb7);}(_0x40a4,0x12c));var _0x440a=function(_0x465050,_0x21c5ae){_0x465050=_0x465050-0x0;var _0x83fb6b=_0x40a4[_0x465050];return _0x83fb6b;};'use strict';var Sequelize=require(_0x440a('0x0'));module[_0x440a('0x1')]={'name':{'type':Sequelize[_0x440a('0x2')],'unique':_0x440a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x440a('0x2')]},'timeout':{'type':Sequelize[_0x440a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x440a('0x5'),_0x440a('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x440a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index c3ea06c..399b282 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab15=['reject','save','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','update','describe','getMembers','findOne','UserFaxQueue','sort','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','hasOwnProperty','addTeams','Team','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','ids','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x3626ce,_0x33effa){var _0x455327=function(_0x4eee88){while(--_0x4eee88){_0x3626ce['push'](_0x3626ce['shift']());}};_0x455327(++_0x33effa);}(_0xab15,0x18d));var _0x5ab1=function(_0x307d6e,_0x158973){_0x307d6e=_0x307d6e-0x0;var _0x34f2c9=_0xab15[_0x307d6e];return _0x34f2c9;};'use strict';var emlformat=require(_0x5ab1('0x0'));var rimraf=require(_0x5ab1('0x1'));var zipdir=require(_0x5ab1('0x2'));var jsonpatch=require(_0x5ab1('0x3'));var rp=require(_0x5ab1('0x4'));var moment=require(_0x5ab1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5ab1('0x6'));var sox=require(_0x5ab1('0x7'));var csv=require(_0x5ab1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ab1('0x9'));var _=require('lodash');var squel=require(_0x5ab1('0xa'));var crypto=require(_0x5ab1('0xb'));var jsforce=require(_0x5ab1('0xc'));var deskjs=require(_0x5ab1('0xd'));var toCsv=require(_0x5ab1('0x8'));var querystring=require('querystring');var Papa=require(_0x5ab1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ab1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ab1('0x10'));var logger=require('../../config/logger')(_0x5ab1('0x11'));var utils=require(_0x5ab1('0x12'));var config=require(_0x5ab1('0x13'));var licenseUtil=require(_0x5ab1('0x14'));var db=require(_0x5ab1('0x15'))['db'];config[_0x5ab1('0x16')]=_[_0x5ab1('0x17')](config['redis'],{'host':_0x5ab1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ab1('0x16')]));require(_0x5ab1('0x19'))[_0x5ab1('0x1a')](socket);function respondWithStatusCode(_0x52d882,_0x4f8fb7){_0x4f8fb7=_0x4f8fb7||0xcc;return function(_0x46e8df){if(_0x46e8df){return _0x52d882[_0x5ab1('0x1b')](_0x4f8fb7);}return _0x52d882[_0x5ab1('0x1c')](_0x4f8fb7)[_0x5ab1('0x1d')]();};}function respondWithResult(_0xf58a42,_0x33f3e4){_0x33f3e4=_0x33f3e4||0xc8;return function(_0x203aff){if(_0x203aff){return _0xf58a42['status'](_0x33f3e4)[_0x5ab1('0x1e')](_0x203aff);}};}function respondWithFilteredResult(_0x425517,_0x5bc2c0){return function(_0x52139a){if(_0x52139a){var _0x54d3ee=typeof _0x5bc2c0[_0x5ab1('0x1f')]===_0x5ab1('0x20')&&typeof _0x5bc2c0[_0x5ab1('0x21')]==='undefined';var _0x2179a9=_0x52139a[_0x5ab1('0x22')];var _0xf9405e=_0x54d3ee?0x0:_0x5bc2c0[_0x5ab1('0x1f')];var _0x3d0e00=_0x54d3ee?_0x52139a[_0x5ab1('0x22')]:_0x5bc2c0['offset']+_0x5bc2c0[_0x5ab1('0x21')];var _0x2429da;if(_0x3d0e00>=_0x2179a9){_0x3d0e00=_0x2179a9;_0x2429da=0xc8;}else{_0x2429da=0xce;}_0x425517['status'](_0x2429da);return _0x425517['set']('Content-Range',_0xf9405e+'-'+_0x3d0e00+'/'+_0x2179a9)[_0x5ab1('0x1e')](_0x52139a);}return null;};}function patchUpdates(_0x16e6e9){return function(_0x5b34bc){try{jsonpatch['apply'](_0x5b34bc,_0x16e6e9,!![]);}catch(_0xf8b890){return BPromise[_0x5ab1('0x23')](_0xf8b890);}return _0x5b34bc[_0x5ab1('0x24')]();};}function saveUpdates(_0xf6df50,_0x27b4d5){return function(_0x138509){if(_0x138509){return _0x138509['update'](_0xf6df50)[_0x5ab1('0x25')](function(_0x1ca03b){return _0x1ca03b;});}return null;};}function removeEntity(_0x2fe7a,_0x1a7d5f){return function(_0x31796a){if(_0x31796a){return _0x31796a['destroy']()[_0x5ab1('0x25')](function(){var _0x136117=_0x31796a[_0x5ab1('0x26')]({'plain':!![]});var _0x157805=_0x5ab1('0x27');return db[_0x5ab1('0x28')][_0x5ab1('0x29')]({'where':{'type':_0x157805,'resourceId':_0x136117['id']}})[_0x5ab1('0x25')](function(){return _0x31796a;});})['then'](function(){_0x2fe7a[_0x5ab1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf059,_0x4eb2e3){return function(_0xd81189){if(!_0xd81189){_0x4bf059[_0x5ab1('0x1b')](0x194);}return _0xd81189;};}function handleError(_0xc20acc,_0x2377a3){_0x2377a3=_0x2377a3||0x1f4;return function(_0x15c96d){logger[_0x5ab1('0x2a')](_0x15c96d[_0x5ab1('0x2b')]);if(_0x15c96d['name']){delete _0x15c96d[_0x5ab1('0x2c')];}_0xc20acc['status'](_0x2377a3)[_0x5ab1('0x2d')](_0x15c96d);};}exports[_0x5ab1('0x2e')]=function(_0x3b9ba1,_0x14d28f){var _0xb83ed7={},_0x2b6793={},_0x28373b={'count':0x0,'rows':[]};var _0x19ec6f=_[_0x5ab1('0x2f')](db[_0x5ab1('0x30')][_0x5ab1('0x31')],function(_0x3c31e2){return{'name':_0x3c31e2[_0x5ab1('0x32')],'type':_0x3c31e2[_0x5ab1('0x33')][_0x5ab1('0x34')]};});_0x2b6793[_0x5ab1('0x35')]=_['map'](_0x19ec6f,_0x5ab1('0x2c'));_0x2b6793[_0x5ab1('0x36')]=_['keys'](_0x3b9ba1[_0x5ab1('0x36')]);_0x2b6793['filters']=_['intersection'](_0x2b6793[_0x5ab1('0x35')],_0x2b6793['query']);_0xb83ed7[_0x5ab1('0x37')]=_[_0x5ab1('0x38')](_0x2b6793[_0x5ab1('0x35')],qs['fields'](_0x3b9ba1['query'][_0x5ab1('0x39')]));_0xb83ed7[_0x5ab1('0x37')]=_0xb83ed7[_0x5ab1('0x37')]['length']?_0xb83ed7[_0x5ab1('0x37')]:_0x2b6793['model'];if(!_0x3b9ba1[_0x5ab1('0x36')]['hasOwnProperty'](_0x5ab1('0x3a'))){_0xb83ed7[_0x5ab1('0x21')]=qs['limit'](_0x3b9ba1[_0x5ab1('0x36')][_0x5ab1('0x21')]);_0xb83ed7[_0x5ab1('0x1f')]=qs[_0x5ab1('0x1f')](_0x3b9ba1[_0x5ab1('0x36')][_0x5ab1('0x1f')]);}_0xb83ed7[_0x5ab1('0x3b')]=qs['sort'](_0x3b9ba1['query']['sort']);_0xb83ed7[_0x5ab1('0x3c')]=qs[_0x5ab1('0x3d')](_[_0x5ab1('0x3e')](_0x3b9ba1[_0x5ab1('0x36')],_0x2b6793[_0x5ab1('0x3d')]),_0x19ec6f);if(_0x3b9ba1[_0x5ab1('0x36')][_0x5ab1('0x3f')]){_0xb83ed7[_0x5ab1('0x3c')]=_['merge'](_0xb83ed7['where'],{'$or':_['map'](_0x19ec6f,function(_0x20cd50){if(_0x20cd50['type']!==_0x5ab1('0x40')){var _0x230a98={};_0x230a98[_0x20cd50['name']]={'$like':'%'+_0x3b9ba1[_0x5ab1('0x36')][_0x5ab1('0x3f')]+'%'};return _0x230a98;}})});}_0xb83ed7=_[_0x5ab1('0x41')]({},_0xb83ed7,_0x3b9ba1[_0x5ab1('0x42')]);var _0x20e825={'where':_0xb83ed7[_0x5ab1('0x3c')]};return db[_0x5ab1('0x30')]['count'](_0x20e825)[_0x5ab1('0x25')](function(_0x13a416){_0x28373b[_0x5ab1('0x22')]=_0x13a416;if(_0x3b9ba1[_0x5ab1('0x36')][_0x5ab1('0x43')]){_0xb83ed7[_0x5ab1('0x44')]=[{'all':!![]}];}return db[_0x5ab1('0x30')]['findAll'](_0xb83ed7);})[_0x5ab1('0x25')](function(_0x53c2b3){_0x28373b[_0x5ab1('0x45')]=_0x53c2b3;return _0x28373b;})[_0x5ab1('0x25')](respondWithFilteredResult(_0x14d28f,_0xb83ed7))[_0x5ab1('0x46')](handleError(_0x14d28f,null));};exports[_0x5ab1('0x47')]=function(_0x433827,_0x2a6717){var _0x2af8ac={'raw':!![],'where':{'id':_0x433827[_0x5ab1('0x48')]['id']}},_0x29f241={};_0x29f241[_0x5ab1('0x35')]=_['keys'](db[_0x5ab1('0x30')][_0x5ab1('0x31')]);_0x29f241[_0x5ab1('0x36')]=_[_0x5ab1('0x49')](_0x433827['query']);_0x29f241[_0x5ab1('0x3d')]=_['intersection'](_0x29f241[_0x5ab1('0x35')],_0x29f241[_0x5ab1('0x36')]);_0x2af8ac[_0x5ab1('0x37')]=_[_0x5ab1('0x38')](_0x29f241[_0x5ab1('0x35')],qs[_0x5ab1('0x39')](_0x433827['query']['fields']));_0x2af8ac[_0x5ab1('0x37')]=_0x2af8ac[_0x5ab1('0x37')][_0x5ab1('0x4a')]?_0x2af8ac[_0x5ab1('0x37')]:_0x29f241[_0x5ab1('0x35')];if(_0x433827[_0x5ab1('0x36')][_0x5ab1('0x43')]){_0x2af8ac[_0x5ab1('0x44')]=[{'all':!![]}];}_0x2af8ac=_['merge']({},_0x2af8ac,_0x433827[_0x5ab1('0x42')]);return db['FaxQueue'][_0x5ab1('0x4b')](_0x2af8ac)[_0x5ab1('0x25')](handleEntityNotFound(_0x2a6717,null))[_0x5ab1('0x25')](respondWithResult(_0x2a6717,null))[_0x5ab1('0x46')](handleError(_0x2a6717,null));};exports['create']=function(_0x16c53b,_0x2ba473){return db[_0x5ab1('0x30')][_0x5ab1('0x4c')](_0x16c53b[_0x5ab1('0x4d')],{})['then'](function(_0x2bf32c){var _0x23b654=_0x16c53b[_0x5ab1('0x4e')][_0x5ab1('0x26')]({'plain':!![]});if(!_0x23b654)throw new Error(_0x5ab1('0x4f'));if(_0x23b654['role']===_0x5ab1('0x4e')){var _0x608d20=_0x2bf32c[_0x5ab1('0x26')]({'plain':!![]});var _0x5c66a2=_0x5ab1('0x27');return db['UserProfileSection'][_0x5ab1('0x4b')]({'where':{'name':_0x5c66a2,'userProfileId':_0x23b654[_0x5ab1('0x50')]},'raw':!![]})['then'](function(_0x539c49){if(_0x539c49&&_0x539c49[_0x5ab1('0x51')]===0x0){return db[_0x5ab1('0x28')][_0x5ab1('0x4c')]({'name':_0x608d20[_0x5ab1('0x2c')],'resourceId':_0x608d20['id'],'type':_0x539c49[_0x5ab1('0x2c')],'sectionId':_0x539c49['id']},{})[_0x5ab1('0x25')](function(){return _0x2bf32c;});}else{return _0x2bf32c;}})['catch'](function(_0x951979){logger[_0x5ab1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x951979);throw _0x951979;});}return _0x2bf32c;})['then'](respondWithResult(_0x2ba473,0xc9))[_0x5ab1('0x46')](handleError(_0x2ba473,null));};exports[_0x5ab1('0x52')]=function(_0x4de4df,_0x527cd2){if(_0x4de4df[_0x5ab1('0x4d')]['id']){delete _0x4de4df[_0x5ab1('0x4d')]['id'];}return db[_0x5ab1('0x30')][_0x5ab1('0x4b')]({'where':{'id':_0x4de4df[_0x5ab1('0x48')]['id']}})[_0x5ab1('0x25')](handleEntityNotFound(_0x527cd2,null))[_0x5ab1('0x25')](saveUpdates(_0x4de4df[_0x5ab1('0x4d')],null))[_0x5ab1('0x25')](respondWithResult(_0x527cd2,null))[_0x5ab1('0x46')](handleError(_0x527cd2,null));};exports[_0x5ab1('0x29')]=function(_0x33afeb,_0x50502c){return db[_0x5ab1('0x30')][_0x5ab1('0x4b')]({'where':{'id':_0x33afeb[_0x5ab1('0x48')]['id']}})[_0x5ab1('0x25')](handleEntityNotFound(_0x50502c,null))[_0x5ab1('0x25')](removeEntity(_0x50502c,null))[_0x5ab1('0x46')](handleError(_0x50502c,null));};exports['describe']=function(_0x46420c,_0x12ac74){return db[_0x5ab1('0x30')][_0x5ab1('0x53')]()[_0x5ab1('0x25')](respondWithResult(_0x12ac74,null))['catch'](handleError(_0x12ac74,null));};exports[_0x5ab1('0x54')]=function(_0x571c5d,_0x26883a,_0xb49d16){var _0x1e4623={'raw':!![],'where':{}},_0x1c349c={},_0x1252dd;return db[_0x5ab1('0x30')][_0x5ab1('0x55')]({'where':{'id':_0x571c5d['params']['id']}})['then'](handleEntityNotFound(_0x26883a,null))[_0x5ab1('0x25')](function(_0x199659){if(_0x199659){_0x1252dd=_0x199659[_0x5ab1('0x26')]({'plain':!![]});_0x1c349c[_0x5ab1('0x35')]=_[_0x5ab1('0x49')](db[_0x5ab1('0x56')]['rawAttributes']);_0x1c349c[_0x5ab1('0x36')]=_[_0x5ab1('0x49')](_0x571c5d['query']);_0x1c349c[_0x5ab1('0x3d')]=_['intersection'](_0x1c349c['model'],_0x1c349c[_0x5ab1('0x36')]);_0x1e4623['attributes']=_['intersection'](_0x1c349c[_0x5ab1('0x35')],qs[_0x5ab1('0x39')](_0x571c5d['query'][_0x5ab1('0x39')]));_0x1e4623[_0x5ab1('0x37')]=_0x1e4623[_0x5ab1('0x37')][_0x5ab1('0x4a')]?_0x1e4623['attributes']:_0x1c349c['model'];if(!_0x571c5d[_0x5ab1('0x36')]['hasOwnProperty']('nolimit')){_0x1e4623['limit']=qs[_0x5ab1('0x21')](_0x571c5d[_0x5ab1('0x36')][_0x5ab1('0x21')]);_0x1e4623[_0x5ab1('0x1f')]=qs[_0x5ab1('0x1f')](_0x571c5d[_0x5ab1('0x36')][_0x5ab1('0x1f')]);}_0x1e4623[_0x5ab1('0x3b')]=qs[_0x5ab1('0x57')](_0x571c5d[_0x5ab1('0x36')][_0x5ab1('0x57')]);_0x1e4623[_0x5ab1('0x3c')]=qs[_0x5ab1('0x3d')](_[_0x5ab1('0x3e')](_0x571c5d[_0x5ab1('0x36')],_0x1c349c[_0x5ab1('0x3d')]));_0x1e4623[_0x5ab1('0x3c')][_0x5ab1('0x58')]=_0x199659['id'];if(_0x571c5d['query'][_0x5ab1('0x3f')]){_0x1e4623[_0x5ab1('0x3c')]=_[_0x5ab1('0x41')](_0x1e4623[_0x5ab1('0x3c')],{'$or':_[_0x5ab1('0x2f')](_0x1e4623[_0x5ab1('0x37')],function(_0x23e766){var _0x2e64da={};_0x2e64da[_0x23e766]={'$like':'%'+_0x571c5d[_0x5ab1('0x36')][_0x5ab1('0x3f')]+'%'};return _0x2e64da;})});}_0x1e4623=_[_0x5ab1('0x41')]({},_0x1e4623,_0x571c5d[_0x5ab1('0x42')]);return db[_0x5ab1('0x56')][_0x5ab1('0x59')](_0x1e4623);}})['then'](function(_0x13b240){if(_0x13b240){return db[_0x5ab1('0x5a')][_0x5ab1('0x5b')]({'where':{'id':_[_0x5ab1('0x2f')](_0x13b240,_0x5ab1('0x5c')),'role':_0x5ab1('0x5d')},'attributes':['id',_0x5ab1('0x2c'),_0x5ab1('0x5e'),_0x5ab1('0x5f'),'createdAt']});}})[_0x5ab1('0x25')](function(_0x1c8958){if(_0x1c8958){return{'count':_0x1c8958[_0x5ab1('0x22')],'rows':_[_0x5ab1('0x2f')](_0x1c8958[_0x5ab1('0x45')],function(_0x45a753){return{'membername':_0x45a753[_0x5ab1('0x2c')],'UserId':_0x45a753['id'],'queue_name':_0x1252dd[_0x5ab1('0x2c')],'FaxQueueId':_0x1252dd['id'],'interface':util[_0x5ab1('0x60')](_0x5ab1('0x61'),_0x5ab1('0x62'),_0x45a753[_0x5ab1('0x2c')]),'penalty':0x0,'paused':_0x45a753['faxPause'],'createdAt':_0x45a753[_0x5ab1('0x63')],'updatedAt':_0x45a753[_0x5ab1('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ab1('0x25')](respondWithFilteredResult(_0x26883a,_0x1e4623))['catch'](handleError(_0x26883a,null));};exports[_0x5ab1('0x64')]=function(_0x3572f9,_0x36d8d0,_0x5ae362){var _0x54bf11={};var _0x15c6d0={};var _0x5c4b95;var _0x3c3837;return db[_0x5ab1('0x30')][_0x5ab1('0x55')]({'where':{'id':_0x3572f9[_0x5ab1('0x48')]['id']}})[_0x5ab1('0x25')](handleEntityNotFound(_0x36d8d0,null))[_0x5ab1('0x25')](function(_0x944fe6){if(_0x944fe6){_0x5c4b95=_0x944fe6;_0x15c6d0[_0x5ab1('0x35')]=_[_0x5ab1('0x49')](db['Team'][_0x5ab1('0x31')]);_0x15c6d0[_0x5ab1('0x36')]=_[_0x5ab1('0x49')](_0x3572f9[_0x5ab1('0x36')]);_0x15c6d0[_0x5ab1('0x3d')]=_['intersection'](_0x15c6d0[_0x5ab1('0x35')],_0x15c6d0[_0x5ab1('0x36')]);_0x54bf11[_0x5ab1('0x37')]=_[_0x5ab1('0x38')](_0x15c6d0[_0x5ab1('0x35')],qs[_0x5ab1('0x39')](_0x3572f9[_0x5ab1('0x36')][_0x5ab1('0x39')]));_0x54bf11[_0x5ab1('0x37')]=_0x54bf11[_0x5ab1('0x37')][_0x5ab1('0x4a')]?_0x54bf11['attributes']:_0x15c6d0[_0x5ab1('0x35')];_0x54bf11['order']=qs['sort'](_0x3572f9['query'][_0x5ab1('0x57')]);_0x54bf11['where']=qs[_0x5ab1('0x3d')](_[_0x5ab1('0x3e')](_0x3572f9[_0x5ab1('0x36')],_0x15c6d0[_0x5ab1('0x3d')]));if(_0x3572f9[_0x5ab1('0x36')][_0x5ab1('0x3f')]){_0x54bf11['where']=_[_0x5ab1('0x41')](_0x54bf11[_0x5ab1('0x3c')],{'$or':_['map'](_0x54bf11[_0x5ab1('0x37')],function(_0x7a8a31){var _0xc786de={};_0xc786de[_0x7a8a31]={'$like':'%'+_0x3572f9[_0x5ab1('0x36')][_0x5ab1('0x3f')]+'%'};return _0xc786de;})});}_0x54bf11=_['merge']({},_0x54bf11,_0x3572f9[_0x5ab1('0x42')]);return _0x5c4b95[_0x5ab1('0x64')](_0x54bf11);}})[_0x5ab1('0x25')](function(_0xd2a3fe){if(_0xd2a3fe){_0x3c3837=_0xd2a3fe[_0x5ab1('0x4a')];if(!_0x3572f9[_0x5ab1('0x36')][_0x5ab1('0x65')](_0x5ab1('0x3a'))){_0x54bf11[_0x5ab1('0x21')]=qs[_0x5ab1('0x21')](_0x3572f9[_0x5ab1('0x36')]['limit']);_0x54bf11[_0x5ab1('0x1f')]=qs[_0x5ab1('0x1f')](_0x3572f9[_0x5ab1('0x36')][_0x5ab1('0x1f')]);}return _0x5c4b95[_0x5ab1('0x64')](_0x54bf11);}})[_0x5ab1('0x25')](function(_0x2323e5){if(_0x2323e5){return _0x2323e5?{'count':_0x3c3837,'rows':_0x2323e5}:null;}})[_0x5ab1('0x25')](respondWithResult(_0x36d8d0,null))[_0x5ab1('0x46')](handleError(_0x36d8d0,null));};exports[_0x5ab1('0x66')]=function(_0x187282,_0x8c9065,_0x977585){var _0x2e51ef=_0x187282['body']['ids'];return db[_0x5ab1('0x67')][_0x5ab1('0x59')]({'where':{'id':_0x2e51ef},'attributes':['id'],'include':[{'model':db[_0x5ab1('0x5a')],'as':'Agents','attributes':['id',_0x5ab1('0x2c'),'online',_0x5ab1('0x68'),_0x5ab1('0x69')],'raw':!![]}]})[_0x5ab1('0x25')](function(_0x78a7f7){if(_0x78a7f7){var _0x391f62=_[_0x5ab1('0x6a')](_0x78a7f7,function(_0x257e34){var _0x4e3a05=_0x257e34[_0x5ab1('0x26')]({'plain':!![]});return _0x4e3a05['Agents'];});return db[_0x5ab1('0x30')][_0x5ab1('0x4b')]({'where':{'id':_0x187282['params']['id']}})['then'](function(_0x21b493){return db['sequelize'][_0x5ab1('0x6b')](function(_0x3525aa){return _0x21b493['addTeams'](_0x2e51ef,{'transaction':_0x3525aa})['then'](function(){return BPromise[_0x5ab1('0x6c')](_0x391f62,function(_0x1ecff3){return db[_0x5ab1('0x56')][_0x5ab1('0x6d')]({'where':{'UserId':_0x1ecff3['id'],'FaxQueueId':_0x187282['params']['id']},'transaction':_0x3525aa});});})['then'](function(){_0x391f62[_0x5ab1('0x6e')](function(_0x3ca10f){socket[_0x5ab1('0x6f')](_0x5ab1('0x70'),{'UserId':_0x3ca10f['id'],'FaxQueueId':_0x21b493['id']});});});});});}})[_0x5ab1('0x25')](respondWithStatusCode(_0x8c9065,null))[_0x5ab1('0x46')](handleError(_0x8c9065,null));};exports[_0x5ab1('0x71')]=function(_0x385a25,_0x10238a,_0x420685){return db[_0x5ab1('0x67')][_0x5ab1('0x59')]({'where':{'id':_0x385a25[_0x5ab1('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5ab1('0x5a')],'as':_0x5ab1('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x10238a,null))[_0x5ab1('0x25')](function(_0x29e101){var _0x30cd79=_[_0x5ab1('0x2f')](_0x29e101,'id');var _0x23b035=[];var _0x443f40=[];var _0x5a7286=squel[_0x5ab1('0x73')]();_0x5a7286[_0x5ab1('0x74')](_0x5ab1('0x75'))[_0x5ab1('0x76')](_0x5ab1('0x77'),'tq')[_0x5ab1('0x78')](_0x5ab1('0x79'),'ut',_0x5ab1('0x7a'))[_0x5ab1('0x3c')]('FaxQueueId\x20=\x20?',_0x385a25[_0x5ab1('0x48')]['id']);for(var _0x2588bd=0x0;_0x2588bd<_0x29e101[_0x5ab1('0x4a')];_0x2588bd+=0x1){let _0x566e8d=_0x29e101[_0x2588bd];for(var _0x2a1005=0x0;_0x2a1005<_0x566e8d['Agents'][_0x5ab1('0x4a')];_0x2a1005+=0x1){let _0x30d2b8=_0x566e8d[_0x5ab1('0x72')][_0x2a1005];var _0x34157c=_0x5a7286[_0x5ab1('0x7b')]();_0x34157c[_0x5ab1('0x3c')](_0x5ab1('0x7c'),_0x30d2b8['id']);_0x443f40[_0x5ab1('0x7d')](db[_0x5ab1('0x7e')][_0x5ab1('0x36')](_0x34157c[_0x5ab1('0x7f')](),{'type':db[_0x5ab1('0x7e')][_0x5ab1('0x80')][_0x5ab1('0x81')]})[_0x5ab1('0x25')](function(_0x2d2d09){if(_0x2d2d09[_0x5ab1('0x4a')]===0x1){return _0x30d2b8['id'];}else{var _0x29d6c3=_[_0x5ab1('0x82')](_[_0x5ab1('0x2f')](_0x2d2d09,_0x5ab1('0x83')),function(_0x2db4e6){return _[_0x5ab1('0x84')](_0x30cd79,_0x2db4e6);});if(_0x29d6c3){return _0x30d2b8['id'];}}}));}}return BPromise[_0x5ab1('0x85')](_0x443f40)[_0x5ab1('0x25')](function(_0x2a6651){_0x23b035=_(_0x23b035)[_0x5ab1('0x86')](_0x2a6651)[_0x5ab1('0x87')]()[_0x5ab1('0x88')]();return db[_0x5ab1('0x30')]['find']({'where':{'id':_0x385a25[_0x5ab1('0x48')]['id']}})[_0x5ab1('0x25')](function(_0x44e3d5){return db['sequelize'][_0x5ab1('0x6b')](function(_0x3da06d){return _0x44e3d5[_0x5ab1('0x71')](_0x385a25[_0x5ab1('0x36')]['ids'],{'transaction':_0x3da06d})[_0x5ab1('0x25')](function(){if(!_[_0x5ab1('0x89')](_0x23b035)){return _0x44e3d5[_0x5ab1('0x8a')](_0x23b035,{'transaction':_0x3da06d});}})['then'](function(){_0x23b035[_0x5ab1('0x6e')](function(_0x1f7a26){socket[_0x5ab1('0x6f')]('userFaxQueue:remove',{'UserId':_0x1f7a26,'FaxQueueId':_0x44e3d5['id']});});});});});});})[_0x5ab1('0x25')](respondWithStatusCode(_0x10238a,null))[_0x5ab1('0x46')](handleError(_0x10238a,null));};exports[_0x5ab1('0x8b')]=function(_0x681147,_0x4c8fa4,_0x4d8ace){return db[_0x5ab1('0x30')]['find']({'where':{'id':_0x681147[_0x5ab1('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c8fa4,null))[_0x5ab1('0x25')](function(_0xd64a01){if(_0xd64a01){return _0xd64a01[_0x5ab1('0x8b')](_0x681147['body'][_0x5ab1('0x8c')],_[_0x5ab1('0x8d')](_0x681147[_0x5ab1('0x4d')],[_0x5ab1('0x8c'),'id'])||{})['spread'](function(_0x50cf05){for(var _0xac5ea1=0x0;_0xac5ea1<_0x681147[_0x5ab1('0x4d')][_0x5ab1('0x8c')][_0x5ab1('0x4a')];_0xac5ea1+=0x1){socket[_0x5ab1('0x6f')]('userFaxQueue:save',{'UserId':Number(_0x681147[_0x5ab1('0x4d')][_0x5ab1('0x8c')][_0xac5ea1]),'FaxQueueId':Number(_0x681147[_0x5ab1('0x48')]['id'])});}return _0x50cf05;});}})[_0x5ab1('0x25')](respondWithResult(_0x4c8fa4,null))[_0x5ab1('0x46')](handleError(_0x4c8fa4,null));};exports[_0x5ab1('0x8a')]=function(_0x13d4ae,_0x5b1d21,_0x3e97e1){return db[_0x5ab1('0x30')][_0x5ab1('0x4b')]({'where':{'id':_0x13d4ae[_0x5ab1('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b1d21,null))[_0x5ab1('0x25')](function(_0x3ccadf){if(_0x3ccadf){return _0x3ccadf[_0x5ab1('0x8a')](_0x13d4ae[_0x5ab1('0x36')]['ids'])['then'](function(){if(_[_0x5ab1('0x8e')](_0x13d4ae[_0x5ab1('0x36')][_0x5ab1('0x8c')])){for(var _0x1beee7=0x0;_0x1beee7<_0x13d4ae['query']['ids']['length'];_0x1beee7+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x13d4ae['query'][_0x5ab1('0x8c')][_0x1beee7]),'FaxQueueId':Number(_0x13d4ae[_0x5ab1('0x48')]['id'])});}}else{socket[_0x5ab1('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x13d4ae[_0x5ab1('0x36')][_0x5ab1('0x8c')]),'FaxQueueId':Number(_0x13d4ae['params']['id'])});}});}})[_0x5ab1('0x25')](respondWithStatusCode(_0x5b1d21,null))[_0x5ab1('0x46')](handleError(_0x5b1d21,null));};exports[_0x5ab1('0x8f')]=function(_0x41b358,_0x441cf5,_0x51adfd){var _0x349c66={};var _0x89dacb={};var _0x5d61b0;var _0x3d0883;return db[_0x5ab1('0x30')]['findOne']({'where':{'id':_0x41b358[_0x5ab1('0x48')]['id']}})[_0x5ab1('0x25')](handleEntityNotFound(_0x441cf5,null))['then'](function(_0x4172f8){if(_0x4172f8){_0x5d61b0=_0x4172f8;_0x89dacb[_0x5ab1('0x35')]=_[_0x5ab1('0x49')](db[_0x5ab1('0x5a')][_0x5ab1('0x31')]);_0x89dacb['query']=_[_0x5ab1('0x49')](_0x41b358[_0x5ab1('0x36')]);_0x89dacb['filters']=_['intersection'](_0x89dacb['model'],_0x89dacb[_0x5ab1('0x36')]);_0x349c66[_0x5ab1('0x37')]=_['intersection'](_0x89dacb[_0x5ab1('0x35')],qs[_0x5ab1('0x39')](_0x41b358[_0x5ab1('0x36')][_0x5ab1('0x39')]));_0x349c66[_0x5ab1('0x37')]=_0x349c66[_0x5ab1('0x37')][_0x5ab1('0x4a')]?_0x349c66[_0x5ab1('0x37')]:_0x89dacb[_0x5ab1('0x35')];_0x349c66[_0x5ab1('0x3b')]=qs[_0x5ab1('0x57')](_0x41b358['query'][_0x5ab1('0x57')]);_0x349c66[_0x5ab1('0x3c')]=qs[_0x5ab1('0x3d')](_[_0x5ab1('0x3e')](_0x41b358['query'],_0x89dacb[_0x5ab1('0x3d')]));if(_0x41b358['query'][_0x5ab1('0x3f')]){_0x349c66[_0x5ab1('0x3c')]=_[_0x5ab1('0x41')](_0x349c66[_0x5ab1('0x3c')],{'$or':_[_0x5ab1('0x2f')](_0x349c66[_0x5ab1('0x37')],function(_0x3f0985){var _0x3fad38={};_0x3fad38[_0x3f0985]={'$like':'%'+_0x41b358['query'][_0x5ab1('0x3f')]+'%'};return _0x3fad38;})});}_0x349c66=_['merge']({},_0x349c66,_0x41b358[_0x5ab1('0x42')]);return _0x5d61b0['getAgents'](_0x349c66);}})['then'](function(_0x3edd1f){if(_0x3edd1f){_0x3d0883=_0x3edd1f['length'];if(!_0x41b358[_0x5ab1('0x36')][_0x5ab1('0x65')]('nolimit')){_0x349c66['limit']=qs['limit'](_0x41b358[_0x5ab1('0x36')][_0x5ab1('0x21')]);_0x349c66[_0x5ab1('0x1f')]=qs[_0x5ab1('0x1f')](_0x41b358[_0x5ab1('0x36')][_0x5ab1('0x1f')]);}return _0x5d61b0[_0x5ab1('0x8f')](_0x349c66);}})[_0x5ab1('0x25')](function(_0x7c284c){if(_0x7c284c){return _0x7c284c?{'count':_0x3d0883,'rows':_0x7c284c}:null;}})[_0x5ab1('0x25')](respondWithResult(_0x441cf5,null))['catch'](handleError(_0x441cf5,null));}; \ No newline at end of file +var _0x25ae=['updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Agents','voicePause','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','Team','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','mustache','path','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','save','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserFaxQueue','FaxQueueId','User','UserId','faxPause'];(function(_0x3c7c49,_0x90ca1b){var _0x54eb2e=function(_0x1c7c0a){while(--_0x1c7c0a){_0x3c7c49['push'](_0x3c7c49['shift']());}};_0x54eb2e(++_0x90ca1b);}(_0x25ae,0xaf));var _0xe25a=function(_0xf6a18e,_0x134124){_0xf6a18e=_0xf6a18e-0x0;var _0xd96aba=_0x25ae[_0xf6a18e];return _0xd96aba;};'use strict';var emlformat=require(_0xe25a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe25a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe25a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe25a('0x3'));var util=require('util');var path=require(_0xe25a('0x4'));var sox=require('sox');var csv=require(_0xe25a('0x5'));var ejs=require(_0xe25a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe25a('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xe25a('0x8'));var toCsv=require(_0xe25a('0x5'));var querystring=require('querystring');var Papa=require(_0xe25a('0x9'));var Redis=require(_0xe25a('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xe25a('0xb'));var as=require(_0xe25a('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe25a('0xd'));var utils=require('../../config/utils');var config=require(_0xe25a('0xe'));var licenseUtil=require(_0xe25a('0xf'));var db=require(_0xe25a('0x10'))['db'];config[_0xe25a('0x11')]=_[_0xe25a('0x12')](config['redis'],{'host':_0xe25a('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe25a('0x11')]));require('./faxQueue.socket')[_0xe25a('0x14')](socket);function respondWithStatusCode(_0x4fbce7,_0x4a4299){_0x4a4299=_0x4a4299||0xcc;return function(_0x240ad6){if(_0x240ad6){return _0x4fbce7[_0xe25a('0x15')](_0x4a4299);}return _0x4fbce7['status'](_0x4a4299)[_0xe25a('0x16')]();};}function respondWithResult(_0x4e822e,_0x3f4471){_0x3f4471=_0x3f4471||0xc8;return function(_0x470767){if(_0x470767){return _0x4e822e[_0xe25a('0x17')](_0x3f4471)['json'](_0x470767);}};}function respondWithFilteredResult(_0x37a1a7,_0x4ff363){return function(_0x27eed0){if(_0x27eed0){var _0x3313e2=typeof _0x4ff363['offset']===_0xe25a('0x18')&&typeof _0x4ff363[_0xe25a('0x19')]===_0xe25a('0x18');var _0x47157a=_0x27eed0[_0xe25a('0x1a')];var _0x40a1cb=_0x3313e2?0x0:_0x4ff363['offset'];var _0x6bd93e=_0x3313e2?_0x27eed0[_0xe25a('0x1a')]:_0x4ff363[_0xe25a('0x1b')]+_0x4ff363['limit'];var _0x2dfe79;if(_0x6bd93e>=_0x47157a){_0x6bd93e=_0x47157a;_0x2dfe79=0xc8;}else{_0x2dfe79=0xce;}_0x37a1a7[_0xe25a('0x17')](_0x2dfe79);return _0x37a1a7[_0xe25a('0x1c')]('Content-Range',_0x40a1cb+'-'+_0x6bd93e+'/'+_0x47157a)[_0xe25a('0x1d')](_0x27eed0);}return null;};}function patchUpdates(_0x16d6ca){return function(_0x413883){try{jsonpatch[_0xe25a('0x1e')](_0x413883,_0x16d6ca,!![]);}catch(_0x2c78a5){return BPromise['reject'](_0x2c78a5);}return _0x413883[_0xe25a('0x1f')]();};}function saveUpdates(_0x474f0b,_0x3d7824){return function(_0x28f561){if(_0x28f561){return _0x28f561[_0xe25a('0x20')](_0x474f0b)['then'](function(_0x6e749a){return _0x6e749a;});}return null;};}function removeEntity(_0x3fdb3f,_0x4156cf){return function(_0x585cd3){if(_0x585cd3){return _0x585cd3[_0xe25a('0x21')]()[_0xe25a('0x22')](function(){var _0x3046c6=_0x585cd3[_0xe25a('0x23')]({'plain':!![]});var _0x443dc3=_0xe25a('0x24');return db[_0xe25a('0x25')][_0xe25a('0x21')]({'where':{'type':_0x443dc3,'resourceId':_0x3046c6['id']}})[_0xe25a('0x22')](function(){return _0x585cd3;});})[_0xe25a('0x22')](function(){_0x3fdb3f[_0xe25a('0x17')](0xcc)[_0xe25a('0x16')]();});}};}function handleEntityNotFound(_0x4d98ea,_0x354df3){return function(_0xcfc3c5){if(!_0xcfc3c5){_0x4d98ea[_0xe25a('0x15')](0x194);}return _0xcfc3c5;};}function handleError(_0xfcf9fa,_0x16f272){_0x16f272=_0x16f272||0x1f4;return function(_0x403375){logger[_0xe25a('0x26')](_0x403375[_0xe25a('0x27')]);if(_0x403375[_0xe25a('0x28')]){delete _0x403375[_0xe25a('0x28')];}_0xfcf9fa[_0xe25a('0x17')](_0x16f272)[_0xe25a('0x29')](_0x403375);};}exports[_0xe25a('0x2a')]=function(_0x13bcbf,_0x2c7f8c){var _0xca5dd7={},_0x32577e={},_0x5f2742={'count':0x0,'rows':[]};var _0x3c2747=_[_0xe25a('0x2b')](db[_0xe25a('0x2c')][_0xe25a('0x2d')],function(_0x577de1){return{'name':_0x577de1['fieldName'],'type':_0x577de1['type'][_0xe25a('0x2e')]};});_0x32577e[_0xe25a('0x2f')]=_[_0xe25a('0x2b')](_0x3c2747,_0xe25a('0x28'));_0x32577e[_0xe25a('0x30')]=_[_0xe25a('0x31')](_0x13bcbf[_0xe25a('0x30')]);_0x32577e[_0xe25a('0x32')]=_[_0xe25a('0x33')](_0x32577e[_0xe25a('0x2f')],_0x32577e[_0xe25a('0x30')]);_0xca5dd7['attributes']=_[_0xe25a('0x33')](_0x32577e[_0xe25a('0x2f')],qs[_0xe25a('0x34')](_0x13bcbf[_0xe25a('0x30')][_0xe25a('0x34')]));_0xca5dd7['attributes']=_0xca5dd7[_0xe25a('0x35')][_0xe25a('0x36')]?_0xca5dd7['attributes']:_0x32577e[_0xe25a('0x2f')];if(!_0x13bcbf[_0xe25a('0x30')][_0xe25a('0x37')](_0xe25a('0x38'))){_0xca5dd7[_0xe25a('0x19')]=qs['limit'](_0x13bcbf['query'][_0xe25a('0x19')]);_0xca5dd7[_0xe25a('0x1b')]=qs[_0xe25a('0x1b')](_0x13bcbf['query'][_0xe25a('0x1b')]);}_0xca5dd7[_0xe25a('0x39')]=qs['sort'](_0x13bcbf['query'][_0xe25a('0x3a')]);_0xca5dd7[_0xe25a('0x3b')]=qs[_0xe25a('0x32')](_[_0xe25a('0x3c')](_0x13bcbf[_0xe25a('0x30')],_0x32577e[_0xe25a('0x32')]),_0x3c2747);if(_0x13bcbf['query'][_0xe25a('0x3d')]){_0xca5dd7[_0xe25a('0x3b')]=_[_0xe25a('0x3e')](_0xca5dd7[_0xe25a('0x3b')],{'$or':_[_0xe25a('0x2b')](_0x3c2747,function(_0x3582db){if(_0x3582db[_0xe25a('0x3f')]!==_0xe25a('0x40')){var _0x1de83e={};_0x1de83e[_0x3582db[_0xe25a('0x28')]]={'$like':'%'+_0x13bcbf[_0xe25a('0x30')][_0xe25a('0x3d')]+'%'};return _0x1de83e;}})});}_0xca5dd7=_[_0xe25a('0x3e')]({},_0xca5dd7,_0x13bcbf[_0xe25a('0x41')]);var _0x262722={'where':_0xca5dd7[_0xe25a('0x3b')]};return db[_0xe25a('0x2c')]['count'](_0x262722)[_0xe25a('0x22')](function(_0x34eec6){_0x5f2742[_0xe25a('0x1a')]=_0x34eec6;if(_0x13bcbf['query'][_0xe25a('0x42')]){_0xca5dd7[_0xe25a('0x43')]=[{'all':!![]}];}return db[_0xe25a('0x2c')][_0xe25a('0x44')](_0xca5dd7);})[_0xe25a('0x22')](function(_0x1aea3c){_0x5f2742['rows']=_0x1aea3c;return _0x5f2742;})['then'](respondWithFilteredResult(_0x2c7f8c,_0xca5dd7))[_0xe25a('0x45')](handleError(_0x2c7f8c,null));};exports[_0xe25a('0x46')]=function(_0x216b04,_0x32d442){var _0x491010={'raw':!![],'where':{'id':_0x216b04[_0xe25a('0x47')]['id']}},_0x10d9c6={};_0x10d9c6[_0xe25a('0x2f')]=_[_0xe25a('0x31')](db[_0xe25a('0x2c')][_0xe25a('0x2d')]);_0x10d9c6[_0xe25a('0x30')]=_[_0xe25a('0x31')](_0x216b04[_0xe25a('0x30')]);_0x10d9c6[_0xe25a('0x32')]=_[_0xe25a('0x33')](_0x10d9c6[_0xe25a('0x2f')],_0x10d9c6[_0xe25a('0x30')]);_0x491010['attributes']=_[_0xe25a('0x33')](_0x10d9c6[_0xe25a('0x2f')],qs[_0xe25a('0x34')](_0x216b04['query'][_0xe25a('0x34')]));_0x491010[_0xe25a('0x35')]=_0x491010[_0xe25a('0x35')][_0xe25a('0x36')]?_0x491010[_0xe25a('0x35')]:_0x10d9c6[_0xe25a('0x2f')];if(_0x216b04[_0xe25a('0x30')][_0xe25a('0x42')]){_0x491010[_0xe25a('0x43')]=[{'all':!![]}];}_0x491010=_['merge']({},_0x491010,_0x216b04[_0xe25a('0x41')]);return db['FaxQueue'][_0xe25a('0x48')](_0x491010)[_0xe25a('0x22')](handleEntityNotFound(_0x32d442,null))[_0xe25a('0x22')](respondWithResult(_0x32d442,null))[_0xe25a('0x45')](handleError(_0x32d442,null));};exports[_0xe25a('0x49')]=function(_0x811537,_0x4f085a){return db['FaxQueue']['create'](_0x811537[_0xe25a('0x4a')],{})[_0xe25a('0x22')](function(_0x18efec){var _0x168398=_0x811537[_0xe25a('0x4b')]['get']({'plain':!![]});if(!_0x168398)throw new Error(_0xe25a('0x4c'));if(_0x168398['role']==='user'){var _0x2e8b0e=_0x18efec[_0xe25a('0x23')]({'plain':!![]});var _0x3105f4=_0xe25a('0x24');return db[_0xe25a('0x4d')][_0xe25a('0x48')]({'where':{'name':_0x3105f4,'userProfileId':_0x168398[_0xe25a('0x4e')]},'raw':!![]})[_0xe25a('0x22')](function(_0x3b5e3b){if(_0x3b5e3b&&_0x3b5e3b[_0xe25a('0x4f')]===0x0){return db[_0xe25a('0x25')][_0xe25a('0x49')]({'name':_0x2e8b0e[_0xe25a('0x28')],'resourceId':_0x2e8b0e['id'],'type':_0x3b5e3b['name'],'sectionId':_0x3b5e3b['id']},{})[_0xe25a('0x22')](function(){return _0x18efec;});}else{return _0x18efec;}})['catch'](function(_0x2f30f0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f30f0);throw _0x2f30f0;});}return _0x18efec;})['then'](respondWithResult(_0x4f085a,0xc9))['catch'](handleError(_0x4f085a,null));};exports[_0xe25a('0x20')]=function(_0x1ece69,_0x406c65){if(_0x1ece69[_0xe25a('0x4a')]['id']){delete _0x1ece69['body']['id'];}return db[_0xe25a('0x2c')][_0xe25a('0x48')]({'where':{'id':_0x1ece69[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0x406c65,null))['then'](saveUpdates(_0x1ece69['body'],null))['then'](respondWithResult(_0x406c65,null))[_0xe25a('0x45')](handleError(_0x406c65,null));};exports[_0xe25a('0x21')]=function(_0x5199e8,_0x521c0c){return db['FaxQueue']['find']({'where':{'id':_0x5199e8[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0x521c0c,null))[_0xe25a('0x22')](removeEntity(_0x521c0c,null))[_0xe25a('0x45')](handleError(_0x521c0c,null));};exports[_0xe25a('0x50')]=function(_0x43a4d2,_0x4a1813){return db['FaxQueue'][_0xe25a('0x50')]()[_0xe25a('0x22')](respondWithResult(_0x4a1813,null))[_0xe25a('0x45')](handleError(_0x4a1813,null));};exports['getMembers']=function(_0x15d063,_0x260b36,_0x507462){var _0x26b5ed={'raw':!![],'where':{}},_0x36bde4={},_0x1a8e53;return db[_0xe25a('0x2c')][_0xe25a('0x51')]({'where':{'id':_0x15d063[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0x260b36,null))['then'](function(_0x3f3c53){if(_0x3f3c53){_0x1a8e53=_0x3f3c53[_0xe25a('0x23')]({'plain':!![]});_0x36bde4[_0xe25a('0x2f')]=_[_0xe25a('0x31')](db[_0xe25a('0x52')][_0xe25a('0x2d')]);_0x36bde4[_0xe25a('0x30')]=_['keys'](_0x15d063['query']);_0x36bde4[_0xe25a('0x32')]=_[_0xe25a('0x33')](_0x36bde4[_0xe25a('0x2f')],_0x36bde4[_0xe25a('0x30')]);_0x26b5ed[_0xe25a('0x35')]=_[_0xe25a('0x33')](_0x36bde4[_0xe25a('0x2f')],qs[_0xe25a('0x34')](_0x15d063[_0xe25a('0x30')]['fields']));_0x26b5ed[_0xe25a('0x35')]=_0x26b5ed[_0xe25a('0x35')][_0xe25a('0x36')]?_0x26b5ed['attributes']:_0x36bde4['model'];if(!_0x15d063[_0xe25a('0x30')]['hasOwnProperty']('nolimit')){_0x26b5ed[_0xe25a('0x19')]=qs[_0xe25a('0x19')](_0x15d063[_0xe25a('0x30')][_0xe25a('0x19')]);_0x26b5ed[_0xe25a('0x1b')]=qs[_0xe25a('0x1b')](_0x15d063[_0xe25a('0x30')]['offset']);}_0x26b5ed[_0xe25a('0x39')]=qs[_0xe25a('0x3a')](_0x15d063[_0xe25a('0x30')][_0xe25a('0x3a')]);_0x26b5ed['where']=qs[_0xe25a('0x32')](_[_0xe25a('0x3c')](_0x15d063[_0xe25a('0x30')],_0x36bde4[_0xe25a('0x32')]));_0x26b5ed[_0xe25a('0x3b')][_0xe25a('0x53')]=_0x3f3c53['id'];if(_0x15d063['query']['filter']){_0x26b5ed['where']=_[_0xe25a('0x3e')](_0x26b5ed[_0xe25a('0x3b')],{'$or':_[_0xe25a('0x2b')](_0x26b5ed[_0xe25a('0x35')],function(_0x5d5d26){var _0xaa0f0={};_0xaa0f0[_0x5d5d26]={'$like':'%'+_0x15d063['query'][_0xe25a('0x3d')]+'%'};return _0xaa0f0;})});}_0x26b5ed=_['merge']({},_0x26b5ed,_0x15d063[_0xe25a('0x41')]);return db[_0xe25a('0x52')][_0xe25a('0x44')](_0x26b5ed);}})[_0xe25a('0x22')](function(_0x128244){if(_0x128244){return db[_0xe25a('0x54')]['findAndCountAll']({'where':{'id':_[_0xe25a('0x2b')](_0x128244,_0xe25a('0x55')),'role':'agent'},'attributes':['id',_0xe25a('0x28'),_0xe25a('0x56'),_0xe25a('0x57'),'createdAt']});}})['then'](function(_0x59694a){if(_0x59694a){return{'count':_0x59694a[_0xe25a('0x1a')],'rows':_[_0xe25a('0x2b')](_0x59694a[_0xe25a('0x58')],function(_0x859eef){return{'membername':_0x859eef[_0xe25a('0x28')],'UserId':_0x859eef['id'],'queue_name':_0x1a8e53[_0xe25a('0x28')],'FaxQueueId':_0x1a8e53['id'],'interface':util[_0xe25a('0x59')](_0xe25a('0x5a'),_0xe25a('0x5b'),_0x859eef['name']),'penalty':0x0,'paused':_0x859eef[_0xe25a('0x56')],'createdAt':_0x859eef[_0xe25a('0x5c')],'updatedAt':_0x859eef['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe25a('0x22')](respondWithFilteredResult(_0x260b36,_0x26b5ed))[_0xe25a('0x45')](handleError(_0x260b36,null));};exports['getTeams']=function(_0x169a7f,_0x5f35c5,_0x1c8a2c){var _0x5dcc39={};var _0x30a003={};var _0x247fb0;var _0x168e93;return db[_0xe25a('0x2c')][_0xe25a('0x51')]({'where':{'id':_0x169a7f['params']['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0x5f35c5,null))[_0xe25a('0x22')](function(_0x588d30){if(_0x588d30){_0x247fb0=_0x588d30;_0x30a003[_0xe25a('0x2f')]=_[_0xe25a('0x31')](db['Team'][_0xe25a('0x2d')]);_0x30a003[_0xe25a('0x30')]=_[_0xe25a('0x31')](_0x169a7f[_0xe25a('0x30')]);_0x30a003['filters']=_[_0xe25a('0x33')](_0x30a003[_0xe25a('0x2f')],_0x30a003['query']);_0x5dcc39[_0xe25a('0x35')]=_[_0xe25a('0x33')](_0x30a003[_0xe25a('0x2f')],qs[_0xe25a('0x34')](_0x169a7f[_0xe25a('0x30')][_0xe25a('0x34')]));_0x5dcc39[_0xe25a('0x35')]=_0x5dcc39[_0xe25a('0x35')][_0xe25a('0x36')]?_0x5dcc39[_0xe25a('0x35')]:_0x30a003[_0xe25a('0x2f')];_0x5dcc39[_0xe25a('0x39')]=qs[_0xe25a('0x3a')](_0x169a7f[_0xe25a('0x30')][_0xe25a('0x3a')]);_0x5dcc39[_0xe25a('0x3b')]=qs[_0xe25a('0x32')](_[_0xe25a('0x3c')](_0x169a7f[_0xe25a('0x30')],_0x30a003[_0xe25a('0x32')]));if(_0x169a7f['query'][_0xe25a('0x3d')]){_0x5dcc39[_0xe25a('0x3b')]=_['merge'](_0x5dcc39[_0xe25a('0x3b')],{'$or':_[_0xe25a('0x2b')](_0x5dcc39['attributes'],function(_0x2af22d){var _0x543492={};_0x543492[_0x2af22d]={'$like':'%'+_0x169a7f['query'][_0xe25a('0x3d')]+'%'};return _0x543492;})});}_0x5dcc39=_['merge']({},_0x5dcc39,_0x169a7f[_0xe25a('0x41')]);return _0x247fb0[_0xe25a('0x5d')](_0x5dcc39);}})[_0xe25a('0x22')](function(_0x56a5fc){if(_0x56a5fc){_0x168e93=_0x56a5fc['length'];if(!_0x169a7f[_0xe25a('0x30')]['hasOwnProperty'](_0xe25a('0x38'))){_0x5dcc39[_0xe25a('0x19')]=qs[_0xe25a('0x19')](_0x169a7f['query']['limit']);_0x5dcc39[_0xe25a('0x1b')]=qs[_0xe25a('0x1b')](_0x169a7f[_0xe25a('0x30')][_0xe25a('0x1b')]);}return _0x247fb0['getTeams'](_0x5dcc39);}})[_0xe25a('0x22')](function(_0x2c5651){if(_0x2c5651){return _0x2c5651?{'count':_0x168e93,'rows':_0x2c5651}:null;}})[_0xe25a('0x22')](respondWithResult(_0x5f35c5,null))['catch'](handleError(_0x5f35c5,null));};exports[_0xe25a('0x5e')]=function(_0x11b4d3,_0x3b44b6,_0x16b355){var _0x1a2c8f=_0x11b4d3[_0xe25a('0x4a')][_0xe25a('0x5f')];return db['Team'][_0xe25a('0x44')]({'where':{'id':_0x1a2c8f},'attributes':['id'],'include':[{'model':db[_0xe25a('0x54')],'as':_0xe25a('0x60'),'attributes':['id','name','online',_0xe25a('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x3be580){if(_0x3be580){var _0x27ed4f=_['flatMap'](_0x3be580,function(_0x34d189){var _0x4f654a=_0x34d189[_0xe25a('0x23')]({'plain':!![]});return _0x4f654a[_0xe25a('0x60')];});return db[_0xe25a('0x2c')][_0xe25a('0x48')]({'where':{'id':_0x11b4d3[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](function(_0x39958a){return db[_0xe25a('0x62')][_0xe25a('0x63')](function(_0x85ca9b){return _0x39958a[_0xe25a('0x5e')](_0x1a2c8f,{'transaction':_0x85ca9b})[_0xe25a('0x22')](function(){return BPromise[_0xe25a('0x64')](_0x27ed4f,function(_0x586edc){return db[_0xe25a('0x52')][_0xe25a('0x65')]({'where':{'UserId':_0x586edc['id'],'FaxQueueId':_0x11b4d3[_0xe25a('0x47')]['id']},'transaction':_0x85ca9b});});})[_0xe25a('0x22')](function(){_0x27ed4f['forEach'](function(_0x5a79c5){socket[_0xe25a('0x66')](_0xe25a('0x67'),{'UserId':_0x5a79c5['id'],'FaxQueueId':_0x39958a['id']});});});});});}})[_0xe25a('0x22')](respondWithStatusCode(_0x3b44b6,null))[_0xe25a('0x45')](handleError(_0x3b44b6,null));};exports[_0xe25a('0x68')]=function(_0x57bc57,_0x2fee22,_0x517720){return db[_0xe25a('0x69')][_0xe25a('0x44')]({'where':{'id':_0x57bc57[_0xe25a('0x30')][_0xe25a('0x5f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe25a('0x60'),'attributes':['id'],'raw':!![]}]})[_0xe25a('0x22')](handleEntityNotFound(_0x2fee22,null))[_0xe25a('0x22')](function(_0x245a17){var _0xf367fa=_[_0xe25a('0x2b')](_0x245a17,'id');var _0x38cc3c=[];var _0x2d7557=[];var _0x3338f7=squel[_0xe25a('0x6a')]();_0x3338f7[_0xe25a('0x6b')]('tq.TeamId')[_0xe25a('0x6c')](_0xe25a('0x6d'),'tq')['join'](_0xe25a('0x6e'),'ut',_0xe25a('0x6f'))[_0xe25a('0x3b')]('FaxQueueId\x20=\x20?',_0x57bc57['params']['id']);for(var _0x2268db=0x0;_0x2268db<_0x245a17[_0xe25a('0x36')];_0x2268db+=0x1){let _0x15736c=_0x245a17[_0x2268db];for(var _0x35c5e8=0x0;_0x35c5e8<_0x15736c['Agents'][_0xe25a('0x36')];_0x35c5e8+=0x1){let _0x41de07=_0x15736c[_0xe25a('0x60')][_0x35c5e8];var _0x28d7d9=_0x3338f7[_0xe25a('0x70')]();_0x28d7d9[_0xe25a('0x3b')](_0xe25a('0x71'),_0x41de07['id']);_0x2d7557[_0xe25a('0x72')](db['sequelize'][_0xe25a('0x30')](_0x28d7d9[_0xe25a('0x73')](),{'type':db[_0xe25a('0x62')][_0xe25a('0x74')][_0xe25a('0x75')]})['then'](function(_0x374fb8){if(_0x374fb8['length']===0x1){return _0x41de07['id'];}else{var _0x5c2015=_[_0xe25a('0x76')](_[_0xe25a('0x2b')](_0x374fb8,_0xe25a('0x77')),function(_0x1f821e){return _[_0xe25a('0x78')](_0xf367fa,_0x1f821e);});if(_0x5c2015){return _0x41de07['id'];}}}));}}return BPromise['all'](_0x2d7557)[_0xe25a('0x22')](function(_0x3941b8){_0x38cc3c=_(_0x38cc3c)['union'](_0x3941b8)['compact']()[_0xe25a('0x79')]();return db[_0xe25a('0x2c')][_0xe25a('0x48')]({'where':{'id':_0x57bc57['params']['id']}})[_0xe25a('0x22')](function(_0x42cc7e){return db[_0xe25a('0x62')][_0xe25a('0x63')](function(_0x97f65){return _0x42cc7e[_0xe25a('0x68')](_0x57bc57[_0xe25a('0x30')][_0xe25a('0x5f')],{'transaction':_0x97f65})[_0xe25a('0x22')](function(){if(!_[_0xe25a('0x7a')](_0x38cc3c)){return _0x42cc7e[_0xe25a('0x7b')](_0x38cc3c,{'transaction':_0x97f65});}})[_0xe25a('0x22')](function(){_0x38cc3c[_0xe25a('0x7c')](function(_0x3d9a48){socket[_0xe25a('0x66')](_0xe25a('0x7d'),{'UserId':_0x3d9a48,'FaxQueueId':_0x42cc7e['id']});});});});});});})['then'](respondWithStatusCode(_0x2fee22,null))[_0xe25a('0x45')](handleError(_0x2fee22,null));};exports[_0xe25a('0x7e')]=function(_0x199ca7,_0x1a025d,_0x2eed84){return db[_0xe25a('0x2c')][_0xe25a('0x48')]({'where':{'id':_0x199ca7[_0xe25a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a025d,null))[_0xe25a('0x22')](function(_0x40496d){if(_0x40496d){return _0x40496d['addAgents'](_0x199ca7['body'][_0xe25a('0x5f')],_[_0xe25a('0x7f')](_0x199ca7['body'],['ids','id'])||{})[_0xe25a('0x80')](function(_0x4fd1ba){for(var _0x5f2bee=0x0;_0x5f2bee<_0x199ca7[_0xe25a('0x4a')][_0xe25a('0x5f')][_0xe25a('0x36')];_0x5f2bee+=0x1){socket['emit'](_0xe25a('0x67'),{'UserId':Number(_0x199ca7[_0xe25a('0x4a')]['ids'][_0x5f2bee]),'FaxQueueId':Number(_0x199ca7[_0xe25a('0x47')]['id'])});}return _0x4fd1ba;});}})[_0xe25a('0x22')](respondWithResult(_0x1a025d,null))['catch'](handleError(_0x1a025d,null));};exports[_0xe25a('0x7b')]=function(_0x5efe3a,_0xb44d01,_0x2b205f){return db[_0xe25a('0x2c')][_0xe25a('0x48')]({'where':{'id':_0x5efe3a[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0xb44d01,null))[_0xe25a('0x22')](function(_0x32f863){if(_0x32f863){return _0x32f863[_0xe25a('0x7b')](_0x5efe3a['query'][_0xe25a('0x5f')])[_0xe25a('0x22')](function(){if(_[_0xe25a('0x81')](_0x5efe3a[_0xe25a('0x30')][_0xe25a('0x5f')])){for(var _0x5d3287=0x0;_0x5d3287<_0x5efe3a[_0xe25a('0x30')]['ids']['length'];_0x5d3287+=0x1){socket[_0xe25a('0x66')](_0xe25a('0x7d'),{'UserId':Number(_0x5efe3a[_0xe25a('0x30')][_0xe25a('0x5f')][_0x5d3287]),'FaxQueueId':Number(_0x5efe3a['params']['id'])});}}else{socket['emit'](_0xe25a('0x7d'),{'UserId':Number(_0x5efe3a[_0xe25a('0x30')][_0xe25a('0x5f')]),'FaxQueueId':Number(_0x5efe3a[_0xe25a('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xb44d01,null))[_0xe25a('0x45')](handleError(_0xb44d01,null));};exports[_0xe25a('0x82')]=function(_0x584f48,_0x23bd78,_0x428bbb){var _0x178b84={};var _0x5d012e={};var _0x6af314;var _0x599a14;return db[_0xe25a('0x2c')][_0xe25a('0x51')]({'where':{'id':_0x584f48[_0xe25a('0x47')]['id']}})[_0xe25a('0x22')](handleEntityNotFound(_0x23bd78,null))[_0xe25a('0x22')](function(_0x12634d){if(_0x12634d){_0x6af314=_0x12634d;_0x5d012e['model']=_['keys'](db[_0xe25a('0x54')][_0xe25a('0x2d')]);_0x5d012e[_0xe25a('0x30')]=_[_0xe25a('0x31')](_0x584f48[_0xe25a('0x30')]);_0x5d012e[_0xe25a('0x32')]=_[_0xe25a('0x33')](_0x5d012e[_0xe25a('0x2f')],_0x5d012e['query']);_0x178b84['attributes']=_[_0xe25a('0x33')](_0x5d012e[_0xe25a('0x2f')],qs[_0xe25a('0x34')](_0x584f48[_0xe25a('0x30')][_0xe25a('0x34')]));_0x178b84[_0xe25a('0x35')]=_0x178b84['attributes']['length']?_0x178b84['attributes']:_0x5d012e[_0xe25a('0x2f')];_0x178b84[_0xe25a('0x39')]=qs[_0xe25a('0x3a')](_0x584f48[_0xe25a('0x30')][_0xe25a('0x3a')]);_0x178b84[_0xe25a('0x3b')]=qs[_0xe25a('0x32')](_[_0xe25a('0x3c')](_0x584f48[_0xe25a('0x30')],_0x5d012e[_0xe25a('0x32')]));if(_0x584f48[_0xe25a('0x30')][_0xe25a('0x3d')]){_0x178b84[_0xe25a('0x3b')]=_[_0xe25a('0x3e')](_0x178b84[_0xe25a('0x3b')],{'$or':_[_0xe25a('0x2b')](_0x178b84[_0xe25a('0x35')],function(_0x445a7f){var _0x1e1df2={};_0x1e1df2[_0x445a7f]={'$like':'%'+_0x584f48[_0xe25a('0x30')][_0xe25a('0x3d')]+'%'};return _0x1e1df2;})});}_0x178b84=_['merge']({},_0x178b84,_0x584f48[_0xe25a('0x41')]);return _0x6af314['getAgents'](_0x178b84);}})[_0xe25a('0x22')](function(_0x26c1cc){if(_0x26c1cc){_0x599a14=_0x26c1cc[_0xe25a('0x36')];if(!_0x584f48[_0xe25a('0x30')][_0xe25a('0x37')](_0xe25a('0x38'))){_0x178b84['limit']=qs[_0xe25a('0x19')](_0x584f48['query']['limit']);_0x178b84[_0xe25a('0x1b')]=qs[_0xe25a('0x1b')](_0x584f48[_0xe25a('0x30')][_0xe25a('0x1b')]);}return _0x6af314[_0xe25a('0x82')](_0x178b84);}})[_0xe25a('0x22')](function(_0x13f597){if(_0x13f597){return _0x13f597?{'count':_0x599a14,'rows':_0x13f597}:null;}})[_0xe25a('0x22')](respondWithResult(_0x23bd78,null))[_0xe25a('0x45')](handleError(_0x23bd78,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f9d8654..9f7af98 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eae=['../../mysqldb','FaxQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x2eae,0x1e5));var _0xe2ea=function(_0x26809a,_0x33166c){_0x26809a=_0x26809a-0x0;var _0x257207=_0x2eae[_0x26809a];return _0x257207;};'use strict';var EventEmitter=require(_0xe2ea('0x0'));var FaxQueue=require(_0xe2ea('0x1'))['db'][_0xe2ea('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe2ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe2ea('0x4')};function emitEvent(_0x27ce84){return function(_0x32d4e4,_0x345952,_0x5902ee){FaxQueueEvents['emit'](_0x27ce84+':'+_0x32d4e4['id'],_0x32d4e4);FaxQueueEvents[_0xe2ea('0x5')](_0x27ce84,_0x32d4e4);_0x5902ee(null);};}for(var e in events){if(events[_0xe2ea('0x6')](e)){var event=events[e];FaxQueue[_0xe2ea('0x7')](e,emitEvent(event));}}module[_0xe2ea('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x7082=['hook','exports','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x7082,0x182));var _0x2708=function(_0x3799cd,_0x131494){_0x3799cd=_0x3799cd-0x0;var _0x3410d3=_0x7082[_0x3799cd];return _0x3410d3;};'use strict';var EventEmitter=require(_0x2708('0x0'));var FaxQueue=require(_0x2708('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2708('0x2'),'afterDestroy':_0x2708('0x3')};function emitEvent(_0x456cb8){return function(_0x3c15ed,_0xd3372d,_0x48ded3){FaxQueueEvents['emit'](_0x456cb8+':'+_0x3c15ed['id'],_0x3c15ed);FaxQueueEvents[_0x2708('0x4')](_0x456cb8,_0x3c15ed);_0x48ded3(null);};}for(var e in events){if(events[_0x2708('0x5')](e)){var event=events[e];FaxQueue[_0x2708('0x6')](e,emitEvent(event));}}module[_0x2708('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f3d98c4..d1e6083 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9888=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util'];(function(_0x2e65a7,_0x1d460b){var _0x15fc1a=function(_0x5af2f7){while(--_0x5af2f7){_0x2e65a7['push'](_0x2e65a7['shift']());}};_0x15fc1a(++_0x1d460b);}(_0x9888,0x136));var _0x8988=function(_0x114575,_0x18d9dd){_0x114575=_0x114575-0x0;var _0x385ce3=_0x9888[_0x114575];return _0x385ce3;};'use strict';var _=require(_0x8988('0x0'));var util=require(_0x8988('0x1'));var logger=require(_0x8988('0x2'))(_0x8988('0x3'));var moment=require(_0x8988('0x4'));var BPromise=require('bluebird');var rp=require(_0x8988('0x5'));var fs=require('fs');var path=require(_0x8988('0x6'));var rimraf=require(_0x8988('0x7'));var config=require(_0x8988('0x8'));var attributes=require(_0x8988('0x9'));module['exports']=function(_0x4d09db,_0x1d6353){return _0x4d09db['define'](_0x8988('0xa'),attributes,{'tableName':_0x8988('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9d0=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xb9d0,0xe1));var _0x0b9d=function(_0xee5f4b,_0x33a91e){_0xee5f4b=_0xee5f4b-0x0;var _0x41a10e=_0xb9d0[_0xee5f4b];return _0x41a10e;};'use strict';var _=require(_0x0b9d('0x0'));var util=require(_0x0b9d('0x1'));var logger=require(_0x0b9d('0x2'))(_0x0b9d('0x3'));var moment=require(_0x0b9d('0x4'));var BPromise=require('bluebird');var rp=require(_0x0b9d('0x5'));var fs=require('fs');var path=require(_0x0b9d('0x6'));var rimraf=require(_0x0b9d('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b9d('0x8'));module[_0x0b9d('0x9')]=function(_0xb415d6,_0x2db222){return _0xb415d6[_0x0b9d('0xa')](_0x0b9d('0xb'),attributes,{'tableName':_0x0b9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 3a7ef52..c3cb505 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1558=['GetFaxQueue','stringify','ShowFaxQueue','FaxQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','findAll','options','raw','where','limit','map','include','model','attributes'];(function(_0x5a46fc,_0x14a3f6){var _0x155b92=function(_0x147792){while(--_0x147792){_0x5a46fc['push'](_0x5a46fc['shift']());}};_0x155b92(++_0x14a3f6);}(_0x1558,0x19b));var _0x8155=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x1558[_0x5192de];return _0x4e287e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8155('0x0'));var BPromise=require(_0x8155('0x1'));var rs=require(_0x8155('0x2'));var fs=require('fs');var Redis=require(_0x8155('0x3'));var db=require(_0x8155('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8155('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8155('0x6')][_0x8155('0x7')]({'port':0x232a});config[_0x8155('0x8')]=_[_0x8155('0x9')](config['redis'],{'host':_0x8155('0xa'),'port':0x18eb});var socket=require(_0x8155('0xb'))(new Redis(config[_0x8155('0x8')]));require(_0x8155('0xc'))[_0x8155('0xd')](socket);function respondWithRpcPromise(_0x48df58,_0x294958,_0x42e8e3){return new BPromise(function(_0x3757a7,_0x1acc0e){return client['request'](_0x48df58,_0x42e8e3)[_0x8155('0xe')](function(_0x3ca26f){logger['info'](_0x8155('0xf'),_0x294958,_0x8155('0x10'));logger[_0x8155('0x11')](_0x8155('0x12'),_0x294958,'request\x20sent',JSON['stringify'](_0x3ca26f));if(_0x3ca26f[_0x8155('0x13')]){if(_0x3ca26f[_0x8155('0x13')]['code']===0x1f4){logger[_0x8155('0x13')](_0x8155('0xf'),_0x294958,_0x3ca26f[_0x8155('0x13')][_0x8155('0x14')]);return _0x1acc0e(_0x3ca26f['error'][_0x8155('0x14')]);}logger[_0x8155('0x13')]('FaxQueue,\x20%s,\x20%s',_0x294958,_0x3ca26f[_0x8155('0x13')][_0x8155('0x14')]);return _0x3757a7(_0x3ca26f['error'][_0x8155('0x14')]);}else{logger[_0x8155('0x15')](_0x8155('0xf'),_0x294958,_0x8155('0x10'));_0x3757a7(_0x3ca26f[_0x8155('0x16')][_0x8155('0x14')]);}})[_0x8155('0x17')](function(_0x274a2e){logger[_0x8155('0x13')]('FaxQueue,\x20%s,\x20%s',_0x294958,_0x274a2e);_0x1acc0e(_0x274a2e);});});}exports['GetFaxQueue']=function(_0xcf9cc3){var _0x277457=this;return new Promise(function(_0x3441f7,_0x4417ad){return db['FaxQueue'][_0x8155('0x18')]({'raw':_0xcf9cc3[_0x8155('0x19')]?_0xcf9cc3[_0x8155('0x19')][_0x8155('0x1a')]===undefined?!![]:![]:!![],'where':_0xcf9cc3[_0x8155('0x19')]?_0xcf9cc3[_0x8155('0x19')][_0x8155('0x1b')]||null:null,'attributes':_0xcf9cc3[_0x8155('0x19')]?_0xcf9cc3[_0x8155('0x19')]['attributes']||null:null,'limit':_0xcf9cc3[_0x8155('0x19')]?_0xcf9cc3['options'][_0x8155('0x1c')]||null:null,'include':_0xcf9cc3[_0x8155('0x19')]?_0xcf9cc3['options']['include']?_[_0x8155('0x1d')](_0xcf9cc3['options'][_0x8155('0x1e')],function(_0x2a4444){return{'model':db[_0x2a4444[_0x8155('0x1f')]],'as':_0x2a4444['as'],'attributes':_0x2a4444[_0x8155('0x20')],'include':_0x2a4444[_0x8155('0x1e')]?_[_0x8155('0x1d')](_0x2a4444[_0x8155('0x1e')],function(_0x5dd5e7){return{'model':db[_0x5dd5e7[_0x8155('0x1f')]],'as':_0x5dd5e7['as'],'attributes':_0x5dd5e7[_0x8155('0x20')],'include':_0x5dd5e7[_0x8155('0x1e')]?_['map'](_0x5dd5e7[_0x8155('0x1e')],function(_0x540d4a){return{'model':db[_0x540d4a['model']],'as':_0x540d4a['as'],'attributes':_0x540d4a[_0x8155('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b2252){logger['info']('GetFaxQueue',_0xcf9cc3);logger[_0x8155('0x11')](_0x8155('0x21'),_0xcf9cc3,JSON[_0x8155('0x22')](_0x2b2252));_0x3441f7(_0x2b2252);})['catch'](function(_0x49b239){logger[_0x8155('0x13')]('GetFaxQueue',_0x49b239[_0x8155('0x14')],_0xcf9cc3);_0x4417ad(_0x277457['error'](0x1f4,_0x49b239[_0x8155('0x14')]));});});};exports[_0x8155('0x23')]=function(_0x13779b){var _0x3be140=this;return new Promise(function(_0x5484b2,_0x30a7c1){return db[_0x8155('0x24')]['find']({'raw':_0x13779b[_0x8155('0x19')]?_0x13779b[_0x8155('0x19')][_0x8155('0x1a')]===undefined?!![]:![]:!![],'where':_0x13779b['options']?_0x13779b['options'][_0x8155('0x1b')]||null:null,'attributes':_0x13779b[_0x8155('0x19')]?_0x13779b['options']['attributes']||null:null,'include':_0x13779b[_0x8155('0x19')]?_0x13779b[_0x8155('0x19')][_0x8155('0x1e')]?_[_0x8155('0x1d')](_0x13779b[_0x8155('0x19')][_0x8155('0x1e')],function(_0x3a59b8){return{'model':db[_0x3a59b8[_0x8155('0x1f')]],'as':_0x3a59b8['as'],'attributes':_0x3a59b8[_0x8155('0x20')],'include':_0x3a59b8['include']?_[_0x8155('0x1d')](_0x3a59b8[_0x8155('0x1e')],function(_0x46560e){return{'model':db[_0x46560e[_0x8155('0x1f')]],'as':_0x46560e['as'],'attributes':_0x46560e['attributes'],'include':_0x46560e[_0x8155('0x1e')]?_[_0x8155('0x1d')](_0x46560e['include'],function(_0x132d27){return{'model':db[_0x132d27[_0x8155('0x1f')]],'as':_0x132d27['as'],'attributes':_0x132d27[_0x8155('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8155('0xe')](function(_0x1dbe66){logger['info'](_0x8155('0x23'),_0x13779b);logger['debug'](_0x8155('0x23'),_0x13779b,JSON[_0x8155('0x22')](_0x1dbe66));_0x5484b2(_0x1dbe66);})[_0x8155('0x17')](function(_0x31852b){logger[_0x8155('0x13')](_0x8155('0x23'),_0x31852b[_0x8155('0x14')],_0x13779b);_0x30a7c1(_0x3be140[_0x8155('0x13')](0x1f4,_0x31852b['message']));});});}; \ No newline at end of file +var _0xc95f=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','model','attributes','map','ShowFaxQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x437db4,_0x711b41){var _0x25bc71=function(_0x5ac27f){while(--_0x5ac27f){_0x437db4['push'](_0x437db4['shift']());}};_0x25bc71(++_0x711b41);}(_0xc95f,0x99));var _0xfc95=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0xc95f[_0x38c0b2];return _0x283c00;};'use strict';var _=require('lodash');var util=require(_0xfc95('0x0'));var moment=require('moment');var BPromise=require(_0xfc95('0x1'));var rs=require(_0xfc95('0x2'));var fs=require('fs');var Redis=require(_0xfc95('0x3'));var db=require(_0xfc95('0x4'))['db'];var utils=require(_0xfc95('0x5'));var logger=require(_0xfc95('0x6'))(_0xfc95('0x7'));var config=require(_0xfc95('0x8'));var jayson=require(_0xfc95('0x9'));var client=jayson[_0xfc95('0xa')][_0xfc95('0xb')]({'port':0x232a});config[_0xfc95('0xc')]=_[_0xfc95('0xd')](config[_0xfc95('0xc')],{'host':_0xfc95('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc95('0xf'))[_0xfc95('0x10')](socket);function respondWithRpcPromise(_0x20c05c,_0x2ed5b5,_0x41922b){return new BPromise(function(_0x2e1483,_0x58853a){return client['request'](_0x20c05c,_0x41922b)[_0xfc95('0x11')](function(_0x2b4fbd){logger[_0xfc95('0x12')]('FaxQueue,\x20%s,\x20%s',_0x2ed5b5,_0xfc95('0x13'));logger[_0xfc95('0x14')](_0xfc95('0x15'),_0x2ed5b5,_0xfc95('0x13'),JSON[_0xfc95('0x16')](_0x2b4fbd));if(_0x2b4fbd[_0xfc95('0x17')]){if(_0x2b4fbd['error'][_0xfc95('0x18')]===0x1f4){logger[_0xfc95('0x17')](_0xfc95('0x19'),_0x2ed5b5,_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);return _0x58853a(_0x2b4fbd['error'][_0xfc95('0x1a')]);}logger['error'](_0xfc95('0x19'),_0x2ed5b5,_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);return _0x2e1483(_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);}else{logger[_0xfc95('0x12')](_0xfc95('0x19'),_0x2ed5b5,_0xfc95('0x13'));_0x2e1483(_0x2b4fbd['result'][_0xfc95('0x1a')]);}})[_0xfc95('0x1b')](function(_0x534562){logger[_0xfc95('0x17')]('FaxQueue,\x20%s,\x20%s',_0x2ed5b5,_0x534562);_0x58853a(_0x534562);});});}exports[_0xfc95('0x1c')]=function(_0x2c0747){var _0x122e49=this;return new Promise(function(_0x11f8b0,_0x179f2d){return db[_0xfc95('0x1d')]['findAll']({'raw':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c0747['options']?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x20')]||null:null,'attributes':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747['options']['attributes']||null:null,'limit':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x21')]||null:null,'include':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x22')]?_['map'](_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x22')],function(_0x339d72){return{'model':db[_0x339d72[_0xfc95('0x23')]],'as':_0x339d72['as'],'attributes':_0x339d72[_0xfc95('0x24')],'include':_0x339d72[_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x339d72[_0xfc95('0x22')],function(_0x3577dd){return{'model':db[_0x3577dd[_0xfc95('0x23')]],'as':_0x3577dd['as'],'attributes':_0x3577dd[_0xfc95('0x24')],'include':_0x3577dd['include']?_[_0xfc95('0x25')](_0x3577dd[_0xfc95('0x22')],function(_0x11695a){return{'model':db[_0x11695a[_0xfc95('0x23')]],'as':_0x11695a['as'],'attributes':_0x11695a[_0xfc95('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfc95('0x11')](function(_0x6e8167){logger[_0xfc95('0x12')](_0xfc95('0x1c'),_0x2c0747);logger['debug'](_0xfc95('0x1c'),_0x2c0747,JSON[_0xfc95('0x16')](_0x6e8167));_0x11f8b0(_0x6e8167);})['catch'](function(_0x492c2c){logger[_0xfc95('0x17')]('GetFaxQueue',_0x492c2c[_0xfc95('0x1a')],_0x2c0747);_0x179f2d(_0x122e49[_0xfc95('0x17')](0x1f4,_0x492c2c[_0xfc95('0x1a')]));});});};exports[_0xfc95('0x26')]=function(_0x269767){var _0x1a641f=this;return new Promise(function(_0x580c63,_0x2da23f){return db[_0xfc95('0x1d')][_0xfc95('0x27')]({'raw':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')][_0xfc95('0x1f')]===undefined?!![]:![]:!![],'where':_0x269767[_0xfc95('0x1e')]?_0x269767['options'][_0xfc95('0x20')]||null:null,'attributes':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')]['attributes']||null:null,'include':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')][_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x269767['options'][_0xfc95('0x22')],function(_0x42cb95){return{'model':db[_0x42cb95[_0xfc95('0x23')]],'as':_0x42cb95['as'],'attributes':_0x42cb95[_0xfc95('0x24')],'include':_0x42cb95['include']?_[_0xfc95('0x25')](_0x42cb95['include'],function(_0x22980c){return{'model':db[_0x22980c[_0xfc95('0x23')]],'as':_0x22980c['as'],'attributes':_0x22980c[_0xfc95('0x24')],'include':_0x22980c[_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x22980c[_0xfc95('0x22')],function(_0x2d7115){return{'model':db[_0x2d7115['model']],'as':_0x2d7115['as'],'attributes':_0x2d7115[_0xfc95('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfc95('0x11')](function(_0x1cab50){logger[_0xfc95('0x12')]('ShowFaxQueue',_0x269767);logger[_0xfc95('0x14')]('ShowFaxQueue',_0x269767,JSON[_0xfc95('0x16')](_0x1cab50));_0x580c63(_0x1cab50);})[_0xfc95('0x1b')](function(_0x40f864){logger['error'](_0xfc95('0x26'),_0x40f864[_0xfc95('0x1a')],_0x269767);_0x2da23f(_0x1a641f['error'](0x1f4,_0x40f864['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0651079..25e510f 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5de0=['removeListener','length','faxQueue:','update','emit'];(function(_0x35a9fd,_0x540c82){var _0x26242e=function(_0x581b0f){while(--_0x581b0f){_0x35a9fd['push'](_0x35a9fd['shift']());}};_0x26242e(++_0x540c82);}(_0x5de0,0xb7));var _0x05de=function(_0x54bdb4,_0x33adeb){_0x54bdb4=_0x54bdb4-0x0;var _0x30593a=_0x5de0[_0x54bdb4];return _0x30593a;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0x05de('0x0')];function createListener(_0x2476e7,_0x25c8ec){return function(_0x431c6f){_0x25c8ec[_0x05de('0x1')](_0x2476e7,_0x431c6f);};}function removeListener(_0x369e09,_0x346a20){return function(){FaxQueueEvents[_0x05de('0x2')](_0x369e09,_0x346a20);};}exports['register']=function(_0x3c8dfc){for(var _0x5d8b18=0x0,_0x1ccc4c=events[_0x05de('0x3')];_0x5d8b18<_0x1ccc4c;_0x5d8b18++){var _0x47d9a1=events[_0x5d8b18];var _0x52e36d=createListener(_0x05de('0x4')+_0x47d9a1,_0x3c8dfc);FaxQueueEvents['on'](_0x47d9a1,_0x52e36d);}}; \ No newline at end of file +var _0xb322=['update','removeListener','register','length','faxQueue:','save','remove'];(function(_0x3d0d65,_0x4dc733){var _0x100c99=function(_0x2ac059){while(--_0x2ac059){_0x3d0d65['push'](_0x3d0d65['shift']());}};_0x100c99(++_0x4dc733);}(_0xb322,0x139));var _0x2b32=function(_0x4d0924,_0x643e0){_0x4d0924=_0x4d0924-0x0;var _0x5db986=_0xb322[_0x4d0924];return _0x5db986;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x2b32('0x0'),_0x2b32('0x1'),_0x2b32('0x2')];function createListener(_0x10618a,_0x443c37){return function(_0xc7ac5f){_0x443c37['emit'](_0x10618a,_0xc7ac5f);};}function removeListener(_0x3d1e48,_0x1b30f5){return function(){FaxQueueEvents[_0x2b32('0x3')](_0x3d1e48,_0x1b30f5);};}exports[_0x2b32('0x4')]=function(_0x174e99){for(var _0x38098a=0x0,_0x4468a8=events[_0x2b32('0x5')];_0x38098a<_0x4468a8;_0x38098a++){var _0x11b2af=events[_0x38098a];var _0x2c06bb=createListener(_0x2b32('0x6')+_0x11b2af,_0x174e99);FaxQueueEvents['on'](_0x11b2af,_0x2c06bb);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index eb3c020..143dfed 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['addAgents','put','update','destroy','delete','/:id/teams','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users'];(function(_0x2dd3ca,_0x3b1f89){var _0x1ebfb2=function(_0x3965e9){while(--_0x3965e9){_0x2dd3ca['push'](_0x2dd3ca['shift']());}};_0x1ebfb2(++_0x3b1f89);}(_0x4991,0xf7));var _0x1499=function(_0x268b1b,_0x4caa1a){_0x268b1b=_0x268b1b-0x0;var _0x17bec6=_0x4991[_0x268b1b];return _0x17bec6;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['show']);router[_0x1499('0x9')](_0x1499('0xf'),auth['isAuthenticated'](),controller[_0x1499('0x10')]);router[_0x1499('0x9')]('/:id/teams',auth[_0x1499('0xc')](),controller[_0x1499('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x1499('0x12')]);router[_0x1499('0x13')]('/',auth[_0x1499('0xc')](),controller[_0x1499('0x14')]);router[_0x1499('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1499('0x15')]);router['post'](_0x1499('0x16'),auth[_0x1499('0xc')](),controller[_0x1499('0x17')]);router[_0x1499('0x18')]('/:id',auth[_0x1499('0xc')](),controller[_0x1499('0x19')]);router['delete'](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x1a')]);router[_0x1499('0x1b')](_0x1499('0x1c'),auth[_0x1499('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1499('0xc')](),controller[_0x1499('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xaa37=['delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','/:id','destroy'];(function(_0x4411bb,_0x42edf8){var _0x19afc8=function(_0x487cd4){while(--_0x487cd4){_0x4411bb['push'](_0x4411bb['shift']());}};_0x19afc8(++_0x42edf8);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaa37[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/describe',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0xa')](_0x7aa3('0xf'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x10')]);router['get']('/:id/teams',auth[_0x7aa3('0xc')](),controller['getTeams']);router[_0x7aa3('0xa')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x12')]);router[_0x7aa3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7aa3('0x14'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x15')]);router[_0x7aa3('0x13')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x16')]);router[_0x7aa3('0x17')](_0x7aa3('0x18'),auth[_0x7aa3('0xc')](),controller['update']);router['delete'](_0x7aa3('0x18'),auth['isAuthenticated'](),controller[_0x7aa3('0x19')]);router[_0x7aa3('0x1a')]('/:id/teams',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x1b')]);router[_0x7aa3('0x1a')](_0x7aa3('0x11'),auth[_0x7aa3('0xc')](),controller['removeAgents']);module[_0x7aa3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index af2f766..5201e6b 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91e6=['DATE','moment','sequelize','exports','STRING'];(function(_0x2323df,_0x116515){var _0x21177d=function(_0x198f5e){while(--_0x198f5e){_0x2323df['push'](_0x2323df['shift']());}};_0x21177d(++_0x116515);}(_0x91e6,0x123));var _0x691e=function(_0x4e2a94,_0x460ba0){_0x4e2a94=_0x4e2a94-0x0;var _0x5164af=_0x91e6[_0x4e2a94];return _0x5164af;};'use strict';var moment=require(_0x691e('0x0'));var Sequelize=require(_0x691e('0x1'));module[_0x691e('0x2')]={'uniqueid':{'type':Sequelize[_0x691e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x691e('0x3')]},'joinAt':{'type':Sequelize[_0x691e('0x4')]},'leaveAt':{'type':Sequelize[_0x691e('0x4')]},'acceptAt':{'type':Sequelize[_0x691e('0x4')]},'exitAt':{'type':Sequelize[_0x691e('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2698=['STRING','DATE','moment'];(function(_0x2d4520,_0x3103f8){var _0xee272b=function(_0x52c108){while(--_0x52c108){_0x2d4520['push'](_0x2d4520['shift']());}};_0xee272b(++_0x3103f8);}(_0x2698,0x1e5));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8269('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8269('0x1')]},'joinAt':{'type':Sequelize[_0x8269('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8269('0x2')]},'exitAt':{'type':Sequelize[_0x8269('0x2')]},'reason':{'type':Sequelize[_0x8269('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5411fb3..55bff8d 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee1=['filters','pick','filter','VIRTUAL','name','includeAll','rows','catch','show','params','include','merge','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5f35c5,_0x48949c){var _0x5e5d64=function(_0x3e968f){while(--_0x3e968f){_0x5f35c5['push'](_0x5f35c5['shift']());}};_0x5e5d64(++_0x48949c);}(_0x7ee1,0xab));var _0x17ee=function(_0x2ee8fe,_0x161eb4){_0x2ee8fe=_0x2ee8fe-0x0;var _0x4e74b3=_0x7ee1[_0x2ee8fe];return _0x4e74b3;};'use strict';var emlformat=require(_0x17ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17ee('0x1'));var jsonpatch=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var moment=require(_0x17ee('0x4'));var BPromise=require(_0x17ee('0x5'));var Mustache=require('mustache');var util=require(_0x17ee('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x17ee('0x7'));var ejs=require(_0x17ee('0x8'));var fs=require('fs');var fs_extra=require(_0x17ee('0x9'));var _=require(_0x17ee('0xa'));var squel=require(_0x17ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x17ee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x17ee('0x7'));var querystring=require(_0x17ee('0xd'));var Papa=require('papaparse');var Redis=require(_0x17ee('0xe'));var authService=require(_0x17ee('0xf'));var qs=require(_0x17ee('0x10'));var as=require(_0x17ee('0x11'));var hardwareService=require(_0x17ee('0x12'));var logger=require(_0x17ee('0x13'))(_0x17ee('0x14'));var utils=require(_0x17ee('0x15'));var config=require(_0x17ee('0x16'));var licenseUtil=require(_0x17ee('0x17'));var db=require(_0x17ee('0x18'))['db'];function respondWithStatusCode(_0x372279,_0x5aa625){_0x5aa625=_0x5aa625||0xcc;return function(_0x2a0f19){if(_0x2a0f19){return _0x372279[_0x17ee('0x19')](_0x5aa625);}return _0x372279['status'](_0x5aa625)[_0x17ee('0x1a')]();};}function respondWithResult(_0x53a2c2,_0x2f452e){_0x2f452e=_0x2f452e||0xc8;return function(_0x27447d){if(_0x27447d){return _0x53a2c2[_0x17ee('0x1b')](_0x2f452e)[_0x17ee('0x1c')](_0x27447d);}};}function respondWithFilteredResult(_0x5eebbc,_0x3fa583){return function(_0x749078){if(_0x749078){var _0x1b09a3=typeof _0x3fa583['offset']===_0x17ee('0x1d')&&typeof _0x3fa583[_0x17ee('0x1e')]===_0x17ee('0x1d');var _0x384eaa=_0x749078[_0x17ee('0x1f')];var _0x3785ed=_0x1b09a3?0x0:_0x3fa583[_0x17ee('0x20')];var _0x5506a3=_0x1b09a3?_0x749078['count']:_0x3fa583[_0x17ee('0x20')]+_0x3fa583[_0x17ee('0x1e')];var _0x1f8fb;if(_0x5506a3>=_0x384eaa){_0x5506a3=_0x384eaa;_0x1f8fb=0xc8;}else{_0x1f8fb=0xce;}_0x5eebbc[_0x17ee('0x1b')](_0x1f8fb);return _0x5eebbc['set'](_0x17ee('0x21'),_0x3785ed+'-'+_0x5506a3+'/'+_0x384eaa)[_0x17ee('0x1c')](_0x749078);}return null;};}function patchUpdates(_0x25782c){return function(_0x3ace7f){try{jsonpatch['apply'](_0x3ace7f,_0x25782c,!![]);}catch(_0x2354a5){return BPromise[_0x17ee('0x22')](_0x2354a5);}return _0x3ace7f[_0x17ee('0x23')]();};}function saveUpdates(_0x54daae,_0x3672df){return function(_0x2d0297){if(_0x2d0297){return _0x2d0297[_0x17ee('0x24')](_0x54daae)[_0x17ee('0x25')](function(_0x3aee75){return _0x3aee75;});}return null;};}function removeEntity(_0x4804ea,_0x249a48){return function(_0xc01da5){if(_0xc01da5){return _0xc01da5[_0x17ee('0x26')]()[_0x17ee('0x25')](function(){_0x4804ea[_0x17ee('0x1b')](0xcc)[_0x17ee('0x1a')]();});}};}function handleEntityNotFound(_0x13e8ff,_0x51a282){return function(_0x4f24a8){if(!_0x4f24a8){_0x13e8ff[_0x17ee('0x19')](0x194);}return _0x4f24a8;};}function handleError(_0x1e24bf,_0x34040a){_0x34040a=_0x34040a||0x1f4;return function(_0x32b311){logger[_0x17ee('0x27')](_0x32b311[_0x17ee('0x28')]);if(_0x32b311['name']){delete _0x32b311['name'];}_0x1e24bf[_0x17ee('0x1b')](_0x34040a)[_0x17ee('0x29')](_0x32b311);};}exports[_0x17ee('0x2a')]=function(_0x5ea202,_0x393231){var _0x34b003={},_0x954455={},_0x4ff2dc={'count':0x0,'rows':[]};var _0x3bcf94=_[_0x17ee('0x2b')](db[_0x17ee('0x2c')][_0x17ee('0x2d')],function(_0x4dfb63){return{'name':_0x4dfb63[_0x17ee('0x2e')],'type':_0x4dfb63[_0x17ee('0x2f')][_0x17ee('0x30')]};});_0x954455['model']=_[_0x17ee('0x2b')](_0x3bcf94,'name');_0x954455[_0x17ee('0x31')]=_[_0x17ee('0x32')](_0x5ea202[_0x17ee('0x31')]);_0x954455['filters']=_[_0x17ee('0x33')](_0x954455['model'],_0x954455[_0x17ee('0x31')]);_0x34b003[_0x17ee('0x34')]=_[_0x17ee('0x33')](_0x954455[_0x17ee('0x35')],qs['fields'](_0x5ea202[_0x17ee('0x31')][_0x17ee('0x36')]));_0x34b003[_0x17ee('0x34')]=_0x34b003['attributes'][_0x17ee('0x37')]?_0x34b003[_0x17ee('0x34')]:_0x954455[_0x17ee('0x35')];if(!_0x5ea202['query'][_0x17ee('0x38')](_0x17ee('0x39'))){_0x34b003[_0x17ee('0x1e')]=qs[_0x17ee('0x1e')](_0x5ea202[_0x17ee('0x31')][_0x17ee('0x1e')]);_0x34b003[_0x17ee('0x20')]=qs[_0x17ee('0x20')](_0x5ea202[_0x17ee('0x31')][_0x17ee('0x20')]);}_0x34b003['order']=qs[_0x17ee('0x3a')](_0x5ea202[_0x17ee('0x31')][_0x17ee('0x3a')]);_0x34b003[_0x17ee('0x3b')]=qs[_0x17ee('0x3c')](_[_0x17ee('0x3d')](_0x5ea202[_0x17ee('0x31')],_0x954455[_0x17ee('0x3c')]),_0x3bcf94);if(_0x5ea202[_0x17ee('0x31')][_0x17ee('0x3e')]){_0x34b003[_0x17ee('0x3b')]=_['merge'](_0x34b003[_0x17ee('0x3b')],{'$or':_[_0x17ee('0x2b')](_0x3bcf94,function(_0x5914b4){if(_0x5914b4[_0x17ee('0x2f')]!==_0x17ee('0x3f')){var _0x21cdf6={};_0x21cdf6[_0x5914b4[_0x17ee('0x40')]]={'$like':'%'+_0x5ea202[_0x17ee('0x31')][_0x17ee('0x3e')]+'%'};return _0x21cdf6;}})});}_0x34b003=_['merge']({},_0x34b003,_0x5ea202['options']);var _0x3a22d6={'where':_0x34b003[_0x17ee('0x3b')]};return db[_0x17ee('0x2c')][_0x17ee('0x1f')](_0x3a22d6)[_0x17ee('0x25')](function(_0x19a52d){_0x4ff2dc['count']=_0x19a52d;if(_0x5ea202[_0x17ee('0x31')][_0x17ee('0x41')]){_0x34b003['include']=[{'all':!![]}];}return db[_0x17ee('0x2c')]['findAll'](_0x34b003);})[_0x17ee('0x25')](function(_0x49a03c){_0x4ff2dc[_0x17ee('0x42')]=_0x49a03c;return _0x4ff2dc;})[_0x17ee('0x25')](respondWithFilteredResult(_0x393231,_0x34b003))[_0x17ee('0x43')](handleError(_0x393231,null));};exports[_0x17ee('0x44')]=function(_0x5d99c5,_0x478874){var _0x5ca289={'raw':!![],'where':{'id':_0x5d99c5[_0x17ee('0x45')]['id']}},_0x5c5452={};_0x5c5452[_0x17ee('0x35')]=_['keys'](db[_0x17ee('0x2c')][_0x17ee('0x2d')]);_0x5c5452[_0x17ee('0x31')]=_[_0x17ee('0x32')](_0x5d99c5[_0x17ee('0x31')]);_0x5c5452[_0x17ee('0x3c')]=_[_0x17ee('0x33')](_0x5c5452[_0x17ee('0x35')],_0x5c5452['query']);_0x5ca289[_0x17ee('0x34')]=_[_0x17ee('0x33')](_0x5c5452['model'],qs[_0x17ee('0x36')](_0x5d99c5[_0x17ee('0x31')][_0x17ee('0x36')]));_0x5ca289['attributes']=_0x5ca289['attributes']['length']?_0x5ca289[_0x17ee('0x34')]:_0x5c5452[_0x17ee('0x35')];if(_0x5d99c5[_0x17ee('0x31')][_0x17ee('0x41')]){_0x5ca289[_0x17ee('0x46')]=[{'all':!![]}];}_0x5ca289=_[_0x17ee('0x47')]({},_0x5ca289,_0x5d99c5[_0x17ee('0x48')]);return db[_0x17ee('0x2c')]['find'](_0x5ca289)[_0x17ee('0x25')](handleEntityNotFound(_0x478874,null))[_0x17ee('0x25')](respondWithResult(_0x478874,null))[_0x17ee('0x43')](handleError(_0x478874,null));};exports[_0x17ee('0x49')]=function(_0x2d9d89,_0x403e43){return db[_0x17ee('0x2c')]['create'](_0x2d9d89[_0x17ee('0x4a')],{})[_0x17ee('0x25')](respondWithResult(_0x403e43,0xc9))[_0x17ee('0x43')](handleError(_0x403e43,null));};exports[_0x17ee('0x24')]=function(_0x5c4f71,_0x10a097){if(_0x5c4f71[_0x17ee('0x4a')]['id']){delete _0x5c4f71[_0x17ee('0x4a')]['id'];}return db[_0x17ee('0x2c')]['find']({'where':{'id':_0x5c4f71[_0x17ee('0x45')]['id']}})[_0x17ee('0x25')](handleEntityNotFound(_0x10a097,null))[_0x17ee('0x25')](saveUpdates(_0x5c4f71[_0x17ee('0x4a')],null))[_0x17ee('0x25')](respondWithResult(_0x10a097,null))[_0x17ee('0x43')](handleError(_0x10a097,null));};exports[_0x17ee('0x26')]=function(_0x2f9cd4,_0x4b913a){return db['FaxQueueReport'][_0x17ee('0x4b')]({'where':{'id':_0x2f9cd4[_0x17ee('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b913a,null))[_0x17ee('0x25')](removeEntity(_0x4b913a,null))[_0x17ee('0x43')](handleError(_0x4b913a,null));};exports[_0x17ee('0x4c')]=function(_0x1d9bc2,_0x558941){return db['FaxQueueReport'][_0x17ee('0x4c')]()[_0x17ee('0x25')](respondWithResult(_0x558941,null))['catch'](handleError(_0x558941,null));}; \ No newline at end of file +var _0xe13e=['body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','fields','length','include','options','find','catch','create'];(function(_0x1e8669,_0x3dc71e){var _0x80db2e=function(_0x416754){while(--_0x416754){_0x1e8669['push'](_0x1e8669['shift']());}};_0x80db2e(++_0x3dc71e);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee13('0x0'));var jsonpatch=require(_0xee13('0x1'));var rp=require(_0xee13('0x2'));var moment=require(_0xee13('0x3'));var BPromise=require(_0xee13('0x4'));var Mustache=require(_0xee13('0x5'));var util=require(_0xee13('0x6'));var path=require(_0xee13('0x7'));var sox=require(_0xee13('0x8'));var csv=require(_0xee13('0x9'));var ejs=require(_0xee13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee13('0xb'));var squel=require(_0xee13('0xc'));var crypto=require(_0xee13('0xd'));var jsforce=require(_0xee13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee13('0x9'));var querystring=require(_0xee13('0xf'));var Papa=require(_0xee13('0x10'));var Redis=require(_0xee13('0x11'));var authService=require(_0xee13('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee13('0x13'));var hardwareService=require(_0xee13('0x14'));var logger=require('../../config/logger')(_0xee13('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee13('0x16'))['db'];function respondWithStatusCode(_0x4ae893,_0x3060d8){_0x3060d8=_0x3060d8||0xcc;return function(_0x43f002){if(_0x43f002){return _0x4ae893[_0xee13('0x17')](_0x3060d8);}return _0x4ae893[_0xee13('0x18')](_0x3060d8)[_0xee13('0x19')]();};}function respondWithResult(_0xeb630e,_0x2f7cd3){_0x2f7cd3=_0x2f7cd3||0xc8;return function(_0x50fd97){if(_0x50fd97){return _0xeb630e[_0xee13('0x18')](_0x2f7cd3)[_0xee13('0x1a')](_0x50fd97);}};}function respondWithFilteredResult(_0xafe3d8,_0x53e5a5){return function(_0x38eb56){if(_0x38eb56){var _0x6de406=typeof _0x53e5a5['offset']===_0xee13('0x1b')&&typeof _0x53e5a5[_0xee13('0x1c')]===_0xee13('0x1b');var _0x1eb454=_0x38eb56[_0xee13('0x1d')];var _0x3a5819=_0x6de406?0x0:_0x53e5a5[_0xee13('0x1e')];var _0x33bd9c=_0x6de406?_0x38eb56[_0xee13('0x1d')]:_0x53e5a5[_0xee13('0x1e')]+_0x53e5a5['limit'];var _0x462257;if(_0x33bd9c>=_0x1eb454){_0x33bd9c=_0x1eb454;_0x462257=0xc8;}else{_0x462257=0xce;}_0xafe3d8[_0xee13('0x18')](_0x462257);return _0xafe3d8['set'](_0xee13('0x1f'),_0x3a5819+'-'+_0x33bd9c+'/'+_0x1eb454)['json'](_0x38eb56);}return null;};}function patchUpdates(_0x17e664){return function(_0x4a49c0){try{jsonpatch[_0xee13('0x20')](_0x4a49c0,_0x17e664,!![]);}catch(_0x28f763){return BPromise['reject'](_0x28f763);}return _0x4a49c0[_0xee13('0x21')]();};}function saveUpdates(_0x248aae,_0x3f9dfd){return function(_0x3231b0){if(_0x3231b0){return _0x3231b0[_0xee13('0x22')](_0x248aae)['then'](function(_0xd93336){return _0xd93336;});}return null;};}function removeEntity(_0x46bd44,_0x4c705c){return function(_0x255ff2){if(_0x255ff2){return _0x255ff2['destroy']()[_0xee13('0x23')](function(){_0x46bd44['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x381508,_0x323e1e){return function(_0x49eddd){if(!_0x49eddd){_0x381508[_0xee13('0x17')](0x194);}return _0x49eddd;};}function handleError(_0x37cf4b,_0x19096f){_0x19096f=_0x19096f||0x1f4;return function(_0x48b604){logger['error'](_0x48b604[_0xee13('0x24')]);if(_0x48b604[_0xee13('0x25')]){delete _0x48b604[_0xee13('0x25')];}_0x37cf4b[_0xee13('0x18')](_0x19096f)[_0xee13('0x26')](_0x48b604);};}exports[_0xee13('0x27')]=function(_0x148477,_0x29ddad){var _0x28d237={},_0x458e12={},_0x3aeaac={'count':0x0,'rows':[]};var _0x37f57d=_[_0xee13('0x28')](db[_0xee13('0x29')][_0xee13('0x2a')],function(_0x122983){return{'name':_0x122983['fieldName'],'type':_0x122983['type'][_0xee13('0x2b')]};});_0x458e12[_0xee13('0x2c')]=_[_0xee13('0x28')](_0x37f57d,_0xee13('0x25'));_0x458e12['query']=_[_0xee13('0x2d')](_0x148477[_0xee13('0x2e')]);_0x458e12[_0xee13('0x2f')]=_[_0xee13('0x30')](_0x458e12[_0xee13('0x2c')],_0x458e12[_0xee13('0x2e')]);_0x28d237[_0xee13('0x31')]=_[_0xee13('0x30')](_0x458e12[_0xee13('0x2c')],qs['fields'](_0x148477[_0xee13('0x2e')]['fields']));_0x28d237['attributes']=_0x28d237[_0xee13('0x31')]['length']?_0x28d237[_0xee13('0x31')]:_0x458e12['model'];if(!_0x148477[_0xee13('0x2e')][_0xee13('0x32')](_0xee13('0x33'))){_0x28d237[_0xee13('0x1c')]=qs[_0xee13('0x1c')](_0x148477[_0xee13('0x2e')][_0xee13('0x1c')]);_0x28d237[_0xee13('0x1e')]=qs[_0xee13('0x1e')](_0x148477['query'][_0xee13('0x1e')]);}_0x28d237[_0xee13('0x34')]=qs[_0xee13('0x35')](_0x148477['query'][_0xee13('0x35')]);_0x28d237[_0xee13('0x36')]=qs[_0xee13('0x2f')](_[_0xee13('0x37')](_0x148477[_0xee13('0x2e')],_0x458e12[_0xee13('0x2f')]),_0x37f57d);if(_0x148477['query'][_0xee13('0x38')]){_0x28d237[_0xee13('0x36')]=_[_0xee13('0x39')](_0x28d237['where'],{'$or':_[_0xee13('0x28')](_0x37f57d,function(_0xbe91b9){if(_0xbe91b9['type']!==_0xee13('0x3a')){var _0xfb099c={};_0xfb099c[_0xbe91b9[_0xee13('0x25')]]={'$like':'%'+_0x148477[_0xee13('0x2e')][_0xee13('0x38')]+'%'};return _0xfb099c;}})});}_0x28d237=_['merge']({},_0x28d237,_0x148477['options']);var _0x17ebe1={'where':_0x28d237[_0xee13('0x36')]};return db[_0xee13('0x29')][_0xee13('0x1d')](_0x17ebe1)[_0xee13('0x23')](function(_0x65d670){_0x3aeaac[_0xee13('0x1d')]=_0x65d670;if(_0x148477[_0xee13('0x2e')][_0xee13('0x3b')]){_0x28d237['include']=[{'all':!![]}];}return db[_0xee13('0x29')][_0xee13('0x3c')](_0x28d237);})[_0xee13('0x23')](function(_0x3acae4){_0x3aeaac['rows']=_0x3acae4;return _0x3aeaac;})['then'](respondWithFilteredResult(_0x29ddad,_0x28d237))['catch'](handleError(_0x29ddad,null));};exports[_0xee13('0x3d')]=function(_0x493aae,_0x4b5288){var _0x16d84a={'raw':!![],'where':{'id':_0x493aae[_0xee13('0x3e')]['id']}},_0x4a7ce6={};_0x4a7ce6[_0xee13('0x2c')]=_[_0xee13('0x2d')](db['FaxQueueReport'][_0xee13('0x2a')]);_0x4a7ce6[_0xee13('0x2e')]=_['keys'](_0x493aae['query']);_0x4a7ce6['filters']=_[_0xee13('0x30')](_0x4a7ce6['model'],_0x4a7ce6[_0xee13('0x2e')]);_0x16d84a[_0xee13('0x31')]=_[_0xee13('0x30')](_0x4a7ce6[_0xee13('0x2c')],qs[_0xee13('0x3f')](_0x493aae[_0xee13('0x2e')][_0xee13('0x3f')]));_0x16d84a[_0xee13('0x31')]=_0x16d84a[_0xee13('0x31')][_0xee13('0x40')]?_0x16d84a[_0xee13('0x31')]:_0x4a7ce6[_0xee13('0x2c')];if(_0x493aae[_0xee13('0x2e')][_0xee13('0x3b')]){_0x16d84a[_0xee13('0x41')]=[{'all':!![]}];}_0x16d84a=_[_0xee13('0x39')]({},_0x16d84a,_0x493aae[_0xee13('0x42')]);return db[_0xee13('0x29')][_0xee13('0x43')](_0x16d84a)[_0xee13('0x23')](handleEntityNotFound(_0x4b5288,null))[_0xee13('0x23')](respondWithResult(_0x4b5288,null))[_0xee13('0x44')](handleError(_0x4b5288,null));};exports[_0xee13('0x45')]=function(_0x3aeb91,_0x33676c){return db[_0xee13('0x29')]['create'](_0x3aeb91[_0xee13('0x46')],{})[_0xee13('0x23')](respondWithResult(_0x33676c,0xc9))[_0xee13('0x44')](handleError(_0x33676c,null));};exports[_0xee13('0x22')]=function(_0x136fb2,_0x587642){if(_0x136fb2['body']['id']){delete _0x136fb2['body']['id'];}return db[_0xee13('0x29')][_0xee13('0x43')]({'where':{'id':_0x136fb2[_0xee13('0x3e')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x587642,null))[_0xee13('0x23')](saveUpdates(_0x136fb2[_0xee13('0x46')],null))[_0xee13('0x23')](respondWithResult(_0x587642,null))['catch'](handleError(_0x587642,null));};exports[_0xee13('0x47')]=function(_0x32e326,_0x225eda){return db[_0xee13('0x29')]['find']({'where':{'id':_0x32e326[_0xee13('0x3e')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x225eda,null))['then'](removeEntity(_0x225eda,null))['catch'](handleError(_0x225eda,null));};exports[_0xee13('0x48')]=function(_0x4356bf,_0x37fe13){return db[_0xee13('0x29')][_0xee13('0x48')]()[_0xee13('0x23')](respondWithResult(_0x37fe13,null))[_0xee13('0x44')](handleError(_0x37fe13,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c1170aa..637cc43 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x11cdf9,_0x46921b){var _0x991df2=function(_0x1390f0){while(--_0x1390f0){_0x11cdf9['push'](_0x11cdf9['shift']());}};_0x991df2(++_0x46921b);}(_0x53ec,0x192));var _0xc53e=function(_0x213295,_0x465d81){_0x213295=_0x213295-0x0;var _0x43a797=_0x53ec[_0x213295];return _0x43a797;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x357671,_0x271d71){var _0x392e0a=function(_0x19a15b){while(--_0x19a15b){_0x357671['push'](_0x357671['shift']());}};_0x392e0a(++_0x271d71);}(_0xe14b,0x93));var _0xbe14=function(_0x53fb43,_0x223a27){_0x53fb43=_0x53fb43-0x0;var _0x35ca6e=_0xe14b[_0x53fb43];return _0x35ca6e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a319c42..7de7094 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa742=['CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0xa742,0x128));var _0x2a74=function(_0x35c598,_0x21fe17){_0x35c598=_0x35c598-0x0;var _0x5eb334=_0xa742[_0x35c598];return _0x5eb334;};'use strict';var _=require(_0x2a74('0x0'));var util=require(_0x2a74('0x1'));var moment=require(_0x2a74('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a74('0x3'));var fs=require('fs');var Redis=require(_0x2a74('0x4'));var db=require(_0x2a74('0x5'))['db'];var utils=require(_0x2a74('0x6'));var logger=require(_0x2a74('0x7'))(_0x2a74('0x8'));var config=require(_0x2a74('0x9'));var jayson=require(_0x2a74('0xa'));var client=jayson['client'][_0x2a74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c6c58,_0x34dfd8,_0x80b2fe){return new BPromise(function(_0x3f82b1,_0x14023c){return client[_0x2a74('0xc')](_0x3c6c58,_0x80b2fe)[_0x2a74('0xd')](function(_0x3fa5c2){logger[_0x2a74('0xe')](_0x2a74('0xf'),_0x34dfd8,_0x2a74('0x10'));logger['debug'](_0x2a74('0x11'),_0x34dfd8,_0x2a74('0x10'),JSON[_0x2a74('0x12')](_0x3fa5c2));if(_0x3fa5c2[_0x2a74('0x13')]){if(_0x3fa5c2[_0x2a74('0x13')][_0x2a74('0x14')]===0x1f4){logger[_0x2a74('0x13')](_0x2a74('0xf'),_0x34dfd8,_0x3fa5c2[_0x2a74('0x13')]['message']);return _0x14023c(_0x3fa5c2[_0x2a74('0x13')][_0x2a74('0x15')]);}logger[_0x2a74('0x13')](_0x2a74('0xf'),_0x34dfd8,_0x3fa5c2[_0x2a74('0x13')]['message']);return _0x3f82b1(_0x3fa5c2[_0x2a74('0x13')][_0x2a74('0x15')]);}else{logger[_0x2a74('0xe')](_0x2a74('0xf'),_0x34dfd8,'request\x20sent');_0x3f82b1(_0x3fa5c2[_0x2a74('0x16')][_0x2a74('0x15')]);}})[_0x2a74('0x17')](function(_0x56ca05){logger[_0x2a74('0x13')](_0x2a74('0xf'),_0x34dfd8,_0x56ca05);_0x14023c(_0x56ca05);});});}exports[_0x2a74('0x18')]=function(_0x453db9){var _0x19d50b=this;return new Promise(function(_0x528c6c,_0x3187e2){return db[_0x2a74('0x19')][_0x2a74('0x1a')](_0x453db9[_0x2a74('0x1b')],{'raw':_0x453db9[_0x2a74('0x1c')]?_0x453db9[_0x2a74('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x2a74('0xd')](function(_0x53503a){logger[_0x2a74('0xe')](_0x2a74('0x18'),_0x453db9);logger[_0x2a74('0x1d')](_0x2a74('0x18'),_0x453db9,JSON[_0x2a74('0x12')](_0x53503a));_0x528c6c(_0x53503a);})[_0x2a74('0x17')](function(_0x5ae12d){logger[_0x2a74('0x13')]('CreateFaxQueueReport',_0x5ae12d[_0x2a74('0x15')],_0x453db9);_0x3187e2(_0x19d50b[_0x2a74('0x13')](0x1f4,_0x5ae12d[_0x2a74('0x15')]));});});};exports[_0x2a74('0x1e')]=function(_0x2fc29f){var _0x36302f=this;return new Promise(function(_0x350b92,_0xf8cc96){return db[_0x2a74('0x19')]['update'](_0x2fc29f[_0x2a74('0x1b')],{'raw':_0x2fc29f['options']?_0x2fc29f[_0x2a74('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fc29f[_0x2a74('0x1c')]?_0x2fc29f[_0x2a74('0x1c')]['where']||null:null,'attributes':_0x2fc29f[_0x2a74('0x1c')]?_0x2fc29f[_0x2a74('0x1c')][_0x2a74('0x1f')]||null:null,'limit':_0x2fc29f['options']?_0x2fc29f['options']['limit']||null:null})[_0x2a74('0xd')](function(_0x48944d){logger[_0x2a74('0xe')](_0x2a74('0x1e'),_0x2fc29f);logger['debug'](_0x2a74('0x1e'),_0x2fc29f,JSON['stringify'](_0x48944d));_0x350b92(_0x48944d);})[_0x2a74('0x17')](function(_0x19b731){logger[_0x2a74('0x13')](_0x2a74('0x1e'),_0x19b731[_0x2a74('0x15')],_0x2fc29f);_0xf8cc96(_0x36302f[_0x2a74('0x13')](0x1f4,_0x19b731[_0x2a74('0x15')]));});});}; \ No newline at end of file +var _0xd063=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','options','update','body','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','moment'];(function(_0x4793f1,_0x4024ee){var _0x356b50=function(_0x31fd94){while(--_0x31fd94){_0x4793f1['push'](_0x4793f1['shift']());}};_0x356b50(++_0x4024ee);}(_0xd063,0x153));var _0x3d06=function(_0x5d349b,_0x1da890){_0x5d349b=_0x5d349b-0x0;var _0x4b42be=_0xd063[_0x5d349b];return _0x4b42be;};'use strict';var _=require(_0x3d06('0x0'));var util=require('util');var moment=require(_0x3d06('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d06('0x2'));var fs=require('fs');var Redis=require(_0x3d06('0x3'));var db=require(_0x3d06('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d06('0x5'))(_0x3d06('0x6'));var config=require(_0x3d06('0x7'));var jayson=require(_0x3d06('0x8'));var client=jayson[_0x3d06('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc48ad9,_0x55dcde,_0x32d85c){return new BPromise(function(_0xecfe3a,_0x8476fb){return client['request'](_0xc48ad9,_0x32d85c)[_0x3d06('0xa')](function(_0x35b81e){logger[_0x3d06('0xb')](_0x3d06('0xc'),_0x55dcde,'request\x20sent');logger[_0x3d06('0xd')](_0x3d06('0xe'),_0x55dcde,'request\x20sent',JSON[_0x3d06('0xf')](_0x35b81e));if(_0x35b81e[_0x3d06('0x10')]){if(_0x35b81e[_0x3d06('0x10')][_0x3d06('0x11')]===0x1f4){logger[_0x3d06('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x55dcde,_0x35b81e[_0x3d06('0x10')][_0x3d06('0x12')]);return _0x8476fb(_0x35b81e['error'][_0x3d06('0x12')]);}logger[_0x3d06('0x10')](_0x3d06('0xc'),_0x55dcde,_0x35b81e[_0x3d06('0x10')][_0x3d06('0x12')]);return _0xecfe3a(_0x35b81e[_0x3d06('0x10')][_0x3d06('0x12')]);}else{logger[_0x3d06('0xb')](_0x3d06('0xc'),_0x55dcde,'request\x20sent');_0xecfe3a(_0x35b81e['result'][_0x3d06('0x12')]);}})[_0x3d06('0x13')](function(_0x506520){logger[_0x3d06('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x55dcde,_0x506520);_0x8476fb(_0x506520);});});}exports[_0x3d06('0x14')]=function(_0x2ddf79){var _0x1fd27d=this;return new Promise(function(_0xafdc0c,_0x412feb){return db[_0x3d06('0x15')][_0x3d06('0x16')](_0x2ddf79['body'],{'raw':_0x2ddf79['options']?_0x2ddf79[_0x3d06('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3d06('0xa')](function(_0x3c6f6){logger[_0x3d06('0xb')](_0x3d06('0x14'),_0x2ddf79);logger[_0x3d06('0xd')](_0x3d06('0x14'),_0x2ddf79,JSON['stringify'](_0x3c6f6));_0xafdc0c(_0x3c6f6);})[_0x3d06('0x13')](function(_0x334bf7){logger['error'](_0x3d06('0x14'),_0x334bf7[_0x3d06('0x12')],_0x2ddf79);_0x412feb(_0x1fd27d[_0x3d06('0x10')](0x1f4,_0x334bf7[_0x3d06('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0xb4cf34){var _0x2f0ad1=this;return new Promise(function(_0x58c4ba,_0x11f545){return db[_0x3d06('0x15')][_0x3d06('0x18')](_0xb4cf34[_0x3d06('0x19')],{'raw':_0xb4cf34[_0x3d06('0x17')]?_0xb4cf34[_0x3d06('0x17')][_0x3d06('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4cf34[_0x3d06('0x17')]?_0xb4cf34['options'][_0x3d06('0x1b')]||null:null,'attributes':_0xb4cf34[_0x3d06('0x17')]?_0xb4cf34[_0x3d06('0x17')][_0x3d06('0x1c')]||null:null,'limit':_0xb4cf34[_0x3d06('0x17')]?_0xb4cf34[_0x3d06('0x17')][_0x3d06('0x1d')]||null:null})[_0x3d06('0xa')](function(_0xd43c3c){logger[_0x3d06('0xb')]('UpdateFaxQueueReport',_0xb4cf34);logger[_0x3d06('0xd')]('UpdateFaxQueueReport',_0xb4cf34,JSON['stringify'](_0xd43c3c));_0x58c4ba(_0xd43c3c);})['catch'](function(_0x27392b){logger[_0x3d06('0x10')](_0x3d06('0x1e'),_0x27392b[_0x3d06('0x12')],_0xb4cf34);_0x11f545(_0x2f0ad1[_0x3d06('0x10')](0x1f4,_0x27392b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 22a1d09..d17753a 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbac=['post','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x52fa1e,_0x39a40f){var _0x26849d=function(_0x4e52c3){while(--_0x4e52c3){_0x52fa1e['push'](_0x52fa1e['shift']());}};_0x26849d(++_0x39a40f);}(_0xbbac,0x92));var _0xcbba=function(_0x34cafd,_0x584f15){_0x34cafd=_0x34cafd-0x0;var _0x925e08=_0xbbac[_0x34cafd];return _0x925e08;};'use strict';var multer=require(_0xcbba('0x0'));var util=require(_0xcbba('0x1'));var path=require('path');var timeout=require(_0xcbba('0x2'));var express=require(_0xcbba('0x3'));var router=express[_0xcbba('0x4')]();var fs_extra=require(_0xcbba('0x5'));var auth=require(_0xcbba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcbba('0x7'));var controller=require('./faxQueueReport.controller');router[_0xcbba('0x8')]('/',auth[_0xcbba('0x9')](),controller[_0xcbba('0xa')]);router[_0xcbba('0x8')](_0xcbba('0xb'),auth[_0xcbba('0x9')](),controller[_0xcbba('0xc')]);router[_0xcbba('0x8')]('/:id',auth[_0xcbba('0x9')](),controller[_0xcbba('0xd')]);router[_0xcbba('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcbba('0xf')]('/:id',auth[_0xcbba('0x9')](),controller[_0xcbba('0x10')]);router['delete'](_0xcbba('0x11'),auth[_0xcbba('0x9')](),controller[_0xcbba('0x12')]);module[_0xcbba('0x13')]=router; \ No newline at end of file +var _0x4389=['post','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','/describe','get','/:id'];(function(_0x49e0e5,_0x1f1f6b){var _0x249c90=function(_0x2851ea){while(--_0x2851ea){_0x49e0e5['push'](_0x49e0e5['shift']());}};_0x249c90(++_0x1f1f6b);}(_0x4389,0x181));var _0x9438=function(_0x4a1da1,_0x11d597){_0x4a1da1=_0x4a1da1-0x0;var _0x2dcd31=_0x4389[_0x4a1da1];return _0x2dcd31;};'use strict';var multer=require('multer');var util=require(_0x9438('0x0'));var path=require(_0x9438('0x1'));var timeout=require(_0x9438('0x2'));var express=require(_0x9438('0x3'));var router=express[_0x9438('0x4')]();var fs_extra=require(_0x9438('0x5'));var auth=require(_0x9438('0x6'));var interaction=require(_0x9438('0x7'));var config=require(_0x9438('0x8'));var controller=require(_0x9438('0x9'));router['get']('/',auth[_0x9438('0xa')](),controller[_0x9438('0xb')]);router['get'](_0x9438('0xc'),auth[_0x9438('0xa')](),controller['describe']);router[_0x9438('0xd')](_0x9438('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x9438('0xf')]('/',auth[_0x9438('0xa')](),controller['create']);router[_0x9438('0x10')](_0x9438('0xe'),auth[_0x9438('0xa')](),controller[_0x9438('0x11')]);router['delete'](_0x9438('0xe'),auth['isAuthenticated'](),controller[_0x9438('0x12')]);module[_0x9438('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4240e59..0bd0347 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3bae86,_0x3e55f3){_0x3bae86=_0x3bae86-0x0;var _0x47490e=_0xb43b[_0x3bae86];return _0x47490e;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x28e8b0,_0x8ac5ea){var _0x3759f9=function(_0x49e25d){while(--_0x49e25d){_0x28e8b0['push'](_0x28e8b0['shift']());}};_0x3759f9(++_0x8ac5ea);}(_0x4b84,0x1cc));var _0x44b8=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x4b84[_0x14476b];return _0x24e2e8;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 4c3f3f7..bcf066a 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa9a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','status','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxTransferReport','includeAll','include','catch','params','options','find','create','body','describe'];(function(_0x37bab4,_0x4fa85e){var _0x336d20=function(_0xdd4ab8){while(--_0xdd4ab8){_0x37bab4['push'](_0x37bab4['shift']());}};_0x336d20(++_0x4fa85e);}(_0xfa9a,0x1a4));var _0xafa9=function(_0x9a2241,_0x49d55b){_0x9a2241=_0x9a2241-0x0;var _0x88f98a=_0xfa9a[_0x9a2241];return _0x88f98a;};'use strict';var emlformat=require(_0xafa9('0x0'));var rimraf=require(_0xafa9('0x1'));var zipdir=require(_0xafa9('0x2'));var jsonpatch=require(_0xafa9('0x3'));var rp=require(_0xafa9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xafa9('0x5'));var util=require(_0xafa9('0x6'));var path=require(_0xafa9('0x7'));var sox=require(_0xafa9('0x8'));var csv=require(_0xafa9('0x9'));var ejs=require(_0xafa9('0xa'));var fs=require('fs');var fs_extra=require(_0xafa9('0xb'));var _=require('lodash');var squel=require(_0xafa9('0xc'));var crypto=require('crypto');var jsforce=require(_0xafa9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xafa9('0x9'));var querystring=require(_0xafa9('0xe'));var Papa=require(_0xafa9('0xf'));var Redis=require(_0xafa9('0x10'));var authService=require(_0xafa9('0x11'));var qs=require(_0xafa9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xafa9('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xafa9('0x14'));var licenseUtil=require(_0xafa9('0x15'));var db=require(_0xafa9('0x16'))['db'];function respondWithStatusCode(_0x973a9c,_0x55e597){_0x55e597=_0x55e597||0xcc;return function(_0x47c118){if(_0x47c118){return _0x973a9c[_0xafa9('0x17')](_0x55e597);}return _0x973a9c['status'](_0x55e597)[_0xafa9('0x18')]();};}function respondWithResult(_0x139aa4,_0x30abc8){_0x30abc8=_0x30abc8||0xc8;return function(_0x4accca){if(_0x4accca){return _0x139aa4['status'](_0x30abc8)[_0xafa9('0x19')](_0x4accca);}};}function respondWithFilteredResult(_0x2ba0bd,_0xee481e){return function(_0x43d9b2){if(_0x43d9b2){var _0x1d15fd=typeof _0xee481e[_0xafa9('0x1a')]===_0xafa9('0x1b')&&typeof _0xee481e[_0xafa9('0x1c')]===_0xafa9('0x1b');var _0x567630=_0x43d9b2[_0xafa9('0x1d')];var _0x2c01a5=_0x1d15fd?0x0:_0xee481e[_0xafa9('0x1a')];var _0x15cc73=_0x1d15fd?_0x43d9b2[_0xafa9('0x1d')]:_0xee481e['offset']+_0xee481e[_0xafa9('0x1c')];var _0x42aa82;if(_0x15cc73>=_0x567630){_0x15cc73=_0x567630;_0x42aa82=0xc8;}else{_0x42aa82=0xce;}_0x2ba0bd['status'](_0x42aa82);return _0x2ba0bd[_0xafa9('0x1e')](_0xafa9('0x1f'),_0x2c01a5+'-'+_0x15cc73+'/'+_0x567630)[_0xafa9('0x19')](_0x43d9b2);}return null;};}function patchUpdates(_0x596928){return function(_0x4e4b20){try{jsonpatch[_0xafa9('0x20')](_0x4e4b20,_0x596928,!![]);}catch(_0x183d56){return BPromise['reject'](_0x183d56);}return _0x4e4b20['save']();};}function saveUpdates(_0x3ba9bd,_0x37a6a3){return function(_0x2ec6a1){if(_0x2ec6a1){return _0x2ec6a1['update'](_0x3ba9bd)[_0xafa9('0x21')](function(_0x1e05c4){return _0x1e05c4;});}return null;};}function removeEntity(_0x1d7cb6,_0x5efa02){return function(_0x1c1857){if(_0x1c1857){return _0x1c1857[_0xafa9('0x22')]()[_0xafa9('0x21')](function(){_0x1d7cb6['status'](0xcc)[_0xafa9('0x18')]();});}};}function handleEntityNotFound(_0x15998a,_0x29c784){return function(_0x15a62b){if(!_0x15a62b){_0x15998a[_0xafa9('0x17')](0x194);}return _0x15a62b;};}function handleError(_0x434341,_0x422d20){_0x422d20=_0x422d20||0x1f4;return function(_0x47c3e4){logger[_0xafa9('0x23')](_0x47c3e4['stack']);if(_0x47c3e4[_0xafa9('0x24')]){delete _0x47c3e4['name'];}_0x434341[_0xafa9('0x25')](_0x422d20)[_0xafa9('0x26')](_0x47c3e4);};}exports['index']=function(_0x42ab79,_0x53b3a9){var _0x212622={},_0x118679={},_0x272b0a={'count':0x0,'rows':[]};var _0x56dbc9=_[_0xafa9('0x27')](db['FaxTransferReport'][_0xafa9('0x28')],function(_0x2d4992){return{'name':_0x2d4992[_0xafa9('0x29')],'type':_0x2d4992[_0xafa9('0x2a')][_0xafa9('0x2b')]};});_0x118679[_0xafa9('0x2c')]=_[_0xafa9('0x27')](_0x56dbc9,_0xafa9('0x24'));_0x118679[_0xafa9('0x2d')]=_[_0xafa9('0x2e')](_0x42ab79['query']);_0x118679[_0xafa9('0x2f')]=_[_0xafa9('0x30')](_0x118679[_0xafa9('0x2c')],_0x118679[_0xafa9('0x2d')]);_0x212622['attributes']=_['intersection'](_0x118679['model'],qs[_0xafa9('0x31')](_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x31')]));_0x212622[_0xafa9('0x32')]=_0x212622[_0xafa9('0x32')][_0xafa9('0x33')]?_0x212622['attributes']:_0x118679['model'];if(!_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x34')](_0xafa9('0x35'))){_0x212622[_0xafa9('0x1c')]=qs[_0xafa9('0x1c')](_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x1c')]);_0x212622['offset']=qs[_0xafa9('0x1a')](_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x1a')]);}_0x212622[_0xafa9('0x36')]=qs[_0xafa9('0x37')](_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x37')]);_0x212622[_0xafa9('0x38')]=qs[_0xafa9('0x2f')](_[_0xafa9('0x39')](_0x42ab79[_0xafa9('0x2d')],_0x118679[_0xafa9('0x2f')]),_0x56dbc9);if(_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x3a')]){_0x212622[_0xafa9('0x38')]=_[_0xafa9('0x3b')](_0x212622[_0xafa9('0x38')],{'$or':_[_0xafa9('0x27')](_0x56dbc9,function(_0x19a5d1){if(_0x19a5d1[_0xafa9('0x2a')]!=='VIRTUAL'){var _0x2301b1={};_0x2301b1[_0x19a5d1['name']]={'$like':'%'+_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x3a')]+'%'};return _0x2301b1;}})});}_0x212622=_[_0xafa9('0x3b')]({},_0x212622,_0x42ab79['options']);var _0x1c0e35={'where':_0x212622[_0xafa9('0x38')]};return db[_0xafa9('0x3c')][_0xafa9('0x1d')](_0x1c0e35)[_0xafa9('0x21')](function(_0x44b28e){_0x272b0a[_0xafa9('0x1d')]=_0x44b28e;if(_0x42ab79[_0xafa9('0x2d')][_0xafa9('0x3d')]){_0x212622[_0xafa9('0x3e')]=[{'all':!![]}];}return db[_0xafa9('0x3c')]['findAll'](_0x212622);})[_0xafa9('0x21')](function(_0x5e420a){_0x272b0a['rows']=_0x5e420a;return _0x272b0a;})[_0xafa9('0x21')](respondWithFilteredResult(_0x53b3a9,_0x212622))[_0xafa9('0x3f')](handleError(_0x53b3a9,null));};exports['show']=function(_0x92076f,_0x5b5a04){var _0x4c5d7d={'raw':!![],'where':{'id':_0x92076f[_0xafa9('0x40')]['id']}},_0x544b28={};_0x544b28[_0xafa9('0x2c')]=_[_0xafa9('0x2e')](db['FaxTransferReport'][_0xafa9('0x28')]);_0x544b28[_0xafa9('0x2d')]=_[_0xafa9('0x2e')](_0x92076f[_0xafa9('0x2d')]);_0x544b28[_0xafa9('0x2f')]=_[_0xafa9('0x30')](_0x544b28[_0xafa9('0x2c')],_0x544b28['query']);_0x4c5d7d[_0xafa9('0x32')]=_[_0xafa9('0x30')](_0x544b28['model'],qs['fields'](_0x92076f[_0xafa9('0x2d')][_0xafa9('0x31')]));_0x4c5d7d[_0xafa9('0x32')]=_0x4c5d7d['attributes'][_0xafa9('0x33')]?_0x4c5d7d[_0xafa9('0x32')]:_0x544b28[_0xafa9('0x2c')];if(_0x92076f[_0xafa9('0x2d')][_0xafa9('0x3d')]){_0x4c5d7d[_0xafa9('0x3e')]=[{'all':!![]}];}_0x4c5d7d=_[_0xafa9('0x3b')]({},_0x4c5d7d,_0x92076f[_0xafa9('0x41')]);return db[_0xafa9('0x3c')][_0xafa9('0x42')](_0x4c5d7d)[_0xafa9('0x21')](handleEntityNotFound(_0x5b5a04,null))[_0xafa9('0x21')](respondWithResult(_0x5b5a04,null))['catch'](handleError(_0x5b5a04,null));};exports[_0xafa9('0x43')]=function(_0x50b099,_0x5c0e50){return db['FaxTransferReport']['create'](_0x50b099['body'],{})[_0xafa9('0x21')](respondWithResult(_0x5c0e50,0xc9))[_0xafa9('0x3f')](handleError(_0x5c0e50,null));};exports['update']=function(_0x381d47,_0x3acc84){if(_0x381d47[_0xafa9('0x44')]['id']){delete _0x381d47[_0xafa9('0x44')]['id'];}return db[_0xafa9('0x3c')][_0xafa9('0x42')]({'where':{'id':_0x381d47[_0xafa9('0x40')]['id']}})[_0xafa9('0x21')](handleEntityNotFound(_0x3acc84,null))[_0xafa9('0x21')](saveUpdates(_0x381d47[_0xafa9('0x44')],null))[_0xafa9('0x21')](respondWithResult(_0x3acc84,null))[_0xafa9('0x3f')](handleError(_0x3acc84,null));};exports['destroy']=function(_0x31f9a0,_0x44e154){return db[_0xafa9('0x3c')][_0xafa9('0x42')]({'where':{'id':_0x31f9a0[_0xafa9('0x40')]['id']}})['then'](handleEntityNotFound(_0x44e154,null))[_0xafa9('0x21')](removeEntity(_0x44e154,null))['catch'](handleError(_0x44e154,null));};exports['describe']=function(_0x22abcd,_0x20beaa){return db[_0xafa9('0x3c')][_0xafa9('0x45')]()['then'](respondWithResult(_0x20beaa,null))[_0xafa9('0x3f')](handleError(_0x20beaa,null));}; \ No newline at end of file +var _0x05d5=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','FaxTransferReport','findAll','catch','includeAll','include','options','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse'];(function(_0x93a285,_0x559b47){var _0x81dc4b=function(_0x371e50){while(--_0x371e50){_0x93a285['push'](_0x93a285['shift']());}};_0x81dc4b(++_0x559b47);}(_0x05d5,0x119));var _0x505d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x05d5[_0x50007c];return _0x5c1ec7;};'use strict';var emlformat=require(_0x505d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x505d('0x1'));var rp=require(_0x505d('0x2'));var moment=require('moment');var BPromise=require(_0x505d('0x3'));var Mustache=require(_0x505d('0x4'));var util=require(_0x505d('0x5'));var path=require(_0x505d('0x6'));var sox=require(_0x505d('0x7'));var csv=require(_0x505d('0x8'));var ejs=require(_0x505d('0x9'));var fs=require('fs');var fs_extra=require(_0x505d('0xa'));var _=require(_0x505d('0xb'));var squel=require(_0x505d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x505d('0xd'));var toCsv=require(_0x505d('0x8'));var querystring=require('querystring');var Papa=require(_0x505d('0xe'));var Redis=require('ioredis');var authService=require(_0x505d('0xf'));var qs=require(_0x505d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x505d('0x11'));var logger=require(_0x505d('0x12'))(_0x505d('0x13'));var utils=require(_0x505d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x505d('0x15'))['db'];function respondWithStatusCode(_0x210c95,_0x4f4926){_0x4f4926=_0x4f4926||0xcc;return function(_0x5f087f){if(_0x5f087f){return _0x210c95['sendStatus'](_0x4f4926);}return _0x210c95['status'](_0x4f4926)[_0x505d('0x16')]();};}function respondWithResult(_0x3fb552,_0x17c892){_0x17c892=_0x17c892||0xc8;return function(_0x3a0555){if(_0x3a0555){return _0x3fb552[_0x505d('0x17')](_0x17c892)[_0x505d('0x18')](_0x3a0555);}};}function respondWithFilteredResult(_0x4140c9,_0x5bb1b1){return function(_0x3f6a46){if(_0x3f6a46){var _0x2ddf05=typeof _0x5bb1b1[_0x505d('0x19')]===_0x505d('0x1a')&&typeof _0x5bb1b1[_0x505d('0x1b')]===_0x505d('0x1a');var _0x405344=_0x3f6a46[_0x505d('0x1c')];var _0x174bb8=_0x2ddf05?0x0:_0x5bb1b1[_0x505d('0x19')];var _0x2a1030=_0x2ddf05?_0x3f6a46[_0x505d('0x1c')]:_0x5bb1b1['offset']+_0x5bb1b1[_0x505d('0x1b')];var _0x24389b;if(_0x2a1030>=_0x405344){_0x2a1030=_0x405344;_0x24389b=0xc8;}else{_0x24389b=0xce;}_0x4140c9[_0x505d('0x17')](_0x24389b);return _0x4140c9['set'](_0x505d('0x1d'),_0x174bb8+'-'+_0x2a1030+'/'+_0x405344)[_0x505d('0x18')](_0x3f6a46);}return null;};}function patchUpdates(_0x3738b7){return function(_0x10a806){try{jsonpatch[_0x505d('0x1e')](_0x10a806,_0x3738b7,!![]);}catch(_0x3ac387){return BPromise[_0x505d('0x1f')](_0x3ac387);}return _0x10a806[_0x505d('0x20')]();};}function saveUpdates(_0xdecc47,_0x1c0753){return function(_0x56fb0e){if(_0x56fb0e){return _0x56fb0e[_0x505d('0x21')](_0xdecc47)[_0x505d('0x22')](function(_0x1d8308){return _0x1d8308;});}return null;};}function removeEntity(_0x49b032,_0x26c281){return function(_0x4dfa90){if(_0x4dfa90){return _0x4dfa90[_0x505d('0x23')]()[_0x505d('0x22')](function(){_0x49b032[_0x505d('0x17')](0xcc)[_0x505d('0x16')]();});}};}function handleEntityNotFound(_0x3a7333,_0x2ce7ef){return function(_0x1eeb60){if(!_0x1eeb60){_0x3a7333[_0x505d('0x24')](0x194);}return _0x1eeb60;};}function handleError(_0xa1db95,_0x483ac7){_0x483ac7=_0x483ac7||0x1f4;return function(_0x3d6807){logger[_0x505d('0x25')](_0x3d6807[_0x505d('0x26')]);if(_0x3d6807[_0x505d('0x27')]){delete _0x3d6807[_0x505d('0x27')];}_0xa1db95[_0x505d('0x17')](_0x483ac7)[_0x505d('0x28')](_0x3d6807);};}exports[_0x505d('0x29')]=function(_0x33f8b2,_0x37fd3f){var _0xc3def0={},_0x1fff00={},_0x26db81={'count':0x0,'rows':[]};var _0xdf54fb=_['map'](db['FaxTransferReport'][_0x505d('0x2a')],function(_0x1d7148){return{'name':_0x1d7148[_0x505d('0x2b')],'type':_0x1d7148[_0x505d('0x2c')][_0x505d('0x2d')]};});_0x1fff00['model']=_[_0x505d('0x2e')](_0xdf54fb,'name');_0x1fff00['query']=_[_0x505d('0x2f')](_0x33f8b2['query']);_0x1fff00[_0x505d('0x30')]=_[_0x505d('0x31')](_0x1fff00[_0x505d('0x32')],_0x1fff00[_0x505d('0x33')]);_0xc3def0[_0x505d('0x34')]=_['intersection'](_0x1fff00[_0x505d('0x32')],qs[_0x505d('0x35')](_0x33f8b2[_0x505d('0x33')][_0x505d('0x35')]));_0xc3def0['attributes']=_0xc3def0[_0x505d('0x34')][_0x505d('0x36')]?_0xc3def0[_0x505d('0x34')]:_0x1fff00[_0x505d('0x32')];if(!_0x33f8b2['query']['hasOwnProperty'](_0x505d('0x37'))){_0xc3def0['limit']=qs[_0x505d('0x1b')](_0x33f8b2[_0x505d('0x33')][_0x505d('0x1b')]);_0xc3def0[_0x505d('0x19')]=qs[_0x505d('0x19')](_0x33f8b2[_0x505d('0x33')][_0x505d('0x19')]);}_0xc3def0[_0x505d('0x38')]=qs[_0x505d('0x39')](_0x33f8b2['query'][_0x505d('0x39')]);_0xc3def0['where']=qs[_0x505d('0x30')](_[_0x505d('0x3a')](_0x33f8b2[_0x505d('0x33')],_0x1fff00[_0x505d('0x30')]),_0xdf54fb);if(_0x33f8b2[_0x505d('0x33')][_0x505d('0x3b')]){_0xc3def0[_0x505d('0x3c')]=_[_0x505d('0x3d')](_0xc3def0[_0x505d('0x3c')],{'$or':_['map'](_0xdf54fb,function(_0x1c2579){if(_0x1c2579[_0x505d('0x2c')]!==_0x505d('0x3e')){var _0x4f20b8={};_0x4f20b8[_0x1c2579[_0x505d('0x27')]]={'$like':'%'+_0x33f8b2[_0x505d('0x33')][_0x505d('0x3b')]+'%'};return _0x4f20b8;}})});}_0xc3def0=_[_0x505d('0x3d')]({},_0xc3def0,_0x33f8b2['options']);var _0x17f759={'where':_0xc3def0['where']};return db[_0x505d('0x3f')][_0x505d('0x1c')](_0x17f759)[_0x505d('0x22')](function(_0x105b86){_0x26db81['count']=_0x105b86;if(_0x33f8b2[_0x505d('0x33')]['includeAll']){_0xc3def0['include']=[{'all':!![]}];}return db[_0x505d('0x3f')][_0x505d('0x40')](_0xc3def0);})[_0x505d('0x22')](function(_0x591412){_0x26db81['rows']=_0x591412;return _0x26db81;})['then'](respondWithFilteredResult(_0x37fd3f,_0xc3def0))[_0x505d('0x41')](handleError(_0x37fd3f,null));};exports['show']=function(_0x236a4c,_0x3ffc0a){var _0x122fa6={'raw':!![],'where':{'id':_0x236a4c['params']['id']}},_0x1281d1={};_0x1281d1[_0x505d('0x32')]=_[_0x505d('0x2f')](db[_0x505d('0x3f')][_0x505d('0x2a')]);_0x1281d1[_0x505d('0x33')]=_[_0x505d('0x2f')](_0x236a4c['query']);_0x1281d1[_0x505d('0x30')]=_[_0x505d('0x31')](_0x1281d1[_0x505d('0x32')],_0x1281d1[_0x505d('0x33')]);_0x122fa6[_0x505d('0x34')]=_[_0x505d('0x31')](_0x1281d1['model'],qs[_0x505d('0x35')](_0x236a4c[_0x505d('0x33')][_0x505d('0x35')]));_0x122fa6[_0x505d('0x34')]=_0x122fa6[_0x505d('0x34')]['length']?_0x122fa6[_0x505d('0x34')]:_0x1281d1[_0x505d('0x32')];if(_0x236a4c[_0x505d('0x33')][_0x505d('0x42')]){_0x122fa6[_0x505d('0x43')]=[{'all':!![]}];}_0x122fa6=_[_0x505d('0x3d')]({},_0x122fa6,_0x236a4c[_0x505d('0x44')]);return db[_0x505d('0x3f')][_0x505d('0x45')](_0x122fa6)[_0x505d('0x22')](handleEntityNotFound(_0x3ffc0a,null))[_0x505d('0x22')](respondWithResult(_0x3ffc0a,null))[_0x505d('0x41')](handleError(_0x3ffc0a,null));};exports[_0x505d('0x46')]=function(_0x3e390b,_0x1ce478){return db[_0x505d('0x3f')][_0x505d('0x46')](_0x3e390b[_0x505d('0x47')],{})[_0x505d('0x22')](respondWithResult(_0x1ce478,0xc9))['catch'](handleError(_0x1ce478,null));};exports[_0x505d('0x21')]=function(_0x1723f2,_0x1343ba){if(_0x1723f2[_0x505d('0x47')]['id']){delete _0x1723f2[_0x505d('0x47')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x1723f2['params']['id']}})[_0x505d('0x22')](handleEntityNotFound(_0x1343ba,null))[_0x505d('0x22')](saveUpdates(_0x1723f2[_0x505d('0x47')],null))[_0x505d('0x22')](respondWithResult(_0x1343ba,null))[_0x505d('0x41')](handleError(_0x1343ba,null));};exports['destroy']=function(_0x174e29,_0x49c170){return db[_0x505d('0x3f')]['find']({'where':{'id':_0x174e29[_0x505d('0x48')]['id']}})['then'](handleEntityNotFound(_0x49c170,null))[_0x505d('0x22')](removeEntity(_0x49c170,null))[_0x505d('0x41')](handleError(_0x49c170,null));};exports[_0x505d('0x49')]=function(_0x3a061e,_0x11a0fb){return db[_0x505d('0x3f')][_0x505d('0x49')]()[_0x505d('0x22')](respondWithResult(_0x11a0fb,null))[_0x505d('0x41')](handleError(_0x11a0fb,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6cabb0a..05b74e5 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5da3=['moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api'];(function(_0x16c702,_0x2e29ca){var _0x3f6a03=function(_0x110e83){while(--_0x110e83){_0x16c702['push'](_0x16c702['shift']());}};_0x3f6a03(++_0x2e29ca);}(_0x5da3,0x123));var _0x35da=function(_0x3a2562,_0x2acdef){_0x3a2562=_0x3a2562-0x0;var _0x59eb58=_0x5da3[_0x3a2562];return _0x59eb58;};'use strict';var _=require('lodash');var util=require(_0x35da('0x0'));var logger=require(_0x35da('0x1'))(_0x35da('0x2'));var moment=require(_0x35da('0x3'));var BPromise=require(_0x35da('0x4'));var rp=require(_0x35da('0x5'));var fs=require('fs');var path=require(_0x35da('0x6'));var rimraf=require(_0x35da('0x7'));var config=require('../../config/environment');var attributes=require(_0x35da('0x8'));module[_0x35da('0x9')]=function(_0x4b45b6,_0x2cad15){return _0x4b45b6[_0x35da('0xa')](_0x35da('0xb'),attributes,{'tableName':_0x35da('0xc'),'paranoid':![],'indexes':[{'name':_0x35da('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2964=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x2bf650,_0x18427f){var _0x36f7fb=function(_0x3ab3f2){while(--_0x3ab3f2){_0x2bf650['push'](_0x2bf650['shift']());}};_0x36f7fb(++_0x18427f);}(_0x2964,0x108));var _0x4296=function(_0x46ec19,_0x3ae1a1){_0x46ec19=_0x46ec19-0x0;var _0x3e78e4=_0x2964[_0x46ec19];return _0x3e78e4;};'use strict';var _=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var logger=require(_0x4296('0x2'))(_0x4296('0x3'));var moment=require(_0x4296('0x4'));var BPromise=require(_0x4296('0x5'));var rp=require(_0x4296('0x6'));var fs=require('fs');var path=require(_0x4296('0x7'));var rimraf=require(_0x4296('0x8'));var config=require('../../config/environment');var attributes=require(_0x4296('0x9'));module[_0x4296('0xa')]=function(_0x23dfb1,_0x10a454){return _0x23dfb1[_0x4296('0xb')](_0x4296('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4296('0xd'),'fields':[_0x4296('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 59b5002..136fab9 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b77=['error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4bdd3a,_0x4eae8b){var _0x504566=function(_0x336cc1){while(--_0x336cc1){_0x4bdd3a['push'](_0x4bdd3a['shift']());}};_0x504566(++_0x4eae8b);}(_0x4b77,0x1bd));var _0x74b7=function(_0x56568b,_0x2dfb78){_0x56568b=_0x56568b-0x0;var _0x3a9720=_0x4b77[_0x56568b];return _0x3a9720;};'use strict';var _=require(_0x74b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74b7('0x1'));var db=require(_0x74b7('0x2'))['db'];var utils=require(_0x74b7('0x3'));var logger=require('../../config/logger')(_0x74b7('0x4'));var config=require(_0x74b7('0x5'));var jayson=require(_0x74b7('0x6'));var client=jayson[_0x74b7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x256817,_0x4c0c54,_0x43a398){return new BPromise(function(_0x51fcae,_0x3b1667){return client[_0x74b7('0x8')](_0x256817,_0x43a398)[_0x74b7('0x9')](function(_0x3cc669){logger[_0x74b7('0xa')](_0x74b7('0xb'),_0x4c0c54,_0x74b7('0xc'));logger[_0x74b7('0xd')](_0x74b7('0xe'),_0x4c0c54,_0x74b7('0xc'),JSON['stringify'](_0x3cc669));if(_0x3cc669[_0x74b7('0xf')]){if(_0x3cc669[_0x74b7('0xf')][_0x74b7('0x10')]===0x1f4){logger['error'](_0x74b7('0xb'),_0x4c0c54,_0x3cc669[_0x74b7('0xf')]['message']);return _0x3b1667(_0x3cc669[_0x74b7('0xf')][_0x74b7('0x11')]);}logger['error'](_0x74b7('0xb'),_0x4c0c54,_0x3cc669[_0x74b7('0xf')][_0x74b7('0x11')]);return _0x51fcae(_0x3cc669[_0x74b7('0xf')][_0x74b7('0x11')]);}else{logger[_0x74b7('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x4c0c54,'request\x20sent');_0x51fcae(_0x3cc669[_0x74b7('0x12')][_0x74b7('0x11')]);}})[_0x74b7('0x13')](function(_0x5476b8){logger['error'](_0x74b7('0xb'),_0x4c0c54,_0x5476b8);_0x3b1667(_0x5476b8);});});} \ No newline at end of file +var _0xc365=['code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x585594,_0xd1720b){var _0x423adf=function(_0x1d3ca3){while(--_0x1d3ca3){_0x585594['push'](_0x585594['shift']());}};_0x423adf(++_0xd1720b);}(_0xc365,0x15c));var _0x5c36=function(_0x5b1463,_0x195190){_0x5b1463=_0x5b1463-0x0;var _0x41516e=_0xc365[_0x5b1463];return _0x41516e;};'use strict';var _=require(_0x5c36('0x0'));var util=require(_0x5c36('0x1'));var moment=require(_0x5c36('0x2'));var BPromise=require(_0x5c36('0x3'));var rs=require(_0x5c36('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c36('0x5'))['db'];var utils=require(_0x5c36('0x6'));var logger=require(_0x5c36('0x7'))(_0x5c36('0x8'));var config=require(_0x5c36('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c36('0xa')][_0x5c36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f8fbf,_0x48ebd7,_0x41da3d){return new BPromise(function(_0x41282,_0x5a0f4a){return client['request'](_0x4f8fbf,_0x41da3d)[_0x5c36('0xc')](function(_0x44220c){logger[_0x5c36('0xd')](_0x5c36('0xe'),_0x48ebd7,'request\x20sent');logger[_0x5c36('0xf')](_0x5c36('0x10'),_0x48ebd7,_0x5c36('0x11'),JSON[_0x5c36('0x12')](_0x44220c));if(_0x44220c[_0x5c36('0x13')]){if(_0x44220c[_0x5c36('0x13')][_0x5c36('0x14')]===0x1f4){logger[_0x5c36('0x13')](_0x5c36('0xe'),_0x48ebd7,_0x44220c[_0x5c36('0x13')][_0x5c36('0x15')]);return _0x5a0f4a(_0x44220c[_0x5c36('0x13')][_0x5c36('0x15')]);}logger[_0x5c36('0x13')](_0x5c36('0xe'),_0x48ebd7,_0x44220c[_0x5c36('0x13')][_0x5c36('0x15')]);return _0x41282(_0x44220c[_0x5c36('0x13')][_0x5c36('0x15')]);}else{logger['info'](_0x5c36('0xe'),_0x48ebd7,_0x5c36('0x11'));_0x41282(_0x44220c[_0x5c36('0x16')][_0x5c36('0x15')]);}})['catch'](function(_0x366f44){logger[_0x5c36('0x13')](_0x5c36('0xe'),_0x48ebd7,_0x366f44);_0x5a0f4a(_0x366f44);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c98c855..1afad53 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4bd=['isAuthenticated','index','get','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xb4bd,0xdd));var _0xdb4b=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xb4bd[_0x427217];return _0x5b28fb;};'use strict';var multer=require(_0xdb4b('0x0'));var util=require(_0xdb4b('0x1'));var path=require(_0xdb4b('0x2'));var timeout=require(_0xdb4b('0x3'));var express=require(_0xdb4b('0x4'));var router=express[_0xdb4b('0x5')]();var fs_extra=require(_0xdb4b('0x6'));var auth=require(_0xdb4b('0x7'));var interaction=require(_0xdb4b('0x8'));var config=require(_0xdb4b('0x9'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xdb4b('0xa')](),controller[_0xdb4b('0xb')]);router[_0xdb4b('0xc')]('/describe',auth[_0xdb4b('0xa')](),controller[_0xdb4b('0xd')]);router[_0xdb4b('0xc')](_0xdb4b('0xe'),auth[_0xdb4b('0xa')](),controller[_0xdb4b('0xf')]);router[_0xdb4b('0x10')]('/',auth[_0xdb4b('0xa')](),controller['create']);router['put'](_0xdb4b('0xe'),auth[_0xdb4b('0xa')](),controller[_0xdb4b('0x11')]);router[_0xdb4b('0x12')](_0xdb4b('0xe'),auth[_0xdb4b('0xa')](),controller[_0xdb4b('0x13')]);module[_0xdb4b('0x14')]=router; \ No newline at end of file +var _0x5323=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0x5323,0xc9));var _0x3532=function(_0x1c18b1,_0x193ff1){_0x1c18b1=_0x1c18b1-0x0;var _0xd79eff=_0x5323[_0x1c18b1];return _0xd79eff;};'use strict';var multer=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var path=require(_0x3532('0x2'));var timeout=require(_0x3532('0x3'));var express=require('express');var router=express[_0x3532('0x4')]();var fs_extra=require(_0x3532('0x5'));var auth=require(_0x3532('0x6'));var interaction=require(_0x3532('0x7'));var config=require(_0x3532('0x8'));var controller=require('./faxTransferReport.controller');router[_0x3532('0x9')]('/',auth[_0x3532('0xa')](),controller[_0x3532('0xb')]);router[_0x3532('0x9')](_0x3532('0xc'),auth[_0x3532('0xa')](),controller['describe']);router[_0x3532('0x9')](_0x3532('0xd'),auth[_0x3532('0xa')](),controller[_0x3532('0xe')]);router[_0x3532('0xf')]('/',auth['isAuthenticated'](),controller[_0x3532('0x10')]);router[_0x3532('0x11')](_0x3532('0xd'),auth[_0x3532('0xa')](),controller[_0x3532('0x12')]);router['delete'](_0x3532('0xd'),auth['isAuthenticated'](),controller[_0x3532('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 57cbeb3..44a4b1a 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6422=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','post','addConfiguration','put','update','delete','destroy','exports','multer','path'];(function(_0x190941,_0x4bb8c7){var _0x45e060=function(_0x2047e8){while(--_0x2047e8){_0x190941['push'](_0x190941['shift']());}};_0x45e060(++_0x4bb8c7);}(_0x6422,0x140));var _0x2642=function(_0x308917,_0x3e4d15){_0x308917=_0x308917-0x0;var _0x1235ab=_0x6422[_0x308917];return _0x1235ab;};'use strict';var multer=require(_0x2642('0x0'));var util=require('util');var path=require(_0x2642('0x1'));var timeout=require(_0x2642('0x2'));var express=require(_0x2642('0x3'));var router=express[_0x2642('0x4')]();var fs_extra=require(_0x2642('0x5'));var auth=require(_0x2642('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2642('0x7'));router[_0x2642('0x8')]('/',auth['isAuthenticated'](),controller[_0x2642('0x9')]);router[_0x2642('0x8')](_0x2642('0xa'),auth['isAuthenticated'](),controller[_0x2642('0xb')]);router[_0x2642('0x8')](_0x2642('0xc'),auth['isAuthenticated'](),controller[_0x2642('0xd')]);router['get'](_0x2642('0xe'),auth[_0x2642('0xf')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2642('0x10')]('/:id/configurations',auth[_0x2642('0xf')](),controller[_0x2642('0x11')]);router[_0x2642('0x12')]('/:id',auth[_0x2642('0xf')](),controller[_0x2642('0x13')]);router[_0x2642('0x14')]('/:id',auth[_0x2642('0xf')](),controller[_0x2642('0x15')]);module[_0x2642('0x16')]=router; \ No newline at end of file +var _0x8015=['put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0x8015,0xad));var _0x5801=function(_0x13d44f,_0x5f28d8){_0x13d44f=_0x13d44f-0x0;var _0x2882d0=_0x8015[_0x13d44f];return _0x2882d0;};'use strict';var multer=require(_0x5801('0x0'));var util=require(_0x5801('0x1'));var path=require('path');var timeout=require(_0x5801('0x2'));var express=require('express');var router=express[_0x5801('0x3')]();var fs_extra=require(_0x5801('0x4'));var auth=require(_0x5801('0x5'));var interaction=require(_0x5801('0x6'));var config=require('../../config/environment');var controller=require(_0x5801('0x7'));router[_0x5801('0x8')]('/',auth[_0x5801('0x9')](),controller[_0x5801('0xa')]);router[_0x5801('0x8')](_0x5801('0xb'),auth[_0x5801('0x9')](),controller[_0x5801('0xc')]);router[_0x5801('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5801('0xd')]);router['get'](_0x5801('0xe'),auth[_0x5801('0x9')](),controller['getFields']);router[_0x5801('0xf')]('/',auth[_0x5801('0x9')](),controller[_0x5801('0x10')]);router[_0x5801('0xf')](_0x5801('0x11'),auth['isAuthenticated'](),controller[_0x5801('0x12')]);router[_0x5801('0x13')](_0x5801('0xb'),auth[_0x5801('0x9')](),controller[_0x5801('0x14')]);router[_0x5801('0x15')]('/:id',auth[_0x5801('0x9')](),controller[_0x5801('0x16')]);module[_0x5801('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6fdae5e..51b6756 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b31=['sequelize','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x5406ee,_0x5e4906){var _0x3e440b=function(_0xf0b381){while(--_0xf0b381){_0x5406ee['push'](_0x5406ee['shift']());}};_0x3e440b(++_0x5e4906);}(_0x1b31,0x78));var _0x11b3=function(_0x4b661f,_0x193a18){_0x4b661f=_0x4b661f-0x0;var _0x341475=_0x1b31[_0x4b661f];return _0x341475;};'use strict';var Sequelize=require(_0x11b3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11b3('0x1')]},'username':{'type':Sequelize[_0x11b3('0x1')]},'remoteUri':{'type':Sequelize[_0x11b3('0x1')]},'authType':{'type':Sequelize[_0x11b3('0x2')](_0x11b3('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x11b3('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x11b3('0x1')]},'tokenSecret':{'type':Sequelize[_0x11b3('0x1')]},'serverUrl':{'type':Sequelize[_0x11b3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x11b3('0x2')](_0x11b3('0x4'),_0x11b3('0x5')),'defaultValue':_0x11b3('0x4')}}; \ No newline at end of file +var _0x3d0a=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3d0a,0xe9));var _0xa3d0=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x3d0a[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xa3d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3d0('0x1')]},'description':{'type':Sequelize[_0xa3d0('0x1')]},'username':{'type':Sequelize[_0xa3d0('0x1')]},'remoteUri':{'type':Sequelize[_0xa3d0('0x1')]},'authType':{'type':Sequelize[_0xa3d0('0x2')](_0xa3d0('0x3')),'defaultValue':_0xa3d0('0x3')},'password':{'type':Sequelize[_0xa3d0('0x1')]},'consumerKey':{'type':Sequelize[_0xa3d0('0x1')]},'consumerSecret':{'type':Sequelize[_0xa3d0('0x1')]},'token':{'type':Sequelize[_0xa3d0('0x1')]},'tokenSecret':{'type':Sequelize[_0xa3d0('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa3d0('0x4'),_0xa3d0('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index acc072e..141ff69 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc570=['params','find','catch','create','body','findOne','DeskConfiguration','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','zip-dir','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xc570,0x167));var _0x0c57=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xc570[_0x363ef8];return _0x148822;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c57('0x0'));var zipdir=require(_0x0c57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c57('0x2'));var util=require(_0x0c57('0x3'));var path=require(_0x0c57('0x4'));var sox=require(_0x0c57('0x5'));var csv=require(_0x0c57('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c57('0x7'));var squel=require(_0x0c57('0x8'));var crypto=require(_0x0c57('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c57('0x6'));var querystring=require(_0x0c57('0xa'));var Papa=require('papaparse');var Redis=require(_0x0c57('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x0c57('0xc'));var as=require(_0x0c57('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0c57('0xe'));var utils=require(_0x0c57('0xf'));var config=require(_0x0c57('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0c57('0x11'));function respondWithStatusCode(_0x326fe3,_0x2fbcbf){_0x2fbcbf=_0x2fbcbf||0xcc;return function(_0x1d1eb5){if(_0x1d1eb5){return _0x326fe3[_0x0c57('0x12')](_0x2fbcbf);}return _0x326fe3[_0x0c57('0x13')](_0x2fbcbf)[_0x0c57('0x14')]();};}function respondWithResult(_0x30dcd4,_0x1bc2fc){_0x1bc2fc=_0x1bc2fc||0xc8;return function(_0x1b65ba){if(_0x1b65ba){return _0x30dcd4[_0x0c57('0x13')](_0x1bc2fc)['json'](_0x1b65ba);}};}function respondWithFilteredResult(_0x35ccba,_0x173d64){return function(_0x56ebba){if(_0x56ebba){var _0x11d3df=typeof _0x173d64[_0x0c57('0x15')]===_0x0c57('0x16')&&typeof _0x173d64[_0x0c57('0x17')]==='undefined';var _0x3864db=_0x56ebba[_0x0c57('0x18')];var _0x514afa=_0x11d3df?0x0:_0x173d64['offset'];var _0x4bee90=_0x11d3df?_0x56ebba[_0x0c57('0x18')]:_0x173d64['offset']+_0x173d64['limit'];var _0xfb7dee;if(_0x4bee90>=_0x3864db){_0x4bee90=_0x3864db;_0xfb7dee=0xc8;}else{_0xfb7dee=0xce;}_0x35ccba['status'](_0xfb7dee);return _0x35ccba['set'](_0x0c57('0x19'),_0x514afa+'-'+_0x4bee90+'/'+_0x3864db)[_0x0c57('0x1a')](_0x56ebba);}return null;};}function patchUpdates(_0x51a180){return function(_0x4255f3){try{jsonpatch['apply'](_0x4255f3,_0x51a180,!![]);}catch(_0x59ba09){return BPromise[_0x0c57('0x1b')](_0x59ba09);}return _0x4255f3[_0x0c57('0x1c')]();};}function saveUpdates(_0x5ce9eb,_0x285016){return function(_0x45d6e3){if(_0x45d6e3){return _0x45d6e3[_0x0c57('0x1d')](_0x5ce9eb)[_0x0c57('0x1e')](function(_0x3bec38){return _0x3bec38;});}return null;};}function removeEntity(_0x4e8d89,_0x5c416b){return function(_0x3446a3){if(_0x3446a3){return _0x3446a3[_0x0c57('0x1f')]()[_0x0c57('0x1e')](function(){_0x4e8d89[_0x0c57('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54df66,_0x2e6889){return function(_0x3b5dbc){if(!_0x3b5dbc){_0x54df66['sendStatus'](0x194);}return _0x3b5dbc;};}function handleError(_0x244b5e,_0x40a9a4){_0x40a9a4=_0x40a9a4||0x1f4;return function(_0x33f01a){logger[_0x0c57('0x20')](_0x33f01a[_0x0c57('0x21')]);if(_0x33f01a['name']){delete _0x33f01a[_0x0c57('0x22')];}_0x244b5e[_0x0c57('0x13')](_0x40a9a4)[_0x0c57('0x23')](_0x33f01a);};}exports[_0x0c57('0x24')]=function(_0x5de83a,_0x188b9a){var _0xa75054={},_0x32d29e={},_0x19c999={'count':0x0,'rows':[]};var _0x15aed6=_[_0x0c57('0x25')](db[_0x0c57('0x26')][_0x0c57('0x27')],function(_0x5810d2){return{'name':_0x5810d2[_0x0c57('0x28')],'type':_0x5810d2[_0x0c57('0x29')]['key']};});_0x32d29e['model']=_[_0x0c57('0x25')](_0x15aed6,_0x0c57('0x22'));_0x32d29e['query']=_[_0x0c57('0x2a')](_0x5de83a[_0x0c57('0x2b')]);_0x32d29e[_0x0c57('0x2c')]=_[_0x0c57('0x2d')](_0x32d29e[_0x0c57('0x2e')],_0x32d29e[_0x0c57('0x2b')]);_0xa75054[_0x0c57('0x2f')]=_[_0x0c57('0x2d')](_0x32d29e[_0x0c57('0x2e')],qs['fields'](_0x5de83a[_0x0c57('0x2b')][_0x0c57('0x30')]));_0xa75054[_0x0c57('0x2f')]=_0xa75054[_0x0c57('0x2f')][_0x0c57('0x31')]?_0xa75054[_0x0c57('0x2f')]:_0x32d29e['model'];if(!_0x5de83a[_0x0c57('0x2b')][_0x0c57('0x32')](_0x0c57('0x33'))){_0xa75054['limit']=qs[_0x0c57('0x17')](_0x5de83a[_0x0c57('0x2b')][_0x0c57('0x17')]);_0xa75054['offset']=qs[_0x0c57('0x15')](_0x5de83a[_0x0c57('0x2b')]['offset']);}_0xa75054[_0x0c57('0x34')]=qs[_0x0c57('0x35')](_0x5de83a[_0x0c57('0x2b')][_0x0c57('0x35')]);_0xa75054[_0x0c57('0x36')]=qs[_0x0c57('0x2c')](_[_0x0c57('0x37')](_0x5de83a[_0x0c57('0x2b')],_0x32d29e[_0x0c57('0x2c')]),_0x15aed6);if(_0x5de83a['query'][_0x0c57('0x38')]){_0xa75054[_0x0c57('0x36')]=_[_0x0c57('0x39')](_0xa75054['where'],{'$or':_[_0x0c57('0x25')](_0x15aed6,function(_0x46c26c){if(_0x46c26c[_0x0c57('0x29')]!==_0x0c57('0x3a')){var _0x39dad6={};_0x39dad6[_0x46c26c['name']]={'$like':'%'+_0x5de83a['query'][_0x0c57('0x38')]+'%'};return _0x39dad6;}})});}_0xa75054=_['merge']({},_0xa75054,_0x5de83a[_0x0c57('0x3b')]);var _0xd5c857={'where':_0xa75054[_0x0c57('0x36')]};return db[_0x0c57('0x26')][_0x0c57('0x18')](_0xd5c857)['then'](function(_0x1fab96){_0x19c999[_0x0c57('0x18')]=_0x1fab96;if(_0x5de83a['query'][_0x0c57('0x3c')]){_0xa75054[_0x0c57('0x3d')]=[{'all':!![]}];}return db[_0x0c57('0x26')][_0x0c57('0x3e')](_0xa75054);})[_0x0c57('0x1e')](function(_0x13b346){_0x19c999[_0x0c57('0x3f')]=_0x13b346;return _0x19c999;})[_0x0c57('0x1e')](respondWithFilteredResult(_0x188b9a,_0xa75054))['catch'](handleError(_0x188b9a,null));};exports[_0x0c57('0x40')]=function(_0x39a65c,_0x1cf23a){var _0x99169a={'raw':![],'where':{'id':_0x39a65c[_0x0c57('0x41')]['id']}},_0x49b13d={};_0x49b13d['model']=_[_0x0c57('0x2a')](db[_0x0c57('0x26')][_0x0c57('0x27')]);_0x49b13d[_0x0c57('0x2b')]=_[_0x0c57('0x2a')](_0x39a65c[_0x0c57('0x2b')]);_0x49b13d[_0x0c57('0x2c')]=_[_0x0c57('0x2d')](_0x49b13d[_0x0c57('0x2e')],_0x49b13d[_0x0c57('0x2b')]);_0x99169a[_0x0c57('0x2f')]=_[_0x0c57('0x2d')](_0x49b13d['model'],qs[_0x0c57('0x30')](_0x39a65c[_0x0c57('0x2b')][_0x0c57('0x30')]));_0x99169a['attributes']=_0x99169a['attributes'][_0x0c57('0x31')]?_0x99169a[_0x0c57('0x2f')]:_0x49b13d[_0x0c57('0x2e')];if(_0x39a65c[_0x0c57('0x2b')][_0x0c57('0x3c')]){_0x99169a[_0x0c57('0x3d')]=[{'all':!![]}];}_0x99169a=_['merge']({},_0x99169a,_0x39a65c[_0x0c57('0x3b')]);return db[_0x0c57('0x26')][_0x0c57('0x42')](_0x99169a)['then'](handleEntityNotFound(_0x1cf23a,null))[_0x0c57('0x1e')](respondWithResult(_0x1cf23a,null))[_0x0c57('0x43')](handleError(_0x1cf23a,null));};exports['create']=function(_0xc32067,_0x577bea){return db[_0x0c57('0x26')][_0x0c57('0x44')](_0xc32067['body'],{})[_0x0c57('0x1e')](respondWithResult(_0x577bea,0xc9))['catch'](handleError(_0x577bea,null));};exports[_0x0c57('0x1d')]=function(_0x30185d,_0x2a3315){if(_0x30185d[_0x0c57('0x45')]['id']){delete _0x30185d[_0x0c57('0x45')]['id'];}return db[_0x0c57('0x26')]['find']({'where':{'id':_0x30185d[_0x0c57('0x41')]['id']}})[_0x0c57('0x1e')](handleEntityNotFound(_0x2a3315,null))[_0x0c57('0x1e')](saveUpdates(_0x30185d['body'],null))[_0x0c57('0x1e')](respondWithResult(_0x2a3315,null))['catch'](handleError(_0x2a3315,null));};exports['destroy']=function(_0x393049,_0x9ea927){return db[_0x0c57('0x26')][_0x0c57('0x42')]({'where':{'id':_0x393049['params']['id']}})[_0x0c57('0x1e')](handleEntityNotFound(_0x9ea927,null))[_0x0c57('0x1e')](removeEntity(_0x9ea927,null))['catch'](handleError(_0x9ea927,null));};exports['getConfigurations']=function(_0x5b005a,_0x3781e6,_0x417116){var _0x263339={};var _0x306e60={};var _0x2ed97d;var _0x1db1be;return db[_0x0c57('0x26')][_0x0c57('0x46')]({'where':{'id':_0x5b005a['params']['id']}})['then'](handleEntityNotFound(_0x3781e6,null))['then'](function(_0x3553b){if(_0x3553b){_0x2ed97d=_0x3553b;_0x306e60[_0x0c57('0x2e')]=_['keys'](db[_0x0c57('0x47')][_0x0c57('0x27')]);_0x306e60[_0x0c57('0x2b')]=_[_0x0c57('0x2a')](_0x5b005a[_0x0c57('0x2b')]);_0x306e60[_0x0c57('0x2c')]=_[_0x0c57('0x2d')](_0x306e60['model'],_0x306e60[_0x0c57('0x2b')]);_0x263339[_0x0c57('0x2f')]=_[_0x0c57('0x2d')](_0x306e60[_0x0c57('0x2e')],qs[_0x0c57('0x30')](_0x5b005a[_0x0c57('0x2b')]['fields']));_0x263339[_0x0c57('0x2f')]=_0x263339[_0x0c57('0x2f')][_0x0c57('0x31')]?_0x263339['attributes']:_0x306e60[_0x0c57('0x2e')];_0x263339[_0x0c57('0x34')]=qs['sort'](_0x5b005a[_0x0c57('0x2b')][_0x0c57('0x35')]);_0x263339[_0x0c57('0x36')]=qs['filters'](_[_0x0c57('0x37')](_0x5b005a['query'],_0x306e60[_0x0c57('0x2c')]));if(_0x5b005a[_0x0c57('0x2b')][_0x0c57('0x38')]){_0x263339[_0x0c57('0x36')]=_[_0x0c57('0x39')](_0x263339[_0x0c57('0x36')],{'$or':_[_0x0c57('0x25')](_0x263339[_0x0c57('0x2f')],function(_0x3e5fd4){var _0x20e97c={};_0x20e97c[_0x3e5fd4]={'$like':'%'+_0x5b005a[_0x0c57('0x2b')][_0x0c57('0x38')]+'%'};return _0x20e97c;})});}_0x263339=_[_0x0c57('0x39')]({},_0x263339,_0x5b005a[_0x0c57('0x3b')]);return _0x2ed97d[_0x0c57('0x48')](_0x263339);}})['then'](function(_0x240aa3){if(_0x240aa3){_0x1db1be=_0x240aa3[_0x0c57('0x31')];if(!_0x5b005a['query']['hasOwnProperty']('nolimit')){_0x263339[_0x0c57('0x17')]=qs[_0x0c57('0x17')](_0x5b005a[_0x0c57('0x2b')]['limit']);_0x263339[_0x0c57('0x15')]=qs['offset'](_0x5b005a['query'][_0x0c57('0x15')]);}return _0x2ed97d[_0x0c57('0x48')](_0x263339);}})[_0x0c57('0x1e')](function(_0x1be431){if(_0x1be431){return _0x1be431?{'count':_0x1db1be,'rows':_0x1be431}:null;}})[_0x0c57('0x1e')](respondWithResult(_0x3781e6,null))[_0x0c57('0x43')](handleError(_0x3781e6,null));};exports['addConfiguration']=function(_0x9506a2,_0x303f21,_0xfe1897){if(_0x9506a2[_0x0c57('0x45')]['id']){delete _0x9506a2[_0x0c57('0x45')]['id'];}return db[_0x0c57('0x26')][_0x0c57('0x46')]({'where':{'id':_0x9506a2[_0x0c57('0x41')]['id']}})[_0x0c57('0x1e')](handleEntityNotFound(_0x303f21,null))[_0x0c57('0x1e')](function(_0x4534e7){if(_0x4534e7){_0x9506a2['body'][_0x0c57('0x49')]=_0x4534e7['id'];_0x9506a2[_0x0c57('0x45')]['Subjects']=integrations[_0x0c57('0x4a')](_0x9506a2['body'][_0x0c57('0x4b')],_0x9506a2[_0x0c57('0x45')][_0x0c57('0x29')]);_0x9506a2[_0x0c57('0x45')][_0x0c57('0x4c')]=integrations[_0x0c57('0x4d')](_0x9506a2[_0x0c57('0x45')][_0x0c57('0x4b')],_0x9506a2['body'][_0x0c57('0x29')]);return db[_0x0c57('0x47')][_0x0c57('0x44')](_0x9506a2['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x0c57('0x4e')],'as':_0x0c57('0x4c')}]});}return null;})[_0x0c57('0x1e')](respondWithResult(_0x303f21,null))[_0x0c57('0x43')](handleError(_0x303f21,null));};exports[_0x0c57('0x4f')]=function(_0x54382c,_0x32e6ec,_0x5505bd){var _0xeb9a36=[{'name':_0x0c57('0x50'),'label':_0x0c57('0x50'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2ff287='';return db['DeskAccount'][_0x0c57('0x46')]({'where':{'id':_0x54382c[_0x0c57('0x41')]['id']},'attributes':['id',_0x0c57('0x51'),'authType',_0x0c57('0x52'),_0x0c57('0x53'),_0x0c57('0x54'),_0x0c57('0x55'),_0x0c57('0x56'),_0x0c57('0x57')]})[_0x0c57('0x1e')](handleEntityNotFound(_0x32e6ec,null))['then'](function(_0x4cb7e8){if(_0x4cb7e8){_0x2ff287=_0x4cb7e8[_0x0c57('0x51')];var _0x30365d=_0x2ff287[_0x0c57('0x58')](-0x1);if(_0x30365d==='/'){_0x2ff287=_0x2ff287['substring'](0x0,_0x2ff287[_0x0c57('0x59')](_0x30365d));}var _0x8aec8a={'method':_0x0c57('0x5a'),'uri':util[_0x0c57('0x5b')](_0x0c57('0x5c'),_0x2ff287),'headers':{'Content-Type':_0x0c57('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x4cb7e8['authType']==='basic'){_0x8aec8a[_0x0c57('0x5e')]['Authorization']=util[_0x0c57('0x5b')](_0x0c57('0x5f'),new Buffer(util[_0x0c57('0x5b')](_0x0c57('0x60'),_0x4cb7e8[_0x0c57('0x52')],_0x4cb7e8['password']))[_0x0c57('0x61')](_0x0c57('0x62')));}return rp(_0x8aec8a)[_0x0c57('0x1e')](function(_0x3ea757){return _0xeb9a36[_0x0c57('0x63')](_['map'](_0x3ea757[_0x0c57('0x64')]['entries'],function(_0x1ac170){return{'id':_0x1ac170[_0x0c57('0x22')],'name':_0x1ac170[_0x0c57('0x22')],'type':_0x1ac170[_0x0c57('0x29')],'active':_0x1ac170['active'],'label':_0x1ac170[_0x0c57('0x65')],'custom':!![]};}));});}})[_0x0c57('0x1e')](function(_0x2af4d1){return{'count':_0x2af4d1[_0x0c57('0x31')],'rows':_0x2af4d1};})[_0x0c57('0x1e')](respondWithResult(_0x32e6ec,null))[_0x0c57('0x43')](function(_0x1fb19a){var _0xe8594=_0x54382c['query']['test']?0x1f4:_0x1fb19a[_0x0c57('0x66')]||0x1f4;logger['error'](_0x0c57('0x67'),'getFields',_0xe8594,JSON['stringify'](_0x1fb19a));delete _0x1fb19a[_0x0c57('0x22')];if(_0xe8594===0x191){_0xe8594=0x190;}_0x32e6ec['status'](_0xe8594)[_0x0c57('0x23')](_0x54382c[_0x0c57('0x2b')][_0x0c57('0x68')]?{'message':_0x0c57('0x69'),'statusCode':_0x1fb19a[_0x0c57('0x66')]}:_0x1fb19a);});}; \ No newline at end of file +var _0x0fb6=['%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','base64','_embedded','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','update','find','params','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format'];(function(_0xd488d6,_0x2e0ada){var _0x32056c=function(_0x970da2){while(--_0x970da2){_0xd488d6['push'](_0xd488d6['shift']());}};_0x32056c(++_0x2e0ada);}(_0x0fb6,0xf1));var _0x60fb=function(_0x54964f,_0x2221e3){_0x54964f=_0x54964f-0x0;var _0x55bbad=_0x0fb6[_0x54964f];return _0x55bbad;};'use strict';var emlformat=require(_0x60fb('0x0'));var rimraf=require(_0x60fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60fb('0x2'));var rp=require('request-promise');var moment=require(_0x60fb('0x3'));var BPromise=require(_0x60fb('0x4'));var Mustache=require(_0x60fb('0x5'));var util=require(_0x60fb('0x6'));var path=require(_0x60fb('0x7'));var sox=require(_0x60fb('0x8'));var csv=require(_0x60fb('0x9'));var ejs=require(_0x60fb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60fb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x60fb('0xc'));var deskjs=require(_0x60fb('0xd'));var toCsv=require(_0x60fb('0x9'));var querystring=require(_0x60fb('0xe'));var Papa=require(_0x60fb('0xf'));var Redis=require('ioredis');var authService=require(_0x60fb('0x10'));var qs=require(_0x60fb('0x11'));var as=require(_0x60fb('0x12'));var hardwareService=require(_0x60fb('0x13'));var logger=require('../../config/logger')(_0x60fb('0x14'));var utils=require(_0x60fb('0x15'));var config=require(_0x60fb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x60fb('0x17'))['db'];var integrations=require(_0x60fb('0x18'));function respondWithStatusCode(_0x481706,_0x238fdd){_0x238fdd=_0x238fdd||0xcc;return function(_0x5e0410){if(_0x5e0410){return _0x481706[_0x60fb('0x19')](_0x238fdd);}return _0x481706[_0x60fb('0x1a')](_0x238fdd)[_0x60fb('0x1b')]();};}function respondWithResult(_0x387000,_0x1f26b8){_0x1f26b8=_0x1f26b8||0xc8;return function(_0x17845b){if(_0x17845b){return _0x387000[_0x60fb('0x1a')](_0x1f26b8)[_0x60fb('0x1c')](_0x17845b);}};}function respondWithFilteredResult(_0x277c9a,_0x30b875){return function(_0x52533c){if(_0x52533c){var _0x1cc05c=typeof _0x30b875[_0x60fb('0x1d')]===_0x60fb('0x1e')&&typeof _0x30b875[_0x60fb('0x1f')]===_0x60fb('0x1e');var _0x1fec6f=_0x52533c[_0x60fb('0x20')];var _0x3892db=_0x1cc05c?0x0:_0x30b875[_0x60fb('0x1d')];var _0x33bc90=_0x1cc05c?_0x52533c['count']:_0x30b875[_0x60fb('0x1d')]+_0x30b875[_0x60fb('0x1f')];var _0x3dda47;if(_0x33bc90>=_0x1fec6f){_0x33bc90=_0x1fec6f;_0x3dda47=0xc8;}else{_0x3dda47=0xce;}_0x277c9a[_0x60fb('0x1a')](_0x3dda47);return _0x277c9a[_0x60fb('0x21')](_0x60fb('0x22'),_0x3892db+'-'+_0x33bc90+'/'+_0x1fec6f)['json'](_0x52533c);}return null;};}function patchUpdates(_0x3a8586){return function(_0x5017a9){try{jsonpatch[_0x60fb('0x23')](_0x5017a9,_0x3a8586,!![]);}catch(_0x2dd6f3){return BPromise['reject'](_0x2dd6f3);}return _0x5017a9[_0x60fb('0x24')]();};}function saveUpdates(_0x543489,_0x583a5c){return function(_0x3f9324){if(_0x3f9324){return _0x3f9324['update'](_0x543489)[_0x60fb('0x25')](function(_0x3133b6){return _0x3133b6;});}return null;};}function removeEntity(_0x1c8d14,_0x309949){return function(_0x965bfc){if(_0x965bfc){return _0x965bfc['destroy']()[_0x60fb('0x25')](function(){_0x1c8d14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x438267,_0x59478a){return function(_0x9d38b5){if(!_0x9d38b5){_0x438267[_0x60fb('0x19')](0x194);}return _0x9d38b5;};}function handleError(_0x368d1d,_0x123798){_0x123798=_0x123798||0x1f4;return function(_0x29e5ad){logger[_0x60fb('0x26')](_0x29e5ad['stack']);if(_0x29e5ad[_0x60fb('0x27')]){delete _0x29e5ad[_0x60fb('0x27')];}_0x368d1d[_0x60fb('0x1a')](_0x123798)['send'](_0x29e5ad);};}exports[_0x60fb('0x28')]=function(_0x5660b1,_0x1b9449){var _0x56125d={},_0x5d874d={},_0x38976d={'count':0x0,'rows':[]};var _0x1fd1b8=_[_0x60fb('0x29')](db[_0x60fb('0x2a')][_0x60fb('0x2b')],function(_0x330f50){return{'name':_0x330f50[_0x60fb('0x2c')],'type':_0x330f50['type'][_0x60fb('0x2d')]};});_0x5d874d[_0x60fb('0x2e')]=_['map'](_0x1fd1b8,_0x60fb('0x27'));_0x5d874d[_0x60fb('0x2f')]=_[_0x60fb('0x30')](_0x5660b1[_0x60fb('0x2f')]);_0x5d874d[_0x60fb('0x31')]=_[_0x60fb('0x32')](_0x5d874d['model'],_0x5d874d[_0x60fb('0x2f')]);_0x56125d[_0x60fb('0x33')]=_[_0x60fb('0x32')](_0x5d874d[_0x60fb('0x2e')],qs[_0x60fb('0x34')](_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x34')]));_0x56125d[_0x60fb('0x33')]=_0x56125d[_0x60fb('0x33')][_0x60fb('0x35')]?_0x56125d[_0x60fb('0x33')]:_0x5d874d[_0x60fb('0x2e')];if(!_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x36')]('nolimit')){_0x56125d[_0x60fb('0x1f')]=qs['limit'](_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x1f')]);_0x56125d['offset']=qs[_0x60fb('0x1d')](_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x1d')]);}_0x56125d[_0x60fb('0x37')]=qs[_0x60fb('0x38')](_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x38')]);_0x56125d[_0x60fb('0x39')]=qs['filters'](_[_0x60fb('0x3a')](_0x5660b1[_0x60fb('0x2f')],_0x5d874d[_0x60fb('0x31')]),_0x1fd1b8);if(_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x3b')]){_0x56125d[_0x60fb('0x39')]=_[_0x60fb('0x3c')](_0x56125d['where'],{'$or':_[_0x60fb('0x29')](_0x1fd1b8,function(_0x1634a5){if(_0x1634a5['type']!==_0x60fb('0x3d')){var _0x17749f={};_0x17749f[_0x1634a5[_0x60fb('0x27')]]={'$like':'%'+_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x3b')]+'%'};return _0x17749f;}})});}_0x56125d=_[_0x60fb('0x3c')]({},_0x56125d,_0x5660b1[_0x60fb('0x3e')]);var _0x2bfb56={'where':_0x56125d[_0x60fb('0x39')]};return db[_0x60fb('0x2a')][_0x60fb('0x20')](_0x2bfb56)[_0x60fb('0x25')](function(_0x585a74){_0x38976d[_0x60fb('0x20')]=_0x585a74;if(_0x5660b1[_0x60fb('0x2f')][_0x60fb('0x3f')]){_0x56125d[_0x60fb('0x40')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x56125d);})[_0x60fb('0x25')](function(_0x1d1d48){_0x38976d[_0x60fb('0x41')]=_0x1d1d48;return _0x38976d;})[_0x60fb('0x25')](respondWithFilteredResult(_0x1b9449,_0x56125d))[_0x60fb('0x42')](handleError(_0x1b9449,null));};exports[_0x60fb('0x43')]=function(_0x35fe80,_0x4b2401){var _0x45e8ae={'raw':![],'where':{'id':_0x35fe80['params']['id']}},_0x52c03f={};_0x52c03f[_0x60fb('0x2e')]=_[_0x60fb('0x30')](db['DeskAccount'][_0x60fb('0x2b')]);_0x52c03f[_0x60fb('0x2f')]=_[_0x60fb('0x30')](_0x35fe80[_0x60fb('0x2f')]);_0x52c03f[_0x60fb('0x31')]=_[_0x60fb('0x32')](_0x52c03f['model'],_0x52c03f[_0x60fb('0x2f')]);_0x45e8ae[_0x60fb('0x33')]=_[_0x60fb('0x32')](_0x52c03f[_0x60fb('0x2e')],qs[_0x60fb('0x34')](_0x35fe80[_0x60fb('0x2f')]['fields']));_0x45e8ae[_0x60fb('0x33')]=_0x45e8ae[_0x60fb('0x33')][_0x60fb('0x35')]?_0x45e8ae[_0x60fb('0x33')]:_0x52c03f['model'];if(_0x35fe80['query']['includeAll']){_0x45e8ae[_0x60fb('0x40')]=[{'all':!![]}];}_0x45e8ae=_[_0x60fb('0x3c')]({},_0x45e8ae,_0x35fe80['options']);return db[_0x60fb('0x2a')]['find'](_0x45e8ae)[_0x60fb('0x25')](handleEntityNotFound(_0x4b2401,null))[_0x60fb('0x25')](respondWithResult(_0x4b2401,null))[_0x60fb('0x42')](handleError(_0x4b2401,null));};exports[_0x60fb('0x44')]=function(_0xbdba6d,_0x39d2aa){return db[_0x60fb('0x2a')]['create'](_0xbdba6d[_0x60fb('0x45')],{})[_0x60fb('0x25')](respondWithResult(_0x39d2aa,0xc9))[_0x60fb('0x42')](handleError(_0x39d2aa,null));};exports[_0x60fb('0x46')]=function(_0x5d9bcc,_0x113a7c){if(_0x5d9bcc[_0x60fb('0x45')]['id']){delete _0x5d9bcc[_0x60fb('0x45')]['id'];}return db[_0x60fb('0x2a')][_0x60fb('0x47')]({'where':{'id':_0x5d9bcc[_0x60fb('0x48')]['id']}})[_0x60fb('0x25')](handleEntityNotFound(_0x113a7c,null))[_0x60fb('0x25')](saveUpdates(_0x5d9bcc['body'],null))[_0x60fb('0x25')](respondWithResult(_0x113a7c,null))[_0x60fb('0x42')](handleError(_0x113a7c,null));};exports['destroy']=function(_0x348acf,_0x275770){return db[_0x60fb('0x2a')][_0x60fb('0x47')]({'where':{'id':_0x348acf[_0x60fb('0x48')]['id']}})[_0x60fb('0x25')](handleEntityNotFound(_0x275770,null))[_0x60fb('0x25')](removeEntity(_0x275770,null))[_0x60fb('0x42')](handleError(_0x275770,null));};exports[_0x60fb('0x49')]=function(_0x222e57,_0x41bca2,_0x7bcfc4){var _0x1c87e0={};var _0x1657f9={};var _0x586842;var _0x77aaf8;return db[_0x60fb('0x2a')]['findOne']({'where':{'id':_0x222e57['params']['id']}})[_0x60fb('0x25')](handleEntityNotFound(_0x41bca2,null))[_0x60fb('0x25')](function(_0x118887){if(_0x118887){_0x586842=_0x118887;_0x1657f9[_0x60fb('0x2e')]=_[_0x60fb('0x30')](db['DeskConfiguration'][_0x60fb('0x2b')]);_0x1657f9[_0x60fb('0x2f')]=_['keys'](_0x222e57[_0x60fb('0x2f')]);_0x1657f9[_0x60fb('0x31')]=_[_0x60fb('0x32')](_0x1657f9[_0x60fb('0x2e')],_0x1657f9[_0x60fb('0x2f')]);_0x1c87e0[_0x60fb('0x33')]=_[_0x60fb('0x32')](_0x1657f9['model'],qs['fields'](_0x222e57[_0x60fb('0x2f')][_0x60fb('0x34')]));_0x1c87e0[_0x60fb('0x33')]=_0x1c87e0[_0x60fb('0x33')]['length']?_0x1c87e0[_0x60fb('0x33')]:_0x1657f9[_0x60fb('0x2e')];_0x1c87e0['order']=qs['sort'](_0x222e57[_0x60fb('0x2f')][_0x60fb('0x38')]);_0x1c87e0[_0x60fb('0x39')]=qs['filters'](_[_0x60fb('0x3a')](_0x222e57[_0x60fb('0x2f')],_0x1657f9['filters']));if(_0x222e57[_0x60fb('0x2f')][_0x60fb('0x3b')]){_0x1c87e0[_0x60fb('0x39')]=_['merge'](_0x1c87e0[_0x60fb('0x39')],{'$or':_[_0x60fb('0x29')](_0x1c87e0[_0x60fb('0x33')],function(_0xe592e1){var _0x394c4d={};_0x394c4d[_0xe592e1]={'$like':'%'+_0x222e57[_0x60fb('0x2f')][_0x60fb('0x3b')]+'%'};return _0x394c4d;})});}_0x1c87e0=_['merge']({},_0x1c87e0,_0x222e57[_0x60fb('0x3e')]);return _0x586842[_0x60fb('0x49')](_0x1c87e0);}})[_0x60fb('0x25')](function(_0x18daf2){if(_0x18daf2){_0x77aaf8=_0x18daf2[_0x60fb('0x35')];if(!_0x222e57[_0x60fb('0x2f')][_0x60fb('0x36')](_0x60fb('0x4a'))){_0x1c87e0[_0x60fb('0x1f')]=qs[_0x60fb('0x1f')](_0x222e57[_0x60fb('0x2f')]['limit']);_0x1c87e0[_0x60fb('0x1d')]=qs[_0x60fb('0x1d')](_0x222e57['query'][_0x60fb('0x1d')]);}return _0x586842['getConfigurations'](_0x1c87e0);}})[_0x60fb('0x25')](function(_0x535d5e){if(_0x535d5e){return _0x535d5e?{'count':_0x77aaf8,'rows':_0x535d5e}:null;}})[_0x60fb('0x25')](respondWithResult(_0x41bca2,null))[_0x60fb('0x42')](handleError(_0x41bca2,null));};exports[_0x60fb('0x4b')]=function(_0x2b684a,_0x3f0bc9,_0x39ee00){if(_0x2b684a[_0x60fb('0x45')]['id']){delete _0x2b684a[_0x60fb('0x45')]['id'];}return db[_0x60fb('0x2a')][_0x60fb('0x4c')]({'where':{'id':_0x2b684a['params']['id']}})['then'](handleEntityNotFound(_0x3f0bc9,null))['then'](function(_0x3b1c50){if(_0x3b1c50){_0x2b684a['body'][_0x60fb('0x4d')]=_0x3b1c50['id'];_0x2b684a['body'][_0x60fb('0x4e')]=integrations['getSubjects'](_0x2b684a[_0x60fb('0x45')][_0x60fb('0x4f')],_0x2b684a['body'][_0x60fb('0x50')]);_0x2b684a[_0x60fb('0x45')][_0x60fb('0x51')]=integrations[_0x60fb('0x52')](_0x2b684a[_0x60fb('0x45')][_0x60fb('0x4f')],_0x2b684a[_0x60fb('0x45')][_0x60fb('0x50')]);return db[_0x60fb('0x53')][_0x60fb('0x44')](_0x2b684a['body'],{'include':[{'model':db[_0x60fb('0x54')],'as':_0x60fb('0x4e')},{'model':db[_0x60fb('0x54')],'as':_0x60fb('0x51')}]});}return null;})[_0x60fb('0x25')](respondWithResult(_0x3f0bc9,null))[_0x60fb('0x42')](handleError(_0x3f0bc9,null));};exports[_0x60fb('0x55')]=function(_0x29344c,_0x12248c,_0x2d5ff){var _0x2b8947=[{'name':_0x60fb('0x56'),'label':_0x60fb('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2ef99c='';return db[_0x60fb('0x2a')][_0x60fb('0x4c')]({'where':{'id':_0x29344c[_0x60fb('0x48')]['id']},'attributes':['id',_0x60fb('0x57'),_0x60fb('0x58'),_0x60fb('0x59'),'password',_0x60fb('0x5a'),_0x60fb('0x5b'),'token',_0x60fb('0x5c')]})[_0x60fb('0x25')](handleEntityNotFound(_0x12248c,null))[_0x60fb('0x25')](function(_0x88c5f6){if(_0x88c5f6){_0x2ef99c=_0x88c5f6['remoteUri'];var _0x52fbb4=_0x2ef99c[_0x60fb('0x5d')](-0x1);if(_0x52fbb4==='/'){_0x2ef99c=_0x2ef99c[_0x60fb('0x5e')](0x0,_0x2ef99c[_0x60fb('0x5f')](_0x52fbb4));}var _0x25b3af={'method':_0x60fb('0x60'),'uri':util[_0x60fb('0x61')](_0x60fb('0x62'),_0x2ef99c),'headers':{'Content-Type':_0x60fb('0x63'),'Accept':_0x60fb('0x63')},'json':!![]};if(_0x88c5f6[_0x60fb('0x58')]===_0x60fb('0x64')){_0x25b3af['headers'][_0x60fb('0x65')]=util[_0x60fb('0x61')](_0x60fb('0x66'),new Buffer(util[_0x60fb('0x61')](_0x60fb('0x67'),_0x88c5f6[_0x60fb('0x59')],_0x88c5f6['password']))['toString'](_0x60fb('0x68')));}return rp(_0x25b3af)[_0x60fb('0x25')](function(_0x2b458c){return _0x2b8947['concat'](_[_0x60fb('0x29')](_0x2b458c[_0x60fb('0x69')][_0x60fb('0x6a')],function(_0x726755){return{'id':_0x726755['name'],'name':_0x726755[_0x60fb('0x27')],'type':_0x726755[_0x60fb('0x50')],'active':_0x726755[_0x60fb('0x6b')],'label':_0x726755['label'],'custom':!![]};}));});}})['then'](function(_0x15caeb){return{'count':_0x15caeb[_0x60fb('0x35')],'rows':_0x15caeb};})[_0x60fb('0x25')](respondWithResult(_0x12248c,null))[_0x60fb('0x42')](function(_0x5c04a4){var _0x4ae88e=_0x29344c[_0x60fb('0x2f')]['test']?0x1f4:_0x5c04a4[_0x60fb('0x6c')]||0x1f4;logger[_0x60fb('0x26')](_0x60fb('0x6d'),_0x60fb('0x55'),_0x4ae88e,JSON[_0x60fb('0x6e')](_0x5c04a4));delete _0x5c04a4['name'];if(_0x4ae88e===0x191){_0x4ae88e=0x190;}_0x12248c[_0x60fb('0x1a')](_0x4ae88e)['send'](_0x29344c['query'][_0x60fb('0x6f')]?{'message':_0x60fb('0x70'),'statusCode':_0x5c04a4['statusCode']}:_0x5c04a4);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 43d054a..2a99fed 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae8e=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0xae8e,0x1f3));var _0xeae8=function(_0xcc452b,_0x420786){_0xcc452b=_0xcc452b-0x0;var _0x29c07a=_0xae8e[_0xcc452b];return _0x29c07a;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))(_0xeae8('0x3'));var moment=require(_0xeae8('0x4'));var BPromise=require(_0xeae8('0x5'));var rp=require(_0xeae8('0x6'));var fs=require('fs');var path=require(_0xeae8('0x7'));var rimraf=require(_0xeae8('0x8'));var config=require(_0xeae8('0x9'));var attributes=require(_0xeae8('0xa'));var integrations=require(_0xeae8('0xb'));module[_0xeae8('0xc')]=function(_0x5c88cc,_0x390ebd){return _0x5c88cc[_0xeae8('0xd')](_0xeae8('0xe'),attributes,{'tableName':_0xeae8('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x047e=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39c29a,_0x39d66c){var _0xf4aad8=function(_0x70a97e){while(--_0x70a97e){_0x39c29a['push'](_0x39c29a['shift']());}};_0xf4aad8(++_0x39d66c);}(_0x047e,0x66));var _0xe047=function(_0x35ad6a,_0x3585aa){_0x35ad6a=_0x35ad6a-0x0;var _0x324955=_0x047e[_0x35ad6a];return _0x324955;};'use strict';var _=require(_0xe047('0x0'));var util=require(_0xe047('0x1'));var logger=require(_0xe047('0x2'))(_0xe047('0x3'));var moment=require(_0xe047('0x4'));var BPromise=require(_0xe047('0x5'));var rp=require(_0xe047('0x6'));var fs=require('fs');var path=require(_0xe047('0x7'));var rimraf=require(_0xe047('0x8'));var config=require(_0xe047('0x9'));var attributes=require(_0xe047('0xa'));var integrations=require(_0xe047('0xb'));module[_0xe047('0xc')]=function(_0x12b018,_0x5ab9ea){return _0x12b018[_0xe047('0xd')](_0xe047('0xe'),attributes,{'tableName':_0xe047('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index ecf9f41..811ee6d 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd393=['GetDeskAccount','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd393,0x18c));var _0x3d39=function(_0x23609c,_0x191db0){_0x23609c=_0x23609c-0x0;var _0x228dd3=_0xd393[_0x23609c];return _0x228dd3;};'use strict';var _=require(_0x3d39('0x0'));var util=require(_0x3d39('0x1'));var moment=require(_0x3d39('0x2'));var BPromise=require(_0x3d39('0x3'));var rs=require(_0x3d39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d39('0x5'));var logger=require(_0x3d39('0x6'))(_0x3d39('0x7'));var config=require(_0x3d39('0x8'));var jayson=require(_0x3d39('0x9'));var client=jayson[_0x3d39('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe51157,_0xa7a093,_0x40d7be){return new BPromise(function(_0x423127,_0x33ad85){return client['request'](_0xe51157,_0x40d7be)[_0x3d39('0xb')](function(_0x45f5d4){logger[_0x3d39('0xc')](_0x3d39('0xd'),_0xa7a093,_0x3d39('0xe'));logger[_0x3d39('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xa7a093,'request\x20sent',JSON[_0x3d39('0x10')](_0x45f5d4));if(_0x45f5d4[_0x3d39('0x11')]){if(_0x45f5d4[_0x3d39('0x11')]['code']===0x1f4){logger[_0x3d39('0x11')](_0x3d39('0xd'),_0xa7a093,_0x45f5d4[_0x3d39('0x11')][_0x3d39('0x12')]);return _0x33ad85(_0x45f5d4[_0x3d39('0x11')]['message']);}logger[_0x3d39('0x11')](_0x3d39('0xd'),_0xa7a093,_0x45f5d4[_0x3d39('0x11')][_0x3d39('0x12')]);return _0x423127(_0x45f5d4[_0x3d39('0x11')][_0x3d39('0x12')]);}else{logger[_0x3d39('0xc')](_0x3d39('0xd'),_0xa7a093,_0x3d39('0xe'));_0x423127(_0x45f5d4['result'][_0x3d39('0x12')]);}})[_0x3d39('0x13')](function(_0x89c5d7){logger[_0x3d39('0x11')](_0x3d39('0xd'),_0xa7a093,_0x89c5d7);_0x33ad85(_0x89c5d7);});});}exports[_0x3d39('0x14')]=function(_0x6bf145){var _0x141db6=this;return new Promise(function(_0x4c234b,_0x1ce090){return db['DeskAccount']['findAll']({'raw':_0x6bf145[_0x3d39('0x15')]?_0x6bf145['options'][_0x3d39('0x16')]===undefined?!![]:![]:!![],'where':_0x6bf145[_0x3d39('0x15')]?_0x6bf145[_0x3d39('0x15')][_0x3d39('0x17')]||null:null,'attributes':_0x6bf145[_0x3d39('0x15')]?_0x6bf145[_0x3d39('0x15')][_0x3d39('0x18')]||null:null,'limit':_0x6bf145[_0x3d39('0x15')]?_0x6bf145[_0x3d39('0x15')][_0x3d39('0x19')]||null:null,'include':_0x6bf145[_0x3d39('0x15')]?_0x6bf145['options'][_0x3d39('0x1a')]?_[_0x3d39('0x1b')](_0x6bf145[_0x3d39('0x15')][_0x3d39('0x1a')],function(_0x17815b){return{'model':db[_0x17815b[_0x3d39('0x1c')]],'as':_0x17815b['as'],'attributes':_0x17815b[_0x3d39('0x18')],'include':_0x17815b[_0x3d39('0x1a')]?_[_0x3d39('0x1b')](_0x17815b['include'],function(_0x5159ef){return{'model':db[_0x5159ef[_0x3d39('0x1c')]],'as':_0x5159ef['as'],'attributes':_0x5159ef[_0x3d39('0x18')],'include':_0x5159ef[_0x3d39('0x1a')]?_['map'](_0x5159ef[_0x3d39('0x1a')],function(_0x91d68f){return{'model':db[_0x91d68f[_0x3d39('0x1c')]],'as':_0x91d68f['as'],'attributes':_0x91d68f[_0x3d39('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3d39('0xb')](function(_0x5ead10){logger[_0x3d39('0xc')](_0x3d39('0x14'),_0x6bf145);logger[_0x3d39('0xf')]('GetDeskAccount',_0x6bf145,JSON[_0x3d39('0x10')](_0x5ead10));_0x4c234b(_0x5ead10);})[_0x3d39('0x13')](function(_0x507e1b){logger[_0x3d39('0x11')](_0x3d39('0x14'),_0x507e1b['message'],_0x6bf145);_0x1ce090(_0x141db6['error'](0x1f4,_0x507e1b[_0x3d39('0x12')]));});});};exports[_0x3d39('0x1d')]=function(_0x314d38){var _0x42670e=this;return new Promise(function(_0xfce6f8,_0x4986d1){return db[_0x3d39('0x1e')][_0x3d39('0x1f')]({'raw':_0x314d38[_0x3d39('0x15')]?_0x314d38[_0x3d39('0x15')][_0x3d39('0x16')]===undefined?!![]:![]:!![],'where':_0x314d38[_0x3d39('0x15')]?_0x314d38[_0x3d39('0x15')][_0x3d39('0x17')]||null:null,'attributes':_0x314d38[_0x3d39('0x15')]?_0x314d38['options'][_0x3d39('0x18')]||null:null,'include':_0x314d38[_0x3d39('0x15')]?_0x314d38[_0x3d39('0x15')][_0x3d39('0x1a')]?_[_0x3d39('0x1b')](_0x314d38[_0x3d39('0x15')][_0x3d39('0x1a')],function(_0x38af46){return{'model':db[_0x38af46[_0x3d39('0x1c')]],'as':_0x38af46['as'],'attributes':_0x38af46[_0x3d39('0x18')],'include':_0x38af46[_0x3d39('0x1a')]?_[_0x3d39('0x1b')](_0x38af46[_0x3d39('0x1a')],function(_0x297674){return{'model':db[_0x297674[_0x3d39('0x1c')]],'as':_0x297674['as'],'attributes':_0x297674[_0x3d39('0x18')],'include':_0x297674[_0x3d39('0x1a')]?_[_0x3d39('0x1b')](_0x297674[_0x3d39('0x1a')],function(_0x3bf4bb){return{'model':db[_0x3bf4bb[_0x3d39('0x1c')]],'as':_0x3bf4bb['as'],'attributes':_0x3bf4bb[_0x3d39('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3d39('0xb')](function(_0x36c6c1){logger['info']('ShowDeskAccount',_0x314d38);logger['debug'](_0x3d39('0x1d'),_0x314d38,JSON[_0x3d39('0x10')](_0x36c6c1));_0xfce6f8(_0x36c6c1);})[_0x3d39('0x13')](function(_0x34cc2c){logger[_0x3d39('0x11')](_0x3d39('0x1d'),_0x34cc2c[_0x3d39('0x12')],_0x314d38);_0x4986d1(_0x42670e[_0x3d39('0x11')](0x1f4,_0x34cc2c[_0x3d39('0x12')]));});});}; \ No newline at end of file +var _0x6b3a=['code','message','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowDeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x464058,_0x5569c6){var _0x3351fc=function(_0x1a4578){while(--_0x1a4578){_0x464058['push'](_0x464058['shift']());}};_0x3351fc(++_0x5569c6);}(_0x6b3a,0x14b));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6b3('0x0'));var util=require(_0xa6b3('0x1'));var moment=require(_0xa6b3('0x2'));var BPromise=require(_0xa6b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6b3('0x5'));var logger=require('../../config/logger')(_0xa6b3('0x6'));var config=require(_0xa6b3('0x7'));var jayson=require(_0xa6b3('0x8'));var client=jayson[_0xa6b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e44f1,_0x15ba70,_0x508a85){return new BPromise(function(_0x5f1a6f,_0x153be2){return client[_0xa6b3('0xa')](_0x4e44f1,_0x508a85)[_0xa6b3('0xb')](function(_0x1b70bf){logger[_0xa6b3('0xc')](_0xa6b3('0xd'),_0x15ba70,_0xa6b3('0xe'));logger[_0xa6b3('0xf')](_0xa6b3('0x10'),_0x15ba70,_0xa6b3('0xe'),JSON[_0xa6b3('0x11')](_0x1b70bf));if(_0x1b70bf[_0xa6b3('0x12')]){if(_0x1b70bf[_0xa6b3('0x12')][_0xa6b3('0x13')]===0x1f4){logger[_0xa6b3('0x12')](_0xa6b3('0xd'),_0x15ba70,_0x1b70bf['error']['message']);return _0x153be2(_0x1b70bf[_0xa6b3('0x12')][_0xa6b3('0x14')]);}logger[_0xa6b3('0x12')](_0xa6b3('0xd'),_0x15ba70,_0x1b70bf[_0xa6b3('0x12')]['message']);return _0x5f1a6f(_0x1b70bf[_0xa6b3('0x12')]['message']);}else{logger[_0xa6b3('0xc')](_0xa6b3('0xd'),_0x15ba70,_0xa6b3('0xe'));_0x5f1a6f(_0x1b70bf['result'][_0xa6b3('0x14')]);}})['catch'](function(_0x291d1c){logger['error'](_0xa6b3('0xd'),_0x15ba70,_0x291d1c);_0x153be2(_0x291d1c);});});}exports[_0xa6b3('0x15')]=function(_0x53d46c){var _0x46948f=this;return new Promise(function(_0x247dee,_0x25e954){return db[_0xa6b3('0x16')][_0xa6b3('0x17')]({'raw':_0x53d46c[_0xa6b3('0x18')]?_0x53d46c['options'][_0xa6b3('0x19')]===undefined?!![]:![]:!![],'where':_0x53d46c[_0xa6b3('0x18')]?_0x53d46c[_0xa6b3('0x18')]['where']||null:null,'attributes':_0x53d46c[_0xa6b3('0x18')]?_0x53d46c[_0xa6b3('0x18')][_0xa6b3('0x1a')]||null:null,'limit':_0x53d46c[_0xa6b3('0x18')]?_0x53d46c['options'][_0xa6b3('0x1b')]||null:null,'include':_0x53d46c[_0xa6b3('0x18')]?_0x53d46c['options'][_0xa6b3('0x1c')]?_[_0xa6b3('0x1d')](_0x53d46c[_0xa6b3('0x18')][_0xa6b3('0x1c')],function(_0x36af05){return{'model':db[_0x36af05[_0xa6b3('0x1e')]],'as':_0x36af05['as'],'attributes':_0x36af05['attributes'],'include':_0x36af05['include']?_[_0xa6b3('0x1d')](_0x36af05[_0xa6b3('0x1c')],function(_0x572837){return{'model':db[_0x572837[_0xa6b3('0x1e')]],'as':_0x572837['as'],'attributes':_0x572837[_0xa6b3('0x1a')],'include':_0x572837[_0xa6b3('0x1c')]?_['map'](_0x572837[_0xa6b3('0x1c')],function(_0x488b54){return{'model':db[_0x488b54['model']],'as':_0x488b54['as'],'attributes':_0x488b54['attributes']};}):[]};}):[]};}):[]:[]})[_0xa6b3('0xb')](function(_0x1dda30){logger['info']('GetDeskAccount',_0x53d46c);logger[_0xa6b3('0xf')]('GetDeskAccount',_0x53d46c,JSON['stringify'](_0x1dda30));_0x247dee(_0x1dda30);})[_0xa6b3('0x1f')](function(_0x4e7853){logger[_0xa6b3('0x12')](_0xa6b3('0x15'),_0x4e7853[_0xa6b3('0x14')],_0x53d46c);_0x25e954(_0x46948f['error'](0x1f4,_0x4e7853[_0xa6b3('0x14')]));});});};exports[_0xa6b3('0x20')]=function(_0x11e1f0){var _0x67b7a0=this;return new Promise(function(_0x6e9078,_0x20dd80){return db['DeskAccount'][_0xa6b3('0x21')]({'raw':_0x11e1f0['options']?_0x11e1f0[_0xa6b3('0x18')][_0xa6b3('0x19')]===undefined?!![]:![]:!![],'where':_0x11e1f0[_0xa6b3('0x18')]?_0x11e1f0['options'][_0xa6b3('0x22')]||null:null,'attributes':_0x11e1f0[_0xa6b3('0x18')]?_0x11e1f0[_0xa6b3('0x18')][_0xa6b3('0x1a')]||null:null,'include':_0x11e1f0['options']?_0x11e1f0[_0xa6b3('0x18')][_0xa6b3('0x1c')]?_[_0xa6b3('0x1d')](_0x11e1f0[_0xa6b3('0x18')]['include'],function(_0xb767f6){return{'model':db[_0xb767f6[_0xa6b3('0x1e')]],'as':_0xb767f6['as'],'attributes':_0xb767f6[_0xa6b3('0x1a')],'include':_0xb767f6['include']?_[_0xa6b3('0x1d')](_0xb767f6['include'],function(_0x8efd3){return{'model':db[_0x8efd3['model']],'as':_0x8efd3['as'],'attributes':_0x8efd3['attributes'],'include':_0x8efd3[_0xa6b3('0x1c')]?_[_0xa6b3('0x1d')](_0x8efd3['include'],function(_0x345fcc){return{'model':db[_0x345fcc[_0xa6b3('0x1e')]],'as':_0x345fcc['as'],'attributes':_0x345fcc[_0xa6b3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x384e2b){logger[_0xa6b3('0xc')](_0xa6b3('0x20'),_0x11e1f0);logger[_0xa6b3('0xf')](_0xa6b3('0x20'),_0x11e1f0,JSON['stringify'](_0x384e2b));_0x6e9078(_0x384e2b);})[_0xa6b3('0x1f')](function(_0x405c01){logger[_0xa6b3('0x12')](_0xa6b3('0x20'),_0x405c01[_0xa6b3('0x14')],_0x11e1f0);_0x20dd80(_0x67b7a0['error'](0x1f4,_0x405c01[_0xa6b3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5b4c037..ebea601 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3b3032,_0x1a5203){var _0x3641bc=function(_0x1ed1ba){while(--_0x1ed1ba){_0x3b3032['push'](_0x3b3032['shift']());}};_0x3641bc(++_0x1a5203);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3af937,_0x2183a0){var _0x2c372e=function(_0x1e1267){while(--_0x1e1267){_0x3af937['push'](_0x3af937['shift']());}};_0x2c372e(++_0x2183a0);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 60e538e..05834ab 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a9=['sequelize','STRING'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x45a9,0x17e));var _0x945a=function(_0x12ce64,_0x2dd624){_0x12ce64=_0x12ce64-0x0;var _0x4f659f=_0x45a9[_0x12ce64];return _0x4f659f;};'use strict';var Sequelize=require(_0x945a('0x0'));module['exports']={'name':{'type':Sequelize[_0x945a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb259=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb259,0xd5));var _0x9b25=function(_0x5406ab,_0x10ddda){_0x5406ab=_0x5406ab-0x0;var _0x47e633=_0xb259[_0x5406ab];return _0x47e633;};'use strict';var Sequelize=require('sequelize');module[_0x9b25('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9b25('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index da3b938..879d7c2 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f5b=['body','params','getFields','order','hasOwnProperty','nolimit','getSubjects','findOne','DeskField','getDescriptions','getTags','setTags','ids','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','find'];(function(_0xcb06d5,_0x206c99){var _0x4cf088=function(_0x10122c){while(--_0x10122c){_0xcb06d5['push'](_0xcb06d5['shift']());}};_0x4cf088(++_0x206c99);}(_0x1f5b,0x139));var _0xb1f5=function(_0x29178b,_0xc6d0bd){_0x29178b=_0x29178b-0x0;var _0x13cc0b=_0x1f5b[_0x29178b];return _0x13cc0b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1f5('0x0'));var rp=require(_0xb1f5('0x1'));var moment=require(_0xb1f5('0x2'));var BPromise=require(_0xb1f5('0x3'));var Mustache=require('mustache');var util=require(_0xb1f5('0x4'));var path=require(_0xb1f5('0x5'));var sox=require(_0xb1f5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1f5('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb1f5('0x8'));var Papa=require('papaparse');var Redis=require(_0xb1f5('0x9'));var authService=require(_0xb1f5('0xa'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1f5('0xb'));var logger=require(_0xb1f5('0xc'))(_0xb1f5('0xd'));var utils=require(_0xb1f5('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0xb1f5('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b3543,_0x1ae1b1){_0x1ae1b1=_0x1ae1b1||0xcc;return function(_0x7b0e26){if(_0x7b0e26){return _0x4b3543[_0xb1f5('0x10')](_0x1ae1b1);}return _0x4b3543[_0xb1f5('0x11')](_0x1ae1b1)[_0xb1f5('0x12')]();};}function respondWithResult(_0x3ad861,_0x5e9b9f){_0x5e9b9f=_0x5e9b9f||0xc8;return function(_0x4ce3ab){if(_0x4ce3ab){return _0x3ad861[_0xb1f5('0x11')](_0x5e9b9f)['json'](_0x4ce3ab);}};}function respondWithFilteredResult(_0x3b68d3,_0x3196eb){return function(_0x1cd6fc){if(_0x1cd6fc){var _0x2080e1=typeof _0x3196eb[_0xb1f5('0x13')]==='undefined'&&typeof _0x3196eb[_0xb1f5('0x14')]===_0xb1f5('0x15');var _0x1a4793=_0x1cd6fc['count'];var _0x167ddc=_0x2080e1?0x0:_0x3196eb[_0xb1f5('0x13')];var _0x21d8b7=_0x2080e1?_0x1cd6fc['count']:_0x3196eb[_0xb1f5('0x13')]+_0x3196eb[_0xb1f5('0x14')];var _0x5a4df7;if(_0x21d8b7>=_0x1a4793){_0x21d8b7=_0x1a4793;_0x5a4df7=0xc8;}else{_0x5a4df7=0xce;}_0x3b68d3['status'](_0x5a4df7);return _0x3b68d3[_0xb1f5('0x16')](_0xb1f5('0x17'),_0x167ddc+'-'+_0x21d8b7+'/'+_0x1a4793)[_0xb1f5('0x18')](_0x1cd6fc);}return null;};}function patchUpdates(_0xd0bdb4){return function(_0x38b153){try{jsonpatch[_0xb1f5('0x19')](_0x38b153,_0xd0bdb4,!![]);}catch(_0x12b277){return BPromise['reject'](_0x12b277);}return _0x38b153[_0xb1f5('0x1a')]();};}function saveUpdates(_0x259dd7,_0x576eb9){return function(_0x46817d){if(_0x46817d){return _0x46817d['update'](_0x259dd7)['then'](function(_0x48ce82){return _0x48ce82;});}return null;};}function removeEntity(_0xdc6321,_0x594020){return function(_0x329143){if(_0x329143){return _0x329143[_0xb1f5('0x1b')]()[_0xb1f5('0x1c')](function(){_0xdc6321[_0xb1f5('0x11')](0xcc)[_0xb1f5('0x12')]();});}};}function handleEntityNotFound(_0x3dfd7a,_0x1a6c68){return function(_0x248881){if(!_0x248881){_0x3dfd7a[_0xb1f5('0x10')](0x194);}return _0x248881;};}function handleError(_0x44e6a0,_0xca8548){_0xca8548=_0xca8548||0x1f4;return function(_0x37e955){logger[_0xb1f5('0x1d')](_0x37e955[_0xb1f5('0x1e')]);if(_0x37e955['name']){delete _0x37e955[_0xb1f5('0x1f')];}_0x44e6a0[_0xb1f5('0x11')](_0xca8548)[_0xb1f5('0x20')](_0x37e955);};}exports[_0xb1f5('0x21')]=function(_0x21e4eb,_0x56ce51){var _0xf948db={},_0x3db5a1={},_0x2f950d={'count':0x0,'rows':[]};var _0x378e2f=_[_0xb1f5('0x22')](db[_0xb1f5('0x23')][_0xb1f5('0x24')],function(_0x4adfd0){return{'name':_0x4adfd0[_0xb1f5('0x25')],'type':_0x4adfd0[_0xb1f5('0x26')][_0xb1f5('0x27')]};});_0x3db5a1[_0xb1f5('0x28')]=_[_0xb1f5('0x22')](_0x378e2f,'name');_0x3db5a1[_0xb1f5('0x29')]=_['keys'](_0x21e4eb[_0xb1f5('0x29')]);_0x3db5a1[_0xb1f5('0x2a')]=_[_0xb1f5('0x2b')](_0x3db5a1[_0xb1f5('0x28')],_0x3db5a1[_0xb1f5('0x29')]);_0xf948db[_0xb1f5('0x2c')]=_[_0xb1f5('0x2b')](_0x3db5a1[_0xb1f5('0x28')],qs[_0xb1f5('0x2d')](_0x21e4eb['query'][_0xb1f5('0x2d')]));_0xf948db[_0xb1f5('0x2c')]=_0xf948db[_0xb1f5('0x2c')][_0xb1f5('0x2e')]?_0xf948db[_0xb1f5('0x2c')]:_0x3db5a1[_0xb1f5('0x28')];if(!_0x21e4eb['query']['hasOwnProperty']('nolimit')){_0xf948db[_0xb1f5('0x14')]=qs[_0xb1f5('0x14')](_0x21e4eb[_0xb1f5('0x29')][_0xb1f5('0x14')]);_0xf948db[_0xb1f5('0x13')]=qs[_0xb1f5('0x13')](_0x21e4eb['query'][_0xb1f5('0x13')]);}_0xf948db['order']=qs[_0xb1f5('0x2f')](_0x21e4eb[_0xb1f5('0x29')][_0xb1f5('0x2f')]);_0xf948db['where']=qs[_0xb1f5('0x2a')](_[_0xb1f5('0x30')](_0x21e4eb[_0xb1f5('0x29')],_0x3db5a1[_0xb1f5('0x2a')]),_0x378e2f);if(_0x21e4eb[_0xb1f5('0x29')][_0xb1f5('0x31')]){_0xf948db[_0xb1f5('0x32')]=_[_0xb1f5('0x33')](_0xf948db['where'],{'$or':_[_0xb1f5('0x22')](_0x378e2f,function(_0x283e14){if(_0x283e14[_0xb1f5('0x26')]!==_0xb1f5('0x34')){var _0x56aebf={};_0x56aebf[_0x283e14[_0xb1f5('0x1f')]]={'$like':'%'+_0x21e4eb[_0xb1f5('0x29')][_0xb1f5('0x31')]+'%'};return _0x56aebf;}})});}_0xf948db=_[_0xb1f5('0x33')]({},_0xf948db,_0x21e4eb[_0xb1f5('0x35')]);var _0x1f6f6c={'where':_0xf948db[_0xb1f5('0x32')]};return db[_0xb1f5('0x23')][_0xb1f5('0x36')](_0x1f6f6c)[_0xb1f5('0x1c')](function(_0x567599){_0x2f950d['count']=_0x567599;if(_0x21e4eb[_0xb1f5('0x29')][_0xb1f5('0x37')]){_0xf948db[_0xb1f5('0x38')]=[{'all':!![]}];}return db[_0xb1f5('0x23')]['findAll'](_0xf948db);})[_0xb1f5('0x1c')](function(_0x518cf2){_0x2f950d[_0xb1f5('0x39')]=_0x518cf2;return _0x2f950d;})[_0xb1f5('0x1c')](respondWithFilteredResult(_0x56ce51,_0xf948db))[_0xb1f5('0x3a')](handleError(_0x56ce51,null));};exports[_0xb1f5('0x3b')]=function(_0x2b30cb,_0xdefabb){var _0x4ca7a5={'raw':![],'where':{'id':_0x2b30cb['params']['id']}},_0x4b5aa1={};_0x4b5aa1[_0xb1f5('0x28')]=_[_0xb1f5('0x3c')](db[_0xb1f5('0x23')][_0xb1f5('0x24')]);_0x4b5aa1[_0xb1f5('0x29')]=_[_0xb1f5('0x3c')](_0x2b30cb['query']);_0x4b5aa1[_0xb1f5('0x2a')]=_[_0xb1f5('0x2b')](_0x4b5aa1[_0xb1f5('0x28')],_0x4b5aa1[_0xb1f5('0x29')]);_0x4ca7a5[_0xb1f5('0x2c')]=_['intersection'](_0x4b5aa1['model'],qs[_0xb1f5('0x2d')](_0x2b30cb[_0xb1f5('0x29')][_0xb1f5('0x2d')]));_0x4ca7a5[_0xb1f5('0x2c')]=_0x4ca7a5[_0xb1f5('0x2c')]['length']?_0x4ca7a5['attributes']:_0x4b5aa1[_0xb1f5('0x28')];if(_0x2b30cb['query'][_0xb1f5('0x37')]){_0x4ca7a5[_0xb1f5('0x38')]=[{'all':!![]}];}_0x4ca7a5=_[_0xb1f5('0x33')]({},_0x4ca7a5,_0x2b30cb[_0xb1f5('0x35')]);return db[_0xb1f5('0x23')][_0xb1f5('0x3d')](_0x4ca7a5)[_0xb1f5('0x1c')](handleEntityNotFound(_0xdefabb,null))[_0xb1f5('0x1c')](respondWithResult(_0xdefabb,null))['catch'](handleError(_0xdefabb,null));};exports['create']=function(_0x4c9403,_0x24136e){return db[_0xb1f5('0x23')]['create'](_0x4c9403[_0xb1f5('0x3e')],{})[_0xb1f5('0x1c')](respondWithResult(_0x24136e,0xc9))[_0xb1f5('0x3a')](handleError(_0x24136e,null));};exports['update']=function(_0x573c6a,_0x4f3a79){if(_0x573c6a['body']['id']){delete _0x573c6a[_0xb1f5('0x3e')]['id'];}return db[_0xb1f5('0x23')][_0xb1f5('0x3d')]({'where':{'id':_0x573c6a[_0xb1f5('0x3f')]['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x4f3a79,null))[_0xb1f5('0x1c')](saveUpdates(_0x573c6a[_0xb1f5('0x3e')],null))[_0xb1f5('0x1c')](respondWithResult(_0x4f3a79,null))[_0xb1f5('0x3a')](handleError(_0x4f3a79,null));};exports[_0xb1f5('0x1b')]=function(_0x96e75,_0x2362f1){return db[_0xb1f5('0x23')]['find']({'where':{'id':_0x96e75[_0xb1f5('0x3f')]['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x2362f1,null))['then'](removeEntity(_0x2362f1,null))[_0xb1f5('0x3a')](handleError(_0x2362f1,null));};exports[_0xb1f5('0x40')]=function(_0x2a4250,_0x37ce37,_0x2bd681){var _0x39d602={};var _0x5fabe6={};var _0x949a79;var _0x17373c;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2a4250[_0xb1f5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x37ce37,null))['then'](function(_0x2964db){if(_0x2964db){_0x949a79=_0x2964db;_0x5fabe6['model']=_[_0xb1f5('0x3c')](db['DeskField']['rawAttributes']);_0x5fabe6[_0xb1f5('0x29')]=_['keys'](_0x2a4250[_0xb1f5('0x29')]);_0x5fabe6['filters']=_[_0xb1f5('0x2b')](_0x5fabe6[_0xb1f5('0x28')],_0x5fabe6['query']);_0x39d602[_0xb1f5('0x2c')]=_[_0xb1f5('0x2b')](_0x5fabe6['model'],qs[_0xb1f5('0x2d')](_0x2a4250[_0xb1f5('0x29')][_0xb1f5('0x2d')]));_0x39d602['attributes']=_0x39d602[_0xb1f5('0x2c')]['length']?_0x39d602[_0xb1f5('0x2c')]:_0x5fabe6[_0xb1f5('0x28')];_0x39d602[_0xb1f5('0x41')]=qs[_0xb1f5('0x2f')](_0x2a4250[_0xb1f5('0x29')][_0xb1f5('0x2f')]);_0x39d602[_0xb1f5('0x32')]=qs[_0xb1f5('0x2a')](_[_0xb1f5('0x30')](_0x2a4250['query'],_0x5fabe6[_0xb1f5('0x2a')]));if(_0x2a4250[_0xb1f5('0x29')][_0xb1f5('0x31')]){_0x39d602[_0xb1f5('0x32')]=_['merge'](_0x39d602['where'],{'$or':_[_0xb1f5('0x22')](_0x39d602[_0xb1f5('0x2c')],function(_0xb0f9b6){var _0x3fccd4={};_0x3fccd4[_0xb0f9b6]={'$like':'%'+_0x2a4250[_0xb1f5('0x29')][_0xb1f5('0x31')]+'%'};return _0x3fccd4;})});}_0x39d602=_[_0xb1f5('0x33')]({},_0x39d602,_0x2a4250['options']);return _0x949a79['getFields'](_0x39d602);}})[_0xb1f5('0x1c')](function(_0x589084){if(_0x589084){_0x17373c=_0x589084[_0xb1f5('0x2e')];if(!_0x2a4250['query'][_0xb1f5('0x42')](_0xb1f5('0x43'))){_0x39d602['limit']=qs[_0xb1f5('0x14')](_0x2a4250[_0xb1f5('0x29')]['limit']);_0x39d602['offset']=qs['offset'](_0x2a4250['query'][_0xb1f5('0x13')]);}return _0x949a79[_0xb1f5('0x40')](_0x39d602);}})['then'](function(_0x1cee2d){if(_0x1cee2d){return _0x1cee2d?{'count':_0x17373c,'rows':_0x1cee2d}:null;}})[_0xb1f5('0x1c')](respondWithResult(_0x37ce37,null))[_0xb1f5('0x3a')](handleError(_0x37ce37,null));};exports[_0xb1f5('0x44')]=function(_0x294307,_0x3a4f20,_0x1aba7e){var _0x59abec={};var _0x4b9438={};var _0x579e89;var _0x4efa78;return db['DeskConfiguration'][_0xb1f5('0x45')]({'where':{'id':_0x294307[_0xb1f5('0x3f')]['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x3a4f20,null))['then'](function(_0x5f0b47){if(_0x5f0b47){_0x579e89=_0x5f0b47;_0x4b9438[_0xb1f5('0x28')]=_[_0xb1f5('0x3c')](db[_0xb1f5('0x46')][_0xb1f5('0x24')]);_0x4b9438[_0xb1f5('0x29')]=_['keys'](_0x294307[_0xb1f5('0x29')]);_0x4b9438[_0xb1f5('0x2a')]=_[_0xb1f5('0x2b')](_0x4b9438[_0xb1f5('0x28')],_0x4b9438[_0xb1f5('0x29')]);_0x59abec[_0xb1f5('0x2c')]=_[_0xb1f5('0x2b')](_0x4b9438[_0xb1f5('0x28')],qs['fields'](_0x294307[_0xb1f5('0x29')][_0xb1f5('0x2d')]));_0x59abec[_0xb1f5('0x2c')]=_0x59abec[_0xb1f5('0x2c')]['length']?_0x59abec[_0xb1f5('0x2c')]:_0x4b9438['model'];_0x59abec[_0xb1f5('0x41')]=qs['sort'](_0x294307[_0xb1f5('0x29')][_0xb1f5('0x2f')]);_0x59abec['where']=qs['filters'](_[_0xb1f5('0x30')](_0x294307[_0xb1f5('0x29')],_0x4b9438['filters']));if(_0x294307['query'][_0xb1f5('0x31')]){_0x59abec[_0xb1f5('0x32')]=_[_0xb1f5('0x33')](_0x59abec['where'],{'$or':_[_0xb1f5('0x22')](_0x59abec[_0xb1f5('0x2c')],function(_0x3d6bd4){var _0x64fb1d={};_0x64fb1d[_0x3d6bd4]={'$like':'%'+_0x294307[_0xb1f5('0x29')][_0xb1f5('0x31')]+'%'};return _0x64fb1d;})});}_0x59abec=_[_0xb1f5('0x33')]({},_0x59abec,_0x294307[_0xb1f5('0x35')]);return _0x579e89[_0xb1f5('0x44')](_0x59abec);}})[_0xb1f5('0x1c')](function(_0x33696c){if(_0x33696c){_0x4efa78=_0x33696c['length'];if(!_0x294307[_0xb1f5('0x29')]['hasOwnProperty'](_0xb1f5('0x43'))){_0x59abec['limit']=qs[_0xb1f5('0x14')](_0x294307[_0xb1f5('0x29')]['limit']);_0x59abec[_0xb1f5('0x13')]=qs['offset'](_0x294307[_0xb1f5('0x29')]['offset']);}return _0x579e89[_0xb1f5('0x44')](_0x59abec);}})[_0xb1f5('0x1c')](function(_0x1785ae){if(_0x1785ae){return _0x1785ae?{'count':_0x4efa78,'rows':_0x1785ae}:null;}})['then'](respondWithResult(_0x3a4f20,null))[_0xb1f5('0x3a')](handleError(_0x3a4f20,null));};exports[_0xb1f5('0x47')]=function(_0x56b3ab,_0x16ec2f,_0xb3894b){var _0x3e909c={};var _0x4e59df={};var _0x148025;var _0x413183;return db[_0xb1f5('0x23')]['findOne']({'where':{'id':_0x56b3ab[_0xb1f5('0x3f')]['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x16ec2f,null))['then'](function(_0x2e8b77){if(_0x2e8b77){_0x148025=_0x2e8b77;_0x4e59df[_0xb1f5('0x28')]=_[_0xb1f5('0x3c')](db[_0xb1f5('0x46')][_0xb1f5('0x24')]);_0x4e59df[_0xb1f5('0x29')]=_['keys'](_0x56b3ab['query']);_0x4e59df[_0xb1f5('0x2a')]=_[_0xb1f5('0x2b')](_0x4e59df[_0xb1f5('0x28')],_0x4e59df['query']);_0x3e909c['attributes']=_[_0xb1f5('0x2b')](_0x4e59df['model'],qs[_0xb1f5('0x2d')](_0x56b3ab[_0xb1f5('0x29')][_0xb1f5('0x2d')]));_0x3e909c[_0xb1f5('0x2c')]=_0x3e909c[_0xb1f5('0x2c')][_0xb1f5('0x2e')]?_0x3e909c['attributes']:_0x4e59df[_0xb1f5('0x28')];_0x3e909c[_0xb1f5('0x41')]=qs[_0xb1f5('0x2f')](_0x56b3ab['query'][_0xb1f5('0x2f')]);_0x3e909c[_0xb1f5('0x32')]=qs[_0xb1f5('0x2a')](_[_0xb1f5('0x30')](_0x56b3ab[_0xb1f5('0x29')],_0x4e59df[_0xb1f5('0x2a')]));if(_0x56b3ab[_0xb1f5('0x29')][_0xb1f5('0x31')]){_0x3e909c[_0xb1f5('0x32')]=_[_0xb1f5('0x33')](_0x3e909c[_0xb1f5('0x32')],{'$or':_['map'](_0x3e909c[_0xb1f5('0x2c')],function(_0x3e245a){var _0x33fc02={};_0x33fc02[_0x3e245a]={'$like':'%'+_0x56b3ab['query']['filter']+'%'};return _0x33fc02;})});}_0x3e909c=_[_0xb1f5('0x33')]({},_0x3e909c,_0x56b3ab[_0xb1f5('0x35')]);return _0x148025[_0xb1f5('0x47')](_0x3e909c);}})[_0xb1f5('0x1c')](function(_0xa5a41f){if(_0xa5a41f){_0x413183=_0xa5a41f['length'];if(!_0x56b3ab[_0xb1f5('0x29')][_0xb1f5('0x42')](_0xb1f5('0x43'))){_0x3e909c[_0xb1f5('0x14')]=qs[_0xb1f5('0x14')](_0x56b3ab[_0xb1f5('0x29')][_0xb1f5('0x14')]);_0x3e909c['offset']=qs[_0xb1f5('0x13')](_0x56b3ab[_0xb1f5('0x29')]['offset']);}return _0x148025['getDescriptions'](_0x3e909c);}})[_0xb1f5('0x1c')](function(_0x3fef20){if(_0x3fef20){return _0x3fef20?{'count':_0x413183,'rows':_0x3fef20}:null;}})[_0xb1f5('0x1c')](respondWithResult(_0x16ec2f,null))[_0xb1f5('0x3a')](handleError(_0x16ec2f,null));};exports['getTags']=function(_0x4c5186,_0x4a323b,_0x23f532){var _0x1ef27e={};var _0x546abd={};var _0x5e1ae0;var _0x54a4f8;return db[_0xb1f5('0x23')][_0xb1f5('0x45')]({'where':{'id':_0x4c5186['params']['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x4a323b,null))[_0xb1f5('0x1c')](function(_0x692115){if(_0x692115){_0x5e1ae0=_0x692115;_0x546abd['model']=_[_0xb1f5('0x3c')](db['Tag']['rawAttributes']);_0x546abd['query']=_[_0xb1f5('0x3c')](_0x4c5186['query']);_0x546abd[_0xb1f5('0x2a')]=_[_0xb1f5('0x2b')](_0x546abd[_0xb1f5('0x28')],_0x546abd[_0xb1f5('0x29')]);_0x1ef27e['attributes']=_['intersection'](_0x546abd[_0xb1f5('0x28')],qs[_0xb1f5('0x2d')](_0x4c5186['query']['fields']));_0x1ef27e[_0xb1f5('0x2c')]=_0x1ef27e['attributes'][_0xb1f5('0x2e')]?_0x1ef27e[_0xb1f5('0x2c')]:_0x546abd[_0xb1f5('0x28')];_0x1ef27e[_0xb1f5('0x41')]=qs[_0xb1f5('0x2f')](_0x4c5186[_0xb1f5('0x29')][_0xb1f5('0x2f')]);_0x1ef27e[_0xb1f5('0x32')]=qs['filters'](_[_0xb1f5('0x30')](_0x4c5186[_0xb1f5('0x29')],_0x546abd[_0xb1f5('0x2a')]));if(_0x4c5186[_0xb1f5('0x29')]['filter']){_0x1ef27e[_0xb1f5('0x32')]=_['merge'](_0x1ef27e[_0xb1f5('0x32')],{'$or':_[_0xb1f5('0x22')](_0x1ef27e[_0xb1f5('0x2c')],function(_0x4450b9){var _0x4ffabe={};_0x4ffabe[_0x4450b9]={'$like':'%'+_0x4c5186['query'][_0xb1f5('0x31')]+'%'};return _0x4ffabe;})});}_0x1ef27e=_[_0xb1f5('0x33')]({},_0x1ef27e,_0x4c5186[_0xb1f5('0x35')]);return _0x5e1ae0[_0xb1f5('0x48')](_0x1ef27e);}})[_0xb1f5('0x1c')](function(_0x2ac094){if(_0x2ac094){_0x54a4f8=_0x2ac094[_0xb1f5('0x2e')];if(!_0x4c5186[_0xb1f5('0x29')][_0xb1f5('0x42')]('nolimit')){_0x1ef27e['limit']=qs['limit'](_0x4c5186[_0xb1f5('0x29')][_0xb1f5('0x14')]);_0x1ef27e['offset']=qs['offset'](_0x4c5186[_0xb1f5('0x29')][_0xb1f5('0x13')]);}return _0x5e1ae0[_0xb1f5('0x48')](_0x1ef27e);}})[_0xb1f5('0x1c')](function(_0x51499e){if(_0x51499e){return _0x51499e?{'count':_0x54a4f8,'rows':_0x51499e}:null;}})[_0xb1f5('0x1c')](respondWithResult(_0x4a323b,null))['catch'](handleError(_0x4a323b,null));};exports['setTags']=function(_0x371bfa,_0x57231a,_0x5b60c0){if(_0x371bfa[_0xb1f5('0x3e')]['id']){delete _0x371bfa[_0xb1f5('0x3e')]['id'];}return db['DeskConfiguration'][_0xb1f5('0x45')]({'where':{'id':_0x371bfa['params']['id']}})[_0xb1f5('0x1c')](handleEntityNotFound(_0x57231a,null))[_0xb1f5('0x1c')](function(_0x21117e){if(_0x21117e){return _0x21117e[_0xb1f5('0x49')](_0x371bfa['body'][_0xb1f5('0x4a')]||[]);}return null;})[_0xb1f5('0x1c')](respondWithResult(_0x57231a,null))[_0xb1f5('0x3a')](handleError(_0x57231a,null));}; \ No newline at end of file +var _0x93ba=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','VIRTUAL','where','include','rows','show','params','length','includeAll','options','catch','create','body','find','getFields','findOne','DeskField','merge','order','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','name','send','map','DeskConfiguration'];(function(_0x4a331b,_0x565a6b){var _0x156945=function(_0x2fb80f){while(--_0x2fb80f){_0x4a331b['push'](_0x4a331b['shift']());}};_0x156945(++_0x565a6b);}(_0x93ba,0x17e));var _0xa93b=function(_0x4f13f8,_0x5e13c5){_0x4f13f8=_0x4f13f8-0x0;var _0x1e6b83=_0x93ba[_0x4f13f8];return _0x1e6b83;};'use strict';var emlformat=require(_0xa93b('0x0'));var rimraf=require(_0xa93b('0x1'));var zipdir=require(_0xa93b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa93b('0x3'));var moment=require(_0xa93b('0x4'));var BPromise=require(_0xa93b('0x5'));var Mustache=require(_0xa93b('0x6'));var util=require(_0xa93b('0x7'));var path=require(_0xa93b('0x8'));var sox=require(_0xa93b('0x9'));var csv=require(_0xa93b('0xa'));var ejs=require(_0xa93b('0xb'));var fs=require('fs');var fs_extra=require(_0xa93b('0xc'));var _=require(_0xa93b('0xd'));var squel=require(_0xa93b('0xe'));var crypto=require(_0xa93b('0xf'));var jsforce=require(_0xa93b('0x10'));var deskjs=require(_0xa93b('0x11'));var toCsv=require('to-csv');var querystring=require(_0xa93b('0x12'));var Papa=require(_0xa93b('0x13'));var Redis=require(_0xa93b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xa93b('0x15'));var as=require(_0xa93b('0x16'));var hardwareService=require(_0xa93b('0x17'));var logger=require(_0xa93b('0x18'))(_0xa93b('0x19'));var utils=require(_0xa93b('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xa93b('0x1b'));var db=require(_0xa93b('0x1c'))['db'];function respondWithStatusCode(_0x2b5fa9,_0x6cbff3){_0x6cbff3=_0x6cbff3||0xcc;return function(_0x4da09c){if(_0x4da09c){return _0x2b5fa9[_0xa93b('0x1d')](_0x6cbff3);}return _0x2b5fa9[_0xa93b('0x1e')](_0x6cbff3)[_0xa93b('0x1f')]();};}function respondWithResult(_0x9a6b2a,_0x1af240){_0x1af240=_0x1af240||0xc8;return function(_0x3332b6){if(_0x3332b6){return _0x9a6b2a[_0xa93b('0x1e')](_0x1af240)[_0xa93b('0x20')](_0x3332b6);}};}function respondWithFilteredResult(_0x1f17e0,_0x5ede70){return function(_0x25bc34){if(_0x25bc34){var _0x5cacc9=typeof _0x5ede70[_0xa93b('0x21')]===_0xa93b('0x22')&&typeof _0x5ede70['limit']==='undefined';var _0x31fb5c=_0x25bc34[_0xa93b('0x23')];var _0x4093a9=_0x5cacc9?0x0:_0x5ede70[_0xa93b('0x21')];var _0x9eeef1=_0x5cacc9?_0x25bc34[_0xa93b('0x23')]:_0x5ede70[_0xa93b('0x21')]+_0x5ede70[_0xa93b('0x24')];var _0x21ba09;if(_0x9eeef1>=_0x31fb5c){_0x9eeef1=_0x31fb5c;_0x21ba09=0xc8;}else{_0x21ba09=0xce;}_0x1f17e0[_0xa93b('0x1e')](_0x21ba09);return _0x1f17e0['set'](_0xa93b('0x25'),_0x4093a9+'-'+_0x9eeef1+'/'+_0x31fb5c)[_0xa93b('0x20')](_0x25bc34);}return null;};}function patchUpdates(_0x32955a){return function(_0x5e464c){try{jsonpatch[_0xa93b('0x26')](_0x5e464c,_0x32955a,!![]);}catch(_0x17ee00){return BPromise['reject'](_0x17ee00);}return _0x5e464c[_0xa93b('0x27')]();};}function saveUpdates(_0x21c03c,_0x5d3f47){return function(_0x7c3f5){if(_0x7c3f5){return _0x7c3f5[_0xa93b('0x28')](_0x21c03c)[_0xa93b('0x29')](function(_0x4f9272){return _0x4f9272;});}return null;};}function removeEntity(_0x2ccab1,_0x16c061){return function(_0x4164b7){if(_0x4164b7){return _0x4164b7[_0xa93b('0x2a')]()[_0xa93b('0x29')](function(){_0x2ccab1[_0xa93b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x538a7e,_0x25a836){return function(_0x412673){if(!_0x412673){_0x538a7e[_0xa93b('0x1d')](0x194);}return _0x412673;};}function handleError(_0x27f0f8,_0x308666){_0x308666=_0x308666||0x1f4;return function(_0x352327){logger[_0xa93b('0x2b')](_0x352327['stack']);if(_0x352327[_0xa93b('0x2c')]){delete _0x352327[_0xa93b('0x2c')];}_0x27f0f8[_0xa93b('0x1e')](_0x308666)[_0xa93b('0x2d')](_0x352327);};}exports['index']=function(_0x255782,_0x484fbd){var _0x5ebff8={},_0xc06df8={},_0x50c056={'count':0x0,'rows':[]};var _0xc58b8c=_[_0xa93b('0x2e')](db[_0xa93b('0x2f')][_0xa93b('0x30')],function(_0x27d273){return{'name':_0x27d273[_0xa93b('0x31')],'type':_0x27d273[_0xa93b('0x32')][_0xa93b('0x33')]};});_0xc06df8[_0xa93b('0x34')]=_[_0xa93b('0x2e')](_0xc58b8c,_0xa93b('0x2c'));_0xc06df8[_0xa93b('0x35')]=_[_0xa93b('0x36')](_0x255782[_0xa93b('0x35')]);_0xc06df8['filters']=_[_0xa93b('0x37')](_0xc06df8[_0xa93b('0x34')],_0xc06df8[_0xa93b('0x35')]);_0x5ebff8[_0xa93b('0x38')]=_[_0xa93b('0x37')](_0xc06df8[_0xa93b('0x34')],qs[_0xa93b('0x39')](_0x255782[_0xa93b('0x35')][_0xa93b('0x39')]));_0x5ebff8[_0xa93b('0x38')]=_0x5ebff8[_0xa93b('0x38')]['length']?_0x5ebff8['attributes']:_0xc06df8[_0xa93b('0x34')];if(!_0x255782['query'][_0xa93b('0x3a')](_0xa93b('0x3b'))){_0x5ebff8[_0xa93b('0x24')]=qs['limit'](_0x255782[_0xa93b('0x35')][_0xa93b('0x24')]);_0x5ebff8[_0xa93b('0x21')]=qs[_0xa93b('0x21')](_0x255782[_0xa93b('0x35')]['offset']);}_0x5ebff8['order']=qs[_0xa93b('0x3c')](_0x255782[_0xa93b('0x35')][_0xa93b('0x3c')]);_0x5ebff8['where']=qs[_0xa93b('0x3d')](_[_0xa93b('0x3e')](_0x255782[_0xa93b('0x35')],_0xc06df8[_0xa93b('0x3d')]),_0xc58b8c);if(_0x255782[_0xa93b('0x35')][_0xa93b('0x3f')]){_0x5ebff8['where']=_['merge'](_0x5ebff8['where'],{'$or':_[_0xa93b('0x2e')](_0xc58b8c,function(_0xdc40d2){if(_0xdc40d2[_0xa93b('0x32')]!==_0xa93b('0x40')){var _0x177e8f={};_0x177e8f[_0xdc40d2['name']]={'$like':'%'+_0x255782['query'][_0xa93b('0x3f')]+'%'};return _0x177e8f;}})});}_0x5ebff8=_['merge']({},_0x5ebff8,_0x255782['options']);var _0x592161={'where':_0x5ebff8[_0xa93b('0x41')]};return db[_0xa93b('0x2f')]['count'](_0x592161)[_0xa93b('0x29')](function(_0x1ce567){_0x50c056[_0xa93b('0x23')]=_0x1ce567;if(_0x255782['query']['includeAll']){_0x5ebff8[_0xa93b('0x42')]=[{'all':!![]}];}return db[_0xa93b('0x2f')]['findAll'](_0x5ebff8);})['then'](function(_0x2da253){_0x50c056[_0xa93b('0x43')]=_0x2da253;return _0x50c056;})['then'](respondWithFilteredResult(_0x484fbd,_0x5ebff8))['catch'](handleError(_0x484fbd,null));};exports[_0xa93b('0x44')]=function(_0x474e86,_0x4e5ddc){var _0x3ecda7={'raw':![],'where':{'id':_0x474e86[_0xa93b('0x45')]['id']}},_0x4d2d02={};_0x4d2d02[_0xa93b('0x34')]=_['keys'](db[_0xa93b('0x2f')][_0xa93b('0x30')]);_0x4d2d02[_0xa93b('0x35')]=_[_0xa93b('0x36')](_0x474e86[_0xa93b('0x35')]);_0x4d2d02['filters']=_[_0xa93b('0x37')](_0x4d2d02[_0xa93b('0x34')],_0x4d2d02[_0xa93b('0x35')]);_0x3ecda7[_0xa93b('0x38')]=_[_0xa93b('0x37')](_0x4d2d02[_0xa93b('0x34')],qs['fields'](_0x474e86[_0xa93b('0x35')][_0xa93b('0x39')]));_0x3ecda7[_0xa93b('0x38')]=_0x3ecda7[_0xa93b('0x38')][_0xa93b('0x46')]?_0x3ecda7[_0xa93b('0x38')]:_0x4d2d02[_0xa93b('0x34')];if(_0x474e86['query'][_0xa93b('0x47')]){_0x3ecda7[_0xa93b('0x42')]=[{'all':!![]}];}_0x3ecda7=_['merge']({},_0x3ecda7,_0x474e86[_0xa93b('0x48')]);return db[_0xa93b('0x2f')]['find'](_0x3ecda7)[_0xa93b('0x29')](handleEntityNotFound(_0x4e5ddc,null))[_0xa93b('0x29')](respondWithResult(_0x4e5ddc,null))[_0xa93b('0x49')](handleError(_0x4e5ddc,null));};exports['create']=function(_0x329586,_0x21903a){return db[_0xa93b('0x2f')][_0xa93b('0x4a')](_0x329586[_0xa93b('0x4b')],{})[_0xa93b('0x29')](respondWithResult(_0x21903a,0xc9))[_0xa93b('0x49')](handleError(_0x21903a,null));};exports['update']=function(_0x533f9a,_0x38f4eb){if(_0x533f9a[_0xa93b('0x4b')]['id']){delete _0x533f9a[_0xa93b('0x4b')]['id'];}return db[_0xa93b('0x2f')][_0xa93b('0x4c')]({'where':{'id':_0x533f9a[_0xa93b('0x45')]['id']}})[_0xa93b('0x29')](handleEntityNotFound(_0x38f4eb,null))['then'](saveUpdates(_0x533f9a[_0xa93b('0x4b')],null))['then'](respondWithResult(_0x38f4eb,null))[_0xa93b('0x49')](handleError(_0x38f4eb,null));};exports[_0xa93b('0x2a')]=function(_0x3752b4,_0x1437b0){return db[_0xa93b('0x2f')]['find']({'where':{'id':_0x3752b4[_0xa93b('0x45')]['id']}})[_0xa93b('0x29')](handleEntityNotFound(_0x1437b0,null))['then'](removeEntity(_0x1437b0,null))[_0xa93b('0x49')](handleError(_0x1437b0,null));};exports[_0xa93b('0x4d')]=function(_0x253704,_0x4e2f29,_0x34b190){var _0x19033f={};var _0xb500f0={};var _0x39eaab;var _0x4079c2;return db[_0xa93b('0x2f')][_0xa93b('0x4e')]({'where':{'id':_0x253704['params']['id']}})['then'](handleEntityNotFound(_0x4e2f29,null))[_0xa93b('0x29')](function(_0x2320c3){if(_0x2320c3){_0x39eaab=_0x2320c3;_0xb500f0[_0xa93b('0x34')]=_[_0xa93b('0x36')](db[_0xa93b('0x4f')]['rawAttributes']);_0xb500f0[_0xa93b('0x35')]=_[_0xa93b('0x36')](_0x253704[_0xa93b('0x35')]);_0xb500f0[_0xa93b('0x3d')]=_['intersection'](_0xb500f0[_0xa93b('0x34')],_0xb500f0[_0xa93b('0x35')]);_0x19033f[_0xa93b('0x38')]=_['intersection'](_0xb500f0[_0xa93b('0x34')],qs[_0xa93b('0x39')](_0x253704[_0xa93b('0x35')]['fields']));_0x19033f[_0xa93b('0x38')]=_0x19033f[_0xa93b('0x38')][_0xa93b('0x46')]?_0x19033f[_0xa93b('0x38')]:_0xb500f0['model'];_0x19033f['order']=qs['sort'](_0x253704[_0xa93b('0x35')][_0xa93b('0x3c')]);_0x19033f[_0xa93b('0x41')]=qs['filters'](_['pick'](_0x253704['query'],_0xb500f0['filters']));if(_0x253704[_0xa93b('0x35')][_0xa93b('0x3f')]){_0x19033f[_0xa93b('0x41')]=_['merge'](_0x19033f[_0xa93b('0x41')],{'$or':_['map'](_0x19033f['attributes'],function(_0x426b52){var _0x4a87bf={};_0x4a87bf[_0x426b52]={'$like':'%'+_0x253704['query']['filter']+'%'};return _0x4a87bf;})});}_0x19033f=_[_0xa93b('0x50')]({},_0x19033f,_0x253704[_0xa93b('0x48')]);return _0x39eaab['getFields'](_0x19033f);}})[_0xa93b('0x29')](function(_0x24a0f2){if(_0x24a0f2){_0x4079c2=_0x24a0f2[_0xa93b('0x46')];if(!_0x253704[_0xa93b('0x35')][_0xa93b('0x3a')](_0xa93b('0x3b'))){_0x19033f[_0xa93b('0x24')]=qs[_0xa93b('0x24')](_0x253704['query'][_0xa93b('0x24')]);_0x19033f['offset']=qs[_0xa93b('0x21')](_0x253704[_0xa93b('0x35')]['offset']);}return _0x39eaab[_0xa93b('0x4d')](_0x19033f);}})[_0xa93b('0x29')](function(_0x1ebd01){if(_0x1ebd01){return _0x1ebd01?{'count':_0x4079c2,'rows':_0x1ebd01}:null;}})['then'](respondWithResult(_0x4e2f29,null))[_0xa93b('0x49')](handleError(_0x4e2f29,null));};exports['getSubjects']=function(_0x337948,_0x21554e,_0x4fe57c){var _0x59d9ec={};var _0xd399f6={};var _0x16c7e2;var _0x52630d;return db[_0xa93b('0x2f')]['findOne']({'where':{'id':_0x337948[_0xa93b('0x45')]['id']}})[_0xa93b('0x29')](handleEntityNotFound(_0x21554e,null))['then'](function(_0x580145){if(_0x580145){_0x16c7e2=_0x580145;_0xd399f6[_0xa93b('0x34')]=_[_0xa93b('0x36')](db['DeskField']['rawAttributes']);_0xd399f6[_0xa93b('0x35')]=_[_0xa93b('0x36')](_0x337948['query']);_0xd399f6[_0xa93b('0x3d')]=_[_0xa93b('0x37')](_0xd399f6[_0xa93b('0x34')],_0xd399f6[_0xa93b('0x35')]);_0x59d9ec['attributes']=_[_0xa93b('0x37')](_0xd399f6[_0xa93b('0x34')],qs['fields'](_0x337948[_0xa93b('0x35')]['fields']));_0x59d9ec['attributes']=_0x59d9ec['attributes'][_0xa93b('0x46')]?_0x59d9ec[_0xa93b('0x38')]:_0xd399f6[_0xa93b('0x34')];_0x59d9ec[_0xa93b('0x51')]=qs[_0xa93b('0x3c')](_0x337948[_0xa93b('0x35')][_0xa93b('0x3c')]);_0x59d9ec[_0xa93b('0x41')]=qs[_0xa93b('0x3d')](_[_0xa93b('0x3e')](_0x337948[_0xa93b('0x35')],_0xd399f6[_0xa93b('0x3d')]));if(_0x337948[_0xa93b('0x35')][_0xa93b('0x3f')]){_0x59d9ec[_0xa93b('0x41')]=_[_0xa93b('0x50')](_0x59d9ec['where'],{'$or':_[_0xa93b('0x2e')](_0x59d9ec[_0xa93b('0x38')],function(_0x4ac981){var _0x352e8f={};_0x352e8f[_0x4ac981]={'$like':'%'+_0x337948[_0xa93b('0x35')]['filter']+'%'};return _0x352e8f;})});}_0x59d9ec=_[_0xa93b('0x50')]({},_0x59d9ec,_0x337948['options']);return _0x16c7e2[_0xa93b('0x52')](_0x59d9ec);}})[_0xa93b('0x29')](function(_0x9e0714){if(_0x9e0714){_0x52630d=_0x9e0714[_0xa93b('0x46')];if(!_0x337948[_0xa93b('0x35')]['hasOwnProperty']('nolimit')){_0x59d9ec[_0xa93b('0x24')]=qs['limit'](_0x337948[_0xa93b('0x35')][_0xa93b('0x24')]);_0x59d9ec[_0xa93b('0x21')]=qs[_0xa93b('0x21')](_0x337948['query'][_0xa93b('0x21')]);}return _0x16c7e2['getSubjects'](_0x59d9ec);}})[_0xa93b('0x29')](function(_0x1c1b26){if(_0x1c1b26){return _0x1c1b26?{'count':_0x52630d,'rows':_0x1c1b26}:null;}})[_0xa93b('0x29')](respondWithResult(_0x21554e,null))['catch'](handleError(_0x21554e,null));};exports[_0xa93b('0x53')]=function(_0x26a895,_0x1da50b,_0x4641fe){var _0x1bbabf={};var _0xf8fb6d={};var _0x6c2654;var _0x4d54db;return db[_0xa93b('0x2f')][_0xa93b('0x4e')]({'where':{'id':_0x26a895[_0xa93b('0x45')]['id']}})[_0xa93b('0x29')](handleEntityNotFound(_0x1da50b,null))['then'](function(_0x4f03aa){if(_0x4f03aa){_0x6c2654=_0x4f03aa;_0xf8fb6d['model']=_[_0xa93b('0x36')](db[_0xa93b('0x4f')]['rawAttributes']);_0xf8fb6d[_0xa93b('0x35')]=_['keys'](_0x26a895[_0xa93b('0x35')]);_0xf8fb6d['filters']=_[_0xa93b('0x37')](_0xf8fb6d[_0xa93b('0x34')],_0xf8fb6d[_0xa93b('0x35')]);_0x1bbabf[_0xa93b('0x38')]=_['intersection'](_0xf8fb6d[_0xa93b('0x34')],qs['fields'](_0x26a895[_0xa93b('0x35')][_0xa93b('0x39')]));_0x1bbabf['attributes']=_0x1bbabf[_0xa93b('0x38')]['length']?_0x1bbabf['attributes']:_0xf8fb6d['model'];_0x1bbabf[_0xa93b('0x51')]=qs[_0xa93b('0x3c')](_0x26a895[_0xa93b('0x35')]['sort']);_0x1bbabf[_0xa93b('0x41')]=qs[_0xa93b('0x3d')](_[_0xa93b('0x3e')](_0x26a895['query'],_0xf8fb6d[_0xa93b('0x3d')]));if(_0x26a895[_0xa93b('0x35')]['filter']){_0x1bbabf[_0xa93b('0x41')]=_['merge'](_0x1bbabf['where'],{'$or':_[_0xa93b('0x2e')](_0x1bbabf[_0xa93b('0x38')],function(_0x1df014){var _0x4f54a9={};_0x4f54a9[_0x1df014]={'$like':'%'+_0x26a895[_0xa93b('0x35')]['filter']+'%'};return _0x4f54a9;})});}_0x1bbabf=_['merge']({},_0x1bbabf,_0x26a895['options']);return _0x6c2654[_0xa93b('0x53')](_0x1bbabf);}})[_0xa93b('0x29')](function(_0x2549e4){if(_0x2549e4){_0x4d54db=_0x2549e4['length'];if(!_0x26a895[_0xa93b('0x35')][_0xa93b('0x3a')](_0xa93b('0x3b'))){_0x1bbabf['limit']=qs[_0xa93b('0x24')](_0x26a895[_0xa93b('0x35')]['limit']);_0x1bbabf[_0xa93b('0x21')]=qs[_0xa93b('0x21')](_0x26a895['query'][_0xa93b('0x21')]);}return _0x6c2654[_0xa93b('0x53')](_0x1bbabf);}})['then'](function(_0x57ee58){if(_0x57ee58){return _0x57ee58?{'count':_0x4d54db,'rows':_0x57ee58}:null;}})['then'](respondWithResult(_0x1da50b,null))[_0xa93b('0x49')](handleError(_0x1da50b,null));};exports[_0xa93b('0x54')]=function(_0x172c4b,_0x1c65ac,_0x10d491){var _0x273d1c={};var _0x379abb={};var _0x2b1c76;var _0x23f700;return db[_0xa93b('0x2f')][_0xa93b('0x4e')]({'where':{'id':_0x172c4b[_0xa93b('0x45')]['id']}})[_0xa93b('0x29')](handleEntityNotFound(_0x1c65ac,null))['then'](function(_0x544b58){if(_0x544b58){_0x2b1c76=_0x544b58;_0x379abb[_0xa93b('0x34')]=_[_0xa93b('0x36')](db['Tag'][_0xa93b('0x30')]);_0x379abb[_0xa93b('0x35')]=_[_0xa93b('0x36')](_0x172c4b['query']);_0x379abb[_0xa93b('0x3d')]=_['intersection'](_0x379abb[_0xa93b('0x34')],_0x379abb['query']);_0x273d1c[_0xa93b('0x38')]=_['intersection'](_0x379abb['model'],qs[_0xa93b('0x39')](_0x172c4b[_0xa93b('0x35')][_0xa93b('0x39')]));_0x273d1c[_0xa93b('0x38')]=_0x273d1c[_0xa93b('0x38')][_0xa93b('0x46')]?_0x273d1c[_0xa93b('0x38')]:_0x379abb[_0xa93b('0x34')];_0x273d1c[_0xa93b('0x51')]=qs[_0xa93b('0x3c')](_0x172c4b[_0xa93b('0x35')][_0xa93b('0x3c')]);_0x273d1c[_0xa93b('0x41')]=qs[_0xa93b('0x3d')](_[_0xa93b('0x3e')](_0x172c4b['query'],_0x379abb['filters']));if(_0x172c4b['query'][_0xa93b('0x3f')]){_0x273d1c['where']=_[_0xa93b('0x50')](_0x273d1c[_0xa93b('0x41')],{'$or':_[_0xa93b('0x2e')](_0x273d1c[_0xa93b('0x38')],function(_0x1079a4){var _0x439f5d={};_0x439f5d[_0x1079a4]={'$like':'%'+_0x172c4b[_0xa93b('0x35')][_0xa93b('0x3f')]+'%'};return _0x439f5d;})});}_0x273d1c=_[_0xa93b('0x50')]({},_0x273d1c,_0x172c4b[_0xa93b('0x48')]);return _0x2b1c76[_0xa93b('0x54')](_0x273d1c);}})[_0xa93b('0x29')](function(_0x3e2dd2){if(_0x3e2dd2){_0x23f700=_0x3e2dd2[_0xa93b('0x46')];if(!_0x172c4b['query'][_0xa93b('0x3a')](_0xa93b('0x3b'))){_0x273d1c['limit']=qs[_0xa93b('0x24')](_0x172c4b['query'][_0xa93b('0x24')]);_0x273d1c['offset']=qs[_0xa93b('0x21')](_0x172c4b[_0xa93b('0x35')][_0xa93b('0x21')]);}return _0x2b1c76['getTags'](_0x273d1c);}})[_0xa93b('0x29')](function(_0x4ce2cb){if(_0x4ce2cb){return _0x4ce2cb?{'count':_0x23f700,'rows':_0x4ce2cb}:null;}})[_0xa93b('0x29')](respondWithResult(_0x1c65ac,null))[_0xa93b('0x49')](handleError(_0x1c65ac,null));};exports[_0xa93b('0x55')]=function(_0x4f5bd9,_0x4ddb18,_0x43d95c){if(_0x4f5bd9[_0xa93b('0x4b')]['id']){delete _0x4f5bd9[_0xa93b('0x4b')]['id'];}return db[_0xa93b('0x2f')][_0xa93b('0x4e')]({'where':{'id':_0x4f5bd9[_0xa93b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ddb18,null))[_0xa93b('0x29')](function(_0x168e02){if(_0x168e02){return _0x168e02[_0xa93b('0x55')](_0x4f5bd9[_0xa93b('0x4b')]['ids']||[]);}return null;})[_0xa93b('0x29')](respondWithResult(_0x4ddb18,null))[_0xa93b('0x49')](handleError(_0x4ddb18,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 20a1423..67d7d74 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dcf=['bluebird','request-promise','rimraf','../../config/environment','exports','lodash','util','api','moment'];(function(_0x5f3c96,_0x412cda){var _0x4b1a08=function(_0x22ae42){while(--_0x22ae42){_0x5f3c96['push'](_0x5f3c96['shift']());}};_0x4b1a08(++_0x412cda);}(_0x0dcf,0x191));var _0xf0dc=function(_0x26a486,_0x38ae6c){_0x26a486=_0x26a486-0x0;var _0x402299=_0x0dcf[_0x26a486];return _0x402299;};'use strict';var _=require(_0xf0dc('0x0'));var util=require(_0xf0dc('0x1'));var logger=require('../../config/logger')(_0xf0dc('0x2'));var moment=require(_0xf0dc('0x3'));var BPromise=require(_0xf0dc('0x4'));var rp=require(_0xf0dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0dc('0x6'));var config=require(_0xf0dc('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xf0dc('0x8')]=function(_0x5d49b4,_0x5a827d){return _0x5d49b4['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ee=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0xf2ee,0x16c));var _0xef2e=function(_0x15158c,_0x456374){_0x15158c=_0x15158c-0x0;var _0x2ccf43=_0xf2ee[_0x15158c];return _0x2ccf43;};'use strict';var _=require(_0xef2e('0x0'));var util=require('util');var logger=require(_0xef2e('0x1'))(_0xef2e('0x2'));var moment=require(_0xef2e('0x3'));var BPromise=require(_0xef2e('0x4'));var rp=require(_0xef2e('0x5'));var fs=require('fs');var path=require(_0xef2e('0x6'));var rimraf=require(_0xef2e('0x7'));var config=require(_0xef2e('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0xef2e('0x9')]=function(_0x3760d9,_0x8ccb24){return _0x3760d9[_0xef2e('0xa')](_0xef2e('0xb'),attributes,{'tableName':_0xef2e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2ac2e9b..2a2810c 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36fe=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x59eaa8,_0x3976d0){var _0x3d8e7c=function(_0x1a77d3){while(--_0x1a77d3){_0x59eaa8['push'](_0x59eaa8['shift']());}};_0x3d8e7c(++_0x3976d0);}(_0x36fe,0x127));var _0xe36f=function(_0x395667,_0x45593a){_0x395667=_0x395667-0x0;var _0x5cdb8f=_0x36fe[_0x395667];return _0x5cdb8f;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x349c9e,_0xdae131,_0x5a0d3c){return new BPromise(function(_0x1ecd6b,_0x21f2a5){return client['request'](_0x349c9e,_0x5a0d3c)[_0xe36f('0xc')](function(_0x386c00){logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,_0xe36f('0xf'));logger['debug'](_0xe36f('0x10'),_0xdae131,'request\x20sent',JSON[_0xe36f('0x11')](_0x386c00));if(_0x386c00[_0xe36f('0x12')]){if(_0x386c00[_0xe36f('0x12')]['code']===0x1f4){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x386c00['error'][_0xe36f('0x13')]);return _0x21f2a5(_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);}logger[_0xe36f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xdae131,_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);return _0x1ecd6b(_0x386c00[_0xe36f('0x12')]['message']);}else{logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,'request\x20sent');_0x1ecd6b(_0x386c00[_0xe36f('0x14')][_0xe36f('0x13')]);}})[_0xe36f('0x15')](function(_0x3f8f9f){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x3f8f9f);_0x21f2a5(_0x3f8f9f);});});} \ No newline at end of file +var _0xf79e=['jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x52382d,_0x2065a6){var _0x128e5e=function(_0x1eaae8){while(--_0x1eaae8){_0x52382d['push'](_0x52382d['shift']());}};_0x128e5e(++_0x2065a6);}(_0xf79e,0x185));var _0xef79=function(_0x303f4a,_0x4c76d2){_0x303f4a=_0x303f4a-0x0;var _0x4e8b4d=_0xf79e[_0x303f4a];return _0x4e8b4d;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index ac4da8c..fffa99a 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcad1=['create','put','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','post'];(function(_0x3bd3e1,_0x41649c){var _0x1855a2=function(_0x4cd9db){while(--_0x4cd9db){_0x3bd3e1['push'](_0x3bd3e1['shift']());}};_0x1855a2(++_0x41649c);}(_0xcad1,0x16c));var _0x1cad=function(_0x2bdba0,_0x5d0b77){_0x2bdba0=_0x2bdba0-0x0;var _0x19ba0e=_0xcad1[_0x2bdba0];return _0x19ba0e;};'use strict';var multer=require('multer');var util=require(_0x1cad('0x0'));var path=require(_0x1cad('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1cad('0x2')]();var fs_extra=require(_0x1cad('0x3'));var auth=require(_0x1cad('0x4'));var interaction=require(_0x1cad('0x5'));var config=require('../../config/environment');var controller=require(_0x1cad('0x6'));router[_0x1cad('0x7')]('/',auth[_0x1cad('0x8')](),controller['index']);router['get']('/:id',auth[_0x1cad('0x8')](),controller['show']);router[_0x1cad('0x9')]('/',auth[_0x1cad('0x8')](),controller[_0x1cad('0xa')]);router[_0x1cad('0xb')](_0x1cad('0xc'),auth[_0x1cad('0x8')](),controller[_0x1cad('0xd')]);router[_0x1cad('0xe')](_0x1cad('0xc'),auth['isAuthenticated'](),controller[_0x1cad('0xf')]);module[_0x1cad('0x10')]=router; \ No newline at end of file +var _0x49b9=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x49b9,0x1da));var _0x949b=function(_0x35a644,_0x4d3952){_0x35a644=_0x35a644-0x0;var _0x4b496e=_0x49b9[_0x35a644];return _0x4b496e;};'use strict';var multer=require(_0x949b('0x0'));var util=require(_0x949b('0x1'));var path=require(_0x949b('0x2'));var timeout=require(_0x949b('0x3'));var express=require(_0x949b('0x4'));var router=express[_0x949b('0x5')]();var fs_extra=require(_0x949b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x949b('0x7'));var config=require(_0x949b('0x8'));var controller=require(_0x949b('0x9'));router[_0x949b('0xa')]('/',auth[_0x949b('0xb')](),controller[_0x949b('0xc')]);router[_0x949b('0xa')](_0x949b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x949b('0xe')]('/',auth[_0x949b('0xb')](),controller[_0x949b('0xf')]);router['put'](_0x949b('0xd'),auth[_0x949b('0xb')](),controller[_0x949b('0x10')]);router[_0x949b('0x11')](_0x949b('0xd'),auth[_0x949b('0xb')](),controller['destroy']);module[_0x949b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index cc6b9c5..0fbccf2 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2df8=['variable','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x13549a,_0x1ae1aa){var _0x49b032=function(_0x2a6390){while(--_0x2a6390){_0x13549a['push'](_0x13549a['shift']());}};_0x49b032(++_0x1ae1aa);}(_0x2df8,0x15f));var _0x82df=function(_0x49b63a,_0x3ce782){_0x49b63a=_0x49b63a-0x0;var _0xa84061=_0x2df8[_0x49b63a];return _0xa84061;};'use strict';var Sequelize=require('sequelize');module[_0x82df('0x0')]={'type':{'type':Sequelize[_0x82df('0x1')](_0x82df('0x2'),_0x82df('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0x82df('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x82df('0x1')](_0x82df('0x2'),_0x82df('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x82df('0x4')]},'nameField':{'type':Sequelize[_0x82df('0x4')]},'customField':{'type':Sequelize[_0x82df('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x82df('0x4')]}}; \ No newline at end of file +var _0x39ff=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x39ff,0xff));var _0xf39f=function(_0xf378db,_0x294255){_0xf378db=_0xf378db-0x0;var _0x3ed5a3=_0x39ff[_0xf378db];return _0x3ed5a3;};'use strict';var Sequelize=require(_0xf39f('0x0'));module[_0xf39f('0x1')]={'type':{'type':Sequelize[_0xf39f('0x2')](_0xf39f('0x3'),_0xf39f('0x4'),_0xf39f('0x5'),_0xf39f('0x6'),_0xf39f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf39f('0x8')]},'key':{'type':Sequelize[_0xf39f('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xf39f('0x3'),_0xf39f('0x4'),_0xf39f('0x5'))},'keyContent':{'type':Sequelize[_0xf39f('0x8')]},'idField':{'type':Sequelize[_0xf39f('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf39f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf39f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 60379c6..cc05040 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7580=['limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','attributes','length','create','body','find','rimraf','fast-json-patch','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7580,0x14b));var _0x0758=function(_0x5be851,_0x527c9a){_0x5be851=_0x5be851-0x0;var _0x5c5d8b=_0x7580[_0x5be851];return _0x5c5d8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0758('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0758('0x1'));var rp=require('request-promise');var moment=require(_0x0758('0x2'));var BPromise=require(_0x0758('0x3'));var Mustache=require(_0x0758('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0758('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0758('0x6'));var _=require(_0x0758('0x7'));var squel=require(_0x0758('0x8'));var crypto=require(_0x0758('0x9'));var jsforce=require(_0x0758('0xa'));var deskjs=require(_0x0758('0xb'));var toCsv=require(_0x0758('0xc'));var querystring=require(_0x0758('0xd'));var Papa=require(_0x0758('0xe'));var Redis=require(_0x0758('0xf'));var authService=require(_0x0758('0x10'));var qs=require(_0x0758('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0758('0x12'));var logger=require(_0x0758('0x13'))('api');var utils=require(_0x0758('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0758('0x15'));var db=require(_0x0758('0x16'))['db'];function respondWithStatusCode(_0x56b83c,_0x17926e){_0x17926e=_0x17926e||0xcc;return function(_0x574c86){if(_0x574c86){return _0x56b83c[_0x0758('0x17')](_0x17926e);}return _0x56b83c[_0x0758('0x18')](_0x17926e)['end']();};}function respondWithResult(_0x3d0df0,_0x27986a){_0x27986a=_0x27986a||0xc8;return function(_0x2e1a26){if(_0x2e1a26){return _0x3d0df0[_0x0758('0x18')](_0x27986a)[_0x0758('0x19')](_0x2e1a26);}};}function respondWithFilteredResult(_0x104e58,_0x30c5b5){return function(_0x353f96){if(_0x353f96){var _0x1ceb2d=typeof _0x30c5b5[_0x0758('0x1a')]==='undefined'&&typeof _0x30c5b5['limit']===_0x0758('0x1b');var _0x5f5dc2=_0x353f96[_0x0758('0x1c')];var _0x12c5dd=_0x1ceb2d?0x0:_0x30c5b5['offset'];var _0x58feba=_0x1ceb2d?_0x353f96[_0x0758('0x1c')]:_0x30c5b5['offset']+_0x30c5b5[_0x0758('0x1d')];var _0x501f49;if(_0x58feba>=_0x5f5dc2){_0x58feba=_0x5f5dc2;_0x501f49=0xc8;}else{_0x501f49=0xce;}_0x104e58[_0x0758('0x18')](_0x501f49);return _0x104e58[_0x0758('0x1e')](_0x0758('0x1f'),_0x12c5dd+'-'+_0x58feba+'/'+_0x5f5dc2)[_0x0758('0x19')](_0x353f96);}return null;};}function patchUpdates(_0x327007){return function(_0x4a052e){try{jsonpatch[_0x0758('0x20')](_0x4a052e,_0x327007,!![]);}catch(_0x3bc553){return BPromise[_0x0758('0x21')](_0x3bc553);}return _0x4a052e[_0x0758('0x22')]();};}function saveUpdates(_0x518a69,_0x4cd14e){return function(_0xeed9c9){if(_0xeed9c9){return _0xeed9c9[_0x0758('0x23')](_0x518a69)[_0x0758('0x24')](function(_0x4da962){return _0x4da962;});}return null;};}function removeEntity(_0x3f8d74,_0x10b838){return function(_0x3786b4){if(_0x3786b4){return _0x3786b4[_0x0758('0x25')]()[_0x0758('0x24')](function(){_0x3f8d74[_0x0758('0x18')](0xcc)[_0x0758('0x26')]();});}};}function handleEntityNotFound(_0xdac325,_0x1a42d6){return function(_0x2e3b6b){if(!_0x2e3b6b){_0xdac325[_0x0758('0x17')](0x194);}return _0x2e3b6b;};}function handleError(_0x4d4b61,_0x4dea6d){_0x4dea6d=_0x4dea6d||0x1f4;return function(_0x4a74dd){logger[_0x0758('0x27')](_0x4a74dd['stack']);if(_0x4a74dd[_0x0758('0x28')]){delete _0x4a74dd[_0x0758('0x28')];}_0x4d4b61[_0x0758('0x18')](_0x4dea6d)[_0x0758('0x29')](_0x4a74dd);};}exports[_0x0758('0x2a')]=function(_0x17c1d8,_0x6db1b5){var _0x12cb98={},_0xe1668e={},_0x3d26a9={'count':0x0,'rows':[]};var _0x20427b=_[_0x0758('0x2b')](db[_0x0758('0x2c')][_0x0758('0x2d')],function(_0x1e7c59){return{'name':_0x1e7c59[_0x0758('0x2e')],'type':_0x1e7c59['type'][_0x0758('0x2f')]};});_0xe1668e[_0x0758('0x30')]=_[_0x0758('0x2b')](_0x20427b,_0x0758('0x28'));_0xe1668e[_0x0758('0x31')]=_['keys'](_0x17c1d8[_0x0758('0x31')]);_0xe1668e['filters']=_[_0x0758('0x32')](_0xe1668e[_0x0758('0x30')],_0xe1668e['query']);_0x12cb98['attributes']=_['intersection'](_0xe1668e['model'],qs[_0x0758('0x33')](_0x17c1d8[_0x0758('0x31')][_0x0758('0x33')]));_0x12cb98['attributes']=_0x12cb98['attributes']['length']?_0x12cb98['attributes']:_0xe1668e[_0x0758('0x30')];if(!_0x17c1d8[_0x0758('0x31')][_0x0758('0x34')]('nolimit')){_0x12cb98[_0x0758('0x1d')]=qs[_0x0758('0x1d')](_0x17c1d8[_0x0758('0x31')]['limit']);_0x12cb98[_0x0758('0x1a')]=qs['offset'](_0x17c1d8[_0x0758('0x31')][_0x0758('0x1a')]);}_0x12cb98[_0x0758('0x35')]=qs[_0x0758('0x36')](_0x17c1d8[_0x0758('0x31')]['sort']);_0x12cb98[_0x0758('0x37')]=qs['filters'](_['pick'](_0x17c1d8['query'],_0xe1668e[_0x0758('0x38')]),_0x20427b);if(_0x17c1d8['query'][_0x0758('0x39')]){_0x12cb98[_0x0758('0x37')]=_[_0x0758('0x3a')](_0x12cb98[_0x0758('0x37')],{'$or':_[_0x0758('0x2b')](_0x20427b,function(_0x56c130){if(_0x56c130['type']!==_0x0758('0x3b')){var _0x31b657={};_0x31b657[_0x56c130[_0x0758('0x28')]]={'$like':'%'+_0x17c1d8[_0x0758('0x31')][_0x0758('0x39')]+'%'};return _0x31b657;}})});}_0x12cb98=_[_0x0758('0x3a')]({},_0x12cb98,_0x17c1d8[_0x0758('0x3c')]);var _0x581c60={'where':_0x12cb98[_0x0758('0x37')]};return db[_0x0758('0x2c')][_0x0758('0x1c')](_0x581c60)[_0x0758('0x24')](function(_0x435192){_0x3d26a9[_0x0758('0x1c')]=_0x435192;if(_0x17c1d8[_0x0758('0x31')][_0x0758('0x3d')]){_0x12cb98[_0x0758('0x3e')]=[{'all':!![]}];}return db[_0x0758('0x2c')][_0x0758('0x3f')](_0x12cb98);})[_0x0758('0x24')](function(_0x31b705){_0x3d26a9[_0x0758('0x40')]=_0x31b705;return _0x3d26a9;})['then'](respondWithFilteredResult(_0x6db1b5,_0x12cb98))[_0x0758('0x41')](handleError(_0x6db1b5,null));};exports['show']=function(_0x29802c,_0x3b5646){var _0x36d990={'raw':!![],'where':{'id':_0x29802c[_0x0758('0x42')]['id']}},_0x588a76={};_0x588a76[_0x0758('0x30')]=_['keys'](db['DeskField'][_0x0758('0x2d')]);_0x588a76[_0x0758('0x31')]=_['keys'](_0x29802c['query']);_0x588a76[_0x0758('0x38')]=_['intersection'](_0x588a76[_0x0758('0x30')],_0x588a76['query']);_0x36d990[_0x0758('0x43')]=_['intersection'](_0x588a76[_0x0758('0x30')],qs[_0x0758('0x33')](_0x29802c[_0x0758('0x31')][_0x0758('0x33')]));_0x36d990['attributes']=_0x36d990['attributes'][_0x0758('0x44')]?_0x36d990['attributes']:_0x588a76[_0x0758('0x30')];if(_0x29802c[_0x0758('0x31')][_0x0758('0x3d')]){_0x36d990[_0x0758('0x3e')]=[{'all':!![]}];}_0x36d990=_[_0x0758('0x3a')]({},_0x36d990,_0x29802c[_0x0758('0x3c')]);return db[_0x0758('0x2c')]['find'](_0x36d990)['then'](handleEntityNotFound(_0x3b5646,null))[_0x0758('0x24')](respondWithResult(_0x3b5646,null))[_0x0758('0x41')](handleError(_0x3b5646,null));};exports[_0x0758('0x45')]=function(_0x3ed8f8,_0xc6969d){return db[_0x0758('0x2c')][_0x0758('0x45')](_0x3ed8f8['body'],{})[_0x0758('0x24')](respondWithResult(_0xc6969d,0xc9))[_0x0758('0x41')](handleError(_0xc6969d,null));};exports[_0x0758('0x23')]=function(_0x492d8a,_0x39578e){if(_0x492d8a[_0x0758('0x46')]['id']){delete _0x492d8a[_0x0758('0x46')]['id'];}return db[_0x0758('0x2c')]['find']({'where':{'id':_0x492d8a[_0x0758('0x42')]['id']}})[_0x0758('0x24')](handleEntityNotFound(_0x39578e,null))['then'](saveUpdates(_0x492d8a[_0x0758('0x46')],null))['then'](respondWithResult(_0x39578e,null))['catch'](handleError(_0x39578e,null));};exports[_0x0758('0x25')]=function(_0x474608,_0x2a0130){return db[_0x0758('0x2c')][_0x0758('0x47')]({'where':{'id':_0x474608[_0x0758('0x42')]['id']}})[_0x0758('0x24')](handleEntityNotFound(_0x2a0130,null))['then'](removeEntity(_0x2a0130,null))[_0x0758('0x41')](handleError(_0x2a0130,null));}; \ No newline at end of file +var _0x6e64=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','Content-Range','reject','save','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','filter','where','merge','map','options','DeskField','then','rows','catch','show','length','include','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x25cb87,_0xc2d352){var _0x3a7537=function(_0x53516a){while(--_0x53516a){_0x25cb87['push'](_0x25cb87['shift']());}};_0x3a7537(++_0xc2d352);}(_0x6e64,0x10f));var _0x46e6=function(_0x259841,_0x1e9bc1){_0x259841=_0x259841-0x0;var _0x5e165b=_0x6e64[_0x259841];return _0x5e165b;};'use strict';var emlformat=require(_0x46e6('0x0'));var rimraf=require(_0x46e6('0x1'));var zipdir=require(_0x46e6('0x2'));var jsonpatch=require(_0x46e6('0x3'));var rp=require('request-promise');var moment=require(_0x46e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46e6('0x5'));var util=require('util');var path=require(_0x46e6('0x6'));var sox=require(_0x46e6('0x7'));var csv=require(_0x46e6('0x8'));var ejs=require(_0x46e6('0x9'));var fs=require('fs');var fs_extra=require(_0x46e6('0xa'));var _=require(_0x46e6('0xb'));var squel=require('squel');var crypto=require(_0x46e6('0xc'));var jsforce=require(_0x46e6('0xd'));var deskjs=require(_0x46e6('0xe'));var toCsv=require(_0x46e6('0x8'));var querystring=require(_0x46e6('0xf'));var Papa=require(_0x46e6('0x10'));var Redis=require(_0x46e6('0x11'));var authService=require(_0x46e6('0x12'));var qs=require(_0x46e6('0x13'));var as=require(_0x46e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46e6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x46e6('0x16'));var licenseUtil=require(_0x46e6('0x17'));var db=require(_0x46e6('0x18'))['db'];function respondWithStatusCode(_0x3d0bee,_0x493191){_0x493191=_0x493191||0xcc;return function(_0x4dfb64){if(_0x4dfb64){return _0x3d0bee[_0x46e6('0x19')](_0x493191);}return _0x3d0bee[_0x46e6('0x1a')](_0x493191)[_0x46e6('0x1b')]();};}function respondWithResult(_0x30e16c,_0x1d8647){_0x1d8647=_0x1d8647||0xc8;return function(_0x37ddb9){if(_0x37ddb9){return _0x30e16c[_0x46e6('0x1a')](_0x1d8647)['json'](_0x37ddb9);}};}function respondWithFilteredResult(_0x315e32,_0x4c4c3c){return function(_0xc666c4){if(_0xc666c4){var _0x2aed35=typeof _0x4c4c3c['offset']==='undefined'&&typeof _0x4c4c3c[_0x46e6('0x1c')]===_0x46e6('0x1d');var _0x13c41c=_0xc666c4['count'];var _0xd2229f=_0x2aed35?0x0:_0x4c4c3c[_0x46e6('0x1e')];var _0x2b0a63=_0x2aed35?_0xc666c4[_0x46e6('0x1f')]:_0x4c4c3c[_0x46e6('0x1e')]+_0x4c4c3c[_0x46e6('0x1c')];var _0x4c20e7;if(_0x2b0a63>=_0x13c41c){_0x2b0a63=_0x13c41c;_0x4c20e7=0xc8;}else{_0x4c20e7=0xce;}_0x315e32[_0x46e6('0x1a')](_0x4c20e7);return _0x315e32['set'](_0x46e6('0x20'),_0xd2229f+'-'+_0x2b0a63+'/'+_0x13c41c)['json'](_0xc666c4);}return null;};}function patchUpdates(_0x220946){return function(_0x5dc059){try{jsonpatch['apply'](_0x5dc059,_0x220946,!![]);}catch(_0x145da2){return BPromise[_0x46e6('0x21')](_0x145da2);}return _0x5dc059[_0x46e6('0x22')]();};}function saveUpdates(_0x537119,_0x351982){return function(_0x1453ff){if(_0x1453ff){return _0x1453ff['update'](_0x537119)['then'](function(_0x2c9103){return _0x2c9103;});}return null;};}function removeEntity(_0x586e7a,_0x1f038c){return function(_0x141968){if(_0x141968){return _0x141968[_0x46e6('0x23')]()['then'](function(){_0x586e7a[_0x46e6('0x1a')](0xcc)[_0x46e6('0x1b')]();});}};}function handleEntityNotFound(_0x267c6b,_0x189b6e){return function(_0x3709ce){if(!_0x3709ce){_0x267c6b[_0x46e6('0x19')](0x194);}return _0x3709ce;};}function handleError(_0x380cd6,_0x4e3a85){_0x4e3a85=_0x4e3a85||0x1f4;return function(_0x5cbc32){logger[_0x46e6('0x24')](_0x5cbc32[_0x46e6('0x25')]);if(_0x5cbc32[_0x46e6('0x26')]){delete _0x5cbc32[_0x46e6('0x26')];}_0x380cd6[_0x46e6('0x1a')](_0x4e3a85)[_0x46e6('0x27')](_0x5cbc32);};}exports[_0x46e6('0x28')]=function(_0x1e78a3,_0x2bae2d){var _0x31ea83={},_0x5bbe66={},_0x31e5cd={'count':0x0,'rows':[]};var _0xfedf26=_['map'](db['DeskField'][_0x46e6('0x29')],function(_0xb5c4f9){return{'name':_0xb5c4f9[_0x46e6('0x2a')],'type':_0xb5c4f9[_0x46e6('0x2b')][_0x46e6('0x2c')]};});_0x5bbe66['model']=_['map'](_0xfedf26,_0x46e6('0x26'));_0x5bbe66[_0x46e6('0x2d')]=_[_0x46e6('0x2e')](_0x1e78a3[_0x46e6('0x2d')]);_0x5bbe66[_0x46e6('0x2f')]=_[_0x46e6('0x30')](_0x5bbe66[_0x46e6('0x31')],_0x5bbe66[_0x46e6('0x2d')]);_0x31ea83[_0x46e6('0x32')]=_[_0x46e6('0x30')](_0x5bbe66[_0x46e6('0x31')],qs[_0x46e6('0x33')](_0x1e78a3[_0x46e6('0x2d')][_0x46e6('0x33')]));_0x31ea83['attributes']=_0x31ea83[_0x46e6('0x32')]['length']?_0x31ea83[_0x46e6('0x32')]:_0x5bbe66['model'];if(!_0x1e78a3[_0x46e6('0x2d')]['hasOwnProperty'](_0x46e6('0x34'))){_0x31ea83[_0x46e6('0x1c')]=qs[_0x46e6('0x1c')](_0x1e78a3['query']['limit']);_0x31ea83[_0x46e6('0x1e')]=qs[_0x46e6('0x1e')](_0x1e78a3['query'][_0x46e6('0x1e')]);}_0x31ea83[_0x46e6('0x35')]=qs['sort'](_0x1e78a3[_0x46e6('0x2d')][_0x46e6('0x36')]);_0x31ea83['where']=qs[_0x46e6('0x2f')](_['pick'](_0x1e78a3[_0x46e6('0x2d')],_0x5bbe66[_0x46e6('0x2f')]),_0xfedf26);if(_0x1e78a3[_0x46e6('0x2d')][_0x46e6('0x37')]){_0x31ea83[_0x46e6('0x38')]=_[_0x46e6('0x39')](_0x31ea83[_0x46e6('0x38')],{'$or':_[_0x46e6('0x3a')](_0xfedf26,function(_0xf04ce7){if(_0xf04ce7['type']!=='VIRTUAL'){var _0xeeef37={};_0xeeef37[_0xf04ce7[_0x46e6('0x26')]]={'$like':'%'+_0x1e78a3[_0x46e6('0x2d')]['filter']+'%'};return _0xeeef37;}})});}_0x31ea83=_[_0x46e6('0x39')]({},_0x31ea83,_0x1e78a3[_0x46e6('0x3b')]);var _0x3ea480={'where':_0x31ea83['where']};return db[_0x46e6('0x3c')][_0x46e6('0x1f')](_0x3ea480)[_0x46e6('0x3d')](function(_0x53125d){_0x31e5cd[_0x46e6('0x1f')]=_0x53125d;if(_0x1e78a3[_0x46e6('0x2d')]['includeAll']){_0x31ea83['include']=[{'all':!![]}];}return db[_0x46e6('0x3c')]['findAll'](_0x31ea83);})['then'](function(_0x15f57d){_0x31e5cd[_0x46e6('0x3e')]=_0x15f57d;return _0x31e5cd;})[_0x46e6('0x3d')](respondWithFilteredResult(_0x2bae2d,_0x31ea83))[_0x46e6('0x3f')](handleError(_0x2bae2d,null));};exports[_0x46e6('0x40')]=function(_0x191247,_0x457dfa){var _0x4f755b={'raw':!![],'where':{'id':_0x191247['params']['id']}},_0x12f959={};_0x12f959['model']=_[_0x46e6('0x2e')](db['DeskField'][_0x46e6('0x29')]);_0x12f959[_0x46e6('0x2d')]=_[_0x46e6('0x2e')](_0x191247[_0x46e6('0x2d')]);_0x12f959[_0x46e6('0x2f')]=_[_0x46e6('0x30')](_0x12f959['model'],_0x12f959[_0x46e6('0x2d')]);_0x4f755b['attributes']=_['intersection'](_0x12f959[_0x46e6('0x31')],qs[_0x46e6('0x33')](_0x191247[_0x46e6('0x2d')]['fields']));_0x4f755b[_0x46e6('0x32')]=_0x4f755b['attributes'][_0x46e6('0x41')]?_0x4f755b['attributes']:_0x12f959[_0x46e6('0x31')];if(_0x191247[_0x46e6('0x2d')]['includeAll']){_0x4f755b[_0x46e6('0x42')]=[{'all':!![]}];}_0x4f755b=_['merge']({},_0x4f755b,_0x191247['options']);return db[_0x46e6('0x3c')][_0x46e6('0x43')](_0x4f755b)[_0x46e6('0x3d')](handleEntityNotFound(_0x457dfa,null))[_0x46e6('0x3d')](respondWithResult(_0x457dfa,null))['catch'](handleError(_0x457dfa,null));};exports['create']=function(_0x378201,_0x5b9efd){return db[_0x46e6('0x3c')][_0x46e6('0x44')](_0x378201['body'],{})['then'](respondWithResult(_0x5b9efd,0xc9))['catch'](handleError(_0x5b9efd,null));};exports[_0x46e6('0x45')]=function(_0x459f8b,_0x2267b4){if(_0x459f8b[_0x46e6('0x46')]['id']){delete _0x459f8b[_0x46e6('0x46')]['id'];}return db[_0x46e6('0x3c')][_0x46e6('0x43')]({'where':{'id':_0x459f8b[_0x46e6('0x47')]['id']}})[_0x46e6('0x3d')](handleEntityNotFound(_0x2267b4,null))[_0x46e6('0x3d')](saveUpdates(_0x459f8b['body'],null))['then'](respondWithResult(_0x2267b4,null))[_0x46e6('0x3f')](handleError(_0x2267b4,null));};exports[_0x46e6('0x23')]=function(_0x4d9331,_0x3b1896){return db[_0x46e6('0x3c')][_0x46e6('0x43')]({'where':{'id':_0x4d9331[_0x46e6('0x47')]['id']}})[_0x46e6('0x3d')](handleEntityNotFound(_0x3b1896,null))[_0x46e6('0x3d')](removeEntity(_0x3b1896,null))[_0x46e6('0x3f')](handleError(_0x3b1896,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 61915a5..14c9789 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89d3=['path','rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cf1d0,_0x25330c){var _0x598afe=function(_0x535584){while(--_0x535584){_0x3cf1d0['push'](_0x3cf1d0['shift']());}};_0x598afe(++_0x25330c);}(_0x89d3,0x96));var _0x389d=function(_0x224436,_0x13088b){_0x224436=_0x224436-0x0;var _0x3c694a=_0x89d3[_0x224436];return _0x3c694a;};'use strict';var _=require('lodash');var util=require(_0x389d('0x0'));var logger=require(_0x389d('0x1'))(_0x389d('0x2'));var moment=require(_0x389d('0x3'));var BPromise=require(_0x389d('0x4'));var rp=require(_0x389d('0x5'));var fs=require('fs');var path=require(_0x389d('0x6'));var rimraf=require(_0x389d('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x389d('0x8')]=function(_0x544a73,_0x1bfc3c){return _0x544a73[_0x389d('0x9')](_0x389d('0xa'),attributes,{'tableName':_0x389d('0xb'),'paranoid':![],'indexes':[{'name':_0x389d('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x18da=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','int_desk_fields','idField','FieldId','lodash'];(function(_0x18386b,_0x4669f7){var _0x175c7f=function(_0x3f47b4){while(--_0x3f47b4){_0x18386b['push'](_0x18386b['shift']());}};_0x175c7f(++_0x4669f7);}(_0x18da,0xa8));var _0xa18d=function(_0x41568f,_0x7c6734){_0x41568f=_0x41568f-0x0;var _0x2b35e5=_0x18da[_0x41568f];return _0x2b35e5;};'use strict';var _=require(_0xa18d('0x0'));var util=require(_0xa18d('0x1'));var logger=require(_0xa18d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa18d('0x3'));var rp=require(_0xa18d('0x4'));var fs=require('fs');var path=require(_0xa18d('0x5'));var rimraf=require(_0xa18d('0x6'));var config=require(_0xa18d('0x7'));var attributes=require(_0xa18d('0x8'));module[_0xa18d('0x9')]=function(_0x3cc5f3,_0x15e36d){return _0x3cc5f3['define']('DeskField',attributes,{'tableName':_0xa18d('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xa18d('0xb'),_0xa18d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 43c2c7c..a501c22 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26bd=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x1c05bd,_0x149272){var _0x560ede=function(_0x43ceee){while(--_0x43ceee){_0x1c05bd['push'](_0x1c05bd['shift']());}};_0x560ede(++_0x149272);}(_0x26bd,0x8e));var _0xd26b=function(_0x123a3c,_0x284523){_0x123a3c=_0x123a3c-0x0;var _0x45a5a4=_0x26bd[_0x123a3c];return _0x45a5a4;};'use strict';var _=require(_0xd26b('0x0'));var util=require('util');var moment=require(_0xd26b('0x1'));var BPromise=require(_0xd26b('0x2'));var rs=require(_0xd26b('0x3'));var fs=require('fs');var Redis=require(_0xd26b('0x4'));var db=require(_0xd26b('0x5'))['db'];var utils=require(_0xd26b('0x6'));var logger=require(_0xd26b('0x7'))(_0xd26b('0x8'));var config=require('../../config/environment');var jayson=require(_0xd26b('0x9'));var client=jayson['client'][_0xd26b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21fe45,_0x17475d,_0xe97a32){return new BPromise(function(_0x2bdcac,_0x45d56e){return client[_0xd26b('0xb')](_0x21fe45,_0xe97a32)['then'](function(_0x5cf195){logger['info']('DeskField,\x20%s,\x20%s',_0x17475d,_0xd26b('0xc'));logger[_0xd26b('0xd')](_0xd26b('0xe'),_0x17475d,_0xd26b('0xc'),JSON[_0xd26b('0xf')](_0x5cf195));if(_0x5cf195[_0xd26b('0x10')]){if(_0x5cf195[_0xd26b('0x10')][_0xd26b('0x11')]===0x1f4){logger['error'](_0xd26b('0x12'),_0x17475d,_0x5cf195['error']['message']);return _0x45d56e(_0x5cf195[_0xd26b('0x10')]['message']);}logger[_0xd26b('0x10')](_0xd26b('0x12'),_0x17475d,_0x5cf195['error']['message']);return _0x2bdcac(_0x5cf195['error'][_0xd26b('0x13')]);}else{logger[_0xd26b('0x14')](_0xd26b('0x12'),_0x17475d,_0xd26b('0xc'));_0x2bdcac(_0x5cf195[_0xd26b('0x15')]['message']);}})['catch'](function(_0x4e79f9){logger[_0xd26b('0x10')](_0xd26b('0x12'),_0x17475d,_0x4e79f9);_0x45d56e(_0x4e79f9);});});} \ No newline at end of file +var _0xebf0=['code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x42cc1f,_0x357858){var _0x5647cd=function(_0x16109f){while(--_0x16109f){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x5647cd(++_0x357858);}(_0xebf0,0x1e3));var _0x0ebf=function(_0x657b03,_0x26b1c6){_0x657b03=_0x657b03-0x0;var _0x528fa8=_0xebf0[_0x657b03];return _0x528fa8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0ebf('0x0'));var rs=require(_0x0ebf('0x1'));var fs=require('fs');var Redis=require(_0x0ebf('0x2'));var db=require(_0x0ebf('0x3'))['db'];var utils=require(_0x0ebf('0x4'));var logger=require(_0x0ebf('0x5'))('rpc');var config=require(_0x0ebf('0x6'));var jayson=require(_0x0ebf('0x7'));var client=jayson[_0x0ebf('0x8')][_0x0ebf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e36d0,_0x33cba0,_0x2c6773){return new BPromise(function(_0x33e6fb,_0x30172e){return client[_0x0ebf('0xa')](_0x3e36d0,_0x2c6773)[_0x0ebf('0xb')](function(_0xe24f72){logger[_0x0ebf('0xc')](_0x0ebf('0xd'),_0x33cba0,_0x0ebf('0xe'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x33cba0,_0x0ebf('0xe'),JSON[_0x0ebf('0xf')](_0xe24f72));if(_0xe24f72[_0x0ebf('0x10')]){if(_0xe24f72[_0x0ebf('0x10')][_0x0ebf('0x11')]===0x1f4){logger[_0x0ebf('0x10')](_0x0ebf('0xd'),_0x33cba0,_0xe24f72[_0x0ebf('0x10')][_0x0ebf('0x12')]);return _0x30172e(_0xe24f72[_0x0ebf('0x10')][_0x0ebf('0x12')]);}logger['error'](_0x0ebf('0xd'),_0x33cba0,_0xe24f72[_0x0ebf('0x10')][_0x0ebf('0x12')]);return _0x33e6fb(_0xe24f72[_0x0ebf('0x10')][_0x0ebf('0x12')]);}else{logger[_0x0ebf('0xc')](_0x0ebf('0xd'),_0x33cba0,_0x0ebf('0xe'));_0x33e6fb(_0xe24f72[_0x0ebf('0x13')][_0x0ebf('0x12')]);}})['catch'](function(_0x2df1b7){logger[_0x0ebf('0x10')](_0x0ebf('0xd'),_0x33cba0,_0x2df1b7);_0x30172e(_0x2df1b7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2cbc1ab..2a4102c 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8399=['getFields','post','addConfiguration','put','update','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x4009a0,_0x52119b){var _0x25cc54=function(_0x239f99){while(--_0x239f99){_0x4009a0['push'](_0x4009a0['shift']());}};_0x25cc54(++_0x52119b);}(_0x8399,0x125));var _0x9839=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x8399[_0x2ef8f1];return _0x17498d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9839('0x0'));var timeout=require(_0x9839('0x1'));var express=require(_0x9839('0x2'));var router=express[_0x9839('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9839('0x4'));var controller=require(_0x9839('0x5'));router[_0x9839('0x6')]('/',auth[_0x9839('0x7')](),controller[_0x9839('0x8')]);router[_0x9839('0x6')](_0x9839('0x9'),auth[_0x9839('0x7')](),controller[_0x9839('0xa')]);router['get'](_0x9839('0xb'),auth[_0x9839('0x7')](),controller['getConfigurations']);router[_0x9839('0x6')](_0x9839('0xc'),auth[_0x9839('0x7')](),controller[_0x9839('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9839('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9839('0xf')]);router[_0x9839('0x10')](_0x9839('0x9'),auth['isAuthenticated'](),controller[_0x9839('0x11')]);router['delete'](_0x9839('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeb1c=['exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy'];(function(_0x7d3ecc,_0x2aaee5){var _0x3716a3=function(_0x559bc0){while(--_0x559bc0){_0x7d3ecc['push'](_0x7d3ecc['shift']());}};_0x3716a3(++_0x2aaee5);}(_0xeb1c,0x161));var _0xceb1=function(_0x43a484,_0x5a30db){_0x43a484=_0x43a484-0x0;var _0x2d7b73=_0xeb1c[_0x43a484];return _0x2d7b73;};'use strict';var multer=require('multer');var util=require(_0xceb1('0x0'));var path=require(_0xceb1('0x1'));var timeout=require(_0xceb1('0x2'));var express=require(_0xceb1('0x3'));var router=express[_0xceb1('0x4')]();var fs_extra=require(_0xceb1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xceb1('0x6'));var controller=require('./intDynamics365Account.controller');router[_0xceb1('0x7')]('/',auth['isAuthenticated'](),controller[_0xceb1('0x8')]);router[_0xceb1('0x7')](_0xceb1('0x9'),auth[_0xceb1('0xa')](),controller['show']);router[_0xceb1('0x7')](_0xceb1('0xb'),auth[_0xceb1('0xa')](),controller[_0xceb1('0xc')]);router[_0xceb1('0x7')](_0xceb1('0xd'),auth[_0xceb1('0xa')](),controller[_0xceb1('0xe')]);router[_0xceb1('0xf')]('/',auth[_0xceb1('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0xceb1('0xa')](),controller[_0xceb1('0x10')]);router[_0xceb1('0x11')](_0xceb1('0x9'),auth['isAuthenticated'](),controller[_0xceb1('0x12')]);router[_0xceb1('0x13')](_0xceb1('0x9'),auth[_0xceb1('0xa')](),controller[_0xceb1('0x14')]);module[_0xceb1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 71f508d..9a0c0ea 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa990=['exports','STRING'];(function(_0x384b51,_0x1a83b2){var _0x4e9102=function(_0xaab14){while(--_0xaab14){_0x384b51['push'](_0x384b51['shift']());}};_0x4e9102(++_0x1a83b2);}(_0xa990,0x1d8));var _0x0a99=function(_0x10fb07,_0xa5bcef){_0x10fb07=_0x10fb07-0x0;var _0x43389f=_0xa990[_0x10fb07];return _0x43389f;};'use strict';var Sequelize=require('sequelize');module[_0x0a99('0x0')]={'name':{'type':Sequelize[_0x0a99('0x1')]},'username':{'type':Sequelize[_0x0a99('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a99('0x1')]},'tenantId':{'type':Sequelize[_0x0a99('0x1')]},'clientId':{'type':Sequelize[_0x0a99('0x1')]},'clientSecret':{'type':Sequelize[_0x0a99('0x1')]},'serverUrl':{'type':Sequelize[_0x0a99('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0a99('0x1')]}}; \ No newline at end of file +var _0x6d78=['exports','STRING','sequelize'];(function(_0x282a0d,_0x268c5e){var _0xdda2fa=function(_0x40ce13){while(--_0x40ce13){_0x282a0d['push'](_0x282a0d['shift']());}};_0xdda2fa(++_0x268c5e);}(_0x6d78,0x1f1));var _0x86d7=function(_0x315969,_0x24d244){_0x315969=_0x315969-0x0;var _0x162bec=_0x6d78[_0x315969];return _0x162bec;};'use strict';var Sequelize=require(_0x86d7('0x0'));module[_0x86d7('0x1')]={'name':{'type':Sequelize[_0x86d7('0x2')]},'username':{'type':Sequelize[_0x86d7('0x2')]},'password':{'type':Sequelize[_0x86d7('0x2')]},'remoteUri':{'type':Sequelize[_0x86d7('0x2')]},'tenantId':{'type':Sequelize[_0x86d7('0x2')]},'clientId':{'type':Sequelize[_0x86d7('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x86d7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x86d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5664778..d0a87f3 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x295f=['Dynamics365Account','includeAll','include','rows','catch','show','params','keys','intersection','length','find','create','body','findOne','Dynamics365Configuration','rawAttributes','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','@odata.type','push','all','isNil','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options'];(function(_0x14c740,_0x185293){var _0x1e9a4c=function(_0x2c322d){while(--_0x2c322d){_0x14c740['push'](_0x14c740['shift']());}};_0x1e9a4c(++_0x185293);}(_0x295f,0x168));var _0xf295=function(_0x1695f2,_0x4784cd){_0x1695f2=_0x1695f2-0x0;var _0x3e55dd=_0x295f[_0x1695f2];return _0x3e55dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf295('0x0'));var zipdir=require(_0xf295('0x1'));var jsonpatch=require(_0xf295('0x2'));var rp=require('request-promise');var moment=require(_0xf295('0x3'));var BPromise=require(_0xf295('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf295('0x5'));var sox=require(_0xf295('0x6'));var csv=require(_0xf295('0x7'));var ejs=require(_0xf295('0x8'));var fs=require('fs');var fs_extra=require(_0xf295('0x9'));var _=require('lodash');var squel=require(_0xf295('0xa'));var crypto=require(_0xf295('0xb'));var jsforce=require(_0xf295('0xc'));var deskjs=require(_0xf295('0xd'));var toCsv=require(_0xf295('0x7'));var querystring=require(_0xf295('0xe'));var Papa=require(_0xf295('0xf'));var Redis=require(_0xf295('0x10'));var authService=require(_0xf295('0x11'));var qs=require(_0xf295('0x12'));var as=require(_0xf295('0x13'));var hardwareService=require(_0xf295('0x14'));var logger=require('../../config/logger')(_0xf295('0x15'));var utils=require(_0xf295('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf295('0x17'));var db=require(_0xf295('0x18'))['db'];var integrations=require(_0xf295('0x19'));function respondWithStatusCode(_0x416d04,_0x11063a){_0x11063a=_0x11063a||0xcc;return function(_0x50c4ba){if(_0x50c4ba){return _0x416d04[_0xf295('0x1a')](_0x11063a);}return _0x416d04[_0xf295('0x1b')](_0x11063a)[_0xf295('0x1c')]();};}function respondWithResult(_0x3f0981,_0x1724d0){_0x1724d0=_0x1724d0||0xc8;return function(_0x6267ce){if(_0x6267ce){return _0x3f0981[_0xf295('0x1b')](_0x1724d0)[_0xf295('0x1d')](_0x6267ce);}};}function respondWithFilteredResult(_0x11f3b0,_0x1d31e6){return function(_0xa42735){if(_0xa42735){var _0x42d8c8=typeof _0x1d31e6['offset']==='undefined'&&typeof _0x1d31e6[_0xf295('0x1e')]===_0xf295('0x1f');var _0x58d1a3=_0xa42735[_0xf295('0x20')];var _0x5d18e1=_0x42d8c8?0x0:_0x1d31e6[_0xf295('0x21')];var _0x4deacb=_0x42d8c8?_0xa42735['count']:_0x1d31e6[_0xf295('0x21')]+_0x1d31e6[_0xf295('0x1e')];var _0x4dca5d;if(_0x4deacb>=_0x58d1a3){_0x4deacb=_0x58d1a3;_0x4dca5d=0xc8;}else{_0x4dca5d=0xce;}_0x11f3b0['status'](_0x4dca5d);return _0x11f3b0[_0xf295('0x22')](_0xf295('0x23'),_0x5d18e1+'-'+_0x4deacb+'/'+_0x58d1a3)[_0xf295('0x1d')](_0xa42735);}return null;};}function patchUpdates(_0x28fa70){return function(_0x476db5){try{jsonpatch[_0xf295('0x24')](_0x476db5,_0x28fa70,!![]);}catch(_0x50ad96){return BPromise['reject'](_0x50ad96);}return _0x476db5[_0xf295('0x25')]();};}function saveUpdates(_0x5154b0,_0x2ef08a){return function(_0x39dc96){if(_0x39dc96){return _0x39dc96[_0xf295('0x26')](_0x5154b0)['then'](function(_0x3c1be4){return _0x3c1be4;});}return null;};}function removeEntity(_0x2e079e,_0x493aed){return function(_0x250939){if(_0x250939){return _0x250939[_0xf295('0x27')]()[_0xf295('0x28')](function(){_0x2e079e[_0xf295('0x1b')](0xcc)[_0xf295('0x1c')]();});}};}function handleEntityNotFound(_0x490cc3,_0x615ded){return function(_0x90d6e5){if(!_0x90d6e5){_0x490cc3['sendStatus'](0x194);}return _0x90d6e5;};}function handleError(_0x4b7850,_0x1ba1dd){_0x1ba1dd=_0x1ba1dd||0x1f4;return function(_0x74d71f){logger[_0xf295('0x29')](_0x74d71f[_0xf295('0x2a')]);if(_0x74d71f[_0xf295('0x2b')]){delete _0x74d71f[_0xf295('0x2b')];}_0x4b7850[_0xf295('0x1b')](_0x1ba1dd)[_0xf295('0x2c')](_0x74d71f);};}exports[_0xf295('0x2d')]=function(_0x5dae12,_0x1f5a89){var _0x19ec3a={},_0x2d98bd={},_0x41aa44={'count':0x0,'rows':[]};var _0x46cc58=_[_0xf295('0x2e')](db['Dynamics365Account']['rawAttributes'],function(_0x50a7b7){return{'name':_0x50a7b7['fieldName'],'type':_0x50a7b7['type'][_0xf295('0x2f')]};});_0x2d98bd[_0xf295('0x30')]=_[_0xf295('0x2e')](_0x46cc58,'name');_0x2d98bd[_0xf295('0x31')]=_['keys'](_0x5dae12[_0xf295('0x31')]);_0x2d98bd['filters']=_['intersection'](_0x2d98bd[_0xf295('0x30')],_0x2d98bd[_0xf295('0x31')]);_0x19ec3a[_0xf295('0x32')]=_['intersection'](_0x2d98bd[_0xf295('0x30')],qs[_0xf295('0x33')](_0x5dae12[_0xf295('0x31')][_0xf295('0x33')]));_0x19ec3a[_0xf295('0x32')]=_0x19ec3a[_0xf295('0x32')]['length']?_0x19ec3a[_0xf295('0x32')]:_0x2d98bd[_0xf295('0x30')];if(!_0x5dae12[_0xf295('0x31')][_0xf295('0x34')](_0xf295('0x35'))){_0x19ec3a['limit']=qs[_0xf295('0x1e')](_0x5dae12[_0xf295('0x31')]['limit']);_0x19ec3a[_0xf295('0x21')]=qs[_0xf295('0x21')](_0x5dae12[_0xf295('0x31')]['offset']);}_0x19ec3a[_0xf295('0x36')]=qs[_0xf295('0x37')](_0x5dae12[_0xf295('0x31')][_0xf295('0x37')]);_0x19ec3a[_0xf295('0x38')]=qs[_0xf295('0x39')](_[_0xf295('0x3a')](_0x5dae12[_0xf295('0x31')],_0x2d98bd[_0xf295('0x39')]),_0x46cc58);if(_0x5dae12[_0xf295('0x31')][_0xf295('0x3b')]){_0x19ec3a[_0xf295('0x38')]=_[_0xf295('0x3c')](_0x19ec3a['where'],{'$or':_[_0xf295('0x2e')](_0x46cc58,function(_0x3f0b45){if(_0x3f0b45[_0xf295('0x3d')]!==_0xf295('0x3e')){var _0x3a746e={};_0x3a746e[_0x3f0b45[_0xf295('0x2b')]]={'$like':'%'+_0x5dae12['query']['filter']+'%'};return _0x3a746e;}})});}_0x19ec3a=_[_0xf295('0x3c')]({},_0x19ec3a,_0x5dae12[_0xf295('0x3f')]);var _0x51c37a={'where':_0x19ec3a['where']};return db[_0xf295('0x40')][_0xf295('0x20')](_0x51c37a)[_0xf295('0x28')](function(_0x57beef){_0x41aa44[_0xf295('0x20')]=_0x57beef;if(_0x5dae12[_0xf295('0x31')][_0xf295('0x41')]){_0x19ec3a[_0xf295('0x42')]=[{'all':!![]}];}return db[_0xf295('0x40')]['findAll'](_0x19ec3a);})[_0xf295('0x28')](function(_0x3fd4be){_0x41aa44[_0xf295('0x43')]=_0x3fd4be;return _0x41aa44;})['then'](respondWithFilteredResult(_0x1f5a89,_0x19ec3a))[_0xf295('0x44')](handleError(_0x1f5a89,null));};exports[_0xf295('0x45')]=function(_0x386422,_0x80fb8a){var _0x4fd3f8={'raw':![],'where':{'id':_0x386422[_0xf295('0x46')]['id']}},_0x5e8bb3={};_0x5e8bb3['model']=_[_0xf295('0x47')](db[_0xf295('0x40')]['rawAttributes']);_0x5e8bb3[_0xf295('0x31')]=_[_0xf295('0x47')](_0x386422[_0xf295('0x31')]);_0x5e8bb3[_0xf295('0x39')]=_[_0xf295('0x48')](_0x5e8bb3[_0xf295('0x30')],_0x5e8bb3[_0xf295('0x31')]);_0x4fd3f8['attributes']=_['intersection'](_0x5e8bb3[_0xf295('0x30')],qs[_0xf295('0x33')](_0x386422[_0xf295('0x31')][_0xf295('0x33')]));_0x4fd3f8[_0xf295('0x32')]=_0x4fd3f8[_0xf295('0x32')][_0xf295('0x49')]?_0x4fd3f8[_0xf295('0x32')]:_0x5e8bb3[_0xf295('0x30')];if(_0x386422[_0xf295('0x31')]['includeAll']){_0x4fd3f8[_0xf295('0x42')]=[{'all':!![]}];}_0x4fd3f8=_['merge']({},_0x4fd3f8,_0x386422[_0xf295('0x3f')]);return db['Dynamics365Account'][_0xf295('0x4a')](_0x4fd3f8)['then'](handleEntityNotFound(_0x80fb8a,null))[_0xf295('0x28')](respondWithResult(_0x80fb8a,null))[_0xf295('0x44')](handleError(_0x80fb8a,null));};exports[_0xf295('0x4b')]=function(_0x5ab7ce,_0xe556ca){return db[_0xf295('0x40')]['create'](_0x5ab7ce[_0xf295('0x4c')],{})['then'](respondWithResult(_0xe556ca,0xc9))[_0xf295('0x44')](handleError(_0xe556ca,null));};exports['update']=function(_0x4beb0d,_0x362dc7){if(_0x4beb0d[_0xf295('0x4c')]['id']){delete _0x4beb0d[_0xf295('0x4c')]['id'];}return db['Dynamics365Account'][_0xf295('0x4a')]({'where':{'id':_0x4beb0d['params']['id']}})[_0xf295('0x28')](handleEntityNotFound(_0x362dc7,null))[_0xf295('0x28')](saveUpdates(_0x4beb0d[_0xf295('0x4c')],null))[_0xf295('0x28')](respondWithResult(_0x362dc7,null))['catch'](handleError(_0x362dc7,null));};exports[_0xf295('0x27')]=function(_0x4987a2,_0x249d95){return db[_0xf295('0x40')][_0xf295('0x4a')]({'where':{'id':_0x4987a2[_0xf295('0x46')]['id']}})['then'](handleEntityNotFound(_0x249d95,null))[_0xf295('0x28')](removeEntity(_0x249d95,null))[_0xf295('0x44')](handleError(_0x249d95,null));};exports['getConfigurations']=function(_0x3e9121,_0x2cee88,_0x37ec22){var _0x56a9ef={};var _0x57525c={};var _0x117952;var _0x3b4d7b;return db[_0xf295('0x40')][_0xf295('0x4d')]({'where':{'id':_0x3e9121['params']['id']}})[_0xf295('0x28')](handleEntityNotFound(_0x2cee88,null))[_0xf295('0x28')](function(_0x5cdc47){if(_0x5cdc47){_0x117952=_0x5cdc47;_0x57525c['model']=_['keys'](db[_0xf295('0x4e')][_0xf295('0x4f')]);_0x57525c[_0xf295('0x31')]=_[_0xf295('0x47')](_0x3e9121[_0xf295('0x31')]);_0x57525c[_0xf295('0x39')]=_[_0xf295('0x48')](_0x57525c[_0xf295('0x30')],_0x57525c[_0xf295('0x31')]);_0x56a9ef[_0xf295('0x32')]=_['intersection'](_0x57525c['model'],qs['fields'](_0x3e9121[_0xf295('0x31')][_0xf295('0x33')]));_0x56a9ef[_0xf295('0x32')]=_0x56a9ef[_0xf295('0x32')][_0xf295('0x49')]?_0x56a9ef[_0xf295('0x32')]:_0x57525c[_0xf295('0x30')];_0x56a9ef['order']=qs['sort'](_0x3e9121[_0xf295('0x31')][_0xf295('0x37')]);_0x56a9ef[_0xf295('0x38')]=qs['filters'](_[_0xf295('0x3a')](_0x3e9121[_0xf295('0x31')],_0x57525c[_0xf295('0x39')]));if(_0x3e9121['query'][_0xf295('0x3b')]){_0x56a9ef['where']=_[_0xf295('0x3c')](_0x56a9ef[_0xf295('0x38')],{'$or':_[_0xf295('0x2e')](_0x56a9ef[_0xf295('0x32')],function(_0x339e84){var _0x669436={};_0x669436[_0x339e84]={'$like':'%'+_0x3e9121[_0xf295('0x31')][_0xf295('0x3b')]+'%'};return _0x669436;})});}_0x56a9ef=_[_0xf295('0x3c')]({},_0x56a9ef,_0x3e9121['options']);return _0x117952['getConfigurations'](_0x56a9ef);}})[_0xf295('0x28')](function(_0x511df3){if(_0x511df3){_0x3b4d7b=_0x511df3[_0xf295('0x49')];if(!_0x3e9121[_0xf295('0x31')][_0xf295('0x34')](_0xf295('0x35'))){_0x56a9ef['limit']=qs['limit'](_0x3e9121[_0xf295('0x31')]['limit']);_0x56a9ef[_0xf295('0x21')]=qs[_0xf295('0x21')](_0x3e9121['query'][_0xf295('0x21')]);}return _0x117952[_0xf295('0x50')](_0x56a9ef);}})[_0xf295('0x28')](function(_0x4aa3c2){if(_0x4aa3c2){return _0x4aa3c2?{'count':_0x3b4d7b,'rows':_0x4aa3c2}:null;}})[_0xf295('0x28')](respondWithResult(_0x2cee88,null))[_0xf295('0x44')](handleError(_0x2cee88,null));};exports[_0xf295('0x51')]=function(_0x14a917,_0x3c037b,_0xa2d5ee){if(_0x14a917[_0xf295('0x4c')]['id']){delete _0x14a917[_0xf295('0x4c')]['id'];}return db[_0xf295('0x40')]['findOne']({'where':{'id':_0x14a917['params']['id']}})[_0xf295('0x28')](handleEntityNotFound(_0x3c037b,null))[_0xf295('0x28')](function(_0xcf3990){if(_0xcf3990){_0x14a917[_0xf295('0x4c')]['AccountId']=_0xcf3990['id'];_0x14a917['body'][_0xf295('0x52')]=integrations[_0xf295('0x53')](_0x14a917[_0xf295('0x4c')][_0xf295('0x54')],_0x14a917[_0xf295('0x4c')][_0xf295('0x3d')]);_0x14a917['body'][_0xf295('0x55')]=integrations[_0xf295('0x56')](_0x14a917[_0xf295('0x4c')]['channel'],_0x14a917[_0xf295('0x4c')][_0xf295('0x3d')]);return db['Dynamics365Configuration'][_0xf295('0x4b')](_0x14a917[_0xf295('0x4c')],{'include':[{'model':db[_0xf295('0x57')],'as':_0xf295('0x52')},{'model':db[_0xf295('0x57')],'as':_0xf295('0x55')}]});}return null;})[_0xf295('0x28')](respondWithResult(_0x3c037b,null))['catch'](handleError(_0x3c037b,null));};exports[_0xf295('0x58')]=function(_0x45347d,_0x37e14b,_0x2a0098){var _0x2b776b=_0x45347d[_0xf295('0x31')]['ticketType'];var _0x523874=_0x2b776b===_0xf295('0x59')?_0xf295('0x5a'):_0xf295('0x5b');var _0x17af87='';var _0x30e3e7='';var _0x200cab='';var _0x469ec0='';var _0x25cb9a='';var _0x40e9c4='';var _0x45f5a6='';var _0x3eb268='';var _0x10c87d=[_0xf295('0x5c'),'description',_0xf295('0x5d'),'ownerid',_0xf295('0x5e'),_0xf295('0x5f'),'phonenumber',_0xf295('0x60'),_0xf295('0x61'),_0xf295('0x62')];var _0x536cbc=[_0xf295('0x63'),_0xf295('0x64'),_0xf295('0x65'),_0xf295('0x66'),_0xf295('0x67'),_0xf295('0x68'),_0xf295('0x69'),_0xf295('0x6a'),_0xf295('0x6b'),_0xf295('0x6c'),_0xf295('0x6d'),_0xf295('0x6e'),_0xf295('0x6f'),_0xf295('0x70'),'createdonbehalfbyyominame',_0xf295('0x71'),_0xf295('0x72'),_0xf295('0x73'),_0xf295('0x74'),'entitlementidname',_0xf295('0x75'),_0xf295('0x76'),_0xf295('0x77'),'exchangerate',_0xf295('0x78'),_0xf295('0x79'),_0xf295('0x7a'),_0xf295('0x7b'),_0xf295('0x7c'),_0xf295('0x7d'),_0xf295('0x7e'),_0xf295('0x7f'),_0xf295('0x80'),_0xf295('0x81'),_0xf295('0x82'),'modifiedon',_0xf295('0x83'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xf295('0x84'),_0xf295('0x85'),'onholdtime',_0xf295('0x86'),_0xf295('0x87'),'owneridtype',_0xf295('0x88'),_0xf295('0x89'),_0xf295('0x8a'),_0xf295('0x8b'),'prioritycodename','productidname',_0xf295('0x8c'),_0xf295('0x8d'),_0xf295('0x8e'),_0xf295('0x8f'),_0xf295('0x90'),_0xf295('0x91'),_0xf295('0x92'),_0xf295('0x93'),_0xf295('0x94'),_0xf295('0x95'),_0xf295('0x96'),_0xf295('0x97'),_0xf295('0x98'),'ticketnumber',_0xf295('0x99'),_0xf295('0x9a'),_0xf295('0x9b'),_0xf295('0x9c'),_0xf295('0x9d')];var _0xad756f=_0x10c87d[_0xf295('0x9e')](_0x536cbc);return db['Dynamics365Account']['findOne']({'where':{'id':_0x45347d[_0xf295('0x46')]['id']},'attributes':['id',_0xf295('0x9f'),_0xf295('0xa0'),_0xf295('0xa1'),_0xf295('0xa2'),_0xf295('0xa3'),'clientSecret']})[_0xf295('0x28')](handleEntityNotFound(_0x37e14b,null))[_0xf295('0x28')](function(_0x368cc8){if(_0x368cc8){_0x3eb268=_0x368cc8[_0xf295('0xa1')];var _0x17779d=_0x3eb268['slice'](-0x1);if(_0x17779d==='/'){_0x3eb268=_0x3eb268[_0xf295('0xa4')](0x0,_0x3eb268[_0xf295('0xa5')](_0x17779d));}_0x45f5a6=util[_0xf295('0xa6')](_0xf295('0xa7'),_0x3eb268);var _0xc1b4fe={'method':'POST','uri':_0xf295('0xa8')+_0x368cc8['tenantId']+_0xf295('0xa9'),'form':{'client_id':_0x368cc8['clientId'],'resource':_0x3eb268,'username':_0x368cc8[_0xf295('0x9f')],'password':_0x368cc8['password'],'grant_type':_0xf295('0xa0'),'client_secret':_0x368cc8[_0xf295('0xaa')]},'json':!![]};return rp(_0xc1b4fe);}})['then'](function(_0x1cf2f6){_0x40e9c4=_0x1cf2f6['access_token'];var _0xe5c447={'method':_0xf295('0xab'),'uri':encodeURI(_0x45f5a6+_0xf295('0xac')+_0x523874+'\x27'),'headers':{'Authorization':_0xf295('0xad')+_0x40e9c4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe5c447);})['then'](function(_0xb7f466){var _0xe4a071=_0xb7f466[_0xf295('0xae')][0x0];var _0x504e91=_0xe4a071[_0xf295('0xaf')];var _0x5a6082={'method':_0xf295('0xab'),'uri':_0x45f5a6+'EntityDefinitions('+_0x504e91+_0xf295('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x40e9c4,'If-None-Match':null,'OData-Version':_0xf295('0xb1')},'json':!![]};return rp(_0x5a6082);})['then'](function(_0x488055){_0x17af87=_0x488055;_0x30e3e7=_0x17af87[_0xf295('0xb2')];_0x30e3e7=_['remove'](_0x30e3e7,function(_0xcaa7ce){return!_0xad756f[_0xf295('0xb3')](_0xcaa7ce[_0xf295('0xb4')]);});var _0x1c9646=[];var _0x2d4aa8=[];_0x30e3e7['forEach'](function(_0x51bebe){if(_0x51bebe[_0xf295('0xb5')]){var _0x1b2c67=_0x51bebe['@odata.type'][_0xf295('0xa4')](_0x51bebe[_0xf295('0xb5')][_0xf295('0xa5')]('.')+0x1);if(_0x1b2c67==='PicklistAttributeMetadata'){_0x1c9646[_0xf295('0xb6')](getSelectList(_0x45f5a6,_0x2b776b,_0x2d4aa8,_0x17af87['MetadataId'],_0x51bebe[_0xf295('0xaf')],_0x40e9c4));}}});return Promise[_0xf295('0xb7')](_0x1c9646);})[_0xf295('0x28')](function(_0x2f6332){_0x200cab=_0x2f6332[0x0];var _0x1ab7be=[];var _0x41bc00=[];_0x30e3e7['forEach'](function(_0x274d7a){if(!_[_0xf295('0xb8')](_0x274d7a['@odata.type'])){var _0x394860=_0x274d7a[_0xf295('0xb5')][_0xf295('0xa4')](_0x274d7a[_0xf295('0xb5')][_0xf295('0xa5')]('.')+0x1);if(_0x394860===_0xf295('0xb9')){_0x1ab7be[_0xf295('0xb6')](getBooleanList(_0x45f5a6,_0x2b776b,_0x41bc00,_0x17af87[_0xf295('0xaf')],_0x274d7a['MetadataId'],_0x40e9c4));}}});return Promise[_0xf295('0xb7')](_0x1ab7be);})['then'](function(_0x560031){_0x469ec0=_0x560031[0x0];var _0x2b2715=[];var _0x1b7da2=[];_0x30e3e7[_0xf295('0xba')](function(_0x134536){if(_0x134536[_0xf295('0xb5')]){var _0x2107da=_0x134536[_0xf295('0xb5')][_0xf295('0xa4')](_0x134536[_0xf295('0xb5')]['lastIndexOf']('.')+0x1);if(_0x2107da===_0xf295('0xbb')||_0x2107da===_0xf295('0xbc')||_0x2107da==='BigIntAttributeMetadata'||_0x2107da===_0xf295('0xbd')||_0x2107da===_0xf295('0xbe')||_0x2107da==='DateTimeAttributeMetadata'||_0x2107da===_0xf295('0xbf')||_0x2107da==='EntityNameAttributeMetadata'||_0x2107da===_0xf295('0xc0')||_0x2107da===_0xf295('0xc1')){_0x2b2715[_0xf295('0xb6')](getInputList(_0x45f5a6,_0x2b776b,_0x2107da,_0x1b7da2,_0x17af87[_0xf295('0xaf')],_0x134536['MetadataId'],_0x40e9c4));}}});return Promise[_0xf295('0xb7')](_0x2b2715);})[_0xf295('0x28')](function(_0x4a8ead){_0x25cb9a=_0x4a8ead[0x0];var _0x45c95d=_0x200cab[_0xf295('0x9e')](_0x469ec0)[_0xf295('0x9e')](_0x25cb9a);var _0x4ba5bf={'count':_0x45c95d[_0xf295('0x49')],'rows':_0x45c95d};return _0x4ba5bf;})['then'](respondWithResult(_0x37e14b,null))['catch'](function(_0x54367b){var _0x4537ba=_0x45347d[_0xf295('0x31')][_0xf295('0xc2')]?0x1f4:_0x54367b['statusCode']||0x1f4;logger[_0xf295('0x29')](_0x54367b['stack']);delete _0x54367b[_0xf295('0x2b')];if(_0x4537ba===0x191){_0x4537ba=0x190;}_0x37e14b[_0xf295('0x1b')](_0x4537ba)[_0xf295('0x2c')](_0x45347d[_0xf295('0x31')]['test']?{'message':_0xf295('0xc3'),'statusCode':_0x54367b['statusCode']}:_0x54367b);});};function getSelectList(_0x26857b,_0x46e97c,_0x5a93c6,_0xcb1492,_0x9f1720,_0x58de8f){var _0x58ff97={'method':_0xf295('0xab'),'uri':_0x26857b+_0xf295('0xc4')+_0xcb1492+_0xf295('0xc5')+_0x9f1720+_0xf295('0xc6')+_0xf295('0xc7'),'headers':{'Authorization':_0xf295('0xad')+_0x58de8f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x58ff97)[_0xf295('0x28')](function(_0x5702f7){var _0x112019=[];var _0x24530d=_0x5702f7[_0xf295('0xc8')][_0xf295('0xc9')];_0x24530d['forEach'](function(_0x2cce52){_0x112019[_0xf295('0xb6')]({'name':_0x2cce52[_0xf295('0xca')][_0xf295('0xcb')]['Label'],'value':String(_0x2cce52[_0xf295('0xcc')])});});var _0x1f8309={'id':_0x46e97c+'_'+_0x5702f7[_0xf295('0xb4')],'name':_0x5702f7[_0xf295('0xcd')]['UserLocalizedLabel'][_0xf295('0xca')],'custom':![],'options':_0x112019};_0x5a93c6[_0xf295('0xb6')](_0x1f8309);return _0x5a93c6;});}function getBooleanList(_0x25612d,_0x1b2621,_0x5e732f,_0x492353,_0x7f6c8b,_0x14363d){var _0x13e582={'method':_0xf295('0xab'),'uri':_0x25612d+_0xf295('0xc4')+_0x492353+_0xf295('0xc5')+_0x7f6c8b+_0xf295('0xce'),'headers':{'Authorization':'Bearer\x20'+_0x14363d,'If-None-Match':null,'OData-Version':_0xf295('0xb1')},'json':!![]};return rp(_0x13e582)['then'](function(_0x3cbc36){var _0x9a5ded=[];_0x9a5ded[_0xf295('0xb6')]({'name':_0x3cbc36['OptionSet'][_0xf295('0xcf')][_0xf295('0xca')][_0xf295('0xcb')][_0xf295('0xca')],'value':'true'},{'name':_0x3cbc36[_0xf295('0xc8')][_0xf295('0xd0')][_0xf295('0xca')][_0xf295('0xcb')][_0xf295('0xca')],'value':_0xf295('0xd1')});var _0x2cc776={'id':_0x1b2621+'_'+_0x3cbc36[_0xf295('0xb4')],'name':_0x3cbc36[_0xf295('0xcd')][_0xf295('0xcb')][_0xf295('0xca')],'custom':![],'options':_0x9a5ded};_0x5e732f['push'](_0x2cc776);return _0x5e732f;});}function getInputList(_0xe6d6ff,_0x5589e6,_0x4f7c6f,_0x4acd0b,_0x292d1c,_0x3fe622,_0x7ba965){var _0x4e3890={'method':_0xf295('0xab'),'uri':_0xe6d6ff+_0xf295('0xc4')+_0x292d1c+_0xf295('0xc5')+_0x3fe622+_0xf295('0xd2')+_0x4f7c6f+_0xf295('0xd3'),'headers':{'Authorization':_0xf295('0xad')+_0x7ba965,'If-None-Match':null,'OData-Version':_0xf295('0xb1')},'json':!![]};return rp(_0x4e3890)[_0xf295('0x28')](function(_0x1b41df){var _0x793b93={'id':_0x5589e6+'_'+_0x1b41df[_0xf295('0xb4')],'name':_0x1b41df[_0xf295('0xcd')][_0xf295('0xcb')]?_0x1b41df['DisplayName'][_0xf295('0xcb')][_0xf295('0xca')]:_0x1b41df[_0xf295('0xb4')],'custom':![],'options':[]};_0x4acd0b['push'](_0x793b93);return _0x4acd0b;});} \ No newline at end of file +var _0x3de0=['Dynamics365Field','Subjects','getFields','Incident','PhoneCall','title','description','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','push','isNil','BooleanAttributeMetadata','all','DoubleAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','reject','then','destroy','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','Dynamics365Account','findAll','catch','show','params','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x439811,_0x19f443){var _0x54a93a=function(_0x4a9a8f){while(--_0x4a9a8f){_0x439811['push'](_0x439811['shift']());}};_0x54a93a(++_0x19f443);}(_0x3de0,0x143));var _0x03de=function(_0x11bebb,_0x4a240a){_0x11bebb=_0x11bebb-0x0;var _0x5ba0f1=_0x3de0[_0x11bebb];return _0x5ba0f1;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x12'))(_0x03de('0x13'));var utils=require('../../config/utils');var config=require(_0x03de('0x14'));var licenseUtil=require(_0x03de('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x03de('0x16'));function respondWithStatusCode(_0x10ab8b,_0x40dd5d){_0x40dd5d=_0x40dd5d||0xcc;return function(_0x341e6a){if(_0x341e6a){return _0x10ab8b[_0x03de('0x17')](_0x40dd5d);}return _0x10ab8b['status'](_0x40dd5d)[_0x03de('0x18')]();};}function respondWithResult(_0x1b467e,_0x14d19c){_0x14d19c=_0x14d19c||0xc8;return function(_0x4064a8){if(_0x4064a8){return _0x1b467e['status'](_0x14d19c)[_0x03de('0x19')](_0x4064a8);}};}function respondWithFilteredResult(_0xedbc6b,_0x1aa88d){return function(_0x45881e){if(_0x45881e){var _0x45fe9e=typeof _0x1aa88d[_0x03de('0x1a')]===_0x03de('0x1b')&&typeof _0x1aa88d[_0x03de('0x1c')]===_0x03de('0x1b');var _0x54556d=_0x45881e['count'];var _0x3e9198=_0x45fe9e?0x0:_0x1aa88d[_0x03de('0x1a')];var _0x9b0ede=_0x45fe9e?_0x45881e['count']:_0x1aa88d[_0x03de('0x1a')]+_0x1aa88d[_0x03de('0x1c')];var _0x32cb0e;if(_0x9b0ede>=_0x54556d){_0x9b0ede=_0x54556d;_0x32cb0e=0xc8;}else{_0x32cb0e=0xce;}_0xedbc6b[_0x03de('0x1d')](_0x32cb0e);return _0xedbc6b[_0x03de('0x1e')](_0x03de('0x1f'),_0x3e9198+'-'+_0x9b0ede+'/'+_0x54556d)[_0x03de('0x19')](_0x45881e);}return null;};}function patchUpdates(_0x5cb66b){return function(_0x49b932){try{jsonpatch['apply'](_0x49b932,_0x5cb66b,!![]);}catch(_0x29686b){return BPromise[_0x03de('0x20')](_0x29686b);}return _0x49b932['save']();};}function saveUpdates(_0x12337f,_0x4447d7){return function(_0xebbd43){if(_0xebbd43){return _0xebbd43['update'](_0x12337f)[_0x03de('0x21')](function(_0x396a57){return _0x396a57;});}return null;};}function removeEntity(_0x5f2317,_0x13fb22){return function(_0x37b44f){if(_0x37b44f){return _0x37b44f[_0x03de('0x22')]()[_0x03de('0x21')](function(){_0x5f2317[_0x03de('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf54687,_0x13ab64){return function(_0x20bea7){if(!_0x20bea7){_0xf54687[_0x03de('0x17')](0x194);}return _0x20bea7;};}function handleError(_0x5a9631,_0x14e785){_0x14e785=_0x14e785||0x1f4;return function(_0x28416a){logger['error'](_0x28416a['stack']);if(_0x28416a[_0x03de('0x23')]){delete _0x28416a[_0x03de('0x23')];}_0x5a9631['status'](_0x14e785)['send'](_0x28416a);};}exports[_0x03de('0x24')]=function(_0x17463b,_0x514232){var _0x405c25={},_0x270b75={},_0x25f7bf={'count':0x0,'rows':[]};var _0x2c4e16=_['map'](db['Dynamics365Account'][_0x03de('0x25')],function(_0xfe302d){return{'name':_0xfe302d[_0x03de('0x26')],'type':_0xfe302d[_0x03de('0x27')][_0x03de('0x28')]};});_0x270b75[_0x03de('0x29')]=_['map'](_0x2c4e16,_0x03de('0x23'));_0x270b75[_0x03de('0x2a')]=_[_0x03de('0x2b')](_0x17463b[_0x03de('0x2a')]);_0x270b75[_0x03de('0x2c')]=_[_0x03de('0x2d')](_0x270b75['model'],_0x270b75[_0x03de('0x2a')]);_0x405c25[_0x03de('0x2e')]=_['intersection'](_0x270b75[_0x03de('0x29')],qs[_0x03de('0x2f')](_0x17463b[_0x03de('0x2a')][_0x03de('0x2f')]));_0x405c25['attributes']=_0x405c25[_0x03de('0x2e')][_0x03de('0x30')]?_0x405c25[_0x03de('0x2e')]:_0x270b75[_0x03de('0x29')];if(!_0x17463b['query'][_0x03de('0x31')](_0x03de('0x32'))){_0x405c25[_0x03de('0x1c')]=qs['limit'](_0x17463b[_0x03de('0x2a')][_0x03de('0x1c')]);_0x405c25[_0x03de('0x1a')]=qs[_0x03de('0x1a')](_0x17463b[_0x03de('0x2a')][_0x03de('0x1a')]);}_0x405c25[_0x03de('0x33')]=qs['sort'](_0x17463b[_0x03de('0x2a')][_0x03de('0x34')]);_0x405c25['where']=qs['filters'](_[_0x03de('0x35')](_0x17463b[_0x03de('0x2a')],_0x270b75[_0x03de('0x2c')]),_0x2c4e16);if(_0x17463b[_0x03de('0x2a')][_0x03de('0x36')]){_0x405c25[_0x03de('0x37')]=_[_0x03de('0x38')](_0x405c25[_0x03de('0x37')],{'$or':_[_0x03de('0x39')](_0x2c4e16,function(_0x269158){if(_0x269158[_0x03de('0x27')]!==_0x03de('0x3a')){var _0x5ce2={};_0x5ce2[_0x269158[_0x03de('0x23')]]={'$like':'%'+_0x17463b[_0x03de('0x2a')][_0x03de('0x36')]+'%'};return _0x5ce2;}})});}_0x405c25=_[_0x03de('0x38')]({},_0x405c25,_0x17463b[_0x03de('0x3b')]);var _0x3f6373={'where':_0x405c25[_0x03de('0x37')]};return db['Dynamics365Account'][_0x03de('0x3c')](_0x3f6373)[_0x03de('0x21')](function(_0x5b13ae){_0x25f7bf[_0x03de('0x3c')]=_0x5b13ae;if(_0x17463b[_0x03de('0x2a')][_0x03de('0x3d')]){_0x405c25[_0x03de('0x3e')]=[{'all':!![]}];}return db[_0x03de('0x3f')][_0x03de('0x40')](_0x405c25);})[_0x03de('0x21')](function(_0x12dc8b){_0x25f7bf['rows']=_0x12dc8b;return _0x25f7bf;})[_0x03de('0x21')](respondWithFilteredResult(_0x514232,_0x405c25))[_0x03de('0x41')](handleError(_0x514232,null));};exports[_0x03de('0x42')]=function(_0x1b62ee,_0x373db0){var _0x42dfd0={'raw':![],'where':{'id':_0x1b62ee[_0x03de('0x43')]['id']}},_0x1a2f94={};_0x1a2f94['model']=_[_0x03de('0x2b')](db['Dynamics365Account']['rawAttributes']);_0x1a2f94[_0x03de('0x2a')]=_[_0x03de('0x2b')](_0x1b62ee[_0x03de('0x2a')]);_0x1a2f94['filters']=_['intersection'](_0x1a2f94[_0x03de('0x29')],_0x1a2f94[_0x03de('0x2a')]);_0x42dfd0[_0x03de('0x2e')]=_[_0x03de('0x2d')](_0x1a2f94['model'],qs[_0x03de('0x2f')](_0x1b62ee['query'][_0x03de('0x2f')]));_0x42dfd0[_0x03de('0x2e')]=_0x42dfd0[_0x03de('0x2e')][_0x03de('0x30')]?_0x42dfd0[_0x03de('0x2e')]:_0x1a2f94[_0x03de('0x29')];if(_0x1b62ee['query'][_0x03de('0x3d')]){_0x42dfd0['include']=[{'all':!![]}];}_0x42dfd0=_[_0x03de('0x38')]({},_0x42dfd0,_0x1b62ee['options']);return db[_0x03de('0x3f')][_0x03de('0x44')](_0x42dfd0)[_0x03de('0x21')](handleEntityNotFound(_0x373db0,null))['then'](respondWithResult(_0x373db0,null))['catch'](handleError(_0x373db0,null));};exports[_0x03de('0x45')]=function(_0x1bd748,_0x3f94e1){return db[_0x03de('0x3f')][_0x03de('0x45')](_0x1bd748[_0x03de('0x46')],{})[_0x03de('0x21')](respondWithResult(_0x3f94e1,0xc9))['catch'](handleError(_0x3f94e1,null));};exports[_0x03de('0x47')]=function(_0x1b6c6e,_0x5f05e2){if(_0x1b6c6e[_0x03de('0x46')]['id']){delete _0x1b6c6e[_0x03de('0x46')]['id'];}return db['Dynamics365Account'][_0x03de('0x44')]({'where':{'id':_0x1b6c6e[_0x03de('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f05e2,null))[_0x03de('0x21')](saveUpdates(_0x1b6c6e['body'],null))['then'](respondWithResult(_0x5f05e2,null))[_0x03de('0x41')](handleError(_0x5f05e2,null));};exports[_0x03de('0x22')]=function(_0x2434bd,_0x17e6f5){return db[_0x03de('0x3f')]['find']({'where':{'id':_0x2434bd['params']['id']}})[_0x03de('0x21')](handleEntityNotFound(_0x17e6f5,null))['then'](removeEntity(_0x17e6f5,null))['catch'](handleError(_0x17e6f5,null));};exports[_0x03de('0x48')]=function(_0x59949a,_0x2cbe67,_0x237d50){var _0x27f531={};var _0x5c0a29={};var _0x24edb2;var _0x1f6683;return db['Dynamics365Account'][_0x03de('0x49')]({'where':{'id':_0x59949a[_0x03de('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cbe67,null))[_0x03de('0x21')](function(_0x56a6e3){if(_0x56a6e3){_0x24edb2=_0x56a6e3;_0x5c0a29[_0x03de('0x29')]=_[_0x03de('0x2b')](db[_0x03de('0x4a')][_0x03de('0x25')]);_0x5c0a29[_0x03de('0x2a')]=_[_0x03de('0x2b')](_0x59949a[_0x03de('0x2a')]);_0x5c0a29[_0x03de('0x2c')]=_['intersection'](_0x5c0a29['model'],_0x5c0a29[_0x03de('0x2a')]);_0x27f531[_0x03de('0x2e')]=_[_0x03de('0x2d')](_0x5c0a29['model'],qs[_0x03de('0x2f')](_0x59949a[_0x03de('0x2a')]['fields']));_0x27f531['attributes']=_0x27f531[_0x03de('0x2e')]['length']?_0x27f531[_0x03de('0x2e')]:_0x5c0a29[_0x03de('0x29')];_0x27f531[_0x03de('0x33')]=qs['sort'](_0x59949a[_0x03de('0x2a')][_0x03de('0x34')]);_0x27f531['where']=qs[_0x03de('0x2c')](_[_0x03de('0x35')](_0x59949a[_0x03de('0x2a')],_0x5c0a29['filters']));if(_0x59949a[_0x03de('0x2a')]['filter']){_0x27f531[_0x03de('0x37')]=_[_0x03de('0x38')](_0x27f531[_0x03de('0x37')],{'$or':_[_0x03de('0x39')](_0x27f531[_0x03de('0x2e')],function(_0x4d64c4){var _0x243c38={};_0x243c38[_0x4d64c4]={'$like':'%'+_0x59949a['query'][_0x03de('0x36')]+'%'};return _0x243c38;})});}_0x27f531=_['merge']({},_0x27f531,_0x59949a[_0x03de('0x3b')]);return _0x24edb2['getConfigurations'](_0x27f531);}})[_0x03de('0x21')](function(_0x355c5e){if(_0x355c5e){_0x1f6683=_0x355c5e[_0x03de('0x30')];if(!_0x59949a['query'][_0x03de('0x31')](_0x03de('0x32'))){_0x27f531['limit']=qs[_0x03de('0x1c')](_0x59949a['query'][_0x03de('0x1c')]);_0x27f531[_0x03de('0x1a')]=qs[_0x03de('0x1a')](_0x59949a['query']['offset']);}return _0x24edb2[_0x03de('0x48')](_0x27f531);}})[_0x03de('0x21')](function(_0x24e29c){if(_0x24e29c){return _0x24e29c?{'count':_0x1f6683,'rows':_0x24e29c}:null;}})[_0x03de('0x21')](respondWithResult(_0x2cbe67,null))[_0x03de('0x41')](handleError(_0x2cbe67,null));};exports[_0x03de('0x4b')]=function(_0xa517f2,_0x4ac564,_0x49a775){if(_0xa517f2['body']['id']){delete _0xa517f2[_0x03de('0x46')]['id'];}return db[_0x03de('0x3f')]['findOne']({'where':{'id':_0xa517f2[_0x03de('0x43')]['id']}})[_0x03de('0x21')](handleEntityNotFound(_0x4ac564,null))[_0x03de('0x21')](function(_0x480890){if(_0x480890){_0xa517f2[_0x03de('0x46')][_0x03de('0x4c')]=_0x480890['id'];_0xa517f2[_0x03de('0x46')]['Subjects']=integrations[_0x03de('0x4d')](_0xa517f2[_0x03de('0x46')][_0x03de('0x4e')],_0xa517f2[_0x03de('0x46')][_0x03de('0x27')]);_0xa517f2['body'][_0x03de('0x4f')]=integrations[_0x03de('0x50')](_0xa517f2[_0x03de('0x46')][_0x03de('0x4e')],_0xa517f2['body']['type']);return db['Dynamics365Configuration'][_0x03de('0x45')](_0xa517f2['body'],{'include':[{'model':db[_0x03de('0x51')],'as':_0x03de('0x52')},{'model':db[_0x03de('0x51')],'as':'Descriptions'}]});}return null;})[_0x03de('0x21')](respondWithResult(_0x4ac564,null))[_0x03de('0x41')](handleError(_0x4ac564,null));};exports[_0x03de('0x53')]=function(_0x22e8df,_0x502b87,_0x20b6b1){var _0x25815a=_0x22e8df['query']['ticketType'];var _0x5a1f1e=_0x25815a==='incident'?_0x03de('0x54'):_0x03de('0x55');var _0x5b199a='';var _0x1a0336='';var _0x20db51='';var _0x59c876='';var _0x11190c='';var _0x2a8650='';var _0x5e17e0='';var _0x4ac1a9='';var _0x45abbd=[_0x03de('0x56'),_0x03de('0x57'),'customerid','ownerid','caseorigincode',_0x03de('0x58'),_0x03de('0x59'),_0x03de('0x5a'),_0x03de('0x5b'),_0x03de('0x5c')];var _0x3a6824=[_0x03de('0x5d'),_0x03de('0x5e'),'actualserviceunits',_0x03de('0x5f'),_0x03de('0x60'),_0x03de('0x61'),_0x03de('0x62'),_0x03de('0x63'),_0x03de('0x64'),_0x03de('0x65'),_0x03de('0x66'),_0x03de('0x67'),_0x03de('0x68'),'createdonbehalfbyname',_0x03de('0x69'),'customeridname',_0x03de('0x6a'),_0x03de('0x6b'),_0x03de('0x6c'),_0x03de('0x6d'),'entityimage_timestamp',_0x03de('0x6e'),'escalatedon',_0x03de('0x6f'),_0x03de('0x70'),_0x03de('0x71'),_0x03de('0x72'),_0x03de('0x73'),_0x03de('0x74'),_0x03de('0x75'),_0x03de('0x76'),'modifiedbyexternalpartyname',_0x03de('0x77'),_0x03de('0x78'),_0x03de('0x79'),'modifiedon',_0x03de('0x7a'),_0x03de('0x7b'),_0x03de('0x7c'),'msdyn_iotalertname',_0x03de('0x7d'),_0x03de('0x7e'),_0x03de('0x7f'),_0x03de('0x80'),_0x03de('0x81'),_0x03de('0x82'),'parentcaseidname',_0x03de('0x83'),'primarycontactidyominame','prioritycodename',_0x03de('0x84'),_0x03de('0x85'),_0x03de('0x86'),_0x03de('0x87'),'responseby',_0x03de('0x88'),'responsiblecontactidyominame','sentimentvalue',_0x03de('0x89'),_0x03de('0x8a'),_0x03de('0x8b'),_0x03de('0x8c'),_0x03de('0x8d'),_0x03de('0x8e'),'ticketnumber',_0x03de('0x8f'),_0x03de('0x90'),'traversedpath','utcconversiontimezonecode',_0x03de('0x91')];var _0x3ec9ab=_0x45abbd[_0x03de('0x92')](_0x3a6824);return db[_0x03de('0x3f')][_0x03de('0x49')]({'where':{'id':_0x22e8df['params']['id']},'attributes':['id',_0x03de('0x93'),_0x03de('0x94'),_0x03de('0x95'),_0x03de('0x96'),_0x03de('0x97'),_0x03de('0x98')]})[_0x03de('0x21')](handleEntityNotFound(_0x502b87,null))[_0x03de('0x21')](function(_0x356608){if(_0x356608){_0x4ac1a9=_0x356608[_0x03de('0x95')];var _0x1c3184=_0x4ac1a9[_0x03de('0x99')](-0x1);if(_0x1c3184==='/'){_0x4ac1a9=_0x4ac1a9['substring'](0x0,_0x4ac1a9[_0x03de('0x9a')](_0x1c3184));}_0x5e17e0=util['format'](_0x03de('0x9b'),_0x4ac1a9);var _0x1a9459={'method':_0x03de('0x9c'),'uri':_0x03de('0x9d')+_0x356608['tenantId']+_0x03de('0x9e'),'form':{'client_id':_0x356608[_0x03de('0x97')],'resource':_0x4ac1a9,'username':_0x356608['username'],'password':_0x356608[_0x03de('0x94')],'grant_type':_0x03de('0x94'),'client_secret':_0x356608[_0x03de('0x98')]},'json':!![]};return rp(_0x1a9459);}})[_0x03de('0x21')](function(_0x5d9778){_0x2a8650=_0x5d9778['access_token'];var _0x510953={'method':_0x03de('0x9f'),'uri':encodeURI(_0x5e17e0+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5a1f1e+'\x27'),'headers':{'Authorization':_0x03de('0xa0')+_0x2a8650,'If-None-Match':null,'OData-Version':_0x03de('0xa1')},'json':!![]};return rp(_0x510953);})['then'](function(_0x267232){var _0x52bcd6=_0x267232[_0x03de('0xa2')][0x0];var _0x148cb9=_0x52bcd6[_0x03de('0xa3')];var _0x497c32={'method':_0x03de('0x9f'),'uri':_0x5e17e0+_0x03de('0xa4')+_0x148cb9+_0x03de('0xa5'),'headers':{'Authorization':_0x03de('0xa0')+_0x2a8650,'If-None-Match':null,'OData-Version':_0x03de('0xa1')},'json':!![]};return rp(_0x497c32);})[_0x03de('0x21')](function(_0x6e58a4){_0x5b199a=_0x6e58a4;_0x1a0336=_0x5b199a[_0x03de('0xa6')];_0x1a0336=_[_0x03de('0xa7')](_0x1a0336,function(_0x158d6b){return!_0x3ec9ab[_0x03de('0xa8')](_0x158d6b['LogicalName']);});var _0x3ad2f5=[];var _0x2b85eb=[];_0x1a0336[_0x03de('0xa9')](function(_0x124c76){if(_0x124c76['@odata.type']){var _0x155188=_0x124c76[_0x03de('0xaa')][_0x03de('0xab')](_0x124c76[_0x03de('0xaa')][_0x03de('0x9a')]('.')+0x1);if(_0x155188==='PicklistAttributeMetadata'){_0x3ad2f5[_0x03de('0xac')](getSelectList(_0x5e17e0,_0x25815a,_0x2b85eb,_0x5b199a[_0x03de('0xa3')],_0x124c76[_0x03de('0xa3')],_0x2a8650));}}});return Promise['all'](_0x3ad2f5);})[_0x03de('0x21')](function(_0x3121b3){_0x20db51=_0x3121b3[0x0];var _0x24d7f1=[];var _0x5e5545=[];_0x1a0336[_0x03de('0xa9')](function(_0x439617){if(!_[_0x03de('0xad')](_0x439617[_0x03de('0xaa')])){var _0x41ecf6=_0x439617[_0x03de('0xaa')][_0x03de('0xab')](_0x439617[_0x03de('0xaa')][_0x03de('0x9a')]('.')+0x1);if(_0x41ecf6===_0x03de('0xae')){_0x24d7f1[_0x03de('0xac')](getBooleanList(_0x5e17e0,_0x25815a,_0x5e5545,_0x5b199a[_0x03de('0xa3')],_0x439617[_0x03de('0xa3')],_0x2a8650));}}});return Promise[_0x03de('0xaf')](_0x24d7f1);})[_0x03de('0x21')](function(_0xfa03ad){_0x59c876=_0xfa03ad[0x0];var _0x2171e4=[];var _0x47fdf8=[];_0x1a0336[_0x03de('0xa9')](function(_0x59a446){if(_0x59a446[_0x03de('0xaa')]){var _0x54e0d1=_0x59a446[_0x03de('0xaa')][_0x03de('0xab')](_0x59a446[_0x03de('0xaa')][_0x03de('0x9a')]('.')+0x1);if(_0x54e0d1==='StringAttributeMetadata'||_0x54e0d1===_0x03de('0xb0')||_0x54e0d1==='BigIntAttributeMetadata'||_0x54e0d1===_0x03de('0xb1')||_0x54e0d1==='MemoAttributeMetadata'||_0x54e0d1==='DateTimeAttributeMetadata'||_0x54e0d1===_0x03de('0xb2')||_0x54e0d1===_0x03de('0xb3')||_0x54e0d1===_0x03de('0xb4')||_0x54e0d1==='DecimalAttributeMetadata'){_0x2171e4[_0x03de('0xac')](getInputList(_0x5e17e0,_0x25815a,_0x54e0d1,_0x47fdf8,_0x5b199a[_0x03de('0xa3')],_0x59a446[_0x03de('0xa3')],_0x2a8650));}}});return Promise[_0x03de('0xaf')](_0x2171e4);})['then'](function(_0x58e47f){_0x11190c=_0x58e47f[0x0];var _0x15b881=_0x20db51['concat'](_0x59c876)['concat'](_0x11190c);var _0x2b9947={'count':_0x15b881[_0x03de('0x30')],'rows':_0x15b881};return _0x2b9947;})[_0x03de('0x21')](respondWithResult(_0x502b87,null))['catch'](function(_0x3c3653){var _0x24b837=_0x22e8df[_0x03de('0x2a')][_0x03de('0xb5')]?0x1f4:_0x3c3653[_0x03de('0xb6')]||0x1f4;logger[_0x03de('0xb7')](_0x3c3653['stack']);delete _0x3c3653[_0x03de('0x23')];if(_0x24b837===0x191){_0x24b837=0x190;}_0x502b87[_0x03de('0x1d')](_0x24b837)[_0x03de('0xb8')](_0x22e8df['query'][_0x03de('0xb5')]?{'message':_0x03de('0xb9'),'statusCode':_0x3c3653[_0x03de('0xb6')]}:_0x3c3653);});};function getSelectList(_0xde8a1c,_0x15439e,_0x162ef8,_0x584e79,_0x2b47ca,_0x3fbf0e){var _0x476a18={'method':_0x03de('0x9f'),'uri':_0xde8a1c+_0x03de('0xa4')+_0x584e79+_0x03de('0xba')+_0x2b47ca+_0x03de('0xbb')+_0x03de('0xbc'),'headers':{'Authorization':_0x03de('0xa0')+_0x3fbf0e,'If-None-Match':null,'OData-Version':_0x03de('0xa1')},'json':!![]};return rp(_0x476a18)[_0x03de('0x21')](function(_0x34a508){var _0x3aab25=[];var _0x1830ea=_0x34a508[_0x03de('0xbd')][_0x03de('0xbe')];_0x1830ea[_0x03de('0xa9')](function(_0x4760a4){_0x3aab25[_0x03de('0xac')]({'name':_0x4760a4[_0x03de('0xbf')][_0x03de('0xc0')][_0x03de('0xbf')],'value':String(_0x4760a4[_0x03de('0xc1')])});});var _0x40fea2={'id':_0x15439e+'_'+_0x34a508[_0x03de('0xc2')],'name':_0x34a508[_0x03de('0xc3')][_0x03de('0xc0')]['Label'],'custom':![],'options':_0x3aab25};_0x162ef8[_0x03de('0xac')](_0x40fea2);return _0x162ef8;});}function getBooleanList(_0x265201,_0x3de369,_0x7d147c,_0x219dcd,_0x302eb6,_0x45e2c5){var _0x4caea2={'method':_0x03de('0x9f'),'uri':_0x265201+_0x03de('0xa4')+_0x219dcd+')/Attributes('+_0x302eb6+_0x03de('0xc4'),'headers':{'Authorization':'Bearer\x20'+_0x45e2c5,'If-None-Match':null,'OData-Version':_0x03de('0xa1')},'json':!![]};return rp(_0x4caea2)[_0x03de('0x21')](function(_0x2b31f7){var _0x157dde=[];_0x157dde['push']({'name':_0x2b31f7[_0x03de('0xbd')][_0x03de('0xc5')][_0x03de('0xbf')]['UserLocalizedLabel'][_0x03de('0xbf')],'value':_0x03de('0xc6')},{'name':_0x2b31f7[_0x03de('0xbd')][_0x03de('0xc7')][_0x03de('0xbf')][_0x03de('0xc0')][_0x03de('0xbf')],'value':_0x03de('0xc8')});var _0x136afd={'id':_0x3de369+'_'+_0x2b31f7[_0x03de('0xc2')],'name':_0x2b31f7[_0x03de('0xc3')][_0x03de('0xc0')]['Label'],'custom':![],'options':_0x157dde};_0x7d147c[_0x03de('0xac')](_0x136afd);return _0x7d147c;});}function getInputList(_0x37116e,_0x44fde6,_0x578d92,_0x196b0c,_0x39c8c2,_0x14878a,_0x3ca338){var _0x268bbd={'method':'GET','uri':_0x37116e+_0x03de('0xa4')+_0x39c8c2+')/Attributes('+_0x14878a+')/Microsoft.Dynamics.CRM.'+_0x578d92+_0x03de('0xc9'),'headers':{'Authorization':_0x03de('0xa0')+_0x3ca338,'If-None-Match':null,'OData-Version':_0x03de('0xa1')},'json':!![]};return rp(_0x268bbd)[_0x03de('0x21')](function(_0x448d44){var _0x2ed673={'id':_0x44fde6+'_'+_0x448d44[_0x03de('0xc2')],'name':_0x448d44[_0x03de('0xc3')]['UserLocalizedLabel']?_0x448d44[_0x03de('0xc3')][_0x03de('0xc0')][_0x03de('0xbf')]:_0x448d44['LogicalName'],'custom':![],'options':[]};_0x196b0c[_0x03de('0xac')](_0x2ed673);return _0x196b0c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b094e24..d7def59 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x14ab79,_0x713e26){var _0x572f54=function(_0x17bbe5){while(--_0x17bbe5){_0x14ab79['push'](_0x14ab79['shift']());}};_0x572f54(++_0x713e26);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xcb91[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 7bfda44..16009b4 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96fe=['model','map','stringify','ShowDynamics365Account','find','raw','then','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','include'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x96fe,0x127));var _0xe96f=function(_0x93114a,_0x146b9a){_0x93114a=_0x93114a-0x0;var _0x129971=_0x96fe[_0x93114a];return _0x129971;};'use strict';var _=require(_0xe96f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe96f('0x1'));var rs=require(_0xe96f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe96f('0x3'))['db'];var utils=require(_0xe96f('0x4'));var logger=require('../../config/logger')(_0xe96f('0x5'));var config=require(_0xe96f('0x6'));var jayson=require(_0xe96f('0x7'));var client=jayson[_0xe96f('0x8')][_0xe96f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3702ab,_0x2d82a0,_0x24038d){return new BPromise(function(_0x3057a4,_0x3ef7ac){return client[_0xe96f('0xa')](_0x3702ab,_0x24038d)['then'](function(_0x1f0d6a){logger[_0xe96f('0xb')](_0xe96f('0xc'),_0x2d82a0,'request\x20sent');logger[_0xe96f('0xd')](_0xe96f('0xe'),_0x2d82a0,_0xe96f('0xf'),JSON['stringify'](_0x1f0d6a));if(_0x1f0d6a[_0xe96f('0x10')]){if(_0x1f0d6a[_0xe96f('0x10')][_0xe96f('0x11')]===0x1f4){logger[_0xe96f('0x10')](_0xe96f('0xc'),_0x2d82a0,_0x1f0d6a['error'][_0xe96f('0x12')]);return _0x3ef7ac(_0x1f0d6a[_0xe96f('0x10')][_0xe96f('0x12')]);}logger[_0xe96f('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x2d82a0,_0x1f0d6a[_0xe96f('0x10')]['message']);return _0x3057a4(_0x1f0d6a[_0xe96f('0x10')][_0xe96f('0x12')]);}else{logger[_0xe96f('0xb')](_0xe96f('0xc'),_0x2d82a0,_0xe96f('0xf'));_0x3057a4(_0x1f0d6a[_0xe96f('0x13')][_0xe96f('0x12')]);}})[_0xe96f('0x14')](function(_0x24e6df){logger[_0xe96f('0x10')](_0xe96f('0xc'),_0x2d82a0,_0x24e6df);_0x3ef7ac(_0x24e6df);});});}exports[_0xe96f('0x15')]=function(_0x3125f7){var _0x247746=this;return new Promise(function(_0x524eb1,_0x12fab3){return db[_0xe96f('0x16')][_0xe96f('0x17')]({'raw':_0x3125f7[_0xe96f('0x18')]?_0x3125f7[_0xe96f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3125f7[_0xe96f('0x18')]?_0x3125f7['options'][_0xe96f('0x19')]||null:null,'attributes':_0x3125f7['options']?_0x3125f7['options'][_0xe96f('0x1a')]||null:null,'limit':_0x3125f7[_0xe96f('0x18')]?_0x3125f7[_0xe96f('0x18')][_0xe96f('0x1b')]||null:null,'include':_0x3125f7[_0xe96f('0x18')]?_0x3125f7['options'][_0xe96f('0x1c')]?_['map'](_0x3125f7[_0xe96f('0x18')][_0xe96f('0x1c')],function(_0x16eedb){return{'model':db[_0x16eedb[_0xe96f('0x1d')]],'as':_0x16eedb['as'],'attributes':_0x16eedb['attributes'],'include':_0x16eedb[_0xe96f('0x1c')]?_[_0xe96f('0x1e')](_0x16eedb[_0xe96f('0x1c')],function(_0x193824){return{'model':db[_0x193824[_0xe96f('0x1d')]],'as':_0x193824['as'],'attributes':_0x193824['attributes'],'include':_0x193824[_0xe96f('0x1c')]?_[_0xe96f('0x1e')](_0x193824['include'],function(_0x409ea6){return{'model':db[_0x409ea6['model']],'as':_0x409ea6['as'],'attributes':_0x409ea6[_0xe96f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xebf0d8){logger[_0xe96f('0xb')](_0xe96f('0x15'),_0x3125f7);logger['debug'](_0xe96f('0x15'),_0x3125f7,JSON[_0xe96f('0x1f')](_0xebf0d8));_0x524eb1(_0xebf0d8);})[_0xe96f('0x14')](function(_0xdc8b9){logger['error']('GetDynamics365Account',_0xdc8b9[_0xe96f('0x12')],_0x3125f7);_0x12fab3(_0x247746[_0xe96f('0x10')](0x1f4,_0xdc8b9[_0xe96f('0x12')]));});});};exports[_0xe96f('0x20')]=function(_0x2594d8){var _0x29e113=this;return new Promise(function(_0x2f8f81,_0x318f27){return db[_0xe96f('0x16')][_0xe96f('0x21')]({'raw':_0x2594d8[_0xe96f('0x18')]?_0x2594d8[_0xe96f('0x18')][_0xe96f('0x22')]===undefined?!![]:![]:!![],'where':_0x2594d8[_0xe96f('0x18')]?_0x2594d8[_0xe96f('0x18')]['where']||null:null,'attributes':_0x2594d8[_0xe96f('0x18')]?_0x2594d8[_0xe96f('0x18')][_0xe96f('0x1a')]||null:null,'include':_0x2594d8[_0xe96f('0x18')]?_0x2594d8[_0xe96f('0x18')][_0xe96f('0x1c')]?_['map'](_0x2594d8[_0xe96f('0x18')][_0xe96f('0x1c')],function(_0x43fbd8){return{'model':db[_0x43fbd8['model']],'as':_0x43fbd8['as'],'attributes':_0x43fbd8[_0xe96f('0x1a')],'include':_0x43fbd8[_0xe96f('0x1c')]?_['map'](_0x43fbd8[_0xe96f('0x1c')],function(_0x120965){return{'model':db[_0x120965['model']],'as':_0x120965['as'],'attributes':_0x120965[_0xe96f('0x1a')],'include':_0x120965['include']?_['map'](_0x120965[_0xe96f('0x1c')],function(_0x323cab){return{'model':db[_0x323cab[_0xe96f('0x1d')]],'as':_0x323cab['as'],'attributes':_0x323cab[_0xe96f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe96f('0x23')](function(_0x28fc53){logger['info'](_0xe96f('0x20'),_0x2594d8);logger[_0xe96f('0xd')]('ShowDynamics365Account',_0x2594d8,JSON[_0xe96f('0x1f')](_0x28fc53));_0x2f8f81(_0x28fc53);})[_0xe96f('0x14')](function(_0x5e9d06){logger[_0xe96f('0x10')](_0xe96f('0x20'),_0x5e9d06[_0xe96f('0x12')],_0x2594d8);_0x318f27(_0x29e113[_0xe96f('0x10')](0x1f4,_0x5e9d06[_0xe96f('0x12')]));});});}; \ No newline at end of file +var _0xc61c=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','map','include','model','then','ShowDynamics365Account','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x4fb48d,_0x1885c5){var _0x58e36d=function(_0x5e99ed){while(--_0x5e99ed){_0x4fb48d['push'](_0x4fb48d['shift']());}};_0x58e36d(++_0x1885c5);}(_0xc61c,0xa8));var _0xcc61=function(_0x368163,_0x1e3010){_0x368163=_0x368163-0x0;var _0x55782e=_0xc61c[_0x368163];return _0x55782e;};'use strict';var _=require(_0xcc61('0x0'));var util=require(_0xcc61('0x1'));var moment=require(_0xcc61('0x2'));var BPromise=require(_0xcc61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc61('0x4'));var db=require(_0xcc61('0x5'))['db'];var utils=require(_0xcc61('0x6'));var logger=require(_0xcc61('0x7'))(_0xcc61('0x8'));var config=require(_0xcc61('0x9'));var jayson=require(_0xcc61('0xa'));var client=jayson[_0xcc61('0xb')][_0xcc61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d025d,_0x2e2294,_0x1766b4){return new BPromise(function(_0xa5de12,_0x28ffaa){return client[_0xcc61('0xd')](_0x1d025d,_0x1766b4)['then'](function(_0x11fdf4){logger[_0xcc61('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2e2294,_0xcc61('0xf'));logger[_0xcc61('0x10')](_0xcc61('0x11'),_0x2e2294,_0xcc61('0xf'),JSON[_0xcc61('0x12')](_0x11fdf4));if(_0x11fdf4['error']){if(_0x11fdf4['error'][_0xcc61('0x13')]===0x1f4){logger[_0xcc61('0x14')](_0xcc61('0x15'),_0x2e2294,_0x11fdf4[_0xcc61('0x14')][_0xcc61('0x16')]);return _0x28ffaa(_0x11fdf4['error']['message']);}logger[_0xcc61('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x2e2294,_0x11fdf4[_0xcc61('0x14')][_0xcc61('0x16')]);return _0xa5de12(_0x11fdf4[_0xcc61('0x14')][_0xcc61('0x16')]);}else{logger[_0xcc61('0xe')](_0xcc61('0x15'),_0x2e2294,_0xcc61('0xf'));_0xa5de12(_0x11fdf4['result'][_0xcc61('0x16')]);}})[_0xcc61('0x17')](function(_0xf762be){logger[_0xcc61('0x14')](_0xcc61('0x15'),_0x2e2294,_0xf762be);_0x28ffaa(_0xf762be);});});}exports[_0xcc61('0x18')]=function(_0x520459){var _0x4a41ba=this;return new Promise(function(_0x14e27f,_0x2e1e8c){return db[_0xcc61('0x19')]['findAll']({'raw':_0x520459[_0xcc61('0x1a')]?_0x520459['options'][_0xcc61('0x1b')]===undefined?!![]:![]:!![],'where':_0x520459[_0xcc61('0x1a')]?_0x520459[_0xcc61('0x1a')][_0xcc61('0x1c')]||null:null,'attributes':_0x520459[_0xcc61('0x1a')]?_0x520459['options'][_0xcc61('0x1d')]||null:null,'limit':_0x520459[_0xcc61('0x1a')]?_0x520459[_0xcc61('0x1a')][_0xcc61('0x1e')]||null:null,'include':_0x520459['options']?_0x520459[_0xcc61('0x1a')]['include']?_[_0xcc61('0x1f')](_0x520459[_0xcc61('0x1a')][_0xcc61('0x20')],function(_0xf5aa07){return{'model':db[_0xf5aa07['model']],'as':_0xf5aa07['as'],'attributes':_0xf5aa07[_0xcc61('0x1d')],'include':_0xf5aa07[_0xcc61('0x20')]?_[_0xcc61('0x1f')](_0xf5aa07['include'],function(_0x136b41){return{'model':db[_0x136b41[_0xcc61('0x21')]],'as':_0x136b41['as'],'attributes':_0x136b41[_0xcc61('0x1d')],'include':_0x136b41[_0xcc61('0x20')]?_[_0xcc61('0x1f')](_0x136b41['include'],function(_0x4fae92){return{'model':db[_0x4fae92[_0xcc61('0x21')]],'as':_0x4fae92['as'],'attributes':_0x4fae92[_0xcc61('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcc61('0x22')](function(_0x10357b){logger[_0xcc61('0xe')](_0xcc61('0x18'),_0x520459);logger[_0xcc61('0x10')](_0xcc61('0x18'),_0x520459,JSON[_0xcc61('0x12')](_0x10357b));_0x14e27f(_0x10357b);})[_0xcc61('0x17')](function(_0x269332){logger[_0xcc61('0x14')](_0xcc61('0x18'),_0x269332[_0xcc61('0x16')],_0x520459);_0x2e1e8c(_0x4a41ba[_0xcc61('0x14')](0x1f4,_0x269332[_0xcc61('0x16')]));});});};exports[_0xcc61('0x23')]=function(_0x55fa49){var _0x44846a=this;return new Promise(function(_0x784d8,_0x629191){return db[_0xcc61('0x19')][_0xcc61('0x24')]({'raw':_0x55fa49[_0xcc61('0x1a')]?_0x55fa49[_0xcc61('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x55fa49[_0xcc61('0x1a')]?_0x55fa49[_0xcc61('0x1a')][_0xcc61('0x1c')]||null:null,'attributes':_0x55fa49[_0xcc61('0x1a')]?_0x55fa49[_0xcc61('0x1a')][_0xcc61('0x1d')]||null:null,'include':_0x55fa49[_0xcc61('0x1a')]?_0x55fa49['options'][_0xcc61('0x20')]?_[_0xcc61('0x1f')](_0x55fa49[_0xcc61('0x1a')][_0xcc61('0x20')],function(_0x511c20){return{'model':db[_0x511c20[_0xcc61('0x21')]],'as':_0x511c20['as'],'attributes':_0x511c20[_0xcc61('0x1d')],'include':_0x511c20['include']?_[_0xcc61('0x1f')](_0x511c20[_0xcc61('0x20')],function(_0x2899ad){return{'model':db[_0x2899ad[_0xcc61('0x21')]],'as':_0x2899ad['as'],'attributes':_0x2899ad['attributes'],'include':_0x2899ad['include']?_[_0xcc61('0x1f')](_0x2899ad[_0xcc61('0x20')],function(_0x2d6eb2){return{'model':db[_0x2d6eb2['model']],'as':_0x2d6eb2['as'],'attributes':_0x2d6eb2[_0xcc61('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcc61('0x22')](function(_0x56ae30){logger[_0xcc61('0xe')](_0xcc61('0x23'),_0x55fa49);logger[_0xcc61('0x10')](_0xcc61('0x23'),_0x55fa49,JSON[_0xcc61('0x12')](_0x56ae30));_0x784d8(_0x56ae30);})[_0xcc61('0x17')](function(_0x46f01c){logger[_0xcc61('0x14')]('ShowDynamics365Account',_0x46f01c[_0xcc61('0x16')],_0x55fa49);_0x629191(_0x44846a[_0xcc61('0x14')](0x1f4,_0x46f01c[_0xcc61('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9f5b5e4..d9b274a 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x967b=['/:id/descriptions','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x967b,0x10e));var _0xb967=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x967b[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0xb967('0x0'));var util=require(_0xb967('0x1'));var path=require(_0xb967('0x2'));var timeout=require(_0xb967('0x3'));var express=require(_0xb967('0x4'));var router=express[_0xb967('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb967('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb967('0x7'));var controller=require(_0xb967('0x8'));router['get']('/',auth[_0xb967('0x9')](),controller[_0xb967('0xa')]);router[_0xb967('0xb')](_0xb967('0xc'),auth[_0xb967('0x9')](),controller[_0xb967('0xd')]);router['get']('/:id/fields',auth[_0xb967('0x9')](),controller[_0xb967('0xe')]);router[_0xb967('0xb')](_0xb967('0xf'),auth[_0xb967('0x9')](),controller['getSubjects']);router['get'](_0xb967('0x10'),auth[_0xb967('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xb967('0x9')](),controller[_0xb967('0x11')]);router['put']('/:id',auth[_0xb967('0x9')](),controller[_0xb967('0x12')]);router[_0xb967('0x13')](_0xb967('0xc'),auth['isAuthenticated'](),controller[_0xb967('0x14')]);module[_0xb967('0x15')]=router; \ No newline at end of file +var _0x4012=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0xc15b70,_0x461d10){var _0x178f88=function(_0x3230fa){while(--_0x3230fa){_0xc15b70['push'](_0xc15b70['shift']());}};_0x178f88(++_0x461d10);}(_0x4012,0x1bf));var _0x2401=function(_0x1fdc51,_0x48f048){_0x1fdc51=_0x1fdc51-0x0;var _0x37e590=_0x4012[_0x1fdc51];return _0x37e590;};'use strict';var multer=require(_0x2401('0x0'));var util=require(_0x2401('0x1'));var path=require(_0x2401('0x2'));var timeout=require(_0x2401('0x3'));var express=require(_0x2401('0x4'));var router=express['Router']();var fs_extra=require(_0x2401('0x5'));var auth=require(_0x2401('0x6'));var interaction=require(_0x2401('0x7'));var config=require(_0x2401('0x8'));var controller=require(_0x2401('0x9'));router[_0x2401('0xa')]('/',auth[_0x2401('0xb')](),controller[_0x2401('0xc')]);router[_0x2401('0xa')](_0x2401('0xd'),auth[_0x2401('0xb')](),controller['show']);router[_0x2401('0xa')]('/:id/fields',auth[_0x2401('0xb')](),controller[_0x2401('0xe')]);router[_0x2401('0xa')](_0x2401('0xf'),auth[_0x2401('0xb')](),controller[_0x2401('0x10')]);router[_0x2401('0xa')](_0x2401('0x11'),auth[_0x2401('0xb')](),controller[_0x2401('0x12')]);router[_0x2401('0x13')]('/',auth[_0x2401('0xb')](),controller[_0x2401('0x14')]);router[_0x2401('0x15')]('/:id',auth[_0x2401('0xb')](),controller['update']);router[_0x2401('0x16')](_0x2401('0xd'),auth[_0x2401('0xb')](),controller[_0x2401('0x17')]);module[_0x2401('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cd9511b..1ce1f5c 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8840=['STRING','incident','phonecall','contact','nothing','sequelize'];(function(_0x5ecacc,_0x220556){var _0x5286c3=function(_0x4a9526){while(--_0x4a9526){_0x5ecacc['push'](_0x5ecacc['shift']());}};_0x5286c3(++_0x220556);}(_0x8840,0x1a9));var _0x0884=function(_0x170682,_0x1fe7b7){_0x170682=_0x170682-0x0;var _0x2d9f0e=_0x8840[_0x170682];return _0x2d9f0e;};'use strict';var Sequelize=require(_0x0884('0x0'));module['exports']={'name':{'type':Sequelize[_0x0884('0x1')]},'description':{'type':Sequelize[_0x0884('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x0884('0x2'),_0x0884('0x3')),'defaultValue':_0x0884('0x2')},'moduleCreate':{'type':Sequelize['ENUM'](_0x0884('0x4'),_0x0884('0x5')),'defaultValue':_0x0884('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0xd8e4=['phonecall','nothing','sequelize','STRING','ENUM','incident'];(function(_0x23c741,_0x4ed6f2){var _0x3bed53=function(_0x25921b){while(--_0x25921b){_0x23c741['push'](_0x23c741['shift']());}};_0x3bed53(++_0x4ed6f2);}(_0xd8e4,0x1a6));var _0x4d8e=function(_0x6d70cd,_0x5f2d97){_0x6d70cd=_0x6d70cd-0x0;var _0x1d3692=_0xd8e4[_0x6d70cd];return _0x1d3692;};'use strict';var Sequelize=require(_0x4d8e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4d8e('0x1')]},'ticketType':{'type':Sequelize[_0x4d8e('0x2')](_0x4d8e('0x3'),_0x4d8e('0x4')),'defaultValue':_0x4d8e('0x3')},'moduleCreate':{'type':Sequelize[_0x4d8e('0x2')]('contact',_0x4d8e('0x5')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8fa4f3c..a1a73fd 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a48=['hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','getFields','findOne','Dynamics365Field','length','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xa048ff,_0x3ea197){var _0x14ca88=function(_0x3b6f6f){while(--_0x3b6f6f){_0xa048ff['push'](_0xa048ff['shift']());}};_0x14ca88(++_0x3ea197);}(_0x4a48,0x158));var _0x84a4=function(_0x14ce4d,_0xd9ab26){_0x14ce4d=_0x14ce4d-0x0;var _0x5e80b1=_0x4a48[_0x14ce4d];return _0x5e80b1;};'use strict';var emlformat=require(_0x84a4('0x0'));var rimraf=require(_0x84a4('0x1'));var zipdir=require(_0x84a4('0x2'));var jsonpatch=require(_0x84a4('0x3'));var rp=require(_0x84a4('0x4'));var moment=require(_0x84a4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x84a4('0x6'));var util=require('util');var path=require(_0x84a4('0x7'));var sox=require(_0x84a4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84a4('0x9'));var _=require(_0x84a4('0xa'));var squel=require(_0x84a4('0xb'));var crypto=require(_0x84a4('0xc'));var jsforce=require(_0x84a4('0xd'));var deskjs=require(_0x84a4('0xe'));var toCsv=require(_0x84a4('0xf'));var querystring=require('querystring');var Papa=require(_0x84a4('0x10'));var Redis=require(_0x84a4('0x11'));var authService=require(_0x84a4('0x12'));var qs=require(_0x84a4('0x13'));var as=require(_0x84a4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84a4('0x15'))(_0x84a4('0x16'));var utils=require('../../config/utils');var config=require(_0x84a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6c4859,_0x105b2f){_0x105b2f=_0x105b2f||0xcc;return function(_0x1caf46){if(_0x1caf46){return _0x6c4859[_0x84a4('0x18')](_0x105b2f);}return _0x6c4859[_0x84a4('0x19')](_0x105b2f)[_0x84a4('0x1a')]();};}function respondWithResult(_0x5c7015,_0x288eb4){_0x288eb4=_0x288eb4||0xc8;return function(_0x3dbd4a){if(_0x3dbd4a){return _0x5c7015['status'](_0x288eb4)['json'](_0x3dbd4a);}};}function respondWithFilteredResult(_0x369450,_0x4b1934){return function(_0x1b5a40){if(_0x1b5a40){var _0x25095f=typeof _0x4b1934[_0x84a4('0x1b')]===_0x84a4('0x1c')&&typeof _0x4b1934[_0x84a4('0x1d')]===_0x84a4('0x1c');var _0x2ff3de=_0x1b5a40[_0x84a4('0x1e')];var _0x51773d=_0x25095f?0x0:_0x4b1934[_0x84a4('0x1b')];var _0x354067=_0x25095f?_0x1b5a40[_0x84a4('0x1e')]:_0x4b1934['offset']+_0x4b1934[_0x84a4('0x1d')];var _0x50ab72;if(_0x354067>=_0x2ff3de){_0x354067=_0x2ff3de;_0x50ab72=0xc8;}else{_0x50ab72=0xce;}_0x369450[_0x84a4('0x19')](_0x50ab72);return _0x369450[_0x84a4('0x1f')](_0x84a4('0x20'),_0x51773d+'-'+_0x354067+'/'+_0x2ff3de)['json'](_0x1b5a40);}return null;};}function patchUpdates(_0x2321a4){return function(_0x1df9db){try{jsonpatch['apply'](_0x1df9db,_0x2321a4,!![]);}catch(_0x1bb1c3){return BPromise[_0x84a4('0x21')](_0x1bb1c3);}return _0x1df9db[_0x84a4('0x22')]();};}function saveUpdates(_0x5e5ccb,_0x302d5e){return function(_0x7b8b0e){if(_0x7b8b0e){return _0x7b8b0e[_0x84a4('0x23')](_0x5e5ccb)['then'](function(_0x48d796){return _0x48d796;});}return null;};}function removeEntity(_0x35671b,_0x27b5cd){return function(_0x1aad0a){if(_0x1aad0a){return _0x1aad0a[_0x84a4('0x24')]()[_0x84a4('0x25')](function(){_0x35671b['status'](0xcc)[_0x84a4('0x1a')]();});}};}function handleEntityNotFound(_0x19654c,_0xb5fb03){return function(_0xe136ec){if(!_0xe136ec){_0x19654c['sendStatus'](0x194);}return _0xe136ec;};}function handleError(_0x49faca,_0x635743){_0x635743=_0x635743||0x1f4;return function(_0xd5018){logger[_0x84a4('0x26')](_0xd5018[_0x84a4('0x27')]);if(_0xd5018['name']){delete _0xd5018[_0x84a4('0x28')];}_0x49faca[_0x84a4('0x19')](_0x635743)[_0x84a4('0x29')](_0xd5018);};}exports[_0x84a4('0x2a')]=function(_0x584b84,_0x5a5154){var _0x412170={},_0x479581={},_0x5de07f={'count':0x0,'rows':[]};var _0x5b2d1a=_[_0x84a4('0x2b')](db[_0x84a4('0x2c')][_0x84a4('0x2d')],function(_0x33fbfa){return{'name':_0x33fbfa[_0x84a4('0x2e')],'type':_0x33fbfa[_0x84a4('0x2f')][_0x84a4('0x30')]};});_0x479581[_0x84a4('0x31')]=_[_0x84a4('0x2b')](_0x5b2d1a,_0x84a4('0x28'));_0x479581[_0x84a4('0x32')]=_[_0x84a4('0x33')](_0x584b84['query']);_0x479581[_0x84a4('0x34')]=_[_0x84a4('0x35')](_0x479581[_0x84a4('0x31')],_0x479581[_0x84a4('0x32')]);_0x412170[_0x84a4('0x36')]=_['intersection'](_0x479581['model'],qs[_0x84a4('0x37')](_0x584b84[_0x84a4('0x32')][_0x84a4('0x37')]));_0x412170['attributes']=_0x412170[_0x84a4('0x36')]['length']?_0x412170[_0x84a4('0x36')]:_0x479581[_0x84a4('0x31')];if(!_0x584b84['query'][_0x84a4('0x38')]('nolimit')){_0x412170[_0x84a4('0x1d')]=qs['limit'](_0x584b84[_0x84a4('0x32')][_0x84a4('0x1d')]);_0x412170['offset']=qs['offset'](_0x584b84[_0x84a4('0x32')][_0x84a4('0x1b')]);}_0x412170[_0x84a4('0x39')]=qs[_0x84a4('0x3a')](_0x584b84[_0x84a4('0x32')]['sort']);_0x412170[_0x84a4('0x3b')]=qs[_0x84a4('0x34')](_[_0x84a4('0x3c')](_0x584b84[_0x84a4('0x32')],_0x479581[_0x84a4('0x34')]),_0x5b2d1a);if(_0x584b84['query']['filter']){_0x412170['where']=_['merge'](_0x412170[_0x84a4('0x3b')],{'$or':_[_0x84a4('0x2b')](_0x5b2d1a,function(_0x56d849){if(_0x56d849['type']!=='VIRTUAL'){var _0x41a357={};_0x41a357[_0x56d849[_0x84a4('0x28')]]={'$like':'%'+_0x584b84[_0x84a4('0x32')][_0x84a4('0x3d')]+'%'};return _0x41a357;}})});}_0x412170=_[_0x84a4('0x3e')]({},_0x412170,_0x584b84[_0x84a4('0x3f')]);var _0x38d56c={'where':_0x412170[_0x84a4('0x3b')]};return db['Dynamics365Configuration'][_0x84a4('0x1e')](_0x38d56c)[_0x84a4('0x25')](function(_0x1b49c3){_0x5de07f[_0x84a4('0x1e')]=_0x1b49c3;if(_0x584b84[_0x84a4('0x32')][_0x84a4('0x40')]){_0x412170[_0x84a4('0x41')]=[{'all':!![]}];}return db[_0x84a4('0x2c')][_0x84a4('0x42')](_0x412170);})[_0x84a4('0x25')](function(_0x2f2947){_0x5de07f['rows']=_0x2f2947;return _0x5de07f;})[_0x84a4('0x25')](respondWithFilteredResult(_0x5a5154,_0x412170))[_0x84a4('0x43')](handleError(_0x5a5154,null));};exports[_0x84a4('0x44')]=function(_0x20573f,_0x35d5b1){var _0x417e74={'raw':![],'where':{'id':_0x20573f['params']['id']}},_0x2e2c7f={};_0x2e2c7f[_0x84a4('0x31')]=_['keys'](db[_0x84a4('0x2c')][_0x84a4('0x2d')]);_0x2e2c7f[_0x84a4('0x32')]=_[_0x84a4('0x33')](_0x20573f[_0x84a4('0x32')]);_0x2e2c7f[_0x84a4('0x34')]=_[_0x84a4('0x35')](_0x2e2c7f[_0x84a4('0x31')],_0x2e2c7f[_0x84a4('0x32')]);_0x417e74['attributes']=_['intersection'](_0x2e2c7f['model'],qs['fields'](_0x20573f[_0x84a4('0x32')][_0x84a4('0x37')]));_0x417e74[_0x84a4('0x36')]=_0x417e74['attributes']['length']?_0x417e74[_0x84a4('0x36')]:_0x2e2c7f[_0x84a4('0x31')];if(_0x20573f[_0x84a4('0x32')]['includeAll']){_0x417e74[_0x84a4('0x41')]=[{'all':!![]}];}_0x417e74=_['merge']({},_0x417e74,_0x20573f[_0x84a4('0x3f')]);return db[_0x84a4('0x2c')][_0x84a4('0x45')](_0x417e74)['then'](handleEntityNotFound(_0x35d5b1,null))[_0x84a4('0x25')](respondWithResult(_0x35d5b1,null))[_0x84a4('0x43')](handleError(_0x35d5b1,null));};exports[_0x84a4('0x46')]=function(_0x476709,_0x2e3628){return db[_0x84a4('0x2c')][_0x84a4('0x46')](_0x476709[_0x84a4('0x47')],{})[_0x84a4('0x25')](respondWithResult(_0x2e3628,0xc9))['catch'](handleError(_0x2e3628,null));};exports[_0x84a4('0x23')]=function(_0x468eac,_0x49b711){if(_0x468eac[_0x84a4('0x47')]['id']){delete _0x468eac[_0x84a4('0x47')]['id'];}return db[_0x84a4('0x2c')][_0x84a4('0x45')]({'where':{'id':_0x468eac[_0x84a4('0x48')]['id']}})['then'](handleEntityNotFound(_0x49b711,null))['then'](saveUpdates(_0x468eac[_0x84a4('0x47')],null))[_0x84a4('0x25')](respondWithResult(_0x49b711,null))[_0x84a4('0x43')](handleError(_0x49b711,null));};exports[_0x84a4('0x24')]=function(_0x225928,_0x27087e){return db[_0x84a4('0x2c')][_0x84a4('0x45')]({'where':{'id':_0x225928['params']['id']}})['then'](handleEntityNotFound(_0x27087e,null))[_0x84a4('0x25')](removeEntity(_0x27087e,null))['catch'](handleError(_0x27087e,null));};exports[_0x84a4('0x49')]=function(_0x723d05,_0x419275,_0x584688){var _0x20dd68={};var _0x1b30b4={};var _0x514ded;var _0x438b63;return db[_0x84a4('0x2c')][_0x84a4('0x4a')]({'where':{'id':_0x723d05[_0x84a4('0x48')]['id']}})[_0x84a4('0x25')](handleEntityNotFound(_0x419275,null))['then'](function(_0x5edb0f){if(_0x5edb0f){_0x514ded=_0x5edb0f;_0x1b30b4[_0x84a4('0x31')]=_[_0x84a4('0x33')](db[_0x84a4('0x4b')][_0x84a4('0x2d')]);_0x1b30b4[_0x84a4('0x32')]=_['keys'](_0x723d05[_0x84a4('0x32')]);_0x1b30b4[_0x84a4('0x34')]=_['intersection'](_0x1b30b4[_0x84a4('0x31')],_0x1b30b4[_0x84a4('0x32')]);_0x20dd68[_0x84a4('0x36')]=_['intersection'](_0x1b30b4[_0x84a4('0x31')],qs[_0x84a4('0x37')](_0x723d05[_0x84a4('0x32')][_0x84a4('0x37')]));_0x20dd68[_0x84a4('0x36')]=_0x20dd68['attributes'][_0x84a4('0x4c')]?_0x20dd68[_0x84a4('0x36')]:_0x1b30b4['model'];_0x20dd68['order']=qs['sort'](_0x723d05['query'][_0x84a4('0x3a')]);_0x20dd68['where']=qs[_0x84a4('0x34')](_[_0x84a4('0x3c')](_0x723d05[_0x84a4('0x32')],_0x1b30b4['filters']));if(_0x723d05['query'][_0x84a4('0x3d')]){_0x20dd68['where']=_[_0x84a4('0x3e')](_0x20dd68[_0x84a4('0x3b')],{'$or':_[_0x84a4('0x2b')](_0x20dd68[_0x84a4('0x36')],function(_0x49bc87){var _0x1e8395={};_0x1e8395[_0x49bc87]={'$like':'%'+_0x723d05[_0x84a4('0x32')][_0x84a4('0x3d')]+'%'};return _0x1e8395;})});}_0x20dd68=_[_0x84a4('0x3e')]({},_0x20dd68,_0x723d05[_0x84a4('0x3f')]);return _0x514ded['getFields'](_0x20dd68);}})[_0x84a4('0x25')](function(_0x89513a){if(_0x89513a){_0x438b63=_0x89513a['length'];if(!_0x723d05[_0x84a4('0x32')][_0x84a4('0x38')](_0x84a4('0x4d'))){_0x20dd68['limit']=qs[_0x84a4('0x1d')](_0x723d05[_0x84a4('0x32')]['limit']);_0x20dd68[_0x84a4('0x1b')]=qs[_0x84a4('0x1b')](_0x723d05[_0x84a4('0x32')][_0x84a4('0x1b')]);}return _0x514ded[_0x84a4('0x49')](_0x20dd68);}})['then'](function(_0x3dc3db){if(_0x3dc3db){return _0x3dc3db?{'count':_0x438b63,'rows':_0x3dc3db}:null;}})['then'](respondWithResult(_0x419275,null))['catch'](handleError(_0x419275,null));};exports[_0x84a4('0x4e')]=function(_0x206aa0,_0x30c6b4,_0x56677d){var _0x38b751={};var _0x3c96b1={};var _0x40e6ad;var _0x19df73;return db[_0x84a4('0x2c')][_0x84a4('0x4a')]({'where':{'id':_0x206aa0[_0x84a4('0x48')]['id']}})[_0x84a4('0x25')](handleEntityNotFound(_0x30c6b4,null))['then'](function(_0x26f8dd){if(_0x26f8dd){_0x40e6ad=_0x26f8dd;_0x3c96b1['model']=_[_0x84a4('0x33')](db[_0x84a4('0x4b')][_0x84a4('0x2d')]);_0x3c96b1[_0x84a4('0x32')]=_['keys'](_0x206aa0['query']);_0x3c96b1[_0x84a4('0x34')]=_[_0x84a4('0x35')](_0x3c96b1[_0x84a4('0x31')],_0x3c96b1['query']);_0x38b751[_0x84a4('0x36')]=_[_0x84a4('0x35')](_0x3c96b1[_0x84a4('0x31')],qs['fields'](_0x206aa0[_0x84a4('0x32')][_0x84a4('0x37')]));_0x38b751[_0x84a4('0x36')]=_0x38b751[_0x84a4('0x36')][_0x84a4('0x4c')]?_0x38b751[_0x84a4('0x36')]:_0x3c96b1[_0x84a4('0x31')];_0x38b751[_0x84a4('0x39')]=qs[_0x84a4('0x3a')](_0x206aa0[_0x84a4('0x32')][_0x84a4('0x3a')]);_0x38b751[_0x84a4('0x3b')]=qs[_0x84a4('0x34')](_[_0x84a4('0x3c')](_0x206aa0[_0x84a4('0x32')],_0x3c96b1[_0x84a4('0x34')]));if(_0x206aa0[_0x84a4('0x32')]['filter']){_0x38b751[_0x84a4('0x3b')]=_[_0x84a4('0x3e')](_0x38b751[_0x84a4('0x3b')],{'$or':_[_0x84a4('0x2b')](_0x38b751[_0x84a4('0x36')],function(_0x27b7c6){var _0x23ccb6={};_0x23ccb6[_0x27b7c6]={'$like':'%'+_0x206aa0[_0x84a4('0x32')][_0x84a4('0x3d')]+'%'};return _0x23ccb6;})});}_0x38b751=_['merge']({},_0x38b751,_0x206aa0[_0x84a4('0x3f')]);return _0x40e6ad[_0x84a4('0x4e')](_0x38b751);}})[_0x84a4('0x25')](function(_0x36d03d){if(_0x36d03d){_0x19df73=_0x36d03d[_0x84a4('0x4c')];if(!_0x206aa0['query'][_0x84a4('0x38')](_0x84a4('0x4d'))){_0x38b751[_0x84a4('0x1d')]=qs[_0x84a4('0x1d')](_0x206aa0['query']['limit']);_0x38b751['offset']=qs[_0x84a4('0x1b')](_0x206aa0[_0x84a4('0x32')]['offset']);}return _0x40e6ad['getSubjects'](_0x38b751);}})['then'](function(_0xc8590b){if(_0xc8590b){return _0xc8590b?{'count':_0x19df73,'rows':_0xc8590b}:null;}})['then'](respondWithResult(_0x30c6b4,null))['catch'](handleError(_0x30c6b4,null));};exports[_0x84a4('0x4f')]=function(_0x46bcba,_0x25d07c,_0x5068b7){var _0x16c622={};var _0x235dc9={};var _0x54a31a;var _0x5be0c0;return db[_0x84a4('0x2c')]['findOne']({'where':{'id':_0x46bcba[_0x84a4('0x48')]['id']}})[_0x84a4('0x25')](handleEntityNotFound(_0x25d07c,null))['then'](function(_0x126027){if(_0x126027){_0x54a31a=_0x126027;_0x235dc9[_0x84a4('0x31')]=_[_0x84a4('0x33')](db['Dynamics365Field'][_0x84a4('0x2d')]);_0x235dc9[_0x84a4('0x32')]=_['keys'](_0x46bcba[_0x84a4('0x32')]);_0x235dc9[_0x84a4('0x34')]=_[_0x84a4('0x35')](_0x235dc9['model'],_0x235dc9[_0x84a4('0x32')]);_0x16c622['attributes']=_[_0x84a4('0x35')](_0x235dc9[_0x84a4('0x31')],qs[_0x84a4('0x37')](_0x46bcba[_0x84a4('0x32')][_0x84a4('0x37')]));_0x16c622[_0x84a4('0x36')]=_0x16c622[_0x84a4('0x36')]['length']?_0x16c622['attributes']:_0x235dc9[_0x84a4('0x31')];_0x16c622[_0x84a4('0x39')]=qs[_0x84a4('0x3a')](_0x46bcba['query'][_0x84a4('0x3a')]);_0x16c622[_0x84a4('0x3b')]=qs[_0x84a4('0x34')](_[_0x84a4('0x3c')](_0x46bcba['query'],_0x235dc9[_0x84a4('0x34')]));if(_0x46bcba[_0x84a4('0x32')][_0x84a4('0x3d')]){_0x16c622[_0x84a4('0x3b')]=_[_0x84a4('0x3e')](_0x16c622['where'],{'$or':_[_0x84a4('0x2b')](_0x16c622[_0x84a4('0x36')],function(_0x1e5069){var _0x86d139={};_0x86d139[_0x1e5069]={'$like':'%'+_0x46bcba['query'][_0x84a4('0x3d')]+'%'};return _0x86d139;})});}_0x16c622=_[_0x84a4('0x3e')]({},_0x16c622,_0x46bcba['options']);return _0x54a31a[_0x84a4('0x4f')](_0x16c622);}})[_0x84a4('0x25')](function(_0x2aba2){if(_0x2aba2){_0x5be0c0=_0x2aba2['length'];if(!_0x46bcba[_0x84a4('0x32')][_0x84a4('0x38')](_0x84a4('0x4d'))){_0x16c622[_0x84a4('0x1d')]=qs[_0x84a4('0x1d')](_0x46bcba['query'][_0x84a4('0x1d')]);_0x16c622[_0x84a4('0x1b')]=qs[_0x84a4('0x1b')](_0x46bcba['query'][_0x84a4('0x1b')]);}return _0x54a31a[_0x84a4('0x4f')](_0x16c622);}})[_0x84a4('0x25')](function(_0x5d036f){if(_0x5d036f){return _0x5d036f?{'count':_0x5be0c0,'rows':_0x5d036f}:null;}})['then'](respondWithResult(_0x25d07c,null))[_0x84a4('0x43')](handleError(_0x25d07c,null));}; \ No newline at end of file +var _0x2116=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','error','stack','name','index','map','Dynamics365Configuration','fieldName','key','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','include','then','rows','catch','params','rawAttributes','length','includeAll','find','create','body','getFields','findOne','Dynamics365Field','pick','hasOwnProperty','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2f2898,_0x315330){var _0x17180d=function(_0x28713e){while(--_0x28713e){_0x2f2898['push'](_0x2f2898['shift']());}};_0x17180d(++_0x315330);}(_0x2116,0x178));var _0x6211=function(_0x8e6c5b,_0x33e4df){_0x8e6c5b=_0x8e6c5b-0x0;var _0x39e9d3=_0x2116[_0x8e6c5b];return _0x39e9d3;};'use strict';var emlformat=require(_0x6211('0x0'));var rimraf=require(_0x6211('0x1'));var zipdir=require(_0x6211('0x2'));var jsonpatch=require(_0x6211('0x3'));var rp=require(_0x6211('0x4'));var moment=require(_0x6211('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6211('0x6'));var util=require(_0x6211('0x7'));var path=require(_0x6211('0x8'));var sox=require(_0x6211('0x9'));var csv=require(_0x6211('0xa'));var ejs=require(_0x6211('0xb'));var fs=require('fs');var fs_extra=require(_0x6211('0xc'));var _=require(_0x6211('0xd'));var squel=require(_0x6211('0xe'));var crypto=require(_0x6211('0xf'));var jsforce=require(_0x6211('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6211('0x11'));var authService=require(_0x6211('0x12'));var qs=require(_0x6211('0x13'));var as=require(_0x6211('0x14'));var hardwareService=require(_0x6211('0x15'));var logger=require(_0x6211('0x16'))(_0x6211('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x18'));var db=require(_0x6211('0x19'))['db'];function respondWithStatusCode(_0x5a9167,_0x273b85){_0x273b85=_0x273b85||0xcc;return function(_0x330008){if(_0x330008){return _0x5a9167[_0x6211('0x1a')](_0x273b85);}return _0x5a9167[_0x6211('0x1b')](_0x273b85)[_0x6211('0x1c')]();};}function respondWithResult(_0x381205,_0x5d4c9e){_0x5d4c9e=_0x5d4c9e||0xc8;return function(_0x26c191){if(_0x26c191){return _0x381205[_0x6211('0x1b')](_0x5d4c9e)[_0x6211('0x1d')](_0x26c191);}};}function respondWithFilteredResult(_0x2d58bb,_0x451511){return function(_0x230ef5){if(_0x230ef5){var _0x4fbe7c=typeof _0x451511[_0x6211('0x1e')]===_0x6211('0x1f')&&typeof _0x451511[_0x6211('0x20')]==='undefined';var _0x59da97=_0x230ef5[_0x6211('0x21')];var _0xc5a233=_0x4fbe7c?0x0:_0x451511['offset'];var _0x19927b=_0x4fbe7c?_0x230ef5[_0x6211('0x21')]:_0x451511[_0x6211('0x1e')]+_0x451511[_0x6211('0x20')];var _0x66d19e;if(_0x19927b>=_0x59da97){_0x19927b=_0x59da97;_0x66d19e=0xc8;}else{_0x66d19e=0xce;}_0x2d58bb['status'](_0x66d19e);return _0x2d58bb[_0x6211('0x22')](_0x6211('0x23'),_0xc5a233+'-'+_0x19927b+'/'+_0x59da97)[_0x6211('0x1d')](_0x230ef5);}return null;};}function patchUpdates(_0x167403){return function(_0x1536a4){try{jsonpatch['apply'](_0x1536a4,_0x167403,!![]);}catch(_0x4435f9){return BPromise['reject'](_0x4435f9);}return _0x1536a4['save']();};}function saveUpdates(_0x282b0f,_0x155fc6){return function(_0x135f66){if(_0x135f66){return _0x135f66[_0x6211('0x24')](_0x282b0f)['then'](function(_0x501f24){return _0x501f24;});}return null;};}function removeEntity(_0x32bb3f,_0x108227){return function(_0x1c23e4){if(_0x1c23e4){return _0x1c23e4[_0x6211('0x25')]()['then'](function(){_0x32bb3f[_0x6211('0x1b')](0xcc)[_0x6211('0x1c')]();});}};}function handleEntityNotFound(_0x1af01c,_0x2a40d0){return function(_0x5ef2b9){if(!_0x5ef2b9){_0x1af01c['sendStatus'](0x194);}return _0x5ef2b9;};}function handleError(_0x16c9f7,_0x1eb317){_0x1eb317=_0x1eb317||0x1f4;return function(_0x78bd13){logger[_0x6211('0x26')](_0x78bd13[_0x6211('0x27')]);if(_0x78bd13[_0x6211('0x28')]){delete _0x78bd13[_0x6211('0x28')];}_0x16c9f7[_0x6211('0x1b')](_0x1eb317)['send'](_0x78bd13);};}exports[_0x6211('0x29')]=function(_0x50ecf3,_0xb9ae2){var _0x2c9ad0={},_0xce3b4e={},_0x5efc05={'count':0x0,'rows':[]};var _0xc8f8e7=_[_0x6211('0x2a')](db[_0x6211('0x2b')]['rawAttributes'],function(_0x8556f){return{'name':_0x8556f[_0x6211('0x2c')],'type':_0x8556f['type'][_0x6211('0x2d')]};});_0xce3b4e['model']=_[_0x6211('0x2a')](_0xc8f8e7,_0x6211('0x28'));_0xce3b4e[_0x6211('0x2e')]=_[_0x6211('0x2f')](_0x50ecf3[_0x6211('0x2e')]);_0xce3b4e[_0x6211('0x30')]=_[_0x6211('0x31')](_0xce3b4e['model'],_0xce3b4e['query']);_0x2c9ad0[_0x6211('0x32')]=_[_0x6211('0x31')](_0xce3b4e[_0x6211('0x33')],qs[_0x6211('0x34')](_0x50ecf3[_0x6211('0x2e')][_0x6211('0x34')]));_0x2c9ad0[_0x6211('0x32')]=_0x2c9ad0[_0x6211('0x32')]['length']?_0x2c9ad0[_0x6211('0x32')]:_0xce3b4e['model'];if(!_0x50ecf3[_0x6211('0x2e')]['hasOwnProperty'](_0x6211('0x35'))){_0x2c9ad0[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x50ecf3[_0x6211('0x2e')][_0x6211('0x20')]);_0x2c9ad0[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x50ecf3[_0x6211('0x2e')]['offset']);}_0x2c9ad0['order']=qs[_0x6211('0x36')](_0x50ecf3['query']['sort']);_0x2c9ad0['where']=qs[_0x6211('0x30')](_['pick'](_0x50ecf3[_0x6211('0x2e')],_0xce3b4e[_0x6211('0x30')]),_0xc8f8e7);if(_0x50ecf3[_0x6211('0x2e')][_0x6211('0x37')]){_0x2c9ad0[_0x6211('0x38')]=_[_0x6211('0x39')](_0x2c9ad0[_0x6211('0x38')],{'$or':_[_0x6211('0x2a')](_0xc8f8e7,function(_0x58eb9f){if(_0x58eb9f[_0x6211('0x3a')]!==_0x6211('0x3b')){var _0x2ef0b9={};_0x2ef0b9[_0x58eb9f['name']]={'$like':'%'+_0x50ecf3['query'][_0x6211('0x37')]+'%'};return _0x2ef0b9;}})});}_0x2c9ad0=_[_0x6211('0x39')]({},_0x2c9ad0,_0x50ecf3[_0x6211('0x3c')]);var _0x3cf524={'where':_0x2c9ad0[_0x6211('0x38')]};return db['Dynamics365Configuration'][_0x6211('0x21')](_0x3cf524)['then'](function(_0x471f5b){_0x5efc05['count']=_0x471f5b;if(_0x50ecf3[_0x6211('0x2e')]['includeAll']){_0x2c9ad0[_0x6211('0x3d')]=[{'all':!![]}];}return db[_0x6211('0x2b')]['findAll'](_0x2c9ad0);})[_0x6211('0x3e')](function(_0xa7b2b2){_0x5efc05[_0x6211('0x3f')]=_0xa7b2b2;return _0x5efc05;})[_0x6211('0x3e')](respondWithFilteredResult(_0xb9ae2,_0x2c9ad0))[_0x6211('0x40')](handleError(_0xb9ae2,null));};exports['show']=function(_0x4c94d4,_0x3404ee){var _0x309d2b={'raw':![],'where':{'id':_0x4c94d4[_0x6211('0x41')]['id']}},_0xbff6={};_0xbff6[_0x6211('0x33')]=_[_0x6211('0x2f')](db[_0x6211('0x2b')][_0x6211('0x42')]);_0xbff6[_0x6211('0x2e')]=_['keys'](_0x4c94d4[_0x6211('0x2e')]);_0xbff6[_0x6211('0x30')]=_[_0x6211('0x31')](_0xbff6['model'],_0xbff6['query']);_0x309d2b[_0x6211('0x32')]=_[_0x6211('0x31')](_0xbff6[_0x6211('0x33')],qs[_0x6211('0x34')](_0x4c94d4[_0x6211('0x2e')]['fields']));_0x309d2b['attributes']=_0x309d2b['attributes'][_0x6211('0x43')]?_0x309d2b['attributes']:_0xbff6[_0x6211('0x33')];if(_0x4c94d4[_0x6211('0x2e')][_0x6211('0x44')]){_0x309d2b[_0x6211('0x3d')]=[{'all':!![]}];}_0x309d2b=_[_0x6211('0x39')]({},_0x309d2b,_0x4c94d4['options']);return db[_0x6211('0x2b')][_0x6211('0x45')](_0x309d2b)[_0x6211('0x3e')](handleEntityNotFound(_0x3404ee,null))[_0x6211('0x3e')](respondWithResult(_0x3404ee,null))[_0x6211('0x40')](handleError(_0x3404ee,null));};exports['create']=function(_0xf82a84,_0x8a3e58){return db[_0x6211('0x2b')][_0x6211('0x46')](_0xf82a84[_0x6211('0x47')],{})[_0x6211('0x3e')](respondWithResult(_0x8a3e58,0xc9))['catch'](handleError(_0x8a3e58,null));};exports[_0x6211('0x24')]=function(_0x3521c1,_0x571478){if(_0x3521c1[_0x6211('0x47')]['id']){delete _0x3521c1[_0x6211('0x47')]['id'];}return db['Dynamics365Configuration'][_0x6211('0x45')]({'where':{'id':_0x3521c1[_0x6211('0x41')]['id']}})['then'](handleEntityNotFound(_0x571478,null))['then'](saveUpdates(_0x3521c1[_0x6211('0x47')],null))['then'](respondWithResult(_0x571478,null))[_0x6211('0x40')](handleError(_0x571478,null));};exports[_0x6211('0x25')]=function(_0x1ba2cc,_0x40512e){return db[_0x6211('0x2b')]['find']({'where':{'id':_0x1ba2cc[_0x6211('0x41')]['id']}})[_0x6211('0x3e')](handleEntityNotFound(_0x40512e,null))[_0x6211('0x3e')](removeEntity(_0x40512e,null))[_0x6211('0x40')](handleError(_0x40512e,null));};exports[_0x6211('0x48')]=function(_0x1b554f,_0x181421,_0x631a92){var _0x52beb5={};var _0x1830dd={};var _0x322a58;var _0x32f9da;return db[_0x6211('0x2b')][_0x6211('0x49')]({'where':{'id':_0x1b554f[_0x6211('0x41')]['id']}})[_0x6211('0x3e')](handleEntityNotFound(_0x181421,null))[_0x6211('0x3e')](function(_0xeb0a8b){if(_0xeb0a8b){_0x322a58=_0xeb0a8b;_0x1830dd[_0x6211('0x33')]=_[_0x6211('0x2f')](db[_0x6211('0x4a')][_0x6211('0x42')]);_0x1830dd[_0x6211('0x2e')]=_['keys'](_0x1b554f[_0x6211('0x2e')]);_0x1830dd[_0x6211('0x30')]=_[_0x6211('0x31')](_0x1830dd[_0x6211('0x33')],_0x1830dd[_0x6211('0x2e')]);_0x52beb5['attributes']=_[_0x6211('0x31')](_0x1830dd[_0x6211('0x33')],qs[_0x6211('0x34')](_0x1b554f[_0x6211('0x2e')][_0x6211('0x34')]));_0x52beb5[_0x6211('0x32')]=_0x52beb5['attributes']['length']?_0x52beb5[_0x6211('0x32')]:_0x1830dd[_0x6211('0x33')];_0x52beb5['order']=qs[_0x6211('0x36')](_0x1b554f[_0x6211('0x2e')][_0x6211('0x36')]);_0x52beb5[_0x6211('0x38')]=qs[_0x6211('0x30')](_[_0x6211('0x4b')](_0x1b554f['query'],_0x1830dd[_0x6211('0x30')]));if(_0x1b554f[_0x6211('0x2e')]['filter']){_0x52beb5[_0x6211('0x38')]=_[_0x6211('0x39')](_0x52beb5[_0x6211('0x38')],{'$or':_[_0x6211('0x2a')](_0x52beb5['attributes'],function(_0x38f5a4){var _0xb086c1={};_0xb086c1[_0x38f5a4]={'$like':'%'+_0x1b554f['query']['filter']+'%'};return _0xb086c1;})});}_0x52beb5=_[_0x6211('0x39')]({},_0x52beb5,_0x1b554f['options']);return _0x322a58[_0x6211('0x48')](_0x52beb5);}})[_0x6211('0x3e')](function(_0x4b2121){if(_0x4b2121){_0x32f9da=_0x4b2121[_0x6211('0x43')];if(!_0x1b554f[_0x6211('0x2e')][_0x6211('0x4c')]('nolimit')){_0x52beb5[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x1b554f[_0x6211('0x2e')][_0x6211('0x20')]);_0x52beb5[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x1b554f[_0x6211('0x2e')][_0x6211('0x1e')]);}return _0x322a58['getFields'](_0x52beb5);}})[_0x6211('0x3e')](function(_0x450bb4){if(_0x450bb4){return _0x450bb4?{'count':_0x32f9da,'rows':_0x450bb4}:null;}})[_0x6211('0x3e')](respondWithResult(_0x181421,null))['catch'](handleError(_0x181421,null));};exports['getSubjects']=function(_0x168616,_0x49b0ae,_0x10cca2){var _0x358f7d={};var _0x470428={};var _0x442b2d;var _0x24a8c1;return db['Dynamics365Configuration'][_0x6211('0x49')]({'where':{'id':_0x168616[_0x6211('0x41')]['id']}})['then'](handleEntityNotFound(_0x49b0ae,null))[_0x6211('0x3e')](function(_0x2265a5){if(_0x2265a5){_0x442b2d=_0x2265a5;_0x470428[_0x6211('0x33')]=_[_0x6211('0x2f')](db[_0x6211('0x4a')][_0x6211('0x42')]);_0x470428['query']=_['keys'](_0x168616[_0x6211('0x2e')]);_0x470428[_0x6211('0x30')]=_[_0x6211('0x31')](_0x470428[_0x6211('0x33')],_0x470428[_0x6211('0x2e')]);_0x358f7d[_0x6211('0x32')]=_[_0x6211('0x31')](_0x470428['model'],qs[_0x6211('0x34')](_0x168616['query'][_0x6211('0x34')]));_0x358f7d[_0x6211('0x32')]=_0x358f7d['attributes'][_0x6211('0x43')]?_0x358f7d['attributes']:_0x470428['model'];_0x358f7d[_0x6211('0x4d')]=qs[_0x6211('0x36')](_0x168616[_0x6211('0x2e')][_0x6211('0x36')]);_0x358f7d[_0x6211('0x38')]=qs[_0x6211('0x30')](_['pick'](_0x168616[_0x6211('0x2e')],_0x470428['filters']));if(_0x168616[_0x6211('0x2e')][_0x6211('0x37')]){_0x358f7d[_0x6211('0x38')]=_['merge'](_0x358f7d[_0x6211('0x38')],{'$or':_[_0x6211('0x2a')](_0x358f7d['attributes'],function(_0x26da57){var _0x367dfc={};_0x367dfc[_0x26da57]={'$like':'%'+_0x168616[_0x6211('0x2e')][_0x6211('0x37')]+'%'};return _0x367dfc;})});}_0x358f7d=_['merge']({},_0x358f7d,_0x168616[_0x6211('0x3c')]);return _0x442b2d[_0x6211('0x4e')](_0x358f7d);}})[_0x6211('0x3e')](function(_0x65e845){if(_0x65e845){_0x24a8c1=_0x65e845[_0x6211('0x43')];if(!_0x168616[_0x6211('0x2e')]['hasOwnProperty'](_0x6211('0x35'))){_0x358f7d[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x168616[_0x6211('0x2e')]['limit']);_0x358f7d[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x168616['query'][_0x6211('0x1e')]);}return _0x442b2d[_0x6211('0x4e')](_0x358f7d);}})[_0x6211('0x3e')](function(_0x377aba){if(_0x377aba){return _0x377aba?{'count':_0x24a8c1,'rows':_0x377aba}:null;}})['then'](respondWithResult(_0x49b0ae,null))[_0x6211('0x40')](handleError(_0x49b0ae,null));};exports['getDescriptions']=function(_0x4c274e,_0x3559dc,_0x4d6b96){var _0xac916={};var _0x5172b4={};var _0x57044b;var _0x557b8a;return db['Dynamics365Configuration'][_0x6211('0x49')]({'where':{'id':_0x4c274e[_0x6211('0x41')]['id']}})[_0x6211('0x3e')](handleEntityNotFound(_0x3559dc,null))[_0x6211('0x3e')](function(_0xbc8d0a){if(_0xbc8d0a){_0x57044b=_0xbc8d0a;_0x5172b4['model']=_[_0x6211('0x2f')](db[_0x6211('0x4a')][_0x6211('0x42')]);_0x5172b4[_0x6211('0x2e')]=_[_0x6211('0x2f')](_0x4c274e[_0x6211('0x2e')]);_0x5172b4[_0x6211('0x30')]=_[_0x6211('0x31')](_0x5172b4[_0x6211('0x33')],_0x5172b4[_0x6211('0x2e')]);_0xac916[_0x6211('0x32')]=_[_0x6211('0x31')](_0x5172b4[_0x6211('0x33')],qs[_0x6211('0x34')](_0x4c274e[_0x6211('0x2e')]['fields']));_0xac916[_0x6211('0x32')]=_0xac916[_0x6211('0x32')][_0x6211('0x43')]?_0xac916[_0x6211('0x32')]:_0x5172b4['model'];_0xac916[_0x6211('0x4d')]=qs[_0x6211('0x36')](_0x4c274e['query'][_0x6211('0x36')]);_0xac916['where']=qs[_0x6211('0x30')](_[_0x6211('0x4b')](_0x4c274e['query'],_0x5172b4[_0x6211('0x30')]));if(_0x4c274e[_0x6211('0x2e')]['filter']){_0xac916[_0x6211('0x38')]=_['merge'](_0xac916[_0x6211('0x38')],{'$or':_[_0x6211('0x2a')](_0xac916[_0x6211('0x32')],function(_0x5ccb3f){var _0x1b96b6={};_0x1b96b6[_0x5ccb3f]={'$like':'%'+_0x4c274e[_0x6211('0x2e')][_0x6211('0x37')]+'%'};return _0x1b96b6;})});}_0xac916=_[_0x6211('0x39')]({},_0xac916,_0x4c274e[_0x6211('0x3c')]);return _0x57044b[_0x6211('0x4f')](_0xac916);}})[_0x6211('0x3e')](function(_0x4f0bfd){if(_0x4f0bfd){_0x557b8a=_0x4f0bfd[_0x6211('0x43')];if(!_0x4c274e[_0x6211('0x2e')]['hasOwnProperty'](_0x6211('0x35'))){_0xac916[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x4c274e[_0x6211('0x2e')][_0x6211('0x20')]);_0xac916[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x4c274e[_0x6211('0x2e')][_0x6211('0x1e')]);}return _0x57044b[_0x6211('0x4f')](_0xac916);}})[_0x6211('0x3e')](function(_0x3d5868){if(_0x3d5868){return _0x3d5868?{'count':_0x557b8a,'rows':_0x3d5868}:null;}})['then'](respondWithResult(_0x3559dc,null))[_0x6211('0x40')](handleError(_0x3559dc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 55c6958..b0da2d8 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x59b787,_0x134ed6){var _0x7b9c91=function(_0x4a42ba){while(--_0x4a42ba){_0x59b787['push'](_0x59b787['shift']());}};_0x7b9c91(++_0x134ed6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x53252d,_0xa8194){_0x53252d=_0x53252d-0x0;var _0x5c15f8=_0xb43b[_0x53252d];return _0x5c15f8;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x5a0456,_0x150b91){var _0x1fafa4=function(_0x1cf098){while(--_0x1cf098){_0x5a0456['push'](_0x5a0456['shift']());}};_0x1fafa4(++_0x150b91);}(_0xedd9,0xfc));var _0x9edd=function(_0x473688,_0x4fce45){_0x473688=_0x473688-0x0;var _0x29b369=_0xedd9[_0x473688];return _0x29b369;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 6980a3e..7a2e6a3 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08bc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error','code','message','result','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x08bc,0x1da));var _0xc08b=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x08bc[_0x5f5cce];return _0x705ecf;};'use strict';var _=require('lodash');var util=require(_0xc08b('0x0'));var moment=require(_0xc08b('0x1'));var BPromise=require(_0xc08b('0x2'));var rs=require(_0xc08b('0x3'));var fs=require('fs');var Redis=require(_0xc08b('0x4'));var db=require(_0xc08b('0x5'))['db'];var utils=require(_0xc08b('0x6'));var logger=require(_0xc08b('0x7'))(_0xc08b('0x8'));var config=require('../../config/environment');var jayson=require(_0xc08b('0x9'));var client=jayson[_0xc08b('0xa')][_0xc08b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e80cc,_0x4552a7,_0x536629){return new BPromise(function(_0x2c909b,_0x54cc6e){return client['request'](_0x5e80cc,_0x536629)['then'](function(_0x58fced){logger[_0xc08b('0xc')](_0xc08b('0xd'),_0x4552a7,_0xc08b('0xe'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4552a7,'request\x20sent',JSON['stringify'](_0x58fced));if(_0x58fced[_0xc08b('0xf')]){if(_0x58fced[_0xc08b('0xf')][_0xc08b('0x10')]===0x1f4){logger['error'](_0xc08b('0xd'),_0x4552a7,_0x58fced[_0xc08b('0xf')]['message']);return _0x54cc6e(_0x58fced[_0xc08b('0xf')]['message']);}logger[_0xc08b('0xf')](_0xc08b('0xd'),_0x4552a7,_0x58fced['error']['message']);return _0x2c909b(_0x58fced[_0xc08b('0xf')][_0xc08b('0x11')]);}else{logger[_0xc08b('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4552a7,_0xc08b('0xe'));_0x2c909b(_0x58fced[_0xc08b('0x12')][_0xc08b('0x11')]);}})['catch'](function(_0x5e483b){logger[_0xc08b('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4552a7,_0x5e483b);_0x54cc6e(_0x5e483b);});});} \ No newline at end of file +var _0xcbc7=['jayson/promise','client','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a0c3e,_0x5f3780){var _0x318886=function(_0x4f0da1){while(--_0x4f0da1){_0x5a0c3e['push'](_0x5a0c3e['shift']());}};_0x318886(++_0x5f3780);}(_0xcbc7,0xa0));var _0x7cbc=function(_0x571720,_0x344cea){_0x571720=_0x571720-0x0;var _0x55b384=_0xcbc7[_0x571720];return _0x55b384;};'use strict';var _=require('lodash');var util=require(_0x7cbc('0x0'));var moment=require('moment');var BPromise=require(_0x7cbc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7cbc('0x2'));var db=require(_0x7cbc('0x3'))['db'];var utils=require(_0x7cbc('0x4'));var logger=require(_0x7cbc('0x5'))(_0x7cbc('0x6'));var config=require(_0x7cbc('0x7'));var jayson=require(_0x7cbc('0x8'));var client=jayson[_0x7cbc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad599c,_0x5cd45c,_0x53dcfe){return new BPromise(function(_0x1709ff,_0x1bbad6){return client[_0x7cbc('0xa')](_0xad599c,_0x53dcfe)['then'](function(_0x4fb131){logger[_0x7cbc('0xb')](_0x7cbc('0xc'),_0x5cd45c,_0x7cbc('0xd'));logger[_0x7cbc('0xe')](_0x7cbc('0xf'),_0x5cd45c,'request\x20sent',JSON['stringify'](_0x4fb131));if(_0x4fb131[_0x7cbc('0x10')]){if(_0x4fb131['error'][_0x7cbc('0x11')]===0x1f4){logger[_0x7cbc('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5cd45c,_0x4fb131[_0x7cbc('0x10')][_0x7cbc('0x12')]);return _0x1bbad6(_0x4fb131[_0x7cbc('0x10')][_0x7cbc('0x12')]);}logger[_0x7cbc('0x10')](_0x7cbc('0xc'),_0x5cd45c,_0x4fb131[_0x7cbc('0x10')][_0x7cbc('0x12')]);return _0x1709ff(_0x4fb131[_0x7cbc('0x10')][_0x7cbc('0x12')]);}else{logger[_0x7cbc('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5cd45c,_0x7cbc('0xd'));_0x1709ff(_0x4fb131[_0x7cbc('0x13')][_0x7cbc('0x12')]);}})[_0x7cbc('0x14')](function(_0x5a70bc){logger[_0x7cbc('0x10')](_0x7cbc('0xc'),_0x5cd45c,_0x5a70bc);_0x1bbad6(_0x5a70bc);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 05fea9f..4b2cf07 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd824=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xd824,0x13e));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4d82('0x0'));var timeout=require(_0x4d82('0x1'));var express=require(_0x4d82('0x2'));var router=express['Router']();var fs_extra=require(_0x4d82('0x3'));var auth=require(_0x4d82('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d82('0x5'));var controller=require(_0x4d82('0x6'));router[_0x4d82('0x7')]('/',auth[_0x4d82('0x8')](),controller[_0x4d82('0x9')]);router[_0x4d82('0x7')](_0x4d82('0xa'),auth[_0x4d82('0x8')](),controller[_0x4d82('0xb')]);router[_0x4d82('0xc')]('/',auth[_0x4d82('0x8')](),controller['create']);router[_0x4d82('0xd')]('/:id',auth[_0x4d82('0x8')](),controller[_0x4d82('0xe')]);router['delete'](_0x4d82('0xa'),auth[_0x4d82('0x8')](),controller[_0x4d82('0xf')]);module[_0x4d82('0x10')]=router; \ No newline at end of file +var _0xe36a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe36a,0x1cf));var _0xae36=function(_0x26c323,_0x559fa7){_0x26c323=_0x26c323-0x0;var _0xaa4f94=_0xe36a[_0x26c323];return _0xaa4f94;};'use strict';var multer=require(_0xae36('0x0'));var util=require(_0xae36('0x1'));var path=require(_0xae36('0x2'));var timeout=require(_0xae36('0x3'));var express=require(_0xae36('0x4'));var router=express[_0xae36('0x5')]();var fs_extra=require(_0xae36('0x6'));var auth=require(_0xae36('0x7'));var interaction=require(_0xae36('0x8'));var config=require(_0xae36('0x9'));var controller=require(_0xae36('0xa'));router['get']('/',auth[_0xae36('0xb')](),controller[_0xae36('0xc')]);router[_0xae36('0xd')](_0xae36('0xe'),auth[_0xae36('0xb')](),controller[_0xae36('0xf')]);router[_0xae36('0x10')]('/',auth[_0xae36('0xb')](),controller[_0xae36('0x11')]);router[_0xae36('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xae36('0x13')]);router['delete'](_0xae36('0xe'),auth[_0xae36('0xb')](),controller[_0xae36('0x14')]);module[_0xae36('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f2fcdf8..597810c 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3f2=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING','variable'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe3f2,0x1b1));var _0x2e3f=function(_0x2faf55,_0x2069ad){_0x2faf55=_0x2faf55-0x0;var _0x1cc42c=_0xe3f2[_0x2faf55];return _0x1cc42c;};'use strict';var Sequelize=require(_0x2e3f('0x0'));module[_0x2e3f('0x1')]={'type':{'type':Sequelize[_0x2e3f('0x2')](_0x2e3f('0x3'),'variable',_0x2e3f('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2e3f('0x5')]},'key':{'type':Sequelize[_0x2e3f('0x5')]},'keyType':{'type':Sequelize[_0x2e3f('0x2')](_0x2e3f('0x3'),_0x2e3f('0x6'),_0x2e3f('0x4'))},'keyContent':{'type':Sequelize[_0x2e3f('0x5')]},'idField':{'type':Sequelize[_0x2e3f('0x5')]},'nameField':{'type':Sequelize[_0x2e3f('0x5')]},'customField':{'type':Sequelize[_0x2e3f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e3f('0x5')]}}; \ No newline at end of file +var _0x3356=['ENUM','sequelize','string','variable','customVariable','picklist','STRING'];(function(_0x27fc76,_0x1cfb91){var _0x461899=function(_0xb9dd20){while(--_0xb9dd20){_0x27fc76['push'](_0x27fc76['shift']());}};_0x461899(++_0x1cfb91);}(_0x3356,0xb7));var _0x6335=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x3356[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x6335('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6335('0x1'),_0x6335('0x2'),_0x6335('0x3'),'keyValue',_0x6335('0x4')),'defaultValue':_0x6335('0x1')},'content':{'type':Sequelize[_0x6335('0x5')]},'key':{'type':Sequelize[_0x6335('0x5')]},'keyType':{'type':Sequelize[_0x6335('0x6')](_0x6335('0x1'),_0x6335('0x2'),_0x6335('0x3'))},'keyContent':{'type':Sequelize[_0x6335('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6335('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6335('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d4e0da5..39c922a 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17b7=['../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','merge','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x48d51,_0x39d503){var _0x440e24=function(_0x1602fb){while(--_0x1602fb){_0x48d51['push'](_0x48d51['shift']());}};_0x440e24(++_0x39d503);}(_0x17b7,0x1a4));var _0x717b=function(_0x43e3f6,_0x3ecae1){_0x43e3f6=_0x43e3f6-0x0;var _0x327aaa=_0x17b7[_0x43e3f6];return _0x327aaa;};'use strict';var emlformat=require(_0x717b('0x0'));var rimraf=require(_0x717b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x717b('0x2'));var moment=require('moment');var BPromise=require(_0x717b('0x3'));var Mustache=require(_0x717b('0x4'));var util=require('util');var path=require(_0x717b('0x5'));var sox=require(_0x717b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x717b('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x717b('0x8'));var jsforce=require(_0x717b('0x9'));var deskjs=require(_0x717b('0xa'));var toCsv=require(_0x717b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x717b('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x717b('0xd'));var hardwareService=require(_0x717b('0xe'));var logger=require('../../config/logger')(_0x717b('0xf'));var utils=require(_0x717b('0x10'));var config=require(_0x717b('0x11'));var licenseUtil=require(_0x717b('0x12'));var db=require(_0x717b('0x13'))['db'];function respondWithStatusCode(_0x45831a,_0x463ec2){_0x463ec2=_0x463ec2||0xcc;return function(_0x5a36c3){if(_0x5a36c3){return _0x45831a['sendStatus'](_0x463ec2);}return _0x45831a[_0x717b('0x14')](_0x463ec2)[_0x717b('0x15')]();};}function respondWithResult(_0x56d98b,_0x5132ef){_0x5132ef=_0x5132ef||0xc8;return function(_0x10d585){if(_0x10d585){return _0x56d98b[_0x717b('0x14')](_0x5132ef)[_0x717b('0x16')](_0x10d585);}};}function respondWithFilteredResult(_0x1841f2,_0x18ea39){return function(_0x13eee3){if(_0x13eee3){var _0x14f4fc=typeof _0x18ea39['offset']==='undefined'&&typeof _0x18ea39[_0x717b('0x17')]===_0x717b('0x18');var _0x579759=_0x13eee3[_0x717b('0x19')];var _0x506d9f=_0x14f4fc?0x0:_0x18ea39[_0x717b('0x1a')];var _0x2a5f53=_0x14f4fc?_0x13eee3[_0x717b('0x19')]:_0x18ea39[_0x717b('0x1a')]+_0x18ea39[_0x717b('0x17')];var _0x3c9167;if(_0x2a5f53>=_0x579759){_0x2a5f53=_0x579759;_0x3c9167=0xc8;}else{_0x3c9167=0xce;}_0x1841f2[_0x717b('0x14')](_0x3c9167);return _0x1841f2[_0x717b('0x1b')]('Content-Range',_0x506d9f+'-'+_0x2a5f53+'/'+_0x579759)['json'](_0x13eee3);}return null;};}function patchUpdates(_0x2778ef){return function(_0x2ac048){try{jsonpatch[_0x717b('0x1c')](_0x2ac048,_0x2778ef,!![]);}catch(_0x7fb544){return BPromise[_0x717b('0x1d')](_0x7fb544);}return _0x2ac048[_0x717b('0x1e')]();};}function saveUpdates(_0xe0e886,_0x1e7164){return function(_0x5d14d6){if(_0x5d14d6){return _0x5d14d6[_0x717b('0x1f')](_0xe0e886)[_0x717b('0x20')](function(_0x297fe6){return _0x297fe6;});}return null;};}function removeEntity(_0x145323,_0x24cfa4){return function(_0x1208dc){if(_0x1208dc){return _0x1208dc[_0x717b('0x21')]()[_0x717b('0x20')](function(){_0x145323[_0x717b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aeac1,_0x3438aa){return function(_0x4e5dae){if(!_0x4e5dae){_0x3aeac1[_0x717b('0x22')](0x194);}return _0x4e5dae;};}function handleError(_0x16191d,_0x47552e){_0x47552e=_0x47552e||0x1f4;return function(_0x27f66b){logger[_0x717b('0x23')](_0x27f66b[_0x717b('0x24')]);if(_0x27f66b[_0x717b('0x25')]){delete _0x27f66b['name'];}_0x16191d['status'](_0x47552e)[_0x717b('0x26')](_0x27f66b);};}exports[_0x717b('0x27')]=function(_0x451ccf,_0x208102){var _0x3fbf73={},_0x8548be={},_0x244662={'count':0x0,'rows':[]};var _0x35d8cb=_['map'](db['Dynamics365Field'][_0x717b('0x28')],function(_0xf1d45a){return{'name':_0xf1d45a[_0x717b('0x29')],'type':_0xf1d45a[_0x717b('0x2a')][_0x717b('0x2b')]};});_0x8548be[_0x717b('0x2c')]=_['map'](_0x35d8cb,_0x717b('0x25'));_0x8548be['query']=_[_0x717b('0x2d')](_0x451ccf[_0x717b('0x2e')]);_0x8548be[_0x717b('0x2f')]=_[_0x717b('0x30')](_0x8548be[_0x717b('0x2c')],_0x8548be['query']);_0x3fbf73[_0x717b('0x31')]=_[_0x717b('0x30')](_0x8548be[_0x717b('0x2c')],qs['fields'](_0x451ccf[_0x717b('0x2e')]['fields']));_0x3fbf73['attributes']=_0x3fbf73[_0x717b('0x31')][_0x717b('0x32')]?_0x3fbf73[_0x717b('0x31')]:_0x8548be[_0x717b('0x2c')];if(!_0x451ccf[_0x717b('0x2e')][_0x717b('0x33')]('nolimit')){_0x3fbf73[_0x717b('0x17')]=qs[_0x717b('0x17')](_0x451ccf['query'][_0x717b('0x17')]);_0x3fbf73['offset']=qs[_0x717b('0x1a')](_0x451ccf[_0x717b('0x2e')][_0x717b('0x1a')]);}_0x3fbf73[_0x717b('0x34')]=qs['sort'](_0x451ccf[_0x717b('0x2e')][_0x717b('0x35')]);_0x3fbf73[_0x717b('0x36')]=qs[_0x717b('0x2f')](_[_0x717b('0x37')](_0x451ccf[_0x717b('0x2e')],_0x8548be[_0x717b('0x2f')]),_0x35d8cb);if(_0x451ccf[_0x717b('0x2e')]['filter']){_0x3fbf73[_0x717b('0x36')]=_['merge'](_0x3fbf73[_0x717b('0x36')],{'$or':_[_0x717b('0x38')](_0x35d8cb,function(_0x495c68){if(_0x495c68[_0x717b('0x2a')]!==_0x717b('0x39')){var _0xdefcc2={};_0xdefcc2[_0x495c68[_0x717b('0x25')]]={'$like':'%'+_0x451ccf[_0x717b('0x2e')][_0x717b('0x3a')]+'%'};return _0xdefcc2;}})});}_0x3fbf73=_[_0x717b('0x3b')]({},_0x3fbf73,_0x451ccf[_0x717b('0x3c')]);var _0x38e058={'where':_0x3fbf73[_0x717b('0x36')]};return db[_0x717b('0x3d')]['count'](_0x38e058)['then'](function(_0x365fbf){_0x244662[_0x717b('0x19')]=_0x365fbf;if(_0x451ccf['query'][_0x717b('0x3e')]){_0x3fbf73[_0x717b('0x3f')]=[{'all':!![]}];}return db[_0x717b('0x3d')][_0x717b('0x40')](_0x3fbf73);})[_0x717b('0x20')](function(_0x599a71){_0x244662[_0x717b('0x41')]=_0x599a71;return _0x244662;})['then'](respondWithFilteredResult(_0x208102,_0x3fbf73))[_0x717b('0x42')](handleError(_0x208102,null));};exports[_0x717b('0x43')]=function(_0x12dd4a,_0x28fe25){var _0x416d66={'raw':!![],'where':{'id':_0x12dd4a[_0x717b('0x44')]['id']}},_0x3393cc={};_0x3393cc[_0x717b('0x2c')]=_['keys'](db['Dynamics365Field'][_0x717b('0x28')]);_0x3393cc['query']=_['keys'](_0x12dd4a[_0x717b('0x2e')]);_0x3393cc['filters']=_[_0x717b('0x30')](_0x3393cc[_0x717b('0x2c')],_0x3393cc[_0x717b('0x2e')]);_0x416d66['attributes']=_[_0x717b('0x30')](_0x3393cc[_0x717b('0x2c')],qs[_0x717b('0x45')](_0x12dd4a[_0x717b('0x2e')]['fields']));_0x416d66[_0x717b('0x31')]=_0x416d66[_0x717b('0x31')][_0x717b('0x32')]?_0x416d66[_0x717b('0x31')]:_0x3393cc[_0x717b('0x2c')];if(_0x12dd4a[_0x717b('0x2e')][_0x717b('0x3e')]){_0x416d66[_0x717b('0x3f')]=[{'all':!![]}];}_0x416d66=_[_0x717b('0x3b')]({},_0x416d66,_0x12dd4a[_0x717b('0x3c')]);return db['Dynamics365Field'][_0x717b('0x46')](_0x416d66)[_0x717b('0x20')](handleEntityNotFound(_0x28fe25,null))[_0x717b('0x20')](respondWithResult(_0x28fe25,null))[_0x717b('0x42')](handleError(_0x28fe25,null));};exports[_0x717b('0x47')]=function(_0x5b370c,_0x14b3f8){return db['Dynamics365Field'][_0x717b('0x47')](_0x5b370c[_0x717b('0x48')],{})[_0x717b('0x20')](respondWithResult(_0x14b3f8,0xc9))[_0x717b('0x42')](handleError(_0x14b3f8,null));};exports[_0x717b('0x1f')]=function(_0x4dfb66,_0xad184b){if(_0x4dfb66[_0x717b('0x48')]['id']){delete _0x4dfb66[_0x717b('0x48')]['id'];}return db['Dynamics365Field'][_0x717b('0x46')]({'where':{'id':_0x4dfb66[_0x717b('0x44')]['id']}})[_0x717b('0x20')](handleEntityNotFound(_0xad184b,null))[_0x717b('0x20')](saveUpdates(_0x4dfb66['body'],null))['then'](respondWithResult(_0xad184b,null))[_0x717b('0x42')](handleError(_0xad184b,null));};exports['destroy']=function(_0x31ccf6,_0x427f49){return db[_0x717b('0x3d')][_0x717b('0x46')]({'where':{'id':_0x31ccf6[_0x717b('0x44')]['id']}})[_0x717b('0x20')](handleEntityNotFound(_0x427f49,null))[_0x717b('0x20')](removeEntity(_0x427f49,null))[_0x717b('0x42')](handleError(_0x427f49,null));}; \ No newline at end of file +var _0x1374=['index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send'];(function(_0x36b4ad,_0x25fd0e){var _0x59c428=function(_0x2c748c){while(--_0x2c748c){_0x36b4ad['push'](_0x36b4ad['shift']());}};_0x59c428(++_0x25fd0e);}(_0x1374,0x1c2));var _0x4137=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1374[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4137('0x0'));var zipdir=require(_0x4137('0x1'));var jsonpatch=require(_0x4137('0x2'));var rp=require(_0x4137('0x3'));var moment=require(_0x4137('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4137('0x5'));var util=require(_0x4137('0x6'));var path=require(_0x4137('0x7'));var sox=require(_0x4137('0x8'));var csv=require(_0x4137('0x9'));var ejs=require(_0x4137('0xa'));var fs=require('fs');var fs_extra=require(_0x4137('0xb'));var _=require(_0x4137('0xc'));var squel=require(_0x4137('0xd'));var crypto=require(_0x4137('0xe'));var jsforce=require(_0x4137('0xf'));var deskjs=require(_0x4137('0x10'));var toCsv=require(_0x4137('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4137('0x11'));var authService=require(_0x4137('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4137('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4137('0x14'));var utils=require('../../config/utils');var config=require(_0x4137('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4137('0x16'))['db'];function respondWithStatusCode(_0x222a83,_0x1b0ad3){_0x1b0ad3=_0x1b0ad3||0xcc;return function(_0x425e28){if(_0x425e28){return _0x222a83['sendStatus'](_0x1b0ad3);}return _0x222a83[_0x4137('0x17')](_0x1b0ad3)[_0x4137('0x18')]();};}function respondWithResult(_0x433b1d,_0x4594ed){_0x4594ed=_0x4594ed||0xc8;return function(_0x1d8e8f){if(_0x1d8e8f){return _0x433b1d['status'](_0x4594ed)[_0x4137('0x19')](_0x1d8e8f);}};}function respondWithFilteredResult(_0x1de539,_0x5d2fcc){return function(_0x18b4ad){if(_0x18b4ad){var _0xba90eb=typeof _0x5d2fcc[_0x4137('0x1a')]===_0x4137('0x1b')&&typeof _0x5d2fcc[_0x4137('0x1c')]===_0x4137('0x1b');var _0x596ed9=_0x18b4ad[_0x4137('0x1d')];var _0x4cf7e6=_0xba90eb?0x0:_0x5d2fcc[_0x4137('0x1a')];var _0x10df7d=_0xba90eb?_0x18b4ad[_0x4137('0x1d')]:_0x5d2fcc['offset']+_0x5d2fcc[_0x4137('0x1c')];var _0x21874b;if(_0x10df7d>=_0x596ed9){_0x10df7d=_0x596ed9;_0x21874b=0xc8;}else{_0x21874b=0xce;}_0x1de539[_0x4137('0x17')](_0x21874b);return _0x1de539[_0x4137('0x1e')](_0x4137('0x1f'),_0x4cf7e6+'-'+_0x10df7d+'/'+_0x596ed9)[_0x4137('0x19')](_0x18b4ad);}return null;};}function patchUpdates(_0x580f29){return function(_0x31d94f){try{jsonpatch[_0x4137('0x20')](_0x31d94f,_0x580f29,!![]);}catch(_0x2fe7dd){return BPromise[_0x4137('0x21')](_0x2fe7dd);}return _0x31d94f['save']();};}function saveUpdates(_0xb6c907,_0x57aa67){return function(_0x480bd0){if(_0x480bd0){return _0x480bd0[_0x4137('0x22')](_0xb6c907)[_0x4137('0x23')](function(_0x18e8a2){return _0x18e8a2;});}return null;};}function removeEntity(_0x4db3b3,_0xc2a22){return function(_0x125867){if(_0x125867){return _0x125867['destroy']()[_0x4137('0x23')](function(){_0x4db3b3[_0x4137('0x17')](0xcc)[_0x4137('0x18')]();});}};}function handleEntityNotFound(_0x2e4d60,_0x4c5bd9){return function(_0x31e660){if(!_0x31e660){_0x2e4d60[_0x4137('0x24')](0x194);}return _0x31e660;};}function handleError(_0x529c42,_0x5a7ce7){_0x5a7ce7=_0x5a7ce7||0x1f4;return function(_0x10c28d){logger['error'](_0x10c28d[_0x4137('0x25')]);if(_0x10c28d['name']){delete _0x10c28d[_0x4137('0x26')];}_0x529c42[_0x4137('0x17')](_0x5a7ce7)[_0x4137('0x27')](_0x10c28d);};}exports[_0x4137('0x28')]=function(_0x5ca64b,_0x2ab02a){var _0x5075cd={},_0x306f78={},_0x54297b={'count':0x0,'rows':[]};var _0x1bd783=_['map'](db[_0x4137('0x29')][_0x4137('0x2a')],function(_0xdfb1d6){return{'name':_0xdfb1d6[_0x4137('0x2b')],'type':_0xdfb1d6[_0x4137('0x2c')][_0x4137('0x2d')]};});_0x306f78[_0x4137('0x2e')]=_[_0x4137('0x2f')](_0x1bd783,'name');_0x306f78[_0x4137('0x30')]=_['keys'](_0x5ca64b[_0x4137('0x30')]);_0x306f78[_0x4137('0x31')]=_[_0x4137('0x32')](_0x306f78['model'],_0x306f78['query']);_0x5075cd[_0x4137('0x33')]=_[_0x4137('0x32')](_0x306f78['model'],qs[_0x4137('0x34')](_0x5ca64b[_0x4137('0x30')][_0x4137('0x34')]));_0x5075cd['attributes']=_0x5075cd[_0x4137('0x33')][_0x4137('0x35')]?_0x5075cd[_0x4137('0x33')]:_0x306f78[_0x4137('0x2e')];if(!_0x5ca64b[_0x4137('0x30')][_0x4137('0x36')]('nolimit')){_0x5075cd[_0x4137('0x1c')]=qs['limit'](_0x5ca64b[_0x4137('0x30')]['limit']);_0x5075cd[_0x4137('0x1a')]=qs[_0x4137('0x1a')](_0x5ca64b['query'][_0x4137('0x1a')]);}_0x5075cd[_0x4137('0x37')]=qs[_0x4137('0x38')](_0x5ca64b[_0x4137('0x30')][_0x4137('0x38')]);_0x5075cd[_0x4137('0x39')]=qs[_0x4137('0x31')](_['pick'](_0x5ca64b[_0x4137('0x30')],_0x306f78['filters']),_0x1bd783);if(_0x5ca64b['query']['filter']){_0x5075cd[_0x4137('0x39')]=_[_0x4137('0x3a')](_0x5075cd['where'],{'$or':_[_0x4137('0x2f')](_0x1bd783,function(_0x5f4f56){if(_0x5f4f56[_0x4137('0x2c')]!=='VIRTUAL'){var _0x3399dc={};_0x3399dc[_0x5f4f56['name']]={'$like':'%'+_0x5ca64b['query']['filter']+'%'};return _0x3399dc;}})});}_0x5075cd=_[_0x4137('0x3a')]({},_0x5075cd,_0x5ca64b[_0x4137('0x3b')]);var _0x38ee98={'where':_0x5075cd[_0x4137('0x39')]};return db['Dynamics365Field'][_0x4137('0x1d')](_0x38ee98)[_0x4137('0x23')](function(_0xab4097){_0x54297b[_0x4137('0x1d')]=_0xab4097;if(_0x5ca64b['query'][_0x4137('0x3c')]){_0x5075cd[_0x4137('0x3d')]=[{'all':!![]}];}return db[_0x4137('0x29')][_0x4137('0x3e')](_0x5075cd);})[_0x4137('0x23')](function(_0x5c6e6e){_0x54297b[_0x4137('0x3f')]=_0x5c6e6e;return _0x54297b;})[_0x4137('0x23')](respondWithFilteredResult(_0x2ab02a,_0x5075cd))[_0x4137('0x40')](handleError(_0x2ab02a,null));};exports['show']=function(_0x503fd9,_0x4e0b21){var _0x429734={'raw':!![],'where':{'id':_0x503fd9[_0x4137('0x41')]['id']}},_0x100e8d={};_0x100e8d['model']=_[_0x4137('0x42')](db[_0x4137('0x29')][_0x4137('0x2a')]);_0x100e8d[_0x4137('0x30')]=_['keys'](_0x503fd9[_0x4137('0x30')]);_0x100e8d[_0x4137('0x31')]=_[_0x4137('0x32')](_0x100e8d[_0x4137('0x2e')],_0x100e8d[_0x4137('0x30')]);_0x429734[_0x4137('0x33')]=_['intersection'](_0x100e8d[_0x4137('0x2e')],qs[_0x4137('0x34')](_0x503fd9['query']['fields']));_0x429734['attributes']=_0x429734['attributes']['length']?_0x429734[_0x4137('0x33')]:_0x100e8d[_0x4137('0x2e')];if(_0x503fd9[_0x4137('0x30')][_0x4137('0x3c')]){_0x429734['include']=[{'all':!![]}];}_0x429734=_[_0x4137('0x3a')]({},_0x429734,_0x503fd9['options']);return db[_0x4137('0x29')][_0x4137('0x43')](_0x429734)[_0x4137('0x23')](handleEntityNotFound(_0x4e0b21,null))[_0x4137('0x23')](respondWithResult(_0x4e0b21,null))[_0x4137('0x40')](handleError(_0x4e0b21,null));};exports[_0x4137('0x44')]=function(_0x59e2ae,_0x45d9af){return db[_0x4137('0x29')][_0x4137('0x44')](_0x59e2ae[_0x4137('0x45')],{})['then'](respondWithResult(_0x45d9af,0xc9))[_0x4137('0x40')](handleError(_0x45d9af,null));};exports[_0x4137('0x22')]=function(_0x5280af,_0x3cc285){if(_0x5280af[_0x4137('0x45')]['id']){delete _0x5280af[_0x4137('0x45')]['id'];}return db['Dynamics365Field'][_0x4137('0x43')]({'where':{'id':_0x5280af[_0x4137('0x41')]['id']}})[_0x4137('0x23')](handleEntityNotFound(_0x3cc285,null))['then'](saveUpdates(_0x5280af[_0x4137('0x45')],null))[_0x4137('0x23')](respondWithResult(_0x3cc285,null))[_0x4137('0x40')](handleError(_0x3cc285,null));};exports['destroy']=function(_0x3758f1,_0x31f631){return db['Dynamics365Field'][_0x4137('0x43')]({'where':{'id':_0x3758f1['params']['id']}})[_0x4137('0x23')](handleEntityNotFound(_0x31f631,null))['then'](removeEntity(_0x31f631,null))[_0x4137('0x40')](handleError(_0x31f631,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index abe9d61..a18f900 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a6=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x45a6,0x6e));var _0x645a=function(_0x1f61e3,_0x4d6d2a){_0x1f61e3=_0x1f61e3-0x0;var _0x3f7da6=_0x45a6[_0x1f61e3];return _0x3f7da6;};'use strict';var _=require(_0x645a('0x0'));var util=require(_0x645a('0x1'));var logger=require(_0x645a('0x2'))('api');var moment=require(_0x645a('0x3'));var BPromise=require(_0x645a('0x4'));var rp=require(_0x645a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x645a('0x6'));var config=require('../../config/environment');var attributes=require(_0x645a('0x7'));module[_0x645a('0x8')]=function(_0x5bd2b1,_0x29bfe3){return _0x5bd2b1[_0x645a('0x9')](_0x645a('0xa'),attributes,{'tableName':_0x645a('0xb'),'paranoid':![],'indexes':[{'name':_0x645a('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaefe=['int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x1c75a4,_0x316603){var _0x3fed51=function(_0x34668d){while(--_0x34668d){_0x1c75a4['push'](_0x1c75a4['shift']());}};_0x3fed51(++_0x316603);}(_0xaefe,0xc6));var _0xeaef=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xaefe[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0xeaef('0x0'));var util=require('util');var logger=require(_0xeaef('0x1'))(_0xeaef('0x2'));var moment=require(_0xeaef('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeaef('0x4'));var rimraf=require(_0xeaef('0x5'));var config=require(_0xeaef('0x6'));var attributes=require(_0xeaef('0x7'));module[_0xeaef('0x8')]=function(_0x584f91,_0x5a2aa9){return _0x584f91['define'](_0xeaef('0x9'),attributes,{'tableName':_0xeaef('0xa'),'paranoid':![],'indexes':[{'name':_0xeaef('0xb'),'fields':['idField',_0xeaef('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index af05076..ed89578 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e06=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e06,0xce));var _0x68e0=function(_0x5f4b1c,_0x55e849){_0x5f4b1c=_0x5f4b1c-0x0;var _0x27b8d4=_0x8e06[_0x5f4b1c];return _0x27b8d4;};'use strict';var _=require(_0x68e0('0x0'));var util=require(_0x68e0('0x1'));var moment=require(_0x68e0('0x2'));var BPromise=require(_0x68e0('0x3'));var rs=require(_0x68e0('0x4'));var fs=require('fs');var Redis=require(_0x68e0('0x5'));var db=require(_0x68e0('0x6'))['db'];var utils=require(_0x68e0('0x7'));var logger=require(_0x68e0('0x8'))('rpc');var config=require(_0x68e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x68e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27d0d2,_0x2b84e8,_0x2128f0){return new BPromise(function(_0x1e6182,_0x23423b){return client[_0x68e0('0xb')](_0x27d0d2,_0x2128f0)['then'](function(_0x4e371d){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2b84e8,_0x68e0('0xc'));logger[_0x68e0('0xd')](_0x68e0('0xe'),_0x2b84e8,_0x68e0('0xc'),JSON[_0x68e0('0xf')](_0x4e371d));if(_0x4e371d[_0x68e0('0x10')]){if(_0x4e371d[_0x68e0('0x10')][_0x68e0('0x11')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2b84e8,_0x4e371d[_0x68e0('0x10')][_0x68e0('0x12')]);return _0x23423b(_0x4e371d[_0x68e0('0x10')][_0x68e0('0x12')]);}logger['error'](_0x68e0('0x13'),_0x2b84e8,_0x4e371d[_0x68e0('0x10')][_0x68e0('0x12')]);return _0x1e6182(_0x4e371d[_0x68e0('0x10')][_0x68e0('0x12')]);}else{logger[_0x68e0('0x14')](_0x68e0('0x13'),_0x2b84e8,_0x68e0('0xc'));_0x1e6182(_0x4e371d[_0x68e0('0x15')][_0x68e0('0x12')]);}})['catch'](function(_0x5b95e5){logger[_0x68e0('0x10')](_0x68e0('0x13'),_0x2b84e8,_0x5b95e5);_0x23423b(_0x5b95e5);});});} \ No newline at end of file +var _0x6b6b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6b6b,0x1ea));var _0xb6b6=function(_0x38f21b,_0x4d5b4b){_0x38f21b=_0x38f21b-0x0;var _0x2f2b84=_0x6b6b[_0x38f21b];return _0x2f2b84;};'use strict';var _=require(_0xb6b6('0x0'));var util=require(_0xb6b6('0x1'));var moment=require(_0xb6b6('0x2'));var BPromise=require(_0xb6b6('0x3'));var rs=require(_0xb6b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6b6('0x5'))['db'];var utils=require(_0xb6b6('0x6'));var logger=require(_0xb6b6('0x7'))(_0xb6b6('0x8'));var config=require(_0xb6b6('0x9'));var jayson=require(_0xb6b6('0xa'));var client=jayson[_0xb6b6('0xb')][_0xb6b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x349232,_0x595f4a,_0x4e7e4e){return new BPromise(function(_0x36c66b,_0x252e04){return client[_0xb6b6('0xd')](_0x349232,_0x4e7e4e)[_0xb6b6('0xe')](function(_0x3cabea){logger[_0xb6b6('0xf')](_0xb6b6('0x10'),_0x595f4a,_0xb6b6('0x11'));logger[_0xb6b6('0x12')](_0xb6b6('0x13'),_0x595f4a,_0xb6b6('0x11'),JSON[_0xb6b6('0x14')](_0x3cabea));if(_0x3cabea[_0xb6b6('0x15')]){if(_0x3cabea['error'][_0xb6b6('0x16')]===0x1f4){logger[_0xb6b6('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x595f4a,_0x3cabea[_0xb6b6('0x15')]['message']);return _0x252e04(_0x3cabea[_0xb6b6('0x15')][_0xb6b6('0x17')]);}logger[_0xb6b6('0x15')](_0xb6b6('0x10'),_0x595f4a,_0x3cabea[_0xb6b6('0x15')][_0xb6b6('0x17')]);return _0x36c66b(_0x3cabea[_0xb6b6('0x15')][_0xb6b6('0x17')]);}else{logger[_0xb6b6('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x595f4a,_0xb6b6('0x11'));_0x36c66b(_0x3cabea[_0xb6b6('0x18')][_0xb6b6('0x17')]);}})[_0xb6b6('0x19')](function(_0x326bf9){logger[_0xb6b6('0x15')](_0xb6b6('0x10'),_0x595f4a,_0x326bf9);_0x252e04(_0x326bf9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 2dae199..76062d7 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61f5=['/:id','/:id/configurations','/:id/fields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index'];(function(_0x4494ed,_0x1ce1e8){var _0x48fd5f=function(_0x196c36){while(--_0x196c36){_0x4494ed['push'](_0x4494ed['shift']());}};_0x48fd5f(++_0x1ce1e8);}(_0x61f5,0x94));var _0x561f=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x61f5[_0x53f897];return _0x6879f8;};'use strict';var multer=require(_0x561f('0x0'));var util=require(_0x561f('0x1'));var path=require(_0x561f('0x2'));var timeout=require(_0x561f('0x3'));var express=require(_0x561f('0x4'));var router=express['Router']();var fs_extra=require(_0x561f('0x5'));var auth=require(_0x561f('0x6'));var interaction=require(_0x561f('0x7'));var config=require(_0x561f('0x8'));var controller=require(_0x561f('0x9'));router[_0x561f('0xa')]('/',auth[_0x561f('0xb')](),controller[_0x561f('0xc')]);router['get'](_0x561f('0xd'),auth[_0x561f('0xb')](),controller['show']);router[_0x561f('0xa')](_0x561f('0xe'),auth[_0x561f('0xb')](),controller['getConfigurations']);router[_0x561f('0xa')](_0x561f('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x561f('0x10')]('/',auth[_0x561f('0xb')](),controller[_0x561f('0x11')]);router[_0x561f('0x10')](_0x561f('0xe'),auth[_0x561f('0xb')](),controller['addConfiguration']);router[_0x561f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x561f('0x13')]);router[_0x561f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x561f('0x15')]);module[_0x561f('0x16')]=router; \ No newline at end of file +var _0xa034=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','/:id','show','getConfigurations','isAuthenticated','getFields','post','/:id/configurations','addConfiguration','update','delete','destroy','multer'];(function(_0x95cb04,_0x20ef0b){var _0x239b42=function(_0xf0a5b6){while(--_0xf0a5b6){_0x95cb04['push'](_0x95cb04['shift']());}};_0x239b42(++_0x20ef0b);}(_0xa034,0x1cd));var _0x4a03=function(_0x445b3b,_0xc46e6f){_0x445b3b=_0x445b3b-0x0;var _0x5842cb=_0xa034[_0x445b3b];return _0x5842cb;};'use strict';var multer=require(_0x4a03('0x0'));var util=require(_0x4a03('0x1'));var path=require('path');var timeout=require(_0x4a03('0x2'));var express=require(_0x4a03('0x3'));var router=express[_0x4a03('0x4')]();var fs_extra=require(_0x4a03('0x5'));var auth=require(_0x4a03('0x6'));var interaction=require(_0x4a03('0x7'));var config=require('../../config/environment');var controller=require(_0x4a03('0x8'));router[_0x4a03('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a03('0xa')]);router[_0x4a03('0x9')](_0x4a03('0xb'),auth['isAuthenticated'](),controller[_0x4a03('0xc')]);router[_0x4a03('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4a03('0xd')]);router['get']('/:id/fields',auth[_0x4a03('0xe')](),controller[_0x4a03('0xf')]);router[_0x4a03('0x10')]('/',auth[_0x4a03('0xe')](),controller['create']);router['post'](_0x4a03('0x11'),auth[_0x4a03('0xe')](),controller[_0x4a03('0x12')]);router['put'](_0x4a03('0xb'),auth[_0x4a03('0xe')](),controller[_0x4a03('0x13')]);router[_0x4a03('0x14')](_0x4a03('0xb'),auth[_0x4a03('0xe')](),controller[_0x4a03('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a6052fd..b8f438f 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['STRING','username','sequelize','exports'];(function(_0x199350,_0x19ab6f){var _0x5b9a52=function(_0x124486){while(--_0x124486){_0x199350['push'](_0x199350['shift']());}};_0x5b9a52(++_0x19ab6f);}(_0xa456,0x142));var _0x6a45=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa456[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x596f3f,_0x53c5bf){var _0x2c1225=function(_0x211f6d){while(--_0x211f6d){_0x596f3f['push'](_0x596f3f['shift']());}};_0x2c1225(++_0x53c5bf);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5c53ac,_0x171f3e){_0x5c53ac=_0x5c53ac-0x0;var _0x53d055=_0xaebd[_0x5c53ac];return _0x53d055;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0cb38f5..58d3e45 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2bf=['apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','end','error','stack','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','find','create','body','update','getConfigurations','FreshdeskConfiguration','options','addConfiguration','findOne','Subjects','FreshdeskField','getFields','remoteUri'];(function(_0x2609fd,_0x4fc52e){var _0x3f9db1=function(_0x488457){while(--_0x488457){_0x2609fd['push'](_0x2609fd['shift']());}};_0x3f9db1(++_0x4fc52e);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xd2bf[_0x2cc711];return _0x31a52e;};'use strict';var emlformat=require(_0xfd2b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd2b('0x1'));var moment=require(_0xfd2b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfd2b('0x3'));var util=require('util');var path=require(_0xfd2b('0x4'));var sox=require(_0xfd2b('0x5'));var csv=require(_0xfd2b('0x6'));var ejs=require(_0xfd2b('0x7'));var fs=require('fs');var fs_extra=require(_0xfd2b('0x8'));var _=require('lodash');var squel=require(_0xfd2b('0x9'));var crypto=require(_0xfd2b('0xa'));var jsforce=require(_0xfd2b('0xb'));var deskjs=require(_0xfd2b('0xc'));var toCsv=require(_0xfd2b('0x6'));var querystring=require(_0xfd2b('0xd'));var Papa=require(_0xfd2b('0xe'));var Redis=require(_0xfd2b('0xf'));var authService=require(_0xfd2b('0x10'));var qs=require(_0xfd2b('0x11'));var as=require(_0xfd2b('0x12'));var hardwareService=require(_0xfd2b('0x13'));var logger=require(_0xfd2b('0x14'))(_0xfd2b('0x15'));var utils=require('../../config/utils');var config=require(_0xfd2b('0x16'));var licenseUtil=require(_0xfd2b('0x17'));var db=require(_0xfd2b('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x441175,_0x51e8ef){_0x51e8ef=_0x51e8ef||0xcc;return function(_0xa1fdbd){if(_0xa1fdbd){return _0x441175[_0xfd2b('0x19')](_0x51e8ef);}return _0x441175[_0xfd2b('0x1a')](_0x51e8ef)['end']();};}function respondWithResult(_0x361c89,_0x1be5d8){_0x1be5d8=_0x1be5d8||0xc8;return function(_0x2bc40c){if(_0x2bc40c){return _0x361c89[_0xfd2b('0x1a')](_0x1be5d8)[_0xfd2b('0x1b')](_0x2bc40c);}};}function respondWithFilteredResult(_0x53344d,_0xec43de){return function(_0x130b62){if(_0x130b62){var _0x374c92=typeof _0xec43de[_0xfd2b('0x1c')]===_0xfd2b('0x1d')&&typeof _0xec43de[_0xfd2b('0x1e')]==='undefined';var _0x4df522=_0x130b62[_0xfd2b('0x1f')];var _0x738bd=_0x374c92?0x0:_0xec43de[_0xfd2b('0x1c')];var _0x28b353=_0x374c92?_0x130b62[_0xfd2b('0x1f')]:_0xec43de['offset']+_0xec43de[_0xfd2b('0x1e')];var _0x389ea5;if(_0x28b353>=_0x4df522){_0x28b353=_0x4df522;_0x389ea5=0xc8;}else{_0x389ea5=0xce;}_0x53344d[_0xfd2b('0x1a')](_0x389ea5);return _0x53344d[_0xfd2b('0x20')]('Content-Range',_0x738bd+'-'+_0x28b353+'/'+_0x4df522)[_0xfd2b('0x1b')](_0x130b62);}return null;};}function patchUpdates(_0x104282){return function(_0x463fb0){try{jsonpatch['apply'](_0x463fb0,_0x104282,!![]);}catch(_0x1ccfa7){return BPromise[_0xfd2b('0x21')](_0x1ccfa7);}return _0x463fb0[_0xfd2b('0x22')]();};}function saveUpdates(_0x28fbc4,_0x4b15ed){return function(_0x3c9ffa){if(_0x3c9ffa){return _0x3c9ffa['update'](_0x28fbc4)[_0xfd2b('0x23')](function(_0x28a405){return _0x28a405;});}return null;};}function removeEntity(_0x5ada3e,_0x337f15){return function(_0x17ec35){if(_0x17ec35){return _0x17ec35[_0xfd2b('0x24')]()[_0xfd2b('0x23')](function(){_0x5ada3e[_0xfd2b('0x1a')](0xcc)[_0xfd2b('0x25')]();});}};}function handleEntityNotFound(_0x1cd6d5,_0x983c56){return function(_0xe895ef){if(!_0xe895ef){_0x1cd6d5['sendStatus'](0x194);}return _0xe895ef;};}function handleError(_0x203de3,_0x1b7126){_0x1b7126=_0x1b7126||0x1f4;return function(_0x3dd59c){logger[_0xfd2b('0x26')](_0x3dd59c[_0xfd2b('0x27')]);if(_0x3dd59c[_0xfd2b('0x28')]){delete _0x3dd59c[_0xfd2b('0x28')];}_0x203de3['status'](_0x1b7126)[_0xfd2b('0x29')](_0x3dd59c);};}exports['index']=function(_0x3fabea,_0x1fbcff){var _0x160c54={},_0x38a250={},_0xa9e1aa={'count':0x0,'rows':[]};var _0x466a7c=_[_0xfd2b('0x2a')](db[_0xfd2b('0x2b')][_0xfd2b('0x2c')],function(_0xcc090f){return{'name':_0xcc090f[_0xfd2b('0x2d')],'type':_0xcc090f[_0xfd2b('0x2e')][_0xfd2b('0x2f')]};});_0x38a250['model']=_[_0xfd2b('0x2a')](_0x466a7c,_0xfd2b('0x28'));_0x38a250[_0xfd2b('0x30')]=_[_0xfd2b('0x31')](_0x3fabea[_0xfd2b('0x30')]);_0x38a250['filters']=_[_0xfd2b('0x32')](_0x38a250[_0xfd2b('0x33')],_0x38a250[_0xfd2b('0x30')]);_0x160c54[_0xfd2b('0x34')]=_[_0xfd2b('0x32')](_0x38a250['model'],qs['fields'](_0x3fabea[_0xfd2b('0x30')][_0xfd2b('0x35')]));_0x160c54['attributes']=_0x160c54['attributes'][_0xfd2b('0x36')]?_0x160c54[_0xfd2b('0x34')]:_0x38a250[_0xfd2b('0x33')];if(!_0x3fabea[_0xfd2b('0x30')][_0xfd2b('0x37')](_0xfd2b('0x38'))){_0x160c54[_0xfd2b('0x1e')]=qs['limit'](_0x3fabea[_0xfd2b('0x30')]['limit']);_0x160c54[_0xfd2b('0x1c')]=qs['offset'](_0x3fabea[_0xfd2b('0x30')][_0xfd2b('0x1c')]);}_0x160c54[_0xfd2b('0x39')]=qs[_0xfd2b('0x3a')](_0x3fabea['query'][_0xfd2b('0x3a')]);_0x160c54[_0xfd2b('0x3b')]=qs[_0xfd2b('0x3c')](_[_0xfd2b('0x3d')](_0x3fabea[_0xfd2b('0x30')],_0x38a250['filters']),_0x466a7c);if(_0x3fabea[_0xfd2b('0x30')][_0xfd2b('0x3e')]){_0x160c54[_0xfd2b('0x3b')]=_[_0xfd2b('0x3f')](_0x160c54[_0xfd2b('0x3b')],{'$or':_[_0xfd2b('0x2a')](_0x466a7c,function(_0x43d221){if(_0x43d221[_0xfd2b('0x2e')]!=='VIRTUAL'){var _0x2ba2ec={};_0x2ba2ec[_0x43d221[_0xfd2b('0x28')]]={'$like':'%'+_0x3fabea['query']['filter']+'%'};return _0x2ba2ec;}})});}_0x160c54=_[_0xfd2b('0x3f')]({},_0x160c54,_0x3fabea['options']);var _0x366fa4={'where':_0x160c54[_0xfd2b('0x3b')]};return db['FreshdeskAccount']['count'](_0x366fa4)['then'](function(_0xbac10){_0xa9e1aa[_0xfd2b('0x1f')]=_0xbac10;if(_0x3fabea[_0xfd2b('0x30')][_0xfd2b('0x40')]){_0x160c54[_0xfd2b('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xfd2b('0x42')](_0x160c54);})[_0xfd2b('0x23')](function(_0x3fb993){_0xa9e1aa[_0xfd2b('0x43')]=_0x3fb993;return _0xa9e1aa;})[_0xfd2b('0x23')](respondWithFilteredResult(_0x1fbcff,_0x160c54))[_0xfd2b('0x44')](handleError(_0x1fbcff,null));};exports['show']=function(_0x170473,_0x1960a8){var _0x3a295b={'raw':![],'where':{'id':_0x170473[_0xfd2b('0x45')]['id']}},_0x189d3b={};_0x189d3b[_0xfd2b('0x33')]=_[_0xfd2b('0x31')](db[_0xfd2b('0x2b')][_0xfd2b('0x2c')]);_0x189d3b[_0xfd2b('0x30')]=_[_0xfd2b('0x31')](_0x170473[_0xfd2b('0x30')]);_0x189d3b['filters']=_[_0xfd2b('0x32')](_0x189d3b[_0xfd2b('0x33')],_0x189d3b[_0xfd2b('0x30')]);_0x3a295b[_0xfd2b('0x34')]=_['intersection'](_0x189d3b[_0xfd2b('0x33')],qs[_0xfd2b('0x35')](_0x170473[_0xfd2b('0x30')][_0xfd2b('0x35')]));_0x3a295b[_0xfd2b('0x34')]=_0x3a295b['attributes'][_0xfd2b('0x36')]?_0x3a295b[_0xfd2b('0x34')]:_0x189d3b[_0xfd2b('0x33')];if(_0x170473[_0xfd2b('0x30')][_0xfd2b('0x40')]){_0x3a295b[_0xfd2b('0x41')]=[{'all':!![]}];}_0x3a295b=_['merge']({},_0x3a295b,_0x170473['options']);return db[_0xfd2b('0x2b')][_0xfd2b('0x46')](_0x3a295b)[_0xfd2b('0x23')](handleEntityNotFound(_0x1960a8,null))[_0xfd2b('0x23')](respondWithResult(_0x1960a8,null))[_0xfd2b('0x44')](handleError(_0x1960a8,null));};exports[_0xfd2b('0x47')]=function(_0x12d781,_0x54ed0f){return db[_0xfd2b('0x2b')]['create'](_0x12d781[_0xfd2b('0x48')],{})[_0xfd2b('0x23')](respondWithResult(_0x54ed0f,0xc9))[_0xfd2b('0x44')](handleError(_0x54ed0f,null));};exports[_0xfd2b('0x49')]=function(_0x2bbf37,_0xd63c6b){if(_0x2bbf37[_0xfd2b('0x48')]['id']){delete _0x2bbf37[_0xfd2b('0x48')]['id'];}return db[_0xfd2b('0x2b')]['find']({'where':{'id':_0x2bbf37[_0xfd2b('0x45')]['id']}})[_0xfd2b('0x23')](handleEntityNotFound(_0xd63c6b,null))[_0xfd2b('0x23')](saveUpdates(_0x2bbf37[_0xfd2b('0x48')],null))['then'](respondWithResult(_0xd63c6b,null))[_0xfd2b('0x44')](handleError(_0xd63c6b,null));};exports[_0xfd2b('0x24')]=function(_0xaa601e,_0x242e32){return db['FreshdeskAccount']['find']({'where':{'id':_0xaa601e[_0xfd2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x242e32,null))[_0xfd2b('0x23')](removeEntity(_0x242e32,null))['catch'](handleError(_0x242e32,null));};exports[_0xfd2b('0x4a')]=function(_0x48fabe,_0x5286e6,_0x2f2964){var _0xc8ff11={};var _0xdfff90={};var _0x20e031;var _0x4d0ea5;return db[_0xfd2b('0x2b')]['findOne']({'where':{'id':_0x48fabe['params']['id']}})[_0xfd2b('0x23')](handleEntityNotFound(_0x5286e6,null))[_0xfd2b('0x23')](function(_0x408453){if(_0x408453){_0x20e031=_0x408453;_0xdfff90[_0xfd2b('0x33')]=_[_0xfd2b('0x31')](db[_0xfd2b('0x4b')][_0xfd2b('0x2c')]);_0xdfff90[_0xfd2b('0x30')]=_[_0xfd2b('0x31')](_0x48fabe['query']);_0xdfff90['filters']=_[_0xfd2b('0x32')](_0xdfff90[_0xfd2b('0x33')],_0xdfff90[_0xfd2b('0x30')]);_0xc8ff11[_0xfd2b('0x34')]=_['intersection'](_0xdfff90[_0xfd2b('0x33')],qs[_0xfd2b('0x35')](_0x48fabe[_0xfd2b('0x30')][_0xfd2b('0x35')]));_0xc8ff11['attributes']=_0xc8ff11[_0xfd2b('0x34')]['length']?_0xc8ff11[_0xfd2b('0x34')]:_0xdfff90['model'];_0xc8ff11[_0xfd2b('0x39')]=qs[_0xfd2b('0x3a')](_0x48fabe[_0xfd2b('0x30')]['sort']);_0xc8ff11[_0xfd2b('0x3b')]=qs['filters'](_['pick'](_0x48fabe['query'],_0xdfff90[_0xfd2b('0x3c')]));if(_0x48fabe[_0xfd2b('0x30')][_0xfd2b('0x3e')]){_0xc8ff11['where']=_[_0xfd2b('0x3f')](_0xc8ff11['where'],{'$or':_[_0xfd2b('0x2a')](_0xc8ff11['attributes'],function(_0x57df47){var _0x56006e={};_0x56006e[_0x57df47]={'$like':'%'+_0x48fabe[_0xfd2b('0x30')][_0xfd2b('0x3e')]+'%'};return _0x56006e;})});}_0xc8ff11=_[_0xfd2b('0x3f')]({},_0xc8ff11,_0x48fabe[_0xfd2b('0x4c')]);return _0x20e031[_0xfd2b('0x4a')](_0xc8ff11);}})['then'](function(_0x432768){if(_0x432768){_0x4d0ea5=_0x432768[_0xfd2b('0x36')];if(!_0x48fabe[_0xfd2b('0x30')][_0xfd2b('0x37')]('nolimit')){_0xc8ff11['limit']=qs['limit'](_0x48fabe['query'][_0xfd2b('0x1e')]);_0xc8ff11[_0xfd2b('0x1c')]=qs['offset'](_0x48fabe[_0xfd2b('0x30')][_0xfd2b('0x1c')]);}return _0x20e031['getConfigurations'](_0xc8ff11);}})[_0xfd2b('0x23')](function(_0xf690f6){if(_0xf690f6){return _0xf690f6?{'count':_0x4d0ea5,'rows':_0xf690f6}:null;}})[_0xfd2b('0x23')](respondWithResult(_0x5286e6,null))[_0xfd2b('0x44')](handleError(_0x5286e6,null));};exports[_0xfd2b('0x4d')]=function(_0x3deb06,_0x945ef7,_0x5551d7){if(_0x3deb06['body']['id']){delete _0x3deb06['body']['id'];}return db[_0xfd2b('0x2b')][_0xfd2b('0x4e')]({'where':{'id':_0x3deb06[_0xfd2b('0x45')]['id']}})[_0xfd2b('0x23')](handleEntityNotFound(_0x945ef7,null))[_0xfd2b('0x23')](function(_0x378262){if(_0x378262){_0x3deb06[_0xfd2b('0x48')]['AccountId']=_0x378262['id'];_0x3deb06['body'][_0xfd2b('0x4f')]=integrations['getSubjects'](_0x3deb06[_0xfd2b('0x48')]['channel'],_0x3deb06[_0xfd2b('0x48')]['type']);_0x3deb06[_0xfd2b('0x48')]['Descriptions']=integrations['getDescriptions'](_0x3deb06['body']['channel'],_0x3deb06[_0xfd2b('0x48')][_0xfd2b('0x2e')]);return db['FreshdeskConfiguration'][_0xfd2b('0x47')](_0x3deb06[_0xfd2b('0x48')],{'include':[{'model':db[_0xfd2b('0x50')],'as':_0xfd2b('0x4f')},{'model':db[_0xfd2b('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x945ef7,null))[_0xfd2b('0x44')](handleError(_0x945ef7,null));};exports[_0xfd2b('0x51')]=function(_0xf837ab,_0x518732,_0x517adb){var _0x233477='';return db[_0xfd2b('0x2b')][_0xfd2b('0x4e')]({'where':{'id':_0xf837ab[_0xfd2b('0x45')]['id']},'attributes':['id',_0xfd2b('0x52'),_0xfd2b('0x53')]})[_0xfd2b('0x23')](handleEntityNotFound(_0x518732,null))[_0xfd2b('0x23')](function(_0x3e6c77){if(_0x3e6c77){_0x233477=_0x3e6c77[_0xfd2b('0x52')];var _0x3e15d1=_0x233477[_0xfd2b('0x54')](-0x1);if(_0x3e15d1==='/'){_0x233477=_0x233477[_0xfd2b('0x55')](0x0,_0x233477[_0xfd2b('0x56')](_0x3e15d1));}return rp({'method':'GET','uri':util[_0xfd2b('0x57')](_0xfd2b('0x58'),_0x233477,_0xfd2b('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfd2b('0x57')](_0xfd2b('0x5a'),_0x3e6c77[_0xfd2b('0x53')]))[_0xfd2b('0x5b')](_0xfd2b('0x5c')))},'json':!![]});}})[_0xfd2b('0x23')](function(_0x57fad8){if(_0x57fad8){var _0x4df15b=[_0xfd2b('0x5d'),_0xfd2b('0x5e'),_0xfd2b('0x5f'),_0xfd2b('0x60'),_0xfd2b('0x1a'),'priority',_0xfd2b('0x61'),_0xfd2b('0x62'),_0xfd2b('0x63'),'group',_0xfd2b('0x64')];_[_0xfd2b('0x65')](_0x57fad8,function(_0x4d2f22){return _0x4df15b[_0xfd2b('0x66')](_0x4d2f22[_0xfd2b('0x28')])||!_0x4d2f22[_0xfd2b('0x67')]&&_0x4d2f22[_0xfd2b('0x2e')]!==_0xfd2b('0x68')&&_0x4d2f22[_0xfd2b('0x2e')]!=='custom_dropdown';});return{'count':_0x57fad8['length'],'rows':_[_0xfd2b('0x2a')](_0x57fad8,function(_0x64202){return{'id':_0x64202[_0xfd2b('0x28')],'name':_0x64202[_0xfd2b('0x69')],'custom':!_0x64202[_0xfd2b('0x67')],'options':_0x64202[_0xfd2b('0x6a')]?_[_0xfd2b('0x2a')](_0x64202['choices'],function(_0xb39591){return{'name':_[_0xfd2b('0x6b')](_0xb39591),'value':_0xb39591};}):[]};})};}})['then'](respondWithResult(_0x518732,null))['catch'](function(_0x341c24){var _0x48a0d0=_0xf837ab[_0xfd2b('0x30')][_0xfd2b('0x6c')]?0x1f4:_0x341c24[_0xfd2b('0x6d')]||0x1f4;logger[_0xfd2b('0x26')](_0xfd2b('0x6e'),_0xfd2b('0x51'),_0x48a0d0,JSON['stringify'](_0x341c24));delete _0x341c24[_0xfd2b('0x28')];if(_0x48a0d0===0x191){_0x48a0d0=0x190;}_0x518732['status'](_0x48a0d0)[_0xfd2b('0x29')](_0xf837ab[_0xfd2b('0x30')][_0xfd2b('0x6c')]?{'message':_0xfd2b('0x6f'),'statusCode':_0x341c24[_0xfd2b('0x6d')]}:_0x341c24);});}; \ No newline at end of file +var _0x9173=['model','attributes','fields','length','nolimit','offset','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','default','custom_text','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','then','error','name','send','index','FreshdeskAccount','type','key','map','query','keys','filters','intersection'];(function(_0x2fae35,_0x127266){var _0x5c0058=function(_0x590ce3){while(--_0x590ce3){_0x2fae35['push'](_0x2fae35['shift']());}};_0x5c0058(++_0x127266);}(_0x9173,0xb4));var _0x3917=function(_0x33f443,_0x197d47){_0x33f443=_0x33f443-0x0;var _0x476ac2=_0x9173[_0x33f443];return _0x476ac2;};'use strict';var emlformat=require(_0x3917('0x0'));var rimraf=require(_0x3917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3917('0x2'));var rp=require(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3917('0x5'));var util=require('util');var path=require(_0x3917('0x6'));var sox=require(_0x3917('0x7'));var csv=require(_0x3917('0x8'));var ejs=require(_0x3917('0x9'));var fs=require('fs');var fs_extra=require(_0x3917('0xa'));var _=require('lodash');var squel=require(_0x3917('0xb'));var crypto=require(_0x3917('0xc'));var jsforce=require(_0x3917('0xd'));var deskjs=require(_0x3917('0xe'));var toCsv=require(_0x3917('0x8'));var querystring=require(_0x3917('0xf'));var Papa=require('papaparse');var Redis=require(_0x3917('0x10'));var authService=require(_0x3917('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3917('0x12'));var hardwareService=require(_0x3917('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3917('0x14'));var licenseUtil=require(_0x3917('0x15'));var db=require(_0x3917('0x16'))['db'];var integrations=require(_0x3917('0x17'));function respondWithStatusCode(_0x3b3b40,_0xc0902d){_0xc0902d=_0xc0902d||0xcc;return function(_0x55b37a){if(_0x55b37a){return _0x3b3b40[_0x3917('0x18')](_0xc0902d);}return _0x3b3b40[_0x3917('0x19')](_0xc0902d)[_0x3917('0x1a')]();};}function respondWithResult(_0x1d19bc,_0x4d7f6c){_0x4d7f6c=_0x4d7f6c||0xc8;return function(_0x3827a3){if(_0x3827a3){return _0x1d19bc[_0x3917('0x19')](_0x4d7f6c)[_0x3917('0x1b')](_0x3827a3);}};}function respondWithFilteredResult(_0x291147,_0x23821c){return function(_0x483e45){if(_0x483e45){var _0x1a5614=typeof _0x23821c['offset']==='undefined'&&typeof _0x23821c[_0x3917('0x1c')]===_0x3917('0x1d');var _0x2f9180=_0x483e45['count'];var _0x402d3c=_0x1a5614?0x0:_0x23821c['offset'];var _0x47da7e=_0x1a5614?_0x483e45[_0x3917('0x1e')]:_0x23821c['offset']+_0x23821c[_0x3917('0x1c')];var _0x425d6b;if(_0x47da7e>=_0x2f9180){_0x47da7e=_0x2f9180;_0x425d6b=0xc8;}else{_0x425d6b=0xce;}_0x291147[_0x3917('0x19')](_0x425d6b);return _0x291147[_0x3917('0x1f')](_0x3917('0x20'),_0x402d3c+'-'+_0x47da7e+'/'+_0x2f9180)[_0x3917('0x1b')](_0x483e45);}return null;};}function patchUpdates(_0x1d4e33){return function(_0x2a9f25){try{jsonpatch[_0x3917('0x21')](_0x2a9f25,_0x1d4e33,!![]);}catch(_0x29482e){return BPromise[_0x3917('0x22')](_0x29482e);}return _0x2a9f25['save']();};}function saveUpdates(_0x1e3d24,_0x1adbe4){return function(_0x5cb6b4){if(_0x5cb6b4){return _0x5cb6b4['update'](_0x1e3d24)[_0x3917('0x23')](function(_0x52f027){return _0x52f027;});}return null;};}function removeEntity(_0x127ab5,_0x337aba){return function(_0x3ddc64){if(_0x3ddc64){return _0x3ddc64['destroy']()[_0x3917('0x23')](function(){_0x127ab5['status'](0xcc)[_0x3917('0x1a')]();});}};}function handleEntityNotFound(_0x1bc725,_0x22f3e7){return function(_0x5d1da9){if(!_0x5d1da9){_0x1bc725[_0x3917('0x18')](0x194);}return _0x5d1da9;};}function handleError(_0x36892d,_0x103729){_0x103729=_0x103729||0x1f4;return function(_0x46c87a){logger[_0x3917('0x24')](_0x46c87a['stack']);if(_0x46c87a['name']){delete _0x46c87a[_0x3917('0x25')];}_0x36892d[_0x3917('0x19')](_0x103729)[_0x3917('0x26')](_0x46c87a);};}exports[_0x3917('0x27')]=function(_0x12302d,_0x4060a8){var _0x2e80ca={},_0x294f0e={},_0x1b8f93={'count':0x0,'rows':[]};var _0x43343e=_['map'](db[_0x3917('0x28')]['rawAttributes'],function(_0x2461a5){return{'name':_0x2461a5['fieldName'],'type':_0x2461a5[_0x3917('0x29')][_0x3917('0x2a')]};});_0x294f0e['model']=_[_0x3917('0x2b')](_0x43343e,_0x3917('0x25'));_0x294f0e[_0x3917('0x2c')]=_[_0x3917('0x2d')](_0x12302d['query']);_0x294f0e[_0x3917('0x2e')]=_[_0x3917('0x2f')](_0x294f0e[_0x3917('0x30')],_0x294f0e[_0x3917('0x2c')]);_0x2e80ca[_0x3917('0x31')]=_[_0x3917('0x2f')](_0x294f0e[_0x3917('0x30')],qs[_0x3917('0x32')](_0x12302d['query'][_0x3917('0x32')]));_0x2e80ca[_0x3917('0x31')]=_0x2e80ca[_0x3917('0x31')][_0x3917('0x33')]?_0x2e80ca[_0x3917('0x31')]:_0x294f0e['model'];if(!_0x12302d[_0x3917('0x2c')]['hasOwnProperty'](_0x3917('0x34'))){_0x2e80ca[_0x3917('0x1c')]=qs['limit'](_0x12302d[_0x3917('0x2c')][_0x3917('0x1c')]);_0x2e80ca[_0x3917('0x35')]=qs[_0x3917('0x35')](_0x12302d[_0x3917('0x2c')][_0x3917('0x35')]);}_0x2e80ca[_0x3917('0x36')]=qs[_0x3917('0x37')](_0x12302d[_0x3917('0x2c')][_0x3917('0x37')]);_0x2e80ca[_0x3917('0x38')]=qs[_0x3917('0x2e')](_['pick'](_0x12302d[_0x3917('0x2c')],_0x294f0e[_0x3917('0x2e')]),_0x43343e);if(_0x12302d[_0x3917('0x2c')][_0x3917('0x39')]){_0x2e80ca[_0x3917('0x38')]=_['merge'](_0x2e80ca[_0x3917('0x38')],{'$or':_[_0x3917('0x2b')](_0x43343e,function(_0x5034e1){if(_0x5034e1[_0x3917('0x29')]!==_0x3917('0x3a')){var _0x227186={};_0x227186[_0x5034e1[_0x3917('0x25')]]={'$like':'%'+_0x12302d['query'][_0x3917('0x39')]+'%'};return _0x227186;}})});}_0x2e80ca=_[_0x3917('0x3b')]({},_0x2e80ca,_0x12302d['options']);var _0x294cbd={'where':_0x2e80ca[_0x3917('0x38')]};return db[_0x3917('0x28')][_0x3917('0x1e')](_0x294cbd)['then'](function(_0x5d08aa){_0x1b8f93[_0x3917('0x1e')]=_0x5d08aa;if(_0x12302d[_0x3917('0x2c')][_0x3917('0x3c')]){_0x2e80ca[_0x3917('0x3d')]=[{'all':!![]}];}return db[_0x3917('0x28')]['findAll'](_0x2e80ca);})[_0x3917('0x23')](function(_0x14efd4){_0x1b8f93[_0x3917('0x3e')]=_0x14efd4;return _0x1b8f93;})[_0x3917('0x23')](respondWithFilteredResult(_0x4060a8,_0x2e80ca))[_0x3917('0x3f')](handleError(_0x4060a8,null));};exports[_0x3917('0x40')]=function(_0x4b185f,_0x2b2437){var _0x2b0f07={'raw':![],'where':{'id':_0x4b185f[_0x3917('0x41')]['id']}},_0x2bfcc5={};_0x2bfcc5[_0x3917('0x30')]=_[_0x3917('0x2d')](db[_0x3917('0x28')][_0x3917('0x42')]);_0x2bfcc5[_0x3917('0x2c')]=_[_0x3917('0x2d')](_0x4b185f[_0x3917('0x2c')]);_0x2bfcc5[_0x3917('0x2e')]=_[_0x3917('0x2f')](_0x2bfcc5[_0x3917('0x30')],_0x2bfcc5[_0x3917('0x2c')]);_0x2b0f07['attributes']=_[_0x3917('0x2f')](_0x2bfcc5[_0x3917('0x30')],qs[_0x3917('0x32')](_0x4b185f[_0x3917('0x2c')][_0x3917('0x32')]));_0x2b0f07[_0x3917('0x31')]=_0x2b0f07[_0x3917('0x31')][_0x3917('0x33')]?_0x2b0f07['attributes']:_0x2bfcc5[_0x3917('0x30')];if(_0x4b185f[_0x3917('0x2c')][_0x3917('0x3c')]){_0x2b0f07['include']=[{'all':!![]}];}_0x2b0f07=_['merge']({},_0x2b0f07,_0x4b185f[_0x3917('0x43')]);return db[_0x3917('0x28')][_0x3917('0x44')](_0x2b0f07)[_0x3917('0x23')](handleEntityNotFound(_0x2b2437,null))[_0x3917('0x23')](respondWithResult(_0x2b2437,null))[_0x3917('0x3f')](handleError(_0x2b2437,null));};exports[_0x3917('0x45')]=function(_0x24f82a,_0x4a24ff){return db['FreshdeskAccount'][_0x3917('0x45')](_0x24f82a[_0x3917('0x46')],{})[_0x3917('0x23')](respondWithResult(_0x4a24ff,0xc9))['catch'](handleError(_0x4a24ff,null));};exports['update']=function(_0xac3a4a,_0x521cc4){if(_0xac3a4a[_0x3917('0x46')]['id']){delete _0xac3a4a[_0x3917('0x46')]['id'];}return db[_0x3917('0x28')][_0x3917('0x44')]({'where':{'id':_0xac3a4a[_0x3917('0x41')]['id']}})[_0x3917('0x23')](handleEntityNotFound(_0x521cc4,null))[_0x3917('0x23')](saveUpdates(_0xac3a4a[_0x3917('0x46')],null))[_0x3917('0x23')](respondWithResult(_0x521cc4,null))[_0x3917('0x3f')](handleError(_0x521cc4,null));};exports[_0x3917('0x47')]=function(_0x1ad926,_0x31cdb6){return db[_0x3917('0x28')][_0x3917('0x44')]({'where':{'id':_0x1ad926['params']['id']}})[_0x3917('0x23')](handleEntityNotFound(_0x31cdb6,null))[_0x3917('0x23')](removeEntity(_0x31cdb6,null))[_0x3917('0x3f')](handleError(_0x31cdb6,null));};exports[_0x3917('0x48')]=function(_0x578edc,_0x81d04b,_0x15a6c8){var _0x451e90={};var _0x982ca1={};var _0x4e9006;var _0x4ff953;return db[_0x3917('0x28')][_0x3917('0x49')]({'where':{'id':_0x578edc['params']['id']}})[_0x3917('0x23')](handleEntityNotFound(_0x81d04b,null))[_0x3917('0x23')](function(_0x16ce77){if(_0x16ce77){_0x4e9006=_0x16ce77;_0x982ca1['model']=_[_0x3917('0x2d')](db[_0x3917('0x4a')][_0x3917('0x42')]);_0x982ca1[_0x3917('0x2c')]=_[_0x3917('0x2d')](_0x578edc[_0x3917('0x2c')]);_0x982ca1[_0x3917('0x2e')]=_[_0x3917('0x2f')](_0x982ca1[_0x3917('0x30')],_0x982ca1[_0x3917('0x2c')]);_0x451e90['attributes']=_[_0x3917('0x2f')](_0x982ca1[_0x3917('0x30')],qs[_0x3917('0x32')](_0x578edc['query'][_0x3917('0x32')]));_0x451e90[_0x3917('0x31')]=_0x451e90[_0x3917('0x31')]['length']?_0x451e90['attributes']:_0x982ca1[_0x3917('0x30')];_0x451e90[_0x3917('0x36')]=qs[_0x3917('0x37')](_0x578edc[_0x3917('0x2c')]['sort']);_0x451e90[_0x3917('0x38')]=qs['filters'](_['pick'](_0x578edc[_0x3917('0x2c')],_0x982ca1[_0x3917('0x2e')]));if(_0x578edc['query'][_0x3917('0x39')]){_0x451e90[_0x3917('0x38')]=_[_0x3917('0x3b')](_0x451e90['where'],{'$or':_[_0x3917('0x2b')](_0x451e90['attributes'],function(_0x50ad81){var _0x4ab2da={};_0x4ab2da[_0x50ad81]={'$like':'%'+_0x578edc[_0x3917('0x2c')]['filter']+'%'};return _0x4ab2da;})});}_0x451e90=_[_0x3917('0x3b')]({},_0x451e90,_0x578edc[_0x3917('0x43')]);return _0x4e9006[_0x3917('0x48')](_0x451e90);}})['then'](function(_0x7f0063){if(_0x7f0063){_0x4ff953=_0x7f0063[_0x3917('0x33')];if(!_0x578edc['query'][_0x3917('0x4b')](_0x3917('0x34'))){_0x451e90['limit']=qs['limit'](_0x578edc[_0x3917('0x2c')]['limit']);_0x451e90[_0x3917('0x35')]=qs[_0x3917('0x35')](_0x578edc[_0x3917('0x2c')][_0x3917('0x35')]);}return _0x4e9006[_0x3917('0x48')](_0x451e90);}})[_0x3917('0x23')](function(_0x3a53dc){if(_0x3a53dc){return _0x3a53dc?{'count':_0x4ff953,'rows':_0x3a53dc}:null;}})[_0x3917('0x23')](respondWithResult(_0x81d04b,null))[_0x3917('0x3f')](handleError(_0x81d04b,null));};exports[_0x3917('0x4c')]=function(_0x1979fd,_0x2848a3,_0x1fd020){if(_0x1979fd[_0x3917('0x46')]['id']){delete _0x1979fd['body']['id'];}return db[_0x3917('0x28')][_0x3917('0x49')]({'where':{'id':_0x1979fd[_0x3917('0x41')]['id']}})[_0x3917('0x23')](handleEntityNotFound(_0x2848a3,null))[_0x3917('0x23')](function(_0x5de713){if(_0x5de713){_0x1979fd[_0x3917('0x46')][_0x3917('0x4d')]=_0x5de713['id'];_0x1979fd[_0x3917('0x46')][_0x3917('0x4e')]=integrations[_0x3917('0x4f')](_0x1979fd[_0x3917('0x46')][_0x3917('0x50')],_0x1979fd[_0x3917('0x46')][_0x3917('0x29')]);_0x1979fd['body'][_0x3917('0x51')]=integrations[_0x3917('0x52')](_0x1979fd[_0x3917('0x46')][_0x3917('0x50')],_0x1979fd[_0x3917('0x46')]['type']);return db[_0x3917('0x4a')][_0x3917('0x45')](_0x1979fd[_0x3917('0x46')],{'include':[{'model':db[_0x3917('0x53')],'as':_0x3917('0x4e')},{'model':db[_0x3917('0x53')],'as':_0x3917('0x51')}]});}return null;})[_0x3917('0x23')](respondWithResult(_0x2848a3,null))[_0x3917('0x3f')](handleError(_0x2848a3,null));};exports['getFields']=function(_0x1eb196,_0x51100e,_0x4c1f71){var _0x18e04e='';return db[_0x3917('0x28')][_0x3917('0x49')]({'where':{'id':_0x1eb196['params']['id']},'attributes':['id',_0x3917('0x54'),_0x3917('0x55')]})[_0x3917('0x23')](handleEntityNotFound(_0x51100e,null))[_0x3917('0x23')](function(_0x3b1fb0){if(_0x3b1fb0){_0x18e04e=_0x3b1fb0[_0x3917('0x54')];var _0xfe7c64=_0x18e04e['slice'](-0x1);if(_0xfe7c64==='/'){_0x18e04e=_0x18e04e[_0x3917('0x56')](0x0,_0x18e04e[_0x3917('0x57')](_0xfe7c64));}return rp({'method':'GET','uri':util[_0x3917('0x58')]('%s/%s',_0x18e04e,_0x3917('0x59')),'headers':{'Authorization':util[_0x3917('0x58')](_0x3917('0x5a'),new Buffer(util[_0x3917('0x58')](_0x3917('0x5b'),_0x3b1fb0['apiKey']))[_0x3917('0x5c')](_0x3917('0x5d')))},'json':!![]});}})['then'](function(_0x9436f1){if(_0x9436f1){var _0x2c16cd=[_0x3917('0x5e'),_0x3917('0x5f'),_0x3917('0x60'),_0x3917('0x61'),_0x3917('0x19'),_0x3917('0x62'),_0x3917('0x63'),_0x3917('0x64'),_0x3917('0x65'),'group',_0x3917('0x66')];_[_0x3917('0x67')](_0x9436f1,function(_0x15eed1){return _0x2c16cd['includes'](_0x15eed1['name'])||!_0x15eed1[_0x3917('0x68')]&&_0x15eed1[_0x3917('0x29')]!==_0x3917('0x69')&&_0x15eed1['type']!=='custom_dropdown';});return{'count':_0x9436f1[_0x3917('0x33')],'rows':_[_0x3917('0x2b')](_0x9436f1,function(_0x11bc90){return{'id':_0x11bc90[_0x3917('0x25')],'name':_0x11bc90['label'],'custom':!_0x11bc90[_0x3917('0x68')],'options':_0x11bc90[_0x3917('0x6a')]?_[_0x3917('0x2b')](_0x11bc90[_0x3917('0x6a')],function(_0xf574dd){return{'name':_[_0x3917('0x6b')](_0xf574dd),'value':_0xf574dd};}):[]};})};}})['then'](respondWithResult(_0x51100e,null))['catch'](function(_0x5d5b7f){var _0x5b6c4d=_0x1eb196['query'][_0x3917('0x6c')]?0x1f4:_0x5d5b7f[_0x3917('0x6d')]||0x1f4;logger[_0x3917('0x24')](_0x3917('0x6e'),_0x3917('0x6f'),_0x5b6c4d,JSON[_0x3917('0x70')](_0x5d5b7f));delete _0x5d5b7f[_0x3917('0x25')];if(_0x5b6c4d===0x191){_0x5b6c4d=0x190;}_0x51100e[_0x3917('0x19')](_0x5b6c4d)[_0x3917('0x26')](_0x1eb196[_0x3917('0x2c')]['test']?{'message':_0x3917('0x71'),'statusCode':_0x5d5b7f['statusCode']}:_0x5d5b7f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 79ada5e..5d6e27c 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4888=['rimraf','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','util','api','bluebird','request-promise','path'];(function(_0x6edb81,_0x37d65b){var _0x134946=function(_0x21a619){while(--_0x21a619){_0x6edb81['push'](_0x6edb81['shift']());}};_0x134946(++_0x37d65b);}(_0x4888,0x113));var _0x8488=function(_0x30efc1,_0xce84de){_0x30efc1=_0x30efc1-0x0;var _0x46d79e=_0x4888[_0x30efc1];return _0x46d79e;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require('../../config/logger')(_0x8488('0x1'));var moment=require('moment');var BPromise=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var fs=require('fs');var path=require(_0x8488('0x4'));var rimraf=require(_0x8488('0x5'));var config=require('../../config/environment');var attributes=require(_0x8488('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x8488('0x7')]=function(_0x68a910,_0x11378c){return _0x68a910[_0x8488('0x8')](_0x8488('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefdf=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xefdf,0xa7));var _0xfefd=function(_0x3f5290,_0x53c67c){_0x3f5290=_0x3f5290-0x0;var _0x8a452d=_0xefdf[_0x3f5290];return _0x8a452d;};'use strict';var _=require(_0xfefd('0x0'));var util=require(_0xfefd('0x1'));var logger=require(_0xfefd('0x2'))(_0xfefd('0x3'));var moment=require(_0xfefd('0x4'));var BPromise=require(_0xfefd('0x5'));var rp=require(_0xfefd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfefd('0x7'));var config=require(_0xfefd('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xfefd('0x9'));module[_0xfefd('0xa')]=function(_0x267597,_0x45b8d4){return _0x267597[_0xfefd('0xb')](_0xfefd('0xc'),attributes,{'tableName':_0xfefd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8cdd19c..cbfd492 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd634=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','findAll','raw','options','where','limit','include','map','attributes','model','then','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xd634,0x151));var _0x4d63=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xd634[_0x495e9f];return _0xb249d2;};'use strict';var _=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var moment=require(_0x4d63('0x2'));var BPromise=require(_0x4d63('0x3'));var rs=require(_0x4d63('0x4'));var fs=require('fs');var Redis=require(_0x4d63('0x5'));var db=require(_0x4d63('0x6'))['db'];var utils=require(_0x4d63('0x7'));var logger=require(_0x4d63('0x8'))(_0x4d63('0x9'));var config=require('../../config/environment');var jayson=require(_0x4d63('0xa'));var client=jayson[_0x4d63('0xb')][_0x4d63('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a28b8,_0x42c748,_0x3578d0){return new BPromise(function(_0x269b6b,_0x1421d0){return client['request'](_0x1a28b8,_0x3578d0)['then'](function(_0x16c4dc){logger['info'](_0x4d63('0xd'),_0x42c748,_0x4d63('0xe'));logger[_0x4d63('0xf')](_0x4d63('0x10'),_0x42c748,'request\x20sent',JSON[_0x4d63('0x11')](_0x16c4dc));if(_0x16c4dc['error']){if(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x13')]===0x1f4){logger['error'](_0x4d63('0xd'),_0x42c748,_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);return _0x1421d0(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);}logger[_0x4d63('0x12')](_0x4d63('0xd'),_0x42c748,_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);return _0x269b6b(_0x16c4dc[_0x4d63('0x12')][_0x4d63('0x14')]);}else{logger[_0x4d63('0x15')](_0x4d63('0xd'),_0x42c748,'request\x20sent');_0x269b6b(_0x16c4dc[_0x4d63('0x16')][_0x4d63('0x14')]);}})[_0x4d63('0x17')](function(_0x3ed512){logger[_0x4d63('0x12')](_0x4d63('0xd'),_0x42c748,_0x3ed512);_0x1421d0(_0x3ed512);});});}exports[_0x4d63('0x18')]=function(_0x20f810){var _0x413050=this;return new Promise(function(_0x603dc3,_0x3922a3){return db['FreshdeskAccount'][_0x4d63('0x19')]({'raw':_0x20f810['options']?_0x20f810['options'][_0x4d63('0x1a')]===undefined?!![]:![]:!![],'where':_0x20f810['options']?_0x20f810[_0x4d63('0x1b')][_0x4d63('0x1c')]||null:null,'attributes':_0x20f810[_0x4d63('0x1b')]?_0x20f810[_0x4d63('0x1b')]['attributes']||null:null,'limit':_0x20f810[_0x4d63('0x1b')]?_0x20f810[_0x4d63('0x1b')][_0x4d63('0x1d')]||null:null,'include':_0x20f810[_0x4d63('0x1b')]?_0x20f810[_0x4d63('0x1b')][_0x4d63('0x1e')]?_[_0x4d63('0x1f')](_0x20f810['options'][_0x4d63('0x1e')],function(_0x26d29c){return{'model':db[_0x26d29c['model']],'as':_0x26d29c['as'],'attributes':_0x26d29c[_0x4d63('0x20')],'include':_0x26d29c[_0x4d63('0x1e')]?_[_0x4d63('0x1f')](_0x26d29c['include'],function(_0x484c30){return{'model':db[_0x484c30[_0x4d63('0x21')]],'as':_0x484c30['as'],'attributes':_0x484c30[_0x4d63('0x20')],'include':_0x484c30['include']?_[_0x4d63('0x1f')](_0x484c30[_0x4d63('0x1e')],function(_0x48197c){return{'model':db[_0x48197c[_0x4d63('0x21')]],'as':_0x48197c['as'],'attributes':_0x48197c[_0x4d63('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4d63('0x22')](function(_0x40e76b){logger[_0x4d63('0x15')](_0x4d63('0x18'),_0x20f810);logger[_0x4d63('0xf')](_0x4d63('0x18'),_0x20f810,JSON[_0x4d63('0x11')](_0x40e76b));_0x603dc3(_0x40e76b);})[_0x4d63('0x17')](function(_0x5d3051){logger[_0x4d63('0x12')](_0x4d63('0x18'),_0x5d3051[_0x4d63('0x14')],_0x20f810);_0x3922a3(_0x413050[_0x4d63('0x12')](0x1f4,_0x5d3051[_0x4d63('0x14')]));});});};exports[_0x4d63('0x23')]=function(_0x4ee7a5){var _0x2b0711=this;return new Promise(function(_0x4fd372,_0x22e805){return db[_0x4d63('0x24')][_0x4d63('0x25')]({'raw':_0x4ee7a5['options']?_0x4ee7a5[_0x4d63('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4ee7a5[_0x4d63('0x1b')]?_0x4ee7a5[_0x4d63('0x1b')][_0x4d63('0x1c')]||null:null,'attributes':_0x4ee7a5[_0x4d63('0x1b')]?_0x4ee7a5['options'][_0x4d63('0x20')]||null:null,'include':_0x4ee7a5[_0x4d63('0x1b')]?_0x4ee7a5[_0x4d63('0x1b')]['include']?_[_0x4d63('0x1f')](_0x4ee7a5['options']['include'],function(_0x10fa6b){return{'model':db[_0x10fa6b[_0x4d63('0x21')]],'as':_0x10fa6b['as'],'attributes':_0x10fa6b['attributes'],'include':_0x10fa6b[_0x4d63('0x1e')]?_[_0x4d63('0x1f')](_0x10fa6b[_0x4d63('0x1e')],function(_0x346b1b){return{'model':db[_0x346b1b[_0x4d63('0x21')]],'as':_0x346b1b['as'],'attributes':_0x346b1b['attributes'],'include':_0x346b1b[_0x4d63('0x1e')]?_[_0x4d63('0x1f')](_0x346b1b[_0x4d63('0x1e')],function(_0x553f56){return{'model':db[_0x553f56[_0x4d63('0x21')]],'as':_0x553f56['as'],'attributes':_0x553f56[_0x4d63('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2495e5){logger[_0x4d63('0x15')](_0x4d63('0x23'),_0x4ee7a5);logger['debug'](_0x4d63('0x23'),_0x4ee7a5,JSON[_0x4d63('0x11')](_0x2495e5));_0x4fd372(_0x2495e5);})[_0x4d63('0x17')](function(_0x251a8b){logger['error'](_0x4d63('0x23'),_0x251a8b[_0x4d63('0x14')],_0x4ee7a5);_0x22e805(_0x2b0711['error'](0x1f4,_0x251a8b['message']));});});}; \ No newline at end of file +var _0xd95b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','util','moment','bluebird'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xd95b,0x126));var _0xbd95=function(_0x3bf6ba,_0x277ec1){_0x3bf6ba=_0x3bf6ba-0x0;var _0x4b71cd=_0xd95b[_0x3bf6ba];return _0x4b71cd;};'use strict';var _=require('lodash');var util=require(_0xbd95('0x0'));var moment=require(_0xbd95('0x1'));var BPromise=require(_0xbd95('0x2'));var rs=require(_0xbd95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd95('0x4'))['db'];var utils=require(_0xbd95('0x5'));var logger=require(_0xbd95('0x6'))('rpc');var config=require(_0xbd95('0x7'));var jayson=require(_0xbd95('0x8'));var client=jayson['client'][_0xbd95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x226929,_0x3d2915,_0x55af0a){return new BPromise(function(_0x383819,_0x4c6975){return client[_0xbd95('0xa')](_0x226929,_0x55af0a)[_0xbd95('0xb')](function(_0x5bb215){logger[_0xbd95('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d2915,_0xbd95('0xd'));logger[_0xbd95('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3d2915,_0xbd95('0xd'),JSON['stringify'](_0x5bb215));if(_0x5bb215[_0xbd95('0xf')]){if(_0x5bb215[_0xbd95('0xf')]['code']===0x1f4){logger[_0xbd95('0xf')](_0xbd95('0x10'),_0x3d2915,_0x5bb215[_0xbd95('0xf')][_0xbd95('0x11')]);return _0x4c6975(_0x5bb215[_0xbd95('0xf')][_0xbd95('0x11')]);}logger[_0xbd95('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d2915,_0x5bb215[_0xbd95('0xf')]['message']);return _0x383819(_0x5bb215[_0xbd95('0xf')][_0xbd95('0x11')]);}else{logger[_0xbd95('0xc')](_0xbd95('0x10'),_0x3d2915,_0xbd95('0xd'));_0x383819(_0x5bb215[_0xbd95('0x12')]['message']);}})[_0xbd95('0x13')](function(_0x5dc666){logger[_0xbd95('0xf')](_0xbd95('0x10'),_0x3d2915,_0x5dc666);_0x4c6975(_0x5dc666);});});}exports['GetFreshdeskAccount']=function(_0x12a05d){var _0x2d13a6=this;return new Promise(function(_0x216a1b,_0x54ebf9){return db[_0xbd95('0x14')][_0xbd95('0x15')]({'raw':_0x12a05d[_0xbd95('0x16')]?_0x12a05d[_0xbd95('0x16')][_0xbd95('0x17')]===undefined?!![]:![]:!![],'where':_0x12a05d[_0xbd95('0x16')]?_0x12a05d[_0xbd95('0x16')][_0xbd95('0x18')]||null:null,'attributes':_0x12a05d[_0xbd95('0x16')]?_0x12a05d['options'][_0xbd95('0x19')]||null:null,'limit':_0x12a05d[_0xbd95('0x16')]?_0x12a05d[_0xbd95('0x16')][_0xbd95('0x1a')]||null:null,'include':_0x12a05d[_0xbd95('0x16')]?_0x12a05d[_0xbd95('0x16')][_0xbd95('0x1b')]?_['map'](_0x12a05d['options']['include'],function(_0x47a2f1){return{'model':db[_0x47a2f1[_0xbd95('0x1c')]],'as':_0x47a2f1['as'],'attributes':_0x47a2f1[_0xbd95('0x19')],'include':_0x47a2f1['include']?_[_0xbd95('0x1d')](_0x47a2f1['include'],function(_0x2b9060){return{'model':db[_0x2b9060[_0xbd95('0x1c')]],'as':_0x2b9060['as'],'attributes':_0x2b9060['attributes'],'include':_0x2b9060[_0xbd95('0x1b')]?_[_0xbd95('0x1d')](_0x2b9060[_0xbd95('0x1b')],function(_0x36956e){return{'model':db[_0x36956e[_0xbd95('0x1c')]],'as':_0x36956e['as'],'attributes':_0x36956e[_0xbd95('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbd95('0xb')](function(_0x52e4a0){logger[_0xbd95('0xc')]('GetFreshdeskAccount',_0x12a05d);logger['debug'](_0xbd95('0x1e'),_0x12a05d,JSON[_0xbd95('0x1f')](_0x52e4a0));_0x216a1b(_0x52e4a0);})[_0xbd95('0x13')](function(_0x41c3c6){logger[_0xbd95('0xf')](_0xbd95('0x1e'),_0x41c3c6['message'],_0x12a05d);_0x54ebf9(_0x2d13a6['error'](0x1f4,_0x41c3c6['message']));});});};exports[_0xbd95('0x20')]=function(_0x3fe51f){var _0x3a5bc9=this;return new Promise(function(_0x35e8b4,_0x38aa22){return db[_0xbd95('0x14')]['find']({'raw':_0x3fe51f[_0xbd95('0x16')]?_0x3fe51f[_0xbd95('0x16')][_0xbd95('0x17')]===undefined?!![]:![]:!![],'where':_0x3fe51f['options']?_0x3fe51f[_0xbd95('0x16')][_0xbd95('0x18')]||null:null,'attributes':_0x3fe51f[_0xbd95('0x16')]?_0x3fe51f['options']['attributes']||null:null,'include':_0x3fe51f['options']?_0x3fe51f[_0xbd95('0x16')][_0xbd95('0x1b')]?_['map'](_0x3fe51f[_0xbd95('0x16')][_0xbd95('0x1b')],function(_0x5e1cff){return{'model':db[_0x5e1cff[_0xbd95('0x1c')]],'as':_0x5e1cff['as'],'attributes':_0x5e1cff['attributes'],'include':_0x5e1cff[_0xbd95('0x1b')]?_['map'](_0x5e1cff['include'],function(_0x39b465){return{'model':db[_0x39b465[_0xbd95('0x1c')]],'as':_0x39b465['as'],'attributes':_0x39b465[_0xbd95('0x19')],'include':_0x39b465[_0xbd95('0x1b')]?_[_0xbd95('0x1d')](_0x39b465[_0xbd95('0x1b')],function(_0x2c4ddf){return{'model':db[_0x2c4ddf[_0xbd95('0x1c')]],'as':_0x2c4ddf['as'],'attributes':_0x2c4ddf['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd95('0xb')](function(_0x133415){logger[_0xbd95('0xc')](_0xbd95('0x20'),_0x3fe51f);logger[_0xbd95('0xe')](_0xbd95('0x20'),_0x3fe51f,JSON['stringify'](_0x133415));_0x35e8b4(_0x133415);})[_0xbd95('0x13')](function(_0x210541){logger[_0xbd95('0xf')](_0xbd95('0x20'),_0x210541['message'],_0x3fe51f);_0x38aa22(_0x3a5bc9[_0xbd95('0xf')](0x1f4,_0x210541['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0812bc3..0679a56 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a1b=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','setTags','/:id'];(function(_0x479b99,_0x1e5bec){var _0x1e7eb7=function(_0x52ac6c){while(--_0x52ac6c){_0x479b99['push'](_0x479b99['shift']());}};_0x1e7eb7(++_0x1e5bec);}(_0x9a1b,0x1bc));var _0xb9a1=function(_0x3c7c7e,_0x18d544){_0x3c7c7e=_0x3c7c7e-0x0;var _0x1051b9=_0x9a1b[_0x3c7c7e];return _0x1051b9;};'use strict';var multer=require(_0xb9a1('0x0'));var util=require(_0xb9a1('0x1'));var path=require(_0xb9a1('0x2'));var timeout=require(_0xb9a1('0x3'));var express=require(_0xb9a1('0x4'));var router=express['Router']();var fs_extra=require(_0xb9a1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9a1('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xb9a1('0x7')]('/',auth[_0xb9a1('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb9a1('0x7')](_0xb9a1('0x9'),auth[_0xb9a1('0x8')](),controller['getFields']);router[_0xb9a1('0x7')](_0xb9a1('0xa'),auth[_0xb9a1('0x8')](),controller[_0xb9a1('0xb')]);router[_0xb9a1('0x7')](_0xb9a1('0xc'),auth[_0xb9a1('0x8')](),controller[_0xb9a1('0xd')]);router[_0xb9a1('0x7')](_0xb9a1('0xe'),auth[_0xb9a1('0x8')](),controller['getTags']);router['post']('/',auth[_0xb9a1('0x8')](),controller[_0xb9a1('0xf')]);router['post'](_0xb9a1('0xe'),auth[_0xb9a1('0x8')](),controller[_0xb9a1('0x10')]);router['put'](_0xb9a1('0x11'),auth[_0xb9a1('0x8')](),controller[_0xb9a1('0x12')]);router[_0xb9a1('0x13')](_0xb9a1('0x11'),auth[_0xb9a1('0x8')](),controller[_0xb9a1('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6e07=['path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','multer','util'];(function(_0x20255b,_0x52aa07){var _0x81fe0a=function(_0x161c2d){while(--_0x161c2d){_0x20255b['push'](_0x20255b['shift']());}};_0x81fe0a(++_0x52aa07);}(_0x6e07,0x66));var _0x76e0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6e07[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x76e0('0x0'));var util=require(_0x76e0('0x1'));var path=require(_0x76e0('0x2'));var timeout=require(_0x76e0('0x3'));var express=require(_0x76e0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76e0('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x76e0('0x6')]('/',auth[_0x76e0('0x7')](),controller[_0x76e0('0x8')]);router['get'](_0x76e0('0x9'),auth[_0x76e0('0x7')](),controller[_0x76e0('0xa')]);router[_0x76e0('0x6')](_0x76e0('0xb'),auth[_0x76e0('0x7')](),controller[_0x76e0('0xc')]);router[_0x76e0('0x6')](_0x76e0('0xd'),auth[_0x76e0('0x7')](),controller[_0x76e0('0xe')]);router[_0x76e0('0x6')](_0x76e0('0xf'),auth['isAuthenticated'](),controller[_0x76e0('0x10')]);router[_0x76e0('0x6')](_0x76e0('0x11'),auth[_0x76e0('0x7')](),controller[_0x76e0('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76e0('0x13')]);router[_0x76e0('0x14')](_0x76e0('0x11'),auth[_0x76e0('0x7')](),controller[_0x76e0('0x15')]);router[_0x76e0('0x16')](_0x76e0('0x9'),auth[_0x76e0('0x7')](),controller[_0x76e0('0x17')]);router[_0x76e0('0x18')](_0x76e0('0x9'),auth[_0x76e0('0x7')](),controller[_0x76e0('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 4949fb6..d3369e7 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f48=['exports','STRING','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7f48,0x1a0));var _0x87f4=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7f48[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0x87f4('0x0'));module[_0x87f4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x87f4('0x2')]}}; \ No newline at end of file +var _0x67c9=['STRING','sequelize','exports'];(function(_0x514a35,_0x3e04a7){var _0x5f241a=function(_0x32b660){while(--_0x32b660){_0x514a35['push'](_0x514a35['shift']());}};_0x5f241a(++_0x3e04a7);}(_0x67c9,0x1c0));var _0x967c=function(_0xca8958,_0x25eed8){_0xca8958=_0xca8958-0x0;var _0x3d7165=_0x67c9[_0xca8958];return _0x3d7165;};'use strict';var Sequelize=require(_0x967c('0x0'));module[_0x967c('0x1')]={'name':{'type':Sequelize[_0x967c('0x2')]},'description':{'type':Sequelize[_0x967c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 8b09b60..8d588b6 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbce1=['rawAttributes','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','offset','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','getFields','FreshdeskField','order','filter','hasOwnProperty','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','FreshdeskConfiguration'];(function(_0x254222,_0xfb6cca){var _0x599373=function(_0x193286){while(--_0x193286){_0x254222['push'](_0x254222['shift']());}};_0x599373(++_0xfb6cca);}(_0xbce1,0x12a));var _0x1bce=function(_0x95c207,_0xc5c32e){_0x95c207=_0x95c207-0x0;var _0x2b5240=_0xbce1[_0x95c207];return _0x2b5240;};'use strict';var emlformat=require(_0x1bce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bce('0x1'));var jsonpatch=require(_0x1bce('0x2'));var rp=require(_0x1bce('0x3'));var moment=require(_0x1bce('0x4'));var BPromise=require(_0x1bce('0x5'));var Mustache=require('mustache');var util=require(_0x1bce('0x6'));var path=require(_0x1bce('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bce('0x8'));var _=require(_0x1bce('0x9'));var squel=require(_0x1bce('0xa'));var crypto=require(_0x1bce('0xb'));var jsforce=require(_0x1bce('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1bce('0xd'));var querystring=require(_0x1bce('0xe'));var Papa=require(_0x1bce('0xf'));var Redis=require(_0x1bce('0x10'));var authService=require(_0x1bce('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1bce('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1bce('0x13'));var utils=require(_0x1bce('0x14'));var config=require(_0x1bce('0x15'));var licenseUtil=require(_0x1bce('0x16'));var db=require(_0x1bce('0x17'))['db'];function respondWithStatusCode(_0x2fcff4,_0xb31efd){_0xb31efd=_0xb31efd||0xcc;return function(_0x1dff4d){if(_0x1dff4d){return _0x2fcff4[_0x1bce('0x18')](_0xb31efd);}return _0x2fcff4['status'](_0xb31efd)[_0x1bce('0x19')]();};}function respondWithResult(_0x40dab5,_0x107e7b){_0x107e7b=_0x107e7b||0xc8;return function(_0x49325b){if(_0x49325b){return _0x40dab5[_0x1bce('0x1a')](_0x107e7b)[_0x1bce('0x1b')](_0x49325b);}};}function respondWithFilteredResult(_0x24e19c,_0x5338d4){return function(_0x205f24){if(_0x205f24){var _0x43f9c3=typeof _0x5338d4['offset']===_0x1bce('0x1c')&&typeof _0x5338d4[_0x1bce('0x1d')]===_0x1bce('0x1c');var _0x52725e=_0x205f24[_0x1bce('0x1e')];var _0xb38afc=_0x43f9c3?0x0:_0x5338d4['offset'];var _0x1b751c=_0x43f9c3?_0x205f24[_0x1bce('0x1e')]:_0x5338d4['offset']+_0x5338d4[_0x1bce('0x1d')];var _0x223fc3;if(_0x1b751c>=_0x52725e){_0x1b751c=_0x52725e;_0x223fc3=0xc8;}else{_0x223fc3=0xce;}_0x24e19c[_0x1bce('0x1a')](_0x223fc3);return _0x24e19c[_0x1bce('0x1f')](_0x1bce('0x20'),_0xb38afc+'-'+_0x1b751c+'/'+_0x52725e)[_0x1bce('0x1b')](_0x205f24);}return null;};}function patchUpdates(_0xf38c26){return function(_0x1772ef){try{jsonpatch[_0x1bce('0x21')](_0x1772ef,_0xf38c26,!![]);}catch(_0x11df96){return BPromise[_0x1bce('0x22')](_0x11df96);}return _0x1772ef['save']();};}function saveUpdates(_0x298bb7,_0x22ae1d){return function(_0x2038c8){if(_0x2038c8){return _0x2038c8[_0x1bce('0x23')](_0x298bb7)[_0x1bce('0x24')](function(_0x13ccb3){return _0x13ccb3;});}return null;};}function removeEntity(_0x434d7b,_0x1a1448){return function(_0x40894d){if(_0x40894d){return _0x40894d['destroy']()[_0x1bce('0x24')](function(){_0x434d7b[_0x1bce('0x1a')](0xcc)[_0x1bce('0x19')]();});}};}function handleEntityNotFound(_0xc3e9b3,_0x3cbcd6){return function(_0x2ee937){if(!_0x2ee937){_0xc3e9b3['sendStatus'](0x194);}return _0x2ee937;};}function handleError(_0x53e55f,_0x3811bf){_0x3811bf=_0x3811bf||0x1f4;return function(_0x5e87ce){logger['error'](_0x5e87ce[_0x1bce('0x25')]);if(_0x5e87ce[_0x1bce('0x26')]){delete _0x5e87ce['name'];}_0x53e55f[_0x1bce('0x1a')](_0x3811bf)[_0x1bce('0x27')](_0x5e87ce);};}exports[_0x1bce('0x28')]=function(_0x420488,_0x2f9a8b){var _0x387299={},_0x2a7a27={},_0x6aee5d={'count':0x0,'rows':[]};var _0x38124d=_['map'](db[_0x1bce('0x29')][_0x1bce('0x2a')],function(_0x3cafaf){return{'name':_0x3cafaf['fieldName'],'type':_0x3cafaf[_0x1bce('0x2b')][_0x1bce('0x2c')]};});_0x2a7a27[_0x1bce('0x2d')]=_[_0x1bce('0x2e')](_0x38124d,_0x1bce('0x26'));_0x2a7a27['query']=_[_0x1bce('0x2f')](_0x420488[_0x1bce('0x30')]);_0x2a7a27[_0x1bce('0x31')]=_['intersection'](_0x2a7a27[_0x1bce('0x2d')],_0x2a7a27[_0x1bce('0x30')]);_0x387299[_0x1bce('0x32')]=_[_0x1bce('0x33')](_0x2a7a27['model'],qs['fields'](_0x420488[_0x1bce('0x30')][_0x1bce('0x34')]));_0x387299[_0x1bce('0x32')]=_0x387299[_0x1bce('0x32')][_0x1bce('0x35')]?_0x387299['attributes']:_0x2a7a27[_0x1bce('0x2d')];if(!_0x420488[_0x1bce('0x30')]['hasOwnProperty'](_0x1bce('0x36'))){_0x387299[_0x1bce('0x1d')]=qs[_0x1bce('0x1d')](_0x420488[_0x1bce('0x30')][_0x1bce('0x1d')]);_0x387299[_0x1bce('0x37')]=qs['offset'](_0x420488[_0x1bce('0x30')][_0x1bce('0x37')]);}_0x387299['order']=qs['sort'](_0x420488[_0x1bce('0x30')][_0x1bce('0x38')]);_0x387299[_0x1bce('0x39')]=qs[_0x1bce('0x31')](_[_0x1bce('0x3a')](_0x420488['query'],_0x2a7a27['filters']),_0x38124d);if(_0x420488[_0x1bce('0x30')]['filter']){_0x387299['where']=_[_0x1bce('0x3b')](_0x387299[_0x1bce('0x39')],{'$or':_[_0x1bce('0x2e')](_0x38124d,function(_0x5732b2){if(_0x5732b2[_0x1bce('0x2b')]!==_0x1bce('0x3c')){var _0x5221af={};_0x5221af[_0x5732b2[_0x1bce('0x26')]]={'$like':'%'+_0x420488[_0x1bce('0x30')]['filter']+'%'};return _0x5221af;}})});}_0x387299=_[_0x1bce('0x3b')]({},_0x387299,_0x420488[_0x1bce('0x3d')]);var _0x223cfa={'where':_0x387299[_0x1bce('0x39')]};return db['FreshdeskConfiguration']['count'](_0x223cfa)['then'](function(_0x2e7347){_0x6aee5d[_0x1bce('0x1e')]=_0x2e7347;if(_0x420488[_0x1bce('0x30')]['includeAll']){_0x387299['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x1bce('0x3e')](_0x387299);})[_0x1bce('0x24')](function(_0x2ca925){_0x6aee5d[_0x1bce('0x3f')]=_0x2ca925;return _0x6aee5d;})[_0x1bce('0x24')](respondWithFilteredResult(_0x2f9a8b,_0x387299))[_0x1bce('0x40')](handleError(_0x2f9a8b,null));};exports[_0x1bce('0x41')]=function(_0x40d73a,_0x26508e){var _0x1aa204={'raw':![],'where':{'id':_0x40d73a[_0x1bce('0x42')]['id']}},_0x238bcc={};_0x238bcc['model']=_[_0x1bce('0x2f')](db[_0x1bce('0x29')][_0x1bce('0x2a')]);_0x238bcc[_0x1bce('0x30')]=_[_0x1bce('0x2f')](_0x40d73a[_0x1bce('0x30')]);_0x238bcc[_0x1bce('0x31')]=_['intersection'](_0x238bcc[_0x1bce('0x2d')],_0x238bcc[_0x1bce('0x30')]);_0x1aa204[_0x1bce('0x32')]=_[_0x1bce('0x33')](_0x238bcc[_0x1bce('0x2d')],qs[_0x1bce('0x34')](_0x40d73a[_0x1bce('0x30')]['fields']));_0x1aa204[_0x1bce('0x32')]=_0x1aa204['attributes'][_0x1bce('0x35')]?_0x1aa204[_0x1bce('0x32')]:_0x238bcc[_0x1bce('0x2d')];if(_0x40d73a[_0x1bce('0x30')][_0x1bce('0x43')]){_0x1aa204[_0x1bce('0x44')]=[{'all':!![]}];}_0x1aa204=_[_0x1bce('0x3b')]({},_0x1aa204,_0x40d73a[_0x1bce('0x3d')]);return db[_0x1bce('0x29')][_0x1bce('0x45')](_0x1aa204)[_0x1bce('0x24')](handleEntityNotFound(_0x26508e,null))[_0x1bce('0x24')](respondWithResult(_0x26508e,null))['catch'](handleError(_0x26508e,null));};exports[_0x1bce('0x46')]=function(_0x2d2099,_0x496af4){return db[_0x1bce('0x29')][_0x1bce('0x46')](_0x2d2099[_0x1bce('0x47')],{})[_0x1bce('0x24')](respondWithResult(_0x496af4,0xc9))[_0x1bce('0x40')](handleError(_0x496af4,null));};exports[_0x1bce('0x23')]=function(_0x6102af,_0x1f86fb){if(_0x6102af['body']['id']){delete _0x6102af['body']['id'];}return db[_0x1bce('0x29')]['find']({'where':{'id':_0x6102af['params']['id']}})[_0x1bce('0x24')](handleEntityNotFound(_0x1f86fb,null))[_0x1bce('0x24')](saveUpdates(_0x6102af[_0x1bce('0x47')],null))[_0x1bce('0x24')](respondWithResult(_0x1f86fb,null))['catch'](handleError(_0x1f86fb,null));};exports[_0x1bce('0x48')]=function(_0x44d281,_0x445baa){return db[_0x1bce('0x29')][_0x1bce('0x45')]({'where':{'id':_0x44d281[_0x1bce('0x42')]['id']}})[_0x1bce('0x24')](handleEntityNotFound(_0x445baa,null))[_0x1bce('0x24')](removeEntity(_0x445baa,null))['catch'](handleError(_0x445baa,null));};exports[_0x1bce('0x49')]=function(_0x43147c,_0x4c0a31,_0x4867c9){var _0x599877={};var _0x982590={};var _0xfe6ea;var _0x5057c1;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x43147c[_0x1bce('0x42')]['id']}})[_0x1bce('0x24')](handleEntityNotFound(_0x4c0a31,null))[_0x1bce('0x24')](function(_0x2b4d2b){if(_0x2b4d2b){_0xfe6ea=_0x2b4d2b;_0x982590[_0x1bce('0x2d')]=_[_0x1bce('0x2f')](db[_0x1bce('0x4a')][_0x1bce('0x2a')]);_0x982590[_0x1bce('0x30')]=_[_0x1bce('0x2f')](_0x43147c[_0x1bce('0x30')]);_0x982590[_0x1bce('0x31')]=_['intersection'](_0x982590[_0x1bce('0x2d')],_0x982590[_0x1bce('0x30')]);_0x599877['attributes']=_[_0x1bce('0x33')](_0x982590[_0x1bce('0x2d')],qs[_0x1bce('0x34')](_0x43147c[_0x1bce('0x30')][_0x1bce('0x34')]));_0x599877[_0x1bce('0x32')]=_0x599877[_0x1bce('0x32')][_0x1bce('0x35')]?_0x599877[_0x1bce('0x32')]:_0x982590[_0x1bce('0x2d')];_0x599877[_0x1bce('0x4b')]=qs[_0x1bce('0x38')](_0x43147c[_0x1bce('0x30')]['sort']);_0x599877[_0x1bce('0x39')]=qs['filters'](_[_0x1bce('0x3a')](_0x43147c[_0x1bce('0x30')],_0x982590[_0x1bce('0x31')]));if(_0x43147c[_0x1bce('0x30')][_0x1bce('0x4c')]){_0x599877[_0x1bce('0x39')]=_[_0x1bce('0x3b')](_0x599877['where'],{'$or':_[_0x1bce('0x2e')](_0x599877[_0x1bce('0x32')],function(_0x5bbd9d){var _0x11beb9={};_0x11beb9[_0x5bbd9d]={'$like':'%'+_0x43147c[_0x1bce('0x30')][_0x1bce('0x4c')]+'%'};return _0x11beb9;})});}_0x599877=_['merge']({},_0x599877,_0x43147c['options']);return _0xfe6ea[_0x1bce('0x49')](_0x599877);}})['then'](function(_0x34f2cc){if(_0x34f2cc){_0x5057c1=_0x34f2cc[_0x1bce('0x35')];if(!_0x43147c['query'][_0x1bce('0x4d')]('nolimit')){_0x599877[_0x1bce('0x1d')]=qs[_0x1bce('0x1d')](_0x43147c[_0x1bce('0x30')][_0x1bce('0x1d')]);_0x599877['offset']=qs[_0x1bce('0x37')](_0x43147c[_0x1bce('0x30')][_0x1bce('0x37')]);}return _0xfe6ea[_0x1bce('0x49')](_0x599877);}})[_0x1bce('0x24')](function(_0x21b8f5){if(_0x21b8f5){return _0x21b8f5?{'count':_0x5057c1,'rows':_0x21b8f5}:null;}})[_0x1bce('0x24')](respondWithResult(_0x4c0a31,null))['catch'](handleError(_0x4c0a31,null));};exports['getSubjects']=function(_0x266cca,_0x2c857,_0x1a7446){var _0x45ba1e={};var _0x13d9b9={};var _0x59c0b;var _0x7c907;return db['FreshdeskConfiguration'][_0x1bce('0x4e')]({'where':{'id':_0x266cca[_0x1bce('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c857,null))[_0x1bce('0x24')](function(_0x25f4f0){if(_0x25f4f0){_0x59c0b=_0x25f4f0;_0x13d9b9[_0x1bce('0x2d')]=_['keys'](db[_0x1bce('0x4a')]['rawAttributes']);_0x13d9b9[_0x1bce('0x30')]=_[_0x1bce('0x2f')](_0x266cca[_0x1bce('0x30')]);_0x13d9b9[_0x1bce('0x31')]=_[_0x1bce('0x33')](_0x13d9b9[_0x1bce('0x2d')],_0x13d9b9[_0x1bce('0x30')]);_0x45ba1e['attributes']=_[_0x1bce('0x33')](_0x13d9b9[_0x1bce('0x2d')],qs[_0x1bce('0x34')](_0x266cca[_0x1bce('0x30')][_0x1bce('0x34')]));_0x45ba1e[_0x1bce('0x32')]=_0x45ba1e['attributes'][_0x1bce('0x35')]?_0x45ba1e[_0x1bce('0x32')]:_0x13d9b9[_0x1bce('0x2d')];_0x45ba1e['order']=qs[_0x1bce('0x38')](_0x266cca['query'][_0x1bce('0x38')]);_0x45ba1e['where']=qs[_0x1bce('0x31')](_[_0x1bce('0x3a')](_0x266cca['query'],_0x13d9b9[_0x1bce('0x31')]));if(_0x266cca[_0x1bce('0x30')][_0x1bce('0x4c')]){_0x45ba1e['where']=_[_0x1bce('0x3b')](_0x45ba1e[_0x1bce('0x39')],{'$or':_['map'](_0x45ba1e[_0x1bce('0x32')],function(_0x1296c7){var _0x5b9083={};_0x5b9083[_0x1296c7]={'$like':'%'+_0x266cca[_0x1bce('0x30')][_0x1bce('0x4c')]+'%'};return _0x5b9083;})});}_0x45ba1e=_['merge']({},_0x45ba1e,_0x266cca[_0x1bce('0x3d')]);return _0x59c0b[_0x1bce('0x4f')](_0x45ba1e);}})[_0x1bce('0x24')](function(_0x551280){if(_0x551280){_0x7c907=_0x551280[_0x1bce('0x35')];if(!_0x266cca['query'][_0x1bce('0x4d')]('nolimit')){_0x45ba1e[_0x1bce('0x1d')]=qs[_0x1bce('0x1d')](_0x266cca[_0x1bce('0x30')]['limit']);_0x45ba1e['offset']=qs['offset'](_0x266cca[_0x1bce('0x30')][_0x1bce('0x37')]);}return _0x59c0b[_0x1bce('0x4f')](_0x45ba1e);}})[_0x1bce('0x24')](function(_0x5d6b3f){if(_0x5d6b3f){return _0x5d6b3f?{'count':_0x7c907,'rows':_0x5d6b3f}:null;}})['then'](respondWithResult(_0x2c857,null))['catch'](handleError(_0x2c857,null));};exports[_0x1bce('0x50')]=function(_0x3f2905,_0x1bb080,_0x1ca2af){var _0x3d2da5={};var _0x12b424={};var _0x1c8a16;var _0x1cd340;return db['FreshdeskConfiguration'][_0x1bce('0x4e')]({'where':{'id':_0x3f2905[_0x1bce('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bb080,null))[_0x1bce('0x24')](function(_0x2bcd81){if(_0x2bcd81){_0x1c8a16=_0x2bcd81;_0x12b424[_0x1bce('0x2d')]=_[_0x1bce('0x2f')](db[_0x1bce('0x4a')][_0x1bce('0x2a')]);_0x12b424[_0x1bce('0x30')]=_[_0x1bce('0x2f')](_0x3f2905[_0x1bce('0x30')]);_0x12b424[_0x1bce('0x31')]=_[_0x1bce('0x33')](_0x12b424[_0x1bce('0x2d')],_0x12b424[_0x1bce('0x30')]);_0x3d2da5[_0x1bce('0x32')]=_['intersection'](_0x12b424[_0x1bce('0x2d')],qs[_0x1bce('0x34')](_0x3f2905[_0x1bce('0x30')][_0x1bce('0x34')]));_0x3d2da5[_0x1bce('0x32')]=_0x3d2da5['attributes'][_0x1bce('0x35')]?_0x3d2da5['attributes']:_0x12b424[_0x1bce('0x2d')];_0x3d2da5['order']=qs[_0x1bce('0x38')](_0x3f2905[_0x1bce('0x30')]['sort']);_0x3d2da5[_0x1bce('0x39')]=qs[_0x1bce('0x31')](_[_0x1bce('0x3a')](_0x3f2905[_0x1bce('0x30')],_0x12b424[_0x1bce('0x31')]));if(_0x3f2905[_0x1bce('0x30')][_0x1bce('0x4c')]){_0x3d2da5[_0x1bce('0x39')]=_[_0x1bce('0x3b')](_0x3d2da5[_0x1bce('0x39')],{'$or':_['map'](_0x3d2da5[_0x1bce('0x32')],function(_0x519705){var _0x4fd2ba={};_0x4fd2ba[_0x519705]={'$like':'%'+_0x3f2905['query']['filter']+'%'};return _0x4fd2ba;})});}_0x3d2da5=_[_0x1bce('0x3b')]({},_0x3d2da5,_0x3f2905[_0x1bce('0x3d')]);return _0x1c8a16[_0x1bce('0x50')](_0x3d2da5);}})[_0x1bce('0x24')](function(_0x21f4dc){if(_0x21f4dc){_0x1cd340=_0x21f4dc['length'];if(!_0x3f2905[_0x1bce('0x30')][_0x1bce('0x4d')](_0x1bce('0x36'))){_0x3d2da5['limit']=qs[_0x1bce('0x1d')](_0x3f2905[_0x1bce('0x30')][_0x1bce('0x1d')]);_0x3d2da5[_0x1bce('0x37')]=qs['offset'](_0x3f2905['query']['offset']);}return _0x1c8a16[_0x1bce('0x50')](_0x3d2da5);}})[_0x1bce('0x24')](function(_0x461ccb){if(_0x461ccb){return _0x461ccb?{'count':_0x1cd340,'rows':_0x461ccb}:null;}})['then'](respondWithResult(_0x1bb080,null))[_0x1bce('0x40')](handleError(_0x1bb080,null));};exports[_0x1bce('0x51')]=function(_0x16334d,_0x2fee7a,_0x1a7f17){var _0x2084a2={};var _0x287b38={};var _0x22efbe;var _0x2d9c9e;return db[_0x1bce('0x29')][_0x1bce('0x4e')]({'where':{'id':_0x16334d[_0x1bce('0x42')]['id']}})[_0x1bce('0x24')](handleEntityNotFound(_0x2fee7a,null))[_0x1bce('0x24')](function(_0x347820){if(_0x347820){_0x22efbe=_0x347820;_0x287b38[_0x1bce('0x2d')]=_[_0x1bce('0x2f')](db[_0x1bce('0x52')][_0x1bce('0x2a')]);_0x287b38[_0x1bce('0x30')]=_[_0x1bce('0x2f')](_0x16334d[_0x1bce('0x30')]);_0x287b38[_0x1bce('0x31')]=_[_0x1bce('0x33')](_0x287b38['model'],_0x287b38['query']);_0x2084a2[_0x1bce('0x32')]=_['intersection'](_0x287b38[_0x1bce('0x2d')],qs[_0x1bce('0x34')](_0x16334d[_0x1bce('0x30')]['fields']));_0x2084a2['attributes']=_0x2084a2[_0x1bce('0x32')][_0x1bce('0x35')]?_0x2084a2[_0x1bce('0x32')]:_0x287b38[_0x1bce('0x2d')];_0x2084a2[_0x1bce('0x4b')]=qs['sort'](_0x16334d[_0x1bce('0x30')][_0x1bce('0x38')]);_0x2084a2[_0x1bce('0x39')]=qs[_0x1bce('0x31')](_[_0x1bce('0x3a')](_0x16334d[_0x1bce('0x30')],_0x287b38[_0x1bce('0x31')]));if(_0x16334d[_0x1bce('0x30')]['filter']){_0x2084a2[_0x1bce('0x39')]=_[_0x1bce('0x3b')](_0x2084a2[_0x1bce('0x39')],{'$or':_[_0x1bce('0x2e')](_0x2084a2[_0x1bce('0x32')],function(_0x5c956a){var _0x5c9e99={};_0x5c9e99[_0x5c956a]={'$like':'%'+_0x16334d['query'][_0x1bce('0x4c')]+'%'};return _0x5c9e99;})});}_0x2084a2=_[_0x1bce('0x3b')]({},_0x2084a2,_0x16334d['options']);return _0x22efbe[_0x1bce('0x51')](_0x2084a2);}})[_0x1bce('0x24')](function(_0x311235){if(_0x311235){_0x2d9c9e=_0x311235[_0x1bce('0x35')];if(!_0x16334d[_0x1bce('0x30')]['hasOwnProperty'](_0x1bce('0x36'))){_0x2084a2[_0x1bce('0x1d')]=qs[_0x1bce('0x1d')](_0x16334d[_0x1bce('0x30')][_0x1bce('0x1d')]);_0x2084a2[_0x1bce('0x37')]=qs['offset'](_0x16334d[_0x1bce('0x30')][_0x1bce('0x37')]);}return _0x22efbe[_0x1bce('0x51')](_0x2084a2);}})[_0x1bce('0x24')](function(_0xa16005){if(_0xa16005){return _0xa16005?{'count':_0x2d9c9e,'rows':_0xa16005}:null;}})[_0x1bce('0x24')](respondWithResult(_0x2fee7a,null))['catch'](handleError(_0x2fee7a,null));};exports['setTags']=function(_0x486946,_0x130472,_0xbe3b2e){if(_0x486946['body']['id']){delete _0x486946[_0x1bce('0x47')]['id'];}return db[_0x1bce('0x29')][_0x1bce('0x4e')]({'where':{'id':_0x486946['params']['id']}})['then'](handleEntityNotFound(_0x130472,null))[_0x1bce('0x24')](function(_0x24eb4b){if(_0x24eb4b){return _0x24eb4b[_0x1bce('0x53')](_0x486946[_0x1bce('0x47')][_0x1bce('0x54')]||[]);}return null;})[_0x1bce('0x24')](respondWithResult(_0x130472,null))['catch'](handleError(_0x130472,null));}; \ No newline at end of file +var _0x7002=['sort','where','filters','pick','filter','VIRTUAL','merge','options','then','include','rows','catch','show','params','length','includeAll','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','end','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x75c71f,_0x52573f){var _0x1e864a=function(_0xaaecd0){while(--_0xaaecd0){_0x75c71f['push'](_0x75c71f['shift']());}};_0x1e864a(++_0x52573f);}(_0x7002,0x1b6));var _0x2700=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x7002[_0x46e523];return _0x5da0ee;};'use strict';var emlformat=require(_0x2700('0x0'));var rimraf=require(_0x2700('0x1'));var zipdir=require(_0x2700('0x2'));var jsonpatch=require(_0x2700('0x3'));var rp=require(_0x2700('0x4'));var moment=require(_0x2700('0x5'));var BPromise=require(_0x2700('0x6'));var Mustache=require(_0x2700('0x7'));var util=require('util');var path=require(_0x2700('0x8'));var sox=require('sox');var csv=require(_0x2700('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2700('0xa'));var _=require('lodash');var squel=require(_0x2700('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2700('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2700('0xd'));var Papa=require('papaparse');var Redis=require(_0x2700('0xe'));var authService=require(_0x2700('0xf'));var qs=require(_0x2700('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2700('0x11'))(_0x2700('0x12'));var utils=require(_0x2700('0x13'));var config=require(_0x2700('0x14'));var licenseUtil=require(_0x2700('0x15'));var db=require(_0x2700('0x16'))['db'];function respondWithStatusCode(_0xd2921d,_0x20a6ea){_0x20a6ea=_0x20a6ea||0xcc;return function(_0x56b335){if(_0x56b335){return _0xd2921d[_0x2700('0x17')](_0x20a6ea);}return _0xd2921d[_0x2700('0x18')](_0x20a6ea)['end']();};}function respondWithResult(_0x52b8de,_0x92be6){_0x92be6=_0x92be6||0xc8;return function(_0x33a5cc){if(_0x33a5cc){return _0x52b8de['status'](_0x92be6)['json'](_0x33a5cc);}};}function respondWithFilteredResult(_0x1b4e4c,_0x44fa17){return function(_0x2bd489){if(_0x2bd489){var _0xdc2160=typeof _0x44fa17[_0x2700('0x19')]==='undefined'&&typeof _0x44fa17[_0x2700('0x1a')]===_0x2700('0x1b');var _0x13ada4=_0x2bd489[_0x2700('0x1c')];var _0x22bc2f=_0xdc2160?0x0:_0x44fa17['offset'];var _0x53ee06=_0xdc2160?_0x2bd489[_0x2700('0x1c')]:_0x44fa17[_0x2700('0x19')]+_0x44fa17[_0x2700('0x1a')];var _0x14cada;if(_0x53ee06>=_0x13ada4){_0x53ee06=_0x13ada4;_0x14cada=0xc8;}else{_0x14cada=0xce;}_0x1b4e4c[_0x2700('0x18')](_0x14cada);return _0x1b4e4c[_0x2700('0x1d')](_0x2700('0x1e'),_0x22bc2f+'-'+_0x53ee06+'/'+_0x13ada4)[_0x2700('0x1f')](_0x2bd489);}return null;};}function patchUpdates(_0x14f5d1){return function(_0x82d2ff){try{jsonpatch[_0x2700('0x20')](_0x82d2ff,_0x14f5d1,!![]);}catch(_0x10997f){return BPromise[_0x2700('0x21')](_0x10997f);}return _0x82d2ff[_0x2700('0x22')]();};}function saveUpdates(_0x4cb910,_0x9bd41e){return function(_0x3e51e9){if(_0x3e51e9){return _0x3e51e9['update'](_0x4cb910)['then'](function(_0x43cb8c){return _0x43cb8c;});}return null;};}function removeEntity(_0x18e282,_0x2223e2){return function(_0x1c034d){if(_0x1c034d){return _0x1c034d[_0x2700('0x23')]()['then'](function(){_0x18e282[_0x2700('0x18')](0xcc)[_0x2700('0x24')]();});}};}function handleEntityNotFound(_0x314c5a,_0x4eb790){return function(_0x4983b9){if(!_0x4983b9){_0x314c5a[_0x2700('0x17')](0x194);}return _0x4983b9;};}function handleError(_0x76ea02,_0x128183){_0x128183=_0x128183||0x1f4;return function(_0x17cf17){logger[_0x2700('0x25')](_0x17cf17[_0x2700('0x26')]);if(_0x17cf17['name']){delete _0x17cf17[_0x2700('0x27')];}_0x76ea02[_0x2700('0x18')](_0x128183)[_0x2700('0x28')](_0x17cf17);};}exports['index']=function(_0x4238cd,_0x2d0c6a){var _0x1562f1={},_0x162048={},_0x390f40={'count':0x0,'rows':[]};var _0x1a15f2=_[_0x2700('0x29')](db[_0x2700('0x2a')][_0x2700('0x2b')],function(_0x2365d9){return{'name':_0x2365d9['fieldName'],'type':_0x2365d9[_0x2700('0x2c')]['key']};});_0x162048[_0x2700('0x2d')]=_[_0x2700('0x29')](_0x1a15f2,_0x2700('0x27'));_0x162048[_0x2700('0x2e')]=_[_0x2700('0x2f')](_0x4238cd[_0x2700('0x2e')]);_0x162048['filters']=_[_0x2700('0x30')](_0x162048[_0x2700('0x2d')],_0x162048[_0x2700('0x2e')]);_0x1562f1[_0x2700('0x31')]=_[_0x2700('0x30')](_0x162048['model'],qs[_0x2700('0x32')](_0x4238cd[_0x2700('0x2e')]['fields']));_0x1562f1['attributes']=_0x1562f1[_0x2700('0x31')]['length']?_0x1562f1['attributes']:_0x162048[_0x2700('0x2d')];if(!_0x4238cd['query'][_0x2700('0x33')](_0x2700('0x34'))){_0x1562f1[_0x2700('0x1a')]=qs['limit'](_0x4238cd[_0x2700('0x2e')][_0x2700('0x1a')]);_0x1562f1[_0x2700('0x19')]=qs[_0x2700('0x19')](_0x4238cd[_0x2700('0x2e')][_0x2700('0x19')]);}_0x1562f1[_0x2700('0x35')]=qs[_0x2700('0x36')](_0x4238cd[_0x2700('0x2e')]['sort']);_0x1562f1[_0x2700('0x37')]=qs[_0x2700('0x38')](_[_0x2700('0x39')](_0x4238cd[_0x2700('0x2e')],_0x162048['filters']),_0x1a15f2);if(_0x4238cd[_0x2700('0x2e')][_0x2700('0x3a')]){_0x1562f1[_0x2700('0x37')]=_['merge'](_0x1562f1['where'],{'$or':_[_0x2700('0x29')](_0x1a15f2,function(_0x377d58){if(_0x377d58['type']!==_0x2700('0x3b')){var _0x1b2253={};_0x1b2253[_0x377d58[_0x2700('0x27')]]={'$like':'%'+_0x4238cd['query'][_0x2700('0x3a')]+'%'};return _0x1b2253;}})});}_0x1562f1=_[_0x2700('0x3c')]({},_0x1562f1,_0x4238cd[_0x2700('0x3d')]);var _0x46958c={'where':_0x1562f1[_0x2700('0x37')]};return db['FreshdeskConfiguration']['count'](_0x46958c)[_0x2700('0x3e')](function(_0x1e1d4){_0x390f40[_0x2700('0x1c')]=_0x1e1d4;if(_0x4238cd[_0x2700('0x2e')]['includeAll']){_0x1562f1[_0x2700('0x3f')]=[{'all':!![]}];}return db[_0x2700('0x2a')]['findAll'](_0x1562f1);})[_0x2700('0x3e')](function(_0xc62f2d){_0x390f40[_0x2700('0x40')]=_0xc62f2d;return _0x390f40;})['then'](respondWithFilteredResult(_0x2d0c6a,_0x1562f1))[_0x2700('0x41')](handleError(_0x2d0c6a,null));};exports[_0x2700('0x42')]=function(_0x2bb447,_0x1291d9){var _0x5a2cb1={'raw':![],'where':{'id':_0x2bb447[_0x2700('0x43')]['id']}},_0x4f8690={};_0x4f8690[_0x2700('0x2d')]=_[_0x2700('0x2f')](db[_0x2700('0x2a')][_0x2700('0x2b')]);_0x4f8690[_0x2700('0x2e')]=_['keys'](_0x2bb447['query']);_0x4f8690[_0x2700('0x38')]=_[_0x2700('0x30')](_0x4f8690[_0x2700('0x2d')],_0x4f8690[_0x2700('0x2e')]);_0x5a2cb1[_0x2700('0x31')]=_[_0x2700('0x30')](_0x4f8690[_0x2700('0x2d')],qs[_0x2700('0x32')](_0x2bb447[_0x2700('0x2e')][_0x2700('0x32')]));_0x5a2cb1[_0x2700('0x31')]=_0x5a2cb1[_0x2700('0x31')][_0x2700('0x44')]?_0x5a2cb1[_0x2700('0x31')]:_0x4f8690[_0x2700('0x2d')];if(_0x2bb447[_0x2700('0x2e')][_0x2700('0x45')]){_0x5a2cb1[_0x2700('0x3f')]=[{'all':!![]}];}_0x5a2cb1=_[_0x2700('0x3c')]({},_0x5a2cb1,_0x2bb447[_0x2700('0x3d')]);return db['FreshdeskConfiguration'][_0x2700('0x46')](_0x5a2cb1)[_0x2700('0x3e')](handleEntityNotFound(_0x1291d9,null))['then'](respondWithResult(_0x1291d9,null))[_0x2700('0x41')](handleError(_0x1291d9,null));};exports[_0x2700('0x47')]=function(_0x444e96,_0x6ad32a){return db[_0x2700('0x2a')][_0x2700('0x47')](_0x444e96[_0x2700('0x48')],{})[_0x2700('0x3e')](respondWithResult(_0x6ad32a,0xc9))[_0x2700('0x41')](handleError(_0x6ad32a,null));};exports['update']=function(_0x1f97e0,_0x200596){if(_0x1f97e0['body']['id']){delete _0x1f97e0[_0x2700('0x48')]['id'];}return db[_0x2700('0x2a')]['find']({'where':{'id':_0x1f97e0[_0x2700('0x43')]['id']}})['then'](handleEntityNotFound(_0x200596,null))[_0x2700('0x3e')](saveUpdates(_0x1f97e0[_0x2700('0x48')],null))[_0x2700('0x3e')](respondWithResult(_0x200596,null))[_0x2700('0x41')](handleError(_0x200596,null));};exports[_0x2700('0x23')]=function(_0xf2a5c5,_0x2bca4d){return db[_0x2700('0x2a')][_0x2700('0x46')]({'where':{'id':_0xf2a5c5[_0x2700('0x43')]['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x2bca4d,null))[_0x2700('0x3e')](removeEntity(_0x2bca4d,null))[_0x2700('0x41')](handleError(_0x2bca4d,null));};exports[_0x2700('0x49')]=function(_0x4391ec,_0x45eb66,_0x275ec6){var _0x1e7c97={};var _0x4ae6eb={};var _0x10a096;var _0x31c6e9;return db['FreshdeskConfiguration'][_0x2700('0x4a')]({'where':{'id':_0x4391ec[_0x2700('0x43')]['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x45eb66,null))[_0x2700('0x3e')](function(_0x491db0){if(_0x491db0){_0x10a096=_0x491db0;_0x4ae6eb[_0x2700('0x2d')]=_['keys'](db[_0x2700('0x4b')]['rawAttributes']);_0x4ae6eb[_0x2700('0x2e')]=_['keys'](_0x4391ec['query']);_0x4ae6eb['filters']=_['intersection'](_0x4ae6eb[_0x2700('0x2d')],_0x4ae6eb[_0x2700('0x2e')]);_0x1e7c97[_0x2700('0x31')]=_[_0x2700('0x30')](_0x4ae6eb[_0x2700('0x2d')],qs['fields'](_0x4391ec[_0x2700('0x2e')][_0x2700('0x32')]));_0x1e7c97[_0x2700('0x31')]=_0x1e7c97[_0x2700('0x31')][_0x2700('0x44')]?_0x1e7c97[_0x2700('0x31')]:_0x4ae6eb['model'];_0x1e7c97[_0x2700('0x35')]=qs[_0x2700('0x36')](_0x4391ec[_0x2700('0x2e')][_0x2700('0x36')]);_0x1e7c97[_0x2700('0x37')]=qs[_0x2700('0x38')](_[_0x2700('0x39')](_0x4391ec['query'],_0x4ae6eb[_0x2700('0x38')]));if(_0x4391ec['query']['filter']){_0x1e7c97['where']=_[_0x2700('0x3c')](_0x1e7c97['where'],{'$or':_[_0x2700('0x29')](_0x1e7c97[_0x2700('0x31')],function(_0x462e59){var _0x58317={};_0x58317[_0x462e59]={'$like':'%'+_0x4391ec[_0x2700('0x2e')][_0x2700('0x3a')]+'%'};return _0x58317;})});}_0x1e7c97=_['merge']({},_0x1e7c97,_0x4391ec[_0x2700('0x3d')]);return _0x10a096[_0x2700('0x49')](_0x1e7c97);}})[_0x2700('0x3e')](function(_0x2f3aea){if(_0x2f3aea){_0x31c6e9=_0x2f3aea['length'];if(!_0x4391ec['query']['hasOwnProperty'](_0x2700('0x34'))){_0x1e7c97[_0x2700('0x1a')]=qs[_0x2700('0x1a')](_0x4391ec[_0x2700('0x2e')]['limit']);_0x1e7c97[_0x2700('0x19')]=qs[_0x2700('0x19')](_0x4391ec[_0x2700('0x2e')][_0x2700('0x19')]);}return _0x10a096[_0x2700('0x49')](_0x1e7c97);}})[_0x2700('0x3e')](function(_0x10bda8){if(_0x10bda8){return _0x10bda8?{'count':_0x31c6e9,'rows':_0x10bda8}:null;}})[_0x2700('0x3e')](respondWithResult(_0x45eb66,null))[_0x2700('0x41')](handleError(_0x45eb66,null));};exports[_0x2700('0x4c')]=function(_0x2ca823,_0x34fe19,_0x49c80e){var _0x22fa0b={};var _0xf05046={};var _0x534d4d;var _0x50ba45;return db[_0x2700('0x2a')][_0x2700('0x4a')]({'where':{'id':_0x2ca823['params']['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x34fe19,null))[_0x2700('0x3e')](function(_0x5aeb91){if(_0x5aeb91){_0x534d4d=_0x5aeb91;_0xf05046[_0x2700('0x2d')]=_[_0x2700('0x2f')](db[_0x2700('0x4b')][_0x2700('0x2b')]);_0xf05046[_0x2700('0x2e')]=_['keys'](_0x2ca823[_0x2700('0x2e')]);_0xf05046[_0x2700('0x38')]=_[_0x2700('0x30')](_0xf05046['model'],_0xf05046[_0x2700('0x2e')]);_0x22fa0b['attributes']=_[_0x2700('0x30')](_0xf05046[_0x2700('0x2d')],qs[_0x2700('0x32')](_0x2ca823[_0x2700('0x2e')][_0x2700('0x32')]));_0x22fa0b['attributes']=_0x22fa0b[_0x2700('0x31')]['length']?_0x22fa0b[_0x2700('0x31')]:_0xf05046[_0x2700('0x2d')];_0x22fa0b[_0x2700('0x35')]=qs['sort'](_0x2ca823[_0x2700('0x2e')][_0x2700('0x36')]);_0x22fa0b[_0x2700('0x37')]=qs[_0x2700('0x38')](_['pick'](_0x2ca823[_0x2700('0x2e')],_0xf05046[_0x2700('0x38')]));if(_0x2ca823[_0x2700('0x2e')][_0x2700('0x3a')]){_0x22fa0b[_0x2700('0x37')]=_['merge'](_0x22fa0b[_0x2700('0x37')],{'$or':_[_0x2700('0x29')](_0x22fa0b[_0x2700('0x31')],function(_0x2ce251){var _0x45c849={};_0x45c849[_0x2ce251]={'$like':'%'+_0x2ca823[_0x2700('0x2e')][_0x2700('0x3a')]+'%'};return _0x45c849;})});}_0x22fa0b=_[_0x2700('0x3c')]({},_0x22fa0b,_0x2ca823[_0x2700('0x3d')]);return _0x534d4d[_0x2700('0x4c')](_0x22fa0b);}})[_0x2700('0x3e')](function(_0x1c3ab9){if(_0x1c3ab9){_0x50ba45=_0x1c3ab9[_0x2700('0x44')];if(!_0x2ca823[_0x2700('0x2e')][_0x2700('0x33')](_0x2700('0x34'))){_0x22fa0b[_0x2700('0x1a')]=qs[_0x2700('0x1a')](_0x2ca823[_0x2700('0x2e')][_0x2700('0x1a')]);_0x22fa0b[_0x2700('0x19')]=qs[_0x2700('0x19')](_0x2ca823[_0x2700('0x2e')][_0x2700('0x19')]);}return _0x534d4d['getSubjects'](_0x22fa0b);}})[_0x2700('0x3e')](function(_0x205f5a){if(_0x205f5a){return _0x205f5a?{'count':_0x50ba45,'rows':_0x205f5a}:null;}})['then'](respondWithResult(_0x34fe19,null))['catch'](handleError(_0x34fe19,null));};exports['getDescriptions']=function(_0x21501f,_0x3e3bb8,_0x330e13){var _0x111314={};var _0x5c3565={};var _0x4e42f6;var _0x21e77a;return db[_0x2700('0x2a')][_0x2700('0x4a')]({'where':{'id':_0x21501f['params']['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x3e3bb8,null))[_0x2700('0x3e')](function(_0x3d32c0){if(_0x3d32c0){_0x4e42f6=_0x3d32c0;_0x5c3565[_0x2700('0x2d')]=_[_0x2700('0x2f')](db[_0x2700('0x4b')][_0x2700('0x2b')]);_0x5c3565[_0x2700('0x2e')]=_['keys'](_0x21501f['query']);_0x5c3565[_0x2700('0x38')]=_[_0x2700('0x30')](_0x5c3565[_0x2700('0x2d')],_0x5c3565[_0x2700('0x2e')]);_0x111314['attributes']=_[_0x2700('0x30')](_0x5c3565[_0x2700('0x2d')],qs[_0x2700('0x32')](_0x21501f[_0x2700('0x2e')][_0x2700('0x32')]));_0x111314[_0x2700('0x31')]=_0x111314[_0x2700('0x31')]['length']?_0x111314[_0x2700('0x31')]:_0x5c3565['model'];_0x111314[_0x2700('0x35')]=qs[_0x2700('0x36')](_0x21501f['query']['sort']);_0x111314[_0x2700('0x37')]=qs[_0x2700('0x38')](_[_0x2700('0x39')](_0x21501f[_0x2700('0x2e')],_0x5c3565[_0x2700('0x38')]));if(_0x21501f[_0x2700('0x2e')][_0x2700('0x3a')]){_0x111314[_0x2700('0x37')]=_[_0x2700('0x3c')](_0x111314[_0x2700('0x37')],{'$or':_['map'](_0x111314[_0x2700('0x31')],function(_0xf43b6b){var _0x40eee7={};_0x40eee7[_0xf43b6b]={'$like':'%'+_0x21501f['query'][_0x2700('0x3a')]+'%'};return _0x40eee7;})});}_0x111314=_[_0x2700('0x3c')]({},_0x111314,_0x21501f[_0x2700('0x3d')]);return _0x4e42f6[_0x2700('0x4d')](_0x111314);}})[_0x2700('0x3e')](function(_0x4ec18f){if(_0x4ec18f){_0x21e77a=_0x4ec18f['length'];if(!_0x21501f[_0x2700('0x2e')]['hasOwnProperty'](_0x2700('0x34'))){_0x111314[_0x2700('0x1a')]=qs['limit'](_0x21501f[_0x2700('0x2e')]['limit']);_0x111314[_0x2700('0x19')]=qs[_0x2700('0x19')](_0x21501f['query'][_0x2700('0x19')]);}return _0x4e42f6[_0x2700('0x4d')](_0x111314);}})[_0x2700('0x3e')](function(_0x11289d){if(_0x11289d){return _0x11289d?{'count':_0x21e77a,'rows':_0x11289d}:null;}})[_0x2700('0x3e')](respondWithResult(_0x3e3bb8,null))[_0x2700('0x41')](handleError(_0x3e3bb8,null));};exports[_0x2700('0x4e')]=function(_0x17b8bf,_0x850b92,_0x193c80){var _0xd19de5={};var _0x11879b={};var _0x361472;var _0x4cc2a1;return db[_0x2700('0x2a')][_0x2700('0x4a')]({'where':{'id':_0x17b8bf[_0x2700('0x43')]['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x850b92,null))[_0x2700('0x3e')](function(_0xccae74){if(_0xccae74){_0x361472=_0xccae74;_0x11879b[_0x2700('0x2d')]=_[_0x2700('0x2f')](db[_0x2700('0x4f')][_0x2700('0x2b')]);_0x11879b[_0x2700('0x2e')]=_[_0x2700('0x2f')](_0x17b8bf[_0x2700('0x2e')]);_0x11879b[_0x2700('0x38')]=_[_0x2700('0x30')](_0x11879b['model'],_0x11879b[_0x2700('0x2e')]);_0xd19de5['attributes']=_[_0x2700('0x30')](_0x11879b['model'],qs[_0x2700('0x32')](_0x17b8bf[_0x2700('0x2e')][_0x2700('0x32')]));_0xd19de5[_0x2700('0x31')]=_0xd19de5[_0x2700('0x31')][_0x2700('0x44')]?_0xd19de5[_0x2700('0x31')]:_0x11879b['model'];_0xd19de5[_0x2700('0x35')]=qs['sort'](_0x17b8bf[_0x2700('0x2e')][_0x2700('0x36')]);_0xd19de5[_0x2700('0x37')]=qs['filters'](_[_0x2700('0x39')](_0x17b8bf[_0x2700('0x2e')],_0x11879b[_0x2700('0x38')]));if(_0x17b8bf[_0x2700('0x2e')][_0x2700('0x3a')]){_0xd19de5[_0x2700('0x37')]=_[_0x2700('0x3c')](_0xd19de5[_0x2700('0x37')],{'$or':_[_0x2700('0x29')](_0xd19de5[_0x2700('0x31')],function(_0x1c14f0){var _0x508b4b={};_0x508b4b[_0x1c14f0]={'$like':'%'+_0x17b8bf[_0x2700('0x2e')]['filter']+'%'};return _0x508b4b;})});}_0xd19de5=_[_0x2700('0x3c')]({},_0xd19de5,_0x17b8bf[_0x2700('0x3d')]);return _0x361472[_0x2700('0x4e')](_0xd19de5);}})['then'](function(_0x8c4b4f){if(_0x8c4b4f){_0x4cc2a1=_0x8c4b4f['length'];if(!_0x17b8bf[_0x2700('0x2e')][_0x2700('0x33')](_0x2700('0x34'))){_0xd19de5[_0x2700('0x1a')]=qs['limit'](_0x17b8bf[_0x2700('0x2e')]['limit']);_0xd19de5[_0x2700('0x19')]=qs[_0x2700('0x19')](_0x17b8bf['query'][_0x2700('0x19')]);}return _0x361472[_0x2700('0x4e')](_0xd19de5);}})[_0x2700('0x3e')](function(_0x490afc){if(_0x490afc){return _0x490afc?{'count':_0x4cc2a1,'rows':_0x490afc}:null;}})[_0x2700('0x3e')](respondWithResult(_0x850b92,null))[_0x2700('0x41')](handleError(_0x850b92,null));};exports[_0x2700('0x50')]=function(_0x56403b,_0x1eef05,_0x1f2cf0){if(_0x56403b[_0x2700('0x48')]['id']){delete _0x56403b[_0x2700('0x48')]['id'];}return db[_0x2700('0x2a')][_0x2700('0x4a')]({'where':{'id':_0x56403b['params']['id']}})[_0x2700('0x3e')](handleEntityNotFound(_0x1eef05,null))[_0x2700('0x3e')](function(_0x39578d){if(_0x39578d){return _0x39578d[_0x2700('0x50')](_0x56403b[_0x2700('0x48')][_0x2700('0x51')]||[]);}return null;})[_0x2700('0x3e')](respondWithResult(_0x1eef05,null))[_0x2700('0x41')](handleError(_0x1eef05,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f33fc9f..7a5152d 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2219=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','bluebird','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x2219,0x8a));var _0x9221=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x2219[_0x4ba380];return _0x4b111b;};'use strict';var _=require(_0x9221('0x0'));var util=require(_0x9221('0x1'));var logger=require('../../config/logger')(_0x9221('0x2'));var moment=require('moment');var BPromise=require(_0x9221('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9221('0x4'));var config=require('../../config/environment');var attributes=require(_0x9221('0x5'));module['exports']=function(_0x471883,_0x1ed9ac){return _0x471883[_0x9221('0x6')](_0x9221('0x7'),attributes,{'tableName':_0x9221('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22cb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0x4a465a,_0xc1b476){var _0x22088f=function(_0x3ca556){while(--_0x3ca556){_0x4a465a['push'](_0x4a465a['shift']());}};_0x22088f(++_0xc1b476);}(_0x22cb,0x7c));var _0xb22c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x22cb[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xb22c('0x0'));var util=require(_0xb22c('0x1'));var logger=require('../../config/logger')(_0xb22c('0x2'));var moment=require(_0xb22c('0x3'));var BPromise=require(_0xb22c('0x4'));var rp=require(_0xb22c('0x5'));var fs=require('fs');var path=require(_0xb22c('0x6'));var rimraf=require(_0xb22c('0x7'));var config=require(_0xb22c('0x8'));var attributes=require(_0xb22c('0x9'));module[_0xb22c('0xa')]=function(_0x4e3786,_0x48804d){return _0x4e3786[_0xb22c('0xb')](_0xb22c('0xc'),attributes,{'tableName':_0xb22c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index da6bb26..22ba907 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb51d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x3d7bff,_0x74c891){var _0x3412a3=function(_0x53a589){while(--_0x53a589){_0x3d7bff['push'](_0x3d7bff['shift']());}};_0x3412a3(++_0x74c891);}(_0xb51d,0xbf));var _0xdb51=function(_0x413fc2,_0x4094d9){_0x413fc2=_0x413fc2-0x0;var _0x437555=_0xb51d[_0x413fc2];return _0x437555;};'use strict';var _=require(_0xdb51('0x0'));var util=require('util');var moment=require(_0xdb51('0x1'));var BPromise=require(_0xdb51('0x2'));var rs=require(_0xdb51('0x3'));var fs=require('fs');var Redis=require(_0xdb51('0x4'));var db=require(_0xdb51('0x5'))['db'];var utils=require(_0xdb51('0x6'));var logger=require(_0xdb51('0x7'))(_0xdb51('0x8'));var config=require(_0xdb51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdb51('0xa')][_0xdb51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x133a2b,_0x2376e2,_0x2e61a6){return new BPromise(function(_0x3317d4,_0x2f5177){return client[_0xdb51('0xc')](_0x133a2b,_0x2e61a6)[_0xdb51('0xd')](function(_0x46ff94){logger['info'](_0xdb51('0xe'),_0x2376e2,_0xdb51('0xf'));logger[_0xdb51('0x10')](_0xdb51('0x11'),_0x2376e2,_0xdb51('0xf'),JSON[_0xdb51('0x12')](_0x46ff94));if(_0x46ff94[_0xdb51('0x13')]){if(_0x46ff94[_0xdb51('0x13')][_0xdb51('0x14')]===0x1f4){logger[_0xdb51('0x13')](_0xdb51('0xe'),_0x2376e2,_0x46ff94[_0xdb51('0x13')]['message']);return _0x2f5177(_0x46ff94[_0xdb51('0x13')]['message']);}logger[_0xdb51('0x13')](_0xdb51('0xe'),_0x2376e2,_0x46ff94[_0xdb51('0x13')][_0xdb51('0x15')]);return _0x3317d4(_0x46ff94[_0xdb51('0x13')][_0xdb51('0x15')]);}else{logger[_0xdb51('0x16')](_0xdb51('0xe'),_0x2376e2,_0xdb51('0xf'));_0x3317d4(_0x46ff94[_0xdb51('0x17')][_0xdb51('0x15')]);}})['catch'](function(_0x558065){logger[_0xdb51('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2376e2,_0x558065);_0x2f5177(_0x558065);});});} \ No newline at end of file +var _0xff61=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xff61,0x64));var _0x1ff6=function(_0x103024,_0x437bd9){_0x103024=_0x103024-0x0;var _0x395d0f=_0xff61[_0x103024];return _0x395d0f;};'use strict';var _=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var moment=require(_0x1ff6('0x2'));var BPromise=require(_0x1ff6('0x3'));var rs=require(_0x1ff6('0x4'));var fs=require('fs');var Redis=require(_0x1ff6('0x5'));var db=require(_0x1ff6('0x6'))['db'];var utils=require(_0x1ff6('0x7'));var logger=require('../../config/logger')(_0x1ff6('0x8'));var config=require(_0x1ff6('0x9'));var jayson=require(_0x1ff6('0xa'));var client=jayson[_0x1ff6('0xb')][_0x1ff6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23308f,_0x3f0272,_0x40d47b){return new BPromise(function(_0x5189ba,_0x107113){return client[_0x1ff6('0xd')](_0x23308f,_0x40d47b)[_0x1ff6('0xe')](function(_0x2aa5c7){logger[_0x1ff6('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f0272,_0x1ff6('0x10'));logger[_0x1ff6('0x11')](_0x1ff6('0x12'),_0x3f0272,'request\x20sent',JSON[_0x1ff6('0x13')](_0x2aa5c7));if(_0x2aa5c7[_0x1ff6('0x14')]){if(_0x2aa5c7[_0x1ff6('0x14')][_0x1ff6('0x15')]===0x1f4){logger[_0x1ff6('0x14')](_0x1ff6('0x16'),_0x3f0272,_0x2aa5c7[_0x1ff6('0x14')][_0x1ff6('0x17')]);return _0x107113(_0x2aa5c7['error'][_0x1ff6('0x17')]);}logger[_0x1ff6('0x14')](_0x1ff6('0x16'),_0x3f0272,_0x2aa5c7[_0x1ff6('0x14')][_0x1ff6('0x17')]);return _0x5189ba(_0x2aa5c7[_0x1ff6('0x14')]['message']);}else{logger['info'](_0x1ff6('0x16'),_0x3f0272,_0x1ff6('0x10'));_0x5189ba(_0x2aa5c7[_0x1ff6('0x18')]['message']);}})['catch'](function(_0x36d43d){logger[_0x1ff6('0x14')](_0x1ff6('0x16'),_0x3f0272,_0x36d43d);_0x107113(_0x36d43d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 92d3158..47c9a9e 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x691f=['update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x691f,0x6a));var _0xf691=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x691f[_0x282ccc];return _0x27c2dd;};'use strict';var multer=require(_0xf691('0x0'));var util=require(_0xf691('0x1'));var path=require('path');var timeout=require(_0xf691('0x2'));var express=require(_0xf691('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf691('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf691('0x5'));router[_0xf691('0x6')]('/',auth[_0xf691('0x7')](),controller['index']);router[_0xf691('0x6')](_0xf691('0x8'),auth['isAuthenticated'](),controller[_0xf691('0x9')]);router[_0xf691('0xa')]('/',auth[_0xf691('0x7')](),controller[_0xf691('0xb')]);router[_0xf691('0xc')](_0xf691('0x8'),auth[_0xf691('0x7')](),controller[_0xf691('0xd')]);router[_0xf691('0xe')](_0xf691('0x8'),auth[_0xf691('0x7')](),controller[_0xf691('0xf')]);module[_0xf691('0x10')]=router; \ No newline at end of file +var _0x00c7=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32c40c,_0x5a48c1){var _0x56e979=function(_0x4ed72a){while(--_0x4ed72a){_0x32c40c['push'](_0x32c40c['shift']());}};_0x56e979(++_0x5a48c1);}(_0x00c7,0x137));var _0x700c=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x00c7[_0x25df80];return _0x17b6d0;};'use strict';var multer=require(_0x700c('0x0'));var util=require(_0x700c('0x1'));var path=require(_0x700c('0x2'));var timeout=require(_0x700c('0x3'));var express=require(_0x700c('0x4'));var router=express[_0x700c('0x5')]();var fs_extra=require(_0x700c('0x6'));var auth=require(_0x700c('0x7'));var interaction=require(_0x700c('0x8'));var config=require(_0x700c('0x9'));var controller=require(_0x700c('0xa'));router[_0x700c('0xb')]('/',auth[_0x700c('0xc')](),controller['index']);router[_0x700c('0xb')](_0x700c('0xd'),auth[_0x700c('0xc')](),controller[_0x700c('0xe')]);router[_0x700c('0xf')]('/',auth[_0x700c('0xc')](),controller[_0x700c('0x10')]);router[_0x700c('0x11')](_0x700c('0xd'),auth[_0x700c('0xc')](),controller[_0x700c('0x12')]);router['delete'](_0x700c('0xd'),auth[_0x700c('0xc')](),controller[_0x700c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 55cb65c..c8ce273 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf82=['customVariable','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x5adbb4,_0x5092e0){var _0x48e176=function(_0x2af1c8){while(--_0x2af1c8){_0x5adbb4['push'](_0x5adbb4['shift']());}};_0x48e176(++_0x5092e0);}(_0xcf82,0xab));var _0x2cf8=function(_0x39d134,_0x149663){_0x39d134=_0x39d134-0x0;var _0x1f21c5=_0xcf82[_0x39d134];return _0x1f21c5;};'use strict';var Sequelize=require(_0x2cf8('0x0'));module['exports']={'type':{'type':Sequelize[_0x2cf8('0x1')](_0x2cf8('0x2'),_0x2cf8('0x3'),_0x2cf8('0x4'),'keyValue',_0x2cf8('0x5')),'defaultValue':_0x2cf8('0x2')},'content':{'type':Sequelize[_0x2cf8('0x6')]},'key':{'type':Sequelize[_0x2cf8('0x6')]},'keyType':{'type':Sequelize[_0x2cf8('0x1')]('string',_0x2cf8('0x3'),_0x2cf8('0x4'))},'keyContent':{'type':Sequelize[_0x2cf8('0x6')]},'idField':{'type':Sequelize[_0x2cf8('0x6')]},'nameField':{'type':Sequelize[_0x2cf8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2cf8('0x6')]}}; \ No newline at end of file +var _0x8d60=['string','customVariable','keyValue','picklist','STRING','variable','exports','ENUM'];(function(_0xd496d9,_0x3d1fb6){var _0x29d87c=function(_0x39b652){while(--_0x39b652){_0xd496d9['push'](_0xd496d9['shift']());}};_0x29d87c(++_0x3d1fb6);}(_0x8d60,0xde));var _0x08d6=function(_0x38fad2,_0x21815e){_0x38fad2=_0x38fad2-0x0;var _0x4aed88=_0x8d60[_0x38fad2];return _0x4aed88;};'use strict';var Sequelize=require('sequelize');module[_0x08d6('0x0')]={'type':{'type':Sequelize[_0x08d6('0x1')](_0x08d6('0x2'),'variable',_0x08d6('0x3'),_0x08d6('0x4'),_0x08d6('0x5')),'defaultValue':_0x08d6('0x2')},'content':{'type':Sequelize[_0x08d6('0x6')]},'key':{'type':Sequelize[_0x08d6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x08d6('0x2'),_0x08d6('0x7'),_0x08d6('0x3'))},'keyContent':{'type':Sequelize[_0x08d6('0x6')]},'idField':{'type':Sequelize[_0x08d6('0x6')]},'nameField':{'type':Sequelize[_0x08d6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x08d6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index fc1db2e..8d9857a 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0bc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','create','catch','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x1461b4,_0x2fee20){var _0x473bdf=function(_0x19ea0a){while(--_0x19ea0a){_0x1461b4['push'](_0x1461b4['shift']());}};_0x473bdf(++_0x2fee20);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){_0x54fb03[_0xca0b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe122e8,_0x10b5f3){return function(_0x131c0e){if(!_0x131c0e){_0xe122e8[_0xca0b('0x2b')](0x194);}return _0x131c0e;};}function handleError(_0x15478d,_0x48e172){_0x48e172=_0x48e172||0x1f4;return function(_0x4d2d1a){logger['error'](_0x4d2d1a[_0xca0b('0x2c')]);if(_0x4d2d1a[_0xca0b('0x2d')]){delete _0x4d2d1a[_0xca0b('0x2d')];}_0x15478d[_0xca0b('0x1c')](_0x48e172)[_0xca0b('0x2e')](_0x4d2d1a);};}exports['index']=function(_0x23af62,_0xbfcb5f){var _0x3b73ff={},_0x20f0d5={},_0x227cdc={'count':0x0,'rows':[]};var _0x449a3a=_[_0xca0b('0x2f')](db['FreshdeskField'][_0xca0b('0x30')],function(_0x17a365){return{'name':_0x17a365[_0xca0b('0x31')],'type':_0x17a365[_0xca0b('0x32')]['key']};});_0x20f0d5[_0xca0b('0x33')]=_[_0xca0b('0x2f')](_0x449a3a,_0xca0b('0x2d'));_0x20f0d5[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x23af62[_0xca0b('0x34')]);_0x20f0d5[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],_0x20f0d5[_0xca0b('0x34')]);_0x3b73ff[_0xca0b('0x38')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],qs[_0xca0b('0x39')](_0x23af62[_0xca0b('0x34')]['fields']));_0x3b73ff[_0xca0b('0x38')]=_0x3b73ff[_0xca0b('0x38')][_0xca0b('0x3a')]?_0x3b73ff[_0xca0b('0x38')]:_0x20f0d5['model'];if(!_0x23af62[_0xca0b('0x34')][_0xca0b('0x3b')]('nolimit')){_0x3b73ff[_0xca0b('0x22')]=qs[_0xca0b('0x22')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x22')]);_0x3b73ff[_0xca0b('0x1f')]=qs[_0xca0b('0x1f')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x1f')]);}_0x3b73ff['order']=qs['sort'](_0x23af62[_0xca0b('0x34')][_0xca0b('0x3c')]);_0x3b73ff[_0xca0b('0x3d')]=qs[_0xca0b('0x36')](_[_0xca0b('0x3e')](_0x23af62[_0xca0b('0x34')],_0x20f0d5[_0xca0b('0x36')]),_0x449a3a);if(_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]){_0x3b73ff[_0xca0b('0x3d')]=_[_0xca0b('0x40')](_0x3b73ff[_0xca0b('0x3d')],{'$or':_[_0xca0b('0x2f')](_0x449a3a,function(_0x236edc){if(_0x236edc[_0xca0b('0x32')]!==_0xca0b('0x41')){var _0xdce72f={};_0xdce72f[_0x236edc[_0xca0b('0x2d')]]={'$like':'%'+_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]+'%'};return _0xdce72f;}})});}_0x3b73ff=_[_0xca0b('0x40')]({},_0x3b73ff,_0x23af62[_0xca0b('0x42')]);var _0x1757f0={'where':_0x3b73ff[_0xca0b('0x3d')]};return db[_0xca0b('0x43')]['count'](_0x1757f0)['then'](function(_0x1e62f5){_0x227cdc[_0xca0b('0x21')]=_0x1e62f5;if(_0x23af62['query']['includeAll']){_0x3b73ff['include']=[{'all':!![]}];}return db[_0xca0b('0x43')][_0xca0b('0x44')](_0x3b73ff);})[_0xca0b('0x29')](function(_0xf9e175){_0x227cdc[_0xca0b('0x45')]=_0xf9e175;return _0x227cdc;})['then'](respondWithFilteredResult(_0xbfcb5f,_0x3b73ff))['catch'](handleError(_0xbfcb5f,null));};exports[_0xca0b('0x46')]=function(_0x543bf8,_0x170d76){var _0x4eca5d={'raw':!![],'where':{'id':_0x543bf8['params']['id']}},_0x57bab3={};_0x57bab3[_0xca0b('0x33')]=_[_0xca0b('0x35')](db[_0xca0b('0x43')][_0xca0b('0x30')]);_0x57bab3[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x543bf8['query']);_0x57bab3[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x57bab3[_0xca0b('0x33')],_0x57bab3[_0xca0b('0x34')]);_0x4eca5d[_0xca0b('0x38')]=_['intersection'](_0x57bab3['model'],qs[_0xca0b('0x39')](_0x543bf8[_0xca0b('0x34')][_0xca0b('0x39')]));_0x4eca5d[_0xca0b('0x38')]=_0x4eca5d['attributes'][_0xca0b('0x3a')]?_0x4eca5d[_0xca0b('0x38')]:_0x57bab3[_0xca0b('0x33')];if(_0x543bf8[_0xca0b('0x34')]['includeAll']){_0x4eca5d['include']=[{'all':!![]}];}_0x4eca5d=_[_0xca0b('0x40')]({},_0x4eca5d,_0x543bf8[_0xca0b('0x42')]);return db[_0xca0b('0x43')]['find'](_0x4eca5d)[_0xca0b('0x29')](handleEntityNotFound(_0x170d76,null))[_0xca0b('0x29')](respondWithResult(_0x170d76,null))['catch'](handleError(_0x170d76,null));};exports['create']=function(_0x4f531c,_0x379a06){return db[_0xca0b('0x43')][_0xca0b('0x47')](_0x4f531c['body'],{})['then'](respondWithResult(_0x379a06,0xc9))[_0xca0b('0x48')](handleError(_0x379a06,null));};exports[_0xca0b('0x28')]=function(_0x250288,_0x174e81){if(_0x250288[_0xca0b('0x49')]['id']){delete _0x250288[_0xca0b('0x49')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x250288['params']['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x174e81,null))[_0xca0b('0x29')](saveUpdates(_0x250288['body'],null))[_0xca0b('0x29')](respondWithResult(_0x174e81,null))[_0xca0b('0x48')](handleError(_0x174e81,null));};exports[_0xca0b('0x2a')]=function(_0x535cce,_0x251820){return db['FreshdeskField'][_0xca0b('0x4a')]({'where':{'id':_0x535cce[_0xca0b('0x4b')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x251820,null))[_0xca0b('0x29')](removeEntity(_0x251820,null))[_0xca0b('0x48')](handleError(_0x251820,null));}; \ No newline at end of file +var _0x1be1=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','includeAll','show','params','rawAttributes','include','create','body','catch','find','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x1be1,0x192));var _0x11be=function(_0x2b6d83,_0x38eb14){_0x2b6d83=_0x2b6d83-0x0;var _0x5edc68=_0x1be1[_0x2b6d83];return _0x5edc68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)[_0x11be('0x23')]();});}};}function handleEntityNotFound(_0x4cb27f,_0x106167){return function(_0x518e2b){if(!_0x518e2b){_0x4cb27f[_0x11be('0x24')](0x194);}return _0x518e2b;};}function handleError(_0x563e01,_0x28310d){_0x28310d=_0x28310d||0x1f4;return function(_0xb11f3d){logger['error'](_0xb11f3d[_0x11be('0x25')]);if(_0xb11f3d[_0x11be('0x26')]){delete _0xb11f3d[_0x11be('0x26')];}_0x563e01[_0x11be('0x17')](_0x28310d)[_0x11be('0x27')](_0xb11f3d);};}exports[_0x11be('0x28')]=function(_0xf5a6ac,_0x2cf9aa){var _0x43ab30={},_0x5966c5={},_0x32c796={'count':0x0,'rows':[]};var _0x4e899f=_[_0x11be('0x29')](db[_0x11be('0x2a')]['rawAttributes'],function(_0x584d4c){return{'name':_0x584d4c[_0x11be('0x2b')],'type':_0x584d4c[_0x11be('0x2c')][_0x11be('0x2d')]};});_0x5966c5[_0x11be('0x2e')]=_[_0x11be('0x29')](_0x4e899f,_0x11be('0x26'));_0x5966c5[_0x11be('0x2f')]=_[_0x11be('0x30')](_0xf5a6ac[_0x11be('0x2f')]);_0x5966c5['filters']=_[_0x11be('0x31')](_0x5966c5[_0x11be('0x2e')],_0x5966c5[_0x11be('0x2f')]);_0x43ab30[_0x11be('0x32')]=_[_0x11be('0x31')](_0x5966c5[_0x11be('0x2e')],qs['fields'](_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x33')]));_0x43ab30[_0x11be('0x32')]=_0x43ab30[_0x11be('0x32')][_0x11be('0x34')]?_0x43ab30['attributes']:_0x5966c5[_0x11be('0x2e')];if(!_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x35')]('nolimit')){_0x43ab30[_0x11be('0x1a')]=qs['limit'](_0xf5a6ac['query']['limit']);_0x43ab30['offset']=qs[_0x11be('0x18')](_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x18')]);}_0x43ab30['order']=qs[_0x11be('0x36')](_0xf5a6ac[_0x11be('0x2f')]['sort']);_0x43ab30[_0x11be('0x37')]=qs['filters'](_[_0x11be('0x38')](_0xf5a6ac['query'],_0x5966c5[_0x11be('0x39')]),_0x4e899f);if(_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x3a')]){_0x43ab30[_0x11be('0x37')]=_['merge'](_0x43ab30[_0x11be('0x37')],{'$or':_[_0x11be('0x29')](_0x4e899f,function(_0x3255c0){if(_0x3255c0[_0x11be('0x2c')]!=='VIRTUAL'){var _0x11d5ea={};_0x11d5ea[_0x3255c0[_0x11be('0x26')]]={'$like':'%'+_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x3a')]+'%'};return _0x11d5ea;}})});}_0x43ab30=_[_0x11be('0x3b')]({},_0x43ab30,_0xf5a6ac[_0x11be('0x3c')]);var _0x5742d1={'where':_0x43ab30['where']};return db[_0x11be('0x2a')][_0x11be('0x1b')](_0x5742d1)['then'](function(_0xf303c){_0x32c796[_0x11be('0x1b')]=_0xf303c;if(_0xf5a6ac['query'][_0x11be('0x3d')]){_0x43ab30['include']=[{'all':!![]}];}return db[_0x11be('0x2a')]['findAll'](_0x43ab30);})[_0x11be('0x22')](function(_0x30be21){_0x32c796['rows']=_0x30be21;return _0x32c796;})[_0x11be('0x22')](respondWithFilteredResult(_0x2cf9aa,_0x43ab30))['catch'](handleError(_0x2cf9aa,null));};exports[_0x11be('0x3e')]=function(_0x51a40b,_0x2deae3){var _0x383604={'raw':!![],'where':{'id':_0x51a40b[_0x11be('0x3f')]['id']}},_0x2b847a={};_0x2b847a[_0x11be('0x2e')]=_['keys'](db[_0x11be('0x2a')][_0x11be('0x40')]);_0x2b847a[_0x11be('0x2f')]=_[_0x11be('0x30')](_0x51a40b['query']);_0x2b847a['filters']=_['intersection'](_0x2b847a[_0x11be('0x2e')],_0x2b847a['query']);_0x383604[_0x11be('0x32')]=_['intersection'](_0x2b847a[_0x11be('0x2e')],qs[_0x11be('0x33')](_0x51a40b[_0x11be('0x2f')][_0x11be('0x33')]));_0x383604[_0x11be('0x32')]=_0x383604[_0x11be('0x32')][_0x11be('0x34')]?_0x383604['attributes']:_0x2b847a[_0x11be('0x2e')];if(_0x51a40b['query'][_0x11be('0x3d')]){_0x383604[_0x11be('0x41')]=[{'all':!![]}];}_0x383604=_[_0x11be('0x3b')]({},_0x383604,_0x51a40b['options']);return db['FreshdeskField']['find'](_0x383604)[_0x11be('0x22')](handleEntityNotFound(_0x2deae3,null))[_0x11be('0x22')](respondWithResult(_0x2deae3,null))['catch'](handleError(_0x2deae3,null));};exports['create']=function(_0x5020c7,_0x44e2e8){return db[_0x11be('0x2a')][_0x11be('0x42')](_0x5020c7[_0x11be('0x43')],{})[_0x11be('0x22')](respondWithResult(_0x44e2e8,0xc9))[_0x11be('0x44')](handleError(_0x44e2e8,null));};exports[_0x11be('0x21')]=function(_0x3f2070,_0x2ce110){if(_0x3f2070[_0x11be('0x43')]['id']){delete _0x3f2070[_0x11be('0x43')]['id'];}return db['FreshdeskField'][_0x11be('0x45')]({'where':{'id':_0x3f2070[_0x11be('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2ce110,null))['then'](saveUpdates(_0x3f2070['body'],null))[_0x11be('0x22')](respondWithResult(_0x2ce110,null))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x46')]=function(_0x1c1626,_0x2716dc){return db[_0x11be('0x2a')][_0x11be('0x45')]({'where':{'id':_0x1c1626[_0x11be('0x3f')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x2716dc,null))[_0x11be('0x22')](removeEntity(_0x2716dc,null))[_0x11be('0x44')](handleError(_0x2716dc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 91e56b5..87bdc95 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb0=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5eb0,0x1c6));var _0x05eb=function(_0xa203e,_0x2b6d7d){_0xa203e=_0xa203e-0x0;var _0xc27f6b=_0x5eb0[_0xa203e];return _0xc27f6b;};'use strict';var _=require(_0x05eb('0x0'));var util=require(_0x05eb('0x1'));var logger=require(_0x05eb('0x2'))(_0x05eb('0x3'));var moment=require(_0x05eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x05eb('0x5'));var fs=require('fs');var path=require(_0x05eb('0x6'));var rimraf=require('rimraf');var config=require(_0x05eb('0x7'));var attributes=require(_0x05eb('0x8'));module[_0x05eb('0x9')]=function(_0xcd64fb,_0x3ee1e9){return _0xcd64fb[_0x05eb('0xa')](_0x05eb('0xb'),attributes,{'tableName':_0x05eb('0xc'),'paranoid':![],'indexes':[{'name':_0x05eb('0xd'),'fields':[_0x05eb('0xe'),_0x05eb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70c2=['freshdesk_unique_index','FieldId','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x26acc8,_0x1148d6){var _0x46f1b5=function(_0x423dff){while(--_0x423dff){_0x26acc8['push'](_0x26acc8['shift']());}};_0x46f1b5(++_0x1148d6);}(_0x70c2,0xb8));var _0x270c=function(_0x5b9353,_0x50885a){_0x5b9353=_0x5b9353-0x0;var _0x1a4f63=_0x70c2[_0x5b9353];return _0x1a4f63;};'use strict';var _=require(_0x270c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x270c('0x1'));var moment=require(_0x270c('0x2'));var BPromise=require(_0x270c('0x3'));var rp=require(_0x270c('0x4'));var fs=require('fs');var path=require(_0x270c('0x5'));var rimraf=require('rimraf');var config=require(_0x270c('0x6'));var attributes=require(_0x270c('0x7'));module[_0x270c('0x8')]=function(_0x53d72b,_0x5e0df7){return _0x53d72b[_0x270c('0x9')](_0x270c('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x270c('0xb'),'fields':['idField',_0x270c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 3375471..9197a87 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa944=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskField,\x20%s,\x20%s'];(function(_0xcd81b8,_0x18d9fd){var _0xc3ae18=function(_0x2bd4e0){while(--_0x2bd4e0){_0xcd81b8['push'](_0xcd81b8['shift']());}};_0xc3ae18(++_0x18d9fd);}(_0xa944,0x142));var _0x4a94=function(_0x3e19ec,_0x3b684a){_0x3e19ec=_0x3e19ec-0x0;var _0x1af73b=_0xa944[_0x3e19ec];return _0x1af73b;};'use strict';var _=require(_0x4a94('0x0'));var util=require(_0x4a94('0x1'));var moment=require(_0x4a94('0x2'));var BPromise=require(_0x4a94('0x3'));var rs=require(_0x4a94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a94('0x5'))['db'];var utils=require(_0x4a94('0x6'));var logger=require(_0x4a94('0x7'))(_0x4a94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x599d1c,_0x34622d,_0x454e90){return new BPromise(function(_0x5bff10,_0x379a63){return client['request'](_0x599d1c,_0x454e90)[_0x4a94('0x9')](function(_0x4f3d33){logger[_0x4a94('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x34622d,_0x4a94('0xb'));logger[_0x4a94('0xc')](_0x4a94('0xd'),_0x34622d,_0x4a94('0xb'),JSON[_0x4a94('0xe')](_0x4f3d33));if(_0x4f3d33[_0x4a94('0xf')]){if(_0x4f3d33[_0x4a94('0xf')]['code']===0x1f4){logger[_0x4a94('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x34622d,_0x4f3d33[_0x4a94('0xf')][_0x4a94('0x10')]);return _0x379a63(_0x4f3d33[_0x4a94('0xf')][_0x4a94('0x10')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x34622d,_0x4f3d33[_0x4a94('0xf')]['message']);return _0x5bff10(_0x4f3d33[_0x4a94('0xf')]['message']);}else{logger[_0x4a94('0xa')](_0x4a94('0x11'),_0x34622d,_0x4a94('0xb'));_0x5bff10(_0x4f3d33[_0x4a94('0x12')]['message']);}})[_0x4a94('0x13')](function(_0x2e480c){logger[_0x4a94('0xf')](_0x4a94('0x11'),_0x34622d,_0x2e480c);_0x379a63(_0x2e480c);});});} \ No newline at end of file +var _0xe547=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x352ed2,_0x2880bb){var _0x35d60b=function(_0x5b0d56){while(--_0x5b0d56){_0x352ed2['push'](_0x352ed2['shift']());}};_0x35d60b(++_0x2880bb);}(_0xe547,0xa5));var _0x7e54=function(_0x4e6c4d,_0x2aac87){_0x4e6c4d=_0x4e6c4d-0x0;var _0x374fbe=_0xe547[_0x4e6c4d];return _0x374fbe;};'use strict';var _=require(_0x7e54('0x0'));var util=require(_0x7e54('0x1'));var moment=require(_0x7e54('0x2'));var BPromise=require(_0x7e54('0x3'));var rs=require(_0x7e54('0x4'));var fs=require('fs');var Redis=require(_0x7e54('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e54('0x6'));var logger=require(_0x7e54('0x7'))(_0x7e54('0x8'));var config=require(_0x7e54('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7e54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13f6e4,_0x3ee9a7,_0x44ba4d){return new BPromise(function(_0x31c583,_0x2361a1){return client['request'](_0x13f6e4,_0x44ba4d)['then'](function(_0x557732){logger[_0x7e54('0xb')](_0x7e54('0xc'),_0x3ee9a7,'request\x20sent');logger[_0x7e54('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3ee9a7,_0x7e54('0xe'),JSON[_0x7e54('0xf')](_0x557732));if(_0x557732['error']){if(_0x557732[_0x7e54('0x10')][_0x7e54('0x11')]===0x1f4){logger[_0x7e54('0x10')](_0x7e54('0xc'),_0x3ee9a7,_0x557732[_0x7e54('0x10')]['message']);return _0x2361a1(_0x557732['error'][_0x7e54('0x12')]);}logger[_0x7e54('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x3ee9a7,_0x557732[_0x7e54('0x10')][_0x7e54('0x12')]);return _0x31c583(_0x557732[_0x7e54('0x10')][_0x7e54('0x12')]);}else{logger[_0x7e54('0xb')](_0x7e54('0xc'),_0x3ee9a7,'request\x20sent');_0x31c583(_0x557732[_0x7e54('0x13')]['message']);}})[_0x7e54('0x14')](function(_0x421c20){logger[_0x7e54('0x10')](_0x7e54('0xc'),_0x3ee9a7,_0x421c20);_0x2361a1(_0x421c20);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1b18227..99c5370 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','put','delete','destroy','exports'];(function(_0x556892,_0x2680cf){var _0xfb1c4d=function(_0xcd7945){while(--_0xcd7945){_0x556892['push'](_0x556892['shift']());}};_0xfb1c4d(++_0x2680cf);}(_0x750a,0x140));var _0xa750=function(_0x20aa8f,_0x515541){_0x20aa8f=_0x20aa8f-0x0;var _0x52f482=_0x750a[_0x20aa8f];return _0x52f482;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/fields',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router['post'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['addConfiguration']);router[_0xa750('0x10')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['update']);router[_0xa750('0x11')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);module[_0xa750('0x13')]=router; \ No newline at end of file +var _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x16d2,0x123));var _0x216d=function(_0x3ca079,_0x4a70bd){_0x3ca079=_0x3ca079-0x0;var _0x435c23=_0x16d2[_0x3ca079];return _0x435c23;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ea4026a..734964c 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['exports','STRING','username'];(function(_0x1046a7,_0x337517){var _0x1ab33c=function(_0xdaf849){while(--_0xdaf849){_0x1046a7['push'](_0x1046a7['shift']());}};_0x1ab33c(++_0x337517);}(_0xda2d,0x102));var _0xdda2=function(_0x8f3cdd,_0x115e79){_0x8f3cdd=_0x8f3cdd-0x0;var _0x2441b3=_0xda2d[_0x8f3cdd];return _0x2441b3;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1f29a8,_0x15ee9b){var _0xc62ab7=function(_0x276fce){while(--_0x276fce){_0x1f29a8['push'](_0x1f29a8['shift']());}};_0xc62ab7(++_0x15ee9b);}(_0x1a37,0xb4));var _0x71a3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1a37[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 97dd337..f734e1d 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7443=['filter','merge','where','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7443,0xf4));var _0x3744=function(_0x2ac88,_0x30ab71){_0x2ac88=_0x2ac88-0x0;var _0x463dcb=_0x7443[_0x2ac88];return _0x463dcb;};'use strict';var emlformat=require(_0x3744('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3744('0x1'));var moment=require(_0x3744('0x2'));var BPromise=require(_0x3744('0x3'));var Mustache=require(_0x3744('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3744('0x5'));var csv=require('to-csv');var ejs=require(_0x3744('0x6'));var fs=require('fs');var fs_extra=require(_0x3744('0x7'));var _=require(_0x3744('0x8'));var squel=require(_0x3744('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3744('0xa'));var Papa=require('papaparse');var Redis=require(_0x3744('0xb'));var authService=require(_0x3744('0xc'));var qs=require(_0x3744('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3744('0xe'));var logger=require(_0x3744('0xf'))(_0x3744('0x10'));var utils=require(_0x3744('0x11'));var config=require(_0x3744('0x12'));var licenseUtil=require(_0x3744('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3744('0x14'));function respondWithStatusCode(_0x35a81e,_0xed2232){_0xed2232=_0xed2232||0xcc;return function(_0x924bb2){if(_0x924bb2){return _0x35a81e[_0x3744('0x15')](_0xed2232);}return _0x35a81e[_0x3744('0x16')](_0xed2232)[_0x3744('0x17')]();};}function respondWithResult(_0xefcf00,_0x197f7c){_0x197f7c=_0x197f7c||0xc8;return function(_0x1d2aac){if(_0x1d2aac){return _0xefcf00['status'](_0x197f7c)[_0x3744('0x18')](_0x1d2aac);}};}function respondWithFilteredResult(_0x4d7c3a,_0xaa49b3){return function(_0xe34d1){if(_0xe34d1){var _0x379b52=typeof _0xaa49b3[_0x3744('0x19')]===_0x3744('0x1a')&&typeof _0xaa49b3[_0x3744('0x1b')]==='undefined';var _0x1780fa=_0xe34d1[_0x3744('0x1c')];var _0x47e67d=_0x379b52?0x0:_0xaa49b3[_0x3744('0x19')];var _0x5575a7=_0x379b52?_0xe34d1['count']:_0xaa49b3[_0x3744('0x19')]+_0xaa49b3[_0x3744('0x1b')];var _0x1f8c11;if(_0x5575a7>=_0x1780fa){_0x5575a7=_0x1780fa;_0x1f8c11=0xc8;}else{_0x1f8c11=0xce;}_0x4d7c3a[_0x3744('0x16')](_0x1f8c11);return _0x4d7c3a[_0x3744('0x1d')](_0x3744('0x1e'),_0x47e67d+'-'+_0x5575a7+'/'+_0x1780fa)[_0x3744('0x18')](_0xe34d1);}return null;};}function patchUpdates(_0x2776e0){return function(_0x2faa30){try{jsonpatch['apply'](_0x2faa30,_0x2776e0,!![]);}catch(_0x1f6658){return BPromise[_0x3744('0x1f')](_0x1f6658);}return _0x2faa30['save']();};}function saveUpdates(_0x4f1fc0,_0x5a0192){return function(_0xd9309b){if(_0xd9309b){return _0xd9309b[_0x3744('0x20')](_0x4f1fc0)['then'](function(_0x2ce450){return _0x2ce450;});}return null;};}function removeEntity(_0x34587c,_0x4783f3){return function(_0x5d21d1){if(_0x5d21d1){return _0x5d21d1[_0x3744('0x21')]()[_0x3744('0x22')](function(){_0x34587c[_0x3744('0x16')](0xcc)[_0x3744('0x17')]();});}};}function handleEntityNotFound(_0x5ea5a5,_0x3144aa){return function(_0x2cb8ef){if(!_0x2cb8ef){_0x5ea5a5[_0x3744('0x15')](0x194);}return _0x2cb8ef;};}function handleError(_0x27d1fe,_0x5bade1){_0x5bade1=_0x5bade1||0x1f4;return function(_0x255d80){logger[_0x3744('0x23')](_0x255d80[_0x3744('0x24')]);if(_0x255d80['name']){delete _0x255d80['name'];}_0x27d1fe[_0x3744('0x16')](_0x5bade1)['send'](_0x255d80);};}exports[_0x3744('0x25')]=function(_0x496209,_0x211a8e){var _0x27e367={},_0x1f96e0={},_0x2af825={'count':0x0,'rows':[]};var _0x168ffd=_[_0x3744('0x26')](db[_0x3744('0x27')][_0x3744('0x28')],function(_0x3ffcb8){return{'name':_0x3ffcb8[_0x3744('0x29')],'type':_0x3ffcb8[_0x3744('0x2a')][_0x3744('0x2b')]};});_0x1f96e0[_0x3744('0x2c')]=_[_0x3744('0x26')](_0x168ffd,_0x3744('0x2d'));_0x1f96e0[_0x3744('0x2e')]=_['keys'](_0x496209[_0x3744('0x2e')]);_0x1f96e0[_0x3744('0x2f')]=_['intersection'](_0x1f96e0[_0x3744('0x2c')],_0x1f96e0[_0x3744('0x2e')]);_0x27e367[_0x3744('0x30')]=_[_0x3744('0x31')](_0x1f96e0[_0x3744('0x2c')],qs[_0x3744('0x32')](_0x496209[_0x3744('0x2e')][_0x3744('0x32')]));_0x27e367['attributes']=_0x27e367['attributes'][_0x3744('0x33')]?_0x27e367['attributes']:_0x1f96e0[_0x3744('0x2c')];if(!_0x496209['query']['hasOwnProperty'](_0x3744('0x34'))){_0x27e367[_0x3744('0x1b')]=qs[_0x3744('0x1b')](_0x496209['query'][_0x3744('0x1b')]);_0x27e367[_0x3744('0x19')]=qs[_0x3744('0x19')](_0x496209['query']['offset']);}_0x27e367[_0x3744('0x35')]=qs[_0x3744('0x36')](_0x496209['query']['sort']);_0x27e367['where']=qs['filters'](_[_0x3744('0x37')](_0x496209[_0x3744('0x2e')],_0x1f96e0[_0x3744('0x2f')]),_0x168ffd);if(_0x496209[_0x3744('0x2e')][_0x3744('0x38')]){_0x27e367['where']=_[_0x3744('0x39')](_0x27e367[_0x3744('0x3a')],{'$or':_[_0x3744('0x26')](_0x168ffd,function(_0x394fe7){if(_0x394fe7['type']!=='VIRTUAL'){var _0x420536={};_0x420536[_0x394fe7[_0x3744('0x2d')]]={'$like':'%'+_0x496209['query']['filter']+'%'};return _0x420536;}})});}_0x27e367=_[_0x3744('0x39')]({},_0x27e367,_0x496209[_0x3744('0x3b')]);var _0x4a851d={'where':_0x27e367['where']};return db[_0x3744('0x27')]['count'](_0x4a851d)['then'](function(_0x2e77e1){_0x2af825[_0x3744('0x1c')]=_0x2e77e1;if(_0x496209[_0x3744('0x2e')][_0x3744('0x3c')]){_0x27e367[_0x3744('0x3d')]=[{'all':!![]}];}return db[_0x3744('0x27')][_0x3744('0x3e')](_0x27e367);})[_0x3744('0x22')](function(_0xbeb53){_0x2af825[_0x3744('0x3f')]=_0xbeb53;return _0x2af825;})[_0x3744('0x22')](respondWithFilteredResult(_0x211a8e,_0x27e367))[_0x3744('0x40')](handleError(_0x211a8e,null));};exports[_0x3744('0x41')]=function(_0x5a96c9,_0x15a48c){var _0x489b6e={'raw':![],'where':{'id':_0x5a96c9['params']['id']}},_0x2fbba4={};_0x2fbba4[_0x3744('0x2c')]=_[_0x3744('0x42')](db[_0x3744('0x27')][_0x3744('0x28')]);_0x2fbba4[_0x3744('0x2e')]=_[_0x3744('0x42')](_0x5a96c9['query']);_0x2fbba4[_0x3744('0x2f')]=_[_0x3744('0x31')](_0x2fbba4[_0x3744('0x2c')],_0x2fbba4[_0x3744('0x2e')]);_0x489b6e[_0x3744('0x30')]=_['intersection'](_0x2fbba4[_0x3744('0x2c')],qs['fields'](_0x5a96c9[_0x3744('0x2e')][_0x3744('0x32')]));_0x489b6e['attributes']=_0x489b6e['attributes'][_0x3744('0x33')]?_0x489b6e[_0x3744('0x30')]:_0x2fbba4[_0x3744('0x2c')];if(_0x5a96c9[_0x3744('0x2e')][_0x3744('0x3c')]){_0x489b6e[_0x3744('0x3d')]=[{'all':!![]}];}_0x489b6e=_[_0x3744('0x39')]({},_0x489b6e,_0x5a96c9[_0x3744('0x3b')]);return db['FreshsalesAccount']['find'](_0x489b6e)['then'](handleEntityNotFound(_0x15a48c,null))[_0x3744('0x22')](respondWithResult(_0x15a48c,null))[_0x3744('0x40')](handleError(_0x15a48c,null));};exports['create']=function(_0x58245a,_0x421f15){return db['FreshsalesAccount'][_0x3744('0x43')](_0x58245a['body'],{})[_0x3744('0x22')](respondWithResult(_0x421f15,0xc9))[_0x3744('0x40')](handleError(_0x421f15,null));};exports[_0x3744('0x20')]=function(_0x3a216b,_0x10c412){if(_0x3a216b[_0x3744('0x44')]['id']){delete _0x3a216b[_0x3744('0x44')]['id'];}return db[_0x3744('0x27')][_0x3744('0x45')]({'where':{'id':_0x3a216b[_0x3744('0x46')]['id']}})[_0x3744('0x22')](handleEntityNotFound(_0x10c412,null))[_0x3744('0x22')](saveUpdates(_0x3a216b[_0x3744('0x44')],null))[_0x3744('0x22')](respondWithResult(_0x10c412,null))[_0x3744('0x40')](handleError(_0x10c412,null));};exports[_0x3744('0x21')]=function(_0x2881b7,_0xd0c221){return db['FreshsalesAccount'][_0x3744('0x45')]({'where':{'id':_0x2881b7[_0x3744('0x46')]['id']}})[_0x3744('0x22')](handleEntityNotFound(_0xd0c221,null))[_0x3744('0x22')](removeEntity(_0xd0c221,null))[_0x3744('0x40')](handleError(_0xd0c221,null));};exports[_0x3744('0x47')]=function(_0x69981e,_0x317dd4,_0xbef81a){var _0x251c08={};var _0xd6ffce={};var _0x53aa50;var _0x306e30;return db[_0x3744('0x27')]['findOne']({'where':{'id':_0x69981e[_0x3744('0x46')]['id']}})['then'](handleEntityNotFound(_0x317dd4,null))[_0x3744('0x22')](function(_0x2f5895){if(_0x2f5895){_0x53aa50=_0x2f5895;_0xd6ffce[_0x3744('0x2c')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0xd6ffce[_0x3744('0x2e')]=_['keys'](_0x69981e[_0x3744('0x2e')]);_0xd6ffce[_0x3744('0x2f')]=_[_0x3744('0x31')](_0xd6ffce['model'],_0xd6ffce[_0x3744('0x2e')]);_0x251c08[_0x3744('0x30')]=_[_0x3744('0x31')](_0xd6ffce[_0x3744('0x2c')],qs['fields'](_0x69981e[_0x3744('0x2e')][_0x3744('0x32')]));_0x251c08['attributes']=_0x251c08[_0x3744('0x30')]['length']?_0x251c08['attributes']:_0xd6ffce[_0x3744('0x2c')];_0x251c08[_0x3744('0x35')]=qs[_0x3744('0x36')](_0x69981e[_0x3744('0x2e')][_0x3744('0x36')]);_0x251c08[_0x3744('0x3a')]=qs['filters'](_['pick'](_0x69981e[_0x3744('0x2e')],_0xd6ffce['filters']));if(_0x69981e[_0x3744('0x2e')][_0x3744('0x38')]){_0x251c08[_0x3744('0x3a')]=_[_0x3744('0x39')](_0x251c08[_0x3744('0x3a')],{'$or':_[_0x3744('0x26')](_0x251c08[_0x3744('0x30')],function(_0x35fd78){var _0x4e17d3={};_0x4e17d3[_0x35fd78]={'$like':'%'+_0x69981e[_0x3744('0x2e')][_0x3744('0x38')]+'%'};return _0x4e17d3;})});}_0x251c08=_['merge']({},_0x251c08,_0x69981e[_0x3744('0x3b')]);return _0x53aa50[_0x3744('0x47')](_0x251c08);}})[_0x3744('0x22')](function(_0xec2923){if(_0xec2923){_0x306e30=_0xec2923[_0x3744('0x33')];if(!_0x69981e[_0x3744('0x2e')][_0x3744('0x48')](_0x3744('0x34'))){_0x251c08[_0x3744('0x1b')]=qs[_0x3744('0x1b')](_0x69981e[_0x3744('0x2e')][_0x3744('0x1b')]);_0x251c08[_0x3744('0x19')]=qs[_0x3744('0x19')](_0x69981e[_0x3744('0x2e')]['offset']);}return _0x53aa50[_0x3744('0x47')](_0x251c08);}})[_0x3744('0x22')](function(_0x1c5ce2){if(_0x1c5ce2){return _0x1c5ce2?{'count':_0x306e30,'rows':_0x1c5ce2}:null;}})[_0x3744('0x22')](respondWithResult(_0x317dd4,null))['catch'](handleError(_0x317dd4,null));};exports['addConfiguration']=function(_0x5d43f8,_0x158032,_0xccebb6){if(_0x5d43f8['body']['id']){delete _0x5d43f8['body']['id'];}return db['FreshsalesAccount'][_0x3744('0x49')]({'where':{'id':_0x5d43f8[_0x3744('0x46')]['id']}})[_0x3744('0x22')](handleEntityNotFound(_0x158032,null))[_0x3744('0x22')](function(_0x1d6e3f){if(_0x1d6e3f){_0x5d43f8[_0x3744('0x44')]['AccountId']=_0x1d6e3f['id'];_0x5d43f8[_0x3744('0x44')][_0x3744('0x4a')]=integrations[_0x3744('0x4b')](_0x5d43f8[_0x3744('0x44')][_0x3744('0x4c')],_0x5d43f8['body']['type']);_0x5d43f8['body']['Descriptions']=integrations[_0x3744('0x4d')](_0x5d43f8[_0x3744('0x44')][_0x3744('0x4c')],_0x5d43f8[_0x3744('0x44')]['type']);return db[_0x3744('0x4e')]['create'](_0x5d43f8[_0x3744('0x44')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x3744('0x4f')}]});}return null;})['then'](respondWithResult(_0x158032,null))[_0x3744('0x40')](handleError(_0x158032,null));};exports[_0x3744('0x50')]=function(_0x35d424,_0x2670ef,_0x2b7485){var _0x3f710e='';var _0x225b76='';return db[_0x3744('0x27')][_0x3744('0x49')]({'where':{'id':_0x35d424[_0x3744('0x46')]['id']},'attributes':['id',_0x3744('0x51'),_0x3744('0x52'),_0x3744('0x53')]})[_0x3744('0x22')](handleEntityNotFound(_0x2670ef,null))[_0x3744('0x22')](function(_0x160e8b){if(_0x160e8b){_0x225b76=_0x160e8b[_0x3744('0x51')];_0x3f710e=_0x160e8b[_0x3744('0x52')];var _0x2b3a43=_0x160e8b[_0x3744('0x52')][_0x3744('0x54')](-0x1);if(_0x2b3a43==='/'){_0x3f710e=_0x3f710e[_0x3744('0x55')](0x0,_0x3f710e['lastIndexOf'](_0x2b3a43));}return rp({'method':_0x3744('0x56'),'uri':util[_0x3744('0x57')](_0x3744('0x58'),_0x3f710e,_0x3744('0x59')),'headers':{'Authorization':_0x3744('0x5a')+_0x160e8b[_0x3744('0x53')]},'json':!![]});}})[_0x3744('0x22')](function(_0x28b59c){if(_0x28b59c){var _0x387f61=_0x28b59c[_0x3744('0x5b')];var _0x2e597e=![];var _0x4324e1=null;for(_0x4324e1=0x0;_0x4324e1<_0x387f61[_0x3744('0x33')];_0x4324e1++){if(_0x387f61[_0x4324e1][_0x3744('0x5c')]===_0x225b76){_0x2e597e=!![];}}if(_0x2e597e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3744('0x5d')});}}})[_0x3744('0x22')](respondWithResult(_0x2670ef,null))[_0x3744('0x40')](function(_0x5da7d1){var _0x4f1397=_0x35d424[_0x3744('0x2e')][_0x3744('0x5e')]?0x1f4:_0x5da7d1['statusCode']||0x1f4;logger[_0x3744('0x23')](_0x3744('0x5f'),'getFields',_0x4f1397,JSON[_0x3744('0x60')](_0x5da7d1));delete _0x5da7d1[_0x3744('0x2d')];if(_0x4f1397===0x191){_0x4f1397=0x190;}_0x2670ef[_0x3744('0x16')](_0x4f1397)[_0x3744('0x61')](_0x35d424[_0x3744('0x2e')]['test']?{'message':_0x3744('0x62'),'statusCode':_0x5da7d1[_0x3744('0x63')]}:_0x5da7d1);});}; \ No newline at end of file +var _0xb2b6=['name','send','index','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','FreshsalesAccount','rawAttributes','create','body','find','params','getConfigurations','order','map','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0xb2b6,0x1bb));var _0x6b2b=function(_0x5231be,_0x3f7817){_0x5231be=_0x5231be-0x0;var _0x37d152=_0xb2b6[_0x5231be];return _0x37d152;};'use strict';var emlformat=require(_0x6b2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b2b('0x1'));var jsonpatch=require(_0x6b2b('0x2'));var rp=require('request-promise');var moment=require(_0x6b2b('0x3'));var BPromise=require(_0x6b2b('0x4'));var Mustache=require(_0x6b2b('0x5'));var util=require(_0x6b2b('0x6'));var path=require(_0x6b2b('0x7'));var sox=require(_0x6b2b('0x8'));var csv=require(_0x6b2b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b2b('0xa'));var _=require(_0x6b2b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6b2b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6b2b('0xd'));var Papa=require('papaparse');var Redis=require(_0x6b2b('0xe'));var authService=require(_0x6b2b('0xf'));var qs=require(_0x6b2b('0x10'));var as=require(_0x6b2b('0x11'));var hardwareService=require(_0x6b2b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6b2b('0x13'));var config=require(_0x6b2b('0x14'));var licenseUtil=require(_0x6b2b('0x15'));var db=require(_0x6b2b('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4f50fb,_0x4ba4c7){_0x4ba4c7=_0x4ba4c7||0xcc;return function(_0x4f644b){if(_0x4f644b){return _0x4f50fb['sendStatus'](_0x4ba4c7);}return _0x4f50fb[_0x6b2b('0x17')](_0x4ba4c7)[_0x6b2b('0x18')]();};}function respondWithResult(_0x5d5ad3,_0x59cbee){_0x59cbee=_0x59cbee||0xc8;return function(_0x47447b){if(_0x47447b){return _0x5d5ad3[_0x6b2b('0x17')](_0x59cbee)[_0x6b2b('0x19')](_0x47447b);}};}function respondWithFilteredResult(_0x19ee01,_0x5b9818){return function(_0x3b9043){if(_0x3b9043){var _0x2887f7=typeof _0x5b9818[_0x6b2b('0x1a')]===_0x6b2b('0x1b')&&typeof _0x5b9818[_0x6b2b('0x1c')]===_0x6b2b('0x1b');var _0x2a2da9=_0x3b9043[_0x6b2b('0x1d')];var _0x3b580e=_0x2887f7?0x0:_0x5b9818[_0x6b2b('0x1a')];var _0x4b19cf=_0x2887f7?_0x3b9043[_0x6b2b('0x1d')]:_0x5b9818[_0x6b2b('0x1a')]+_0x5b9818[_0x6b2b('0x1c')];var _0x28bcbb;if(_0x4b19cf>=_0x2a2da9){_0x4b19cf=_0x2a2da9;_0x28bcbb=0xc8;}else{_0x28bcbb=0xce;}_0x19ee01['status'](_0x28bcbb);return _0x19ee01['set']('Content-Range',_0x3b580e+'-'+_0x4b19cf+'/'+_0x2a2da9)[_0x6b2b('0x19')](_0x3b9043);}return null;};}function patchUpdates(_0x388456){return function(_0x44f706){try{jsonpatch[_0x6b2b('0x1e')](_0x44f706,_0x388456,!![]);}catch(_0x13c1e5){return BPromise[_0x6b2b('0x1f')](_0x13c1e5);}return _0x44f706['save']();};}function saveUpdates(_0xed9fa3,_0x12b016){return function(_0x3b8fcd){if(_0x3b8fcd){return _0x3b8fcd[_0x6b2b('0x20')](_0xed9fa3)[_0x6b2b('0x21')](function(_0x516cf4){return _0x516cf4;});}return null;};}function removeEntity(_0x314ac4,_0x28f7ba){return function(_0x492742){if(_0x492742){return _0x492742[_0x6b2b('0x22')]()[_0x6b2b('0x21')](function(){_0x314ac4[_0x6b2b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdbe4,_0x5321b1){return function(_0x56e21f){if(!_0x56e21f){_0x2cdbe4['sendStatus'](0x194);}return _0x56e21f;};}function handleError(_0x486ac5,_0xd9d3e2){_0xd9d3e2=_0xd9d3e2||0x1f4;return function(_0x233b60){logger[_0x6b2b('0x23')](_0x233b60[_0x6b2b('0x24')]);if(_0x233b60[_0x6b2b('0x25')]){delete _0x233b60['name'];}_0x486ac5[_0x6b2b('0x17')](_0xd9d3e2)[_0x6b2b('0x26')](_0x233b60);};}exports[_0x6b2b('0x27')]=function(_0x3470e8,_0x5cf7c0){var _0x114f15={},_0x3539a0={},_0x30a6f0={'count':0x0,'rows':[]};var _0x3d3fc6=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x2938cd){return{'name':_0x2938cd['fieldName'],'type':_0x2938cd[_0x6b2b('0x28')]['key']};});_0x3539a0['model']=_['map'](_0x3d3fc6,_0x6b2b('0x25'));_0x3539a0[_0x6b2b('0x29')]=_[_0x6b2b('0x2a')](_0x3470e8[_0x6b2b('0x29')]);_0x3539a0[_0x6b2b('0x2b')]=_[_0x6b2b('0x2c')](_0x3539a0[_0x6b2b('0x2d')],_0x3539a0[_0x6b2b('0x29')]);_0x114f15[_0x6b2b('0x2e')]=_[_0x6b2b('0x2c')](_0x3539a0[_0x6b2b('0x2d')],qs[_0x6b2b('0x2f')](_0x3470e8[_0x6b2b('0x29')][_0x6b2b('0x2f')]));_0x114f15[_0x6b2b('0x2e')]=_0x114f15[_0x6b2b('0x2e')][_0x6b2b('0x30')]?_0x114f15[_0x6b2b('0x2e')]:_0x3539a0[_0x6b2b('0x2d')];if(!_0x3470e8[_0x6b2b('0x29')][_0x6b2b('0x31')](_0x6b2b('0x32'))){_0x114f15[_0x6b2b('0x1c')]=qs['limit'](_0x3470e8['query']['limit']);_0x114f15[_0x6b2b('0x1a')]=qs['offset'](_0x3470e8['query']['offset']);}_0x114f15['order']=qs[_0x6b2b('0x33')](_0x3470e8[_0x6b2b('0x29')]['sort']);_0x114f15[_0x6b2b('0x34')]=qs['filters'](_[_0x6b2b('0x35')](_0x3470e8[_0x6b2b('0x29')],_0x3539a0[_0x6b2b('0x2b')]),_0x3d3fc6);if(_0x3470e8[_0x6b2b('0x29')][_0x6b2b('0x36')]){_0x114f15['where']=_[_0x6b2b('0x37')](_0x114f15[_0x6b2b('0x34')],{'$or':_['map'](_0x3d3fc6,function(_0x271c52){if(_0x271c52['type']!==_0x6b2b('0x38')){var _0x16261c={};_0x16261c[_0x271c52[_0x6b2b('0x25')]]={'$like':'%'+_0x3470e8[_0x6b2b('0x29')][_0x6b2b('0x36')]+'%'};return _0x16261c;}})});}_0x114f15=_['merge']({},_0x114f15,_0x3470e8[_0x6b2b('0x39')]);var _0x275eaf={'where':_0x114f15['where']};return db['FreshsalesAccount'][_0x6b2b('0x1d')](_0x275eaf)[_0x6b2b('0x21')](function(_0x1b7bb0){_0x30a6f0[_0x6b2b('0x1d')]=_0x1b7bb0;if(_0x3470e8['query'][_0x6b2b('0x3a')]){_0x114f15[_0x6b2b('0x3b')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x114f15);})[_0x6b2b('0x21')](function(_0x30c5f2){_0x30a6f0[_0x6b2b('0x3c')]=_0x30c5f2;return _0x30a6f0;})[_0x6b2b('0x21')](respondWithFilteredResult(_0x5cf7c0,_0x114f15))[_0x6b2b('0x3d')](handleError(_0x5cf7c0,null));};exports['show']=function(_0x143a04,_0x4176f1){var _0x561beb={'raw':![],'where':{'id':_0x143a04['params']['id']}},_0x195beb={};_0x195beb[_0x6b2b('0x2d')]=_[_0x6b2b('0x2a')](db[_0x6b2b('0x3e')][_0x6b2b('0x3f')]);_0x195beb['query']=_['keys'](_0x143a04[_0x6b2b('0x29')]);_0x195beb[_0x6b2b('0x2b')]=_[_0x6b2b('0x2c')](_0x195beb['model'],_0x195beb[_0x6b2b('0x29')]);_0x561beb[_0x6b2b('0x2e')]=_['intersection'](_0x195beb[_0x6b2b('0x2d')],qs[_0x6b2b('0x2f')](_0x143a04[_0x6b2b('0x29')][_0x6b2b('0x2f')]));_0x561beb[_0x6b2b('0x2e')]=_0x561beb[_0x6b2b('0x2e')][_0x6b2b('0x30')]?_0x561beb[_0x6b2b('0x2e')]:_0x195beb[_0x6b2b('0x2d')];if(_0x143a04[_0x6b2b('0x29')][_0x6b2b('0x3a')]){_0x561beb[_0x6b2b('0x3b')]=[{'all':!![]}];}_0x561beb=_[_0x6b2b('0x37')]({},_0x561beb,_0x143a04['options']);return db[_0x6b2b('0x3e')]['find'](_0x561beb)['then'](handleEntityNotFound(_0x4176f1,null))[_0x6b2b('0x21')](respondWithResult(_0x4176f1,null))['catch'](handleError(_0x4176f1,null));};exports['create']=function(_0x5a6056,_0x33eb18){return db[_0x6b2b('0x3e')][_0x6b2b('0x40')](_0x5a6056['body'],{})['then'](respondWithResult(_0x33eb18,0xc9))['catch'](handleError(_0x33eb18,null));};exports[_0x6b2b('0x20')]=function(_0x51daef,_0x1e9a04){if(_0x51daef[_0x6b2b('0x41')]['id']){delete _0x51daef[_0x6b2b('0x41')]['id'];}return db[_0x6b2b('0x3e')][_0x6b2b('0x42')]({'where':{'id':_0x51daef[_0x6b2b('0x43')]['id']}})[_0x6b2b('0x21')](handleEntityNotFound(_0x1e9a04,null))[_0x6b2b('0x21')](saveUpdates(_0x51daef[_0x6b2b('0x41')],null))[_0x6b2b('0x21')](respondWithResult(_0x1e9a04,null))[_0x6b2b('0x3d')](handleError(_0x1e9a04,null));};exports[_0x6b2b('0x22')]=function(_0x1fe823,_0x2ae27e){return db[_0x6b2b('0x3e')][_0x6b2b('0x42')]({'where':{'id':_0x1fe823[_0x6b2b('0x43')]['id']}})[_0x6b2b('0x21')](handleEntityNotFound(_0x2ae27e,null))['then'](removeEntity(_0x2ae27e,null))[_0x6b2b('0x3d')](handleError(_0x2ae27e,null));};exports[_0x6b2b('0x44')]=function(_0x4899b5,_0x39a891,_0xf18b6d){var _0x59d493={};var _0x4199ed={};var _0x12c090;var _0x2da9c7;return db[_0x6b2b('0x3e')]['findOne']({'where':{'id':_0x4899b5[_0x6b2b('0x43')]['id']}})[_0x6b2b('0x21')](handleEntityNotFound(_0x39a891,null))[_0x6b2b('0x21')](function(_0x61e156){if(_0x61e156){_0x12c090=_0x61e156;_0x4199ed['model']=_['keys'](db['FreshsalesConfiguration'][_0x6b2b('0x3f')]);_0x4199ed[_0x6b2b('0x29')]=_[_0x6b2b('0x2a')](_0x4899b5[_0x6b2b('0x29')]);_0x4199ed[_0x6b2b('0x2b')]=_[_0x6b2b('0x2c')](_0x4199ed[_0x6b2b('0x2d')],_0x4199ed['query']);_0x59d493[_0x6b2b('0x2e')]=_[_0x6b2b('0x2c')](_0x4199ed[_0x6b2b('0x2d')],qs[_0x6b2b('0x2f')](_0x4899b5[_0x6b2b('0x29')][_0x6b2b('0x2f')]));_0x59d493[_0x6b2b('0x2e')]=_0x59d493['attributes'][_0x6b2b('0x30')]?_0x59d493[_0x6b2b('0x2e')]:_0x4199ed[_0x6b2b('0x2d')];_0x59d493[_0x6b2b('0x45')]=qs[_0x6b2b('0x33')](_0x4899b5[_0x6b2b('0x29')]['sort']);_0x59d493[_0x6b2b('0x34')]=qs['filters'](_[_0x6b2b('0x35')](_0x4899b5[_0x6b2b('0x29')],_0x4199ed[_0x6b2b('0x2b')]));if(_0x4899b5[_0x6b2b('0x29')][_0x6b2b('0x36')]){_0x59d493[_0x6b2b('0x34')]=_['merge'](_0x59d493['where'],{'$or':_[_0x6b2b('0x46')](_0x59d493[_0x6b2b('0x2e')],function(_0xe5fd62){var _0x3b20ac={};_0x3b20ac[_0xe5fd62]={'$like':'%'+_0x4899b5['query'][_0x6b2b('0x36')]+'%'};return _0x3b20ac;})});}_0x59d493=_['merge']({},_0x59d493,_0x4899b5[_0x6b2b('0x39')]);return _0x12c090[_0x6b2b('0x44')](_0x59d493);}})[_0x6b2b('0x21')](function(_0x1f88a4){if(_0x1f88a4){_0x2da9c7=_0x1f88a4['length'];if(!_0x4899b5['query'][_0x6b2b('0x31')](_0x6b2b('0x32'))){_0x59d493['limit']=qs['limit'](_0x4899b5[_0x6b2b('0x29')]['limit']);_0x59d493[_0x6b2b('0x1a')]=qs[_0x6b2b('0x1a')](_0x4899b5['query'][_0x6b2b('0x1a')]);}return _0x12c090[_0x6b2b('0x44')](_0x59d493);}})[_0x6b2b('0x21')](function(_0x4cffb2){if(_0x4cffb2){return _0x4cffb2?{'count':_0x2da9c7,'rows':_0x4cffb2}:null;}})[_0x6b2b('0x21')](respondWithResult(_0x39a891,null))[_0x6b2b('0x3d')](handleError(_0x39a891,null));};exports[_0x6b2b('0x47')]=function(_0x30aca2,_0x3d03a6,_0x3f1764){if(_0x30aca2[_0x6b2b('0x41')]['id']){delete _0x30aca2[_0x6b2b('0x41')]['id'];}return db['FreshsalesAccount'][_0x6b2b('0x48')]({'where':{'id':_0x30aca2[_0x6b2b('0x43')]['id']}})[_0x6b2b('0x21')](handleEntityNotFound(_0x3d03a6,null))['then'](function(_0x4a7fad){if(_0x4a7fad){_0x30aca2['body'][_0x6b2b('0x49')]=_0x4a7fad['id'];_0x30aca2['body'][_0x6b2b('0x4a')]=integrations[_0x6b2b('0x4b')](_0x30aca2[_0x6b2b('0x41')][_0x6b2b('0x4c')],_0x30aca2[_0x6b2b('0x41')][_0x6b2b('0x28')]);_0x30aca2['body']['Descriptions']=integrations[_0x6b2b('0x4d')](_0x30aca2[_0x6b2b('0x41')]['channel'],_0x30aca2[_0x6b2b('0x41')][_0x6b2b('0x28')]);return db[_0x6b2b('0x4e')]['create'](_0x30aca2[_0x6b2b('0x41')],{'include':[{'model':db['FreshsalesField'],'as':_0x6b2b('0x4a')},{'model':db[_0x6b2b('0x4f')],'as':'Descriptions'}]});}return null;})[_0x6b2b('0x21')](respondWithResult(_0x3d03a6,null))[_0x6b2b('0x3d')](handleError(_0x3d03a6,null));};exports['getFields']=function(_0x5e83c7,_0x154d45,_0x10205f){var _0x617c86='';var _0x5eb121='';return db[_0x6b2b('0x3e')][_0x6b2b('0x48')]({'where':{'id':_0x5e83c7[_0x6b2b('0x43')]['id']},'attributes':['id',_0x6b2b('0x50'),'remoteUri',_0x6b2b('0x51')]})['then'](handleEntityNotFound(_0x154d45,null))['then'](function(_0x5edf60){if(_0x5edf60){_0x5eb121=_0x5edf60[_0x6b2b('0x50')];_0x617c86=_0x5edf60[_0x6b2b('0x52')];var _0x3fb07b=_0x5edf60['remoteUri'][_0x6b2b('0x53')](-0x1);if(_0x3fb07b==='/'){_0x617c86=_0x617c86[_0x6b2b('0x54')](0x0,_0x617c86[_0x6b2b('0x55')](_0x3fb07b));}return rp({'method':_0x6b2b('0x56'),'uri':util[_0x6b2b('0x57')](_0x6b2b('0x58'),_0x617c86,_0x6b2b('0x59')),'headers':{'Authorization':_0x6b2b('0x5a')+_0x5edf60[_0x6b2b('0x51')]},'json':!![]});}})[_0x6b2b('0x21')](function(_0x1e96e0){if(_0x1e96e0){var _0x417562=_0x1e96e0['users'];var _0x4d0be6=![];var _0x4c0684=null;for(_0x4c0684=0x0;_0x4c0684<_0x417562['length'];_0x4c0684++){if(_0x417562[_0x4c0684][_0x6b2b('0x5b')]===_0x5eb121){_0x4d0be6=!![];}}if(_0x4d0be6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6b2b('0x5c')});}}})[_0x6b2b('0x21')](respondWithResult(_0x154d45,null))['catch'](function(_0x2e8347){var _0xb226e6=_0x5e83c7[_0x6b2b('0x29')][_0x6b2b('0x5d')]?0x1f4:_0x2e8347[_0x6b2b('0x5e')]||0x1f4;logger[_0x6b2b('0x23')](_0x6b2b('0x5f'),'getFields',_0xb226e6,JSON['stringify'](_0x2e8347));delete _0x2e8347[_0x6b2b('0x25')];if(_0xb226e6===0x191){_0xb226e6=0x190;}_0x154d45[_0x6b2b('0x17')](_0xb226e6)[_0x6b2b('0x26')](_0x5e83c7[_0x6b2b('0x29')][_0x6b2b('0x5d')]?{'message':'Wrong\x20credentials','statusCode':_0x2e8347[_0x6b2b('0x5e')]}:_0x2e8347);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 12a86b6..a0c6772 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x32f3af,_0x3675e3){var _0x58e114=function(_0x332d68){while(--_0x332d68){_0x32f3af['push'](_0x32f3af['shift']());}};_0x58e114(++_0x3675e3);}(_0x6050,0x196));var _0x0605=function(_0x164138,_0x2abb60){_0x164138=_0x164138-0x0;var _0x2654c4=_0x6050[_0x164138];return _0x2654c4;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x1479a6,_0x2007ac){var _0x2eee67=function(_0x21c955){while(--_0x21c955){_0x1479a6['push'](_0x1479a6['shift']());}};_0x2eee67(++_0x2007ac);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 41c4ddb..545cc73 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd117=['message','request\x20sent','catch','FreshsalesAccount','options','raw','where','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','code','error'];(function(_0x1a329c,_0x42b32e){var _0x4cf66d=function(_0x5567d1){while(--_0x5567d1){_0x1a329c['push'](_0x1a329c['shift']());}};_0x4cf66d(++_0x42b32e);}(_0xd117,0x182));var _0x7d11=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xd117[_0xdd2bfa];return _0x55397e;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});}exports['GetFreshsalesAccount']=function(_0x456cb9){var _0x49a34b=this;return new Promise(function(_0x4d1306,_0x5459df){return db[_0x7d11('0x18')]['findAll']({'raw':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1b')]||null:null,'attributes':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1c')]||null:null,'limit':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1d')]||null:null,'include':_0x456cb9['options']?_0x456cb9['options']['include']?_[_0x7d11('0x1e')](_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1f')],function(_0x1a7853){return{'model':db[_0x1a7853[_0x7d11('0x20')]],'as':_0x1a7853['as'],'attributes':_0x1a7853[_0x7d11('0x1c')],'include':_0x1a7853[_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0x1a7853['include'],function(_0x36c2b4){return{'model':db[_0x36c2b4['model']],'as':_0x36c2b4['as'],'attributes':_0x36c2b4['attributes'],'include':_0x36c2b4['include']?_[_0x7d11('0x1e')](_0x36c2b4['include'],function(_0x180e1e){return{'model':db[_0x180e1e[_0x7d11('0x20')]],'as':_0x180e1e['as'],'attributes':_0x180e1e[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46f76a){logger[_0x7d11('0xf')](_0x7d11('0x21'),_0x456cb9);logger['debug'](_0x7d11('0x21'),_0x456cb9,JSON[_0x7d11('0x12')](_0x46f76a));_0x4d1306(_0x46f76a);})[_0x7d11('0x17')](function(_0x38f1be){logger['error'](_0x7d11('0x21'),_0x38f1be['message'],_0x456cb9);_0x5459df(_0x49a34b[_0x7d11('0x14')](0x1f4,_0x38f1be['message']));});});};exports[_0x7d11('0x22')]=function(_0xba4e80){var _0x1e32f6=this;return new Promise(function(_0x4831ed,_0x5e721f){return db[_0x7d11('0x18')][_0x7d11('0x23')]({'raw':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0xba4e80[_0x7d11('0x19')]?_0xba4e80['options'][_0x7d11('0x1b')]||null:null,'attributes':_0xba4e80['options']?_0xba4e80['options'][_0x7d11('0x1c')]||null:null,'include':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0xba4e80[_0x7d11('0x19')]['include'],function(_0x11d9e2){return{'model':db[_0x11d9e2[_0x7d11('0x20')]],'as':_0x11d9e2['as'],'attributes':_0x11d9e2['attributes'],'include':_0x11d9e2['include']?_[_0x7d11('0x1e')](_0x11d9e2[_0x7d11('0x1f')],function(_0x5b7d3a){return{'model':db[_0x5b7d3a[_0x7d11('0x20')]],'as':_0x5b7d3a['as'],'attributes':_0x5b7d3a['attributes'],'include':_0x5b7d3a['include']?_[_0x7d11('0x1e')](_0x5b7d3a['include'],function(_0x4e53be){return{'model':db[_0x4e53be[_0x7d11('0x20')]],'as':_0x4e53be['as'],'attributes':_0x4e53be[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d11('0x24')](function(_0x2e426b){logger[_0x7d11('0xf')](_0x7d11('0x22'),_0xba4e80);logger[_0x7d11('0x11')](_0x7d11('0x22'),_0xba4e80,JSON[_0x7d11('0x12')](_0x2e426b));_0x4831ed(_0x2e426b);})[_0x7d11('0x17')](function(_0x1a9f18){logger[_0x7d11('0x14')]('ShowFreshsalesAccount',_0x1a9f18[_0x7d11('0x15')],_0xba4e80);_0x5e721f(_0x1e32f6['error'](0x1f4,_0x1a9f18[_0x7d11('0x15')]));});});}; \ No newline at end of file +var _0xef0f=['FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','include','model','attributes','map','ShowFreshsalesAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d2006,_0x2d27b3){var _0x442661=function(_0x4838ea){while(--_0x4838ea){_0x2d2006['push'](_0x2d2006['shift']());}};_0x442661(++_0x2d27b3);}(_0xef0f,0x168));var _0xfef0=function(_0x379606,_0x203819){_0x379606=_0x379606-0x0;var _0x4f5f05=_0xef0f[_0x379606];return _0x4f5f05;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')]({'raw':_0x581459['options']?_0x581459[_0xfef0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')][_0xfef0('0x1c')]||null:null,'attributes':_0x581459['options']?_0x581459[_0xfef0('0x1b')]['attributes']||null:null,'limit':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')]['limit']||null:null,'include':_0x581459['options']?_0x581459['options'][_0xfef0('0x1d')]?_['map'](_0x581459[_0xfef0('0x1b')][_0xfef0('0x1d')],function(_0x1a8d66){return{'model':db[_0x1a8d66[_0xfef0('0x1e')]],'as':_0x1a8d66['as'],'attributes':_0x1a8d66[_0xfef0('0x1f')],'include':_0x1a8d66[_0xfef0('0x1d')]?_['map'](_0x1a8d66['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x1e')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1f')],'include':_0x316e20[_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x316e20[_0xfef0('0x1d')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x1e')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a6758){logger[_0xfef0('0xd')](_0xfef0('0x18'),_0x581459);logger[_0xfef0('0x10')](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x1a6758));_0x1642cd(_0x1a6758);})[_0xfef0('0x17')](function(_0x3e026a){logger[_0xfef0('0x13')](_0xfef0('0x18'),_0x3e026a[_0xfef0('0x15')],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0x3e026a['message']));});});};exports[_0xfef0('0x21')]=function(_0x5806bd){var _0x4eaf74=this;return new Promise(function(_0x7d1692,_0x2ae54a){return db['FreshsalesAccount']['find']({'raw':_0x5806bd['options']?_0x5806bd['options']['raw']===undefined?!![]:![]:!![],'where':_0x5806bd[_0xfef0('0x1b')]?_0x5806bd[_0xfef0('0x1b')][_0xfef0('0x1c')]||null:null,'attributes':_0x5806bd['options']?_0x5806bd['options']['attributes']||null:null,'include':_0x5806bd[_0xfef0('0x1b')]?_0x5806bd['options'][_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x5806bd[_0xfef0('0x1b')]['include'],function(_0x3cad13){return{'model':db[_0x3cad13['model']],'as':_0x3cad13['as'],'attributes':_0x3cad13[_0xfef0('0x1f')],'include':_0x3cad13[_0xfef0('0x1d')]?_[_0xfef0('0x20')](_0x3cad13[_0xfef0('0x1d')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x1e')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1f')],'include':_0x3e1a64[_0xfef0('0x1d')]?_['map'](_0x3e1a64[_0xfef0('0x1d')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x1e')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xc')](function(_0x262341){logger[_0xfef0('0xd')](_0xfef0('0x21'),_0x5806bd);logger[_0xfef0('0x10')](_0xfef0('0x21'),_0x5806bd,JSON[_0xfef0('0x12')](_0x262341));_0x7d1692(_0x262341);})[_0xfef0('0x17')](function(_0x366667){logger['error'](_0xfef0('0x21'),_0x366667['message'],_0x5806bd);_0x2ae54a(_0x4eaf74[_0xfef0('0x13')](0x1f4,_0x366667[_0xfef0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 12a29d7..46a4035 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbeb7=['isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xbeb7,0x138));var _0x7beb=function(_0x1f1b6a,_0xb98246){_0x1f1b6a=_0x1f1b6a-0x0;var _0x3c74bc=_0xbeb7[_0x1f1b6a];return _0x3c74bc;};'use strict';var multer=require('multer');var util=require(_0x7beb('0x0'));var path=require(_0x7beb('0x1'));var timeout=require(_0x7beb('0x2'));var express=require(_0x7beb('0x3'));var router=express[_0x7beb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7beb('0x5'));var config=require(_0x7beb('0x6'));var controller=require(_0x7beb('0x7'));router[_0x7beb('0x8')]('/',auth['isAuthenticated'](),controller[_0x7beb('0x9')]);router[_0x7beb('0x8')]('/:id',auth[_0x7beb('0xa')](),controller[_0x7beb('0xb')]);router[_0x7beb('0x8')](_0x7beb('0xc'),auth[_0x7beb('0xa')](),controller[_0x7beb('0xd')]);router[_0x7beb('0x8')](_0x7beb('0xe'),auth[_0x7beb('0xa')](),controller['getDescriptions']);router[_0x7beb('0x8')](_0x7beb('0xf'),auth[_0x7beb('0xa')](),controller[_0x7beb('0x10')]);router[_0x7beb('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7beb('0x12')](_0x7beb('0x13'),auth[_0x7beb('0xa')](),controller[_0x7beb('0x14')]);router['delete'](_0x7beb('0x13'),auth[_0x7beb('0xa')](),controller[_0x7beb('0x15')]);module[_0x7beb('0x16')]=router; \ No newline at end of file +var _0xba4a=['index','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x370e4b,_0x1eb510){var _0xafbbb5=function(_0x3ab7c4){while(--_0x3ab7c4){_0x370e4b['push'](_0x370e4b['shift']());}};_0xafbbb5(++_0x1eb510);}(_0xba4a,0x1f4));var _0xaba4=function(_0x58dc45,_0x27baa9){_0x58dc45=_0x58dc45-0x0;var _0x3a2c07=_0xba4a[_0x58dc45];return _0x3a2c07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaba4('0x0'));var timeout=require(_0xaba4('0x1'));var express=require('express');var router=express[_0xaba4('0x2')]();var fs_extra=require(_0xaba4('0x3'));var auth=require(_0xaba4('0x4'));var interaction=require(_0xaba4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaba4('0x6')]);router[_0xaba4('0x7')](_0xaba4('0x8'),auth[_0xaba4('0x9')](),controller[_0xaba4('0xa')]);router[_0xaba4('0x7')](_0xaba4('0xb'),auth[_0xaba4('0x9')](),controller[_0xaba4('0xc')]);router[_0xaba4('0x7')](_0xaba4('0xd'),auth[_0xaba4('0x9')](),controller[_0xaba4('0xe')]);router[_0xaba4('0x7')](_0xaba4('0xf'),auth[_0xaba4('0x9')](),controller[_0xaba4('0x10')]);router[_0xaba4('0x11')]('/',auth[_0xaba4('0x9')](),controller['create']);router['put'](_0xaba4('0x8'),auth[_0xaba4('0x9')](),controller[_0xaba4('0x12')]);router[_0xaba4('0x13')](_0xaba4('0x8'),auth[_0xaba4('0x9')](),controller[_0xaba4('0x14')]);module[_0xaba4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index af6b083..4eaa7de 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ac5=['exports','sequelize'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0x5ac5,0x157));var _0x55ac=function(_0x59e8c6,_0x847c24){_0x59e8c6=_0x59e8c6-0x0;var _0x4e6c5b=_0x5ac5[_0x59e8c6];return _0x4e6c5b;};'use strict';var Sequelize=require(_0x55ac('0x0'));module[_0x55ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1564=['STRING','sequelize','exports'];(function(_0x322919,_0x2ea14c){var _0x1ccdb7=function(_0x38c4e4){while(--_0x38c4e4){_0x322919['push'](_0x322919['shift']());}};_0x1ccdb7(++_0x2ea14c);}(_0x1564,0xac));var _0x4156=function(_0x4ac24c,_0x2791b9){_0x4ac24c=_0x4ac24c-0x0;var _0x3961b0=_0x1564[_0x4ac24c];return _0x3961b0;};'use strict';var Sequelize=require(_0x4156('0x0'));module[_0x4156('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4156('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0160504..0fb3932 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda4d=['fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','getSubjects','findOne','FreshsalesField','options','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x54597a,_0x4ea42f){var _0x5a764f=function(_0x5c000b){while(--_0x5c000b){_0x54597a['push'](_0x54597a['shift']());}};_0x5a764f(++_0x4ea42f);}(_0xda4d,0x194));var _0xdda4=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xda4d[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xdda4('0x0'));var rimraf=require(_0xdda4('0x1'));var zipdir=require(_0xdda4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdda4('0x3'));var moment=require('moment');var BPromise=require(_0xdda4('0x4'));var Mustache=require(_0xdda4('0x5'));var util=require(_0xdda4('0x6'));var path=require(_0xdda4('0x7'));var sox=require(_0xdda4('0x8'));var csv=require(_0xdda4('0x9'));var ejs=require(_0xdda4('0xa'));var fs=require('fs');var fs_extra=require(_0xdda4('0xb'));var _=require(_0xdda4('0xc'));var squel=require(_0xdda4('0xd'));var crypto=require(_0xdda4('0xe'));var jsforce=require(_0xdda4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdda4('0x9'));var querystring=require('querystring');var Papa=require(_0xdda4('0x10'));var Redis=require(_0xdda4('0x11'));var authService=require(_0xdda4('0x12'));var qs=require(_0xdda4('0x13'));var as=require(_0xdda4('0x14'));var hardwareService=require(_0xdda4('0x15'));var logger=require(_0xdda4('0x16'))('api');var utils=require(_0xdda4('0x17'));var config=require(_0xdda4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdda4('0x19'))['db'];function respondWithStatusCode(_0x288d47,_0x5dbdf0){_0x5dbdf0=_0x5dbdf0||0xcc;return function(_0x35daa1){if(_0x35daa1){return _0x288d47[_0xdda4('0x1a')](_0x5dbdf0);}return _0x288d47['status'](_0x5dbdf0)[_0xdda4('0x1b')]();};}function respondWithResult(_0x5068b5,_0x1de049){_0x1de049=_0x1de049||0xc8;return function(_0x5d6994){if(_0x5d6994){return _0x5068b5[_0xdda4('0x1c')](_0x1de049)[_0xdda4('0x1d')](_0x5d6994);}};}function respondWithFilteredResult(_0x1c2acb,_0x474ae4){return function(_0x27b6a9){if(_0x27b6a9){var _0x2f4189=typeof _0x474ae4['offset']===_0xdda4('0x1e')&&typeof _0x474ae4[_0xdda4('0x1f')]===_0xdda4('0x1e');var _0x3a62e9=_0x27b6a9['count'];var _0x5e5d30=_0x2f4189?0x0:_0x474ae4[_0xdda4('0x20')];var _0x7d30fd=_0x2f4189?_0x27b6a9['count']:_0x474ae4[_0xdda4('0x20')]+_0x474ae4[_0xdda4('0x1f')];var _0x549bb9;if(_0x7d30fd>=_0x3a62e9){_0x7d30fd=_0x3a62e9;_0x549bb9=0xc8;}else{_0x549bb9=0xce;}_0x1c2acb[_0xdda4('0x1c')](_0x549bb9);return _0x1c2acb['set'](_0xdda4('0x21'),_0x5e5d30+'-'+_0x7d30fd+'/'+_0x3a62e9)['json'](_0x27b6a9);}return null;};}function patchUpdates(_0x3033e1){return function(_0x1743fc){try{jsonpatch[_0xdda4('0x22')](_0x1743fc,_0x3033e1,!![]);}catch(_0x347a11){return BPromise[_0xdda4('0x23')](_0x347a11);}return _0x1743fc[_0xdda4('0x24')]();};}function saveUpdates(_0x441ebd,_0x44b5a6){return function(_0x4b9acf){if(_0x4b9acf){return _0x4b9acf[_0xdda4('0x25')](_0x441ebd)[_0xdda4('0x26')](function(_0x515099){return _0x515099;});}return null;};}function removeEntity(_0x24391d,_0x2a03b1){return function(_0x414298){if(_0x414298){return _0x414298['destroy']()[_0xdda4('0x26')](function(){_0x24391d[_0xdda4('0x1c')](0xcc)[_0xdda4('0x1b')]();});}};}function handleEntityNotFound(_0x39ad88,_0x1649f8){return function(_0x1277ff){if(!_0x1277ff){_0x39ad88[_0xdda4('0x1a')](0x194);}return _0x1277ff;};}function handleError(_0x2b3b06,_0x134afa){_0x134afa=_0x134afa||0x1f4;return function(_0x3bf240){logger[_0xdda4('0x27')](_0x3bf240['stack']);if(_0x3bf240[_0xdda4('0x28')]){delete _0x3bf240[_0xdda4('0x28')];}_0x2b3b06['status'](_0x134afa)[_0xdda4('0x29')](_0x3bf240);};}exports[_0xdda4('0x2a')]=function(_0x7ef469,_0x1aad66){var _0x4c90d7={},_0x5badc0={},_0x105691={'count':0x0,'rows':[]};var _0x3bcee8=_[_0xdda4('0x2b')](db[_0xdda4('0x2c')][_0xdda4('0x2d')],function(_0x93359d){return{'name':_0x93359d['fieldName'],'type':_0x93359d[_0xdda4('0x2e')][_0xdda4('0x2f')]};});_0x5badc0[_0xdda4('0x30')]=_[_0xdda4('0x2b')](_0x3bcee8,_0xdda4('0x28'));_0x5badc0[_0xdda4('0x31')]=_[_0xdda4('0x32')](_0x7ef469[_0xdda4('0x31')]);_0x5badc0[_0xdda4('0x33')]=_[_0xdda4('0x34')](_0x5badc0[_0xdda4('0x30')],_0x5badc0[_0xdda4('0x31')]);_0x4c90d7[_0xdda4('0x35')]=_[_0xdda4('0x34')](_0x5badc0[_0xdda4('0x30')],qs[_0xdda4('0x36')](_0x7ef469['query']['fields']));_0x4c90d7['attributes']=_0x4c90d7[_0xdda4('0x35')][_0xdda4('0x37')]?_0x4c90d7[_0xdda4('0x35')]:_0x5badc0[_0xdda4('0x30')];if(!_0x7ef469[_0xdda4('0x31')][_0xdda4('0x38')](_0xdda4('0x39'))){_0x4c90d7[_0xdda4('0x1f')]=qs[_0xdda4('0x1f')](_0x7ef469['query'][_0xdda4('0x1f')]);_0x4c90d7[_0xdda4('0x20')]=qs[_0xdda4('0x20')](_0x7ef469[_0xdda4('0x31')][_0xdda4('0x20')]);}_0x4c90d7[_0xdda4('0x3a')]=qs['sort'](_0x7ef469[_0xdda4('0x31')][_0xdda4('0x3b')]);_0x4c90d7[_0xdda4('0x3c')]=qs[_0xdda4('0x33')](_[_0xdda4('0x3d')](_0x7ef469[_0xdda4('0x31')],_0x5badc0[_0xdda4('0x33')]),_0x3bcee8);if(_0x7ef469[_0xdda4('0x31')][_0xdda4('0x3e')]){_0x4c90d7['where']=_[_0xdda4('0x3f')](_0x4c90d7[_0xdda4('0x3c')],{'$or':_['map'](_0x3bcee8,function(_0x4a3922){if(_0x4a3922[_0xdda4('0x2e')]!==_0xdda4('0x40')){var _0x4b7ab7={};_0x4b7ab7[_0x4a3922[_0xdda4('0x28')]]={'$like':'%'+_0x7ef469[_0xdda4('0x31')]['filter']+'%'};return _0x4b7ab7;}})});}_0x4c90d7=_[_0xdda4('0x3f')]({},_0x4c90d7,_0x7ef469['options']);var _0x24602c={'where':_0x4c90d7[_0xdda4('0x3c')]};return db[_0xdda4('0x2c')][_0xdda4('0x41')](_0x24602c)[_0xdda4('0x26')](function(_0x1be3b5){_0x105691['count']=_0x1be3b5;if(_0x7ef469[_0xdda4('0x31')][_0xdda4('0x42')]){_0x4c90d7[_0xdda4('0x43')]=[{'all':!![]}];}return db[_0xdda4('0x2c')][_0xdda4('0x44')](_0x4c90d7);})[_0xdda4('0x26')](function(_0x4feac8){_0x105691[_0xdda4('0x45')]=_0x4feac8;return _0x105691;})[_0xdda4('0x26')](respondWithFilteredResult(_0x1aad66,_0x4c90d7))[_0xdda4('0x46')](handleError(_0x1aad66,null));};exports[_0xdda4('0x47')]=function(_0x16e47b,_0x2935cf){var _0x1d2226={'raw':![],'where':{'id':_0x16e47b['params']['id']}},_0xbf3af4={};_0xbf3af4[_0xdda4('0x30')]=_[_0xdda4('0x32')](db[_0xdda4('0x2c')][_0xdda4('0x2d')]);_0xbf3af4['query']=_[_0xdda4('0x32')](_0x16e47b[_0xdda4('0x31')]);_0xbf3af4[_0xdda4('0x33')]=_[_0xdda4('0x34')](_0xbf3af4['model'],_0xbf3af4[_0xdda4('0x31')]);_0x1d2226[_0xdda4('0x35')]=_[_0xdda4('0x34')](_0xbf3af4[_0xdda4('0x30')],qs[_0xdda4('0x36')](_0x16e47b[_0xdda4('0x31')][_0xdda4('0x36')]));_0x1d2226[_0xdda4('0x35')]=_0x1d2226[_0xdda4('0x35')][_0xdda4('0x37')]?_0x1d2226[_0xdda4('0x35')]:_0xbf3af4[_0xdda4('0x30')];if(_0x16e47b[_0xdda4('0x31')][_0xdda4('0x42')]){_0x1d2226[_0xdda4('0x43')]=[{'all':!![]}];}_0x1d2226=_['merge']({},_0x1d2226,_0x16e47b['options']);return db[_0xdda4('0x2c')][_0xdda4('0x48')](_0x1d2226)[_0xdda4('0x26')](handleEntityNotFound(_0x2935cf,null))['then'](respondWithResult(_0x2935cf,null))[_0xdda4('0x46')](handleError(_0x2935cf,null));};exports[_0xdda4('0x49')]=function(_0x5f5509,_0xc0464d){return db[_0xdda4('0x2c')]['create'](_0x5f5509[_0xdda4('0x4a')],{})[_0xdda4('0x26')](respondWithResult(_0xc0464d,0xc9))[_0xdda4('0x46')](handleError(_0xc0464d,null));};exports['update']=function(_0x1b32df,_0xb58d61){if(_0x1b32df[_0xdda4('0x4a')]['id']){delete _0x1b32df['body']['id'];}return db[_0xdda4('0x2c')][_0xdda4('0x48')]({'where':{'id':_0x1b32df[_0xdda4('0x4b')]['id']}})[_0xdda4('0x26')](handleEntityNotFound(_0xb58d61,null))[_0xdda4('0x26')](saveUpdates(_0x1b32df[_0xdda4('0x4a')],null))[_0xdda4('0x26')](respondWithResult(_0xb58d61,null))[_0xdda4('0x46')](handleError(_0xb58d61,null));};exports[_0xdda4('0x4c')]=function(_0x52c0ad,_0x576cc2){return db[_0xdda4('0x2c')]['find']({'where':{'id':_0x52c0ad[_0xdda4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x576cc2,null))[_0xdda4('0x26')](removeEntity(_0x576cc2,null))[_0xdda4('0x46')](handleError(_0x576cc2,null));};exports[_0xdda4('0x4d')]=function(_0x5a87b7,_0x2c5bb0,_0x276e1b){var _0xce32e1={};var _0x4da460={};var _0x4f900f;var _0x2ec26a;return db['FreshsalesConfiguration'][_0xdda4('0x4e')]({'where':{'id':_0x5a87b7[_0xdda4('0x4b')]['id']}})[_0xdda4('0x26')](handleEntityNotFound(_0x2c5bb0,null))['then'](function(_0x1f72d6){if(_0x1f72d6){_0x4f900f=_0x1f72d6;_0x4da460[_0xdda4('0x30')]=_[_0xdda4('0x32')](db[_0xdda4('0x4f')][_0xdda4('0x2d')]);_0x4da460[_0xdda4('0x31')]=_[_0xdda4('0x32')](_0x5a87b7[_0xdda4('0x31')]);_0x4da460[_0xdda4('0x33')]=_['intersection'](_0x4da460[_0xdda4('0x30')],_0x4da460['query']);_0xce32e1['attributes']=_[_0xdda4('0x34')](_0x4da460[_0xdda4('0x30')],qs['fields'](_0x5a87b7[_0xdda4('0x31')][_0xdda4('0x36')]));_0xce32e1[_0xdda4('0x35')]=_0xce32e1[_0xdda4('0x35')][_0xdda4('0x37')]?_0xce32e1[_0xdda4('0x35')]:_0x4da460[_0xdda4('0x30')];_0xce32e1[_0xdda4('0x3a')]=qs[_0xdda4('0x3b')](_0x5a87b7[_0xdda4('0x31')][_0xdda4('0x3b')]);_0xce32e1[_0xdda4('0x3c')]=qs[_0xdda4('0x33')](_[_0xdda4('0x3d')](_0x5a87b7['query'],_0x4da460[_0xdda4('0x33')]));if(_0x5a87b7[_0xdda4('0x31')][_0xdda4('0x3e')]){_0xce32e1[_0xdda4('0x3c')]=_['merge'](_0xce32e1['where'],{'$or':_[_0xdda4('0x2b')](_0xce32e1['attributes'],function(_0x1e288d){var _0x3b5cb9={};_0x3b5cb9[_0x1e288d]={'$like':'%'+_0x5a87b7[_0xdda4('0x31')]['filter']+'%'};return _0x3b5cb9;})});}_0xce32e1=_[_0xdda4('0x3f')]({},_0xce32e1,_0x5a87b7[_0xdda4('0x50')]);return _0x4f900f[_0xdda4('0x4d')](_0xce32e1);}})[_0xdda4('0x26')](function(_0x302b25){if(_0x302b25){_0x2ec26a=_0x302b25[_0xdda4('0x37')];if(!_0x5a87b7['query'][_0xdda4('0x38')](_0xdda4('0x39'))){_0xce32e1[_0xdda4('0x1f')]=qs['limit'](_0x5a87b7[_0xdda4('0x31')][_0xdda4('0x1f')]);_0xce32e1[_0xdda4('0x20')]=qs[_0xdda4('0x20')](_0x5a87b7[_0xdda4('0x31')]['offset']);}return _0x4f900f[_0xdda4('0x4d')](_0xce32e1);}})[_0xdda4('0x26')](function(_0x291c33){if(_0x291c33){return _0x291c33?{'count':_0x2ec26a,'rows':_0x291c33}:null;}})[_0xdda4('0x26')](respondWithResult(_0x2c5bb0,null))[_0xdda4('0x46')](handleError(_0x2c5bb0,null));};exports[_0xdda4('0x51')]=function(_0x11f93d,_0x5af106,_0x5c8bad){var _0x76314f={};var _0x45218a={};var _0x1eda10;var _0x42540d;return db['FreshsalesConfiguration'][_0xdda4('0x4e')]({'where':{'id':_0x11f93d['params']['id']}})['then'](handleEntityNotFound(_0x5af106,null))[_0xdda4('0x26')](function(_0x3b1791){if(_0x3b1791){_0x1eda10=_0x3b1791;_0x45218a[_0xdda4('0x30')]=_[_0xdda4('0x32')](db[_0xdda4('0x4f')]['rawAttributes']);_0x45218a['query']=_['keys'](_0x11f93d[_0xdda4('0x31')]);_0x45218a['filters']=_[_0xdda4('0x34')](_0x45218a[_0xdda4('0x30')],_0x45218a[_0xdda4('0x31')]);_0x76314f[_0xdda4('0x35')]=_[_0xdda4('0x34')](_0x45218a[_0xdda4('0x30')],qs[_0xdda4('0x36')](_0x11f93d[_0xdda4('0x31')]['fields']));_0x76314f[_0xdda4('0x35')]=_0x76314f[_0xdda4('0x35')][_0xdda4('0x37')]?_0x76314f[_0xdda4('0x35')]:_0x45218a['model'];_0x76314f[_0xdda4('0x3a')]=qs[_0xdda4('0x3b')](_0x11f93d['query'][_0xdda4('0x3b')]);_0x76314f[_0xdda4('0x3c')]=qs['filters'](_[_0xdda4('0x3d')](_0x11f93d[_0xdda4('0x31')],_0x45218a['filters']));if(_0x11f93d[_0xdda4('0x31')][_0xdda4('0x3e')]){_0x76314f[_0xdda4('0x3c')]=_['merge'](_0x76314f[_0xdda4('0x3c')],{'$or':_[_0xdda4('0x2b')](_0x76314f['attributes'],function(_0x12971c){var _0x19ff14={};_0x19ff14[_0x12971c]={'$like':'%'+_0x11f93d['query'][_0xdda4('0x3e')]+'%'};return _0x19ff14;})});}_0x76314f=_[_0xdda4('0x3f')]({},_0x76314f,_0x11f93d[_0xdda4('0x50')]);return _0x1eda10[_0xdda4('0x51')](_0x76314f);}})[_0xdda4('0x26')](function(_0x10b5f6){if(_0x10b5f6){_0x42540d=_0x10b5f6[_0xdda4('0x37')];if(!_0x11f93d['query']['hasOwnProperty'](_0xdda4('0x39'))){_0x76314f[_0xdda4('0x1f')]=qs[_0xdda4('0x1f')](_0x11f93d[_0xdda4('0x31')]['limit']);_0x76314f[_0xdda4('0x20')]=qs[_0xdda4('0x20')](_0x11f93d[_0xdda4('0x31')]['offset']);}return _0x1eda10[_0xdda4('0x51')](_0x76314f);}})['then'](function(_0x3d65d5){if(_0x3d65d5){return _0x3d65d5?{'count':_0x42540d,'rows':_0x3d65d5}:null;}})[_0xdda4('0x26')](respondWithResult(_0x5af106,null))[_0xdda4('0x46')](handleError(_0x5af106,null));};exports['getFields']=function(_0x407824,_0x59936a,_0x3e15e8){var _0x1efa29={};var _0x3de8ab={};var _0x47fe45;var _0x2081d6;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x407824[_0xdda4('0x4b')]['id']}})[_0xdda4('0x26')](handleEntityNotFound(_0x59936a,null))['then'](function(_0x51c8df){if(_0x51c8df){_0x47fe45=_0x51c8df;_0x3de8ab[_0xdda4('0x30')]=_[_0xdda4('0x32')](db[_0xdda4('0x4f')][_0xdda4('0x2d')]);_0x3de8ab[_0xdda4('0x31')]=_[_0xdda4('0x32')](_0x407824['query']);_0x3de8ab[_0xdda4('0x33')]=_[_0xdda4('0x34')](_0x3de8ab['model'],_0x3de8ab[_0xdda4('0x31')]);_0x1efa29['attributes']=_[_0xdda4('0x34')](_0x3de8ab[_0xdda4('0x30')],qs[_0xdda4('0x36')](_0x407824[_0xdda4('0x31')]['fields']));_0x1efa29[_0xdda4('0x35')]=_0x1efa29[_0xdda4('0x35')]['length']?_0x1efa29[_0xdda4('0x35')]:_0x3de8ab[_0xdda4('0x30')];_0x1efa29[_0xdda4('0x3a')]=qs[_0xdda4('0x3b')](_0x407824[_0xdda4('0x31')]['sort']);_0x1efa29[_0xdda4('0x3c')]=qs[_0xdda4('0x33')](_[_0xdda4('0x3d')](_0x407824[_0xdda4('0x31')],_0x3de8ab[_0xdda4('0x33')]));if(_0x407824[_0xdda4('0x31')][_0xdda4('0x3e')]){_0x1efa29[_0xdda4('0x3c')]=_[_0xdda4('0x3f')](_0x1efa29['where'],{'$or':_['map'](_0x1efa29[_0xdda4('0x35')],function(_0x1b54a4){var _0x558920={};_0x558920[_0x1b54a4]={'$like':'%'+_0x407824[_0xdda4('0x31')][_0xdda4('0x3e')]+'%'};return _0x558920;})});}_0x1efa29=_[_0xdda4('0x3f')]({},_0x1efa29,_0x407824[_0xdda4('0x50')]);return _0x47fe45[_0xdda4('0x52')](_0x1efa29);}})[_0xdda4('0x26')](function(_0x1130c8){if(_0x1130c8){_0x2081d6=_0x1130c8[_0xdda4('0x37')];if(!_0x407824[_0xdda4('0x31')][_0xdda4('0x38')](_0xdda4('0x39'))){_0x1efa29[_0xdda4('0x1f')]=qs[_0xdda4('0x1f')](_0x407824[_0xdda4('0x31')][_0xdda4('0x1f')]);_0x1efa29[_0xdda4('0x20')]=qs[_0xdda4('0x20')](_0x407824[_0xdda4('0x31')]['offset']);}return _0x47fe45[_0xdda4('0x52')](_0x1efa29);}})[_0xdda4('0x26')](function(_0xd49192){if(_0xd49192){return _0xd49192?{'count':_0x2081d6,'rows':_0xd49192}:null;}})[_0xdda4('0x26')](respondWithResult(_0x59936a,null))[_0xdda4('0x46')](handleError(_0x59936a,null));}; \ No newline at end of file +var _0x136a=['length','model','nolimit','order','sort','where','merge','filter','options','include','catch','show','includeAll','find','create','body','destroy','params','getSubjects','findOne','pick','hasOwnProperty','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','fields'];(function(_0x287d72,_0x40756b){var _0x5353d0=function(_0x3b52a6){while(--_0x3b52a6){_0x287d72['push'](_0x287d72['shift']());}};_0x5353d0(++_0x40756b);}(_0x136a,0xb1));var _0xa136=function(_0x396c8f,_0x3ecf4c){_0x396c8f=_0x396c8f-0x0;var _0x8a1360=_0x136a[_0x396c8f];return _0x8a1360;};'use strict';var emlformat=require(_0xa136('0x0'));var rimraf=require(_0xa136('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa136('0x2'));var rp=require(_0xa136('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa136('0x4'));var util=require(_0xa136('0x5'));var path=require(_0xa136('0x6'));var sox=require(_0xa136('0x7'));var csv=require(_0xa136('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa136('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa136('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa136('0xb'));var toCsv=require(_0xa136('0x8'));var querystring=require(_0xa136('0xc'));var Papa=require(_0xa136('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa136('0xe'));var hardwareService=require(_0xa136('0xf'));var logger=require(_0xa136('0x10'))(_0xa136('0x11'));var utils=require(_0xa136('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa136('0x13'));var db=require(_0xa136('0x14'))['db'];function respondWithStatusCode(_0x2f9acd,_0x3054b3){_0x3054b3=_0x3054b3||0xcc;return function(_0x405bcc){if(_0x405bcc){return _0x2f9acd[_0xa136('0x15')](_0x3054b3);}return _0x2f9acd['status'](_0x3054b3)[_0xa136('0x16')]();};}function respondWithResult(_0x2c5c06,_0x4dd84f){_0x4dd84f=_0x4dd84f||0xc8;return function(_0x5ed916){if(_0x5ed916){return _0x2c5c06[_0xa136('0x17')](_0x4dd84f)[_0xa136('0x18')](_0x5ed916);}};}function respondWithFilteredResult(_0x50bccb,_0x3d5fc5){return function(_0x479ac6){if(_0x479ac6){var _0x2ea717=typeof _0x3d5fc5[_0xa136('0x19')]===_0xa136('0x1a')&&typeof _0x3d5fc5[_0xa136('0x1b')]===_0xa136('0x1a');var _0x3e7273=_0x479ac6[_0xa136('0x1c')];var _0x19d224=_0x2ea717?0x0:_0x3d5fc5[_0xa136('0x19')];var _0x48cb94=_0x2ea717?_0x479ac6[_0xa136('0x1c')]:_0x3d5fc5[_0xa136('0x19')]+_0x3d5fc5[_0xa136('0x1b')];var _0x277f4b;if(_0x48cb94>=_0x3e7273){_0x48cb94=_0x3e7273;_0x277f4b=0xc8;}else{_0x277f4b=0xce;}_0x50bccb['status'](_0x277f4b);return _0x50bccb[_0xa136('0x1d')](_0xa136('0x1e'),_0x19d224+'-'+_0x48cb94+'/'+_0x3e7273)[_0xa136('0x18')](_0x479ac6);}return null;};}function patchUpdates(_0x3d84c2){return function(_0x5e9c6f){try{jsonpatch[_0xa136('0x1f')](_0x5e9c6f,_0x3d84c2,!![]);}catch(_0x541368){return BPromise['reject'](_0x541368);}return _0x5e9c6f[_0xa136('0x20')]();};}function saveUpdates(_0x16fb70,_0x1f183c){return function(_0x4344f8){if(_0x4344f8){return _0x4344f8[_0xa136('0x21')](_0x16fb70)[_0xa136('0x22')](function(_0x208918){return _0x208918;});}return null;};}function removeEntity(_0x49a978,_0x22653b){return function(_0x177302){if(_0x177302){return _0x177302['destroy']()[_0xa136('0x22')](function(){_0x49a978[_0xa136('0x17')](0xcc)[_0xa136('0x16')]();});}};}function handleEntityNotFound(_0x3700b1,_0x5d2122){return function(_0x136404){if(!_0x136404){_0x3700b1[_0xa136('0x15')](0x194);}return _0x136404;};}function handleError(_0x505e57,_0x668a40){_0x668a40=_0x668a40||0x1f4;return function(_0x987fca){logger[_0xa136('0x23')](_0x987fca[_0xa136('0x24')]);if(_0x987fca['name']){delete _0x987fca['name'];}_0x505e57[_0xa136('0x17')](_0x668a40)[_0xa136('0x25')](_0x987fca);};}exports['index']=function(_0x241ccd,_0x243bce){var _0x6f143={},_0x3403a0={},_0x186be4={'count':0x0,'rows':[]};var _0x59f26a=_[_0xa136('0x26')](db[_0xa136('0x27')][_0xa136('0x28')],function(_0x4206de){return{'name':_0x4206de[_0xa136('0x29')],'type':_0x4206de[_0xa136('0x2a')][_0xa136('0x2b')]};});_0x3403a0['model']=_['map'](_0x59f26a,_0xa136('0x2c'));_0x3403a0[_0xa136('0x2d')]=_[_0xa136('0x2e')](_0x241ccd[_0xa136('0x2d')]);_0x3403a0[_0xa136('0x2f')]=_[_0xa136('0x30')](_0x3403a0['model'],_0x3403a0[_0xa136('0x2d')]);_0x6f143[_0xa136('0x31')]=_[_0xa136('0x30')](_0x3403a0['model'],qs['fields'](_0x241ccd[_0xa136('0x2d')][_0xa136('0x32')]));_0x6f143[_0xa136('0x31')]=_0x6f143[_0xa136('0x31')][_0xa136('0x33')]?_0x6f143[_0xa136('0x31')]:_0x3403a0[_0xa136('0x34')];if(!_0x241ccd[_0xa136('0x2d')]['hasOwnProperty'](_0xa136('0x35'))){_0x6f143[_0xa136('0x1b')]=qs['limit'](_0x241ccd[_0xa136('0x2d')][_0xa136('0x1b')]);_0x6f143[_0xa136('0x19')]=qs[_0xa136('0x19')](_0x241ccd[_0xa136('0x2d')][_0xa136('0x19')]);}_0x6f143[_0xa136('0x36')]=qs[_0xa136('0x37')](_0x241ccd[_0xa136('0x2d')][_0xa136('0x37')]);_0x6f143[_0xa136('0x38')]=qs[_0xa136('0x2f')](_['pick'](_0x241ccd['query'],_0x3403a0[_0xa136('0x2f')]),_0x59f26a);if(_0x241ccd[_0xa136('0x2d')]['filter']){_0x6f143[_0xa136('0x38')]=_[_0xa136('0x39')](_0x6f143[_0xa136('0x38')],{'$or':_[_0xa136('0x26')](_0x59f26a,function(_0x25344a){if(_0x25344a[_0xa136('0x2a')]!=='VIRTUAL'){var _0x5dae47={};_0x5dae47[_0x25344a[_0xa136('0x2c')]]={'$like':'%'+_0x241ccd[_0xa136('0x2d')][_0xa136('0x3a')]+'%'};return _0x5dae47;}})});}_0x6f143=_['merge']({},_0x6f143,_0x241ccd[_0xa136('0x3b')]);var _0x17370b={'where':_0x6f143[_0xa136('0x38')]};return db[_0xa136('0x27')]['count'](_0x17370b)[_0xa136('0x22')](function(_0x57307f){_0x186be4[_0xa136('0x1c')]=_0x57307f;if(_0x241ccd[_0xa136('0x2d')]['includeAll']){_0x6f143[_0xa136('0x3c')]=[{'all':!![]}];}return db[_0xa136('0x27')]['findAll'](_0x6f143);})[_0xa136('0x22')](function(_0x2e3ed9){_0x186be4['rows']=_0x2e3ed9;return _0x186be4;})[_0xa136('0x22')](respondWithFilteredResult(_0x243bce,_0x6f143))[_0xa136('0x3d')](handleError(_0x243bce,null));};exports[_0xa136('0x3e')]=function(_0x2faec8,_0x3b1d23){var _0x291a8b={'raw':![],'where':{'id':_0x2faec8['params']['id']}},_0x1ac794={};_0x1ac794[_0xa136('0x34')]=_[_0xa136('0x2e')](db['FreshsalesConfiguration']['rawAttributes']);_0x1ac794[_0xa136('0x2d')]=_[_0xa136('0x2e')](_0x2faec8[_0xa136('0x2d')]);_0x1ac794[_0xa136('0x2f')]=_[_0xa136('0x30')](_0x1ac794[_0xa136('0x34')],_0x1ac794[_0xa136('0x2d')]);_0x291a8b[_0xa136('0x31')]=_[_0xa136('0x30')](_0x1ac794[_0xa136('0x34')],qs[_0xa136('0x32')](_0x2faec8['query'][_0xa136('0x32')]));_0x291a8b[_0xa136('0x31')]=_0x291a8b['attributes'][_0xa136('0x33')]?_0x291a8b[_0xa136('0x31')]:_0x1ac794[_0xa136('0x34')];if(_0x2faec8['query'][_0xa136('0x3f')]){_0x291a8b[_0xa136('0x3c')]=[{'all':!![]}];}_0x291a8b=_[_0xa136('0x39')]({},_0x291a8b,_0x2faec8['options']);return db[_0xa136('0x27')][_0xa136('0x40')](_0x291a8b)['then'](handleEntityNotFound(_0x3b1d23,null))['then'](respondWithResult(_0x3b1d23,null))[_0xa136('0x3d')](handleError(_0x3b1d23,null));};exports[_0xa136('0x41')]=function(_0x1628e2,_0x1ed137){return db['FreshsalesConfiguration'][_0xa136('0x41')](_0x1628e2[_0xa136('0x42')],{})[_0xa136('0x22')](respondWithResult(_0x1ed137,0xc9))['catch'](handleError(_0x1ed137,null));};exports[_0xa136('0x21')]=function(_0x62b045,_0x320041){if(_0x62b045[_0xa136('0x42')]['id']){delete _0x62b045[_0xa136('0x42')]['id'];}return db[_0xa136('0x27')][_0xa136('0x40')]({'where':{'id':_0x62b045['params']['id']}})[_0xa136('0x22')](handleEntityNotFound(_0x320041,null))[_0xa136('0x22')](saveUpdates(_0x62b045[_0xa136('0x42')],null))[_0xa136('0x22')](respondWithResult(_0x320041,null))[_0xa136('0x3d')](handleError(_0x320041,null));};exports[_0xa136('0x43')]=function(_0x24efec,_0x41bc2b){return db[_0xa136('0x27')][_0xa136('0x40')]({'where':{'id':_0x24efec[_0xa136('0x44')]['id']}})[_0xa136('0x22')](handleEntityNotFound(_0x41bc2b,null))[_0xa136('0x22')](removeEntity(_0x41bc2b,null))[_0xa136('0x3d')](handleError(_0x41bc2b,null));};exports[_0xa136('0x45')]=function(_0x189811,_0x52147c,_0x1a3955){var _0x3b7ccb={};var _0x3d6f39={};var _0x456351;var _0x37f27c;return db['FreshsalesConfiguration'][_0xa136('0x46')]({'where':{'id':_0x189811[_0xa136('0x44')]['id']}})[_0xa136('0x22')](handleEntityNotFound(_0x52147c,null))['then'](function(_0x204fd0){if(_0x204fd0){_0x456351=_0x204fd0;_0x3d6f39[_0xa136('0x34')]=_[_0xa136('0x2e')](db['FreshsalesField'][_0xa136('0x28')]);_0x3d6f39['query']=_[_0xa136('0x2e')](_0x189811[_0xa136('0x2d')]);_0x3d6f39['filters']=_[_0xa136('0x30')](_0x3d6f39[_0xa136('0x34')],_0x3d6f39[_0xa136('0x2d')]);_0x3b7ccb[_0xa136('0x31')]=_[_0xa136('0x30')](_0x3d6f39[_0xa136('0x34')],qs['fields'](_0x189811[_0xa136('0x2d')][_0xa136('0x32')]));_0x3b7ccb[_0xa136('0x31')]=_0x3b7ccb[_0xa136('0x31')][_0xa136('0x33')]?_0x3b7ccb[_0xa136('0x31')]:_0x3d6f39[_0xa136('0x34')];_0x3b7ccb[_0xa136('0x36')]=qs['sort'](_0x189811[_0xa136('0x2d')]['sort']);_0x3b7ccb['where']=qs[_0xa136('0x2f')](_[_0xa136('0x47')](_0x189811[_0xa136('0x2d')],_0x3d6f39['filters']));if(_0x189811['query'][_0xa136('0x3a')]){_0x3b7ccb[_0xa136('0x38')]=_[_0xa136('0x39')](_0x3b7ccb['where'],{'$or':_[_0xa136('0x26')](_0x3b7ccb[_0xa136('0x31')],function(_0x81953){var _0x19971b={};_0x19971b[_0x81953]={'$like':'%'+_0x189811[_0xa136('0x2d')][_0xa136('0x3a')]+'%'};return _0x19971b;})});}_0x3b7ccb=_['merge']({},_0x3b7ccb,_0x189811[_0xa136('0x3b')]);return _0x456351[_0xa136('0x45')](_0x3b7ccb);}})[_0xa136('0x22')](function(_0x1fcc5f){if(_0x1fcc5f){_0x37f27c=_0x1fcc5f[_0xa136('0x33')];if(!_0x189811[_0xa136('0x2d')][_0xa136('0x48')](_0xa136('0x35'))){_0x3b7ccb[_0xa136('0x1b')]=qs[_0xa136('0x1b')](_0x189811[_0xa136('0x2d')]['limit']);_0x3b7ccb[_0xa136('0x19')]=qs[_0xa136('0x19')](_0x189811[_0xa136('0x2d')][_0xa136('0x19')]);}return _0x456351[_0xa136('0x45')](_0x3b7ccb);}})['then'](function(_0x233623){if(_0x233623){return _0x233623?{'count':_0x37f27c,'rows':_0x233623}:null;}})['then'](respondWithResult(_0x52147c,null))[_0xa136('0x3d')](handleError(_0x52147c,null));};exports[_0xa136('0x49')]=function(_0x2226cd,_0x8b63c1,_0x313c18){var _0x1dafb4={};var _0x4797d6={};var _0x1cb98c;var _0x32141a;return db[_0xa136('0x27')][_0xa136('0x46')]({'where':{'id':_0x2226cd[_0xa136('0x44')]['id']}})[_0xa136('0x22')](handleEntityNotFound(_0x8b63c1,null))[_0xa136('0x22')](function(_0x1322c8){if(_0x1322c8){_0x1cb98c=_0x1322c8;_0x4797d6[_0xa136('0x34')]=_[_0xa136('0x2e')](db['FreshsalesField'][_0xa136('0x28')]);_0x4797d6[_0xa136('0x2d')]=_['keys'](_0x2226cd['query']);_0x4797d6[_0xa136('0x2f')]=_[_0xa136('0x30')](_0x4797d6['model'],_0x4797d6[_0xa136('0x2d')]);_0x1dafb4['attributes']=_[_0xa136('0x30')](_0x4797d6[_0xa136('0x34')],qs[_0xa136('0x32')](_0x2226cd[_0xa136('0x2d')][_0xa136('0x32')]));_0x1dafb4[_0xa136('0x31')]=_0x1dafb4['attributes']['length']?_0x1dafb4[_0xa136('0x31')]:_0x4797d6['model'];_0x1dafb4['order']=qs[_0xa136('0x37')](_0x2226cd[_0xa136('0x2d')][_0xa136('0x37')]);_0x1dafb4[_0xa136('0x38')]=qs[_0xa136('0x2f')](_[_0xa136('0x47')](_0x2226cd[_0xa136('0x2d')],_0x4797d6[_0xa136('0x2f')]));if(_0x2226cd[_0xa136('0x2d')][_0xa136('0x3a')]){_0x1dafb4[_0xa136('0x38')]=_[_0xa136('0x39')](_0x1dafb4[_0xa136('0x38')],{'$or':_[_0xa136('0x26')](_0x1dafb4['attributes'],function(_0x2988d2){var _0x359356={};_0x359356[_0x2988d2]={'$like':'%'+_0x2226cd[_0xa136('0x2d')][_0xa136('0x3a')]+'%'};return _0x359356;})});}_0x1dafb4=_[_0xa136('0x39')]({},_0x1dafb4,_0x2226cd[_0xa136('0x3b')]);return _0x1cb98c[_0xa136('0x49')](_0x1dafb4);}})[_0xa136('0x22')](function(_0x580e21){if(_0x580e21){_0x32141a=_0x580e21[_0xa136('0x33')];if(!_0x2226cd[_0xa136('0x2d')]['hasOwnProperty']('nolimit')){_0x1dafb4[_0xa136('0x1b')]=qs['limit'](_0x2226cd[_0xa136('0x2d')][_0xa136('0x1b')]);_0x1dafb4[_0xa136('0x19')]=qs[_0xa136('0x19')](_0x2226cd['query'][_0xa136('0x19')]);}return _0x1cb98c[_0xa136('0x49')](_0x1dafb4);}})[_0xa136('0x22')](function(_0x2f071d){if(_0x2f071d){return _0x2f071d?{'count':_0x32141a,'rows':_0x2f071d}:null;}})['then'](respondWithResult(_0x8b63c1,null))[_0xa136('0x3d')](handleError(_0x8b63c1,null));};exports['getFields']=function(_0x48b1de,_0xd51a2f,_0x459bef){var _0x280dad={};var _0x2ca61d={};var _0x27f0c2;var _0x23c9c3;return db[_0xa136('0x27')]['findOne']({'where':{'id':_0x48b1de[_0xa136('0x44')]['id']}})['then'](handleEntityNotFound(_0xd51a2f,null))[_0xa136('0x22')](function(_0x1d67b6){if(_0x1d67b6){_0x27f0c2=_0x1d67b6;_0x2ca61d[_0xa136('0x34')]=_[_0xa136('0x2e')](db[_0xa136('0x4a')][_0xa136('0x28')]);_0x2ca61d[_0xa136('0x2d')]=_[_0xa136('0x2e')](_0x48b1de[_0xa136('0x2d')]);_0x2ca61d[_0xa136('0x2f')]=_['intersection'](_0x2ca61d[_0xa136('0x34')],_0x2ca61d[_0xa136('0x2d')]);_0x280dad[_0xa136('0x31')]=_[_0xa136('0x30')](_0x2ca61d[_0xa136('0x34')],qs[_0xa136('0x32')](_0x48b1de[_0xa136('0x2d')][_0xa136('0x32')]));_0x280dad[_0xa136('0x31')]=_0x280dad[_0xa136('0x31')]['length']?_0x280dad[_0xa136('0x31')]:_0x2ca61d[_0xa136('0x34')];_0x280dad[_0xa136('0x36')]=qs['sort'](_0x48b1de[_0xa136('0x2d')]['sort']);_0x280dad[_0xa136('0x38')]=qs[_0xa136('0x2f')](_[_0xa136('0x47')](_0x48b1de[_0xa136('0x2d')],_0x2ca61d['filters']));if(_0x48b1de[_0xa136('0x2d')][_0xa136('0x3a')]){_0x280dad[_0xa136('0x38')]=_['merge'](_0x280dad[_0xa136('0x38')],{'$or':_[_0xa136('0x26')](_0x280dad['attributes'],function(_0x519450){var _0x57b95b={};_0x57b95b[_0x519450]={'$like':'%'+_0x48b1de[_0xa136('0x2d')][_0xa136('0x3a')]+'%'};return _0x57b95b;})});}_0x280dad=_[_0xa136('0x39')]({},_0x280dad,_0x48b1de['options']);return _0x27f0c2[_0xa136('0x4b')](_0x280dad);}})[_0xa136('0x22')](function(_0x121be9){if(_0x121be9){_0x23c9c3=_0x121be9[_0xa136('0x33')];if(!_0x48b1de[_0xa136('0x2d')][_0xa136('0x48')](_0xa136('0x35'))){_0x280dad[_0xa136('0x1b')]=qs[_0xa136('0x1b')](_0x48b1de['query'][_0xa136('0x1b')]);_0x280dad[_0xa136('0x19')]=qs[_0xa136('0x19')](_0x48b1de[_0xa136('0x2d')][_0xa136('0x19')]);}return _0x27f0c2[_0xa136('0x4b')](_0x280dad);}})[_0xa136('0x22')](function(_0x3902da){if(_0x3902da){return _0x3902da?{'count':_0x23c9c3,'rows':_0x3902da}:null;}})[_0xa136('0x22')](respondWithResult(_0xd51a2f,null))[_0xa136('0x3d')](handleError(_0xd51a2f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 67d8ff5..1963ced 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8fe=['moment','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0xb2a80d,_0x587da8){var _0x3e7a3b=function(_0x16d69c){while(--_0x16d69c){_0xb2a80d['push'](_0xb2a80d['shift']());}};_0x3e7a3b(++_0x587da8);}(_0xa8fe,0x1e0));var _0xea8f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa8fe[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xea8f('0x0'));var util=require(_0xea8f('0x1'));var logger=require(_0xea8f('0x2'))(_0xea8f('0x3'));var moment=require(_0xea8f('0x4'));var BPromise=require('bluebird');var rp=require(_0xea8f('0x5'));var fs=require('fs');var path=require(_0xea8f('0x6'));var rimraf=require('rimraf');var config=require(_0xea8f('0x7'));var attributes=require(_0xea8f('0x8'));module['exports']=function(_0x2eaf68,_0x213366){return _0x2eaf68['define'](_0xea8f('0x9'),attributes,{'tableName':_0xea8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00d0=['rimraf','../../config/environment','util','../../config/logger','api','request-promise','path'];(function(_0x2b6d05,_0x5cff60){var _0x550584=function(_0x3e68ae){while(--_0x3e68ae){_0x2b6d05['push'](_0x2b6d05['shift']());}};_0x550584(++_0x5cff60);}(_0x00d0,0x19f));var _0x000d=function(_0x48a2e6,_0x14a1e9){_0x48a2e6=_0x48a2e6-0x0;var _0x2bc896=_0x00d0[_0x48a2e6];return _0x2bc896;};'use strict';var _=require('lodash');var util=require(_0x000d('0x0'));var logger=require(_0x000d('0x1'))(_0x000d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x000d('0x3'));var fs=require('fs');var path=require(_0x000d('0x4'));var rimraf=require(_0x000d('0x5'));var config=require(_0x000d('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x312a33,_0x251d6f){return _0x312a33['define']('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index ff6c44c..89d4341 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf87=['stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xadee9c,_0x5190f4){var _0x4119b1=function(_0x22d6df){while(--_0x22d6df){_0xadee9c['push'](_0xadee9c['shift']());}};_0x4119b1(++_0x5190f4);}(_0xaf87,0xaf));var _0x7af8=function(_0x179519,_0x1c1fcc){_0x179519=_0x179519-0x0;var _0x35c431=_0xaf87[_0x179519];return _0x35c431;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7af8('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x7af8('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x7af8('0x2'));var jayson=require(_0x7af8('0x3'));var client=jayson[_0x7af8('0x4')][_0x7af8('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x208c06,_0x43006f,_0x17bbc0){return new BPromise(function(_0x4a4c97,_0x1a3df4){return client[_0x7af8('0x6')](_0x208c06,_0x17bbc0)[_0x7af8('0x7')](function(_0x58511c){logger[_0x7af8('0x8')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x43006f,_0x7af8('0x9'));logger[_0x7af8('0xa')](_0x7af8('0xb'),_0x43006f,'request\x20sent',JSON[_0x7af8('0xc')](_0x58511c));if(_0x58511c[_0x7af8('0xd')]){if(_0x58511c[_0x7af8('0xd')][_0x7af8('0xe')]===0x1f4){logger[_0x7af8('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x43006f,_0x58511c[_0x7af8('0xd')][_0x7af8('0xf')]);return _0x1a3df4(_0x58511c[_0x7af8('0xd')]['message']);}logger['error'](_0x7af8('0x10'),_0x43006f,_0x58511c[_0x7af8('0xd')]['message']);return _0x4a4c97(_0x58511c[_0x7af8('0xd')]['message']);}else{logger[_0x7af8('0x8')](_0x7af8('0x10'),_0x43006f,_0x7af8('0x9'));_0x4a4c97(_0x58511c['result']['message']);}})['catch'](function(_0x179fa1){logger['error'](_0x7af8('0x10'),_0x43006f,_0x179fa1);_0x1a3df4(_0x179fa1);});});} \ No newline at end of file +var _0x5dc6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','randomstring'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x5dc6,0x1b5));var _0x65dc=function(_0x15c0ea,_0x84cd62){_0x15c0ea=_0x15c0ea-0x0;var _0x237e7a=_0x5dc6[_0x15c0ea];return _0x237e7a;};'use strict';var _=require(_0x65dc('0x0'));var util=require('util');var moment=require(_0x65dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x65dc('0x2'));var fs=require('fs');var Redis=require(_0x65dc('0x3'));var db=require(_0x65dc('0x4'))['db'];var utils=require(_0x65dc('0x5'));var logger=require(_0x65dc('0x6'))(_0x65dc('0x7'));var config=require(_0x65dc('0x8'));var jayson=require(_0x65dc('0x9'));var client=jayson[_0x65dc('0xa')][_0x65dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a1a50,_0x719d76,_0x147e79){return new BPromise(function(_0x3784ba,_0x54f051){return client[_0x65dc('0xc')](_0x5a1a50,_0x147e79)['then'](function(_0x3e6923){logger[_0x65dc('0xd')](_0x65dc('0xe'),_0x719d76,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x719d76,_0x65dc('0xf'),JSON['stringify'](_0x3e6923));if(_0x3e6923['error']){if(_0x3e6923[_0x65dc('0x10')]['code']===0x1f4){logger[_0x65dc('0x10')](_0x65dc('0xe'),_0x719d76,_0x3e6923[_0x65dc('0x10')]['message']);return _0x54f051(_0x3e6923[_0x65dc('0x10')]['message']);}logger['error'](_0x65dc('0xe'),_0x719d76,_0x3e6923[_0x65dc('0x10')]['message']);return _0x3784ba(_0x3e6923[_0x65dc('0x10')][_0x65dc('0x11')]);}else{logger['info'](_0x65dc('0xe'),_0x719d76,'request\x20sent');_0x3784ba(_0x3e6923[_0x65dc('0x12')]['message']);}})[_0x65dc('0x13')](function(_0x32aa74){logger[_0x65dc('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x719d76,_0x32aa74);_0x54f051(_0x32aa74);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3a4fc0d..ba352aa 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7980=['./intFreshsalesField.controller','isAuthenticated','get','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x84ddae,_0x3e2b02){var _0x33b5fa=function(_0x2da667){while(--_0x2da667){_0x84ddae['push'](_0x84ddae['shift']());}};_0x33b5fa(++_0x3e2b02);}(_0x7980,0xab));var _0x0798=function(_0x53fc17,_0x4ce1c6){_0x53fc17=_0x53fc17-0x0;var _0x25c149=_0x7980[_0x53fc17];return _0x25c149;};'use strict';var multer=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var path=require(_0x0798('0x2'));var timeout=require(_0x0798('0x3'));var express=require(_0x0798('0x4'));var router=express['Router']();var fs_extra=require(_0x0798('0x5'));var auth=require(_0x0798('0x6'));var interaction=require(_0x0798('0x7'));var config=require(_0x0798('0x8'));var controller=require(_0x0798('0x9'));router['get']('/',auth[_0x0798('0xa')](),controller['index']);router[_0x0798('0xb')](_0x0798('0xc'),auth[_0x0798('0xa')](),controller['show']);router['post']('/',auth[_0x0798('0xa')](),controller[_0x0798('0xd')]);router[_0x0798('0xe')](_0x0798('0xc'),auth[_0x0798('0xa')](),controller[_0x0798('0xf')]);router[_0x0798('0x10')](_0x0798('0xc'),auth[_0x0798('0xa')](),controller[_0x0798('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3dd5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x3dd5,0x73));var _0x53dd=function(_0x18c033,_0x4afe79){_0x18c033=_0x18c033-0x0;var _0xa010=_0x3dd5[_0x18c033];return _0xa010;};'use strict';var multer=require(_0x53dd('0x0'));var util=require('util');var path=require(_0x53dd('0x1'));var timeout=require(_0x53dd('0x2'));var express=require(_0x53dd('0x3'));var router=express[_0x53dd('0x4')]();var fs_extra=require(_0x53dd('0x5'));var auth=require(_0x53dd('0x6'));var interaction=require(_0x53dd('0x7'));var config=require(_0x53dd('0x8'));var controller=require(_0x53dd('0x9'));router['get']('/',auth[_0x53dd('0xa')](),controller[_0x53dd('0xb')]);router[_0x53dd('0xc')](_0x53dd('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x53dd('0xe')]('/',auth['isAuthenticated'](),controller[_0x53dd('0xf')]);router[_0x53dd('0x10')](_0x53dd('0xd'),auth[_0x53dd('0xa')](),controller[_0x53dd('0x11')]);router['delete'](_0x53dd('0xd'),auth[_0x53dd('0xa')](),controller[_0x53dd('0x12')]);module[_0x53dd('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index b91f212..b64763b 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c4c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x8c4c,0xe8));var _0xc8c4=function(_0x45516c,_0x48ec42){_0x45516c=_0x45516c-0x0;var _0x42b30c=_0x8c4c[_0x45516c];return _0x42b30c;};'use strict';var Sequelize=require(_0xc8c4('0x0'));module[_0xc8c4('0x1')]={'type':{'type':Sequelize[_0xc8c4('0x2')](_0xc8c4('0x3'),_0xc8c4('0x4'),_0xc8c4('0x5'),_0xc8c4('0x6'),_0xc8c4('0x7')),'defaultValue':_0xc8c4('0x3')},'content':{'type':Sequelize[_0xc8c4('0x8')]},'key':{'type':Sequelize[_0xc8c4('0x8')]},'keyType':{'type':Sequelize[_0xc8c4('0x2')]('string',_0xc8c4('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc8c4('0x8')]},'nameField':{'type':Sequelize[_0xc8c4('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc8c4('0x8')]}}; \ No newline at end of file +var _0xf711=['picklist','string','STRING','customVariable','BOOLEAN','ENUM','variable'];(function(_0x26aa17,_0x218eac){var _0x3a4e19=function(_0x1424e0){while(--_0x1424e0){_0x26aa17['push'](_0x26aa17['shift']());}};_0x3a4e19(++_0x218eac);}(_0xf711,0x140));var _0x1f71=function(_0x27453c,_0x22dd12){_0x27453c=_0x27453c-0x0;var _0x421149=_0xf711[_0x27453c];return _0x421149;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1f71('0x0')]('string',_0x1f71('0x1'),'customVariable','keyValue',_0x1f71('0x2')),'defaultValue':_0x1f71('0x3')},'content':{'type':Sequelize[_0x1f71('0x4')]},'key':{'type':Sequelize[_0x1f71('0x4')]},'keyType':{'type':Sequelize[_0x1f71('0x0')]('string','variable',_0x1f71('0x5'))},'keyContent':{'type':Sequelize[_0x1f71('0x4')]},'idField':{'type':Sequelize[_0x1f71('0x4')]},'nameField':{'type':Sequelize[_0x1f71('0x4')]},'customField':{'type':Sequelize[_0x1f71('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f71('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 82f0b36..40bc7e4 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2777=['../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','keys','length','include','create','body','find','params','rimraf','zip-dir','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x12f7f4,_0x4ecdba){var _0x2643ab=function(_0x1f2e5c){while(--_0x1f2e5c){_0x12f7f4['push'](_0x12f7f4['shift']());}};_0x2643ab(++_0x4ecdba);}(_0x2777,0xbb));var _0x7277=function(_0xc968bb,_0x455c58){_0xc968bb=_0xc968bb-0x0;var _0xfa5c0e=_0x2777[_0xc968bb];return _0xfa5c0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7277('0x0'));var zipdir=require(_0x7277('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7277('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7277('0x3'));var path=require('path');var sox=require(_0x7277('0x4'));var csv=require(_0x7277('0x5'));var ejs=require(_0x7277('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7277('0x7'));var squel=require(_0x7277('0x8'));var crypto=require(_0x7277('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7277('0xa'));var toCsv=require(_0x7277('0x5'));var querystring=require(_0x7277('0xb'));var Papa=require(_0x7277('0xc'));var Redis=require(_0x7277('0xd'));var authService=require(_0x7277('0xe'));var qs=require(_0x7277('0xf'));var as=require(_0x7277('0x10'));var hardwareService=require(_0x7277('0x11'));var logger=require(_0x7277('0x12'))(_0x7277('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7277('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56da7c,_0x142f20){_0x142f20=_0x142f20||0xcc;return function(_0x1eb880){if(_0x1eb880){return _0x56da7c[_0x7277('0x15')](_0x142f20);}return _0x56da7c[_0x7277('0x16')](_0x142f20)[_0x7277('0x17')]();};}function respondWithResult(_0x5e8003,_0x415a32){_0x415a32=_0x415a32||0xc8;return function(_0x283f52){if(_0x283f52){return _0x5e8003[_0x7277('0x16')](_0x415a32)[_0x7277('0x18')](_0x283f52);}};}function respondWithFilteredResult(_0x36fd11,_0x1814d2){return function(_0x342037){if(_0x342037){var _0x5e001a=typeof _0x1814d2[_0x7277('0x19')]==='undefined'&&typeof _0x1814d2[_0x7277('0x1a')]===_0x7277('0x1b');var _0x5c56c8=_0x342037[_0x7277('0x1c')];var _0x1d6bfa=_0x5e001a?0x0:_0x1814d2[_0x7277('0x19')];var _0x36cb81=_0x5e001a?_0x342037[_0x7277('0x1c')]:_0x1814d2[_0x7277('0x19')]+_0x1814d2[_0x7277('0x1a')];var _0x5ac2cf;if(_0x36cb81>=_0x5c56c8){_0x36cb81=_0x5c56c8;_0x5ac2cf=0xc8;}else{_0x5ac2cf=0xce;}_0x36fd11['status'](_0x5ac2cf);return _0x36fd11['set']('Content-Range',_0x1d6bfa+'-'+_0x36cb81+'/'+_0x5c56c8)['json'](_0x342037);}return null;};}function patchUpdates(_0x496413){return function(_0x1c03c4){try{jsonpatch[_0x7277('0x1d')](_0x1c03c4,_0x496413,!![]);}catch(_0x52a3a8){return BPromise['reject'](_0x52a3a8);}return _0x1c03c4[_0x7277('0x1e')]();};}function saveUpdates(_0x131774,_0x4ac7c4){return function(_0x505889){if(_0x505889){return _0x505889[_0x7277('0x1f')](_0x131774)[_0x7277('0x20')](function(_0x12318a){return _0x12318a;});}return null;};}function removeEntity(_0x35137b,_0x4da6c7){return function(_0x549657){if(_0x549657){return _0x549657[_0x7277('0x21')]()[_0x7277('0x20')](function(){_0x35137b[_0x7277('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5d4b,_0x39df10){return function(_0x1b0837){if(!_0x1b0837){_0x3d5d4b[_0x7277('0x15')](0x194);}return _0x1b0837;};}function handleError(_0x478f4e,_0x1ae8cc){_0x1ae8cc=_0x1ae8cc||0x1f4;return function(_0x242f1e){logger[_0x7277('0x22')](_0x242f1e['stack']);if(_0x242f1e[_0x7277('0x23')]){delete _0x242f1e[_0x7277('0x23')];}_0x478f4e[_0x7277('0x16')](_0x1ae8cc)[_0x7277('0x24')](_0x242f1e);};}exports[_0x7277('0x25')]=function(_0x244c8f,_0x53c547){var _0xa582e4={},_0x5c09e0={},_0x5524f1={'count':0x0,'rows':[]};var _0x4bd1ad=_[_0x7277('0x26')](db[_0x7277('0x27')][_0x7277('0x28')],function(_0x3809cf){return{'name':_0x3809cf[_0x7277('0x29')],'type':_0x3809cf[_0x7277('0x2a')][_0x7277('0x2b')]};});_0x5c09e0[_0x7277('0x2c')]=_[_0x7277('0x26')](_0x4bd1ad,_0x7277('0x23'));_0x5c09e0['query']=_['keys'](_0x244c8f[_0x7277('0x2d')]);_0x5c09e0[_0x7277('0x2e')]=_[_0x7277('0x2f')](_0x5c09e0[_0x7277('0x2c')],_0x5c09e0[_0x7277('0x2d')]);_0xa582e4['attributes']=_[_0x7277('0x2f')](_0x5c09e0[_0x7277('0x2c')],qs[_0x7277('0x30')](_0x244c8f[_0x7277('0x2d')]['fields']));_0xa582e4[_0x7277('0x31')]=_0xa582e4['attributes']['length']?_0xa582e4[_0x7277('0x31')]:_0x5c09e0[_0x7277('0x2c')];if(!_0x244c8f['query'][_0x7277('0x32')](_0x7277('0x33'))){_0xa582e4[_0x7277('0x1a')]=qs['limit'](_0x244c8f[_0x7277('0x2d')][_0x7277('0x1a')]);_0xa582e4[_0x7277('0x19')]=qs['offset'](_0x244c8f[_0x7277('0x2d')][_0x7277('0x19')]);}_0xa582e4['order']=qs[_0x7277('0x34')](_0x244c8f[_0x7277('0x2d')][_0x7277('0x34')]);_0xa582e4['where']=qs[_0x7277('0x2e')](_[_0x7277('0x35')](_0x244c8f[_0x7277('0x2d')],_0x5c09e0[_0x7277('0x2e')]),_0x4bd1ad);if(_0x244c8f[_0x7277('0x2d')]['filter']){_0xa582e4[_0x7277('0x36')]=_[_0x7277('0x37')](_0xa582e4[_0x7277('0x36')],{'$or':_['map'](_0x4bd1ad,function(_0xd80d9b){if(_0xd80d9b[_0x7277('0x2a')]!==_0x7277('0x38')){var _0x1b435e={};_0x1b435e[_0xd80d9b[_0x7277('0x23')]]={'$like':'%'+_0x244c8f[_0x7277('0x2d')][_0x7277('0x39')]+'%'};return _0x1b435e;}})});}_0xa582e4=_[_0x7277('0x37')]({},_0xa582e4,_0x244c8f[_0x7277('0x3a')]);var _0x48376d={'where':_0xa582e4[_0x7277('0x36')]};return db[_0x7277('0x27')][_0x7277('0x1c')](_0x48376d)[_0x7277('0x20')](function(_0x757c45){_0x5524f1[_0x7277('0x1c')]=_0x757c45;if(_0x244c8f[_0x7277('0x2d')][_0x7277('0x3b')]){_0xa582e4['include']=[{'all':!![]}];}return db[_0x7277('0x27')]['findAll'](_0xa582e4);})[_0x7277('0x20')](function(_0x28d6c0){_0x5524f1[_0x7277('0x3c')]=_0x28d6c0;return _0x5524f1;})[_0x7277('0x20')](respondWithFilteredResult(_0x53c547,_0xa582e4))[_0x7277('0x3d')](handleError(_0x53c547,null));};exports['show']=function(_0x3e6490,_0x35982f){var _0x726698={'raw':!![],'where':{'id':_0x3e6490['params']['id']}},_0x3a54b1={};_0x3a54b1[_0x7277('0x2c')]=_['keys'](db['FreshsalesField'][_0x7277('0x28')]);_0x3a54b1['query']=_[_0x7277('0x3e')](_0x3e6490['query']);_0x3a54b1[_0x7277('0x2e')]=_[_0x7277('0x2f')](_0x3a54b1['model'],_0x3a54b1[_0x7277('0x2d')]);_0x726698[_0x7277('0x31')]=_[_0x7277('0x2f')](_0x3a54b1[_0x7277('0x2c')],qs[_0x7277('0x30')](_0x3e6490[_0x7277('0x2d')]['fields']));_0x726698[_0x7277('0x31')]=_0x726698['attributes'][_0x7277('0x3f')]?_0x726698[_0x7277('0x31')]:_0x3a54b1[_0x7277('0x2c')];if(_0x3e6490[_0x7277('0x2d')][_0x7277('0x3b')]){_0x726698[_0x7277('0x40')]=[{'all':!![]}];}_0x726698=_[_0x7277('0x37')]({},_0x726698,_0x3e6490[_0x7277('0x3a')]);return db[_0x7277('0x27')]['find'](_0x726698)[_0x7277('0x20')](handleEntityNotFound(_0x35982f,null))[_0x7277('0x20')](respondWithResult(_0x35982f,null))[_0x7277('0x3d')](handleError(_0x35982f,null));};exports[_0x7277('0x41')]=function(_0x49a47b,_0x4d3ca5){return db['FreshsalesField'][_0x7277('0x41')](_0x49a47b[_0x7277('0x42')],{})[_0x7277('0x20')](respondWithResult(_0x4d3ca5,0xc9))[_0x7277('0x3d')](handleError(_0x4d3ca5,null));};exports['update']=function(_0x54e958,_0x12900f){if(_0x54e958[_0x7277('0x42')]['id']){delete _0x54e958[_0x7277('0x42')]['id'];}return db[_0x7277('0x27')][_0x7277('0x43')]({'where':{'id':_0x54e958[_0x7277('0x44')]['id']}})['then'](handleEntityNotFound(_0x12900f,null))[_0x7277('0x20')](saveUpdates(_0x54e958[_0x7277('0x42')],null))[_0x7277('0x20')](respondWithResult(_0x12900f,null))[_0x7277('0x3d')](handleError(_0x12900f,null));};exports[_0x7277('0x21')]=function(_0x3d9b1d,_0x1c9981){return db[_0x7277('0x27')][_0x7277('0x43')]({'where':{'id':_0x3d9b1d[_0x7277('0x44')]['id']}})[_0x7277('0x20')](handleEntityNotFound(_0x1c9981,null))['then'](removeEntity(_0x1c9981,null))['catch'](handleError(_0x1c9981,null));}; \ No newline at end of file +var _0xecd1=['include','findAll','show','keys','find','catch','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','FreshsalesField','includeAll'];(function(_0x2883b9,_0x2e187d){var _0x23de5c=function(_0x18624d){while(--_0x18624d){_0x2883b9['push'](_0x2883b9['shift']());}};_0x23de5c(++_0x2e187d);}(_0xecd1,0xf1));var _0x1ecd=function(_0x1e3312,_0x115cc7){_0x1e3312=_0x1e3312-0x0;var _0x549cc2=_0xecd1[_0x1e3312];return _0x549cc2;};'use strict';var emlformat=require(_0x1ecd('0x0'));var rimraf=require(_0x1ecd('0x1'));var zipdir=require(_0x1ecd('0x2'));var jsonpatch=require(_0x1ecd('0x3'));var rp=require('request-promise');var moment=require(_0x1ecd('0x4'));var BPromise=require(_0x1ecd('0x5'));var Mustache=require(_0x1ecd('0x6'));var util=require(_0x1ecd('0x7'));var path=require('path');var sox=require(_0x1ecd('0x8'));var csv=require('to-csv');var ejs=require(_0x1ecd('0x9'));var fs=require('fs');var fs_extra=require(_0x1ecd('0xa'));var _=require(_0x1ecd('0xb'));var squel=require('squel');var crypto=require(_0x1ecd('0xc'));var jsforce=require(_0x1ecd('0xd'));var deskjs=require(_0x1ecd('0xe'));var toCsv=require(_0x1ecd('0xf'));var querystring=require(_0x1ecd('0x10'));var Papa=require(_0x1ecd('0x11'));var Redis=require(_0x1ecd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1ecd('0x13'));var as=require(_0x1ecd('0x14'));var hardwareService=require(_0x1ecd('0x15'));var logger=require(_0x1ecd('0x16'))(_0x1ecd('0x17'));var utils=require(_0x1ecd('0x18'));var config=require(_0x1ecd('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ecd('0x1a'))['db'];function respondWithStatusCode(_0x3408fe,_0x77e059){_0x77e059=_0x77e059||0xcc;return function(_0xd31dca){if(_0xd31dca){return _0x3408fe['sendStatus'](_0x77e059);}return _0x3408fe[_0x1ecd('0x1b')](_0x77e059)['end']();};}function respondWithResult(_0x3d0992,_0x197001){_0x197001=_0x197001||0xc8;return function(_0x5e707c){if(_0x5e707c){return _0x3d0992[_0x1ecd('0x1b')](_0x197001)['json'](_0x5e707c);}};}function respondWithFilteredResult(_0xd11dae,_0x261196){return function(_0x32a097){if(_0x32a097){var _0x178686=typeof _0x261196[_0x1ecd('0x1c')]===_0x1ecd('0x1d')&&typeof _0x261196['limit']===_0x1ecd('0x1d');var _0x43e5b3=_0x32a097['count'];var _0x3e06bb=_0x178686?0x0:_0x261196[_0x1ecd('0x1c')];var _0x16e1ff=_0x178686?_0x32a097[_0x1ecd('0x1e')]:_0x261196[_0x1ecd('0x1c')]+_0x261196[_0x1ecd('0x1f')];var _0x576152;if(_0x16e1ff>=_0x43e5b3){_0x16e1ff=_0x43e5b3;_0x576152=0xc8;}else{_0x576152=0xce;}_0xd11dae[_0x1ecd('0x1b')](_0x576152);return _0xd11dae['set']('Content-Range',_0x3e06bb+'-'+_0x16e1ff+'/'+_0x43e5b3)['json'](_0x32a097);}return null;};}function patchUpdates(_0x2e0259){return function(_0x973662){try{jsonpatch[_0x1ecd('0x20')](_0x973662,_0x2e0259,!![]);}catch(_0x18baa3){return BPromise[_0x1ecd('0x21')](_0x18baa3);}return _0x973662[_0x1ecd('0x22')]();};}function saveUpdates(_0x4e5066,_0x59bb91){return function(_0x224735){if(_0x224735){return _0x224735[_0x1ecd('0x23')](_0x4e5066)[_0x1ecd('0x24')](function(_0x3e458f){return _0x3e458f;});}return null;};}function removeEntity(_0x26fd53,_0x1247c0){return function(_0x675869){if(_0x675869){return _0x675869['destroy']()[_0x1ecd('0x24')](function(){_0x26fd53[_0x1ecd('0x1b')](0xcc)[_0x1ecd('0x25')]();});}};}function handleEntityNotFound(_0x446830,_0x563698){return function(_0x81553d){if(!_0x81553d){_0x446830[_0x1ecd('0x26')](0x194);}return _0x81553d;};}function handleError(_0x388308,_0x4ed3a2){_0x4ed3a2=_0x4ed3a2||0x1f4;return function(_0x57dc67){logger[_0x1ecd('0x27')](_0x57dc67[_0x1ecd('0x28')]);if(_0x57dc67[_0x1ecd('0x29')]){delete _0x57dc67['name'];}_0x388308[_0x1ecd('0x1b')](_0x4ed3a2)[_0x1ecd('0x2a')](_0x57dc67);};}exports[_0x1ecd('0x2b')]=function(_0x351980,_0x2d2f74){var _0x3799d5={},_0x4c7188={},_0x2e0634={'count':0x0,'rows':[]};var _0x491f33=_[_0x1ecd('0x2c')](db['FreshsalesField'][_0x1ecd('0x2d')],function(_0x25988e){return{'name':_0x25988e[_0x1ecd('0x2e')],'type':_0x25988e['type'][_0x1ecd('0x2f')]};});_0x4c7188['model']=_['map'](_0x491f33,_0x1ecd('0x29'));_0x4c7188['query']=_['keys'](_0x351980[_0x1ecd('0x30')]);_0x4c7188['filters']=_['intersection'](_0x4c7188['model'],_0x4c7188[_0x1ecd('0x30')]);_0x3799d5['attributes']=_[_0x1ecd('0x31')](_0x4c7188[_0x1ecd('0x32')],qs[_0x1ecd('0x33')](_0x351980[_0x1ecd('0x30')][_0x1ecd('0x33')]));_0x3799d5['attributes']=_0x3799d5[_0x1ecd('0x34')][_0x1ecd('0x35')]?_0x3799d5['attributes']:_0x4c7188[_0x1ecd('0x32')];if(!_0x351980[_0x1ecd('0x30')][_0x1ecd('0x36')]('nolimit')){_0x3799d5[_0x1ecd('0x1f')]=qs[_0x1ecd('0x1f')](_0x351980[_0x1ecd('0x30')][_0x1ecd('0x1f')]);_0x3799d5[_0x1ecd('0x1c')]=qs[_0x1ecd('0x1c')](_0x351980[_0x1ecd('0x30')][_0x1ecd('0x1c')]);}_0x3799d5[_0x1ecd('0x37')]=qs[_0x1ecd('0x38')](_0x351980['query'][_0x1ecd('0x38')]);_0x3799d5[_0x1ecd('0x39')]=qs[_0x1ecd('0x3a')](_[_0x1ecd('0x3b')](_0x351980[_0x1ecd('0x30')],_0x4c7188[_0x1ecd('0x3a')]),_0x491f33);if(_0x351980[_0x1ecd('0x30')]['filter']){_0x3799d5[_0x1ecd('0x39')]=_[_0x1ecd('0x3c')](_0x3799d5['where'],{'$or':_['map'](_0x491f33,function(_0x1d644a){if(_0x1d644a[_0x1ecd('0x3d')]!==_0x1ecd('0x3e')){var _0x1120ae={};_0x1120ae[_0x1d644a['name']]={'$like':'%'+_0x351980[_0x1ecd('0x30')][_0x1ecd('0x3f')]+'%'};return _0x1120ae;}})});}_0x3799d5=_['merge']({},_0x3799d5,_0x351980[_0x1ecd('0x40')]);var _0x415c34={'where':_0x3799d5['where']};return db[_0x1ecd('0x41')][_0x1ecd('0x1e')](_0x415c34)[_0x1ecd('0x24')](function(_0x3af124){_0x2e0634[_0x1ecd('0x1e')]=_0x3af124;if(_0x351980[_0x1ecd('0x30')][_0x1ecd('0x42')]){_0x3799d5[_0x1ecd('0x43')]=[{'all':!![]}];}return db[_0x1ecd('0x41')][_0x1ecd('0x44')](_0x3799d5);})['then'](function(_0x5e54b6){_0x2e0634['rows']=_0x5e54b6;return _0x2e0634;})[_0x1ecd('0x24')](respondWithFilteredResult(_0x2d2f74,_0x3799d5))['catch'](handleError(_0x2d2f74,null));};exports[_0x1ecd('0x45')]=function(_0x31b632,_0x3f15ef){var _0x2156df={'raw':!![],'where':{'id':_0x31b632['params']['id']}},_0xb4bcd8={};_0xb4bcd8['model']=_[_0x1ecd('0x46')](db[_0x1ecd('0x41')][_0x1ecd('0x2d')]);_0xb4bcd8[_0x1ecd('0x30')]=_[_0x1ecd('0x46')](_0x31b632[_0x1ecd('0x30')]);_0xb4bcd8[_0x1ecd('0x3a')]=_['intersection'](_0xb4bcd8[_0x1ecd('0x32')],_0xb4bcd8[_0x1ecd('0x30')]);_0x2156df['attributes']=_['intersection'](_0xb4bcd8[_0x1ecd('0x32')],qs[_0x1ecd('0x33')](_0x31b632['query'][_0x1ecd('0x33')]));_0x2156df['attributes']=_0x2156df[_0x1ecd('0x34')][_0x1ecd('0x35')]?_0x2156df[_0x1ecd('0x34')]:_0xb4bcd8['model'];if(_0x31b632['query'][_0x1ecd('0x42')]){_0x2156df[_0x1ecd('0x43')]=[{'all':!![]}];}_0x2156df=_[_0x1ecd('0x3c')]({},_0x2156df,_0x31b632[_0x1ecd('0x40')]);return db[_0x1ecd('0x41')][_0x1ecd('0x47')](_0x2156df)[_0x1ecd('0x24')](handleEntityNotFound(_0x3f15ef,null))[_0x1ecd('0x24')](respondWithResult(_0x3f15ef,null))[_0x1ecd('0x48')](handleError(_0x3f15ef,null));};exports[_0x1ecd('0x49')]=function(_0x1c7c10,_0x11738a){return db[_0x1ecd('0x41')][_0x1ecd('0x49')](_0x1c7c10['body'],{})[_0x1ecd('0x24')](respondWithResult(_0x11738a,0xc9))[_0x1ecd('0x48')](handleError(_0x11738a,null));};exports[_0x1ecd('0x23')]=function(_0x139cd2,_0x849f2a){if(_0x139cd2[_0x1ecd('0x4a')]['id']){delete _0x139cd2[_0x1ecd('0x4a')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x139cd2['params']['id']}})[_0x1ecd('0x24')](handleEntityNotFound(_0x849f2a,null))[_0x1ecd('0x24')](saveUpdates(_0x139cd2['body'],null))['then'](respondWithResult(_0x849f2a,null))['catch'](handleError(_0x849f2a,null));};exports[_0x1ecd('0x4b')]=function(_0x2ea6be,_0x246ef3){return db[_0x1ecd('0x41')][_0x1ecd('0x47')]({'where':{'id':_0x2ea6be[_0x1ecd('0x4c')]['id']}})[_0x1ecd('0x24')](handleEntityNotFound(_0x246ef3,null))['then'](removeEntity(_0x246ef3,null))[_0x1ecd('0x48')](handleError(_0x246ef3,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b1dad85..bfc9f16 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa887=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','idField','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2da798,_0xd4547e){var _0x383063=function(_0x595727){while(--_0x595727){_0x2da798['push'](_0x2da798['shift']());}};_0x383063(++_0xd4547e);}(_0xa887,0x89));var _0x7a88=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa887[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x7a88('0x0'));var util=require('util');var logger=require(_0x7a88('0x1'))(_0x7a88('0x2'));var moment=require('moment');var BPromise=require(_0x7a88('0x3'));var rp=require(_0x7a88('0x4'));var fs=require('fs');var path=require(_0x7a88('0x5'));var rimraf=require(_0x7a88('0x6'));var config=require(_0x7a88('0x7'));var attributes=require(_0x7a88('0x8'));module[_0x7a88('0x9')]=function(_0xf70f6,_0x12fabf){return _0xf70f6['define'](_0x7a88('0xa'),attributes,{'tableName':_0x7a88('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x7a88('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8322=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8322,0x186));var _0x2832=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x8322[_0xe0b81f];return _0x290e5e;};'use strict';var _=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var logger=require(_0x2832('0x2'))(_0x2832('0x3'));var moment=require(_0x2832('0x4'));var BPromise=require(_0x2832('0x5'));var rp=require(_0x2832('0x6'));var fs=require('fs');var path=require(_0x2832('0x7'));var rimraf=require(_0x2832('0x8'));var config=require(_0x2832('0x9'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x3583d5,_0x1d10f2){return _0x3583d5[_0x2832('0xa')](_0x2832('0xb'),attributes,{'tableName':_0x2832('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x2832('0xd'),_0x2832('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 318634d..70423a3 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x33d5b9,_0x2fb333){var _0x55086e=function(_0x10632e){while(--_0x10632e){_0x33d5b9['push'](_0x33d5b9['shift']());}};_0x55086e(++_0x2fb333);}(_0xabce,0x103));var _0xeabc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xabce[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('FreshsalesField,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3bede0,_0x34c952){var _0x255039=function(_0x55916d){while(--_0x55916d){_0x3bede0['push'](_0x3bede0['shift']());}};_0x255039(++_0x34c952);}(_0x5496,0x175));var _0x6549=function(_0x4d9df4,_0x768417){_0x4d9df4=_0x4d9df4-0x0;var _0x125e23=_0x5496[_0x4d9df4];return _0x125e23;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4950674..2efc973 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5bde73,_0x44eea3){var _0x4abb76=function(_0x59bc9c){while(--_0x59bc9c){_0x5bde73['push'](_0x5bde73['shift']());}};_0x4abb76(++_0x44eea3);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5a1bc7,_0x265946){var _0x1b7c64=function(_0x12f593){while(--_0x12f593){_0x5a1bc7['push'](_0x5a1bc7['shift']());}};_0x1b7c64(++_0x265946);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0bef5e3..034faa9 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f25=['newTab','sequelize','exports','STRING','username','integrationTab'];(function(_0x4f73b2,_0xecd3da){var _0x5d7e8c=function(_0x4cf7e4){while(--_0x4cf7e4){_0x4f73b2['push'](_0x4f73b2['shift']());}};_0x5d7e8c(++_0xecd3da);}(_0x8f25,0x14b));var _0x58f2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8f25[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x58f2('0x0'));module[_0x58f2('0x1')]={'name':{'type':Sequelize[_0x58f2('0x2')]},'description':{'type':Sequelize[_0x58f2('0x2')]},'username':{'type':Sequelize[_0x58f2('0x2')],'unique':_0x58f2('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x58f2('0x2')]},'securityToken':{'type':Sequelize[_0x58f2('0x2')]},'serverUrl':{'type':Sequelize[_0x58f2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x58f2('0x4'),_0x58f2('0x5')),'defaultValue':_0x58f2('0x4')}}; \ No newline at end of file +var _0xdab3=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x415338,_0x2c7a97){var _0x46dc84=function(_0x1df07c){while(--_0x1df07c){_0x415338['push'](_0x415338['shift']());}};_0x46dc84(++_0x2c7a97);}(_0xdab3,0xeb));var _0x3dab=function(_0x23d73e,_0x2c9aa4){_0x23d73e=_0x23d73e-0x0;var _0x47ba29=_0xdab3[_0x23d73e];return _0x47ba29;};'use strict';var Sequelize=require(_0x3dab('0x0'));module[_0x3dab('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dab('0x2')]},'username':{'type':Sequelize[_0x3dab('0x2')],'unique':_0x3dab('0x3')},'remoteUri':{'type':Sequelize[_0x3dab('0x2')]},'password':{'type':Sequelize[_0x3dab('0x2')]},'clientId':{'type':Sequelize[_0x3dab('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3dab('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3dab('0x4')](_0x3dab('0x5'),_0x3dab('0x6')),'defaultValue':_0x3dab('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index dade7f1..821480c 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cd6=['reject','save','destroy','then','stack','name','index','map','SalesforceAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','isNil','ticketType','sobject','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','boolean','email','textarea','includes','label','custom','picklistValues','value','True','false','test','statusCode','error','stringify','send','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x14c3d4,_0x2f60fd){var _0x317764=function(_0x3305d6){while(--_0x3305d6){_0x14c3d4['push'](_0x14c3d4['shift']());}};_0x317764(++_0x2f60fd);}(_0x2cd6,0x13a));var _0x62cd=function(_0x4fa2d1,_0x3ae6ed){_0x4fa2d1=_0x4fa2d1-0x0;var _0x15b6b5=_0x2cd6[_0x4fa2d1];return _0x15b6b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62cd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62cd('0x1'));var rp=require('request-promise');var moment=require(_0x62cd('0x2'));var BPromise=require(_0x62cd('0x3'));var Mustache=require(_0x62cd('0x4'));var util=require('util');var path=require(_0x62cd('0x5'));var sox=require('sox');var csv=require(_0x62cd('0x6'));var ejs=require(_0x62cd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62cd('0x8'));var squel=require(_0x62cd('0x9'));var crypto=require('crypto');var jsforce=require(_0x62cd('0xa'));var deskjs=require(_0x62cd('0xb'));var toCsv=require(_0x62cd('0x6'));var querystring=require(_0x62cd('0xc'));var Papa=require(_0x62cd('0xd'));var Redis=require(_0x62cd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x62cd('0xf'))(_0x62cd('0x10'));var utils=require(_0x62cd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x62cd('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x62cd('0x13'));function respondWithStatusCode(_0x220df3,_0x192d38){_0x192d38=_0x192d38||0xcc;return function(_0x1f7a65){if(_0x1f7a65){return _0x220df3[_0x62cd('0x14')](_0x192d38);}return _0x220df3['status'](_0x192d38)[_0x62cd('0x15')]();};}function respondWithResult(_0x5adc9a,_0x45b671){_0x45b671=_0x45b671||0xc8;return function(_0x3dd77c){if(_0x3dd77c){return _0x5adc9a[_0x62cd('0x16')](_0x45b671)['json'](_0x3dd77c);}};}function respondWithFilteredResult(_0x2f03a8,_0x4f8625){return function(_0x378237){if(_0x378237){var _0x4759f2=typeof _0x4f8625['offset']===_0x62cd('0x17')&&typeof _0x4f8625[_0x62cd('0x18')]==='undefined';var _0xcf03fd=_0x378237[_0x62cd('0x19')];var _0x54796f=_0x4759f2?0x0:_0x4f8625[_0x62cd('0x1a')];var _0x125fd1=_0x4759f2?_0x378237[_0x62cd('0x19')]:_0x4f8625[_0x62cd('0x1a')]+_0x4f8625[_0x62cd('0x18')];var _0x574720;if(_0x125fd1>=_0xcf03fd){_0x125fd1=_0xcf03fd;_0x574720=0xc8;}else{_0x574720=0xce;}_0x2f03a8[_0x62cd('0x16')](_0x574720);return _0x2f03a8[_0x62cd('0x1b')](_0x62cd('0x1c'),_0x54796f+'-'+_0x125fd1+'/'+_0xcf03fd)[_0x62cd('0x1d')](_0x378237);}return null;};}function patchUpdates(_0x582d52){return function(_0x159aa8){try{jsonpatch[_0x62cd('0x1e')](_0x159aa8,_0x582d52,!![]);}catch(_0x40c33f){return BPromise[_0x62cd('0x1f')](_0x40c33f);}return _0x159aa8[_0x62cd('0x20')]();};}function saveUpdates(_0x3574ab,_0x3c074b){return function(_0x4e6c9f){if(_0x4e6c9f){return _0x4e6c9f['update'](_0x3574ab)['then'](function(_0x50bfba){return _0x50bfba;});}return null;};}function removeEntity(_0x18ba7e,_0x3fd1fc){return function(_0x56fc98){if(_0x56fc98){return _0x56fc98[_0x62cd('0x21')]()[_0x62cd('0x22')](function(){_0x18ba7e[_0x62cd('0x16')](0xcc)[_0x62cd('0x15')]();});}};}function handleEntityNotFound(_0x1c1a16,_0x57a6c1){return function(_0x5819cc){if(!_0x5819cc){_0x1c1a16[_0x62cd('0x14')](0x194);}return _0x5819cc;};}function handleError(_0x220f61,_0x5ebaa3){_0x5ebaa3=_0x5ebaa3||0x1f4;return function(_0x46706f){logger['error'](_0x46706f[_0x62cd('0x23')]);if(_0x46706f[_0x62cd('0x24')]){delete _0x46706f[_0x62cd('0x24')];}_0x220f61['status'](_0x5ebaa3)['send'](_0x46706f);};}exports[_0x62cd('0x25')]=function(_0x17280f,_0x46a665){var _0x4a11ea={},_0x3a06bb={},_0x3ea946={'count':0x0,'rows':[]};var _0x4a26e1=_[_0x62cd('0x26')](db[_0x62cd('0x27')][_0x62cd('0x28')],function(_0x2f0b68){return{'name':_0x2f0b68['fieldName'],'type':_0x2f0b68[_0x62cd('0x29')][_0x62cd('0x2a')]};});_0x3a06bb[_0x62cd('0x2b')]=_[_0x62cd('0x26')](_0x4a26e1,_0x62cd('0x24'));_0x3a06bb['query']=_[_0x62cd('0x2c')](_0x17280f[_0x62cd('0x2d')]);_0x3a06bb[_0x62cd('0x2e')]=_[_0x62cd('0x2f')](_0x3a06bb['model'],_0x3a06bb[_0x62cd('0x2d')]);_0x4a11ea[_0x62cd('0x30')]=_['intersection'](_0x3a06bb[_0x62cd('0x2b')],qs[_0x62cd('0x31')](_0x17280f[_0x62cd('0x2d')][_0x62cd('0x31')]));_0x4a11ea['attributes']=_0x4a11ea[_0x62cd('0x30')][_0x62cd('0x32')]?_0x4a11ea['attributes']:_0x3a06bb[_0x62cd('0x2b')];if(!_0x17280f[_0x62cd('0x2d')]['hasOwnProperty'](_0x62cd('0x33'))){_0x4a11ea[_0x62cd('0x18')]=qs['limit'](_0x17280f['query'][_0x62cd('0x18')]);_0x4a11ea[_0x62cd('0x1a')]=qs[_0x62cd('0x1a')](_0x17280f[_0x62cd('0x2d')][_0x62cd('0x1a')]);}_0x4a11ea[_0x62cd('0x34')]=qs[_0x62cd('0x35')](_0x17280f['query'][_0x62cd('0x35')]);_0x4a11ea[_0x62cd('0x36')]=qs[_0x62cd('0x2e')](_[_0x62cd('0x37')](_0x17280f[_0x62cd('0x2d')],_0x3a06bb['filters']),_0x4a26e1);if(_0x17280f['query'][_0x62cd('0x38')]){_0x4a11ea[_0x62cd('0x36')]=_['merge'](_0x4a11ea[_0x62cd('0x36')],{'$or':_[_0x62cd('0x26')](_0x4a26e1,function(_0x462f96){if(_0x462f96[_0x62cd('0x29')]!==_0x62cd('0x39')){var _0x4668ba={};_0x4668ba[_0x462f96[_0x62cd('0x24')]]={'$like':'%'+_0x17280f[_0x62cd('0x2d')][_0x62cd('0x38')]+'%'};return _0x4668ba;}})});}_0x4a11ea=_[_0x62cd('0x3a')]({},_0x4a11ea,_0x17280f[_0x62cd('0x3b')]);var _0x5dbe95={'where':_0x4a11ea[_0x62cd('0x36')]};return db[_0x62cd('0x27')][_0x62cd('0x19')](_0x5dbe95)[_0x62cd('0x22')](function(_0x4c5ed9){_0x3ea946['count']=_0x4c5ed9;if(_0x17280f[_0x62cd('0x2d')][_0x62cd('0x3c')]){_0x4a11ea[_0x62cd('0x3d')]=[{'all':!![]}];}return db[_0x62cd('0x27')][_0x62cd('0x3e')](_0x4a11ea);})[_0x62cd('0x22')](function(_0xbc4c10){_0x3ea946['rows']=_0xbc4c10;return _0x3ea946;})[_0x62cd('0x22')](respondWithFilteredResult(_0x46a665,_0x4a11ea))[_0x62cd('0x3f')](handleError(_0x46a665,null));};exports[_0x62cd('0x40')]=function(_0x6ed044,_0x10e8a8){var _0x26c05c={'raw':![],'where':{'id':_0x6ed044['params']['id']}},_0x1c90e1={};_0x1c90e1[_0x62cd('0x2b')]=_[_0x62cd('0x2c')](db[_0x62cd('0x27')][_0x62cd('0x28')]);_0x1c90e1[_0x62cd('0x2d')]=_[_0x62cd('0x2c')](_0x6ed044[_0x62cd('0x2d')]);_0x1c90e1['filters']=_[_0x62cd('0x2f')](_0x1c90e1['model'],_0x1c90e1[_0x62cd('0x2d')]);_0x26c05c[_0x62cd('0x30')]=_['intersection'](_0x1c90e1[_0x62cd('0x2b')],qs[_0x62cd('0x31')](_0x6ed044[_0x62cd('0x2d')][_0x62cd('0x31')]));_0x26c05c[_0x62cd('0x30')]=_0x26c05c[_0x62cd('0x30')][_0x62cd('0x32')]?_0x26c05c['attributes']:_0x1c90e1[_0x62cd('0x2b')];if(_0x6ed044[_0x62cd('0x2d')]['includeAll']){_0x26c05c['include']=[{'all':!![]}];}_0x26c05c=_[_0x62cd('0x3a')]({},_0x26c05c,_0x6ed044[_0x62cd('0x3b')]);return db[_0x62cd('0x27')][_0x62cd('0x41')](_0x26c05c)['then'](handleEntityNotFound(_0x10e8a8,null))[_0x62cd('0x22')](respondWithResult(_0x10e8a8,null))[_0x62cd('0x3f')](handleError(_0x10e8a8,null));};exports[_0x62cd('0x42')]=function(_0x19332a,_0x8eae2e){return db[_0x62cd('0x27')][_0x62cd('0x42')](_0x19332a[_0x62cd('0x43')],{})[_0x62cd('0x22')](respondWithResult(_0x8eae2e,0xc9))[_0x62cd('0x3f')](handleError(_0x8eae2e,null));};exports['update']=function(_0x1afc3a,_0x4f4ad6){if(_0x1afc3a[_0x62cd('0x43')]['id']){delete _0x1afc3a[_0x62cd('0x43')]['id'];}return db[_0x62cd('0x27')][_0x62cd('0x41')]({'where':{'id':_0x1afc3a[_0x62cd('0x44')]['id']}})[_0x62cd('0x22')](handleEntityNotFound(_0x4f4ad6,null))[_0x62cd('0x22')](saveUpdates(_0x1afc3a[_0x62cd('0x43')],null))[_0x62cd('0x22')](respondWithResult(_0x4f4ad6,null))[_0x62cd('0x3f')](handleError(_0x4f4ad6,null));};exports[_0x62cd('0x21')]=function(_0x93a000,_0x2251ea){return db[_0x62cd('0x27')][_0x62cd('0x41')]({'where':{'id':_0x93a000[_0x62cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2251ea,null))[_0x62cd('0x22')](removeEntity(_0x2251ea,null))[_0x62cd('0x3f')](handleError(_0x2251ea,null));};exports[_0x62cd('0x45')]=function(_0x4f4d91,_0x41ee44,_0x187d42){var _0x5f0206={};var _0x353b15={};var _0x5272f1;var _0x38f2b0;return db['SalesforceAccount'][_0x62cd('0x46')]({'where':{'id':_0x4f4d91[_0x62cd('0x44')]['id']}})[_0x62cd('0x22')](handleEntityNotFound(_0x41ee44,null))[_0x62cd('0x22')](function(_0xa9c1fa){if(_0xa9c1fa){_0x5272f1=_0xa9c1fa;_0x353b15[_0x62cd('0x2b')]=_[_0x62cd('0x2c')](db[_0x62cd('0x47')][_0x62cd('0x28')]);_0x353b15[_0x62cd('0x2d')]=_[_0x62cd('0x2c')](_0x4f4d91['query']);_0x353b15[_0x62cd('0x2e')]=_['intersection'](_0x353b15[_0x62cd('0x2b')],_0x353b15[_0x62cd('0x2d')]);_0x5f0206[_0x62cd('0x30')]=_[_0x62cd('0x2f')](_0x353b15[_0x62cd('0x2b')],qs[_0x62cd('0x31')](_0x4f4d91[_0x62cd('0x2d')][_0x62cd('0x31')]));_0x5f0206[_0x62cd('0x30')]=_0x5f0206[_0x62cd('0x30')][_0x62cd('0x32')]?_0x5f0206[_0x62cd('0x30')]:_0x353b15[_0x62cd('0x2b')];_0x5f0206[_0x62cd('0x34')]=qs[_0x62cd('0x35')](_0x4f4d91[_0x62cd('0x2d')][_0x62cd('0x35')]);_0x5f0206[_0x62cd('0x36')]=qs[_0x62cd('0x2e')](_[_0x62cd('0x37')](_0x4f4d91[_0x62cd('0x2d')],_0x353b15['filters']));if(_0x4f4d91['query']['filter']){_0x5f0206[_0x62cd('0x36')]=_[_0x62cd('0x3a')](_0x5f0206[_0x62cd('0x36')],{'$or':_['map'](_0x5f0206[_0x62cd('0x30')],function(_0x1a6cf6){var _0x3dd6d3={};_0x3dd6d3[_0x1a6cf6]={'$like':'%'+_0x4f4d91[_0x62cd('0x2d')][_0x62cd('0x38')]+'%'};return _0x3dd6d3;})});}_0x5f0206=_[_0x62cd('0x3a')]({},_0x5f0206,_0x4f4d91[_0x62cd('0x3b')]);return _0x5272f1[_0x62cd('0x45')](_0x5f0206);}})[_0x62cd('0x22')](function(_0x9a1228){if(_0x9a1228){_0x38f2b0=_0x9a1228['length'];if(!_0x4f4d91[_0x62cd('0x2d')]['hasOwnProperty'](_0x62cd('0x33'))){_0x5f0206[_0x62cd('0x18')]=qs[_0x62cd('0x18')](_0x4f4d91[_0x62cd('0x2d')][_0x62cd('0x18')]);_0x5f0206[_0x62cd('0x1a')]=qs[_0x62cd('0x1a')](_0x4f4d91[_0x62cd('0x2d')][_0x62cd('0x1a')]);}return _0x5272f1['getConfigurations'](_0x5f0206);}})['then'](function(_0x4af8cd){if(_0x4af8cd){return _0x4af8cd?{'count':_0x38f2b0,'rows':_0x4af8cd}:null;}})[_0x62cd('0x22')](respondWithResult(_0x41ee44,null))[_0x62cd('0x3f')](handleError(_0x41ee44,null));};exports['addConfiguration']=function(_0x98b46b,_0x5b9072,_0x3491b5){if(_0x98b46b[_0x62cd('0x43')]['id']){delete _0x98b46b[_0x62cd('0x43')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x98b46b[_0x62cd('0x44')]['id']}})[_0x62cd('0x22')](handleEntityNotFound(_0x5b9072,null))[_0x62cd('0x22')](function(_0xe4a27a){if(_0xe4a27a){_0x98b46b[_0x62cd('0x43')][_0x62cd('0x48')]=_0xe4a27a['id'];_0x98b46b[_0x62cd('0x43')][_0x62cd('0x49')]=integrations['getSubjects'](_0x98b46b[_0x62cd('0x43')][_0x62cd('0x4a')],_0x98b46b[_0x62cd('0x43')][_0x62cd('0x29')]);_0x98b46b['body'][_0x62cd('0x4b')]=integrations[_0x62cd('0x4c')](_0x98b46b['body'][_0x62cd('0x4a')],_0x98b46b[_0x62cd('0x43')][_0x62cd('0x29')]);return db[_0x62cd('0x47')]['create'](_0x98b46b[_0x62cd('0x43')],{'include':[{'model':db['SalesforceField'],'as':_0x62cd('0x49')},{'model':db[_0x62cd('0x4d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5b9072,null))['catch'](handleError(_0x5b9072,null));};exports[_0x62cd('0x4e')]=function(_0xcb09c3,_0x5b91ad,_0x55ab8b){var _0xea3144;var _0x3ff5f7='';var _0x14dc53=_0x62cd('0x4f');return db[_0x62cd('0x27')]['findOne']({'where':{'id':_0xcb09c3[_0x62cd('0x44')]['id']},'attributes':['id',_0x62cd('0x50'),_0x62cd('0x51'),_0x62cd('0x52'),_0x62cd('0x53'),_0x62cd('0x54'),_0x62cd('0x55')]})[_0x62cd('0x22')](handleEntityNotFound(_0x5b91ad,null))[_0x62cd('0x22')](function(_0xb52067){if(_0xb52067){_0x3ff5f7=_0xb52067[_0x62cd('0x50')];var _0x5bf2c6=_0x3ff5f7[_0x62cd('0x56')](-0x1);if(_0x5bf2c6==='/'){_0x3ff5f7=_0x3ff5f7['substring'](0x0,_0x3ff5f7[_0x62cd('0x57')](_0x5bf2c6));}_0xea3144=new jsforce[(_0x62cd('0x58'))]({'oauth2':{'loginUrl':_0x3ff5f7,'clientId':_0xb52067[_0x62cd('0x51')],'clientSecret':_0xb52067[_0x62cd('0x52')]}});return _0xea3144[_0x62cd('0x59')](_0xb52067[_0x62cd('0x53')],_0xb52067[_0x62cd('0x54')]['concat'](_0xb52067[_0x62cd('0x55')]));}})[_0x62cd('0x22')](function(_0x4acae0){if(_0x4acae0){if(!_[_0x62cd('0x5a')](_0xcb09c3[_0x62cd('0x2d')][_0x62cd('0x5b')])){_0x14dc53=_0xcb09c3[_0x62cd('0x2d')][_0x62cd('0x5b')];}return _0xea3144[_0x62cd('0x5c')](_0x14dc53)['describe']();}})[_0x62cd('0x22')](function(_0x342bde){var _0x4b0eab=['OwnerId',_0x62cd('0x5d'),_0x62cd('0x5e'),'IsRecurrence',_0x62cd('0x5f'),_0x62cd('0x60')];var _0x3ede50=[_0x62cd('0x61'),_0x62cd('0x62'),_0x62cd('0x63'),_0x62cd('0x64'),_0x62cd('0x65'),_0x62cd('0x66'),'phone'];if(_0x342bde){_['remove'](_0x342bde['fields'],function(_0x38d658){return _0x4b0eab['includes'](_0x38d658[_0x62cd('0x24')])||!_0x3ede50[_0x62cd('0x67')](_0x38d658['type']);});return{'count':_0x342bde['fields']['length'],'rows':_[_0x62cd('0x26')](_0x342bde['fields'],function(_0x18bb65){return{'id':_0x18bb65['name'],'name':_0x18bb65[_0x62cd('0x68')],'custom':_0x18bb65[_0x62cd('0x69')],'options':_0x18bb65[_0x62cd('0x6a')][_0x62cd('0x32')]>0x0?_[_0x62cd('0x26')](_0x18bb65[_0x62cd('0x6a')],function(_0x30166c){return{'name':_0x30166c[_0x62cd('0x68')],'value':_0x30166c[_0x62cd('0x6b')]};}):_0x18bb65[_0x62cd('0x29')]==_0x62cd('0x64')?[{'name':_0x62cd('0x6c'),'value':'true'},{'name':'False','value':_0x62cd('0x6d')}]:[]};})};}})[_0x62cd('0x22')](respondWithResult(_0x5b91ad,null))[_0x62cd('0x3f')](function(_0x4d7dab){var _0x1d3d42=_0xcb09c3[_0x62cd('0x2d')][_0x62cd('0x6e')]?0x1f4:_0x4d7dab[_0x62cd('0x6f')]||0x1f4;logger[_0x62cd('0x70')]('getFields,\x20%s,\x20%s,\x20%s',_0x62cd('0x4e'),_0x1d3d42,JSON[_0x62cd('0x71')](_0x4d7dab));delete _0x4d7dab[_0x62cd('0x24')];if(_0x1d3d42===0x191){_0x1d3d42=0x190;}_0x5b91ad[_0x62cd('0x16')](_0x1d3d42)[_0x62cd('0x72')](_0xcb09c3[_0x62cd('0x2d')][_0x62cd('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d7dab[_0x62cd('0x6f')]}:_0x4d7dab);});}; \ No newline at end of file +var _0x6fbd=['../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','SalesforceAccount','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','type','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','params','body','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','slice','substring','lastIndexOf','Connection','login','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','int','picklist','email','phone','remove','includes','custom','picklistValues','label','value','boolean','true','false','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fbd,0x15a));var _0xd6fb=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x6fbd[_0x4709c8];return _0x478cdd;};'use strict';var emlformat=require(_0xd6fb('0x0'));var rimraf=require(_0xd6fb('0x1'));var zipdir=require(_0xd6fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6fb('0x3'));var moment=require(_0xd6fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6fb('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd6fb('0x6'));var csv=require('to-csv');var ejs=require(_0xd6fb('0x7'));var fs=require('fs');var fs_extra=require(_0xd6fb('0x8'));var _=require(_0xd6fb('0x9'));var squel=require(_0xd6fb('0xa'));var crypto=require(_0xd6fb('0xb'));var jsforce=require(_0xd6fb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd6fb('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd6fb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd6fb('0xf'));var hardwareService=require(_0xd6fb('0x10'));var logger=require(_0xd6fb('0x11'))('api');var utils=require(_0xd6fb('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd6fb('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd6fb('0x14'));function respondWithStatusCode(_0x5c4674,_0x3184f6){_0x3184f6=_0x3184f6||0xcc;return function(_0x14ee04){if(_0x14ee04){return _0x5c4674[_0xd6fb('0x15')](_0x3184f6);}return _0x5c4674[_0xd6fb('0x16')](_0x3184f6)[_0xd6fb('0x17')]();};}function respondWithResult(_0x51df50,_0x3b86c6){_0x3b86c6=_0x3b86c6||0xc8;return function(_0xc174b4){if(_0xc174b4){return _0x51df50[_0xd6fb('0x16')](_0x3b86c6)[_0xd6fb('0x18')](_0xc174b4);}};}function respondWithFilteredResult(_0x1cb69b,_0x4890f1){return function(_0x136333){if(_0x136333){var _0x156546=typeof _0x4890f1['offset']===_0xd6fb('0x19')&&typeof _0x4890f1[_0xd6fb('0x1a')]===_0xd6fb('0x19');var _0x2880c7=_0x136333[_0xd6fb('0x1b')];var _0x1eb304=_0x156546?0x0:_0x4890f1[_0xd6fb('0x1c')];var _0xbe8061=_0x156546?_0x136333['count']:_0x4890f1[_0xd6fb('0x1c')]+_0x4890f1[_0xd6fb('0x1a')];var _0x19921d;if(_0xbe8061>=_0x2880c7){_0xbe8061=_0x2880c7;_0x19921d=0xc8;}else{_0x19921d=0xce;}_0x1cb69b[_0xd6fb('0x16')](_0x19921d);return _0x1cb69b[_0xd6fb('0x1d')](_0xd6fb('0x1e'),_0x1eb304+'-'+_0xbe8061+'/'+_0x2880c7)[_0xd6fb('0x18')](_0x136333);}return null;};}function patchUpdates(_0x133a3e){return function(_0x36c45b){try{jsonpatch[_0xd6fb('0x1f')](_0x36c45b,_0x133a3e,!![]);}catch(_0x3df623){return BPromise[_0xd6fb('0x20')](_0x3df623);}return _0x36c45b[_0xd6fb('0x21')]();};}function saveUpdates(_0x3c1164,_0x31eacd){return function(_0x52c60c){if(_0x52c60c){return _0x52c60c[_0xd6fb('0x22')](_0x3c1164)[_0xd6fb('0x23')](function(_0x32dd97){return _0x32dd97;});}return null;};}function removeEntity(_0x4e8604,_0x11f2bc){return function(_0x16e6d6){if(_0x16e6d6){return _0x16e6d6[_0xd6fb('0x24')]()[_0xd6fb('0x23')](function(){_0x4e8604[_0xd6fb('0x16')](0xcc)[_0xd6fb('0x17')]();});}};}function handleEntityNotFound(_0x5ca62b,_0x4a38b5){return function(_0x4c84dc){if(!_0x4c84dc){_0x5ca62b['sendStatus'](0x194);}return _0x4c84dc;};}function handleError(_0x56f757,_0x281160){_0x281160=_0x281160||0x1f4;return function(_0x5df16c){logger['error'](_0x5df16c[_0xd6fb('0x25')]);if(_0x5df16c[_0xd6fb('0x26')]){delete _0x5df16c[_0xd6fb('0x26')];}_0x56f757[_0xd6fb('0x16')](_0x281160)[_0xd6fb('0x27')](_0x5df16c);};}exports['index']=function(_0x470a54,_0x5bd56b){var _0x4c89c9={},_0x572b71={},_0x5f3b5f={'count':0x0,'rows':[]};var _0x5ce6c4=_['map'](db[_0xd6fb('0x28')]['rawAttributes'],function(_0x533fde){return{'name':_0x533fde[_0xd6fb('0x29')],'type':_0x533fde['type'][_0xd6fb('0x2a')]};});_0x572b71[_0xd6fb('0x2b')]=_[_0xd6fb('0x2c')](_0x5ce6c4,'name');_0x572b71['query']=_['keys'](_0x470a54[_0xd6fb('0x2d')]);_0x572b71[_0xd6fb('0x2e')]=_['intersection'](_0x572b71[_0xd6fb('0x2b')],_0x572b71[_0xd6fb('0x2d')]);_0x4c89c9['attributes']=_[_0xd6fb('0x2f')](_0x572b71['model'],qs[_0xd6fb('0x30')](_0x470a54[_0xd6fb('0x2d')][_0xd6fb('0x30')]));_0x4c89c9[_0xd6fb('0x31')]=_0x4c89c9[_0xd6fb('0x31')][_0xd6fb('0x32')]?_0x4c89c9[_0xd6fb('0x31')]:_0x572b71['model'];if(!_0x470a54[_0xd6fb('0x2d')][_0xd6fb('0x33')](_0xd6fb('0x34'))){_0x4c89c9[_0xd6fb('0x1a')]=qs[_0xd6fb('0x1a')](_0x470a54['query'][_0xd6fb('0x1a')]);_0x4c89c9[_0xd6fb('0x1c')]=qs[_0xd6fb('0x1c')](_0x470a54[_0xd6fb('0x2d')][_0xd6fb('0x1c')]);}_0x4c89c9['order']=qs[_0xd6fb('0x35')](_0x470a54['query']['sort']);_0x4c89c9[_0xd6fb('0x36')]=qs[_0xd6fb('0x2e')](_['pick'](_0x470a54[_0xd6fb('0x2d')],_0x572b71[_0xd6fb('0x2e')]),_0x5ce6c4);if(_0x470a54[_0xd6fb('0x2d')]['filter']){_0x4c89c9[_0xd6fb('0x36')]=_[_0xd6fb('0x37')](_0x4c89c9[_0xd6fb('0x36')],{'$or':_[_0xd6fb('0x2c')](_0x5ce6c4,function(_0x2428c0){if(_0x2428c0[_0xd6fb('0x38')]!=='VIRTUAL'){var _0x45c80c={};_0x45c80c[_0x2428c0[_0xd6fb('0x26')]]={'$like':'%'+_0x470a54['query']['filter']+'%'};return _0x45c80c;}})});}_0x4c89c9=_[_0xd6fb('0x37')]({},_0x4c89c9,_0x470a54[_0xd6fb('0x39')]);var _0x1761fa={'where':_0x4c89c9[_0xd6fb('0x36')]};return db[_0xd6fb('0x28')][_0xd6fb('0x1b')](_0x1761fa)[_0xd6fb('0x23')](function(_0x66ccd8){_0x5f3b5f[_0xd6fb('0x1b')]=_0x66ccd8;if(_0x470a54[_0xd6fb('0x2d')][_0xd6fb('0x3a')]){_0x4c89c9[_0xd6fb('0x3b')]=[{'all':!![]}];}return db[_0xd6fb('0x28')][_0xd6fb('0x3c')](_0x4c89c9);})[_0xd6fb('0x23')](function(_0x4fc4fe){_0x5f3b5f[_0xd6fb('0x3d')]=_0x4fc4fe;return _0x5f3b5f;})[_0xd6fb('0x23')](respondWithFilteredResult(_0x5bd56b,_0x4c89c9))[_0xd6fb('0x3e')](handleError(_0x5bd56b,null));};exports[_0xd6fb('0x3f')]=function(_0x5861a1,_0x25ca21){var _0x262bc1={'raw':![],'where':{'id':_0x5861a1['params']['id']}},_0x3632c5={};_0x3632c5[_0xd6fb('0x2b')]=_[_0xd6fb('0x40')](db[_0xd6fb('0x28')][_0xd6fb('0x41')]);_0x3632c5[_0xd6fb('0x2d')]=_[_0xd6fb('0x40')](_0x5861a1[_0xd6fb('0x2d')]);_0x3632c5[_0xd6fb('0x2e')]=_[_0xd6fb('0x2f')](_0x3632c5['model'],_0x3632c5['query']);_0x262bc1[_0xd6fb('0x31')]=_[_0xd6fb('0x2f')](_0x3632c5['model'],qs[_0xd6fb('0x30')](_0x5861a1[_0xd6fb('0x2d')][_0xd6fb('0x30')]));_0x262bc1[_0xd6fb('0x31')]=_0x262bc1[_0xd6fb('0x31')]['length']?_0x262bc1['attributes']:_0x3632c5['model'];if(_0x5861a1['query']['includeAll']){_0x262bc1[_0xd6fb('0x3b')]=[{'all':!![]}];}_0x262bc1=_[_0xd6fb('0x37')]({},_0x262bc1,_0x5861a1[_0xd6fb('0x39')]);return db[_0xd6fb('0x28')][_0xd6fb('0x42')](_0x262bc1)[_0xd6fb('0x23')](handleEntityNotFound(_0x25ca21,null))[_0xd6fb('0x23')](respondWithResult(_0x25ca21,null))[_0xd6fb('0x3e')](handleError(_0x25ca21,null));};exports[_0xd6fb('0x43')]=function(_0x46196d,_0x35170b){return db['SalesforceAccount']['create'](_0x46196d['body'],{})[_0xd6fb('0x23')](respondWithResult(_0x35170b,0xc9))['catch'](handleError(_0x35170b,null));};exports[_0xd6fb('0x22')]=function(_0x43b641,_0x2459bf){if(_0x43b641['body']['id']){delete _0x43b641['body']['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x43b641[_0xd6fb('0x44')]['id']}})[_0xd6fb('0x23')](handleEntityNotFound(_0x2459bf,null))[_0xd6fb('0x23')](saveUpdates(_0x43b641[_0xd6fb('0x45')],null))[_0xd6fb('0x23')](respondWithResult(_0x2459bf,null))['catch'](handleError(_0x2459bf,null));};exports[_0xd6fb('0x24')]=function(_0x1cf7d6,_0x14b2a3){return db[_0xd6fb('0x28')][_0xd6fb('0x42')]({'where':{'id':_0x1cf7d6[_0xd6fb('0x44')]['id']}})[_0xd6fb('0x23')](handleEntityNotFound(_0x14b2a3,null))['then'](removeEntity(_0x14b2a3,null))[_0xd6fb('0x3e')](handleError(_0x14b2a3,null));};exports[_0xd6fb('0x46')]=function(_0x260c7a,_0x44e219,_0x4e6630){var _0x330d25={};var _0x190874={};var _0x25de58;var _0x220c94;return db[_0xd6fb('0x28')][_0xd6fb('0x47')]({'where':{'id':_0x260c7a[_0xd6fb('0x44')]['id']}})[_0xd6fb('0x23')](handleEntityNotFound(_0x44e219,null))[_0xd6fb('0x23')](function(_0x149553){if(_0x149553){_0x25de58=_0x149553;_0x190874['model']=_[_0xd6fb('0x40')](db[_0xd6fb('0x48')][_0xd6fb('0x41')]);_0x190874[_0xd6fb('0x2d')]=_['keys'](_0x260c7a[_0xd6fb('0x2d')]);_0x190874[_0xd6fb('0x2e')]=_['intersection'](_0x190874[_0xd6fb('0x2b')],_0x190874['query']);_0x330d25['attributes']=_['intersection'](_0x190874['model'],qs[_0xd6fb('0x30')](_0x260c7a[_0xd6fb('0x2d')][_0xd6fb('0x30')]));_0x330d25['attributes']=_0x330d25['attributes'][_0xd6fb('0x32')]?_0x330d25[_0xd6fb('0x31')]:_0x190874[_0xd6fb('0x2b')];_0x330d25['order']=qs[_0xd6fb('0x35')](_0x260c7a[_0xd6fb('0x2d')]['sort']);_0x330d25[_0xd6fb('0x36')]=qs['filters'](_[_0xd6fb('0x49')](_0x260c7a[_0xd6fb('0x2d')],_0x190874[_0xd6fb('0x2e')]));if(_0x260c7a[_0xd6fb('0x2d')]['filter']){_0x330d25['where']=_[_0xd6fb('0x37')](_0x330d25['where'],{'$or':_[_0xd6fb('0x2c')](_0x330d25[_0xd6fb('0x31')],function(_0x271602){var _0x4eb4d7={};_0x4eb4d7[_0x271602]={'$like':'%'+_0x260c7a[_0xd6fb('0x2d')]['filter']+'%'};return _0x4eb4d7;})});}_0x330d25=_[_0xd6fb('0x37')]({},_0x330d25,_0x260c7a[_0xd6fb('0x39')]);return _0x25de58[_0xd6fb('0x46')](_0x330d25);}})[_0xd6fb('0x23')](function(_0x534ffe){if(_0x534ffe){_0x220c94=_0x534ffe[_0xd6fb('0x32')];if(!_0x260c7a[_0xd6fb('0x2d')][_0xd6fb('0x33')](_0xd6fb('0x34'))){_0x330d25[_0xd6fb('0x1a')]=qs['limit'](_0x260c7a[_0xd6fb('0x2d')][_0xd6fb('0x1a')]);_0x330d25[_0xd6fb('0x1c')]=qs[_0xd6fb('0x1c')](_0x260c7a[_0xd6fb('0x2d')][_0xd6fb('0x1c')]);}return _0x25de58[_0xd6fb('0x46')](_0x330d25);}})['then'](function(_0x4554d2){if(_0x4554d2){return _0x4554d2?{'count':_0x220c94,'rows':_0x4554d2}:null;}})[_0xd6fb('0x23')](respondWithResult(_0x44e219,null))[_0xd6fb('0x3e')](handleError(_0x44e219,null));};exports[_0xd6fb('0x4a')]=function(_0x5457d8,_0xaa64b5,_0x21aea5){if(_0x5457d8['body']['id']){delete _0x5457d8[_0xd6fb('0x45')]['id'];}return db[_0xd6fb('0x28')][_0xd6fb('0x47')]({'where':{'id':_0x5457d8['params']['id']}})[_0xd6fb('0x23')](handleEntityNotFound(_0xaa64b5,null))[_0xd6fb('0x23')](function(_0x230c17){if(_0x230c17){_0x5457d8['body'][_0xd6fb('0x4b')]=_0x230c17['id'];_0x5457d8[_0xd6fb('0x45')][_0xd6fb('0x4c')]=integrations[_0xd6fb('0x4d')](_0x5457d8['body'][_0xd6fb('0x4e')],_0x5457d8[_0xd6fb('0x45')][_0xd6fb('0x38')]);_0x5457d8[_0xd6fb('0x45')]['Descriptions']=integrations['getDescriptions'](_0x5457d8['body']['channel'],_0x5457d8[_0xd6fb('0x45')][_0xd6fb('0x38')]);return db['SalesforceConfiguration']['create'](_0x5457d8[_0xd6fb('0x45')],{'include':[{'model':db[_0xd6fb('0x4f')],'as':_0xd6fb('0x4c')},{'model':db[_0xd6fb('0x4f')],'as':_0xd6fb('0x50')}]});}return null;})[_0xd6fb('0x23')](respondWithResult(_0xaa64b5,null))[_0xd6fb('0x3e')](handleError(_0xaa64b5,null));};exports[_0xd6fb('0x51')]=function(_0x336a29,_0x54af97,_0x5ec992){var _0x3686ab;var _0x5cb5a4='';var _0x28433f=_0xd6fb('0x52');return db[_0xd6fb('0x28')][_0xd6fb('0x47')]({'where':{'id':_0x336a29[_0xd6fb('0x44')]['id']},'attributes':['id',_0xd6fb('0x53'),_0xd6fb('0x54'),_0xd6fb('0x55'),_0xd6fb('0x56'),'password','securityToken']})[_0xd6fb('0x23')](handleEntityNotFound(_0x54af97,null))['then'](function(_0x5a7982){if(_0x5a7982){_0x5cb5a4=_0x5a7982[_0xd6fb('0x53')];var _0x363ff0=_0x5cb5a4[_0xd6fb('0x57')](-0x1);if(_0x363ff0==='/'){_0x5cb5a4=_0x5cb5a4[_0xd6fb('0x58')](0x0,_0x5cb5a4[_0xd6fb('0x59')](_0x363ff0));}_0x3686ab=new jsforce[(_0xd6fb('0x5a'))]({'oauth2':{'loginUrl':_0x5cb5a4,'clientId':_0x5a7982[_0xd6fb('0x54')],'clientSecret':_0x5a7982[_0xd6fb('0x55')]}});return _0x3686ab[_0xd6fb('0x5b')](_0x5a7982['username'],_0x5a7982[_0xd6fb('0x5c')][_0xd6fb('0x5d')](_0x5a7982[_0xd6fb('0x5e')]));}})[_0xd6fb('0x23')](function(_0x40f020){if(_0x40f020){if(!_[_0xd6fb('0x5f')](_0x336a29[_0xd6fb('0x2d')][_0xd6fb('0x60')])){_0x28433f=_0x336a29[_0xd6fb('0x2d')][_0xd6fb('0x60')];}return _0x3686ab[_0xd6fb('0x61')](_0x28433f)[_0xd6fb('0x62')]();}})[_0xd6fb('0x23')](function(_0x374a59){var _0x16d95a=[_0xd6fb('0x63'),_0xd6fb('0x64'),_0xd6fb('0x65'),_0xd6fb('0x66'),_0xd6fb('0x67'),'Description'];var _0x6ee3dc=['string',_0xd6fb('0x68'),_0xd6fb('0x69'),'boolean',_0xd6fb('0x6a'),'textarea',_0xd6fb('0x6b')];if(_0x374a59){_[_0xd6fb('0x6c')](_0x374a59['fields'],function(_0x53a8c0){return _0x16d95a[_0xd6fb('0x6d')](_0x53a8c0[_0xd6fb('0x26')])||!_0x6ee3dc['includes'](_0x53a8c0[_0xd6fb('0x38')]);});return{'count':_0x374a59[_0xd6fb('0x30')][_0xd6fb('0x32')],'rows':_['map'](_0x374a59[_0xd6fb('0x30')],function(_0x5b1cd7){return{'id':_0x5b1cd7[_0xd6fb('0x26')],'name':_0x5b1cd7['label'],'custom':_0x5b1cd7[_0xd6fb('0x6e')],'options':_0x5b1cd7[_0xd6fb('0x6f')][_0xd6fb('0x32')]>0x0?_[_0xd6fb('0x2c')](_0x5b1cd7[_0xd6fb('0x6f')],function(_0x26069c){return{'name':_0x26069c[_0xd6fb('0x70')],'value':_0x26069c[_0xd6fb('0x71')]};}):_0x5b1cd7['type']==_0xd6fb('0x72')?[{'name':'True','value':_0xd6fb('0x73')},{'name':'False','value':_0xd6fb('0x74')}]:[]};})};}})['then'](respondWithResult(_0x54af97,null))['catch'](function(_0x2ada57){var _0x180496=_0x336a29['query'][_0xd6fb('0x75')]?0x1f4:_0x2ada57[_0xd6fb('0x76')]||0x1f4;logger[_0xd6fb('0x77')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x180496,JSON[_0xd6fb('0x78')](_0x2ada57));delete _0x2ada57[_0xd6fb('0x26')];if(_0x180496===0x191){_0x180496=0x190;}_0x54af97[_0xd6fb('0x16')](_0x180496)[_0xd6fb('0x27')](_0x336a29[_0xd6fb('0x2d')][_0xd6fb('0x75')]?{'message':_0xd6fb('0x79'),'statusCode':_0x2ada57[_0xd6fb('0x76')]}:_0x2ada57);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1a30518..8e3b84c 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x831c=['exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x5babd2,_0x52c7d2){var _0x16c4f0=function(_0x4a0a0c){while(--_0x4a0a0c){_0x5babd2['push'](_0x5babd2['shift']());}};_0x16c4f0(++_0x52c7d2);}(_0x831c,0x112));var _0xc831=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x831c[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xc831('0x0'));var util=require(_0xc831('0x1'));var logger=require(_0xc831('0x2'))(_0xc831('0x3'));var moment=require(_0xc831('0x4'));var BPromise=require(_0xc831('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc831('0x6'));var rimraf=require(_0xc831('0x7'));var config=require(_0xc831('0x8'));var attributes=require(_0xc831('0x9'));var integrations=require(_0xc831('0xa'));module[_0xc831('0xb')]=function(_0x1dfdf6,_0x532e2d){return _0x1dfdf6[_0xc831('0xc')](_0xc831('0xd'),attributes,{'tableName':_0xc831('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1330=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x1330,0x1f4));var _0x0133=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x1330[_0x38e177];return _0x1faf15;};'use strict';var _=require('lodash');var util=require(_0x0133('0x0'));var logger=require(_0x0133('0x1'))(_0x0133('0x2'));var moment=require(_0x0133('0x3'));var BPromise=require('bluebird');var rp=require(_0x0133('0x4'));var fs=require('fs');var path=require(_0x0133('0x5'));var rimraf=require(_0x0133('0x6'));var config=require(_0x0133('0x7'));var attributes=require(_0x0133('0x8'));var integrations=require(_0x0133('0x9'));module['exports']=function(_0x430137,_0x33d2ef){return _0x430137[_0x0133('0xa')](_0x0133('0xb'),attributes,{'tableName':_0x0133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 8dc8faf..2527ea9 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4d9=['result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4a5e2e,_0x13b74b){var _0x207cd4=function(_0x19dc5b){while(--_0x19dc5b){_0x4a5e2e['push'](_0x4a5e2e['shift']());}};_0x207cd4(++_0x13b74b);}(_0xb4d9,0xce));var _0x9b4d=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb4d9[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var moment=require('moment');var BPromise=require(_0x9b4d('0x2'));var rs=require(_0x9b4d('0x3'));var fs=require('fs');var Redis=require(_0x9b4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b4d('0x5'));var logger=require(_0x9b4d('0x6'))(_0x9b4d('0x7'));var config=require(_0x9b4d('0x8'));var jayson=require(_0x9b4d('0x9'));var client=jayson[_0x9b4d('0xa')][_0x9b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429cc5,_0x461cb1,_0x14cb0b){return new BPromise(function(_0x156c68,_0x48832a){return client[_0x9b4d('0xc')](_0x429cc5,_0x14cb0b)['then'](function(_0x340b21){logger['info'](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));logger[_0x9b4d('0xf')](_0x9b4d('0x10'),_0x461cb1,_0x9b4d('0xe'),JSON[_0x9b4d('0x11')](_0x340b21));if(_0x340b21[_0x9b4d('0x12')]){if(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x13')]===0x1f4){logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21[_0x9b4d('0x12')]['message']);return _0x48832a(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x14')]);}logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21['error'][_0x9b4d('0x14')]);return _0x156c68(_0x340b21['error']['message']);}else{logger[_0x9b4d('0x15')](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));_0x156c68(_0x340b21[_0x9b4d('0x16')][_0x9b4d('0x14')]);}})[_0x9b4d('0x17')](function(_0x5d23f3){logger['error'](_0x9b4d('0xd'),_0x461cb1,_0x5d23f3);_0x48832a(_0x5d23f3);});});}exports[_0x9b4d('0x18')]=function(_0x15e808){var _0x25c32d=this;return new Promise(function(_0x1c52eb,_0x20e223){return db[_0x9b4d('0x19')][_0x9b4d('0x1a')]({'raw':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'limit':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1f')]||null:null,'include':_0x15e808['options']?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x15e808['options'][_0x9b4d('0x20')],function(_0x5daeda){return{'model':db[_0x5daeda['model']],'as':_0x5daeda['as'],'attributes':_0x5daeda[_0x9b4d('0x1e')],'include':_0x5daeda['include']?_[_0x9b4d('0x21')](_0x5daeda[_0x9b4d('0x20')],function(_0x5607b7){return{'model':db[_0x5607b7[_0x9b4d('0x22')]],'as':_0x5607b7['as'],'attributes':_0x5607b7[_0x9b4d('0x1e')],'include':_0x5607b7[_0x9b4d('0x20')]?_['map'](_0x5607b7['include'],function(_0x465013){return{'model':db[_0x465013[_0x9b4d('0x22')]],'as':_0x465013['as'],'attributes':_0x465013['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0x5d639b){logger[_0x9b4d('0x15')]('GetSalesforceAccount',_0x15e808);logger[_0x9b4d('0xf')]('GetSalesforceAccount',_0x15e808,JSON[_0x9b4d('0x11')](_0x5d639b));_0x1c52eb(_0x5d639b);})[_0x9b4d('0x17')](function(_0x5e9d1b){logger[_0x9b4d('0x12')]('GetSalesforceAccount',_0x5e9d1b['message'],_0x15e808);_0x20e223(_0x25c32d[_0x9b4d('0x12')](0x1f4,_0x5e9d1b[_0x9b4d('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x51459b){var _0xe5980d=this;return new Promise(function(_0x3b1954,_0x1da4ab){return db[_0x9b4d('0x19')][_0x9b4d('0x24')]({'raw':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'include':_0x51459b[_0x9b4d('0x1b')]?_0x51459b['options'][_0x9b4d('0x20')]?_['map'](_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x20')],function(_0x141989){return{'model':db[_0x141989[_0x9b4d('0x22')]],'as':_0x141989['as'],'attributes':_0x141989[_0x9b4d('0x1e')],'include':_0x141989[_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x141989['include'],function(_0x1b99b7){return{'model':db[_0x1b99b7[_0x9b4d('0x22')]],'as':_0x1b99b7['as'],'attributes':_0x1b99b7[_0x9b4d('0x1e')],'include':_0x1b99b7['include']?_['map'](_0x1b99b7[_0x9b4d('0x20')],function(_0x47bff3){return{'model':db[_0x47bff3['model']],'as':_0x47bff3['as'],'attributes':_0x47bff3[_0x9b4d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0xb588fe){logger[_0x9b4d('0x15')](_0x9b4d('0x25'),_0x51459b);logger['debug'](_0x9b4d('0x25'),_0x51459b,JSON[_0x9b4d('0x11')](_0xb588fe));_0x3b1954(_0xb588fe);})['catch'](function(_0xf5842){logger[_0x9b4d('0x12')](_0x9b4d('0x25'),_0xf5842[_0x9b4d('0x14')],_0x51459b);_0x1da4ab(_0xe5980d[_0x9b4d('0x12')](0x1f4,_0xf5842['message']));});});}; \ No newline at end of file +var _0xe139=['info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','options','raw','where','attributes','limit','include','map','model','catch','SalesforceAccount','find','ShowSalesforceAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe139,0x1eb));var _0x9e13=function(_0x1d4174,_0x336e28){_0x1d4174=_0x1d4174-0x0;var _0xbaf30a=_0xe139[_0x1d4174];return _0xbaf30a;};'use strict';var _=require(_0x9e13('0x0'));var util=require('util');var moment=require(_0x9e13('0x1'));var BPromise=require(_0x9e13('0x2'));var rs=require(_0x9e13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e13('0x4'))['db'];var utils=require(_0x9e13('0x5'));var logger=require(_0x9e13('0x6'))(_0x9e13('0x7'));var config=require(_0x9e13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e13('0x9')][_0x9e13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431d00,_0x4b3aee,_0x48a2cd){return new BPromise(function(_0x2133a9,_0x16a0be){return client[_0x9e13('0xb')](_0x431d00,_0x48a2cd)[_0x9e13('0xc')](function(_0x2a0705){logger[_0x9e13('0xd')](_0x9e13('0xe'),_0x4b3aee,_0x9e13('0xf'));logger[_0x9e13('0x10')](_0x9e13('0x11'),_0x4b3aee,_0x9e13('0xf'),JSON[_0x9e13('0x12')](_0x2a0705));if(_0x2a0705[_0x9e13('0x13')]){if(_0x2a0705[_0x9e13('0x13')][_0x9e13('0x14')]===0x1f4){logger['error'](_0x9e13('0xe'),_0x4b3aee,_0x2a0705[_0x9e13('0x13')]['message']);return _0x16a0be(_0x2a0705['error']['message']);}logger['error'](_0x9e13('0xe'),_0x4b3aee,_0x2a0705[_0x9e13('0x13')]['message']);return _0x2133a9(_0x2a0705[_0x9e13('0x13')][_0x9e13('0x15')]);}else{logger[_0x9e13('0xd')](_0x9e13('0xe'),_0x4b3aee,_0x9e13('0xf'));_0x2133a9(_0x2a0705[_0x9e13('0x16')][_0x9e13('0x15')]);}})['catch'](function(_0x56897e){logger[_0x9e13('0x13')](_0x9e13('0xe'),_0x4b3aee,_0x56897e);_0x16a0be(_0x56897e);});});}exports[_0x9e13('0x17')]=function(_0x453f77){var _0x52af17=this;return new Promise(function(_0x31550b,_0x371754){return db['SalesforceAccount']['findAll']({'raw':_0x453f77['options']?_0x453f77[_0x9e13('0x18')][_0x9e13('0x19')]===undefined?!![]:![]:!![],'where':_0x453f77['options']?_0x453f77['options'][_0x9e13('0x1a')]||null:null,'attributes':_0x453f77['options']?_0x453f77['options'][_0x9e13('0x1b')]||null:null,'limit':_0x453f77[_0x9e13('0x18')]?_0x453f77['options'][_0x9e13('0x1c')]||null:null,'include':_0x453f77[_0x9e13('0x18')]?_0x453f77[_0x9e13('0x18')][_0x9e13('0x1d')]?_[_0x9e13('0x1e')](_0x453f77['options'][_0x9e13('0x1d')],function(_0xeac12e){return{'model':db[_0xeac12e['model']],'as':_0xeac12e['as'],'attributes':_0xeac12e[_0x9e13('0x1b')],'include':_0xeac12e[_0x9e13('0x1d')]?_[_0x9e13('0x1e')](_0xeac12e[_0x9e13('0x1d')],function(_0x4a1e2d){return{'model':db[_0x4a1e2d[_0x9e13('0x1f')]],'as':_0x4a1e2d['as'],'attributes':_0x4a1e2d['attributes'],'include':_0x4a1e2d[_0x9e13('0x1d')]?_['map'](_0x4a1e2d[_0x9e13('0x1d')],function(_0x30a29e){return{'model':db[_0x30a29e['model']],'as':_0x30a29e['as'],'attributes':_0x30a29e[_0x9e13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9e13('0xc')](function(_0xfbf595){logger[_0x9e13('0xd')]('GetSalesforceAccount',_0x453f77);logger[_0x9e13('0x10')](_0x9e13('0x17'),_0x453f77,JSON[_0x9e13('0x12')](_0xfbf595));_0x31550b(_0xfbf595);})[_0x9e13('0x20')](function(_0xda0f7c){logger[_0x9e13('0x13')](_0x9e13('0x17'),_0xda0f7c[_0x9e13('0x15')],_0x453f77);_0x371754(_0x52af17[_0x9e13('0x13')](0x1f4,_0xda0f7c[_0x9e13('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x3fb688){var _0x1cf9a8=this;return new Promise(function(_0x2a232d,_0x3edb56){return db[_0x9e13('0x21')][_0x9e13('0x22')]({'raw':_0x3fb688['options']?_0x3fb688['options'][_0x9e13('0x19')]===undefined?!![]:![]:!![],'where':_0x3fb688[_0x9e13('0x18')]?_0x3fb688[_0x9e13('0x18')]['where']||null:null,'attributes':_0x3fb688['options']?_0x3fb688[_0x9e13('0x18')]['attributes']||null:null,'include':_0x3fb688['options']?_0x3fb688[_0x9e13('0x18')][_0x9e13('0x1d')]?_[_0x9e13('0x1e')](_0x3fb688['options']['include'],function(_0x251871){return{'model':db[_0x251871['model']],'as':_0x251871['as'],'attributes':_0x251871[_0x9e13('0x1b')],'include':_0x251871[_0x9e13('0x1d')]?_[_0x9e13('0x1e')](_0x251871[_0x9e13('0x1d')],function(_0x554712){return{'model':db[_0x554712['model']],'as':_0x554712['as'],'attributes':_0x554712[_0x9e13('0x1b')],'include':_0x554712[_0x9e13('0x1d')]?_[_0x9e13('0x1e')](_0x554712['include'],function(_0x3fab16){return{'model':db[_0x3fab16[_0x9e13('0x1f')]],'as':_0x3fab16['as'],'attributes':_0x3fab16['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e13('0xc')](function(_0x30e4ab){logger[_0x9e13('0xd')](_0x9e13('0x23'),_0x3fb688);logger[_0x9e13('0x10')](_0x9e13('0x23'),_0x3fb688,JSON['stringify'](_0x30e4ab));_0x2a232d(_0x30e4ab);})[_0x9e13('0x20')](function(_0x2b180d){logger['error'](_0x9e13('0x23'),_0x2b180d['message'],_0x3fb688);_0x3edb56(_0x1cf9a8['error'](0x1f4,_0x2b180d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index b3ef3c1..5067cb6 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4c80bd,_0x1add8c){var _0x500de4=function(_0x2cb09f){while(--_0x2cb09f){_0x4c80bd['push'](_0x4c80bd['shift']());}};_0x500de4(++_0x1add8c);}(_0xadb5,0xad));var _0x5adb=function(_0x2f007c,_0x204af3){_0x2f007c=_0x2f007c-0x0;var _0x5956c4=_0xadb5[_0x2f007c];return _0x5956c4;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x10855c,_0x56f469){var _0x5e561c=function(_0x46c50d){while(--_0x46c50d){_0x10855c['push'](_0x10855c['shift']());}};_0x5e561c(++_0x56f469);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0adb8b6..568d17a 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27a3=['contact_lead','contact','lead','account','nothing','exports','STRING','ENUM','Task','Case'];(function(_0x2f4311,_0xd2d511){var _0x309ccb=function(_0x3ddf5c){while(--_0x3ddf5c){_0x2f4311['push'](_0x2f4311['shift']());}};_0x309ccb(++_0xd2d511);}(_0x27a3,0xb9));var _0x327a=function(_0x425294,_0x575904){_0x425294=_0x425294-0x0;var _0xbdf42d=_0x27a3[_0x425294];return _0xbdf42d;};'use strict';var Sequelize=require('sequelize');module[_0x327a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x327a('0x1')]},'ticketType':{'type':Sequelize[_0x327a('0x2')](_0x327a('0x3'),_0x327a('0x4')),'defaultValue':_0x327a('0x3')},'moduleSearch':{'type':Sequelize[_0x327a('0x2')](_0x327a('0x5'),_0x327a('0x6'),_0x327a('0x7'),'account_contact_lead',_0x327a('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x327a('0x2')](_0x327a('0x9'),'contact',_0x327a('0x7'),'account'),'defaultValue':_0x327a('0x7')},'leadId':{'type':Sequelize[_0x327a('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x327a('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x327a('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x327a('0x1')]}}; \ No newline at end of file +var _0x361a=['contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','Task','Case','ENUM'];(function(_0xfa6949,_0x493595){var _0x2883ef=function(_0xbfac04){while(--_0xbfac04){_0xfa6949['push'](_0xfa6949['shift']());}};_0x2883ef(++_0x493595);}(_0x361a,0x102));var _0xa361=function(_0x3f1352,_0x547367){_0x3f1352=_0x3f1352-0x0;var _0x3dba99=_0x361a[_0x3f1352];return _0x3dba99;};'use strict';var Sequelize=require(_0xa361('0x0'));module[_0xa361('0x1')]={'name':{'type':Sequelize[_0xa361('0x2')]},'description':{'type':Sequelize[_0xa361('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xa361('0x3'),_0xa361('0x4')),'defaultValue':_0xa361('0x3')},'moduleSearch':{'type':Sequelize[_0xa361('0x5')](_0xa361('0x6'),_0xa361('0x7'),_0xa361('0x8'),_0xa361('0x9'),_0xa361('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa361('0x5')](_0xa361('0xb'),_0xa361('0x7'),'lead',_0xa361('0xa')),'defaultValue':_0xa361('0x8')},'leadId':{'type':Sequelize[_0xa361('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xa361('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xa361('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xa361('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4ebc88f..89bf20b 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac47=['keys','find','create','body','getFields','nolimit','getSubjects','findOne','SalesforceField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','SalesforceConfiguration'];(function(_0x259d2c,_0x19aaee){var _0x355c78=function(_0x4fa5b9){while(--_0x4fa5b9){_0x259d2c['push'](_0x259d2c['shift']());}};_0x355c78(++_0x19aaee);}(_0xac47,0xef));var _0x7ac4=function(_0xa0d6e8,_0x41e320){_0xa0d6e8=_0xa0d6e8-0x0;var _0x4ba300=_0xac47[_0xa0d6e8];return _0x4ba300;};'use strict';var emlformat=require(_0x7ac4('0x0'));var rimraf=require(_0x7ac4('0x1'));var zipdir=require(_0x7ac4('0x2'));var jsonpatch=require(_0x7ac4('0x3'));var rp=require(_0x7ac4('0x4'));var moment=require(_0x7ac4('0x5'));var BPromise=require(_0x7ac4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7ac4('0x7'));var sox=require(_0x7ac4('0x8'));var csv=require('to-csv');var ejs=require(_0x7ac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ac4('0xa'));var squel=require(_0x7ac4('0xb'));var crypto=require('crypto');var jsforce=require(_0x7ac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ac4('0xd'));var Redis=require(_0x7ac4('0xe'));var authService=require(_0x7ac4('0xf'));var qs=require(_0x7ac4('0x10'));var as=require(_0x7ac4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ac4('0x12'))(_0x7ac4('0x13'));var utils=require(_0x7ac4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f79f,_0x4747cb){_0x4747cb=_0x4747cb||0xcc;return function(_0x2c890c){if(_0x2c890c){return _0x13f79f['sendStatus'](_0x4747cb);}return _0x13f79f[_0x7ac4('0x15')](_0x4747cb)['end']();};}function respondWithResult(_0x1f65e6,_0x578687){_0x578687=_0x578687||0xc8;return function(_0x5d3a1f){if(_0x5d3a1f){return _0x1f65e6[_0x7ac4('0x15')](_0x578687)[_0x7ac4('0x16')](_0x5d3a1f);}};}function respondWithFilteredResult(_0xae7f41,_0x1a1d61){return function(_0x13f3e3){if(_0x13f3e3){var _0x4867fa=typeof _0x1a1d61[_0x7ac4('0x17')]===_0x7ac4('0x18')&&typeof _0x1a1d61[_0x7ac4('0x19')]===_0x7ac4('0x18');var _0x14768c=_0x13f3e3[_0x7ac4('0x1a')];var _0x1a0bdf=_0x4867fa?0x0:_0x1a1d61['offset'];var _0x11030b=_0x4867fa?_0x13f3e3[_0x7ac4('0x1a')]:_0x1a1d61[_0x7ac4('0x17')]+_0x1a1d61['limit'];var _0x6a3514;if(_0x11030b>=_0x14768c){_0x11030b=_0x14768c;_0x6a3514=0xc8;}else{_0x6a3514=0xce;}_0xae7f41[_0x7ac4('0x15')](_0x6a3514);return _0xae7f41[_0x7ac4('0x1b')](_0x7ac4('0x1c'),_0x1a0bdf+'-'+_0x11030b+'/'+_0x14768c)[_0x7ac4('0x16')](_0x13f3e3);}return null;};}function patchUpdates(_0x26bd6b){return function(_0x162ff4){try{jsonpatch[_0x7ac4('0x1d')](_0x162ff4,_0x26bd6b,!![]);}catch(_0x19fe9e){return BPromise[_0x7ac4('0x1e')](_0x19fe9e);}return _0x162ff4['save']();};}function saveUpdates(_0x32b13d,_0x3de9e5){return function(_0x39b180){if(_0x39b180){return _0x39b180[_0x7ac4('0x1f')](_0x32b13d)[_0x7ac4('0x20')](function(_0x12dff9){return _0x12dff9;});}return null;};}function removeEntity(_0x2da214,_0x264c04){return function(_0x211fd7){if(_0x211fd7){return _0x211fd7[_0x7ac4('0x21')]()[_0x7ac4('0x20')](function(){_0x2da214[_0x7ac4('0x15')](0xcc)[_0x7ac4('0x22')]();});}};}function handleEntityNotFound(_0x49975c,_0x3b81e9){return function(_0xee6a9d){if(!_0xee6a9d){_0x49975c[_0x7ac4('0x23')](0x194);}return _0xee6a9d;};}function handleError(_0xd72e38,_0x3f54d6){_0x3f54d6=_0x3f54d6||0x1f4;return function(_0x140592){logger[_0x7ac4('0x24')](_0x140592['stack']);if(_0x140592[_0x7ac4('0x25')]){delete _0x140592[_0x7ac4('0x25')];}_0xd72e38[_0x7ac4('0x15')](_0x3f54d6)['send'](_0x140592);};}exports[_0x7ac4('0x26')]=function(_0x49d5ae,_0x256830){var _0x970067={},_0x560a00={},_0x3d3c8a={'count':0x0,'rows':[]};var _0xdce1a0=_[_0x7ac4('0x27')](db['SalesforceConfiguration'][_0x7ac4('0x28')],function(_0x1a7832){return{'name':_0x1a7832[_0x7ac4('0x29')],'type':_0x1a7832['type'][_0x7ac4('0x2a')]};});_0x560a00[_0x7ac4('0x2b')]=_[_0x7ac4('0x27')](_0xdce1a0,_0x7ac4('0x25'));_0x560a00['query']=_['keys'](_0x49d5ae[_0x7ac4('0x2c')]);_0x560a00[_0x7ac4('0x2d')]=_[_0x7ac4('0x2e')](_0x560a00[_0x7ac4('0x2b')],_0x560a00['query']);_0x970067[_0x7ac4('0x2f')]=_['intersection'](_0x560a00[_0x7ac4('0x2b')],qs['fields'](_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x30')]));_0x970067[_0x7ac4('0x2f')]=_0x970067['attributes'][_0x7ac4('0x31')]?_0x970067[_0x7ac4('0x2f')]:_0x560a00[_0x7ac4('0x2b')];if(!_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x32')]('nolimit')){_0x970067[_0x7ac4('0x19')]=qs[_0x7ac4('0x19')](_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x19')]);_0x970067[_0x7ac4('0x17')]=qs[_0x7ac4('0x17')](_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x17')]);}_0x970067['order']=qs[_0x7ac4('0x33')](_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x33')]);_0x970067[_0x7ac4('0x34')]=qs[_0x7ac4('0x2d')](_['pick'](_0x49d5ae[_0x7ac4('0x2c')],_0x560a00[_0x7ac4('0x2d')]),_0xdce1a0);if(_0x49d5ae['query']['filter']){_0x970067[_0x7ac4('0x34')]=_[_0x7ac4('0x35')](_0x970067[_0x7ac4('0x34')],{'$or':_[_0x7ac4('0x27')](_0xdce1a0,function(_0x5b96cc){if(_0x5b96cc[_0x7ac4('0x36')]!==_0x7ac4('0x37')){var _0x915800={};_0x915800[_0x5b96cc['name']]={'$like':'%'+_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x38')]+'%'};return _0x915800;}})});}_0x970067=_[_0x7ac4('0x35')]({},_0x970067,_0x49d5ae[_0x7ac4('0x39')]);var _0xc66c69={'where':_0x970067['where']};return db['SalesforceConfiguration']['count'](_0xc66c69)['then'](function(_0x275e2){_0x3d3c8a[_0x7ac4('0x1a')]=_0x275e2;if(_0x49d5ae[_0x7ac4('0x2c')][_0x7ac4('0x3a')]){_0x970067[_0x7ac4('0x3b')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x970067);})[_0x7ac4('0x20')](function(_0x23f9a5){_0x3d3c8a[_0x7ac4('0x3c')]=_0x23f9a5;return _0x3d3c8a;})[_0x7ac4('0x20')](respondWithFilteredResult(_0x256830,_0x970067))[_0x7ac4('0x3d')](handleError(_0x256830,null));};exports[_0x7ac4('0x3e')]=function(_0x11aab0,_0x26adf9){var _0x47b88a={'raw':![],'where':{'id':_0x11aab0[_0x7ac4('0x3f')]['id']}},_0x351ccb={};_0x351ccb[_0x7ac4('0x2b')]=_['keys'](db[_0x7ac4('0x40')]['rawAttributes']);_0x351ccb[_0x7ac4('0x2c')]=_[_0x7ac4('0x41')](_0x11aab0[_0x7ac4('0x2c')]);_0x351ccb[_0x7ac4('0x2d')]=_[_0x7ac4('0x2e')](_0x351ccb[_0x7ac4('0x2b')],_0x351ccb[_0x7ac4('0x2c')]);_0x47b88a[_0x7ac4('0x2f')]=_[_0x7ac4('0x2e')](_0x351ccb[_0x7ac4('0x2b')],qs[_0x7ac4('0x30')](_0x11aab0['query']['fields']));_0x47b88a[_0x7ac4('0x2f')]=_0x47b88a[_0x7ac4('0x2f')]['length']?_0x47b88a[_0x7ac4('0x2f')]:_0x351ccb[_0x7ac4('0x2b')];if(_0x11aab0[_0x7ac4('0x2c')][_0x7ac4('0x3a')]){_0x47b88a['include']=[{'all':!![]}];}_0x47b88a=_[_0x7ac4('0x35')]({},_0x47b88a,_0x11aab0['options']);return db[_0x7ac4('0x40')][_0x7ac4('0x42')](_0x47b88a)[_0x7ac4('0x20')](handleEntityNotFound(_0x26adf9,null))[_0x7ac4('0x20')](respondWithResult(_0x26adf9,null))[_0x7ac4('0x3d')](handleError(_0x26adf9,null));};exports[_0x7ac4('0x43')]=function(_0x1834a3,_0x165af1){return db[_0x7ac4('0x40')][_0x7ac4('0x43')](_0x1834a3[_0x7ac4('0x44')],{})[_0x7ac4('0x20')](respondWithResult(_0x165af1,0xc9))[_0x7ac4('0x3d')](handleError(_0x165af1,null));};exports[_0x7ac4('0x1f')]=function(_0x3f4823,_0x31c081){if(_0x3f4823[_0x7ac4('0x44')]['id']){delete _0x3f4823[_0x7ac4('0x44')]['id'];}return db[_0x7ac4('0x40')][_0x7ac4('0x42')]({'where':{'id':_0x3f4823[_0x7ac4('0x3f')]['id']}})[_0x7ac4('0x20')](handleEntityNotFound(_0x31c081,null))[_0x7ac4('0x20')](saveUpdates(_0x3f4823[_0x7ac4('0x44')],null))[_0x7ac4('0x20')](respondWithResult(_0x31c081,null))['catch'](handleError(_0x31c081,null));};exports[_0x7ac4('0x21')]=function(_0x28c269,_0x29167f){return db['SalesforceConfiguration'][_0x7ac4('0x42')]({'where':{'id':_0x28c269[_0x7ac4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29167f,null))[_0x7ac4('0x20')](removeEntity(_0x29167f,null))[_0x7ac4('0x3d')](handleError(_0x29167f,null));};exports[_0x7ac4('0x45')]=function(_0x5c76a0,_0xe31b20,_0x12e235){var _0x3aed85={};var _0x389198={};var _0xfff280;var _0x8d94bf;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5c76a0[_0x7ac4('0x3f')]['id']}})[_0x7ac4('0x20')](handleEntityNotFound(_0xe31b20,null))[_0x7ac4('0x20')](function(_0x346e5f){if(_0x346e5f){_0xfff280=_0x346e5f;_0x389198[_0x7ac4('0x2b')]=_[_0x7ac4('0x41')](db['SalesforceField'][_0x7ac4('0x28')]);_0x389198[_0x7ac4('0x2c')]=_['keys'](_0x5c76a0['query']);_0x389198[_0x7ac4('0x2d')]=_[_0x7ac4('0x2e')](_0x389198['model'],_0x389198['query']);_0x3aed85[_0x7ac4('0x2f')]=_[_0x7ac4('0x2e')](_0x389198['model'],qs[_0x7ac4('0x30')](_0x5c76a0[_0x7ac4('0x2c')]['fields']));_0x3aed85[_0x7ac4('0x2f')]=_0x3aed85[_0x7ac4('0x2f')][_0x7ac4('0x31')]?_0x3aed85[_0x7ac4('0x2f')]:_0x389198[_0x7ac4('0x2b')];_0x3aed85['order']=qs[_0x7ac4('0x33')](_0x5c76a0['query'][_0x7ac4('0x33')]);_0x3aed85['where']=qs[_0x7ac4('0x2d')](_['pick'](_0x5c76a0[_0x7ac4('0x2c')],_0x389198[_0x7ac4('0x2d')]));if(_0x5c76a0['query']['filter']){_0x3aed85[_0x7ac4('0x34')]=_[_0x7ac4('0x35')](_0x3aed85[_0x7ac4('0x34')],{'$or':_[_0x7ac4('0x27')](_0x3aed85[_0x7ac4('0x2f')],function(_0xd1e269){var _0x23c304={};_0x23c304[_0xd1e269]={'$like':'%'+_0x5c76a0[_0x7ac4('0x2c')][_0x7ac4('0x38')]+'%'};return _0x23c304;})});}_0x3aed85=_[_0x7ac4('0x35')]({},_0x3aed85,_0x5c76a0[_0x7ac4('0x39')]);return _0xfff280[_0x7ac4('0x45')](_0x3aed85);}})['then'](function(_0x1d1896){if(_0x1d1896){_0x8d94bf=_0x1d1896[_0x7ac4('0x31')];if(!_0x5c76a0[_0x7ac4('0x2c')]['hasOwnProperty'](_0x7ac4('0x46'))){_0x3aed85[_0x7ac4('0x19')]=qs[_0x7ac4('0x19')](_0x5c76a0[_0x7ac4('0x2c')][_0x7ac4('0x19')]);_0x3aed85['offset']=qs[_0x7ac4('0x17')](_0x5c76a0[_0x7ac4('0x2c')][_0x7ac4('0x17')]);}return _0xfff280[_0x7ac4('0x45')](_0x3aed85);}})[_0x7ac4('0x20')](function(_0x5e499b){if(_0x5e499b){return _0x5e499b?{'count':_0x8d94bf,'rows':_0x5e499b}:null;}})[_0x7ac4('0x20')](respondWithResult(_0xe31b20,null))['catch'](handleError(_0xe31b20,null));};exports[_0x7ac4('0x47')]=function(_0x41b9ca,_0x13d204,_0x2b25e3){var _0x2b3e40={};var _0x3eda41={};var _0x58261e;var _0x4efca3;return db[_0x7ac4('0x40')][_0x7ac4('0x48')]({'where':{'id':_0x41b9ca[_0x7ac4('0x3f')]['id']}})[_0x7ac4('0x20')](handleEntityNotFound(_0x13d204,null))['then'](function(_0x46e6b8){if(_0x46e6b8){_0x58261e=_0x46e6b8;_0x3eda41['model']=_[_0x7ac4('0x41')](db[_0x7ac4('0x49')][_0x7ac4('0x28')]);_0x3eda41[_0x7ac4('0x2c')]=_[_0x7ac4('0x41')](_0x41b9ca['query']);_0x3eda41[_0x7ac4('0x2d')]=_[_0x7ac4('0x2e')](_0x3eda41[_0x7ac4('0x2b')],_0x3eda41['query']);_0x2b3e40[_0x7ac4('0x2f')]=_[_0x7ac4('0x2e')](_0x3eda41[_0x7ac4('0x2b')],qs[_0x7ac4('0x30')](_0x41b9ca[_0x7ac4('0x2c')][_0x7ac4('0x30')]));_0x2b3e40['attributes']=_0x2b3e40[_0x7ac4('0x2f')][_0x7ac4('0x31')]?_0x2b3e40[_0x7ac4('0x2f')]:_0x3eda41[_0x7ac4('0x2b')];_0x2b3e40['order']=qs[_0x7ac4('0x33')](_0x41b9ca[_0x7ac4('0x2c')][_0x7ac4('0x33')]);_0x2b3e40[_0x7ac4('0x34')]=qs[_0x7ac4('0x2d')](_['pick'](_0x41b9ca[_0x7ac4('0x2c')],_0x3eda41[_0x7ac4('0x2d')]));if(_0x41b9ca['query'][_0x7ac4('0x38')]){_0x2b3e40[_0x7ac4('0x34')]=_[_0x7ac4('0x35')](_0x2b3e40[_0x7ac4('0x34')],{'$or':_[_0x7ac4('0x27')](_0x2b3e40[_0x7ac4('0x2f')],function(_0x1be135){var _0x2d129b={};_0x2d129b[_0x1be135]={'$like':'%'+_0x41b9ca[_0x7ac4('0x2c')][_0x7ac4('0x38')]+'%'};return _0x2d129b;})});}_0x2b3e40=_[_0x7ac4('0x35')]({},_0x2b3e40,_0x41b9ca['options']);return _0x58261e[_0x7ac4('0x47')](_0x2b3e40);}})['then'](function(_0x1b0c7a){if(_0x1b0c7a){_0x4efca3=_0x1b0c7a[_0x7ac4('0x31')];if(!_0x41b9ca[_0x7ac4('0x2c')]['hasOwnProperty'](_0x7ac4('0x46'))){_0x2b3e40[_0x7ac4('0x19')]=qs[_0x7ac4('0x19')](_0x41b9ca[_0x7ac4('0x2c')]['limit']);_0x2b3e40[_0x7ac4('0x17')]=qs[_0x7ac4('0x17')](_0x41b9ca[_0x7ac4('0x2c')][_0x7ac4('0x17')]);}return _0x58261e[_0x7ac4('0x47')](_0x2b3e40);}})[_0x7ac4('0x20')](function(_0x57deaf){if(_0x57deaf){return _0x57deaf?{'count':_0x4efca3,'rows':_0x57deaf}:null;}})[_0x7ac4('0x20')](respondWithResult(_0x13d204,null))[_0x7ac4('0x3d')](handleError(_0x13d204,null));};exports['getDescriptions']=function(_0x57228e,_0x13da0f,_0x332169){var _0x23d987={};var _0x20d0a4={};var _0x4b83cb;var _0x586f9d;return db[_0x7ac4('0x40')]['findOne']({'where':{'id':_0x57228e[_0x7ac4('0x3f')]['id']}})[_0x7ac4('0x20')](handleEntityNotFound(_0x13da0f,null))['then'](function(_0x12f196){if(_0x12f196){_0x4b83cb=_0x12f196;_0x20d0a4[_0x7ac4('0x2b')]=_[_0x7ac4('0x41')](db[_0x7ac4('0x49')]['rawAttributes']);_0x20d0a4[_0x7ac4('0x2c')]=_[_0x7ac4('0x41')](_0x57228e[_0x7ac4('0x2c')]);_0x20d0a4[_0x7ac4('0x2d')]=_[_0x7ac4('0x2e')](_0x20d0a4['model'],_0x20d0a4[_0x7ac4('0x2c')]);_0x23d987['attributes']=_[_0x7ac4('0x2e')](_0x20d0a4[_0x7ac4('0x2b')],qs[_0x7ac4('0x30')](_0x57228e[_0x7ac4('0x2c')][_0x7ac4('0x30')]));_0x23d987[_0x7ac4('0x2f')]=_0x23d987[_0x7ac4('0x2f')][_0x7ac4('0x31')]?_0x23d987[_0x7ac4('0x2f')]:_0x20d0a4[_0x7ac4('0x2b')];_0x23d987[_0x7ac4('0x4a')]=qs[_0x7ac4('0x33')](_0x57228e[_0x7ac4('0x2c')][_0x7ac4('0x33')]);_0x23d987[_0x7ac4('0x34')]=qs[_0x7ac4('0x2d')](_['pick'](_0x57228e[_0x7ac4('0x2c')],_0x20d0a4[_0x7ac4('0x2d')]));if(_0x57228e['query']['filter']){_0x23d987[_0x7ac4('0x34')]=_[_0x7ac4('0x35')](_0x23d987[_0x7ac4('0x34')],{'$or':_[_0x7ac4('0x27')](_0x23d987['attributes'],function(_0x5cfb7b){var _0x487747={};_0x487747[_0x5cfb7b]={'$like':'%'+_0x57228e[_0x7ac4('0x2c')]['filter']+'%'};return _0x487747;})});}_0x23d987=_[_0x7ac4('0x35')]({},_0x23d987,_0x57228e[_0x7ac4('0x39')]);return _0x4b83cb[_0x7ac4('0x4b')](_0x23d987);}})[_0x7ac4('0x20')](function(_0x541036){if(_0x541036){_0x586f9d=_0x541036[_0x7ac4('0x31')];if(!_0x57228e[_0x7ac4('0x2c')][_0x7ac4('0x32')](_0x7ac4('0x46'))){_0x23d987[_0x7ac4('0x19')]=qs[_0x7ac4('0x19')](_0x57228e[_0x7ac4('0x2c')][_0x7ac4('0x19')]);_0x23d987[_0x7ac4('0x17')]=qs['offset'](_0x57228e[_0x7ac4('0x2c')]['offset']);}return _0x4b83cb[_0x7ac4('0x4b')](_0x23d987);}})[_0x7ac4('0x20')](function(_0x365e97){if(_0x365e97){return _0x365e97?{'count':_0x586f9d,'rows':_0x365e97}:null;}})[_0x7ac4('0x20')](respondWithResult(_0x13da0f,null))[_0x7ac4('0x3d')](handleError(_0x13da0f,null));}; \ No newline at end of file +var _0xb607=['model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','SalesforceField','getFields','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','filters','attributes','intersection'];(function(_0x4cb068,_0x2076a6){var _0x55dbc0=function(_0x7935ea){while(--_0x7935ea){_0x4cb068['push'](_0x4cb068['shift']());}};_0x55dbc0(++_0x2076a6);}(_0xb607,0x1bc));var _0x7b60=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xb607[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x7b60('0x0'));var rimraf=require(_0x7b60('0x1'));var zipdir=require(_0x7b60('0x2'));var jsonpatch=require(_0x7b60('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b60('0x4'));var util=require(_0x7b60('0x5'));var path=require(_0x7b60('0x6'));var sox=require(_0x7b60('0x7'));var csv=require(_0x7b60('0x8'));var ejs=require(_0x7b60('0x9'));var fs=require('fs');var fs_extra=require(_0x7b60('0xa'));var _=require(_0x7b60('0xb'));var squel=require(_0x7b60('0xc'));var crypto=require(_0x7b60('0xd'));var jsforce=require(_0x7b60('0xe'));var deskjs=require(_0x7b60('0xf'));var toCsv=require(_0x7b60('0x8'));var querystring=require(_0x7b60('0x10'));var Papa=require(_0x7b60('0x11'));var Redis=require(_0x7b60('0x12'));var authService=require(_0x7b60('0x13'));var qs=require(_0x7b60('0x14'));var as=require(_0x7b60('0x15'));var hardwareService=require(_0x7b60('0x16'));var logger=require(_0x7b60('0x17'))(_0x7b60('0x18'));var utils=require(_0x7b60('0x19'));var config=require(_0x7b60('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b60('0x1b'))['db'];function respondWithStatusCode(_0x120155,_0x521b2c){_0x521b2c=_0x521b2c||0xcc;return function(_0x49e5f7){if(_0x49e5f7){return _0x120155[_0x7b60('0x1c')](_0x521b2c);}return _0x120155[_0x7b60('0x1d')](_0x521b2c)[_0x7b60('0x1e')]();};}function respondWithResult(_0xeb2d97,_0x3438bc){_0x3438bc=_0x3438bc||0xc8;return function(_0x3c4159){if(_0x3c4159){return _0xeb2d97['status'](_0x3438bc)['json'](_0x3c4159);}};}function respondWithFilteredResult(_0x1e2952,_0x55d78d){return function(_0x221265){if(_0x221265){var _0x1b8718=typeof _0x55d78d[_0x7b60('0x1f')]===_0x7b60('0x20')&&typeof _0x55d78d[_0x7b60('0x21')]==='undefined';var _0x2e624a=_0x221265['count'];var _0x51bd4c=_0x1b8718?0x0:_0x55d78d[_0x7b60('0x1f')];var _0x24bf53=_0x1b8718?_0x221265[_0x7b60('0x22')]:_0x55d78d['offset']+_0x55d78d[_0x7b60('0x21')];var _0x31b737;if(_0x24bf53>=_0x2e624a){_0x24bf53=_0x2e624a;_0x31b737=0xc8;}else{_0x31b737=0xce;}_0x1e2952['status'](_0x31b737);return _0x1e2952[_0x7b60('0x23')]('Content-Range',_0x51bd4c+'-'+_0x24bf53+'/'+_0x2e624a)[_0x7b60('0x24')](_0x221265);}return null;};}function patchUpdates(_0x1b6f67){return function(_0x37a6da){try{jsonpatch[_0x7b60('0x25')](_0x37a6da,_0x1b6f67,!![]);}catch(_0x5f644a){return BPromise['reject'](_0x5f644a);}return _0x37a6da[_0x7b60('0x26')]();};}function saveUpdates(_0x59e948,_0x4a54d5){return function(_0x40d12d){if(_0x40d12d){return _0x40d12d[_0x7b60('0x27')](_0x59e948)['then'](function(_0x37cf44){return _0x37cf44;});}return null;};}function removeEntity(_0x4247ba,_0x101a4e){return function(_0x3a59e5){if(_0x3a59e5){return _0x3a59e5[_0x7b60('0x28')]()[_0x7b60('0x29')](function(){_0x4247ba[_0x7b60('0x1d')](0xcc)[_0x7b60('0x1e')]();});}};}function handleEntityNotFound(_0x340101,_0x43d883){return function(_0x24bdfb){if(!_0x24bdfb){_0x340101[_0x7b60('0x1c')](0x194);}return _0x24bdfb;};}function handleError(_0x4e3248,_0x53e239){_0x53e239=_0x53e239||0x1f4;return function(_0x4cc7e4){logger['error'](_0x4cc7e4[_0x7b60('0x2a')]);if(_0x4cc7e4[_0x7b60('0x2b')]){delete _0x4cc7e4[_0x7b60('0x2b')];}_0x4e3248[_0x7b60('0x1d')](_0x53e239)['send'](_0x4cc7e4);};}exports[_0x7b60('0x2c')]=function(_0x15b5fd,_0x41a822){var _0xd4e21c={},_0x2a8f9f={},_0x499f22={'count':0x0,'rows':[]};var _0x3fba6b=_[_0x7b60('0x2d')](db[_0x7b60('0x2e')][_0x7b60('0x2f')],function(_0x1c9bec){return{'name':_0x1c9bec[_0x7b60('0x30')],'type':_0x1c9bec[_0x7b60('0x31')]['key']};});_0x2a8f9f['model']=_['map'](_0x3fba6b,_0x7b60('0x2b'));_0x2a8f9f[_0x7b60('0x32')]=_['keys'](_0x15b5fd[_0x7b60('0x32')]);_0x2a8f9f[_0x7b60('0x33')]=_['intersection'](_0x2a8f9f['model'],_0x2a8f9f['query']);_0xd4e21c[_0x7b60('0x34')]=_[_0x7b60('0x35')](_0x2a8f9f[_0x7b60('0x36')],qs[_0x7b60('0x37')](_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x37')]));_0xd4e21c[_0x7b60('0x34')]=_0xd4e21c[_0x7b60('0x34')]['length']?_0xd4e21c[_0x7b60('0x34')]:_0x2a8f9f[_0x7b60('0x36')];if(!_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x38')](_0x7b60('0x39'))){_0xd4e21c[_0x7b60('0x21')]=qs[_0x7b60('0x21')](_0x15b5fd['query']['limit']);_0xd4e21c[_0x7b60('0x1f')]=qs[_0x7b60('0x1f')](_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x1f')]);}_0xd4e21c[_0x7b60('0x3a')]=qs[_0x7b60('0x3b')](_0x15b5fd['query']['sort']);_0xd4e21c[_0x7b60('0x3c')]=qs[_0x7b60('0x33')](_[_0x7b60('0x3d')](_0x15b5fd[_0x7b60('0x32')],_0x2a8f9f[_0x7b60('0x33')]),_0x3fba6b);if(_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x3e')]){_0xd4e21c[_0x7b60('0x3c')]=_[_0x7b60('0x3f')](_0xd4e21c[_0x7b60('0x3c')],{'$or':_['map'](_0x3fba6b,function(_0x364bbc){if(_0x364bbc['type']!==_0x7b60('0x40')){var _0x2cbb0b={};_0x2cbb0b[_0x364bbc[_0x7b60('0x2b')]]={'$like':'%'+_0x15b5fd['query'][_0x7b60('0x3e')]+'%'};return _0x2cbb0b;}})});}_0xd4e21c=_[_0x7b60('0x3f')]({},_0xd4e21c,_0x15b5fd['options']);var _0x4a8fe1={'where':_0xd4e21c[_0x7b60('0x3c')]};return db[_0x7b60('0x2e')]['count'](_0x4a8fe1)[_0x7b60('0x29')](function(_0x4f0080){_0x499f22['count']=_0x4f0080;if(_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x41')]){_0xd4e21c[_0x7b60('0x42')]=[{'all':!![]}];}return db[_0x7b60('0x2e')][_0x7b60('0x43')](_0xd4e21c);})[_0x7b60('0x29')](function(_0x4525d3){_0x499f22[_0x7b60('0x44')]=_0x4525d3;return _0x499f22;})[_0x7b60('0x29')](respondWithFilteredResult(_0x41a822,_0xd4e21c))[_0x7b60('0x45')](handleError(_0x41a822,null));};exports[_0x7b60('0x46')]=function(_0xc86071,_0x3aa007){var _0x53b77f={'raw':![],'where':{'id':_0xc86071[_0x7b60('0x47')]['id']}},_0x379f99={};_0x379f99[_0x7b60('0x36')]=_[_0x7b60('0x48')](db['SalesforceConfiguration'][_0x7b60('0x2f')]);_0x379f99[_0x7b60('0x32')]=_['keys'](_0xc86071[_0x7b60('0x32')]);_0x379f99[_0x7b60('0x33')]=_['intersection'](_0x379f99[_0x7b60('0x36')],_0x379f99[_0x7b60('0x32')]);_0x53b77f[_0x7b60('0x34')]=_[_0x7b60('0x35')](_0x379f99['model'],qs[_0x7b60('0x37')](_0xc86071[_0x7b60('0x32')][_0x7b60('0x37')]));_0x53b77f[_0x7b60('0x34')]=_0x53b77f[_0x7b60('0x34')][_0x7b60('0x49')]?_0x53b77f[_0x7b60('0x34')]:_0x379f99['model'];if(_0xc86071['query'][_0x7b60('0x41')]){_0x53b77f['include']=[{'all':!![]}];}_0x53b77f=_[_0x7b60('0x3f')]({},_0x53b77f,_0xc86071[_0x7b60('0x4a')]);return db[_0x7b60('0x2e')]['find'](_0x53b77f)[_0x7b60('0x29')](handleEntityNotFound(_0x3aa007,null))[_0x7b60('0x29')](respondWithResult(_0x3aa007,null))['catch'](handleError(_0x3aa007,null));};exports[_0x7b60('0x4b')]=function(_0x437797,_0x4d7431){return db[_0x7b60('0x2e')][_0x7b60('0x4b')](_0x437797[_0x7b60('0x4c')],{})[_0x7b60('0x29')](respondWithResult(_0x4d7431,0xc9))[_0x7b60('0x45')](handleError(_0x4d7431,null));};exports['update']=function(_0x306d49,_0x5469ff){if(_0x306d49[_0x7b60('0x4c')]['id']){delete _0x306d49['body']['id'];}return db[_0x7b60('0x2e')][_0x7b60('0x4d')]({'where':{'id':_0x306d49[_0x7b60('0x47')]['id']}})['then'](handleEntityNotFound(_0x5469ff,null))[_0x7b60('0x29')](saveUpdates(_0x306d49[_0x7b60('0x4c')],null))['then'](respondWithResult(_0x5469ff,null))[_0x7b60('0x45')](handleError(_0x5469ff,null));};exports[_0x7b60('0x28')]=function(_0x24e181,_0x2f54a9){return db['SalesforceConfiguration'][_0x7b60('0x4d')]({'where':{'id':_0x24e181['params']['id']}})[_0x7b60('0x29')](handleEntityNotFound(_0x2f54a9,null))['then'](removeEntity(_0x2f54a9,null))[_0x7b60('0x45')](handleError(_0x2f54a9,null));};exports['getFields']=function(_0x3cdb8f,_0x51887a,_0x34e0b3){var _0x37cfe4={};var _0x5e3441={};var _0x3cf3b6;var _0x533d53;return db[_0x7b60('0x2e')]['findOne']({'where':{'id':_0x3cdb8f['params']['id']}})[_0x7b60('0x29')](handleEntityNotFound(_0x51887a,null))['then'](function(_0x433174){if(_0x433174){_0x3cf3b6=_0x433174;_0x5e3441[_0x7b60('0x36')]=_[_0x7b60('0x48')](db[_0x7b60('0x4e')][_0x7b60('0x2f')]);_0x5e3441[_0x7b60('0x32')]=_[_0x7b60('0x48')](_0x3cdb8f['query']);_0x5e3441[_0x7b60('0x33')]=_[_0x7b60('0x35')](_0x5e3441[_0x7b60('0x36')],_0x5e3441['query']);_0x37cfe4[_0x7b60('0x34')]=_[_0x7b60('0x35')](_0x5e3441[_0x7b60('0x36')],qs[_0x7b60('0x37')](_0x3cdb8f['query']['fields']));_0x37cfe4[_0x7b60('0x34')]=_0x37cfe4[_0x7b60('0x34')][_0x7b60('0x49')]?_0x37cfe4['attributes']:_0x5e3441[_0x7b60('0x36')];_0x37cfe4[_0x7b60('0x3a')]=qs[_0x7b60('0x3b')](_0x3cdb8f[_0x7b60('0x32')][_0x7b60('0x3b')]);_0x37cfe4[_0x7b60('0x3c')]=qs[_0x7b60('0x33')](_[_0x7b60('0x3d')](_0x3cdb8f[_0x7b60('0x32')],_0x5e3441[_0x7b60('0x33')]));if(_0x3cdb8f[_0x7b60('0x32')][_0x7b60('0x3e')]){_0x37cfe4[_0x7b60('0x3c')]=_[_0x7b60('0x3f')](_0x37cfe4[_0x7b60('0x3c')],{'$or':_[_0x7b60('0x2d')](_0x37cfe4[_0x7b60('0x34')],function(_0x403a56){var _0x473d86={};_0x473d86[_0x403a56]={'$like':'%'+_0x3cdb8f[_0x7b60('0x32')][_0x7b60('0x3e')]+'%'};return _0x473d86;})});}_0x37cfe4=_[_0x7b60('0x3f')]({},_0x37cfe4,_0x3cdb8f[_0x7b60('0x4a')]);return _0x3cf3b6['getFields'](_0x37cfe4);}})[_0x7b60('0x29')](function(_0x45ce8b){if(_0x45ce8b){_0x533d53=_0x45ce8b[_0x7b60('0x49')];if(!_0x3cdb8f[_0x7b60('0x32')][_0x7b60('0x38')](_0x7b60('0x39'))){_0x37cfe4[_0x7b60('0x21')]=qs[_0x7b60('0x21')](_0x3cdb8f['query'][_0x7b60('0x21')]);_0x37cfe4[_0x7b60('0x1f')]=qs[_0x7b60('0x1f')](_0x3cdb8f[_0x7b60('0x32')][_0x7b60('0x1f')]);}return _0x3cf3b6[_0x7b60('0x4f')](_0x37cfe4);}})[_0x7b60('0x29')](function(_0x4fbea4){if(_0x4fbea4){return _0x4fbea4?{'count':_0x533d53,'rows':_0x4fbea4}:null;}})[_0x7b60('0x29')](respondWithResult(_0x51887a,null))[_0x7b60('0x45')](handleError(_0x51887a,null));};exports['getSubjects']=function(_0x32ad97,_0x41b372,_0x205272){var _0x40eae0={};var _0x3d6d2f={};var _0x42e127;var _0x3c4a8;return db[_0x7b60('0x2e')][_0x7b60('0x50')]({'where':{'id':_0x32ad97[_0x7b60('0x47')]['id']}})[_0x7b60('0x29')](handleEntityNotFound(_0x41b372,null))[_0x7b60('0x29')](function(_0x1d7b7f){if(_0x1d7b7f){_0x42e127=_0x1d7b7f;_0x3d6d2f[_0x7b60('0x36')]=_[_0x7b60('0x48')](db['SalesforceField'][_0x7b60('0x2f')]);_0x3d6d2f[_0x7b60('0x32')]=_[_0x7b60('0x48')](_0x32ad97[_0x7b60('0x32')]);_0x3d6d2f[_0x7b60('0x33')]=_[_0x7b60('0x35')](_0x3d6d2f['model'],_0x3d6d2f[_0x7b60('0x32')]);_0x40eae0[_0x7b60('0x34')]=_[_0x7b60('0x35')](_0x3d6d2f['model'],qs[_0x7b60('0x37')](_0x32ad97[_0x7b60('0x32')][_0x7b60('0x37')]));_0x40eae0[_0x7b60('0x34')]=_0x40eae0['attributes'][_0x7b60('0x49')]?_0x40eae0['attributes']:_0x3d6d2f[_0x7b60('0x36')];_0x40eae0[_0x7b60('0x3a')]=qs['sort'](_0x32ad97[_0x7b60('0x32')]['sort']);_0x40eae0[_0x7b60('0x3c')]=qs[_0x7b60('0x33')](_[_0x7b60('0x3d')](_0x32ad97[_0x7b60('0x32')],_0x3d6d2f[_0x7b60('0x33')]));if(_0x32ad97[_0x7b60('0x32')][_0x7b60('0x3e')]){_0x40eae0[_0x7b60('0x3c')]=_[_0x7b60('0x3f')](_0x40eae0[_0x7b60('0x3c')],{'$or':_['map'](_0x40eae0['attributes'],function(_0x36a424){var _0x8ca629={};_0x8ca629[_0x36a424]={'$like':'%'+_0x32ad97['query'][_0x7b60('0x3e')]+'%'};return _0x8ca629;})});}_0x40eae0=_[_0x7b60('0x3f')]({},_0x40eae0,_0x32ad97[_0x7b60('0x4a')]);return _0x42e127[_0x7b60('0x51')](_0x40eae0);}})[_0x7b60('0x29')](function(_0x55c923){if(_0x55c923){_0x3c4a8=_0x55c923[_0x7b60('0x49')];if(!_0x32ad97['query'][_0x7b60('0x38')](_0x7b60('0x39'))){_0x40eae0[_0x7b60('0x21')]=qs['limit'](_0x32ad97[_0x7b60('0x32')][_0x7b60('0x21')]);_0x40eae0[_0x7b60('0x1f')]=qs[_0x7b60('0x1f')](_0x32ad97['query'][_0x7b60('0x1f')]);}return _0x42e127[_0x7b60('0x51')](_0x40eae0);}})[_0x7b60('0x29')](function(_0x5f0b51){if(_0x5f0b51){return _0x5f0b51?{'count':_0x3c4a8,'rows':_0x5f0b51}:null;}})[_0x7b60('0x29')](respondWithResult(_0x41b372,null))['catch'](handleError(_0x41b372,null));};exports[_0x7b60('0x52')]=function(_0x57c504,_0x316e2c,_0x22e7bb){var _0x4a40a9={};var _0x246b3d={};var _0x480c99;var _0x4fa90c;return db['SalesforceConfiguration'][_0x7b60('0x50')]({'where':{'id':_0x57c504[_0x7b60('0x47')]['id']}})[_0x7b60('0x29')](handleEntityNotFound(_0x316e2c,null))[_0x7b60('0x29')](function(_0x1b4bd5){if(_0x1b4bd5){_0x480c99=_0x1b4bd5;_0x246b3d[_0x7b60('0x36')]=_[_0x7b60('0x48')](db['SalesforceField'][_0x7b60('0x2f')]);_0x246b3d[_0x7b60('0x32')]=_[_0x7b60('0x48')](_0x57c504[_0x7b60('0x32')]);_0x246b3d[_0x7b60('0x33')]=_[_0x7b60('0x35')](_0x246b3d[_0x7b60('0x36')],_0x246b3d['query']);_0x4a40a9['attributes']=_[_0x7b60('0x35')](_0x246b3d[_0x7b60('0x36')],qs[_0x7b60('0x37')](_0x57c504[_0x7b60('0x32')][_0x7b60('0x37')]));_0x4a40a9[_0x7b60('0x34')]=_0x4a40a9[_0x7b60('0x34')][_0x7b60('0x49')]?_0x4a40a9['attributes']:_0x246b3d[_0x7b60('0x36')];_0x4a40a9[_0x7b60('0x3a')]=qs[_0x7b60('0x3b')](_0x57c504[_0x7b60('0x32')]['sort']);_0x4a40a9[_0x7b60('0x3c')]=qs[_0x7b60('0x33')](_[_0x7b60('0x3d')](_0x57c504[_0x7b60('0x32')],_0x246b3d[_0x7b60('0x33')]));if(_0x57c504[_0x7b60('0x32')][_0x7b60('0x3e')]){_0x4a40a9[_0x7b60('0x3c')]=_['merge'](_0x4a40a9[_0x7b60('0x3c')],{'$or':_[_0x7b60('0x2d')](_0x4a40a9[_0x7b60('0x34')],function(_0x4acbbf){var _0x208367={};_0x208367[_0x4acbbf]={'$like':'%'+_0x57c504[_0x7b60('0x32')][_0x7b60('0x3e')]+'%'};return _0x208367;})});}_0x4a40a9=_[_0x7b60('0x3f')]({},_0x4a40a9,_0x57c504[_0x7b60('0x4a')]);return _0x480c99[_0x7b60('0x52')](_0x4a40a9);}})[_0x7b60('0x29')](function(_0x9885d8){if(_0x9885d8){_0x4fa90c=_0x9885d8[_0x7b60('0x49')];if(!_0x57c504[_0x7b60('0x32')]['hasOwnProperty']('nolimit')){_0x4a40a9[_0x7b60('0x21')]=qs[_0x7b60('0x21')](_0x57c504[_0x7b60('0x32')][_0x7b60('0x21')]);_0x4a40a9[_0x7b60('0x1f')]=qs[_0x7b60('0x1f')](_0x57c504[_0x7b60('0x32')][_0x7b60('0x1f')]);}return _0x480c99['getDescriptions'](_0x4a40a9);}})[_0x7b60('0x29')](function(_0xbe13e9){if(_0xbe13e9){return _0xbe13e9?{'count':_0x4fa90c,'rows':_0xbe13e9}:null;}})[_0x7b60('0x29')](respondWithResult(_0x316e2c,null))[_0x7b60('0x45')](handleError(_0x316e2c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c1d9bdd..a3749ed 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecc1=['path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0xecc1,0x65));var _0x1ecc=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xecc1[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x1ecc('0x0'));var util=require(_0x1ecc('0x1'));var logger=require(_0x1ecc('0x2'))(_0x1ecc('0x3'));var moment=require(_0x1ecc('0x4'));var BPromise=require(_0x1ecc('0x5'));var rp=require(_0x1ecc('0x6'));var fs=require('fs');var path=require(_0x1ecc('0x7'));var rimraf=require(_0x1ecc('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ecc('0x9'));module[_0x1ecc('0xa')]=function(_0x3eb83e,_0x183f0b){return _0x3eb83e['define'](_0x1ecc('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2668=['request-promise','path','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','bluebird'];(function(_0x220a8f,_0x1d0f5f){var _0x361531=function(_0x15a640){while(--_0x15a640){_0x220a8f['push'](_0x220a8f['shift']());}};_0x361531(++_0x1d0f5f);}(_0x2668,0x1d9));var _0x8266=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2668[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x8266('0x0'));var util=require('util');var logger=require(_0x8266('0x1'))(_0x8266('0x2'));var moment=require('moment');var BPromise=require(_0x8266('0x3'));var rp=require(_0x8266('0x4'));var fs=require('fs');var path=require(_0x8266('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x8266('0x6')]=function(_0x954e38,_0x47832d){return _0x954e38['define'](_0x8266('0x7'),attributes,{'tableName':_0x8266('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 65a4866..c148e25 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb0f=['../../config/environment','jayson/promise','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x1f417c,_0x39d379){var _0x3f6d49=function(_0x43897c){while(--_0x43897c){_0x1f417c['push'](_0x1f417c['shift']());}};_0x3f6d49(++_0x39d379);}(_0xfb0f,0x151));var _0xffb0=function(_0x480e41,_0x51caae){_0x480e41=_0x480e41-0x0;var _0x1a1c52=_0xfb0f[_0x480e41];return _0x1a1c52;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xffb0('0x0'));var rs=require(_0xffb0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffb0('0x2'))['db'];var utils=require(_0xffb0('0x3'));var logger=require('../../config/logger')(_0xffb0('0x4'));var config=require(_0xffb0('0x5'));var jayson=require(_0xffb0('0x6'));var client=jayson[_0xffb0('0x7')][_0xffb0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e1583,_0xeb0aac,_0x5a2664){return new BPromise(function(_0x20568f,_0x266cac){return client['request'](_0x4e1583,_0x5a2664)['then'](function(_0x938b4c){logger[_0xffb0('0x9')](_0xffb0('0xa'),_0xeb0aac,_0xffb0('0xb'));logger['debug'](_0xffb0('0xc'),_0xeb0aac,_0xffb0('0xb'),JSON[_0xffb0('0xd')](_0x938b4c));if(_0x938b4c['error']){if(_0x938b4c[_0xffb0('0xe')][_0xffb0('0xf')]===0x1f4){logger[_0xffb0('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeb0aac,_0x938b4c['error'][_0xffb0('0x10')]);return _0x266cac(_0x938b4c[_0xffb0('0xe')]['message']);}logger[_0xffb0('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeb0aac,_0x938b4c[_0xffb0('0xe')]['message']);return _0x20568f(_0x938b4c[_0xffb0('0xe')][_0xffb0('0x10')]);}else{logger[_0xffb0('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0xeb0aac,_0xffb0('0xb'));_0x20568f(_0x938b4c[_0xffb0('0x11')][_0xffb0('0x10')]);}})[_0xffb0('0x12')](function(_0x286f07){logger[_0xffb0('0xe')](_0xffb0('0xa'),_0xeb0aac,_0x286f07);_0x266cac(_0x286f07);});});} \ No newline at end of file +var _0x6518=['request','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x6518,0x173));var _0x8651=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x6518[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x8651('0x0'));var util=require(_0x8651('0x1'));var moment=require('moment');var BPromise=require(_0x8651('0x2'));var rs=require(_0x8651('0x3'));var fs=require('fs');var Redis=require(_0x8651('0x4'));var db=require(_0x8651('0x5'))['db'];var utils=require(_0x8651('0x6'));var logger=require('../../config/logger')(_0x8651('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8651('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2373a3,_0x419c47,_0x3bd2a1){return new BPromise(function(_0x28270b,_0x29ae36){return client[_0x8651('0x9')](_0x2373a3,_0x3bd2a1)['then'](function(_0x5262ee){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x419c47,'request\x20sent');logger[_0x8651('0xa')](_0x8651('0xb'),_0x419c47,_0x8651('0xc'),JSON['stringify'](_0x5262ee));if(_0x5262ee[_0x8651('0xd')]){if(_0x5262ee['error'][_0x8651('0xe')]===0x1f4){logger[_0x8651('0xd')](_0x8651('0xf'),_0x419c47,_0x5262ee[_0x8651('0xd')][_0x8651('0x10')]);return _0x29ae36(_0x5262ee[_0x8651('0xd')][_0x8651('0x10')]);}logger['error'](_0x8651('0xf'),_0x419c47,_0x5262ee[_0x8651('0xd')][_0x8651('0x10')]);return _0x28270b(_0x5262ee[_0x8651('0xd')]['message']);}else{logger[_0x8651('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x419c47,_0x8651('0xc'));_0x28270b(_0x5262ee[_0x8651('0x12')][_0x8651('0x10')]);}})[_0x8651('0x13')](function(_0x3be551){logger[_0x8651('0xd')](_0x8651('0xf'),_0x419c47,_0x3be551);_0x29ae36(_0x3be551);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 89a4d77..feb0b7b 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6221=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x6221,0xe8));var _0x1622=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x6221[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x1622('0x0'));var util=require(_0x1622('0x1'));var path=require(_0x1622('0x2'));var timeout=require(_0x1622('0x3'));var express=require(_0x1622('0x4'));var router=express[_0x1622('0x5')]();var fs_extra=require(_0x1622('0x6'));var auth=require(_0x1622('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1622('0x8'));router[_0x1622('0x9')]('/',auth[_0x1622('0xa')](),controller[_0x1622('0xb')]);router[_0x1622('0x9')](_0x1622('0xc'),auth[_0x1622('0xa')](),controller[_0x1622('0xd')]);router[_0x1622('0xe')]('/',auth[_0x1622('0xa')](),controller[_0x1622('0xf')]);router['put'](_0x1622('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1622('0x10')](_0x1622('0xc'),auth[_0x1622('0xa')](),controller[_0x1622('0x11')]);module[_0x1622('0x12')]=router; \ No newline at end of file +var _0x66b9=['./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x259c59,_0x56c41d){var _0x360f54=function(_0x4fab82){while(--_0x4fab82){_0x259c59['push'](_0x259c59['shift']());}};_0x360f54(++_0x56c41d);}(_0x66b9,0x106));var _0x966b=function(_0x2face5,_0x25e869){_0x2face5=_0x2face5-0x0;var _0x34d24e=_0x66b9[_0x2face5];return _0x34d24e;};'use strict';var multer=require(_0x966b('0x0'));var util=require(_0x966b('0x1'));var path=require('path');var timeout=require(_0x966b('0x2'));var express=require(_0x966b('0x3'));var router=express['Router']();var fs_extra=require(_0x966b('0x4'));var auth=require(_0x966b('0x5'));var interaction=require(_0x966b('0x6'));var config=require(_0x966b('0x7'));var controller=require(_0x966b('0x8'));router[_0x966b('0x9')]('/',auth[_0x966b('0xa')](),controller['index']);router[_0x966b('0x9')](_0x966b('0xb'),auth[_0x966b('0xa')](),controller[_0x966b('0xc')]);router[_0x966b('0xd')]('/',auth[_0x966b('0xa')](),controller[_0x966b('0xe')]);router['put'](_0x966b('0xb'),auth['isAuthenticated'](),controller[_0x966b('0xf')]);router[_0x966b('0x10')](_0x966b('0xb'),auth[_0x966b('0xa')](),controller[_0x966b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 4ff10c0..0875cc0 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84e4=['customVariable','keyValue','picklist','STRING','variable','ENUM','string'];(function(_0x187d72,_0xa3a82){var _0x3b3fea=function(_0x45ee56){while(--_0x45ee56){_0x187d72['push'](_0x187d72['shift']());}};_0x3b3fea(++_0xa3a82);}(_0x84e4,0x67));var _0x484e=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x84e4[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x484e('0x0')](_0x484e('0x1'),'variable',_0x484e('0x2'),_0x484e('0x3'),_0x484e('0x4')),'defaultValue':_0x484e('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x484e('0x5')]},'keyType':{'type':Sequelize[_0x484e('0x0')](_0x484e('0x1'),_0x484e('0x6'),_0x484e('0x2'))},'keyContent':{'type':Sequelize[_0x484e('0x5')]},'idField':{'type':Sequelize[_0x484e('0x5')]},'variableName':{'type':Sequelize[_0x484e('0x5')]}}; \ No newline at end of file +var _0x52d5=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x3f6381,_0x518409){var _0x398bde=function(_0x5591fc){while(--_0x5591fc){_0x3f6381['push'](_0x3f6381['shift']());}};_0x398bde(++_0x518409);}(_0x52d5,0x1a7));var _0x552d=function(_0x26a8f2,_0x11ff88){_0x26a8f2=_0x26a8f2-0x0;var _0x2d24cd=_0x52d5[_0x26a8f2];return _0x2d24cd;};'use strict';var Sequelize=require(_0x552d('0x0'));module[_0x552d('0x1')]={'type':{'type':Sequelize[_0x552d('0x2')](_0x552d('0x3'),_0x552d('0x4'),_0x552d('0x5'),_0x552d('0x6'),'picklist'),'defaultValue':_0x552d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x552d('0x7')]},'keyType':{'type':Sequelize[_0x552d('0x2')](_0x552d('0x3'),'variable',_0x552d('0x5'))},'keyContent':{'type':Sequelize[_0x552d('0x7')]},'idField':{'type':Sequelize[_0x552d('0x7')]},'variableName':{'type':Sequelize[_0x552d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ff6ab54..edeced2 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8a6=['end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','name','send','index','SalesforceField','rawAttributes','type','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8a6,0x102));var _0x6a8a=function(_0x45fcd4,_0x53a13c){_0x45fcd4=_0x45fcd4-0x0;var _0x300a3a=_0xa8a6[_0x45fcd4];return _0x300a3a;};'use strict';var emlformat=require(_0x6a8a('0x0'));var rimraf=require(_0x6a8a('0x1'));var zipdir=require(_0x6a8a('0x2'));var jsonpatch=require(_0x6a8a('0x3'));var rp=require('request-promise');var moment=require(_0x6a8a('0x4'));var BPromise=require(_0x6a8a('0x5'));var Mustache=require(_0x6a8a('0x6'));var util=require(_0x6a8a('0x7'));var path=require(_0x6a8a('0x8'));var sox=require('sox');var csv=require(_0x6a8a('0x9'));var ejs=require(_0x6a8a('0xa'));var fs=require('fs');var fs_extra=require(_0x6a8a('0xb'));var _=require(_0x6a8a('0xc'));var squel=require(_0x6a8a('0xd'));var crypto=require(_0x6a8a('0xe'));var jsforce=require(_0x6a8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6a8a('0x9'));var querystring=require(_0x6a8a('0x10'));var Papa=require(_0x6a8a('0x11'));var Redis=require(_0x6a8a('0x12'));var authService=require(_0x6a8a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a8a('0x14'))(_0x6a8a('0x15'));var utils=require(_0x6a8a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6a8a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4697a3,_0x543522){_0x543522=_0x543522||0xcc;return function(_0xca6282){if(_0xca6282){return _0x4697a3[_0x6a8a('0x18')](_0x543522);}return _0x4697a3[_0x6a8a('0x19')](_0x543522)[_0x6a8a('0x1a')]();};}function respondWithResult(_0x3ee36e,_0x147cea){_0x147cea=_0x147cea||0xc8;return function(_0x47408a){if(_0x47408a){return _0x3ee36e[_0x6a8a('0x19')](_0x147cea)[_0x6a8a('0x1b')](_0x47408a);}};}function respondWithFilteredResult(_0x2bf456,_0xb60a16){return function(_0x18c0a8){if(_0x18c0a8){var _0x2ed603=typeof _0xb60a16['offset']===_0x6a8a('0x1c')&&typeof _0xb60a16[_0x6a8a('0x1d')]===_0x6a8a('0x1c');var _0x31cf20=_0x18c0a8[_0x6a8a('0x1e')];var _0x382545=_0x2ed603?0x0:_0xb60a16[_0x6a8a('0x1f')];var _0x2d85f3=_0x2ed603?_0x18c0a8[_0x6a8a('0x1e')]:_0xb60a16[_0x6a8a('0x1f')]+_0xb60a16[_0x6a8a('0x1d')];var _0x352aaa;if(_0x2d85f3>=_0x31cf20){_0x2d85f3=_0x31cf20;_0x352aaa=0xc8;}else{_0x352aaa=0xce;}_0x2bf456['status'](_0x352aaa);return _0x2bf456[_0x6a8a('0x20')](_0x6a8a('0x21'),_0x382545+'-'+_0x2d85f3+'/'+_0x31cf20)[_0x6a8a('0x1b')](_0x18c0a8);}return null;};}function patchUpdates(_0x48c6a4){return function(_0x53b254){try{jsonpatch['apply'](_0x53b254,_0x48c6a4,!![]);}catch(_0x125983){return BPromise[_0x6a8a('0x22')](_0x125983);}return _0x53b254['save']();};}function saveUpdates(_0x5b2218,_0x93923a){return function(_0x5799f3){if(_0x5799f3){return _0x5799f3[_0x6a8a('0x23')](_0x5b2218)[_0x6a8a('0x24')](function(_0x1afa0f){return _0x1afa0f;});}return null;};}function removeEntity(_0x5e01a2,_0x2d0461){return function(_0x205aa2){if(_0x205aa2){return _0x205aa2[_0x6a8a('0x25')]()[_0x6a8a('0x24')](function(){_0x5e01a2[_0x6a8a('0x19')](0xcc)[_0x6a8a('0x1a')]();});}};}function handleEntityNotFound(_0x178449,_0x1ae1f8){return function(_0x59f45b){if(!_0x59f45b){_0x178449[_0x6a8a('0x18')](0x194);}return _0x59f45b;};}function handleError(_0x39b9b1,_0x4121e7){_0x4121e7=_0x4121e7||0x1f4;return function(_0x2b537b){logger['error'](_0x2b537b['stack']);if(_0x2b537b[_0x6a8a('0x26')]){delete _0x2b537b['name'];}_0x39b9b1[_0x6a8a('0x19')](_0x4121e7)[_0x6a8a('0x27')](_0x2b537b);};}exports[_0x6a8a('0x28')]=function(_0x1d25ad,_0x3f647f){var _0x368eba={},_0x42c6ea={},_0x722dfe={'count':0x0,'rows':[]};var _0x174e85=_['map'](db[_0x6a8a('0x29')][_0x6a8a('0x2a')],function(_0x526c49){return{'name':_0x526c49['fieldName'],'type':_0x526c49[_0x6a8a('0x2b')]['key']};});_0x42c6ea[_0x6a8a('0x2c')]=_['map'](_0x174e85,_0x6a8a('0x26'));_0x42c6ea[_0x6a8a('0x2d')]=_['keys'](_0x1d25ad[_0x6a8a('0x2d')]);_0x42c6ea[_0x6a8a('0x2e')]=_['intersection'](_0x42c6ea[_0x6a8a('0x2c')],_0x42c6ea['query']);_0x368eba[_0x6a8a('0x2f')]=_[_0x6a8a('0x30')](_0x42c6ea[_0x6a8a('0x2c')],qs[_0x6a8a('0x31')](_0x1d25ad[_0x6a8a('0x2d')]['fields']));_0x368eba[_0x6a8a('0x2f')]=_0x368eba[_0x6a8a('0x2f')]['length']?_0x368eba[_0x6a8a('0x2f')]:_0x42c6ea[_0x6a8a('0x2c')];if(!_0x1d25ad['query']['hasOwnProperty'](_0x6a8a('0x32'))){_0x368eba[_0x6a8a('0x1d')]=qs[_0x6a8a('0x1d')](_0x1d25ad['query'][_0x6a8a('0x1d')]);_0x368eba[_0x6a8a('0x1f')]=qs[_0x6a8a('0x1f')](_0x1d25ad[_0x6a8a('0x2d')][_0x6a8a('0x1f')]);}_0x368eba[_0x6a8a('0x33')]=qs[_0x6a8a('0x34')](_0x1d25ad[_0x6a8a('0x2d')]['sort']);_0x368eba[_0x6a8a('0x35')]=qs['filters'](_[_0x6a8a('0x36')](_0x1d25ad[_0x6a8a('0x2d')],_0x42c6ea[_0x6a8a('0x2e')]),_0x174e85);if(_0x1d25ad['query'][_0x6a8a('0x37')]){_0x368eba[_0x6a8a('0x35')]=_[_0x6a8a('0x38')](_0x368eba['where'],{'$or':_[_0x6a8a('0x39')](_0x174e85,function(_0x1ba5e5){if(_0x1ba5e5['type']!==_0x6a8a('0x3a')){var _0x375431={};_0x375431[_0x1ba5e5[_0x6a8a('0x26')]]={'$like':'%'+_0x1d25ad['query'][_0x6a8a('0x37')]+'%'};return _0x375431;}})});}_0x368eba=_['merge']({},_0x368eba,_0x1d25ad[_0x6a8a('0x3b')]);var _0x32c73c={'where':_0x368eba[_0x6a8a('0x35')]};return db[_0x6a8a('0x29')]['count'](_0x32c73c)[_0x6a8a('0x24')](function(_0x2e819c){_0x722dfe[_0x6a8a('0x1e')]=_0x2e819c;if(_0x1d25ad['query'][_0x6a8a('0x3c')]){_0x368eba[_0x6a8a('0x3d')]=[{'all':!![]}];}return db[_0x6a8a('0x29')]['findAll'](_0x368eba);})[_0x6a8a('0x24')](function(_0x10befc){_0x722dfe[_0x6a8a('0x3e')]=_0x10befc;return _0x722dfe;})['then'](respondWithFilteredResult(_0x3f647f,_0x368eba))[_0x6a8a('0x3f')](handleError(_0x3f647f,null));};exports[_0x6a8a('0x40')]=function(_0x4b62da,_0x50bc2c){var _0x181ebf={'raw':!![],'where':{'id':_0x4b62da[_0x6a8a('0x41')]['id']}},_0x32b59d={};_0x32b59d[_0x6a8a('0x2c')]=_['keys'](db[_0x6a8a('0x29')][_0x6a8a('0x2a')]);_0x32b59d[_0x6a8a('0x2d')]=_[_0x6a8a('0x42')](_0x4b62da[_0x6a8a('0x2d')]);_0x32b59d[_0x6a8a('0x2e')]=_[_0x6a8a('0x30')](_0x32b59d['model'],_0x32b59d['query']);_0x181ebf[_0x6a8a('0x2f')]=_[_0x6a8a('0x30')](_0x32b59d['model'],qs['fields'](_0x4b62da['query'][_0x6a8a('0x31')]));_0x181ebf[_0x6a8a('0x2f')]=_0x181ebf['attributes'][_0x6a8a('0x43')]?_0x181ebf[_0x6a8a('0x2f')]:_0x32b59d[_0x6a8a('0x2c')];if(_0x4b62da[_0x6a8a('0x2d')][_0x6a8a('0x3c')]){_0x181ebf[_0x6a8a('0x3d')]=[{'all':!![]}];}_0x181ebf=_[_0x6a8a('0x38')]({},_0x181ebf,_0x4b62da[_0x6a8a('0x3b')]);return db[_0x6a8a('0x29')]['find'](_0x181ebf)[_0x6a8a('0x24')](handleEntityNotFound(_0x50bc2c,null))[_0x6a8a('0x24')](respondWithResult(_0x50bc2c,null))[_0x6a8a('0x3f')](handleError(_0x50bc2c,null));};exports['create']=function(_0x3954e5,_0x4eb967){return db[_0x6a8a('0x29')][_0x6a8a('0x44')](_0x3954e5[_0x6a8a('0x45')],{})[_0x6a8a('0x24')](respondWithResult(_0x4eb967,0xc9))['catch'](handleError(_0x4eb967,null));};exports[_0x6a8a('0x23')]=function(_0x5de527,_0x3049f2){if(_0x5de527['body']['id']){delete _0x5de527[_0x6a8a('0x45')]['id'];}return db[_0x6a8a('0x29')][_0x6a8a('0x46')]({'where':{'id':_0x5de527[_0x6a8a('0x41')]['id']}})['then'](handleEntityNotFound(_0x3049f2,null))[_0x6a8a('0x24')](saveUpdates(_0x5de527[_0x6a8a('0x45')],null))[_0x6a8a('0x24')](respondWithResult(_0x3049f2,null))[_0x6a8a('0x3f')](handleError(_0x3049f2,null));};exports[_0x6a8a('0x25')]=function(_0x579333,_0x2d3692){return db[_0x6a8a('0x29')][_0x6a8a('0x46')]({'where':{'id':_0x579333[_0x6a8a('0x41')]['id']}})[_0x6a8a('0x24')](handleEntityNotFound(_0x2d3692,null))['then'](removeEntity(_0x2d3692,null))['catch'](handleError(_0x2d3692,null));}; \ No newline at end of file +var _0xe7c5=['body','params','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','destroy','error','name','map','SalesforceField','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','catch','show','keys','find','create','update'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xe7c5,0xbf));var _0x5e7c=function(_0x457321,_0x1c6ba6){_0x457321=_0x457321-0x0;var _0x22c317=_0xe7c5[_0x457321];return _0x22c317;};'use strict';var emlformat=require(_0x5e7c('0x0'));var rimraf=require(_0x5e7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5e7c('0x2'));var Mustache=require(_0x5e7c('0x3'));var util=require(_0x5e7c('0x4'));var path=require('path');var sox=require(_0x5e7c('0x5'));var csv=require(_0x5e7c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e7c('0x7'));var _=require('lodash');var squel=require(_0x5e7c('0x8'));var crypto=require(_0x5e7c('0x9'));var jsforce=require(_0x5e7c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5e7c('0x6'));var querystring=require('querystring');var Papa=require(_0x5e7c('0xb'));var Redis=require(_0x5e7c('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5e7c('0xd'));var hardwareService=require(_0x5e7c('0xe'));var logger=require(_0x5e7c('0xf'))('api');var utils=require(_0x5e7c('0x10'));var config=require(_0x5e7c('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e7c('0x12'))['db'];function respondWithStatusCode(_0xf78e9c,_0x4e718a){_0x4e718a=_0x4e718a||0xcc;return function(_0x51ab4d){if(_0x51ab4d){return _0xf78e9c['sendStatus'](_0x4e718a);}return _0xf78e9c[_0x5e7c('0x13')](_0x4e718a)[_0x5e7c('0x14')]();};}function respondWithResult(_0x37292b,_0x49385c){_0x49385c=_0x49385c||0xc8;return function(_0x317b72){if(_0x317b72){return _0x37292b[_0x5e7c('0x13')](_0x49385c)['json'](_0x317b72);}};}function respondWithFilteredResult(_0x3eada8,_0x1d8a0e){return function(_0x3a04c5){if(_0x3a04c5){var _0x85c928=typeof _0x1d8a0e['offset']===_0x5e7c('0x15')&&typeof _0x1d8a0e[_0x5e7c('0x16')]===_0x5e7c('0x15');var _0x16d8c0=_0x3a04c5[_0x5e7c('0x17')];var _0x3b8f43=_0x85c928?0x0:_0x1d8a0e[_0x5e7c('0x18')];var _0xfb809=_0x85c928?_0x3a04c5['count']:_0x1d8a0e[_0x5e7c('0x18')]+_0x1d8a0e['limit'];var _0xe327e;if(_0xfb809>=_0x16d8c0){_0xfb809=_0x16d8c0;_0xe327e=0xc8;}else{_0xe327e=0xce;}_0x3eada8[_0x5e7c('0x13')](_0xe327e);return _0x3eada8[_0x5e7c('0x19')](_0x5e7c('0x1a'),_0x3b8f43+'-'+_0xfb809+'/'+_0x16d8c0)[_0x5e7c('0x1b')](_0x3a04c5);}return null;};}function patchUpdates(_0x2d429e){return function(_0x1749f0){try{jsonpatch['apply'](_0x1749f0,_0x2d429e,!![]);}catch(_0x4d220e){return BPromise[_0x5e7c('0x1c')](_0x4d220e);}return _0x1749f0[_0x5e7c('0x1d')]();};}function saveUpdates(_0x2a3de3,_0x5833e0){return function(_0x36e1a3){if(_0x36e1a3){return _0x36e1a3['update'](_0x2a3de3)[_0x5e7c('0x1e')](function(_0x5d986c){return _0x5d986c;});}return null;};}function removeEntity(_0xb4dda0,_0x449d80){return function(_0x1cb108){if(_0x1cb108){return _0x1cb108[_0x5e7c('0x1f')]()[_0x5e7c('0x1e')](function(){_0xb4dda0[_0x5e7c('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353494,_0x27ce12){return function(_0x4b46d5){if(!_0x4b46d5){_0x353494['sendStatus'](0x194);}return _0x4b46d5;};}function handleError(_0x3ddf1c,_0xd1eff){_0xd1eff=_0xd1eff||0x1f4;return function(_0x8b2b92){logger[_0x5e7c('0x20')](_0x8b2b92['stack']);if(_0x8b2b92[_0x5e7c('0x21')]){delete _0x8b2b92[_0x5e7c('0x21')];}_0x3ddf1c[_0x5e7c('0x13')](_0xd1eff)['send'](_0x8b2b92);};}exports['index']=function(_0x265b7b,_0x151cbd){var _0x3173b7={},_0x134b0f={},_0xf409d0={'count':0x0,'rows':[]};var _0x5c1c8c=_[_0x5e7c('0x22')](db[_0x5e7c('0x23')][_0x5e7c('0x24')],function(_0x3a0550){return{'name':_0x3a0550['fieldName'],'type':_0x3a0550[_0x5e7c('0x25')][_0x5e7c('0x26')]};});_0x134b0f['model']=_[_0x5e7c('0x22')](_0x5c1c8c,_0x5e7c('0x21'));_0x134b0f[_0x5e7c('0x27')]=_['keys'](_0x265b7b[_0x5e7c('0x27')]);_0x134b0f[_0x5e7c('0x28')]=_[_0x5e7c('0x29')](_0x134b0f[_0x5e7c('0x2a')],_0x134b0f[_0x5e7c('0x27')]);_0x3173b7[_0x5e7c('0x2b')]=_['intersection'](_0x134b0f[_0x5e7c('0x2a')],qs[_0x5e7c('0x2c')](_0x265b7b[_0x5e7c('0x27')][_0x5e7c('0x2c')]));_0x3173b7[_0x5e7c('0x2b')]=_0x3173b7[_0x5e7c('0x2b')][_0x5e7c('0x2d')]?_0x3173b7[_0x5e7c('0x2b')]:_0x134b0f[_0x5e7c('0x2a')];if(!_0x265b7b[_0x5e7c('0x27')][_0x5e7c('0x2e')]('nolimit')){_0x3173b7['limit']=qs[_0x5e7c('0x16')](_0x265b7b[_0x5e7c('0x27')][_0x5e7c('0x16')]);_0x3173b7[_0x5e7c('0x18')]=qs[_0x5e7c('0x18')](_0x265b7b['query']['offset']);}_0x3173b7['order']=qs[_0x5e7c('0x2f')](_0x265b7b[_0x5e7c('0x27')][_0x5e7c('0x2f')]);_0x3173b7[_0x5e7c('0x30')]=qs[_0x5e7c('0x28')](_[_0x5e7c('0x31')](_0x265b7b['query'],_0x134b0f[_0x5e7c('0x28')]),_0x5c1c8c);if(_0x265b7b['query'][_0x5e7c('0x32')]){_0x3173b7[_0x5e7c('0x30')]=_['merge'](_0x3173b7['where'],{'$or':_[_0x5e7c('0x22')](_0x5c1c8c,function(_0x275816){if(_0x275816[_0x5e7c('0x25')]!=='VIRTUAL'){var _0x1eecf9={};_0x1eecf9[_0x275816[_0x5e7c('0x21')]]={'$like':'%'+_0x265b7b['query'][_0x5e7c('0x32')]+'%'};return _0x1eecf9;}})});}_0x3173b7=_[_0x5e7c('0x33')]({},_0x3173b7,_0x265b7b[_0x5e7c('0x34')]);var _0x47d4ab={'where':_0x3173b7[_0x5e7c('0x30')]};return db['SalesforceField']['count'](_0x47d4ab)[_0x5e7c('0x1e')](function(_0x5df8fb){_0xf409d0[_0x5e7c('0x17')]=_0x5df8fb;if(_0x265b7b[_0x5e7c('0x27')][_0x5e7c('0x35')]){_0x3173b7[_0x5e7c('0x36')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x3173b7);})[_0x5e7c('0x1e')](function(_0x21d14c){_0xf409d0['rows']=_0x21d14c;return _0xf409d0;})[_0x5e7c('0x1e')](respondWithFilteredResult(_0x151cbd,_0x3173b7))[_0x5e7c('0x37')](handleError(_0x151cbd,null));};exports[_0x5e7c('0x38')]=function(_0x39a4a0,_0x463a55){var _0x22fe7b={'raw':!![],'where':{'id':_0x39a4a0['params']['id']}},_0x3b851e={};_0x3b851e['model']=_[_0x5e7c('0x39')](db[_0x5e7c('0x23')]['rawAttributes']);_0x3b851e[_0x5e7c('0x27')]=_[_0x5e7c('0x39')](_0x39a4a0['query']);_0x3b851e['filters']=_[_0x5e7c('0x29')](_0x3b851e['model'],_0x3b851e[_0x5e7c('0x27')]);_0x22fe7b[_0x5e7c('0x2b')]=_[_0x5e7c('0x29')](_0x3b851e[_0x5e7c('0x2a')],qs[_0x5e7c('0x2c')](_0x39a4a0[_0x5e7c('0x27')][_0x5e7c('0x2c')]));_0x22fe7b['attributes']=_0x22fe7b[_0x5e7c('0x2b')][_0x5e7c('0x2d')]?_0x22fe7b[_0x5e7c('0x2b')]:_0x3b851e[_0x5e7c('0x2a')];if(_0x39a4a0[_0x5e7c('0x27')][_0x5e7c('0x35')]){_0x22fe7b['include']=[{'all':!![]}];}_0x22fe7b=_[_0x5e7c('0x33')]({},_0x22fe7b,_0x39a4a0[_0x5e7c('0x34')]);return db[_0x5e7c('0x23')][_0x5e7c('0x3a')](_0x22fe7b)[_0x5e7c('0x1e')](handleEntityNotFound(_0x463a55,null))[_0x5e7c('0x1e')](respondWithResult(_0x463a55,null))[_0x5e7c('0x37')](handleError(_0x463a55,null));};exports[_0x5e7c('0x3b')]=function(_0x268340,_0xd2770d){return db[_0x5e7c('0x23')][_0x5e7c('0x3b')](_0x268340['body'],{})[_0x5e7c('0x1e')](respondWithResult(_0xd2770d,0xc9))[_0x5e7c('0x37')](handleError(_0xd2770d,null));};exports[_0x5e7c('0x3c')]=function(_0x4bfed5,_0x5ba10b){if(_0x4bfed5[_0x5e7c('0x3d')]['id']){delete _0x4bfed5[_0x5e7c('0x3d')]['id'];}return db[_0x5e7c('0x23')]['find']({'where':{'id':_0x4bfed5[_0x5e7c('0x3e')]['id']}})[_0x5e7c('0x1e')](handleEntityNotFound(_0x5ba10b,null))[_0x5e7c('0x1e')](saveUpdates(_0x4bfed5[_0x5e7c('0x3d')],null))['then'](respondWithResult(_0x5ba10b,null))[_0x5e7c('0x37')](handleError(_0x5ba10b,null));};exports[_0x5e7c('0x1f')]=function(_0x3a3a66,_0x3892a5){return db['SalesforceField'][_0x5e7c('0x3a')]({'where':{'id':_0x3a3a66[_0x5e7c('0x3e')]['id']}})[_0x5e7c('0x1e')](handleEntityNotFound(_0x3892a5,null))[_0x5e7c('0x1e')](removeEntity(_0x3892a5,null))[_0x5e7c('0x37')](handleError(_0x3892a5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 66e2a27..40a1db1 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d6d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','FieldId'];(function(_0x4491ef,_0x5153d9){var _0x3c72dc=function(_0x4c467d){while(--_0x4c467d){_0x4491ef['push'](_0x4491ef['shift']());}};_0x3c72dc(++_0x5153d9);}(_0x7d6d,0xc4));var _0xd7d6=function(_0xe08ea7,_0x2f4e05){_0xe08ea7=_0xe08ea7-0x0;var _0x2a64b4=_0x7d6d[_0xe08ea7];return _0x2a64b4;};'use strict';var _=require(_0xd7d6('0x0'));var util=require(_0xd7d6('0x1'));var logger=require(_0xd7d6('0x2'))(_0xd7d6('0x3'));var moment=require(_0xd7d6('0x4'));var BPromise=require(_0xd7d6('0x5'));var rp=require(_0xd7d6('0x6'));var fs=require('fs');var path=require(_0xd7d6('0x7'));var rimraf=require(_0xd7d6('0x8'));var config=require(_0xd7d6('0x9'));var attributes=require(_0xd7d6('0xa'));module[_0xd7d6('0xb')]=function(_0x580c11,_0x114bc5){return _0x580c11['define'](_0xd7d6('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xd7d6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b6a=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId'];(function(_0x479650,_0x2bee99){var _0x26b288=function(_0x1ba49f){while(--_0x1ba49f){_0x479650['push'](_0x479650['shift']());}};_0x26b288(++_0x2bee99);}(_0x8b6a,0x1dc));var _0xa8b6=function(_0x573771,_0x244352){_0x573771=_0x573771-0x0;var _0x5ad871=_0x8b6a[_0x573771];return _0x5ad871;};'use strict';var _=require(_0xa8b6('0x0'));var util=require(_0xa8b6('0x1'));var logger=require(_0xa8b6('0x2'))(_0xa8b6('0x3'));var moment=require('moment');var BPromise=require(_0xa8b6('0x4'));var rp=require(_0xa8b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8b6('0x6'));var attributes=require(_0xa8b6('0x7'));module[_0xa8b6('0x8')]=function(_0x54879e,_0x12a780){return _0x54879e[_0xa8b6('0x9')](_0xa8b6('0xa'),attributes,{'tableName':_0xa8b6('0xb'),'paranoid':![],'indexes':[{'name':_0xa8b6('0xc'),'fields':['idField',_0xa8b6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 0701a91..b07b0e1 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd63d=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xd63d,0x115));var _0xdd63=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xd63d[_0x3e8cae];return _0x45c4d6;};'use strict';var _=require('lodash');var util=require(_0xdd63('0x0'));var moment=require(_0xdd63('0x1'));var BPromise=require(_0xdd63('0x2'));var rs=require(_0xdd63('0x3'));var fs=require('fs');var Redis=require(_0xdd63('0x4'));var db=require(_0xdd63('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd63('0x6'))(_0xdd63('0x7'));var config=require(_0xdd63('0x8'));var jayson=require(_0xdd63('0x9'));var client=jayson[_0xdd63('0xa')][_0xdd63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57ee8f,_0x391d6a,_0xd2c6f7){return new BPromise(function(_0x2b0af0,_0x51b95b){return client['request'](_0x57ee8f,_0xd2c6f7)[_0xdd63('0xc')](function(_0x422d06){logger[_0xdd63('0xd')](_0xdd63('0xe'),_0x391d6a,_0xdd63('0xf'));logger[_0xdd63('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x391d6a,_0xdd63('0xf'),JSON[_0xdd63('0x11')](_0x422d06));if(_0x422d06[_0xdd63('0x12')]){if(_0x422d06[_0xdd63('0x12')][_0xdd63('0x13')]===0x1f4){logger[_0xdd63('0x12')]('SalesforceField,\x20%s,\x20%s',_0x391d6a,_0x422d06[_0xdd63('0x12')][_0xdd63('0x14')]);return _0x51b95b(_0x422d06['error'][_0xdd63('0x14')]);}logger['error'](_0xdd63('0xe'),_0x391d6a,_0x422d06[_0xdd63('0x12')][_0xdd63('0x14')]);return _0x2b0af0(_0x422d06[_0xdd63('0x12')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x391d6a,'request\x20sent');_0x2b0af0(_0x422d06[_0xdd63('0x15')]['message']);}})[_0xdd63('0x16')](function(_0x5dd433){logger['error'](_0xdd63('0xe'),_0x391d6a,_0x5dd433);_0x51b95b(_0x5dd433);});});} \ No newline at end of file +var _0x867c=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x3b5f6b,_0x3caca2){var _0x186534=function(_0x4fdcdf){while(--_0x4fdcdf){_0x3b5f6b['push'](_0x3b5f6b['shift']());}};_0x186534(++_0x3caca2);}(_0x867c,0x173));var _0xc867=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x867c[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0xc867('0x0'));var util=require(_0xc867('0x1'));var moment=require(_0xc867('0x2'));var BPromise=require(_0xc867('0x3'));var rs=require(_0xc867('0x4'));var fs=require('fs');var Redis=require(_0xc867('0x5'));var db=require(_0xc867('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc867('0x7'))(_0xc867('0x8'));var config=require(_0xc867('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc867('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34342f,_0x4f0658,_0x27e799){return new BPromise(function(_0x453bc0,_0x279307){return client[_0xc867('0xb')](_0x34342f,_0x27e799)[_0xc867('0xc')](function(_0x2f1caf){logger[_0xc867('0xd')](_0xc867('0xe'),_0x4f0658,_0xc867('0xf'));logger[_0xc867('0x10')](_0xc867('0x11'),_0x4f0658,_0xc867('0xf'),JSON[_0xc867('0x12')](_0x2f1caf));if(_0x2f1caf[_0xc867('0x13')]){if(_0x2f1caf['error'][_0xc867('0x14')]===0x1f4){logger['error'](_0xc867('0xe'),_0x4f0658,_0x2f1caf[_0xc867('0x13')][_0xc867('0x15')]);return _0x279307(_0x2f1caf[_0xc867('0x13')][_0xc867('0x15')]);}logger[_0xc867('0x13')](_0xc867('0xe'),_0x4f0658,_0x2f1caf[_0xc867('0x13')][_0xc867('0x15')]);return _0x453bc0(_0x2f1caf['error'][_0xc867('0x15')]);}else{logger[_0xc867('0xd')]('SalesforceField,\x20%s,\x20%s',_0x4f0658,'request\x20sent');_0x453bc0(_0x2f1caf[_0xc867('0x16')][_0xc867('0x15')]);}})[_0xc867('0x17')](function(_0x1d5be0){logger[_0xc867('0x13')](_0xc867('0xe'),_0x4f0658,_0x1d5be0);_0x279307(_0x1d5be0);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index fd053bd..ef5156a 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c7c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x28beb4,_0x1f0879){var _0x222d07=function(_0x37cefe){while(--_0x37cefe){_0x28beb4['push'](_0x28beb4['shift']());}};_0x222d07(++_0x1f0879);}(_0x5c7c,0xe2));var _0xc5c7=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0x5c7c[_0x414cbe];return _0x2793fe;};'use strict';var multer=require(_0xc5c7('0x0'));var util=require('util');var path=require(_0xc5c7('0x1'));var timeout=require(_0xc5c7('0x2'));var express=require(_0xc5c7('0x3'));var router=express[_0xc5c7('0x4')]();var fs_extra=require(_0xc5c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5c7('0x6'));var config=require(_0xc5c7('0x7'));var controller=require(_0xc5c7('0x8'));router['get']('/',auth[_0xc5c7('0x9')](),controller[_0xc5c7('0xa')]);router[_0xc5c7('0xb')](_0xc5c7('0xc'),auth[_0xc5c7('0x9')](),controller[_0xc5c7('0xd')]);router[_0xc5c7('0xb')](_0xc5c7('0xe'),auth[_0xc5c7('0x9')](),controller[_0xc5c7('0xf')]);router['get']('/:id/fields',auth[_0xc5c7('0x9')](),controller[_0xc5c7('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc5c7('0x11')](_0xc5c7('0xe'),auth[_0xc5c7('0x9')](),controller[_0xc5c7('0x12')]);router[_0xc5c7('0x13')](_0xc5c7('0xc'),auth[_0xc5c7('0x9')](),controller[_0xc5c7('0x14')]);router['delete'](_0xc5c7('0xc'),auth['isAuthenticated'](),controller[_0xc5c7('0x15')]);module[_0xc5c7('0x16')]=router; \ No newline at end of file +var _0x3fb2=['/:id','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x4f542e,_0x22e5d7){var _0x34b1ad=function(_0x5bb4c9){while(--_0x5bb4c9){_0x4f542e['push'](_0x4f542e['shift']());}};_0x34b1ad(++_0x22e5d7);}(_0x3fb2,0x12a));var _0x23fb=function(_0x4f4161,_0x51b9d6){_0x4f4161=_0x4f4161-0x0;var _0x33ebfc=_0x3fb2[_0x4f4161];return _0x33ebfc;};'use strict';var multer=require('multer');var util=require(_0x23fb('0x0'));var path=require(_0x23fb('0x1'));var timeout=require('connect-timeout');var express=require(_0x23fb('0x2'));var router=express[_0x23fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23fb('0x4'));var interaction=require(_0x23fb('0x5'));var config=require('../../config/environment');var controller=require(_0x23fb('0x6'));router[_0x23fb('0x7')]('/',auth[_0x23fb('0x8')](),controller['index']);router[_0x23fb('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x23fb('0x7')](_0x23fb('0x9'),auth[_0x23fb('0x8')](),controller[_0x23fb('0xa')]);router[_0x23fb('0x7')](_0x23fb('0xb'),auth[_0x23fb('0x8')](),controller[_0x23fb('0xc')]);router[_0x23fb('0xd')]('/',auth[_0x23fb('0x8')](),controller[_0x23fb('0xe')]);router[_0x23fb('0xd')](_0x23fb('0x9'),auth['isAuthenticated'](),controller[_0x23fb('0xf')]);router[_0x23fb('0x10')](_0x23fb('0x11'),auth['isAuthenticated'](),controller[_0x23fb('0x12')]);router[_0x23fb('0x13')](_0x23fb('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x23fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8ded2a7..fa78b1a 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c2b=['STRING','exports'];(function(_0x3cc83b,_0x1d8b9d){var _0x395806=function(_0x5efdbd){while(--_0x5efdbd){_0x3cc83b['push'](_0x3cc83b['shift']());}};_0x395806(++_0x1d8b9d);}(_0x5c2b,0x87));var _0xb5c2=function(_0xb6b9b,_0x4e273b){_0xb6b9b=_0xb6b9b-0x0;var _0x56338f=_0x5c2b[_0xb6b9b];return _0x56338f;};'use strict';var Sequelize=require('sequelize');module[_0xb5c2('0x0')]={'name':{'type':Sequelize[_0xb5c2('0x1')]},'description':{'type':Sequelize[_0xb5c2('0x1')]},'username':{'type':Sequelize[_0xb5c2('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xb5c2('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb5c2('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb5c2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x51b4=['sequelize','STRING'];(function(_0x33fe60,_0x2c2213){var _0xc6fdb6=function(_0x3e7ccb){while(--_0x3e7ccb){_0x33fe60['push'](_0x33fe60['shift']());}};_0xc6fdb6(++_0x2c2213);}(_0x51b4,0x70));var _0x451b=function(_0x50c0d6,_0x326b3d){_0x50c0d6=_0x50c0d6-0x0;var _0x393334=_0x51b4[_0x50c0d6];return _0x393334;};'use strict';var Sequelize=require(_0x451b('0x0'));module['exports']={'name':{'type':Sequelize[_0x451b('0x1')]},'description':{'type':Sequelize[_0x451b('0x1')]},'username':{'type':Sequelize[_0x451b('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x451b('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x451b('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index b1c77be..da3a451 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ce8=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','find','getConfigurations','rawAttributes','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','ServicenowConfiguration','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','made_sla','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','follow_up','sys_id','contact_type','urgency','problem_id','company','activity_due','assigned_to','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','password','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','assign','includes','forEach','internalType','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','ServiceNow\x20error:\x20','test','statusCode','error','boolean','True','true','False','false','inactive','label','value','zip-dir','request-promise','moment','bluebird','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','map','ServicenowAccount','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3b8ef0,_0x307c75){var _0x5e2166=function(_0x4e2588){while(--_0x4e2588){_0x3b8ef0['push'](_0x3b8ef0['shift']());}};_0x5e2166(++_0x307c75);}(_0x6ce8,0x1d9));var _0x86ce=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6ce8[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86ce('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86ce('0x1'));var moment=require(_0x86ce('0x2'));var BPromise=require(_0x86ce('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x86ce('0x4'));var csv=require('to-csv');var ejs=require(_0x86ce('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x86ce('0x6'));var crypto=require(_0x86ce('0x7'));var jsforce=require(_0x86ce('0x8'));var deskjs=require(_0x86ce('0x9'));var toCsv=require(_0x86ce('0xa'));var querystring=require(_0x86ce('0xb'));var Papa=require(_0x86ce('0xc'));var Redis=require(_0x86ce('0xd'));var authService=require(_0x86ce('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x86ce('0xf'));var hardwareService=require(_0x86ce('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x86ce('0x11'));var config=require(_0x86ce('0x12'));var licenseUtil=require(_0x86ce('0x13'));var db=require(_0x86ce('0x14'))['db'];var integrations=require(_0x86ce('0x15'));function respondWithStatusCode(_0x253726,_0x1d518a){_0x1d518a=_0x1d518a||0xcc;return function(_0x21e2a0){if(_0x21e2a0){return _0x253726[_0x86ce('0x16')](_0x1d518a);}return _0x253726[_0x86ce('0x17')](_0x1d518a)[_0x86ce('0x18')]();};}function respondWithResult(_0x2a2d95,_0x18d6be){_0x18d6be=_0x18d6be||0xc8;return function(_0x3ac838){if(_0x3ac838){return _0x2a2d95['status'](_0x18d6be)[_0x86ce('0x19')](_0x3ac838);}};}function respondWithFilteredResult(_0x31e5e8,_0x59565a){return function(_0x737ca1){if(_0x737ca1){var _0x30d46a=typeof _0x59565a[_0x86ce('0x1a')]===_0x86ce('0x1b')&&typeof _0x59565a[_0x86ce('0x1c')]===_0x86ce('0x1b');var _0x1f28ef=_0x737ca1[_0x86ce('0x1d')];var _0x4115aa=_0x30d46a?0x0:_0x59565a[_0x86ce('0x1a')];var _0x3a5e95=_0x30d46a?_0x737ca1[_0x86ce('0x1d')]:_0x59565a[_0x86ce('0x1a')]+_0x59565a['limit'];var _0x564e89;if(_0x3a5e95>=_0x1f28ef){_0x3a5e95=_0x1f28ef;_0x564e89=0xc8;}else{_0x564e89=0xce;}_0x31e5e8['status'](_0x564e89);return _0x31e5e8[_0x86ce('0x1e')]('Content-Range',_0x4115aa+'-'+_0x3a5e95+'/'+_0x1f28ef)[_0x86ce('0x19')](_0x737ca1);}return null;};}function patchUpdates(_0x424a2b){return function(_0x5bc301){try{jsonpatch[_0x86ce('0x1f')](_0x5bc301,_0x424a2b,!![]);}catch(_0x3e91bb){return BPromise[_0x86ce('0x20')](_0x3e91bb);}return _0x5bc301['save']();};}function saveUpdates(_0x22fd06,_0x218eff){return function(_0x405b2d){if(_0x405b2d){return _0x405b2d[_0x86ce('0x21')](_0x22fd06)[_0x86ce('0x22')](function(_0x1b9c55){return _0x1b9c55;});}return null;};}function removeEntity(_0x3f6f4c,_0x267a09){return function(_0x3bb875){if(_0x3bb875){return _0x3bb875[_0x86ce('0x23')]()[_0x86ce('0x22')](function(){_0x3f6f4c[_0x86ce('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x261c80,_0x1ef809){return function(_0x51281a){if(!_0x51281a){_0x261c80['sendStatus'](0x194);}return _0x51281a;};}function handleError(_0x851c80,_0x363841){_0x363841=_0x363841||0x1f4;return function(_0x5310b7){logger['error'](_0x5310b7[_0x86ce('0x24')]);if(_0x5310b7[_0x86ce('0x25')]){delete _0x5310b7['name'];}_0x851c80[_0x86ce('0x17')](_0x363841)[_0x86ce('0x26')](_0x5310b7);};}exports['index']=function(_0x12371b,_0x4fcd31){var _0x408ef6={},_0x47e45c={},_0x5035b9={'count':0x0,'rows':[]};var _0x2c40e1=_[_0x86ce('0x27')](db[_0x86ce('0x28')]['rawAttributes'],function(_0x1be9b2){return{'name':_0x1be9b2['fieldName'],'type':_0x1be9b2[_0x86ce('0x29')]['key']};});_0x47e45c[_0x86ce('0x2a')]=_[_0x86ce('0x27')](_0x2c40e1,_0x86ce('0x25'));_0x47e45c['query']=_[_0x86ce('0x2b')](_0x12371b[_0x86ce('0x2c')]);_0x47e45c[_0x86ce('0x2d')]=_[_0x86ce('0x2e')](_0x47e45c['model'],_0x47e45c[_0x86ce('0x2c')]);_0x408ef6[_0x86ce('0x2f')]=_[_0x86ce('0x2e')](_0x47e45c[_0x86ce('0x2a')],qs[_0x86ce('0x30')](_0x12371b[_0x86ce('0x2c')][_0x86ce('0x30')]));_0x408ef6['attributes']=_0x408ef6[_0x86ce('0x2f')][_0x86ce('0x31')]?_0x408ef6[_0x86ce('0x2f')]:_0x47e45c[_0x86ce('0x2a')];if(!_0x12371b['query'][_0x86ce('0x32')](_0x86ce('0x33'))){_0x408ef6['limit']=qs['limit'](_0x12371b[_0x86ce('0x2c')]['limit']);_0x408ef6[_0x86ce('0x1a')]=qs[_0x86ce('0x1a')](_0x12371b[_0x86ce('0x2c')]['offset']);}_0x408ef6[_0x86ce('0x34')]=qs[_0x86ce('0x35')](_0x12371b[_0x86ce('0x2c')][_0x86ce('0x35')]);_0x408ef6[_0x86ce('0x36')]=qs['filters'](_['pick'](_0x12371b[_0x86ce('0x2c')],_0x47e45c[_0x86ce('0x2d')]),_0x2c40e1);if(_0x12371b[_0x86ce('0x2c')][_0x86ce('0x37')]){_0x408ef6[_0x86ce('0x36')]=_[_0x86ce('0x38')](_0x408ef6[_0x86ce('0x36')],{'$or':_[_0x86ce('0x27')](_0x2c40e1,function(_0xb26071){if(_0xb26071['type']!==_0x86ce('0x39')){var _0x131a4e={};_0x131a4e[_0xb26071[_0x86ce('0x25')]]={'$like':'%'+_0x12371b[_0x86ce('0x2c')][_0x86ce('0x37')]+'%'};return _0x131a4e;}})});}_0x408ef6=_[_0x86ce('0x38')]({},_0x408ef6,_0x12371b[_0x86ce('0x3a')]);var _0x253ade={'where':_0x408ef6[_0x86ce('0x36')]};return db[_0x86ce('0x28')][_0x86ce('0x1d')](_0x253ade)[_0x86ce('0x22')](function(_0x3294f0){_0x5035b9[_0x86ce('0x1d')]=_0x3294f0;if(_0x12371b[_0x86ce('0x2c')][_0x86ce('0x3b')]){_0x408ef6['include']=[{'all':!![]}];}return db[_0x86ce('0x28')][_0x86ce('0x3c')](_0x408ef6);})[_0x86ce('0x22')](function(_0x48a165){_0x5035b9[_0x86ce('0x3d')]=_0x48a165;return _0x5035b9;})[_0x86ce('0x22')](respondWithFilteredResult(_0x4fcd31,_0x408ef6))[_0x86ce('0x3e')](handleError(_0x4fcd31,null));};exports['show']=function(_0x246cb9,_0x424c74){var _0x386017={'raw':![],'where':{'id':_0x246cb9[_0x86ce('0x3f')]['id']}},_0x516990={};_0x516990['model']=_[_0x86ce('0x2b')](db['ServicenowAccount']['rawAttributes']);_0x516990[_0x86ce('0x2c')]=_[_0x86ce('0x2b')](_0x246cb9[_0x86ce('0x2c')]);_0x516990[_0x86ce('0x2d')]=_[_0x86ce('0x2e')](_0x516990[_0x86ce('0x2a')],_0x516990['query']);_0x386017[_0x86ce('0x2f')]=_['intersection'](_0x516990['model'],qs[_0x86ce('0x30')](_0x246cb9[_0x86ce('0x2c')]['fields']));_0x386017[_0x86ce('0x2f')]=_0x386017[_0x86ce('0x2f')]['length']?_0x386017['attributes']:_0x516990[_0x86ce('0x2a')];if(_0x246cb9[_0x86ce('0x2c')][_0x86ce('0x3b')]){_0x386017[_0x86ce('0x40')]=[{'all':!![]}];}_0x386017=_[_0x86ce('0x38')]({},_0x386017,_0x246cb9[_0x86ce('0x3a')]);return db[_0x86ce('0x28')]['find'](_0x386017)[_0x86ce('0x22')](handleEntityNotFound(_0x424c74,null))[_0x86ce('0x22')](respondWithResult(_0x424c74,null))[_0x86ce('0x3e')](handleError(_0x424c74,null));};exports[_0x86ce('0x41')]=function(_0x109cd2,_0x8383){return db[_0x86ce('0x28')]['create'](_0x109cd2[_0x86ce('0x42')],{})[_0x86ce('0x22')](respondWithResult(_0x8383,0xc9))[_0x86ce('0x3e')](handleError(_0x8383,null));};exports['update']=function(_0x523415,_0x304948){if(_0x523415['body']['id']){delete _0x523415[_0x86ce('0x42')]['id'];}return db[_0x86ce('0x28')][_0x86ce('0x43')]({'where':{'id':_0x523415[_0x86ce('0x3f')]['id']}})['then'](handleEntityNotFound(_0x304948,null))[_0x86ce('0x22')](saveUpdates(_0x523415[_0x86ce('0x42')],null))[_0x86ce('0x22')](respondWithResult(_0x304948,null))[_0x86ce('0x3e')](handleError(_0x304948,null));};exports[_0x86ce('0x23')]=function(_0x105e7f,_0x5413bd){return db[_0x86ce('0x28')][_0x86ce('0x43')]({'where':{'id':_0x105e7f[_0x86ce('0x3f')]['id']}})[_0x86ce('0x22')](handleEntityNotFound(_0x5413bd,null))[_0x86ce('0x22')](removeEntity(_0x5413bd,null))[_0x86ce('0x3e')](handleError(_0x5413bd,null));};exports[_0x86ce('0x44')]=function(_0x2892e1,_0x34fbec,_0x4e0978){var _0x26f820={};var _0xa5b12e={};var _0x5613f8;var _0x4a1db8;return db[_0x86ce('0x28')]['findOne']({'where':{'id':_0x2892e1[_0x86ce('0x3f')]['id']}})['then'](handleEntityNotFound(_0x34fbec,null))[_0x86ce('0x22')](function(_0x619408){if(_0x619408){_0x5613f8=_0x619408;_0xa5b12e['model']=_[_0x86ce('0x2b')](db['ServicenowConfiguration'][_0x86ce('0x45')]);_0xa5b12e[_0x86ce('0x2c')]=_[_0x86ce('0x2b')](_0x2892e1['query']);_0xa5b12e[_0x86ce('0x2d')]=_[_0x86ce('0x2e')](_0xa5b12e[_0x86ce('0x2a')],_0xa5b12e[_0x86ce('0x2c')]);_0x26f820[_0x86ce('0x2f')]=_[_0x86ce('0x2e')](_0xa5b12e[_0x86ce('0x2a')],qs[_0x86ce('0x30')](_0x2892e1[_0x86ce('0x2c')]['fields']));_0x26f820[_0x86ce('0x2f')]=_0x26f820['attributes']['length']?_0x26f820[_0x86ce('0x2f')]:_0xa5b12e[_0x86ce('0x2a')];_0x26f820[_0x86ce('0x34')]=qs['sort'](_0x2892e1[_0x86ce('0x2c')][_0x86ce('0x35')]);_0x26f820[_0x86ce('0x36')]=qs[_0x86ce('0x2d')](_['pick'](_0x2892e1[_0x86ce('0x2c')],_0xa5b12e['filters']));if(_0x2892e1[_0x86ce('0x2c')][_0x86ce('0x37')]){_0x26f820[_0x86ce('0x36')]=_[_0x86ce('0x38')](_0x26f820['where'],{'$or':_['map'](_0x26f820[_0x86ce('0x2f')],function(_0x104958){var _0x22fe07={};_0x22fe07[_0x104958]={'$like':'%'+_0x2892e1[_0x86ce('0x2c')]['filter']+'%'};return _0x22fe07;})});}_0x26f820=_[_0x86ce('0x38')]({},_0x26f820,_0x2892e1[_0x86ce('0x3a')]);return _0x5613f8['getConfigurations'](_0x26f820);}})[_0x86ce('0x22')](function(_0x325953){if(_0x325953){_0x4a1db8=_0x325953[_0x86ce('0x31')];if(!_0x2892e1[_0x86ce('0x2c')][_0x86ce('0x32')]('nolimit')){_0x26f820[_0x86ce('0x1c')]=qs[_0x86ce('0x1c')](_0x2892e1[_0x86ce('0x2c')]['limit']);_0x26f820[_0x86ce('0x1a')]=qs[_0x86ce('0x1a')](_0x2892e1[_0x86ce('0x2c')][_0x86ce('0x1a')]);}return _0x5613f8['getConfigurations'](_0x26f820);}})[_0x86ce('0x22')](function(_0x38dc30){if(_0x38dc30){return _0x38dc30?{'count':_0x4a1db8,'rows':_0x38dc30}:null;}})[_0x86ce('0x22')](respondWithResult(_0x34fbec,null))[_0x86ce('0x3e')](handleError(_0x34fbec,null));};exports[_0x86ce('0x46')]=function(_0x4e8698,_0x411221,_0x256e3d){if(_0x4e8698[_0x86ce('0x42')]['id']){delete _0x4e8698[_0x86ce('0x42')]['id'];}return db[_0x86ce('0x28')][_0x86ce('0x47')]({'where':{'id':_0x4e8698['params']['id']}})[_0x86ce('0x22')](handleEntityNotFound(_0x411221,null))[_0x86ce('0x22')](function(_0x458fe3){if(_0x458fe3){_0x4e8698['body'][_0x86ce('0x48')]=_0x458fe3['id'];_0x4e8698[_0x86ce('0x42')][_0x86ce('0x49')]=integrations['getSubjects'](_0x4e8698[_0x86ce('0x42')]['channel'],_0x4e8698[_0x86ce('0x42')]['type']);_0x4e8698['body'][_0x86ce('0x4a')]=integrations[_0x86ce('0x4b')](_0x4e8698[_0x86ce('0x42')][_0x86ce('0x4c')],_0x4e8698[_0x86ce('0x42')][_0x86ce('0x29')]);return db[_0x86ce('0x4d')][_0x86ce('0x41')](_0x4e8698[_0x86ce('0x42')],{'include':[{'model':db[_0x86ce('0x4e')],'as':_0x86ce('0x49')},{'model':db[_0x86ce('0x4e')],'as':_0x86ce('0x4a')}]});}return null;})[_0x86ce('0x22')](respondWithResult(_0x411221,null))[_0x86ce('0x3e')](handleError(_0x411221,null));};exports[_0x86ce('0x4f')]=function(_0x48fc3d,_0x13150a,_0x1009db){var _0x512cb2=['made_sla',_0x86ce('0x50'),_0x86ce('0x51'),_0x86ce('0x52'),_0x86ce('0x53'),_0x86ce('0x54'),_0x86ce('0x55'),_0x86ce('0x56'),_0x86ce('0x57')];var _0x2f8b06=[_0x86ce('0x58'),_0x86ce('0x59'),'caused_by',_0x86ce('0x5a'),_0x86ce('0x5b'),_0x86ce('0x5c'),_0x86ce('0x5d'),'hold_reason','approval_history',_0x86ce('0x5e'),_0x86ce('0x5f'),_0x86ce('0x60'),'opened_by',_0x86ce('0x61'),'sys_created_on',_0x86ce('0x62'),_0x86ce('0x63'),_0x86ce('0x64'),_0x86ce('0x51'),_0x86ce('0x34'),'calendar_stc','closed_at',_0x86ce('0x65'),_0x86ce('0x66'),_0x86ce('0x67'),_0x86ce('0x68'),_0x86ce('0x69'),_0x86ce('0x6a'),_0x86ce('0x6b'),_0x86ce('0x6c'),_0x86ce('0x6d'),_0x86ce('0x6e'),'expected_start',_0x86ce('0x6f'),'business_duration',_0x86ce('0x70'),_0x86ce('0x71'),_0x86ce('0x72'),_0x86ce('0x73'),_0x86ce('0x74'),_0x86ce('0x75'),_0x86ce('0x52'),_0x86ce('0x76'),_0x86ce('0x77'),_0x86ce('0x53'),_0x86ce('0x78'),'delivery_task',_0x86ce('0x79'),_0x86ce('0x7a'),_0x86ce('0x7b'),_0x86ce('0x7c'),'description',_0x86ce('0x7d'),_0x86ce('0x54'),_0x86ce('0x7e'),'close_notes','closed_by',_0x86ce('0x7f'),'parent_incident',_0x86ce('0x80'),_0x86ce('0x81'),'reopened_by','incident_state',_0x86ce('0x82'),_0x86ce('0x83'),_0x86ce('0x84'),'reassignment_count',_0x86ce('0x85'),_0x86ce('0x86'),_0x86ce('0x56'),'comments',_0x86ce('0x87'),_0x86ce('0x88'),'comments_and_work_notes',_0x86ce('0x89'),_0x86ce('0x8a'),_0x86ce('0x8b'),_0x86ce('0x8c'),_0x86ce('0x8d'),'upon_approval','correlation_id','location','category'];var _0x1fbf3e='';var _0x1dea2d='';var _0x544db8=[];var _0x4c4958='';var _0xade9c8='';var _0x4b5c72=[];var _0x1fef9b='';var _0x2e22f8='';var _0x46f308={};var _0x25685b='';return db['ServicenowAccount'][_0x86ce('0x47')]({'where':{'id':_0x48fc3d[_0x86ce('0x3f')]['id']},'attributes':['id','username',_0x86ce('0x8e'),_0x86ce('0x8f'),'remoteUri',_0x86ce('0x90')]})['then'](handleEntityNotFound(_0x13150a,null))[_0x86ce('0x22')](function(_0x50654b){if(_0x50654b){_0x25685b=_0x50654b[_0x86ce('0x91')];var _0x10e3e9=_0x25685b['slice'](-0x1);if(_0x10e3e9==='/'){_0x25685b=_0x25685b[_0x86ce('0x92')](0x0,_0x25685b[_0x86ce('0x93')](_0x10e3e9));}_0x2e22f8=util[_0x86ce('0x94')](_0x86ce('0x95'),_0x25685b);_0x1fef9b=util['format'](_0x86ce('0x96'),_0x25685b);_0x46f308={'user':_0x50654b[_0x86ce('0x97')],'pass':_0x50654b[_0x86ce('0x8e')]};var _0x5d1da6={'method':_0x86ce('0x98'),'uri':_0x2e22f8+_0x86ce('0x99'),'auth':_0x46f308,'json':!![]};return rp(_0x5d1da6);}})[_0x86ce('0x22')](function(_0x3b8e5c){if(_0x3b8e5c[_0x86ce('0x9a')][_0x86ce('0x31')]>0x0){_0x1fbf3e=_0x3b8e5c['result'];}console[_0x86ce('0x9b')]('incident\x20table\x20objects',_0x1fbf3e);_0x4b5c72=[];_0x1dea2d=Object[_0x86ce('0x9c')]([],_0x1fbf3e);_['remove'](_0x1dea2d,function(_0x272256){return!_0x512cb2[_0x86ce('0x9d')](_0x272256[_0x86ce('0x25')]);});_0x1dea2d[_0x86ce('0x9e')](function(_0x57dd9e){var _0x53c55e=createFieldObject(_0x1fef9b,_0x46f308,_0x57dd9e[_0x86ce('0x9f')],_0x57dd9e['name'],_0x57dd9e['label'],![]);_0x4b5c72['push'](_0x53c55e);});return Promise['all'](_0x4b5c72);})['then'](function(_0x4ca1e8){_0x544db8=_0x4ca1e8;_0x4c4958=Object[_0x86ce('0x9c')]([],_0x1fbf3e);console['log'](_0x86ce('0xa0'),_0x1fbf3e);_['remove'](_0x4c4958,function(_0x2f5ea2){return _0x2f8b06[_0x86ce('0x9d')](_0x2f5ea2[_0x86ce('0x25')]);});console['log'](_0x86ce('0xa1'),_0x4c4958);_0x4b5c72=[];_0x4c4958[_0x86ce('0x9e')](function(_0x274a67){var _0x5cee1a=createFieldObject(_0x1fef9b,_0x46f308,_0x274a67[_0x86ce('0x9f')],_0x274a67[_0x86ce('0x25')],_0x274a67['label'],!![]);_0x4b5c72[_0x86ce('0xa2')](_0x5cee1a);});return Promise[_0x86ce('0xa3')](_0x4b5c72);})[_0x86ce('0x22')](function(_0x2f62c1){_0xade9c8=_0x2f62c1;var _0xdf3370=_0x544db8['concat'](_0xade9c8);return{'count':_0xdf3370[_0x86ce('0x31')],'rows':_0xdf3370};})[_0x86ce('0x22')](respondWithResult(_0x13150a,null))[_0x86ce('0x3e')](function(_0xcb328c){console['log'](_0x86ce('0xa4')+_0xcb328c);var _0x57bfda=_0x48fc3d[_0x86ce('0x2c')][_0x86ce('0xa5')]?0x1f4:_0xcb328c[_0x86ce('0xa6')]||0x1f4;logger[_0x86ce('0xa7')](_0xcb328c[_0x86ce('0x24')]);delete _0xcb328c[_0x86ce('0x25')];if(_0x57bfda===0x191){_0x57bfda=0x190;}_0x13150a[_0x86ce('0x17')](_0x57bfda)['send'](_0x48fc3d[_0x86ce('0x2c')][_0x86ce('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0xcb328c['statusCode']}:_0xcb328c);});};function createFieldObject(_0x30221e,_0xb3feed,_0xbd77c3,_0x247a70,_0x429d25,_0x236694){return new Promise(function(_0x194031,_0x5573ad){var _0x268fef={'id':_0x247a70,'name':_0x429d25,'custom':_0x236694};if(_0xbd77c3===_0x86ce('0xa8')){_0x268fef['options']=[{'name':_0x86ce('0xa9'),'value':_0x86ce('0xaa')},{'name':_0x86ce('0xab'),'value':_0x86ce('0xac')}];_0x194031(_0x268fef);}else{var _0x47ed5f={'method':'GET','uri':_0x30221e+'sys_choice?sysparm_query=name=incident^element='+_0x247a70,'auth':_0xb3feed,'json':!![]};return rp(_0x47ed5f)['then'](function(_0x2101e2){var _0x14d3f=[];if(_0x2101e2[_0x86ce('0x9a')]['length']>0x0){_0x2101e2[_0x86ce('0x9a')][_0x86ce('0x9e')](function(_0x43cc6a){if(_0x43cc6a[_0x86ce('0xad')]===_0x86ce('0xac')){var _0x2df243={'name':_0x43cc6a[_0x86ce('0xae')],'value':_0x43cc6a[_0x86ce('0xaf')]};_0x14d3f[_0x86ce('0xa2')](_0x2df243);}});}_0x268fef[_0x86ce('0x3a')]=_0x14d3f;if(_0x268fef[_0x86ce('0x3a')][_0x86ce('0x31')]>0x0){_0x194031(_0x268fef);}else{if(_0x236694==![]){_0x194031();}else{_0x194031(_0x268fef);}}});}});} \ No newline at end of file +var _0xb825=['log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','push','concat','test','statusCode','error','Wrong\x20credentials','true','false','sys_choice?sysparm_query=name=incident^element=','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ServicenowAccount','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','getConfigurations','params','ServicenowConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','correlation_id','findOne','password','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','username','incident?sysparm_display_value=all','result'];(function(_0x478927,_0x137268){var _0x37223f=function(_0x16faf8){while(--_0x16faf8){_0x478927['push'](_0x478927['shift']());}};_0x37223f(++_0x137268);}(_0xb825,0x174));var _0x5b82=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb825[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b82('0x0'));var zipdir=require(_0x5b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b82('0x2'));var moment=require('moment');var BPromise=require(_0x5b82('0x3'));var Mustache=require('mustache');var util=require(_0x5b82('0x4'));var path=require(_0x5b82('0x5'));var sox=require(_0x5b82('0x6'));var csv=require(_0x5b82('0x7'));var ejs=require(_0x5b82('0x8'));var fs=require('fs');var fs_extra=require(_0x5b82('0x9'));var _=require(_0x5b82('0xa'));var squel=require('squel');var crypto=require(_0x5b82('0xb'));var jsforce=require(_0x5b82('0xc'));var deskjs=require(_0x5b82('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5b82('0xe'));var Papa=require(_0x5b82('0xf'));var Redis=require('ioredis');var authService=require(_0x5b82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b82('0x11'));var hardwareService=require(_0x5b82('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x5b82('0x13'));function respondWithStatusCode(_0x41c240,_0x59d44c){_0x59d44c=_0x59d44c||0xcc;return function(_0x1bf7dc){if(_0x1bf7dc){return _0x41c240[_0x5b82('0x14')](_0x59d44c);}return _0x41c240['status'](_0x59d44c)[_0x5b82('0x15')]();};}function respondWithResult(_0x5771c0,_0x2a2db0){_0x2a2db0=_0x2a2db0||0xc8;return function(_0x1f4975){if(_0x1f4975){return _0x5771c0[_0x5b82('0x16')](_0x2a2db0)[_0x5b82('0x17')](_0x1f4975);}};}function respondWithFilteredResult(_0x3df521,_0x513f9b){return function(_0x113e52){if(_0x113e52){var _0x4ee114=typeof _0x513f9b[_0x5b82('0x18')]===_0x5b82('0x19')&&typeof _0x513f9b[_0x5b82('0x1a')]===_0x5b82('0x19');var _0x448ba4=_0x113e52[_0x5b82('0x1b')];var _0x344e64=_0x4ee114?0x0:_0x513f9b[_0x5b82('0x18')];var _0x5c2dbd=_0x4ee114?_0x113e52[_0x5b82('0x1b')]:_0x513f9b['offset']+_0x513f9b[_0x5b82('0x1a')];var _0x1315e5;if(_0x5c2dbd>=_0x448ba4){_0x5c2dbd=_0x448ba4;_0x1315e5=0xc8;}else{_0x1315e5=0xce;}_0x3df521[_0x5b82('0x16')](_0x1315e5);return _0x3df521[_0x5b82('0x1c')](_0x5b82('0x1d'),_0x344e64+'-'+_0x5c2dbd+'/'+_0x448ba4)[_0x5b82('0x17')](_0x113e52);}return null;};}function patchUpdates(_0x238757){return function(_0x41a2f7){try{jsonpatch[_0x5b82('0x1e')](_0x41a2f7,_0x238757,!![]);}catch(_0x11f87b){return BPromise[_0x5b82('0x1f')](_0x11f87b);}return _0x41a2f7[_0x5b82('0x20')]();};}function saveUpdates(_0x336a96,_0x4c6e5f){return function(_0x19cf88){if(_0x19cf88){return _0x19cf88[_0x5b82('0x21')](_0x336a96)[_0x5b82('0x22')](function(_0x57521e){return _0x57521e;});}return null;};}function removeEntity(_0x4a189d,_0x39dfe7){return function(_0x18dff7){if(_0x18dff7){return _0x18dff7['destroy']()[_0x5b82('0x22')](function(){_0x4a189d[_0x5b82('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb48ca,_0x16e7d4){return function(_0x4b3d56){if(!_0x4b3d56){_0xeb48ca[_0x5b82('0x14')](0x194);}return _0x4b3d56;};}function handleError(_0x29559e,_0x1b7341){_0x1b7341=_0x1b7341||0x1f4;return function(_0x374ac3){logger['error'](_0x374ac3[_0x5b82('0x23')]);if(_0x374ac3[_0x5b82('0x24')]){delete _0x374ac3[_0x5b82('0x24')];}_0x29559e[_0x5b82('0x16')](_0x1b7341)[_0x5b82('0x25')](_0x374ac3);};}exports['index']=function(_0x135efe,_0x25e4c2){var _0x226548={},_0x47d04e={},_0x42033e={'count':0x0,'rows':[]};var _0x452e53=_[_0x5b82('0x26')](db[_0x5b82('0x27')][_0x5b82('0x28')],function(_0x313048){return{'name':_0x313048['fieldName'],'type':_0x313048['type'][_0x5b82('0x29')]};});_0x47d04e[_0x5b82('0x2a')]=_['map'](_0x452e53,_0x5b82('0x24'));_0x47d04e['query']=_['keys'](_0x135efe[_0x5b82('0x2b')]);_0x47d04e[_0x5b82('0x2c')]=_['intersection'](_0x47d04e[_0x5b82('0x2a')],_0x47d04e[_0x5b82('0x2b')]);_0x226548[_0x5b82('0x2d')]=_[_0x5b82('0x2e')](_0x47d04e[_0x5b82('0x2a')],qs[_0x5b82('0x2f')](_0x135efe[_0x5b82('0x2b')][_0x5b82('0x2f')]));_0x226548['attributes']=_0x226548[_0x5b82('0x2d')][_0x5b82('0x30')]?_0x226548['attributes']:_0x47d04e[_0x5b82('0x2a')];if(!_0x135efe[_0x5b82('0x2b')]['hasOwnProperty'](_0x5b82('0x31'))){_0x226548[_0x5b82('0x1a')]=qs['limit'](_0x135efe[_0x5b82('0x2b')][_0x5b82('0x1a')]);_0x226548[_0x5b82('0x18')]=qs[_0x5b82('0x18')](_0x135efe['query'][_0x5b82('0x18')]);}_0x226548[_0x5b82('0x32')]=qs['sort'](_0x135efe[_0x5b82('0x2b')][_0x5b82('0x33')]);_0x226548['where']=qs[_0x5b82('0x2c')](_[_0x5b82('0x34')](_0x135efe[_0x5b82('0x2b')],_0x47d04e[_0x5b82('0x2c')]),_0x452e53);if(_0x135efe[_0x5b82('0x2b')][_0x5b82('0x35')]){_0x226548['where']=_[_0x5b82('0x36')](_0x226548['where'],{'$or':_[_0x5b82('0x26')](_0x452e53,function(_0x4deac7){if(_0x4deac7[_0x5b82('0x37')]!==_0x5b82('0x38')){var _0x59359f={};_0x59359f[_0x4deac7[_0x5b82('0x24')]]={'$like':'%'+_0x135efe[_0x5b82('0x2b')][_0x5b82('0x35')]+'%'};return _0x59359f;}})});}_0x226548=_['merge']({},_0x226548,_0x135efe[_0x5b82('0x39')]);var _0x460e77={'where':_0x226548[_0x5b82('0x3a')]};return db[_0x5b82('0x27')][_0x5b82('0x1b')](_0x460e77)['then'](function(_0xb4ea04){_0x42033e[_0x5b82('0x1b')]=_0xb4ea04;if(_0x135efe[_0x5b82('0x2b')]['includeAll']){_0x226548['include']=[{'all':!![]}];}return db[_0x5b82('0x27')][_0x5b82('0x3b')](_0x226548);})['then'](function(_0x135360){_0x42033e[_0x5b82('0x3c')]=_0x135360;return _0x42033e;})[_0x5b82('0x22')](respondWithFilteredResult(_0x25e4c2,_0x226548))[_0x5b82('0x3d')](handleError(_0x25e4c2,null));};exports[_0x5b82('0x3e')]=function(_0x1b0a0c,_0xc575bf){var _0x2baecd={'raw':![],'where':{'id':_0x1b0a0c['params']['id']}},_0x15ed7a={};_0x15ed7a[_0x5b82('0x2a')]=_[_0x5b82('0x3f')](db[_0x5b82('0x27')][_0x5b82('0x28')]);_0x15ed7a[_0x5b82('0x2b')]=_['keys'](_0x1b0a0c[_0x5b82('0x2b')]);_0x15ed7a['filters']=_[_0x5b82('0x2e')](_0x15ed7a['model'],_0x15ed7a[_0x5b82('0x2b')]);_0x2baecd['attributes']=_['intersection'](_0x15ed7a[_0x5b82('0x2a')],qs[_0x5b82('0x2f')](_0x1b0a0c[_0x5b82('0x2b')]['fields']));_0x2baecd['attributes']=_0x2baecd[_0x5b82('0x2d')][_0x5b82('0x30')]?_0x2baecd[_0x5b82('0x2d')]:_0x15ed7a[_0x5b82('0x2a')];if(_0x1b0a0c['query'][_0x5b82('0x40')]){_0x2baecd['include']=[{'all':!![]}];}_0x2baecd=_[_0x5b82('0x36')]({},_0x2baecd,_0x1b0a0c[_0x5b82('0x39')]);return db['ServicenowAccount'][_0x5b82('0x41')](_0x2baecd)[_0x5b82('0x22')](handleEntityNotFound(_0xc575bf,null))['then'](respondWithResult(_0xc575bf,null))['catch'](handleError(_0xc575bf,null));};exports[_0x5b82('0x42')]=function(_0x30755d,_0x4260f5){return db[_0x5b82('0x27')][_0x5b82('0x42')](_0x30755d[_0x5b82('0x43')],{})[_0x5b82('0x22')](respondWithResult(_0x4260f5,0xc9))[_0x5b82('0x3d')](handleError(_0x4260f5,null));};exports[_0x5b82('0x21')]=function(_0x4c19b8,_0x4338f0){if(_0x4c19b8[_0x5b82('0x43')]['id']){delete _0x4c19b8[_0x5b82('0x43')]['id'];}return db['ServicenowAccount'][_0x5b82('0x41')]({'where':{'id':_0x4c19b8['params']['id']}})[_0x5b82('0x22')](handleEntityNotFound(_0x4338f0,null))[_0x5b82('0x22')](saveUpdates(_0x4c19b8[_0x5b82('0x43')],null))['then'](respondWithResult(_0x4338f0,null))[_0x5b82('0x3d')](handleError(_0x4338f0,null));};exports[_0x5b82('0x44')]=function(_0x2bb2ea,_0x28aba2){return db[_0x5b82('0x27')][_0x5b82('0x41')]({'where':{'id':_0x2bb2ea['params']['id']}})[_0x5b82('0x22')](handleEntityNotFound(_0x28aba2,null))[_0x5b82('0x22')](removeEntity(_0x28aba2,null))[_0x5b82('0x3d')](handleError(_0x28aba2,null));};exports[_0x5b82('0x45')]=function(_0x3bec95,_0x5b3165,_0x439ffd){var _0x5c1865={};var _0x3d9f48={};var _0x1e17d3;var _0x5f065e;return db['ServicenowAccount']['findOne']({'where':{'id':_0x3bec95[_0x5b82('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b3165,null))[_0x5b82('0x22')](function(_0x3d689d){if(_0x3d689d){_0x1e17d3=_0x3d689d;_0x3d9f48[_0x5b82('0x2a')]=_[_0x5b82('0x3f')](db[_0x5b82('0x47')]['rawAttributes']);_0x3d9f48['query']=_[_0x5b82('0x3f')](_0x3bec95[_0x5b82('0x2b')]);_0x3d9f48[_0x5b82('0x2c')]=_[_0x5b82('0x2e')](_0x3d9f48[_0x5b82('0x2a')],_0x3d9f48['query']);_0x5c1865[_0x5b82('0x2d')]=_['intersection'](_0x3d9f48[_0x5b82('0x2a')],qs[_0x5b82('0x2f')](_0x3bec95['query']['fields']));_0x5c1865['attributes']=_0x5c1865[_0x5b82('0x2d')][_0x5b82('0x30')]?_0x5c1865[_0x5b82('0x2d')]:_0x3d9f48['model'];_0x5c1865[_0x5b82('0x32')]=qs[_0x5b82('0x33')](_0x3bec95['query']['sort']);_0x5c1865[_0x5b82('0x3a')]=qs[_0x5b82('0x2c')](_[_0x5b82('0x34')](_0x3bec95[_0x5b82('0x2b')],_0x3d9f48[_0x5b82('0x2c')]));if(_0x3bec95[_0x5b82('0x2b')][_0x5b82('0x35')]){_0x5c1865['where']=_['merge'](_0x5c1865[_0x5b82('0x3a')],{'$or':_[_0x5b82('0x26')](_0x5c1865[_0x5b82('0x2d')],function(_0x23082b){var _0x75fa0a={};_0x75fa0a[_0x23082b]={'$like':'%'+_0x3bec95[_0x5b82('0x2b')][_0x5b82('0x35')]+'%'};return _0x75fa0a;})});}_0x5c1865=_[_0x5b82('0x36')]({},_0x5c1865,_0x3bec95[_0x5b82('0x39')]);return _0x1e17d3[_0x5b82('0x45')](_0x5c1865);}})[_0x5b82('0x22')](function(_0x1c259b){if(_0x1c259b){_0x5f065e=_0x1c259b[_0x5b82('0x30')];if(!_0x3bec95[_0x5b82('0x2b')]['hasOwnProperty'](_0x5b82('0x31'))){_0x5c1865['limit']=qs[_0x5b82('0x1a')](_0x3bec95[_0x5b82('0x2b')]['limit']);_0x5c1865[_0x5b82('0x18')]=qs['offset'](_0x3bec95[_0x5b82('0x2b')][_0x5b82('0x18')]);}return _0x1e17d3[_0x5b82('0x45')](_0x5c1865);}})['then'](function(_0x8d9af8){if(_0x8d9af8){return _0x8d9af8?{'count':_0x5f065e,'rows':_0x8d9af8}:null;}})[_0x5b82('0x22')](respondWithResult(_0x5b3165,null))['catch'](handleError(_0x5b3165,null));};exports['addConfiguration']=function(_0xb5ec28,_0x514817,_0x18ca04){if(_0xb5ec28['body']['id']){delete _0xb5ec28[_0x5b82('0x43')]['id'];}return db[_0x5b82('0x27')]['findOne']({'where':{'id':_0xb5ec28[_0x5b82('0x46')]['id']}})[_0x5b82('0x22')](handleEntityNotFound(_0x514817,null))[_0x5b82('0x22')](function(_0x313927){if(_0x313927){_0xb5ec28['body'][_0x5b82('0x48')]=_0x313927['id'];_0xb5ec28[_0x5b82('0x43')][_0x5b82('0x49')]=integrations[_0x5b82('0x4a')](_0xb5ec28[_0x5b82('0x43')][_0x5b82('0x4b')],_0xb5ec28[_0x5b82('0x43')][_0x5b82('0x37')]);_0xb5ec28[_0x5b82('0x43')]['Descriptions']=integrations[_0x5b82('0x4c')](_0xb5ec28[_0x5b82('0x43')][_0x5b82('0x4b')],_0xb5ec28[_0x5b82('0x43')][_0x5b82('0x37')]);return db[_0x5b82('0x47')][_0x5b82('0x42')](_0xb5ec28[_0x5b82('0x43')],{'include':[{'model':db[_0x5b82('0x4d')],'as':_0x5b82('0x49')},{'model':db[_0x5b82('0x4d')],'as':_0x5b82('0x4e')}]});}return null;})[_0x5b82('0x22')](respondWithResult(_0x514817,null))[_0x5b82('0x3d')](handleError(_0x514817,null));};exports[_0x5b82('0x4f')]=function(_0x54ee06,_0x1159ab,_0x3744f1){var _0x993c24=[_0x5b82('0x50'),_0x5b82('0x51'),_0x5b82('0x52'),_0x5b82('0x53'),_0x5b82('0x54'),_0x5b82('0x55'),_0x5b82('0x56'),_0x5b82('0x57'),_0x5b82('0x58')];var _0x2f8472=['parent',_0x5b82('0x50'),_0x5b82('0x59'),_0x5b82('0x5a'),_0x5b82('0x5b'),_0x5b82('0x5c'),_0x5b82('0x5d'),'hold_reason',_0x5b82('0x5e'),_0x5b82('0x5f'),_0x5b82('0x60'),_0x5b82('0x61'),_0x5b82('0x62'),_0x5b82('0x63'),_0x5b82('0x64'),'sys_domain',_0x5b82('0x65'),_0x5b82('0x66'),'knowledge',_0x5b82('0x32'),_0x5b82('0x67'),_0x5b82('0x68'),_0x5b82('0x69'),_0x5b82('0x6a'),_0x5b82('0x6b'),_0x5b82('0x6c'),_0x5b82('0x6d'),_0x5b82('0x6e'),_0x5b82('0x6f'),_0x5b82('0x70'),'rfc',_0x5b82('0x71'),_0x5b82('0x72'),_0x5b82('0x73'),_0x5b82('0x74'),_0x5b82('0x75'),_0x5b82('0x76'),_0x5b82('0x77'),_0x5b82('0x78'),_0x5b82('0x79'),'approval_set',_0x5b82('0x53'),_0x5b82('0x7a'),_0x5b82('0x7b'),'close_code',_0x5b82('0x7c'),_0x5b82('0x7d'),_0x5b82('0x7e'),_0x5b82('0x7f'),_0x5b82('0x80'),'additional_assignee_list',_0x5b82('0x81'),_0x5b82('0x82'),_0x5b82('0x55'),_0x5b82('0x83'),'close_notes',_0x5b82('0x84'),_0x5b82('0x85'),_0x5b82('0x86'),'sys_id',_0x5b82('0x87'),_0x5b82('0x88'),'incident_state',_0x5b82('0x89'),'problem_id','company',_0x5b82('0x8a'),_0x5b82('0x8b'),_0x5b82('0x8c'),_0x5b82('0x57'),_0x5b82('0x8d'),'sla_due','approval',_0x5b82('0x8e'),_0x5b82('0x8f'),_0x5b82('0x90'),_0x5b82('0x91'),'sys_tags','escalation','upon_approval',_0x5b82('0x92'),'location',_0x5b82('0x58')];var _0x171098='';var _0x3b55d5='';var _0xffbd1a=[];var _0x14860f='';var _0x2aa74d='';var _0x2ec115=[];var _0x482f26='';var _0x2267e6='';var _0x62ce8e={};var _0x14dccb='';return db[_0x5b82('0x27')][_0x5b82('0x93')]({'where':{'id':_0x54ee06[_0x5b82('0x46')]['id']},'attributes':['id','username',_0x5b82('0x94'),_0x5b82('0x95'),'remoteUri',_0x5b82('0x96')]})[_0x5b82('0x22')](handleEntityNotFound(_0x1159ab,null))[_0x5b82('0x22')](function(_0x5c5ba8){if(_0x5c5ba8){_0x14dccb=_0x5c5ba8[_0x5b82('0x97')];var _0xe8dc90=_0x14dccb['slice'](-0x1);if(_0xe8dc90==='/'){_0x14dccb=_0x14dccb[_0x5b82('0x98')](0x0,_0x14dccb[_0x5b82('0x99')](_0xe8dc90));}_0x2267e6=util[_0x5b82('0x9a')](_0x5b82('0x9b'),_0x14dccb);_0x482f26=util[_0x5b82('0x9a')]('%s/api/now/table/',_0x14dccb);_0x62ce8e={'user':_0x5c5ba8[_0x5b82('0x9c')],'pass':_0x5c5ba8[_0x5b82('0x94')]};var _0xd32755={'method':'GET','uri':_0x2267e6+_0x5b82('0x9d'),'auth':_0x62ce8e,'json':!![]};return rp(_0xd32755);}})['then'](function(_0x307987){if(_0x307987[_0x5b82('0x9e')][_0x5b82('0x30')]>0x0){_0x171098=_0x307987['result'];}console[_0x5b82('0x9f')](_0x5b82('0xa0'),_0x171098);_0x2ec115=[];_0x3b55d5=Object[_0x5b82('0xa1')]([],_0x171098);_[_0x5b82('0xa2')](_0x3b55d5,function(_0x420d98){return!_0x993c24[_0x5b82('0xa3')](_0x420d98[_0x5b82('0x24')]);});_0x3b55d5[_0x5b82('0xa4')](function(_0x19f2ea){var _0x37fd3c=createFieldObject(_0x482f26,_0x62ce8e,_0x19f2ea[_0x5b82('0xa5')],_0x19f2ea[_0x5b82('0x24')],_0x19f2ea[_0x5b82('0xa6')],![]);_0x2ec115['push'](_0x37fd3c);});return Promise[_0x5b82('0xa7')](_0x2ec115);})[_0x5b82('0x22')](function(_0x2bf467){_0xffbd1a=_0x2bf467;_0x14860f=Object[_0x5b82('0xa1')]([],_0x171098);console['log']('TCL:\x20_object',_0x171098);_[_0x5b82('0xa2')](_0x14860f,function(_0x101e61){return _0x2f8472[_0x5b82('0xa3')](_0x101e61['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x14860f);_0x2ec115=[];_0x14860f['forEach'](function(_0x423f4f){var _0x5bcef6=createFieldObject(_0x482f26,_0x62ce8e,_0x423f4f[_0x5b82('0xa5')],_0x423f4f[_0x5b82('0x24')],_0x423f4f[_0x5b82('0xa6')],!![]);_0x2ec115[_0x5b82('0xa8')](_0x5bcef6);});return Promise['all'](_0x2ec115);})[_0x5b82('0x22')](function(_0x56a974){_0x2aa74d=_0x56a974;var _0x159ff8=_0xffbd1a[_0x5b82('0xa9')](_0x2aa74d);return{'count':_0x159ff8[_0x5b82('0x30')],'rows':_0x159ff8};})[_0x5b82('0x22')](respondWithResult(_0x1159ab,null))['catch'](function(_0x55bbcb){console['log']('ServiceNow\x20error:\x20'+_0x55bbcb);var _0x2f6452=_0x54ee06['query'][_0x5b82('0xaa')]?0x1f4:_0x55bbcb[_0x5b82('0xab')]||0x1f4;logger[_0x5b82('0xac')](_0x55bbcb[_0x5b82('0x23')]);delete _0x55bbcb[_0x5b82('0x24')];if(_0x2f6452===0x191){_0x2f6452=0x190;}_0x1159ab[_0x5b82('0x16')](_0x2f6452)[_0x5b82('0x25')](_0x54ee06['query'][_0x5b82('0xaa')]?{'message':_0x5b82('0xad'),'statusCode':_0x55bbcb['statusCode']}:_0x55bbcb);});};function createFieldObject(_0x11b53c,_0x4286f4,_0x3603b1,_0x5a849,_0x22f0af,_0x269041){return new Promise(function(_0x14d5dc,_0x20b6fd){var _0x54ed01={'id':_0x5a849,'name':_0x22f0af,'custom':_0x269041};if(_0x3603b1==='boolean'){_0x54ed01[_0x5b82('0x39')]=[{'name':'True','value':_0x5b82('0xae')},{'name':'False','value':_0x5b82('0xaf')}];_0x14d5dc(_0x54ed01);}else{var _0x29b19e={'method':'GET','uri':_0x11b53c+_0x5b82('0xb0')+_0x5a849,'auth':_0x4286f4,'json':!![]};return rp(_0x29b19e)[_0x5b82('0x22')](function(_0x4627c7){var _0x5df23a=[];if(_0x4627c7['result']['length']>0x0){_0x4627c7[_0x5b82('0x9e')][_0x5b82('0xa4')](function(_0x627b50){if(_0x627b50['inactive']===_0x5b82('0xaf')){var _0x4e672b={'name':_0x627b50[_0x5b82('0xa6')],'value':_0x627b50['value']};_0x5df23a[_0x5b82('0xa8')](_0x4e672b);}});}_0x54ed01[_0x5b82('0x39')]=_0x5df23a;if(_0x54ed01[_0x5b82('0x39')][_0x5b82('0x30')]>0x0){_0x14d5dc(_0x54ed01);}else{if(_0x269041==![]){_0x14d5dc();}else{_0x14d5dc(_0x54ed01);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1907954..962da56 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0x7c09,0x102));var _0x97c0=function(_0x5562b2,_0x6f71b5){_0x5562b2=_0x5562b2-0x0;var _0x27d71e=_0x7c09[_0x5562b2];return _0x27d71e;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x590368,_0x46fdd9){return _0x590368[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xca18be,_0x5bbe40){var _0x2815ad=function(_0x19b785){while(--_0x19b785){_0xca18be['push'](_0xca18be['shift']());}};_0x2815ad(++_0x5bbe40);}(_0x1883,0xab));var _0x3188=function(_0x50365c,_0x3c0c8b){_0x50365c=_0x50365c-0x0;var _0x330f1e=_0x1883[_0x50365c];return _0x330f1e;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 38ca819..1700f79 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcf6=['model','include','map','stringify','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit'];(function(_0x51c257,_0x3dafa2){var _0xaa4d1d=function(_0x32c148){while(--_0x32c148){_0x51c257['push'](_0x51c257['shift']());}};_0xaa4d1d(++_0x3dafa2);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x20e375,_0xdc0dde){_0x20e375=_0x20e375-0x0;var _0x55ac5d=_0xdcf6[_0x20e375];return _0x55ac5d;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5abd79,_0x56fdb2,_0x5766db){return new BPromise(function(_0x34517a,_0x4e2877){return client[_0x6dcf('0xb')](_0x5abd79,_0x5766db)[_0x6dcf('0xc')](function(_0x304a75){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x56fdb2,'request\x20sent');logger[_0x6dcf('0xd')](_0x6dcf('0xe'),_0x56fdb2,_0x6dcf('0xf'),JSON['stringify'](_0x304a75));if(_0x304a75[_0x6dcf('0x10')]){if(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x11')]===0x1f4){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x4e2877(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x34517a(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}else{logger[_0x6dcf('0x14')](_0x6dcf('0x12'),_0x56fdb2,'request\x20sent');_0x34517a(_0x304a75[_0x6dcf('0x15')][_0x6dcf('0x13')]);}})[_0x6dcf('0x16')](function(_0x4874ff){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x4874ff);_0x4e2877(_0x4874ff);});});}exports[_0x6dcf('0x17')]=function(_0x40b6ac){var _0x821c86=this;return new Promise(function(_0x83da87,_0x1bed56){return db[_0x6dcf('0x18')]['findAll']({'raw':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![],'where':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac['options'][_0x6dcf('0x1c')]||null:null,'limit':_0x40b6ac['options']?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1d')]||null:null,'include':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')]['include']?_['map'](_0x40b6ac[_0x6dcf('0x19')]['include'],function(_0x1df874){return{'model':db[_0x1df874[_0x6dcf('0x1e')]],'as':_0x1df874['as'],'attributes':_0x1df874[_0x6dcf('0x1c')],'include':_0x1df874[_0x6dcf('0x1f')]?_['map'](_0x1df874[_0x6dcf('0x1f')],function(_0x2b6dbe){return{'model':db[_0x2b6dbe[_0x6dcf('0x1e')]],'as':_0x2b6dbe['as'],'attributes':_0x2b6dbe[_0x6dcf('0x1c')],'include':_0x2b6dbe['include']?_[_0x6dcf('0x20')](_0x2b6dbe[_0x6dcf('0x1f')],function(_0x2dc909){return{'model':db[_0x2dc909[_0x6dcf('0x1e')]],'as':_0x2dc909['as'],'attributes':_0x2dc909[_0x6dcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6dcf('0xc')](function(_0x3fad7e){logger[_0x6dcf('0x14')](_0x6dcf('0x17'),_0x40b6ac);logger[_0x6dcf('0xd')](_0x6dcf('0x17'),_0x40b6ac,JSON[_0x6dcf('0x21')](_0x3fad7e));_0x83da87(_0x3fad7e);})['catch'](function(_0x3a4356){logger[_0x6dcf('0x10')]('GetServicenowAccount',_0x3a4356['message'],_0x40b6ac);_0x1bed56(_0x821c86['error'](0x1f4,_0x3a4356['message']));});});};exports[_0x6dcf('0x22')]=function(_0x356ad1){var _0x4c106c=this;return new Promise(function(_0x3d4615,_0x271c8e){return db[_0x6dcf('0x18')][_0x6dcf('0x23')]({'raw':_0x356ad1['options']?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![],'where':_0x356ad1[_0x6dcf('0x19')]?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x356ad1[_0x6dcf('0x19')]?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1c')]||null:null,'include':_0x356ad1[_0x6dcf('0x19')]?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1f')]?_[_0x6dcf('0x20')](_0x356ad1[_0x6dcf('0x19')]['include'],function(_0x3cfd7e){return{'model':db[_0x3cfd7e[_0x6dcf('0x1e')]],'as':_0x3cfd7e['as'],'attributes':_0x3cfd7e['attributes'],'include':_0x3cfd7e[_0x6dcf('0x1f')]?_[_0x6dcf('0x20')](_0x3cfd7e[_0x6dcf('0x1f')],function(_0x9ed57e){return{'model':db[_0x9ed57e[_0x6dcf('0x1e')]],'as':_0x9ed57e['as'],'attributes':_0x9ed57e[_0x6dcf('0x1c')],'include':_0x9ed57e[_0x6dcf('0x1f')]?_[_0x6dcf('0x20')](_0x9ed57e['include'],function(_0x2eb30f){return{'model':db[_0x2eb30f['model']],'as':_0x2eb30f['as'],'attributes':_0x2eb30f[_0x6dcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6dcf('0xc')](function(_0x38dfa4){logger[_0x6dcf('0x14')](_0x6dcf('0x22'),_0x356ad1);logger[_0x6dcf('0xd')]('ShowServicenowAccount',_0x356ad1,JSON[_0x6dcf('0x21')](_0x38dfa4));_0x3d4615(_0x38dfa4);})['catch'](function(_0x441fc0){logger['error'](_0x6dcf('0x22'),_0x441fc0[_0x6dcf('0x13')],_0x356ad1);_0x271c8e(_0x4c106c[_0x6dcf('0x10')](0x1f4,_0x441fc0['message']));});});}; \ No newline at end of file +var _0xe0a9=['jayson/promise','client','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','ShowServicenowAccount','find','then','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x4dbc43,_0x2f10bd){var _0x40b990=function(_0x21047a){while(--_0x21047a){_0x4dbc43['push'](_0x4dbc43['shift']());}};_0x40b990(++_0x2f10bd);}(_0xe0a9,0xc0));var _0x9e0a=function(_0x3dcf1e,_0xddb92e){_0x3dcf1e=_0x3dcf1e-0x0;var _0x12fd4c=_0xe0a9[_0x3dcf1e];return _0x12fd4c;};'use strict';var _=require('lodash');var util=require(_0x9e0a('0x0'));var moment=require(_0x9e0a('0x1'));var BPromise=require(_0x9e0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e0a('0x4'));var logger=require('../../config/logger')(_0x9e0a('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e0a('0x6'));var client=jayson[_0x9e0a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x426afd,_0x1dc342,_0x11e2cd){return new BPromise(function(_0x4f6f9d,_0x2d1ae3){return client[_0x9e0a('0x8')](_0x426afd,_0x11e2cd)['then'](function(_0x55e048){logger['info'](_0x9e0a('0x9'),_0x1dc342,_0x9e0a('0xa'));logger[_0x9e0a('0xb')](_0x9e0a('0xc'),_0x1dc342,_0x9e0a('0xa'),JSON[_0x9e0a('0xd')](_0x55e048));if(_0x55e048[_0x9e0a('0xe')]){if(_0x55e048[_0x9e0a('0xe')][_0x9e0a('0xf')]===0x1f4){logger['error'](_0x9e0a('0x9'),_0x1dc342,_0x55e048['error'][_0x9e0a('0x10')]);return _0x2d1ae3(_0x55e048[_0x9e0a('0xe')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1dc342,_0x55e048['error'][_0x9e0a('0x10')]);return _0x4f6f9d(_0x55e048[_0x9e0a('0xe')][_0x9e0a('0x10')]);}else{logger[_0x9e0a('0x11')](_0x9e0a('0x9'),_0x1dc342,_0x9e0a('0xa'));_0x4f6f9d(_0x55e048[_0x9e0a('0x12')][_0x9e0a('0x10')]);}})[_0x9e0a('0x13')](function(_0x20d1d5){logger[_0x9e0a('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x1dc342,_0x20d1d5);_0x2d1ae3(_0x20d1d5);});});}exports[_0x9e0a('0x14')]=function(_0x2401ce){var _0x81e141=this;return new Promise(function(_0x58e408,_0x56472e){return db[_0x9e0a('0x15')][_0x9e0a('0x16')]({'raw':_0x2401ce[_0x9e0a('0x17')]?_0x2401ce['options'][_0x9e0a('0x18')]===undefined?!![]:![]:!![],'where':_0x2401ce[_0x9e0a('0x17')]?_0x2401ce[_0x9e0a('0x17')][_0x9e0a('0x19')]||null:null,'attributes':_0x2401ce[_0x9e0a('0x17')]?_0x2401ce[_0x9e0a('0x17')][_0x9e0a('0x1a')]||null:null,'limit':_0x2401ce['options']?_0x2401ce[_0x9e0a('0x17')]['limit']||null:null,'include':_0x2401ce['options']?_0x2401ce[_0x9e0a('0x17')][_0x9e0a('0x1b')]?_[_0x9e0a('0x1c')](_0x2401ce[_0x9e0a('0x17')][_0x9e0a('0x1b')],function(_0xa5a412){return{'model':db[_0xa5a412['model']],'as':_0xa5a412['as'],'attributes':_0xa5a412[_0x9e0a('0x1a')],'include':_0xa5a412[_0x9e0a('0x1b')]?_[_0x9e0a('0x1c')](_0xa5a412[_0x9e0a('0x1b')],function(_0x5dc497){return{'model':db[_0x5dc497[_0x9e0a('0x1d')]],'as':_0x5dc497['as'],'attributes':_0x5dc497[_0x9e0a('0x1a')],'include':_0x5dc497['include']?_[_0x9e0a('0x1c')](_0x5dc497[_0x9e0a('0x1b')],function(_0x14df6b){return{'model':db[_0x14df6b[_0x9e0a('0x1d')]],'as':_0x14df6b['as'],'attributes':_0x14df6b[_0x9e0a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b75af){logger[_0x9e0a('0x11')](_0x9e0a('0x14'),_0x2401ce);logger[_0x9e0a('0xb')](_0x9e0a('0x14'),_0x2401ce,JSON['stringify'](_0x1b75af));_0x58e408(_0x1b75af);})[_0x9e0a('0x13')](function(_0x51c9b1){logger['error'](_0x9e0a('0x14'),_0x51c9b1[_0x9e0a('0x10')],_0x2401ce);_0x56472e(_0x81e141[_0x9e0a('0xe')](0x1f4,_0x51c9b1[_0x9e0a('0x10')]));});});};exports[_0x9e0a('0x1e')]=function(_0x59db20){var _0x505d48=this;return new Promise(function(_0x3e490,_0x54a13c){return db[_0x9e0a('0x15')][_0x9e0a('0x1f')]({'raw':_0x59db20[_0x9e0a('0x17')]?_0x59db20['options'][_0x9e0a('0x18')]===undefined?!![]:![]:!![],'where':_0x59db20[_0x9e0a('0x17')]?_0x59db20[_0x9e0a('0x17')][_0x9e0a('0x19')]||null:null,'attributes':_0x59db20[_0x9e0a('0x17')]?_0x59db20[_0x9e0a('0x17')][_0x9e0a('0x1a')]||null:null,'include':_0x59db20['options']?_0x59db20['options'][_0x9e0a('0x1b')]?_['map'](_0x59db20[_0x9e0a('0x17')]['include'],function(_0x5c7cd8){return{'model':db[_0x5c7cd8[_0x9e0a('0x1d')]],'as':_0x5c7cd8['as'],'attributes':_0x5c7cd8[_0x9e0a('0x1a')],'include':_0x5c7cd8[_0x9e0a('0x1b')]?_['map'](_0x5c7cd8[_0x9e0a('0x1b')],function(_0x37c30f){return{'model':db[_0x37c30f[_0x9e0a('0x1d')]],'as':_0x37c30f['as'],'attributes':_0x37c30f[_0x9e0a('0x1a')],'include':_0x37c30f[_0x9e0a('0x1b')]?_[_0x9e0a('0x1c')](_0x37c30f['include'],function(_0xec44b6){return{'model':db[_0xec44b6['model']],'as':_0xec44b6['as'],'attributes':_0xec44b6[_0x9e0a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9e0a('0x20')](function(_0xa6c2){logger['info'](_0x9e0a('0x1e'),_0x59db20);logger[_0x9e0a('0xb')](_0x9e0a('0x1e'),_0x59db20,JSON[_0x9e0a('0xd')](_0xa6c2));_0x3e490(_0xa6c2);})[_0x9e0a('0x13')](function(_0x178294){logger[_0x9e0a('0xe')](_0x9e0a('0x1e'),_0x178294[_0x9e0a('0x10')],_0x59db20);_0x54a13c(_0x505d48[_0x9e0a('0xe')](0x1f4,_0x178294[_0x9e0a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4d192ac..f0da03d 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e09=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x178247,_0x36b657){var _0x2c4155=function(_0x188dc1){while(--_0x188dc1){_0x178247['push'](_0x178247['shift']());}};_0x2c4155(++_0x36b657);}(_0x9e09,0x1e7));var _0x99e0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9e09[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x99e0('0x0'));var util=require('util');var path=require(_0x99e0('0x1'));var timeout=require(_0x99e0('0x2'));var express=require('express');var router=express[_0x99e0('0x3')]();var fs_extra=require(_0x99e0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x99e0('0x5'));var config=require(_0x99e0('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x99e0('0x7')]('/',auth[_0x99e0('0x8')](),controller['index']);router[_0x99e0('0x7')]('/:id',auth[_0x99e0('0x8')](),controller[_0x99e0('0x9')]);router[_0x99e0('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x99e0('0xa')]);router[_0x99e0('0x7')](_0x99e0('0xb'),auth[_0x99e0('0x8')](),controller[_0x99e0('0xc')]);router[_0x99e0('0x7')](_0x99e0('0xd'),auth[_0x99e0('0x8')](),controller[_0x99e0('0xe')]);router[_0x99e0('0xf')]('/',auth['isAuthenticated'](),controller[_0x99e0('0x10')]);router[_0x99e0('0x11')](_0x99e0('0x12'),auth[_0x99e0('0x8')](),controller[_0x99e0('0x13')]);router[_0x99e0('0x14')](_0x99e0('0x12'),auth[_0x99e0('0x8')](),controller[_0x99e0('0x15')]);module[_0x99e0('0x16')]=router; \ No newline at end of file +var _0x96a1=['../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf77d7d,_0x5c170a){var _0x25d379=function(_0x12e6cf){while(--_0x12e6cf){_0xf77d7d['push'](_0xf77d7d['shift']());}};_0x25d379(++_0x5c170a);}(_0x96a1,0x83));var _0x196a=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x96a1[_0x367e5b];return _0x4b909e;};'use strict';var multer=require(_0x196a('0x0'));var util=require('util');var path=require(_0x196a('0x1'));var timeout=require(_0x196a('0x2'));var express=require('express');var router=express[_0x196a('0x3')]();var fs_extra=require(_0x196a('0x4'));var auth=require(_0x196a('0x5'));var interaction=require(_0x196a('0x6'));var config=require(_0x196a('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x196a('0x8')]('/',auth[_0x196a('0x9')](),controller['index']);router['get']('/:id',auth[_0x196a('0x9')](),controller[_0x196a('0xa')]);router[_0x196a('0x8')](_0x196a('0xb'),auth[_0x196a('0x9')](),controller[_0x196a('0xc')]);router[_0x196a('0x8')](_0x196a('0xd'),auth[_0x196a('0x9')](),controller[_0x196a('0xe')]);router['get']('/:id/descriptions',auth[_0x196a('0x9')](),controller['getDescriptions']);router[_0x196a('0xf')]('/',auth[_0x196a('0x9')](),controller[_0x196a('0x10')]);router[_0x196a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x196a('0x12')]);router[_0x196a('0x13')](_0x196a('0x14'),auth[_0x196a('0x9')](),controller[_0x196a('0x15')]);module[_0x196a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 7b8e865..8aac526 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0e2=['exports','STRING','sequelize'];(function(_0x5811c9,_0x53aa8c){var _0x353260=function(_0xf2c512){while(--_0xf2c512){_0x5811c9['push'](_0x5811c9['shift']());}};_0x353260(++_0x53aa8c);}(_0xc0e2,0xaa));var _0x2c0e=function(_0xe66674,_0x251e54){_0xe66674=_0xe66674-0x0;var _0x4c750e=_0xc0e2[_0xe66674];return _0x4c750e;};'use strict';var Sequelize=require(_0x2c0e('0x0'));module[_0x2c0e('0x1')]={'name':{'type':Sequelize[_0x2c0e('0x2')]},'description':{'type':Sequelize[_0x2c0e('0x2')]}}; \ No newline at end of file +var _0x7e4b=['exports','STRING','sequelize'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0x7e4b,0x18b));var _0xb7e4=function(_0x4c118a,_0x3f38b3){_0x4c118a=_0x4c118a-0x0;var _0x410ba2=_0x7e4b[_0x4c118a];return _0x410ba2;};'use strict';var Sequelize=require(_0xb7e4('0x0'));module[_0xb7e4('0x1')]={'name':{'type':Sequelize[_0xb7e4('0x2')]},'description':{'type':Sequelize[_0xb7e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 7585874..e0aa4f3 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46e6=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ServicenowConfiguration','findAll','show','params','keys','find','body','catch','findOne','nolimit','getSubjects','getDescriptions','ServicenowField','fast-json-patch','request-promise','moment','mustache'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x46e6,0x169));var _0x646e=function(_0x3b2f1b,_0xecb07c){_0x3b2f1b=_0x3b2f1b-0x0;var _0x3d86cb=_0x46e6[_0x3b2f1b];return _0x3d86cb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x646e('0x0'));var rp=require(_0x646e('0x1'));var moment=require(_0x646e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x646e('0x3'));var util=require(_0x646e('0x4'));var path=require(_0x646e('0x5'));var sox=require('sox');var csv=require(_0x646e('0x6'));var ejs=require(_0x646e('0x7'));var fs=require('fs');var fs_extra=require(_0x646e('0x8'));var _=require(_0x646e('0x9'));var squel=require(_0x646e('0xa'));var crypto=require(_0x646e('0xb'));var jsforce=require(_0x646e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x646e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x646e('0xe'));var as=require(_0x646e('0xf'));var hardwareService=require(_0x646e('0x10'));var logger=require(_0x646e('0x11'))(_0x646e('0x12'));var utils=require(_0x646e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6c4af0,_0x52d016){_0x52d016=_0x52d016||0xcc;return function(_0x2a6de6){if(_0x2a6de6){return _0x6c4af0[_0x646e('0x14')](_0x52d016);}return _0x6c4af0[_0x646e('0x15')](_0x52d016)[_0x646e('0x16')]();};}function respondWithResult(_0x48505a,_0x473091){_0x473091=_0x473091||0xc8;return function(_0x25c67c){if(_0x25c67c){return _0x48505a[_0x646e('0x15')](_0x473091)[_0x646e('0x17')](_0x25c67c);}};}function respondWithFilteredResult(_0x2e7ecb,_0x44d3ff){return function(_0x289c93){if(_0x289c93){var _0x541a59=typeof _0x44d3ff[_0x646e('0x18')]===_0x646e('0x19')&&typeof _0x44d3ff[_0x646e('0x1a')]==='undefined';var _0x167a07=_0x289c93[_0x646e('0x1b')];var _0x17e022=_0x541a59?0x0:_0x44d3ff['offset'];var _0x2213db=_0x541a59?_0x289c93[_0x646e('0x1b')]:_0x44d3ff[_0x646e('0x18')]+_0x44d3ff[_0x646e('0x1a')];var _0x59b689;if(_0x2213db>=_0x167a07){_0x2213db=_0x167a07;_0x59b689=0xc8;}else{_0x59b689=0xce;}_0x2e7ecb[_0x646e('0x15')](_0x59b689);return _0x2e7ecb[_0x646e('0x1c')](_0x646e('0x1d'),_0x17e022+'-'+_0x2213db+'/'+_0x167a07)[_0x646e('0x17')](_0x289c93);}return null;};}function patchUpdates(_0x55526c){return function(_0x377e61){try{jsonpatch[_0x646e('0x1e')](_0x377e61,_0x55526c,!![]);}catch(_0x36eef8){return BPromise['reject'](_0x36eef8);}return _0x377e61[_0x646e('0x1f')]();};}function saveUpdates(_0x323eb2,_0x24bbde){return function(_0x329c4a){if(_0x329c4a){return _0x329c4a['update'](_0x323eb2)[_0x646e('0x20')](function(_0x2c2767){return _0x2c2767;});}return null;};}function removeEntity(_0x2a577e,_0x417cfe){return function(_0x1c4c06){if(_0x1c4c06){return _0x1c4c06['destroy']()[_0x646e('0x20')](function(){_0x2a577e[_0x646e('0x15')](0xcc)[_0x646e('0x16')]();});}};}function handleEntityNotFound(_0x4d038b,_0x7b3ef2){return function(_0x22581f){if(!_0x22581f){_0x4d038b[_0x646e('0x14')](0x194);}return _0x22581f;};}function handleError(_0x1e20a9,_0x211399){_0x211399=_0x211399||0x1f4;return function(_0x13a9bc){logger[_0x646e('0x21')](_0x13a9bc[_0x646e('0x22')]);if(_0x13a9bc[_0x646e('0x23')]){delete _0x13a9bc[_0x646e('0x23')];}_0x1e20a9['status'](_0x211399)[_0x646e('0x24')](_0x13a9bc);};}exports['index']=function(_0x2ffea8,_0x36f01b){var _0x5e7536={},_0x5e77fa={},_0x41bdad={'count':0x0,'rows':[]};var _0x2cf69e=_[_0x646e('0x25')](db['ServicenowConfiguration'][_0x646e('0x26')],function(_0x22341d){return{'name':_0x22341d[_0x646e('0x27')],'type':_0x22341d['type'][_0x646e('0x28')]};});_0x5e77fa[_0x646e('0x29')]=_[_0x646e('0x25')](_0x2cf69e,'name');_0x5e77fa[_0x646e('0x2a')]=_['keys'](_0x2ffea8[_0x646e('0x2a')]);_0x5e77fa[_0x646e('0x2b')]=_[_0x646e('0x2c')](_0x5e77fa[_0x646e('0x29')],_0x5e77fa[_0x646e('0x2a')]);_0x5e7536['attributes']=_[_0x646e('0x2c')](_0x5e77fa[_0x646e('0x29')],qs[_0x646e('0x2d')](_0x2ffea8[_0x646e('0x2a')][_0x646e('0x2d')]));_0x5e7536[_0x646e('0x2e')]=_0x5e7536[_0x646e('0x2e')][_0x646e('0x2f')]?_0x5e7536['attributes']:_0x5e77fa['model'];if(!_0x2ffea8[_0x646e('0x2a')][_0x646e('0x30')]('nolimit')){_0x5e7536[_0x646e('0x1a')]=qs[_0x646e('0x1a')](_0x2ffea8[_0x646e('0x2a')]['limit']);_0x5e7536[_0x646e('0x18')]=qs[_0x646e('0x18')](_0x2ffea8[_0x646e('0x2a')][_0x646e('0x18')]);}_0x5e7536[_0x646e('0x31')]=qs[_0x646e('0x32')](_0x2ffea8[_0x646e('0x2a')][_0x646e('0x32')]);_0x5e7536[_0x646e('0x33')]=qs['filters'](_[_0x646e('0x34')](_0x2ffea8[_0x646e('0x2a')],_0x5e77fa[_0x646e('0x2b')]),_0x2cf69e);if(_0x2ffea8[_0x646e('0x2a')][_0x646e('0x35')]){_0x5e7536[_0x646e('0x33')]=_[_0x646e('0x36')](_0x5e7536[_0x646e('0x33')],{'$or':_[_0x646e('0x25')](_0x2cf69e,function(_0x396e5d){if(_0x396e5d[_0x646e('0x37')]!==_0x646e('0x38')){var _0x37a5b4={};_0x37a5b4[_0x396e5d['name']]={'$like':'%'+_0x2ffea8[_0x646e('0x2a')][_0x646e('0x35')]+'%'};return _0x37a5b4;}})});}_0x5e7536=_['merge']({},_0x5e7536,_0x2ffea8[_0x646e('0x39')]);var _0x2a5813={'where':_0x5e7536[_0x646e('0x33')]};return db['ServicenowConfiguration'][_0x646e('0x1b')](_0x2a5813)[_0x646e('0x20')](function(_0x9a443){_0x41bdad['count']=_0x9a443;if(_0x2ffea8[_0x646e('0x2a')][_0x646e('0x3a')]){_0x5e7536[_0x646e('0x3b')]=[{'all':!![]}];}return db[_0x646e('0x3c')][_0x646e('0x3d')](_0x5e7536);})[_0x646e('0x20')](function(_0x48aea4){_0x41bdad['rows']=_0x48aea4;return _0x41bdad;})['then'](respondWithFilteredResult(_0x36f01b,_0x5e7536))['catch'](handleError(_0x36f01b,null));};exports[_0x646e('0x3e')]=function(_0x1c2d83,_0x561ae1){var _0x597df5={'raw':![],'where':{'id':_0x1c2d83[_0x646e('0x3f')]['id']}},_0x5eb8ef={};_0x5eb8ef[_0x646e('0x29')]=_[_0x646e('0x40')](db[_0x646e('0x3c')][_0x646e('0x26')]);_0x5eb8ef[_0x646e('0x2a')]=_[_0x646e('0x40')](_0x1c2d83['query']);_0x5eb8ef[_0x646e('0x2b')]=_[_0x646e('0x2c')](_0x5eb8ef[_0x646e('0x29')],_0x5eb8ef['query']);_0x597df5['attributes']=_[_0x646e('0x2c')](_0x5eb8ef[_0x646e('0x29')],qs[_0x646e('0x2d')](_0x1c2d83[_0x646e('0x2a')][_0x646e('0x2d')]));_0x597df5[_0x646e('0x2e')]=_0x597df5[_0x646e('0x2e')][_0x646e('0x2f')]?_0x597df5[_0x646e('0x2e')]:_0x5eb8ef['model'];if(_0x1c2d83[_0x646e('0x2a')][_0x646e('0x3a')]){_0x597df5[_0x646e('0x3b')]=[{'all':!![]}];}_0x597df5=_[_0x646e('0x36')]({},_0x597df5,_0x1c2d83[_0x646e('0x39')]);return db[_0x646e('0x3c')][_0x646e('0x41')](_0x597df5)[_0x646e('0x20')](handleEntityNotFound(_0x561ae1,null))[_0x646e('0x20')](respondWithResult(_0x561ae1,null))['catch'](handleError(_0x561ae1,null));};exports['create']=function(_0x47b8d3,_0xfc73e2){return db[_0x646e('0x3c')]['create'](_0x47b8d3[_0x646e('0x42')],{})['then'](respondWithResult(_0xfc73e2,0xc9))['catch'](handleError(_0xfc73e2,null));};exports['update']=function(_0x3d32a9,_0x15d311){if(_0x3d32a9['body']['id']){delete _0x3d32a9[_0x646e('0x42')]['id'];}return db[_0x646e('0x3c')][_0x646e('0x41')]({'where':{'id':_0x3d32a9[_0x646e('0x3f')]['id']}})[_0x646e('0x20')](handleEntityNotFound(_0x15d311,null))['then'](saveUpdates(_0x3d32a9[_0x646e('0x42')],null))['then'](respondWithResult(_0x15d311,null))['catch'](handleError(_0x15d311,null));};exports['destroy']=function(_0x524927,_0x1b2d79){return db[_0x646e('0x3c')][_0x646e('0x41')]({'where':{'id':_0x524927[_0x646e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1b2d79,null))['then'](removeEntity(_0x1b2d79,null))[_0x646e('0x43')](handleError(_0x1b2d79,null));};exports['getFields']=function(_0x4e1b32,_0x4430ff,_0x129fdf){var _0x33c772={};var _0x2c75d4={};var _0x1a805c;var _0x177645;return db['ServicenowConfiguration'][_0x646e('0x44')]({'where':{'id':_0x4e1b32[_0x646e('0x3f')]['id']}})[_0x646e('0x20')](handleEntityNotFound(_0x4430ff,null))['then'](function(_0x2cafa9){if(_0x2cafa9){_0x1a805c=_0x2cafa9;_0x2c75d4[_0x646e('0x29')]=_[_0x646e('0x40')](db['ServicenowField'][_0x646e('0x26')]);_0x2c75d4[_0x646e('0x2a')]=_[_0x646e('0x40')](_0x4e1b32[_0x646e('0x2a')]);_0x2c75d4[_0x646e('0x2b')]=_['intersection'](_0x2c75d4['model'],_0x2c75d4[_0x646e('0x2a')]);_0x33c772[_0x646e('0x2e')]=_[_0x646e('0x2c')](_0x2c75d4['model'],qs[_0x646e('0x2d')](_0x4e1b32[_0x646e('0x2a')][_0x646e('0x2d')]));_0x33c772[_0x646e('0x2e')]=_0x33c772[_0x646e('0x2e')][_0x646e('0x2f')]?_0x33c772[_0x646e('0x2e')]:_0x2c75d4[_0x646e('0x29')];_0x33c772[_0x646e('0x31')]=qs['sort'](_0x4e1b32['query']['sort']);_0x33c772[_0x646e('0x33')]=qs[_0x646e('0x2b')](_[_0x646e('0x34')](_0x4e1b32[_0x646e('0x2a')],_0x2c75d4['filters']));if(_0x4e1b32[_0x646e('0x2a')][_0x646e('0x35')]){_0x33c772[_0x646e('0x33')]=_['merge'](_0x33c772[_0x646e('0x33')],{'$or':_[_0x646e('0x25')](_0x33c772[_0x646e('0x2e')],function(_0x379984){var _0x31c61a={};_0x31c61a[_0x379984]={'$like':'%'+_0x4e1b32[_0x646e('0x2a')]['filter']+'%'};return _0x31c61a;})});}_0x33c772=_['merge']({},_0x33c772,_0x4e1b32[_0x646e('0x39')]);return _0x1a805c['getFields'](_0x33c772);}})[_0x646e('0x20')](function(_0x24c350){if(_0x24c350){_0x177645=_0x24c350[_0x646e('0x2f')];if(!_0x4e1b32['query'][_0x646e('0x30')](_0x646e('0x45'))){_0x33c772[_0x646e('0x1a')]=qs[_0x646e('0x1a')](_0x4e1b32[_0x646e('0x2a')][_0x646e('0x1a')]);_0x33c772[_0x646e('0x18')]=qs['offset'](_0x4e1b32['query'][_0x646e('0x18')]);}return _0x1a805c['getFields'](_0x33c772);}})['then'](function(_0x4ecc57){if(_0x4ecc57){return _0x4ecc57?{'count':_0x177645,'rows':_0x4ecc57}:null;}})[_0x646e('0x20')](respondWithResult(_0x4430ff,null))['catch'](handleError(_0x4430ff,null));};exports['getSubjects']=function(_0x4c8f10,_0x13ac99,_0x117e83){var _0x324f43={};var _0x5d7364={};var _0x38eb30;var _0x3a0b82;return db['ServicenowConfiguration'][_0x646e('0x44')]({'where':{'id':_0x4c8f10['params']['id']}})[_0x646e('0x20')](handleEntityNotFound(_0x13ac99,null))[_0x646e('0x20')](function(_0x1c4aae){if(_0x1c4aae){_0x38eb30=_0x1c4aae;_0x5d7364['model']=_[_0x646e('0x40')](db['ServicenowField'][_0x646e('0x26')]);_0x5d7364[_0x646e('0x2a')]=_[_0x646e('0x40')](_0x4c8f10['query']);_0x5d7364[_0x646e('0x2b')]=_['intersection'](_0x5d7364[_0x646e('0x29')],_0x5d7364[_0x646e('0x2a')]);_0x324f43['attributes']=_[_0x646e('0x2c')](_0x5d7364[_0x646e('0x29')],qs[_0x646e('0x2d')](_0x4c8f10[_0x646e('0x2a')][_0x646e('0x2d')]));_0x324f43[_0x646e('0x2e')]=_0x324f43[_0x646e('0x2e')]['length']?_0x324f43[_0x646e('0x2e')]:_0x5d7364[_0x646e('0x29')];_0x324f43[_0x646e('0x31')]=qs[_0x646e('0x32')](_0x4c8f10[_0x646e('0x2a')][_0x646e('0x32')]);_0x324f43['where']=qs['filters'](_[_0x646e('0x34')](_0x4c8f10[_0x646e('0x2a')],_0x5d7364[_0x646e('0x2b')]));if(_0x4c8f10['query'][_0x646e('0x35')]){_0x324f43[_0x646e('0x33')]=_['merge'](_0x324f43[_0x646e('0x33')],{'$or':_[_0x646e('0x25')](_0x324f43[_0x646e('0x2e')],function(_0x72037b){var _0x43d6d2={};_0x43d6d2[_0x72037b]={'$like':'%'+_0x4c8f10[_0x646e('0x2a')]['filter']+'%'};return _0x43d6d2;})});}_0x324f43=_[_0x646e('0x36')]({},_0x324f43,_0x4c8f10['options']);return _0x38eb30[_0x646e('0x46')](_0x324f43);}})['then'](function(_0x57a515){if(_0x57a515){_0x3a0b82=_0x57a515[_0x646e('0x2f')];if(!_0x4c8f10[_0x646e('0x2a')][_0x646e('0x30')](_0x646e('0x45'))){_0x324f43[_0x646e('0x1a')]=qs[_0x646e('0x1a')](_0x4c8f10[_0x646e('0x2a')]['limit']);_0x324f43[_0x646e('0x18')]=qs[_0x646e('0x18')](_0x4c8f10[_0x646e('0x2a')][_0x646e('0x18')]);}return _0x38eb30['getSubjects'](_0x324f43);}})['then'](function(_0x3e8d4c){if(_0x3e8d4c){return _0x3e8d4c?{'count':_0x3a0b82,'rows':_0x3e8d4c}:null;}})['then'](respondWithResult(_0x13ac99,null))[_0x646e('0x43')](handleError(_0x13ac99,null));};exports[_0x646e('0x47')]=function(_0x25986d,_0x5dfbb7,_0x2ea825){var _0x3b86fa={};var _0x2f0fce={};var _0x19124b;var _0x447d01;return db[_0x646e('0x3c')]['findOne']({'where':{'id':_0x25986d[_0x646e('0x3f')]['id']}})[_0x646e('0x20')](handleEntityNotFound(_0x5dfbb7,null))[_0x646e('0x20')](function(_0x592322){if(_0x592322){_0x19124b=_0x592322;_0x2f0fce['model']=_[_0x646e('0x40')](db[_0x646e('0x48')]['rawAttributes']);_0x2f0fce[_0x646e('0x2a')]=_[_0x646e('0x40')](_0x25986d['query']);_0x2f0fce[_0x646e('0x2b')]=_['intersection'](_0x2f0fce['model'],_0x2f0fce[_0x646e('0x2a')]);_0x3b86fa[_0x646e('0x2e')]=_[_0x646e('0x2c')](_0x2f0fce['model'],qs[_0x646e('0x2d')](_0x25986d['query']['fields']));_0x3b86fa[_0x646e('0x2e')]=_0x3b86fa[_0x646e('0x2e')][_0x646e('0x2f')]?_0x3b86fa['attributes']:_0x2f0fce[_0x646e('0x29')];_0x3b86fa[_0x646e('0x31')]=qs[_0x646e('0x32')](_0x25986d[_0x646e('0x2a')]['sort']);_0x3b86fa['where']=qs[_0x646e('0x2b')](_['pick'](_0x25986d['query'],_0x2f0fce[_0x646e('0x2b')]));if(_0x25986d['query'][_0x646e('0x35')]){_0x3b86fa[_0x646e('0x33')]=_[_0x646e('0x36')](_0x3b86fa[_0x646e('0x33')],{'$or':_['map'](_0x3b86fa['attributes'],function(_0x500217){var _0x14ba7e={};_0x14ba7e[_0x500217]={'$like':'%'+_0x25986d[_0x646e('0x2a')][_0x646e('0x35')]+'%'};return _0x14ba7e;})});}_0x3b86fa=_['merge']({},_0x3b86fa,_0x25986d[_0x646e('0x39')]);return _0x19124b[_0x646e('0x47')](_0x3b86fa);}})['then'](function(_0x47daa0){if(_0x47daa0){_0x447d01=_0x47daa0[_0x646e('0x2f')];if(!_0x25986d['query'][_0x646e('0x30')](_0x646e('0x45'))){_0x3b86fa[_0x646e('0x1a')]=qs[_0x646e('0x1a')](_0x25986d[_0x646e('0x2a')][_0x646e('0x1a')]);_0x3b86fa[_0x646e('0x18')]=qs[_0x646e('0x18')](_0x25986d[_0x646e('0x2a')][_0x646e('0x18')]);}return _0x19124b[_0x646e('0x47')](_0x3b86fa);}})['then'](function(_0x4bdaa4){if(_0x4bdaa4){return _0x4bdaa4?{'count':_0x447d01,'rows':_0x4bdaa4}:null;}})[_0x646e('0x20')](respondWithResult(_0x5dfbb7,null))['catch'](handleError(_0x5dfbb7,null));}; \ No newline at end of file +var _0xdeae=['offset','limit','undefined','count','set','apply','reject','update','then','name','send','ServicenowConfiguration','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','sort','where','pick','VIRTUAL','filter','merge','options','include','rows','catch','show','params','find','create','body','findOne','ServicenowField','order','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x289cf5,_0x501dfc){var _0x1f316d=function(_0x4180c4){while(--_0x4180c4){_0x289cf5['push'](_0x289cf5['shift']());}};_0x1f316d(++_0x501dfc);}(_0xdeae,0x1a6));var _0xedea=function(_0x77ad9d,_0x516a82){_0x77ad9d=_0x77ad9d-0x0;var _0x561706=_0xdeae[_0x77ad9d];return _0x561706;};'use strict';var emlformat=require(_0xedea('0x0'));var rimraf=require(_0xedea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedea('0x2'));var rp=require('request-promise');var moment=require(_0xedea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xedea('0x4'));var util=require(_0xedea('0x5'));var path=require(_0xedea('0x6'));var sox=require(_0xedea('0x7'));var csv=require(_0xedea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedea('0x9'));var _=require(_0xedea('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xedea('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xedea('0x8'));var querystring=require(_0xedea('0xc'));var Papa=require(_0xedea('0xd'));var Redis=require(_0xedea('0xe'));var authService=require(_0xedea('0xf'));var qs=require(_0xedea('0x10'));var as=require(_0xedea('0x11'));var hardwareService=require(_0xedea('0x12'));var logger=require(_0xedea('0x13'))(_0xedea('0x14'));var utils=require('../../config/utils');var config=require(_0xedea('0x15'));var licenseUtil=require(_0xedea('0x16'));var db=require(_0xedea('0x17'))['db'];function respondWithStatusCode(_0x4aced9,_0x14ff96){_0x14ff96=_0x14ff96||0xcc;return function(_0x578403){if(_0x578403){return _0x4aced9[_0xedea('0x18')](_0x14ff96);}return _0x4aced9[_0xedea('0x19')](_0x14ff96)[_0xedea('0x1a')]();};}function respondWithResult(_0x50ddd2,_0x4ba205){_0x4ba205=_0x4ba205||0xc8;return function(_0x1783d9){if(_0x1783d9){return _0x50ddd2[_0xedea('0x19')](_0x4ba205)[_0xedea('0x1b')](_0x1783d9);}};}function respondWithFilteredResult(_0x36b6b9,_0x2cbb46){return function(_0x59da67){if(_0x59da67){var _0x220b4d=typeof _0x2cbb46[_0xedea('0x1c')]==='undefined'&&typeof _0x2cbb46[_0xedea('0x1d')]===_0xedea('0x1e');var _0x15757e=_0x59da67[_0xedea('0x1f')];var _0x2e62e7=_0x220b4d?0x0:_0x2cbb46[_0xedea('0x1c')];var _0x259f9e=_0x220b4d?_0x59da67[_0xedea('0x1f')]:_0x2cbb46['offset']+_0x2cbb46[_0xedea('0x1d')];var _0x350f91;if(_0x259f9e>=_0x15757e){_0x259f9e=_0x15757e;_0x350f91=0xc8;}else{_0x350f91=0xce;}_0x36b6b9[_0xedea('0x19')](_0x350f91);return _0x36b6b9[_0xedea('0x20')]('Content-Range',_0x2e62e7+'-'+_0x259f9e+'/'+_0x15757e)[_0xedea('0x1b')](_0x59da67);}return null;};}function patchUpdates(_0x1b6cf0){return function(_0x436fb4){try{jsonpatch[_0xedea('0x21')](_0x436fb4,_0x1b6cf0,!![]);}catch(_0x516dbe){return BPromise[_0xedea('0x22')](_0x516dbe);}return _0x436fb4['save']();};}function saveUpdates(_0x21a51e,_0x3faf56){return function(_0x33c670){if(_0x33c670){return _0x33c670[_0xedea('0x23')](_0x21a51e)[_0xedea('0x24')](function(_0x5da0d7){return _0x5da0d7;});}return null;};}function removeEntity(_0x1a841b,_0x8863eb){return function(_0x3b32bf){if(_0x3b32bf){return _0x3b32bf['destroy']()[_0xedea('0x24')](function(){_0x1a841b[_0xedea('0x19')](0xcc)[_0xedea('0x1a')]();});}};}function handleEntityNotFound(_0xcb896f,_0x26347c){return function(_0x1956e1){if(!_0x1956e1){_0xcb896f[_0xedea('0x18')](0x194);}return _0x1956e1;};}function handleError(_0x3063e8,_0xe4012f){_0xe4012f=_0xe4012f||0x1f4;return function(_0xbe2642){logger['error'](_0xbe2642['stack']);if(_0xbe2642['name']){delete _0xbe2642[_0xedea('0x25')];}_0x3063e8['status'](_0xe4012f)[_0xedea('0x26')](_0xbe2642);};}exports['index']=function(_0x112a29,_0x36db02){var _0x549c93={},_0x502d90={},_0x8f8574={'count':0x0,'rows':[]};var _0x972320=_['map'](db[_0xedea('0x27')][_0xedea('0x28')],function(_0x5e656e){return{'name':_0x5e656e['fieldName'],'type':_0x5e656e[_0xedea('0x29')][_0xedea('0x2a')]};});_0x502d90[_0xedea('0x2b')]=_[_0xedea('0x2c')](_0x972320,_0xedea('0x25'));_0x502d90['query']=_[_0xedea('0x2d')](_0x112a29[_0xedea('0x2e')]);_0x502d90[_0xedea('0x2f')]=_[_0xedea('0x30')](_0x502d90['model'],_0x502d90[_0xedea('0x2e')]);_0x549c93['attributes']=_[_0xedea('0x30')](_0x502d90[_0xedea('0x2b')],qs['fields'](_0x112a29['query'][_0xedea('0x31')]));_0x549c93['attributes']=_0x549c93[_0xedea('0x32')][_0xedea('0x33')]?_0x549c93[_0xedea('0x32')]:_0x502d90['model'];if(!_0x112a29['query']['hasOwnProperty']('nolimit')){_0x549c93['limit']=qs[_0xedea('0x1d')](_0x112a29[_0xedea('0x2e')]['limit']);_0x549c93[_0xedea('0x1c')]=qs[_0xedea('0x1c')](_0x112a29['query']['offset']);}_0x549c93['order']=qs[_0xedea('0x34')](_0x112a29[_0xedea('0x2e')][_0xedea('0x34')]);_0x549c93[_0xedea('0x35')]=qs[_0xedea('0x2f')](_[_0xedea('0x36')](_0x112a29['query'],_0x502d90[_0xedea('0x2f')]),_0x972320);if(_0x112a29[_0xedea('0x2e')]['filter']){_0x549c93[_0xedea('0x35')]=_['merge'](_0x549c93[_0xedea('0x35')],{'$or':_[_0xedea('0x2c')](_0x972320,function(_0x2b4382){if(_0x2b4382['type']!==_0xedea('0x37')){var _0x566cde={};_0x566cde[_0x2b4382[_0xedea('0x25')]]={'$like':'%'+_0x112a29[_0xedea('0x2e')][_0xedea('0x38')]+'%'};return _0x566cde;}})});}_0x549c93=_[_0xedea('0x39')]({},_0x549c93,_0x112a29[_0xedea('0x3a')]);var _0x3fec98={'where':_0x549c93[_0xedea('0x35')]};return db[_0xedea('0x27')][_0xedea('0x1f')](_0x3fec98)[_0xedea('0x24')](function(_0x1cabf4){_0x8f8574[_0xedea('0x1f')]=_0x1cabf4;if(_0x112a29[_0xedea('0x2e')]['includeAll']){_0x549c93[_0xedea('0x3b')]=[{'all':!![]}];}return db[_0xedea('0x27')]['findAll'](_0x549c93);})[_0xedea('0x24')](function(_0x206d70){_0x8f8574[_0xedea('0x3c')]=_0x206d70;return _0x8f8574;})[_0xedea('0x24')](respondWithFilteredResult(_0x36db02,_0x549c93))[_0xedea('0x3d')](handleError(_0x36db02,null));};exports[_0xedea('0x3e')]=function(_0xf85bb1,_0x2a5e55){var _0x310f79={'raw':![],'where':{'id':_0xf85bb1[_0xedea('0x3f')]['id']}},_0x300cd9={};_0x300cd9[_0xedea('0x2b')]=_[_0xedea('0x2d')](db['ServicenowConfiguration']['rawAttributes']);_0x300cd9[_0xedea('0x2e')]=_[_0xedea('0x2d')](_0xf85bb1[_0xedea('0x2e')]);_0x300cd9[_0xedea('0x2f')]=_[_0xedea('0x30')](_0x300cd9[_0xedea('0x2b')],_0x300cd9[_0xedea('0x2e')]);_0x310f79[_0xedea('0x32')]=_[_0xedea('0x30')](_0x300cd9[_0xedea('0x2b')],qs['fields'](_0xf85bb1[_0xedea('0x2e')][_0xedea('0x31')]));_0x310f79[_0xedea('0x32')]=_0x310f79[_0xedea('0x32')][_0xedea('0x33')]?_0x310f79['attributes']:_0x300cd9['model'];if(_0xf85bb1[_0xedea('0x2e')]['includeAll']){_0x310f79[_0xedea('0x3b')]=[{'all':!![]}];}_0x310f79=_[_0xedea('0x39')]({},_0x310f79,_0xf85bb1['options']);return db[_0xedea('0x27')][_0xedea('0x40')](_0x310f79)['then'](handleEntityNotFound(_0x2a5e55,null))['then'](respondWithResult(_0x2a5e55,null))['catch'](handleError(_0x2a5e55,null));};exports[_0xedea('0x41')]=function(_0x34afa5,_0x52991f){return db[_0xedea('0x27')][_0xedea('0x41')](_0x34afa5[_0xedea('0x42')],{})[_0xedea('0x24')](respondWithResult(_0x52991f,0xc9))[_0xedea('0x3d')](handleError(_0x52991f,null));};exports[_0xedea('0x23')]=function(_0x48214d,_0x37d61b){if(_0x48214d['body']['id']){delete _0x48214d[_0xedea('0x42')]['id'];}return db[_0xedea('0x27')]['find']({'where':{'id':_0x48214d[_0xedea('0x3f')]['id']}})[_0xedea('0x24')](handleEntityNotFound(_0x37d61b,null))['then'](saveUpdates(_0x48214d['body'],null))['then'](respondWithResult(_0x37d61b,null))[_0xedea('0x3d')](handleError(_0x37d61b,null));};exports['destroy']=function(_0x84ff8b,_0x2346b2){return db['ServicenowConfiguration'][_0xedea('0x40')]({'where':{'id':_0x84ff8b['params']['id']}})[_0xedea('0x24')](handleEntityNotFound(_0x2346b2,null))['then'](removeEntity(_0x2346b2,null))['catch'](handleError(_0x2346b2,null));};exports['getFields']=function(_0x1e4c82,_0x546cc1,_0xf8f9db){var _0x3e2f8c={};var _0x464549={};var _0x1e9f98;var _0x3f0d5a;return db[_0xedea('0x27')][_0xedea('0x43')]({'where':{'id':_0x1e4c82[_0xedea('0x3f')]['id']}})[_0xedea('0x24')](handleEntityNotFound(_0x546cc1,null))['then'](function(_0xed43c8){if(_0xed43c8){_0x1e9f98=_0xed43c8;_0x464549[_0xedea('0x2b')]=_[_0xedea('0x2d')](db[_0xedea('0x44')][_0xedea('0x28')]);_0x464549['query']=_['keys'](_0x1e4c82['query']);_0x464549[_0xedea('0x2f')]=_[_0xedea('0x30')](_0x464549[_0xedea('0x2b')],_0x464549['query']);_0x3e2f8c['attributes']=_[_0xedea('0x30')](_0x464549[_0xedea('0x2b')],qs['fields'](_0x1e4c82['query'][_0xedea('0x31')]));_0x3e2f8c[_0xedea('0x32')]=_0x3e2f8c[_0xedea('0x32')][_0xedea('0x33')]?_0x3e2f8c[_0xedea('0x32')]:_0x464549['model'];_0x3e2f8c[_0xedea('0x45')]=qs[_0xedea('0x34')](_0x1e4c82[_0xedea('0x2e')][_0xedea('0x34')]);_0x3e2f8c[_0xedea('0x35')]=qs['filters'](_['pick'](_0x1e4c82[_0xedea('0x2e')],_0x464549[_0xedea('0x2f')]));if(_0x1e4c82['query']['filter']){_0x3e2f8c['where']=_[_0xedea('0x39')](_0x3e2f8c['where'],{'$or':_[_0xedea('0x2c')](_0x3e2f8c['attributes'],function(_0x945347){var _0x41e379={};_0x41e379[_0x945347]={'$like':'%'+_0x1e4c82[_0xedea('0x2e')][_0xedea('0x38')]+'%'};return _0x41e379;})});}_0x3e2f8c=_[_0xedea('0x39')]({},_0x3e2f8c,_0x1e4c82[_0xedea('0x3a')]);return _0x1e9f98[_0xedea('0x46')](_0x3e2f8c);}})[_0xedea('0x24')](function(_0x5bc096){if(_0x5bc096){_0x3f0d5a=_0x5bc096[_0xedea('0x33')];if(!_0x1e4c82['query'][_0xedea('0x47')](_0xedea('0x48'))){_0x3e2f8c[_0xedea('0x1d')]=qs[_0xedea('0x1d')](_0x1e4c82['query'][_0xedea('0x1d')]);_0x3e2f8c[_0xedea('0x1c')]=qs[_0xedea('0x1c')](_0x1e4c82[_0xedea('0x2e')]['offset']);}return _0x1e9f98['getFields'](_0x3e2f8c);}})[_0xedea('0x24')](function(_0x2451c5){if(_0x2451c5){return _0x2451c5?{'count':_0x3f0d5a,'rows':_0x2451c5}:null;}})[_0xedea('0x24')](respondWithResult(_0x546cc1,null))['catch'](handleError(_0x546cc1,null));};exports[_0xedea('0x49')]=function(_0x310ebf,_0x416477,_0x3ff388){var _0x469c70={};var _0x222921={};var _0x168448;var _0x226ed0;return db['ServicenowConfiguration'][_0xedea('0x43')]({'where':{'id':_0x310ebf[_0xedea('0x3f')]['id']}})[_0xedea('0x24')](handleEntityNotFound(_0x416477,null))[_0xedea('0x24')](function(_0x37bf4c){if(_0x37bf4c){_0x168448=_0x37bf4c;_0x222921['model']=_[_0xedea('0x2d')](db[_0xedea('0x44')][_0xedea('0x28')]);_0x222921['query']=_['keys'](_0x310ebf['query']);_0x222921[_0xedea('0x2f')]=_[_0xedea('0x30')](_0x222921[_0xedea('0x2b')],_0x222921[_0xedea('0x2e')]);_0x469c70[_0xedea('0x32')]=_[_0xedea('0x30')](_0x222921[_0xedea('0x2b')],qs[_0xedea('0x31')](_0x310ebf['query'][_0xedea('0x31')]));_0x469c70[_0xedea('0x32')]=_0x469c70['attributes'][_0xedea('0x33')]?_0x469c70[_0xedea('0x32')]:_0x222921[_0xedea('0x2b')];_0x469c70[_0xedea('0x45')]=qs[_0xedea('0x34')](_0x310ebf[_0xedea('0x2e')][_0xedea('0x34')]);_0x469c70[_0xedea('0x35')]=qs['filters'](_[_0xedea('0x36')](_0x310ebf[_0xedea('0x2e')],_0x222921['filters']));if(_0x310ebf[_0xedea('0x2e')][_0xedea('0x38')]){_0x469c70['where']=_[_0xedea('0x39')](_0x469c70['where'],{'$or':_[_0xedea('0x2c')](_0x469c70['attributes'],function(_0x4fb962){var _0x1e12df={};_0x1e12df[_0x4fb962]={'$like':'%'+_0x310ebf[_0xedea('0x2e')]['filter']+'%'};return _0x1e12df;})});}_0x469c70=_[_0xedea('0x39')]({},_0x469c70,_0x310ebf['options']);return _0x168448[_0xedea('0x49')](_0x469c70);}})[_0xedea('0x24')](function(_0x5dd918){if(_0x5dd918){_0x226ed0=_0x5dd918[_0xedea('0x33')];if(!_0x310ebf['query'][_0xedea('0x47')](_0xedea('0x48'))){_0x469c70[_0xedea('0x1d')]=qs['limit'](_0x310ebf[_0xedea('0x2e')]['limit']);_0x469c70['offset']=qs[_0xedea('0x1c')](_0x310ebf[_0xedea('0x2e')]['offset']);}return _0x168448[_0xedea('0x49')](_0x469c70);}})['then'](function(_0x18f5cb){if(_0x18f5cb){return _0x18f5cb?{'count':_0x226ed0,'rows':_0x18f5cb}:null;}})[_0xedea('0x24')](respondWithResult(_0x416477,null))[_0xedea('0x3d')](handleError(_0x416477,null));};exports[_0xedea('0x4a')]=function(_0x25c114,_0x32a814,_0x4a93c6){var _0x1e1cf6={};var _0x520767={};var _0x2e7172;var _0x3ec6a4;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x25c114[_0xedea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x32a814,null))[_0xedea('0x24')](function(_0x2c9ad5){if(_0x2c9ad5){_0x2e7172=_0x2c9ad5;_0x520767[_0xedea('0x2b')]=_[_0xedea('0x2d')](db[_0xedea('0x44')][_0xedea('0x28')]);_0x520767[_0xedea('0x2e')]=_['keys'](_0x25c114[_0xedea('0x2e')]);_0x520767[_0xedea('0x2f')]=_[_0xedea('0x30')](_0x520767['model'],_0x520767[_0xedea('0x2e')]);_0x1e1cf6[_0xedea('0x32')]=_['intersection'](_0x520767[_0xedea('0x2b')],qs[_0xedea('0x31')](_0x25c114[_0xedea('0x2e')][_0xedea('0x31')]));_0x1e1cf6[_0xedea('0x32')]=_0x1e1cf6[_0xedea('0x32')][_0xedea('0x33')]?_0x1e1cf6[_0xedea('0x32')]:_0x520767['model'];_0x1e1cf6['order']=qs[_0xedea('0x34')](_0x25c114[_0xedea('0x2e')][_0xedea('0x34')]);_0x1e1cf6[_0xedea('0x35')]=qs['filters'](_['pick'](_0x25c114[_0xedea('0x2e')],_0x520767[_0xedea('0x2f')]));if(_0x25c114[_0xedea('0x2e')][_0xedea('0x38')]){_0x1e1cf6[_0xedea('0x35')]=_[_0xedea('0x39')](_0x1e1cf6[_0xedea('0x35')],{'$or':_[_0xedea('0x2c')](_0x1e1cf6[_0xedea('0x32')],function(_0x406022){var _0x321e79={};_0x321e79[_0x406022]={'$like':'%'+_0x25c114['query'][_0xedea('0x38')]+'%'};return _0x321e79;})});}_0x1e1cf6=_[_0xedea('0x39')]({},_0x1e1cf6,_0x25c114[_0xedea('0x3a')]);return _0x2e7172[_0xedea('0x4a')](_0x1e1cf6);}})[_0xedea('0x24')](function(_0xf38849){if(_0xf38849){_0x3ec6a4=_0xf38849[_0xedea('0x33')];if(!_0x25c114[_0xedea('0x2e')]['hasOwnProperty']('nolimit')){_0x1e1cf6[_0xedea('0x1d')]=qs['limit'](_0x25c114[_0xedea('0x2e')]['limit']);_0x1e1cf6['offset']=qs[_0xedea('0x1c')](_0x25c114['query'][_0xedea('0x1c')]);}return _0x2e7172[_0xedea('0x4a')](_0x1e1cf6);}})[_0xedea('0x24')](function(_0x15ee7a){if(_0x15ee7a){return _0x15ee7a?{'count':_0x3ec6a4,'rows':_0x15ee7a}:null;}})[_0xedea('0x24')](respondWithResult(_0x32a814,null))[_0xedea('0x3d')](handleError(_0x32a814,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b63c95a..d983695 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ccd=['int_servicenow_configurations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x1fe2a2,_0x20c435){var _0x3918cc=function(_0x2170b2){while(--_0x2170b2){_0x1fe2a2['push'](_0x1fe2a2['shift']());}};_0x3918cc(++_0x20c435);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var logger=require(_0xd9cc('0x1'))(_0xd9cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9cc('0x4'));var config=require(_0xd9cc('0x5'));var attributes=require(_0xd9cc('0x6'));module[_0xd9cc('0x7')]=function(_0x126f77,_0x113744){return _0x126f77[_0xd9cc('0x8')](_0xd9cc('0x9'),attributes,{'tableName':_0xd9cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd07=['rimraf','exports','define','int_servicenow_configurations','lodash','util','request-promise','path'];(function(_0x12b31f,_0x5c70d3){var _0x2755e6=function(_0x19c17e){while(--_0x19c17e){_0x12b31f['push'](_0x12b31f['shift']());}};_0x2755e6(++_0x5c70d3);}(_0xfd07,0x104));var _0x7fd0=function(_0x557bf4,_0x1f8dad){_0x557bf4=_0x557bf4-0x0;var _0x2916e2=_0xfd07[_0x557bf4];return _0x2916e2;};'use strict';var _=require(_0x7fd0('0x0'));var util=require(_0x7fd0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fd0('0x2'));var fs=require('fs');var path=require(_0x7fd0('0x3'));var rimraf=require(_0x7fd0('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x7fd0('0x5')]=function(_0x245329,_0x40d823){return _0x245329[_0x7fd0('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0x7fd0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 05a2d3b..5bf6d4e 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b8f=['code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9b8f,0x69));var _0xf9b8=function(_0x464be9,_0x3a20b4){_0x464be9=_0x464be9-0x0;var _0x98540c=_0x9b8f[_0x464be9];return _0x98540c;};'use strict';var _=require(_0xf9b8('0x0'));var util=require(_0xf9b8('0x1'));var moment=require(_0xf9b8('0x2'));var BPromise=require(_0xf9b8('0x3'));var rs=require(_0xf9b8('0x4'));var fs=require('fs');var Redis=require(_0xf9b8('0x5'));var db=require(_0xf9b8('0x6'))['db'];var utils=require(_0xf9b8('0x7'));var logger=require(_0xf9b8('0x8'))(_0xf9b8('0x9'));var config=require(_0xf9b8('0xa'));var jayson=require(_0xf9b8('0xb'));var client=jayson[_0xf9b8('0xc')][_0xf9b8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xef5bea,_0x2a02de,_0x1db328){return new BPromise(function(_0x442ece,_0x99234f){return client[_0xf9b8('0xe')](_0xef5bea,_0x1db328)['then'](function(_0x53c9dd){logger[_0xf9b8('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a02de,'request\x20sent');logger['debug'](_0xf9b8('0x10'),_0x2a02de,_0xf9b8('0x11'),JSON[_0xf9b8('0x12')](_0x53c9dd));if(_0x53c9dd['error']){if(_0x53c9dd[_0xf9b8('0x13')][_0xf9b8('0x14')]===0x1f4){logger['error'](_0xf9b8('0x15'),_0x2a02de,_0x53c9dd[_0xf9b8('0x13')][_0xf9b8('0x16')]);return _0x99234f(_0x53c9dd['error'][_0xf9b8('0x16')]);}logger[_0xf9b8('0x13')](_0xf9b8('0x15'),_0x2a02de,_0x53c9dd['error'][_0xf9b8('0x16')]);return _0x442ece(_0x53c9dd['error'][_0xf9b8('0x16')]);}else{logger['info'](_0xf9b8('0x15'),_0x2a02de,'request\x20sent');_0x442ece(_0x53c9dd[_0xf9b8('0x17')]['message']);}})[_0xf9b8('0x18')](function(_0x1732e2){logger[_0xf9b8('0x13')](_0xf9b8('0x15'),_0x2a02de,_0x1732e2);_0x99234f(_0x1732e2);});});} \ No newline at end of file +var _0x6916=['catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0x6916,0x1bb));var _0x6691=function(_0x3dcfc0,_0x30cee7){_0x3dcfc0=_0x3dcfc0-0x0;var _0x8d0491=_0x6916[_0x3dcfc0];return _0x8d0491;};'use strict';var _=require('lodash');var util=require(_0x6691('0x0'));var moment=require(_0x6691('0x1'));var BPromise=require(_0x6691('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6691('0x3'));var logger=require(_0x6691('0x4'))(_0x6691('0x5'));var config=require('../../config/environment');var jayson=require(_0x6691('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2abd74,_0xdeb5d2,_0x28efd5){return new BPromise(function(_0x51a883,_0x38f964){return client[_0x6691('0x7')](_0x2abd74,_0x28efd5)[_0x6691('0x8')](function(_0x9369e9){logger[_0x6691('0x9')](_0x6691('0xa'),_0xdeb5d2,_0x6691('0xb'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xdeb5d2,'request\x20sent',JSON[_0x6691('0xc')](_0x9369e9));if(_0x9369e9['error']){if(_0x9369e9[_0x6691('0xd')][_0x6691('0xe')]===0x1f4){logger[_0x6691('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xdeb5d2,_0x9369e9['error']['message']);return _0x38f964(_0x9369e9[_0x6691('0xd')][_0x6691('0xf')]);}logger[_0x6691('0xd')](_0x6691('0xa'),_0xdeb5d2,_0x9369e9['error']['message']);return _0x51a883(_0x9369e9[_0x6691('0xd')]['message']);}else{logger[_0x6691('0x9')](_0x6691('0xa'),_0xdeb5d2,_0x6691('0xb'));_0x51a883(_0x9369e9['result']['message']);}})[_0x6691('0x10')](function(_0x5cf4f4){logger[_0x6691('0xd')](_0x6691('0xa'),_0xdeb5d2,_0x5cf4f4);_0x38f964(_0x5cf4f4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index b4f2f01..1847c55 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea1d=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','put','/:id','update','delete'];(function(_0x2c1f24,_0x2bce0b){var _0x384d65=function(_0x4a18ac){while(--_0x4a18ac){_0x2c1f24['push'](_0x2c1f24['shift']());}};_0x384d65(++_0x2bce0b);}(_0xea1d,0xdf));var _0xdea1=function(_0x30c8c9,_0x54b329){_0x30c8c9=_0x30c8c9-0x0;var _0x22ba2d=_0xea1d[_0x30c8c9];return _0x22ba2d;};'use strict';var multer=require(_0xdea1('0x0'));var util=require('util');var path=require(_0xdea1('0x1'));var timeout=require(_0xdea1('0x2'));var express=require(_0xdea1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdea1('0x4'));var interaction=require(_0xdea1('0x5'));var config=require(_0xdea1('0x6'));var controller=require('./intServicenowField.controller');router[_0xdea1('0x7')]('/',auth[_0xdea1('0x8')](),controller[_0xdea1('0x9')]);router['get']('/:id',auth[_0xdea1('0x8')](),controller['show']);router[_0xdea1('0xa')]('/',auth[_0xdea1('0x8')](),controller['create']);router[_0xdea1('0xb')](_0xdea1('0xc'),auth['isAuthenticated'](),controller[_0xdea1('0xd')]);router[_0xdea1('0xe')](_0xdea1('0xc'),auth['isAuthenticated'](),controller[_0xdea1('0xf')]);module[_0xdea1('0x10')]=router; \ No newline at end of file +var _0x3ff0=['/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x4e0e71,_0x145e36){var _0x52766d=function(_0x31291b){while(--_0x31291b){_0x4e0e71['push'](_0x4e0e71['shift']());}};_0x52766d(++_0x145e36);}(_0x3ff0,0x98));var _0x03ff=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x3ff0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x03ff('0x0'));var util=require(_0x03ff('0x1'));var path=require('path');var timeout=require(_0x03ff('0x2'));var express=require('express');var router=express[_0x03ff('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x03ff('0x4'));var config=require(_0x03ff('0x5'));var controller=require(_0x03ff('0x6'));router[_0x03ff('0x7')]('/',auth[_0x03ff('0x8')](),controller[_0x03ff('0x9')]);router['get'](_0x03ff('0xa'),auth[_0x03ff('0x8')](),controller[_0x03ff('0xb')]);router[_0x03ff('0xc')]('/',auth[_0x03ff('0x8')](),controller[_0x03ff('0xd')]);router['put'](_0x03ff('0xa'),auth[_0x03ff('0x8')](),controller[_0x03ff('0xe')]);router[_0x03ff('0xf')](_0x03ff('0xa'),auth[_0x03ff('0x8')](),controller[_0x03ff('0x10')]);module[_0x03ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e78f32d..1b3a71f 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd59=['string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5e7115,_0x10b976){var _0x4ace01=function(_0x11967d){while(--_0x11967d){_0x5e7115['push'](_0x5e7115['shift']());}};_0x4ace01(++_0x10b976);}(_0xfd59,0x1b5));var _0x9fd5=function(_0x3e3e6a,_0x3312e7){_0x3e3e6a=_0x3e3e6a-0x0;var _0x4f57f2=_0xfd59[_0x3e3e6a];return _0x4f57f2;};'use strict';var Sequelize=require(_0x9fd5('0x0'));module[_0x9fd5('0x1')]={'type':{'type':Sequelize[_0x9fd5('0x2')](_0x9fd5('0x3'),_0x9fd5('0x4'),'customVariable',_0x9fd5('0x5'),_0x9fd5('0x6')),'defaultValue':_0x9fd5('0x3')},'content':{'type':Sequelize[_0x9fd5('0x7')]},'key':{'type':Sequelize[_0x9fd5('0x7')]},'keyType':{'type':Sequelize[_0x9fd5('0x2')](_0x9fd5('0x3'),'variable',_0x9fd5('0x8'))},'keyContent':{'type':Sequelize[_0x9fd5('0x7')]},'idField':{'type':Sequelize[_0x9fd5('0x7')]},'nameField':{'type':Sequelize[_0x9fd5('0x7')]},'customField':{'type':Sequelize[_0x9fd5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9fd5('0x7')]}}; \ No newline at end of file +var _0x4a52=['variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','picklist','STRING'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x4a52,0x174));var _0x24a5=function(_0x294ef0,_0x45f19a){_0x294ef0=_0x294ef0-0x0;var _0x255f45=_0x4a52[_0x294ef0];return _0x255f45;};'use strict';var Sequelize=require(_0x24a5('0x0'));module[_0x24a5('0x1')]={'type':{'type':Sequelize[_0x24a5('0x2')](_0x24a5('0x3'),'variable','customVariable','keyValue',_0x24a5('0x4')),'defaultValue':_0x24a5('0x3')},'content':{'type':Sequelize[_0x24a5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x24a5('0x2')]('string',_0x24a5('0x6'),_0x24a5('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x24a5('0x5')]},'nameField':{'type':Sequelize[_0x24a5('0x5')]},'customField':{'type':Sequelize[_0x24a5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x24a5('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 3ad9949..3bd147d 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2523=['include','findAll','rows','show','params','keys','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0x44b69,_0x45f0b2){var _0xa3c291=function(_0x2337e2){while(--_0x2337e2){_0x44b69['push'](_0x44b69['shift']());}};_0xa3c291(++_0x45f0b2);}(_0x2523,0x1ea));var _0x3252=function(_0x1194ad,_0x435140){_0x1194ad=_0x1194ad-0x0;var _0x5f374d=_0x2523[_0x1194ad];return _0x5f374d;};'use strict';var emlformat=require(_0x3252('0x0'));var rimraf=require(_0x3252('0x1'));var zipdir=require(_0x3252('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3252('0x3'));var moment=require('moment');var BPromise=require(_0x3252('0x4'));var Mustache=require(_0x3252('0x5'));var util=require(_0x3252('0x6'));var path=require(_0x3252('0x7'));var sox=require(_0x3252('0x8'));var csv=require(_0x3252('0x9'));var ejs=require(_0x3252('0xa'));var fs=require('fs');var fs_extra=require(_0x3252('0xb'));var _=require(_0x3252('0xc'));var squel=require(_0x3252('0xd'));var crypto=require('crypto');var jsforce=require(_0x3252('0xe'));var deskjs=require(_0x3252('0xf'));var toCsv=require(_0x3252('0x9'));var querystring=require(_0x3252('0x10'));var Papa=require(_0x3252('0x11'));var Redis=require(_0x3252('0x12'));var authService=require(_0x3252('0x13'));var qs=require(_0x3252('0x14'));var as=require(_0x3252('0x15'));var hardwareService=require(_0x3252('0x16'));var logger=require('../../config/logger')(_0x3252('0x17'));var utils=require(_0x3252('0x18'));var config=require(_0x3252('0x19'));var licenseUtil=require(_0x3252('0x1a'));var db=require(_0x3252('0x1b'))['db'];function respondWithStatusCode(_0x3392d7,_0x16a331){_0x16a331=_0x16a331||0xcc;return function(_0x1fb087){if(_0x1fb087){return _0x3392d7[_0x3252('0x1c')](_0x16a331);}return _0x3392d7[_0x3252('0x1d')](_0x16a331)[_0x3252('0x1e')]();};}function respondWithResult(_0x7f64c,_0x2095b5){_0x2095b5=_0x2095b5||0xc8;return function(_0x17ddfd){if(_0x17ddfd){return _0x7f64c[_0x3252('0x1d')](_0x2095b5)['json'](_0x17ddfd);}};}function respondWithFilteredResult(_0x16fb69,_0x559a88){return function(_0x556961){if(_0x556961){var _0x4c2080=typeof _0x559a88[_0x3252('0x1f')]===_0x3252('0x20')&&typeof _0x559a88[_0x3252('0x21')]==='undefined';var _0x18e0f8=_0x556961[_0x3252('0x22')];var _0x56c27e=_0x4c2080?0x0:_0x559a88[_0x3252('0x1f')];var _0x2707cc=_0x4c2080?_0x556961[_0x3252('0x22')]:_0x559a88[_0x3252('0x1f')]+_0x559a88[_0x3252('0x21')];var _0x407175;if(_0x2707cc>=_0x18e0f8){_0x2707cc=_0x18e0f8;_0x407175=0xc8;}else{_0x407175=0xce;}_0x16fb69['status'](_0x407175);return _0x16fb69[_0x3252('0x23')](_0x3252('0x24'),_0x56c27e+'-'+_0x2707cc+'/'+_0x18e0f8)[_0x3252('0x25')](_0x556961);}return null;};}function patchUpdates(_0x409b54){return function(_0x163393){try{jsonpatch[_0x3252('0x26')](_0x163393,_0x409b54,!![]);}catch(_0x4cde7b){return BPromise[_0x3252('0x27')](_0x4cde7b);}return _0x163393[_0x3252('0x28')]();};}function saveUpdates(_0x2a1857,_0x50a80e){return function(_0x3189b2){if(_0x3189b2){return _0x3189b2[_0x3252('0x29')](_0x2a1857)['then'](function(_0x39eb5b){return _0x39eb5b;});}return null;};}function removeEntity(_0x2fc9f1,_0x2f3c69){return function(_0x13aac3){if(_0x13aac3){return _0x13aac3[_0x3252('0x2a')]()[_0x3252('0x2b')](function(){_0x2fc9f1[_0x3252('0x1d')](0xcc)[_0x3252('0x1e')]();});}};}function handleEntityNotFound(_0x1cdf68,_0x3cd439){return function(_0x19abff){if(!_0x19abff){_0x1cdf68['sendStatus'](0x194);}return _0x19abff;};}function handleError(_0x2f7ba6,_0x5e3497){_0x5e3497=_0x5e3497||0x1f4;return function(_0x4b7394){logger[_0x3252('0x2c')](_0x4b7394[_0x3252('0x2d')]);if(_0x4b7394[_0x3252('0x2e')]){delete _0x4b7394[_0x3252('0x2e')];}_0x2f7ba6[_0x3252('0x1d')](_0x5e3497)[_0x3252('0x2f')](_0x4b7394);};}exports['index']=function(_0x1e330c,_0x70996e){var _0x41425c={},_0x56184b={},_0x1b16c6={'count':0x0,'rows':[]};var _0x3ee05d=_['map'](db[_0x3252('0x30')][_0x3252('0x31')],function(_0x23abe3){return{'name':_0x23abe3[_0x3252('0x32')],'type':_0x23abe3[_0x3252('0x33')][_0x3252('0x34')]};});_0x56184b[_0x3252('0x35')]=_[_0x3252('0x36')](_0x3ee05d,_0x3252('0x2e'));_0x56184b[_0x3252('0x37')]=_['keys'](_0x1e330c['query']);_0x56184b[_0x3252('0x38')]=_[_0x3252('0x39')](_0x56184b[_0x3252('0x35')],_0x56184b[_0x3252('0x37')]);_0x41425c[_0x3252('0x3a')]=_[_0x3252('0x39')](_0x56184b[_0x3252('0x35')],qs[_0x3252('0x3b')](_0x1e330c[_0x3252('0x37')][_0x3252('0x3b')]));_0x41425c['attributes']=_0x41425c[_0x3252('0x3a')][_0x3252('0x3c')]?_0x41425c[_0x3252('0x3a')]:_0x56184b[_0x3252('0x35')];if(!_0x1e330c[_0x3252('0x37')][_0x3252('0x3d')]('nolimit')){_0x41425c['limit']=qs['limit'](_0x1e330c[_0x3252('0x37')][_0x3252('0x21')]);_0x41425c[_0x3252('0x1f')]=qs[_0x3252('0x1f')](_0x1e330c['query'][_0x3252('0x1f')]);}_0x41425c[_0x3252('0x3e')]=qs[_0x3252('0x3f')](_0x1e330c['query']['sort']);_0x41425c[_0x3252('0x40')]=qs[_0x3252('0x38')](_[_0x3252('0x41')](_0x1e330c[_0x3252('0x37')],_0x56184b[_0x3252('0x38')]),_0x3ee05d);if(_0x1e330c[_0x3252('0x37')]['filter']){_0x41425c[_0x3252('0x40')]=_['merge'](_0x41425c[_0x3252('0x40')],{'$or':_[_0x3252('0x36')](_0x3ee05d,function(_0x3a337e){if(_0x3a337e[_0x3252('0x33')]!==_0x3252('0x42')){var _0x449f44={};_0x449f44[_0x3a337e['name']]={'$like':'%'+_0x1e330c[_0x3252('0x37')][_0x3252('0x43')]+'%'};return _0x449f44;}})});}_0x41425c=_[_0x3252('0x44')]({},_0x41425c,_0x1e330c[_0x3252('0x45')]);var _0x57a87e={'where':_0x41425c[_0x3252('0x40')]};return db[_0x3252('0x30')][_0x3252('0x22')](_0x57a87e)[_0x3252('0x2b')](function(_0x1fa714){_0x1b16c6['count']=_0x1fa714;if(_0x1e330c[_0x3252('0x37')]['includeAll']){_0x41425c[_0x3252('0x46')]=[{'all':!![]}];}return db['ServicenowField'][_0x3252('0x47')](_0x41425c);})['then'](function(_0x2880dd){_0x1b16c6[_0x3252('0x48')]=_0x2880dd;return _0x1b16c6;})[_0x3252('0x2b')](respondWithFilteredResult(_0x70996e,_0x41425c))['catch'](handleError(_0x70996e,null));};exports[_0x3252('0x49')]=function(_0x4be247,_0x2d86fd){var _0x8d45f2={'raw':!![],'where':{'id':_0x4be247[_0x3252('0x4a')]['id']}},_0x5e222a={};_0x5e222a[_0x3252('0x35')]=_['keys'](db[_0x3252('0x30')][_0x3252('0x31')]);_0x5e222a['query']=_[_0x3252('0x4b')](_0x4be247['query']);_0x5e222a[_0x3252('0x38')]=_['intersection'](_0x5e222a[_0x3252('0x35')],_0x5e222a[_0x3252('0x37')]);_0x8d45f2['attributes']=_[_0x3252('0x39')](_0x5e222a['model'],qs[_0x3252('0x3b')](_0x4be247[_0x3252('0x37')]['fields']));_0x8d45f2[_0x3252('0x3a')]=_0x8d45f2[_0x3252('0x3a')][_0x3252('0x3c')]?_0x8d45f2[_0x3252('0x3a')]:_0x5e222a['model'];if(_0x4be247[_0x3252('0x37')]['includeAll']){_0x8d45f2[_0x3252('0x46')]=[{'all':!![]}];}_0x8d45f2=_[_0x3252('0x44')]({},_0x8d45f2,_0x4be247[_0x3252('0x45')]);return db[_0x3252('0x30')]['find'](_0x8d45f2)[_0x3252('0x2b')](handleEntityNotFound(_0x2d86fd,null))[_0x3252('0x2b')](respondWithResult(_0x2d86fd,null))['catch'](handleError(_0x2d86fd,null));};exports[_0x3252('0x4c')]=function(_0x25c508,_0x116501){return db['ServicenowField'][_0x3252('0x4c')](_0x25c508[_0x3252('0x4d')],{})['then'](respondWithResult(_0x116501,0xc9))[_0x3252('0x4e')](handleError(_0x116501,null));};exports['update']=function(_0x54c1c3,_0x1ea9c0){if(_0x54c1c3['body']['id']){delete _0x54c1c3[_0x3252('0x4d')]['id'];}return db[_0x3252('0x30')][_0x3252('0x4f')]({'where':{'id':_0x54c1c3[_0x3252('0x4a')]['id']}})[_0x3252('0x2b')](handleEntityNotFound(_0x1ea9c0,null))['then'](saveUpdates(_0x54c1c3[_0x3252('0x4d')],null))['then'](respondWithResult(_0x1ea9c0,null))[_0x3252('0x4e')](handleError(_0x1ea9c0,null));};exports[_0x3252('0x2a')]=function(_0x5384ff,_0x276534){return db[_0x3252('0x30')][_0x3252('0x4f')]({'where':{'id':_0x5384ff[_0x3252('0x4a')]['id']}})[_0x3252('0x2b')](handleEntityNotFound(_0x276534,null))[_0x3252('0x2b')](removeEntity(_0x276534,null))[_0x3252('0x4e')](handleError(_0x276534,null));}; \ No newline at end of file +var _0x704c=['count','Content-Range','apply','update','then','error','name','send','index','map','ServicenowField','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x14c784,_0x5d945a){var _0x1cf4f8=function(_0x56b12e){while(--_0x56b12e){_0x14c784['push'](_0x14c784['shift']());}};_0x1cf4f8(++_0x5d945a);}(_0x704c,0xfb));var _0xc704=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x704c[_0x4ae625];return _0x31accf;};'use strict';var emlformat=require(_0xc704('0x0'));var rimraf=require(_0xc704('0x1'));var zipdir=require(_0xc704('0x2'));var jsonpatch=require(_0xc704('0x3'));var rp=require(_0xc704('0x4'));var moment=require('moment');var BPromise=require(_0xc704('0x5'));var Mustache=require(_0xc704('0x6'));var util=require(_0xc704('0x7'));var path=require(_0xc704('0x8'));var sox=require(_0xc704('0x9'));var csv=require(_0xc704('0xa'));var ejs=require(_0xc704('0xb'));var fs=require('fs');var fs_extra=require(_0xc704('0xc'));var _=require(_0xc704('0xd'));var squel=require(_0xc704('0xe'));var crypto=require(_0xc704('0xf'));var jsforce=require(_0xc704('0x10'));var deskjs=require(_0xc704('0x11'));var toCsv=require(_0xc704('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc704('0x12'));var authService=require(_0xc704('0x13'));var qs=require(_0xc704('0x14'));var as=require(_0xc704('0x15'));var hardwareService=require(_0xc704('0x16'));var logger=require('../../config/logger')(_0xc704('0x17'));var utils=require(_0xc704('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc704('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x452a15,_0x42934c){_0x42934c=_0x42934c||0xcc;return function(_0x5008ab){if(_0x5008ab){return _0x452a15[_0xc704('0x1a')](_0x42934c);}return _0x452a15[_0xc704('0x1b')](_0x42934c)[_0xc704('0x1c')]();};}function respondWithResult(_0x2200f7,_0x3ca13f){_0x3ca13f=_0x3ca13f||0xc8;return function(_0x246a82){if(_0x246a82){return _0x2200f7[_0xc704('0x1b')](_0x3ca13f)[_0xc704('0x1d')](_0x246a82);}};}function respondWithFilteredResult(_0x28aa8e,_0x1fb928){return function(_0x5db873){if(_0x5db873){var _0x94ad16=typeof _0x1fb928[_0xc704('0x1e')]===_0xc704('0x1f')&&typeof _0x1fb928[_0xc704('0x20')]===_0xc704('0x1f');var _0x30ead7=_0x5db873[_0xc704('0x21')];var _0x4a012f=_0x94ad16?0x0:_0x1fb928[_0xc704('0x1e')];var _0x3e0cae=_0x94ad16?_0x5db873[_0xc704('0x21')]:_0x1fb928['offset']+_0x1fb928[_0xc704('0x20')];var _0x1b7190;if(_0x3e0cae>=_0x30ead7){_0x3e0cae=_0x30ead7;_0x1b7190=0xc8;}else{_0x1b7190=0xce;}_0x28aa8e['status'](_0x1b7190);return _0x28aa8e['set'](_0xc704('0x22'),_0x4a012f+'-'+_0x3e0cae+'/'+_0x30ead7)[_0xc704('0x1d')](_0x5db873);}return null;};}function patchUpdates(_0x48bbb3){return function(_0x55c64f){try{jsonpatch[_0xc704('0x23')](_0x55c64f,_0x48bbb3,!![]);}catch(_0x46a680){return BPromise['reject'](_0x46a680);}return _0x55c64f['save']();};}function saveUpdates(_0x41dab7,_0x128487){return function(_0x37353d){if(_0x37353d){return _0x37353d[_0xc704('0x24')](_0x41dab7)[_0xc704('0x25')](function(_0x427ebc){return _0x427ebc;});}return null;};}function removeEntity(_0x531f0c,_0x556e4d){return function(_0x37969e){if(_0x37969e){return _0x37969e['destroy']()[_0xc704('0x25')](function(){_0x531f0c['status'](0xcc)[_0xc704('0x1c')]();});}};}function handleEntityNotFound(_0x4a3c8f,_0x520db0){return function(_0x1b3aa0){if(!_0x1b3aa0){_0x4a3c8f[_0xc704('0x1a')](0x194);}return _0x1b3aa0;};}function handleError(_0x48358d,_0x2da634){_0x2da634=_0x2da634||0x1f4;return function(_0x2f4cc8){logger[_0xc704('0x26')](_0x2f4cc8['stack']);if(_0x2f4cc8['name']){delete _0x2f4cc8[_0xc704('0x27')];}_0x48358d[_0xc704('0x1b')](_0x2da634)[_0xc704('0x28')](_0x2f4cc8);};}exports[_0xc704('0x29')]=function(_0x26d3cc,_0x5dbb36){var _0x3324a2={},_0x1d3d21={},_0x395423={'count':0x0,'rows':[]};var _0xd0b2dd=_[_0xc704('0x2a')](db[_0xc704('0x2b')]['rawAttributes'],function(_0x4728ec){return{'name':_0x4728ec[_0xc704('0x2c')],'type':_0x4728ec[_0xc704('0x2d')]['key']};});_0x1d3d21[_0xc704('0x2e')]=_['map'](_0xd0b2dd,_0xc704('0x27'));_0x1d3d21[_0xc704('0x2f')]=_['keys'](_0x26d3cc[_0xc704('0x2f')]);_0x1d3d21[_0xc704('0x30')]=_['intersection'](_0x1d3d21[_0xc704('0x2e')],_0x1d3d21[_0xc704('0x2f')]);_0x3324a2[_0xc704('0x31')]=_[_0xc704('0x32')](_0x1d3d21[_0xc704('0x2e')],qs[_0xc704('0x33')](_0x26d3cc['query'][_0xc704('0x33')]));_0x3324a2[_0xc704('0x31')]=_0x3324a2[_0xc704('0x31')]['length']?_0x3324a2[_0xc704('0x31')]:_0x1d3d21[_0xc704('0x2e')];if(!_0x26d3cc[_0xc704('0x2f')]['hasOwnProperty']('nolimit')){_0x3324a2['limit']=qs[_0xc704('0x20')](_0x26d3cc[_0xc704('0x2f')][_0xc704('0x20')]);_0x3324a2[_0xc704('0x1e')]=qs[_0xc704('0x1e')](_0x26d3cc[_0xc704('0x2f')][_0xc704('0x1e')]);}_0x3324a2[_0xc704('0x34')]=qs['sort'](_0x26d3cc[_0xc704('0x2f')][_0xc704('0x35')]);_0x3324a2['where']=qs[_0xc704('0x30')](_[_0xc704('0x36')](_0x26d3cc[_0xc704('0x2f')],_0x1d3d21[_0xc704('0x30')]),_0xd0b2dd);if(_0x26d3cc[_0xc704('0x2f')][_0xc704('0x37')]){_0x3324a2[_0xc704('0x38')]=_['merge'](_0x3324a2[_0xc704('0x38')],{'$or':_['map'](_0xd0b2dd,function(_0x284bb4){if(_0x284bb4['type']!=='VIRTUAL'){var _0x36303b={};_0x36303b[_0x284bb4['name']]={'$like':'%'+_0x26d3cc[_0xc704('0x2f')]['filter']+'%'};return _0x36303b;}})});}_0x3324a2=_[_0xc704('0x39')]({},_0x3324a2,_0x26d3cc['options']);var _0x3cdf9e={'where':_0x3324a2[_0xc704('0x38')]};return db[_0xc704('0x2b')][_0xc704('0x21')](_0x3cdf9e)[_0xc704('0x25')](function(_0x892ebd){_0x395423[_0xc704('0x21')]=_0x892ebd;if(_0x26d3cc[_0xc704('0x2f')][_0xc704('0x3a')]){_0x3324a2['include']=[{'all':!![]}];}return db[_0xc704('0x2b')][_0xc704('0x3b')](_0x3324a2);})[_0xc704('0x25')](function(_0x50ba94){_0x395423[_0xc704('0x3c')]=_0x50ba94;return _0x395423;})[_0xc704('0x25')](respondWithFilteredResult(_0x5dbb36,_0x3324a2))[_0xc704('0x3d')](handleError(_0x5dbb36,null));};exports[_0xc704('0x3e')]=function(_0x513983,_0x465731){var _0x44a1c6={'raw':!![],'where':{'id':_0x513983[_0xc704('0x3f')]['id']}},_0x2f8f6d={};_0x2f8f6d['model']=_[_0xc704('0x40')](db['ServicenowField'][_0xc704('0x41')]);_0x2f8f6d[_0xc704('0x2f')]=_[_0xc704('0x40')](_0x513983[_0xc704('0x2f')]);_0x2f8f6d[_0xc704('0x30')]=_[_0xc704('0x32')](_0x2f8f6d[_0xc704('0x2e')],_0x2f8f6d[_0xc704('0x2f')]);_0x44a1c6[_0xc704('0x31')]=_['intersection'](_0x2f8f6d[_0xc704('0x2e')],qs[_0xc704('0x33')](_0x513983[_0xc704('0x2f')]['fields']));_0x44a1c6[_0xc704('0x31')]=_0x44a1c6[_0xc704('0x31')][_0xc704('0x42')]?_0x44a1c6[_0xc704('0x31')]:_0x2f8f6d['model'];if(_0x513983[_0xc704('0x2f')][_0xc704('0x3a')]){_0x44a1c6[_0xc704('0x43')]=[{'all':!![]}];}_0x44a1c6=_['merge']({},_0x44a1c6,_0x513983['options']);return db[_0xc704('0x2b')][_0xc704('0x44')](_0x44a1c6)[_0xc704('0x25')](handleEntityNotFound(_0x465731,null))[_0xc704('0x25')](respondWithResult(_0x465731,null))['catch'](handleError(_0x465731,null));};exports['create']=function(_0x13fa58,_0x36d3d9){return db[_0xc704('0x2b')]['create'](_0x13fa58['body'],{})[_0xc704('0x25')](respondWithResult(_0x36d3d9,0xc9))['catch'](handleError(_0x36d3d9,null));};exports[_0xc704('0x24')]=function(_0x1c7ea8,_0x27f6c9){if(_0x1c7ea8[_0xc704('0x45')]['id']){delete _0x1c7ea8[_0xc704('0x45')]['id'];}return db[_0xc704('0x2b')]['find']({'where':{'id':_0x1c7ea8[_0xc704('0x3f')]['id']}})[_0xc704('0x25')](handleEntityNotFound(_0x27f6c9,null))['then'](saveUpdates(_0x1c7ea8[_0xc704('0x45')],null))[_0xc704('0x25')](respondWithResult(_0x27f6c9,null))[_0xc704('0x3d')](handleError(_0x27f6c9,null));};exports[_0xc704('0x46')]=function(_0x396d07,_0x460690){return db['ServicenowField']['find']({'where':{'id':_0x396d07['params']['id']}})[_0xc704('0x25')](handleEntityNotFound(_0x460690,null))[_0xc704('0x25')](removeEntity(_0x460690,null))['catch'](handleError(_0x460690,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 9fbdb40..4eb4683 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe705=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','idField'];(function(_0x5ac6b,_0x303f88){var _0x49b258=function(_0x19369a){while(--_0x19369a){_0x5ac6b['push'](_0x5ac6b['shift']());}};_0x49b258(++_0x303f88);}(_0xe705,0xc4));var _0x5e70=function(_0x736eb,_0x345088){_0x736eb=_0x736eb-0x0;var _0x30ea13=_0xe705[_0x736eb];return _0x30ea13;};'use strict';var _=require(_0x5e70('0x0'));var util=require(_0x5e70('0x1'));var logger=require(_0x5e70('0x2'))(_0x5e70('0x3'));var moment=require(_0x5e70('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e70('0x5'));var fs=require('fs');var path=require(_0x5e70('0x6'));var rimraf=require(_0x5e70('0x7'));var config=require(_0x5e70('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x5e70('0x9')]=function(_0x46b093,_0x15ac46){return _0x46b093[_0x5e70('0xa')](_0x5e70('0xb'),attributes,{'tableName':_0x5e70('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5e70('0xd'),_0x5e70('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x83fb=['../../config/environment','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','FieldId','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x218160,_0x40bc13){var _0x38cfdf=function(_0x378d79){while(--_0x378d79){_0x218160['push'](_0x218160['shift']());}};_0x38cfdf(++_0x40bc13);}(_0x83fb,0x1cd));var _0xb83f=function(_0x585fff,_0x5b0eb3){_0x585fff=_0x585fff-0x0;var _0x2aae34=_0x83fb[_0x585fff];return _0x2aae34;};'use strict';var _=require(_0xb83f('0x0'));var util=require(_0xb83f('0x1'));var logger=require('../../config/logger')(_0xb83f('0x2'));var moment=require(_0xb83f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb83f('0x4'));var fs=require('fs');var path=require(_0xb83f('0x5'));var rimraf=require(_0xb83f('0x6'));var config=require(_0xb83f('0x7'));var attributes=require(_0xb83f('0x8'));module['exports']=function(_0x32f61a,_0x347af9){return _0x32f61a[_0xb83f('0x9')](_0xb83f('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xb83f('0xb'),'fields':['idField',_0xb83f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 18925d8..17b830b 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x4fd870,_0x22b86a){var _0x3ac5fa=function(_0x187766){while(--_0x187766){_0x4fd870['push'](_0x4fd870['shift']());}};_0x3ac5fa(++_0x22b86a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb7e7[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c952e,_0x598aae){var _0x384663=function(_0x233e93){while(--_0x233e93){_0x5c952e['push'](_0x5c952e['shift']());}};_0x384663(++_0x598aae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f835543..7cd1dc4 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x510d0a,_0xa13777){var _0x355b2c=function(_0x25130b){while(--_0x25130b){_0x510d0a['push'](_0x510d0a['shift']());}};_0x355b2c(++_0xa13777);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x12c05b,_0x3f5dbf){var _0x5ad2c9=function(_0x2b95bc){while(--_0x2b95bc){_0x12c05b['push'](_0x12c05b['shift']());}};_0x5ad2c9(++_0x3f5dbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 9296554..ec2b96c 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x43a9c3,_0x316af4){var _0x49ebb7=function(_0x7ce83e){while(--_0x7ce83e){_0x43a9c3['push'](_0x43a9c3['shift']());}};_0x49ebb7(++_0x316af4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3b9b45,_0x29ccf3){var _0x39b486=function(_0x221621){while(--_0x221621){_0x3b9b45['push'](_0x3b9b45['shift']());}};_0x39b486(++_0x29ccf3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index bb0a09a..e6e9556 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7db=['error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','SugarcrmAccount','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','findOne','SugarcrmConfiguration','rawAttributes','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','format','%s%s','login','JSON','stringify','POST','Calls','values','includes','label','endsWith','value','test'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0xd7db,0x157));var _0xbd7d=function(_0x342e17,_0x5bfa19){_0x342e17=_0x342e17-0x0;var _0x23d8e2=_0xd7db[_0x342e17];return _0x23d8e2;};'use strict';var emlformat=require(_0xbd7d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd7d('0x1'));var moment=require(_0xbd7d('0x2'));var BPromise=require(_0xbd7d('0x3'));var Mustache=require(_0xbd7d('0x4'));var util=require(_0xbd7d('0x5'));var path=require(_0xbd7d('0x6'));var sox=require(_0xbd7d('0x7'));var csv=require(_0xbd7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd7d('0x9'));var squel=require('squel');var crypto=require(_0xbd7d('0xa'));var jsforce=require(_0xbd7d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbd7d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbd7d('0xd'));var qs=require(_0xbd7d('0xe'));var as=require(_0xbd7d('0xf'));var hardwareService=require(_0xbd7d('0x10'));var logger=require('../../config/logger')(_0xbd7d('0x11'));var utils=require(_0xbd7d('0x12'));var config=require(_0xbd7d('0x13'));var licenseUtil=require(_0xbd7d('0x14'));var db=require(_0xbd7d('0x15'))['db'];var integrations=require(_0xbd7d('0x16'));function respondWithStatusCode(_0x4c12c0,_0x593123){_0x593123=_0x593123||0xcc;return function(_0x3e68a4){if(_0x3e68a4){return _0x4c12c0['sendStatus'](_0x593123);}return _0x4c12c0['status'](_0x593123)[_0xbd7d('0x17')]();};}function respondWithResult(_0x5471c8,_0x1254e7){_0x1254e7=_0x1254e7||0xc8;return function(_0x1415dc){if(_0x1415dc){return _0x5471c8[_0xbd7d('0x18')](_0x1254e7)[_0xbd7d('0x19')](_0x1415dc);}};}function respondWithFilteredResult(_0x216b9b,_0x2d1b8a){return function(_0x2d6bc9){if(_0x2d6bc9){var _0x52a139=typeof _0x2d1b8a[_0xbd7d('0x1a')]==='undefined'&&typeof _0x2d1b8a['limit']==='undefined';var _0x3b165e=_0x2d6bc9[_0xbd7d('0x1b')];var _0x38c781=_0x52a139?0x0:_0x2d1b8a[_0xbd7d('0x1a')];var _0x1df4fa=_0x52a139?_0x2d6bc9[_0xbd7d('0x1b')]:_0x2d1b8a['offset']+_0x2d1b8a[_0xbd7d('0x1c')];var _0x2a7d77;if(_0x1df4fa>=_0x3b165e){_0x1df4fa=_0x3b165e;_0x2a7d77=0xc8;}else{_0x2a7d77=0xce;}_0x216b9b['status'](_0x2a7d77);return _0x216b9b[_0xbd7d('0x1d')](_0xbd7d('0x1e'),_0x38c781+'-'+_0x1df4fa+'/'+_0x3b165e)[_0xbd7d('0x19')](_0x2d6bc9);}return null;};}function patchUpdates(_0x34c4ee){return function(_0x44f3aa){try{jsonpatch[_0xbd7d('0x1f')](_0x44f3aa,_0x34c4ee,!![]);}catch(_0x37f9a3){return BPromise[_0xbd7d('0x20')](_0x37f9a3);}return _0x44f3aa[_0xbd7d('0x21')]();};}function saveUpdates(_0x3d8be1,_0x471480){return function(_0x5b19ce){if(_0x5b19ce){return _0x5b19ce[_0xbd7d('0x22')](_0x3d8be1)['then'](function(_0x320a70){return _0x320a70;});}return null;};}function removeEntity(_0x4c322c,_0x27371d){return function(_0x1bdaa8){if(_0x1bdaa8){return _0x1bdaa8[_0xbd7d('0x23')]()[_0xbd7d('0x24')](function(){_0x4c322c['status'](0xcc)[_0xbd7d('0x17')]();});}};}function handleEntityNotFound(_0x27c626,_0x54427b){return function(_0x11f69f){if(!_0x11f69f){_0x27c626[_0xbd7d('0x25')](0x194);}return _0x11f69f;};}function handleError(_0x5bc9ec,_0x5b04cf){_0x5b04cf=_0x5b04cf||0x1f4;return function(_0x422b2e){logger['error'](_0x422b2e[_0xbd7d('0x26')]);if(_0x422b2e[_0xbd7d('0x27')]){delete _0x422b2e[_0xbd7d('0x27')];}_0x5bc9ec[_0xbd7d('0x18')](_0x5b04cf)[_0xbd7d('0x28')](_0x422b2e);};}exports[_0xbd7d('0x29')]=function(_0x463dd4,_0x537f80){var _0xb667f5={},_0x4876c9={},_0x1d695c={'count':0x0,'rows':[]};var _0x18fae8=_[_0xbd7d('0x2a')](db[_0xbd7d('0x2b')]['rawAttributes'],function(_0x4a7d7e){return{'name':_0x4a7d7e[_0xbd7d('0x2c')],'type':_0x4a7d7e[_0xbd7d('0x2d')]['key']};});_0x4876c9[_0xbd7d('0x2e')]=_[_0xbd7d('0x2a')](_0x18fae8,_0xbd7d('0x27'));_0x4876c9[_0xbd7d('0x2f')]=_['keys'](_0x463dd4[_0xbd7d('0x2f')]);_0x4876c9[_0xbd7d('0x30')]=_[_0xbd7d('0x31')](_0x4876c9['model'],_0x4876c9[_0xbd7d('0x2f')]);_0xb667f5[_0xbd7d('0x32')]=_[_0xbd7d('0x31')](_0x4876c9['model'],qs['fields'](_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x33')]));_0xb667f5[_0xbd7d('0x32')]=_0xb667f5[_0xbd7d('0x32')][_0xbd7d('0x34')]?_0xb667f5[_0xbd7d('0x32')]:_0x4876c9[_0xbd7d('0x2e')];if(!_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x35')](_0xbd7d('0x36'))){_0xb667f5['limit']=qs['limit'](_0x463dd4['query'][_0xbd7d('0x1c')]);_0xb667f5['offset']=qs[_0xbd7d('0x1a')](_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x1a')]);}_0xb667f5['order']=qs[_0xbd7d('0x37')](_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x37')]);_0xb667f5[_0xbd7d('0x38')]=qs[_0xbd7d('0x30')](_[_0xbd7d('0x39')](_0x463dd4[_0xbd7d('0x2f')],_0x4876c9[_0xbd7d('0x30')]),_0x18fae8);if(_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x3a')]){_0xb667f5['where']=_[_0xbd7d('0x3b')](_0xb667f5['where'],{'$or':_['map'](_0x18fae8,function(_0x30a494){if(_0x30a494['type']!=='VIRTUAL'){var _0x374f49={};_0x374f49[_0x30a494['name']]={'$like':'%'+_0x463dd4[_0xbd7d('0x2f')][_0xbd7d('0x3a')]+'%'};return _0x374f49;}})});}_0xb667f5=_[_0xbd7d('0x3b')]({},_0xb667f5,_0x463dd4[_0xbd7d('0x3c')]);var _0x3cc7a7={'where':_0xb667f5[_0xbd7d('0x38')]};return db['SugarcrmAccount'][_0xbd7d('0x1b')](_0x3cc7a7)[_0xbd7d('0x24')](function(_0x4dd5c2){_0x1d695c[_0xbd7d('0x1b')]=_0x4dd5c2;if(_0x463dd4['query'][_0xbd7d('0x3d')]){_0xb667f5[_0xbd7d('0x3e')]=[{'all':!![]}];}return db[_0xbd7d('0x2b')]['findAll'](_0xb667f5);})[_0xbd7d('0x24')](function(_0x3d61c4){_0x1d695c[_0xbd7d('0x3f')]=_0x3d61c4;return _0x1d695c;})['then'](respondWithFilteredResult(_0x537f80,_0xb667f5))[_0xbd7d('0x40')](handleError(_0x537f80,null));};exports[_0xbd7d('0x41')]=function(_0x5ba1a8,_0x5028b0){var _0x4d7d18={'raw':![],'where':{'id':_0x5ba1a8[_0xbd7d('0x42')]['id']}},_0x1b4530={};_0x1b4530['model']=_[_0xbd7d('0x43')](db['SugarcrmAccount']['rawAttributes']);_0x1b4530['query']=_[_0xbd7d('0x43')](_0x5ba1a8[_0xbd7d('0x2f')]);_0x1b4530[_0xbd7d('0x30')]=_['intersection'](_0x1b4530[_0xbd7d('0x2e')],_0x1b4530[_0xbd7d('0x2f')]);_0x4d7d18[_0xbd7d('0x32')]=_[_0xbd7d('0x31')](_0x1b4530[_0xbd7d('0x2e')],qs[_0xbd7d('0x33')](_0x5ba1a8[_0xbd7d('0x2f')][_0xbd7d('0x33')]));_0x4d7d18['attributes']=_0x4d7d18['attributes'][_0xbd7d('0x34')]?_0x4d7d18[_0xbd7d('0x32')]:_0x1b4530[_0xbd7d('0x2e')];if(_0x5ba1a8['query'][_0xbd7d('0x3d')]){_0x4d7d18['include']=[{'all':!![]}];}_0x4d7d18=_[_0xbd7d('0x3b')]({},_0x4d7d18,_0x5ba1a8[_0xbd7d('0x3c')]);return db[_0xbd7d('0x2b')]['find'](_0x4d7d18)[_0xbd7d('0x24')](handleEntityNotFound(_0x5028b0,null))['then'](respondWithResult(_0x5028b0,null))[_0xbd7d('0x40')](handleError(_0x5028b0,null));};exports['create']=function(_0x5c9af2,_0x2614ee){return db[_0xbd7d('0x2b')][_0xbd7d('0x44')](_0x5c9af2[_0xbd7d('0x45')],{})['then'](respondWithResult(_0x2614ee,0xc9))[_0xbd7d('0x40')](handleError(_0x2614ee,null));};exports['update']=function(_0x3e5bbe,_0x1a190a){if(_0x3e5bbe[_0xbd7d('0x45')]['id']){delete _0x3e5bbe[_0xbd7d('0x45')]['id'];}return db[_0xbd7d('0x2b')][_0xbd7d('0x46')]({'where':{'id':_0x3e5bbe[_0xbd7d('0x42')]['id']}})[_0xbd7d('0x24')](handleEntityNotFound(_0x1a190a,null))['then'](saveUpdates(_0x3e5bbe[_0xbd7d('0x45')],null))['then'](respondWithResult(_0x1a190a,null))[_0xbd7d('0x40')](handleError(_0x1a190a,null));};exports[_0xbd7d('0x23')]=function(_0x55d8dc,_0x3c3fa3){return db['SugarcrmAccount']['find']({'where':{'id':_0x55d8dc[_0xbd7d('0x42')]['id']}})[_0xbd7d('0x24')](handleEntityNotFound(_0x3c3fa3,null))[_0xbd7d('0x24')](removeEntity(_0x3c3fa3,null))[_0xbd7d('0x40')](handleError(_0x3c3fa3,null));};exports['getConfigurations']=function(_0x125bd8,_0x5a6257,_0x29359c){var _0x1ea20a={};var _0x27b927={};var _0x44ffb1;var _0x5d7dd5;return db['SugarcrmAccount'][_0xbd7d('0x47')]({'where':{'id':_0x125bd8[_0xbd7d('0x42')]['id']}})[_0xbd7d('0x24')](handleEntityNotFound(_0x5a6257,null))['then'](function(_0x453b2b){if(_0x453b2b){_0x44ffb1=_0x453b2b;_0x27b927[_0xbd7d('0x2e')]=_['keys'](db[_0xbd7d('0x48')][_0xbd7d('0x49')]);_0x27b927['query']=_[_0xbd7d('0x43')](_0x125bd8[_0xbd7d('0x2f')]);_0x27b927[_0xbd7d('0x30')]=_[_0xbd7d('0x31')](_0x27b927[_0xbd7d('0x2e')],_0x27b927[_0xbd7d('0x2f')]);_0x1ea20a[_0xbd7d('0x32')]=_[_0xbd7d('0x31')](_0x27b927[_0xbd7d('0x2e')],qs[_0xbd7d('0x33')](_0x125bd8['query'][_0xbd7d('0x33')]));_0x1ea20a[_0xbd7d('0x32')]=_0x1ea20a[_0xbd7d('0x32')][_0xbd7d('0x34')]?_0x1ea20a[_0xbd7d('0x32')]:_0x27b927[_0xbd7d('0x2e')];_0x1ea20a['order']=qs[_0xbd7d('0x37')](_0x125bd8[_0xbd7d('0x2f')][_0xbd7d('0x37')]);_0x1ea20a['where']=qs[_0xbd7d('0x30')](_[_0xbd7d('0x39')](_0x125bd8[_0xbd7d('0x2f')],_0x27b927[_0xbd7d('0x30')]));if(_0x125bd8[_0xbd7d('0x2f')][_0xbd7d('0x3a')]){_0x1ea20a[_0xbd7d('0x38')]=_[_0xbd7d('0x3b')](_0x1ea20a[_0xbd7d('0x38')],{'$or':_[_0xbd7d('0x2a')](_0x1ea20a[_0xbd7d('0x32')],function(_0x4152c1){var _0x520af0={};_0x520af0[_0x4152c1]={'$like':'%'+_0x125bd8[_0xbd7d('0x2f')]['filter']+'%'};return _0x520af0;})});}_0x1ea20a=_[_0xbd7d('0x3b')]({},_0x1ea20a,_0x125bd8[_0xbd7d('0x3c')]);return _0x44ffb1[_0xbd7d('0x4a')](_0x1ea20a);}})[_0xbd7d('0x24')](function(_0x525037){if(_0x525037){_0x5d7dd5=_0x525037[_0xbd7d('0x34')];if(!_0x125bd8['query'][_0xbd7d('0x35')](_0xbd7d('0x36'))){_0x1ea20a[_0xbd7d('0x1c')]=qs[_0xbd7d('0x1c')](_0x125bd8[_0xbd7d('0x2f')][_0xbd7d('0x1c')]);_0x1ea20a['offset']=qs[_0xbd7d('0x1a')](_0x125bd8[_0xbd7d('0x2f')][_0xbd7d('0x1a')]);}return _0x44ffb1['getConfigurations'](_0x1ea20a);}})[_0xbd7d('0x24')](function(_0x2a5a1f){if(_0x2a5a1f){return _0x2a5a1f?{'count':_0x5d7dd5,'rows':_0x2a5a1f}:null;}})[_0xbd7d('0x24')](respondWithResult(_0x5a6257,null))[_0xbd7d('0x40')](handleError(_0x5a6257,null));};exports[_0xbd7d('0x4b')]=function(_0x39af79,_0x592b49,_0x14fbc3){if(_0x39af79[_0xbd7d('0x45')]['id']){delete _0x39af79[_0xbd7d('0x45')]['id'];}return db[_0xbd7d('0x2b')][_0xbd7d('0x47')]({'where':{'id':_0x39af79[_0xbd7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x592b49,null))[_0xbd7d('0x24')](function(_0x251b72){if(_0x251b72){_0x39af79['body'][_0xbd7d('0x4c')]=_0x251b72['id'];_0x39af79['body'][_0xbd7d('0x4d')]=integrations['getSubjects'](_0x39af79[_0xbd7d('0x45')][_0xbd7d('0x4e')],_0x39af79['body'][_0xbd7d('0x2d')]);_0x39af79['body'][_0xbd7d('0x4f')]=integrations[_0xbd7d('0x50')](_0x39af79[_0xbd7d('0x45')][_0xbd7d('0x4e')],_0x39af79[_0xbd7d('0x45')][_0xbd7d('0x2d')]);return db['SugarcrmConfiguration'][_0xbd7d('0x44')](_0x39af79[_0xbd7d('0x45')],{'include':[{'model':db[_0xbd7d('0x51')],'as':_0xbd7d('0x4d')},{'model':db[_0xbd7d('0x51')],'as':_0xbd7d('0x4f')}]});}return null;})['then'](respondWithResult(_0x592b49,null))[_0xbd7d('0x40')](handleError(_0x592b49,null));};exports[_0xbd7d('0x52')]=function(_0x5f2cd0,_0xea18e9,_0x138fbf){var _0x220a7c='';var _0x27c739=['id',_0xbd7d('0x27'),_0xbd7d('0x53'),'created_by',_0xbd7d('0x54'),_0xbd7d('0x55'),_0xbd7d('0x56'),_0xbd7d('0x57'),'parent_id',_0xbd7d('0x58'),_0xbd7d('0x59'),_0xbd7d('0x5a')];return db[_0xbd7d('0x2b')][_0xbd7d('0x47')]({'where':{'id':_0x5f2cd0[_0xbd7d('0x42')]['id']},'attributes':['id',_0xbd7d('0x5b'),_0xbd7d('0x5c'),'remoteUri']})[_0xbd7d('0x24')](handleEntityNotFound(_0xea18e9,null))['then'](function(_0x5c7559){if(_0x5c7559){_0x220a7c=_0x5c7559[_0xbd7d('0x5d')];var _0x4efbf9=_0x220a7c[_0xbd7d('0x5e')](-0x1);if(_0x4efbf9==='/'){_0x220a7c=_0x220a7c['substring'](0x0,_0x220a7c[_0xbd7d('0x5f')](_0x4efbf9));}return rp({'method':'POST','uri':util[_0xbd7d('0x60')](_0xbd7d('0x61'),_0x220a7c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xbd7d('0x62'),'input_type':'JSON','response_type':_0xbd7d('0x63'),'rest_data':JSON[_0xbd7d('0x64')]({'user_auth':{'user_name':_0x5c7559[_0xbd7d('0x5b')],'password':_0x5c7559[_0xbd7d('0x5c')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x39f53b){if(_0x39f53b&&_0x39f53b[_0xbd7d('0x27')]!=='Invalid\x20Login'&&_0x39f53b[_0xbd7d('0x27')]!=='Password\x20Expired'){return rp({'method':_0xbd7d('0x65'),'uri':util[_0xbd7d('0x60')](_0xbd7d('0x61'),_0x220a7c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xbd7d('0x63'),'response_type':'JSON','rest_data':JSON[_0xbd7d('0x64')]({'session':_0x39f53b['id'],'module_name':_0xbd7d('0x66')})}})['then'](function(_0x2b0e7b){if(_0x2b0e7b){var _0x2ee4a5=_[_0xbd7d('0x67')](_0x2b0e7b['module_fields']);_['remove'](_0x2ee4a5,function(_0x44d3c6){return _0x27c739[_0xbd7d('0x68')](_0x44d3c6[_0xbd7d('0x27')]);});return{'count':_0x2ee4a5[_0xbd7d('0x34')],'rows':_[_0xbd7d('0x2a')](_0x2ee4a5,function(_0x21f733){return{'id':_0x21f733[_0xbd7d('0x27')],'name':_0x21f733[_0xbd7d('0x69')],'custom':_[_0xbd7d('0x6a')](_0x21f733[_0xbd7d('0x27')],'_c')?!![]:![],'options':_0x21f733[_0xbd7d('0x3c')]?_[_0xbd7d('0x2a')](_[_0xbd7d('0x67')](_0x21f733[_0xbd7d('0x3c')]),function(_0x4afc1f){return{'name':_0x4afc1f[_0xbd7d('0x6b')],'value':_0x4afc1f[_0xbd7d('0x27')]};}):[]};})};}})['then'](respondWithResult(_0xea18e9,null))[_0xbd7d('0x40')](function(_0x15f9af){var _0x1bbe9c=_0x5f2cd0[_0xbd7d('0x2f')][_0xbd7d('0x6c')]?0x1f4:_0x15f9af['statusCode']||0x1f4;logger[_0xbd7d('0x6d')](_0xbd7d('0x6e'),'getFields',_0x1bbe9c,JSON['stringify'](_0x15f9af));delete _0x15f9af[_0xbd7d('0x27')];if(_0x1bbe9c===0x191){_0x1bbe9c=0x190;}_0xea18e9[_0xbd7d('0x18')](_0x1bbe9c)[_0xbd7d('0x28')](_0x5f2cd0[_0xbd7d('0x2f')]['test']?{'message':_0xbd7d('0x6f'),'statusCode':_0x15f9af[_0xbd7d('0x70')]}:_0x15f9af);});}else{var _0x54d706=0x1f4;_0xea18e9[_0xbd7d('0x18')](_0x54d706)[_0xbd7d('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x3ea0=['limit','count','set','Content-Range','reject','save','destroy','then','end','sendStatus','error','stack','index','SugarcrmAccount','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','getConfigurations','findOne','length','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x8e5187,_0x536070){var _0x66c911=function(_0x5dd39e){while(--_0x5dd39e){_0x8e5187['push'](_0x8e5187['shift']());}};_0x66c911(++_0x536070);}(_0x3ea0,0x1c4));var _0x03ea=function(_0xa72931,_0x37d87a){_0xa72931=_0xa72931-0x0;var _0x13b2f5=_0x3ea0[_0xa72931];return _0x13b2f5;};'use strict';var emlformat=require(_0x03ea('0x0'));var rimraf=require(_0x03ea('0x1'));var zipdir=require(_0x03ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x03ea('0x3'));var BPromise=require(_0x03ea('0x4'));var Mustache=require('mustache');var util=require(_0x03ea('0x5'));var path=require(_0x03ea('0x6'));var sox=require(_0x03ea('0x7'));var csv=require(_0x03ea('0x8'));var ejs=require(_0x03ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03ea('0xa'));var squel=require('squel');var crypto=require(_0x03ea('0xb'));var jsforce=require(_0x03ea('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03ea('0x8'));var querystring=require(_0x03ea('0xd'));var Papa=require(_0x03ea('0xe'));var Redis=require(_0x03ea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03ea('0x10'));var as=require(_0x03ea('0x11'));var hardwareService=require(_0x03ea('0x12'));var logger=require(_0x03ea('0x13'))(_0x03ea('0x14'));var utils=require(_0x03ea('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x03ea('0x16'));var db=require(_0x03ea('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x85b1f5,_0x555b5e){_0x555b5e=_0x555b5e||0xcc;return function(_0x5125d4){if(_0x5125d4){return _0x85b1f5['sendStatus'](_0x555b5e);}return _0x85b1f5[_0x03ea('0x18')](_0x555b5e)['end']();};}function respondWithResult(_0x5e42e7,_0x3b30a1){_0x3b30a1=_0x3b30a1||0xc8;return function(_0x255ad4){if(_0x255ad4){return _0x5e42e7[_0x03ea('0x18')](_0x3b30a1)[_0x03ea('0x19')](_0x255ad4);}};}function respondWithFilteredResult(_0xeb439d,_0x272ccf){return function(_0x277fba){if(_0x277fba){var _0x305a26=typeof _0x272ccf[_0x03ea('0x1a')]===_0x03ea('0x1b')&&typeof _0x272ccf[_0x03ea('0x1c')]===_0x03ea('0x1b');var _0x5de57c=_0x277fba['count'];var _0x241168=_0x305a26?0x0:_0x272ccf['offset'];var _0x4ff753=_0x305a26?_0x277fba[_0x03ea('0x1d')]:_0x272ccf[_0x03ea('0x1a')]+_0x272ccf[_0x03ea('0x1c')];var _0x2e392f;if(_0x4ff753>=_0x5de57c){_0x4ff753=_0x5de57c;_0x2e392f=0xc8;}else{_0x2e392f=0xce;}_0xeb439d[_0x03ea('0x18')](_0x2e392f);return _0xeb439d[_0x03ea('0x1e')](_0x03ea('0x1f'),_0x241168+'-'+_0x4ff753+'/'+_0x5de57c)[_0x03ea('0x19')](_0x277fba);}return null;};}function patchUpdates(_0x1cd5cf){return function(_0x580a1f){try{jsonpatch['apply'](_0x580a1f,_0x1cd5cf,!![]);}catch(_0x338db6){return BPromise[_0x03ea('0x20')](_0x338db6);}return _0x580a1f[_0x03ea('0x21')]();};}function saveUpdates(_0x5a5e67,_0x1971e8){return function(_0x4018a3){if(_0x4018a3){return _0x4018a3['update'](_0x5a5e67)['then'](function(_0x2a4d7a){return _0x2a4d7a;});}return null;};}function removeEntity(_0xe812d4,_0x64d6e5){return function(_0xae7723){if(_0xae7723){return _0xae7723[_0x03ea('0x22')]()[_0x03ea('0x23')](function(){_0xe812d4['status'](0xcc)[_0x03ea('0x24')]();});}};}function handleEntityNotFound(_0x24533f,_0x15a371){return function(_0x275812){if(!_0x275812){_0x24533f[_0x03ea('0x25')](0x194);}return _0x275812;};}function handleError(_0x50099c,_0x1fe139){_0x1fe139=_0x1fe139||0x1f4;return function(_0x3904bd){logger[_0x03ea('0x26')](_0x3904bd[_0x03ea('0x27')]);if(_0x3904bd['name']){delete _0x3904bd['name'];}_0x50099c[_0x03ea('0x18')](_0x1fe139)['send'](_0x3904bd);};}exports[_0x03ea('0x28')]=function(_0x23efcc,_0x75a540){var _0x30bf8d={},_0x40d3d5={},_0x4c8fcd={'count':0x0,'rows':[]};var _0x367a88=_['map'](db[_0x03ea('0x29')][_0x03ea('0x2a')],function(_0x709f04){return{'name':_0x709f04['fieldName'],'type':_0x709f04[_0x03ea('0x2b')][_0x03ea('0x2c')]};});_0x40d3d5[_0x03ea('0x2d')]=_[_0x03ea('0x2e')](_0x367a88,'name');_0x40d3d5[_0x03ea('0x2f')]=_[_0x03ea('0x30')](_0x23efcc[_0x03ea('0x2f')]);_0x40d3d5[_0x03ea('0x31')]=_['intersection'](_0x40d3d5[_0x03ea('0x2d')],_0x40d3d5[_0x03ea('0x2f')]);_0x30bf8d[_0x03ea('0x32')]=_[_0x03ea('0x33')](_0x40d3d5[_0x03ea('0x2d')],qs[_0x03ea('0x34')](_0x23efcc[_0x03ea('0x2f')][_0x03ea('0x34')]));_0x30bf8d['attributes']=_0x30bf8d['attributes']['length']?_0x30bf8d[_0x03ea('0x32')]:_0x40d3d5['model'];if(!_0x23efcc[_0x03ea('0x2f')][_0x03ea('0x35')]('nolimit')){_0x30bf8d[_0x03ea('0x1c')]=qs[_0x03ea('0x1c')](_0x23efcc[_0x03ea('0x2f')]['limit']);_0x30bf8d[_0x03ea('0x1a')]=qs[_0x03ea('0x1a')](_0x23efcc[_0x03ea('0x2f')][_0x03ea('0x1a')]);}_0x30bf8d[_0x03ea('0x36')]=qs[_0x03ea('0x37')](_0x23efcc['query']['sort']);_0x30bf8d[_0x03ea('0x38')]=qs[_0x03ea('0x31')](_[_0x03ea('0x39')](_0x23efcc[_0x03ea('0x2f')],_0x40d3d5[_0x03ea('0x31')]),_0x367a88);if(_0x23efcc[_0x03ea('0x2f')][_0x03ea('0x3a')]){_0x30bf8d['where']=_[_0x03ea('0x3b')](_0x30bf8d[_0x03ea('0x38')],{'$or':_[_0x03ea('0x2e')](_0x367a88,function(_0x4bf2b1){if(_0x4bf2b1[_0x03ea('0x2b')]!==_0x03ea('0x3c')){var _0x44c1cc={};_0x44c1cc[_0x4bf2b1[_0x03ea('0x3d')]]={'$like':'%'+_0x23efcc[_0x03ea('0x2f')]['filter']+'%'};return _0x44c1cc;}})});}_0x30bf8d=_['merge']({},_0x30bf8d,_0x23efcc['options']);var _0x512c6f={'where':_0x30bf8d[_0x03ea('0x38')]};return db[_0x03ea('0x29')][_0x03ea('0x1d')](_0x512c6f)[_0x03ea('0x23')](function(_0x25520c){_0x4c8fcd[_0x03ea('0x1d')]=_0x25520c;if(_0x23efcc[_0x03ea('0x2f')][_0x03ea('0x3e')]){_0x30bf8d[_0x03ea('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x03ea('0x40')](_0x30bf8d);})[_0x03ea('0x23')](function(_0x756fc2){_0x4c8fcd[_0x03ea('0x41')]=_0x756fc2;return _0x4c8fcd;})[_0x03ea('0x23')](respondWithFilteredResult(_0x75a540,_0x30bf8d))['catch'](handleError(_0x75a540,null));};exports[_0x03ea('0x42')]=function(_0x17396f,_0x546c4f){var _0x1126b9={'raw':![],'where':{'id':_0x17396f[_0x03ea('0x43')]['id']}},_0x4fcb12={};_0x4fcb12[_0x03ea('0x2d')]=_[_0x03ea('0x30')](db[_0x03ea('0x29')]['rawAttributes']);_0x4fcb12['query']=_[_0x03ea('0x30')](_0x17396f['query']);_0x4fcb12['filters']=_[_0x03ea('0x33')](_0x4fcb12[_0x03ea('0x2d')],_0x4fcb12[_0x03ea('0x2f')]);_0x1126b9[_0x03ea('0x32')]=_[_0x03ea('0x33')](_0x4fcb12['model'],qs[_0x03ea('0x34')](_0x17396f['query'][_0x03ea('0x34')]));_0x1126b9[_0x03ea('0x32')]=_0x1126b9[_0x03ea('0x32')]['length']?_0x1126b9['attributes']:_0x4fcb12[_0x03ea('0x2d')];if(_0x17396f['query'][_0x03ea('0x3e')]){_0x1126b9[_0x03ea('0x3f')]=[{'all':!![]}];}_0x1126b9=_['merge']({},_0x1126b9,_0x17396f[_0x03ea('0x44')]);return db[_0x03ea('0x29')][_0x03ea('0x45')](_0x1126b9)[_0x03ea('0x23')](handleEntityNotFound(_0x546c4f,null))[_0x03ea('0x23')](respondWithResult(_0x546c4f,null))[_0x03ea('0x46')](handleError(_0x546c4f,null));};exports[_0x03ea('0x47')]=function(_0x1fcbf5,_0x196153){return db[_0x03ea('0x29')][_0x03ea('0x47')](_0x1fcbf5[_0x03ea('0x48')],{})[_0x03ea('0x23')](respondWithResult(_0x196153,0xc9))[_0x03ea('0x46')](handleError(_0x196153,null));};exports[_0x03ea('0x49')]=function(_0x5c489b,_0x4390e2){if(_0x5c489b[_0x03ea('0x48')]['id']){delete _0x5c489b['body']['id'];}return db[_0x03ea('0x29')]['find']({'where':{'id':_0x5c489b['params']['id']}})['then'](handleEntityNotFound(_0x4390e2,null))['then'](saveUpdates(_0x5c489b[_0x03ea('0x48')],null))['then'](respondWithResult(_0x4390e2,null))['catch'](handleError(_0x4390e2,null));};exports[_0x03ea('0x22')]=function(_0x137236,_0x496968){return db['SugarcrmAccount'][_0x03ea('0x45')]({'where':{'id':_0x137236['params']['id']}})['then'](handleEntityNotFound(_0x496968,null))['then'](removeEntity(_0x496968,null))['catch'](handleError(_0x496968,null));};exports[_0x03ea('0x4a')]=function(_0x901afd,_0x355f85,_0x535463){var _0x4ecff6={};var _0x4db0f5={};var _0xeed8c5;var _0x1e91d3;return db[_0x03ea('0x29')][_0x03ea('0x4b')]({'where':{'id':_0x901afd['params']['id']}})[_0x03ea('0x23')](handleEntityNotFound(_0x355f85,null))['then'](function(_0x59cb27){if(_0x59cb27){_0xeed8c5=_0x59cb27;_0x4db0f5[_0x03ea('0x2d')]=_[_0x03ea('0x30')](db['SugarcrmConfiguration'][_0x03ea('0x2a')]);_0x4db0f5[_0x03ea('0x2f')]=_[_0x03ea('0x30')](_0x901afd[_0x03ea('0x2f')]);_0x4db0f5[_0x03ea('0x31')]=_[_0x03ea('0x33')](_0x4db0f5[_0x03ea('0x2d')],_0x4db0f5[_0x03ea('0x2f')]);_0x4ecff6[_0x03ea('0x32')]=_['intersection'](_0x4db0f5[_0x03ea('0x2d')],qs['fields'](_0x901afd[_0x03ea('0x2f')][_0x03ea('0x34')]));_0x4ecff6['attributes']=_0x4ecff6[_0x03ea('0x32')]['length']?_0x4ecff6['attributes']:_0x4db0f5[_0x03ea('0x2d')];_0x4ecff6[_0x03ea('0x36')]=qs[_0x03ea('0x37')](_0x901afd[_0x03ea('0x2f')]['sort']);_0x4ecff6[_0x03ea('0x38')]=qs[_0x03ea('0x31')](_[_0x03ea('0x39')](_0x901afd['query'],_0x4db0f5['filters']));if(_0x901afd['query'][_0x03ea('0x3a')]){_0x4ecff6['where']=_['merge'](_0x4ecff6[_0x03ea('0x38')],{'$or':_[_0x03ea('0x2e')](_0x4ecff6[_0x03ea('0x32')],function(_0x19782f){var _0x4dfea7={};_0x4dfea7[_0x19782f]={'$like':'%'+_0x901afd[_0x03ea('0x2f')][_0x03ea('0x3a')]+'%'};return _0x4dfea7;})});}_0x4ecff6=_[_0x03ea('0x3b')]({},_0x4ecff6,_0x901afd[_0x03ea('0x44')]);return _0xeed8c5[_0x03ea('0x4a')](_0x4ecff6);}})[_0x03ea('0x23')](function(_0x39b42c){if(_0x39b42c){_0x1e91d3=_0x39b42c[_0x03ea('0x4c')];if(!_0x901afd[_0x03ea('0x2f')][_0x03ea('0x35')]('nolimit')){_0x4ecff6[_0x03ea('0x1c')]=qs['limit'](_0x901afd[_0x03ea('0x2f')][_0x03ea('0x1c')]);_0x4ecff6[_0x03ea('0x1a')]=qs[_0x03ea('0x1a')](_0x901afd['query'][_0x03ea('0x1a')]);}return _0xeed8c5[_0x03ea('0x4a')](_0x4ecff6);}})[_0x03ea('0x23')](function(_0x288693){if(_0x288693){return _0x288693?{'count':_0x1e91d3,'rows':_0x288693}:null;}})[_0x03ea('0x23')](respondWithResult(_0x355f85,null))[_0x03ea('0x46')](handleError(_0x355f85,null));};exports[_0x03ea('0x4d')]=function(_0x3d8769,_0x4ebaae,_0x52a690){if(_0x3d8769[_0x03ea('0x48')]['id']){delete _0x3d8769[_0x03ea('0x48')]['id'];}return db[_0x03ea('0x29')]['findOne']({'where':{'id':_0x3d8769['params']['id']}})[_0x03ea('0x23')](handleEntityNotFound(_0x4ebaae,null))[_0x03ea('0x23')](function(_0x25f03c){if(_0x25f03c){_0x3d8769[_0x03ea('0x48')]['AccountId']=_0x25f03c['id'];_0x3d8769[_0x03ea('0x48')][_0x03ea('0x4e')]=integrations[_0x03ea('0x4f')](_0x3d8769[_0x03ea('0x48')][_0x03ea('0x50')],_0x3d8769[_0x03ea('0x48')]['type']);_0x3d8769[_0x03ea('0x48')][_0x03ea('0x51')]=integrations[_0x03ea('0x52')](_0x3d8769[_0x03ea('0x48')]['channel'],_0x3d8769[_0x03ea('0x48')][_0x03ea('0x2b')]);return db['SugarcrmConfiguration'][_0x03ea('0x47')](_0x3d8769[_0x03ea('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0x03ea('0x4e')},{'model':db[_0x03ea('0x53')],'as':_0x03ea('0x51')}]});}return null;})['then'](respondWithResult(_0x4ebaae,null))[_0x03ea('0x46')](handleError(_0x4ebaae,null));};exports[_0x03ea('0x54')]=function(_0x1c3075,_0x9a4594,_0x5e2845){var _0x568e54='';var _0x3a6a65=['id',_0x03ea('0x3d'),_0x03ea('0x55'),_0x03ea('0x56'),_0x03ea('0x57'),'date_start',_0x03ea('0x58'),_0x03ea('0x59'),'parent_id',_0x03ea('0x5a'),_0x03ea('0x5b'),_0x03ea('0x5c')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1c3075[_0x03ea('0x43')]['id']},'attributes':['id',_0x03ea('0x5d'),_0x03ea('0x5e'),_0x03ea('0x5f')]})[_0x03ea('0x23')](handleEntityNotFound(_0x9a4594,null))[_0x03ea('0x23')](function(_0x28f762){if(_0x28f762){_0x568e54=_0x28f762[_0x03ea('0x5f')];var _0x481cf6=_0x568e54[_0x03ea('0x60')](-0x1);if(_0x481cf6==='/'){_0x568e54=_0x568e54[_0x03ea('0x61')](0x0,_0x568e54[_0x03ea('0x62')](_0x481cf6));}return rp({'method':_0x03ea('0x63'),'uri':util[_0x03ea('0x64')](_0x03ea('0x65'),_0x568e54,_0x03ea('0x66')),'json':!![],'form':{'method':'login','input_type':_0x03ea('0x67'),'response_type':_0x03ea('0x67'),'rest_data':JSON[_0x03ea('0x68')]({'user_auth':{'user_name':_0x28f762['username'],'password':_0x28f762[_0x03ea('0x5e')],'encryption':_0x03ea('0x69')},'application':_0x03ea('0x6a')})}});}})[_0x03ea('0x23')](function(_0x5d4b4a){if(_0x5d4b4a&&_0x5d4b4a[_0x03ea('0x3d')]!==_0x03ea('0x6b')&&_0x5d4b4a[_0x03ea('0x3d')]!=='Password\x20Expired'){return rp({'method':_0x03ea('0x63'),'uri':util[_0x03ea('0x64')](_0x03ea('0x65'),_0x568e54,_0x03ea('0x66')),'json':!![],'form':{'method':_0x03ea('0x6c'),'input_type':_0x03ea('0x67'),'response_type':_0x03ea('0x67'),'rest_data':JSON[_0x03ea('0x68')]({'session':_0x5d4b4a['id'],'module_name':_0x03ea('0x6d')})}})[_0x03ea('0x23')](function(_0x312192){if(_0x312192){var _0x368571=_[_0x03ea('0x6e')](_0x312192[_0x03ea('0x6f')]);_[_0x03ea('0x70')](_0x368571,function(_0xc2f64d){return _0x3a6a65['includes'](_0xc2f64d[_0x03ea('0x3d')]);});return{'count':_0x368571[_0x03ea('0x4c')],'rows':_[_0x03ea('0x2e')](_0x368571,function(_0x201619){return{'id':_0x201619[_0x03ea('0x3d')],'name':_0x201619[_0x03ea('0x71')],'custom':_[_0x03ea('0x72')](_0x201619['name'],'_c')?!![]:![],'options':_0x201619[_0x03ea('0x44')]?_[_0x03ea('0x2e')](_['values'](_0x201619[_0x03ea('0x44')]),function(_0x31a99a){return{'name':_0x31a99a[_0x03ea('0x73')],'value':_0x31a99a[_0x03ea('0x3d')]};}):[]};})};}})[_0x03ea('0x23')](respondWithResult(_0x9a4594,null))['catch'](function(_0x3268e7){var _0x4b4944=_0x1c3075[_0x03ea('0x2f')]['test']?0x1f4:_0x3268e7[_0x03ea('0x74')]||0x1f4;logger['error'](_0x03ea('0x75'),'getFields',_0x4b4944,JSON[_0x03ea('0x68')](_0x3268e7));delete _0x3268e7['name'];if(_0x4b4944===0x191){_0x4b4944=0x190;}_0x9a4594[_0x03ea('0x18')](_0x4b4944)['send'](_0x1c3075['query']['test']?{'message':_0x03ea('0x76'),'statusCode':_0x3268e7[_0x03ea('0x74')]}:_0x3268e7);});}else{var _0x4f56c9=0x1f4;_0x9a4594['status'](_0x4f56c9)[_0x03ea('0x77')]({'message':_0x03ea('0x76'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index ad11cb7..e634585 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aef=['exports','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration'];(function(_0x1a4a49,_0xf73c87){var _0x3be8cd=function(_0xad6ff0){while(--_0xad6ff0){_0x1a4a49['push'](_0x1a4a49['shift']());}};_0x3be8cd(++_0xf73c87);}(_0x7aef,0x191));var _0xf7ae=function(_0x1b33b5,_0x3e3913){_0x1b33b5=_0x1b33b5-0x0;var _0x534fa1=_0x7aef[_0x1b33b5];return _0x534fa1;};'use strict';var _=require(_0xf7ae('0x0'));var util=require(_0xf7ae('0x1'));var logger=require(_0xf7ae('0x2'))(_0xf7ae('0x3'));var moment=require(_0xf7ae('0x4'));var BPromise=require(_0xf7ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7ae('0x6'));var rimraf=require('rimraf');var config=require(_0xf7ae('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xf7ae('0x8'));module[_0xf7ae('0x9')]=function(_0x30ab54,_0x8dd206){return _0x30ab54['define']('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa13a=['lodash','../../config/logger','api','moment','path','../../config/environment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x3ce961,_0x5e0281){var _0x4331cb=function(_0x20b0e8){while(--_0x20b0e8){_0x3ce961['push'](_0x3ce961['shift']());}};_0x4331cb(++_0x5e0281);}(_0xa13a,0x78));var _0xaa13=function(_0x366f21,_0x199176){_0x366f21=_0x366f21-0x0;var _0x4cc9de=_0xa13a[_0x366f21];return _0x4cc9de;};'use strict';var _=require(_0xaa13('0x0'));var util=require('util');var logger=require(_0xaa13('0x1'))(_0xaa13('0x2'));var moment=require(_0xaa13('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa13('0x4'));var rimraf=require('rimraf');var config=require(_0xaa13('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xaa13('0x6'));module['exports']=function(_0x4acbc6,_0x356883){return _0x4acbc6[_0xaa13('0x7')](_0xaa13('0x8'),attributes,{'tableName':_0xaa13('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index c4ce6d5..3a48766 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf14e=['attributes','limit','include','map','model','then','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where'];(function(_0x1f8c59,_0x3c8819){var _0x56969e=function(_0x1bcf2c){while(--_0x1bcf2c){_0x1f8c59['push'](_0x1f8c59['shift']());}};_0x56969e(++_0x3c8819);}(_0xf14e,0x155));var _0xef14=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xf14e[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xef14('0x0'));var util=require('util');var moment=require(_0xef14('0x1'));var BPromise=require(_0xef14('0x2'));var rs=require(_0xef14('0x3'));var fs=require('fs');var Redis=require(_0xef14('0x4'));var db=require(_0xef14('0x5'))['db'];var utils=require(_0xef14('0x6'));var logger=require(_0xef14('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xef14('0x8'));var client=jayson[_0xef14('0x9')][_0xef14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb548dc,_0xbd3c49,_0x6d2adf){return new BPromise(function(_0x53903c,_0x3e6e5a){return client[_0xef14('0xb')](_0xb548dc,_0x6d2adf)['then'](function(_0x34488d){logger[_0xef14('0xc')](_0xef14('0xd'),_0xbd3c49,'request\x20sent');logger[_0xef14('0xe')](_0xef14('0xf'),_0xbd3c49,_0xef14('0x10'),JSON[_0xef14('0x11')](_0x34488d));if(_0x34488d[_0xef14('0x12')]){if(_0x34488d[_0xef14('0x12')][_0xef14('0x13')]===0x1f4){logger[_0xef14('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0xbd3c49,_0x34488d[_0xef14('0x12')][_0xef14('0x14')]);return _0x3e6e5a(_0x34488d[_0xef14('0x12')][_0xef14('0x14')]);}logger[_0xef14('0x12')](_0xef14('0xd'),_0xbd3c49,_0x34488d[_0xef14('0x12')][_0xef14('0x14')]);return _0x53903c(_0x34488d[_0xef14('0x12')][_0xef14('0x14')]);}else{logger['info'](_0xef14('0xd'),_0xbd3c49,_0xef14('0x10'));_0x53903c(_0x34488d[_0xef14('0x15')]['message']);}})[_0xef14('0x16')](function(_0x144f90){logger[_0xef14('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0xbd3c49,_0x144f90);_0x3e6e5a(_0x144f90);});});}exports[_0xef14('0x17')]=function(_0x62dccd){var _0x9d848b=this;return new Promise(function(_0x2ff702,_0x5a0a41){return db[_0xef14('0x18')][_0xef14('0x19')]({'raw':_0x62dccd[_0xef14('0x1a')]?_0x62dccd[_0xef14('0x1a')][_0xef14('0x1b')]===undefined?!![]:![]:!![],'where':_0x62dccd[_0xef14('0x1a')]?_0x62dccd[_0xef14('0x1a')][_0xef14('0x1c')]||null:null,'attributes':_0x62dccd[_0xef14('0x1a')]?_0x62dccd[_0xef14('0x1a')][_0xef14('0x1d')]||null:null,'limit':_0x62dccd['options']?_0x62dccd[_0xef14('0x1a')][_0xef14('0x1e')]||null:null,'include':_0x62dccd[_0xef14('0x1a')]?_0x62dccd[_0xef14('0x1a')][_0xef14('0x1f')]?_[_0xef14('0x20')](_0x62dccd['options'][_0xef14('0x1f')],function(_0x3367a8){return{'model':db[_0x3367a8[_0xef14('0x21')]],'as':_0x3367a8['as'],'attributes':_0x3367a8['attributes'],'include':_0x3367a8['include']?_[_0xef14('0x20')](_0x3367a8[_0xef14('0x1f')],function(_0x248708){return{'model':db[_0x248708['model']],'as':_0x248708['as'],'attributes':_0x248708[_0xef14('0x1d')],'include':_0x248708[_0xef14('0x1f')]?_[_0xef14('0x20')](_0x248708['include'],function(_0x268ecb){return{'model':db[_0x268ecb[_0xef14('0x21')]],'as':_0x268ecb['as'],'attributes':_0x268ecb[_0xef14('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef14('0x22')](function(_0x59a14d){logger[_0xef14('0xc')]('GetSugarcrmAccount',_0x62dccd);logger[_0xef14('0xe')](_0xef14('0x17'),_0x62dccd,JSON[_0xef14('0x11')](_0x59a14d));_0x2ff702(_0x59a14d);})[_0xef14('0x16')](function(_0x247092){logger[_0xef14('0x12')](_0xef14('0x17'),_0x247092[_0xef14('0x14')],_0x62dccd);_0x5a0a41(_0x9d848b['error'](0x1f4,_0x247092[_0xef14('0x14')]));});});};exports[_0xef14('0x23')]=function(_0x470438){var _0x226aca=this;return new Promise(function(_0x5dc8bf,_0xef934c){return db[_0xef14('0x18')][_0xef14('0x24')]({'raw':_0x470438[_0xef14('0x1a')]?_0x470438[_0xef14('0x1a')][_0xef14('0x1b')]===undefined?!![]:![]:!![],'where':_0x470438[_0xef14('0x1a')]?_0x470438['options'][_0xef14('0x1c')]||null:null,'attributes':_0x470438[_0xef14('0x1a')]?_0x470438[_0xef14('0x1a')][_0xef14('0x1d')]||null:null,'include':_0x470438[_0xef14('0x1a')]?_0x470438[_0xef14('0x1a')][_0xef14('0x1f')]?_['map'](_0x470438[_0xef14('0x1a')][_0xef14('0x1f')],function(_0x4505e8){return{'model':db[_0x4505e8[_0xef14('0x21')]],'as':_0x4505e8['as'],'attributes':_0x4505e8['attributes'],'include':_0x4505e8['include']?_[_0xef14('0x20')](_0x4505e8[_0xef14('0x1f')],function(_0x253dc4){return{'model':db[_0x253dc4['model']],'as':_0x253dc4['as'],'attributes':_0x253dc4[_0xef14('0x1d')],'include':_0x253dc4['include']?_[_0xef14('0x20')](_0x253dc4['include'],function(_0x17dd54){return{'model':db[_0x17dd54[_0xef14('0x21')]],'as':_0x17dd54['as'],'attributes':_0x17dd54[_0xef14('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef14('0x22')](function(_0x4e2d17){logger[_0xef14('0xc')]('ShowSugarcrmAccount',_0x470438);logger[_0xef14('0xe')](_0xef14('0x23'),_0x470438,JSON['stringify'](_0x4e2d17));_0x5dc8bf(_0x4e2d17);})[_0xef14('0x16')](function(_0xc32076){logger[_0xef14('0x12')](_0xef14('0x23'),_0xc32076['message'],_0x470438);_0xef934c(_0x226aca[_0xef14('0x12')](0x1f4,_0xc32076[_0xef14('0x14')]));});});}; \ No newline at end of file +var _0x3265=['../../config/utils','rpc','../../config/environment','jayson/promise','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','include','map','model','then','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','ioredis'];(function(_0x1cd084,_0x548018){var _0x4b89f2=function(_0x1fc43f){while(--_0x1fc43f){_0x1cd084['push'](_0x1cd084['shift']());}};_0x4b89f2(++_0x548018);}(_0x3265,0x7f));var _0x5326=function(_0x386b6b,_0x489623){_0x386b6b=_0x386b6b-0x0;var _0x39969e=_0x3265[_0x386b6b];return _0x39969e;};'use strict';var _=require(_0x5326('0x0'));var util=require(_0x5326('0x1'));var moment=require(_0x5326('0x2'));var BPromise=require(_0x5326('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5326('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5326('0x5'));var logger=require('../../config/logger')(_0x5326('0x6'));var config=require(_0x5326('0x7'));var jayson=require(_0x5326('0x8'));var client=jayson['client'][_0x5326('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad58b,_0x3d2873,_0x1fe497){return new BPromise(function(_0x124a2b,_0x569478){return client['request'](_0x4ad58b,_0x1fe497)['then'](function(_0x604e){logger[_0x5326('0xa')](_0x5326('0xb'),_0x3d2873,_0x5326('0xc'));logger[_0x5326('0xd')](_0x5326('0xe'),_0x3d2873,_0x5326('0xc'),JSON[_0x5326('0xf')](_0x604e));if(_0x604e[_0x5326('0x10')]){if(_0x604e[_0x5326('0x10')]['code']===0x1f4){logger[_0x5326('0x10')](_0x5326('0xb'),_0x3d2873,_0x604e[_0x5326('0x10')][_0x5326('0x11')]);return _0x569478(_0x604e[_0x5326('0x10')][_0x5326('0x11')]);}logger[_0x5326('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3d2873,_0x604e[_0x5326('0x10')][_0x5326('0x11')]);return _0x124a2b(_0x604e['error']['message']);}else{logger[_0x5326('0xa')](_0x5326('0xb'),_0x3d2873,'request\x20sent');_0x124a2b(_0x604e[_0x5326('0x12')]['message']);}})[_0x5326('0x13')](function(_0x373e48){logger[_0x5326('0x10')](_0x5326('0xb'),_0x3d2873,_0x373e48);_0x569478(_0x373e48);});});}exports[_0x5326('0x14')]=function(_0x4bd43a){var _0x26acbd=this;return new Promise(function(_0x13fd37,_0x1a0515){return db['SugarcrmAccount']['findAll']({'raw':_0x4bd43a[_0x5326('0x15')]?_0x4bd43a[_0x5326('0x15')][_0x5326('0x16')]===undefined?!![]:![]:!![],'where':_0x4bd43a[_0x5326('0x15')]?_0x4bd43a['options'][_0x5326('0x17')]||null:null,'attributes':_0x4bd43a[_0x5326('0x15')]?_0x4bd43a[_0x5326('0x15')][_0x5326('0x18')]||null:null,'limit':_0x4bd43a[_0x5326('0x15')]?_0x4bd43a[_0x5326('0x15')][_0x5326('0x19')]||null:null,'include':_0x4bd43a[_0x5326('0x15')]?_0x4bd43a[_0x5326('0x15')][_0x5326('0x1a')]?_[_0x5326('0x1b')](_0x4bd43a[_0x5326('0x15')][_0x5326('0x1a')],function(_0xbbcca5){return{'model':db[_0xbbcca5[_0x5326('0x1c')]],'as':_0xbbcca5['as'],'attributes':_0xbbcca5[_0x5326('0x18')],'include':_0xbbcca5[_0x5326('0x1a')]?_['map'](_0xbbcca5[_0x5326('0x1a')],function(_0x4f039a){return{'model':db[_0x4f039a[_0x5326('0x1c')]],'as':_0x4f039a['as'],'attributes':_0x4f039a['attributes'],'include':_0x4f039a[_0x5326('0x1a')]?_[_0x5326('0x1b')](_0x4f039a['include'],function(_0xd0de63){return{'model':db[_0xd0de63['model']],'as':_0xd0de63['as'],'attributes':_0xd0de63[_0x5326('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5326('0x1d')](function(_0x121295){logger['info']('GetSugarcrmAccount',_0x4bd43a);logger['debug'](_0x5326('0x14'),_0x4bd43a,JSON[_0x5326('0xf')](_0x121295));_0x13fd37(_0x121295);})[_0x5326('0x13')](function(_0x3210da){logger[_0x5326('0x10')]('GetSugarcrmAccount',_0x3210da['message'],_0x4bd43a);_0x1a0515(_0x26acbd[_0x5326('0x10')](0x1f4,_0x3210da[_0x5326('0x11')]));});});};exports[_0x5326('0x1e')]=function(_0x203806){var _0x2d7b2f=this;return new Promise(function(_0x43574b,_0x2a9c4c){return db[_0x5326('0x1f')][_0x5326('0x20')]({'raw':_0x203806[_0x5326('0x15')]?_0x203806[_0x5326('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x203806[_0x5326('0x15')]?_0x203806['options']['where']||null:null,'attributes':_0x203806[_0x5326('0x15')]?_0x203806[_0x5326('0x15')][_0x5326('0x18')]||null:null,'include':_0x203806[_0x5326('0x15')]?_0x203806['options']['include']?_[_0x5326('0x1b')](_0x203806[_0x5326('0x15')]['include'],function(_0x1179e0){return{'model':db[_0x1179e0[_0x5326('0x1c')]],'as':_0x1179e0['as'],'attributes':_0x1179e0[_0x5326('0x18')],'include':_0x1179e0['include']?_[_0x5326('0x1b')](_0x1179e0['include'],function(_0x5f53c8){return{'model':db[_0x5f53c8['model']],'as':_0x5f53c8['as'],'attributes':_0x5f53c8[_0x5326('0x18')],'include':_0x5f53c8[_0x5326('0x1a')]?_[_0x5326('0x1b')](_0x5f53c8[_0x5326('0x1a')],function(_0x3fb9cc){return{'model':db[_0x3fb9cc[_0x5326('0x1c')]],'as':_0x3fb9cc['as'],'attributes':_0x3fb9cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x5326('0x1d')](function(_0x35ef6c){logger[_0x5326('0xa')](_0x5326('0x1e'),_0x203806);logger[_0x5326('0xd')]('ShowSugarcrmAccount',_0x203806,JSON[_0x5326('0xf')](_0x35ef6c));_0x43574b(_0x35ef6c);})['catch'](function(_0x5e7470){logger['error'](_0x5326('0x1e'),_0x5e7470['message'],_0x203806);_0x2a9c4c(_0x2d7b2f[_0x5326('0x10')](0x1f4,_0x5e7470['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index da0013a..500da2f 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ed4=['/:id/subjects','getSubjects','post','create','put','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','getFields'];(function(_0x1572d1,_0x2896e6){var _0x243de8=function(_0x2299e7){while(--_0x2299e7){_0x1572d1['push'](_0x1572d1['shift']());}};_0x243de8(++_0x2896e6);}(_0x3ed4,0x1ab));var _0x43ed=function(_0x425640,_0x292ac9){_0x425640=_0x425640-0x0;var _0x201109=_0x3ed4[_0x425640];return _0x201109;};'use strict';var multer=require(_0x43ed('0x0'));var util=require(_0x43ed('0x1'));var path=require('path');var timeout=require(_0x43ed('0x2'));var express=require(_0x43ed('0x3'));var router=express[_0x43ed('0x4')]();var fs_extra=require(_0x43ed('0x5'));var auth=require(_0x43ed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43ed('0x7'));var controller=require(_0x43ed('0x8'));router[_0x43ed('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x43ed('0x9')]('/:id',auth[_0x43ed('0xa')](),controller[_0x43ed('0xb')]);router[_0x43ed('0x9')]('/:id/fields',auth[_0x43ed('0xa')](),controller[_0x43ed('0xc')]);router[_0x43ed('0x9')](_0x43ed('0xd'),auth[_0x43ed('0xa')](),controller[_0x43ed('0xe')]);router['get']('/:id/descriptions',auth[_0x43ed('0xa')](),controller['getDescriptions']);router[_0x43ed('0xf')]('/',auth['isAuthenticated'](),controller[_0x43ed('0x10')]);router[_0x43ed('0x11')](_0x43ed('0x12'),auth[_0x43ed('0xa')](),controller['update']);router['delete'](_0x43ed('0x12'),auth[_0x43ed('0xa')](),controller['destroy']);module[_0x43ed('0x13')]=router; \ No newline at end of file +var _0xe106=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id'];(function(_0x11cad6,_0xb6a5d7){var _0x177d1f=function(_0x42c56f){while(--_0x42c56f){_0x11cad6['push'](_0x11cad6['shift']());}};_0x177d1f(++_0xb6a5d7);}(_0xe106,0xff));var _0x6e10=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xe106[_0x22e9fe];return _0x47cd19;};'use strict';var multer=require(_0x6e10('0x0'));var util=require(_0x6e10('0x1'));var path=require('path');var timeout=require(_0x6e10('0x2'));var express=require(_0x6e10('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e10('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6e10('0x5'));var controller=require(_0x6e10('0x6'));router[_0x6e10('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6e10('0x8'),auth[_0x6e10('0x9')](),controller[_0x6e10('0xa')]);router[_0x6e10('0x7')](_0x6e10('0xb'),auth[_0x6e10('0x9')](),controller[_0x6e10('0xc')]);router['get'](_0x6e10('0xd'),auth[_0x6e10('0x9')](),controller[_0x6e10('0xe')]);router[_0x6e10('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6e10('0xf')]);router[_0x6e10('0x10')]('/',auth[_0x6e10('0x9')](),controller[_0x6e10('0x11')]);router[_0x6e10('0x12')]('/:id',auth[_0x6e10('0x9')](),controller['update']);router[_0x6e10('0x13')]('/:id',auth[_0x6e10('0x9')](),controller[_0x6e10('0x14')]);module[_0x6e10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 6837a7c..39d8eb9 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea5c=['sequelize','exports','STRING'];(function(_0x1ef162,_0x4accea){var _0x132d8d=function(_0x416290){while(--_0x416290){_0x1ef162['push'](_0x1ef162['shift']());}};_0x132d8d(++_0x4accea);}(_0xea5c,0xb1));var _0xcea5=function(_0x4412d,_0x5aab56){_0x4412d=_0x4412d-0x0;var _0x527974=_0xea5c[_0x4412d];return _0x527974;};'use strict';var Sequelize=require(_0xcea5('0x0'));module[_0xcea5('0x1')]={'name':{'type':Sequelize[_0xcea5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2ea8=['STRING','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2ea8,0x8b));var _0x82ea=function(_0xb2cab2,_0x1680f5){_0xb2cab2=_0xb2cab2-0x0;var _0x392207=_0x2ea8[_0xb2cab2];return _0x392207;};'use strict';var Sequelize=require(_0x82ea('0x0'));module[_0x82ea('0x1')]={'name':{'type':Sequelize[_0x82ea('0x2')]},'description':{'type':Sequelize[_0x82ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 12c1cc8..07a60e6 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5821=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','update','getFields','findOne','order','pick','nolimit','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x49335f,_0x46042c){var _0x144233=function(_0x52534b){while(--_0x52534b){_0x49335f['push'](_0x49335f['shift']());}};_0x144233(++_0x46042c);}(_0x5821,0xf4));var _0x1582=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5821[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1582('0x0'));var zipdir=require(_0x1582('0x1'));var jsonpatch=require(_0x1582('0x2'));var rp=require('request-promise');var moment=require(_0x1582('0x3'));var BPromise=require(_0x1582('0x4'));var Mustache=require(_0x1582('0x5'));var util=require(_0x1582('0x6'));var path=require(_0x1582('0x7'));var sox=require(_0x1582('0x8'));var csv=require('to-csv');var ejs=require(_0x1582('0x9'));var fs=require('fs');var fs_extra=require(_0x1582('0xa'));var _=require(_0x1582('0xb'));var squel=require(_0x1582('0xc'));var crypto=require(_0x1582('0xd'));var jsforce=require(_0x1582('0xe'));var deskjs=require(_0x1582('0xf'));var toCsv=require(_0x1582('0x10'));var querystring=require(_0x1582('0x11'));var Papa=require(_0x1582('0x12'));var Redis=require(_0x1582('0x13'));var authService=require(_0x1582('0x14'));var qs=require(_0x1582('0x15'));var as=require(_0x1582('0x16'));var hardwareService=require(_0x1582('0x17'));var logger=require(_0x1582('0x18'))(_0x1582('0x19'));var utils=require('../../config/utils');var config=require(_0x1582('0x1a'));var licenseUtil=require(_0x1582('0x1b'));var db=require(_0x1582('0x1c'))['db'];function respondWithStatusCode(_0x572cad,_0x37f00f){_0x37f00f=_0x37f00f||0xcc;return function(_0x50344c){if(_0x50344c){return _0x572cad['sendStatus'](_0x37f00f);}return _0x572cad[_0x1582('0x1d')](_0x37f00f)[_0x1582('0x1e')]();};}function respondWithResult(_0x26c4fd,_0x59d169){_0x59d169=_0x59d169||0xc8;return function(_0xbf1f6a){if(_0xbf1f6a){return _0x26c4fd[_0x1582('0x1d')](_0x59d169)[_0x1582('0x1f')](_0xbf1f6a);}};}function respondWithFilteredResult(_0x40c5ea,_0x3b45bb){return function(_0x5a456f){if(_0x5a456f){var _0x164189=typeof _0x3b45bb['offset']==='undefined'&&typeof _0x3b45bb[_0x1582('0x20')]===_0x1582('0x21');var _0x1fbfc0=_0x5a456f[_0x1582('0x22')];var _0x39aac3=_0x164189?0x0:_0x3b45bb['offset'];var _0xad6bf3=_0x164189?_0x5a456f[_0x1582('0x22')]:_0x3b45bb['offset']+_0x3b45bb['limit'];var _0x3a861e;if(_0xad6bf3>=_0x1fbfc0){_0xad6bf3=_0x1fbfc0;_0x3a861e=0xc8;}else{_0x3a861e=0xce;}_0x40c5ea[_0x1582('0x1d')](_0x3a861e);return _0x40c5ea[_0x1582('0x23')](_0x1582('0x24'),_0x39aac3+'-'+_0xad6bf3+'/'+_0x1fbfc0)['json'](_0x5a456f);}return null;};}function patchUpdates(_0x31dfdc){return function(_0x81d327){try{jsonpatch[_0x1582('0x25')](_0x81d327,_0x31dfdc,!![]);}catch(_0x5a6b94){return BPromise['reject'](_0x5a6b94);}return _0x81d327[_0x1582('0x26')]();};}function saveUpdates(_0x3bdaa2,_0xbb07b4){return function(_0x4f52a5){if(_0x4f52a5){return _0x4f52a5['update'](_0x3bdaa2)[_0x1582('0x27')](function(_0x19e27f){return _0x19e27f;});}return null;};}function removeEntity(_0x21e816,_0x22a95b){return function(_0x3f96c3){if(_0x3f96c3){return _0x3f96c3[_0x1582('0x28')]()[_0x1582('0x27')](function(){_0x21e816[_0x1582('0x1d')](0xcc)[_0x1582('0x1e')]();});}};}function handleEntityNotFound(_0x466613,_0xe6d7b9){return function(_0x255def){if(!_0x255def){_0x466613[_0x1582('0x29')](0x194);}return _0x255def;};}function handleError(_0xc18d2d,_0x591abb){_0x591abb=_0x591abb||0x1f4;return function(_0x126e16){logger[_0x1582('0x2a')](_0x126e16['stack']);if(_0x126e16['name']){delete _0x126e16['name'];}_0xc18d2d[_0x1582('0x1d')](_0x591abb)[_0x1582('0x2b')](_0x126e16);};}exports[_0x1582('0x2c')]=function(_0x4dab45,_0x21a94e){var _0x4ee53e={},_0x4638f4={},_0x2908a3={'count':0x0,'rows':[]};var _0xa4ad35=_[_0x1582('0x2d')](db[_0x1582('0x2e')][_0x1582('0x2f')],function(_0x240db4){return{'name':_0x240db4['fieldName'],'type':_0x240db4[_0x1582('0x30')][_0x1582('0x31')]};});_0x4638f4[_0x1582('0x32')]=_[_0x1582('0x2d')](_0xa4ad35,_0x1582('0x33'));_0x4638f4[_0x1582('0x34')]=_[_0x1582('0x35')](_0x4dab45[_0x1582('0x34')]);_0x4638f4[_0x1582('0x36')]=_[_0x1582('0x37')](_0x4638f4[_0x1582('0x32')],_0x4638f4[_0x1582('0x34')]);_0x4ee53e['attributes']=_[_0x1582('0x37')](_0x4638f4[_0x1582('0x32')],qs[_0x1582('0x38')](_0x4dab45['query'][_0x1582('0x38')]));_0x4ee53e[_0x1582('0x39')]=_0x4ee53e[_0x1582('0x39')][_0x1582('0x3a')]?_0x4ee53e[_0x1582('0x39')]:_0x4638f4[_0x1582('0x32')];if(!_0x4dab45['query'][_0x1582('0x3b')]('nolimit')){_0x4ee53e[_0x1582('0x20')]=qs[_0x1582('0x20')](_0x4dab45['query'][_0x1582('0x20')]);_0x4ee53e[_0x1582('0x3c')]=qs[_0x1582('0x3c')](_0x4dab45[_0x1582('0x34')][_0x1582('0x3c')]);}_0x4ee53e['order']=qs[_0x1582('0x3d')](_0x4dab45[_0x1582('0x34')]['sort']);_0x4ee53e[_0x1582('0x3e')]=qs['filters'](_['pick'](_0x4dab45[_0x1582('0x34')],_0x4638f4['filters']),_0xa4ad35);if(_0x4dab45[_0x1582('0x34')][_0x1582('0x3f')]){_0x4ee53e[_0x1582('0x3e')]=_[_0x1582('0x40')](_0x4ee53e[_0x1582('0x3e')],{'$or':_[_0x1582('0x2d')](_0xa4ad35,function(_0x328958){if(_0x328958[_0x1582('0x30')]!==_0x1582('0x41')){var _0xc523f3={};_0xc523f3[_0x328958[_0x1582('0x33')]]={'$like':'%'+_0x4dab45[_0x1582('0x34')][_0x1582('0x3f')]+'%'};return _0xc523f3;}})});}_0x4ee53e=_['merge']({},_0x4ee53e,_0x4dab45[_0x1582('0x42')]);var _0x43b975={'where':_0x4ee53e['where']};return db[_0x1582('0x2e')][_0x1582('0x22')](_0x43b975)[_0x1582('0x27')](function(_0x427ae0){_0x2908a3['count']=_0x427ae0;if(_0x4dab45[_0x1582('0x34')][_0x1582('0x43')]){_0x4ee53e['include']=[{'all':!![]}];}return db[_0x1582('0x2e')][_0x1582('0x44')](_0x4ee53e);})[_0x1582('0x27')](function(_0x380088){_0x2908a3[_0x1582('0x45')]=_0x380088;return _0x2908a3;})[_0x1582('0x27')](respondWithFilteredResult(_0x21a94e,_0x4ee53e))['catch'](handleError(_0x21a94e,null));};exports['show']=function(_0x458c77,_0x5bead5){var _0x304ca0={'raw':![],'where':{'id':_0x458c77[_0x1582('0x46')]['id']}},_0x35605d={};_0x35605d['model']=_[_0x1582('0x35')](db[_0x1582('0x2e')][_0x1582('0x2f')]);_0x35605d[_0x1582('0x34')]=_[_0x1582('0x35')](_0x458c77[_0x1582('0x34')]);_0x35605d[_0x1582('0x36')]=_[_0x1582('0x37')](_0x35605d['model'],_0x35605d[_0x1582('0x34')]);_0x304ca0['attributes']=_['intersection'](_0x35605d[_0x1582('0x32')],qs[_0x1582('0x38')](_0x458c77['query'][_0x1582('0x38')]));_0x304ca0[_0x1582('0x39')]=_0x304ca0['attributes'][_0x1582('0x3a')]?_0x304ca0[_0x1582('0x39')]:_0x35605d[_0x1582('0x32')];if(_0x458c77[_0x1582('0x34')][_0x1582('0x43')]){_0x304ca0[_0x1582('0x47')]=[{'all':!![]}];}_0x304ca0=_['merge']({},_0x304ca0,_0x458c77[_0x1582('0x42')]);return db[_0x1582('0x2e')][_0x1582('0x48')](_0x304ca0)[_0x1582('0x27')](handleEntityNotFound(_0x5bead5,null))[_0x1582('0x27')](respondWithResult(_0x5bead5,null))[_0x1582('0x49')](handleError(_0x5bead5,null));};exports[_0x1582('0x4a')]=function(_0x54ab03,_0x169473){return db[_0x1582('0x2e')][_0x1582('0x4a')](_0x54ab03[_0x1582('0x4b')],{})[_0x1582('0x27')](respondWithResult(_0x169473,0xc9))[_0x1582('0x49')](handleError(_0x169473,null));};exports[_0x1582('0x4c')]=function(_0x2e1607,_0x3e76f6){if(_0x2e1607[_0x1582('0x4b')]['id']){delete _0x2e1607[_0x1582('0x4b')]['id'];}return db[_0x1582('0x2e')]['find']({'where':{'id':_0x2e1607[_0x1582('0x46')]['id']}})[_0x1582('0x27')](handleEntityNotFound(_0x3e76f6,null))['then'](saveUpdates(_0x2e1607[_0x1582('0x4b')],null))[_0x1582('0x27')](respondWithResult(_0x3e76f6,null))[_0x1582('0x49')](handleError(_0x3e76f6,null));};exports[_0x1582('0x28')]=function(_0x4277ce,_0x47fe84){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x4277ce[_0x1582('0x46')]['id']}})[_0x1582('0x27')](handleEntityNotFound(_0x47fe84,null))['then'](removeEntity(_0x47fe84,null))[_0x1582('0x49')](handleError(_0x47fe84,null));};exports[_0x1582('0x4d')]=function(_0x13c7ae,_0x7f1661,_0x4e8aac){var _0x3f9f64={};var _0x2399bd={};var _0x142b2f;var _0xd7aab7;return db['SugarcrmConfiguration'][_0x1582('0x4e')]({'where':{'id':_0x13c7ae[_0x1582('0x46')]['id']}})[_0x1582('0x27')](handleEntityNotFound(_0x7f1661,null))[_0x1582('0x27')](function(_0x111cc4){if(_0x111cc4){_0x142b2f=_0x111cc4;_0x2399bd[_0x1582('0x32')]=_[_0x1582('0x35')](db['SugarcrmField'][_0x1582('0x2f')]);_0x2399bd[_0x1582('0x34')]=_[_0x1582('0x35')](_0x13c7ae[_0x1582('0x34')]);_0x2399bd[_0x1582('0x36')]=_['intersection'](_0x2399bd[_0x1582('0x32')],_0x2399bd[_0x1582('0x34')]);_0x3f9f64['attributes']=_[_0x1582('0x37')](_0x2399bd[_0x1582('0x32')],qs[_0x1582('0x38')](_0x13c7ae[_0x1582('0x34')][_0x1582('0x38')]));_0x3f9f64[_0x1582('0x39')]=_0x3f9f64[_0x1582('0x39')]['length']?_0x3f9f64['attributes']:_0x2399bd[_0x1582('0x32')];_0x3f9f64[_0x1582('0x4f')]=qs[_0x1582('0x3d')](_0x13c7ae['query']['sort']);_0x3f9f64[_0x1582('0x3e')]=qs[_0x1582('0x36')](_[_0x1582('0x50')](_0x13c7ae[_0x1582('0x34')],_0x2399bd[_0x1582('0x36')]));if(_0x13c7ae['query']['filter']){_0x3f9f64['where']=_[_0x1582('0x40')](_0x3f9f64[_0x1582('0x3e')],{'$or':_['map'](_0x3f9f64[_0x1582('0x39')],function(_0x50c6ae){var _0x25f980={};_0x25f980[_0x50c6ae]={'$like':'%'+_0x13c7ae['query'][_0x1582('0x3f')]+'%'};return _0x25f980;})});}_0x3f9f64=_[_0x1582('0x40')]({},_0x3f9f64,_0x13c7ae[_0x1582('0x42')]);return _0x142b2f[_0x1582('0x4d')](_0x3f9f64);}})[_0x1582('0x27')](function(_0x2eff93){if(_0x2eff93){_0xd7aab7=_0x2eff93[_0x1582('0x3a')];if(!_0x13c7ae[_0x1582('0x34')][_0x1582('0x3b')](_0x1582('0x51'))){_0x3f9f64['limit']=qs['limit'](_0x13c7ae[_0x1582('0x34')][_0x1582('0x20')]);_0x3f9f64[_0x1582('0x3c')]=qs[_0x1582('0x3c')](_0x13c7ae[_0x1582('0x34')][_0x1582('0x3c')]);}return _0x142b2f['getFields'](_0x3f9f64);}})['then'](function(_0x130813){if(_0x130813){return _0x130813?{'count':_0xd7aab7,'rows':_0x130813}:null;}})['then'](respondWithResult(_0x7f1661,null))[_0x1582('0x49')](handleError(_0x7f1661,null));};exports[_0x1582('0x52')]=function(_0x3b8564,_0x26171e,_0x1b0e6c){var _0x1423a6={};var _0x3c0cc4={};var _0x798a88;var _0x23aa91;return db[_0x1582('0x2e')][_0x1582('0x4e')]({'where':{'id':_0x3b8564[_0x1582('0x46')]['id']}})[_0x1582('0x27')](handleEntityNotFound(_0x26171e,null))[_0x1582('0x27')](function(_0x510fcd){if(_0x510fcd){_0x798a88=_0x510fcd;_0x3c0cc4[_0x1582('0x32')]=_[_0x1582('0x35')](db[_0x1582('0x53')][_0x1582('0x2f')]);_0x3c0cc4[_0x1582('0x34')]=_[_0x1582('0x35')](_0x3b8564[_0x1582('0x34')]);_0x3c0cc4[_0x1582('0x36')]=_[_0x1582('0x37')](_0x3c0cc4[_0x1582('0x32')],_0x3c0cc4[_0x1582('0x34')]);_0x1423a6['attributes']=_[_0x1582('0x37')](_0x3c0cc4[_0x1582('0x32')],qs[_0x1582('0x38')](_0x3b8564[_0x1582('0x34')]['fields']));_0x1423a6[_0x1582('0x39')]=_0x1423a6[_0x1582('0x39')][_0x1582('0x3a')]?_0x1423a6[_0x1582('0x39')]:_0x3c0cc4[_0x1582('0x32')];_0x1423a6[_0x1582('0x4f')]=qs[_0x1582('0x3d')](_0x3b8564[_0x1582('0x34')]['sort']);_0x1423a6['where']=qs['filters'](_[_0x1582('0x50')](_0x3b8564[_0x1582('0x34')],_0x3c0cc4[_0x1582('0x36')]));if(_0x3b8564[_0x1582('0x34')]['filter']){_0x1423a6['where']=_['merge'](_0x1423a6[_0x1582('0x3e')],{'$or':_[_0x1582('0x2d')](_0x1423a6[_0x1582('0x39')],function(_0x3f10a1){var _0xd49213={};_0xd49213[_0x3f10a1]={'$like':'%'+_0x3b8564[_0x1582('0x34')][_0x1582('0x3f')]+'%'};return _0xd49213;})});}_0x1423a6=_[_0x1582('0x40')]({},_0x1423a6,_0x3b8564[_0x1582('0x42')]);return _0x798a88[_0x1582('0x52')](_0x1423a6);}})[_0x1582('0x27')](function(_0x4a74a3){if(_0x4a74a3){_0x23aa91=_0x4a74a3['length'];if(!_0x3b8564[_0x1582('0x34')][_0x1582('0x3b')](_0x1582('0x51'))){_0x1423a6['limit']=qs[_0x1582('0x20')](_0x3b8564[_0x1582('0x34')]['limit']);_0x1423a6[_0x1582('0x3c')]=qs[_0x1582('0x3c')](_0x3b8564[_0x1582('0x34')][_0x1582('0x3c')]);}return _0x798a88[_0x1582('0x52')](_0x1423a6);}})[_0x1582('0x27')](function(_0x1375a2){if(_0x1375a2){return _0x1375a2?{'count':_0x23aa91,'rows':_0x1375a2}:null;}})[_0x1582('0x27')](respondWithResult(_0x26171e,null))[_0x1582('0x49')](handleError(_0x26171e,null));};exports[_0x1582('0x54')]=function(_0x190ed8,_0x746a,_0x3fd7ac){var _0x51860d={};var _0x1d71db={};var _0x2fde31;var _0x3de52b;return db[_0x1582('0x2e')][_0x1582('0x4e')]({'where':{'id':_0x190ed8[_0x1582('0x46')]['id']}})['then'](handleEntityNotFound(_0x746a,null))[_0x1582('0x27')](function(_0x539b6a){if(_0x539b6a){_0x2fde31=_0x539b6a;_0x1d71db[_0x1582('0x32')]=_[_0x1582('0x35')](db[_0x1582('0x53')][_0x1582('0x2f')]);_0x1d71db[_0x1582('0x34')]=_[_0x1582('0x35')](_0x190ed8[_0x1582('0x34')]);_0x1d71db[_0x1582('0x36')]=_[_0x1582('0x37')](_0x1d71db[_0x1582('0x32')],_0x1d71db[_0x1582('0x34')]);_0x51860d[_0x1582('0x39')]=_[_0x1582('0x37')](_0x1d71db[_0x1582('0x32')],qs['fields'](_0x190ed8[_0x1582('0x34')]['fields']));_0x51860d[_0x1582('0x39')]=_0x51860d[_0x1582('0x39')][_0x1582('0x3a')]?_0x51860d['attributes']:_0x1d71db[_0x1582('0x32')];_0x51860d['order']=qs['sort'](_0x190ed8[_0x1582('0x34')][_0x1582('0x3d')]);_0x51860d['where']=qs[_0x1582('0x36')](_[_0x1582('0x50')](_0x190ed8[_0x1582('0x34')],_0x1d71db[_0x1582('0x36')]));if(_0x190ed8[_0x1582('0x34')][_0x1582('0x3f')]){_0x51860d[_0x1582('0x3e')]=_[_0x1582('0x40')](_0x51860d[_0x1582('0x3e')],{'$or':_[_0x1582('0x2d')](_0x51860d[_0x1582('0x39')],function(_0x63006f){var _0x3adb82={};_0x3adb82[_0x63006f]={'$like':'%'+_0x190ed8[_0x1582('0x34')][_0x1582('0x3f')]+'%'};return _0x3adb82;})});}_0x51860d=_[_0x1582('0x40')]({},_0x51860d,_0x190ed8[_0x1582('0x42')]);return _0x2fde31[_0x1582('0x54')](_0x51860d);}})[_0x1582('0x27')](function(_0x289205){if(_0x289205){_0x3de52b=_0x289205[_0x1582('0x3a')];if(!_0x190ed8['query']['hasOwnProperty'](_0x1582('0x51'))){_0x51860d[_0x1582('0x20')]=qs[_0x1582('0x20')](_0x190ed8[_0x1582('0x34')]['limit']);_0x51860d[_0x1582('0x3c')]=qs[_0x1582('0x3c')](_0x190ed8[_0x1582('0x34')]['offset']);}return _0x2fde31[_0x1582('0x54')](_0x51860d);}})[_0x1582('0x27')](function(_0x430101){if(_0x430101){return _0x430101?{'count':_0x3de52b,'rows':_0x430101}:null;}})[_0x1582('0x27')](respondWithResult(_0x746a,null))[_0x1582('0x49')](handleError(_0x746a,null));}; \ No newline at end of file +var _0xaf78=['undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','SugarcrmConfiguration','count','include','findAll','catch','show','params','rawAttributes','create','body','find','getFields','findOne','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf78,0x1af));var _0x8af7=function(_0x565ef0,_0x105d70){_0x565ef0=_0x565ef0-0x0;var _0x2aebb7=_0xaf78[_0x565ef0];return _0x2aebb7;};'use strict';var emlformat=require(_0x8af7('0x0'));var rimraf=require(_0x8af7('0x1'));var zipdir=require(_0x8af7('0x2'));var jsonpatch=require(_0x8af7('0x3'));var rp=require(_0x8af7('0x4'));var moment=require(_0x8af7('0x5'));var BPromise=require(_0x8af7('0x6'));var Mustache=require(_0x8af7('0x7'));var util=require(_0x8af7('0x8'));var path=require(_0x8af7('0x9'));var sox=require(_0x8af7('0xa'));var csv=require(_0x8af7('0xb'));var ejs=require(_0x8af7('0xc'));var fs=require('fs');var fs_extra=require(_0x8af7('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8af7('0xe'));var jsforce=require(_0x8af7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8af7('0xb'));var querystring=require(_0x8af7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8af7('0x11'));var qs=require(_0x8af7('0x12'));var as=require(_0x8af7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8af7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8af7('0x15'))['db'];function respondWithStatusCode(_0x3d31c4,_0x217af4){_0x217af4=_0x217af4||0xcc;return function(_0x26d5a7){if(_0x26d5a7){return _0x3d31c4[_0x8af7('0x16')](_0x217af4);}return _0x3d31c4[_0x8af7('0x17')](_0x217af4)['end']();};}function respondWithResult(_0x4d99d3,_0x18de05){_0x18de05=_0x18de05||0xc8;return function(_0x4c354e){if(_0x4c354e){return _0x4d99d3[_0x8af7('0x17')](_0x18de05)['json'](_0x4c354e);}};}function respondWithFilteredResult(_0x32935b,_0x5003e9){return function(_0x1643a7){if(_0x1643a7){var _0x3735c6=typeof _0x5003e9[_0x8af7('0x18')]===_0x8af7('0x19')&&typeof _0x5003e9[_0x8af7('0x1a')]===_0x8af7('0x19');var _0x489b45=_0x1643a7['count'];var _0x3fc918=_0x3735c6?0x0:_0x5003e9['offset'];var _0x5a0b0=_0x3735c6?_0x1643a7['count']:_0x5003e9['offset']+_0x5003e9[_0x8af7('0x1a')];var _0x565afd;if(_0x5a0b0>=_0x489b45){_0x5a0b0=_0x489b45;_0x565afd=0xc8;}else{_0x565afd=0xce;}_0x32935b[_0x8af7('0x17')](_0x565afd);return _0x32935b[_0x8af7('0x1b')](_0x8af7('0x1c'),_0x3fc918+'-'+_0x5a0b0+'/'+_0x489b45)[_0x8af7('0x1d')](_0x1643a7);}return null;};}function patchUpdates(_0x14b667){return function(_0x5c21ae){try{jsonpatch[_0x8af7('0x1e')](_0x5c21ae,_0x14b667,!![]);}catch(_0x256a77){return BPromise['reject'](_0x256a77);}return _0x5c21ae[_0x8af7('0x1f')]();};}function saveUpdates(_0x50b8aa,_0x552b9d){return function(_0x1d31f6){if(_0x1d31f6){return _0x1d31f6[_0x8af7('0x20')](_0x50b8aa)[_0x8af7('0x21')](function(_0x298136){return _0x298136;});}return null;};}function removeEntity(_0xc93ad6,_0x404522){return function(_0x46dd5d){if(_0x46dd5d){return _0x46dd5d[_0x8af7('0x22')]()[_0x8af7('0x21')](function(){_0xc93ad6['status'](0xcc)[_0x8af7('0x23')]();});}};}function handleEntityNotFound(_0x2d9d27,_0x2606da){return function(_0x5511f5){if(!_0x5511f5){_0x2d9d27[_0x8af7('0x16')](0x194);}return _0x5511f5;};}function handleError(_0x541d24,_0x5ecf76){_0x5ecf76=_0x5ecf76||0x1f4;return function(_0x23ee72){logger[_0x8af7('0x24')](_0x23ee72[_0x8af7('0x25')]);if(_0x23ee72[_0x8af7('0x26')]){delete _0x23ee72[_0x8af7('0x26')];}_0x541d24['status'](_0x5ecf76)[_0x8af7('0x27')](_0x23ee72);};}exports['index']=function(_0x1dc4e7,_0x178f74){var _0x23e527={},_0x33d66e={},_0x290847={'count':0x0,'rows':[]};var _0x2c33ef=_[_0x8af7('0x28')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x56388c){return{'name':_0x56388c['fieldName'],'type':_0x56388c[_0x8af7('0x29')][_0x8af7('0x2a')]};});_0x33d66e[_0x8af7('0x2b')]=_[_0x8af7('0x28')](_0x2c33ef,'name');_0x33d66e[_0x8af7('0x2c')]=_[_0x8af7('0x2d')](_0x1dc4e7['query']);_0x33d66e[_0x8af7('0x2e')]=_[_0x8af7('0x2f')](_0x33d66e[_0x8af7('0x2b')],_0x33d66e[_0x8af7('0x2c')]);_0x23e527[_0x8af7('0x30')]=_[_0x8af7('0x2f')](_0x33d66e[_0x8af7('0x2b')],qs[_0x8af7('0x31')](_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x31')]));_0x23e527[_0x8af7('0x30')]=_0x23e527[_0x8af7('0x30')][_0x8af7('0x32')]?_0x23e527['attributes']:_0x33d66e[_0x8af7('0x2b')];if(!_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x33')](_0x8af7('0x34'))){_0x23e527[_0x8af7('0x1a')]=qs[_0x8af7('0x1a')](_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x1a')]);_0x23e527['offset']=qs[_0x8af7('0x18')](_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x18')]);}_0x23e527[_0x8af7('0x35')]=qs[_0x8af7('0x36')](_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x36')]);_0x23e527['where']=qs[_0x8af7('0x2e')](_[_0x8af7('0x37')](_0x1dc4e7['query'],_0x33d66e[_0x8af7('0x2e')]),_0x2c33ef);if(_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x38')]){_0x23e527['where']=_[_0x8af7('0x39')](_0x23e527[_0x8af7('0x3a')],{'$or':_[_0x8af7('0x28')](_0x2c33ef,function(_0x1b0277){if(_0x1b0277[_0x8af7('0x29')]!=='VIRTUAL'){var _0x353ec2={};_0x353ec2[_0x1b0277[_0x8af7('0x26')]]={'$like':'%'+_0x1dc4e7[_0x8af7('0x2c')][_0x8af7('0x38')]+'%'};return _0x353ec2;}})});}_0x23e527=_['merge']({},_0x23e527,_0x1dc4e7[_0x8af7('0x3b')]);var _0x17247e={'where':_0x23e527[_0x8af7('0x3a')]};return db[_0x8af7('0x3c')][_0x8af7('0x3d')](_0x17247e)[_0x8af7('0x21')](function(_0x23b48){_0x290847[_0x8af7('0x3d')]=_0x23b48;if(_0x1dc4e7[_0x8af7('0x2c')]['includeAll']){_0x23e527[_0x8af7('0x3e')]=[{'all':!![]}];}return db[_0x8af7('0x3c')][_0x8af7('0x3f')](_0x23e527);})[_0x8af7('0x21')](function(_0x1c5765){_0x290847['rows']=_0x1c5765;return _0x290847;})[_0x8af7('0x21')](respondWithFilteredResult(_0x178f74,_0x23e527))[_0x8af7('0x40')](handleError(_0x178f74,null));};exports[_0x8af7('0x41')]=function(_0x209831,_0x10f8a6){var _0x41cc40={'raw':![],'where':{'id':_0x209831[_0x8af7('0x42')]['id']}},_0x150562={};_0x150562[_0x8af7('0x2b')]=_['keys'](db['SugarcrmConfiguration'][_0x8af7('0x43')]);_0x150562[_0x8af7('0x2c')]=_[_0x8af7('0x2d')](_0x209831[_0x8af7('0x2c')]);_0x150562['filters']=_[_0x8af7('0x2f')](_0x150562[_0x8af7('0x2b')],_0x150562[_0x8af7('0x2c')]);_0x41cc40[_0x8af7('0x30')]=_[_0x8af7('0x2f')](_0x150562['model'],qs[_0x8af7('0x31')](_0x209831['query'][_0x8af7('0x31')]));_0x41cc40[_0x8af7('0x30')]=_0x41cc40['attributes'][_0x8af7('0x32')]?_0x41cc40[_0x8af7('0x30')]:_0x150562[_0x8af7('0x2b')];if(_0x209831[_0x8af7('0x2c')]['includeAll']){_0x41cc40[_0x8af7('0x3e')]=[{'all':!![]}];}_0x41cc40=_[_0x8af7('0x39')]({},_0x41cc40,_0x209831[_0x8af7('0x3b')]);return db[_0x8af7('0x3c')]['find'](_0x41cc40)[_0x8af7('0x21')](handleEntityNotFound(_0x10f8a6,null))[_0x8af7('0x21')](respondWithResult(_0x10f8a6,null))[_0x8af7('0x40')](handleError(_0x10f8a6,null));};exports[_0x8af7('0x44')]=function(_0x4b323a,_0x278e55){return db[_0x8af7('0x3c')][_0x8af7('0x44')](_0x4b323a[_0x8af7('0x45')],{})[_0x8af7('0x21')](respondWithResult(_0x278e55,0xc9))[_0x8af7('0x40')](handleError(_0x278e55,null));};exports[_0x8af7('0x20')]=function(_0x21a603,_0x126c4c){if(_0x21a603[_0x8af7('0x45')]['id']){delete _0x21a603[_0x8af7('0x45')]['id'];}return db[_0x8af7('0x3c')][_0x8af7('0x46')]({'where':{'id':_0x21a603[_0x8af7('0x42')]['id']}})[_0x8af7('0x21')](handleEntityNotFound(_0x126c4c,null))[_0x8af7('0x21')](saveUpdates(_0x21a603[_0x8af7('0x45')],null))[_0x8af7('0x21')](respondWithResult(_0x126c4c,null))[_0x8af7('0x40')](handleError(_0x126c4c,null));};exports['destroy']=function(_0x9f6643,_0x4ea8a7){return db[_0x8af7('0x3c')][_0x8af7('0x46')]({'where':{'id':_0x9f6643[_0x8af7('0x42')]['id']}})[_0x8af7('0x21')](handleEntityNotFound(_0x4ea8a7,null))[_0x8af7('0x21')](removeEntity(_0x4ea8a7,null))[_0x8af7('0x40')](handleError(_0x4ea8a7,null));};exports[_0x8af7('0x47')]=function(_0x113a69,_0x9a696d,_0x3ff19c){var _0x1abb7f={};var _0x504f1d={};var _0x397f1;var _0xe2505b;return db['SugarcrmConfiguration'][_0x8af7('0x48')]({'where':{'id':_0x113a69[_0x8af7('0x42')]['id']}})['then'](handleEntityNotFound(_0x9a696d,null))[_0x8af7('0x21')](function(_0x38288c){if(_0x38288c){_0x397f1=_0x38288c;_0x504f1d[_0x8af7('0x2b')]=_[_0x8af7('0x2d')](db['SugarcrmField']['rawAttributes']);_0x504f1d[_0x8af7('0x2c')]=_[_0x8af7('0x2d')](_0x113a69[_0x8af7('0x2c')]);_0x504f1d[_0x8af7('0x2e')]=_[_0x8af7('0x2f')](_0x504f1d['model'],_0x504f1d['query']);_0x1abb7f['attributes']=_['intersection'](_0x504f1d['model'],qs['fields'](_0x113a69[_0x8af7('0x2c')][_0x8af7('0x31')]));_0x1abb7f[_0x8af7('0x30')]=_0x1abb7f['attributes']['length']?_0x1abb7f[_0x8af7('0x30')]:_0x504f1d[_0x8af7('0x2b')];_0x1abb7f['order']=qs['sort'](_0x113a69['query'][_0x8af7('0x36')]);_0x1abb7f[_0x8af7('0x3a')]=qs['filters'](_['pick'](_0x113a69[_0x8af7('0x2c')],_0x504f1d[_0x8af7('0x2e')]));if(_0x113a69[_0x8af7('0x2c')]['filter']){_0x1abb7f[_0x8af7('0x3a')]=_[_0x8af7('0x39')](_0x1abb7f['where'],{'$or':_[_0x8af7('0x28')](_0x1abb7f[_0x8af7('0x30')],function(_0xed28cb){var _0x1d93db={};_0x1d93db[_0xed28cb]={'$like':'%'+_0x113a69[_0x8af7('0x2c')][_0x8af7('0x38')]+'%'};return _0x1d93db;})});}_0x1abb7f=_['merge']({},_0x1abb7f,_0x113a69[_0x8af7('0x3b')]);return _0x397f1['getFields'](_0x1abb7f);}})['then'](function(_0x406743){if(_0x406743){_0xe2505b=_0x406743[_0x8af7('0x32')];if(!_0x113a69[_0x8af7('0x2c')][_0x8af7('0x33')](_0x8af7('0x34'))){_0x1abb7f[_0x8af7('0x1a')]=qs['limit'](_0x113a69[_0x8af7('0x2c')][_0x8af7('0x1a')]);_0x1abb7f[_0x8af7('0x18')]=qs['offset'](_0x113a69[_0x8af7('0x2c')][_0x8af7('0x18')]);}return _0x397f1[_0x8af7('0x47')](_0x1abb7f);}})[_0x8af7('0x21')](function(_0x204374){if(_0x204374){return _0x204374?{'count':_0xe2505b,'rows':_0x204374}:null;}})[_0x8af7('0x21')](respondWithResult(_0x9a696d,null))['catch'](handleError(_0x9a696d,null));};exports[_0x8af7('0x49')]=function(_0x2a6a20,_0x3af383,_0x30759c){var _0x310e5a={};var _0x1d3d78={};var _0x197546;var _0x36623f;return db['SugarcrmConfiguration'][_0x8af7('0x48')]({'where':{'id':_0x2a6a20['params']['id']}})[_0x8af7('0x21')](handleEntityNotFound(_0x3af383,null))[_0x8af7('0x21')](function(_0x22c8cb){if(_0x22c8cb){_0x197546=_0x22c8cb;_0x1d3d78['model']=_['keys'](db[_0x8af7('0x4a')][_0x8af7('0x43')]);_0x1d3d78[_0x8af7('0x2c')]=_[_0x8af7('0x2d')](_0x2a6a20[_0x8af7('0x2c')]);_0x1d3d78[_0x8af7('0x2e')]=_['intersection'](_0x1d3d78['model'],_0x1d3d78[_0x8af7('0x2c')]);_0x310e5a['attributes']=_[_0x8af7('0x2f')](_0x1d3d78[_0x8af7('0x2b')],qs[_0x8af7('0x31')](_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x31')]));_0x310e5a['attributes']=_0x310e5a[_0x8af7('0x30')][_0x8af7('0x32')]?_0x310e5a['attributes']:_0x1d3d78[_0x8af7('0x2b')];_0x310e5a[_0x8af7('0x35')]=qs[_0x8af7('0x36')](_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x36')]);_0x310e5a['where']=qs['filters'](_[_0x8af7('0x37')](_0x2a6a20[_0x8af7('0x2c')],_0x1d3d78[_0x8af7('0x2e')]));if(_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x38')]){_0x310e5a['where']=_[_0x8af7('0x39')](_0x310e5a[_0x8af7('0x3a')],{'$or':_['map'](_0x310e5a[_0x8af7('0x30')],function(_0x5b13f8){var _0x165c3b={};_0x165c3b[_0x5b13f8]={'$like':'%'+_0x2a6a20[_0x8af7('0x2c')]['filter']+'%'};return _0x165c3b;})});}_0x310e5a=_[_0x8af7('0x39')]({},_0x310e5a,_0x2a6a20[_0x8af7('0x3b')]);return _0x197546[_0x8af7('0x49')](_0x310e5a);}})[_0x8af7('0x21')](function(_0x35832e){if(_0x35832e){_0x36623f=_0x35832e[_0x8af7('0x32')];if(!_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x33')]('nolimit')){_0x310e5a[_0x8af7('0x1a')]=qs[_0x8af7('0x1a')](_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x1a')]);_0x310e5a[_0x8af7('0x18')]=qs[_0x8af7('0x18')](_0x2a6a20[_0x8af7('0x2c')][_0x8af7('0x18')]);}return _0x197546[_0x8af7('0x49')](_0x310e5a);}})[_0x8af7('0x21')](function(_0x5def05){if(_0x5def05){return _0x5def05?{'count':_0x36623f,'rows':_0x5def05}:null;}})[_0x8af7('0x21')](respondWithResult(_0x3af383,null))[_0x8af7('0x40')](handleError(_0x3af383,null));};exports[_0x8af7('0x4b')]=function(_0x38d183,_0x39040a,_0x45995a){var _0x4ab4ff={};var _0x59e5e4={};var _0x3d0777;var _0x5877a3;return db[_0x8af7('0x3c')][_0x8af7('0x48')]({'where':{'id':_0x38d183['params']['id']}})[_0x8af7('0x21')](handleEntityNotFound(_0x39040a,null))[_0x8af7('0x21')](function(_0x25071c){if(_0x25071c){_0x3d0777=_0x25071c;_0x59e5e4[_0x8af7('0x2b')]=_[_0x8af7('0x2d')](db[_0x8af7('0x4a')][_0x8af7('0x43')]);_0x59e5e4['query']=_[_0x8af7('0x2d')](_0x38d183[_0x8af7('0x2c')]);_0x59e5e4[_0x8af7('0x2e')]=_['intersection'](_0x59e5e4[_0x8af7('0x2b')],_0x59e5e4[_0x8af7('0x2c')]);_0x4ab4ff[_0x8af7('0x30')]=_[_0x8af7('0x2f')](_0x59e5e4[_0x8af7('0x2b')],qs[_0x8af7('0x31')](_0x38d183[_0x8af7('0x2c')][_0x8af7('0x31')]));_0x4ab4ff['attributes']=_0x4ab4ff[_0x8af7('0x30')][_0x8af7('0x32')]?_0x4ab4ff[_0x8af7('0x30')]:_0x59e5e4[_0x8af7('0x2b')];_0x4ab4ff[_0x8af7('0x35')]=qs[_0x8af7('0x36')](_0x38d183[_0x8af7('0x2c')][_0x8af7('0x36')]);_0x4ab4ff[_0x8af7('0x3a')]=qs[_0x8af7('0x2e')](_[_0x8af7('0x37')](_0x38d183[_0x8af7('0x2c')],_0x59e5e4[_0x8af7('0x2e')]));if(_0x38d183['query'][_0x8af7('0x38')]){_0x4ab4ff[_0x8af7('0x3a')]=_[_0x8af7('0x39')](_0x4ab4ff[_0x8af7('0x3a')],{'$or':_[_0x8af7('0x28')](_0x4ab4ff[_0x8af7('0x30')],function(_0x530b9b){var _0x4e29d2={};_0x4e29d2[_0x530b9b]={'$like':'%'+_0x38d183['query'][_0x8af7('0x38')]+'%'};return _0x4e29d2;})});}_0x4ab4ff=_['merge']({},_0x4ab4ff,_0x38d183[_0x8af7('0x3b')]);return _0x3d0777[_0x8af7('0x4b')](_0x4ab4ff);}})[_0x8af7('0x21')](function(_0xb2f7e7){if(_0xb2f7e7){_0x5877a3=_0xb2f7e7[_0x8af7('0x32')];if(!_0x38d183[_0x8af7('0x2c')][_0x8af7('0x33')](_0x8af7('0x34'))){_0x4ab4ff[_0x8af7('0x1a')]=qs[_0x8af7('0x1a')](_0x38d183[_0x8af7('0x2c')][_0x8af7('0x1a')]);_0x4ab4ff[_0x8af7('0x18')]=qs[_0x8af7('0x18')](_0x38d183[_0x8af7('0x2c')][_0x8af7('0x18')]);}return _0x3d0777[_0x8af7('0x4b')](_0x4ab4ff);}})[_0x8af7('0x21')](function(_0x1ab54d){if(_0x1ab54d){return _0x1ab54d?{'count':_0x5877a3,'rows':_0x1ab54d}:null;}})[_0x8af7('0x21')](respondWithResult(_0x39040a,null))['catch'](handleError(_0x39040a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index dc2bc78..767f0fc 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf774=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','SugarcrmConfiguration'];(function(_0x2a2cfd,_0x274d1e){var _0x18c062=function(_0x22a4c0){while(--_0x22a4c0){_0x2a2cfd['push'](_0x2a2cfd['shift']());}};_0x18c062(++_0x274d1e);}(_0xf774,0x11f));var _0x4f77=function(_0x343d9d,_0xa29023){_0x343d9d=_0x343d9d-0x0;var _0x526cab=_0xf774[_0x343d9d];return _0x526cab;};'use strict';var _=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var logger=require(_0x4f77('0x2'))(_0x4f77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f77('0x5'));var config=require(_0x4f77('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x4f77('0x7')]=function(_0x58e994,_0x10613a){return _0x58e994[_0x4f77('0x8')](_0x4f77('0x9'),attributes,{'tableName':_0x4f77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca6=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define'];(function(_0x4e1211,_0x3babe2){var _0x2ffc28=function(_0x4febf4){while(--_0x4febf4){_0x4e1211['push'](_0x4e1211['shift']());}};_0x2ffc28(++_0x3babe2);}(_0x8ca6,0x139));var _0x68ca=function(_0x5cb578,_0x398b9a){_0x5cb578=_0x5cb578-0x0;var _0xcaecf2=_0x8ca6[_0x5cb578];return _0xcaecf2;};'use strict';var _=require(_0x68ca('0x0'));var util=require(_0x68ca('0x1'));var logger=require(_0x68ca('0x2'))(_0x68ca('0x3'));var moment=require(_0x68ca('0x4'));var BPromise=require(_0x68ca('0x5'));var rp=require(_0x68ca('0x6'));var fs=require('fs');var path=require(_0x68ca('0x7'));var rimraf=require(_0x68ca('0x8'));var config=require(_0x68ca('0x9'));var attributes=require(_0x68ca('0xa'));module['exports']=function(_0x5e83a8,_0x545d08){return _0x5e83a8[_0x68ca('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x68ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index c9fac7b..0a678e3 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfa5=['rpc','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x5d4dc2,_0x218752){var _0x31a0dd=function(_0x4eff01){while(--_0x4eff01){_0x5d4dc2['push'](_0x5d4dc2['shift']());}};_0x31a0dd(++_0x218752);}(_0xcfa5,0x118));var _0x5cfa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcfa5[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x5cfa('0x0'));var moment=require('moment');var BPromise=require(_0x5cfa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cfa('0x2'));var db=require(_0x5cfa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cfa('0x4'))(_0x5cfa('0x5'));var config=require('../../config/environment');var jayson=require(_0x5cfa('0x6'));var client=jayson[_0x5cfa('0x7')][_0x5cfa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b380d,_0x333115,_0x2ba34a){return new BPromise(function(_0x16aaa9,_0x1f2088){return client['request'](_0x4b380d,_0x2ba34a)[_0x5cfa('0x9')](function(_0xf002a){logger[_0x5cfa('0xa')](_0x5cfa('0xb'),_0x333115,'request\x20sent');logger[_0x5cfa('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x333115,_0x5cfa('0xd'),JSON[_0x5cfa('0xe')](_0xf002a));if(_0xf002a[_0x5cfa('0xf')]){if(_0xf002a['error'][_0x5cfa('0x10')]===0x1f4){logger[_0x5cfa('0xf')](_0x5cfa('0xb'),_0x333115,_0xf002a[_0x5cfa('0xf')][_0x5cfa('0x11')]);return _0x1f2088(_0xf002a[_0x5cfa('0xf')]['message']);}logger['error'](_0x5cfa('0xb'),_0x333115,_0xf002a[_0x5cfa('0xf')][_0x5cfa('0x11')]);return _0x16aaa9(_0xf002a[_0x5cfa('0xf')][_0x5cfa('0x11')]);}else{logger[_0x5cfa('0xa')](_0x5cfa('0xb'),_0x333115,_0x5cfa('0xd'));_0x16aaa9(_0xf002a[_0x5cfa('0x12')]['message']);}})['catch'](function(_0x306279){logger[_0x5cfa('0xf')](_0x5cfa('0xb'),_0x333115,_0x306279);_0x1f2088(_0x306279);});});} \ No newline at end of file +var _0x91ac=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x58c26d,_0x93e0a3){var _0x10f4be=function(_0x2b8578){while(--_0x2b8578){_0x58c26d['push'](_0x58c26d['shift']());}};_0x10f4be(++_0x93e0a3);}(_0x91ac,0xd6));var _0xc91a=function(_0x3592f0,_0x56b8b9){_0x3592f0=_0x3592f0-0x0;var _0x4c13ac=_0x91ac[_0x3592f0];return _0x4c13ac;};'use strict';var _=require(_0xc91a('0x0'));var util=require(_0xc91a('0x1'));var moment=require(_0xc91a('0x2'));var BPromise=require(_0xc91a('0x3'));var rs=require(_0xc91a('0x4'));var fs=require('fs');var Redis=require(_0xc91a('0x5'));var db=require(_0xc91a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc91a('0x7'));var config=require(_0xc91a('0x8'));var jayson=require(_0xc91a('0x9'));var client=jayson[_0xc91a('0xa')][_0xc91a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x474c5b,_0x4639b9,_0x511197){return new BPromise(function(_0x1bbb1d,_0x10e844){return client[_0xc91a('0xc')](_0x474c5b,_0x511197)[_0xc91a('0xd')](function(_0x400bdd){logger[_0xc91a('0xe')](_0xc91a('0xf'),_0x4639b9,'request\x20sent');logger[_0xc91a('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4639b9,_0xc91a('0x11'),JSON[_0xc91a('0x12')](_0x400bdd));if(_0x400bdd['error']){if(_0x400bdd[_0xc91a('0x13')][_0xc91a('0x14')]===0x1f4){logger[_0xc91a('0x13')](_0xc91a('0xf'),_0x4639b9,_0x400bdd[_0xc91a('0x13')][_0xc91a('0x15')]);return _0x10e844(_0x400bdd[_0xc91a('0x13')]['message']);}logger[_0xc91a('0x13')](_0xc91a('0xf'),_0x4639b9,_0x400bdd[_0xc91a('0x13')][_0xc91a('0x15')]);return _0x1bbb1d(_0x400bdd[_0xc91a('0x13')][_0xc91a('0x15')]);}else{logger['info'](_0xc91a('0xf'),_0x4639b9,_0xc91a('0x11'));_0x1bbb1d(_0x400bdd[_0xc91a('0x16')][_0xc91a('0x15')]);}})[_0xc91a('0x17')](function(_0x4ef99e){logger[_0xc91a('0x13')](_0xc91a('0xf'),_0x4639b9,_0x4ef99e);_0x10e844(_0x4ef99e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7f07717..78d7b9c 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc67e=['../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e1409,_0x2eb61d){var _0x37b0c1=function(_0x569e9e){while(--_0x569e9e){_0x4e1409['push'](_0x4e1409['shift']());}};_0x37b0c1(++_0x2eb61d);}(_0xc67e,0x1ed));var _0xec67=function(_0x435f8d,_0x29991){_0x435f8d=_0x435f8d-0x0;var _0xea059f=_0xc67e[_0x435f8d];return _0xea059f;};'use strict';var multer=require(_0xec67('0x0'));var util=require(_0xec67('0x1'));var path=require(_0xec67('0x2'));var timeout=require(_0xec67('0x3'));var express=require(_0xec67('0x4'));var router=express[_0xec67('0x5')]();var fs_extra=require(_0xec67('0x6'));var auth=require(_0xec67('0x7'));var interaction=require(_0xec67('0x8'));var config=require('../../config/environment');var controller=require(_0xec67('0x9'));router[_0xec67('0xa')]('/',auth['isAuthenticated'](),controller[_0xec67('0xb')]);router['get'](_0xec67('0xc'),auth[_0xec67('0xd')](),controller[_0xec67('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xec67('0xf')]);router[_0xec67('0x10')](_0xec67('0xc'),auth['isAuthenticated'](),controller[_0xec67('0x11')]);router['delete'](_0xec67('0xc'),auth[_0xec67('0xd')](),controller[_0xec67('0x12')]);module[_0xec67('0x13')]=router; \ No newline at end of file +var _0xa282=['path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','multer','util'];(function(_0x27d3f8,_0x7800a5){var _0xbd76c2=function(_0x52218c){while(--_0x52218c){_0x27d3f8['push'](_0x27d3f8['shift']());}};_0xbd76c2(++_0x7800a5);}(_0xa282,0xd6));var _0x2a28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa282[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var path=require(_0x2a28('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a28('0x3'));var router=express[_0x2a28('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a28('0x5'));var config=require(_0x2a28('0x6'));var controller=require(_0x2a28('0x7'));router['get']('/',auth[_0x2a28('0x8')](),controller[_0x2a28('0x9')]);router[_0x2a28('0xa')](_0x2a28('0xb'),auth[_0x2a28('0x8')](),controller['show']);router[_0x2a28('0xc')]('/',auth[_0x2a28('0x8')](),controller[_0x2a28('0xd')]);router[_0x2a28('0xe')](_0x2a28('0xb'),auth[_0x2a28('0x8')](),controller['update']);router[_0x2a28('0xf')]('/:id',auth[_0x2a28('0x8')](),controller[_0x2a28('0x10')]);module[_0x2a28('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9bc696b..0ffb8f4 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61cf=['ENUM','customVariable','keyValue','picklist','STRING','string','variable','BOOLEAN','exports'];(function(_0x4ade50,_0x372294){var _0x1d1628=function(_0x165aae){while(--_0x165aae){_0x4ade50['push'](_0x4ade50['shift']());}};_0x1d1628(++_0x372294);}(_0x61cf,0xb3));var _0xf61c=function(_0x38d3f3,_0x232894){_0x38d3f3=_0x38d3f3-0x0;var _0x54b3d1=_0x61cf[_0x38d3f3];return _0x54b3d1;};'use strict';var Sequelize=require('sequelize');module[_0xf61c('0x0')]={'type':{'type':Sequelize[_0xf61c('0x1')]('string','variable',_0xf61c('0x2'),_0xf61c('0x3'),_0xf61c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf61c('0x5')]},'keyType':{'type':Sequelize[_0xf61c('0x1')](_0xf61c('0x6'),_0xf61c('0x7'),_0xf61c('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf61c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf61c('0x5')]}}; \ No newline at end of file +var _0x0a29=['ENUM','string','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a29,0x1d4));var _0x90a2=function(_0x1f77fc,_0x4cfe13){_0x1f77fc=_0x1f77fc-0x0;var _0x31ad35=_0x0a29[_0x1f77fc];return _0x31ad35;};'use strict';var Sequelize=require(_0x90a2('0x0'));module['exports']={'type':{'type':Sequelize[_0x90a2('0x1')](_0x90a2('0x2'),'variable','customVariable','keyValue',_0x90a2('0x3')),'defaultValue':_0x90a2('0x2')},'content':{'type':Sequelize[_0x90a2('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x90a2('0x1')](_0x90a2('0x2'),'variable',_0x90a2('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x90a2('0x4')]},'customField':{'type':Sequelize[_0x90a2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90a2('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 978cdea..4859b1c 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe8a=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','send','map','SugarcrmField','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','squel'];(function(_0x259d84,_0x99d2a1){var _0x28b1c1=function(_0x3a76a4){while(--_0x3a76a4){_0x259d84['push'](_0x259d84['shift']());}};_0x28b1c1(++_0x99d2a1);}(_0xbe8a,0x116));var _0xabe8=function(_0x277b55,_0x8ba28){_0x277b55=_0x277b55-0x0;var _0xff0d15=_0xbe8a[_0x277b55];return _0xff0d15;};'use strict';var emlformat=require(_0xabe8('0x0'));var rimraf=require(_0xabe8('0x1'));var zipdir=require(_0xabe8('0x2'));var jsonpatch=require(_0xabe8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xabe8('0x4'));var Mustache=require('mustache');var util=require(_0xabe8('0x5'));var path=require(_0xabe8('0x6'));var sox=require('sox');var csv=require(_0xabe8('0x7'));var ejs=require(_0xabe8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabe8('0x9'));var crypto=require(_0xabe8('0xa'));var jsforce=require(_0xabe8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xabe8('0x7'));var querystring=require(_0xabe8('0xc'));var Papa=require(_0xabe8('0xd'));var Redis=require(_0xabe8('0xe'));var authService=require(_0xabe8('0xf'));var qs=require(_0xabe8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabe8('0x11'));var logger=require(_0xabe8('0x12'))(_0xabe8('0x13'));var utils=require(_0xabe8('0x14'));var config=require(_0xabe8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xabe8('0x16'))['db'];function respondWithStatusCode(_0x3ad85b,_0x59c3d0){_0x59c3d0=_0x59c3d0||0xcc;return function(_0x2a91c2){if(_0x2a91c2){return _0x3ad85b[_0xabe8('0x17')](_0x59c3d0);}return _0x3ad85b[_0xabe8('0x18')](_0x59c3d0)[_0xabe8('0x19')]();};}function respondWithResult(_0x2e64fc,_0x3a2967){_0x3a2967=_0x3a2967||0xc8;return function(_0x1de49b){if(_0x1de49b){return _0x2e64fc[_0xabe8('0x18')](_0x3a2967)[_0xabe8('0x1a')](_0x1de49b);}};}function respondWithFilteredResult(_0x4d8891,_0x14e3ce){return function(_0x3fad){if(_0x3fad){var _0x1da782=typeof _0x14e3ce['offset']===_0xabe8('0x1b')&&typeof _0x14e3ce[_0xabe8('0x1c')]===_0xabe8('0x1b');var _0x16e8be=_0x3fad[_0xabe8('0x1d')];var _0xba97d7=_0x1da782?0x0:_0x14e3ce[_0xabe8('0x1e')];var _0x24608c=_0x1da782?_0x3fad[_0xabe8('0x1d')]:_0x14e3ce[_0xabe8('0x1e')]+_0x14e3ce[_0xabe8('0x1c')];var _0x121fcf;if(_0x24608c>=_0x16e8be){_0x24608c=_0x16e8be;_0x121fcf=0xc8;}else{_0x121fcf=0xce;}_0x4d8891[_0xabe8('0x18')](_0x121fcf);return _0x4d8891[_0xabe8('0x1f')]('Content-Range',_0xba97d7+'-'+_0x24608c+'/'+_0x16e8be)[_0xabe8('0x1a')](_0x3fad);}return null;};}function patchUpdates(_0x581545){return function(_0x2aab42){try{jsonpatch[_0xabe8('0x20')](_0x2aab42,_0x581545,!![]);}catch(_0xd9045b){return BPromise[_0xabe8('0x21')](_0xd9045b);}return _0x2aab42[_0xabe8('0x22')]();};}function saveUpdates(_0x39cf96,_0x2614ec){return function(_0x1a0b72){if(_0x1a0b72){return _0x1a0b72[_0xabe8('0x23')](_0x39cf96)[_0xabe8('0x24')](function(_0x2a140a){return _0x2a140a;});}return null;};}function removeEntity(_0x3204d1,_0x547248){return function(_0x379a12){if(_0x379a12){return _0x379a12[_0xabe8('0x25')]()[_0xabe8('0x24')](function(){_0x3204d1[_0xabe8('0x18')](0xcc)[_0xabe8('0x19')]();});}};}function handleEntityNotFound(_0xf18489,_0x46c0d4){return function(_0x208670){if(!_0x208670){_0xf18489[_0xabe8('0x17')](0x194);}return _0x208670;};}function handleError(_0x1c270f,_0x532342){_0x532342=_0x532342||0x1f4;return function(_0x41f3d6){logger[_0xabe8('0x26')](_0x41f3d6['stack']);if(_0x41f3d6['name']){delete _0x41f3d6['name'];}_0x1c270f[_0xabe8('0x18')](_0x532342)[_0xabe8('0x27')](_0x41f3d6);};}exports['index']=function(_0x2aa5ed,_0x5500be){var _0x3716b5={},_0xf4ead9={},_0x532649={'count':0x0,'rows':[]};var _0x2df648=_[_0xabe8('0x28')](db[_0xabe8('0x29')]['rawAttributes'],function(_0x40ab3b){return{'name':_0x40ab3b[_0xabe8('0x2a')],'type':_0x40ab3b[_0xabe8('0x2b')][_0xabe8('0x2c')]};});_0xf4ead9[_0xabe8('0x2d')]=_[_0xabe8('0x28')](_0x2df648,_0xabe8('0x2e'));_0xf4ead9[_0xabe8('0x2f')]=_[_0xabe8('0x30')](_0x2aa5ed[_0xabe8('0x2f')]);_0xf4ead9[_0xabe8('0x31')]=_[_0xabe8('0x32')](_0xf4ead9[_0xabe8('0x2d')],_0xf4ead9['query']);_0x3716b5[_0xabe8('0x33')]=_[_0xabe8('0x32')](_0xf4ead9[_0xabe8('0x2d')],qs[_0xabe8('0x34')](_0x2aa5ed[_0xabe8('0x2f')][_0xabe8('0x34')]));_0x3716b5[_0xabe8('0x33')]=_0x3716b5['attributes'][_0xabe8('0x35')]?_0x3716b5['attributes']:_0xf4ead9[_0xabe8('0x2d')];if(!_0x2aa5ed[_0xabe8('0x2f')]['hasOwnProperty']('nolimit')){_0x3716b5[_0xabe8('0x1c')]=qs[_0xabe8('0x1c')](_0x2aa5ed[_0xabe8('0x2f')][_0xabe8('0x1c')]);_0x3716b5[_0xabe8('0x1e')]=qs[_0xabe8('0x1e')](_0x2aa5ed[_0xabe8('0x2f')]['offset']);}_0x3716b5[_0xabe8('0x36')]=qs['sort'](_0x2aa5ed[_0xabe8('0x2f')][_0xabe8('0x37')]);_0x3716b5['where']=qs[_0xabe8('0x31')](_[_0xabe8('0x38')](_0x2aa5ed[_0xabe8('0x2f')],_0xf4ead9[_0xabe8('0x31')]),_0x2df648);if(_0x2aa5ed['query']['filter']){_0x3716b5[_0xabe8('0x39')]=_[_0xabe8('0x3a')](_0x3716b5[_0xabe8('0x39')],{'$or':_[_0xabe8('0x28')](_0x2df648,function(_0x4aef12){if(_0x4aef12[_0xabe8('0x2b')]!==_0xabe8('0x3b')){var _0x4e1273={};_0x4e1273[_0x4aef12[_0xabe8('0x2e')]]={'$like':'%'+_0x2aa5ed['query'][_0xabe8('0x3c')]+'%'};return _0x4e1273;}})});}_0x3716b5=_['merge']({},_0x3716b5,_0x2aa5ed[_0xabe8('0x3d')]);var _0x54d9a8={'where':_0x3716b5[_0xabe8('0x39')]};return db[_0xabe8('0x29')][_0xabe8('0x1d')](_0x54d9a8)[_0xabe8('0x24')](function(_0x2bdf8c){_0x532649['count']=_0x2bdf8c;if(_0x2aa5ed['query'][_0xabe8('0x3e')]){_0x3716b5[_0xabe8('0x3f')]=[{'all':!![]}];}return db[_0xabe8('0x29')][_0xabe8('0x40')](_0x3716b5);})[_0xabe8('0x24')](function(_0x5872d8){_0x532649[_0xabe8('0x41')]=_0x5872d8;return _0x532649;})[_0xabe8('0x24')](respondWithFilteredResult(_0x5500be,_0x3716b5))[_0xabe8('0x42')](handleError(_0x5500be,null));};exports[_0xabe8('0x43')]=function(_0x2aecd8,_0x5cb313){var _0x50cc38={'raw':!![],'where':{'id':_0x2aecd8[_0xabe8('0x44')]['id']}},_0x5c8c0f={};_0x5c8c0f[_0xabe8('0x2d')]=_[_0xabe8('0x30')](db[_0xabe8('0x29')]['rawAttributes']);_0x5c8c0f[_0xabe8('0x2f')]=_['keys'](_0x2aecd8[_0xabe8('0x2f')]);_0x5c8c0f[_0xabe8('0x31')]=_[_0xabe8('0x32')](_0x5c8c0f[_0xabe8('0x2d')],_0x5c8c0f[_0xabe8('0x2f')]);_0x50cc38[_0xabe8('0x33')]=_['intersection'](_0x5c8c0f[_0xabe8('0x2d')],qs[_0xabe8('0x34')](_0x2aecd8[_0xabe8('0x2f')][_0xabe8('0x34')]));_0x50cc38[_0xabe8('0x33')]=_0x50cc38[_0xabe8('0x33')]['length']?_0x50cc38['attributes']:_0x5c8c0f[_0xabe8('0x2d')];if(_0x2aecd8[_0xabe8('0x2f')][_0xabe8('0x3e')]){_0x50cc38[_0xabe8('0x3f')]=[{'all':!![]}];}_0x50cc38=_[_0xabe8('0x3a')]({},_0x50cc38,_0x2aecd8[_0xabe8('0x3d')]);return db['SugarcrmField'][_0xabe8('0x45')](_0x50cc38)[_0xabe8('0x24')](handleEntityNotFound(_0x5cb313,null))[_0xabe8('0x24')](respondWithResult(_0x5cb313,null))['catch'](handleError(_0x5cb313,null));};exports[_0xabe8('0x46')]=function(_0x5b5575,_0x91449a){return db[_0xabe8('0x29')]['create'](_0x5b5575['body'],{})[_0xabe8('0x24')](respondWithResult(_0x91449a,0xc9))['catch'](handleError(_0x91449a,null));};exports[_0xabe8('0x23')]=function(_0x2897ab,_0x41af5e){if(_0x2897ab[_0xabe8('0x47')]['id']){delete _0x2897ab['body']['id'];}return db[_0xabe8('0x29')]['find']({'where':{'id':_0x2897ab[_0xabe8('0x44')]['id']}})[_0xabe8('0x24')](handleEntityNotFound(_0x41af5e,null))[_0xabe8('0x24')](saveUpdates(_0x2897ab[_0xabe8('0x47')],null))[_0xabe8('0x24')](respondWithResult(_0x41af5e,null))[_0xabe8('0x42')](handleError(_0x41af5e,null));};exports[_0xabe8('0x25')]=function(_0x10dcd6,_0x3ac12e){return db[_0xabe8('0x29')][_0xabe8('0x45')]({'where':{'id':_0x10dcd6[_0xabe8('0x44')]['id']}})[_0xabe8('0x24')](handleEntityNotFound(_0x3ac12e,null))[_0xabe8('0x24')](removeEntity(_0x3ac12e,null))['catch'](handleError(_0x3ac12e,null));}; \ No newline at end of file +var _0x0b75=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','eml-format','request-promise','moment','path','sox','ejs','fs-extra'];(function(_0x2a8f30,_0x39ada5){var _0x11a804=function(_0x201501){while(--_0x201501){_0x2a8f30['push'](_0x2a8f30['shift']());}};_0x11a804(++_0x39ada5);}(_0x0b75,0xd1));var _0x50b7=function(_0x5477bf,_0x1854b5){_0x5477bf=_0x5477bf-0x0;var _0x2a8778=_0x0b75[_0x5477bf];return _0x2a8778;};'use strict';var emlformat=require(_0x50b7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50b7('0x1'));var moment=require(_0x50b7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x50b7('0x3'));var sox=require(_0x50b7('0x4'));var csv=require('to-csv');var ejs=require(_0x50b7('0x5'));var fs=require('fs');var fs_extra=require(_0x50b7('0x6'));var _=require('lodash');var squel=require(_0x50b7('0x7'));var crypto=require(_0x50b7('0x8'));var jsforce=require(_0x50b7('0x9'));var deskjs=require(_0x50b7('0xa'));var toCsv=require(_0x50b7('0xb'));var querystring=require(_0x50b7('0xc'));var Papa=require(_0x50b7('0xd'));var Redis=require(_0x50b7('0xe'));var authService=require(_0x50b7('0xf'));var qs=require(_0x50b7('0x10'));var as=require(_0x50b7('0x11'));var hardwareService=require(_0x50b7('0x12'));var logger=require(_0x50b7('0x13'))('api');var utils=require(_0x50b7('0x14'));var config=require(_0x50b7('0x15'));var licenseUtil=require(_0x50b7('0x16'));var db=require(_0x50b7('0x17'))['db'];function respondWithStatusCode(_0x33cef0,_0x150fee){_0x150fee=_0x150fee||0xcc;return function(_0x269ac9){if(_0x269ac9){return _0x33cef0[_0x50b7('0x18')](_0x150fee);}return _0x33cef0['status'](_0x150fee)[_0x50b7('0x19')]();};}function respondWithResult(_0x1ad696,_0x17195b){_0x17195b=_0x17195b||0xc8;return function(_0x31aa71){if(_0x31aa71){return _0x1ad696[_0x50b7('0x1a')](_0x17195b)['json'](_0x31aa71);}};}function respondWithFilteredResult(_0x47e52e,_0x14add8){return function(_0x23410f){if(_0x23410f){var _0x50a5ac=typeof _0x14add8[_0x50b7('0x1b')]==='undefined'&&typeof _0x14add8['limit']===_0x50b7('0x1c');var _0x9d006=_0x23410f[_0x50b7('0x1d')];var _0x464fb0=_0x50a5ac?0x0:_0x14add8[_0x50b7('0x1b')];var _0x4ec6f7=_0x50a5ac?_0x23410f[_0x50b7('0x1d')]:_0x14add8[_0x50b7('0x1b')]+_0x14add8['limit'];var _0x51c204;if(_0x4ec6f7>=_0x9d006){_0x4ec6f7=_0x9d006;_0x51c204=0xc8;}else{_0x51c204=0xce;}_0x47e52e[_0x50b7('0x1a')](_0x51c204);return _0x47e52e['set'](_0x50b7('0x1e'),_0x464fb0+'-'+_0x4ec6f7+'/'+_0x9d006)[_0x50b7('0x1f')](_0x23410f);}return null;};}function patchUpdates(_0x567e17){return function(_0x43824b){try{jsonpatch[_0x50b7('0x20')](_0x43824b,_0x567e17,!![]);}catch(_0x1bf95e){return BPromise['reject'](_0x1bf95e);}return _0x43824b[_0x50b7('0x21')]();};}function saveUpdates(_0x240019,_0xb0b7e6){return function(_0x337631){if(_0x337631){return _0x337631[_0x50b7('0x22')](_0x240019)[_0x50b7('0x23')](function(_0x3ad82a){return _0x3ad82a;});}return null;};}function removeEntity(_0x23e4c6,_0x3ba48c){return function(_0x43187e){if(_0x43187e){return _0x43187e[_0x50b7('0x24')]()['then'](function(){_0x23e4c6[_0x50b7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x809dbb,_0x2f02eb){return function(_0x2c4a88){if(!_0x2c4a88){_0x809dbb[_0x50b7('0x18')](0x194);}return _0x2c4a88;};}function handleError(_0x3404ae,_0x598ce4){_0x598ce4=_0x598ce4||0x1f4;return function(_0x52d495){logger[_0x50b7('0x25')](_0x52d495[_0x50b7('0x26')]);if(_0x52d495[_0x50b7('0x27')]){delete _0x52d495[_0x50b7('0x27')];}_0x3404ae[_0x50b7('0x1a')](_0x598ce4)['send'](_0x52d495);};}exports[_0x50b7('0x28')]=function(_0x442989,_0x2c00c9){var _0x308f43={},_0x4b5a4d={},_0x54ca09={'count':0x0,'rows':[]};var _0x2c69f9=_[_0x50b7('0x29')](db[_0x50b7('0x2a')][_0x50b7('0x2b')],function(_0x491cf2){return{'name':_0x491cf2[_0x50b7('0x2c')],'type':_0x491cf2[_0x50b7('0x2d')][_0x50b7('0x2e')]};});_0x4b5a4d[_0x50b7('0x2f')]=_['map'](_0x2c69f9,'name');_0x4b5a4d[_0x50b7('0x30')]=_['keys'](_0x442989[_0x50b7('0x30')]);_0x4b5a4d[_0x50b7('0x31')]=_[_0x50b7('0x32')](_0x4b5a4d['model'],_0x4b5a4d['query']);_0x308f43['attributes']=_[_0x50b7('0x32')](_0x4b5a4d[_0x50b7('0x2f')],qs[_0x50b7('0x33')](_0x442989['query'][_0x50b7('0x33')]));_0x308f43['attributes']=_0x308f43[_0x50b7('0x34')][_0x50b7('0x35')]?_0x308f43['attributes']:_0x4b5a4d['model'];if(!_0x442989['query'][_0x50b7('0x36')]('nolimit')){_0x308f43['limit']=qs[_0x50b7('0x37')](_0x442989['query'][_0x50b7('0x37')]);_0x308f43[_0x50b7('0x1b')]=qs['offset'](_0x442989[_0x50b7('0x30')][_0x50b7('0x1b')]);}_0x308f43[_0x50b7('0x38')]=qs[_0x50b7('0x39')](_0x442989[_0x50b7('0x30')]['sort']);_0x308f43[_0x50b7('0x3a')]=qs[_0x50b7('0x31')](_[_0x50b7('0x3b')](_0x442989['query'],_0x4b5a4d[_0x50b7('0x31')]),_0x2c69f9);if(_0x442989[_0x50b7('0x30')][_0x50b7('0x3c')]){_0x308f43[_0x50b7('0x3a')]=_['merge'](_0x308f43[_0x50b7('0x3a')],{'$or':_[_0x50b7('0x29')](_0x2c69f9,function(_0x115e96){if(_0x115e96[_0x50b7('0x2d')]!=='VIRTUAL'){var _0x59f6f8={};_0x59f6f8[_0x115e96[_0x50b7('0x27')]]={'$like':'%'+_0x442989[_0x50b7('0x30')]['filter']+'%'};return _0x59f6f8;}})});}_0x308f43=_[_0x50b7('0x3d')]({},_0x308f43,_0x442989[_0x50b7('0x3e')]);var _0x447fd8={'where':_0x308f43['where']};return db[_0x50b7('0x2a')][_0x50b7('0x1d')](_0x447fd8)['then'](function(_0x3f7c74){_0x54ca09['count']=_0x3f7c74;if(_0x442989[_0x50b7('0x30')][_0x50b7('0x3f')]){_0x308f43[_0x50b7('0x40')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x308f43);})['then'](function(_0x1ed306){_0x54ca09[_0x50b7('0x41')]=_0x1ed306;return _0x54ca09;})[_0x50b7('0x23')](respondWithFilteredResult(_0x2c00c9,_0x308f43))[_0x50b7('0x42')](handleError(_0x2c00c9,null));};exports['show']=function(_0x3c1345,_0x433ff3){var _0x1b6b93={'raw':!![],'where':{'id':_0x3c1345[_0x50b7('0x43')]['id']}},_0x44f9b0={};_0x44f9b0[_0x50b7('0x2f')]=_[_0x50b7('0x44')](db[_0x50b7('0x2a')][_0x50b7('0x2b')]);_0x44f9b0[_0x50b7('0x30')]=_[_0x50b7('0x44')](_0x3c1345[_0x50b7('0x30')]);_0x44f9b0[_0x50b7('0x31')]=_[_0x50b7('0x32')](_0x44f9b0[_0x50b7('0x2f')],_0x44f9b0[_0x50b7('0x30')]);_0x1b6b93[_0x50b7('0x34')]=_[_0x50b7('0x32')](_0x44f9b0[_0x50b7('0x2f')],qs[_0x50b7('0x33')](_0x3c1345[_0x50b7('0x30')]['fields']));_0x1b6b93['attributes']=_0x1b6b93[_0x50b7('0x34')][_0x50b7('0x35')]?_0x1b6b93[_0x50b7('0x34')]:_0x44f9b0[_0x50b7('0x2f')];if(_0x3c1345[_0x50b7('0x30')][_0x50b7('0x3f')]){_0x1b6b93['include']=[{'all':!![]}];}_0x1b6b93=_[_0x50b7('0x3d')]({},_0x1b6b93,_0x3c1345[_0x50b7('0x3e')]);return db[_0x50b7('0x2a')][_0x50b7('0x45')](_0x1b6b93)[_0x50b7('0x23')](handleEntityNotFound(_0x433ff3,null))[_0x50b7('0x23')](respondWithResult(_0x433ff3,null))['catch'](handleError(_0x433ff3,null));};exports['create']=function(_0x389de1,_0x3f5403){return db['SugarcrmField'][_0x50b7('0x46')](_0x389de1['body'],{})[_0x50b7('0x23')](respondWithResult(_0x3f5403,0xc9))['catch'](handleError(_0x3f5403,null));};exports[_0x50b7('0x22')]=function(_0x4e1f38,_0x32b2ae){if(_0x4e1f38[_0x50b7('0x47')]['id']){delete _0x4e1f38['body']['id'];}return db[_0x50b7('0x2a')][_0x50b7('0x45')]({'where':{'id':_0x4e1f38[_0x50b7('0x43')]['id']}})[_0x50b7('0x23')](handleEntityNotFound(_0x32b2ae,null))[_0x50b7('0x23')](saveUpdates(_0x4e1f38[_0x50b7('0x47')],null))[_0x50b7('0x23')](respondWithResult(_0x32b2ae,null))[_0x50b7('0x42')](handleError(_0x32b2ae,null));};exports[_0x50b7('0x24')]=function(_0x79856f,_0x52c4b3){return db[_0x50b7('0x2a')]['find']({'where':{'id':_0x79856f['params']['id']}})[_0x50b7('0x23')](handleEntityNotFound(_0x52c4b3,null))[_0x50b7('0x23')](removeEntity(_0x52c4b3,null))[_0x50b7('0x42')](handleError(_0x52c4b3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8515dc8..dce1e21 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eab=['int_sugarcrm_fields','sugarcrm_unique_index','lodash','util','api','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0x18ec5b,_0x5e9a60){var _0x4f1c24=function(_0x5abcf4){while(--_0x5abcf4){_0x18ec5b['push'](_0x18ec5b['shift']());}};_0x4f1c24(++_0x5e9a60);}(_0x3eab,0xf2));var _0xb3ea=function(_0x57e568,_0x5c7fcd){_0x57e568=_0x57e568-0x0;var _0x295fb4=_0x3eab[_0x57e568];return _0x295fb4;};'use strict';var _=require(_0xb3ea('0x0'));var util=require(_0xb3ea('0x1'));var logger=require('../../config/logger')(_0xb3ea('0x2'));var moment=require('moment');var BPromise=require(_0xb3ea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3ea('0x4'));var rimraf=require(_0xb3ea('0x5'));var config=require(_0xb3ea('0x6'));var attributes=require(_0xb3ea('0x7'));module[_0xb3ea('0x8')]=function(_0x13e5ee,_0x1d3ceb){return _0x13e5ee['define'](_0xb3ea('0x9'),attributes,{'tableName':_0xb3ea('0xa'),'paranoid':![],'indexes':[{'name':_0xb3ea('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf055=['../../config/environment','./intSugarcrmField.attributes','define','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf055,0xd5));var _0x5f05=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0xf055[_0x30a956];return _0x2ac17d;};'use strict';var _=require(_0x5f05('0x0'));var util=require(_0x5f05('0x1'));var logger=require('../../config/logger')(_0x5f05('0x2'));var moment=require('moment');var BPromise=require(_0x5f05('0x3'));var rp=require(_0x5f05('0x4'));var fs=require('fs');var path=require(_0x5f05('0x5'));var rimraf=require(_0x5f05('0x6'));var config=require(_0x5f05('0x7'));var attributes=require(_0x5f05('0x8'));module['exports']=function(_0x4f66f4,_0x2d01d2){return _0x4f66f4[_0x5f05('0x9')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x5f05('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 7269321..1a3c826 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6e5=['../../config/environment','jayson/promise','client','http','request','then','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmField,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f5415,_0x232b3e){var _0x90471=function(_0x2fe7cb){while(--_0x2fe7cb){_0x5f5415['push'](_0x5f5415['shift']());}};_0x90471(++_0x232b3e);}(_0xc6e5,0xdd));var _0x5c6e=function(_0x5a0619,_0x7a883c){_0x5a0619=_0x5a0619-0x0;var _0x5175de=_0xc6e5[_0x5a0619];return _0x5175de;};'use strict';var _=require(_0x5c6e('0x0'));var util=require(_0x5c6e('0x1'));var moment=require(_0x5c6e('0x2'));var BPromise=require(_0x5c6e('0x3'));var rs=require(_0x5c6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c6e('0x5'))['db'];var utils=require(_0x5c6e('0x6'));var logger=require(_0x5c6e('0x7'))(_0x5c6e('0x8'));var config=require(_0x5c6e('0x9'));var jayson=require(_0x5c6e('0xa'));var client=jayson[_0x5c6e('0xb')][_0x5c6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27b675,_0x559ed5,_0x5038da){return new BPromise(function(_0x5d0c61,_0x537993){return client[_0x5c6e('0xd')](_0x27b675,_0x5038da)[_0x5c6e('0xe')](function(_0xe948f2){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x559ed5,'request\x20sent');logger[_0x5c6e('0xf')](_0x5c6e('0x10'),_0x559ed5,_0x5c6e('0x11'),JSON[_0x5c6e('0x12')](_0xe948f2));if(_0xe948f2['error']){if(_0xe948f2[_0x5c6e('0x13')]['code']===0x1f4){logger[_0x5c6e('0x13')](_0x5c6e('0x14'),_0x559ed5,_0xe948f2[_0x5c6e('0x13')]['message']);return _0x537993(_0xe948f2[_0x5c6e('0x13')][_0x5c6e('0x15')]);}logger[_0x5c6e('0x13')](_0x5c6e('0x14'),_0x559ed5,_0xe948f2[_0x5c6e('0x13')][_0x5c6e('0x15')]);return _0x5d0c61(_0xe948f2[_0x5c6e('0x13')][_0x5c6e('0x15')]);}else{logger[_0x5c6e('0x16')](_0x5c6e('0x14'),_0x559ed5,_0x5c6e('0x11'));_0x5d0c61(_0xe948f2['result'][_0x5c6e('0x15')]);}})['catch'](function(_0x1a0bd7){logger[_0x5c6e('0x13')](_0x5c6e('0x14'),_0x559ed5,_0x1a0bd7);_0x537993(_0x1a0bd7);});});} \ No newline at end of file +var _0xed50=['../../config/logger','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5ee9e7,_0x2156e7){var _0x3416c=function(_0x46dc0b){while(--_0x46dc0b){_0x5ee9e7['push'](_0x5ee9e7['shift']());}};_0x3416c(++_0x2156e7);}(_0xed50,0x15f));var _0x0ed5=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0xed50[_0x208505];return _0x1a985f;};'use strict';var _=require('lodash');var util=require(_0x0ed5('0x0'));var moment=require(_0x0ed5('0x1'));var BPromise=require(_0x0ed5('0x2'));var rs=require(_0x0ed5('0x3'));var fs=require('fs');var Redis=require(_0x0ed5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ed5('0x5'));var logger=require(_0x0ed5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0ed5('0x7'));var client=jayson['client'][_0x0ed5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24b5bd,_0x4784a3,_0x1acbbd){return new BPromise(function(_0x106732,_0x458ae8){return client[_0x0ed5('0x9')](_0x24b5bd,_0x1acbbd)[_0x0ed5('0xa')](function(_0xdb7a32){logger[_0x0ed5('0xb')](_0x0ed5('0xc'),_0x4784a3,_0x0ed5('0xd'));logger[_0x0ed5('0xe')](_0x0ed5('0xf'),_0x4784a3,_0x0ed5('0xd'),JSON[_0x0ed5('0x10')](_0xdb7a32));if(_0xdb7a32[_0x0ed5('0x11')]){if(_0xdb7a32[_0x0ed5('0x11')]['code']===0x1f4){logger[_0x0ed5('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4784a3,_0xdb7a32[_0x0ed5('0x11')][_0x0ed5('0x12')]);return _0x458ae8(_0xdb7a32['error'][_0x0ed5('0x12')]);}logger[_0x0ed5('0x11')](_0x0ed5('0xc'),_0x4784a3,_0xdb7a32['error']['message']);return _0x106732(_0xdb7a32[_0x0ed5('0x11')]['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x4784a3,'request\x20sent');_0x106732(_0xdb7a32[_0x0ed5('0x13')][_0x0ed5('0x12')]);}})[_0x0ed5('0x14')](function(_0x1acd74){logger[_0x0ed5('0x11')](_0x0ed5('0xc'),_0x4784a3,_0x1acd74);_0x458ae8(_0x1acd74);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 661af13..9ffcf56 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d3e=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intVtigerAccount.controller','index','get','/:id'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x3d3e,0x155));var _0xe3d3=function(_0x2e4312,_0xdf93fd){_0x2e4312=_0x2e4312-0x0;var _0x4cc870=_0x3d3e[_0x2e4312];return _0x4cc870;};'use strict';var multer=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var path=require(_0xe3d3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3d3('0x3'));var router=express[_0xe3d3('0x4')]();var fs_extra=require(_0xe3d3('0x5'));var auth=require(_0xe3d3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3d3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3d3('0x8')]);router[_0xe3d3('0x9')](_0xe3d3('0xa'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0xc')]);router[_0xe3d3('0x9')](_0xe3d3('0xd'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0xe')]);router[_0xe3d3('0x9')](_0xe3d3('0xf'),auth[_0xe3d3('0xb')](),controller['getFields']);router['post']('/',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x10')]);router[_0xe3d3('0x11')]('/:id/configurations',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x12')]);router['put']('/:id',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x13')]);router[_0xe3d3('0x14')](_0xe3d3('0xa'),auth[_0xe3d3('0xb')](),controller['destroy']);module[_0xe3d3('0x15')]=router; \ No newline at end of file +var _0x0a9a=['create','addConfiguration','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x594115,_0x90412f){var _0xefcb79=function(_0x1024c8){while(--_0x1024c8){_0x594115['push'](_0x594115['shift']());}};_0xefcb79(++_0x90412f);}(_0x0a9a,0x183));var _0xa0a9=function(_0x220bd1,_0x3dc2f7){_0x220bd1=_0x220bd1-0x0;var _0x2d7940=_0x0a9a[_0x220bd1];return _0x2d7940;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./intVtigerAccount.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/:id',auth[_0xa0a9('0x8')](),controller['show']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['get'](_0xa0a9('0xc'),auth[_0xa0a9('0x8')](),controller['getFields']);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['post'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);router['put'](_0xa0a9('0xf'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x10')]);router[_0xa0a9('0x11')](_0xa0a9('0xf'),auth['isAuthenticated'](),controller[_0xa0a9('0x12')]);module[_0xa0a9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 5815391..9f99d2c 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc091=['STRING','sequelize','exports'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xc091,0x9d));var _0x1c09=function(_0x14bd96,_0x2dbfd4){_0x14bd96=_0x14bd96-0x0;var _0x529d11=_0xc091[_0x14bd96];return _0x529d11;};'use strict';var Sequelize=require(_0x1c09('0x0'));module[_0x1c09('0x1')]={'name':{'type':Sequelize[_0x1c09('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1c09('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x1c09('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1c09('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfc49=['STRING','HelpDesk','sequelize','exports'];(function(_0x50561f,_0x315f00){var _0x44f5e4=function(_0x43a55c){while(--_0x43a55c){_0x50561f['push'](_0x50561f['shift']());}};_0x44f5e4(++_0x315f00);}(_0xfc49,0x10e));var _0x9fc4=function(_0x311c76,_0x3c0078){_0x311c76=_0x311c76-0x0;var _0x460284=_0xfc49[_0x311c76];return _0x460284;};'use strict';var Sequelize=require(_0x9fc4('0x0'));module[_0x9fc4('0x1')]={'name':{'type':Sequelize[_0x9fc4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9fc4('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9fc4('0x2')],'allowNull':![],'defaultValue':_0x9fc4('0x3')},'remoteUri':{'type':Sequelize[_0x9fc4('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9fc4('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9fc4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5390145..fba3bbc 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0372=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VtigerAccount','catch','show','rawAttributes','find','create','update','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','VtigerConfiguration','VtigerField','Descriptions','md5','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','token','GET','describe','result','sessionName','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x41e5c4,_0x345c57){var _0xe412f8=function(_0x329f9d){while(--_0x329f9d){_0x41e5c4['push'](_0x41e5c4['shift']());}};_0xe412f8(++_0x345c57);}(_0x0372,0xbb));var _0x2037=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x0372[_0x5550b3];return _0x4b8fc4;};'use strict';var emlformat=require(_0x2037('0x0'));var rimraf=require(_0x2037('0x1'));var zipdir=require(_0x2037('0x2'));var jsonpatch=require(_0x2037('0x3'));var rp=require(_0x2037('0x4'));var moment=require(_0x2037('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2037('0x6'));var util=require(_0x2037('0x7'));var path=require(_0x2037('0x8'));var sox=require(_0x2037('0x9'));var csv=require(_0x2037('0xa'));var ejs=require(_0x2037('0xb'));var fs=require('fs');var fs_extra=require(_0x2037('0xc'));var _=require(_0x2037('0xd'));var squel=require(_0x2037('0xe'));var crypto=require(_0x2037('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2037('0x10'));var toCsv=require(_0x2037('0xa'));var querystring=require(_0x2037('0x11'));var Papa=require(_0x2037('0x12'));var Redis=require(_0x2037('0x13'));var authService=require(_0x2037('0x14'));var qs=require(_0x2037('0x15'));var as=require(_0x2037('0x16'));var hardwareService=require(_0x2037('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2037('0x18'));var config=require(_0x2037('0x19'));var licenseUtil=require(_0x2037('0x1a'));var db=require(_0x2037('0x1b'))['db'];var integrations=require(_0x2037('0x1c'));function respondWithStatusCode(_0x5859d8,_0x5b9690){_0x5b9690=_0x5b9690||0xcc;return function(_0x4314c9){if(_0x4314c9){return _0x5859d8[_0x2037('0x1d')](_0x5b9690);}return _0x5859d8[_0x2037('0x1e')](_0x5b9690)[_0x2037('0x1f')]();};}function respondWithResult(_0x5a6a13,_0x16d14e){_0x16d14e=_0x16d14e||0xc8;return function(_0x1f1b4a){if(_0x1f1b4a){return _0x5a6a13[_0x2037('0x1e')](_0x16d14e)[_0x2037('0x20')](_0x1f1b4a);}};}function respondWithFilteredResult(_0x3080f6,_0x46e84a){return function(_0x5c4c80){if(_0x5c4c80){var _0x27538a=typeof _0x46e84a['offset']===_0x2037('0x21')&&typeof _0x46e84a['limit']==='undefined';var _0x3ecdfa=_0x5c4c80['count'];var _0xb097bd=_0x27538a?0x0:_0x46e84a[_0x2037('0x22')];var _0x53f19e=_0x27538a?_0x5c4c80[_0x2037('0x23')]:_0x46e84a[_0x2037('0x22')]+_0x46e84a[_0x2037('0x24')];var _0x360e66;if(_0x53f19e>=_0x3ecdfa){_0x53f19e=_0x3ecdfa;_0x360e66=0xc8;}else{_0x360e66=0xce;}_0x3080f6['status'](_0x360e66);return _0x3080f6[_0x2037('0x25')]('Content-Range',_0xb097bd+'-'+_0x53f19e+'/'+_0x3ecdfa)[_0x2037('0x20')](_0x5c4c80);}return null;};}function patchUpdates(_0x206328){return function(_0x11e68c){try{jsonpatch[_0x2037('0x26')](_0x11e68c,_0x206328,!![]);}catch(_0x129eff){return BPromise[_0x2037('0x27')](_0x129eff);}return _0x11e68c[_0x2037('0x28')]();};}function saveUpdates(_0x28fcfb,_0x474bcf){return function(_0x1a207e){if(_0x1a207e){return _0x1a207e['update'](_0x28fcfb)[_0x2037('0x29')](function(_0x4fbc16){return _0x4fbc16;});}return null;};}function removeEntity(_0xa4ba5d,_0x3cc965){return function(_0x165c5e){if(_0x165c5e){return _0x165c5e[_0x2037('0x2a')]()['then'](function(){_0xa4ba5d[_0x2037('0x1e')](0xcc)[_0x2037('0x1f')]();});}};}function handleEntityNotFound(_0x2b0345,_0xc8df63){return function(_0x4c81f8){if(!_0x4c81f8){_0x2b0345[_0x2037('0x1d')](0x194);}return _0x4c81f8;};}function handleError(_0x146186,_0x10a69b){_0x10a69b=_0x10a69b||0x1f4;return function(_0x3c4a8e){logger[_0x2037('0x2b')](_0x3c4a8e[_0x2037('0x2c')]);if(_0x3c4a8e[_0x2037('0x2d')]){delete _0x3c4a8e['name'];}_0x146186['status'](_0x10a69b)[_0x2037('0x2e')](_0x3c4a8e);};}exports[_0x2037('0x2f')]=function(_0x580d06,_0x4d83a9){var _0x45daeb={},_0x3a0ffa={},_0x480f03={'count':0x0,'rows':[]};var _0x9ae090=_[_0x2037('0x30')](db['VtigerAccount']['rawAttributes'],function(_0x35b5de){return{'name':_0x35b5de[_0x2037('0x31')],'type':_0x35b5de[_0x2037('0x32')][_0x2037('0x33')]};});_0x3a0ffa[_0x2037('0x34')]=_['map'](_0x9ae090,_0x2037('0x2d'));_0x3a0ffa[_0x2037('0x35')]=_[_0x2037('0x36')](_0x580d06['query']);_0x3a0ffa[_0x2037('0x37')]=_['intersection'](_0x3a0ffa[_0x2037('0x34')],_0x3a0ffa[_0x2037('0x35')]);_0x45daeb['attributes']=_[_0x2037('0x38')](_0x3a0ffa[_0x2037('0x34')],qs['fields'](_0x580d06['query'][_0x2037('0x39')]));_0x45daeb[_0x2037('0x3a')]=_0x45daeb[_0x2037('0x3a')][_0x2037('0x3b')]?_0x45daeb[_0x2037('0x3a')]:_0x3a0ffa[_0x2037('0x34')];if(!_0x580d06[_0x2037('0x35')][_0x2037('0x3c')](_0x2037('0x3d'))){_0x45daeb[_0x2037('0x24')]=qs[_0x2037('0x24')](_0x580d06[_0x2037('0x35')]['limit']);_0x45daeb[_0x2037('0x22')]=qs[_0x2037('0x22')](_0x580d06[_0x2037('0x35')]['offset']);}_0x45daeb[_0x2037('0x3e')]=qs['sort'](_0x580d06[_0x2037('0x35')][_0x2037('0x3f')]);_0x45daeb[_0x2037('0x40')]=qs[_0x2037('0x37')](_[_0x2037('0x41')](_0x580d06[_0x2037('0x35')],_0x3a0ffa[_0x2037('0x37')]),_0x9ae090);if(_0x580d06[_0x2037('0x35')][_0x2037('0x42')]){_0x45daeb[_0x2037('0x40')]=_[_0x2037('0x43')](_0x45daeb[_0x2037('0x40')],{'$or':_[_0x2037('0x30')](_0x9ae090,function(_0x9de06){if(_0x9de06[_0x2037('0x32')]!==_0x2037('0x44')){var _0xd99d83={};_0xd99d83[_0x9de06[_0x2037('0x2d')]]={'$like':'%'+_0x580d06[_0x2037('0x35')]['filter']+'%'};return _0xd99d83;}})});}_0x45daeb=_[_0x2037('0x43')]({},_0x45daeb,_0x580d06[_0x2037('0x45')]);var _0x2a1e08={'where':_0x45daeb['where']};return db['VtigerAccount'][_0x2037('0x23')](_0x2a1e08)[_0x2037('0x29')](function(_0x40e1d3){_0x480f03[_0x2037('0x23')]=_0x40e1d3;if(_0x580d06[_0x2037('0x35')][_0x2037('0x46')]){_0x45daeb[_0x2037('0x47')]=[{'all':!![]}];}return db[_0x2037('0x48')]['findAll'](_0x45daeb);})[_0x2037('0x29')](function(_0xc2bcc3){_0x480f03['rows']=_0xc2bcc3;return _0x480f03;})['then'](respondWithFilteredResult(_0x4d83a9,_0x45daeb))[_0x2037('0x49')](handleError(_0x4d83a9,null));};exports[_0x2037('0x4a')]=function(_0x10b7f0,_0x3da04c){var _0x18ae03={'raw':![],'where':{'id':_0x10b7f0['params']['id']}},_0x28e8ce={};_0x28e8ce[_0x2037('0x34')]=_['keys'](db[_0x2037('0x48')][_0x2037('0x4b')]);_0x28e8ce['query']=_['keys'](_0x10b7f0['query']);_0x28e8ce[_0x2037('0x37')]=_[_0x2037('0x38')](_0x28e8ce[_0x2037('0x34')],_0x28e8ce[_0x2037('0x35')]);_0x18ae03[_0x2037('0x3a')]=_[_0x2037('0x38')](_0x28e8ce[_0x2037('0x34')],qs[_0x2037('0x39')](_0x10b7f0[_0x2037('0x35')]['fields']));_0x18ae03['attributes']=_0x18ae03[_0x2037('0x3a')][_0x2037('0x3b')]?_0x18ae03['attributes']:_0x28e8ce['model'];if(_0x10b7f0[_0x2037('0x35')][_0x2037('0x46')]){_0x18ae03['include']=[{'all':!![]}];}_0x18ae03=_[_0x2037('0x43')]({},_0x18ae03,_0x10b7f0[_0x2037('0x45')]);return db[_0x2037('0x48')][_0x2037('0x4c')](_0x18ae03)[_0x2037('0x29')](handleEntityNotFound(_0x3da04c,null))[_0x2037('0x29')](respondWithResult(_0x3da04c,null))[_0x2037('0x49')](handleError(_0x3da04c,null));};exports['create']=function(_0x4843c6,_0x32a4b8){return db[_0x2037('0x48')][_0x2037('0x4d')](_0x4843c6['body'],{})[_0x2037('0x29')](respondWithResult(_0x32a4b8,0xc9))[_0x2037('0x49')](handleError(_0x32a4b8,null));};exports[_0x2037('0x4e')]=function(_0x3e7133,_0x4719f2){if(_0x3e7133[_0x2037('0x4f')]['id']){delete _0x3e7133[_0x2037('0x4f')]['id'];}return db[_0x2037('0x48')][_0x2037('0x4c')]({'where':{'id':_0x3e7133[_0x2037('0x50')]['id']}})[_0x2037('0x29')](handleEntityNotFound(_0x4719f2,null))[_0x2037('0x29')](saveUpdates(_0x3e7133[_0x2037('0x4f')],null))['then'](respondWithResult(_0x4719f2,null))[_0x2037('0x49')](handleError(_0x4719f2,null));};exports[_0x2037('0x2a')]=function(_0x48ece8,_0x2642c3){return db[_0x2037('0x48')][_0x2037('0x4c')]({'where':{'id':_0x48ece8[_0x2037('0x50')]['id']}})[_0x2037('0x29')](handleEntityNotFound(_0x2642c3,null))[_0x2037('0x29')](removeEntity(_0x2642c3,null))[_0x2037('0x49')](handleError(_0x2642c3,null));};exports[_0x2037('0x51')]=function(_0xa4e4e4,_0xaab6d2,_0x34a074){var _0x29d571={};var _0x5f4b87={};var _0x3810c0;var _0x1db20a;return db[_0x2037('0x48')][_0x2037('0x52')]({'where':{'id':_0xa4e4e4[_0x2037('0x50')]['id']}})[_0x2037('0x29')](handleEntityNotFound(_0xaab6d2,null))[_0x2037('0x29')](function(_0x2a94cb){if(_0x2a94cb){_0x3810c0=_0x2a94cb;_0x5f4b87[_0x2037('0x34')]=_[_0x2037('0x36')](db['VtigerConfiguration'][_0x2037('0x4b')]);_0x5f4b87[_0x2037('0x35')]=_[_0x2037('0x36')](_0xa4e4e4[_0x2037('0x35')]);_0x5f4b87['filters']=_['intersection'](_0x5f4b87[_0x2037('0x34')],_0x5f4b87[_0x2037('0x35')]);_0x29d571['attributes']=_[_0x2037('0x38')](_0x5f4b87[_0x2037('0x34')],qs[_0x2037('0x39')](_0xa4e4e4[_0x2037('0x35')]['fields']));_0x29d571[_0x2037('0x3a')]=_0x29d571[_0x2037('0x3a')][_0x2037('0x3b')]?_0x29d571[_0x2037('0x3a')]:_0x5f4b87[_0x2037('0x34')];_0x29d571['order']=qs['sort'](_0xa4e4e4[_0x2037('0x35')][_0x2037('0x3f')]);_0x29d571['where']=qs[_0x2037('0x37')](_[_0x2037('0x41')](_0xa4e4e4[_0x2037('0x35')],_0x5f4b87[_0x2037('0x37')]));if(_0xa4e4e4[_0x2037('0x35')][_0x2037('0x42')]){_0x29d571[_0x2037('0x40')]=_[_0x2037('0x43')](_0x29d571[_0x2037('0x40')],{'$or':_['map'](_0x29d571[_0x2037('0x3a')],function(_0x523f51){var _0x552579={};_0x552579[_0x523f51]={'$like':'%'+_0xa4e4e4['query'][_0x2037('0x42')]+'%'};return _0x552579;})});}_0x29d571=_['merge']({},_0x29d571,_0xa4e4e4[_0x2037('0x45')]);return _0x3810c0['getConfigurations'](_0x29d571);}})[_0x2037('0x29')](function(_0x5ec0bb){if(_0x5ec0bb){_0x1db20a=_0x5ec0bb[_0x2037('0x3b')];if(!_0xa4e4e4[_0x2037('0x35')][_0x2037('0x3c')](_0x2037('0x3d'))){_0x29d571['limit']=qs[_0x2037('0x24')](_0xa4e4e4[_0x2037('0x35')][_0x2037('0x24')]);_0x29d571['offset']=qs['offset'](_0xa4e4e4[_0x2037('0x35')][_0x2037('0x22')]);}return _0x3810c0[_0x2037('0x51')](_0x29d571);}})['then'](function(_0x2b6233){if(_0x2b6233){return _0x2b6233?{'count':_0x1db20a,'rows':_0x2b6233}:null;}})[_0x2037('0x29')](respondWithResult(_0xaab6d2,null))[_0x2037('0x49')](handleError(_0xaab6d2,null));};exports[_0x2037('0x53')]=function(_0x17ed08,_0x14f927,_0x68dd8f){if(_0x17ed08[_0x2037('0x4f')]['id']){delete _0x17ed08[_0x2037('0x4f')]['id'];}return db[_0x2037('0x48')][_0x2037('0x52')]({'where':{'id':_0x17ed08[_0x2037('0x50')]['id']}})[_0x2037('0x29')](handleEntityNotFound(_0x14f927,null))['then'](function(_0x3ec56b){if(_0x3ec56b){_0x17ed08[_0x2037('0x4f')][_0x2037('0x54')]=_0x3ec56b['id'];_0x17ed08[_0x2037('0x4f')][_0x2037('0x55')]=integrations['getSubjects'](_0x17ed08[_0x2037('0x4f')][_0x2037('0x56')],_0x17ed08[_0x2037('0x4f')][_0x2037('0x32')]);_0x17ed08[_0x2037('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x17ed08[_0x2037('0x4f')][_0x2037('0x56')],_0x17ed08[_0x2037('0x4f')][_0x2037('0x32')]);return db[_0x2037('0x57')][_0x2037('0x4d')](_0x17ed08[_0x2037('0x4f')],{'include':[{'model':db[_0x2037('0x58')],'as':'Subjects'},{'model':db[_0x2037('0x58')],'as':_0x2037('0x59')}]});}return null;})[_0x2037('0x29')](respondWithResult(_0x14f927,null))[_0x2037('0x49')](handleError(_0x14f927,null));};var md5=require(_0x2037('0x5a'));exports['getFields']=function(_0x42839d,_0xc664f3,_0x492d99){var _0x228b13=null;var _0x409cd7=null;var _0x3022e9=null;var _0x4f51c9=null;var _0xbd1cc7='';return db[_0x2037('0x48')][_0x2037('0x52')]({'where':{'id':_0x42839d['params']['id']},'attributes':['id',_0x2037('0x2d'),'username',_0x2037('0x5b'),_0x2037('0x5c'),_0x2037('0x5d'),_0x2037('0x5e'),_0x2037('0x5f')]})[_0x2037('0x29')](handleEntityNotFound(_0xc664f3,null))[_0x2037('0x29')](function(_0x2f1eae){if(_0x2f1eae){_0x228b13=_0x2f1eae[_0x2037('0x60')];_0x409cd7=_0x2f1eae[_0x2037('0x5f')];_0x3022e9=_0x2f1eae['moduleName'];_0xbd1cc7=_0x2f1eae[_0x2037('0x5d')];var _0x394a8f=_0xbd1cc7[_0x2037('0x61')](-0x1);if(_0x394a8f==='/'){_0xbd1cc7=_0xbd1cc7[_0x2037('0x62')](0x0,_0xbd1cc7[_0x2037('0x63')](_0x394a8f));}_0x4f51c9=util['format'](_0x2037('0x64'),_0xbd1cc7);var _0x2d7ebd={'method':'GET','uri':_0x4f51c9,'qs':{'operation':_0x2037('0x65'),'username':_0x2f1eae[_0x2037('0x60')]},'json':!![]};return rp(_0x2d7ebd);}})[_0x2037('0x29')](function(_0x458877){if(_0x458877[_0x2037('0x66')]){var _0x2a884c={'method':_0x2037('0x67'),'uri':_0x4f51c9,'form':{'operation':_0x2037('0x68'),'username':_0x228b13,'accessKey':md5(_0x458877['result'][_0x2037('0x69')]+_0x409cd7)},'json':!![]};return rp(_0x2a884c);}})['then'](function(_0x20976e){if(_0x20976e[_0x2037('0x66')]){var _0x21dfbc={'method':_0x2037('0x6a'),'uri':_0x4f51c9,'qs':{'operation':_0x2037('0x6b'),'username':_0x228b13,'sessionName':_0x20976e[_0x2037('0x6c')][_0x2037('0x6d')],'elementType':_0x3022e9},'json':!![]};return rp(_0x21dfbc);}})[_0x2037('0x29')](function(_0x452f4e){if(_0x452f4e[_0x2037('0x66')]){var _0x152cff=['autogenerated','reference',_0x2037('0x6e')];_[_0x2037('0x6f')](_0x452f4e[_0x2037('0x6c')][_0x2037('0x39')],function(_0x26c33d){return _0x152cff[_0x2037('0x70')](_0x26c33d[_0x2037('0x32')][_0x2037('0x2d')]);});_[_0x2037('0x6f')](_0x452f4e[_0x2037('0x6c')][_0x2037('0x39')],function(_0x33f638){return _0x33f638[_0x2037('0x71')]==='false';});return{'count':_0x452f4e[_0x2037('0x6c')][_0x2037('0x39')]['length'],'rows':_[_0x2037('0x30')](_0x452f4e[_0x2037('0x6c')]['fields'],function(_0x729982){return{'id':_0x729982[_0x2037('0x2d')],'name':_0x729982[_0x2037('0x72')],'custom':_[_0x2037('0x73')](_0x729982[_0x2037('0x2d')],'cf_')?!![]:![],'options':_0x729982['type'][_0x2037('0x2d')]===_0x2037('0x74')&&_0x729982[_0x2037('0x32')][_0x2037('0x75')][_0x2037('0x3b')]>0x0?_[_0x2037('0x30')](_0x729982[_0x2037('0x32')]['picklistValues'],function(_0x3b29d6){return{'name':_0x3b29d6[_0x2037('0x72')],'value':_0x3b29d6[_0x2037('0x76')]};}):[]};})};}})[_0x2037('0x29')](respondWithResult(_0xc664f3,null))[_0x2037('0x49')](function(_0x4e30a6){console['log'](_0x2037('0x77')+_0x4e30a6);var _0x15d679=_0x42839d[_0x2037('0x35')][_0x2037('0x78')]?0x1f4:_0x4e30a6['statusCode']||0x1f4;logger[_0x2037('0x2b')](_0x2037('0x79'),_0x2037('0x7a'),_0x15d679,JSON[_0x2037('0x7b')](_0x4e30a6));delete _0x4e30a6[_0x2037('0x2d')];if(_0x15d679===0x191){_0x15d679=0x190;}_0xc664f3[_0x2037('0x1e')](_0x15d679)[_0x2037('0x2e')](_0x42839d['query'][_0x2037('0x78')]?{'message':_0x2037('0x7c'),'statusCode':_0x4e30a6['statusCode']}:_0x4e30a6);});}; \ No newline at end of file +var _0xe6a7=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','findOne','VtigerConfiguration','sort','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','description','serverUrl','accessKey','username','moduleName','remoteUri','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model'];(function(_0x5efce3,_0x17e8e4){var _0x15a967=function(_0x4ad151){while(--_0x4ad151){_0x5efce3['push'](_0x5efce3['shift']());}};_0x15a967(++_0x17e8e4);}(_0xe6a7,0x13b));var _0x7e6a=function(_0x5b1f2f,_0x4570de){_0x5b1f2f=_0x5b1f2f-0x0;var _0x57e945=_0xe6a7[_0x5b1f2f];return _0x57e945;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e6a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e6a('0x1'));var rp=require(_0x7e6a('0x2'));var moment=require(_0x7e6a('0x3'));var BPromise=require(_0x7e6a('0x4'));var Mustache=require(_0x7e6a('0x5'));var util=require(_0x7e6a('0x6'));var path=require(_0x7e6a('0x7'));var sox=require('sox');var csv=require(_0x7e6a('0x8'));var ejs=require(_0x7e6a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e6a('0xa'));var squel=require(_0x7e6a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e6a('0x8'));var querystring=require(_0x7e6a('0xc'));var Papa=require(_0x7e6a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e6a('0xe'));var as=require(_0x7e6a('0xf'));var hardwareService=require(_0x7e6a('0x10'));var logger=require('../../config/logger')(_0x7e6a('0x11'));var utils=require(_0x7e6a('0x12'));var config=require(_0x7e6a('0x13'));var licenseUtil=require(_0x7e6a('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7e6a('0x15'));function respondWithStatusCode(_0x48bf54,_0x3c0a8d){_0x3c0a8d=_0x3c0a8d||0xcc;return function(_0x21c3db){if(_0x21c3db){return _0x48bf54[_0x7e6a('0x16')](_0x3c0a8d);}return _0x48bf54['status'](_0x3c0a8d)[_0x7e6a('0x17')]();};}function respondWithResult(_0x9f0e71,_0x19e8e7){_0x19e8e7=_0x19e8e7||0xc8;return function(_0x398e21){if(_0x398e21){return _0x9f0e71[_0x7e6a('0x18')](_0x19e8e7)[_0x7e6a('0x19')](_0x398e21);}};}function respondWithFilteredResult(_0x52ce79,_0xd620){return function(_0x25b8d2){if(_0x25b8d2){var _0xd43263=typeof _0xd620[_0x7e6a('0x1a')]===_0x7e6a('0x1b')&&typeof _0xd620[_0x7e6a('0x1c')]===_0x7e6a('0x1b');var _0x47c3b8=_0x25b8d2['count'];var _0x579f74=_0xd43263?0x0:_0xd620[_0x7e6a('0x1a')];var _0x5701c2=_0xd43263?_0x25b8d2[_0x7e6a('0x1d')]:_0xd620[_0x7e6a('0x1a')]+_0xd620['limit'];var _0x391733;if(_0x5701c2>=_0x47c3b8){_0x5701c2=_0x47c3b8;_0x391733=0xc8;}else{_0x391733=0xce;}_0x52ce79[_0x7e6a('0x18')](_0x391733);return _0x52ce79[_0x7e6a('0x1e')](_0x7e6a('0x1f'),_0x579f74+'-'+_0x5701c2+'/'+_0x47c3b8)[_0x7e6a('0x19')](_0x25b8d2);}return null;};}function patchUpdates(_0x308a88){return function(_0x293a68){try{jsonpatch['apply'](_0x293a68,_0x308a88,!![]);}catch(_0xcf052b){return BPromise[_0x7e6a('0x20')](_0xcf052b);}return _0x293a68[_0x7e6a('0x21')]();};}function saveUpdates(_0x157e0a,_0x527ddd){return function(_0x6e52d3){if(_0x6e52d3){return _0x6e52d3[_0x7e6a('0x22')](_0x157e0a)[_0x7e6a('0x23')](function(_0x3b9ad6){return _0x3b9ad6;});}return null;};}function removeEntity(_0x4f20ed,_0x209962){return function(_0x17753f){if(_0x17753f){return _0x17753f[_0x7e6a('0x24')]()['then'](function(){_0x4f20ed[_0x7e6a('0x18')](0xcc)[_0x7e6a('0x17')]();});}};}function handleEntityNotFound(_0xc428a,_0x3e6c33){return function(_0x33e22a){if(!_0x33e22a){_0xc428a[_0x7e6a('0x16')](0x194);}return _0x33e22a;};}function handleError(_0x4d92e4,_0x293e2a){_0x293e2a=_0x293e2a||0x1f4;return function(_0x1a063b){logger[_0x7e6a('0x25')](_0x1a063b[_0x7e6a('0x26')]);if(_0x1a063b[_0x7e6a('0x27')]){delete _0x1a063b[_0x7e6a('0x27')];}_0x4d92e4['status'](_0x293e2a)[_0x7e6a('0x28')](_0x1a063b);};}exports[_0x7e6a('0x29')]=function(_0x44d286,_0x503977){var _0x169597={},_0x31bcfc={},_0x13d51a={'count':0x0,'rows':[]};var _0x5a907a=_[_0x7e6a('0x2a')](db[_0x7e6a('0x2b')][_0x7e6a('0x2c')],function(_0x4d4ace){return{'name':_0x4d4ace[_0x7e6a('0x2d')],'type':_0x4d4ace[_0x7e6a('0x2e')]['key']};});_0x31bcfc[_0x7e6a('0x2f')]=_[_0x7e6a('0x2a')](_0x5a907a,_0x7e6a('0x27'));_0x31bcfc[_0x7e6a('0x30')]=_[_0x7e6a('0x31')](_0x44d286[_0x7e6a('0x30')]);_0x31bcfc[_0x7e6a('0x32')]=_[_0x7e6a('0x33')](_0x31bcfc['model'],_0x31bcfc[_0x7e6a('0x30')]);_0x169597[_0x7e6a('0x34')]=_[_0x7e6a('0x33')](_0x31bcfc[_0x7e6a('0x2f')],qs[_0x7e6a('0x35')](_0x44d286[_0x7e6a('0x30')][_0x7e6a('0x35')]));_0x169597[_0x7e6a('0x34')]=_0x169597[_0x7e6a('0x34')]['length']?_0x169597[_0x7e6a('0x34')]:_0x31bcfc[_0x7e6a('0x2f')];if(!_0x44d286[_0x7e6a('0x30')][_0x7e6a('0x36')](_0x7e6a('0x37'))){_0x169597[_0x7e6a('0x1c')]=qs['limit'](_0x44d286['query'][_0x7e6a('0x1c')]);_0x169597[_0x7e6a('0x1a')]=qs[_0x7e6a('0x1a')](_0x44d286[_0x7e6a('0x30')]['offset']);}_0x169597[_0x7e6a('0x38')]=qs['sort'](_0x44d286[_0x7e6a('0x30')]['sort']);_0x169597[_0x7e6a('0x39')]=qs[_0x7e6a('0x32')](_[_0x7e6a('0x3a')](_0x44d286['query'],_0x31bcfc[_0x7e6a('0x32')]),_0x5a907a);if(_0x44d286[_0x7e6a('0x30')]['filter']){_0x169597[_0x7e6a('0x39')]=_[_0x7e6a('0x3b')](_0x169597['where'],{'$or':_[_0x7e6a('0x2a')](_0x5a907a,function(_0x352562){if(_0x352562[_0x7e6a('0x2e')]!=='VIRTUAL'){var _0x432f21={};_0x432f21[_0x352562[_0x7e6a('0x27')]]={'$like':'%'+_0x44d286[_0x7e6a('0x30')][_0x7e6a('0x3c')]+'%'};return _0x432f21;}})});}_0x169597=_[_0x7e6a('0x3b')]({},_0x169597,_0x44d286[_0x7e6a('0x3d')]);var _0x389eb3={'where':_0x169597[_0x7e6a('0x39')]};return db[_0x7e6a('0x2b')][_0x7e6a('0x1d')](_0x389eb3)[_0x7e6a('0x23')](function(_0x310120){_0x13d51a[_0x7e6a('0x1d')]=_0x310120;if(_0x44d286[_0x7e6a('0x30')][_0x7e6a('0x3e')]){_0x169597[_0x7e6a('0x3f')]=[{'all':!![]}];}return db['VtigerAccount'][_0x7e6a('0x40')](_0x169597);})[_0x7e6a('0x23')](function(_0x33e406){_0x13d51a[_0x7e6a('0x41')]=_0x33e406;return _0x13d51a;})[_0x7e6a('0x23')](respondWithFilteredResult(_0x503977,_0x169597))['catch'](handleError(_0x503977,null));};exports[_0x7e6a('0x42')]=function(_0x29de3f,_0x2bfe0c){var _0x22046e={'raw':![],'where':{'id':_0x29de3f[_0x7e6a('0x43')]['id']}},_0x591e35={};_0x591e35[_0x7e6a('0x2f')]=_[_0x7e6a('0x31')](db['VtigerAccount'][_0x7e6a('0x2c')]);_0x591e35[_0x7e6a('0x30')]=_[_0x7e6a('0x31')](_0x29de3f[_0x7e6a('0x30')]);_0x591e35[_0x7e6a('0x32')]=_[_0x7e6a('0x33')](_0x591e35[_0x7e6a('0x2f')],_0x591e35['query']);_0x22046e[_0x7e6a('0x34')]=_[_0x7e6a('0x33')](_0x591e35[_0x7e6a('0x2f')],qs[_0x7e6a('0x35')](_0x29de3f[_0x7e6a('0x30')]['fields']));_0x22046e[_0x7e6a('0x34')]=_0x22046e[_0x7e6a('0x34')][_0x7e6a('0x44')]?_0x22046e[_0x7e6a('0x34')]:_0x591e35[_0x7e6a('0x2f')];if(_0x29de3f[_0x7e6a('0x30')][_0x7e6a('0x3e')]){_0x22046e['include']=[{'all':!![]}];}_0x22046e=_[_0x7e6a('0x3b')]({},_0x22046e,_0x29de3f[_0x7e6a('0x3d')]);return db[_0x7e6a('0x2b')][_0x7e6a('0x45')](_0x22046e)[_0x7e6a('0x23')](handleEntityNotFound(_0x2bfe0c,null))['then'](respondWithResult(_0x2bfe0c,null))['catch'](handleError(_0x2bfe0c,null));};exports['create']=function(_0x17894b,_0x2e98a9){return db[_0x7e6a('0x2b')][_0x7e6a('0x46')](_0x17894b[_0x7e6a('0x47')],{})[_0x7e6a('0x23')](respondWithResult(_0x2e98a9,0xc9))[_0x7e6a('0x48')](handleError(_0x2e98a9,null));};exports['update']=function(_0x1b60cc,_0x3561fa){if(_0x1b60cc[_0x7e6a('0x47')]['id']){delete _0x1b60cc[_0x7e6a('0x47')]['id'];}return db[_0x7e6a('0x2b')][_0x7e6a('0x45')]({'where':{'id':_0x1b60cc[_0x7e6a('0x43')]['id']}})[_0x7e6a('0x23')](handleEntityNotFound(_0x3561fa,null))[_0x7e6a('0x23')](saveUpdates(_0x1b60cc[_0x7e6a('0x47')],null))['then'](respondWithResult(_0x3561fa,null))[_0x7e6a('0x48')](handleError(_0x3561fa,null));};exports[_0x7e6a('0x24')]=function(_0xb81c17,_0x2965a5){return db[_0x7e6a('0x2b')][_0x7e6a('0x45')]({'where':{'id':_0xb81c17['params']['id']}})[_0x7e6a('0x23')](handleEntityNotFound(_0x2965a5,null))[_0x7e6a('0x23')](removeEntity(_0x2965a5,null))[_0x7e6a('0x48')](handleError(_0x2965a5,null));};exports['getConfigurations']=function(_0x497974,_0x546b84,_0x2e9c7c){var _0x5c713d={};var _0x495a4e={};var _0x597d8e;var _0x393e81;return db['VtigerAccount'][_0x7e6a('0x49')]({'where':{'id':_0x497974[_0x7e6a('0x43')]['id']}})[_0x7e6a('0x23')](handleEntityNotFound(_0x546b84,null))[_0x7e6a('0x23')](function(_0x1e9e21){if(_0x1e9e21){_0x597d8e=_0x1e9e21;_0x495a4e['model']=_[_0x7e6a('0x31')](db[_0x7e6a('0x4a')][_0x7e6a('0x2c')]);_0x495a4e['query']=_['keys'](_0x497974[_0x7e6a('0x30')]);_0x495a4e['filters']=_[_0x7e6a('0x33')](_0x495a4e[_0x7e6a('0x2f')],_0x495a4e['query']);_0x5c713d[_0x7e6a('0x34')]=_['intersection'](_0x495a4e['model'],qs[_0x7e6a('0x35')](_0x497974[_0x7e6a('0x30')][_0x7e6a('0x35')]));_0x5c713d[_0x7e6a('0x34')]=_0x5c713d['attributes'][_0x7e6a('0x44')]?_0x5c713d[_0x7e6a('0x34')]:_0x495a4e[_0x7e6a('0x2f')];_0x5c713d[_0x7e6a('0x38')]=qs[_0x7e6a('0x4b')](_0x497974[_0x7e6a('0x30')]['sort']);_0x5c713d[_0x7e6a('0x39')]=qs[_0x7e6a('0x32')](_[_0x7e6a('0x3a')](_0x497974[_0x7e6a('0x30')],_0x495a4e[_0x7e6a('0x32')]));if(_0x497974[_0x7e6a('0x30')][_0x7e6a('0x3c')]){_0x5c713d[_0x7e6a('0x39')]=_[_0x7e6a('0x3b')](_0x5c713d[_0x7e6a('0x39')],{'$or':_[_0x7e6a('0x2a')](_0x5c713d[_0x7e6a('0x34')],function(_0x24f4ac){var _0x29f704={};_0x29f704[_0x24f4ac]={'$like':'%'+_0x497974[_0x7e6a('0x30')][_0x7e6a('0x3c')]+'%'};return _0x29f704;})});}_0x5c713d=_[_0x7e6a('0x3b')]({},_0x5c713d,_0x497974[_0x7e6a('0x3d')]);return _0x597d8e['getConfigurations'](_0x5c713d);}})[_0x7e6a('0x23')](function(_0x125184){if(_0x125184){_0x393e81=_0x125184[_0x7e6a('0x44')];if(!_0x497974['query'][_0x7e6a('0x36')](_0x7e6a('0x37'))){_0x5c713d[_0x7e6a('0x1c')]=qs['limit'](_0x497974['query'][_0x7e6a('0x1c')]);_0x5c713d[_0x7e6a('0x1a')]=qs[_0x7e6a('0x1a')](_0x497974[_0x7e6a('0x30')][_0x7e6a('0x1a')]);}return _0x597d8e[_0x7e6a('0x4c')](_0x5c713d);}})[_0x7e6a('0x23')](function(_0x796c6b){if(_0x796c6b){return _0x796c6b?{'count':_0x393e81,'rows':_0x796c6b}:null;}})[_0x7e6a('0x23')](respondWithResult(_0x546b84,null))[_0x7e6a('0x48')](handleError(_0x546b84,null));};exports['addConfiguration']=function(_0x5c6d1f,_0x41d653,_0x1a49dc){if(_0x5c6d1f[_0x7e6a('0x47')]['id']){delete _0x5c6d1f[_0x7e6a('0x47')]['id'];}return db[_0x7e6a('0x2b')][_0x7e6a('0x49')]({'where':{'id':_0x5c6d1f['params']['id']}})[_0x7e6a('0x23')](handleEntityNotFound(_0x41d653,null))['then'](function(_0x32ab66){if(_0x32ab66){_0x5c6d1f[_0x7e6a('0x47')][_0x7e6a('0x4d')]=_0x32ab66['id'];_0x5c6d1f[_0x7e6a('0x47')][_0x7e6a('0x4e')]=integrations[_0x7e6a('0x4f')](_0x5c6d1f[_0x7e6a('0x47')][_0x7e6a('0x50')],_0x5c6d1f['body']['type']);_0x5c6d1f[_0x7e6a('0x47')]['Descriptions']=integrations[_0x7e6a('0x51')](_0x5c6d1f[_0x7e6a('0x47')][_0x7e6a('0x50')],_0x5c6d1f[_0x7e6a('0x47')]['type']);return db[_0x7e6a('0x4a')][_0x7e6a('0x46')](_0x5c6d1f['body'],{'include':[{'model':db[_0x7e6a('0x52')],'as':'Subjects'},{'model':db[_0x7e6a('0x52')],'as':_0x7e6a('0x53')}]});}return null;})[_0x7e6a('0x23')](respondWithResult(_0x41d653,null))[_0x7e6a('0x48')](handleError(_0x41d653,null));};var md5=require(_0x7e6a('0x54'));exports[_0x7e6a('0x55')]=function(_0x2b8b0a,_0x1f3a3d,_0x44029a){var _0xe889ff=null;var _0x3a7260=null;var _0x367339=null;var _0x41b343=null;var _0x579941='';return db[_0x7e6a('0x2b')][_0x7e6a('0x49')]({'where':{'id':_0x2b8b0a[_0x7e6a('0x43')]['id']},'attributes':['id','name','username',_0x7e6a('0x56'),'moduleName','remoteUri',_0x7e6a('0x57'),_0x7e6a('0x58')]})[_0x7e6a('0x23')](handleEntityNotFound(_0x1f3a3d,null))[_0x7e6a('0x23')](function(_0xd79fbd){if(_0xd79fbd){_0xe889ff=_0xd79fbd[_0x7e6a('0x59')];_0x3a7260=_0xd79fbd['accessKey'];_0x367339=_0xd79fbd[_0x7e6a('0x5a')];_0x579941=_0xd79fbd[_0x7e6a('0x5b')];var _0x48d27f=_0x579941[_0x7e6a('0x5c')](-0x1);if(_0x48d27f==='/'){_0x579941=_0x579941['substring'](0x0,_0x579941[_0x7e6a('0x5d')](_0x48d27f));}_0x41b343=util['format'](_0x7e6a('0x5e'),_0x579941);var _0x501293={'method':_0x7e6a('0x5f'),'uri':_0x41b343,'qs':{'operation':_0x7e6a('0x60'),'username':_0xd79fbd['username']},'json':!![]};return rp(_0x501293);}})[_0x7e6a('0x23')](function(_0x5be995){if(_0x5be995[_0x7e6a('0x61')]){var _0x373f9a={'method':_0x7e6a('0x62'),'uri':_0x41b343,'form':{'operation':_0x7e6a('0x63'),'username':_0xe889ff,'accessKey':md5(_0x5be995[_0x7e6a('0x64')][_0x7e6a('0x65')]+_0x3a7260)},'json':!![]};return rp(_0x373f9a);}})['then'](function(_0x3d41c7){if(_0x3d41c7[_0x7e6a('0x61')]){var _0x16f4d1={'method':_0x7e6a('0x5f'),'uri':_0x41b343,'qs':{'operation':_0x7e6a('0x66'),'username':_0xe889ff,'sessionName':_0x3d41c7['result']['sessionName'],'elementType':_0x367339},'json':!![]};return rp(_0x16f4d1);}})[_0x7e6a('0x23')](function(_0x46f5f2){if(_0x46f5f2[_0x7e6a('0x61')]){var _0x143021=[_0x7e6a('0x67'),'reference',_0x7e6a('0x68')];_[_0x7e6a('0x69')](_0x46f5f2[_0x7e6a('0x64')][_0x7e6a('0x35')],function(_0x5dd7b5){return _0x143021[_0x7e6a('0x6a')](_0x5dd7b5[_0x7e6a('0x2e')]['name']);});_[_0x7e6a('0x69')](_0x46f5f2['result']['fields'],function(_0x1f3df5){return _0x1f3df5[_0x7e6a('0x6b')]===_0x7e6a('0x6c');});return{'count':_0x46f5f2[_0x7e6a('0x64')]['fields']['length'],'rows':_['map'](_0x46f5f2['result'][_0x7e6a('0x35')],function(_0x4c4d48){return{'id':_0x4c4d48[_0x7e6a('0x27')],'name':_0x4c4d48[_0x7e6a('0x6d')],'custom':_[_0x7e6a('0x6e')](_0x4c4d48[_0x7e6a('0x27')],_0x7e6a('0x6f'))?!![]:![],'options':_0x4c4d48['type']['name']===_0x7e6a('0x70')&&_0x4c4d48[_0x7e6a('0x2e')][_0x7e6a('0x71')][_0x7e6a('0x44')]>0x0?_[_0x7e6a('0x2a')](_0x4c4d48[_0x7e6a('0x2e')][_0x7e6a('0x71')],function(_0x41134a){return{'name':_0x41134a[_0x7e6a('0x6d')],'value':_0x41134a[_0x7e6a('0x72')]};}):[]};})};}})[_0x7e6a('0x23')](respondWithResult(_0x1f3a3d,null))[_0x7e6a('0x48')](function(_0x27437d){console[_0x7e6a('0x73')](_0x7e6a('0x74')+_0x27437d);var _0x1895d1=_0x2b8b0a['query']['test']?0x1f4:_0x27437d[_0x7e6a('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x7e6a('0x55'),_0x1895d1,JSON[_0x7e6a('0x76')](_0x27437d));delete _0x27437d['name'];if(_0x1895d1===0x191){_0x1895d1=0x190;}_0x1f3a3d['status'](_0x1895d1)['send'](_0x2b8b0a[_0x7e6a('0x30')][_0x7e6a('0x77')]?{'message':_0x7e6a('0x78'),'statusCode':_0x27437d[_0x7e6a('0x75')]}:_0x27437d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e7519dc..14911cb 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6aa=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','api','bluebird','request-promise','rimraf'];(function(_0x1ba8a4,_0xd0539d){var _0x27d429=function(_0x46095a){while(--_0x46095a){_0x1ba8a4['push'](_0x1ba8a4['shift']());}};_0x27d429(++_0xd0539d);}(_0xc6aa,0x127));var _0xac6a=function(_0x54aa9a,_0x2fcc67){_0x54aa9a=_0x54aa9a-0x0;var _0x11b900=_0xc6aa[_0x54aa9a];return _0x11b900;};'use strict';var _=require(_0xac6a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac6a('0x1'));var moment=require('moment');var BPromise=require(_0xac6a('0x2'));var rp=require(_0xac6a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac6a('0x4'));var config=require(_0xac6a('0x5'));var attributes=require(_0xac6a('0x6'));var integrations=require(_0xac6a('0x7'));module[_0xac6a('0x8')]=function(_0x4d60e9,_0x344e32){return _0x4d60e9[_0xac6a('0x9')](_0xac6a('0xa'),attributes,{'tableName':_0xac6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x179b=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','moment','bluebird','request-promise'];(function(_0x5a3a73,_0xd947ae){var _0x1a3119=function(_0x12da09){while(--_0x12da09){_0x5a3a73['push'](_0x5a3a73['shift']());}};_0x1a3119(++_0xd947ae);}(_0x179b,0xcc));var _0xb179=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x179b[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0xb179('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb179('0x1'));var BPromise=require(_0xb179('0x2'));var rp=require(_0xb179('0x3'));var fs=require('fs');var path=require(_0xb179('0x4'));var rimraf=require(_0xb179('0x5'));var config=require(_0xb179('0x6'));var attributes=require(_0xb179('0x7'));var integrations=require(_0xb179('0x8'));module[_0xb179('0x9')]=function(_0x53929a,_0x27862d){return _0x53929a[_0xb179('0xa')](_0xb179('0xb'),attributes,{'tableName':_0xb179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 54141ba..7b6fa45 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96cc=['model','map','debug','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0xe83ac5,_0x279b67){var _0x3df16e=function(_0x5a1577){while(--_0x5a1577){_0xe83ac5['push'](_0xe83ac5['shift']());}};_0x3df16e(++_0x279b67);}(_0x96cc,0x16c));var _0xc96c=function(_0x48de9e,_0x144e00){_0x48de9e=_0x48de9e-0x0;var _0x20e60f=_0x96cc[_0x48de9e];return _0x20e60f;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')]({'raw':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1c')]||null:null,'attributes':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'limit':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1e')]||null:null,'include':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')]?_['map'](_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')],function(_0x4456bf){return{'model':db[_0x4456bf[_0xc96c('0x20')]],'as':_0x4456bf['as'],'attributes':_0x4456bf[_0xc96c('0x1d')],'include':_0x4456bf[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4456bf[_0xc96c('0x1f')],function(_0x1a77df){return{'model':db[_0x1a77df[_0xc96c('0x20')]],'as':_0x1a77df['as'],'attributes':_0x1a77df['attributes'],'include':_0x1a77df[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x1a77df[_0xc96c('0x1f')],function(_0x294fee){return{'model':db[_0x294fee['model']],'as':_0x294fee['as'],'attributes':_0x294fee['attributes']};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x12c293){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x22')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x12c293));_0x2ae19a(_0x12c293);})[_0xc96c('0x16')](function(_0xa0efbc){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0xa0efbc[_0xc96c('0x14')],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0xa0efbc[_0xc96c('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x3aa436){var _0x53c994=this;return new Promise(function(_0x3f4b0e,_0x442c7f){return db[_0xc96c('0x18')]['find']({'raw':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436['options']['where']||null:null,'attributes':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'include':_0x3aa436['options']?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x3aa436[_0xc96c('0x1a')]['include'],function(_0x4132a9){return{'model':db[_0x4132a9[_0xc96c('0x20')]],'as':_0x4132a9['as'],'attributes':_0x4132a9['attributes'],'include':_0x4132a9[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4132a9[_0xc96c('0x1f')],function(_0x2d2595){return{'model':db[_0x2d2595[_0xc96c('0x20')]],'as':_0x2d2595['as'],'attributes':_0x2d2595[_0xc96c('0x1d')],'include':_0x2d2595['include']?_[_0xc96c('0x21')](_0x2d2595[_0xc96c('0x1f')],function(_0x15b68b){return{'model':db[_0x15b68b[_0xc96c('0x20')]],'as':_0x15b68b['as'],'attributes':_0x15b68b[_0xc96c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x52d4a2){logger['info'](_0xc96c('0x23'),_0x3aa436);logger[_0xc96c('0x22')]('ShowVtigerAccount',_0x3aa436,JSON['stringify'](_0x52d4a2));_0x3f4b0e(_0x52d4a2);})[_0xc96c('0x16')](function(_0x1df393){logger[_0xc96c('0x12')](_0xc96c('0x23'),_0x1df393[_0xc96c('0x14')],_0x3aa436);_0x442c7f(_0x53c994[_0xc96c('0x12')](0x1f4,_0x1df393[_0xc96c('0x14')]));});});}; \ No newline at end of file +var _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xed3c,0x1a6));var _0xced3=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0xed3c[_0x24853d];return _0x4c5cff;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 68f9123..9978473 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea4e=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x3e8b1e,_0x2c8ef5){var _0x3989d5=function(_0x14fa1d){while(--_0x14fa1d){_0x3e8b1e['push'](_0x3e8b1e['shift']());}};_0x3989d5(++_0x2c8ef5);}(_0xea4e,0xbf));var _0xeea4=function(_0x261038,_0x2fab28){_0x261038=_0x261038-0x0;var _0x2fd230=_0xea4e[_0x261038];return _0x2fd230;};'use strict';var multer=require(_0xeea4('0x0'));var util=require(_0xeea4('0x1'));var path=require(_0xeea4('0x2'));var timeout=require(_0xeea4('0x3'));var express=require(_0xeea4('0x4'));var router=express[_0xeea4('0x5')]();var fs_extra=require(_0xeea4('0x6'));var auth=require(_0xeea4('0x7'));var interaction=require(_0xeea4('0x8'));var config=require(_0xeea4('0x9'));var controller=require('./intVtigerConfiguration.controller');router[_0xeea4('0xa')]('/',auth['isAuthenticated'](),controller[_0xeea4('0xb')]);router['get'](_0xeea4('0xc'),auth[_0xeea4('0xd')](),controller[_0xeea4('0xe')]);router[_0xeea4('0xa')](_0xeea4('0xf'),auth[_0xeea4('0xd')](),controller[_0xeea4('0x10')]);router[_0xeea4('0xa')](_0xeea4('0x11'),auth[_0xeea4('0xd')](),controller[_0xeea4('0x12')]);router[_0xeea4('0xa')](_0xeea4('0x13'),auth[_0xeea4('0xd')](),controller[_0xeea4('0x14')]);router[_0xeea4('0x15')]('/',auth[_0xeea4('0xd')](),controller['create']);router[_0xeea4('0x16')](_0xeea4('0xc'),auth[_0xeea4('0xd')](),controller[_0xeea4('0x17')]);router[_0xeea4('0x18')](_0xeea4('0xc'),auth[_0xeea4('0xd')](),controller[_0xeea4('0x19')]);module[_0xeea4('0x1a')]=router; \ No newline at end of file +var _0x2e7e=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x98137e,_0x246fc5){var _0x8703a2=function(_0x2b8209){while(--_0x2b8209){_0x98137e['push'](_0x98137e['shift']());}};_0x8703a2(++_0x246fc5);}(_0x2e7e,0x1db));var _0xe2e7=function(_0xb3e877,_0x5c2463){_0xb3e877=_0xb3e877-0x0;var _0x1db8d0=_0x2e7e[_0xb3e877];return _0x1db8d0;};'use strict';var multer=require(_0xe2e7('0x0'));var util=require(_0xe2e7('0x1'));var path=require(_0xe2e7('0x2'));var timeout=require(_0xe2e7('0x3'));var express=require('express');var router=express[_0xe2e7('0x4')]();var fs_extra=require(_0xe2e7('0x5'));var auth=require(_0xe2e7('0x6'));var interaction=require(_0xe2e7('0x7'));var config=require('../../config/environment');var controller=require(_0xe2e7('0x8'));router[_0xe2e7('0x9')]('/',auth[_0xe2e7('0xa')](),controller[_0xe2e7('0xb')]);router[_0xe2e7('0x9')](_0xe2e7('0xc'),auth[_0xe2e7('0xa')](),controller[_0xe2e7('0xd')]);router['get']('/:id/fields',auth[_0xe2e7('0xa')](),controller['getFields']);router['get'](_0xe2e7('0xe'),auth['isAuthenticated'](),controller[_0xe2e7('0xf')]);router['get'](_0xe2e7('0x10'),auth[_0xe2e7('0xa')](),controller[_0xe2e7('0x11')]);router[_0xe2e7('0x12')]('/',auth[_0xe2e7('0xa')](),controller[_0xe2e7('0x13')]);router[_0xe2e7('0x14')](_0xe2e7('0xc'),auth[_0xe2e7('0xa')](),controller[_0xe2e7('0x15')]);router['delete'](_0xe2e7('0xc'),auth[_0xe2e7('0xa')](),controller[_0xe2e7('0x16')]);module[_0xe2e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7935e48..17551ee 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe708=['sequelize','STRING'];(function(_0x585977,_0x9a2d50){var _0x541022=function(_0x5d636b){while(--_0x5d636b){_0x585977['push'](_0x585977['shift']());}};_0x541022(++_0x9a2d50);}(_0xe708,0x12c));var _0x8e70=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe708[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x8e70('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e70('0x1')]}}; \ No newline at end of file +var _0xce25=['STRING'];(function(_0x2f9c02,_0x15719e){var _0x5d33f3=function(_0x534f68){while(--_0x534f68){_0x2f9c02['push'](_0x2f9c02['shift']());}};_0x5d33f3(++_0x15719e);}(_0xce25,0x1b7));var _0x5ce2=function(_0x3ccfaa,_0x5e7818){_0x3ccfaa=_0x3ccfaa-0x0;var _0x5cd116=_0xce25[_0x3ccfaa];return _0x5cd116;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5ce2('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ffda5e7..66321bc 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb311=['findAll','catch','show','params','find','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','VtigerConfiguration','includeAll','include'];(function(_0x38156b,_0x26a2e9){var _0x198f57=function(_0x501d0d){while(--_0x501d0d){_0x38156b['push'](_0x38156b['shift']());}};_0x198f57(++_0x26a2e9);}(_0xb311,0xad));var _0x1b31=function(_0x5424b6,_0x503b7e){_0x5424b6=_0x5424b6-0x0;var _0x2f7efd=_0xb311[_0x5424b6];return _0x2f7efd;};'use strict';var emlformat=require(_0x1b31('0x0'));var rimraf=require(_0x1b31('0x1'));var zipdir=require(_0x1b31('0x2'));var jsonpatch=require(_0x1b31('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1b31('0x4'));var Mustache=require(_0x1b31('0x5'));var util=require('util');var path=require(_0x1b31('0x6'));var sox=require(_0x1b31('0x7'));var csv=require(_0x1b31('0x8'));var ejs=require(_0x1b31('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b31('0xa'));var squel=require(_0x1b31('0xb'));var crypto=require(_0x1b31('0xc'));var jsforce=require(_0x1b31('0xd'));var deskjs=require(_0x1b31('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b31('0xf'));var Papa=require(_0x1b31('0x10'));var Redis=require(_0x1b31('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1b31('0x12'));var hardwareService=require(_0x1b31('0x13'));var logger=require('../../config/logger')(_0x1b31('0x14'));var utils=require(_0x1b31('0x15'));var config=require(_0x1b31('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b31('0x17'))['db'];function respondWithStatusCode(_0x90c848,_0x5ca246){_0x5ca246=_0x5ca246||0xcc;return function(_0xf21d3c){if(_0xf21d3c){return _0x90c848[_0x1b31('0x18')](_0x5ca246);}return _0x90c848[_0x1b31('0x19')](_0x5ca246)[_0x1b31('0x1a')]();};}function respondWithResult(_0x2b5748,_0x1cdc79){_0x1cdc79=_0x1cdc79||0xc8;return function(_0x2ac945){if(_0x2ac945){return _0x2b5748[_0x1b31('0x19')](_0x1cdc79)[_0x1b31('0x1b')](_0x2ac945);}};}function respondWithFilteredResult(_0x455c36,_0xa60d5e){return function(_0x2ae13e){if(_0x2ae13e){var _0x83080=typeof _0xa60d5e[_0x1b31('0x1c')]===_0x1b31('0x1d')&&typeof _0xa60d5e['limit']===_0x1b31('0x1d');var _0x23707d=_0x2ae13e['count'];var _0x407b53=_0x83080?0x0:_0xa60d5e[_0x1b31('0x1c')];var _0x5d9995=_0x83080?_0x2ae13e[_0x1b31('0x1e')]:_0xa60d5e['offset']+_0xa60d5e[_0x1b31('0x1f')];var _0x4289cd;if(_0x5d9995>=_0x23707d){_0x5d9995=_0x23707d;_0x4289cd=0xc8;}else{_0x4289cd=0xce;}_0x455c36[_0x1b31('0x19')](_0x4289cd);return _0x455c36['set'](_0x1b31('0x20'),_0x407b53+'-'+_0x5d9995+'/'+_0x23707d)[_0x1b31('0x1b')](_0x2ae13e);}return null;};}function patchUpdates(_0x1f2f27){return function(_0x128c02){try{jsonpatch[_0x1b31('0x21')](_0x128c02,_0x1f2f27,!![]);}catch(_0x28a955){return BPromise[_0x1b31('0x22')](_0x28a955);}return _0x128c02[_0x1b31('0x23')]();};}function saveUpdates(_0x42c9b6,_0x1daa7d){return function(_0x522c98){if(_0x522c98){return _0x522c98[_0x1b31('0x24')](_0x42c9b6)[_0x1b31('0x25')](function(_0x353525){return _0x353525;});}return null;};}function removeEntity(_0x37fb8b,_0x101106){return function(_0xf33ef7){if(_0xf33ef7){return _0xf33ef7[_0x1b31('0x26')]()[_0x1b31('0x25')](function(){_0x37fb8b[_0x1b31('0x19')](0xcc)[_0x1b31('0x1a')]();});}};}function handleEntityNotFound(_0x593d46,_0x584194){return function(_0x192ff3){if(!_0x192ff3){_0x593d46[_0x1b31('0x18')](0x194);}return _0x192ff3;};}function handleError(_0x2bedf0,_0x3f6b61){_0x3f6b61=_0x3f6b61||0x1f4;return function(_0x22f438){logger[_0x1b31('0x27')](_0x22f438[_0x1b31('0x28')]);if(_0x22f438['name']){delete _0x22f438['name'];}_0x2bedf0[_0x1b31('0x19')](_0x3f6b61)[_0x1b31('0x29')](_0x22f438);};}exports[_0x1b31('0x2a')]=function(_0x5b7a4b,_0x202e6d){var _0x38b994={},_0x483562={},_0x2b6112={'count':0x0,'rows':[]};var _0x46fd56=_[_0x1b31('0x2b')](db['VtigerConfiguration'][_0x1b31('0x2c')],function(_0x4e1510){return{'name':_0x4e1510[_0x1b31('0x2d')],'type':_0x4e1510[_0x1b31('0x2e')]['key']};});_0x483562[_0x1b31('0x2f')]=_[_0x1b31('0x2b')](_0x46fd56,_0x1b31('0x30'));_0x483562[_0x1b31('0x31')]=_[_0x1b31('0x32')](_0x5b7a4b[_0x1b31('0x31')]);_0x483562[_0x1b31('0x33')]=_[_0x1b31('0x34')](_0x483562['model'],_0x483562['query']);_0x38b994[_0x1b31('0x35')]=_[_0x1b31('0x34')](_0x483562['model'],qs[_0x1b31('0x36')](_0x5b7a4b[_0x1b31('0x31')]['fields']));_0x38b994[_0x1b31('0x35')]=_0x38b994[_0x1b31('0x35')][_0x1b31('0x37')]?_0x38b994[_0x1b31('0x35')]:_0x483562[_0x1b31('0x2f')];if(!_0x5b7a4b[_0x1b31('0x31')][_0x1b31('0x38')](_0x1b31('0x39'))){_0x38b994[_0x1b31('0x1f')]=qs[_0x1b31('0x1f')](_0x5b7a4b[_0x1b31('0x31')][_0x1b31('0x1f')]);_0x38b994['offset']=qs[_0x1b31('0x1c')](_0x5b7a4b[_0x1b31('0x31')][_0x1b31('0x1c')]);}_0x38b994['order']=qs[_0x1b31('0x3a')](_0x5b7a4b['query'][_0x1b31('0x3a')]);_0x38b994[_0x1b31('0x3b')]=qs[_0x1b31('0x33')](_[_0x1b31('0x3c')](_0x5b7a4b['query'],_0x483562[_0x1b31('0x33')]),_0x46fd56);if(_0x5b7a4b['query']['filter']){_0x38b994[_0x1b31('0x3b')]=_[_0x1b31('0x3d')](_0x38b994[_0x1b31('0x3b')],{'$or':_[_0x1b31('0x2b')](_0x46fd56,function(_0x300129){if(_0x300129[_0x1b31('0x2e')]!=='VIRTUAL'){var _0x2c380d={};_0x2c380d[_0x300129['name']]={'$like':'%'+_0x5b7a4b[_0x1b31('0x31')][_0x1b31('0x3e')]+'%'};return _0x2c380d;}})});}_0x38b994=_[_0x1b31('0x3d')]({},_0x38b994,_0x5b7a4b[_0x1b31('0x3f')]);var _0x56b3d9={'where':_0x38b994['where']};return db[_0x1b31('0x40')][_0x1b31('0x1e')](_0x56b3d9)[_0x1b31('0x25')](function(_0x22e2d5){_0x2b6112[_0x1b31('0x1e')]=_0x22e2d5;if(_0x5b7a4b[_0x1b31('0x31')][_0x1b31('0x41')]){_0x38b994[_0x1b31('0x42')]=[{'all':!![]}];}return db[_0x1b31('0x40')][_0x1b31('0x43')](_0x38b994);})[_0x1b31('0x25')](function(_0x27cd5d){_0x2b6112['rows']=_0x27cd5d;return _0x2b6112;})[_0x1b31('0x25')](respondWithFilteredResult(_0x202e6d,_0x38b994))[_0x1b31('0x44')](handleError(_0x202e6d,null));};exports[_0x1b31('0x45')]=function(_0x391b5c,_0x134a3a){var _0x1e139a={'raw':![],'where':{'id':_0x391b5c[_0x1b31('0x46')]['id']}},_0x219f63={};_0x219f63[_0x1b31('0x2f')]=_[_0x1b31('0x32')](db[_0x1b31('0x40')][_0x1b31('0x2c')]);_0x219f63[_0x1b31('0x31')]=_[_0x1b31('0x32')](_0x391b5c['query']);_0x219f63[_0x1b31('0x33')]=_[_0x1b31('0x34')](_0x219f63[_0x1b31('0x2f')],_0x219f63['query']);_0x1e139a[_0x1b31('0x35')]=_[_0x1b31('0x34')](_0x219f63[_0x1b31('0x2f')],qs['fields'](_0x391b5c['query'][_0x1b31('0x36')]));_0x1e139a[_0x1b31('0x35')]=_0x1e139a[_0x1b31('0x35')][_0x1b31('0x37')]?_0x1e139a['attributes']:_0x219f63[_0x1b31('0x2f')];if(_0x391b5c[_0x1b31('0x31')][_0x1b31('0x41')]){_0x1e139a[_0x1b31('0x42')]=[{'all':!![]}];}_0x1e139a=_[_0x1b31('0x3d')]({},_0x1e139a,_0x391b5c[_0x1b31('0x3f')]);return db[_0x1b31('0x40')][_0x1b31('0x47')](_0x1e139a)['then'](handleEntityNotFound(_0x134a3a,null))['then'](respondWithResult(_0x134a3a,null))[_0x1b31('0x44')](handleError(_0x134a3a,null));};exports[_0x1b31('0x48')]=function(_0x1a0336,_0x5b763b){return db[_0x1b31('0x40')][_0x1b31('0x48')](_0x1a0336[_0x1b31('0x49')],{})['then'](respondWithResult(_0x5b763b,0xc9))['catch'](handleError(_0x5b763b,null));};exports[_0x1b31('0x24')]=function(_0x3e24a6,_0x2a2998){if(_0x3e24a6['body']['id']){delete _0x3e24a6['body']['id'];}return db[_0x1b31('0x40')][_0x1b31('0x47')]({'where':{'id':_0x3e24a6[_0x1b31('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a2998,null))[_0x1b31('0x25')](saveUpdates(_0x3e24a6[_0x1b31('0x49')],null))[_0x1b31('0x25')](respondWithResult(_0x2a2998,null))[_0x1b31('0x44')](handleError(_0x2a2998,null));};exports[_0x1b31('0x26')]=function(_0x1804aa,_0x59a91a){return db[_0x1b31('0x40')][_0x1b31('0x47')]({'where':{'id':_0x1804aa[_0x1b31('0x46')]['id']}})[_0x1b31('0x25')](handleEntityNotFound(_0x59a91a,null))[_0x1b31('0x25')](removeEntity(_0x59a91a,null))[_0x1b31('0x44')](handleError(_0x59a91a,null));};exports[_0x1b31('0x4a')]=function(_0x1c7e32,_0x30de31,_0x4632d2){var _0x3f3f4d={};var _0x9e5a14={};var _0x35b763;var _0x3d511f;return db[_0x1b31('0x40')][_0x1b31('0x4b')]({'where':{'id':_0x1c7e32['params']['id']}})['then'](handleEntityNotFound(_0x30de31,null))[_0x1b31('0x25')](function(_0x4fd5ad){if(_0x4fd5ad){_0x35b763=_0x4fd5ad;_0x9e5a14[_0x1b31('0x2f')]=_['keys'](db[_0x1b31('0x4c')][_0x1b31('0x2c')]);_0x9e5a14[_0x1b31('0x31')]=_['keys'](_0x1c7e32['query']);_0x9e5a14[_0x1b31('0x33')]=_[_0x1b31('0x34')](_0x9e5a14['model'],_0x9e5a14[_0x1b31('0x31')]);_0x3f3f4d[_0x1b31('0x35')]=_[_0x1b31('0x34')](_0x9e5a14[_0x1b31('0x2f')],qs[_0x1b31('0x36')](_0x1c7e32[_0x1b31('0x31')][_0x1b31('0x36')]));_0x3f3f4d[_0x1b31('0x35')]=_0x3f3f4d['attributes'][_0x1b31('0x37')]?_0x3f3f4d[_0x1b31('0x35')]:_0x9e5a14[_0x1b31('0x2f')];_0x3f3f4d[_0x1b31('0x4d')]=qs[_0x1b31('0x3a')](_0x1c7e32[_0x1b31('0x31')]['sort']);_0x3f3f4d['where']=qs[_0x1b31('0x33')](_['pick'](_0x1c7e32[_0x1b31('0x31')],_0x9e5a14[_0x1b31('0x33')]));if(_0x1c7e32[_0x1b31('0x31')][_0x1b31('0x3e')]){_0x3f3f4d[_0x1b31('0x3b')]=_['merge'](_0x3f3f4d[_0x1b31('0x3b')],{'$or':_[_0x1b31('0x2b')](_0x3f3f4d[_0x1b31('0x35')],function(_0x16d2af){var _0x290b7b={};_0x290b7b[_0x16d2af]={'$like':'%'+_0x1c7e32[_0x1b31('0x31')]['filter']+'%'};return _0x290b7b;})});}_0x3f3f4d=_[_0x1b31('0x3d')]({},_0x3f3f4d,_0x1c7e32[_0x1b31('0x3f')]);return _0x35b763[_0x1b31('0x4a')](_0x3f3f4d);}})['then'](function(_0x22c539){if(_0x22c539){_0x3d511f=_0x22c539[_0x1b31('0x37')];if(!_0x1c7e32[_0x1b31('0x31')]['hasOwnProperty'](_0x1b31('0x39'))){_0x3f3f4d[_0x1b31('0x1f')]=qs[_0x1b31('0x1f')](_0x1c7e32[_0x1b31('0x31')][_0x1b31('0x1f')]);_0x3f3f4d[_0x1b31('0x1c')]=qs['offset'](_0x1c7e32[_0x1b31('0x31')][_0x1b31('0x1c')]);}return _0x35b763[_0x1b31('0x4a')](_0x3f3f4d);}})[_0x1b31('0x25')](function(_0x121e90){if(_0x121e90){return _0x121e90?{'count':_0x3d511f,'rows':_0x121e90}:null;}})[_0x1b31('0x25')](respondWithResult(_0x30de31,null))[_0x1b31('0x44')](handleError(_0x30de31,null));};exports[_0x1b31('0x4e')]=function(_0x1d4905,_0x49170a,_0x320633){var _0x2fbee1={};var _0x274610={};var _0x2e01a4;var _0x4e90b2;return db['VtigerConfiguration'][_0x1b31('0x4b')]({'where':{'id':_0x1d4905[_0x1b31('0x46')]['id']}})[_0x1b31('0x25')](handleEntityNotFound(_0x49170a,null))[_0x1b31('0x25')](function(_0xf180e0){if(_0xf180e0){_0x2e01a4=_0xf180e0;_0x274610[_0x1b31('0x2f')]=_[_0x1b31('0x32')](db['VtigerField']['rawAttributes']);_0x274610['query']=_['keys'](_0x1d4905['query']);_0x274610['filters']=_[_0x1b31('0x34')](_0x274610['model'],_0x274610[_0x1b31('0x31')]);_0x2fbee1[_0x1b31('0x35')]=_[_0x1b31('0x34')](_0x274610['model'],qs[_0x1b31('0x36')](_0x1d4905[_0x1b31('0x31')]['fields']));_0x2fbee1['attributes']=_0x2fbee1[_0x1b31('0x35')][_0x1b31('0x37')]?_0x2fbee1['attributes']:_0x274610['model'];_0x2fbee1[_0x1b31('0x4d')]=qs[_0x1b31('0x3a')](_0x1d4905[_0x1b31('0x31')][_0x1b31('0x3a')]);_0x2fbee1[_0x1b31('0x3b')]=qs['filters'](_[_0x1b31('0x3c')](_0x1d4905['query'],_0x274610[_0x1b31('0x33')]));if(_0x1d4905[_0x1b31('0x31')][_0x1b31('0x3e')]){_0x2fbee1['where']=_[_0x1b31('0x3d')](_0x2fbee1[_0x1b31('0x3b')],{'$or':_[_0x1b31('0x2b')](_0x2fbee1['attributes'],function(_0x526a16){var _0x2b6b7a={};_0x2b6b7a[_0x526a16]={'$like':'%'+_0x1d4905['query'][_0x1b31('0x3e')]+'%'};return _0x2b6b7a;})});}_0x2fbee1=_[_0x1b31('0x3d')]({},_0x2fbee1,_0x1d4905[_0x1b31('0x3f')]);return _0x2e01a4[_0x1b31('0x4e')](_0x2fbee1);}})[_0x1b31('0x25')](function(_0x234f83){if(_0x234f83){_0x4e90b2=_0x234f83[_0x1b31('0x37')];if(!_0x1d4905[_0x1b31('0x31')][_0x1b31('0x38')](_0x1b31('0x39'))){_0x2fbee1[_0x1b31('0x1f')]=qs['limit'](_0x1d4905[_0x1b31('0x31')][_0x1b31('0x1f')]);_0x2fbee1[_0x1b31('0x1c')]=qs['offset'](_0x1d4905[_0x1b31('0x31')][_0x1b31('0x1c')]);}return _0x2e01a4[_0x1b31('0x4e')](_0x2fbee1);}})[_0x1b31('0x25')](function(_0x3a9b77){if(_0x3a9b77){return _0x3a9b77?{'count':_0x4e90b2,'rows':_0x3a9b77}:null;}})[_0x1b31('0x25')](respondWithResult(_0x49170a,null))[_0x1b31('0x44')](handleError(_0x49170a,null));};exports[_0x1b31('0x4f')]=function(_0x3328e6,_0xb6f52f,_0x7890c1){var _0x15479e={};var _0x257215={};var _0x5e265e;var _0x4f0593;return db[_0x1b31('0x40')][_0x1b31('0x4b')]({'where':{'id':_0x3328e6[_0x1b31('0x46')]['id']}})[_0x1b31('0x25')](handleEntityNotFound(_0xb6f52f,null))[_0x1b31('0x25')](function(_0x5d92e7){if(_0x5d92e7){_0x5e265e=_0x5d92e7;_0x257215['model']=_[_0x1b31('0x32')](db[_0x1b31('0x4c')][_0x1b31('0x2c')]);_0x257215[_0x1b31('0x31')]=_['keys'](_0x3328e6[_0x1b31('0x31')]);_0x257215['filters']=_[_0x1b31('0x34')](_0x257215[_0x1b31('0x2f')],_0x257215[_0x1b31('0x31')]);_0x15479e['attributes']=_[_0x1b31('0x34')](_0x257215[_0x1b31('0x2f')],qs[_0x1b31('0x36')](_0x3328e6[_0x1b31('0x31')][_0x1b31('0x36')]));_0x15479e[_0x1b31('0x35')]=_0x15479e['attributes'][_0x1b31('0x37')]?_0x15479e['attributes']:_0x257215[_0x1b31('0x2f')];_0x15479e[_0x1b31('0x4d')]=qs[_0x1b31('0x3a')](_0x3328e6['query'][_0x1b31('0x3a')]);_0x15479e[_0x1b31('0x3b')]=qs[_0x1b31('0x33')](_[_0x1b31('0x3c')](_0x3328e6[_0x1b31('0x31')],_0x257215[_0x1b31('0x33')]));if(_0x3328e6[_0x1b31('0x31')][_0x1b31('0x3e')]){_0x15479e[_0x1b31('0x3b')]=_[_0x1b31('0x3d')](_0x15479e[_0x1b31('0x3b')],{'$or':_[_0x1b31('0x2b')](_0x15479e[_0x1b31('0x35')],function(_0x3cfa01){var _0xfd37ba={};_0xfd37ba[_0x3cfa01]={'$like':'%'+_0x3328e6['query'][_0x1b31('0x3e')]+'%'};return _0xfd37ba;})});}_0x15479e=_[_0x1b31('0x3d')]({},_0x15479e,_0x3328e6[_0x1b31('0x3f')]);return _0x5e265e[_0x1b31('0x4f')](_0x15479e);}})['then'](function(_0x180b0e){if(_0x180b0e){_0x4f0593=_0x180b0e[_0x1b31('0x37')];if(!_0x3328e6[_0x1b31('0x31')]['hasOwnProperty'](_0x1b31('0x39'))){_0x15479e[_0x1b31('0x1f')]=qs[_0x1b31('0x1f')](_0x3328e6[_0x1b31('0x31')][_0x1b31('0x1f')]);_0x15479e[_0x1b31('0x1c')]=qs[_0x1b31('0x1c')](_0x3328e6[_0x1b31('0x31')][_0x1b31('0x1c')]);}return _0x5e265e['getDescriptions'](_0x15479e);}})[_0x1b31('0x25')](function(_0x2bdea0){if(_0x2bdea0){return _0x2bdea0?{'count':_0x4f0593,'rows':_0x2bdea0}:null;}})['then'](respondWithResult(_0xb6f52f,null))[_0x1b31('0x44')](handleError(_0xb6f52f,null));}; \ No newline at end of file +var _0xfbf1=['send','map','VtigerConfiguration','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','catch','show','include','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x2fea0b,_0x1427b2){var _0x80f5ec=function(_0x3070c2){while(--_0x3070c2){_0x2fea0b['push'](_0x2fea0b['shift']());}};_0x80f5ec(++_0x1427b2);}(_0xfbf1,0xc9));var _0x1fbf=function(_0x293359,_0x18c345){_0x293359=_0x293359-0x0;var _0x47e672=_0xfbf1[_0x293359];return _0x47e672;};'use strict';var emlformat=require(_0x1fbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fbf('0x1'));var jsonpatch=require(_0x1fbf('0x2'));var rp=require(_0x1fbf('0x3'));var moment=require('moment');var BPromise=require(_0x1fbf('0x4'));var Mustache=require('mustache');var util=require(_0x1fbf('0x5'));var path=require(_0x1fbf('0x6'));var sox=require(_0x1fbf('0x7'));var csv=require(_0x1fbf('0x8'));var ejs=require(_0x1fbf('0x9'));var fs=require('fs');var fs_extra=require(_0x1fbf('0xa'));var _=require(_0x1fbf('0xb'));var squel=require(_0x1fbf('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1fbf('0xd'));var toCsv=require(_0x1fbf('0x8'));var querystring=require(_0x1fbf('0xe'));var Papa=require(_0x1fbf('0xf'));var Redis=require('ioredis');var authService=require(_0x1fbf('0x10'));var qs=require(_0x1fbf('0x11'));var as=require(_0x1fbf('0x12'));var hardwareService=require(_0x1fbf('0x13'));var logger=require(_0x1fbf('0x14'))(_0x1fbf('0x15'));var utils=require(_0x1fbf('0x16'));var config=require(_0x1fbf('0x17'));var licenseUtil=require(_0x1fbf('0x18'));var db=require(_0x1fbf('0x19'))['db'];function respondWithStatusCode(_0x3d4149,_0x5c60f0){_0x5c60f0=_0x5c60f0||0xcc;return function(_0x2f4b5c){if(_0x2f4b5c){return _0x3d4149[_0x1fbf('0x1a')](_0x5c60f0);}return _0x3d4149[_0x1fbf('0x1b')](_0x5c60f0)[_0x1fbf('0x1c')]();};}function respondWithResult(_0x5a2d7a,_0x26995e){_0x26995e=_0x26995e||0xc8;return function(_0x14edd9){if(_0x14edd9){return _0x5a2d7a[_0x1fbf('0x1b')](_0x26995e)[_0x1fbf('0x1d')](_0x14edd9);}};}function respondWithFilteredResult(_0x5a5bf9,_0x4903e9){return function(_0x20c3f9){if(_0x20c3f9){var _0x5730ff=typeof _0x4903e9[_0x1fbf('0x1e')]===_0x1fbf('0x1f')&&typeof _0x4903e9[_0x1fbf('0x20')]===_0x1fbf('0x1f');var _0x5857ad=_0x20c3f9['count'];var _0x5e8116=_0x5730ff?0x0:_0x4903e9[_0x1fbf('0x1e')];var _0x24c7d7=_0x5730ff?_0x20c3f9[_0x1fbf('0x21')]:_0x4903e9[_0x1fbf('0x1e')]+_0x4903e9[_0x1fbf('0x20')];var _0x8d3ece;if(_0x24c7d7>=_0x5857ad){_0x24c7d7=_0x5857ad;_0x8d3ece=0xc8;}else{_0x8d3ece=0xce;}_0x5a5bf9[_0x1fbf('0x1b')](_0x8d3ece);return _0x5a5bf9[_0x1fbf('0x22')](_0x1fbf('0x23'),_0x5e8116+'-'+_0x24c7d7+'/'+_0x5857ad)['json'](_0x20c3f9);}return null;};}function patchUpdates(_0x2308d6){return function(_0x13ed5d){try{jsonpatch[_0x1fbf('0x24')](_0x13ed5d,_0x2308d6,!![]);}catch(_0x3c9dd9){return BPromise[_0x1fbf('0x25')](_0x3c9dd9);}return _0x13ed5d[_0x1fbf('0x26')]();};}function saveUpdates(_0x2c82b4,_0xb96a55){return function(_0x1c5b36){if(_0x1c5b36){return _0x1c5b36[_0x1fbf('0x27')](_0x2c82b4)[_0x1fbf('0x28')](function(_0xc68c35){return _0xc68c35;});}return null;};}function removeEntity(_0x4d1e56,_0x1b0d56){return function(_0x134d0b){if(_0x134d0b){return _0x134d0b[_0x1fbf('0x29')]()[_0x1fbf('0x28')](function(){_0x4d1e56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x62854a,_0x389deb){return function(_0x269ca3){if(!_0x269ca3){_0x62854a['sendStatus'](0x194);}return _0x269ca3;};}function handleError(_0x418180,_0x202678){_0x202678=_0x202678||0x1f4;return function(_0x191c02){logger[_0x1fbf('0x2a')](_0x191c02[_0x1fbf('0x2b')]);if(_0x191c02[_0x1fbf('0x2c')]){delete _0x191c02[_0x1fbf('0x2c')];}_0x418180[_0x1fbf('0x1b')](_0x202678)[_0x1fbf('0x2d')](_0x191c02);};}exports['index']=function(_0x20b4df,_0x15656b){var _0x5b4a6e={},_0x42ac3a={},_0x10d8ca={'count':0x0,'rows':[]};var _0xd437d8=_[_0x1fbf('0x2e')](db[_0x1fbf('0x2f')][_0x1fbf('0x30')],function(_0x4e13c2){return{'name':_0x4e13c2[_0x1fbf('0x31')],'type':_0x4e13c2['type'][_0x1fbf('0x32')]};});_0x42ac3a['model']=_[_0x1fbf('0x2e')](_0xd437d8,_0x1fbf('0x2c'));_0x42ac3a['query']=_[_0x1fbf('0x33')](_0x20b4df[_0x1fbf('0x34')]);_0x42ac3a[_0x1fbf('0x35')]=_[_0x1fbf('0x36')](_0x42ac3a[_0x1fbf('0x37')],_0x42ac3a[_0x1fbf('0x34')]);_0x5b4a6e[_0x1fbf('0x38')]=_[_0x1fbf('0x36')](_0x42ac3a[_0x1fbf('0x37')],qs[_0x1fbf('0x39')](_0x20b4df['query'][_0x1fbf('0x39')]));_0x5b4a6e['attributes']=_0x5b4a6e['attributes'][_0x1fbf('0x3a')]?_0x5b4a6e['attributes']:_0x42ac3a[_0x1fbf('0x37')];if(!_0x20b4df[_0x1fbf('0x34')][_0x1fbf('0x3b')](_0x1fbf('0x3c'))){_0x5b4a6e[_0x1fbf('0x20')]=qs[_0x1fbf('0x20')](_0x20b4df[_0x1fbf('0x34')][_0x1fbf('0x20')]);_0x5b4a6e['offset']=qs[_0x1fbf('0x1e')](_0x20b4df[_0x1fbf('0x34')]['offset']);}_0x5b4a6e[_0x1fbf('0x3d')]=qs[_0x1fbf('0x3e')](_0x20b4df[_0x1fbf('0x34')]['sort']);_0x5b4a6e['where']=qs[_0x1fbf('0x35')](_[_0x1fbf('0x3f')](_0x20b4df[_0x1fbf('0x34')],_0x42ac3a[_0x1fbf('0x35')]),_0xd437d8);if(_0x20b4df[_0x1fbf('0x34')]['filter']){_0x5b4a6e[_0x1fbf('0x40')]=_['merge'](_0x5b4a6e[_0x1fbf('0x40')],{'$or':_['map'](_0xd437d8,function(_0x4e51ff){if(_0x4e51ff[_0x1fbf('0x41')]!==_0x1fbf('0x42')){var _0x5ca11b={};_0x5ca11b[_0x4e51ff[_0x1fbf('0x2c')]]={'$like':'%'+_0x20b4df[_0x1fbf('0x34')][_0x1fbf('0x43')]+'%'};return _0x5ca11b;}})});}_0x5b4a6e=_[_0x1fbf('0x44')]({},_0x5b4a6e,_0x20b4df[_0x1fbf('0x45')]);var _0x43413e={'where':_0x5b4a6e[_0x1fbf('0x40')]};return db[_0x1fbf('0x2f')]['count'](_0x43413e)[_0x1fbf('0x28')](function(_0x5ef94b){_0x10d8ca[_0x1fbf('0x21')]=_0x5ef94b;if(_0x20b4df[_0x1fbf('0x34')][_0x1fbf('0x46')]){_0x5b4a6e['include']=[{'all':!![]}];}return db[_0x1fbf('0x2f')]['findAll'](_0x5b4a6e);})[_0x1fbf('0x28')](function(_0x491597){_0x10d8ca['rows']=_0x491597;return _0x10d8ca;})[_0x1fbf('0x28')](respondWithFilteredResult(_0x15656b,_0x5b4a6e))[_0x1fbf('0x47')](handleError(_0x15656b,null));};exports[_0x1fbf('0x48')]=function(_0x101276,_0x199dc4){var _0x4e62f9={'raw':![],'where':{'id':_0x101276['params']['id']}},_0x30d755={};_0x30d755[_0x1fbf('0x37')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x30d755['query']=_[_0x1fbf('0x33')](_0x101276[_0x1fbf('0x34')]);_0x30d755[_0x1fbf('0x35')]=_[_0x1fbf('0x36')](_0x30d755[_0x1fbf('0x37')],_0x30d755[_0x1fbf('0x34')]);_0x4e62f9[_0x1fbf('0x38')]=_[_0x1fbf('0x36')](_0x30d755[_0x1fbf('0x37')],qs[_0x1fbf('0x39')](_0x101276[_0x1fbf('0x34')]['fields']));_0x4e62f9[_0x1fbf('0x38')]=_0x4e62f9[_0x1fbf('0x38')][_0x1fbf('0x3a')]?_0x4e62f9[_0x1fbf('0x38')]:_0x30d755['model'];if(_0x101276[_0x1fbf('0x34')]['includeAll']){_0x4e62f9[_0x1fbf('0x49')]=[{'all':!![]}];}_0x4e62f9=_[_0x1fbf('0x44')]({},_0x4e62f9,_0x101276[_0x1fbf('0x45')]);return db[_0x1fbf('0x2f')]['find'](_0x4e62f9)[_0x1fbf('0x28')](handleEntityNotFound(_0x199dc4,null))[_0x1fbf('0x28')](respondWithResult(_0x199dc4,null))[_0x1fbf('0x47')](handleError(_0x199dc4,null));};exports[_0x1fbf('0x4a')]=function(_0x228375,_0x57b031){return db[_0x1fbf('0x2f')][_0x1fbf('0x4a')](_0x228375[_0x1fbf('0x4b')],{})[_0x1fbf('0x28')](respondWithResult(_0x57b031,0xc9))[_0x1fbf('0x47')](handleError(_0x57b031,null));};exports[_0x1fbf('0x27')]=function(_0x529651,_0x3e86b8){if(_0x529651[_0x1fbf('0x4b')]['id']){delete _0x529651['body']['id'];}return db[_0x1fbf('0x2f')]['find']({'where':{'id':_0x529651[_0x1fbf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e86b8,null))[_0x1fbf('0x28')](saveUpdates(_0x529651['body'],null))[_0x1fbf('0x28')](respondWithResult(_0x3e86b8,null))[_0x1fbf('0x47')](handleError(_0x3e86b8,null));};exports[_0x1fbf('0x29')]=function(_0x348cd8,_0x3b4027){return db[_0x1fbf('0x2f')]['find']({'where':{'id':_0x348cd8['params']['id']}})[_0x1fbf('0x28')](handleEntityNotFound(_0x3b4027,null))[_0x1fbf('0x28')](removeEntity(_0x3b4027,null))[_0x1fbf('0x47')](handleError(_0x3b4027,null));};exports[_0x1fbf('0x4d')]=function(_0x552a4c,_0x138dd2,_0x3dd2b1){var _0x1c9e26={};var _0x4c16bd={};var _0x4a6c2c;var _0x10b951;return db[_0x1fbf('0x2f')][_0x1fbf('0x4e')]({'where':{'id':_0x552a4c['params']['id']}})['then'](handleEntityNotFound(_0x138dd2,null))[_0x1fbf('0x28')](function(_0xd3f938){if(_0xd3f938){_0x4a6c2c=_0xd3f938;_0x4c16bd[_0x1fbf('0x37')]=_[_0x1fbf('0x33')](db[_0x1fbf('0x4f')]['rawAttributes']);_0x4c16bd[_0x1fbf('0x34')]=_['keys'](_0x552a4c[_0x1fbf('0x34')]);_0x4c16bd[_0x1fbf('0x35')]=_['intersection'](_0x4c16bd[_0x1fbf('0x37')],_0x4c16bd[_0x1fbf('0x34')]);_0x1c9e26[_0x1fbf('0x38')]=_[_0x1fbf('0x36')](_0x4c16bd[_0x1fbf('0x37')],qs[_0x1fbf('0x39')](_0x552a4c['query']['fields']));_0x1c9e26[_0x1fbf('0x38')]=_0x1c9e26[_0x1fbf('0x38')][_0x1fbf('0x3a')]?_0x1c9e26['attributes']:_0x4c16bd[_0x1fbf('0x37')];_0x1c9e26[_0x1fbf('0x3d')]=qs['sort'](_0x552a4c[_0x1fbf('0x34')]['sort']);_0x1c9e26[_0x1fbf('0x40')]=qs[_0x1fbf('0x35')](_[_0x1fbf('0x3f')](_0x552a4c[_0x1fbf('0x34')],_0x4c16bd[_0x1fbf('0x35')]));if(_0x552a4c[_0x1fbf('0x34')][_0x1fbf('0x43')]){_0x1c9e26[_0x1fbf('0x40')]=_['merge'](_0x1c9e26[_0x1fbf('0x40')],{'$or':_[_0x1fbf('0x2e')](_0x1c9e26['attributes'],function(_0x37e617){var _0x1de0ed={};_0x1de0ed[_0x37e617]={'$like':'%'+_0x552a4c['query'][_0x1fbf('0x43')]+'%'};return _0x1de0ed;})});}_0x1c9e26=_[_0x1fbf('0x44')]({},_0x1c9e26,_0x552a4c[_0x1fbf('0x45')]);return _0x4a6c2c[_0x1fbf('0x4d')](_0x1c9e26);}})['then'](function(_0x1a13af){if(_0x1a13af){_0x10b951=_0x1a13af[_0x1fbf('0x3a')];if(!_0x552a4c[_0x1fbf('0x34')]['hasOwnProperty'](_0x1fbf('0x3c'))){_0x1c9e26['limit']=qs[_0x1fbf('0x20')](_0x552a4c['query']['limit']);_0x1c9e26['offset']=qs['offset'](_0x552a4c[_0x1fbf('0x34')][_0x1fbf('0x1e')]);}return _0x4a6c2c[_0x1fbf('0x4d')](_0x1c9e26);}})['then'](function(_0x58a446){if(_0x58a446){return _0x58a446?{'count':_0x10b951,'rows':_0x58a446}:null;}})[_0x1fbf('0x28')](respondWithResult(_0x138dd2,null))[_0x1fbf('0x47')](handleError(_0x138dd2,null));};exports[_0x1fbf('0x50')]=function(_0x3361d7,_0x24c780,_0x438a7f){var _0x2f4420={};var _0x2e5927={};var _0x30c7a1;var _0xc665bc;return db[_0x1fbf('0x2f')][_0x1fbf('0x4e')]({'where':{'id':_0x3361d7[_0x1fbf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24c780,null))[_0x1fbf('0x28')](function(_0x3d9771){if(_0x3d9771){_0x30c7a1=_0x3d9771;_0x2e5927[_0x1fbf('0x37')]=_[_0x1fbf('0x33')](db[_0x1fbf('0x4f')][_0x1fbf('0x30')]);_0x2e5927[_0x1fbf('0x34')]=_['keys'](_0x3361d7['query']);_0x2e5927[_0x1fbf('0x35')]=_[_0x1fbf('0x36')](_0x2e5927[_0x1fbf('0x37')],_0x2e5927[_0x1fbf('0x34')]);_0x2f4420[_0x1fbf('0x38')]=_[_0x1fbf('0x36')](_0x2e5927[_0x1fbf('0x37')],qs['fields'](_0x3361d7['query'][_0x1fbf('0x39')]));_0x2f4420[_0x1fbf('0x38')]=_0x2f4420[_0x1fbf('0x38')][_0x1fbf('0x3a')]?_0x2f4420[_0x1fbf('0x38')]:_0x2e5927[_0x1fbf('0x37')];_0x2f4420['order']=qs[_0x1fbf('0x3e')](_0x3361d7[_0x1fbf('0x34')][_0x1fbf('0x3e')]);_0x2f4420[_0x1fbf('0x40')]=qs[_0x1fbf('0x35')](_[_0x1fbf('0x3f')](_0x3361d7[_0x1fbf('0x34')],_0x2e5927[_0x1fbf('0x35')]));if(_0x3361d7['query'][_0x1fbf('0x43')]){_0x2f4420['where']=_[_0x1fbf('0x44')](_0x2f4420[_0x1fbf('0x40')],{'$or':_[_0x1fbf('0x2e')](_0x2f4420[_0x1fbf('0x38')],function(_0x424833){var _0x433781={};_0x433781[_0x424833]={'$like':'%'+_0x3361d7['query']['filter']+'%'};return _0x433781;})});}_0x2f4420=_['merge']({},_0x2f4420,_0x3361d7[_0x1fbf('0x45')]);return _0x30c7a1['getSubjects'](_0x2f4420);}})[_0x1fbf('0x28')](function(_0x28b540){if(_0x28b540){_0xc665bc=_0x28b540['length'];if(!_0x3361d7['query'][_0x1fbf('0x3b')](_0x1fbf('0x3c'))){_0x2f4420[_0x1fbf('0x20')]=qs['limit'](_0x3361d7[_0x1fbf('0x34')][_0x1fbf('0x20')]);_0x2f4420[_0x1fbf('0x1e')]=qs[_0x1fbf('0x1e')](_0x3361d7[_0x1fbf('0x34')][_0x1fbf('0x1e')]);}return _0x30c7a1[_0x1fbf('0x50')](_0x2f4420);}})[_0x1fbf('0x28')](function(_0x36f644){if(_0x36f644){return _0x36f644?{'count':_0xc665bc,'rows':_0x36f644}:null;}})[_0x1fbf('0x28')](respondWithResult(_0x24c780,null))[_0x1fbf('0x47')](handleError(_0x24c780,null));};exports[_0x1fbf('0x51')]=function(_0x4c3f04,_0x915742,_0x4b3ddf){var _0x405aa7={};var _0x4117bb={};var _0x3c7820;var _0x99f213;return db[_0x1fbf('0x2f')][_0x1fbf('0x4e')]({'where':{'id':_0x4c3f04['params']['id']}})['then'](handleEntityNotFound(_0x915742,null))[_0x1fbf('0x28')](function(_0x4a87d1){if(_0x4a87d1){_0x3c7820=_0x4a87d1;_0x4117bb[_0x1fbf('0x37')]=_[_0x1fbf('0x33')](db[_0x1fbf('0x4f')][_0x1fbf('0x30')]);_0x4117bb['query']=_[_0x1fbf('0x33')](_0x4c3f04['query']);_0x4117bb[_0x1fbf('0x35')]=_['intersection'](_0x4117bb['model'],_0x4117bb[_0x1fbf('0x34')]);_0x405aa7[_0x1fbf('0x38')]=_[_0x1fbf('0x36')](_0x4117bb[_0x1fbf('0x37')],qs[_0x1fbf('0x39')](_0x4c3f04[_0x1fbf('0x34')][_0x1fbf('0x39')]));_0x405aa7[_0x1fbf('0x38')]=_0x405aa7['attributes'][_0x1fbf('0x3a')]?_0x405aa7[_0x1fbf('0x38')]:_0x4117bb[_0x1fbf('0x37')];_0x405aa7[_0x1fbf('0x3d')]=qs[_0x1fbf('0x3e')](_0x4c3f04['query'][_0x1fbf('0x3e')]);_0x405aa7[_0x1fbf('0x40')]=qs['filters'](_[_0x1fbf('0x3f')](_0x4c3f04[_0x1fbf('0x34')],_0x4117bb['filters']));if(_0x4c3f04[_0x1fbf('0x34')][_0x1fbf('0x43')]){_0x405aa7[_0x1fbf('0x40')]=_[_0x1fbf('0x44')](_0x405aa7[_0x1fbf('0x40')],{'$or':_[_0x1fbf('0x2e')](_0x405aa7[_0x1fbf('0x38')],function(_0xddd8d0){var _0x3bb31c={};_0x3bb31c[_0xddd8d0]={'$like':'%'+_0x4c3f04[_0x1fbf('0x34')][_0x1fbf('0x43')]+'%'};return _0x3bb31c;})});}_0x405aa7=_[_0x1fbf('0x44')]({},_0x405aa7,_0x4c3f04['options']);return _0x3c7820[_0x1fbf('0x51')](_0x405aa7);}})[_0x1fbf('0x28')](function(_0x18e8a9){if(_0x18e8a9){_0x99f213=_0x18e8a9[_0x1fbf('0x3a')];if(!_0x4c3f04[_0x1fbf('0x34')][_0x1fbf('0x3b')]('nolimit')){_0x405aa7[_0x1fbf('0x20')]=qs[_0x1fbf('0x20')](_0x4c3f04['query'][_0x1fbf('0x20')]);_0x405aa7[_0x1fbf('0x1e')]=qs[_0x1fbf('0x1e')](_0x4c3f04[_0x1fbf('0x34')][_0x1fbf('0x1e')]);}return _0x3c7820[_0x1fbf('0x51')](_0x405aa7);}})[_0x1fbf('0x28')](function(_0x1b08d6){if(_0x1b08d6){return _0x1b08d6?{'count':_0x99f213,'rows':_0x1b08d6}:null;}})[_0x1fbf('0x28')](respondWithResult(_0x915742,null))[_0x1fbf('0x47')](handleError(_0x915742,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 68606b4..176da67 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7783=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api'];(function(_0x3b88f4,_0x38d282){var _0x1e3c55=function(_0x34cb94){while(--_0x34cb94){_0x3b88f4['push'](_0x3b88f4['shift']());}};_0x1e3c55(++_0x38d282);}(_0x7783,0x182));var _0x3778=function(_0x1d1cef,_0x25c58e){_0x1d1cef=_0x1d1cef-0x0;var _0xba9801=_0x7783[_0x1d1cef];return _0xba9801;};'use strict';var _=require(_0x3778('0x0'));var util=require(_0x3778('0x1'));var logger=require(_0x3778('0x2'))(_0x3778('0x3'));var moment=require(_0x3778('0x4'));var BPromise=require(_0x3778('0x5'));var rp=require(_0x3778('0x6'));var fs=require('fs');var path=require(_0x3778('0x7'));var rimraf=require(_0x3778('0x8'));var config=require(_0x3778('0x9'));var attributes=require(_0x3778('0xa'));module[_0x3778('0xb')]=function(_0x451502,_0x3a9edf){return _0x451502[_0x3778('0xc')](_0x3778('0xd'),attributes,{'tableName':_0x3778('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9f9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerConfiguration'];(function(_0x896db1,_0x2a0ff9){var _0xc1adb6=function(_0x5608f){while(--_0x5608f){_0x896db1['push'](_0x896db1['shift']());}};_0xc1adb6(++_0x2a0ff9);}(_0xf9f9,0xf2));var _0x9f9f=function(_0x466598,_0x184aaf){_0x466598=_0x466598-0x0;var _0x303178=_0xf9f9[_0x466598];return _0x303178;};'use strict';var _=require('lodash');var util=require(_0x9f9f('0x0'));var logger=require(_0x9f9f('0x1'))(_0x9f9f('0x2'));var moment=require(_0x9f9f('0x3'));var BPromise=require(_0x9f9f('0x4'));var rp=require(_0x9f9f('0x5'));var fs=require('fs');var path=require(_0x9f9f('0x6'));var rimraf=require(_0x9f9f('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x9f9f('0x8')]=function(_0x25284e,_0x257d26){return _0x25284e[_0x9f9f('0x9')](_0x9f9f('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 0882059..6c3855e 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fb7=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x7fa241,_0xf12387){var _0x23af35=function(_0x25a07c){while(--_0x25a07c){_0x7fa241['push'](_0x7fa241['shift']());}};_0x23af35(++_0xf12387);}(_0x4fb7,0x112));var _0x74fb=function(_0x511404,_0x1e6a6c){_0x511404=_0x511404-0x0;var _0x4edc9a=_0x4fb7[_0x511404];return _0x4edc9a;};'use strict';var _=require(_0x74fb('0x0'));var util=require(_0x74fb('0x1'));var moment=require(_0x74fb('0x2'));var BPromise=require(_0x74fb('0x3'));var rs=require(_0x74fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x74fb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x74fb('0x6'));var client=jayson[_0x74fb('0x7')][_0x74fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36c1b2,_0x220b5e,_0x1e07e0){return new BPromise(function(_0x56c9a6,_0x1b4de2){return client[_0x74fb('0x9')](_0x36c1b2,_0x1e07e0)[_0x74fb('0xa')](function(_0x375e93){logger[_0x74fb('0xb')](_0x74fb('0xc'),_0x220b5e,_0x74fb('0xd'));logger[_0x74fb('0xe')](_0x74fb('0xf'),_0x220b5e,'request\x20sent',JSON[_0x74fb('0x10')](_0x375e93));if(_0x375e93[_0x74fb('0x11')]){if(_0x375e93[_0x74fb('0x11')][_0x74fb('0x12')]===0x1f4){logger[_0x74fb('0x11')](_0x74fb('0xc'),_0x220b5e,_0x375e93[_0x74fb('0x11')][_0x74fb('0x13')]);return _0x1b4de2(_0x375e93[_0x74fb('0x11')]['message']);}logger[_0x74fb('0x11')](_0x74fb('0xc'),_0x220b5e,_0x375e93[_0x74fb('0x11')]['message']);return _0x56c9a6(_0x375e93[_0x74fb('0x11')][_0x74fb('0x13')]);}else{logger[_0x74fb('0xb')](_0x74fb('0xc'),_0x220b5e,_0x74fb('0xd'));_0x56c9a6(_0x375e93[_0x74fb('0x14')][_0x74fb('0x13')]);}})[_0x74fb('0x15')](function(_0x1441d4){logger[_0x74fb('0x11')](_0x74fb('0xc'),_0x220b5e,_0x1441d4);_0x1b4de2(_0x1441d4);});});} \ No newline at end of file +var _0xed1f=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x172c4b,_0x15f40e){var _0x45233d=function(_0x589e19){while(--_0x589e19){_0x172c4b['push'](_0x172c4b['shift']());}};_0x45233d(++_0x15f40e);}(_0xed1f,0x153));var _0xfed1=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xed1f[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require('moment');var BPromise=require(_0xfed1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var utils=require(_0xfed1('0x5'));var logger=require(_0xfed1('0x6'))('rpc');var config=require(_0xfed1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfed1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b2226,_0x271133,_0x5bf050){return new BPromise(function(_0xf996db,_0x32b85e){return client[_0xfed1('0x9')](_0x1b2226,_0x5bf050)[_0xfed1('0xa')](function(_0x12ec1f){logger[_0xfed1('0xb')](_0xfed1('0xc'),_0x271133,_0xfed1('0xd'));logger[_0xfed1('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x271133,_0xfed1('0xd'),JSON['stringify'](_0x12ec1f));if(_0x12ec1f[_0xfed1('0xf')]){if(_0x12ec1f[_0xfed1('0xf')][_0xfed1('0x10')]===0x1f4){logger[_0xfed1('0xf')](_0xfed1('0xc'),_0x271133,_0x12ec1f['error'][_0xfed1('0x11')]);return _0x32b85e(_0x12ec1f[_0xfed1('0xf')][_0xfed1('0x11')]);}logger[_0xfed1('0xf')](_0xfed1('0xc'),_0x271133,_0x12ec1f['error'][_0xfed1('0x11')]);return _0xf996db(_0x12ec1f[_0xfed1('0xf')][_0xfed1('0x11')]);}else{logger[_0xfed1('0xb')](_0xfed1('0xc'),_0x271133,_0xfed1('0xd'));_0xf996db(_0x12ec1f[_0xfed1('0x12')][_0xfed1('0x11')]);}})[_0xfed1('0x13')](function(_0x2a1f6e){logger[_0xfed1('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x271133,_0x2a1f6e);_0x32b85e(_0x2a1f6e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8f41e5d..14db464 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb67c=['../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xb315a5,_0x54fba2){var _0x8b213f=function(_0x46f762){while(--_0x46f762){_0xb315a5['push'](_0xb315a5['shift']());}};_0x8b213f(++_0x54fba2);}(_0xb67c,0xcb));var _0xcb67=function(_0x228d2d,_0x557835){_0x228d2d=_0x228d2d-0x0;var _0x59b4e4=_0xb67c[_0x228d2d];return _0x59b4e4;};'use strict';var multer=require(_0xcb67('0x0'));var util=require(_0xcb67('0x1'));var path=require(_0xcb67('0x2'));var timeout=require(_0xcb67('0x3'));var express=require(_0xcb67('0x4'));var router=express['Router']();var fs_extra=require(_0xcb67('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb67('0x6'));var config=require('../../config/environment');var controller=require(_0xcb67('0x7'));router[_0xcb67('0x8')]('/',auth[_0xcb67('0x9')](),controller[_0xcb67('0xa')]);router[_0xcb67('0x8')]('/:id',auth[_0xcb67('0x9')](),controller[_0xcb67('0xb')]);router[_0xcb67('0xc')]('/',auth['isAuthenticated'](),controller[_0xcb67('0xd')]);router[_0xcb67('0xe')](_0xcb67('0xf'),auth[_0xcb67('0x9')](),controller[_0xcb67('0x10')]);router[_0xcb67('0x11')](_0xcb67('0xf'),auth[_0xcb67('0x9')](),controller[_0xcb67('0x12')]);module['exports']=router; \ No newline at end of file +var _0x65fe=['show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id'];(function(_0x108b66,_0x37db88){var _0x3ed76=function(_0x2a22c5){while(--_0x2a22c5){_0x108b66['push'](_0x108b66['shift']());}};_0x3ed76(++_0x37db88);}(_0x65fe,0xaf));var _0xe65f=function(_0x65b466,_0x10adc0){_0x65b466=_0x65b466-0x0;var _0x50fbac=_0x65fe[_0x65b466];return _0x50fbac;};'use strict';var multer=require(_0xe65f('0x0'));var util=require(_0xe65f('0x1'));var path=require(_0xe65f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe65f('0x3'));var router=express[_0xe65f('0x4')]();var fs_extra=require(_0xe65f('0x5'));var auth=require(_0xe65f('0x6'));var interaction=require(_0xe65f('0x7'));var config=require(_0xe65f('0x8'));var controller=require(_0xe65f('0x9'));router['get']('/',auth[_0xe65f('0xa')](),controller[_0xe65f('0xb')]);router[_0xe65f('0xc')](_0xe65f('0xd'),auth[_0xe65f('0xa')](),controller[_0xe65f('0xe')]);router[_0xe65f('0xf')]('/',auth[_0xe65f('0xa')](),controller[_0xe65f('0x10')]);router[_0xe65f('0x11')](_0xe65f('0xd'),auth[_0xe65f('0xa')](),controller[_0xe65f('0x12')]);router['delete'](_0xe65f('0xd'),auth[_0xe65f('0xa')](),controller[_0xe65f('0x13')]);module[_0xe65f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b357fcb..137beec 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f82=['sequelize','exports','ENUM','string','customVariable','picklist','STRING','variable'];(function(_0x7992ef,_0x392f6b){var _0x478e15=function(_0x4ea438){while(--_0x4ea438){_0x7992ef['push'](_0x7992ef['shift']());}};_0x478e15(++_0x392f6b);}(_0x3f82,0xe8));var _0x23f8=function(_0x14ba47,_0x5e7f87){_0x14ba47=_0x14ba47-0x0;var _0x4f40af=_0x3f82[_0x14ba47];return _0x4f40af;};'use strict';var Sequelize=require(_0x23f8('0x0'));module[_0x23f8('0x1')]={'type':{'type':Sequelize[_0x23f8('0x2')](_0x23f8('0x3'),'variable',_0x23f8('0x4'),'keyValue',_0x23f8('0x5')),'defaultValue':_0x23f8('0x3')},'content':{'type':Sequelize[_0x23f8('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x23f8('0x2')]('string',_0x23f8('0x7'),_0x23f8('0x4'))},'keyContent':{'type':Sequelize[_0x23f8('0x6')]},'idField':{'type':Sequelize[_0x23f8('0x6')]},'nameField':{'type':Sequelize[_0x23f8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23f8('0x6')]}}; \ No newline at end of file +var _0x7233=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x2f841a,_0x1d5f85){var _0x4e60f2=function(_0x166429){while(--_0x166429){_0x2f841a['push'](_0x2f841a['shift']());}};_0x4e60f2(++_0x1d5f85);}(_0x7233,0x86));var _0x3723=function(_0x45ed35,_0x4fdc39){_0x45ed35=_0x45ed35-0x0;var _0x26f778=_0x7233[_0x45ed35];return _0x26f778;};'use strict';var Sequelize=require(_0x3723('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3723('0x1'),_0x3723('0x2'),_0x3723('0x3'),_0x3723('0x4'),_0x3723('0x5')),'defaultValue':_0x3723('0x1')},'content':{'type':Sequelize[_0x3723('0x6')]},'key':{'type':Sequelize[_0x3723('0x6')]},'keyType':{'type':Sequelize[_0x3723('0x7')](_0x3723('0x1'),_0x3723('0x2'),_0x3723('0x3'))},'keyContent':{'type':Sequelize[_0x3723('0x6')]},'idField':{'type':Sequelize[_0x3723('0x6')]},'nameField':{'type':Sequelize[_0x3723('0x6')]},'customField':{'type':Sequelize[_0x3723('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3723('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index fce0828..381a23f 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd54=['map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','index'];(function(_0x3cf228,_0x1c5598){var _0x4888d2=function(_0x209bb1){while(--_0x209bb1){_0x3cf228['push'](_0x3cf228['shift']());}};_0x4888d2(++_0x1c5598);}(_0xbd54,0xf4));var _0x4bd5=function(_0xb60674,_0xa4e08a){_0xb60674=_0xb60674-0x0;var _0x2514a0=_0xbd54[_0xb60674];return _0x2514a0;};'use strict';var emlformat=require(_0x4bd5('0x0'));var rimraf=require(_0x4bd5('0x1'));var zipdir=require(_0x4bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bd5('0x3'));var moment=require(_0x4bd5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bd5('0x5'));var util=require('util');var path=require(_0x4bd5('0x6'));var sox=require(_0x4bd5('0x7'));var csv=require(_0x4bd5('0x8'));var ejs=require(_0x4bd5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bd5('0xa'));var squel=require(_0x4bd5('0xb'));var crypto=require(_0x4bd5('0xc'));var jsforce=require(_0x4bd5('0xd'));var deskjs=require(_0x4bd5('0xe'));var toCsv=require(_0x4bd5('0x8'));var querystring=require(_0x4bd5('0xf'));var Papa=require('papaparse');var Redis=require(_0x4bd5('0x10'));var authService=require(_0x4bd5('0x11'));var qs=require(_0x4bd5('0x12'));var as=require(_0x4bd5('0x13'));var hardwareService=require(_0x4bd5('0x14'));var logger=require(_0x4bd5('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34626d,_0x4f086b){_0x4f086b=_0x4f086b||0xcc;return function(_0x44d77){if(_0x44d77){return _0x34626d[_0x4bd5('0x16')](_0x4f086b);}return _0x34626d[_0x4bd5('0x17')](_0x4f086b)[_0x4bd5('0x18')]();};}function respondWithResult(_0x21a73d,_0x5cec3f){_0x5cec3f=_0x5cec3f||0xc8;return function(_0x1dbd08){if(_0x1dbd08){return _0x21a73d[_0x4bd5('0x17')](_0x5cec3f)[_0x4bd5('0x19')](_0x1dbd08);}};}function respondWithFilteredResult(_0x243a0a,_0x547794){return function(_0x1edbe4){if(_0x1edbe4){var _0x465d06=typeof _0x547794[_0x4bd5('0x1a')]===_0x4bd5('0x1b')&&typeof _0x547794[_0x4bd5('0x1c')]===_0x4bd5('0x1b');var _0x5b4ec9=_0x1edbe4['count'];var _0xe29201=_0x465d06?0x0:_0x547794['offset'];var _0x97a163=_0x465d06?_0x1edbe4[_0x4bd5('0x1d')]:_0x547794[_0x4bd5('0x1a')]+_0x547794[_0x4bd5('0x1c')];var _0x1d9ea5;if(_0x97a163>=_0x5b4ec9){_0x97a163=_0x5b4ec9;_0x1d9ea5=0xc8;}else{_0x1d9ea5=0xce;}_0x243a0a[_0x4bd5('0x17')](_0x1d9ea5);return _0x243a0a[_0x4bd5('0x1e')](_0x4bd5('0x1f'),_0xe29201+'-'+_0x97a163+'/'+_0x5b4ec9)['json'](_0x1edbe4);}return null;};}function patchUpdates(_0x2c43c6){return function(_0x4e5ebf){try{jsonpatch['apply'](_0x4e5ebf,_0x2c43c6,!![]);}catch(_0xd57f1c){return BPromise[_0x4bd5('0x20')](_0xd57f1c);}return _0x4e5ebf[_0x4bd5('0x21')]();};}function saveUpdates(_0xd0ffe2,_0x1194a9){return function(_0xb283e4){if(_0xb283e4){return _0xb283e4[_0x4bd5('0x22')](_0xd0ffe2)['then'](function(_0x207ea2){return _0x207ea2;});}return null;};}function removeEntity(_0x4fa469,_0x2f3c45){return function(_0x5d01e7){if(_0x5d01e7){return _0x5d01e7[_0x4bd5('0x23')]()[_0x4bd5('0x24')](function(){_0x4fa469[_0x4bd5('0x17')](0xcc)[_0x4bd5('0x18')]();});}};}function handleEntityNotFound(_0x41a3c8,_0x9a8793){return function(_0x230aa2){if(!_0x230aa2){_0x41a3c8['sendStatus'](0x194);}return _0x230aa2;};}function handleError(_0x1aa3db,_0x4d66a7){_0x4d66a7=_0x4d66a7||0x1f4;return function(_0x5a7eb8){logger['error'](_0x5a7eb8[_0x4bd5('0x25')]);if(_0x5a7eb8[_0x4bd5('0x26')]){delete _0x5a7eb8[_0x4bd5('0x26')];}_0x1aa3db[_0x4bd5('0x17')](_0x4d66a7)['send'](_0x5a7eb8);};}exports[_0x4bd5('0x27')]=function(_0x44283c,_0x649a85){var _0x244596={},_0x1aa885={},_0x45e3a4={'count':0x0,'rows':[]};var _0x335dfc=_[_0x4bd5('0x28')](db[_0x4bd5('0x29')][_0x4bd5('0x2a')],function(_0x9dfed0){return{'name':_0x9dfed0[_0x4bd5('0x2b')],'type':_0x9dfed0[_0x4bd5('0x2c')]['key']};});_0x1aa885[_0x4bd5('0x2d')]=_[_0x4bd5('0x28')](_0x335dfc,_0x4bd5('0x26'));_0x1aa885[_0x4bd5('0x2e')]=_[_0x4bd5('0x2f')](_0x44283c[_0x4bd5('0x2e')]);_0x1aa885[_0x4bd5('0x30')]=_[_0x4bd5('0x31')](_0x1aa885[_0x4bd5('0x2d')],_0x1aa885[_0x4bd5('0x2e')]);_0x244596[_0x4bd5('0x32')]=_['intersection'](_0x1aa885['model'],qs[_0x4bd5('0x33')](_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x33')]));_0x244596[_0x4bd5('0x32')]=_0x244596[_0x4bd5('0x32')][_0x4bd5('0x34')]?_0x244596[_0x4bd5('0x32')]:_0x1aa885[_0x4bd5('0x2d')];if(!_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x35')]('nolimit')){_0x244596[_0x4bd5('0x1c')]=qs[_0x4bd5('0x1c')](_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x1c')]);_0x244596[_0x4bd5('0x1a')]=qs[_0x4bd5('0x1a')](_0x44283c['query']['offset']);}_0x244596[_0x4bd5('0x36')]=qs[_0x4bd5('0x37')](_0x44283c['query'][_0x4bd5('0x37')]);_0x244596['where']=qs['filters'](_[_0x4bd5('0x38')](_0x44283c[_0x4bd5('0x2e')],_0x1aa885[_0x4bd5('0x30')]),_0x335dfc);if(_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x39')]){_0x244596[_0x4bd5('0x3a')]=_[_0x4bd5('0x3b')](_0x244596[_0x4bd5('0x3a')],{'$or':_[_0x4bd5('0x28')](_0x335dfc,function(_0x5a05eb){if(_0x5a05eb[_0x4bd5('0x2c')]!==_0x4bd5('0x3c')){var _0x24c76a={};_0x24c76a[_0x5a05eb[_0x4bd5('0x26')]]={'$like':'%'+_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x39')]+'%'};return _0x24c76a;}})});}_0x244596=_[_0x4bd5('0x3b')]({},_0x244596,_0x44283c[_0x4bd5('0x3d')]);var _0x38d70e={'where':_0x244596[_0x4bd5('0x3a')]};return db['VtigerField'][_0x4bd5('0x1d')](_0x38d70e)[_0x4bd5('0x24')](function(_0x31fd28){_0x45e3a4[_0x4bd5('0x1d')]=_0x31fd28;if(_0x44283c[_0x4bd5('0x2e')][_0x4bd5('0x3e')]){_0x244596['include']=[{'all':!![]}];}return db['VtigerField'][_0x4bd5('0x3f')](_0x244596);})[_0x4bd5('0x24')](function(_0x5263ce){_0x45e3a4[_0x4bd5('0x40')]=_0x5263ce;return _0x45e3a4;})[_0x4bd5('0x24')](respondWithFilteredResult(_0x649a85,_0x244596))[_0x4bd5('0x41')](handleError(_0x649a85,null));};exports[_0x4bd5('0x42')]=function(_0x137b75,_0x1a4eb4){var _0x5d4616={'raw':!![],'where':{'id':_0x137b75['params']['id']}},_0x52a0c2={};_0x52a0c2[_0x4bd5('0x2d')]=_[_0x4bd5('0x2f')](db[_0x4bd5('0x29')][_0x4bd5('0x2a')]);_0x52a0c2[_0x4bd5('0x2e')]=_[_0x4bd5('0x2f')](_0x137b75[_0x4bd5('0x2e')]);_0x52a0c2[_0x4bd5('0x30')]=_['intersection'](_0x52a0c2[_0x4bd5('0x2d')],_0x52a0c2[_0x4bd5('0x2e')]);_0x5d4616[_0x4bd5('0x32')]=_[_0x4bd5('0x31')](_0x52a0c2['model'],qs[_0x4bd5('0x33')](_0x137b75[_0x4bd5('0x2e')][_0x4bd5('0x33')]));_0x5d4616[_0x4bd5('0x32')]=_0x5d4616[_0x4bd5('0x32')][_0x4bd5('0x34')]?_0x5d4616[_0x4bd5('0x32')]:_0x52a0c2['model'];if(_0x137b75[_0x4bd5('0x2e')][_0x4bd5('0x3e')]){_0x5d4616[_0x4bd5('0x43')]=[{'all':!![]}];}_0x5d4616=_[_0x4bd5('0x3b')]({},_0x5d4616,_0x137b75[_0x4bd5('0x3d')]);return db['VtigerField'][_0x4bd5('0x44')](_0x5d4616)['then'](handleEntityNotFound(_0x1a4eb4,null))[_0x4bd5('0x24')](respondWithResult(_0x1a4eb4,null))['catch'](handleError(_0x1a4eb4,null));};exports['create']=function(_0x2f2937,_0x2c95cc){return db[_0x4bd5('0x29')]['create'](_0x2f2937[_0x4bd5('0x45')],{})['then'](respondWithResult(_0x2c95cc,0xc9))[_0x4bd5('0x41')](handleError(_0x2c95cc,null));};exports[_0x4bd5('0x22')]=function(_0x3ee999,_0x23d334){if(_0x3ee999[_0x4bd5('0x45')]['id']){delete _0x3ee999[_0x4bd5('0x45')]['id'];}return db[_0x4bd5('0x29')][_0x4bd5('0x44')]({'where':{'id':_0x3ee999['params']['id']}})[_0x4bd5('0x24')](handleEntityNotFound(_0x23d334,null))['then'](saveUpdates(_0x3ee999[_0x4bd5('0x45')],null))[_0x4bd5('0x24')](respondWithResult(_0x23d334,null))['catch'](handleError(_0x23d334,null));};exports[_0x4bd5('0x23')]=function(_0x55e860,_0x469d8a){return db['VtigerField'][_0x4bd5('0x44')]({'where':{'id':_0x55e860[_0x4bd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x469d8a,null))['then'](removeEntity(_0x469d8a,null))['catch'](handleError(_0x469d8a,null));}; \ No newline at end of file +var _0xbf0b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','VtigerField','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','crypto','desk.js','papaparse'];(function(_0x41456b,_0xb27de1){var _0x35e763=function(_0x4d4d4c){while(--_0x4d4d4c){_0x41456b['push'](_0x41456b['shift']());}};_0x35e763(++_0xb27de1);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x311d08,_0x573ad0){_0x311d08=_0x311d08-0x0;var _0x37de45=_0xbf0b[_0x311d08];return _0x37de45;};'use strict';var emlformat=require(_0xbbf0('0x0'));var rimraf=require(_0xbbf0('0x1'));var zipdir=require(_0xbbf0('0x2'));var jsonpatch=require(_0xbbf0('0x3'));var rp=require('request-promise');var moment=require(_0xbbf0('0x4'));var BPromise=require(_0xbbf0('0x5'));var Mustache=require('mustache');var util=require(_0xbbf0('0x6'));var path=require(_0xbbf0('0x7'));var sox=require('sox');var csv=require(_0xbbf0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbf0('0x9'));var squel=require('squel');var crypto=require(_0xbbf0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbbf0('0xb'));var toCsv=require(_0xbbf0('0x8'));var querystring=require('querystring');var Papa=require(_0xbbf0('0xc'));var Redis=require(_0xbbf0('0xd'));var authService=require(_0xbbf0('0xe'));var qs=require(_0xbbf0('0xf'));var as=require(_0xbbf0('0x10'));var hardwareService=require(_0xbbf0('0x11'));var logger=require(_0xbbf0('0x12'))(_0xbbf0('0x13'));var utils=require(_0xbbf0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbbf0('0x15'));var db=require(_0xbbf0('0x16'))['db'];function respondWithStatusCode(_0x5c3fd7,_0x26d7b5){_0x26d7b5=_0x26d7b5||0xcc;return function(_0x219463){if(_0x219463){return _0x5c3fd7[_0xbbf0('0x17')](_0x26d7b5);}return _0x5c3fd7[_0xbbf0('0x18')](_0x26d7b5)[_0xbbf0('0x19')]();};}function respondWithResult(_0x192ce3,_0x233a90){_0x233a90=_0x233a90||0xc8;return function(_0x3b5f7d){if(_0x3b5f7d){return _0x192ce3[_0xbbf0('0x18')](_0x233a90)[_0xbbf0('0x1a')](_0x3b5f7d);}};}function respondWithFilteredResult(_0x5f288b,_0x962087){return function(_0x3acf18){if(_0x3acf18){var _0xd673b=typeof _0x962087['offset']===_0xbbf0('0x1b')&&typeof _0x962087[_0xbbf0('0x1c')]===_0xbbf0('0x1b');var _0x4cf99a=_0x3acf18[_0xbbf0('0x1d')];var _0x1c2ff8=_0xd673b?0x0:_0x962087['offset'];var _0x2513b3=_0xd673b?_0x3acf18['count']:_0x962087[_0xbbf0('0x1e')]+_0x962087[_0xbbf0('0x1c')];var _0xb050aa;if(_0x2513b3>=_0x4cf99a){_0x2513b3=_0x4cf99a;_0xb050aa=0xc8;}else{_0xb050aa=0xce;}_0x5f288b[_0xbbf0('0x18')](_0xb050aa);return _0x5f288b[_0xbbf0('0x1f')](_0xbbf0('0x20'),_0x1c2ff8+'-'+_0x2513b3+'/'+_0x4cf99a)[_0xbbf0('0x1a')](_0x3acf18);}return null;};}function patchUpdates(_0x14e32a){return function(_0x37c141){try{jsonpatch[_0xbbf0('0x21')](_0x37c141,_0x14e32a,!![]);}catch(_0x424a30){return BPromise[_0xbbf0('0x22')](_0x424a30);}return _0x37c141[_0xbbf0('0x23')]();};}function saveUpdates(_0x5b2855,_0x3b85ec){return function(_0x390091){if(_0x390091){return _0x390091[_0xbbf0('0x24')](_0x5b2855)[_0xbbf0('0x25')](function(_0x35b9aa){return _0x35b9aa;});}return null;};}function removeEntity(_0x4f31b7,_0x2b707a){return function(_0x17edff){if(_0x17edff){return _0x17edff['destroy']()[_0xbbf0('0x25')](function(){_0x4f31b7['status'](0xcc)[_0xbbf0('0x19')]();});}};}function handleEntityNotFound(_0x90c582,_0x4c4e49){return function(_0x517b95){if(!_0x517b95){_0x90c582['sendStatus'](0x194);}return _0x517b95;};}function handleError(_0x36f6ff,_0x487711){_0x487711=_0x487711||0x1f4;return function(_0x15f38a){logger[_0xbbf0('0x26')](_0x15f38a[_0xbbf0('0x27')]);if(_0x15f38a['name']){delete _0x15f38a[_0xbbf0('0x28')];}_0x36f6ff[_0xbbf0('0x18')](_0x487711)[_0xbbf0('0x29')](_0x15f38a);};}exports[_0xbbf0('0x2a')]=function(_0x311599,_0x580b07){var _0x249745={},_0x532123={},_0x2b5c3d={'count':0x0,'rows':[]};var _0x1eb7b8=_[_0xbbf0('0x2b')](db['VtigerField'][_0xbbf0('0x2c')],function(_0x4796b4){return{'name':_0x4796b4[_0xbbf0('0x2d')],'type':_0x4796b4[_0xbbf0('0x2e')]['key']};});_0x532123[_0xbbf0('0x2f')]=_['map'](_0x1eb7b8,_0xbbf0('0x28'));_0x532123['query']=_[_0xbbf0('0x30')](_0x311599[_0xbbf0('0x31')]);_0x532123[_0xbbf0('0x32')]=_[_0xbbf0('0x33')](_0x532123[_0xbbf0('0x2f')],_0x532123[_0xbbf0('0x31')]);_0x249745[_0xbbf0('0x34')]=_[_0xbbf0('0x33')](_0x532123['model'],qs[_0xbbf0('0x35')](_0x311599[_0xbbf0('0x31')][_0xbbf0('0x35')]));_0x249745[_0xbbf0('0x34')]=_0x249745[_0xbbf0('0x34')][_0xbbf0('0x36')]?_0x249745[_0xbbf0('0x34')]:_0x532123[_0xbbf0('0x2f')];if(!_0x311599[_0xbbf0('0x31')][_0xbbf0('0x37')](_0xbbf0('0x38'))){_0x249745[_0xbbf0('0x1c')]=qs['limit'](_0x311599['query']['limit']);_0x249745[_0xbbf0('0x1e')]=qs[_0xbbf0('0x1e')](_0x311599[_0xbbf0('0x31')][_0xbbf0('0x1e')]);}_0x249745[_0xbbf0('0x39')]=qs[_0xbbf0('0x3a')](_0x311599['query'][_0xbbf0('0x3a')]);_0x249745[_0xbbf0('0x3b')]=qs[_0xbbf0('0x32')](_['pick'](_0x311599['query'],_0x532123['filters']),_0x1eb7b8);if(_0x311599[_0xbbf0('0x31')][_0xbbf0('0x3c')]){_0x249745['where']=_[_0xbbf0('0x3d')](_0x249745[_0xbbf0('0x3b')],{'$or':_[_0xbbf0('0x2b')](_0x1eb7b8,function(_0x311400){if(_0x311400[_0xbbf0('0x2e')]!=='VIRTUAL'){var _0x2dd69c={};_0x2dd69c[_0x311400[_0xbbf0('0x28')]]={'$like':'%'+_0x311599[_0xbbf0('0x31')][_0xbbf0('0x3c')]+'%'};return _0x2dd69c;}})});}_0x249745=_[_0xbbf0('0x3d')]({},_0x249745,_0x311599[_0xbbf0('0x3e')]);var _0x43bd64={'where':_0x249745['where']};return db[_0xbbf0('0x3f')][_0xbbf0('0x1d')](_0x43bd64)['then'](function(_0xc12468){_0x2b5c3d[_0xbbf0('0x1d')]=_0xc12468;if(_0x311599[_0xbbf0('0x31')][_0xbbf0('0x40')]){_0x249745[_0xbbf0('0x41')]=[{'all':!![]}];}return db[_0xbbf0('0x3f')][_0xbbf0('0x42')](_0x249745);})[_0xbbf0('0x25')](function(_0x57b542){_0x2b5c3d[_0xbbf0('0x43')]=_0x57b542;return _0x2b5c3d;})[_0xbbf0('0x25')](respondWithFilteredResult(_0x580b07,_0x249745))[_0xbbf0('0x44')](handleError(_0x580b07,null));};exports[_0xbbf0('0x45')]=function(_0x35fab1,_0x1c8da6){var _0x329c6f={'raw':!![],'where':{'id':_0x35fab1['params']['id']}},_0x2b512c={};_0x2b512c[_0xbbf0('0x2f')]=_[_0xbbf0('0x30')](db['VtigerField'][_0xbbf0('0x2c')]);_0x2b512c[_0xbbf0('0x31')]=_[_0xbbf0('0x30')](_0x35fab1[_0xbbf0('0x31')]);_0x2b512c[_0xbbf0('0x32')]=_[_0xbbf0('0x33')](_0x2b512c[_0xbbf0('0x2f')],_0x2b512c['query']);_0x329c6f[_0xbbf0('0x34')]=_[_0xbbf0('0x33')](_0x2b512c['model'],qs[_0xbbf0('0x35')](_0x35fab1['query']['fields']));_0x329c6f[_0xbbf0('0x34')]=_0x329c6f['attributes'][_0xbbf0('0x36')]?_0x329c6f[_0xbbf0('0x34')]:_0x2b512c[_0xbbf0('0x2f')];if(_0x35fab1[_0xbbf0('0x31')][_0xbbf0('0x40')]){_0x329c6f[_0xbbf0('0x41')]=[{'all':!![]}];}_0x329c6f=_[_0xbbf0('0x3d')]({},_0x329c6f,_0x35fab1[_0xbbf0('0x3e')]);return db['VtigerField'][_0xbbf0('0x46')](_0x329c6f)[_0xbbf0('0x25')](handleEntityNotFound(_0x1c8da6,null))[_0xbbf0('0x25')](respondWithResult(_0x1c8da6,null))[_0xbbf0('0x44')](handleError(_0x1c8da6,null));};exports[_0xbbf0('0x47')]=function(_0x1f5aba,_0x375dfc){return db[_0xbbf0('0x3f')]['create'](_0x1f5aba['body'],{})['then'](respondWithResult(_0x375dfc,0xc9))[_0xbbf0('0x44')](handleError(_0x375dfc,null));};exports[_0xbbf0('0x24')]=function(_0x5c3772,_0x1b4d5b){if(_0x5c3772['body']['id']){delete _0x5c3772[_0xbbf0('0x48')]['id'];}return db[_0xbbf0('0x3f')]['find']({'where':{'id':_0x5c3772[_0xbbf0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b4d5b,null))[_0xbbf0('0x25')](saveUpdates(_0x5c3772['body'],null))[_0xbbf0('0x25')](respondWithResult(_0x1b4d5b,null))[_0xbbf0('0x44')](handleError(_0x1b4d5b,null));};exports[_0xbbf0('0x4a')]=function(_0x10e3a8,_0x560ddf){return db[_0xbbf0('0x3f')]['find']({'where':{'id':_0x10e3a8[_0xbbf0('0x49')]['id']}})[_0xbbf0('0x25')](handleEntityNotFound(_0x560ddf,null))['then'](removeEntity(_0x560ddf,null))[_0xbbf0('0x44')](handleError(_0x560ddf,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5dfb717..db78215 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46a3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash'];(function(_0x28360f,_0x41149d){var _0x589eda=function(_0x17e0b9){while(--_0x17e0b9){_0x28360f['push'](_0x28360f['shift']());}};_0x589eda(++_0x41149d);}(_0x46a3,0x15f));var _0x346a=function(_0x5ad672,_0x104703){_0x5ad672=_0x5ad672-0x0;var _0x3e52b7=_0x46a3[_0x5ad672];return _0x3e52b7;};'use strict';var _=require(_0x346a('0x0'));var util=require(_0x346a('0x1'));var logger=require(_0x346a('0x2'))(_0x346a('0x3'));var moment=require(_0x346a('0x4'));var BPromise=require(_0x346a('0x5'));var rp=require(_0x346a('0x6'));var fs=require('fs');var path=require(_0x346a('0x7'));var rimraf=require('rimraf');var config=require(_0x346a('0x8'));var attributes=require(_0x346a('0x9'));module[_0x346a('0xa')]=function(_0x9088c6,_0x3e572e){return _0x9088c6[_0x346a('0xb')](_0x346a('0xc'),attributes,{'tableName':_0x346a('0xd'),'paranoid':![],'indexes':[{'name':_0x346a('0xe'),'fields':['idField',_0x346a('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bb7=['idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index'];(function(_0x2fe1de,_0x2ca69a){var _0x5d59fe=function(_0x439c80){while(--_0x439c80){_0x2fe1de['push'](_0x2fe1de['shift']());}};_0x5d59fe(++_0x2ca69a);}(_0x7bb7,0xd2));var _0x77bb=function(_0xa2884a,_0x3e95f8){_0xa2884a=_0xa2884a-0x0;var _0x55f93b=_0x7bb7[_0xa2884a];return _0x55f93b;};'use strict';var _=require('lodash');var util=require(_0x77bb('0x0'));var logger=require(_0x77bb('0x1'))(_0x77bb('0x2'));var moment=require(_0x77bb('0x3'));var BPromise=require(_0x77bb('0x4'));var rp=require(_0x77bb('0x5'));var fs=require('fs');var path=require(_0x77bb('0x6'));var rimraf=require(_0x77bb('0x7'));var config=require(_0x77bb('0x8'));var attributes=require(_0x77bb('0x9'));module[_0x77bb('0xa')]=function(_0x5acab6,_0x1728df){return _0x5acab6[_0x77bb('0xb')]('VtigerField',attributes,{'tableName':_0x77bb('0xc'),'paranoid':![],'indexes':[{'name':_0x77bb('0xd'),'fields':[_0x77bb('0xe'),_0x77bb('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 0daeffb..1f52368 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0055=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x0055,0x175));var _0x5005=function(_0x1b7700,_0x138acf){_0x1b7700=_0x1b7700-0x0;var _0x295d2d=_0x0055[_0x1b7700];return _0x295d2d;};'use strict';var _=require(_0x5005('0x0'));var util=require(_0x5005('0x1'));var moment=require(_0x5005('0x2'));var BPromise=require('bluebird');var rs=require(_0x5005('0x3'));var fs=require('fs');var Redis=require(_0x5005('0x4'));var db=require(_0x5005('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5005('0x6'))(_0x5005('0x7'));var config=require(_0x5005('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5005('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18057c,_0x454d75,_0x1f0471){return new BPromise(function(_0x1be066,_0x10c904){return client[_0x5005('0xa')](_0x18057c,_0x1f0471)[_0x5005('0xb')](function(_0x3a51dd){logger['info'](_0x5005('0xc'),_0x454d75,_0x5005('0xd'));logger['debug'](_0x5005('0xe'),_0x454d75,'request\x20sent',JSON[_0x5005('0xf')](_0x3a51dd));if(_0x3a51dd[_0x5005('0x10')]){if(_0x3a51dd[_0x5005('0x10')][_0x5005('0x11')]===0x1f4){logger[_0x5005('0x10')](_0x5005('0xc'),_0x454d75,_0x3a51dd[_0x5005('0x10')][_0x5005('0x12')]);return _0x10c904(_0x3a51dd[_0x5005('0x10')][_0x5005('0x12')]);}logger[_0x5005('0x10')](_0x5005('0xc'),_0x454d75,_0x3a51dd[_0x5005('0x10')][_0x5005('0x12')]);return _0x1be066(_0x3a51dd[_0x5005('0x10')][_0x5005('0x12')]);}else{logger[_0x5005('0x13')](_0x5005('0xc'),_0x454d75,_0x5005('0xd'));_0x1be066(_0x3a51dd[_0x5005('0x14')][_0x5005('0x12')]);}})[_0x5005('0x15')](function(_0x8d1b2a){logger['error'](_0x5005('0xc'),_0x454d75,_0x8d1b2a);_0x10c904(_0x8d1b2a);});});} \ No newline at end of file +var _0xd8ad=['../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x45c034,_0x4fa46c){var _0x4850bb=function(_0x88702a){while(--_0x88702a){_0x45c034['push'](_0x45c034['shift']());}};_0x4850bb(++_0x4fa46c);}(_0xd8ad,0x169));var _0xdd8a=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xd8ad[_0x1f5143];return _0x383a38;};'use strict';var _=require(_0xdd8a('0x0'));var util=require('util');var moment=require(_0xdd8a('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd8a('0x2'));var fs=require('fs');var Redis=require(_0xdd8a('0x3'));var db=require(_0xdd8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd8a('0x5'))(_0xdd8a('0x6'));var config=require(_0xdd8a('0x7'));var jayson=require(_0xdd8a('0x8'));var client=jayson[_0xdd8a('0x9')][_0xdd8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a41fd,_0x47298c,_0x2c8c74){return new BPromise(function(_0x2d32a8,_0x283f91){return client[_0xdd8a('0xb')](_0x4a41fd,_0x2c8c74)[_0xdd8a('0xc')](function(_0x4f836b){logger['info'](_0xdd8a('0xd'),_0x47298c,_0xdd8a('0xe'));logger[_0xdd8a('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x47298c,'request\x20sent',JSON[_0xdd8a('0x10')](_0x4f836b));if(_0x4f836b[_0xdd8a('0x11')]){if(_0x4f836b[_0xdd8a('0x11')][_0xdd8a('0x12')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x47298c,_0x4f836b[_0xdd8a('0x11')][_0xdd8a('0x13')]);return _0x283f91(_0x4f836b[_0xdd8a('0x11')]['message']);}logger[_0xdd8a('0x11')]('VtigerField,\x20%s,\x20%s',_0x47298c,_0x4f836b[_0xdd8a('0x11')]['message']);return _0x2d32a8(_0x4f836b[_0xdd8a('0x11')]['message']);}else{logger[_0xdd8a('0x14')]('VtigerField,\x20%s,\x20%s',_0x47298c,_0xdd8a('0xe'));_0x2d32a8(_0x4f836b[_0xdd8a('0x15')][_0xdd8a('0x13')]);}})[_0xdd8a('0x16')](function(_0xe07810){logger[_0xdd8a('0x11')](_0xdd8a('0xd'),_0x47298c,_0xe07810);_0x283f91(_0xe07810);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index abe1f26..ddf3b02 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba75=['destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','put','/:id','update','delete'];(function(_0x39cae9,_0x1ee5ad){var _0x4b18ea=function(_0x536465){while(--_0x536465){_0x39cae9['push'](_0x39cae9['shift']());}};_0x4b18ea(++_0x1ee5ad);}(_0xba75,0x1a5));var _0x5ba7=function(_0x47aded,_0xb76625){_0x47aded=_0x47aded-0x0;var _0x505e9a=_0xba75[_0x47aded];return _0x505e9a;};'use strict';var multer=require(_0x5ba7('0x0'));var util=require(_0x5ba7('0x1'));var path=require('path');var timeout=require(_0x5ba7('0x2'));var express=require(_0x5ba7('0x3'));var router=express['Router']();var fs_extra=require(_0x5ba7('0x4'));var auth=require(_0x5ba7('0x5'));var interaction=require(_0x5ba7('0x6'));var config=require(_0x5ba7('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x5ba7('0x8')]('/',auth[_0x5ba7('0x9')](),controller['index']);router[_0x5ba7('0x8')]('/:id',auth[_0x5ba7('0x9')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x5ba7('0xa')]);router['get'](_0x5ba7('0xb'),auth[_0x5ba7('0x9')](),controller[_0x5ba7('0xc')]);router['post']('/',auth[_0x5ba7('0x9')](),controller[_0x5ba7('0xd')]);router[_0x5ba7('0xe')](_0x5ba7('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5ba7('0x10')](_0x5ba7('0x11'),auth[_0x5ba7('0x9')](),controller[_0x5ba7('0x12')]);router[_0x5ba7('0x13')]('/:id',auth[_0x5ba7('0x9')](),controller[_0x5ba7('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf034=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x1e3c2f,_0x53b8d1){var _0x40ac24=function(_0x418cbc){while(--_0x418cbc){_0x1e3c2f['push'](_0x1e3c2f['shift']());}};_0x40ac24(++_0x53b8d1);}(_0xf034,0x195));var _0x4f03=function(_0x5dae0e,_0x5be21b){_0x5dae0e=_0x5dae0e-0x0;var _0x19f03d=_0xf034[_0x5dae0e];return _0x19f03d;};'use strict';var multer=require('multer');var util=require(_0x4f03('0x0'));var path=require(_0x4f03('0x1'));var timeout=require(_0x4f03('0x2'));var express=require(_0x4f03('0x3'));var router=express[_0x4f03('0x4')]();var fs_extra=require(_0x4f03('0x5'));var auth=require(_0x4f03('0x6'));var interaction=require(_0x4f03('0x7'));var config=require(_0x4f03('0x8'));var controller=require(_0x4f03('0x9'));router[_0x4f03('0xa')]('/',auth[_0x4f03('0xb')](),controller['index']);router['get'](_0x4f03('0xc'),auth[_0x4f03('0xb')](),controller[_0x4f03('0xd')]);router['get'](_0x4f03('0xe'),auth[_0x4f03('0xb')](),controller[_0x4f03('0xf')]);router['get'](_0x4f03('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x4f03('0x11')]('/',auth[_0x4f03('0xb')](),controller[_0x4f03('0x12')]);router['post'](_0x4f03('0xe'),auth['isAuthenticated'](),controller[_0x4f03('0x13')]);router[_0x4f03('0x14')](_0x4f03('0xc'),auth[_0x4f03('0xb')](),controller[_0x4f03('0x15')]);router['delete'](_0x4f03('0xc'),auth[_0x4f03('0xb')](),controller[_0x4f03('0x16')]);module[_0x4f03('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 54f71b1..632e37c 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29b1=['token','integrationTab','newTab','STRING','username','remoteUri','ENUM','password'];(function(_0x5d662c,_0x4a585c){var _0x3bc3e3=function(_0x3cb678){while(--_0x3cb678){_0x5d662c['push'](_0x5d662c['shift']());}};_0x3bc3e3(++_0x4a585c);}(_0x29b1,0x13b));var _0x129b=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x29b1[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x129b('0x0')]},'description':{'type':Sequelize[_0x129b('0x0')]},'username':{'type':Sequelize[_0x129b('0x0')],'unique':_0x129b('0x1')},'password':{'type':Sequelize[_0x129b('0x0')]},'token':{'type':Sequelize[_0x129b('0x0')]},'remoteUri':{'type':Sequelize[_0x129b('0x0')],'unique':_0x129b('0x2')},'authType':{'type':Sequelize[_0x129b('0x3')](_0x129b('0x4'),_0x129b('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x129b('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x129b('0x6'),_0x129b('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x71ab=['newTab','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0x4feeeb,_0x3ed121){var _0xc30a8a=function(_0x501658){while(--_0x501658){_0x4feeeb['push'](_0x4feeeb['shift']());}};_0xc30a8a(++_0x3ed121);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb71a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb71a('0x2')},'password':{'type':Sequelize[_0xb71a('0x1')]},'token':{'type':Sequelize[_0xb71a('0x1')]},'remoteUri':{'type':Sequelize[_0xb71a('0x1')],'unique':_0xb71a('0x3')},'authType':{'type':Sequelize[_0xb71a('0x4')](_0xb71a('0x5'),_0xb71a('0x6')),'defaultValue':_0xb71a('0x5')},'serverUrl':{'type':Sequelize[_0xb71a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x4')](_0xb71a('0x7'),_0xb71a('0x8')),'defaultValue':_0xb71a('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index db8f2bf..1582567 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x709bff,_0xd81caa){var _0x401822=function(_0x30f4b5){while(--_0x30f4b5){_0x709bff['push'](_0x709bff['shift']());}};_0x401822(++_0xd81caa);}(_0x91a7,0xe7));var _0x791a=function(_0x4fb74c,_0x32ab4a){_0x4fb74c=_0x4fb74c-0x0;var _0x1400f2=_0x91a7[_0x4fb74c];return _0x1400f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file +var _0xea28=['stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','length','find','catch','create','body','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','authType','%s:%s','token','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x2245f8,_0x36f746){var _0x2c9833=function(_0x2532d8){while(--_0x2532d8){_0x2245f8['push'](_0x2245f8['shift']());}};_0x2c9833(++_0x36f746);}(_0xea28,0x13a));var _0x8ea2=function(_0x2beaac,_0x50b730){_0x2beaac=_0x2beaac-0x0;var _0xc96281=_0xea28[_0x2beaac];return _0xc96281;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];var integrations=require(_0x8ea2('0x1b'));function respondWithStatusCode(_0x10aead,_0xe47c0e){_0xe47c0e=_0xe47c0e||0xcc;return function(_0x5e662e){if(_0x5e662e){return _0x10aead[_0x8ea2('0x1c')](_0xe47c0e);}return _0x10aead['status'](_0xe47c0e)['end']();};}function respondWithResult(_0x772bad,_0x4726a7){_0x4726a7=_0x4726a7||0xc8;return function(_0x416bae){if(_0x416bae){return _0x772bad[_0x8ea2('0x1d')](_0x4726a7)[_0x8ea2('0x1e')](_0x416bae);}};}function respondWithFilteredResult(_0xbb9bd1,_0x3cff96){return function(_0x11f5e8){if(_0x11f5e8){var _0x474873=typeof _0x3cff96[_0x8ea2('0x1f')]===_0x8ea2('0x20')&&typeof _0x3cff96[_0x8ea2('0x21')]===_0x8ea2('0x20');var _0xaa8abf=_0x11f5e8[_0x8ea2('0x22')];var _0x174ef2=_0x474873?0x0:_0x3cff96[_0x8ea2('0x1f')];var _0x2a0329=_0x474873?_0x11f5e8[_0x8ea2('0x22')]:_0x3cff96[_0x8ea2('0x1f')]+_0x3cff96[_0x8ea2('0x21')];var _0x287597;if(_0x2a0329>=_0xaa8abf){_0x2a0329=_0xaa8abf;_0x287597=0xc8;}else{_0x287597=0xce;}_0xbb9bd1['status'](_0x287597);return _0xbb9bd1['set'](_0x8ea2('0x23'),_0x174ef2+'-'+_0x2a0329+'/'+_0xaa8abf)[_0x8ea2('0x1e')](_0x11f5e8);}return null;};}function patchUpdates(_0x29151a){return function(_0x5ebc04){try{jsonpatch[_0x8ea2('0x24')](_0x5ebc04,_0x29151a,!![]);}catch(_0x218bd0){return BPromise['reject'](_0x218bd0);}return _0x5ebc04[_0x8ea2('0x25')]();};}function saveUpdates(_0x283f00,_0x37229a){return function(_0x9f9548){if(_0x9f9548){return _0x9f9548[_0x8ea2('0x26')](_0x283f00)[_0x8ea2('0x27')](function(_0x199417){return _0x199417;});}return null;};}function removeEntity(_0x1e4cc9,_0x18ec34){return function(_0x4d5030){if(_0x4d5030){return _0x4d5030[_0x8ea2('0x28')]()['then'](function(){_0x1e4cc9[_0x8ea2('0x1d')](0xcc)[_0x8ea2('0x29')]();});}};}function handleEntityNotFound(_0x29b38f,_0x4e2106){return function(_0x53ed43){if(!_0x53ed43){_0x29b38f[_0x8ea2('0x1c')](0x194);}return _0x53ed43;};}function handleError(_0x4dc7bf,_0x200a49){_0x200a49=_0x200a49||0x1f4;return function(_0x4e786d){logger[_0x8ea2('0x2a')](_0x4e786d[_0x8ea2('0x2b')]);if(_0x4e786d[_0x8ea2('0x2c')]){delete _0x4e786d[_0x8ea2('0x2c')];}_0x4dc7bf['status'](_0x200a49)['send'](_0x4e786d);};}exports[_0x8ea2('0x2d')]=function(_0x4da5b3,_0x4a9875){var _0x287078={},_0x24f187={},_0x41f482={'count':0x0,'rows':[]};var _0x307c74=_[_0x8ea2('0x2e')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')],function(_0x19e868){return{'name':_0x19e868[_0x8ea2('0x31')],'type':_0x19e868['type']['key']};});_0x24f187[_0x8ea2('0x32')]=_[_0x8ea2('0x2e')](_0x307c74,'name');_0x24f187['query']=_[_0x8ea2('0x33')](_0x4da5b3['query']);_0x24f187[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x24f187['model'],_0x24f187[_0x8ea2('0x36')]);_0x287078[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x24f187['model'],qs['fields'](_0x4da5b3['query'][_0x8ea2('0x38')]));_0x287078[_0x8ea2('0x37')]=_0x287078[_0x8ea2('0x37')]['length']?_0x287078[_0x8ea2('0x37')]:_0x24f187[_0x8ea2('0x32')];if(!_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x287078[_0x8ea2('0x21')]=qs[_0x8ea2('0x21')](_0x4da5b3[_0x8ea2('0x36')]['limit']);_0x287078[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}_0x287078['order']=qs[_0x8ea2('0x3b')](_0x4da5b3['query'][_0x8ea2('0x3b')]);_0x287078[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x4da5b3['query'],_0x24f187[_0x8ea2('0x34')]),_0x307c74);if(_0x4da5b3['query']['filter']){_0x287078[_0x8ea2('0x3c')]=_['merge'](_0x287078[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x307c74,function(_0x1c229d){if(_0x1c229d[_0x8ea2('0x3e')]!==_0x8ea2('0x3f')){var _0x4ae536={};_0x4ae536[_0x1c229d[_0x8ea2('0x2c')]]={'$like':'%'+_0x4da5b3['query'][_0x8ea2('0x40')]+'%'};return _0x4ae536;}})});}_0x287078=_[_0x8ea2('0x41')]({},_0x287078,_0x4da5b3[_0x8ea2('0x42')]);var _0x3995ff={'where':_0x287078['where']};return db[_0x8ea2('0x2f')]['count'](_0x3995ff)[_0x8ea2('0x27')](function(_0x5ba351){_0x41f482[_0x8ea2('0x22')]=_0x5ba351;if(_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x287078[_0x8ea2('0x44')]=[{'all':!![]}];}return db[_0x8ea2('0x2f')][_0x8ea2('0x45')](_0x287078);})[_0x8ea2('0x27')](function(_0x478d5c){_0x41f482['rows']=_0x478d5c;return _0x41f482;})[_0x8ea2('0x27')](respondWithFilteredResult(_0x4a9875,_0x287078))['catch'](handleError(_0x4a9875,null));};exports['show']=function(_0x59e2fa,_0x3cbc09){var _0x5d9ba0={'raw':![],'where':{'id':_0x59e2fa[_0x8ea2('0x46')]['id']}},_0x40a532={};_0x40a532[_0x8ea2('0x32')]=_[_0x8ea2('0x33')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')]);_0x40a532[_0x8ea2('0x36')]=_[_0x8ea2('0x33')](_0x59e2fa['query']);_0x40a532[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],_0x40a532['query']);_0x5d9ba0[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],qs[_0x8ea2('0x38')](_0x59e2fa[_0x8ea2('0x36')]['fields']));_0x5d9ba0[_0x8ea2('0x37')]=_0x5d9ba0[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x5d9ba0['attributes']:_0x40a532[_0x8ea2('0x32')];if(_0x59e2fa[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x5d9ba0[_0x8ea2('0x44')]=[{'all':!![]}];}_0x5d9ba0=_[_0x8ea2('0x41')]({},_0x5d9ba0,_0x59e2fa[_0x8ea2('0x42')]);return db[_0x8ea2('0x2f')][_0x8ea2('0x48')](_0x5d9ba0)[_0x8ea2('0x27')](handleEntityNotFound(_0x3cbc09,null))[_0x8ea2('0x27')](respondWithResult(_0x3cbc09,null))[_0x8ea2('0x49')](handleError(_0x3cbc09,null));};exports[_0x8ea2('0x4a')]=function(_0x220970,_0x12e81f){return db['ZendeskAccount'][_0x8ea2('0x4a')](_0x220970[_0x8ea2('0x4b')],{})[_0x8ea2('0x27')](respondWithResult(_0x12e81f,0xc9))[_0x8ea2('0x49')](handleError(_0x12e81f,null));};exports[_0x8ea2('0x26')]=function(_0x1daa25,_0x11b3ef){if(_0x1daa25[_0x8ea2('0x4b')]['id']){delete _0x1daa25['body']['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x1daa25[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x11b3ef,null))['then'](saveUpdates(_0x1daa25[_0x8ea2('0x4b')],null))[_0x8ea2('0x27')](respondWithResult(_0x11b3ef,null))[_0x8ea2('0x49')](handleError(_0x11b3ef,null));};exports['destroy']=function(_0x3d86f3,_0x315b5d){return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x3d86f3[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x315b5d,null))['then'](removeEntity(_0x315b5d,null))[_0x8ea2('0x49')](handleError(_0x315b5d,null));};exports[_0x8ea2('0x4c')]=function(_0x1b8c4b,_0x5e4268,_0x18cbe9){var _0x100e29={};var _0x442dce={};var _0x54c9d7;var _0x5c6524;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1b8c4b['params']['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x5e4268,null))[_0x8ea2('0x27')](function(_0x5f56f8){if(_0x5f56f8){_0x54c9d7=_0x5f56f8;_0x442dce['model']=_[_0x8ea2('0x33')](db[_0x8ea2('0x4d')][_0x8ea2('0x30')]);_0x442dce['query']=_[_0x8ea2('0x33')](_0x1b8c4b[_0x8ea2('0x36')]);_0x442dce['filters']=_[_0x8ea2('0x35')](_0x442dce[_0x8ea2('0x32')],_0x442dce[_0x8ea2('0x36')]);_0x100e29[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x442dce['model'],qs['fields'](_0x1b8c4b['query'][_0x8ea2('0x38')]));_0x100e29[_0x8ea2('0x37')]=_0x100e29[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x100e29[_0x8ea2('0x37')]:_0x442dce[_0x8ea2('0x32')];_0x100e29[_0x8ea2('0x4e')]=qs['sort'](_0x1b8c4b['query']['sort']);_0x100e29[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x1b8c4b[_0x8ea2('0x36')],_0x442dce['filters']));if(_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x40')]){_0x100e29['where']=_[_0x8ea2('0x41')](_0x100e29[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x100e29[_0x8ea2('0x37')],function(_0x3de1a2){var _0x48c1de={};_0x48c1de[_0x3de1a2]={'$like':'%'+_0x1b8c4b['query']['filter']+'%'};return _0x48c1de;})});}_0x100e29=_[_0x8ea2('0x41')]({},_0x100e29,_0x1b8c4b[_0x8ea2('0x42')]);return _0x54c9d7[_0x8ea2('0x4c')](_0x100e29);}})[_0x8ea2('0x27')](function(_0x3c44ef){if(_0x3c44ef){_0x5c6524=_0x3c44ef['length'];if(!_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x100e29[_0x8ea2('0x21')]=qs['limit'](_0x1b8c4b[_0x8ea2('0x36')]['limit']);_0x100e29[_0x8ea2('0x1f')]=qs['offset'](_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}return _0x54c9d7['getConfigurations'](_0x100e29);}})['then'](function(_0x1d0326){if(_0x1d0326){return _0x1d0326?{'count':_0x5c6524,'rows':_0x1d0326}:null;}})['then'](respondWithResult(_0x5e4268,null))[_0x8ea2('0x49')](handleError(_0x5e4268,null));};exports[_0x8ea2('0x4f')]=function(_0x1c5489,_0x23185e,_0x4dab8f){if(_0x1c5489[_0x8ea2('0x4b')]['id']){delete _0x1c5489[_0x8ea2('0x4b')]['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x1c5489[_0x8ea2('0x46')]['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x23185e,null))[_0x8ea2('0x27')](function(_0x3a78c9){if(_0x3a78c9){_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x51')]=_0x3a78c9['id'];_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x52')]=integrations['getSubjects'](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x54')]=integrations[_0x8ea2('0x55')](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);return db[_0x8ea2('0x4d')]['create'](_0x1c5489[_0x8ea2('0x4b')],{'include':[{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x52')},{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x54')}]});}return null;})['then'](respondWithResult(_0x23185e,null))['catch'](handleError(_0x23185e,null));};exports['getFields']=function(_0x17f2f2,_0xe8b3ed,_0x380066){var _0x31bda0='';return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x17f2f2['params']['id']},'attributes':['id',_0x8ea2('0x57'),_0x8ea2('0x58'),'token','authType',_0x8ea2('0x59')]})[_0x8ea2('0x27')](handleEntityNotFound(_0xe8b3ed,null))[_0x8ea2('0x27')](function(_0x289e74){if(_0x289e74){_0x31bda0=_0x289e74[_0x8ea2('0x59')];var _0x32a8f2=_0x31bda0[_0x8ea2('0x5a')](-0x1);if(_0x32a8f2==='/'){_0x31bda0=_0x31bda0['substring'](0x0,_0x31bda0[_0x8ea2('0x5b')](_0x32a8f2));}var _0x3fa2c8={'method':_0x8ea2('0x5c'),'uri':util[_0x8ea2('0x5d')]('%s/%s',_0x31bda0,_0x8ea2('0x5e')),'json':!![]};switch(_0x289e74[_0x8ea2('0x5f')]){case _0x8ea2('0x58'):_0x3fa2c8['headers']={'Authorization':util[_0x8ea2('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0x8ea2('0x60'),_0x289e74[_0x8ea2('0x57')],_0x289e74['password']))['toString']('base64'))};break;case _0x8ea2('0x61'):_0x3fa2c8['headers']={'Authorization':util['format'](_0x8ea2('0x62'),new Buffer(util[_0x8ea2('0x5d')](_0x8ea2('0x63'),_0x289e74[_0x8ea2('0x57')],_0x289e74[_0x8ea2('0x61')]))[_0x8ea2('0x64')](_0x8ea2('0x65')))};break;default:throw new db[(_0x8ea2('0x66'))][(_0x8ea2('0x67'))](_0x8ea2('0x68'));}return rp(_0x3fa2c8);}})[_0x8ea2('0x27')](function(_0x15eab7){if(_0x15eab7){var _0x1961a9=[_0x8ea2('0x69'),'description',_0x8ea2('0x6a'),_0x8ea2('0x6b')];_[_0x8ea2('0x6c')](_0x15eab7['ticket_fields'],function(_0x1807bb){return _0x1961a9['includes'](_0x1807bb[_0x8ea2('0x3e')]);});return{'count':_0x15eab7['ticket_fields'][_0x8ea2('0x47')],'rows':_['map'](_0x15eab7[_0x8ea2('0x5e')],function(_0x165052){return{'id':_0x165052['id'],'name':_0x165052['position']>0x7?_0x165052[_0x8ea2('0x6d')]:_0x165052['type'],'custom':_0x165052[_0x8ea2('0x6e')]>0x7?!![]:![],'options':_0x165052[_0x8ea2('0x6f')]?_0x165052[_0x8ea2('0x6f')]:_0x165052[_0x8ea2('0x70')]?_0x165052[_0x8ea2('0x70')]:[]};})};}})['then'](respondWithResult(_0xe8b3ed,null))['catch'](function(_0x39d0d7){var _0x4b7e5e=_0x17f2f2[_0x8ea2('0x36')][_0x8ea2('0x71')]?0x1f4:_0x39d0d7[_0x8ea2('0x72')]||0x1f4;logger[_0x8ea2('0x2a')](_0x8ea2('0x73'),_0x8ea2('0x74'),_0x4b7e5e,JSON['stringify'](_0x39d0d7));delete _0x39d0d7['name'];if(_0x4b7e5e===0x191){_0x4b7e5e=0x190;}_0xe8b3ed['status'](_0x4b7e5e)[_0x8ea2('0x75')](_0x17f2f2['query'][_0x8ea2('0x71')]?{'message':_0x8ea2('0x76'),'statusCode':_0x39d0d7[_0x8ea2('0x72')]}:_0x39d0d7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f1deb9f..6037806 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0640=['int_zendesk_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x5dd56c,_0x24fd06){var _0x4157ac=function(_0x2b3c72){while(--_0x2b3c72){_0x5dd56c['push'](_0x5dd56c['shift']());}};_0x4157ac(++_0x24fd06);}(_0x0640,0x112));var _0x0064=function(_0x4bccd5,_0x164b22){_0x4bccd5=_0x4bccd5-0x0;var _0x18e6af=_0x0640[_0x4bccd5];return _0x18e6af;};'use strict';var _=require(_0x0064('0x0'));var util=require(_0x0064('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0064('0x2'));var BPromise=require(_0x0064('0x3'));var rp=require(_0x0064('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0064('0x5'));var config=require(_0x0064('0x6'));var attributes=require(_0x0064('0x7'));var integrations=require(_0x0064('0x8'));module[_0x0064('0x9')]=function(_0x1e3908,_0x49194c){return _0x1e3908[_0x0064('0xa')](_0x0064('0xb'),attributes,{'tableName':_0x0064('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb16d=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3828d2,_0x2bab59){var _0x469d22=function(_0x31a7ac){while(--_0x31a7ac){_0x3828d2['push'](_0x3828d2['shift']());}};_0x469d22(++_0x2bab59);}(_0xb16d,0xae));var _0xdb16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb16d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb16('0x0'));var util=require(_0xdb16('0x1'));var logger=require(_0xdb16('0x2'))('api');var moment=require(_0xdb16('0x3'));var BPromise=require(_0xdb16('0x4'));var rp=require(_0xdb16('0x5'));var fs=require('fs');var path=require(_0xdb16('0x6'));var rimraf=require(_0xdb16('0x7'));var config=require('../../config/environment');var attributes=require(_0xdb16('0x8'));var integrations=require(_0xdb16('0x9'));module[_0xdb16('0xa')]=function(_0x29459b,_0x5a7060){return _0x29459b[_0xdb16('0xb')](_0xdb16('0xc'),attributes,{'tableName':_0xdb16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 5485d81..3a12d9f 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5940=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowZendeskAccount','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request'];(function(_0x5542fe,_0xe5e543){var _0x1556f6=function(_0x3fe30c){while(--_0x3fe30c){_0x5542fe['push'](_0x5542fe['shift']());}};_0x1556f6(++_0xe5e543);}(_0x5940,0x78));var _0x0594=function(_0x56b927,_0x43b48f){_0x56b927=_0x56b927-0x0;var _0x2f3392=_0x5940[_0x56b927];return _0x2f3392;};'use strict';var _=require(_0x0594('0x0'));var util=require('util');var moment=require(_0x0594('0x1'));var BPromise=require('bluebird');var rs=require(_0x0594('0x2'));var fs=require('fs');var Redis=require(_0x0594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0594('0x4'));var logger=require('../../config/logger')(_0x0594('0x5'));var config=require('../../config/environment');var jayson=require(_0x0594('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36f444,_0x28240e,_0x2262b9){return new BPromise(function(_0x57071c,_0x1eb345){return client[_0x0594('0x7')](_0x36f444,_0x2262b9)[_0x0594('0x8')](function(_0x27f9d0){logger[_0x0594('0x9')](_0x0594('0xa'),_0x28240e,_0x0594('0xb'));logger[_0x0594('0xc')](_0x0594('0xd'),_0x28240e,_0x0594('0xb'),JSON[_0x0594('0xe')](_0x27f9d0));if(_0x27f9d0[_0x0594('0xf')]){if(_0x27f9d0[_0x0594('0xf')][_0x0594('0x10')]===0x1f4){logger['error'](_0x0594('0xa'),_0x28240e,_0x27f9d0[_0x0594('0xf')]['message']);return _0x1eb345(_0x27f9d0[_0x0594('0xf')][_0x0594('0x11')]);}logger[_0x0594('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x28240e,_0x27f9d0[_0x0594('0xf')]['message']);return _0x57071c(_0x27f9d0[_0x0594('0xf')][_0x0594('0x11')]);}else{logger[_0x0594('0x9')](_0x0594('0xa'),_0x28240e,'request\x20sent');_0x57071c(_0x27f9d0[_0x0594('0x12')][_0x0594('0x11')]);}})[_0x0594('0x13')](function(_0x4d5b92){logger[_0x0594('0xf')](_0x0594('0xa'),_0x28240e,_0x4d5b92);_0x1eb345(_0x4d5b92);});});}exports[_0x0594('0x14')]=function(_0x5357da){var _0x855c77=this;return new Promise(function(_0x35a779,_0x10adec){return db[_0x0594('0x15')][_0x0594('0x16')]({'raw':_0x5357da[_0x0594('0x17')]?_0x5357da[_0x0594('0x17')][_0x0594('0x18')]===undefined?!![]:![]:!![],'where':_0x5357da[_0x0594('0x17')]?_0x5357da[_0x0594('0x17')][_0x0594('0x19')]||null:null,'attributes':_0x5357da[_0x0594('0x17')]?_0x5357da['options'][_0x0594('0x1a')]||null:null,'limit':_0x5357da[_0x0594('0x17')]?_0x5357da['options']['limit']||null:null,'include':_0x5357da['options']?_0x5357da[_0x0594('0x17')][_0x0594('0x1b')]?_[_0x0594('0x1c')](_0x5357da[_0x0594('0x17')]['include'],function(_0x5e9978){return{'model':db[_0x5e9978[_0x0594('0x1d')]],'as':_0x5e9978['as'],'attributes':_0x5e9978[_0x0594('0x1a')],'include':_0x5e9978[_0x0594('0x1b')]?_['map'](_0x5e9978[_0x0594('0x1b')],function(_0xc0984c){return{'model':db[_0xc0984c['model']],'as':_0xc0984c['as'],'attributes':_0xc0984c['attributes'],'include':_0xc0984c[_0x0594('0x1b')]?_[_0x0594('0x1c')](_0xc0984c['include'],function(_0x5776bf){return{'model':db[_0x5776bf[_0x0594('0x1d')]],'as':_0x5776bf['as'],'attributes':_0x5776bf[_0x0594('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0594('0x8')](function(_0x1ff129){logger['info'](_0x0594('0x14'),_0x5357da);logger[_0x0594('0xc')](_0x0594('0x14'),_0x5357da,JSON[_0x0594('0xe')](_0x1ff129));_0x35a779(_0x1ff129);})[_0x0594('0x13')](function(_0x37b0a4){logger[_0x0594('0xf')](_0x0594('0x14'),_0x37b0a4[_0x0594('0x11')],_0x5357da);_0x10adec(_0x855c77['error'](0x1f4,_0x37b0a4[_0x0594('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x326be5){var _0x1963c5=this;return new Promise(function(_0x1686c9,_0x4d22bb){return db['ZendeskAccount'][_0x0594('0x1e')]({'raw':_0x326be5[_0x0594('0x17')]?_0x326be5[_0x0594('0x17')][_0x0594('0x18')]===undefined?!![]:![]:!![],'where':_0x326be5['options']?_0x326be5['options'][_0x0594('0x19')]||null:null,'attributes':_0x326be5[_0x0594('0x17')]?_0x326be5['options']['attributes']||null:null,'include':_0x326be5[_0x0594('0x17')]?_0x326be5[_0x0594('0x17')]['include']?_[_0x0594('0x1c')](_0x326be5['options'][_0x0594('0x1b')],function(_0x40d11e){return{'model':db[_0x40d11e[_0x0594('0x1d')]],'as':_0x40d11e['as'],'attributes':_0x40d11e[_0x0594('0x1a')],'include':_0x40d11e[_0x0594('0x1b')]?_[_0x0594('0x1c')](_0x40d11e[_0x0594('0x1b')],function(_0x27e1d6){return{'model':db[_0x27e1d6[_0x0594('0x1d')]],'as':_0x27e1d6['as'],'attributes':_0x27e1d6[_0x0594('0x1a')],'include':_0x27e1d6[_0x0594('0x1b')]?_[_0x0594('0x1c')](_0x27e1d6[_0x0594('0x1b')],function(_0x5e9a4d){return{'model':db[_0x5e9a4d['model']],'as':_0x5e9a4d['as'],'attributes':_0x5e9a4d[_0x0594('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1499da){logger[_0x0594('0x9')](_0x0594('0x1f'),_0x326be5);logger[_0x0594('0xc')]('ShowZendeskAccount',_0x326be5,JSON['stringify'](_0x1499da));_0x1686c9(_0x1499da);})['catch'](function(_0x7dfdb2){logger['error']('ShowZendeskAccount',_0x7dfdb2[_0x0594('0x11')],_0x326be5);_0x4d22bb(_0x1963c5[_0x0594('0xf')](0x1f4,_0x7dfdb2['message']));});});}; \ No newline at end of file +var _0x04f9=['attributes','catch','ZendeskAccount','ShowZendeskAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','raw','options','where','limit','include','map','model'];(function(_0x35186d,_0x35f5f1){var _0x221d3b=function(_0x14ac3c){while(--_0x14ac3c){_0x35186d['push'](_0x35186d['shift']());}};_0x221d3b(++_0x35f5f1);}(_0x04f9,0xb3));var _0x904f=function(_0xcbd8e,_0x1b35d8){_0xcbd8e=_0xcbd8e-0x0;var _0x29ff08=_0x04f9[_0xcbd8e];return _0x29ff08;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var moment=require(_0x904f('0x1'));var BPromise=require(_0x904f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x904f('0x3'));var db=require(_0x904f('0x4'))['db'];var utils=require(_0x904f('0x5'));var logger=require(_0x904f('0x6'))(_0x904f('0x7'));var config=require(_0x904f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x904f('0x9')][_0x904f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175c38,_0x21dce4,_0x34cbd7){return new BPromise(function(_0x506239,_0xa90c3f){return client[_0x904f('0xb')](_0x175c38,_0x34cbd7)[_0x904f('0xc')](function(_0x4f8d32){logger[_0x904f('0xd')](_0x904f('0xe'),_0x21dce4,_0x904f('0xf'));logger[_0x904f('0x10')](_0x904f('0x11'),_0x21dce4,_0x904f('0xf'),JSON[_0x904f('0x12')](_0x4f8d32));if(_0x4f8d32[_0x904f('0x13')]){if(_0x4f8d32[_0x904f('0x13')][_0x904f('0x14')]===0x1f4){logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0xa90c3f(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0x506239(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}else{logger[_0x904f('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x21dce4,'request\x20sent');_0x506239(_0x4f8d32[_0x904f('0x16')][_0x904f('0x15')]);}})['catch'](function(_0x58c4d6){logger['error'](_0x904f('0xe'),_0x21dce4,_0x58c4d6);_0xa90c3f(_0x58c4d6);});});}exports[_0x904f('0x17')]=function(_0x4eb784){var _0x43cf3e=this;return new Promise(function(_0x502f80,_0x5327b5){return db['ZendeskAccount']['findAll']({'raw':_0x4eb784['options']?_0x4eb784['options'][_0x904f('0x18')]===undefined?!![]:![]:!![],'where':_0x4eb784[_0x904f('0x19')]?_0x4eb784['options'][_0x904f('0x1a')]||null:null,'attributes':_0x4eb784[_0x904f('0x19')]?_0x4eb784[_0x904f('0x19')]['attributes']||null:null,'limit':_0x4eb784[_0x904f('0x19')]?_0x4eb784[_0x904f('0x19')][_0x904f('0x1b')]||null:null,'include':_0x4eb784[_0x904f('0x19')]?_0x4eb784[_0x904f('0x19')][_0x904f('0x1c')]?_[_0x904f('0x1d')](_0x4eb784[_0x904f('0x19')][_0x904f('0x1c')],function(_0x1f3c74){return{'model':db[_0x1f3c74[_0x904f('0x1e')]],'as':_0x1f3c74['as'],'attributes':_0x1f3c74[_0x904f('0x1f')],'include':_0x1f3c74[_0x904f('0x1c')]?_[_0x904f('0x1d')](_0x1f3c74[_0x904f('0x1c')],function(_0x57dbcc){return{'model':db[_0x57dbcc['model']],'as':_0x57dbcc['as'],'attributes':_0x57dbcc[_0x904f('0x1f')],'include':_0x57dbcc[_0x904f('0x1c')]?_['map'](_0x57dbcc[_0x904f('0x1c')],function(_0x1b8f20){return{'model':db[_0x1b8f20['model']],'as':_0x1b8f20['as'],'attributes':_0x1b8f20[_0x904f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x904f('0xc')](function(_0x3fcb62){logger[_0x904f('0xd')](_0x904f('0x17'),_0x4eb784);logger[_0x904f('0x10')](_0x904f('0x17'),_0x4eb784,JSON[_0x904f('0x12')](_0x3fcb62));_0x502f80(_0x3fcb62);})[_0x904f('0x20')](function(_0x3aa868){logger['error'](_0x904f('0x17'),_0x3aa868['message'],_0x4eb784);_0x5327b5(_0x43cf3e[_0x904f('0x13')](0x1f4,_0x3aa868[_0x904f('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x56ac39){var _0x39fd1d=this;return new Promise(function(_0x5353d5,_0x7d6015){return db[_0x904f('0x21')]['find']({'raw':_0x56ac39[_0x904f('0x19')]?_0x56ac39['options'][_0x904f('0x18')]===undefined?!![]:![]:!![],'where':_0x56ac39[_0x904f('0x19')]?_0x56ac39[_0x904f('0x19')][_0x904f('0x1a')]||null:null,'attributes':_0x56ac39[_0x904f('0x19')]?_0x56ac39[_0x904f('0x19')]['attributes']||null:null,'include':_0x56ac39['options']?_0x56ac39[_0x904f('0x19')][_0x904f('0x1c')]?_['map'](_0x56ac39[_0x904f('0x19')][_0x904f('0x1c')],function(_0x10a87a){return{'model':db[_0x10a87a[_0x904f('0x1e')]],'as':_0x10a87a['as'],'attributes':_0x10a87a[_0x904f('0x1f')],'include':_0x10a87a[_0x904f('0x1c')]?_['map'](_0x10a87a[_0x904f('0x1c')],function(_0x3d1edd){return{'model':db[_0x3d1edd[_0x904f('0x1e')]],'as':_0x3d1edd['as'],'attributes':_0x3d1edd[_0x904f('0x1f')],'include':_0x3d1edd['include']?_[_0x904f('0x1d')](_0x3d1edd[_0x904f('0x1c')],function(_0x435f99){return{'model':db[_0x435f99['model']],'as':_0x435f99['as'],'attributes':_0x435f99[_0x904f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x904f('0xc')](function(_0xeb03c9){logger[_0x904f('0xd')](_0x904f('0x22'),_0x56ac39);logger[_0x904f('0x10')](_0x904f('0x22'),_0x56ac39,JSON[_0x904f('0x12')](_0xeb03c9));_0x5353d5(_0xeb03c9);})[_0x904f('0x20')](function(_0x5c9a07){logger[_0x904f('0x13')](_0x904f('0x22'),_0x5c9a07[_0x904f('0x15')],_0x56ac39);_0x7d6015(_0x39fd1d[_0x904f('0x13')](0x1f4,_0x5c9a07['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b1a9cb2..4d23909 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1ac146,_0x1091e6){_0x1ac146=_0x1ac146-0x0;var _0x4f9658=_0x9ffd[_0x1ac146];return _0x4f9658;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x42973d,_0x157bba){var _0x492844=function(_0xe1abe){while(--_0xe1abe){_0x42973d['push'](_0x42973d['shift']());}};_0x492844(++_0x157bba);}(_0xe706,0xa3));var _0x6e70=function(_0x45cb2b,_0x285349){_0x45cb2b=_0x45cb2b-0x0;var _0x9411a6=_0xe706[_0x45cb2b];return _0x9411a6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5791493..eb2fff7 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd747=['STRING','sequelize'];(function(_0x3dd822,_0x3b9fed){var _0x4f58d0=function(_0x41be33){while(--_0x41be33){_0x3dd822['push'](_0x3dd822['shift']());}};_0x4f58d0(++_0x3b9fed);}(_0xd747,0x1d1));var _0x7d74=function(_0x393154,_0x19e817){_0x393154=_0x393154-0x0;var _0x3facfe=_0xd747[_0x393154];return _0x3facfe;};'use strict';var Sequelize=require(_0x7d74('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d74('0x1')]},'description':{'type':Sequelize[_0x7d74('0x1')]}}; \ No newline at end of file +var _0x35a3=['STRING','sequelize','exports'];(function(_0x516e99,_0x509258){var _0x5802f4=function(_0x11f8fe){while(--_0x11f8fe){_0x516e99['push'](_0x516e99['shift']());}};_0x5802f4(++_0x509258);}(_0x35a3,0x160));var _0x335a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x35a3[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x335a('0x0'));module[_0x335a('0x1')]={'name':{'type':Sequelize[_0x335a('0x2')]},'description':{'type':Sequelize[_0x335a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index a1fe096..32d53fe 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x963a=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','name','send','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','create','catch','update','body','find','findOne','ZendeskField','getFields','nolimit','getSubjects','order','getDescriptions','getTags','Tag','setTags','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x963a,0x132));var _0xa963=function(_0xa32039,_0x31329b){_0xa32039=_0xa32039-0x0;var _0x66dfc8=_0x963a[_0xa32039];return _0x66dfc8;};'use strict';var emlformat=require(_0xa963('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa963('0x1'));var rp=require(_0xa963('0x2'));var moment=require(_0xa963('0x3'));var BPromise=require(_0xa963('0x4'));var Mustache=require(_0xa963('0x5'));var util=require(_0xa963('0x6'));var path=require(_0xa963('0x7'));var sox=require(_0xa963('0x8'));var csv=require(_0xa963('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa963('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa963('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa963('0x9'));var querystring=require(_0xa963('0xc'));var Papa=require(_0xa963('0xd'));var Redis=require(_0xa963('0xe'));var authService=require(_0xa963('0xf'));var qs=require(_0xa963('0x10'));var as=require(_0xa963('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa963('0x12'))(_0xa963('0x13'));var utils=require(_0xa963('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa963('0x15'))['db'];function respondWithStatusCode(_0x49ec59,_0x3df776){_0x3df776=_0x3df776||0xcc;return function(_0x487af8){if(_0x487af8){return _0x49ec59[_0xa963('0x16')](_0x3df776);}return _0x49ec59[_0xa963('0x17')](_0x3df776)[_0xa963('0x18')]();};}function respondWithResult(_0x250c5d,_0x39f77a){_0x39f77a=_0x39f77a||0xc8;return function(_0x32c6d6){if(_0x32c6d6){return _0x250c5d[_0xa963('0x17')](_0x39f77a)['json'](_0x32c6d6);}};}function respondWithFilteredResult(_0x5db5b9,_0xf962b8){return function(_0x34de41){if(_0x34de41){var _0x3c6b01=typeof _0xf962b8[_0xa963('0x19')]===_0xa963('0x1a')&&typeof _0xf962b8[_0xa963('0x1b')]===_0xa963('0x1a');var _0x3b20ff=_0x34de41[_0xa963('0x1c')];var _0xb5ab0b=_0x3c6b01?0x0:_0xf962b8[_0xa963('0x19')];var _0x1a0480=_0x3c6b01?_0x34de41[_0xa963('0x1c')]:_0xf962b8[_0xa963('0x19')]+_0xf962b8[_0xa963('0x1b')];var _0xfd4b3c;if(_0x1a0480>=_0x3b20ff){_0x1a0480=_0x3b20ff;_0xfd4b3c=0xc8;}else{_0xfd4b3c=0xce;}_0x5db5b9[_0xa963('0x17')](_0xfd4b3c);return _0x5db5b9[_0xa963('0x1d')](_0xa963('0x1e'),_0xb5ab0b+'-'+_0x1a0480+'/'+_0x3b20ff)[_0xa963('0x1f')](_0x34de41);}return null;};}function patchUpdates(_0x1562f8){return function(_0x15d6c7){try{jsonpatch['apply'](_0x15d6c7,_0x1562f8,!![]);}catch(_0x50f79d){return BPromise[_0xa963('0x20')](_0x50f79d);}return _0x15d6c7[_0xa963('0x21')]();};}function saveUpdates(_0x1b982c,_0x310b45){return function(_0x5731fb){if(_0x5731fb){return _0x5731fb['update'](_0x1b982c)[_0xa963('0x22')](function(_0x34f37a){return _0x34f37a;});}return null;};}function removeEntity(_0x2c668d,_0x3623d2){return function(_0x1000cd){if(_0x1000cd){return _0x1000cd[_0xa963('0x23')]()[_0xa963('0x22')](function(){_0x2c668d[_0xa963('0x17')](0xcc)[_0xa963('0x18')]();});}};}function handleEntityNotFound(_0x482e33,_0xd0f6ab){return function(_0x34e47e){if(!_0x34e47e){_0x482e33['sendStatus'](0x194);}return _0x34e47e;};}function handleError(_0x447636,_0x20299a){_0x20299a=_0x20299a||0x1f4;return function(_0x309838){logger[_0xa963('0x24')](_0x309838['stack']);if(_0x309838['name']){delete _0x309838[_0xa963('0x25')];}_0x447636[_0xa963('0x17')](_0x20299a)[_0xa963('0x26')](_0x309838);};}exports['index']=function(_0x3ab89c,_0x3847a3){var _0x4e687f={},_0x4b694e={},_0xbc405f={'count':0x0,'rows':[]};var _0xd18307=_[_0xa963('0x27')](db[_0xa963('0x28')][_0xa963('0x29')],function(_0x21710d){return{'name':_0x21710d['fieldName'],'type':_0x21710d[_0xa963('0x2a')][_0xa963('0x2b')]};});_0x4b694e[_0xa963('0x2c')]=_['map'](_0xd18307,_0xa963('0x25'));_0x4b694e[_0xa963('0x2d')]=_[_0xa963('0x2e')](_0x3ab89c[_0xa963('0x2d')]);_0x4b694e[_0xa963('0x2f')]=_[_0xa963('0x30')](_0x4b694e[_0xa963('0x2c')],_0x4b694e['query']);_0x4e687f[_0xa963('0x31')]=_[_0xa963('0x30')](_0x4b694e['model'],qs[_0xa963('0x32')](_0x3ab89c[_0xa963('0x2d')][_0xa963('0x32')]));_0x4e687f[_0xa963('0x31')]=_0x4e687f[_0xa963('0x31')][_0xa963('0x33')]?_0x4e687f[_0xa963('0x31')]:_0x4b694e[_0xa963('0x2c')];if(!_0x3ab89c[_0xa963('0x2d')][_0xa963('0x34')]('nolimit')){_0x4e687f['limit']=qs[_0xa963('0x1b')](_0x3ab89c[_0xa963('0x2d')]['limit']);_0x4e687f['offset']=qs[_0xa963('0x19')](_0x3ab89c['query'][_0xa963('0x19')]);}_0x4e687f['order']=qs[_0xa963('0x35')](_0x3ab89c[_0xa963('0x2d')][_0xa963('0x35')]);_0x4e687f['where']=qs[_0xa963('0x2f')](_[_0xa963('0x36')](_0x3ab89c['query'],_0x4b694e[_0xa963('0x2f')]),_0xd18307);if(_0x3ab89c[_0xa963('0x2d')][_0xa963('0x37')]){_0x4e687f[_0xa963('0x38')]=_[_0xa963('0x39')](_0x4e687f[_0xa963('0x38')],{'$or':_[_0xa963('0x27')](_0xd18307,function(_0x56699e){if(_0x56699e[_0xa963('0x2a')]!==_0xa963('0x3a')){var _0x4d070c={};_0x4d070c[_0x56699e['name']]={'$like':'%'+_0x3ab89c[_0xa963('0x2d')][_0xa963('0x37')]+'%'};return _0x4d070c;}})});}_0x4e687f=_[_0xa963('0x39')]({},_0x4e687f,_0x3ab89c['options']);var _0x9686c9={'where':_0x4e687f[_0xa963('0x38')]};return db[_0xa963('0x28')]['count'](_0x9686c9)[_0xa963('0x22')](function(_0x1870f4){_0xbc405f[_0xa963('0x1c')]=_0x1870f4;if(_0x3ab89c[_0xa963('0x2d')]['includeAll']){_0x4e687f[_0xa963('0x3b')]=[{'all':!![]}];}return db[_0xa963('0x28')][_0xa963('0x3c')](_0x4e687f);})['then'](function(_0x5d50b8){_0xbc405f[_0xa963('0x3d')]=_0x5d50b8;return _0xbc405f;})['then'](respondWithFilteredResult(_0x3847a3,_0x4e687f))['catch'](handleError(_0x3847a3,null));};exports[_0xa963('0x3e')]=function(_0x271ba8,_0x846de3){var _0x5d0a9c={'raw':![],'where':{'id':_0x271ba8[_0xa963('0x3f')]['id']}},_0x45499d={};_0x45499d[_0xa963('0x2c')]=_[_0xa963('0x2e')](db[_0xa963('0x28')][_0xa963('0x29')]);_0x45499d[_0xa963('0x2d')]=_[_0xa963('0x2e')](_0x271ba8['query']);_0x45499d[_0xa963('0x2f')]=_[_0xa963('0x30')](_0x45499d['model'],_0x45499d[_0xa963('0x2d')]);_0x5d0a9c[_0xa963('0x31')]=_[_0xa963('0x30')](_0x45499d[_0xa963('0x2c')],qs[_0xa963('0x32')](_0x271ba8[_0xa963('0x2d')][_0xa963('0x32')]));_0x5d0a9c['attributes']=_0x5d0a9c['attributes'][_0xa963('0x33')]?_0x5d0a9c[_0xa963('0x31')]:_0x45499d[_0xa963('0x2c')];if(_0x271ba8[_0xa963('0x2d')][_0xa963('0x40')]){_0x5d0a9c[_0xa963('0x3b')]=[{'all':!![]}];}_0x5d0a9c=_['merge']({},_0x5d0a9c,_0x271ba8[_0xa963('0x41')]);return db[_0xa963('0x28')]['find'](_0x5d0a9c)['then'](handleEntityNotFound(_0x846de3,null))[_0xa963('0x22')](respondWithResult(_0x846de3,null))['catch'](handleError(_0x846de3,null));};exports['create']=function(_0x136b3a,_0x44e124){return db['ZendeskConfiguration'][_0xa963('0x42')](_0x136b3a['body'],{})[_0xa963('0x22')](respondWithResult(_0x44e124,0xc9))[_0xa963('0x43')](handleError(_0x44e124,null));};exports[_0xa963('0x44')]=function(_0x2a3051,_0x2ee495){if(_0x2a3051[_0xa963('0x45')]['id']){delete _0x2a3051[_0xa963('0x45')]['id'];}return db['ZendeskConfiguration'][_0xa963('0x46')]({'where':{'id':_0x2a3051[_0xa963('0x3f')]['id']}})[_0xa963('0x22')](handleEntityNotFound(_0x2ee495,null))[_0xa963('0x22')](saveUpdates(_0x2a3051[_0xa963('0x45')],null))[_0xa963('0x22')](respondWithResult(_0x2ee495,null))['catch'](handleError(_0x2ee495,null));};exports[_0xa963('0x23')]=function(_0x20beff,_0x26f6f4){return db['ZendeskConfiguration']['find']({'where':{'id':_0x20beff['params']['id']}})['then'](handleEntityNotFound(_0x26f6f4,null))[_0xa963('0x22')](removeEntity(_0x26f6f4,null))[_0xa963('0x43')](handleError(_0x26f6f4,null));};exports['getFields']=function(_0x829d1a,_0x253066,_0x1e7ed8){var _0x21c44f={};var _0x145f8c={};var _0x201672;var _0x1dba71;return db[_0xa963('0x28')][_0xa963('0x47')]({'where':{'id':_0x829d1a[_0xa963('0x3f')]['id']}})[_0xa963('0x22')](handleEntityNotFound(_0x253066,null))[_0xa963('0x22')](function(_0x30946d){if(_0x30946d){_0x201672=_0x30946d;_0x145f8c[_0xa963('0x2c')]=_[_0xa963('0x2e')](db[_0xa963('0x48')]['rawAttributes']);_0x145f8c['query']=_[_0xa963('0x2e')](_0x829d1a[_0xa963('0x2d')]);_0x145f8c[_0xa963('0x2f')]=_['intersection'](_0x145f8c['model'],_0x145f8c[_0xa963('0x2d')]);_0x21c44f['attributes']=_[_0xa963('0x30')](_0x145f8c[_0xa963('0x2c')],qs['fields'](_0x829d1a['query'][_0xa963('0x32')]));_0x21c44f[_0xa963('0x31')]=_0x21c44f[_0xa963('0x31')]['length']?_0x21c44f[_0xa963('0x31')]:_0x145f8c[_0xa963('0x2c')];_0x21c44f['order']=qs['sort'](_0x829d1a['query'][_0xa963('0x35')]);_0x21c44f[_0xa963('0x38')]=qs[_0xa963('0x2f')](_[_0xa963('0x36')](_0x829d1a['query'],_0x145f8c[_0xa963('0x2f')]));if(_0x829d1a['query'][_0xa963('0x37')]){_0x21c44f[_0xa963('0x38')]=_[_0xa963('0x39')](_0x21c44f[_0xa963('0x38')],{'$or':_[_0xa963('0x27')](_0x21c44f[_0xa963('0x31')],function(_0x430a80){var _0x32803b={};_0x32803b[_0x430a80]={'$like':'%'+_0x829d1a[_0xa963('0x2d')][_0xa963('0x37')]+'%'};return _0x32803b;})});}_0x21c44f=_[_0xa963('0x39')]({},_0x21c44f,_0x829d1a['options']);return _0x201672[_0xa963('0x49')](_0x21c44f);}})[_0xa963('0x22')](function(_0x4684a1){if(_0x4684a1){_0x1dba71=_0x4684a1['length'];if(!_0x829d1a['query'][_0xa963('0x34')](_0xa963('0x4a'))){_0x21c44f['limit']=qs[_0xa963('0x1b')](_0x829d1a['query'][_0xa963('0x1b')]);_0x21c44f[_0xa963('0x19')]=qs[_0xa963('0x19')](_0x829d1a[_0xa963('0x2d')][_0xa963('0x19')]);}return _0x201672[_0xa963('0x49')](_0x21c44f);}})['then'](function(_0x311dc6){if(_0x311dc6){return _0x311dc6?{'count':_0x1dba71,'rows':_0x311dc6}:null;}})[_0xa963('0x22')](respondWithResult(_0x253066,null))[_0xa963('0x43')](handleError(_0x253066,null));};exports[_0xa963('0x4b')]=function(_0x23bd57,_0x5952e3,_0x484503){var _0x2218ee={};var _0x905d0={};var _0x3bfbf6;var _0x35be85;return db['ZendeskConfiguration'][_0xa963('0x47')]({'where':{'id':_0x23bd57['params']['id']}})[_0xa963('0x22')](handleEntityNotFound(_0x5952e3,null))[_0xa963('0x22')](function(_0x459674){if(_0x459674){_0x3bfbf6=_0x459674;_0x905d0[_0xa963('0x2c')]=_['keys'](db[_0xa963('0x48')]['rawAttributes']);_0x905d0[_0xa963('0x2d')]=_[_0xa963('0x2e')](_0x23bd57[_0xa963('0x2d')]);_0x905d0[_0xa963('0x2f')]=_[_0xa963('0x30')](_0x905d0[_0xa963('0x2c')],_0x905d0[_0xa963('0x2d')]);_0x2218ee[_0xa963('0x31')]=_[_0xa963('0x30')](_0x905d0['model'],qs[_0xa963('0x32')](_0x23bd57['query'][_0xa963('0x32')]));_0x2218ee['attributes']=_0x2218ee[_0xa963('0x31')][_0xa963('0x33')]?_0x2218ee[_0xa963('0x31')]:_0x905d0[_0xa963('0x2c')];_0x2218ee[_0xa963('0x4c')]=qs[_0xa963('0x35')](_0x23bd57[_0xa963('0x2d')][_0xa963('0x35')]);_0x2218ee[_0xa963('0x38')]=qs[_0xa963('0x2f')](_[_0xa963('0x36')](_0x23bd57[_0xa963('0x2d')],_0x905d0[_0xa963('0x2f')]));if(_0x23bd57[_0xa963('0x2d')][_0xa963('0x37')]){_0x2218ee[_0xa963('0x38')]=_['merge'](_0x2218ee[_0xa963('0x38')],{'$or':_[_0xa963('0x27')](_0x2218ee[_0xa963('0x31')],function(_0x593a93){var _0x20f9fd={};_0x20f9fd[_0x593a93]={'$like':'%'+_0x23bd57[_0xa963('0x2d')]['filter']+'%'};return _0x20f9fd;})});}_0x2218ee=_[_0xa963('0x39')]({},_0x2218ee,_0x23bd57['options']);return _0x3bfbf6['getSubjects'](_0x2218ee);}})[_0xa963('0x22')](function(_0x647135){if(_0x647135){_0x35be85=_0x647135[_0xa963('0x33')];if(!_0x23bd57[_0xa963('0x2d')][_0xa963('0x34')](_0xa963('0x4a'))){_0x2218ee[_0xa963('0x1b')]=qs[_0xa963('0x1b')](_0x23bd57[_0xa963('0x2d')][_0xa963('0x1b')]);_0x2218ee[_0xa963('0x19')]=qs[_0xa963('0x19')](_0x23bd57['query']['offset']);}return _0x3bfbf6['getSubjects'](_0x2218ee);}})[_0xa963('0x22')](function(_0x32a63d){if(_0x32a63d){return _0x32a63d?{'count':_0x35be85,'rows':_0x32a63d}:null;}})[_0xa963('0x22')](respondWithResult(_0x5952e3,null))[_0xa963('0x43')](handleError(_0x5952e3,null));};exports[_0xa963('0x4d')]=function(_0x38fee4,_0x212606,_0x391ee9){var _0x23df46={};var _0x109e6c={};var _0x3730dc;var _0x5c6123;return db['ZendeskConfiguration'][_0xa963('0x47')]({'where':{'id':_0x38fee4[_0xa963('0x3f')]['id']}})['then'](handleEntityNotFound(_0x212606,null))[_0xa963('0x22')](function(_0x5606cc){if(_0x5606cc){_0x3730dc=_0x5606cc;_0x109e6c[_0xa963('0x2c')]=_[_0xa963('0x2e')](db[_0xa963('0x48')][_0xa963('0x29')]);_0x109e6c[_0xa963('0x2d')]=_[_0xa963('0x2e')](_0x38fee4[_0xa963('0x2d')]);_0x109e6c[_0xa963('0x2f')]=_[_0xa963('0x30')](_0x109e6c[_0xa963('0x2c')],_0x109e6c['query']);_0x23df46[_0xa963('0x31')]=_[_0xa963('0x30')](_0x109e6c[_0xa963('0x2c')],qs['fields'](_0x38fee4[_0xa963('0x2d')][_0xa963('0x32')]));_0x23df46[_0xa963('0x31')]=_0x23df46['attributes'][_0xa963('0x33')]?_0x23df46[_0xa963('0x31')]:_0x109e6c[_0xa963('0x2c')];_0x23df46[_0xa963('0x4c')]=qs[_0xa963('0x35')](_0x38fee4[_0xa963('0x2d')][_0xa963('0x35')]);_0x23df46[_0xa963('0x38')]=qs[_0xa963('0x2f')](_[_0xa963('0x36')](_0x38fee4[_0xa963('0x2d')],_0x109e6c[_0xa963('0x2f')]));if(_0x38fee4[_0xa963('0x2d')][_0xa963('0x37')]){_0x23df46['where']=_[_0xa963('0x39')](_0x23df46['where'],{'$or':_[_0xa963('0x27')](_0x23df46[_0xa963('0x31')],function(_0x1db745){var _0x1d4287={};_0x1d4287[_0x1db745]={'$like':'%'+_0x38fee4['query'][_0xa963('0x37')]+'%'};return _0x1d4287;})});}_0x23df46=_[_0xa963('0x39')]({},_0x23df46,_0x38fee4[_0xa963('0x41')]);return _0x3730dc[_0xa963('0x4d')](_0x23df46);}})[_0xa963('0x22')](function(_0x4e9b28){if(_0x4e9b28){_0x5c6123=_0x4e9b28['length'];if(!_0x38fee4['query'][_0xa963('0x34')](_0xa963('0x4a'))){_0x23df46[_0xa963('0x1b')]=qs[_0xa963('0x1b')](_0x38fee4['query'][_0xa963('0x1b')]);_0x23df46[_0xa963('0x19')]=qs[_0xa963('0x19')](_0x38fee4['query'][_0xa963('0x19')]);}return _0x3730dc['getDescriptions'](_0x23df46);}})[_0xa963('0x22')](function(_0xd4dc4c){if(_0xd4dc4c){return _0xd4dc4c?{'count':_0x5c6123,'rows':_0xd4dc4c}:null;}})[_0xa963('0x22')](respondWithResult(_0x212606,null))['catch'](handleError(_0x212606,null));};exports[_0xa963('0x4e')]=function(_0x47378d,_0x30c33b,_0x176f55){var _0x17d93b={};var _0x458d1={};var _0x1a4cb4;var _0x56e0df;return db['ZendeskConfiguration'][_0xa963('0x47')]({'where':{'id':_0x47378d[_0xa963('0x3f')]['id']}})['then'](handleEntityNotFound(_0x30c33b,null))[_0xa963('0x22')](function(_0xb3bdec){if(_0xb3bdec){_0x1a4cb4=_0xb3bdec;_0x458d1[_0xa963('0x2c')]=_['keys'](db[_0xa963('0x4f')]['rawAttributes']);_0x458d1['query']=_[_0xa963('0x2e')](_0x47378d[_0xa963('0x2d')]);_0x458d1[_0xa963('0x2f')]=_[_0xa963('0x30')](_0x458d1[_0xa963('0x2c')],_0x458d1[_0xa963('0x2d')]);_0x17d93b['attributes']=_[_0xa963('0x30')](_0x458d1[_0xa963('0x2c')],qs[_0xa963('0x32')](_0x47378d[_0xa963('0x2d')][_0xa963('0x32')]));_0x17d93b[_0xa963('0x31')]=_0x17d93b[_0xa963('0x31')]['length']?_0x17d93b[_0xa963('0x31')]:_0x458d1[_0xa963('0x2c')];_0x17d93b[_0xa963('0x4c')]=qs['sort'](_0x47378d[_0xa963('0x2d')]['sort']);_0x17d93b[_0xa963('0x38')]=qs[_0xa963('0x2f')](_['pick'](_0x47378d['query'],_0x458d1[_0xa963('0x2f')]));if(_0x47378d[_0xa963('0x2d')][_0xa963('0x37')]){_0x17d93b[_0xa963('0x38')]=_[_0xa963('0x39')](_0x17d93b[_0xa963('0x38')],{'$or':_[_0xa963('0x27')](_0x17d93b[_0xa963('0x31')],function(_0x5813b1){var _0x17acec={};_0x17acec[_0x5813b1]={'$like':'%'+_0x47378d[_0xa963('0x2d')][_0xa963('0x37')]+'%'};return _0x17acec;})});}_0x17d93b=_[_0xa963('0x39')]({},_0x17d93b,_0x47378d[_0xa963('0x41')]);return _0x1a4cb4[_0xa963('0x4e')](_0x17d93b);}})[_0xa963('0x22')](function(_0x3bf6d3){if(_0x3bf6d3){_0x56e0df=_0x3bf6d3[_0xa963('0x33')];if(!_0x47378d[_0xa963('0x2d')]['hasOwnProperty']('nolimit')){_0x17d93b[_0xa963('0x1b')]=qs[_0xa963('0x1b')](_0x47378d[_0xa963('0x2d')][_0xa963('0x1b')]);_0x17d93b[_0xa963('0x19')]=qs['offset'](_0x47378d[_0xa963('0x2d')]['offset']);}return _0x1a4cb4['getTags'](_0x17d93b);}})['then'](function(_0x2a2400){if(_0x2a2400){return _0x2a2400?{'count':_0x56e0df,'rows':_0x2a2400}:null;}})[_0xa963('0x22')](respondWithResult(_0x30c33b,null))[_0xa963('0x43')](handleError(_0x30c33b,null));};exports[_0xa963('0x50')]=function(_0x27fcac,_0x11a3ef,_0x378268){if(_0x27fcac[_0xa963('0x45')]['id']){delete _0x27fcac[_0xa963('0x45')]['id'];}return db['ZendeskConfiguration'][_0xa963('0x47')]({'where':{'id':_0x27fcac[_0xa963('0x3f')]['id']}})[_0xa963('0x22')](handleEntityNotFound(_0x11a3ef,null))[_0xa963('0x22')](function(_0x4e5bd1){if(_0x4e5bd1){return _0x4e5bd1[_0xa963('0x50')](_0x27fcac[_0xa963('0x45')]['ids']||[]);}return null;})[_0xa963('0x22')](respondWithResult(_0x11a3ef,null))[_0xa963('0x43')](handleError(_0x11a3ef,null));}; \ No newline at end of file +var _0x0952=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','name','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','find','create','body','update','getFields','findOne','ZendeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x0952,0x9c));var _0x2095=function(_0x4f0fcc,_0xa36539){_0x4f0fcc=_0x4f0fcc-0x0;var _0x4d9a75=_0x0952[_0x4f0fcc];return _0x4d9a75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2095('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2095('0x1'));var rp=require(_0x2095('0x2'));var moment=require(_0x2095('0x3'));var BPromise=require(_0x2095('0x4'));var Mustache=require(_0x2095('0x5'));var util=require(_0x2095('0x6'));var path=require(_0x2095('0x7'));var sox=require(_0x2095('0x8'));var csv=require(_0x2095('0x9'));var ejs=require(_0x2095('0xa'));var fs=require('fs');var fs_extra=require(_0x2095('0xb'));var _=require(_0x2095('0xc'));var squel=require(_0x2095('0xd'));var crypto=require(_0x2095('0xe'));var jsforce=require(_0x2095('0xf'));var deskjs=require(_0x2095('0x10'));var toCsv=require(_0x2095('0x9'));var querystring=require(_0x2095('0x11'));var Papa=require(_0x2095('0x12'));var Redis=require(_0x2095('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2095('0x14'));var as=require(_0x2095('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2095('0x16'))(_0x2095('0x17'));var utils=require('../../config/utils');var config=require(_0x2095('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x106efb,_0x17c363){_0x17c363=_0x17c363||0xcc;return function(_0x4735e7){if(_0x4735e7){return _0x106efb['sendStatus'](_0x17c363);}return _0x106efb['status'](_0x17c363)['end']();};}function respondWithResult(_0x4c39a9,_0xcf39bb){_0xcf39bb=_0xcf39bb||0xc8;return function(_0x345fd8){if(_0x345fd8){return _0x4c39a9[_0x2095('0x19')](_0xcf39bb)['json'](_0x345fd8);}};}function respondWithFilteredResult(_0x392666,_0x5252b7){return function(_0x18a011){if(_0x18a011){var _0x53d54f=typeof _0x5252b7['offset']===_0x2095('0x1a')&&typeof _0x5252b7[_0x2095('0x1b')]===_0x2095('0x1a');var _0x151160=_0x18a011[_0x2095('0x1c')];var _0x141cbf=_0x53d54f?0x0:_0x5252b7[_0x2095('0x1d')];var _0x5a96ec=_0x53d54f?_0x18a011['count']:_0x5252b7[_0x2095('0x1d')]+_0x5252b7['limit'];var _0x279f3b;if(_0x5a96ec>=_0x151160){_0x5a96ec=_0x151160;_0x279f3b=0xc8;}else{_0x279f3b=0xce;}_0x392666['status'](_0x279f3b);return _0x392666[_0x2095('0x1e')](_0x2095('0x1f'),_0x141cbf+'-'+_0x5a96ec+'/'+_0x151160)['json'](_0x18a011);}return null;};}function patchUpdates(_0xde2cab){return function(_0x102499){try{jsonpatch['apply'](_0x102499,_0xde2cab,!![]);}catch(_0x5b30af){return BPromise[_0x2095('0x20')](_0x5b30af);}return _0x102499[_0x2095('0x21')]();};}function saveUpdates(_0x4a0dc5,_0xae4fbf){return function(_0x5f214d){if(_0x5f214d){return _0x5f214d['update'](_0x4a0dc5)[_0x2095('0x22')](function(_0x5c5768){return _0x5c5768;});}return null;};}function removeEntity(_0x2b9400,_0xa2ef86){return function(_0x2c11fa){if(_0x2c11fa){return _0x2c11fa[_0x2095('0x23')]()[_0x2095('0x22')](function(){_0x2b9400[_0x2095('0x19')](0xcc)[_0x2095('0x24')]();});}};}function handleEntityNotFound(_0x350d53,_0x3c65a4){return function(_0x4015b1){if(!_0x4015b1){_0x350d53[_0x2095('0x25')](0x194);}return _0x4015b1;};}function handleError(_0x3cfce1,_0x1f2510){_0x1f2510=_0x1f2510||0x1f4;return function(_0x340be4){logger[_0x2095('0x26')](_0x340be4['stack']);if(_0x340be4[_0x2095('0x27')]){delete _0x340be4[_0x2095('0x27')];}_0x3cfce1[_0x2095('0x19')](_0x1f2510)['send'](_0x340be4);};}exports[_0x2095('0x28')]=function(_0x121189,_0x2820d2){var _0x243f7b={},_0x1c98fa={},_0x1f3ab2={'count':0x0,'rows':[]};var _0x259260=_[_0x2095('0x29')](db[_0x2095('0x2a')][_0x2095('0x2b')],function(_0x20ecac){return{'name':_0x20ecac['fieldName'],'type':_0x20ecac[_0x2095('0x2c')][_0x2095('0x2d')]};});_0x1c98fa[_0x2095('0x2e')]=_[_0x2095('0x29')](_0x259260,_0x2095('0x27'));_0x1c98fa[_0x2095('0x2f')]=_[_0x2095('0x30')](_0x121189[_0x2095('0x2f')]);_0x1c98fa[_0x2095('0x31')]=_[_0x2095('0x32')](_0x1c98fa[_0x2095('0x2e')],_0x1c98fa[_0x2095('0x2f')]);_0x243f7b[_0x2095('0x33')]=_[_0x2095('0x32')](_0x1c98fa[_0x2095('0x2e')],qs[_0x2095('0x34')](_0x121189[_0x2095('0x2f')]['fields']));_0x243f7b['attributes']=_0x243f7b[_0x2095('0x33')][_0x2095('0x35')]?_0x243f7b[_0x2095('0x33')]:_0x1c98fa[_0x2095('0x2e')];if(!_0x121189[_0x2095('0x2f')]['hasOwnProperty']('nolimit')){_0x243f7b['limit']=qs[_0x2095('0x1b')](_0x121189[_0x2095('0x2f')]['limit']);_0x243f7b[_0x2095('0x1d')]=qs[_0x2095('0x1d')](_0x121189[_0x2095('0x2f')]['offset']);}_0x243f7b[_0x2095('0x36')]=qs[_0x2095('0x37')](_0x121189['query'][_0x2095('0x37')]);_0x243f7b[_0x2095('0x38')]=qs[_0x2095('0x31')](_[_0x2095('0x39')](_0x121189[_0x2095('0x2f')],_0x1c98fa[_0x2095('0x31')]),_0x259260);if(_0x121189['query'][_0x2095('0x3a')]){_0x243f7b[_0x2095('0x38')]=_[_0x2095('0x3b')](_0x243f7b[_0x2095('0x38')],{'$or':_[_0x2095('0x29')](_0x259260,function(_0x193155){if(_0x193155['type']!==_0x2095('0x3c')){var _0x39d076={};_0x39d076[_0x193155[_0x2095('0x27')]]={'$like':'%'+_0x121189[_0x2095('0x2f')][_0x2095('0x3a')]+'%'};return _0x39d076;}})});}_0x243f7b=_[_0x2095('0x3b')]({},_0x243f7b,_0x121189[_0x2095('0x3d')]);var _0x54fbd4={'where':_0x243f7b[_0x2095('0x38')]};return db[_0x2095('0x2a')][_0x2095('0x1c')](_0x54fbd4)[_0x2095('0x22')](function(_0x3e406d){_0x1f3ab2[_0x2095('0x1c')]=_0x3e406d;if(_0x121189[_0x2095('0x2f')][_0x2095('0x3e')]){_0x243f7b['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x243f7b);})[_0x2095('0x22')](function(_0x305ffe){_0x1f3ab2['rows']=_0x305ffe;return _0x1f3ab2;})[_0x2095('0x22')](respondWithFilteredResult(_0x2820d2,_0x243f7b))[_0x2095('0x3f')](handleError(_0x2820d2,null));};exports[_0x2095('0x40')]=function(_0x1f0914,_0x3acd65){var _0x4c1b54={'raw':![],'where':{'id':_0x1f0914[_0x2095('0x41')]['id']}},_0x4f9bcc={};_0x4f9bcc['model']=_[_0x2095('0x30')](db[_0x2095('0x2a')][_0x2095('0x2b')]);_0x4f9bcc[_0x2095('0x2f')]=_['keys'](_0x1f0914[_0x2095('0x2f')]);_0x4f9bcc['filters']=_[_0x2095('0x32')](_0x4f9bcc[_0x2095('0x2e')],_0x4f9bcc['query']);_0x4c1b54[_0x2095('0x33')]=_['intersection'](_0x4f9bcc[_0x2095('0x2e')],qs[_0x2095('0x34')](_0x1f0914[_0x2095('0x2f')][_0x2095('0x34')]));_0x4c1b54['attributes']=_0x4c1b54[_0x2095('0x33')]['length']?_0x4c1b54[_0x2095('0x33')]:_0x4f9bcc[_0x2095('0x2e')];if(_0x1f0914[_0x2095('0x2f')][_0x2095('0x3e')]){_0x4c1b54['include']=[{'all':!![]}];}_0x4c1b54=_[_0x2095('0x3b')]({},_0x4c1b54,_0x1f0914[_0x2095('0x3d')]);return db[_0x2095('0x2a')][_0x2095('0x42')](_0x4c1b54)[_0x2095('0x22')](handleEntityNotFound(_0x3acd65,null))['then'](respondWithResult(_0x3acd65,null))[_0x2095('0x3f')](handleError(_0x3acd65,null));};exports[_0x2095('0x43')]=function(_0x45f29f,_0x320677){return db[_0x2095('0x2a')][_0x2095('0x43')](_0x45f29f[_0x2095('0x44')],{})[_0x2095('0x22')](respondWithResult(_0x320677,0xc9))[_0x2095('0x3f')](handleError(_0x320677,null));};exports[_0x2095('0x45')]=function(_0x4a1d89,_0x446be5){if(_0x4a1d89[_0x2095('0x44')]['id']){delete _0x4a1d89[_0x2095('0x44')]['id'];}return db[_0x2095('0x2a')]['find']({'where':{'id':_0x4a1d89[_0x2095('0x41')]['id']}})[_0x2095('0x22')](handleEntityNotFound(_0x446be5,null))['then'](saveUpdates(_0x4a1d89[_0x2095('0x44')],null))['then'](respondWithResult(_0x446be5,null))[_0x2095('0x3f')](handleError(_0x446be5,null));};exports[_0x2095('0x23')]=function(_0x8da7f2,_0x245b89){return db[_0x2095('0x2a')]['find']({'where':{'id':_0x8da7f2[_0x2095('0x41')]['id']}})[_0x2095('0x22')](handleEntityNotFound(_0x245b89,null))[_0x2095('0x22')](removeEntity(_0x245b89,null))[_0x2095('0x3f')](handleError(_0x245b89,null));};exports[_0x2095('0x46')]=function(_0x4d2dc6,_0x23b42e,_0x338b9e){var _0x5d5cb3={};var _0x24bc0a={};var _0x342863;var _0x21be52;return db[_0x2095('0x2a')][_0x2095('0x47')]({'where':{'id':_0x4d2dc6[_0x2095('0x41')]['id']}})[_0x2095('0x22')](handleEntityNotFound(_0x23b42e,null))[_0x2095('0x22')](function(_0x103a46){if(_0x103a46){_0x342863=_0x103a46;_0x24bc0a[_0x2095('0x2e')]=_[_0x2095('0x30')](db[_0x2095('0x48')][_0x2095('0x2b')]);_0x24bc0a[_0x2095('0x2f')]=_[_0x2095('0x30')](_0x4d2dc6[_0x2095('0x2f')]);_0x24bc0a[_0x2095('0x31')]=_[_0x2095('0x32')](_0x24bc0a[_0x2095('0x2e')],_0x24bc0a[_0x2095('0x2f')]);_0x5d5cb3['attributes']=_[_0x2095('0x32')](_0x24bc0a[_0x2095('0x2e')],qs[_0x2095('0x34')](_0x4d2dc6['query'][_0x2095('0x34')]));_0x5d5cb3[_0x2095('0x33')]=_0x5d5cb3['attributes'][_0x2095('0x35')]?_0x5d5cb3['attributes']:_0x24bc0a['model'];_0x5d5cb3[_0x2095('0x36')]=qs[_0x2095('0x37')](_0x4d2dc6[_0x2095('0x2f')][_0x2095('0x37')]);_0x5d5cb3[_0x2095('0x38')]=qs[_0x2095('0x31')](_['pick'](_0x4d2dc6[_0x2095('0x2f')],_0x24bc0a[_0x2095('0x31')]));if(_0x4d2dc6[_0x2095('0x2f')][_0x2095('0x3a')]){_0x5d5cb3[_0x2095('0x38')]=_[_0x2095('0x3b')](_0x5d5cb3[_0x2095('0x38')],{'$or':_[_0x2095('0x29')](_0x5d5cb3['attributes'],function(_0x54d02d){var _0x307b36={};_0x307b36[_0x54d02d]={'$like':'%'+_0x4d2dc6[_0x2095('0x2f')][_0x2095('0x3a')]+'%'};return _0x307b36;})});}_0x5d5cb3=_[_0x2095('0x3b')]({},_0x5d5cb3,_0x4d2dc6[_0x2095('0x3d')]);return _0x342863[_0x2095('0x46')](_0x5d5cb3);}})[_0x2095('0x22')](function(_0x6b351f){if(_0x6b351f){_0x21be52=_0x6b351f[_0x2095('0x35')];if(!_0x4d2dc6[_0x2095('0x2f')][_0x2095('0x49')](_0x2095('0x4a'))){_0x5d5cb3[_0x2095('0x1b')]=qs[_0x2095('0x1b')](_0x4d2dc6[_0x2095('0x2f')]['limit']);_0x5d5cb3[_0x2095('0x1d')]=qs[_0x2095('0x1d')](_0x4d2dc6[_0x2095('0x2f')][_0x2095('0x1d')]);}return _0x342863[_0x2095('0x46')](_0x5d5cb3);}})[_0x2095('0x22')](function(_0x3e2681){if(_0x3e2681){return _0x3e2681?{'count':_0x21be52,'rows':_0x3e2681}:null;}})['then'](respondWithResult(_0x23b42e,null))[_0x2095('0x3f')](handleError(_0x23b42e,null));};exports['getSubjects']=function(_0x579497,_0x1adb3f,_0x555ef4){var _0xb9d228={};var _0x3ed977={};var _0x3150be;var _0x112ba3;return db[_0x2095('0x2a')][_0x2095('0x47')]({'where':{'id':_0x579497[_0x2095('0x41')]['id']}})[_0x2095('0x22')](handleEntityNotFound(_0x1adb3f,null))[_0x2095('0x22')](function(_0x5b6208){if(_0x5b6208){_0x3150be=_0x5b6208;_0x3ed977[_0x2095('0x2e')]=_[_0x2095('0x30')](db[_0x2095('0x48')]['rawAttributes']);_0x3ed977[_0x2095('0x2f')]=_[_0x2095('0x30')](_0x579497[_0x2095('0x2f')]);_0x3ed977[_0x2095('0x31')]=_['intersection'](_0x3ed977[_0x2095('0x2e')],_0x3ed977[_0x2095('0x2f')]);_0xb9d228[_0x2095('0x33')]=_['intersection'](_0x3ed977[_0x2095('0x2e')],qs[_0x2095('0x34')](_0x579497[_0x2095('0x2f')]['fields']));_0xb9d228[_0x2095('0x33')]=_0xb9d228[_0x2095('0x33')][_0x2095('0x35')]?_0xb9d228['attributes']:_0x3ed977['model'];_0xb9d228[_0x2095('0x36')]=qs[_0x2095('0x37')](_0x579497[_0x2095('0x2f')][_0x2095('0x37')]);_0xb9d228[_0x2095('0x38')]=qs['filters'](_[_0x2095('0x39')](_0x579497['query'],_0x3ed977[_0x2095('0x31')]));if(_0x579497[_0x2095('0x2f')]['filter']){_0xb9d228[_0x2095('0x38')]=_[_0x2095('0x3b')](_0xb9d228[_0x2095('0x38')],{'$or':_['map'](_0xb9d228[_0x2095('0x33')],function(_0x7d82b){var _0x1dd625={};_0x1dd625[_0x7d82b]={'$like':'%'+_0x579497[_0x2095('0x2f')][_0x2095('0x3a')]+'%'};return _0x1dd625;})});}_0xb9d228=_[_0x2095('0x3b')]({},_0xb9d228,_0x579497[_0x2095('0x3d')]);return _0x3150be[_0x2095('0x4b')](_0xb9d228);}})['then'](function(_0x231321){if(_0x231321){_0x112ba3=_0x231321[_0x2095('0x35')];if(!_0x579497[_0x2095('0x2f')][_0x2095('0x49')](_0x2095('0x4a'))){_0xb9d228[_0x2095('0x1b')]=qs[_0x2095('0x1b')](_0x579497[_0x2095('0x2f')][_0x2095('0x1b')]);_0xb9d228[_0x2095('0x1d')]=qs['offset'](_0x579497[_0x2095('0x2f')]['offset']);}return _0x3150be[_0x2095('0x4b')](_0xb9d228);}})[_0x2095('0x22')](function(_0x265a0e){if(_0x265a0e){return _0x265a0e?{'count':_0x112ba3,'rows':_0x265a0e}:null;}})[_0x2095('0x22')](respondWithResult(_0x1adb3f,null))[_0x2095('0x3f')](handleError(_0x1adb3f,null));};exports['getDescriptions']=function(_0x445da1,_0x1df4f5,_0x26fd63){var _0x52d43e={};var _0x5cad61={};var _0x91df36;var _0x4be412;return db[_0x2095('0x2a')][_0x2095('0x47')]({'where':{'id':_0x445da1['params']['id']}})['then'](handleEntityNotFound(_0x1df4f5,null))[_0x2095('0x22')](function(_0x1da7ce){if(_0x1da7ce){_0x91df36=_0x1da7ce;_0x5cad61[_0x2095('0x2e')]=_[_0x2095('0x30')](db[_0x2095('0x48')][_0x2095('0x2b')]);_0x5cad61[_0x2095('0x2f')]=_[_0x2095('0x30')](_0x445da1[_0x2095('0x2f')]);_0x5cad61[_0x2095('0x31')]=_[_0x2095('0x32')](_0x5cad61[_0x2095('0x2e')],_0x5cad61[_0x2095('0x2f')]);_0x52d43e[_0x2095('0x33')]=_[_0x2095('0x32')](_0x5cad61['model'],qs[_0x2095('0x34')](_0x445da1['query'][_0x2095('0x34')]));_0x52d43e[_0x2095('0x33')]=_0x52d43e[_0x2095('0x33')]['length']?_0x52d43e[_0x2095('0x33')]:_0x5cad61[_0x2095('0x2e')];_0x52d43e['order']=qs[_0x2095('0x37')](_0x445da1[_0x2095('0x2f')][_0x2095('0x37')]);_0x52d43e['where']=qs['filters'](_[_0x2095('0x39')](_0x445da1[_0x2095('0x2f')],_0x5cad61['filters']));if(_0x445da1[_0x2095('0x2f')]['filter']){_0x52d43e[_0x2095('0x38')]=_[_0x2095('0x3b')](_0x52d43e[_0x2095('0x38')],{'$or':_['map'](_0x52d43e[_0x2095('0x33')],function(_0x381159){var _0x7a71d1={};_0x7a71d1[_0x381159]={'$like':'%'+_0x445da1[_0x2095('0x2f')][_0x2095('0x3a')]+'%'};return _0x7a71d1;})});}_0x52d43e=_['merge']({},_0x52d43e,_0x445da1[_0x2095('0x3d')]);return _0x91df36['getDescriptions'](_0x52d43e);}})[_0x2095('0x22')](function(_0x43627c){if(_0x43627c){_0x4be412=_0x43627c[_0x2095('0x35')];if(!_0x445da1[_0x2095('0x2f')][_0x2095('0x49')]('nolimit')){_0x52d43e[_0x2095('0x1b')]=qs['limit'](_0x445da1[_0x2095('0x2f')]['limit']);_0x52d43e[_0x2095('0x1d')]=qs[_0x2095('0x1d')](_0x445da1['query'][_0x2095('0x1d')]);}return _0x91df36[_0x2095('0x4c')](_0x52d43e);}})[_0x2095('0x22')](function(_0xc7de79){if(_0xc7de79){return _0xc7de79?{'count':_0x4be412,'rows':_0xc7de79}:null;}})[_0x2095('0x22')](respondWithResult(_0x1df4f5,null))['catch'](handleError(_0x1df4f5,null));};exports['getTags']=function(_0xc9f3b1,_0x5dc3b2,_0x1e4016){var _0x2db218={};var _0x258038={};var _0x56274b;var _0x4f0573;return db[_0x2095('0x2a')][_0x2095('0x47')]({'where':{'id':_0xc9f3b1[_0x2095('0x41')]['id']}})['then'](handleEntityNotFound(_0x5dc3b2,null))['then'](function(_0x8ad33f){if(_0x8ad33f){_0x56274b=_0x8ad33f;_0x258038['model']=_['keys'](db[_0x2095('0x4d')][_0x2095('0x2b')]);_0x258038[_0x2095('0x2f')]=_[_0x2095('0x30')](_0xc9f3b1['query']);_0x258038['filters']=_[_0x2095('0x32')](_0x258038[_0x2095('0x2e')],_0x258038[_0x2095('0x2f')]);_0x2db218[_0x2095('0x33')]=_[_0x2095('0x32')](_0x258038[_0x2095('0x2e')],qs[_0x2095('0x34')](_0xc9f3b1[_0x2095('0x2f')][_0x2095('0x34')]));_0x2db218[_0x2095('0x33')]=_0x2db218[_0x2095('0x33')]['length']?_0x2db218[_0x2095('0x33')]:_0x258038[_0x2095('0x2e')];_0x2db218[_0x2095('0x36')]=qs[_0x2095('0x37')](_0xc9f3b1[_0x2095('0x2f')]['sort']);_0x2db218[_0x2095('0x38')]=qs[_0x2095('0x31')](_[_0x2095('0x39')](_0xc9f3b1['query'],_0x258038[_0x2095('0x31')]));if(_0xc9f3b1[_0x2095('0x2f')]['filter']){_0x2db218[_0x2095('0x38')]=_['merge'](_0x2db218[_0x2095('0x38')],{'$or':_[_0x2095('0x29')](_0x2db218[_0x2095('0x33')],function(_0x2afa0b){var _0x4a4cb7={};_0x4a4cb7[_0x2afa0b]={'$like':'%'+_0xc9f3b1[_0x2095('0x2f')][_0x2095('0x3a')]+'%'};return _0x4a4cb7;})});}_0x2db218=_[_0x2095('0x3b')]({},_0x2db218,_0xc9f3b1['options']);return _0x56274b[_0x2095('0x4e')](_0x2db218);}})[_0x2095('0x22')](function(_0x3941da){if(_0x3941da){_0x4f0573=_0x3941da['length'];if(!_0xc9f3b1[_0x2095('0x2f')][_0x2095('0x49')]('nolimit')){_0x2db218[_0x2095('0x1b')]=qs[_0x2095('0x1b')](_0xc9f3b1[_0x2095('0x2f')][_0x2095('0x1b')]);_0x2db218['offset']=qs[_0x2095('0x1d')](_0xc9f3b1['query'][_0x2095('0x1d')]);}return _0x56274b[_0x2095('0x4e')](_0x2db218);}})['then'](function(_0x286bd2){if(_0x286bd2){return _0x286bd2?{'count':_0x4f0573,'rows':_0x286bd2}:null;}})[_0x2095('0x22')](respondWithResult(_0x5dc3b2,null))[_0x2095('0x3f')](handleError(_0x5dc3b2,null));};exports['setTags']=function(_0x4cd395,_0x3076c5,_0x34ac9b){if(_0x4cd395[_0x2095('0x44')]['id']){delete _0x4cd395[_0x2095('0x44')]['id'];}return db[_0x2095('0x2a')][_0x2095('0x47')]({'where':{'id':_0x4cd395[_0x2095('0x41')]['id']}})[_0x2095('0x22')](handleEntityNotFound(_0x3076c5,null))[_0x2095('0x22')](function(_0x59d672){if(_0x59d672){return _0x59d672[_0x2095('0x4f')](_0x4cd395['body'][_0x2095('0x50')]||[]);}return null;})['then'](respondWithResult(_0x3076c5,null))[_0x2095('0x3f')](handleError(_0x3076c5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c08ca20..dd7dc69 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskConfiguration','lodash','util','api','moment'];(function(_0xa5c9b7,_0x126374){var _0x50ee92=function(_0x2e7614){while(--_0x2e7614){_0xa5c9b7['push'](_0xa5c9b7['shift']());}};_0x50ee92(++_0x126374);}(_0x5423,0xe3));var _0x3542=function(_0x28148c,_0x2d91c9){_0x28148c=_0x28148c-0x0;var _0x3ef6dd=_0x5423[_0x28148c];return _0x3ef6dd;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x38fba0,_0x342537){var _0x5506fd=function(_0x128b12){while(--_0x128b12){_0x38fba0['push'](_0x38fba0['shift']());}};_0x5506fd(++_0x342537);}(_0x896e,0x1e9));var _0xe896=function(_0x17e903,_0x58eeea){_0x17e903=_0x17e903-0x0;var _0x554f28=_0x896e[_0x17e903];return _0x554f28;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 5b2cb31..1898df8 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fc8=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then'];(function(_0x24b773,_0x392c26){var _0x35f6c9=function(_0x37b5c3){while(--_0x37b5c3){_0x24b773['push'](_0x24b773['shift']());}};_0x35f6c9(++_0x392c26);}(_0x0fc8,0x16c));var _0x80fc=function(_0x43e1aa,_0x18279d){_0x43e1aa=_0x43e1aa-0x0;var _0x5764cb=_0x0fc8[_0x43e1aa];return _0x5764cb;};'use strict';var _=require(_0x80fc('0x0'));var util=require('util');var moment=require(_0x80fc('0x1'));var BPromise=require(_0x80fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80fc('0x3'));var db=require(_0x80fc('0x4'))['db'];var utils=require(_0x80fc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x80fc('0x6'));var jayson=require(_0x80fc('0x7'));var client=jayson[_0x80fc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457ea0,_0x10276c,_0x167295){return new BPromise(function(_0x23ccbc,_0x3ef2e4){return client['request'](_0x457ea0,_0x167295)[_0x80fc('0x9')](function(_0x17370b){logger['info'](_0x80fc('0xa'),_0x10276c,_0x80fc('0xb'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x10276c,_0x80fc('0xb'),JSON[_0x80fc('0xc')](_0x17370b));if(_0x17370b[_0x80fc('0xd')]){if(_0x17370b[_0x80fc('0xd')][_0x80fc('0xe')]===0x1f4){logger[_0x80fc('0xd')](_0x80fc('0xa'),_0x10276c,_0x17370b[_0x80fc('0xd')][_0x80fc('0xf')]);return _0x3ef2e4(_0x17370b[_0x80fc('0xd')][_0x80fc('0xf')]);}logger[_0x80fc('0xd')](_0x80fc('0xa'),_0x10276c,_0x17370b[_0x80fc('0xd')]['message']);return _0x23ccbc(_0x17370b[_0x80fc('0xd')][_0x80fc('0xf')]);}else{logger['info'](_0x80fc('0xa'),_0x10276c,_0x80fc('0xb'));_0x23ccbc(_0x17370b[_0x80fc('0x10')][_0x80fc('0xf')]);}})['catch'](function(_0x591c77){logger[_0x80fc('0xd')](_0x80fc('0xa'),_0x10276c,_0x591c77);_0x3ef2e4(_0x591c77);});});} \ No newline at end of file +var _0x89fe=['message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7d697d,_0x6dceed){var _0x528126=function(_0x2062bb){while(--_0x2062bb){_0x7d697d['push'](_0x7d697d['shift']());}};_0x528126(++_0x6dceed);}(_0x89fe,0x6b));var _0xe89f=function(_0x2d94dc,_0x56bed1){_0x2d94dc=_0x2d94dc-0x0;var _0x42f80d=_0x89fe[_0x2d94dc];return _0x42f80d;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var moment=require(_0xe89f('0x2'));var BPromise=require(_0xe89f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe89f('0x4'));var logger=require(_0xe89f('0x5'))(_0xe89f('0x6'));var config=require(_0xe89f('0x7'));var jayson=require(_0xe89f('0x8'));var client=jayson[_0xe89f('0x9')][_0xe89f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bd97a,_0x1e4ec9,_0x52ffa0){return new BPromise(function(_0x20da88,_0x4ae22d){return client['request'](_0x2bd97a,_0x52ffa0)[_0xe89f('0xb')](function(_0x170d29){logger['info'](_0xe89f('0xc'),_0x1e4ec9,_0xe89f('0xd'));logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x1e4ec9,'request\x20sent',JSON[_0xe89f('0x10')](_0x170d29));if(_0x170d29['error']){if(_0x170d29[_0xe89f('0x11')][_0xe89f('0x12')]===0x1f4){logger[_0xe89f('0x11')](_0xe89f('0xc'),_0x1e4ec9,_0x170d29[_0xe89f('0x11')][_0xe89f('0x13')]);return _0x4ae22d(_0x170d29[_0xe89f('0x11')][_0xe89f('0x13')]);}logger[_0xe89f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1e4ec9,_0x170d29[_0xe89f('0x11')][_0xe89f('0x13')]);return _0x20da88(_0x170d29[_0xe89f('0x11')][_0xe89f('0x13')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1e4ec9,_0xe89f('0xd'));_0x20da88(_0x170d29[_0xe89f('0x14')][_0xe89f('0x13')]);}})['catch'](function(_0x404376){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1e4ec9,_0x404376);_0x4ae22d(_0x404376);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 548b3cd..2132306 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2943=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get','/:id','show','post','update','delete','destroy','multer','util','path'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0x2943,0x12f));var _0x3294=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x2943[_0x91ed5c];return _0x2387d8;};'use strict';var multer=require(_0x3294('0x0'));var util=require(_0x3294('0x1'));var path=require(_0x3294('0x2'));var timeout=require(_0x3294('0x3'));var express=require(_0x3294('0x4'));var router=express['Router']();var fs_extra=require(_0x3294('0x5'));var auth=require(_0x3294('0x6'));var interaction=require(_0x3294('0x7'));var config=require(_0x3294('0x8'));var controller=require(_0x3294('0x9'));router['get']('/',auth[_0x3294('0xa')](),controller['index']);router[_0x3294('0xb')](_0x3294('0xc'),auth[_0x3294('0xa')](),controller[_0x3294('0xd')]);router[_0x3294('0xe')]('/',auth[_0x3294('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3294('0xf')]);router[_0x3294('0x10')](_0x3294('0xc'),auth['isAuthenticated'](),controller[_0x3294('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdd1d=['delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xdd1d,0x1de));var _0xddd1=function(_0x17371c,_0x1a1e9c){_0x17371c=_0x17371c-0x0;var _0x422265=_0xdd1d[_0x17371c];return _0x422265;};'use strict';var multer=require('multer');var util=require(_0xddd1('0x0'));var path=require(_0xddd1('0x1'));var timeout=require(_0xddd1('0x2'));var express=require('express');var router=express[_0xddd1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddd1('0x4'));var interaction=require(_0xddd1('0x5'));var config=require(_0xddd1('0x6'));var controller=require(_0xddd1('0x7'));router[_0xddd1('0x8')]('/',auth[_0xddd1('0x9')](),controller[_0xddd1('0xa')]);router['get'](_0xddd1('0xb'),auth[_0xddd1('0x9')](),controller[_0xddd1('0xc')]);router[_0xddd1('0xd')]('/',auth['isAuthenticated'](),controller[_0xddd1('0xe')]);router['put'](_0xddd1('0xb'),auth[_0xddd1('0x9')](),controller[_0xddd1('0xf')]);router[_0xddd1('0x10')](_0xddd1('0xb'),auth[_0xddd1('0x9')](),controller[_0xddd1('0x11')]);module[_0xddd1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index da9a163..34f86fc 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0e3=['picklist','STRING','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x4c7149,_0x335342){var _0x200122=function(_0x358259){while(--_0x358259){_0x4c7149['push'](_0x4c7149['shift']());}};_0x200122(++_0x335342);}(_0xb0e3,0x1da));var _0x3b0e=function(_0x59a385,_0x1acba6){_0x59a385=_0x59a385-0x0;var _0x2d0f5a=_0xb0e3[_0x59a385];return _0x2d0f5a;};'use strict';var Sequelize=require(_0x3b0e('0x0'));module[_0x3b0e('0x1')]={'type':{'type':Sequelize[_0x3b0e('0x2')](_0x3b0e('0x3'),'variable',_0x3b0e('0x4'),_0x3b0e('0x5'),_0x3b0e('0x6')),'defaultValue':_0x3b0e('0x3')},'content':{'type':Sequelize[_0x3b0e('0x7')]},'key':{'type':Sequelize[_0x3b0e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3b0e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x3b0e('0x7')]},'idField':{'type':Sequelize[_0x3b0e('0x7')]},'nameField':{'type':Sequelize[_0x3b0e('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b0e('0x7')]}}; \ No newline at end of file +var _0x25d7=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x2b77d0,_0x11f932){var _0x3b1d83=function(_0x27b661){while(--_0x27b661){_0x2b77d0['push'](_0x2b77d0['shift']());}};_0x3b1d83(++_0x11f932);}(_0x25d7,0x164));var _0x725d=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x25d7[_0xeff2c3];return _0x2cade6;};'use strict';var Sequelize=require('sequelize');module[_0x725d('0x0')]={'type':{'type':Sequelize[_0x725d('0x1')](_0x725d('0x2'),_0x725d('0x3'),_0x725d('0x4'),_0x725d('0x5'),'picklist'),'defaultValue':_0x725d('0x2')},'content':{'type':Sequelize[_0x725d('0x6')]},'key':{'type':Sequelize[_0x725d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x725d('0x2'),_0x725d('0x3'),_0x725d('0x4'))},'keyContent':{'type':Sequelize[_0x725d('0x6')]},'idField':{'type':Sequelize[_0x725d('0x6')]},'nameField':{'type':Sequelize[_0x725d('0x6')]},'customField':{'type':Sequelize[_0x725d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x725d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 819e99c..66b8a77 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f09=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4f09,0x18b));var _0x94f0=function(_0x1f8eb8,_0xfc4345){_0x1f8eb8=_0x1f8eb8-0x0;var _0x37ca05=_0x4f09[_0x1f8eb8];return _0x37ca05;};'use strict';var emlformat=require(_0x94f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94f0('0x1'));var jsonpatch=require(_0x94f0('0x2'));var rp=require('request-promise');var moment=require(_0x94f0('0x3'));var BPromise=require(_0x94f0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x94f0('0x5'));var sox=require(_0x94f0('0x6'));var csv=require(_0x94f0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x94f0('0x8'));var _=require('lodash');var squel=require(_0x94f0('0x9'));var crypto=require(_0x94f0('0xa'));var jsforce=require(_0x94f0('0xb'));var deskjs=require(_0x94f0('0xc'));var toCsv=require(_0x94f0('0x7'));var querystring=require(_0x94f0('0xd'));var Papa=require(_0x94f0('0xe'));var Redis=require(_0x94f0('0xf'));var authService=require(_0x94f0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x94f0('0x11'));var hardwareService=require(_0x94f0('0x12'));var logger=require(_0x94f0('0x13'))(_0x94f0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x94f0('0x15'));var db=require(_0x94f0('0x16'))['db'];function respondWithStatusCode(_0x1a85ed,_0x420dcd){_0x420dcd=_0x420dcd||0xcc;return function(_0x2d373b){if(_0x2d373b){return _0x1a85ed[_0x94f0('0x17')](_0x420dcd);}return _0x1a85ed['status'](_0x420dcd)[_0x94f0('0x18')]();};}function respondWithResult(_0x6f008e,_0x3ead46){_0x3ead46=_0x3ead46||0xc8;return function(_0x377bbb){if(_0x377bbb){return _0x6f008e[_0x94f0('0x19')](_0x3ead46)[_0x94f0('0x1a')](_0x377bbb);}};}function respondWithFilteredResult(_0x17f08d,_0x3de1eb){return function(_0x245d1d){if(_0x245d1d){var _0x4b8488=typeof _0x3de1eb['offset']===_0x94f0('0x1b')&&typeof _0x3de1eb[_0x94f0('0x1c')]===_0x94f0('0x1b');var _0x5a5918=_0x245d1d[_0x94f0('0x1d')];var _0x5d1c0e=_0x4b8488?0x0:_0x3de1eb[_0x94f0('0x1e')];var _0x39956a=_0x4b8488?_0x245d1d['count']:_0x3de1eb[_0x94f0('0x1e')]+_0x3de1eb[_0x94f0('0x1c')];var _0x119296;if(_0x39956a>=_0x5a5918){_0x39956a=_0x5a5918;_0x119296=0xc8;}else{_0x119296=0xce;}_0x17f08d[_0x94f0('0x19')](_0x119296);return _0x17f08d['set'](_0x94f0('0x1f'),_0x5d1c0e+'-'+_0x39956a+'/'+_0x5a5918)[_0x94f0('0x1a')](_0x245d1d);}return null;};}function patchUpdates(_0x48b419){return function(_0x7d80c1){try{jsonpatch[_0x94f0('0x20')](_0x7d80c1,_0x48b419,!![]);}catch(_0x3bed79){return BPromise[_0x94f0('0x21')](_0x3bed79);}return _0x7d80c1[_0x94f0('0x22')]();};}function saveUpdates(_0x13b5d2,_0x20e671){return function(_0x1a0d89){if(_0x1a0d89){return _0x1a0d89['update'](_0x13b5d2)['then'](function(_0xdde2c2){return _0xdde2c2;});}return null;};}function removeEntity(_0x64b350,_0x32667a){return function(_0x5d6cbc){if(_0x5d6cbc){return _0x5d6cbc[_0x94f0('0x23')]()[_0x94f0('0x24')](function(){_0x64b350[_0x94f0('0x19')](0xcc)[_0x94f0('0x18')]();});}};}function handleEntityNotFound(_0x3c097c,_0x5a314d){return function(_0x5f156b){if(!_0x5f156b){_0x3c097c['sendStatus'](0x194);}return _0x5f156b;};}function handleError(_0x1597c7,_0x25b2e7){_0x25b2e7=_0x25b2e7||0x1f4;return function(_0x2cd681){logger['error'](_0x2cd681[_0x94f0('0x25')]);if(_0x2cd681[_0x94f0('0x26')]){delete _0x2cd681[_0x94f0('0x26')];}_0x1597c7[_0x94f0('0x19')](_0x25b2e7)[_0x94f0('0x27')](_0x2cd681);};}exports['index']=function(_0x1dcf47,_0x6ef070){var _0x5041fc={},_0x794311={},_0x458a8d={'count':0x0,'rows':[]};var _0x1329fa=_[_0x94f0('0x28')](db[_0x94f0('0x29')][_0x94f0('0x2a')],function(_0x5254d7){return{'name':_0x5254d7[_0x94f0('0x2b')],'type':_0x5254d7[_0x94f0('0x2c')][_0x94f0('0x2d')]};});_0x794311[_0x94f0('0x2e')]=_[_0x94f0('0x28')](_0x1329fa,_0x94f0('0x26'));_0x794311[_0x94f0('0x2f')]=_[_0x94f0('0x30')](_0x1dcf47[_0x94f0('0x2f')]);_0x794311[_0x94f0('0x31')]=_[_0x94f0('0x32')](_0x794311[_0x94f0('0x2e')],_0x794311[_0x94f0('0x2f')]);_0x5041fc[_0x94f0('0x33')]=_[_0x94f0('0x32')](_0x794311[_0x94f0('0x2e')],qs[_0x94f0('0x34')](_0x1dcf47[_0x94f0('0x2f')]['fields']));_0x5041fc[_0x94f0('0x33')]=_0x5041fc['attributes'][_0x94f0('0x35')]?_0x5041fc[_0x94f0('0x33')]:_0x794311[_0x94f0('0x2e')];if(!_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x36')](_0x94f0('0x37'))){_0x5041fc[_0x94f0('0x1c')]=qs[_0x94f0('0x1c')](_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x1c')]);_0x5041fc[_0x94f0('0x1e')]=qs[_0x94f0('0x1e')](_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x1e')]);}_0x5041fc[_0x94f0('0x38')]=qs[_0x94f0('0x39')](_0x1dcf47['query'][_0x94f0('0x39')]);_0x5041fc[_0x94f0('0x3a')]=qs[_0x94f0('0x31')](_[_0x94f0('0x3b')](_0x1dcf47[_0x94f0('0x2f')],_0x794311[_0x94f0('0x31')]),_0x1329fa);if(_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x3c')]){_0x5041fc[_0x94f0('0x3a')]=_['merge'](_0x5041fc[_0x94f0('0x3a')],{'$or':_[_0x94f0('0x28')](_0x1329fa,function(_0x39d9ce){if(_0x39d9ce[_0x94f0('0x2c')]!==_0x94f0('0x3d')){var _0xa3682e={};_0xa3682e[_0x39d9ce[_0x94f0('0x26')]]={'$like':'%'+_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x3c')]+'%'};return _0xa3682e;}})});}_0x5041fc=_[_0x94f0('0x3e')]({},_0x5041fc,_0x1dcf47[_0x94f0('0x3f')]);var _0x784d8={'where':_0x5041fc[_0x94f0('0x3a')]};return db['ZendeskField']['count'](_0x784d8)[_0x94f0('0x24')](function(_0x21961c){_0x458a8d['count']=_0x21961c;if(_0x1dcf47[_0x94f0('0x2f')][_0x94f0('0x40')]){_0x5041fc[_0x94f0('0x41')]=[{'all':!![]}];}return db[_0x94f0('0x29')][_0x94f0('0x42')](_0x5041fc);})[_0x94f0('0x24')](function(_0x50f68d){_0x458a8d[_0x94f0('0x43')]=_0x50f68d;return _0x458a8d;})[_0x94f0('0x24')](respondWithFilteredResult(_0x6ef070,_0x5041fc))[_0x94f0('0x44')](handleError(_0x6ef070,null));};exports[_0x94f0('0x45')]=function(_0x3dd018,_0x34e6dd){var _0x3450a3={'raw':!![],'where':{'id':_0x3dd018['params']['id']}},_0x56b1aa={};_0x56b1aa[_0x94f0('0x2e')]=_[_0x94f0('0x30')](db['ZendeskField']['rawAttributes']);_0x56b1aa[_0x94f0('0x2f')]=_[_0x94f0('0x30')](_0x3dd018[_0x94f0('0x2f')]);_0x56b1aa['filters']=_[_0x94f0('0x32')](_0x56b1aa[_0x94f0('0x2e')],_0x56b1aa[_0x94f0('0x2f')]);_0x3450a3[_0x94f0('0x33')]=_[_0x94f0('0x32')](_0x56b1aa[_0x94f0('0x2e')],qs['fields'](_0x3dd018[_0x94f0('0x2f')][_0x94f0('0x34')]));_0x3450a3['attributes']=_0x3450a3[_0x94f0('0x33')]['length']?_0x3450a3['attributes']:_0x56b1aa[_0x94f0('0x2e')];if(_0x3dd018['query'][_0x94f0('0x40')]){_0x3450a3[_0x94f0('0x41')]=[{'all':!![]}];}_0x3450a3=_['merge']({},_0x3450a3,_0x3dd018[_0x94f0('0x3f')]);return db[_0x94f0('0x29')]['find'](_0x3450a3)['then'](handleEntityNotFound(_0x34e6dd,null))['then'](respondWithResult(_0x34e6dd,null))['catch'](handleError(_0x34e6dd,null));};exports[_0x94f0('0x46')]=function(_0x3497bc,_0x13ece1){return db[_0x94f0('0x29')]['create'](_0x3497bc[_0x94f0('0x47')],{})['then'](respondWithResult(_0x13ece1,0xc9))[_0x94f0('0x44')](handleError(_0x13ece1,null));};exports[_0x94f0('0x48')]=function(_0x291d20,_0x29e8a9){if(_0x291d20[_0x94f0('0x47')]['id']){delete _0x291d20[_0x94f0('0x47')]['id'];}return db['ZendeskField'][_0x94f0('0x49')]({'where':{'id':_0x291d20[_0x94f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29e8a9,null))[_0x94f0('0x24')](saveUpdates(_0x291d20[_0x94f0('0x47')],null))[_0x94f0('0x24')](respondWithResult(_0x29e8a9,null))[_0x94f0('0x44')](handleError(_0x29e8a9,null));};exports[_0x94f0('0x23')]=function(_0x152076,_0x382d66){return db[_0x94f0('0x29')][_0x94f0('0x49')]({'where':{'id':_0x152076[_0x94f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x382d66,null))[_0x94f0('0x24')](removeEntity(_0x382d66,null))[_0x94f0('0x44')](handleError(_0x382d66,null));}; \ No newline at end of file +var _0xe148=['where','pick','merge','VIRTUAL','filter','includeAll','ZendeskField','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x52706f,_0x50d4a8){var _0x1c1633=function(_0x293f86){while(--_0x293f86){_0x52706f['push'](_0x52706f['shift']());}};_0x1c1633(++_0x50d4a8);}(_0xe148,0x9e));var _0x8e14=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xe148[_0x26c112];return _0x4933d8;};'use strict';var emlformat=require(_0x8e14('0x0'));var rimraf=require(_0x8e14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e14('0x2'));var rp=require(_0x8e14('0x3'));var moment=require('moment');var BPromise=require(_0x8e14('0x4'));var Mustache=require(_0x8e14('0x5'));var util=require(_0x8e14('0x6'));var path=require(_0x8e14('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e14('0x8'));var fs=require('fs');var fs_extra=require(_0x8e14('0x9'));var _=require('lodash');var squel=require(_0x8e14('0xa'));var crypto=require(_0x8e14('0xb'));var jsforce=require(_0x8e14('0xc'));var deskjs=require(_0x8e14('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e14('0xe'));var Papa=require('papaparse');var Redis=require(_0x8e14('0xf'));var authService=require(_0x8e14('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e14('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e14('0x12'));var utils=require(_0x8e14('0x13'));var config=require(_0x8e14('0x14'));var licenseUtil=require(_0x8e14('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243e4f,_0x5712fe){_0x5712fe=_0x5712fe||0xcc;return function(_0x5c49d9){if(_0x5c49d9){return _0x243e4f[_0x8e14('0x16')](_0x5712fe);}return _0x243e4f['status'](_0x5712fe)[_0x8e14('0x17')]();};}function respondWithResult(_0x4e1223,_0x59e069){_0x59e069=_0x59e069||0xc8;return function(_0x4f36a5){if(_0x4f36a5){return _0x4e1223[_0x8e14('0x18')](_0x59e069)[_0x8e14('0x19')](_0x4f36a5);}};}function respondWithFilteredResult(_0x13bdc0,_0x128217){return function(_0x40b964){if(_0x40b964){var _0x50db2e=typeof _0x128217[_0x8e14('0x1a')]===_0x8e14('0x1b')&&typeof _0x128217['limit']===_0x8e14('0x1b');var _0x201f86=_0x40b964[_0x8e14('0x1c')];var _0x169b84=_0x50db2e?0x0:_0x128217[_0x8e14('0x1a')];var _0x2510ce=_0x50db2e?_0x40b964[_0x8e14('0x1c')]:_0x128217[_0x8e14('0x1a')]+_0x128217[_0x8e14('0x1d')];var _0x2d1771;if(_0x2510ce>=_0x201f86){_0x2510ce=_0x201f86;_0x2d1771=0xc8;}else{_0x2d1771=0xce;}_0x13bdc0['status'](_0x2d1771);return _0x13bdc0[_0x8e14('0x1e')](_0x8e14('0x1f'),_0x169b84+'-'+_0x2510ce+'/'+_0x201f86)['json'](_0x40b964);}return null;};}function patchUpdates(_0x13587d){return function(_0x5a7d38){try{jsonpatch[_0x8e14('0x20')](_0x5a7d38,_0x13587d,!![]);}catch(_0x5550cb){return BPromise[_0x8e14('0x21')](_0x5550cb);}return _0x5a7d38[_0x8e14('0x22')]();};}function saveUpdates(_0x16d8e6,_0x4b3de5){return function(_0x23c5eb){if(_0x23c5eb){return _0x23c5eb[_0x8e14('0x23')](_0x16d8e6)['then'](function(_0x184cbd){return _0x184cbd;});}return null;};}function removeEntity(_0x2b7ff5,_0x1244d3){return function(_0x52b041){if(_0x52b041){return _0x52b041[_0x8e14('0x24')]()[_0x8e14('0x25')](function(){_0x2b7ff5[_0x8e14('0x18')](0xcc)[_0x8e14('0x17')]();});}};}function handleEntityNotFound(_0x5a0860,_0x28ee4a){return function(_0x5b4af3){if(!_0x5b4af3){_0x5a0860['sendStatus'](0x194);}return _0x5b4af3;};}function handleError(_0x2ad93d,_0x43b6db){_0x43b6db=_0x43b6db||0x1f4;return function(_0x356200){logger['error'](_0x356200[_0x8e14('0x26')]);if(_0x356200[_0x8e14('0x27')]){delete _0x356200[_0x8e14('0x27')];}_0x2ad93d[_0x8e14('0x18')](_0x43b6db)['send'](_0x356200);};}exports['index']=function(_0x2d88db,_0x46e737){var _0x170e0b={},_0x9eb6a7={},_0x292f44={'count':0x0,'rows':[]};var _0x21d9c8=_[_0x8e14('0x28')](db['ZendeskField'][_0x8e14('0x29')],function(_0xb116a6){return{'name':_0xb116a6[_0x8e14('0x2a')],'type':_0xb116a6[_0x8e14('0x2b')]['key']};});_0x9eb6a7[_0x8e14('0x2c')]=_[_0x8e14('0x28')](_0x21d9c8,_0x8e14('0x27'));_0x9eb6a7[_0x8e14('0x2d')]=_[_0x8e14('0x2e')](_0x2d88db[_0x8e14('0x2d')]);_0x9eb6a7[_0x8e14('0x2f')]=_[_0x8e14('0x30')](_0x9eb6a7[_0x8e14('0x2c')],_0x9eb6a7[_0x8e14('0x2d')]);_0x170e0b[_0x8e14('0x31')]=_['intersection'](_0x9eb6a7[_0x8e14('0x2c')],qs[_0x8e14('0x32')](_0x2d88db[_0x8e14('0x2d')]['fields']));_0x170e0b['attributes']=_0x170e0b[_0x8e14('0x31')][_0x8e14('0x33')]?_0x170e0b['attributes']:_0x9eb6a7[_0x8e14('0x2c')];if(!_0x2d88db[_0x8e14('0x2d')]['hasOwnProperty'](_0x8e14('0x34'))){_0x170e0b['limit']=qs[_0x8e14('0x1d')](_0x2d88db[_0x8e14('0x2d')][_0x8e14('0x1d')]);_0x170e0b[_0x8e14('0x1a')]=qs['offset'](_0x2d88db[_0x8e14('0x2d')][_0x8e14('0x1a')]);}_0x170e0b[_0x8e14('0x35')]=qs['sort'](_0x2d88db[_0x8e14('0x2d')][_0x8e14('0x36')]);_0x170e0b[_0x8e14('0x37')]=qs['filters'](_[_0x8e14('0x38')](_0x2d88db[_0x8e14('0x2d')],_0x9eb6a7[_0x8e14('0x2f')]),_0x21d9c8);if(_0x2d88db[_0x8e14('0x2d')]['filter']){_0x170e0b[_0x8e14('0x37')]=_[_0x8e14('0x39')](_0x170e0b['where'],{'$or':_[_0x8e14('0x28')](_0x21d9c8,function(_0x123ac3){if(_0x123ac3[_0x8e14('0x2b')]!==_0x8e14('0x3a')){var _0x33a950={};_0x33a950[_0x123ac3[_0x8e14('0x27')]]={'$like':'%'+_0x2d88db[_0x8e14('0x2d')][_0x8e14('0x3b')]+'%'};return _0x33a950;}})});}_0x170e0b=_['merge']({},_0x170e0b,_0x2d88db['options']);var _0x531e19={'where':_0x170e0b[_0x8e14('0x37')]};return db['ZendeskField'][_0x8e14('0x1c')](_0x531e19)[_0x8e14('0x25')](function(_0x1593fb){_0x292f44['count']=_0x1593fb;if(_0x2d88db[_0x8e14('0x2d')][_0x8e14('0x3c')]){_0x170e0b['include']=[{'all':!![]}];}return db[_0x8e14('0x3d')][_0x8e14('0x3e')](_0x170e0b);})[_0x8e14('0x25')](function(_0x13f85a){_0x292f44[_0x8e14('0x3f')]=_0x13f85a;return _0x292f44;})[_0x8e14('0x25')](respondWithFilteredResult(_0x46e737,_0x170e0b))[_0x8e14('0x40')](handleError(_0x46e737,null));};exports[_0x8e14('0x41')]=function(_0x10bcf6,_0x3adda6){var _0x59fde1={'raw':!![],'where':{'id':_0x10bcf6['params']['id']}},_0x425a63={};_0x425a63[_0x8e14('0x2c')]=_['keys'](db[_0x8e14('0x3d')][_0x8e14('0x29')]);_0x425a63[_0x8e14('0x2d')]=_['keys'](_0x10bcf6[_0x8e14('0x2d')]);_0x425a63[_0x8e14('0x2f')]=_['intersection'](_0x425a63[_0x8e14('0x2c')],_0x425a63[_0x8e14('0x2d')]);_0x59fde1['attributes']=_[_0x8e14('0x30')](_0x425a63[_0x8e14('0x2c')],qs[_0x8e14('0x32')](_0x10bcf6['query'][_0x8e14('0x32')]));_0x59fde1[_0x8e14('0x31')]=_0x59fde1[_0x8e14('0x31')][_0x8e14('0x33')]?_0x59fde1[_0x8e14('0x31')]:_0x425a63[_0x8e14('0x2c')];if(_0x10bcf6[_0x8e14('0x2d')][_0x8e14('0x3c')]){_0x59fde1['include']=[{'all':!![]}];}_0x59fde1=_[_0x8e14('0x39')]({},_0x59fde1,_0x10bcf6[_0x8e14('0x42')]);return db['ZendeskField'][_0x8e14('0x43')](_0x59fde1)[_0x8e14('0x25')](handleEntityNotFound(_0x3adda6,null))[_0x8e14('0x25')](respondWithResult(_0x3adda6,null))[_0x8e14('0x40')](handleError(_0x3adda6,null));};exports[_0x8e14('0x44')]=function(_0x4ab576,_0x335de9){return db[_0x8e14('0x3d')][_0x8e14('0x44')](_0x4ab576['body'],{})[_0x8e14('0x25')](respondWithResult(_0x335de9,0xc9))[_0x8e14('0x40')](handleError(_0x335de9,null));};exports['update']=function(_0x23e0d8,_0x398f66){if(_0x23e0d8['body']['id']){delete _0x23e0d8[_0x8e14('0x45')]['id'];}return db[_0x8e14('0x3d')]['find']({'where':{'id':_0x23e0d8[_0x8e14('0x46')]['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0x398f66,null))[_0x8e14('0x25')](saveUpdates(_0x23e0d8[_0x8e14('0x45')],null))['then'](respondWithResult(_0x398f66,null))[_0x8e14('0x40')](handleError(_0x398f66,null));};exports['destroy']=function(_0x4427a3,_0x3aefeb){return db[_0x8e14('0x3d')][_0x8e14('0x43')]({'where':{'id':_0x4427a3['params']['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0x3aefeb,null))[_0x8e14('0x25')](removeEntity(_0x3aefeb,null))['catch'](handleError(_0x3aefeb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 514bfd6..72d7bd1 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5c5=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x41aaa5,_0x5d880b){var _0x35c60f=function(_0x4bf487){while(--_0x4bf487){_0x41aaa5['push'](_0x41aaa5['shift']());}};_0x35c60f(++_0x5d880b);}(_0xe5c5,0x1ea));var _0x5e5c=function(_0x2a9dc0,_0x2235cb){_0x2a9dc0=_0x2a9dc0-0x0;var _0xc686be=_0xe5c5[_0x2a9dc0];return _0xc686be;};'use strict';var _=require('lodash');var util=require(_0x5e5c('0x0'));var logger=require(_0x5e5c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5e5c('0x2'));var rp=require(_0x5e5c('0x3'));var fs=require('fs');var path=require(_0x5e5c('0x4'));var rimraf=require(_0x5e5c('0x5'));var config=require(_0x5e5c('0x6'));var attributes=require(_0x5e5c('0x7'));module[_0x5e5c('0x8')]=function(_0x1e3043,_0x703792){return _0x1e3043['define'](_0x5e5c('0x9'),attributes,{'tableName':_0x5e5c('0xa'),'paranoid':![],'indexes':[{'name':_0x5e5c('0xb'),'fields':[_0x5e5c('0xc'),_0x5e5c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x289a=['bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','lodash','util','../../config/logger','moment'];(function(_0x4c43ab,_0x49c9b1){var _0x5adb5c=function(_0x554c52){while(--_0x554c52){_0x4c43ab['push'](_0x4c43ab['shift']());}};_0x5adb5c(++_0x49c9b1);}(_0x289a,0x1d8));var _0xa289=function(_0x4d4223,_0x325b3b){_0x4d4223=_0x4d4223-0x0;var _0x2f5cd7=_0x289a[_0x4d4223];return _0x2f5cd7;};'use strict';var _=require(_0xa289('0x0'));var util=require(_0xa289('0x1'));var logger=require(_0xa289('0x2'))('api');var moment=require(_0xa289('0x3'));var BPromise=require(_0xa289('0x4'));var rp=require(_0xa289('0x5'));var fs=require('fs');var path=require(_0xa289('0x6'));var rimraf=require(_0xa289('0x7'));var config=require('../../config/environment');var attributes=require(_0xa289('0x8'));module[_0xa289('0x9')]=function(_0x4179ce,_0x27269c){return _0x4179ce[_0xa289('0xa')](_0xa289('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xa289('0xc'),'fields':[_0xa289('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 0d669c4..bbf5f56 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54a2=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x54a2,0x1cc));var _0x254a=function(_0x4d763d,_0x2e9bec){_0x4d763d=_0x4d763d-0x0;var _0x3e74b7=_0x54a2[_0x4d763d];return _0x3e74b7;};'use strict';var _=require(_0x254a('0x0'));var util=require(_0x254a('0x1'));var moment=require(_0x254a('0x2'));var BPromise=require(_0x254a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x254a('0x4'));var db=require(_0x254a('0x5'))['db'];var utils=require(_0x254a('0x6'));var logger=require(_0x254a('0x7'))('rpc');var config=require(_0x254a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x254a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122dda,_0x253714,_0xedbe82){return new BPromise(function(_0xf3f97,_0x1a030b){return client[_0x254a('0xa')](_0x122dda,_0xedbe82)['then'](function(_0x334a22){logger[_0x254a('0xb')]('ZendeskField,\x20%s,\x20%s',_0x253714,_0x254a('0xc'));logger[_0x254a('0xd')](_0x254a('0xe'),_0x253714,_0x254a('0xc'),JSON[_0x254a('0xf')](_0x334a22));if(_0x334a22[_0x254a('0x10')]){if(_0x334a22[_0x254a('0x10')]['code']===0x1f4){logger[_0x254a('0x10')](_0x254a('0x11'),_0x253714,_0x334a22[_0x254a('0x10')][_0x254a('0x12')]);return _0x1a030b(_0x334a22[_0x254a('0x10')][_0x254a('0x12')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x253714,_0x334a22['error'][_0x254a('0x12')]);return _0xf3f97(_0x334a22['error'][_0x254a('0x12')]);}else{logger[_0x254a('0xb')](_0x254a('0x11'),_0x253714,_0x254a('0xc'));_0xf3f97(_0x334a22[_0x254a('0x13')][_0x254a('0x12')]);}})[_0x254a('0x14')](function(_0x1c7081){logger['error'](_0x254a('0x11'),_0x253714,_0x1c7081);_0x1a030b(_0x1c7081);});});} \ No newline at end of file +var _0xbe41=['ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbe41,0x1ba));var _0x1be4=function(_0x396229,_0x55b756){_0x396229=_0x396229-0x0;var _0x1c9bce=_0xbe41[_0x396229];return _0x1c9bce;};'use strict';var _=require(_0x1be4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1be4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1be4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1be4('0x3'));var logger=require('../../config/logger')(_0x1be4('0x4'));var config=require(_0x1be4('0x5'));var jayson=require(_0x1be4('0x6'));var client=jayson[_0x1be4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484ca1,_0x23b6df,_0x397bfd){return new BPromise(function(_0x1a613f,_0x48db4f){return client[_0x1be4('0x8')](_0x484ca1,_0x397bfd)[_0x1be4('0x9')](function(_0x144a42){logger[_0x1be4('0xa')](_0x1be4('0xb'),_0x23b6df,_0x1be4('0xc'));logger[_0x1be4('0xd')](_0x1be4('0xe'),_0x23b6df,_0x1be4('0xc'),JSON['stringify'](_0x144a42));if(_0x144a42[_0x1be4('0xf')]){if(_0x144a42[_0x1be4('0xf')][_0x1be4('0x10')]===0x1f4){logger['error'](_0x1be4('0xb'),_0x23b6df,_0x144a42[_0x1be4('0xf')][_0x1be4('0x11')]);return _0x48db4f(_0x144a42[_0x1be4('0xf')][_0x1be4('0x11')]);}logger[_0x1be4('0xf')](_0x1be4('0xb'),_0x23b6df,_0x144a42['error'][_0x1be4('0x11')]);return _0x1a613f(_0x144a42[_0x1be4('0xf')][_0x1be4('0x11')]);}else{logger[_0x1be4('0xa')](_0x1be4('0xb'),_0x23b6df,'request\x20sent');_0x1a613f(_0x144a42['result'][_0x1be4('0x11')]);}})[_0x1be4('0x12')](function(_0x541218){logger[_0x1be4('0xf')](_0x1be4('0xb'),_0x23b6df,_0x541218);_0x48db4f(_0x541218);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e5d2cd2..072b674 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbe0=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration'];(function(_0x3ea605,_0x50a649){var _0x43d80a=function(_0x339364){while(--_0x339364){_0x3ea605['push'](_0x3ea605['shift']());}};_0x43d80a(++_0x50a649);}(_0xfbe0,0xe2));var _0x0fbe=function(_0x2ce688,_0x31576c){_0x2ce688=_0x2ce688-0x0;var _0x447877=_0xfbe0[_0x2ce688];return _0x447877;};'use strict';var multer=require(_0x0fbe('0x0'));var util=require(_0x0fbe('0x1'));var path=require(_0x0fbe('0x2'));var timeout=require(_0x0fbe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0fbe('0x4'));var interaction=require(_0x0fbe('0x5'));var config=require(_0x0fbe('0x6'));var controller=require('./intZohoAccount.controller');router[_0x0fbe('0x7')]('/',auth['isAuthenticated'](),controller[_0x0fbe('0x8')]);router[_0x0fbe('0x7')]('/:id',auth[_0x0fbe('0x9')](),controller[_0x0fbe('0xa')]);router[_0x0fbe('0x7')](_0x0fbe('0xb'),auth[_0x0fbe('0x9')](),controller[_0x0fbe('0xc')]);router[_0x0fbe('0x7')]('/:id/fields',auth[_0x0fbe('0x9')](),controller[_0x0fbe('0xd')]);router[_0x0fbe('0xe')]('/',auth[_0x0fbe('0x9')](),controller['create']);router[_0x0fbe('0xe')](_0x0fbe('0xb'),auth[_0x0fbe('0x9')](),controller[_0x0fbe('0xf')]);router[_0x0fbe('0x10')](_0x0fbe('0x11'),auth[_0x0fbe('0x9')](),controller[_0x0fbe('0x12')]);router[_0x0fbe('0x13')](_0x0fbe('0x11'),auth[_0x0fbe('0x9')](),controller[_0x0fbe('0x14')]);module[_0x0fbe('0x15')]=router; \ No newline at end of file +var _0x4323=['/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x30dfa9,_0x21a382){var _0x1c30d0=function(_0x4766d4){while(--_0x4766d4){_0x30dfa9['push'](_0x30dfa9['shift']());}};_0x1c30d0(++_0x21a382);}(_0x4323,0x1bb));var _0x3432=function(_0x5be211,_0x236afd){_0x5be211=_0x5be211-0x0;var _0x2f1a8c=_0x4323[_0x5be211];return _0x2f1a8c;};'use strict';var multer=require(_0x3432('0x0'));var util=require(_0x3432('0x1'));var path=require('path');var timeout=require(_0x3432('0x2'));var express=require(_0x3432('0x3'));var router=express[_0x3432('0x4')]();var fs_extra=require(_0x3432('0x5'));var auth=require(_0x3432('0x6'));var interaction=require(_0x3432('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x3432('0x8')]('/',auth[_0x3432('0x9')](),controller[_0x3432('0xa')]);router['get'](_0x3432('0xb'),auth[_0x3432('0x9')](),controller[_0x3432('0xc')]);router['get'](_0x3432('0xd'),auth[_0x3432('0x9')](),controller[_0x3432('0xe')]);router[_0x3432('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3432('0xf')]);router[_0x3432('0x10')]('/',auth['isAuthenticated'](),controller[_0x3432('0x11')]);router['post'](_0x3432('0xd'),auth[_0x3432('0x9')](),controller[_0x3432('0x12')]);router[_0x3432('0x13')]('/:id',auth[_0x3432('0x9')](),controller[_0x3432('0x14')]);router[_0x3432('0x15')]('/:id',auth[_0x3432('0x9')](),controller[_0x3432('0x16')]);module[_0x3432('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 786700e..8ca2f3c 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING'];(function(_0x53c779,_0x5e8a93){var _0x485933=function(_0x58dd99){while(--_0x58dd99){_0x53c779['push'](_0x53c779['shift']());}};_0x485933(++_0x5e8a93);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0xcb91[_0x5f519b];return _0x2461e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')]},'description':{'type':Sequelize[_0x1cb9('0x0')]},'host':{'type':Sequelize[_0x1cb9('0x0')]},'zone':{'type':Sequelize[_0x1cb9('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1cb9('0x0')]},'serverUrl':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x1cb9('0x0')]}}; \ No newline at end of file +var _0x4522=['STRING'];(function(_0x20ab50,_0x55d183){var _0x2e3873=function(_0x4eb73b){while(--_0x4eb73b){_0x20ab50['push'](_0x20ab50['shift']());}};_0x2e3873(++_0x55d183);}(_0x4522,0x1a0));var _0x2452=function(_0x48262a,_0x2660d8){_0x48262a=_0x48262a-0x0;var _0x16f99c=_0x4522[_0x48262a];return _0x16f99c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2452('0x0')]},'description':{'type':Sequelize[_0x2452('0x0')]},'host':{'type':Sequelize[_0x2452('0x0')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2452('0x0')]},'clientSecret':{'type':Sequelize[_0x2452('0x0')]},'serverUrl':{'type':Sequelize[_0x2452('0x0')],'allowNull':![]},'code':{'type':Sequelize[_0x2452('0x0')]},'refreshToken':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 4e184d1..bebe983 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bb8=['includeAll','options','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','ZohoConfiguration','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','code','host','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','system_mandatory','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','ZohoAccount','include','rows','catch','params'];(function(_0x112435,_0x28583c){var _0x9c492b=function(_0x289f3f){while(--_0x289f3f){_0x112435['push'](_0x112435['shift']());}};_0x9c492b(++_0x28583c);}(_0x8bb8,0xb5));var _0x88bb=function(_0xb3f627,_0x13268e){_0xb3f627=_0xb3f627-0x0;var _0x1be684=_0x8bb8[_0xb3f627];return _0x1be684;};'use strict';var emlformat=require(_0x88bb('0x0'));var rimraf=require(_0x88bb('0x1'));var zipdir=require(_0x88bb('0x2'));var jsonpatch=require(_0x88bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x88bb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x88bb('0x5'));var sox=require(_0x88bb('0x6'));var csv=require('to-csv');var ejs=require(_0x88bb('0x7'));var fs=require('fs');var fs_extra=require(_0x88bb('0x8'));var _=require('lodash');var squel=require(_0x88bb('0x9'));var crypto=require(_0x88bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x88bb('0xb'));var toCsv=require('to-csv');var querystring=require(_0x88bb('0xc'));var Papa=require(_0x88bb('0xd'));var Redis=require('ioredis');var authService=require(_0x88bb('0xe'));var qs=require(_0x88bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88bb('0x10'));var logger=require(_0x88bb('0x11'))(_0x88bb('0x12'));var utils=require(_0x88bb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x88bb('0x14'));var db=require(_0x88bb('0x15'))['db'];var integrations=require(_0x88bb('0x16'));function respondWithStatusCode(_0x5657a0,_0x5f230e){_0x5f230e=_0x5f230e||0xcc;return function(_0x5a1cd4){if(_0x5a1cd4){return _0x5657a0[_0x88bb('0x17')](_0x5f230e);}return _0x5657a0[_0x88bb('0x18')](_0x5f230e)[_0x88bb('0x19')]();};}function respondWithResult(_0x3e3858,_0x3de592){_0x3de592=_0x3de592||0xc8;return function(_0x189fd0){if(_0x189fd0){return _0x3e3858[_0x88bb('0x18')](_0x3de592)[_0x88bb('0x1a')](_0x189fd0);}};}function respondWithFilteredResult(_0x3edc09,_0x50319c){return function(_0x897f7e){if(_0x897f7e){var _0x2b1459=typeof _0x50319c[_0x88bb('0x1b')]===_0x88bb('0x1c')&&typeof _0x50319c['limit']==='undefined';var _0x1d4dc=_0x897f7e[_0x88bb('0x1d')];var _0x100b0d=_0x2b1459?0x0:_0x50319c[_0x88bb('0x1b')];var _0x576922=_0x2b1459?_0x897f7e[_0x88bb('0x1d')]:_0x50319c[_0x88bb('0x1b')]+_0x50319c['limit'];var _0xa88ff3;if(_0x576922>=_0x1d4dc){_0x576922=_0x1d4dc;_0xa88ff3=0xc8;}else{_0xa88ff3=0xce;}_0x3edc09['status'](_0xa88ff3);return _0x3edc09[_0x88bb('0x1e')](_0x88bb('0x1f'),_0x100b0d+'-'+_0x576922+'/'+_0x1d4dc)[_0x88bb('0x1a')](_0x897f7e);}return null;};}function patchUpdates(_0x36d807){return function(_0x2a998e){try{jsonpatch[_0x88bb('0x20')](_0x2a998e,_0x36d807,!![]);}catch(_0x159ccd){return BPromise[_0x88bb('0x21')](_0x159ccd);}return _0x2a998e[_0x88bb('0x22')]();};}function saveUpdates(_0x58d76d,_0x3be49c){return function(_0x33fcd5){if(_0x33fcd5){return _0x33fcd5[_0x88bb('0x23')](_0x58d76d)[_0x88bb('0x24')](function(_0x29b2f0){return _0x29b2f0;});}return null;};}function removeEntity(_0x5b3ec4,_0x44b416){return function(_0x1ddbe7){if(_0x1ddbe7){return _0x1ddbe7[_0x88bb('0x25')]()[_0x88bb('0x24')](function(){_0x5b3ec4[_0x88bb('0x18')](0xcc)[_0x88bb('0x19')]();});}};}function handleEntityNotFound(_0x27a1cc,_0x2a0f8e){return function(_0x4209ef){if(!_0x4209ef){_0x27a1cc[_0x88bb('0x17')](0x194);}return _0x4209ef;};}function handleError(_0x358d24,_0x22f16a){_0x22f16a=_0x22f16a||0x1f4;return function(_0x6e0945){logger[_0x88bb('0x26')](_0x6e0945[_0x88bb('0x27')]);if(_0x6e0945[_0x88bb('0x28')]){delete _0x6e0945[_0x88bb('0x28')];}_0x358d24[_0x88bb('0x18')](_0x22f16a)[_0x88bb('0x29')](_0x6e0945);};}exports['index']=function(_0x296300,_0x108369){var _0x5dd528={},_0x1ae50e={},_0xff2df2={'count':0x0,'rows':[]};var _0x473281=_[_0x88bb('0x2a')](db['ZohoAccount'][_0x88bb('0x2b')],function(_0x45dcfd){return{'name':_0x45dcfd['fieldName'],'type':_0x45dcfd[_0x88bb('0x2c')][_0x88bb('0x2d')]};});_0x1ae50e['model']=_[_0x88bb('0x2a')](_0x473281,_0x88bb('0x28'));_0x1ae50e[_0x88bb('0x2e')]=_[_0x88bb('0x2f')](_0x296300['query']);_0x1ae50e['filters']=_[_0x88bb('0x30')](_0x1ae50e[_0x88bb('0x31')],_0x1ae50e[_0x88bb('0x2e')]);_0x5dd528['attributes']=_['intersection'](_0x1ae50e[_0x88bb('0x31')],qs[_0x88bb('0x32')](_0x296300[_0x88bb('0x2e')][_0x88bb('0x32')]));_0x5dd528[_0x88bb('0x33')]=_0x5dd528['attributes'][_0x88bb('0x34')]?_0x5dd528[_0x88bb('0x33')]:_0x1ae50e['model'];if(!_0x296300[_0x88bb('0x2e')][_0x88bb('0x35')](_0x88bb('0x36'))){_0x5dd528[_0x88bb('0x37')]=qs['limit'](_0x296300['query'][_0x88bb('0x37')]);_0x5dd528['offset']=qs[_0x88bb('0x1b')](_0x296300[_0x88bb('0x2e')]['offset']);}_0x5dd528[_0x88bb('0x38')]=qs['sort'](_0x296300[_0x88bb('0x2e')][_0x88bb('0x39')]);_0x5dd528[_0x88bb('0x3a')]=qs[_0x88bb('0x3b')](_[_0x88bb('0x3c')](_0x296300[_0x88bb('0x2e')],_0x1ae50e[_0x88bb('0x3b')]),_0x473281);if(_0x296300[_0x88bb('0x2e')][_0x88bb('0x3d')]){_0x5dd528[_0x88bb('0x3a')]=_[_0x88bb('0x3e')](_0x5dd528['where'],{'$or':_['map'](_0x473281,function(_0x53589d){if(_0x53589d[_0x88bb('0x2c')]!==_0x88bb('0x3f')){var _0x5b2dc3={};_0x5b2dc3[_0x53589d[_0x88bb('0x28')]]={'$like':'%'+_0x296300[_0x88bb('0x2e')][_0x88bb('0x3d')]+'%'};return _0x5b2dc3;}})});}_0x5dd528=_[_0x88bb('0x3e')]({},_0x5dd528,_0x296300['options']);var _0x206adb={'where':_0x5dd528[_0x88bb('0x3a')]};return db[_0x88bb('0x40')][_0x88bb('0x1d')](_0x206adb)[_0x88bb('0x24')](function(_0x4bd81e){_0xff2df2['count']=_0x4bd81e;if(_0x296300['query']['includeAll']){_0x5dd528[_0x88bb('0x41')]=[{'all':!![]}];}return db[_0x88bb('0x40')]['findAll'](_0x5dd528);})[_0x88bb('0x24')](function(_0x57fb27){_0xff2df2[_0x88bb('0x42')]=_0x57fb27;return _0xff2df2;})[_0x88bb('0x24')](respondWithFilteredResult(_0x108369,_0x5dd528))[_0x88bb('0x43')](handleError(_0x108369,null));};exports['show']=function(_0x4541b7,_0x342740){var _0x3312ed={'raw':![],'where':{'id':_0x4541b7[_0x88bb('0x44')]['id']}},_0x59ad2d={};_0x59ad2d[_0x88bb('0x31')]=_[_0x88bb('0x2f')](db[_0x88bb('0x40')][_0x88bb('0x2b')]);_0x59ad2d[_0x88bb('0x2e')]=_[_0x88bb('0x2f')](_0x4541b7[_0x88bb('0x2e')]);_0x59ad2d['filters']=_[_0x88bb('0x30')](_0x59ad2d['model'],_0x59ad2d[_0x88bb('0x2e')]);_0x3312ed['attributes']=_[_0x88bb('0x30')](_0x59ad2d[_0x88bb('0x31')],qs[_0x88bb('0x32')](_0x4541b7[_0x88bb('0x2e')][_0x88bb('0x32')]));_0x3312ed[_0x88bb('0x33')]=_0x3312ed[_0x88bb('0x33')][_0x88bb('0x34')]?_0x3312ed['attributes']:_0x59ad2d[_0x88bb('0x31')];if(_0x4541b7[_0x88bb('0x2e')][_0x88bb('0x45')]){_0x3312ed[_0x88bb('0x41')]=[{'all':!![]}];}_0x3312ed=_['merge']({},_0x3312ed,_0x4541b7[_0x88bb('0x46')]);return db[_0x88bb('0x40')][_0x88bb('0x47')](_0x3312ed)['then'](handleEntityNotFound(_0x342740,null))['then'](respondWithResult(_0x342740,null))['catch'](handleError(_0x342740,null));};exports['create']=function(_0x20510d,_0x5b3d98){return db[_0x88bb('0x40')][_0x88bb('0x48')](_0x20510d[_0x88bb('0x49')],{})[_0x88bb('0x24')](respondWithResult(_0x5b3d98,0xc9))['catch'](handleError(_0x5b3d98,null));};exports[_0x88bb('0x23')]=function(_0x252480,_0x609726){if(_0x252480['body']['id']){delete _0x252480[_0x88bb('0x49')]['id'];}return db[_0x88bb('0x40')]['find']({'where':{'id':_0x252480[_0x88bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x609726,null))[_0x88bb('0x24')](saveUpdates(_0x252480[_0x88bb('0x49')],null))['then'](respondWithResult(_0x609726,null))[_0x88bb('0x43')](handleError(_0x609726,null));};exports[_0x88bb('0x25')]=function(_0x1051a1,_0xb78e2d){return db[_0x88bb('0x40')][_0x88bb('0x47')]({'where':{'id':_0x1051a1[_0x88bb('0x44')]['id']}})[_0x88bb('0x24')](handleEntityNotFound(_0xb78e2d,null))[_0x88bb('0x24')](removeEntity(_0xb78e2d,null))[_0x88bb('0x43')](handleError(_0xb78e2d,null));};exports[_0x88bb('0x4a')]=function(_0x15c9bb,_0x1809f2,_0x3ced01){var _0x50c73b={};var _0x51e95c={};var _0x274761;var _0xd98f86;return db[_0x88bb('0x40')][_0x88bb('0x4b')]({'where':{'id':_0x15c9bb[_0x88bb('0x44')]['id']}})[_0x88bb('0x24')](handleEntityNotFound(_0x1809f2,null))[_0x88bb('0x24')](function(_0x1039cc){if(_0x1039cc){_0x274761=_0x1039cc;_0x51e95c[_0x88bb('0x31')]=_[_0x88bb('0x2f')](db['ZohoConfiguration'][_0x88bb('0x2b')]);_0x51e95c[_0x88bb('0x2e')]=_[_0x88bb('0x2f')](_0x15c9bb[_0x88bb('0x2e')]);_0x51e95c['filters']=_[_0x88bb('0x30')](_0x51e95c[_0x88bb('0x31')],_0x51e95c['query']);_0x50c73b[_0x88bb('0x33')]=_[_0x88bb('0x30')](_0x51e95c[_0x88bb('0x31')],qs[_0x88bb('0x32')](_0x15c9bb[_0x88bb('0x2e')]['fields']));_0x50c73b[_0x88bb('0x33')]=_0x50c73b[_0x88bb('0x33')][_0x88bb('0x34')]?_0x50c73b[_0x88bb('0x33')]:_0x51e95c[_0x88bb('0x31')];_0x50c73b['order']=qs[_0x88bb('0x39')](_0x15c9bb[_0x88bb('0x2e')][_0x88bb('0x39')]);_0x50c73b[_0x88bb('0x3a')]=qs['filters'](_[_0x88bb('0x3c')](_0x15c9bb[_0x88bb('0x2e')],_0x51e95c[_0x88bb('0x3b')]));if(_0x15c9bb[_0x88bb('0x2e')][_0x88bb('0x3d')]){_0x50c73b[_0x88bb('0x3a')]=_[_0x88bb('0x3e')](_0x50c73b[_0x88bb('0x3a')],{'$or':_[_0x88bb('0x2a')](_0x50c73b[_0x88bb('0x33')],function(_0x1988b1){var _0x19e4ef={};_0x19e4ef[_0x1988b1]={'$like':'%'+_0x15c9bb[_0x88bb('0x2e')]['filter']+'%'};return _0x19e4ef;})});}_0x50c73b=_['merge']({},_0x50c73b,_0x15c9bb[_0x88bb('0x46')]);return _0x274761[_0x88bb('0x4a')](_0x50c73b);}})[_0x88bb('0x24')](function(_0x20e34d){if(_0x20e34d){_0xd98f86=_0x20e34d['length'];if(!_0x15c9bb[_0x88bb('0x2e')][_0x88bb('0x35')](_0x88bb('0x36'))){_0x50c73b[_0x88bb('0x37')]=qs[_0x88bb('0x37')](_0x15c9bb[_0x88bb('0x2e')][_0x88bb('0x37')]);_0x50c73b[_0x88bb('0x1b')]=qs['offset'](_0x15c9bb[_0x88bb('0x2e')][_0x88bb('0x1b')]);}return _0x274761[_0x88bb('0x4a')](_0x50c73b);}})[_0x88bb('0x24')](function(_0x514327){if(_0x514327){return _0x514327?{'count':_0xd98f86,'rows':_0x514327}:null;}})[_0x88bb('0x24')](respondWithResult(_0x1809f2,null))['catch'](handleError(_0x1809f2,null));};exports[_0x88bb('0x4c')]=function(_0x13e83a,_0x58af7e,_0x2967b2){if(_0x13e83a[_0x88bb('0x49')]['id']){delete _0x13e83a['body']['id'];}return db[_0x88bb('0x40')][_0x88bb('0x4b')]({'where':{'id':_0x13e83a[_0x88bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x58af7e,null))[_0x88bb('0x24')](function(_0x3f6d8a){if(_0x3f6d8a){_0x13e83a[_0x88bb('0x49')][_0x88bb('0x4d')]=_0x3f6d8a['id'];_0x13e83a[_0x88bb('0x49')][_0x88bb('0x4e')]=integrations['getSubjects'](_0x13e83a[_0x88bb('0x49')]['channel'],_0x13e83a['body'][_0x88bb('0x2c')]);_0x13e83a['body'][_0x88bb('0x4f')]=integrations[_0x88bb('0x50')](_0x13e83a[_0x88bb('0x49')]['channel'],_0x13e83a['body'][_0x88bb('0x2c')]);return db[_0x88bb('0x51')]['create'](_0x13e83a[_0x88bb('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x88bb('0x4e')},{'model':db['ZohoField'],'as':_0x88bb('0x4f')}]});}return null;})[_0x88bb('0x24')](respondWithResult(_0x58af7e,null))[_0x88bb('0x43')](handleError(_0x58af7e,null));};function getAccessToken(_0x47ef1b){return new Promise(function(_0x1b5774,_0x16a884){var _0x9c2c69;switch(_0x47ef1b[_0x88bb('0x52')]){case'US':_0x9c2c69=_0x88bb('0x53');break;case'AU':_0x9c2c69=_0x88bb('0x54');break;case'EU':_0x9c2c69='https://accounts.zoho.eu';break;case'IN':_0x9c2c69=_0x88bb('0x55');break;case'CN':_0x9c2c69='https://accounts.zoho.com.cn';break;default:_0x9c2c69=_0x88bb('0x56');break;}var _0x27d902={'method':'POST','uri':_0x9c2c69+_0x88bb('0x57'),'qs':{'refresh_token':_0x47ef1b[_0x88bb('0x58')],'client_id':_0x47ef1b[_0x88bb('0x59')],'client_secret':_0x47ef1b['clientSecret'],'grant_type':_0x88bb('0x5a')},'json':!![]};return rp(_0x27d902)['then'](function(_0x19e583){if(_0x19e583[_0x88bb('0x5b')]){_0x1b5774(_0x19e583['access_token']);}else{_0x16a884(_0x88bb('0x5c'));}})[_0x88bb('0x43')](function(_0x439ec3){_0x16a884(_0x439ec3);});});}exports[_0x88bb('0x5d')]=function(_0x1480c8,_0x2c00c6,_0x448b94){var _0x323e0c,_0x14f410,_0x1cc40c,_0x4ab944,_0x47a36c;return db['ZohoAccount'][_0x88bb('0x4b')]({'where':{'id':_0x1480c8[_0x88bb('0x44')]['id']},'attributes':['id','host','zone',_0x88bb('0x59'),_0x88bb('0x5e'),_0x88bb('0x5f'),_0x88bb('0x60'),'refreshToken']})[_0x88bb('0x24')](handleEntityNotFound(_0x2c00c6,null))[_0x88bb('0x24')](function(_0x47d3bf){_0x47a36c=_0x47d3bf;_0x323e0c=_0x47a36c[_0x88bb('0x61')];_0x14f410=_0x323e0c==='zoho.eu'?'eu':_0x88bb('0x62');_0x1cc40c=_0x47a36c['serverUrl'];var _0x26b193=_0x1cc40c[_0x88bb('0x63')](-0x1);if(_0x26b193==='/'||_0x26b193==='\x5c'||_0x26b193===':'){_0x1cc40c=_0x1cc40c[_0x88bb('0x64')](0x0,_0x1cc40c[_0x88bb('0x65')](_0x26b193));}if(!_0x47a36c[_0x88bb('0x58')]){throw new Error(_0x88bb('0x66'));}return getAccessToken(_0x47a36c);})[_0x88bb('0x24')](function(_0x1d10a2){if(_0x1d10a2){return rp({'method':'GET','uri':util[_0x88bb('0x67')](_0x88bb('0x68'),_0x14f410),'qs':{'module':'Calls'},'headers':{'Authorization':_0x88bb('0x69')+_0x1d10a2},'json':!![]});}})[_0x88bb('0x24')](function(_0x3321e9){if(_0x3321e9){if(_0x3321e9[_0x88bb('0x6a')]&&_0x3321e9['response']['error']){throw new Error(_0x3321e9[_0x88bb('0x6a')]['error'][_0x88bb('0x6b')]);}var _0x589659=[];var _0x346741=[];var _0x300135=[_0x88bb('0x6c'),_0x88bb('0x6d'),_0x88bb('0x6e'),_0x88bb('0x6f'),'Call_Duration',_0x88bb('0x70'),_0x88bb('0x71'),'Call_Type'];_0x346741=_[_0x88bb('0x72')](_0x3321e9[_0x88bb('0x32')],function(_0x19d445){return _0x300135[_0x88bb('0x73')](_0x19d445['api_name']);});for(var _0x18b367=0x0;_0x18b367<_0x346741[_0x88bb('0x34')];_0x18b367++){if(_0x346741[_0x18b367][_0x88bb('0x74')]===![]){_0x589659[_0x88bb('0x75')]({'id':_0x346741[_0x18b367]['id'],'name':_0x346741[_0x18b367][_0x88bb('0x76')],'custom':_0x346741[_0x18b367]['custom_field'],'options':_0x346741[_0x18b367][_0x88bb('0x77')]==='picklist'&&_0x346741[_0x18b367][_0x88bb('0x78')][_0x88bb('0x34')]>-0x1?_[_0x88bb('0x2a')](_0x346741[_0x18b367][_0x88bb('0x78')],function(_0x17976e){return{'name':_0x17976e,'value':_0x17976e};}):[]});}}return{'count':_0x589659[_0x88bb('0x34')],'rows':_0x589659};}else{return{'count':0x0,'rows':[]};}})[_0x88bb('0x24')](respondWithResult(_0x2c00c6,null))[_0x88bb('0x43')](function(_0x1c423d){var _0x203801=_0x1480c8[_0x88bb('0x2e')][_0x88bb('0x79')]?0x1f4:_0x1c423d[_0x88bb('0x7a')]||0x1f4;logger[_0x88bb('0x26')](_0x88bb('0x7b'),'getFields',_0x203801,JSON['stringify'](_0x1c423d));delete _0x1c423d[_0x88bb('0x28')];if(_0x203801===0x191){_0x203801=0x190;}_0x2c00c6[_0x88bb('0x18')](_0x203801)[_0x88bb('0x29')](_0x1480c8[_0x88bb('0x2e')][_0x88bb('0x79')]?{'message':_0x88bb('0x7c'),'statusCode':_0x1c423d[_0x88bb('0x7a')]}:_0x1c423d);});}; \ No newline at end of file +var _0x22af=['push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','stack','name','index','map','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','include','rows','show','rawAttributes','intersection','length','find','catch','create','body','update','params','destroy','findOne','ZohoConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','getDescriptions','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','response','error','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory'];(function(_0x3564c3,_0x8358fb){var _0x460b5d=function(_0x551d1f){while(--_0x551d1f){_0x3564c3['push'](_0x3564c3['shift']());}};_0x460b5d(++_0x8358fb);}(_0x22af,0x1a0));var _0xf22a=function(_0x230bb8,_0xa1718){_0x230bb8=_0x230bb8-0x0;var _0x16cb9a=_0x22af[_0x230bb8];return _0x16cb9a;};'use strict';var emlformat=require(_0xf22a('0x0'));var rimraf=require(_0xf22a('0x1'));var zipdir=require(_0xf22a('0x2'));var jsonpatch=require(_0xf22a('0x3'));var rp=require(_0xf22a('0x4'));var moment=require(_0xf22a('0x5'));var BPromise=require(_0xf22a('0x6'));var Mustache=require(_0xf22a('0x7'));var util=require(_0xf22a('0x8'));var path=require(_0xf22a('0x9'));var sox=require(_0xf22a('0xa'));var csv=require('to-csv');var ejs=require(_0xf22a('0xb'));var fs=require('fs');var fs_extra=require(_0xf22a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf22a('0xd'));var jsforce=require(_0xf22a('0xe'));var deskjs=require(_0xf22a('0xf'));var toCsv=require(_0xf22a('0x10'));var querystring=require(_0xf22a('0x11'));var Papa=require(_0xf22a('0x12'));var Redis=require(_0xf22a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf22a('0x14'));var as=require(_0xf22a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf22a('0x16'))(_0xf22a('0x17'));var utils=require(_0xf22a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf22a('0x19'));var db=require(_0xf22a('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b2204,_0x411495){_0x411495=_0x411495||0xcc;return function(_0x41b9b7){if(_0x41b9b7){return _0x1b2204[_0xf22a('0x1b')](_0x411495);}return _0x1b2204['status'](_0x411495)[_0xf22a('0x1c')]();};}function respondWithResult(_0x5b429a,_0x661739){_0x661739=_0x661739||0xc8;return function(_0x2573e3){if(_0x2573e3){return _0x5b429a['status'](_0x661739)['json'](_0x2573e3);}};}function respondWithFilteredResult(_0x37ee72,_0x292b58){return function(_0x488484){if(_0x488484){var _0x223ac2=typeof _0x292b58[_0xf22a('0x1d')]===_0xf22a('0x1e')&&typeof _0x292b58[_0xf22a('0x1f')]===_0xf22a('0x1e');var _0x4ae8bf=_0x488484['count'];var _0x4a3cca=_0x223ac2?0x0:_0x292b58['offset'];var _0xc002cf=_0x223ac2?_0x488484[_0xf22a('0x20')]:_0x292b58[_0xf22a('0x1d')]+_0x292b58[_0xf22a('0x1f')];var _0x52151a;if(_0xc002cf>=_0x4ae8bf){_0xc002cf=_0x4ae8bf;_0x52151a=0xc8;}else{_0x52151a=0xce;}_0x37ee72[_0xf22a('0x21')](_0x52151a);return _0x37ee72[_0xf22a('0x22')](_0xf22a('0x23'),_0x4a3cca+'-'+_0xc002cf+'/'+_0x4ae8bf)[_0xf22a('0x24')](_0x488484);}return null;};}function patchUpdates(_0x13f8fc){return function(_0x40ee39){try{jsonpatch[_0xf22a('0x25')](_0x40ee39,_0x13f8fc,!![]);}catch(_0x26d595){return BPromise[_0xf22a('0x26')](_0x26d595);}return _0x40ee39[_0xf22a('0x27')]();};}function saveUpdates(_0x2804db,_0x511a9d){return function(_0x4cd29d){if(_0x4cd29d){return _0x4cd29d['update'](_0x2804db)[_0xf22a('0x28')](function(_0x5e04cc){return _0x5e04cc;});}return null;};}function removeEntity(_0x5c111d,_0x239b0a){return function(_0x539866){if(_0x539866){return _0x539866['destroy']()[_0xf22a('0x28')](function(){_0x5c111d[_0xf22a('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x942843,_0x184656){return function(_0x5bb8b5){if(!_0x5bb8b5){_0x942843[_0xf22a('0x1b')](0x194);}return _0x5bb8b5;};}function handleError(_0x2d36dd,_0x3837f3){_0x3837f3=_0x3837f3||0x1f4;return function(_0xd8b685){logger['error'](_0xd8b685[_0xf22a('0x29')]);if(_0xd8b685[_0xf22a('0x2a')]){delete _0xd8b685[_0xf22a('0x2a')];}_0x2d36dd[_0xf22a('0x21')](_0x3837f3)['send'](_0xd8b685);};}exports[_0xf22a('0x2b')]=function(_0x1283ad,_0x1c5a03){var _0x4070b0={},_0x380629={},_0x358367={'count':0x0,'rows':[]};var _0x253b0a=_[_0xf22a('0x2c')](db['ZohoAccount']['rawAttributes'],function(_0x2992f7){return{'name':_0x2992f7[_0xf22a('0x2d')],'type':_0x2992f7[_0xf22a('0x2e')][_0xf22a('0x2f')]};});_0x380629[_0xf22a('0x30')]=_[_0xf22a('0x2c')](_0x253b0a,'name');_0x380629[_0xf22a('0x31')]=_[_0xf22a('0x32')](_0x1283ad[_0xf22a('0x31')]);_0x380629[_0xf22a('0x33')]=_['intersection'](_0x380629[_0xf22a('0x30')],_0x380629[_0xf22a('0x31')]);_0x4070b0['attributes']=_['intersection'](_0x380629['model'],qs[_0xf22a('0x34')](_0x1283ad[_0xf22a('0x31')][_0xf22a('0x34')]));_0x4070b0[_0xf22a('0x35')]=_0x4070b0[_0xf22a('0x35')]['length']?_0x4070b0[_0xf22a('0x35')]:_0x380629[_0xf22a('0x30')];if(!_0x1283ad['query'][_0xf22a('0x36')]('nolimit')){_0x4070b0[_0xf22a('0x1f')]=qs['limit'](_0x1283ad['query'][_0xf22a('0x1f')]);_0x4070b0[_0xf22a('0x1d')]=qs[_0xf22a('0x1d')](_0x1283ad[_0xf22a('0x31')][_0xf22a('0x1d')]);}_0x4070b0['order']=qs[_0xf22a('0x37')](_0x1283ad['query'][_0xf22a('0x37')]);_0x4070b0[_0xf22a('0x38')]=qs['filters'](_[_0xf22a('0x39')](_0x1283ad[_0xf22a('0x31')],_0x380629[_0xf22a('0x33')]),_0x253b0a);if(_0x1283ad[_0xf22a('0x31')][_0xf22a('0x3a')]){_0x4070b0[_0xf22a('0x38')]=_[_0xf22a('0x3b')](_0x4070b0[_0xf22a('0x38')],{'$or':_[_0xf22a('0x2c')](_0x253b0a,function(_0x18cded){if(_0x18cded['type']!==_0xf22a('0x3c')){var _0x59b92a={};_0x59b92a[_0x18cded['name']]={'$like':'%'+_0x1283ad[_0xf22a('0x31')][_0xf22a('0x3a')]+'%'};return _0x59b92a;}})});}_0x4070b0=_[_0xf22a('0x3b')]({},_0x4070b0,_0x1283ad[_0xf22a('0x3d')]);var _0x5e0a48={'where':_0x4070b0['where']};return db[_0xf22a('0x3e')][_0xf22a('0x20')](_0x5e0a48)[_0xf22a('0x28')](function(_0xbe251d){_0x358367[_0xf22a('0x20')]=_0xbe251d;if(_0x1283ad[_0xf22a('0x31')]['includeAll']){_0x4070b0[_0xf22a('0x3f')]=[{'all':!![]}];}return db[_0xf22a('0x3e')]['findAll'](_0x4070b0);})['then'](function(_0xaf3e94){_0x358367[_0xf22a('0x40')]=_0xaf3e94;return _0x358367;})[_0xf22a('0x28')](respondWithFilteredResult(_0x1c5a03,_0x4070b0))['catch'](handleError(_0x1c5a03,null));};exports[_0xf22a('0x41')]=function(_0x2c4f61,_0x54048b){var _0x1d9bdf={'raw':![],'where':{'id':_0x2c4f61['params']['id']}},_0x5db47e={};_0x5db47e[_0xf22a('0x30')]=_[_0xf22a('0x32')](db[_0xf22a('0x3e')][_0xf22a('0x42')]);_0x5db47e[_0xf22a('0x31')]=_['keys'](_0x2c4f61[_0xf22a('0x31')]);_0x5db47e['filters']=_[_0xf22a('0x43')](_0x5db47e[_0xf22a('0x30')],_0x5db47e[_0xf22a('0x31')]);_0x1d9bdf[_0xf22a('0x35')]=_[_0xf22a('0x43')](_0x5db47e[_0xf22a('0x30')],qs[_0xf22a('0x34')](_0x2c4f61[_0xf22a('0x31')][_0xf22a('0x34')]));_0x1d9bdf[_0xf22a('0x35')]=_0x1d9bdf['attributes'][_0xf22a('0x44')]?_0x1d9bdf[_0xf22a('0x35')]:_0x5db47e['model'];if(_0x2c4f61[_0xf22a('0x31')]['includeAll']){_0x1d9bdf[_0xf22a('0x3f')]=[{'all':!![]}];}_0x1d9bdf=_[_0xf22a('0x3b')]({},_0x1d9bdf,_0x2c4f61[_0xf22a('0x3d')]);return db['ZohoAccount'][_0xf22a('0x45')](_0x1d9bdf)[_0xf22a('0x28')](handleEntityNotFound(_0x54048b,null))[_0xf22a('0x28')](respondWithResult(_0x54048b,null))[_0xf22a('0x46')](handleError(_0x54048b,null));};exports[_0xf22a('0x47')]=function(_0xff49d6,_0x44316e){return db['ZohoAccount']['create'](_0xff49d6[_0xf22a('0x48')],{})[_0xf22a('0x28')](respondWithResult(_0x44316e,0xc9))[_0xf22a('0x46')](handleError(_0x44316e,null));};exports[_0xf22a('0x49')]=function(_0x581239,_0x12935a){if(_0x581239['body']['id']){delete _0x581239[_0xf22a('0x48')]['id'];}return db['ZohoAccount'][_0xf22a('0x45')]({'where':{'id':_0x581239[_0xf22a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12935a,null))[_0xf22a('0x28')](saveUpdates(_0x581239[_0xf22a('0x48')],null))[_0xf22a('0x28')](respondWithResult(_0x12935a,null))[_0xf22a('0x46')](handleError(_0x12935a,null));};exports[_0xf22a('0x4b')]=function(_0x28c4ec,_0x133c18){return db[_0xf22a('0x3e')][_0xf22a('0x45')]({'where':{'id':_0x28c4ec[_0xf22a('0x4a')]['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0x133c18,null))[_0xf22a('0x28')](removeEntity(_0x133c18,null))['catch'](handleError(_0x133c18,null));};exports['getConfigurations']=function(_0x16cf8a,_0x15c822,_0x4ee5cf){var _0xc2addd={};var _0x2f9e42={};var _0x2eb353;var _0x50f027;return db[_0xf22a('0x3e')][_0xf22a('0x4c')]({'where':{'id':_0x16cf8a[_0xf22a('0x4a')]['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0x15c822,null))[_0xf22a('0x28')](function(_0x309b66){if(_0x309b66){_0x2eb353=_0x309b66;_0x2f9e42[_0xf22a('0x30')]=_[_0xf22a('0x32')](db[_0xf22a('0x4d')][_0xf22a('0x42')]);_0x2f9e42[_0xf22a('0x31')]=_[_0xf22a('0x32')](_0x16cf8a[_0xf22a('0x31')]);_0x2f9e42['filters']=_[_0xf22a('0x43')](_0x2f9e42[_0xf22a('0x30')],_0x2f9e42['query']);_0xc2addd[_0xf22a('0x35')]=_[_0xf22a('0x43')](_0x2f9e42[_0xf22a('0x30')],qs[_0xf22a('0x34')](_0x16cf8a[_0xf22a('0x31')][_0xf22a('0x34')]));_0xc2addd[_0xf22a('0x35')]=_0xc2addd[_0xf22a('0x35')][_0xf22a('0x44')]?_0xc2addd[_0xf22a('0x35')]:_0x2f9e42[_0xf22a('0x30')];_0xc2addd[_0xf22a('0x4e')]=qs[_0xf22a('0x37')](_0x16cf8a[_0xf22a('0x31')]['sort']);_0xc2addd[_0xf22a('0x38')]=qs['filters'](_[_0xf22a('0x39')](_0x16cf8a[_0xf22a('0x31')],_0x2f9e42['filters']));if(_0x16cf8a[_0xf22a('0x31')]['filter']){_0xc2addd[_0xf22a('0x38')]=_[_0xf22a('0x3b')](_0xc2addd[_0xf22a('0x38')],{'$or':_[_0xf22a('0x2c')](_0xc2addd[_0xf22a('0x35')],function(_0x2652c5){var _0x115883={};_0x115883[_0x2652c5]={'$like':'%'+_0x16cf8a['query'][_0xf22a('0x3a')]+'%'};return _0x115883;})});}_0xc2addd=_[_0xf22a('0x3b')]({},_0xc2addd,_0x16cf8a[_0xf22a('0x3d')]);return _0x2eb353[_0xf22a('0x4f')](_0xc2addd);}})['then'](function(_0x21f561){if(_0x21f561){_0x50f027=_0x21f561[_0xf22a('0x44')];if(!_0x16cf8a[_0xf22a('0x31')][_0xf22a('0x36')]('nolimit')){_0xc2addd['limit']=qs['limit'](_0x16cf8a[_0xf22a('0x31')][_0xf22a('0x1f')]);_0xc2addd[_0xf22a('0x1d')]=qs['offset'](_0x16cf8a[_0xf22a('0x31')][_0xf22a('0x1d')]);}return _0x2eb353[_0xf22a('0x4f')](_0xc2addd);}})[_0xf22a('0x28')](function(_0x7fc5f1){if(_0x7fc5f1){return _0x7fc5f1?{'count':_0x50f027,'rows':_0x7fc5f1}:null;}})[_0xf22a('0x28')](respondWithResult(_0x15c822,null))[_0xf22a('0x46')](handleError(_0x15c822,null));};exports[_0xf22a('0x50')]=function(_0x4d6130,_0x53e487,_0x2598b2){if(_0x4d6130[_0xf22a('0x48')]['id']){delete _0x4d6130['body']['id'];}return db[_0xf22a('0x3e')][_0xf22a('0x4c')]({'where':{'id':_0x4d6130[_0xf22a('0x4a')]['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0x53e487,null))['then'](function(_0x21d07a){if(_0x21d07a){_0x4d6130[_0xf22a('0x48')][_0xf22a('0x51')]=_0x21d07a['id'];_0x4d6130[_0xf22a('0x48')][_0xf22a('0x52')]=integrations['getSubjects'](_0x4d6130[_0xf22a('0x48')]['channel'],_0x4d6130[_0xf22a('0x48')][_0xf22a('0x2e')]);_0x4d6130[_0xf22a('0x48')]['Descriptions']=integrations[_0xf22a('0x53')](_0x4d6130[_0xf22a('0x48')][_0xf22a('0x54')],_0x4d6130[_0xf22a('0x48')][_0xf22a('0x2e')]);return db[_0xf22a('0x4d')][_0xf22a('0x47')](_0x4d6130['body'],{'include':[{'model':db[_0xf22a('0x55')],'as':_0xf22a('0x52')},{'model':db[_0xf22a('0x55')],'as':_0xf22a('0x56')}]});}return null;})['then'](respondWithResult(_0x53e487,null))['catch'](handleError(_0x53e487,null));};function getAccessToken(_0x59a36a){return new Promise(function(_0x549308,_0x27221e){var _0x26e6cc;switch(_0x59a36a[_0xf22a('0x57')]){case'US':_0x26e6cc=_0xf22a('0x58');break;case'AU':_0x26e6cc=_0xf22a('0x59');break;case'EU':_0x26e6cc=_0xf22a('0x5a');break;case'IN':_0x26e6cc=_0xf22a('0x5b');break;case'CN':_0x26e6cc=_0xf22a('0x5c');break;default:_0x26e6cc=_0xf22a('0x5a');break;}var _0x57b785={'method':_0xf22a('0x5d'),'uri':_0x26e6cc+_0xf22a('0x5e'),'qs':{'refresh_token':_0x59a36a[_0xf22a('0x5f')],'client_id':_0x59a36a[_0xf22a('0x60')],'client_secret':_0x59a36a[_0xf22a('0x61')],'grant_type':_0xf22a('0x62')},'json':!![]};return rp(_0x57b785)[_0xf22a('0x28')](function(_0x521def){if(_0x521def[_0xf22a('0x63')]){_0x549308(_0x521def[_0xf22a('0x63')]);}else{_0x27221e(_0xf22a('0x64'));}})[_0xf22a('0x46')](function(_0x4378ac){_0x27221e(_0x4378ac);});});}exports[_0xf22a('0x65')]=function(_0x359852,_0x558a35,_0x2035a9){var _0x1eebdc,_0x39ed22,_0x40b103,_0x476196,_0x403c3c;return db[_0xf22a('0x3e')][_0xf22a('0x4c')]({'where':{'id':_0x359852['params']['id']},'attributes':['id',_0xf22a('0x66'),_0xf22a('0x57'),'clientId',_0xf22a('0x61'),_0xf22a('0x67'),_0xf22a('0x68'),_0xf22a('0x5f')]})[_0xf22a('0x28')](handleEntityNotFound(_0x558a35,null))[_0xf22a('0x28')](function(_0x4302e7){_0x403c3c=_0x4302e7;_0x1eebdc=_0x403c3c['host'];_0x39ed22=_0x1eebdc===_0xf22a('0x69')?'eu':'com';_0x40b103=_0x403c3c['serverUrl'];var _0x3c1545=_0x40b103['slice'](-0x1);if(_0x3c1545==='/'||_0x3c1545==='\x5c'||_0x3c1545===':'){_0x40b103=_0x40b103[_0xf22a('0x6a')](0x0,_0x40b103[_0xf22a('0x6b')](_0x3c1545));}if(!_0x403c3c['refreshToken']){throw new Error(_0xf22a('0x6c'));}return getAccessToken(_0x403c3c);})[_0xf22a('0x28')](function(_0x2a511e){if(_0x2a511e){return rp({'method':_0xf22a('0x6d'),'uri':util['format'](_0xf22a('0x6e'),_0x39ed22),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a511e},'json':!![]});}})[_0xf22a('0x28')](function(_0x4c2ac1){if(_0x4c2ac1){if(_0x4c2ac1[_0xf22a('0x6f')]&&_0x4c2ac1[_0xf22a('0x6f')][_0xf22a('0x70')]){throw new Error(_0x4c2ac1['response'][_0xf22a('0x70')][_0xf22a('0x71')]);}var _0x4e2d77=[];var _0x5910a4=[];var _0x23e6b8=['Owner',_0xf22a('0x72'),'Description',_0xf22a('0x73'),_0xf22a('0x74'),_0xf22a('0x75'),_0xf22a('0x76'),_0xf22a('0x77')];_0x5910a4=_[_0xf22a('0x78')](_0x4c2ac1[_0xf22a('0x34')],function(_0xf7891c){return _0x23e6b8[_0xf22a('0x79')](_0xf7891c[_0xf22a('0x7a')]);});for(var _0x4acf80=0x0;_0x4acf80<_0x5910a4[_0xf22a('0x44')];_0x4acf80++){if(_0x5910a4[_0x4acf80][_0xf22a('0x7b')]===![]){_0x4e2d77[_0xf22a('0x7c')]({'id':_0x5910a4[_0x4acf80]['id'],'name':_0x5910a4[_0x4acf80][_0xf22a('0x7d')],'custom':_0x5910a4[_0x4acf80][_0xf22a('0x7e')],'options':_0x5910a4[_0x4acf80][_0xf22a('0x7f')]===_0xf22a('0x80')&&_0x5910a4[_0x4acf80][_0xf22a('0x81')][_0xf22a('0x44')]>-0x1?_[_0xf22a('0x2c')](_0x5910a4[_0x4acf80][_0xf22a('0x81')],function(_0x66b185){return{'name':_0x66b185,'value':_0x66b185};}):[]});}}return{'count':_0x4e2d77[_0xf22a('0x44')],'rows':_0x4e2d77};}else{return{'count':0x0,'rows':[]};}})[_0xf22a('0x28')](respondWithResult(_0x558a35,null))['catch'](function(_0x7c25bb){var _0x5c4883=_0x359852[_0xf22a('0x31')][_0xf22a('0x82')]?0x1f4:_0x7c25bb[_0xf22a('0x83')]||0x1f4;logger[_0xf22a('0x70')]('getFields,\x20%s,\x20%s,\x20%s',_0xf22a('0x65'),_0x5c4883,JSON[_0xf22a('0x84')](_0x7c25bb));delete _0x7c25bb[_0xf22a('0x2a')];if(_0x5c4883===0x191){_0x5c4883=0x190;}_0x558a35['status'](_0x5c4883)[_0xf22a('0x85')](_0x359852['query'][_0xf22a('0x82')]?{'message':_0xf22a('0x86'),'statusCode':_0x7c25bb[_0xf22a('0x83')]}:_0x7c25bb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c870d15..5101635 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe7b=['serverUrl','clientId','clientSecret','code','host','slice','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','format','name','inspect','lastIndexOf','https://accounts.zoho.eu','parse','error','lodash','util','../../config/logger','bluebird','path','./intZohoAccount.attributes','define','ZohoAccount','changed'];(function(_0x1107f0,_0x3ce369){var _0x4f5141=function(_0x5c8fc7){while(--_0x5c8fc7){_0x1107f0['push'](_0x1107f0['shift']());}};_0x4f5141(++_0x3ce369);}(_0xbe7b,0x66));var _0xbbe7=function(_0x2f56c9,_0x53c36f){_0x2f56c9=_0x2f56c9-0x0;var _0x5d04f2=_0xbe7b[_0x2f56c9];return _0x5d04f2;};'use strict';var _=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var logger=require(_0xbbe7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbbe7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbe7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbbe7('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x34c713,_0x1b2bd5){return _0x34c713[_0xbbe7('0x6')](_0xbbe7('0x7'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5386aa,_0x4f60e9,_0x334d6b){if(_0x5386aa[_0xbbe7('0x8')]('zone')||_0x5386aa[_0xbbe7('0x8')](_0xbbe7('0x9'))||_0x5386aa[_0xbbe7('0x8')](_0xbbe7('0xa'))||_0x5386aa[_0xbbe7('0x8')](_0xbbe7('0xb'))||_0x5386aa[_0xbbe7('0x8')](_0xbbe7('0xc'))||_0x5386aa[_0xbbe7('0x8')](_0xbbe7('0xd'))){var _0x2d8878,_0x3b7888;_0x2d8878=_0x5386aa['serverUrl'];var _0x52bc3a=_0x2d8878[_0xbbe7('0xe')](-0x1);if(_0x52bc3a==='/'||_0x52bc3a==='\x5c'||_0x52bc3a===':'){_0x2d8878=_0x2d8878['substring'](0x0,_0x2d8878['lastIndexOf'](_0x52bc3a));}switch(_0x5386aa[_0xbbe7('0xf')]){case'US':_0x3b7888=_0xbbe7('0x10');break;case'AU':_0x3b7888=_0xbbe7('0x11');break;case'IN':_0x3b7888=_0xbbe7('0x12');break;case'CN':_0x3b7888=_0xbbe7('0x13');break;default:_0x3b7888='https://accounts.zoho.eu';break;}var _0x47ea77={'method':_0xbbe7('0x14'),'uri':_0x3b7888+_0xbbe7('0x15'),'form':{'grant_type':_0xbbe7('0x16'),'client_id':_0x5386aa[_0xbbe7('0xa')],'client_secret':_0x5386aa['clientSecret'],'redirect_uri':_0x5386aa['serverUrl'],'code':_0x5386aa[_0xbbe7('0xc')]},'headers':{'Content-Type':_0xbbe7('0x17')}};return rp(_0x47ea77)[_0xbbe7('0x18')](function(_0x31b21e){var _0x5310d8=JSON['parse'](_0x31b21e);if(_0x5310d8[_0xbbe7('0x19')]){_0x5386aa['refreshToken']=_0x5310d8['refresh_token'];logger[_0xbbe7('0x1a')](util['format'](_0xbbe7('0x1b'),_0x5386aa['name'],_0x5386aa['id']));}else{logger['error'](util['format'](_0xbbe7('0x1c'),_0x5386aa['name'],_0x5386aa['id']),util['inspect'](_0x5310d8,{'showHidden':![],'depth':null}));}return _0x334d6b(null,_0x4f60e9);})[_0xbbe7('0x1d')](function(_0x5b1ff4){logger['error'](util[_0xbbe7('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5386aa[_0xbbe7('0x1f')],_0x5386aa['id']),util[_0xbbe7('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x334d6b(_0x5b1ff4);});}else{return _0x334d6b(null,_0x4f60e9);}},'beforeUpdate':function(_0x2c8c7e,_0x3e5cc9,_0x2efb77){if(_0x2c8c7e[_0xbbe7('0x8')]('zone')||_0x2c8c7e[_0xbbe7('0x8')]('serverUrl')||_0x2c8c7e[_0xbbe7('0x8')](_0xbbe7('0xa'))||_0x2c8c7e[_0xbbe7('0x8')]('clientSecret')||_0x2c8c7e[_0xbbe7('0x8')]('code')||_0x2c8c7e[_0xbbe7('0x8')](_0xbbe7('0xd'))){var _0x4d04f4,_0xc5e2f7;_0x4d04f4=_0x2c8c7e[_0xbbe7('0x9')];var _0x4bac8c=_0x4d04f4[_0xbbe7('0xe')](-0x1);if(_0x4bac8c==='/'||_0x4bac8c==='\x5c'||_0x4bac8c===':'){_0x4d04f4=_0x4d04f4['substring'](0x0,_0x4d04f4[_0xbbe7('0x21')](_0x4bac8c));}switch(_0x2c8c7e[_0xbbe7('0xf')]){case'US':_0xc5e2f7=_0xbbe7('0x10');break;case'AU':_0xc5e2f7='https://accounts.zoho.com.au';break;case'IN':_0xc5e2f7=_0xbbe7('0x12');break;case'CN':_0xc5e2f7=_0xbbe7('0x13');break;default:_0xc5e2f7=_0xbbe7('0x22');break;}var _0x35df10={'method':'POST','uri':_0xc5e2f7+_0xbbe7('0x15'),'form':{'grant_type':_0xbbe7('0x16'),'client_id':_0x2c8c7e['clientId'],'client_secret':_0x2c8c7e[_0xbbe7('0xb')],'redirect_uri':_0x2c8c7e[_0xbbe7('0x9')],'code':_0x2c8c7e[_0xbbe7('0xc')]},'headers':{'Content-Type':_0xbbe7('0x17')}};return rp(_0x35df10)['then'](function(_0x489a7e){var _0x3cbfa4=JSON[_0xbbe7('0x23')](_0x489a7e);if(_0x3cbfa4['refresh_token']){_0x2c8c7e['refreshToken']=_0x3cbfa4[_0xbbe7('0x19')];logger[_0xbbe7('0x1a')](util[_0xbbe7('0x1e')](_0xbbe7('0x1b'),_0x2c8c7e['name'],_0x2c8c7e['id']));}else{logger[_0xbbe7('0x24')](util[_0xbbe7('0x1e')](_0xbbe7('0x1c'),_0x2c8c7e['name'],_0x2c8c7e['id']),util[_0xbbe7('0x20')](_0x3cbfa4,{'showHidden':![],'depth':null}));}return _0x2efb77(null,_0x3e5cc9);})[_0xbbe7('0x1d')](function(_0x313d80){logger[_0xbbe7('0x24')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c8c7e[_0xbbe7('0x1f')],_0x2c8c7e['id']),util[_0xbbe7('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x2efb77(_0x313d80);});}else{return _0x2efb77(null,_0x3e5cc9);}}}});}; \ No newline at end of file +var _0xdf20=['https://accounts.zoho.com.cn','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','code','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientId','then','parse','refresh_token','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','https://accounts.zoho.com'];(function(_0x275fbb,_0x52bdd9){var _0x1a1699=function(_0x2ded23){while(--_0x2ded23){_0x275fbb['push'](_0x275fbb['shift']());}};_0x1a1699(++_0x52bdd9);}(_0xdf20,0x1b1));var _0x0df2=function(_0x307c35,_0x5da047){_0x307c35=_0x307c35-0x0;var _0x51f77c=_0xdf20[_0x307c35];return _0x51f77c;};'use strict';var _=require(_0x0df2('0x0'));var util=require(_0x0df2('0x1'));var logger=require('../../config/logger')(_0x0df2('0x2'));var moment=require(_0x0df2('0x3'));var BPromise=require(_0x0df2('0x4'));var rp=require(_0x0df2('0x5'));var fs=require('fs');var path=require(_0x0df2('0x6'));var rimraf=require(_0x0df2('0x7'));var config=require(_0x0df2('0x8'));var attributes=require(_0x0df2('0x9'));var integrations=require(_0x0df2('0xa'));module[_0x0df2('0xb')]=function(_0x5318e6,_0x130618){return _0x5318e6[_0x0df2('0xc')](_0x0df2('0xd'),attributes,{'tableName':_0x0df2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c93af,_0x9d6b80,_0x4c0325){if(_0x5c93af[_0x0df2('0xf')](_0x0df2('0x10'))||_0x5c93af[_0x0df2('0xf')]('serverUrl')||_0x5c93af[_0x0df2('0xf')]('clientId')||_0x5c93af[_0x0df2('0xf')](_0x0df2('0x11'))||_0x5c93af[_0x0df2('0xf')](_0x0df2('0x12'))||_0x5c93af[_0x0df2('0xf')]('host')){var _0x3c4434,_0x541767;_0x3c4434=_0x5c93af[_0x0df2('0x13')];var _0x531026=_0x3c4434[_0x0df2('0x14')](-0x1);if(_0x531026==='/'||_0x531026==='\x5c'||_0x531026===':'){_0x3c4434=_0x3c4434[_0x0df2('0x15')](0x0,_0x3c4434[_0x0df2('0x16')](_0x531026));}switch(_0x5c93af['zone']){case'US':_0x541767='https://accounts.zoho.com';break;case'AU':_0x541767=_0x0df2('0x17');break;case'IN':_0x541767=_0x0df2('0x18');break;case'CN':_0x541767='https://accounts.zoho.com.cn';break;default:_0x541767=_0x0df2('0x19');break;}var _0x350bca={'method':_0x0df2('0x1a'),'uri':_0x541767+'/oauth/v2/token','form':{'grant_type':_0x0df2('0x1b'),'client_id':_0x5c93af[_0x0df2('0x1c')],'client_secret':_0x5c93af['clientSecret'],'redirect_uri':_0x5c93af[_0x0df2('0x13')],'code':_0x5c93af[_0x0df2('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x350bca)[_0x0df2('0x1d')](function(_0x27ad7b){var _0xf78ad4=JSON[_0x0df2('0x1e')](_0x27ad7b);if(_0xf78ad4[_0x0df2('0x1f')]){_0x5c93af['refreshToken']=_0xf78ad4[_0x0df2('0x1f')];logger['info'](util[_0x0df2('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c93af[_0x0df2('0x21')],_0x5c93af['id']));}else{logger[_0x0df2('0x22')](util['format'](_0x0df2('0x23'),_0x5c93af[_0x0df2('0x21')],_0x5c93af['id']),util[_0x0df2('0x24')](_0xf78ad4,{'showHidden':![],'depth':null}));}return _0x4c0325(null,_0x9d6b80);})[_0x0df2('0x25')](function(_0x53f39c){logger[_0x0df2('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c93af[_0x0df2('0x21')],_0x5c93af['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4c0325(_0x53f39c);});}else{return _0x4c0325(null,_0x9d6b80);}},'beforeUpdate':function(_0x225800,_0x296e51,_0x359c3f){if(_0x225800[_0x0df2('0xf')](_0x0df2('0x10'))||_0x225800[_0x0df2('0xf')](_0x0df2('0x13'))||_0x225800[_0x0df2('0xf')](_0x0df2('0x1c'))||_0x225800[_0x0df2('0xf')](_0x0df2('0x11'))||_0x225800[_0x0df2('0xf')](_0x0df2('0x12'))||_0x225800['changed'](_0x0df2('0x26'))){var _0x5d9e96,_0x1ad8d1;_0x5d9e96=_0x225800[_0x0df2('0x13')];var _0x5b5857=_0x5d9e96['slice'](-0x1);if(_0x5b5857==='/'||_0x5b5857==='\x5c'||_0x5b5857===':'){_0x5d9e96=_0x5d9e96[_0x0df2('0x15')](0x0,_0x5d9e96['lastIndexOf'](_0x5b5857));}switch(_0x225800[_0x0df2('0x10')]){case'US':_0x1ad8d1=_0x0df2('0x27');break;case'AU':_0x1ad8d1='https://accounts.zoho.com.au';break;case'IN':_0x1ad8d1=_0x0df2('0x18');break;case'CN':_0x1ad8d1=_0x0df2('0x28');break;default:_0x1ad8d1='https://accounts.zoho.eu';break;}var _0x5e2d39={'method':_0x0df2('0x1a'),'uri':_0x1ad8d1+_0x0df2('0x29'),'form':{'grant_type':_0x0df2('0x1b'),'client_id':_0x225800[_0x0df2('0x1c')],'client_secret':_0x225800[_0x0df2('0x11')],'redirect_uri':_0x225800['serverUrl'],'code':_0x225800[_0x0df2('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5e2d39)['then'](function(_0x4166ed){var _0x327674=JSON['parse'](_0x4166ed);if(_0x327674[_0x0df2('0x1f')]){_0x225800['refreshToken']=_0x327674['refresh_token'];logger['info'](util[_0x0df2('0x20')](_0x0df2('0x2a'),_0x225800[_0x0df2('0x21')],_0x225800['id']));}else{logger[_0x0df2('0x22')](util[_0x0df2('0x20')](_0x0df2('0x23'),_0x225800[_0x0df2('0x21')],_0x225800['id']),util[_0x0df2('0x24')](_0x327674,{'showHidden':![],'depth':null}));}return _0x359c3f(null,_0x296e51);})[_0x0df2('0x25')](function(_0x5ac5ba){logger['error'](util[_0x0df2('0x20')](_0x0df2('0x23'),_0x225800['name'],_0x225800['id']),util[_0x0df2('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x359c3f(_0x5ac5ba);});}else{return _0x359c3f(null,_0x296e51);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ec0c608..8d4c211 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb0b=['include','model','map','GetZohoAccount','stringify','ShowZohoAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','ZohoAccount','findAll','options','where','attributes'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xfb0b,0x94));var _0xbfb0=function(_0x21cd07,_0x4a9c1d){_0x21cd07=_0x21cd07-0x0;var _0x107278=_0xfb0b[_0x21cd07];return _0x107278;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var moment=require(_0xbfb0('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfb0('0x3'));var fs=require('fs');var Redis=require(_0xbfb0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbfb0('0x5'))('rpc');var config=require(_0xbfb0('0x6'));var jayson=require(_0xbfb0('0x7'));var client=jayson[_0xbfb0('0x8')][_0xbfb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b3840,_0x46166a,_0x52eba3){return new BPromise(function(_0x3491c7,_0x1afe32){return client[_0xbfb0('0xa')](_0x2b3840,_0x52eba3)[_0xbfb0('0xb')](function(_0x4c2cee){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x46166a,'request\x20sent');logger[_0xbfb0('0xc')](_0xbfb0('0xd'),_0x46166a,_0xbfb0('0xe'),JSON['stringify'](_0x4c2cee));if(_0x4c2cee[_0xbfb0('0xf')]){if(_0x4c2cee['error'][_0xbfb0('0x10')]===0x1f4){logger[_0xbfb0('0xf')](_0xbfb0('0x11'),_0x46166a,_0x4c2cee[_0xbfb0('0xf')][_0xbfb0('0x12')]);return _0x1afe32(_0x4c2cee[_0xbfb0('0xf')]['message']);}logger[_0xbfb0('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x46166a,_0x4c2cee['error']['message']);return _0x3491c7(_0x4c2cee[_0xbfb0('0xf')][_0xbfb0('0x12')]);}else{logger[_0xbfb0('0x13')](_0xbfb0('0x11'),_0x46166a,_0xbfb0('0xe'));_0x3491c7(_0x4c2cee[_0xbfb0('0x14')][_0xbfb0('0x12')]);}})[_0xbfb0('0x15')](function(_0x315b80){logger[_0xbfb0('0xf')](_0xbfb0('0x11'),_0x46166a,_0x315b80);_0x1afe32(_0x315b80);});});}exports['GetZohoAccount']=function(_0x5c8a1e){var _0x3319a1=this;return new Promise(function(_0x3b0a50,_0x51842c){return db[_0xbfb0('0x16')][_0xbfb0('0x17')]({'raw':_0x5c8a1e['options']?_0x5c8a1e[_0xbfb0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e[_0xbfb0('0x18')][_0xbfb0('0x19')]||null:null,'attributes':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e['options'][_0xbfb0('0x1a')]||null:null,'limit':_0x5c8a1e['options']?_0x5c8a1e[_0xbfb0('0x18')]['limit']||null:null,'include':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e['options'][_0xbfb0('0x1b')]?_['map'](_0x5c8a1e[_0xbfb0('0x18')][_0xbfb0('0x1b')],function(_0x40bb06){return{'model':db[_0x40bb06[_0xbfb0('0x1c')]],'as':_0x40bb06['as'],'attributes':_0x40bb06['attributes'],'include':_0x40bb06[_0xbfb0('0x1b')]?_[_0xbfb0('0x1d')](_0x40bb06['include'],function(_0x4e86c8){return{'model':db[_0x4e86c8[_0xbfb0('0x1c')]],'as':_0x4e86c8['as'],'attributes':_0x4e86c8[_0xbfb0('0x1a')],'include':_0x4e86c8[_0xbfb0('0x1b')]?_['map'](_0x4e86c8[_0xbfb0('0x1b')],function(_0x4af626){return{'model':db[_0x4af626[_0xbfb0('0x1c')]],'as':_0x4af626['as'],'attributes':_0x4af626[_0xbfb0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfb0('0xb')](function(_0x402db3){logger[_0xbfb0('0x13')](_0xbfb0('0x1e'),_0x5c8a1e);logger[_0xbfb0('0xc')]('GetZohoAccount',_0x5c8a1e,JSON[_0xbfb0('0x1f')](_0x402db3));_0x3b0a50(_0x402db3);})[_0xbfb0('0x15')](function(_0x25fea2){logger[_0xbfb0('0xf')]('GetZohoAccount',_0x25fea2[_0xbfb0('0x12')],_0x5c8a1e);_0x51842c(_0x3319a1[_0xbfb0('0xf')](0x1f4,_0x25fea2['message']));});});};exports[_0xbfb0('0x20')]=function(_0x6ba12c){var _0x41ad24=this;return new Promise(function(_0x1a5623,_0x4a720c){return db[_0xbfb0('0x16')][_0xbfb0('0x21')]({'raw':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x22')]===undefined?!![]:![]:!![],'where':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')]['where']||null:null,'attributes':_0x6ba12c['options']?_0x6ba12c['options'][_0xbfb0('0x1a')]||null:null,'include':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x1b')]?_[_0xbfb0('0x1d')](_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x1b')],function(_0x3ddc06){return{'model':db[_0x3ddc06['model']],'as':_0x3ddc06['as'],'attributes':_0x3ddc06['attributes'],'include':_0x3ddc06['include']?_[_0xbfb0('0x1d')](_0x3ddc06[_0xbfb0('0x1b')],function(_0x6deeee){return{'model':db[_0x6deeee[_0xbfb0('0x1c')]],'as':_0x6deeee['as'],'attributes':_0x6deeee[_0xbfb0('0x1a')],'include':_0x6deeee['include']?_['map'](_0x6deeee[_0xbfb0('0x1b')],function(_0x3e18e5){return{'model':db[_0x3e18e5[_0xbfb0('0x1c')]],'as':_0x3e18e5['as'],'attributes':_0x3e18e5[_0xbfb0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfb0('0xb')](function(_0x6665a0){logger[_0xbfb0('0x13')](_0xbfb0('0x20'),_0x6ba12c);logger[_0xbfb0('0xc')](_0xbfb0('0x20'),_0x6ba12c,JSON['stringify'](_0x6665a0));_0x1a5623(_0x6665a0);})['catch'](function(_0x28ef7d){logger[_0xbfb0('0xf')]('ShowZohoAccount',_0x28ef7d[_0xbfb0('0x12')],_0x6ba12c);_0x4a720c(_0x41ad24['error'](0x1f4,_0x28ef7d[_0xbfb0('0x12')]));});});}; \ No newline at end of file +var _0xa701=['raw','where','attributes','limit','include','model','map','GetZohoAccount','ShowZohoAccount','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ZohoAccount','options'];(function(_0x43c51d,_0x4d1cca){var _0x53b58a=function(_0x3ba9d6){while(--_0x3ba9d6){_0x43c51d['push'](_0x43c51d['shift']());}};_0x53b58a(++_0x4d1cca);}(_0xa701,0xd4));var _0x1a70=function(_0x4a7604,_0x55325f){_0x4a7604=_0x4a7604-0x0;var _0x10f3c5=_0xa701[_0x4a7604];return _0x10f3c5;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));var config=require(_0x1a70('0x5'));var jayson=require(_0x1a70('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c700b,_0x191a56,_0x1e5432){return new BPromise(function(_0x85bfd0,_0x1dd89b){return client[_0x1a70('0x7')](_0x1c700b,_0x1e5432)[_0x1a70('0x8')](function(_0x55b5e2){logger[_0x1a70('0x9')](_0x1a70('0xa'),_0x191a56,_0x1a70('0xb'));logger[_0x1a70('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x191a56,_0x1a70('0xb'),JSON[_0x1a70('0xd')](_0x55b5e2));if(_0x55b5e2[_0x1a70('0xe')]){if(_0x55b5e2['error']['code']===0x1f4){logger[_0x1a70('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')]['message']);return _0x1dd89b(_0x55b5e2[_0x1a70('0xe')]['message']);}logger[_0x1a70('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);return _0x85bfd0(_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);}else{logger[_0x1a70('0x9')]('ZohoAccount,\x20%s,\x20%s',_0x191a56,'request\x20sent');_0x85bfd0(_0x55b5e2[_0x1a70('0x10')]['message']);}})[_0x1a70('0x11')](function(_0x3d8745){logger['error'](_0x1a70('0xa'),_0x191a56,_0x3d8745);_0x1dd89b(_0x3d8745);});});}exports['GetZohoAccount']=function(_0x266784){var _0xcb545c=this;return new Promise(function(_0x555680,_0x117ac1){return db[_0x1a70('0x12')]['findAll']({'raw':_0x266784['options']?_0x266784[_0x1a70('0x13')][_0x1a70('0x14')]===undefined?!![]:![]:!![],'where':_0x266784[_0x1a70('0x13')]?_0x266784[_0x1a70('0x13')][_0x1a70('0x15')]||null:null,'attributes':_0x266784[_0x1a70('0x13')]?_0x266784[_0x1a70('0x13')][_0x1a70('0x16')]||null:null,'limit':_0x266784[_0x1a70('0x13')]?_0x266784[_0x1a70('0x13')][_0x1a70('0x17')]||null:null,'include':_0x266784[_0x1a70('0x13')]?_0x266784[_0x1a70('0x13')][_0x1a70('0x18')]?_['map'](_0x266784['options'][_0x1a70('0x18')],function(_0x20f1b1){return{'model':db[_0x20f1b1[_0x1a70('0x19')]],'as':_0x20f1b1['as'],'attributes':_0x20f1b1[_0x1a70('0x16')],'include':_0x20f1b1[_0x1a70('0x18')]?_[_0x1a70('0x1a')](_0x20f1b1['include'],function(_0xe7c8a5){return{'model':db[_0xe7c8a5[_0x1a70('0x19')]],'as':_0xe7c8a5['as'],'attributes':_0xe7c8a5['attributes'],'include':_0xe7c8a5[_0x1a70('0x18')]?_[_0x1a70('0x1a')](_0xe7c8a5[_0x1a70('0x18')],function(_0x24dee2){return{'model':db[_0x24dee2[_0x1a70('0x19')]],'as':_0x24dee2['as'],'attributes':_0x24dee2[_0x1a70('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1a70('0x8')](function(_0xc18572){logger[_0x1a70('0x9')](_0x1a70('0x1b'),_0x266784);logger[_0x1a70('0xc')]('GetZohoAccount',_0x266784,JSON[_0x1a70('0xd')](_0xc18572));_0x555680(_0xc18572);})[_0x1a70('0x11')](function(_0x19e0ba){logger[_0x1a70('0xe')](_0x1a70('0x1b'),_0x19e0ba[_0x1a70('0xf')],_0x266784);_0x117ac1(_0xcb545c[_0x1a70('0xe')](0x1f4,_0x19e0ba[_0x1a70('0xf')]));});});};exports[_0x1a70('0x1c')]=function(_0x659d4b){var _0x200155=this;return new Promise(function(_0x113aa0,_0x5090ad){return db[_0x1a70('0x12')]['find']({'raw':_0x659d4b[_0x1a70('0x13')]?_0x659d4b[_0x1a70('0x13')][_0x1a70('0x14')]===undefined?!![]:![]:!![],'where':_0x659d4b[_0x1a70('0x13')]?_0x659d4b[_0x1a70('0x13')]['where']||null:null,'attributes':_0x659d4b[_0x1a70('0x13')]?_0x659d4b[_0x1a70('0x13')][_0x1a70('0x16')]||null:null,'include':_0x659d4b[_0x1a70('0x13')]?_0x659d4b[_0x1a70('0x13')][_0x1a70('0x18')]?_[_0x1a70('0x1a')](_0x659d4b[_0x1a70('0x13')]['include'],function(_0x4b13ea){return{'model':db[_0x4b13ea[_0x1a70('0x19')]],'as':_0x4b13ea['as'],'attributes':_0x4b13ea[_0x1a70('0x16')],'include':_0x4b13ea[_0x1a70('0x18')]?_[_0x1a70('0x1a')](_0x4b13ea[_0x1a70('0x18')],function(_0x3c739c){return{'model':db[_0x3c739c[_0x1a70('0x19')]],'as':_0x3c739c['as'],'attributes':_0x3c739c[_0x1a70('0x16')],'include':_0x3c739c[_0x1a70('0x18')]?_[_0x1a70('0x1a')](_0x3c739c['include'],function(_0x1ee357){return{'model':db[_0x1ee357['model']],'as':_0x1ee357['as'],'attributes':_0x1ee357[_0x1a70('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fea89){logger[_0x1a70('0x9')]('ShowZohoAccount',_0x659d4b);logger[_0x1a70('0xc')](_0x1a70('0x1c'),_0x659d4b,JSON[_0x1a70('0xd')](_0x1fea89));_0x113aa0(_0x1fea89);})[_0x1a70('0x11')](function(_0x559c0c){logger[_0x1a70('0xe')](_0x1a70('0x1c'),_0x559c0c[_0x1a70('0xf')],_0x659d4b);_0x5090ad(_0x200155[_0x1a70('0xe')](0x1f4,_0x559c0c[_0x1a70('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9fb9243..19e03ab 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc151=['../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/descriptions','put','/:id','update','delete','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc151,0x151));var _0x1c15=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc151[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1c15('0x0'));var util=require(_0x1c15('0x1'));var path=require(_0x1c15('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c15('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c15('0x4'));var config=require(_0x1c15('0x5'));var controller=require(_0x1c15('0x6'));router[_0x1c15('0x7')]('/',auth[_0x1c15('0x8')](),controller[_0x1c15('0x9')]);router[_0x1c15('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1c15('0xa')]);router['get'](_0x1c15('0xb'),auth['isAuthenticated'](),controller[_0x1c15('0xc')]);router['get']('/:id/subjects',auth[_0x1c15('0x8')](),controller['getSubjects']);router[_0x1c15('0x7')](_0x1c15('0xd'),auth[_0x1c15('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x1c15('0x8')](),controller['create']);router[_0x1c15('0xe')](_0x1c15('0xf'),auth[_0x1c15('0x8')](),controller[_0x1c15('0x10')]);router[_0x1c15('0x11')](_0x1c15('0xf'),auth[_0x1c15('0x8')](),controller['destroy']);module[_0x1c15('0x12')]=router; \ No newline at end of file +var _0xb82f=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb82f,0xe8));var _0xfb82=function(_0x2cfb38,_0x14bad4){_0x2cfb38=_0x2cfb38-0x0;var _0x210a8f=_0xb82f[_0x2cfb38];return _0x210a8f;};'use strict';var multer=require(_0xfb82('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfb82('0x1'));var express=require(_0xfb82('0x2'));var router=express[_0xfb82('0x3')]();var fs_extra=require(_0xfb82('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfb82('0x5'));var config=require(_0xfb82('0x6'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xfb82('0x7')](),controller[_0xfb82('0x8')]);router[_0xfb82('0x9')](_0xfb82('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xfb82('0x9')](_0xfb82('0xb'),auth['isAuthenticated'](),controller[_0xfb82('0xc')]);router['get'](_0xfb82('0xd'),auth[_0xfb82('0x7')](),controller[_0xfb82('0xe')]);router[_0xfb82('0x9')](_0xfb82('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xfb82('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfb82('0x11')](_0xfb82('0xa'),auth[_0xfb82('0x7')](),controller['update']);router[_0xfb82('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfb82('0x13')]);module[_0xfb82('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 738f921..d970796 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ed7=['nothing','lead','contact_lead','sequelize','STRING','ENUM','contact'];(function(_0x1cca67,_0x26b5ad){var _0x5a3432=function(_0x1089e9){while(--_0x1089e9){_0x1cca67['push'](_0x1cca67['shift']());}};_0x5a3432(++_0x26b5ad);}(_0x9ed7,0x168));var _0x79ed=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x9ed7[_0x459b74];return _0x46cb16;};'use strict';var Sequelize=require(_0x79ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x79ed('0x1')]},'moduleCreate':{'type':Sequelize[_0x79ed('0x2')]('lead',_0x79ed('0x3'),_0x79ed('0x4')),'defaultValue':_0x79ed('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x79ed('0x6'),'contact',_0x79ed('0x5')),'defaultValue':_0x79ed('0x6')},'description':{'type':Sequelize[_0x79ed('0x1')]}}; \ No newline at end of file +var _0x266c=['nothing','contact_lead','STRING','sequelize','ENUM','lead','contact'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x266c,0x1b5));var _0xc266=function(_0x2de093,_0x1dc902){_0x2de093=_0x2de093-0x0;var _0x4dc0f7=_0x266c[_0x2de093];return _0x4dc0f7;};'use strict';var Sequelize=require(_0xc266('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xc266('0x1')](_0xc266('0x2'),_0xc266('0x3'),_0xc266('0x4')),'defaultValue':_0xc266('0x2')},'moduleSearch':{'type':Sequelize[_0xc266('0x1')](_0xc266('0x5'),'contact','lead'),'defaultValue':_0xc266('0x5')},'description':{'type':Sequelize[_0xc266('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b06c8bb..ffcd341 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37c9=['where','filters','filter','VIRTUAL','merge','options','include','findAll','show','params','includeAll','find','create','body','catch','findOne','ZohoField','getFields','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x392b75,_0x1f2054){var _0x3b3825=function(_0x56a8de){while(--_0x56a8de){_0x392b75['push'](_0x392b75['shift']());}};_0x3b3825(++_0x1f2054);}(_0x37c9,0xb9));var _0x937c=function(_0x1e6281,_0x2d5377){_0x1e6281=_0x1e6281-0x0;var _0x1c1414=_0x37c9[_0x1e6281];return _0x1c1414;};'use strict';var emlformat=require(_0x937c('0x0'));var rimraf=require(_0x937c('0x1'));var zipdir=require(_0x937c('0x2'));var jsonpatch=require(_0x937c('0x3'));var rp=require('request-promise');var moment=require(_0x937c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x937c('0x5'));var util=require(_0x937c('0x6'));var path=require(_0x937c('0x7'));var sox=require('sox');var csv=require(_0x937c('0x8'));var ejs=require(_0x937c('0x9'));var fs=require('fs');var fs_extra=require(_0x937c('0xa'));var _=require(_0x937c('0xb'));var squel=require(_0x937c('0xc'));var crypto=require(_0x937c('0xd'));var jsforce=require(_0x937c('0xe'));var deskjs=require(_0x937c('0xf'));var toCsv=require(_0x937c('0x8'));var querystring=require(_0x937c('0x10'));var Papa=require(_0x937c('0x11'));var Redis=require('ioredis');var authService=require(_0x937c('0x12'));var qs=require(_0x937c('0x13'));var as=require(_0x937c('0x14'));var hardwareService=require(_0x937c('0x15'));var logger=require(_0x937c('0x16'))(_0x937c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x937c('0x18'));var db=require(_0x937c('0x19'))['db'];function respondWithStatusCode(_0x805b87,_0x5c5ad4){_0x5c5ad4=_0x5c5ad4||0xcc;return function(_0x1d880c){if(_0x1d880c){return _0x805b87[_0x937c('0x1a')](_0x5c5ad4);}return _0x805b87[_0x937c('0x1b')](_0x5c5ad4)[_0x937c('0x1c')]();};}function respondWithResult(_0xcf22c8,_0x4b5f1d){_0x4b5f1d=_0x4b5f1d||0xc8;return function(_0x4f71ae){if(_0x4f71ae){return _0xcf22c8[_0x937c('0x1b')](_0x4b5f1d)[_0x937c('0x1d')](_0x4f71ae);}};}function respondWithFilteredResult(_0x5a5d35,_0x12b46d){return function(_0x5a6fd6){if(_0x5a6fd6){var _0x1afa90=typeof _0x12b46d[_0x937c('0x1e')]===_0x937c('0x1f')&&typeof _0x12b46d['limit']===_0x937c('0x1f');var _0x505625=_0x5a6fd6[_0x937c('0x20')];var _0xeb6774=_0x1afa90?0x0:_0x12b46d[_0x937c('0x1e')];var _0x599539=_0x1afa90?_0x5a6fd6[_0x937c('0x20')]:_0x12b46d[_0x937c('0x1e')]+_0x12b46d[_0x937c('0x21')];var _0x5de210;if(_0x599539>=_0x505625){_0x599539=_0x505625;_0x5de210=0xc8;}else{_0x5de210=0xce;}_0x5a5d35[_0x937c('0x1b')](_0x5de210);return _0x5a5d35[_0x937c('0x22')](_0x937c('0x23'),_0xeb6774+'-'+_0x599539+'/'+_0x505625)[_0x937c('0x1d')](_0x5a6fd6);}return null;};}function patchUpdates(_0x24300f){return function(_0x437fd0){try{jsonpatch[_0x937c('0x24')](_0x437fd0,_0x24300f,!![]);}catch(_0xeb3f7b){return BPromise['reject'](_0xeb3f7b);}return _0x437fd0['save']();};}function saveUpdates(_0x2ed01b,_0x49ee9f){return function(_0x2b7368){if(_0x2b7368){return _0x2b7368[_0x937c('0x25')](_0x2ed01b)[_0x937c('0x26')](function(_0x63167a){return _0x63167a;});}return null;};}function removeEntity(_0x5c8310,_0x1c92ca){return function(_0xb9f247){if(_0xb9f247){return _0xb9f247[_0x937c('0x27')]()[_0x937c('0x26')](function(){_0x5c8310[_0x937c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x765a9a,_0xd7918f){return function(_0x42801d){if(!_0x42801d){_0x765a9a[_0x937c('0x1a')](0x194);}return _0x42801d;};}function handleError(_0x19c79b,_0x53665b){_0x53665b=_0x53665b||0x1f4;return function(_0xc14a56){logger[_0x937c('0x28')](_0xc14a56['stack']);if(_0xc14a56[_0x937c('0x29')]){delete _0xc14a56[_0x937c('0x29')];}_0x19c79b[_0x937c('0x1b')](_0x53665b)[_0x937c('0x2a')](_0xc14a56);};}exports[_0x937c('0x2b')]=function(_0x160380,_0x5bc616){var _0x102097={},_0x585244={},_0xc79c1a={'count':0x0,'rows':[]};var _0x348b64=_[_0x937c('0x2c')](db[_0x937c('0x2d')][_0x937c('0x2e')],function(_0xd79d5c){return{'name':_0xd79d5c[_0x937c('0x2f')],'type':_0xd79d5c[_0x937c('0x30')][_0x937c('0x31')]};});_0x585244['model']=_[_0x937c('0x2c')](_0x348b64,_0x937c('0x29'));_0x585244['query']=_[_0x937c('0x32')](_0x160380[_0x937c('0x33')]);_0x585244['filters']=_[_0x937c('0x34')](_0x585244[_0x937c('0x35')],_0x585244['query']);_0x102097[_0x937c('0x36')]=_['intersection'](_0x585244[_0x937c('0x35')],qs[_0x937c('0x37')](_0x160380['query']['fields']));_0x102097['attributes']=_0x102097[_0x937c('0x36')][_0x937c('0x38')]?_0x102097[_0x937c('0x36')]:_0x585244[_0x937c('0x35')];if(!_0x160380[_0x937c('0x33')][_0x937c('0x39')](_0x937c('0x3a'))){_0x102097[_0x937c('0x21')]=qs[_0x937c('0x21')](_0x160380[_0x937c('0x33')]['limit']);_0x102097['offset']=qs['offset'](_0x160380[_0x937c('0x33')]['offset']);}_0x102097[_0x937c('0x3b')]=qs[_0x937c('0x3c')](_0x160380['query'][_0x937c('0x3c')]);_0x102097[_0x937c('0x3d')]=qs[_0x937c('0x3e')](_['pick'](_0x160380[_0x937c('0x33')],_0x585244[_0x937c('0x3e')]),_0x348b64);if(_0x160380[_0x937c('0x33')][_0x937c('0x3f')]){_0x102097[_0x937c('0x3d')]=_['merge'](_0x102097[_0x937c('0x3d')],{'$or':_[_0x937c('0x2c')](_0x348b64,function(_0x504c33){if(_0x504c33[_0x937c('0x30')]!==_0x937c('0x40')){var _0x3ba198={};_0x3ba198[_0x504c33[_0x937c('0x29')]]={'$like':'%'+_0x160380[_0x937c('0x33')][_0x937c('0x3f')]+'%'};return _0x3ba198;}})});}_0x102097=_[_0x937c('0x41')]({},_0x102097,_0x160380[_0x937c('0x42')]);var _0x1875f6={'where':_0x102097[_0x937c('0x3d')]};return db[_0x937c('0x2d')][_0x937c('0x20')](_0x1875f6)['then'](function(_0x41d908){_0xc79c1a['count']=_0x41d908;if(_0x160380[_0x937c('0x33')]['includeAll']){_0x102097[_0x937c('0x43')]=[{'all':!![]}];}return db[_0x937c('0x2d')][_0x937c('0x44')](_0x102097);})['then'](function(_0x3cf120){_0xc79c1a['rows']=_0x3cf120;return _0xc79c1a;})[_0x937c('0x26')](respondWithFilteredResult(_0x5bc616,_0x102097))['catch'](handleError(_0x5bc616,null));};exports[_0x937c('0x45')]=function(_0x27f39b,_0x5a8f24){var _0xb4af9e={'raw':![],'where':{'id':_0x27f39b[_0x937c('0x46')]['id']}},_0x55a35f={};_0x55a35f[_0x937c('0x35')]=_[_0x937c('0x32')](db[_0x937c('0x2d')][_0x937c('0x2e')]);_0x55a35f['query']=_['keys'](_0x27f39b[_0x937c('0x33')]);_0x55a35f[_0x937c('0x3e')]=_[_0x937c('0x34')](_0x55a35f[_0x937c('0x35')],_0x55a35f[_0x937c('0x33')]);_0xb4af9e[_0x937c('0x36')]=_[_0x937c('0x34')](_0x55a35f['model'],qs[_0x937c('0x37')](_0x27f39b[_0x937c('0x33')][_0x937c('0x37')]));_0xb4af9e['attributes']=_0xb4af9e[_0x937c('0x36')][_0x937c('0x38')]?_0xb4af9e[_0x937c('0x36')]:_0x55a35f['model'];if(_0x27f39b[_0x937c('0x33')][_0x937c('0x47')]){_0xb4af9e[_0x937c('0x43')]=[{'all':!![]}];}_0xb4af9e=_[_0x937c('0x41')]({},_0xb4af9e,_0x27f39b[_0x937c('0x42')]);return db[_0x937c('0x2d')][_0x937c('0x48')](_0xb4af9e)[_0x937c('0x26')](handleEntityNotFound(_0x5a8f24,null))[_0x937c('0x26')](respondWithResult(_0x5a8f24,null))['catch'](handleError(_0x5a8f24,null));};exports['create']=function(_0x15fe1e,_0x38a162){return db[_0x937c('0x2d')][_0x937c('0x49')](_0x15fe1e[_0x937c('0x4a')],{})[_0x937c('0x26')](respondWithResult(_0x38a162,0xc9))[_0x937c('0x4b')](handleError(_0x38a162,null));};exports[_0x937c('0x25')]=function(_0x9660e7,_0x2cb7c8){if(_0x9660e7[_0x937c('0x4a')]['id']){delete _0x9660e7['body']['id'];}return db['ZohoConfiguration'][_0x937c('0x48')]({'where':{'id':_0x9660e7[_0x937c('0x46')]['id']}})[_0x937c('0x26')](handleEntityNotFound(_0x2cb7c8,null))[_0x937c('0x26')](saveUpdates(_0x9660e7[_0x937c('0x4a')],null))[_0x937c('0x26')](respondWithResult(_0x2cb7c8,null))[_0x937c('0x4b')](handleError(_0x2cb7c8,null));};exports[_0x937c('0x27')]=function(_0x1464d6,_0x3bec26){return db[_0x937c('0x2d')][_0x937c('0x48')]({'where':{'id':_0x1464d6[_0x937c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bec26,null))['then'](removeEntity(_0x3bec26,null))['catch'](handleError(_0x3bec26,null));};exports['getFields']=function(_0x49cbcf,_0x1ab62e,_0x32534d){var _0x383ec4={};var _0x1858e9={};var _0x1754e3;var _0x239004;return db[_0x937c('0x2d')][_0x937c('0x4c')]({'where':{'id':_0x49cbcf[_0x937c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ab62e,null))[_0x937c('0x26')](function(_0x365868){if(_0x365868){_0x1754e3=_0x365868;_0x1858e9[_0x937c('0x35')]=_[_0x937c('0x32')](db[_0x937c('0x4d')]['rawAttributes']);_0x1858e9[_0x937c('0x33')]=_[_0x937c('0x32')](_0x49cbcf[_0x937c('0x33')]);_0x1858e9[_0x937c('0x3e')]=_[_0x937c('0x34')](_0x1858e9[_0x937c('0x35')],_0x1858e9[_0x937c('0x33')]);_0x383ec4[_0x937c('0x36')]=_[_0x937c('0x34')](_0x1858e9[_0x937c('0x35')],qs['fields'](_0x49cbcf[_0x937c('0x33')][_0x937c('0x37')]));_0x383ec4[_0x937c('0x36')]=_0x383ec4['attributes'][_0x937c('0x38')]?_0x383ec4['attributes']:_0x1858e9['model'];_0x383ec4[_0x937c('0x3b')]=qs['sort'](_0x49cbcf[_0x937c('0x33')][_0x937c('0x3c')]);_0x383ec4[_0x937c('0x3d')]=qs[_0x937c('0x3e')](_['pick'](_0x49cbcf[_0x937c('0x33')],_0x1858e9[_0x937c('0x3e')]));if(_0x49cbcf['query']['filter']){_0x383ec4[_0x937c('0x3d')]=_[_0x937c('0x41')](_0x383ec4[_0x937c('0x3d')],{'$or':_[_0x937c('0x2c')](_0x383ec4[_0x937c('0x36')],function(_0xce16bf){var _0x383f1e={};_0x383f1e[_0xce16bf]={'$like':'%'+_0x49cbcf[_0x937c('0x33')][_0x937c('0x3f')]+'%'};return _0x383f1e;})});}_0x383ec4=_['merge']({},_0x383ec4,_0x49cbcf[_0x937c('0x42')]);return _0x1754e3[_0x937c('0x4e')](_0x383ec4);}})[_0x937c('0x26')](function(_0x187afd){if(_0x187afd){_0x239004=_0x187afd[_0x937c('0x38')];if(!_0x49cbcf[_0x937c('0x33')][_0x937c('0x39')](_0x937c('0x3a'))){_0x383ec4[_0x937c('0x21')]=qs['limit'](_0x49cbcf['query'][_0x937c('0x21')]);_0x383ec4['offset']=qs[_0x937c('0x1e')](_0x49cbcf[_0x937c('0x33')]['offset']);}return _0x1754e3[_0x937c('0x4e')](_0x383ec4);}})[_0x937c('0x26')](function(_0x2a5fb6){if(_0x2a5fb6){return _0x2a5fb6?{'count':_0x239004,'rows':_0x2a5fb6}:null;}})[_0x937c('0x26')](respondWithResult(_0x1ab62e,null))[_0x937c('0x4b')](handleError(_0x1ab62e,null));};exports[_0x937c('0x4f')]=function(_0x17ea52,_0x3770a5,_0x39b47f){var _0x2a5809={};var _0x216aa3={};var _0x9028f2;var _0x73b101;return db[_0x937c('0x2d')][_0x937c('0x4c')]({'where':{'id':_0x17ea52[_0x937c('0x46')]['id']}})[_0x937c('0x26')](handleEntityNotFound(_0x3770a5,null))[_0x937c('0x26')](function(_0x3eaad0){if(_0x3eaad0){_0x9028f2=_0x3eaad0;_0x216aa3['model']=_['keys'](db['ZohoField'][_0x937c('0x2e')]);_0x216aa3[_0x937c('0x33')]=_[_0x937c('0x32')](_0x17ea52[_0x937c('0x33')]);_0x216aa3[_0x937c('0x3e')]=_[_0x937c('0x34')](_0x216aa3['model'],_0x216aa3[_0x937c('0x33')]);_0x2a5809['attributes']=_[_0x937c('0x34')](_0x216aa3[_0x937c('0x35')],qs[_0x937c('0x37')](_0x17ea52[_0x937c('0x33')][_0x937c('0x37')]));_0x2a5809[_0x937c('0x36')]=_0x2a5809['attributes'][_0x937c('0x38')]?_0x2a5809[_0x937c('0x36')]:_0x216aa3[_0x937c('0x35')];_0x2a5809[_0x937c('0x3b')]=qs[_0x937c('0x3c')](_0x17ea52['query']['sort']);_0x2a5809[_0x937c('0x3d')]=qs[_0x937c('0x3e')](_[_0x937c('0x50')](_0x17ea52[_0x937c('0x33')],_0x216aa3['filters']));if(_0x17ea52['query']['filter']){_0x2a5809[_0x937c('0x3d')]=_[_0x937c('0x41')](_0x2a5809[_0x937c('0x3d')],{'$or':_[_0x937c('0x2c')](_0x2a5809['attributes'],function(_0x54f58b){var _0x401c76={};_0x401c76[_0x54f58b]={'$like':'%'+_0x17ea52['query'][_0x937c('0x3f')]+'%'};return _0x401c76;})});}_0x2a5809=_[_0x937c('0x41')]({},_0x2a5809,_0x17ea52['options']);return _0x9028f2[_0x937c('0x4f')](_0x2a5809);}})[_0x937c('0x26')](function(_0x38fd0b){if(_0x38fd0b){_0x73b101=_0x38fd0b[_0x937c('0x38')];if(!_0x17ea52[_0x937c('0x33')][_0x937c('0x39')](_0x937c('0x3a'))){_0x2a5809[_0x937c('0x21')]=qs[_0x937c('0x21')](_0x17ea52[_0x937c('0x33')][_0x937c('0x21')]);_0x2a5809['offset']=qs[_0x937c('0x1e')](_0x17ea52['query']['offset']);}return _0x9028f2[_0x937c('0x4f')](_0x2a5809);}})[_0x937c('0x26')](function(_0x3a56ef){if(_0x3a56ef){return _0x3a56ef?{'count':_0x73b101,'rows':_0x3a56ef}:null;}})[_0x937c('0x26')](respondWithResult(_0x3770a5,null))['catch'](handleError(_0x3770a5,null));};exports[_0x937c('0x51')]=function(_0x19e3a8,_0x1d5d26,_0x171bef){var _0x234114={};var _0x4d7a05={};var _0x1f3b2b;var _0xca63c5;return db[_0x937c('0x2d')][_0x937c('0x4c')]({'where':{'id':_0x19e3a8['params']['id']}})['then'](handleEntityNotFound(_0x1d5d26,null))['then'](function(_0x55183d){if(_0x55183d){_0x1f3b2b=_0x55183d;_0x4d7a05[_0x937c('0x35')]=_[_0x937c('0x32')](db['ZohoField'][_0x937c('0x2e')]);_0x4d7a05[_0x937c('0x33')]=_[_0x937c('0x32')](_0x19e3a8['query']);_0x4d7a05['filters']=_[_0x937c('0x34')](_0x4d7a05[_0x937c('0x35')],_0x4d7a05[_0x937c('0x33')]);_0x234114['attributes']=_[_0x937c('0x34')](_0x4d7a05[_0x937c('0x35')],qs[_0x937c('0x37')](_0x19e3a8[_0x937c('0x33')][_0x937c('0x37')]));_0x234114[_0x937c('0x36')]=_0x234114['attributes'][_0x937c('0x38')]?_0x234114[_0x937c('0x36')]:_0x4d7a05[_0x937c('0x35')];_0x234114[_0x937c('0x3b')]=qs[_0x937c('0x3c')](_0x19e3a8[_0x937c('0x33')][_0x937c('0x3c')]);_0x234114['where']=qs[_0x937c('0x3e')](_[_0x937c('0x50')](_0x19e3a8[_0x937c('0x33')],_0x4d7a05[_0x937c('0x3e')]));if(_0x19e3a8['query']['filter']){_0x234114[_0x937c('0x3d')]=_['merge'](_0x234114[_0x937c('0x3d')],{'$or':_[_0x937c('0x2c')](_0x234114[_0x937c('0x36')],function(_0x27762e){var _0x308787={};_0x308787[_0x27762e]={'$like':'%'+_0x19e3a8['query']['filter']+'%'};return _0x308787;})});}_0x234114=_['merge']({},_0x234114,_0x19e3a8[_0x937c('0x42')]);return _0x1f3b2b[_0x937c('0x51')](_0x234114);}})[_0x937c('0x26')](function(_0x33110f){if(_0x33110f){_0xca63c5=_0x33110f[_0x937c('0x38')];if(!_0x19e3a8['query'][_0x937c('0x39')]('nolimit')){_0x234114[_0x937c('0x21')]=qs[_0x937c('0x21')](_0x19e3a8[_0x937c('0x33')][_0x937c('0x21')]);_0x234114[_0x937c('0x1e')]=qs[_0x937c('0x1e')](_0x19e3a8[_0x937c('0x33')]['offset']);}return _0x1f3b2b['getDescriptions'](_0x234114);}})[_0x937c('0x26')](function(_0x286dff){if(_0x286dff){return _0x286dff?{'count':_0xca63c5,'rows':_0x286dff}:null;}})[_0x937c('0x26')](respondWithResult(_0x1d5d26,null))['catch'](handleError(_0x1d5d26,null));}; \ No newline at end of file +var _0xf7df=['ZohoField','order','pick','getFields','getSubjects','nolimit','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','then','destroy','error','stack','name','index','ZohoConfiguration','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','merge','map','filter','options','includeAll','catch','show','params','rawAttributes','include','find','create','body','update','findOne'];(function(_0xb12a1d,_0x229e8b){var _0x428340=function(_0x254ea3){while(--_0x254ea3){_0xb12a1d['push'](_0xb12a1d['shift']());}};_0x428340(++_0x229e8b);}(_0xf7df,0x147));var _0xff7d=function(_0x8634eb,_0x1e9cdd){_0x8634eb=_0x8634eb-0x0;var _0x47f258=_0xf7df[_0x8634eb];return _0x47f258;};'use strict';var emlformat=require(_0xff7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff7d('0x1'));var jsonpatch=require(_0xff7d('0x2'));var rp=require(_0xff7d('0x3'));var moment=require(_0xff7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff7d('0x5'));var util=require(_0xff7d('0x6'));var path=require(_0xff7d('0x7'));var sox=require(_0xff7d('0x8'));var csv=require('to-csv');var ejs=require(_0xff7d('0x9'));var fs=require('fs');var fs_extra=require(_0xff7d('0xa'));var _=require('lodash');var squel=require(_0xff7d('0xb'));var crypto=require(_0xff7d('0xc'));var jsforce=require(_0xff7d('0xd'));var deskjs=require(_0xff7d('0xe'));var toCsv=require(_0xff7d('0xf'));var querystring=require(_0xff7d('0x10'));var Papa=require('papaparse');var Redis=require(_0xff7d('0x11'));var authService=require(_0xff7d('0x12'));var qs=require(_0xff7d('0x13'));var as=require(_0xff7d('0x14'));var hardwareService=require(_0xff7d('0x15'));var logger=require(_0xff7d('0x16'))(_0xff7d('0x17'));var utils=require(_0xff7d('0x18'));var config=require(_0xff7d('0x19'));var licenseUtil=require(_0xff7d('0x1a'));var db=require(_0xff7d('0x1b'))['db'];function respondWithStatusCode(_0x766ba3,_0x38070b){_0x38070b=_0x38070b||0xcc;return function(_0x553feb){if(_0x553feb){return _0x766ba3[_0xff7d('0x1c')](_0x38070b);}return _0x766ba3[_0xff7d('0x1d')](_0x38070b)[_0xff7d('0x1e')]();};}function respondWithResult(_0x14fc1d,_0x54300b){_0x54300b=_0x54300b||0xc8;return function(_0x95f640){if(_0x95f640){return _0x14fc1d[_0xff7d('0x1d')](_0x54300b)[_0xff7d('0x1f')](_0x95f640);}};}function respondWithFilteredResult(_0x1aefe4,_0x2229f5){return function(_0xe3484b){if(_0xe3484b){var _0x4a286e=typeof _0x2229f5[_0xff7d('0x20')]===_0xff7d('0x21')&&typeof _0x2229f5['limit']===_0xff7d('0x21');var _0x274cb2=_0xe3484b[_0xff7d('0x22')];var _0x3849b3=_0x4a286e?0x0:_0x2229f5[_0xff7d('0x20')];var _0x3a2d38=_0x4a286e?_0xe3484b[_0xff7d('0x22')]:_0x2229f5[_0xff7d('0x20')]+_0x2229f5['limit'];var _0x53742b;if(_0x3a2d38>=_0x274cb2){_0x3a2d38=_0x274cb2;_0x53742b=0xc8;}else{_0x53742b=0xce;}_0x1aefe4[_0xff7d('0x1d')](_0x53742b);return _0x1aefe4[_0xff7d('0x23')](_0xff7d('0x24'),_0x3849b3+'-'+_0x3a2d38+'/'+_0x274cb2)['json'](_0xe3484b);}return null;};}function patchUpdates(_0x52a9dc){return function(_0x54f58c){try{jsonpatch['apply'](_0x54f58c,_0x52a9dc,!![]);}catch(_0x4c1df8){return BPromise['reject'](_0x4c1df8);}return _0x54f58c[_0xff7d('0x25')]();};}function saveUpdates(_0x3a7657,_0x21a36b){return function(_0x2fcbaa){if(_0x2fcbaa){return _0x2fcbaa['update'](_0x3a7657)[_0xff7d('0x26')](function(_0x3f3d63){return _0x3f3d63;});}return null;};}function removeEntity(_0x38c375,_0x17bafb){return function(_0xc9df9){if(_0xc9df9){return _0xc9df9[_0xff7d('0x27')]()[_0xff7d('0x26')](function(){_0x38c375[_0xff7d('0x1d')](0xcc)[_0xff7d('0x1e')]();});}};}function handleEntityNotFound(_0x13d9ec,_0x236922){return function(_0x4fde7d){if(!_0x4fde7d){_0x13d9ec[_0xff7d('0x1c')](0x194);}return _0x4fde7d;};}function handleError(_0x5a1f6b,_0x3a0a9f){_0x3a0a9f=_0x3a0a9f||0x1f4;return function(_0x57a958){logger[_0xff7d('0x28')](_0x57a958[_0xff7d('0x29')]);if(_0x57a958['name']){delete _0x57a958[_0xff7d('0x2a')];}_0x5a1f6b[_0xff7d('0x1d')](_0x3a0a9f)['send'](_0x57a958);};}exports[_0xff7d('0x2b')]=function(_0x5f04a8,_0xe4c5ff){var _0x43e585={},_0x42983f={},_0x3ad896={'count':0x0,'rows':[]};var _0x24df99=_['map'](db[_0xff7d('0x2c')]['rawAttributes'],function(_0x1dd668){return{'name':_0x1dd668['fieldName'],'type':_0x1dd668[_0xff7d('0x2d')]['key']};});_0x42983f['model']=_['map'](_0x24df99,_0xff7d('0x2a'));_0x42983f['query']=_[_0xff7d('0x2e')](_0x5f04a8[_0xff7d('0x2f')]);_0x42983f[_0xff7d('0x30')]=_[_0xff7d('0x31')](_0x42983f['model'],_0x42983f['query']);_0x43e585['attributes']=_['intersection'](_0x42983f[_0xff7d('0x32')],qs[_0xff7d('0x33')](_0x5f04a8[_0xff7d('0x2f')][_0xff7d('0x33')]));_0x43e585[_0xff7d('0x34')]=_0x43e585[_0xff7d('0x34')][_0xff7d('0x35')]?_0x43e585[_0xff7d('0x34')]:_0x42983f['model'];if(!_0x5f04a8[_0xff7d('0x2f')][_0xff7d('0x36')]('nolimit')){_0x43e585[_0xff7d('0x37')]=qs[_0xff7d('0x37')](_0x5f04a8[_0xff7d('0x2f')][_0xff7d('0x37')]);_0x43e585['offset']=qs[_0xff7d('0x20')](_0x5f04a8[_0xff7d('0x2f')]['offset']);}_0x43e585['order']=qs[_0xff7d('0x38')](_0x5f04a8[_0xff7d('0x2f')][_0xff7d('0x38')]);_0x43e585[_0xff7d('0x39')]=qs['filters'](_['pick'](_0x5f04a8[_0xff7d('0x2f')],_0x42983f['filters']),_0x24df99);if(_0x5f04a8[_0xff7d('0x2f')]['filter']){_0x43e585[_0xff7d('0x39')]=_[_0xff7d('0x3a')](_0x43e585[_0xff7d('0x39')],{'$or':_[_0xff7d('0x3b')](_0x24df99,function(_0x4e0308){if(_0x4e0308[_0xff7d('0x2d')]!=='VIRTUAL'){var _0x26d34e={};_0x26d34e[_0x4e0308[_0xff7d('0x2a')]]={'$like':'%'+_0x5f04a8[_0xff7d('0x2f')][_0xff7d('0x3c')]+'%'};return _0x26d34e;}})});}_0x43e585=_[_0xff7d('0x3a')]({},_0x43e585,_0x5f04a8[_0xff7d('0x3d')]);var _0x1519e2={'where':_0x43e585[_0xff7d('0x39')]};return db[_0xff7d('0x2c')]['count'](_0x1519e2)[_0xff7d('0x26')](function(_0x160b87){_0x3ad896['count']=_0x160b87;if(_0x5f04a8['query'][_0xff7d('0x3e')]){_0x43e585['include']=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x43e585);})[_0xff7d('0x26')](function(_0x1004f7){_0x3ad896['rows']=_0x1004f7;return _0x3ad896;})[_0xff7d('0x26')](respondWithFilteredResult(_0xe4c5ff,_0x43e585))[_0xff7d('0x3f')](handleError(_0xe4c5ff,null));};exports[_0xff7d('0x40')]=function(_0x784afe,_0x4f98d2){var _0x531aba={'raw':![],'where':{'id':_0x784afe[_0xff7d('0x41')]['id']}},_0x5a2e6b={};_0x5a2e6b[_0xff7d('0x32')]=_['keys'](db[_0xff7d('0x2c')][_0xff7d('0x42')]);_0x5a2e6b[_0xff7d('0x2f')]=_[_0xff7d('0x2e')](_0x784afe[_0xff7d('0x2f')]);_0x5a2e6b[_0xff7d('0x30')]=_[_0xff7d('0x31')](_0x5a2e6b['model'],_0x5a2e6b['query']);_0x531aba[_0xff7d('0x34')]=_[_0xff7d('0x31')](_0x5a2e6b[_0xff7d('0x32')],qs[_0xff7d('0x33')](_0x784afe[_0xff7d('0x2f')][_0xff7d('0x33')]));_0x531aba[_0xff7d('0x34')]=_0x531aba['attributes'][_0xff7d('0x35')]?_0x531aba[_0xff7d('0x34')]:_0x5a2e6b[_0xff7d('0x32')];if(_0x784afe[_0xff7d('0x2f')][_0xff7d('0x3e')]){_0x531aba[_0xff7d('0x43')]=[{'all':!![]}];}_0x531aba=_[_0xff7d('0x3a')]({},_0x531aba,_0x784afe['options']);return db[_0xff7d('0x2c')][_0xff7d('0x44')](_0x531aba)[_0xff7d('0x26')](handleEntityNotFound(_0x4f98d2,null))[_0xff7d('0x26')](respondWithResult(_0x4f98d2,null))[_0xff7d('0x3f')](handleError(_0x4f98d2,null));};exports[_0xff7d('0x45')]=function(_0x314a30,_0x44fd52){return db['ZohoConfiguration'][_0xff7d('0x45')](_0x314a30[_0xff7d('0x46')],{})[_0xff7d('0x26')](respondWithResult(_0x44fd52,0xc9))[_0xff7d('0x3f')](handleError(_0x44fd52,null));};exports[_0xff7d('0x47')]=function(_0x59c625,_0x4c3400){if(_0x59c625[_0xff7d('0x46')]['id']){delete _0x59c625[_0xff7d('0x46')]['id'];}return db[_0xff7d('0x2c')][_0xff7d('0x44')]({'where':{'id':_0x59c625[_0xff7d('0x41')]['id']}})[_0xff7d('0x26')](handleEntityNotFound(_0x4c3400,null))['then'](saveUpdates(_0x59c625[_0xff7d('0x46')],null))[_0xff7d('0x26')](respondWithResult(_0x4c3400,null))['catch'](handleError(_0x4c3400,null));};exports[_0xff7d('0x27')]=function(_0x5e7475,_0x1a2e36){return db[_0xff7d('0x2c')][_0xff7d('0x44')]({'where':{'id':_0x5e7475[_0xff7d('0x41')]['id']}})[_0xff7d('0x26')](handleEntityNotFound(_0x1a2e36,null))[_0xff7d('0x26')](removeEntity(_0x1a2e36,null))[_0xff7d('0x3f')](handleError(_0x1a2e36,null));};exports['getFields']=function(_0x1494b9,_0x41ec7e,_0x2aff23){var _0x1c43d1={};var _0x11f00d={};var _0xdd8417;var _0x473b7d;return db[_0xff7d('0x2c')][_0xff7d('0x48')]({'where':{'id':_0x1494b9[_0xff7d('0x41')]['id']}})['then'](handleEntityNotFound(_0x41ec7e,null))[_0xff7d('0x26')](function(_0x5d91c0){if(_0x5d91c0){_0xdd8417=_0x5d91c0;_0x11f00d['model']=_[_0xff7d('0x2e')](db[_0xff7d('0x49')][_0xff7d('0x42')]);_0x11f00d[_0xff7d('0x2f')]=_[_0xff7d('0x2e')](_0x1494b9[_0xff7d('0x2f')]);_0x11f00d['filters']=_[_0xff7d('0x31')](_0x11f00d[_0xff7d('0x32')],_0x11f00d[_0xff7d('0x2f')]);_0x1c43d1[_0xff7d('0x34')]=_['intersection'](_0x11f00d[_0xff7d('0x32')],qs['fields'](_0x1494b9[_0xff7d('0x2f')][_0xff7d('0x33')]));_0x1c43d1[_0xff7d('0x34')]=_0x1c43d1['attributes']['length']?_0x1c43d1[_0xff7d('0x34')]:_0x11f00d['model'];_0x1c43d1[_0xff7d('0x4a')]=qs['sort'](_0x1494b9[_0xff7d('0x2f')]['sort']);_0x1c43d1[_0xff7d('0x39')]=qs[_0xff7d('0x30')](_[_0xff7d('0x4b')](_0x1494b9[_0xff7d('0x2f')],_0x11f00d['filters']));if(_0x1494b9[_0xff7d('0x2f')]['filter']){_0x1c43d1[_0xff7d('0x39')]=_[_0xff7d('0x3a')](_0x1c43d1[_0xff7d('0x39')],{'$or':_['map'](_0x1c43d1[_0xff7d('0x34')],function(_0x57bf90){var _0xf8bb28={};_0xf8bb28[_0x57bf90]={'$like':'%'+_0x1494b9['query'][_0xff7d('0x3c')]+'%'};return _0xf8bb28;})});}_0x1c43d1=_[_0xff7d('0x3a')]({},_0x1c43d1,_0x1494b9[_0xff7d('0x3d')]);return _0xdd8417[_0xff7d('0x4c')](_0x1c43d1);}})['then'](function(_0x1de658){if(_0x1de658){_0x473b7d=_0x1de658[_0xff7d('0x35')];if(!_0x1494b9[_0xff7d('0x2f')]['hasOwnProperty']('nolimit')){_0x1c43d1[_0xff7d('0x37')]=qs[_0xff7d('0x37')](_0x1494b9[_0xff7d('0x2f')]['limit']);_0x1c43d1[_0xff7d('0x20')]=qs[_0xff7d('0x20')](_0x1494b9[_0xff7d('0x2f')][_0xff7d('0x20')]);}return _0xdd8417[_0xff7d('0x4c')](_0x1c43d1);}})[_0xff7d('0x26')](function(_0x47f7d2){if(_0x47f7d2){return _0x47f7d2?{'count':_0x473b7d,'rows':_0x47f7d2}:null;}})['then'](respondWithResult(_0x41ec7e,null))[_0xff7d('0x3f')](handleError(_0x41ec7e,null));};exports[_0xff7d('0x4d')]=function(_0x1204af,_0x4c8796,_0x5085b3){var _0x5c067e={};var _0x5a4e21={};var _0x21942a;var _0x280421;return db[_0xff7d('0x2c')][_0xff7d('0x48')]({'where':{'id':_0x1204af[_0xff7d('0x41')]['id']}})[_0xff7d('0x26')](handleEntityNotFound(_0x4c8796,null))[_0xff7d('0x26')](function(_0x2ed9f6){if(_0x2ed9f6){_0x21942a=_0x2ed9f6;_0x5a4e21[_0xff7d('0x32')]=_['keys'](db['ZohoField'][_0xff7d('0x42')]);_0x5a4e21[_0xff7d('0x2f')]=_[_0xff7d('0x2e')](_0x1204af[_0xff7d('0x2f')]);_0x5a4e21[_0xff7d('0x30')]=_[_0xff7d('0x31')](_0x5a4e21[_0xff7d('0x32')],_0x5a4e21[_0xff7d('0x2f')]);_0x5c067e[_0xff7d('0x34')]=_['intersection'](_0x5a4e21[_0xff7d('0x32')],qs['fields'](_0x1204af['query']['fields']));_0x5c067e[_0xff7d('0x34')]=_0x5c067e['attributes']['length']?_0x5c067e[_0xff7d('0x34')]:_0x5a4e21[_0xff7d('0x32')];_0x5c067e[_0xff7d('0x4a')]=qs[_0xff7d('0x38')](_0x1204af[_0xff7d('0x2f')]['sort']);_0x5c067e[_0xff7d('0x39')]=qs[_0xff7d('0x30')](_[_0xff7d('0x4b')](_0x1204af[_0xff7d('0x2f')],_0x5a4e21[_0xff7d('0x30')]));if(_0x1204af[_0xff7d('0x2f')][_0xff7d('0x3c')]){_0x5c067e['where']=_[_0xff7d('0x3a')](_0x5c067e[_0xff7d('0x39')],{'$or':_['map'](_0x5c067e['attributes'],function(_0x164901){var _0x3b29a3={};_0x3b29a3[_0x164901]={'$like':'%'+_0x1204af[_0xff7d('0x2f')][_0xff7d('0x3c')]+'%'};return _0x3b29a3;})});}_0x5c067e=_[_0xff7d('0x3a')]({},_0x5c067e,_0x1204af[_0xff7d('0x3d')]);return _0x21942a[_0xff7d('0x4d')](_0x5c067e);}})[_0xff7d('0x26')](function(_0x567f48){if(_0x567f48){_0x280421=_0x567f48[_0xff7d('0x35')];if(!_0x1204af[_0xff7d('0x2f')][_0xff7d('0x36')](_0xff7d('0x4e'))){_0x5c067e[_0xff7d('0x37')]=qs[_0xff7d('0x37')](_0x1204af[_0xff7d('0x2f')][_0xff7d('0x37')]);_0x5c067e['offset']=qs['offset'](_0x1204af[_0xff7d('0x2f')]['offset']);}return _0x21942a['getSubjects'](_0x5c067e);}})['then'](function(_0x3964d0){if(_0x3964d0){return _0x3964d0?{'count':_0x280421,'rows':_0x3964d0}:null;}})[_0xff7d('0x26')](respondWithResult(_0x4c8796,null))['catch'](handleError(_0x4c8796,null));};exports[_0xff7d('0x4f')]=function(_0x1a369c,_0x4d3496,_0x3d1aa5){var _0xa288ae={};var _0x43aaf8={};var _0x5090a1;var _0x4ac6af;return db['ZohoConfiguration'][_0xff7d('0x48')]({'where':{'id':_0x1a369c[_0xff7d('0x41')]['id']}})[_0xff7d('0x26')](handleEntityNotFound(_0x4d3496,null))['then'](function(_0x12191a){if(_0x12191a){_0x5090a1=_0x12191a;_0x43aaf8[_0xff7d('0x32')]=_['keys'](db[_0xff7d('0x49')][_0xff7d('0x42')]);_0x43aaf8[_0xff7d('0x2f')]=_[_0xff7d('0x2e')](_0x1a369c[_0xff7d('0x2f')]);_0x43aaf8['filters']=_['intersection'](_0x43aaf8['model'],_0x43aaf8[_0xff7d('0x2f')]);_0xa288ae['attributes']=_[_0xff7d('0x31')](_0x43aaf8[_0xff7d('0x32')],qs[_0xff7d('0x33')](_0x1a369c['query'][_0xff7d('0x33')]));_0xa288ae[_0xff7d('0x34')]=_0xa288ae[_0xff7d('0x34')][_0xff7d('0x35')]?_0xa288ae[_0xff7d('0x34')]:_0x43aaf8[_0xff7d('0x32')];_0xa288ae[_0xff7d('0x4a')]=qs['sort'](_0x1a369c[_0xff7d('0x2f')][_0xff7d('0x38')]);_0xa288ae['where']=qs[_0xff7d('0x30')](_[_0xff7d('0x4b')](_0x1a369c[_0xff7d('0x2f')],_0x43aaf8['filters']));if(_0x1a369c['query'][_0xff7d('0x3c')]){_0xa288ae[_0xff7d('0x39')]=_[_0xff7d('0x3a')](_0xa288ae['where'],{'$or':_[_0xff7d('0x3b')](_0xa288ae[_0xff7d('0x34')],function(_0x29bb64){var _0x3e3699={};_0x3e3699[_0x29bb64]={'$like':'%'+_0x1a369c[_0xff7d('0x2f')][_0xff7d('0x3c')]+'%'};return _0x3e3699;})});}_0xa288ae=_[_0xff7d('0x3a')]({},_0xa288ae,_0x1a369c[_0xff7d('0x3d')]);return _0x5090a1[_0xff7d('0x4f')](_0xa288ae);}})[_0xff7d('0x26')](function(_0x1097e4){if(_0x1097e4){_0x4ac6af=_0x1097e4['length'];if(!_0x1a369c[_0xff7d('0x2f')][_0xff7d('0x36')]('nolimit')){_0xa288ae['limit']=qs[_0xff7d('0x37')](_0x1a369c['query'][_0xff7d('0x37')]);_0xa288ae[_0xff7d('0x20')]=qs[_0xff7d('0x20')](_0x1a369c['query'][_0xff7d('0x20')]);}return _0x5090a1[_0xff7d('0x4f')](_0xa288ae);}})['then'](function(_0x1740b8){if(_0x1740b8){return _0x1740b8?{'count':_0x4ac6af,'rows':_0x1740b8}:null;}})[_0xff7d('0x26')](respondWithResult(_0x4d3496,null))[_0xff7d('0x3f')](handleError(_0x4d3496,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9dd3535..2030e7b 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4f9=['util','api','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f9,0x6b));var _0x9f4f=function(_0x100919,_0x38387b){_0x100919=_0x100919-0x0;var _0x444020=_0xf4f9[_0x100919];return _0x444020;};'use strict';var _=require(_0x9f4f('0x0'));var util=require(_0x9f4f('0x1'));var logger=require('../../config/logger')(_0x9f4f('0x2'));var moment=require('moment');var BPromise=require(_0x9f4f('0x3'));var rp=require(_0x9f4f('0x4'));var fs=require('fs');var path=require(_0x9f4f('0x5'));var rimraf=require(_0x9f4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f4f('0x7'));module[_0x9f4f('0x8')]=function(_0x499d94,_0x3a5a8c){return _0x499d94[_0x9f4f('0x9')](_0x9f4f('0xa'),attributes,{'tableName':_0x9f4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb14b=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3bf975,_0x5a749b){var _0x5af02d=function(_0x1f1a56){while(--_0x1f1a56){_0x3bf975['push'](_0x3bf975['shift']());}};_0x5af02d(++_0x5a749b);}(_0xb14b,0xc0));var _0xbb14=function(_0x1a003e,_0x47fd71){_0x1a003e=_0x1a003e-0x0;var _0x555ee4=_0xb14b[_0x1a003e];return _0x555ee4;};'use strict';var _=require(_0xbb14('0x0'));var util=require(_0xbb14('0x1'));var logger=require(_0xbb14('0x2'))(_0xbb14('0x3'));var moment=require('moment');var BPromise=require(_0xbb14('0x4'));var rp=require(_0xbb14('0x5'));var fs=require('fs');var path=require(_0xbb14('0x6'));var rimraf=require(_0xbb14('0x7'));var config=require(_0xbb14('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xbb14('0x9')]=function(_0x544ac5,_0x25b5da){return _0x544ac5[_0xbb14('0xa')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 6709508..cce70ed 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6165=['../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4e2901,_0x2eb0ee){var _0x542548=function(_0x1bda6b){while(--_0x1bda6b){_0x4e2901['push'](_0x4e2901['shift']());}};_0x542548(++_0x2eb0ee);}(_0x6165,0x1dd));var _0x5616=function(_0x5995fd,_0x2df5ac){_0x5995fd=_0x5995fd-0x0;var _0x1a7540=_0x6165[_0x5995fd];return _0x1a7540;};'use strict';var _=require(_0x5616('0x0'));var util=require(_0x5616('0x1'));var moment=require('moment');var BPromise=require(_0x5616('0x2'));var rs=require(_0x5616('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5616('0x4'))['db'];var utils=require(_0x5616('0x5'));var logger=require(_0x5616('0x6'))(_0x5616('0x7'));var config=require(_0x5616('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5616('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x252d16,_0x2506d7,_0x5ec01a){return new BPromise(function(_0x594898,_0xac75e1){return client[_0x5616('0xa')](_0x252d16,_0x5ec01a)[_0x5616('0xb')](function(_0xa9520a){logger[_0x5616('0xc')](_0x5616('0xd'),_0x2506d7,_0x5616('0xe'));logger['debug'](_0x5616('0xf'),_0x2506d7,'request\x20sent',JSON[_0x5616('0x10')](_0xa9520a));if(_0xa9520a[_0x5616('0x11')]){if(_0xa9520a['error'][_0x5616('0x12')]===0x1f4){logger['error'](_0x5616('0xd'),_0x2506d7,_0xa9520a[_0x5616('0x11')]['message']);return _0xac75e1(_0xa9520a[_0x5616('0x11')][_0x5616('0x13')]);}logger[_0x5616('0x11')](_0x5616('0xd'),_0x2506d7,_0xa9520a['error'][_0x5616('0x13')]);return _0x594898(_0xa9520a[_0x5616('0x11')][_0x5616('0x13')]);}else{logger[_0x5616('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x2506d7,_0x5616('0xe'));_0x594898(_0xa9520a[_0x5616('0x14')][_0x5616('0x13')]);}})['catch'](function(_0x355fa9){logger['error'](_0x5616('0xd'),_0x2506d7,_0x355fa9);_0xac75e1(_0x355fa9);});});} \ No newline at end of file +var _0x4d09=['jayson/promise','client','http','request','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ZohoConfiguration,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d09,0x7c));var _0x94d0=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x4d09[_0x4d8666];return _0x37175b;};'use strict';var _=require(_0x94d0('0x0'));var util=require('util');var moment=require(_0x94d0('0x1'));var BPromise=require(_0x94d0('0x2'));var rs=require(_0x94d0('0x3'));var fs=require('fs');var Redis=require(_0x94d0('0x4'));var db=require(_0x94d0('0x5'))['db'];var utils=require(_0x94d0('0x6'));var logger=require(_0x94d0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94d0('0x8'));var client=jayson[_0x94d0('0x9')][_0x94d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58b51d,_0x548ad5,_0xcf9dec){return new BPromise(function(_0x45c180,_0x2bf2c1){return client[_0x94d0('0xb')](_0x58b51d,_0xcf9dec)['then'](function(_0x10050c){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x548ad5,_0x94d0('0xc'));logger[_0x94d0('0xd')](_0x94d0('0xe'),_0x548ad5,_0x94d0('0xc'),JSON[_0x94d0('0xf')](_0x10050c));if(_0x10050c['error']){if(_0x10050c['error']['code']===0x1f4){logger[_0x94d0('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x548ad5,_0x10050c['error'][_0x94d0('0x11')]);return _0x2bf2c1(_0x10050c['error'][_0x94d0('0x11')]);}logger[_0x94d0('0x10')](_0x94d0('0x12'),_0x548ad5,_0x10050c[_0x94d0('0x10')][_0x94d0('0x11')]);return _0x45c180(_0x10050c[_0x94d0('0x10')][_0x94d0('0x11')]);}else{logger[_0x94d0('0x13')](_0x94d0('0x12'),_0x548ad5,_0x94d0('0xc'));_0x45c180(_0x10050c[_0x94d0('0x14')][_0x94d0('0x11')]);}})[_0x94d0('0x15')](function(_0x59b747){logger[_0x94d0('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x548ad5,_0x59b747);_0x2bf2c1(_0x59b747);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index cad1ae9..da3a26d 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b15=['/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1b15,0x79));var _0x51b1=function(_0x160e7d,_0x1266a5){_0x160e7d=_0x160e7d-0x0;var _0x537c1e=_0x1b15[_0x160e7d];return _0x537c1e;};'use strict';var multer=require(_0x51b1('0x0'));var util=require(_0x51b1('0x1'));var path=require(_0x51b1('0x2'));var timeout=require(_0x51b1('0x3'));var express=require(_0x51b1('0x4'));var router=express[_0x51b1('0x5')]();var fs_extra=require(_0x51b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x51b1('0x7'));var config=require(_0x51b1('0x8'));var controller=require('./intZohoField.controller');router[_0x51b1('0x9')]('/',auth[_0x51b1('0xa')](),controller[_0x51b1('0xb')]);router[_0x51b1('0x9')](_0x51b1('0xc'),auth['isAuthenticated'](),controller[_0x51b1('0xd')]);router['post']('/',auth[_0x51b1('0xa')](),controller[_0x51b1('0xe')]);router[_0x51b1('0xf')](_0x51b1('0xc'),auth[_0x51b1('0xa')](),controller[_0x51b1('0x10')]);router[_0x51b1('0x11')](_0x51b1('0xc'),auth[_0x51b1('0xa')](),controller['destroy']);module[_0x51b1('0x12')]=router; \ No newline at end of file +var _0xb412=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','/:id','show','post','create','update','delete','util','path'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xb412,0x7e));var _0x2b41=function(_0x39cfed,_0xac6797){_0x39cfed=_0x39cfed-0x0;var _0x7ee7f1=_0xb412[_0x39cfed];return _0x7ee7f1;};'use strict';var multer=require('multer');var util=require(_0x2b41('0x0'));var path=require(_0x2b41('0x1'));var timeout=require(_0x2b41('0x2'));var express=require(_0x2b41('0x3'));var router=express[_0x2b41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b41('0x5'));var interaction=require(_0x2b41('0x6'));var config=require('../../config/environment');var controller=require(_0x2b41('0x7'));router['get']('/',auth[_0x2b41('0x8')](),controller[_0x2b41('0x9')]);router['get'](_0x2b41('0xa'),auth[_0x2b41('0x8')](),controller[_0x2b41('0xb')]);router[_0x2b41('0xc')]('/',auth['isAuthenticated'](),controller[_0x2b41('0xd')]);router['put']('/:id',auth[_0x2b41('0x8')](),controller[_0x2b41('0xe')]);router[_0x2b41('0xf')](_0x2b41('0xa'),auth[_0x2b41('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7925d9d..4972ddf 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a89=['string','variable','customVariable','keyValue','STRING','BOOLEAN','ENUM'];(function(_0x1ab711,_0x587acb){var _0x4bab40=function(_0x4874ba){while(--_0x4874ba){_0x1ab711['push'](_0x1ab711['shift']());}};_0x4bab40(++_0x587acb);}(_0x0a89,0x92));var _0x90a8=function(_0x4443f3,_0x458052){_0x4443f3=_0x4443f3-0x0;var _0x2f925c=_0x0a89[_0x4443f3];return _0x2f925c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x90a8('0x0')](_0x90a8('0x1'),_0x90a8('0x2'),_0x90a8('0x3'),_0x90a8('0x4'),'picklist'),'defaultValue':_0x90a8('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x90a8('0x5')]},'keyType':{'type':Sequelize[_0x90a8('0x0')](_0x90a8('0x1'),_0x90a8('0x2'),_0x90a8('0x3'))},'keyContent':{'type':Sequelize[_0x90a8('0x5')]},'idField':{'type':Sequelize[_0x90a8('0x5')]},'nameField':{'type':Sequelize[_0x90a8('0x5')]},'customField':{'type':Sequelize[_0x90a8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90a8('0x5')]}}; \ No newline at end of file +var _0x572f=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x56c208,_0x3841ea){var _0x52281b=function(_0x507353){while(--_0x507353){_0x56c208['push'](_0x56c208['shift']());}};_0x52281b(++_0x3841ea);}(_0x572f,0x146));var _0xf572=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x572f[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xf572('0x0')]={'type':{'type':Sequelize[_0xf572('0x1')](_0xf572('0x2'),_0xf572('0x3'),_0xf572('0x4'),_0xf572('0x5'),_0xf572('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf572('0x7')]},'key':{'type':Sequelize[_0xf572('0x7')]},'keyType':{'type':Sequelize[_0xf572('0x1')](_0xf572('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf572('0x7')]},'nameField':{'type':Sequelize[_0xf572('0x7')]},'customField':{'type':Sequelize[_0xf572('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 312628d..2232e46 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9037=['include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZohoField','includeAll','findAll','rows','catch','show','params'];(function(_0x3e043f,_0x3114e6){var _0x31f639=function(_0x4be3e3){while(--_0x4be3e3){_0x3e043f['push'](_0x3e043f['shift']());}};_0x31f639(++_0x3114e6);}(_0x9037,0x185));var _0x7903=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9037[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7903('0x0'));var rimraf=require(_0x7903('0x1'));var zipdir=require(_0x7903('0x2'));var jsonpatch=require(_0x7903('0x3'));var rp=require(_0x7903('0x4'));var moment=require(_0x7903('0x5'));var BPromise=require(_0x7903('0x6'));var Mustache=require(_0x7903('0x7'));var util=require(_0x7903('0x8'));var path=require('path');var sox=require(_0x7903('0x9'));var csv=require(_0x7903('0xa'));var ejs=require(_0x7903('0xb'));var fs=require('fs');var fs_extra=require(_0x7903('0xc'));var _=require(_0x7903('0xd'));var squel=require(_0x7903('0xe'));var crypto=require(_0x7903('0xf'));var jsforce=require(_0x7903('0x10'));var deskjs=require(_0x7903('0x11'));var toCsv=require(_0x7903('0xa'));var querystring=require('querystring');var Papa=require(_0x7903('0x12'));var Redis=require(_0x7903('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7903('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7903('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7903('0x16'));var config=require(_0x7903('0x17'));var licenseUtil=require(_0x7903('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4870cd,_0xd4dd4c){_0xd4dd4c=_0xd4dd4c||0xcc;return function(_0x3de8a6){if(_0x3de8a6){return _0x4870cd[_0x7903('0x19')](_0xd4dd4c);}return _0x4870cd[_0x7903('0x1a')](_0xd4dd4c)[_0x7903('0x1b')]();};}function respondWithResult(_0x3c2258,_0x1dfa0a){_0x1dfa0a=_0x1dfa0a||0xc8;return function(_0x5c5c14){if(_0x5c5c14){return _0x3c2258['status'](_0x1dfa0a)[_0x7903('0x1c')](_0x5c5c14);}};}function respondWithFilteredResult(_0xf6639e,_0x3506c9){return function(_0x431ddd){if(_0x431ddd){var _0x4b66d7=typeof _0x3506c9[_0x7903('0x1d')]===_0x7903('0x1e')&&typeof _0x3506c9[_0x7903('0x1f')]===_0x7903('0x1e');var _0x45783f=_0x431ddd[_0x7903('0x20')];var _0xe2cf48=_0x4b66d7?0x0:_0x3506c9['offset'];var _0x43b256=_0x4b66d7?_0x431ddd[_0x7903('0x20')]:_0x3506c9['offset']+_0x3506c9[_0x7903('0x1f')];var _0x3fffcb;if(_0x43b256>=_0x45783f){_0x43b256=_0x45783f;_0x3fffcb=0xc8;}else{_0x3fffcb=0xce;}_0xf6639e['status'](_0x3fffcb);return _0xf6639e[_0x7903('0x21')](_0x7903('0x22'),_0xe2cf48+'-'+_0x43b256+'/'+_0x45783f)[_0x7903('0x1c')](_0x431ddd);}return null;};}function patchUpdates(_0x58b065){return function(_0x4d4ddf){try{jsonpatch[_0x7903('0x23')](_0x4d4ddf,_0x58b065,!![]);}catch(_0x2c0571){return BPromise[_0x7903('0x24')](_0x2c0571);}return _0x4d4ddf[_0x7903('0x25')]();};}function saveUpdates(_0x4a6563,_0x2f8c26){return function(_0x3f17c9){if(_0x3f17c9){return _0x3f17c9[_0x7903('0x26')](_0x4a6563)[_0x7903('0x27')](function(_0x4f28d1){return _0x4f28d1;});}return null;};}function removeEntity(_0x24daee,_0x2c233f){return function(_0x51c905){if(_0x51c905){return _0x51c905[_0x7903('0x28')]()[_0x7903('0x27')](function(){_0x24daee[_0x7903('0x1a')](0xcc)[_0x7903('0x1b')]();});}};}function handleEntityNotFound(_0x2f028c,_0x5d3af8){return function(_0x427110){if(!_0x427110){_0x2f028c[_0x7903('0x19')](0x194);}return _0x427110;};}function handleError(_0x363142,_0x437e6a){_0x437e6a=_0x437e6a||0x1f4;return function(_0x3526af){logger[_0x7903('0x29')](_0x3526af[_0x7903('0x2a')]);if(_0x3526af[_0x7903('0x2b')]){delete _0x3526af[_0x7903('0x2b')];}_0x363142['status'](_0x437e6a)['send'](_0x3526af);};}exports[_0x7903('0x2c')]=function(_0x38d997,_0x37771d){var _0x44e8a2={},_0x5ebf04={},_0x3c1c8f={'count':0x0,'rows':[]};var _0x5a6a63=_['map'](db['ZohoField'][_0x7903('0x2d')],function(_0x4c49b8){return{'name':_0x4c49b8[_0x7903('0x2e')],'type':_0x4c49b8[_0x7903('0x2f')][_0x7903('0x30')]};});_0x5ebf04['model']=_[_0x7903('0x31')](_0x5a6a63,_0x7903('0x2b'));_0x5ebf04[_0x7903('0x32')]=_['keys'](_0x38d997[_0x7903('0x32')]);_0x5ebf04[_0x7903('0x33')]=_[_0x7903('0x34')](_0x5ebf04['model'],_0x5ebf04[_0x7903('0x32')]);_0x44e8a2['attributes']=_[_0x7903('0x34')](_0x5ebf04[_0x7903('0x35')],qs[_0x7903('0x36')](_0x38d997[_0x7903('0x32')]['fields']));_0x44e8a2[_0x7903('0x37')]=_0x44e8a2[_0x7903('0x37')][_0x7903('0x38')]?_0x44e8a2[_0x7903('0x37')]:_0x5ebf04[_0x7903('0x35')];if(!_0x38d997[_0x7903('0x32')][_0x7903('0x39')](_0x7903('0x3a'))){_0x44e8a2[_0x7903('0x1f')]=qs[_0x7903('0x1f')](_0x38d997['query'][_0x7903('0x1f')]);_0x44e8a2[_0x7903('0x1d')]=qs['offset'](_0x38d997[_0x7903('0x32')][_0x7903('0x1d')]);}_0x44e8a2[_0x7903('0x3b')]=qs['sort'](_0x38d997[_0x7903('0x32')][_0x7903('0x3c')]);_0x44e8a2[_0x7903('0x3d')]=qs[_0x7903('0x33')](_[_0x7903('0x3e')](_0x38d997['query'],_0x5ebf04[_0x7903('0x33')]),_0x5a6a63);if(_0x38d997[_0x7903('0x32')][_0x7903('0x3f')]){_0x44e8a2['where']=_[_0x7903('0x40')](_0x44e8a2['where'],{'$or':_[_0x7903('0x31')](_0x5a6a63,function(_0x51b8e6){if(_0x51b8e6[_0x7903('0x2f')]!==_0x7903('0x41')){var _0x3cbae2={};_0x3cbae2[_0x51b8e6['name']]={'$like':'%'+_0x38d997[_0x7903('0x32')][_0x7903('0x3f')]+'%'};return _0x3cbae2;}})});}_0x44e8a2=_[_0x7903('0x40')]({},_0x44e8a2,_0x38d997['options']);var _0x30f43a={'where':_0x44e8a2[_0x7903('0x3d')]};return db[_0x7903('0x42')][_0x7903('0x20')](_0x30f43a)[_0x7903('0x27')](function(_0x250601){_0x3c1c8f[_0x7903('0x20')]=_0x250601;if(_0x38d997[_0x7903('0x32')][_0x7903('0x43')]){_0x44e8a2['include']=[{'all':!![]}];}return db[_0x7903('0x42')][_0x7903('0x44')](_0x44e8a2);})[_0x7903('0x27')](function(_0x249b3d){_0x3c1c8f[_0x7903('0x45')]=_0x249b3d;return _0x3c1c8f;})[_0x7903('0x27')](respondWithFilteredResult(_0x37771d,_0x44e8a2))[_0x7903('0x46')](handleError(_0x37771d,null));};exports[_0x7903('0x47')]=function(_0x3ccb36,_0x3dd068){var _0x5aa81c={'raw':!![],'where':{'id':_0x3ccb36[_0x7903('0x48')]['id']}},_0x5f591c={};_0x5f591c[_0x7903('0x35')]=_['keys'](db[_0x7903('0x42')][_0x7903('0x2d')]);_0x5f591c['query']=_['keys'](_0x3ccb36['query']);_0x5f591c[_0x7903('0x33')]=_[_0x7903('0x34')](_0x5f591c[_0x7903('0x35')],_0x5f591c[_0x7903('0x32')]);_0x5aa81c[_0x7903('0x37')]=_[_0x7903('0x34')](_0x5f591c[_0x7903('0x35')],qs['fields'](_0x3ccb36['query'][_0x7903('0x36')]));_0x5aa81c[_0x7903('0x37')]=_0x5aa81c[_0x7903('0x37')][_0x7903('0x38')]?_0x5aa81c['attributes']:_0x5f591c[_0x7903('0x35')];if(_0x3ccb36[_0x7903('0x32')][_0x7903('0x43')]){_0x5aa81c[_0x7903('0x49')]=[{'all':!![]}];}_0x5aa81c=_[_0x7903('0x40')]({},_0x5aa81c,_0x3ccb36['options']);return db[_0x7903('0x42')]['find'](_0x5aa81c)[_0x7903('0x27')](handleEntityNotFound(_0x3dd068,null))[_0x7903('0x27')](respondWithResult(_0x3dd068,null))['catch'](handleError(_0x3dd068,null));};exports[_0x7903('0x4a')]=function(_0x13a495,_0xf7293b){return db[_0x7903('0x42')][_0x7903('0x4a')](_0x13a495['body'],{})[_0x7903('0x27')](respondWithResult(_0xf7293b,0xc9))[_0x7903('0x46')](handleError(_0xf7293b,null));};exports['update']=function(_0x40a476,_0x2b7192){if(_0x40a476[_0x7903('0x4b')]['id']){delete _0x40a476[_0x7903('0x4b')]['id'];}return db['ZohoField'][_0x7903('0x4c')]({'where':{'id':_0x40a476[_0x7903('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b7192,null))[_0x7903('0x27')](saveUpdates(_0x40a476['body'],null))[_0x7903('0x27')](respondWithResult(_0x2b7192,null))[_0x7903('0x46')](handleError(_0x2b7192,null));};exports[_0x7903('0x28')]=function(_0x4f9aa5,_0x449962){return db[_0x7903('0x42')]['find']({'where':{'id':_0x4f9aa5['params']['id']}})['then'](handleEntityNotFound(_0x449962,null))[_0x7903('0x27')](removeEntity(_0x449962,null))[_0x7903('0x46')](handleError(_0x449962,null));}; \ No newline at end of file +var _0x676c=['sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','update','destroy','then','error','stack','name','index','map','ZohoField','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc676('0x0'));var rimraf=require(_0xc676('0x1'));var zipdir=require(_0xc676('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc676('0x3'));var moment=require(_0xc676('0x4'));var BPromise=require(_0xc676('0x5'));var Mustache=require(_0xc676('0x6'));var util=require(_0xc676('0x7'));var path=require(_0xc676('0x8'));var sox=require('sox');var csv=require(_0xc676('0x9'));var ejs=require(_0xc676('0xa'));var fs=require('fs');var fs_extra=require(_0xc676('0xb'));var _=require(_0xc676('0xc'));var squel=require(_0xc676('0xd'));var crypto=require('crypto');var jsforce=require(_0xc676('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc676('0xf'));var Papa=require(_0xc676('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc676('0x11'));var as=require(_0xc676('0x12'));var hardwareService=require(_0xc676('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc676('0x14'));var config=require(_0xc676('0x15'));var licenseUtil=require(_0xc676('0x16'));var db=require(_0xc676('0x17'))['db'];function respondWithStatusCode(_0x5e8565,_0xc15629){_0xc15629=_0xc15629||0xcc;return function(_0xfb2c57){if(_0xfb2c57){return _0x5e8565[_0xc676('0x18')](_0xc15629);}return _0x5e8565[_0xc676('0x19')](_0xc15629)[_0xc676('0x1a')]();};}function respondWithResult(_0xcee1c5,_0xa07c6d){_0xa07c6d=_0xa07c6d||0xc8;return function(_0x4f8832){if(_0x4f8832){return _0xcee1c5[_0xc676('0x19')](_0xa07c6d)['json'](_0x4f8832);}};}function respondWithFilteredResult(_0x59deda,_0x2ea1e0){return function(_0x4e0f49){if(_0x4e0f49){var _0x51e6d4=typeof _0x2ea1e0['offset']===_0xc676('0x1b')&&typeof _0x2ea1e0['limit']===_0xc676('0x1b');var _0x1468bc=_0x4e0f49[_0xc676('0x1c')];var _0x3b3215=_0x51e6d4?0x0:_0x2ea1e0[_0xc676('0x1d')];var _0x215ea6=_0x51e6d4?_0x4e0f49['count']:_0x2ea1e0[_0xc676('0x1d')]+_0x2ea1e0[_0xc676('0x1e')];var _0x4fe489;if(_0x215ea6>=_0x1468bc){_0x215ea6=_0x1468bc;_0x4fe489=0xc8;}else{_0x4fe489=0xce;}_0x59deda[_0xc676('0x19')](_0x4fe489);return _0x59deda[_0xc676('0x1f')](_0xc676('0x20'),_0x3b3215+'-'+_0x215ea6+'/'+_0x1468bc)[_0xc676('0x21')](_0x4e0f49);}return null;};}function patchUpdates(_0x26a00b){return function(_0x87b27d){try{jsonpatch[_0xc676('0x22')](_0x87b27d,_0x26a00b,!![]);}catch(_0xc533a9){return BPromise['reject'](_0xc533a9);}return _0x87b27d['save']();};}function saveUpdates(_0x502e6f,_0x399461){return function(_0x5ca0a2){if(_0x5ca0a2){return _0x5ca0a2[_0xc676('0x23')](_0x502e6f)['then'](function(_0x54389a){return _0x54389a;});}return null;};}function removeEntity(_0x3b55c5,_0x575de4){return function(_0x113ec5){if(_0x113ec5){return _0x113ec5[_0xc676('0x24')]()[_0xc676('0x25')](function(){_0x3b55c5[_0xc676('0x19')](0xcc)[_0xc676('0x1a')]();});}};}function handleEntityNotFound(_0x4ca666,_0x187960){return function(_0x24f330){if(!_0x24f330){_0x4ca666[_0xc676('0x18')](0x194);}return _0x24f330;};}function handleError(_0x56215c,_0x36bd5b){_0x36bd5b=_0x36bd5b||0x1f4;return function(_0x4b61aa){logger[_0xc676('0x26')](_0x4b61aa[_0xc676('0x27')]);if(_0x4b61aa['name']){delete _0x4b61aa[_0xc676('0x28')];}_0x56215c[_0xc676('0x19')](_0x36bd5b)['send'](_0x4b61aa);};}exports[_0xc676('0x29')]=function(_0x230b36,_0x32056c){var _0x4e4834={},_0x278ccc={},_0x2d521d={'count':0x0,'rows':[]};var _0x181e3d=_[_0xc676('0x2a')](db[_0xc676('0x2b')]['rawAttributes'],function(_0x1bd277){return{'name':_0x1bd277[_0xc676('0x2c')],'type':_0x1bd277[_0xc676('0x2d')][_0xc676('0x2e')]};});_0x278ccc[_0xc676('0x2f')]=_['map'](_0x181e3d,_0xc676('0x28'));_0x278ccc[_0xc676('0x30')]=_[_0xc676('0x31')](_0x230b36[_0xc676('0x30')]);_0x278ccc['filters']=_[_0xc676('0x32')](_0x278ccc[_0xc676('0x2f')],_0x278ccc[_0xc676('0x30')]);_0x4e4834[_0xc676('0x33')]=_[_0xc676('0x32')](_0x278ccc[_0xc676('0x2f')],qs[_0xc676('0x34')](_0x230b36[_0xc676('0x30')][_0xc676('0x34')]));_0x4e4834['attributes']=_0x4e4834['attributes']['length']?_0x4e4834[_0xc676('0x33')]:_0x278ccc[_0xc676('0x2f')];if(!_0x230b36[_0xc676('0x30')][_0xc676('0x35')]('nolimit')){_0x4e4834[_0xc676('0x1e')]=qs[_0xc676('0x1e')](_0x230b36[_0xc676('0x30')][_0xc676('0x1e')]);_0x4e4834[_0xc676('0x1d')]=qs[_0xc676('0x1d')](_0x230b36['query']['offset']);}_0x4e4834[_0xc676('0x36')]=qs['sort'](_0x230b36[_0xc676('0x30')][_0xc676('0x37')]);_0x4e4834[_0xc676('0x38')]=qs[_0xc676('0x39')](_['pick'](_0x230b36['query'],_0x278ccc['filters']),_0x181e3d);if(_0x230b36[_0xc676('0x30')][_0xc676('0x3a')]){_0x4e4834[_0xc676('0x38')]=_[_0xc676('0x3b')](_0x4e4834[_0xc676('0x38')],{'$or':_[_0xc676('0x2a')](_0x181e3d,function(_0x30148a){if(_0x30148a[_0xc676('0x2d')]!==_0xc676('0x3c')){var _0x45fad7={};_0x45fad7[_0x30148a[_0xc676('0x28')]]={'$like':'%'+_0x230b36[_0xc676('0x30')][_0xc676('0x3a')]+'%'};return _0x45fad7;}})});}_0x4e4834=_[_0xc676('0x3b')]({},_0x4e4834,_0x230b36[_0xc676('0x3d')]);var _0x2cba1a={'where':_0x4e4834[_0xc676('0x38')]};return db['ZohoField'][_0xc676('0x1c')](_0x2cba1a)[_0xc676('0x25')](function(_0x2020d7){_0x2d521d['count']=_0x2020d7;if(_0x230b36[_0xc676('0x30')][_0xc676('0x3e')]){_0x4e4834[_0xc676('0x3f')]=[{'all':!![]}];}return db[_0xc676('0x2b')][_0xc676('0x40')](_0x4e4834);})[_0xc676('0x25')](function(_0x18bd1a){_0x2d521d['rows']=_0x18bd1a;return _0x2d521d;})[_0xc676('0x25')](respondWithFilteredResult(_0x32056c,_0x4e4834))['catch'](handleError(_0x32056c,null));};exports[_0xc676('0x41')]=function(_0x1e7bb5,_0x5dcfd8){var _0x3fc05b={'raw':!![],'where':{'id':_0x1e7bb5[_0xc676('0x42')]['id']}},_0x3869f6={};_0x3869f6[_0xc676('0x2f')]=_[_0xc676('0x31')](db['ZohoField'][_0xc676('0x43')]);_0x3869f6[_0xc676('0x30')]=_[_0xc676('0x31')](_0x1e7bb5['query']);_0x3869f6[_0xc676('0x39')]=_[_0xc676('0x32')](_0x3869f6[_0xc676('0x2f')],_0x3869f6[_0xc676('0x30')]);_0x3fc05b['attributes']=_[_0xc676('0x32')](_0x3869f6['model'],qs[_0xc676('0x34')](_0x1e7bb5[_0xc676('0x30')][_0xc676('0x34')]));_0x3fc05b['attributes']=_0x3fc05b[_0xc676('0x33')]['length']?_0x3fc05b['attributes']:_0x3869f6[_0xc676('0x2f')];if(_0x1e7bb5['query'][_0xc676('0x3e')]){_0x3fc05b['include']=[{'all':!![]}];}_0x3fc05b=_['merge']({},_0x3fc05b,_0x1e7bb5[_0xc676('0x3d')]);return db['ZohoField'][_0xc676('0x44')](_0x3fc05b)['then'](handleEntityNotFound(_0x5dcfd8,null))[_0xc676('0x25')](respondWithResult(_0x5dcfd8,null))[_0xc676('0x45')](handleError(_0x5dcfd8,null));};exports[_0xc676('0x46')]=function(_0xf2d3a0,_0x4d8d1d){return db['ZohoField'][_0xc676('0x46')](_0xf2d3a0[_0xc676('0x47')],{})['then'](respondWithResult(_0x4d8d1d,0xc9))[_0xc676('0x45')](handleError(_0x4d8d1d,null));};exports[_0xc676('0x23')]=function(_0x59be1a,_0x38d1bc){if(_0x59be1a[_0xc676('0x47')]['id']){delete _0x59be1a[_0xc676('0x47')]['id'];}return db[_0xc676('0x2b')][_0xc676('0x44')]({'where':{'id':_0x59be1a['params']['id']}})[_0xc676('0x25')](handleEntityNotFound(_0x38d1bc,null))[_0xc676('0x25')](saveUpdates(_0x59be1a['body'],null))[_0xc676('0x25')](respondWithResult(_0x38d1bc,null))[_0xc676('0x45')](handleError(_0x38d1bc,null));};exports[_0xc676('0x24')]=function(_0x238ebf,_0x5c643e){return db[_0xc676('0x2b')][_0xc676('0x44')]({'where':{'id':_0x238ebf[_0xc676('0x42')]['id']}})[_0xc676('0x25')](handleEntityNotFound(_0x5c643e,null))['then'](removeEntity(_0x5c643e,null))[_0xc676('0x45')](handleError(_0x5c643e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 86f6dcc..2cd36c3 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9536=['zoho_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x9536,0x179));var _0x6953=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x9536[_0x35f7f5];return _0x5567a4;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['idField',_0x6953('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x5e8584,_0xab5d1f){var _0x500b5a=function(_0x5b4223){while(--_0x5b4223){_0x5e8584['push'](_0x5e8584['shift']());}};_0x500b5a(++_0xab5d1f);}(_0x82c4,0x1ca));var _0x482c=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x82c4[_0x5eb22e];return _0x27fed5;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 6ccb028..d0804d3 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd013=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','bluebird'];(function(_0x4b9163,_0x3f717b){var _0x5e4cfd=function(_0x139831){while(--_0x139831){_0x4b9163['push'](_0x4b9163['shift']());}};_0x5e4cfd(++_0x3f717b);}(_0xd013,0x1c9));var _0x3d01=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xd013[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require(_0x3d01('0x0'));var util=require(_0x3d01('0x1'));var moment=require('moment');var BPromise=require(_0x3d01('0x2'));var rs=require(_0x3d01('0x3'));var fs=require('fs');var Redis=require(_0x3d01('0x4'));var db=require(_0x3d01('0x5'))['db'];var utils=require(_0x3d01('0x6'));var logger=require(_0x3d01('0x7'))(_0x3d01('0x8'));var config=require(_0x3d01('0x9'));var jayson=require(_0x3d01('0xa'));var client=jayson[_0x3d01('0xb')][_0x3d01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fb06e,_0x334c63,_0x1d006b){return new BPromise(function(_0x262d21,_0x9f22cf){return client[_0x3d01('0xd')](_0x2fb06e,_0x1d006b)[_0x3d01('0xe')](function(_0x464877){logger[_0x3d01('0xf')]('ZohoField,\x20%s,\x20%s',_0x334c63,_0x3d01('0x10'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x334c63,_0x3d01('0x10'),JSON[_0x3d01('0x11')](_0x464877));if(_0x464877[_0x3d01('0x12')]){if(_0x464877['error'][_0x3d01('0x13')]===0x1f4){logger[_0x3d01('0x12')](_0x3d01('0x14'),_0x334c63,_0x464877[_0x3d01('0x12')][_0x3d01('0x15')]);return _0x9f22cf(_0x464877[_0x3d01('0x12')][_0x3d01('0x15')]);}logger[_0x3d01('0x12')](_0x3d01('0x14'),_0x334c63,_0x464877[_0x3d01('0x12')][_0x3d01('0x15')]);return _0x262d21(_0x464877['error'][_0x3d01('0x15')]);}else{logger['info'](_0x3d01('0x14'),_0x334c63,_0x3d01('0x10'));_0x262d21(_0x464877['result'][_0x3d01('0x15')]);}})[_0x3d01('0x16')](function(_0x74b1f8){logger[_0x3d01('0x12')](_0x3d01('0x14'),_0x334c63,_0x74b1f8);_0x9f22cf(_0x74b1f8);});});} \ No newline at end of file +var _0x547f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x1cbc8c,_0x4732df){var _0x42ad78=function(_0x1fd8e4){while(--_0x1fd8e4){_0x1cbc8c['push'](_0x1cbc8c['shift']());}};_0x42ad78(++_0x4732df);}(_0x547f,0x76));var _0xf547=function(_0x1a2882,_0x406f86){_0x1a2882=_0x1a2882-0x0;var _0x1d41fe=_0x547f[_0x1a2882];return _0x1d41fe;};'use strict';var _=require(_0xf547('0x0'));var util=require(_0xf547('0x1'));var moment=require(_0xf547('0x2'));var BPromise=require(_0xf547('0x3'));var rs=require(_0xf547('0x4'));var fs=require('fs');var Redis=require(_0xf547('0x5'));var db=require(_0xf547('0x6'))['db'];var utils=require(_0xf547('0x7'));var logger=require(_0xf547('0x8'))(_0xf547('0x9'));var config=require(_0xf547('0xa'));var jayson=require(_0xf547('0xb'));var client=jayson[_0xf547('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf13e7b,_0x208730,_0x5b8594){return new BPromise(function(_0x57bca6,_0x3600d2){return client[_0xf547('0xd')](_0xf13e7b,_0x5b8594)['then'](function(_0x5bd65a){logger['info']('ZohoField,\x20%s,\x20%s',_0x208730,_0xf547('0xe'));logger[_0xf547('0xf')](_0xf547('0x10'),_0x208730,'request\x20sent',JSON[_0xf547('0x11')](_0x5bd65a));if(_0x5bd65a[_0xf547('0x12')]){if(_0x5bd65a[_0xf547('0x12')]['code']===0x1f4){logger[_0xf547('0x12')](_0xf547('0x13'),_0x208730,_0x5bd65a[_0xf547('0x12')]['message']);return _0x3600d2(_0x5bd65a['error']['message']);}logger[_0xf547('0x12')](_0xf547('0x13'),_0x208730,_0x5bd65a[_0xf547('0x12')][_0xf547('0x14')]);return _0x57bca6(_0x5bd65a[_0xf547('0x12')]['message']);}else{logger[_0xf547('0x15')](_0xf547('0x13'),_0x208730,'request\x20sent');_0x57bca6(_0x5bd65a[_0xf547('0x16')][_0xf547('0x14')]);}})[_0xf547('0x17')](function(_0x278cda){logger[_0xf547('0x12')](_0xf547('0x13'),_0x208730,_0x278cda);_0x3600d2(_0x278cda);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 367a05a..4a1ad3e 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x44b694,_0x195b96){var _0x3fd117=function(_0x3bd3db){while(--_0x3bd3db){_0x44b694['push'](_0x44b694['shift']());}};_0x3fd117(++_0x195b96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 6d03296..70946ef 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa39b=['state','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x2d90a0,_0xeabaf2){var _0x4a023a=function(_0x3718e1){while(--_0x3718e1){_0x2d90a0['push'](_0x2d90a0['shift']());}};_0x4a023a(++_0xeabaf2);}(_0xa39b,0x199));var _0xba39=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa39b[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xba39('0x0')]={'name':{'type':Sequelize[_0xba39('0x1')],'allowNull':![],'unique':_0xba39('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xba39('0x1')]},'path':{'type':Sequelize[_0xba39('0x1')]},'type':{'type':Sequelize[_0xba39('0x1')]},'size':{'type':Sequelize[_0xba39('0x3')]},'active':{'type':Sequelize[_0xba39('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xba39('0x1')]},'state':{'type':Sequelize[_0xba39('0x1')],'unique':_0xba39('0x5')},'description':{'type':Sequelize[_0xba39('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xba39('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb99b=['state','sequelize','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x4cbc98,_0x1d69f2){var _0x11be76=function(_0xb50325){while(--_0xb50325){_0x4cbc98['push'](_0x4cbc98['shift']());}};_0x11be76(++_0x1d69f2);}(_0xb99b,0xa9));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbb99('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb99('0x1')],'allowNull':![],'unique':_0xbb99('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb99('0x2')},'main':{'type':Sequelize[_0xbb99('0x1')],'defaultValue':_0xbb99('0x3')},'filename':{'type':Sequelize[_0xbb99('0x1')]},'path':{'type':Sequelize[_0xbb99('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xbb99('0x4')]},'active':{'type':Sequelize[_0xbb99('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xbb99('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xbb99('0x6')},'description':{'type':Sequelize[_0xbb99('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbb99('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 452cff7..bf93dce 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5c6272,_0xd82df5){var _0x19c236=function(_0x332352){while(--_0x332352){_0x5c6272['push'](_0x5c6272['shift']());}};_0x19c236(++_0xd82df5);}(_0x2542,0x169));var _0x2254=function(_0x18ee55,_0x159595){_0x18ee55=_0x18ee55-0x0;var _0x40c45e=_0x2542[_0x18ee55];return _0x40c45e;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file +var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0x4f3cd1,_0x4b666e){var _0x4f304d=function(_0x5691ad){while(--_0x5691ad){_0x4f3cd1['push'](_0x4f3cd1['shift']());}};_0x4f304d(++_0x4b666e);}(_0xf61e,0x191));var _0xef61=function(_0xf2799c,_0x70b040){_0xf2799c=_0xf2799c-0x0;var _0x57bde6=_0xf61e[_0xf2799c];return _0x57bde6;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['Integration']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['Integration'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 3d0e885..9294b62 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b40=['api','moment','bluebird','request-promise','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x7b40,0xa6));var _0x07b4=function(_0x568ca4,_0x2a5ba3){_0x568ca4=_0x568ca4-0x0;var _0x2562a0=_0x7b40[_0x568ca4];return _0x2562a0;};'use strict';var _=require(_0x07b4('0x0'));var util=require('util');var logger=require(_0x07b4('0x1'))(_0x07b4('0x2'));var moment=require(_0x07b4('0x3'));var BPromise=require(_0x07b4('0x4'));var rp=require(_0x07b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07b4('0x6'));var config=require('../../config/environment');var attributes=require(_0x07b4('0x7'));module[_0x07b4('0x8')]=function(_0x2ab70d,_0x471e9e){return _0x2ab70d[_0x07b4('0x9')](_0x07b4('0xa'),attributes,{'tableName':_0x07b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x111d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','Integration','integrations','lodash','util'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x111d,0xf0));var _0xd111=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x111d[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xd111('0x0'));var util=require(_0xd111('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd111('0x2'));var BPromise=require(_0xd111('0x3'));var rp=require(_0xd111('0x4'));var fs=require('fs');var path=require(_0xd111('0x5'));var rimraf=require(_0xd111('0x6'));var config=require(_0xd111('0x7'));var attributes=require(_0xd111('0x8'));module['exports']=function(_0x51ba01,_0x4e69f6){return _0x51ba01['define'](_0xd111('0x9'),attributes,{'tableName':_0xd111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 9f06b13..b66e56c 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2d31bf,_0x85016e){var _0x2dce9d=function(_0x44501b){while(--_0x44501b){_0x2d31bf['push'](_0x2d31bf['shift']());}};_0x2dce9d(++_0x85016e);}(_0x5f2f,0x73));var _0xf5f2=function(_0xab800b,_0x1d70cd){_0xab800b=_0xab800b-0x0;var _0x1cfb63=_0x5f2f[_0xab800b];return _0x1cfb63;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x4975,0x86));var _0x5497=function(_0x435087,_0x84d866){_0x435087=_0x435087-0x0;var _0x1ccc5c=_0x4975[_0x435087];return _0x1ccc5c;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 57f14c8..7e6e988 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x173aba,_0x17853f){var _0x3b11c8=function(_0x26a61e){while(--_0x26a61e){_0x173aba['push'](_0x173aba['shift']());}};_0x3b11c8(++_0x17853f);}(_0x7880,0x1f4));var _0x0788=function(_0xadbaeb,_0x13c8c9){_0xadbaeb=_0xadbaeb-0x0;var _0x3bb7f2=_0x7880[_0xadbaeb];return _0x3bb7f2;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x3ee198,_0x5d0a40){var _0x88b6c2=function(_0x1a291c){while(--_0x1a291c){_0x3ee198['push'](_0x3ee198['shift']());}};_0x88b6c2(++_0x5d0a40);}(_0x524e,0x15e));var _0xe524=function(_0x543be5,_0x20f866){_0x543be5=_0x543be5-0x0;var _0x5e3d29=_0x524e[_0x543be5];return _0x5e3d29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index be15e0b..14f22bf 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcebb=['FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x4f57ad,_0x4e456b){var _0x1c7afe=function(_0x3e827f){while(--_0x3e827f){_0x4f57ad['push'](_0x4f57ad['shift']());}};_0x1c7afe(++_0x4e456b);}(_0xcebb,0xc9));var _0xbceb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcebb[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xbceb('0x0'));module['exports']={'integration':{'type':Sequelize[_0xbceb('0x1')]},'eventChannel':{'type':Sequelize[_0xbceb('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xbceb('0x1')]},'integrationId':{'type':Sequelize[_0xbceb('0x2')]},'contacts':{'type':Sequelize[_0xbceb('0x1')]},'uniqueid':{'type':Sequelize[_0xbceb('0x1')]},'calleridnum':{'type':Sequelize[_0xbceb('0x1')]},'calleridname':{'type':Sequelize[_0xbceb('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbceb('0x1')]},'membername':{'type':Sequelize[_0xbceb('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbceb('0x3')]},'agentconnectAt':{'type':Sequelize[_0xbceb('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xbceb('0x3')]},'talktime':{'type':Sequelize[_0xbceb('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xbceb('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xbceb('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbceb('0x3')]},'agentdump':{'type':Sequelize[_0xbceb('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbceb('0x3')]},'lastevent':{'type':Sequelize[_0xbceb('0x1')]},'channel':{'type':Sequelize[_0xbceb('0x1')]},'channelstate':{'type':Sequelize[_0xbceb('0x2')]},'channelstatedesc':{'type':Sequelize[_0xbceb('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbceb('0x1')]},'connectedlinename':{'type':Sequelize[_0xbceb('0x1')]},'language':{'type':Sequelize[_0xbceb('0x1')]},'accountcode':{'type':Sequelize[_0xbceb('0x1')]},'context':{'type':Sequelize[_0xbceb('0x1')]},'exten':{'type':Sequelize[_0xbceb('0x1')]},'priority':{'type':Sequelize[_0xbceb('0x1')]},'destchannel':{'type':Sequelize[_0xbceb('0x1')]},'destchannelstate':{'type':Sequelize[_0xbceb('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xbceb('0x1')]},'destcalleridnum':{'type':Sequelize[_0xbceb('0x1')]},'destcalleridname':{'type':Sequelize[_0xbceb('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbceb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xbceb('0x1')]},'destlanguage':{'type':Sequelize[_0xbceb('0x1')]},'destaccountcode':{'type':Sequelize[_0xbceb('0x1')]},'destcontext':{'type':Sequelize[_0xbceb('0x1')]},'destexten':{'type':Sequelize[_0xbceb('0x1')]},'destpriority':{'type':Sequelize[_0xbceb('0x1')]},'destuniqueid':{'type':Sequelize[_0xbceb('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xbceb('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xbceb('0x1')]},'to':{'type':Sequelize[_0xbceb('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xbceb('0x5')]},'html':{'type':Sequelize[_0xbceb('0x5')]},'text':{'type':Sequelize[_0xbceb('0x5')]},'status':{'type':Sequelize[_0xbceb('0x6')](_0xbceb('0x7'),_0xbceb('0x8'),'RECEIVED',_0xbceb('0x9'))},'url':{'type':Sequelize[_0xbceb('0x1')]},'app':{'type':Sequelize[_0xbceb('0x1')]},'appdata':{'type':Sequelize[_0xbceb('0x1')]},'projectId':{'type':Sequelize[_0xbceb('0x2')]}}; \ No newline at end of file +var _0x3225=['BOOLEAN','INTEGER','TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING','DATE'];(function(_0x552fb8,_0x4ed24b){var _0x2a741a=function(_0x15b7a1){while(--_0x15b7a1){_0x552fb8['push'](_0x552fb8['shift']());}};_0x2a741a(++_0x4ed24b);}(_0x3225,0x150));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5322('0x0'));module[_0x5322('0x1')]={'integration':{'type':Sequelize[_0x5322('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x5322('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x5322('0x2')]},'uniqueid':{'type':Sequelize[_0x5322('0x2')]},'calleridnum':{'type':Sequelize[_0x5322('0x2')]},'calleridname':{'type':Sequelize[_0x5322('0x2')]},'queue':{'type':Sequelize[_0x5322('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x5322('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5322('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5322('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x5322('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x5322('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5322('0x3')]},'agentdump':{'type':Sequelize[_0x5322('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5322('0x3')]},'lastevent':{'type':Sequelize[_0x5322('0x2')]},'channel':{'type':Sequelize[_0x5322('0x2')]},'channelstate':{'type':Sequelize[_0x5322('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5322('0x2')]},'connectedlinename':{'type':Sequelize[_0x5322('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5322('0x2')]},'priority':{'type':Sequelize[_0x5322('0x2')]},'destchannel':{'type':Sequelize[_0x5322('0x2')]},'destchannelstate':{'type':Sequelize[_0x5322('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5322('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5322('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5322('0x2')]},'destaccountcode':{'type':Sequelize[_0x5322('0x2')]},'destcontext':{'type':Sequelize[_0x5322('0x2')]},'destexten':{'type':Sequelize[_0x5322('0x2')]},'destpriority':{'type':Sequelize[_0x5322('0x2')]},'destuniqueid':{'type':Sequelize[_0x5322('0x2')]},'messageId':{'type':Sequelize[_0x5322('0x2')]},'inReplyTo':{'type':Sequelize[_0x5322('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x5322('0x2')]},'to':{'type':Sequelize[_0x5322('0x2')]},'cc':{'type':Sequelize[_0x5322('0x2')]},'attachment':{'type':Sequelize[_0x5322('0x6')]},'html':{'type':Sequelize[_0x5322('0x6')]},'text':{'type':Sequelize[_0x5322('0x6')]},'status':{'type':Sequelize[_0x5322('0x7')](_0x5322('0x8'),'SENDING','RECEIVED',_0x5322('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5322('0x2')]},'appdata':{'type':Sequelize[_0x5322('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 09c7b94..f5212f2 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ab4=['set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','options','find','create','body','destroy','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x207121,_0x5a635e){var _0x441054=function(_0x4a73b3){while(--_0x4a73b3){_0x207121['push'](_0x207121['shift']());}};_0x441054(++_0x5a635e);}(_0x5ab4,0xc5));var _0x45ab=function(_0x223f5d,_0x4bda4f){_0x223f5d=_0x223f5d-0x0;var _0x58e484=_0x5ab4[_0x223f5d];return _0x58e484;};'use strict';var emlformat=require(_0x45ab('0x0'));var rimraf=require(_0x45ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x45ab('0x2'));var moment=require(_0x45ab('0x3'));var BPromise=require(_0x45ab('0x4'));var Mustache=require(_0x45ab('0x5'));var util=require(_0x45ab('0x6'));var path=require(_0x45ab('0x7'));var sox=require(_0x45ab('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45ab('0x9'));var squel=require(_0x45ab('0xa'));var crypto=require(_0x45ab('0xb'));var jsforce=require(_0x45ab('0xc'));var deskjs=require(_0x45ab('0xd'));var toCsv=require(_0x45ab('0xe'));var querystring=require(_0x45ab('0xf'));var Papa=require(_0x45ab('0x10'));var Redis=require(_0x45ab('0x11'));var authService=require(_0x45ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x45ab('0x13'));var hardwareService=require(_0x45ab('0x14'));var logger=require('../../config/logger')(_0x45ab('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45ab('0x16'));var db=require(_0x45ab('0x17'))['db'];function respondWithStatusCode(_0x43a6bd,_0x1004bd){_0x1004bd=_0x1004bd||0xcc;return function(_0x56d899){if(_0x56d899){return _0x43a6bd[_0x45ab('0x18')](_0x1004bd);}return _0x43a6bd[_0x45ab('0x19')](_0x1004bd)['end']();};}function respondWithResult(_0x210286,_0x3823ad){_0x3823ad=_0x3823ad||0xc8;return function(_0x52191c){if(_0x52191c){return _0x210286['status'](_0x3823ad)[_0x45ab('0x1a')](_0x52191c);}};}function respondWithFilteredResult(_0x376fc2,_0x1844f4){return function(_0x2fe7d7){if(_0x2fe7d7){var _0x55186d=typeof _0x1844f4[_0x45ab('0x1b')]==='undefined'&&typeof _0x1844f4[_0x45ab('0x1c')]===_0x45ab('0x1d');var _0x138b30=_0x2fe7d7[_0x45ab('0x1e')];var _0x164279=_0x55186d?0x0:_0x1844f4[_0x45ab('0x1b')];var _0x3d3555=_0x55186d?_0x2fe7d7[_0x45ab('0x1e')]:_0x1844f4[_0x45ab('0x1b')]+_0x1844f4[_0x45ab('0x1c')];var _0x154e83;if(_0x3d3555>=_0x138b30){_0x3d3555=_0x138b30;_0x154e83=0xc8;}else{_0x154e83=0xce;}_0x376fc2[_0x45ab('0x19')](_0x154e83);return _0x376fc2[_0x45ab('0x1f')](_0x45ab('0x20'),_0x164279+'-'+_0x3d3555+'/'+_0x138b30)[_0x45ab('0x1a')](_0x2fe7d7);}return null;};}function patchUpdates(_0x953789){return function(_0x5daae4){try{jsonpatch[_0x45ab('0x21')](_0x5daae4,_0x953789,!![]);}catch(_0x3fbab8){return BPromise[_0x45ab('0x22')](_0x3fbab8);}return _0x5daae4[_0x45ab('0x23')]();};}function saveUpdates(_0x60df61,_0x470023){return function(_0x378680){if(_0x378680){return _0x378680[_0x45ab('0x24')](_0x60df61)['then'](function(_0x31555d){return _0x31555d;});}return null;};}function removeEntity(_0x73d067,_0x369960){return function(_0x566c8d){if(_0x566c8d){return _0x566c8d['destroy']()[_0x45ab('0x25')](function(){_0x73d067['status'](0xcc)[_0x45ab('0x26')]();});}};}function handleEntityNotFound(_0x3eecf9,_0x49ed80){return function(_0x518826){if(!_0x518826){_0x3eecf9[_0x45ab('0x18')](0x194);}return _0x518826;};}function handleError(_0x34f70a,_0x88e3d0){_0x88e3d0=_0x88e3d0||0x1f4;return function(_0x472a21){logger[_0x45ab('0x27')](_0x472a21[_0x45ab('0x28')]);if(_0x472a21[_0x45ab('0x29')]){delete _0x472a21[_0x45ab('0x29')];}_0x34f70a[_0x45ab('0x19')](_0x88e3d0)['send'](_0x472a21);};}exports[_0x45ab('0x2a')]=function(_0x147a41,_0x69910c){var _0x419419={},_0x5cb4c9={},_0x59f60d={'count':0x0,'rows':[]};var _0x39ff44=_[_0x45ab('0x2b')](db[_0x45ab('0x2c')][_0x45ab('0x2d')],function(_0x1511f5){return{'name':_0x1511f5[_0x45ab('0x2e')],'type':_0x1511f5[_0x45ab('0x2f')][_0x45ab('0x30')]};});_0x5cb4c9[_0x45ab('0x31')]=_['map'](_0x39ff44,_0x45ab('0x29'));_0x5cb4c9[_0x45ab('0x32')]=_[_0x45ab('0x33')](_0x147a41[_0x45ab('0x32')]);_0x5cb4c9[_0x45ab('0x34')]=_[_0x45ab('0x35')](_0x5cb4c9[_0x45ab('0x31')],_0x5cb4c9[_0x45ab('0x32')]);_0x419419[_0x45ab('0x36')]=_[_0x45ab('0x35')](_0x5cb4c9[_0x45ab('0x31')],qs['fields'](_0x147a41[_0x45ab('0x32')][_0x45ab('0x37')]));_0x419419[_0x45ab('0x36')]=_0x419419[_0x45ab('0x36')][_0x45ab('0x38')]?_0x419419[_0x45ab('0x36')]:_0x5cb4c9[_0x45ab('0x31')];if(!_0x147a41[_0x45ab('0x32')][_0x45ab('0x39')]('nolimit')){_0x419419[_0x45ab('0x1c')]=qs['limit'](_0x147a41['query'][_0x45ab('0x1c')]);_0x419419[_0x45ab('0x1b')]=qs[_0x45ab('0x1b')](_0x147a41[_0x45ab('0x32')][_0x45ab('0x1b')]);}_0x419419[_0x45ab('0x3a')]=qs[_0x45ab('0x3b')](_0x147a41[_0x45ab('0x32')][_0x45ab('0x3b')]);_0x419419[_0x45ab('0x3c')]=qs[_0x45ab('0x34')](_[_0x45ab('0x3d')](_0x147a41[_0x45ab('0x32')],_0x5cb4c9[_0x45ab('0x34')]),_0x39ff44);if(_0x147a41['query']['filter']){_0x419419['where']=_[_0x45ab('0x3e')](_0x419419[_0x45ab('0x3c')],{'$or':_[_0x45ab('0x2b')](_0x39ff44,function(_0x4ae4b8){if(_0x4ae4b8[_0x45ab('0x2f')]!==_0x45ab('0x3f')){var _0x1cab8e={};_0x1cab8e[_0x4ae4b8['name']]={'$like':'%'+_0x147a41[_0x45ab('0x32')][_0x45ab('0x40')]+'%'};return _0x1cab8e;}})});}_0x419419=_[_0x45ab('0x3e')]({},_0x419419,_0x147a41['options']);var _0x5ce625={'where':_0x419419[_0x45ab('0x3c')]};return db[_0x45ab('0x2c')]['count'](_0x5ce625)[_0x45ab('0x25')](function(_0x3d3e8b){_0x59f60d[_0x45ab('0x1e')]=_0x3d3e8b;if(_0x147a41[_0x45ab('0x32')][_0x45ab('0x41')]){_0x419419[_0x45ab('0x42')]=[{'all':!![]}];}return db[_0x45ab('0x2c')][_0x45ab('0x43')](_0x419419);})[_0x45ab('0x25')](function(_0x3b7647){_0x59f60d['rows']=_0x3b7647;return _0x59f60d;})[_0x45ab('0x25')](respondWithFilteredResult(_0x69910c,_0x419419))[_0x45ab('0x44')](handleError(_0x69910c,null));};exports['show']=function(_0x4f3eb7,_0x3caa81){var _0xbb7a45={'raw':![],'where':{'id':_0x4f3eb7['params']['id']}},_0x43ca8e={};_0x43ca8e[_0x45ab('0x31')]=_[_0x45ab('0x33')](db['IntegrationReport'][_0x45ab('0x2d')]);_0x43ca8e[_0x45ab('0x32')]=_[_0x45ab('0x33')](_0x4f3eb7[_0x45ab('0x32')]);_0x43ca8e[_0x45ab('0x34')]=_[_0x45ab('0x35')](_0x43ca8e[_0x45ab('0x31')],_0x43ca8e[_0x45ab('0x32')]);_0xbb7a45[_0x45ab('0x36')]=_['intersection'](_0x43ca8e[_0x45ab('0x31')],qs[_0x45ab('0x37')](_0x4f3eb7[_0x45ab('0x32')][_0x45ab('0x37')]));_0xbb7a45['attributes']=_0xbb7a45['attributes'][_0x45ab('0x38')]?_0xbb7a45[_0x45ab('0x36')]:_0x43ca8e[_0x45ab('0x31')];if(_0x4f3eb7[_0x45ab('0x32')][_0x45ab('0x41')]){_0xbb7a45[_0x45ab('0x42')]=[{'all':!![]}];}_0xbb7a45=_['merge']({},_0xbb7a45,_0x4f3eb7[_0x45ab('0x45')]);return db[_0x45ab('0x2c')][_0x45ab('0x46')](_0xbb7a45)[_0x45ab('0x25')](handleEntityNotFound(_0x3caa81,null))[_0x45ab('0x25')](respondWithResult(_0x3caa81,null))[_0x45ab('0x44')](handleError(_0x3caa81,null));};exports[_0x45ab('0x47')]=function(_0x3fd068,_0x3a4940){return db[_0x45ab('0x2c')]['create'](_0x3fd068[_0x45ab('0x48')],{})['then'](respondWithResult(_0x3a4940,0xc9))[_0x45ab('0x44')](handleError(_0x3a4940,null));};exports[_0x45ab('0x24')]=function(_0x487880,_0x351de8){if(_0x487880[_0x45ab('0x48')]['id']){delete _0x487880[_0x45ab('0x48')]['id'];}return db[_0x45ab('0x2c')][_0x45ab('0x46')]({'where':{'id':_0x487880['params']['id']}})[_0x45ab('0x25')](handleEntityNotFound(_0x351de8,null))[_0x45ab('0x25')](saveUpdates(_0x487880[_0x45ab('0x48')],null))[_0x45ab('0x25')](respondWithResult(_0x351de8,null))[_0x45ab('0x44')](handleError(_0x351de8,null));};exports[_0x45ab('0x49')]=function(_0x5af57e,_0x28db49){return db[_0x45ab('0x2c')][_0x45ab('0x46')]({'where':{'id':_0x5af57e[_0x45ab('0x4a')]['id']}})[_0x45ab('0x25')](handleEntityNotFound(_0x28db49,null))['then'](removeEntity(_0x28db49,null))[_0x45ab('0x44')](handleError(_0x28db49,null));};exports['describe']=function(_0x515b3d,_0x9c845b){return db['IntegrationReport'][_0x45ab('0x4b')]()['then'](respondWithResult(_0x9c845b,null))[_0x45ab('0x44')](handleError(_0x9c845b,null));}; \ No newline at end of file +var _0xb431=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x5648f4,_0x458de2){var _0x3327ff=function(_0x2e942f){while(--_0x2e942f){_0x5648f4['push'](_0x5648f4['shift']());}};_0x3327ff(++_0x458de2);}(_0xb431,0x1c2));var _0x1b43=function(_0x1b79b9,_0x2c7588){_0x1b79b9=_0x1b79b9-0x0;var _0x308d1c=_0xb431[_0x1b79b9];return _0x308d1c;};'use strict';var emlformat=require(_0x1b43('0x0'));var rimraf=require(_0x1b43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b43('0x2'));var BPromise=require(_0x1b43('0x3'));var Mustache=require(_0x1b43('0x4'));var util=require(_0x1b43('0x5'));var path=require(_0x1b43('0x6'));var sox=require(_0x1b43('0x7'));var csv=require(_0x1b43('0x8'));var ejs=require(_0x1b43('0x9'));var fs=require('fs');var fs_extra=require(_0x1b43('0xa'));var _=require(_0x1b43('0xb'));var squel=require(_0x1b43('0xc'));var crypto=require(_0x1b43('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1b43('0xe'));var toCsv=require(_0x1b43('0x8'));var querystring=require(_0x1b43('0xf'));var Papa=require(_0x1b43('0x10'));var Redis=require(_0x1b43('0x11'));var authService=require(_0x1b43('0x12'));var qs=require(_0x1b43('0x13'));var as=require(_0x1b43('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b43('0x15'))('api');var utils=require(_0x1b43('0x16'));var config=require(_0x1b43('0x17'));var licenseUtil=require(_0x1b43('0x18'));var db=require(_0x1b43('0x19'))['db'];function respondWithStatusCode(_0x45f08a,_0x2d6ee1){_0x2d6ee1=_0x2d6ee1||0xcc;return function(_0xc66229){if(_0xc66229){return _0x45f08a[_0x1b43('0x1a')](_0x2d6ee1);}return _0x45f08a[_0x1b43('0x1b')](_0x2d6ee1)[_0x1b43('0x1c')]();};}function respondWithResult(_0xe28d1b,_0x4e4a02){_0x4e4a02=_0x4e4a02||0xc8;return function(_0x37b696){if(_0x37b696){return _0xe28d1b['status'](_0x4e4a02)[_0x1b43('0x1d')](_0x37b696);}};}function respondWithFilteredResult(_0x20ee77,_0x1fa6de){return function(_0x3efb9d){if(_0x3efb9d){var _0x4d5363=typeof _0x1fa6de['offset']==='undefined'&&typeof _0x1fa6de[_0x1b43('0x1e')]==='undefined';var _0x197b2c=_0x3efb9d[_0x1b43('0x1f')];var _0x28a9fa=_0x4d5363?0x0:_0x1fa6de[_0x1b43('0x20')];var _0x172215=_0x4d5363?_0x3efb9d[_0x1b43('0x1f')]:_0x1fa6de[_0x1b43('0x20')]+_0x1fa6de[_0x1b43('0x1e')];var _0x33bdbf;if(_0x172215>=_0x197b2c){_0x172215=_0x197b2c;_0x33bdbf=0xc8;}else{_0x33bdbf=0xce;}_0x20ee77['status'](_0x33bdbf);return _0x20ee77[_0x1b43('0x21')](_0x1b43('0x22'),_0x28a9fa+'-'+_0x172215+'/'+_0x197b2c)['json'](_0x3efb9d);}return null;};}function patchUpdates(_0x2d6489){return function(_0x6328db){try{jsonpatch[_0x1b43('0x23')](_0x6328db,_0x2d6489,!![]);}catch(_0x58a8a2){return BPromise[_0x1b43('0x24')](_0x58a8a2);}return _0x6328db['save']();};}function saveUpdates(_0x50ba33,_0x16df65){return function(_0x187996){if(_0x187996){return _0x187996[_0x1b43('0x25')](_0x50ba33)['then'](function(_0x3505c1){return _0x3505c1;});}return null;};}function removeEntity(_0x498574,_0x1c9ee3){return function(_0x469879){if(_0x469879){return _0x469879[_0x1b43('0x26')]()[_0x1b43('0x27')](function(){_0x498574['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4289b6,_0x403756){return function(_0x4d1284){if(!_0x4d1284){_0x4289b6[_0x1b43('0x1a')](0x194);}return _0x4d1284;};}function handleError(_0x13d829,_0x120ea7){_0x120ea7=_0x120ea7||0x1f4;return function(_0x921109){logger[_0x1b43('0x28')](_0x921109[_0x1b43('0x29')]);if(_0x921109['name']){delete _0x921109[_0x1b43('0x2a')];}_0x13d829[_0x1b43('0x1b')](_0x120ea7)[_0x1b43('0x2b')](_0x921109);};}exports['index']=function(_0x1cc5cc,_0x565b9c){var _0x215f6a={},_0x308a38={},_0x3ae5f8={'count':0x0,'rows':[]};var _0x233ea6=_[_0x1b43('0x2c')](db[_0x1b43('0x2d')][_0x1b43('0x2e')],function(_0x30be6e){return{'name':_0x30be6e[_0x1b43('0x2f')],'type':_0x30be6e[_0x1b43('0x30')][_0x1b43('0x31')]};});_0x308a38[_0x1b43('0x32')]=_[_0x1b43('0x2c')](_0x233ea6,_0x1b43('0x2a'));_0x308a38[_0x1b43('0x33')]=_[_0x1b43('0x34')](_0x1cc5cc[_0x1b43('0x33')]);_0x308a38[_0x1b43('0x35')]=_[_0x1b43('0x36')](_0x308a38[_0x1b43('0x32')],_0x308a38[_0x1b43('0x33')]);_0x215f6a[_0x1b43('0x37')]=_['intersection'](_0x308a38[_0x1b43('0x32')],qs[_0x1b43('0x38')](_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x38')]));_0x215f6a[_0x1b43('0x37')]=_0x215f6a[_0x1b43('0x37')][_0x1b43('0x39')]?_0x215f6a[_0x1b43('0x37')]:_0x308a38['model'];if(!_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x3a')](_0x1b43('0x3b'))){_0x215f6a['limit']=qs[_0x1b43('0x1e')](_0x1cc5cc['query'][_0x1b43('0x1e')]);_0x215f6a[_0x1b43('0x20')]=qs['offset'](_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x20')]);}_0x215f6a[_0x1b43('0x3c')]=qs['sort'](_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x3d')]);_0x215f6a[_0x1b43('0x3e')]=qs[_0x1b43('0x35')](_[_0x1b43('0x3f')](_0x1cc5cc[_0x1b43('0x33')],_0x308a38[_0x1b43('0x35')]),_0x233ea6);if(_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x40')]){_0x215f6a[_0x1b43('0x3e')]=_[_0x1b43('0x41')](_0x215f6a['where'],{'$or':_[_0x1b43('0x2c')](_0x233ea6,function(_0x2e639c){if(_0x2e639c[_0x1b43('0x30')]!==_0x1b43('0x42')){var _0x3e1af2={};_0x3e1af2[_0x2e639c[_0x1b43('0x2a')]]={'$like':'%'+_0x1cc5cc[_0x1b43('0x33')][_0x1b43('0x40')]+'%'};return _0x3e1af2;}})});}_0x215f6a=_[_0x1b43('0x41')]({},_0x215f6a,_0x1cc5cc[_0x1b43('0x43')]);var _0x5c9b88={'where':_0x215f6a[_0x1b43('0x3e')]};return db[_0x1b43('0x2d')]['count'](_0x5c9b88)[_0x1b43('0x27')](function(_0x2a7cc3){_0x3ae5f8['count']=_0x2a7cc3;if(_0x1cc5cc[_0x1b43('0x33')]['includeAll']){_0x215f6a['include']=[{'all':!![]}];}return db[_0x1b43('0x2d')]['findAll'](_0x215f6a);})[_0x1b43('0x27')](function(_0x1716d1){_0x3ae5f8[_0x1b43('0x44')]=_0x1716d1;return _0x3ae5f8;})['then'](respondWithFilteredResult(_0x565b9c,_0x215f6a))[_0x1b43('0x45')](handleError(_0x565b9c,null));};exports[_0x1b43('0x46')]=function(_0x11b0b9,_0x206c05){var _0x1f67ae={'raw':![],'where':{'id':_0x11b0b9[_0x1b43('0x47')]['id']}},_0x23379b={};_0x23379b[_0x1b43('0x32')]=_[_0x1b43('0x34')](db[_0x1b43('0x2d')][_0x1b43('0x2e')]);_0x23379b[_0x1b43('0x33')]=_[_0x1b43('0x34')](_0x11b0b9[_0x1b43('0x33')]);_0x23379b['filters']=_[_0x1b43('0x36')](_0x23379b[_0x1b43('0x32')],_0x23379b['query']);_0x1f67ae['attributes']=_[_0x1b43('0x36')](_0x23379b['model'],qs[_0x1b43('0x38')](_0x11b0b9[_0x1b43('0x33')][_0x1b43('0x38')]));_0x1f67ae[_0x1b43('0x37')]=_0x1f67ae['attributes'][_0x1b43('0x39')]?_0x1f67ae[_0x1b43('0x37')]:_0x23379b[_0x1b43('0x32')];if(_0x11b0b9[_0x1b43('0x33')][_0x1b43('0x48')]){_0x1f67ae[_0x1b43('0x49')]=[{'all':!![]}];}_0x1f67ae=_[_0x1b43('0x41')]({},_0x1f67ae,_0x11b0b9['options']);return db['IntegrationReport']['find'](_0x1f67ae)[_0x1b43('0x27')](handleEntityNotFound(_0x206c05,null))['then'](respondWithResult(_0x206c05,null))['catch'](handleError(_0x206c05,null));};exports[_0x1b43('0x4a')]=function(_0x323d2a,_0x21ef17){return db[_0x1b43('0x2d')][_0x1b43('0x4a')](_0x323d2a['body'],{})['then'](respondWithResult(_0x21ef17,0xc9))[_0x1b43('0x45')](handleError(_0x21ef17,null));};exports[_0x1b43('0x25')]=function(_0x3e2c49,_0x42100c){if(_0x3e2c49[_0x1b43('0x4b')]['id']){delete _0x3e2c49[_0x1b43('0x4b')]['id'];}return db[_0x1b43('0x2d')][_0x1b43('0x4c')]({'where':{'id':_0x3e2c49[_0x1b43('0x47')]['id']}})[_0x1b43('0x27')](handleEntityNotFound(_0x42100c,null))['then'](saveUpdates(_0x3e2c49['body'],null))[_0x1b43('0x27')](respondWithResult(_0x42100c,null))[_0x1b43('0x45')](handleError(_0x42100c,null));};exports[_0x1b43('0x26')]=function(_0x20a4c8,_0x3f6492){return db[_0x1b43('0x2d')][_0x1b43('0x4c')]({'where':{'id':_0x20a4c8[_0x1b43('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f6492,null))[_0x1b43('0x27')](removeEntity(_0x3f6492,null))[_0x1b43('0x45')](handleError(_0x3f6492,null));};exports[_0x1b43('0x4d')]=function(_0x46934c,_0x3b0623){return db[_0x1b43('0x2d')][_0x1b43('0x4d')]()['then'](respondWithResult(_0x3b0623,null))[_0x1b43('0x45')](handleError(_0x3b0623,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c28448b..d4c63c4 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x571e=['IntegrationReport','util','../../config/logger','api','moment','path','rimraf','exports','define'];(function(_0x42c749,_0x54eff2){var _0x301d1e=function(_0x372001){while(--_0x372001){_0x42c749['push'](_0x42c749['shift']());}};_0x301d1e(++_0x54eff2);}(_0x571e,0x157));var _0xe571=function(_0x1f468d,_0x5118e7){_0x1f468d=_0x1f468d-0x0;var _0x42cc15=_0x571e[_0x1f468d];return _0x42cc15;};'use strict';var _=require('lodash');var util=require(_0xe571('0x0'));var logger=require(_0xe571('0x1'))(_0xe571('0x2'));var moment=require(_0xe571('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe571('0x4'));var rimraf=require(_0xe571('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xe571('0x6')]=function(_0x36b264,_0x2c38bd){return _0x36b264[_0xe571('0x7')](_0xe571('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2df=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','lodash','util','../../config/logger','api'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0xd2df,0xa5));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var logger=require(_0xfd2d('0x2'))(_0xfd2d('0x3'));var moment=require(_0xfd2d('0x4'));var BPromise=require(_0xfd2d('0x5'));var rp=require(_0xfd2d('0x6'));var fs=require('fs');var path=require(_0xfd2d('0x7'));var rimraf=require(_0xfd2d('0x8'));var config=require(_0xfd2d('0x9'));var attributes=require(_0xfd2d('0xa'));module['exports']=function(_0x9922ef,_0x313ae7){return _0x9922ef[_0xfd2d('0xb')](_0xfd2d('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 88cff45..7025705 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x4975,0x86));var _0x5497=function(_0x5d61cb,_0xd29411){_0x5d61cb=_0x5d61cb-0x0;var _0x3f033f=_0x4975[_0x5d61cb];return _0x3f033f;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x1544b4,_0x35f39f){var _0x2f848b=function(_0x105d0e){while(--_0x105d0e){_0x1544b4['push'](_0x1544b4['shift']());}};_0x2f848b(++_0x35f39f);}(_0x187d,0x93));var _0xd187=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x187d[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index cf934dc..e665216 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e50=['./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b9a22,_0xc1f8f6){var _0x174fc1=function(_0x4bd9c2){while(--_0x4bd9c2){_0x1b9a22['push'](_0x1b9a22['shift']());}};_0x174fc1(++_0xc1f8f6);}(_0x0e50,0x168));var _0x00e5=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x0e50[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0x00e5('0x0'));var util=require(_0x00e5('0x1'));var path=require(_0x00e5('0x2'));var timeout=require('connect-timeout');var express=require(_0x00e5('0x3'));var router=express[_0x00e5('0x4')]();var fs_extra=require(_0x00e5('0x5'));var auth=require(_0x00e5('0x6'));var interaction=require(_0x00e5('0x7'));var config=require('../../config/environment');var controller=require(_0x00e5('0x8'));router['get']('/',auth[_0x00e5('0x9')](),controller[_0x00e5('0xa')]);router[_0x00e5('0xb')](_0x00e5('0xc'),auth[_0x00e5('0x9')](),controller['show']);router[_0x00e5('0xb')](_0x00e5('0xd'),auth[_0x00e5('0x9')](),controller[_0x00e5('0xe')]);router[_0x00e5('0xf')]('/',auth[_0x00e5('0x9')](),controller['create']);router[_0x00e5('0xf')](_0x00e5('0xd'),auth['isAuthenticated'](),controller[_0x00e5('0x10')]);router[_0x00e5('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x00e5('0x11')]);router[_0x00e5('0x12')](_0x00e5('0xc'),auth['isAuthenticated'](),controller[_0x00e5('0x13')]);router[_0x00e5('0x14')](_0x00e5('0xc'),auth[_0x00e5('0x9')](),controller[_0x00e5('0x15')]);module[_0x00e5('0x16')]=router; \ No newline at end of file +var _0x1b9b=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x194b25,_0x4bedc4){var _0x107ac5=function(_0x13bcce){while(--_0x13bcce){_0x194b25['push'](_0x194b25['shift']());}};_0x107ac5(++_0x4bedc4);}(_0x1b9b,0x89));var _0xb1b9=function(_0x194c42,_0x29e7cf){_0x194c42=_0x194c42-0x0;var _0x481ae9=_0x1b9b[_0x194c42];return _0x481ae9;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require('util');var path=require(_0xb1b9('0x1'));var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express[_0xb1b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb1b9('0x5'));var interaction=require(_0xb1b9('0x6'));var config=require('../../config/environment');var controller=require('./interval.controller');router['get']('/',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x8')]);router['get'](_0xb1b9('0x9'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0xa')]);router['get'](_0xb1b9('0xb'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0xc')]);router['post']('/',auth[_0xb1b9('0x7')](),controller['create']);router[_0xb1b9('0xd')]('/:id/sub_intervals',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0xe')]);router[_0xb1b9('0xd')](_0xb1b9('0xf'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x10')]);router[_0xb1b9('0x11')](_0xb1b9('0x9'),auth['isAuthenticated'](),controller[_0xb1b9('0x12')]);router[_0xb1b9('0x13')](_0xb1b9('0x9'),auth['isAuthenticated'](),controller[_0xb1b9('0x14')]);module[_0xb1b9('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 237b3de..80bd5a8 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x602c=['STRING','sequelize','exports'];(function(_0x53d11d,_0x4a704e){var _0x3231ab=function(_0x4e2511){while(--_0x4e2511){_0x53d11d['push'](_0x53d11d['shift']());}};_0x3231ab(++_0x4a704e);}(_0x602c,0x172));var _0xc602=function(_0x3a894f,_0x190892){_0x3a894f=_0x3a894f-0x0;var _0x55c214=_0x602c[_0x3a894f];return _0x55c214;};'use strict';var Sequelize=require(_0xc602('0x0'));module[_0xc602('0x1')]={'name':{'type':Sequelize[_0xc602('0x2')]},'description':{'type':Sequelize[_0xc602('0x2')]},'interval':{'type':Sequelize[_0xc602('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8337=['STRING','sequelize','exports'];(function(_0x482bbd,_0xdd125e){var _0x4d0cbe=function(_0x1c54a5){while(--_0x1c54a5){_0x482bbd['push'](_0x482bbd['shift']());}};_0x4d0cbe(++_0xdd125e);}(_0x8337,0x7f));var _0x7833=function(_0x1c220e,_0x5b6d3a){_0x1c220e=_0x1c220e-0x0;var _0x26b7e5=_0x8337[_0x1c220e];return _0x26b7e5;};'use strict';var Sequelize=require(_0x7833('0x0'));module[_0x7833('0x1')]={'name':{'type':Sequelize[_0x7833('0x2')]},'description':{'type':Sequelize[_0x7833('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index c67923f..95ad697 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef2b=['key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','includeAll','include','findAll','rows','params','keys','catch','create','role','user','Intervals','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','options','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','get','UserProfileResource','then','stack','name','index','Interval','rawAttributes','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef2b,0x80));var _0xbef2=function(_0x3f6c4b,_0x2f89b5){_0x3f6c4b=_0x3f6c4b-0x0;var _0x4da1ab=_0xef2b[_0x3f6c4b];return _0x4da1ab;};'use strict';var emlformat=require(_0xbef2('0x0'));var rimraf=require(_0xbef2('0x1'));var zipdir=require(_0xbef2('0x2'));var jsonpatch=require(_0xbef2('0x3'));var rp=require(_0xbef2('0x4'));var moment=require(_0xbef2('0x5'));var BPromise=require(_0xbef2('0x6'));var Mustache=require('mustache');var util=require(_0xbef2('0x7'));var path=require(_0xbef2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbef2('0x9'));var fs=require('fs');var fs_extra=require(_0xbef2('0xa'));var _=require(_0xbef2('0xb'));var squel=require(_0xbef2('0xc'));var crypto=require(_0xbef2('0xd'));var jsforce=require(_0xbef2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbef2('0xf'));var Papa=require(_0xbef2('0x10'));var Redis=require(_0xbef2('0x11'));var authService=require(_0xbef2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbef2('0x13'));var hardwareService=require(_0xbef2('0x14'));var logger=require(_0xbef2('0x15'))(_0xbef2('0x16'));var utils=require(_0xbef2('0x17'));var config=require(_0xbef2('0x18'));var licenseUtil=require(_0xbef2('0x19'));var db=require(_0xbef2('0x1a'))['db'];var extensions=require(_0xbef2('0x1b'));function respondWithStatusCode(_0xfc4f20,_0x43e71a){_0x43e71a=_0x43e71a||0xcc;return function(_0x3b28c8){if(_0x3b28c8){return _0xfc4f20[_0xbef2('0x1c')](_0x43e71a);}return _0xfc4f20[_0xbef2('0x1d')](_0x43e71a)[_0xbef2('0x1e')]();};}function respondWithResult(_0x57002b,_0x58f9f2){_0x58f9f2=_0x58f9f2||0xc8;return function(_0x1192cb){if(_0x1192cb){return _0x57002b['status'](_0x58f9f2)['json'](_0x1192cb);}};}function respondWithFilteredResult(_0x4d5072,_0x15a023){return function(_0x59a63a){if(_0x59a63a){var _0x47c462=typeof _0x15a023['offset']===_0xbef2('0x1f')&&typeof _0x15a023[_0xbef2('0x20')]===_0xbef2('0x1f');var _0x47c2f8=_0x59a63a[_0xbef2('0x21')];var _0x542c15=_0x47c462?0x0:_0x15a023[_0xbef2('0x22')];var _0x39ad6c=_0x47c462?_0x59a63a[_0xbef2('0x21')]:_0x15a023[_0xbef2('0x22')]+_0x15a023[_0xbef2('0x20')];var _0x29f21e;if(_0x39ad6c>=_0x47c2f8){_0x39ad6c=_0x47c2f8;_0x29f21e=0xc8;}else{_0x29f21e=0xce;}_0x4d5072[_0xbef2('0x1d')](_0x29f21e);return _0x4d5072[_0xbef2('0x23')](_0xbef2('0x24'),_0x542c15+'-'+_0x39ad6c+'/'+_0x47c2f8)[_0xbef2('0x25')](_0x59a63a);}return null;};}function patchUpdates(_0x22a864){return function(_0x31f16e){try{jsonpatch['apply'](_0x31f16e,_0x22a864,!![]);}catch(_0x161393){return BPromise['reject'](_0x161393);}return _0x31f16e[_0xbef2('0x26')]();};}function saveUpdates(_0x3a381b,_0x3ee668){return function(_0xb7c440){if(_0xb7c440){return _0xb7c440[_0xbef2('0x27')](_0x3a381b)['then'](function(_0x1ac5ef){return _0x1ac5ef;});}return null;};}function removeEntity(_0x2b25e3,_0x4cb41c){return function(_0x160d6b){if(_0x160d6b){return _0x160d6b[_0xbef2('0x28')]()['then'](function(){var _0x16e463=_0x160d6b[_0xbef2('0x29')]({'plain':!![]});var _0x38bd5c='Intervals';return db[_0xbef2('0x2a')][_0xbef2('0x28')]({'where':{'type':_0x38bd5c,'resourceId':_0x16e463['id']}})[_0xbef2('0x2b')](function(){return _0x160d6b;});})[_0xbef2('0x2b')](function(){_0x2b25e3['status'](0xcc)[_0xbef2('0x1e')]();});}};}function handleEntityNotFound(_0x1830d4,_0x5164be){return function(_0x117306){if(!_0x117306){_0x1830d4[_0xbef2('0x1c')](0x194);}return _0x117306;};}function handleError(_0x2fa37c,_0x2edc74){_0x2edc74=_0x2edc74||0x1f4;return function(_0x170a7f){logger['error'](_0x170a7f[_0xbef2('0x2c')]);if(_0x170a7f[_0xbef2('0x2d')]){delete _0x170a7f[_0xbef2('0x2d')];}_0x2fa37c[_0xbef2('0x1d')](_0x2edc74)['send'](_0x170a7f);};}exports[_0xbef2('0x2e')]=function(_0x34be93,_0x45feba){var _0x142dbe={},_0x24fedd={},_0x5b81bf={'count':0x0,'rows':[]};var _0x50e9d3=_['map'](db[_0xbef2('0x2f')][_0xbef2('0x30')],function(_0x15daf2){return{'name':_0x15daf2['fieldName'],'type':_0x15daf2[_0xbef2('0x31')][_0xbef2('0x32')]};});_0x24fedd[_0xbef2('0x33')]=_[_0xbef2('0x34')](_0x50e9d3,_0xbef2('0x2d'));_0x24fedd[_0xbef2('0x35')]=_['keys'](_0x34be93['query']);_0x24fedd['filters']=_['intersection'](_0x24fedd[_0xbef2('0x33')],_0x24fedd[_0xbef2('0x35')]);_0x142dbe[_0xbef2('0x36')]=_[_0xbef2('0x37')](_0x24fedd[_0xbef2('0x33')],qs[_0xbef2('0x38')](_0x34be93[_0xbef2('0x35')][_0xbef2('0x38')]));_0x142dbe[_0xbef2('0x36')]=_0x142dbe[_0xbef2('0x36')][_0xbef2('0x39')]?_0x142dbe[_0xbef2('0x36')]:_0x24fedd[_0xbef2('0x33')];if(!_0x34be93['query'][_0xbef2('0x3a')]('nolimit')){_0x142dbe['limit']=qs[_0xbef2('0x20')](_0x34be93[_0xbef2('0x35')][_0xbef2('0x20')]);_0x142dbe[_0xbef2('0x22')]=qs[_0xbef2('0x22')](_0x34be93[_0xbef2('0x35')][_0xbef2('0x22')]);}_0x142dbe[_0xbef2('0x3b')]=qs[_0xbef2('0x3c')](_0x34be93[_0xbef2('0x35')]['sort']);_0x142dbe['where']=qs[_0xbef2('0x3d')](_[_0xbef2('0x3e')](_0x34be93[_0xbef2('0x35')],_0x24fedd['filters']),_0x50e9d3);if(_0x34be93['query'][_0xbef2('0x3f')]){_0x142dbe['where']=_[_0xbef2('0x40')](_0x142dbe[_0xbef2('0x41')],{'$or':_[_0xbef2('0x34')](_0x50e9d3,function(_0x2f8f36){if(_0x2f8f36['type']!=='VIRTUAL'){var _0x1b2393={};_0x1b2393[_0x2f8f36[_0xbef2('0x2d')]]={'$like':'%'+_0x34be93['query'][_0xbef2('0x3f')]+'%'};return _0x1b2393;}})});}_0x142dbe=_['merge']({},_0x142dbe,_0x34be93['options']);var _0x293275={'where':_0x142dbe[_0xbef2('0x41')]};return db[_0xbef2('0x2f')][_0xbef2('0x21')](_0x293275)['then'](function(_0x1ddbc5){_0x5b81bf[_0xbef2('0x21')]=_0x1ddbc5;if(_0x34be93[_0xbef2('0x35')][_0xbef2('0x42')]){_0x142dbe[_0xbef2('0x43')]=[{'all':!![]}];}return db[_0xbef2('0x2f')][_0xbef2('0x44')](_0x142dbe);})[_0xbef2('0x2b')](function(_0x1d69ec){_0x5b81bf[_0xbef2('0x45')]=_0x1d69ec;return _0x5b81bf;})['then'](respondWithFilteredResult(_0x45feba,_0x142dbe))['catch'](handleError(_0x45feba,null));};exports['show']=function(_0x14db59,_0x123c14){var _0x177e18={'raw':!![],'where':{'id':_0x14db59[_0xbef2('0x46')]['id']}},_0x148f55={};_0x148f55[_0xbef2('0x33')]=_[_0xbef2('0x47')](db[_0xbef2('0x2f')]['rawAttributes']);_0x148f55[_0xbef2('0x35')]=_['keys'](_0x14db59[_0xbef2('0x35')]);_0x148f55[_0xbef2('0x3d')]=_['intersection'](_0x148f55[_0xbef2('0x33')],_0x148f55[_0xbef2('0x35')]);_0x177e18['attributes']=_[_0xbef2('0x37')](_0x148f55[_0xbef2('0x33')],qs[_0xbef2('0x38')](_0x14db59['query'][_0xbef2('0x38')]));_0x177e18[_0xbef2('0x36')]=_0x177e18[_0xbef2('0x36')]['length']?_0x177e18[_0xbef2('0x36')]:_0x148f55[_0xbef2('0x33')];if(_0x14db59[_0xbef2('0x35')][_0xbef2('0x42')]){_0x177e18['include']=[{'all':!![]}];}_0x177e18=_[_0xbef2('0x40')]({},_0x177e18,_0x14db59['options']);return db[_0xbef2('0x2f')]['find'](_0x177e18)[_0xbef2('0x2b')](handleEntityNotFound(_0x123c14,null))[_0xbef2('0x2b')](respondWithResult(_0x123c14,null))[_0xbef2('0x48')](handleError(_0x123c14,null));};exports[_0xbef2('0x49')]=function(_0x358d3b,_0x9942a2){return db['Interval'][_0xbef2('0x49')](_0x358d3b['body'],{})['then'](function(_0x4d14a1){var _0x2df845=_0x358d3b['user'][_0xbef2('0x29')]({'plain':!![]});if(!_0x2df845)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2df845[_0xbef2('0x4a')]===_0xbef2('0x4b')){var _0x50ff1b=_0x4d14a1[_0xbef2('0x29')]({'plain':!![]});var _0x57c735=_0xbef2('0x4c');return db[_0xbef2('0x4d')][_0xbef2('0x4e')]({'where':{'name':_0x57c735,'userProfileId':_0x2df845['userProfileId']},'raw':!![]})['then'](function(_0xbdb3ad){if(_0xbdb3ad&&_0xbdb3ad['autoAssociation']===0x0){return db[_0xbef2('0x2a')][_0xbef2('0x49')]({'name':_0x50ff1b[_0xbef2('0x2d')],'resourceId':_0x50ff1b['id'],'type':_0xbdb3ad[_0xbef2('0x2d')],'sectionId':_0xbdb3ad['id']},{})[_0xbef2('0x2b')](function(){return _0x4d14a1;});}else{return _0x4d14a1;}})[_0xbef2('0x48')](function(_0x16df8d){logger[_0xbef2('0x4f')](_0xbef2('0x50'),_0x16df8d);throw _0x16df8d;});}return _0x4d14a1;})[_0xbef2('0x2b')](respondWithResult(_0x9942a2,0xc9))[_0xbef2('0x48')](handleError(_0x9942a2,null));};exports['update']=function(_0x4d5b06,_0x12d85a){if(_0x4d5b06[_0xbef2('0x51')]['id']){delete _0x4d5b06[_0xbef2('0x51')]['id'];}return db['Interval'][_0xbef2('0x4e')]({'where':{'id':_0x4d5b06[_0xbef2('0x46')]['id']}})[_0xbef2('0x2b')](handleEntityNotFound(_0x12d85a,null))['then'](saveUpdates(_0x4d5b06['body'],null))[_0xbef2('0x2b')](respondWithResult(_0x12d85a,null))[_0xbef2('0x48')](handleError(_0x12d85a,null));};exports[_0xbef2('0x28')]=function(_0x4ffaf4,_0x3b63b8){return db[_0xbef2('0x2f')][_0xbef2('0x4e')]({'where':{'id':_0x4ffaf4[_0xbef2('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b63b8,null))[_0xbef2('0x2b')](removeEntity(_0x3b63b8,null))[_0xbef2('0x48')](handleError(_0x3b63b8,null));};exports[_0xbef2('0x52')]=function(_0x1a1ce8,_0x30e3e0,_0x339a8b){if(_0x1a1ce8[_0xbef2('0x51')]['id']){delete _0x1a1ce8['body']['id'];}return db['Interval'][_0xbef2('0x4e')]({'where':{'id':_0x1a1ce8[_0xbef2('0x46')]['id']}})[_0xbef2('0x2b')](handleEntityNotFound(_0x30e3e0,null))[_0xbef2('0x2b')](function(_0x522aef){if(_0x522aef){_0x1a1ce8['body']['IntervalId']=_0x522aef['id'];return db['Interval'][_0xbef2('0x49')](_0x1a1ce8[_0xbef2('0x51')]);}})[_0xbef2('0x2b')](respondWithResult(_0x30e3e0,null))[_0xbef2('0x48')](handleError(_0x30e3e0,null));};exports[_0xbef2('0x53')]=function(_0x161d3d,_0x5f4581,_0x2bac4f){var _0x47b164={};var _0x5c2ff0={};var _0x5dca77;var _0x50aee1;return db[_0xbef2('0x2f')]['findOne']({'where':{'id':_0x161d3d['params']['id']}})[_0xbef2('0x2b')](handleEntityNotFound(_0x5f4581,null))[_0xbef2('0x2b')](function(_0x5c3b21){if(_0x5c3b21){_0x5dca77=_0x5c3b21;_0x5c2ff0[_0xbef2('0x33')]=_[_0xbef2('0x47')](db[_0xbef2('0x2f')]['rawAttributes']);_0x5c2ff0[_0xbef2('0x35')]=_['keys'](_0x161d3d['query']);_0x5c2ff0['filters']=_[_0xbef2('0x37')](_0x5c2ff0[_0xbef2('0x33')],_0x5c2ff0[_0xbef2('0x35')]);_0x47b164[_0xbef2('0x36')]=_['intersection'](_0x5c2ff0[_0xbef2('0x33')],qs[_0xbef2('0x38')](_0x161d3d['query'][_0xbef2('0x38')]));_0x47b164[_0xbef2('0x36')]=_0x47b164[_0xbef2('0x36')]['length']?_0x47b164[_0xbef2('0x36')]:_0x5c2ff0['model'];_0x47b164[_0xbef2('0x3b')]=qs[_0xbef2('0x3c')](_0x161d3d[_0xbef2('0x35')][_0xbef2('0x3c')]);_0x47b164[_0xbef2('0x41')]=qs['filters'](_['pick'](_0x161d3d['query'],_0x5c2ff0['filters']));if(_0x161d3d[_0xbef2('0x35')][_0xbef2('0x3f')]){_0x47b164[_0xbef2('0x41')]=_['merge'](_0x47b164[_0xbef2('0x41')],{'$or':_[_0xbef2('0x34')](_0x47b164[_0xbef2('0x36')],function(_0x11fe89){var _0x3f3470={};_0x3f3470[_0x11fe89]={'$like':'%'+_0x161d3d[_0xbef2('0x35')]['filter']+'%'};return _0x3f3470;})});}_0x47b164=_[_0xbef2('0x40')]({},_0x47b164,_0x161d3d[_0xbef2('0x54')]);return _0x5dca77[_0xbef2('0x53')](_0x47b164);}})[_0xbef2('0x2b')](function(_0x2cfc03){if(_0x2cfc03){_0x50aee1=_0x2cfc03['length'];if(!_0x161d3d[_0xbef2('0x35')][_0xbef2('0x3a')]('nolimit')){_0x47b164[_0xbef2('0x20')]=qs[_0xbef2('0x20')](_0x161d3d[_0xbef2('0x35')][_0xbef2('0x20')]);_0x47b164[_0xbef2('0x22')]=qs['offset'](_0x161d3d[_0xbef2('0x35')]['offset']);}return _0x5dca77[_0xbef2('0x53')](_0x47b164);}})['then'](function(_0x5c49ba){if(_0x5c49ba){return _0x5c49ba?{'count':_0x50aee1,'rows':_0x5c49ba}:null;}})[_0xbef2('0x2b')](respondWithResult(_0x5f4581,null))[_0xbef2('0x48')](handleError(_0x5f4581,null));};exports['addIntervals']=function(_0x4fd487,_0x26db29,_0x50b6a6){return db[_0xbef2('0x2f')][_0xbef2('0x55')]({'where':{'id':_0x4fd487[_0xbef2('0x46')]['id']}})['then'](handleEntityNotFound(_0x26db29,null))[_0xbef2('0x2b')](function(_0xfdf76c){if(_0xfdf76c){return db[_0xbef2('0x56')][_0xbef2('0x57')](function(_0x1a468f){return db[_0xbef2('0x2f')][_0xbef2('0x28')]({'where':{'IntervalId':_0x4fd487[_0xbef2('0x46')]['id']},'transaction':_0x1a468f})[_0xbef2('0x2b')](function(_0x427c8a){var _0x41023a=_[_0xbef2('0x34')](_0x4fd487[_0xbef2('0x51')],function(_0x242bd1){delete _0x242bd1['id'];_0x242bd1['IntervalId']=_0x4fd487[_0xbef2('0x46')]['id'];return _0x242bd1;});return db[_0xbef2('0x2f')][_0xbef2('0x58')](_0x41023a,{'transaction':_0x1a468f});});})[_0xbef2('0x2b')](function(){return db['Interval'][_0xbef2('0x44')]({'where':{'IntervalId':_0x4fd487[_0xbef2('0x46')]['id']}});});}})[_0xbef2('0x2b')](respondWithResult(_0x26db29,null))['catch'](handleError(_0x26db29,null));}; \ No newline at end of file +var _0x420c=['pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','Intervals','destroy','sendStatus','error','stack','send','index','map','Interval','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1c688b,_0x4df102){var _0x4d4577=function(_0x29a41b){while(--_0x29a41b){_0x1c688b['push'](_0x1c688b['shift']());}};_0x4d4577(++_0x4df102);}(_0x420c,0xd4));var _0xc420=function(_0x3b6e57,_0x1f3499){_0x3b6e57=_0x3b6e57-0x0;var _0x1e66b0=_0x420c[_0x3b6e57];return _0x1e66b0;};'use strict';var emlformat=require(_0xc420('0x0'));var rimraf=require(_0xc420('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc420('0x2'));var moment=require('moment');var BPromise=require(_0xc420('0x3'));var Mustache=require(_0xc420('0x4'));var util=require('util');var path=require(_0xc420('0x5'));var sox=require(_0xc420('0x6'));var csv=require('to-csv');var ejs=require(_0xc420('0x7'));var fs=require('fs');var fs_extra=require(_0xc420('0x8'));var _=require(_0xc420('0x9'));var squel=require(_0xc420('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc420('0xb'));var toCsv=require(_0xc420('0xc'));var querystring=require('querystring');var Papa=require(_0xc420('0xd'));var Redis=require(_0xc420('0xe'));var authService=require(_0xc420('0xf'));var qs=require(_0xc420('0x10'));var as=require(_0xc420('0x11'));var hardwareService=require(_0xc420('0x12'));var logger=require('../../config/logger')(_0xc420('0x13'));var utils=require(_0xc420('0x14'));var config=require(_0xc420('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc420('0x16'))['db'];var extensions=require(_0xc420('0x17'));function respondWithStatusCode(_0x2dbce7,_0x413fed){_0x413fed=_0x413fed||0xcc;return function(_0x2481ec){if(_0x2481ec){return _0x2dbce7['sendStatus'](_0x413fed);}return _0x2dbce7[_0xc420('0x18')](_0x413fed)['end']();};}function respondWithResult(_0x3d39cf,_0x111bd6){_0x111bd6=_0x111bd6||0xc8;return function(_0x5e4cc4){if(_0x5e4cc4){return _0x3d39cf[_0xc420('0x18')](_0x111bd6)[_0xc420('0x19')](_0x5e4cc4);}};}function respondWithFilteredResult(_0x46bce7,_0x210ca7){return function(_0x38f41b){if(_0x38f41b){var _0x3e5d5e=typeof _0x210ca7[_0xc420('0x1a')]===_0xc420('0x1b')&&typeof _0x210ca7[_0xc420('0x1c')]===_0xc420('0x1b');var _0x29dc7d=_0x38f41b[_0xc420('0x1d')];var _0x5677db=_0x3e5d5e?0x0:_0x210ca7[_0xc420('0x1a')];var _0x2ebea3=_0x3e5d5e?_0x38f41b['count']:_0x210ca7['offset']+_0x210ca7[_0xc420('0x1c')];var _0x788f13;if(_0x2ebea3>=_0x29dc7d){_0x2ebea3=_0x29dc7d;_0x788f13=0xc8;}else{_0x788f13=0xce;}_0x46bce7[_0xc420('0x18')](_0x788f13);return _0x46bce7[_0xc420('0x1e')](_0xc420('0x1f'),_0x5677db+'-'+_0x2ebea3+'/'+_0x29dc7d)[_0xc420('0x19')](_0x38f41b);}return null;};}function patchUpdates(_0x4c2f67){return function(_0xf2ad06){try{jsonpatch[_0xc420('0x20')](_0xf2ad06,_0x4c2f67,!![]);}catch(_0x2a6c85){return BPromise[_0xc420('0x21')](_0x2a6c85);}return _0xf2ad06[_0xc420('0x22')]();};}function saveUpdates(_0x4b4b00,_0x9105fa){return function(_0x376a23){if(_0x376a23){return _0x376a23['update'](_0x4b4b00)['then'](function(_0x18d7b6){return _0x18d7b6;});}return null;};}function removeEntity(_0x494cad,_0x1538d5){return function(_0x52ca7d){if(_0x52ca7d){return _0x52ca7d['destroy']()[_0xc420('0x23')](function(){var _0x1fd89d=_0x52ca7d[_0xc420('0x24')]({'plain':!![]});var _0x3f28f2=_0xc420('0x25');return db['UserProfileResource'][_0xc420('0x26')]({'where':{'type':_0x3f28f2,'resourceId':_0x1fd89d['id']}})[_0xc420('0x23')](function(){return _0x52ca7d;});})['then'](function(){_0x494cad[_0xc420('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1043d2,_0x2af739){return function(_0x2df7f4){if(!_0x2df7f4){_0x1043d2[_0xc420('0x27')](0x194);}return _0x2df7f4;};}function handleError(_0x204d7f,_0x407932){_0x407932=_0x407932||0x1f4;return function(_0x17028e){logger[_0xc420('0x28')](_0x17028e[_0xc420('0x29')]);if(_0x17028e['name']){delete _0x17028e['name'];}_0x204d7f[_0xc420('0x18')](_0x407932)[_0xc420('0x2a')](_0x17028e);};}exports[_0xc420('0x2b')]=function(_0x1bd6ef,_0x3f89dd){var _0x2d4faa={},_0x10b9e6={},_0x5a1c1d={'count':0x0,'rows':[]};var _0x565019=_[_0xc420('0x2c')](db[_0xc420('0x2d')][_0xc420('0x2e')],function(_0x5798b0){return{'name':_0x5798b0[_0xc420('0x2f')],'type':_0x5798b0[_0xc420('0x30')][_0xc420('0x31')]};});_0x10b9e6['model']=_[_0xc420('0x2c')](_0x565019,_0xc420('0x32'));_0x10b9e6[_0xc420('0x33')]=_[_0xc420('0x34')](_0x1bd6ef[_0xc420('0x33')]);_0x10b9e6[_0xc420('0x35')]=_[_0xc420('0x36')](_0x10b9e6[_0xc420('0x37')],_0x10b9e6[_0xc420('0x33')]);_0x2d4faa[_0xc420('0x38')]=_[_0xc420('0x36')](_0x10b9e6['model'],qs[_0xc420('0x39')](_0x1bd6ef[_0xc420('0x33')][_0xc420('0x39')]));_0x2d4faa['attributes']=_0x2d4faa['attributes'][_0xc420('0x3a')]?_0x2d4faa['attributes']:_0x10b9e6[_0xc420('0x37')];if(!_0x1bd6ef['query'][_0xc420('0x3b')](_0xc420('0x3c'))){_0x2d4faa[_0xc420('0x1c')]=qs[_0xc420('0x1c')](_0x1bd6ef['query'][_0xc420('0x1c')]);_0x2d4faa['offset']=qs[_0xc420('0x1a')](_0x1bd6ef['query'][_0xc420('0x1a')]);}_0x2d4faa[_0xc420('0x3d')]=qs[_0xc420('0x3e')](_0x1bd6ef['query'][_0xc420('0x3e')]);_0x2d4faa[_0xc420('0x3f')]=qs[_0xc420('0x35')](_[_0xc420('0x40')](_0x1bd6ef[_0xc420('0x33')],_0x10b9e6['filters']),_0x565019);if(_0x1bd6ef[_0xc420('0x33')][_0xc420('0x41')]){_0x2d4faa[_0xc420('0x3f')]=_[_0xc420('0x42')](_0x2d4faa['where'],{'$or':_[_0xc420('0x2c')](_0x565019,function(_0x150719){if(_0x150719[_0xc420('0x30')]!=='VIRTUAL'){var _0x345f72={};_0x345f72[_0x150719[_0xc420('0x32')]]={'$like':'%'+_0x1bd6ef[_0xc420('0x33')][_0xc420('0x41')]+'%'};return _0x345f72;}})});}_0x2d4faa=_[_0xc420('0x42')]({},_0x2d4faa,_0x1bd6ef[_0xc420('0x43')]);var _0x3f681f={'where':_0x2d4faa[_0xc420('0x3f')]};return db['Interval']['count'](_0x3f681f)[_0xc420('0x23')](function(_0x3d7cc7){_0x5a1c1d['count']=_0x3d7cc7;if(_0x1bd6ef['query'][_0xc420('0x44')]){_0x2d4faa['include']=[{'all':!![]}];}return db[_0xc420('0x2d')][_0xc420('0x45')](_0x2d4faa);})[_0xc420('0x23')](function(_0x1bd709){_0x5a1c1d[_0xc420('0x46')]=_0x1bd709;return _0x5a1c1d;})['then'](respondWithFilteredResult(_0x3f89dd,_0x2d4faa))[_0xc420('0x47')](handleError(_0x3f89dd,null));};exports['show']=function(_0xd7964b,_0x73a2bc){var _0x27f7d0={'raw':!![],'where':{'id':_0xd7964b[_0xc420('0x48')]['id']}},_0x18324c={};_0x18324c[_0xc420('0x37')]=_[_0xc420('0x34')](db[_0xc420('0x2d')]['rawAttributes']);_0x18324c['query']=_['keys'](_0xd7964b[_0xc420('0x33')]);_0x18324c['filters']=_[_0xc420('0x36')](_0x18324c[_0xc420('0x37')],_0x18324c[_0xc420('0x33')]);_0x27f7d0[_0xc420('0x38')]=_[_0xc420('0x36')](_0x18324c[_0xc420('0x37')],qs['fields'](_0xd7964b[_0xc420('0x33')]['fields']));_0x27f7d0[_0xc420('0x38')]=_0x27f7d0[_0xc420('0x38')][_0xc420('0x3a')]?_0x27f7d0['attributes']:_0x18324c[_0xc420('0x37')];if(_0xd7964b['query'][_0xc420('0x44')]){_0x27f7d0[_0xc420('0x49')]=[{'all':!![]}];}_0x27f7d0=_[_0xc420('0x42')]({},_0x27f7d0,_0xd7964b[_0xc420('0x43')]);return db[_0xc420('0x2d')][_0xc420('0x4a')](_0x27f7d0)[_0xc420('0x23')](handleEntityNotFound(_0x73a2bc,null))[_0xc420('0x23')](respondWithResult(_0x73a2bc,null))['catch'](handleError(_0x73a2bc,null));};exports[_0xc420('0x4b')]=function(_0x3724b3,_0xf968d2){return db[_0xc420('0x2d')][_0xc420('0x4b')](_0x3724b3['body'],{})[_0xc420('0x23')](function(_0x5a28c){var _0x4ba7f7=_0x3724b3[_0xc420('0x4c')]['get']({'plain':!![]});if(!_0x4ba7f7)throw new Error(_0xc420('0x4d'));if(_0x4ba7f7[_0xc420('0x4e')]===_0xc420('0x4c')){var _0x174562=_0x5a28c[_0xc420('0x24')]({'plain':!![]});var _0x68bed='Intervals';return db[_0xc420('0x4f')][_0xc420('0x4a')]({'where':{'name':_0x68bed,'userProfileId':_0x4ba7f7[_0xc420('0x50')]},'raw':!![]})[_0xc420('0x23')](function(_0x1d21c4){if(_0x1d21c4&&_0x1d21c4[_0xc420('0x51')]===0x0){return db['UserProfileResource'][_0xc420('0x4b')]({'name':_0x174562[_0xc420('0x32')],'resourceId':_0x174562['id'],'type':_0x1d21c4[_0xc420('0x32')],'sectionId':_0x1d21c4['id']},{})[_0xc420('0x23')](function(){return _0x5a28c;});}else{return _0x5a28c;}})['catch'](function(_0x265f49){logger[_0xc420('0x28')](_0xc420('0x52'),_0x265f49);throw _0x265f49;});}return _0x5a28c;})[_0xc420('0x23')](respondWithResult(_0xf968d2,0xc9))['catch'](handleError(_0xf968d2,null));};exports[_0xc420('0x53')]=function(_0x56115d,_0xa0aafc){if(_0x56115d['body']['id']){delete _0x56115d[_0xc420('0x54')]['id'];}return db['Interval'][_0xc420('0x4a')]({'where':{'id':_0x56115d[_0xc420('0x48')]['id']}})['then'](handleEntityNotFound(_0xa0aafc,null))[_0xc420('0x23')](saveUpdates(_0x56115d['body'],null))[_0xc420('0x23')](respondWithResult(_0xa0aafc,null))[_0xc420('0x47')](handleError(_0xa0aafc,null));};exports[_0xc420('0x26')]=function(_0x890c5,_0x94f641){return db[_0xc420('0x2d')][_0xc420('0x4a')]({'where':{'id':_0x890c5[_0xc420('0x48')]['id']}})[_0xc420('0x23')](handleEntityNotFound(_0x94f641,null))[_0xc420('0x23')](removeEntity(_0x94f641,null))['catch'](handleError(_0x94f641,null));};exports[_0xc420('0x55')]=function(_0x3f4e6a,_0x11699f,_0x4c378c){if(_0x3f4e6a[_0xc420('0x54')]['id']){delete _0x3f4e6a[_0xc420('0x54')]['id'];}return db[_0xc420('0x2d')][_0xc420('0x4a')]({'where':{'id':_0x3f4e6a[_0xc420('0x48')]['id']}})[_0xc420('0x23')](handleEntityNotFound(_0x11699f,null))[_0xc420('0x23')](function(_0x22830f){if(_0x22830f){_0x3f4e6a[_0xc420('0x54')][_0xc420('0x56')]=_0x22830f['id'];return db['Interval'][_0xc420('0x4b')](_0x3f4e6a['body']);}})['then'](respondWithResult(_0x11699f,null))[_0xc420('0x47')](handleError(_0x11699f,null));};exports[_0xc420('0x57')]=function(_0x5f0cac,_0x15330d,_0xbba902){var _0x2a4925={};var _0x11d948={};var _0x36730c;var _0x3eae2f;return db[_0xc420('0x2d')][_0xc420('0x58')]({'where':{'id':_0x5f0cac[_0xc420('0x48')]['id']}})[_0xc420('0x23')](handleEntityNotFound(_0x15330d,null))['then'](function(_0x34224f){if(_0x34224f){_0x36730c=_0x34224f;_0x11d948[_0xc420('0x37')]=_['keys'](db[_0xc420('0x2d')][_0xc420('0x2e')]);_0x11d948[_0xc420('0x33')]=_[_0xc420('0x34')](_0x5f0cac['query']);_0x11d948[_0xc420('0x35')]=_[_0xc420('0x36')](_0x11d948['model'],_0x11d948[_0xc420('0x33')]);_0x2a4925[_0xc420('0x38')]=_[_0xc420('0x36')](_0x11d948[_0xc420('0x37')],qs[_0xc420('0x39')](_0x5f0cac[_0xc420('0x33')][_0xc420('0x39')]));_0x2a4925[_0xc420('0x38')]=_0x2a4925[_0xc420('0x38')][_0xc420('0x3a')]?_0x2a4925[_0xc420('0x38')]:_0x11d948[_0xc420('0x37')];_0x2a4925[_0xc420('0x3d')]=qs[_0xc420('0x3e')](_0x5f0cac[_0xc420('0x33')][_0xc420('0x3e')]);_0x2a4925[_0xc420('0x3f')]=qs[_0xc420('0x35')](_['pick'](_0x5f0cac['query'],_0x11d948[_0xc420('0x35')]));if(_0x5f0cac[_0xc420('0x33')]['filter']){_0x2a4925['where']=_['merge'](_0x2a4925['where'],{'$or':_[_0xc420('0x2c')](_0x2a4925[_0xc420('0x38')],function(_0x1226aa){var _0x37d7ed={};_0x37d7ed[_0x1226aa]={'$like':'%'+_0x5f0cac['query']['filter']+'%'};return _0x37d7ed;})});}_0x2a4925=_[_0xc420('0x42')]({},_0x2a4925,_0x5f0cac[_0xc420('0x43')]);return _0x36730c[_0xc420('0x57')](_0x2a4925);}})[_0xc420('0x23')](function(_0x32a9c1){if(_0x32a9c1){_0x3eae2f=_0x32a9c1['length'];if(!_0x5f0cac[_0xc420('0x33')][_0xc420('0x3b')](_0xc420('0x3c'))){_0x2a4925['limit']=qs[_0xc420('0x1c')](_0x5f0cac['query'][_0xc420('0x1c')]);_0x2a4925[_0xc420('0x1a')]=qs[_0xc420('0x1a')](_0x5f0cac[_0xc420('0x33')][_0xc420('0x1a')]);}return _0x36730c['getIntervals'](_0x2a4925);}})[_0xc420('0x23')](function(_0x472fdf){if(_0x472fdf){return _0x472fdf?{'count':_0x3eae2f,'rows':_0x472fdf}:null;}})[_0xc420('0x23')](respondWithResult(_0x15330d,null))[_0xc420('0x47')](handleError(_0x15330d,null));};exports[_0xc420('0x59')]=function(_0x38e449,_0x1d8369,_0x5f27f7){return db[_0xc420('0x2d')][_0xc420('0x58')]({'where':{'id':_0x38e449[_0xc420('0x48')]['id']}})[_0xc420('0x23')](handleEntityNotFound(_0x1d8369,null))[_0xc420('0x23')](function(_0x4a1098){if(_0x4a1098){return db[_0xc420('0x5a')][_0xc420('0x5b')](function(_0x30aa07){return db[_0xc420('0x2d')]['destroy']({'where':{'IntervalId':_0x38e449['params']['id']},'transaction':_0x30aa07})[_0xc420('0x23')](function(_0x1204c4){var _0x31b3a9=_['map'](_0x38e449[_0xc420('0x54')],function(_0x1a5a50){delete _0x1a5a50['id'];_0x1a5a50[_0xc420('0x56')]=_0x38e449[_0xc420('0x48')]['id'];return _0x1a5a50;});return db[_0xc420('0x2d')]['bulkCreate'](_0x31b3a9,{'transaction':_0x30aa07});});})[_0xc420('0x23')](function(){return db[_0xc420('0x2d')][_0xc420('0x45')]({'where':{'IntervalId':_0x38e449[_0xc420('0x48')]['id']}});});}})[_0xc420('0x23')](respondWithResult(_0x1d8369,null))[_0xc420('0x47')](handleError(_0x1d8369,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index a945f28..e758f52 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7812=['rewrite','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Interval','tools_intervals'];(function(_0x295d1d,_0x39409f){var _0x327d2b=function(_0x4538f9){while(--_0x4538f9){_0x295d1d['push'](_0x295d1d['shift']());}};_0x327d2b(++_0x39409f);}(_0x7812,0xd1));var _0x2781=function(_0x269ccb,_0x5eaeea){_0x269ccb=_0x269ccb-0x0;var _0x41e49=_0x7812[_0x269ccb];return _0x41e49;};'use strict';var _=require(_0x2781('0x0'));var util=require(_0x2781('0x1'));var logger=require(_0x2781('0x2'))(_0x2781('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2781('0x4'));var fs=require('fs');var path=require(_0x2781('0x5'));var rimraf=require(_0x2781('0x6'));var config=require(_0x2781('0x7'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x2781('0x8')]=function(_0x28401a,_0x2585bb){return _0x28401a[_0x2781('0x9')](_0x2781('0xa'),attributes,{'tableName':_0x2781('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a614a,_0x2e7479){extensions[_0x2781('0xc')](_0x28401a,_0x3a614a);},'afterBulkCreate':function(_0x3b0331,_0x261f79,_0x3a7919){_0x3a7919();extensions[_0x2781('0xc')](_0x28401a,_0x3b0331[0x0]);},'afterUpdate':function(_0x3ed1a0,_0x5f4ad9){extensions[_0x2781('0xc')](_0x28401a,_0x3ed1a0);},'afterDestroy':function(_0x4888a2,_0x168b6a){extensions[_0x2781('0xc')](_0x28401a,_0x4888a2);}}});}; \ No newline at end of file +var _0x8df2=['define','Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','request-promise','rimraf','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0xbf2f7,_0xd30a4a){var _0x55ee1a=function(_0x269147){while(--_0x269147){_0xbf2f7['push'](_0xbf2f7['shift']());}};_0x55ee1a(++_0xd30a4a);}(_0x8df2,0x1b1));var _0x28df=function(_0x35244f,_0x2f534c){_0x35244f=_0x35244f-0x0;var _0x415eb2=_0x8df2[_0x35244f];return _0x415eb2;};'use strict';var _=require('lodash');var util=require(_0x28df('0x0'));var logger=require(_0x28df('0x1'))(_0x28df('0x2'));var moment=require(_0x28df('0x3'));var BPromise=require('bluebird');var rp=require(_0x28df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28df('0x5'));var config=require('../../config/environment');var attributes=require(_0x28df('0x6'));var extensions=require(_0x28df('0x7'));module[_0x28df('0x8')]=function(_0x338a99,_0x3fa880){return _0x338a99[_0x28df('0x9')](_0x28df('0xa'),attributes,{'tableName':_0x28df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5326d0,_0x265a6a){extensions[_0x28df('0xc')](_0x338a99,_0x5326d0);},'afterBulkCreate':function(_0x28ff0c,_0x1aad7c,_0x7da537){_0x7da537();extensions[_0x28df('0xc')](_0x338a99,_0x28ff0c[0x0]);},'afterUpdate':function(_0x42584f,_0x3a2be8){extensions['rewrite'](_0x338a99,_0x42584f);},'afterDestroy':function(_0x3e55bd,_0x1a37ae){extensions[_0x28df('0xc')](_0x338a99,_0x3e55bd);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 47dfbfb..abb6370 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2216a4e..7fda72c 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb10b,0x12a));var _0xbb10=function(_0x24681b,_0x31424e){_0x24681b=_0x24681b-0x0;var _0x10d992=_0xb10b[_0x24681b];return _0x10d992;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x21d595,_0x5f3b37){var _0x3173a3=function(_0x841b70){while(--_0x841b70){_0x21d595['push'](_0x21d595['shift']());}};_0x3173a3(++_0x5f3b37);}(_0x2ef3,0xba));var _0x32ef=function(_0x1994c1,_0x9353fe){_0x1994c1=_0x1994c1-0x0;var _0x5c8659=_0x2ef3[_0x1994c1];return _0x5c8659;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b452007..3dc06b3 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d42=['send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','description','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','stringify','setEncoding','data','end','status','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9d42,0x109));var _0x29d4=function(_0x47557d,_0xf370a8){_0x47557d=_0x47557d-0x0;var _0x5a8ecd=_0x9d42[_0x47557d];return _0x5a8ecd;};'use strict';var BPromise=require(_0x29d4('0x0'));var https=require(_0x29d4('0x1'));var logger=require('../../config/logger')(_0x29d4('0x2'));var USERNAME=_0x29d4('0x3');var PASSWORD=_0x29d4('0x4');function openIssue(_0x20b930,_0x565957){var _0x2958ef={'fields':{'project':{'key':_0x20b930[_0x29d4('0x5')]||_0x29d4('0x6')},'summary':(_0x20b930['summary']||'Report')+'\x20from\x20'+_0x20b930['ip'],'description':_0x20b930[_0x29d4('0x7')]||JSON['stringify'](_0x20b930),'issuetype':{'name':_0x20b930[_0x29d4('0x8')]||_0x29d4('0x9')}}};_0x2958ef[_0x29d4('0xa')][_0x29d4('0xb')]=_0x20b930[_0x29d4('0xc')];_0x2958ef[_0x29d4('0xa')]['customfield_11501']=_0x20b930[_0x29d4('0xd')];_0x2958ef['fields'][_0x29d4('0xe')]=_0x20b930['newToken'];_0x2958ef[_0x29d4('0xa')][_0x29d4('0xf')]=_0x20b930[_0x29d4('0x10')];_0x2958ef[_0x29d4('0xa')][_0x29d4('0x11')]=_0x20b930['reason'];_0x2958ef[_0x29d4('0xa')][_0x29d4('0x12')]=_0x20b930['ip'];var _0x52fa5b={'host':_0x29d4('0x13'),'port':0x1bb,'path':_0x29d4('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x29d4('0x15'),'Authorization':_0x29d4('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x29d4('0x17')](_0x29d4('0x18'))}};var _0x25fe2f=JSON[_0x29d4('0x19')](_0x2958ef);var _0x90a42f=https['request'](_0x52fa5b,function(_0x3bd41b){_0x3bd41b[_0x29d4('0x1a')]('utf8');var _0x5cf4ce='';_0x3bd41b['on'](_0x29d4('0x1b'),function(_0x519c19){_0x5cf4ce+=_0x519c19;});_0x3bd41b['on'](_0x29d4('0x1c'),function(){if(_0x565957){return _0x565957[_0x29d4('0x1d')](_0x3bd41b['statusCode'])['json'](JSON['parse'](_0x5cf4ce));}});});_0x90a42f['on'](_0x29d4('0x1e'),function(_0x4e4bf3){if(_0x565957){return _0x565957[_0x29d4('0x1d')](0x1f4)[_0x29d4('0x1f')]({'errors':[{'message':_0x29d4('0x20'),'type':_0x29d4('0x21')}]});}});_0x90a42f[_0x29d4('0x22')](_0x25fe2f);_0x90a42f[_0x29d4('0x1c')]();}exports[_0x29d4('0x23')]=openIssue;exports[_0x29d4('0x24')]=function(_0x197105,_0x2d6fdf){_0x197105[_0x29d4('0x25')]['ip']=_0x197105[_0x29d4('0x26')][_0x29d4('0x27')]||_0x197105['connection'][_0x29d4('0x28')]||_0x197105[_0x29d4('0x29')]['remoteAddress']||_0x197105[_0x29d4('0x2a')][_0x29d4('0x29')]['remoteAddress'];return openIssue(_0x197105[_0x29d4('0x25')],_0x2d6fdf);}; \ No newline at end of file +var _0x2400=['application/json','Basic\x20','toString','request','setEncoding','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','POST'];(function(_0x337959,_0x4ca215){var _0x47b64f=function(_0x18d96f){while(--_0x18d96f){_0x337959['push'](_0x337959['shift']());}};_0x47b64f(++_0x4ca215);}(_0x2400,0x12a));var _0x0240=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x2400[_0x68ee8b];return _0x5148f7;};'use strict';var BPromise=require(_0x0240('0x0'));var https=require(_0x0240('0x1'));var logger=require(_0x0240('0x2'))(_0x0240('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x46041e,_0x41bc2e){var _0x17569f={'fields':{'project':{'key':_0x46041e[_0x0240('0x4')]||_0x0240('0x5')},'summary':(_0x46041e[_0x0240('0x6')]||_0x0240('0x7'))+'\x20from\x20'+_0x46041e['ip'],'description':_0x46041e[_0x0240('0x8')]||JSON[_0x0240('0x9')](_0x46041e),'issuetype':{'name':_0x46041e[_0x0240('0xa')]||_0x0240('0xb')}}};_0x17569f[_0x0240('0xc')][_0x0240('0xd')]=_0x46041e[_0x0240('0xe')];_0x17569f['fields'][_0x0240('0xf')]=_0x46041e[_0x0240('0x10')];_0x17569f[_0x0240('0xc')][_0x0240('0x11')]=_0x46041e[_0x0240('0x12')];_0x17569f[_0x0240('0xc')][_0x0240('0x13')]=_0x46041e[_0x0240('0x14')];_0x17569f[_0x0240('0xc')][_0x0240('0x15')]=_0x46041e[_0x0240('0x16')];_0x17569f[_0x0240('0xc')]['customfield_10102']=_0x46041e['ip'];var _0x1db260={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x0240('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x0240('0x18'),'Authorization':_0x0240('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x0240('0x1a')]('base64')}};var _0x5b9215=JSON['stringify'](_0x17569f);var _0x2be986=https[_0x0240('0x1b')](_0x1db260,function(_0x41a27d){_0x41a27d[_0x0240('0x1c')]('utf8');var _0x32acf4='';_0x41a27d['on'](_0x0240('0x1d'),function(_0x55c8ed){_0x32acf4+=_0x55c8ed;});_0x41a27d['on'](_0x0240('0x1e'),function(){if(_0x41bc2e){return _0x41bc2e[_0x0240('0x1f')](_0x41a27d[_0x0240('0x20')])[_0x0240('0x21')](JSON[_0x0240('0x22')](_0x32acf4));}});});_0x2be986['on']('error',function(_0x46e1cc){if(_0x41bc2e){return _0x41bc2e[_0x0240('0x1f')](0x1f4)['json']({'errors':[{'message':_0x0240('0x23'),'type':_0x0240('0x24')}]});}});_0x2be986[_0x0240('0x25')](_0x5b9215);_0x2be986['end']();}exports[_0x0240('0x26')]=openIssue;exports[_0x0240('0x27')]=function(_0x11d594,_0xe1e3d9){_0x11d594[_0x0240('0x28')]['ip']=_0x11d594[_0x0240('0x29')][_0x0240('0x2a')]||_0x11d594[_0x0240('0x2b')][_0x0240('0x2c')]||_0x11d594[_0x0240('0x2d')][_0x0240('0x2c')]||_0x11d594[_0x0240('0x2b')]['socket'][_0x0240('0x2c')];return openIssue(_0x11d594[_0x0240('0x28')],_0xe1e3d9);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 0ea42d1..a237100 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0x559d74,_0x2dcb76){var _0x1ea558=function(_0x2ec5b5){while(--_0x2ec5b5){_0x559d74['push'](_0x559d74['shift']());}};_0x1ea558(++_0x2dcb76);}(_0x668b,0x140));var _0xb668=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0x668b[_0x4cc03b];return _0xf0358c;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x2df316,_0x5d2bf0){var _0x3cbbf6=function(_0x25cc56){while(--_0x25cc56){_0x2df316['push'](_0x2df316['shift']());}};_0x3cbbf6(++_0x5d2bf0);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b428d,_0x21be12){_0x1b428d=_0x1b428d-0x0;var _0x169cf2=_0xedd9[_0x1b428d];return _0x169cf2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 84da9e0..7ca7151 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x57da01,_0x3bf354){_0x57da01=_0x57da01-0x0;var _0x25a2f4=_0x7a54[_0x57da01];return _0x25a2f4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x1378d4,_0x59700a){_0x1378d4=_0x1378d4-0x0;var _0x484996=_0x7a54[_0x1378d4];return _0x484996;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 4b777e3..3d15141 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacd6=['params','rawAttributes','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','then','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','JscriptyAnswerReport','includeAll','findAll','catch','show'];(function(_0x4bf843,_0x4a3906){var _0x129286=function(_0x3ded6d){while(--_0x3ded6d){_0x4bf843['push'](_0x4bf843['shift']());}};_0x129286(++_0x4a3906);}(_0xacd6,0xef));var _0x6acd=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xacd6[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x6acd('0x0'));var rimraf=require(_0x6acd('0x1'));var zipdir=require(_0x6acd('0x2'));var jsonpatch=require(_0x6acd('0x3'));var rp=require(_0x6acd('0x4'));var moment=require(_0x6acd('0x5'));var BPromise=require(_0x6acd('0x6'));var Mustache=require(_0x6acd('0x7'));var util=require(_0x6acd('0x8'));var path=require(_0x6acd('0x9'));var sox=require(_0x6acd('0xa'));var csv=require(_0x6acd('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6acd('0xc'));var _=require(_0x6acd('0xd'));var squel=require(_0x6acd('0xe'));var crypto=require(_0x6acd('0xf'));var jsforce=require(_0x6acd('0x10'));var deskjs=require(_0x6acd('0x11'));var toCsv=require(_0x6acd('0xb'));var querystring=require(_0x6acd('0x12'));var Papa=require('papaparse');var Redis=require(_0x6acd('0x13'));var authService=require(_0x6acd('0x14'));var qs=require(_0x6acd('0x15'));var as=require(_0x6acd('0x16'));var hardwareService=require(_0x6acd('0x17'));var logger=require(_0x6acd('0x18'))(_0x6acd('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6acd('0x1a'));var db=require(_0x6acd('0x1b'))['db'];function respondWithStatusCode(_0x29204d,_0x48bb0b){_0x48bb0b=_0x48bb0b||0xcc;return function(_0x239db0){if(_0x239db0){return _0x29204d[_0x6acd('0x1c')](_0x48bb0b);}return _0x29204d[_0x6acd('0x1d')](_0x48bb0b)[_0x6acd('0x1e')]();};}function respondWithResult(_0x113884,_0x40ad48){_0x40ad48=_0x40ad48||0xc8;return function(_0x1387ab){if(_0x1387ab){return _0x113884[_0x6acd('0x1d')](_0x40ad48)['json'](_0x1387ab);}};}function respondWithFilteredResult(_0x3a8a57,_0x6f0d63){return function(_0x3644f3){if(_0x3644f3){var _0x34da42=typeof _0x6f0d63[_0x6acd('0x1f')]==='undefined'&&typeof _0x6f0d63['limit']===_0x6acd('0x20');var _0x13557f=_0x3644f3['count'];var _0xf0c6f5=_0x34da42?0x0:_0x6f0d63['offset'];var _0x37d7d4=_0x34da42?_0x3644f3[_0x6acd('0x21')]:_0x6f0d63[_0x6acd('0x1f')]+_0x6f0d63[_0x6acd('0x22')];var _0xc01af2;if(_0x37d7d4>=_0x13557f){_0x37d7d4=_0x13557f;_0xc01af2=0xc8;}else{_0xc01af2=0xce;}_0x3a8a57[_0x6acd('0x1d')](_0xc01af2);return _0x3a8a57[_0x6acd('0x23')](_0x6acd('0x24'),_0xf0c6f5+'-'+_0x37d7d4+'/'+_0x13557f)['json'](_0x3644f3);}return null;};}function patchUpdates(_0x3d5a6a){return function(_0x48f328){try{jsonpatch[_0x6acd('0x25')](_0x48f328,_0x3d5a6a,!![]);}catch(_0x31eaec){return BPromise[_0x6acd('0x26')](_0x31eaec);}return _0x48f328['save']();};}function saveUpdates(_0x4f0ed2,_0x42fd36){return function(_0x2d3e2d){if(_0x2d3e2d){return _0x2d3e2d['update'](_0x4f0ed2)[_0x6acd('0x27')](function(_0x5ebc86){return _0x5ebc86;});}return null;};}function removeEntity(_0x5f17af,_0x3596ae){return function(_0x40dde8){if(_0x40dde8){return _0x40dde8['destroy']()[_0x6acd('0x27')](function(){_0x5f17af['status'](0xcc)[_0x6acd('0x1e')]();});}};}function handleEntityNotFound(_0xa57e4d,_0x25d47b){return function(_0x48ce7b){if(!_0x48ce7b){_0xa57e4d[_0x6acd('0x1c')](0x194);}return _0x48ce7b;};}function handleError(_0x2b8160,_0x97fa14){_0x97fa14=_0x97fa14||0x1f4;return function(_0x67289e){logger[_0x6acd('0x28')](_0x67289e[_0x6acd('0x29')]);if(_0x67289e[_0x6acd('0x2a')]){delete _0x67289e['name'];}_0x2b8160[_0x6acd('0x1d')](_0x97fa14)[_0x6acd('0x2b')](_0x67289e);};}exports['index']=function(_0x229269,_0x5bc3cb){var _0x535e0a={},_0x50239c={},_0x1ff700={'count':0x0,'rows':[]};var _0x3556c4=_[_0x6acd('0x2c')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x1187c4){return{'name':_0x1187c4[_0x6acd('0x2d')],'type':_0x1187c4['type'][_0x6acd('0x2e')]};});_0x50239c[_0x6acd('0x2f')]=_['map'](_0x3556c4,_0x6acd('0x2a'));_0x50239c[_0x6acd('0x30')]=_[_0x6acd('0x31')](_0x229269['query']);_0x50239c[_0x6acd('0x32')]=_[_0x6acd('0x33')](_0x50239c[_0x6acd('0x2f')],_0x50239c[_0x6acd('0x30')]);_0x535e0a['attributes']=_['intersection'](_0x50239c['model'],qs[_0x6acd('0x34')](_0x229269['query'][_0x6acd('0x34')]));_0x535e0a['attributes']=_0x535e0a['attributes'][_0x6acd('0x35')]?_0x535e0a[_0x6acd('0x36')]:_0x50239c[_0x6acd('0x2f')];if(!_0x229269['query'][_0x6acd('0x37')]('nolimit')){_0x535e0a[_0x6acd('0x22')]=qs[_0x6acd('0x22')](_0x229269[_0x6acd('0x30')][_0x6acd('0x22')]);_0x535e0a[_0x6acd('0x1f')]=qs[_0x6acd('0x1f')](_0x229269[_0x6acd('0x30')][_0x6acd('0x1f')]);}_0x535e0a[_0x6acd('0x38')]=qs[_0x6acd('0x39')](_0x229269[_0x6acd('0x30')][_0x6acd('0x39')]);_0x535e0a[_0x6acd('0x3a')]=qs['filters'](_[_0x6acd('0x3b')](_0x229269[_0x6acd('0x30')],_0x50239c[_0x6acd('0x32')]),_0x3556c4);if(_0x229269['query'][_0x6acd('0x3c')]){_0x535e0a[_0x6acd('0x3a')]=_[_0x6acd('0x3d')](_0x535e0a[_0x6acd('0x3a')],{'$or':_[_0x6acd('0x2c')](_0x3556c4,function(_0x36b417){if(_0x36b417[_0x6acd('0x3e')]!=='VIRTUAL'){var _0x2a309e={};_0x2a309e[_0x36b417[_0x6acd('0x2a')]]={'$like':'%'+_0x229269[_0x6acd('0x30')]['filter']+'%'};return _0x2a309e;}})});}_0x535e0a=_[_0x6acd('0x3d')]({},_0x535e0a,_0x229269[_0x6acd('0x3f')]);var _0x9ce15={'where':_0x535e0a[_0x6acd('0x3a')]};return db[_0x6acd('0x40')][_0x6acd('0x21')](_0x9ce15)[_0x6acd('0x27')](function(_0xb012ef){_0x1ff700[_0x6acd('0x21')]=_0xb012ef;if(_0x229269[_0x6acd('0x30')][_0x6acd('0x41')]){_0x535e0a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6acd('0x42')](_0x535e0a);})[_0x6acd('0x27')](function(_0x193284){_0x1ff700['rows']=_0x193284;return _0x1ff700;})[_0x6acd('0x27')](respondWithFilteredResult(_0x5bc3cb,_0x535e0a))[_0x6acd('0x43')](handleError(_0x5bc3cb,null));};exports[_0x6acd('0x44')]=function(_0x1b53b5,_0x2deac6){var _0x498080={'raw':!![],'where':{'id':_0x1b53b5[_0x6acd('0x45')]['id']}},_0x565efa={};_0x565efa[_0x6acd('0x2f')]=_[_0x6acd('0x31')](db[_0x6acd('0x40')][_0x6acd('0x46')]);_0x565efa['query']=_[_0x6acd('0x31')](_0x1b53b5[_0x6acd('0x30')]);_0x565efa[_0x6acd('0x32')]=_[_0x6acd('0x33')](_0x565efa['model'],_0x565efa[_0x6acd('0x30')]);_0x498080[_0x6acd('0x36')]=_[_0x6acd('0x33')](_0x565efa[_0x6acd('0x2f')],qs[_0x6acd('0x34')](_0x1b53b5['query'][_0x6acd('0x34')]));_0x498080['attributes']=_0x498080[_0x6acd('0x36')][_0x6acd('0x35')]?_0x498080[_0x6acd('0x36')]:_0x565efa[_0x6acd('0x2f')];if(_0x1b53b5['query'][_0x6acd('0x41')]){_0x498080[_0x6acd('0x47')]=[{'all':!![]}];}_0x498080=_[_0x6acd('0x3d')]({},_0x498080,_0x1b53b5[_0x6acd('0x3f')]);return db[_0x6acd('0x40')][_0x6acd('0x48')](_0x498080)['then'](handleEntityNotFound(_0x2deac6,null))[_0x6acd('0x27')](respondWithResult(_0x2deac6,null))[_0x6acd('0x43')](handleError(_0x2deac6,null));};exports[_0x6acd('0x49')]=function(_0x5a30e0,_0x351bd3){return db[_0x6acd('0x40')][_0x6acd('0x49')](_0x5a30e0[_0x6acd('0x4a')],{})['then'](respondWithResult(_0x351bd3,0xc9))[_0x6acd('0x43')](handleError(_0x351bd3,null));};exports['update']=function(_0x276fb1,_0x1bc305){if(_0x276fb1[_0x6acd('0x4a')]['id']){delete _0x276fb1[_0x6acd('0x4a')]['id'];}return db[_0x6acd('0x40')][_0x6acd('0x48')]({'where':{'id':_0x276fb1[_0x6acd('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bc305,null))[_0x6acd('0x27')](saveUpdates(_0x276fb1[_0x6acd('0x4a')],null))['then'](respondWithResult(_0x1bc305,null))[_0x6acd('0x43')](handleError(_0x1bc305,null));};exports[_0x6acd('0x4b')]=function(_0x2b3867,_0x3c076f){return db['JscriptyAnswerReport'][_0x6acd('0x48')]({'where':{'id':_0x2b3867[_0x6acd('0x45')]['id']}})[_0x6acd('0x27')](handleEntityNotFound(_0x3c076f,null))[_0x6acd('0x27')](removeEntity(_0x3c076f,null))[_0x6acd('0x43')](handleError(_0x3c076f,null));};exports[_0x6acd('0x4c')]=function(_0x1b7ab3,_0x297253){return db[_0x6acd('0x40')]['describe']()['then'](respondWithResult(_0x297253,null))[_0x6acd('0x43')](handleError(_0x297253,null));}; \ No newline at end of file +var _0x972c=['attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','intersection','fields'];(function(_0x4d1bac,_0x57a98f){var _0x38825c=function(_0x14499a){while(--_0x14499a){_0x4d1bac['push'](_0x4d1bac['shift']());}};_0x38825c(++_0x57a98f);}(_0x972c,0xf2));var _0xc972=function(_0x280c75,_0x35e0fa){_0x280c75=_0x280c75-0x0;var _0x68ca94=_0x972c[_0x280c75];return _0x68ca94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc972('0x0'));var jsonpatch=require(_0xc972('0x1'));var rp=require('request-promise');var moment=require(_0xc972('0x2'));var BPromise=require(_0xc972('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc972('0x4'));var sox=require(_0xc972('0x5'));var csv=require(_0xc972('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc972('0x7'));var _=require('lodash');var squel=require(_0xc972('0x8'));var crypto=require(_0xc972('0x9'));var jsforce=require(_0xc972('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc972('0xb'));var Redis=require('ioredis');var authService=require(_0xc972('0xc'));var qs=require(_0xc972('0xd'));var as=require(_0xc972('0xe'));var hardwareService=require(_0xc972('0xf'));var logger=require(_0xc972('0x10'))(_0xc972('0x11'));var utils=require(_0xc972('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc972('0x13'));var db=require(_0xc972('0x14'))['db'];function respondWithStatusCode(_0x27851c,_0x5829ab){_0x5829ab=_0x5829ab||0xcc;return function(_0x3623ca){if(_0x3623ca){return _0x27851c[_0xc972('0x15')](_0x5829ab);}return _0x27851c[_0xc972('0x16')](_0x5829ab)['end']();};}function respondWithResult(_0x37786e,_0x298f92){_0x298f92=_0x298f92||0xc8;return function(_0x3aa39d){if(_0x3aa39d){return _0x37786e[_0xc972('0x16')](_0x298f92)['json'](_0x3aa39d);}};}function respondWithFilteredResult(_0x665f8f,_0x3d519e){return function(_0x2b20d2){if(_0x2b20d2){var _0x341564=typeof _0x3d519e[_0xc972('0x17')]===_0xc972('0x18')&&typeof _0x3d519e[_0xc972('0x19')]===_0xc972('0x18');var _0x3a7521=_0x2b20d2[_0xc972('0x1a')];var _0x2bfe0e=_0x341564?0x0:_0x3d519e[_0xc972('0x17')];var _0x214417=_0x341564?_0x2b20d2[_0xc972('0x1a')]:_0x3d519e[_0xc972('0x17')]+_0x3d519e[_0xc972('0x19')];var _0x4a2b5f;if(_0x214417>=_0x3a7521){_0x214417=_0x3a7521;_0x4a2b5f=0xc8;}else{_0x4a2b5f=0xce;}_0x665f8f[_0xc972('0x16')](_0x4a2b5f);return _0x665f8f[_0xc972('0x1b')](_0xc972('0x1c'),_0x2bfe0e+'-'+_0x214417+'/'+_0x3a7521)[_0xc972('0x1d')](_0x2b20d2);}return null;};}function patchUpdates(_0x486340){return function(_0x5e1b06){try{jsonpatch[_0xc972('0x1e')](_0x5e1b06,_0x486340,!![]);}catch(_0x3c4b7c){return BPromise['reject'](_0x3c4b7c);}return _0x5e1b06[_0xc972('0x1f')]();};}function saveUpdates(_0x3fdacf,_0x10c6ce){return function(_0x331338){if(_0x331338){return _0x331338[_0xc972('0x20')](_0x3fdacf)[_0xc972('0x21')](function(_0x59cae4){return _0x59cae4;});}return null;};}function removeEntity(_0x11a9f1,_0x5d11e4){return function(_0x5f0c94){if(_0x5f0c94){return _0x5f0c94[_0xc972('0x22')]()[_0xc972('0x21')](function(){_0x11a9f1[_0xc972('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9bed,_0x47332e){return function(_0xf115da){if(!_0xf115da){_0x1f9bed[_0xc972('0x15')](0x194);}return _0xf115da;};}function handleError(_0x228f99,_0x2497d9){_0x2497d9=_0x2497d9||0x1f4;return function(_0x33ced1){logger[_0xc972('0x23')](_0x33ced1[_0xc972('0x24')]);if(_0x33ced1[_0xc972('0x25')]){delete _0x33ced1[_0xc972('0x25')];}_0x228f99[_0xc972('0x16')](_0x2497d9)[_0xc972('0x26')](_0x33ced1);};}exports[_0xc972('0x27')]=function(_0x5ad71d,_0x1203a8){var _0x481026={},_0x164d52={},_0x4efef1={'count':0x0,'rows':[]};var _0x26aa4c=_[_0xc972('0x28')](db[_0xc972('0x29')][_0xc972('0x2a')],function(_0x166779){return{'name':_0x166779['fieldName'],'type':_0x166779[_0xc972('0x2b')][_0xc972('0x2c')]};});_0x164d52[_0xc972('0x2d')]=_[_0xc972('0x28')](_0x26aa4c,'name');_0x164d52[_0xc972('0x2e')]=_[_0xc972('0x2f')](_0x5ad71d['query']);_0x164d52['filters']=_['intersection'](_0x164d52['model'],_0x164d52[_0xc972('0x2e')]);_0x481026['attributes']=_[_0xc972('0x30')](_0x164d52['model'],qs['fields'](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x31')]));_0x481026[_0xc972('0x32')]=_0x481026['attributes'][_0xc972('0x33')]?_0x481026['attributes']:_0x164d52[_0xc972('0x2d')];if(!_0x5ad71d[_0xc972('0x2e')]['hasOwnProperty'](_0xc972('0x34'))){_0x481026[_0xc972('0x19')]=qs[_0xc972('0x19')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x19')]);_0x481026[_0xc972('0x17')]=qs[_0xc972('0x17')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x17')]);}_0x481026[_0xc972('0x35')]=qs[_0xc972('0x36')](_0x5ad71d[_0xc972('0x2e')][_0xc972('0x36')]);_0x481026[_0xc972('0x37')]=qs[_0xc972('0x38')](_[_0xc972('0x39')](_0x5ad71d[_0xc972('0x2e')],_0x164d52[_0xc972('0x38')]),_0x26aa4c);if(_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3a')]){_0x481026[_0xc972('0x37')]=_['merge'](_0x481026[_0xc972('0x37')],{'$or':_[_0xc972('0x28')](_0x26aa4c,function(_0x4880f7){if(_0x4880f7[_0xc972('0x2b')]!==_0xc972('0x3b')){var _0x255fcf={};_0x255fcf[_0x4880f7[_0xc972('0x25')]]={'$like':'%'+_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3a')]+'%'};return _0x255fcf;}})});}_0x481026=_[_0xc972('0x3c')]({},_0x481026,_0x5ad71d[_0xc972('0x3d')]);var _0x4bb412={'where':_0x481026[_0xc972('0x37')]};return db[_0xc972('0x29')]['count'](_0x4bb412)[_0xc972('0x21')](function(_0x1bc249){_0x4efef1[_0xc972('0x1a')]=_0x1bc249;if(_0x5ad71d[_0xc972('0x2e')][_0xc972('0x3e')]){_0x481026['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc972('0x3f')](_0x481026);})[_0xc972('0x21')](function(_0x483f11){_0x4efef1[_0xc972('0x40')]=_0x483f11;return _0x4efef1;})[_0xc972('0x21')](respondWithFilteredResult(_0x1203a8,_0x481026))[_0xc972('0x41')](handleError(_0x1203a8,null));};exports[_0xc972('0x42')]=function(_0x3edc1e,_0x498a43){var _0x1f0d3f={'raw':!![],'where':{'id':_0x3edc1e[_0xc972('0x43')]['id']}},_0x21830b={};_0x21830b[_0xc972('0x2d')]=_[_0xc972('0x2f')](db[_0xc972('0x29')][_0xc972('0x2a')]);_0x21830b[_0xc972('0x2e')]=_[_0xc972('0x2f')](_0x3edc1e['query']);_0x21830b[_0xc972('0x38')]=_[_0xc972('0x30')](_0x21830b['model'],_0x21830b['query']);_0x1f0d3f['attributes']=_['intersection'](_0x21830b[_0xc972('0x2d')],qs[_0xc972('0x31')](_0x3edc1e[_0xc972('0x2e')][_0xc972('0x31')]));_0x1f0d3f[_0xc972('0x32')]=_0x1f0d3f[_0xc972('0x32')][_0xc972('0x33')]?_0x1f0d3f[_0xc972('0x32')]:_0x21830b['model'];if(_0x3edc1e[_0xc972('0x2e')][_0xc972('0x3e')]){_0x1f0d3f[_0xc972('0x44')]=[{'all':!![]}];}_0x1f0d3f=_[_0xc972('0x3c')]({},_0x1f0d3f,_0x3edc1e[_0xc972('0x3d')]);return db[_0xc972('0x29')][_0xc972('0x45')](_0x1f0d3f)['then'](handleEntityNotFound(_0x498a43,null))[_0xc972('0x21')](respondWithResult(_0x498a43,null))[_0xc972('0x41')](handleError(_0x498a43,null));};exports['create']=function(_0x48bcbf,_0x215e81){return db['JscriptyAnswerReport'][_0xc972('0x46')](_0x48bcbf[_0xc972('0x47')],{})[_0xc972('0x21')](respondWithResult(_0x215e81,0xc9))[_0xc972('0x41')](handleError(_0x215e81,null));};exports[_0xc972('0x20')]=function(_0x2e921d,_0x2e2afe){if(_0x2e921d['body']['id']){delete _0x2e921d[_0xc972('0x47')]['id'];}return db[_0xc972('0x29')]['find']({'where':{'id':_0x2e921d[_0xc972('0x43')]['id']}})[_0xc972('0x21')](handleEntityNotFound(_0x2e2afe,null))[_0xc972('0x21')](saveUpdates(_0x2e921d[_0xc972('0x47')],null))['then'](respondWithResult(_0x2e2afe,null))['catch'](handleError(_0x2e2afe,null));};exports[_0xc972('0x22')]=function(_0x384ff4,_0x398be7){return db[_0xc972('0x29')][_0xc972('0x45')]({'where':{'id':_0x384ff4[_0xc972('0x43')]['id']}})['then'](handleEntityNotFound(_0x398be7,null))[_0xc972('0x21')](removeEntity(_0x398be7,null))[_0xc972('0x41')](handleError(_0x398be7,null));};exports[_0xc972('0x48')]=function(_0x52f9fd,_0x35fadd){return db[_0xc972('0x29')]['describe']()['then'](respondWithResult(_0x35fadd,null))[_0xc972('0x41')](handleError(_0x35fadd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 44acfee..6236e88 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf23=['JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xdf23,0x1be));var _0x3df2=function(_0x2fd65a,_0x1c5e5e){_0x2fd65a=_0x2fd65a-0x0;var _0x24a0f5=_0xdf23[_0x2fd65a];return _0x24a0f5;};'use strict';var _=require('lodash');var util=require(_0x3df2('0x0'));var logger=require(_0x3df2('0x1'))(_0x3df2('0x2'));var moment=require(_0x3df2('0x3'));var BPromise=require('bluebird');var rp=require(_0x3df2('0x4'));var fs=require('fs');var path=require(_0x3df2('0x5'));var rimraf=require(_0x3df2('0x6'));var config=require(_0x3df2('0x7'));var attributes=require(_0x3df2('0x8'));module[_0x3df2('0x9')]=function(_0x150d95,_0x436210){return _0x150d95['define'](_0x3df2('0xa'),attributes,{'tableName':_0x3df2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd14c=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xd14c,0xf4));var _0xcd14=function(_0x5b3d42,_0x859490){_0x5b3d42=_0x5b3d42-0x0;var _0xe55cc4=_0xd14c[_0x5b3d42];return _0xe55cc4;};'use strict';var _=require(_0xcd14('0x0'));var util=require(_0xcd14('0x1'));var logger=require(_0xcd14('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcd14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd14('0x4'));var rimraf=require(_0xcd14('0x5'));var config=require(_0xcd14('0x6'));var attributes=require(_0xcd14('0x7'));module[_0xcd14('0x8')]=function(_0x4d05a0,_0x5d825d){return _0x4d05a0[_0xcd14('0x9')](_0xcd14('0xa'),attributes,{'tableName':_0xcd14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 6bc81cb..6369bc9 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc19a=['http','request','then','debug','request\x20sent','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d5d88,_0x48a787){var _0x1a2e77=function(_0x2cf1df){while(--_0x2cf1df){_0x1d5d88['push'](_0x1d5d88['shift']());}};_0x1a2e77(++_0x48a787);}(_0xc19a,0xf3));var _0xac19=function(_0x2dc7f2,_0x4f37b8){_0x2dc7f2=_0x2dc7f2-0x0;var _0xeba275=_0xc19a[_0x2dc7f2];return _0xeba275;};'use strict';var _=require(_0xac19('0x0'));var util=require('util');var moment=require(_0xac19('0x1'));var BPromise=require('bluebird');var rs=require(_0xac19('0x2'));var fs=require('fs');var Redis=require(_0xac19('0x3'));var db=require(_0xac19('0x4'))['db'];var utils=require(_0xac19('0x5'));var logger=require('../../config/logger')(_0xac19('0x6'));var config=require(_0xac19('0x7'));var jayson=require(_0xac19('0x8'));var client=jayson[_0xac19('0x9')][_0xac19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ce0a9,_0x108de1,_0x434435){return new BPromise(function(_0x81033d,_0x976763){return client[_0xac19('0xb')](_0x4ce0a9,_0x434435)[_0xac19('0xc')](function(_0x59a828){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x108de1,'request\x20sent');logger[_0xac19('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x108de1,_0xac19('0xe'),JSON[_0xac19('0xf')](_0x59a828));if(_0x59a828[_0xac19('0x10')]){if(_0x59a828[_0xac19('0x10')][_0xac19('0x11')]===0x1f4){logger[_0xac19('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x108de1,_0x59a828[_0xac19('0x10')][_0xac19('0x12')]);return _0x976763(_0x59a828['error'][_0xac19('0x12')]);}logger['error'](_0xac19('0x13'),_0x108de1,_0x59a828[_0xac19('0x10')]['message']);return _0x81033d(_0x59a828[_0xac19('0x10')]['message']);}else{logger[_0xac19('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x108de1,'request\x20sent');_0x81033d(_0x59a828[_0xac19('0x15')][_0xac19('0x12')]);}})[_0xac19('0x16')](function(_0xb592ff){logger[_0xac19('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x108de1,_0xb592ff);_0x976763(_0xb592ff);});});} \ No newline at end of file +var _0x724e=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0xbe65d3,_0x1a4d56){var _0x4a7f60=function(_0x100bd3){while(--_0x100bd3){_0xbe65d3['push'](_0xbe65d3['shift']());}};_0x4a7f60(++_0x1a4d56);}(_0x724e,0x8c));var _0xe724=function(_0x11dab3,_0x46b940){_0x11dab3=_0x11dab3-0x0;var _0x97dfbe=_0x724e[_0x11dab3];return _0x97dfbe;};'use strict';var _=require(_0xe724('0x0'));var util=require('util');var moment=require(_0xe724('0x1'));var BPromise=require(_0xe724('0x2'));var rs=require(_0xe724('0x3'));var fs=require('fs');var Redis=require(_0xe724('0x4'));var db=require(_0xe724('0x5'))['db'];var utils=require(_0xe724('0x6'));var logger=require(_0xe724('0x7'))(_0xe724('0x8'));var config=require(_0xe724('0x9'));var jayson=require(_0xe724('0xa'));var client=jayson[_0xe724('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58bc2e,_0x3e6a00,_0x32a8ef){return new BPromise(function(_0x196ec0,_0x3602d9){return client['request'](_0x58bc2e,_0x32a8ef)['then'](function(_0x1b3cc0){logger[_0xe724('0xc')](_0xe724('0xd'),_0x3e6a00,'request\x20sent');logger[_0xe724('0xe')](_0xe724('0xf'),_0x3e6a00,'request\x20sent',JSON['stringify'](_0x1b3cc0));if(_0x1b3cc0['error']){if(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x11')]===0x1f4){logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);return _0x3602d9(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);}logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x1b3cc0[_0xe724('0x10')]['message']);return _0x196ec0(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);}else{logger['info'](_0xe724('0xd'),_0x3e6a00,_0xe724('0x13'));_0x196ec0(_0x1b3cc0[_0xe724('0x14')][_0xe724('0x12')]);}})[_0xe724('0x15')](function(_0x46b70b){logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x46b70b);_0x3602d9(_0x46b70b);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 39e93e9..da4f06c 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3517=['/:id/clone','clone','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get','show','/:id/sessions','isAuthenticated','getSessions','getAnswers','/:id/summary','getSummary','post','create'];(function(_0x3f6b67,_0x2736d1){var _0x3d2b4c=function(_0x402dd4){while(--_0x402dd4){_0x3f6b67['push'](_0x3f6b67['shift']());}};_0x3d2b4c(++_0x2736d1);}(_0x3517,0x18d));var _0x7351=function(_0x4b0948,_0x7dd5c2){_0x4b0948=_0x4b0948-0x0;var _0x2e240a=_0x3517[_0x4b0948];return _0x2e240a;};'use strict';var multer=require('multer');var util=require(_0x7351('0x0'));var path=require(_0x7351('0x1'));var timeout=require(_0x7351('0x2'));var express=require('express');var router=express[_0x7351('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7351('0x4'));var interaction=require(_0x7351('0x5'));var config=require(_0x7351('0x6'));var controller=require(_0x7351('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7351('0x8')]);router[_0x7351('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7351('0xa')]);router['get'](_0x7351('0xb'),auth[_0x7351('0xc')](),controller[_0x7351('0xd')]);router[_0x7351('0x9')]('/:id/answers',auth[_0x7351('0xc')](),controller[_0x7351('0xe')]);router[_0x7351('0x9')](_0x7351('0xf'),auth[_0x7351('0xc')](),timeout('30s'),controller[_0x7351('0x10')]);router[_0x7351('0x11')]('/',auth[_0x7351('0xc')](),controller[_0x7351('0x12')]);router[_0x7351('0x11')](_0x7351('0x13'),auth['isAuthenticated'](),controller[_0x7351('0x14')]);router[_0x7351('0x15')](_0x7351('0x16'),auth[_0x7351('0xc')](),controller[_0x7351('0x17')]);router['delete'](_0x7351('0x16'),auth['isAuthenticated'](),controller[_0x7351('0x18')]);module[_0x7351('0x19')]=router; \ No newline at end of file +var _0x2456=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','getSessions','/:id/answers','/:id/summary','30s','getSummary','create','post','clone','put','update','delete','destroy','exports','multer','path','Router'];(function(_0x5418a4,_0x4f74b8){var _0x53c06a=function(_0x5d8c40){while(--_0x5d8c40){_0x5418a4['push'](_0x5418a4['shift']());}};_0x53c06a(++_0x4f74b8);}(_0x2456,0xbd));var _0x6245=function(_0x131c69,_0x55102b){_0x131c69=_0x131c69-0x0;var _0x1c57e6=_0x2456[_0x131c69];return _0x1c57e6;};'use strict';var multer=require(_0x6245('0x0'));var util=require('util');var path=require(_0x6245('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6245('0x2')]();var fs_extra=require(_0x6245('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6245('0x4'));var config=require(_0x6245('0x5'));var controller=require('./jscriptyProject.controller');router[_0x6245('0x6')]('/',auth['isAuthenticated'](),controller[_0x6245('0x7')]);router[_0x6245('0x6')](_0x6245('0x8'),auth['isAuthenticated'](),controller[_0x6245('0x9')]);router['get']('/:id/sessions',auth[_0x6245('0xa')](),controller[_0x6245('0xb')]);router[_0x6245('0x6')](_0x6245('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x6245('0x6')](_0x6245('0xd'),auth['isAuthenticated'](),timeout(_0x6245('0xe')),controller[_0x6245('0xf')]);router['post']('/',auth[_0x6245('0xa')](),controller[_0x6245('0x10')]);router[_0x6245('0x11')]('/:id/clone',auth[_0x6245('0xa')](),controller[_0x6245('0x12')]);router[_0x6245('0x13')](_0x6245('0x8'),auth[_0x6245('0xa')](),controller[_0x6245('0x14')]);router[_0x6245('0x15')](_0x6245('0x8'),auth['isAuthenticated'](),controller[_0x6245('0x16')]);module[_0x6245('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8934461..9bf6991 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5e5=['BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','formData','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xc5e5,0x6a));var _0x5c5e=function(_0x4f6653,_0x5b6c88){_0x4f6653=_0x4f6653-0x0;var _0x2c6e80=_0xc5e5[_0x4f6653];return _0x2c6e80;};'use strict';var Sequelize=require(_0x5c5e('0x0'));var _=require(_0x5c5e('0x1'));var util=require('util');module[_0x5c5e('0x2')]={'name':{'type':Sequelize[_0x5c5e('0x3')],'unique':_0x5c5e('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5c5e('0x5')](_0x5c5e('0x6')),'set':function(_0x270a56){if(_[_0x5c5e('0x7')](_0x270a56)){this['setDataValue'](_0x5c5e('0x8'),JSON['stringify'](_0x270a56));}else if(_['isString'](_0x270a56)){this[_0x5c5e('0x9')](_0x5c5e('0x8'),_0x270a56);}else{this[_0x5c5e('0x9')](_0x5c5e('0x8'),util[_0x5c5e('0xa')](_0x5c5e('0xb'),this[_0x5c5e('0xc')](_0x5c5e('0x4'))||'',this[_0x5c5e('0xc')](_0x5c5e('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5c5e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5c5e('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x281e=['BOOLEAN','sequelize','util','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','getDataValue'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x281e,0x160));var _0xe281=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x281e[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xe281('0x0'));var _=require('lodash');var util=require(_0xe281('0x1'));module['exports']={'name':{'type':Sequelize[_0xe281('0x2')],'unique':_0xe281('0x3')},'description':{'type':Sequelize[_0xe281('0x2')]},'formData':{'type':Sequelize[_0xe281('0x4')](_0xe281('0x5')),'set':function(_0x34d3f3){if(_[_0xe281('0x6')](_0x34d3f3)){this[_0xe281('0x7')](_0xe281('0x8'),JSON[_0xe281('0x9')](_0x34d3f3));}else if(_[_0xe281('0xa')](_0x34d3f3)){this[_0xe281('0x7')](_0xe281('0x8'),_0x34d3f3);}else{this[_0xe281('0x7')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xe281('0xb')](_0xe281('0x3'))||'',this[_0xe281('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe281('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe281('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index dc311e8..8771ac3 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00f4=['query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','autoAssociation','getSessions','findOne','JscriptySessionReport','getAnswers','nolimit','ProjectId','JscriptyAnswerReport','fromCharCode','apply','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','destroy','get','Projects','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys'];(function(_0x49a458,_0x3a1c94){var _0x146862=function(_0x4b2529){while(--_0x4b2529){_0x49a458['push'](_0x49a458['shift']());}};_0x146862(++_0x3a1c94);}(_0x00f4,0x137));var _0x400f=function(_0x406841,_0x3df1d0){_0x406841=_0x406841-0x0;var _0x517ea6=_0x00f4[_0x406841];return _0x517ea6;};'use strict';var emlformat=require(_0x400f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x400f('0x1'));var jsonpatch=require(_0x400f('0x2'));var rp=require(_0x400f('0x3'));var moment=require(_0x400f('0x4'));var BPromise=require(_0x400f('0x5'));var Mustache=require(_0x400f('0x6'));var util=require(_0x400f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x400f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x400f('0x9'));var _=require(_0x400f('0xa'));var squel=require(_0x400f('0xb'));var crypto=require(_0x400f('0xc'));var jsforce=require(_0x400f('0xd'));var deskjs=require(_0x400f('0xe'));var toCsv=require(_0x400f('0x8'));var querystring=require('querystring');var Papa=require(_0x400f('0xf'));var Redis=require(_0x400f('0x10'));var authService=require(_0x400f('0x11'));var qs=require(_0x400f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x400f('0x13'));var logger=require(_0x400f('0x14'))('api');var utils=require(_0x400f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x400f('0x16'));var db=require(_0x400f('0x17'))['db'];function respondWithStatusCode(_0x29b1c4,_0x439014){_0x439014=_0x439014||0xcc;return function(_0x5bd038){if(_0x5bd038){return _0x29b1c4['sendStatus'](_0x439014);}return _0x29b1c4['status'](_0x439014)[_0x400f('0x18')]();};}function respondWithResult(_0x1a457d,_0x1971a3){_0x1971a3=_0x1971a3||0xc8;return function(_0x1c0d02){if(_0x1c0d02){return _0x1a457d['status'](_0x1971a3)[_0x400f('0x19')](_0x1c0d02);}};}function respondWithFilteredResult(_0x113c15,_0x3106ed){return function(_0x40f275){if(_0x40f275){var _0xcb1fc5=typeof _0x3106ed['offset']===_0x400f('0x1a')&&typeof _0x3106ed[_0x400f('0x1b')]==='undefined';var _0x574058=_0x40f275[_0x400f('0x1c')];var _0x57864b=_0xcb1fc5?0x0:_0x3106ed[_0x400f('0x1d')];var _0x43300a=_0xcb1fc5?_0x40f275[_0x400f('0x1c')]:_0x3106ed[_0x400f('0x1d')]+_0x3106ed['limit'];var _0x165116;if(_0x43300a>=_0x574058){_0x43300a=_0x574058;_0x165116=0xc8;}else{_0x165116=0xce;}_0x113c15[_0x400f('0x1e')](_0x165116);return _0x113c15[_0x400f('0x1f')](_0x400f('0x20'),_0x57864b+'-'+_0x43300a+'/'+_0x574058)[_0x400f('0x19')](_0x40f275);}return null;};}function patchUpdates(_0x1245ef){return function(_0x263b4c){try{jsonpatch['apply'](_0x263b4c,_0x1245ef,!![]);}catch(_0x197aee){return BPromise[_0x400f('0x21')](_0x197aee);}return _0x263b4c[_0x400f('0x22')]();};}function saveUpdates(_0x39c25f,_0xf561af){return function(_0x1ad9ee){if(_0x1ad9ee){return _0x1ad9ee[_0x400f('0x23')](_0x39c25f)[_0x400f('0x24')](function(_0x2399b2){return _0x2399b2;});}return null;};}function removeEntity(_0x5b5bba,_0x5c7f44){return function(_0xfe8997){if(_0xfe8997){return _0xfe8997[_0x400f('0x25')]()[_0x400f('0x24')](function(){var _0x1173d1=_0xfe8997[_0x400f('0x26')]({'plain':!![]});var _0xf2ecb3=_0x400f('0x27');return db['UserProfileResource'][_0x400f('0x25')]({'where':{'type':_0xf2ecb3,'resourceId':_0x1173d1['id']}})[_0x400f('0x24')](function(){return _0xfe8997;});})[_0x400f('0x24')](function(){_0x5b5bba[_0x400f('0x1e')](0xcc)[_0x400f('0x18')]();});}};}function handleEntityNotFound(_0x1b62be,_0x359257){return function(_0x3c0efe){if(!_0x3c0efe){_0x1b62be[_0x400f('0x28')](0x194);}return _0x3c0efe;};}function handleError(_0x1d324a,_0x4261a7){_0x4261a7=_0x4261a7||0x1f4;return function(_0x5c52f2){logger[_0x400f('0x29')](_0x5c52f2[_0x400f('0x2a')]);if(_0x5c52f2[_0x400f('0x2b')]){delete _0x5c52f2['name'];}_0x1d324a['status'](_0x4261a7)[_0x400f('0x2c')](_0x5c52f2);};}exports[_0x400f('0x2d')]=function(_0x2abe7b,_0x11f18f){var _0x214550={},_0x218c58={},_0x1a7a42={'count':0x0,'rows':[]};var _0x370b67=_['map'](db['JscriptyProject'][_0x400f('0x2e')],function(_0x25dac7){return{'name':_0x25dac7[_0x400f('0x2f')],'type':_0x25dac7[_0x400f('0x30')][_0x400f('0x31')]};});_0x218c58['model']=_[_0x400f('0x32')](_0x370b67,_0x400f('0x2b'));_0x218c58['query']=_[_0x400f('0x33')](_0x2abe7b[_0x400f('0x34')]);_0x218c58[_0x400f('0x35')]=_['intersection'](_0x218c58[_0x400f('0x36')],_0x218c58[_0x400f('0x34')]);_0x214550[_0x400f('0x37')]=_[_0x400f('0x38')](_0x218c58[_0x400f('0x36')],qs[_0x400f('0x39')](_0x2abe7b[_0x400f('0x34')][_0x400f('0x39')]));_0x214550[_0x400f('0x37')]=_0x214550[_0x400f('0x37')]['length']?_0x214550[_0x400f('0x37')]:_0x218c58[_0x400f('0x36')];if(!_0x2abe7b[_0x400f('0x34')][_0x400f('0x3a')]('nolimit')){_0x214550['limit']=qs['limit'](_0x2abe7b[_0x400f('0x34')][_0x400f('0x1b')]);_0x214550[_0x400f('0x1d')]=qs['offset'](_0x2abe7b['query'][_0x400f('0x1d')]);}_0x214550[_0x400f('0x3b')]=qs[_0x400f('0x3c')](_0x2abe7b[_0x400f('0x34')][_0x400f('0x3c')]);_0x214550['where']=qs[_0x400f('0x35')](_[_0x400f('0x3d')](_0x2abe7b[_0x400f('0x34')],_0x218c58['filters']),_0x370b67);if(_0x2abe7b[_0x400f('0x34')][_0x400f('0x3e')]){_0x214550[_0x400f('0x3f')]=_[_0x400f('0x40')](_0x214550[_0x400f('0x3f')],{'$or':_[_0x400f('0x32')](_0x370b67,function(_0x379676){if(_0x379676[_0x400f('0x30')]!==_0x400f('0x41')){var _0x223157={};_0x223157[_0x379676['name']]={'$like':'%'+_0x2abe7b[_0x400f('0x34')][_0x400f('0x3e')]+'%'};return _0x223157;}})});}_0x214550=_[_0x400f('0x40')]({},_0x214550,_0x2abe7b[_0x400f('0x42')]);var _0xfce289={'where':_0x214550[_0x400f('0x3f')]};return db[_0x400f('0x43')][_0x400f('0x1c')](_0xfce289)[_0x400f('0x24')](function(_0x261956){_0x1a7a42['count']=_0x261956;if(_0x2abe7b[_0x400f('0x34')][_0x400f('0x44')]){_0x214550['include']=[{'all':!![]}];}return db[_0x400f('0x43')][_0x400f('0x45')](_0x214550);})[_0x400f('0x24')](function(_0x334f53){_0x1a7a42[_0x400f('0x46')]=_0x334f53;return _0x1a7a42;})['then'](respondWithFilteredResult(_0x11f18f,_0x214550))['catch'](handleError(_0x11f18f,null));};exports[_0x400f('0x47')]=function(_0x3c3935,_0x4cf567){var _0x3cc568={'raw':![],'where':{'id':_0x3c3935[_0x400f('0x48')]['id']}},_0x45b581={};_0x45b581[_0x400f('0x36')]=_[_0x400f('0x33')](db['JscriptyProject'][_0x400f('0x2e')]);_0x45b581[_0x400f('0x34')]=_[_0x400f('0x33')](_0x3c3935[_0x400f('0x34')]);_0x45b581[_0x400f('0x35')]=_['intersection'](_0x45b581[_0x400f('0x36')],_0x45b581[_0x400f('0x34')]);_0x3cc568[_0x400f('0x37')]=_['intersection'](_0x45b581[_0x400f('0x36')],qs[_0x400f('0x39')](_0x3c3935[_0x400f('0x34')][_0x400f('0x39')]));_0x3cc568['attributes']=_0x3cc568[_0x400f('0x37')][_0x400f('0x49')]?_0x3cc568[_0x400f('0x37')]:_0x45b581['model'];if(_0x3c3935[_0x400f('0x34')][_0x400f('0x44')]){_0x3cc568[_0x400f('0x4a')]=[{'all':!![]}];}_0x3cc568=_[_0x400f('0x40')]({},_0x3cc568,_0x3c3935[_0x400f('0x42')]);return db['JscriptyProject'][_0x400f('0x4b')](_0x3cc568)[_0x400f('0x24')](handleEntityNotFound(_0x4cf567,null))[_0x400f('0x24')](respondWithResult(_0x4cf567,null))[_0x400f('0x4c')](handleError(_0x4cf567,null));};exports[_0x400f('0x4d')]=function(_0x5c644a,_0x2f3923){return db['JscriptyProject']['create'](_0x5c644a[_0x400f('0x4e')],{})[_0x400f('0x24')](function(_0x445913){var _0x7a696b=_0x5c644a[_0x400f('0x4f')][_0x400f('0x26')]({'plain':!![]});if(!_0x7a696b)throw new Error(_0x400f('0x50'));if(_0x7a696b[_0x400f('0x51')]===_0x400f('0x4f')){var _0x290c46=_0x445913['get']({'plain':!![]});var _0x335456=_0x400f('0x27');return db[_0x400f('0x52')][_0x400f('0x4b')]({'where':{'name':_0x335456,'userProfileId':_0x7a696b[_0x400f('0x53')]},'raw':!![]})[_0x400f('0x24')](function(_0x13fe30){if(_0x13fe30&&_0x13fe30['autoAssociation']===0x0){return db[_0x400f('0x54')][_0x400f('0x4d')]({'name':_0x290c46['name'],'resourceId':_0x290c46['id'],'type':_0x13fe30[_0x400f('0x2b')],'sectionId':_0x13fe30['id']},{})[_0x400f('0x24')](function(){return _0x445913;});}else{return _0x445913;}})[_0x400f('0x4c')](function(_0x3ca7a3){logger[_0x400f('0x29')](_0x400f('0x55'),_0x3ca7a3);throw _0x3ca7a3;});}return _0x445913;})['then'](respondWithResult(_0x2f3923,0xc9))[_0x400f('0x4c')](handleError(_0x2f3923,null));};exports[_0x400f('0x56')]=function(_0x598775,_0x28d792){var _0x4b4a86={'where':{'id':_0x598775['params']['id']}},_0x51b180={};_0x51b180[_0x400f('0x36')]=_[_0x400f('0x33')](db[_0x400f('0x43')][_0x400f('0x2e')]);_0x4b4a86[_0x400f('0x37')]=_[_0x400f('0x38')](_0x51b180[_0x400f('0x36')],qs[_0x400f('0x39')](_0x598775[_0x400f('0x34')][_0x400f('0x39')]));_0x4b4a86[_0x400f('0x37')]=_0x4b4a86['attributes'][_0x400f('0x49')]?_0x4b4a86['attributes']:_0x51b180['model'];if(_0x598775[_0x400f('0x34')][_0x400f('0x44')]){_0x4b4a86[_0x400f('0x4a')]=[{'all':!![]}];}_0x4b4a86=_[_0x400f('0x40')]({},_0x4b4a86,_0x598775[_0x400f('0x42')]);return db[_0x400f('0x43')][_0x400f('0x4b')](_0x4b4a86)[_0x400f('0x24')](handleEntityNotFound(_0x28d792,null))['then'](function(_0x437f98){if(_0x437f98){var _0x2a2891=_0x437f98[_0x400f('0x26')]({'plain':!![]});_0x2a2891=qs['omit'](_0x2a2891,['id',_0x400f('0x57'),'updatedAt']);_0x598775[_0x400f('0x4e')]=_['omit'](_0x598775[_0x400f('0x4e')],['id',_0x400f('0x57'),'updatedAt']);return db[_0x400f('0x43')][_0x400f('0x4d')](_[_0x400f('0x40')](_0x2a2891,_0x598775[_0x400f('0x4e')]),{'include':_0x598775[_0x400f('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x400f('0x24')](function(_0xd0e39b){var _0x5b6643=_0x598775[_0x400f('0x4f')][_0x400f('0x26')]({'plain':!![]});if(!_0x5b6643)throw new Error(_0x400f('0x50'));if(_0x5b6643['role']===_0x400f('0x4f')){var _0x32c201=_0xd0e39b[_0x400f('0x26')]({'plain':!![]});var _0x47e2ce=_0x400f('0x27');return db[_0x400f('0x52')]['find']({'where':{'name':_0x47e2ce,'userProfileId':_0x5b6643[_0x400f('0x53')]},'raw':!![]})[_0x400f('0x24')](function(_0xf70376){if(_0xf70376&&_0xf70376[_0x400f('0x58')]===0x0){return db[_0x400f('0x54')][_0x400f('0x4d')]({'name':_0x32c201[_0x400f('0x2b')],'resourceId':_0x32c201['id'],'type':_0xf70376[_0x400f('0x2b')],'sectionId':_0xf70376['id']},{})[_0x400f('0x24')](function(){return _0xd0e39b;});}else{return _0xd0e39b;}})[_0x400f('0x4c')](function(_0x4f21a4){logger[_0x400f('0x29')](_0x400f('0x55'),_0x4f21a4);throw _0x4f21a4;});}return _0xd0e39b;});}})[_0x400f('0x24')](respondWithResult(_0x28d792,0xc9))[_0x400f('0x4c')](handleError(_0x28d792,null));};exports['update']=function(_0x1c60ea,_0x56f919){if(_0x1c60ea[_0x400f('0x4e')]['id']){delete _0x1c60ea[_0x400f('0x4e')]['id'];}return db[_0x400f('0x43')][_0x400f('0x4b')]({'where':{'id':_0x1c60ea[_0x400f('0x48')]['id']}})[_0x400f('0x24')](handleEntityNotFound(_0x56f919,null))['then'](saveUpdates(_0x1c60ea[_0x400f('0x4e')],null))[_0x400f('0x24')](respondWithResult(_0x56f919,null))[_0x400f('0x4c')](handleError(_0x56f919,null));};exports['destroy']=function(_0x804977,_0x1cb5dd){return db[_0x400f('0x43')][_0x400f('0x4b')]({'where':{'id':_0x804977['params']['id']}})[_0x400f('0x24')](handleEntityNotFound(_0x1cb5dd,null))[_0x400f('0x24')](removeEntity(_0x1cb5dd,null))[_0x400f('0x4c')](handleError(_0x1cb5dd,null));};exports[_0x400f('0x59')]=function(_0x52902a,_0x4cdc4a,_0x15a658){var _0x184775={'raw':!![],'where':{}};var _0x4bfcb1={};var _0xe2bb5f={'count':0x0,'rows':[]};return db[_0x400f('0x43')][_0x400f('0x5a')]({'where':{'id':_0x52902a[_0x400f('0x48')]['id']}})[_0x400f('0x24')](handleEntityNotFound(_0x4cdc4a,null))[_0x400f('0x24')](function(_0x469cae){if(_0x469cae){_0x4bfcb1[_0x400f('0x36')]=_[_0x400f('0x33')](db[_0x400f('0x5b')][_0x400f('0x2e')]);_0x4bfcb1['query']=_['keys'](_0x52902a[_0x400f('0x34')]);_0x4bfcb1[_0x400f('0x35')]=_[_0x400f('0x38')](_0x4bfcb1[_0x400f('0x36')],_0x4bfcb1[_0x400f('0x34')]);_0x184775[_0x400f('0x37')]=_[_0x400f('0x38')](_0x4bfcb1['model'],qs[_0x400f('0x39')](_0x52902a['query'][_0x400f('0x39')]));_0x184775[_0x400f('0x37')]=_0x184775[_0x400f('0x37')]['length']?_0x184775[_0x400f('0x37')]:_0x4bfcb1[_0x400f('0x36')];if(!_0x52902a[_0x400f('0x34')]['hasOwnProperty']('nolimit')){_0x184775[_0x400f('0x1b')]=qs[_0x400f('0x1b')](_0x52902a[_0x400f('0x34')][_0x400f('0x1b')]);_0x184775[_0x400f('0x1d')]=qs['offset'](_0x52902a[_0x400f('0x34')][_0x400f('0x1d')]);}_0x184775[_0x400f('0x3b')]=qs['sort'](_0x52902a[_0x400f('0x34')]['sort']);_0x184775[_0x400f('0x3f')]=qs[_0x400f('0x35')](_[_0x400f('0x3d')](_0x52902a[_0x400f('0x34')],_0x4bfcb1['filters']));_0x184775[_0x400f('0x3f')]['ProjectId']=_0x469cae['id'];if(_0x52902a[_0x400f('0x34')][_0x400f('0x3e')]){_0x184775[_0x400f('0x3f')]=_[_0x400f('0x40')](_0x184775[_0x400f('0x3f')],{'$or':_['map'](_0x184775[_0x400f('0x37')],function(_0x18cdb7){var _0x4dd886={};_0x4dd886[_0x18cdb7]={'$like':'%'+_0x52902a['query'][_0x400f('0x3e')]+'%'};return _0x4dd886;})});}_0x184775=_[_0x400f('0x40')]({},_0x184775,_0x52902a[_0x400f('0x42')]);return db[_0x400f('0x5b')]['count']({'where':_0x184775['where']})[_0x400f('0x24')](function(_0x35189d){_0xe2bb5f[_0x400f('0x1c')]=_0x35189d;if(_0x52902a['query']['includeAll']){_0x184775['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x400f('0x45')](_0x184775);})[_0x400f('0x24')](function(_0x1981f1){_0xe2bb5f[_0x400f('0x46')]=_0x1981f1;return _0xe2bb5f;});}})[_0x400f('0x24')](respondWithFilteredResult(_0x4cdc4a,_0x184775))[_0x400f('0x4c')](handleError(_0x4cdc4a,null));};exports[_0x400f('0x5c')]=function(_0x2f9162,_0x1fe2e8,_0x4dfdcb){var _0x4b3b84={'raw':!![],'where':{}};var _0x518e7e={};var _0x17ed94={'count':0x0,'rows':[]};return db[_0x400f('0x43')][_0x400f('0x5a')]({'where':{'id':_0x2f9162[_0x400f('0x48')]['id']}})[_0x400f('0x24')](handleEntityNotFound(_0x1fe2e8,null))[_0x400f('0x24')](function(_0x52ad88){if(_0x52ad88){_0x518e7e[_0x400f('0x36')]=_[_0x400f('0x33')](db['JscriptyAnswerReport'][_0x400f('0x2e')]);_0x518e7e[_0x400f('0x34')]=_[_0x400f('0x33')](_0x2f9162[_0x400f('0x34')]);_0x518e7e[_0x400f('0x35')]=_[_0x400f('0x38')](_0x518e7e[_0x400f('0x36')],_0x518e7e['query']);_0x4b3b84['attributes']=_[_0x400f('0x38')](_0x518e7e[_0x400f('0x36')],qs[_0x400f('0x39')](_0x2f9162[_0x400f('0x34')]['fields']));_0x4b3b84['attributes']=_0x4b3b84[_0x400f('0x37')][_0x400f('0x49')]?_0x4b3b84[_0x400f('0x37')]:_0x518e7e[_0x400f('0x36')];if(!_0x2f9162['query'][_0x400f('0x3a')](_0x400f('0x5d'))){_0x4b3b84[_0x400f('0x1b')]=qs[_0x400f('0x1b')](_0x2f9162[_0x400f('0x34')][_0x400f('0x1b')]);_0x4b3b84[_0x400f('0x1d')]=qs[_0x400f('0x1d')](_0x2f9162[_0x400f('0x34')][_0x400f('0x1d')]);}_0x4b3b84[_0x400f('0x3b')]=qs['sort'](_0x2f9162[_0x400f('0x34')][_0x400f('0x3c')]);_0x4b3b84[_0x400f('0x3f')]=qs['filters'](_[_0x400f('0x3d')](_0x2f9162[_0x400f('0x34')],_0x518e7e[_0x400f('0x35')]));_0x4b3b84['where'][_0x400f('0x5e')]=_0x52ad88['id'];if(_0x2f9162[_0x400f('0x34')]['filter']){_0x4b3b84[_0x400f('0x3f')]=_[_0x400f('0x40')](_0x4b3b84[_0x400f('0x3f')],{'$or':_['map'](_0x4b3b84['attributes'],function(_0x44fdad){var _0x46ae6e={};_0x46ae6e[_0x44fdad]={'$like':'%'+_0x2f9162[_0x400f('0x34')][_0x400f('0x3e')]+'%'};return _0x46ae6e;})});}_0x4b3b84=_[_0x400f('0x40')]({},_0x4b3b84,_0x2f9162[_0x400f('0x42')]);return db[_0x400f('0x5f')][_0x400f('0x1c')]({'where':_0x4b3b84[_0x400f('0x3f')]})[_0x400f('0x24')](function(_0x2b710d){_0x17ed94[_0x400f('0x1c')]=_0x2b710d;if(_0x2f9162[_0x400f('0x34')]['includeAll']){_0x4b3b84[_0x400f('0x4a')]=[{'all':!![]}];}return db[_0x400f('0x5f')][_0x400f('0x45')](_0x4b3b84);})[_0x400f('0x24')](function(_0x52f125){_0x17ed94[_0x400f('0x46')]=_0x52f125;return _0x17ed94;});}})[_0x400f('0x24')](respondWithFilteredResult(_0x1fe2e8,_0x4b3b84))[_0x400f('0x4c')](handleError(_0x1fe2e8,null));};function char(_0xf3e0eb){return'number'===typeof _0xf3e0eb?String[_0x400f('0x60')][_0x400f('0x61')](null,arguments):_0xf3e0eb;}function needsEncapsulation(_0x141270){return!!_0x141270&&(_0x141270[_0x400f('0x62')]()['indexOf'](char(0xd))>=0x0||_0x141270[_0x400f('0x62')]()[_0x400f('0x63')](char(0xa))>=0x0||_0x141270[_0x400f('0x62')]()[_0x400f('0x63')](char(0x2c))>=0x0||_0x141270[_0x400f('0x62')]()[_0x400f('0x63')](char(0x22))>=0x0);}function encapsulate(_0x107e65){var _0x3cf500=char(0x22),_0x221a81='\x5c'+char(0x22),_0x3ab214=_0x107e65[_0x400f('0x62')]()[_0x400f('0x64')](new RegExp(_0x3cf500,'g'),_0x221a81);return _0x3cf500+_0x3ab214+_0x3cf500;}exports['getSummary']=function(_0x19d368,_0x555b0b,_0x1ed9e4){var _0x5851c9,_0x4791a7;var _0x55448f={'where':{'ProjectId':_0x19d368[_0x400f('0x48')]['id']}};if(_0x19d368[_0x400f('0x34')][_0x400f('0x65')]){_0x55448f[_0x400f('0x3f')][_0x400f('0x66')]=JSON[_0x400f('0x67')](_0x19d368['query'][_0x400f('0x65')]);}return db[_0x400f('0x5b')][_0x400f('0x45')](_0x55448f)[_0x400f('0x24')](handleEntityNotFound(_0x555b0b,null))['then'](function(_0x39d73a){if(_0x39d73a){_0x5851c9=_0x39d73a;return db[_0x400f('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0x400f('0x32')](_0x5851c9,'id')},'ProjectId':_0x19d368[_0x400f('0x48')]['id']},'order':'-createdAt'});}})[_0x400f('0x24')](handleEntityNotFound(_0x555b0b,null))['then'](function(_0x431211){if(_0x431211){_0x4791a7=_0x431211;var _0x4300ca={};for(var _0x47cd46=0x0,_0x12bcfc=_0x4791a7[_0x400f('0x49')];_0x47cd46<_0x12bcfc;_0x47cd46++){if(!_0x4300ca['hasOwnProperty'](_0x4791a7[_0x47cd46][_0x400f('0x69')])){_0x4300ca[_0x4791a7[_0x47cd46][_0x400f('0x69')]]=needsEncapsulation(_0x4791a7[_0x47cd46][_0x400f('0x6a')])?encapsulate(_0x4791a7[_0x47cd46]['question']):_0x4791a7[_0x47cd46][_0x400f('0x6a')];}}var _0x5789a2=[],_0x3089fd={};for(var _0x40f504=0x0,_0x4f238a=_0x5851c9[_0x400f('0x49')];_0x40f504<_0x4f238a;_0x40f504++){_0x3089fd={'ProjectId':_0x19d368['params']['id'],'SessionId':_0x5851c9[_0x40f504]['id'],'StartTime':moment(_0x5851c9[_0x40f504]['starttime'])[_0x400f('0x6b')](_0x400f('0x6c'))};for(var _0xc34699=0x0,_0x160928=_0x4791a7[_0x400f('0x49')];_0xc34699<_0x160928;_0xc34699++){if(_0x4791a7[_0xc34699][_0x400f('0x6d')]==_0x5851c9[_0x40f504]['id']&&_0x4300ca[_0x400f('0x3a')](_0x4791a7[_0xc34699][_0x400f('0x69')])){_0x3089fd[_0x4300ca[_0x4791a7[_0xc34699][_0x400f('0x69')]]]=_0x4791a7[_0xc34699]['answer'];}}for(var _0x3d9816 in _0x4300ca){if(!_0x3089fd[_0x400f('0x3a')](_0x4300ca[_0x3d9816])){_0x3089fd[_0x4300ca[_0x3d9816]]=null;}}_0x5789a2[_0x400f('0x6e')](_0x3089fd);}return _0x5789a2;}})[_0x400f('0x24')](function(_0x3bb32b){if(!_['isEmpty'](_0x3bb32b)){var _0x314720=toCsv(_0x3bb32b);var _0x47602b=Date[_0x400f('0x6f')]();fs[_0x400f('0x70')](util[_0x400f('0x6b')](_0x400f('0x71'),_0x19d368['params']['id'],_0x47602b),_0x314720);_0x555b0b[_0x400f('0x72')](_0x400f('0x73'),_0x400f('0x74')+util[_0x400f('0x6b')](_0x400f('0x75'),_0x19d368[_0x400f('0x48')]['id'],_0x47602b));_0x555b0b['setHeader'](_0x400f('0x76'),_0x400f('0x77'));return _0x555b0b[_0x400f('0x78')](util[_0x400f('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x19d368[_0x400f('0x48')]['id'],_0x47602b));}else{return _0x555b0b[_0x400f('0x28')](0xcc);}})['catch'](handleError(_0x555b0b,null));}; \ No newline at end of file +var _0x18a8=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','userProfileId','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','JscriptyProject','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x18a8,0x127));var _0x818a=function(_0x4299bb,_0x45cb09){_0x4299bb=_0x4299bb-0x0;var _0x394a29=_0x18a8[_0x4299bb];return _0x394a29;};'use strict';var emlformat=require(_0x818a('0x0'));var rimraf=require(_0x818a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x818a('0x2'));var rp=require(_0x818a('0x3'));var moment=require(_0x818a('0x4'));var BPromise=require(_0x818a('0x5'));var Mustache=require(_0x818a('0x6'));var util=require('util');var path=require(_0x818a('0x7'));var sox=require(_0x818a('0x8'));var csv=require('to-csv');var ejs=require(_0x818a('0x9'));var fs=require('fs');var fs_extra=require(_0x818a('0xa'));var _=require(_0x818a('0xb'));var squel=require(_0x818a('0xc'));var crypto=require(_0x818a('0xd'));var jsforce=require(_0x818a('0xe'));var deskjs=require(_0x818a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x818a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x818a('0x11'));var hardwareService=require(_0x818a('0x12'));var logger=require('../../config/logger')(_0x818a('0x13'));var utils=require(_0x818a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x818a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bbd72,_0x467d21){_0x467d21=_0x467d21||0xcc;return function(_0x5670ef){if(_0x5670ef){return _0x4bbd72['sendStatus'](_0x467d21);}return _0x4bbd72[_0x818a('0x16')](_0x467d21)[_0x818a('0x17')]();};}function respondWithResult(_0x4e45af,_0x5e810b){_0x5e810b=_0x5e810b||0xc8;return function(_0x379e15){if(_0x379e15){return _0x4e45af[_0x818a('0x16')](_0x5e810b)[_0x818a('0x18')](_0x379e15);}};}function respondWithFilteredResult(_0x31680a,_0x59eee9){return function(_0x48eefa){if(_0x48eefa){var _0x4fbce9=typeof _0x59eee9[_0x818a('0x19')]===_0x818a('0x1a')&&typeof _0x59eee9[_0x818a('0x1b')]===_0x818a('0x1a');var _0x24ecdb=_0x48eefa[_0x818a('0x1c')];var _0x3d088c=_0x4fbce9?0x0:_0x59eee9[_0x818a('0x19')];var _0xa964a6=_0x4fbce9?_0x48eefa[_0x818a('0x1c')]:_0x59eee9['offset']+_0x59eee9[_0x818a('0x1b')];var _0x3fe6a8;if(_0xa964a6>=_0x24ecdb){_0xa964a6=_0x24ecdb;_0x3fe6a8=0xc8;}else{_0x3fe6a8=0xce;}_0x31680a[_0x818a('0x16')](_0x3fe6a8);return _0x31680a[_0x818a('0x1d')](_0x818a('0x1e'),_0x3d088c+'-'+_0xa964a6+'/'+_0x24ecdb)[_0x818a('0x18')](_0x48eefa);}return null;};}function patchUpdates(_0x659d41){return function(_0x2bcc73){try{jsonpatch[_0x818a('0x1f')](_0x2bcc73,_0x659d41,!![]);}catch(_0x3dedeb){return BPromise[_0x818a('0x20')](_0x3dedeb);}return _0x2bcc73[_0x818a('0x21')]();};}function saveUpdates(_0x5542d1,_0x80e4e){return function(_0x1bfeb2){if(_0x1bfeb2){return _0x1bfeb2[_0x818a('0x22')](_0x5542d1)[_0x818a('0x23')](function(_0xe73187){return _0xe73187;});}return null;};}function removeEntity(_0x2e0e3d,_0x4c389e){return function(_0x5a8475){if(_0x5a8475){return _0x5a8475[_0x818a('0x24')]()['then'](function(){var _0x214978=_0x5a8475[_0x818a('0x25')]({'plain':!![]});var _0x53cf60='Projects';return db['UserProfileResource']['destroy']({'where':{'type':_0x53cf60,'resourceId':_0x214978['id']}})[_0x818a('0x23')](function(){return _0x5a8475;});})['then'](function(){_0x2e0e3d[_0x818a('0x16')](0xcc)[_0x818a('0x17')]();});}};}function handleEntityNotFound(_0x298a69,_0x4d6321){return function(_0x40bab6){if(!_0x40bab6){_0x298a69[_0x818a('0x26')](0x194);}return _0x40bab6;};}function handleError(_0x4cf462,_0x5072ce){_0x5072ce=_0x5072ce||0x1f4;return function(_0x47d3bc){logger[_0x818a('0x27')](_0x47d3bc[_0x818a('0x28')]);if(_0x47d3bc[_0x818a('0x29')]){delete _0x47d3bc[_0x818a('0x29')];}_0x4cf462[_0x818a('0x16')](_0x5072ce)[_0x818a('0x2a')](_0x47d3bc);};}exports[_0x818a('0x2b')]=function(_0x3e916b,_0x1932f3){var _0x4ea29c={},_0x2b9a2f={},_0x366641={'count':0x0,'rows':[]};var _0x9dd36a=_[_0x818a('0x2c')](db[_0x818a('0x2d')]['rawAttributes'],function(_0x1e740b){return{'name':_0x1e740b['fieldName'],'type':_0x1e740b[_0x818a('0x2e')]['key']};});_0x2b9a2f[_0x818a('0x2f')]=_['map'](_0x9dd36a,'name');_0x2b9a2f[_0x818a('0x30')]=_[_0x818a('0x31')](_0x3e916b['query']);_0x2b9a2f['filters']=_[_0x818a('0x32')](_0x2b9a2f[_0x818a('0x2f')],_0x2b9a2f['query']);_0x4ea29c[_0x818a('0x33')]=_[_0x818a('0x32')](_0x2b9a2f[_0x818a('0x2f')],qs[_0x818a('0x34')](_0x3e916b[_0x818a('0x30')]['fields']));_0x4ea29c[_0x818a('0x33')]=_0x4ea29c[_0x818a('0x33')][_0x818a('0x35')]?_0x4ea29c[_0x818a('0x33')]:_0x2b9a2f['model'];if(!_0x3e916b['query'][_0x818a('0x36')](_0x818a('0x37'))){_0x4ea29c[_0x818a('0x1b')]=qs[_0x818a('0x1b')](_0x3e916b[_0x818a('0x30')][_0x818a('0x1b')]);_0x4ea29c[_0x818a('0x19')]=qs['offset'](_0x3e916b[_0x818a('0x30')][_0x818a('0x19')]);}_0x4ea29c[_0x818a('0x38')]=qs['sort'](_0x3e916b[_0x818a('0x30')][_0x818a('0x39')]);_0x4ea29c['where']=qs[_0x818a('0x3a')](_[_0x818a('0x3b')](_0x3e916b[_0x818a('0x30')],_0x2b9a2f[_0x818a('0x3a')]),_0x9dd36a);if(_0x3e916b[_0x818a('0x30')][_0x818a('0x3c')]){_0x4ea29c[_0x818a('0x3d')]=_[_0x818a('0x3e')](_0x4ea29c[_0x818a('0x3d')],{'$or':_[_0x818a('0x2c')](_0x9dd36a,function(_0x22f090){if(_0x22f090[_0x818a('0x2e')]!==_0x818a('0x3f')){var _0x20c295={};_0x20c295[_0x22f090[_0x818a('0x29')]]={'$like':'%'+_0x3e916b[_0x818a('0x30')]['filter']+'%'};return _0x20c295;}})});}_0x4ea29c=_[_0x818a('0x3e')]({},_0x4ea29c,_0x3e916b['options']);var _0x28c5f1={'where':_0x4ea29c[_0x818a('0x3d')]};return db[_0x818a('0x2d')][_0x818a('0x1c')](_0x28c5f1)[_0x818a('0x23')](function(_0x36ad69){_0x366641[_0x818a('0x1c')]=_0x36ad69;if(_0x3e916b[_0x818a('0x30')][_0x818a('0x40')]){_0x4ea29c[_0x818a('0x41')]=[{'all':!![]}];}return db[_0x818a('0x2d')][_0x818a('0x42')](_0x4ea29c);})[_0x818a('0x23')](function(_0x167f8e){_0x366641['rows']=_0x167f8e;return _0x366641;})['then'](respondWithFilteredResult(_0x1932f3,_0x4ea29c))[_0x818a('0x43')](handleError(_0x1932f3,null));};exports[_0x818a('0x44')]=function(_0x4f35a1,_0xf5124c){var _0x1c81d8={'raw':![],'where':{'id':_0x4f35a1[_0x818a('0x45')]['id']}},_0x28553a={};_0x28553a['model']=_['keys'](db[_0x818a('0x2d')][_0x818a('0x46')]);_0x28553a[_0x818a('0x30')]=_[_0x818a('0x31')](_0x4f35a1[_0x818a('0x30')]);_0x28553a['filters']=_['intersection'](_0x28553a[_0x818a('0x2f')],_0x28553a[_0x818a('0x30')]);_0x1c81d8[_0x818a('0x33')]=_['intersection'](_0x28553a['model'],qs[_0x818a('0x34')](_0x4f35a1['query']['fields']));_0x1c81d8[_0x818a('0x33')]=_0x1c81d8[_0x818a('0x33')][_0x818a('0x35')]?_0x1c81d8['attributes']:_0x28553a[_0x818a('0x2f')];if(_0x4f35a1[_0x818a('0x30')][_0x818a('0x40')]){_0x1c81d8[_0x818a('0x41')]=[{'all':!![]}];}_0x1c81d8=_[_0x818a('0x3e')]({},_0x1c81d8,_0x4f35a1[_0x818a('0x47')]);return db['JscriptyProject'][_0x818a('0x48')](_0x1c81d8)[_0x818a('0x23')](handleEntityNotFound(_0xf5124c,null))[_0x818a('0x23')](respondWithResult(_0xf5124c,null))[_0x818a('0x43')](handleError(_0xf5124c,null));};exports[_0x818a('0x49')]=function(_0x3b11c6,_0x269412){return db['JscriptyProject'][_0x818a('0x49')](_0x3b11c6[_0x818a('0x4a')],{})['then'](function(_0x617316){var _0x571a95=_0x3b11c6[_0x818a('0x4b')]['get']({'plain':!![]});if(!_0x571a95)throw new Error(_0x818a('0x4c'));if(_0x571a95['role']===_0x818a('0x4b')){var _0xa3066e=_0x617316[_0x818a('0x25')]({'plain':!![]});var _0x5dea72=_0x818a('0x4d');return db[_0x818a('0x4e')][_0x818a('0x48')]({'where':{'name':_0x5dea72,'userProfileId':_0x571a95['userProfileId']},'raw':!![]})[_0x818a('0x23')](function(_0x43f1e1){if(_0x43f1e1&&_0x43f1e1['autoAssociation']===0x0){return db[_0x818a('0x4f')][_0x818a('0x49')]({'name':_0xa3066e['name'],'resourceId':_0xa3066e['id'],'type':_0x43f1e1['name'],'sectionId':_0x43f1e1['id']},{})[_0x818a('0x23')](function(){return _0x617316;});}else{return _0x617316;}})[_0x818a('0x43')](function(_0x93211d){logger[_0x818a('0x27')](_0x818a('0x50'),_0x93211d);throw _0x93211d;});}return _0x617316;})['then'](respondWithResult(_0x269412,0xc9))[_0x818a('0x43')](handleError(_0x269412,null));};exports[_0x818a('0x51')]=function(_0x52da45,_0x16b87e){var _0x2fe598={'where':{'id':_0x52da45[_0x818a('0x45')]['id']}},_0x20b23a={};_0x20b23a[_0x818a('0x2f')]=_[_0x818a('0x31')](db['JscriptyProject'][_0x818a('0x46')]);_0x2fe598[_0x818a('0x33')]=_[_0x818a('0x32')](_0x20b23a[_0x818a('0x2f')],qs[_0x818a('0x34')](_0x52da45[_0x818a('0x30')][_0x818a('0x34')]));_0x2fe598[_0x818a('0x33')]=_0x2fe598[_0x818a('0x33')][_0x818a('0x35')]?_0x2fe598[_0x818a('0x33')]:_0x20b23a[_0x818a('0x2f')];if(_0x52da45[_0x818a('0x30')][_0x818a('0x40')]){_0x2fe598[_0x818a('0x41')]=[{'all':!![]}];}_0x2fe598=_[_0x818a('0x3e')]({},_0x2fe598,_0x52da45[_0x818a('0x47')]);return db[_0x818a('0x2d')][_0x818a('0x48')](_0x2fe598)[_0x818a('0x23')](handleEntityNotFound(_0x16b87e,null))['then'](function(_0x4be672){if(_0x4be672){var _0x1f4bd6=_0x4be672[_0x818a('0x25')]({'plain':!![]});_0x1f4bd6=qs[_0x818a('0x52')](_0x1f4bd6,['id',_0x818a('0x53'),'updatedAt']);_0x52da45[_0x818a('0x4a')]=_[_0x818a('0x52')](_0x52da45['body'],['id','createdAt','updatedAt']);return db[_0x818a('0x2d')]['create'](_[_0x818a('0x3e')](_0x1f4bd6,_0x52da45[_0x818a('0x4a')]),{'include':_0x52da45[_0x818a('0x30')][_0x818a('0x40')]?[{'all':!![]}]:undefined})[_0x818a('0x23')](function(_0x5891bb){var _0x49e48e=_0x52da45['user'][_0x818a('0x25')]({'plain':!![]});if(!_0x49e48e)throw new Error(_0x818a('0x4c'));if(_0x49e48e['role']===_0x818a('0x4b')){var _0x135a5c=_0x5891bb[_0x818a('0x25')]({'plain':!![]});var _0x4fea60=_0x818a('0x4d');return db['UserProfileSection'][_0x818a('0x48')]({'where':{'name':_0x4fea60,'userProfileId':_0x49e48e[_0x818a('0x54')]},'raw':!![]})[_0x818a('0x23')](function(_0xf73a78){if(_0xf73a78&&_0xf73a78[_0x818a('0x55')]===0x0){return db[_0x818a('0x4f')][_0x818a('0x49')]({'name':_0x135a5c[_0x818a('0x29')],'resourceId':_0x135a5c['id'],'type':_0xf73a78['name'],'sectionId':_0xf73a78['id']},{})[_0x818a('0x23')](function(){return _0x5891bb;});}else{return _0x5891bb;}})[_0x818a('0x43')](function(_0xdb49e6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdb49e6);throw _0xdb49e6;});}return _0x5891bb;});}})[_0x818a('0x23')](respondWithResult(_0x16b87e,0xc9))['catch'](handleError(_0x16b87e,null));};exports[_0x818a('0x22')]=function(_0x115df3,_0x5c7737){if(_0x115df3[_0x818a('0x4a')]['id']){delete _0x115df3[_0x818a('0x4a')]['id'];}return db[_0x818a('0x2d')][_0x818a('0x48')]({'where':{'id':_0x115df3[_0x818a('0x45')]['id']}})[_0x818a('0x23')](handleEntityNotFound(_0x5c7737,null))[_0x818a('0x23')](saveUpdates(_0x115df3['body'],null))['then'](respondWithResult(_0x5c7737,null))['catch'](handleError(_0x5c7737,null));};exports[_0x818a('0x24')]=function(_0x1917b7,_0x3ecb51){return db[_0x818a('0x2d')][_0x818a('0x48')]({'where':{'id':_0x1917b7[_0x818a('0x45')]['id']}})[_0x818a('0x23')](handleEntityNotFound(_0x3ecb51,null))['then'](removeEntity(_0x3ecb51,null))['catch'](handleError(_0x3ecb51,null));};exports[_0x818a('0x56')]=function(_0x360598,_0x24f959,_0x337228){var _0x538c9c={'raw':!![],'where':{}};var _0x5d0cc2={};var _0x181af8={'count':0x0,'rows':[]};return db[_0x818a('0x2d')][_0x818a('0x57')]({'where':{'id':_0x360598[_0x818a('0x45')]['id']}})[_0x818a('0x23')](handleEntityNotFound(_0x24f959,null))['then'](function(_0x41a853){if(_0x41a853){_0x5d0cc2['model']=_[_0x818a('0x31')](db[_0x818a('0x58')][_0x818a('0x46')]);_0x5d0cc2[_0x818a('0x30')]=_[_0x818a('0x31')](_0x360598[_0x818a('0x30')]);_0x5d0cc2[_0x818a('0x3a')]=_[_0x818a('0x32')](_0x5d0cc2[_0x818a('0x2f')],_0x5d0cc2[_0x818a('0x30')]);_0x538c9c[_0x818a('0x33')]=_[_0x818a('0x32')](_0x5d0cc2[_0x818a('0x2f')],qs[_0x818a('0x34')](_0x360598[_0x818a('0x30')][_0x818a('0x34')]));_0x538c9c[_0x818a('0x33')]=_0x538c9c[_0x818a('0x33')][_0x818a('0x35')]?_0x538c9c['attributes']:_0x5d0cc2[_0x818a('0x2f')];if(!_0x360598[_0x818a('0x30')][_0x818a('0x36')](_0x818a('0x37'))){_0x538c9c['limit']=qs[_0x818a('0x1b')](_0x360598[_0x818a('0x30')][_0x818a('0x1b')]);_0x538c9c[_0x818a('0x19')]=qs['offset'](_0x360598[_0x818a('0x30')]['offset']);}_0x538c9c['order']=qs[_0x818a('0x39')](_0x360598[_0x818a('0x30')][_0x818a('0x39')]);_0x538c9c[_0x818a('0x3d')]=qs[_0x818a('0x3a')](_[_0x818a('0x3b')](_0x360598[_0x818a('0x30')],_0x5d0cc2[_0x818a('0x3a')]));_0x538c9c[_0x818a('0x3d')][_0x818a('0x59')]=_0x41a853['id'];if(_0x360598[_0x818a('0x30')][_0x818a('0x3c')]){_0x538c9c[_0x818a('0x3d')]=_[_0x818a('0x3e')](_0x538c9c[_0x818a('0x3d')],{'$or':_[_0x818a('0x2c')](_0x538c9c[_0x818a('0x33')],function(_0xc5eeb4){var _0x536ff1={};_0x536ff1[_0xc5eeb4]={'$like':'%'+_0x360598[_0x818a('0x30')]['filter']+'%'};return _0x536ff1;})});}_0x538c9c=_[_0x818a('0x3e')]({},_0x538c9c,_0x360598[_0x818a('0x47')]);return db[_0x818a('0x58')][_0x818a('0x1c')]({'where':_0x538c9c[_0x818a('0x3d')]})[_0x818a('0x23')](function(_0x46fd11){_0x181af8[_0x818a('0x1c')]=_0x46fd11;if(_0x360598[_0x818a('0x30')][_0x818a('0x40')]){_0x538c9c[_0x818a('0x41')]=[{'all':!![]}];}return db[_0x818a('0x58')]['findAll'](_0x538c9c);})[_0x818a('0x23')](function(_0x51f5cd){_0x181af8[_0x818a('0x5a')]=_0x51f5cd;return _0x181af8;});}})['then'](respondWithFilteredResult(_0x24f959,_0x538c9c))[_0x818a('0x43')](handleError(_0x24f959,null));};exports[_0x818a('0x5b')]=function(_0xa497c2,_0x468d19,_0x72d69f){var _0xd94f2f={'raw':!![],'where':{}};var _0x37cebc={};var _0x325365={'count':0x0,'rows':[]};return db[_0x818a('0x2d')][_0x818a('0x57')]({'where':{'id':_0xa497c2[_0x818a('0x45')]['id']}})[_0x818a('0x23')](handleEntityNotFound(_0x468d19,null))[_0x818a('0x23')](function(_0x4c9fd1){if(_0x4c9fd1){_0x37cebc[_0x818a('0x2f')]=_['keys'](db[_0x818a('0x5c')][_0x818a('0x46')]);_0x37cebc[_0x818a('0x30')]=_['keys'](_0xa497c2[_0x818a('0x30')]);_0x37cebc[_0x818a('0x3a')]=_[_0x818a('0x32')](_0x37cebc[_0x818a('0x2f')],_0x37cebc[_0x818a('0x30')]);_0xd94f2f[_0x818a('0x33')]=_[_0x818a('0x32')](_0x37cebc['model'],qs['fields'](_0xa497c2[_0x818a('0x30')]['fields']));_0xd94f2f[_0x818a('0x33')]=_0xd94f2f[_0x818a('0x33')]['length']?_0xd94f2f[_0x818a('0x33')]:_0x37cebc[_0x818a('0x2f')];if(!_0xa497c2[_0x818a('0x30')][_0x818a('0x36')](_0x818a('0x37'))){_0xd94f2f[_0x818a('0x1b')]=qs[_0x818a('0x1b')](_0xa497c2['query']['limit']);_0xd94f2f[_0x818a('0x19')]=qs[_0x818a('0x19')](_0xa497c2[_0x818a('0x30')][_0x818a('0x19')]);}_0xd94f2f[_0x818a('0x38')]=qs['sort'](_0xa497c2[_0x818a('0x30')][_0x818a('0x39')]);_0xd94f2f[_0x818a('0x3d')]=qs[_0x818a('0x3a')](_[_0x818a('0x3b')](_0xa497c2[_0x818a('0x30')],_0x37cebc['filters']));_0xd94f2f[_0x818a('0x3d')]['ProjectId']=_0x4c9fd1['id'];if(_0xa497c2[_0x818a('0x30')][_0x818a('0x3c')]){_0xd94f2f['where']=_[_0x818a('0x3e')](_0xd94f2f['where'],{'$or':_[_0x818a('0x2c')](_0xd94f2f['attributes'],function(_0x40cb1c){var _0x1b451e={};_0x1b451e[_0x40cb1c]={'$like':'%'+_0xa497c2['query'][_0x818a('0x3c')]+'%'};return _0x1b451e;})});}_0xd94f2f=_[_0x818a('0x3e')]({},_0xd94f2f,_0xa497c2[_0x818a('0x47')]);return db['JscriptyAnswerReport']['count']({'where':_0xd94f2f[_0x818a('0x3d')]})['then'](function(_0x4d2aa7){_0x325365[_0x818a('0x1c')]=_0x4d2aa7;if(_0xa497c2['query'][_0x818a('0x40')]){_0xd94f2f[_0x818a('0x41')]=[{'all':!![]}];}return db[_0x818a('0x5c')][_0x818a('0x42')](_0xd94f2f);})[_0x818a('0x23')](function(_0x390c54){_0x325365['rows']=_0x390c54;return _0x325365;});}})[_0x818a('0x23')](respondWithFilteredResult(_0x468d19,_0xd94f2f))[_0x818a('0x43')](handleError(_0x468d19,null));};function char(_0x14ffa0){return _0x818a('0x5d')===typeof _0x14ffa0?String[_0x818a('0x5e')][_0x818a('0x1f')](null,arguments):_0x14ffa0;}function needsEncapsulation(_0x40feae){return!!_0x40feae&&(_0x40feae[_0x818a('0x5f')]()[_0x818a('0x60')](char(0xd))>=0x0||_0x40feae[_0x818a('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x40feae[_0x818a('0x5f')]()[_0x818a('0x60')](char(0x2c))>=0x0||_0x40feae['toString']()[_0x818a('0x60')](char(0x22))>=0x0);}function encapsulate(_0x13efc2){var _0x202d39=char(0x22),_0x118c1a='\x5c'+char(0x22),_0x2b5475=_0x13efc2[_0x818a('0x5f')]()[_0x818a('0x61')](new RegExp(_0x202d39,'g'),_0x118c1a);return _0x202d39+_0x2b5475+_0x202d39;}exports[_0x818a('0x62')]=function(_0x4d1bc8,_0x152991,_0x134638){var _0x8d2e89,_0x391737;var _0x2b8b72={'where':{'ProjectId':_0x4d1bc8[_0x818a('0x45')]['id']}};if(_0x4d1bc8[_0x818a('0x30')][_0x818a('0x63')]){_0x2b8b72[_0x818a('0x3d')][_0x818a('0x64')]=JSON[_0x818a('0x65')](_0x4d1bc8[_0x818a('0x30')][_0x818a('0x63')]);}return db[_0x818a('0x58')][_0x818a('0x42')](_0x2b8b72)[_0x818a('0x23')](handleEntityNotFound(_0x152991,null))[_0x818a('0x23')](function(_0x4553ad){if(_0x4553ad){_0x8d2e89=_0x4553ad;return db[_0x818a('0x66')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x8d2e89,'id')},'ProjectId':_0x4d1bc8[_0x818a('0x45')]['id']},'order':'-createdAt'});}})[_0x818a('0x23')](handleEntityNotFound(_0x152991,null))[_0x818a('0x23')](function(_0x90a424){if(_0x90a424){_0x391737=_0x90a424;var _0x3c25ad={};for(var _0x7077d3=0x0,_0x30a661=_0x391737[_0x818a('0x35')];_0x7077d3<_0x30a661;_0x7077d3++){if(!_0x3c25ad[_0x818a('0x36')](_0x391737[_0x7077d3]['questionId'])){_0x3c25ad[_0x391737[_0x7077d3][_0x818a('0x67')]]=needsEncapsulation(_0x391737[_0x7077d3]['question'])?encapsulate(_0x391737[_0x7077d3]['question']):_0x391737[_0x7077d3][_0x818a('0x68')];}}var _0x18d136=[],_0x3d70ea={};for(var _0x3d24fa=0x0,_0x4fe1f5=_0x8d2e89[_0x818a('0x35')];_0x3d24fa<_0x4fe1f5;_0x3d24fa++){_0x3d70ea={'ProjectId':_0x4d1bc8[_0x818a('0x45')]['id'],'SessionId':_0x8d2e89[_0x3d24fa]['id'],'StartTime':moment(_0x8d2e89[_0x3d24fa][_0x818a('0x64')])[_0x818a('0x69')](_0x818a('0x6a'))};for(var _0x28fde9=0x0,_0x5ce783=_0x391737[_0x818a('0x35')];_0x28fde9<_0x5ce783;_0x28fde9++){if(_0x391737[_0x28fde9][_0x818a('0x6b')]==_0x8d2e89[_0x3d24fa]['id']&&_0x3c25ad['hasOwnProperty'](_0x391737[_0x28fde9][_0x818a('0x67')])){_0x3d70ea[_0x3c25ad[_0x391737[_0x28fde9]['questionId']]]=_0x391737[_0x28fde9][_0x818a('0x6c')];}}for(var _0x4fcb37 in _0x3c25ad){if(!_0x3d70ea[_0x818a('0x36')](_0x3c25ad[_0x4fcb37])){_0x3d70ea[_0x3c25ad[_0x4fcb37]]=null;}}_0x18d136[_0x818a('0x6d')](_0x3d70ea);}return _0x18d136;}})['then'](function(_0x312ede){if(!_['isEmpty'](_0x312ede)){var _0x123519=toCsv(_0x312ede);var _0x2af935=Date[_0x818a('0x6e')]();fs[_0x818a('0x6f')](util[_0x818a('0x69')](_0x818a('0x70'),_0x4d1bc8['params']['id'],_0x2af935),_0x123519);_0x152991[_0x818a('0x71')](_0x818a('0x72'),_0x818a('0x73')+util[_0x818a('0x69')](_0x818a('0x74'),_0x4d1bc8[_0x818a('0x45')]['id'],_0x2af935));_0x152991[_0x818a('0x71')](_0x818a('0x75'),'text/csv');return _0x152991[_0x818a('0x76')](util[_0x818a('0x69')](_0x818a('0x70'),_0x4d1bc8[_0x818a('0x45')]['id'],_0x2af935));}else{return _0x152991[_0x818a('0x26')](0xcc);}})[_0x818a('0x43')](handleError(_0x152991,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 18dc488..5e467f1 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['bluebird','request-promise','path','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xac9d,0x14d));var _0xdac9=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xac9d[_0x996bc8];return _0x20b0ea;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var logger=require(_0xdac9('0x2'))(_0xdac9('0x3'));var moment=require(_0xdac9('0x4'));var BPromise=require(_0xdac9('0x5'));var rp=require(_0xdac9('0x6'));var fs=require('fs');var path=require(_0xdac9('0x7'));var rimraf=require('rimraf');var config=require(_0xdac9('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0xdac9('0x9')]=function(_0x1f8ff3,_0x1222bb){return _0x1f8ff3[_0xdac9('0xa')](_0xdac9('0xb'),attributes,{'tableName':_0xdac9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb647=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x3f187e,_0x5f0839){var _0x4cecd5=function(_0x10ad1c){while(--_0x10ad1c){_0x3f187e['push'](_0x3f187e['shift']());}};_0x4cecd5(++_0x5f0839);}(_0xb647,0xdb));var _0x7b64=function(_0x53de97,_0x2ce26f){_0x53de97=_0x53de97-0x0;var _0x52ed7c=_0xb647[_0x53de97];return _0x52ed7c;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var logger=require(_0x7b64('0x2'))(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var rp=require(_0x7b64('0x6'));var fs=require('fs');var path=require(_0x7b64('0x7'));var rimraf=require('rimraf');var config=require(_0x7b64('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x7b64('0x9')]=function(_0x38ebf7,_0x31915b){return _0x38ebf7[_0x7b64('0xa')](_0x7b64('0xb'),attributes,{'tableName':_0x7b64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index e83e3cb..f73127d 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xac4a,0x13f));var _0xaac4=function(_0x5e7619,_0xdf269a){_0x5e7619=_0x5e7619-0x0;var _0x8625fd=_0xac4a[_0x5e7619];return _0x8625fd;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b5101,_0xd01f0d){var _0x4edf1a=function(_0x3f99db){while(--_0x3f99db){_0x3b5101['push'](_0x3b5101['shift']());}};_0x4edf1a(++_0xd01f0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index bb20052..8fe13be 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd65=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x416390,_0x3976e9){var _0x2e5322=function(_0x2c3409){while(--_0x2c3409){_0x416390['push'](_0x416390['shift']());}};_0x2e5322(++_0x3976e9);}(_0xcd65,0x193));var _0x5cd6=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xcd65[_0x1db251];return _0x56685a;};'use strict';var multer=require(_0x5cd6('0x0'));var util=require('util');var path=require(_0x5cd6('0x1'));var timeout=require(_0x5cd6('0x2'));var express=require(_0x5cd6('0x3'));var router=express[_0x5cd6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5cd6('0x5'));var interaction=require(_0x5cd6('0x6'));var config=require(_0x5cd6('0x7'));var controller=require(_0x5cd6('0x8'));router[_0x5cd6('0x9')]('/',auth[_0x5cd6('0xa')](),controller['index']);router[_0x5cd6('0x9')]('/describe',auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xb')]);router[_0x5cd6('0x9')](_0x5cd6('0xc'),auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xd')]);router[_0x5cd6('0xe')]('/',auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xf')]);router[_0x5cd6('0x10')](_0x5cd6('0xc'),auth[_0x5cd6('0xa')](),controller[_0x5cd6('0x11')]);router[_0x5cd6('0x12')](_0x5cd6('0xc'),auth['isAuthenticated'](),controller[_0x5cd6('0x13')]);module[_0x5cd6('0x14')]=router; \ No newline at end of file +var _0xf324=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x1b7d18,_0x5bcfa0){var _0x1e98ef=function(_0x2c2e22){while(--_0x2c2e22){_0x1b7d18['push'](_0x1b7d18['shift']());}};_0x1e98ef(++_0x5bcfa0);}(_0xf324,0xb2));var _0x4f32=function(_0x5caa8b,_0x2194b7){_0x5caa8b=_0x5caa8b-0x0;var _0x34522f=_0xf324[_0x5caa8b];return _0x34522f;};'use strict';var multer=require(_0x4f32('0x0'));var util=require('util');var path=require(_0x4f32('0x1'));var timeout=require(_0x4f32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4f32('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4f32('0x4'));var config=require(_0x4f32('0x5'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x4f32('0x6')](),controller['index']);router[_0x4f32('0x7')]('/describe',auth[_0x4f32('0x6')](),controller[_0x4f32('0x8')]);router[_0x4f32('0x7')](_0x4f32('0x9'),auth[_0x4f32('0x6')](),controller[_0x4f32('0xa')]);router[_0x4f32('0xb')]('/',auth[_0x4f32('0x6')](),controller[_0x4f32('0xc')]);router[_0x4f32('0xd')](_0x4f32('0x9'),auth[_0x4f32('0x6')](),controller[_0x4f32('0xe')]);router[_0x4f32('0xf')](_0x4f32('0x9'),auth['isAuthenticated'](),controller[_0x4f32('0x10')]);module[_0x4f32('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8eae73d..1f3ef26 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x4b9666,_0x593167){_0x4b9666=_0x4b9666-0x0;var _0x298927=_0x7a54[_0x4b9666];return _0x298927;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x5c8349,_0x15e858){_0x5c8349=_0x5c8349-0x0;var _0x7b24f2=_0x7a54[_0x5c8349];return _0x7b24f2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 82d6467..04f9261 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bec=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x33e114,_0x77cc5a){var _0x17e9b6=function(_0xd1cb2f){while(--_0xd1cb2f){_0x33e114['push'](_0x33e114['shift']());}};_0x17e9b6(++_0x77cc5a);}(_0x3bec,0x175));var _0xc3be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3bec[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc3be('0x0'));var rimraf=require(_0xc3be('0x1'));var zipdir=require(_0xc3be('0x2'));var jsonpatch=require(_0xc3be('0x3'));var rp=require(_0xc3be('0x4'));var moment=require(_0xc3be('0x5'));var BPromise=require(_0xc3be('0x6'));var Mustache=require(_0xc3be('0x7'));var util=require(_0xc3be('0x8'));var path=require('path');var sox=require(_0xc3be('0x9'));var csv=require(_0xc3be('0xa'));var ejs=require(_0xc3be('0xb'));var fs=require('fs');var fs_extra=require(_0xc3be('0xc'));var _=require(_0xc3be('0xd'));var squel=require(_0xc3be('0xe'));var crypto=require('crypto');var jsforce=require(_0xc3be('0xf'));var deskjs=require(_0xc3be('0x10'));var toCsv=require(_0xc3be('0xa'));var querystring=require(_0xc3be('0x11'));var Papa=require(_0xc3be('0x12'));var Redis=require('ioredis');var authService=require(_0xc3be('0x13'));var qs=require(_0xc3be('0x14'));var as=require(_0xc3be('0x15'));var hardwareService=require(_0xc3be('0x16'));var logger=require('../../config/logger')(_0xc3be('0x17'));var utils=require(_0xc3be('0x18'));var config=require(_0xc3be('0x19'));var licenseUtil=require(_0xc3be('0x1a'));var db=require(_0xc3be('0x1b'))['db'];function respondWithStatusCode(_0x5011fc,_0xcb10d){_0xcb10d=_0xcb10d||0xcc;return function(_0x873cd3){if(_0x873cd3){return _0x5011fc[_0xc3be('0x1c')](_0xcb10d);}return _0x5011fc['status'](_0xcb10d)[_0xc3be('0x1d')]();};}function respondWithResult(_0x5a1a84,_0x4e3c30){_0x4e3c30=_0x4e3c30||0xc8;return function(_0x45b4ba){if(_0x45b4ba){return _0x5a1a84[_0xc3be('0x1e')](_0x4e3c30)[_0xc3be('0x1f')](_0x45b4ba);}};}function respondWithFilteredResult(_0x4c1810,_0x4d05c7){return function(_0x18d6a3){if(_0x18d6a3){var _0x4f966d=typeof _0x4d05c7[_0xc3be('0x20')]===_0xc3be('0x21')&&typeof _0x4d05c7[_0xc3be('0x22')]===_0xc3be('0x21');var _0xfbe593=_0x18d6a3[_0xc3be('0x23')];var _0x428e91=_0x4f966d?0x0:_0x4d05c7[_0xc3be('0x20')];var _0x2f28fb=_0x4f966d?_0x18d6a3[_0xc3be('0x23')]:_0x4d05c7[_0xc3be('0x20')]+_0x4d05c7[_0xc3be('0x22')];var _0x355e14;if(_0x2f28fb>=_0xfbe593){_0x2f28fb=_0xfbe593;_0x355e14=0xc8;}else{_0x355e14=0xce;}_0x4c1810[_0xc3be('0x1e')](_0x355e14);return _0x4c1810['set'](_0xc3be('0x24'),_0x428e91+'-'+_0x2f28fb+'/'+_0xfbe593)[_0xc3be('0x1f')](_0x18d6a3);}return null;};}function patchUpdates(_0x35adcf){return function(_0x2ec07c){try{jsonpatch[_0xc3be('0x25')](_0x2ec07c,_0x35adcf,!![]);}catch(_0x303bfa){return BPromise['reject'](_0x303bfa);}return _0x2ec07c[_0xc3be('0x26')]();};}function saveUpdates(_0x14d64c,_0x382d5a){return function(_0x729493){if(_0x729493){return _0x729493[_0xc3be('0x27')](_0x14d64c)[_0xc3be('0x28')](function(_0x2d537e){return _0x2d537e;});}return null;};}function removeEntity(_0xcb63dc,_0x530ffc){return function(_0x369a55){if(_0x369a55){return _0x369a55[_0xc3be('0x29')]()[_0xc3be('0x28')](function(){_0xcb63dc[_0xc3be('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174c83,_0x76510b){return function(_0x469f86){if(!_0x469f86){_0x174c83['sendStatus'](0x194);}return _0x469f86;};}function handleError(_0x167042,_0x5b968d){_0x5b968d=_0x5b968d||0x1f4;return function(_0x516fa4){logger[_0xc3be('0x2a')](_0x516fa4[_0xc3be('0x2b')]);if(_0x516fa4['name']){delete _0x516fa4['name'];}_0x167042[_0xc3be('0x1e')](_0x5b968d)[_0xc3be('0x2c')](_0x516fa4);};}exports[_0xc3be('0x2d')]=function(_0x150e9e,_0x2c89d7){var _0x52613a={},_0x4afdb6={},_0x5f3f00={'count':0x0,'rows':[]};var _0x536a8c=_[_0xc3be('0x2e')](db[_0xc3be('0x2f')][_0xc3be('0x30')],function(_0x12bc62){return{'name':_0x12bc62[_0xc3be('0x31')],'type':_0x12bc62[_0xc3be('0x32')][_0xc3be('0x33')]};});_0x4afdb6[_0xc3be('0x34')]=_[_0xc3be('0x2e')](_0x536a8c,_0xc3be('0x35'));_0x4afdb6[_0xc3be('0x36')]=_['keys'](_0x150e9e[_0xc3be('0x36')]);_0x4afdb6[_0xc3be('0x37')]=_[_0xc3be('0x38')](_0x4afdb6[_0xc3be('0x34')],_0x4afdb6['query']);_0x52613a[_0xc3be('0x39')]=_['intersection'](_0x4afdb6[_0xc3be('0x34')],qs[_0xc3be('0x3a')](_0x150e9e[_0xc3be('0x36')][_0xc3be('0x3a')]));_0x52613a['attributes']=_0x52613a['attributes'][_0xc3be('0x3b')]?_0x52613a[_0xc3be('0x39')]:_0x4afdb6[_0xc3be('0x34')];if(!_0x150e9e[_0xc3be('0x36')]['hasOwnProperty'](_0xc3be('0x3c'))){_0x52613a[_0xc3be('0x22')]=qs[_0xc3be('0x22')](_0x150e9e[_0xc3be('0x36')][_0xc3be('0x22')]);_0x52613a[_0xc3be('0x20')]=qs['offset'](_0x150e9e[_0xc3be('0x36')][_0xc3be('0x20')]);}_0x52613a[_0xc3be('0x3d')]=qs['sort'](_0x150e9e[_0xc3be('0x36')][_0xc3be('0x3e')]);_0x52613a[_0xc3be('0x3f')]=qs[_0xc3be('0x37')](_[_0xc3be('0x40')](_0x150e9e[_0xc3be('0x36')],_0x4afdb6[_0xc3be('0x37')]),_0x536a8c);if(_0x150e9e[_0xc3be('0x36')][_0xc3be('0x41')]){_0x52613a['where']=_[_0xc3be('0x42')](_0x52613a[_0xc3be('0x3f')],{'$or':_[_0xc3be('0x2e')](_0x536a8c,function(_0x32cc7e){if(_0x32cc7e[_0xc3be('0x32')]!==_0xc3be('0x43')){var _0x4b15e4={};_0x4b15e4[_0x32cc7e[_0xc3be('0x35')]]={'$like':'%'+_0x150e9e[_0xc3be('0x36')][_0xc3be('0x41')]+'%'};return _0x4b15e4;}})});}_0x52613a=_[_0xc3be('0x42')]({},_0x52613a,_0x150e9e[_0xc3be('0x44')]);var _0x3cc43e={'where':_0x52613a['where']};return db[_0xc3be('0x2f')][_0xc3be('0x23')](_0x3cc43e)[_0xc3be('0x28')](function(_0x10175b){_0x5f3f00['count']=_0x10175b;if(_0x150e9e[_0xc3be('0x36')][_0xc3be('0x45')]){_0x52613a[_0xc3be('0x46')]=[{'all':!![]}];}return db[_0xc3be('0x2f')][_0xc3be('0x47')](_0x52613a);})[_0xc3be('0x28')](function(_0x408a27){_0x5f3f00[_0xc3be('0x48')]=_0x408a27;return _0x5f3f00;})['then'](respondWithFilteredResult(_0x2c89d7,_0x52613a))[_0xc3be('0x49')](handleError(_0x2c89d7,null));};exports[_0xc3be('0x4a')]=function(_0x2441d8,_0x56f27f){var _0x51875a={'raw':!![],'where':{'id':_0x2441d8[_0xc3be('0x4b')]['id']}},_0x424058={};_0x424058['model']=_['keys'](db[_0xc3be('0x2f')][_0xc3be('0x30')]);_0x424058[_0xc3be('0x36')]=_['keys'](_0x2441d8['query']);_0x424058[_0xc3be('0x37')]=_[_0xc3be('0x38')](_0x424058[_0xc3be('0x34')],_0x424058[_0xc3be('0x36')]);_0x51875a[_0xc3be('0x39')]=_[_0xc3be('0x38')](_0x424058[_0xc3be('0x34')],qs[_0xc3be('0x3a')](_0x2441d8[_0xc3be('0x36')][_0xc3be('0x3a')]));_0x51875a[_0xc3be('0x39')]=_0x51875a['attributes'][_0xc3be('0x3b')]?_0x51875a[_0xc3be('0x39')]:_0x424058[_0xc3be('0x34')];if(_0x2441d8[_0xc3be('0x36')][_0xc3be('0x45')]){_0x51875a['include']=[{'all':!![]}];}_0x51875a=_['merge']({},_0x51875a,_0x2441d8[_0xc3be('0x44')]);return db[_0xc3be('0x2f')][_0xc3be('0x4c')](_0x51875a)[_0xc3be('0x28')](handleEntityNotFound(_0x56f27f,null))[_0xc3be('0x28')](respondWithResult(_0x56f27f,null))[_0xc3be('0x49')](handleError(_0x56f27f,null));};exports[_0xc3be('0x4d')]=function(_0x46b6ea,_0x314f67){return db['JscriptyQuestionReport'][_0xc3be('0x4d')](_0x46b6ea[_0xc3be('0x4e')],{})[_0xc3be('0x28')](respondWithResult(_0x314f67,0xc9))[_0xc3be('0x49')](handleError(_0x314f67,null));};exports[_0xc3be('0x27')]=function(_0x24f7f1,_0x106822){if(_0x24f7f1[_0xc3be('0x4e')]['id']){delete _0x24f7f1['body']['id'];}return db[_0xc3be('0x2f')][_0xc3be('0x4c')]({'where':{'id':_0x24f7f1['params']['id']}})[_0xc3be('0x28')](handleEntityNotFound(_0x106822,null))[_0xc3be('0x28')](saveUpdates(_0x24f7f1[_0xc3be('0x4e')],null))[_0xc3be('0x28')](respondWithResult(_0x106822,null))[_0xc3be('0x49')](handleError(_0x106822,null));};exports[_0xc3be('0x29')]=function(_0x55d87d,_0x44563e){return db[_0xc3be('0x2f')][_0xc3be('0x4c')]({'where':{'id':_0x55d87d[_0xc3be('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44563e,null))['then'](removeEntity(_0x44563e,null))[_0xc3be('0x49')](handleError(_0x44563e,null));};exports[_0xc3be('0x4f')]=function(_0x58dfc9,_0x596803){return db[_0xc3be('0x2f')][_0xc3be('0x4f')]()[_0xc3be('0x28')](respondWithResult(_0x596803,null))[_0xc3be('0x49')](handleError(_0x596803,null));}; \ No newline at end of file +var _0x5a14=['apply','reject','update','then','destroy','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x266a39,_0x5ae672){var _0x45105d=function(_0x551156){while(--_0x551156){_0x266a39['push'](_0x266a39['shift']());}};_0x45105d(++_0x5ae672);}(_0x5a14,0x73));var _0x45a1=function(_0xec66c3,_0x987871){_0xec66c3=_0xec66c3-0x0;var _0x3a66e6=_0x5a14[_0xec66c3];return _0x3a66e6;};'use strict';var emlformat=require(_0x45a1('0x0'));var rimraf=require(_0x45a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x45a1('0x2'));var rp=require('request-promise');var moment=require(_0x45a1('0x3'));var BPromise=require(_0x45a1('0x4'));var Mustache=require(_0x45a1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x45a1('0x6'));var csv=require(_0x45a1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45a1('0x8'));var _=require(_0x45a1('0x9'));var squel=require('squel');var crypto=require(_0x45a1('0xa'));var jsforce=require(_0x45a1('0xb'));var deskjs=require(_0x45a1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x45a1('0xd'));var Papa=require(_0x45a1('0xe'));var Redis=require(_0x45a1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x45a1('0x10'));var as=require(_0x45a1('0x11'));var hardwareService=require(_0x45a1('0x12'));var logger=require(_0x45a1('0x13'))(_0x45a1('0x14'));var utils=require(_0x45a1('0x15'));var config=require(_0x45a1('0x16'));var licenseUtil=require(_0x45a1('0x17'));var db=require(_0x45a1('0x18'))['db'];function respondWithStatusCode(_0x428e86,_0x245303){_0x245303=_0x245303||0xcc;return function(_0x4951ef){if(_0x4951ef){return _0x428e86[_0x45a1('0x19')](_0x245303);}return _0x428e86[_0x45a1('0x1a')](_0x245303)[_0x45a1('0x1b')]();};}function respondWithResult(_0x2865d5,_0x1bc8fd){_0x1bc8fd=_0x1bc8fd||0xc8;return function(_0x226b70){if(_0x226b70){return _0x2865d5[_0x45a1('0x1a')](_0x1bc8fd)[_0x45a1('0x1c')](_0x226b70);}};}function respondWithFilteredResult(_0x4e65ef,_0x14cd63){return function(_0x5b462b){if(_0x5b462b){var _0x285515=typeof _0x14cd63[_0x45a1('0x1d')]===_0x45a1('0x1e')&&typeof _0x14cd63[_0x45a1('0x1f')]===_0x45a1('0x1e');var _0x4583ca=_0x5b462b[_0x45a1('0x20')];var _0x4ea36a=_0x285515?0x0:_0x14cd63[_0x45a1('0x1d')];var _0x580444=_0x285515?_0x5b462b['count']:_0x14cd63[_0x45a1('0x1d')]+_0x14cd63[_0x45a1('0x1f')];var _0x577fbd;if(_0x580444>=_0x4583ca){_0x580444=_0x4583ca;_0x577fbd=0xc8;}else{_0x577fbd=0xce;}_0x4e65ef['status'](_0x577fbd);return _0x4e65ef[_0x45a1('0x21')](_0x45a1('0x22'),_0x4ea36a+'-'+_0x580444+'/'+_0x4583ca)[_0x45a1('0x1c')](_0x5b462b);}return null;};}function patchUpdates(_0x2fd1c8){return function(_0xac45c8){try{jsonpatch[_0x45a1('0x23')](_0xac45c8,_0x2fd1c8,!![]);}catch(_0x5e5092){return BPromise[_0x45a1('0x24')](_0x5e5092);}return _0xac45c8['save']();};}function saveUpdates(_0x39c582,_0x23c5cc){return function(_0x3f1cb2){if(_0x3f1cb2){return _0x3f1cb2[_0x45a1('0x25')](_0x39c582)[_0x45a1('0x26')](function(_0x226b97){return _0x226b97;});}return null;};}function removeEntity(_0x288ce8,_0x308adb){return function(_0x32776b){if(_0x32776b){return _0x32776b[_0x45a1('0x27')]()[_0x45a1('0x26')](function(){_0x288ce8['status'](0xcc)[_0x45a1('0x1b')]();});}};}function handleEntityNotFound(_0x5209cc,_0x325cd1){return function(_0x4fa6b2){if(!_0x4fa6b2){_0x5209cc['sendStatus'](0x194);}return _0x4fa6b2;};}function handleError(_0xc4821e,_0x276b3f){_0x276b3f=_0x276b3f||0x1f4;return function(_0x34252b){logger[_0x45a1('0x28')](_0x34252b[_0x45a1('0x29')]);if(_0x34252b[_0x45a1('0x2a')]){delete _0x34252b[_0x45a1('0x2a')];}_0xc4821e[_0x45a1('0x1a')](_0x276b3f)[_0x45a1('0x2b')](_0x34252b);};}exports['index']=function(_0x17317b,_0x24039b){var _0x1dec80={},_0x43dda9={},_0x5164a0={'count':0x0,'rows':[]};var _0x21b345=_[_0x45a1('0x2c')](db[_0x45a1('0x2d')][_0x45a1('0x2e')],function(_0x465965){return{'name':_0x465965[_0x45a1('0x2f')],'type':_0x465965[_0x45a1('0x30')][_0x45a1('0x31')]};});_0x43dda9[_0x45a1('0x32')]=_[_0x45a1('0x2c')](_0x21b345,_0x45a1('0x2a'));_0x43dda9[_0x45a1('0x33')]=_[_0x45a1('0x34')](_0x17317b[_0x45a1('0x33')]);_0x43dda9['filters']=_[_0x45a1('0x35')](_0x43dda9['model'],_0x43dda9[_0x45a1('0x33')]);_0x1dec80[_0x45a1('0x36')]=_['intersection'](_0x43dda9['model'],qs[_0x45a1('0x37')](_0x17317b[_0x45a1('0x33')]['fields']));_0x1dec80['attributes']=_0x1dec80[_0x45a1('0x36')][_0x45a1('0x38')]?_0x1dec80[_0x45a1('0x36')]:_0x43dda9['model'];if(!_0x17317b[_0x45a1('0x33')]['hasOwnProperty'](_0x45a1('0x39'))){_0x1dec80[_0x45a1('0x1f')]=qs['limit'](_0x17317b['query'][_0x45a1('0x1f')]);_0x1dec80[_0x45a1('0x1d')]=qs[_0x45a1('0x1d')](_0x17317b['query']['offset']);}_0x1dec80['order']=qs[_0x45a1('0x3a')](_0x17317b[_0x45a1('0x33')]['sort']);_0x1dec80[_0x45a1('0x3b')]=qs[_0x45a1('0x3c')](_['pick'](_0x17317b[_0x45a1('0x33')],_0x43dda9['filters']),_0x21b345);if(_0x17317b['query'][_0x45a1('0x3d')]){_0x1dec80[_0x45a1('0x3b')]=_[_0x45a1('0x3e')](_0x1dec80[_0x45a1('0x3b')],{'$or':_[_0x45a1('0x2c')](_0x21b345,function(_0x1c5298){if(_0x1c5298[_0x45a1('0x30')]!==_0x45a1('0x3f')){var _0xd83c5e={};_0xd83c5e[_0x1c5298[_0x45a1('0x2a')]]={'$like':'%'+_0x17317b[_0x45a1('0x33')][_0x45a1('0x3d')]+'%'};return _0xd83c5e;}})});}_0x1dec80=_[_0x45a1('0x3e')]({},_0x1dec80,_0x17317b[_0x45a1('0x40')]);var _0x49a082={'where':_0x1dec80[_0x45a1('0x3b')]};return db[_0x45a1('0x2d')]['count'](_0x49a082)[_0x45a1('0x26')](function(_0x459fa3){_0x5164a0[_0x45a1('0x20')]=_0x459fa3;if(_0x17317b[_0x45a1('0x33')][_0x45a1('0x41')]){_0x1dec80['include']=[{'all':!![]}];}return db[_0x45a1('0x2d')][_0x45a1('0x42')](_0x1dec80);})[_0x45a1('0x26')](function(_0x39d5d2){_0x5164a0['rows']=_0x39d5d2;return _0x5164a0;})[_0x45a1('0x26')](respondWithFilteredResult(_0x24039b,_0x1dec80))[_0x45a1('0x43')](handleError(_0x24039b,null));};exports[_0x45a1('0x44')]=function(_0x57de76,_0x1baf44){var _0x4c3b11={'raw':!![],'where':{'id':_0x57de76[_0x45a1('0x45')]['id']}},_0x534be8={};_0x534be8[_0x45a1('0x32')]=_[_0x45a1('0x34')](db[_0x45a1('0x2d')][_0x45a1('0x2e')]);_0x534be8[_0x45a1('0x33')]=_[_0x45a1('0x34')](_0x57de76[_0x45a1('0x33')]);_0x534be8[_0x45a1('0x3c')]=_['intersection'](_0x534be8[_0x45a1('0x32')],_0x534be8[_0x45a1('0x33')]);_0x4c3b11['attributes']=_[_0x45a1('0x35')](_0x534be8[_0x45a1('0x32')],qs['fields'](_0x57de76['query'][_0x45a1('0x37')]));_0x4c3b11[_0x45a1('0x36')]=_0x4c3b11[_0x45a1('0x36')][_0x45a1('0x38')]?_0x4c3b11['attributes']:_0x534be8[_0x45a1('0x32')];if(_0x57de76['query'][_0x45a1('0x41')]){_0x4c3b11[_0x45a1('0x46')]=[{'all':!![]}];}_0x4c3b11=_['merge']({},_0x4c3b11,_0x57de76[_0x45a1('0x40')]);return db[_0x45a1('0x2d')][_0x45a1('0x47')](_0x4c3b11)[_0x45a1('0x26')](handleEntityNotFound(_0x1baf44,null))[_0x45a1('0x26')](respondWithResult(_0x1baf44,null))[_0x45a1('0x43')](handleError(_0x1baf44,null));};exports['create']=function(_0x5a52b2,_0x10393c){return db['JscriptyQuestionReport'][_0x45a1('0x48')](_0x5a52b2[_0x45a1('0x49')],{})[_0x45a1('0x26')](respondWithResult(_0x10393c,0xc9))[_0x45a1('0x43')](handleError(_0x10393c,null));};exports['update']=function(_0x37e2b3,_0x25f9e3){if(_0x37e2b3[_0x45a1('0x49')]['id']){delete _0x37e2b3[_0x45a1('0x49')]['id'];}return db[_0x45a1('0x2d')][_0x45a1('0x47')]({'where':{'id':_0x37e2b3[_0x45a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x25f9e3,null))[_0x45a1('0x26')](saveUpdates(_0x37e2b3[_0x45a1('0x49')],null))['then'](respondWithResult(_0x25f9e3,null))[_0x45a1('0x43')](handleError(_0x25f9e3,null));};exports[_0x45a1('0x27')]=function(_0x13a75e,_0x2fa7ae){return db[_0x45a1('0x2d')][_0x45a1('0x47')]({'where':{'id':_0x13a75e['params']['id']}})[_0x45a1('0x26')](handleEntityNotFound(_0x2fa7ae,null))[_0x45a1('0x26')](removeEntity(_0x2fa7ae,null))[_0x45a1('0x43')](handleError(_0x2fa7ae,null));};exports[_0x45a1('0x4a')]=function(_0x1c528a,_0x1ed865){return db[_0x45a1('0x2d')]['describe']()['then'](respondWithResult(_0x1ed865,null))[_0x45a1('0x43')](handleError(_0x1ed865,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 028878f..3196d25 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce06=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e80af,_0x3ace86){var _0x1a49e0=function(_0x4df556){while(--_0x4df556){_0x1e80af['push'](_0x1e80af['shift']());}};_0x1a49e0(++_0x3ace86);}(_0xce06,0x1d9));var _0x6ce0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce06[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ce0('0x0'));var util=require(_0x6ce0('0x1'));var logger=require(_0x6ce0('0x2'))('api');var moment=require(_0x6ce0('0x3'));var BPromise=require(_0x6ce0('0x4'));var rp=require(_0x6ce0('0x5'));var fs=require('fs');var path=require(_0x6ce0('0x6'));var rimraf=require(_0x6ce0('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ce0('0x8'));module[_0x6ce0('0x9')]=function(_0x10931f,_0x5dfda7){return _0x10931f[_0x6ce0('0xa')](_0x6ce0('0xb'),attributes,{'tableName':_0x6ce0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd0a=['JscriptyQuestionReport','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x35d44b,_0x587933){var _0x2a32ab=function(_0x3fb928){while(--_0x3fb928){_0x35d44b['push'](_0x35d44b['shift']());}};_0x2a32ab(++_0x587933);}(_0xdd0a,0x15d));var _0xadd0=function(_0x33b774,_0x59f711){_0x33b774=_0x33b774-0x0;var _0x5c3cb1=_0xdd0a[_0x33b774];return _0x5c3cb1;};'use strict';var _=require(_0xadd0('0x0'));var util=require(_0xadd0('0x1'));var logger=require('../../config/logger')(_0xadd0('0x2'));var moment=require(_0xadd0('0x3'));var BPromise=require(_0xadd0('0x4'));var rp=require(_0xadd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadd0('0x6'));var config=require(_0xadd0('0x7'));var attributes=require(_0xadd0('0x8'));module[_0xadd0('0x9')]=function(_0x5c60f6,_0x32e4b3){return _0x5c60f6[_0xadd0('0xa')](_0xadd0('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index a3e63d8..2942f43 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaa6=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5c9a2e,_0x468cb0){var _0xa32889=function(_0x1780de){while(--_0x1780de){_0x5c9a2e['push'](_0x5c9a2e['shift']());}};_0xa32889(++_0x468cb0);}(_0xbaa6,0x14e));var _0x6baa=function(_0x1cd916,_0x333f5c){_0x1cd916=_0x1cd916-0x0;var _0x1ff07a=_0xbaa6[_0x1cd916];return _0x1ff07a;};'use strict';var _=require(_0x6baa('0x0'));var util=require('util');var moment=require(_0x6baa('0x1'));var BPromise=require('bluebird');var rs=require(_0x6baa('0x2'));var fs=require('fs');var Redis=require(_0x6baa('0x3'));var db=require(_0x6baa('0x4'))['db'];var utils=require(_0x6baa('0x5'));var logger=require(_0x6baa('0x6'))(_0x6baa('0x7'));var config=require(_0x6baa('0x8'));var jayson=require(_0x6baa('0x9'));var client=jayson[_0x6baa('0xa')][_0x6baa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55eaf5,_0x45d00e,_0xeac31a){return new BPromise(function(_0x33fe9e,_0x9475c){return client[_0x6baa('0xc')](_0x55eaf5,_0xeac31a)[_0x6baa('0xd')](function(_0x32a887){logger['info'](_0x6baa('0xe'),_0x45d00e,_0x6baa('0xf'));logger[_0x6baa('0x10')](_0x6baa('0x11'),_0x45d00e,_0x6baa('0xf'),JSON[_0x6baa('0x12')](_0x32a887));if(_0x32a887[_0x6baa('0x13')]){if(_0x32a887['error'][_0x6baa('0x14')]===0x1f4){logger[_0x6baa('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x45d00e,_0x32a887[_0x6baa('0x13')][_0x6baa('0x15')]);return _0x9475c(_0x32a887['error'][_0x6baa('0x15')]);}logger[_0x6baa('0x13')](_0x6baa('0xe'),_0x45d00e,_0x32a887['error'][_0x6baa('0x15')]);return _0x33fe9e(_0x32a887[_0x6baa('0x13')][_0x6baa('0x15')]);}else{logger[_0x6baa('0x16')](_0x6baa('0xe'),_0x45d00e,_0x6baa('0xf'));_0x33fe9e(_0x32a887[_0x6baa('0x17')]['message']);}})[_0x6baa('0x18')](function(_0x12c5f6){logger['error'](_0x6baa('0xe'),_0x45d00e,_0x12c5f6);_0x9475c(_0x12c5f6);});});} \ No newline at end of file +var _0x0b13=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x253676,_0x1a45dd){var _0x398e4b=function(_0x36e001){while(--_0x36e001){_0x253676['push'](_0x253676['shift']());}};_0x398e4b(++_0x1a45dd);}(_0x0b13,0x1b9));var _0x30b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0b13[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x30b1('0x0'));var util=require(_0x30b1('0x1'));var moment=require(_0x30b1('0x2'));var BPromise=require(_0x30b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x30b1('0x4'));var logger=require(_0x30b1('0x5'))(_0x30b1('0x6'));var config=require(_0x30b1('0x7'));var jayson=require(_0x30b1('0x8'));var client=jayson['client'][_0x30b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6e9a47,_0x66a018,_0x2ffe9d){return new BPromise(function(_0x7e2527,_0x298ebd){return client['request'](_0x6e9a47,_0x2ffe9d)['then'](function(_0x155866){logger['info'](_0x30b1('0xa'),_0x66a018,_0x30b1('0xb'));logger[_0x30b1('0xc')](_0x30b1('0xd'),_0x66a018,_0x30b1('0xb'),JSON[_0x30b1('0xe')](_0x155866));if(_0x155866['error']){if(_0x155866[_0x30b1('0xf')][_0x30b1('0x10')]===0x1f4){logger[_0x30b1('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x66a018,_0x155866[_0x30b1('0xf')][_0x30b1('0x11')]);return _0x298ebd(_0x155866[_0x30b1('0xf')]['message']);}logger[_0x30b1('0xf')](_0x30b1('0xa'),_0x66a018,_0x155866[_0x30b1('0xf')][_0x30b1('0x11')]);return _0x7e2527(_0x155866[_0x30b1('0xf')][_0x30b1('0x11')]);}else{logger[_0x30b1('0x12')](_0x30b1('0xa'),_0x66a018,_0x30b1('0xb'));_0x7e2527(_0x155866[_0x30b1('0x13')][_0x30b1('0x11')]);}})[_0x30b1('0x14')](function(_0x469981){logger[_0x30b1('0xf')](_0x30b1('0xa'),_0x66a018,_0x469981);_0x298ebd(_0x469981);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8ca841b..11bb61b 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64a9=['/:id','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','show','/:id/questions','post','create','put'];(function(_0x5173a6,_0x1eb1e2){var _0x2d4a8d=function(_0x1585a5){while(--_0x1585a5){_0x5173a6['push'](_0x5173a6['shift']());}};_0x2d4a8d(++_0x1eb1e2);}(_0x64a9,0xd2));var _0x964a=function(_0x419300,_0x109ef0){_0x419300=_0x419300-0x0;var _0x43aa95=_0x64a9[_0x419300];return _0x43aa95;};'use strict';var multer=require(_0x964a('0x0'));var util=require(_0x964a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x964a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x964a('0x3'));var interaction=require(_0x964a('0x4'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x964a('0x5')](),controller['index']);router[_0x964a('0x6')](_0x964a('0x7'),auth[_0x964a('0x5')](),controller[_0x964a('0x8')]);router['get']('/:id',auth[_0x964a('0x5')](),controller[_0x964a('0x9')]);router[_0x964a('0x6')](_0x964a('0xa'),auth[_0x964a('0x5')](),controller['getQuestions']);router[_0x964a('0xb')]('/',auth[_0x964a('0x5')](),controller[_0x964a('0xc')]);router[_0x964a('0xd')](_0x964a('0xe'),auth[_0x964a('0x5')](),controller['update']);router['delete'](_0x964a('0xe'),auth[_0x964a('0x5')](),controller[_0x964a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8c2e=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','/:id/questions','getQuestions','post'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x8c2e,0x1d2));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe8c2('0x0'));var util=require(_0xe8c2('0x1'));var path=require(_0xe8c2('0x2'));var timeout=require('connect-timeout');var express=require(_0xe8c2('0x3'));var router=express[_0xe8c2('0x4')]();var fs_extra=require(_0xe8c2('0x5'));var auth=require(_0xe8c2('0x6'));var interaction=require(_0xe8c2('0x7'));var config=require(_0xe8c2('0x8'));var controller=require(_0xe8c2('0x9'));router[_0xe8c2('0xa')]('/',auth[_0xe8c2('0xb')](),controller['index']);router[_0xe8c2('0xa')]('/describe',auth[_0xe8c2('0xb')](),controller[_0xe8c2('0xc')]);router['get'](_0xe8c2('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe8c2('0xa')](_0xe8c2('0xe'),auth[_0xe8c2('0xb')](),controller[_0xe8c2('0xf')]);router[_0xe8c2('0x10')]('/',auth['isAuthenticated'](),controller[_0xe8c2('0x11')]);router[_0xe8c2('0x12')](_0xe8c2('0xd'),auth['isAuthenticated'](),controller[_0xe8c2('0x13')]);router[_0xe8c2('0x14')](_0xe8c2('0xd'),auth['isAuthenticated'](),controller[_0xe8c2('0x15')]);module[_0xe8c2('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 94bb7aa..ebd0fef 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d8b=['endtime','STRING','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x0d8b,0x8a));var _0xb0d8=function(_0x39758d,_0x346423){_0x39758d=_0x39758d-0x0;var _0x44ac11=_0x0d8b[_0x39758d];return _0x44ac11;};'use strict';var moment=require(_0xb0d8('0x0'));var Sequelize=require(_0xb0d8('0x1'));module[_0xb0d8('0x2')]={'starttime':{'type':Sequelize[_0xb0d8('0x3')],'set':function(_0x35cc17){this[_0xb0d8('0x4')](_0xb0d8('0x5'),_0x35cc17);this[_0xb0d8('0x4')](_0xb0d8('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xb0d8('0x3')]},'membername':{'type':Sequelize[_0xb0d8('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb0d8('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb0d8('0x7')]},'calleridnum':{'type':Sequelize[_0xb0d8('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1107=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue'];(function(_0x1a934d,_0x26d7b2){var _0x3f96e1=function(_0x60398a){while(--_0x60398a){_0x1a934d['push'](_0x1a934d['shift']());}};_0x3f96e1(++_0x26d7b2);}(_0x1107,0xd8));var _0x7110=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x1107[_0x43941d];return _0x27b82a;};'use strict';var moment=require(_0x7110('0x0'));var Sequelize=require(_0x7110('0x1'));module[_0x7110('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4ecd2f){this[_0x7110('0x3')](_0x7110('0x4'),_0x4ecd2f);this['setDataValue'](_0x7110('0x5'),moment()[_0x7110('0x6')](_0x7110('0x7')));}},'endtime':{'type':Sequelize[_0x7110('0x8')]},'membername':{'type':Sequelize[_0x7110('0x9')]},'projectname':{'type':Sequelize[_0x7110('0x9')]},'queue':{'type':Sequelize[_0x7110('0x9')]},'uniqueid':{'type':Sequelize[_0x7110('0x9')]},'calleridname':{'type':Sequelize[_0x7110('0x9')]},'calleridnum':{'type':Sequelize[_0x7110('0x9')]},'completed':{'type':Sequelize[_0x7110('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index f3e6084..604fa90 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc516=['index','map','JscriptySessionReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','catch','create','body','update','find','params','describe','getQuestions','findOne','rawAttributes','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','error','stack','name'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xc516,0x170));var _0x6c51=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0xc516[_0x26a10d];return _0xf90201;};'use strict';var emlformat=require(_0x6c51('0x0'));var rimraf=require(_0x6c51('0x1'));var zipdir=require(_0x6c51('0x2'));var jsonpatch=require(_0x6c51('0x3'));var rp=require(_0x6c51('0x4'));var moment=require(_0x6c51('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6c51('0x6'));var util=require(_0x6c51('0x7'));var path=require(_0x6c51('0x8'));var sox=require(_0x6c51('0x9'));var csv=require(_0x6c51('0xa'));var ejs=require(_0x6c51('0xb'));var fs=require('fs');var fs_extra=require(_0x6c51('0xc'));var _=require(_0x6c51('0xd'));var squel=require('squel');var crypto=require(_0x6c51('0xe'));var jsforce=require(_0x6c51('0xf'));var deskjs=require(_0x6c51('0x10'));var toCsv=require(_0x6c51('0xa'));var querystring=require(_0x6c51('0x11'));var Papa=require('papaparse');var Redis=require(_0x6c51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6c51('0x13'));var as=require(_0x6c51('0x14'));var hardwareService=require(_0x6c51('0x15'));var logger=require('../../config/logger')(_0x6c51('0x16'));var utils=require(_0x6c51('0x17'));var config=require(_0x6c51('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c51('0x19'))['db'];function respondWithStatusCode(_0x419eeb,_0x8abffc){_0x8abffc=_0x8abffc||0xcc;return function(_0xb35ead){if(_0xb35ead){return _0x419eeb[_0x6c51('0x1a')](_0x8abffc);}return _0x419eeb[_0x6c51('0x1b')](_0x8abffc)['end']();};}function respondWithResult(_0x3b022f,_0x1b926d){_0x1b926d=_0x1b926d||0xc8;return function(_0x251475){if(_0x251475){return _0x3b022f[_0x6c51('0x1b')](_0x1b926d)[_0x6c51('0x1c')](_0x251475);}};}function respondWithFilteredResult(_0x2062f7,_0x4c0368){return function(_0x3f85e0){if(_0x3f85e0){var _0x5058ed=typeof _0x4c0368[_0x6c51('0x1d')]===_0x6c51('0x1e')&&typeof _0x4c0368['limit']==='undefined';var _0x26baa0=_0x3f85e0[_0x6c51('0x1f')];var _0x7b4e23=_0x5058ed?0x0:_0x4c0368['offset'];var _0x1c3e4a=_0x5058ed?_0x3f85e0[_0x6c51('0x1f')]:_0x4c0368[_0x6c51('0x1d')]+_0x4c0368[_0x6c51('0x20')];var _0x2be361;if(_0x1c3e4a>=_0x26baa0){_0x1c3e4a=_0x26baa0;_0x2be361=0xc8;}else{_0x2be361=0xce;}_0x2062f7[_0x6c51('0x1b')](_0x2be361);return _0x2062f7[_0x6c51('0x21')](_0x6c51('0x22'),_0x7b4e23+'-'+_0x1c3e4a+'/'+_0x26baa0)[_0x6c51('0x1c')](_0x3f85e0);}return null;};}function patchUpdates(_0x36bc22){return function(_0x5e970f){try{jsonpatch['apply'](_0x5e970f,_0x36bc22,!![]);}catch(_0x1f23ef){return BPromise[_0x6c51('0x23')](_0x1f23ef);}return _0x5e970f[_0x6c51('0x24')]();};}function saveUpdates(_0x4441c2,_0x3f69dd){return function(_0x341dc9){if(_0x341dc9){return _0x341dc9['update'](_0x4441c2)['then'](function(_0x205722){return _0x205722;});}return null;};}function removeEntity(_0x371e28,_0x3af966){return function(_0x4afe8b){if(_0x4afe8b){return _0x4afe8b[_0x6c51('0x25')]()[_0x6c51('0x26')](function(){_0x371e28['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a36e,_0x9c7840){return function(_0x23c9ca){if(!_0x23c9ca){_0x38a36e[_0x6c51('0x1a')](0x194);}return _0x23c9ca;};}function handleError(_0x2364c9,_0x1acd62){_0x1acd62=_0x1acd62||0x1f4;return function(_0x17ec86){logger[_0x6c51('0x27')](_0x17ec86[_0x6c51('0x28')]);if(_0x17ec86[_0x6c51('0x29')]){delete _0x17ec86[_0x6c51('0x29')];}_0x2364c9[_0x6c51('0x1b')](_0x1acd62)['send'](_0x17ec86);};}exports[_0x6c51('0x2a')]=function(_0x442e85,_0x529145){var _0x176938={},_0x375a39={},_0x31c7f3={'count':0x0,'rows':[]};var _0x423b89=_[_0x6c51('0x2b')](db[_0x6c51('0x2c')]['rawAttributes'],function(_0x48f4c2){return{'name':_0x48f4c2[_0x6c51('0x2d')],'type':_0x48f4c2[_0x6c51('0x2e')][_0x6c51('0x2f')]};});_0x375a39[_0x6c51('0x30')]=_[_0x6c51('0x2b')](_0x423b89,_0x6c51('0x29'));_0x375a39['query']=_[_0x6c51('0x31')](_0x442e85['query']);_0x375a39[_0x6c51('0x32')]=_[_0x6c51('0x33')](_0x375a39['model'],_0x375a39[_0x6c51('0x34')]);_0x176938[_0x6c51('0x35')]=_[_0x6c51('0x33')](_0x375a39['model'],qs[_0x6c51('0x36')](_0x442e85[_0x6c51('0x34')][_0x6c51('0x36')]));_0x176938[_0x6c51('0x35')]=_0x176938[_0x6c51('0x35')][_0x6c51('0x37')]?_0x176938['attributes']:_0x375a39[_0x6c51('0x30')];if(!_0x442e85[_0x6c51('0x34')][_0x6c51('0x38')]('nolimit')){_0x176938['limit']=qs[_0x6c51('0x20')](_0x442e85['query'][_0x6c51('0x20')]);_0x176938[_0x6c51('0x1d')]=qs[_0x6c51('0x1d')](_0x442e85[_0x6c51('0x34')]['offset']);}_0x176938[_0x6c51('0x39')]=qs[_0x6c51('0x3a')](_0x442e85[_0x6c51('0x34')]['sort']);_0x176938[_0x6c51('0x3b')]=qs[_0x6c51('0x32')](_[_0x6c51('0x3c')](_0x442e85[_0x6c51('0x34')],_0x375a39[_0x6c51('0x32')]),_0x423b89);if(_0x442e85['query'][_0x6c51('0x3d')]){_0x176938[_0x6c51('0x3b')]=_[_0x6c51('0x3e')](_0x176938[_0x6c51('0x3b')],{'$or':_[_0x6c51('0x2b')](_0x423b89,function(_0x199bc5){if(_0x199bc5[_0x6c51('0x2e')]!==_0x6c51('0x3f')){var _0x546646={};_0x546646[_0x199bc5[_0x6c51('0x29')]]={'$like':'%'+_0x442e85['query']['filter']+'%'};return _0x546646;}})});}_0x176938=_[_0x6c51('0x3e')]({},_0x176938,_0x442e85[_0x6c51('0x40')]);var _0x5bc99c={'where':_0x176938[_0x6c51('0x3b')]};return db[_0x6c51('0x2c')][_0x6c51('0x1f')](_0x5bc99c)[_0x6c51('0x26')](function(_0x1220ee){_0x31c7f3[_0x6c51('0x1f')]=_0x1220ee;if(_0x442e85[_0x6c51('0x34')][_0x6c51('0x41')]){_0x176938[_0x6c51('0x42')]=[{'all':!![]}];}return db[_0x6c51('0x2c')]['findAll'](_0x176938);})[_0x6c51('0x26')](function(_0x26b0f6){_0x31c7f3[_0x6c51('0x43')]=_0x26b0f6;return _0x31c7f3;})['then'](respondWithFilteredResult(_0x529145,_0x176938))['catch'](handleError(_0x529145,null));};exports[_0x6c51('0x44')]=function(_0x298b97,_0x3b8e4b){var _0x539865={'raw':!![],'where':{'id':_0x298b97['params']['id']}},_0x5a6a73={};_0x5a6a73['model']=_[_0x6c51('0x31')](db[_0x6c51('0x2c')]['rawAttributes']);_0x5a6a73[_0x6c51('0x34')]=_[_0x6c51('0x31')](_0x298b97[_0x6c51('0x34')]);_0x5a6a73[_0x6c51('0x32')]=_[_0x6c51('0x33')](_0x5a6a73['model'],_0x5a6a73[_0x6c51('0x34')]);_0x539865[_0x6c51('0x35')]=_[_0x6c51('0x33')](_0x5a6a73['model'],qs[_0x6c51('0x36')](_0x298b97[_0x6c51('0x34')][_0x6c51('0x36')]));_0x539865[_0x6c51('0x35')]=_0x539865[_0x6c51('0x35')][_0x6c51('0x37')]?_0x539865[_0x6c51('0x35')]:_0x5a6a73['model'];if(_0x298b97[_0x6c51('0x34')][_0x6c51('0x41')]){_0x539865['include']=[{'all':!![]}];}_0x539865=_[_0x6c51('0x3e')]({},_0x539865,_0x298b97[_0x6c51('0x40')]);return db[_0x6c51('0x2c')]['find'](_0x539865)[_0x6c51('0x26')](handleEntityNotFound(_0x3b8e4b,null))['then'](respondWithResult(_0x3b8e4b,null))[_0x6c51('0x45')](handleError(_0x3b8e4b,null));};exports[_0x6c51('0x46')]=function(_0x1359f7,_0x416e10){return db[_0x6c51('0x2c')][_0x6c51('0x46')](_0x1359f7[_0x6c51('0x47')],{})[_0x6c51('0x26')](respondWithResult(_0x416e10,0xc9))[_0x6c51('0x45')](handleError(_0x416e10,null));};exports[_0x6c51('0x48')]=function(_0x4f4884,_0x572268){if(_0x4f4884['body']['id']){delete _0x4f4884['body']['id'];}return db[_0x6c51('0x2c')][_0x6c51('0x49')]({'where':{'id':_0x4f4884[_0x6c51('0x4a')]['id']}})['then'](handleEntityNotFound(_0x572268,null))[_0x6c51('0x26')](saveUpdates(_0x4f4884['body'],null))['then'](respondWithResult(_0x572268,null))[_0x6c51('0x45')](handleError(_0x572268,null));};exports[_0x6c51('0x25')]=function(_0x32797c,_0x74d927){return db[_0x6c51('0x2c')][_0x6c51('0x49')]({'where':{'id':_0x32797c[_0x6c51('0x4a')]['id']}})['then'](handleEntityNotFound(_0x74d927,null))[_0x6c51('0x26')](removeEntity(_0x74d927,null))['catch'](handleError(_0x74d927,null));};exports[_0x6c51('0x4b')]=function(_0x26fa73,_0x77dc6){return db[_0x6c51('0x2c')]['describe']()[_0x6c51('0x26')](respondWithResult(_0x77dc6,null))[_0x6c51('0x45')](handleError(_0x77dc6,null));};exports[_0x6c51('0x4c')]=function(_0x590e9b,_0x3e5900,_0xd70884){var _0xddde8a={'raw':!![],'where':{}};var _0x46c10d={};var _0x5b452c={'count':0x0,'rows':[]};return db[_0x6c51('0x2c')][_0x6c51('0x4d')]({'where':{'id':_0x590e9b['params']['id']}})[_0x6c51('0x26')](handleEntityNotFound(_0x3e5900,null))[_0x6c51('0x26')](function(_0x4068e2){if(_0x4068e2){_0x46c10d[_0x6c51('0x30')]=_[_0x6c51('0x31')](db['JscriptyQuestionReport'][_0x6c51('0x4e')]);_0x46c10d['query']=_[_0x6c51('0x31')](_0x590e9b['query']);_0x46c10d[_0x6c51('0x32')]=_[_0x6c51('0x33')](_0x46c10d[_0x6c51('0x30')],_0x46c10d[_0x6c51('0x34')]);_0xddde8a[_0x6c51('0x35')]=_[_0x6c51('0x33')](_0x46c10d[_0x6c51('0x30')],qs[_0x6c51('0x36')](_0x590e9b[_0x6c51('0x34')][_0x6c51('0x36')]));_0xddde8a['attributes']=_0xddde8a['attributes']['length']?_0xddde8a[_0x6c51('0x35')]:_0x46c10d[_0x6c51('0x30')];if(!_0x590e9b[_0x6c51('0x34')][_0x6c51('0x38')]('nolimit')){_0xddde8a['limit']=qs[_0x6c51('0x20')](_0x590e9b[_0x6c51('0x34')][_0x6c51('0x20')]);_0xddde8a['offset']=qs[_0x6c51('0x1d')](_0x590e9b[_0x6c51('0x34')][_0x6c51('0x1d')]);}_0xddde8a[_0x6c51('0x39')]=qs['sort'](_0x590e9b[_0x6c51('0x34')]['sort']);_0xddde8a[_0x6c51('0x3b')]=qs[_0x6c51('0x32')](_['pick'](_0x590e9b[_0x6c51('0x34')],_0x46c10d['filters']));_0xddde8a[_0x6c51('0x3b')][_0x6c51('0x4f')]=_0x4068e2['id'];if(_0x590e9b[_0x6c51('0x34')][_0x6c51('0x3d')]){_0xddde8a[_0x6c51('0x3b')]=_[_0x6c51('0x3e')](_0xddde8a['where'],{'$or':_[_0x6c51('0x2b')](_0xddde8a['attributes'],function(_0x4ade61){var _0x4ad2ac={};_0x4ad2ac[_0x4ade61]={'$like':'%'+_0x590e9b['query'][_0x6c51('0x3d')]+'%'};return _0x4ad2ac;})});}_0xddde8a=_[_0x6c51('0x3e')]({},_0xddde8a,_0x590e9b['options']);return db[_0x6c51('0x50')][_0x6c51('0x1f')]({'where':_0xddde8a[_0x6c51('0x3b')]})[_0x6c51('0x26')](function(_0x2ac06c){_0x5b452c[_0x6c51('0x1f')]=_0x2ac06c;if(_0x590e9b[_0x6c51('0x34')][_0x6c51('0x41')]){_0xddde8a[_0x6c51('0x42')]=[{'all':!![]}];}return db[_0x6c51('0x50')][_0x6c51('0x51')](_0xddde8a);})[_0x6c51('0x26')](function(_0x5c8537){_0x5b452c[_0x6c51('0x43')]=_0x5c8537;return _0x5b452c;});}})[_0x6c51('0x26')](respondWithFilteredResult(_0x3e5900,_0xddde8a))[_0x6c51('0x45')](handleError(_0x3e5900,null));}; \ No newline at end of file +var _0x111b=['create','body','describe','getQuestions','findOne','length','pick','JscriptyQuestionReport','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find'];(function(_0x11fb3e,_0x56d153){var _0x50ebf6=function(_0x4ffa49){while(--_0x4ffa49){_0x11fb3e['push'](_0x11fb3e['shift']());}};_0x50ebf6(++_0x56d153);}(_0x111b,0x1be));var _0xb111=function(_0x3ae1c8,_0x4f1c21){_0x3ae1c8=_0x3ae1c8-0x0;var _0x5a2621=_0x111b[_0x3ae1c8];return _0x5a2621;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb111('0x0'));var jsonpatch=require(_0xb111('0x1'));var rp=require(_0xb111('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb111('0x3'));var util=require(_0xb111('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb111('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb111('0x6'));var squel=require(_0xb111('0x7'));var crypto=require('crypto');var jsforce=require(_0xb111('0x8'));var deskjs=require(_0xb111('0x9'));var toCsv=require(_0xb111('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb111('0xb'));var qs=require(_0xb111('0xc'));var as=require(_0xb111('0xd'));var hardwareService=require(_0xb111('0xe'));var logger=require('../../config/logger')(_0xb111('0xf'));var utils=require(_0xb111('0x10'));var config=require(_0xb111('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4eb506,_0x58c06a){_0x58c06a=_0x58c06a||0xcc;return function(_0x3a5925){if(_0x3a5925){return _0x4eb506[_0xb111('0x12')](_0x58c06a);}return _0x4eb506[_0xb111('0x13')](_0x58c06a)['end']();};}function respondWithResult(_0x52154f,_0xc3c76){_0xc3c76=_0xc3c76||0xc8;return function(_0x200c92){if(_0x200c92){return _0x52154f[_0xb111('0x13')](_0xc3c76)[_0xb111('0x14')](_0x200c92);}};}function respondWithFilteredResult(_0x426ead,_0x2c1ede){return function(_0x553f33){if(_0x553f33){var _0xeb6c32=typeof _0x2c1ede[_0xb111('0x15')]===_0xb111('0x16')&&typeof _0x2c1ede['limit']===_0xb111('0x16');var _0x980fde=_0x553f33[_0xb111('0x17')];var _0x520e22=_0xeb6c32?0x0:_0x2c1ede[_0xb111('0x15')];var _0x3c0a7d=_0xeb6c32?_0x553f33[_0xb111('0x17')]:_0x2c1ede[_0xb111('0x15')]+_0x2c1ede[_0xb111('0x18')];var _0x51e3c0;if(_0x3c0a7d>=_0x980fde){_0x3c0a7d=_0x980fde;_0x51e3c0=0xc8;}else{_0x51e3c0=0xce;}_0x426ead[_0xb111('0x13')](_0x51e3c0);return _0x426ead['set'](_0xb111('0x19'),_0x520e22+'-'+_0x3c0a7d+'/'+_0x980fde)[_0xb111('0x14')](_0x553f33);}return null;};}function patchUpdates(_0xf659e5){return function(_0x3e3c71){try{jsonpatch[_0xb111('0x1a')](_0x3e3c71,_0xf659e5,!![]);}catch(_0x2382a0){return BPromise[_0xb111('0x1b')](_0x2382a0);}return _0x3e3c71[_0xb111('0x1c')]();};}function saveUpdates(_0x596401,_0x550763){return function(_0x15c281){if(_0x15c281){return _0x15c281[_0xb111('0x1d')](_0x596401)['then'](function(_0x2455fb){return _0x2455fb;});}return null;};}function removeEntity(_0x1cc365,_0x1e3a66){return function(_0x22450e){if(_0x22450e){return _0x22450e[_0xb111('0x1e')]()[_0xb111('0x1f')](function(){_0x1cc365[_0xb111('0x13')](0xcc)[_0xb111('0x20')]();});}};}function handleEntityNotFound(_0x123661,_0x3125ab){return function(_0x1f31f9){if(!_0x1f31f9){_0x123661[_0xb111('0x12')](0x194);}return _0x1f31f9;};}function handleError(_0x370102,_0x85e9cf){_0x85e9cf=_0x85e9cf||0x1f4;return function(_0x5bd43d){logger[_0xb111('0x21')](_0x5bd43d[_0xb111('0x22')]);if(_0x5bd43d[_0xb111('0x23')]){delete _0x5bd43d[_0xb111('0x23')];}_0x370102[_0xb111('0x13')](_0x85e9cf)[_0xb111('0x24')](_0x5bd43d);};}exports[_0xb111('0x25')]=function(_0x5ec4e3,_0x428a4e){var _0x40ec76={},_0x25598d={},_0x242c71={'count':0x0,'rows':[]};var _0x21b0c3=_[_0xb111('0x26')](db[_0xb111('0x27')]['rawAttributes'],function(_0x4e1d83){return{'name':_0x4e1d83[_0xb111('0x28')],'type':_0x4e1d83[_0xb111('0x29')]['key']};});_0x25598d[_0xb111('0x2a')]=_['map'](_0x21b0c3,_0xb111('0x23'));_0x25598d[_0xb111('0x2b')]=_[_0xb111('0x2c')](_0x5ec4e3[_0xb111('0x2b')]);_0x25598d['filters']=_[_0xb111('0x2d')](_0x25598d[_0xb111('0x2a')],_0x25598d[_0xb111('0x2b')]);_0x40ec76[_0xb111('0x2e')]=_['intersection'](_0x25598d[_0xb111('0x2a')],qs[_0xb111('0x2f')](_0x5ec4e3[_0xb111('0x2b')][_0xb111('0x2f')]));_0x40ec76[_0xb111('0x2e')]=_0x40ec76[_0xb111('0x2e')]['length']?_0x40ec76[_0xb111('0x2e')]:_0x25598d[_0xb111('0x2a')];if(!_0x5ec4e3['query'][_0xb111('0x30')](_0xb111('0x31'))){_0x40ec76[_0xb111('0x18')]=qs['limit'](_0x5ec4e3[_0xb111('0x2b')]['limit']);_0x40ec76[_0xb111('0x15')]=qs[_0xb111('0x15')](_0x5ec4e3['query'][_0xb111('0x15')]);}_0x40ec76[_0xb111('0x32')]=qs[_0xb111('0x33')](_0x5ec4e3[_0xb111('0x2b')][_0xb111('0x33')]);_0x40ec76[_0xb111('0x34')]=qs['filters'](_['pick'](_0x5ec4e3[_0xb111('0x2b')],_0x25598d[_0xb111('0x35')]),_0x21b0c3);if(_0x5ec4e3[_0xb111('0x2b')][_0xb111('0x36')]){_0x40ec76[_0xb111('0x34')]=_[_0xb111('0x37')](_0x40ec76[_0xb111('0x34')],{'$or':_[_0xb111('0x26')](_0x21b0c3,function(_0x2fd962){if(_0x2fd962[_0xb111('0x29')]!==_0xb111('0x38')){var _0x33685e={};_0x33685e[_0x2fd962[_0xb111('0x23')]]={'$like':'%'+_0x5ec4e3['query'][_0xb111('0x36')]+'%'};return _0x33685e;}})});}_0x40ec76=_[_0xb111('0x37')]({},_0x40ec76,_0x5ec4e3[_0xb111('0x39')]);var _0x5a5993={'where':_0x40ec76[_0xb111('0x34')]};return db[_0xb111('0x27')][_0xb111('0x17')](_0x5a5993)[_0xb111('0x1f')](function(_0x318b66){_0x242c71[_0xb111('0x17')]=_0x318b66;if(_0x5ec4e3[_0xb111('0x2b')][_0xb111('0x3a')]){_0x40ec76[_0xb111('0x3b')]=[{'all':!![]}];}return db[_0xb111('0x27')][_0xb111('0x3c')](_0x40ec76);})['then'](function(_0x4f445f){_0x242c71[_0xb111('0x3d')]=_0x4f445f;return _0x242c71;})[_0xb111('0x1f')](respondWithFilteredResult(_0x428a4e,_0x40ec76))[_0xb111('0x3e')](handleError(_0x428a4e,null));};exports['show']=function(_0x5e8764,_0x1f8e0a){var _0x3f5d63={'raw':!![],'where':{'id':_0x5e8764[_0xb111('0x3f')]['id']}},_0x33edc6={};_0x33edc6[_0xb111('0x2a')]=_['keys'](db[_0xb111('0x27')]['rawAttributes']);_0x33edc6[_0xb111('0x2b')]=_[_0xb111('0x2c')](_0x5e8764[_0xb111('0x2b')]);_0x33edc6[_0xb111('0x35')]=_['intersection'](_0x33edc6[_0xb111('0x2a')],_0x33edc6[_0xb111('0x2b')]);_0x3f5d63[_0xb111('0x2e')]=_[_0xb111('0x2d')](_0x33edc6[_0xb111('0x2a')],qs['fields'](_0x5e8764[_0xb111('0x2b')]['fields']));_0x3f5d63[_0xb111('0x2e')]=_0x3f5d63[_0xb111('0x2e')]['length']?_0x3f5d63[_0xb111('0x2e')]:_0x33edc6[_0xb111('0x2a')];if(_0x5e8764[_0xb111('0x2b')][_0xb111('0x3a')]){_0x3f5d63[_0xb111('0x3b')]=[{'all':!![]}];}_0x3f5d63=_[_0xb111('0x37')]({},_0x3f5d63,_0x5e8764[_0xb111('0x39')]);return db[_0xb111('0x27')][_0xb111('0x40')](_0x3f5d63)[_0xb111('0x1f')](handleEntityNotFound(_0x1f8e0a,null))[_0xb111('0x1f')](respondWithResult(_0x1f8e0a,null))[_0xb111('0x3e')](handleError(_0x1f8e0a,null));};exports[_0xb111('0x41')]=function(_0x351068,_0x21ccf6){return db[_0xb111('0x27')][_0xb111('0x41')](_0x351068[_0xb111('0x42')],{})['then'](respondWithResult(_0x21ccf6,0xc9))['catch'](handleError(_0x21ccf6,null));};exports[_0xb111('0x1d')]=function(_0x4993de,_0x420f6e){if(_0x4993de[_0xb111('0x42')]['id']){delete _0x4993de['body']['id'];}return db['JscriptySessionReport'][_0xb111('0x40')]({'where':{'id':_0x4993de[_0xb111('0x3f')]['id']}})[_0xb111('0x1f')](handleEntityNotFound(_0x420f6e,null))[_0xb111('0x1f')](saveUpdates(_0x4993de[_0xb111('0x42')],null))[_0xb111('0x1f')](respondWithResult(_0x420f6e,null))['catch'](handleError(_0x420f6e,null));};exports[_0xb111('0x1e')]=function(_0x3fb45b,_0x16dc4a){return db[_0xb111('0x27')][_0xb111('0x40')]({'where':{'id':_0x3fb45b['params']['id']}})['then'](handleEntityNotFound(_0x16dc4a,null))['then'](removeEntity(_0x16dc4a,null))[_0xb111('0x3e')](handleError(_0x16dc4a,null));};exports[_0xb111('0x43')]=function(_0x598467,_0x1dcd9b){return db['JscriptySessionReport']['describe']()['then'](respondWithResult(_0x1dcd9b,null))[_0xb111('0x3e')](handleError(_0x1dcd9b,null));};exports[_0xb111('0x44')]=function(_0x1d8fc7,_0x303532,_0x35d9bb){var _0x2da056={'raw':!![],'where':{}};var _0x242100={};var _0x5bc109={'count':0x0,'rows':[]};return db[_0xb111('0x27')][_0xb111('0x45')]({'where':{'id':_0x1d8fc7['params']['id']}})[_0xb111('0x1f')](handleEntityNotFound(_0x303532,null))['then'](function(_0x19f745){if(_0x19f745){_0x242100[_0xb111('0x2a')]=_[_0xb111('0x2c')](db['JscriptyQuestionReport']['rawAttributes']);_0x242100['query']=_['keys'](_0x1d8fc7[_0xb111('0x2b')]);_0x242100[_0xb111('0x35')]=_[_0xb111('0x2d')](_0x242100[_0xb111('0x2a')],_0x242100[_0xb111('0x2b')]);_0x2da056['attributes']=_['intersection'](_0x242100[_0xb111('0x2a')],qs[_0xb111('0x2f')](_0x1d8fc7['query'][_0xb111('0x2f')]));_0x2da056[_0xb111('0x2e')]=_0x2da056[_0xb111('0x2e')][_0xb111('0x46')]?_0x2da056[_0xb111('0x2e')]:_0x242100[_0xb111('0x2a')];if(!_0x1d8fc7[_0xb111('0x2b')]['hasOwnProperty'](_0xb111('0x31'))){_0x2da056[_0xb111('0x18')]=qs['limit'](_0x1d8fc7[_0xb111('0x2b')][_0xb111('0x18')]);_0x2da056[_0xb111('0x15')]=qs[_0xb111('0x15')](_0x1d8fc7[_0xb111('0x2b')][_0xb111('0x15')]);}_0x2da056['order']=qs[_0xb111('0x33')](_0x1d8fc7['query'][_0xb111('0x33')]);_0x2da056[_0xb111('0x34')]=qs[_0xb111('0x35')](_[_0xb111('0x47')](_0x1d8fc7[_0xb111('0x2b')],_0x242100[_0xb111('0x35')]));_0x2da056[_0xb111('0x34')]['SessionId']=_0x19f745['id'];if(_0x1d8fc7['query'][_0xb111('0x36')]){_0x2da056[_0xb111('0x34')]=_[_0xb111('0x37')](_0x2da056['where'],{'$or':_[_0xb111('0x26')](_0x2da056['attributes'],function(_0x3223a1){var _0x44f589={};_0x44f589[_0x3223a1]={'$like':'%'+_0x1d8fc7[_0xb111('0x2b')][_0xb111('0x36')]+'%'};return _0x44f589;})});}_0x2da056=_[_0xb111('0x37')]({},_0x2da056,_0x1d8fc7['options']);return db[_0xb111('0x48')][_0xb111('0x17')]({'where':_0x2da056['where']})[_0xb111('0x1f')](function(_0x58c8e1){_0x5bc109[_0xb111('0x17')]=_0x58c8e1;if(_0x1d8fc7[_0xb111('0x2b')][_0xb111('0x3a')]){_0x2da056[_0xb111('0x3b')]=[{'all':!![]}];}return db[_0xb111('0x48')][_0xb111('0x3c')](_0x2da056);})['then'](function(_0xb7e15){_0x5bc109[_0xb111('0x3d')]=_0xb7e15;return _0x5bc109;});}})[_0xb111('0x1f')](respondWithFilteredResult(_0x303532,_0x2da056))['catch'](handleError(_0x303532,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 25b8d02..4432950 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','lodash','util'];(function(_0xfa1fda,_0x180577){var _0x39f6b6=function(_0x15a401){while(--_0x15a401){_0xfa1fda['push'](_0xfa1fda['shift']());}};_0x39f6b6(++_0x180577);}(_0xf494,0x1c6));var _0x4f49=function(_0x94b5d3,_0x19926d){_0x94b5d3=_0x94b5d3-0x0;var _0x3a9989=_0xf494[_0x94b5d3];return _0x3a9989;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb66=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xcb66,0x19f));var _0x6cb6=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xcb66[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3efd7e6..88a5b77 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6455=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x13e511,_0x54bdac){var _0x19742e=function(_0xb1934d){while(--_0xb1934d){_0x13e511['push'](_0x13e511['shift']());}};_0x19742e(++_0x54bdac);}(_0x6455,0x97));var _0x5645=function(_0x3793ab,_0x8fdd73){_0x3793ab=_0x3793ab-0x0;var _0x1557eb=_0x6455[_0x3793ab];return _0x1557eb;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x1c1c78,_0x5b3fc5){var _0xbd8e5c=function(_0x185fb6){while(--_0x185fb6){_0x1c1c78['push'](_0x1c1c78['shift']());}};_0xbd8e5c(++_0x5b3fc5);}(_0x4c60,0xc1));var _0x04c6=function(_0x53a75d,_0x2180eb){_0x53a75d=_0x53a75d-0x0;var _0x344e6c=_0x4c60[_0x53a75d];return _0x344e6c;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d6cd808..8dd140a 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35c8=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','update'];(function(_0x2db10b,_0x2a85ae){var _0x1bc275=function(_0x1650c8){while(--_0x1650c8){_0x2db10b['push'](_0x2db10b['shift']());}};_0x1bc275(++_0x2a85ae);}(_0x35c8,0xa6));var _0x835c=function(_0x4a3bf4,_0x119ad1){_0x4a3bf4=_0x4a3bf4-0x0;var _0x299464=_0x35c8[_0x4a3bf4];return _0x299464;};'use strict';var multer=require(_0x835c('0x0'));var util=require(_0x835c('0x1'));var path=require(_0x835c('0x2'));var timeout=require(_0x835c('0x3'));var express=require(_0x835c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x835c('0x5'));var interaction=require(_0x835c('0x6'));var config=require(_0x835c('0x7'));var controller=require(_0x835c('0x8'));router[_0x835c('0x9')]('/',controller[_0x835c('0xa')]);router[_0x835c('0xb')](_0x835c('0xc'),auth['isAuthenticated'](),controller[_0x835c('0xd')]);module[_0x835c('0xe')]=router; \ No newline at end of file +var _0x79a8=['isAuthenticated','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79a8,0x1d0));var _0x879a=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0x79a8[_0x526786];return _0x3a512d;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',controller[_0x879a('0x9')]);router[_0x879a('0xa')](_0x879a('0xb'),auth[_0x879a('0xc')](),controller['update']);module[_0x879a('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9b7e4a7..973f150 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb80=['sequelize','exports'];(function(_0x35aeee,_0x5d99f9){var _0x1bd504=function(_0x1df1b9){while(--_0x1df1b9){_0x35aeee['push'](_0x35aeee['shift']());}};_0x1bd504(++_0x5d99f9);}(_0xbb80,0x136));var _0x0bb8=function(_0xb27cf7,_0x49480e){_0xb27cf7=_0xb27cf7-0x0;var _0x411d9e=_0xbb80[_0xb27cf7];return _0x411d9e;};'use strict';var Sequelize=require(_0x0bb8('0x0'));module[_0x0bb8('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4750=['TEXT','STRING'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x4750,0x126));var _0x0475=function(_0x4bae58,_0x58dbbe){_0x4bae58=_0x4bae58-0x0;var _0x574d53=_0x4750[_0x4bae58];return _0x574d53;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x0475('0x0')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0475('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 8e5f74f..5803e88 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file +var _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x529516,_0x4077a8){var _0x58bac1=function(_0x8c23af){while(--_0x8c23af){_0x529516['push'](_0x529516['shift']());}};_0x58bac1(++_0x4077a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x1dd3e7,_0x2fff34){_0x1dd3e7=_0x1dd3e7-0x0;var _0x436ffd=_0x2ef3[_0x1dd3e7];return _0x436ffd;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 74adec2..1fc98c0 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','api'];(function(_0x2d9391,_0x262e93){var _0xf51ea3=function(_0x33164b){while(--_0x33164b){_0x2d9391['push'](_0x2d9391['shift']());}};_0xf51ea3(++_0x262e93);}(_0x9edd,0x6c));var _0xd9ed=function(_0x3c71ff,_0x333eb5){_0x3c71ff=_0x3c71ff-0x0;var _0x3961ec=_0x9edd[_0x3c71ff];return _0x3961ec;};'use strict';var _=require(_0xd9ed('0x0'));var util=require(_0xd9ed('0x1'));var logger=require(_0xd9ed('0x2'))(_0xd9ed('0x3'));var moment=require(_0xd9ed('0x4'));var BPromise=require(_0xd9ed('0x5'));var rp=require(_0xd9ed('0x6'));var fs=require('fs');var path=require(_0xd9ed('0x7'));var rimraf=require(_0xd9ed('0x8'));var config=require(_0xd9ed('0x9'));var attributes=require(_0xd9ed('0xa'));module[_0xd9ed('0xb')]=function(_0x2ea8a5,_0xde3ea4){return _0x2ea8a5[_0xd9ed('0xc')](_0xd9ed('0xd'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad38=['License','license','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define'];(function(_0xee0f37,_0x538ab1){var _0x4cd0bc=function(_0x1a0392){while(--_0x1a0392){_0xee0f37['push'](_0xee0f37['shift']());}};_0x4cd0bc(++_0x538ab1);}(_0xad38,0x12d));var _0x8ad3=function(_0x2beb43,_0x1188d6){_0x2beb43=_0x2beb43-0x0;var _0x540848=_0xad38[_0x2beb43];return _0x540848;};'use strict';var _=require(_0x8ad3('0x0'));var util=require(_0x8ad3('0x1'));var logger=require(_0x8ad3('0x2'))('api');var moment=require(_0x8ad3('0x3'));var BPromise=require(_0x8ad3('0x4'));var rp=require(_0x8ad3('0x5'));var fs=require('fs');var path=require(_0x8ad3('0x6'));var rimraf=require('rimraf');var config=require(_0x8ad3('0x7'));var attributes=require(_0x8ad3('0x8'));module[_0x8ad3('0x9')]=function(_0x1f01cb,_0x49a49a){return _0x1f01cb[_0x8ad3('0xa')](_0x8ad3('0xb'),attributes,{'tableName':_0x8ad3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e88e4ce..fa10389 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fd8=['catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','code','License,\x20%s,\x20%s','error','message','result'];(function(_0x4451d3,_0x41168c){var _0x1def91=function(_0x19ffd8){while(--_0x19ffd8){_0x4451d3['push'](_0x4451d3['shift']());}};_0x1def91(++_0x41168c);}(_0x3fd8,0x14b));var _0x83fd=function(_0x412e82,_0x141780){_0x412e82=_0x412e82-0x0;var _0x211212=_0x3fd8[_0x412e82];return _0x211212;};'use strict';var _=require('lodash');var util=require(_0x83fd('0x0'));var moment=require(_0x83fd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83fd('0x2'));var db=require(_0x83fd('0x3'))['db'];var utils=require(_0x83fd('0x4'));var logger=require(_0x83fd('0x5'))('rpc');var config=require(_0x83fd('0x6'));var jayson=require(_0x83fd('0x7'));var client=jayson[_0x83fd('0x8')][_0x83fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe8dc52,_0x3bd394,_0x5ac094){return new BPromise(function(_0x1a7b01,_0x38ef73){return client[_0x83fd('0xa')](_0xe8dc52,_0x5ac094)[_0x83fd('0xb')](function(_0x5c6ab8){logger[_0x83fd('0xc')]('License,\x20%s,\x20%s',_0x3bd394,_0x83fd('0xd'));logger['debug'](_0x83fd('0xe'),_0x3bd394,_0x83fd('0xd'),JSON[_0x83fd('0xf')](_0x5c6ab8));if(_0x5c6ab8['error']){if(_0x5c6ab8['error'][_0x83fd('0x10')]===0x1f4){logger['error'](_0x83fd('0x11'),_0x3bd394,_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);return _0x38ef73(_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);}logger[_0x83fd('0x12')](_0x83fd('0x11'),_0x3bd394,_0x5c6ab8[_0x83fd('0x12')][_0x83fd('0x13')]);return _0x1a7b01(_0x5c6ab8['error'][_0x83fd('0x13')]);}else{logger[_0x83fd('0xc')](_0x83fd('0x11'),_0x3bd394,_0x83fd('0xd'));_0x1a7b01(_0x5c6ab8[_0x83fd('0x14')][_0x83fd('0x13')]);}})[_0x83fd('0x15')](function(_0x923329){logger[_0x83fd('0x12')](_0x83fd('0x11'),_0x3bd394,_0x923329);_0x38ef73(_0x923329);});});} \ No newline at end of file +var _0xf04e=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info'];(function(_0x199ef3,_0xd47a47){var _0x71730=function(_0x362dff){while(--_0x362dff){_0x199ef3['push'](_0x199ef3['shift']());}};_0x71730(++_0xd47a47);}(_0xf04e,0x1a8));var _0xef04=function(_0x5df2f7,_0x3a41df){_0x5df2f7=_0x5df2f7-0x0;var _0x2c84b4=_0xf04e[_0x5df2f7];return _0x2c84b4;};'use strict';var _=require(_0xef04('0x0'));var util=require(_0xef04('0x1'));var moment=require(_0xef04('0x2'));var BPromise=require(_0xef04('0x3'));var rs=require(_0xef04('0x4'));var fs=require('fs');var Redis=require(_0xef04('0x5'));var db=require(_0xef04('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xef04('0x7'))(_0xef04('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef04('0x9')][_0xef04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13dec0,_0x13a4f1,_0x1ce3ef){return new BPromise(function(_0x47a644,_0x127aba){return client[_0xef04('0xb')](_0x13dec0,_0x1ce3ef)['then'](function(_0x171da5){logger[_0xef04('0xc')](_0xef04('0xd'),_0x13a4f1,_0xef04('0xe'));logger[_0xef04('0xf')](_0xef04('0x10'),_0x13a4f1,_0xef04('0xe'),JSON[_0xef04('0x11')](_0x171da5));if(_0x171da5['error']){if(_0x171da5[_0xef04('0x12')][_0xef04('0x13')]===0x1f4){logger[_0xef04('0x12')]('License,\x20%s,\x20%s',_0x13a4f1,_0x171da5[_0xef04('0x12')][_0xef04('0x14')]);return _0x127aba(_0x171da5[_0xef04('0x12')]['message']);}logger[_0xef04('0x12')](_0xef04('0xd'),_0x13a4f1,_0x171da5['error'][_0xef04('0x14')]);return _0x47a644(_0x171da5[_0xef04('0x12')][_0xef04('0x14')]);}else{logger['info'](_0xef04('0xd'),_0x13a4f1,_0xef04('0xe'));_0x47a644(_0x171da5[_0xef04('0x15')][_0xef04('0x14')]);}})[_0xef04('0x16')](function(_0x191ddc){logger[_0xef04('0x12')](_0xef04('0xd'),_0x13a4f1,_0x191ddc);_0x127aba(_0x191ddc);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index b032e37..9d404bf 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f57=['getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addSmtp','addInteraction','addApplications','/:id/send','addAgents','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x6f57,0x76));var _0x76f5=function(_0x412675,_0x52a795){_0x412675=_0x412675-0x0;var _0x500396=_0x6f57[_0x412675];return _0x500396;};'use strict';var multer=require(_0x76f5('0x0'));var util=require(_0x76f5('0x1'));var path=require('path');var timeout=require(_0x76f5('0x2'));var express=require(_0x76f5('0x3'));var router=express[_0x76f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76f5('0x5'));var interaction=require(_0x76f5('0x6'));var config=require(_0x76f5('0x7'));var controller=require('./mailAccount.controller');router[_0x76f5('0x8')]('/',auth[_0x76f5('0x9')](),controller['index']);router[_0x76f5('0x8')](_0x76f5('0xa'),auth[_0x76f5('0x9')](),controller[_0x76f5('0xb')]);router['get'](_0x76f5('0xc'),auth[_0x76f5('0x9')](),controller[_0x76f5('0xd')]);router[_0x76f5('0x8')]('/:id/dispositions',auth[_0x76f5('0x9')](),controller[_0x76f5('0xe')]);router[_0x76f5('0x8')](_0x76f5('0xf'),auth[_0x76f5('0x9')](),controller['getAnswers']);router['get'](_0x76f5('0x10'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x11')]);router[_0x76f5('0x8')](_0x76f5('0x12'),auth[_0x76f5('0x9')](),controller['getSmtp']);router['get'](_0x76f5('0x13'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x14')]);router['get'](_0x76f5('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0x76f5('0x8')](_0x76f5('0x16'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x17')]);router[_0x76f5('0x8')](_0x76f5('0x18'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x19')]);router[_0x76f5('0x8')](_0x76f5('0x1a'),auth['isAuthenticated'](),controller[_0x76f5('0x1b')]);router[_0x76f5('0x1c')](_0x76f5('0x1d'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x1e')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x76f5('0x1f')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x76f5('0x1c')]('/:id/in_servers',auth[_0x76f5('0x9')](),controller['addImap']);router[_0x76f5('0x1c')]('/:id/out_servers',auth[_0x76f5('0x9')](),controller[_0x76f5('0x20')]);router[_0x76f5('0x1c')](_0x76f5('0x13'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x21')]);router[_0x76f5('0x1c')](_0x76f5('0x15'),auth['isAuthenticated'](),controller[_0x76f5('0x22')]);router[_0x76f5('0x1c')](_0x76f5('0x23'),auth['isAuthenticated'](),controller['send']);router[_0x76f5('0x1c')](_0x76f5('0x1a'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x24')]);router['put'](_0x76f5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x76f5('0x25')]('/:id/dispositions',auth[_0x76f5('0x9')](),controller[_0x76f5('0x26')]);router[_0x76f5('0x25')](_0x76f5('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x76f5('0x25')](_0x76f5('0x10'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x27')]);router[_0x76f5('0x25')](_0x76f5('0x12'),auth[_0x76f5('0x9')](),controller[_0x76f5('0x28')]);router[_0x76f5('0x25')]('/:id',auth[_0x76f5('0x9')](),controller[_0x76f5('0x29')]);router['delete'](_0x76f5('0x1a'),auth['isAuthenticated'](),controller[_0x76f5('0x2a')]);module[_0x76f5('0x2b')]=router; \ No newline at end of file +var _0xf935=['create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','getImap','getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','post'];(function(_0x2d35e3,_0x13dd46){var _0x5152bc=function(_0x3ea376){while(--_0x3ea376){_0x2d35e3['push'](_0x2d35e3['shift']());}};_0x5152bc(++_0x13dd46);}(_0xf935,0xe3));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5f93('0x0'));var util=require(_0x5f93('0x1'));var path=require('path');var timeout=require(_0x5f93('0x2'));var express=require('express');var router=express[_0x5f93('0x3')]();var fs_extra=require(_0x5f93('0x4'));var auth=require(_0x5f93('0x5'));var interaction=require(_0x5f93('0x6'));var config=require(_0x5f93('0x7'));var controller=require(_0x5f93('0x8'));router[_0x5f93('0x9')]('/',auth[_0x5f93('0xa')](),controller[_0x5f93('0xb')]);router[_0x5f93('0x9')](_0x5f93('0xc'),auth[_0x5f93('0xa')](),controller[_0x5f93('0xd')]);router[_0x5f93('0x9')](_0x5f93('0xe'),auth[_0x5f93('0xa')](),controller[_0x5f93('0xf')]);router[_0x5f93('0x9')]('/:id/dispositions',auth[_0x5f93('0xa')](),controller[_0x5f93('0x10')]);router['get']('/:id/canned_answers',auth[_0x5f93('0xa')](),controller[_0x5f93('0x11')]);router['get']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x5f93('0x12')]);router[_0x5f93('0x9')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x5f93('0x13')]);router[_0x5f93('0x9')]('/:id/interactions',auth[_0x5f93('0xa')](),controller['getInteractions']);router[_0x5f93('0x9')](_0x5f93('0x14'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x15')]);router[_0x5f93('0x9')](_0x5f93('0x16'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x17')]);router[_0x5f93('0x9')](_0x5f93('0x18'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x19')]);router[_0x5f93('0x9')](_0x5f93('0x1a'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x1b')]);router['post'](_0x5f93('0x1c'),auth['isAuthenticated'](),controller[_0x5f93('0x1d')]);router['post'](_0x5f93('0x1e'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x1f')]);router[_0x5f93('0x20')]('/',auth['isAuthenticated'](),controller[_0x5f93('0x21')]);router[_0x5f93('0x20')](_0x5f93('0x22'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x23')]);router['post'](_0x5f93('0x24'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x25')]);router[_0x5f93('0x20')](_0x5f93('0x26'),auth['isAuthenticated'](),controller[_0x5f93('0x27')]);router[_0x5f93('0x20')](_0x5f93('0x14'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x28')]);router[_0x5f93('0x20')](_0x5f93('0x29'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x2a')]);router[_0x5f93('0x20')]('/:id/users',auth[_0x5f93('0xa')](),controller[_0x5f93('0x2b')]);router[_0x5f93('0x2c')](_0x5f93('0xe'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x2d')]);router[_0x5f93('0x2e')](_0x5f93('0x1c'),auth[_0x5f93('0xa')](),controller['removeDispositions']);router[_0x5f93('0x2e')]('/:id/canned_answers',auth[_0x5f93('0xa')](),controller[_0x5f93('0x2f')]);router['delete'](_0x5f93('0x22'),auth['isAuthenticated'](),controller[_0x5f93('0x30')]);router[_0x5f93('0x2e')](_0x5f93('0x24'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x31')]);router[_0x5f93('0x2e')]('/:id',auth[_0x5f93('0xa')](),controller[_0x5f93('0x32')]);router[_0x5f93('0x2e')]('/:id/users',auth[_0x5f93('0xa')](),controller[_0x5f93('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 1b22321..96110dd 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56e7=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x4a44a9,_0x2a4137){var _0x5af9fe=function(_0x5a25f4){while(--_0x5a25f4){_0x4a44a9['push'](_0x4a44a9['shift']());}};_0x5af9fe(++_0x2a4137);}(_0x56e7,0x7b));var _0x756e=function(_0x319d77,_0x445f72){_0x319d77=_0x319d77-0x0;var _0x1dd41c=_0x56e7[_0x319d77];return _0x1dd41c;};'use strict';var Sequelize=require('sequelize');module[_0x756e('0x0')]={'description':{'type':Sequelize[_0x756e('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x756e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x756e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x756e('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x756e('0x3')]},'markAsUnread':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x756e('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x756e('0x4')](0x2)[_0x756e('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x756e('0x3')],'defaultValue':function(){return _0x756e('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x756e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x756e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x756e('0x2')],'defaultValue':![],'comment':_0x756e('0x7'),'set':function(_0x13bea7){if(!_0x13bea7)this['setDataValue'](_0x756e('0x8'),null);this[_0x756e('0x9')]('mandatoryDisposition',_0x13bea7);}}}; \ No newline at end of file +var _0x24cd=['mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x40487c,_0x96b92e){var _0x2569e0=function(_0x137d53){while(--_0x137d53){_0x40487c['push'](_0x40487c['shift']());}};_0x2569e0(++_0x96b92e);}(_0x24cd,0x83));var _0xd24c=function(_0x4378a3,_0x5ec8ed){_0x4378a3=_0x4378a3-0x0;var _0x47d27e=_0x24cd[_0x4378a3];return _0x47d27e;};'use strict';var Sequelize=require(_0xd24c('0x0'));module[_0xd24c('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xd24c('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xd24c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd24c('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd24c('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xd24c('0x4')](0x2)[_0xd24c('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd24c('0x6')],'defaultValue':function(){return _0xd24c('0x7');}},'notificationSound':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd24c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd24c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd24c('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xd24c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd24c('0x3')],'defaultValue':![],'comment':_0xd24c('0x9'),'set':function(_0x1aa701){if(!_0x1aa701)this[_0xd24c('0xa')](_0xd24c('0xb'),null);this['setDataValue'](_0xd24c('0xc'),_0x1aa701);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index ae945fb..e18f0b9 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ab4=['includeAll','findAll','catch','show','params','Imap','keys','include','find','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','findAndCountAll','getApplications','hasOwnProperty','$gte','split','format','MailMessage','inlineCss','true','CmList','Contacts','updatedAt','DESC','from','attachments','root','basename','auth','secure','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','html-to-text','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x40c901,_0x2242f2){var _0x29cf1a=function(_0x2d405e){while(--_0x2d405e){_0x40c901['push'](_0x40c901['shift']());}};_0x29cf1a(++_0x2242f2);}(_0x4ab4,0x1f2));var _0x44ab=function(_0x2fb008,_0x23048e){_0x2fb008=_0x2fb008-0x0;var _0x561658=_0x4ab4[_0x2fb008];return _0x561658;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x44ab('0x0'));var jsonpatch=require(_0x44ab('0x1'));var rp=require(_0x44ab('0x2'));var moment=require(_0x44ab('0x3'));var BPromise=require(_0x44ab('0x4'));var Mustache=require('mustache');var util=require(_0x44ab('0x5'));var path=require(_0x44ab('0x6'));var sox=require(_0x44ab('0x7'));var csv=require(_0x44ab('0x8'));var ejs=require(_0x44ab('0x9'));var fs=require('fs');var fs_extra=require(_0x44ab('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x44ab('0xb'));var deskjs=require(_0x44ab('0xc'));var toCsv=require(_0x44ab('0x8'));var querystring=require('querystring');var Papa=require(_0x44ab('0xd'));var htmlToText=require(_0x44ab('0xe'));var juice=require('juice');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44ab('0xf'));var as=require(_0x44ab('0x10'));var hardwareService=require(_0x44ab('0x11'));var logger=require(_0x44ab('0x12'))(_0x44ab('0x13'));var utils=require(_0x44ab('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x44ab('0x15'));var db=require('../../mysqldb')['db'];config[_0x44ab('0x16')]=_[_0x44ab('0x17')](config[_0x44ab('0x16')],{'host':_0x44ab('0x18'),'port':0x18eb});var socket=require(_0x44ab('0x19'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x44ab('0x1a')](socket);var jayson=require(_0x44ab('0x1b'));var client=jayson[_0x44ab('0x1c')][_0x44ab('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x2eff4e,_0x292df6,_0x1db24f,_0x33acc1){return new BPromise(function(_0x1cffc5,_0x11714){var _0x4e3389=_0x33acc1||client;return _0x4e3389[_0x44ab('0x1e')](_0x2eff4e,_0x1db24f)[_0x44ab('0x1f')](function(_0x5c49b0){logger[_0x44ab('0x20')]('MailAccount,\x20%s,\x20%s',_0x292df6,_0x44ab('0x21'));logger[_0x44ab('0x22')](_0x44ab('0x23'),_0x292df6,_0x44ab('0x21'),JSON[_0x44ab('0x24')](_0x5c49b0));if(_0x5c49b0['error']){if(_0x5c49b0[_0x44ab('0x25')][_0x44ab('0x26')]===0x1f4){logger[_0x44ab('0x25')](_0x44ab('0x27'),_0x292df6,_0x5c49b0[_0x44ab('0x25')][_0x44ab('0x28')]);return _0x11714(_0x5c49b0[_0x44ab('0x25')][_0x44ab('0x28')]);}logger[_0x44ab('0x25')](_0x44ab('0x27'),_0x292df6,_0x5c49b0['error'][_0x44ab('0x28')]);return _0x1cffc5(_0x5c49b0[_0x44ab('0x25')]['message']);}else{logger[_0x44ab('0x20')](_0x44ab('0x27'),_0x292df6,'request\x20sent');_0x1cffc5(_0x5c49b0[_0x44ab('0x29')][_0x44ab('0x28')]);}})['catch'](function(_0x3944fc){logger[_0x44ab('0x25')]('MailAccount,\x20%s,\x20%s',_0x292df6,_0x3944fc);_0x11714(_0x3944fc);});});}function respondWithStatusCode(_0x57fc75,_0x15bfa0){_0x15bfa0=_0x15bfa0||0xcc;return function(_0x25cb6d){if(_0x25cb6d){return _0x57fc75[_0x44ab('0x2a')](_0x15bfa0);}return _0x57fc75[_0x44ab('0x2b')](_0x15bfa0)[_0x44ab('0x2c')]();};}function respondWithResult(_0x2bfaf4,_0x5d4e37){_0x5d4e37=_0x5d4e37||0xc8;return function(_0x569896){if(_0x569896){return _0x2bfaf4[_0x44ab('0x2b')](_0x5d4e37)[_0x44ab('0x2d')](_0x569896);}};}function respondWithFilteredResult(_0xf11547,_0x2f0bea){return function(_0x3e88b6){if(_0x3e88b6){var _0x123df0=typeof _0x2f0bea[_0x44ab('0x2e')]===_0x44ab('0x2f')&&typeof _0x2f0bea['limit']===_0x44ab('0x2f');var _0x4f4d1e=_0x3e88b6[_0x44ab('0x30')];var _0x13e736=_0x123df0?0x0:_0x2f0bea[_0x44ab('0x2e')];var _0x48ae10=_0x123df0?_0x3e88b6['count']:_0x2f0bea[_0x44ab('0x2e')]+_0x2f0bea[_0x44ab('0x31')];var _0x4c6505;if(_0x48ae10>=_0x4f4d1e){_0x48ae10=_0x4f4d1e;_0x4c6505=0xc8;}else{_0x4c6505=0xce;}_0xf11547[_0x44ab('0x2b')](_0x4c6505);return _0xf11547[_0x44ab('0x32')](_0x44ab('0x33'),_0x13e736+'-'+_0x48ae10+'/'+_0x4f4d1e)['json'](_0x3e88b6);}return null;};}function patchUpdates(_0x5cf3fb){return function(_0x3b6427){try{jsonpatch[_0x44ab('0x34')](_0x3b6427,_0x5cf3fb,!![]);}catch(_0x1ec3a2){return BPromise['reject'](_0x1ec3a2);}return _0x3b6427[_0x44ab('0x35')]();};}function saveUpdates(_0x18a0f9,_0x4f7f9d){return function(_0x4cb88a){if(_0x4cb88a){return _0x4cb88a[_0x44ab('0x36')](_0x18a0f9)['then'](function(_0x36c472){return _0x36c472;});}return null;};}function removeEntity(_0x14f476,_0x17742d){return function(_0xc81b99){if(_0xc81b99){return _0xc81b99[_0x44ab('0x37')]()['then'](function(){var _0x248412=_0xc81b99[_0x44ab('0x38')]({'plain':!![]});var _0x29b05d='MailAccounts';return db[_0x44ab('0x39')][_0x44ab('0x37')]({'where':{'type':_0x29b05d,'resourceId':_0x248412['id']}})['then'](function(){return _0xc81b99;});})[_0x44ab('0x1f')](function(){_0x14f476[_0x44ab('0x2b')](0xcc)[_0x44ab('0x2c')]();});}};}function handleEntityNotFound(_0x4edaa8,_0x46894a){return function(_0x598a82){if(!_0x598a82){_0x4edaa8[_0x44ab('0x2a')](0x194);}return _0x598a82;};}function handleError(_0x5e0fff,_0x3336d5){_0x3336d5=_0x3336d5||0x1f4;return function(_0x464eb6){logger[_0x44ab('0x25')](_0x464eb6[_0x44ab('0x3a')]);if(_0x464eb6['name']){delete _0x464eb6['name'];}_0x5e0fff[_0x44ab('0x2b')](_0x3336d5)[_0x44ab('0x3b')](_0x464eb6);};}exports[_0x44ab('0x3c')]=function(_0x3ec76f,_0x239aa4){var _0x381ee0={'include':[{'model':db[_0x44ab('0x3d')],'as':'Imap'},{'model':db[_0x44ab('0x3e')],'as':_0x44ab('0x3f')},{'model':db[_0x44ab('0x40')],'as':_0x44ab('0x41')}]},_0x43e77f={},_0x2261e6={'count':0x0,'rows':[]};var _0x4bd73e=_[_0x44ab('0x42')](db[_0x44ab('0x43')][_0x44ab('0x44')],function(_0x38066f){return{'name':_0x38066f['fieldName'],'type':_0x38066f[_0x44ab('0x45')][_0x44ab('0x46')]};});_0x43e77f['model']=_[_0x44ab('0x42')](_0x4bd73e,_0x44ab('0x47'));_0x43e77f[_0x44ab('0x48')]=_['keys'](_0x3ec76f[_0x44ab('0x48')]);_0x43e77f[_0x44ab('0x49')]=_[_0x44ab('0x4a')](_0x43e77f[_0x44ab('0x4b')],_0x43e77f['query']);_0x381ee0[_0x44ab('0x4c')]=_[_0x44ab('0x4a')](_0x43e77f[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x3ec76f['query']['fields']));_0x381ee0[_0x44ab('0x4c')]=_0x381ee0['attributes'][_0x44ab('0x4e')]?_0x381ee0[_0x44ab('0x4c')]:_0x43e77f[_0x44ab('0x4b')];if(!_0x3ec76f[_0x44ab('0x48')]['hasOwnProperty']('nolimit')){_0x381ee0[_0x44ab('0x31')]=qs[_0x44ab('0x31')](_0x3ec76f[_0x44ab('0x48')][_0x44ab('0x31')]);_0x381ee0[_0x44ab('0x2e')]=qs[_0x44ab('0x2e')](_0x3ec76f[_0x44ab('0x48')]['offset']);}_0x381ee0[_0x44ab('0x4f')]=qs['sort'](_0x3ec76f['query'][_0x44ab('0x50')]);_0x381ee0[_0x44ab('0x51')]=qs['filters'](_[_0x44ab('0x52')](_0x3ec76f[_0x44ab('0x48')],_0x43e77f[_0x44ab('0x49')]),_0x4bd73e);if(_0x3ec76f['query'][_0x44ab('0x53')]){_0x381ee0[_0x44ab('0x51')]=_[_0x44ab('0x54')](_0x381ee0[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0x4bd73e,function(_0x35f55d){if(_0x35f55d[_0x44ab('0x45')]!==_0x44ab('0x55')){var _0x1aca11={};_0x1aca11[_0x35f55d[_0x44ab('0x47')]]={'$like':'%'+_0x3ec76f[_0x44ab('0x48')][_0x44ab('0x53')]+'%'};return _0x1aca11;}})});}_0x381ee0=_['merge']({},_0x381ee0,_0x3ec76f[_0x44ab('0x56')]);var _0x5c5458={'where':_0x381ee0['where']};return db[_0x44ab('0x43')][_0x44ab('0x30')](_0x5c5458)['then'](function(_0x243ea3){_0x2261e6[_0x44ab('0x30')]=_0x243ea3;if(_0x3ec76f[_0x44ab('0x48')][_0x44ab('0x57')]){_0x381ee0['include']=[{'all':!![]}];}return db['MailAccount'][_0x44ab('0x58')](_0x381ee0);})[_0x44ab('0x1f')](function(_0x5e399b){_0x2261e6['rows']=_0x5e399b;return _0x2261e6;})[_0x44ab('0x1f')](respondWithFilteredResult(_0x239aa4,_0x381ee0))[_0x44ab('0x59')](handleError(_0x239aa4,null));};exports[_0x44ab('0x5a')]=function(_0x5c69f2,_0x492f15){var _0x3f843e={'raw':![],'where':{'id':_0x5c69f2[_0x44ab('0x5b')]['id']},'include':[{'model':db[_0x44ab('0x3d')],'as':_0x44ab('0x5c')},{'model':db['MailServerOut'],'as':_0x44ab('0x3f')},{'model':db[_0x44ab('0x40')],'as':_0x44ab('0x41')}]},_0x16ebda={};_0x16ebda[_0x44ab('0x4b')]=_[_0x44ab('0x5d')](db[_0x44ab('0x43')][_0x44ab('0x44')]);_0x16ebda[_0x44ab('0x48')]=_[_0x44ab('0x5d')](_0x5c69f2['query']);_0x16ebda['filters']=_[_0x44ab('0x4a')](_0x16ebda[_0x44ab('0x4b')],_0x16ebda[_0x44ab('0x48')]);_0x3f843e['attributes']=_[_0x44ab('0x4a')](_0x16ebda[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x5c69f2[_0x44ab('0x48')][_0x44ab('0x4d')]));_0x3f843e[_0x44ab('0x4c')]=_0x3f843e[_0x44ab('0x4c')][_0x44ab('0x4e')]?_0x3f843e[_0x44ab('0x4c')]:_0x16ebda[_0x44ab('0x4b')];if(_0x5c69f2['query'][_0x44ab('0x57')]){_0x3f843e[_0x44ab('0x5e')]=[{'all':!![]}];}_0x3f843e=_[_0x44ab('0x54')]({},_0x3f843e,_0x5c69f2[_0x44ab('0x56')]);return db[_0x44ab('0x43')][_0x44ab('0x5f')](_0x3f843e)[_0x44ab('0x1f')](handleEntityNotFound(_0x492f15,null))[_0x44ab('0x1f')](respondWithResult(_0x492f15,null))[_0x44ab('0x59')](handleError(_0x492f15,null));};exports[_0x44ab('0x36')]=function(_0x236798,_0x20d75e){if(_0x236798[_0x44ab('0x60')]['id']){delete _0x236798[_0x44ab('0x60')]['id'];}return db[_0x44ab('0x43')][_0x44ab('0x5f')]({'where':{'id':_0x236798['params']['id']},'include':[{'model':db[_0x44ab('0x3d')],'as':_0x44ab('0x5c')},{'model':db['MailServerOut'],'as':_0x44ab('0x3f')},{'model':db[_0x44ab('0x40')],'as':_0x44ab('0x41')}]})['then'](handleEntityNotFound(_0x20d75e,null))[_0x44ab('0x1f')](saveUpdates(_0x236798['body'],null))[_0x44ab('0x1f')](function(_0x35ebed){if(_0x35ebed&&_0x236798[_0x44ab('0x60')][_0x44ab('0x5c')]){return db[_0x44ab('0x3d')][_0x44ab('0x36')](_0x236798[_0x44ab('0x60')]['Imap'],{'where':{'MailAccountId':_0x35ebed['id']}})['then'](function(){return _0x35ebed;});}return _0x35ebed;})[_0x44ab('0x1f')](function(_0x283f37){if(_0x283f37&&_0x236798[_0x44ab('0x60')][_0x44ab('0x3f')]){return db['MailServerOut'][_0x44ab('0x36')](_0x236798[_0x44ab('0x60')][_0x44ab('0x3f')],{'where':{'MailAccountId':_0x283f37['id']}})[_0x44ab('0x1f')](function(){return _0x283f37;});}return _0x283f37;})[_0x44ab('0x1f')](respondWithResult(_0x20d75e,null))['catch'](handleError(_0x20d75e,null));};exports['describe']=function(_0x49def0,_0x32df06){return db[_0x44ab('0x43')][_0x44ab('0x61')]()[_0x44ab('0x1f')](respondWithResult(_0x32df06,null))[_0x44ab('0x59')](handleError(_0x32df06,null));};exports['addDisposition']=function(_0x4718bc,_0x1df3ea,_0x1cf7ea){if(_0x4718bc['body']['id']){delete _0x4718bc[_0x44ab('0x60')]['id'];}return db[_0x44ab('0x43')][_0x44ab('0x5f')]({'where':{'id':_0x4718bc[_0x44ab('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1df3ea,null))[_0x44ab('0x1f')](function(_0x1b7098){if(_0x1b7098){_0x4718bc[_0x44ab('0x60')][_0x44ab('0x62')]=_0x1b7098['id'];return db[_0x44ab('0x63')][_0x44ab('0x64')](_0x4718bc[_0x44ab('0x60')]);}})[_0x44ab('0x1f')](respondWithResult(_0x1df3ea,null))['catch'](handleError(_0x1df3ea,null));};exports[_0x44ab('0x65')]=function(_0x93509c,_0x1e2759,_0xd4ede5){var _0x3c0aac={'raw':![],'where':{}};var _0x20166c={};var _0x238466={'count':0x0,'rows':[]};return db['MailAccount'][_0x44ab('0x66')]({'where':{'id':_0x93509c[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x1e2759,null))['then'](function(_0x3a1bc5){if(_0x3a1bc5){_0x20166c[_0x44ab('0x4b')]=_[_0x44ab('0x5d')](db[_0x44ab('0x63')][_0x44ab('0x44')]);_0x20166c[_0x44ab('0x48')]=_[_0x44ab('0x5d')](_0x93509c[_0x44ab('0x48')]);_0x20166c[_0x44ab('0x49')]=_[_0x44ab('0x4a')](_0x20166c['model'],_0x20166c['query']);_0x3c0aac['attributes']=_[_0x44ab('0x4a')](_0x20166c[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x93509c['query']['fields']));_0x3c0aac[_0x44ab('0x4c')]=_0x3c0aac[_0x44ab('0x4c')][_0x44ab('0x4e')]?_0x3c0aac[_0x44ab('0x4c')]:_0x20166c[_0x44ab('0x4b')];if(!_0x93509c[_0x44ab('0x48')]['hasOwnProperty'](_0x44ab('0x67'))){_0x3c0aac[_0x44ab('0x31')]=qs[_0x44ab('0x31')](_0x93509c[_0x44ab('0x48')]['limit']);_0x3c0aac[_0x44ab('0x2e')]=qs[_0x44ab('0x2e')](_0x93509c['query'][_0x44ab('0x2e')]);}_0x3c0aac[_0x44ab('0x4f')]=qs[_0x44ab('0x50')](_0x93509c[_0x44ab('0x48')][_0x44ab('0x50')]);_0x3c0aac['where']=qs[_0x44ab('0x49')](_[_0x44ab('0x52')](_0x93509c['query'],_0x20166c[_0x44ab('0x49')]));_0x3c0aac[_0x44ab('0x51')]['MailAccountId']=_0x3a1bc5['id'];if(_0x93509c[_0x44ab('0x48')][_0x44ab('0x53')]){_0x3c0aac[_0x44ab('0x51')]=_[_0x44ab('0x54')](_0x3c0aac[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0x3c0aac[_0x44ab('0x4c')],function(_0x153e8f){var _0x3b968b={};_0x3b968b[_0x153e8f]={'$like':'%'+_0x93509c[_0x44ab('0x48')]['filter']+'%'};return _0x3b968b;})});}_0x3c0aac=_[_0x44ab('0x54')]({},_0x3c0aac,_0x93509c[_0x44ab('0x56')]);return db[_0x44ab('0x63')][_0x44ab('0x30')]({'where':_0x3c0aac['where']})['then'](function(_0xb9c1e0){_0x238466[_0x44ab('0x30')]=_0xb9c1e0;if(_0x93509c[_0x44ab('0x48')][_0x44ab('0x57')]){_0x3c0aac['include']=[{'all':!![]}];}return db[_0x44ab('0x63')]['findAll'](_0x3c0aac);})[_0x44ab('0x1f')](function(_0x455b58){_0x238466[_0x44ab('0x68')]=_0x455b58;return _0x238466;});}})[_0x44ab('0x1f')](respondWithFilteredResult(_0x1e2759,_0x3c0aac))['catch'](handleError(_0x1e2759,null));};exports[_0x44ab('0x69')]=function(_0x537263,_0x5035ce,_0x57042a){return db['MailAccount']['find']({'where':{'id':_0x537263['params']['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x5035ce,null))[_0x44ab('0x1f')](function(_0x2adaf3){if(_0x2adaf3){return _0x2adaf3[_0x44ab('0x69')](_0x537263['query'][_0x44ab('0x6a')]);}})['then'](respondWithStatusCode(_0x5035ce,null))[_0x44ab('0x59')](handleError(_0x5035ce,null));};exports[_0x44ab('0x6b')]=function(_0x2759fa,_0x3aec5a,_0x4e6dba){if(_0x2759fa[_0x44ab('0x60')]['id']){delete _0x2759fa[_0x44ab('0x60')]['id'];}return db[_0x44ab('0x43')][_0x44ab('0x5f')]({'where':{'id':_0x2759fa[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x3aec5a,null))[_0x44ab('0x1f')](function(_0x2e0ef2){if(_0x2e0ef2){_0x2759fa['body'][_0x44ab('0x62')]=_0x2e0ef2['id'];return db['CannedAnswer'][_0x44ab('0x64')](_0x2759fa[_0x44ab('0x60')]);}})[_0x44ab('0x1f')](respondWithResult(_0x3aec5a,null))['catch'](handleError(_0x3aec5a,null));};exports[_0x44ab('0x6c')]=function(_0x2c7a32,_0x130a97,_0x2dd5bc){var _0x1127d5={'raw':![],'where':{}};var _0x3f6f35={};var _0x6d367d={'count':0x0,'rows':[]};return db[_0x44ab('0x43')][_0x44ab('0x66')]({'where':{'id':_0x2c7a32[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x130a97,null))[_0x44ab('0x1f')](function(_0x5cc5ca){if(_0x5cc5ca){_0x3f6f35[_0x44ab('0x4b')]=_['keys'](db[_0x44ab('0x6d')][_0x44ab('0x44')]);_0x3f6f35[_0x44ab('0x48')]=_[_0x44ab('0x5d')](_0x2c7a32[_0x44ab('0x48')]);_0x3f6f35[_0x44ab('0x49')]=_[_0x44ab('0x4a')](_0x3f6f35['model'],_0x3f6f35['query']);_0x1127d5['attributes']=_[_0x44ab('0x4a')](_0x3f6f35[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x2c7a32[_0x44ab('0x48')]['fields']));_0x1127d5[_0x44ab('0x4c')]=_0x1127d5[_0x44ab('0x4c')][_0x44ab('0x4e')]?_0x1127d5['attributes']:_0x3f6f35[_0x44ab('0x4b')];if(!_0x2c7a32[_0x44ab('0x48')]['hasOwnProperty'](_0x44ab('0x67'))){_0x1127d5[_0x44ab('0x31')]=qs['limit'](_0x2c7a32[_0x44ab('0x48')][_0x44ab('0x31')]);_0x1127d5[_0x44ab('0x2e')]=qs['offset'](_0x2c7a32[_0x44ab('0x48')]['offset']);}_0x1127d5[_0x44ab('0x4f')]=qs[_0x44ab('0x50')](_0x2c7a32[_0x44ab('0x48')][_0x44ab('0x50')]);_0x1127d5[_0x44ab('0x51')]=qs['filters'](_[_0x44ab('0x52')](_0x2c7a32[_0x44ab('0x48')],_0x3f6f35[_0x44ab('0x49')]));_0x1127d5[_0x44ab('0x51')][_0x44ab('0x62')]=_0x5cc5ca['id'];if(_0x2c7a32[_0x44ab('0x48')]['filter']){_0x1127d5[_0x44ab('0x51')]=_['merge'](_0x1127d5['where'],{'$or':_[_0x44ab('0x42')](_0x1127d5[_0x44ab('0x4c')],function(_0x1fc84e){var _0x2783d5={};_0x2783d5[_0x1fc84e]={'$like':'%'+_0x2c7a32[_0x44ab('0x48')][_0x44ab('0x53')]+'%'};return _0x2783d5;})});}_0x1127d5=_[_0x44ab('0x54')]({},_0x1127d5,_0x2c7a32[_0x44ab('0x56')]);return db['CannedAnswer']['count']({'where':_0x1127d5[_0x44ab('0x51')]})['then'](function(_0x15853f){_0x6d367d['count']=_0x15853f;if(_0x2c7a32['query'][_0x44ab('0x57')]){_0x1127d5['include']=[{'all':!![]}];}return db[_0x44ab('0x6d')][_0x44ab('0x58')](_0x1127d5);})[_0x44ab('0x1f')](function(_0x41f029){_0x6d367d[_0x44ab('0x68')]=_0x41f029;return _0x6d367d;});}})['then'](respondWithFilteredResult(_0x130a97,_0x1127d5))[_0x44ab('0x59')](handleError(_0x130a97,null));};exports[_0x44ab('0x6e')]=function(_0x276dc7,_0x40f3cc,_0x5bd54a){return db[_0x44ab('0x43')]['find']({'where':{'id':_0x276dc7[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x40f3cc,null))['then'](function(_0x28f910){if(_0x28f910){return _0x28f910[_0x44ab('0x6e')](_0x276dc7[_0x44ab('0x48')]['ids']);}})[_0x44ab('0x1f')](respondWithStatusCode(_0x40f3cc,null))[_0x44ab('0x59')](handleError(_0x40f3cc,null));};exports[_0x44ab('0x64')]=function(_0x472e6d,_0x36ab6c){var _0x39d1cf={'name':_0x472e6d[_0x44ab('0x60')][_0x44ab('0x47')],'key':_0x472e6d[_0x44ab('0x60')][_0x44ab('0x46')],'email':_0x472e6d[_0x44ab('0x60')][_0x44ab('0x6f')],'ListId':_0x472e6d[_0x44ab('0x60')][_0x44ab('0x70')],'active':!_[_0x44ab('0x71')](_0x472e6d[_0x44ab('0x60')][_0x44ab('0x72')])?_0x472e6d[_0x44ab('0x60')][_0x44ab('0x72')]:!![],'description':_0x472e6d[_0x44ab('0x60')][_0x44ab('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x44ab('0x71')](_0x472e6d[_0x44ab('0x60')][_0x44ab('0x74')])){if(_0x472e6d[_0x44ab('0x60')][_0x44ab('0x75')]){_0x39d1cf[_0x44ab('0x5c')][_0x44ab('0x76')]=_0x39d1cf['Smtp'][_0x44ab('0x76')]=_0x472e6d[_0x44ab('0x60')]['cuser'];_0x39d1cf['Imap'][_0x44ab('0x77')]=_0x39d1cf['Smtp'][_0x44ab('0x78')]=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x79')];}else{_0x39d1cf[_0x44ab('0x5c')]['authentication']=_0x39d1cf[_0x44ab('0x3f')][_0x44ab('0x7a')]=![];}_0x39d1cf[_0x44ab('0x5c')][_0x44ab('0x7b')]=_0x472e6d['body'][_0x44ab('0x5c')][_0x44ab('0x7b')];_0x39d1cf[_0x44ab('0x5c')][_0x44ab('0x7c')]=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x5c')][_0x44ab('0x7c')];_0x39d1cf[_0x44ab('0x3f')][_0x44ab('0x7b')]=_0x472e6d['body'][_0x44ab('0x3f')]['host'];_0x39d1cf[_0x44ab('0x3f')]['port']=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x3f')][_0x44ab('0x7c')];}else{_0x39d1cf['Imap'][_0x44ab('0x7d')]=_0x39d1cf['Smtp']['service']=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x74')];_0x39d1cf[_0x44ab('0x5c')]['user']=_0x39d1cf[_0x44ab('0x3f')]['user']=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x7e')];_0x39d1cf['Imap']['password']=_0x39d1cf[_0x44ab('0x3f')][_0x44ab('0x78')]=_0x472e6d[_0x44ab('0x60')][_0x44ab('0x79')];}return db[_0x44ab('0x43')][_0x44ab('0x64')](_0x39d1cf,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x44ab('0x3d')],'as':_0x44ab('0x5c')}]})[_0x44ab('0x1f')](function(_0x488a60){var _0x3b95a8=_0x472e6d[_0x44ab('0x76')][_0x44ab('0x38')]({'plain':!![]});if(!_0x3b95a8)throw new Error(_0x44ab('0x7f'));if(_0x3b95a8[_0x44ab('0x80')]===_0x44ab('0x76')){var _0x1db6db=_0x488a60[_0x44ab('0x38')]({'plain':!![]});return db[_0x44ab('0x81')][_0x44ab('0x5f')]({'where':{'name':_0x44ab('0x82'),'userProfileId':_0x3b95a8['userProfileId']},'raw':!![]})[_0x44ab('0x1f')](function(_0x15ae57){if(_0x15ae57&&_0x15ae57[_0x44ab('0x83')]===0x0){return db[_0x44ab('0x39')]['create']({'name':_0x1db6db[_0x44ab('0x47')],'resourceId':_0x1db6db['id'],'type':_0x15ae57[_0x44ab('0x47')],'sectionId':_0x15ae57['id']},{})[_0x44ab('0x1f')](function(){return _0x488a60;});}else{return _0x488a60;}})[_0x44ab('0x59')](function(_0x1bdbdb){logger[_0x44ab('0x25')](_0x44ab('0x84'),_0x1bdbdb);throw _0x1bdbdb;});}return _0x488a60;})[_0x44ab('0x1f')](respondWithResult(_0x36ab6c,0xc9))[_0x44ab('0x59')](handleError(_0x36ab6c,null));};exports[_0x44ab('0x85')]=function(_0x5eeda2,_0x2c00f2,_0x507d63){return db[_0x44ab('0x43')][_0x44ab('0x66')]({'where':{'id':_0x5eeda2[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x2c00f2,null))[_0x44ab('0x1f')](function(_0x1f0baa){if(_0x1f0baa){return _0x1f0baa[_0x44ab('0x85')]();}return null;})[_0x44ab('0x1f')](respondWithResult(_0x2c00f2,null))[_0x44ab('0x59')](handleError(_0x2c00f2,null));};exports[_0x44ab('0x86')]=function(_0x514632,_0x435920,_0x234215){if(_0x514632[_0x44ab('0x60')]['id']){delete _0x514632[_0x44ab('0x60')]['id'];}return db[_0x44ab('0x43')][_0x44ab('0x5f')]({'where':{'id':_0x514632[_0x44ab('0x5b')]['id']}})['then'](handleEntityNotFound(_0x435920,null))['then'](function(_0x2d01f9){if(_0x2d01f9){_0x514632[_0x44ab('0x60')][_0x44ab('0x62')]=_0x2d01f9['id'];return db[_0x44ab('0x3d')][_0x44ab('0x64')](_0x514632[_0x44ab('0x60')]);}})[_0x44ab('0x1f')](respondWithResult(_0x435920,null))['catch'](handleError(_0x435920,null));};exports['removeImap']=function(_0x8f42b6,_0x6955c,_0x3c3032){return db[_0x44ab('0x43')][_0x44ab('0x66')]({'where':{'id':_0x8f42b6['params']['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x6955c,null))[_0x44ab('0x1f')](function(_0x18b701){if(_0x18b701){return _0x18b701[_0x44ab('0x87')](null);}return null;})[_0x44ab('0x1f')](respondWithStatusCode(_0x6955c,null))[_0x44ab('0x59')](handleError(_0x6955c,null));};exports['getSmtp']=function(_0x5a14a6,_0x2b69e2,_0x2c468f){return db[_0x44ab('0x43')]['findOne']({'where':{'id':_0x5a14a6[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x2b69e2,null))[_0x44ab('0x1f')](function(_0x4574c3){if(_0x4574c3){return _0x4574c3[_0x44ab('0x88')]();}return null;})[_0x44ab('0x1f')](respondWithResult(_0x2b69e2,null))[_0x44ab('0x59')](handleError(_0x2b69e2,null));};exports[_0x44ab('0x89')]=function(_0x40ba60,_0x2d8d05,_0xcc7589){if(_0x40ba60['body']['id']){delete _0x40ba60[_0x44ab('0x60')]['id'];}return db[_0x44ab('0x43')]['find']({'where':{'id':_0x40ba60['params']['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x2d8d05,null))[_0x44ab('0x1f')](function(_0x29a300){if(_0x29a300){_0x40ba60[_0x44ab('0x60')][_0x44ab('0x62')]=_0x29a300['id'];return db['MailServerOut'][_0x44ab('0x64')](_0x40ba60[_0x44ab('0x60')]);}})['then'](respondWithResult(_0x2d8d05,null))[_0x44ab('0x59')](handleError(_0x2d8d05,null));};exports['removeSmtp']=function(_0x42107c,_0x59c2e6,_0x2d23de){return db[_0x44ab('0x43')][_0x44ab('0x66')]({'where':{'id':_0x42107c[_0x44ab('0x5b')]['id']}})['then'](handleEntityNotFound(_0x59c2e6,null))[_0x44ab('0x1f')](function(_0x3f845c){if(_0x3f845c){return _0x3f845c[_0x44ab('0x8a')](null);}return null;})[_0x44ab('0x1f')](respondWithStatusCode(_0x59c2e6,null))[_0x44ab('0x59')](handleError(_0x59c2e6,null));};exports[_0x44ab('0x8b')]=function(_0x56a781,_0x278e2a,_0x57f1a2){return db[_0x44ab('0x8c')]['find']({'where':{'id':_0x56a781[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x278e2a,null))['then'](function(_0x2a3279){if(_0x2a3279){return _0x2a3279[_0x44ab('0x8b')](_0x56a781[_0x44ab('0x60')]['ids'],_['omit'](_0x56a781[_0x44ab('0x60')],['ids','id'])||{});}})[_0x44ab('0x1f')](respondWithResult(_0x278e2a,null))[_0x44ab('0x59')](handleError(_0x278e2a,null));};exports[_0x44ab('0x8d')]=function(_0x482b60,_0x2095c8,_0x8519d2){var _0x5e0619={'raw':![],'where':{}};var _0x2973cb={};var _0x5e1c59={'count':0x0,'rows':[]};return db['MailAccount'][_0x44ab('0x66')]({'where':{'id':_0x482b60['params']['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x2095c8,null))[_0x44ab('0x1f')](function(_0x26e896){if(_0x26e896){_0x2973cb[_0x44ab('0x4b')]=_['keys'](db[_0x44ab('0x8c')]['rawAttributes']);_0x2973cb['query']=_[_0x44ab('0x5d')](_0x482b60[_0x44ab('0x48')]);_0x2973cb[_0x44ab('0x49')]=_[_0x44ab('0x4a')](_0x2973cb['model'],_0x2973cb[_0x44ab('0x48')]);_0x5e0619[_0x44ab('0x4c')]=_[_0x44ab('0x4a')](_0x2973cb[_0x44ab('0x4b')],qs['fields'](_0x482b60[_0x44ab('0x48')][_0x44ab('0x4d')]));_0x5e0619[_0x44ab('0x4c')]=_0x5e0619[_0x44ab('0x4c')][_0x44ab('0x4e')]?_0x5e0619[_0x44ab('0x4c')]:_0x2973cb[_0x44ab('0x4b')];if(!_0x482b60[_0x44ab('0x48')]['hasOwnProperty'](_0x44ab('0x67'))){_0x5e0619[_0x44ab('0x31')]=qs['limit'](_0x482b60[_0x44ab('0x48')][_0x44ab('0x31')]);_0x5e0619[_0x44ab('0x2e')]=qs['offset'](_0x482b60[_0x44ab('0x48')][_0x44ab('0x2e')]);}_0x5e0619[_0x44ab('0x4f')]=qs[_0x44ab('0x50')](_0x482b60[_0x44ab('0x48')][_0x44ab('0x50')]);_0x5e0619[_0x44ab('0x51')]=qs['filters'](_[_0x44ab('0x52')](_0x482b60[_0x44ab('0x48')],_0x2973cb['filters']));_0x5e0619[_0x44ab('0x51')]['MailAccountId']=_0x26e896['id'];if(_0x482b60['query'][_0x44ab('0x53')]){_0x5e0619['where']=_['merge'](_0x5e0619[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0x5e0619[_0x44ab('0x4c')],function(_0x24f492){var _0x59fbc6={};_0x59fbc6[_0x24f492]={'$like':'%'+_0x482b60[_0x44ab('0x48')][_0x44ab('0x53')]+'%'};return _0x59fbc6;})});}_0x5e0619=_[_0x44ab('0x54')]({},_0x5e0619,_0x482b60[_0x44ab('0x56')]);return db[_0x44ab('0x8c')][_0x44ab('0x30')]({'where':_0x5e0619[_0x44ab('0x51')]})[_0x44ab('0x1f')](function(_0x2c49af){_0x5e1c59[_0x44ab('0x30')]=_0x2c49af;if(_0x482b60['query'][_0x44ab('0x57')]){_0x5e0619[_0x44ab('0x5e')]=[{'model':db[_0x44ab('0x8e')],'as':_0x44ab('0x8f'),'required':![]},{'model':db[_0x44ab('0x90')],'as':_0x44ab('0x91'),'attributes':[_0x44ab('0x47'),_0x44ab('0x92'),'internal'],'required':![]},{'model':db[_0x44ab('0x93')],'as':_0x44ab('0x94'),'attributes':['id',_0x44ab('0x47'),'color'],'where':_0x482b60[_0x44ab('0x48')][_0x44ab('0x95')]?{'id':_0x482b60[_0x44ab('0x48')][_0x44ab('0x95')]}:undefined,'required':_0x482b60['query']['tag']?!![]:![]}];}return db[_0x44ab('0x8c')][_0x44ab('0x58')](_0x5e0619);})['then'](function(_0x1b6420){_0x5e1c59[_0x44ab('0x68')]=_0x1b6420;return _0x5e1c59;});}})[_0x44ab('0x1f')](respondWithFilteredResult(_0x2095c8,_0x5e0619))[_0x44ab('0x59')](handleError(_0x2095c8,null));};exports[_0x44ab('0x96')]=function addApplications(_0x1009fe,_0x1c3c49){var _0x20a3b7=_0x1009fe[_0x44ab('0x5b')]['id'];var _0x3ea461=_0x1009fe[_0x44ab('0x60')];var _0x1088d=0xc8;var _0x530c06=null;return db[_0x44ab('0x97')][_0x44ab('0x98')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x44ab('0x99')]},function(_0x41adde){return db[_0x44ab('0x43')]['findOne']({'where':{'id':_0x20a3b7},'transaction':_0x41adde})[_0x44ab('0x1f')](function(_0xbe331d){if(_0xbe331d){return db[_0x44ab('0x9a')][_0x44ab('0x37')]({'where':{'MailAccountId':_0x20a3b7},'transaction':_0x41adde})['then'](function(){var _0x53edfc=_[_0x44ab('0x42')](_0x3ea461,function(_0x2b643f){_0x2b643f['MailAccountId']=_0x20a3b7;return _0x2b643f;});return db[_0x44ab('0x9a')]['bulkCreate'](_0x53edfc,{'transaction':_0x41adde});});}else{_0x1088d=0x194;_0x530c06=[];}});})[_0x44ab('0x1f')](function(){if(_0x1088d!==0x194){return db[_0x44ab('0x9a')][_0x44ab('0x9b')]({'where':{'MailAccountId':_0x20a3b7},'order':'priority'})['then'](function(_0x3adcaa){_0x530c06=_0x3adcaa;});}})[_0x44ab('0x59')](function(_0x55333b){_0x1088d=0x1f4;logger['error'](_0x55333b[_0x44ab('0x3a')]);if(_0x55333b[_0x44ab('0x47')]){delete _0x55333b['name'];}_0x530c06=_0x55333b;})['finally'](function(){if(_0x530c06===null){_0x1c3c49[_0x44ab('0x2a')](_0x1088d);}else{if(_0x1088d===0x1f4){_0x1c3c49[_0x44ab('0x2b')](_0x1088d)['send'](_0x530c06);}else{_0x1c3c49[_0x44ab('0x2b')](_0x1088d)[_0x44ab('0x2d')](_0x530c06);}}});};exports[_0x44ab('0x9c')]=function(_0x4ba7cc,_0xa0cfbe,_0x9df4b0){var _0x3dcc9f={};var _0x5151c5={};var _0x5d8184;var _0x575827;return db['MailAccount']['findOne']({'where':{'id':_0x4ba7cc[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0xa0cfbe,null))[_0x44ab('0x1f')](function(_0x205960){if(_0x205960){_0x5d8184=_0x205960;_0x5151c5[_0x44ab('0x4b')]=_['keys'](db[_0x44ab('0x9a')]['rawAttributes']);_0x5151c5[_0x44ab('0x48')]=_[_0x44ab('0x5d')](_0x4ba7cc[_0x44ab('0x48')]);_0x5151c5['filters']=_['intersection'](_0x5151c5[_0x44ab('0x4b')],_0x5151c5[_0x44ab('0x48')]);_0x3dcc9f[_0x44ab('0x4c')]=_[_0x44ab('0x4a')](_0x5151c5[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x4d')]));_0x3dcc9f['attributes']=_0x3dcc9f[_0x44ab('0x4c')]['length']?_0x3dcc9f['attributes']:_0x5151c5[_0x44ab('0x4b')];_0x3dcc9f[_0x44ab('0x4f')]=qs[_0x44ab('0x50')](_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x50')]);_0x3dcc9f[_0x44ab('0x51')]=qs[_0x44ab('0x49')](_[_0x44ab('0x52')](_0x4ba7cc['query'],_0x5151c5[_0x44ab('0x49')]));if(_0x4ba7cc[_0x44ab('0x48')]['filter']){_0x3dcc9f[_0x44ab('0x51')]=_[_0x44ab('0x54')](_0x3dcc9f[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0x3dcc9f[_0x44ab('0x4c')],function(_0x2c0d8c){var _0x4e9c47={};_0x4e9c47[_0x2c0d8c]={'$like':'%'+_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x53')]+'%'};return _0x4e9c47;})});}_0x3dcc9f=_[_0x44ab('0x54')]({},_0x3dcc9f,_0x4ba7cc[_0x44ab('0x56')]);return _0x5d8184[_0x44ab('0x9c')](_0x3dcc9f);}})['then'](function(_0x15da29){if(_0x15da29){_0x575827=_0x15da29[_0x44ab('0x4e')];if(!_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x9d')](_0x44ab('0x67'))){_0x3dcc9f[_0x44ab('0x31')]=qs[_0x44ab('0x31')](_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x31')]);_0x3dcc9f['offset']=qs['offset'](_0x4ba7cc[_0x44ab('0x48')][_0x44ab('0x2e')]);}return _0x5d8184[_0x44ab('0x9c')](_0x3dcc9f);}})[_0x44ab('0x1f')](function(_0xcd77b6){if(_0xcd77b6){return _0xcd77b6?{'count':_0x575827,'rows':_0xcd77b6}:null;}})['then'](respondWithResult(_0xa0cfbe,null))[_0x44ab('0x59')](handleError(_0xa0cfbe,null));};exports['getMessages']=function(_0x4ef197,_0x2ca915,_0x5d7303){var _0xe232a0={'raw':!![],'where':{}};var _0x4223b2={};var _0xf3eb68={'count':0x0,'rows':[]};return db['MailAccount'][_0x44ab('0x66')]({'where':{'id':_0x4ef197[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x2ca915,null))[_0x44ab('0x1f')](function(_0x578837){if(_0x578837){_0x4223b2[_0x44ab('0x4b')]=_['keys'](db['MailMessage']['rawAttributes']);_0x4223b2['query']=_['keys'](_0x4ef197[_0x44ab('0x48')]);_0x4223b2[_0x44ab('0x49')]=_[_0x44ab('0x4a')](_0x4223b2[_0x44ab('0x4b')],_0x4223b2[_0x44ab('0x48')]);_0xe232a0[_0x44ab('0x4c')]=_['intersection'](_0x4223b2[_0x44ab('0x4b')],qs['fields'](_0x4ef197[_0x44ab('0x48')][_0x44ab('0x4d')]));_0xe232a0[_0x44ab('0x4c')]=_0xe232a0['attributes']['length']?_0xe232a0[_0x44ab('0x4c')]:_0x4223b2['model'];if(!_0x4ef197[_0x44ab('0x48')][_0x44ab('0x9d')](_0x44ab('0x67'))){_0xe232a0['limit']=qs[_0x44ab('0x31')](_0x4ef197[_0x44ab('0x48')]['limit']);_0xe232a0[_0x44ab('0x2e')]=qs[_0x44ab('0x2e')](_0x4ef197[_0x44ab('0x48')]['offset']);}_0xe232a0['order']=qs[_0x44ab('0x50')](_0x4ef197[_0x44ab('0x48')][_0x44ab('0x50')]);_0xe232a0[_0x44ab('0x51')]=qs['filters'](_['pick'](_0x4ef197['query'],_0x4223b2[_0x44ab('0x49')]));_0xe232a0['where'][_0x44ab('0x62')]=_0x578837['id'];if(_0x4ef197[_0x44ab('0x48')]['filter']){_0xe232a0[_0x44ab('0x51')]=_['merge'](_0xe232a0[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0xe232a0[_0x44ab('0x4c')],function(_0x45a82d){var _0x3e328a={};_0x3e328a[_0x45a82d]={'$like':'%'+_0x4ef197['query'][_0x44ab('0x53')]+'%'};return _0x3e328a;})});}if(_0x4ef197[_0x44ab('0x48')][_0x44ab('0x9e')]){var _0x386ec8=_0x4ef197[_0x44ab('0x48')][_0x44ab('0x9e')][_0x44ab('0x9f')](',');var _0x5594f8={};_0x5594f8[_0x386ec8[0x0]]={'$gte':moment(_0x386ec8[0x1])[_0x44ab('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe232a0[_0x44ab('0x51')]=_['merge'](_0xe232a0[_0x44ab('0x51')],_0x5594f8);}_0xe232a0=_[_0x44ab('0x54')]({},_0xe232a0,_0x4ef197[_0x44ab('0x56')]);return db['MailMessage'][_0x44ab('0x30')]({'where':_0xe232a0['where']})[_0x44ab('0x1f')](function(_0x3e7694){_0xf3eb68[_0x44ab('0x30')]=_0x3e7694;if(_0x4ef197['query'][_0x44ab('0x57')]){_0xe232a0[_0x44ab('0x5e')]=[{'all':!![]}];}return db[_0x44ab('0xa1')]['findAll'](_0xe232a0);})[_0x44ab('0x1f')](function(_0x1d1e6a){if(_0x4ef197[_0x44ab('0x48')][_0x44ab('0xa2')]===_0x44ab('0xa3')){for(var _0xba2ea5=0x0;_0xba2ea5<_0x1d1e6a[_0x44ab('0x4e')];_0xba2ea5++){_0x1d1e6a[_0xba2ea5][_0x44ab('0x60')]=juice(_0x1d1e6a[_0xba2ea5]['body']);}}_0xf3eb68[_0x44ab('0x68')]=_0x1d1e6a;return _0xf3eb68;});}})[_0x44ab('0x1f')](respondWithFilteredResult(_0x2ca915,_0xe232a0))[_0x44ab('0x59')](handleError(_0x2ca915,null));};exports[_0x44ab('0x3b')]=function(_0x3aaaeb,_0x2422ec,_0x55f76e){var _0x4cc601,_0x261fa2={},_0xabd60c;if(_0x3aaaeb[_0x44ab('0x60')]['to']){_0xabd60c=_0x3aaaeb[_0x44ab('0x60')]['to']['split'](',')[0x0];}return db[_0x44ab('0x43')]['find']({'where':{'id':_0x3aaaeb[_0x44ab('0x5b')]['id']},'include':[{'model':db[_0x44ab('0xa4')],'as':'List','include':[{'model':db['CmContact'],'as':_0x44ab('0xa5'),'where':{'email':_0xabd60c},'limit':0x1,'order':[[_0x44ab('0xa6'),_0x44ab('0xa7')]]}]},{'model':db[_0x44ab('0x3e')],'as':_0x44ab('0x3f'),'raw':!![]}]})[_0x44ab('0x1f')](handleEntityNotFound(_0x2422ec,null))[_0x44ab('0x1f')](function(_0x3e70af){if(_0x3e70af){_0x4cc601=_0x3e70af;if(_0x3e70af['Smtp']){if(_['isNil'](_0x3aaaeb[_0x44ab('0x60')]['from'])){_0x3aaaeb[_0x44ab('0x60')][_0x44ab('0xa8')]=util[_0x44ab('0xa0')]('%s\x20<%s>',_0x3e70af[_0x44ab('0x47')],_0x3e70af['email']||_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x76')]);}if(_0x3aaaeb[_0x44ab('0x60')][_0x44ab('0xa9')]&&_0x3aaaeb['body'][_0x44ab('0xa9')]['length']){for(var _0x2fb688=0x0;_0x2fb688<_0x3aaaeb['body'][_0x44ab('0xa9')][_0x44ab('0x4e')];_0x2fb688+=0x1){_0x3aaaeb[_0x44ab('0x60')][_0x44ab('0xa9')][_0x2fb688]={'filename':_0x3aaaeb[_0x44ab('0x60')]['attachments'][_0x2fb688][_0x44ab('0x47')],'path':path['join'](config[_0x44ab('0xaa')],'server/files/attachments',_0x3aaaeb[_0x44ab('0x60')]['attachments'][_0x2fb688][_0x44ab('0xab')])};}}var _0x564de3={'tls':{'rejectUnauthorized':![]}};if(_[_0x44ab('0x71')](_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x7d')])){if(_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x7a')]){_0x564de3[_0x44ab('0xac')]={'user':_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x76')],'pass':_0x3e70af['Smtp'][_0x44ab('0x78')]};}_0x564de3[_0x44ab('0x7b')]=_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x7b')];_0x564de3[_0x44ab('0x7c')]=_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x7c')];_0x564de3[_0x44ab('0xad')]=_0x3e70af[_0x44ab('0x3f')][_0x44ab('0xad')];}else{_0x564de3[_0x44ab('0x7d')]=_0x3e70af[_0x44ab('0x3f')][_0x44ab('0x7d')];_0x564de3['auth']={'user':_0x3e70af[_0x44ab('0x3f')]['user'],'pass':_0x3e70af['Smtp'][_0x44ab('0x78')]};}return respondWithRpcPromise('SendMail',_0x44ab('0xae'),{'account':_0x564de3,'message':_0x3aaaeb[_0x44ab('0x60')]});}else{throw new Error(_0x44ab('0xaf'));}}})[_0x44ab('0x1f')](function(_0x59c35c){if(_0x59c35c){_0x261fa2=_0x59c35c;if(_0x4cc601[_0x44ab('0xb0')]){if(_0x4cc601[_0x44ab('0xb0')][_0x44ab('0xa5')][_0x44ab('0x4e')]){return _0x4cc601[_0x44ab('0xb0')]['Contacts'][0x0];}else{return db[_0x44ab('0x8e')]['create'](_[_0x44ab('0x17')](_0x3aaaeb['body'],{'firstName':_0x3aaaeb[_0x44ab('0x60')]['to'],'email':_0x3aaaeb[_0x44ab('0x60')]['to'],'phone':_0x3aaaeb['body']['to'],'ListId':_0x4cc601[_0x44ab('0x70')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x44ab('0x1f')](function(_0x74d3f0){if(_0x74d3f0){var _0x3327d6={'UserId':_0x3aaaeb[_0x44ab('0x76')]['id'],'ContactId':_0x74d3f0['id'],'MailAccountId':_0x4cc601['id'],'inReplyTo':_0x261fa2[_0x44ab('0xb1')],'to':_0x3aaaeb['body']['from'],'cc':_0x3aaaeb[_0x44ab('0x60')]['cc'],'subject':_0x3aaaeb['body'][_0x44ab('0xb2')],'attach':_0x3aaaeb[_0x44ab('0x60')][_0x44ab('0xb3')],'firstMsgDirection':_0x44ab('0xb4'),'lastMsgAt':moment()[_0x44ab('0xa0')](_0x44ab('0xb5')),'lastMsgDirection':'out','Messages':[_[_0x44ab('0x54')](_0x3aaaeb[_0x44ab('0x60')],{'messageId':_0x261fa2[_0x44ab('0xb1')],'sentAt':moment()['format'](_0x44ab('0xb5')),'read':!![],'MailAccountId':_0x4cc601['id'],'UserId':_0x3aaaeb[_0x44ab('0x76')]['id'],'ContactId':_0x74d3f0['id']})]};if(_0x3aaaeb['body']['Interaction']){_0x3327d6=_[_0x44ab('0x54')](_0x3327d6,_0x3aaaeb[_0x44ab('0x60')][_0x44ab('0xb6')]);}return db[_0x44ab('0x8c')][_0x44ab('0x64')](_0x3327d6,{'include':[{'model':db[_0x44ab('0xa1')],'as':'Messages'}]});}})[_0x44ab('0x1f')](respondWithResult(_0x2422ec,null))[_0x44ab('0x59')](handleError(_0x2422ec,null));};exports[_0x44ab('0xb7')]=function(_0x552223,_0x4b4f21,_0x175380){return db[_0x44ab('0x43')][_0x44ab('0x5f')]({'where':{'id':_0x552223[_0x44ab('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x44ab('0x3f'),'raw':!![]}]})[_0x44ab('0x1f')](handleEntityNotFound(_0x4b4f21,null))['then'](function(_0x4cce9b){if(_0x4cce9b&&_0x4cce9b['Smtp']){var _0x26918e={'id':_0x4cce9b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4cce9b[_0x44ab('0x3f')]['service']){_0x26918e[_0x44ab('0x7d')]=_0x4cce9b[_0x44ab('0x3f')][_0x44ab('0x7d')];}else{_0x26918e[_0x44ab('0x7b')]=_0x4cce9b[_0x44ab('0x3f')]['host'];_0x26918e[_0x44ab('0x7c')]=_0x4cce9b[_0x44ab('0x3f')]['port'];_0x26918e[_0x44ab('0xad')]=_0x4cce9b[_0x44ab('0x3f')][_0x44ab('0xad')];}if(_0x4cce9b[_0x44ab('0x3f')][_0x44ab('0x7a')]){_0x26918e[_0x44ab('0xac')]={'user':_0x4cce9b[_0x44ab('0x3f')][_0x44ab('0x76')],'pass':_0x4cce9b['Smtp'][_0x44ab('0x78')]};}return respondWithRpcPromise(_0x44ab('0xb8'),_0x44ab('0xb7'),{'account':_0x26918e});}})[_0x44ab('0x1f')](respondWithResult(_0x4b4f21,null))['catch'](handleError(_0x4b4f21,null));};exports[_0x44ab('0x37')]=function(_0x4e99b6,_0x407d48){return db['MailAccount']['find']({'where':{'id':_0x4e99b6[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x407d48,null))[_0x44ab('0x1f')](function(_0x35f79c){if(_0x35f79c&&_0x35f79c[_0x44ab('0x7d')]){throw new db[(_0x44ab('0xb9'))]['ValidationError'](_0x44ab('0xba'));}return _0x35f79c;})['then'](removeEntity(_0x407d48,null))[_0x44ab('0x59')](handleError(_0x407d48,null));};exports[_0x44ab('0xbb')]=function(_0x41b336,_0x346a2e,_0x32cabd){return db['MailAccount'][_0x44ab('0x5f')]({'where':{'id':_0x41b336[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x346a2e,null))[_0x44ab('0x1f')](function(_0x3ec481){if(_0x3ec481){return _0x3ec481[_0x44ab('0xbb')](_0x41b336['body'][_0x44ab('0x6a')],_[_0x44ab('0xbc')](_0x41b336[_0x44ab('0x60')],['ids','id'])||{})[_0x44ab('0xbd')](function(_0x153e35){for(var _0x568076=0x0;_0x568076<_0x41b336[_0x44ab('0x60')][_0x44ab('0x6a')][_0x44ab('0x4e')];_0x568076+=0x1){socket[_0x44ab('0xbe')](_0x44ab('0xbf'),{'UserId':Number(_0x41b336[_0x44ab('0x60')][_0x44ab('0x6a')][_0x568076]),'MailAccountId':Number(_0x41b336[_0x44ab('0x5b')]['id'])});}return _0x153e35;});}})['then'](respondWithResult(_0x346a2e,null))[_0x44ab('0x59')](handleError(_0x346a2e,null));};exports[_0x44ab('0xc0')]=function(_0x2350fc,_0x35953e,_0x17c29a){return db[_0x44ab('0x43')]['find']({'where':{'id':_0x2350fc[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x35953e,null))['then'](function(_0xf435c6){if(_0xf435c6){return _0xf435c6[_0x44ab('0xc0')](_0x2350fc[_0x44ab('0x48')][_0x44ab('0x6a')])[_0x44ab('0x1f')](function(){if(_[_0x44ab('0xc1')](_0x2350fc[_0x44ab('0x48')][_0x44ab('0x6a')])){for(var _0xa6126=0x0;_0xa6126<_0x2350fc[_0x44ab('0x48')][_0x44ab('0x6a')][_0x44ab('0x4e')];_0xa6126+=0x1){socket[_0x44ab('0xbe')]('userMailAccount:remove',{'UserId':Number(_0x2350fc[_0x44ab('0x48')][_0x44ab('0x6a')][_0xa6126]),'MailAccountId':Number(_0x2350fc[_0x44ab('0x5b')]['id'])});}}else{socket[_0x44ab('0xbe')]('userMailAccount:remove',{'UserId':Number(_0x2350fc[_0x44ab('0x48')][_0x44ab('0x6a')]),'MailAccountId':Number(_0x2350fc['params']['id'])});}});}})[_0x44ab('0x1f')](respondWithStatusCode(_0x35953e,null))[_0x44ab('0x59')](handleError(_0x35953e,null));};exports[_0x44ab('0xc2')]=function(_0x427b81,_0x183f05,_0x37e8e6){var _0x433e1c={};var _0x16d63d={};var _0x989111;var _0xf8437a;return db['MailAccount'][_0x44ab('0x66')]({'where':{'id':_0x427b81[_0x44ab('0x5b')]['id']}})[_0x44ab('0x1f')](handleEntityNotFound(_0x183f05,null))[_0x44ab('0x1f')](function(_0x28fe0a){if(_0x28fe0a){_0x989111=_0x28fe0a;_0x16d63d[_0x44ab('0x4b')]=_[_0x44ab('0x5d')](db[_0x44ab('0x90')][_0x44ab('0x44')]);_0x16d63d[_0x44ab('0x48')]=_[_0x44ab('0x5d')](_0x427b81['query']);_0x16d63d['filters']=_[_0x44ab('0x4a')](_0x16d63d['model'],_0x16d63d[_0x44ab('0x48')]);_0x433e1c['attributes']=_[_0x44ab('0x4a')](_0x16d63d[_0x44ab('0x4b')],qs[_0x44ab('0x4d')](_0x427b81[_0x44ab('0x48')][_0x44ab('0x4d')]));_0x433e1c[_0x44ab('0x4c')]=_0x433e1c['attributes'][_0x44ab('0x4e')]?_0x433e1c['attributes']:_0x16d63d['model'];_0x433e1c[_0x44ab('0x4f')]=qs['sort'](_0x427b81['query'][_0x44ab('0x50')]);_0x433e1c[_0x44ab('0x51')]=qs[_0x44ab('0x49')](_['pick'](_0x427b81[_0x44ab('0x48')],_0x16d63d[_0x44ab('0x49')]));if(_0x427b81['query']['filter']){_0x433e1c[_0x44ab('0x51')]=_['merge'](_0x433e1c[_0x44ab('0x51')],{'$or':_[_0x44ab('0x42')](_0x433e1c['attributes'],function(_0x8ed3d1){var _0x404d97={};_0x404d97[_0x8ed3d1]={'$like':'%'+_0x427b81[_0x44ab('0x48')][_0x44ab('0x53')]+'%'};return _0x404d97;})});}_0x433e1c=_[_0x44ab('0x54')]({},_0x433e1c,_0x427b81['options']);return _0x989111['getAgents'](_0x433e1c);}})[_0x44ab('0x1f')](function(_0x149875){if(_0x149875){_0xf8437a=_0x149875[_0x44ab('0x4e')];if(!_0x427b81[_0x44ab('0x48')][_0x44ab('0x9d')]('nolimit')){_0x433e1c['limit']=qs[_0x44ab('0x31')](_0x427b81['query']['limit']);_0x433e1c[_0x44ab('0x2e')]=qs[_0x44ab('0x2e')](_0x427b81[_0x44ab('0x48')]['offset']);}return _0x989111['getAgents'](_0x433e1c);}})['then'](function(_0x57852c){if(_0x57852c){return _0x57852c?{'count':_0xf8437a,'rows':_0x57852c}:null;}})[_0x44ab('0x1f')](respondWithResult(_0x183f05,null))[_0x44ab('0x59')](handleError(_0x183f05,null));}; \ No newline at end of file +var _0x6e61=['spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','get','MailAccounts','destroy','stack','name','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','params','Imap','update','body','find','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','ListId','isNil','active','description','cservice','user','cuser','password','pass','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','Contact','User','fullname','internal','Tag','Tags','tag','addApplications','sequelize','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','sendStatus','send','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','basename','secure','SendMail','sendMail','List\x20not\x20found','defaults','messageId','subject','out','Interaction','verifySmtp','auth','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents'];(function(_0x5cc506,_0x2761a0){var _0x269462=function(_0xd10514){while(--_0xd10514){_0x5cc506['push'](_0x5cc506['shift']());}};_0x269462(++_0x2761a0);}(_0x6e61,0x19a));var _0x16e6=function(_0x46a55e,_0xe095bf){_0x46a55e=_0x46a55e-0x0;var _0x2648a8=_0x6e61[_0x46a55e];return _0x2648a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16e6('0x1'));var rp=require(_0x16e6('0x2'));var moment=require(_0x16e6('0x3'));var BPromise=require(_0x16e6('0x4'));var Mustache=require(_0x16e6('0x5'));var util=require(_0x16e6('0x6'));var path=require(_0x16e6('0x7'));var sox=require(_0x16e6('0x8'));var csv=require(_0x16e6('0x9'));var ejs=require(_0x16e6('0xa'));var fs=require('fs');var fs_extra=require(_0x16e6('0xb'));var _=require('lodash');var squel=require(_0x16e6('0xc'));var crypto=require(_0x16e6('0xd'));var jsforce=require(_0x16e6('0xe'));var deskjs=require(_0x16e6('0xf'));var toCsv=require(_0x16e6('0x9'));var querystring=require(_0x16e6('0x10'));var Papa=require(_0x16e6('0x11'));var htmlToText=require(_0x16e6('0x12'));var juice=require(_0x16e6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x16e6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16e6('0x15'));var logger=require(_0x16e6('0x16'))(_0x16e6('0x17'));var utils=require(_0x16e6('0x18'));var config=require(_0x16e6('0x19'));var licenseUtil=require(_0x16e6('0x1a'));var db=require(_0x16e6('0x1b'))['db'];config[_0x16e6('0x1c')]=_['defaults'](config[_0x16e6('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x16e6('0x1d'))(new Redis(config[_0x16e6('0x1c')]));require(_0x16e6('0x1e'))[_0x16e6('0x1f')](socket);var jayson=require(_0x16e6('0x20'));var client=jayson[_0x16e6('0x21')]['http']({'port':0x232b});function respondWithRpcPromise(_0x16199e,_0x3d6e4b,_0x41c725,_0x5d6c72){return new BPromise(function(_0x22d829,_0x71ad80){var _0x5f5159=_0x5d6c72||client;return _0x5f5159[_0x16e6('0x22')](_0x16199e,_0x41c725)[_0x16e6('0x23')](function(_0x3e5f43){logger[_0x16e6('0x24')]('MailAccount,\x20%s,\x20%s',_0x3d6e4b,'request\x20sent');logger[_0x16e6('0x25')](_0x16e6('0x26'),_0x3d6e4b,'request\x20sent',JSON[_0x16e6('0x27')](_0x3e5f43));if(_0x3e5f43[_0x16e6('0x28')]){if(_0x3e5f43[_0x16e6('0x28')]['code']===0x1f4){logger['error'](_0x16e6('0x29'),_0x3d6e4b,_0x3e5f43[_0x16e6('0x28')]['message']);return _0x71ad80(_0x3e5f43['error'][_0x16e6('0x2a')]);}logger['error'](_0x16e6('0x29'),_0x3d6e4b,_0x3e5f43['error'][_0x16e6('0x2a')]);return _0x22d829(_0x3e5f43[_0x16e6('0x28')][_0x16e6('0x2a')]);}else{logger[_0x16e6('0x24')](_0x16e6('0x29'),_0x3d6e4b,'request\x20sent');_0x22d829(_0x3e5f43[_0x16e6('0x2b')][_0x16e6('0x2a')]);}})[_0x16e6('0x2c')](function(_0x184354){logger[_0x16e6('0x28')](_0x16e6('0x29'),_0x3d6e4b,_0x184354);_0x71ad80(_0x184354);});});}function respondWithStatusCode(_0x5ceb7e,_0x182b8b){_0x182b8b=_0x182b8b||0xcc;return function(_0x10b786){if(_0x10b786){return _0x5ceb7e['sendStatus'](_0x182b8b);}return _0x5ceb7e[_0x16e6('0x2d')](_0x182b8b)[_0x16e6('0x2e')]();};}function respondWithResult(_0x4bce33,_0x278423){_0x278423=_0x278423||0xc8;return function(_0x207393){if(_0x207393){return _0x4bce33['status'](_0x278423)[_0x16e6('0x2f')](_0x207393);}};}function respondWithFilteredResult(_0x18ff17,_0x13f97e){return function(_0x51354f){if(_0x51354f){var _0x3ffff1=typeof _0x13f97e[_0x16e6('0x30')]===_0x16e6('0x31')&&typeof _0x13f97e[_0x16e6('0x32')]===_0x16e6('0x31');var _0x454f89=_0x51354f[_0x16e6('0x33')];var _0x3f5d32=_0x3ffff1?0x0:_0x13f97e[_0x16e6('0x30')];var _0x3c1954=_0x3ffff1?_0x51354f['count']:_0x13f97e['offset']+_0x13f97e[_0x16e6('0x32')];var _0xdf6705;if(_0x3c1954>=_0x454f89){_0x3c1954=_0x454f89;_0xdf6705=0xc8;}else{_0xdf6705=0xce;}_0x18ff17['status'](_0xdf6705);return _0x18ff17['set'](_0x16e6('0x34'),_0x3f5d32+'-'+_0x3c1954+'/'+_0x454f89)[_0x16e6('0x2f')](_0x51354f);}return null;};}function patchUpdates(_0x26a1e1){return function(_0x259718){try{jsonpatch[_0x16e6('0x35')](_0x259718,_0x26a1e1,!![]);}catch(_0x2f1f30){return BPromise[_0x16e6('0x36')](_0x2f1f30);}return _0x259718[_0x16e6('0x37')]();};}function saveUpdates(_0x3a651b,_0x1293ef){return function(_0x18d169){if(_0x18d169){return _0x18d169['update'](_0x3a651b)[_0x16e6('0x23')](function(_0x2989b5){return _0x2989b5;});}return null;};}function removeEntity(_0x3d4e67,_0x4517d2){return function(_0x4daa47){if(_0x4daa47){return _0x4daa47['destroy']()[_0x16e6('0x23')](function(){var _0x204a07=_0x4daa47[_0x16e6('0x38')]({'plain':!![]});var _0xcd6976=_0x16e6('0x39');return db['UserProfileResource'][_0x16e6('0x3a')]({'where':{'type':_0xcd6976,'resourceId':_0x204a07['id']}})[_0x16e6('0x23')](function(){return _0x4daa47;});})[_0x16e6('0x23')](function(){_0x3d4e67[_0x16e6('0x2d')](0xcc)[_0x16e6('0x2e')]();});}};}function handleEntityNotFound(_0x1f8a45,_0x323883){return function(_0x54f32c){if(!_0x54f32c){_0x1f8a45['sendStatus'](0x194);}return _0x54f32c;};}function handleError(_0x4641d2,_0x20177b){_0x20177b=_0x20177b||0x1f4;return function(_0xc247cb){logger[_0x16e6('0x28')](_0xc247cb[_0x16e6('0x3b')]);if(_0xc247cb[_0x16e6('0x3c')]){delete _0xc247cb['name'];}_0x4641d2[_0x16e6('0x2d')](_0x20177b)['send'](_0xc247cb);};}exports[_0x16e6('0x3d')]=function(_0x26657e,_0x4f5bed){var _0x10708f={'include':[{'model':db[_0x16e6('0x3e')],'as':'Imap'},{'model':db[_0x16e6('0x3f')],'as':_0x16e6('0x40')},{'model':db[_0x16e6('0x41')],'as':_0x16e6('0x42')}]},_0x580e11={},_0x945616={'count':0x0,'rows':[]};var _0x15d6f2=_[_0x16e6('0x43')](db['MailAccount'][_0x16e6('0x44')],function(_0xa5e529){return{'name':_0xa5e529[_0x16e6('0x45')],'type':_0xa5e529[_0x16e6('0x46')][_0x16e6('0x47')]};});_0x580e11[_0x16e6('0x48')]=_['map'](_0x15d6f2,'name');_0x580e11[_0x16e6('0x49')]=_[_0x16e6('0x4a')](_0x26657e[_0x16e6('0x49')]);_0x580e11[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x580e11[_0x16e6('0x48')],_0x580e11['query']);_0x10708f[_0x16e6('0x4d')]=_[_0x16e6('0x4c')](_0x580e11['model'],qs[_0x16e6('0x4e')](_0x26657e[_0x16e6('0x49')][_0x16e6('0x4e')]));_0x10708f[_0x16e6('0x4d')]=_0x10708f[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x10708f[_0x16e6('0x4d')]:_0x580e11[_0x16e6('0x48')];if(!_0x26657e[_0x16e6('0x49')][_0x16e6('0x50')]('nolimit')){_0x10708f['limit']=qs[_0x16e6('0x32')](_0x26657e[_0x16e6('0x49')][_0x16e6('0x32')]);_0x10708f['offset']=qs[_0x16e6('0x30')](_0x26657e[_0x16e6('0x49')][_0x16e6('0x30')]);}_0x10708f[_0x16e6('0x51')]=qs[_0x16e6('0x52')](_0x26657e[_0x16e6('0x49')][_0x16e6('0x52')]);_0x10708f['where']=qs[_0x16e6('0x4b')](_['pick'](_0x26657e[_0x16e6('0x49')],_0x580e11[_0x16e6('0x4b')]),_0x15d6f2);if(_0x26657e[_0x16e6('0x49')][_0x16e6('0x53')]){_0x10708f[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x10708f[_0x16e6('0x54')],{'$or':_['map'](_0x15d6f2,function(_0x13b642){if(_0x13b642['type']!==_0x16e6('0x56')){var _0x5e471e={};_0x5e471e[_0x13b642[_0x16e6('0x3c')]]={'$like':'%'+_0x26657e[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0x5e471e;}})});}_0x10708f=_[_0x16e6('0x55')]({},_0x10708f,_0x26657e[_0x16e6('0x57')]);var _0x48df24={'where':_0x10708f[_0x16e6('0x54')]};return db[_0x16e6('0x58')]['count'](_0x48df24)[_0x16e6('0x23')](function(_0x177a96){_0x945616[_0x16e6('0x33')]=_0x177a96;if(_0x26657e[_0x16e6('0x49')][_0x16e6('0x59')]){_0x10708f[_0x16e6('0x5a')]=[{'all':!![]}];}return db[_0x16e6('0x58')][_0x16e6('0x5b')](_0x10708f);})[_0x16e6('0x23')](function(_0xf6b7cf){_0x945616[_0x16e6('0x5c')]=_0xf6b7cf;return _0x945616;})[_0x16e6('0x23')](respondWithFilteredResult(_0x4f5bed,_0x10708f))[_0x16e6('0x2c')](handleError(_0x4f5bed,null));};exports[_0x16e6('0x5d')]=function(_0xad0a0b,_0x577e2d){var _0x554aa3={'raw':![],'where':{'id':_0xad0a0b[_0x16e6('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x16e6('0x5f')},{'model':db[_0x16e6('0x3f')],'as':_0x16e6('0x40')},{'model':db[_0x16e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x4a4d48={};_0x4a4d48[_0x16e6('0x48')]=_[_0x16e6('0x4a')](db[_0x16e6('0x58')][_0x16e6('0x44')]);_0x4a4d48['query']=_[_0x16e6('0x4a')](_0xad0a0b[_0x16e6('0x49')]);_0x4a4d48[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x4a4d48[_0x16e6('0x48')],_0x4a4d48['query']);_0x554aa3[_0x16e6('0x4d')]=_[_0x16e6('0x4c')](_0x4a4d48[_0x16e6('0x48')],qs[_0x16e6('0x4e')](_0xad0a0b[_0x16e6('0x49')][_0x16e6('0x4e')]));_0x554aa3[_0x16e6('0x4d')]=_0x554aa3[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x554aa3[_0x16e6('0x4d')]:_0x4a4d48[_0x16e6('0x48')];if(_0xad0a0b[_0x16e6('0x49')][_0x16e6('0x59')]){_0x554aa3['include']=[{'all':!![]}];}_0x554aa3=_['merge']({},_0x554aa3,_0xad0a0b[_0x16e6('0x57')]);return db['MailAccount']['find'](_0x554aa3)['then'](handleEntityNotFound(_0x577e2d,null))['then'](respondWithResult(_0x577e2d,null))[_0x16e6('0x2c')](handleError(_0x577e2d,null));};exports[_0x16e6('0x60')]=function(_0x3c2ac8,_0xfc9a48){if(_0x3c2ac8[_0x16e6('0x61')]['id']){delete _0x3c2ac8[_0x16e6('0x61')]['id'];}return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x3c2ac8[_0x16e6('0x5e')]['id']},'include':[{'model':db[_0x16e6('0x3e')],'as':_0x16e6('0x5f')},{'model':db[_0x16e6('0x3f')],'as':_0x16e6('0x40')},{'model':db['Pause'],'as':_0x16e6('0x42')}]})[_0x16e6('0x23')](handleEntityNotFound(_0xfc9a48,null))['then'](saveUpdates(_0x3c2ac8['body'],null))['then'](function(_0x2f8a0f){if(_0x2f8a0f&&_0x3c2ac8['body'][_0x16e6('0x5f')]){return db[_0x16e6('0x3e')][_0x16e6('0x60')](_0x3c2ac8[_0x16e6('0x61')][_0x16e6('0x5f')],{'where':{'MailAccountId':_0x2f8a0f['id']}})['then'](function(){return _0x2f8a0f;});}return _0x2f8a0f;})[_0x16e6('0x23')](function(_0x398177){if(_0x398177&&_0x3c2ac8[_0x16e6('0x61')][_0x16e6('0x40')]){return db[_0x16e6('0x3f')][_0x16e6('0x60')](_0x3c2ac8[_0x16e6('0x61')][_0x16e6('0x40')],{'where':{'MailAccountId':_0x398177['id']}})[_0x16e6('0x23')](function(){return _0x398177;});}return _0x398177;})[_0x16e6('0x23')](respondWithResult(_0xfc9a48,null))['catch'](handleError(_0xfc9a48,null));};exports[_0x16e6('0x63')]=function(_0x2ffab3,_0x18f3cb){return db['MailAccount']['describe']()[_0x16e6('0x23')](respondWithResult(_0x18f3cb,null))[_0x16e6('0x2c')](handleError(_0x18f3cb,null));};exports[_0x16e6('0x64')]=function(_0x4b6c15,_0x59c20c,_0x4f751b){if(_0x4b6c15[_0x16e6('0x61')]['id']){delete _0x4b6c15[_0x16e6('0x61')]['id'];}return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x4b6c15[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x59c20c,null))['then'](function(_0x4f8bda){if(_0x4f8bda){_0x4b6c15['body'][_0x16e6('0x65')]=_0x4f8bda['id'];return db['Disposition'][_0x16e6('0x66')](_0x4b6c15['body']);}})[_0x16e6('0x23')](respondWithResult(_0x59c20c,null))['catch'](handleError(_0x59c20c,null));};exports[_0x16e6('0x67')]=function(_0xf197fe,_0x3eca6e,_0x307ca5){var _0x903f61={'raw':![],'where':{}};var _0x38734c={};var _0x17c579={'count':0x0,'rows':[]};return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0xf197fe['params']['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x3eca6e,null))[_0x16e6('0x23')](function(_0x28609f){if(_0x28609f){_0x38734c[_0x16e6('0x48')]=_['keys'](db[_0x16e6('0x69')]['rawAttributes']);_0x38734c[_0x16e6('0x49')]=_[_0x16e6('0x4a')](_0xf197fe[_0x16e6('0x49')]);_0x38734c[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x38734c['model'],_0x38734c[_0x16e6('0x49')]);_0x903f61['attributes']=_[_0x16e6('0x4c')](_0x38734c['model'],qs[_0x16e6('0x4e')](_0xf197fe[_0x16e6('0x49')]['fields']));_0x903f61['attributes']=_0x903f61[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x903f61['attributes']:_0x38734c[_0x16e6('0x48')];if(!_0xf197fe[_0x16e6('0x49')][_0x16e6('0x50')]('nolimit')){_0x903f61[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0xf197fe['query'][_0x16e6('0x32')]);_0x903f61[_0x16e6('0x30')]=qs[_0x16e6('0x30')](_0xf197fe[_0x16e6('0x49')]['offset']);}_0x903f61['order']=qs[_0x16e6('0x52')](_0xf197fe[_0x16e6('0x49')][_0x16e6('0x52')]);_0x903f61[_0x16e6('0x54')]=qs[_0x16e6('0x4b')](_[_0x16e6('0x6a')](_0xf197fe['query'],_0x38734c[_0x16e6('0x4b')]));_0x903f61['where'][_0x16e6('0x65')]=_0x28609f['id'];if(_0xf197fe[_0x16e6('0x49')]['filter']){_0x903f61[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x903f61['where'],{'$or':_['map'](_0x903f61[_0x16e6('0x4d')],function(_0x3b72fa){var _0x2be220={};_0x2be220[_0x3b72fa]={'$like':'%'+_0xf197fe[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0x2be220;})});}_0x903f61=_[_0x16e6('0x55')]({},_0x903f61,_0xf197fe['options']);return db[_0x16e6('0x69')]['count']({'where':_0x903f61[_0x16e6('0x54')]})[_0x16e6('0x23')](function(_0x2cb7a3){_0x17c579['count']=_0x2cb7a3;if(_0xf197fe[_0x16e6('0x49')][_0x16e6('0x59')]){_0x903f61[_0x16e6('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x16e6('0x5b')](_0x903f61);})[_0x16e6('0x23')](function(_0x47cf90){_0x17c579['rows']=_0x47cf90;return _0x17c579;});}})[_0x16e6('0x23')](respondWithFilteredResult(_0x3eca6e,_0x903f61))[_0x16e6('0x2c')](handleError(_0x3eca6e,null));};exports[_0x16e6('0x6b')]=function(_0x2dd5c1,_0x3851ec,_0x2f8cd3){return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x2dd5c1[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x3851ec,null))[_0x16e6('0x23')](function(_0x538467){if(_0x538467){return _0x538467[_0x16e6('0x6b')](_0x2dd5c1[_0x16e6('0x49')][_0x16e6('0x6c')]);}})[_0x16e6('0x23')](respondWithStatusCode(_0x3851ec,null))[_0x16e6('0x2c')](handleError(_0x3851ec,null));};exports[_0x16e6('0x6d')]=function(_0x1040c7,_0x1411ea,_0x3c49f8){if(_0x1040c7[_0x16e6('0x61')]['id']){delete _0x1040c7[_0x16e6('0x61')]['id'];}return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x1040c7[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x1411ea,null))[_0x16e6('0x23')](function(_0x3d13a3){if(_0x3d13a3){_0x1040c7[_0x16e6('0x61')][_0x16e6('0x65')]=_0x3d13a3['id'];return db[_0x16e6('0x6e')][_0x16e6('0x66')](_0x1040c7['body']);}})[_0x16e6('0x23')](respondWithResult(_0x1411ea,null))['catch'](handleError(_0x1411ea,null));};exports['getAnswers']=function(_0x38281a,_0x18e653,_0x33c7a4){var _0x497c93={'raw':![],'where':{}};var _0x446b26={};var _0x260a68={'count':0x0,'rows':[]};return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x38281a[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x18e653,null))[_0x16e6('0x23')](function(_0x19b8fe){if(_0x19b8fe){_0x446b26['model']=_[_0x16e6('0x4a')](db[_0x16e6('0x6e')][_0x16e6('0x44')]);_0x446b26[_0x16e6('0x49')]=_['keys'](_0x38281a[_0x16e6('0x49')]);_0x446b26[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x446b26[_0x16e6('0x48')],_0x446b26['query']);_0x497c93['attributes']=_[_0x16e6('0x4c')](_0x446b26[_0x16e6('0x48')],qs['fields'](_0x38281a[_0x16e6('0x49')][_0x16e6('0x4e')]));_0x497c93['attributes']=_0x497c93[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x497c93[_0x16e6('0x4d')]:_0x446b26[_0x16e6('0x48')];if(!_0x38281a['query'][_0x16e6('0x50')](_0x16e6('0x6f'))){_0x497c93[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0x38281a[_0x16e6('0x49')][_0x16e6('0x32')]);_0x497c93['offset']=qs['offset'](_0x38281a['query'][_0x16e6('0x30')]);}_0x497c93[_0x16e6('0x51')]=qs[_0x16e6('0x52')](_0x38281a['query'][_0x16e6('0x52')]);_0x497c93[_0x16e6('0x54')]=qs[_0x16e6('0x4b')](_[_0x16e6('0x6a')](_0x38281a[_0x16e6('0x49')],_0x446b26['filters']));_0x497c93[_0x16e6('0x54')][_0x16e6('0x65')]=_0x19b8fe['id'];if(_0x38281a[_0x16e6('0x49')][_0x16e6('0x53')]){_0x497c93[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x497c93[_0x16e6('0x54')],{'$or':_[_0x16e6('0x43')](_0x497c93[_0x16e6('0x4d')],function(_0x5a3fdf){var _0x3aac04={};_0x3aac04[_0x5a3fdf]={'$like':'%'+_0x38281a['query'][_0x16e6('0x53')]+'%'};return _0x3aac04;})});}_0x497c93=_[_0x16e6('0x55')]({},_0x497c93,_0x38281a[_0x16e6('0x57')]);return db[_0x16e6('0x6e')]['count']({'where':_0x497c93[_0x16e6('0x54')]})['then'](function(_0x1d8fa1){_0x260a68[_0x16e6('0x33')]=_0x1d8fa1;if(_0x38281a[_0x16e6('0x49')]['includeAll']){_0x497c93['include']=[{'all':!![]}];}return db[_0x16e6('0x6e')][_0x16e6('0x5b')](_0x497c93);})[_0x16e6('0x23')](function(_0x3e87e9){_0x260a68[_0x16e6('0x5c')]=_0x3e87e9;return _0x260a68;});}})['then'](respondWithFilteredResult(_0x18e653,_0x497c93))['catch'](handleError(_0x18e653,null));};exports['removeAnswers']=function(_0x238c9a,_0xebf0b8,_0x311628){return db['MailAccount']['find']({'where':{'id':_0x238c9a['params']['id']}})['then'](handleEntityNotFound(_0xebf0b8,null))['then'](function(_0x2c14b8){if(_0x2c14b8){return _0x2c14b8[_0x16e6('0x70')](_0x238c9a[_0x16e6('0x49')]['ids']);}})[_0x16e6('0x23')](respondWithStatusCode(_0xebf0b8,null))[_0x16e6('0x2c')](handleError(_0xebf0b8,null));};exports[_0x16e6('0x66')]=function(_0x47fc41,_0x267f91){var _0x5eb10b={'name':_0x47fc41['body']['name'],'key':_0x47fc41[_0x16e6('0x61')]['key'],'email':_0x47fc41[_0x16e6('0x61')]['email'],'ListId':_0x47fc41['body'][_0x16e6('0x71')],'active':!_[_0x16e6('0x72')](_0x47fc41[_0x16e6('0x61')]['active'])?_0x47fc41[_0x16e6('0x61')][_0x16e6('0x73')]:!![],'description':_0x47fc41[_0x16e6('0x61')][_0x16e6('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x16e6('0x72')](_0x47fc41[_0x16e6('0x61')][_0x16e6('0x75')])){if(_0x47fc41[_0x16e6('0x61')]['cauthentication']){_0x5eb10b['Imap'][_0x16e6('0x76')]=_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x76')]=_0x47fc41[_0x16e6('0x61')][_0x16e6('0x77')];_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x78')]=_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x79')]=_0x47fc41[_0x16e6('0x61')]['cpassword'];}else{_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x7a')]=_0x5eb10b[_0x16e6('0x40')]['authentication']=![];}_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x7b')]=_0x47fc41[_0x16e6('0x61')][_0x16e6('0x5f')][_0x16e6('0x7b')];_0x5eb10b['Imap'][_0x16e6('0x7c')]=_0x47fc41['body'][_0x16e6('0x5f')]['port'];_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x7b')]=_0x47fc41[_0x16e6('0x61')][_0x16e6('0x40')][_0x16e6('0x7b')];_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x7c')]=_0x47fc41[_0x16e6('0x61')][_0x16e6('0x40')]['port'];}else{_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x7d')]=_0x5eb10b[_0x16e6('0x40')]['service']=_0x47fc41[_0x16e6('0x61')][_0x16e6('0x75')];_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x76')]=_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x76')]=_0x47fc41['body'][_0x16e6('0x77')];_0x5eb10b[_0x16e6('0x5f')][_0x16e6('0x78')]=_0x5eb10b[_0x16e6('0x40')][_0x16e6('0x79')]=_0x47fc41[_0x16e6('0x61')]['cpassword'];}return db[_0x16e6('0x58')]['create'](_0x5eb10b,{'include':[{'model':db[_0x16e6('0x3f')],'as':_0x16e6('0x40')},{'model':db[_0x16e6('0x3e')],'as':_0x16e6('0x5f')}]})[_0x16e6('0x23')](function(_0x47cf91){var _0x4884fe=_0x47fc41[_0x16e6('0x76')][_0x16e6('0x38')]({'plain':!![]});if(!_0x4884fe)throw new Error(_0x16e6('0x7e'));if(_0x4884fe[_0x16e6('0x7f')]===_0x16e6('0x76')){var _0x3c3745=_0x47cf91[_0x16e6('0x38')]({'plain':!![]});return db[_0x16e6('0x80')][_0x16e6('0x62')]({'where':{'name':'MailAccounts','userProfileId':_0x4884fe[_0x16e6('0x81')]},'raw':!![]})['then'](function(_0x5225b2){if(_0x5225b2&&_0x5225b2[_0x16e6('0x82')]===0x0){return db[_0x16e6('0x83')][_0x16e6('0x66')]({'name':_0x3c3745['name'],'resourceId':_0x3c3745['id'],'type':_0x5225b2[_0x16e6('0x3c')],'sectionId':_0x5225b2['id']},{})[_0x16e6('0x23')](function(){return _0x47cf91;});}else{return _0x47cf91;}})['catch'](function(_0x54406c){logger[_0x16e6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54406c);throw _0x54406c;});}return _0x47cf91;})[_0x16e6('0x23')](respondWithResult(_0x267f91,0xc9))['catch'](handleError(_0x267f91,null));};exports[_0x16e6('0x84')]=function(_0x3978d9,_0xe478a3,_0x3452c6){return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x3978d9[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0xe478a3,null))[_0x16e6('0x23')](function(_0x45bc48){if(_0x45bc48){return _0x45bc48['getImap']();}return null;})[_0x16e6('0x23')](respondWithResult(_0xe478a3,null))['catch'](handleError(_0xe478a3,null));};exports[_0x16e6('0x85')]=function(_0x56dd9a,_0x4ad06a,_0x5de3a6){if(_0x56dd9a[_0x16e6('0x61')]['id']){delete _0x56dd9a[_0x16e6('0x61')]['id'];}return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x56dd9a[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x4ad06a,null))[_0x16e6('0x23')](function(_0x5af461){if(_0x5af461){_0x56dd9a[_0x16e6('0x61')][_0x16e6('0x65')]=_0x5af461['id'];return db['MailServerIn'][_0x16e6('0x66')](_0x56dd9a[_0x16e6('0x61')]);}})[_0x16e6('0x23')](respondWithResult(_0x4ad06a,null))[_0x16e6('0x2c')](handleError(_0x4ad06a,null));};exports[_0x16e6('0x86')]=function(_0x18fdb3,_0x4080e0,_0xe5809e){return db['MailAccount']['findOne']({'where':{'id':_0x18fdb3[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x4080e0,null))[_0x16e6('0x23')](function(_0x5c4ef3){if(_0x5c4ef3){return _0x5c4ef3[_0x16e6('0x87')](null);}return null;})[_0x16e6('0x23')](respondWithStatusCode(_0x4080e0,null))[_0x16e6('0x2c')](handleError(_0x4080e0,null));};exports['getSmtp']=function(_0x149d55,_0xb336bc,_0x20d1b6){return db[_0x16e6('0x58')]['findOne']({'where':{'id':_0x149d55[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0xb336bc,null))[_0x16e6('0x23')](function(_0x3d17c9){if(_0x3d17c9){return _0x3d17c9[_0x16e6('0x88')]();}return null;})['then'](respondWithResult(_0xb336bc,null))[_0x16e6('0x2c')](handleError(_0xb336bc,null));};exports[_0x16e6('0x89')]=function(_0x2e6803,_0x184979,_0x20cb20){if(_0x2e6803[_0x16e6('0x61')]['id']){delete _0x2e6803[_0x16e6('0x61')]['id'];}return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x2e6803[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x184979,null))['then'](function(_0x5db42b){if(_0x5db42b){_0x2e6803['body'][_0x16e6('0x65')]=_0x5db42b['id'];return db[_0x16e6('0x3f')][_0x16e6('0x66')](_0x2e6803['body']);}})[_0x16e6('0x23')](respondWithResult(_0x184979,null))[_0x16e6('0x2c')](handleError(_0x184979,null));};exports[_0x16e6('0x8a')]=function(_0x2bdb74,_0x50acc3,_0x4119a2){return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x2bdb74[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x50acc3,null))[_0x16e6('0x23')](function(_0x5701aa){if(_0x5701aa){return _0x5701aa[_0x16e6('0x8b')](null);}return null;})[_0x16e6('0x23')](respondWithStatusCode(_0x50acc3,null))[_0x16e6('0x2c')](handleError(_0x50acc3,null));};exports[_0x16e6('0x8c')]=function(_0x25af8e,_0x29b300,_0x1e1f64){return db['MailInteraction'][_0x16e6('0x62')]({'where':{'id':_0x25af8e['params']['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x29b300,null))['then'](function(_0x2fcd49){if(_0x2fcd49){return _0x2fcd49[_0x16e6('0x8c')](_0x25af8e[_0x16e6('0x61')][_0x16e6('0x6c')],_[_0x16e6('0x8d')](_0x25af8e[_0x16e6('0x61')],[_0x16e6('0x6c'),'id'])||{});}})[_0x16e6('0x23')](respondWithResult(_0x29b300,null))[_0x16e6('0x2c')](handleError(_0x29b300,null));};exports[_0x16e6('0x8e')]=function(_0x3d508a,_0xf43445,_0x52a0ea){var _0x5a25e6={'raw':![],'where':{}};var _0x3b0b05={};var _0x5105d1={'count':0x0,'rows':[]};return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x3d508a['params']['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0xf43445,null))['then'](function(_0x5bb951){if(_0x5bb951){_0x3b0b05[_0x16e6('0x48')]=_[_0x16e6('0x4a')](db[_0x16e6('0x8f')][_0x16e6('0x44')]);_0x3b0b05[_0x16e6('0x49')]=_[_0x16e6('0x4a')](_0x3d508a[_0x16e6('0x49')]);_0x3b0b05[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x3b0b05[_0x16e6('0x48')],_0x3b0b05[_0x16e6('0x49')]);_0x5a25e6[_0x16e6('0x4d')]=_['intersection'](_0x3b0b05[_0x16e6('0x48')],qs['fields'](_0x3d508a[_0x16e6('0x49')][_0x16e6('0x4e')]));_0x5a25e6[_0x16e6('0x4d')]=_0x5a25e6[_0x16e6('0x4d')]['length']?_0x5a25e6[_0x16e6('0x4d')]:_0x3b0b05[_0x16e6('0x48')];if(!_0x3d508a['query'][_0x16e6('0x50')]('nolimit')){_0x5a25e6[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0x3d508a[_0x16e6('0x49')]['limit']);_0x5a25e6['offset']=qs[_0x16e6('0x30')](_0x3d508a[_0x16e6('0x49')]['offset']);}_0x5a25e6['order']=qs[_0x16e6('0x52')](_0x3d508a[_0x16e6('0x49')][_0x16e6('0x52')]);_0x5a25e6[_0x16e6('0x54')]=qs[_0x16e6('0x4b')](_[_0x16e6('0x6a')](_0x3d508a[_0x16e6('0x49')],_0x3b0b05['filters']));_0x5a25e6[_0x16e6('0x54')]['MailAccountId']=_0x5bb951['id'];if(_0x3d508a[_0x16e6('0x49')][_0x16e6('0x53')]){_0x5a25e6[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x5a25e6[_0x16e6('0x54')],{'$or':_[_0x16e6('0x43')](_0x5a25e6[_0x16e6('0x4d')],function(_0x479b2e){var _0x1a7796={};_0x1a7796[_0x479b2e]={'$like':'%'+_0x3d508a[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0x1a7796;})});}_0x5a25e6=_[_0x16e6('0x55')]({},_0x5a25e6,_0x3d508a[_0x16e6('0x57')]);return db[_0x16e6('0x8f')][_0x16e6('0x33')]({'where':_0x5a25e6['where']})[_0x16e6('0x23')](function(_0x332cb9){_0x5105d1['count']=_0x332cb9;if(_0x3d508a[_0x16e6('0x49')]['includeAll']){_0x5a25e6[_0x16e6('0x5a')]=[{'model':db['CmContact'],'as':_0x16e6('0x90'),'required':![]},{'model':db[_0x16e6('0x91')],'as':'Owner','attributes':[_0x16e6('0x3c'),_0x16e6('0x92'),_0x16e6('0x93')],'required':![]},{'model':db[_0x16e6('0x94')],'as':_0x16e6('0x95'),'attributes':['id',_0x16e6('0x3c'),'color'],'where':_0x3d508a[_0x16e6('0x49')][_0x16e6('0x96')]?{'id':_0x3d508a[_0x16e6('0x49')]['tag']}:undefined,'required':_0x3d508a[_0x16e6('0x49')][_0x16e6('0x96')]?!![]:![]}];}return db[_0x16e6('0x8f')][_0x16e6('0x5b')](_0x5a25e6);})['then'](function(_0x5f3eb1){_0x5105d1[_0x16e6('0x5c')]=_0x5f3eb1;return _0x5105d1;});}})[_0x16e6('0x23')](respondWithFilteredResult(_0xf43445,_0x5a25e6))['catch'](handleError(_0xf43445,null));};exports[_0x16e6('0x97')]=function addApplications(_0x1482f0,_0x4a454f){var _0x4a250c=_0x1482f0[_0x16e6('0x5e')]['id'];var _0x1b379b=_0x1482f0[_0x16e6('0x61')];var _0x4e57d1=0xc8;var _0x1a9688=null;return db[_0x16e6('0x98')]['transaction']({'isolationLevel':db[_0x16e6('0x98')]['Transaction']['ISOLATION_LEVELS'][_0x16e6('0x99')]},function(_0x5f1b7b){return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x4a250c},'transaction':_0x5f1b7b})[_0x16e6('0x23')](function(_0x35ace4){if(_0x35ace4){return db[_0x16e6('0x9a')][_0x16e6('0x3a')]({'where':{'MailAccountId':_0x4a250c},'transaction':_0x5f1b7b})['then'](function(){var _0x32341e=_[_0x16e6('0x43')](_0x1b379b,function(_0x5cf6d0){_0x5cf6d0[_0x16e6('0x65')]=_0x4a250c;return _0x5cf6d0;});return db['MailApplication'][_0x16e6('0x9b')](_0x32341e,{'transaction':_0x5f1b7b});});}else{_0x4e57d1=0x194;_0x1a9688=[];}});})['then'](function(){if(_0x4e57d1!==0x194){return db[_0x16e6('0x9a')][_0x16e6('0x9c')]({'where':{'MailAccountId':_0x4a250c},'order':'priority'})['then'](function(_0x2ec8c7){_0x1a9688=_0x2ec8c7;});}})[_0x16e6('0x2c')](function(_0x140d5d){_0x4e57d1=0x1f4;logger[_0x16e6('0x28')](_0x140d5d[_0x16e6('0x3b')]);if(_0x140d5d[_0x16e6('0x3c')]){delete _0x140d5d[_0x16e6('0x3c')];}_0x1a9688=_0x140d5d;})[_0x16e6('0x9d')](function(){if(_0x1a9688===null){_0x4a454f[_0x16e6('0x9e')](_0x4e57d1);}else{if(_0x4e57d1===0x1f4){_0x4a454f[_0x16e6('0x2d')](_0x4e57d1)[_0x16e6('0x9f')](_0x1a9688);}else{_0x4a454f[_0x16e6('0x2d')](_0x4e57d1)['json'](_0x1a9688);}}});};exports['getApplications']=function(_0xcdaee3,_0xbd1f72,_0x30a696){var _0x194b1d={};var _0x5d7bde={};var _0x1b1598;var _0x2ba59e;return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0xcdaee3[_0x16e6('0x5e')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0xbd1f72,null))[_0x16e6('0x23')](function(_0x3f4382){if(_0x3f4382){_0x1b1598=_0x3f4382;_0x5d7bde[_0x16e6('0x48')]=_[_0x16e6('0x4a')](db[_0x16e6('0x9a')][_0x16e6('0x44')]);_0x5d7bde['query']=_[_0x16e6('0x4a')](_0xcdaee3[_0x16e6('0x49')]);_0x5d7bde[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x5d7bde['model'],_0x5d7bde[_0x16e6('0x49')]);_0x194b1d[_0x16e6('0x4d')]=_['intersection'](_0x5d7bde[_0x16e6('0x48')],qs[_0x16e6('0x4e')](_0xcdaee3[_0x16e6('0x49')][_0x16e6('0x4e')]));_0x194b1d[_0x16e6('0x4d')]=_0x194b1d['attributes'][_0x16e6('0x4f')]?_0x194b1d['attributes']:_0x5d7bde[_0x16e6('0x48')];_0x194b1d['order']=qs[_0x16e6('0x52')](_0xcdaee3['query'][_0x16e6('0x52')]);_0x194b1d[_0x16e6('0x54')]=qs['filters'](_[_0x16e6('0x6a')](_0xcdaee3[_0x16e6('0x49')],_0x5d7bde[_0x16e6('0x4b')]));if(_0xcdaee3[_0x16e6('0x49')][_0x16e6('0x53')]){_0x194b1d[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x194b1d['where'],{'$or':_[_0x16e6('0x43')](_0x194b1d[_0x16e6('0x4d')],function(_0x3909f9){var _0xe7642={};_0xe7642[_0x3909f9]={'$like':'%'+_0xcdaee3[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0xe7642;})});}_0x194b1d=_[_0x16e6('0x55')]({},_0x194b1d,_0xcdaee3[_0x16e6('0x57')]);return _0x1b1598[_0x16e6('0xa0')](_0x194b1d);}})[_0x16e6('0x23')](function(_0x2ba821){if(_0x2ba821){_0x2ba59e=_0x2ba821['length'];if(!_0xcdaee3['query'][_0x16e6('0x50')]('nolimit')){_0x194b1d[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0xcdaee3['query'][_0x16e6('0x32')]);_0x194b1d[_0x16e6('0x30')]=qs[_0x16e6('0x30')](_0xcdaee3[_0x16e6('0x49')]['offset']);}return _0x1b1598['getApplications'](_0x194b1d);}})[_0x16e6('0x23')](function(_0x29c338){if(_0x29c338){return _0x29c338?{'count':_0x2ba59e,'rows':_0x29c338}:null;}})['then'](respondWithResult(_0xbd1f72,null))['catch'](handleError(_0xbd1f72,null));};exports[_0x16e6('0xa1')]=function(_0x3a694e,_0xff7acd,_0x4965b1){var _0x310fdd={'raw':!![],'where':{}};var _0x2700ae={};var _0x3561b6={'count':0x0,'rows':[]};return db[_0x16e6('0x58')][_0x16e6('0x68')]({'where':{'id':_0x3a694e[_0x16e6('0x5e')]['id']}})['then'](handleEntityNotFound(_0xff7acd,null))[_0x16e6('0x23')](function(_0x50ef58){if(_0x50ef58){_0x2700ae[_0x16e6('0x48')]=_[_0x16e6('0x4a')](db['MailMessage'][_0x16e6('0x44')]);_0x2700ae['query']=_[_0x16e6('0x4a')](_0x3a694e[_0x16e6('0x49')]);_0x2700ae[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x2700ae[_0x16e6('0x48')],_0x2700ae[_0x16e6('0x49')]);_0x310fdd[_0x16e6('0x4d')]=_[_0x16e6('0x4c')](_0x2700ae[_0x16e6('0x48')],qs[_0x16e6('0x4e')](_0x3a694e['query'][_0x16e6('0x4e')]));_0x310fdd['attributes']=_0x310fdd[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x310fdd['attributes']:_0x2700ae['model'];if(!_0x3a694e[_0x16e6('0x49')][_0x16e6('0x50')](_0x16e6('0x6f'))){_0x310fdd[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0x3a694e['query'][_0x16e6('0x32')]);_0x310fdd[_0x16e6('0x30')]=qs[_0x16e6('0x30')](_0x3a694e[_0x16e6('0x49')]['offset']);}_0x310fdd[_0x16e6('0x51')]=qs['sort'](_0x3a694e[_0x16e6('0x49')][_0x16e6('0x52')]);_0x310fdd[_0x16e6('0x54')]=qs[_0x16e6('0x4b')](_[_0x16e6('0x6a')](_0x3a694e['query'],_0x2700ae['filters']));_0x310fdd[_0x16e6('0x54')][_0x16e6('0x65')]=_0x50ef58['id'];if(_0x3a694e['query']['filter']){_0x310fdd[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x310fdd['where'],{'$or':_['map'](_0x310fdd[_0x16e6('0x4d')],function(_0x641bb){var _0x2711ba={};_0x2711ba[_0x641bb]={'$like':'%'+_0x3a694e[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0x2711ba;})});}if(_0x3a694e['query'][_0x16e6('0xa2')]){var _0x4a0b61=_0x3a694e[_0x16e6('0x49')][_0x16e6('0xa2')][_0x16e6('0xa3')](',');var _0x31d12d={};_0x31d12d[_0x4a0b61[0x0]]={'$gte':moment(_0x4a0b61[0x1])[_0x16e6('0xa4')](_0x16e6('0xa5'))};_0x310fdd[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x310fdd[_0x16e6('0x54')],_0x31d12d);}_0x310fdd=_[_0x16e6('0x55')]({},_0x310fdd,_0x3a694e[_0x16e6('0x57')]);return db[_0x16e6('0xa6')][_0x16e6('0x33')]({'where':_0x310fdd[_0x16e6('0x54')]})['then'](function(_0x44f887){_0x3561b6['count']=_0x44f887;if(_0x3a694e['query'][_0x16e6('0x59')]){_0x310fdd['include']=[{'all':!![]}];}return db['MailMessage'][_0x16e6('0x5b')](_0x310fdd);})[_0x16e6('0x23')](function(_0x5f0c60){if(_0x3a694e['query'][_0x16e6('0xa7')]===_0x16e6('0xa8')){for(var _0x4fa021=0x0;_0x4fa021<_0x5f0c60[_0x16e6('0x4f')];_0x4fa021++){_0x5f0c60[_0x4fa021]['body']=juice(_0x5f0c60[_0x4fa021]['body']);}}_0x3561b6['rows']=_0x5f0c60;return _0x3561b6;});}})['then'](respondWithFilteredResult(_0xff7acd,_0x310fdd))['catch'](handleError(_0xff7acd,null));};exports[_0x16e6('0x9f')]=function(_0x26371f,_0x5bdb76,_0x4bd828){var _0xbe5116,_0x35baeb={},_0x287726;if(_0x26371f['body']['to']){_0x287726=_0x26371f['body']['to'][_0x16e6('0xa3')](',')[0x0];}return db['MailAccount'][_0x16e6('0x62')]({'where':{'id':_0x26371f[_0x16e6('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x16e6('0xa9'),'include':[{'model':db[_0x16e6('0xaa')],'as':_0x16e6('0xab'),'where':{'email':_0x287726},'limit':0x1,'order':[[_0x16e6('0xac'),_0x16e6('0xad')]]}]},{'model':db['MailServerOut'],'as':_0x16e6('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5bdb76,null))[_0x16e6('0x23')](function(_0x385629){if(_0x385629){_0xbe5116=_0x385629;if(_0x385629[_0x16e6('0x40')]){if(_[_0x16e6('0x72')](_0x26371f[_0x16e6('0x61')][_0x16e6('0xae')])){_0x26371f['body'][_0x16e6('0xae')]=util[_0x16e6('0xa4')](_0x16e6('0xaf'),_0x385629[_0x16e6('0x3c')],_0x385629[_0x16e6('0xb0')]||_0x385629[_0x16e6('0x40')][_0x16e6('0x76')]);}if(_0x26371f[_0x16e6('0x61')]['attachments']&&_0x26371f[_0x16e6('0x61')]['attachments'][_0x16e6('0x4f')]){for(var _0x18f5c3=0x0;_0x18f5c3<_0x26371f[_0x16e6('0x61')]['attachments'][_0x16e6('0x4f')];_0x18f5c3+=0x1){_0x26371f[_0x16e6('0x61')][_0x16e6('0xb1')][_0x18f5c3]={'filename':_0x26371f[_0x16e6('0x61')][_0x16e6('0xb1')][_0x18f5c3][_0x16e6('0x3c')],'path':path[_0x16e6('0xb2')](config[_0x16e6('0xb3')],'server/files/attachments',_0x26371f['body']['attachments'][_0x18f5c3][_0x16e6('0xb4')])};}}var _0x59dee3={'tls':{'rejectUnauthorized':![]}};if(_[_0x16e6('0x72')](_0x385629[_0x16e6('0x40')][_0x16e6('0x7d')])){if(_0x385629[_0x16e6('0x40')]['authentication']){_0x59dee3['auth']={'user':_0x385629[_0x16e6('0x40')][_0x16e6('0x76')],'pass':_0x385629[_0x16e6('0x40')]['pass']};}_0x59dee3[_0x16e6('0x7b')]=_0x385629['Smtp']['host'];_0x59dee3['port']=_0x385629[_0x16e6('0x40')][_0x16e6('0x7c')];_0x59dee3[_0x16e6('0xb5')]=_0x385629[_0x16e6('0x40')]['secure'];}else{_0x59dee3[_0x16e6('0x7d')]=_0x385629[_0x16e6('0x40')][_0x16e6('0x7d')];_0x59dee3['auth']={'user':_0x385629[_0x16e6('0x40')][_0x16e6('0x76')],'pass':_0x385629['Smtp'][_0x16e6('0x79')]};}return respondWithRpcPromise(_0x16e6('0xb6'),_0x16e6('0xb7'),{'account':_0x59dee3,'message':_0x26371f[_0x16e6('0x61')]});}else{throw new Error(_0x16e6('0xb8'));}}})[_0x16e6('0x23')](function(_0xc54771){if(_0xc54771){_0x35baeb=_0xc54771;if(_0xbe5116[_0x16e6('0xa9')]){if(_0xbe5116[_0x16e6('0xa9')][_0x16e6('0xab')][_0x16e6('0x4f')]){return _0xbe5116[_0x16e6('0xa9')][_0x16e6('0xab')][0x0];}else{return db[_0x16e6('0xaa')]['create'](_[_0x16e6('0xb9')](_0x26371f[_0x16e6('0x61')],{'firstName':_0x26371f[_0x16e6('0x61')]['to'],'email':_0x26371f[_0x16e6('0x61')]['to'],'phone':_0x26371f[_0x16e6('0x61')]['to'],'ListId':_0xbe5116[_0x16e6('0x71')]}));}}else{throw new Error(_0x16e6('0xb8'));}}})['then'](function(_0x5a5796){if(_0x5a5796){var _0x4e15f9={'UserId':_0x26371f[_0x16e6('0x76')]['id'],'ContactId':_0x5a5796['id'],'MailAccountId':_0xbe5116['id'],'inReplyTo':_0x35baeb[_0x16e6('0xba')],'to':_0x26371f[_0x16e6('0x61')][_0x16e6('0xae')],'cc':_0x26371f['body']['cc'],'subject':_0x26371f[_0x16e6('0x61')][_0x16e6('0xbb')],'attach':_0x26371f['body']['attach'],'firstMsgDirection':_0x16e6('0xbc'),'lastMsgAt':moment()['format'](_0x16e6('0xa5')),'lastMsgDirection':'out','Messages':[_[_0x16e6('0x55')](_0x26371f[_0x16e6('0x61')],{'messageId':_0x35baeb[_0x16e6('0xba')],'sentAt':moment()['format'](_0x16e6('0xa5')),'read':!![],'MailAccountId':_0xbe5116['id'],'UserId':_0x26371f[_0x16e6('0x76')]['id'],'ContactId':_0x5a5796['id']})]};if(_0x26371f[_0x16e6('0x61')]['Interaction']){_0x4e15f9=_[_0x16e6('0x55')](_0x4e15f9,_0x26371f[_0x16e6('0x61')][_0x16e6('0xbd')]);}return db[_0x16e6('0x8f')][_0x16e6('0x66')](_0x4e15f9,{'include':[{'model':db[_0x16e6('0xa6')],'as':'Messages'}]});}})['then'](respondWithResult(_0x5bdb76,null))[_0x16e6('0x2c')](handleError(_0x5bdb76,null));};exports[_0x16e6('0xbe')]=function(_0x3a0ef3,_0x20a595,_0x34b5bd){return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x3a0ef3[_0x16e6('0x5e')]['id']},'include':[{'model':db[_0x16e6('0x3f')],'as':_0x16e6('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x20a595,null))['then'](function(_0x3a1e31){if(_0x3a1e31&&_0x3a1e31[_0x16e6('0x40')]){var _0x3cf4b2={'id':_0x3a1e31['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3a1e31[_0x16e6('0x40')][_0x16e6('0x7d')]){_0x3cf4b2[_0x16e6('0x7d')]=_0x3a1e31['Smtp'][_0x16e6('0x7d')];}else{_0x3cf4b2[_0x16e6('0x7b')]=_0x3a1e31[_0x16e6('0x40')]['host'];_0x3cf4b2['port']=_0x3a1e31[_0x16e6('0x40')][_0x16e6('0x7c')];_0x3cf4b2[_0x16e6('0xb5')]=_0x3a1e31['Smtp']['secure'];}if(_0x3a1e31['Smtp'][_0x16e6('0x7a')]){_0x3cf4b2[_0x16e6('0xbf')]={'user':_0x3a1e31[_0x16e6('0x40')][_0x16e6('0x76')],'pass':_0x3a1e31[_0x16e6('0x40')][_0x16e6('0x79')]};}return respondWithRpcPromise(_0x16e6('0xc0'),_0x16e6('0xbe'),{'account':_0x3cf4b2});}})['then'](respondWithResult(_0x20a595,null))[_0x16e6('0x2c')](handleError(_0x20a595,null));};exports[_0x16e6('0x3a')]=function(_0x3b0194,_0x1082e6){return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x3b0194['params']['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x1082e6,null))['then'](function(_0x4f80e2){if(_0x4f80e2&&_0x4f80e2[_0x16e6('0x7d')]){throw new db[(_0x16e6('0xc1'))]['ValidationError'](_0x16e6('0xc2'));}return _0x4f80e2;})[_0x16e6('0x23')](removeEntity(_0x1082e6,null))[_0x16e6('0x2c')](handleError(_0x1082e6,null));};exports[_0x16e6('0xc3')]=function(_0x2f9e06,_0x6eafde,_0x12221a){return db[_0x16e6('0x58')][_0x16e6('0x62')]({'where':{'id':_0x2f9e06[_0x16e6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x6eafde,null))['then'](function(_0x5a7d74){if(_0x5a7d74){return _0x5a7d74[_0x16e6('0xc3')](_0x2f9e06[_0x16e6('0x61')][_0x16e6('0x6c')],_[_0x16e6('0x8d')](_0x2f9e06[_0x16e6('0x61')],[_0x16e6('0x6c'),'id'])||{})[_0x16e6('0xc4')](function(_0xfadb29){for(var _0x1f9258=0x0;_0x1f9258<_0x2f9e06[_0x16e6('0x61')][_0x16e6('0x6c')][_0x16e6('0x4f')];_0x1f9258+=0x1){socket[_0x16e6('0xc5')](_0x16e6('0xc6'),{'UserId':Number(_0x2f9e06[_0x16e6('0x61')][_0x16e6('0x6c')][_0x1f9258]),'MailAccountId':Number(_0x2f9e06[_0x16e6('0x5e')]['id'])});}return _0xfadb29;});}})['then'](respondWithResult(_0x6eafde,null))[_0x16e6('0x2c')](handleError(_0x6eafde,null));};exports[_0x16e6('0xc7')]=function(_0x238ac5,_0x286277,_0x135f44){return db['MailAccount'][_0x16e6('0x62')]({'where':{'id':_0x238ac5['params']['id']}})['then'](handleEntityNotFound(_0x286277,null))[_0x16e6('0x23')](function(_0x2acff0){if(_0x2acff0){return _0x2acff0[_0x16e6('0xc7')](_0x238ac5[_0x16e6('0x49')]['ids'])[_0x16e6('0x23')](function(){if(_['isArray'](_0x238ac5['query'][_0x16e6('0x6c')])){for(var _0x1b2149=0x0;_0x1b2149<_0x238ac5['query'][_0x16e6('0x6c')]['length'];_0x1b2149+=0x1){socket[_0x16e6('0xc5')](_0x16e6('0xc8'),{'UserId':Number(_0x238ac5[_0x16e6('0x49')][_0x16e6('0x6c')][_0x1b2149]),'MailAccountId':Number(_0x238ac5['params']['id'])});}}else{socket[_0x16e6('0xc5')]('userMailAccount:remove',{'UserId':Number(_0x238ac5[_0x16e6('0x49')][_0x16e6('0x6c')]),'MailAccountId':Number(_0x238ac5['params']['id'])});}});}})[_0x16e6('0x23')](respondWithStatusCode(_0x286277,null))['catch'](handleError(_0x286277,null));};exports[_0x16e6('0xc9')]=function(_0xa09a07,_0x5f49a9,_0x36ab2e){var _0x37cf55={};var _0x2d43fe={};var _0x42c7c4;var _0x3c2676;return db[_0x16e6('0x58')]['findOne']({'where':{'id':_0xa09a07['params']['id']}})['then'](handleEntityNotFound(_0x5f49a9,null))[_0x16e6('0x23')](function(_0x3b05e0){if(_0x3b05e0){_0x42c7c4=_0x3b05e0;_0x2d43fe['model']=_['keys'](db[_0x16e6('0x91')][_0x16e6('0x44')]);_0x2d43fe['query']=_[_0x16e6('0x4a')](_0xa09a07[_0x16e6('0x49')]);_0x2d43fe[_0x16e6('0x4b')]=_[_0x16e6('0x4c')](_0x2d43fe['model'],_0x2d43fe[_0x16e6('0x49')]);_0x37cf55[_0x16e6('0x4d')]=_[_0x16e6('0x4c')](_0x2d43fe['model'],qs[_0x16e6('0x4e')](_0xa09a07['query'][_0x16e6('0x4e')]));_0x37cf55[_0x16e6('0x4d')]=_0x37cf55[_0x16e6('0x4d')][_0x16e6('0x4f')]?_0x37cf55[_0x16e6('0x4d')]:_0x2d43fe[_0x16e6('0x48')];_0x37cf55[_0x16e6('0x51')]=qs[_0x16e6('0x52')](_0xa09a07['query'][_0x16e6('0x52')]);_0x37cf55[_0x16e6('0x54')]=qs['filters'](_['pick'](_0xa09a07[_0x16e6('0x49')],_0x2d43fe[_0x16e6('0x4b')]));if(_0xa09a07[_0x16e6('0x49')][_0x16e6('0x53')]){_0x37cf55[_0x16e6('0x54')]=_[_0x16e6('0x55')](_0x37cf55[_0x16e6('0x54')],{'$or':_['map'](_0x37cf55[_0x16e6('0x4d')],function(_0x59d210){var _0x4958e5={};_0x4958e5[_0x59d210]={'$like':'%'+_0xa09a07[_0x16e6('0x49')][_0x16e6('0x53')]+'%'};return _0x4958e5;})});}_0x37cf55=_['merge']({},_0x37cf55,_0xa09a07['options']);return _0x42c7c4[_0x16e6('0xc9')](_0x37cf55);}})[_0x16e6('0x23')](function(_0x482a3f){if(_0x482a3f){_0x3c2676=_0x482a3f[_0x16e6('0x4f')];if(!_0xa09a07[_0x16e6('0x49')]['hasOwnProperty'](_0x16e6('0x6f'))){_0x37cf55[_0x16e6('0x32')]=qs[_0x16e6('0x32')](_0xa09a07['query'][_0x16e6('0x32')]);_0x37cf55['offset']=qs[_0x16e6('0x30')](_0xa09a07[_0x16e6('0x49')][_0x16e6('0x30')]);}return _0x42c7c4[_0x16e6('0xc9')](_0x37cf55);}})[_0x16e6('0x23')](function(_0x139b55){if(_0x139b55){return _0x139b55?{'count':_0x3c2676,'rows':_0x139b55}:null;}})[_0x16e6('0x23')](respondWithResult(_0x5f49a9,null))['catch'](handleError(_0x5f49a9,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 03033e8..1ac50a8 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9147=['remove','emit','hook','events','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x1c2fa9,_0x3f1daf){var _0x52d25f=function(_0x15f277){while(--_0x15f277){_0x1c2fa9['push'](_0x1c2fa9['shift']());}};_0x52d25f(++_0x3f1daf);}(_0x9147,0x81));var _0x7914=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x9147[_0x49ca18];return _0x145d54;};'use strict';var EventEmitter=require(_0x7914('0x0'));var MailAccount=require(_0x7914('0x1'))['db'][_0x7914('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7914('0x3')](0x0);var events={'afterCreate':_0x7914('0x4'),'afterUpdate':_0x7914('0x5'),'afterDestroy':_0x7914('0x6')};function emitEvent(_0x53d9c7){return function(_0x21cae6,_0x1de2bc,_0x1f8716){MailAccountEvents[_0x7914('0x7')](_0x53d9c7+':'+_0x21cae6['id'],_0x21cae6);MailAccountEvents[_0x7914('0x7')](_0x53d9c7,_0x21cae6);_0x1f8716(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x7914('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xce22=['events','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1c2aa7,_0x1f7fb6){var _0x51594c=function(_0xf7869b){while(--_0xf7869b){_0x1c2aa7['push'](_0x1c2aa7['shift']());}};_0x51594c(++_0x1f7fb6);}(_0xce22,0xea));var _0x2ce2=function(_0x19bae5,_0x4e1554){_0x19bae5=_0x19bae5-0x0;var _0x172d36=_0xce22[_0x19bae5];return _0x172d36;};'use strict';var EventEmitter=require(_0x2ce2('0x0'));var MailAccount=require(_0x2ce2('0x1'))['db'][_0x2ce2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2ce2('0x3')](0x0);var events={'afterCreate':_0x2ce2('0x4'),'afterUpdate':'update','afterDestroy':_0x2ce2('0x5')};function emitEvent(_0x5bc506){return function(_0x26b273,_0x1801be,_0x470a06){MailAccountEvents[_0x2ce2('0x6')](_0x5bc506+':'+_0x26b273['id'],_0x26b273);MailAccountEvents[_0x2ce2('0x6')](_0x5bc506,_0x26b273);_0x470a06(null);};}for(var e in events){if(events[_0x2ce2('0x7')](e)){var event=events[e];MailAccount[_0x2ce2('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ce2b59b..408b8ab 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a17=['mail_accounts','lodash','util','api','request-promise','path','exports','define','MailAccount'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x6a17,0xeb));var _0x76a1=function(_0xae40c9,_0x36b4ec){_0xae40c9=_0xae40c9-0x0;var _0x5c638d=_0x6a17[_0xae40c9];return _0x5c638d;};'use strict';var _=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var logger=require('../../config/logger')(_0x76a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x76a1('0x3'));var fs=require('fs');var path=require(_0x76a1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0x76a1('0x5')]=function(_0x3465a2,_0x2089ed){return _0x3465a2[_0x76a1('0x6')](_0x76a1('0x7'),attributes,{'tableName':_0x76a1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c64=['../../config/logger','moment','bluebird','rimraf','./mailAccount.attributes','exports','define','MailAccount','lodash','util'];(function(_0x33c85a,_0x50d04e){var _0x18daa5=function(_0x5276fb){while(--_0x5276fb){_0x33c85a['push'](_0x33c85a['shift']());}};_0x18daa5(++_0x50d04e);}(_0x5c64,0xe4));var _0x45c6=function(_0x1d0e52,_0x2c4e2c){_0x1d0e52=_0x1d0e52-0x0;var _0x2e87f4=_0x5c64[_0x1d0e52];return _0x2e87f4;};'use strict';var _=require(_0x45c6('0x0'));var util=require(_0x45c6('0x1'));var logger=require(_0x45c6('0x2'))('api');var moment=require(_0x45c6('0x3'));var BPromise=require(_0x45c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x45c6('0x5'));var config=require('../../config/environment');var attributes=require(_0x45c6('0x6'));module[_0x45c6('0x7')]=function(_0x3767c9,_0x4ea6f2){return _0x3767c9[_0x45c6('0x8')](_0x45c6('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index d6c46fb..1500555 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf709=['MailApplication','MailServerOut','account','omit','Applications','applications','list','orderBy','priority','autoclose','close','*,*,*,*','length','contact','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','create','Contact\x20not\x20found','spread','interaction','created','MailMessage','subject','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','options','raw','attributes','limit','map','model','include','debug','ShowMailAccount','MailAccount','where','NotifyMailAccount','body','mail','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','List','Contacts','DESC'];(function(_0x332dca,_0x4a0737){var _0x30deb0=function(_0x43953c){while(--_0x43953c){_0x332dca['push'](_0x332dca['shift']());}};_0x30deb0(++_0x4a0737);}(_0xf709,0x100));var _0x9f70=function(_0x29adfd,_0x5ee335){_0x29adfd=_0x29adfd-0x0;var _0x125c1f=_0xf709[_0x29adfd];return _0x125c1f;};'use strict';var _=require(_0x9f70('0x0'));var util=require(_0x9f70('0x1'));var moment=require(_0x9f70('0x2'));var BPromise=require(_0x9f70('0x3'));var rs=require(_0x9f70('0x4'));var fs=require('fs');var Redis=require(_0x9f70('0x5'));var db=require(_0x9f70('0x6'))['db'];var utils=require(_0x9f70('0x7'));var logger=require(_0x9f70('0x8'))(_0x9f70('0x9'));var config=require(_0x9f70('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9f70('0xb')]['http']({'port':0x232c});config[_0x9f70('0xc')]=_[_0x9f70('0xd')](config['redis'],{'host':_0x9f70('0xe'),'port':0x18eb});var socket=require(_0x9f70('0xf'))(new Redis(config[_0x9f70('0xc')]));require(_0x9f70('0x10'))[_0x9f70('0x11')](socket);function respondWithRpcPromise(_0x5ad5df,_0x323962,_0x34fa20){return new BPromise(function(_0x26ac81,_0x329554){return client['request'](_0x5ad5df,_0x34fa20)[_0x9f70('0x12')](function(_0x414237){logger[_0x9f70('0x13')](_0x9f70('0x14'),_0x323962,_0x9f70('0x15'));logger['debug'](_0x9f70('0x16'),_0x323962,_0x9f70('0x15'),JSON[_0x9f70('0x17')](_0x414237));if(_0x414237[_0x9f70('0x18')]){if(_0x414237[_0x9f70('0x18')][_0x9f70('0x19')]===0x1f4){logger[_0x9f70('0x18')](_0x9f70('0x14'),_0x323962,_0x414237[_0x9f70('0x18')][_0x9f70('0x1a')]);return _0x329554(_0x414237[_0x9f70('0x18')][_0x9f70('0x1a')]);}logger['error'](_0x9f70('0x14'),_0x323962,_0x414237[_0x9f70('0x18')][_0x9f70('0x1a')]);return _0x26ac81(_0x414237['error']['message']);}else{logger[_0x9f70('0x13')](_0x9f70('0x14'),_0x323962,_0x9f70('0x15'));_0x26ac81(_0x414237[_0x9f70('0x1b')][_0x9f70('0x1a')]);}})[_0x9f70('0x1c')](function(_0x5b8726){logger[_0x9f70('0x18')]('MailAccount,\x20%s,\x20%s',_0x323962,_0x5b8726);_0x329554(_0x5b8726);});});}exports[_0x9f70('0x1d')]=function(_0x1c311e){var _0x131e47=this;return new Promise(function(_0x5f1e29,_0x21c4d6){return db['MailAccount']['findAll']({'raw':_0x1c311e[_0x9f70('0x1e')]?_0x1c311e[_0x9f70('0x1e')][_0x9f70('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c311e[_0x9f70('0x1e')]?_0x1c311e['options']['where']||null:null,'attributes':_0x1c311e[_0x9f70('0x1e')]?_0x1c311e[_0x9f70('0x1e')][_0x9f70('0x20')]||null:null,'limit':_0x1c311e['options']?_0x1c311e[_0x9f70('0x1e')][_0x9f70('0x21')]||null:null,'include':_0x1c311e['options']?_0x1c311e['options']['include']?_[_0x9f70('0x22')](_0x1c311e[_0x9f70('0x1e')]['include'],function(_0x1876d0){return{'model':db[_0x1876d0[_0x9f70('0x23')]],'as':_0x1876d0['as'],'attributes':_0x1876d0[_0x9f70('0x20')],'include':_0x1876d0[_0x9f70('0x24')]?_[_0x9f70('0x22')](_0x1876d0['include'],function(_0x530300){return{'model':db[_0x530300[_0x9f70('0x23')]],'as':_0x530300['as'],'attributes':_0x530300[_0x9f70('0x20')],'include':_0x530300[_0x9f70('0x24')]?_[_0x9f70('0x22')](_0x530300[_0x9f70('0x24')],function(_0x40b886){return{'model':db[_0x40b886['model']],'as':_0x40b886['as'],'attributes':_0x40b886['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53bd82){logger[_0x9f70('0x13')](_0x9f70('0x1d'),_0x1c311e);logger[_0x9f70('0x25')](_0x9f70('0x1d'),_0x1c311e,JSON[_0x9f70('0x17')](_0x53bd82));_0x5f1e29(_0x53bd82);})['catch'](function(_0x3bf2da){logger[_0x9f70('0x18')]('GetMailAccount',_0x3bf2da[_0x9f70('0x1a')],_0x1c311e);_0x21c4d6(_0x131e47[_0x9f70('0x18')](0x1f4,_0x3bf2da[_0x9f70('0x1a')]));});});};exports[_0x9f70('0x26')]=function(_0x1932e7){var _0x53b3f3=this;return new Promise(function(_0x38218d,_0x2c598d){return db[_0x9f70('0x27')]['find']({'raw':_0x1932e7[_0x9f70('0x1e')]?_0x1932e7['options'][_0x9f70('0x1f')]===undefined?!![]:![]:!![],'where':_0x1932e7[_0x9f70('0x1e')]?_0x1932e7[_0x9f70('0x1e')][_0x9f70('0x28')]||null:null,'attributes':_0x1932e7[_0x9f70('0x1e')]?_0x1932e7['options']['attributes']||null:null,'include':_0x1932e7[_0x9f70('0x1e')]?_0x1932e7[_0x9f70('0x1e')][_0x9f70('0x24')]?_[_0x9f70('0x22')](_0x1932e7[_0x9f70('0x1e')][_0x9f70('0x24')],function(_0x2b741b){return{'model':db[_0x2b741b[_0x9f70('0x23')]],'as':_0x2b741b['as'],'attributes':_0x2b741b['attributes'],'include':_0x2b741b[_0x9f70('0x24')]?_[_0x9f70('0x22')](_0x2b741b[_0x9f70('0x24')],function(_0x43e9db){return{'model':db[_0x43e9db['model']],'as':_0x43e9db['as'],'attributes':_0x43e9db[_0x9f70('0x20')],'include':_0x43e9db[_0x9f70('0x24')]?_[_0x9f70('0x22')](_0x43e9db[_0x9f70('0x24')],function(_0x5c3aa6){return{'model':db[_0x5c3aa6['model']],'as':_0x5c3aa6['as'],'attributes':_0x5c3aa6[_0x9f70('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x83ae1f){logger['info'](_0x9f70('0x26'),_0x1932e7);logger['debug']('ShowMailAccount',_0x1932e7,JSON[_0x9f70('0x17')](_0x83ae1f));_0x38218d(_0x83ae1f);})[_0x9f70('0x1c')](function(_0x3c6857){logger[_0x9f70('0x18')]('ShowMailAccount',_0x3c6857[_0x9f70('0x1a')],_0x1932e7);_0x2c598d(_0x53b3f3['error'](0x1f4,_0x3c6857[_0x9f70('0x1a')]));});});};exports[_0x9f70('0x29')]=function(_0x3e3ce6){var _0x67301d=this;return new Promise(function(_0x4ea001,_0x38832f){var _0xf39c6e={'body':_0x3e3ce6[_0x9f70('0x2a')],'channel':_0x9f70('0x2b')};var _0xcdb6c3=_['difference'](_['keys'](db[_0x9f70('0x2c')][_0x9f70('0x2d')]),['createdAt',_0x9f70('0x2e'),_0x9f70('0x2f'),_0x9f70('0x30')]);var _0x2d6b8e=![];if(_0x3e3ce6[_0x9f70('0x2a')]['id']){delete _0x3e3ce6['body']['id'];}if(_[_0x9f70('0x31')](_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x32')])){return _0x38832f(_0x67301d[_0x9f70('0x18')](0x1f4,_0x9f70('0x33')));}if(_['isNil'](_0x3e3ce6['body'][_0x9f70('0x2a')])||_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x2a')]===''){return _0x38832f(_0x67301d[_0x9f70('0x18')](0x1f4,_0x9f70('0x34')));}if(_[_0x9f70('0x31')](_0x3e3ce6['body']['mapKey'])){return _0x38832f(_0x67301d['error'](0x1f4,_0x9f70('0x35')+_0xcdb6c3));}if(!_['includes'](_0xcdb6c3,_0x3e3ce6['body'][_0x9f70('0x36')])){return _0x38832f(_0x67301d[_0x9f70('0x18')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xcdb6c3));}var _0x41bf9a={};_0x41bf9a[_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x36')]]=_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x32')];return db[_0x9f70('0x27')][_0x9f70('0x37')]({'where':{'id':_0x3e3ce6['account']['id']},'include':[{'model':db['CmList'],'as':_0x9f70('0x38'),'include':[{'model':db[_0x9f70('0x2c')],'as':_0x9f70('0x39'),'where':_0x41bf9a,'limit':0x1,'order':[[_0x9f70('0x2e'),_0x9f70('0x3a')]]}]},{'model':db[_0x9f70('0x3b')],'as':'Applications'},{'model':db[_0x9f70('0x3c')],'as':'Smtp'}]})[_0x9f70('0x12')](function(_0x2efd3c){if(_0x2efd3c&&_0x2efd3c[_0x9f70('0x38')]){var _0x35aba3=_0x2efd3c['get']({'plain':!![]});_0xf39c6e[_0x9f70('0x3d')]=_[_0x9f70('0x3e')](_0x35aba3,[_0x9f70('0x3f'),_0x9f70('0x38')]);_0xf39c6e[_0x9f70('0x40')]=_0x35aba3[_0x9f70('0x3f')];_0xf39c6e[_0x9f70('0x41')]=_0x35aba3[_0x9f70('0x38')];_0xf39c6e[_0x9f70('0x40')]=_[_0x9f70('0x42')](_0xf39c6e[_0x9f70('0x40')],[_0x9f70('0x43')],['asc']);if(_0xf39c6e[_0x9f70('0x3d')]&&_0xf39c6e['account'][_0x9f70('0x44')]){_0xf39c6e[_0x9f70('0x40')]['push']({'id':0x0,'priority':_0xf39c6e[_0x9f70('0x40')]['length']+0x1,'app':_0x9f70('0x45'),'appdata':_0x9f70('0x44'),'interval':_0x9f70('0x46')});}if(_0xf39c6e[_0x9f70('0x3d')]['Applications']){delete _0xf39c6e[_0x9f70('0x3d')]['Applications'];}if(_0xf39c6e[_0x9f70('0x3d')][_0x9f70('0x38')]){delete _0xf39c6e[_0x9f70('0x3d')]['List'];}if(_0x35aba3[_0x9f70('0x38')][_0x9f70('0x39')][_0x9f70('0x47')]){return _0x35aba3['List'][_0x9f70('0x39')][0x0];}var _0x503f8a=_[_0x9f70('0xd')](_0x3e3ce6[_0x9f70('0x2a')],{'firstName':_0x3e3ce6['body']['from'],'ListId':_0x35aba3[_0x9f70('0x30')]});_0x503f8a[_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x36')]]=_0x3e3ce6[_0x9f70('0x2a')]['from'];return db[_0x9f70('0x2c')]['create'](_0x503f8a);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x2144ce){_0xf39c6e[_0x9f70('0x48')]=_0x2144ce;if(_0x2144ce){if(!_0x3e3ce6['body'][_0x9f70('0x1a')][_0x9f70('0x49')]){_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')]['messageId']=rs['generate']()+'\x20'+_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x32')];}var _0x16b96c={'ContactId':_0x2144ce['id'],'MailAccountId':_0x3e3ce6[_0x9f70('0x3d')]['id'],'inReplyTo':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x49')],'to':_0x3e3ce6['body'][_0x9f70('0x1a')][_0x9f70('0x32')],'cc':_0x3e3ce6[_0x9f70('0x2a')]['message']['cc'],'subject':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')]['subject'],'attach':_0x3e3ce6['body']['message'][_0x9f70('0x4a')],'lastMsgAt':moment()[_0x9f70('0x4b')](_0x9f70('0x4c')),'lastMsgDirection':'in'};return db[_0x9f70('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x3e3ce6[_0x9f70('0x3d')]['id']},'include':[{'model':db['MailMessage'],'as':_0x9f70('0x4e'),'attributes':[_0x9f70('0x49')],'where':{'messageId':_0x3e3ce6[_0x9f70('0x2a')]['message'][_0x9f70('0x4f')]}}]})['then'](function(_0x1e95f0){if(_0x1e95f0){return[_0x1e95f0,![]];}return db[_0x9f70('0x4d')][_0x9f70('0x50')](_0x16b96c)[_0x9f70('0x12')](function(_0x1815b5){return[_0x1815b5,!![]];});});}else{throw new Error(_0x9f70('0x51'));}})[_0x9f70('0x52')](function(_0x2a3708,_0x73186){if(_0x2a3708){_0x2d6b8e=_0x73186;if(!_0x73186){return _0x2a3708['update']({'inReplyTo':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x49')],'to':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x32')],'cc':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')]['cc'],'subject':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')]['subject'],'attach':_0x2a3708['attach']?_0x2a3708[_0x9f70('0x4a')]:_0x3e3ce6['body']['message'][_0x9f70('0x4a')],'substatus':null,'substatusAt':moment()[_0x9f70('0x4b')](_0x9f70('0x4c')),'lastMsgAt':moment()[_0x9f70('0x4b')](_0x9f70('0x4c')),'lastMsgDirection':'in'});}else{return _0x2a3708;}}})[_0x9f70('0x12')](function(_0x30f2f6){_0xf39c6e['interaction']=_0x30f2f6['get']({'plain':!![]});_0xf39c6e[_0x9f70('0x53')][_0x9f70('0x54')]=_0x2d6b8e;return db[_0x9f70('0x55')]['create']({'body':_0x3e3ce6[_0x9f70('0x2a')]['body'],'MailAccountId':_0x3e3ce6[_0x9f70('0x3d')]['id'],'MailInteractionId':_0x30f2f6['id'],'direction':'in','ContactId':_0xf39c6e[_0x9f70('0x48')]['id'],'messageId':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x49')],'from':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x32')],'to':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')]['to'],'cc':_0x3e3ce6[_0x9f70('0x2a')]['message']['cc'],'subject':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x56')],'attach':_0x3e3ce6['body'][_0x9f70('0x1a')]['attach'],'Attachments':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x57')],'originTo':_0x3e3ce6[_0x9f70('0x2a')][_0x9f70('0x1a')][_0x9f70('0x58')],'originCc':_0x3e3ce6['body'][_0x9f70('0x1a')][_0x9f70('0x59')],'bcc':_0x3e3ce6['body'][_0x9f70('0x1a')][_0x9f70('0x5a')],'ChatWebsiteId':_0x3e3ce6[_0x9f70('0x2a')]['message'][_0x9f70('0x5b')]||null,'originChannel':_0x3e3ce6[_0x9f70('0x2a')]['message'][_0x9f70('0x5c')]||_0x9f70('0x5d'),'ChatOfflineMessageId':_0x3e3ce6['body'][_0x9f70('0x1a')][_0x9f70('0x5e')]||null},{'include':[{'model':db[_0x9f70('0x5f')],'as':_0x9f70('0x60')}]});})[_0x9f70('0x12')](function(_0x3a2cf3){_0xf39c6e[_0x9f70('0x1a')]=_0x3a2cf3;if(_0xf39c6e[_0x9f70('0x53')][_0x9f70('0x61')]){return db[_0x9f70('0x62')][_0x9f70('0x37')]({'attributes':['id','name'],'where':{'id':_0xf39c6e[_0x9f70('0x53')][_0x9f70('0x61')]}})[_0x9f70('0x12')](function(_0x598af9){if(_0x598af9){_0xf39c6e[_0x9f70('0x40')][_0x9f70('0x63')]({'id':0x0,'priority':0x0,'app':_0x9f70('0x64'),'appdata':_0x598af9[_0x9f70('0x65')]+','+(_0xf39c6e['account'][_0x9f70('0x66')]||0xa),'interval':_0x9f70('0x46')});}return respondWithRpcPromise(_0x9f70('0x67'),_0x9f70('0x68'),_0xf39c6e);});}return respondWithRpcPromise(_0x9f70('0x67'),_0x9f70('0x68'),_0xf39c6e);})['then'](function(_0x5bf439){_0x4ea001(_0x5bf439);})[_0x9f70('0x1c')](function(_0xab863f){_0x38832f(_0x67301d[_0x9f70('0x18')](0x1f4,_0xab863f['message']));});});}; \ No newline at end of file +var _0xd260=['Messages','inReplyTo','Contact\x20not\x20found','spread','update','get','created','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','interaction','UserId','User','name','agent','startRouting','Start','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','include','map','model','ShowMailAccount','find','raw','then','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','updatedAt','DESC','Applications','MailServerOut','Smtp','List','list','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','Contacts','create','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage'];(function(_0x38616d,_0x22fbe5){var _0x505626=function(_0x5b3a5a){while(--_0x5b3a5a){_0x38616d['push'](_0x38616d['shift']());}};_0x505626(++_0x22fbe5);}(_0xd260,0x1af));var _0x0d26=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xd260[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x0d26('0x0'));var util=require(_0x0d26('0x1'));var moment=require(_0x0d26('0x2'));var BPromise=require(_0x0d26('0x3'));var rs=require(_0x0d26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d26('0x5'))['db'];var utils=require(_0x0d26('0x6'));var logger=require(_0x0d26('0x7'))(_0x0d26('0x8'));var config=require(_0x0d26('0x9'));var jayson=require(_0x0d26('0xa'));var client=jayson[_0x0d26('0xb')][_0x0d26('0xc')]({'port':0x232c});config[_0x0d26('0xd')]=_[_0x0d26('0xe')](config[_0x0d26('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d26('0xf'))(new Redis(config['redis']));require(_0x0d26('0x10'))[_0x0d26('0x11')](socket);function respondWithRpcPromise(_0x204012,_0x3e2abb,_0x278b0f){return new BPromise(function(_0x33ace1,_0x29440f){return client['request'](_0x204012,_0x278b0f)['then'](function(_0x527dcb){logger['info'](_0x0d26('0x12'),_0x3e2abb,_0x0d26('0x13'));logger[_0x0d26('0x14')](_0x0d26('0x15'),_0x3e2abb,_0x0d26('0x13'),JSON[_0x0d26('0x16')](_0x527dcb));if(_0x527dcb[_0x0d26('0x17')]){if(_0x527dcb[_0x0d26('0x17')][_0x0d26('0x18')]===0x1f4){logger['error'](_0x0d26('0x12'),_0x3e2abb,_0x527dcb['error'][_0x0d26('0x19')]);return _0x29440f(_0x527dcb[_0x0d26('0x17')]['message']);}logger[_0x0d26('0x17')](_0x0d26('0x12'),_0x3e2abb,_0x527dcb[_0x0d26('0x17')][_0x0d26('0x19')]);return _0x33ace1(_0x527dcb[_0x0d26('0x17')][_0x0d26('0x19')]);}else{logger[_0x0d26('0x1a')]('MailAccount,\x20%s,\x20%s',_0x3e2abb,'request\x20sent');_0x33ace1(_0x527dcb[_0x0d26('0x1b')]['message']);}})[_0x0d26('0x1c')](function(_0x33eaf2){logger[_0x0d26('0x17')]('MailAccount,\x20%s,\x20%s',_0x3e2abb,_0x33eaf2);_0x29440f(_0x33eaf2);});});}exports[_0x0d26('0x1d')]=function(_0x38f6b9){var _0x2ec128=this;return new Promise(function(_0x5acd58,_0x5694b5){return db[_0x0d26('0x1e')][_0x0d26('0x1f')]({'raw':_0x38f6b9[_0x0d26('0x20')]?_0x38f6b9[_0x0d26('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x38f6b9['options']?_0x38f6b9['options'][_0x0d26('0x21')]||null:null,'attributes':_0x38f6b9[_0x0d26('0x20')]?_0x38f6b9[_0x0d26('0x20')][_0x0d26('0x22')]||null:null,'limit':_0x38f6b9[_0x0d26('0x20')]?_0x38f6b9[_0x0d26('0x20')]['limit']||null:null,'include':_0x38f6b9[_0x0d26('0x20')]?_0x38f6b9[_0x0d26('0x20')][_0x0d26('0x23')]?_[_0x0d26('0x24')](_0x38f6b9[_0x0d26('0x20')]['include'],function(_0x50af33){return{'model':db[_0x50af33[_0x0d26('0x25')]],'as':_0x50af33['as'],'attributes':_0x50af33[_0x0d26('0x22')],'include':_0x50af33[_0x0d26('0x23')]?_[_0x0d26('0x24')](_0x50af33[_0x0d26('0x23')],function(_0x2da89e){return{'model':db[_0x2da89e[_0x0d26('0x25')]],'as':_0x2da89e['as'],'attributes':_0x2da89e[_0x0d26('0x22')],'include':_0x2da89e[_0x0d26('0x23')]?_[_0x0d26('0x24')](_0x2da89e[_0x0d26('0x23')],function(_0x3f3d57){return{'model':db[_0x3f3d57[_0x0d26('0x25')]],'as':_0x3f3d57['as'],'attributes':_0x3f3d57[_0x0d26('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f3232){logger[_0x0d26('0x1a')](_0x0d26('0x1d'),_0x38f6b9);logger[_0x0d26('0x14')](_0x0d26('0x1d'),_0x38f6b9,JSON[_0x0d26('0x16')](_0x5f3232));_0x5acd58(_0x5f3232);})[_0x0d26('0x1c')](function(_0x580548){logger[_0x0d26('0x17')](_0x0d26('0x1d'),_0x580548[_0x0d26('0x19')],_0x38f6b9);_0x5694b5(_0x2ec128[_0x0d26('0x17')](0x1f4,_0x580548[_0x0d26('0x19')]));});});};exports[_0x0d26('0x26')]=function(_0x2072c1){var _0x44ddf4=this;return new Promise(function(_0x2bd9e1,_0xfb9ba6){return db['MailAccount'][_0x0d26('0x27')]({'raw':_0x2072c1[_0x0d26('0x20')]?_0x2072c1['options'][_0x0d26('0x28')]===undefined?!![]:![]:!![],'where':_0x2072c1[_0x0d26('0x20')]?_0x2072c1[_0x0d26('0x20')][_0x0d26('0x21')]||null:null,'attributes':_0x2072c1[_0x0d26('0x20')]?_0x2072c1['options'][_0x0d26('0x22')]||null:null,'include':_0x2072c1[_0x0d26('0x20')]?_0x2072c1[_0x0d26('0x20')][_0x0d26('0x23')]?_[_0x0d26('0x24')](_0x2072c1[_0x0d26('0x20')][_0x0d26('0x23')],function(_0x2e5228){return{'model':db[_0x2e5228[_0x0d26('0x25')]],'as':_0x2e5228['as'],'attributes':_0x2e5228['attributes'],'include':_0x2e5228[_0x0d26('0x23')]?_[_0x0d26('0x24')](_0x2e5228[_0x0d26('0x23')],function(_0x361720){return{'model':db[_0x361720['model']],'as':_0x361720['as'],'attributes':_0x361720['attributes'],'include':_0x361720['include']?_[_0x0d26('0x24')](_0x361720[_0x0d26('0x23')],function(_0x6ef3a5){return{'model':db[_0x6ef3a5[_0x0d26('0x25')]],'as':_0x6ef3a5['as'],'attributes':_0x6ef3a5[_0x0d26('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0d26('0x29')](function(_0x2c5909){logger[_0x0d26('0x1a')](_0x0d26('0x26'),_0x2072c1);logger[_0x0d26('0x14')](_0x0d26('0x26'),_0x2072c1,JSON['stringify'](_0x2c5909));_0x2bd9e1(_0x2c5909);})[_0x0d26('0x1c')](function(_0x27f417){logger['error'](_0x0d26('0x26'),_0x27f417[_0x0d26('0x19')],_0x2072c1);_0xfb9ba6(_0x44ddf4[_0x0d26('0x17')](0x1f4,_0x27f417[_0x0d26('0x19')]));});});};exports[_0x0d26('0x2a')]=function(_0x3d2988){var _0x3b871c=this;return new Promise(function(_0x7e36ad,_0x14bc9b){var _0xe3b7e5={'body':_0x3d2988[_0x0d26('0x2b')],'channel':_0x0d26('0x2c')};var _0x3e772c=_[_0x0d26('0x2d')](_[_0x0d26('0x2e')](db[_0x0d26('0x2f')][_0x0d26('0x30')]),[_0x0d26('0x31'),'updatedAt',_0x0d26('0x32'),_0x0d26('0x33')]);var _0x49025c=![];if(_0x3d2988['body']['id']){delete _0x3d2988[_0x0d26('0x2b')]['id'];}if(_[_0x0d26('0x34')](_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x35')])){return _0x14bc9b(_0x3b871c[_0x0d26('0x17')](0x1f4,_0x0d26('0x36')));}if(_[_0x0d26('0x34')](_0x3d2988[_0x0d26('0x2b')]['body'])||_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x2b')]===''){return _0x14bc9b(_0x3b871c[_0x0d26('0x17')](0x1f4,_0x0d26('0x37')));}if(_[_0x0d26('0x34')](_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x38')])){return _0x14bc9b(_0x3b871c[_0x0d26('0x17')](0x1f4,_0x0d26('0x39')+_0x3e772c));}if(!_['includes'](_0x3e772c,_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x38')])){return _0x14bc9b(_0x3b871c[_0x0d26('0x17')](0x1f4,_0x0d26('0x3a')+_0x3e772c));}var _0x414f1f={};_0x414f1f[_0x3d2988[_0x0d26('0x2b')]['mapKey']]=_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x35')];return db['MailAccount'][_0x0d26('0x27')]({'where':{'id':_0x3d2988[_0x0d26('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0d26('0x2f')],'as':'Contacts','where':_0x414f1f,'limit':0x1,'order':[[_0x0d26('0x3c'),_0x0d26('0x3d')]]}]},{'model':db['MailApplication'],'as':_0x0d26('0x3e')},{'model':db[_0x0d26('0x3f')],'as':_0x0d26('0x40')}]})['then'](function(_0x4c250a){if(_0x4c250a&&_0x4c250a[_0x0d26('0x41')]){var _0x27ed02=_0x4c250a['get']({'plain':!![]});_0xe3b7e5[_0x0d26('0x3b')]=_['omit'](_0x27ed02,[_0x0d26('0x3e'),_0x0d26('0x41')]);_0xe3b7e5['applications']=_0x27ed02[_0x0d26('0x3e')];_0xe3b7e5[_0x0d26('0x42')]=_0x27ed02[_0x0d26('0x41')];_0xe3b7e5[_0x0d26('0x43')]=_[_0x0d26('0x44')](_0xe3b7e5[_0x0d26('0x43')],[_0x0d26('0x45')],['asc']);if(_0xe3b7e5[_0x0d26('0x3b')]&&_0xe3b7e5[_0x0d26('0x3b')]['autoclose']){_0xe3b7e5['applications'][_0x0d26('0x46')]({'id':0x0,'priority':_0xe3b7e5[_0x0d26('0x43')][_0x0d26('0x47')]+0x1,'app':_0x0d26('0x48'),'appdata':_0x0d26('0x49'),'interval':_0x0d26('0x4a')});}if(_0xe3b7e5['account'][_0x0d26('0x3e')]){delete _0xe3b7e5['account'][_0x0d26('0x3e')];}if(_0xe3b7e5[_0x0d26('0x3b')][_0x0d26('0x41')]){delete _0xe3b7e5[_0x0d26('0x3b')][_0x0d26('0x41')];}if(_0x27ed02[_0x0d26('0x41')][_0x0d26('0x4b')][_0x0d26('0x47')]){return _0x27ed02['List'][_0x0d26('0x4b')][0x0];}var _0x5dc50d=_['defaults'](_0x3d2988['body'],{'firstName':_0x3d2988[_0x0d26('0x2b')]['from'],'ListId':_0x27ed02[_0x0d26('0x33')]});_0x5dc50d[_0x3d2988['body']['mapKey']]=_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x35')];return db[_0x0d26('0x2f')][_0x0d26('0x4c')](_0x5dc50d);}else{throw new Error('List\x20not\x20found');}})[_0x0d26('0x29')](function(_0x10fc64){_0xe3b7e5['contact']=_0x10fc64;if(_0x10fc64){if(!_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x4d')]){_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x4d')]=rs[_0x0d26('0x4e')]()+'\x20'+_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x35')];}var _0x440a5f={'ContactId':_0x10fc64['id'],'MailAccountId':_0x3d2988[_0x0d26('0x3b')]['id'],'inReplyTo':_0x3d2988['body'][_0x0d26('0x19')][_0x0d26('0x4d')],'to':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')]['from'],'cc':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')]['cc'],'subject':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x4f')],'attach':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x50')],'lastMsgAt':moment()[_0x0d26('0x51')](_0x0d26('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x0d26('0x27')]({'where':{'closed':![],'MailAccountId':_0x3d2988[_0x0d26('0x3b')]['id']},'include':[{'model':db[_0x0d26('0x53')],'as':_0x0d26('0x54'),'attributes':[_0x0d26('0x4d')],'where':{'messageId':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x55')]}}]})['then'](function(_0x4ac944){if(_0x4ac944){return[_0x4ac944,![]];}return db['MailInteraction']['create'](_0x440a5f)[_0x0d26('0x29')](function(_0x454737){return[_0x454737,!![]];});});}else{throw new Error(_0x0d26('0x56'));}})[_0x0d26('0x57')](function(_0x10e205,_0x46d4a6){if(_0x10e205){_0x49025c=_0x46d4a6;if(!_0x46d4a6){return _0x10e205[_0x0d26('0x58')]({'inReplyTo':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x4d')],'to':_0x3d2988[_0x0d26('0x2b')]['message']['from'],'cc':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')]['cc'],'subject':_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x4f')],'attach':_0x10e205[_0x0d26('0x50')]?_0x10e205[_0x0d26('0x50')]:_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x50')],'substatus':null,'substatusAt':moment()[_0x0d26('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0d26('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x10e205;}}})[_0x0d26('0x29')](function(_0x10e7a5){_0xe3b7e5['interaction']=_0x10e7a5[_0x0d26('0x59')]({'plain':!![]});_0xe3b7e5['interaction'][_0x0d26('0x5a')]=_0x49025c;return db[_0x0d26('0x53')][_0x0d26('0x4c')]({'body':_0x3d2988['body'][_0x0d26('0x2b')],'MailAccountId':_0x3d2988[_0x0d26('0x3b')]['id'],'MailInteractionId':_0x10e7a5['id'],'direction':'in','ContactId':_0xe3b7e5['contact']['id'],'messageId':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x4d')],'from':_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x35')],'to':_0x3d2988['body'][_0x0d26('0x19')]['to'],'cc':_0x3d2988['body'][_0x0d26('0x19')]['cc'],'subject':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')]['subject'],'attach':_0x3d2988['body'][_0x0d26('0x19')][_0x0d26('0x50')],'Attachments':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')]['attachments'],'originTo':_0x3d2988['body'][_0x0d26('0x19')]['originTo'],'originCc':_0x3d2988['body'][_0x0d26('0x19')]['originCc'],'bcc':_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x5b')],'ChatWebsiteId':_0x3d2988[_0x0d26('0x2b')][_0x0d26('0x19')][_0x0d26('0x5c')]||null,'originChannel':_0x3d2988['body'][_0x0d26('0x19')]['originChannel']||_0x0d26('0x5d'),'ChatOfflineMessageId':_0x3d2988[_0x0d26('0x2b')]['message'][_0x0d26('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x0d26('0x5f')}]});})[_0x0d26('0x29')](function(_0x4ea0a7){_0xe3b7e5['message']=_0x4ea0a7;if(_0xe3b7e5[_0x0d26('0x60')][_0x0d26('0x61')]){return db[_0x0d26('0x62')]['find']({'attributes':['id',_0x0d26('0x63')],'where':{'id':_0xe3b7e5[_0x0d26('0x60')][_0x0d26('0x61')]}})[_0x0d26('0x29')](function(_0x519cfc){if(_0x519cfc){_0xe3b7e5['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x0d26('0x64'),'appdata':_0x519cfc[_0x0d26('0x63')]+','+(_0xe3b7e5['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0d26('0x4a')});}return respondWithRpcPromise('Start',_0x0d26('0x65'),_0xe3b7e5);});}return respondWithRpcPromise(_0x0d26('0x66'),'startRouting',_0xe3b7e5);})['then'](function(_0x27c98c){_0x7e36ad(_0x27c98c);})[_0x0d26('0x1c')](function(_0x556fa0){_0x14bc9b(_0x3b871c[_0x0d26('0x17')](0x1f4,_0x556fa0[_0x0d26('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index da8e5d2..3974672 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1957=['update','emit','register','length','./mailAccount.events','save','remove'];(function(_0x85ae15,_0x46909b){var _0x11c8db=function(_0x24329f){while(--_0x24329f){_0x85ae15['push'](_0x85ae15['shift']());}};_0x11c8db(++_0x46909b);}(_0x1957,0xeb));var _0x7195=function(_0x23347e,_0x350e6c){_0x23347e=_0x23347e-0x0;var _0x24efed=_0x1957[_0x23347e];return _0x24efed;};'use strict';var MailAccountEvents=require(_0x7195('0x0'));var events=[_0x7195('0x1'),_0x7195('0x2'),_0x7195('0x3')];function createListener(_0x12d9f8,_0x1d77ca){return function(_0x4d6994){_0x1d77ca[_0x7195('0x4')](_0x12d9f8,_0x4d6994);};}function removeListener(_0x1f97ca,_0x16b977){return function(){MailAccountEvents['removeListener'](_0x1f97ca,_0x16b977);};}exports[_0x7195('0x5')]=function(_0x4b64af){for(var _0x1105ce=0x0,_0x5a6d2b=events[_0x7195('0x6')];_0x1105ce<_0x5a6d2b;_0x1105ce++){var _0x49684d=events[_0x1105ce];var _0x10afd9=createListener('mailAccount:'+_0x49684d,_0x4b64af);MailAccountEvents['on'](_0x49684d,_0x10afd9);}}; \ No newline at end of file +var _0xdbed=['save','remove','update','register','length','mailAccount:','./mailAccount.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xdbed,0xca));var _0xddbe=function(_0x50d205,_0x5afdfa){_0x50d205=_0x50d205-0x0;var _0x31e9e2=_0xdbed[_0x50d205];return _0x31e9e2;};'use strict';var MailAccountEvents=require(_0xddbe('0x0'));var events=[_0xddbe('0x1'),_0xddbe('0x2'),_0xddbe('0x3')];function createListener(_0x4f7e45,_0xb3a2e1){return function(_0x4fb3c4){_0xb3a2e1['emit'](_0x4f7e45,_0x4fb3c4);};}function removeListener(_0x5e6502,_0x4c012e){return function(){MailAccountEvents['removeListener'](_0x5e6502,_0x4c012e);};}exports[_0xddbe('0x4')]=function(_0x1f0254){for(var _0x23bfb2=0x0,_0x17addb=events[_0xddbe('0x5')];_0x23bfb2<_0x17addb;_0x23bfb2++){var _0x3d7866=events[_0x23bfb2];var _0x5770ae=createListener(_0xddbe('0x6')+_0x3d7866,_0x1f0254);MailAccountEvents['on'](_0x3d7866,_0x5770ae);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b690c7c..a1e5914 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85b4=['express','Router','../../components/interaction/service','../../config/environment','/:id','show','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xf93076,_0x1acb30){var _0x33d1da=function(_0x29e6bf){while(--_0x29e6bf){_0xf93076['push'](_0xf93076['shift']());}};_0x33d1da(++_0x1acb30);}(_0x85b4,0x146));var _0x485b=function(_0x1a4c27,_0x5a4b45){_0x1a4c27=_0x1a4c27-0x0;var _0x578d9=_0x85b4[_0x1a4c27];return _0x578d9;};'use strict';var multer=require(_0x485b('0x0'));var util=require(_0x485b('0x1'));var path=require(_0x485b('0x2'));var timeout=require(_0x485b('0x3'));var express=require(_0x485b('0x4'));var router=express[_0x485b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x485b('0x6'));var config=require(_0x485b('0x7'));var controller=require('./mailApplication.controller');router['get'](_0x485b('0x8'),auth['isAuthenticated'](),controller[_0x485b('0x9')]);router[_0x485b('0xa')]('/:id',auth[_0x485b('0xb')](),controller[_0x485b('0xc')]);router[_0x485b('0xd')](_0x485b('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x485b('0xe')]=router; \ No newline at end of file +var _0x4204=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x5d1359,_0x5dea28){var _0x1a55f9=function(_0x9b3143){while(--_0x9b3143){_0x5d1359['push'](_0x5d1359['shift']());}};_0x1a55f9(++_0x5dea28);}(_0x4204,0x160));var _0x4420=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x4204[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require(_0x4420('0x0'));var util=require(_0x4420('0x1'));var path=require(_0x4420('0x2'));var timeout=require('connect-timeout');var express=require(_0x4420('0x3'));var router=express[_0x4420('0x4')]();var fs_extra=require(_0x4420('0x5'));var auth=require(_0x4420('0x6'));var interaction=require(_0x4420('0x7'));var config=require(_0x4420('0x8'));var controller=require('./mailApplication.controller');router[_0x4420('0x9')](_0x4420('0xa'),auth[_0x4420('0xb')](),controller[_0x4420('0xc')]);router[_0x4420('0xd')](_0x4420('0xa'),auth[_0x4420('0xb')](),controller[_0x4420('0xe')]);router[_0x4420('0xf')](_0x4420('0xa'),auth[_0x4420('0xb')](),controller['destroy']);module[_0x4420('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a2e3121..dc4e7aa 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x050f=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x050f,0xdd));var _0xf050=function(_0x42018d,_0x416a7f){_0x42018d=_0x42018d-0x0;var _0x4a1d13=_0x050f[_0x42018d];return _0x4a1d13;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xf050('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xf050('0x1')],'allowNull':![],'defaultValue':_0xf050('0x2')},'appdata':{'type':Sequelize[_0xf050('0x3')]()},'description':{'type':Sequelize[_0xf050('0x1')]},'interval':{'type':Sequelize[_0xf050('0x1')],'defaultValue':_0xf050('0x4')}}; \ No newline at end of file +var _0x48f2=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1fbe1d,_0x31f2cb){var _0x658975=function(_0x3df321){while(--_0x3df321){_0x1fbe1d['push'](_0x1fbe1d['shift']());}};_0x658975(++_0x31f2cb);}(_0x48f2,0x15f));var _0x248f=function(_0x4e7a23,_0x5969b4){_0x4e7a23=_0x4e7a23-0x0;var _0x1843d2=_0x48f2[_0x4e7a23];return _0x1843d2;};'use strict';var Sequelize=require(_0x248f('0x0'));module[_0x248f('0x1')]={'priority':{'type':Sequelize[_0x248f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x248f('0x3')],'allowNull':![],'defaultValue':_0x248f('0x4')},'appdata':{'type':Sequelize[_0x248f('0x5')]()},'description':{'type':Sequelize[_0x248f('0x3')]},'interval':{'type':Sequelize[_0x248f('0x3')],'defaultValue':_0x248f('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 64d2db2..0290051 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x49a57f,_0x405f38){_0x49a57f=_0x49a57f-0x0;var _0x2fa2a5=_0xbdb7[_0x49a57f];return _0x2fa2a5;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0xbdb7[_0x3871d7];return _0x28ec09;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 7aff1a1..f0194f8 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0312=['define','MailApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x7fa2d8,_0x26e571){var _0x21c46f=function(_0x47afc5){while(--_0x47afc5){_0x7fa2d8['push'](_0x7fa2d8['shift']());}};_0x21c46f(++_0x26e571);}(_0x0312,0x114));var _0x2031=function(_0x4130c2,_0x41a7c3){_0x4130c2=_0x4130c2-0x0;var _0x5085e3=_0x0312[_0x4130c2];return _0x5085e3;};'use strict';var _=require(_0x2031('0x0'));var util=require(_0x2031('0x1'));var logger=require(_0x2031('0x2'))(_0x2031('0x3'));var moment=require(_0x2031('0x4'));var BPromise=require(_0x2031('0x5'));var rp=require(_0x2031('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2031('0x7'));var config=require(_0x2031('0x8'));var attributes=require(_0x2031('0x9'));module['exports']=function(_0xa04fae,_0x4d4368){return _0xa04fae[_0x2031('0xa')](_0x2031('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2031('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb73e=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','utf8mb4_unicode_ci','lodash'];(function(_0x5a2c7a,_0x3da6e4){var _0x584e8c=function(_0x3a9dc3){while(--_0x3a9dc3){_0x5a2c7a['push'](_0x5a2c7a['shift']());}};_0x584e8c(++_0x3da6e4);}(_0xb73e,0x17f));var _0xeb73=function(_0x1585ab,_0x59e468){_0x1585ab=_0x1585ab-0x0;var _0x12cdc7=_0xb73e[_0x1585ab];return _0x12cdc7;};'use strict';var _=require(_0xeb73('0x0'));var util=require(_0xeb73('0x1'));var logger=require(_0xeb73('0x2'))('api');var moment=require(_0xeb73('0x3'));var BPromise=require(_0xeb73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb73('0x5'));var rimraf=require(_0xeb73('0x6'));var config=require(_0xeb73('0x7'));var attributes=require(_0xeb73('0x8'));module['exports']=function(_0x347051,_0xdfab6b){return _0x347051[_0xeb73('0x9')](_0xeb73('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb73('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6c00290..e44ffa1 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d90=['message','result','catch','UpdateMailApplication','body','raw','options','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1d90,0x13e));var _0x01d9=function(_0x412376,_0x482fc2){_0x412376=_0x412376-0x0;var _0xae59bf=_0x1d90[_0x412376];return _0xae59bf;};'use strict';var _=require(_0x01d9('0x0'));var util=require('util');var moment=require(_0x01d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x01d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01d9('0x3'))['db'];var utils=require(_0x01d9('0x4'));var logger=require('../../config/logger')(_0x01d9('0x5'));var config=require(_0x01d9('0x6'));var jayson=require(_0x01d9('0x7'));var client=jayson['client'][_0x01d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1664eb,_0x31c11d,_0x598409){return new BPromise(function(_0xef9d5b,_0x479447){return client['request'](_0x1664eb,_0x598409)[_0x01d9('0x9')](function(_0x2b8e06){logger[_0x01d9('0xa')]('MailApplication,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));logger[_0x01d9('0xc')](_0x01d9('0xd'),_0x31c11d,'request\x20sent',JSON[_0x01d9('0xe')](_0x2b8e06));if(_0x2b8e06[_0x01d9('0xf')]){if(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x10')]===0x1f4){logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);return _0x479447(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06['error'][_0x01d9('0x12')]);return _0xef9d5b(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}else{logger[_0x01d9('0xa')]('MailApplication,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));_0xef9d5b(_0x2b8e06[_0x01d9('0x13')][_0x01d9('0x12')]);}})[_0x01d9('0x14')](function(_0x147911){logger['error'](_0x01d9('0x11'),_0x31c11d,_0x147911);_0x479447(_0x147911);});});}exports[_0x01d9('0x15')]=function(_0x51ebb3){var _0x1b31b3=this;return new Promise(function(_0x2789e9,_0x19a3de){return db['MailApplication']['update'](_0x51ebb3[_0x01d9('0x16')],{'raw':_0x51ebb3['options']?_0x51ebb3['options'][_0x01d9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51ebb3[_0x01d9('0x18')]?_0x51ebb3[_0x01d9('0x18')][_0x01d9('0x19')]||null:null,'attributes':_0x51ebb3['options']?_0x51ebb3[_0x01d9('0x18')][_0x01d9('0x1a')]||null:null,'limit':_0x51ebb3['options']?_0x51ebb3[_0x01d9('0x18')][_0x01d9('0x1b')]||null:null})[_0x01d9('0x9')](function(_0x529f34){logger[_0x01d9('0xa')](_0x01d9('0x15'),_0x51ebb3);logger[_0x01d9('0xc')](_0x01d9('0x15'),_0x51ebb3,JSON['stringify'](_0x529f34));_0x2789e9(_0x529f34);})[_0x01d9('0x14')](function(_0x49cc18){logger[_0x01d9('0xf')](_0x01d9('0x15'),_0x49cc18[_0x01d9('0x12')],_0x51ebb3);_0x19a3de(_0x1b31b3[_0x01d9('0xf')](0x1f4,_0x49cc18[_0x01d9('0x12')]));});});}; \ No newline at end of file +var _0x2f0c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1fa3a9,_0x25a3f9){var _0x1e31ff=function(_0x25d78c){while(--_0x25d78c){_0x1fa3a9['push'](_0x1fa3a9['shift']());}};_0x1e31ff(++_0x25a3f9);}(_0x2f0c,0x101));var _0xc2f0=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x2f0c[_0x5ef905];return _0x367808;};'use strict';var _=require(_0xc2f0('0x0'));var util=require(_0xc2f0('0x1'));var moment=require(_0xc2f0('0x2'));var BPromise=require(_0xc2f0('0x3'));var rs=require(_0xc2f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2f0('0x5'))['db'];var utils=require(_0xc2f0('0x6'));var logger=require(_0xc2f0('0x7'))(_0xc2f0('0x8'));var config=require(_0xc2f0('0x9'));var jayson=require(_0xc2f0('0xa'));var client=jayson[_0xc2f0('0xb')][_0xc2f0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x287b3f,_0x18209d,_0x4cf757){return new BPromise(function(_0x2ac8a5,_0x119a79){return client[_0xc2f0('0xd')](_0x287b3f,_0x4cf757)[_0xc2f0('0xe')](function(_0x4ec103){logger[_0xc2f0('0xf')](_0xc2f0('0x10'),_0x18209d,'request\x20sent');logger[_0xc2f0('0x11')](_0xc2f0('0x12'),_0x18209d,_0xc2f0('0x13'),JSON['stringify'](_0x4ec103));if(_0x4ec103['error']){if(_0x4ec103[_0xc2f0('0x14')][_0xc2f0('0x15')]===0x1f4){logger[_0xc2f0('0x14')](_0xc2f0('0x10'),_0x18209d,_0x4ec103[_0xc2f0('0x14')][_0xc2f0('0x16')]);return _0x119a79(_0x4ec103['error']['message']);}logger[_0xc2f0('0x14')](_0xc2f0('0x10'),_0x18209d,_0x4ec103[_0xc2f0('0x14')][_0xc2f0('0x16')]);return _0x2ac8a5(_0x4ec103[_0xc2f0('0x14')][_0xc2f0('0x16')]);}else{logger[_0xc2f0('0xf')](_0xc2f0('0x10'),_0x18209d,_0xc2f0('0x13'));_0x2ac8a5(_0x4ec103['result'][_0xc2f0('0x16')]);}})[_0xc2f0('0x17')](function(_0x4f3077){logger['error'](_0xc2f0('0x10'),_0x18209d,_0x4f3077);_0x119a79(_0x4f3077);});});}exports[_0xc2f0('0x18')]=function(_0x2ef511){var _0x4752b5=this;return new Promise(function(_0x3a59d0,_0x192bb0){return db[_0xc2f0('0x19')][_0xc2f0('0x1a')](_0x2ef511[_0xc2f0('0x1b')],{'raw':_0x2ef511[_0xc2f0('0x1c')]?_0x2ef511['options'][_0xc2f0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef511[_0xc2f0('0x1c')]?_0x2ef511[_0xc2f0('0x1c')]['where']||null:null,'attributes':_0x2ef511[_0xc2f0('0x1c')]?_0x2ef511['options'][_0xc2f0('0x1e')]||null:null,'limit':_0x2ef511[_0xc2f0('0x1c')]?_0x2ef511['options'][_0xc2f0('0x1f')]||null:null})[_0xc2f0('0xe')](function(_0x165768){logger['info']('UpdateMailApplication',_0x2ef511);logger[_0xc2f0('0x11')](_0xc2f0('0x18'),_0x2ef511,JSON[_0xc2f0('0x20')](_0x165768));_0x3a59d0(_0x165768);})['catch'](function(_0x313563){logger[_0xc2f0('0x14')](_0xc2f0('0x18'),_0x313563[_0xc2f0('0x16')],_0x2ef511);_0x192bb0(_0x4752b5[_0xc2f0('0x14')](0x1f4,_0x313563[_0xc2f0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 057d077..ef83c32 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8353=['addMessage','/:id/tags','tracked','mail','/:id','mailinteraction:update','update','delete','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show','getMessages','/:id/download','download','create','post','/:id/messages'];(function(_0x3adf04,_0x37b720){var _0x3dca72=function(_0x4f6d6e){while(--_0x4f6d6e){_0x3adf04['push'](_0x3adf04['shift']());}};_0x3dca72(++_0x37b720);}(_0x8353,0x1aa));var _0x3835=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x8353[_0x5d4607];return _0x5e4a86;};'use strict';var express=require('express');var router=express[_0x3835('0x0')]();var auth=require(_0x3835('0x1'));var interaction=require(_0x3835('0x2'));var controller=require(_0x3835('0x3'));router['get']('/',auth[_0x3835('0x4')](),controller[_0x3835('0x5')]);router[_0x3835('0x6')](_0x3835('0x7'),auth[_0x3835('0x4')](),controller[_0x3835('0x8')]);router[_0x3835('0x6')]('/:id',auth[_0x3835('0x4')](),controller[_0x3835('0x9')]);router[_0x3835('0x6')]('/:id/messages',auth[_0x3835('0x4')](),controller[_0x3835('0xa')]);router[_0x3835('0x6')](_0x3835('0xb'),auth[_0x3835('0x4')](),controller[_0x3835('0xc')]);router['post']('/',auth[_0x3835('0x4')](),controller[_0x3835('0xd')]);router[_0x3835('0xe')](_0x3835('0xf'),auth[_0x3835('0x4')](),controller[_0x3835('0x10')]);router[_0x3835('0xe')](_0x3835('0x11'),auth['isAuthenticated'](),interaction[_0x3835('0x12')](_0x3835('0x13'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0x3835('0x14'),auth[_0x3835('0x4')](),interaction[_0x3835('0x12')]('mail',_0x3835('0x15')),controller[_0x3835('0x16')]);router[_0x3835('0x17')](_0x3835('0x14'),auth[_0x3835('0x4')](),interaction[_0x3835('0x12')](_0x3835('0x13'),'mailinteraction:destroy'),controller['destroy']);router[_0x3835('0x17')](_0x3835('0x11'),auth[_0x3835('0x4')](),controller[_0x3835('0x18')]);module[_0x3835('0x19')]=router; \ No newline at end of file +var _0xf606=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x189a66,_0x245d35){var _0x44fb31=function(_0x322e69){while(--_0x322e69){_0x189a66['push'](_0x189a66['shift']());}};_0x44fb31(++_0x245d35);}(_0xf606,0xf2));var _0x6f60=function(_0x2327fc,_0x1980d9){_0x2327fc=_0x2327fc-0x0;var _0x386585=_0xf606[_0x2327fc];return _0x386585;};'use strict';var express=require(_0x6f60('0x0'));var router=express[_0x6f60('0x1')]();var auth=require(_0x6f60('0x2'));var interaction=require(_0x6f60('0x3'));var controller=require(_0x6f60('0x4'));router[_0x6f60('0x5')]('/',auth[_0x6f60('0x6')](),controller[_0x6f60('0x7')]);router[_0x6f60('0x5')](_0x6f60('0x8'),auth[_0x6f60('0x6')](),controller[_0x6f60('0x9')]);router[_0x6f60('0x5')](_0x6f60('0xa'),auth[_0x6f60('0x6')](),controller[_0x6f60('0xb')]);router['get'](_0x6f60('0xc'),auth[_0x6f60('0x6')](),controller[_0x6f60('0xd')]);router[_0x6f60('0x5')](_0x6f60('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6f60('0x6')](),controller['create']);router['post'](_0x6f60('0xc'),auth[_0x6f60('0x6')](),controller['addMessage']);router['post'](_0x6f60('0xf'),auth['isAuthenticated'](),interaction[_0x6f60('0x10')](_0x6f60('0x11'),_0x6f60('0x12')),controller['addTags']);router[_0x6f60('0x13')]('/:id',auth[_0x6f60('0x6')](),interaction['tracked'](_0x6f60('0x11'),_0x6f60('0x14')),controller['update']);router[_0x6f60('0x15')](_0x6f60('0xa'),auth['isAuthenticated'](),interaction[_0x6f60('0x10')](_0x6f60('0x11'),_0x6f60('0x16')),controller[_0x6f60('0x17')]);router[_0x6f60('0x15')](_0x6f60('0xf'),auth[_0x6f60('0x6')](),controller['removeTags']);module[_0x6f60('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 1a9bbb8..58ae730 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87a4=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','sequelize','iconv'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x87a4,0x12e));var _0x487a=function(_0x2fc6aa,_0x2edd32){_0x2fc6aa=_0x2fc6aa-0x0;var _0x1c795b=_0x87a4[_0x2fc6aa];return _0x1c795b;};'use strict';var Sequelize=require(_0x487a('0x0'));var iconv=require(_0x487a('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x487a('0x2')]},'disposition':{'type':Sequelize[_0x487a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x487a('0x3')](0x1fe)},'to':{'type':Sequelize[_0x487a('0x3')]},'cc':{'type':Sequelize[_0x487a('0x4')](_0x487a('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x487a('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x487a('0x2')]},'substatus':{'type':Sequelize[_0x487a('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x487a('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x487a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x487a('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x487a('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x8463=['ENUM','out','sequelize','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0x8463,0x1b2));var _0x3846=function(_0x3dc46f,_0x4b8e64){_0x3dc46f=_0x3dc46f-0x0;var _0x297083=_0x8463[_0x3dc46f];return _0x297083;};'use strict';var Sequelize=require(_0x3846('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x3846('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3846('0x2')]},'disposition':{'type':Sequelize[_0x3846('0x3')]},'secondDisposition':{'type':Sequelize[_0x3846('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3846('0x3')](0x1fe)},'to':{'type':Sequelize[_0x3846('0x3')]},'cc':{'type':Sequelize[_0x3846('0x4')](_0x3846('0x5'))},'subject':{'type':Sequelize[_0x3846('0x4')]()},'attach':{'type':Sequelize[_0x3846('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3846('0x2')]},'substatus':{'type':Sequelize[_0x3846('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x3846('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3846('0x6')]('in',_0x3846('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3846('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8271a42..868f46c 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83d0=['talking','answered','unmanaged','total','waiting','closed','UserId','index','MailInteraction','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.MailInteractionId','from','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','t.id\x20IN\x20?','resolve','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.substatus','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','Setting','enableEmailPreview','rows','show','params','options','create','body','destroy','addMessage','ids','omit','rawAttributes','MailInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','Attachment','Messages','bcc','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','plainBody','-id','trimStart','catch'];(function(_0x3220c9,_0xa67ccd){var _0x45528a=function(_0x1d7405){while(--_0x1d7405){_0x3220c9['push'](_0x3220c9['shift']());}};_0x45528a(++_0xa67ccd);}(_0x83d0,0xb7));var _0x083d=function(_0x2ba21a,_0x4aca4e){_0x2ba21a=_0x2ba21a-0x0;var _0x51ce42=_0x83d0[_0x2ba21a];return _0x51ce42;};'use strict';var emlformat=require(_0x083d('0x0'));var rimraf=require(_0x083d('0x1'));var zipdir=require(_0x083d('0x2'));var moment=require(_0x083d('0x3'));var BPromise=require(_0x083d('0x4'));var util=require(_0x083d('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x083d('0x6'));var squel=require('squel');var juice=require('juice');var Redis=require(_0x083d('0x7'));var qs=require(_0x083d('0x8'));var as=require(_0x083d('0x9'));var logger=require(_0x083d('0xa'))(_0x083d('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x083d('0xc'));config[_0x083d('0xd')]=_[_0x083d('0xe')](config['redis'],{'host':_0x083d('0xf'),'port':0x18eb});var socket=require(_0x083d('0x10'))(new Redis(config[_0x083d('0xd')]));require(_0x083d('0x11'))['register'](socket);function respondWithStatusCode(_0x3473fa,_0x5be91f){_0x5be91f=_0x5be91f||0xcc;return function(_0x1a2155){if(_0x1a2155){return _0x3473fa[_0x083d('0x12')](_0x5be91f);}return _0x3473fa['status'](_0x5be91f)[_0x083d('0x13')]();};}function respondWithResult(_0x93be5c,_0x23ccf2){_0x23ccf2=_0x23ccf2||0xc8;return function(_0x3e5be5){if(_0x3e5be5){return _0x93be5c[_0x083d('0x14')](_0x23ccf2)['json'](_0x3e5be5);}};}function respondWithFilteredResult(_0xeb0ac2,_0x2266b2){return function(_0x4ee93c){if(_0x4ee93c){var _0x11c03f=typeof _0x2266b2['offset']==='undefined'&&typeof _0x2266b2[_0x083d('0x15')]===_0x083d('0x16');var _0x356d8e=_0x4ee93c[_0x083d('0x17')];var _0x381455=_0x11c03f?0x0:_0x2266b2['offset'];var _0x2ec521=_0x11c03f?_0x4ee93c['count']:_0x2266b2[_0x083d('0x18')]+_0x2266b2[_0x083d('0x15')];var _0x24708d;if(_0x2ec521>=_0x356d8e){_0x2ec521=_0x356d8e;_0x24708d=0xc8;}else{_0x24708d=0xce;}_0xeb0ac2[_0x083d('0x14')](_0x24708d);return _0xeb0ac2[_0x083d('0x19')](_0x083d('0x1a'),_0x381455+'-'+_0x2ec521+'/'+_0x356d8e)[_0x083d('0x1b')](_0x4ee93c);}return null;};}function saveUpdates(_0x3a3dd3){return function(_0x160afb){if(_0x160afb){return _0x160afb[_0x083d('0x1c')](_0x3a3dd3)[_0x083d('0x1d')](function(_0xb8a16f){return _0xb8a16f;});}return null;};}function removeEntity(_0x5dd1ba){return function(_0x24dd4e){if(_0x24dd4e){return _0x24dd4e['destroy']()[_0x083d('0x1d')](function(){_0x5dd1ba[_0x083d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2ba6){return function(_0x4bd7c2){if(!_0x4bd7c2){_0x2b2ba6['sendStatus'](0x194);}return _0x4bd7c2;};}function handleError(_0x59828a,_0xcde93c){_0xcde93c=_0xcde93c||0x1f4;return function(_0x32f1ba){logger[_0x083d('0x1e')](_0x32f1ba[_0x083d('0x1f')]);if(_0x32f1ba[_0x083d('0x20')]){delete _0x32f1ba[_0x083d('0x20')];}_0x59828a['status'](_0xcde93c)[_0x083d('0x21')](_0x32f1ba);};}function getInteractionUsers(_0x33f423,_0x5e6e43){return new BPromise(function(_0x3a0ce2,_0x38ca23){try{if(_0x5e6e43[_0x33f423['id']]){_0x33f423[_0x083d('0x22')]=_[_0x083d('0x23')](_0x5e6e43[_0x33f423['id']],function(_0x42a8f8){return{'id':_0x42a8f8['id'],'fullname':_0x42a8f8[_0x083d('0x24')]};});}}catch(_0x9bc640){_0x38ca23(_0x9bc640);}_0x3a0ce2(_0x33f423);});}function getInteractionTags(_0x3923ff,_0x552bc9){return new BPromise(function(_0x6bccbd,_0x50e5ae){try{if(_0x3923ff[_0x083d('0x25')]){_0x3923ff[_0x083d('0x26')]=[];_0x3923ff[_0x083d('0x25')][_0x083d('0x27')](',')[_0x083d('0x28')](function(_0x13c376){_0x3923ff[_0x083d('0x26')][_0x083d('0x29')](_0x552bc9[_0x13c376]);});}delete _0x3923ff[_0x083d('0x25')];}catch(_0x3f41a4){_0x50e5ae(_0x3f41a4);}_0x6bccbd(_0x3923ff);});}function getLastMessageText(_0x2d9202){return new BPromise(function(_0x24c32c,_0x4588df){return db[_0x083d('0x2a')][_0x083d('0x2b')]({'where':{'$and':[{'MailInteractionId':_0x2d9202['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x083d('0x2c')],'order':_0x083d('0x2d'),'raw':!![]})['then'](function(_0x4c971d){if(_0x4c971d&&_0x4c971d[_0x083d('0x2c')]){_0x2d9202['lastMsgText']=_[_0x083d('0x2e')](_0x4c971d['plainBody']);}_0x24c32c(_0x2d9202);})[_0x083d('0x2f')](function(_0x59f1d5){_0x4588df(_0x59f1d5);});});}function updateMailInteraction(_0x3a2c3d,_0x46d991,_0x3ab8cd,_0x5ae450){return new BPromise(function(_0x5e5e4e,_0x3563bf){return getInteractionUsers(_0x3a2c3d,_0x3ab8cd)['then'](function(_0x18d68c){return getInteractionTags(_0x18d68c,_0x46d991);})[_0x083d('0x1d')](function(_0x17a3e3){return getStateInteraction(_0x17a3e3);})[_0x083d('0x1d')](function(_0x4d76c7){if(_0x5ae450){_0x5e5e4e(getLastMessageText(_0x4d76c7));}else{_0x5e5e4e(_0x4d76c7);}})[_0x083d('0x2f')](function(_0x438957){_0x3563bf(_0x438957);});});}function getStateInteraction(_0x1cc755){return new BPromise(function(_0x30f4ad){_0x1cc755['waiting']=0x0;_0x1cc755[_0x083d('0x30')]=0x0;_0x1cc755[_0x083d('0x31')]=0x0;_0x1cc755[_0x083d('0x32')]=0x0;_0x1cc755[_0x083d('0x33')]=0x0;if(!_0x1cc755['closed']&&!_0x1cc755['UserId']){_0x1cc755[_0x083d('0x34')]+=0x1;}if(!_0x1cc755[_0x083d('0x35')]&&_0x1cc755[_0x083d('0x36')]){_0x1cc755[_0x083d('0x30')]+=0x1;if(_0x1cc755[_0x083d('0x34')]){_0x1cc755['waiting']-=0x1;}}if(_0x1cc755[_0x083d('0x35')]&&_0x1cc755[_0x083d('0x36')]){_0x1cc755['answered']+=0x1;if(_0x1cc755[_0x083d('0x30')]){_0x1cc755['talking']-=0x1;}}if(_0x1cc755['closed']&&!_0x1cc755[_0x083d('0x36')]){_0x1cc755[_0x083d('0x32')]+=0x1;if(_0x1cc755['waiting']){_0x1cc755[_0x083d('0x34')]-=0x1;}}_0x1cc755[_0x083d('0x33')]+=0x1;_0x30f4ad(_0x1cc755);});}exports[_0x083d('0x37')]=function(_0x594327,_0x5766d5){var _0x48e297={},_0x4b1268={},_0xbc94e8={'count':0x0,'rows':[]};var _0x417585=_[_0x083d('0x23')](db[_0x083d('0x38')]['rawAttributes'],function(_0x5ad9f2){return{'name':_0x5ad9f2[_0x083d('0x39')],'type':_0x5ad9f2['type'][_0x083d('0x3a')]};});_0x4b1268[_0x083d('0x3b')]=_[_0x083d('0x23')](_0x417585,_0x083d('0x20'));_0x4b1268[_0x083d('0x3c')]=_[_0x083d('0x3d')](_0x594327[_0x083d('0x3c')]);_0x4b1268[_0x083d('0x3e')]=_['intersection'](_0x4b1268[_0x083d('0x3b')],_0x4b1268[_0x083d('0x3c')]);_0x48e297[_0x083d('0x3f')]=_[_0x083d('0x40')](_0x4b1268[_0x083d('0x3b')],qs[_0x083d('0x41')](_0x594327[_0x083d('0x3c')]['fields']));_0x48e297[_0x083d('0x3f')]=_0x48e297[_0x083d('0x3f')]['length']?_0x48e297[_0x083d('0x3f')]:_0x4b1268[_0x083d('0x3b')];if(!_0x594327[_0x083d('0x3c')][_0x083d('0x42')](_0x083d('0x43'))){_0x48e297['limit']=qs[_0x083d('0x15')](_0x594327[_0x083d('0x3c')][_0x083d('0x15')]);_0x48e297[_0x083d('0x18')]=qs[_0x083d('0x18')](_0x594327['query'][_0x083d('0x18')]);}_0x48e297[_0x083d('0x44')]=qs[_0x083d('0x45')](_0x594327[_0x083d('0x3c')][_0x083d('0x45')]);_0x48e297[_0x083d('0x46')]=qs['filters'](_[_0x083d('0x47')](_0x594327[_0x083d('0x3c')],_0x4b1268[_0x083d('0x3e')]),_0x417585);var _0x1bdafc=[];var _0x19bdc0=squel[_0x083d('0x48')]()[_0x083d('0x49')]('id')['field']('name')['field'](_0x083d('0x4a'))['from'](_0x083d('0x4b'));var _0x42af7d=squel[_0x083d('0x48')]()[_0x083d('0x49')]('u.id')[_0x083d('0x49')](_0x083d('0x4c'))[_0x083d('0x49')](_0x083d('0x4d'))[_0x083d('0x4e')]('user_has_mail_interactions','ui')['left_join']('users','u',_0x083d('0x4f'));var _0x34ed6c=squel[_0x083d('0x48')]()[_0x083d('0x4e')](_0x083d('0x50'),'i')[_0x083d('0x51')](_0x083d('0x52'),'c',_0x083d('0x53'))[_0x083d('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x083d('0x51')]('mail_accounts','a',_0x083d('0x54'))[_0x083d('0x51')](_0x083d('0x55'),'me',_0x083d('0x56'))[_0x083d('0x51')]('mail_interaction_has_tags','it',_0x083d('0x57'))['left_join']('tools_tags','t',_0x083d('0x58'));var _0x1bdfe5=squel[_0x083d('0x59')]();var _0x4273b2=[];var _0x10db3e=squel[_0x083d('0x59')]();var _0xa7a4bd;if(_0x594327['query'][_0x083d('0x5a')]){_0xa7a4bd=as[_0x083d('0x5b')](_0x594327[_0x083d('0x3c')][_0x083d('0x5a')]);var _0x395350=_0xa7a4bd[_0x083d('0x5c')];for(var _0x912e1e=0x0;_0x912e1e<_0xa7a4bd[_0x083d('0x5d')]['length'];_0x912e1e++){var _0x16892c=_0xa7a4bd[_0x083d('0x5d')][_0x912e1e];var _0x1505f8='i';var _0x20472f=_[_0x083d('0x5e')](_0x417585,[_0x083d('0x20'),_0x16892c[_0x083d('0x49')]]);if(!_0x20472f){switch(_0x16892c[_0x083d('0x49')]){case _0x083d('0x5f'):if(_0x16892c[_0x083d('0x60')]==0x1){_0x34ed6c[_0x083d('0x61')]('`'+_0x16892c[_0x083d('0x49')]+_0x083d('0x62'));}else{_0x34ed6c['having']('`'+_0x16892c['field']+_0x083d('0x63'));}break;case _0x083d('0x64'):if(_0x16892c[_0x083d('0x65')]===_0x083d('0x66')){if(_0x16892c['value'][_0x083d('0x27')]('\x20')[_0x083d('0x67')]>0x1){_0x1bdfe5[_0x395350](_0x083d('0x68'),qs[_0x083d('0x69')](_0x16892c[_0x083d('0x60')]),null);}else{var _0x48c6b3='%'+_0x16892c['value']+'%';_0x1bdfe5[_0x395350](_0x083d('0x6a'),_0x48c6b3,_0x48c6b3,_0x48c6b3);}}else{_0x20472f=_[_0x083d('0x5e')](_0x417585,[_0x083d('0x20'),'ContactId']);_0x16892c[_0x083d('0x49')]=_0x083d('0x6b');_0x3d6af8=as['buildExpression'](_0x1505f8,_0x20472f[_0x083d('0x6c')],_0x16892c);_0x1bdfe5[_0x395350](_0x3d6af8[_0x083d('0x6d')],_0x3d6af8['value'][_0x083d('0x6e')],_0x3d6af8[_0x083d('0x60')]['end']);}break;case _0x083d('0x6f'):var _0x6e2328=_0x16892c['value']['split'](',')[_0x083d('0x23')](function(_0x24acf7){return Number(_0x24acf7);});_0x6e2328[_0x083d('0x28')](function(_0x1d5761){_0x10db3e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1d5761+',%');});_0x4273b2=_[_0x083d('0x70')](_0x4273b2,_0x6e2328);break;case _0x083d('0x71'):if(_0x16892c[_0x083d('0x65')]==='$substring'){_0x1bdfe5[_0x395350](_0x083d('0x72'),'%'+_0x16892c[_0x083d('0x60')]+'%',null);}else{_0x20472f=_[_0x083d('0x5e')](_0x417585,[_0x083d('0x20'),'UserId']);_0x16892c['field']=_0x083d('0x36');_0x3d6af8=as[_0x083d('0x73')](_0x1505f8,_0x20472f['type'],_0x16892c);_0x1bdfe5[_0x395350](_0x3d6af8[_0x083d('0x6d')],_0x3d6af8[_0x083d('0x60')][_0x083d('0x6e')],_0x3d6af8[_0x083d('0x60')][_0x083d('0x13')]);}break;case'plainBody':_0x3d6af8=as[_0x083d('0x73')]('me',null,_0x16892c);_0x1bdfe5[_0x395350](_0x3d6af8[_0x083d('0x6d')],_0x3d6af8[_0x083d('0x60')][_0x083d('0x6e')],_0x3d6af8[_0x083d('0x60')][_0x083d('0x13')]);break;}}else{var _0x3d6af8=as[_0x083d('0x73')](_0x1505f8,_0x20472f['type'],_0x16892c);_0x1bdfe5[_0x395350](_0x3d6af8[_0x083d('0x6d')],_0x3d6af8[_0x083d('0x60')][_0x083d('0x6e')],_0x3d6af8['value']['end']);}}}else{var _0x63eda5=_(_0x594327[_0x083d('0x3c')])[_0x083d('0x3d')]()[_0x083d('0x23')](function(_0x51db05){return _[_0x083d('0x74')](_0x417585,['name',_0x51db05])?_0x51db05:undefined;})['compact']()[_0x083d('0x60')]();if(!_[_0x083d('0x75')](_0x63eda5)){_0x63eda5[_0x083d('0x28')](function(_0x276ac1){if(_0x276ac1===_0x083d('0x76')){_0x34ed6c[_0x083d('0x46')](_0x083d('0x77'),[][_0x083d('0x78')](_0x594327[_0x083d('0x3c')][_0x276ac1]));}else if(_0x276ac1===_0x083d('0x79')){var _0x3b54a4=JSON['parse'](_0x594327[_0x083d('0x3c')][_0x276ac1])['$gte'];var _0x5ea764=JSON[_0x083d('0x7a')](_0x594327[_0x083d('0x3c')][_0x276ac1])[_0x083d('0x7b')];_0x34ed6c[_0x083d('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3b54a4,_0x5ea764);}else{if(_0x594327['query'][_0x276ac1]===_0x083d('0x7c')){_0x34ed6c[_0x083d('0x46')]('i.'+_0x276ac1+_0x083d('0x7d'));}else{_0x34ed6c['where']('i.'+_0x276ac1+_0x083d('0x7e'),_0x594327[_0x083d('0x3c')][_0x276ac1]);}}});}if(_0x594327['query'][_0x083d('0x7f')]){if(_0x594327[_0x083d('0x3c')][_0x083d('0x7f')]==0x1){_0x34ed6c[_0x083d('0x61')](_0x083d('0x80'));}else{_0x34ed6c[_0x083d('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x594327[_0x083d('0x3c')]['tag']){_0x4273b2=_[_0x083d('0x81')](_0x594327['query']['tag'])?_0x594327[_0x083d('0x3c')]['tag']:new Array(_0x594327[_0x083d('0x3c')][_0x083d('0x82')]);_0x4273b2[_0x083d('0x28')](function(_0xa5d49d){_0x10db3e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa5d49d+',%');});}if(_0x594327[_0x083d('0x3c')][_0x083d('0x83')]){var _0x154da6=_0x594327[_0x083d('0x3c')][_0x083d('0x83')][_0x083d('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x083d('0x85')](_0x154da6)){_0x1bdfe5['or'](_0x083d('0x86'),_0x154da6+'%');}else if(qs[_0x083d('0x87')](_0x154da6)){_0x1bdfe5['or']('c.email\x20LIKE\x20?',_0x154da6+'%');}else{_0x1bdfe5['or'](_0x083d('0x88'),qs[_0x083d('0x69')](_0x154da6))['or'](_0x083d('0x89'),qs[_0x083d('0x69')](_0x154da6));}}}_0x34ed6c[_0x083d('0x46')](_0x1bdfe5);_0x34ed6c[_0x083d('0x8a')]('i.id');var _0x24b593={'type':db[_0x083d('0x8b')]['QueryTypes'][_0x083d('0x8c')],'raw':!![]};var _0x347ea0=_0x34ed6c[_0x083d('0x8d')]();_0x347ea0['field'](_0x083d('0x8e'));_0x347ea0[_0x083d('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x083d('0x5f'));if(_0x48e297['order']){_0x48e297[_0x083d('0x44')][_0x083d('0x28')](function(_0x3997b8){var _0x38ac1f=_0x3997b8[0x0]==='contactName'?_0x3997b8[0x0]:'i.'+_0x3997b8[0x0];_0x34ed6c[_0x083d('0x44')](_0x38ac1f,_0x3997b8[0x1]==='DESC'?![]:!![]);});}if(!_[_0x083d('0x75')](_0x4273b2)){_0x34ed6c[_0x083d('0x61')](_0x10db3e);_0x347ea0['where'](_0x083d('0x8f'),_0x4273b2);}BPromise[_0x083d('0x90')]()[_0x083d('0x1d')](function(){if(!_0xa7a4bd){if(_0x594327[_0x083d('0x3c')]['MailAccountId'])return;_0x347ea0['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x34ed6c[_0x083d('0x46')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x594327[_0x083d('0x91')]['role']!==_0x083d('0x92'))return;return _0x594327[_0x083d('0x91')][_0x083d('0x93')]({'attributes':['id'],'raw':!![]})[_0x083d('0x1d')](function(_0x3b38ae){if(_[_0x083d('0x75')](_0x3b38ae)){_0x347ea0[_0x083d('0x46')](_0x083d('0x94'));_0x34ed6c['where'](_0x083d('0x94'));}else{_0x347ea0[_0x083d('0x46')]('i.MailAccountId\x20IN\x20?',_[_0x083d('0x23')](_0x3b38ae,'id'));_0x34ed6c[_0x083d('0x46')](_0x083d('0x77'),_[_0x083d('0x23')](_0x3b38ae,'id'));}});})[_0x083d('0x1d')](function(){if(_0x594327[_0x083d('0x91')]['role']===_0x083d('0x92')&&!_0xa7a4bd&&!_0x594327[_0x083d('0x3c')]['MailAccountId'])return[];return db['sequelize'][_0x083d('0x3c')](_0x347ea0[_0x083d('0x95')](),_0x24b593);})[_0x083d('0x1d')](function(_0x212473){_0xbc94e8['count']=_0x212473[_0x083d('0x67')];if(_0xbc94e8[_0x083d('0x17')]===0x0)return[];return db[_0x083d('0x96')][_0x083d('0x3c')](_0x19bdc0['toString'](),_0x24b593)['then'](function(_0x586a14){_0x1bdafc=_['keyBy'](_0x586a14,'id');_0x24b593=_[_0x083d('0x97')](_0x24b593,{'model':db[_0x083d('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x594327[_0x083d('0x3c')][_0x083d('0x41')]){_0x48e297[_0x083d('0x3f')][_0x083d('0x28')](function(_0x181a7a){_0x34ed6c[_0x083d('0x49')]('i.'+_0x181a7a);});}else{_0x34ed6c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x083d('0x5f'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x98'),_0x083d('0x99'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x9a'),'Account.mandatoryDisposition');_0x34ed6c[_0x083d('0x49')](_0x083d('0x9b'),_0x083d('0x9c'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x8e'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x9d'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x9e'));_0x34ed6c[_0x083d('0x49')](_0x083d('0x9f'));_0x34ed6c['field']('i.closedAt');_0x34ed6c[_0x083d('0x49')]('i.attach');_0x34ed6c[_0x083d('0x49')](_0x083d('0xa0'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xa1'));_0x34ed6c['field']('i.subject');_0x34ed6c['field']('i.disposition');_0x34ed6c[_0x083d('0x49')](_0x083d('0xa2'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xa3'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xa4'));_0x34ed6c[_0x083d('0x49')]('i.to');_0x34ed6c[_0x083d('0x49')]('i.ContactId');_0x34ed6c[_0x083d('0x49')](_0x083d('0xa5'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xa6'));_0x34ed6c['field']('c.firstName',_0x083d('0xa7'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xa8'),_0x083d('0xa9'));_0x34ed6c['field'](_0x083d('0xaa'),_0x083d('0xab'));_0x34ed6c[_0x083d('0x49')]('c.phone','Contact.phone');_0x34ed6c[_0x083d('0x49')](_0x083d('0xac'),_0x083d('0xad'));_0x34ed6c[_0x083d('0x49')]('c.fax',_0x083d('0xae'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xaf'),_0x083d('0xb0'));_0x34ed6c[_0x083d('0x49')](_0x083d('0xb1'),_0x083d('0xb2'));_0x34ed6c['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x083d('0x25'));}if(_0x48e297[_0x083d('0x15')])_0x34ed6c[_0x083d('0x15')](_0x48e297[_0x083d('0x15')]);if(_0x48e297[_0x083d('0x18')])_0x34ed6c[_0x083d('0x18')](_0x48e297['offset']);return db[_0x083d('0x96')][_0x083d('0x3c')](_0x34ed6c[_0x083d('0x95')](),_0x24b593);})[_0x083d('0x1d')](function(_0x23a718){if(_0x23a718[_0x083d('0x67')]>0x0)_0x42af7d[_0x083d('0x46')]('ui.MailInteractionId\x20IN\x20?',_[_0x083d('0x23')](_0x23a718,'id'));return db[_0x083d('0x96')]['query'](_0x42af7d[_0x083d('0x95')](),_0x24b593)[_0x083d('0x1d')](function(_0x1075c7){var _0x3bc174=_[_0x083d('0xb3')](_0x1075c7,'MailInteractionId');var _0x3d340d=[];return db[_0x083d('0xb4')]['findOne']({'attributes':[_0x083d('0xb5')],'raw':!![]})['then'](function(_0x2e43d7){var _0x2a01b4=_0x2e43d7[_0x083d('0xb5')];_0x23a718['forEach'](function(_0x3575df){_0x3d340d[_0x083d('0x29')](updateMailInteraction(_0x3575df,_0x1bdafc,_0x3bc174,_0x2a01b4));});return BPromise['all'](_0x3d340d);});});});})[_0x083d('0x1d')](function(_0x2918ce){_0xbc94e8[_0x083d('0xb6')]=_0x2918ce;return _0xbc94e8;})[_0x083d('0x1d')](respondWithFilteredResult(_0x5766d5,_0x48e297))[_0x083d('0x2f')](handleError(_0x5766d5,null));};exports[_0x083d('0xb7')]=function(_0x12c819,_0x2cc7e3){var _0x4f1aee={'raw':![],'where':{'id':_0x12c819[_0x083d('0xb8')]['id']}},_0x5554a0={};_0x5554a0[_0x083d('0x3b')]=_[_0x083d('0x3d')](db['MailInteraction']['rawAttributes']);_0x5554a0[_0x083d('0x3c')]=_['keys'](_0x12c819[_0x083d('0x3c')]);_0x5554a0['filters']=_['intersection'](_0x5554a0['model'],_0x5554a0[_0x083d('0x3c')]);_0x4f1aee[_0x083d('0x3f')]=_[_0x083d('0x40')](_0x5554a0['model'],qs[_0x083d('0x41')](_0x12c819[_0x083d('0x3c')]['fields']));_0x4f1aee[_0x083d('0x3f')]=_0x4f1aee['attributes'][_0x083d('0x67')]?_0x4f1aee[_0x083d('0x3f')]:_0x5554a0[_0x083d('0x3b')];if(_0x12c819['query']['includeAll']){_0x4f1aee['include']=[{'all':!![]}];}_0x4f1aee=_[_0x083d('0x97')]({},_0x4f1aee,_0x12c819[_0x083d('0xb9')]);return db[_0x083d('0x38')][_0x083d('0x5e')](_0x4f1aee)[_0x083d('0x1d')](handleEntityNotFound(_0x2cc7e3,null))[_0x083d('0x1d')](respondWithResult(_0x2cc7e3,null))[_0x083d('0x2f')](handleError(_0x2cc7e3,null));};exports[_0x083d('0xba')]=function(_0x46a46d,_0x1fca11){return db['MailInteraction'][_0x083d('0xba')](_0x46a46d[_0x083d('0xbb')],{})['then'](respondWithResult(_0x1fca11,0xc9))['catch'](handleError(_0x1fca11,null));};exports[_0x083d('0x1c')]=function(_0x3603d9,_0x2c5cc7){if(_0x3603d9[_0x083d('0xbb')]['id']){delete _0x3603d9[_0x083d('0xbb')]['id'];}return db[_0x083d('0x38')]['find']({'where':{'id':_0x3603d9['params']['id']}})[_0x083d('0x1d')](handleEntityNotFound(_0x2c5cc7,null))[_0x083d('0x1d')](saveUpdates(_0x3603d9[_0x083d('0xbb')],null))['then'](respondWithResult(_0x2c5cc7,null))[_0x083d('0x2f')](handleError(_0x2c5cc7,null));};exports[_0x083d('0xbc')]=function(_0x295574,_0x221d42){return db[_0x083d('0x38')][_0x083d('0x5e')]({'where':{'id':_0x295574[_0x083d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x221d42,null))[_0x083d('0x1d')](removeEntity(_0x221d42,null))[_0x083d('0x2f')](handleError(_0x221d42,null));};exports['describe']=function(_0x45456e,_0x5bd5b9){return db[_0x083d('0x38')]['describe']()[_0x083d('0x1d')](respondWithResult(_0x5bd5b9,null))['catch'](handleError(_0x5bd5b9,null));};exports[_0x083d('0xbd')]=function(_0x5336b9,_0x3ced98){return db[_0x083d('0x2a')][_0x083d('0x5e')]({'where':{'id':_0x5336b9[_0x083d('0xb8')]['id']}})[_0x083d('0x1d')](handleEntityNotFound(_0x3ced98,null))['then'](function(_0x3aed94){if(_0x3aed94){return _0x3aed94[_0x083d('0xbd')](_0x5336b9['body'][_0x083d('0xbe')],_[_0x083d('0xbf')](_0x5336b9[_0x083d('0xbb')],['ids','id'])||{});}})[_0x083d('0x1d')](respondWithResult(_0x3ced98,null))[_0x083d('0x2f')](handleError(_0x3ced98,null));};exports['getMessages']=function(_0x8a8105,_0x1deffd){var _0x1e3427={'raw':![],'where':{}};var _0x2e7d58={};var _0x2f9741={'count':0x0,'rows':[]};return db['MailInteraction'][_0x083d('0x2b')]({'where':{'id':_0x8a8105['params']['id']}})[_0x083d('0x1d')](handleEntityNotFound(_0x1deffd,null))[_0x083d('0x1d')](function(_0x3b0c46){if(_0x3b0c46){_0x2e7d58[_0x083d('0x3b')]=_['keys'](db[_0x083d('0x2a')][_0x083d('0xc0')]);_0x2e7d58[_0x083d('0x3c')]=_[_0x083d('0x3d')](_0x8a8105[_0x083d('0x3c')]);_0x2e7d58[_0x083d('0x3e')]=_[_0x083d('0x40')](_0x2e7d58[_0x083d('0x3b')],_0x2e7d58[_0x083d('0x3c')]);_0x1e3427[_0x083d('0x3f')]=_[_0x083d('0x40')](_0x2e7d58[_0x083d('0x3b')],qs['fields'](_0x8a8105[_0x083d('0x3c')][_0x083d('0x41')]));_0x1e3427['attributes']=_0x1e3427[_0x083d('0x3f')][_0x083d('0x67')]?_0x1e3427['attributes']:_0x2e7d58[_0x083d('0x3b')];if(!_0x8a8105[_0x083d('0x3c')][_0x083d('0x42')]('nolimit')){_0x1e3427['limit']=qs[_0x083d('0x15')](_0x8a8105['query'][_0x083d('0x15')]);_0x1e3427[_0x083d('0x18')]=qs['offset'](_0x8a8105[_0x083d('0x3c')][_0x083d('0x18')]);}_0x1e3427[_0x083d('0x44')]=qs[_0x083d('0x45')](_0x8a8105[_0x083d('0x3c')][_0x083d('0x45')]);_0x1e3427[_0x083d('0x46')]=qs[_0x083d('0x3e')](_[_0x083d('0x47')](_0x8a8105[_0x083d('0x3c')],_0x2e7d58['filters']));_0x1e3427[_0x083d('0x46')][_0x083d('0xc1')]=_0x3b0c46['id'];if(_0x8a8105[_0x083d('0x3c')][_0x083d('0x83')]){_0x1e3427[_0x083d('0x46')]=_[_0x083d('0x97')](_0x1e3427[_0x083d('0x46')],{'$or':_['map'](_0x1e3427[_0x083d('0x3f')],function(_0x4d1a56){var _0x53c18c={};_0x53c18c[_0x4d1a56]={'$like':'%'+_0x8a8105[_0x083d('0x3c')]['filter']+'%'};return _0x53c18c;})});}if(_0x8a8105[_0x083d('0x3c')][_0x083d('0xc2')]){var _0xb8e3ae=_0x8a8105[_0x083d('0x3c')][_0x083d('0xc2')][_0x083d('0x27')](',');var _0x1584f1={};_0x1584f1[_0xb8e3ae[0x0]]={'$gte':moment(_0xb8e3ae[0x1])[_0x083d('0xc3')](_0x083d('0xc4'))};_0x1e3427['where']=_['merge'](_0x1e3427[_0x083d('0x46')],_0x1584f1);}_0x1e3427=_[_0x083d('0x97')]({},_0x1e3427,_0x8a8105[_0x083d('0xb9')]);return db[_0x083d('0x2a')][_0x083d('0x17')]({'where':_0x1e3427[_0x083d('0x46')]})[_0x083d('0x1d')](function(_0x48c7f2){_0x2f9741[_0x083d('0x17')]=_0x48c7f2;if(_0x8a8105[_0x083d('0x3c')][_0x083d('0xc5')]){_0x1e3427['include']=[{'all':!![]}];}return db[_0x083d('0x2a')][_0x083d('0xc6')](_0x1e3427);})['then'](function(_0x3db632){if(_0x8a8105[_0x083d('0x3c')][_0x083d('0xc7')]===_0x083d('0xc8')){for(var _0x38c181=0x0;_0x38c181<_0x3db632[_0x083d('0x67')];_0x38c181++){_0x3db632[_0x38c181][_0x083d('0xbb')]=juice(_0x3db632[_0x38c181]['body']);}}_0x2f9741['rows']=_0x3db632;return _0x2f9741;});}})['then'](respondWithFilteredResult(_0x1deffd,_0x1e3427))[_0x083d('0x2f')](handleError(_0x1deffd,null));};exports[_0x083d('0xc9')]=function(_0x464a39,_0xefb039){return db[_0x083d('0x38')][_0x083d('0x5e')]({'where':{'id':_0x464a39[_0x083d('0xb8')]['id']}})['then'](handleEntityNotFound(_0xefb039,null))[_0x083d('0x1d')](function(_0x337890){if(_0x337890){return _0x337890[_0x083d('0xca')](_0x464a39[_0x083d('0xbb')][_0x083d('0xbe')],_[_0x083d('0xbf')](_0x464a39['body'],[_0x083d('0xbe'),'id'])||{})[_0x083d('0xcb')](function(){return db[_0x083d('0x6f')]['findAll']({'attributes':['id','name',_0x083d('0x4a')],'where':{'id':_0x464a39[_0x083d('0xbb')]['ids']}});})['then'](function(_0x48ee79){socket[_0x083d('0xcc')](_0x083d('0xcd'),{'id':Number(_0x464a39[_0x083d('0xb8')]['id']),'tags':_0x48ee79||[]});return{'id':Number(_0x464a39[_0x083d('0xb8')]['id']),'tags':_0x48ee79||[]};});}})[_0x083d('0x1d')](respondWithResult(_0xefb039,null))[_0x083d('0x2f')](handleError(_0xefb039,null));};exports[_0x083d('0xce')]=function(_0xf8c2c0,_0x29e65a){return db[_0x083d('0x38')][_0x083d('0x5e')]({'where':{'id':_0xf8c2c0[_0x083d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x29e65a,null))[_0x083d('0x1d')](function(_0x58fc22){if(_0x58fc22){return _0x58fc22['removeTags'](_0xf8c2c0['query'][_0x083d('0xbe')]);}})['then'](respondWithStatusCode(_0x29e65a,null))['catch'](handleError(_0x29e65a,null));};exports[_0x083d('0xcf')]=function(_0x546931,_0x2f30ae){var _0xdc0baf=moment()[_0x083d('0xd0')]()[_0x083d('0x95')]();var _0x489a84=path['join'](config[_0x083d('0xd1')],_0x083d('0xd2'),_0x083d('0xd3'),_0x083d('0xd4'));var _0x39d9a2=path[_0x083d('0xd5')](config[_0x083d('0xd1')],'server',_0x083d('0xd3'),'attachments');var _0x17a569=path[_0x083d('0xd5')](_0x489a84,_0xdc0baf);var _0x364036=util[_0x083d('0xc3')]('transcript-%d-%s.zip',_0x546931[_0x083d('0xb8')]['id'],_0xdc0baf);var _0x58077e=path['join'](_0x489a84,_0x364036);var _0x3edf16=[];if(_0x546931[_0x083d('0x3c')][_0x083d('0xd6')]){_0x3edf16[_0x083d('0x29')]({'model':db[_0x083d('0xd7')],'as':'Attachments','raw':!![]});}var _0x1f2ae6=[{'model':db[_0x083d('0x2a')],'as':_0x083d('0xd8'),'attributes':['id','body',_0x083d('0x4e'),'to','cc',_0x083d('0xd9'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x083d('0x45')]('id'),'include':_0x3edf16}];return db[_0x083d('0x38')][_0x083d('0x5e')]({'where':{'id':_0x546931[_0x083d('0xb8')]['id']},'include':_0x1f2ae6})['then'](handleEntityNotFound(_0x2f30ae,null))[_0x083d('0x1d')](function(_0x1ddfcf){if(_0x1ddfcf&&_0x1ddfcf['Messages']){var _0x3700fb=_0x1ddfcf['get']({'plain':!![]});fs[_0x083d('0xda')](_0x17a569);return BPromise[_0x083d('0xdb')](_0x3700fb[_0x083d('0xd8')],function(_0x26d1c2,_0x444045){var _0xcdfc86={'from':_0x26d1c2[_0x083d('0x4e')],'to':_0x26d1c2['to'],'subject':_0x26d1c2[_0x083d('0xdc')],'html':htmlEntities[_0x083d('0xdd')](_0x26d1c2[_0x083d('0xbb')]),'headers':{'Date':moment(_0x26d1c2[_0x083d('0x79')])['format'](_0x083d('0xde'))},'attachments':[]};if(_0x26d1c2['cc']){_0xcdfc86['headers']['Cc']=_0x26d1c2['cc'];}if(_0x26d1c2[_0x083d('0xd9')]){_0xcdfc86['headers'][_0x083d('0xdf')]=_0x26d1c2[_0x083d('0xd9')];}return new BPromise(function(_0x509f34,_0x5d0315){if(_0x26d1c2[_0x083d('0xe0')]){for(var _0x4cd5db=0x0;_0x4cd5db<_0x26d1c2[_0x083d('0xe0')][_0x083d('0x67')];_0x4cd5db++){var _0x335523=_0x26d1c2['Attachments'][_0x4cd5db];var _0x8e6b98=path[_0x083d('0xd5')](_0x39d9a2,_0x335523[_0x083d('0xe1')]);if(fs[_0x083d('0xe2')](_0x8e6b98)){_0xcdfc86[_0x083d('0xd6')][_0x083d('0x29')]({'name':_0x335523['name'],'contentType':_0x335523[_0x083d('0x6c')],'data':fs['readFileSync'](_0x8e6b98)});}}}emlformat[_0x083d('0xe3')](_0xcdfc86,function(_0x3da861,_0x3beb7f){if(_0x3da861)return _0x5d0315(_0x3da861);fs[_0x083d('0xe4')](path['join'](_0x17a569,util[_0x083d('0xc3')](_0x083d('0xe5'),_0x444045)),_0x3beb7f);return _0x509f34(_0x3beb7f);});});})['then'](function(){return new BPromise(function(_0x1aa443,_0x9045cf){zipdir(_0x17a569,{'saveTo':_0x58077e},function(_0x2400fb,_0x43f335){if(_0x2400fb)return _0x9045cf(_0x2400fb);return _0x1aa443(_0x43f335);});})[_0x083d('0x1d')](function(){return new BPromise(function(_0x33a691,_0x45c9d9){rimraf(_0x17a569,function(_0x6ae77b){if(_0x6ae77b)_0x45c9d9(_0x6ae77b);return _0x33a691();});});})[_0x083d('0x1d')](function(){return _0x2f30ae[_0x083d('0xcf')](_0x58077e,_0x364036,function(_0x88235a){if(!_0x88235a)fs[_0x083d('0xe6')](_0x58077e);});});});}else{return _0x2f30ae['sendStatus'](0xc8);}})[_0x083d('0x2f')](handleError(_0x2f30ae,null));}; \ No newline at end of file +var _0xa23f=['buildExpression','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','rows','show','params','includeAll','include','merge','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','message%d.eml','eml-format','rimraf','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','update','then','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','MailInteraction','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0xa23f,0x7c));var _0xfa23=function(_0x479ed6,_0x74c485){_0x479ed6=_0x479ed6-0x0;var _0x2e6a58=_0xa23f[_0x479ed6];return _0x2e6a58;};'use strict';var emlformat=require(_0xfa23('0x0'));var rimraf=require(_0xfa23('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xfa23('0x2'));var util=require(_0xfa23('0x3'));var path=require(_0xfa23('0x4'));var fs=require('fs');var _=require(_0xfa23('0x5'));var squel=require('squel');var juice=require(_0xfa23('0x6'));var Redis=require('ioredis');var qs=require(_0xfa23('0x7'));var as=require(_0xfa23('0x8'));var logger=require(_0xfa23('0x9'))(_0xfa23('0xa'));var config=require('../../config/environment');var db=require(_0xfa23('0xb'))['db'];var htmlEntities=require('html-entities');config[_0xfa23('0xc')]=_[_0xfa23('0xd')](config[_0xfa23('0xc')],{'host':_0xfa23('0xe'),'port':0x18eb});var socket=require(_0xfa23('0xf'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xfa23('0x10')](socket);function respondWithStatusCode(_0x4ea7a8,_0x3128d3){_0x3128d3=_0x3128d3||0xcc;return function(_0x5c0ec9){if(_0x5c0ec9){return _0x4ea7a8[_0xfa23('0x11')](_0x3128d3);}return _0x4ea7a8[_0xfa23('0x12')](_0x3128d3)[_0xfa23('0x13')]();};}function respondWithResult(_0x52ef2a,_0x1e5ffe){_0x1e5ffe=_0x1e5ffe||0xc8;return function(_0x42380){if(_0x42380){return _0x52ef2a[_0xfa23('0x12')](_0x1e5ffe)['json'](_0x42380);}};}function respondWithFilteredResult(_0x56f927,_0x17e782){return function(_0x23712b){if(_0x23712b){var _0x3f50f0=typeof _0x17e782[_0xfa23('0x14')]==='undefined'&&typeof _0x17e782[_0xfa23('0x15')]===_0xfa23('0x16');var _0x2095a5=_0x23712b[_0xfa23('0x17')];var _0x542d9a=_0x3f50f0?0x0:_0x17e782[_0xfa23('0x14')];var _0x39729e=_0x3f50f0?_0x23712b[_0xfa23('0x17')]:_0x17e782[_0xfa23('0x14')]+_0x17e782[_0xfa23('0x15')];var _0x4e5b77;if(_0x39729e>=_0x2095a5){_0x39729e=_0x2095a5;_0x4e5b77=0xc8;}else{_0x4e5b77=0xce;}_0x56f927['status'](_0x4e5b77);return _0x56f927['set'](_0xfa23('0x18'),_0x542d9a+'-'+_0x39729e+'/'+_0x2095a5)[_0xfa23('0x19')](_0x23712b);}return null;};}function saveUpdates(_0x4bd0e0){return function(_0x9effe6){if(_0x9effe6){return _0x9effe6[_0xfa23('0x1a')](_0x4bd0e0)[_0xfa23('0x1b')](function(_0x54bb04){return _0x54bb04;});}return null;};}function removeEntity(_0x1970ec){return function(_0x452604){if(_0x452604){return _0x452604['destroy']()[_0xfa23('0x1b')](function(){_0x1970ec[_0xfa23('0x12')](0xcc)[_0xfa23('0x13')]();});}};}function handleEntityNotFound(_0x1b9994){return function(_0x2ce89a){if(!_0x2ce89a){_0x1b9994[_0xfa23('0x11')](0x194);}return _0x2ce89a;};}function handleError(_0x31eedb,_0x485838){_0x485838=_0x485838||0x1f4;return function(_0x147228){logger[_0xfa23('0x1c')](_0x147228[_0xfa23('0x1d')]);if(_0x147228[_0xfa23('0x1e')]){delete _0x147228['name'];}_0x31eedb[_0xfa23('0x12')](_0x485838)['send'](_0x147228);};}function getInteractionUsers(_0x34ecab,_0x1abb42){return new BPromise(function(_0x2481e9,_0x26bdce){try{if(_0x1abb42[_0x34ecab['id']]){_0x34ecab[_0xfa23('0x1f')]=_[_0xfa23('0x20')](_0x1abb42[_0x34ecab['id']],function(_0x21bbc0){return{'id':_0x21bbc0['id'],'fullname':_0x21bbc0[_0xfa23('0x21')]};});}}catch(_0x5e1780){_0x26bdce(_0x5e1780);}_0x2481e9(_0x34ecab);});}function getInteractionTags(_0x2ae826,_0x4ab34d){return new BPromise(function(_0x1ae38a,_0x5de208){try{if(_0x2ae826['TagIds']){_0x2ae826[_0xfa23('0x22')]=[];_0x2ae826[_0xfa23('0x23')][_0xfa23('0x24')](',')[_0xfa23('0x25')](function(_0x374169){_0x2ae826[_0xfa23('0x22')][_0xfa23('0x26')](_0x4ab34d[_0x374169]);});}delete _0x2ae826['TagIds'];}catch(_0x591797){_0x5de208(_0x591797);}_0x1ae38a(_0x2ae826);});}function getLastMessageText(_0x47ced6){return new BPromise(function(_0x380d42,_0x6bf719){return db['MailMessage'][_0xfa23('0x27')]({'where':{'$and':[{'MailInteractionId':_0x47ced6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xfa23('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xfa23('0x29')],'order':_0xfa23('0x2a'),'raw':!![]})[_0xfa23('0x1b')](function(_0x16393f){if(_0x16393f&&_0x16393f[_0xfa23('0x29')]){_0x47ced6[_0xfa23('0x2b')]=_[_0xfa23('0x2c')](_0x16393f['plainBody']);}_0x380d42(_0x47ced6);})[_0xfa23('0x2d')](function(_0x59c393){_0x6bf719(_0x59c393);});});}function updateMailInteraction(_0x9d0602,_0x41d235,_0x451e40,_0xaa1d77){return new BPromise(function(_0x1801f1,_0x8ac724){return getInteractionUsers(_0x9d0602,_0x451e40)[_0xfa23('0x1b')](function(_0x33aa43){return getInteractionTags(_0x33aa43,_0x41d235);})[_0xfa23('0x1b')](function(_0x59aa98){return getStateInteraction(_0x59aa98);})[_0xfa23('0x1b')](function(_0x4e82a3){if(_0xaa1d77){_0x1801f1(getLastMessageText(_0x4e82a3));}else{_0x1801f1(_0x4e82a3);}})[_0xfa23('0x2d')](function(_0x88a593){_0x8ac724(_0x88a593);});});}function getStateInteraction(_0x17c407){return new BPromise(function(_0x30ea1e){_0x17c407[_0xfa23('0x2e')]=0x0;_0x17c407[_0xfa23('0x2f')]=0x0;_0x17c407[_0xfa23('0x30')]=0x0;_0x17c407['unmanaged']=0x0;_0x17c407[_0xfa23('0x31')]=0x0;if(!_0x17c407[_0xfa23('0x32')]&&!_0x17c407[_0xfa23('0x33')]){_0x17c407[_0xfa23('0x2e')]+=0x1;}if(!_0x17c407['closed']&&_0x17c407['UserId']){_0x17c407['talking']+=0x1;if(_0x17c407[_0xfa23('0x2e')]){_0x17c407[_0xfa23('0x2e')]-=0x1;}}if(_0x17c407['closed']&&_0x17c407[_0xfa23('0x33')]){_0x17c407[_0xfa23('0x30')]+=0x1;if(_0x17c407[_0xfa23('0x2f')]){_0x17c407['talking']-=0x1;}}if(_0x17c407[_0xfa23('0x32')]&&!_0x17c407['UserId']){_0x17c407[_0xfa23('0x34')]+=0x1;if(_0x17c407[_0xfa23('0x2e')]){_0x17c407[_0xfa23('0x2e')]-=0x1;}}_0x17c407[_0xfa23('0x31')]+=0x1;_0x30ea1e(_0x17c407);});}exports[_0xfa23('0x35')]=function(_0x80827f,_0x58fc41){var _0xe546db={},_0x3c4743={},_0x43eb23={'count':0x0,'rows':[]};var _0x245f49=_['map'](db[_0xfa23('0x36')][_0xfa23('0x37')],function(_0x15480c){return{'name':_0x15480c[_0xfa23('0x38')],'type':_0x15480c[_0xfa23('0x39')][_0xfa23('0x3a')]};});_0x3c4743['model']=_[_0xfa23('0x20')](_0x245f49,'name');_0x3c4743['query']=_[_0xfa23('0x3b')](_0x80827f[_0xfa23('0x3c')]);_0x3c4743['filters']=_[_0xfa23('0x3d')](_0x3c4743[_0xfa23('0x3e')],_0x3c4743[_0xfa23('0x3c')]);_0xe546db['attributes']=_[_0xfa23('0x3d')](_0x3c4743[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x80827f['query']['fields']));_0xe546db[_0xfa23('0x40')]=_0xe546db['attributes'][_0xfa23('0x41')]?_0xe546db[_0xfa23('0x40')]:_0x3c4743[_0xfa23('0x3e')];if(!_0x80827f['query'][_0xfa23('0x42')](_0xfa23('0x43'))){_0xe546db[_0xfa23('0x15')]=qs[_0xfa23('0x15')](_0x80827f['query'][_0xfa23('0x15')]);_0xe546db[_0xfa23('0x14')]=qs[_0xfa23('0x14')](_0x80827f['query']['offset']);}_0xe546db[_0xfa23('0x44')]=qs['sort'](_0x80827f[_0xfa23('0x3c')][_0xfa23('0x45')]);_0xe546db[_0xfa23('0x46')]=qs[_0xfa23('0x47')](_[_0xfa23('0x48')](_0x80827f[_0xfa23('0x3c')],_0x3c4743['filters']),_0x245f49);var _0xd2345d=[];var _0x1ca7c3=squel[_0xfa23('0x49')]()[_0xfa23('0x4a')]('id')[_0xfa23('0x4a')](_0xfa23('0x1e'))['field'](_0xfa23('0x4b'))[_0xfa23('0x4c')](_0xfa23('0x4d'));var _0x2f6a37=squel[_0xfa23('0x49')]()['field'](_0xfa23('0x4e'))[_0xfa23('0x4a')](_0xfa23('0x4f'))['field'](_0xfa23('0x50'))[_0xfa23('0x4c')](_0xfa23('0x51'),'ui')[_0xfa23('0x52')](_0xfa23('0x53'),'u',_0xfa23('0x54'));var _0x709755=squel['select']()[_0xfa23('0x4c')]('mail_interactions','i')[_0xfa23('0x52')](_0xfa23('0x55'),'c',_0xfa23('0x56'))[_0xfa23('0x52')](_0xfa23('0x53'),'o',_0xfa23('0x57'))['left_join'](_0xfa23('0x58'),'a',_0xfa23('0x59'))[_0xfa23('0x52')](_0xfa23('0x5a'),'me',_0xfa23('0x5b'))[_0xfa23('0x52')](_0xfa23('0x5c'),'it','it.MailInteractionId\x20=\x20i.id')[_0xfa23('0x52')](_0xfa23('0x4d'),'t',_0xfa23('0x5d'));var _0xd64189=squel['expr']();var _0xbb8b7d=[];var _0x9bf852=squel[_0xfa23('0x5e')]();var _0x26e171;if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x5f')]){_0x26e171=as['parseSearch'](_0x80827f[_0xfa23('0x3c')]['search']);var _0x476fdc=_0x26e171[_0xfa23('0x60')];for(var _0x595cdb=0x0;_0x595cdb<_0x26e171[_0xfa23('0x61')][_0xfa23('0x41')];_0x595cdb++){var _0x5a5397=_0x26e171[_0xfa23('0x61')][_0x595cdb];var _0xb9b7d8='i';var _0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),_0x5a5397[_0xfa23('0x4a')]]);if(!_0x5d3777){switch(_0x5a5397[_0xfa23('0x4a')]){case'unreadMessages':if(_0x5a5397[_0xfa23('0x63')]==0x1){_0x709755[_0xfa23('0x64')]('`'+_0x5a5397['field']+_0xfa23('0x65'));}else{_0x709755[_0xfa23('0x64')]('`'+_0x5a5397[_0xfa23('0x4a')]+_0xfa23('0x66'));}break;case _0xfa23('0x67'):if(_0x5a5397[_0xfa23('0x68')]==='$substring'){if(_0x5a5397[_0xfa23('0x63')][_0xfa23('0x24')]('\x20')[_0xfa23('0x41')]>0x1){_0xd64189[_0x476fdc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfa23('0x69')](_0x5a5397[_0xfa23('0x63')]),null);}else{var _0x1ea6a1='%'+_0x5a5397['value']+'%';_0xd64189[_0x476fdc](_0xfa23('0x6a'),_0x1ea6a1,_0x1ea6a1,_0x1ea6a1);}}else{_0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),_0xfa23('0x6b')]);_0x5a5397[_0xfa23('0x4a')]='ContactId';_0x4c2103=as['buildExpression'](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103[_0xfa23('0x6c')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103['value']['end']);}break;case _0xfa23('0x6e'):var _0x303ee9=_0x5a5397[_0xfa23('0x63')][_0xfa23('0x24')](',')['map'](function(_0x41ac7a){return Number(_0x41ac7a);});_0x303ee9[_0xfa23('0x25')](function(_0x4b1545){_0x9bf852['or'](_0xfa23('0x6f'),'%,'+_0x4b1545+',%');});_0xbb8b7d=_[_0xfa23('0x70')](_0xbb8b7d,_0x303ee9);break;case'User':if(_0x5a5397[_0xfa23('0x68')]===_0xfa23('0x71')){_0xd64189[_0x476fdc](_0xfa23('0x72'),'%'+_0x5a5397[_0xfa23('0x63')]+'%',null);}else{_0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),'UserId']);_0x5a5397[_0xfa23('0x4a')]='UserId';_0x4c2103=as[_0xfa23('0x73')](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103[_0xfa23('0x6c')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);}break;case _0xfa23('0x29'):_0x4c2103=as[_0xfa23('0x73')]('me',null,_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103['text'],_0x4c2103[_0xfa23('0x63')]['start'],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);break;}}else{var _0x4c2103=as['buildExpression'](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103['text'],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);}}}else{var _0x3d0f94=_(_0x80827f[_0xfa23('0x3c')])[_0xfa23('0x3b')]()['map'](function(_0x57a71c){return _[_0xfa23('0x74')](_0x245f49,[_0xfa23('0x1e'),_0x57a71c])?_0x57a71c:undefined;})[_0xfa23('0x75')]()[_0xfa23('0x63')]();if(!_['isEmpty'](_0x3d0f94)){_0x3d0f94[_0xfa23('0x25')](function(_0x4d3144){if(_0x4d3144===_0xfa23('0x76')){_0x709755[_0xfa23('0x46')](_0xfa23('0x77'),[][_0xfa23('0x78')](_0x80827f[_0xfa23('0x3c')][_0x4d3144]));}else if(_0x4d3144===_0xfa23('0x79')){var _0x19c67f=JSON[_0xfa23('0x7a')](_0x80827f[_0xfa23('0x3c')][_0x4d3144])[_0xfa23('0x7b')];var _0x5c3a1e=JSON['parse'](_0x80827f[_0xfa23('0x3c')][_0x4d3144])['$lte'];_0x709755[_0xfa23('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19c67f,_0x5c3a1e);}else{if(_0x80827f[_0xfa23('0x3c')][_0x4d3144]===_0xfa23('0x7c')){_0x709755['where']('i.'+_0x4d3144+_0xfa23('0x7d'));}else{_0x709755['where']('i.'+_0x4d3144+'\x20=\x20?',_0x80827f[_0xfa23('0x3c')][_0x4d3144]);}}});}if(_0x80827f[_0xfa23('0x3c')]['read']){if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x7e')]==0x1){_0x709755[_0xfa23('0x64')](_0xfa23('0x7f'));}else{_0x709755[_0xfa23('0x64')](_0xfa23('0x80'));}}if(_0x80827f[_0xfa23('0x3c')]['tag']){_0xbb8b7d=_[_0xfa23('0x81')](_0x80827f[_0xfa23('0x3c')][_0xfa23('0x82')])?_0x80827f[_0xfa23('0x3c')][_0xfa23('0x82')]:new Array(_0x80827f['query'][_0xfa23('0x82')]);_0xbb8b7d['forEach'](function(_0x5bb05f){_0x9bf852['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5bb05f+',%');});}if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x83')]){var _0x1b12af=_0x80827f['query'][_0xfa23('0x83')][_0xfa23('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xfa23('0x85')](_0x1b12af)){_0xd64189['or'](_0xfa23('0x86'),_0x1b12af+'%');}else if(qs[_0xfa23('0x87')](_0x1b12af)){_0xd64189['or'](_0xfa23('0x88'),_0x1b12af+'%');}else{_0xd64189['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1b12af))['or'](_0xfa23('0x89'),qs['getFullTextValue'](_0x1b12af));}}}_0x709755[_0xfa23('0x46')](_0xd64189);_0x709755[_0xfa23('0x8a')](_0xfa23('0x8b'));var _0x4a77e5={'type':db[_0xfa23('0x8c')][_0xfa23('0x8d')][_0xfa23('0x8e')],'raw':!![]};var _0xcf4b16=_0x709755[_0xfa23('0x8f')]();_0xcf4b16[_0xfa23('0x4a')]('i.id');_0xcf4b16[_0xfa23('0x4a')](_0xfa23('0x90'),_0xfa23('0x91'));if(_0xe546db[_0xfa23('0x44')]){_0xe546db[_0xfa23('0x44')][_0xfa23('0x25')](function(_0x56b78d){var _0x11b3fa=_0x56b78d[0x0]===_0xfa23('0x92')?_0x56b78d[0x0]:'i.'+_0x56b78d[0x0];_0x709755['order'](_0x11b3fa,_0x56b78d[0x1]===_0xfa23('0x93')?![]:!![]);});}if(!_[_0xfa23('0x94')](_0xbb8b7d)){_0x709755[_0xfa23('0x64')](_0x9bf852);_0xcf4b16[_0xfa23('0x46')](_0xfa23('0x95'),_0xbb8b7d);}BPromise['resolve']()[_0xfa23('0x1b')](function(){if(!_0x26e171){if(_0x80827f['query']['MailAccountId'])return;_0xcf4b16['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x709755[_0xfa23('0x46')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x80827f[_0xfa23('0x96')][_0xfa23('0x97')]!==_0xfa23('0x98'))return;return _0x80827f[_0xfa23('0x96')][_0xfa23('0x99')]({'attributes':['id'],'raw':!![]})[_0xfa23('0x1b')](function(_0x23c6f4){if(_[_0xfa23('0x94')](_0x23c6f4)){_0xcf4b16['where'](_0xfa23('0x9a'));_0x709755['where'](_0xfa23('0x9a'));}else{_0xcf4b16[_0xfa23('0x46')]('i.MailAccountId\x20IN\x20?',_[_0xfa23('0x20')](_0x23c6f4,'id'));_0x709755[_0xfa23('0x46')]('i.MailAccountId\x20IN\x20?',_[_0xfa23('0x20')](_0x23c6f4,'id'));}});})['then'](function(){if(_0x80827f[_0xfa23('0x96')]['role']===_0xfa23('0x98')&&!_0x26e171&&!_0x80827f['query'][_0xfa23('0x76')])return[];return db[_0xfa23('0x9b')]['query'](_0xcf4b16[_0xfa23('0x9c')](),_0x4a77e5);})[_0xfa23('0x1b')](function(_0x1787b5){_0x43eb23['count']=_0x1787b5[_0xfa23('0x41')];if(_0x43eb23['count']===0x0)return[];return db[_0xfa23('0x9b')][_0xfa23('0x3c')](_0x1ca7c3[_0xfa23('0x9c')](),_0x4a77e5)[_0xfa23('0x1b')](function(_0x58f34e){_0xd2345d=_[_0xfa23('0x9d')](_0x58f34e,'id');_0x4a77e5=_['merge'](_0x4a77e5,{'model':db[_0xfa23('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x80827f['query'][_0xfa23('0x3f')]){_0xe546db[_0xfa23('0x40')][_0xfa23('0x25')](function(_0x376b22){_0x709755[_0xfa23('0x4a')]('i.'+_0x376b22);});}else{_0x709755['field'](_0xfa23('0x90'),'unreadMessages');_0x709755['field'](_0xfa23('0x9e'),_0xfa23('0x9f'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa0'),'Account.mandatoryDisposition');_0x709755[_0xfa23('0x4a')](_0xfa23('0xa1'),_0xfa23('0x92'));_0x709755[_0xfa23('0x4a')](_0xfa23('0x8b'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa2'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa3'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa4'));_0x709755[_0xfa23('0x4a')]('i.closedAt');_0x709755[_0xfa23('0x4a')](_0xfa23('0xa5'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa6'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa7'));_0x709755[_0xfa23('0x4a')]('i.subject');_0x709755[_0xfa23('0x4a')]('i.disposition');_0x709755['field']('i.secondDisposition');_0x709755['field'](_0xfa23('0xa8'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa9'));_0x709755['field'](_0xfa23('0xaa'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xab'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xac'));_0x709755['field'](_0xfa23('0xad'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xae'),_0xfa23('0xaf'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb0'),'Contact.lastName');_0x709755['field']('c.email','Contact.email');_0x709755[_0xfa23('0x4a')](_0xfa23('0xb1'),_0xfa23('0xb2'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb3'),'Contact.mobile');_0x709755[_0xfa23('0x4a')](_0xfa23('0xb4'),_0xfa23('0xb5'));_0x709755['field'](_0xfa23('0xb6'),'Owner.fullname');_0x709755['field'](_0xfa23('0xb7'),_0xfa23('0xb8'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb9'),'TagIds');}if(_0xe546db[_0xfa23('0x15')])_0x709755[_0xfa23('0x15')](_0xe546db['limit']);if(_0xe546db[_0xfa23('0x14')])_0x709755[_0xfa23('0x14')](_0xe546db['offset']);return db['sequelize'][_0xfa23('0x3c')](_0x709755['toString'](),_0x4a77e5);})[_0xfa23('0x1b')](function(_0x3d5a10){if(_0x3d5a10[_0xfa23('0x41')]>0x0)_0x2f6a37[_0xfa23('0x46')](_0xfa23('0xba'),_[_0xfa23('0x20')](_0x3d5a10,'id'));return db[_0xfa23('0x9b')][_0xfa23('0x3c')](_0x2f6a37[_0xfa23('0x9c')](),_0x4a77e5)[_0xfa23('0x1b')](function(_0x11fce6){var _0x4c0059=_[_0xfa23('0xbb')](_0x11fce6,_0xfa23('0xbc'));var _0x48a314=[];return db[_0xfa23('0xbd')][_0xfa23('0x27')]({'attributes':[_0xfa23('0xbe')],'raw':!![]})[_0xfa23('0x1b')](function(_0x49ab16){var _0x55c627=_0x49ab16[_0xfa23('0xbe')];_0x3d5a10[_0xfa23('0x25')](function(_0x289e3b){_0x48a314[_0xfa23('0x26')](updateMailInteraction(_0x289e3b,_0xd2345d,_0x4c0059,_0x55c627));});return BPromise['all'](_0x48a314);});});});})['then'](function(_0x393695){_0x43eb23[_0xfa23('0xbf')]=_0x393695;return _0x43eb23;})[_0xfa23('0x1b')](respondWithFilteredResult(_0x58fc41,_0xe546db))['catch'](handleError(_0x58fc41,null));};exports[_0xfa23('0xc0')]=function(_0x123824,_0x4909a5){var _0x40f83b={'raw':![],'where':{'id':_0x123824[_0xfa23('0xc1')]['id']}},_0x56b6c8={};_0x56b6c8[_0xfa23('0x3e')]=_[_0xfa23('0x3b')](db[_0xfa23('0x36')][_0xfa23('0x37')]);_0x56b6c8[_0xfa23('0x3c')]=_[_0xfa23('0x3b')](_0x123824['query']);_0x56b6c8['filters']=_[_0xfa23('0x3d')](_0x56b6c8[_0xfa23('0x3e')],_0x56b6c8[_0xfa23('0x3c')]);_0x40f83b['attributes']=_[_0xfa23('0x3d')](_0x56b6c8[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x123824[_0xfa23('0x3c')][_0xfa23('0x3f')]));_0x40f83b[_0xfa23('0x40')]=_0x40f83b[_0xfa23('0x40')][_0xfa23('0x41')]?_0x40f83b['attributes']:_0x56b6c8[_0xfa23('0x3e')];if(_0x123824[_0xfa23('0x3c')][_0xfa23('0xc2')]){_0x40f83b[_0xfa23('0xc3')]=[{'all':!![]}];}_0x40f83b=_[_0xfa23('0xc4')]({},_0x40f83b,_0x123824[_0xfa23('0xc5')]);return db['MailInteraction'][_0xfa23('0x62')](_0x40f83b)[_0xfa23('0x1b')](handleEntityNotFound(_0x4909a5,null))['then'](respondWithResult(_0x4909a5,null))[_0xfa23('0x2d')](handleError(_0x4909a5,null));};exports[_0xfa23('0xc6')]=function(_0x88da46,_0x2229fe){return db[_0xfa23('0x36')][_0xfa23('0xc6')](_0x88da46[_0xfa23('0xc7')],{})[_0xfa23('0x1b')](respondWithResult(_0x2229fe,0xc9))[_0xfa23('0x2d')](handleError(_0x2229fe,null));};exports[_0xfa23('0x1a')]=function(_0x3c0c1a,_0xa57d4e){if(_0x3c0c1a[_0xfa23('0xc7')]['id']){delete _0x3c0c1a[_0xfa23('0xc7')]['id'];}return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x3c0c1a[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0xa57d4e,null))[_0xfa23('0x1b')](saveUpdates(_0x3c0c1a[_0xfa23('0xc7')],null))[_0xfa23('0x1b')](respondWithResult(_0xa57d4e,null))['catch'](handleError(_0xa57d4e,null));};exports[_0xfa23('0xc8')]=function(_0x37146b,_0x3116f6){return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x37146b['params']['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x3116f6,null))[_0xfa23('0x1b')](removeEntity(_0x3116f6,null))['catch'](handleError(_0x3116f6,null));};exports[_0xfa23('0xc9')]=function(_0x459318,_0xd1193a){return db[_0xfa23('0x36')][_0xfa23('0xc9')]()[_0xfa23('0x1b')](respondWithResult(_0xd1193a,null))['catch'](handleError(_0xd1193a,null));};exports[_0xfa23('0xca')]=function(_0x3ca789,_0x3b6730){return db[_0xfa23('0xcb')][_0xfa23('0x62')]({'where':{'id':_0x3ca789[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x3b6730,null))[_0xfa23('0x1b')](function(_0x17a179){if(_0x17a179){return _0x17a179['addMessage'](_0x3ca789[_0xfa23('0xc7')][_0xfa23('0xcc')],_[_0xfa23('0xcd')](_0x3ca789['body'],[_0xfa23('0xcc'),'id'])||{});}})[_0xfa23('0x1b')](respondWithResult(_0x3b6730,null))[_0xfa23('0x2d')](handleError(_0x3b6730,null));};exports[_0xfa23('0xce')]=function(_0x34c78d,_0x4542ed){var _0x288500={'raw':![],'where':{}};var _0x2c040d={};var _0x1c4467={'count':0x0,'rows':[]};return db[_0xfa23('0x36')]['findOne']({'where':{'id':_0x34c78d[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x4542ed,null))['then'](function(_0x48f2ee){if(_0x48f2ee){_0x2c040d[_0xfa23('0x3e')]=_[_0xfa23('0x3b')](db[_0xfa23('0xcb')][_0xfa23('0x37')]);_0x2c040d['query']=_[_0xfa23('0x3b')](_0x34c78d['query']);_0x2c040d[_0xfa23('0x47')]=_[_0xfa23('0x3d')](_0x2c040d[_0xfa23('0x3e')],_0x2c040d[_0xfa23('0x3c')]);_0x288500['attributes']=_[_0xfa23('0x3d')](_0x2c040d[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x3f')]));_0x288500[_0xfa23('0x40')]=_0x288500[_0xfa23('0x40')][_0xfa23('0x41')]?_0x288500['attributes']:_0x2c040d['model'];if(!_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x42')](_0xfa23('0x43'))){_0x288500[_0xfa23('0x15')]=qs[_0xfa23('0x15')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x15')]);_0x288500[_0xfa23('0x14')]=qs[_0xfa23('0x14')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x14')]);}_0x288500[_0xfa23('0x44')]=qs[_0xfa23('0x45')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x45')]);_0x288500['where']=qs['filters'](_['pick'](_0x34c78d[_0xfa23('0x3c')],_0x2c040d['filters']));_0x288500[_0xfa23('0x46')][_0xfa23('0xbc')]=_0x48f2ee['id'];if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x83')]){_0x288500['where']=_[_0xfa23('0xc4')](_0x288500['where'],{'$or':_[_0xfa23('0x20')](_0x288500['attributes'],function(_0x2fc119){var _0x274067={};_0x274067[_0x2fc119]={'$like':'%'+_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x83')]+'%'};return _0x274067;})});}if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x7b')]){var _0x3a1762=_0x34c78d[_0xfa23('0x3c')]['$gte'][_0xfa23('0x24')](',');var _0xd31f63={};_0xd31f63[_0x3a1762[0x0]]={'$gte':moment(_0x3a1762[0x1])[_0xfa23('0xcf')](_0xfa23('0xd0'))};_0x288500['where']=_[_0xfa23('0xc4')](_0x288500[_0xfa23('0x46')],_0xd31f63);}_0x288500=_[_0xfa23('0xc4')]({},_0x288500,_0x34c78d[_0xfa23('0xc5')]);return db[_0xfa23('0xcb')][_0xfa23('0x17')]({'where':_0x288500[_0xfa23('0x46')]})[_0xfa23('0x1b')](function(_0x341fb7){_0x1c4467['count']=_0x341fb7;if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0xc2')]){_0x288500[_0xfa23('0xc3')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x288500);})[_0xfa23('0x1b')](function(_0x2d0233){if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0xd1')]===_0xfa23('0xd2')){for(var _0x3e0a20=0x0;_0x3e0a20<_0x2d0233['length'];_0x3e0a20++){_0x2d0233[_0x3e0a20][_0xfa23('0xc7')]=juice(_0x2d0233[_0x3e0a20][_0xfa23('0xc7')]);}}_0x1c4467['rows']=_0x2d0233;return _0x1c4467;});}})[_0xfa23('0x1b')](respondWithFilteredResult(_0x4542ed,_0x288500))[_0xfa23('0x2d')](handleError(_0x4542ed,null));};exports[_0xfa23('0xd3')]=function(_0x1a6be6,_0x415741){return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x1a6be6['params']['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x415741,null))[_0xfa23('0x1b')](function(_0x468604){if(_0x468604){return _0x468604['setTags'](_0x1a6be6[_0xfa23('0xc7')]['ids'],_[_0xfa23('0xcd')](_0x1a6be6[_0xfa23('0xc7')],[_0xfa23('0xcc'),'id'])||{})[_0xfa23('0xd4')](function(){return db[_0xfa23('0x6e')]['findAll']({'attributes':['id',_0xfa23('0x1e'),_0xfa23('0x4b')],'where':{'id':_0x1a6be6[_0xfa23('0xc7')][_0xfa23('0xcc')]}});})[_0xfa23('0x1b')](function(_0x1a93ba){socket[_0xfa23('0xd5')](_0xfa23('0xd6'),{'id':Number(_0x1a6be6['params']['id']),'tags':_0x1a93ba||[]});return{'id':Number(_0x1a6be6[_0xfa23('0xc1')]['id']),'tags':_0x1a93ba||[]};});}})['then'](respondWithResult(_0x415741,null))[_0xfa23('0x2d')](handleError(_0x415741,null));};exports[_0xfa23('0xd7')]=function(_0x1e8cae,_0x45e847){return db[_0xfa23('0x36')]['find']({'where':{'id':_0x1e8cae[_0xfa23('0xc1')]['id']}})['then'](handleEntityNotFound(_0x45e847,null))[_0xfa23('0x1b')](function(_0x11bc79){if(_0x11bc79){return _0x11bc79[_0xfa23('0xd7')](_0x1e8cae[_0xfa23('0x3c')][_0xfa23('0xcc')]);}})[_0xfa23('0x1b')](respondWithStatusCode(_0x45e847,null))[_0xfa23('0x2d')](handleError(_0x45e847,null));};exports[_0xfa23('0xd8')]=function(_0x26581e,_0x18effe){var _0x55dd79=moment()[_0xfa23('0xd9')]()[_0xfa23('0x9c')]();var _0x1b0f19=path[_0xfa23('0xda')](config[_0xfa23('0xdb')],'server',_0xfa23('0xdc'),_0xfa23('0xdd'));var _0x20bb3a=path[_0xfa23('0xda')](config[_0xfa23('0xdb')],'server',_0xfa23('0xdc'),_0xfa23('0xde'));var _0x3ff523=path[_0xfa23('0xda')](_0x1b0f19,_0x55dd79);var _0x381290=util['format'](_0xfa23('0xdf'),_0x26581e['params']['id'],_0x55dd79);var _0x55dc5f=path['join'](_0x1b0f19,_0x381290);var _0x37ba1a=[];if(_0x26581e['query']['attachments']){_0x37ba1a[_0xfa23('0x26')]({'model':db[_0xfa23('0xe0')],'as':_0xfa23('0xe1'),'raw':!![]});}var _0xf39a18=[{'model':db[_0xfa23('0xcb')],'as':_0xfa23('0xe2'),'attributes':['id',_0xfa23('0xc7'),_0xfa23('0x4c'),'to','cc',_0xfa23('0xe3'),_0xfa23('0xe4'),_0xfa23('0x79')],'where':{'secret':![]},'order':qs[_0xfa23('0x45')]('id'),'include':_0x37ba1a}];return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x26581e[_0xfa23('0xc1')]['id']},'include':_0xf39a18})[_0xfa23('0x1b')](handleEntityNotFound(_0x18effe,null))[_0xfa23('0x1b')](function(_0x4ec3c5){if(_0x4ec3c5&&_0x4ec3c5[_0xfa23('0xe2')]){var _0x48e4e0=_0x4ec3c5[_0xfa23('0xe5')]({'plain':!![]});fs[_0xfa23('0xe6')](_0x3ff523);return BPromise['each'](_0x48e4e0[_0xfa23('0xe2')],function(_0x19111c,_0x235ea6){var _0xdb3e45={'from':_0x19111c[_0xfa23('0x4c')],'to':_0x19111c['to'],'subject':_0x19111c[_0xfa23('0xe4')],'html':htmlEntities[_0xfa23('0xe7')](_0x19111c[_0xfa23('0xc7')]),'headers':{'Date':moment(_0x19111c[_0xfa23('0x79')])[_0xfa23('0xcf')](_0xfa23('0xe8'))},'attachments':[]};if(_0x19111c['cc']){_0xdb3e45[_0xfa23('0xe9')]['Cc']=_0x19111c['cc'];}if(_0x19111c[_0xfa23('0xe3')]){_0xdb3e45['headers'][_0xfa23('0xea')]=_0x19111c[_0xfa23('0xe3')];}return new BPromise(function(_0x1ed7c5,_0x550424){if(_0x19111c[_0xfa23('0xe1')]){for(var _0x2aa3a5=0x0;_0x2aa3a5<_0x19111c[_0xfa23('0xe1')][_0xfa23('0x41')];_0x2aa3a5++){var _0x1d50ef=_0x19111c[_0xfa23('0xe1')][_0x2aa3a5];var _0x55f89c=path[_0xfa23('0xda')](_0x20bb3a,_0x1d50ef['basename']);if(fs[_0xfa23('0xeb')](_0x55f89c)){_0xdb3e45[_0xfa23('0xde')]['push']({'name':_0x1d50ef[_0xfa23('0x1e')],'contentType':_0x1d50ef[_0xfa23('0x39')],'data':fs[_0xfa23('0xec')](_0x55f89c)});}}}emlformat['build'](_0xdb3e45,function(_0x796110,_0x47cb3e){if(_0x796110)return _0x550424(_0x796110);fs[_0xfa23('0xed')](path['join'](_0x3ff523,util[_0xfa23('0xcf')](_0xfa23('0xee'),_0x235ea6)),_0x47cb3e);return _0x1ed7c5(_0x47cb3e);});});})[_0xfa23('0x1b')](function(){return new BPromise(function(_0x14892d,_0x3c9c27){zipdir(_0x3ff523,{'saveTo':_0x55dc5f},function(_0x4e9855,_0x3d6b2f){if(_0x4e9855)return _0x3c9c27(_0x4e9855);return _0x14892d(_0x3d6b2f);});})[_0xfa23('0x1b')](function(){return new BPromise(function(_0xe2aa6c,_0xdf540f){rimraf(_0x3ff523,function(_0x244672){if(_0x244672)_0xdf540f(_0x244672);return _0xe2aa6c();});});})['then'](function(){return _0x18effe['download'](_0x55dc5f,_0x381290,function(_0x188ce1){if(!_0x188ce1)fs['unlinkSync'](_0x55dc5f);});});});}else{return _0x18effe['sendStatus'](0xc8);}})[_0xfa23('0x2d')](handleError(_0x18effe,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a532e9b..3ecc4b0 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa43a=['getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa43a,0xe3));var _0xaa43=function(_0x1554a1,_0x4f0476){_0x1554a1=_0x1554a1-0x0;var _0x114b56=_0xa43a[_0x1554a1];return _0x114b56;};'use strict';var EventEmitter=require(_0xaa43('0x0'));var MailInteraction=require(_0xaa43('0x1'))['db'][_0xaa43('0x2')];var MailMessage=require(_0xaa43('0x1'))['db'][_0xaa43('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xaa43('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa43('0x5'),'afterDestroy':_0xaa43('0x6')};function emitEvent(_0x3bfdc3){return function(_0x956ace,_0x4ae894,_0x4b85a6){_0x956ace[_0xaa43('0x7')]({'attributes':['id'],'raw':!![]})[_0xaa43('0x8')](function(_0x1107d1){_0x956ace[_0xaa43('0x9')]('Users',_0x1107d1[_0xaa43('0xa')](function(_0x1a11de){return{'id':_0x1a11de['id']};}));return MailMessage[_0xaa43('0xb')]({'where':{'MailInteractionId':_0x956ace['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ebd94){_0x956ace[_0xaa43('0x9')](_0xaa43('0xc'),_0x4ebd94[_0xaa43('0xd')]);MailInteractionEvents[_0xaa43('0xe')](_0x3bfdc3+':'+_0x956ace['id'],_0x956ace);MailInteractionEvents[_0xaa43('0xe')](_0x3bfdc3,_0x956ace);_0x4b85a6(null);})['catch'](_0x4b85a6(null));};}for(var e in events){if(events[_0xaa43('0xf')](e)){var event=events[e];MailInteraction[_0xaa43('0x10')](e,emitEvent(event));}}module[_0xaa43('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x2fb5=['length','catch','hook','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages'];(function(_0x38d6f3,_0x10ed5f){var _0x7f389e=function(_0x39dfa3){while(--_0x39dfa3){_0x38d6f3['push'](_0x38d6f3['shift']());}};_0x7f389e(++_0x10ed5f);}(_0x2fb5,0xff));var _0x52fb=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x2fb5[_0x2ef44b];return _0x2405b9;};'use strict';var EventEmitter=require(_0x52fb('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x52fb('0x1'))['db'][_0x52fb('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x52fb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x52fb('0x4'),'afterDestroy':_0x52fb('0x5')};function emitEvent(_0x2a556a){return function(_0x386e07,_0x4fc417,_0x148eab){_0x386e07['getUsers']({'attributes':['id'],'raw':!![]})[_0x52fb('0x6')](function(_0xa3e4ec){_0x386e07[_0x52fb('0x7')](_0x52fb('0x8'),_0xa3e4ec[_0x52fb('0x9')](function(_0x32a7bb){return{'id':_0x32a7bb['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x386e07['id'],'direction':'in','read':![]},'raw':!![]});})[_0x52fb('0x6')](function(_0x564f94){_0x386e07[_0x52fb('0x7')](_0x52fb('0xa'),_0x564f94[_0x52fb('0xb')]);MailInteractionEvents['emit'](_0x2a556a+':'+_0x386e07['id'],_0x386e07);MailInteractionEvents['emit'](_0x2a556a,_0x386e07);_0x148eab(null);})[_0x52fb('0xc')](_0x148eab(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x52fb('0xd')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d490f55..db7e70e 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09a2=['YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x09a2,0x11e));var _0x209a=function(_0x2312fd,_0x1a4fd4){_0x2312fd=_0x2312fd-0x0;var _0xabeaab=_0x09a2[_0x2312fd];return _0xabeaab;};'use strict';var _=require(_0x209a('0x0'));var util=require(_0x209a('0x1'));var logger=require(_0x209a('0x2'))(_0x209a('0x3'));var moment=require(_0x209a('0x4'));var BPromise=require(_0x209a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x209a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x209a('0x7'));module['exports']=function(_0x4200ea,_0x502357){return _0x4200ea['define'](_0x209a('0x8'),attributes,{'tableName':_0x209a('0x9'),'paranoid':![],'indexes':[{'name':_0x209a('0xa'),'fields':['subject','to'],'type':_0x209a('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x209572,_0x143e50,_0xeb5e75){if(_0x209572[_0x209a('0xc')]){_0x209572[_0x209a('0xd')]=moment()['format'](_0x209a('0xe'));}if(_0x209572[_0x209a('0xf')]){_0x209572[_0x209a('0x10')]=moment()[_0x209a('0x11')](_0x209a('0xe'));}_0xeb5e75(null,_0x143e50);},'beforeUpdate':function(_0x502c88,_0x1b9e41,_0xc47f95){if(_0x502c88[_0x209a('0x12')](_0x209a('0xc'))){_0x502c88['substatusAt']=_0x502c88['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x502c88[_0x209a('0x12')]('closed')){_0x502c88[_0x209a('0x10')]=moment()[_0x209a('0x11')](_0x209a('0xe'));_0x502c88[_0x209a('0xc')]=null;_0x502c88['substatusAt']=null;}_0xc47f95(null,_0x502c88);},'afterUpdate':function(_0x572415,_0x56ab1c,_0x1f7fda){var _0x2ac5a5=_0x4200ea[_0x209a('0x13')];var _0x50bc75=_0x572415[_0x209a('0x14')]({'plain':!![]});if(_0x50bc75[_0x209a('0xf')]){return _0x2ac5a5['MailMessage'][_0x209a('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x50bc75['id']}})[_0x209a('0x16')](function(){_0x1f7fda();})[_0x209a('0x17')](function(_0x201790){_0x1f7fda(_0x201790);});}else{_0x1f7fda();}}},'charset':_0x209a('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xac76=['./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','update','catch','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x2a6b55,_0x20d37b){var _0x4cc1c5=function(_0x18ea07){while(--_0x18ea07){_0x2a6b55['push'](_0x2a6b55['shift']());}};_0x4cc1c5(++_0x20d37b);}(_0xac76,0x15f));var _0x6ac7=function(_0x2e1d3d,_0x719bf0){_0x2e1d3d=_0x2e1d3d-0x0;var _0x3d81df=_0xac76[_0x2e1d3d];return _0x3d81df;};'use strict';var _=require('lodash');var util=require(_0x6ac7('0x0'));var logger=require(_0x6ac7('0x1'))(_0x6ac7('0x2'));var moment=require(_0x6ac7('0x3'));var BPromise=require(_0x6ac7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ac7('0x5'));var attributes=require(_0x6ac7('0x6'));module[_0x6ac7('0x7')]=function(_0x34d645,_0x5333d2){return _0x34d645['define']('MailInteraction',attributes,{'tableName':_0x6ac7('0x8'),'paranoid':![],'indexes':[{'name':_0x6ac7('0x9'),'fields':[_0x6ac7('0xa'),'to'],'type':_0x6ac7('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41c66e,_0x2c3e02,_0x42f203){if(_0x41c66e[_0x6ac7('0xc')]){_0x41c66e[_0x6ac7('0xd')]=moment()['format'](_0x6ac7('0xe'));}if(_0x41c66e[_0x6ac7('0xf')]){_0x41c66e[_0x6ac7('0x10')]=moment()['format'](_0x6ac7('0xe'));}_0x42f203(null,_0x2c3e02);},'beforeUpdate':function(_0x18af4c,_0x3bf19e,_0x10388a){if(_0x18af4c[_0x6ac7('0x11')]('substatus')){_0x18af4c[_0x6ac7('0xd')]=_0x18af4c[_0x6ac7('0xc')]?moment()['format'](_0x6ac7('0xe')):null;}if(_0x18af4c[_0x6ac7('0x11')](_0x6ac7('0xf'))){_0x18af4c['closedAt']=moment()['format'](_0x6ac7('0xe'));_0x18af4c[_0x6ac7('0xc')]=null;_0x18af4c['substatusAt']=null;}_0x10388a(null,_0x18af4c);},'afterUpdate':function(_0x37e1eb,_0x1392d7,_0x2bec51){var _0x39e189=_0x34d645[_0x6ac7('0x12')];var _0x446b3b=_0x37e1eb['get']({'plain':!![]});if(_0x446b3b[_0x6ac7('0xf')]){return _0x39e189['MailMessage'][_0x6ac7('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x446b3b['id']}})['then'](function(){_0x2bec51();})[_0x6ac7('0x14')](function(_0x3f3211){_0x2bec51(_0x3f3211);});}else{_0x2bec51();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index dfb26f7..a7686f9 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89b8=['ids','omit','spread','stringify','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','info','request\x20sent','debug','error','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','AddTagsToMailInteraction','addTags'];(function(_0x347c9d,_0x4c5d84){var _0x590cc8=function(_0x2f29e9){while(--_0x2f29e9){_0x347c9d['push'](_0x347c9d['shift']());}};_0x590cc8(++_0x4c5d84);}(_0x89b8,0x19f));var _0x889b=function(_0x51473d,_0x42b5ce){_0x51473d=_0x51473d-0x0;var _0x395921=_0x89b8[_0x51473d];return _0x395921;};'use strict';var _=require(_0x889b('0x0'));var util=require(_0x889b('0x1'));var moment=require(_0x889b('0x2'));var BPromise=require(_0x889b('0x3'));var rs=require(_0x889b('0x4'));var fs=require('fs');var Redis=require(_0x889b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x889b('0x6'));var logger=require(_0x889b('0x7'))(_0x889b('0x8'));var config=require('../../config/environment');var jayson=require(_0x889b('0x9'));var client=jayson[_0x889b('0xa')][_0x889b('0xb')]({'port':0x232a});config['redis']=_[_0x889b('0xc')](config[_0x889b('0xd')],{'host':_0x889b('0xe'),'port':0x18eb});var socket=require(_0x889b('0xf'))(new Redis(config[_0x889b('0xd')]));require(_0x889b('0x10'))[_0x889b('0x11')](socket);function respondWithRpcPromise(_0x12455a,_0x175c5a,_0x2938fc){return new BPromise(function(_0x373405,_0x176cdd){return client['request'](_0x12455a,_0x2938fc)['then'](function(_0x2dffee){logger[_0x889b('0x12')]('MailInteraction,\x20%s,\x20%s',_0x175c5a,_0x889b('0x13'));logger[_0x889b('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x175c5a,_0x889b('0x13'),JSON['stringify'](_0x2dffee));if(_0x2dffee[_0x889b('0x15')]){if(_0x2dffee[_0x889b('0x15')]['code']===0x1f4){logger[_0x889b('0x15')](_0x889b('0x16'),_0x175c5a,_0x2dffee['error']['message']);return _0x176cdd(_0x2dffee['error'][_0x889b('0x17')]);}logger[_0x889b('0x15')](_0x889b('0x16'),_0x175c5a,_0x2dffee[_0x889b('0x15')][_0x889b('0x17')]);return _0x373405(_0x2dffee[_0x889b('0x15')]['message']);}else{logger[_0x889b('0x12')]('MailInteraction,\x20%s,\x20%s',_0x175c5a,_0x889b('0x13'));_0x373405(_0x2dffee[_0x889b('0x18')][_0x889b('0x17')]);}})[_0x889b('0x19')](function(_0x1e6bd7){logger['error'](_0x889b('0x16'),_0x175c5a,_0x1e6bd7);_0x176cdd(_0x1e6bd7);});});}exports[_0x889b('0x1a')]=function(_0x2c80f9){var _0x39a0d6=this;return new Promise(function(_0x7148d5,_0x13e7b7){return db[_0x889b('0x1b')][_0x889b('0x1c')](_0x2c80f9[_0x889b('0x1d')],{'raw':_0x2c80f9[_0x889b('0x1e')]?_0x2c80f9[_0x889b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c80f9['options']?_0x2c80f9['options'][_0x889b('0x1f')]||null:null,'attributes':_0x2c80f9['options']?_0x2c80f9['options'][_0x889b('0x20')]||null:null,'limit':_0x2c80f9[_0x889b('0x1e')]?_0x2c80f9['options'][_0x889b('0x21')]||null:null})['then'](function(_0xf4907){logger[_0x889b('0x12')](_0x889b('0x1a'),_0x2c80f9);logger[_0x889b('0x14')]('UpdateMailInteraction',_0x2c80f9,JSON['stringify'](_0xf4907));_0x7148d5(_0xf4907);})[_0x889b('0x19')](function(_0x585701){logger[_0x889b('0x15')]('UpdateMailInteraction',_0x585701[_0x889b('0x17')],_0x2c80f9);_0x13e7b7(_0x39a0d6['error'](0x1f4,_0x585701[_0x889b('0x17')]));});});};exports[_0x889b('0x22')]=function(_0x1892ab){return new Promise(function(_0x36efea,_0x1ce3bc){return db['MailInteraction']['find']({'where':_0x1892ab[_0x889b('0x1e')]?_0x1892ab[_0x889b('0x1e')]['where']||null:null})['then'](function(_0x2b1802){if(_0x2b1802){return _0x2b1802[_0x889b('0x23')](_0x1892ab[_0x889b('0x1d')][_0x889b('0x24')],_[_0x889b('0x25')](_0x1892ab[_0x889b('0x1d')],[_0x889b('0x24'),'id'])||{});}})[_0x889b('0x26')](function(_0x53d971){logger['info']('AddTags',_0x1892ab);logger[_0x889b('0x14')]('AddTags',_0x1892ab,JSON[_0x889b('0x27')](_0x53d971));_0x36efea(_0x53d971);})['catch'](function(_0x37a0b6){logger[_0x889b('0x15')](_0x889b('0x28'),_0x37a0b6[_0x889b('0x17')],_0x1892ab);_0x1ce3bc(_this[_0x889b('0x15')](0x1f4,_0x37a0b6['message']));});});}; \ No newline at end of file +var _0x1335=['../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailInteraction','MailInteraction','body','options','limit','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x11e001,_0x1c787f){var _0x5f2890=function(_0x12940d){while(--_0x12940d){_0x11e001['push'](_0x11e001['shift']());}};_0x5f2890(++_0x1c787f);}(_0x1335,0x19c));var _0x5133=function(_0x4a4c01,_0x4be4bc){_0x4a4c01=_0x4a4c01-0x0;var _0x2d2883=_0x1335[_0x4a4c01];return _0x2d2883;};'use strict';var _=require(_0x5133('0x0'));var util=require(_0x5133('0x1'));var moment=require(_0x5133('0x2'));var BPromise=require('bluebird');var rs=require(_0x5133('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5133('0x4'))['db'];var utils=require(_0x5133('0x5'));var logger=require(_0x5133('0x6'))(_0x5133('0x7'));var config=require('../../config/environment');var jayson=require(_0x5133('0x8'));var client=jayson[_0x5133('0x9')][_0x5133('0xa')]({'port':0x232a});config['redis']=_[_0x5133('0xb')](config['redis'],{'host':_0x5133('0xc'),'port':0x18eb});var socket=require(_0x5133('0xd'))(new Redis(config[_0x5133('0xe')]));require(_0x5133('0xf'))['register'](socket);function respondWithRpcPromise(_0x1830f9,_0x5ac16e,_0x99e652){return new BPromise(function(_0x1d9850,_0x3f02ff){return client[_0x5133('0x10')](_0x1830f9,_0x99e652)[_0x5133('0x11')](function(_0x4994ec){logger[_0x5133('0x12')](_0x5133('0x13'),_0x5ac16e,'request\x20sent');logger[_0x5133('0x14')](_0x5133('0x15'),_0x5ac16e,'request\x20sent',JSON['stringify'](_0x4994ec));if(_0x4994ec[_0x5133('0x16')]){if(_0x4994ec[_0x5133('0x16')][_0x5133('0x17')]===0x1f4){logger[_0x5133('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5ac16e,_0x4994ec[_0x5133('0x16')][_0x5133('0x18')]);return _0x3f02ff(_0x4994ec[_0x5133('0x16')][_0x5133('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x5ac16e,_0x4994ec['error']['message']);return _0x1d9850(_0x4994ec[_0x5133('0x16')][_0x5133('0x18')]);}else{logger[_0x5133('0x12')](_0x5133('0x13'),_0x5ac16e,'request\x20sent');_0x1d9850(_0x4994ec['result'][_0x5133('0x18')]);}})[_0x5133('0x19')](function(_0x27e1da){logger[_0x5133('0x16')](_0x5133('0x13'),_0x5ac16e,_0x27e1da);_0x3f02ff(_0x27e1da);});});}exports[_0x5133('0x1a')]=function(_0x51dac7){var _0xa8b061=this;return new Promise(function(_0x75fbfe,_0x1fad7c){return db[_0x5133('0x1b')]['update'](_0x51dac7[_0x5133('0x1c')],{'raw':_0x51dac7[_0x5133('0x1d')]?_0x51dac7[_0x5133('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51dac7[_0x5133('0x1d')]?_0x51dac7[_0x5133('0x1d')]['where']||null:null,'attributes':_0x51dac7[_0x5133('0x1d')]?_0x51dac7[_0x5133('0x1d')]['attributes']||null:null,'limit':_0x51dac7[_0x5133('0x1d')]?_0x51dac7[_0x5133('0x1d')][_0x5133('0x1e')]||null:null})[_0x5133('0x11')](function(_0x5b394b){logger[_0x5133('0x12')]('UpdateMailInteraction',_0x51dac7);logger[_0x5133('0x14')](_0x5133('0x1a'),_0x51dac7,JSON['stringify'](_0x5b394b));_0x75fbfe(_0x5b394b);})['catch'](function(_0x26b7a7){logger[_0x5133('0x16')](_0x5133('0x1a'),_0x26b7a7[_0x5133('0x18')],_0x51dac7);_0x1fad7c(_0xa8b061[_0x5133('0x16')](0x1f4,_0x26b7a7[_0x5133('0x18')]));});});};exports[_0x5133('0x1f')]=function(_0x6d949a){return new Promise(function(_0x3c247b,_0x88487b){return db['MailInteraction'][_0x5133('0x20')]({'where':_0x6d949a[_0x5133('0x1d')]?_0x6d949a[_0x5133('0x1d')]['where']||null:null})[_0x5133('0x11')](function(_0xba48a7){if(_0xba48a7){return _0xba48a7[_0x5133('0x21')](_0x6d949a[_0x5133('0x1c')][_0x5133('0x22')],_[_0x5133('0x23')](_0x6d949a['body'],[_0x5133('0x22'),'id'])||{});}})['spread'](function(_0x2c5b43){logger[_0x5133('0x12')](_0x5133('0x24'),_0x6d949a);logger[_0x5133('0x14')]('AddTags',_0x6d949a,JSON[_0x5133('0x25')](_0x2c5b43));_0x3c247b(_0x2c5b43);})['catch'](function(_0x2f7edc){logger[_0x5133('0x16')](_0x5133('0x24'),_0x2f7edc[_0x5133('0x18')],_0x6d949a);_0x88487b(_this['error'](0x1f4,_0x2f7edc[_0x5133('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 45780c2..1a46d44 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['update','emit','removeListener','register','length','mailInteraction:','save'];(function(_0x1fd831,_0x5158c8){var _0x209157=function(_0x1c89e){while(--_0x1c89e){_0x1fd831['push'](_0x1fd831['shift']());}};_0x209157(++_0x5158c8);}(_0x2eb2,0x180));var _0x22eb=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x2eb2[_0x397cfb];return _0x15fed9;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x22eb('0x0'),'remove',_0x22eb('0x1')];function createListener(_0x48b19f,_0x3f0c95){return function(_0x50f369){_0x3f0c95[_0x22eb('0x2')](_0x48b19f,_0x50f369);};}function removeListener(_0x5b363c,_0x5b1d65){return function(){MailInteractionEvents[_0x22eb('0x3')](_0x5b363c,_0x5b1d65);};}exports[_0x22eb('0x4')]=function(_0x225661){for(var _0x4355c7=0x0,_0x2a6dea=events[_0x22eb('0x5')];_0x4355c7<_0x2a6dea;_0x4355c7++){var _0x540141=events[_0x4355c7];var _0x4295c1=createListener(_0x22eb('0x6')+_0x540141,_0x225661);MailInteractionEvents['on'](_0x540141,_0x4295c1);}}; \ No newline at end of file +var _0xb90e=['emit','register','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x3c912c,_0x1ab236){var _0x5f1240=function(_0x8a625d){while(--_0x8a625d){_0x3c912c['push'](_0x3c912c['shift']());}};_0x5f1240(++_0x1ab236);}(_0xb90e,0x1d9));var _0xeb90=function(_0x1c88ef,_0x5cccb1){_0x1c88ef=_0x1c88ef-0x0;var _0x5440f9=_0xb90e[_0x1c88ef];return _0x5440f9;};'use strict';var MailInteractionEvents=require(_0xeb90('0x0'));var events=['save',_0xeb90('0x1'),_0xeb90('0x2')];function createListener(_0x47879b,_0xd2e6f6){return function(_0x5b3315){_0xd2e6f6[_0xeb90('0x3')](_0x47879b,_0x5b3315);};}function removeListener(_0x390066,_0x545606){return function(){MailInteractionEvents['removeListener'](_0x390066,_0x545606);};}exports[_0xeb90('0x4')]=function(_0x24f8cf){for(var _0x500206=0x0,_0x2e3e8b=events[_0xeb90('0x5')];_0x500206<_0x2e3e8b;_0x500206++){var _0x128766=events[_0x500206];var _0x1059ae=createListener(_0xeb90('0x6')+_0x128766,_0x24f8cf);MailInteractionEvents['on'](_0x128766,_0x1059ae);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 99c2ee2..b6ea7a6 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58e5=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./mailMessage.controller','isAuthenticated','get','/describe','show','download','post','mail','create','put','/:id','/:id/accept','accept','delete'];(function(_0x43469e,_0x4e69d6){var _0xcefd2a=function(_0x8ded6f){while(--_0x8ded6f){_0x43469e['push'](_0x43469e['shift']());}};_0xcefd2a(++_0x4e69d6);}(_0x58e5,0xd1));var _0x558e=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x58e5[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var path=require(_0x558e('0x2'));var timeout=require(_0x558e('0x3'));var express=require(_0x558e('0x4'));var router=express[_0x558e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x558e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x558e('0x7'));router['get']('/',auth[_0x558e('0x8')](),controller['index']);router[_0x558e('0x9')](_0x558e('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x558e('0xb')]);router[_0x558e('0x9')]('/:id/download',auth[_0x558e('0x8')](),controller[_0x558e('0xc')]);router[_0x558e('0xd')]('/',auth[_0x558e('0x8')](),interaction['tracked'](_0x558e('0xe'),'mailmessage:create'),controller[_0x558e('0xf')]);router[_0x558e('0x10')](_0x558e('0x11'),auth[_0x558e('0x8')](),controller['update']);router[_0x558e('0x10')](_0x558e('0x12'),auth['isAuthenticated'](),controller[_0x558e('0x13')]);router[_0x558e('0x10')]('/:id/reject',auth[_0x558e('0x8')](),controller['reject']);router[_0x558e('0x14')](_0x558e('0x11'),auth['isAuthenticated'](),controller[_0x558e('0x15')]);module[_0x558e('0x16')]=router; \ No newline at end of file +var _0x5b05=['mail','mailmessage:create','put','update','/:id/accept','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked'];(function(_0x4ec7f8,_0x46b723){var _0x556043=function(_0x5d0232){while(--_0x5d0232){_0x4ec7f8['push'](_0x4ec7f8['shift']());}};_0x556043(++_0x46b723);}(_0x5b05,0x190));var _0x55b0=function(_0x18271a,_0xea6a89){_0x18271a=_0x18271a-0x0;var _0x3ea4df=_0x5b05[_0x18271a];return _0x3ea4df;};'use strict';var multer=require('multer');var util=require(_0x55b0('0x0'));var path=require(_0x55b0('0x1'));var timeout=require(_0x55b0('0x2'));var express=require(_0x55b0('0x3'));var router=express[_0x55b0('0x4')]();var fs_extra=require(_0x55b0('0x5'));var auth=require(_0x55b0('0x6'));var interaction=require(_0x55b0('0x7'));var config=require(_0x55b0('0x8'));var controller=require(_0x55b0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55b0('0xa')]);router[_0x55b0('0xb')](_0x55b0('0xc'),auth[_0x55b0('0xd')](),controller[_0x55b0('0xe')]);router['get'](_0x55b0('0xf'),auth[_0x55b0('0xd')](),controller[_0x55b0('0x10')]);router[_0x55b0('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x55b0('0x11')]);router[_0x55b0('0x12')]('/',auth[_0x55b0('0xd')](),interaction[_0x55b0('0x13')](_0x55b0('0x14'),_0x55b0('0x15')),controller['create']);router[_0x55b0('0x16')](_0x55b0('0xf'),auth['isAuthenticated'](),controller[_0x55b0('0x17')]);router[_0x55b0('0x16')](_0x55b0('0x18'),auth[_0x55b0('0xd')](),controller['accept']);router['put']('/:id/reject',auth[_0x55b0('0xd')](),controller['reject']);router[_0x55b0('0x19')](_0x55b0('0xf'),auth['isAuthenticated'](),controller[_0x55b0('0x1a')]);module[_0x55b0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 44befbf..024acf4 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a2b=['INTEGER','DATE','Email','Chat','lodash','exports','TEXT','medium','ENUM','out','STRING','long'];(function(_0x7ca0e3,_0x4281d3){var _0x242020=function(_0x5941a3){while(--_0x5941a3){_0x7ca0e3['push'](_0x7ca0e3['shift']());}};_0x242020(++_0x4281d3);}(_0x8a2b,0x130));var _0xb8a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a2b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb8a2('0x0'));module[_0xb8a2('0x1')]={'body':{'type':Sequelize[_0xb8a2('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb8a2('0x2')](_0xb8a2('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb8a2('0x4')]('in',_0xb8a2('0x5')),'defaultValue':_0xb8a2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb8a2('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xb8a2('0x2')]('long')},'cc':{'type':Sequelize[_0xb8a2('0x2')](_0xb8a2('0x7'))},'bcc':{'type':Sequelize[_0xb8a2('0x2')](_0xb8a2('0x7'))},'subject':{'type':Sequelize[_0xb8a2('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xb8a2('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb8a2('0x9')]},'originTo':{'type':Sequelize[_0xb8a2('0x2')](_0xb8a2('0x7'))},'originCc':{'type':Sequelize[_0xb8a2('0x2')](_0xb8a2('0x7'))},'originChannel':{'type':Sequelize[_0xb8a2('0x4')](_0xb8a2('0xa'),_0xb8a2('0xb')),'defaultValue':_0xb8a2('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x9f49=['long','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','lodash','exports','TEXT'];(function(_0x19f012,_0x2350ba){var _0x526186=function(_0x12f7d5){while(--_0x12f7d5){_0x19f012['push'](_0x19f012['shift']());}};_0x526186(++_0x2350ba);}(_0x9f49,0x189));var _0x99f4=function(_0x7026a4,_0x5e6da9){_0x7026a4=_0x7026a4-0x0;var _0x38f372=_0x9f49[_0x7026a4];return _0x38f372;};'use strict';var Sequelize=require('sequelize');var _=require(_0x99f4('0x0'));module[_0x99f4('0x1')]={'body':{'type':Sequelize[_0x99f4('0x2')](_0x99f4('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x99f4('0x2')]('medium')},'read':{'type':Sequelize[_0x99f4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x99f4('0x5')]('in',_0x99f4('0x6')),'defaultValue':_0x99f4('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x99f4('0x7')](0x1fe)},'from':{'type':Sequelize[_0x99f4('0x7')]},'to':{'type':Sequelize[_0x99f4('0x2')](_0x99f4('0x3'))},'cc':{'type':Sequelize[_0x99f4('0x2')](_0x99f4('0x3'))},'bcc':{'type':Sequelize[_0x99f4('0x2')](_0x99f4('0x3'))},'subject':{'type':Sequelize[_0x99f4('0x2')]},'sentAt':{'type':Sequelize[_0x99f4('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x99f4('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x99f4('0x8')]},'originTo':{'type':Sequelize[_0x99f4('0x2')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x99f4('0x3'))},'originChannel':{'type':Sequelize[_0x99f4('0x5')](_0x99f4('0x9'),_0x99f4('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 5c59cad..78791e2 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fc9=['message-%s.eml','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','defaults','redis','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','undefined','limit','offset','set','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','include','findAll','rows','catch','show','length','includeAll','find','update','body','params','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','root','server/files/attachments','CmContact','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','User','interface','toString','join','server','files','tmp'];(function(_0x59bd6f,_0x2317d1){var _0x2c5f08=function(_0x507b03){while(--_0x507b03){_0x59bd6f['push'](_0x59bd6f['shift']());}};_0x2c5f08(++_0x2317d1);}(_0x6fc9,0xb0));var _0x96fc=function(_0x244473,_0x39f321){_0x244473=_0x244473-0x0;var _0x199ef4=_0x6fc9[_0x244473];return _0x199ef4;};'use strict';var emlformat=require(_0x96fc('0x0'));var moment=require(_0x96fc('0x1'));var BPromise=require(_0x96fc('0x2'));var util=require('util');var path=require(_0x96fc('0x3'));var fs=require('fs');var _=require(_0x96fc('0x4'));var Redis=require(_0x96fc('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x96fc('0x6'));var logger=require('../../config/logger')(_0x96fc('0x7'));var interaction_log=require(_0x96fc('0x8'))('mail-interactions');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x96fc('0x9')](config[_0x96fc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x96fc('0xb'))(new Redis(config[_0x96fc('0xa')]));var htmlEntities=require(_0x96fc('0xc'));require('./mailMessage.socket')[_0x96fc('0xd')](socket);var jayson=require(_0x96fc('0xe'));var client=jayson[_0x96fc('0xf')][_0x96fc('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x96fc('0x10')]({'port':0x232b});var client9002=jayson['client'][_0x96fc('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x233ed5,_0x2ebf3d,_0x1df852,_0x193c0e){return new BPromise(function(_0x5601dd,_0x15a5bb){var _0x55cabc=_0x193c0e||client;return _0x55cabc[_0x96fc('0x11')](_0x233ed5,_0x1df852)['then'](function(_0x3605c2){logger[_0x96fc('0x12')]('MailMessage,\x20%s,\x20%s',_0x2ebf3d,_0x96fc('0x13'));logger[_0x96fc('0x14')](_0x96fc('0x15'),_0x2ebf3d,_0x96fc('0x13'),JSON[_0x96fc('0x16')](_0x3605c2));if(_0x3605c2[_0x96fc('0x17')]){if(_0x3605c2[_0x96fc('0x17')][_0x96fc('0x18')]===0x1f4){logger[_0x96fc('0x17')](_0x96fc('0x19'),_0x2ebf3d,_0x3605c2[_0x96fc('0x17')]['message']);return _0x15a5bb(_0x3605c2['error']['message']);}logger[_0x96fc('0x17')](_0x96fc('0x19'),_0x2ebf3d,_0x3605c2[_0x96fc('0x17')][_0x96fc('0x1a')]);return _0x5601dd(_0x3605c2[_0x96fc('0x17')][_0x96fc('0x1a')]);}else{logger[_0x96fc('0x12')](_0x96fc('0x19'),_0x2ebf3d,_0x96fc('0x13'));_0x5601dd(_0x3605c2[_0x96fc('0x1b')][_0x96fc('0x1a')]);}})['catch'](function(_0x544433){logger[_0x96fc('0x17')](_0x96fc('0x19'),_0x2ebf3d,_0x544433);_0x15a5bb(_0x544433);});});}function respondWithResult(_0x2a194b,_0x171070){_0x171070=_0x171070||0xc8;return function(_0xe2acd9){if(_0xe2acd9){return _0x2a194b[_0x96fc('0x1c')](_0x171070)[_0x96fc('0x1d')](_0xe2acd9);}};}function respondWithFilteredResult(_0x13a6f0,_0x2257b5){return function(_0x5e88c8){if(_0x5e88c8){var _0x300e10=typeof _0x2257b5['offset']===_0x96fc('0x1e')&&typeof _0x2257b5[_0x96fc('0x1f')]===_0x96fc('0x1e');var _0x882e6d=_0x5e88c8['count'];var _0xce7a40=_0x300e10?0x0:_0x2257b5[_0x96fc('0x20')];var _0x3118ec=_0x300e10?_0x5e88c8['count']:_0x2257b5['offset']+_0x2257b5[_0x96fc('0x1f')];var _0x2266fc;if(_0x3118ec>=_0x882e6d){_0x3118ec=_0x882e6d;_0x2266fc=0xc8;}else{_0x2266fc=0xce;}_0x13a6f0[_0x96fc('0x1c')](_0x2266fc);return _0x13a6f0[_0x96fc('0x21')]('Content-Range',_0xce7a40+'-'+_0x3118ec+'/'+_0x882e6d)[_0x96fc('0x1d')](_0x5e88c8);}return null;};}function saveUpdates(_0x12193b){return function(_0x165619){if(_0x165619){return _0x165619['update'](_0x12193b)[_0x96fc('0x22')](function(_0x3203a2){return _0x3203a2;});}return null;};}function removeEntity(_0x30e34c){return function(_0x16e961){if(_0x16e961){return _0x16e961[_0x96fc('0x23')]()[_0x96fc('0x22')](function(){_0x30e34c[_0x96fc('0x1c')](0xcc)[_0x96fc('0x24')]();});}};}function handleEntityNotFound(_0x33ef7b){return function(_0x279fd1){if(!_0x279fd1){_0x33ef7b[_0x96fc('0x25')](0x194);}return _0x279fd1;};}function handleError(_0x3a1aa1,_0x4e2721){_0x4e2721=_0x4e2721||0x1f4;return function(_0x4762d7){logger[_0x96fc('0x17')](_0x4762d7[_0x96fc('0x26')]);if(_0x4762d7[_0x96fc('0x27')]){delete _0x4762d7[_0x96fc('0x27')];}_0x3a1aa1[_0x96fc('0x1c')](_0x4e2721)[_0x96fc('0x28')](_0x4762d7);};}exports[_0x96fc('0x29')]=function(_0x3171a2,_0x4e6d0b){var _0x29c425={},_0x1d63b1={},_0x2d43a2={'count':0x0,'rows':[]};var _0x3a4664=_[_0x96fc('0x2a')](db[_0x96fc('0x2b')][_0x96fc('0x2c')],function(_0x4cc195){return{'name':_0x4cc195[_0x96fc('0x2d')],'type':_0x4cc195[_0x96fc('0x2e')][_0x96fc('0x2f')]};});_0x1d63b1[_0x96fc('0x30')]=_[_0x96fc('0x2a')](_0x3a4664,_0x96fc('0x27'));_0x1d63b1[_0x96fc('0x31')]=_[_0x96fc('0x32')](_0x3171a2[_0x96fc('0x31')]);_0x1d63b1[_0x96fc('0x33')]=_[_0x96fc('0x34')](_0x1d63b1[_0x96fc('0x30')],_0x1d63b1[_0x96fc('0x31')]);_0x29c425[_0x96fc('0x35')]=_[_0x96fc('0x34')](_0x1d63b1[_0x96fc('0x30')],qs[_0x96fc('0x36')](_0x3171a2[_0x96fc('0x31')][_0x96fc('0x36')]));_0x29c425['attributes']=_0x29c425[_0x96fc('0x35')]['length']?_0x29c425['attributes']:_0x1d63b1[_0x96fc('0x30')];if(!_0x3171a2[_0x96fc('0x31')][_0x96fc('0x37')](_0x96fc('0x38'))){_0x29c425[_0x96fc('0x1f')]=qs[_0x96fc('0x1f')](_0x3171a2[_0x96fc('0x31')][_0x96fc('0x1f')]);_0x29c425[_0x96fc('0x20')]=qs['offset'](_0x3171a2['query'][_0x96fc('0x20')]);}_0x29c425[_0x96fc('0x39')]=qs[_0x96fc('0x3a')](_0x3171a2[_0x96fc('0x31')]['sort']);_0x29c425['where']=qs[_0x96fc('0x33')](_[_0x96fc('0x3b')](_0x3171a2[_0x96fc('0x31')],_0x1d63b1['filters']),_0x3a4664);if(_0x3171a2[_0x96fc('0x31')][_0x96fc('0x3c')]){_0x29c425['where']=_[_0x96fc('0x3d')](_0x29c425[_0x96fc('0x3e')],{'$or':_[_0x96fc('0x2a')](_0x3a4664,function(_0x3c7932){if(_0x3c7932['type']!==_0x96fc('0x3f')){var _0x3d908f={};_0x3d908f[_0x3c7932[_0x96fc('0x27')]]={'$like':'%'+_0x3171a2[_0x96fc('0x31')][_0x96fc('0x3c')]+'%'};return _0x3d908f;}})});}_0x29c425=_[_0x96fc('0x3d')]({},_0x29c425,_0x3171a2[_0x96fc('0x40')]);var _0x177757={'where':_0x29c425[_0x96fc('0x3e')]};return db['MailMessage'][_0x96fc('0x41')](_0x177757)[_0x96fc('0x22')](function(_0x69c6b1){_0x2d43a2[_0x96fc('0x41')]=_0x69c6b1;if(_0x3171a2[_0x96fc('0x31')]['includeAll']){_0x29c425[_0x96fc('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0x96fc('0x43')](_0x29c425);})[_0x96fc('0x22')](function(_0x2cfff9){_0x2d43a2[_0x96fc('0x44')]=_0x2cfff9;return _0x2d43a2;})[_0x96fc('0x22')](respondWithFilteredResult(_0x4e6d0b,_0x29c425))[_0x96fc('0x45')](handleError(_0x4e6d0b,null));};exports[_0x96fc('0x46')]=function(_0xeb6aae,_0x11a400){var _0x6ceb45={'raw':!![],'where':{'id':_0xeb6aae['params']['id']}},_0x14c4d6={};_0x14c4d6['model']=_[_0x96fc('0x32')](db[_0x96fc('0x2b')][_0x96fc('0x2c')]);_0x14c4d6['query']=_['keys'](_0xeb6aae[_0x96fc('0x31')]);_0x14c4d6['filters']=_[_0x96fc('0x34')](_0x14c4d6[_0x96fc('0x30')],_0x14c4d6['query']);_0x6ceb45[_0x96fc('0x35')]=_[_0x96fc('0x34')](_0x14c4d6[_0x96fc('0x30')],qs[_0x96fc('0x36')](_0xeb6aae[_0x96fc('0x31')][_0x96fc('0x36')]));_0x6ceb45[_0x96fc('0x35')]=_0x6ceb45[_0x96fc('0x35')][_0x96fc('0x47')]?_0x6ceb45[_0x96fc('0x35')]:_0x14c4d6[_0x96fc('0x30')];if(_0xeb6aae['query'][_0x96fc('0x48')]){_0x6ceb45[_0x96fc('0x42')]=[{'all':!![]}];}_0x6ceb45=_['merge']({},_0x6ceb45,_0xeb6aae[_0x96fc('0x40')]);return db[_0x96fc('0x2b')][_0x96fc('0x49')](_0x6ceb45)['then'](handleEntityNotFound(_0x11a400,null))['then'](respondWithResult(_0x11a400,null))[_0x96fc('0x45')](handleError(_0x11a400,null));};exports[_0x96fc('0x4a')]=function(_0x454939,_0x4e5aac){if(_0x454939[_0x96fc('0x4b')]['id']){delete _0x454939[_0x96fc('0x4b')]['id'];}return db[_0x96fc('0x2b')][_0x96fc('0x49')]({'where':{'id':_0x454939['params']['id']}})[_0x96fc('0x22')](handleEntityNotFound(_0x4e5aac,null))['then'](saveUpdates(_0x454939[_0x96fc('0x4b')],null))[_0x96fc('0x22')](respondWithResult(_0x4e5aac,null))[_0x96fc('0x45')](handleError(_0x4e5aac,null));};exports[_0x96fc('0x23')]=function(_0x22d67b,_0x111a8b){return db[_0x96fc('0x2b')][_0x96fc('0x49')]({'where':{'id':_0x22d67b[_0x96fc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x111a8b,null))[_0x96fc('0x22')](removeEntity(_0x111a8b,null))['catch'](handleError(_0x111a8b,null));};exports[_0x96fc('0x4d')]=function(_0x38afb7,_0x520335){return db[_0x96fc('0x2b')][_0x96fc('0x4d')]()['then'](respondWithResult(_0x520335,null))[_0x96fc('0x45')](handleError(_0x520335,null));};exports[_0x96fc('0x4e')]=function(_0x5e071f,_0x5aa359){return db[_0x96fc('0x2b')][_0x96fc('0x4e')](_0x5e071f[_0x96fc('0x4b')])[_0x96fc('0x22')](function(_0x522cc6){if(_0x522cc6){if(_0x522cc6[_0x96fc('0x4f')]===_0x96fc('0x50')&&!_0x522cc6['secret']){var _0x29a943,_0x46ac0a,_0x19cf4a;if(_0x5e071f[_0x96fc('0x4b')]['to']){_0x46ac0a=_0x5e071f['body']['to'][_0x96fc('0x51')](',')[0x0];}return db[_0x96fc('0x52')][_0x96fc('0x53')]({'where':{'id':_0x522cc6[_0x96fc('0x54')]},'include':[{'model':db[_0x96fc('0x55')],'as':_0x96fc('0x56'),'include':[{'model':db['CmContact'],'as':_0x96fc('0x57'),'where':{'email':_0x46ac0a},'limit':0x1,'order':[['updatedAt',_0x96fc('0x58')]]}]},{'model':db[_0x96fc('0x59')],'as':_0x96fc('0x5a'),'raw':!![]}]})[_0x96fc('0x22')](function(_0x91e80c){_0x29a943=_0x91e80c;if(_0x29a943&&_0x29a943[_0x96fc('0x5a')]){var _0x3d7f92={'tls':{'rejectUnauthorized':![]}};if(_[_0x96fc('0x5b')](_0x29a943[_0x96fc('0x5a')][_0x96fc('0x5c')])){_0x3d7f92[_0x96fc('0x5d')]=_0x29a943[_0x96fc('0x5a')]['host'];_0x3d7f92[_0x96fc('0x5e')]=_0x29a943[_0x96fc('0x5a')][_0x96fc('0x5e')];_0x3d7f92[_0x96fc('0x5f')]=_0x29a943['Smtp'][_0x96fc('0x5f')];if(_0x29a943[_0x96fc('0x5a')]['authentication']){_0x3d7f92[_0x96fc('0x60')]={'user':_0x29a943[_0x96fc('0x5a')][_0x96fc('0x61')],'pass':_0x29a943[_0x96fc('0x5a')][_0x96fc('0x62')]};}}else{_0x3d7f92[_0x96fc('0x5c')]=_0x29a943[_0x96fc('0x5a')][_0x96fc('0x5c')];_0x3d7f92[_0x96fc('0x60')]={'user':_0x29a943[_0x96fc('0x5a')][_0x96fc('0x61')],'pass':_0x29a943['Smtp'][_0x96fc('0x62')]};_0x3d7f92[_0x96fc('0x5f')]=_0x29a943[_0x96fc('0x5a')][_0x96fc('0x5f')];}if(_0x5e071f[_0x96fc('0x4b')]['attachments']&&_0x5e071f[_0x96fc('0x4b')][_0x96fc('0x63')][_0x96fc('0x47')]){for(var _0x486bae=0x0;_0x486bae<_0x5e071f['body'][_0x96fc('0x63')][_0x96fc('0x47')];_0x486bae+=0x1){_0x5e071f[_0x96fc('0x4b')][_0x96fc('0x63')][_0x486bae]={'filename':_0x5e071f[_0x96fc('0x4b')]['attachments'][_0x486bae][_0x96fc('0x27')],'path':path['join'](config[_0x96fc('0x64')],_0x96fc('0x65'),_0x5e071f[_0x96fc('0x4b')][_0x96fc('0x63')][_0x486bae]['basename'])};}}_0x19cf4a={'account':_0x3d7f92,'message':_0x5e071f[_0x96fc('0x4b')]};return;}})[_0x96fc('0x22')](function(){if(_0x29a943[_0x96fc('0x56')]){if(_0x29a943['List'][_0x96fc('0x57')][_0x96fc('0x47')]){return _0x29a943[_0x96fc('0x56')][_0x96fc('0x57')][0x0];}else{return db[_0x96fc('0x66')][_0x96fc('0x4e')](_[_0x96fc('0x9')](_0x5e071f['body'],{'firstName':_0x5e071f['body']['to'],'email':_0x5e071f['body']['to'],'phone':_0x5e071f['body']['to'],'ListId':_0x29a943['ListId']}));}}else{throw new Error(_0x96fc('0x67'));}})[_0x96fc('0x22')](function(){if(_0x19cf4a){return respondWithRpcPromise(_0x96fc('0x68'),'sendMail',_0x19cf4a,client9003)[_0x96fc('0x22')](function(_0x1d30eb){return _0x522cc6['update']({'read':!![],'messageId':_0x1d30eb[_0x96fc('0x69')],'sentAt':moment()['format'](_0x96fc('0x6a'))});})[_0x96fc('0x45')](function(_0x5efb3e){logger[_0x96fc('0x17')]('%s',JSON[_0x96fc('0x16')](_0x5efb3e));return _0x522cc6;});}return _0x522cc6;});}return _0x522cc6;}})[_0x96fc('0x22')](respondWithResult(_0x5aa359,0xc9))[_0x96fc('0x45')](handleError(_0x5aa359,null));};exports[_0x96fc('0x6b')]=function(_0x5a1d78,_0x43fe6a){var _0x13352c={'agent':{},'channel':_0x96fc('0x6c')};if(_0x5a1d78[_0x96fc('0x4b')]['id']){delete _0x5a1d78[_0x96fc('0x4b')]['id'];}_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x6d')]=!![];_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x6e')]=moment()[_0x96fc('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x70')]=_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x70')]||_0x5a1d78[_0x96fc('0x61')]['id'];_0x13352c[_0x96fc('0x71')]['id']=_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x70')];return db[_0x96fc('0x2b')][_0x96fc('0x49')]({'where':{'id':_0x5a1d78['params']['id'],'UserId':null}})[_0x96fc('0x22')](handleEntityNotFound(_0x43fe6a,null))[_0x96fc('0x22')](saveUpdates(_0x5a1d78[_0x96fc('0x4b')],null))[_0x96fc('0x22')](function(_0x3466e2){if(_0x3466e2){_0x13352c['message']=_0x3466e2[_0x96fc('0x72')]({'plain':!![]});return db[_0x96fc('0x73')][_0x96fc('0x49')]({'where':{'id':_0x3466e2[_0x96fc('0x74')]}});}return null;})[_0x96fc('0x22')](handleEntityNotFound(_0x43fe6a,null))[_0x96fc('0x22')](function(_0x18f376){if(_0x18f376){return _0x18f376[_0x96fc('0x4a')]({'UserId':_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x70')],'read1stAt':_[_0x96fc('0x5b')](_0x18f376['read1stAt'])?moment()[_0x96fc('0x6f')](_0x96fc('0x6a')):undefined});}return null;})[_0x96fc('0x22')](function(_0x55cfcd){if(_0x55cfcd){_0x13352c[_0x96fc('0x75')]=_0x55cfcd[_0x96fc('0x72')]({'plain':!![]});interaction_log[_0x96fc('0x12')](_0x96fc('0x76'),_0x5a1d78[_0x96fc('0x61')]['id'],_0x5a1d78[_0x96fc('0x61')][_0x96fc('0x27')],_0x5a1d78['user'][_0x96fc('0x77')],_0x13352c[_0x96fc('0x75')]['id'],_0x5a1d78[_0x96fc('0x4b')]?JSON[_0x96fc('0x16')](_0x5a1d78[_0x96fc('0x4b')]):'null');return respondWithRpcPromise(_0x96fc('0x78'),_0x96fc('0x79'),_0x13352c);}return null;})['then'](function(_0x43d243){var _0x55c1a1=_0x96fc('0x7a')+_0x43d243[_0x96fc('0x1a')][_0x96fc('0x7b')];return db[_0x96fc('0x7c')][_0x96fc('0x31')](_0x55c1a1,{'type':db[_0x96fc('0x7d')][_0x96fc('0x7e')]['SELECT'],'raw':!![]})[_0x96fc('0x22')](function(_0x42ffc8){return _0x42ffc8;});})[_0x96fc('0x22')](function(_0x473ee7){if(_0x473ee7){_0x13352c[_0x96fc('0x1a')][_0x96fc('0x7f')]=_0x473ee7[0x0];if(!_0x5a1d78[_0x96fc('0x4b')]['UserId'])return;return db['User'][_0x96fc('0x49')]({'where':{'id':_0x5a1d78[_0x96fc('0x4b')][_0x96fc('0x70')],'role':_0x96fc('0x71')},'attributes':['id',_0x96fc('0x27'),_0x96fc('0x80'),_0x96fc('0x81'),_0x96fc('0x82')],'raw':!![]});}return null;})[_0x96fc('0x22')](function(_0x49c66b){if(!_0x49c66b)return null;_0x13352c[_0x96fc('0x1a')]['agent']=_0x49c66b;return _0x13352c;})[_0x96fc('0x22')](function(_0x56b12b){if(_0x56b12b){if(_0x5a1d78[_0x96fc('0x4b')]['manual']){_0x13352c['message']['interface']=util[_0x96fc('0x6f')](_0x96fc('0x83'),_0x5a1d78[_0x96fc('0x61')]['name']);_0x13352c[_0x96fc('0x1a')][_0x96fc('0x84')]=_0x13352c[_0x96fc('0x84')];_0x13352c[_0x96fc('0x1a')][_0x96fc('0x85')]=_0x13352c['channel'];_0x13352c[_0x96fc('0x1a')][_0x96fc('0x86')]=_0x96fc('0x6b');_0x13352c['message']['body']=htmlToText['fromString'](_0x13352c[_0x96fc('0x1a')][_0x96fc('0x4b')]);return respondWithRpcPromise('EventManager',_0x96fc('0x87'),{'event':_0x96fc('0x88'),'message':_0x13352c['message']},client9002)[_0x96fc('0x22')](function(){return _0x13352c;});}return _0x13352c;}return null;})[_0x96fc('0x22')](respondWithResult(_0x43fe6a,null))[_0x96fc('0x45')](handleError(_0x43fe6a,null));};exports[_0x96fc('0x89')]=function(_0x102165,_0x108886){var _0x142547={'agent':{},'channel':_0x96fc('0x6c')};if(_0x102165[_0x96fc('0x4b')]['id']){delete _0x102165[_0x96fc('0x4b')]['id'];}_0x102165[_0x96fc('0x4b')]['UserId']=_0x102165[_0x96fc('0x4b')][_0x96fc('0x70')]||_0x102165[_0x96fc('0x61')]['id'];_0x142547[_0x96fc('0x71')]['id']=_0x102165[_0x96fc('0x4b')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x102165[_0x96fc('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x108886,null))[_0x96fc('0x22')](function(_0x27b5f4){if(_0x27b5f4){_0x142547['message']=_0x27b5f4[_0x96fc('0x72')]({'plain':!![]});return db[_0x96fc('0x73')][_0x96fc('0x49')]({'where':{'id':_0x27b5f4['MailInteractionId']}});}return null;})[_0x96fc('0x22')](handleEntityNotFound(_0x108886,null))[_0x96fc('0x22')](function(_0x2ac0b7){if(_0x2ac0b7){_0x142547[_0x96fc('0x75')]=_0x2ac0b7[_0x96fc('0x72')]({'plain':!![]});interaction_log[_0x96fc('0x12')](_0x96fc('0x8a'),_0x102165[_0x96fc('0x61')]['id'],_0x102165[_0x96fc('0x61')][_0x96fc('0x27')],_0x102165[_0x96fc('0x61')][_0x96fc('0x77')],_0x142547[_0x96fc('0x75')]['id'],_0x102165[_0x96fc('0x4b')]?JSON['stringify'](_0x102165[_0x96fc('0x4b')]):'null');return respondWithRpcPromise(_0x96fc('0x8b'),'rejectMessage',_0x142547);}return null;})['then'](function(_0x1961c0){var _0x533ebd=_0x96fc('0x7a')+_0x1961c0[_0x96fc('0x1a')][_0x96fc('0x7b')];return db['sequelize']['query'](_0x533ebd,{'type':db[_0x96fc('0x7d')]['QueryTypes'][_0x96fc('0x8c')],'raw':!![]})['then'](function(_0x51f5d3){return _0x51f5d3;});})[_0x96fc('0x22')](function(_0x442add){if(_0x442add){_0x142547['message'][_0x96fc('0x7f')]=_0x442add[0x0];if(!_0x102165[_0x96fc('0x4b')]['UserId'])return;return db[_0x96fc('0x8d')][_0x96fc('0x49')]({'where':{'id':_0x102165[_0x96fc('0x4b')]['UserId'],'role':_0x96fc('0x71')},'attributes':['id',_0x96fc('0x27'),_0x96fc('0x80'),_0x96fc('0x81'),_0x96fc('0x82')],'raw':!![]});}return null;})['then'](function(_0x48da1b){if(!_0x48da1b)return null;_0x142547[_0x96fc('0x1a')]['agent']=_0x48da1b;return _0x142547;})[_0x96fc('0x22')](function(_0x372282){if(_0x372282){_0x372282[_0x96fc('0x1a')][_0x96fc('0x8e')]=util[_0x96fc('0x6f')](_0x96fc('0x83'),_0x102165['user'][_0x96fc('0x27')]);_0x372282[_0x96fc('0x1a')][_0x96fc('0x84')]=_0x142547[_0x96fc('0x84')];_0x372282[_0x96fc('0x1a')][_0x96fc('0x85')]=_0x142547['channel'];_0x372282[_0x96fc('0x1a')][_0x96fc('0x86')]='reject';_0x372282[_0x96fc('0x1a')][_0x96fc('0x4b')]=htmlToText['fromString'](_0x142547[_0x96fc('0x1a')][_0x96fc('0x4b')]);respondWithRpcPromise(_0x96fc('0x87'),_0x96fc('0x87'),{'event':'rejectmessage','message':_0x372282[_0x96fc('0x1a')]},client9002);return _0x142547;}return null;})[_0x96fc('0x22')](respondWithResult(_0x108886,null))[_0x96fc('0x45')](handleError(_0x108886,null));};exports['download']=function(_0x5d6f3a,_0x57e034){var _0x6bf0bf=moment()['unix']()[_0x96fc('0x8f')]();var _0x1e9ae4=path[_0x96fc('0x90')](config[_0x96fc('0x64')],_0x96fc('0x91'),_0x96fc('0x92'),_0x96fc('0x93'));var _0x3b6280=path['join'](config[_0x96fc('0x64')],_0x96fc('0x91'),_0x96fc('0x92'),'attachments');var _0x2ecb6b=util[_0x96fc('0x6f')](_0x96fc('0x94'),_0x6bf0bf);return db[_0x96fc('0x2b')]['find']({'where':{'id':_0x5d6f3a['params']['id']},'attributes':['id',_0x96fc('0x4b'),_0x96fc('0x95'),'to','cc','bcc',_0x96fc('0x96'),_0x96fc('0x97')],'include':_0x5d6f3a['query'][_0x96fc('0x63')]?[{'model':db[_0x96fc('0x98')],'as':_0x96fc('0x99')}]:undefined})[_0x96fc('0x22')](handleEntityNotFound(_0x57e034,null))['then'](function(_0x2964c6){if(_0x2964c6){var _0x31284c=_0x2964c6;var _0x563ffd={'from':_0x31284c[_0x96fc('0x95')],'to':_0x31284c['to'],'subject':_0x31284c[_0x96fc('0x96')],'html':htmlEntities['decode'](_0x31284c['body']),'headers':{'Date':moment(_0x31284c[_0x96fc('0x97')])[_0x96fc('0x6f')](_0x96fc('0x9a'))},'attachments':[]};if(_0x2964c6['cc']){_0x563ffd[_0x96fc('0x9b')]['Cc']=_0x2964c6['cc'];}if(_0x2964c6[_0x96fc('0x9c')]){_0x563ffd[_0x96fc('0x9b')][_0x96fc('0x9d')]=_0x2964c6[_0x96fc('0x9c')];}return new BPromise(function(_0x2694b7,_0x21013b){if(_0x2964c6['Attachments']){for(var _0x30d828=0x0;_0x30d828<_0x2964c6[_0x96fc('0x99')][_0x96fc('0x47')];_0x30d828++){var _0x29eba1=_0x2964c6[_0x96fc('0x99')][_0x30d828];var _0x4f879b=path[_0x96fc('0x90')](_0x3b6280,_0x29eba1['basename']);if(fs[_0x96fc('0x9e')](_0x4f879b)){_0x563ffd[_0x96fc('0x63')]['push']({'name':_0x29eba1[_0x96fc('0x27')],'contentType':_0x29eba1[_0x96fc('0x2e')],'data':fs['readFileSync'](_0x4f879b)});}}}emlformat['build'](_0x563ffd,function(_0x2f77c4,_0x1a2c77){if(_0x2f77c4)return _0x21013b(_0x2f77c4);fs[_0x96fc('0x9f')](path[_0x96fc('0x90')](_0x1e9ae4,_0x2ecb6b),_0x1a2c77);return _0x2694b7(_0x1a2c77);});});}})[_0x96fc('0x22')](function(_0x24cb0d){if(_0x24cb0d){return _0x57e034[_0x96fc('0xa0')](path[_0x96fc('0x90')](_0x1e9ae4,_0x2ecb6b),_0x2ecb6b,function(_0x234813){if(!_0x234813)fs[_0x96fc('0xa1')](path['join'](_0x1e9ae4,_0x2ecb6b));});}})[_0x96fc('0x45')](handleError(_0x57e034,null));}; \ No newline at end of file +var _0x50be=['MailMessage','includeAll','include','show','params','filters','find','body','describe','create','direction','out','split','findOne','CmList','CmContact','Contacts','updatedAt','MailServerOut','isNil','service','host','port','Smtp','secure','authentication','auth','user','pass','attachments','join','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','agent','get','MailInteractionId','read1stAt','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','fromString','EventManager','acceptmessage','reject','MailInteraction','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','SIP/%s','event','download','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','info','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','stack','name','status','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x3e62bf,_0xde1a83){var _0x102cae=function(_0x1be466){while(--_0x1be466){_0x3e62bf['push'](_0x3e62bf['shift']());}};_0x102cae(++_0xde1a83);}(_0x50be,0x1a1));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe50b('0x0'));var moment=require(_0xe50b('0x1'));var BPromise=require(_0xe50b('0x2'));var util=require(_0xe50b('0x3'));var path=require(_0xe50b('0x4'));var fs=require('fs');var _=require(_0xe50b('0x5'));var Redis=require(_0xe50b('0x6'));var htmlToText=require(_0xe50b('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xe50b('0x8'))(_0xe50b('0x9'));var interaction_log=require(_0xe50b('0x8'))(_0xe50b('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe50b('0xb')]=_[_0xe50b('0xc')](config[_0xe50b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe50b('0xd'))(new Redis(config[_0xe50b('0xb')]));var htmlEntities=require(_0xe50b('0xe'));require(_0xe50b('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe50b('0x10')][_0xe50b('0x11')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0xe50b('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed3c5,_0xd9fc0a,_0x166154,_0x574cb3){return new BPromise(function(_0x196ec7,_0x3e995f){var _0x57548e=_0x574cb3||client;return _0x57548e[_0xe50b('0x12')](_0x4ed3c5,_0x166154)['then'](function(_0x9c95b2){logger[_0xe50b('0x13')]('MailMessage,\x20%s,\x20%s',_0xd9fc0a,'request\x20sent');logger['debug'](_0xe50b('0x14'),_0xd9fc0a,'request\x20sent',JSON[_0xe50b('0x15')](_0x9c95b2));if(_0x9c95b2[_0xe50b('0x16')]){if(_0x9c95b2[_0xe50b('0x16')]['code']===0x1f4){logger['error'](_0xe50b('0x17'),_0xd9fc0a,_0x9c95b2[_0xe50b('0x16')]['message']);return _0x3e995f(_0x9c95b2['error'][_0xe50b('0x18')]);}logger[_0xe50b('0x16')](_0xe50b('0x17'),_0xd9fc0a,_0x9c95b2['error'][_0xe50b('0x18')]);return _0x196ec7(_0x9c95b2[_0xe50b('0x16')]['message']);}else{logger[_0xe50b('0x13')](_0xe50b('0x17'),_0xd9fc0a,'request\x20sent');_0x196ec7(_0x9c95b2[_0xe50b('0x19')][_0xe50b('0x18')]);}})[_0xe50b('0x1a')](function(_0x2f752c){logger[_0xe50b('0x16')](_0xe50b('0x17'),_0xd9fc0a,_0x2f752c);_0x3e995f(_0x2f752c);});});}function respondWithResult(_0x48f53d,_0x2051c4){_0x2051c4=_0x2051c4||0xc8;return function(_0x1fa34b){if(_0x1fa34b){return _0x48f53d['status'](_0x2051c4)[_0xe50b('0x1b')](_0x1fa34b);}};}function respondWithFilteredResult(_0x5c3900,_0x82d1a5){return function(_0x20a818){if(_0x20a818){var _0x1587c9=typeof _0x82d1a5[_0xe50b('0x1c')]===_0xe50b('0x1d')&&typeof _0x82d1a5[_0xe50b('0x1e')]==='undefined';var _0x2735c8=_0x20a818[_0xe50b('0x1f')];var _0x187bc1=_0x1587c9?0x0:_0x82d1a5[_0xe50b('0x1c')];var _0x3c5fb0=_0x1587c9?_0x20a818['count']:_0x82d1a5[_0xe50b('0x1c')]+_0x82d1a5[_0xe50b('0x1e')];var _0xc71912;if(_0x3c5fb0>=_0x2735c8){_0x3c5fb0=_0x2735c8;_0xc71912=0xc8;}else{_0xc71912=0xce;}_0x5c3900['status'](_0xc71912);return _0x5c3900[_0xe50b('0x20')]('Content-Range',_0x187bc1+'-'+_0x3c5fb0+'/'+_0x2735c8)[_0xe50b('0x1b')](_0x20a818);}return null;};}function saveUpdates(_0x5324a2){return function(_0x616643){if(_0x616643){return _0x616643[_0xe50b('0x21')](_0x5324a2)[_0xe50b('0x22')](function(_0x5b879f){return _0x5b879f;});}return null;};}function removeEntity(_0x4d9992){return function(_0x367bbf){if(_0x367bbf){return _0x367bbf[_0xe50b('0x23')]()[_0xe50b('0x22')](function(){_0x4d9992['status'](0xcc)[_0xe50b('0x24')]();});}};}function handleEntityNotFound(_0x202aad){return function(_0x493fd8){if(!_0x493fd8){_0x202aad[_0xe50b('0x25')](0x194);}return _0x493fd8;};}function handleError(_0xef6486,_0x456ecd){_0x456ecd=_0x456ecd||0x1f4;return function(_0x5b334f){logger['error'](_0x5b334f[_0xe50b('0x26')]);if(_0x5b334f[_0xe50b('0x27')]){delete _0x5b334f[_0xe50b('0x27')];}_0xef6486[_0xe50b('0x28')](_0x456ecd)[_0xe50b('0x29')](_0x5b334f);};}exports[_0xe50b('0x2a')]=function(_0x12e7b5,_0x54aba0){var _0x35812a={},_0x2db6c8={},_0x293a8b={'count':0x0,'rows':[]};var _0x5d6bbc=_[_0xe50b('0x2b')](db['MailMessage'][_0xe50b('0x2c')],function(_0x5a6d00){return{'name':_0x5a6d00[_0xe50b('0x2d')],'type':_0x5a6d00[_0xe50b('0x2e')][_0xe50b('0x2f')]};});_0x2db6c8['model']=_[_0xe50b('0x2b')](_0x5d6bbc,_0xe50b('0x27'));_0x2db6c8[_0xe50b('0x30')]=_[_0xe50b('0x31')](_0x12e7b5[_0xe50b('0x30')]);_0x2db6c8['filters']=_[_0xe50b('0x32')](_0x2db6c8[_0xe50b('0x33')],_0x2db6c8[_0xe50b('0x30')]);_0x35812a[_0xe50b('0x34')]=_[_0xe50b('0x32')](_0x2db6c8[_0xe50b('0x33')],qs[_0xe50b('0x35')](_0x12e7b5[_0xe50b('0x30')][_0xe50b('0x35')]));_0x35812a[_0xe50b('0x34')]=_0x35812a[_0xe50b('0x34')][_0xe50b('0x36')]?_0x35812a[_0xe50b('0x34')]:_0x2db6c8[_0xe50b('0x33')];if(!_0x12e7b5['query']['hasOwnProperty'](_0xe50b('0x37'))){_0x35812a[_0xe50b('0x1e')]=qs['limit'](_0x12e7b5[_0xe50b('0x30')]['limit']);_0x35812a[_0xe50b('0x1c')]=qs[_0xe50b('0x1c')](_0x12e7b5['query'][_0xe50b('0x1c')]);}_0x35812a['order']=qs[_0xe50b('0x38')](_0x12e7b5['query'][_0xe50b('0x38')]);_0x35812a['where']=qs['filters'](_[_0xe50b('0x39')](_0x12e7b5[_0xe50b('0x30')],_0x2db6c8['filters']),_0x5d6bbc);if(_0x12e7b5[_0xe50b('0x30')][_0xe50b('0x3a')]){_0x35812a[_0xe50b('0x3b')]=_[_0xe50b('0x3c')](_0x35812a[_0xe50b('0x3b')],{'$or':_[_0xe50b('0x2b')](_0x5d6bbc,function(_0x34453f){if(_0x34453f['type']!==_0xe50b('0x3d')){var _0x2ba881={};_0x2ba881[_0x34453f['name']]={'$like':'%'+_0x12e7b5[_0xe50b('0x30')][_0xe50b('0x3a')]+'%'};return _0x2ba881;}})});}_0x35812a=_[_0xe50b('0x3c')]({},_0x35812a,_0x12e7b5[_0xe50b('0x3e')]);var _0x4f9d9c={'where':_0x35812a[_0xe50b('0x3b')]};return db[_0xe50b('0x3f')]['count'](_0x4f9d9c)[_0xe50b('0x22')](function(_0x553571){_0x293a8b[_0xe50b('0x1f')]=_0x553571;if(_0x12e7b5[_0xe50b('0x30')][_0xe50b('0x40')]){_0x35812a[_0xe50b('0x41')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x35812a);})['then'](function(_0x1a8e1a){_0x293a8b['rows']=_0x1a8e1a;return _0x293a8b;})[_0xe50b('0x22')](respondWithFilteredResult(_0x54aba0,_0x35812a))[_0xe50b('0x1a')](handleError(_0x54aba0,null));};exports[_0xe50b('0x42')]=function(_0x3dc91b,_0x58235b){var _0x1c6681={'raw':!![],'where':{'id':_0x3dc91b[_0xe50b('0x43')]['id']}},_0x7474e8={};_0x7474e8[_0xe50b('0x33')]=_['keys'](db[_0xe50b('0x3f')]['rawAttributes']);_0x7474e8[_0xe50b('0x30')]=_['keys'](_0x3dc91b[_0xe50b('0x30')]);_0x7474e8[_0xe50b('0x44')]=_['intersection'](_0x7474e8[_0xe50b('0x33')],_0x7474e8[_0xe50b('0x30')]);_0x1c6681[_0xe50b('0x34')]=_[_0xe50b('0x32')](_0x7474e8[_0xe50b('0x33')],qs[_0xe50b('0x35')](_0x3dc91b['query'][_0xe50b('0x35')]));_0x1c6681['attributes']=_0x1c6681[_0xe50b('0x34')][_0xe50b('0x36')]?_0x1c6681['attributes']:_0x7474e8[_0xe50b('0x33')];if(_0x3dc91b[_0xe50b('0x30')]['includeAll']){_0x1c6681[_0xe50b('0x41')]=[{'all':!![]}];}_0x1c6681=_['merge']({},_0x1c6681,_0x3dc91b[_0xe50b('0x3e')]);return db[_0xe50b('0x3f')][_0xe50b('0x45')](_0x1c6681)[_0xe50b('0x22')](handleEntityNotFound(_0x58235b,null))[_0xe50b('0x22')](respondWithResult(_0x58235b,null))[_0xe50b('0x1a')](handleError(_0x58235b,null));};exports[_0xe50b('0x21')]=function(_0x3d7aa7,_0x2d74c4){if(_0x3d7aa7['body']['id']){delete _0x3d7aa7[_0xe50b('0x46')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x3d7aa7[_0xe50b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d74c4,null))[_0xe50b('0x22')](saveUpdates(_0x3d7aa7[_0xe50b('0x46')],null))['then'](respondWithResult(_0x2d74c4,null))[_0xe50b('0x1a')](handleError(_0x2d74c4,null));};exports[_0xe50b('0x23')]=function(_0x232a10,_0x547a0f){return db[_0xe50b('0x3f')]['find']({'where':{'id':_0x232a10[_0xe50b('0x43')]['id']}})[_0xe50b('0x22')](handleEntityNotFound(_0x547a0f,null))[_0xe50b('0x22')](removeEntity(_0x547a0f,null))[_0xe50b('0x1a')](handleError(_0x547a0f,null));};exports[_0xe50b('0x47')]=function(_0xb3a957,_0x40471b){return db[_0xe50b('0x3f')][_0xe50b('0x47')]()[_0xe50b('0x22')](respondWithResult(_0x40471b,null))[_0xe50b('0x1a')](handleError(_0x40471b,null));};exports[_0xe50b('0x48')]=function(_0x424dbf,_0x269bf8){return db[_0xe50b('0x3f')]['create'](_0x424dbf['body'])[_0xe50b('0x22')](function(_0x5b1440){if(_0x5b1440){if(_0x5b1440[_0xe50b('0x49')]===_0xe50b('0x4a')&&!_0x5b1440['secret']){var _0x5293be,_0x4d8d03,_0x6a5cd1;if(_0x424dbf[_0xe50b('0x46')]['to']){_0x4d8d03=_0x424dbf[_0xe50b('0x46')]['to'][_0xe50b('0x4b')](',')[0x0];}return db['MailAccount'][_0xe50b('0x4c')]({'where':{'id':_0x5b1440['MailAccountId']},'include':[{'model':db[_0xe50b('0x4d')],'as':'List','include':[{'model':db[_0xe50b('0x4e')],'as':_0xe50b('0x4f'),'where':{'email':_0x4d8d03},'limit':0x1,'order':[[_0xe50b('0x50'),'DESC']]}]},{'model':db[_0xe50b('0x51')],'as':'Smtp','raw':!![]}]})['then'](function(_0x1481cf){_0x5293be=_0x1481cf;if(_0x5293be&&_0x5293be['Smtp']){var _0x2c1ae7={'tls':{'rejectUnauthorized':![]}};if(_[_0xe50b('0x52')](_0x5293be['Smtp'][_0xe50b('0x53')])){_0x2c1ae7[_0xe50b('0x54')]=_0x5293be['Smtp'][_0xe50b('0x54')];_0x2c1ae7[_0xe50b('0x55')]=_0x5293be[_0xe50b('0x56')]['port'];_0x2c1ae7[_0xe50b('0x57')]=_0x5293be['Smtp'][_0xe50b('0x57')];if(_0x5293be[_0xe50b('0x56')][_0xe50b('0x58')]){_0x2c1ae7[_0xe50b('0x59')]={'user':_0x5293be['Smtp'][_0xe50b('0x5a')],'pass':_0x5293be[_0xe50b('0x56')][_0xe50b('0x5b')]};}}else{_0x2c1ae7['service']=_0x5293be[_0xe50b('0x56')][_0xe50b('0x53')];_0x2c1ae7[_0xe50b('0x59')]={'user':_0x5293be[_0xe50b('0x56')]['user'],'pass':_0x5293be['Smtp'][_0xe50b('0x5b')]};_0x2c1ae7['secure']=_0x5293be[_0xe50b('0x56')]['secure'];}if(_0x424dbf[_0xe50b('0x46')][_0xe50b('0x5c')]&&_0x424dbf[_0xe50b('0x46')][_0xe50b('0x5c')][_0xe50b('0x36')]){for(var _0x1a4afd=0x0;_0x1a4afd<_0x424dbf[_0xe50b('0x46')]['attachments'][_0xe50b('0x36')];_0x1a4afd+=0x1){_0x424dbf[_0xe50b('0x46')]['attachments'][_0x1a4afd]={'filename':_0x424dbf[_0xe50b('0x46')][_0xe50b('0x5c')][_0x1a4afd][_0xe50b('0x27')],'path':path[_0xe50b('0x5d')](config['root'],'server/files/attachments',_0x424dbf[_0xe50b('0x46')][_0xe50b('0x5c')][_0x1a4afd][_0xe50b('0x5e')])};}}_0x6a5cd1={'account':_0x2c1ae7,'message':_0x424dbf[_0xe50b('0x46')]};return;}})['then'](function(){if(_0x5293be[_0xe50b('0x5f')]){if(_0x5293be[_0xe50b('0x5f')][_0xe50b('0x4f')][_0xe50b('0x36')]){return _0x5293be[_0xe50b('0x5f')][_0xe50b('0x4f')][0x0];}else{return db[_0xe50b('0x4e')][_0xe50b('0x48')](_[_0xe50b('0xc')](_0x424dbf[_0xe50b('0x46')],{'firstName':_0x424dbf[_0xe50b('0x46')]['to'],'email':_0x424dbf[_0xe50b('0x46')]['to'],'phone':_0x424dbf[_0xe50b('0x46')]['to'],'ListId':_0x5293be[_0xe50b('0x60')]}));}}else{throw new Error(_0xe50b('0x61'));}})[_0xe50b('0x22')](function(){if(_0x6a5cd1){return respondWithRpcPromise(_0xe50b('0x62'),_0xe50b('0x63'),_0x6a5cd1,client9003)[_0xe50b('0x22')](function(_0x3c9b95){return _0x5b1440[_0xe50b('0x21')]({'read':!![],'messageId':_0x3c9b95[_0xe50b('0x64')],'sentAt':moment()[_0xe50b('0x65')](_0xe50b('0x66'))});})['catch'](function(_0x257ca2){logger[_0xe50b('0x16')]('%s',JSON[_0xe50b('0x15')](_0x257ca2));return _0x5b1440;});}return _0x5b1440;});}return _0x5b1440;}})['then'](respondWithResult(_0x269bf8,0xc9))[_0xe50b('0x1a')](handleError(_0x269bf8,null));};exports[_0xe50b('0x67')]=function(_0x1492f0,_0x16e766){var _0x138ba0={'agent':{},'channel':_0xe50b('0x68')};if(_0x1492f0['body']['id']){delete _0x1492f0[_0xe50b('0x46')]['id'];}_0x1492f0[_0xe50b('0x46')]['read']=!![];_0x1492f0[_0xe50b('0x46')][_0xe50b('0x69')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1492f0[_0xe50b('0x46')][_0xe50b('0x6a')]=_0x1492f0[_0xe50b('0x46')][_0xe50b('0x6a')]||_0x1492f0[_0xe50b('0x5a')]['id'];_0x138ba0[_0xe50b('0x6b')]['id']=_0x1492f0['body'][_0xe50b('0x6a')];return db[_0xe50b('0x3f')][_0xe50b('0x45')]({'where':{'id':_0x1492f0[_0xe50b('0x43')]['id'],'UserId':null}})[_0xe50b('0x22')](handleEntityNotFound(_0x16e766,null))[_0xe50b('0x22')](saveUpdates(_0x1492f0[_0xe50b('0x46')],null))[_0xe50b('0x22')](function(_0xf07b21){if(_0xf07b21){_0x138ba0['message']=_0xf07b21[_0xe50b('0x6c')]({'plain':!![]});return db['MailInteraction'][_0xe50b('0x45')]({'where':{'id':_0xf07b21[_0xe50b('0x6d')]}});}return null;})[_0xe50b('0x22')](handleEntityNotFound(_0x16e766,null))[_0xe50b('0x22')](function(_0x4e4059){if(_0x4e4059){return _0x4e4059[_0xe50b('0x21')]({'UserId':_0x1492f0[_0xe50b('0x46')]['UserId'],'read1stAt':_[_0xe50b('0x52')](_0x4e4059[_0xe50b('0x6e')])?moment()[_0xe50b('0x65')](_0xe50b('0x66')):undefined});}return null;})[_0xe50b('0x22')](function(_0x108559){if(_0x108559){_0x138ba0['interaction']=_0x108559[_0xe50b('0x6c')]({'plain':!![]});interaction_log[_0xe50b('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1492f0[_0xe50b('0x5a')]['id'],_0x1492f0['user'][_0xe50b('0x27')],_0x1492f0[_0xe50b('0x5a')]['role'],_0x138ba0['interaction']['id'],_0x1492f0[_0xe50b('0x46')]?JSON[_0xe50b('0x15')](_0x1492f0[_0xe50b('0x46')]):_0xe50b('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xe50b('0x70'),_0x138ba0);}return null;})[_0xe50b('0x22')](function(_0x547701){var _0x5a853c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x547701['message'][_0xe50b('0x71')];return db[_0xe50b('0x72')][_0xe50b('0x30')](_0x5a853c,{'type':db[_0xe50b('0x73')][_0xe50b('0x74')][_0xe50b('0x75')],'raw':!![]})[_0xe50b('0x22')](function(_0x369c90){return _0x369c90;});})[_0xe50b('0x22')](function(_0x59294c){if(_0x59294c){_0x138ba0[_0xe50b('0x18')][_0xe50b('0x76')]=_0x59294c[0x0];if(!_0x1492f0[_0xe50b('0x46')]['UserId'])return;return db[_0xe50b('0x77')][_0xe50b('0x45')]({'where':{'id':_0x1492f0[_0xe50b('0x46')][_0xe50b('0x6a')],'role':_0xe50b('0x6b')},'attributes':['id','name',_0xe50b('0x78'),'email',_0xe50b('0x79')],'raw':!![]});}return null;})[_0xe50b('0x22')](function(_0x493511){if(!_0x493511)return null;_0x138ba0[_0xe50b('0x18')]['agent']=_0x493511;return _0x138ba0;})['then'](function(_0x10a328){if(_0x10a328){if(_0x1492f0[_0xe50b('0x46')][_0xe50b('0x7a')]){_0x138ba0[_0xe50b('0x18')][_0xe50b('0x7b')]=util['format']('SIP/%s',_0x1492f0[_0xe50b('0x5a')][_0xe50b('0x27')]);_0x138ba0[_0xe50b('0x18')][_0xe50b('0x7c')]=_0x138ba0[_0xe50b('0x7c')];_0x138ba0[_0xe50b('0x18')][_0xe50b('0x7d')]=_0x138ba0[_0xe50b('0x7c')];_0x138ba0['message']['event']=_0xe50b('0x67');_0x138ba0['message'][_0xe50b('0x46')]=htmlToText[_0xe50b('0x7e')](_0x138ba0[_0xe50b('0x18')]['body']);return respondWithRpcPromise('EventManager',_0xe50b('0x7f'),{'event':_0xe50b('0x80'),'message':_0x138ba0[_0xe50b('0x18')]},client9002)[_0xe50b('0x22')](function(){return _0x138ba0;});}return _0x138ba0;}return null;})[_0xe50b('0x22')](respondWithResult(_0x16e766,null))[_0xe50b('0x1a')](handleError(_0x16e766,null));};exports[_0xe50b('0x81')]=function(_0xf3de7,_0x1deb07){var _0x53303b={'agent':{},'channel':_0xe50b('0x68')};if(_0xf3de7[_0xe50b('0x46')]['id']){delete _0xf3de7[_0xe50b('0x46')]['id'];}_0xf3de7['body']['UserId']=_0xf3de7[_0xe50b('0x46')][_0xe50b('0x6a')]||_0xf3de7['user']['id'];_0x53303b[_0xe50b('0x6b')]['id']=_0xf3de7[_0xe50b('0x46')][_0xe50b('0x6a')];return db[_0xe50b('0x3f')][_0xe50b('0x45')]({'where':{'id':_0xf3de7[_0xe50b('0x43')]['id'],'UserId':null}})[_0xe50b('0x22')](handleEntityNotFound(_0x1deb07,null))[_0xe50b('0x22')](function(_0x568bd9){if(_0x568bd9){_0x53303b[_0xe50b('0x18')]=_0x568bd9['get']({'plain':!![]});return db[_0xe50b('0x82')]['find']({'where':{'id':_0x568bd9['MailInteractionId']}});}return null;})[_0xe50b('0x22')](handleEntityNotFound(_0x1deb07,null))[_0xe50b('0x22')](function(_0x37a7e7){if(_0x37a7e7){_0x53303b['interaction']=_0x37a7e7[_0xe50b('0x6c')]({'plain':!![]});interaction_log[_0xe50b('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf3de7[_0xe50b('0x5a')]['id'],_0xf3de7[_0xe50b('0x5a')][_0xe50b('0x27')],_0xf3de7['user'][_0xe50b('0x83')],_0x53303b['interaction']['id'],_0xf3de7[_0xe50b('0x46')]?JSON[_0xe50b('0x15')](_0xf3de7[_0xe50b('0x46')]):_0xe50b('0x6f'));return respondWithRpcPromise(_0xe50b('0x84'),_0xe50b('0x85'),_0x53303b);}return null;})[_0xe50b('0x22')](function(_0x2cfc87){var _0x2b3967=_0xe50b('0x86')+_0x2cfc87[_0xe50b('0x18')][_0xe50b('0x71')];return db[_0xe50b('0x72')][_0xe50b('0x30')](_0x2b3967,{'type':db[_0xe50b('0x73')][_0xe50b('0x74')]['SELECT'],'raw':!![]})[_0xe50b('0x22')](function(_0x27c451){return _0x27c451;});})[_0xe50b('0x22')](function(_0x85a2b1){if(_0x85a2b1){_0x53303b[_0xe50b('0x18')][_0xe50b('0x76')]=_0x85a2b1[0x0];if(!_0xf3de7['body'][_0xe50b('0x6a')])return;return db[_0xe50b('0x77')][_0xe50b('0x45')]({'where':{'id':_0xf3de7[_0xe50b('0x46')][_0xe50b('0x6a')],'role':_0xe50b('0x6b')},'attributes':['id',_0xe50b('0x27'),_0xe50b('0x78'),_0xe50b('0x87'),_0xe50b('0x79')],'raw':!![]});}return null;})['then'](function(_0x3012f2){if(!_0x3012f2)return null;_0x53303b[_0xe50b('0x18')]['agent']=_0x3012f2;return _0x53303b;})['then'](function(_0x403c2f){if(_0x403c2f){_0x403c2f[_0xe50b('0x18')]['interface']=util[_0xe50b('0x65')](_0xe50b('0x88'),_0xf3de7[_0xe50b('0x5a')][_0xe50b('0x27')]);_0x403c2f[_0xe50b('0x18')]['channel']=_0x53303b[_0xe50b('0x7c')];_0x403c2f[_0xe50b('0x18')][_0xe50b('0x7d')]=_0x53303b['channel'];_0x403c2f[_0xe50b('0x18')][_0xe50b('0x89')]=_0xe50b('0x81');_0x403c2f[_0xe50b('0x18')]['body']=htmlToText[_0xe50b('0x7e')](_0x53303b['message'][_0xe50b('0x46')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x403c2f['message']},client9002);return _0x53303b;}return null;})[_0xe50b('0x22')](respondWithResult(_0x1deb07,null))[_0xe50b('0x1a')](handleError(_0x1deb07,null));};exports[_0xe50b('0x8a')]=function(_0x53557f,_0x256813){var _0x1bdf33=moment()['unix']()[_0xe50b('0x8b')]();var _0x50d1a7=path[_0xe50b('0x5d')](config[_0xe50b('0x8c')],_0xe50b('0x8d'),_0xe50b('0x8e'),_0xe50b('0x8f'));var _0x364eb2=path[_0xe50b('0x5d')](config[_0xe50b('0x8c')],'server','files',_0xe50b('0x5c'));var _0x413b3a=util[_0xe50b('0x65')](_0xe50b('0x90'),_0x1bdf33);return db[_0xe50b('0x3f')][_0xe50b('0x45')]({'where':{'id':_0x53557f[_0xe50b('0x43')]['id']},'attributes':['id',_0xe50b('0x46'),'from','to','cc',_0xe50b('0x91'),_0xe50b('0x92'),_0xe50b('0x93')],'include':_0x53557f[_0xe50b('0x30')][_0xe50b('0x5c')]?[{'model':db[_0xe50b('0x94')],'as':'Attachments'}]:undefined})[_0xe50b('0x22')](handleEntityNotFound(_0x256813,null))[_0xe50b('0x22')](function(_0x2d0ef){if(_0x2d0ef){var _0x1397aa=_0x2d0ef;var _0x3e7d31={'from':_0x1397aa[_0xe50b('0x95')],'to':_0x1397aa['to'],'subject':_0x1397aa[_0xe50b('0x92')],'html':htmlEntities[_0xe50b('0x96')](_0x1397aa[_0xe50b('0x46')]),'headers':{'Date':moment(_0x1397aa['createdAt'])['format'](_0xe50b('0x97'))},'attachments':[]};if(_0x2d0ef['cc']){_0x3e7d31[_0xe50b('0x98')]['Cc']=_0x2d0ef['cc'];}if(_0x2d0ef[_0xe50b('0x91')]){_0x3e7d31[_0xe50b('0x98')]['Bcc']=_0x2d0ef[_0xe50b('0x91')];}return new BPromise(function(_0xa27a87,_0x418aaa){if(_0x2d0ef[_0xe50b('0x99')]){for(var _0x34e0ff=0x0;_0x34e0ff<_0x2d0ef[_0xe50b('0x99')][_0xe50b('0x36')];_0x34e0ff++){var _0x14d78d=_0x2d0ef[_0xe50b('0x99')][_0x34e0ff];var _0x43f47b=path[_0xe50b('0x5d')](_0x364eb2,_0x14d78d[_0xe50b('0x5e')]);if(fs[_0xe50b('0x9a')](_0x43f47b)){_0x3e7d31['attachments'][_0xe50b('0x9b')]({'name':_0x14d78d[_0xe50b('0x27')],'contentType':_0x14d78d[_0xe50b('0x2e')],'data':fs[_0xe50b('0x9c')](_0x43f47b)});}}}emlformat[_0xe50b('0x9d')](_0x3e7d31,function(_0x137b3d,_0x4cf7bc){if(_0x137b3d)return _0x418aaa(_0x137b3d);fs[_0xe50b('0x9e')](path[_0xe50b('0x5d')](_0x50d1a7,_0x413b3a),_0x4cf7bc);return _0xa27a87(_0x4cf7bc);});});}})[_0xe50b('0x22')](function(_0x219133){if(_0x219133){return _0x256813[_0xe50b('0x8a')](path[_0xe50b('0x5d')](_0x50d1a7,_0x413b3a),_0x413b3a,function(_0x5a7562){if(!_0x5a7562)fs[_0xe50b('0x9f')](path[_0xe50b('0x5d')](_0x50d1a7,_0x413b3a));});}})[_0xe50b('0x1a')](handleError(_0x256813,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 824156f..f2d0a5a 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f53=['exports','events','../../mysqldb','MailMessage','save','remove','emit','hasOwnProperty'];(function(_0x455953,_0x2ee57d){var _0x2d7d6b=function(_0x1453b7){while(--_0x1453b7){_0x455953['push'](_0x455953['shift']());}};_0x2d7d6b(++_0x2ee57d);}(_0x3f53,0x111));var _0x33f5=function(_0x10be76,_0x53b4f1){_0x10be76=_0x10be76-0x0;var _0x4247fd=_0x3f53[_0x10be76];return _0x4247fd;};'use strict';var EventEmitter=require(_0x33f5('0x0'));var MailMessage=require(_0x33f5('0x1'))['db'][_0x33f5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x33f5('0x3'),'afterUpdate':'update','afterDestroy':_0x33f5('0x4')};function emitEvent(_0x1efd16){return function(_0x37c1ed,_0x2d85c5,_0x12f80d){MailMessageEvents[_0x33f5('0x5')](_0x1efd16+':'+_0x37c1ed['id'],_0x37c1ed);MailMessageEvents[_0x33f5('0x5')](_0x1efd16,_0x37c1ed);_0x12f80d(null);};}for(var e in events){if(events[_0x33f5('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x33f5('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xa2e5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','update','remove'];(function(_0x461685,_0x5ec898){var _0x314cef=function(_0x5e49cf){while(--_0x5e49cf){_0x461685['push'](_0x461685['shift']());}};_0x314cef(++_0x5ec898);}(_0xa2e5,0x130));var _0x5a2e=function(_0xbe2cfc,_0x2e129b){_0xbe2cfc=_0xbe2cfc-0x0;var _0x327b69=_0xa2e5[_0xbe2cfc];return _0x327b69;};'use strict';var EventEmitter=require(_0x5a2e('0x0'));var MailMessage=require(_0x5a2e('0x1'))['db'][_0x5a2e('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a2e('0x3'),'afterUpdate':_0x5a2e('0x4'),'afterDestroy':_0x5a2e('0x5')};function emitEvent(_0x474781){return function(_0x2ccb9f,_0x3dc431,_0x586ba5){MailMessageEvents[_0x5a2e('0x6')](_0x474781+':'+_0x2ccb9f['id'],_0x2ccb9f);MailMessageEvents['emit'](_0x474781,_0x2ccb9f);_0x586ba5(null);};}for(var e in events){if(events[_0x5a2e('0x7')](e)){var event=events[e];MailMessage[_0x5a2e('0x8')](e,emitEvent(event));}}module[_0x5a2e('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 004b7ea..b6db3ef 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x098f=['plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x098f,0x12c));var _0xf098=function(_0x887516,_0x2a2bfe){_0x887516=_0x887516-0x0;var _0x9aa21b=_0x098f[_0x887516];return _0x9aa21b;};'use strict';var _=require('lodash');var util=require(_0xf098('0x0'));var logger=require(_0xf098('0x1'))(_0xf098('0x2'));var moment=require(_0xf098('0x3'));var BPromise=require(_0xf098('0x4'));var rp=require(_0xf098('0x5'));var htmlToText=require(_0xf098('0x6'));var fs=require('fs');var path=require(_0xf098('0x7'));var rimraf=require(_0xf098('0x8'));var config=require(_0xf098('0x9'));var attributes=require(_0xf098('0xa'));module['exports']=function(_0x363be2,_0x411527){return _0x363be2['define'](_0xf098('0xb'),attributes,{'tableName':_0xf098('0xc'),'paranoid':![],'indexes':[{'name':_0xf098('0xd'),'fields':[_0xf098('0xd')]},{'name':_0xf098('0xe'),'fields':[_0xf098('0xf'),_0xf098('0x10')],'type':_0xf098('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40bc1d,_0x6eb6ed,_0xed57af){if(_0x40bc1d[_0xf098('0x12')]){_0x40bc1d[_0xf098('0xf')]=htmlToText['fromString'](_0x40bc1d[_0xf098('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xed57af(null,_0x6eb6ed);},'afterCreate':function(_0x34eebc,_0x24b6c8,_0x3a133e){var _0x3274fd=_0x363be2[_0xf098('0x13')];var _0x40699c=_0x34eebc[_0xf098('0x14')]({'plain':!![]});if(_0x40699c[_0xf098('0x15')]['toLowerCase']()==='in'||_0x40699c[_0xf098('0x15')][_0xf098('0x16')]()===_0xf098('0x17')&&!_0x40699c[_0xf098('0x18')]&&!_[_0xf098('0x19')](_0x40699c[_0xf098('0x1a')])){_0x3274fd[_0xf098('0x1b')][_0xf098('0x1c')]({'where':{'id':_0x40699c['MailInteractionId']}})['then'](function(_0x5e2692){if(_0x5e2692){_0x5e2692[_0xf098('0x1d')]({'lastMsgAt':_0x40699c[_0xf098('0x1e')],'lastMsgDirection':_0x40699c['direction'][_0xf098('0x16')]()});}})[_0xf098('0x1f')](function(_0x3c32c2){console[_0xf098('0x20')](_0x3c32c2);});}_0x3a133e();}},'charset':_0xf098('0x21'),'collate':_0xf098('0x22')});}; \ No newline at end of file +var _0xae46=['update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','then'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xae46,0x197));var _0x6ae4=function(_0x20a13a,_0x54a240){_0x20a13a=_0x20a13a-0x0;var _0x56e3d0=_0xae46[_0x20a13a];return _0x56e3d0;};'use strict';var _=require(_0x6ae4('0x0'));var util=require('util');var logger=require(_0x6ae4('0x1'))(_0x6ae4('0x2'));var moment=require(_0x6ae4('0x3'));var BPromise=require(_0x6ae4('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x6ae4('0x5'));var rimraf=require(_0x6ae4('0x6'));var config=require('../../config/environment');var attributes=require(_0x6ae4('0x7'));module[_0x6ae4('0x8')]=function(_0x436596,_0x531853){return _0x436596[_0x6ae4('0x9')](_0x6ae4('0xa'),attributes,{'tableName':_0x6ae4('0xb'),'paranoid':![],'indexes':[{'name':_0x6ae4('0xc'),'fields':[_0x6ae4('0xc')]},{'name':_0x6ae4('0xd'),'fields':[_0x6ae4('0xe'),_0x6ae4('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f47e2,_0xa50038,_0xd82d02){if(_0x1f47e2[_0x6ae4('0x10')]){_0x1f47e2[_0x6ae4('0xe')]=htmlToText['fromString'](_0x1f47e2['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xd82d02(null,_0xa50038);},'afterCreate':function(_0x13897e,_0x2d74b2,_0x3a735d){var _0x2c3ae7=_0x436596[_0x6ae4('0x11')];var _0x269ddf=_0x13897e[_0x6ae4('0x12')]({'plain':!![]});if(_0x269ddf[_0x6ae4('0x13')][_0x6ae4('0x14')]()==='in'||_0x269ddf[_0x6ae4('0x13')][_0x6ae4('0x14')]()==='out'&&!_0x269ddf['secret']&&!_[_0x6ae4('0x15')](_0x269ddf[_0x6ae4('0x16')])){_0x2c3ae7[_0x6ae4('0x17')][_0x6ae4('0x18')]({'where':{'id':_0x269ddf[_0x6ae4('0x19')]}})[_0x6ae4('0x1a')](function(_0x55ed60){if(_0x55ed60){_0x55ed60[_0x6ae4('0x1b')]({'lastMsgAt':_0x269ddf[_0x6ae4('0x1c')],'lastMsgDirection':_0x269ddf['direction'][_0x6ae4('0x14')]()});}})['catch'](function(_0x2b6625){console['error'](_0x2b6625);});}_0x3a735d();}},'charset':_0x6ae4('0x1d'),'collate':_0x6ae4('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bfe8605..de7368f 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5596ee,_0x4455fb){var _0x325ce8=function(_0x1a4521){while(--_0x1a4521){_0x5596ee['push'](_0x5596ee['shift']());}};_0x325ce8(++_0x4455fb);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5d3edd,_0x523db5){_0x5d3edd=_0x5d3edd-0x0;var _0x1ebd5e=_0x9f0e[_0x5d3edd];return _0x1ebd5e;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});}; \ No newline at end of file +var _0xd7d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','debug','stringify','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x359615,_0x2125eb){_0x359615=_0x359615-0x0;var _0x19cdc7=_0xd7d1[_0x359615];return _0x19cdc7;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});config[_0x1d7d('0xd')]=_[_0x1d7d('0xe')](config[_0x1d7d('0xd')],{'host':_0x1d7d('0xf'),'port':0x18eb});var socket=require(_0x1d7d('0x10'))(new Redis(config[_0x1d7d('0xd')]));require(_0x1d7d('0x11'))[_0x1d7d('0x12')](socket);function respondWithRpcPromise(_0x1ad06f,_0x8b258b,_0x2765fe){return new BPromise(function(_0x547f7b,_0xe6b9eb){return client['request'](_0x1ad06f,_0x2765fe)[_0x1d7d('0x13')](function(_0x3a7add){logger[_0x1d7d('0x14')](_0x1d7d('0x15'),_0x8b258b,'request\x20sent');logger[_0x1d7d('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x8b258b,'request\x20sent',JSON[_0x1d7d('0x17')](_0x3a7add));if(_0x3a7add[_0x1d7d('0x18')]){if(_0x3a7add['error']['code']===0x1f4){logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x3a7add[_0x1d7d('0x18')][_0x1d7d('0x19')]);return _0xe6b9eb(_0x3a7add[_0x1d7d('0x18')]['message']);}logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x3a7add['error'][_0x1d7d('0x19')]);return _0x547f7b(_0x3a7add[_0x1d7d('0x18')][_0x1d7d('0x19')]);}else{logger[_0x1d7d('0x14')](_0x1d7d('0x15'),_0x8b258b,'request\x20sent');_0x547f7b(_0x3a7add[_0x1d7d('0x1a')][_0x1d7d('0x19')]);}})['catch'](function(_0x495212){logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x495212);_0xe6b9eb(_0x495212);});});}exports[_0x1d7d('0x1b')]=function(_0x396802){var _0x2ae740=this;return new Promise(function(_0x275d3c,_0x54d401){return db[_0x1d7d('0x1c')][_0x1d7d('0x1d')](_0x396802[_0x1d7d('0x1e')],{'raw':_0x396802['options']?_0x396802[_0x1d7d('0x1f')][_0x1d7d('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5950bd){logger[_0x1d7d('0x14')](_0x1d7d('0x1b'),_0x396802);logger[_0x1d7d('0x16')]('CreateMailMessage',_0x396802,JSON[_0x1d7d('0x17')](_0x5950bd));_0x275d3c(_0x5950bd);})[_0x1d7d('0x21')](function(_0x2d4c0c){logger[_0x1d7d('0x18')]('CreateMailMessage',_0x2d4c0c[_0x1d7d('0x19')],_0x396802);_0x54d401(_0x2ae740[_0x1d7d('0x18')](0x1f4,_0x2d4c0c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 61a0b4a..85942c7 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c16=['register','./mailMessage.events','save','update','removeListener'];(function(_0x1fdff9,_0x4c4bf4){var _0x3d1b6e=function(_0x2fd0a8){while(--_0x2fd0a8){_0x1fdff9['push'](_0x1fdff9['shift']());}};_0x3d1b6e(++_0x4c4bf4);}(_0x1c16,0x15a));var _0x61c1=function(_0x2d5a8e,_0x333734){_0x2d5a8e=_0x2d5a8e-0x0;var _0x3d97f8=_0x1c16[_0x2d5a8e];return _0x3d97f8;};'use strict';var MailMessageEvents=require(_0x61c1('0x0'));var events=[_0x61c1('0x1'),'remove',_0x61c1('0x2')];function createListener(_0x329fe3,_0x4a8d2b){return function(_0x166aeb){_0x4a8d2b['emit'](_0x329fe3,_0x166aeb);};}function removeListener(_0x24440e,_0x5853c3){return function(){MailMessageEvents[_0x61c1('0x3')](_0x24440e,_0x5853c3);};}exports[_0x61c1('0x4')]=function(_0x496be5){for(var _0x46a9d9=0x0,_0x4bef5=events['length'];_0x46a9d9<_0x4bef5;_0x46a9d9++){var _0x1ff916=events[_0x46a9d9];var _0x2d5d1b=createListener('mailMessage:'+_0x1ff916,_0x496be5);MailMessageEvents['on'](_0x1ff916,_0x2d5d1b);}}; \ No newline at end of file +var _0x5178=['remove','update','register','length','save'];(function(_0x53b7c8,_0x33974c){var _0x29f258=function(_0x16e4dd){while(--_0x16e4dd){_0x53b7c8['push'](_0x53b7c8['shift']());}};_0x29f258(++_0x33974c);}(_0x5178,0x171));var _0x8517=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5178[_0x3b380d];return _0x54502b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){MailMessageEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('mailMessage:'+_0x10f918,_0x58ed7e);MailMessageEvents['on'](_0x10f918,_0x25146d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 84e3138..a8f5999 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe43e=['destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete'];(function(_0x9f4fc3,_0xfcd80a){var _0x13dba9=function(_0x203d51){while(--_0x203d51){_0x9f4fc3['push'](_0x9f4fc3['shift']());}};_0x13dba9(++_0xfcd80a);}(_0xe43e,0x1d3));var _0xee43=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0xe43e[_0x1ebd10];return _0x1004d3;};'use strict';var multer=require(_0xee43('0x0'));var util=require(_0xee43('0x1'));var path=require(_0xee43('0x2'));var timeout=require(_0xee43('0x3'));var express=require(_0xee43('0x4'));var router=express[_0xee43('0x5')]();var fs_extra=require(_0xee43('0x6'));var auth=require(_0xee43('0x7'));var interaction=require(_0xee43('0x8'));var config=require('../../config/environment');var controller=require(_0xee43('0x9'));router[_0xee43('0xa')]('/',auth[_0xee43('0xb')](),controller['index']);router[_0xee43('0xa')](_0xee43('0xc'),auth[_0xee43('0xb')](),controller[_0xee43('0xd')]);router[_0xee43('0xa')](_0xee43('0xe'),auth[_0xee43('0xb')](),controller['show']);router['get'](_0xee43('0xf'),auth[_0xee43('0xb')](),controller[_0xee43('0x10')]);router[_0xee43('0xa')](_0xee43('0x11'),auth[_0xee43('0xb')](),controller[_0xee43('0x12')]);router[_0xee43('0xa')](_0xee43('0x13'),auth[_0xee43('0xb')](),controller['getAgents']);router[_0xee43('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xee43('0x14')](_0xee43('0x11'),auth[_0xee43('0xb')](),controller[_0xee43('0x15')]);router['post'](_0xee43('0x13'),auth['isAuthenticated'](),controller[_0xee43('0x16')]);router[_0xee43('0x17')](_0xee43('0xe'),auth[_0xee43('0xb')](),controller[_0xee43('0x18')]);router[_0xee43('0x19')](_0xee43('0xe'),auth[_0xee43('0xb')](),controller[_0xee43('0x1a')]);router['delete'](_0xee43('0x11'),auth[_0xee43('0xb')](),controller['removeTeams']);router[_0xee43('0x19')](_0xee43('0x13'),auth['isAuthenticated'](),controller[_0xee43('0x1b')]);module[_0xee43('0x1c')]=router; \ No newline at end of file +var _0xb88b=['../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e9242,_0x2b5315){var _0x18b2ae=function(_0xfcb6ac){while(--_0xfcb6ac){_0x3e9242['push'](_0x3e9242['shift']());}};_0x18b2ae(++_0x2b5315);}(_0xb88b,0x163));var _0xbb88=function(_0x540195,_0x374b88){_0x540195=_0x540195-0x0;var _0x35f84c=_0xb88b[_0x540195];return _0x35f84c;};'use strict';var multer=require('multer');var util=require(_0xbb88('0x0'));var path=require(_0xbb88('0x1'));var timeout=require(_0xbb88('0x2'));var express=require(_0xbb88('0x3'));var router=express[_0xbb88('0x4')]();var fs_extra=require(_0xbb88('0x5'));var auth=require(_0xbb88('0x6'));var interaction=require(_0xbb88('0x7'));var config=require(_0xbb88('0x8'));var controller=require(_0xbb88('0x9'));router['get']('/',auth[_0xbb88('0xa')](),controller[_0xbb88('0xb')]);router[_0xbb88('0xc')](_0xbb88('0xd'),auth['isAuthenticated'](),controller[_0xbb88('0xe')]);router[_0xbb88('0xc')](_0xbb88('0xf'),auth[_0xbb88('0xa')](),controller[_0xbb88('0x10')]);router[_0xbb88('0xc')](_0xbb88('0x11'),auth[_0xbb88('0xa')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xbb88('0xa')](),controller[_0xbb88('0x12')]);router[_0xbb88('0xc')](_0xbb88('0x13'),auth['isAuthenticated'](),controller[_0xbb88('0x14')]);router[_0xbb88('0x15')]('/',auth[_0xbb88('0xa')](),controller[_0xbb88('0x16')]);router[_0xbb88('0x15')](_0xbb88('0x17'),auth[_0xbb88('0xa')](),controller[_0xbb88('0x18')]);router[_0xbb88('0x15')](_0xbb88('0x13'),auth[_0xbb88('0xa')](),controller[_0xbb88('0x19')]);router[_0xbb88('0x1a')](_0xbb88('0xf'),auth['isAuthenticated'](),controller[_0xbb88('0x1b')]);router[_0xbb88('0x1c')](_0xbb88('0xf'),auth[_0xbb88('0xa')](),controller[_0xbb88('0x1d')]);router[_0xbb88('0x1c')](_0xbb88('0x17'),auth[_0xbb88('0xa')](),controller[_0xbb88('0x1e')]);router[_0xbb88('0x1c')]('/:id/users',auth[_0xbb88('0xa')](),controller[_0xbb88('0x1f')]);module[_0xbb88('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index c5cad1b..97a9f8f 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05dd=['name','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0xe7880d,_0x14c4a2){var _0x3b8670=function(_0x5e379f){while(--_0x5e379f){_0xe7880d['push'](_0xe7880d['shift']());}};_0x3b8670(++_0x14c4a2);}(_0x05dd,0x147));var _0xd05d=function(_0x2ebe92,_0x1992a1){_0x2ebe92=_0x2ebe92-0x0;var _0x59cdc1=_0x05dd[_0x2ebe92];return _0x59cdc1;};'use strict';var Sequelize=require('sequelize');module[_0xd05d('0x0')]={'name':{'type':Sequelize[_0xd05d('0x1')],'unique':_0xd05d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd05d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd05d('0x3')](_0xd05d('0x4'),_0xd05d('0x5'),_0xd05d('0x6'))}}; \ No newline at end of file +var _0x439d=['beepall','exports','STRING','name','INTEGER','rrmemory'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0x439d,0x1c3));var _0xd439=function(_0x41f745,_0x4b5c4a){_0x41f745=_0x41f745-0x0;var _0x2cbbcb=_0x439d[_0x41f745];return _0x2cbbcb;};'use strict';var Sequelize=require('sequelize');module[_0xd439('0x0')]={'name':{'type':Sequelize[_0xd439('0x1')],'unique':_0xd439('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd439('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd439('0x4'),_0xd439('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2a92c98..b74a1e3 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a8c=['User','UserId','agent','mailPause','updatedAt','createdAt','count','format','%s/%s','SIP','getTeams','findOne','Team','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','ids','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','MailQueueId'];(function(_0x3ecce9,_0x49bc31){var _0x391cac=function(_0x1b1ad7){while(--_0x1b1ad7){_0x3ecce9['push'](_0x3ecce9['shift']());}};_0x391cac(++_0x49bc31);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x1b03f0,_0x43eab9){_0x1b03f0=_0x1b03f0-0x0;var _0x3003c0=_0x5a8c[_0x1b03f0];return _0x3003c0;};'use strict';var emlformat=require(_0xc5a8('0x0'));var rimraf=require(_0xc5a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5a8('0x2'));var rp=require(_0xc5a8('0x3'));var moment=require(_0xc5a8('0x4'));var BPromise=require(_0xc5a8('0x5'));var Mustache=require('mustache');var util=require(_0xc5a8('0x6'));var path=require(_0xc5a8('0x7'));var sox=require('sox');var csv=require(_0xc5a8('0x8'));var ejs=require(_0xc5a8('0x9'));var fs=require('fs');var fs_extra=require(_0xc5a8('0xa'));var _=require(_0xc5a8('0xb'));var squel=require(_0xc5a8('0xc'));var crypto=require(_0xc5a8('0xd'));var jsforce=require(_0xc5a8('0xe'));var deskjs=require(_0xc5a8('0xf'));var toCsv=require(_0xc5a8('0x8'));var querystring=require(_0xc5a8('0x10'));var Papa=require(_0xc5a8('0x11'));var Redis=require('ioredis');var authService=require(_0xc5a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc5a8('0x13'));var hardwareService=require(_0xc5a8('0x14'));var logger=require(_0xc5a8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc5a8('0x16'));var licenseUtil=require(_0xc5a8('0x17'));var db=require(_0xc5a8('0x18'))['db'];config[_0xc5a8('0x19')]=_[_0xc5a8('0x1a')](config['redis'],{'host':_0xc5a8('0x1b'),'port':0x18eb});var socket=require(_0xc5a8('0x1c'))(new Redis(config[_0xc5a8('0x19')]));require(_0xc5a8('0x1d'))[_0xc5a8('0x1e')](socket);function respondWithStatusCode(_0x219823,_0x365df5){_0x365df5=_0x365df5||0xcc;return function(_0x26d87c){if(_0x26d87c){return _0x219823[_0xc5a8('0x1f')](_0x365df5);}return _0x219823[_0xc5a8('0x20')](_0x365df5)[_0xc5a8('0x21')]();};}function respondWithResult(_0x443376,_0x393e1c){_0x393e1c=_0x393e1c||0xc8;return function(_0x1cb591){if(_0x1cb591){return _0x443376[_0xc5a8('0x20')](_0x393e1c)[_0xc5a8('0x22')](_0x1cb591);}};}function respondWithFilteredResult(_0x22b230,_0x2fb8eb){return function(_0x506c10){if(_0x506c10){var _0x134589=typeof _0x2fb8eb[_0xc5a8('0x23')]===_0xc5a8('0x24')&&typeof _0x2fb8eb[_0xc5a8('0x25')]==='undefined';var _0x326baf=_0x506c10['count'];var _0x36cc16=_0x134589?0x0:_0x2fb8eb[_0xc5a8('0x23')];var _0x35ac5a=_0x134589?_0x506c10['count']:_0x2fb8eb['offset']+_0x2fb8eb['limit'];var _0x332ee2;if(_0x35ac5a>=_0x326baf){_0x35ac5a=_0x326baf;_0x332ee2=0xc8;}else{_0x332ee2=0xce;}_0x22b230[_0xc5a8('0x20')](_0x332ee2);return _0x22b230[_0xc5a8('0x26')](_0xc5a8('0x27'),_0x36cc16+'-'+_0x35ac5a+'/'+_0x326baf)['json'](_0x506c10);}return null;};}function patchUpdates(_0x1a8662){return function(_0x8b6473){try{jsonpatch[_0xc5a8('0x28')](_0x8b6473,_0x1a8662,!![]);}catch(_0x36d2c6){return BPromise['reject'](_0x36d2c6);}return _0x8b6473[_0xc5a8('0x29')]();};}function saveUpdates(_0x4865dd,_0x25e56d){return function(_0x4616ec){if(_0x4616ec){return _0x4616ec[_0xc5a8('0x2a')](_0x4865dd)[_0xc5a8('0x2b')](function(_0x5c8705){return _0x5c8705;});}return null;};}function removeEntity(_0x3448c1,_0x459694){return function(_0x208333){if(_0x208333){return _0x208333[_0xc5a8('0x2c')]()[_0xc5a8('0x2b')](function(){var _0x1a49ad=_0x208333[_0xc5a8('0x2d')]({'plain':!![]});var _0x165ee0='MailQueues';return db[_0xc5a8('0x2e')]['destroy']({'where':{'type':_0x165ee0,'resourceId':_0x1a49ad['id']}})[_0xc5a8('0x2b')](function(){return _0x208333;});})['then'](function(){_0x3448c1[_0xc5a8('0x20')](0xcc)[_0xc5a8('0x21')]();});}};}function handleEntityNotFound(_0x505b27,_0x10569a){return function(_0x2aa6d6){if(!_0x2aa6d6){_0x505b27[_0xc5a8('0x1f')](0x194);}return _0x2aa6d6;};}function handleError(_0x2102c7,_0xa7f8f2){_0xa7f8f2=_0xa7f8f2||0x1f4;return function(_0x2d7fae){logger[_0xc5a8('0x2f')](_0x2d7fae[_0xc5a8('0x30')]);if(_0x2d7fae[_0xc5a8('0x31')]){delete _0x2d7fae[_0xc5a8('0x31')];}_0x2102c7[_0xc5a8('0x20')](_0xa7f8f2)[_0xc5a8('0x32')](_0x2d7fae);};}exports[_0xc5a8('0x33')]=function(_0x3c1b7c,_0x434d67){var _0x25ebbd={},_0x702dba={},_0x11a820={'count':0x0,'rows':[]};var _0x450e89=_[_0xc5a8('0x34')](db[_0xc5a8('0x35')][_0xc5a8('0x36')],function(_0x2906f4){return{'name':_0x2906f4['fieldName'],'type':_0x2906f4['type'][_0xc5a8('0x37')]};});_0x702dba[_0xc5a8('0x38')]=_[_0xc5a8('0x34')](_0x450e89,'name');_0x702dba[_0xc5a8('0x39')]=_[_0xc5a8('0x3a')](_0x3c1b7c[_0xc5a8('0x39')]);_0x702dba[_0xc5a8('0x3b')]=_['intersection'](_0x702dba['model'],_0x702dba['query']);_0x25ebbd[_0xc5a8('0x3c')]=_[_0xc5a8('0x3d')](_0x702dba[_0xc5a8('0x38')],qs[_0xc5a8('0x3e')](_0x3c1b7c[_0xc5a8('0x39')]['fields']));_0x25ebbd[_0xc5a8('0x3c')]=_0x25ebbd[_0xc5a8('0x3c')]['length']?_0x25ebbd[_0xc5a8('0x3c')]:_0x702dba['model'];if(!_0x3c1b7c[_0xc5a8('0x39')][_0xc5a8('0x3f')](_0xc5a8('0x40'))){_0x25ebbd[_0xc5a8('0x25')]=qs[_0xc5a8('0x25')](_0x3c1b7c[_0xc5a8('0x39')]['limit']);_0x25ebbd[_0xc5a8('0x23')]=qs[_0xc5a8('0x23')](_0x3c1b7c[_0xc5a8('0x39')][_0xc5a8('0x23')]);}_0x25ebbd[_0xc5a8('0x41')]=qs[_0xc5a8('0x42')](_0x3c1b7c[_0xc5a8('0x39')][_0xc5a8('0x42')]);_0x25ebbd['where']=qs[_0xc5a8('0x3b')](_[_0xc5a8('0x43')](_0x3c1b7c[_0xc5a8('0x39')],_0x702dba[_0xc5a8('0x3b')]),_0x450e89);if(_0x3c1b7c['query'][_0xc5a8('0x44')]){_0x25ebbd['where']=_[_0xc5a8('0x45')](_0x25ebbd[_0xc5a8('0x46')],{'$or':_[_0xc5a8('0x34')](_0x450e89,function(_0x521f76){if(_0x521f76[_0xc5a8('0x47')]!==_0xc5a8('0x48')){var _0x1a8423={};_0x1a8423[_0x521f76['name']]={'$like':'%'+_0x3c1b7c['query']['filter']+'%'};return _0x1a8423;}})});}_0x25ebbd=_[_0xc5a8('0x45')]({},_0x25ebbd,_0x3c1b7c[_0xc5a8('0x49')]);var _0xfa8f3b={'where':_0x25ebbd['where']};return db[_0xc5a8('0x35')]['count'](_0xfa8f3b)['then'](function(_0x5b2284){_0x11a820['count']=_0x5b2284;if(_0x3c1b7c['query']['includeAll']){_0x25ebbd[_0xc5a8('0x4a')]=[{'all':!![]}];}return db[_0xc5a8('0x35')][_0xc5a8('0x4b')](_0x25ebbd);})[_0xc5a8('0x2b')](function(_0x922cc4){_0x11a820[_0xc5a8('0x4c')]=_0x922cc4;return _0x11a820;})[_0xc5a8('0x2b')](respondWithFilteredResult(_0x434d67,_0x25ebbd))[_0xc5a8('0x4d')](handleError(_0x434d67,null));};exports[_0xc5a8('0x4e')]=function(_0x4c5755,_0x1a16ef){var _0x3cd62f={'raw':!![],'where':{'id':_0x4c5755[_0xc5a8('0x4f')]['id']}},_0x18a655={};_0x18a655['model']=_[_0xc5a8('0x3a')](db[_0xc5a8('0x35')][_0xc5a8('0x36')]);_0x18a655[_0xc5a8('0x39')]=_['keys'](_0x4c5755['query']);_0x18a655[_0xc5a8('0x3b')]=_[_0xc5a8('0x3d')](_0x18a655[_0xc5a8('0x38')],_0x18a655['query']);_0x3cd62f[_0xc5a8('0x3c')]=_[_0xc5a8('0x3d')](_0x18a655[_0xc5a8('0x38')],qs[_0xc5a8('0x3e')](_0x4c5755[_0xc5a8('0x39')]['fields']));_0x3cd62f[_0xc5a8('0x3c')]=_0x3cd62f['attributes'][_0xc5a8('0x50')]?_0x3cd62f[_0xc5a8('0x3c')]:_0x18a655['model'];if(_0x4c5755['query'][_0xc5a8('0x51')]){_0x3cd62f[_0xc5a8('0x4a')]=[{'all':!![]}];}_0x3cd62f=_['merge']({},_0x3cd62f,_0x4c5755['options']);return db[_0xc5a8('0x35')][_0xc5a8('0x52')](_0x3cd62f)[_0xc5a8('0x2b')](handleEntityNotFound(_0x1a16ef,null))[_0xc5a8('0x2b')](respondWithResult(_0x1a16ef,null))[_0xc5a8('0x4d')](handleError(_0x1a16ef,null));};exports[_0xc5a8('0x53')]=function(_0x594d7a,_0x534136){return db['MailQueue']['create'](_0x594d7a[_0xc5a8('0x54')],{})[_0xc5a8('0x2b')](function(_0x796f8a){var _0x4a930c=_0x594d7a['user'][_0xc5a8('0x2d')]({'plain':!![]});if(!_0x4a930c)throw new Error(_0xc5a8('0x55'));if(_0x4a930c['role']==='user'){var _0x65798f=_0x796f8a[_0xc5a8('0x2d')]({'plain':!![]});var _0xa227dd='MailQueues';return db[_0xc5a8('0x56')][_0xc5a8('0x52')]({'where':{'name':_0xa227dd,'userProfileId':_0x4a930c[_0xc5a8('0x57')]},'raw':!![]})[_0xc5a8('0x2b')](function(_0x3be874){if(_0x3be874&&_0x3be874[_0xc5a8('0x58')]===0x0){return db['UserProfileResource'][_0xc5a8('0x53')]({'name':_0x65798f[_0xc5a8('0x31')],'resourceId':_0x65798f['id'],'type':_0x3be874[_0xc5a8('0x31')],'sectionId':_0x3be874['id']},{})['then'](function(){return _0x796f8a;});}else{return _0x796f8a;}})[_0xc5a8('0x4d')](function(_0x86f7cc){logger[_0xc5a8('0x2f')](_0xc5a8('0x59'),_0x86f7cc);throw _0x86f7cc;});}return _0x796f8a;})[_0xc5a8('0x2b')](respondWithResult(_0x534136,0xc9))[_0xc5a8('0x4d')](handleError(_0x534136,null));};exports[_0xc5a8('0x2a')]=function(_0x2a8e77,_0x10250c){if(_0x2a8e77[_0xc5a8('0x54')]['id']){delete _0x2a8e77['body']['id'];}return db['MailQueue'][_0xc5a8('0x52')]({'where':{'id':_0x2a8e77[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x10250c,null))[_0xc5a8('0x2b')](saveUpdates(_0x2a8e77[_0xc5a8('0x54')],null))['then'](respondWithResult(_0x10250c,null))[_0xc5a8('0x4d')](handleError(_0x10250c,null));};exports[_0xc5a8('0x2c')]=function(_0x567f10,_0x15f177){return db[_0xc5a8('0x35')][_0xc5a8('0x52')]({'where':{'id':_0x567f10[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x15f177,null))[_0xc5a8('0x2b')](removeEntity(_0x15f177,null))[_0xc5a8('0x4d')](handleError(_0x15f177,null));};exports['describe']=function(_0x3ba2b1,_0x53b074){return db[_0xc5a8('0x35')][_0xc5a8('0x5a')]()[_0xc5a8('0x2b')](respondWithResult(_0x53b074,null))[_0xc5a8('0x4d')](handleError(_0x53b074,null));};exports[_0xc5a8('0x5b')]=function(_0x2570d6,_0x561985,_0x3a3986){var _0x1d911c={'raw':!![],'where':{}},_0x423b7e={},_0x22bfc3;return db['MailQueue']['findOne']({'where':{'id':_0x2570d6['params']['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x561985,null))['then'](function(_0x58c900){if(_0x58c900){_0x22bfc3=_0x58c900['get']({'plain':!![]});_0x423b7e[_0xc5a8('0x38')]=_[_0xc5a8('0x3a')](db[_0xc5a8('0x5c')][_0xc5a8('0x36')]);_0x423b7e['query']=_[_0xc5a8('0x3a')](_0x2570d6['query']);_0x423b7e[_0xc5a8('0x3b')]=_[_0xc5a8('0x3d')](_0x423b7e['model'],_0x423b7e[_0xc5a8('0x39')]);_0x1d911c[_0xc5a8('0x3c')]=_['intersection'](_0x423b7e[_0xc5a8('0x38')],qs[_0xc5a8('0x3e')](_0x2570d6[_0xc5a8('0x39')][_0xc5a8('0x3e')]));_0x1d911c[_0xc5a8('0x3c')]=_0x1d911c[_0xc5a8('0x3c')][_0xc5a8('0x50')]?_0x1d911c[_0xc5a8('0x3c')]:_0x423b7e[_0xc5a8('0x38')];if(!_0x2570d6[_0xc5a8('0x39')][_0xc5a8('0x3f')](_0xc5a8('0x40'))){_0x1d911c[_0xc5a8('0x25')]=qs[_0xc5a8('0x25')](_0x2570d6[_0xc5a8('0x39')]['limit']);_0x1d911c[_0xc5a8('0x23')]=qs[_0xc5a8('0x23')](_0x2570d6['query'][_0xc5a8('0x23')]);}_0x1d911c[_0xc5a8('0x41')]=qs[_0xc5a8('0x42')](_0x2570d6['query'][_0xc5a8('0x42')]);_0x1d911c['where']=qs['filters'](_['pick'](_0x2570d6[_0xc5a8('0x39')],_0x423b7e[_0xc5a8('0x3b')]));_0x1d911c[_0xc5a8('0x46')][_0xc5a8('0x5d')]=_0x58c900['id'];if(_0x2570d6[_0xc5a8('0x39')][_0xc5a8('0x44')]){_0x1d911c[_0xc5a8('0x46')]=_[_0xc5a8('0x45')](_0x1d911c['where'],{'$or':_[_0xc5a8('0x34')](_0x1d911c['attributes'],function(_0x3418b0){var _0x553463={};_0x553463[_0x3418b0]={'$like':'%'+_0x2570d6[_0xc5a8('0x39')]['filter']+'%'};return _0x553463;})});}_0x1d911c=_['merge']({},_0x1d911c,_0x2570d6[_0xc5a8('0x49')]);return db[_0xc5a8('0x5c')]['findAll'](_0x1d911c);}})['then'](function(_0x23a5aa){if(_0x23a5aa){return db[_0xc5a8('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x23a5aa,_0xc5a8('0x5f')),'role':_0xc5a8('0x60')},'attributes':['id',_0xc5a8('0x31'),_0xc5a8('0x61'),_0xc5a8('0x62'),_0xc5a8('0x63')]});}})[_0xc5a8('0x2b')](function(_0x1f7699){if(_0x1f7699){return{'count':_0x1f7699[_0xc5a8('0x64')],'rows':_['map'](_0x1f7699[_0xc5a8('0x4c')],function(_0x358b68){return{'membername':_0x358b68[_0xc5a8('0x31')],'UserId':_0x358b68['id'],'queue_name':_0x22bfc3[_0xc5a8('0x31')],'MailQueueId':_0x22bfc3['id'],'interface':util[_0xc5a8('0x65')](_0xc5a8('0x66'),_0xc5a8('0x67'),_0x358b68[_0xc5a8('0x31')]),'penalty':0x0,'paused':_0x358b68[_0xc5a8('0x61')],'createdAt':_0x358b68[_0xc5a8('0x63')],'updatedAt':_0x358b68['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x561985,_0x1d911c))[_0xc5a8('0x4d')](handleError(_0x561985,null));};exports[_0xc5a8('0x68')]=function(_0x374f7e,_0x5d3012,_0x25cbcb){var _0x3f5200={};var _0x3fd9d9={};var _0x5a4f99;var _0x510a99;return db[_0xc5a8('0x35')][_0xc5a8('0x69')]({'where':{'id':_0x374f7e[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x5d3012,null))['then'](function(_0x1edc2a){if(_0x1edc2a){_0x5a4f99=_0x1edc2a;_0x3fd9d9[_0xc5a8('0x38')]=_[_0xc5a8('0x3a')](db[_0xc5a8('0x6a')][_0xc5a8('0x36')]);_0x3fd9d9['query']=_[_0xc5a8('0x3a')](_0x374f7e[_0xc5a8('0x39')]);_0x3fd9d9[_0xc5a8('0x3b')]=_['intersection'](_0x3fd9d9['model'],_0x3fd9d9[_0xc5a8('0x39')]);_0x3f5200['attributes']=_[_0xc5a8('0x3d')](_0x3fd9d9[_0xc5a8('0x38')],qs[_0xc5a8('0x3e')](_0x374f7e[_0xc5a8('0x39')][_0xc5a8('0x3e')]));_0x3f5200[_0xc5a8('0x3c')]=_0x3f5200[_0xc5a8('0x3c')]['length']?_0x3f5200[_0xc5a8('0x3c')]:_0x3fd9d9['model'];_0x3f5200[_0xc5a8('0x41')]=qs[_0xc5a8('0x42')](_0x374f7e[_0xc5a8('0x39')]['sort']);_0x3f5200[_0xc5a8('0x46')]=qs[_0xc5a8('0x3b')](_['pick'](_0x374f7e['query'],_0x3fd9d9[_0xc5a8('0x3b')]));if(_0x374f7e[_0xc5a8('0x39')][_0xc5a8('0x44')]){_0x3f5200[_0xc5a8('0x46')]=_[_0xc5a8('0x45')](_0x3f5200['where'],{'$or':_[_0xc5a8('0x34')](_0x3f5200[_0xc5a8('0x3c')],function(_0x465150){var _0x35708b={};_0x35708b[_0x465150]={'$like':'%'+_0x374f7e[_0xc5a8('0x39')][_0xc5a8('0x44')]+'%'};return _0x35708b;})});}_0x3f5200=_[_0xc5a8('0x45')]({},_0x3f5200,_0x374f7e[_0xc5a8('0x49')]);return _0x5a4f99[_0xc5a8('0x68')](_0x3f5200);}})[_0xc5a8('0x2b')](function(_0x470c9f){if(_0x470c9f){_0x510a99=_0x470c9f['length'];if(!_0x374f7e['query'][_0xc5a8('0x3f')]('nolimit')){_0x3f5200['limit']=qs[_0xc5a8('0x25')](_0x374f7e[_0xc5a8('0x39')][_0xc5a8('0x25')]);_0x3f5200[_0xc5a8('0x23')]=qs[_0xc5a8('0x23')](_0x374f7e[_0xc5a8('0x39')][_0xc5a8('0x23')]);}return _0x5a4f99[_0xc5a8('0x68')](_0x3f5200);}})[_0xc5a8('0x2b')](function(_0x350e34){if(_0x350e34){return _0x350e34?{'count':_0x510a99,'rows':_0x350e34}:null;}})[_0xc5a8('0x2b')](respondWithResult(_0x5d3012,null))[_0xc5a8('0x4d')](handleError(_0x5d3012,null));};exports['addTeams']=function(_0x2b6452,_0x58d1c2,_0x3d5c19){var _0x442da0=_0x2b6452[_0xc5a8('0x54')]['ids'];return db[_0xc5a8('0x6a')][_0xc5a8('0x4b')]({'where':{'id':_0x442da0},'attributes':['id'],'include':[{'model':db[_0xc5a8('0x5e')],'as':_0xc5a8('0x6b'),'attributes':['id',_0xc5a8('0x31'),_0xc5a8('0x6c'),_0xc5a8('0x6d'),'interface'],'raw':!![]}]})[_0xc5a8('0x2b')](function(_0x4c4a40){if(_0x4c4a40){var _0x451212=_[_0xc5a8('0x6e')](_0x4c4a40,function(_0x357879){var _0x583020=_0x357879[_0xc5a8('0x2d')]({'plain':!![]});return _0x583020[_0xc5a8('0x6b')];});return db[_0xc5a8('0x35')]['find']({'where':{'id':_0x2b6452['params']['id']}})['then'](function(_0x10d6b1){return db[_0xc5a8('0x6f')][_0xc5a8('0x70')](function(_0x4a4699){return _0x10d6b1[_0xc5a8('0x71')](_0x442da0,{'transaction':_0x4a4699})[_0xc5a8('0x2b')](function(){return BPromise[_0xc5a8('0x72')](_0x451212,function(_0x1b1e7c){return db[_0xc5a8('0x5c')][_0xc5a8('0x73')]({'where':{'UserId':_0x1b1e7c['id'],'MailQueueId':_0x2b6452[_0xc5a8('0x4f')]['id']},'transaction':_0x4a4699});});})[_0xc5a8('0x2b')](function(){_0x451212[_0xc5a8('0x74')](function(_0x2b552e){socket[_0xc5a8('0x75')](_0xc5a8('0x76'),{'UserId':_0x2b552e['id'],'MailQueueId':_0x10d6b1['id']});});});});});}})[_0xc5a8('0x2b')](respondWithStatusCode(_0x58d1c2,null))[_0xc5a8('0x4d')](handleError(_0x58d1c2,null));};exports[_0xc5a8('0x77')]=function(_0x496776,_0x1efa66,_0x8b52e9){return db[_0xc5a8('0x6a')][_0xc5a8('0x4b')]({'where':{'id':_0x496776[_0xc5a8('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5a8('0x2b')](handleEntityNotFound(_0x1efa66,null))[_0xc5a8('0x2b')](function(_0x2df4c8){var _0x468285=_[_0xc5a8('0x34')](_0x2df4c8,'id');var _0x3eac0d=[];var _0x2569ba=[];var _0x115485=squel[_0xc5a8('0x78')]();_0x115485[_0xc5a8('0x79')](_0xc5a8('0x7a'))['from']('team_has_mail_queues','tq')['join'](_0xc5a8('0x7b'),'ut',_0xc5a8('0x7c'))[_0xc5a8('0x46')](_0xc5a8('0x7d'),_0x496776['params']['id']);for(var _0x3a967a=0x0;_0x3a967a<_0x2df4c8[_0xc5a8('0x50')];_0x3a967a+=0x1){let _0x5480ee=_0x2df4c8[_0x3a967a];for(var _0x5e4c82=0x0;_0x5e4c82<_0x5480ee['Agents'][_0xc5a8('0x50')];_0x5e4c82+=0x1){let _0x37f115=_0x5480ee[_0xc5a8('0x6b')][_0x5e4c82];var _0x26dd09=_0x115485[_0xc5a8('0x7e')]();_0x26dd09['where']('ut.UserId\x20=\x20?',_0x37f115['id']);_0x2569ba['push'](db['sequelize'][_0xc5a8('0x39')](_0x26dd09[_0xc5a8('0x7f')](),{'type':db[_0xc5a8('0x6f')][_0xc5a8('0x80')][_0xc5a8('0x81')]})[_0xc5a8('0x2b')](function(_0x347e89){if(_0x347e89[_0xc5a8('0x50')]===0x1){return _0x37f115['id'];}else{var _0x30101a=_['every'](_['map'](_0x347e89,'TeamId'),function(_0x49cb46){return _['includes'](_0x468285,_0x49cb46);});if(_0x30101a){return _0x37f115['id'];}}}));}}return BPromise[_0xc5a8('0x82')](_0x2569ba)[_0xc5a8('0x2b')](function(_0x236200){_0x3eac0d=_(_0x3eac0d)['union'](_0x236200)[_0xc5a8('0x83')]()[_0xc5a8('0x84')]();return db[_0xc5a8('0x35')]['find']({'where':{'id':_0x496776[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](function(_0x29c0fe){return db[_0xc5a8('0x6f')][_0xc5a8('0x70')](function(_0x2f8302){return _0x29c0fe['removeTeams'](_0x496776['query']['ids'],{'transaction':_0x2f8302})['then'](function(){if(!_[_0xc5a8('0x85')](_0x3eac0d)){return _0x29c0fe[_0xc5a8('0x86')](_0x3eac0d,{'transaction':_0x2f8302});}})[_0xc5a8('0x2b')](function(){_0x3eac0d['forEach'](function(_0x5b26a9){socket[_0xc5a8('0x75')](_0xc5a8('0x87'),{'UserId':_0x5b26a9,'MailQueueId':_0x29c0fe['id']});});});});});});})[_0xc5a8('0x2b')](respondWithStatusCode(_0x1efa66,null))['catch'](handleError(_0x1efa66,null));};exports['addAgents']=function(_0x1f7c09,_0x30bb1a,_0x4d868e){return db[_0xc5a8('0x35')][_0xc5a8('0x52')]({'where':{'id':_0x1f7c09[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x30bb1a,null))[_0xc5a8('0x2b')](function(_0x41e5f6){if(_0x41e5f6){return _0x41e5f6[_0xc5a8('0x88')](_0x1f7c09[_0xc5a8('0x54')][_0xc5a8('0x89')],_[_0xc5a8('0x8a')](_0x1f7c09[_0xc5a8('0x54')],[_0xc5a8('0x89'),'id'])||{})[_0xc5a8('0x8b')](function(_0x3e9645){for(var _0x49e87f=0x0;_0x49e87f<_0x1f7c09[_0xc5a8('0x54')]['ids'][_0xc5a8('0x50')];_0x49e87f+=0x1){socket[_0xc5a8('0x75')](_0xc5a8('0x76'),{'UserId':Number(_0x1f7c09[_0xc5a8('0x54')][_0xc5a8('0x89')][_0x49e87f]),'MailQueueId':Number(_0x1f7c09[_0xc5a8('0x4f')]['id'])});}return _0x3e9645;});}})[_0xc5a8('0x2b')](respondWithResult(_0x30bb1a,null))['catch'](handleError(_0x30bb1a,null));};exports['removeAgents']=function(_0x59a74f,_0x54b003,_0x5b8053){return db[_0xc5a8('0x35')][_0xc5a8('0x52')]({'where':{'id':_0x59a74f[_0xc5a8('0x4f')]['id']}})[_0xc5a8('0x2b')](handleEntityNotFound(_0x54b003,null))[_0xc5a8('0x2b')](function(_0x524016){if(_0x524016){return _0x524016[_0xc5a8('0x86')](_0x59a74f['query'][_0xc5a8('0x89')])[_0xc5a8('0x2b')](function(){if(_[_0xc5a8('0x8c')](_0x59a74f['query'][_0xc5a8('0x89')])){for(var _0x16c1a1=0x0;_0x16c1a1<_0x59a74f['query'][_0xc5a8('0x89')][_0xc5a8('0x50')];_0x16c1a1+=0x1){socket[_0xc5a8('0x75')](_0xc5a8('0x87'),{'UserId':Number(_0x59a74f[_0xc5a8('0x39')]['ids'][_0x16c1a1]),'MailQueueId':Number(_0x59a74f['params']['id'])});}}else{socket[_0xc5a8('0x75')](_0xc5a8('0x87'),{'UserId':Number(_0x59a74f[_0xc5a8('0x39')][_0xc5a8('0x89')]),'MailQueueId':Number(_0x59a74f[_0xc5a8('0x4f')]['id'])});}});}})[_0xc5a8('0x2b')](respondWithStatusCode(_0x54b003,null))[_0xc5a8('0x4d')](handleError(_0x54b003,null));};exports[_0xc5a8('0x8d')]=function(_0x47c50e,_0x693602,_0x4a85fa){var _0x5280e4={};var _0x378a26={};var _0x42fa60;var _0x3fa9ea;return db[_0xc5a8('0x35')][_0xc5a8('0x69')]({'where':{'id':_0x47c50e[_0xc5a8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x693602,null))[_0xc5a8('0x2b')](function(_0x537435){if(_0x537435){_0x42fa60=_0x537435;_0x378a26[_0xc5a8('0x38')]=_[_0xc5a8('0x3a')](db[_0xc5a8('0x5e')]['rawAttributes']);_0x378a26[_0xc5a8('0x39')]=_['keys'](_0x47c50e[_0xc5a8('0x39')]);_0x378a26[_0xc5a8('0x3b')]=_[_0xc5a8('0x3d')](_0x378a26[_0xc5a8('0x38')],_0x378a26[_0xc5a8('0x39')]);_0x5280e4[_0xc5a8('0x3c')]=_[_0xc5a8('0x3d')](_0x378a26[_0xc5a8('0x38')],qs[_0xc5a8('0x3e')](_0x47c50e[_0xc5a8('0x39')][_0xc5a8('0x3e')]));_0x5280e4['attributes']=_0x5280e4[_0xc5a8('0x3c')][_0xc5a8('0x50')]?_0x5280e4[_0xc5a8('0x3c')]:_0x378a26[_0xc5a8('0x38')];_0x5280e4['order']=qs[_0xc5a8('0x42')](_0x47c50e['query'][_0xc5a8('0x42')]);_0x5280e4[_0xc5a8('0x46')]=qs[_0xc5a8('0x3b')](_[_0xc5a8('0x43')](_0x47c50e[_0xc5a8('0x39')],_0x378a26[_0xc5a8('0x3b')]));if(_0x47c50e[_0xc5a8('0x39')]['filter']){_0x5280e4[_0xc5a8('0x46')]=_[_0xc5a8('0x45')](_0x5280e4['where'],{'$or':_[_0xc5a8('0x34')](_0x5280e4[_0xc5a8('0x3c')],function(_0x2dc6fe){var _0x1177bb={};_0x1177bb[_0x2dc6fe]={'$like':'%'+_0x47c50e[_0xc5a8('0x39')][_0xc5a8('0x44')]+'%'};return _0x1177bb;})});}_0x5280e4=_[_0xc5a8('0x45')]({},_0x5280e4,_0x47c50e[_0xc5a8('0x49')]);return _0x42fa60['getAgents'](_0x5280e4);}})[_0xc5a8('0x2b')](function(_0x3ab220){if(_0x3ab220){_0x3fa9ea=_0x3ab220['length'];if(!_0x47c50e[_0xc5a8('0x39')]['hasOwnProperty'](_0xc5a8('0x40'))){_0x5280e4[_0xc5a8('0x25')]=qs[_0xc5a8('0x25')](_0x47c50e['query'][_0xc5a8('0x25')]);_0x5280e4[_0xc5a8('0x23')]=qs['offset'](_0x47c50e['query'][_0xc5a8('0x23')]);}return _0x42fa60[_0xc5a8('0x8d')](_0x5280e4);}})[_0xc5a8('0x2b')](function(_0x3d5307){if(_0x3d5307){return _0x3d5307?{'count':_0x3fa9ea,'rows':_0x3d5307}:null;}})[_0xc5a8('0x2b')](respondWithResult(_0x693602,null))[_0xc5a8('0x4d')](handleError(_0x693602,null));}; \ No newline at end of file +var _0x8113=['UserId','mailPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','spread','emit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','MailQueueId','UserMailQueue','User','findAndCountAll'];(function(_0x30fe8c,_0x272cb9){var _0x4f1068=function(_0x5f52c7){while(--_0x5f52c7){_0x30fe8c['push'](_0x30fe8c['shift']());}};_0x4f1068(++_0x272cb9);}(_0x8113,0x1df));var _0x3811=function(_0x41c622,_0x4fa506){_0x41c622=_0x41c622-0x0;var _0x3c2b70=_0x8113[_0x41c622];return _0x3c2b70;};'use strict';var emlformat=require(_0x3811('0x0'));var rimraf=require(_0x3811('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3811('0x2'));var rp=require(_0x3811('0x3'));var moment=require(_0x3811('0x4'));var BPromise=require(_0x3811('0x5'));var Mustache=require(_0x3811('0x6'));var util=require(_0x3811('0x7'));var path=require(_0x3811('0x8'));var sox=require(_0x3811('0x9'));var csv=require(_0x3811('0xa'));var ejs=require(_0x3811('0xb'));var fs=require('fs');var fs_extra=require(_0x3811('0xc'));var _=require(_0x3811('0xd'));var squel=require(_0x3811('0xe'));var crypto=require(_0x3811('0xf'));var jsforce=require(_0x3811('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3811('0xa'));var querystring=require(_0x3811('0x11'));var Papa=require(_0x3811('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3811('0x13'));var as=require(_0x3811('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3811('0x15'));var utils=require(_0x3811('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3811('0x17')]=_[_0x3811('0x18')](config[_0x3811('0x17')],{'host':_0x3811('0x19'),'port':0x18eb});var socket=require(_0x3811('0x1a'))(new Redis(config[_0x3811('0x17')]));require('./mailQueue.socket')[_0x3811('0x1b')](socket);function respondWithStatusCode(_0x1b3154,_0x4c66a4){_0x4c66a4=_0x4c66a4||0xcc;return function(_0x125a46){if(_0x125a46){return _0x1b3154[_0x3811('0x1c')](_0x4c66a4);}return _0x1b3154[_0x3811('0x1d')](_0x4c66a4)[_0x3811('0x1e')]();};}function respondWithResult(_0x4d1ff1,_0x391481){_0x391481=_0x391481||0xc8;return function(_0x1c13a3){if(_0x1c13a3){return _0x4d1ff1[_0x3811('0x1d')](_0x391481)['json'](_0x1c13a3);}};}function respondWithFilteredResult(_0xf12416,_0x2adce7){return function(_0x59878a){if(_0x59878a){var _0x24d8d4=typeof _0x2adce7[_0x3811('0x1f')]===_0x3811('0x20')&&typeof _0x2adce7[_0x3811('0x21')]==='undefined';var _0x5caefd=_0x59878a['count'];var _0x4791cb=_0x24d8d4?0x0:_0x2adce7[_0x3811('0x1f')];var _0x2ae263=_0x24d8d4?_0x59878a[_0x3811('0x22')]:_0x2adce7[_0x3811('0x1f')]+_0x2adce7[_0x3811('0x21')];var _0x16d9b4;if(_0x2ae263>=_0x5caefd){_0x2ae263=_0x5caefd;_0x16d9b4=0xc8;}else{_0x16d9b4=0xce;}_0xf12416[_0x3811('0x1d')](_0x16d9b4);return _0xf12416[_0x3811('0x23')](_0x3811('0x24'),_0x4791cb+'-'+_0x2ae263+'/'+_0x5caefd)[_0x3811('0x25')](_0x59878a);}return null;};}function patchUpdates(_0x203aa6){return function(_0x50ca5a){try{jsonpatch[_0x3811('0x26')](_0x50ca5a,_0x203aa6,!![]);}catch(_0x2e91c3){return BPromise[_0x3811('0x27')](_0x2e91c3);}return _0x50ca5a[_0x3811('0x28')]();};}function saveUpdates(_0x56c126,_0x347aaf){return function(_0x2ba195){if(_0x2ba195){return _0x2ba195['update'](_0x56c126)[_0x3811('0x29')](function(_0x2d9840){return _0x2d9840;});}return null;};}function removeEntity(_0x384547,_0x41e6af){return function(_0x544d30){if(_0x544d30){return _0x544d30[_0x3811('0x2a')]()[_0x3811('0x29')](function(){var _0x1938c0=_0x544d30[_0x3811('0x2b')]({'plain':!![]});var _0x1c542c='MailQueues';return db[_0x3811('0x2c')][_0x3811('0x2a')]({'where':{'type':_0x1c542c,'resourceId':_0x1938c0['id']}})[_0x3811('0x29')](function(){return _0x544d30;});})[_0x3811('0x29')](function(){_0x384547['status'](0xcc)[_0x3811('0x1e')]();});}};}function handleEntityNotFound(_0x32fad0,_0x3203e9){return function(_0x1ddcdb){if(!_0x1ddcdb){_0x32fad0[_0x3811('0x1c')](0x194);}return _0x1ddcdb;};}function handleError(_0x72b8b8,_0x1d5453){_0x1d5453=_0x1d5453||0x1f4;return function(_0x5e5767){logger[_0x3811('0x2d')](_0x5e5767[_0x3811('0x2e')]);if(_0x5e5767[_0x3811('0x2f')]){delete _0x5e5767[_0x3811('0x2f')];}_0x72b8b8[_0x3811('0x1d')](_0x1d5453)[_0x3811('0x30')](_0x5e5767);};}exports['index']=function(_0x46abe7,_0xd22b2f){var _0x12c47c={},_0x1f1cd1={},_0x44cf9a={'count':0x0,'rows':[]};var _0x301bd5=_[_0x3811('0x31')](db[_0x3811('0x32')][_0x3811('0x33')],function(_0x46b7d5){return{'name':_0x46b7d5[_0x3811('0x34')],'type':_0x46b7d5[_0x3811('0x35')]['key']};});_0x1f1cd1[_0x3811('0x36')]=_[_0x3811('0x31')](_0x301bd5,'name');_0x1f1cd1[_0x3811('0x37')]=_[_0x3811('0x38')](_0x46abe7['query']);_0x1f1cd1['filters']=_[_0x3811('0x39')](_0x1f1cd1['model'],_0x1f1cd1[_0x3811('0x37')]);_0x12c47c['attributes']=_[_0x3811('0x39')](_0x1f1cd1[_0x3811('0x36')],qs[_0x3811('0x3a')](_0x46abe7[_0x3811('0x37')][_0x3811('0x3a')]));_0x12c47c[_0x3811('0x3b')]=_0x12c47c['attributes'][_0x3811('0x3c')]?_0x12c47c['attributes']:_0x1f1cd1[_0x3811('0x36')];if(!_0x46abe7[_0x3811('0x37')][_0x3811('0x3d')](_0x3811('0x3e'))){_0x12c47c[_0x3811('0x21')]=qs[_0x3811('0x21')](_0x46abe7[_0x3811('0x37')][_0x3811('0x21')]);_0x12c47c[_0x3811('0x1f')]=qs[_0x3811('0x1f')](_0x46abe7[_0x3811('0x37')]['offset']);}_0x12c47c[_0x3811('0x3f')]=qs[_0x3811('0x40')](_0x46abe7[_0x3811('0x37')][_0x3811('0x40')]);_0x12c47c[_0x3811('0x41')]=qs[_0x3811('0x42')](_[_0x3811('0x43')](_0x46abe7['query'],_0x1f1cd1['filters']),_0x301bd5);if(_0x46abe7[_0x3811('0x37')][_0x3811('0x44')]){_0x12c47c[_0x3811('0x41')]=_['merge'](_0x12c47c[_0x3811('0x41')],{'$or':_[_0x3811('0x31')](_0x301bd5,function(_0x54e891){if(_0x54e891[_0x3811('0x35')]!=='VIRTUAL'){var _0x4e537d={};_0x4e537d[_0x54e891['name']]={'$like':'%'+_0x46abe7[_0x3811('0x37')][_0x3811('0x44')]+'%'};return _0x4e537d;}})});}_0x12c47c=_[_0x3811('0x45')]({},_0x12c47c,_0x46abe7['options']);var _0x285333={'where':_0x12c47c[_0x3811('0x41')]};return db[_0x3811('0x32')][_0x3811('0x22')](_0x285333)['then'](function(_0x36af10){_0x44cf9a['count']=_0x36af10;if(_0x46abe7['query'][_0x3811('0x46')]){_0x12c47c[_0x3811('0x47')]=[{'all':!![]}];}return db[_0x3811('0x32')][_0x3811('0x48')](_0x12c47c);})['then'](function(_0x4135e7){_0x44cf9a['rows']=_0x4135e7;return _0x44cf9a;})[_0x3811('0x29')](respondWithFilteredResult(_0xd22b2f,_0x12c47c))[_0x3811('0x49')](handleError(_0xd22b2f,null));};exports[_0x3811('0x4a')]=function(_0x14451e,_0x44e8dc){var _0x35be20={'raw':!![],'where':{'id':_0x14451e[_0x3811('0x4b')]['id']}},_0x54f64d={};_0x54f64d[_0x3811('0x36')]=_[_0x3811('0x38')](db[_0x3811('0x32')][_0x3811('0x33')]);_0x54f64d[_0x3811('0x37')]=_[_0x3811('0x38')](_0x14451e[_0x3811('0x37')]);_0x54f64d[_0x3811('0x42')]=_[_0x3811('0x39')](_0x54f64d[_0x3811('0x36')],_0x54f64d[_0x3811('0x37')]);_0x35be20['attributes']=_[_0x3811('0x39')](_0x54f64d[_0x3811('0x36')],qs[_0x3811('0x3a')](_0x14451e[_0x3811('0x37')]['fields']));_0x35be20[_0x3811('0x3b')]=_0x35be20['attributes'][_0x3811('0x3c')]?_0x35be20[_0x3811('0x3b')]:_0x54f64d[_0x3811('0x36')];if(_0x14451e[_0x3811('0x37')][_0x3811('0x46')]){_0x35be20[_0x3811('0x47')]=[{'all':!![]}];}_0x35be20=_[_0x3811('0x45')]({},_0x35be20,_0x14451e[_0x3811('0x4c')]);return db['MailQueue'][_0x3811('0x4d')](_0x35be20)['then'](handleEntityNotFound(_0x44e8dc,null))[_0x3811('0x29')](respondWithResult(_0x44e8dc,null))['catch'](handleError(_0x44e8dc,null));};exports[_0x3811('0x4e')]=function(_0x11c7b0,_0x31e764){return db[_0x3811('0x32')][_0x3811('0x4e')](_0x11c7b0[_0x3811('0x4f')],{})[_0x3811('0x29')](function(_0x23135a){var _0x284f27=_0x11c7b0['user'][_0x3811('0x2b')]({'plain':!![]});if(!_0x284f27)throw new Error(_0x3811('0x50'));if(_0x284f27['role']==='user'){var _0x37a36e=_0x23135a[_0x3811('0x2b')]({'plain':!![]});var _0x5a39a5=_0x3811('0x51');return db[_0x3811('0x52')][_0x3811('0x4d')]({'where':{'name':_0x5a39a5,'userProfileId':_0x284f27[_0x3811('0x53')]},'raw':!![]})[_0x3811('0x29')](function(_0x134d5c){if(_0x134d5c&&_0x134d5c['autoAssociation']===0x0){return db[_0x3811('0x2c')][_0x3811('0x4e')]({'name':_0x37a36e[_0x3811('0x2f')],'resourceId':_0x37a36e['id'],'type':_0x134d5c[_0x3811('0x2f')],'sectionId':_0x134d5c['id']},{})[_0x3811('0x29')](function(){return _0x23135a;});}else{return _0x23135a;}})[_0x3811('0x49')](function(_0x3d6260){logger[_0x3811('0x2d')](_0x3811('0x54'),_0x3d6260);throw _0x3d6260;});}return _0x23135a;})[_0x3811('0x29')](respondWithResult(_0x31e764,0xc9))['catch'](handleError(_0x31e764,null));};exports[_0x3811('0x55')]=function(_0x2bf300,_0x12f09c){if(_0x2bf300[_0x3811('0x4f')]['id']){delete _0x2bf300['body']['id'];}return db['MailQueue'][_0x3811('0x4d')]({'where':{'id':_0x2bf300[_0x3811('0x4b')]['id']}})[_0x3811('0x29')](handleEntityNotFound(_0x12f09c,null))['then'](saveUpdates(_0x2bf300['body'],null))['then'](respondWithResult(_0x12f09c,null))[_0x3811('0x49')](handleError(_0x12f09c,null));};exports[_0x3811('0x2a')]=function(_0x21abce,_0x29cb47){return db[_0x3811('0x32')][_0x3811('0x4d')]({'where':{'id':_0x21abce[_0x3811('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29cb47,null))[_0x3811('0x29')](removeEntity(_0x29cb47,null))[_0x3811('0x49')](handleError(_0x29cb47,null));};exports[_0x3811('0x56')]=function(_0x533a62,_0x117564){return db[_0x3811('0x32')][_0x3811('0x56')]()[_0x3811('0x29')](respondWithResult(_0x117564,null))[_0x3811('0x49')](handleError(_0x117564,null));};exports[_0x3811('0x57')]=function(_0x591673,_0x4566d6,_0x555839){var _0x41fd98={'raw':!![],'where':{}},_0x189bbf={},_0x37f16a;return db[_0x3811('0x32')][_0x3811('0x58')]({'where':{'id':_0x591673[_0x3811('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4566d6,null))['then'](function(_0x48eab3){if(_0x48eab3){_0x37f16a=_0x48eab3[_0x3811('0x2b')]({'plain':!![]});_0x189bbf[_0x3811('0x36')]=_[_0x3811('0x38')](db['UserMailQueue'][_0x3811('0x33')]);_0x189bbf['query']=_['keys'](_0x591673['query']);_0x189bbf[_0x3811('0x42')]=_[_0x3811('0x39')](_0x189bbf[_0x3811('0x36')],_0x189bbf[_0x3811('0x37')]);_0x41fd98[_0x3811('0x3b')]=_[_0x3811('0x39')](_0x189bbf['model'],qs[_0x3811('0x3a')](_0x591673[_0x3811('0x37')]['fields']));_0x41fd98[_0x3811('0x3b')]=_0x41fd98['attributes'][_0x3811('0x3c')]?_0x41fd98[_0x3811('0x3b')]:_0x189bbf[_0x3811('0x36')];if(!_0x591673[_0x3811('0x37')][_0x3811('0x3d')]('nolimit')){_0x41fd98['limit']=qs[_0x3811('0x21')](_0x591673[_0x3811('0x37')]['limit']);_0x41fd98[_0x3811('0x1f')]=qs[_0x3811('0x1f')](_0x591673[_0x3811('0x37')][_0x3811('0x1f')]);}_0x41fd98[_0x3811('0x3f')]=qs['sort'](_0x591673[_0x3811('0x37')][_0x3811('0x40')]);_0x41fd98[_0x3811('0x41')]=qs['filters'](_[_0x3811('0x43')](_0x591673[_0x3811('0x37')],_0x189bbf[_0x3811('0x42')]));_0x41fd98[_0x3811('0x41')][_0x3811('0x59')]=_0x48eab3['id'];if(_0x591673[_0x3811('0x37')]['filter']){_0x41fd98[_0x3811('0x41')]=_[_0x3811('0x45')](_0x41fd98[_0x3811('0x41')],{'$or':_[_0x3811('0x31')](_0x41fd98[_0x3811('0x3b')],function(_0x3a53a0){var _0x41a7fe={};_0x41a7fe[_0x3a53a0]={'$like':'%'+_0x591673[_0x3811('0x37')][_0x3811('0x44')]+'%'};return _0x41a7fe;})});}_0x41fd98=_[_0x3811('0x45')]({},_0x41fd98,_0x591673[_0x3811('0x4c')]);return db[_0x3811('0x5a')]['findAll'](_0x41fd98);}})[_0x3811('0x29')](function(_0x518e3f){if(_0x518e3f){return db[_0x3811('0x5b')][_0x3811('0x5c')]({'where':{'id':_[_0x3811('0x31')](_0x518e3f,_0x3811('0x5d')),'role':'agent'},'attributes':['id',_0x3811('0x2f'),_0x3811('0x5e'),_0x3811('0x5f'),'createdAt']});}})['then'](function(_0x255382){if(_0x255382){return{'count':_0x255382[_0x3811('0x22')],'rows':_['map'](_0x255382[_0x3811('0x60')],function(_0x5581de){return{'membername':_0x5581de['name'],'UserId':_0x5581de['id'],'queue_name':_0x37f16a['name'],'MailQueueId':_0x37f16a['id'],'interface':util[_0x3811('0x61')](_0x3811('0x62'),_0x3811('0x63'),_0x5581de['name']),'penalty':0x0,'paused':_0x5581de[_0x3811('0x5e')],'createdAt':_0x5581de[_0x3811('0x64')],'updatedAt':_0x5581de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3811('0x29')](respondWithFilteredResult(_0x4566d6,_0x41fd98))['catch'](handleError(_0x4566d6,null));};exports[_0x3811('0x65')]=function(_0x304c8a,_0x2fb2db,_0x58808c){var _0x5d8562={};var _0x1c4592={};var _0x11f83d;var _0x4e52f3;return db[_0x3811('0x32')][_0x3811('0x58')]({'where':{'id':_0x304c8a['params']['id']}})[_0x3811('0x29')](handleEntityNotFound(_0x2fb2db,null))['then'](function(_0x47b0fd){if(_0x47b0fd){_0x11f83d=_0x47b0fd;_0x1c4592[_0x3811('0x36')]=_['keys'](db[_0x3811('0x66')]['rawAttributes']);_0x1c4592[_0x3811('0x37')]=_[_0x3811('0x38')](_0x304c8a['query']);_0x1c4592['filters']=_[_0x3811('0x39')](_0x1c4592[_0x3811('0x36')],_0x1c4592[_0x3811('0x37')]);_0x5d8562[_0x3811('0x3b')]=_[_0x3811('0x39')](_0x1c4592['model'],qs[_0x3811('0x3a')](_0x304c8a[_0x3811('0x37')]['fields']));_0x5d8562[_0x3811('0x3b')]=_0x5d8562['attributes'][_0x3811('0x3c')]?_0x5d8562[_0x3811('0x3b')]:_0x1c4592[_0x3811('0x36')];_0x5d8562[_0x3811('0x3f')]=qs[_0x3811('0x40')](_0x304c8a[_0x3811('0x37')][_0x3811('0x40')]);_0x5d8562[_0x3811('0x41')]=qs[_0x3811('0x42')](_['pick'](_0x304c8a[_0x3811('0x37')],_0x1c4592['filters']));if(_0x304c8a[_0x3811('0x37')][_0x3811('0x44')]){_0x5d8562[_0x3811('0x41')]=_[_0x3811('0x45')](_0x5d8562[_0x3811('0x41')],{'$or':_[_0x3811('0x31')](_0x5d8562[_0x3811('0x3b')],function(_0x33a8bc){var _0x5c1968={};_0x5c1968[_0x33a8bc]={'$like':'%'+_0x304c8a[_0x3811('0x37')][_0x3811('0x44')]+'%'};return _0x5c1968;})});}_0x5d8562=_[_0x3811('0x45')]({},_0x5d8562,_0x304c8a[_0x3811('0x4c')]);return _0x11f83d[_0x3811('0x65')](_0x5d8562);}})[_0x3811('0x29')](function(_0x29286e){if(_0x29286e){_0x4e52f3=_0x29286e[_0x3811('0x3c')];if(!_0x304c8a['query'][_0x3811('0x3d')](_0x3811('0x3e'))){_0x5d8562[_0x3811('0x21')]=qs['limit'](_0x304c8a['query']['limit']);_0x5d8562['offset']=qs[_0x3811('0x1f')](_0x304c8a[_0x3811('0x37')][_0x3811('0x1f')]);}return _0x11f83d[_0x3811('0x65')](_0x5d8562);}})[_0x3811('0x29')](function(_0x5e48f5){if(_0x5e48f5){return _0x5e48f5?{'count':_0x4e52f3,'rows':_0x5e48f5}:null;}})['then'](respondWithResult(_0x2fb2db,null))['catch'](handleError(_0x2fb2db,null));};exports[_0x3811('0x67')]=function(_0x15d655,_0x433234,_0x5b5519){var _0x4690ee=_0x15d655['body'][_0x3811('0x68')];return db[_0x3811('0x66')][_0x3811('0x48')]({'where':{'id':_0x4690ee},'attributes':['id'],'include':[{'model':db[_0x3811('0x5b')],'as':_0x3811('0x69'),'attributes':['id',_0x3811('0x2f'),_0x3811('0x6a'),_0x3811('0x6b'),_0x3811('0x6c')],'raw':!![]}]})['then'](function(_0x5f560d){if(_0x5f560d){var _0x1004b3=_[_0x3811('0x6d')](_0x5f560d,function(_0x22b401){var _0x20fa6d=_0x22b401[_0x3811('0x2b')]({'plain':!![]});return _0x20fa6d[_0x3811('0x69')];});return db['MailQueue'][_0x3811('0x4d')]({'where':{'id':_0x15d655['params']['id']}})[_0x3811('0x29')](function(_0x47ed10){return db['sequelize'][_0x3811('0x6e')](function(_0x3f4ca4){return _0x47ed10[_0x3811('0x67')](_0x4690ee,{'transaction':_0x3f4ca4})[_0x3811('0x29')](function(){return BPromise[_0x3811('0x6f')](_0x1004b3,function(_0x5cabf0){return db['UserMailQueue'][_0x3811('0x70')]({'where':{'UserId':_0x5cabf0['id'],'MailQueueId':_0x15d655[_0x3811('0x4b')]['id']},'transaction':_0x3f4ca4});});})[_0x3811('0x29')](function(){_0x1004b3['forEach'](function(_0x542c16){socket['emit'](_0x3811('0x71'),{'UserId':_0x542c16['id'],'MailQueueId':_0x47ed10['id']});});});});});}})[_0x3811('0x29')](respondWithStatusCode(_0x433234,null))['catch'](handleError(_0x433234,null));};exports[_0x3811('0x72')]=function(_0x17e226,_0x30a85f,_0x5226b7){return db[_0x3811('0x66')][_0x3811('0x48')]({'where':{'id':_0x17e226['query'][_0x3811('0x68')]},'attributes':['id'],'include':[{'model':db[_0x3811('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3811('0x29')](handleEntityNotFound(_0x30a85f,null))['then'](function(_0x49bdfe){var _0x50bb4a=_[_0x3811('0x31')](_0x49bdfe,'id');var _0xf3d876=[];var _0x1cee55=[];var _0x28632c=squel[_0x3811('0x73')]();_0x28632c[_0x3811('0x74')](_0x3811('0x75'))[_0x3811('0x76')](_0x3811('0x77'),'tq')[_0x3811('0x78')](_0x3811('0x79'),'ut',_0x3811('0x7a'))[_0x3811('0x41')]('MailQueueId\x20=\x20?',_0x17e226[_0x3811('0x4b')]['id']);for(var _0x5493c4=0x0;_0x5493c4<_0x49bdfe[_0x3811('0x3c')];_0x5493c4+=0x1){let _0x593898=_0x49bdfe[_0x5493c4];for(var _0x4c3067=0x0;_0x4c3067<_0x593898[_0x3811('0x69')]['length'];_0x4c3067+=0x1){let _0x630488=_0x593898['Agents'][_0x4c3067];var _0x32b43d=_0x28632c['clone']();_0x32b43d[_0x3811('0x41')](_0x3811('0x7b'),_0x630488['id']);_0x1cee55[_0x3811('0x7c')](db[_0x3811('0x7d')][_0x3811('0x37')](_0x32b43d[_0x3811('0x7e')](),{'type':db[_0x3811('0x7d')][_0x3811('0x7f')][_0x3811('0x80')]})[_0x3811('0x29')](function(_0x354933){if(_0x354933[_0x3811('0x3c')]===0x1){return _0x630488['id'];}else{var _0x65147e=_['every'](_[_0x3811('0x31')](_0x354933,'TeamId'),function(_0x5625bf){return _[_0x3811('0x81')](_0x50bb4a,_0x5625bf);});if(_0x65147e){return _0x630488['id'];}}}));}}return BPromise[_0x3811('0x82')](_0x1cee55)[_0x3811('0x29')](function(_0x32cf97){_0xf3d876=_(_0xf3d876)[_0x3811('0x83')](_0x32cf97)[_0x3811('0x84')]()[_0x3811('0x85')]();return db[_0x3811('0x32')]['find']({'where':{'id':_0x17e226[_0x3811('0x4b')]['id']}})['then'](function(_0x172039){return db[_0x3811('0x7d')][_0x3811('0x6e')](function(_0xf3ca6){return _0x172039[_0x3811('0x72')](_0x17e226[_0x3811('0x37')]['ids'],{'transaction':_0xf3ca6})[_0x3811('0x29')](function(){if(!_[_0x3811('0x86')](_0xf3d876)){return _0x172039[_0x3811('0x87')](_0xf3d876,{'transaction':_0xf3ca6});}})[_0x3811('0x29')](function(){_0xf3d876[_0x3811('0x88')](function(_0x202cbd){socket['emit'](_0x3811('0x89'),{'UserId':_0x202cbd,'MailQueueId':_0x172039['id']});});});});});});})[_0x3811('0x29')](respondWithStatusCode(_0x30a85f,null))['catch'](handleError(_0x30a85f,null));};exports[_0x3811('0x8a')]=function(_0x22cf6c,_0x39a6c9,_0x5ead34){return db[_0x3811('0x32')][_0x3811('0x4d')]({'where':{'id':_0x22cf6c[_0x3811('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39a6c9,null))[_0x3811('0x29')](function(_0x18d28a){if(_0x18d28a){return _0x18d28a[_0x3811('0x8a')](_0x22cf6c[_0x3811('0x4f')][_0x3811('0x68')],_['omit'](_0x22cf6c[_0x3811('0x4f')],[_0x3811('0x68'),'id'])||{})[_0x3811('0x8b')](function(_0x549221){for(var _0xd5f7ee=0x0;_0xd5f7ee<_0x22cf6c['body'][_0x3811('0x68')][_0x3811('0x3c')];_0xd5f7ee+=0x1){socket[_0x3811('0x8c')]('userMailQueue:save',{'UserId':Number(_0x22cf6c[_0x3811('0x4f')][_0x3811('0x68')][_0xd5f7ee]),'MailQueueId':Number(_0x22cf6c[_0x3811('0x4b')]['id'])});}return _0x549221;});}})[_0x3811('0x29')](respondWithResult(_0x39a6c9,null))[_0x3811('0x49')](handleError(_0x39a6c9,null));};exports[_0x3811('0x87')]=function(_0x2b025b,_0x5252a0,_0x22298b){return db[_0x3811('0x32')][_0x3811('0x4d')]({'where':{'id':_0x2b025b[_0x3811('0x4b')]['id']}})[_0x3811('0x29')](handleEntityNotFound(_0x5252a0,null))[_0x3811('0x29')](function(_0x1e0215){if(_0x1e0215){return _0x1e0215[_0x3811('0x87')](_0x2b025b[_0x3811('0x37')]['ids'])[_0x3811('0x29')](function(){if(_[_0x3811('0x8d')](_0x2b025b[_0x3811('0x37')][_0x3811('0x68')])){for(var _0x197397=0x0;_0x197397<_0x2b025b['query'][_0x3811('0x68')][_0x3811('0x3c')];_0x197397+=0x1){socket[_0x3811('0x8c')](_0x3811('0x89'),{'UserId':Number(_0x2b025b[_0x3811('0x37')][_0x3811('0x68')][_0x197397]),'MailQueueId':Number(_0x2b025b[_0x3811('0x4b')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x2b025b['query']['ids']),'MailQueueId':Number(_0x2b025b[_0x3811('0x4b')]['id'])});}});}})[_0x3811('0x29')](respondWithStatusCode(_0x5252a0,null))['catch'](handleError(_0x5252a0,null));};exports[_0x3811('0x8e')]=function(_0x4ffc97,_0x267fb6,_0x3dda3a){var _0x5cf39a={};var _0x59efbf={};var _0xe6ad06;var _0x24e088;return db[_0x3811('0x32')][_0x3811('0x58')]({'where':{'id':_0x4ffc97['params']['id']}})['then'](handleEntityNotFound(_0x267fb6,null))['then'](function(_0x1b4c93){if(_0x1b4c93){_0xe6ad06=_0x1b4c93;_0x59efbf[_0x3811('0x36')]=_[_0x3811('0x38')](db['User'][_0x3811('0x33')]);_0x59efbf[_0x3811('0x37')]=_['keys'](_0x4ffc97[_0x3811('0x37')]);_0x59efbf[_0x3811('0x42')]=_[_0x3811('0x39')](_0x59efbf[_0x3811('0x36')],_0x59efbf[_0x3811('0x37')]);_0x5cf39a['attributes']=_['intersection'](_0x59efbf[_0x3811('0x36')],qs[_0x3811('0x3a')](_0x4ffc97[_0x3811('0x37')][_0x3811('0x3a')]));_0x5cf39a['attributes']=_0x5cf39a[_0x3811('0x3b')]['length']?_0x5cf39a[_0x3811('0x3b')]:_0x59efbf['model'];_0x5cf39a[_0x3811('0x3f')]=qs[_0x3811('0x40')](_0x4ffc97[_0x3811('0x37')]['sort']);_0x5cf39a[_0x3811('0x41')]=qs[_0x3811('0x42')](_[_0x3811('0x43')](_0x4ffc97['query'],_0x59efbf[_0x3811('0x42')]));if(_0x4ffc97[_0x3811('0x37')]['filter']){_0x5cf39a[_0x3811('0x41')]=_[_0x3811('0x45')](_0x5cf39a[_0x3811('0x41')],{'$or':_[_0x3811('0x31')](_0x5cf39a[_0x3811('0x3b')],function(_0x1e4038){var _0x27d6db={};_0x27d6db[_0x1e4038]={'$like':'%'+_0x4ffc97[_0x3811('0x37')][_0x3811('0x44')]+'%'};return _0x27d6db;})});}_0x5cf39a=_[_0x3811('0x45')]({},_0x5cf39a,_0x4ffc97[_0x3811('0x4c')]);return _0xe6ad06[_0x3811('0x8e')](_0x5cf39a);}})[_0x3811('0x29')](function(_0x53af63){if(_0x53af63){_0x24e088=_0x53af63[_0x3811('0x3c')];if(!_0x4ffc97[_0x3811('0x37')][_0x3811('0x3d')](_0x3811('0x3e'))){_0x5cf39a[_0x3811('0x21')]=qs[_0x3811('0x21')](_0x4ffc97['query'][_0x3811('0x21')]);_0x5cf39a[_0x3811('0x1f')]=qs[_0x3811('0x1f')](_0x4ffc97['query'][_0x3811('0x1f')]);}return _0xe6ad06[_0x3811('0x8e')](_0x5cf39a);}})[_0x3811('0x29')](function(_0x1f4e6d){if(_0x1f4e6d){return _0x1f4e6d?{'count':_0x24e088,'rows':_0x1f4e6d}:null;}})[_0x3811('0x29')](respondWithResult(_0x267fb6,null))[_0x3811('0x49')](handleError(_0x267fb6,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index be6b908..4275e97 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1667=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','MailQueue'];(function(_0x225838,_0x29b914){var _0x1da96b=function(_0x3e54b3){while(--_0x3e54b3){_0x225838['push'](_0x225838['shift']());}};_0x1da96b(++_0x29b914);}(_0x1667,0x186));var _0x7166=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x1667[_0x9d14e3];return _0x19bf32;};'use strict';var EventEmitter=require(_0x7166('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x7166('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7166('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7166('0x3'),'afterDestroy':_0x7166('0x4')};function emitEvent(_0x369513){return function(_0xda5d31,_0x31481b,_0x4b9402){MailQueueEvents[_0x7166('0x5')](_0x369513+':'+_0xda5d31['id'],_0xda5d31);MailQueueEvents[_0x7166('0x5')](_0x369513,_0xda5d31);_0x4b9402(null);};}for(var e in events){if(events[_0x7166('0x6')](e)){var event=events[e];MailQueue[_0x7166('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x8c5b=['../../mysqldb','MailQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xb2e24e,_0x71029a){var _0xbc6217=function(_0x40a703){while(--_0x40a703){_0xb2e24e['push'](_0xb2e24e['shift']());}};_0xbc6217(++_0x71029a);}(_0x8c5b,0x13a));var _0xb8c5=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x8c5b[_0x4d672c];return _0x22dc61;};'use strict';var EventEmitter=require(_0xb8c5('0x0'));var MailQueue=require(_0xb8c5('0x1'))['db'][_0xb8c5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb8c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb8c5('0x4')};function emitEvent(_0x564247){return function(_0x7f8e8e,_0x3a2f2b,_0x1abb21){MailQueueEvents['emit'](_0x564247+':'+_0x7f8e8e['id'],_0x7f8e8e);MailQueueEvents[_0xb8c5('0x5')](_0x564247,_0x7f8e8e);_0x1abb21(null);};}for(var e in events){if(events[_0xb8c5('0x6')](e)){var event=events[e];MailQueue[_0xb8c5('0x7')](e,emitEvent(event));}}module[_0xb8c5('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6edddfa..b35e60f 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e8e=['path','rimraf','../../config/environment','./mailQueue.attributes','define','lodash','../../config/logger','moment'];(function(_0x394576,_0x5d447b){var _0x3dbf0b=function(_0x5a602a){while(--_0x5a602a){_0x394576['push'](_0x394576['shift']());}};_0x3dbf0b(++_0x5d447b);}(_0x4e8e,0x1ed));var _0xe4e8=function(_0x7c3946,_0x3edf02){_0x7c3946=_0x7c3946-0x0;var _0xb71136=_0x4e8e[_0x7c3946];return _0xb71136;};'use strict';var _=require(_0xe4e8('0x0'));var util=require('util');var logger=require(_0xe4e8('0x1'))('api');var moment=require(_0xe4e8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4e8('0x3'));var rimraf=require(_0xe4e8('0x4'));var config=require(_0xe4e8('0x5'));var attributes=require(_0xe4e8('0x6'));module['exports']=function(_0x56b526,_0x498871){return _0x56b526[_0xe4e8('0x7')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6548=['mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','define','MailQueue'];(function(_0xb94076,_0x72d495){var _0x532df9=function(_0x4e7f83){while(--_0x4e7f83){_0xb94076['push'](_0xb94076['shift']());}};_0x532df9(++_0x72d495);}(_0x6548,0x1d5));var _0x8654=function(_0x88073,_0x4641be){_0x88073=_0x88073-0x0;var _0x272135=_0x6548[_0x88073];return _0x272135;};'use strict';var _=require(_0x8654('0x0'));var util=require(_0x8654('0x1'));var logger=require(_0x8654('0x2'))(_0x8654('0x3'));var moment=require('moment');var BPromise=require(_0x8654('0x4'));var rp=require(_0x8654('0x5'));var fs=require('fs');var path=require(_0x8654('0x6'));var rimraf=require(_0x8654('0x7'));var config=require('../../config/environment');var attributes=require(_0x8654('0x8'));module[_0x8654('0x9')]=function(_0xe48f14,_0x2d20e5){return _0xe48f14[_0x8654('0xa')](_0x8654('0xb'),attributes,{'tableName':_0x8654('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index f51e3ab..8becf83 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8d=['localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowMailQueue','MailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0xa4f272,_0x1106a3){var _0x44859f=function(_0x690083){while(--_0x690083){_0xa4f272['push'](_0xa4f272['shift']());}};_0x44859f(++_0x1106a3);}(_0x3f8d,0x162));var _0xd3f8=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x3f8d[_0x28014d];return _0x2572cc;};'use strict';var _=require('lodash');var util=require(_0xd3f8('0x0'));var moment=require(_0xd3f8('0x1'));var BPromise=require(_0xd3f8('0x2'));var rs=require(_0xd3f8('0x3'));var fs=require('fs');var Redis=require(_0xd3f8('0x4'));var db=require(_0xd3f8('0x5'))['db'];var utils=require(_0xd3f8('0x6'));var logger=require(_0xd3f8('0x7'))(_0xd3f8('0x8'));var config=require(_0xd3f8('0x9'));var jayson=require(_0xd3f8('0xa'));var client=jayson[_0xd3f8('0xb')][_0xd3f8('0xc')]({'port':0x232a});config['redis']=_[_0xd3f8('0xd')](config[_0xd3f8('0xe')],{'host':_0xd3f8('0xf'),'port':0x18eb});var socket=require(_0xd3f8('0x10'))(new Redis(config[_0xd3f8('0xe')]));require('./mailQueue.socket')[_0xd3f8('0x11')](socket);function respondWithRpcPromise(_0x2526a1,_0x3cee1e,_0x38ccf5){return new BPromise(function(_0x19bb5d,_0x417e00){return client['request'](_0x2526a1,_0x38ccf5)[_0xd3f8('0x12')](function(_0x1973a8){logger[_0xd3f8('0x13')](_0xd3f8('0x14'),_0x3cee1e,_0xd3f8('0x15'));logger[_0xd3f8('0x16')](_0xd3f8('0x17'),_0x3cee1e,_0xd3f8('0x15'),JSON[_0xd3f8('0x18')](_0x1973a8));if(_0x1973a8[_0xd3f8('0x19')]){if(_0x1973a8[_0xd3f8('0x19')]['code']===0x1f4){logger[_0xd3f8('0x19')](_0xd3f8('0x14'),_0x3cee1e,_0x1973a8[_0xd3f8('0x19')]['message']);return _0x417e00(_0x1973a8[_0xd3f8('0x19')]['message']);}logger[_0xd3f8('0x19')](_0xd3f8('0x14'),_0x3cee1e,_0x1973a8['error'][_0xd3f8('0x1a')]);return _0x19bb5d(_0x1973a8['error'][_0xd3f8('0x1a')]);}else{logger['info'](_0xd3f8('0x14'),_0x3cee1e,_0xd3f8('0x15'));_0x19bb5d(_0x1973a8['result'][_0xd3f8('0x1a')]);}})[_0xd3f8('0x1b')](function(_0x196776){logger[_0xd3f8('0x19')](_0xd3f8('0x14'),_0x3cee1e,_0x196776);_0x417e00(_0x196776);});});}exports[_0xd3f8('0x1c')]=function(_0x32f3b5){var _0x2cca92=this;return new Promise(function(_0x2abe2a,_0x5d3f52){return db['MailQueue'][_0xd3f8('0x1d')]({'raw':_0x32f3b5[_0xd3f8('0x1e')]?_0x32f3b5[_0xd3f8('0x1e')][_0xd3f8('0x1f')]===undefined?!![]:![]:!![],'where':_0x32f3b5[_0xd3f8('0x1e')]?_0x32f3b5['options'][_0xd3f8('0x20')]||null:null,'attributes':_0x32f3b5[_0xd3f8('0x1e')]?_0x32f3b5[_0xd3f8('0x1e')]['attributes']||null:null,'limit':_0x32f3b5['options']?_0x32f3b5[_0xd3f8('0x1e')][_0xd3f8('0x21')]||null:null,'include':_0x32f3b5[_0xd3f8('0x1e')]?_0x32f3b5[_0xd3f8('0x1e')][_0xd3f8('0x22')]?_['map'](_0x32f3b5[_0xd3f8('0x1e')][_0xd3f8('0x22')],function(_0x448ce8){return{'model':db[_0x448ce8['model']],'as':_0x448ce8['as'],'attributes':_0x448ce8['attributes'],'include':_0x448ce8[_0xd3f8('0x22')]?_['map'](_0x448ce8[_0xd3f8('0x22')],function(_0x4b4cd6){return{'model':db[_0x4b4cd6[_0xd3f8('0x23')]],'as':_0x4b4cd6['as'],'attributes':_0x4b4cd6[_0xd3f8('0x24')],'include':_0x4b4cd6['include']?_[_0xd3f8('0x25')](_0x4b4cd6[_0xd3f8('0x22')],function(_0x2439fc){return{'model':db[_0x2439fc[_0xd3f8('0x23')]],'as':_0x2439fc['as'],'attributes':_0x2439fc[_0xd3f8('0x24')]};}):[]};}):[]};}):[]:[]})[_0xd3f8('0x12')](function(_0x47e281){logger[_0xd3f8('0x13')](_0xd3f8('0x1c'),_0x32f3b5);logger[_0xd3f8('0x16')](_0xd3f8('0x1c'),_0x32f3b5,JSON[_0xd3f8('0x18')](_0x47e281));_0x2abe2a(_0x47e281);})[_0xd3f8('0x1b')](function(_0x4c2bb8){logger[_0xd3f8('0x19')]('GetMailQueue',_0x4c2bb8[_0xd3f8('0x1a')],_0x32f3b5);_0x5d3f52(_0x2cca92[_0xd3f8('0x19')](0x1f4,_0x4c2bb8[_0xd3f8('0x1a')]));});});};exports[_0xd3f8('0x26')]=function(_0x237965){var _0x2a587b=this;return new Promise(function(_0x5b251d,_0xa134d5){return db[_0xd3f8('0x27')][_0xd3f8('0x28')]({'raw':_0x237965['options']?_0x237965[_0xd3f8('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x237965[_0xd3f8('0x1e')]?_0x237965[_0xd3f8('0x1e')][_0xd3f8('0x20')]||null:null,'attributes':_0x237965[_0xd3f8('0x1e')]?_0x237965[_0xd3f8('0x1e')]['attributes']||null:null,'include':_0x237965['options']?_0x237965['options'][_0xd3f8('0x22')]?_[_0xd3f8('0x25')](_0x237965['options'][_0xd3f8('0x22')],function(_0x18c1a7){return{'model':db[_0x18c1a7[_0xd3f8('0x23')]],'as':_0x18c1a7['as'],'attributes':_0x18c1a7[_0xd3f8('0x24')],'include':_0x18c1a7[_0xd3f8('0x22')]?_[_0xd3f8('0x25')](_0x18c1a7[_0xd3f8('0x22')],function(_0x1da88c){return{'model':db[_0x1da88c['model']],'as':_0x1da88c['as'],'attributes':_0x1da88c[_0xd3f8('0x24')],'include':_0x1da88c[_0xd3f8('0x22')]?_[_0xd3f8('0x25')](_0x1da88c['include'],function(_0x378713){return{'model':db[_0x378713[_0xd3f8('0x23')]],'as':_0x378713['as'],'attributes':_0x378713[_0xd3f8('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x319081){logger[_0xd3f8('0x13')](_0xd3f8('0x26'),_0x237965);logger['debug'](_0xd3f8('0x26'),_0x237965,JSON[_0xd3f8('0x18')](_0x319081));_0x5b251d(_0x319081);})[_0xd3f8('0x1b')](function(_0x24d9ab){logger['error']('ShowMailQueue',_0x24d9ab[_0xd3f8('0x1a')],_0x237965);_0xa134d5(_0x2a587b['error'](0x1f4,_0x24d9ab['message']));});});}; \ No newline at end of file +var _0x8c5c=['attributes','limit','include','model','map','then','debug','catch','ShowMailQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','options','raw'];(function(_0x5dfc3f,_0x9e7a1a){var _0x7123b5=function(_0x137ac6){while(--_0x137ac6){_0x5dfc3f['push'](_0x5dfc3f['shift']());}};_0x7123b5(++_0x9e7a1a);}(_0x8c5c,0x7f));var _0xc8c5=function(_0x2dd66a,_0x2f15a3){_0x2dd66a=_0x2dd66a-0x0;var _0x2dae5b=_0x8c5c[_0x2dd66a];return _0x2dae5b;};'use strict';var _=require('lodash');var util=require(_0xc8c5('0x0'));var moment=require('moment');var BPromise=require(_0xc8c5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8c5('0x2'));var db=require(_0xc8c5('0x3'))['db'];var utils=require(_0xc8c5('0x4'));var logger=require('../../config/logger')(_0xc8c5('0x5'));var config=require(_0xc8c5('0x6'));var jayson=require(_0xc8c5('0x7'));var client=jayson[_0xc8c5('0x8')][_0xc8c5('0x9')]({'port':0x232a});config[_0xc8c5('0xa')]=_[_0xc8c5('0xb')](config['redis'],{'host':_0xc8c5('0xc'),'port':0x18eb});var socket=require(_0xc8c5('0xd'))(new Redis(config[_0xc8c5('0xa')]));require(_0xc8c5('0xe'))[_0xc8c5('0xf')](socket);function respondWithRpcPromise(_0x2446b4,_0x3b4534,_0x3aea27){return new BPromise(function(_0xbc58be,_0x59f2c5){return client[_0xc8c5('0x10')](_0x2446b4,_0x3aea27)['then'](function(_0x2b691a){logger[_0xc8c5('0x11')](_0xc8c5('0x12'),_0x3b4534,'request\x20sent');logger['debug'](_0xc8c5('0x13'),_0x3b4534,_0xc8c5('0x14'),JSON[_0xc8c5('0x15')](_0x2b691a));if(_0x2b691a[_0xc8c5('0x16')]){if(_0x2b691a[_0xc8c5('0x16')][_0xc8c5('0x17')]===0x1f4){logger[_0xc8c5('0x16')](_0xc8c5('0x12'),_0x3b4534,_0x2b691a['error'][_0xc8c5('0x18')]);return _0x59f2c5(_0x2b691a['error'][_0xc8c5('0x18')]);}logger[_0xc8c5('0x16')](_0xc8c5('0x12'),_0x3b4534,_0x2b691a[_0xc8c5('0x16')]['message']);return _0xbc58be(_0x2b691a[_0xc8c5('0x16')][_0xc8c5('0x18')]);}else{logger[_0xc8c5('0x11')](_0xc8c5('0x12'),_0x3b4534,_0xc8c5('0x14'));_0xbc58be(_0x2b691a[_0xc8c5('0x19')][_0xc8c5('0x18')]);}})['catch'](function(_0x3d1fb7){logger['error'](_0xc8c5('0x12'),_0x3b4534,_0x3d1fb7);_0x59f2c5(_0x3d1fb7);});});}exports[_0xc8c5('0x1a')]=function(_0x52148d){var _0x2a2d91=this;return new Promise(function(_0x5b9d43,_0x447bee){return db['MailQueue']['findAll']({'raw':_0x52148d[_0xc8c5('0x1b')]?_0x52148d[_0xc8c5('0x1b')][_0xc8c5('0x1c')]===undefined?!![]:![]:!![],'where':_0x52148d['options']?_0x52148d[_0xc8c5('0x1b')]['where']||null:null,'attributes':_0x52148d[_0xc8c5('0x1b')]?_0x52148d[_0xc8c5('0x1b')][_0xc8c5('0x1d')]||null:null,'limit':_0x52148d[_0xc8c5('0x1b')]?_0x52148d[_0xc8c5('0x1b')][_0xc8c5('0x1e')]||null:null,'include':_0x52148d['options']?_0x52148d[_0xc8c5('0x1b')][_0xc8c5('0x1f')]?_['map'](_0x52148d[_0xc8c5('0x1b')][_0xc8c5('0x1f')],function(_0x598c82){return{'model':db[_0x598c82[_0xc8c5('0x20')]],'as':_0x598c82['as'],'attributes':_0x598c82[_0xc8c5('0x1d')],'include':_0x598c82[_0xc8c5('0x1f')]?_[_0xc8c5('0x21')](_0x598c82[_0xc8c5('0x1f')],function(_0x361a1d){return{'model':db[_0x361a1d[_0xc8c5('0x20')]],'as':_0x361a1d['as'],'attributes':_0x361a1d[_0xc8c5('0x1d')],'include':_0x361a1d[_0xc8c5('0x1f')]?_[_0xc8c5('0x21')](_0x361a1d[_0xc8c5('0x1f')],function(_0xfe065c){return{'model':db[_0xfe065c[_0xc8c5('0x20')]],'as':_0xfe065c['as'],'attributes':_0xfe065c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc8c5('0x22')](function(_0x2429b4){logger[_0xc8c5('0x11')](_0xc8c5('0x1a'),_0x52148d);logger[_0xc8c5('0x23')](_0xc8c5('0x1a'),_0x52148d,JSON['stringify'](_0x2429b4));_0x5b9d43(_0x2429b4);})[_0xc8c5('0x24')](function(_0x194475){logger['error'](_0xc8c5('0x1a'),_0x194475[_0xc8c5('0x18')],_0x52148d);_0x447bee(_0x2a2d91[_0xc8c5('0x16')](0x1f4,_0x194475[_0xc8c5('0x18')]));});});};exports[_0xc8c5('0x25')]=function(_0x4be717){var _0x1c4237=this;return new Promise(function(_0x2fad58,_0x41944d){return db['MailQueue'][_0xc8c5('0x26')]({'raw':_0x4be717['options']?_0x4be717[_0xc8c5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4be717['options']?_0x4be717[_0xc8c5('0x1b')]['where']||null:null,'attributes':_0x4be717[_0xc8c5('0x1b')]?_0x4be717['options'][_0xc8c5('0x1d')]||null:null,'include':_0x4be717[_0xc8c5('0x1b')]?_0x4be717[_0xc8c5('0x1b')][_0xc8c5('0x1f')]?_[_0xc8c5('0x21')](_0x4be717[_0xc8c5('0x1b')][_0xc8c5('0x1f')],function(_0x43f303){return{'model':db[_0x43f303['model']],'as':_0x43f303['as'],'attributes':_0x43f303[_0xc8c5('0x1d')],'include':_0x43f303['include']?_[_0xc8c5('0x21')](_0x43f303[_0xc8c5('0x1f')],function(_0x3e1123){return{'model':db[_0x3e1123[_0xc8c5('0x20')]],'as':_0x3e1123['as'],'attributes':_0x3e1123[_0xc8c5('0x1d')],'include':_0x3e1123[_0xc8c5('0x1f')]?_['map'](_0x3e1123[_0xc8c5('0x1f')],function(_0x4d772c){return{'model':db[_0x4d772c[_0xc8c5('0x20')]],'as':_0x4d772c['as'],'attributes':_0x4d772c[_0xc8c5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc8c5('0x22')](function(_0x4156b1){logger[_0xc8c5('0x11')]('ShowMailQueue',_0x4be717);logger[_0xc8c5('0x23')](_0xc8c5('0x25'),_0x4be717,JSON[_0xc8c5('0x15')](_0x4156b1));_0x2fad58(_0x4156b1);})[_0xc8c5('0x24')](function(_0xcb828e){logger[_0xc8c5('0x16')](_0xc8c5('0x25'),_0xcb828e[_0xc8c5('0x18')],_0x4be717);_0x41944d(_0x1c4237['error'](0x1f4,_0xcb828e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 32211c9..b23cf87 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0630=['remove','update','emit','register','mailQueue:','./mailQueue.events','save'];(function(_0x1f0514,_0x1b4757){var _0x5271c4=function(_0x413eba){while(--_0x413eba){_0x1f0514['push'](_0x1f0514['shift']());}};_0x5271c4(++_0x1b4757);}(_0x0630,0xde));var _0x0063=function(_0x31b3e7,_0x4b71a5){_0x31b3e7=_0x31b3e7-0x0;var _0x20d4b0=_0x0630[_0x31b3e7];return _0x20d4b0;};'use strict';var MailQueueEvents=require(_0x0063('0x0'));var events=[_0x0063('0x1'),_0x0063('0x2'),_0x0063('0x3')];function createListener(_0x1d8469,_0x252b42){return function(_0x4d9183){_0x252b42[_0x0063('0x4')](_0x1d8469,_0x4d9183);};}function removeListener(_0x1490f7,_0x389dec){return function(){MailQueueEvents['removeListener'](_0x1490f7,_0x389dec);};}exports[_0x0063('0x5')]=function(_0x57a966){for(var _0x14ff3d=0x0,_0x51e3e2=events['length'];_0x14ff3d<_0x51e3e2;_0x14ff3d++){var _0x19aeb2=events[_0x14ff3d];var _0x5c3dda=createListener(_0x0063('0x6')+_0x19aeb2,_0x57a966);MailQueueEvents['on'](_0x19aeb2,_0x5c3dda);}}; \ No newline at end of file +var _0x974f=['mailQueue:','save','remove','update','register','length'];(function(_0x1b9442,_0x4616dc){var _0x39ac5c=function(_0x180c8f){while(--_0x180c8f){_0x1b9442['push'](_0x1b9442['shift']());}};_0x39ac5c(++_0x4616dc);}(_0x974f,0x85));var _0xf974=function(_0x4bee11,_0x56c443){_0x4bee11=_0x4bee11-0x0;var _0x29bb80=_0x974f[_0x4bee11];return _0x29bb80;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xf974('0x0'),_0xf974('0x1'),_0xf974('0x2')];function createListener(_0x2503b2,_0x4b47ce){return function(_0x5c907f){_0x4b47ce['emit'](_0x2503b2,_0x5c907f);};}function removeListener(_0x49c123,_0x572a8f){return function(){MailQueueEvents['removeListener'](_0x49c123,_0x572a8f);};}exports[_0xf974('0x3')]=function(_0x47831d){for(var _0xf98399=0x0,_0x196ae9=events[_0xf974('0x4')];_0xf98399<_0x196ae9;_0xf98399++){var _0x6f9462=events[_0xf98399];var _0x4b75ec=createListener(_0xf974('0x5')+_0x6f9462,_0x47831d);MailQueueEvents['on'](_0x6f9462,_0x4b75ec);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 1bbfb46..62838a1 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x358e=['put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1f9347,_0x8e7a50){var _0x2dbc27=function(_0x55b1bc){while(--_0x55b1bc){_0x1f9347['push'](_0x1f9347['shift']());}};_0x2dbc27(++_0x8e7a50);}(_0x358e,0xc3));var _0xe358=function(_0x97688b,_0x24a0aa){_0x97688b=_0x97688b-0x0;var _0x4e0ca4=_0x358e[_0x97688b];return _0x4e0ca4;};'use strict';var multer=require(_0xe358('0x0'));var util=require(_0xe358('0x1'));var path=require(_0xe358('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe358('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe358('0x4'));var interaction=require(_0xe358('0x5'));var config=require(_0xe358('0x6'));var controller=require('./mailQueueReport.controller');router[_0xe358('0x7')]('/',auth[_0xe358('0x8')](),controller[_0xe358('0x9')]);router[_0xe358('0x7')](_0xe358('0xa'),auth[_0xe358('0x8')](),controller[_0xe358('0xb')]);router['get'](_0xe358('0xc'),auth[_0xe358('0x8')](),controller['show']);router[_0xe358('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe358('0xe')](_0xe358('0xc'),auth[_0xe358('0x8')](),controller[_0xe358('0xf')]);router[_0xe358('0x10')](_0xe358('0xc'),auth[_0xe358('0x8')](),controller[_0xe358('0x11')]);module[_0xe358('0x12')]=router; \ No newline at end of file +var _0x67e2=['post','create','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3e229a,_0x31b7b9){var _0x4403e7=function(_0x21c3b6){while(--_0x21c3b6){_0x3e229a['push'](_0x3e229a['shift']());}};_0x4403e7(++_0x31b7b9);}(_0x67e2,0x76));var _0x267e=function(_0xf47dc9,_0x3d4858){_0xf47dc9=_0xf47dc9-0x0;var _0xfde298=_0x67e2[_0xf47dc9];return _0xfde298;};'use strict';var multer=require(_0x267e('0x0'));var util=require(_0x267e('0x1'));var path=require('path');var timeout=require(_0x267e('0x2'));var express=require(_0x267e('0x3'));var router=express[_0x267e('0x4')]();var fs_extra=require(_0x267e('0x5'));var auth=require(_0x267e('0x6'));var interaction=require(_0x267e('0x7'));var config=require(_0x267e('0x8'));var controller=require('./mailQueueReport.controller');router[_0x267e('0x9')]('/',auth[_0x267e('0xa')](),controller[_0x267e('0xb')]);router[_0x267e('0x9')]('/describe',auth[_0x267e('0xa')](),controller[_0x267e('0xc')]);router[_0x267e('0x9')](_0x267e('0xd'),auth[_0x267e('0xa')](),controller[_0x267e('0xe')]);router[_0x267e('0xf')]('/',auth[_0x267e('0xa')](),controller[_0x267e('0x10')]);router['put']('/:id',auth[_0x267e('0xa')](),controller[_0x267e('0x11')]);router[_0x267e('0x12')](_0x267e('0xd'),auth[_0x267e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7ddf28a..3fc2daf 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ce1=['DATE','moment','sequelize','exports','STRING'];(function(_0x5de7be,_0x51575a){var _0x21b73e=function(_0x2d12a1){while(--_0x2d12a1){_0x5de7be['push'](_0x5de7be['shift']());}};_0x21b73e(++_0x51575a);}(_0x4ce1,0xba));var _0x14ce=function(_0x450920,_0x2acb54){_0x450920=_0x450920-0x0;var _0x534eb1=_0x4ce1[_0x450920];return _0x534eb1;};'use strict';var moment=require(_0x14ce('0x0'));var Sequelize=require(_0x14ce('0x1'));module[_0x14ce('0x2')]={'uniqueid':{'type':Sequelize[_0x14ce('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x14ce('0x3')]},'joinAt':{'type':Sequelize[_0x14ce('0x4')]},'leaveAt':{'type':Sequelize[_0x14ce('0x4')]},'acceptAt':{'type':Sequelize[_0x14ce('0x4')]},'exitAt':{'type':Sequelize[_0x14ce('0x4')]},'reason':{'type':Sequelize[_0x14ce('0x3')]}}; \ No newline at end of file +var _0xaa40=['exports','STRING','DATE','moment'];(function(_0xbc898f,_0x44ec04){var _0x1fed09=function(_0x4866a3){while(--_0x4866a3){_0xbc898f['push'](_0xbc898f['shift']());}};_0x1fed09(++_0x44ec04);}(_0xaa40,0x107));var _0x0aa4=function(_0x25fc6a,_0x577bae){_0x25fc6a=_0x25fc6a-0x0;var _0x31489d=_0xaa40[_0x25fc6a];return _0x31489d;};'use strict';var moment=require(_0x0aa4('0x0'));var Sequelize=require('sequelize');module[_0x0aa4('0x1')]={'uniqueid':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0aa4('0x2')]},'joinAt':{'type':Sequelize[_0x0aa4('0x3')]},'leaveAt':{'type':Sequelize[_0x0aa4('0x3')]},'acceptAt':{'type':Sequelize[_0x0aa4('0x3')]},'exitAt':{'type':Sequelize[_0x0aa4('0x3')]},'reason':{'type':Sequelize[_0x0aa4('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 140fe58..d8a4af5 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','MailQueueReport','includeAll','include'];(function(_0x102123,_0x5c1a48){var _0x151fee=function(_0x5c0b42){while(--_0x5c0b42){_0x102123['push'](_0x102123['shift']());}};_0x151fee(++_0x5c1a48);}(_0x5c3c,0x132));var _0xc5c3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5c3c[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['MailQueueReport'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['MailQueueReport'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':!![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['MailQueueReport'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['MailQueueReport'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file +var _0x583c=['rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format'];(function(_0x15c5a4,_0x4657f5){var _0x3b71eb=function(_0x3f7841){while(--_0x3f7841){_0x15c5a4['push'](_0x15c5a4['shift']());}};_0x3b71eb(++_0x4657f5);}(_0x583c,0x12b));var _0xc583=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x583c[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];function respondWithStatusCode(_0x87632d,_0x24343b){_0x24343b=_0x24343b||0xcc;return function(_0x267da0){if(_0x267da0){return _0x87632d[_0xc583('0x18')](_0x24343b);}return _0x87632d[_0xc583('0x19')](_0x24343b)[_0xc583('0x1a')]();};}function respondWithResult(_0xf81809,_0x1c6b79){_0x1c6b79=_0x1c6b79||0xc8;return function(_0x5403a3){if(_0x5403a3){return _0xf81809[_0xc583('0x19')](_0x1c6b79)['json'](_0x5403a3);}};}function respondWithFilteredResult(_0x19f46a,_0x299fa1){return function(_0x510090){if(_0x510090){var _0x263552=typeof _0x299fa1[_0xc583('0x1b')]==='undefined'&&typeof _0x299fa1[_0xc583('0x1c')]===_0xc583('0x1d');var _0x5127fa=_0x510090[_0xc583('0x1e')];var _0x8a2d84=_0x263552?0x0:_0x299fa1[_0xc583('0x1b')];var _0x36e0fd=_0x263552?_0x510090['count']:_0x299fa1[_0xc583('0x1b')]+_0x299fa1['limit'];var _0x227ec2;if(_0x36e0fd>=_0x5127fa){_0x36e0fd=_0x5127fa;_0x227ec2=0xc8;}else{_0x227ec2=0xce;}_0x19f46a[_0xc583('0x19')](_0x227ec2);return _0x19f46a[_0xc583('0x1f')](_0xc583('0x20'),_0x8a2d84+'-'+_0x36e0fd+'/'+_0x5127fa)[_0xc583('0x21')](_0x510090);}return null;};}function patchUpdates(_0x12b910){return function(_0x3ce81b){try{jsonpatch[_0xc583('0x22')](_0x3ce81b,_0x12b910,!![]);}catch(_0x37fcd4){return BPromise[_0xc583('0x23')](_0x37fcd4);}return _0x3ce81b[_0xc583('0x24')]();};}function saveUpdates(_0x3b31bc,_0x21466f){return function(_0x478ee1){if(_0x478ee1){return _0x478ee1['update'](_0x3b31bc)[_0xc583('0x25')](function(_0x3e075c){return _0x3e075c;});}return null;};}function removeEntity(_0x8443dc,_0x5ceef1){return function(_0x1521e2){if(_0x1521e2){return _0x1521e2[_0xc583('0x26')]()[_0xc583('0x25')](function(){_0x8443dc[_0xc583('0x19')](0xcc)[_0xc583('0x1a')]();});}};}function handleEntityNotFound(_0x48c95e,_0x4cad36){return function(_0x45871c){if(!_0x45871c){_0x48c95e['sendStatus'](0x194);}return _0x45871c;};}function handleError(_0x45ef74,_0xcbe9b2){_0xcbe9b2=_0xcbe9b2||0x1f4;return function(_0xbabf24){logger[_0xc583('0x27')](_0xbabf24[_0xc583('0x28')]);if(_0xbabf24['name']){delete _0xbabf24[_0xc583('0x29')];}_0x45ef74[_0xc583('0x19')](_0xcbe9b2)['send'](_0xbabf24);};}exports[_0xc583('0x2a')]=function(_0x483357,_0x2c9088){var _0x8d4ecb={},_0x1c80b1={},_0x3ed083={'count':0x0,'rows':[]};var _0x1b2b49=_[_0xc583('0x2b')](db[_0xc583('0x2c')]['rawAttributes'],function(_0x529dbe){return{'name':_0x529dbe[_0xc583('0x2d')],'type':_0x529dbe[_0xc583('0x2e')][_0xc583('0x2f')]};});_0x1c80b1[_0xc583('0x30')]=_[_0xc583('0x2b')](_0x1b2b49,'name');_0x1c80b1[_0xc583('0x31')]=_['keys'](_0x483357['query']);_0x1c80b1[_0xc583('0x32')]=_[_0xc583('0x33')](_0x1c80b1[_0xc583('0x30')],_0x1c80b1[_0xc583('0x31')]);_0x8d4ecb[_0xc583('0x34')]=_['intersection'](_0x1c80b1[_0xc583('0x30')],qs[_0xc583('0x35')](_0x483357[_0xc583('0x31')]['fields']));_0x8d4ecb[_0xc583('0x34')]=_0x8d4ecb['attributes'][_0xc583('0x36')]?_0x8d4ecb[_0xc583('0x34')]:_0x1c80b1[_0xc583('0x30')];if(!_0x483357[_0xc583('0x31')][_0xc583('0x37')]('nolimit')){_0x8d4ecb[_0xc583('0x1c')]=qs['limit'](_0x483357[_0xc583('0x31')]['limit']);_0x8d4ecb[_0xc583('0x1b')]=qs[_0xc583('0x1b')](_0x483357[_0xc583('0x31')][_0xc583('0x1b')]);}_0x8d4ecb[_0xc583('0x38')]=qs[_0xc583('0x39')](_0x483357['query']['sort']);_0x8d4ecb[_0xc583('0x3a')]=qs[_0xc583('0x32')](_['pick'](_0x483357[_0xc583('0x31')],_0x1c80b1[_0xc583('0x32')]),_0x1b2b49);if(_0x483357[_0xc583('0x31')][_0xc583('0x3b')]){_0x8d4ecb[_0xc583('0x3a')]=_[_0xc583('0x3c')](_0x8d4ecb['where'],{'$or':_[_0xc583('0x2b')](_0x1b2b49,function(_0x595351){if(_0x595351[_0xc583('0x2e')]!==_0xc583('0x3d')){var _0x39bed4={};_0x39bed4[_0x595351['name']]={'$like':'%'+_0x483357['query']['filter']+'%'};return _0x39bed4;}})});}_0x8d4ecb=_[_0xc583('0x3c')]({},_0x8d4ecb,_0x483357[_0xc583('0x3e')]);var _0x2b957d={'where':_0x8d4ecb[_0xc583('0x3a')]};return db['MailQueueReport'][_0xc583('0x1e')](_0x2b957d)[_0xc583('0x25')](function(_0x594a0b){_0x3ed083['count']=_0x594a0b;if(_0x483357[_0xc583('0x31')]['includeAll']){_0x8d4ecb[_0xc583('0x3f')]=[{'all':!![]}];}return db[_0xc583('0x2c')][_0xc583('0x40')](_0x8d4ecb);})[_0xc583('0x25')](function(_0x58553e){_0x3ed083[_0xc583('0x41')]=_0x58553e;return _0x3ed083;})[_0xc583('0x25')](respondWithFilteredResult(_0x2c9088,_0x8d4ecb))[_0xc583('0x42')](handleError(_0x2c9088,null));};exports[_0xc583('0x43')]=function(_0x2c1c22,_0x5e6e7e){var _0x3ffeb7={'raw':!![],'where':{'id':_0x2c1c22['params']['id']}},_0x5f5a97={};_0x5f5a97[_0xc583('0x30')]=_[_0xc583('0x44')](db['MailQueueReport']['rawAttributes']);_0x5f5a97[_0xc583('0x31')]=_[_0xc583('0x44')](_0x2c1c22[_0xc583('0x31')]);_0x5f5a97[_0xc583('0x32')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],_0x5f5a97['query']);_0x3ffeb7[_0xc583('0x34')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],qs[_0xc583('0x35')](_0x2c1c22[_0xc583('0x31')][_0xc583('0x35')]));_0x3ffeb7[_0xc583('0x34')]=_0x3ffeb7['attributes'][_0xc583('0x36')]?_0x3ffeb7[_0xc583('0x34')]:_0x5f5a97[_0xc583('0x30')];if(_0x2c1c22['query']['includeAll']){_0x3ffeb7['include']=[{'all':!![]}];}_0x3ffeb7=_[_0xc583('0x3c')]({},_0x3ffeb7,_0x2c1c22['options']);return db[_0xc583('0x2c')][_0xc583('0x45')](_0x3ffeb7)[_0xc583('0x25')](handleEntityNotFound(_0x5e6e7e,null))[_0xc583('0x25')](respondWithResult(_0x5e6e7e,null))[_0xc583('0x42')](handleError(_0x5e6e7e,null));};exports[_0xc583('0x46')]=function(_0x302038,_0x32cfbf){return db[_0xc583('0x2c')][_0xc583('0x46')](_0x302038[_0xc583('0x47')],{})['then'](respondWithResult(_0x32cfbf,0xc9))[_0xc583('0x42')](handleError(_0x32cfbf,null));};exports[_0xc583('0x48')]=function(_0x453df7,_0x230a45){if(_0x453df7['body']['id']){delete _0x453df7[_0xc583('0x47')]['id'];}return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x453df7[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x230a45,null))[_0xc583('0x25')](saveUpdates(_0x453df7[_0xc583('0x47')],null))[_0xc583('0x25')](respondWithResult(_0x230a45,null))[_0xc583('0x42')](handleError(_0x230a45,null));};exports['destroy']=function(_0x1f4901,_0x1919fa){return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x1f4901[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x1919fa,null))[_0xc583('0x25')](removeEntity(_0x1919fa,null))[_0xc583('0x42')](handleError(_0x1919fa,null));};exports[_0xc583('0x4a')]=function(_0xa03d53,_0x1a0f91){return db[_0xc583('0x2c')][_0xc583('0x4a')]()['then'](respondWithResult(_0x1a0f91,null))[_0xc583('0x42')](handleError(_0x1a0f91,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 900cebf..ce65c0f 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x213f=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0x13932d,_0xf930d3){var _0x1a7b81=function(_0x5c7b67){while(--_0x5c7b67){_0x13932d['push'](_0x13932d['shift']());}};_0x1a7b81(++_0xf930d3);}(_0x213f,0x1c7));var _0xf213=function(_0x29deef,_0x1ff39c){_0x29deef=_0x29deef-0x0;var _0x5e6c67=_0x213f[_0x29deef];return _0x5e6c67;};'use strict';var _=require('lodash');var util=require(_0xf213('0x0'));var logger=require(_0xf213('0x1'))('api');var moment=require(_0xf213('0x2'));var BPromise=require('bluebird');var rp=require(_0xf213('0x3'));var fs=require('fs');var path=require(_0xf213('0x4'));var rimraf=require(_0xf213('0x5'));var config=require(_0xf213('0x6'));var attributes=require(_0xf213('0x7'));module[_0xf213('0x8')]=function(_0x4795b3,_0x513fed){return _0x4795b3['define'](_0xf213('0x9'),attributes,{'tableName':_0xf213('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf213('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc571=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x400f3d,_0x228ad0){var _0x1b011f=function(_0x10472a){while(--_0x10472a){_0x400f3d['push'](_0x400f3d['shift']());}};_0x1b011f(++_0x228ad0);}(_0xc571,0x149));var _0x1c57=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xc571[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0x1c57('0x0'));var util=require(_0x1c57('0x1'));var logger=require(_0x1c57('0x2'))(_0x1c57('0x3'));var moment=require(_0x1c57('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c57('0x5'));var rimraf=require(_0x1c57('0x6'));var config=require(_0x1c57('0x7'));var attributes=require(_0x1c57('0x8'));module[_0x1c57('0x9')]=function(_0xfcf4bc,_0x15494d){return _0xfcf4bc[_0x1c57('0xa')](_0x1c57('0xb'),attributes,{'tableName':_0x1c57('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1c57('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2195531..712db40 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x2ef3,0xba));var _0x32ef=function(_0xa35404,_0x1001d9){_0xa35404=_0xa35404-0x0;var _0x2c3c7c=_0x2ef3[_0xa35404];return _0x2c3c7c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x13d416,_0x557caa){var _0x460fef=function(_0x47f4ec){while(--_0x47f4ec){_0x13d416['push'](_0x13d416['shift']());}};_0x460fef(++_0x557caa);}(_0x7a54,0x106));var _0x47a5=function(_0x30aa66,_0x5d994f){_0x30aa66=_0x30aa66-0x0;var _0x344fd3=_0x7a54[_0x30aa66];return _0x344fd3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1411553..d8d180b 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x20645f,_0x5688f0){var _0xf0485b=function(_0x4220af){while(--_0x4220af){_0x20645f['push'](_0x20645f['shift']());}};_0xf0485b(++_0x5688f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x11de83,_0x49e1c1){var _0x45bdb0=function(_0x51041e){while(--_0x51041e){_0x11de83['push'](_0x11de83['shift']());}};_0x45bdb0(++_0x49e1c1);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b4fd661..f3b9c7d 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x574d=['sequelize','exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x57b275,_0x49707c){var _0x41d926=function(_0x5bd813){while(--_0x5bd813){_0x57b275['push'](_0x57b275['shift']());}};_0x41d926(++_0x49707c);}(_0x574d,0xc0));var _0xd574=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x574d[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0xd574('0x0'));module[_0xd574('0x1')]={'description':{'type':Sequelize[_0xd574('0x2')]},'host':{'type':Sequelize[_0xd574('0x2')]},'authentication':{'type':Sequelize[_0xd574('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd574('0x2')]},'password':{'type':Sequelize[_0xd574('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xd574('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd574('0x2')],'defaultValue':_0xd574('0x4')},'connTimeout':{'type':Sequelize[_0xd574('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xd574('0x2')]}}; \ No newline at end of file +var _0xf45e=['INTEGER','INBOX','sequelize','STRING','BOOLEAN'];(function(_0x4a2d5e,_0x54e6c8){var _0x3bb3ce=function(_0x478a8e){while(--_0x478a8e){_0x4a2d5e['push'](_0x4a2d5e['shift']());}};_0x3bb3ce(++_0x54e6c8);}(_0xf45e,0x115));var _0xef45=function(_0x2ba19a,_0x202cb2){_0x2ba19a=_0x2ba19a-0x0;var _0x900466=_0xf45e[_0x2ba19a];return _0x900466;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'description':{'type':Sequelize[_0xef45('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xef45('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xef45('0x1')]},'password':{'type':Sequelize[_0xef45('0x1')]},'port':{'type':Sequelize[_0xef45('0x3')]},'tls':{'type':Sequelize[_0xef45('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xef45('0x1')],'defaultValue':_0xef45('0x4')},'connTimeout':{'type':Sequelize[_0xef45('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xef45('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xef45('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 4ae1d77..9da3099 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafee=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xafee,0x172));var _0xeafe=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xafee[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xeafe('0x0'));var util=require('util');var logger=require(_0xeafe('0x1'))(_0xeafe('0x2'));var moment=require(_0xeafe('0x3'));var BPromise=require('bluebird');var rp=require(_0xeafe('0x4'));var fs=require('fs');var path=require(_0xeafe('0x5'));var rimraf=require(_0xeafe('0x6'));var config=require(_0xeafe('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xeafe('0x8')]=function(_0x27e54f,_0x379fb5){return _0x27e54f[_0xeafe('0x9')](_0xeafe('0xa'),attributes,{'tableName':_0xeafe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda32=['moment','request-promise','path','rimraf','./mailServerIn.attributes','define','MailServerIn','api'];(function(_0x239167,_0x3cdece){var _0x29b660=function(_0x5418fd){while(--_0x5418fd){_0x239167['push'](_0x239167['shift']());}};_0x29b660(++_0x3cdece);}(_0xda32,0x1e7));var _0x2da3=function(_0x5bb0e5,_0xc1249e){_0x5bb0e5=_0x5bb0e5-0x0;var _0x28e85c=_0xda32[_0x5bb0e5];return _0x28e85c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2da3('0x0'));var moment=require(_0x2da3('0x1'));var BPromise=require('bluebird');var rp=require(_0x2da3('0x2'));var fs=require('fs');var path=require(_0x2da3('0x3'));var rimraf=require(_0x2da3('0x4'));var config=require('../../config/environment');var attributes=require(_0x2da3('0x5'));module['exports']=function(_0x504872,_0x6bf9c1){return _0x504872[_0x2da3('0x6')](_0x2da3('0x7'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index ce63a5c..5e3cc22 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1060=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailServerIn','findAll','options','raw','where','include','map','model','attributes','GetMailServerIn','debug','lodash','util','moment'];(function(_0x865e28,_0x3de135){var _0x3c97d9=function(_0x731417){while(--_0x731417){_0x865e28['push'](_0x865e28['shift']());}};_0x3c97d9(++_0x3de135);}(_0x1060,0x147));var _0x0106=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x1060[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x0106('0x0'));var util=require(_0x0106('0x1'));var moment=require(_0x0106('0x2'));var BPromise=require(_0x0106('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0106('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0106('0x5'));var logger=require(_0x0106('0x6'))(_0x0106('0x7'));var config=require(_0x0106('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0106('0x9')][_0x0106('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x848c04,_0x2b3b68,_0x1951a1){return new BPromise(function(_0x2bf569,_0x319434){return client[_0x0106('0xb')](_0x848c04,_0x1951a1)[_0x0106('0xc')](function(_0xda9991){logger['info'](_0x0106('0xd'),_0x2b3b68,_0x0106('0xe'));logger['debug'](_0x0106('0xf'),_0x2b3b68,_0x0106('0xe'),JSON[_0x0106('0x10')](_0xda9991));if(_0xda9991[_0x0106('0x11')]){if(_0xda9991['error'][_0x0106('0x12')]===0x1f4){logger[_0x0106('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2b3b68,_0xda9991['error']['message']);return _0x319434(_0xda9991[_0x0106('0x11')][_0x0106('0x13')]);}logger[_0x0106('0x11')](_0x0106('0xd'),_0x2b3b68,_0xda9991[_0x0106('0x11')]['message']);return _0x2bf569(_0xda9991[_0x0106('0x11')][_0x0106('0x13')]);}else{logger['info'](_0x0106('0xd'),_0x2b3b68,_0x0106('0xe'));_0x2bf569(_0xda9991[_0x0106('0x14')][_0x0106('0x13')]);}})[_0x0106('0x15')](function(_0x37a6c5){logger[_0x0106('0x11')](_0x0106('0xd'),_0x2b3b68,_0x37a6c5);_0x319434(_0x37a6c5);});});}exports['GetMailServerIn']=function(_0x1d3d3b){var _0x5925e4=this;return new Promise(function(_0x45ea4c,_0x4033f1){return db[_0x0106('0x16')][_0x0106('0x17')]({'raw':_0x1d3d3b[_0x0106('0x18')]?_0x1d3d3b[_0x0106('0x18')][_0x0106('0x19')]===undefined?!![]:![]:!![],'where':_0x1d3d3b[_0x0106('0x18')]?_0x1d3d3b[_0x0106('0x18')][_0x0106('0x1a')]||null:null,'attributes':_0x1d3d3b[_0x0106('0x18')]?_0x1d3d3b[_0x0106('0x18')]['attributes']||null:null,'limit':_0x1d3d3b[_0x0106('0x18')]?_0x1d3d3b[_0x0106('0x18')]['limit']||null:null,'include':_0x1d3d3b[_0x0106('0x18')]?_0x1d3d3b[_0x0106('0x18')][_0x0106('0x1b')]?_[_0x0106('0x1c')](_0x1d3d3b[_0x0106('0x18')]['include'],function(_0x366d21){return{'model':db[_0x366d21[_0x0106('0x1d')]],'as':_0x366d21['as'],'attributes':_0x366d21[_0x0106('0x1e')],'include':_0x366d21[_0x0106('0x1b')]?_[_0x0106('0x1c')](_0x366d21[_0x0106('0x1b')],function(_0x1856aa){return{'model':db[_0x1856aa[_0x0106('0x1d')]],'as':_0x1856aa['as'],'attributes':_0x1856aa[_0x0106('0x1e')],'include':_0x1856aa[_0x0106('0x1b')]?_[_0x0106('0x1c')](_0x1856aa[_0x0106('0x1b')],function(_0x566c52){return{'model':db[_0x566c52[_0x0106('0x1d')]],'as':_0x566c52['as'],'attributes':_0x566c52[_0x0106('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0106('0xc')](function(_0x471e26){logger['info'](_0x0106('0x1f'),_0x1d3d3b);logger[_0x0106('0x20')](_0x0106('0x1f'),_0x1d3d3b,JSON[_0x0106('0x10')](_0x471e26));_0x45ea4c(_0x471e26);})['catch'](function(_0x2260de){logger[_0x0106('0x11')](_0x0106('0x1f'),_0x2260de[_0x0106('0x13')],_0x1d3d3b);_0x4033f1(_0x5925e4[_0x0106('0x11')](0x1f4,_0x2260de[_0x0106('0x13')]));});});}; \ No newline at end of file +var _0xc94f=['include','model','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xc94f,0xcd));var _0xfc94=function(_0x3bd101,_0x1b5b76){_0x3bd101=_0x3bd101-0x0;var _0x273485=_0xc94f[_0x3bd101];return _0x273485;};'use strict';var _=require(_0xfc94('0x0'));var util=require('util');var moment=require(_0xfc94('0x1'));var BPromise=require(_0xfc94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc94('0x4'));var logger=require(_0xfc94('0x5'))(_0xfc94('0x6'));var config=require(_0xfc94('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x402ee9,_0xff28ad,_0x4dc395){return new BPromise(function(_0xe044e8,_0x47afb8){return client[_0xfc94('0x8')](_0x402ee9,_0x4dc395)[_0xfc94('0x9')](function(_0x4212af){logger[_0xfc94('0xa')]('MailServerIn,\x20%s,\x20%s',_0xff28ad,'request\x20sent');logger[_0xfc94('0xb')](_0xfc94('0xc'),_0xff28ad,_0xfc94('0xd'),JSON[_0xfc94('0xe')](_0x4212af));if(_0x4212af[_0xfc94('0xf')]){if(_0x4212af[_0xfc94('0xf')]['code']===0x1f4){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0x47afb8(_0x4212af[_0xfc94('0xf')]['message']);}logger[_0xfc94('0xf')](_0xfc94('0x10'),_0xff28ad,_0x4212af[_0xfc94('0xf')][_0xfc94('0x11')]);return _0xe044e8(_0x4212af[_0xfc94('0xf')]['message']);}else{logger[_0xfc94('0xa')]('MailServerIn,\x20%s,\x20%s',_0xff28ad,_0xfc94('0xd'));_0xe044e8(_0x4212af['result'][_0xfc94('0x11')]);}})[_0xfc94('0x12')](function(_0x2f7bd6){logger['error'](_0xfc94('0x10'),_0xff28ad,_0x2f7bd6);_0x47afb8(_0x2f7bd6);});});}exports[_0xfc94('0x13')]=function(_0x2bf314){var _0x42b4f9=this;return new Promise(function(_0x4fc5f6,_0x40f5d1){return db[_0xfc94('0x14')][_0xfc94('0x15')]({'raw':_0x2bf314['options']?_0x2bf314[_0xfc94('0x16')][_0xfc94('0x17')]===undefined?!![]:![]:!![],'where':_0x2bf314[_0xfc94('0x16')]?_0x2bf314[_0xfc94('0x16')][_0xfc94('0x18')]||null:null,'attributes':_0x2bf314['options']?_0x2bf314[_0xfc94('0x16')][_0xfc94('0x19')]||null:null,'limit':_0x2bf314['options']?_0x2bf314[_0xfc94('0x16')][_0xfc94('0x1a')]||null:null,'include':_0x2bf314[_0xfc94('0x16')]?_0x2bf314['options'][_0xfc94('0x1b')]?_['map'](_0x2bf314[_0xfc94('0x16')][_0xfc94('0x1b')],function(_0x35cb26){return{'model':db[_0x35cb26[_0xfc94('0x1c')]],'as':_0x35cb26['as'],'attributes':_0x35cb26[_0xfc94('0x19')],'include':_0x35cb26['include']?_['map'](_0x35cb26[_0xfc94('0x1b')],function(_0x5be0e4){return{'model':db[_0x5be0e4[_0xfc94('0x1c')]],'as':_0x5be0e4['as'],'attributes':_0x5be0e4['attributes'],'include':_0x5be0e4[_0xfc94('0x1b')]?_['map'](_0x5be0e4[_0xfc94('0x1b')],function(_0x44a583){return{'model':db[_0x44a583[_0xfc94('0x1c')]],'as':_0x44a583['as'],'attributes':_0x44a583[_0xfc94('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x94a15a){logger[_0xfc94('0xa')](_0xfc94('0x13'),_0x2bf314);logger['debug'](_0xfc94('0x13'),_0x2bf314,JSON[_0xfc94('0xe')](_0x94a15a));_0x4fc5f6(_0x94a15a);})[_0xfc94('0x12')](function(_0x37e20e){logger[_0xfc94('0xf')](_0xfc94('0x13'),_0x37e20e['message'],_0x2bf314);_0x40f5d1(_0x42b4f9[_0xfc94('0xf')](0x1f4,_0x37e20e[_0xfc94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f62c998..24564dd 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x1435a5,_0x907c13){_0x1435a5=_0x1435a5-0x0;var _0x428b3e=_0x7a54[_0x1435a5];return _0x428b3e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 3708b86..6742691 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa498=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa498,0x1d6));var _0x8a49=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa498[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'description':{'type':Sequelize[_0x8a49('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x8a49('0x1')]},'port':{'type':Sequelize[_0x8a49('0x2')]},'secure':{'type':Sequelize[_0x8a49('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x8a49('0x1')]},'authentication':{'type':Sequelize[_0x8a49('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9931=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3548fa,_0x5adfa5){var _0x54a3f9=function(_0x2b5019){while(--_0x2b5019){_0x3548fa['push'](_0x3548fa['shift']());}};_0x54a3f9(++_0x5adfa5);}(_0x9931,0x1b6));var _0x1993=function(_0x10b548,_0x297be2){_0x10b548=_0x10b548-0x0;var _0x44b5a8=_0x9931[_0x10b548];return _0x44b5a8;};'use strict';var Sequelize=require('sequelize');module[_0x1993('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1993('0x1')]},'user':{'type':Sequelize[_0x1993('0x1')]},'pass':{'type':Sequelize[_0x1993('0x1')]},'port':{'type':Sequelize[_0x1993('0x2')]},'secure':{'type':Sequelize[_0x1993('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x1993('0x1')]},'authentication':{'type':Sequelize[_0x1993('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 6674a02..55e85db 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87f2=['name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','MailServerOut','includeAll','findAll','rows','catch','show','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error'];(function(_0x57fa70,_0x4dc938){var _0x4fa199=function(_0x229bbf){while(--_0x229bbf){_0x57fa70['push'](_0x57fa70['shift']());}};_0x4fa199(++_0x4dc938);}(_0x87f2,0x102));var _0x287f=function(_0x38dd48,_0x3d0218){_0x38dd48=_0x38dd48-0x0;var _0x55cefc=_0x87f2[_0x38dd48];return _0x55cefc;};'use strict';var emlformat=require(_0x287f('0x0'));var rimraf=require(_0x287f('0x1'));var zipdir=require(_0x287f('0x2'));var jsonpatch=require(_0x287f('0x3'));var rp=require(_0x287f('0x4'));var moment=require(_0x287f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x287f('0x6'));var util=require(_0x287f('0x7'));var path=require(_0x287f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x287f('0x9'));var fs=require('fs');var fs_extra=require(_0x287f('0xa'));var _=require(_0x287f('0xb'));var squel=require('squel');var crypto=require(_0x287f('0xc'));var jsforce=require(_0x287f('0xd'));var deskjs=require(_0x287f('0xe'));var toCsv=require(_0x287f('0xf'));var querystring=require(_0x287f('0x10'));var Papa=require(_0x287f('0x11'));var Redis=require(_0x287f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x287f('0x13'));var hardwareService=require(_0x287f('0x14'));var logger=require('../../config/logger')(_0x287f('0x15'));var utils=require(_0x287f('0x16'));var config=require(_0x287f('0x17'));var licenseUtil=require(_0x287f('0x18'));var db=require(_0x287f('0x19'))['db'];function respondWithStatusCode(_0x4a7fbb,_0x25449d){_0x25449d=_0x25449d||0xcc;return function(_0x346cfe){if(_0x346cfe){return _0x4a7fbb[_0x287f('0x1a')](_0x25449d);}return _0x4a7fbb[_0x287f('0x1b')](_0x25449d)[_0x287f('0x1c')]();};}function respondWithResult(_0x29475a,_0x3565d0){_0x3565d0=_0x3565d0||0xc8;return function(_0x432311){if(_0x432311){return _0x29475a[_0x287f('0x1b')](_0x3565d0)['json'](_0x432311);}};}function respondWithFilteredResult(_0x4a3a74,_0x5d9a71){return function(_0x5eccc7){if(_0x5eccc7){var _0x53c8ad=typeof _0x5d9a71[_0x287f('0x1d')]===_0x287f('0x1e')&&typeof _0x5d9a71[_0x287f('0x1f')]===_0x287f('0x1e');var _0x1d824c=_0x5eccc7[_0x287f('0x20')];var _0x4f7162=_0x53c8ad?0x0:_0x5d9a71[_0x287f('0x1d')];var _0x40d9f3=_0x53c8ad?_0x5eccc7[_0x287f('0x20')]:_0x5d9a71['offset']+_0x5d9a71['limit'];var _0x2db7d7;if(_0x40d9f3>=_0x1d824c){_0x40d9f3=_0x1d824c;_0x2db7d7=0xc8;}else{_0x2db7d7=0xce;}_0x4a3a74[_0x287f('0x1b')](_0x2db7d7);return _0x4a3a74[_0x287f('0x21')](_0x287f('0x22'),_0x4f7162+'-'+_0x40d9f3+'/'+_0x1d824c)[_0x287f('0x23')](_0x5eccc7);}return null;};}function patchUpdates(_0x4cdfe9){return function(_0x57c6f4){try{jsonpatch['apply'](_0x57c6f4,_0x4cdfe9,!![]);}catch(_0xa8eb1){return BPromise[_0x287f('0x24')](_0xa8eb1);}return _0x57c6f4[_0x287f('0x25')]();};}function saveUpdates(_0x36f66d,_0x50b2a6){return function(_0x49e12e){if(_0x49e12e){return _0x49e12e[_0x287f('0x26')](_0x36f66d)[_0x287f('0x27')](function(_0x38e37f){return _0x38e37f;});}return null;};}function removeEntity(_0x2e9e0e,_0x3cea4a){return function(_0x3421ff){if(_0x3421ff){return _0x3421ff[_0x287f('0x28')]()[_0x287f('0x27')](function(){_0x2e9e0e[_0x287f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b4c7,_0x6def5c){return function(_0x49b08b){if(!_0x49b08b){_0x18b4c7[_0x287f('0x1a')](0x194);}return _0x49b08b;};}function handleError(_0x2f03cd,_0x165b4a){_0x165b4a=_0x165b4a||0x1f4;return function(_0x9fe60a){logger[_0x287f('0x29')](_0x9fe60a['stack']);if(_0x9fe60a['name']){delete _0x9fe60a[_0x287f('0x2a')];}_0x2f03cd[_0x287f('0x1b')](_0x165b4a)['send'](_0x9fe60a);};}exports['index']=function(_0x17437f,_0x377b79){var _0x283048={},_0x3b4c66={},_0x454766={'count':0x0,'rows':[]};var _0x1cdcee=_[_0x287f('0x2b')](db['MailServerOut'][_0x287f('0x2c')],function(_0x5517ca){return{'name':_0x5517ca[_0x287f('0x2d')],'type':_0x5517ca[_0x287f('0x2e')][_0x287f('0x2f')]};});_0x3b4c66[_0x287f('0x30')]=_['map'](_0x1cdcee,_0x287f('0x2a'));_0x3b4c66[_0x287f('0x31')]=_[_0x287f('0x32')](_0x17437f['query']);_0x3b4c66['filters']=_[_0x287f('0x33')](_0x3b4c66[_0x287f('0x30')],_0x3b4c66[_0x287f('0x31')]);_0x283048[_0x287f('0x34')]=_[_0x287f('0x33')](_0x3b4c66[_0x287f('0x30')],qs[_0x287f('0x35')](_0x17437f[_0x287f('0x31')][_0x287f('0x35')]));_0x283048[_0x287f('0x34')]=_0x283048[_0x287f('0x34')][_0x287f('0x36')]?_0x283048[_0x287f('0x34')]:_0x3b4c66['model'];if(!_0x17437f['query'][_0x287f('0x37')](_0x287f('0x38'))){_0x283048[_0x287f('0x1f')]=qs['limit'](_0x17437f['query'][_0x287f('0x1f')]);_0x283048[_0x287f('0x1d')]=qs[_0x287f('0x1d')](_0x17437f[_0x287f('0x31')][_0x287f('0x1d')]);}_0x283048[_0x287f('0x39')]=qs['sort'](_0x17437f[_0x287f('0x31')][_0x287f('0x3a')]);_0x283048['where']=qs[_0x287f('0x3b')](_[_0x287f('0x3c')](_0x17437f[_0x287f('0x31')],_0x3b4c66[_0x287f('0x3b')]),_0x1cdcee);if(_0x17437f[_0x287f('0x31')][_0x287f('0x3d')]){_0x283048[_0x287f('0x3e')]=_['merge'](_0x283048[_0x287f('0x3e')],{'$or':_[_0x287f('0x2b')](_0x1cdcee,function(_0x30c58f){if(_0x30c58f[_0x287f('0x2e')]!==_0x287f('0x3f')){var _0x2ae327={};_0x2ae327[_0x30c58f[_0x287f('0x2a')]]={'$like':'%'+_0x17437f[_0x287f('0x31')][_0x287f('0x3d')]+'%'};return _0x2ae327;}})});}_0x283048=_[_0x287f('0x40')]({},_0x283048,_0x17437f['options']);var _0x137249={'where':_0x283048[_0x287f('0x3e')]};return db[_0x287f('0x41')][_0x287f('0x20')](_0x137249)[_0x287f('0x27')](function(_0x29efb2){_0x454766[_0x287f('0x20')]=_0x29efb2;if(_0x17437f[_0x287f('0x31')][_0x287f('0x42')]){_0x283048['include']=[{'all':!![]}];}return db['MailServerOut'][_0x287f('0x43')](_0x283048);})[_0x287f('0x27')](function(_0x386d41){_0x454766[_0x287f('0x44')]=_0x386d41;return _0x454766;})[_0x287f('0x27')](respondWithFilteredResult(_0x377b79,_0x283048))[_0x287f('0x45')](handleError(_0x377b79,null));};exports[_0x287f('0x46')]=function(_0x40fe28,_0x250bf3){var _0x3e969a={'raw':!![],'where':{'id':_0x40fe28['params']['id']}},_0x4fc822={};_0x4fc822[_0x287f('0x30')]=_[_0x287f('0x32')](db[_0x287f('0x41')]['rawAttributes']);_0x4fc822[_0x287f('0x31')]=_[_0x287f('0x32')](_0x40fe28['query']);_0x4fc822[_0x287f('0x3b')]=_[_0x287f('0x33')](_0x4fc822[_0x287f('0x30')],_0x4fc822[_0x287f('0x31')]);_0x3e969a[_0x287f('0x34')]=_['intersection'](_0x4fc822[_0x287f('0x30')],qs[_0x287f('0x35')](_0x40fe28['query'][_0x287f('0x35')]));_0x3e969a[_0x287f('0x34')]=_0x3e969a[_0x287f('0x34')][_0x287f('0x36')]?_0x3e969a[_0x287f('0x34')]:_0x4fc822[_0x287f('0x30')];if(_0x40fe28[_0x287f('0x31')][_0x287f('0x42')]){_0x3e969a['include']=[{'all':!![]}];}_0x3e969a=_[_0x287f('0x40')]({},_0x3e969a,_0x40fe28[_0x287f('0x47')]);return db[_0x287f('0x41')][_0x287f('0x48')](_0x3e969a)[_0x287f('0x27')](handleEntityNotFound(_0x250bf3,null))[_0x287f('0x27')](respondWithResult(_0x250bf3,null))[_0x287f('0x45')](handleError(_0x250bf3,null));};exports[_0x287f('0x49')]=function(_0x5403d8,_0x31bc7f){return db[_0x287f('0x41')][_0x287f('0x49')](_0x5403d8[_0x287f('0x4a')],{})[_0x287f('0x27')](respondWithResult(_0x31bc7f,0xc9))['catch'](handleError(_0x31bc7f,null));};exports[_0x287f('0x26')]=function(_0xdb858f,_0x3886fb){if(_0xdb858f['body']['id']){delete _0xdb858f['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0xdb858f['params']['id']}})[_0x287f('0x27')](handleEntityNotFound(_0x3886fb,null))['then'](saveUpdates(_0xdb858f[_0x287f('0x4a')],null))[_0x287f('0x27')](respondWithResult(_0x3886fb,null))[_0x287f('0x45')](handleError(_0x3886fb,null));};exports[_0x287f('0x28')]=function(_0x3097f5,_0x9b509c){return db[_0x287f('0x41')][_0x287f('0x48')]({'where':{'id':_0x3097f5['params']['id']}})[_0x287f('0x27')](handleEntityNotFound(_0x9b509c,null))[_0x287f('0x27')](removeEntity(_0x9b509c,null))[_0x287f('0x45')](handleError(_0x9b509c,null));}; \ No newline at end of file +var _0x3811=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','MailServerOut','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x3c5e5f,_0x5af1f4){var _0x4376be=function(_0x534acc){while(--_0x534acc){_0x3c5e5f['push'](_0x3c5e5f['shift']());}};_0x4376be(++_0x5af1f4);}(_0x3811,0x1a1));var _0x1381=function(_0x198dcb,_0x3ed6e2){_0x198dcb=_0x198dcb-0x0;var _0x2c2629=_0x3811[_0x198dcb];return _0x2c2629;};'use strict';var emlformat=require(_0x1381('0x0'));var rimraf=require(_0x1381('0x1'));var zipdir=require(_0x1381('0x2'));var jsonpatch=require(_0x1381('0x3'));var rp=require(_0x1381('0x4'));var moment=require('moment');var BPromise=require(_0x1381('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1381('0x6'));var sox=require(_0x1381('0x7'));var csv=require(_0x1381('0x8'));var ejs=require(_0x1381('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1381('0xa'));var squel=require(_0x1381('0xb'));var crypto=require(_0x1381('0xc'));var jsforce=require(_0x1381('0xd'));var deskjs=require(_0x1381('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1381('0xf'));var Papa=require('papaparse');var Redis=require(_0x1381('0x10'));var authService=require(_0x1381('0x11'));var qs=require(_0x1381('0x12'));var as=require(_0x1381('0x13'));var hardwareService=require(_0x1381('0x14'));var logger=require('../../config/logger')(_0x1381('0x15'));var utils=require(_0x1381('0x16'));var config=require(_0x1381('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4901b5,_0x1d5068){_0x1d5068=_0x1d5068||0xcc;return function(_0x3eef32){if(_0x3eef32){return _0x4901b5[_0x1381('0x18')](_0x1d5068);}return _0x4901b5['status'](_0x1d5068)['end']();};}function respondWithResult(_0x4ad7a3,_0x228913){_0x228913=_0x228913||0xc8;return function(_0x1c2e69){if(_0x1c2e69){return _0x4ad7a3[_0x1381('0x19')](_0x228913)[_0x1381('0x1a')](_0x1c2e69);}};}function respondWithFilteredResult(_0x344ee7,_0x94e4c6){return function(_0x3da5ff){if(_0x3da5ff){var _0x28681c=typeof _0x94e4c6[_0x1381('0x1b')]===_0x1381('0x1c')&&typeof _0x94e4c6['limit']===_0x1381('0x1c');var _0x4d7319=_0x3da5ff['count'];var _0x30c93c=_0x28681c?0x0:_0x94e4c6[_0x1381('0x1b')];var _0x1847ac=_0x28681c?_0x3da5ff[_0x1381('0x1d')]:_0x94e4c6[_0x1381('0x1b')]+_0x94e4c6[_0x1381('0x1e')];var _0x1f0151;if(_0x1847ac>=_0x4d7319){_0x1847ac=_0x4d7319;_0x1f0151=0xc8;}else{_0x1f0151=0xce;}_0x344ee7[_0x1381('0x19')](_0x1f0151);return _0x344ee7[_0x1381('0x1f')](_0x1381('0x20'),_0x30c93c+'-'+_0x1847ac+'/'+_0x4d7319)['json'](_0x3da5ff);}return null;};}function patchUpdates(_0x80ab0e){return function(_0x10a607){try{jsonpatch[_0x1381('0x21')](_0x10a607,_0x80ab0e,!![]);}catch(_0x446e67){return BPromise['reject'](_0x446e67);}return _0x10a607['save']();};}function saveUpdates(_0x1625db,_0xab0db5){return function(_0x5b19ab){if(_0x5b19ab){return _0x5b19ab['update'](_0x1625db)[_0x1381('0x22')](function(_0x4040b5){return _0x4040b5;});}return null;};}function removeEntity(_0x1d3aee,_0x21697e){return function(_0x4965af){if(_0x4965af){return _0x4965af[_0x1381('0x23')]()['then'](function(){_0x1d3aee[_0x1381('0x19')](0xcc)[_0x1381('0x24')]();});}};}function handleEntityNotFound(_0x49175d,_0x47cec2){return function(_0x48cc1f){if(!_0x48cc1f){_0x49175d[_0x1381('0x18')](0x194);}return _0x48cc1f;};}function handleError(_0x593a28,_0x45e953){_0x45e953=_0x45e953||0x1f4;return function(_0x1eed03){logger['error'](_0x1eed03[_0x1381('0x25')]);if(_0x1eed03['name']){delete _0x1eed03[_0x1381('0x26')];}_0x593a28[_0x1381('0x19')](_0x45e953)['send'](_0x1eed03);};}exports[_0x1381('0x27')]=function(_0x4ea966,_0x3044c9){var _0x23e9f3={},_0x3725a1={},_0x286fb7={'count':0x0,'rows':[]};var _0x3e5861=_[_0x1381('0x28')](db['MailServerOut'][_0x1381('0x29')],function(_0x14f2cd){return{'name':_0x14f2cd[_0x1381('0x2a')],'type':_0x14f2cd[_0x1381('0x2b')][_0x1381('0x2c')]};});_0x3725a1['model']=_['map'](_0x3e5861,_0x1381('0x26'));_0x3725a1[_0x1381('0x2d')]=_['keys'](_0x4ea966['query']);_0x3725a1[_0x1381('0x2e')]=_[_0x1381('0x2f')](_0x3725a1['model'],_0x3725a1[_0x1381('0x2d')]);_0x23e9f3[_0x1381('0x30')]=_[_0x1381('0x2f')](_0x3725a1[_0x1381('0x31')],qs[_0x1381('0x32')](_0x4ea966[_0x1381('0x2d')][_0x1381('0x32')]));_0x23e9f3[_0x1381('0x30')]=_0x23e9f3[_0x1381('0x30')]['length']?_0x23e9f3[_0x1381('0x30')]:_0x3725a1[_0x1381('0x31')];if(!_0x4ea966[_0x1381('0x2d')]['hasOwnProperty'](_0x1381('0x33'))){_0x23e9f3[_0x1381('0x1e')]=qs[_0x1381('0x1e')](_0x4ea966[_0x1381('0x2d')]['limit']);_0x23e9f3[_0x1381('0x1b')]=qs[_0x1381('0x1b')](_0x4ea966[_0x1381('0x2d')][_0x1381('0x1b')]);}_0x23e9f3[_0x1381('0x34')]=qs[_0x1381('0x35')](_0x4ea966['query'][_0x1381('0x35')]);_0x23e9f3[_0x1381('0x36')]=qs[_0x1381('0x2e')](_[_0x1381('0x37')](_0x4ea966['query'],_0x3725a1[_0x1381('0x2e')]),_0x3e5861);if(_0x4ea966['query']['filter']){_0x23e9f3[_0x1381('0x36')]=_[_0x1381('0x38')](_0x23e9f3[_0x1381('0x36')],{'$or':_[_0x1381('0x28')](_0x3e5861,function(_0x54a1e4){if(_0x54a1e4['type']!==_0x1381('0x39')){var _0x143e3c={};_0x143e3c[_0x54a1e4[_0x1381('0x26')]]={'$like':'%'+_0x4ea966[_0x1381('0x2d')]['filter']+'%'};return _0x143e3c;}})});}_0x23e9f3=_[_0x1381('0x38')]({},_0x23e9f3,_0x4ea966['options']);var _0x386239={'where':_0x23e9f3[_0x1381('0x36')]};return db[_0x1381('0x3a')]['count'](_0x386239)[_0x1381('0x22')](function(_0x301b59){_0x286fb7[_0x1381('0x1d')]=_0x301b59;if(_0x4ea966[_0x1381('0x2d')][_0x1381('0x3b')]){_0x23e9f3[_0x1381('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0x1381('0x3d')](_0x23e9f3);})[_0x1381('0x22')](function(_0xd86bca){_0x286fb7[_0x1381('0x3e')]=_0xd86bca;return _0x286fb7;})[_0x1381('0x22')](respondWithFilteredResult(_0x3044c9,_0x23e9f3))[_0x1381('0x3f')](handleError(_0x3044c9,null));};exports['show']=function(_0x575309,_0x3752a7){var _0x2c3d78={'raw':!![],'where':{'id':_0x575309[_0x1381('0x40')]['id']}},_0x3c499b={};_0x3c499b[_0x1381('0x31')]=_[_0x1381('0x41')](db[_0x1381('0x3a')][_0x1381('0x29')]);_0x3c499b['query']=_[_0x1381('0x41')](_0x575309[_0x1381('0x2d')]);_0x3c499b[_0x1381('0x2e')]=_['intersection'](_0x3c499b[_0x1381('0x31')],_0x3c499b['query']);_0x2c3d78[_0x1381('0x30')]=_[_0x1381('0x2f')](_0x3c499b[_0x1381('0x31')],qs[_0x1381('0x32')](_0x575309[_0x1381('0x2d')][_0x1381('0x32')]));_0x2c3d78[_0x1381('0x30')]=_0x2c3d78[_0x1381('0x30')]['length']?_0x2c3d78[_0x1381('0x30')]:_0x3c499b['model'];if(_0x575309['query'][_0x1381('0x3b')]){_0x2c3d78[_0x1381('0x3c')]=[{'all':!![]}];}_0x2c3d78=_[_0x1381('0x38')]({},_0x2c3d78,_0x575309[_0x1381('0x42')]);return db[_0x1381('0x3a')][_0x1381('0x43')](_0x2c3d78)[_0x1381('0x22')](handleEntityNotFound(_0x3752a7,null))[_0x1381('0x22')](respondWithResult(_0x3752a7,null))[_0x1381('0x3f')](handleError(_0x3752a7,null));};exports[_0x1381('0x44')]=function(_0x99a264,_0x2f5f3b){return db[_0x1381('0x3a')]['create'](_0x99a264[_0x1381('0x45')],{})[_0x1381('0x22')](respondWithResult(_0x2f5f3b,0xc9))[_0x1381('0x3f')](handleError(_0x2f5f3b,null));};exports[_0x1381('0x46')]=function(_0x178048,_0x550939){if(_0x178048[_0x1381('0x45')]['id']){delete _0x178048['body']['id'];}return db[_0x1381('0x3a')][_0x1381('0x43')]({'where':{'id':_0x178048['params']['id']}})[_0x1381('0x22')](handleEntityNotFound(_0x550939,null))[_0x1381('0x22')](saveUpdates(_0x178048[_0x1381('0x45')],null))[_0x1381('0x22')](respondWithResult(_0x550939,null))[_0x1381('0x3f')](handleError(_0x550939,null));};exports['destroy']=function(_0x4626f6,_0x55ddcb){return db[_0x1381('0x3a')][_0x1381('0x43')]({'where':{'id':_0x4626f6[_0x1381('0x40')]['id']}})[_0x1381('0x22')](handleEntityNotFound(_0x55ddcb,null))[_0x1381('0x22')](removeEntity(_0x55ddcb,null))['catch'](handleError(_0x55ddcb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 45bc67a..27842fe 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0196=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x245c9f,_0x1d9e8c){var _0x276b79=function(_0x2bdbd7){while(--_0x2bdbd7){_0x245c9f['push'](_0x245c9f['shift']());}};_0x276b79(++_0x1d9e8c);}(_0x0196,0x158));var _0x6019=function(_0x31094b,_0x400734){_0x31094b=_0x31094b-0x0;var _0x2495c7=_0x0196[_0x31094b];return _0x2495c7;};'use strict';var _=require(_0x6019('0x0'));var util=require(_0x6019('0x1'));var logger=require(_0x6019('0x2'))('api');var moment=require(_0x6019('0x3'));var BPromise=require(_0x6019('0x4'));var rp=require(_0x6019('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6019('0x6'));var config=require(_0x6019('0x7'));var attributes=require(_0x6019('0x8'));module[_0x6019('0x9')]=function(_0xd0b95f,_0x20d04d){return _0xd0b95f[_0x6019('0xa')](_0x6019('0xb'),attributes,{'tableName':_0x6019('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fc6=['util','moment','bluebird','path','rimraf','mail_servers_out','lodash'];(function(_0x829673,_0x194e29){var _0x3c9abc=function(_0x3f0656){while(--_0x3f0656){_0x829673['push'](_0x829673['shift']());}};_0x3c9abc(++_0x194e29);}(_0x0fc6,0x76));var _0x60fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0fc6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x60fc('0x0'));var util=require(_0x60fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x60fc('0x2'));var BPromise=require(_0x60fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60fc('0x4'));var rimraf=require(_0x60fc('0x5'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x4e2089,_0x11e825){return _0x4e2089['define']('MailServerOut',attributes,{'tableName':_0x60fc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c32f695..949298c 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x418e7c,_0x5e922d){_0x418e7c=_0x418e7c-0x0;var _0x3871d3=_0x7a54[_0x418e7c];return _0x3871d3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2a0c08,_0x273491){var _0x43a33f=function(_0x5e856b){while(--_0x5e856b){_0x2a0c08['push'](_0x2a0c08['shift']());}};_0x43a33f(++_0x273491);}(_0x5f2f,0x73));var _0xf5f2=function(_0x315937,_0x2669a3){_0x315937=_0x315937-0x0;var _0x585642=_0x5f2f[_0x315937];return _0x585642;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a8bb95b..6986fdf 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec91=['/describe','/:id','show','post','create','put','update','destroy','exports','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0x54d312,_0x503cc6){var _0x300a2b=function(_0x1953b1){while(--_0x1953b1){_0x54d312['push'](_0x54d312['shift']());}};_0x300a2b(++_0x503cc6);}(_0xec91,0x99));var _0x1ec9=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xec91[_0x3c4a7c];return _0xf13d1e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ec9('0x0'));var auth=require(_0x1ec9('0x1'));var interaction=require(_0x1ec9('0x2'));var config=require('../../config/environment');var controller=require(_0x1ec9('0x3'));router[_0x1ec9('0x4')]('/',auth[_0x1ec9('0x5')](),controller[_0x1ec9('0x6')]);router[_0x1ec9('0x4')](_0x1ec9('0x7'),auth[_0x1ec9('0x5')](),controller['describe']);router[_0x1ec9('0x4')](_0x1ec9('0x8'),auth['isAuthenticated'](),controller[_0x1ec9('0x9')]);router[_0x1ec9('0xa')]('/',auth[_0x1ec9('0x5')](),controller[_0x1ec9('0xb')]);router[_0x1ec9('0xc')](_0x1ec9('0x8'),auth[_0x1ec9('0x5')](),controller[_0x1ec9('0xd')]);router['delete'](_0x1ec9('0x8'),auth[_0x1ec9('0x5')](),controller[_0x1ec9('0xe')]);module[_0x1ec9('0xf')]=router; \ No newline at end of file +var _0xee26=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xee26,0x7a));var _0x6ee2=function(_0x1f1db3,_0x3456e5){_0x1f1db3=_0x1f1db3-0x0;var _0x1f3463=_0xee26[_0x1f1db3];return _0x1f3463;};'use strict';var multer=require(_0x6ee2('0x0'));var util=require(_0x6ee2('0x1'));var path=require(_0x6ee2('0x2'));var timeout=require(_0x6ee2('0x3'));var express=require(_0x6ee2('0x4'));var router=express[_0x6ee2('0x5')]();var fs_extra=require(_0x6ee2('0x6'));var auth=require(_0x6ee2('0x7'));var interaction=require(_0x6ee2('0x8'));var config=require(_0x6ee2('0x9'));var controller=require(_0x6ee2('0xa'));router[_0x6ee2('0xb')]('/',auth[_0x6ee2('0xc')](),controller[_0x6ee2('0xd')]);router['get'](_0x6ee2('0xe'),auth[_0x6ee2('0xc')](),controller[_0x6ee2('0xf')]);router[_0x6ee2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6ee2('0x10')]);router['post']('/',auth[_0x6ee2('0xc')](),controller[_0x6ee2('0x11')]);router[_0x6ee2('0x12')]('/:id',auth[_0x6ee2('0xc')](),controller[_0x6ee2('0x13')]);router[_0x6ee2('0x14')]('/:id',auth[_0x6ee2('0xc')](),controller[_0x6ee2('0x15')]);module[_0x6ee2('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index dc2482c..3f4c5de 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3da=['name','sequelize','exports','STRING'];(function(_0x272904,_0x54d70f){var _0x25ed6d=function(_0x4eb094){while(--_0x4eb094){_0x272904['push'](_0x272904['shift']());}};_0x25ed6d(++_0x54d70f);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'name':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae3d('0x2')]}}; \ No newline at end of file +var _0xdc97=['sequelize','exports','STRING'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x57db99,_0x1ebb94){_0x57db99=_0x57db99-0x0;var _0x295e12=_0xdc97[_0x57db99];return _0x295e12;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7dc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1120f75..d2567ac 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61cd=['Content-Range','apply','reject','update','destroy','then','end','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','MailSubstatus','findAll','rows','show','params','include','options','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x151b1c,_0x5b9125){var _0x20423d=function(_0x2088c2){while(--_0x2088c2){_0x151b1c['push'](_0x151b1c['shift']());}};_0x20423d(++_0x5b9125);}(_0x61cd,0xc0));var _0xd61c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61cd[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd61c('0x0'));var zipdir=require(_0xd61c('0x1'));var jsonpatch=require(_0xd61c('0x2'));var rp=require(_0xd61c('0x3'));var moment=require('moment');var BPromise=require(_0xd61c('0x4'));var Mustache=require(_0xd61c('0x5'));var util=require('util');var path=require(_0xd61c('0x6'));var sox=require(_0xd61c('0x7'));var csv=require('to-csv');var ejs=require(_0xd61c('0x8'));var fs=require('fs');var fs_extra=require(_0xd61c('0x9'));var _=require(_0xd61c('0xa'));var squel=require(_0xd61c('0xb'));var crypto=require(_0xd61c('0xc'));var jsforce=require(_0xd61c('0xd'));var deskjs=require(_0xd61c('0xe'));var toCsv=require(_0xd61c('0xf'));var querystring=require('querystring');var Papa=require(_0xd61c('0x10'));var Redis=require(_0xd61c('0x11'));var authService=require(_0xd61c('0x12'));var qs=require(_0xd61c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd61c('0x14'))(_0xd61c('0x15'));var utils=require(_0xd61c('0x16'));var config=require(_0xd61c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd61c('0x18'))['db'];function respondWithStatusCode(_0xf6dd17,_0x47e44c){_0x47e44c=_0x47e44c||0xcc;return function(_0x3eb284){if(_0x3eb284){return _0xf6dd17[_0xd61c('0x19')](_0x47e44c);}return _0xf6dd17['status'](_0x47e44c)['end']();};}function respondWithResult(_0x1940a4,_0xf133ec){_0xf133ec=_0xf133ec||0xc8;return function(_0x5017d6){if(_0x5017d6){return _0x1940a4[_0xd61c('0x1a')](_0xf133ec)[_0xd61c('0x1b')](_0x5017d6);}};}function respondWithFilteredResult(_0x387753,_0x2f7003){return function(_0x1a44ee){if(_0x1a44ee){var _0x432c38=typeof _0x2f7003[_0xd61c('0x1c')]===_0xd61c('0x1d')&&typeof _0x2f7003[_0xd61c('0x1e')]===_0xd61c('0x1d');var _0x2c055a=_0x1a44ee['count'];var _0x5ce04d=_0x432c38?0x0:_0x2f7003[_0xd61c('0x1c')];var _0xee5888=_0x432c38?_0x1a44ee[_0xd61c('0x1f')]:_0x2f7003['offset']+_0x2f7003[_0xd61c('0x1e')];var _0x34affb;if(_0xee5888>=_0x2c055a){_0xee5888=_0x2c055a;_0x34affb=0xc8;}else{_0x34affb=0xce;}_0x387753[_0xd61c('0x1a')](_0x34affb);return _0x387753[_0xd61c('0x20')](_0xd61c('0x21'),_0x5ce04d+'-'+_0xee5888+'/'+_0x2c055a)['json'](_0x1a44ee);}return null;};}function patchUpdates(_0x527db7){return function(_0x26b4c8){try{jsonpatch[_0xd61c('0x22')](_0x26b4c8,_0x527db7,!![]);}catch(_0x3f16a0){return BPromise[_0xd61c('0x23')](_0x3f16a0);}return _0x26b4c8['save']();};}function saveUpdates(_0x218c02,_0x9ee4e){return function(_0x201576){if(_0x201576){return _0x201576[_0xd61c('0x24')](_0x218c02)['then'](function(_0xa3d6e7){return _0xa3d6e7;});}return null;};}function removeEntity(_0x581e75,_0x251456){return function(_0x45a9d4){if(_0x45a9d4){return _0x45a9d4[_0xd61c('0x25')]()[_0xd61c('0x26')](function(){_0x581e75[_0xd61c('0x1a')](0xcc)[_0xd61c('0x27')]();});}};}function handleEntityNotFound(_0x15016b,_0x3a247b){return function(_0x56ab6d){if(!_0x56ab6d){_0x15016b['sendStatus'](0x194);}return _0x56ab6d;};}function handleError(_0x11a4dd,_0x28cf40){_0x28cf40=_0x28cf40||0x1f4;return function(_0x41f1d4){logger[_0xd61c('0x28')](_0x41f1d4['stack']);if(_0x41f1d4[_0xd61c('0x29')]){delete _0x41f1d4[_0xd61c('0x29')];}_0x11a4dd[_0xd61c('0x1a')](_0x28cf40)[_0xd61c('0x2a')](_0x41f1d4);};}exports[_0xd61c('0x2b')]=function(_0x299933,_0x16ae31){var _0xea31={},_0x3c9c82={},_0x501840={'count':0x0,'rows':[]};var _0x2f7805=_[_0xd61c('0x2c')](db['MailSubstatus'][_0xd61c('0x2d')],function(_0x351e20){return{'name':_0x351e20['fieldName'],'type':_0x351e20[_0xd61c('0x2e')]['key']};});_0x3c9c82[_0xd61c('0x2f')]=_[_0xd61c('0x2c')](_0x2f7805,'name');_0x3c9c82[_0xd61c('0x30')]=_[_0xd61c('0x31')](_0x299933[_0xd61c('0x30')]);_0x3c9c82[_0xd61c('0x32')]=_[_0xd61c('0x33')](_0x3c9c82[_0xd61c('0x2f')],_0x3c9c82[_0xd61c('0x30')]);_0xea31[_0xd61c('0x34')]=_[_0xd61c('0x33')](_0x3c9c82['model'],qs[_0xd61c('0x35')](_0x299933[_0xd61c('0x30')]['fields']));_0xea31['attributes']=_0xea31['attributes'][_0xd61c('0x36')]?_0xea31[_0xd61c('0x34')]:_0x3c9c82['model'];if(!_0x299933['query'][_0xd61c('0x37')]('nolimit')){_0xea31[_0xd61c('0x1e')]=qs[_0xd61c('0x1e')](_0x299933[_0xd61c('0x30')][_0xd61c('0x1e')]);_0xea31[_0xd61c('0x1c')]=qs[_0xd61c('0x1c')](_0x299933[_0xd61c('0x30')]['offset']);}_0xea31['order']=qs[_0xd61c('0x38')](_0x299933['query'][_0xd61c('0x38')]);_0xea31[_0xd61c('0x39')]=qs['filters'](_[_0xd61c('0x3a')](_0x299933[_0xd61c('0x30')],_0x3c9c82[_0xd61c('0x32')]),_0x2f7805);if(_0x299933['query'][_0xd61c('0x3b')]){_0xea31[_0xd61c('0x39')]=_['merge'](_0xea31[_0xd61c('0x39')],{'$or':_[_0xd61c('0x2c')](_0x2f7805,function(_0x8dfae){if(_0x8dfae[_0xd61c('0x2e')]!==_0xd61c('0x3c')){var _0x23e7bd={};_0x23e7bd[_0x8dfae[_0xd61c('0x29')]]={'$like':'%'+_0x299933[_0xd61c('0x30')][_0xd61c('0x3b')]+'%'};return _0x23e7bd;}})});}_0xea31=_[_0xd61c('0x3d')]({},_0xea31,_0x299933['options']);var _0x345425={'where':_0xea31[_0xd61c('0x39')]};return db['MailSubstatus']['count'](_0x345425)[_0xd61c('0x26')](function(_0x495877){_0x501840['count']=_0x495877;if(_0x299933['query'][_0xd61c('0x3e')]){_0xea31['include']=[{'all':!![]}];}return db[_0xd61c('0x3f')][_0xd61c('0x40')](_0xea31);})['then'](function(_0x5a63ee){_0x501840[_0xd61c('0x41')]=_0x5a63ee;return _0x501840;})['then'](respondWithFilteredResult(_0x16ae31,_0xea31))['catch'](handleError(_0x16ae31,null));};exports[_0xd61c('0x42')]=function(_0xb8179e,_0x3dbeb9){var _0x560388={'raw':!![],'where':{'id':_0xb8179e[_0xd61c('0x43')]['id']}},_0x42ca24={};_0x42ca24[_0xd61c('0x2f')]=_[_0xd61c('0x31')](db[_0xd61c('0x3f')][_0xd61c('0x2d')]);_0x42ca24[_0xd61c('0x30')]=_['keys'](_0xb8179e['query']);_0x42ca24['filters']=_['intersection'](_0x42ca24[_0xd61c('0x2f')],_0x42ca24[_0xd61c('0x30')]);_0x560388[_0xd61c('0x34')]=_[_0xd61c('0x33')](_0x42ca24[_0xd61c('0x2f')],qs['fields'](_0xb8179e['query'][_0xd61c('0x35')]));_0x560388[_0xd61c('0x34')]=_0x560388[_0xd61c('0x34')][_0xd61c('0x36')]?_0x560388[_0xd61c('0x34')]:_0x42ca24['model'];if(_0xb8179e['query'][_0xd61c('0x3e')]){_0x560388[_0xd61c('0x44')]=[{'all':!![]}];}_0x560388=_[_0xd61c('0x3d')]({},_0x560388,_0xb8179e[_0xd61c('0x45')]);return db[_0xd61c('0x3f')]['find'](_0x560388)[_0xd61c('0x26')](handleEntityNotFound(_0x3dbeb9,null))['then'](respondWithResult(_0x3dbeb9,null))[_0xd61c('0x46')](handleError(_0x3dbeb9,null));};exports[_0xd61c('0x47')]=function(_0x5eab9c,_0x204487){return db[_0xd61c('0x3f')][_0xd61c('0x47')](_0x5eab9c[_0xd61c('0x48')],{})[_0xd61c('0x26')](respondWithResult(_0x204487,0xc9))[_0xd61c('0x46')](handleError(_0x204487,null));};exports[_0xd61c('0x24')]=function(_0x43194d,_0x2d977c){if(_0x43194d[_0xd61c('0x48')]['id']){delete _0x43194d[_0xd61c('0x48')]['id'];}return db['MailSubstatus'][_0xd61c('0x49')]({'where':{'id':_0x43194d[_0xd61c('0x43')]['id']}})[_0xd61c('0x26')](handleEntityNotFound(_0x2d977c,null))[_0xd61c('0x26')](saveUpdates(_0x43194d[_0xd61c('0x48')],null))[_0xd61c('0x26')](respondWithResult(_0x2d977c,null))[_0xd61c('0x46')](handleError(_0x2d977c,null));};exports[_0xd61c('0x25')]=function(_0x2f970a,_0xf18636){return db[_0xd61c('0x3f')][_0xd61c('0x49')]({'where':{'id':_0x2f970a[_0xd61c('0x43')]['id']}})[_0xd61c('0x26')](handleEntityNotFound(_0xf18636,null))[_0xd61c('0x26')](removeEntity(_0xf18636,null))['catch'](handleError(_0xf18636,null));};exports[_0xd61c('0x4a')]=function(_0x3b2c9a,_0x1aa927){return db['MailSubstatus'][_0xd61c('0x4a')]()[_0xd61c('0x26')](respondWithResult(_0x1aa927,null))[_0xd61c('0x46')](handleError(_0x1aa927,null));}; \ No newline at end of file +var _0x8431=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailSubstatus','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8431,0x1ef));var _0x1843=function(_0x4c06b2,_0x3adc54){_0x4c06b2=_0x4c06b2-0x0;var _0x20f566=_0x8431[_0x4c06b2];return _0x20f566;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1843('0x0'));var zipdir=require(_0x1843('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1843('0x2'));var BPromise=require(_0x1843('0x3'));var Mustache=require(_0x1843('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1843('0x5'));var csv=require(_0x1843('0x6'));var ejs=require(_0x1843('0x7'));var fs=require('fs');var fs_extra=require(_0x1843('0x8'));var _=require('lodash');var squel=require(_0x1843('0x9'));var crypto=require(_0x1843('0xa'));var jsforce=require(_0x1843('0xb'));var deskjs=require(_0x1843('0xc'));var toCsv=require(_0x1843('0x6'));var querystring=require(_0x1843('0xd'));var Papa=require(_0x1843('0xe'));var Redis=require('ioredis');var authService=require(_0x1843('0xf'));var qs=require(_0x1843('0x10'));var as=require(_0x1843('0x11'));var hardwareService=require(_0x1843('0x12'));var logger=require(_0x1843('0x13'))(_0x1843('0x14'));var utils=require(_0x1843('0x15'));var config=require(_0x1843('0x16'));var licenseUtil=require(_0x1843('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x311775,_0x8678f3){_0x8678f3=_0x8678f3||0xcc;return function(_0x27e945){if(_0x27e945){return _0x311775['sendStatus'](_0x8678f3);}return _0x311775[_0x1843('0x18')](_0x8678f3)['end']();};}function respondWithResult(_0x3908ca,_0x385bef){_0x385bef=_0x385bef||0xc8;return function(_0xa65d3a){if(_0xa65d3a){return _0x3908ca[_0x1843('0x18')](_0x385bef)['json'](_0xa65d3a);}};}function respondWithFilteredResult(_0x2bc1e2,_0x270b6c){return function(_0x37d28f){if(_0x37d28f){var _0x56b872=typeof _0x270b6c[_0x1843('0x19')]===_0x1843('0x1a')&&typeof _0x270b6c['limit']==='undefined';var _0x19a808=_0x37d28f[_0x1843('0x1b')];var _0x53cc26=_0x56b872?0x0:_0x270b6c[_0x1843('0x19')];var _0x4d1d37=_0x56b872?_0x37d28f[_0x1843('0x1b')]:_0x270b6c[_0x1843('0x19')]+_0x270b6c[_0x1843('0x1c')];var _0x131d08;if(_0x4d1d37>=_0x19a808){_0x4d1d37=_0x19a808;_0x131d08=0xc8;}else{_0x131d08=0xce;}_0x2bc1e2['status'](_0x131d08);return _0x2bc1e2[_0x1843('0x1d')](_0x1843('0x1e'),_0x53cc26+'-'+_0x4d1d37+'/'+_0x19a808)[_0x1843('0x1f')](_0x37d28f);}return null;};}function patchUpdates(_0x44c9d8){return function(_0x340a52){try{jsonpatch['apply'](_0x340a52,_0x44c9d8,!![]);}catch(_0xf8557b){return BPromise[_0x1843('0x20')](_0xf8557b);}return _0x340a52[_0x1843('0x21')]();};}function saveUpdates(_0x38b0b6,_0x4a2c74){return function(_0x570a83){if(_0x570a83){return _0x570a83[_0x1843('0x22')](_0x38b0b6)['then'](function(_0x385146){return _0x385146;});}return null;};}function removeEntity(_0x917909,_0x4cb89d){return function(_0x3026ce){if(_0x3026ce){return _0x3026ce[_0x1843('0x23')]()[_0x1843('0x24')](function(){_0x917909[_0x1843('0x18')](0xcc)[_0x1843('0x25')]();});}};}function handleEntityNotFound(_0x28a78d,_0x9a25e7){return function(_0x1b9d5b){if(!_0x1b9d5b){_0x28a78d[_0x1843('0x26')](0x194);}return _0x1b9d5b;};}function handleError(_0x6d6f98,_0x34f110){_0x34f110=_0x34f110||0x1f4;return function(_0x45792c){logger[_0x1843('0x27')](_0x45792c['stack']);if(_0x45792c[_0x1843('0x28')]){delete _0x45792c[_0x1843('0x28')];}_0x6d6f98[_0x1843('0x18')](_0x34f110)[_0x1843('0x29')](_0x45792c);};}exports[_0x1843('0x2a')]=function(_0x3659df,_0x1470df){var _0x1a3219={},_0x5c09c0={},_0x5aa383={'count':0x0,'rows':[]};var _0x42b96a=_[_0x1843('0x2b')](db[_0x1843('0x2c')]['rawAttributes'],function(_0x34d748){return{'name':_0x34d748[_0x1843('0x2d')],'type':_0x34d748['type'][_0x1843('0x2e')]};});_0x5c09c0[_0x1843('0x2f')]=_['map'](_0x42b96a,'name');_0x5c09c0['query']=_['keys'](_0x3659df[_0x1843('0x30')]);_0x5c09c0[_0x1843('0x31')]=_['intersection'](_0x5c09c0[_0x1843('0x2f')],_0x5c09c0[_0x1843('0x30')]);_0x1a3219[_0x1843('0x32')]=_[_0x1843('0x33')](_0x5c09c0[_0x1843('0x2f')],qs[_0x1843('0x34')](_0x3659df[_0x1843('0x30')]['fields']));_0x1a3219[_0x1843('0x32')]=_0x1a3219[_0x1843('0x32')][_0x1843('0x35')]?_0x1a3219[_0x1843('0x32')]:_0x5c09c0[_0x1843('0x2f')];if(!_0x3659df[_0x1843('0x30')][_0x1843('0x36')](_0x1843('0x37'))){_0x1a3219[_0x1843('0x1c')]=qs['limit'](_0x3659df['query']['limit']);_0x1a3219[_0x1843('0x19')]=qs[_0x1843('0x19')](_0x3659df[_0x1843('0x30')][_0x1843('0x19')]);}_0x1a3219['order']=qs[_0x1843('0x38')](_0x3659df[_0x1843('0x30')][_0x1843('0x38')]);_0x1a3219['where']=qs[_0x1843('0x31')](_['pick'](_0x3659df['query'],_0x5c09c0[_0x1843('0x31')]),_0x42b96a);if(_0x3659df[_0x1843('0x30')][_0x1843('0x39')]){_0x1a3219[_0x1843('0x3a')]=_[_0x1843('0x3b')](_0x1a3219[_0x1843('0x3a')],{'$or':_[_0x1843('0x2b')](_0x42b96a,function(_0x22a260){if(_0x22a260[_0x1843('0x3c')]!=='VIRTUAL'){var _0x2fb541={};_0x2fb541[_0x22a260[_0x1843('0x28')]]={'$like':'%'+_0x3659df[_0x1843('0x30')][_0x1843('0x39')]+'%'};return _0x2fb541;}})});}_0x1a3219=_[_0x1843('0x3b')]({},_0x1a3219,_0x3659df[_0x1843('0x3d')]);var _0x51e765={'where':_0x1a3219[_0x1843('0x3a')]};return db[_0x1843('0x2c')]['count'](_0x51e765)[_0x1843('0x24')](function(_0x56bbce){_0x5aa383[_0x1843('0x1b')]=_0x56bbce;if(_0x3659df[_0x1843('0x30')][_0x1843('0x3e')]){_0x1a3219[_0x1843('0x3f')]=[{'all':!![]}];}return db[_0x1843('0x2c')][_0x1843('0x40')](_0x1a3219);})[_0x1843('0x24')](function(_0xb0db5e){_0x5aa383[_0x1843('0x41')]=_0xb0db5e;return _0x5aa383;})[_0x1843('0x24')](respondWithFilteredResult(_0x1470df,_0x1a3219))[_0x1843('0x42')](handleError(_0x1470df,null));};exports[_0x1843('0x43')]=function(_0x5cdb06,_0x45509f){var _0x5e43c0={'raw':!![],'where':{'id':_0x5cdb06[_0x1843('0x44')]['id']}},_0x534991={};_0x534991[_0x1843('0x2f')]=_['keys'](db[_0x1843('0x2c')]['rawAttributes']);_0x534991[_0x1843('0x30')]=_['keys'](_0x5cdb06[_0x1843('0x30')]);_0x534991['filters']=_[_0x1843('0x33')](_0x534991[_0x1843('0x2f')],_0x534991[_0x1843('0x30')]);_0x5e43c0[_0x1843('0x32')]=_[_0x1843('0x33')](_0x534991[_0x1843('0x2f')],qs[_0x1843('0x34')](_0x5cdb06[_0x1843('0x30')][_0x1843('0x34')]));_0x5e43c0[_0x1843('0x32')]=_0x5e43c0['attributes'][_0x1843('0x35')]?_0x5e43c0[_0x1843('0x32')]:_0x534991[_0x1843('0x2f')];if(_0x5cdb06[_0x1843('0x30')]['includeAll']){_0x5e43c0[_0x1843('0x3f')]=[{'all':!![]}];}_0x5e43c0=_[_0x1843('0x3b')]({},_0x5e43c0,_0x5cdb06[_0x1843('0x3d')]);return db[_0x1843('0x2c')]['find'](_0x5e43c0)['then'](handleEntityNotFound(_0x45509f,null))[_0x1843('0x24')](respondWithResult(_0x45509f,null))['catch'](handleError(_0x45509f,null));};exports[_0x1843('0x45')]=function(_0x13ce90,_0x1bf9fc){return db[_0x1843('0x2c')][_0x1843('0x45')](_0x13ce90[_0x1843('0x46')],{})['then'](respondWithResult(_0x1bf9fc,0xc9))[_0x1843('0x42')](handleError(_0x1bf9fc,null));};exports[_0x1843('0x22')]=function(_0xb49532,_0x2e50f8){if(_0xb49532[_0x1843('0x46')]['id']){delete _0xb49532['body']['id'];}return db[_0x1843('0x2c')][_0x1843('0x47')]({'where':{'id':_0xb49532['params']['id']}})['then'](handleEntityNotFound(_0x2e50f8,null))[_0x1843('0x24')](saveUpdates(_0xb49532['body'],null))[_0x1843('0x24')](respondWithResult(_0x2e50f8,null))[_0x1843('0x42')](handleError(_0x2e50f8,null));};exports[_0x1843('0x23')]=function(_0x197c24,_0x2b1d42){return db[_0x1843('0x2c')]['find']({'where':{'id':_0x197c24[_0x1843('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b1d42,null))[_0x1843('0x24')](removeEntity(_0x2b1d42,null))[_0x1843('0x42')](handleError(_0x2b1d42,null));};exports[_0x1843('0x48')]=function(_0x2a9846,_0x2a19b1){return db['MailSubstatus']['describe']()[_0x1843('0x24')](respondWithResult(_0x2a19b1,null))[_0x1843('0x42')](handleError(_0x2a19b1,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2a21613..65c3c52 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f6f=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x570dfe,_0x26812d){var _0x1d85f5=function(_0x4b04fc){while(--_0x4b04fc){_0x570dfe['push'](_0x570dfe['shift']());}};_0x1d85f5(++_0x26812d);}(_0x0f6f,0xee));var _0xf0f6=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x0f6f[_0x2a7210];return _0x460766;};'use strict';var EventEmitter=require(_0xf0f6('0x0'));var MailSubstatus=require(_0xf0f6('0x1'))['db'][_0xf0f6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf0f6('0x3')](0x0);var events={'afterUpdate':_0xf0f6('0x4')};function emitEvent(_0x513a45){return function(_0x5a4094,_0x436608,_0xae5241){MailSubstatusEvents[_0xf0f6('0x5')](_0x513a45+':'+_0x5a4094['id'],_0x5a4094);MailSubstatusEvents[_0xf0f6('0x5')](_0x513a45,_0x5a4094);_0xae5241(null);};}for(var e in events){if(events[_0xf0f6('0x6')](e)){var event=events[e];MailSubstatus[_0xf0f6('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x933d=['../../mysqldb','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x33ec02,_0x4f5f3c){var _0x4ec6ed=function(_0x1e6b23){while(--_0x1e6b23){_0x33ec02['push'](_0x33ec02['shift']());}};_0x4ec6ed(++_0x4f5f3c);}(_0x933d,0xf5));var _0xd933=function(_0x5d06bc,_0x2497b4){_0x5d06bc=_0x5d06bc-0x0;var _0x4f755f=_0x933d[_0x5d06bc];return _0x4f755f;};'use strict';var EventEmitter=require(_0xd933('0x0'));var MailSubstatus=require(_0xd933('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd933('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x30a87f){return function(_0x429beb,_0x26ff1d,_0x3ec593){MailSubstatusEvents[_0xd933('0x3')](_0x30a87f+':'+_0x429beb['id'],_0x429beb);MailSubstatusEvents['emit'](_0x30a87f,_0x429beb);_0x3ec593(null);};}for(var e in events){if(events[_0xd933('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xd933('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2e4b75c..b290fa5 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3525=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','_previousDataValues','name'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x3525,0x16a));var _0x5352=function(_0x8db5a4,_0x30c14f){_0x8db5a4=_0x8db5a4-0x0;var _0x717a1=_0x3525[_0x8db5a4];return _0x717a1;};'use strict';var attributes=require(_0x5352('0x0'));module[_0x5352('0x1')]=function(_0xb9318d){var _0x31fb46=_0xb9318d[_0x5352('0x2')];return _0xb9318d[_0x5352('0x3')](_0x5352('0x4'),attributes,{'tableName':_0x5352('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x39492b,_0x537148,_0x3ef38d){return _0x31fb46[_0x5352('0x6')][_0x5352('0x7')]({'value':_0x39492b['name']},{'where':{'field':'mailSubstatus','value':_0x39492b[_0x5352('0x8')][_0x5352('0x9')]}})[_0x5352('0xa')](function(){_0x3ef38d();})[_0x5352('0xb')](function(_0x36c74a){_0x3ef38d(_0x36c74a);});}}});}; \ No newline at end of file +var _0xc275=['_previousDataValues','then','catch','exports','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x1e8a61,_0x364cf6){var _0x19fe45=function(_0x47ceaa){while(--_0x47ceaa){_0x1e8a61['push'](_0x1e8a61['shift']());}};_0x19fe45(++_0x364cf6);}(_0xc275,0x1c5));var _0x5c27=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc275[_0x4e676e];return _0x336a3c;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x5c27('0x0')]=function(_0x591193){var _0x53aba7=_0x591193['models'];return _0x591193['define']('MailSubstatus',attributes,{'tableName':_0x5c27('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x378c50,_0x313d5d,_0x353b86){return _0x53aba7[_0x5c27('0x2')][_0x5c27('0x3')]({'value':_0x378c50[_0x5c27('0x4')]},{'where':{'field':_0x5c27('0x5'),'value':_0x378c50[_0x5c27('0x6')]['name']}})[_0x5c27('0x7')](function(){_0x353b86();})[_0x5c27('0x8')](function(_0x3452a2){_0x353b86(_0x3452a2);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9028084..76df254 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeebc=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x51769e,_0x1152eb){var _0xdf3fe0=function(_0x2e700d){while(--_0x2e700d){_0x51769e['push'](_0x51769e['shift']());}};_0xdf3fe0(++_0x1152eb);}(_0xeebc,0x6f));var _0xceeb=function(_0x193f28,_0x2574ce){_0x193f28=_0x193f28-0x0;var _0x350257=_0xeebc[_0x193f28];return _0x350257;};'use strict';var _=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var moment=require(_0xceeb('0x2'));var BPromise=require(_0xceeb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xceeb('0x4'));var db=require(_0xceeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xceeb('0x6'))(_0xceeb('0x7'));var config=require('../../config/environment');var jayson=require(_0xceeb('0x8'));var client=jayson[_0xceeb('0x9')][_0xceeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1c88,_0x49ac08,_0x23bfac){return new BPromise(function(_0x5a4908,_0x364eb5){return client['request'](_0x5c1c88,_0x23bfac)[_0xceeb('0xb')](function(_0x2c329c){logger[_0xceeb('0xc')](_0xceeb('0xd'),_0x49ac08,_0xceeb('0xe'));logger['debug'](_0xceeb('0xf'),_0x49ac08,_0xceeb('0xe'),JSON[_0xceeb('0x10')](_0x2c329c));if(_0x2c329c[_0xceeb('0x11')]){if(_0x2c329c[_0xceeb('0x11')][_0xceeb('0x12')]===0x1f4){logger[_0xceeb('0x11')](_0xceeb('0xd'),_0x49ac08,_0x2c329c['error']['message']);return _0x364eb5(_0x2c329c[_0xceeb('0x11')]['message']);}logger['error'](_0xceeb('0xd'),_0x49ac08,_0x2c329c[_0xceeb('0x11')][_0xceeb('0x13')]);return _0x5a4908(_0x2c329c[_0xceeb('0x11')][_0xceeb('0x13')]);}else{logger['info'](_0xceeb('0xd'),_0x49ac08,_0xceeb('0xe'));_0x5a4908(_0x2c329c[_0xceeb('0x14')][_0xceeb('0x13')]);}})[_0xceeb('0x15')](function(_0x1d6ce3){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x49ac08,_0x1d6ce3);_0x364eb5(_0x1d6ce3);});});} \ No newline at end of file +var _0x9efe=['code','MailSubstatus,\x20%s,\x20%s','message','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3493b1,_0x4074dc){var _0x188716=function(_0x9b61da){while(--_0x9b61da){_0x3493b1['push'](_0x3493b1['shift']());}};_0x188716(++_0x4074dc);}(_0x9efe,0xca));var _0xe9ef=function(_0xcb56d2,_0x18c194){_0xcb56d2=_0xcb56d2-0x0;var _0x57bed4=_0x9efe[_0xcb56d2];return _0x57bed4;};'use strict';var _=require('lodash');var util=require(_0xe9ef('0x0'));var moment=require(_0xe9ef('0x1'));var BPromise=require(_0xe9ef('0x2'));var rs=require(_0xe9ef('0x3'));var fs=require('fs');var Redis=require(_0xe9ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9ef('0x5'));var logger=require(_0xe9ef('0x6'))(_0xe9ef('0x7'));var config=require(_0xe9ef('0x8'));var jayson=require(_0xe9ef('0x9'));var client=jayson[_0xe9ef('0xa')][_0xe9ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58d664,_0x47df46,_0x590cea){return new BPromise(function(_0x40ffdc,_0x2f7280){return client[_0xe9ef('0xc')](_0x58d664,_0x590cea)['then'](function(_0x51b634){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x47df46,_0xe9ef('0xd'));logger[_0xe9ef('0xe')](_0xe9ef('0xf'),_0x47df46,'request\x20sent',JSON[_0xe9ef('0x10')](_0x51b634));if(_0x51b634[_0xe9ef('0x11')]){if(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x12')]===0x1f4){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x2f7280(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x40ffdc(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}else{logger[_0xe9ef('0x15')](_0xe9ef('0x13'),_0x47df46,'request\x20sent');_0x40ffdc(_0x51b634['result'][_0xe9ef('0x14')]);}})['catch'](function(_0x8ed5e3){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x8ed5e3);_0x2f7280(_0x8ed5e3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e0f64f9..ffe5a29 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60e2=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd730a7,_0x486686){var _0x217ded=function(_0x4e4a4c){while(--_0x4e4a4c){_0xd730a7['push'](_0xd730a7['shift']());}};_0x217ded(++_0x486686);}(_0x60e2,0x13d));var _0x260e=function(_0x191434,_0x10f048){_0x191434=_0x191434-0x0;var _0x6a94ef=_0x60e2[_0x191434];return _0x6a94ef;};'use strict';var multer=require(_0x260e('0x0'));var util=require(_0x260e('0x1'));var path=require('path');var timeout=require(_0x260e('0x2'));var express=require(_0x260e('0x3'));var router=express['Router']();var fs_extra=require(_0x260e('0x4'));var auth=require(_0x260e('0x5'));var interaction=require(_0x260e('0x6'));var config=require(_0x260e('0x7'));var controller=require(_0x260e('0x8'));router[_0x260e('0x9')]('/',auth[_0x260e('0xa')](),controller['index']);router['get'](_0x260e('0xb'),auth[_0x260e('0xa')](),controller['describe']);router[_0x260e('0x9')](_0x260e('0xc'),auth[_0x260e('0xa')](),controller[_0x260e('0xd')]);router['post']('/',auth[_0x260e('0xa')](),controller[_0x260e('0xe')]);router['put'](_0x260e('0xc'),auth[_0x260e('0xa')](),controller[_0x260e('0xf')]);router[_0x260e('0x10')]('/:id',auth[_0x260e('0xa')](),controller['destroy']);module[_0x260e('0x11')]=router; \ No newline at end of file +var _0x0c5d=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create'];(function(_0x5ac71d,_0x42d484){var _0x372b8a=function(_0x3f9e80){while(--_0x3f9e80){_0x5ac71d['push'](_0x5ac71d['shift']());}};_0x372b8a(++_0x42d484);}(_0x0c5d,0xb6));var _0xd0c5=function(_0x21c790,_0xec3e8b){_0x21c790=_0x21c790-0x0;var _0x385752=_0x0c5d[_0x21c790];return _0x385752;};'use strict';var multer=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require(_0xd0c5('0x2'));var timeout=require(_0xd0c5('0x3'));var express=require(_0xd0c5('0x4'));var router=express[_0xd0c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0c5('0x6'));var interaction=require(_0xd0c5('0x7'));var config=require('../../config/environment');var controller=require(_0xd0c5('0x8'));router[_0xd0c5('0x9')]('/',auth[_0xd0c5('0xa')](),controller[_0xd0c5('0xb')]);router[_0xd0c5('0x9')](_0xd0c5('0xc'),auth[_0xd0c5('0xa')](),controller['describe']);router[_0xd0c5('0x9')]('/:id',auth[_0xd0c5('0xa')](),controller[_0xd0c5('0xd')]);router[_0xd0c5('0xe')]('/',auth[_0xd0c5('0xa')](),controller[_0xd0c5('0xf')]);router[_0xd0c5('0x10')](_0xd0c5('0x11'),auth[_0xd0c5('0xa')](),controller[_0xd0c5('0x12')]);router[_0xd0c5('0x13')](_0xd0c5('0x11'),auth['isAuthenticated'](),controller[_0xd0c5('0x14')]);module[_0xd0c5('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 05a2f22..0a97f71 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x43a1ea,_0x259d76){_0x43a1ea=_0x43a1ea-0x0;var _0x511755=_0xb43b[_0x43a1ea];return _0x511755;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x38c9f2,_0x5935d1){var _0x5957fc=function(_0x266100){while(--_0x266100){_0x38c9f2['push'](_0x38c9f2['shift']());}};_0x5957fc(++_0x5935d1);}(_0x008c,0x188));var _0xc008=function(_0x3a5b74,_0x4960ee){_0x3a5b74=_0x3a5b74-0x0;var _0x366746=_0x008c[_0x3a5b74];return _0x366746;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index edb2e56..1a6c1af 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf01=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x583c4f,_0x491082){var _0x30d763=function(_0x3bdfaa){while(--_0x3bdfaa){_0x583c4f['push'](_0x583c4f['shift']());}};_0x30d763(++_0x491082);}(_0xcf01,0xde));var _0x1cf0=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0xcf01[_0x1dad4f];return _0x22468b;};'use strict';var emlformat=require(_0x1cf0('0x0'));var rimraf=require(_0x1cf0('0x1'));var zipdir=require(_0x1cf0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1cf0('0x3'));var moment=require(_0x1cf0('0x4'));var BPromise=require(_0x1cf0('0x5'));var Mustache=require(_0x1cf0('0x6'));var util=require('util');var path=require(_0x1cf0('0x7'));var sox=require(_0x1cf0('0x8'));var csv=require(_0x1cf0('0x9'));var ejs=require(_0x1cf0('0xa'));var fs=require('fs');var fs_extra=require(_0x1cf0('0xb'));var _=require(_0x1cf0('0xc'));var squel=require(_0x1cf0('0xd'));var crypto=require(_0x1cf0('0xe'));var jsforce=require(_0x1cf0('0xf'));var deskjs=require(_0x1cf0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1cf0('0x11'));var Papa=require(_0x1cf0('0x12'));var Redis=require(_0x1cf0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1cf0('0x14'));var as=require(_0x1cf0('0x15'));var hardwareService=require(_0x1cf0('0x16'));var logger=require(_0x1cf0('0x17'))(_0x1cf0('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1cf0('0x19'))['db'];function respondWithStatusCode(_0x1163c1,_0x14d1b7){_0x14d1b7=_0x14d1b7||0xcc;return function(_0x54710b){if(_0x54710b){return _0x1163c1[_0x1cf0('0x1a')](_0x14d1b7);}return _0x1163c1['status'](_0x14d1b7)['end']();};}function respondWithResult(_0x2815a1,_0xf221c8){_0xf221c8=_0xf221c8||0xc8;return function(_0x5a2339){if(_0x5a2339){return _0x2815a1[_0x1cf0('0x1b')](_0xf221c8)[_0x1cf0('0x1c')](_0x5a2339);}};}function respondWithFilteredResult(_0x5af22b,_0x55719e){return function(_0x407525){if(_0x407525){var _0x48e9fd=typeof _0x55719e[_0x1cf0('0x1d')]===_0x1cf0('0x1e')&&typeof _0x55719e[_0x1cf0('0x1f')]===_0x1cf0('0x1e');var _0x407973=_0x407525[_0x1cf0('0x20')];var _0x44ca60=_0x48e9fd?0x0:_0x55719e['offset'];var _0x29e6b5=_0x48e9fd?_0x407525[_0x1cf0('0x20')]:_0x55719e[_0x1cf0('0x1d')]+_0x55719e[_0x1cf0('0x1f')];var _0xd5a83e;if(_0x29e6b5>=_0x407973){_0x29e6b5=_0x407973;_0xd5a83e=0xc8;}else{_0xd5a83e=0xce;}_0x5af22b[_0x1cf0('0x1b')](_0xd5a83e);return _0x5af22b[_0x1cf0('0x21')](_0x1cf0('0x22'),_0x44ca60+'-'+_0x29e6b5+'/'+_0x407973)[_0x1cf0('0x1c')](_0x407525);}return null;};}function patchUpdates(_0x501bbb){return function(_0x45610a){try{jsonpatch[_0x1cf0('0x23')](_0x45610a,_0x501bbb,!![]);}catch(_0x5c6a2a){return BPromise[_0x1cf0('0x24')](_0x5c6a2a);}return _0x45610a[_0x1cf0('0x25')]();};}function saveUpdates(_0x3960f6,_0x2aade7){return function(_0x263225){if(_0x263225){return _0x263225[_0x1cf0('0x26')](_0x3960f6)['then'](function(_0x2f472f){return _0x2f472f;});}return null;};}function removeEntity(_0x17249a,_0x46e92f){return function(_0x1708c5){if(_0x1708c5){return _0x1708c5[_0x1cf0('0x27')]()['then'](function(){_0x17249a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc50,_0x305843){return function(_0x136cde){if(!_0x136cde){_0x3cc50[_0x1cf0('0x1a')](0x194);}return _0x136cde;};}function handleError(_0x322ace,_0x42e9bf){_0x42e9bf=_0x42e9bf||0x1f4;return function(_0x2081e3){logger[_0x1cf0('0x28')](_0x2081e3[_0x1cf0('0x29')]);if(_0x2081e3['name']){delete _0x2081e3[_0x1cf0('0x2a')];}_0x322ace[_0x1cf0('0x1b')](_0x42e9bf)[_0x1cf0('0x2b')](_0x2081e3);};}exports['index']=function(_0x142fe9,_0x11fbc9){var _0x1f0f63={},_0x481c3f={},_0x261325={'count':0x0,'rows':[]};var _0x400539=_[_0x1cf0('0x2c')](db[_0x1cf0('0x2d')][_0x1cf0('0x2e')],function(_0x578337){return{'name':_0x578337[_0x1cf0('0x2f')],'type':_0x578337[_0x1cf0('0x30')][_0x1cf0('0x31')]};});_0x481c3f[_0x1cf0('0x32')]=_[_0x1cf0('0x2c')](_0x400539,_0x1cf0('0x2a'));_0x481c3f[_0x1cf0('0x33')]=_['keys'](_0x142fe9[_0x1cf0('0x33')]);_0x481c3f[_0x1cf0('0x34')]=_['intersection'](_0x481c3f[_0x1cf0('0x32')],_0x481c3f[_0x1cf0('0x33')]);_0x1f0f63[_0x1cf0('0x35')]=_['intersection'](_0x481c3f['model'],qs[_0x1cf0('0x36')](_0x142fe9['query'][_0x1cf0('0x36')]));_0x1f0f63[_0x1cf0('0x35')]=_0x1f0f63[_0x1cf0('0x35')][_0x1cf0('0x37')]?_0x1f0f63[_0x1cf0('0x35')]:_0x481c3f[_0x1cf0('0x32')];if(!_0x142fe9[_0x1cf0('0x33')][_0x1cf0('0x38')](_0x1cf0('0x39'))){_0x1f0f63['limit']=qs[_0x1cf0('0x1f')](_0x142fe9[_0x1cf0('0x33')][_0x1cf0('0x1f')]);_0x1f0f63[_0x1cf0('0x1d')]=qs[_0x1cf0('0x1d')](_0x142fe9[_0x1cf0('0x33')]['offset']);}_0x1f0f63['order']=qs[_0x1cf0('0x3a')](_0x142fe9[_0x1cf0('0x33')][_0x1cf0('0x3a')]);_0x1f0f63[_0x1cf0('0x3b')]=qs[_0x1cf0('0x34')](_[_0x1cf0('0x3c')](_0x142fe9['query'],_0x481c3f[_0x1cf0('0x34')]),_0x400539);if(_0x142fe9[_0x1cf0('0x33')][_0x1cf0('0x3d')]){_0x1f0f63[_0x1cf0('0x3b')]=_[_0x1cf0('0x3e')](_0x1f0f63[_0x1cf0('0x3b')],{'$or':_[_0x1cf0('0x2c')](_0x400539,function(_0x188ddb){if(_0x188ddb[_0x1cf0('0x30')]!=='VIRTUAL'){var _0x3a38d0={};_0x3a38d0[_0x188ddb[_0x1cf0('0x2a')]]={'$like':'%'+_0x142fe9['query'][_0x1cf0('0x3d')]+'%'};return _0x3a38d0;}})});}_0x1f0f63=_[_0x1cf0('0x3e')]({},_0x1f0f63,_0x142fe9[_0x1cf0('0x3f')]);var _0xfebd3b={'where':_0x1f0f63['where']};return db['MailTransferReport'][_0x1cf0('0x20')](_0xfebd3b)[_0x1cf0('0x40')](function(_0x1f5248){_0x261325[_0x1cf0('0x20')]=_0x1f5248;if(_0x142fe9[_0x1cf0('0x33')][_0x1cf0('0x41')]){_0x1f0f63[_0x1cf0('0x42')]=[{'all':!![]}];}return db['MailTransferReport'][_0x1cf0('0x43')](_0x1f0f63);})[_0x1cf0('0x40')](function(_0x11c130){_0x261325[_0x1cf0('0x44')]=_0x11c130;return _0x261325;})[_0x1cf0('0x40')](respondWithFilteredResult(_0x11fbc9,_0x1f0f63))[_0x1cf0('0x45')](handleError(_0x11fbc9,null));};exports['show']=function(_0x3f8a42,_0x5489e6){var _0xa746c4={'raw':!![],'where':{'id':_0x3f8a42['params']['id']}},_0x52d6d0={};_0x52d6d0[_0x1cf0('0x32')]=_[_0x1cf0('0x46')](db['MailTransferReport'][_0x1cf0('0x2e')]);_0x52d6d0[_0x1cf0('0x33')]=_[_0x1cf0('0x46')](_0x3f8a42['query']);_0x52d6d0[_0x1cf0('0x34')]=_['intersection'](_0x52d6d0[_0x1cf0('0x32')],_0x52d6d0['query']);_0xa746c4[_0x1cf0('0x35')]=_['intersection'](_0x52d6d0[_0x1cf0('0x32')],qs['fields'](_0x3f8a42[_0x1cf0('0x33')][_0x1cf0('0x36')]));_0xa746c4[_0x1cf0('0x35')]=_0xa746c4[_0x1cf0('0x35')]['length']?_0xa746c4[_0x1cf0('0x35')]:_0x52d6d0[_0x1cf0('0x32')];if(_0x3f8a42['query']['includeAll']){_0xa746c4['include']=[{'all':!![]}];}_0xa746c4=_[_0x1cf0('0x3e')]({},_0xa746c4,_0x3f8a42[_0x1cf0('0x3f')]);return db['MailTransferReport'][_0x1cf0('0x47')](_0xa746c4)['then'](handleEntityNotFound(_0x5489e6,null))[_0x1cf0('0x40')](respondWithResult(_0x5489e6,null))[_0x1cf0('0x45')](handleError(_0x5489e6,null));};exports[_0x1cf0('0x48')]=function(_0x433db2,_0x2af51c){return db['MailTransferReport']['create'](_0x433db2['body'],{})[_0x1cf0('0x40')](respondWithResult(_0x2af51c,0xc9))[_0x1cf0('0x45')](handleError(_0x2af51c,null));};exports[_0x1cf0('0x26')]=function(_0x256956,_0x4aeac1){if(_0x256956[_0x1cf0('0x49')]['id']){delete _0x256956['body']['id'];}return db[_0x1cf0('0x2d')][_0x1cf0('0x47')]({'where':{'id':_0x256956[_0x1cf0('0x4a')]['id']}})[_0x1cf0('0x40')](handleEntityNotFound(_0x4aeac1,null))[_0x1cf0('0x40')](saveUpdates(_0x256956[_0x1cf0('0x49')],null))[_0x1cf0('0x40')](respondWithResult(_0x4aeac1,null))[_0x1cf0('0x45')](handleError(_0x4aeac1,null));};exports['destroy']=function(_0x21eff6,_0x24ff09){return db[_0x1cf0('0x2d')][_0x1cf0('0x47')]({'where':{'id':_0x21eff6[_0x1cf0('0x4a')]['id']}})[_0x1cf0('0x40')](handleEntityNotFound(_0x24ff09,null))['then'](removeEntity(_0x24ff09,null))['catch'](handleError(_0x24ff09,null));};exports[_0x1cf0('0x4b')]=function(_0x27225d,_0x34b417){return db[_0x1cf0('0x2d')][_0x1cf0('0x4b')]()[_0x1cf0('0x40')](respondWithResult(_0x34b417,null))['catch'](handleError(_0x34b417,null));}; \ No newline at end of file +var _0xce23=['error','name','send','index','MailTransferReport','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xce23,0x157));var _0x3ce2=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xce23[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0x3ce2('0x0'));var rimraf=require(_0x3ce2('0x1'));var zipdir=require(_0x3ce2('0x2'));var jsonpatch=require(_0x3ce2('0x3'));var rp=require(_0x3ce2('0x4'));var moment=require(_0x3ce2('0x5'));var BPromise=require(_0x3ce2('0x6'));var Mustache=require(_0x3ce2('0x7'));var util=require(_0x3ce2('0x8'));var path=require(_0x3ce2('0x9'));var sox=require(_0x3ce2('0xa'));var csv=require('to-csv');var ejs=require(_0x3ce2('0xb'));var fs=require('fs');var fs_extra=require(_0x3ce2('0xc'));var _=require(_0x3ce2('0xd'));var squel=require(_0x3ce2('0xe'));var crypto=require(_0x3ce2('0xf'));var jsforce=require(_0x3ce2('0x10'));var deskjs=require(_0x3ce2('0x11'));var toCsv=require(_0x3ce2('0x12'));var querystring=require(_0x3ce2('0x13'));var Papa=require(_0x3ce2('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ce2('0x15'));var hardwareService=require(_0x3ce2('0x16'));var logger=require(_0x3ce2('0x17'))(_0x3ce2('0x18'));var utils=require(_0x3ce2('0x19'));var config=require(_0x3ce2('0x1a'));var licenseUtil=require(_0x3ce2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x412e69,_0x365c1d){_0x365c1d=_0x365c1d||0xcc;return function(_0x26269d){if(_0x26269d){return _0x412e69[_0x3ce2('0x1c')](_0x365c1d);}return _0x412e69['status'](_0x365c1d)[_0x3ce2('0x1d')]();};}function respondWithResult(_0x578f58,_0x50e0e0){_0x50e0e0=_0x50e0e0||0xc8;return function(_0x35c9ed){if(_0x35c9ed){return _0x578f58[_0x3ce2('0x1e')](_0x50e0e0)[_0x3ce2('0x1f')](_0x35c9ed);}};}function respondWithFilteredResult(_0x4210cb,_0x5417a1){return function(_0x5983d5){if(_0x5983d5){var _0x36c139=typeof _0x5417a1[_0x3ce2('0x20')]===_0x3ce2('0x21')&&typeof _0x5417a1[_0x3ce2('0x22')]===_0x3ce2('0x21');var _0x3bce86=_0x5983d5['count'];var _0x3e8e2d=_0x36c139?0x0:_0x5417a1['offset'];var _0x3c44c4=_0x36c139?_0x5983d5[_0x3ce2('0x23')]:_0x5417a1['offset']+_0x5417a1[_0x3ce2('0x22')];var _0x5633b2;if(_0x3c44c4>=_0x3bce86){_0x3c44c4=_0x3bce86;_0x5633b2=0xc8;}else{_0x5633b2=0xce;}_0x4210cb[_0x3ce2('0x1e')](_0x5633b2);return _0x4210cb['set'](_0x3ce2('0x24'),_0x3e8e2d+'-'+_0x3c44c4+'/'+_0x3bce86)[_0x3ce2('0x1f')](_0x5983d5);}return null;};}function patchUpdates(_0x43d1c9){return function(_0x27a8ac){try{jsonpatch[_0x3ce2('0x25')](_0x27a8ac,_0x43d1c9,!![]);}catch(_0x456f31){return BPromise[_0x3ce2('0x26')](_0x456f31);}return _0x27a8ac['save']();};}function saveUpdates(_0x1c1eac,_0x5cf7d7){return function(_0x2bb7ed){if(_0x2bb7ed){return _0x2bb7ed[_0x3ce2('0x27')](_0x1c1eac)[_0x3ce2('0x28')](function(_0x451e18){return _0x451e18;});}return null;};}function removeEntity(_0x58ebaa,_0x31a692){return function(_0x313da5){if(_0x313da5){return _0x313da5[_0x3ce2('0x29')]()[_0x3ce2('0x28')](function(){_0x58ebaa['status'](0xcc)[_0x3ce2('0x1d')]();});}};}function handleEntityNotFound(_0x5e2dfc,_0x2a199b){return function(_0x48bdb3){if(!_0x48bdb3){_0x5e2dfc[_0x3ce2('0x1c')](0x194);}return _0x48bdb3;};}function handleError(_0x9a6e1b,_0x5c8f8a){_0x5c8f8a=_0x5c8f8a||0x1f4;return function(_0x1ba095){logger[_0x3ce2('0x2a')](_0x1ba095['stack']);if(_0x1ba095[_0x3ce2('0x2b')]){delete _0x1ba095[_0x3ce2('0x2b')];}_0x9a6e1b[_0x3ce2('0x1e')](_0x5c8f8a)[_0x3ce2('0x2c')](_0x1ba095);};}exports[_0x3ce2('0x2d')]=function(_0x3da07d,_0x447c2e){var _0x17bb92={},_0x4e439a={},_0x5a3434={'count':0x0,'rows':[]};var _0x4e9187=_['map'](db[_0x3ce2('0x2e')]['rawAttributes'],function(_0x5a0c3f){return{'name':_0x5a0c3f['fieldName'],'type':_0x5a0c3f[_0x3ce2('0x2f')][_0x3ce2('0x30')]};});_0x4e439a[_0x3ce2('0x31')]=_['map'](_0x4e9187,_0x3ce2('0x2b'));_0x4e439a['query']=_['keys'](_0x3da07d[_0x3ce2('0x32')]);_0x4e439a[_0x3ce2('0x33')]=_[_0x3ce2('0x34')](_0x4e439a[_0x3ce2('0x31')],_0x4e439a[_0x3ce2('0x32')]);_0x17bb92['attributes']=_[_0x3ce2('0x34')](_0x4e439a[_0x3ce2('0x31')],qs[_0x3ce2('0x35')](_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x35')]));_0x17bb92[_0x3ce2('0x36')]=_0x17bb92[_0x3ce2('0x36')][_0x3ce2('0x37')]?_0x17bb92['attributes']:_0x4e439a['model'];if(!_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x38')](_0x3ce2('0x39'))){_0x17bb92['limit']=qs[_0x3ce2('0x22')](_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x22')]);_0x17bb92[_0x3ce2('0x20')]=qs['offset'](_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x20')]);}_0x17bb92[_0x3ce2('0x3a')]=qs[_0x3ce2('0x3b')](_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x3b')]);_0x17bb92[_0x3ce2('0x3c')]=qs[_0x3ce2('0x33')](_[_0x3ce2('0x3d')](_0x3da07d[_0x3ce2('0x32')],_0x4e439a['filters']),_0x4e9187);if(_0x3da07d[_0x3ce2('0x32')]['filter']){_0x17bb92[_0x3ce2('0x3c')]=_[_0x3ce2('0x3e')](_0x17bb92['where'],{'$or':_[_0x3ce2('0x3f')](_0x4e9187,function(_0x2723ba){if(_0x2723ba[_0x3ce2('0x2f')]!==_0x3ce2('0x40')){var _0x1eb1c9={};_0x1eb1c9[_0x2723ba[_0x3ce2('0x2b')]]={'$like':'%'+_0x3da07d[_0x3ce2('0x32')]['filter']+'%'};return _0x1eb1c9;}})});}_0x17bb92=_['merge']({},_0x17bb92,_0x3da07d[_0x3ce2('0x41')]);var _0xb2f003={'where':_0x17bb92[_0x3ce2('0x3c')]};return db[_0x3ce2('0x2e')]['count'](_0xb2f003)[_0x3ce2('0x28')](function(_0x47e5ba){_0x5a3434[_0x3ce2('0x23')]=_0x47e5ba;if(_0x3da07d[_0x3ce2('0x32')][_0x3ce2('0x42')]){_0x17bb92[_0x3ce2('0x43')]=[{'all':!![]}];}return db[_0x3ce2('0x2e')][_0x3ce2('0x44')](_0x17bb92);})[_0x3ce2('0x28')](function(_0x107d45){_0x5a3434[_0x3ce2('0x45')]=_0x107d45;return _0x5a3434;})[_0x3ce2('0x28')](respondWithFilteredResult(_0x447c2e,_0x17bb92))['catch'](handleError(_0x447c2e,null));};exports[_0x3ce2('0x46')]=function(_0x11bdb3,_0x5b1319){var _0x14fa52={'raw':!![],'where':{'id':_0x11bdb3['params']['id']}},_0x3eb94a={};_0x3eb94a[_0x3ce2('0x31')]=_[_0x3ce2('0x47')](db[_0x3ce2('0x2e')]['rawAttributes']);_0x3eb94a[_0x3ce2('0x32')]=_['keys'](_0x11bdb3[_0x3ce2('0x32')]);_0x3eb94a[_0x3ce2('0x33')]=_[_0x3ce2('0x34')](_0x3eb94a[_0x3ce2('0x31')],_0x3eb94a[_0x3ce2('0x32')]);_0x14fa52[_0x3ce2('0x36')]=_[_0x3ce2('0x34')](_0x3eb94a[_0x3ce2('0x31')],qs[_0x3ce2('0x35')](_0x11bdb3[_0x3ce2('0x32')][_0x3ce2('0x35')]));_0x14fa52[_0x3ce2('0x36')]=_0x14fa52[_0x3ce2('0x36')][_0x3ce2('0x37')]?_0x14fa52[_0x3ce2('0x36')]:_0x3eb94a[_0x3ce2('0x31')];if(_0x11bdb3['query'][_0x3ce2('0x42')]){_0x14fa52['include']=[{'all':!![]}];}_0x14fa52=_[_0x3ce2('0x3e')]({},_0x14fa52,_0x11bdb3[_0x3ce2('0x41')]);return db[_0x3ce2('0x2e')][_0x3ce2('0x48')](_0x14fa52)[_0x3ce2('0x28')](handleEntityNotFound(_0x5b1319,null))[_0x3ce2('0x28')](respondWithResult(_0x5b1319,null))['catch'](handleError(_0x5b1319,null));};exports[_0x3ce2('0x49')]=function(_0x348100,_0x40e7a3){return db[_0x3ce2('0x2e')][_0x3ce2('0x49')](_0x348100[_0x3ce2('0x4a')],{})['then'](respondWithResult(_0x40e7a3,0xc9))[_0x3ce2('0x4b')](handleError(_0x40e7a3,null));};exports[_0x3ce2('0x27')]=function(_0x424ed1,_0xc35199){if(_0x424ed1[_0x3ce2('0x4a')]['id']){delete _0x424ed1[_0x3ce2('0x4a')]['id'];}return db[_0x3ce2('0x2e')]['find']({'where':{'id':_0x424ed1[_0x3ce2('0x4c')]['id']}})[_0x3ce2('0x28')](handleEntityNotFound(_0xc35199,null))[_0x3ce2('0x28')](saveUpdates(_0x424ed1[_0x3ce2('0x4a')],null))[_0x3ce2('0x28')](respondWithResult(_0xc35199,null))[_0x3ce2('0x4b')](handleError(_0xc35199,null));};exports[_0x3ce2('0x29')]=function(_0x7f06ea,_0x3afc4b){return db[_0x3ce2('0x2e')]['find']({'where':{'id':_0x7f06ea['params']['id']}})[_0x3ce2('0x28')](handleEntityNotFound(_0x3afc4b,null))['then'](removeEntity(_0x3afc4b,null))[_0x3ce2('0x4b')](handleError(_0x3afc4b,null));};exports['describe']=function(_0x4717cb,_0xe05916){return db['MailTransferReport']['describe']()[_0x3ce2('0x28')](respondWithResult(_0xe05916,null))[_0x3ce2('0x4b')](handleError(_0xe05916,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4f3f656..a1ed9ed 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x180b=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x25b9c5,_0x31a38e){var _0x1a50d5=function(_0x33aaac){while(--_0x33aaac){_0x25b9c5['push'](_0x25b9c5['shift']());}};_0x1a50d5(++_0x31a38e);}(_0x180b,0xdc));var _0xb180=function(_0x2a4692,_0x5db910){_0x2a4692=_0x2a4692-0x0;var _0x370e6b=_0x180b[_0x2a4692];return _0x370e6b;};'use strict';var _=require(_0xb180('0x0'));var util=require(_0xb180('0x1'));var logger=require(_0xb180('0x2'))('api');var moment=require(_0xb180('0x3'));var BPromise=require(_0xb180('0x4'));var rp=require(_0xb180('0x5'));var fs=require('fs');var path=require(_0xb180('0x6'));var rimraf=require(_0xb180('0x7'));var config=require(_0xb180('0x8'));var attributes=require(_0xb180('0x9'));module[_0xb180('0xa')]=function(_0x417150,_0x21e952){return _0x417150[_0xb180('0xb')](_0xb180('0xc'),attributes,{'tableName':_0xb180('0xd'),'paranoid':![],'indexes':[{'name':_0xb180('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d9b=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./mailTransferReport.attributes','define','uniqueid'];(function(_0xd41ec0,_0x2c82f1){var _0x49f365=function(_0x234ec1){while(--_0x234ec1){_0xd41ec0['push'](_0xd41ec0['shift']());}};_0x49f365(++_0x2c82f1);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var logger=require(_0xb8d9('0x2'))(_0xb8d9('0x3'));var moment=require(_0xb8d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d9('0x5'));var rimraf=require('rimraf');var config=require(_0xb8d9('0x6'));var attributes=require(_0xb8d9('0x7'));module['exports']=function(_0x5996e9,_0x529b0a){return _0x5996e9[_0xb8d9('0x8')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb8d9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 5ab92c0..8e37df8 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8861=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x2096a7,_0x1f20ee){var _0x52f0ff=function(_0x35c016){while(--_0x35c016){_0x2096a7['push'](_0x2096a7['shift']());}};_0x52f0ff(++_0x1f20ee);}(_0x8861,0x97));var _0x1886=function(_0x142d60,_0x3de430){_0x142d60=_0x142d60-0x0;var _0x18b83d=_0x8861[_0x142d60];return _0x18b83d;};'use strict';var _=require(_0x1886('0x0'));var util=require(_0x1886('0x1'));var moment=require(_0x1886('0x2'));var BPromise=require('bluebird');var rs=require(_0x1886('0x3'));var fs=require('fs');var Redis=require(_0x1886('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1886('0x5'));var logger=require(_0x1886('0x6'))('rpc');var config=require(_0x1886('0x7'));var jayson=require(_0x1886('0x8'));var client=jayson['client'][_0x1886('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d92c,_0x51deb7,_0x1bdb39){return new BPromise(function(_0x22b5f9,_0x184739){return client[_0x1886('0xa')](_0x24d92c,_0x1bdb39)['then'](function(_0xf87af){logger[_0x1886('0xb')](_0x1886('0xc'),_0x51deb7,_0x1886('0xd'));logger[_0x1886('0xe')](_0x1886('0xf'),_0x51deb7,_0x1886('0xd'),JSON[_0x1886('0x10')](_0xf87af));if(_0xf87af[_0x1886('0x11')]){if(_0xf87af['error']['code']===0x1f4){logger[_0x1886('0x11')](_0x1886('0xc'),_0x51deb7,_0xf87af[_0x1886('0x11')][_0x1886('0x12')]);return _0x184739(_0xf87af[_0x1886('0x11')]['message']);}logger['error'](_0x1886('0xc'),_0x51deb7,_0xf87af[_0x1886('0x11')][_0x1886('0x12')]);return _0x22b5f9(_0xf87af[_0x1886('0x11')][_0x1886('0x12')]);}else{logger['info'](_0x1886('0xc'),_0x51deb7,'request\x20sent');_0x22b5f9(_0xf87af['result'][_0x1886('0x12')]);}})['catch'](function(_0x85c7a9){logger[_0x1886('0x11')](_0x1886('0xc'),_0x51deb7,_0x85c7a9);_0x184739(_0x85c7a9);});});} \ No newline at end of file +var _0xbbd4=['error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45ea72,_0x2e5b3d){var _0x9e418e=function(_0x1d1ffd){while(--_0x1d1ffd){_0x45ea72['push'](_0x45ea72['shift']());}};_0x9e418e(++_0x2e5b3d);}(_0xbbd4,0x1e6));var _0x4bbd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbbd4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x4bbd('0x0'));var moment=require('moment');var BPromise=require(_0x4bbd('0x1'));var rs=require(_0x4bbd('0x2'));var fs=require('fs');var Redis=require(_0x4bbd('0x3'));var db=require(_0x4bbd('0x4'))['db'];var utils=require(_0x4bbd('0x5'));var logger=require(_0x4bbd('0x6'))(_0x4bbd('0x7'));var config=require('../../config/environment');var jayson=require(_0x4bbd('0x8'));var client=jayson[_0x4bbd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6774,_0x2266ac,_0x73c978){return new BPromise(function(_0x1b68ed,_0xae801d){return client[_0x4bbd('0xa')](_0x5a6774,_0x73c978)['then'](function(_0x5b8668){logger['info'](_0x4bbd('0xb'),_0x2266ac,_0x4bbd('0xc'));logger[_0x4bbd('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2266ac,_0x4bbd('0xc'),JSON['stringify'](_0x5b8668));if(_0x5b8668[_0x4bbd('0xe')]){if(_0x5b8668[_0x4bbd('0xe')][_0x4bbd('0xf')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2266ac,_0x5b8668[_0x4bbd('0xe')]['message']);return _0xae801d(_0x5b8668[_0x4bbd('0xe')][_0x4bbd('0x10')]);}logger['error'](_0x4bbd('0xb'),_0x2266ac,_0x5b8668['error'][_0x4bbd('0x10')]);return _0x1b68ed(_0x5b8668[_0x4bbd('0xe')][_0x4bbd('0x10')]);}else{logger[_0x4bbd('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2266ac,_0x4bbd('0xc'));_0x1b68ed(_0x5b8668[_0x4bbd('0x12')][_0x4bbd('0x10')]);}})[_0x4bbd('0x13')](function(_0x2ad2fb){logger[_0x4bbd('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2266ac,_0x2ad2fb);_0xae801d(_0x2ad2fb);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0a60342..75af752 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c11=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x4e4096,_0x22c1bf){var _0x7acdeb=function(_0x3cf94a){while(--_0x3cf94a){_0x4e4096['push'](_0x4e4096['shift']());}};_0x7acdeb(++_0x22c1bf);}(_0x5c11,0x11d));var _0x15c1=function(_0x555788,_0x207c93){_0x555788=_0x555788-0x0;var _0x2ec89b=_0x5c11[_0x555788];return _0x2ec89b;};'use strict';var multer=require(_0x15c1('0x0'));var util=require(_0x15c1('0x1'));var path=require('path');var timeout=require(_0x15c1('0x2'));var express=require(_0x15c1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15c1('0x4'));var interaction=require(_0x15c1('0x5'));var config=require('../../config/environment');var controller=require(_0x15c1('0x6'));router[_0x15c1('0x7')]('/',auth['isAuthenticated'](),controller[_0x15c1('0x8')]);router['get'](_0x15c1('0x9'),auth[_0x15c1('0xa')](),controller[_0x15c1('0xb')]);router[_0x15c1('0x7')](_0x15c1('0xc'),auth[_0x15c1('0xa')](),controller['show']);router[_0x15c1('0xd')]('/',auth[_0x15c1('0xa')](),controller[_0x15c1('0xe')]);router[_0x15c1('0xf')](_0x15c1('0xc'),auth[_0x15c1('0xa')](),controller[_0x15c1('0x10')]);router[_0x15c1('0x11')](_0x15c1('0xc'),auth[_0x15c1('0xa')](),controller[_0x15c1('0x12')]);module[_0x15c1('0x13')]=router; \ No newline at end of file +var _0x1379=['/describe','describe','/:id','isAuthenticated','post','update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index'];(function(_0x4bf5d3,_0x250136){var _0x19ff9b=function(_0x7f04e){while(--_0x7f04e){_0x4bf5d3['push'](_0x4bf5d3['shift']());}};_0x19ff9b(++_0x250136);}(_0x1379,0x18f));var _0x9137=function(_0x352b7c,_0xf3c28b){_0x352b7c=_0x352b7c-0x0;var _0x2f96ff=_0x1379[_0x352b7c];return _0x2f96ff;};'use strict';var multer=require('multer');var util=require(_0x9137('0x0'));var path=require('path');var timeout=require(_0x9137('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9137('0x2'));var auth=require(_0x9137('0x3'));var interaction=require(_0x9137('0x4'));var config=require(_0x9137('0x5'));var controller=require(_0x9137('0x6'));router[_0x9137('0x7')]('/',auth['isAuthenticated'](),controller[_0x9137('0x8')]);router['get'](_0x9137('0x9'),auth['isAuthenticated'](),controller[_0x9137('0xa')]);router[_0x9137('0x7')](_0x9137('0xb'),auth[_0x9137('0xc')](),controller['show']);router[_0x9137('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x9137('0xc')](),controller[_0x9137('0xe')]);router[_0x9137('0xf')](_0x9137('0xb'),auth[_0x9137('0xc')](),controller[_0x9137('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 677eb0d..e45bf93 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bec=['INTEGER','DATE','getDataValue','diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x5350f5,_0x3aafa3){var _0x2faef5=function(_0x48d945){while(--_0x48d945){_0x5350f5['push'](_0x5350f5['shift']());}};_0x2faef5(++_0x3aafa3);}(_0x1bec,0x7a));var _0xc1be=function(_0x1b1c65,_0x23ca6d){_0x1b1c65=_0x1b1c65-0x0;var _0x1b86d9=_0x1bec[_0x1b1c65];return _0x1b86d9;};'use strict';var Sequelize=require(_0xc1be('0x0'));var moment=require(_0xc1be('0x1'));module[_0xc1be('0x2')]={'channel':{'type':Sequelize[_0xc1be('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc1be('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc1be('0x4'),'comment':_0xc1be('0x5')},'duration':{'type':Sequelize[_0xc1be('0x6')]},'enterAt':{'type':Sequelize[_0xc1be('0x7')]},'exitAt':{'type':Sequelize[_0xc1be('0x7')],'set':function(_0x5f4e1b){var _0x1f4d46=moment(_0x5f4e1b);var _0x4edaef=moment(this[_0xc1be('0x8')]('enterAt'));var _0x34eab0=_0x1f4d46[_0xc1be('0x9')](_0x4edaef,'seconds');this[_0xc1be('0xa')](_0xc1be('0xb'),_0x5f4e1b);this[_0xc1be('0xa')]('duration',_0x34eab0>=0x0?_0x34eab0:null);}},'data1':{'type':Sequelize[_0xc1be('0x3')],'comment':_0xc1be('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0xc1be('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xc1be('0x3')],'comment':_0xc1be('0xe')},'data5':{'type':Sequelize[_0xc1be('0x3')],'comment':_0xc1be('0xf')},'role':{'type':Sequelize[_0xc1be('0x3')]},'internal':{'type':Sequelize[_0xc1be('0x6')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0a22=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x57ddab,_0x2b4db6){var _0x53ec4e=function(_0x59289f){while(--_0x59289f){_0x57ddab['push'](_0x57ddab['shift']());}};_0x53ec4e(++_0x2b4db6);}(_0x0a22,0xd1));var _0x20a2=function(_0x4a9efa,_0x23e524){_0x4a9efa=_0x4a9efa-0x0;var _0x1809af=_0x0a22[_0x4a9efa];return _0x1809af;};'use strict';var Sequelize=require(_0x20a2('0x0'));var moment=require(_0x20a2('0x1'));module[_0x20a2('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x20a2('0x3')]},'interface':{'type':Sequelize[_0x20a2('0x3')]},'type':{'type':Sequelize[_0x20a2('0x3')],'defaultValue':_0x20a2('0x4'),'comment':_0x20a2('0x5')},'duration':{'type':Sequelize[_0x20a2('0x6')]},'enterAt':{'type':Sequelize[_0x20a2('0x7')]},'exitAt':{'type':Sequelize[_0x20a2('0x7')],'set':function(_0x4eee99){var _0x26fe64=moment(_0x4eee99);var _0x42f94a=moment(this[_0x20a2('0x8')](_0x20a2('0x9')));var _0x2e66d6=_0x26fe64[_0x20a2('0xa')](_0x42f94a,_0x20a2('0xb'));this[_0x20a2('0xc')](_0x20a2('0xd'),_0x4eee99);this[_0x20a2('0xc')]('duration',_0x2e66d6>=0x0?_0x2e66d6:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x20a2('0xe')},'data2':{'type':Sequelize['STRING'],'comment':_0x20a2('0xf')},'data3':{'type':Sequelize['STRING'],'comment':_0x20a2('0x10')},'data4':{'type':Sequelize[_0x20a2('0x3')],'comment':_0x20a2('0x11')},'data5':{'type':Sequelize['STRING'],'comment':_0x20a2('0x12')},'role':{'type':Sequelize[_0x20a2('0x3')]},'internal':{'type':Sequelize[_0x20a2('0x6')]},'uniqueid':{'type':Sequelize[_0x20a2('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 83f73f9..bddcab7 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x22103e,_0x13ce5d){var _0x5f1d9d=function(_0x3a7d06){while(--_0x3a7d06){_0x22103e['push'](_0x22103e['shift']());}};_0x5f1d9d(++_0x13ce5d);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0xb35cef,_0x54bc25){var _0x3f3edf=function(_0x56767b){while(--_0x56767b){_0xb35cef['push'](_0xb35cef['shift']());}};_0x3f3edf(++_0x54bc25);}(_0x3e74,0x175));var _0x43e7=function(_0x36049d,_0x4d97ac){_0x36049d=_0x36049d-0x0;var _0x118dc1=_0x3e74[_0x36049d];return _0x118dc1;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c1f4d0d..e33333a 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4eb=['report_member','lodash','util','../../config/logger','api','bluebird','path','rimraf','./memberReport.attributes','define'];(function(_0x5a4135,_0xf46cc9){var _0x5b0dc0=function(_0x392f13){while(--_0x392f13){_0x5a4135['push'](_0x5a4135['shift']());}};_0x5b0dc0(++_0xf46cc9);}(_0xb4eb,0xa1));var _0xbb4e=function(_0xc591a7,_0x2d7777){_0xc591a7=_0xc591a7-0x0;var _0x2127f4=_0xb4eb[_0xc591a7];return _0x2127f4;};'use strict';var _=require(_0xbb4e('0x0'));var util=require(_0xbb4e('0x1'));var logger=require(_0xbb4e('0x2'))(_0xbb4e('0x3'));var moment=require('moment');var BPromise=require(_0xbb4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb4e('0x5'));var rimraf=require(_0xbb4e('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb4e('0x7'));module['exports']=function(_0x1d9011,_0x458291){return _0x1d9011[_0xbb4e('0x8')]('MemberReport',attributes,{'tableName':_0xbb4e('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x19fc=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','api','moment'];(function(_0x5d205b,_0x460904){var _0x138a0b=function(_0x34ebfe){while(--_0x34ebfe){_0x5d205b['push'](_0x5d205b['shift']());}};_0x138a0b(++_0x460904);}(_0x19fc,0x150));var _0xc19f=function(_0x565dc8,_0x4261e5){_0x565dc8=_0x565dc8-0x0;var _0x46d643=_0x19fc[_0x565dc8];return _0x46d643;};'use strict';var _=require(_0xc19f('0x0'));var util=require('util');var logger=require(_0xc19f('0x1'))(_0xc19f('0x2'));var moment=require(_0xc19f('0x3'));var BPromise=require(_0xc19f('0x4'));var rp=require(_0xc19f('0x5'));var fs=require('fs');var path=require(_0xc19f('0x6'));var rimraf=require(_0xc19f('0x7'));var config=require(_0xc19f('0x8'));var attributes=require(_0xc19f('0x9'));module[_0xc19f('0xa')]=function(_0x35e3f6,_0x442b80){return _0x35e3f6[_0xc19f('0xb')](_0xc19f('0xc'),attributes,{'tableName':_0xc19f('0xd'),'paranoid':![],'indexes':[{'name':_0xc19f('0xe'),'fields':[_0xc19f('0xf'),_0xc19f('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b201f82..00a5358 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9aac=['body','UpdateMemberReport','where','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','debug','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','CreateMemberReport','create'];(function(_0x49a96d,_0x5c47a5){var _0x847470=function(_0x2959b9){while(--_0x2959b9){_0x49a96d['push'](_0x49a96d['shift']());}};_0x847470(++_0x5c47a5);}(_0x9aac,0x135));var _0xc9aa=function(_0x186ca5,_0x12dbb0){_0x186ca5=_0x186ca5-0x0;var _0x2b9f5e=_0x9aac[_0x186ca5];return _0x2b9f5e;};'use strict';var _=require(_0xc9aa('0x0'));var util=require('util');var moment=require(_0xc9aa('0x1'));var BPromise=require(_0xc9aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9aa('0x4'));var logger=require('../../config/logger')(_0xc9aa('0x5'));var config=require(_0xc9aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc9aa('0x7')][_0xc9aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34beeb,_0x4d47ad,_0x2f3fde){return new BPromise(function(_0x24829f,_0x2acfd4){return client['request'](_0x34beeb,_0x2f3fde)[_0xc9aa('0x9')](function(_0xda84e5){logger[_0xc9aa('0xa')]('MemberReport,\x20%s,\x20%s',_0x4d47ad,'request\x20sent');logger[_0xc9aa('0xb')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4d47ad,_0xc9aa('0xc'),JSON[_0xc9aa('0xd')](_0xda84e5));if(_0xda84e5[_0xc9aa('0xe')]){if(_0xda84e5[_0xc9aa('0xe')][_0xc9aa('0xf')]===0x1f4){logger[_0xc9aa('0xe')](_0xc9aa('0x10'),_0x4d47ad,_0xda84e5[_0xc9aa('0xe')][_0xc9aa('0x11')]);return _0x2acfd4(_0xda84e5[_0xc9aa('0xe')][_0xc9aa('0x11')]);}logger[_0xc9aa('0xe')](_0xc9aa('0x10'),_0x4d47ad,_0xda84e5[_0xc9aa('0xe')][_0xc9aa('0x11')]);return _0x24829f(_0xda84e5[_0xc9aa('0xe')][_0xc9aa('0x11')]);}else{logger['info'](_0xc9aa('0x10'),_0x4d47ad,'request\x20sent');_0x24829f(_0xda84e5['result'][_0xc9aa('0x11')]);}})[_0xc9aa('0x12')](function(_0x13ed6c){logger[_0xc9aa('0xe')]('MemberReport,\x20%s,\x20%s',_0x4d47ad,_0x13ed6c);_0x2acfd4(_0x13ed6c);});});}exports[_0xc9aa('0x13')]=function(_0x28a1a0){var _0x26f5a9=this;return new Promise(function(_0x4bacb3,_0x2999e0){return db[_0xc9aa('0x14')][_0xc9aa('0x15')]({'raw':_0x28a1a0[_0xc9aa('0x16')]?_0x28a1a0[_0xc9aa('0x16')][_0xc9aa('0x17')]===undefined?!![]:![]:!![],'where':_0x28a1a0['options']?_0x28a1a0[_0xc9aa('0x16')]['where']||null:null,'attributes':_0x28a1a0[_0xc9aa('0x16')]?_0x28a1a0['options'][_0xc9aa('0x18')]||null:null,'limit':_0x28a1a0['options']?_0x28a1a0[_0xc9aa('0x16')][_0xc9aa('0x19')]||null:null,'include':_0x28a1a0[_0xc9aa('0x16')]?_0x28a1a0[_0xc9aa('0x16')]['include']?_[_0xc9aa('0x1a')](_0x28a1a0[_0xc9aa('0x16')][_0xc9aa('0x1b')],function(_0x1b4246){return{'model':db[_0x1b4246[_0xc9aa('0x1c')]],'as':_0x1b4246['as'],'attributes':_0x1b4246['attributes'],'include':_0x1b4246[_0xc9aa('0x1b')]?_[_0xc9aa('0x1a')](_0x1b4246[_0xc9aa('0x1b')],function(_0x59dcfe){return{'model':db[_0x59dcfe[_0xc9aa('0x1c')]],'as':_0x59dcfe['as'],'attributes':_0x59dcfe[_0xc9aa('0x18')],'include':_0x59dcfe[_0xc9aa('0x1b')]?_['map'](_0x59dcfe[_0xc9aa('0x1b')],function(_0x40e628){return{'model':db[_0x40e628['model']],'as':_0x40e628['as'],'attributes':_0x40e628['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9aa('0x9')](function(_0x10a62e){logger[_0xc9aa('0xa')](_0xc9aa('0x13'),_0x28a1a0);logger[_0xc9aa('0xb')](_0xc9aa('0x13'),_0x28a1a0,JSON[_0xc9aa('0xd')](_0x10a62e));_0x4bacb3(_0x10a62e);})['catch'](function(_0x1d1215){logger[_0xc9aa('0xe')](_0xc9aa('0x13'),_0x1d1215[_0xc9aa('0x11')],_0x28a1a0);_0x2999e0(_0x26f5a9[_0xc9aa('0xe')](0x1f4,_0x1d1215[_0xc9aa('0x11')]));});});};exports[_0xc9aa('0x1d')]=function(_0x574a66){var _0x16b293=this;return new Promise(function(_0xbe9cc,_0x8be8ee){return db[_0xc9aa('0x14')][_0xc9aa('0x1e')](_0x574a66[_0xc9aa('0x1f')],{'raw':_0x574a66[_0xc9aa('0x16')]?_0x574a66[_0xc9aa('0x16')][_0xc9aa('0x17')]===undefined?!![]:![]:!![]})[_0xc9aa('0x9')](function(_0x340d53){logger['info']('CreateMemberReport',_0x574a66);logger[_0xc9aa('0xb')]('CreateMemberReport',_0x574a66,JSON[_0xc9aa('0xd')](_0x340d53));_0xbe9cc(_0x340d53);})[_0xc9aa('0x12')](function(_0x2a7a85){logger['error'](_0xc9aa('0x1d'),_0x2a7a85[_0xc9aa('0x11')],_0x574a66);_0x8be8ee(_0x16b293['error'](0x1f4,_0x2a7a85[_0xc9aa('0x11')]));});});};exports[_0xc9aa('0x20')]=function(_0x4ae06c){var _0x455d02=this;return new Promise(function(_0x3e2669,_0x36ee50){return db[_0xc9aa('0x14')]['update'](_0x4ae06c[_0xc9aa('0x1f')],{'raw':_0x4ae06c[_0xc9aa('0x16')]?_0x4ae06c['options'][_0xc9aa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ae06c[_0xc9aa('0x16')]?_0x4ae06c[_0xc9aa('0x16')][_0xc9aa('0x21')]||null:null,'attributes':_0x4ae06c[_0xc9aa('0x16')]?_0x4ae06c[_0xc9aa('0x16')]['attributes']||null:null,'limit':_0x4ae06c['options']?_0x4ae06c[_0xc9aa('0x16')][_0xc9aa('0x19')]||null:null})[_0xc9aa('0x9')](function(_0x44c360){logger[_0xc9aa('0xa')](_0xc9aa('0x20'),_0x4ae06c);logger[_0xc9aa('0xb')]('UpdateMemberReport',_0x4ae06c,JSON[_0xc9aa('0xd')](_0x44c360));_0x3e2669(_0x44c360);})[_0xc9aa('0x12')](function(_0x213e45){logger[_0xc9aa('0xe')]('UpdateMemberReport',_0x213e45['message'],_0x4ae06c);_0x36ee50(_0x455d02['error'](0x1f4,_0x213e45[_0xc9aa('0x11')]));});});}; \ No newline at end of file +var _0x0763=['error','message','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','map','model','then','create','CreateMemberReport','debug','update','body','where','UpdateMemberReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0763,0x87));var _0x3076=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x0763[_0x533528];return _0x3189f1;};'use strict';var _=require(_0x3076('0x0'));var util=require('util');var moment=require(_0x3076('0x1'));var BPromise=require(_0x3076('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3076('0x3'));var db=require(_0x3076('0x4'))['db'];var utils=require(_0x3076('0x5'));var logger=require(_0x3076('0x6'))('rpc');var config=require(_0x3076('0x7'));var jayson=require(_0x3076('0x8'));var client=jayson[_0x3076('0x9')][_0x3076('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18b4c8,_0x5efd65,_0x2776c8){return new BPromise(function(_0xf1ee41,_0xf5b1b0){return client[_0x3076('0xb')](_0x18b4c8,_0x2776c8)['then'](function(_0x42804a){logger[_0x3076('0xc')](_0x3076('0xd'),_0x5efd65,'request\x20sent');logger['debug'](_0x3076('0xe'),_0x5efd65,_0x3076('0xf'),JSON[_0x3076('0x10')](_0x42804a));if(_0x42804a[_0x3076('0x11')]){if(_0x42804a[_0x3076('0x11')]['code']===0x1f4){logger[_0x3076('0x11')](_0x3076('0xd'),_0x5efd65,_0x42804a[_0x3076('0x11')][_0x3076('0x12')]);return _0xf5b1b0(_0x42804a[_0x3076('0x11')][_0x3076('0x12')]);}logger[_0x3076('0x11')](_0x3076('0xd'),_0x5efd65,_0x42804a['error']['message']);return _0xf1ee41(_0x42804a[_0x3076('0x11')][_0x3076('0x12')]);}else{logger[_0x3076('0xc')](_0x3076('0xd'),_0x5efd65,'request\x20sent');_0xf1ee41(_0x42804a['result'][_0x3076('0x12')]);}})[_0x3076('0x13')](function(_0x45a69b){logger[_0x3076('0x11')](_0x3076('0xd'),_0x5efd65,_0x45a69b);_0xf5b1b0(_0x45a69b);});});}exports[_0x3076('0x14')]=function(_0x21c242){var _0x2d7343=this;return new Promise(function(_0x1880b8,_0x1bb2ea){return db[_0x3076('0x15')][_0x3076('0x16')]({'raw':_0x21c242['options']?_0x21c242[_0x3076('0x17')][_0x3076('0x18')]===undefined?!![]:![]:!![],'where':_0x21c242['options']?_0x21c242[_0x3076('0x17')]['where']||null:null,'attributes':_0x21c242[_0x3076('0x17')]?_0x21c242[_0x3076('0x17')][_0x3076('0x19')]||null:null,'limit':_0x21c242['options']?_0x21c242[_0x3076('0x17')][_0x3076('0x1a')]||null:null,'include':_0x21c242[_0x3076('0x17')]?_0x21c242[_0x3076('0x17')][_0x3076('0x1b')]?_[_0x3076('0x1c')](_0x21c242[_0x3076('0x17')][_0x3076('0x1b')],function(_0x195606){return{'model':db[_0x195606[_0x3076('0x1d')]],'as':_0x195606['as'],'attributes':_0x195606['attributes'],'include':_0x195606[_0x3076('0x1b')]?_['map'](_0x195606[_0x3076('0x1b')],function(_0x4f4bdc){return{'model':db[_0x4f4bdc['model']],'as':_0x4f4bdc['as'],'attributes':_0x4f4bdc[_0x3076('0x19')],'include':_0x4f4bdc[_0x3076('0x1b')]?_[_0x3076('0x1c')](_0x4f4bdc[_0x3076('0x1b')],function(_0x28d834){return{'model':db[_0x28d834[_0x3076('0x1d')]],'as':_0x28d834['as'],'attributes':_0x28d834[_0x3076('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3076('0x1e')](function(_0x3a0ba7){logger[_0x3076('0xc')](_0x3076('0x14'),_0x21c242);logger['debug'](_0x3076('0x14'),_0x21c242,JSON[_0x3076('0x10')](_0x3a0ba7));_0x1880b8(_0x3a0ba7);})[_0x3076('0x13')](function(_0x5af88e){logger[_0x3076('0x11')](_0x3076('0x14'),_0x5af88e['message'],_0x21c242);_0x1bb2ea(_0x2d7343[_0x3076('0x11')](0x1f4,_0x5af88e[_0x3076('0x12')]));});});};exports['CreateMemberReport']=function(_0x44f7c7){var _0x5337bc=this;return new Promise(function(_0x4d6f8f,_0x28bcfb){return db[_0x3076('0x15')][_0x3076('0x1f')](_0x44f7c7['body'],{'raw':_0x44f7c7[_0x3076('0x17')]?_0x44f7c7[_0x3076('0x17')][_0x3076('0x18')]===undefined?!![]:![]:!![]})[_0x3076('0x1e')](function(_0x516e5d){logger[_0x3076('0xc')](_0x3076('0x20'),_0x44f7c7);logger[_0x3076('0x21')](_0x3076('0x20'),_0x44f7c7,JSON[_0x3076('0x10')](_0x516e5d));_0x4d6f8f(_0x516e5d);})['catch'](function(_0x5d40d8){logger[_0x3076('0x11')](_0x3076('0x20'),_0x5d40d8[_0x3076('0x12')],_0x44f7c7);_0x28bcfb(_0x5337bc[_0x3076('0x11')](0x1f4,_0x5d40d8[_0x3076('0x12')]));});});};exports['UpdateMemberReport']=function(_0x171d0a){var _0x538502=this;return new Promise(function(_0x445847,_0x1d6b0b){return db[_0x3076('0x15')][_0x3076('0x22')](_0x171d0a[_0x3076('0x23')],{'raw':_0x171d0a[_0x3076('0x17')]?_0x171d0a[_0x3076('0x17')][_0x3076('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x171d0a[_0x3076('0x17')]?_0x171d0a[_0x3076('0x17')][_0x3076('0x24')]||null:null,'attributes':_0x171d0a[_0x3076('0x17')]?_0x171d0a[_0x3076('0x17')][_0x3076('0x19')]||null:null,'limit':_0x171d0a[_0x3076('0x17')]?_0x171d0a[_0x3076('0x17')][_0x3076('0x1a')]||null:null})[_0x3076('0x1e')](function(_0x4525ea){logger[_0x3076('0xc')](_0x3076('0x25'),_0x171d0a);logger[_0x3076('0x21')](_0x3076('0x25'),_0x171d0a,JSON[_0x3076('0x10')](_0x4525ea));_0x445847(_0x4525ea);})[_0x3076('0x13')](function(_0x135fdd){logger[_0x3076('0x11')]('UpdateMemberReport',_0x135fdd[_0x3076('0x12')],_0x171d0a);_0x1d6b0b(_0x538502[_0x3076('0x11')](0x1f4,_0x135fdd[_0x3076('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 884b3a6..2aeb451 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1014=['../../config/environment','./migration.controller','get','index','exports','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1af67c,_0x247866){var _0x4e6ec9=function(_0x5a36d2){while(--_0x5a36d2){_0x1af67c['push'](_0x1af67c['shift']());}};_0x4e6ec9(++_0x247866);}(_0x1014,0x1c7));var _0x4101=function(_0x53601e,_0x347db2){_0x53601e=_0x53601e-0x0;var _0x13ec7d=_0x1014[_0x53601e];return _0x13ec7d;};'use strict';var multer=require('multer');var util=require(_0x4101('0x0'));var path=require('path');var timeout=require(_0x4101('0x1'));var express=require(_0x4101('0x2'));var router=express['Router']();var fs_extra=require(_0x4101('0x3'));var auth=require(_0x4101('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4101('0x5'));var controller=require(_0x4101('0x6'));router[_0x4101('0x7')]('/',controller[_0x4101('0x8')]);module[_0x4101('0x9')]=router; \ No newline at end of file +var _0x2649=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x5437e4,_0x451ade){var _0x2ca9d4=function(_0x4805b2){while(--_0x4805b2){_0x5437e4['push'](_0x5437e4['shift']());}};_0x2ca9d4(++_0x451ade);}(_0x2649,0x133));var _0x9264=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x2649[_0x580647];return _0x5f0792;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9264('0x0'));var timeout=require(_0x9264('0x1'));var express=require(_0x9264('0x2'));var router=express[_0x9264('0x3')]();var fs_extra=require(_0x9264('0x4'));var auth=require(_0x9264('0x5'));var interaction=require(_0x9264('0x6'));var config=require(_0x9264('0x7'));var controller=require(_0x9264('0x8'));router[_0x9264('0x9')]('/',controller[_0x9264('0xa')]);module[_0x9264('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 7f78801..94816af 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbe9=['exports','version','sequelize'];(function(_0x36aad6,_0x2a37ba){var _0x36d6eb=function(_0x533854){while(--_0x533854){_0x36aad6['push'](_0x36aad6['shift']());}};_0x36d6eb(++_0x2a37ba);}(_0xcbe9,0x71));var _0x9cbe=function(_0x379ab8,_0x31cb3a){_0x379ab8=_0x379ab8-0x0;var _0x6763f8=_0xcbe9[_0x379ab8];return _0x6763f8;};'use strict';var Sequelize=require(_0x9cbe('0x0'));module[_0x9cbe('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x9cbe('0x2')}}; \ No newline at end of file +var _0xf4f0=['version','exports'];(function(_0x589750,_0x5efe1a){var _0x49b7ab=function(_0x57cbfa){while(--_0x57cbfa){_0x589750['push'](_0x589750['shift']());}};_0x49b7ab(++_0x5efe1a);}(_0xf4f0,0x1a9));var _0x0f4f=function(_0x56c7c0,_0x463d97){_0x56c7c0=_0x56c7c0-0x0;var _0x666b9a=_0xf4f0[_0x56c7c0];return _0x666b9a;};'use strict';var Sequelize=require('sequelize');module[_0x0f4f('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x0f4f('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cb2d6ed..f1daeef 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4ae=['length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','Migration','includeAll','include','findAll','rows','catch','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','map','type','model','query','filters','intersection','attributes','fields'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa4ae,0x101));var _0xea4a=function(_0x40eec9,_0x817a67){_0x40eec9=_0x40eec9-0x0;var _0xfee890=_0xa4ae[_0x40eec9];return _0xfee890;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea4a('0x0'));var rp=require(_0xea4a('0x1'));var moment=require(_0xea4a('0x2'));var BPromise=require(_0xea4a('0x3'));var Mustache=require('mustache');var util=require(_0xea4a('0x4'));var path=require(_0xea4a('0x5'));var sox=require(_0xea4a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea4a('0x7'));var _=require(_0xea4a('0x8'));var squel=require(_0xea4a('0x9'));var crypto=require(_0xea4a('0xa'));var jsforce=require(_0xea4a('0xb'));var deskjs=require(_0xea4a('0xc'));var toCsv=require(_0xea4a('0xd'));var querystring=require('querystring');var Papa=require(_0xea4a('0xe'));var Redis=require('ioredis');var authService=require(_0xea4a('0xf'));var qs=require(_0xea4a('0x10'));var as=require(_0xea4a('0x11'));var hardwareService=require(_0xea4a('0x12'));var logger=require(_0xea4a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xea4a('0x14'));var licenseUtil=require(_0xea4a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4866ea,_0x519595){_0x519595=_0x519595||0xcc;return function(_0x14da18){if(_0x14da18){return _0x4866ea[_0xea4a('0x16')](_0x519595);}return _0x4866ea[_0xea4a('0x17')](_0x519595)['end']();};}function respondWithResult(_0x1b99b7,_0x312216){_0x312216=_0x312216||0xc8;return function(_0x12b22a){if(_0x12b22a){return _0x1b99b7['status'](_0x312216)['json'](_0x12b22a);}};}function respondWithFilteredResult(_0x7f1d1f,_0x403957){return function(_0x27b4bb){if(_0x27b4bb){var _0x37d723=typeof _0x403957['offset']==='undefined'&&typeof _0x403957[_0xea4a('0x18')]===_0xea4a('0x19');var _0x46f8df=_0x27b4bb[_0xea4a('0x1a')];var _0x31f04f=_0x37d723?0x0:_0x403957['offset'];var _0x457c70=_0x37d723?_0x27b4bb['count']:_0x403957[_0xea4a('0x1b')]+_0x403957['limit'];var _0x458e15;if(_0x457c70>=_0x46f8df){_0x457c70=_0x46f8df;_0x458e15=0xc8;}else{_0x458e15=0xce;}_0x7f1d1f['status'](_0x458e15);return _0x7f1d1f[_0xea4a('0x1c')](_0xea4a('0x1d'),_0x31f04f+'-'+_0x457c70+'/'+_0x46f8df)[_0xea4a('0x1e')](_0x27b4bb);}return null;};}function patchUpdates(_0x44095b){return function(_0x22ba70){try{jsonpatch['apply'](_0x22ba70,_0x44095b,!![]);}catch(_0x2199e5){return BPromise[_0xea4a('0x1f')](_0x2199e5);}return _0x22ba70[_0xea4a('0x20')]();};}function saveUpdates(_0xa2c65e,_0xf97b69){return function(_0x5efbfe){if(_0x5efbfe){return _0x5efbfe['update'](_0xa2c65e)[_0xea4a('0x21')](function(_0x26ea3d){return _0x26ea3d;});}return null;};}function removeEntity(_0x84cd5b,_0x26f868){return function(_0xb4f647){if(_0xb4f647){return _0xb4f647[_0xea4a('0x22')]()[_0xea4a('0x21')](function(){_0x84cd5b[_0xea4a('0x17')](0xcc)[_0xea4a('0x23')]();});}};}function handleEntityNotFound(_0xb58a48,_0x146b9c){return function(_0x3aa4c8){if(!_0x3aa4c8){_0xb58a48[_0xea4a('0x16')](0x194);}return _0x3aa4c8;};}function handleError(_0x45537f,_0x426b13){_0x426b13=_0x426b13||0x1f4;return function(_0x4d826a){logger[_0xea4a('0x24')](_0x4d826a[_0xea4a('0x25')]);if(_0x4d826a[_0xea4a('0x26')]){delete _0x4d826a[_0xea4a('0x26')];}_0x45537f[_0xea4a('0x17')](_0x426b13)[_0xea4a('0x27')](_0x4d826a);};}exports['index']=function(_0x37468f,_0x4463b7){var _0x543333={},_0xcce38f={},_0x461cf2={'count':0x0,'rows':[]};var _0x48851a=_[_0xea4a('0x28')](db['Migration']['rawAttributes'],function(_0x36418b){return{'name':_0x36418b['fieldName'],'type':_0x36418b[_0xea4a('0x29')]['key']};});_0xcce38f[_0xea4a('0x2a')]=_['map'](_0x48851a,'name');_0xcce38f['query']=_['keys'](_0x37468f[_0xea4a('0x2b')]);_0xcce38f[_0xea4a('0x2c')]=_[_0xea4a('0x2d')](_0xcce38f[_0xea4a('0x2a')],_0xcce38f['query']);_0x543333[_0xea4a('0x2e')]=_[_0xea4a('0x2d')](_0xcce38f[_0xea4a('0x2a')],qs[_0xea4a('0x2f')](_0x37468f['query'][_0xea4a('0x2f')]));_0x543333['attributes']=_0x543333['attributes'][_0xea4a('0x30')]?_0x543333[_0xea4a('0x2e')]:_0xcce38f[_0xea4a('0x2a')];if(!_0x37468f['query'][_0xea4a('0x31')]('nolimit')){_0x543333['limit']=qs[_0xea4a('0x18')](_0x37468f[_0xea4a('0x2b')]['limit']);_0x543333[_0xea4a('0x1b')]=qs['offset'](_0x37468f[_0xea4a('0x2b')][_0xea4a('0x1b')]);}_0x543333['order']=qs[_0xea4a('0x32')](_0x37468f['query'][_0xea4a('0x32')]);_0x543333[_0xea4a('0x33')]=qs[_0xea4a('0x2c')](_['pick'](_0x37468f['query'],_0xcce38f[_0xea4a('0x2c')]),_0x48851a);if(_0x37468f['query'][_0xea4a('0x34')]){_0x543333[_0xea4a('0x33')]=_[_0xea4a('0x35')](_0x543333[_0xea4a('0x33')],{'$or':_[_0xea4a('0x28')](_0x48851a,function(_0x4d84c4){if(_0x4d84c4[_0xea4a('0x29')]!==_0xea4a('0x36')){var _0x34d6b3={};_0x34d6b3[_0x4d84c4[_0xea4a('0x26')]]={'$like':'%'+_0x37468f['query'][_0xea4a('0x34')]+'%'};return _0x34d6b3;}})});}_0x543333=_[_0xea4a('0x35')]({},_0x543333,_0x37468f['options']);var _0x55ef2a={'where':_0x543333['where']};return db[_0xea4a('0x37')]['count'](_0x55ef2a)[_0xea4a('0x21')](function(_0x1f425e){_0x461cf2[_0xea4a('0x1a')]=_0x1f425e;if(_0x37468f[_0xea4a('0x2b')][_0xea4a('0x38')]){_0x543333[_0xea4a('0x39')]=[{'all':!![]}];}return db[_0xea4a('0x37')][_0xea4a('0x3a')](_0x543333);})['then'](function(_0x2a6396){_0x461cf2[_0xea4a('0x3b')]=_0x2a6396;return _0x461cf2;})[_0xea4a('0x21')](respondWithFilteredResult(_0x4463b7,_0x543333))[_0xea4a('0x3c')](handleError(_0x4463b7,null));}; \ No newline at end of file +var _0x7ffc=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','sendStatus','error','name','send','index','map','Migration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x457a61,_0x46640c){var _0x47ea14=function(_0x34d81c){while(--_0x34d81c){_0x457a61['push'](_0x457a61['shift']());}};_0x47ea14(++_0x46640c);}(_0x7ffc,0x13a));var _0xc7ff=function(_0x2afccc,_0x443a1a){_0x2afccc=_0x2afccc-0x0;var _0x485666=_0x7ffc[_0x2afccc];return _0x485666;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7ff('0x0'));var zipdir=require(_0xc7ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7ff('0x2'));var moment=require(_0xc7ff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc7ff('0x4'));var util=require(_0xc7ff('0x5'));var path=require(_0xc7ff('0x6'));var sox=require('sox');var csv=require(_0xc7ff('0x7'));var ejs=require(_0xc7ff('0x8'));var fs=require('fs');var fs_extra=require(_0xc7ff('0x9'));var _=require(_0xc7ff('0xa'));var squel=require(_0xc7ff('0xb'));var crypto=require('crypto');var jsforce=require(_0xc7ff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc7ff('0x7'));var querystring=require(_0xc7ff('0xd'));var Papa=require('papaparse');var Redis=require(_0xc7ff('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc7ff('0xf'));var hardwareService=require(_0xc7ff('0x10'));var logger=require(_0xc7ff('0x11'))(_0xc7ff('0x12'));var utils=require(_0xc7ff('0x13'));var config=require(_0xc7ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ff('0x15'))['db'];function respondWithStatusCode(_0x4091a0,_0x1fcf2a){_0x1fcf2a=_0x1fcf2a||0xcc;return function(_0x3d123a){if(_0x3d123a){return _0x4091a0['sendStatus'](_0x1fcf2a);}return _0x4091a0[_0xc7ff('0x16')](_0x1fcf2a)[_0xc7ff('0x17')]();};}function respondWithResult(_0xad6973,_0x47b3cd){_0x47b3cd=_0x47b3cd||0xc8;return function(_0x1abe86){if(_0x1abe86){return _0xad6973[_0xc7ff('0x16')](_0x47b3cd)[_0xc7ff('0x18')](_0x1abe86);}};}function respondWithFilteredResult(_0x4ebf2e,_0x599083){return function(_0x4b8a08){if(_0x4b8a08){var _0x4d24d7=typeof _0x599083[_0xc7ff('0x19')]===_0xc7ff('0x1a')&&typeof _0x599083[_0xc7ff('0x1b')]==='undefined';var _0x4f0f47=_0x4b8a08['count'];var _0x44afe4=_0x4d24d7?0x0:_0x599083[_0xc7ff('0x19')];var _0x49c60b=_0x4d24d7?_0x4b8a08[_0xc7ff('0x1c')]:_0x599083['offset']+_0x599083[_0xc7ff('0x1b')];var _0x2f5cb0;if(_0x49c60b>=_0x4f0f47){_0x49c60b=_0x4f0f47;_0x2f5cb0=0xc8;}else{_0x2f5cb0=0xce;}_0x4ebf2e['status'](_0x2f5cb0);return _0x4ebf2e[_0xc7ff('0x1d')]('Content-Range',_0x44afe4+'-'+_0x49c60b+'/'+_0x4f0f47)[_0xc7ff('0x18')](_0x4b8a08);}return null;};}function patchUpdates(_0x225bb4){return function(_0x40a430){try{jsonpatch['apply'](_0x40a430,_0x225bb4,!![]);}catch(_0xfb0946){return BPromise[_0xc7ff('0x1e')](_0xfb0946);}return _0x40a430[_0xc7ff('0x1f')]();};}function saveUpdates(_0x48504b,_0xcb5b93){return function(_0x3a1e98){if(_0x3a1e98){return _0x3a1e98['update'](_0x48504b)[_0xc7ff('0x20')](function(_0x12ac2a){return _0x12ac2a;});}return null;};}function removeEntity(_0x588c73,_0x4591fb){return function(_0x6efbcd){if(_0x6efbcd){return _0x6efbcd['destroy']()[_0xc7ff('0x20')](function(){_0x588c73[_0xc7ff('0x16')](0xcc)[_0xc7ff('0x17')]();});}};}function handleEntityNotFound(_0x367571,_0x4dc5c){return function(_0x36059a){if(!_0x36059a){_0x367571[_0xc7ff('0x21')](0x194);}return _0x36059a;};}function handleError(_0x57231f,_0x33cb92){_0x33cb92=_0x33cb92||0x1f4;return function(_0x38e3df){logger[_0xc7ff('0x22')](_0x38e3df['stack']);if(_0x38e3df[_0xc7ff('0x23')]){delete _0x38e3df[_0xc7ff('0x23')];}_0x57231f[_0xc7ff('0x16')](_0x33cb92)[_0xc7ff('0x24')](_0x38e3df);};}exports[_0xc7ff('0x25')]=function(_0x466522,_0x597d1e){var _0x31c37f={},_0x15b035={},_0xef0605={'count':0x0,'rows':[]};var _0x498141=_[_0xc7ff('0x26')](db[_0xc7ff('0x27')][_0xc7ff('0x28')],function(_0xdace6f){return{'name':_0xdace6f[_0xc7ff('0x29')],'type':_0xdace6f[_0xc7ff('0x2a')][_0xc7ff('0x2b')]};});_0x15b035['model']=_[_0xc7ff('0x26')](_0x498141,_0xc7ff('0x23'));_0x15b035['query']=_[_0xc7ff('0x2c')](_0x466522[_0xc7ff('0x2d')]);_0x15b035[_0xc7ff('0x2e')]=_[_0xc7ff('0x2f')](_0x15b035[_0xc7ff('0x30')],_0x15b035[_0xc7ff('0x2d')]);_0x31c37f[_0xc7ff('0x31')]=_[_0xc7ff('0x2f')](_0x15b035[_0xc7ff('0x30')],qs[_0xc7ff('0x32')](_0x466522[_0xc7ff('0x2d')]['fields']));_0x31c37f['attributes']=_0x31c37f[_0xc7ff('0x31')][_0xc7ff('0x33')]?_0x31c37f[_0xc7ff('0x31')]:_0x15b035[_0xc7ff('0x30')];if(!_0x466522[_0xc7ff('0x2d')][_0xc7ff('0x34')](_0xc7ff('0x35'))){_0x31c37f[_0xc7ff('0x1b')]=qs[_0xc7ff('0x1b')](_0x466522[_0xc7ff('0x2d')][_0xc7ff('0x1b')]);_0x31c37f['offset']=qs[_0xc7ff('0x19')](_0x466522[_0xc7ff('0x2d')]['offset']);}_0x31c37f[_0xc7ff('0x36')]=qs['sort'](_0x466522['query'][_0xc7ff('0x37')]);_0x31c37f[_0xc7ff('0x38')]=qs[_0xc7ff('0x2e')](_[_0xc7ff('0x39')](_0x466522[_0xc7ff('0x2d')],_0x15b035[_0xc7ff('0x2e')]),_0x498141);if(_0x466522[_0xc7ff('0x2d')][_0xc7ff('0x3a')]){_0x31c37f['where']=_[_0xc7ff('0x3b')](_0x31c37f['where'],{'$or':_[_0xc7ff('0x26')](_0x498141,function(_0x5b4f41){if(_0x5b4f41['type']!==_0xc7ff('0x3c')){var _0x2be7d6={};_0x2be7d6[_0x5b4f41[_0xc7ff('0x23')]]={'$like':'%'+_0x466522[_0xc7ff('0x2d')][_0xc7ff('0x3a')]+'%'};return _0x2be7d6;}})});}_0x31c37f=_[_0xc7ff('0x3b')]({},_0x31c37f,_0x466522[_0xc7ff('0x3d')]);var _0x5703b8={'where':_0x31c37f[_0xc7ff('0x38')]};return db[_0xc7ff('0x27')][_0xc7ff('0x1c')](_0x5703b8)[_0xc7ff('0x20')](function(_0x1c91f2){_0xef0605[_0xc7ff('0x1c')]=_0x1c91f2;if(_0x466522[_0xc7ff('0x2d')]['includeAll']){_0x31c37f[_0xc7ff('0x3e')]=[{'all':!![]}];}return db[_0xc7ff('0x27')][_0xc7ff('0x3f')](_0x31c37f);})[_0xc7ff('0x20')](function(_0xf1b2b){_0xef0605[_0xc7ff('0x40')]=_0xf1b2b;return _0xef0605;})[_0xc7ff('0x20')](respondWithFilteredResult(_0x597d1e,_0x31c37f))[_0xc7ff('0x41')](handleError(_0x597d1e,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a992a89..717cc07 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2753=['rimraf','../../config/environment','exports','define','Migration','migrations','util','../../config/logger','bluebird','request-promise'];(function(_0x4fef3e,_0x35f04a){var _0x59008d=function(_0x242f1b){while(--_0x242f1b){_0x4fef3e['push'](_0x4fef3e['shift']());}};_0x59008d(++_0x35f04a);}(_0x2753,0x132));var _0x3275=function(_0x38fad3,_0x1f9813){_0x38fad3=_0x38fad3-0x0;var _0x4b1a79=_0x2753[_0x38fad3];return _0x4b1a79;};'use strict';var _=require('lodash');var util=require(_0x3275('0x0'));var logger=require(_0x3275('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3275('0x2'));var rp=require(_0x3275('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3275('0x4'));var config=require(_0x3275('0x5'));var attributes=require('./migration.attributes');module[_0x3275('0x6')]=function(_0x4cee10,_0x1a8f46){return _0x4cee10[_0x3275('0x7')](_0x3275('0x8'),attributes,{'tableName':_0x3275('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1052=['path','rimraf','./migration.attributes','exports','Migration','migrations','lodash','util','api','bluebird','request-promise'];(function(_0x25ed73,_0x8a06c0){var _0x2d44ad=function(_0x503673){while(--_0x503673){_0x25ed73['push'](_0x25ed73['shift']());}};_0x2d44ad(++_0x8a06c0);}(_0x1052,0x1b3));var _0x2105=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0x1052[_0x19e08e];return _0x14c229;};'use strict';var _=require(_0x2105('0x0'));var util=require(_0x2105('0x1'));var logger=require('../../config/logger')(_0x2105('0x2'));var moment=require('moment');var BPromise=require(_0x2105('0x3'));var rp=require(_0x2105('0x4'));var fs=require('fs');var path=require(_0x2105('0x5'));var rimraf=require(_0x2105('0x6'));var config=require('../../config/environment');var attributes=require(_0x2105('0x7'));module[_0x2105('0x8')]=function(_0x2b6c56,_0x49f8ff){return _0x2b6c56['define'](_0x2105('0x9'),attributes,{'tableName':_0x2105('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 483fe6d..8d410c2 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f59=['../../config/environment','jayson/promise','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f59,0x1b0));var _0x93f5=function(_0x3a9729,_0x369e8b){_0x3a9729=_0x3a9729-0x0;var _0x6540b5=_0x3f59[_0x3a9729];return _0x6540b5;};'use strict';var _=require(_0x93f5('0x0'));var util=require(_0x93f5('0x1'));var moment=require('moment');var BPromise=require(_0x93f5('0x2'));var rs=require(_0x93f5('0x3'));var fs=require('fs');var Redis=require(_0x93f5('0x4'));var db=require(_0x93f5('0x5'))['db'];var utils=require(_0x93f5('0x6'));var logger=require(_0x93f5('0x7'))(_0x93f5('0x8'));var config=require(_0x93f5('0x9'));var jayson=require(_0x93f5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb86c2d,_0x456295,_0x1e7b4d){return new BPromise(function(_0x24b75b,_0x16e2f6){return client['request'](_0xb86c2d,_0x1e7b4d)['then'](function(_0x491809){logger['info'](_0x93f5('0xb'),_0x456295,_0x93f5('0xc'));logger[_0x93f5('0xd')](_0x93f5('0xe'),_0x456295,'request\x20sent',JSON['stringify'](_0x491809));if(_0x491809[_0x93f5('0xf')]){if(_0x491809[_0x93f5('0xf')][_0x93f5('0x10')]===0x1f4){logger['error'](_0x93f5('0xb'),_0x456295,_0x491809['error'][_0x93f5('0x11')]);return _0x16e2f6(_0x491809[_0x93f5('0xf')][_0x93f5('0x11')]);}logger[_0x93f5('0xf')](_0x93f5('0xb'),_0x456295,_0x491809[_0x93f5('0xf')]['message']);return _0x24b75b(_0x491809[_0x93f5('0xf')][_0x93f5('0x11')]);}else{logger[_0x93f5('0x12')](_0x93f5('0xb'),_0x456295,_0x93f5('0xc'));_0x24b75b(_0x491809[_0x93f5('0x13')][_0x93f5('0x11')]);}})[_0x93f5('0x14')](function(_0x35afc3){logger[_0x93f5('0xf')](_0x93f5('0xb'),_0x456295,_0x35afc3);_0x16e2f6(_0x35afc3);});});} \ No newline at end of file +var _0xac4a=['Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x2578d5,_0x2ac867){_0x2578d5=_0x2578d5-0x0;var _0x31e3a2=_0xac4a[_0x2578d5];return _0x31e3a2;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('Migration,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('Migration,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 938fe09..1de2137 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fad=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports'];(function(_0x50c306,_0x2105f3){var _0xb4eff1=function(_0xceb85e){while(--_0xceb85e){_0x50c306['push'](_0x50c306['shift']());}};_0xb4eff1(++_0x2105f3);}(_0x6fad,0x17a));var _0xd6fa=function(_0x52e94f,_0x22e52d){_0x52e94f=_0x52e94f-0x0;var _0x127d43=_0x6fad[_0x52e94f];return _0x127d43;};'use strict';var multer=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var path=require(_0xd6fa('0x2'));var timeout=require(_0xd6fa('0x3'));var express=require(_0xd6fa('0x4'));var router=express['Router']();var fs_extra=require(_0xd6fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6fa('0x6'));var config=require('../../config/environment');var controller=require(_0xd6fa('0x7'));router['get']('/',auth[_0xd6fa('0x8')](),controller[_0xd6fa('0x9')]);router[_0xd6fa('0xa')](_0xd6fa('0xb'),auth[_0xd6fa('0x8')](),controller[_0xd6fa('0xc')]);router[_0xd6fa('0xd')]('/',auth['isAuthenticated'](),controller[_0xd6fa('0xe')]);router['put'](_0xd6fa('0xb'),auth[_0xd6fa('0x8')](),controller[_0xd6fa('0xf')]);router[_0xd6fa('0x10')](_0xd6fa('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd6fa('0x11')]=router; \ No newline at end of file +var _0xa76e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util','path'];(function(_0x366d33,_0x437c04){var _0x5abd90=function(_0x32e713){while(--_0x32e713){_0x366d33['push'](_0x366d33['shift']());}};_0x5abd90(++_0x437c04);}(_0xa76e,0xfe));var _0xea76=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xa76e[_0x456fb1];return _0x4083d6;};'use strict';var multer=require('multer');var util=require(_0xea76('0x0'));var path=require(_0xea76('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea76('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xea76('0x3'));var interaction=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var controller=require('./network.controller');router[_0xea76('0x6')]('/',auth['isAuthenticated'](),controller[_0xea76('0x7')]);router['get'](_0xea76('0x8'),auth[_0xea76('0x9')](),controller['show']);router['post']('/',auth[_0xea76('0x9')](),controller[_0xea76('0xa')]);router[_0xea76('0xb')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xc')]);router[_0xea76('0xd')](_0xea76('0x8'),auth['isAuthenticated'](),controller[_0xea76('0xe')]);module[_0xea76('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 208fb73..b5768fa 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb8c=['ENUM','externip','turn','STRING','sequelize','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xdb8c,0x70));var _0xcdb8=function(_0x340bf6,_0x277b81){_0x340bf6=_0x340bf6-0x0;var _0x239149=_0xdb8c[_0x340bf6];return _0x239149;};'use strict';var Sequelize=require(_0xcdb8('0x0'));module[_0xcdb8('0x1')]={'type':{'type':Sequelize[_0xcdb8('0x2')]('localnet',_0xcdb8('0x3'),'stun',_0xcdb8('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcdb8('0x5')]},'password':{'type':Sequelize[_0xcdb8('0x5')]}}; \ No newline at end of file +var _0x47b2=['exports','stun','turn','STRING','sequelize'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x47b2,0x16c));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x247b('0x0'));module[_0x247b('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip',_0x247b('0x2'),_0x247b('0x3'))},'value':{'type':Sequelize[_0x247b('0x4')]},'username':{'type':Sequelize[_0x247b('0x4')]},'password':{'type':Sequelize[_0x247b('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4cfa174..a989a21 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','fields','catch','sequelize','transaction','create','body','type','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','Reload','res_stun_monitor.so','toUpperCase','TURN','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','find','/etc/asterisk/stun_xcally.conf','toLowerCase','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','sendStatus','stack','index','map','Network','rawAttributes','fieldName','key','model','name'];(function(_0x4a1a73,_0x22bfdc){var _0xaf1c2d=function(_0x5a3387){while(--_0x5a3387){_0x4a1a73['push'](_0x4a1a73['shift']());}};_0xaf1c2d(++_0x22bfdc);}(_0x66fa,0x168));var _0xa66f=function(_0x1f64ec,_0x15558a){_0x1f64ec=_0x1f64ec-0x0;var _0x57e1dd=_0x66fa[_0x1f64ec];return _0x57e1dd;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require(_0xa66f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var Mustache=require(_0xa66f('0x5'));var util=require(_0xa66f('0x6'));var path=require(_0xa66f('0x7'));var sox=require(_0xa66f('0x8'));var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var fs_extra=require(_0xa66f('0xb'));var _=require(_0xa66f('0xc'));var squel=require(_0xa66f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa66f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa66f('0x9'));var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require(_0xa66f('0x11'));var qs=require(_0xa66f('0x12'));var as=require(_0xa66f('0x13'));var hardwareService=require(_0xa66f('0x14'));var logger=require(_0xa66f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa66f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x17'))['db'];var jayson=require(_0xa66f('0x18'));var client=jayson[_0xa66f('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26030b,_0x1a1ab2,_0x4ad224,_0xaa9ef5){return new BPromise(function(_0x24423a,_0x263e64){var _0x96a262=_0xaa9ef5||client;return _0x96a262['request'](_0x26030b,_0x4ad224)[_0xa66f('0x1a')](function(_0x27f04e){logger['info'](_0xa66f('0x1b'),_0x1a1ab2,_0xa66f('0x1c'));logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x1a1ab2,_0xa66f('0x1c'),JSON[_0xa66f('0x1f')](_0x27f04e));if(_0x27f04e['error']){if(_0x27f04e['error'][_0xa66f('0x20')]===0x1f4){logger[_0xa66f('0x21')](_0xa66f('0x1b'),_0x1a1ab2,_0x27f04e[_0xa66f('0x21')]['message']);return _0x263e64(_0x27f04e[_0xa66f('0x21')][_0xa66f('0x22')]);}logger['error'](_0xa66f('0x1b'),_0x1a1ab2,_0x27f04e['error'][_0xa66f('0x22')]);return _0x24423a(_0x27f04e[_0xa66f('0x21')]['message']);}else{logger['info'](_0xa66f('0x1b'),_0x1a1ab2,'request\x20sent');_0x24423a(_0x27f04e['result']['message']);}})['catch'](function(_0x40ec74){logger[_0xa66f('0x21')](_0xa66f('0x1b'),_0x1a1ab2,_0x40ec74);_0x263e64(_0x40ec74);});});}function respondWithStatusCode(_0x4cfec6,_0x20bf81){_0x20bf81=_0x20bf81||0xcc;return function(_0xe5e0f1){if(_0xe5e0f1){return _0x4cfec6['sendStatus'](_0x20bf81);}return _0x4cfec6[_0xa66f('0x23')](_0x20bf81)[_0xa66f('0x24')]();};}function respondWithResult(_0xf6f0b8,_0x29dfe5){_0x29dfe5=_0x29dfe5||0xc8;return function(_0xa90ae0){if(_0xa90ae0){return _0xf6f0b8[_0xa66f('0x23')](_0x29dfe5)['json'](_0xa90ae0);}};}function respondWithFilteredResult(_0x56e23e,_0x272f1e){return function(_0x5a03f7){if(_0x5a03f7){var _0x45dc65=typeof _0x272f1e[_0xa66f('0x25')]===_0xa66f('0x26')&&typeof _0x272f1e['limit']===_0xa66f('0x26');var _0x4ca0a4=_0x5a03f7['count'];var _0x4c7b82=_0x45dc65?0x0:_0x272f1e[_0xa66f('0x25')];var _0x502e6e=_0x45dc65?_0x5a03f7[_0xa66f('0x27')]:_0x272f1e[_0xa66f('0x25')]+_0x272f1e[_0xa66f('0x28')];var _0x5f253f;if(_0x502e6e>=_0x4ca0a4){_0x502e6e=_0x4ca0a4;_0x5f253f=0xc8;}else{_0x5f253f=0xce;}_0x56e23e['status'](_0x5f253f);return _0x56e23e[_0xa66f('0x29')](_0xa66f('0x2a'),_0x4c7b82+'-'+_0x502e6e+'/'+_0x4ca0a4)[_0xa66f('0x2b')](_0x5a03f7);}return null;};}function patchUpdates(_0x5583eb){return function(_0x46c525){try{jsonpatch['apply'](_0x46c525,_0x5583eb,!![]);}catch(_0x6be926){return BPromise[_0xa66f('0x2c')](_0x6be926);}return _0x46c525[_0xa66f('0x2d')]();};}function saveUpdates(_0x36525b,_0x2a1e6b){return function(_0x265b50){if(_0x265b50){return _0x265b50['update'](_0x36525b)[_0xa66f('0x1a')](function(_0x42fbe4){return _0x42fbe4;});}return null;};}function removeEntity(_0x4ce0d3,_0x1d37c2){return function(_0x40802d){if(_0x40802d){return _0x40802d['destroy']()['then'](function(){_0x4ce0d3[_0xa66f('0x23')](0xcc)[_0xa66f('0x24')]();});}};}function handleEntityNotFound(_0x42aa69,_0x276ca3){return function(_0x351656){if(!_0x351656){_0x42aa69[_0xa66f('0x2e')](0x194);}return _0x351656;};}function handleError(_0x5d9f31,_0x3bba31){_0x3bba31=_0x3bba31||0x1f4;return function(_0x16b375){logger[_0xa66f('0x21')](_0x16b375[_0xa66f('0x2f')]);if(_0x16b375['name']){delete _0x16b375['name'];}_0x5d9f31[_0xa66f('0x23')](_0x3bba31)['send'](_0x16b375);};}exports[_0xa66f('0x30')]=function(_0x3d71f0,_0x5d8814){var _0x1d95e7={},_0x1361c8={},_0x28caf6={'count':0x0,'rows':[]};var _0x343cdc=_[_0xa66f('0x31')](db[_0xa66f('0x32')][_0xa66f('0x33')],function(_0xdc06ac){return{'name':_0xdc06ac[_0xa66f('0x34')],'type':_0xdc06ac['type'][_0xa66f('0x35')]};});_0x1361c8[_0xa66f('0x36')]=_['map'](_0x343cdc,_0xa66f('0x37'));_0x1361c8['query']=_[_0xa66f('0x38')](_0x3d71f0[_0xa66f('0x39')]);_0x1361c8[_0xa66f('0x3a')]=_[_0xa66f('0x3b')](_0x1361c8['model'],_0x1361c8[_0xa66f('0x39')]);_0x1d95e7[_0xa66f('0x3c')]=_[_0xa66f('0x3b')](_0x1361c8[_0xa66f('0x36')],qs['fields'](_0x3d71f0[_0xa66f('0x39')]['fields']));_0x1d95e7[_0xa66f('0x3c')]=_0x1d95e7[_0xa66f('0x3c')][_0xa66f('0x3d')]?_0x1d95e7[_0xa66f('0x3c')]:_0x1361c8['model'];if(!_0x3d71f0[_0xa66f('0x39')]['hasOwnProperty'](_0xa66f('0x3e'))){_0x1d95e7[_0xa66f('0x28')]=qs[_0xa66f('0x28')](_0x3d71f0[_0xa66f('0x39')][_0xa66f('0x28')]);_0x1d95e7[_0xa66f('0x25')]=qs[_0xa66f('0x25')](_0x3d71f0[_0xa66f('0x39')][_0xa66f('0x25')]);}_0x1d95e7[_0xa66f('0x3f')]=qs[_0xa66f('0x40')](_0x3d71f0[_0xa66f('0x39')][_0xa66f('0x40')]);_0x1d95e7[_0xa66f('0x41')]=qs[_0xa66f('0x3a')](_['pick'](_0x3d71f0[_0xa66f('0x39')],_0x1361c8[_0xa66f('0x3a')]),_0x343cdc);if(_0x3d71f0[_0xa66f('0x39')]['filter']){_0x1d95e7[_0xa66f('0x41')]=_['merge'](_0x1d95e7[_0xa66f('0x41')],{'$or':_[_0xa66f('0x31')](_0x343cdc,function(_0x30ebd8){if(_0x30ebd8['type']!=='VIRTUAL'){var _0x23c659={};_0x23c659[_0x30ebd8[_0xa66f('0x37')]]={'$like':'%'+_0x3d71f0[_0xa66f('0x39')][_0xa66f('0x42')]+'%'};return _0x23c659;}})});}_0x1d95e7=_[_0xa66f('0x43')]({},_0x1d95e7,_0x3d71f0[_0xa66f('0x44')]);var _0x4eea29={'where':_0x1d95e7[_0xa66f('0x41')]};return db[_0xa66f('0x32')]['count'](_0x4eea29)['then'](function(_0x1e8806){_0x28caf6[_0xa66f('0x27')]=_0x1e8806;if(_0x3d71f0[_0xa66f('0x39')][_0xa66f('0x45')]){_0x1d95e7[_0xa66f('0x46')]=[{'all':!![]}];}return db['Network'][_0xa66f('0x47')](_0x1d95e7);})[_0xa66f('0x1a')](function(_0x3aa272){_0x28caf6[_0xa66f('0x48')]=_0x3aa272;return _0x28caf6;})[_0xa66f('0x1a')](respondWithFilteredResult(_0x5d8814,_0x1d95e7))['catch'](handleError(_0x5d8814,null));};exports[_0xa66f('0x49')]=function(_0x2a7942,_0x1ffd50){var _0x2dc004={'raw':!![],'where':{'id':_0x2a7942['params']['id']}},_0x35108c={};_0x35108c['model']=_[_0xa66f('0x38')](db[_0xa66f('0x32')][_0xa66f('0x33')]);_0x35108c[_0xa66f('0x39')]=_[_0xa66f('0x38')](_0x2a7942[_0xa66f('0x39')]);_0x35108c[_0xa66f('0x3a')]=_[_0xa66f('0x3b')](_0x35108c['model'],_0x35108c[_0xa66f('0x39')]);_0x2dc004[_0xa66f('0x3c')]=_[_0xa66f('0x3b')](_0x35108c[_0xa66f('0x36')],qs[_0xa66f('0x4a')](_0x2a7942['query'][_0xa66f('0x4a')]));_0x2dc004[_0xa66f('0x3c')]=_0x2dc004[_0xa66f('0x3c')]['length']?_0x2dc004['attributes']:_0x35108c[_0xa66f('0x36')];if(_0x2a7942[_0xa66f('0x39')][_0xa66f('0x45')]){_0x2dc004[_0xa66f('0x46')]=[{'all':!![]}];}_0x2dc004=_[_0xa66f('0x43')]({},_0x2dc004,_0x2a7942['options']);return db[_0xa66f('0x32')]['find'](_0x2dc004)[_0xa66f('0x1a')](handleEntityNotFound(_0x1ffd50,null))[_0xa66f('0x1a')](respondWithResult(_0x1ffd50,null))[_0xa66f('0x4b')](handleError(_0x1ffd50,null));};exports['create']=function(_0x11b725,_0x5edef9,_0x1a7e34){var _0x3ed06d;return db[_0xa66f('0x4c')][_0xa66f('0x4d')](function(_0x1a8b53){return db[_0xa66f('0x32')][_0xa66f('0x4e')](_0x11b725['body'],{'raw':!![]})['then'](function(_0x513feb){_0x3ed06d=_0x513feb;return db[_0xa66f('0x32')][_0xa66f('0x47')]({'where':{'type':_0x11b725[_0xa66f('0x4f')][_0xa66f('0x50')]},'raw':!![]});})[_0xa66f('0x1a')](function(_0x2c8ede){if(_0x3ed06d[_0xa66f('0x50')]['toUpperCase']()==_0xa66f('0x51')){var _0x56269b=fs[_0xa66f('0x52')](path[_0xa66f('0x53')](config['root'],_0xa66f('0x54')),_0xa66f('0x55'));var _0x3d04aa=ejs['render'](_0x56269b,{'networks':_0x2c8ede||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x3d04aa);return respondWithRpcPromise(_0xa66f('0x56'),'create',{'module':_0xa66f('0x57')});}else if(_0x3ed06d['type'][_0xa66f('0x58')]()==_0xa66f('0x59')){var _0x550c4c=fs['readFileSync'](path['join'](config[_0xa66f('0x5a')],_0xa66f('0x5b')),_0xa66f('0x55'));var _0x1ebc02=ejs[_0xa66f('0x5c')](_0x550c4c,{'networks':_0x2c8ede||[]});fs['writeFileSync'](_0xa66f('0x5d'),_0x1ebc02);return respondWithRpcPromise(_0xa66f('0x56'),'create',{'module':'res_stun_monitor.so'});}else{var _0x436c35=fs[_0xa66f('0x52')](path[_0xa66f('0x53')](config[_0xa66f('0x5a')],_0xa66f('0x5e')),_0xa66f('0x55'));var _0x3028f3=ejs[_0xa66f('0x5c')](_0x436c35,{'networks':_0x2c8ede||[]});fs[_0xa66f('0x5f')](util[_0xa66f('0x60')](_0xa66f('0x61'),_0x11b725[_0xa66f('0x4f')][_0xa66f('0x50')]['toLowerCase']()),_0x3028f3);return respondWithRpcPromise(_0xa66f('0x56'),'create',{'module':_0xa66f('0x62')});}return null;})[_0xa66f('0x1a')](function(){return _0x3ed06d;});})[_0xa66f('0x1a')](respondWithResult(_0x5edef9,0xc9))[_0xa66f('0x4b')](handleError(_0x5edef9,null));};exports[_0xa66f('0x63')]=function(_0x1b5f02,_0x39eede,_0x1372ab){var _0x3a052a;return db[_0xa66f('0x4c')][_0xa66f('0x4d')](function(_0x23582c){return db[_0xa66f('0x32')][_0xa66f('0x64')]({'where':{'id':_0x1b5f02['params']['id']}})[_0xa66f('0x1a')](handleEntityNotFound(_0x39eede,null))[_0xa66f('0x1a')](saveUpdates(_0x1b5f02[_0xa66f('0x4f')],null))[_0xa66f('0x1a')](function(_0x5e5d1c){if(_0x5e5d1c){_0x3a052a=_0x5e5d1c;return db[_0xa66f('0x32')][_0xa66f('0x47')]({'where':{'type':_0x3a052a['type']},'raw':!![]});}return null;})['then'](function(_0x397257){if(_0x3a052a[_0xa66f('0x50')][_0xa66f('0x58')]()==_0xa66f('0x51')){var _0x4bb7ae=fs[_0xa66f('0x52')](path[_0xa66f('0x53')](config[_0xa66f('0x5a')],_0xa66f('0x54')),_0xa66f('0x55'));var _0x38696c=ejs[_0xa66f('0x5c')](_0x4bb7ae,{'networks':_0x397257||[]});fs[_0xa66f('0x5f')](_0xa66f('0x65'),_0x38696c);return respondWithRpcPromise(_0xa66f('0x56'),_0xa66f('0x63'),{'module':'res_stun_monitor.so'});}else if(_0x3a052a[_0xa66f('0x50')]['toUpperCase']()==_0xa66f('0x59')){var _0x2998be=fs[_0xa66f('0x52')](path[_0xa66f('0x53')](config[_0xa66f('0x5a')],_0xa66f('0x5b')),_0xa66f('0x55'));var _0x5ce85d=ejs[_0xa66f('0x5c')](_0x2998be,{'networks':_0x397257||[]});fs[_0xa66f('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x5ce85d);return respondWithRpcPromise('Reload',_0xa66f('0x63'),{'module':_0xa66f('0x57')});}else{var _0x1c9f12=fs[_0xa66f('0x52')](path['join'](config[_0xa66f('0x5a')],_0xa66f('0x5e')),_0xa66f('0x55'));var _0xe929e=ejs[_0xa66f('0x5c')](_0x1c9f12,{'networks':_0x397257||[]});fs[_0xa66f('0x5f')](util[_0xa66f('0x60')]('/etc/asterisk/sip_xcally_%s.conf',_0x1b5f02[_0xa66f('0x4f')][_0xa66f('0x50')][_0xa66f('0x66')]()),_0xe929e);return respondWithRpcPromise('Reload',_0xa66f('0x63'),{'module':_0xa66f('0x62')});}return null;})['then'](function(_0x3768b7){if(_0x3768b7){return _0x3a052a;}return null;});})[_0xa66f('0x1a')](respondWithResult(_0x39eede,null))['catch'](handleError(_0x39eede,null));};exports[_0xa66f('0x67')]=function(_0x1a0f63,_0x1d29d9,_0x1b3606){var _0x95e77e;return db[_0xa66f('0x32')]['find']({'where':{'id':_0x1a0f63['params']['id']}})[_0xa66f('0x1a')](function(_0x37edce){_0x95e77e=_0x37edce;return _0x37edce;})[_0xa66f('0x1a')](handleEntityNotFound(_0x1d29d9,null))[_0xa66f('0x1a')](removeEntity(_0x1d29d9,null))['then'](function(){if(_0x95e77e){return db[_0xa66f('0x32')][_0xa66f('0x47')]({'where':{'type':_0x95e77e['type']},'raw':!![]});}})[_0xa66f('0x1a')](function(_0xa0abb6){if(_0x95e77e[_0xa66f('0x50')]['toUpperCase']()==_0xa66f('0x51')){var _0x15a2e6=fs[_0xa66f('0x52')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xa66f('0x55'));var _0xf696fb=ejs[_0xa66f('0x5c')](_0x15a2e6,{'networks':_0xa0abb6||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0xf696fb);return respondWithRpcPromise(_0xa66f('0x56'),_0xa66f('0x67'),{'module':_0xa66f('0x57')});}else if(_0x95e77e[_0xa66f('0x50')][_0xa66f('0x58')]()==_0xa66f('0x59')){var _0x5302f5=fs[_0xa66f('0x52')](path['join'](config[_0xa66f('0x5a')],_0xa66f('0x5b')),_0xa66f('0x55'));var _0x23dc5a=ejs[_0xa66f('0x5c')](_0x5302f5,{'networks':_0xa0abb6||[]});fs[_0xa66f('0x5f')](_0xa66f('0x5d'),_0x23dc5a);return respondWithRpcPromise('Reload',_0xa66f('0x67'),{'module':'res_stun_monitor.so'});}else{var _0x39b0df=fs[_0xa66f('0x52')](path[_0xa66f('0x53')](config[_0xa66f('0x5a')],_0xa66f('0x5e')),_0xa66f('0x55'));var _0x16b100=ejs[_0xa66f('0x5c')](_0x39b0df,{'networks':_0xa0abb6||[]});fs['writeFileSync'](util[_0xa66f('0x60')](_0xa66f('0x61'),_0x1a0f63[_0xa66f('0x4f')][_0xa66f('0x50')]['toLowerCase']()),_0x16b100);return respondWithRpcPromise(_0xa66f('0x56'),_0xa66f('0x67'),{'module':_0xa66f('0x62')});}return null;})[_0xa66f('0x4b')](handleError(_0x1d29d9,null));}; \ No newline at end of file +var _0xec1b=['includeAll','findAll','rows','show','params','keys','include','find','create','body','toUpperCase','STUN','readFileSync','join','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','utf8','render','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','transaction','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Network','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options'];(function(_0x187842,_0x58331c){var _0x5dbcf3=function(_0x55faef){while(--_0x55faef){_0x187842['push'](_0x187842['shift']());}};_0x5dbcf3(++_0x58331c);}(_0xec1b,0xf5));var _0xbec1=function(_0x184cc6,_0x4961ee){_0x184cc6=_0x184cc6-0x0;var _0x3f7435=_0xec1b[_0x184cc6];return _0x3f7435;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbec1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbec1('0x1'));var rp=require(_0xbec1('0x2'));var moment=require(_0xbec1('0x3'));var BPromise=require(_0xbec1('0x4'));var Mustache=require(_0xbec1('0x5'));var util=require(_0xbec1('0x6'));var path=require(_0xbec1('0x7'));var sox=require('sox');var csv=require(_0xbec1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbec1('0x9'));var _=require(_0xbec1('0xa'));var squel=require(_0xbec1('0xb'));var crypto=require(_0xbec1('0xc'));var jsforce=require(_0xbec1('0xd'));var deskjs=require(_0xbec1('0xe'));var toCsv=require(_0xbec1('0x8'));var querystring=require(_0xbec1('0xf'));var Papa=require(_0xbec1('0x10'));var Redis=require('ioredis');var authService=require(_0xbec1('0x11'));var qs=require(_0xbec1('0x12'));var as=require(_0xbec1('0x13'));var hardwareService=require(_0xbec1('0x14'));var logger=require(_0xbec1('0x15'))('api');var utils=require(_0xbec1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbec1('0x17'))['db'];var jayson=require(_0xbec1('0x18'));var client=jayson[_0xbec1('0x19')][_0xbec1('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xbc51d2,_0x1ff0ea,_0xa11574,_0x51ebec){return new BPromise(function(_0x489b79,_0x3a8f8a){var _0x3468b7=_0x51ebec||client;return _0x3468b7[_0xbec1('0x1b')](_0xbc51d2,_0xa11574)['then'](function(_0x5c2481){logger[_0xbec1('0x1c')](_0xbec1('0x1d'),_0x1ff0ea,'request\x20sent');logger[_0xbec1('0x1e')](_0xbec1('0x1f'),_0x1ff0ea,'request\x20sent',JSON[_0xbec1('0x20')](_0x5c2481));if(_0x5c2481['error']){if(_0x5c2481[_0xbec1('0x21')][_0xbec1('0x22')]===0x1f4){logger[_0xbec1('0x21')](_0xbec1('0x1d'),_0x1ff0ea,_0x5c2481['error'][_0xbec1('0x23')]);return _0x3a8f8a(_0x5c2481['error']['message']);}logger['error']('Network,\x20%s,\x20%s',_0x1ff0ea,_0x5c2481[_0xbec1('0x21')][_0xbec1('0x23')]);return _0x489b79(_0x5c2481[_0xbec1('0x21')][_0xbec1('0x23')]);}else{logger[_0xbec1('0x1c')](_0xbec1('0x1d'),_0x1ff0ea,_0xbec1('0x24'));_0x489b79(_0x5c2481[_0xbec1('0x25')][_0xbec1('0x23')]);}})[_0xbec1('0x26')](function(_0xec2b38){logger['error'](_0xbec1('0x1d'),_0x1ff0ea,_0xec2b38);_0x3a8f8a(_0xec2b38);});});}function respondWithStatusCode(_0x475db9,_0x5639e2){_0x5639e2=_0x5639e2||0xcc;return function(_0x4143f5){if(_0x4143f5){return _0x475db9[_0xbec1('0x27')](_0x5639e2);}return _0x475db9[_0xbec1('0x28')](_0x5639e2)[_0xbec1('0x29')]();};}function respondWithResult(_0x1e56ee,_0xe2a8c5){_0xe2a8c5=_0xe2a8c5||0xc8;return function(_0x25e5f4){if(_0x25e5f4){return _0x1e56ee[_0xbec1('0x28')](_0xe2a8c5)[_0xbec1('0x2a')](_0x25e5f4);}};}function respondWithFilteredResult(_0x540b09,_0x47b78c){return function(_0x2fd4fc){if(_0x2fd4fc){var _0x5807d1=typeof _0x47b78c['offset']===_0xbec1('0x2b')&&typeof _0x47b78c['limit']===_0xbec1('0x2b');var _0x364c52=_0x2fd4fc[_0xbec1('0x2c')];var _0x481dc3=_0x5807d1?0x0:_0x47b78c[_0xbec1('0x2d')];var _0x409716=_0x5807d1?_0x2fd4fc[_0xbec1('0x2c')]:_0x47b78c[_0xbec1('0x2d')]+_0x47b78c[_0xbec1('0x2e')];var _0x2b2b89;if(_0x409716>=_0x364c52){_0x409716=_0x364c52;_0x2b2b89=0xc8;}else{_0x2b2b89=0xce;}_0x540b09['status'](_0x2b2b89);return _0x540b09['set'](_0xbec1('0x2f'),_0x481dc3+'-'+_0x409716+'/'+_0x364c52)[_0xbec1('0x2a')](_0x2fd4fc);}return null;};}function patchUpdates(_0x5bdf37){return function(_0x461571){try{jsonpatch[_0xbec1('0x30')](_0x461571,_0x5bdf37,!![]);}catch(_0x2cf05e){return BPromise[_0xbec1('0x31')](_0x2cf05e);}return _0x461571[_0xbec1('0x32')]();};}function saveUpdates(_0x1bf487,_0x3ca5da){return function(_0x2d98bc){if(_0x2d98bc){return _0x2d98bc[_0xbec1('0x33')](_0x1bf487)[_0xbec1('0x34')](function(_0x125938){return _0x125938;});}return null;};}function removeEntity(_0x40a859,_0xd06a74){return function(_0xba3c01){if(_0xba3c01){return _0xba3c01[_0xbec1('0x35')]()[_0xbec1('0x34')](function(){_0x40a859[_0xbec1('0x28')](0xcc)[_0xbec1('0x29')]();});}};}function handleEntityNotFound(_0x511ec2,_0x1c9a06){return function(_0xe772b1){if(!_0xe772b1){_0x511ec2[_0xbec1('0x27')](0x194);}return _0xe772b1;};}function handleError(_0x4fee01,_0x2d2ff7){_0x2d2ff7=_0x2d2ff7||0x1f4;return function(_0x172b82){logger['error'](_0x172b82[_0xbec1('0x36')]);if(_0x172b82[_0xbec1('0x37')]){delete _0x172b82['name'];}_0x4fee01[_0xbec1('0x28')](_0x2d2ff7)['send'](_0x172b82);};}exports[_0xbec1('0x38')]=function(_0x4b2523,_0x11ebc8){var _0x265658={},_0x54f658={},_0x21b5eb={'count':0x0,'rows':[]};var _0x44768c=_[_0xbec1('0x39')](db[_0xbec1('0x3a')][_0xbec1('0x3b')],function(_0x2d9158){return{'name':_0x2d9158['fieldName'],'type':_0x2d9158[_0xbec1('0x3c')]['key']};});_0x54f658[_0xbec1('0x3d')]=_[_0xbec1('0x39')](_0x44768c,_0xbec1('0x37'));_0x54f658['query']=_['keys'](_0x4b2523[_0xbec1('0x3e')]);_0x54f658['filters']=_[_0xbec1('0x3f')](_0x54f658[_0xbec1('0x3d')],_0x54f658[_0xbec1('0x3e')]);_0x265658[_0xbec1('0x40')]=_[_0xbec1('0x3f')](_0x54f658['model'],qs[_0xbec1('0x41')](_0x4b2523[_0xbec1('0x3e')]['fields']));_0x265658[_0xbec1('0x40')]=_0x265658['attributes'][_0xbec1('0x42')]?_0x265658[_0xbec1('0x40')]:_0x54f658[_0xbec1('0x3d')];if(!_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x43')](_0xbec1('0x44'))){_0x265658[_0xbec1('0x2e')]=qs[_0xbec1('0x2e')](_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x2e')]);_0x265658['offset']=qs['offset'](_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x2d')]);}_0x265658['order']=qs[_0xbec1('0x45')](_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x45')]);_0x265658['where']=qs[_0xbec1('0x46')](_[_0xbec1('0x47')](_0x4b2523[_0xbec1('0x3e')],_0x54f658['filters']),_0x44768c);if(_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x48')]){_0x265658[_0xbec1('0x49')]=_[_0xbec1('0x4a')](_0x265658[_0xbec1('0x49')],{'$or':_[_0xbec1('0x39')](_0x44768c,function(_0x4cc6ab){if(_0x4cc6ab[_0xbec1('0x3c')]!=='VIRTUAL'){var _0x4fa78c={};_0x4fa78c[_0x4cc6ab['name']]={'$like':'%'+_0x4b2523['query'][_0xbec1('0x48')]+'%'};return _0x4fa78c;}})});}_0x265658=_[_0xbec1('0x4a')]({},_0x265658,_0x4b2523[_0xbec1('0x4b')]);var _0x5481bb={'where':_0x265658[_0xbec1('0x49')]};return db[_0xbec1('0x3a')][_0xbec1('0x2c')](_0x5481bb)[_0xbec1('0x34')](function(_0x5da202){_0x21b5eb['count']=_0x5da202;if(_0x4b2523[_0xbec1('0x3e')][_0xbec1('0x4c')]){_0x265658['include']=[{'all':!![]}];}return db['Network'][_0xbec1('0x4d')](_0x265658);})[_0xbec1('0x34')](function(_0x3fdc98){_0x21b5eb[_0xbec1('0x4e')]=_0x3fdc98;return _0x21b5eb;})[_0xbec1('0x34')](respondWithFilteredResult(_0x11ebc8,_0x265658))[_0xbec1('0x26')](handleError(_0x11ebc8,null));};exports[_0xbec1('0x4f')]=function(_0x507388,_0xb0acee){var _0x352064={'raw':!![],'where':{'id':_0x507388[_0xbec1('0x50')]['id']}},_0x3503e3={};_0x3503e3[_0xbec1('0x3d')]=_['keys'](db['Network'][_0xbec1('0x3b')]);_0x3503e3['query']=_[_0xbec1('0x51')](_0x507388[_0xbec1('0x3e')]);_0x3503e3[_0xbec1('0x46')]=_[_0xbec1('0x3f')](_0x3503e3[_0xbec1('0x3d')],_0x3503e3['query']);_0x352064[_0xbec1('0x40')]=_[_0xbec1('0x3f')](_0x3503e3[_0xbec1('0x3d')],qs[_0xbec1('0x41')](_0x507388['query']['fields']));_0x352064[_0xbec1('0x40')]=_0x352064['attributes'][_0xbec1('0x42')]?_0x352064['attributes']:_0x3503e3[_0xbec1('0x3d')];if(_0x507388[_0xbec1('0x3e')][_0xbec1('0x4c')]){_0x352064[_0xbec1('0x52')]=[{'all':!![]}];}_0x352064=_['merge']({},_0x352064,_0x507388[_0xbec1('0x4b')]);return db[_0xbec1('0x3a')][_0xbec1('0x53')](_0x352064)[_0xbec1('0x34')](handleEntityNotFound(_0xb0acee,null))['then'](respondWithResult(_0xb0acee,null))[_0xbec1('0x26')](handleError(_0xb0acee,null));};exports[_0xbec1('0x54')]=function(_0x407d78,_0x3f5142,_0x25726d){var _0x2ccb5f;return db['sequelize']['transaction'](function(_0x1ef48c){return db[_0xbec1('0x3a')]['create'](_0x407d78[_0xbec1('0x55')],{'raw':!![]})[_0xbec1('0x34')](function(_0x36c515){_0x2ccb5f=_0x36c515;return db[_0xbec1('0x3a')][_0xbec1('0x4d')]({'where':{'type':_0x407d78[_0xbec1('0x55')][_0xbec1('0x3c')]},'raw':!![]});})[_0xbec1('0x34')](function(_0x3827dc){if(_0x2ccb5f[_0xbec1('0x3c')][_0xbec1('0x56')]()==_0xbec1('0x57')){var _0x412086=fs[_0xbec1('0x58')](path[_0xbec1('0x59')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x34e69a=ejs['render'](_0x412086,{'networks':_0x3827dc||[]});fs[_0xbec1('0x5a')](_0xbec1('0x5b'),_0x34e69a);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x54'),{'module':_0xbec1('0x5d')});}else if(_0x2ccb5f[_0xbec1('0x3c')][_0xbec1('0x56')]()==_0xbec1('0x5e')){var _0x4d2818=fs[_0xbec1('0x58')](path['join'](config[_0xbec1('0x5f')],'server/files/templates/turn_multiple.ejs'),_0xbec1('0x60'));var _0x294184=ejs[_0xbec1('0x61')](_0x4d2818,{'networks':_0x3827dc||[]});fs[_0xbec1('0x5a')](_0xbec1('0x62'),_0x294184);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x54'),{'module':_0xbec1('0x5d')});}else{var _0x354406=fs['readFileSync'](path[_0xbec1('0x59')](config[_0xbec1('0x5f')],'server/files/templates/network.ejs'),'utf8');var _0x4570b1=ejs[_0xbec1('0x61')](_0x354406,{'networks':_0x3827dc||[]});fs['writeFileSync'](util[_0xbec1('0x63')](_0xbec1('0x64'),_0x407d78[_0xbec1('0x55')][_0xbec1('0x3c')][_0xbec1('0x65')]()),_0x4570b1);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x54'),{'module':_0xbec1('0x66')});}return null;})[_0xbec1('0x34')](function(){return _0x2ccb5f;});})[_0xbec1('0x34')](respondWithResult(_0x3f5142,0xc9))[_0xbec1('0x26')](handleError(_0x3f5142,null));};exports[_0xbec1('0x33')]=function(_0x1d81aa,_0x392a1e,_0x13183f){var _0x30eaa4;return db[_0xbec1('0x67')][_0xbec1('0x68')](function(_0x3fb524){return db[_0xbec1('0x3a')][_0xbec1('0x53')]({'where':{'id':_0x1d81aa[_0xbec1('0x50')]['id']}})[_0xbec1('0x34')](handleEntityNotFound(_0x392a1e,null))[_0xbec1('0x34')](saveUpdates(_0x1d81aa[_0xbec1('0x55')],null))[_0xbec1('0x34')](function(_0x5a44d6){if(_0x5a44d6){_0x30eaa4=_0x5a44d6;return db[_0xbec1('0x3a')][_0xbec1('0x4d')]({'where':{'type':_0x30eaa4['type']},'raw':!![]});}return null;})['then'](function(_0x5c91ec){if(_0x30eaa4[_0xbec1('0x3c')][_0xbec1('0x56')]()==_0xbec1('0x57')){var _0x2c072d=fs['readFileSync'](path[_0xbec1('0x59')](config[_0xbec1('0x5f')],_0xbec1('0x69')),'utf8');var _0x5a2a2c=ejs['render'](_0x2c072d,{'networks':_0x5c91ec||[]});fs[_0xbec1('0x5a')](_0xbec1('0x5b'),_0x5a2a2c);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x33'),{'module':_0xbec1('0x5d')});}else if(_0x30eaa4['type']['toUpperCase']()==_0xbec1('0x5e')){var _0x36314b=fs[_0xbec1('0x58')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0xbec1('0x60'));var _0x395092=ejs[_0xbec1('0x61')](_0x36314b,{'networks':_0x5c91ec||[]});fs[_0xbec1('0x5a')](_0xbec1('0x62'),_0x395092);return respondWithRpcPromise('Reload',_0xbec1('0x33'),{'module':_0xbec1('0x5d')});}else{var _0x44acaa=fs[_0xbec1('0x58')](path['join'](config['root'],_0xbec1('0x6a')),'utf8');var _0x47e301=ejs[_0xbec1('0x61')](_0x44acaa,{'networks':_0x5c91ec||[]});fs[_0xbec1('0x5a')](util[_0xbec1('0x63')](_0xbec1('0x64'),_0x1d81aa[_0xbec1('0x55')][_0xbec1('0x3c')]['toLowerCase']()),_0x47e301);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x33'),{'module':_0xbec1('0x66')});}return null;})[_0xbec1('0x34')](function(_0x2c8d58){if(_0x2c8d58){return _0x30eaa4;}return null;});})['then'](respondWithResult(_0x392a1e,null))[_0xbec1('0x26')](handleError(_0x392a1e,null));};exports[_0xbec1('0x35')]=function(_0x5e0f33,_0x126185,_0x298ed9){var _0xd152b9;return db['Network'][_0xbec1('0x53')]({'where':{'id':_0x5e0f33[_0xbec1('0x50')]['id']}})[_0xbec1('0x34')](function(_0x293708){_0xd152b9=_0x293708;return _0x293708;})[_0xbec1('0x34')](handleEntityNotFound(_0x126185,null))[_0xbec1('0x34')](removeEntity(_0x126185,null))[_0xbec1('0x34')](function(){if(_0xd152b9){return db[_0xbec1('0x3a')]['findAll']({'where':{'type':_0xd152b9['type']},'raw':!![]});}})['then'](function(_0x1b5ef4){if(_0xd152b9[_0xbec1('0x3c')][_0xbec1('0x56')]()==_0xbec1('0x57')){var _0x505e4d=fs['readFileSync'](path[_0xbec1('0x59')](config[_0xbec1('0x5f')],_0xbec1('0x69')),'utf8');var _0x15b317=ejs[_0xbec1('0x61')](_0x505e4d,{'networks':_0x1b5ef4||[]});fs['writeFileSync'](_0xbec1('0x5b'),_0x15b317);return respondWithRpcPromise('Reload',_0xbec1('0x35'),{'module':_0xbec1('0x5d')});}else if(_0xd152b9[_0xbec1('0x3c')][_0xbec1('0x56')]()==_0xbec1('0x5e')){var _0x555e5a=fs[_0xbec1('0x58')](path['join'](config[_0xbec1('0x5f')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x5e0dc=ejs[_0xbec1('0x61')](_0x555e5a,{'networks':_0x1b5ef4||[]});fs[_0xbec1('0x5a')](_0xbec1('0x62'),_0x5e0dc);return respondWithRpcPromise(_0xbec1('0x5c'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x22b979=fs[_0xbec1('0x58')](path[_0xbec1('0x59')](config[_0xbec1('0x5f')],_0xbec1('0x6a')),_0xbec1('0x60'));var _0x4a2889=ejs[_0xbec1('0x61')](_0x22b979,{'networks':_0x1b5ef4||[]});fs[_0xbec1('0x5a')](util['format'](_0xbec1('0x64'),_0x5e0f33['body'][_0xbec1('0x3c')][_0xbec1('0x65')]()),_0x4a2889);return respondWithRpcPromise(_0xbec1('0x5c'),_0xbec1('0x35'),{'module':_0xbec1('0x66')});}return null;})[_0xbec1('0x26')](handleError(_0x126185,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1389383..317956a 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x574d=['moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api'];(function(_0x2580b8,_0x3d820b){var _0x4f7c7b=function(_0x4776ab){while(--_0x4776ab){_0x2580b8['push'](_0x2580b8['shift']());}};_0x4f7c7b(++_0x3d820b);}(_0x574d,0xc0));var _0xd574=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x574d[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var logger=require(_0xd574('0x2'))(_0xd574('0x3'));var moment=require(_0xd574('0x4'));var BPromise=require(_0xd574('0x5'));var rp=require(_0xd574('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd574('0x7'));var config=require(_0xd574('0x8'));var attributes=require(_0xd574('0x9'));module[_0xd574('0xa')]=function(_0x56ecee,_0x16a152){return _0x56ecee[_0xd574('0xb')](_0xd574('0xc'),attributes,{'tableName':_0xd574('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b87=['define','Network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x44c742,_0x5d69a4){var _0x40fcf0=function(_0x453d3c){while(--_0x453d3c){_0x44c742['push'](_0x44c742['shift']());}};_0x40fcf0(++_0x5d69a4);}(_0x9b87,0x8e));var _0x79b8=function(_0x581eb2,_0x4a1d49){_0x581eb2=_0x581eb2-0x0;var _0x3ebdc9=_0x9b87[_0x581eb2];return _0x3ebdc9;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var logger=require(_0x79b8('0x2'))(_0x79b8('0x3'));var moment=require(_0x79b8('0x4'));var BPromise=require(_0x79b8('0x5'));var rp=require(_0x79b8('0x6'));var fs=require('fs');var path=require(_0x79b8('0x7'));var rimraf=require(_0x79b8('0x8'));var config=require(_0x79b8('0x9'));var attributes=require(_0x79b8('0xa'));module[_0x79b8('0xb')]=function(_0x3ccc53,_0x2e21b9){return _0x3ccc53[_0x79b8('0xc')](_0x79b8('0xd'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index dc504d7..914b508 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xbe1676,_0x586ed4){var _0x1b95cc=function(_0x4b3156){while(--_0x4b3156){_0xbe1676['push'](_0xbe1676['shift']());}};_0x1b95cc(++_0x586ed4);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x518e14,_0x2efabd){var _0x13e9e4=function(_0xb6abab){while(--_0xb6abab){_0x518e14['push'](_0x518e14['shift']());}};_0x13e9e4(++_0x2efabd);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 97340b8..7960285 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x030a=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/users','getAgents','post','create','addAnswer','notify','addAgents','/:id/send','send','put','delete','removeDispositions','removeAgents','exports','multer','util','express','Router','fs-extra','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x030a,0x94));var _0xa030=function(_0x20d06a,_0x16b092){_0x20d06a=_0x20d06a-0x0;var _0x1c48ef=_0x030a[_0x20d06a];return _0x1c48ef;};'use strict';var multer=require(_0xa030('0x0'));var util=require(_0xa030('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa030('0x2'));var router=express[_0xa030('0x3')]();var fs_extra=require(_0xa030('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa030('0x5'));router[_0xa030('0x6')]('/',auth[_0xa030('0x7')](),controller[_0xa030('0x8')]);router[_0xa030('0x6')](_0xa030('0x9'),auth[_0xa030('0x7')](),controller[_0xa030('0xa')]);router[_0xa030('0x6')](_0xa030('0xb'),auth[_0xa030('0x7')](),controller[_0xa030('0xc')]);router[_0xa030('0x6')](_0xa030('0xd'),auth[_0xa030('0x7')](),controller[_0xa030('0xe')]);router[_0xa030('0x6')](_0xa030('0xf'),auth['isAuthenticated'](),controller[_0xa030('0x10')]);router[_0xa030('0x6')]('/:id/applications',auth[_0xa030('0x7')](),controller[_0xa030('0x11')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa030('0x12'),auth[_0xa030('0x7')](),controller[_0xa030('0x13')]);router[_0xa030('0x14')]('/',auth[_0xa030('0x7')](),controller[_0xa030('0x15')]);router[_0xa030('0x14')](_0xa030('0xd'),auth[_0xa030('0x7')](),controller['addDisposition']);router[_0xa030('0x14')]('/:id/canned_answers',auth[_0xa030('0x7')](),controller[_0xa030('0x16')]);router[_0xa030('0x14')]('/:id/notify',controller[_0xa030('0x17')]);router[_0xa030('0x14')]('/:id/applications',auth[_0xa030('0x7')](),controller['addApplications']);router[_0xa030('0x14')](_0xa030('0x12'),auth['isAuthenticated'](),controller[_0xa030('0x18')]);router[_0xa030('0x14')](_0xa030('0x19'),auth['isAuthenticated'](),controller[_0xa030('0x1a')]);router[_0xa030('0x1b')](_0xa030('0xb'),auth[_0xa030('0x7')](),controller['update']);router[_0xa030('0x1c')](_0xa030('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xa030('0x1c')](_0xa030('0xd'),auth[_0xa030('0x7')](),controller[_0xa030('0x1d')]);router[_0xa030('0x1c')](_0xa030('0xf'),auth[_0xa030('0x7')](),controller['removeAnswers']);router[_0xa030('0x1c')](_0xa030('0x12'),auth[_0xa030('0x7')](),controller[_0xa030('0x1e')]);module[_0xa030('0x1f')]=router; \ No newline at end of file +var _0x22b2=['removeDispositions','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addAgents','/:id/send','send','put','delete','destroy'];(function(_0x2d287e,_0x2b31ec){var _0x1d0054=function(_0x523a9f){while(--_0x523a9f){_0x2d287e['push'](_0x2d287e['shift']());}};_0x1d0054(++_0x2b31ec);}(_0x22b2,0x71));var _0x222b=function(_0x31f211,_0x2485d7){_0x31f211=_0x31f211-0x0;var _0xe1aaa4=_0x22b2[_0x31f211];return _0xe1aaa4;};'use strict';var multer=require(_0x222b('0x0'));var util=require(_0x222b('0x1'));var path=require(_0x222b('0x2'));var timeout=require(_0x222b('0x3'));var express=require('express');var router=express[_0x222b('0x4')]();var fs_extra=require(_0x222b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x222b('0x6'));var config=require(_0x222b('0x7'));var controller=require(_0x222b('0x8'));router[_0x222b('0x9')]('/',auth[_0x222b('0xa')](),controller[_0x222b('0xb')]);router[_0x222b('0x9')](_0x222b('0xc'),auth[_0x222b('0xa')](),controller[_0x222b('0xd')]);router[_0x222b('0x9')](_0x222b('0xe'),auth[_0x222b('0xa')](),controller['show']);router['get'](_0x222b('0xf'),auth[_0x222b('0xa')](),controller[_0x222b('0x10')]);router[_0x222b('0x9')]('/:id/canned_answers',auth[_0x222b('0xa')](),controller[_0x222b('0x11')]);router[_0x222b('0x9')](_0x222b('0x12'),auth[_0x222b('0xa')](),controller[_0x222b('0x13')]);router[_0x222b('0x9')](_0x222b('0x14'),auth[_0x222b('0xa')](),controller[_0x222b('0x15')]);router[_0x222b('0x9')](_0x222b('0x16'),auth[_0x222b('0xa')](),controller['getAgents']);router[_0x222b('0x17')]('/',auth[_0x222b('0xa')](),controller[_0x222b('0x18')]);router['post']('/:id/dispositions',auth[_0x222b('0xa')](),controller[_0x222b('0x19')]);router[_0x222b('0x17')](_0x222b('0x1a'),auth['isAuthenticated'](),controller[_0x222b('0x1b')]);router[_0x222b('0x17')](_0x222b('0x1c'),controller['notify']);router[_0x222b('0x17')](_0x222b('0x12'),auth[_0x222b('0xa')](),controller['addApplications']);router[_0x222b('0x17')](_0x222b('0x16'),auth[_0x222b('0xa')](),controller[_0x222b('0x1d')]);router['post'](_0x222b('0x1e'),auth[_0x222b('0xa')](),controller[_0x222b('0x1f')]);router[_0x222b('0x20')](_0x222b('0xe'),auth[_0x222b('0xa')](),controller['update']);router[_0x222b('0x21')](_0x222b('0xe'),auth[_0x222b('0xa')](),controller[_0x222b('0x22')]);router['delete'](_0x222b('0xf'),auth[_0x222b('0xa')](),controller[_0x222b('0x23')]);router[_0x222b('0x21')](_0x222b('0x1a'),auth[_0x222b('0xa')](),controller['removeAnswers']);router[_0x222b('0x21')](_0x222b('0x16'),auth[_0x222b('0xa')](),controller['removeAgents']);module[_0x222b('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index a092bd8..79aa634 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5841=['name','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x4d2b63,_0x585da6){var _0x594bb6=function(_0x4a588d){while(--_0x4a588d){_0x4d2b63['push'](_0x4d2b63['shift']());}};_0x594bb6(++_0x585da6);}(_0x5841,0x14e));var _0x1584=function(_0x5ac310,_0x3b4b4e){_0x5ac310=_0x5ac310-0x0;var _0x33e546=_0x5841[_0x5ac310];return _0x33e546;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1584('0x0'));module[_0x1584('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1584('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1584('0x3')]},'token':{'type':Sequelize[_0x1584('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1584('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1584('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1584('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1584('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1584('0x3')]},'queueTransfer':{'type':Sequelize[_0x1584('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1584('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1584('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1584('0x8'),'set':function(_0x39763a){if(!_0x39763a)this[_0x1584('0x9')](_0x1584('0xa'),null);this[_0x1584('0x9')](_0x1584('0xb'),_0x39763a);}}}; \ No newline at end of file +var _0x03a0=['INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x89908f,_0x49b399){var _0x161c78=function(_0x1b3787){while(--_0x1b3787){_0x89908f['push'](_0x89908f['shift']());}};_0x161c78(++_0x49b399);}(_0x03a0,0xc1));var _0x003a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x03a0[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x003a('0x0'));module['exports']={'name':{'type':Sequelize[_0x003a('0x1')],'unique':_0x003a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x003a('0x1')]},'token':{'type':Sequelize[_0x003a('0x1')],'defaultValue':function(){return rs[_0x003a('0x3')]();}},'replyUri':{'type':Sequelize[_0x003a('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x003a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x003a('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x003a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x003a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x003a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x003a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x003a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x003a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x003a('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x003a('0x6')],'defaultValue':![],'comment':_0x003a('0x8'),'set':function(_0x186c2b){if(!_0x186c2b)this[_0x003a('0x9')]('mandatoryDispositionPauseId',null);this[_0x003a('0x9')](_0x003a('0xa'),_0x186c2b);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 992c6ad..fdc1276 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4b8=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','OpenchannelAccount,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','OpenchannelAccounts','stack','send','index','Pause','map','OpenchannelAccount','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','mandatoryDispositionPause','rawAttributes','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','Sequelize','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','asc','CmContact','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','firstName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','OpenchannelApplication','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2c47d9,_0x513652){var _0x220b47=function(_0x2161b1){while(--_0x2161b1){_0x2c47d9['push'](_0x2c47d9['shift']());}};_0x220b47(++_0x513652);}(_0xc4b8,0xb2));var _0x8c4b=function(_0x493809,_0xe55f0a){_0x493809=_0x493809-0x0;var _0x20db3b=_0xc4b8[_0x493809];return _0x20db3b;};'use strict';var emlformat=require(_0x8c4b('0x0'));var rimraf=require(_0x8c4b('0x1'));var zipdir=require(_0x8c4b('0x2'));var jsonpatch=require(_0x8c4b('0x3'));var rp=require(_0x8c4b('0x4'));var moment=require('moment');var BPromise=require(_0x8c4b('0x5'));var Mustache=require('mustache');var util=require(_0x8c4b('0x6'));var path=require(_0x8c4b('0x7'));var sox=require(_0x8c4b('0x8'));var csv=require('to-csv');var ejs=require(_0x8c4b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c4b('0xa'));var crypto=require(_0x8c4b('0xb'));var jsforce=require(_0x8c4b('0xc'));var deskjs=require(_0x8c4b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8c4b('0xe'));var Papa=require(_0x8c4b('0xf'));var Redis=require(_0x8c4b('0x10'));var authService=require(_0x8c4b('0x11'));var qs=require(_0x8c4b('0x12'));var as=require(_0x8c4b('0x13'));var hardwareService=require(_0x8c4b('0x14'));var logger=require(_0x8c4b('0x15'))(_0x8c4b('0x16'));var utils=require('../../config/utils');var config=require(_0x8c4b('0x17'));var licenseUtil=require(_0x8c4b('0x18'));var db=require(_0x8c4b('0x19'))['db'];config[_0x8c4b('0x1a')]=_[_0x8c4b('0x1b')](config[_0x8c4b('0x1a')],{'host':_0x8c4b('0x1c'),'port':0x18eb});var socket=require(_0x8c4b('0x1d'))(new Redis(config[_0x8c4b('0x1a')]));require(_0x8c4b('0x1e'))[_0x8c4b('0x1f')](socket);var jayson=require(_0x8c4b('0x20'));var client=jayson[_0x8c4b('0x21')][_0x8c4b('0x22')]({'port':0x232c});var client9002=jayson[_0x8c4b('0x21')][_0x8c4b('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2983ca,_0x1d4044,_0x5870e4,_0x386ca6){return new BPromise(function(_0x1b9517,_0x224dab){var _0x16c7ad=_0x386ca6||client;return _0x16c7ad[_0x8c4b('0x23')](_0x2983ca,_0x5870e4)['then'](function(_0x456193){logger[_0x8c4b('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d4044,_0x8c4b('0x25'));logger[_0x8c4b('0x26')](_0x8c4b('0x27'),_0x1d4044,_0x8c4b('0x25'),JSON[_0x8c4b('0x28')](_0x456193));if(_0x456193['error']){if(_0x456193['error'][_0x8c4b('0x29')]===0x1f4){logger['error'](_0x8c4b('0x2a'),_0x1d4044,_0x456193[_0x8c4b('0x2b')][_0x8c4b('0x2c')]);return _0x224dab(_0x456193[_0x8c4b('0x2b')][_0x8c4b('0x2c')]);}logger[_0x8c4b('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d4044,_0x456193[_0x8c4b('0x2b')][_0x8c4b('0x2c')]);return _0x1b9517(_0x456193['error']['message']);}else{logger[_0x8c4b('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d4044,_0x8c4b('0x25'));_0x1b9517(_0x456193[_0x8c4b('0x2d')][_0x8c4b('0x2c')]);}})['catch'](function(_0x34c81b){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1d4044,_0x34c81b);_0x224dab(_0x34c81b);});});}function respondWithStatusCode(_0xc562cb,_0x275b83){_0x275b83=_0x275b83||0xcc;return function(_0x20662c){if(_0x20662c){return _0xc562cb[_0x8c4b('0x2e')](_0x275b83);}return _0xc562cb[_0x8c4b('0x2f')](_0x275b83)[_0x8c4b('0x30')]();};}function respondWithResult(_0x43e7b3,_0x3fcbe4){_0x3fcbe4=_0x3fcbe4||0xc8;return function(_0x3468c5){if(_0x3468c5){return _0x43e7b3[_0x8c4b('0x2f')](_0x3fcbe4)[_0x8c4b('0x31')](_0x3468c5);}};}function respondWithFilteredResult(_0x486dbb,_0x43f202){return function(_0x1fa16d){if(_0x1fa16d){var _0x80ddd6=typeof _0x43f202[_0x8c4b('0x32')]===_0x8c4b('0x33')&&typeof _0x43f202[_0x8c4b('0x34')]==='undefined';var _0x24d4e9=_0x1fa16d[_0x8c4b('0x35')];var _0x12e32c=_0x80ddd6?0x0:_0x43f202[_0x8c4b('0x32')];var _0x495c9f=_0x80ddd6?_0x1fa16d[_0x8c4b('0x35')]:_0x43f202[_0x8c4b('0x32')]+_0x43f202[_0x8c4b('0x34')];var _0x5648cd;if(_0x495c9f>=_0x24d4e9){_0x495c9f=_0x24d4e9;_0x5648cd=0xc8;}else{_0x5648cd=0xce;}_0x486dbb[_0x8c4b('0x2f')](_0x5648cd);return _0x486dbb[_0x8c4b('0x36')]('Content-Range',_0x12e32c+'-'+_0x495c9f+'/'+_0x24d4e9)[_0x8c4b('0x31')](_0x1fa16d);}return null;};}function patchUpdates(_0x5a19cd){return function(_0x487e11){try{jsonpatch[_0x8c4b('0x37')](_0x487e11,_0x5a19cd,!![]);}catch(_0x9ce402){return BPromise[_0x8c4b('0x38')](_0x9ce402);}return _0x487e11['save']();};}function saveUpdates(_0x192a21,_0x4a4ada){return function(_0x4ef287){if(_0x4ef287){return _0x4ef287[_0x8c4b('0x39')](_0x192a21)[_0x8c4b('0x3a')](function(_0x43b1f6){return _0x43b1f6;});}return null;};}function removeEntity(_0x59c8e5,_0x4ec367){return function(_0x1b2b8d){if(_0x1b2b8d){return _0x1b2b8d[_0x8c4b('0x3b')]()['then'](function(){var _0x3645b5=_0x1b2b8d[_0x8c4b('0x3c')]({'plain':!![]});var _0x50a297=_0x8c4b('0x3d');return db['UserProfileResource'][_0x8c4b('0x3b')]({'where':{'type':_0x50a297,'resourceId':_0x3645b5['id']}})[_0x8c4b('0x3a')](function(){return _0x1b2b8d;});})['then'](function(){_0x59c8e5[_0x8c4b('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x946fa6,_0x5727d4){return function(_0x7a319f){if(!_0x7a319f){_0x946fa6[_0x8c4b('0x2e')](0x194);}return _0x7a319f;};}function handleError(_0x20f946,_0x2db4d5){_0x2db4d5=_0x2db4d5||0x1f4;return function(_0x1a5d4e){logger['error'](_0x1a5d4e[_0x8c4b('0x3e')]);if(_0x1a5d4e['name']){delete _0x1a5d4e['name'];}_0x20f946['status'](_0x2db4d5)[_0x8c4b('0x3f')](_0x1a5d4e);};}exports[_0x8c4b('0x40')]=function(_0x344cd1,_0x47d6bb){var _0x44a5c0={'include':[{'model':db[_0x8c4b('0x41')],'as':'mandatoryDispositionPause'}]},_0x510133={},_0x117f6a={'count':0x0,'rows':[]};var _0x4e83b2=_[_0x8c4b('0x42')](db[_0x8c4b('0x43')]['rawAttributes'],function(_0x1b3ba0){return{'name':_0x1b3ba0[_0x8c4b('0x44')],'type':_0x1b3ba0[_0x8c4b('0x45')][_0x8c4b('0x46')]};});_0x510133[_0x8c4b('0x47')]=_[_0x8c4b('0x42')](_0x4e83b2,_0x8c4b('0x48'));_0x510133[_0x8c4b('0x49')]=_[_0x8c4b('0x4a')](_0x344cd1['query']);_0x510133['filters']=_[_0x8c4b('0x4b')](_0x510133['model'],_0x510133[_0x8c4b('0x49')]);_0x44a5c0['attributes']=_['intersection'](_0x510133[_0x8c4b('0x47')],qs[_0x8c4b('0x4c')](_0x344cd1['query'][_0x8c4b('0x4c')]));_0x44a5c0[_0x8c4b('0x4d')]=_0x44a5c0[_0x8c4b('0x4d')][_0x8c4b('0x4e')]?_0x44a5c0['attributes']:_0x510133[_0x8c4b('0x47')];if(!_0x344cd1[_0x8c4b('0x49')][_0x8c4b('0x4f')](_0x8c4b('0x50'))){_0x44a5c0['limit']=qs[_0x8c4b('0x34')](_0x344cd1[_0x8c4b('0x49')][_0x8c4b('0x34')]);_0x44a5c0[_0x8c4b('0x32')]=qs[_0x8c4b('0x32')](_0x344cd1['query']['offset']);}_0x44a5c0['order']=qs[_0x8c4b('0x51')](_0x344cd1[_0x8c4b('0x49')][_0x8c4b('0x51')]);_0x44a5c0[_0x8c4b('0x52')]=qs[_0x8c4b('0x53')](_[_0x8c4b('0x54')](_0x344cd1[_0x8c4b('0x49')],_0x510133[_0x8c4b('0x53')]),_0x4e83b2);if(_0x344cd1[_0x8c4b('0x49')][_0x8c4b('0x55')]){_0x44a5c0['where']=_[_0x8c4b('0x56')](_0x44a5c0['where'],{'$or':_[_0x8c4b('0x42')](_0x4e83b2,function(_0xfe9714){if(_0xfe9714[_0x8c4b('0x45')]!=='VIRTUAL'){var _0x14fe75={};_0x14fe75[_0xfe9714[_0x8c4b('0x48')]]={'$like':'%'+_0x344cd1[_0x8c4b('0x49')]['filter']+'%'};return _0x14fe75;}})});}_0x44a5c0=_[_0x8c4b('0x56')]({},_0x44a5c0,_0x344cd1['options']);var _0x1f13da={'where':_0x44a5c0[_0x8c4b('0x52')]};return db[_0x8c4b('0x43')][_0x8c4b('0x35')](_0x1f13da)['then'](function(_0x5cbe6b){_0x117f6a[_0x8c4b('0x35')]=_0x5cbe6b;if(_0x344cd1['query']['includeAll']){_0x44a5c0[_0x8c4b('0x57')]=[{'all':!![]}];}return db[_0x8c4b('0x43')][_0x8c4b('0x58')](_0x44a5c0);})[_0x8c4b('0x3a')](function(_0x55b04a){_0x117f6a[_0x8c4b('0x59')]=_0x55b04a;return _0x117f6a;})['then'](respondWithFilteredResult(_0x47d6bb,_0x44a5c0))[_0x8c4b('0x5a')](handleError(_0x47d6bb,null));};exports[_0x8c4b('0x5b')]=function(_0x3a51f5,_0x5bed3e){var _0x48806e={'raw':![],'where':{'id':_0x3a51f5['params']['id']},'include':[{'model':db[_0x8c4b('0x41')],'as':_0x8c4b('0x5c')}]},_0x274b3f={};_0x274b3f[_0x8c4b('0x47')]=_[_0x8c4b('0x4a')](db['OpenchannelAccount'][_0x8c4b('0x5d')]);_0x274b3f[_0x8c4b('0x49')]=_[_0x8c4b('0x4a')](_0x3a51f5[_0x8c4b('0x49')]);_0x274b3f['filters']=_[_0x8c4b('0x4b')](_0x274b3f[_0x8c4b('0x47')],_0x274b3f['query']);_0x48806e[_0x8c4b('0x4d')]=_[_0x8c4b('0x4b')](_0x274b3f[_0x8c4b('0x47')],qs['fields'](_0x3a51f5['query']['fields']));_0x48806e[_0x8c4b('0x4d')]=_0x48806e['attributes']['length']?_0x48806e['attributes']:_0x274b3f[_0x8c4b('0x47')];if(_0x3a51f5[_0x8c4b('0x49')][_0x8c4b('0x5e')]){_0x48806e[_0x8c4b('0x57')]=[{'all':!![]}];}_0x48806e=_[_0x8c4b('0x56')]({},_0x48806e,_0x3a51f5[_0x8c4b('0x5f')]);return db[_0x8c4b('0x43')]['find'](_0x48806e)[_0x8c4b('0x3a')](handleEntityNotFound(_0x5bed3e,null))[_0x8c4b('0x3a')](respondWithResult(_0x5bed3e,null))[_0x8c4b('0x5a')](handleError(_0x5bed3e,null));};exports['create']=function(_0x43329d,_0x3315e7){return db[_0x8c4b('0x43')][_0x8c4b('0x60')](_0x43329d['body'],{})[_0x8c4b('0x3a')](function(_0x4af12e){var _0x593230=_0x43329d[_0x8c4b('0x61')][_0x8c4b('0x3c')]({'plain':!![]});if(!_0x593230)throw new Error(_0x8c4b('0x62'));if(_0x593230[_0x8c4b('0x63')]===_0x8c4b('0x61')){var _0x55611b=_0x4af12e[_0x8c4b('0x3c')]({'plain':!![]});var _0x51c278=_0x8c4b('0x3d');return db[_0x8c4b('0x64')][_0x8c4b('0x65')]({'where':{'name':_0x51c278,'userProfileId':_0x593230[_0x8c4b('0x66')]},'raw':!![]})[_0x8c4b('0x3a')](function(_0x87d0c){if(_0x87d0c&&_0x87d0c['autoAssociation']===0x0){return db[_0x8c4b('0x67')][_0x8c4b('0x60')]({'name':_0x55611b[_0x8c4b('0x48')],'resourceId':_0x55611b['id'],'type':_0x87d0c[_0x8c4b('0x48')],'sectionId':_0x87d0c['id']},{})['then'](function(){return _0x4af12e;});}else{return _0x4af12e;}})[_0x8c4b('0x5a')](function(_0x54ec56){logger[_0x8c4b('0x2b')](_0x8c4b('0x68'),_0x54ec56);throw _0x54ec56;});}return _0x4af12e;})[_0x8c4b('0x3a')](respondWithResult(_0x3315e7,0xc9))[_0x8c4b('0x5a')](handleError(_0x3315e7,null));};exports['update']=function(_0x1bd332,_0x47f887){if(_0x1bd332[_0x8c4b('0x69')]['id']){delete _0x1bd332['body']['id'];}return db[_0x8c4b('0x43')]['find']({'where':{'id':_0x1bd332[_0x8c4b('0x6a')]['id']},'include':[{'model':db['Pause'],'as':_0x8c4b('0x5c')}]})[_0x8c4b('0x3a')](handleEntityNotFound(_0x47f887,null))[_0x8c4b('0x3a')](saveUpdates(_0x1bd332[_0x8c4b('0x69')],null))[_0x8c4b('0x3a')](respondWithResult(_0x47f887,null))[_0x8c4b('0x5a')](handleError(_0x47f887,null));};exports['destroy']=function(_0x4e5002,_0xd6f032){return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x4e5002[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0xd6f032,null))[_0x8c4b('0x3a')](removeEntity(_0xd6f032,null))['catch'](handleError(_0xd6f032,null));};exports[_0x8c4b('0x6b')]=function(_0xd6dbf6,_0x590bf3){return db[_0x8c4b('0x43')][_0x8c4b('0x6b')]()[_0x8c4b('0x3a')](respondWithResult(_0x590bf3,null))[_0x8c4b('0x5a')](handleError(_0x590bf3,null));};exports[_0x8c4b('0x6c')]=function(_0x4d09a4,_0x3f7a3a,_0x168e08){if(_0x4d09a4[_0x8c4b('0x69')]['id']){delete _0x4d09a4[_0x8c4b('0x69')]['id'];}return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x4d09a4[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x3f7a3a,null))[_0x8c4b('0x3a')](function(_0x44b8e9){if(_0x44b8e9){_0x4d09a4[_0x8c4b('0x69')][_0x8c4b('0x6d')]=_0x44b8e9['id'];return db['Disposition'][_0x8c4b('0x60')](_0x4d09a4['body']);}})[_0x8c4b('0x3a')](respondWithResult(_0x3f7a3a,null))[_0x8c4b('0x5a')](handleError(_0x3f7a3a,null));};exports[_0x8c4b('0x6e')]=function(_0x3d4a0e,_0x48a4fd,_0x58b259){var _0x577329={'raw':![],'where':{}};var _0x1eb2b3={};var _0x278e80={'count':0x0,'rows':[]};return db[_0x8c4b('0x43')][_0x8c4b('0x6f')]({'where':{'id':_0x3d4a0e[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x48a4fd,null))[_0x8c4b('0x3a')](function(_0x1c76b2){if(_0x1c76b2){_0x1eb2b3[_0x8c4b('0x47')]=_['keys'](db[_0x8c4b('0x70')][_0x8c4b('0x5d')]);_0x1eb2b3['query']=_[_0x8c4b('0x4a')](_0x3d4a0e[_0x8c4b('0x49')]);_0x1eb2b3['filters']=_[_0x8c4b('0x4b')](_0x1eb2b3[_0x8c4b('0x47')],_0x1eb2b3[_0x8c4b('0x49')]);_0x577329['attributes']=_['intersection'](_0x1eb2b3['model'],qs[_0x8c4b('0x4c')](_0x3d4a0e[_0x8c4b('0x49')]['fields']));_0x577329['attributes']=_0x577329[_0x8c4b('0x4d')][_0x8c4b('0x4e')]?_0x577329[_0x8c4b('0x4d')]:_0x1eb2b3[_0x8c4b('0x47')];if(!_0x3d4a0e['query']['hasOwnProperty']('nolimit')){_0x577329[_0x8c4b('0x34')]=qs[_0x8c4b('0x34')](_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x34')]);_0x577329['offset']=qs[_0x8c4b('0x32')](_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x32')]);}_0x577329[_0x8c4b('0x71')]=qs[_0x8c4b('0x51')](_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x51')]);_0x577329[_0x8c4b('0x52')]=qs['filters'](_[_0x8c4b('0x54')](_0x3d4a0e['query'],_0x1eb2b3[_0x8c4b('0x53')]));_0x577329['where'][_0x8c4b('0x6d')]=_0x1c76b2['id'];if(_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x55')]){_0x577329[_0x8c4b('0x52')]=_[_0x8c4b('0x56')](_0x577329[_0x8c4b('0x52')],{'$or':_[_0x8c4b('0x42')](_0x577329[_0x8c4b('0x4d')],function(_0x129147){var _0x45f944={};_0x45f944[_0x129147]={'$like':'%'+_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x55')]+'%'};return _0x45f944;})});}_0x577329=_[_0x8c4b('0x56')]({},_0x577329,_0x3d4a0e['options']);return db[_0x8c4b('0x70')]['count']({'where':_0x577329[_0x8c4b('0x52')]})[_0x8c4b('0x3a')](function(_0x1028d2){_0x278e80[_0x8c4b('0x35')]=_0x1028d2;if(_0x3d4a0e[_0x8c4b('0x49')][_0x8c4b('0x5e')]){_0x577329[_0x8c4b('0x57')]=[{'all':!![]}];}return db[_0x8c4b('0x70')][_0x8c4b('0x58')](_0x577329);})[_0x8c4b('0x3a')](function(_0x38862e){_0x278e80[_0x8c4b('0x59')]=_0x38862e;return _0x278e80;});}})[_0x8c4b('0x3a')](respondWithFilteredResult(_0x48a4fd,_0x577329))[_0x8c4b('0x5a')](handleError(_0x48a4fd,null));};exports[_0x8c4b('0x72')]=function(_0x5e8c68,_0x44ab64,_0x4e2094){return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x5e8c68[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x44ab64,null))[_0x8c4b('0x3a')](function(_0x3f05c5){if(_0x3f05c5){return _0x3f05c5[_0x8c4b('0x72')](_0x5e8c68['query'][_0x8c4b('0x73')]);}})[_0x8c4b('0x3a')](respondWithStatusCode(_0x44ab64,null))[_0x8c4b('0x5a')](handleError(_0x44ab64,null));};exports[_0x8c4b('0x74')]=function(_0x113fff,_0xca0c35,_0x406d36){if(_0x113fff['body']['id']){delete _0x113fff[_0x8c4b('0x69')]['id'];}return db['OpenchannelAccount'][_0x8c4b('0x65')]({'where':{'id':_0x113fff[_0x8c4b('0x6a')]['id']}})['then'](handleEntityNotFound(_0xca0c35,null))[_0x8c4b('0x3a')](function(_0x20b979){if(_0x20b979){_0x113fff[_0x8c4b('0x69')][_0x8c4b('0x6d')]=_0x20b979['id'];return db[_0x8c4b('0x75')][_0x8c4b('0x60')](_0x113fff[_0x8c4b('0x69')]);}})[_0x8c4b('0x3a')](respondWithResult(_0xca0c35,null))[_0x8c4b('0x5a')](handleError(_0xca0c35,null));};exports[_0x8c4b('0x76')]=function(_0x15d1a9,_0x22e765,_0x396bc5){var _0x106a2f={'raw':![],'where':{}};var _0x5a085c={};var _0x3e360d={'count':0x0,'rows':[]};return db[_0x8c4b('0x43')][_0x8c4b('0x6f')]({'where':{'id':_0x15d1a9['params']['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x22e765,null))[_0x8c4b('0x3a')](function(_0xfbef2e){if(_0xfbef2e){_0x5a085c[_0x8c4b('0x47')]=_[_0x8c4b('0x4a')](db['CannedAnswer'][_0x8c4b('0x5d')]);_0x5a085c[_0x8c4b('0x49')]=_[_0x8c4b('0x4a')](_0x15d1a9[_0x8c4b('0x49')]);_0x5a085c[_0x8c4b('0x53')]=_[_0x8c4b('0x4b')](_0x5a085c[_0x8c4b('0x47')],_0x5a085c[_0x8c4b('0x49')]);_0x106a2f[_0x8c4b('0x4d')]=_['intersection'](_0x5a085c[_0x8c4b('0x47')],qs[_0x8c4b('0x4c')](_0x15d1a9[_0x8c4b('0x49')]['fields']));_0x106a2f[_0x8c4b('0x4d')]=_0x106a2f['attributes']['length']?_0x106a2f[_0x8c4b('0x4d')]:_0x5a085c['model'];if(!_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x4f')](_0x8c4b('0x50'))){_0x106a2f[_0x8c4b('0x34')]=qs[_0x8c4b('0x34')](_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x34')]);_0x106a2f[_0x8c4b('0x32')]=qs[_0x8c4b('0x32')](_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x32')]);}_0x106a2f[_0x8c4b('0x71')]=qs['sort'](_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x51')]);_0x106a2f[_0x8c4b('0x52')]=qs['filters'](_[_0x8c4b('0x54')](_0x15d1a9[_0x8c4b('0x49')],_0x5a085c['filters']));_0x106a2f[_0x8c4b('0x52')][_0x8c4b('0x6d')]=_0xfbef2e['id'];if(_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x55')]){_0x106a2f[_0x8c4b('0x52')]=_['merge'](_0x106a2f[_0x8c4b('0x52')],{'$or':_['map'](_0x106a2f[_0x8c4b('0x4d')],function(_0x4aab90){var _0x54888a={};_0x54888a[_0x4aab90]={'$like':'%'+_0x15d1a9['query'][_0x8c4b('0x55')]+'%'};return _0x54888a;})});}_0x106a2f=_['merge']({},_0x106a2f,_0x15d1a9['options']);return db[_0x8c4b('0x75')][_0x8c4b('0x35')]({'where':_0x106a2f[_0x8c4b('0x52')]})[_0x8c4b('0x3a')](function(_0x4f1829){_0x3e360d[_0x8c4b('0x35')]=_0x4f1829;if(_0x15d1a9[_0x8c4b('0x49')][_0x8c4b('0x5e')]){_0x106a2f[_0x8c4b('0x57')]=[{'all':!![]}];}return db[_0x8c4b('0x75')][_0x8c4b('0x58')](_0x106a2f);})['then'](function(_0x171800){_0x3e360d['rows']=_0x171800;return _0x3e360d;});}})[_0x8c4b('0x3a')](respondWithFilteredResult(_0x22e765,_0x106a2f))[_0x8c4b('0x5a')](handleError(_0x22e765,null));};exports[_0x8c4b('0x77')]=function(_0x3df562,_0x35c777,_0x1f4678){return db['OpenchannelAccount'][_0x8c4b('0x65')]({'where':{'id':_0x3df562[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x35c777,null))[_0x8c4b('0x3a')](function(_0x295924){if(_0x295924){return _0x295924[_0x8c4b('0x77')](_0x3df562[_0x8c4b('0x49')][_0x8c4b('0x73')]);}})[_0x8c4b('0x3a')](respondWithStatusCode(_0x35c777,null))[_0x8c4b('0x5a')](handleError(_0x35c777,null));};exports['notify']=function(_0x1179c8,_0x55bf0f,_0x2a6e75){var _0x46fc42={'body':_0x1179c8[_0x8c4b('0x69')],'channel':'openchannel'};var _0x5c3e4c=[];var _0x1387f7=[];var _0x228104={};var _0x1d33c2=![];return db['CmContact'][_0x8c4b('0x6b')]()[_0x8c4b('0x3a')](function(_0x314b94){if(!_0x314b94){throw new db[(_0x8c4b('0x78'))]['ValidationError']('no\x20available\x20attributes');}_0x5c3e4c=_[_0x8c4b('0x79')](_[_0x8c4b('0x4a')](_0x314b94),['createdAt',_0x8c4b('0x7a')]);_0x1387f7=_[_0x8c4b('0x79')](_['keys'](_0x314b94),[_0x8c4b('0x7b'),_0x8c4b('0x7a'),_0x8c4b('0x7c'),_0x8c4b('0x7d')]);if(_0x1179c8['body']['id']){delete _0x1179c8['body']['id'];}if(_[_0x8c4b('0x7e')](_0x1179c8['body'][_0x8c4b('0x7f')])){throw new db[(_0x8c4b('0x78'))][(_0x8c4b('0x80'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x69')])||_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x69')]===''){throw new db['Sequelize'][(_0x8c4b('0x80'))](_0x8c4b('0x81'));}if(_[_0x8c4b('0x7e')](_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x82')])){throw new db[(_0x8c4b('0x78'))][(_0x8c4b('0x80'))](_0x8c4b('0x83')+_0x1387f7);}if(!_[_0x8c4b('0x84')](_0x1387f7,_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x82')])){throw new db['Sequelize'][(_0x8c4b('0x80'))](_0x8c4b('0x85')+_0x1387f7);}_0x228104[_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x82')]]=_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x7f')];})['then'](function(){return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x1179c8['params']['id']},'include':[{'model':db[_0x8c4b('0x86')],'as':_0x8c4b('0x87'),'include':[{'model':db['CmContact'],'as':_0x8c4b('0x88'),'where':_0x228104,'limit':0x1,'order':[[_0x8c4b('0x7a'),_0x8c4b('0x89')]]}]},{'model':db['OpenchannelApplication'],'as':_0x8c4b('0x8a')}]});})['then'](handleEntityNotFound(_0x55bf0f,null))['then'](function(_0x3c74dd){if(_0x3c74dd&&_0x3c74dd[_0x8c4b('0x87')]){_0x46fc42[_0x8c4b('0x8b')]=_0x3c74dd;_0x46fc42[_0x8c4b('0x8c')]=_0x3c74dd['Applications'];_0x46fc42[_0x8c4b('0x8d')]=_0x3c74dd[_0x8c4b('0x87')];_0x46fc42[_0x8c4b('0x8c')]=_[_0x8c4b('0x8e')](_0x46fc42[_0x8c4b('0x8c')],['priority'],[_0x8c4b('0x8f')]);if(_0x46fc42['account'][_0x8c4b('0x8a')]){delete _0x46fc42[_0x8c4b('0x8b')][_0x8c4b('0x8a')];}if(_0x46fc42[_0x8c4b('0x8b')]['List']&&_0x46fc42[_0x8c4b('0x8b')][_0x8c4b('0x87')][_0x8c4b('0x88')][_0x8c4b('0x4e')]){return _0x46fc42['account']['List']['Contacts'][0x0];}var _0x12bfeb=_[_0x8c4b('0x1b')](_0x1179c8[_0x8c4b('0x69')],{'firstName':_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x7f')],'ListId':_0x3c74dd[_0x8c4b('0x7d')]});_0x12bfeb[_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x82')]]=_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x7f')];return db[_0x8c4b('0x90')][_0x8c4b('0x60')](_0x12bfeb,{'fields':_0x5c3e4c,'raw':!![]});}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x55bf0f,null))[_0x8c4b('0x3a')](function(_0x39f43a){_0x46fc42[_0x8c4b('0x91')]=_0x39f43a;if(_0x39f43a){var _0x1037db={'ContactId':_0x39f43a['id'],'OpenchannelAccountId':_0x1179c8[_0x8c4b('0x6a')]['id'],'from':(_0x39f43a['firstName']||'')+'\x20'+(_0x39f43a[_0x8c4b('0x92')]||'')};var _0x5ffe81={'OpenchannelAccountId':_0x1179c8['params']['id'],'closed':![]};if(_0x1179c8[_0x8c4b('0x69')]['threadId']){_0x5ffe81[_0x8c4b('0x93')]=_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x93')];return db['OpenchannelInteraction'][_0x8c4b('0x65')]({'where':_0x5ffe81})['then'](function(_0xac0870){if(_0xac0870){return[_0xac0870,![]];}_0x1037db[_0x8c4b('0x93')]=_0x1179c8['body']['threadId'];_0x1037db[_0x8c4b('0x94')]=_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x94')];return db[_0x8c4b('0x95')]['create'](_0x1037db)[_0x8c4b('0x3a')](function(_0x5a8f5e){return[_0x5a8f5e,!![]];});});}else{_0x5ffe81['threadId']=null;}_0x5ffe81[_0x8c4b('0x96')]=_0x39f43a['id'];return db[_0x8c4b('0x95')][_0x8c4b('0x65')]({'where':_0x5ffe81})[_0x8c4b('0x3a')](function(_0x58bc7e){if(_0x58bc7e){return[_0x58bc7e,![]];}return db[_0x8c4b('0x95')]['create'](_0x1037db)[_0x8c4b('0x3a')](function(_0x139b25){return[_0x139b25,!![]];});});}})['spread'](function(_0x2a3531,_0x3c8b28){if(_0x2a3531){_0x1d33c2=_0x3c8b28;if(!_0x3c8b28){var _0x1917bd={'from':(_0x46fc42[_0x8c4b('0x91')][_0x8c4b('0x97')]||'')+'\x20'+(_0x46fc42[_0x8c4b('0x91')]['lastName']||'')};if(_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x93')]&&_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x98')]&&_0x1179c8['body'][_0x8c4b('0x93')]!=_0x1179c8[_0x8c4b('0x69')]['messageId']){_0x1917bd[_0x8c4b('0x93')]=_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x98')];}return _0x2a3531[_0x8c4b('0x39')](_0x1917bd);}else{return _0x2a3531;}}})[_0x8c4b('0x3a')](function(_0x4f920b){_0x46fc42['interaction']=_0x4f920b[_0x8c4b('0x3c')]({'plain':!![]});_0x46fc42[_0x8c4b('0x99')][_0x8c4b('0x9a')]=_0x1d33c2;if(_0x46fc42[_0x8c4b('0x99')]['created']){if(_0x46fc42[_0x8c4b('0x8b')][_0x8c4b('0x9b')]){_0x46fc42[_0x8c4b('0x8c')]['push']({'id':0x0,'priority':_0x46fc42[_0x8c4b('0x8c')]['length']+0x1,'app':_0x8c4b('0x9c'),'appdata':_0x8c4b('0x9d'),'interval':_0x8c4b('0x9e')});}}return db['OpenchannelMessage'][_0x8c4b('0x60')]({'body':_0x1179c8[_0x8c4b('0x69')]['body'],'OpenchannelAccountId':_0x1179c8[_0x8c4b('0x6a')]['id'],'OpenchannelInteractionId':_0x4f920b['id'],'direction':'in','ContactId':_0x46fc42[_0x8c4b('0x91')]['id'],'AttachmentId':_0x1179c8[_0x8c4b('0x69')][_0x8c4b('0x9f')]});})['then'](function(_0x1dbc1d){_0x46fc42['message']=_0x1dbc1d;if(_0x46fc42[_0x8c4b('0x99')]['UserId']){return db[_0x8c4b('0xa0')][_0x8c4b('0x65')]({'attributes':['id',_0x8c4b('0x48')],'where':{'id':_0x46fc42[_0x8c4b('0x99')]['UserId']}})['then'](function(_0x174d06){if(_0x174d06){_0x46fc42[_0x8c4b('0x8c')][_0x8c4b('0xa1')]({'id':0x0,'priority':0x0,'app':_0x8c4b('0xa2'),'appdata':_0x174d06[_0x8c4b('0x48')]+','+(_0x46fc42[_0x8c4b('0x8b')][_0x8c4b('0xa3')]||0xa),'interval':_0x8c4b('0x9e')});_0x46fc42[_0x8c4b('0xa4')]=![];}return respondWithRpcPromise(_0x8c4b('0xa5'),_0x8c4b('0xa6'),_0x46fc42);});}return respondWithRpcPromise('Start',_0x8c4b('0xa6'),_0x46fc42);})['then'](function(_0x706d49){respondWithRpcPromise(_0x8c4b('0xa7'),_0x8c4b('0xa7'),{'event':_0x8c4b('0xa8'),'message':_0x706d49},client9002);return _0x706d49;})[_0x8c4b('0x3a')](respondWithResult(_0x55bf0f,null))['catch'](handleError(_0x55bf0f,null));};exports[_0x8c4b('0xa9')]=function(_0x23ffd8,_0x3debaa){var _0x1cc32e=_0x23ffd8[_0x8c4b('0x6a')]['id'];var _0x38cf3f=_0x23ffd8[_0x8c4b('0x69')];var _0x4bb907=0xc8;var _0x5f0f5d=null;return db[_0x8c4b('0xaa')][_0x8c4b('0xab')]({'isolationLevel':db[_0x8c4b('0xaa')][_0x8c4b('0xac')]['ISOLATION_LEVELS'][_0x8c4b('0xad')]},function(_0xeac9b6){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1cc32e},'transaction':_0xeac9b6})[_0x8c4b('0x3a')](function(_0x3ed201){if(_0x3ed201){return db['OpenchannelApplication'][_0x8c4b('0x3b')]({'where':{'OpenchannelAccountId':_0x1cc32e},'transaction':_0xeac9b6})[_0x8c4b('0x3a')](function(){var _0x504303=_[_0x8c4b('0x42')](_0x38cf3f,function(_0x1d0216){_0x1d0216[_0x8c4b('0x6d')]=_0x1cc32e;return _0x1d0216;});return db['OpenchannelApplication']['bulkCreate'](_0x504303,{'transaction':_0xeac9b6});});}else{_0x4bb907=0x194;_0x5f0f5d=[];}});})[_0x8c4b('0x3a')](function(){if(_0x4bb907!==0x194){return db[_0x8c4b('0xae')][_0x8c4b('0xaf')]({'where':{'OpenchannelAccountId':_0x1cc32e},'order':_0x8c4b('0xb0')})[_0x8c4b('0x3a')](function(_0x43b6fa){_0x5f0f5d=_0x43b6fa;});}})[_0x8c4b('0x5a')](function(_0x51e6f7){_0x4bb907=0x1f4;logger['error'](_0x51e6f7[_0x8c4b('0x3e')]);if(_0x51e6f7[_0x8c4b('0x48')]){delete _0x51e6f7[_0x8c4b('0x48')];}_0x5f0f5d=_0x51e6f7;})[_0x8c4b('0xb1')](function(){if(_0x5f0f5d===null){_0x3debaa[_0x8c4b('0x2e')](_0x4bb907);}else{if(_0x4bb907===0x1f4){_0x3debaa['status'](_0x4bb907)[_0x8c4b('0x3f')](_0x5f0f5d);}else{_0x3debaa[_0x8c4b('0x2f')](_0x4bb907)[_0x8c4b('0x31')](_0x5f0f5d);}}});};exports[_0x8c4b('0xb2')]=function(_0x494e42,_0x5861e5,_0x3847c4){var _0x529fb6={};var _0x2ec2e8={};var _0x1ca60f;var _0x25bfcc;return db[_0x8c4b('0x43')][_0x8c4b('0x6f')]({'where':{'id':_0x494e42[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x5861e5,null))['then'](function(_0x1bd196){if(_0x1bd196){_0x1ca60f=_0x1bd196;_0x2ec2e8['model']=_[_0x8c4b('0x4a')](db['OpenchannelApplication'][_0x8c4b('0x5d')]);_0x2ec2e8['query']=_[_0x8c4b('0x4a')](_0x494e42['query']);_0x2ec2e8[_0x8c4b('0x53')]=_[_0x8c4b('0x4b')](_0x2ec2e8[_0x8c4b('0x47')],_0x2ec2e8[_0x8c4b('0x49')]);_0x529fb6['attributes']=_['intersection'](_0x2ec2e8[_0x8c4b('0x47')],qs[_0x8c4b('0x4c')](_0x494e42['query']['fields']));_0x529fb6[_0x8c4b('0x4d')]=_0x529fb6[_0x8c4b('0x4d')][_0x8c4b('0x4e')]?_0x529fb6[_0x8c4b('0x4d')]:_0x2ec2e8['model'];_0x529fb6[_0x8c4b('0x71')]=qs['sort'](_0x494e42['query']['sort']);_0x529fb6['where']=qs['filters'](_[_0x8c4b('0x54')](_0x494e42['query'],_0x2ec2e8[_0x8c4b('0x53')]));if(_0x494e42[_0x8c4b('0x49')][_0x8c4b('0x55')]){_0x529fb6[_0x8c4b('0x52')]=_[_0x8c4b('0x56')](_0x529fb6[_0x8c4b('0x52')],{'$or':_[_0x8c4b('0x42')](_0x529fb6['attributes'],function(_0xe08876){var _0x28e863={};_0x28e863[_0xe08876]={'$like':'%'+_0x494e42[_0x8c4b('0x49')][_0x8c4b('0x55')]+'%'};return _0x28e863;})});}_0x529fb6=_[_0x8c4b('0x56')]({},_0x529fb6,_0x494e42[_0x8c4b('0x5f')]);return _0x1ca60f[_0x8c4b('0xb2')](_0x529fb6);}})['then'](function(_0x5493b8){if(_0x5493b8){_0x25bfcc=_0x5493b8[_0x8c4b('0x4e')];if(!_0x494e42[_0x8c4b('0x49')]['hasOwnProperty'](_0x8c4b('0x50'))){_0x529fb6[_0x8c4b('0x34')]=qs['limit'](_0x494e42[_0x8c4b('0x49')]['limit']);_0x529fb6[_0x8c4b('0x32')]=qs[_0x8c4b('0x32')](_0x494e42[_0x8c4b('0x49')][_0x8c4b('0x32')]);}return _0x1ca60f['getApplications'](_0x529fb6);}})['then'](function(_0x445904){if(_0x445904){return _0x445904?{'count':_0x25bfcc,'rows':_0x445904}:null;}})[_0x8c4b('0x3a')](respondWithResult(_0x5861e5,null))[_0x8c4b('0x5a')](handleError(_0x5861e5,null));};exports[_0x8c4b('0xb3')]=function(_0x35b8ed,_0x21b9ba,_0x1f8e18){var _0xd069e={'raw':![],'where':{}};var _0x2e74f0={};var _0x498f24={'count':0x0,'rows':[]};return db[_0x8c4b('0x43')][_0x8c4b('0x6f')]({'where':{'id':_0x35b8ed[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x21b9ba,null))[_0x8c4b('0x3a')](function(_0x2dc53e){if(_0x2dc53e){_0x2e74f0[_0x8c4b('0x47')]=_[_0x8c4b('0x4a')](db[_0x8c4b('0x95')]['rawAttributes']);_0x2e74f0[_0x8c4b('0x49')]=_[_0x8c4b('0x4a')](_0x35b8ed[_0x8c4b('0x49')]);_0x2e74f0[_0x8c4b('0x53')]=_[_0x8c4b('0x4b')](_0x2e74f0[_0x8c4b('0x47')],_0x2e74f0['query']);_0xd069e[_0x8c4b('0x4d')]=_[_0x8c4b('0x4b')](_0x2e74f0[_0x8c4b('0x47')],qs['fields'](_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x4c')]));_0xd069e[_0x8c4b('0x4d')]=_0xd069e[_0x8c4b('0x4d')][_0x8c4b('0x4e')]?_0xd069e['attributes']:_0x2e74f0[_0x8c4b('0x47')];if(!_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x4f')](_0x8c4b('0x50'))){_0xd069e[_0x8c4b('0x34')]=qs[_0x8c4b('0x34')](_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x34')]);_0xd069e[_0x8c4b('0x32')]=qs[_0x8c4b('0x32')](_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x32')]);}_0xd069e[_0x8c4b('0x71')]=qs['sort'](_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x51')]);_0xd069e[_0x8c4b('0x52')]=qs[_0x8c4b('0x53')](_[_0x8c4b('0x54')](_0x35b8ed[_0x8c4b('0x49')],_0x2e74f0[_0x8c4b('0x53')]));_0xd069e[_0x8c4b('0x52')][_0x8c4b('0x6d')]=_0x2dc53e['id'];if(_0x35b8ed[_0x8c4b('0x49')]['filter']){_0xd069e[_0x8c4b('0x52')]=_[_0x8c4b('0x56')](_0xd069e[_0x8c4b('0x52')],{'$or':_['map'](_0xd069e[_0x8c4b('0x4d')],function(_0x4b82fd){var _0x236cff={};_0x236cff[_0x4b82fd]={'$like':'%'+_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x55')]+'%'};return _0x236cff;})});}_0xd069e=_['merge']({},_0xd069e,_0x35b8ed[_0x8c4b('0x5f')]);return db[_0x8c4b('0x95')][_0x8c4b('0x35')]({'where':_0xd069e[_0x8c4b('0x52')]})['then'](function(_0x1233c6){_0x498f24['count']=_0x1233c6;if(_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0x5e')]){_0xd069e[_0x8c4b('0x57')]=[{'model':db[_0x8c4b('0x90')],'as':_0x8c4b('0xb4'),'required':![]},{'model':db['User'],'as':_0x8c4b('0xb5'),'attributes':[_0x8c4b('0x48'),_0x8c4b('0xb6'),_0x8c4b('0xb7')],'required':![]},{'model':db['Tag'],'as':_0x8c4b('0xb8'),'attributes':['id',_0x8c4b('0x48'),'color'],'where':_0x35b8ed[_0x8c4b('0x49')]['tag']?{'id':_0x35b8ed['query'][_0x8c4b('0xb9')]}:undefined,'required':_0x35b8ed[_0x8c4b('0x49')][_0x8c4b('0xb9')]?!![]:![]}];}return db[_0x8c4b('0x95')][_0x8c4b('0x58')](_0xd069e);})[_0x8c4b('0x3a')](function(_0x3fc2bf){_0x498f24[_0x8c4b('0x59')]=_0x3fc2bf;return _0x498f24;});}})[_0x8c4b('0x3a')](respondWithFilteredResult(_0x21b9ba,_0xd069e))['catch'](handleError(_0x21b9ba,null));};exports['addAgents']=function(_0x287e9e,_0x2f5a36,_0x2b6e20){return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x287e9e[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x2f5a36,null))[_0x8c4b('0x3a')](function(_0x4cd791){if(_0x4cd791){return _0x4cd791[_0x8c4b('0xba')](_0x287e9e[_0x8c4b('0x69')][_0x8c4b('0x73')],_[_0x8c4b('0xbb')](_0x287e9e[_0x8c4b('0x69')],['ids','id'])||{})[_0x8c4b('0xbc')](function(_0x375574){for(var _0xea93d5=0x0;_0xea93d5<_0x287e9e[_0x8c4b('0x69')][_0x8c4b('0x73')][_0x8c4b('0x4e')];_0xea93d5+=0x1){socket[_0x8c4b('0xbd')](_0x8c4b('0xbe'),{'UserId':Number(_0x287e9e[_0x8c4b('0x69')][_0x8c4b('0x73')][_0xea93d5]),'OpenchannelAccountId':Number(_0x287e9e[_0x8c4b('0x6a')]['id'])});}return _0x375574;});}})['then'](respondWithResult(_0x2f5a36,null))['catch'](handleError(_0x2f5a36,null));};exports[_0x8c4b('0xbf')]=function(_0x1291b9,_0xc397f9,_0x3d6e47){return db[_0x8c4b('0x43')][_0x8c4b('0x65')]({'where':{'id':_0x1291b9[_0x8c4b('0x6a')]['id']}})['then'](handleEntityNotFound(_0xc397f9,null))[_0x8c4b('0x3a')](function(_0x47b139){if(_0x47b139){return _0x47b139['removeAgents'](_0x1291b9[_0x8c4b('0x49')][_0x8c4b('0x73')])['then'](function(){if(_[_0x8c4b('0xc0')](_0x1291b9['query']['ids'])){for(var _0x157488=0x0;_0x157488<_0x1291b9[_0x8c4b('0x49')][_0x8c4b('0x73')][_0x8c4b('0x4e')];_0x157488+=0x1){socket[_0x8c4b('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1291b9[_0x8c4b('0x49')][_0x8c4b('0x73')][_0x157488]),'OpenchannelAccountId':Number(_0x1291b9['params']['id'])});}}else{socket['emit'](_0x8c4b('0xc1'),{'UserId':Number(_0x1291b9[_0x8c4b('0x49')][_0x8c4b('0x73')]),'OpenchannelAccountId':Number(_0x1291b9[_0x8c4b('0x6a')]['id'])});}});}})[_0x8c4b('0x3a')](respondWithStatusCode(_0xc397f9,null))[_0x8c4b('0x5a')](handleError(_0xc397f9,null));};exports[_0x8c4b('0xc2')]=function(_0x25fa53,_0x2ea9dd,_0x4948fa){var _0x3f6b45={};var _0x2fe94e={};var _0xab0b23;var _0x178a3e;return db['OpenchannelAccount'][_0x8c4b('0x6f')]({'where':{'id':_0x25fa53[_0x8c4b('0x6a')]['id']}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x2ea9dd,null))[_0x8c4b('0x3a')](function(_0x21612d){if(_0x21612d){_0xab0b23=_0x21612d;_0x2fe94e[_0x8c4b('0x47')]=_['keys'](db['User'][_0x8c4b('0x5d')]);_0x2fe94e[_0x8c4b('0x49')]=_[_0x8c4b('0x4a')](_0x25fa53[_0x8c4b('0x49')]);_0x2fe94e['filters']=_[_0x8c4b('0x4b')](_0x2fe94e['model'],_0x2fe94e[_0x8c4b('0x49')]);_0x3f6b45[_0x8c4b('0x4d')]=_[_0x8c4b('0x4b')](_0x2fe94e[_0x8c4b('0x47')],qs['fields'](_0x25fa53['query'][_0x8c4b('0x4c')]));_0x3f6b45[_0x8c4b('0x4d')]=_0x3f6b45[_0x8c4b('0x4d')][_0x8c4b('0x4e')]?_0x3f6b45[_0x8c4b('0x4d')]:_0x2fe94e['model'];_0x3f6b45[_0x8c4b('0x71')]=qs[_0x8c4b('0x51')](_0x25fa53[_0x8c4b('0x49')][_0x8c4b('0x51')]);_0x3f6b45[_0x8c4b('0x52')]=qs[_0x8c4b('0x53')](_['pick'](_0x25fa53[_0x8c4b('0x49')],_0x2fe94e['filters']));if(_0x25fa53['query']['filter']){_0x3f6b45[_0x8c4b('0x52')]=_[_0x8c4b('0x56')](_0x3f6b45[_0x8c4b('0x52')],{'$or':_[_0x8c4b('0x42')](_0x3f6b45[_0x8c4b('0x4d')],function(_0x574686){var _0xf7ebf3={};_0xf7ebf3[_0x574686]={'$like':'%'+_0x25fa53[_0x8c4b('0x49')][_0x8c4b('0x55')]+'%'};return _0xf7ebf3;})});}_0x3f6b45=_['merge']({},_0x3f6b45,_0x25fa53[_0x8c4b('0x5f')]);return _0xab0b23[_0x8c4b('0xc2')](_0x3f6b45);}})[_0x8c4b('0x3a')](function(_0x253850){if(_0x253850){_0x178a3e=_0x253850['length'];if(!_0x25fa53[_0x8c4b('0x49')][_0x8c4b('0x4f')](_0x8c4b('0x50'))){_0x3f6b45[_0x8c4b('0x34')]=qs[_0x8c4b('0x34')](_0x25fa53[_0x8c4b('0x49')][_0x8c4b('0x34')]);_0x3f6b45[_0x8c4b('0x32')]=qs[_0x8c4b('0x32')](_0x25fa53[_0x8c4b('0x49')][_0x8c4b('0x32')]);}return _0xab0b23[_0x8c4b('0xc2')](_0x3f6b45);}})[_0x8c4b('0x3a')](function(_0x3b4e67){if(_0x3b4e67){return _0x3b4e67?{'count':_0x178a3e,'rows':_0x3b4e67}:null;}})[_0x8c4b('0x3a')](respondWithResult(_0x2ea9dd,null))[_0x8c4b('0x5a')](handleError(_0x2ea9dd,null));};exports['send']=function(_0x4913cf,_0x54c1c8,_0x39ecd8){var _0x4e51b5,_0x3a2dcb,_0x2e3e5c;if(_[_0x8c4b('0x7e')](_0x4913cf[_0x8c4b('0x69')][_0x8c4b('0x69')])||_0x4913cf['body'][_0x8c4b('0x69')]===''){throw new db[(_0x8c4b('0x78'))]['ValidationError'](_0x8c4b('0x81'));}if(_[_0x8c4b('0x7e')](_0x4913cf['body']['to'])){}_0x4e51b5=_0x4913cf[_0x8c4b('0x69')]['to'];return db[_0x8c4b('0x43')][_0x8c4b('0x6f')]({'where':{'id':_0x4913cf[_0x8c4b('0x6a')]['id']}})['then'](handleEntityNotFound(_0x54c1c8,null))['then'](function(_0x2c9d71){if(_0x2c9d71){return db[_0x8c4b('0x43')]['find']({'where':{'id':_0x2c9d71['id']},'include':[{'model':db['CmList'],'as':_0x8c4b('0x87'),'include':[{'model':db[_0x8c4b('0x90')],'as':_0x8c4b('0x88'),'where':{[_0x2c9d71[_0x8c4b('0x82')]]:_0x4e51b5},'limit':0x1,'order':[['updatedAt',_0x8c4b('0x89')]]}]}]})[_0x8c4b('0x3a')](handleEntityNotFound(_0x54c1c8,null))[_0x8c4b('0x3a')](function(_0x5ed027){if(_0x5ed027&&_0x5ed027[_0x8c4b('0x87')]){_0x3a2dcb=_0x5ed027['get']({'plain':!![]});if(_0x3a2dcb[_0x8c4b('0x87')]&&_0x3a2dcb[_0x8c4b('0x87')][_0x8c4b('0x88')]['length']){return _0x3a2dcb[_0x8c4b('0x87')][_0x8c4b('0x88')][0x0];}return db['CmContact'][_0x8c4b('0x60')](_[_0x8c4b('0x1b')](_0x4913cf[_0x8c4b('0x69')],{'firstName':_0x4e51b5,[_0x5ed027[_0x8c4b('0x82')]]:_0x4e51b5,'phone':_0x4e51b5,'ListId':_0x3a2dcb[_0x8c4b('0x7d')]}));}})[_0x8c4b('0x3a')](handleEntityNotFound(_0x54c1c8,null))[_0x8c4b('0x3a')](function(_0x4ff0ca){if(_0x4ff0ca){_0x2e3e5c=_0x4ff0ca;return db[_0x8c4b('0x95')][_0x8c4b('0x65')]({'where':{'ContactId':_0x2e3e5c['id'],'closed':![],'OpenchannelAccountId':_0x3a2dcb['id']}})[_0x8c4b('0x3a')](function(_0x1aa35b){if(_0x1aa35b){return[_0x1aa35b,![]];}return db[_0x8c4b('0x95')][_0x8c4b('0x60')]({'UserId':_0x4913cf['user']['id'],'ContactId':_0x2e3e5c['id'],'OpenchannelAccountId':_0x3a2dcb['id'],'lastMsgDirection':'out','Messages':[_[_0x8c4b('0x56')](_0x4913cf[_0x8c4b('0x69')],{'read':![],'body':_0x4913cf[_0x8c4b('0x69')]['body'],'OpenchannelAccountId':_0x3a2dcb['id'],'UserId':_0x4913cf['user']['id'],'ContactId':_0x2e3e5c['id']})]},{'include':[{'model':db[_0x8c4b('0xc3')],'as':_0x8c4b('0xc4')}]})[_0x8c4b('0x3a')](function(_0x6bc35f){return[_0x6bc35f,!![]];});});}})[_0x8c4b('0xbc')](function(_0x1479ad,_0x110e96){if(_0x110e96){return _0x1479ad;}return db[_0x8c4b('0xc3')][_0x8c4b('0x60')](_[_0x8c4b('0x56')](_0x4913cf[_0x8c4b('0x69')],{'read':![],'body':_0x4913cf[_0x8c4b('0x69')][_0x8c4b('0x69')],'OpenchannelAccountId':_0x3a2dcb['id'],'OpenchannelInteractionId':_0x1479ad['id'],'UserId':_0x4913cf[_0x8c4b('0x61')]['id'],'ContactId':_0x2e3e5c['id']}))[_0x8c4b('0x3a')](function(_0x2dfd6e){_0x1479ad[_0x8c4b('0xc5')][_0x8c4b('0xc4')]=[];_0x1479ad['dataValues']['Messages']['push'](_0x2dfd6e[_0x8c4b('0xc5')]);return _0x1479ad;});});}})['then'](respondWithResult(_0x54c1c8,null))[_0x8c4b('0x5a')](handleError(_0x54c1c8,null));}; \ No newline at end of file +var _0xb90d=['addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filters','order','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','openchannel','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','firstName','threadId','OpenchannelInteraction','externalUrl','contact','lastName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','notify','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','finally','getApplications','nolimit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','OpenchannelAccounts','destroy','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','mandatoryDispositionPause','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xb90d,0x1d5));var _0xdb90=function(_0x1d5daa,_0x452e80){_0x1d5daa=_0x1d5daa-0x0;var _0x5d14b1=_0xb90d[_0x1d5daa];return _0x5d14b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdb90('0x0'));var BPromise=require(_0xdb90('0x1'));var Mustache=require(_0xdb90('0x2'));var util=require('util');var path=require(_0xdb90('0x3'));var sox=require(_0xdb90('0x4'));var csv=require(_0xdb90('0x5'));var ejs=require(_0xdb90('0x6'));var fs=require('fs');var fs_extra=require(_0xdb90('0x7'));var _=require(_0xdb90('0x8'));var squel=require(_0xdb90('0x9'));var crypto=require('crypto');var jsforce=require(_0xdb90('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdb90('0x5'));var querystring=require(_0xdb90('0xb'));var Papa=require(_0xdb90('0xc'));var Redis=require(_0xdb90('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdb90('0xe'));var as=require(_0xdb90('0xf'));var hardwareService=require(_0xdb90('0x10'));var logger=require(_0xdb90('0x11'))('api');var utils=require(_0xdb90('0x12'));var config=require(_0xdb90('0x13'));var licenseUtil=require(_0xdb90('0x14'));var db=require(_0xdb90('0x15'))['db'];config[_0xdb90('0x16')]=_[_0xdb90('0x17')](config[_0xdb90('0x16')],{'host':_0xdb90('0x18'),'port':0x18eb});var socket=require(_0xdb90('0x19'))(new Redis(config[_0xdb90('0x16')]));require(_0xdb90('0x1a'))[_0xdb90('0x1b')](socket);var jayson=require(_0xdb90('0x1c'));var client=jayson['client'][_0xdb90('0x1d')]({'port':0x232c});var client9002=jayson[_0xdb90('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9b408d,_0x3f1c65,_0x4c6bad,_0x50a6da){return new BPromise(function(_0x576a7d,_0x1efcfc){var _0x3f827f=_0x50a6da||client;return _0x3f827f['request'](_0x9b408d,_0x4c6bad)[_0xdb90('0x1f')](function(_0x429862){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3f1c65,_0xdb90('0x20'));logger['debug'](_0xdb90('0x21'),_0x3f1c65,_0xdb90('0x20'),JSON[_0xdb90('0x22')](_0x429862));if(_0x429862['error']){if(_0x429862[_0xdb90('0x23')]['code']===0x1f4){logger[_0xdb90('0x23')](_0xdb90('0x24'),_0x3f1c65,_0x429862[_0xdb90('0x23')][_0xdb90('0x25')]);return _0x1efcfc(_0x429862[_0xdb90('0x23')][_0xdb90('0x25')]);}logger[_0xdb90('0x23')](_0xdb90('0x24'),_0x3f1c65,_0x429862[_0xdb90('0x23')][_0xdb90('0x25')]);return _0x576a7d(_0x429862['error'][_0xdb90('0x25')]);}else{logger[_0xdb90('0x26')](_0xdb90('0x24'),_0x3f1c65,_0xdb90('0x20'));_0x576a7d(_0x429862['result'][_0xdb90('0x25')]);}})[_0xdb90('0x27')](function(_0x6ab87a){logger[_0xdb90('0x23')](_0xdb90('0x24'),_0x3f1c65,_0x6ab87a);_0x1efcfc(_0x6ab87a);});});}function respondWithStatusCode(_0x400331,_0x5f215f){_0x5f215f=_0x5f215f||0xcc;return function(_0x513998){if(_0x513998){return _0x400331[_0xdb90('0x28')](_0x5f215f);}return _0x400331[_0xdb90('0x29')](_0x5f215f)[_0xdb90('0x2a')]();};}function respondWithResult(_0x1d9394,_0x18a872){_0x18a872=_0x18a872||0xc8;return function(_0x35627c){if(_0x35627c){return _0x1d9394[_0xdb90('0x29')](_0x18a872)[_0xdb90('0x2b')](_0x35627c);}};}function respondWithFilteredResult(_0x3947a6,_0x2bf431){return function(_0x416a38){if(_0x416a38){var _0x24411d=typeof _0x2bf431[_0xdb90('0x2c')]===_0xdb90('0x2d')&&typeof _0x2bf431[_0xdb90('0x2e')]===_0xdb90('0x2d');var _0x43a6fc=_0x416a38[_0xdb90('0x2f')];var _0x1f7e1f=_0x24411d?0x0:_0x2bf431[_0xdb90('0x2c')];var _0x333486=_0x24411d?_0x416a38[_0xdb90('0x2f')]:_0x2bf431[_0xdb90('0x2c')]+_0x2bf431[_0xdb90('0x2e')];var _0x5c377f;if(_0x333486>=_0x43a6fc){_0x333486=_0x43a6fc;_0x5c377f=0xc8;}else{_0x5c377f=0xce;}_0x3947a6[_0xdb90('0x29')](_0x5c377f);return _0x3947a6[_0xdb90('0x30')](_0xdb90('0x31'),_0x1f7e1f+'-'+_0x333486+'/'+_0x43a6fc)[_0xdb90('0x2b')](_0x416a38);}return null;};}function patchUpdates(_0x22b7cc){return function(_0x474036){try{jsonpatch['apply'](_0x474036,_0x22b7cc,!![]);}catch(_0x338ab9){return BPromise['reject'](_0x338ab9);}return _0x474036[_0xdb90('0x32')]();};}function saveUpdates(_0x1398ec,_0xafc78b){return function(_0x7afac3){if(_0x7afac3){return _0x7afac3[_0xdb90('0x33')](_0x1398ec)[_0xdb90('0x1f')](function(_0x3a39b2){return _0x3a39b2;});}return null;};}function removeEntity(_0x3eede7,_0x473407){return function(_0x1a5046){if(_0x1a5046){return _0x1a5046['destroy']()[_0xdb90('0x1f')](function(){var _0x4dfa82=_0x1a5046['get']({'plain':!![]});var _0x2d9303=_0xdb90('0x34');return db['UserProfileResource'][_0xdb90('0x35')]({'where':{'type':_0x2d9303,'resourceId':_0x4dfa82['id']}})[_0xdb90('0x1f')](function(){return _0x1a5046;});})[_0xdb90('0x1f')](function(){_0x3eede7[_0xdb90('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f6c93,_0x115372){return function(_0x367cf7){if(!_0x367cf7){_0x8f6c93[_0xdb90('0x28')](0x194);}return _0x367cf7;};}function handleError(_0x2bd61b,_0x4363da){_0x4363da=_0x4363da||0x1f4;return function(_0x29b692){logger['error'](_0x29b692[_0xdb90('0x36')]);if(_0x29b692[_0xdb90('0x37')]){delete _0x29b692[_0xdb90('0x37')];}_0x2bd61b[_0xdb90('0x29')](_0x4363da)[_0xdb90('0x38')](_0x29b692);};}exports[_0xdb90('0x39')]=function(_0x1c3e68,_0x4a1b96){var _0x518545={'include':[{'model':db[_0xdb90('0x3a')],'as':'mandatoryDispositionPause'}]},_0x4da5bb={},_0x445eb7={'count':0x0,'rows':[]};var _0x3f600f=_['map'](db[_0xdb90('0x3b')][_0xdb90('0x3c')],function(_0x2bef8e){return{'name':_0x2bef8e[_0xdb90('0x3d')],'type':_0x2bef8e[_0xdb90('0x3e')]['key']};});_0x4da5bb[_0xdb90('0x3f')]=_['map'](_0x3f600f,_0xdb90('0x37'));_0x4da5bb[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x1c3e68[_0xdb90('0x40')]);_0x4da5bb['filters']=_[_0xdb90('0x42')](_0x4da5bb[_0xdb90('0x3f')],_0x4da5bb[_0xdb90('0x40')]);_0x518545[_0xdb90('0x43')]=_['intersection'](_0x4da5bb['model'],qs[_0xdb90('0x44')](_0x1c3e68['query']['fields']));_0x518545['attributes']=_0x518545[_0xdb90('0x43')][_0xdb90('0x45')]?_0x518545[_0xdb90('0x43')]:_0x4da5bb['model'];if(!_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x46')]('nolimit')){_0x518545['limit']=qs['limit'](_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x2e')]);_0x518545['offset']=qs['offset'](_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x2c')]);}_0x518545['order']=qs[_0xdb90('0x47')](_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x47')]);_0x518545[_0xdb90('0x48')]=qs['filters'](_[_0xdb90('0x49')](_0x1c3e68[_0xdb90('0x40')],_0x4da5bb['filters']),_0x3f600f);if(_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x4a')]){_0x518545[_0xdb90('0x48')]=_[_0xdb90('0x4b')](_0x518545['where'],{'$or':_[_0xdb90('0x4c')](_0x3f600f,function(_0x9f2a82){if(_0x9f2a82[_0xdb90('0x3e')]!==_0xdb90('0x4d')){var _0x1c4ead={};_0x1c4ead[_0x9f2a82[_0xdb90('0x37')]]={'$like':'%'+_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x4a')]+'%'};return _0x1c4ead;}})});}_0x518545=_[_0xdb90('0x4b')]({},_0x518545,_0x1c3e68[_0xdb90('0x4e')]);var _0x486c2e={'where':_0x518545[_0xdb90('0x48')]};return db[_0xdb90('0x3b')][_0xdb90('0x2f')](_0x486c2e)['then'](function(_0xbf65e0){_0x445eb7[_0xdb90('0x2f')]=_0xbf65e0;if(_0x1c3e68[_0xdb90('0x40')][_0xdb90('0x4f')]){_0x518545[_0xdb90('0x50')]=[{'all':!![]}];}return db[_0xdb90('0x3b')][_0xdb90('0x51')](_0x518545);})['then'](function(_0x219811){_0x445eb7['rows']=_0x219811;return _0x445eb7;})[_0xdb90('0x1f')](respondWithFilteredResult(_0x4a1b96,_0x518545))[_0xdb90('0x27')](handleError(_0x4a1b96,null));};exports[_0xdb90('0x52')]=function(_0x4d4657,_0x5e1985){var _0x270012={'raw':![],'where':{'id':_0x4d4657['params']['id']},'include':[{'model':db[_0xdb90('0x3a')],'as':_0xdb90('0x53')}]},_0x2adfe8={};_0x2adfe8[_0xdb90('0x3f')]=_[_0xdb90('0x41')](db['OpenchannelAccount'][_0xdb90('0x3c')]);_0x2adfe8[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x4d4657[_0xdb90('0x40')]);_0x2adfe8['filters']=_['intersection'](_0x2adfe8[_0xdb90('0x3f')],_0x2adfe8[_0xdb90('0x40')]);_0x270012[_0xdb90('0x43')]=_[_0xdb90('0x42')](_0x2adfe8[_0xdb90('0x3f')],qs[_0xdb90('0x44')](_0x4d4657[_0xdb90('0x40')][_0xdb90('0x44')]));_0x270012[_0xdb90('0x43')]=_0x270012[_0xdb90('0x43')]['length']?_0x270012[_0xdb90('0x43')]:_0x2adfe8[_0xdb90('0x3f')];if(_0x4d4657[_0xdb90('0x40')][_0xdb90('0x4f')]){_0x270012[_0xdb90('0x50')]=[{'all':!![]}];}_0x270012=_[_0xdb90('0x4b')]({},_0x270012,_0x4d4657['options']);return db[_0xdb90('0x3b')][_0xdb90('0x54')](_0x270012)[_0xdb90('0x1f')](handleEntityNotFound(_0x5e1985,null))['then'](respondWithResult(_0x5e1985,null))[_0xdb90('0x27')](handleError(_0x5e1985,null));};exports[_0xdb90('0x55')]=function(_0x152047,_0x1f5e12){return db[_0xdb90('0x3b')][_0xdb90('0x55')](_0x152047[_0xdb90('0x56')],{})['then'](function(_0x1e936b){var _0x51e8e9=_0x152047[_0xdb90('0x57')][_0xdb90('0x58')]({'plain':!![]});if(!_0x51e8e9)throw new Error(_0xdb90('0x59'));if(_0x51e8e9[_0xdb90('0x5a')]==='user'){var _0x543506=_0x1e936b[_0xdb90('0x58')]({'plain':!![]});var _0x432df8='OpenchannelAccounts';return db[_0xdb90('0x5b')][_0xdb90('0x54')]({'where':{'name':_0x432df8,'userProfileId':_0x51e8e9[_0xdb90('0x5c')]},'raw':!![]})[_0xdb90('0x1f')](function(_0x46dbd6){if(_0x46dbd6&&_0x46dbd6[_0xdb90('0x5d')]===0x0){return db[_0xdb90('0x5e')]['create']({'name':_0x543506[_0xdb90('0x37')],'resourceId':_0x543506['id'],'type':_0x46dbd6[_0xdb90('0x37')],'sectionId':_0x46dbd6['id']},{})['then'](function(){return _0x1e936b;});}else{return _0x1e936b;}})['catch'](function(_0x5d2afb){logger[_0xdb90('0x23')](_0xdb90('0x5f'),_0x5d2afb);throw _0x5d2afb;});}return _0x1e936b;})[_0xdb90('0x1f')](respondWithResult(_0x1f5e12,0xc9))[_0xdb90('0x27')](handleError(_0x1f5e12,null));};exports[_0xdb90('0x33')]=function(_0x1e75e4,_0x51649b){if(_0x1e75e4[_0xdb90('0x56')]['id']){delete _0x1e75e4[_0xdb90('0x56')]['id'];}return db[_0xdb90('0x3b')][_0xdb90('0x54')]({'where':{'id':_0x1e75e4[_0xdb90('0x60')]['id']},'include':[{'model':db[_0xdb90('0x3a')],'as':_0xdb90('0x53')}]})[_0xdb90('0x1f')](handleEntityNotFound(_0x51649b,null))[_0xdb90('0x1f')](saveUpdates(_0x1e75e4[_0xdb90('0x56')],null))['then'](respondWithResult(_0x51649b,null))['catch'](handleError(_0x51649b,null));};exports[_0xdb90('0x35')]=function(_0x498308,_0x5a0232){return db[_0xdb90('0x3b')]['find']({'where':{'id':_0x498308[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x5a0232,null))[_0xdb90('0x1f')](removeEntity(_0x5a0232,null))[_0xdb90('0x27')](handleError(_0x5a0232,null));};exports[_0xdb90('0x61')]=function(_0x26d369,_0x424286){return db[_0xdb90('0x3b')][_0xdb90('0x61')]()[_0xdb90('0x1f')](respondWithResult(_0x424286,null))[_0xdb90('0x27')](handleError(_0x424286,null));};exports[_0xdb90('0x62')]=function(_0x353dfc,_0x37537b,_0xa12086){if(_0x353dfc[_0xdb90('0x56')]['id']){delete _0x353dfc['body']['id'];}return db[_0xdb90('0x3b')]['find']({'where':{'id':_0x353dfc[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x37537b,null))[_0xdb90('0x1f')](function(_0x1c96bc){if(_0x1c96bc){_0x353dfc[_0xdb90('0x56')][_0xdb90('0x63')]=_0x1c96bc['id'];return db[_0xdb90('0x64')][_0xdb90('0x55')](_0x353dfc[_0xdb90('0x56')]);}})[_0xdb90('0x1f')](respondWithResult(_0x37537b,null))[_0xdb90('0x27')](handleError(_0x37537b,null));};exports[_0xdb90('0x65')]=function(_0x55d825,_0x44d5d1,_0x8047d0){var _0x359853={'raw':![],'where':{}};var _0x3c650e={};var _0x1fc6c6={'count':0x0,'rows':[]};return db[_0xdb90('0x3b')][_0xdb90('0x66')]({'where':{'id':_0x55d825[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x44d5d1,null))[_0xdb90('0x1f')](function(_0x1d4793){if(_0x1d4793){_0x3c650e[_0xdb90('0x3f')]=_[_0xdb90('0x41')](db[_0xdb90('0x64')][_0xdb90('0x3c')]);_0x3c650e[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x55d825[_0xdb90('0x40')]);_0x3c650e[_0xdb90('0x67')]=_[_0xdb90('0x42')](_0x3c650e[_0xdb90('0x3f')],_0x3c650e[_0xdb90('0x40')]);_0x359853['attributes']=_[_0xdb90('0x42')](_0x3c650e['model'],qs[_0xdb90('0x44')](_0x55d825[_0xdb90('0x40')]['fields']));_0x359853[_0xdb90('0x43')]=_0x359853['attributes'][_0xdb90('0x45')]?_0x359853[_0xdb90('0x43')]:_0x3c650e[_0xdb90('0x3f')];if(!_0x55d825[_0xdb90('0x40')][_0xdb90('0x46')]('nolimit')){_0x359853[_0xdb90('0x2e')]=qs['limit'](_0x55d825[_0xdb90('0x40')]['limit']);_0x359853[_0xdb90('0x2c')]=qs[_0xdb90('0x2c')](_0x55d825['query'][_0xdb90('0x2c')]);}_0x359853[_0xdb90('0x68')]=qs[_0xdb90('0x47')](_0x55d825[_0xdb90('0x40')]['sort']);_0x359853[_0xdb90('0x48')]=qs[_0xdb90('0x67')](_[_0xdb90('0x49')](_0x55d825[_0xdb90('0x40')],_0x3c650e[_0xdb90('0x67')]));_0x359853['where'][_0xdb90('0x63')]=_0x1d4793['id'];if(_0x55d825[_0xdb90('0x40')]['filter']){_0x359853[_0xdb90('0x48')]=_[_0xdb90('0x4b')](_0x359853[_0xdb90('0x48')],{'$or':_[_0xdb90('0x4c')](_0x359853[_0xdb90('0x43')],function(_0x65f838){var _0x3fe748={};_0x3fe748[_0x65f838]={'$like':'%'+_0x55d825[_0xdb90('0x40')][_0xdb90('0x4a')]+'%'};return _0x3fe748;})});}_0x359853=_['merge']({},_0x359853,_0x55d825['options']);return db[_0xdb90('0x64')][_0xdb90('0x2f')]({'where':_0x359853[_0xdb90('0x48')]})[_0xdb90('0x1f')](function(_0x4c19b7){_0x1fc6c6[_0xdb90('0x2f')]=_0x4c19b7;if(_0x55d825[_0xdb90('0x40')][_0xdb90('0x4f')]){_0x359853[_0xdb90('0x50')]=[{'all':!![]}];}return db[_0xdb90('0x64')]['findAll'](_0x359853);})[_0xdb90('0x1f')](function(_0x3df498){_0x1fc6c6['rows']=_0x3df498;return _0x1fc6c6;});}})[_0xdb90('0x1f')](respondWithFilteredResult(_0x44d5d1,_0x359853))[_0xdb90('0x27')](handleError(_0x44d5d1,null));};exports[_0xdb90('0x69')]=function(_0x3631b1,_0x1a22ee,_0x470467){return db[_0xdb90('0x3b')][_0xdb90('0x54')]({'where':{'id':_0x3631b1[_0xdb90('0x60')]['id']}})['then'](handleEntityNotFound(_0x1a22ee,null))['then'](function(_0x213db7){if(_0x213db7){return _0x213db7['removeDispositions'](_0x3631b1[_0xdb90('0x40')][_0xdb90('0x6a')]);}})[_0xdb90('0x1f')](respondWithStatusCode(_0x1a22ee,null))[_0xdb90('0x27')](handleError(_0x1a22ee,null));};exports['addAnswer']=function(_0x1793ee,_0x33d9f7,_0x1189d6){if(_0x1793ee[_0xdb90('0x56')]['id']){delete _0x1793ee[_0xdb90('0x56')]['id'];}return db[_0xdb90('0x3b')]['find']({'where':{'id':_0x1793ee[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x33d9f7,null))[_0xdb90('0x1f')](function(_0x14ac69){if(_0x14ac69){_0x1793ee[_0xdb90('0x56')][_0xdb90('0x63')]=_0x14ac69['id'];return db[_0xdb90('0x6b')]['create'](_0x1793ee[_0xdb90('0x56')]);}})[_0xdb90('0x1f')](respondWithResult(_0x33d9f7,null))[_0xdb90('0x27')](handleError(_0x33d9f7,null));};exports[_0xdb90('0x6c')]=function(_0x3a7b4e,_0x56a1f5,_0x358be1){var _0x177751={'raw':![],'where':{}};var _0x170dfc={};var _0x473eb0={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xdb90('0x66')]({'where':{'id':_0x3a7b4e[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x56a1f5,null))[_0xdb90('0x1f')](function(_0x497a83){if(_0x497a83){_0x170dfc['model']=_[_0xdb90('0x41')](db[_0xdb90('0x6b')]['rawAttributes']);_0x170dfc[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x3a7b4e['query']);_0x170dfc['filters']=_[_0xdb90('0x42')](_0x170dfc['model'],_0x170dfc[_0xdb90('0x40')]);_0x177751[_0xdb90('0x43')]=_['intersection'](_0x170dfc[_0xdb90('0x3f')],qs[_0xdb90('0x44')](_0x3a7b4e[_0xdb90('0x40')]['fields']));_0x177751[_0xdb90('0x43')]=_0x177751['attributes'][_0xdb90('0x45')]?_0x177751[_0xdb90('0x43')]:_0x170dfc['model'];if(!_0x3a7b4e[_0xdb90('0x40')][_0xdb90('0x46')]('nolimit')){_0x177751[_0xdb90('0x2e')]=qs[_0xdb90('0x2e')](_0x3a7b4e['query'][_0xdb90('0x2e')]);_0x177751[_0xdb90('0x2c')]=qs[_0xdb90('0x2c')](_0x3a7b4e[_0xdb90('0x40')]['offset']);}_0x177751[_0xdb90('0x68')]=qs['sort'](_0x3a7b4e[_0xdb90('0x40')]['sort']);_0x177751[_0xdb90('0x48')]=qs[_0xdb90('0x67')](_[_0xdb90('0x49')](_0x3a7b4e['query'],_0x170dfc[_0xdb90('0x67')]));_0x177751['where'][_0xdb90('0x63')]=_0x497a83['id'];if(_0x3a7b4e[_0xdb90('0x40')][_0xdb90('0x4a')]){_0x177751[_0xdb90('0x48')]=_[_0xdb90('0x4b')](_0x177751[_0xdb90('0x48')],{'$or':_['map'](_0x177751['attributes'],function(_0x30fa1d){var _0x1b87ad={};_0x1b87ad[_0x30fa1d]={'$like':'%'+_0x3a7b4e[_0xdb90('0x40')][_0xdb90('0x4a')]+'%'};return _0x1b87ad;})});}_0x177751=_['merge']({},_0x177751,_0x3a7b4e[_0xdb90('0x4e')]);return db['CannedAnswer'][_0xdb90('0x2f')]({'where':_0x177751['where']})['then'](function(_0x259918){_0x473eb0[_0xdb90('0x2f')]=_0x259918;if(_0x3a7b4e[_0xdb90('0x40')][_0xdb90('0x4f')]){_0x177751[_0xdb90('0x50')]=[{'all':!![]}];}return db[_0xdb90('0x6b')][_0xdb90('0x51')](_0x177751);})['then'](function(_0x5d5711){_0x473eb0[_0xdb90('0x6d')]=_0x5d5711;return _0x473eb0;});}})[_0xdb90('0x1f')](respondWithFilteredResult(_0x56a1f5,_0x177751))[_0xdb90('0x27')](handleError(_0x56a1f5,null));};exports[_0xdb90('0x6e')]=function(_0x242498,_0x4b8123,_0x4a633a){return db['OpenchannelAccount']['find']({'where':{'id':_0x242498[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x4b8123,null))[_0xdb90('0x1f')](function(_0x198b51){if(_0x198b51){return _0x198b51[_0xdb90('0x6e')](_0x242498['query'][_0xdb90('0x6a')]);}})[_0xdb90('0x1f')](respondWithStatusCode(_0x4b8123,null))[_0xdb90('0x27')](handleError(_0x4b8123,null));};exports['notify']=function(_0x10757f,_0x6ba515,_0x52ff48){var _0x140028={'body':_0x10757f[_0xdb90('0x56')],'channel':_0xdb90('0x6f')};var _0xc710ee=[];var _0x559e53=[];var _0x2ffb64={};var _0x1f60c5=![];return db['CmContact'][_0xdb90('0x61')]()[_0xdb90('0x1f')](function(_0x4e8040){if(!_0x4e8040){throw new db[(_0xdb90('0x70'))]['ValidationError'](_0xdb90('0x71'));}_0xc710ee=_[_0xdb90('0x72')](_[_0xdb90('0x41')](_0x4e8040),['createdAt',_0xdb90('0x73')]);_0x559e53=_[_0xdb90('0x72')](_[_0xdb90('0x41')](_0x4e8040),[_0xdb90('0x74'),_0xdb90('0x73'),_0xdb90('0x75'),_0xdb90('0x76')]);if(_0x10757f[_0xdb90('0x56')]['id']){delete _0x10757f[_0xdb90('0x56')]['id'];}if(_[_0xdb90('0x77')](_0x10757f[_0xdb90('0x56')]['from'])){throw new db[(_0xdb90('0x70'))][(_0xdb90('0x78'))](_0xdb90('0x79'));}if(_[_0xdb90('0x77')](_0x10757f['body'][_0xdb90('0x56')])||_0x10757f[_0xdb90('0x56')]['body']===''){throw new db[(_0xdb90('0x70'))]['ValidationError'](_0xdb90('0x7a'));}if(_[_0xdb90('0x77')](_0x10757f[_0xdb90('0x56')][_0xdb90('0x7b')])){throw new db[(_0xdb90('0x70'))][(_0xdb90('0x78'))](_0xdb90('0x7c')+_0x559e53);}if(!_[_0xdb90('0x7d')](_0x559e53,_0x10757f[_0xdb90('0x56')]['mapKey'])){throw new db[(_0xdb90('0x70'))][(_0xdb90('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x559e53);}_0x2ffb64[_0x10757f['body']['mapKey']]=_0x10757f[_0xdb90('0x56')][_0xdb90('0x7e')];})[_0xdb90('0x1f')](function(){return db[_0xdb90('0x3b')][_0xdb90('0x54')]({'where':{'id':_0x10757f['params']['id']},'include':[{'model':db[_0xdb90('0x7f')],'as':_0xdb90('0x80'),'include':[{'model':db[_0xdb90('0x81')],'as':_0xdb90('0x82'),'where':_0x2ffb64,'limit':0x1,'order':[['updatedAt',_0xdb90('0x83')]]}]},{'model':db[_0xdb90('0x84')],'as':_0xdb90('0x85')}]});})[_0xdb90('0x1f')](handleEntityNotFound(_0x6ba515,null))[_0xdb90('0x1f')](function(_0x458d72){if(_0x458d72&&_0x458d72[_0xdb90('0x80')]){_0x140028[_0xdb90('0x86')]=_0x458d72;_0x140028['applications']=_0x458d72[_0xdb90('0x85')];_0x140028['list']=_0x458d72[_0xdb90('0x80')];_0x140028[_0xdb90('0x87')]=_[_0xdb90('0x88')](_0x140028['applications'],[_0xdb90('0x89')],['asc']);if(_0x140028[_0xdb90('0x86')][_0xdb90('0x85')]){delete _0x140028[_0xdb90('0x86')][_0xdb90('0x85')];}if(_0x140028['account'][_0xdb90('0x80')]&&_0x140028[_0xdb90('0x86')][_0xdb90('0x80')][_0xdb90('0x82')]['length']){return _0x140028['account'][_0xdb90('0x80')][_0xdb90('0x82')][0x0];}var _0x15d420=_['defaults'](_0x10757f['body'],{'firstName':_0x10757f['body'][_0xdb90('0x7e')],'ListId':_0x458d72[_0xdb90('0x76')]});_0x15d420[_0x10757f[_0xdb90('0x56')]['mapKey']]=_0x10757f[_0xdb90('0x56')][_0xdb90('0x7e')];return db[_0xdb90('0x81')][_0xdb90('0x55')](_0x15d420,{'fields':_0xc710ee,'raw':!![]});}})[_0xdb90('0x1f')](handleEntityNotFound(_0x6ba515,null))['then'](function(_0x44d17e){_0x140028['contact']=_0x44d17e;if(_0x44d17e){var _0x3f895d={'ContactId':_0x44d17e['id'],'OpenchannelAccountId':_0x10757f[_0xdb90('0x60')]['id'],'from':(_0x44d17e[_0xdb90('0x8a')]||'')+'\x20'+(_0x44d17e['lastName']||'')};var _0x17cfdd={'OpenchannelAccountId':_0x10757f[_0xdb90('0x60')]['id'],'closed':![]};if(_0x10757f[_0xdb90('0x56')]['threadId']){_0x17cfdd[_0xdb90('0x8b')]=_0x10757f['body'][_0xdb90('0x8b')];return db[_0xdb90('0x8c')]['find']({'where':_0x17cfdd})[_0xdb90('0x1f')](function(_0xe85f95){if(_0xe85f95){return[_0xe85f95,![]];}_0x3f895d[_0xdb90('0x8b')]=_0x10757f[_0xdb90('0x56')]['threadId'];_0x3f895d[_0xdb90('0x8d')]=_0x10757f[_0xdb90('0x56')]['externalUrl'];return db[_0xdb90('0x8c')]['create'](_0x3f895d)['then'](function(_0x42be95){return[_0x42be95,!![]];});});}else{_0x17cfdd[_0xdb90('0x8b')]=null;}_0x17cfdd['ContactId']=_0x44d17e['id'];return db[_0xdb90('0x8c')]['find']({'where':_0x17cfdd})[_0xdb90('0x1f')](function(_0x38e37e){if(_0x38e37e){return[_0x38e37e,![]];}return db[_0xdb90('0x8c')]['create'](_0x3f895d)[_0xdb90('0x1f')](function(_0x337496){return[_0x337496,!![]];});});}})['spread'](function(_0x4aac72,_0x19cf1f){if(_0x4aac72){_0x1f60c5=_0x19cf1f;if(!_0x19cf1f){var _0x381339={'from':(_0x140028[_0xdb90('0x8e')][_0xdb90('0x8a')]||'')+'\x20'+(_0x140028[_0xdb90('0x8e')][_0xdb90('0x8f')]||'')};if(_0x10757f['body'][_0xdb90('0x8b')]&&_0x10757f[_0xdb90('0x56')]['messageId']&&_0x10757f[_0xdb90('0x56')][_0xdb90('0x8b')]!=_0x10757f[_0xdb90('0x56')]['messageId']){_0x381339[_0xdb90('0x8b')]=_0x10757f[_0xdb90('0x56')][_0xdb90('0x90')];}return _0x4aac72[_0xdb90('0x33')](_0x381339);}else{return _0x4aac72;}}})[_0xdb90('0x1f')](function(_0x5ed6b8){_0x140028[_0xdb90('0x91')]=_0x5ed6b8['get']({'plain':!![]});_0x140028[_0xdb90('0x91')]['created']=_0x1f60c5;if(_0x140028[_0xdb90('0x91')][_0xdb90('0x92')]){if(_0x140028[_0xdb90('0x86')][_0xdb90('0x93')]){_0x140028[_0xdb90('0x87')][_0xdb90('0x94')]({'id':0x0,'priority':_0x140028[_0xdb90('0x87')]['length']+0x1,'app':'close','appdata':_0xdb90('0x95'),'interval':_0xdb90('0x96')});}}return db[_0xdb90('0x97')][_0xdb90('0x55')]({'body':_0x10757f[_0xdb90('0x56')]['body'],'OpenchannelAccountId':_0x10757f[_0xdb90('0x60')]['id'],'OpenchannelInteractionId':_0x5ed6b8['id'],'direction':'in','ContactId':_0x140028['contact']['id'],'AttachmentId':_0x10757f['body'][_0xdb90('0x98')]});})['then'](function(_0x4aca97){_0x140028[_0xdb90('0x25')]=_0x4aca97;if(_0x140028[_0xdb90('0x91')][_0xdb90('0x99')]){return db[_0xdb90('0x9a')][_0xdb90('0x54')]({'attributes':['id',_0xdb90('0x37')],'where':{'id':_0x140028[_0xdb90('0x91')][_0xdb90('0x99')]}})[_0xdb90('0x1f')](function(_0x61a338){if(_0x61a338){_0x140028['applications'][_0xdb90('0x9b')]({'id':0x0,'priority':0x0,'app':_0xdb90('0x9c'),'appdata':_0x61a338[_0xdb90('0x37')]+','+(_0x140028[_0xdb90('0x86')][_0xdb90('0x9d')]||0xa),'interval':_0xdb90('0x96')});_0x140028[_0xdb90('0x9e')]=![];}return respondWithRpcPromise(_0xdb90('0x9f'),_0xdb90('0xa0'),_0x140028);});}return respondWithRpcPromise(_0xdb90('0x9f'),_0xdb90('0xa0'),_0x140028);})[_0xdb90('0x1f')](function(_0x41d54e){respondWithRpcPromise('EventManager','EventManager',{'event':_0xdb90('0xa1'),'message':_0x41d54e},client9002);return _0x41d54e;})[_0xdb90('0x1f')](respondWithResult(_0x6ba515,null))['catch'](handleError(_0x6ba515,null));};exports[_0xdb90('0xa2')]=function(_0x334a1b,_0x56c461){var _0xf29f4b=_0x334a1b[_0xdb90('0x60')]['id'];var _0x20a164=_0x334a1b['body'];var _0x17c064=0xc8;var _0x50ea3b=null;return db[_0xdb90('0xa3')]['transaction']({'isolationLevel':db[_0xdb90('0xa3')][_0xdb90('0xa4')]['ISOLATION_LEVELS'][_0xdb90('0xa5')]},function(_0x45dfee){return db[_0xdb90('0x3b')]['findOne']({'where':{'id':_0xf29f4b},'transaction':_0x45dfee})[_0xdb90('0x1f')](function(_0x2616b2){if(_0x2616b2){return db[_0xdb90('0x84')][_0xdb90('0x35')]({'where':{'OpenchannelAccountId':_0xf29f4b},'transaction':_0x45dfee})[_0xdb90('0x1f')](function(){var _0x8a1e97=_['map'](_0x20a164,function(_0x1aa32a){_0x1aa32a[_0xdb90('0x63')]=_0xf29f4b;return _0x1aa32a;});return db[_0xdb90('0x84')][_0xdb90('0xa6')](_0x8a1e97,{'transaction':_0x45dfee});});}else{_0x17c064=0x194;_0x50ea3b=[];}});})['then'](function(){if(_0x17c064!==0x194){return db[_0xdb90('0x84')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0xf29f4b},'order':_0xdb90('0x89')})['then'](function(_0x2680bb){_0x50ea3b=_0x2680bb;});}})[_0xdb90('0x27')](function(_0x5e1984){_0x17c064=0x1f4;logger[_0xdb90('0x23')](_0x5e1984[_0xdb90('0x36')]);if(_0x5e1984['name']){delete _0x5e1984[_0xdb90('0x37')];}_0x50ea3b=_0x5e1984;})[_0xdb90('0xa7')](function(){if(_0x50ea3b===null){_0x56c461[_0xdb90('0x28')](_0x17c064);}else{if(_0x17c064===0x1f4){_0x56c461[_0xdb90('0x29')](_0x17c064)[_0xdb90('0x38')](_0x50ea3b);}else{_0x56c461[_0xdb90('0x29')](_0x17c064)[_0xdb90('0x2b')](_0x50ea3b);}}});};exports[_0xdb90('0xa8')]=function(_0x22e28c,_0x42a9b5,_0x4ee166){var _0x58caee={};var _0x366005={};var _0x1283ce;var _0x30ecea;return db[_0xdb90('0x3b')][_0xdb90('0x66')]({'where':{'id':_0x22e28c[_0xdb90('0x60')]['id']}})['then'](handleEntityNotFound(_0x42a9b5,null))[_0xdb90('0x1f')](function(_0x2696dc){if(_0x2696dc){_0x1283ce=_0x2696dc;_0x366005['model']=_[_0xdb90('0x41')](db[_0xdb90('0x84')][_0xdb90('0x3c')]);_0x366005[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x22e28c['query']);_0x366005[_0xdb90('0x67')]=_[_0xdb90('0x42')](_0x366005['model'],_0x366005[_0xdb90('0x40')]);_0x58caee[_0xdb90('0x43')]=_['intersection'](_0x366005[_0xdb90('0x3f')],qs[_0xdb90('0x44')](_0x22e28c['query'][_0xdb90('0x44')]));_0x58caee[_0xdb90('0x43')]=_0x58caee['attributes'][_0xdb90('0x45')]?_0x58caee['attributes']:_0x366005[_0xdb90('0x3f')];_0x58caee[_0xdb90('0x68')]=qs[_0xdb90('0x47')](_0x22e28c[_0xdb90('0x40')][_0xdb90('0x47')]);_0x58caee[_0xdb90('0x48')]=qs[_0xdb90('0x67')](_[_0xdb90('0x49')](_0x22e28c[_0xdb90('0x40')],_0x366005[_0xdb90('0x67')]));if(_0x22e28c[_0xdb90('0x40')][_0xdb90('0x4a')]){_0x58caee['where']=_[_0xdb90('0x4b')](_0x58caee['where'],{'$or':_['map'](_0x58caee[_0xdb90('0x43')],function(_0x2c1620){var _0x1ee014={};_0x1ee014[_0x2c1620]={'$like':'%'+_0x22e28c[_0xdb90('0x40')][_0xdb90('0x4a')]+'%'};return _0x1ee014;})});}_0x58caee=_['merge']({},_0x58caee,_0x22e28c[_0xdb90('0x4e')]);return _0x1283ce[_0xdb90('0xa8')](_0x58caee);}})[_0xdb90('0x1f')](function(_0x21f2cb){if(_0x21f2cb){_0x30ecea=_0x21f2cb[_0xdb90('0x45')];if(!_0x22e28c['query'][_0xdb90('0x46')](_0xdb90('0xa9'))){_0x58caee['limit']=qs[_0xdb90('0x2e')](_0x22e28c[_0xdb90('0x40')][_0xdb90('0x2e')]);_0x58caee['offset']=qs[_0xdb90('0x2c')](_0x22e28c['query'][_0xdb90('0x2c')]);}return _0x1283ce[_0xdb90('0xa8')](_0x58caee);}})[_0xdb90('0x1f')](function(_0x3bd7e0){if(_0x3bd7e0){return _0x3bd7e0?{'count':_0x30ecea,'rows':_0x3bd7e0}:null;}})['then'](respondWithResult(_0x42a9b5,null))[_0xdb90('0x27')](handleError(_0x42a9b5,null));};exports[_0xdb90('0xaa')]=function(_0x11b99a,_0x34a48a,_0x79f2cc){var _0x2da0e0={'raw':![],'where':{}};var _0x159838={};var _0x41933f={'count':0x0,'rows':[]};return db[_0xdb90('0x3b')][_0xdb90('0x66')]({'where':{'id':_0x11b99a[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x34a48a,null))[_0xdb90('0x1f')](function(_0x392938){if(_0x392938){_0x159838[_0xdb90('0x3f')]=_[_0xdb90('0x41')](db['OpenchannelInteraction']['rawAttributes']);_0x159838[_0xdb90('0x40')]=_['keys'](_0x11b99a[_0xdb90('0x40')]);_0x159838[_0xdb90('0x67')]=_[_0xdb90('0x42')](_0x159838[_0xdb90('0x3f')],_0x159838['query']);_0x2da0e0['attributes']=_[_0xdb90('0x42')](_0x159838[_0xdb90('0x3f')],qs['fields'](_0x11b99a[_0xdb90('0x40')][_0xdb90('0x44')]));_0x2da0e0[_0xdb90('0x43')]=_0x2da0e0[_0xdb90('0x43')][_0xdb90('0x45')]?_0x2da0e0['attributes']:_0x159838[_0xdb90('0x3f')];if(!_0x11b99a[_0xdb90('0x40')][_0xdb90('0x46')]('nolimit')){_0x2da0e0[_0xdb90('0x2e')]=qs[_0xdb90('0x2e')](_0x11b99a[_0xdb90('0x40')][_0xdb90('0x2e')]);_0x2da0e0[_0xdb90('0x2c')]=qs[_0xdb90('0x2c')](_0x11b99a[_0xdb90('0x40')]['offset']);}_0x2da0e0[_0xdb90('0x68')]=qs[_0xdb90('0x47')](_0x11b99a[_0xdb90('0x40')][_0xdb90('0x47')]);_0x2da0e0[_0xdb90('0x48')]=qs[_0xdb90('0x67')](_['pick'](_0x11b99a[_0xdb90('0x40')],_0x159838[_0xdb90('0x67')]));_0x2da0e0['where'][_0xdb90('0x63')]=_0x392938['id'];if(_0x11b99a[_0xdb90('0x40')][_0xdb90('0x4a')]){_0x2da0e0[_0xdb90('0x48')]=_[_0xdb90('0x4b')](_0x2da0e0[_0xdb90('0x48')],{'$or':_['map'](_0x2da0e0['attributes'],function(_0x246bfa){var _0x50217c={};_0x50217c[_0x246bfa]={'$like':'%'+_0x11b99a[_0xdb90('0x40')]['filter']+'%'};return _0x50217c;})});}_0x2da0e0=_[_0xdb90('0x4b')]({},_0x2da0e0,_0x11b99a['options']);return db[_0xdb90('0x8c')][_0xdb90('0x2f')]({'where':_0x2da0e0[_0xdb90('0x48')]})[_0xdb90('0x1f')](function(_0x79040f){_0x41933f[_0xdb90('0x2f')]=_0x79040f;if(_0x11b99a[_0xdb90('0x40')][_0xdb90('0x4f')]){_0x2da0e0[_0xdb90('0x50')]=[{'model':db['CmContact'],'as':_0xdb90('0xab'),'required':![]},{'model':db[_0xdb90('0x9a')],'as':_0xdb90('0xac'),'attributes':[_0xdb90('0x37'),_0xdb90('0xad'),'internal'],'required':![]},{'model':db[_0xdb90('0xae')],'as':_0xdb90('0xaf'),'attributes':['id',_0xdb90('0x37'),'color'],'where':_0x11b99a[_0xdb90('0x40')][_0xdb90('0xb0')]?{'id':_0x11b99a[_0xdb90('0x40')][_0xdb90('0xb0')]}:undefined,'required':_0x11b99a[_0xdb90('0x40')][_0xdb90('0xb0')]?!![]:![]}];}return db[_0xdb90('0x8c')][_0xdb90('0x51')](_0x2da0e0);})[_0xdb90('0x1f')](function(_0x2483ce){_0x41933f[_0xdb90('0x6d')]=_0x2483ce;return _0x41933f;});}})[_0xdb90('0x1f')](respondWithFilteredResult(_0x34a48a,_0x2da0e0))[_0xdb90('0x27')](handleError(_0x34a48a,null));};exports[_0xdb90('0xb1')]=function(_0x1ce9d4,_0x3a94b0,_0x4b2a57){return db['OpenchannelAccount']['find']({'where':{'id':_0x1ce9d4['params']['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x3a94b0,null))[_0xdb90('0x1f')](function(_0x5725fd){if(_0x5725fd){return _0x5725fd['addAgents'](_0x1ce9d4['body'][_0xdb90('0x6a')],_[_0xdb90('0xb2')](_0x1ce9d4[_0xdb90('0x56')],[_0xdb90('0x6a'),'id'])||{})[_0xdb90('0xb3')](function(_0x142318){for(var _0x57649c=0x0;_0x57649c<_0x1ce9d4[_0xdb90('0x56')][_0xdb90('0x6a')]['length'];_0x57649c+=0x1){socket[_0xdb90('0xb4')](_0xdb90('0xb5'),{'UserId':Number(_0x1ce9d4['body'][_0xdb90('0x6a')][_0x57649c]),'OpenchannelAccountId':Number(_0x1ce9d4[_0xdb90('0x60')]['id'])});}return _0x142318;});}})[_0xdb90('0x1f')](respondWithResult(_0x3a94b0,null))['catch'](handleError(_0x3a94b0,null));};exports['removeAgents']=function(_0x18def6,_0x129baf,_0x5d6c63){return db[_0xdb90('0x3b')][_0xdb90('0x54')]({'where':{'id':_0x18def6[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x129baf,null))['then'](function(_0x3afff0){if(_0x3afff0){return _0x3afff0[_0xdb90('0xb6')](_0x18def6[_0xdb90('0x40')]['ids'])[_0xdb90('0x1f')](function(){if(_[_0xdb90('0xb7')](_0x18def6[_0xdb90('0x40')][_0xdb90('0x6a')])){for(var _0xf4dbf=0x0;_0xf4dbf<_0x18def6[_0xdb90('0x40')][_0xdb90('0x6a')]['length'];_0xf4dbf+=0x1){socket[_0xdb90('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x18def6['query'][_0xdb90('0x6a')][_0xf4dbf]),'OpenchannelAccountId':Number(_0x18def6[_0xdb90('0x60')]['id'])});}}else{socket['emit'](_0xdb90('0xb8'),{'UserId':Number(_0x18def6[_0xdb90('0x40')][_0xdb90('0x6a')]),'OpenchannelAccountId':Number(_0x18def6[_0xdb90('0x60')]['id'])});}});}})[_0xdb90('0x1f')](respondWithStatusCode(_0x129baf,null))[_0xdb90('0x27')](handleError(_0x129baf,null));};exports[_0xdb90('0xb9')]=function(_0x416eb6,_0x54d775,_0x410eb6){var _0xf969b7={};var _0x21a43c={};var _0x106b2d;var _0x5e8e73;return db[_0xdb90('0x3b')][_0xdb90('0x66')]({'where':{'id':_0x416eb6['params']['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x54d775,null))['then'](function(_0x298dd3){if(_0x298dd3){_0x106b2d=_0x298dd3;_0x21a43c[_0xdb90('0x3f')]=_[_0xdb90('0x41')](db['User'][_0xdb90('0x3c')]);_0x21a43c[_0xdb90('0x40')]=_[_0xdb90('0x41')](_0x416eb6[_0xdb90('0x40')]);_0x21a43c[_0xdb90('0x67')]=_[_0xdb90('0x42')](_0x21a43c[_0xdb90('0x3f')],_0x21a43c[_0xdb90('0x40')]);_0xf969b7['attributes']=_[_0xdb90('0x42')](_0x21a43c[_0xdb90('0x3f')],qs['fields'](_0x416eb6[_0xdb90('0x40')]['fields']));_0xf969b7[_0xdb90('0x43')]=_0xf969b7[_0xdb90('0x43')][_0xdb90('0x45')]?_0xf969b7[_0xdb90('0x43')]:_0x21a43c['model'];_0xf969b7['order']=qs[_0xdb90('0x47')](_0x416eb6['query']['sort']);_0xf969b7['where']=qs['filters'](_[_0xdb90('0x49')](_0x416eb6[_0xdb90('0x40')],_0x21a43c[_0xdb90('0x67')]));if(_0x416eb6[_0xdb90('0x40')][_0xdb90('0x4a')]){_0xf969b7[_0xdb90('0x48')]=_['merge'](_0xf969b7[_0xdb90('0x48')],{'$or':_[_0xdb90('0x4c')](_0xf969b7['attributes'],function(_0x49f357){var _0x5aae8c={};_0x5aae8c[_0x49f357]={'$like':'%'+_0x416eb6[_0xdb90('0x40')][_0xdb90('0x4a')]+'%'};return _0x5aae8c;})});}_0xf969b7=_['merge']({},_0xf969b7,_0x416eb6[_0xdb90('0x4e')]);return _0x106b2d[_0xdb90('0xb9')](_0xf969b7);}})[_0xdb90('0x1f')](function(_0x47859f){if(_0x47859f){_0x5e8e73=_0x47859f[_0xdb90('0x45')];if(!_0x416eb6[_0xdb90('0x40')]['hasOwnProperty'](_0xdb90('0xa9'))){_0xf969b7[_0xdb90('0x2e')]=qs[_0xdb90('0x2e')](_0x416eb6[_0xdb90('0x40')][_0xdb90('0x2e')]);_0xf969b7[_0xdb90('0x2c')]=qs[_0xdb90('0x2c')](_0x416eb6[_0xdb90('0x40')][_0xdb90('0x2c')]);}return _0x106b2d['getAgents'](_0xf969b7);}})[_0xdb90('0x1f')](function(_0x269787){if(_0x269787){return _0x269787?{'count':_0x5e8e73,'rows':_0x269787}:null;}})[_0xdb90('0x1f')](respondWithResult(_0x54d775,null))[_0xdb90('0x27')](handleError(_0x54d775,null));};exports[_0xdb90('0x38')]=function(_0x31cc04,_0x39488f,_0x5cfd5c){var _0x11a42c,_0x227c63,_0x2fc0e5;if(_[_0xdb90('0x77')](_0x31cc04[_0xdb90('0x56')]['body'])||_0x31cc04[_0xdb90('0x56')]['body']===''){throw new db[(_0xdb90('0x70'))][(_0xdb90('0x78'))](_0xdb90('0x7a'));}if(_['isNil'](_0x31cc04['body']['to'])){}_0x11a42c=_0x31cc04['body']['to'];return db[_0xdb90('0x3b')][_0xdb90('0x66')]({'where':{'id':_0x31cc04[_0xdb90('0x60')]['id']}})[_0xdb90('0x1f')](handleEntityNotFound(_0x39488f,null))[_0xdb90('0x1f')](function(_0x132b3d){if(_0x132b3d){return db[_0xdb90('0x3b')][_0xdb90('0x54')]({'where':{'id':_0x132b3d['id']},'include':[{'model':db[_0xdb90('0x7f')],'as':_0xdb90('0x80'),'include':[{'model':db[_0xdb90('0x81')],'as':_0xdb90('0x82'),'where':{[_0x132b3d['mapKey']]:_0x11a42c},'limit':0x1,'order':[['updatedAt',_0xdb90('0x83')]]}]}]})['then'](handleEntityNotFound(_0x39488f,null))[_0xdb90('0x1f')](function(_0x326dfd){if(_0x326dfd&&_0x326dfd['List']){_0x227c63=_0x326dfd[_0xdb90('0x58')]({'plain':!![]});if(_0x227c63[_0xdb90('0x80')]&&_0x227c63[_0xdb90('0x80')]['Contacts'][_0xdb90('0x45')]){return _0x227c63['List'][_0xdb90('0x82')][0x0];}return db[_0xdb90('0x81')][_0xdb90('0x55')](_[_0xdb90('0x17')](_0x31cc04['body'],{'firstName':_0x11a42c,[_0x326dfd['mapKey']]:_0x11a42c,'phone':_0x11a42c,'ListId':_0x227c63['ListId']}));}})['then'](handleEntityNotFound(_0x39488f,null))[_0xdb90('0x1f')](function(_0x673faf){if(_0x673faf){_0x2fc0e5=_0x673faf;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x2fc0e5['id'],'closed':![],'OpenchannelAccountId':_0x227c63['id']}})[_0xdb90('0x1f')](function(_0x4598bb){if(_0x4598bb){return[_0x4598bb,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x31cc04['user']['id'],'ContactId':_0x2fc0e5['id'],'OpenchannelAccountId':_0x227c63['id'],'lastMsgDirection':_0xdb90('0xba'),'Messages':[_[_0xdb90('0x4b')](_0x31cc04[_0xdb90('0x56')],{'read':![],'body':_0x31cc04[_0xdb90('0x56')][_0xdb90('0x56')],'OpenchannelAccountId':_0x227c63['id'],'UserId':_0x31cc04[_0xdb90('0x57')]['id'],'ContactId':_0x2fc0e5['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xdb90('0xbb')}]})[_0xdb90('0x1f')](function(_0xbd5398){return[_0xbd5398,!![]];});});}})['spread'](function(_0x32fe3a,_0x506e42){if(_0x506e42){return _0x32fe3a;}return db[_0xdb90('0x97')][_0xdb90('0x55')](_[_0xdb90('0x4b')](_0x31cc04[_0xdb90('0x56')],{'read':![],'body':_0x31cc04[_0xdb90('0x56')][_0xdb90('0x56')],'OpenchannelAccountId':_0x227c63['id'],'OpenchannelInteractionId':_0x32fe3a['id'],'UserId':_0x31cc04['user']['id'],'ContactId':_0x2fc0e5['id']}))['then'](function(_0x397fe0){_0x32fe3a[_0xdb90('0xbc')]['Messages']=[];_0x32fe3a[_0xdb90('0xbc')][_0xdb90('0xbb')][_0xdb90('0x94')](_0x397fe0[_0xdb90('0xbc')]);return _0x32fe3a;});});}})[_0xdb90('0x1f')](respondWithResult(_0x39488f,null))['catch'](handleError(_0x39488f,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 63777fd..aaff886 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0xec56,0x1bd));var _0x6ec5=function(_0x33fdf1,_0x509e9c){_0x33fdf1=_0x33fdf1-0x0;var _0x2cd781=_0xec56[_0x33fdf1];return _0x2cd781;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x750a=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x40750d,_0x593094){var _0x42d026=function(_0x1168bb){while(--_0x1168bb){_0x40750d['push'](_0x40750d['shift']());}};_0x42d026(++_0x593094);}(_0x750a,0x140));var _0xa750=function(_0x19eccf,_0x238a37){_0x19eccf=_0x19eccf-0x0;var _0x3f1b86=_0x750a[_0x19eccf];return _0x3f1b86;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xa750('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa750('0x1'),'afterUpdate':_0xa750('0x2'),'afterDestroy':_0xa750('0x3')};function emitEvent(_0x19bd5f){return function(_0x457cae,_0x43d704,_0x562911){OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f+':'+_0x457cae['id'],_0x457cae);OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f,_0x457cae);_0x562911(null);};}for(var e in events){if(events[_0xa750('0x5')](e)){var event=events[e];OpenchannelAccount[_0xa750('0x6')](e,emitEvent(event));}}module[_0xa750('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 59153a0..a82dff3 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3d48d6,_0x2fe650){var _0x46a6e6=function(_0x57d925){while(--_0x57d925){_0x3d48d6['push'](_0x3d48d6['shift']());}};_0x46a6e6(++_0x2fe650);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x8ef270,_0x1ec3c9){var _0x4ab23a=function(_0x5c16c5){while(--_0x5c16c5){_0x8ef270['push'](_0x8ef270['shift']());}};_0x4ab23a(++_0x1ec3c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 04c24c7..e90effe 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x282b=['request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x33de28,_0x28c4fd){var _0x15a3e5=function(_0x2e3e26){while(--_0x2e3e26){_0x33de28['push'](_0x33de28['shift']());}};_0x15a3e5(++_0x28c4fd);}(_0x282b,0xec));var _0xb282=function(_0x4da21a,_0x508223){_0x4da21a=_0x4da21a-0x0;var _0x2f644c=_0x282b[_0x4da21a];return _0x2f644c;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});config[_0xb282('0xb')]=_['defaults'](config['redis'],{'host':_0xb282('0xc'),'port':0x18eb});var socket=require(_0xb282('0xd'))(new Redis(config['redis']));require(_0xb282('0xe'))[_0xb282('0xf')](socket);function respondWithRpcPromise(_0x3435fc,_0x2d86ba,_0x56caf2){return new BPromise(function(_0x47e62e,_0x36b984){return client[_0xb282('0x10')](_0x3435fc,_0x56caf2)[_0xb282('0x11')](function(_0x1cbe28){logger[_0xb282('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x2d86ba,'request\x20sent');logger[_0xb282('0x13')](_0xb282('0x14'),_0x2d86ba,_0xb282('0x15'),JSON[_0xb282('0x16')](_0x1cbe28));if(_0x1cbe28[_0xb282('0x17')]){if(_0x1cbe28['error'][_0xb282('0x18')]===0x1f4){logger['error'](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')]['message']);return _0x36b984(_0x1cbe28['error']['message']);}logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')][_0xb282('0x1a')]);return _0x47e62e(_0x1cbe28[_0xb282('0x17')]['message']);}else{logger[_0xb282('0x12')](_0xb282('0x19'),_0x2d86ba,_0xb282('0x15'));_0x47e62e(_0x1cbe28[_0xb282('0x1b')][_0xb282('0x1a')]);}})['catch'](function(_0x52e305){logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x52e305);_0x36b984(_0x52e305);});});} \ No newline at end of file +var _0x0490=['result','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x155d4c,_0x5c58ec){var _0x5b2475=function(_0x428a5a){while(--_0x428a5a){_0x155d4c['push'](_0x155d4c['shift']());}};_0x5b2475(++_0x5c58ec);}(_0x0490,0x147));var _0x0049=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0x0490[_0xae01dd];return _0x8c26df;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0049('0x1'))['db'];var utils=require(_0x0049('0x2'));var logger=require(_0x0049('0x3'))(_0x0049('0x4'));var config=require(_0x0049('0x5'));var jayson=require(_0x0049('0x6'));var client=jayson[_0x0049('0x7')][_0x0049('0x8')]({'port':0x232a});config[_0x0049('0x9')]=_['defaults'](config[_0x0049('0x9')],{'host':_0x0049('0xa'),'port':0x18eb});var socket=require(_0x0049('0xb'))(new Redis(config['redis']));require(_0x0049('0xc'))[_0x0049('0xd')](socket);function respondWithRpcPromise(_0x4165c2,_0x41c511,_0x266001){return new BPromise(function(_0x3409c6,_0xf3c508){return client[_0x0049('0xe')](_0x4165c2,_0x266001)[_0x0049('0xf')](function(_0x52f313){logger[_0x0049('0x10')](_0x0049('0x11'),_0x41c511,_0x0049('0x12'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x41c511,_0x0049('0x12'),JSON[_0x0049('0x13')](_0x52f313));if(_0x52f313[_0x0049('0x14')]){if(_0x52f313[_0x0049('0x14')][_0x0049('0x15')]===0x1f4){logger['error'](_0x0049('0x11'),_0x41c511,_0x52f313[_0x0049('0x14')]['message']);return _0xf3c508(_0x52f313[_0x0049('0x14')][_0x0049('0x16')]);}logger[_0x0049('0x14')](_0x0049('0x11'),_0x41c511,_0x52f313['error']['message']);return _0x3409c6(_0x52f313[_0x0049('0x14')][_0x0049('0x16')]);}else{logger[_0x0049('0x10')](_0x0049('0x11'),_0x41c511,_0x0049('0x12'));_0x3409c6(_0x52f313[_0x0049('0x17')][_0x0049('0x16')]);}})[_0x0049('0x18')](function(_0x6df63c){logger[_0x0049('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x41c511,_0x6df63c);_0xf3c508(_0x6df63c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 68496dd..0f82cab 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44a3=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x109400,_0x33bbde){var _0x5d9698=function(_0x58c3f9){while(--_0x58c3f9){_0x109400['push'](_0x109400['shift']());}};_0x5d9698(++_0x33bbde);}(_0x44a3,0x1a9));var _0x344a=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0x44a3[_0x143565];return _0x4dc1d9;};'use strict';var OpenchannelAccountEvents=require(_0x344a('0x0'));var events=[_0x344a('0x1'),_0x344a('0x2'),_0x344a('0x3')];function createListener(_0xdffe0b,_0x42b3a6){return function(_0x3bb844){_0x42b3a6[_0x344a('0x4')](_0xdffe0b,_0x3bb844);};}function removeListener(_0x528a13,_0x23004c){return function(){OpenchannelAccountEvents[_0x344a('0x5')](_0x528a13,_0x23004c);};}exports[_0x344a('0x6')]=function(_0x28b51e){for(var _0x39984a=0x0,_0x504bd1=events['length'];_0x39984a<_0x504bd1;_0x39984a++){var _0x55ddca=events[_0x39984a];var _0x484661=createListener(_0x344a('0x7')+_0x55ddca,_0x28b51e);OpenchannelAccountEvents['on'](_0x55ddca,_0x484661);}}; \ No newline at end of file +var _0x2116=['openchannelAccount:','save','update','removeListener','register','length'];(function(_0x45628f,_0xba6cce){var _0x433cc2=function(_0x5acb2f){while(--_0x5acb2f){_0x45628f['push'](_0x45628f['shift']());}};_0x433cc2(++_0xba6cce);}(_0x2116,0x67));var _0x6211=function(_0x311e33,_0xe04c1d){_0x311e33=_0x311e33-0x0;var _0x2e1cd9=_0x2116[_0x311e33];return _0x2e1cd9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x6211('0x0'),'remove',_0x6211('0x1')];function createListener(_0x434fbb,_0xa806a3){return function(_0xf2f23c){_0xa806a3['emit'](_0x434fbb,_0xf2f23c);};}function removeListener(_0x3d23d1,_0x2bf1b1){return function(){OpenchannelAccountEvents[_0x6211('0x2')](_0x3d23d1,_0x2bf1b1);};}exports[_0x6211('0x3')]=function(_0x5cac18){for(var _0x37d71a=0x0,_0x57f7e7=events[_0x6211('0x4')];_0x37d71a<_0x57f7e7;_0x37d71a++){var _0x320562=events[_0x37d71a];var _0x365e65=createListener(_0x6211('0x5')+_0x320562,_0x5cac18);OpenchannelAccountEvents['on'](_0x320562,_0x365e65);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 268eec1..114b2c7 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf102=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','create','put','/:id','delete','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x7f1f7b,_0xebc96c){var _0xe8420d=function(_0x2a5593){while(--_0x2a5593){_0x7f1f7b['push'](_0x7f1f7b['shift']());}};_0xe8420d(++_0xebc96c);}(_0xf102,0x1e5));var _0x2f10=function(_0x3b59d5,_0x1e23f2){_0x3b59d5=_0x3b59d5-0x0;var _0x30cc91=_0xf102[_0x3b59d5];return _0x30cc91;};'use strict';var multer=require('multer');var util=require(_0x2f10('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2f10('0x1'));var router=express[_0x2f10('0x2')]();var fs_extra=require(_0x2f10('0x3'));var auth=require(_0x2f10('0x4'));var interaction=require(_0x2f10('0x5'));var config=require(_0x2f10('0x6'));var controller=require(_0x2f10('0x7'));router[_0x2f10('0x8')]('/',auth[_0x2f10('0x9')](),controller['index']);router[_0x2f10('0x8')]('/:id',auth[_0x2f10('0x9')](),controller['show']);router['post']('/',auth[_0x2f10('0x9')](),controller[_0x2f10('0xa')]);router[_0x2f10('0xb')](_0x2f10('0xc'),auth[_0x2f10('0x9')](),controller['update']);router[_0x2f10('0xd')](_0x2f10('0xc'),auth[_0x2f10('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeaea=['connect-timeout','Router','../../config/environment','get','isAuthenticated','index','show','post','create','put','delete','/:id','exports','util','path'];(function(_0x2fe8ca,_0x3b700f){var _0x3a8295=function(_0x1e4119){while(--_0x1e4119){_0x2fe8ca['push'](_0x2fe8ca['shift']());}};_0x3a8295(++_0x3b700f);}(_0xeaea,0x1c0));var _0xaeae=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xeaea[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require(_0xaeae('0x0'));var path=require(_0xaeae('0x1'));var timeout=require(_0xaeae('0x2'));var express=require('express');var router=express[_0xaeae('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaeae('0x4'));var controller=require('./openchannelApplication.controller');router[_0xaeae('0x5')]('/',auth[_0xaeae('0x6')](),controller[_0xaeae('0x7')]);router[_0xaeae('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xaeae('0x8')]);router[_0xaeae('0x9')]('/',auth[_0xaeae('0x6')](),controller[_0xaeae('0xa')]);router[_0xaeae('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xaeae('0xc')](_0xaeae('0xd'),auth[_0xaeae('0x6')](),controller['destroy']);module[_0xaeae('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 25dcabe..ec0403b 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0c1=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xbe4f5e,_0x29ffb4){var _0xcc7e2c=function(_0x30df59){while(--_0x30df59){_0xbe4f5e['push'](_0xbe4f5e['shift']());}};_0xcc7e2c(++_0x29ffb4);}(_0xb0c1,0x17c));var _0x1b0c=function(_0x1df88b,_0x58979c){_0x1df88b=_0x1df88b-0x0;var _0x51d1a2=_0xb0c1[_0x1df88b];return _0x51d1a2;};'use strict';var Sequelize=require(_0x1b0c('0x0'));module[_0x1b0c('0x1')]={'priority':{'type':Sequelize[_0x1b0c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1b0c('0x3')],'allowNull':![],'defaultValue':_0x1b0c('0x4')},'appdata':{'type':Sequelize[_0x1b0c('0x5')]()},'description':{'type':Sequelize[_0x1b0c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1b0c('0x6')}}; \ No newline at end of file +var _0x0a27=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0a27,0x12c));var _0x70a2=function(_0xf93627,_0x345662){_0xf93627=_0xf93627-0x0;var _0xd0aa53=_0x0a27[_0xf93627];return _0xd0aa53;};'use strict';var Sequelize=require(_0x70a2('0x0'));module['exports']={'priority':{'type':Sequelize[_0x70a2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x70a2('0x2')],'allowNull':![],'defaultValue':_0x70a2('0x3')},'appdata':{'type':Sequelize[_0x70a2('0x4')]()},'description':{'type':Sequelize[_0x70a2('0x2')]},'interval':{'type':Sequelize[_0x70a2('0x2')],'defaultValue':_0x70a2('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ac8be67..49b6e08 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2862=['filter','where','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick'];(function(_0x5bb3a6,_0xc89ee3){var _0x279273=function(_0x232bdf){while(--_0x232bdf){_0x5bb3a6['push'](_0x5bb3a6['shift']());}};_0x279273(++_0xc89ee3);}(_0x2862,0xae));var _0x2286=function(_0x88db83,_0x4441a1){_0x88db83=_0x88db83-0x0;var _0x4233ca=_0x2862[_0x88db83];return _0x4233ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2286('0x0'));var zipdir=require(_0x2286('0x1'));var jsonpatch=require(_0x2286('0x2'));var rp=require(_0x2286('0x3'));var moment=require(_0x2286('0x4'));var BPromise=require(_0x2286('0x5'));var Mustache=require(_0x2286('0x6'));var util=require(_0x2286('0x7'));var path=require('path');var sox=require(_0x2286('0x8'));var csv=require(_0x2286('0x9'));var ejs=require(_0x2286('0xa'));var fs=require('fs');var fs_extra=require(_0x2286('0xb'));var _=require('lodash');var squel=require(_0x2286('0xc'));var crypto=require(_0x2286('0xd'));var jsforce=require(_0x2286('0xe'));var deskjs=require(_0x2286('0xf'));var toCsv=require(_0x2286('0x9'));var querystring=require(_0x2286('0x10'));var Papa=require(_0x2286('0x11'));var Redis=require(_0x2286('0x12'));var authService=require(_0x2286('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2286('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2286('0x15'))('api');var utils=require(_0x2286('0x16'));var config=require(_0x2286('0x17'));var licenseUtil=require(_0x2286('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289991,_0x3220b9){_0x3220b9=_0x3220b9||0xcc;return function(_0x112458){if(_0x112458){return _0x289991[_0x2286('0x19')](_0x3220b9);}return _0x289991['status'](_0x3220b9)[_0x2286('0x1a')]();};}function respondWithResult(_0xbe6c3b,_0x17d4d9){_0x17d4d9=_0x17d4d9||0xc8;return function(_0x16553b){if(_0x16553b){return _0xbe6c3b['status'](_0x17d4d9)[_0x2286('0x1b')](_0x16553b);}};}function respondWithFilteredResult(_0x29cbd5,_0x13f1a1){return function(_0x4a09b2){if(_0x4a09b2){var _0x68519e=typeof _0x13f1a1['offset']==='undefined'&&typeof _0x13f1a1['limit']===_0x2286('0x1c');var _0x455c36=_0x4a09b2[_0x2286('0x1d')];var _0x4b595e=_0x68519e?0x0:_0x13f1a1[_0x2286('0x1e')];var _0x3a7fc0=_0x68519e?_0x4a09b2[_0x2286('0x1d')]:_0x13f1a1[_0x2286('0x1e')]+_0x13f1a1['limit'];var _0x59e4b3;if(_0x3a7fc0>=_0x455c36){_0x3a7fc0=_0x455c36;_0x59e4b3=0xc8;}else{_0x59e4b3=0xce;}_0x29cbd5[_0x2286('0x1f')](_0x59e4b3);return _0x29cbd5[_0x2286('0x20')](_0x2286('0x21'),_0x4b595e+'-'+_0x3a7fc0+'/'+_0x455c36)[_0x2286('0x1b')](_0x4a09b2);}return null;};}function patchUpdates(_0x23b9d3){return function(_0x4c770d){try{jsonpatch[_0x2286('0x22')](_0x4c770d,_0x23b9d3,!![]);}catch(_0x4365fa){return BPromise[_0x2286('0x23')](_0x4365fa);}return _0x4c770d[_0x2286('0x24')]();};}function saveUpdates(_0xb6aadf,_0x1566c8){return function(_0x13552c){if(_0x13552c){return _0x13552c['update'](_0xb6aadf)[_0x2286('0x25')](function(_0x1e1d0a){return _0x1e1d0a;});}return null;};}function removeEntity(_0x29e486,_0x44b66a){return function(_0x3ffa31){if(_0x3ffa31){return _0x3ffa31[_0x2286('0x26')]()[_0x2286('0x25')](function(){_0x29e486[_0x2286('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c3ff3,_0x49f03d){return function(_0x2677d1){if(!_0x2677d1){_0x4c3ff3[_0x2286('0x19')](0x194);}return _0x2677d1;};}function handleError(_0x575d07,_0x2a0d83){_0x2a0d83=_0x2a0d83||0x1f4;return function(_0x2c3fc6){logger[_0x2286('0x27')](_0x2c3fc6[_0x2286('0x28')]);if(_0x2c3fc6[_0x2286('0x29')]){delete _0x2c3fc6[_0x2286('0x29')];}_0x575d07[_0x2286('0x1f')](_0x2a0d83)[_0x2286('0x2a')](_0x2c3fc6);};}exports[_0x2286('0x2b')]=function(_0x32dfea,_0x2bc3cc){var _0x4b95b7={},_0x4f5948={},_0x5e65d9={'count':0x0,'rows':[]};var _0x3c2198=_[_0x2286('0x2c')](db[_0x2286('0x2d')][_0x2286('0x2e')],function(_0x3309d3){return{'name':_0x3309d3[_0x2286('0x2f')],'type':_0x3309d3[_0x2286('0x30')][_0x2286('0x31')]};});_0x4f5948[_0x2286('0x32')]=_[_0x2286('0x2c')](_0x3c2198,_0x2286('0x29'));_0x4f5948[_0x2286('0x33')]=_[_0x2286('0x34')](_0x32dfea['query']);_0x4f5948['filters']=_[_0x2286('0x35')](_0x4f5948[_0x2286('0x32')],_0x4f5948[_0x2286('0x33')]);_0x4b95b7[_0x2286('0x36')]=_['intersection'](_0x4f5948[_0x2286('0x32')],qs[_0x2286('0x37')](_0x32dfea['query']['fields']));_0x4b95b7['attributes']=_0x4b95b7[_0x2286('0x36')]['length']?_0x4b95b7['attributes']:_0x4f5948[_0x2286('0x32')];if(!_0x32dfea[_0x2286('0x33')][_0x2286('0x38')](_0x2286('0x39'))){_0x4b95b7[_0x2286('0x3a')]=qs[_0x2286('0x3a')](_0x32dfea['query'][_0x2286('0x3a')]);_0x4b95b7[_0x2286('0x1e')]=qs['offset'](_0x32dfea[_0x2286('0x33')][_0x2286('0x1e')]);}_0x4b95b7[_0x2286('0x3b')]=qs[_0x2286('0x3c')](_0x32dfea['query']['sort']);_0x4b95b7['where']=qs[_0x2286('0x3d')](_[_0x2286('0x3e')](_0x32dfea[_0x2286('0x33')],_0x4f5948[_0x2286('0x3d')]),_0x3c2198);if(_0x32dfea['query'][_0x2286('0x3f')]){_0x4b95b7[_0x2286('0x40')]=_[_0x2286('0x41')](_0x4b95b7[_0x2286('0x40')],{'$or':_[_0x2286('0x2c')](_0x3c2198,function(_0x1701fd){if(_0x1701fd[_0x2286('0x30')]!==_0x2286('0x42')){var _0xc0b059={};_0xc0b059[_0x1701fd['name']]={'$like':'%'+_0x32dfea[_0x2286('0x33')]['filter']+'%'};return _0xc0b059;}})});}_0x4b95b7=_[_0x2286('0x41')]({},_0x4b95b7,_0x32dfea[_0x2286('0x43')]);var _0x2a6c9d={'where':_0x4b95b7['where']};return db['OpenchannelApplication'][_0x2286('0x1d')](_0x2a6c9d)['then'](function(_0x5ab539){_0x5e65d9[_0x2286('0x1d')]=_0x5ab539;if(_0x32dfea[_0x2286('0x33')]['includeAll']){_0x4b95b7['include']=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x4b95b7);})[_0x2286('0x25')](function(_0x2180b1){_0x5e65d9[_0x2286('0x44')]=_0x2180b1;return _0x5e65d9;})['then'](respondWithFilteredResult(_0x2bc3cc,_0x4b95b7))[_0x2286('0x45')](handleError(_0x2bc3cc,null));};exports[_0x2286('0x46')]=function(_0x54ebd3,_0x10dea3){var _0x4235ae={'raw':!![],'where':{'id':_0x54ebd3[_0x2286('0x47')]['id']}},_0xe19cae={};_0xe19cae['model']=_[_0x2286('0x34')](db['OpenchannelApplication'][_0x2286('0x2e')]);_0xe19cae[_0x2286('0x33')]=_['keys'](_0x54ebd3[_0x2286('0x33')]);_0xe19cae[_0x2286('0x3d')]=_[_0x2286('0x35')](_0xe19cae[_0x2286('0x32')],_0xe19cae[_0x2286('0x33')]);_0x4235ae[_0x2286('0x36')]=_['intersection'](_0xe19cae[_0x2286('0x32')],qs['fields'](_0x54ebd3['query'][_0x2286('0x37')]));_0x4235ae['attributes']=_0x4235ae[_0x2286('0x36')][_0x2286('0x48')]?_0x4235ae['attributes']:_0xe19cae['model'];if(_0x54ebd3[_0x2286('0x33')][_0x2286('0x49')]){_0x4235ae[_0x2286('0x4a')]=[{'all':!![]}];}_0x4235ae=_[_0x2286('0x41')]({},_0x4235ae,_0x54ebd3[_0x2286('0x43')]);return db[_0x2286('0x2d')][_0x2286('0x4b')](_0x4235ae)[_0x2286('0x25')](handleEntityNotFound(_0x10dea3,null))[_0x2286('0x25')](respondWithResult(_0x10dea3,null))['catch'](handleError(_0x10dea3,null));};exports['create']=function(_0x574260,_0x189cd8){return db[_0x2286('0x2d')][_0x2286('0x4c')](_0x574260[_0x2286('0x4d')],{})[_0x2286('0x25')](respondWithResult(_0x189cd8,0xc9))[_0x2286('0x45')](handleError(_0x189cd8,null));};exports[_0x2286('0x4e')]=function(_0x3c77f0,_0x4e2dfd){if(_0x3c77f0['body']['id']){delete _0x3c77f0['body']['id'];}return db[_0x2286('0x2d')][_0x2286('0x4b')]({'where':{'id':_0x3c77f0[_0x2286('0x47')]['id']}})[_0x2286('0x25')](handleEntityNotFound(_0x4e2dfd,null))[_0x2286('0x25')](saveUpdates(_0x3c77f0['body'],null))[_0x2286('0x25')](respondWithResult(_0x4e2dfd,null))['catch'](handleError(_0x4e2dfd,null));};exports[_0x2286('0x26')]=function(_0x315a5c,_0x5b3dc7){return db[_0x2286('0x2d')][_0x2286('0x4b')]({'where':{'id':_0x315a5c[_0x2286('0x47')]['id']}})[_0x2286('0x25')](handleEntityNotFound(_0x5b3dc7,null))[_0x2286('0x25')](removeEntity(_0x5b3dc7,null))['catch'](handleError(_0x5b3dc7,null));}; \ No newline at end of file +var _0x848c=['destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','params','keys','rawAttributes','catch','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','update','then'];(function(_0x3a4a02,_0x150455){var _0x579e6c=function(_0x20533b){while(--_0x20533b){_0x3a4a02['push'](_0x3a4a02['shift']());}};_0x579e6c(++_0x150455);}(_0x848c,0xf7));var _0xc848=function(_0x106641,_0x571045){_0x106641=_0x106641-0x0;var _0x2676ae=_0x848c[_0x106641];return _0x2676ae;};'use strict';var emlformat=require(_0xc848('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc848('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc848('0x2'));var moment=require('moment');var BPromise=require(_0xc848('0x3'));var Mustache=require(_0xc848('0x4'));var util=require(_0xc848('0x5'));var path=require(_0xc848('0x6'));var sox=require('sox');var csv=require(_0xc848('0x7'));var ejs=require(_0xc848('0x8'));var fs=require('fs');var fs_extra=require(_0xc848('0x9'));var _=require(_0xc848('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc848('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc848('0x7'));var querystring=require(_0xc848('0xc'));var Papa=require('papaparse');var Redis=require(_0xc848('0xd'));var authService=require(_0xc848('0xe'));var qs=require(_0xc848('0xf'));var as=require(_0xc848('0x10'));var hardwareService=require(_0xc848('0x11'));var logger=require(_0xc848('0x12'))(_0xc848('0x13'));var utils=require('../../config/utils');var config=require(_0xc848('0x14'));var licenseUtil=require(_0xc848('0x15'));var db=require(_0xc848('0x16'))['db'];function respondWithStatusCode(_0x4f77a5,_0x192e36){_0x192e36=_0x192e36||0xcc;return function(_0x31e94f){if(_0x31e94f){return _0x4f77a5[_0xc848('0x17')](_0x192e36);}return _0x4f77a5['status'](_0x192e36)[_0xc848('0x18')]();};}function respondWithResult(_0x5c33d0,_0x3be388){_0x3be388=_0x3be388||0xc8;return function(_0x12c9b2){if(_0x12c9b2){return _0x5c33d0[_0xc848('0x19')](_0x3be388)[_0xc848('0x1a')](_0x12c9b2);}};}function respondWithFilteredResult(_0x440111,_0xb6c629){return function(_0x4dbe0e){if(_0x4dbe0e){var _0x29096e=typeof _0xb6c629[_0xc848('0x1b')]===_0xc848('0x1c')&&typeof _0xb6c629['limit']===_0xc848('0x1c');var _0x4aa7f5=_0x4dbe0e[_0xc848('0x1d')];var _0x3301a4=_0x29096e?0x0:_0xb6c629[_0xc848('0x1b')];var _0x59203a=_0x29096e?_0x4dbe0e['count']:_0xb6c629[_0xc848('0x1b')]+_0xb6c629['limit'];var _0x4b6db6;if(_0x59203a>=_0x4aa7f5){_0x59203a=_0x4aa7f5;_0x4b6db6=0xc8;}else{_0x4b6db6=0xce;}_0x440111[_0xc848('0x19')](_0x4b6db6);return _0x440111[_0xc848('0x1e')]('Content-Range',_0x3301a4+'-'+_0x59203a+'/'+_0x4aa7f5)[_0xc848('0x1a')](_0x4dbe0e);}return null;};}function patchUpdates(_0x5ea218){return function(_0x3fe004){try{jsonpatch['apply'](_0x3fe004,_0x5ea218,!![]);}catch(_0x4748f7){return BPromise['reject'](_0x4748f7);}return _0x3fe004['save']();};}function saveUpdates(_0x130b39,_0x51a996){return function(_0x38d11d){if(_0x38d11d){return _0x38d11d[_0xc848('0x1f')](_0x130b39)[_0xc848('0x20')](function(_0x5ddab5){return _0x5ddab5;});}return null;};}function removeEntity(_0x30cd41,_0x343c80){return function(_0x687f98){if(_0x687f98){return _0x687f98[_0xc848('0x21')]()[_0xc848('0x20')](function(){_0x30cd41['status'](0xcc)[_0xc848('0x18')]();});}};}function handleEntityNotFound(_0x3552cb,_0x1d18f5){return function(_0x47cb93){if(!_0x47cb93){_0x3552cb[_0xc848('0x17')](0x194);}return _0x47cb93;};}function handleError(_0x529015,_0x5a7b3b){_0x5a7b3b=_0x5a7b3b||0x1f4;return function(_0x16d739){logger[_0xc848('0x22')](_0x16d739[_0xc848('0x23')]);if(_0x16d739[_0xc848('0x24')]){delete _0x16d739['name'];}_0x529015['status'](_0x5a7b3b)[_0xc848('0x25')](_0x16d739);};}exports[_0xc848('0x26')]=function(_0x3e1131,_0x106ee2){var _0x3403bd={},_0x16b0d4={},_0x4ba55d={'count':0x0,'rows':[]};var _0x42371c=_[_0xc848('0x27')](db[_0xc848('0x28')]['rawAttributes'],function(_0x3eb58f){return{'name':_0x3eb58f[_0xc848('0x29')],'type':_0x3eb58f[_0xc848('0x2a')][_0xc848('0x2b')]};});_0x16b0d4[_0xc848('0x2c')]=_[_0xc848('0x27')](_0x42371c,'name');_0x16b0d4[_0xc848('0x2d')]=_['keys'](_0x3e1131[_0xc848('0x2d')]);_0x16b0d4[_0xc848('0x2e')]=_['intersection'](_0x16b0d4[_0xc848('0x2c')],_0x16b0d4[_0xc848('0x2d')]);_0x3403bd[_0xc848('0x2f')]=_[_0xc848('0x30')](_0x16b0d4[_0xc848('0x2c')],qs[_0xc848('0x31')](_0x3e1131['query'][_0xc848('0x31')]));_0x3403bd[_0xc848('0x2f')]=_0x3403bd[_0xc848('0x2f')][_0xc848('0x32')]?_0x3403bd[_0xc848('0x2f')]:_0x16b0d4[_0xc848('0x2c')];if(!_0x3e1131[_0xc848('0x2d')][_0xc848('0x33')](_0xc848('0x34'))){_0x3403bd[_0xc848('0x35')]=qs[_0xc848('0x35')](_0x3e1131[_0xc848('0x2d')][_0xc848('0x35')]);_0x3403bd['offset']=qs[_0xc848('0x1b')](_0x3e1131[_0xc848('0x2d')][_0xc848('0x1b')]);}_0x3403bd[_0xc848('0x36')]=qs[_0xc848('0x37')](_0x3e1131[_0xc848('0x2d')]['sort']);_0x3403bd['where']=qs[_0xc848('0x2e')](_[_0xc848('0x38')](_0x3e1131['query'],_0x16b0d4['filters']),_0x42371c);if(_0x3e1131[_0xc848('0x2d')][_0xc848('0x39')]){_0x3403bd[_0xc848('0x3a')]=_[_0xc848('0x3b')](_0x3403bd[_0xc848('0x3a')],{'$or':_[_0xc848('0x27')](_0x42371c,function(_0x2f661e){if(_0x2f661e['type']!=='VIRTUAL'){var _0x6fbde0={};_0x6fbde0[_0x2f661e[_0xc848('0x24')]]={'$like':'%'+_0x3e1131[_0xc848('0x2d')][_0xc848('0x39')]+'%'};return _0x6fbde0;}})});}_0x3403bd=_[_0xc848('0x3b')]({},_0x3403bd,_0x3e1131[_0xc848('0x3c')]);var _0x320e8d={'where':_0x3403bd['where']};return db['OpenchannelApplication'][_0xc848('0x1d')](_0x320e8d)[_0xc848('0x20')](function(_0x4329f6){_0x4ba55d[_0xc848('0x1d')]=_0x4329f6;if(_0x3e1131['query'][_0xc848('0x3d')]){_0x3403bd[_0xc848('0x3e')]=[{'all':!![]}];}return db[_0xc848('0x28')][_0xc848('0x3f')](_0x3403bd);})[_0xc848('0x20')](function(_0x33dfbe){_0x4ba55d['rows']=_0x33dfbe;return _0x4ba55d;})['then'](respondWithFilteredResult(_0x106ee2,_0x3403bd))['catch'](handleError(_0x106ee2,null));};exports['show']=function(_0xbb879e,_0x26e0d3){var _0x280c33={'raw':!![],'where':{'id':_0xbb879e[_0xc848('0x40')]['id']}},_0x4c8f20={};_0x4c8f20['model']=_[_0xc848('0x41')](db[_0xc848('0x28')][_0xc848('0x42')]);_0x4c8f20[_0xc848('0x2d')]=_['keys'](_0xbb879e[_0xc848('0x2d')]);_0x4c8f20['filters']=_['intersection'](_0x4c8f20[_0xc848('0x2c')],_0x4c8f20[_0xc848('0x2d')]);_0x280c33[_0xc848('0x2f')]=_[_0xc848('0x30')](_0x4c8f20[_0xc848('0x2c')],qs[_0xc848('0x31')](_0xbb879e['query'][_0xc848('0x31')]));_0x280c33[_0xc848('0x2f')]=_0x280c33[_0xc848('0x2f')][_0xc848('0x32')]?_0x280c33[_0xc848('0x2f')]:_0x4c8f20[_0xc848('0x2c')];if(_0xbb879e[_0xc848('0x2d')][_0xc848('0x3d')]){_0x280c33[_0xc848('0x3e')]=[{'all':!![]}];}_0x280c33=_['merge']({},_0x280c33,_0xbb879e[_0xc848('0x3c')]);return db[_0xc848('0x28')]['find'](_0x280c33)[_0xc848('0x20')](handleEntityNotFound(_0x26e0d3,null))['then'](respondWithResult(_0x26e0d3,null))[_0xc848('0x43')](handleError(_0x26e0d3,null));};exports['create']=function(_0x2ef858,_0x3c3109){return db['OpenchannelApplication']['create'](_0x2ef858[_0xc848('0x44')],{})[_0xc848('0x20')](respondWithResult(_0x3c3109,0xc9))[_0xc848('0x43')](handleError(_0x3c3109,null));};exports[_0xc848('0x1f')]=function(_0x3afef4,_0x1d81ff){if(_0x3afef4[_0xc848('0x44')]['id']){delete _0x3afef4[_0xc848('0x44')]['id'];}return db[_0xc848('0x28')]['find']({'where':{'id':_0x3afef4['params']['id']}})['then'](handleEntityNotFound(_0x1d81ff,null))[_0xc848('0x20')](saveUpdates(_0x3afef4[_0xc848('0x44')],null))[_0xc848('0x20')](respondWithResult(_0x1d81ff,null))['catch'](handleError(_0x1d81ff,null));};exports[_0xc848('0x21')]=function(_0x1b4f78,_0x28faab){return db[_0xc848('0x28')][_0xc848('0x45')]({'where':{'id':_0x1b4f78[_0xc848('0x40')]['id']}})[_0xc848('0x20')](handleEntityNotFound(_0x28faab,null))[_0xc848('0x20')](removeEntity(_0x28faab,null))['catch'](handleError(_0x28faab,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 221e452..aa40dfc 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfce4=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfce4,0x160));var _0x4fce=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0xfce4[_0x521e8d];return _0x518bbd;};'use strict';var _=require(_0x4fce('0x0'));var util=require('util');var logger=require(_0x4fce('0x1'))(_0x4fce('0x2'));var moment=require(_0x4fce('0x3'));var BPromise=require(_0x4fce('0x4'));var rp=require(_0x4fce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fce('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fce('0x7'));module[_0x4fce('0x8')]=function(_0x1f65bc,_0x1e687b){return _0x1f65bc[_0x4fce('0x9')](_0x4fce('0xa'),attributes,{'tableName':_0x4fce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fce('0xc'),'collate':_0x4fce('0xd')});}; \ No newline at end of file +var _0x70c0=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x5bf40f,_0x4c3ef3){var _0x6092b1=function(_0x3e0b02){while(--_0x3e0b02){_0x5bf40f['push'](_0x5bf40f['shift']());}};_0x6092b1(++_0x4c3ef3);}(_0x70c0,0x1a4));var _0x070c=function(_0x46fd07,_0x3abdf7){_0x46fd07=_0x46fd07-0x0;var _0xe3deff=_0x70c0[_0x46fd07];return _0xe3deff;};'use strict';var _=require('lodash');var util=require(_0x070c('0x0'));var logger=require(_0x070c('0x1'))(_0x070c('0x2'));var moment=require(_0x070c('0x3'));var BPromise=require(_0x070c('0x4'));var rp=require(_0x070c('0x5'));var fs=require('fs');var path=require(_0x070c('0x6'));var rimraf=require(_0x070c('0x7'));var config=require(_0x070c('0x8'));var attributes=require(_0x070c('0x9'));module[_0x070c('0xa')]=function(_0x21a775,_0x15e0e9){return _0x21a775[_0x070c('0xb')](_0x070c('0xc'),attributes,{'tableName':_0x070c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x070c('0xe'),'collate':_0x070c('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 76adb64..df2ce5a 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f37=['then','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x3ecaf1,_0x4cf1d4){var _0x5382fe=function(_0x1f4fee){while(--_0x1f4fee){_0x3ecaf1['push'](_0x3ecaf1['shift']());}};_0x5382fe(++_0x4cf1d4);}(_0x1f37,0x8a));var _0x71f3=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x1f37[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0x71f3('0x0'));var util=require(_0x71f3('0x1'));var moment=require(_0x71f3('0x2'));var BPromise=require(_0x71f3('0x3'));var rs=require(_0x71f3('0x4'));var fs=require('fs');var Redis=require(_0x71f3('0x5'));var db=require(_0x71f3('0x6'))['db'];var utils=require(_0x71f3('0x7'));var logger=require(_0x71f3('0x8'))('rpc');var config=require(_0x71f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x71f3('0xa')][_0x71f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f28b4,_0x2d6656,_0x25db01){return new BPromise(function(_0x3f0aa0,_0x56c5c0){return client['request'](_0x5f28b4,_0x25db01)[_0x71f3('0xc')](function(_0x58af74){logger[_0x71f3('0xd')](_0x71f3('0xe'),_0x2d6656,'request\x20sent');logger[_0x71f3('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2d6656,'request\x20sent',JSON[_0x71f3('0x10')](_0x58af74));if(_0x58af74[_0x71f3('0x11')]){if(_0x58af74['error'][_0x71f3('0x12')]===0x1f4){logger[_0x71f3('0x11')](_0x71f3('0xe'),_0x2d6656,_0x58af74['error'][_0x71f3('0x13')]);return _0x56c5c0(_0x58af74[_0x71f3('0x11')][_0x71f3('0x13')]);}logger[_0x71f3('0x11')](_0x71f3('0xe'),_0x2d6656,_0x58af74[_0x71f3('0x11')][_0x71f3('0x13')]);return _0x3f0aa0(_0x58af74[_0x71f3('0x11')][_0x71f3('0x13')]);}else{logger['info'](_0x71f3('0xe'),_0x2d6656,_0x71f3('0x14'));_0x3f0aa0(_0x58af74['result'][_0x71f3('0x13')]);}})[_0x71f3('0x15')](function(_0x2977cc){logger[_0x71f3('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x2d6656,_0x2977cc);_0x56c5c0(_0x2977cc);});});}exports[_0x71f3('0x16')]=function(_0x40753b){var _0x17c1d6=this;return new Promise(function(_0x36cce6,_0x4b187a){return db[_0x71f3('0x17')][_0x71f3('0x18')](_0x40753b[_0x71f3('0x19')],{'raw':_0x40753b[_0x71f3('0x1a')]?_0x40753b[_0x71f3('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40753b['options']?_0x40753b['options'][_0x71f3('0x1b')]||null:null,'attributes':_0x40753b[_0x71f3('0x1a')]?_0x40753b[_0x71f3('0x1a')][_0x71f3('0x1c')]||null:null,'limit':_0x40753b['options']?_0x40753b[_0x71f3('0x1a')][_0x71f3('0x1d')]||null:null})[_0x71f3('0xc')](function(_0x558b62){logger[_0x71f3('0xd')]('UpdateOpenchannelApplication',_0x40753b);logger[_0x71f3('0xf')](_0x71f3('0x16'),_0x40753b,JSON[_0x71f3('0x10')](_0x558b62));_0x36cce6(_0x558b62);})[_0x71f3('0x15')](function(_0x6f4c1b){logger[_0x71f3('0x11')](_0x71f3('0x16'),_0x6f4c1b['message'],_0x40753b);_0x4b187a(_0x17c1d6['error'](0x1f4,_0x6f4c1b['message']));});});}; \ No newline at end of file +var _0xcd23=['then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','OpenchannelApplication','update','options','raw','where','UpdateOpenchannelApplication','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x4a015f,_0x2820e3){var _0x40ce6c=function(_0x557c5b){while(--_0x557c5b){_0x4a015f['push'](_0x4a015f['shift']());}};_0x40ce6c(++_0x2820e3);}(_0xcd23,0x176));var _0x3cd2=function(_0x32751b,_0x25f383){_0x32751b=_0x32751b-0x0;var _0x2fdb5e=_0xcd23[_0x32751b];return _0x2fdb5e;};'use strict';var _=require(_0x3cd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3cd2('0x1'));var rs=require(_0x3cd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cd2('0x3'))['db'];var utils=require(_0x3cd2('0x4'));var logger=require(_0x3cd2('0x5'))('rpc');var config=require(_0x3cd2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3cd2('0x7')][_0x3cd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e43e7,_0x2f3ffd,_0x1e11b5){return new BPromise(function(_0x5bd9f3,_0x4d6593){return client[_0x3cd2('0x9')](_0x5e43e7,_0x1e11b5)[_0x3cd2('0xa')](function(_0x5559f9){logger[_0x3cd2('0xb')](_0x3cd2('0xc'),_0x2f3ffd,_0x3cd2('0xd'));logger[_0x3cd2('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2f3ffd,_0x3cd2('0xd'),JSON['stringify'](_0x5559f9));if(_0x5559f9['error']){if(_0x5559f9[_0x3cd2('0xf')]['code']===0x1f4){logger[_0x3cd2('0xf')](_0x3cd2('0xc'),_0x2f3ffd,_0x5559f9[_0x3cd2('0xf')][_0x3cd2('0x10')]);return _0x4d6593(_0x5559f9['error'][_0x3cd2('0x10')]);}logger['error'](_0x3cd2('0xc'),_0x2f3ffd,_0x5559f9[_0x3cd2('0xf')][_0x3cd2('0x10')]);return _0x5bd9f3(_0x5559f9[_0x3cd2('0xf')][_0x3cd2('0x10')]);}else{logger['info'](_0x3cd2('0xc'),_0x2f3ffd,_0x3cd2('0xd'));_0x5bd9f3(_0x5559f9['result'][_0x3cd2('0x10')]);}})[_0x3cd2('0x11')](function(_0x2e21bd){logger[_0x3cd2('0xf')](_0x3cd2('0xc'),_0x2f3ffd,_0x2e21bd);_0x4d6593(_0x2e21bd);});});}exports['UpdateOpenchannelApplication']=function(_0x479e0c){var _0x66a021=this;return new Promise(function(_0x34736a,_0x38e467){return db[_0x3cd2('0x12')][_0x3cd2('0x13')](_0x479e0c['body'],{'raw':_0x479e0c['options']?_0x479e0c[_0x3cd2('0x14')][_0x3cd2('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x479e0c[_0x3cd2('0x14')]?_0x479e0c[_0x3cd2('0x14')][_0x3cd2('0x16')]||null:null,'attributes':_0x479e0c[_0x3cd2('0x14')]?_0x479e0c[_0x3cd2('0x14')]['attributes']||null:null,'limit':_0x479e0c[_0x3cd2('0x14')]?_0x479e0c['options']['limit']||null:null})[_0x3cd2('0xa')](function(_0x3ea7b7){logger[_0x3cd2('0xb')](_0x3cd2('0x17'),_0x479e0c);logger['debug']('UpdateOpenchannelApplication',_0x479e0c,JSON['stringify'](_0x3ea7b7));_0x34736a(_0x3ea7b7);})[_0x3cd2('0x11')](function(_0x3cb522){logger[_0x3cd2('0xf')](_0x3cd2('0x17'),_0x3cb522[_0x3cd2('0x10')],_0x479e0c);_0x38e467(_0x66a021[_0x3cd2('0xf')](0x1f4,_0x3cb522[_0x3cd2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index cdcd5bf..edd8f8d 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5ea=['/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','/:id/download','download','post','create'];(function(_0x14cf9c,_0x592b60){var _0x3e0297=function(_0x2f9be4){while(--_0x2f9be4){_0x14cf9c['push'](_0x14cf9c['shift']());}};_0x3e0297(++_0x592b60);}(_0xc5ea,0x1cb));var _0xac5e=function(_0x2a1a98,_0x5a7d5a){_0x2a1a98=_0x2a1a98-0x0;var _0x7a90ff=_0xc5ea[_0x2a1a98];return _0x7a90ff;};'use strict';var multer=require(_0xac5e('0x0'));var util=require(_0xac5e('0x1'));var path=require('path');var timeout=require(_0xac5e('0x2'));var express=require(_0xac5e('0x3'));var router=express[_0xac5e('0x4')]();var fs_extra=require(_0xac5e('0x5'));var auth=require(_0xac5e('0x6'));var interaction=require(_0xac5e('0x7'));var config=require(_0xac5e('0x8'));var controller=require(_0xac5e('0x9'));router[_0xac5e('0xa')]('/',auth[_0xac5e('0xb')](),controller[_0xac5e('0xc')]);router[_0xac5e('0xa')](_0xac5e('0xd'),auth['isAuthenticated'](),controller[_0xac5e('0xe')]);router['get']('/:id',auth[_0xac5e('0xb')](),controller[_0xac5e('0xf')]);router[_0xac5e('0xa')](_0xac5e('0x10'),auth[_0xac5e('0xb')](),controller['getMessages']);router[_0xac5e('0xa')](_0xac5e('0x11'),auth[_0xac5e('0xb')](),controller[_0xac5e('0x12')]);router[_0xac5e('0x13')]('/',auth[_0xac5e('0xb')](),controller[_0xac5e('0x14')]);router[_0xac5e('0x13')](_0xac5e('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0xac5e('0x13')](_0xac5e('0x15'),auth['isAuthenticated'](),interaction[_0xac5e('0x16')](_0xac5e('0x17'),_0xac5e('0x18')),controller[_0xac5e('0x19')]);router['put'](_0xac5e('0x1a'),auth[_0xac5e('0xb')](),interaction[_0xac5e('0x16')](_0xac5e('0x17'),'openchannelinteraction:update'),controller['update']);router[_0xac5e('0x1b')]('/:id',auth[_0xac5e('0xb')](),interaction['tracked'](_0xac5e('0x17'),_0xac5e('0x1c')),controller[_0xac5e('0x1d')]);router[_0xac5e('0x1b')](_0xac5e('0x15'),auth[_0xac5e('0xb')](),controller[_0xac5e('0x1e')]);module[_0xac5e('0x1f')]=router; \ No newline at end of file +var _0xa705=['put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','getMessages','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','addTags'];(function(_0x21fdf2,_0x4ee73a){var _0x2daa88=function(_0x58b9a6){while(--_0x58b9a6){_0x21fdf2['push'](_0x21fdf2['shift']());}};_0x2daa88(++_0x4ee73a);}(_0xa705,0x15c));var _0x5a70=function(_0x56d99d,_0x588a9f){_0x56d99d=_0x56d99d-0x0;var _0x55006f=_0xa705[_0x56d99d];return _0x55006f;};'use strict';var multer=require(_0x5a70('0x0'));var util=require(_0x5a70('0x1'));var path=require(_0x5a70('0x2'));var timeout=require(_0x5a70('0x3'));var express=require(_0x5a70('0x4'));var router=express[_0x5a70('0x5')]();var fs_extra=require(_0x5a70('0x6'));var auth=require(_0x5a70('0x7'));var interaction=require(_0x5a70('0x8'));var config=require('../../config/environment');var controller=require(_0x5a70('0x9'));router['get']('/',auth[_0x5a70('0xa')](),controller['index']);router[_0x5a70('0xb')](_0x5a70('0xc'),auth[_0x5a70('0xa')](),controller[_0x5a70('0xd')]);router[_0x5a70('0xb')](_0x5a70('0xe'),auth[_0x5a70('0xa')](),controller['show']);router['get']('/:id/messages',auth[_0x5a70('0xa')](),controller[_0x5a70('0xf')]);router[_0x5a70('0xb')]('/:id/download',auth[_0x5a70('0xa')](),controller[_0x5a70('0x10')]);router[_0x5a70('0x11')]('/',auth[_0x5a70('0xa')](),controller['create']);router[_0x5a70('0x11')](_0x5a70('0x12'),auth[_0x5a70('0xa')](),controller[_0x5a70('0x13')]);router[_0x5a70('0x11')](_0x5a70('0x14'),auth['isAuthenticated'](),interaction[_0x5a70('0x15')](_0x5a70('0x16'),'openchannelinteraction:addtags'),controller[_0x5a70('0x17')]);router[_0x5a70('0x18')](_0x5a70('0xe'),auth['isAuthenticated'](),interaction[_0x5a70('0x15')]('openchannel',_0x5a70('0x19')),controller['update']);router[_0x5a70('0x1a')](_0x5a70('0xe'),auth[_0x5a70('0xa')](),interaction[_0x5a70('0x15')](_0x5a70('0x16'),_0x5a70('0x1b')),controller[_0x5a70('0x1c')]);router['delete'](_0x5a70('0x14'),auth[_0x5a70('0xa')](),controller[_0x5a70('0x1d')]);module[_0x5a70('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4cc2c48..61313eb 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9b7=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x20412f,_0x32b502){_0x20412f=_0x20412f-0x0;var _0x16d840=_0xc9b7[_0x20412f];return _0x16d840;};'use strict';var Sequelize=require(_0x7c9b('0x0'));module[_0x7c9b('0x1')]={'closed':{'type':Sequelize[_0x7c9b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7c9b('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7c9b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7c9b('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7c9b('0x3')]},'threadId':{'type':Sequelize[_0x7c9b('0x4')]},'externalUrl':{'type':Sequelize[_0x7c9b('0x4')]},'lastMsgAt':{'type':Sequelize[_0x7c9b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7c9b('0x5')]('in',_0x7c9b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7c9b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x7c9b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3379=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x579ce2,_0x3cdc58){var _0xb4f49f=function(_0x378b3c){while(--_0x378b3c){_0x579ce2['push'](_0x579ce2['shift']());}};_0xb4f49f(++_0x3cdc58);}(_0x3379,0x115));var _0x9337=function(_0x586675,_0x129f9b){_0x586675=_0x586675-0x0;var _0x21f0e1=_0x3379[_0x586675];return _0x21f0e1;};'use strict';var Sequelize=require(_0x9337('0x0'));module[_0x9337('0x1')]={'closed':{'type':Sequelize[_0x9337('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9337('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9337('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9337('0x4')]},'note':{'type':Sequelize[_0x9337('0x4')]},'read1stAt':{'type':Sequelize[_0x9337('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x9337('0x4')]},'lastMsgAt':{'type':Sequelize[_0x9337('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9337('0x5')]('in',_0x9337('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9337('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 38ed720..3421196 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x391a=['rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','select','field','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','forEach','union','User','operator','buildExpression','text','body','keys','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','Sequelize','SELECT','clone','contactName','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','o.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','all','rows','show','params','includeAll','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','OpenchannelInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','setTags','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','split','Tags','push','catch','waiting','answered','unmanaged','closed','UserId','talking','total'];(function(_0x57d93d,_0x54e571){var _0x1b8148=function(_0x22dfa6){while(--_0x22dfa6){_0x57d93d['push'](_0x57d93d['shift']());}};_0x1b8148(++_0x54e571);}(_0x391a,0x198));var _0xa391=function(_0x45a1bf,_0x760960){_0x45a1bf=_0x45a1bf-0x0;var _0x3c8110=_0x391a[_0x45a1bf];return _0x3c8110;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa391('0x0'));var zipdir=require(_0xa391('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa391('0x2'));var moment=require(_0xa391('0x3'));var BPromise=require(_0xa391('0x4'));var Mustache=require(_0xa391('0x5'));var util=require('util');var path=require(_0xa391('0x6'));var sox=require('sox');var csv=require(_0xa391('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa391('0x8'));var _=require(_0xa391('0x9'));var squel=require(_0xa391('0xa'));var crypto=require(_0xa391('0xb'));var jsforce=require(_0xa391('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa391('0x7'));var querystring=require(_0xa391('0xd'));var Papa=require(_0xa391('0xe'));var Redis=require(_0xa391('0xf'));var authService=require(_0xa391('0x10'));var qs=require(_0xa391('0x11'));var as=require(_0xa391('0x12'));var pdf=require(_0xa391('0x13'));var hardwareService=require(_0xa391('0x14'));var logger=require(_0xa391('0x15'))(_0xa391('0x16'));var utils=require(_0xa391('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa391('0x18'))['db'];config[_0xa391('0x19')]=_['defaults'](config[_0xa391('0x19')],{'host':_0xa391('0x1a'),'port':0x18eb});var socket=require(_0xa391('0x1b'))(new Redis(config[_0xa391('0x19')]));require(_0xa391('0x1c'))[_0xa391('0x1d')](socket);function respondWithStatusCode(_0x50e49f,_0x7b4e57){_0x7b4e57=_0x7b4e57||0xcc;return function(_0x5f1b08){if(_0x5f1b08){return _0x50e49f['sendStatus'](_0x7b4e57);}return _0x50e49f[_0xa391('0x1e')](_0x7b4e57)[_0xa391('0x1f')]();};}function respondWithResult(_0x2d88ed,_0x510a13){_0x510a13=_0x510a13||0xc8;return function(_0x35ee88){if(_0x35ee88){return _0x2d88ed[_0xa391('0x1e')](_0x510a13)[_0xa391('0x20')](_0x35ee88);}};}function respondWithFilteredResult(_0x54fedc,_0x4e11bd){return function(_0x5850fc){if(_0x5850fc){var _0x10551a=typeof _0x4e11bd[_0xa391('0x21')]===_0xa391('0x22')&&typeof _0x4e11bd[_0xa391('0x23')]===_0xa391('0x22');var _0x23da11=_0x5850fc[_0xa391('0x24')];var _0x276fdf=_0x10551a?0x0:_0x4e11bd[_0xa391('0x21')];var _0x2f9a32=_0x10551a?_0x5850fc[_0xa391('0x24')]:_0x4e11bd[_0xa391('0x21')]+_0x4e11bd[_0xa391('0x23')];var _0x5693dc;if(_0x2f9a32>=_0x23da11){_0x2f9a32=_0x23da11;_0x5693dc=0xc8;}else{_0x5693dc=0xce;}_0x54fedc[_0xa391('0x1e')](_0x5693dc);return _0x54fedc[_0xa391('0x25')](_0xa391('0x26'),_0x276fdf+'-'+_0x2f9a32+'/'+_0x23da11)[_0xa391('0x20')](_0x5850fc);}return null;};}function patchUpdates(_0x195324){return function(_0x4ce7e7){try{jsonpatch[_0xa391('0x27')](_0x4ce7e7,_0x195324,!![]);}catch(_0x103f38){return BPromise[_0xa391('0x28')](_0x103f38);}return _0x4ce7e7[_0xa391('0x29')]();};}function saveUpdates(_0x5148da,_0x2f8381){return function(_0x573b2e){if(_0x573b2e){return _0x573b2e[_0xa391('0x2a')](_0x5148da)[_0xa391('0x2b')](function(_0x16596c){return _0x16596c;});}return null;};}function removeEntity(_0x492c05,_0x4ac48e){return function(_0x52dfd4){if(_0x52dfd4){return _0x52dfd4[_0xa391('0x2c')]()[_0xa391('0x2b')](function(){_0x492c05[_0xa391('0x1e')](0xcc)[_0xa391('0x1f')]();});}};}function handleEntityNotFound(_0x5965f4,_0x15fe4a){return function(_0x407a23){if(!_0x407a23){_0x5965f4[_0xa391('0x2d')](0x194);}return _0x407a23;};}function handleError(_0x37e01f,_0x1f1bb3){_0x1f1bb3=_0x1f1bb3||0x1f4;return function(_0x570f88){logger['error'](_0x570f88[_0xa391('0x2e')]);if(_0x570f88['name']){delete _0x570f88[_0xa391('0x2f')];}_0x37e01f[_0xa391('0x1e')](_0x1f1bb3)[_0xa391('0x30')](_0x570f88);};}function getInteractionUsers(_0xbe532f,_0x1666b9){return new BPromise(function(_0x1b6aca,_0x387b6c){try{if(_0x1666b9[_0xbe532f['id']]){_0xbe532f[_0xa391('0x31')]=_[_0xa391('0x32')](_0x1666b9[_0xbe532f['id']],function(_0x36f5e5){return{'id':_0x36f5e5['id'],'fullname':_0x36f5e5[_0xa391('0x33')]};});}}catch(_0x425096){_0x387b6c(_0x425096);}_0x1b6aca(_0xbe532f);});}function getInteractionTags(_0xd8e5c8,_0x46b534){return new BPromise(function(_0x49edec,_0x363d57){try{if(_0xd8e5c8[_0xa391('0x34')]){_0xd8e5c8['Tags']=[];_0xd8e5c8['TagIds'][_0xa391('0x35')](',')['forEach'](function(_0x2b184c){_0xd8e5c8[_0xa391('0x36')][_0xa391('0x37')](_0x46b534[_0x2b184c]);});}delete _0xd8e5c8['TagIds'];}catch(_0x1d5d9d){_0x363d57(_0x1d5d9d);}_0x49edec(_0xd8e5c8);});}function updateOpenchannelInteraction(_0x311223,_0x31b93b,_0x298fbe){return new BPromise(function(_0x4a764f,_0x5e1b25){return getInteractionUsers(_0x311223,_0x298fbe)[_0xa391('0x2b')](function(_0x5d1704){return getInteractionTags(_0x5d1704,_0x31b93b);})[_0xa391('0x2b')](function(_0x1105b5){return getStateInteraction(_0x1105b5);})[_0xa391('0x2b')](function(_0x43ccc4){_0x4a764f(_0x43ccc4);})[_0xa391('0x38')](function(_0x4205d2){_0x5e1b25(_0x4205d2);});});}function getStateInteraction(_0x207399){return new BPromise(function(_0x2d3607){_0x207399[_0xa391('0x39')]=0x0;_0x207399['talking']=0x0;_0x207399[_0xa391('0x3a')]=0x0;_0x207399[_0xa391('0x3b')]=0x0;_0x207399['total']=0x0;if(!_0x207399[_0xa391('0x3c')]&&!_0x207399['UserId']){_0x207399[_0xa391('0x39')]+=0x1;}if(!_0x207399[_0xa391('0x3c')]&&_0x207399[_0xa391('0x3d')]){_0x207399[_0xa391('0x3e')]+=0x1;if(_0x207399['waiting']){_0x207399[_0xa391('0x39')]-=0x1;}}if(_0x207399[_0xa391('0x3c')]&&_0x207399[_0xa391('0x3d')]){_0x207399['answered']+=0x1;if(_0x207399[_0xa391('0x3e')]){_0x207399['talking']-=0x1;}}if(_0x207399[_0xa391('0x3c')]&&!_0x207399['UserId']){_0x207399[_0xa391('0x3b')]+=0x1;if(_0x207399['waiting']){_0x207399['waiting']-=0x1;}}_0x207399[_0xa391('0x3f')]+=0x1;_0x2d3607(_0x207399);});}exports['index']=function(_0x20a904,_0x3e3a84){var _0x404446={},_0x4bb846={},_0x1546c0={'count':0x0,'rows':[]};var _0x2e4f30=_[_0xa391('0x32')](db['OpenchannelInteraction'][_0xa391('0x40')],function(_0x57b925){return{'name':_0x57b925['fieldName'],'type':_0x57b925[_0xa391('0x41')][_0xa391('0x42')]};});_0x4bb846[_0xa391('0x43')]=_[_0xa391('0x32')](_0x2e4f30,'name');_0x4bb846[_0xa391('0x44')]=_['keys'](_0x20a904[_0xa391('0x44')]);_0x4bb846[_0xa391('0x45')]=_[_0xa391('0x46')](_0x4bb846['model'],_0x4bb846[_0xa391('0x44')]);_0x404446['attributes']=_['intersection'](_0x4bb846[_0xa391('0x43')],qs[_0xa391('0x47')](_0x20a904['query']['fields']));_0x404446['attributes']=_0x404446[_0xa391('0x48')]['length']?_0x404446[_0xa391('0x48')]:_0x4bb846[_0xa391('0x43')];if(!_0x20a904[_0xa391('0x44')][_0xa391('0x49')]('nolimit')){_0x404446[_0xa391('0x23')]=qs[_0xa391('0x23')](_0x20a904[_0xa391('0x44')][_0xa391('0x23')]);_0x404446[_0xa391('0x21')]=qs['offset'](_0x20a904['query']['offset']);}_0x404446[_0xa391('0x4a')]=qs[_0xa391('0x4b')](_0x20a904[_0xa391('0x44')][_0xa391('0x4b')]);_0x404446['where']=qs['filters'](_['pick'](_0x20a904[_0xa391('0x44')],_0x4bb846[_0xa391('0x45')]),_0x2e4f30);var _0x45ae97=[];var _0x3398b4=squel[_0xa391('0x4c')]()['field']('id')['field'](_0xa391('0x2f'))[_0xa391('0x4d')]('color')[_0xa391('0x4e')](_0xa391('0x4f'));var _0x381662=squel[_0xa391('0x4c')]()[_0xa391('0x4d')](_0xa391('0x50'))['field'](_0xa391('0x51'))[_0xa391('0x4d')]('ui.OpenchannelInteractionId')[_0xa391('0x4e')](_0xa391('0x52'),'ui')[_0xa391('0x53')](_0xa391('0x54'),'u',_0xa391('0x55'));var _0x348e68=squel[_0xa391('0x4c')]()[_0xa391('0x4e')](_0xa391('0x56'),'i')[_0xa391('0x53')](_0xa391('0x57'),'c',_0xa391('0x58'))[_0xa391('0x53')](_0xa391('0x54'),'o',_0xa391('0x59'))[_0xa391('0x53')](_0xa391('0x5a'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xa391('0x53')](_0xa391('0x5b'),'me',_0xa391('0x5c'))[_0xa391('0x53')](_0xa391('0x5d'),'it',_0xa391('0x5e'))[_0xa391('0x53')](_0xa391('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x2d77a1=squel[_0xa391('0x5f')]();var _0x44df4f=[];var _0x4c5b00=squel[_0xa391('0x5f')]();var _0x4ba725;if(_0x20a904[_0xa391('0x44')][_0xa391('0x60')]){_0x4ba725=as[_0xa391('0x61')](_0x20a904[_0xa391('0x44')][_0xa391('0x60')]);var _0x21a45c=_0x4ba725['sqlOperator'];for(var _0x46ea7d=0x0;_0x46ea7d<_0x4ba725['conditions'][_0xa391('0x62')];_0x46ea7d++){var _0x3ad974=_0x4ba725[_0xa391('0x63')][_0x46ea7d];var _0x535f6f='i';var _0x5c7865=_[_0xa391('0x64')](_0x2e4f30,['name',_0x3ad974[_0xa391('0x4d')]]);if(!_0x5c7865){switch(_0x3ad974[_0xa391('0x4d')]){case _0xa391('0x65'):if(_0x3ad974[_0xa391('0x66')]==0x1){_0x348e68['having']('`'+_0x3ad974['field']+_0xa391('0x67'));}else{_0x348e68[_0xa391('0x68')]('`'+_0x3ad974[_0xa391('0x4d')]+_0xa391('0x69'));}break;case _0xa391('0x6a'):if(_0x3ad974['operator']===_0xa391('0x6b')){if(_0x3ad974[_0xa391('0x66')][_0xa391('0x35')]('\x20')[_0xa391('0x62')]>0x1){_0x2d77a1[_0x21a45c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa391('0x6c')](_0x3ad974[_0xa391('0x66')]),null);}else{var _0x16cd5e='%'+_0x3ad974['value']+'%';_0x2d77a1[_0x21a45c](_0xa391('0x6d'),_0x16cd5e,_0x16cd5e,_0x16cd5e);}}else{_0x5c7865=_[_0xa391('0x64')](_0x2e4f30,['name',_0xa391('0x6e')]);_0x3ad974['field']=_0xa391('0x6e');_0x9d7d76=as['buildExpression'](_0x535f6f,_0x5c7865['type'],_0x3ad974);_0x2d77a1[_0x21a45c](_0x9d7d76['text'],_0x9d7d76[_0xa391('0x66')][_0xa391('0x6f')],_0x9d7d76[_0xa391('0x66')][_0xa391('0x1f')]);}break;case _0xa391('0x70'):var _0x412834=_0x3ad974[_0xa391('0x66')][_0xa391('0x35')](',')[_0xa391('0x32')](function(_0x3c4174){return Number(_0x3c4174);});_0x412834[_0xa391('0x71')](function(_0x41bd26){_0x4c5b00['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x41bd26+',%');});_0x44df4f=_[_0xa391('0x72')](_0x44df4f,_0x412834);break;case _0xa391('0x73'):if(_0x3ad974[_0xa391('0x74')]===_0xa391('0x6b')){_0x2d77a1[_0x21a45c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3ad974[_0xa391('0x66')]+'%',null);}else{_0x5c7865=_[_0xa391('0x64')](_0x2e4f30,['name','UserId']);_0x3ad974[_0xa391('0x4d')]=_0xa391('0x3d');_0x9d7d76=as[_0xa391('0x75')](_0x535f6f,_0x5c7865[_0xa391('0x41')],_0x3ad974);_0x2d77a1[_0x21a45c](_0x9d7d76[_0xa391('0x76')],_0x9d7d76[_0xa391('0x66')][_0xa391('0x6f')],_0x9d7d76['value'][_0xa391('0x1f')]);}break;case _0xa391('0x77'):_0x9d7d76=as[_0xa391('0x75')]('me',null,_0x3ad974);_0x2d77a1[_0x21a45c](_0x9d7d76['text'],_0x9d7d76[_0xa391('0x66')][_0xa391('0x6f')],_0x9d7d76[_0xa391('0x66')][_0xa391('0x1f')]);break;}}else{var _0x9d7d76=as['buildExpression'](_0x535f6f,_0x5c7865[_0xa391('0x41')],_0x3ad974);_0x2d77a1[_0x21a45c](_0x9d7d76[_0xa391('0x76')],_0x9d7d76[_0xa391('0x66')]['start'],_0x9d7d76[_0xa391('0x66')][_0xa391('0x1f')]);}}}else{var _0x3b9d9d=_(_0x20a904['query'])[_0xa391('0x78')]()[_0xa391('0x32')](function(_0x5c01cd){return _[_0xa391('0x79')](_0x2e4f30,['name',_0x5c01cd])?_0x5c01cd:undefined;})[_0xa391('0x7a')]()[_0xa391('0x66')]();if(!_[_0xa391('0x7b')](_0x3b9d9d)){_0x3b9d9d[_0xa391('0x71')](function(_0x260111){if(_0x260111===_0xa391('0x7c')){_0x348e68[_0xa391('0x7d')](_0xa391('0x7e'),[]['concat'](_0x20a904['query'][_0x260111]));}else if(_0x260111===_0xa391('0x7f')){var _0x379d0f=JSON[_0xa391('0x80')](_0x20a904[_0xa391('0x44')][_0x260111])['$gte'];var _0x517374=JSON[_0xa391('0x80')](_0x20a904[_0xa391('0x44')][_0x260111])['$lte'];_0x348e68[_0xa391('0x7d')](_0xa391('0x81'),_0x379d0f,_0x517374);}else{if(_0x20a904[_0xa391('0x44')][_0x260111]==='null'){_0x348e68[_0xa391('0x7d')]('i.'+_0x260111+_0xa391('0x82'));}else{_0x348e68[_0xa391('0x7d')]('i.'+_0x260111+_0xa391('0x83'),_0x20a904[_0xa391('0x44')][_0x260111]);}}});}if(_0x20a904['query'][_0xa391('0x84')]){if(_0x20a904[_0xa391('0x44')][_0xa391('0x84')]==0x1){_0x348e68[_0xa391('0x68')]('`unreadMessages`\x20=\x200');}else{_0x348e68['having'](_0xa391('0x85'));}}if(_0x20a904['query']['tag']){_0x44df4f=_[_0xa391('0x86')](_0x20a904['query'][_0xa391('0x87')])?_0x20a904[_0xa391('0x44')]['tag']:new Array(_0x20a904[_0xa391('0x44')][_0xa391('0x87')]);_0x44df4f[_0xa391('0x71')](function(_0xd30de6){_0x4c5b00['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd30de6+',%');});}if(_0x20a904[_0xa391('0x44')]['filter']){var _0x16219e=_0x20a904[_0xa391('0x44')][_0xa391('0x88')][_0xa391('0x89')]('\x5c','\x5c\x5c')[_0xa391('0x89')](/'/g,'\x27\x27');if(qs[_0xa391('0x8a')](_0x16219e)){_0x2d77a1['or']('i.id\x20LIKE\x20?',_0x16219e+'%');}else{_0x2d77a1['or'](_0xa391('0x8b'),qs[_0xa391('0x6c')](_0x16219e))['or'](_0xa391('0x8c'),_0x16219e+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x16219e+'%');}}}_0x348e68[_0xa391('0x7d')](_0x2d77a1);_0x348e68[_0xa391('0x8d')]('i.id');var _0x4c2c5d={'type':db[_0xa391('0x8e')]['QueryTypes'][_0xa391('0x8f')],'raw':!![]};var _0x46f08c=_0x348e68[_0xa391('0x90')]();_0x46f08c[_0xa391('0x4d')]('i.id');_0x46f08c[_0xa391('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x404446['order']){_0x404446[_0xa391('0x4a')][_0xa391('0x71')](function(_0x169f76){var _0x1c6a4f=_0x169f76[0x0]===_0xa391('0x91')?_0x169f76[0x0]:'i.'+_0x169f76[0x0];_0x348e68['order'](_0x1c6a4f,_0x169f76[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x44df4f)){_0x348e68['having'](_0x4c5b00);_0x46f08c['where'](_0xa391('0x92'),_0x44df4f);}BPromise['resolve']()[_0xa391('0x2b')](function(){if(!_0x4ba725){if(_0x20a904[_0xa391('0x44')]['OpenchannelAccountId'])return;_0x46f08c['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x348e68[_0xa391('0x7d')](_0xa391('0x93'));return;}if(_0x20a904['user'][_0xa391('0x94')]!==_0xa391('0x95'))return;return _0x20a904['user'][_0xa391('0x96')]({'attributes':['id'],'raw':!![]})[_0xa391('0x2b')](function(_0x54a764){if(_[_0xa391('0x7b')](_0x54a764)){_0x46f08c['where'](_0xa391('0x97'));_0x348e68[_0xa391('0x7d')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x46f08c['where'](_0xa391('0x7e'),_['map'](_0x54a764,'id'));_0x348e68[_0xa391('0x7d')](_0xa391('0x7e'),_[_0xa391('0x32')](_0x54a764,'id'));}});})[_0xa391('0x2b')](function(){if(_0x20a904[_0xa391('0x98')][_0xa391('0x94')]===_0xa391('0x95')&&!_0x4ba725&&!_0x20a904['query'][_0xa391('0x7c')])return[];return db[_0xa391('0x99')]['query'](_0x46f08c[_0xa391('0x9a')](),_0x4c2c5d);})['then'](function(_0x255ebc){_0x1546c0[_0xa391('0x24')]=_0x255ebc[_0xa391('0x62')];if(_0x1546c0[_0xa391('0x24')]===0x0)return[];return db['sequelize'][_0xa391('0x44')](_0x3398b4[_0xa391('0x9a')](),_0x4c2c5d)[_0xa391('0x2b')](function(_0x1ae07e){_0x45ae97=_[_0xa391('0x9b')](_0x1ae07e,'id');_0x4c2c5d=_[_0xa391('0x9c')](_0x4c2c5d,{'model':db[_0xa391('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20a904[_0xa391('0x44')][_0xa391('0x47')]){_0x404446[_0xa391('0x48')][_0xa391('0x71')](function(_0x3a89a6){_0x348e68['field']('i.'+_0x3a89a6);});}else{_0x348e68['field'](_0xa391('0x9e'),'unreadMessages');_0x348e68[_0xa391('0x4d')](_0xa391('0x9f'),'Account.key');_0x348e68['field'](_0xa391('0xa0'),'Account.mandatoryDisposition');_0x348e68[_0xa391('0x4d')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xa391('0x91'));_0x348e68[_0xa391('0x4d')](_0xa391('0xa1'));_0x348e68[_0xa391('0x4d')](_0xa391('0xa2'),_0xa391('0xa3'));_0x348e68[_0xa391('0x4d')](_0xa391('0xa4'),_0xa391('0xa5'));_0x348e68[_0xa391('0x4d')]('c.email',_0xa391('0xa6'));_0x348e68[_0xa391('0x4d')](_0xa391('0xa7'),'Contact.phone');_0x348e68['field']('c.mobile',_0xa391('0xa8'));_0x348e68['field']('c.fax',_0xa391('0xa9'));_0x348e68[_0xa391('0x4d')](_0xa391('0xaa'),'Owner.fullname');_0x348e68[_0xa391('0x4d')](_0xa391('0xab'),'Owner.internal');_0x348e68[_0xa391('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa391('0x34'));}if(_0x404446['limit'])_0x348e68[_0xa391('0x23')](_0x404446[_0xa391('0x23')]);if(_0x404446[_0xa391('0x21')])_0x348e68[_0xa391('0x21')](_0x404446[_0xa391('0x21')]);return db[_0xa391('0x99')][_0xa391('0x44')](_0x348e68[_0xa391('0x9a')](),_0x4c2c5d);})[_0xa391('0x2b')](function(_0x23fa8f){if(_0x23fa8f[_0xa391('0x62')]>0x0)_0x381662[_0xa391('0x7d')](_0xa391('0xac'),_[_0xa391('0x32')](_0x23fa8f,'id'));return db[_0xa391('0x99')][_0xa391('0x44')](_0x381662[_0xa391('0x9a')](),_0x4c2c5d)['then'](function(_0x3bfd8d){var _0x4a185a=_['groupBy'](_0x3bfd8d,'OpenchannelInteractionId');var _0x9f8c35=[];_0x23fa8f[_0xa391('0x71')](function(_0x4b8ca5){_0x9f8c35[_0xa391('0x37')](updateOpenchannelInteraction(_0x4b8ca5,_0x45ae97,_0x4a185a));});return BPromise[_0xa391('0xad')](_0x9f8c35);});});})[_0xa391('0x2b')](function(_0x29b8e0){_0x1546c0[_0xa391('0xae')]=_0x29b8e0;return _0x1546c0;})[_0xa391('0x2b')](respondWithFilteredResult(_0x3e3a84,_0x404446))[_0xa391('0x38')](handleError(_0x3e3a84,null));};exports[_0xa391('0xaf')]=function(_0x9e9b34,_0x1916ec){var _0x5f3a6e={};if(_0x9e9b34[_0xa391('0x44')][_0xa391('0x41')]&&_0x9e9b34[_0xa391('0x44')]['type']===_0xa391('0x4e')){_0x5f3a6e[_0xa391('0x4e')]=_0x9e9b34['params']['id'];}else{_0x5f3a6e['id']=_0x9e9b34[_0xa391('0xb0')]['id'];}var _0x24387e={'raw':![],'where':_0x5f3a6e},_0x18af52={};_0x18af52['model']=_[_0xa391('0x78')](db[_0xa391('0x9d')][_0xa391('0x40')]);_0x18af52['query']=_[_0xa391('0x78')](_0x9e9b34[_0xa391('0x44')]);_0x18af52[_0xa391('0x45')]=_[_0xa391('0x46')](_0x18af52[_0xa391('0x43')],_0x18af52['query']);_0x24387e[_0xa391('0x48')]=_[_0xa391('0x46')](_0x18af52[_0xa391('0x43')],qs[_0xa391('0x47')](_0x9e9b34['query'][_0xa391('0x47')]));_0x24387e[_0xa391('0x48')]=_0x24387e['attributes']['length']?_0x24387e[_0xa391('0x48')]:_0x18af52[_0xa391('0x43')];if(_0x9e9b34[_0xa391('0x44')][_0xa391('0xb1')]){_0x24387e['include']=[{'all':!![]}];}_0x24387e=_[_0xa391('0x9c')]({},_0x24387e,_0x9e9b34[_0xa391('0xb2')]);return db['OpenchannelInteraction'][_0xa391('0x64')](_0x24387e)[_0xa391('0x2b')](handleEntityNotFound(_0x1916ec,null))[_0xa391('0x2b')](respondWithResult(_0x1916ec,null))[_0xa391('0x38')](handleError(_0x1916ec,null));};exports[_0xa391('0xb3')]=function(_0x55c09b,_0x6f559a){return db[_0xa391('0x9d')]['create'](_0x55c09b['body'],{})[_0xa391('0x2b')](respondWithResult(_0x6f559a,0xc9))[_0xa391('0x38')](handleError(_0x6f559a,null));};exports[_0xa391('0x2a')]=function(_0x5c47d0,_0x440f36){if(_0x5c47d0[_0xa391('0x77')]['id']){delete _0x5c47d0[_0xa391('0x77')]['id'];}return db['OpenchannelInteraction'][_0xa391('0x64')]({'where':{'id':_0x5c47d0[_0xa391('0xb0')]['id']}})[_0xa391('0x2b')](handleEntityNotFound(_0x440f36,null))[_0xa391('0x2b')](saveUpdates(_0x5c47d0[_0xa391('0x77')],null))[_0xa391('0x2b')](respondWithResult(_0x440f36,null))['catch'](handleError(_0x440f36,null));};exports[_0xa391('0x2c')]=function(_0x2e4daf,_0x54c46f){return db['OpenchannelInteraction'][_0xa391('0x64')]({'where':{'id':_0x2e4daf[_0xa391('0xb0')]['id']}})[_0xa391('0x2b')](handleEntityNotFound(_0x54c46f,null))[_0xa391('0x2b')](removeEntity(_0x54c46f,null))[_0xa391('0x38')](handleError(_0x54c46f,null));};exports[_0xa391('0xb4')]=function(_0x27f3fc,_0x228094){return db[_0xa391('0x9d')][_0xa391('0xb4')]()[_0xa391('0x2b')](respondWithResult(_0x228094,null))['catch'](handleError(_0x228094,null));};exports[_0xa391('0xb5')]=function(_0x1056fd,_0x2ca839,_0x35f77b){return db[_0xa391('0xb6')][_0xa391('0x64')]({'where':{'id':_0x1056fd[_0xa391('0xb0')]['id']}})[_0xa391('0x2b')](handleEntityNotFound(_0x2ca839,null))[_0xa391('0x2b')](function(_0x2c94cc){if(_0x2c94cc){return _0x2c94cc['addMessage'](_0x1056fd[_0xa391('0x77')][_0xa391('0xb7')],_[_0xa391('0xb8')](_0x1056fd[_0xa391('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x2ca839,null))[_0xa391('0x38')](handleError(_0x2ca839,null));};exports[_0xa391('0xb9')]=function(_0x576e26,_0xa1e08,_0x5c4eb1){var _0x2020d7={'raw':![],'where':{}};var _0x1ef9ed={};var _0x554a13={'count':0x0,'rows':[]};return db[_0xa391('0x9d')][_0xa391('0xba')]({'where':{'id':_0x576e26[_0xa391('0xb0')]['id']}})['then'](handleEntityNotFound(_0xa1e08,null))['then'](function(_0x860438){if(_0x860438){_0x1ef9ed[_0xa391('0x43')]=_[_0xa391('0x78')](db['OpenchannelMessage'][_0xa391('0x40')]);_0x1ef9ed[_0xa391('0x44')]=_[_0xa391('0x78')](_0x576e26[_0xa391('0x44')]);_0x1ef9ed[_0xa391('0x45')]=_[_0xa391('0x46')](_0x1ef9ed['model'],_0x1ef9ed[_0xa391('0x44')]);_0x2020d7['attributes']=_[_0xa391('0x46')](_0x1ef9ed[_0xa391('0x43')],qs[_0xa391('0x47')](_0x576e26[_0xa391('0x44')][_0xa391('0x47')]));_0x2020d7[_0xa391('0x48')]=_0x2020d7[_0xa391('0x48')]['length']?_0x2020d7[_0xa391('0x48')]:_0x1ef9ed[_0xa391('0x43')];if(!_0x576e26[_0xa391('0x44')][_0xa391('0x49')](_0xa391('0xbb'))){_0x2020d7[_0xa391('0x23')]=qs[_0xa391('0x23')](_0x576e26['query']['limit']);_0x2020d7[_0xa391('0x21')]=qs['offset'](_0x576e26['query'][_0xa391('0x21')]);}_0x2020d7['order']=qs[_0xa391('0x4b')](_0x576e26[_0xa391('0x44')][_0xa391('0x4b')]);_0x2020d7[_0xa391('0x7d')]=qs[_0xa391('0x45')](_['pick'](_0x576e26['query'],_0x1ef9ed[_0xa391('0x45')]));_0x2020d7['where'][_0xa391('0xbc')]=_0x860438['id'];if(_0x576e26[_0xa391('0x44')][_0xa391('0x88')]){_0x2020d7['where']=_[_0xa391('0x9c')](_0x2020d7['where'],{'$or':_[_0xa391('0x32')](_0x2020d7[_0xa391('0x48')],function(_0xd1c7f8){var _0x57004d={};_0x57004d[_0xd1c7f8]={'$like':'%'+_0x576e26[_0xa391('0x44')][_0xa391('0x88')]+'%'};return _0x57004d;})});}if(_0x576e26[_0xa391('0x44')]['$gte']){var _0x5d73a6=_0x576e26[_0xa391('0x44')][_0xa391('0xbd')][_0xa391('0x35')](',');var _0x53d6c1={};_0x53d6c1[_0x5d73a6[0x0]]={'$gte':moment(_0x5d73a6[0x1])[_0xa391('0xbe')](_0xa391('0xbf'))};_0x2020d7[_0xa391('0x7d')]=_['merge'](_0x2020d7['where'],_0x53d6c1);}_0x2020d7=_[_0xa391('0x9c')]({},_0x2020d7,_0x576e26[_0xa391('0xb2')]);return db[_0xa391('0xb6')][_0xa391('0x24')]({'where':_0x2020d7['where']})[_0xa391('0x2b')](function(_0x2742ba){_0x554a13[_0xa391('0x24')]=_0x2742ba;if(_0x576e26[_0xa391('0x44')]['includeAll']){_0x2020d7[_0xa391('0xc0')]=[{'all':!![]}];}return db[_0xa391('0xb6')]['findAll'](_0x2020d7);})[_0xa391('0x2b')](function(_0x3e39e4){_0x554a13[_0xa391('0xae')]=_0x3e39e4;return _0x554a13;});}})['then'](respondWithFilteredResult(_0xa1e08,_0x2020d7))[_0xa391('0x38')](handleError(_0xa1e08,null));};exports['addTags']=function(_0x451b9d,_0x1c6e91,_0x44a8c3){return db['OpenchannelInteraction'][_0xa391('0x64')]({'where':{'id':_0x451b9d[_0xa391('0xb0')]['id']}})[_0xa391('0x2b')](handleEntityNotFound(_0x1c6e91,null))[_0xa391('0x2b')](function(_0x4c6598){if(_0x4c6598){return _0x4c6598[_0xa391('0xc1')](_0x451b9d['body'][_0xa391('0xb7')],_[_0xa391('0xb8')](_0x451b9d[_0xa391('0x77')],[_0xa391('0xb7'),'id'])||{})['spread'](function(){return db[_0xa391('0x70')]['findAll']({'attributes':['id',_0xa391('0x2f'),_0xa391('0xc2')],'where':{'id':_0x451b9d[_0xa391('0x77')][_0xa391('0xb7')]}});})[_0xa391('0x2b')](function(_0x55230a){socket[_0xa391('0xc3')](_0xa391('0xc4'),{'id':Number(_0x451b9d[_0xa391('0xb0')]['id']),'tags':_0x55230a||[]});return{'id':Number(_0x451b9d[_0xa391('0xb0')]['id']),'tags':_0x55230a||[]};});}})[_0xa391('0x2b')](respondWithResult(_0x1c6e91,null))[_0xa391('0x38')](handleError(_0x1c6e91,null));};exports[_0xa391('0xc5')]=function(_0x355c4b,_0x4e9dd4,_0x29f2d7){return db[_0xa391('0x9d')]['find']({'where':{'id':_0x355c4b[_0xa391('0xb0')]['id']}})[_0xa391('0x2b')](handleEntityNotFound(_0x4e9dd4,null))['then'](function(_0x1c3183){if(_0x1c3183){return _0x1c3183['removeTags'](_0x355c4b['query']['ids']);}})[_0xa391('0x2b')](respondWithStatusCode(_0x4e9dd4,null))[_0xa391('0x38')](handleError(_0x4e9dd4,null));};exports['download']=function(_0x212969,_0x30c9fb){var _0x2e31dc=moment()[_0xa391('0xc6')]()[_0xa391('0x9a')]();var _0x3930cb=path[_0xa391('0xc7')](config[_0xa391('0xc8')],_0xa391('0xc9'),_0xa391('0xca'),_0xa391('0xcb'));var _0xbc5566=path[_0xa391('0xc7')](config['root'],'server',_0xa391('0xca'),_0xa391('0xcc'));var _0xe46d67=path[_0xa391('0xc7')](_0x3930cb,_0x2e31dc);var _0x3fb62f=util[_0xa391('0xbe')](_0xa391('0xcd'),_0x212969['params']['id'],_0x2e31dc);var _0x23df16=path[_0xa391('0xc7')](_0x3930cb,_0x3fb62f);var _0x316ecc=[];_0x316ecc[_0xa391('0x37')]({'model':db[_0xa391('0x73')],'as':_0xa391('0x73'),'attributes':['id',_0xa391('0x33')],'raw':!![]});_0x316ecc[_0xa391('0x37')]({'model':db[_0xa391('0xce')],'as':_0xa391('0x6a'),'attributes':['id','firstName',_0xa391('0xcf')],'raw':!![]});if(_0x212969[_0xa391('0x44')]['attachments']){_0x316ecc[_0xa391('0x37')]({'model':db[_0xa391('0xd0')],'as':_0xa391('0xd0'),'raw':!![]});}var _0x367b8b=[{'model':db[_0xa391('0xb6')],'as':_0xa391('0xd1'),'attributes':['id',_0xa391('0x77'),_0xa391('0x7f'),_0xa391('0xd2'),'secret',_0xa391('0x84')],'include':_0x316ecc}];_0x367b8b[_0xa391('0x37')]({'model':db[_0xa391('0xd3')],'as':_0xa391('0xd4'),'attributes':['id',_0xa391('0x2f')]});_0x367b8b[_0xa391('0x37')]({'model':db['User'],'as':_0xa391('0xd5'),'attributes':['id',_0xa391('0x33')]});return db['OpenchannelInteraction'][_0xa391('0x64')]({'where':{'id':_0x212969[_0xa391('0xb0')]['id']},'include':_0x367b8b})[_0xa391('0x2b')](handleEntityNotFound(_0x30c9fb,null))[_0xa391('0x2b')](function(_0x4260f5){if(_0x4260f5){var _0x4b0495=_0x4260f5[_0xa391('0xd6')]({'plain':!![]});fs[_0xa391('0xd7')](_0xe46d67);var _0x174d71={'channel':_0xa391('0xd8'),'account':_0x4b0495[_0xa391('0xd4')][_0xa391('0x2f')],'agent':_0x4b0495[_0xa391('0xd5')]?_0x4b0495[_0xa391('0xd5')][_0xa391('0x33')]:_0xa391('0xd9'),'createdAt':moment(_0x4b0495[_0xa391('0x7f')])[_0xa391('0xbe')](_0xa391('0xbf'))[_0xa391('0x9a')](),'closedAt':_0x4b0495[_0xa391('0x3c')]?moment(_0x4b0495[_0xa391('0xda')])[_0xa391('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4b0495[_0xa391('0xdb')],'visibility':_0x4b0495[_0xa391('0xdc')]?_0xa391('0xdd'):'Private','messages':_(_0x4b0495[_0xa391('0xd1')])[_0xa391('0x88')]({'secret':![]})['map'](function(_0xfb7777){if(_0xfb7777[_0xa391('0xd0')]){var _0x142cac=path[_0xa391('0xc7')](_0xbc5566,_0xfb7777[_0xa391('0xd0')][_0xa391('0xde')]);if(fs[_0xa391('0xdf')](_0x142cac)){fs[_0xa391('0xe0')](_0x142cac)['pipe'](fs[_0xa391('0xe1')](path['join'](_0xe46d67,_0xfb7777['Attachment'][_0xa391('0xde')])));}}return{'date':moment(_0xfb7777[_0xa391('0x7f')])[_0xa391('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xfb7777[_0xa391('0xd2')]===_0xa391('0xe2')?_0xfb7777[_0xa391('0x73')]?_0xfb7777[_0xa391('0x73')][_0xa391('0x33')]:_0xa391('0xe3'):_0xfb7777[_0xa391('0x6a')]['firstName']+(_0xfb7777[_0xa391('0x6a')][_0xa391('0xcf')]?'\x20'+_0xfb7777[_0xa391('0x6a')]['lastName']:''),'body':_0xfb7777[_0xa391('0xd0')]?_0xfb7777[_0xa391('0xd0')][_0xa391('0xde')]:_0xfb7777[_0xa391('0x77')],'direction':_0xfb7777[_0xa391('0xd2')]===_0xa391('0xe2')?'A':'C','secret':_0xfb7777['secret'],'read':_0xfb7777[_0xa391('0x84')],'attachment':_0xfb7777['Attachment']};})[_0xa391('0x66')]()};return ejs[_0xa391('0xe4')](path[_0xa391('0xc7')](config[_0xa391('0xc8')],_0xa391('0xc9'),_0xa391('0xe5'),_0xa391('0xe6')),{'interaction':_0x174d71})[_0xa391('0x2b')](function(_0xc4f662){var _0xe8574=path[_0xa391('0xc7')](_0xe46d67,_0xa391('0xe7')+_0x4b0495['id']+'-'+_0x2e31dc+_0xa391('0xe8'));var _0x24fc07={'path':_0xe8574,'channel':_0xa391('0xd8'),'interactionId':_0x4b0495['id']};return pdf[_0xa391('0xe9')](_0xc4f662,_0x24fc07);})[_0xa391('0x2b')](function(){return new BPromise(function(_0x591dd5,_0x6c9965){zipdir(_0xe46d67,{'saveTo':_0x23df16},function(_0x111bc4,_0x299350){if(_0x111bc4)return _0x6c9965(_0x111bc4);return _0x591dd5(_0x299350);});})[_0xa391('0x2b')](function(){return new BPromise(function(_0x302269,_0x54f4b4){rimraf(_0xe46d67,function(_0x3741f2){if(_0x3741f2)_0x54f4b4(_0x3741f2);return _0x302269();});});})[_0xa391('0x2b')](function(){return _0x30c9fb[_0xa391('0xea')](_0x23df16,_0x3fb62f,function(_0x1999be){if(_0x1999be){console[_0xa391('0xeb')]('err',_0x1999be);}else{fs['unlinkSync'](_0x23df16);}});});});}else{return _0x30c9fb['sendStatus'](0xc8);}})[_0xa391('0x38')](handleError(_0x30c9fb,null));}; \ No newline at end of file +var _0x444a=['replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','clone','i.id','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','show','params','include','create','describe','addMessage','OpenchannelMessage','omit','ids','findOne','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','out','System','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then','error','stack','name','Users','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','answered','UserId','closed','unmanaged','total','index','map','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','where','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter'];(function(_0xc64946,_0x229695){var _0x2f66e5=function(_0x3028d5){while(--_0x3028d5){_0xc64946['push'](_0xc64946['shift']());}};_0x2f66e5(++_0x229695);}(_0x444a,0x68));var _0xa444=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x444a[_0x9e0cb3];return _0x5926b7;};'use strict';var emlformat=require(_0xa444('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa444('0x1'));var jsonpatch=require(_0xa444('0x2'));var rp=require(_0xa444('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa444('0x4'));var util=require(_0xa444('0x5'));var path=require('path');var sox=require(_0xa444('0x6'));var csv=require(_0xa444('0x7'));var ejs=require(_0xa444('0x8'));var fs=require('fs');var fs_extra=require(_0xa444('0x9'));var _=require(_0xa444('0xa'));var squel=require(_0xa444('0xb'));var crypto=require(_0xa444('0xc'));var jsforce=require(_0xa444('0xd'));var deskjs=require(_0xa444('0xe'));var toCsv=require(_0xa444('0x7'));var querystring=require('querystring');var Papa=require(_0xa444('0xf'));var Redis=require('ioredis');var authService=require(_0xa444('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa444('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa444('0x12'));var licenseUtil=require(_0xa444('0x13'));var db=require(_0xa444('0x14'))['db'];config['redis']=_[_0xa444('0x15')](config[_0xa444('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa444('0x17'))(new Redis(config[_0xa444('0x16')]));require(_0xa444('0x18'))[_0xa444('0x19')](socket);function respondWithStatusCode(_0x3f5550,_0x538b0c){_0x538b0c=_0x538b0c||0xcc;return function(_0x438469){if(_0x438469){return _0x3f5550[_0xa444('0x1a')](_0x538b0c);}return _0x3f5550[_0xa444('0x1b')](_0x538b0c)[_0xa444('0x1c')]();};}function respondWithResult(_0x217154,_0x30cde4){_0x30cde4=_0x30cde4||0xc8;return function(_0x3b2b97){if(_0x3b2b97){return _0x217154[_0xa444('0x1b')](_0x30cde4)[_0xa444('0x1d')](_0x3b2b97);}};}function respondWithFilteredResult(_0x48a447,_0x19cb36){return function(_0x1b3cf6){if(_0x1b3cf6){var _0x42ae7b=typeof _0x19cb36[_0xa444('0x1e')]===_0xa444('0x1f')&&typeof _0x19cb36[_0xa444('0x20')]===_0xa444('0x1f');var _0x1a53bf=_0x1b3cf6[_0xa444('0x21')];var _0x5b47ab=_0x42ae7b?0x0:_0x19cb36[_0xa444('0x1e')];var _0x3a3125=_0x42ae7b?_0x1b3cf6['count']:_0x19cb36[_0xa444('0x1e')]+_0x19cb36[_0xa444('0x20')];var _0x2e35f3;if(_0x3a3125>=_0x1a53bf){_0x3a3125=_0x1a53bf;_0x2e35f3=0xc8;}else{_0x2e35f3=0xce;}_0x48a447[_0xa444('0x1b')](_0x2e35f3);return _0x48a447['set'](_0xa444('0x22'),_0x5b47ab+'-'+_0x3a3125+'/'+_0x1a53bf)['json'](_0x1b3cf6);}return null;};}function patchUpdates(_0x195b31){return function(_0x587a70){try{jsonpatch[_0xa444('0x23')](_0x587a70,_0x195b31,!![]);}catch(_0x11bd7a){return BPromise['reject'](_0x11bd7a);}return _0x587a70['save']();};}function saveUpdates(_0x4d1532,_0x3659d9){return function(_0x3a203e){if(_0x3a203e){return _0x3a203e[_0xa444('0x24')](_0x4d1532)['then'](function(_0x28fdab){return _0x28fdab;});}return null;};}function removeEntity(_0xe10a0e,_0x557894){return function(_0x5169fe){if(_0x5169fe){return _0x5169fe[_0xa444('0x25')]()[_0xa444('0x26')](function(){_0xe10a0e[_0xa444('0x1b')](0xcc)[_0xa444('0x1c')]();});}};}function handleEntityNotFound(_0x3b5f41,_0x5a1f34){return function(_0x2d7fe6){if(!_0x2d7fe6){_0x3b5f41[_0xa444('0x1a')](0x194);}return _0x2d7fe6;};}function handleError(_0x11b720,_0x5037e4){_0x5037e4=_0x5037e4||0x1f4;return function(_0x61f09f){logger[_0xa444('0x27')](_0x61f09f[_0xa444('0x28')]);if(_0x61f09f[_0xa444('0x29')]){delete _0x61f09f[_0xa444('0x29')];}_0x11b720['status'](_0x5037e4)['send'](_0x61f09f);};}function getInteractionUsers(_0x352075,_0x50d449){return new BPromise(function(_0x24f774,_0x5da8a5){try{if(_0x50d449[_0x352075['id']]){_0x352075[_0xa444('0x2a')]=_['map'](_0x50d449[_0x352075['id']],function(_0x51f559){return{'id':_0x51f559['id'],'fullname':_0x51f559[_0xa444('0x2b')]};});}}catch(_0x3bd605){_0x5da8a5(_0x3bd605);}_0x24f774(_0x352075);});}function getInteractionTags(_0x157635,_0x19d8de){return new BPromise(function(_0x451572,_0x44d64c){try{if(_0x157635[_0xa444('0x2c')]){_0x157635[_0xa444('0x2d')]=[];_0x157635[_0xa444('0x2c')]['split'](',')[_0xa444('0x2e')](function(_0x242fa4){_0x157635['Tags'][_0xa444('0x2f')](_0x19d8de[_0x242fa4]);});}delete _0x157635['TagIds'];}catch(_0x308adc){_0x44d64c(_0x308adc);}_0x451572(_0x157635);});}function updateOpenchannelInteraction(_0x2c6796,_0x1a988f,_0x3869b3){return new BPromise(function(_0x5552f5,_0x1ac6eb){return getInteractionUsers(_0x2c6796,_0x3869b3)[_0xa444('0x26')](function(_0x526c16){return getInteractionTags(_0x526c16,_0x1a988f);})[_0xa444('0x26')](function(_0x52ac9f){return getStateInteraction(_0x52ac9f);})[_0xa444('0x26')](function(_0xe55b57){_0x5552f5(_0xe55b57);})[_0xa444('0x30')](function(_0x32f1d4){_0x1ac6eb(_0x32f1d4);});});}function getStateInteraction(_0x1ba33c){return new BPromise(function(_0xe07025){_0x1ba33c[_0xa444('0x31')]=0x0;_0x1ba33c[_0xa444('0x32')]=0x0;_0x1ba33c[_0xa444('0x33')]=0x0;_0x1ba33c['unmanaged']=0x0;_0x1ba33c['total']=0x0;if(!_0x1ba33c['closed']&&!_0x1ba33c[_0xa444('0x34')]){_0x1ba33c[_0xa444('0x31')]+=0x1;}if(!_0x1ba33c[_0xa444('0x35')]&&_0x1ba33c[_0xa444('0x34')]){_0x1ba33c[_0xa444('0x32')]+=0x1;if(_0x1ba33c[_0xa444('0x31')]){_0x1ba33c['waiting']-=0x1;}}if(_0x1ba33c[_0xa444('0x35')]&&_0x1ba33c['UserId']){_0x1ba33c[_0xa444('0x33')]+=0x1;if(_0x1ba33c[_0xa444('0x32')]){_0x1ba33c[_0xa444('0x32')]-=0x1;}}if(_0x1ba33c[_0xa444('0x35')]&&!_0x1ba33c['UserId']){_0x1ba33c[_0xa444('0x36')]+=0x1;if(_0x1ba33c[_0xa444('0x31')]){_0x1ba33c[_0xa444('0x31')]-=0x1;}}_0x1ba33c[_0xa444('0x37')]+=0x1;_0xe07025(_0x1ba33c);});}exports[_0xa444('0x38')]=function(_0x3113b8,_0x47d7dd){var _0x4fb8b0={},_0x190f78={},_0x4bdf1e={'count':0x0,'rows':[]};var _0x1b8fa6=_[_0xa444('0x39')](db[_0xa444('0x3a')][_0xa444('0x3b')],function(_0x42be86){return{'name':_0x42be86['fieldName'],'type':_0x42be86[_0xa444('0x3c')][_0xa444('0x3d')]};});_0x190f78[_0xa444('0x3e')]=_['map'](_0x1b8fa6,_0xa444('0x29'));_0x190f78[_0xa444('0x3f')]=_[_0xa444('0x40')](_0x3113b8[_0xa444('0x3f')]);_0x190f78[_0xa444('0x41')]=_[_0xa444('0x42')](_0x190f78['model'],_0x190f78['query']);_0x4fb8b0[_0xa444('0x43')]=_[_0xa444('0x42')](_0x190f78[_0xa444('0x3e')],qs[_0xa444('0x44')](_0x3113b8[_0xa444('0x3f')][_0xa444('0x44')]));_0x4fb8b0[_0xa444('0x43')]=_0x4fb8b0[_0xa444('0x43')][_0xa444('0x45')]?_0x4fb8b0[_0xa444('0x43')]:_0x190f78[_0xa444('0x3e')];if(!_0x3113b8['query'][_0xa444('0x46')](_0xa444('0x47'))){_0x4fb8b0[_0xa444('0x20')]=qs[_0xa444('0x20')](_0x3113b8[_0xa444('0x3f')][_0xa444('0x20')]);_0x4fb8b0['offset']=qs[_0xa444('0x1e')](_0x3113b8[_0xa444('0x3f')]['offset']);}_0x4fb8b0[_0xa444('0x48')]=qs[_0xa444('0x49')](_0x3113b8[_0xa444('0x3f')][_0xa444('0x49')]);_0x4fb8b0['where']=qs[_0xa444('0x41')](_['pick'](_0x3113b8[_0xa444('0x3f')],_0x190f78[_0xa444('0x41')]),_0x1b8fa6);var _0x43cfbb=[];var _0x2bb5ec=squel[_0xa444('0x4a')]()[_0xa444('0x4b')]('id')[_0xa444('0x4b')](_0xa444('0x29'))[_0xa444('0x4b')](_0xa444('0x4c'))[_0xa444('0x4d')]('tools_tags');var _0x362c52=squel[_0xa444('0x4a')]()[_0xa444('0x4b')](_0xa444('0x4e'))['field'](_0xa444('0x4f'))[_0xa444('0x4b')](_0xa444('0x50'))[_0xa444('0x4d')]('user_has_openchannel_interactions','ui')[_0xa444('0x51')](_0xa444('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x53859e=squel[_0xa444('0x4a')]()[_0xa444('0x4d')](_0xa444('0x53'),'i')['left_join'](_0xa444('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa444('0x51')](_0xa444('0x52'),'o',_0xa444('0x55'))[_0xa444('0x51')](_0xa444('0x56'),'a',_0xa444('0x57'))[_0xa444('0x51')]('openchannel_messages','me',_0xa444('0x58'))['left_join']('openchannel_interaction_has_tags','it',_0xa444('0x59'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x923c16=squel[_0xa444('0x5a')]();var _0x4bdc4b=[];var _0x53ca97=squel[_0xa444('0x5a')]();var _0x9c2171;if(_0x3113b8[_0xa444('0x3f')]['search']){_0x9c2171=as[_0xa444('0x5b')](_0x3113b8[_0xa444('0x3f')][_0xa444('0x5c')]);var _0x12e5e9=_0x9c2171[_0xa444('0x5d')];for(var _0x4d3f38=0x0;_0x4d3f38<_0x9c2171[_0xa444('0x5e')][_0xa444('0x45')];_0x4d3f38++){var _0xe092b9=_0x9c2171[_0xa444('0x5e')][_0x4d3f38];var _0x409eb1='i';var _0x1d1008=_[_0xa444('0x5f')](_0x1b8fa6,[_0xa444('0x29'),_0xe092b9['field']]);if(!_0x1d1008){switch(_0xe092b9[_0xa444('0x4b')]){case _0xa444('0x60'):if(_0xe092b9[_0xa444('0x61')]==0x1){_0x53859e[_0xa444('0x62')]('`'+_0xe092b9[_0xa444('0x4b')]+_0xa444('0x63'));}else{_0x53859e[_0xa444('0x62')]('`'+_0xe092b9['field']+'`\x20>\x200');}break;case _0xa444('0x64'):if(_0xe092b9[_0xa444('0x65')]===_0xa444('0x66')){if(_0xe092b9[_0xa444('0x61')][_0xa444('0x67')]('\x20')['length']>0x1){_0x923c16[_0x12e5e9](_0xa444('0x68'),qs[_0xa444('0x69')](_0xe092b9['value']),null);}else{var _0x3dcc35='%'+_0xe092b9[_0xa444('0x61')]+'%';_0x923c16[_0x12e5e9](_0xa444('0x6a'),_0x3dcc35,_0x3dcc35,_0x3dcc35);}}else{_0x1d1008=_[_0xa444('0x5f')](_0x1b8fa6,[_0xa444('0x29'),_0xa444('0x6b')]);_0xe092b9[_0xa444('0x4b')]=_0xa444('0x6b');_0x277db4=as['buildExpression'](_0x409eb1,_0x1d1008[_0xa444('0x3c')],_0xe092b9);_0x923c16[_0x12e5e9](_0x277db4[_0xa444('0x6c')],_0x277db4[_0xa444('0x61')][_0xa444('0x6d')],_0x277db4['value']['end']);}break;case _0xa444('0x6e'):var _0x445eba=_0xe092b9[_0xa444('0x61')][_0xa444('0x67')](',')[_0xa444('0x39')](function(_0x49515){return Number(_0x49515);});_0x445eba[_0xa444('0x2e')](function(_0x5da1f4){_0x53ca97['or'](_0xa444('0x6f'),'%,'+_0x5da1f4+',%');});_0x4bdc4b=_[_0xa444('0x70')](_0x4bdc4b,_0x445eba);break;case _0xa444('0x71'):if(_0xe092b9[_0xa444('0x65')]===_0xa444('0x66')){_0x923c16[_0x12e5e9](_0xa444('0x72'),'%'+_0xe092b9[_0xa444('0x61')]+'%',null);}else{_0x1d1008=_[_0xa444('0x5f')](_0x1b8fa6,[_0xa444('0x29'),_0xa444('0x34')]);_0xe092b9['field']='UserId';_0x277db4=as['buildExpression'](_0x409eb1,_0x1d1008[_0xa444('0x3c')],_0xe092b9);_0x923c16[_0x12e5e9](_0x277db4[_0xa444('0x6c')],_0x277db4[_0xa444('0x61')][_0xa444('0x6d')],_0x277db4[_0xa444('0x61')][_0xa444('0x1c')]);}break;case _0xa444('0x73'):_0x277db4=as['buildExpression']('me',null,_0xe092b9);_0x923c16[_0x12e5e9](_0x277db4[_0xa444('0x6c')],_0x277db4[_0xa444('0x61')]['start'],_0x277db4[_0xa444('0x61')]['end']);break;}}else{var _0x277db4=as[_0xa444('0x74')](_0x409eb1,_0x1d1008[_0xa444('0x3c')],_0xe092b9);_0x923c16[_0x12e5e9](_0x277db4[_0xa444('0x6c')],_0x277db4[_0xa444('0x61')][_0xa444('0x6d')],_0x277db4[_0xa444('0x61')][_0xa444('0x1c')]);}}}else{var _0x3a06e1=_(_0x3113b8[_0xa444('0x3f')])['keys']()[_0xa444('0x39')](function(_0x3db1e0){return _[_0xa444('0x75')](_0x1b8fa6,[_0xa444('0x29'),_0x3db1e0])?_0x3db1e0:undefined;})[_0xa444('0x76')]()['value']();if(!_['isEmpty'](_0x3a06e1)){_0x3a06e1[_0xa444('0x2e')](function(_0x20830b){if(_0x20830b===_0xa444('0x77')){_0x53859e['where'](_0xa444('0x78'),[][_0xa444('0x79')](_0x3113b8[_0xa444('0x3f')][_0x20830b]));}else if(_0x20830b===_0xa444('0x7a')){var _0x3773d4=JSON[_0xa444('0x7b')](_0x3113b8[_0xa444('0x3f')][_0x20830b])[_0xa444('0x7c')];var _0x4ddffd=JSON[_0xa444('0x7b')](_0x3113b8[_0xa444('0x3f')][_0x20830b])[_0xa444('0x7d')];_0x53859e['where'](_0xa444('0x7e'),_0x3773d4,_0x4ddffd);}else{if(_0x3113b8[_0xa444('0x3f')][_0x20830b]==='null'){_0x53859e[_0xa444('0x7f')]('i.'+_0x20830b+_0xa444('0x80'));}else{_0x53859e[_0xa444('0x7f')]('i.'+_0x20830b+'\x20=\x20?',_0x3113b8[_0xa444('0x3f')][_0x20830b]);}}});}if(_0x3113b8['query'][_0xa444('0x81')]){if(_0x3113b8[_0xa444('0x3f')][_0xa444('0x81')]==0x1){_0x53859e[_0xa444('0x62')](_0xa444('0x82'));}else{_0x53859e[_0xa444('0x62')](_0xa444('0x83'));}}if(_0x3113b8['query']['tag']){_0x4bdc4b=_[_0xa444('0x84')](_0x3113b8[_0xa444('0x3f')][_0xa444('0x85')])?_0x3113b8[_0xa444('0x3f')][_0xa444('0x85')]:new Array(_0x3113b8[_0xa444('0x3f')]['tag']);_0x4bdc4b[_0xa444('0x2e')](function(_0x1c8e8d){_0x53ca97['or'](_0xa444('0x6f'),'%,'+_0x1c8e8d+',%');});}if(_0x3113b8[_0xa444('0x3f')]['filter']){var _0x4bb9d7=_0x3113b8[_0xa444('0x3f')][_0xa444('0x86')][_0xa444('0x87')]('\x5c','\x5c\x5c')[_0xa444('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4bb9d7)){_0x923c16['or']('i.id\x20LIKE\x20?',_0x4bb9d7+'%');}else{_0x923c16['or'](_0xa444('0x88'),qs[_0xa444('0x69')](_0x4bb9d7))['or'](_0xa444('0x89'),_0x4bb9d7+'%')['or'](_0xa444('0x8a'),_0x4bb9d7+'%');}}}_0x53859e[_0xa444('0x7f')](_0x923c16);_0x53859e[_0xa444('0x8b')]('i.id');var _0x23f839={'type':db[_0xa444('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1c397a=_0x53859e[_0xa444('0x8d')]();_0x1c397a[_0xa444('0x4b')](_0xa444('0x8e'));_0x1c397a[_0xa444('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4fb8b0[_0xa444('0x48')]){_0x4fb8b0[_0xa444('0x48')][_0xa444('0x2e')](function(_0x4b3c84){var _0x4253df=_0x4b3c84[0x0]===_0xa444('0x8f')?_0x4b3c84[0x0]:'i.'+_0x4b3c84[0x0];_0x53859e[_0xa444('0x48')](_0x4253df,_0x4b3c84[0x1]===_0xa444('0x90')?![]:!![]);});}if(!_[_0xa444('0x91')](_0x4bdc4b)){_0x53859e[_0xa444('0x62')](_0x53ca97);_0x1c397a[_0xa444('0x7f')](_0xa444('0x92'),_0x4bdc4b);}BPromise[_0xa444('0x93')]()[_0xa444('0x26')](function(){if(!_0x9c2171){if(_0x3113b8[_0xa444('0x3f')]['OpenchannelAccountId'])return;_0x1c397a[_0xa444('0x7f')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x53859e[_0xa444('0x7f')](_0xa444('0x94'));return;}if(_0x3113b8['user'][_0xa444('0x95')]!==_0xa444('0x96'))return;return _0x3113b8[_0xa444('0x97')][_0xa444('0x98')]({'attributes':['id'],'raw':!![]})[_0xa444('0x26')](function(_0x400251){if(_[_0xa444('0x91')](_0x400251)){_0x1c397a[_0xa444('0x7f')](_0xa444('0x99'));_0x53859e[_0xa444('0x7f')](_0xa444('0x99'));}else{_0x1c397a[_0xa444('0x7f')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x400251,'id'));_0x53859e[_0xa444('0x7f')](_0xa444('0x78'),_['map'](_0x400251,'id'));}});})[_0xa444('0x26')](function(){if(_0x3113b8[_0xa444('0x97')][_0xa444('0x95')]===_0xa444('0x96')&&!_0x9c2171&&!_0x3113b8[_0xa444('0x3f')][_0xa444('0x77')])return[];return db['sequelize'][_0xa444('0x3f')](_0x1c397a[_0xa444('0x9a')](),_0x23f839);})[_0xa444('0x26')](function(_0x454fdb){_0x4bdf1e[_0xa444('0x21')]=_0x454fdb[_0xa444('0x45')];if(_0x4bdf1e['count']===0x0)return[];return db[_0xa444('0x9b')][_0xa444('0x3f')](_0x2bb5ec[_0xa444('0x9a')](),_0x23f839)[_0xa444('0x26')](function(_0x5515f6){_0x43cfbb=_[_0xa444('0x9c')](_0x5515f6,'id');_0x23f839=_[_0xa444('0x9d')](_0x23f839,{'model':db[_0xa444('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3113b8[_0xa444('0x3f')][_0xa444('0x44')]){_0x4fb8b0[_0xa444('0x43')][_0xa444('0x2e')](function(_0x4f91fe){_0x53859e['field']('i.'+_0x4f91fe);});}else{_0x53859e[_0xa444('0x4b')](_0xa444('0x9e'),_0xa444('0x60'));_0x53859e[_0xa444('0x4b')](_0xa444('0x9f'),_0xa444('0xa0'));_0x53859e[_0xa444('0x4b')](_0xa444('0xa1'),'Account.mandatoryDisposition');_0x53859e[_0xa444('0x4b')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xa444('0x8f'));_0x53859e[_0xa444('0x4b')](_0xa444('0xa2'));_0x53859e[_0xa444('0x4b')](_0xa444('0xa3'),_0xa444('0xa4'));_0x53859e[_0xa444('0x4b')]('c.lastName',_0xa444('0xa5'));_0x53859e[_0xa444('0x4b')]('c.email',_0xa444('0xa6'));_0x53859e[_0xa444('0x4b')](_0xa444('0xa7'),'Contact.phone');_0x53859e[_0xa444('0x4b')](_0xa444('0xa8'),'Contact.mobile');_0x53859e[_0xa444('0x4b')]('c.fax',_0xa444('0xa9'));_0x53859e[_0xa444('0x4b')](_0xa444('0xaa'),_0xa444('0xab'));_0x53859e['field'](_0xa444('0xac'),_0xa444('0xad'));_0x53859e[_0xa444('0x4b')](_0xa444('0xae'),'TagIds');}if(_0x4fb8b0[_0xa444('0x20')])_0x53859e[_0xa444('0x20')](_0x4fb8b0[_0xa444('0x20')]);if(_0x4fb8b0[_0xa444('0x1e')])_0x53859e[_0xa444('0x1e')](_0x4fb8b0[_0xa444('0x1e')]);return db[_0xa444('0x9b')][_0xa444('0x3f')](_0x53859e[_0xa444('0x9a')](),_0x23f839);})[_0xa444('0x26')](function(_0x4c3b7a){if(_0x4c3b7a[_0xa444('0x45')]>0x0)_0x362c52[_0xa444('0x7f')](_0xa444('0xaf'),_[_0xa444('0x39')](_0x4c3b7a,'id'));return db[_0xa444('0x9b')][_0xa444('0x3f')](_0x362c52['toString'](),_0x23f839)[_0xa444('0x26')](function(_0xca5440){var _0x3e4b26=_[_0xa444('0xb0')](_0xca5440,'OpenchannelInteractionId');var _0x49ad78=[];_0x4c3b7a['forEach'](function(_0x52cfe2){_0x49ad78['push'](updateOpenchannelInteraction(_0x52cfe2,_0x43cfbb,_0x3e4b26));});return BPromise['all'](_0x49ad78);});});})[_0xa444('0x26')](function(_0x34fe7e){_0x4bdf1e[_0xa444('0xb1')]=_0x34fe7e;return _0x4bdf1e;})['then'](respondWithFilteredResult(_0x47d7dd,_0x4fb8b0))['catch'](handleError(_0x47d7dd,null));};exports[_0xa444('0xb2')]=function(_0x1aace4,_0x37687b){var _0x3f8509={};if(_0x1aace4[_0xa444('0x3f')]['type']&&_0x1aace4[_0xa444('0x3f')][_0xa444('0x3c')]===_0xa444('0x4d')){_0x3f8509[_0xa444('0x4d')]=_0x1aace4['params']['id'];}else{_0x3f8509['id']=_0x1aace4[_0xa444('0xb3')]['id'];}var _0x4a7d32={'raw':![],'where':_0x3f8509},_0x268267={};_0x268267['model']=_[_0xa444('0x40')](db[_0xa444('0x3a')][_0xa444('0x3b')]);_0x268267[_0xa444('0x3f')]=_['keys'](_0x1aace4[_0xa444('0x3f')]);_0x268267[_0xa444('0x41')]=_[_0xa444('0x42')](_0x268267['model'],_0x268267[_0xa444('0x3f')]);_0x4a7d32['attributes']=_['intersection'](_0x268267[_0xa444('0x3e')],qs[_0xa444('0x44')](_0x1aace4[_0xa444('0x3f')]['fields']));_0x4a7d32[_0xa444('0x43')]=_0x4a7d32[_0xa444('0x43')][_0xa444('0x45')]?_0x4a7d32[_0xa444('0x43')]:_0x268267['model'];if(_0x1aace4[_0xa444('0x3f')]['includeAll']){_0x4a7d32[_0xa444('0xb4')]=[{'all':!![]}];}_0x4a7d32=_[_0xa444('0x9d')]({},_0x4a7d32,_0x1aace4['options']);return db[_0xa444('0x3a')][_0xa444('0x5f')](_0x4a7d32)[_0xa444('0x26')](handleEntityNotFound(_0x37687b,null))[_0xa444('0x26')](respondWithResult(_0x37687b,null))[_0xa444('0x30')](handleError(_0x37687b,null));};exports[_0xa444('0xb5')]=function(_0x163e12,_0x4f0f72){return db[_0xa444('0x3a')][_0xa444('0xb5')](_0x163e12[_0xa444('0x73')],{})[_0xa444('0x26')](respondWithResult(_0x4f0f72,0xc9))[_0xa444('0x30')](handleError(_0x4f0f72,null));};exports[_0xa444('0x24')]=function(_0x4a4423,_0x298ddf){if(_0x4a4423[_0xa444('0x73')]['id']){delete _0x4a4423[_0xa444('0x73')]['id'];}return db[_0xa444('0x3a')]['find']({'where':{'id':_0x4a4423[_0xa444('0xb3')]['id']}})['then'](handleEntityNotFound(_0x298ddf,null))['then'](saveUpdates(_0x4a4423['body'],null))[_0xa444('0x26')](respondWithResult(_0x298ddf,null))[_0xa444('0x30')](handleError(_0x298ddf,null));};exports[_0xa444('0x25')]=function(_0x30c066,_0x4c58b0){return db[_0xa444('0x3a')]['find']({'where':{'id':_0x30c066['params']['id']}})['then'](handleEntityNotFound(_0x4c58b0,null))[_0xa444('0x26')](removeEntity(_0x4c58b0,null))[_0xa444('0x30')](handleError(_0x4c58b0,null));};exports[_0xa444('0xb6')]=function(_0x5527fe,_0x521652){return db[_0xa444('0x3a')][_0xa444('0xb6')]()[_0xa444('0x26')](respondWithResult(_0x521652,null))[_0xa444('0x30')](handleError(_0x521652,null));};exports[_0xa444('0xb7')]=function(_0x2027c5,_0xcf6528,_0x303b34){return db[_0xa444('0xb8')]['find']({'where':{'id':_0x2027c5[_0xa444('0xb3')]['id']}})[_0xa444('0x26')](handleEntityNotFound(_0xcf6528,null))[_0xa444('0x26')](function(_0x46e510){if(_0x46e510){return _0x46e510[_0xa444('0xb7')](_0x2027c5[_0xa444('0x73')]['ids'],_[_0xa444('0xb9')](_0x2027c5[_0xa444('0x73')],[_0xa444('0xba'),'id'])||{});}})[_0xa444('0x26')](respondWithResult(_0xcf6528,null))[_0xa444('0x30')](handleError(_0xcf6528,null));};exports['getMessages']=function(_0x19c991,_0x621cbb,_0x342f4b){var _0x5c66fb={'raw':![],'where':{}};var _0x188440={};var _0x340002={'count':0x0,'rows':[]};return db[_0xa444('0x3a')][_0xa444('0xbb')]({'where':{'id':_0x19c991['params']['id']}})[_0xa444('0x26')](handleEntityNotFound(_0x621cbb,null))[_0xa444('0x26')](function(_0x3538f5){if(_0x3538f5){_0x188440[_0xa444('0x3e')]=_[_0xa444('0x40')](db[_0xa444('0xb8')][_0xa444('0x3b')]);_0x188440[_0xa444('0x3f')]=_[_0xa444('0x40')](_0x19c991[_0xa444('0x3f')]);_0x188440[_0xa444('0x41')]=_['intersection'](_0x188440['model'],_0x188440['query']);_0x5c66fb[_0xa444('0x43')]=_[_0xa444('0x42')](_0x188440[_0xa444('0x3e')],qs[_0xa444('0x44')](_0x19c991['query']['fields']));_0x5c66fb[_0xa444('0x43')]=_0x5c66fb[_0xa444('0x43')][_0xa444('0x45')]?_0x5c66fb['attributes']:_0x188440[_0xa444('0x3e')];if(!_0x19c991[_0xa444('0x3f')]['hasOwnProperty'](_0xa444('0x47'))){_0x5c66fb[_0xa444('0x20')]=qs['limit'](_0x19c991[_0xa444('0x3f')][_0xa444('0x20')]);_0x5c66fb['offset']=qs[_0xa444('0x1e')](_0x19c991[_0xa444('0x3f')][_0xa444('0x1e')]);}_0x5c66fb[_0xa444('0x48')]=qs[_0xa444('0x49')](_0x19c991[_0xa444('0x3f')]['sort']);_0x5c66fb['where']=qs[_0xa444('0x41')](_['pick'](_0x19c991[_0xa444('0x3f')],_0x188440['filters']));_0x5c66fb['where'][_0xa444('0xbc')]=_0x3538f5['id'];if(_0x19c991[_0xa444('0x3f')][_0xa444('0x86')]){_0x5c66fb['where']=_['merge'](_0x5c66fb['where'],{'$or':_[_0xa444('0x39')](_0x5c66fb[_0xa444('0x43')],function(_0x38b56b){var _0x568c00={};_0x568c00[_0x38b56b]={'$like':'%'+_0x19c991[_0xa444('0x3f')][_0xa444('0x86')]+'%'};return _0x568c00;})});}if(_0x19c991['query']['$gte']){var _0x31120a=_0x19c991[_0xa444('0x3f')][_0xa444('0x7c')][_0xa444('0x67')](',');var _0x40b674={};_0x40b674[_0x31120a[0x0]]={'$gte':moment(_0x31120a[0x1])[_0xa444('0xbd')](_0xa444('0xbe'))};_0x5c66fb[_0xa444('0x7f')]=_[_0xa444('0x9d')](_0x5c66fb[_0xa444('0x7f')],_0x40b674);}_0x5c66fb=_['merge']({},_0x5c66fb,_0x19c991[_0xa444('0xbf')]);return db[_0xa444('0xb8')]['count']({'where':_0x5c66fb[_0xa444('0x7f')]})[_0xa444('0x26')](function(_0x2389ee){_0x340002['count']=_0x2389ee;if(_0x19c991[_0xa444('0x3f')][_0xa444('0xc0')]){_0x5c66fb[_0xa444('0xb4')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa444('0xc1')](_0x5c66fb);})[_0xa444('0x26')](function(_0x2b2817){_0x340002['rows']=_0x2b2817;return _0x340002;});}})[_0xa444('0x26')](respondWithFilteredResult(_0x621cbb,_0x5c66fb))['catch'](handleError(_0x621cbb,null));};exports[_0xa444('0xc2')]=function(_0x4d1e84,_0xcafec9,_0xc944f1){return db[_0xa444('0x3a')][_0xa444('0x5f')]({'where':{'id':_0x4d1e84[_0xa444('0xb3')]['id']}})[_0xa444('0x26')](handleEntityNotFound(_0xcafec9,null))[_0xa444('0x26')](function(_0x5d381f){if(_0x5d381f){return _0x5d381f['setTags'](_0x4d1e84[_0xa444('0x73')][_0xa444('0xba')],_[_0xa444('0xb9')](_0x4d1e84[_0xa444('0x73')],[_0xa444('0xba'),'id'])||{})[_0xa444('0xc3')](function(){return db[_0xa444('0x6e')][_0xa444('0xc1')]({'attributes':['id',_0xa444('0x29'),_0xa444('0x4c')],'where':{'id':_0x4d1e84[_0xa444('0x73')][_0xa444('0xba')]}});})[_0xa444('0x26')](function(_0x410b07){socket[_0xa444('0xc4')](_0xa444('0xc5'),{'id':Number(_0x4d1e84[_0xa444('0xb3')]['id']),'tags':_0x410b07||[]});return{'id':Number(_0x4d1e84[_0xa444('0xb3')]['id']),'tags':_0x410b07||[]};});}})[_0xa444('0x26')](respondWithResult(_0xcafec9,null))[_0xa444('0x30')](handleError(_0xcafec9,null));};exports[_0xa444('0xc6')]=function(_0x2ff9b6,_0x5e17dc,_0xe4f5f1){return db[_0xa444('0x3a')][_0xa444('0x5f')]({'where':{'id':_0x2ff9b6[_0xa444('0xb3')]['id']}})[_0xa444('0x26')](handleEntityNotFound(_0x5e17dc,null))[_0xa444('0x26')](function(_0x7e8287){if(_0x7e8287){return _0x7e8287[_0xa444('0xc6')](_0x2ff9b6[_0xa444('0x3f')][_0xa444('0xba')]);}})[_0xa444('0x26')](respondWithStatusCode(_0x5e17dc,null))[_0xa444('0x30')](handleError(_0x5e17dc,null));};exports[_0xa444('0xc7')]=function(_0x398f47,_0x5b32f6){var _0x839730=moment()[_0xa444('0xc8')]()[_0xa444('0x9a')]();var _0x4a79de=path[_0xa444('0xc9')](config[_0xa444('0xca')],'server',_0xa444('0xcb'),_0xa444('0xcc'));var _0x311730=path[_0xa444('0xc9')](config['root'],_0xa444('0xcd'),_0xa444('0xcb'),'attachments');var _0x540c33=path[_0xa444('0xc9')](_0x4a79de,_0x839730);var _0x3f8930=util[_0xa444('0xbd')](_0xa444('0xce'),_0x398f47[_0xa444('0xb3')]['id'],_0x839730);var _0x1924ca=path['join'](_0x4a79de,_0x3f8930);var _0x2ec82c=[];_0x2ec82c['push']({'model':db[_0xa444('0x71')],'as':'User','attributes':['id',_0xa444('0x2b')],'raw':!![]});_0x2ec82c[_0xa444('0x2f')]({'model':db[_0xa444('0xcf')],'as':_0xa444('0x64'),'attributes':['id',_0xa444('0xd0'),_0xa444('0xd1')],'raw':!![]});if(_0x398f47[_0xa444('0x3f')][_0xa444('0xd2')]){_0x2ec82c[_0xa444('0x2f')]({'model':db[_0xa444('0xd3')],'as':'Attachment','raw':!![]});}var _0x3e1b79=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xa444('0x73'),'createdAt',_0xa444('0xd4'),_0xa444('0xd5'),_0xa444('0x81')],'include':_0x2ec82c}];_0x3e1b79[_0xa444('0x2f')]({'model':db[_0xa444('0xd6')],'as':_0xa444('0xd7'),'attributes':['id',_0xa444('0x29')]});_0x3e1b79[_0xa444('0x2f')]({'model':db[_0xa444('0x71')],'as':_0xa444('0xd8'),'attributes':['id','fullname']});return db[_0xa444('0x3a')]['find']({'where':{'id':_0x398f47[_0xa444('0xb3')]['id']},'include':_0x3e1b79})[_0xa444('0x26')](handleEntityNotFound(_0x5b32f6,null))[_0xa444('0x26')](function(_0x5d93ac){if(_0x5d93ac){var _0x5cf912=_0x5d93ac[_0xa444('0xd9')]({'plain':!![]});fs[_0xa444('0xda')](_0x540c33);var _0x1ed31f={'channel':_0xa444('0xdb'),'account':_0x5cf912[_0xa444('0xd7')][_0xa444('0x29')],'agent':_0x5cf912[_0xa444('0xd8')]?_0x5cf912[_0xa444('0xd8')]['fullname']:_0xa444('0xdc'),'createdAt':moment(_0x5cf912[_0xa444('0x7a')])[_0xa444('0xbd')](_0xa444('0xbe'))[_0xa444('0x9a')](),'closedAt':_0x5cf912[_0xa444('0x35')]?moment(_0x5cf912[_0xa444('0xdd')])[_0xa444('0xbd')](_0xa444('0xbe'))[_0xa444('0x9a')]():'','disposition':_0x5cf912[_0xa444('0xde')],'visibility':_0x5cf912[_0xa444('0xdf')]?_0xa444('0xe0'):_0xa444('0xe1'),'messages':_(_0x5cf912[_0xa444('0xe2')])[_0xa444('0x86')]({'secret':![]})[_0xa444('0x39')](function(_0x1b9979){if(_0x1b9979[_0xa444('0xd3')]){var _0x3e7a65=path['join'](_0x311730,_0x1b9979['Attachment'][_0xa444('0xe3')]);if(fs[_0xa444('0xe4')](_0x3e7a65)){fs[_0xa444('0xe5')](_0x3e7a65)[_0xa444('0xe6')](fs['createWriteStream'](path[_0xa444('0xc9')](_0x540c33,_0x1b9979['Attachment']['basename'])));}}return{'date':moment(_0x1b9979[_0xa444('0x7a')])[_0xa444('0xbd')](_0xa444('0xbe'))[_0xa444('0x9a')](),'sender':_0x1b9979[_0xa444('0xd4')]===_0xa444('0xe7')?_0x1b9979[_0xa444('0x71')]?_0x1b9979['User']['fullname']:_0xa444('0xe8'):_0x1b9979['Contact']['firstName']+(_0x1b9979['Contact'][_0xa444('0xd1')]?'\x20'+_0x1b9979[_0xa444('0x64')][_0xa444('0xd1')]:''),'body':_0x1b9979[_0xa444('0xd3')]?_0x1b9979['Attachment'][_0xa444('0xe3')]:_0x1b9979[_0xa444('0x73')],'direction':_0x1b9979[_0xa444('0xd4')]==='out'?'A':'C','secret':_0x1b9979[_0xa444('0xd5')],'read':_0x1b9979[_0xa444('0x81')],'attachment':_0x1b9979[_0xa444('0xd3')]};})[_0xa444('0x61')]()};return ejs['renderFile'](path[_0xa444('0xc9')](config[_0xa444('0xca')],_0xa444('0xcd'),_0xa444('0xe9'),_0xa444('0xea')),{'interaction':_0x1ed31f})[_0xa444('0x26')](function(_0x346753){var _0x37ffa=path[_0xa444('0xc9')](_0x540c33,_0xa444('0xeb')+_0x5cf912['id']+'-'+_0x839730+'.pdf');var _0x3d7753={'path':_0x37ffa,'channel':_0xa444('0xdb'),'interactionId':_0x5cf912['id']};return pdf[_0xa444('0xec')](_0x346753,_0x3d7753);})[_0xa444('0x26')](function(){return new BPromise(function(_0x15e959,_0x4c0a21){zipdir(_0x540c33,{'saveTo':_0x1924ca},function(_0x2e9a40,_0x3097ee){if(_0x2e9a40)return _0x4c0a21(_0x2e9a40);return _0x15e959(_0x3097ee);});})[_0xa444('0x26')](function(){return new BPromise(function(_0x243351,_0x51fdce){rimraf(_0x540c33,function(_0x59237f){if(_0x59237f)_0x51fdce(_0x59237f);return _0x243351();});});})[_0xa444('0x26')](function(){return _0x5b32f6[_0xa444('0xc7')](_0x1924ca,_0x3f8930,function(_0x298624){if(_0x298624){console['log'](_0xa444('0xed'),_0x298624);}else{fs[_0xa444('0xee')](_0x1924ca);}});});});}else{return _0x5b32f6[_0xa444('0x1a')](0xc8);}})[_0xa444('0x30')](handleError(_0x5b32f6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c420378..24d0744 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf23e=['update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0xf23e,0x72));var _0xef23=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xf23e[_0x231e16];return _0x570a7c;};'use strict';var EventEmitter=require(_0xef23('0x0'));var OpenchannelInteraction=require(_0xef23('0x1'))['db'][_0xef23('0x2')];var OpenchannelMessage=require(_0xef23('0x1'))['db'][_0xef23('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xef23('0x4')](0x0);var events={'afterCreate':_0xef23('0x5'),'afterUpdate':_0xef23('0x6'),'afterDestroy':'remove'};function emitEvent(_0x372339){return function(_0x1fe264,_0x4adb90,_0x10a256){_0x1fe264[_0xef23('0x7')]({'attributes':['id'],'raw':!![]})[_0xef23('0x8')](function(_0x37a92f){_0x1fe264[_0xef23('0x9')](_0xef23('0xa'),_0x37a92f[_0xef23('0xb')](function(_0x5d1022){return{'id':_0x5d1022['id']};}));return OpenchannelMessage[_0xef23('0xc')]({'where':{'OpenchannelInteractionId':_0x1fe264['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef23('0x8')](function(_0x118698){_0x1fe264[_0xef23('0x9')](_0xef23('0xd'),_0x118698[_0xef23('0xe')]);OpenchannelInteractionEvents[_0xef23('0xf')](_0x372339+':'+_0x1fe264['id'],_0x1fe264);OpenchannelInteractionEvents['emit'](_0x372339,_0x1fe264);_0x10a256(null);})[_0xef23('0x10')](_0x10a256(null));};}for(var e in events){if(events[_0xef23('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xef23('0x12')](e,emitEvent(event));}}module[_0xef23('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbca4=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','catch'];(function(_0x4c9581,_0x22f783){var _0x52f6fd=function(_0x2542c0){while(--_0x2542c0){_0x4c9581['push'](_0x4c9581['shift']());}};_0x52f6fd(++_0x22f783);}(_0xbca4,0x158));var _0x4bca=function(_0x4a05b4,_0x54508c){_0x4a05b4=_0x4a05b4-0x0;var _0x303231=_0xbca4[_0x4a05b4];return _0x303231;};'use strict';var EventEmitter=require(_0x4bca('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x4bca('0x1'))['db'][_0x4bca('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4bca('0x3')](0x0);var events={'afterCreate':_0x4bca('0x4'),'afterUpdate':_0x4bca('0x5'),'afterDestroy':_0x4bca('0x6')};function emitEvent(_0x355c43){return function(_0x37bd44,_0x2e684d,_0x2a1fd3){_0x37bd44[_0x4bca('0x7')]({'attributes':['id'],'raw':!![]})[_0x4bca('0x8')](function(_0x7d5042){_0x37bd44['setDataValue'](_0x4bca('0x9'),_0x7d5042[_0x4bca('0xa')](function(_0x41474b){return{'id':_0x41474b['id']};}));return OpenchannelMessage[_0x4bca('0xb')]({'where':{'OpenchannelInteractionId':_0x37bd44['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4bca('0x8')](function(_0x3c7959){_0x37bd44['setDataValue'](_0x4bca('0xc'),_0x3c7959[_0x4bca('0xd')]);OpenchannelInteractionEvents[_0x4bca('0xe')](_0x355c43+':'+_0x37bd44['id'],_0x37bd44);OpenchannelInteractionEvents[_0x4bca('0xe')](_0x355c43,_0x37bd44);_0x2a1fd3(null);})[_0x4bca('0xf')](_0x2a1fd3(null));};}for(var e in events){if(events[_0x4bca('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x4bca('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5fff2ee..e4a1150 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cae=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','changed','closed'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x5cae,0xb1));var _0xe5ca=function(_0x2bd007,_0x281ba0){_0x2bd007=_0x2bd007-0x0;var _0x53c252=_0x5cae[_0x2bd007];return _0x53c252;};'use strict';var _=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var logger=require(_0xe5ca('0x2'))('api');var moment=require(_0xe5ca('0x3'));var BPromise=require(_0xe5ca('0x4'));var rp=require(_0xe5ca('0x5'));var fs=require('fs');var path=require(_0xe5ca('0x6'));var rimraf=require(_0xe5ca('0x7'));var config=require(_0xe5ca('0x8'));var attributes=require(_0xe5ca('0x9'));module[_0xe5ca('0xa')]=function(_0x313197,_0x5260f5){return _0x313197['define'](_0xe5ca('0xb'),attributes,{'tableName':_0xe5ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x59ed30,_0x3008bb,_0x2b0660){if(_0x59ed30[_0xe5ca('0xd')](_0xe5ca('0xe'))){_0x59ed30['closedAt']=moment()['format'](_0xe5ca('0xf'));}_0x2b0660(null,_0x59ed30);}}});}; \ No newline at end of file +var _0x4e0a=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x3238a7,_0x51ff1b){var _0x504fd3=function(_0x49c24b){while(--_0x49c24b){_0x3238a7['push'](_0x3238a7['shift']());}};_0x504fd3(++_0x51ff1b);}(_0x4e0a,0x1d5));var _0xa4e0=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0x4e0a[_0x5decec];return _0x35e1b4;};'use strict';var _=require(_0xa4e0('0x0'));var util=require('util');var logger=require(_0xa4e0('0x1'))(_0xa4e0('0x2'));var moment=require('moment');var BPromise=require(_0xa4e0('0x3'));var rp=require(_0xa4e0('0x4'));var fs=require('fs');var path=require(_0xa4e0('0x5'));var rimraf=require(_0xa4e0('0x6'));var config=require(_0xa4e0('0x7'));var attributes=require(_0xa4e0('0x8'));module[_0xa4e0('0x9')]=function(_0x324d62,_0x9f5e50){return _0x324d62[_0xa4e0('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0xa4e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4e0('0xc'),'collate':_0xa4e0('0xd'),'hooks':{'beforeUpdate':function(_0x2ffb72,_0x1b1a83,_0x2f917){if(_0x2ffb72[_0xa4e0('0xe')]('closed')){_0x2ffb72['closedAt']=moment()['format'](_0xa4e0('0xf'));}_0x2f917(null,_0x2ffb72);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 124eb07..95c587f 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d7b=['client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xc12adf,_0x155b20){var _0x59c398=function(_0x1773ab){while(--_0x1773ab){_0xc12adf['push'](_0xc12adf['shift']());}};_0x59c398(++_0x155b20);}(_0x8d7b,0xe3));var _0xb8d7=function(_0x5be0a1,_0x49ee54){_0x5be0a1=_0x5be0a1-0x0;var _0x1e3f13=_0x8d7b[_0x5be0a1];return _0x1e3f13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb8d7('0x0'));var BPromise=require(_0xb8d7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8d7('0x2'))['db'];var utils=require(_0xb8d7('0x3'));var logger=require(_0xb8d7('0x4'))('rpc');var config=require(_0xb8d7('0x5'));var jayson=require(_0xb8d7('0x6'));var client=jayson[_0xb8d7('0x7')]['http']({'port':0x232a});config[_0xb8d7('0x8')]=_[_0xb8d7('0x9')](config[_0xb8d7('0x8')],{'host':_0xb8d7('0xa'),'port':0x18eb});var socket=require(_0xb8d7('0xb'))(new Redis(config['redis']));require(_0xb8d7('0xc'))[_0xb8d7('0xd')](socket);function respondWithRpcPromise(_0x130c08,_0xd7ca81,_0x2d6ca0){return new BPromise(function(_0x36dc09,_0x26497d){return client[_0xb8d7('0xe')](_0x130c08,_0x2d6ca0)[_0xb8d7('0xf')](function(_0x3e6e57){logger[_0xb8d7('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd7ca81,_0xb8d7('0x11'));logger[_0xb8d7('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xd7ca81,_0xb8d7('0x11'),JSON[_0xb8d7('0x13')](_0x3e6e57));if(_0x3e6e57['error']){if(_0x3e6e57[_0xb8d7('0x14')][_0xb8d7('0x15')]===0x1f4){logger[_0xb8d7('0x14')](_0xb8d7('0x16'),_0xd7ca81,_0x3e6e57[_0xb8d7('0x14')]['message']);return _0x26497d(_0x3e6e57[_0xb8d7('0x14')][_0xb8d7('0x17')]);}logger[_0xb8d7('0x14')](_0xb8d7('0x16'),_0xd7ca81,_0x3e6e57['error']['message']);return _0x36dc09(_0x3e6e57[_0xb8d7('0x14')][_0xb8d7('0x17')]);}else{logger[_0xb8d7('0x10')](_0xb8d7('0x16'),_0xd7ca81,_0xb8d7('0x11'));_0x36dc09(_0x3e6e57[_0xb8d7('0x18')][_0xb8d7('0x17')]);}})[_0xb8d7('0x19')](function(_0xf625de){logger[_0xb8d7('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd7ca81,_0xf625de);_0x26497d(_0xf625de);});});}exports[_0xb8d7('0x1a')]=function(_0x30e28b){var _0x4b472e=this;return new Promise(function(_0x1429bf,_0x104ca2){return db[_0xb8d7('0x1b')][_0xb8d7('0x1c')](_0x30e28b[_0xb8d7('0x1d')],{'raw':_0x30e28b['options']?_0x30e28b[_0xb8d7('0x1e')][_0xb8d7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30e28b['options']?_0x30e28b[_0xb8d7('0x1e')][_0xb8d7('0x20')]||null:null,'attributes':_0x30e28b['options']?_0x30e28b['options']['attributes']||null:null,'limit':_0x30e28b['options']?_0x30e28b[_0xb8d7('0x1e')][_0xb8d7('0x21')]||null:null})['then'](function(_0x2b8b0e){logger[_0xb8d7('0x10')](_0xb8d7('0x1a'),_0x30e28b);logger['debug'](_0xb8d7('0x1a'),_0x30e28b,JSON[_0xb8d7('0x13')](_0x2b8b0e));_0x1429bf(_0x2b8b0e);})[_0xb8d7('0x19')](function(_0x46a6cb){logger[_0xb8d7('0x14')](_0xb8d7('0x1a'),_0x46a6cb[_0xb8d7('0x17')],_0x30e28b);_0x104ca2(_0x4b472e['error'](0x1f4,_0x46a6cb[_0xb8d7('0x17')]));});});};exports[_0xb8d7('0x22')]=function(_0x1eea7e){return new Promise(function(_0x3646c2,_0x2e0f57){return db[_0xb8d7('0x1b')]['find']({'where':_0x1eea7e[_0xb8d7('0x1e')]?_0x1eea7e[_0xb8d7('0x1e')][_0xb8d7('0x20')]||null:null})[_0xb8d7('0xf')](function(_0x470b7f){if(_0x470b7f){return _0x470b7f[_0xb8d7('0x23')](_0x1eea7e['body'][_0xb8d7('0x24')],_['omit'](_0x1eea7e[_0xb8d7('0x1d')],[_0xb8d7('0x24'),'id'])||{});}})[_0xb8d7('0x25')](function(_0x12b44e){logger[_0xb8d7('0x10')](_0xb8d7('0x26'),_0x1eea7e);logger[_0xb8d7('0x12')](_0xb8d7('0x26'),_0x1eea7e,JSON['stringify'](_0x12b44e));_0x3646c2(_0x12b44e);})[_0xb8d7('0x19')](function(_0x4de7df){logger[_0xb8d7('0x14')](_0xb8d7('0x26'),_0x4de7df['message'],_0x1eea7e);_0x2e0f57(_this['error'](0x1f4,_0x4de7df[_0xb8d7('0x17')]));});});}; \ No newline at end of file +var _0x668c=['code','message','OpenchannelInteraction,\x20%s,\x20%s','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','raw','options','where','limit','find','addTags','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x668c,0x195));var _0xc668=function(_0x4f750b,_0x4e3e43){_0x4f750b=_0x4f750b-0x0;var _0x918b39=_0x668c[_0x4f750b];return _0x918b39;};'use strict';var _=require(_0xc668('0x0'));var util=require(_0xc668('0x1'));var moment=require(_0xc668('0x2'));var BPromise=require(_0xc668('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc668('0x4'));var db=require(_0xc668('0x5'))['db'];var utils=require(_0xc668('0x6'));var logger=require('../../config/logger')(_0xc668('0x7'));var config=require(_0xc668('0x8'));var jayson=require(_0xc668('0x9'));var client=jayson[_0xc668('0xa')][_0xc668('0xb')]({'port':0x232a});config[_0xc668('0xc')]=_[_0xc668('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc668('0xe'))(new Redis(config[_0xc668('0xc')]));require(_0xc668('0xf'))[_0xc668('0x10')](socket);function respondWithRpcPromise(_0x78aa95,_0x2a2478,_0x48538d){return new BPromise(function(_0x36c258,_0x39303e){return client[_0xc668('0x11')](_0x78aa95,_0x48538d)[_0xc668('0x12')](function(_0x57b25c){logger[_0xc668('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2a2478,_0xc668('0x14'));logger[_0xc668('0x15')](_0xc668('0x16'),_0x2a2478,_0xc668('0x14'),JSON[_0xc668('0x17')](_0x57b25c));if(_0x57b25c[_0xc668('0x18')]){if(_0x57b25c[_0xc668('0x18')][_0xc668('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2a2478,_0x57b25c[_0xc668('0x18')][_0xc668('0x1a')]);return _0x39303e(_0x57b25c[_0xc668('0x18')]['message']);}logger[_0xc668('0x18')](_0xc668('0x1b'),_0x2a2478,_0x57b25c[_0xc668('0x18')][_0xc668('0x1a')]);return _0x36c258(_0x57b25c[_0xc668('0x18')][_0xc668('0x1a')]);}else{logger[_0xc668('0x13')](_0xc668('0x1b'),_0x2a2478,_0xc668('0x14'));_0x36c258(_0x57b25c['result'][_0xc668('0x1a')]);}})[_0xc668('0x1c')](function(_0x5f2f86){logger[_0xc668('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2a2478,_0x5f2f86);_0x39303e(_0x5f2f86);});});}exports[_0xc668('0x1d')]=function(_0x2eec9c){var _0x5732b1=this;return new Promise(function(_0x19a5df,_0x511f4a){return db[_0xc668('0x1e')][_0xc668('0x1f')](_0x2eec9c['body'],{'raw':_0x2eec9c['options']?_0x2eec9c['options'][_0xc668('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eec9c[_0xc668('0x21')]?_0x2eec9c[_0xc668('0x21')][_0xc668('0x22')]||null:null,'attributes':_0x2eec9c[_0xc668('0x21')]?_0x2eec9c[_0xc668('0x21')]['attributes']||null:null,'limit':_0x2eec9c['options']?_0x2eec9c[_0xc668('0x21')][_0xc668('0x23')]||null:null})[_0xc668('0x12')](function(_0xce1776){logger[_0xc668('0x13')](_0xc668('0x1d'),_0x2eec9c);logger[_0xc668('0x15')](_0xc668('0x1d'),_0x2eec9c,JSON['stringify'](_0xce1776));_0x19a5df(_0xce1776);})[_0xc668('0x1c')](function(_0x594809){logger['error'](_0xc668('0x1d'),_0x594809['message'],_0x2eec9c);_0x511f4a(_0x5732b1['error'](0x1f4,_0x594809[_0xc668('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x11b336){return new Promise(function(_0x139684,_0x418762){return db['OpenchannelInteraction'][_0xc668('0x24')]({'where':_0x11b336[_0xc668('0x21')]?_0x11b336[_0xc668('0x21')][_0xc668('0x22')]||null:null})[_0xc668('0x12')](function(_0x24099d){if(_0x24099d){return _0x24099d[_0xc668('0x25')](_0x11b336[_0xc668('0x26')]['ids'],_[_0xc668('0x27')](_0x11b336[_0xc668('0x26')],[_0xc668('0x28'),'id'])||{});}})[_0xc668('0x29')](function(_0x4ee000){logger['info'](_0xc668('0x2a'),_0x11b336);logger['debug'](_0xc668('0x2a'),_0x11b336,JSON[_0xc668('0x17')](_0x4ee000));_0x139684(_0x4ee000);})[_0xc668('0x1c')](function(_0x91e33c){logger[_0xc668('0x18')](_0xc668('0x2a'),_0x91e33c['message'],_0x11b336);_0x418762(_this[_0xc668('0x18')](0x1f4,_0x91e33c[_0xc668('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 72650ad..a08180c 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a68=['register','length','./openchannelInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5ca7bc,_0x49503a){var _0x3fda69=function(_0x14a8f0){while(--_0x14a8f0){_0x5ca7bc['push'](_0x5ca7bc['shift']());}};_0x3fda69(++_0x49503a);}(_0x4a68,0x132));var _0x84a6=function(_0x3aef82,_0x556c64){_0x3aef82=_0x3aef82-0x0;var _0xe635f=_0x4a68[_0x3aef82];return _0xe635f;};'use strict';var OpenchannelInteractionEvents=require(_0x84a6('0x0'));var events=[_0x84a6('0x1'),_0x84a6('0x2'),_0x84a6('0x3')];function createListener(_0x590ab9,_0x1014fa){return function(_0x2cf6c2){_0x1014fa[_0x84a6('0x4')](_0x590ab9,_0x2cf6c2);};}function removeListener(_0x3688d6,_0x3d010c){return function(){OpenchannelInteractionEvents[_0x84a6('0x5')](_0x3688d6,_0x3d010c);};}exports[_0x84a6('0x6')]=function(_0x105fbc){for(var _0x73320b=0x0,_0xcdadf3=events[_0x84a6('0x7')];_0x73320b<_0xcdadf3;_0x73320b++){var _0x16d110=events[_0x73320b];var _0x2b2e53=createListener('openchannelInteraction:'+_0x16d110,_0x105fbc);OpenchannelInteractionEvents['on'](_0x16d110,_0x2b2e53);}}; \ No newline at end of file +var _0x4d0e=['register','openchannelInteraction:','save','remove','update','removeListener'];(function(_0x399bfc,_0x36d4b0){var _0x36846d=function(_0x1465bc){while(--_0x1465bc){_0x399bfc['push'](_0x399bfc['shift']());}};_0x36846d(++_0x36d4b0);}(_0x4d0e,0x10a));var _0xe4d0=function(_0x3f54b2,_0x214c8e){_0x3f54b2=_0x3f54b2-0x0;var _0x1fb2de=_0x4d0e[_0x3f54b2];return _0x1fb2de;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xe4d0('0x0'),_0xe4d0('0x1'),_0xe4d0('0x2')];function createListener(_0x174a97,_0x52ead3){return function(_0x5bfd1a){_0x52ead3['emit'](_0x174a97,_0x5bfd1a);};}function removeListener(_0x5d3d95,_0x346863){return function(){OpenchannelInteractionEvents[_0xe4d0('0x3')](_0x5d3d95,_0x346863);};}exports[_0xe4d0('0x4')]=function(_0x1c045a){for(var _0x4701d6=0x0,_0x390b5d=events['length'];_0x4701d6<_0x390b5d;_0x4701d6++){var _0x56d542=events[_0x4701d6];var _0x4d973f=createListener(_0xe4d0('0x5')+_0x56d542,_0x1c045a);OpenchannelInteractionEvents['on'](_0x56d542,_0x4d973f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e29fb70..12dd541 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0xfea119,_0xc5b03e){var _0x29cbc3=function(_0x436b36){while(--_0x436b36){_0xfea119['push'](_0xfea119['shift']());}};_0x29cbc3(++_0xc5b03e);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ee332,_0x4dacd7){_0x1ee332=_0x1ee332-0x0;var _0x2a37ff=_0xedd9[_0x1ee332];return _0x2a37ff;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5c80df,_0x321469){_0x5c80df=_0x5c80df-0x0;var _0x489af6=_0x70e0[_0x5c80df];return _0x489af6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 60d8bf5..dfa76cc 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bde=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x2bb997,_0x167727){var _0x555c05=function(_0x59eb90){while(--_0x59eb90){_0x2bb997['push'](_0x2bb997['shift']());}};_0x555c05(++_0x167727);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x4bde[_0x1bc0ae];return _0x501104;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'body':{'type':Sequelize[_0xe4bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe4bd('0x4')]('in',_0xe4bd('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe4bd('0x6')]},'providerName':{'type':Sequelize[_0xe4bd('0x7')]},'providerResponse':{'type':Sequelize[_0xe4bd('0x2')]}}; \ No newline at end of file +var _0xf45e=['ENUM','out','DATE','STRING','sequelize','TEXT','BOOLEAN'];(function(_0x131a8c,_0x1361b7){var _0x8efaeb=function(_0x4342eb){while(--_0x4342eb){_0x131a8c['push'](_0x131a8c['shift']());}};_0x8efaeb(++_0x1361b7);}(_0xf45e,0x115));var _0xef45=function(_0xe275b9,_0x2cd528){_0xe275b9=_0xe275b9-0x0;var _0xa49c89=_0xf45e[_0xe275b9];return _0xa49c89;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'body':{'type':Sequelize[_0xef45('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef45('0x3')]('in',_0xef45('0x4')),'defaultValue':_0xef45('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xef45('0x5')]},'providerName':{'type':Sequelize[_0xef45('0x6')]},'providerResponse':{'type':Sequelize[_0xef45('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 5e8a723..5cb20d5 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4473=['error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','include','findAll','catch','show','keys','find','create','body','update','params','describe','../../config/logger','openchannel-interactions','accept','openchannel','readAt','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s'];(function(_0x517ce4,_0x450909){var _0xa8d43b=function(_0x511005){while(--_0x511005){_0x517ce4['push'](_0x517ce4['shift']());}};_0xa8d43b(++_0x450909);}(_0x4473,0x15c));var _0x3447=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4473[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3447('0x0'));var BPromise=require(_0x3447('0x1'));var Mustache=require(_0x3447('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3447('0x3'));var ejs=require(_0x3447('0x4'));var fs=require('fs');var fs_extra=require(_0x3447('0x5'));var _=require(_0x3447('0x6'));var squel=require(_0x3447('0x7'));var crypto=require(_0x3447('0x8'));var jsforce=require(_0x3447('0x9'));var deskjs=require(_0x3447('0xa'));var toCsv=require(_0x3447('0x3'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3447('0xb'));var authService=require(_0x3447('0xc'));var qs=require(_0x3447('0xd'));var as=require(_0x3447('0xe'));var hardwareService=require(_0x3447('0xf'));var logger=require('../../config/logger')(_0x3447('0x10'));var utils=require(_0x3447('0x11'));var config=require(_0x3447('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3447('0x13'))['db'];config[_0x3447('0x14')]=_[_0x3447('0x15')](config[_0x3447('0x14')],{'host':_0x3447('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3447('0x14')]));require(_0x3447('0x17'))[_0x3447('0x18')](socket);var jayson=require(_0x3447('0x19'));var client=jayson[_0x3447('0x1a')][_0x3447('0x1b')]({'port':0x232c});var client9002=jayson[_0x3447('0x1a')][_0x3447('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2f4d6e,_0x5e89a2,_0xacb40a,_0x3c642c){return new BPromise(function(_0xd7be4a,_0x3b81b3){var _0x37fd84=_0x3c642c||client;return _0x37fd84['request'](_0x2f4d6e,_0xacb40a)['then'](function(_0x110951){logger[_0x3447('0x1c')](_0x3447('0x1d'),_0x5e89a2,_0x3447('0x1e'));logger[_0x3447('0x1f')](_0x3447('0x20'),_0x5e89a2,_0x3447('0x1e'),JSON['stringify'](_0x110951));if(_0x110951[_0x3447('0x21')]){if(_0x110951[_0x3447('0x21')][_0x3447('0x22')]===0x1f4){logger[_0x3447('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e89a2,_0x110951[_0x3447('0x21')][_0x3447('0x23')]);return _0x3b81b3(_0x110951[_0x3447('0x21')]['message']);}logger[_0x3447('0x21')](_0x3447('0x1d'),_0x5e89a2,_0x110951['error'][_0x3447('0x23')]);return _0xd7be4a(_0x110951[_0x3447('0x21')][_0x3447('0x23')]);}else{logger[_0x3447('0x1c')](_0x3447('0x1d'),_0x5e89a2,_0x3447('0x1e'));_0xd7be4a(_0x110951[_0x3447('0x24')][_0x3447('0x23')]);}})['catch'](function(_0x13f61f){logger[_0x3447('0x21')](_0x3447('0x1d'),_0x5e89a2,_0x13f61f);_0x3b81b3(_0x13f61f);});});}function respondWithStatusCode(_0x12cd7c,_0x4e3684){_0x4e3684=_0x4e3684||0xcc;return function(_0x534ba6){if(_0x534ba6){return _0x12cd7c[_0x3447('0x25')](_0x4e3684);}return _0x12cd7c[_0x3447('0x26')](_0x4e3684)[_0x3447('0x27')]();};}function respondWithResult(_0x4a5604,_0x549d02){_0x549d02=_0x549d02||0xc8;return function(_0x1dd2d7){if(_0x1dd2d7){return _0x4a5604[_0x3447('0x26')](_0x549d02)[_0x3447('0x28')](_0x1dd2d7);}};}function respondWithFilteredResult(_0x3e8e95,_0x36a75d){return function(_0x43a301){if(_0x43a301){var _0x3ae8d3=typeof _0x36a75d[_0x3447('0x29')]===_0x3447('0x2a')&&typeof _0x36a75d[_0x3447('0x2b')]===_0x3447('0x2a');var _0x5373f4=_0x43a301[_0x3447('0x2c')];var _0x2cd42e=_0x3ae8d3?0x0:_0x36a75d[_0x3447('0x29')];var _0x2b2dcb=_0x3ae8d3?_0x43a301[_0x3447('0x2c')]:_0x36a75d[_0x3447('0x29')]+_0x36a75d[_0x3447('0x2b')];var _0xd1132;if(_0x2b2dcb>=_0x5373f4){_0x2b2dcb=_0x5373f4;_0xd1132=0xc8;}else{_0xd1132=0xce;}_0x3e8e95['status'](_0xd1132);return _0x3e8e95[_0x3447('0x2d')](_0x3447('0x2e'),_0x2cd42e+'-'+_0x2b2dcb+'/'+_0x5373f4)[_0x3447('0x28')](_0x43a301);}return null;};}function patchUpdates(_0x5a4a99){return function(_0x3a593f){try{jsonpatch[_0x3447('0x2f')](_0x3a593f,_0x5a4a99,!![]);}catch(_0xa0f11e){return BPromise[_0x3447('0x30')](_0xa0f11e);}return _0x3a593f[_0x3447('0x31')]();};}function saveUpdates(_0x3bd32a,_0x18100f){return function(_0x7d01ce){if(_0x7d01ce){return _0x7d01ce['update'](_0x3bd32a)[_0x3447('0x32')](function(_0x2e3668){return _0x2e3668;});}return null;};}function removeEntity(_0x2aafc1,_0x400bbb){return function(_0x57f6fd){if(_0x57f6fd){return _0x57f6fd[_0x3447('0x33')]()[_0x3447('0x32')](function(){_0x2aafc1[_0x3447('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c87a2,_0x1c06b1){return function(_0x4a1280){if(!_0x4a1280){_0x1c87a2['sendStatus'](0x194);}return _0x4a1280;};}function handleError(_0x19b3c2,_0x101cc7){_0x101cc7=_0x101cc7||0x1f4;return function(_0x2a6a69){logger[_0x3447('0x21')](_0x2a6a69['stack']);if(_0x2a6a69[_0x3447('0x34')]){delete _0x2a6a69[_0x3447('0x34')];}_0x19b3c2[_0x3447('0x26')](_0x101cc7)[_0x3447('0x35')](_0x2a6a69);};}exports[_0x3447('0x36')]=function(_0x2582b5,_0x3e966a){var _0xecaf42={},_0x5a0b2f={},_0x566365={'count':0x0,'rows':[]};var _0x232d0d=_[_0x3447('0x37')](db['OpenchannelMessage'][_0x3447('0x38')],function(_0x2a07c3){return{'name':_0x2a07c3[_0x3447('0x39')],'type':_0x2a07c3[_0x3447('0x3a')][_0x3447('0x3b')]};});_0x5a0b2f[_0x3447('0x3c')]=_[_0x3447('0x37')](_0x232d0d,'name');_0x5a0b2f['query']=_['keys'](_0x2582b5[_0x3447('0x3d')]);_0x5a0b2f[_0x3447('0x3e')]=_[_0x3447('0x3f')](_0x5a0b2f[_0x3447('0x3c')],_0x5a0b2f['query']);_0xecaf42[_0x3447('0x40')]=_[_0x3447('0x3f')](_0x5a0b2f[_0x3447('0x3c')],qs['fields'](_0x2582b5['query'][_0x3447('0x41')]));_0xecaf42[_0x3447('0x40')]=_0xecaf42['attributes'][_0x3447('0x42')]?_0xecaf42[_0x3447('0x40')]:_0x5a0b2f[_0x3447('0x3c')];if(!_0x2582b5['query'][_0x3447('0x43')]('nolimit')){_0xecaf42[_0x3447('0x2b')]=qs[_0x3447('0x2b')](_0x2582b5[_0x3447('0x3d')]['limit']);_0xecaf42[_0x3447('0x29')]=qs[_0x3447('0x29')](_0x2582b5[_0x3447('0x3d')][_0x3447('0x29')]);}_0xecaf42[_0x3447('0x44')]=qs['sort'](_0x2582b5['query'][_0x3447('0x45')]);_0xecaf42[_0x3447('0x46')]=qs['filters'](_[_0x3447('0x47')](_0x2582b5[_0x3447('0x3d')],_0x5a0b2f[_0x3447('0x3e')]),_0x232d0d);if(_0x2582b5[_0x3447('0x3d')][_0x3447('0x48')]){_0xecaf42[_0x3447('0x46')]=_[_0x3447('0x49')](_0xecaf42[_0x3447('0x46')],{'$or':_[_0x3447('0x37')](_0x232d0d,function(_0x2c71a4){if(_0x2c71a4['type']!==_0x3447('0x4a')){var _0x507403={};_0x507403[_0x2c71a4['name']]={'$like':'%'+_0x2582b5['query'][_0x3447('0x48')]+'%'};return _0x507403;}})});}_0xecaf42=_[_0x3447('0x49')]({},_0xecaf42,_0x2582b5[_0x3447('0x4b')]);var _0x24efc3={'where':_0xecaf42['where']};return db[_0x3447('0x4c')]['count'](_0x24efc3)['then'](function(_0x38d442){_0x566365['count']=_0x38d442;if(_0x2582b5['query']['includeAll']){_0xecaf42[_0x3447('0x4d')]=[{'all':!![]}];}return db[_0x3447('0x4c')][_0x3447('0x4e')](_0xecaf42);})[_0x3447('0x32')](function(_0x12e4d0){_0x566365['rows']=_0x12e4d0;return _0x566365;})[_0x3447('0x32')](respondWithFilteredResult(_0x3e966a,_0xecaf42))[_0x3447('0x4f')](handleError(_0x3e966a,null));};exports[_0x3447('0x50')]=function(_0x2659e8,_0x2c6bc6){var _0x1a3903={'raw':!![],'where':{'id':_0x2659e8['params']['id']}},_0x303e80={};_0x303e80[_0x3447('0x3c')]=_[_0x3447('0x51')](db[_0x3447('0x4c')]['rawAttributes']);_0x303e80[_0x3447('0x3d')]=_[_0x3447('0x51')](_0x2659e8[_0x3447('0x3d')]);_0x303e80[_0x3447('0x3e')]=_[_0x3447('0x3f')](_0x303e80[_0x3447('0x3c')],_0x303e80[_0x3447('0x3d')]);_0x1a3903['attributes']=_[_0x3447('0x3f')](_0x303e80[_0x3447('0x3c')],qs[_0x3447('0x41')](_0x2659e8[_0x3447('0x3d')][_0x3447('0x41')]));_0x1a3903[_0x3447('0x40')]=_0x1a3903[_0x3447('0x40')]['length']?_0x1a3903[_0x3447('0x40')]:_0x303e80[_0x3447('0x3c')];if(_0x2659e8['query']['includeAll']){_0x1a3903[_0x3447('0x4d')]=[{'all':!![]}];}_0x1a3903=_[_0x3447('0x49')]({},_0x1a3903,_0x2659e8[_0x3447('0x4b')]);return db[_0x3447('0x4c')][_0x3447('0x52')](_0x1a3903)['then'](handleEntityNotFound(_0x2c6bc6,null))[_0x3447('0x32')](respondWithResult(_0x2c6bc6,null))[_0x3447('0x4f')](handleError(_0x2c6bc6,null));};exports[_0x3447('0x53')]=function(_0x343026,_0x27484a){return db['OpenchannelMessage'][_0x3447('0x53')](_0x343026[_0x3447('0x54')],{})[_0x3447('0x32')](respondWithResult(_0x27484a,0xc9))[_0x3447('0x4f')](handleError(_0x27484a,null));};exports[_0x3447('0x55')]=function(_0xe78cc0,_0x7e56a9){if(_0xe78cc0[_0x3447('0x54')]['id']){delete _0xe78cc0[_0x3447('0x54')]['id'];}return db[_0x3447('0x4c')][_0x3447('0x52')]({'where':{'id':_0xe78cc0[_0x3447('0x56')]['id']}})['then'](handleEntityNotFound(_0x7e56a9,null))[_0x3447('0x32')](saveUpdates(_0xe78cc0[_0x3447('0x54')],null))[_0x3447('0x32')](respondWithResult(_0x7e56a9,null))[_0x3447('0x4f')](handleError(_0x7e56a9,null));};exports[_0x3447('0x33')]=function(_0x4078fd,_0x3e16ea){return db[_0x3447('0x4c')]['find']({'where':{'id':_0x4078fd['params']['id']}})[_0x3447('0x32')](handleEntityNotFound(_0x3e16ea,null))[_0x3447('0x32')](removeEntity(_0x3e16ea,null))['catch'](handleError(_0x3e16ea,null));};exports[_0x3447('0x57')]=function(_0x34d017,_0x7d962e){return db[_0x3447('0x4c')][_0x3447('0x57')]()['then'](respondWithResult(_0x7d962e,null))[_0x3447('0x4f')](handleError(_0x7d962e,null));};var interaction_log=require(_0x3447('0x58'))(_0x3447('0x59'));exports[_0x3447('0x5a')]=function(_0x123168,_0x4dd328,_0x5647e4){var _0x3f729e={'agent':{},'channel':_0x3447('0x5b')};if(_0x123168[_0x3447('0x54')]['id']){delete _0x123168['body']['id'];}_0x123168[_0x3447('0x54')]['read']=!![];_0x123168[_0x3447('0x54')][_0x3447('0x5c')]=moment()[_0x3447('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x123168[_0x3447('0x54')][_0x3447('0x5e')]=_0x123168[_0x3447('0x54')][_0x3447('0x5e')]||_0x123168[_0x3447('0x5f')]['id'];_0x3f729e[_0x3447('0x60')]['id']=_0x123168['body'][_0x3447('0x5e')];return db[_0x3447('0x4c')][_0x3447('0x52')]({'where':{'id':_0x123168['params']['id'],'UserId':null}})[_0x3447('0x32')](handleEntityNotFound(_0x4dd328,null))[_0x3447('0x32')](saveUpdates(_0x123168[_0x3447('0x54')],null))['then'](function(_0x27bfc6){if(_0x27bfc6){_0x3f729e[_0x3447('0x23')]=_0x27bfc6['get']({'plain':!![]});return db[_0x3447('0x61')][_0x3447('0x52')]({'where':{'id':_0x27bfc6[_0x3447('0x62')]}});}return null;})[_0x3447('0x32')](handleEntityNotFound(_0x4dd328,null))['then'](function(_0x137811){if(_0x137811){return _0x137811[_0x3447('0x55')]({'UserId':_0x123168[_0x3447('0x54')][_0x3447('0x5e')],'read1stAt':_['isNil'](_0x137811[_0x3447('0x63')])?moment()[_0x3447('0x5d')](_0x3447('0x64')):undefined});}return null;})[_0x3447('0x32')](function(_0x35781d){if(_0x35781d){_0x3f729e[_0x3447('0x65')]=_0x35781d['get']({'plain':!![]});interaction_log['info'](_0x3447('0x66'),_0x123168[_0x3447('0x5f')]['id'],_0x123168[_0x3447('0x5f')][_0x3447('0x34')],_0x123168[_0x3447('0x5f')][_0x3447('0x67')],_0x3f729e['interaction']['id'],_0x123168['body']?JSON[_0x3447('0x68')](_0x123168[_0x3447('0x54')]):_0x3447('0x69'));return respondWithRpcPromise(_0x3447('0x6a'),_0x3447('0x6b'),_0x3f729e);}return null;})['then'](function(_0x2f1a25){var _0xff8379=_0x3447('0x6c')+_0x2f1a25[_0x3447('0x23')][_0x3447('0x6d')];return db['sequelize'][_0x3447('0x3d')](_0xff8379,{'type':db[_0x3447('0x6e')][_0x3447('0x6f')][_0x3447('0x70')],'raw':!![]})[_0x3447('0x32')](function(_0x134821){return _0x134821;});})[_0x3447('0x32')](function(_0x2c4e85){if(_0x2c4e85){_0x3f729e[_0x3447('0x23')][_0x3447('0x71')]=_0x2c4e85[0x0];if(!_0x123168['body'][_0x3447('0x5e')])return;return db[_0x3447('0x72')][_0x3447('0x52')]({'where':{'id':_0x123168['body'][_0x3447('0x5e')],'role':_0x3447('0x60')},'attributes':['id',_0x3447('0x34'),_0x3447('0x73'),_0x3447('0x74'),_0x3447('0x75')],'raw':!![]});}return null;})[_0x3447('0x32')](function(_0x144adf){if(!_0x144adf)return null;_0x3f729e[_0x3447('0x23')][_0x3447('0x60')]=_0x144adf;return _0x3f729e;})['then'](function(_0x1e097f){if(_0x1e097f){if(_0x123168['body']['manual']){_0x3f729e['message'][_0x3447('0x76')]=util[_0x3447('0x5d')](_0x3447('0x77'),_0x123168[_0x3447('0x5f')]['name']);_0x3f729e[_0x3447('0x23')][_0x3447('0x78')]=_0x3f729e['channel'];_0x3f729e[_0x3447('0x23')]['motionChannel']=_0x3f729e[_0x3447('0x78')];_0x3f729e['message']['event']=_0x3447('0x5a');return respondWithRpcPromise(_0x3447('0x79'),_0x3447('0x79'),{'event':'acceptmessage','message':_0x3f729e['message']},client9002)[_0x3447('0x32')](function(){return _0x3f729e;});}return _0x3f729e;}return null;})['then'](respondWithResult(_0x4dd328,null))[_0x3447('0x4f')](handleError(_0x4dd328,null));};var interaction_log=require(_0x3447('0x58'))('openchannel-interactions');exports[_0x3447('0x30')]=function(_0xb9940,_0x309333,_0x37dab2){var _0x683622={'agent':{},'channel':_0x3447('0x5b')};if(_0xb9940['body']['id']){delete _0xb9940[_0x3447('0x54')]['id'];}_0xb9940[_0x3447('0x54')][_0x3447('0x5e')]=_0xb9940['body']['UserId']||_0xb9940[_0x3447('0x5f')]['id'];_0x683622[_0x3447('0x60')]['id']=_0xb9940['body'][_0x3447('0x5e')];return db[_0x3447('0x4c')][_0x3447('0x52')]({'where':{'id':_0xb9940['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x309333,null))[_0x3447('0x32')](function(_0x460ea2){if(_0x460ea2){_0x683622['message']=_0x460ea2[_0x3447('0x7a')]({'plain':!![]});return db[_0x3447('0x61')][_0x3447('0x52')]({'where':{'id':_0x460ea2['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x309333,null))[_0x3447('0x32')](function(_0x3bca6f){if(_0x3bca6f){_0x683622['interaction']=_0x3bca6f[_0x3447('0x7a')]({'plain':!![]});interaction_log['info'](_0x3447('0x7b'),_0xb9940[_0x3447('0x5f')]['id'],_0xb9940[_0x3447('0x5f')][_0x3447('0x34')],_0xb9940[_0x3447('0x5f')][_0x3447('0x67')],_0x683622[_0x3447('0x65')]['id'],_0xb9940['body']?JSON[_0x3447('0x68')](_0xb9940[_0x3447('0x54')]):_0x3447('0x69'));return respondWithRpcPromise(_0x3447('0x7c'),_0x3447('0x7d'),_0x683622);}return null;})[_0x3447('0x32')](function(_0x37d4bd){var _0xbbade0=_0x3447('0x6c')+_0x37d4bd[_0x3447('0x23')]['ContactId'];return db['sequelize'][_0x3447('0x3d')](_0xbbade0,{'type':db[_0x3447('0x6e')][_0x3447('0x6f')]['SELECT'],'raw':!![]})[_0x3447('0x32')](function(_0x815ecc){return _0x815ecc;});})[_0x3447('0x32')](function(_0xe52ccb){if(_0xe52ccb){_0x683622[_0x3447('0x23')]['contact']=_0xe52ccb[0x0];if(!_0xb9940[_0x3447('0x54')]['UserId'])return;return db['User'][_0x3447('0x52')]({'where':{'id':_0xb9940['body'][_0x3447('0x5e')],'role':_0x3447('0x60')},'attributes':['id','name','fullname',_0x3447('0x74'),_0x3447('0x75')],'raw':!![]});}return null;})[_0x3447('0x32')](function(_0xbb3545){if(!_0xbb3545)return null;_0x683622[_0x3447('0x23')][_0x3447('0x60')]=_0xbb3545;return _0x683622;})[_0x3447('0x32')](function(_0x296e27){if(_0x296e27){_0x296e27[_0x3447('0x23')]['interface']=util[_0x3447('0x5d')]('SIP/%s',_0xb9940[_0x3447('0x5f')][_0x3447('0x34')]);_0x296e27[_0x3447('0x23')]['channel']=_0x683622[_0x3447('0x78')];_0x296e27['message'][_0x3447('0x7e')]=_0x683622[_0x3447('0x78')];_0x296e27[_0x3447('0x23')]['event']='reject';respondWithRpcPromise('EventManager',_0x3447('0x79'),{'event':'rejectmessage','message':_0x296e27['message']},client9002);return _0x683622;}return null;})[_0x3447('0x32')](respondWithResult(_0x309333,null))['catch'](handleError(_0x309333,null));}; \ No newline at end of file +var _0xa2e7=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','find','create','body','OpenchannelMessage','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','interface','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x17004f,_0x16ed63){var _0x4db36a=function(_0x23b396){while(--_0x23b396){_0x17004f['push'](_0x17004f['shift']());}};_0x4db36a(++_0x16ed63);}(_0xa2e7,0x185));var _0x7a2e=function(_0x10106a,_0x343b68){_0x10106a=_0x10106a-0x0;var _0x5da8b9=_0xa2e7[_0x10106a];return _0x5da8b9;};'use strict';var emlformat=require(_0x7a2e('0x0'));var rimraf=require(_0x7a2e('0x1'));var zipdir=require(_0x7a2e('0x2'));var jsonpatch=require(_0x7a2e('0x3'));var rp=require(_0x7a2e('0x4'));var moment=require(_0x7a2e('0x5'));var BPromise=require(_0x7a2e('0x6'));var Mustache=require(_0x7a2e('0x7'));var util=require('util');var path=require(_0x7a2e('0x8'));var sox=require(_0x7a2e('0x9'));var csv=require(_0x7a2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a2e('0xb'));var _=require(_0x7a2e('0xc'));var squel=require(_0x7a2e('0xd'));var crypto=require(_0x7a2e('0xe'));var jsforce=require(_0x7a2e('0xf'));var deskjs=require(_0x7a2e('0x10'));var toCsv=require(_0x7a2e('0xa'));var querystring=require(_0x7a2e('0x11'));var Papa=require(_0x7a2e('0x12'));var Redis=require(_0x7a2e('0x13'));var authService=require(_0x7a2e('0x14'));var qs=require(_0x7a2e('0x15'));var as=require(_0x7a2e('0x16'));var hardwareService=require(_0x7a2e('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7a2e('0x18'));var config=require(_0x7a2e('0x19'));var licenseUtil=require(_0x7a2e('0x1a'));var db=require(_0x7a2e('0x1b'))['db'];config[_0x7a2e('0x1c')]=_[_0x7a2e('0x1d')](config['redis'],{'host':_0x7a2e('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a2e('0x1c')]));require(_0x7a2e('0x1f'))[_0x7a2e('0x20')](socket);var jayson=require(_0x7a2e('0x21'));var client=jayson[_0x7a2e('0x22')][_0x7a2e('0x23')]({'port':0x232c});var client9002=jayson[_0x7a2e('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f58a6,_0x41b6ad,_0x3566bb,_0xf79fe8){return new BPromise(function(_0x38c4a3,_0x5f25c4){var _0x4b6d77=_0xf79fe8||client;return _0x4b6d77[_0x7a2e('0x24')](_0x1f58a6,_0x3566bb)[_0x7a2e('0x25')](function(_0x398bd4){logger[_0x7a2e('0x26')](_0x7a2e('0x27'),_0x41b6ad,_0x7a2e('0x28'));logger[_0x7a2e('0x29')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x41b6ad,_0x7a2e('0x28'),JSON['stringify'](_0x398bd4));if(_0x398bd4[_0x7a2e('0x2a')]){if(_0x398bd4[_0x7a2e('0x2a')]['code']===0x1f4){logger[_0x7a2e('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x41b6ad,_0x398bd4[_0x7a2e('0x2a')][_0x7a2e('0x2b')]);return _0x5f25c4(_0x398bd4[_0x7a2e('0x2a')][_0x7a2e('0x2b')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x41b6ad,_0x398bd4[_0x7a2e('0x2a')][_0x7a2e('0x2b')]);return _0x38c4a3(_0x398bd4[_0x7a2e('0x2a')][_0x7a2e('0x2b')]);}else{logger[_0x7a2e('0x26')](_0x7a2e('0x27'),_0x41b6ad,'request\x20sent');_0x38c4a3(_0x398bd4[_0x7a2e('0x2c')]['message']);}})[_0x7a2e('0x2d')](function(_0x439af0){logger[_0x7a2e('0x2a')](_0x7a2e('0x27'),_0x41b6ad,_0x439af0);_0x5f25c4(_0x439af0);});});}function respondWithStatusCode(_0x4df5d6,_0x266d1f){_0x266d1f=_0x266d1f||0xcc;return function(_0x21ca69){if(_0x21ca69){return _0x4df5d6[_0x7a2e('0x2e')](_0x266d1f);}return _0x4df5d6[_0x7a2e('0x2f')](_0x266d1f)[_0x7a2e('0x30')]();};}function respondWithResult(_0xc7af6e,_0x5acc79){_0x5acc79=_0x5acc79||0xc8;return function(_0x5ef0ab){if(_0x5ef0ab){return _0xc7af6e[_0x7a2e('0x2f')](_0x5acc79)[_0x7a2e('0x31')](_0x5ef0ab);}};}function respondWithFilteredResult(_0xf5b0f8,_0x1e5586){return function(_0x4d0534){if(_0x4d0534){var _0x37cb03=typeof _0x1e5586[_0x7a2e('0x32')]===_0x7a2e('0x33')&&typeof _0x1e5586[_0x7a2e('0x34')]===_0x7a2e('0x33');var _0x26e847=_0x4d0534[_0x7a2e('0x35')];var _0x107cd7=_0x37cb03?0x0:_0x1e5586[_0x7a2e('0x32')];var _0x4f239f=_0x37cb03?_0x4d0534['count']:_0x1e5586[_0x7a2e('0x32')]+_0x1e5586['limit'];var _0x4cd10c;if(_0x4f239f>=_0x26e847){_0x4f239f=_0x26e847;_0x4cd10c=0xc8;}else{_0x4cd10c=0xce;}_0xf5b0f8[_0x7a2e('0x2f')](_0x4cd10c);return _0xf5b0f8[_0x7a2e('0x36')](_0x7a2e('0x37'),_0x107cd7+'-'+_0x4f239f+'/'+_0x26e847)['json'](_0x4d0534);}return null;};}function patchUpdates(_0x429b37){return function(_0x479b7a){try{jsonpatch['apply'](_0x479b7a,_0x429b37,!![]);}catch(_0x9eca6c){return BPromise['reject'](_0x9eca6c);}return _0x479b7a[_0x7a2e('0x38')]();};}function saveUpdates(_0x1acd1d,_0x5ee907){return function(_0x54a2bd){if(_0x54a2bd){return _0x54a2bd[_0x7a2e('0x39')](_0x1acd1d)['then'](function(_0x164ae2){return _0x164ae2;});}return null;};}function removeEntity(_0x315c5b,_0x77775){return function(_0x2aa5a4){if(_0x2aa5a4){return _0x2aa5a4[_0x7a2e('0x3a')]()[_0x7a2e('0x25')](function(){_0x315c5b[_0x7a2e('0x2f')](0xcc)[_0x7a2e('0x30')]();});}};}function handleEntityNotFound(_0x2cee8c,_0x93f178){return function(_0xf98037){if(!_0xf98037){_0x2cee8c[_0x7a2e('0x2e')](0x194);}return _0xf98037;};}function handleError(_0x3504c7,_0x3082b5){_0x3082b5=_0x3082b5||0x1f4;return function(_0xf94a9){logger['error'](_0xf94a9[_0x7a2e('0x3b')]);if(_0xf94a9['name']){delete _0xf94a9[_0x7a2e('0x3c')];}_0x3504c7['status'](_0x3082b5)['send'](_0xf94a9);};}exports[_0x7a2e('0x3d')]=function(_0x193191,_0x5ec4a9){var _0x4de024={},_0x3dafe8={},_0x58dfb8={'count':0x0,'rows':[]};var _0x202b7a=_[_0x7a2e('0x3e')](db['OpenchannelMessage'][_0x7a2e('0x3f')],function(_0x259c11){return{'name':_0x259c11[_0x7a2e('0x40')],'type':_0x259c11[_0x7a2e('0x41')][_0x7a2e('0x42')]};});_0x3dafe8[_0x7a2e('0x43')]=_[_0x7a2e('0x3e')](_0x202b7a,_0x7a2e('0x3c'));_0x3dafe8[_0x7a2e('0x44')]=_['keys'](_0x193191[_0x7a2e('0x44')]);_0x3dafe8[_0x7a2e('0x45')]=_[_0x7a2e('0x46')](_0x3dafe8['model'],_0x3dafe8[_0x7a2e('0x44')]);_0x4de024[_0x7a2e('0x47')]=_[_0x7a2e('0x46')](_0x3dafe8[_0x7a2e('0x43')],qs[_0x7a2e('0x48')](_0x193191[_0x7a2e('0x44')][_0x7a2e('0x48')]));_0x4de024[_0x7a2e('0x47')]=_0x4de024[_0x7a2e('0x47')][_0x7a2e('0x49')]?_0x4de024['attributes']:_0x3dafe8[_0x7a2e('0x43')];if(!_0x193191[_0x7a2e('0x44')]['hasOwnProperty']('nolimit')){_0x4de024[_0x7a2e('0x34')]=qs[_0x7a2e('0x34')](_0x193191[_0x7a2e('0x44')]['limit']);_0x4de024[_0x7a2e('0x32')]=qs['offset'](_0x193191[_0x7a2e('0x44')][_0x7a2e('0x32')]);}_0x4de024[_0x7a2e('0x4a')]=qs[_0x7a2e('0x4b')](_0x193191['query'][_0x7a2e('0x4b')]);_0x4de024[_0x7a2e('0x4c')]=qs[_0x7a2e('0x45')](_[_0x7a2e('0x4d')](_0x193191[_0x7a2e('0x44')],_0x3dafe8[_0x7a2e('0x45')]),_0x202b7a);if(_0x193191['query'][_0x7a2e('0x4e')]){_0x4de024[_0x7a2e('0x4c')]=_[_0x7a2e('0x4f')](_0x4de024[_0x7a2e('0x4c')],{'$or':_[_0x7a2e('0x3e')](_0x202b7a,function(_0x1d690b){if(_0x1d690b[_0x7a2e('0x41')]!==_0x7a2e('0x50')){var _0x4de4f7={};_0x4de4f7[_0x1d690b[_0x7a2e('0x3c')]]={'$like':'%'+_0x193191[_0x7a2e('0x44')][_0x7a2e('0x4e')]+'%'};return _0x4de4f7;}})});}_0x4de024=_[_0x7a2e('0x4f')]({},_0x4de024,_0x193191[_0x7a2e('0x51')]);var _0x28c869={'where':_0x4de024['where']};return db['OpenchannelMessage'][_0x7a2e('0x35')](_0x28c869)[_0x7a2e('0x25')](function(_0x3a1e19){_0x58dfb8[_0x7a2e('0x35')]=_0x3a1e19;if(_0x193191[_0x7a2e('0x44')][_0x7a2e('0x52')]){_0x4de024[_0x7a2e('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x4de024);})[_0x7a2e('0x25')](function(_0x3d0fc2){_0x58dfb8['rows']=_0x3d0fc2;return _0x58dfb8;})[_0x7a2e('0x25')](respondWithFilteredResult(_0x5ec4a9,_0x4de024))[_0x7a2e('0x2d')](handleError(_0x5ec4a9,null));};exports[_0x7a2e('0x54')]=function(_0x4dca83,_0x5bbd7c){var _0x527e0b={'raw':!![],'where':{'id':_0x4dca83[_0x7a2e('0x55')]['id']}},_0x2aceec={};_0x2aceec[_0x7a2e('0x43')]=_['keys'](db['OpenchannelMessage'][_0x7a2e('0x3f')]);_0x2aceec[_0x7a2e('0x44')]=_[_0x7a2e('0x56')](_0x4dca83[_0x7a2e('0x44')]);_0x2aceec[_0x7a2e('0x45')]=_[_0x7a2e('0x46')](_0x2aceec['model'],_0x2aceec[_0x7a2e('0x44')]);_0x527e0b[_0x7a2e('0x47')]=_['intersection'](_0x2aceec[_0x7a2e('0x43')],qs[_0x7a2e('0x48')](_0x4dca83[_0x7a2e('0x44')][_0x7a2e('0x48')]));_0x527e0b[_0x7a2e('0x47')]=_0x527e0b[_0x7a2e('0x47')][_0x7a2e('0x49')]?_0x527e0b[_0x7a2e('0x47')]:_0x2aceec['model'];if(_0x4dca83[_0x7a2e('0x44')]['includeAll']){_0x527e0b[_0x7a2e('0x53')]=[{'all':!![]}];}_0x527e0b=_['merge']({},_0x527e0b,_0x4dca83['options']);return db['OpenchannelMessage'][_0x7a2e('0x57')](_0x527e0b)['then'](handleEntityNotFound(_0x5bbd7c,null))[_0x7a2e('0x25')](respondWithResult(_0x5bbd7c,null))[_0x7a2e('0x2d')](handleError(_0x5bbd7c,null));};exports[_0x7a2e('0x58')]=function(_0x4e7539,_0x5f47d5){return db['OpenchannelMessage'][_0x7a2e('0x58')](_0x4e7539['body'],{})[_0x7a2e('0x25')](respondWithResult(_0x5f47d5,0xc9))[_0x7a2e('0x2d')](handleError(_0x5f47d5,null));};exports[_0x7a2e('0x39')]=function(_0x223e47,_0x4d98fa){if(_0x223e47[_0x7a2e('0x59')]['id']){delete _0x223e47[_0x7a2e('0x59')]['id'];}return db[_0x7a2e('0x5a')]['find']({'where':{'id':_0x223e47['params']['id']}})[_0x7a2e('0x25')](handleEntityNotFound(_0x4d98fa,null))[_0x7a2e('0x25')](saveUpdates(_0x223e47[_0x7a2e('0x59')],null))[_0x7a2e('0x25')](respondWithResult(_0x4d98fa,null))[_0x7a2e('0x2d')](handleError(_0x4d98fa,null));};exports[_0x7a2e('0x3a')]=function(_0x4e2f25,_0x51aa2c){return db[_0x7a2e('0x5a')][_0x7a2e('0x57')]({'where':{'id':_0x4e2f25[_0x7a2e('0x55')]['id']}})['then'](handleEntityNotFound(_0x51aa2c,null))[_0x7a2e('0x25')](removeEntity(_0x51aa2c,null))[_0x7a2e('0x2d')](handleError(_0x51aa2c,null));};exports[_0x7a2e('0x5b')]=function(_0x338b69,_0x3399f2){return db[_0x7a2e('0x5a')]['describe']()[_0x7a2e('0x25')](respondWithResult(_0x3399f2,null))[_0x7a2e('0x2d')](handleError(_0x3399f2,null));};var interaction_log=require(_0x7a2e('0x5c'))(_0x7a2e('0x5d'));exports[_0x7a2e('0x5e')]=function(_0x7096c3,_0x573a6b,_0x3373bd){var _0x16f757={'agent':{},'channel':_0x7a2e('0x5f')};if(_0x7096c3['body']['id']){delete _0x7096c3[_0x7a2e('0x59')]['id'];}_0x7096c3[_0x7a2e('0x59')][_0x7a2e('0x60')]=!![];_0x7096c3[_0x7a2e('0x59')][_0x7a2e('0x61')]=moment()['format'](_0x7a2e('0x62'));_0x7096c3[_0x7a2e('0x59')]['UserId']=_0x7096c3[_0x7a2e('0x59')][_0x7a2e('0x63')]||_0x7096c3[_0x7a2e('0x64')]['id'];_0x16f757[_0x7a2e('0x65')]['id']=_0x7096c3[_0x7a2e('0x59')]['UserId'];return db['OpenchannelMessage'][_0x7a2e('0x57')]({'where':{'id':_0x7096c3[_0x7a2e('0x55')]['id'],'UserId':null}})[_0x7a2e('0x25')](handleEntityNotFound(_0x573a6b,null))['then'](saveUpdates(_0x7096c3[_0x7a2e('0x59')],null))['then'](function(_0x90e418){if(_0x90e418){_0x16f757['message']=_0x90e418['get']({'plain':!![]});return db[_0x7a2e('0x66')][_0x7a2e('0x57')]({'where':{'id':_0x90e418[_0x7a2e('0x67')]}});}return null;})[_0x7a2e('0x25')](handleEntityNotFound(_0x573a6b,null))[_0x7a2e('0x25')](function(_0x42f94e){if(_0x42f94e){return _0x42f94e[_0x7a2e('0x39')]({'UserId':_0x7096c3[_0x7a2e('0x59')][_0x7a2e('0x63')],'read1stAt':_[_0x7a2e('0x68')](_0x42f94e[_0x7a2e('0x69')])?moment()[_0x7a2e('0x6a')](_0x7a2e('0x62')):undefined});}return null;})[_0x7a2e('0x25')](function(_0x2f5e26){if(_0x2f5e26){_0x16f757[_0x7a2e('0x6b')]=_0x2f5e26[_0x7a2e('0x6c')]({'plain':!![]});interaction_log[_0x7a2e('0x26')](_0x7a2e('0x6d'),_0x7096c3[_0x7a2e('0x64')]['id'],_0x7096c3['user'][_0x7a2e('0x3c')],_0x7096c3[_0x7a2e('0x64')][_0x7a2e('0x6e')],_0x16f757[_0x7a2e('0x6b')]['id'],_0x7096c3[_0x7a2e('0x59')]?JSON[_0x7a2e('0x6f')](_0x7096c3[_0x7a2e('0x59')]):_0x7a2e('0x70'));return respondWithRpcPromise(_0x7a2e('0x71'),_0x7a2e('0x72'),_0x16f757);}return null;})[_0x7a2e('0x25')](function(_0x23692a){var _0x5d5829=_0x7a2e('0x73')+_0x23692a[_0x7a2e('0x2b')][_0x7a2e('0x74')];return db[_0x7a2e('0x75')][_0x7a2e('0x44')](_0x5d5829,{'type':db[_0x7a2e('0x76')][_0x7a2e('0x77')]['SELECT'],'raw':!![]})[_0x7a2e('0x25')](function(_0x2f8b24){return _0x2f8b24;});})[_0x7a2e('0x25')](function(_0x27e6ae){if(_0x27e6ae){_0x16f757[_0x7a2e('0x2b')][_0x7a2e('0x78')]=_0x27e6ae[0x0];if(!_0x7096c3['body'][_0x7a2e('0x63')])return;return db['User'][_0x7a2e('0x57')]({'where':{'id':_0x7096c3[_0x7a2e('0x59')][_0x7a2e('0x63')],'role':_0x7a2e('0x65')},'attributes':['id',_0x7a2e('0x3c'),_0x7a2e('0x79'),_0x7a2e('0x7a'),_0x7a2e('0x7b')],'raw':!![]});}return null;})[_0x7a2e('0x25')](function(_0x12d8bb){if(!_0x12d8bb)return null;_0x16f757[_0x7a2e('0x2b')]['agent']=_0x12d8bb;return _0x16f757;})['then'](function(_0x5ce932){if(_0x5ce932){if(_0x7096c3[_0x7a2e('0x59')]['manual']){_0x16f757[_0x7a2e('0x2b')]['interface']=util[_0x7a2e('0x6a')](_0x7a2e('0x7c'),_0x7096c3[_0x7a2e('0x64')][_0x7a2e('0x3c')]);_0x16f757[_0x7a2e('0x2b')][_0x7a2e('0x7d')]=_0x16f757['channel'];_0x16f757[_0x7a2e('0x2b')][_0x7a2e('0x7e')]=_0x16f757['channel'];_0x16f757[_0x7a2e('0x2b')]['event']=_0x7a2e('0x5e');return respondWithRpcPromise('EventManager',_0x7a2e('0x7f'),{'event':_0x7a2e('0x80'),'message':_0x16f757['message']},client9002)['then'](function(){return _0x16f757;});}return _0x16f757;}return null;})[_0x7a2e('0x25')](respondWithResult(_0x573a6b,null))[_0x7a2e('0x2d')](handleError(_0x573a6b,null));};var interaction_log=require(_0x7a2e('0x5c'))(_0x7a2e('0x5d'));exports[_0x7a2e('0x81')]=function(_0x3a876d,_0x436ad8,_0x577e0c){var _0x1a66d2={'agent':{},'channel':_0x7a2e('0x5f')};if(_0x3a876d[_0x7a2e('0x59')]['id']){delete _0x3a876d[_0x7a2e('0x59')]['id'];}_0x3a876d[_0x7a2e('0x59')][_0x7a2e('0x63')]=_0x3a876d['body']['UserId']||_0x3a876d['user']['id'];_0x1a66d2['agent']['id']=_0x3a876d[_0x7a2e('0x59')][_0x7a2e('0x63')];return db[_0x7a2e('0x5a')][_0x7a2e('0x57')]({'where':{'id':_0x3a876d['params']['id'],'UserId':null}})[_0x7a2e('0x25')](handleEntityNotFound(_0x436ad8,null))[_0x7a2e('0x25')](function(_0x4653fc){if(_0x4653fc){_0x1a66d2['message']=_0x4653fc[_0x7a2e('0x6c')]({'plain':!![]});return db['OpenchannelInteraction'][_0x7a2e('0x57')]({'where':{'id':_0x4653fc[_0x7a2e('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x436ad8,null))[_0x7a2e('0x25')](function(_0xe5c179){if(_0xe5c179){_0x1a66d2[_0x7a2e('0x6b')]=_0xe5c179[_0x7a2e('0x6c')]({'plain':!![]});interaction_log[_0x7a2e('0x26')](_0x7a2e('0x82'),_0x3a876d[_0x7a2e('0x64')]['id'],_0x3a876d['user'][_0x7a2e('0x3c')],_0x3a876d['user'][_0x7a2e('0x6e')],_0x1a66d2[_0x7a2e('0x6b')]['id'],_0x3a876d[_0x7a2e('0x59')]?JSON['stringify'](_0x3a876d['body']):'null');return respondWithRpcPromise(_0x7a2e('0x83'),_0x7a2e('0x84'),_0x1a66d2);}return null;})[_0x7a2e('0x25')](function(_0x3e70db){var _0x100930='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e70db[_0x7a2e('0x2b')][_0x7a2e('0x74')];return db[_0x7a2e('0x75')]['query'](_0x100930,{'type':db[_0x7a2e('0x76')][_0x7a2e('0x77')][_0x7a2e('0x85')],'raw':!![]})[_0x7a2e('0x25')](function(_0x1095d7){return _0x1095d7;});})[_0x7a2e('0x25')](function(_0x1cbddd){if(_0x1cbddd){_0x1a66d2[_0x7a2e('0x2b')]['contact']=_0x1cbddd[0x0];if(!_0x3a876d['body'][_0x7a2e('0x63')])return;return db[_0x7a2e('0x86')][_0x7a2e('0x57')]({'where':{'id':_0x3a876d[_0x7a2e('0x59')][_0x7a2e('0x63')],'role':'agent'},'attributes':['id',_0x7a2e('0x3c'),'fullname',_0x7a2e('0x7a'),_0x7a2e('0x7b')],'raw':!![]});}return null;})[_0x7a2e('0x25')](function(_0x312d30){if(!_0x312d30)return null;_0x1a66d2[_0x7a2e('0x2b')][_0x7a2e('0x65')]=_0x312d30;return _0x1a66d2;})[_0x7a2e('0x25')](function(_0x1bead4){if(_0x1bead4){_0x1bead4[_0x7a2e('0x2b')][_0x7a2e('0x87')]=util[_0x7a2e('0x6a')](_0x7a2e('0x7c'),_0x3a876d[_0x7a2e('0x64')][_0x7a2e('0x3c')]);_0x1bead4[_0x7a2e('0x2b')][_0x7a2e('0x7d')]=_0x1a66d2['channel'];_0x1bead4[_0x7a2e('0x2b')][_0x7a2e('0x7e')]=_0x1a66d2[_0x7a2e('0x7d')];_0x1bead4[_0x7a2e('0x2b')][_0x7a2e('0x88')]=_0x7a2e('0x81');respondWithRpcPromise(_0x7a2e('0x7f'),_0x7a2e('0x7f'),{'event':_0x7a2e('0x89'),'message':_0x1bead4[_0x7a2e('0x2b')]},client9002);return _0x1a66d2;}return null;})[_0x7a2e('0x25')](respondWithResult(_0x436ad8,null))[_0x7a2e('0x2d')](handleError(_0x436ad8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6054082..b2f0c08 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5063=['save','emit','hasOwnProperty','exports','events','OpenchannelMessage'];(function(_0x31f618,_0x58f798){var _0x489ff0=function(_0x1dea55){while(--_0x1dea55){_0x31f618['push'](_0x31f618['shift']());}};_0x489ff0(++_0x58f798);}(_0x5063,0xd0));var _0x3506=function(_0x25174a,_0x3af9fb){_0x25174a=_0x25174a-0x0;var _0xfa187a=_0x5063[_0x25174a];return _0xfa187a;};'use strict';var EventEmitter=require(_0x3506('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3506('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3506('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28399d){return function(_0x160b57,_0xb7df5f,_0x2756ff){OpenchannelMessageEvents['emit'](_0x28399d+':'+_0x160b57['id'],_0x160b57);OpenchannelMessageEvents[_0x3506('0x3')](_0x28399d,_0x160b57);_0x2756ff(null);};}for(var e in events){if(events[_0x3506('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x3506('0x5')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xf274=['exports','../../mysqldb','save','update','remove','emit','hook'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xf274,0x1dd));var _0x4f27=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xf274[_0x2f45ea];return _0x485a84;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x4f27('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f27('0x1'),'afterUpdate':_0x4f27('0x2'),'afterDestroy':_0x4f27('0x3')};function emitEvent(_0x4f9a3c){return function(_0xe57755,_0xd06f46,_0x30e40c){OpenchannelMessageEvents[_0x4f27('0x4')](_0x4f9a3c+':'+_0xe57755['id'],_0xe57755);OpenchannelMessageEvents[_0x4f27('0x4')](_0x4f9a3c,_0xe57755);_0x30e40c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x4f27('0x5')](e,emitEvent(event));}}module[_0x4f27('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 55c004f..f858283 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','OpenchannelMessage'];(function(_0x27407e,_0xae870f){var _0x23d9f4=function(_0x5634f2){while(--_0x5634f2){_0x27407e['push'](_0x27407e['shift']());}};_0x23d9f4(++_0xae870f);}(_0x1a85,0x178));var _0x51a8=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x1a85[_0x176329];return _0x31997c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x51a8('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56e1b4,_0x39e06a,_0x2f276b){var _0x1a476d=_0x4b76a8[_0x51a8('0xa')];var _0x418f06=_0x56e1b4[_0x51a8('0xb')]({'plain':!![]});if(_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()==='in'||_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]&&!_[_0x51a8('0x10')](_0x418f06[_0x51a8('0x11')])){_0x1a476d[_0x51a8('0x12')][_0x51a8('0x13')]({'where':{'id':_0x418f06[_0x51a8('0x14')]}})['then'](function(_0x461f5c){if(_0x461f5c){_0x461f5c[_0x51a8('0x15')]({'lastMsgAt':_0x418f06[_0x51a8('0x16')],'lastMsgDirection':_0x418f06['direction'][_0x51a8('0xd')]()});}})['catch'](function(_0x10584b){console[_0x51a8('0x17')](_0x10584b);});}if(_0x418f06[_0x51a8('0xc')]===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]){var _0x3e0603;_0x1a476d[_0x51a8('0x18')]['describe']()[_0x51a8('0x19')](function(_0x45a433){return _0x1a476d[_0x51a8('0x1a')][_0x51a8('0x1b')]({'where':{'id':_0x418f06[_0x51a8('0x1c')]},'include':[{'model':_0x1a476d[_0x51a8('0x12')],'as':'Interactions','where':{'id':_0x418f06[_0x51a8('0x14')]},'limit':0x1,'include':[{'model':_0x1a476d[_0x51a8('0x18')],'as':_0x51a8('0x1d'),'attributes':_[_0x51a8('0x1e')](_0x45a433)}]}]});})[_0x51a8('0x19')](function(_0x3bc044){_0x3e0603=_0x3bc044[_0x51a8('0xb')]({'plain':!![]});if(_0x3e0603&&_0x3e0603[_0x51a8('0x1f')]){logger['info'](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x21')](_0x51a8('0x22'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0x3e0603[_0x51a8('0x23')]&&_0x3e0603['Interactions'][_0x51a8('0x24')]){_0x418f06['Interaction']=_['omit'](_0x3e0603[_0x51a8('0x23')][0x0],'Contact');_0x418f06[_0x51a8('0x1d')]=_0x3e0603[_0x51a8('0x23')][0x0][_0x51a8('0x1d')];}var _0x39e06a={'method':_0x51a8('0x25'),'uri':encodeURI(_0x3e0603[_0x51a8('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x39e06a[_0x51a8('0x26')]){case _0x51a8('0x27'):_0x39e06a['qs']=_0x418f06;break;case'POST':_0x39e06a[_0x51a8('0x9')]=_0x418f06;break;}return rp(_0x39e06a)[_0x51a8('0x19')](function(_0xca5746){logger[_0x51a8('0x28')](_0x51a8('0x20'),_0x51a8('0x29'),util[_0x51a8('0x21')](_0x51a8('0x2a'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]&&_0xca5746[_0x51a8('0x9')]['threadId']!=_0x418f06[_0x51a8('0x2c')]['threadId']){return _0x1a476d[_0x51a8('0x12')][_0x51a8('0x15')]({'threadId':_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]},{'logging':!![],'where':{'id':_0x418f06[_0x51a8('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x56e1b4[_0x51a8('0x15')]({'read':!![]});})['catch'](function(_0x41c4de){logger[_0x51a8('0x17')](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x2d')](_0x41c4de,{'showHidden':![],'depth':null}));_0x2f276b();});}else{_0x2f276b();}})['finally'](function(){_0x2f276b();});}else{_0x2f276b();}}},'charset':_0x51a8('0x2e'),'collate':_0x51a8('0x2f')});}; \ No newline at end of file +var _0x80ed=['find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','then','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','GET','info','OpenchannelMessage,\x20%s,\x20%s','threadId','Interaction','OpenchannelInteraction','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','update','createdAt','error','CmContact','describe','OpenchannelAccount'];(function(_0x1a55c5,_0x4949a8){var _0x5eeeb2=function(_0x567038){while(--_0x567038){_0x1a55c5['push'](_0x1a55c5['shift']());}};_0x5eeeb2(++_0x4949a8);}(_0x80ed,0x11c));var _0xd80e=function(_0x1e64e9,_0x198ece){_0x1e64e9=_0x1e64e9-0x0;var _0x1a22c9=_0x80ed[_0x1e64e9];return _0x1a22c9;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[{'name':_0xd80e('0xb'),'fields':[_0xd80e('0xc')],'type':_0xd80e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x298c29,_0x3063ff,_0x2457f5){var _0x68625=_0x2b4742[_0xd80e('0xe')];var _0x4eee08=_0x298c29[_0xd80e('0xf')]({'plain':!![]});if(_0x4eee08[_0xd80e('0x10')][_0xd80e('0x11')]()==='in'||_0x4eee08[_0xd80e('0x10')][_0xd80e('0x11')]()===_0xd80e('0x12')&&!_0x4eee08[_0xd80e('0x13')]&&!_[_0xd80e('0x14')](_0x4eee08[_0xd80e('0x15')])){_0x68625['OpenchannelInteraction']['findOne']({'where':{'id':_0x4eee08['OpenchannelInteractionId']}})['then'](function(_0x145766){if(_0x145766){_0x145766[_0xd80e('0x16')]({'lastMsgAt':_0x4eee08[_0xd80e('0x17')],'lastMsgDirection':_0x4eee08[_0xd80e('0x10')][_0xd80e('0x11')]()});}})['catch'](function(_0x595683){console[_0xd80e('0x18')](_0x595683);});}if(_0x4eee08[_0xd80e('0x10')]===_0xd80e('0x12')&&!_0x4eee08[_0xd80e('0x13')]){var _0xc25d82;_0x68625[_0xd80e('0x19')][_0xd80e('0x1a')]()['then'](function(_0x21ceec){return _0x68625[_0xd80e('0x1b')][_0xd80e('0x1c')]({'where':{'id':_0x4eee08[_0xd80e('0x1d')]},'include':[{'model':_0x68625['OpenchannelInteraction'],'as':_0xd80e('0x1e'),'where':{'id':_0x4eee08[_0xd80e('0x1f')]},'limit':0x1,'include':[{'model':_0x68625[_0xd80e('0x19')],'as':'Contact','attributes':_[_0xd80e('0x20')](_0x21ceec)}]}]});})[_0xd80e('0x21')](function(_0x2765ea){_0xc25d82=_0x2765ea[_0xd80e('0xf')]({'plain':!![]});if(_0xc25d82&&_0xc25d82[_0xd80e('0x22')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xd80e('0x23'),util[_0xd80e('0x24')](_0xd80e('0x25'),_0x4eee08['id'],_0xc25d82[_0xd80e('0x22')]));if(_0xc25d82[_0xd80e('0x1e')]&&_0xc25d82[_0xd80e('0x1e')][_0xd80e('0x26')]){_0x4eee08['Interaction']=_[_0xd80e('0x27')](_0xc25d82[_0xd80e('0x1e')][0x0],_0xd80e('0x28'));_0x4eee08['Contact']=_0xc25d82[_0xd80e('0x1e')][0x0][_0xd80e('0x28')];}var _0x3063ff={'method':'POST','uri':encodeURI(_0xc25d82['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3063ff['method']){case _0xd80e('0x29'):_0x3063ff['qs']=_0x4eee08;break;case'POST':_0x3063ff[_0xd80e('0xc')]=_0x4eee08;break;}return rp(_0x3063ff)[_0xd80e('0x21')](function(_0x4e8ed9){logger[_0xd80e('0x2a')](_0xd80e('0x2b'),_0xd80e('0x23'),util[_0xd80e('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4eee08['id'],_0xc25d82[_0xd80e('0x22')]));if(_0x4e8ed9[_0xd80e('0xc')][_0xd80e('0x2c')]&&_0x4e8ed9[_0xd80e('0xc')][_0xd80e('0x2c')]!=_0x4eee08[_0xd80e('0x2d')][_0xd80e('0x2c')]){return _0x68625[_0xd80e('0x2e')]['update']({'threadId':_0x4e8ed9['body'][_0xd80e('0x2c')]},{'logging':!![],'where':{'id':_0x4eee08[_0xd80e('0x2d')]['id']}});}else{return;}})[_0xd80e('0x21')](function(){return _0x298c29[_0xd80e('0x16')]({'read':!![]});})[_0xd80e('0x2f')](function(_0x44b440){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xd80e('0x23'),util[_0xd80e('0x30')](_0x44b440,{'showHidden':![],'depth':null}));_0x2457f5();});}else{_0x2457f5();}})[_0xd80e('0x31')](function(){_0x2457f5();});}else{_0x2457f5();}}},'charset':_0xd80e('0x32'),'collate':_0xd80e('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a2af83c..cc63626 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48ba32,_0x342f7c){var _0x48eb53=function(_0x45a499){while(--_0x45a499){_0x48ba32['push'](_0x48ba32['shift']());}};_0x48eb53(++_0x342f7c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ed7aa,_0xa41adc){_0x4ed7aa=_0x4ed7aa-0x0;var _0x2380c5=_0x5f2f[_0x4ed7aa];return _0x2380c5;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xdf4261,_0x2e7cac){var _0x4a1502=function(_0x3b02a1){while(--_0x3b02a1){_0xdf4261['push'](_0xdf4261['shift']());}};_0x4a1502(++_0x2e7cac);}(_0x2ef3,0xba));var _0x32ef=function(_0x723452,_0xda1dc8){_0x723452=_0x723452-0x0;var _0x464908=_0x2ef3[_0x723452];return _0x464908;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d516969..af3c2f2 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02b6=['length','openchannelMessage:','./openchannelMessage.events','remove','update','emit','removeListener'];(function(_0x383d05,_0x17f85b){var _0x44745f=function(_0x3c9461){while(--_0x3c9461){_0x383d05['push'](_0x383d05['shift']());}};_0x44745f(++_0x17f85b);}(_0x02b6,0xfe));var _0x602b=function(_0x4ed0d9,_0x5bb2ba){_0x4ed0d9=_0x4ed0d9-0x0;var _0x394d9c=_0x02b6[_0x4ed0d9];return _0x394d9c;};'use strict';var OpenchannelMessageEvents=require(_0x602b('0x0'));var events=['save',_0x602b('0x1'),_0x602b('0x2')];function createListener(_0x295d72,_0x4ec4d5){return function(_0x57c7b5){_0x4ec4d5[_0x602b('0x3')](_0x295d72,_0x57c7b5);};}function removeListener(_0x31f4a4,_0x33cc82){return function(){OpenchannelMessageEvents[_0x602b('0x4')](_0x31f4a4,_0x33cc82);};}exports['register']=function(_0x175178){for(var _0x51b9b7=0x0,_0x265e3b=events[_0x602b('0x5')];_0x51b9b7<_0x265e3b;_0x51b9b7++){var _0x140c8a=events[_0x51b9b7];var _0x1edb2d=createListener(_0x602b('0x6')+_0x140c8a,_0x175178);OpenchannelMessageEvents['on'](_0x140c8a,_0x1edb2d);}}; \ No newline at end of file +var _0x2a56=['save','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x5699c0,_0x16c7c2){var _0x1f67b1=function(_0x49c64d){while(--_0x49c64d){_0x5699c0['push'](_0x5699c0['shift']());}};_0x1f67b1(++_0x16c7c2);}(_0x2a56,0xaf));var _0x62a5=function(_0xc7159a,_0x407792){_0xc7159a=_0xc7159a-0x0;var _0x63bb06=_0x2a56[_0xc7159a];return _0x63bb06;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x62a5('0x0'),'remove',_0x62a5('0x1')];function createListener(_0x236dfe,_0x6ce1ef){return function(_0x315f00){_0x6ce1ef[_0x62a5('0x2')](_0x236dfe,_0x315f00);};}function removeListener(_0x4d2fa7,_0x280fad){return function(){OpenchannelMessageEvents[_0x62a5('0x3')](_0x4d2fa7,_0x280fad);};}exports[_0x62a5('0x4')]=function(_0x40bd58){for(var _0x19444d=0x0,_0x206ee4=events[_0x62a5('0x5')];_0x19444d<_0x206ee4;_0x19444d++){var _0x22ae0d=events[_0x19444d];var _0x4b376d=createListener(_0x62a5('0x6')+_0x22ae0d,_0x40bd58);OpenchannelMessageEvents['on'](_0x22ae0d,_0x4b376d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 31719c5..8a70557 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4f6=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','delete','removeAgents'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa4f6,0xe0));var _0x6a4f=function(_0x5b318b,_0x4047aa){_0x5b318b=_0x5b318b-0x0;var _0x323b59=_0xa4f6[_0x5b318b];return _0x323b59;};'use strict';var multer=require(_0x6a4f('0x0'));var util=require(_0x6a4f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6a4f('0x2')]();var fs_extra=require(_0x6a4f('0x3'));var auth=require(_0x6a4f('0x4'));var interaction=require(_0x6a4f('0x5'));var config=require(_0x6a4f('0x6'));var controller=require(_0x6a4f('0x7'));router[_0x6a4f('0x8')]('/',auth[_0x6a4f('0x9')](),controller[_0x6a4f('0xa')]);router[_0x6a4f('0x8')](_0x6a4f('0xb'),auth[_0x6a4f('0x9')](),controller['describe']);router['get'](_0x6a4f('0xc'),auth['isAuthenticated'](),controller[_0x6a4f('0xd')]);router[_0x6a4f('0x8')](_0x6a4f('0xe'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0xf')]);router[_0x6a4f('0x8')](_0x6a4f('0x10'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x11')]);router[_0x6a4f('0x8')](_0x6a4f('0x12'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x13')]);router[_0x6a4f('0x14')]('/',auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x15')]);router['post'](_0x6a4f('0x10'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x16')]);router[_0x6a4f('0x14')]('/:id/users',auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x17')]);router['put']('/:id',auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x18')]);router['delete'](_0x6a4f('0xc'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x19')]);router['delete'](_0x6a4f('0x10'),auth[_0x6a4f('0x9')](),controller['removeTeams']);router[_0x6a4f('0x1a')](_0x6a4f('0x12'),auth[_0x6a4f('0x9')](),controller[_0x6a4f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3186=['./openchannelQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3186,0x97));var _0x6318=function(_0x25512e,_0x2962b1){_0x25512e=_0x25512e-0x0;var _0x396a94=_0x3186[_0x25512e];return _0x396a94;};'use strict';var multer=require(_0x6318('0x0'));var util=require(_0x6318('0x1'));var path=require(_0x6318('0x2'));var timeout=require('connect-timeout');var express=require(_0x6318('0x3'));var router=express[_0x6318('0x4')]();var fs_extra=require(_0x6318('0x5'));var auth=require(_0x6318('0x6'));var interaction=require(_0x6318('0x7'));var config=require(_0x6318('0x8'));var controller=require(_0x6318('0x9'));router['get']('/',auth[_0x6318('0xa')](),controller[_0x6318('0xb')]);router[_0x6318('0xc')](_0x6318('0xd'),auth[_0x6318('0xa')](),controller['describe']);router['get'](_0x6318('0xe'),auth['isAuthenticated'](),controller[_0x6318('0xf')]);router['get'](_0x6318('0x10'),auth['isAuthenticated'](),controller[_0x6318('0x11')]);router['get'](_0x6318('0x12'),auth[_0x6318('0xa')](),controller[_0x6318('0x13')]);router[_0x6318('0xc')](_0x6318('0x14'),auth['isAuthenticated'](),controller[_0x6318('0x15')]);router[_0x6318('0x16')]('/',auth[_0x6318('0xa')](),controller[_0x6318('0x17')]);router[_0x6318('0x16')](_0x6318('0x12'),auth[_0x6318('0xa')](),controller['addTeams']);router[_0x6318('0x16')](_0x6318('0x14'),auth[_0x6318('0xa')](),controller[_0x6318('0x18')]);router[_0x6318('0x19')](_0x6318('0xe'),auth[_0x6318('0xa')](),controller[_0x6318('0x1a')]);router[_0x6318('0x1b')](_0x6318('0xe'),auth[_0x6318('0xa')](),controller[_0x6318('0x1c')]);router[_0x6318('0x1b')]('/:id/teams',auth[_0x6318('0xa')](),controller[_0x6318('0x1d')]);router[_0x6318('0x1b')]('/:id/users',auth[_0x6318('0xa')](),controller[_0x6318('0x1e')]);module[_0x6318('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 3dc592a..c2aad65 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe933=['ENUM','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x5e902f,_0x29f01e){var _0x8e7bfa=function(_0x25ba8d){while(--_0x25ba8d){_0x5e902f['push'](_0x5e902f['shift']());}};_0x8e7bfa(++_0x29f01e);}(_0xe933,0xa4));var _0x3e93=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xe933[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module[_0x3e93('0x0')]={'name':{'type':Sequelize[_0x3e93('0x1')],'unique':_0x3e93('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e93('0x1')]},'timeout':{'type':Sequelize[_0x3e93('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e93('0x4')]('rrmemory',_0x3e93('0x5'),_0x3e93('0x6'))}}; \ No newline at end of file +var _0xfe4c=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x359806,_0x418a8a){var _0x40b7c3=function(_0x484cfc){while(--_0x484cfc){_0x359806['push'](_0x359806['shift']());}};_0x40b7c3(++_0x418a8a);}(_0xfe4c,0x142));var _0xcfe4=function(_0x390f24,_0x47fc0c){_0x390f24=_0x390f24-0x0;var _0x349486=_0xfe4c[_0x390f24];return _0x349486;};'use strict';var Sequelize=require(_0xcfe4('0x0'));module[_0xcfe4('0x1')]={'name':{'type':Sequelize[_0xcfe4('0x2')],'unique':_0xcfe4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcfe4('0x2')]},'timeout':{'type':Sequelize[_0xcfe4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfe4('0x5')](_0xcfe4('0x6'),_0xcfe4('0x7'),_0xcfe4('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5b500fc..d005bd6 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa026=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','index','map','OpenchannelQueue','rawAttributes','type','key','model','query','fields','attributes','length','hasOwnProperty','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','intersection','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserOpenchannelQueue','order','sort','OpenchannelQueueId','options','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','ids','select','field','tq.TeamId','from','join'];(function(_0x498b81,_0x1089d6){var _0x3424b8=function(_0x1bd8eb){while(--_0x1bd8eb){_0x498b81['push'](_0x498b81['shift']());}};_0x3424b8(++_0x1089d6);}(_0xa026,0x13b));var _0x6a02=function(_0x465e1c,_0xdff365){_0x465e1c=_0x465e1c-0x0;var _0xb35dda=_0xa026[_0x465e1c];return _0xb35dda;};'use strict';var emlformat=require(_0x6a02('0x0'));var rimraf=require(_0x6a02('0x1'));var zipdir=require(_0x6a02('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a02('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a02('0x4'));var util=require(_0x6a02('0x5'));var path=require('path');var sox=require(_0x6a02('0x6'));var csv=require(_0x6a02('0x7'));var ejs=require(_0x6a02('0x8'));var fs=require('fs');var fs_extra=require(_0x6a02('0x9'));var _=require(_0x6a02('0xa'));var squel=require(_0x6a02('0xb'));var crypto=require(_0x6a02('0xc'));var jsforce=require(_0x6a02('0xd'));var deskjs=require(_0x6a02('0xe'));var toCsv=require(_0x6a02('0x7'));var querystring=require('querystring');var Papa=require(_0x6a02('0xf'));var Redis=require(_0x6a02('0x10'));var authService=require(_0x6a02('0x11'));var qs=require(_0x6a02('0x12'));var as=require(_0x6a02('0x13'));var hardwareService=require(_0x6a02('0x14'));var logger=require('../../config/logger')(_0x6a02('0x15'));var utils=require(_0x6a02('0x16'));var config=require(_0x6a02('0x17'));var licenseUtil=require(_0x6a02('0x18'));var db=require(_0x6a02('0x19'))['db'];config[_0x6a02('0x1a')]=_[_0x6a02('0x1b')](config['redis'],{'host':_0x6a02('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a02('0x1a')]));require('./openchannelQueue.socket')[_0x6a02('0x1d')](socket);function respondWithStatusCode(_0x29d6c8,_0x968adb){_0x968adb=_0x968adb||0xcc;return function(_0x5b516c){if(_0x5b516c){return _0x29d6c8[_0x6a02('0x1e')](_0x968adb);}return _0x29d6c8['status'](_0x968adb)[_0x6a02('0x1f')]();};}function respondWithResult(_0x53c52d,_0x517777){_0x517777=_0x517777||0xc8;return function(_0x827107){if(_0x827107){return _0x53c52d[_0x6a02('0x20')](_0x517777)[_0x6a02('0x21')](_0x827107);}};}function respondWithFilteredResult(_0x1e378c,_0xea8b1e){return function(_0x2d2235){if(_0x2d2235){var _0x11a063=typeof _0xea8b1e[_0x6a02('0x22')]===_0x6a02('0x23')&&typeof _0xea8b1e[_0x6a02('0x24')]===_0x6a02('0x23');var _0x9b24f=_0x2d2235[_0x6a02('0x25')];var _0x432b11=_0x11a063?0x0:_0xea8b1e[_0x6a02('0x22')];var _0x5d89d9=_0x11a063?_0x2d2235[_0x6a02('0x25')]:_0xea8b1e['offset']+_0xea8b1e[_0x6a02('0x24')];var _0x8d5a50;if(_0x5d89d9>=_0x9b24f){_0x5d89d9=_0x9b24f;_0x8d5a50=0xc8;}else{_0x8d5a50=0xce;}_0x1e378c[_0x6a02('0x20')](_0x8d5a50);return _0x1e378c[_0x6a02('0x26')]('Content-Range',_0x432b11+'-'+_0x5d89d9+'/'+_0x9b24f)[_0x6a02('0x21')](_0x2d2235);}return null;};}function patchUpdates(_0xf451ae){return function(_0x2a7591){try{jsonpatch[_0x6a02('0x27')](_0x2a7591,_0xf451ae,!![]);}catch(_0x3cbed6){return BPromise['reject'](_0x3cbed6);}return _0x2a7591[_0x6a02('0x28')]();};}function saveUpdates(_0x47f70d,_0x24927d){return function(_0x50d4d2){if(_0x50d4d2){return _0x50d4d2[_0x6a02('0x29')](_0x47f70d)[_0x6a02('0x2a')](function(_0x553d7a){return _0x553d7a;});}return null;};}function removeEntity(_0x1a49d8,_0x42d70a){return function(_0x3359f3){if(_0x3359f3){return _0x3359f3['destroy']()[_0x6a02('0x2a')](function(){var _0x1172ab=_0x3359f3[_0x6a02('0x2b')]({'plain':!![]});var _0x44184a=_0x6a02('0x2c');return db[_0x6a02('0x2d')][_0x6a02('0x2e')]({'where':{'type':_0x44184a,'resourceId':_0x1172ab['id']}})[_0x6a02('0x2a')](function(){return _0x3359f3;});})[_0x6a02('0x2a')](function(){_0x1a49d8[_0x6a02('0x20')](0xcc)[_0x6a02('0x1f')]();});}};}function handleEntityNotFound(_0xaf2721,_0x3ae3a9){return function(_0x5eab4c){if(!_0x5eab4c){_0xaf2721[_0x6a02('0x1e')](0x194);}return _0x5eab4c;};}function handleError(_0x52a6ad,_0x48bb87){_0x48bb87=_0x48bb87||0x1f4;return function(_0x18ee05){logger[_0x6a02('0x2f')](_0x18ee05[_0x6a02('0x30')]);if(_0x18ee05[_0x6a02('0x31')]){delete _0x18ee05[_0x6a02('0x31')];}_0x52a6ad['status'](_0x48bb87)['send'](_0x18ee05);};}exports[_0x6a02('0x32')]=function(_0x4cbe24,_0x182f67){var _0x9b6037={},_0x1ff339={},_0x56d990={'count':0x0,'rows':[]};var _0x21c736=_[_0x6a02('0x33')](db[_0x6a02('0x34')][_0x6a02('0x35')],function(_0x924763){return{'name':_0x924763['fieldName'],'type':_0x924763[_0x6a02('0x36')][_0x6a02('0x37')]};});_0x1ff339[_0x6a02('0x38')]=_['map'](_0x21c736,'name');_0x1ff339[_0x6a02('0x39')]=_['keys'](_0x4cbe24['query']);_0x1ff339['filters']=_['intersection'](_0x1ff339['model'],_0x1ff339[_0x6a02('0x39')]);_0x9b6037['attributes']=_['intersection'](_0x1ff339['model'],qs[_0x6a02('0x3a')](_0x4cbe24[_0x6a02('0x39')]['fields']));_0x9b6037[_0x6a02('0x3b')]=_0x9b6037['attributes'][_0x6a02('0x3c')]?_0x9b6037[_0x6a02('0x3b')]:_0x1ff339['model'];if(!_0x4cbe24[_0x6a02('0x39')][_0x6a02('0x3d')]('nolimit')){_0x9b6037[_0x6a02('0x24')]=qs[_0x6a02('0x24')](_0x4cbe24[_0x6a02('0x39')][_0x6a02('0x24')]);_0x9b6037['offset']=qs[_0x6a02('0x22')](_0x4cbe24['query']['offset']);}_0x9b6037['order']=qs['sort'](_0x4cbe24[_0x6a02('0x39')]['sort']);_0x9b6037['where']=qs[_0x6a02('0x3e')](_[_0x6a02('0x3f')](_0x4cbe24[_0x6a02('0x39')],_0x1ff339[_0x6a02('0x3e')]),_0x21c736);if(_0x4cbe24['query'][_0x6a02('0x40')]){_0x9b6037[_0x6a02('0x41')]=_[_0x6a02('0x42')](_0x9b6037[_0x6a02('0x41')],{'$or':_['map'](_0x21c736,function(_0x21ae3a){if(_0x21ae3a['type']!==_0x6a02('0x43')){var _0xb44729={};_0xb44729[_0x21ae3a[_0x6a02('0x31')]]={'$like':'%'+_0x4cbe24['query']['filter']+'%'};return _0xb44729;}})});}_0x9b6037=_['merge']({},_0x9b6037,_0x4cbe24['options']);var _0x3c0694={'where':_0x9b6037[_0x6a02('0x41')]};return db['OpenchannelQueue'][_0x6a02('0x25')](_0x3c0694)[_0x6a02('0x2a')](function(_0x14a2b8){_0x56d990[_0x6a02('0x25')]=_0x14a2b8;if(_0x4cbe24[_0x6a02('0x39')][_0x6a02('0x44')]){_0x9b6037[_0x6a02('0x45')]=[{'all':!![]}];}return db[_0x6a02('0x34')][_0x6a02('0x46')](_0x9b6037);})[_0x6a02('0x2a')](function(_0x53d275){_0x56d990['rows']=_0x53d275;return _0x56d990;})['then'](respondWithFilteredResult(_0x182f67,_0x9b6037))[_0x6a02('0x47')](handleError(_0x182f67,null));};exports[_0x6a02('0x48')]=function(_0x2e3ac8,_0x19812){var _0x3d063e={'raw':!![],'where':{'id':_0x2e3ac8['params']['id']}},_0x333f10={};_0x333f10[_0x6a02('0x38')]=_['keys'](db[_0x6a02('0x34')][_0x6a02('0x35')]);_0x333f10['query']=_[_0x6a02('0x49')](_0x2e3ac8['query']);_0x333f10[_0x6a02('0x3e')]=_[_0x6a02('0x4a')](_0x333f10[_0x6a02('0x38')],_0x333f10[_0x6a02('0x39')]);_0x3d063e[_0x6a02('0x3b')]=_[_0x6a02('0x4a')](_0x333f10[_0x6a02('0x38')],qs[_0x6a02('0x3a')](_0x2e3ac8['query'][_0x6a02('0x3a')]));_0x3d063e[_0x6a02('0x3b')]=_0x3d063e[_0x6a02('0x3b')][_0x6a02('0x3c')]?_0x3d063e[_0x6a02('0x3b')]:_0x333f10['model'];if(_0x2e3ac8[_0x6a02('0x39')][_0x6a02('0x44')]){_0x3d063e[_0x6a02('0x45')]=[{'all':!![]}];}_0x3d063e=_[_0x6a02('0x42')]({},_0x3d063e,_0x2e3ac8['options']);return db[_0x6a02('0x34')]['find'](_0x3d063e)[_0x6a02('0x2a')](handleEntityNotFound(_0x19812,null))[_0x6a02('0x2a')](respondWithResult(_0x19812,null))[_0x6a02('0x47')](handleError(_0x19812,null));};exports['create']=function(_0x32bf3d,_0x56ce03){return db[_0x6a02('0x34')][_0x6a02('0x4b')](_0x32bf3d[_0x6a02('0x4c')],{})[_0x6a02('0x2a')](function(_0x1e2058){var _0x5943cf=_0x32bf3d[_0x6a02('0x4d')][_0x6a02('0x2b')]({'plain':!![]});if(!_0x5943cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5943cf[_0x6a02('0x4e')]==='user'){var _0x4a28d4=_0x1e2058[_0x6a02('0x2b')]({'plain':!![]});var _0xb10b0a=_0x6a02('0x2c');return db[_0x6a02('0x4f')][_0x6a02('0x50')]({'where':{'name':_0xb10b0a,'userProfileId':_0x5943cf[_0x6a02('0x51')]},'raw':!![]})[_0x6a02('0x2a')](function(_0x45030e){if(_0x45030e&&_0x45030e[_0x6a02('0x52')]===0x0){return db[_0x6a02('0x2d')]['create']({'name':_0x4a28d4['name'],'resourceId':_0x4a28d4['id'],'type':_0x45030e[_0x6a02('0x31')],'sectionId':_0x45030e['id']},{})[_0x6a02('0x2a')](function(){return _0x1e2058;});}else{return _0x1e2058;}})[_0x6a02('0x47')](function(_0x5cc27d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cc27d);throw _0x5cc27d;});}return _0x1e2058;})[_0x6a02('0x2a')](respondWithResult(_0x56ce03,0xc9))['catch'](handleError(_0x56ce03,null));};exports[_0x6a02('0x29')]=function(_0x3fb663,_0x38a997){if(_0x3fb663['body']['id']){delete _0x3fb663[_0x6a02('0x4c')]['id'];}return db[_0x6a02('0x34')][_0x6a02('0x50')]({'where':{'id':_0x3fb663[_0x6a02('0x53')]['id']}})['then'](handleEntityNotFound(_0x38a997,null))[_0x6a02('0x2a')](saveUpdates(_0x3fb663[_0x6a02('0x4c')],null))[_0x6a02('0x2a')](respondWithResult(_0x38a997,null))[_0x6a02('0x47')](handleError(_0x38a997,null));};exports['destroy']=function(_0x5236f3,_0x4923f7){return db['OpenchannelQueue'][_0x6a02('0x50')]({'where':{'id':_0x5236f3['params']['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x4923f7,null))[_0x6a02('0x2a')](removeEntity(_0x4923f7,null))[_0x6a02('0x47')](handleError(_0x4923f7,null));};exports[_0x6a02('0x54')]=function(_0x1546d3,_0x1fa1c9){return db[_0x6a02('0x34')][_0x6a02('0x54')]()['then'](respondWithResult(_0x1fa1c9,null))['catch'](handleError(_0x1fa1c9,null));};exports[_0x6a02('0x55')]=function(_0x50bccc,_0x94fd63,_0x5cf341){var _0x10fbac={'raw':!![],'where':{}},_0x868c8d={},_0xfbafd;return db[_0x6a02('0x34')][_0x6a02('0x56')]({'where':{'id':_0x50bccc['params']['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x94fd63,null))[_0x6a02('0x2a')](function(_0x18ed50){if(_0x18ed50){_0xfbafd=_0x18ed50[_0x6a02('0x2b')]({'plain':!![]});_0x868c8d[_0x6a02('0x38')]=_['keys'](db[_0x6a02('0x57')][_0x6a02('0x35')]);_0x868c8d[_0x6a02('0x39')]=_[_0x6a02('0x49')](_0x50bccc['query']);_0x868c8d[_0x6a02('0x3e')]=_[_0x6a02('0x4a')](_0x868c8d['model'],_0x868c8d['query']);_0x10fbac[_0x6a02('0x3b')]=_[_0x6a02('0x4a')](_0x868c8d['model'],qs[_0x6a02('0x3a')](_0x50bccc['query']['fields']));_0x10fbac['attributes']=_0x10fbac[_0x6a02('0x3b')][_0x6a02('0x3c')]?_0x10fbac['attributes']:_0x868c8d[_0x6a02('0x38')];if(!_0x50bccc[_0x6a02('0x39')][_0x6a02('0x3d')]('nolimit')){_0x10fbac[_0x6a02('0x24')]=qs[_0x6a02('0x24')](_0x50bccc[_0x6a02('0x39')][_0x6a02('0x24')]);_0x10fbac[_0x6a02('0x22')]=qs['offset'](_0x50bccc['query'][_0x6a02('0x22')]);}_0x10fbac[_0x6a02('0x58')]=qs[_0x6a02('0x59')](_0x50bccc[_0x6a02('0x39')][_0x6a02('0x59')]);_0x10fbac['where']=qs['filters'](_[_0x6a02('0x3f')](_0x50bccc['query'],_0x868c8d['filters']));_0x10fbac[_0x6a02('0x41')][_0x6a02('0x5a')]=_0x18ed50['id'];if(_0x50bccc['query'][_0x6a02('0x40')]){_0x10fbac[_0x6a02('0x41')]=_['merge'](_0x10fbac[_0x6a02('0x41')],{'$or':_[_0x6a02('0x33')](_0x10fbac[_0x6a02('0x3b')],function(_0x432f8b){var _0x4c5c44={};_0x4c5c44[_0x432f8b]={'$like':'%'+_0x50bccc[_0x6a02('0x39')][_0x6a02('0x40')]+'%'};return _0x4c5c44;})});}_0x10fbac=_[_0x6a02('0x42')]({},_0x10fbac,_0x50bccc[_0x6a02('0x5b')]);return db[_0x6a02('0x57')][_0x6a02('0x46')](_0x10fbac);}})[_0x6a02('0x2a')](function(_0xa1d7ba){if(_0xa1d7ba){return db['User'][_0x6a02('0x5c')]({'where':{'id':_[_0x6a02('0x33')](_0xa1d7ba,_0x6a02('0x5d')),'role':_0x6a02('0x5e')},'attributes':['id',_0x6a02('0x31'),_0x6a02('0x5f'),_0x6a02('0x60'),_0x6a02('0x61')]});}})['then'](function(_0x1f00d4){if(_0x1f00d4){return{'count':_0x1f00d4[_0x6a02('0x25')],'rows':_[_0x6a02('0x33')](_0x1f00d4['rows'],function(_0x51c949){return{'membername':_0x51c949[_0x6a02('0x31')],'UserId':_0x51c949['id'],'queue_name':_0xfbafd['name'],'OpenchannelQueueId':_0xfbafd['id'],'interface':util[_0x6a02('0x62')](_0x6a02('0x63'),_0x6a02('0x64'),_0x51c949[_0x6a02('0x31')]),'penalty':0x0,'paused':_0x51c949['openchannelPause'],'createdAt':_0x51c949[_0x6a02('0x61')],'updatedAt':_0x51c949[_0x6a02('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x94fd63,_0x10fbac))['catch'](handleError(_0x94fd63,null));};exports[_0x6a02('0x65')]=function(_0x17d435,_0x48c495,_0x4737f7){var _0x253b26={};var _0x391d7d={};var _0x28cf6a;var _0x39d036;return db[_0x6a02('0x34')][_0x6a02('0x56')]({'where':{'id':_0x17d435[_0x6a02('0x53')]['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x48c495,null))[_0x6a02('0x2a')](function(_0xdf203e){if(_0xdf203e){_0x28cf6a=_0xdf203e;_0x391d7d[_0x6a02('0x38')]=_[_0x6a02('0x49')](db['Team']['rawAttributes']);_0x391d7d['query']=_[_0x6a02('0x49')](_0x17d435[_0x6a02('0x39')]);_0x391d7d[_0x6a02('0x3e')]=_['intersection'](_0x391d7d[_0x6a02('0x38')],_0x391d7d[_0x6a02('0x39')]);_0x253b26[_0x6a02('0x3b')]=_['intersection'](_0x391d7d[_0x6a02('0x38')],qs[_0x6a02('0x3a')](_0x17d435['query'][_0x6a02('0x3a')]));_0x253b26['attributes']=_0x253b26['attributes']['length']?_0x253b26[_0x6a02('0x3b')]:_0x391d7d['model'];_0x253b26[_0x6a02('0x58')]=qs['sort'](_0x17d435[_0x6a02('0x39')][_0x6a02('0x59')]);_0x253b26['where']=qs[_0x6a02('0x3e')](_[_0x6a02('0x3f')](_0x17d435[_0x6a02('0x39')],_0x391d7d[_0x6a02('0x3e')]));if(_0x17d435[_0x6a02('0x39')][_0x6a02('0x40')]){_0x253b26[_0x6a02('0x41')]=_['merge'](_0x253b26[_0x6a02('0x41')],{'$or':_[_0x6a02('0x33')](_0x253b26['attributes'],function(_0x5f0622){var _0x11c5d8={};_0x11c5d8[_0x5f0622]={'$like':'%'+_0x17d435[_0x6a02('0x39')][_0x6a02('0x40')]+'%'};return _0x11c5d8;})});}_0x253b26=_[_0x6a02('0x42')]({},_0x253b26,_0x17d435['options']);return _0x28cf6a[_0x6a02('0x65')](_0x253b26);}})[_0x6a02('0x2a')](function(_0x58e271){if(_0x58e271){_0x39d036=_0x58e271[_0x6a02('0x3c')];if(!_0x17d435['query']['hasOwnProperty'](_0x6a02('0x66'))){_0x253b26['limit']=qs[_0x6a02('0x24')](_0x17d435[_0x6a02('0x39')]['limit']);_0x253b26[_0x6a02('0x22')]=qs[_0x6a02('0x22')](_0x17d435[_0x6a02('0x39')]['offset']);}return _0x28cf6a[_0x6a02('0x65')](_0x253b26);}})[_0x6a02('0x2a')](function(_0x282745){if(_0x282745){return _0x282745?{'count':_0x39d036,'rows':_0x282745}:null;}})[_0x6a02('0x2a')](respondWithResult(_0x48c495,null))[_0x6a02('0x47')](handleError(_0x48c495,null));};exports[_0x6a02('0x67')]=function(_0x32faf7,_0x31f401,_0x8872c0){var _0x1b6260=_0x32faf7[_0x6a02('0x4c')]['ids'];return db['Team'][_0x6a02('0x46')]({'where':{'id':_0x1b6260},'attributes':['id'],'include':[{'model':db[_0x6a02('0x68')],'as':_0x6a02('0x69'),'attributes':['id',_0x6a02('0x31'),_0x6a02('0x6a'),_0x6a02('0x6b'),_0x6a02('0x6c')],'raw':!![]}]})[_0x6a02('0x2a')](function(_0x1fcf53){if(_0x1fcf53){var _0x20f17b=_[_0x6a02('0x6d')](_0x1fcf53,function(_0x56a9f1){var _0xc218b7=_0x56a9f1[_0x6a02('0x2b')]({'plain':!![]});return _0xc218b7[_0x6a02('0x69')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x32faf7[_0x6a02('0x53')]['id']}})[_0x6a02('0x2a')](function(_0x538d02){return db[_0x6a02('0x6e')][_0x6a02('0x6f')](function(_0x2ed5f8){return _0x538d02[_0x6a02('0x67')](_0x1b6260,{'transaction':_0x2ed5f8})[_0x6a02('0x2a')](function(){return BPromise[_0x6a02('0x70')](_0x20f17b,function(_0x164ffe){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x164ffe['id'],'OpenchannelQueueId':_0x32faf7['params']['id']},'transaction':_0x2ed5f8});});})['then'](function(){_0x20f17b['forEach'](function(_0x4f4d10){socket[_0x6a02('0x71')]('userOpenchannelQueue:save',{'UserId':_0x4f4d10['id'],'OpenchannelQueueId':_0x538d02['id']});});});});});}})[_0x6a02('0x2a')](respondWithStatusCode(_0x31f401,null))[_0x6a02('0x47')](handleError(_0x31f401,null));};exports['removeTeams']=function(_0xb7ca31,_0x2a4dc8,_0x17f3fa){return db['Team'][_0x6a02('0x46')]({'where':{'id':_0xb7ca31['query'][_0x6a02('0x72')]},'attributes':['id'],'include':[{'model':db[_0x6a02('0x68')],'as':_0x6a02('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6a02('0x2a')](handleEntityNotFound(_0x2a4dc8,null))[_0x6a02('0x2a')](function(_0xa169b){var _0x250d17=_[_0x6a02('0x33')](_0xa169b,'id');var _0x2fd453=[];var _0x37008b=[];var _0x5856a0=squel[_0x6a02('0x73')]();_0x5856a0[_0x6a02('0x74')](_0x6a02('0x75'))[_0x6a02('0x76')]('team_has_openchannel_queues','tq')[_0x6a02('0x77')](_0x6a02('0x78'),'ut',_0x6a02('0x79'))['where'](_0x6a02('0x7a'),_0xb7ca31[_0x6a02('0x53')]['id']);for(var _0x4d1206=0x0;_0x4d1206<_0xa169b[_0x6a02('0x3c')];_0x4d1206+=0x1){let _0x4cc2a2=_0xa169b[_0x4d1206];for(var _0x4a37e7=0x0;_0x4a37e7<_0x4cc2a2[_0x6a02('0x69')][_0x6a02('0x3c')];_0x4a37e7+=0x1){let _0x38bcc7=_0x4cc2a2[_0x6a02('0x69')][_0x4a37e7];var _0xbdbbe9=_0x5856a0[_0x6a02('0x7b')]();_0xbdbbe9[_0x6a02('0x41')](_0x6a02('0x7c'),_0x38bcc7['id']);_0x37008b[_0x6a02('0x7d')](db[_0x6a02('0x6e')][_0x6a02('0x39')](_0xbdbbe9['toString'](),{'type':db[_0x6a02('0x6e')][_0x6a02('0x7e')][_0x6a02('0x7f')]})[_0x6a02('0x2a')](function(_0x20bab2){if(_0x20bab2[_0x6a02('0x3c')]===0x1){return _0x38bcc7['id'];}else{var _0x57435b=_[_0x6a02('0x80')](_['map'](_0x20bab2,_0x6a02('0x81')),function(_0x5b9be4){return _[_0x6a02('0x82')](_0x250d17,_0x5b9be4);});if(_0x57435b){return _0x38bcc7['id'];}}}));}}return BPromise[_0x6a02('0x83')](_0x37008b)[_0x6a02('0x2a')](function(_0x402ef1){_0x2fd453=_(_0x2fd453)[_0x6a02('0x84')](_0x402ef1)[_0x6a02('0x85')]()[_0x6a02('0x86')]();return db['OpenchannelQueue']['find']({'where':{'id':_0xb7ca31['params']['id']}})[_0x6a02('0x2a')](function(_0x40b114){return db[_0x6a02('0x6e')][_0x6a02('0x6f')](function(_0x4b09e8){return _0x40b114[_0x6a02('0x87')](_0xb7ca31[_0x6a02('0x39')]['ids'],{'transaction':_0x4b09e8})[_0x6a02('0x2a')](function(){if(!_[_0x6a02('0x88')](_0x2fd453)){return _0x40b114[_0x6a02('0x89')](_0x2fd453,{'transaction':_0x4b09e8});}})[_0x6a02('0x2a')](function(){_0x2fd453[_0x6a02('0x8a')](function(_0x3aa606){socket[_0x6a02('0x71')](_0x6a02('0x8b'),{'UserId':_0x3aa606,'OpenchannelQueueId':_0x40b114['id']});});});});});});})[_0x6a02('0x2a')](respondWithStatusCode(_0x2a4dc8,null))[_0x6a02('0x47')](handleError(_0x2a4dc8,null));};exports[_0x6a02('0x8c')]=function(_0x425d31,_0x5a651e,_0x76aef){return db[_0x6a02('0x34')]['find']({'where':{'id':_0x425d31['params']['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x5a651e,null))['then'](function(_0x5ef575){if(_0x5ef575){return _0x5ef575[_0x6a02('0x8c')](_0x425d31['body'][_0x6a02('0x72')],_[_0x6a02('0x8d')](_0x425d31['body'],[_0x6a02('0x72'),'id'])||{})['spread'](function(_0x13b458){for(var _0x1d3081=0x0;_0x1d3081<_0x425d31['body'][_0x6a02('0x72')][_0x6a02('0x3c')];_0x1d3081+=0x1){socket[_0x6a02('0x71')](_0x6a02('0x8e'),{'UserId':Number(_0x425d31[_0x6a02('0x4c')][_0x6a02('0x72')][_0x1d3081]),'OpenchannelQueueId':Number(_0x425d31[_0x6a02('0x53')]['id'])});}return _0x13b458;});}})[_0x6a02('0x2a')](respondWithResult(_0x5a651e,null))[_0x6a02('0x47')](handleError(_0x5a651e,null));};exports['removeAgents']=function(_0x4239b6,_0x2f43c9,_0x192bb5){return db['OpenchannelQueue'][_0x6a02('0x50')]({'where':{'id':_0x4239b6[_0x6a02('0x53')]['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x2f43c9,null))['then'](function(_0x34f6ff){if(_0x34f6ff){return _0x34f6ff[_0x6a02('0x89')](_0x4239b6[_0x6a02('0x39')][_0x6a02('0x72')])['then'](function(){if(_[_0x6a02('0x8f')](_0x4239b6['query']['ids'])){for(var _0x636e2=0x0;_0x636e2<_0x4239b6['query'][_0x6a02('0x72')][_0x6a02('0x3c')];_0x636e2+=0x1){socket[_0x6a02('0x71')](_0x6a02('0x8b'),{'UserId':Number(_0x4239b6[_0x6a02('0x39')][_0x6a02('0x72')][_0x636e2]),'OpenchannelQueueId':Number(_0x4239b6[_0x6a02('0x53')]['id'])});}}else{socket['emit'](_0x6a02('0x8b'),{'UserId':Number(_0x4239b6[_0x6a02('0x39')]['ids']),'OpenchannelQueueId':Number(_0x4239b6[_0x6a02('0x53')]['id'])});}});}})[_0x6a02('0x2a')](respondWithStatusCode(_0x2f43c9,null))[_0x6a02('0x47')](handleError(_0x2f43c9,null));};exports[_0x6a02('0x90')]=function(_0x2b7ab1,_0x352ea8,_0x173af7){var _0x243f9f={};var _0xbdd20c={};var _0x1ee96e;var _0x4752f7;return db[_0x6a02('0x34')]['findOne']({'where':{'id':_0x2b7ab1[_0x6a02('0x53')]['id']}})[_0x6a02('0x2a')](handleEntityNotFound(_0x352ea8,null))[_0x6a02('0x2a')](function(_0x178c8b){if(_0x178c8b){_0x1ee96e=_0x178c8b;_0xbdd20c[_0x6a02('0x38')]=_['keys'](db[_0x6a02('0x68')][_0x6a02('0x35')]);_0xbdd20c[_0x6a02('0x39')]=_[_0x6a02('0x49')](_0x2b7ab1[_0x6a02('0x39')]);_0xbdd20c[_0x6a02('0x3e')]=_[_0x6a02('0x4a')](_0xbdd20c[_0x6a02('0x38')],_0xbdd20c[_0x6a02('0x39')]);_0x243f9f[_0x6a02('0x3b')]=_['intersection'](_0xbdd20c[_0x6a02('0x38')],qs[_0x6a02('0x3a')](_0x2b7ab1[_0x6a02('0x39')][_0x6a02('0x3a')]));_0x243f9f[_0x6a02('0x3b')]=_0x243f9f[_0x6a02('0x3b')][_0x6a02('0x3c')]?_0x243f9f[_0x6a02('0x3b')]:_0xbdd20c[_0x6a02('0x38')];_0x243f9f[_0x6a02('0x58')]=qs[_0x6a02('0x59')](_0x2b7ab1[_0x6a02('0x39')]['sort']);_0x243f9f[_0x6a02('0x41')]=qs[_0x6a02('0x3e')](_['pick'](_0x2b7ab1[_0x6a02('0x39')],_0xbdd20c[_0x6a02('0x3e')]));if(_0x2b7ab1[_0x6a02('0x39')][_0x6a02('0x40')]){_0x243f9f['where']=_[_0x6a02('0x42')](_0x243f9f['where'],{'$or':_['map'](_0x243f9f[_0x6a02('0x3b')],function(_0x282c5d){var _0xf09c4e={};_0xf09c4e[_0x282c5d]={'$like':'%'+_0x2b7ab1[_0x6a02('0x39')][_0x6a02('0x40')]+'%'};return _0xf09c4e;})});}_0x243f9f=_[_0x6a02('0x42')]({},_0x243f9f,_0x2b7ab1[_0x6a02('0x5b')]);return _0x1ee96e[_0x6a02('0x90')](_0x243f9f);}})[_0x6a02('0x2a')](function(_0x10d307){if(_0x10d307){_0x4752f7=_0x10d307[_0x6a02('0x3c')];if(!_0x2b7ab1[_0x6a02('0x39')][_0x6a02('0x3d')](_0x6a02('0x66'))){_0x243f9f[_0x6a02('0x24')]=qs[_0x6a02('0x24')](_0x2b7ab1[_0x6a02('0x39')][_0x6a02('0x24')]);_0x243f9f[_0x6a02('0x22')]=qs[_0x6a02('0x22')](_0x2b7ab1['query']['offset']);}return _0x1ee96e['getAgents'](_0x243f9f);}})['then'](function(_0x41ce4e){if(_0x41ce4e){return _0x41ce4e?{'count':_0x4752f7,'rows':_0x41ce4e}:null;}})[_0x6a02('0x2a')](respondWithResult(_0x352ea8,null))[_0x6a02('0x47')](handleError(_0x352ea8,null));}; \ No newline at end of file +var _0x2fe3=['redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','sendStatus','error','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x2fe3,0x75));var _0x32fe=function(_0x752bfc,_0x22d1ca){_0x752bfc=_0x752bfc-0x0;var _0x2dfe73=_0x2fe3[_0x752bfc];return _0x2dfe73;};'use strict';var emlformat=require(_0x32fe('0x0'));var rimraf=require(_0x32fe('0x1'));var zipdir=require(_0x32fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32fe('0x3'));var moment=require(_0x32fe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32fe('0x5'));var path=require('path');var sox=require(_0x32fe('0x6'));var csv=require('to-csv');var ejs=require(_0x32fe('0x7'));var fs=require('fs');var fs_extra=require(_0x32fe('0x8'));var _=require(_0x32fe('0x9'));var squel=require(_0x32fe('0xa'));var crypto=require(_0x32fe('0xb'));var jsforce=require(_0x32fe('0xc'));var deskjs=require(_0x32fe('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x32fe('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32fe('0xf'));var hardwareService=require(_0x32fe('0x10'));var logger=require(_0x32fe('0x11'))(_0x32fe('0x12'));var utils=require(_0x32fe('0x13'));var config=require(_0x32fe('0x14'));var licenseUtil=require(_0x32fe('0x15'));var db=require(_0x32fe('0x16'))['db'];config[_0x32fe('0x17')]=_['defaults'](config['redis'],{'host':_0x32fe('0x18'),'port':0x18eb});var socket=require(_0x32fe('0x19'))(new Redis(config[_0x32fe('0x17')]));require(_0x32fe('0x1a'))[_0x32fe('0x1b')](socket);function respondWithStatusCode(_0x5a4687,_0xcce053){_0xcce053=_0xcce053||0xcc;return function(_0x52dfb3){if(_0x52dfb3){return _0x5a4687['sendStatus'](_0xcce053);}return _0x5a4687[_0x32fe('0x1c')](_0xcce053)['end']();};}function respondWithResult(_0x3e49bb,_0x3d262b){_0x3d262b=_0x3d262b||0xc8;return function(_0x3277c0){if(_0x3277c0){return _0x3e49bb[_0x32fe('0x1c')](_0x3d262b)['json'](_0x3277c0);}};}function respondWithFilteredResult(_0x143e1b,_0x4926c8){return function(_0x23ffbe){if(_0x23ffbe){var _0x57a6a9=typeof _0x4926c8[_0x32fe('0x1d')]===_0x32fe('0x1e')&&typeof _0x4926c8[_0x32fe('0x1f')]===_0x32fe('0x1e');var _0x2cd56f=_0x23ffbe[_0x32fe('0x20')];var _0x3f4c94=_0x57a6a9?0x0:_0x4926c8[_0x32fe('0x1d')];var _0x4ef683=_0x57a6a9?_0x23ffbe[_0x32fe('0x20')]:_0x4926c8[_0x32fe('0x1d')]+_0x4926c8[_0x32fe('0x1f')];var _0x3d4c00;if(_0x4ef683>=_0x2cd56f){_0x4ef683=_0x2cd56f;_0x3d4c00=0xc8;}else{_0x3d4c00=0xce;}_0x143e1b[_0x32fe('0x1c')](_0x3d4c00);return _0x143e1b[_0x32fe('0x21')](_0x32fe('0x22'),_0x3f4c94+'-'+_0x4ef683+'/'+_0x2cd56f)[_0x32fe('0x23')](_0x23ffbe);}return null;};}function patchUpdates(_0x1e2df1){return function(_0x4d5a3a){try{jsonpatch[_0x32fe('0x24')](_0x4d5a3a,_0x1e2df1,!![]);}catch(_0x36a5e0){return BPromise['reject'](_0x36a5e0);}return _0x4d5a3a[_0x32fe('0x25')]();};}function saveUpdates(_0x23c58f,_0x3482cd){return function(_0x4b5f98){if(_0x4b5f98){return _0x4b5f98[_0x32fe('0x26')](_0x23c58f)[_0x32fe('0x27')](function(_0x40083c){return _0x40083c;});}return null;};}function removeEntity(_0x561274,_0x20fde4){return function(_0x2fd99f){if(_0x2fd99f){return _0x2fd99f[_0x32fe('0x28')]()[_0x32fe('0x27')](function(){var _0x56819b=_0x2fd99f[_0x32fe('0x29')]({'plain':!![]});var _0x1e3ef3=_0x32fe('0x2a');return db[_0x32fe('0x2b')]['destroy']({'where':{'type':_0x1e3ef3,'resourceId':_0x56819b['id']}})[_0x32fe('0x27')](function(){return _0x2fd99f;});})[_0x32fe('0x27')](function(){_0x561274[_0x32fe('0x1c')](0xcc)[_0x32fe('0x2c')]();});}};}function handleEntityNotFound(_0x2a71fc,_0x4b8ceb){return function(_0x1b8e50){if(!_0x1b8e50){_0x2a71fc[_0x32fe('0x2d')](0x194);}return _0x1b8e50;};}function handleError(_0x300b6c,_0x372f18){_0x372f18=_0x372f18||0x1f4;return function(_0x2571d1){logger[_0x32fe('0x2e')](_0x2571d1['stack']);if(_0x2571d1[_0x32fe('0x2f')]){delete _0x2571d1['name'];}_0x300b6c[_0x32fe('0x1c')](_0x372f18)['send'](_0x2571d1);};}exports[_0x32fe('0x30')]=function(_0xb87d08,_0x58d4b9){var _0x3ff3ae={},_0x23b34c={},_0x2fc8a2={'count':0x0,'rows':[]};var _0x37dfc9=_[_0x32fe('0x31')](db[_0x32fe('0x32')][_0x32fe('0x33')],function(_0x1a3e67){return{'name':_0x1a3e67[_0x32fe('0x34')],'type':_0x1a3e67[_0x32fe('0x35')][_0x32fe('0x36')]};});_0x23b34c['model']=_[_0x32fe('0x31')](_0x37dfc9,'name');_0x23b34c[_0x32fe('0x37')]=_['keys'](_0xb87d08['query']);_0x23b34c[_0x32fe('0x38')]=_[_0x32fe('0x39')](_0x23b34c[_0x32fe('0x3a')],_0x23b34c['query']);_0x3ff3ae[_0x32fe('0x3b')]=_['intersection'](_0x23b34c[_0x32fe('0x3a')],qs[_0x32fe('0x3c')](_0xb87d08[_0x32fe('0x37')][_0x32fe('0x3c')]));_0x3ff3ae[_0x32fe('0x3b')]=_0x3ff3ae[_0x32fe('0x3b')][_0x32fe('0x3d')]?_0x3ff3ae[_0x32fe('0x3b')]:_0x23b34c[_0x32fe('0x3a')];if(!_0xb87d08[_0x32fe('0x37')][_0x32fe('0x3e')](_0x32fe('0x3f'))){_0x3ff3ae[_0x32fe('0x1f')]=qs[_0x32fe('0x1f')](_0xb87d08[_0x32fe('0x37')]['limit']);_0x3ff3ae['offset']=qs[_0x32fe('0x1d')](_0xb87d08['query'][_0x32fe('0x1d')]);}_0x3ff3ae[_0x32fe('0x40')]=qs[_0x32fe('0x41')](_0xb87d08[_0x32fe('0x37')][_0x32fe('0x41')]);_0x3ff3ae[_0x32fe('0x42')]=qs[_0x32fe('0x38')](_[_0x32fe('0x43')](_0xb87d08[_0x32fe('0x37')],_0x23b34c[_0x32fe('0x38')]),_0x37dfc9);if(_0xb87d08[_0x32fe('0x37')][_0x32fe('0x44')]){_0x3ff3ae[_0x32fe('0x42')]=_['merge'](_0x3ff3ae[_0x32fe('0x42')],{'$or':_['map'](_0x37dfc9,function(_0x4f7fc9){if(_0x4f7fc9[_0x32fe('0x35')]!==_0x32fe('0x45')){var _0x4878b6={};_0x4878b6[_0x4f7fc9[_0x32fe('0x2f')]]={'$like':'%'+_0xb87d08['query'][_0x32fe('0x44')]+'%'};return _0x4878b6;}})});}_0x3ff3ae=_[_0x32fe('0x46')]({},_0x3ff3ae,_0xb87d08['options']);var _0x3b2e86={'where':_0x3ff3ae[_0x32fe('0x42')]};return db[_0x32fe('0x32')][_0x32fe('0x20')](_0x3b2e86)[_0x32fe('0x27')](function(_0x418e4b){_0x2fc8a2[_0x32fe('0x20')]=_0x418e4b;if(_0xb87d08['query'][_0x32fe('0x47')]){_0x3ff3ae['include']=[{'all':!![]}];}return db[_0x32fe('0x32')][_0x32fe('0x48')](_0x3ff3ae);})[_0x32fe('0x27')](function(_0x5f3eb8){_0x2fc8a2['rows']=_0x5f3eb8;return _0x2fc8a2;})[_0x32fe('0x27')](respondWithFilteredResult(_0x58d4b9,_0x3ff3ae))[_0x32fe('0x49')](handleError(_0x58d4b9,null));};exports[_0x32fe('0x4a')]=function(_0x2d6b56,_0x1f57ba){var _0x894859={'raw':!![],'where':{'id':_0x2d6b56[_0x32fe('0x4b')]['id']}},_0x235eaf={};_0x235eaf[_0x32fe('0x3a')]=_[_0x32fe('0x4c')](db[_0x32fe('0x32')][_0x32fe('0x33')]);_0x235eaf['query']=_['keys'](_0x2d6b56['query']);_0x235eaf[_0x32fe('0x38')]=_['intersection'](_0x235eaf[_0x32fe('0x3a')],_0x235eaf['query']);_0x894859['attributes']=_[_0x32fe('0x39')](_0x235eaf[_0x32fe('0x3a')],qs['fields'](_0x2d6b56[_0x32fe('0x37')][_0x32fe('0x3c')]));_0x894859[_0x32fe('0x3b')]=_0x894859[_0x32fe('0x3b')]['length']?_0x894859[_0x32fe('0x3b')]:_0x235eaf['model'];if(_0x2d6b56['query']['includeAll']){_0x894859['include']=[{'all':!![]}];}_0x894859=_[_0x32fe('0x46')]({},_0x894859,_0x2d6b56[_0x32fe('0x4d')]);return db[_0x32fe('0x32')][_0x32fe('0x4e')](_0x894859)[_0x32fe('0x27')](handleEntityNotFound(_0x1f57ba,null))['then'](respondWithResult(_0x1f57ba,null))[_0x32fe('0x49')](handleError(_0x1f57ba,null));};exports[_0x32fe('0x4f')]=function(_0x547fb4,_0x39f944){return db[_0x32fe('0x32')][_0x32fe('0x4f')](_0x547fb4['body'],{})[_0x32fe('0x27')](function(_0x3761cc){var _0xbaa93c=_0x547fb4['user'][_0x32fe('0x29')]({'plain':!![]});if(!_0xbaa93c)throw new Error(_0x32fe('0x50'));if(_0xbaa93c[_0x32fe('0x51')]==='user'){var _0x289bb3=_0x3761cc[_0x32fe('0x29')]({'plain':!![]});var _0x3e5c6f='OpenchannelQueues';return db[_0x32fe('0x52')]['find']({'where':{'name':_0x3e5c6f,'userProfileId':_0xbaa93c[_0x32fe('0x53')]},'raw':!![]})[_0x32fe('0x27')](function(_0x3a44e2){if(_0x3a44e2&&_0x3a44e2[_0x32fe('0x54')]===0x0){return db['UserProfileResource'][_0x32fe('0x4f')]({'name':_0x289bb3[_0x32fe('0x2f')],'resourceId':_0x289bb3['id'],'type':_0x3a44e2['name'],'sectionId':_0x3a44e2['id']},{})[_0x32fe('0x27')](function(){return _0x3761cc;});}else{return _0x3761cc;}})[_0x32fe('0x49')](function(_0x2b1552){logger[_0x32fe('0x2e')](_0x32fe('0x55'),_0x2b1552);throw _0x2b1552;});}return _0x3761cc;})[_0x32fe('0x27')](respondWithResult(_0x39f944,0xc9))[_0x32fe('0x49')](handleError(_0x39f944,null));};exports[_0x32fe('0x26')]=function(_0x57a6d7,_0x5925b9){if(_0x57a6d7[_0x32fe('0x56')]['id']){delete _0x57a6d7['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x57a6d7[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x5925b9,null))[_0x32fe('0x27')](saveUpdates(_0x57a6d7[_0x32fe('0x56')],null))[_0x32fe('0x27')](respondWithResult(_0x5925b9,null))[_0x32fe('0x49')](handleError(_0x5925b9,null));};exports[_0x32fe('0x28')]=function(_0x61b144,_0x5347fc){return db[_0x32fe('0x32')][_0x32fe('0x4e')]({'where':{'id':_0x61b144[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x5347fc,null))['then'](removeEntity(_0x5347fc,null))['catch'](handleError(_0x5347fc,null));};exports[_0x32fe('0x57')]=function(_0x31065e,_0x281079){return db['OpenchannelQueue'][_0x32fe('0x57')]()[_0x32fe('0x27')](respondWithResult(_0x281079,null))[_0x32fe('0x49')](handleError(_0x281079,null));};exports[_0x32fe('0x58')]=function(_0x326277,_0x13bf63,_0x37a89d){var _0x17eca1={'raw':!![],'where':{}},_0x5d0192={},_0x54fc73;return db[_0x32fe('0x32')][_0x32fe('0x59')]({'where':{'id':_0x326277[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x13bf63,null))[_0x32fe('0x27')](function(_0x8777fd){if(_0x8777fd){_0x54fc73=_0x8777fd[_0x32fe('0x29')]({'plain':!![]});_0x5d0192[_0x32fe('0x3a')]=_[_0x32fe('0x4c')](db['UserOpenchannelQueue'][_0x32fe('0x33')]);_0x5d0192[_0x32fe('0x37')]=_[_0x32fe('0x4c')](_0x326277['query']);_0x5d0192[_0x32fe('0x38')]=_[_0x32fe('0x39')](_0x5d0192[_0x32fe('0x3a')],_0x5d0192[_0x32fe('0x37')]);_0x17eca1['attributes']=_['intersection'](_0x5d0192[_0x32fe('0x3a')],qs[_0x32fe('0x3c')](_0x326277[_0x32fe('0x37')]['fields']));_0x17eca1['attributes']=_0x17eca1[_0x32fe('0x3b')][_0x32fe('0x3d')]?_0x17eca1[_0x32fe('0x3b')]:_0x5d0192[_0x32fe('0x3a')];if(!_0x326277[_0x32fe('0x37')][_0x32fe('0x3e')](_0x32fe('0x3f'))){_0x17eca1['limit']=qs['limit'](_0x326277[_0x32fe('0x37')][_0x32fe('0x1f')]);_0x17eca1[_0x32fe('0x1d')]=qs[_0x32fe('0x1d')](_0x326277[_0x32fe('0x37')][_0x32fe('0x1d')]);}_0x17eca1[_0x32fe('0x40')]=qs[_0x32fe('0x41')](_0x326277[_0x32fe('0x37')][_0x32fe('0x41')]);_0x17eca1[_0x32fe('0x42')]=qs[_0x32fe('0x38')](_[_0x32fe('0x43')](_0x326277[_0x32fe('0x37')],_0x5d0192[_0x32fe('0x38')]));_0x17eca1[_0x32fe('0x42')]['OpenchannelQueueId']=_0x8777fd['id'];if(_0x326277[_0x32fe('0x37')][_0x32fe('0x44')]){_0x17eca1['where']=_[_0x32fe('0x46')](_0x17eca1[_0x32fe('0x42')],{'$or':_[_0x32fe('0x31')](_0x17eca1[_0x32fe('0x3b')],function(_0x46c5ee){var _0x30a7ab={};_0x30a7ab[_0x46c5ee]={'$like':'%'+_0x326277[_0x32fe('0x37')]['filter']+'%'};return _0x30a7ab;})});}_0x17eca1=_[_0x32fe('0x46')]({},_0x17eca1,_0x326277['options']);return db[_0x32fe('0x5a')][_0x32fe('0x48')](_0x17eca1);}})[_0x32fe('0x27')](function(_0x41f685){if(_0x41f685){return db[_0x32fe('0x5b')][_0x32fe('0x5c')]({'where':{'id':_['map'](_0x41f685,_0x32fe('0x5d')),'role':'agent'},'attributes':['id',_0x32fe('0x2f'),'openchannelPause',_0x32fe('0x5e'),_0x32fe('0x5f')]});}})['then'](function(_0x38a0eb){if(_0x38a0eb){return{'count':_0x38a0eb['count'],'rows':_['map'](_0x38a0eb['rows'],function(_0x4a46df){return{'membername':_0x4a46df[_0x32fe('0x2f')],'UserId':_0x4a46df['id'],'queue_name':_0x54fc73[_0x32fe('0x2f')],'OpenchannelQueueId':_0x54fc73['id'],'interface':util[_0x32fe('0x60')](_0x32fe('0x61'),_0x32fe('0x62'),_0x4a46df[_0x32fe('0x2f')]),'penalty':0x0,'paused':_0x4a46df[_0x32fe('0x63')],'createdAt':_0x4a46df[_0x32fe('0x5f')],'updatedAt':_0x4a46df['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13bf63,_0x17eca1))[_0x32fe('0x49')](handleError(_0x13bf63,null));};exports['getTeams']=function(_0x47319b,_0x39c0fa,_0x25d17d){var _0x4ad298={};var _0x19eb1f={};var _0x1926f6;var _0x1fe6e9;return db[_0x32fe('0x32')]['findOne']({'where':{'id':_0x47319b[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x39c0fa,null))[_0x32fe('0x27')](function(_0x2cba26){if(_0x2cba26){_0x1926f6=_0x2cba26;_0x19eb1f[_0x32fe('0x3a')]=_[_0x32fe('0x4c')](db['Team'][_0x32fe('0x33')]);_0x19eb1f[_0x32fe('0x37')]=_['keys'](_0x47319b[_0x32fe('0x37')]);_0x19eb1f[_0x32fe('0x38')]=_[_0x32fe('0x39')](_0x19eb1f[_0x32fe('0x3a')],_0x19eb1f[_0x32fe('0x37')]);_0x4ad298[_0x32fe('0x3b')]=_[_0x32fe('0x39')](_0x19eb1f[_0x32fe('0x3a')],qs[_0x32fe('0x3c')](_0x47319b[_0x32fe('0x37')][_0x32fe('0x3c')]));_0x4ad298['attributes']=_0x4ad298['attributes'][_0x32fe('0x3d')]?_0x4ad298[_0x32fe('0x3b')]:_0x19eb1f[_0x32fe('0x3a')];_0x4ad298[_0x32fe('0x40')]=qs['sort'](_0x47319b[_0x32fe('0x37')]['sort']);_0x4ad298[_0x32fe('0x42')]=qs[_0x32fe('0x38')](_[_0x32fe('0x43')](_0x47319b[_0x32fe('0x37')],_0x19eb1f['filters']));if(_0x47319b[_0x32fe('0x37')][_0x32fe('0x44')]){_0x4ad298[_0x32fe('0x42')]=_[_0x32fe('0x46')](_0x4ad298[_0x32fe('0x42')],{'$or':_[_0x32fe('0x31')](_0x4ad298[_0x32fe('0x3b')],function(_0x3d5a50){var _0x5212b1={};_0x5212b1[_0x3d5a50]={'$like':'%'+_0x47319b['query'][_0x32fe('0x44')]+'%'};return _0x5212b1;})});}_0x4ad298=_['merge']({},_0x4ad298,_0x47319b[_0x32fe('0x4d')]);return _0x1926f6['getTeams'](_0x4ad298);}})[_0x32fe('0x27')](function(_0x399518){if(_0x399518){_0x1fe6e9=_0x399518[_0x32fe('0x3d')];if(!_0x47319b[_0x32fe('0x37')][_0x32fe('0x3e')]('nolimit')){_0x4ad298['limit']=qs[_0x32fe('0x1f')](_0x47319b[_0x32fe('0x37')][_0x32fe('0x1f')]);_0x4ad298[_0x32fe('0x1d')]=qs[_0x32fe('0x1d')](_0x47319b[_0x32fe('0x37')][_0x32fe('0x1d')]);}return _0x1926f6['getTeams'](_0x4ad298);}})[_0x32fe('0x27')](function(_0x313c9f){if(_0x313c9f){return _0x313c9f?{'count':_0x1fe6e9,'rows':_0x313c9f}:null;}})[_0x32fe('0x27')](respondWithResult(_0x39c0fa,null))[_0x32fe('0x49')](handleError(_0x39c0fa,null));};exports[_0x32fe('0x64')]=function(_0x33ffee,_0x535554,_0x295515){var _0x3a0f07=_0x33ffee[_0x32fe('0x56')][_0x32fe('0x65')];return db['Team'][_0x32fe('0x48')]({'where':{'id':_0x3a0f07},'attributes':['id'],'include':[{'model':db[_0x32fe('0x5b')],'as':_0x32fe('0x66'),'attributes':['id',_0x32fe('0x2f'),_0x32fe('0x67'),_0x32fe('0x68'),_0x32fe('0x69')],'raw':!![]}]})[_0x32fe('0x27')](function(_0x2f6bbf){if(_0x2f6bbf){var _0x328389=_[_0x32fe('0x6a')](_0x2f6bbf,function(_0x2d49c5){var _0x33e821=_0x2d49c5[_0x32fe('0x29')]({'plain':!![]});return _0x33e821['Agents'];});return db['OpenchannelQueue'][_0x32fe('0x4e')]({'where':{'id':_0x33ffee[_0x32fe('0x4b')]['id']}})['then'](function(_0x220b38){return db['sequelize'][_0x32fe('0x6b')](function(_0x5393f5){return _0x220b38['addTeams'](_0x3a0f07,{'transaction':_0x5393f5})[_0x32fe('0x27')](function(){return BPromise[_0x32fe('0x6c')](_0x328389,function(_0x1578d4){return db['UserOpenchannelQueue'][_0x32fe('0x6d')]({'where':{'UserId':_0x1578d4['id'],'OpenchannelQueueId':_0x33ffee['params']['id']},'transaction':_0x5393f5});});})[_0x32fe('0x27')](function(){_0x328389[_0x32fe('0x6e')](function(_0x32a0b1){socket[_0x32fe('0x6f')](_0x32fe('0x70'),{'UserId':_0x32a0b1['id'],'OpenchannelQueueId':_0x220b38['id']});});});});});}})[_0x32fe('0x27')](respondWithStatusCode(_0x535554,null))[_0x32fe('0x49')](handleError(_0x535554,null));};exports[_0x32fe('0x71')]=function(_0x1ff766,_0x51bf8e,_0x1e7789){return db['Team'][_0x32fe('0x48')]({'where':{'id':_0x1ff766[_0x32fe('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x32fe('0x5b')],'as':_0x32fe('0x66'),'attributes':['id'],'raw':!![]}]})[_0x32fe('0x27')](handleEntityNotFound(_0x51bf8e,null))[_0x32fe('0x27')](function(_0x32d324){var _0x37db5b=_[_0x32fe('0x31')](_0x32d324,'id');var _0xd73560=[];var _0xeb1020=[];var _0x3af4ed=squel[_0x32fe('0x72')]();_0x3af4ed[_0x32fe('0x73')](_0x32fe('0x74'))[_0x32fe('0x75')]('team_has_openchannel_queues','tq')[_0x32fe('0x76')](_0x32fe('0x77'),'ut',_0x32fe('0x78'))[_0x32fe('0x42')](_0x32fe('0x79'),_0x1ff766[_0x32fe('0x4b')]['id']);for(var _0x3cfaa8=0x0;_0x3cfaa8<_0x32d324[_0x32fe('0x3d')];_0x3cfaa8+=0x1){let _0x273b51=_0x32d324[_0x3cfaa8];for(var _0x36ac81=0x0;_0x36ac81<_0x273b51[_0x32fe('0x66')][_0x32fe('0x3d')];_0x36ac81+=0x1){let _0x4b1d67=_0x273b51['Agents'][_0x36ac81];var _0x600348=_0x3af4ed['clone']();_0x600348['where'](_0x32fe('0x7a'),_0x4b1d67['id']);_0xeb1020[_0x32fe('0x7b')](db[_0x32fe('0x7c')][_0x32fe('0x37')](_0x600348[_0x32fe('0x7d')](),{'type':db[_0x32fe('0x7c')][_0x32fe('0x7e')][_0x32fe('0x7f')]})[_0x32fe('0x27')](function(_0x37aad0){if(_0x37aad0['length']===0x1){return _0x4b1d67['id'];}else{var _0x558b13=_['every'](_[_0x32fe('0x31')](_0x37aad0,_0x32fe('0x80')),function(_0x16d0c7){return _['includes'](_0x37db5b,_0x16d0c7);});if(_0x558b13){return _0x4b1d67['id'];}}}));}}return BPromise[_0x32fe('0x81')](_0xeb1020)[_0x32fe('0x27')](function(_0x503dfa){_0xd73560=_(_0xd73560)[_0x32fe('0x82')](_0x503dfa)[_0x32fe('0x83')]()[_0x32fe('0x84')]();return db[_0x32fe('0x32')][_0x32fe('0x4e')]({'where':{'id':_0x1ff766[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](function(_0x31f9b3){return db[_0x32fe('0x7c')]['transaction'](function(_0xb70626){return _0x31f9b3[_0x32fe('0x71')](_0x1ff766[_0x32fe('0x37')][_0x32fe('0x65')],{'transaction':_0xb70626})[_0x32fe('0x27')](function(){if(!_[_0x32fe('0x85')](_0xd73560)){return _0x31f9b3[_0x32fe('0x86')](_0xd73560,{'transaction':_0xb70626});}})['then'](function(){_0xd73560['forEach'](function(_0x44eb9e){socket[_0x32fe('0x6f')]('userOpenchannelQueue:remove',{'UserId':_0x44eb9e,'OpenchannelQueueId':_0x31f9b3['id']});});});});});});})[_0x32fe('0x27')](respondWithStatusCode(_0x51bf8e,null))['catch'](handleError(_0x51bf8e,null));};exports[_0x32fe('0x87')]=function(_0x100074,_0x45f8df,_0x33e589){return db[_0x32fe('0x32')][_0x32fe('0x4e')]({'where':{'id':_0x100074[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x45f8df,null))[_0x32fe('0x27')](function(_0x128128){if(_0x128128){return _0x128128['addAgents'](_0x100074[_0x32fe('0x56')][_0x32fe('0x65')],_['omit'](_0x100074[_0x32fe('0x56')],[_0x32fe('0x65'),'id'])||{})[_0x32fe('0x88')](function(_0x473f46){for(var _0x24295e=0x0;_0x24295e<_0x100074[_0x32fe('0x56')][_0x32fe('0x65')][_0x32fe('0x3d')];_0x24295e+=0x1){socket[_0x32fe('0x6f')](_0x32fe('0x70'),{'UserId':Number(_0x100074[_0x32fe('0x56')][_0x32fe('0x65')][_0x24295e]),'OpenchannelQueueId':Number(_0x100074['params']['id'])});}return _0x473f46;});}})['then'](respondWithResult(_0x45f8df,null))[_0x32fe('0x49')](handleError(_0x45f8df,null));};exports[_0x32fe('0x86')]=function(_0x5facbd,_0x28ed84,_0x3d608c){return db[_0x32fe('0x32')][_0x32fe('0x4e')]({'where':{'id':_0x5facbd[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x28ed84,null))[_0x32fe('0x27')](function(_0x53ca69){if(_0x53ca69){return _0x53ca69[_0x32fe('0x86')](_0x5facbd[_0x32fe('0x37')][_0x32fe('0x65')])[_0x32fe('0x27')](function(){if(_[_0x32fe('0x89')](_0x5facbd[_0x32fe('0x37')][_0x32fe('0x65')])){for(var _0x301a35=0x0;_0x301a35<_0x5facbd[_0x32fe('0x37')][_0x32fe('0x65')][_0x32fe('0x3d')];_0x301a35+=0x1){socket['emit'](_0x32fe('0x8a'),{'UserId':Number(_0x5facbd[_0x32fe('0x37')][_0x32fe('0x65')][_0x301a35]),'OpenchannelQueueId':Number(_0x5facbd[_0x32fe('0x4b')]['id'])});}}else{socket[_0x32fe('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5facbd[_0x32fe('0x37')]['ids']),'OpenchannelQueueId':Number(_0x5facbd[_0x32fe('0x4b')]['id'])});}});}})[_0x32fe('0x27')](respondWithStatusCode(_0x28ed84,null))[_0x32fe('0x49')](handleError(_0x28ed84,null));};exports[_0x32fe('0x8b')]=function(_0x548514,_0x197866,_0x8bbd0a){var _0x52ea64={};var _0x5b9b68={};var _0xe6f49e;var _0x53f489;return db[_0x32fe('0x32')][_0x32fe('0x59')]({'where':{'id':_0x548514[_0x32fe('0x4b')]['id']}})[_0x32fe('0x27')](handleEntityNotFound(_0x197866,null))[_0x32fe('0x27')](function(_0x2fa9f8){if(_0x2fa9f8){_0xe6f49e=_0x2fa9f8;_0x5b9b68[_0x32fe('0x3a')]=_['keys'](db[_0x32fe('0x5b')][_0x32fe('0x33')]);_0x5b9b68[_0x32fe('0x37')]=_[_0x32fe('0x4c')](_0x548514[_0x32fe('0x37')]);_0x5b9b68[_0x32fe('0x38')]=_[_0x32fe('0x39')](_0x5b9b68[_0x32fe('0x3a')],_0x5b9b68['query']);_0x52ea64[_0x32fe('0x3b')]=_[_0x32fe('0x39')](_0x5b9b68[_0x32fe('0x3a')],qs[_0x32fe('0x3c')](_0x548514['query']['fields']));_0x52ea64[_0x32fe('0x3b')]=_0x52ea64['attributes'][_0x32fe('0x3d')]?_0x52ea64[_0x32fe('0x3b')]:_0x5b9b68[_0x32fe('0x3a')];_0x52ea64[_0x32fe('0x40')]=qs[_0x32fe('0x41')](_0x548514['query']['sort']);_0x52ea64[_0x32fe('0x42')]=qs[_0x32fe('0x38')](_[_0x32fe('0x43')](_0x548514[_0x32fe('0x37')],_0x5b9b68[_0x32fe('0x38')]));if(_0x548514[_0x32fe('0x37')]['filter']){_0x52ea64[_0x32fe('0x42')]=_[_0x32fe('0x46')](_0x52ea64['where'],{'$or':_[_0x32fe('0x31')](_0x52ea64[_0x32fe('0x3b')],function(_0x504355){var _0x33cc5d={};_0x33cc5d[_0x504355]={'$like':'%'+_0x548514[_0x32fe('0x37')][_0x32fe('0x44')]+'%'};return _0x33cc5d;})});}_0x52ea64=_[_0x32fe('0x46')]({},_0x52ea64,_0x548514['options']);return _0xe6f49e[_0x32fe('0x8b')](_0x52ea64);}})['then'](function(_0x11e76a){if(_0x11e76a){_0x53f489=_0x11e76a[_0x32fe('0x3d')];if(!_0x548514[_0x32fe('0x37')][_0x32fe('0x3e')](_0x32fe('0x3f'))){_0x52ea64['limit']=qs['limit'](_0x548514[_0x32fe('0x37')][_0x32fe('0x1f')]);_0x52ea64[_0x32fe('0x1d')]=qs[_0x32fe('0x1d')](_0x548514[_0x32fe('0x37')][_0x32fe('0x1d')]);}return _0xe6f49e[_0x32fe('0x8b')](_0x52ea64);}})[_0x32fe('0x27')](function(_0x174267){if(_0x174267){return _0x174267?{'count':_0x53f489,'rows':_0x174267}:null;}})[_0x32fe('0x27')](respondWithResult(_0x197866,null))[_0x32fe('0x49')](handleError(_0x197866,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6a5618b..470d0fd 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa198=['remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa198,0xdc));var _0x8a19=function(_0x495bdd,_0x5ab6ae){_0x495bdd=_0x495bdd-0x0;var _0xd1ee22=_0xa198[_0x495bdd];return _0xd1ee22;};'use strict';var EventEmitter=require(_0x8a19('0x0'));var OpenchannelQueue=require(_0x8a19('0x1'))['db'][_0x8a19('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8a19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a19('0x4'),'afterDestroy':_0x8a19('0x5')};function emitEvent(_0x1b3911){return function(_0x4d741a,_0x458d01,_0x462e79){OpenchannelQueueEvents[_0x8a19('0x6')](_0x1b3911+':'+_0x4d741a['id'],_0x4d741a);OpenchannelQueueEvents[_0x8a19('0x6')](_0x1b3911,_0x4d741a);_0x462e79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x8a19('0x7')](e,emitEvent(event));}}module[_0x8a19('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2d8c=['emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','update','remove'];(function(_0x37ece3,_0x4ed5f6){var _0x3aad88=function(_0x47466d){while(--_0x47466d){_0x37ece3['push'](_0x37ece3['shift']());}};_0x3aad88(++_0x4ed5f6);}(_0x2d8c,0xc3));var _0xc2d8=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x2d8c[_0x5ce3c8];return _0xa76867;};'use strict';var EventEmitter=require(_0xc2d8('0x0'));var OpenchannelQueue=require(_0xc2d8('0x1'))['db'][_0xc2d8('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc2d8('0x3'),'afterDestroy':_0xc2d8('0x4')};function emitEvent(_0x504fcb){return function(_0x2be687,_0x60433e,_0x1664b4){OpenchannelQueueEvents[_0xc2d8('0x5')](_0x504fcb+':'+_0x2be687['id'],_0x2be687);OpenchannelQueueEvents[_0xc2d8('0x5')](_0x504fcb,_0x2be687);_0x1664b4(null);};}for(var e in events){if(events[_0xc2d8('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc2d8('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 2217652..097bb30 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80d7=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x34ef8e,_0x5a9507){var _0x339bf3=function(_0x33cd72){while(--_0x33cd72){_0x34ef8e['push'](_0x34ef8e['shift']());}};_0x339bf3(++_0x5a9507);}(_0x80d7,0xe9));var _0x780d=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x80d7[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0x780d('0x0'));var util=require(_0x780d('0x1'));var logger=require(_0x780d('0x2'))(_0x780d('0x3'));var moment=require(_0x780d('0x4'));var BPromise=require(_0x780d('0x5'));var rp=require(_0x780d('0x6'));var fs=require('fs');var path=require(_0x780d('0x7'));var rimraf=require(_0x780d('0x8'));var config=require(_0x780d('0x9'));var attributes=require(_0x780d('0xa'));module[_0x780d('0xb')]=function(_0x1819cb,_0x2deb89){return _0x1819cb[_0x780d('0xc')](_0x780d('0xd'),attributes,{'tableName':_0x780d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1587=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','util','../../config/logger'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x1587,0x11d));var _0x7158=function(_0x5d82ac,_0x10b48b){_0x5d82ac=_0x5d82ac-0x0;var _0x1595e1=_0x1587[_0x5d82ac];return _0x1595e1;};'use strict';var _=require(_0x7158('0x0'));var util=require(_0x7158('0x1'));var logger=require(_0x7158('0x2'))(_0x7158('0x3'));var moment=require(_0x7158('0x4'));var BPromise=require('bluebird');var rp=require(_0x7158('0x5'));var fs=require('fs');var path=require(_0x7158('0x6'));var rimraf=require(_0x7158('0x7'));var config=require(_0x7158('0x8'));var attributes=require(_0x7158('0x9'));module[_0x7158('0xa')]=function(_0x1e8a19,_0x1e5bcf){return _0x1e8a19['define'](_0x7158('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 8d3aad1..da52977 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92a7=['then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./openchannelQueue.socket','register'];(function(_0x572dd8,_0x227286){var _0x4e3e5a=function(_0x4ee034){while(--_0x4ee034){_0x572dd8['push'](_0x572dd8['shift']());}};_0x4e3e5a(++_0x227286);}(_0x92a7,0xbd));var _0x792a=function(_0x27235a,_0x54bcc5){_0x27235a=_0x27235a-0x0;var _0x1250c3=_0x92a7[_0x27235a];return _0x1250c3;};'use strict';var _=require(_0x792a('0x0'));var util=require(_0x792a('0x1'));var moment=require(_0x792a('0x2'));var BPromise=require(_0x792a('0x3'));var rs=require(_0x792a('0x4'));var fs=require('fs');var Redis=require(_0x792a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x792a('0x6'));var logger=require('../../config/logger')(_0x792a('0x7'));var config=require(_0x792a('0x8'));var jayson=require(_0x792a('0x9'));var client=jayson[_0x792a('0xa')][_0x792a('0xb')]({'port':0x232a});config[_0x792a('0xc')]=_['defaults'](config[_0x792a('0xc')],{'host':_0x792a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x792a('0xc')]));require(_0x792a('0xe'))[_0x792a('0xf')](socket);function respondWithRpcPromise(_0x19b712,_0x5350b8,_0x4d5ef1){return new BPromise(function(_0x58f66e,_0x13f282){return client['request'](_0x19b712,_0x4d5ef1)[_0x792a('0x10')](function(_0x51ef1b){logger[_0x792a('0x11')](_0x792a('0x12'),_0x5350b8,_0x792a('0x13'));logger[_0x792a('0x14')](_0x792a('0x15'),_0x5350b8,'request\x20sent',JSON[_0x792a('0x16')](_0x51ef1b));if(_0x51ef1b['error']){if(_0x51ef1b[_0x792a('0x17')][_0x792a('0x18')]===0x1f4){logger[_0x792a('0x17')](_0x792a('0x12'),_0x5350b8,_0x51ef1b['error'][_0x792a('0x19')]);return _0x13f282(_0x51ef1b[_0x792a('0x17')][_0x792a('0x19')]);}logger[_0x792a('0x17')](_0x792a('0x12'),_0x5350b8,_0x51ef1b[_0x792a('0x17')][_0x792a('0x19')]);return _0x58f66e(_0x51ef1b[_0x792a('0x17')][_0x792a('0x19')]);}else{logger[_0x792a('0x11')](_0x792a('0x12'),_0x5350b8,_0x792a('0x13'));_0x58f66e(_0x51ef1b[_0x792a('0x1a')][_0x792a('0x19')]);}})['catch'](function(_0x220288){logger[_0x792a('0x17')](_0x792a('0x12'),_0x5350b8,_0x220288);_0x13f282(_0x220288);});});}exports[_0x792a('0x1b')]=function(_0x27a100){var _0x4ba15c=this;return new Promise(function(_0x1457c8,_0x23b9be){return db[_0x792a('0x1c')][_0x792a('0x1d')]({'raw':_0x27a100[_0x792a('0x1e')]?_0x27a100['options'][_0x792a('0x1f')]===undefined?!![]:![]:!![],'where':_0x27a100[_0x792a('0x1e')]?_0x27a100[_0x792a('0x1e')][_0x792a('0x20')]||null:null,'attributes':_0x27a100['options']?_0x27a100[_0x792a('0x1e')][_0x792a('0x21')]||null:null,'limit':_0x27a100[_0x792a('0x1e')]?_0x27a100['options'][_0x792a('0x22')]||null:null,'include':_0x27a100['options']?_0x27a100['options'][_0x792a('0x23')]?_[_0x792a('0x24')](_0x27a100[_0x792a('0x1e')][_0x792a('0x23')],function(_0x2f48f4){return{'model':db[_0x2f48f4[_0x792a('0x25')]],'as':_0x2f48f4['as'],'attributes':_0x2f48f4[_0x792a('0x21')],'include':_0x2f48f4['include']?_[_0x792a('0x24')](_0x2f48f4['include'],function(_0x2297ea){return{'model':db[_0x2297ea[_0x792a('0x25')]],'as':_0x2297ea['as'],'attributes':_0x2297ea['attributes'],'include':_0x2297ea[_0x792a('0x23')]?_[_0x792a('0x24')](_0x2297ea[_0x792a('0x23')],function(_0x3ee8d0){return{'model':db[_0x3ee8d0['model']],'as':_0x3ee8d0['as'],'attributes':_0x3ee8d0[_0x792a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x792a('0x10')](function(_0x3440d1){logger[_0x792a('0x11')]('GetOpenchannelQueue',_0x27a100);logger[_0x792a('0x14')](_0x792a('0x1b'),_0x27a100,JSON[_0x792a('0x16')](_0x3440d1));_0x1457c8(_0x3440d1);})[_0x792a('0x26')](function(_0x318de9){logger['error'](_0x792a('0x1b'),_0x318de9[_0x792a('0x19')],_0x27a100);_0x23b9be(_0x4ba15c[_0x792a('0x17')](0x1f4,_0x318de9[_0x792a('0x19')]));});});};exports[_0x792a('0x27')]=function(_0x4e387d){var _0x331ca0=this;return new Promise(function(_0x30a274,_0x18240a){return db[_0x792a('0x1c')][_0x792a('0x28')]({'raw':_0x4e387d[_0x792a('0x1e')]?_0x4e387d[_0x792a('0x1e')][_0x792a('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e387d[_0x792a('0x1e')]?_0x4e387d[_0x792a('0x1e')][_0x792a('0x20')]||null:null,'attributes':_0x4e387d[_0x792a('0x1e')]?_0x4e387d['options'][_0x792a('0x21')]||null:null,'include':_0x4e387d[_0x792a('0x1e')]?_0x4e387d[_0x792a('0x1e')]['include']?_[_0x792a('0x24')](_0x4e387d[_0x792a('0x1e')][_0x792a('0x23')],function(_0x1f8f51){return{'model':db[_0x1f8f51['model']],'as':_0x1f8f51['as'],'attributes':_0x1f8f51[_0x792a('0x21')],'include':_0x1f8f51['include']?_[_0x792a('0x24')](_0x1f8f51[_0x792a('0x23')],function(_0x5256e3){return{'model':db[_0x5256e3[_0x792a('0x25')]],'as':_0x5256e3['as'],'attributes':_0x5256e3[_0x792a('0x21')],'include':_0x5256e3[_0x792a('0x23')]?_[_0x792a('0x24')](_0x5256e3[_0x792a('0x23')],function(_0x391517){return{'model':db[_0x391517[_0x792a('0x25')]],'as':_0x391517['as'],'attributes':_0x391517[_0x792a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x792a('0x10')](function(_0x141bef){logger[_0x792a('0x11')](_0x792a('0x27'),_0x4e387d);logger[_0x792a('0x14')]('ShowOpenchannelQueue',_0x4e387d,JSON[_0x792a('0x16')](_0x141bef));_0x30a274(_0x141bef);})[_0x792a('0x26')](function(_0x2b931b){logger[_0x792a('0x17')](_0x792a('0x27'),_0x2b931b[_0x792a('0x19')],_0x4e387d);_0x18240a(_0x331ca0[_0x792a('0x17')](0x1f4,_0x2b931b[_0x792a('0x19')]));});});}; \ No newline at end of file +var _0xbe0c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetOpenchannelQueue','ShowOpenchannelQueue','util','moment'];(function(_0x45900a,_0x215663){var _0x9c719a=function(_0x468a9c){while(--_0x468a9c){_0x45900a['push'](_0x45900a['shift']());}};_0x9c719a(++_0x215663);}(_0xbe0c,0xe2));var _0xcbe0=function(_0x3c9c05,_0x31f740){_0x3c9c05=_0x3c9c05-0x0;var _0x2f1d51=_0xbe0c[_0x3c9c05];return _0x2f1d51;};'use strict';var _=require('lodash');var util=require(_0xcbe0('0x0'));var moment=require(_0xcbe0('0x1'));var BPromise=require(_0xcbe0('0x2'));var rs=require(_0xcbe0('0x3'));var fs=require('fs');var Redis=require(_0xcbe0('0x4'));var db=require(_0xcbe0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbe0('0x6'))(_0xcbe0('0x7'));var config=require(_0xcbe0('0x8'));var jayson=require(_0xcbe0('0x9'));var client=jayson[_0xcbe0('0xa')][_0xcbe0('0xb')]({'port':0x232a});config[_0xcbe0('0xc')]=_[_0xcbe0('0xd')](config['redis'],{'host':_0xcbe0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbe0('0xc')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2b76b3,_0x4b83a1,_0x2d65cb){return new BPromise(function(_0x223e6f,_0x20f885){return client[_0xcbe0('0xf')](_0x2b76b3,_0x2d65cb)['then'](function(_0x24eb8f){logger[_0xcbe0('0x10')](_0xcbe0('0x11'),_0x4b83a1,_0xcbe0('0x12'));logger[_0xcbe0('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4b83a1,_0xcbe0('0x12'),JSON[_0xcbe0('0x14')](_0x24eb8f));if(_0x24eb8f[_0xcbe0('0x15')]){if(_0x24eb8f[_0xcbe0('0x15')]['code']===0x1f4){logger[_0xcbe0('0x15')](_0xcbe0('0x11'),_0x4b83a1,_0x24eb8f[_0xcbe0('0x15')][_0xcbe0('0x16')]);return _0x20f885(_0x24eb8f['error'][_0xcbe0('0x16')]);}logger[_0xcbe0('0x15')](_0xcbe0('0x11'),_0x4b83a1,_0x24eb8f[_0xcbe0('0x15')][_0xcbe0('0x16')]);return _0x223e6f(_0x24eb8f['error'][_0xcbe0('0x16')]);}else{logger[_0xcbe0('0x10')](_0xcbe0('0x11'),_0x4b83a1,_0xcbe0('0x12'));_0x223e6f(_0x24eb8f[_0xcbe0('0x17')][_0xcbe0('0x16')]);}})[_0xcbe0('0x18')](function(_0x45a6bc){logger[_0xcbe0('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x4b83a1,_0x45a6bc);_0x20f885(_0x45a6bc);});});}exports['GetOpenchannelQueue']=function(_0x5484a3){var _0x327af7=this;return new Promise(function(_0x280086,_0x28aa99){return db[_0xcbe0('0x19')][_0xcbe0('0x1a')]({'raw':_0x5484a3['options']?_0x5484a3[_0xcbe0('0x1b')][_0xcbe0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5484a3[_0xcbe0('0x1b')]?_0x5484a3[_0xcbe0('0x1b')][_0xcbe0('0x1d')]||null:null,'attributes':_0x5484a3[_0xcbe0('0x1b')]?_0x5484a3['options'][_0xcbe0('0x1e')]||null:null,'limit':_0x5484a3[_0xcbe0('0x1b')]?_0x5484a3[_0xcbe0('0x1b')][_0xcbe0('0x1f')]||null:null,'include':_0x5484a3[_0xcbe0('0x1b')]?_0x5484a3[_0xcbe0('0x1b')][_0xcbe0('0x20')]?_[_0xcbe0('0x21')](_0x5484a3[_0xcbe0('0x1b')][_0xcbe0('0x20')],function(_0x56f972){return{'model':db[_0x56f972[_0xcbe0('0x22')]],'as':_0x56f972['as'],'attributes':_0x56f972[_0xcbe0('0x1e')],'include':_0x56f972[_0xcbe0('0x20')]?_[_0xcbe0('0x21')](_0x56f972[_0xcbe0('0x20')],function(_0x5a6bd3){return{'model':db[_0x5a6bd3[_0xcbe0('0x22')]],'as':_0x5a6bd3['as'],'attributes':_0x5a6bd3['attributes'],'include':_0x5a6bd3[_0xcbe0('0x20')]?_['map'](_0x5a6bd3[_0xcbe0('0x20')],function(_0x164532){return{'model':db[_0x164532[_0xcbe0('0x22')]],'as':_0x164532['as'],'attributes':_0x164532[_0xcbe0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcbe0('0x23')](function(_0x4199e7){logger[_0xcbe0('0x10')](_0xcbe0('0x24'),_0x5484a3);logger[_0xcbe0('0x13')](_0xcbe0('0x24'),_0x5484a3,JSON[_0xcbe0('0x14')](_0x4199e7));_0x280086(_0x4199e7);})[_0xcbe0('0x18')](function(_0x30b183){logger[_0xcbe0('0x15')](_0xcbe0('0x24'),_0x30b183['message'],_0x5484a3);_0x28aa99(_0x327af7[_0xcbe0('0x15')](0x1f4,_0x30b183[_0xcbe0('0x16')]));});});};exports[_0xcbe0('0x25')]=function(_0x1582b4){var _0x2466dc=this;return new Promise(function(_0x5d3e40,_0x1f5602){return db['OpenchannelQueue']['find']({'raw':_0x1582b4[_0xcbe0('0x1b')]?_0x1582b4['options'][_0xcbe0('0x1c')]===undefined?!![]:![]:!![],'where':_0x1582b4[_0xcbe0('0x1b')]?_0x1582b4[_0xcbe0('0x1b')][_0xcbe0('0x1d')]||null:null,'attributes':_0x1582b4[_0xcbe0('0x1b')]?_0x1582b4['options'][_0xcbe0('0x1e')]||null:null,'include':_0x1582b4[_0xcbe0('0x1b')]?_0x1582b4['options']['include']?_[_0xcbe0('0x21')](_0x1582b4['options']['include'],function(_0x4127d4){return{'model':db[_0x4127d4[_0xcbe0('0x22')]],'as':_0x4127d4['as'],'attributes':_0x4127d4['attributes'],'include':_0x4127d4[_0xcbe0('0x20')]?_[_0xcbe0('0x21')](_0x4127d4[_0xcbe0('0x20')],function(_0x488232){return{'model':db[_0x488232['model']],'as':_0x488232['as'],'attributes':_0x488232[_0xcbe0('0x1e')],'include':_0x488232['include']?_[_0xcbe0('0x21')](_0x488232[_0xcbe0('0x20')],function(_0x4172d5){return{'model':db[_0x4172d5[_0xcbe0('0x22')]],'as':_0x4172d5['as'],'attributes':_0x4172d5[_0xcbe0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a8ea3){logger[_0xcbe0('0x10')](_0xcbe0('0x25'),_0x1582b4);logger[_0xcbe0('0x13')](_0xcbe0('0x25'),_0x1582b4,JSON['stringify'](_0x5a8ea3));_0x5d3e40(_0x5a8ea3);})[_0xcbe0('0x18')](function(_0x5b6993){logger[_0xcbe0('0x15')](_0xcbe0('0x25'),_0x5b6993[_0xcbe0('0x16')],_0x1582b4);_0x1f5602(_0x2466dc[_0xcbe0('0x15')](0x1f4,_0x5b6993[_0xcbe0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index febd728..33540cb 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1265=['emit','length','./openchannelQueue.events','save','remove','update'];(function(_0x575107,_0x485842){var _0x255a90=function(_0x5ac4bc){while(--_0x5ac4bc){_0x575107['push'](_0x575107['shift']());}};_0x255a90(++_0x485842);}(_0x1265,0xc8));var _0x5126=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1265[_0x397e5f];return _0x5302b8;};'use strict';var OpenchannelQueueEvents=require(_0x5126('0x0'));var events=[_0x5126('0x1'),_0x5126('0x2'),_0x5126('0x3')];function createListener(_0x2e0811,_0x2f1ae4){return function(_0x482952){_0x2f1ae4[_0x5126('0x4')](_0x2e0811,_0x482952);};}function removeListener(_0x3fb798,_0x14f172){return function(){OpenchannelQueueEvents['removeListener'](_0x3fb798,_0x14f172);};}exports['register']=function(_0x29e5c7){for(var _0x12450d=0x0,_0x5159e8=events[_0x5126('0x5')];_0x12450d<_0x5159e8;_0x12450d++){var _0x4af580=events[_0x12450d];var _0x4a0d8d=createListener('openchannelQueue:'+_0x4af580,_0x29e5c7);OpenchannelQueueEvents['on'](_0x4af580,_0x4a0d8d);}}; \ No newline at end of file +var _0xf841=['remove','update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x3e3748,_0x118608){var _0x467996=function(_0x475275){while(--_0x475275){_0x3e3748['push'](_0x3e3748['shift']());}};_0x467996(++_0x118608);}(_0xf841,0xd6));var _0x1f84=function(_0x2b8eb3,_0x10c689){_0x2b8eb3=_0x2b8eb3-0x0;var _0x5c99e2=_0xf841[_0x2b8eb3];return _0x5c99e2;};'use strict';var OpenchannelQueueEvents=require(_0x1f84('0x0'));var events=[_0x1f84('0x1'),_0x1f84('0x2'),_0x1f84('0x3')];function createListener(_0x4de72d,_0x3d2b1e){return function(_0x13dda7){_0x3d2b1e[_0x1f84('0x4')](_0x4de72d,_0x13dda7);};}function removeListener(_0x4b249e,_0x15f0e4){return function(){OpenchannelQueueEvents[_0x1f84('0x5')](_0x4b249e,_0x15f0e4);};}exports['register']=function(_0x1af310){for(var _0x54591a=0x0,_0x36bf5f=events[_0x1f84('0x6')];_0x54591a<_0x36bf5f;_0x54591a++){var _0x356773=events[_0x54591a];var _0x529d25=createListener(_0x1f84('0x7')+_0x356773,_0x1af310);OpenchannelQueueEvents['on'](_0x356773,_0x529d25);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 87a697f..c65d5c6 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x796f=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update'];(function(_0x942ba4,_0x511316){var _0x2d880b=function(_0x4780ef){while(--_0x4780ef){_0x942ba4['push'](_0x942ba4['shift']());}};_0x2d880b(++_0x511316);}(_0x796f,0x1a4));var _0xf796=function(_0x2f9dda,_0x56fe40){_0x2f9dda=_0x2f9dda-0x0;var _0x35aad5=_0x796f[_0x2f9dda];return _0x35aad5;};'use strict';var multer=require(_0xf796('0x0'));var util=require(_0xf796('0x1'));var path=require(_0xf796('0x2'));var timeout=require(_0xf796('0x3'));var express=require(_0xf796('0x4'));var router=express[_0xf796('0x5')]();var fs_extra=require(_0xf796('0x6'));var auth=require(_0xf796('0x7'));var interaction=require(_0xf796('0x8'));var config=require(_0xf796('0x9'));var controller=require(_0xf796('0xa'));router[_0xf796('0xb')]('/',auth[_0xf796('0xc')](),controller['index']);router[_0xf796('0xb')](_0xf796('0xd'),auth[_0xf796('0xc')](),controller[_0xf796('0xe')]);router[_0xf796('0xb')](_0xf796('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xf796('0x10')]('/',auth[_0xf796('0xc')](),controller[_0xf796('0x11')]);router[_0xf796('0x12')](_0xf796('0xf'),auth['isAuthenticated'](),controller[_0xf796('0x13')]);router[_0xf796('0x14')](_0xf796('0xf'),auth[_0xf796('0xc')](),controller[_0xf796('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0068=['./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d8be3,_0x428ee8){var _0x10083c=function(_0x14610d){while(--_0x14610d){_0x1d8be3['push'](_0x1d8be3['shift']());}};_0x10083c(++_0x428ee8);}(_0x0068,0x14c));var _0x8006=function(_0x32ad2d,_0x188218){_0x32ad2d=_0x32ad2d-0x0;var _0x2e5aa2=_0x0068[_0x32ad2d];return _0x2e5aa2;};'use strict';var multer=require(_0x8006('0x0'));var util=require('util');var path=require(_0x8006('0x1'));var timeout=require('connect-timeout');var express=require(_0x8006('0x2'));var router=express[_0x8006('0x3')]();var fs_extra=require(_0x8006('0x4'));var auth=require(_0x8006('0x5'));var interaction=require(_0x8006('0x6'));var config=require(_0x8006('0x7'));var controller=require(_0x8006('0x8'));router[_0x8006('0x9')]('/',auth['isAuthenticated'](),controller[_0x8006('0xa')]);router[_0x8006('0x9')](_0x8006('0xb'),auth[_0x8006('0xc')](),controller[_0x8006('0xd')]);router['get']('/:id',auth[_0x8006('0xc')](),controller['show']);router[_0x8006('0xe')]('/',auth[_0x8006('0xc')](),controller[_0x8006('0xf')]);router['put'](_0x8006('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8006('0x11')]('/:id',auth[_0x8006('0xc')](),controller[_0x8006('0x12')]);module[_0x8006('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 798bfc4..921b641 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38d3=['sequelize','STRING','DATE','moment'];(function(_0xb7d771,_0x2c2508){var _0x2699af=function(_0x4e0579){while(--_0x4e0579){_0xb7d771['push'](_0xb7d771['shift']());}};_0x2699af(++_0x2c2508);}(_0x38d3,0x1a7));var _0x338d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x38d3[_0x243b2f];return _0xcb3c2d;};'use strict';var moment=require(_0x338d('0x0'));var Sequelize=require(_0x338d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x338d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x338d('0x2')]},'joinAt':{'type':Sequelize[_0x338d('0x3')]},'leaveAt':{'type':Sequelize[_0x338d('0x3')]},'acceptAt':{'type':Sequelize[_0x338d('0x3')]},'exitAt':{'type':Sequelize[_0x338d('0x3')]},'reason':{'type':Sequelize[_0x338d('0x2')]}}; \ No newline at end of file +var _0x74fa=['moment','sequelize','exports','STRING','DATE'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x74fa,0x6e));var _0xa74f=function(_0x193add,_0x221a01){_0x193add=_0x193add-0x0;var _0x186be1=_0x74fa[_0x193add];return _0x186be1;};'use strict';var moment=require(_0xa74f('0x0'));var Sequelize=require(_0xa74f('0x1'));module[_0xa74f('0x2')]={'uniqueid':{'type':Sequelize[_0xa74f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa74f('0x3')]},'joinAt':{'type':Sequelize[_0xa74f('0x4')]},'leaveAt':{'type':Sequelize[_0xa74f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa74f('0x4')]},'reason':{'type':Sequelize[_0xa74f('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c196b2c..84c0d3c 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8587=['describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','destroy'];(function(_0x2ba98e,_0x26331e){var _0x4cf31b=function(_0x2e49fa){while(--_0x2e49fa){_0x2ba98e['push'](_0x2ba98e['shift']());}};_0x4cf31b(++_0x26331e);}(_0x8587,0x125));var _0x7858=function(_0x4d581a,_0x2b0ab8){_0x4d581a=_0x4d581a-0x0;var _0x29d9ae=_0x8587[_0x4d581a];return _0x29d9ae;};'use strict';var emlformat=require(_0x7858('0x0'));var rimraf=require(_0x7858('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7858('0x2'));var moment=require('moment');var BPromise=require(_0x7858('0x3'));var Mustache=require(_0x7858('0x4'));var util=require(_0x7858('0x5'));var path=require(_0x7858('0x6'));var sox=require(_0x7858('0x7'));var csv=require(_0x7858('0x8'));var ejs=require(_0x7858('0x9'));var fs=require('fs');var fs_extra=require(_0x7858('0xa'));var _=require('lodash');var squel=require(_0x7858('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7858('0x8'));var querystring=require(_0x7858('0xc'));var Papa=require(_0x7858('0xd'));var Redis=require(_0x7858('0xe'));var authService=require(_0x7858('0xf'));var qs=require(_0x7858('0x10'));var as=require(_0x7858('0x11'));var hardwareService=require(_0x7858('0x12'));var logger=require(_0x7858('0x13'))(_0x7858('0x14'));var utils=require(_0x7858('0x15'));var config=require(_0x7858('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bbe45,_0x1bf01e){_0x1bf01e=_0x1bf01e||0xcc;return function(_0x1a7f7e){if(_0x1a7f7e){return _0x3bbe45[_0x7858('0x17')](_0x1bf01e);}return _0x3bbe45['status'](_0x1bf01e)[_0x7858('0x18')]();};}function respondWithResult(_0x2bde9c,_0x111fcd){_0x111fcd=_0x111fcd||0xc8;return function(_0x36d1d1){if(_0x36d1d1){return _0x2bde9c[_0x7858('0x19')](_0x111fcd)[_0x7858('0x1a')](_0x36d1d1);}};}function respondWithFilteredResult(_0x29d362,_0x5a95f0){return function(_0x59a9eb){if(_0x59a9eb){var _0x4ce502=typeof _0x5a95f0[_0x7858('0x1b')]==='undefined'&&typeof _0x5a95f0['limit']===_0x7858('0x1c');var _0x3a05fc=_0x59a9eb[_0x7858('0x1d')];var _0x3e4c56=_0x4ce502?0x0:_0x5a95f0[_0x7858('0x1b')];var _0x347651=_0x4ce502?_0x59a9eb[_0x7858('0x1d')]:_0x5a95f0[_0x7858('0x1b')]+_0x5a95f0['limit'];var _0x1e21dd;if(_0x347651>=_0x3a05fc){_0x347651=_0x3a05fc;_0x1e21dd=0xc8;}else{_0x1e21dd=0xce;}_0x29d362['status'](_0x1e21dd);return _0x29d362[_0x7858('0x1e')](_0x7858('0x1f'),_0x3e4c56+'-'+_0x347651+'/'+_0x3a05fc)[_0x7858('0x1a')](_0x59a9eb);}return null;};}function patchUpdates(_0x4a6fd3){return function(_0x319466){try{jsonpatch['apply'](_0x319466,_0x4a6fd3,!![]);}catch(_0x212abb){return BPromise[_0x7858('0x20')](_0x212abb);}return _0x319466[_0x7858('0x21')]();};}function saveUpdates(_0x18f6bc,_0xc4d391){return function(_0x4e2914){if(_0x4e2914){return _0x4e2914[_0x7858('0x22')](_0x18f6bc)[_0x7858('0x23')](function(_0x4b8487){return _0x4b8487;});}return null;};}function removeEntity(_0x23eacb,_0x1c461a){return function(_0x32cbf1){if(_0x32cbf1){return _0x32cbf1['destroy']()[_0x7858('0x23')](function(){_0x23eacb[_0x7858('0x19')](0xcc)[_0x7858('0x18')]();});}};}function handleEntityNotFound(_0x79f938,_0x55bfb2){return function(_0x1f5d15){if(!_0x1f5d15){_0x79f938[_0x7858('0x17')](0x194);}return _0x1f5d15;};}function handleError(_0x7f5789,_0x887692){_0x887692=_0x887692||0x1f4;return function(_0xba4cbb){logger[_0x7858('0x24')](_0xba4cbb[_0x7858('0x25')]);if(_0xba4cbb[_0x7858('0x26')]){delete _0xba4cbb[_0x7858('0x26')];}_0x7f5789[_0x7858('0x19')](_0x887692)['send'](_0xba4cbb);};}exports[_0x7858('0x27')]=function(_0x58a07e,_0x1dfa2d){var _0x221722={},_0x249e2a={},_0x29055b={'count':0x0,'rows':[]};var _0x2323ad=_[_0x7858('0x28')](db[_0x7858('0x29')][_0x7858('0x2a')],function(_0x1e5e89){return{'name':_0x1e5e89['fieldName'],'type':_0x1e5e89[_0x7858('0x2b')]['key']};});_0x249e2a[_0x7858('0x2c')]=_[_0x7858('0x28')](_0x2323ad,_0x7858('0x26'));_0x249e2a[_0x7858('0x2d')]=_[_0x7858('0x2e')](_0x58a07e[_0x7858('0x2d')]);_0x249e2a[_0x7858('0x2f')]=_[_0x7858('0x30')](_0x249e2a[_0x7858('0x2c')],_0x249e2a[_0x7858('0x2d')]);_0x221722[_0x7858('0x31')]=_[_0x7858('0x30')](_0x249e2a[_0x7858('0x2c')],qs['fields'](_0x58a07e[_0x7858('0x2d')][_0x7858('0x32')]));_0x221722['attributes']=_0x221722[_0x7858('0x31')][_0x7858('0x33')]?_0x221722[_0x7858('0x31')]:_0x249e2a[_0x7858('0x2c')];if(!_0x58a07e['query'][_0x7858('0x34')](_0x7858('0x35'))){_0x221722[_0x7858('0x36')]=qs[_0x7858('0x36')](_0x58a07e['query']['limit']);_0x221722[_0x7858('0x1b')]=qs[_0x7858('0x1b')](_0x58a07e[_0x7858('0x2d')][_0x7858('0x1b')]);}_0x221722[_0x7858('0x37')]=qs[_0x7858('0x38')](_0x58a07e['query']['sort']);_0x221722[_0x7858('0x39')]=qs[_0x7858('0x2f')](_[_0x7858('0x3a')](_0x58a07e[_0x7858('0x2d')],_0x249e2a[_0x7858('0x2f')]),_0x2323ad);if(_0x58a07e[_0x7858('0x2d')][_0x7858('0x3b')]){_0x221722[_0x7858('0x39')]=_[_0x7858('0x3c')](_0x221722['where'],{'$or':_[_0x7858('0x28')](_0x2323ad,function(_0x1ee061){if(_0x1ee061[_0x7858('0x2b')]!==_0x7858('0x3d')){var _0x14e5ff={};_0x14e5ff[_0x1ee061[_0x7858('0x26')]]={'$like':'%'+_0x58a07e[_0x7858('0x2d')]['filter']+'%'};return _0x14e5ff;}})});}_0x221722=_['merge']({},_0x221722,_0x58a07e[_0x7858('0x3e')]);var _0x3b7c67={'where':_0x221722[_0x7858('0x39')]};return db['OpenchannelQueueReport'][_0x7858('0x1d')](_0x3b7c67)[_0x7858('0x23')](function(_0x457dfa){_0x29055b[_0x7858('0x1d')]=_0x457dfa;if(_0x58a07e['query'][_0x7858('0x3f')]){_0x221722['include']=[{'all':!![]}];}return db[_0x7858('0x29')]['findAll'](_0x221722);})['then'](function(_0x4c8c93){_0x29055b[_0x7858('0x40')]=_0x4c8c93;return _0x29055b;})['then'](respondWithFilteredResult(_0x1dfa2d,_0x221722))[_0x7858('0x41')](handleError(_0x1dfa2d,null));};exports['show']=function(_0x3a819a,_0x179c9b){var _0x3c7d08={'raw':!![],'where':{'id':_0x3a819a[_0x7858('0x42')]['id']}},_0x5936c2={};_0x5936c2[_0x7858('0x2c')]=_[_0x7858('0x2e')](db[_0x7858('0x29')][_0x7858('0x2a')]);_0x5936c2[_0x7858('0x2d')]=_[_0x7858('0x2e')](_0x3a819a[_0x7858('0x2d')]);_0x5936c2[_0x7858('0x2f')]=_[_0x7858('0x30')](_0x5936c2['model'],_0x5936c2[_0x7858('0x2d')]);_0x3c7d08[_0x7858('0x31')]=_[_0x7858('0x30')](_0x5936c2[_0x7858('0x2c')],qs[_0x7858('0x32')](_0x3a819a[_0x7858('0x2d')][_0x7858('0x32')]));_0x3c7d08[_0x7858('0x31')]=_0x3c7d08[_0x7858('0x31')][_0x7858('0x33')]?_0x3c7d08[_0x7858('0x31')]:_0x5936c2[_0x7858('0x2c')];if(_0x3a819a[_0x7858('0x2d')][_0x7858('0x3f')]){_0x3c7d08[_0x7858('0x43')]=[{'all':!![]}];}_0x3c7d08=_[_0x7858('0x3c')]({},_0x3c7d08,_0x3a819a[_0x7858('0x3e')]);return db[_0x7858('0x29')][_0x7858('0x44')](_0x3c7d08)[_0x7858('0x23')](handleEntityNotFound(_0x179c9b,null))['then'](respondWithResult(_0x179c9b,null))[_0x7858('0x41')](handleError(_0x179c9b,null));};exports['create']=function(_0x18e0be,_0x4ecec7){return db['OpenchannelQueueReport'][_0x7858('0x45')](_0x18e0be[_0x7858('0x46')],{})['then'](respondWithResult(_0x4ecec7,0xc9))[_0x7858('0x41')](handleError(_0x4ecec7,null));};exports[_0x7858('0x22')]=function(_0x6d68db,_0x5afa1a){if(_0x6d68db['body']['id']){delete _0x6d68db[_0x7858('0x46')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x6d68db['params']['id']}})[_0x7858('0x23')](handleEntityNotFound(_0x5afa1a,null))['then'](saveUpdates(_0x6d68db[_0x7858('0x46')],null))['then'](respondWithResult(_0x5afa1a,null))['catch'](handleError(_0x5afa1a,null));};exports[_0x7858('0x47')]=function(_0x2ed961,_0x16f9d5){return db[_0x7858('0x29')][_0x7858('0x44')]({'where':{'id':_0x2ed961[_0x7858('0x42')]['id']}})['then'](handleEntityNotFound(_0x16f9d5,null))[_0x7858('0x23')](removeEntity(_0x16f9d5,null))['catch'](handleError(_0x16f9d5,null));};exports[_0x7858('0x48')]=function(_0x3806af,_0x2c2c5c){return db['OpenchannelQueueReport'][_0x7858('0x48')]()['then'](respondWithResult(_0x2c2c5c,null))['catch'](handleError(_0x2c2c5c,null));}; \ No newline at end of file +var _0x968d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','save','then','error','stack','name','send','OpenchannelQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0x968d,0x1ae));var _0xd968=function(_0x1d9762,_0x3a432c){_0x1d9762=_0x1d9762-0x0;var _0x203315=_0x968d[_0x1d9762];return _0x203315;};'use strict';var emlformat=require(_0xd968('0x0'));var rimraf=require(_0xd968('0x1'));var zipdir=require(_0xd968('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd968('0x3'));var moment=require(_0xd968('0x4'));var BPromise=require(_0xd968('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd968('0x6'));var csv=require(_0xd968('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd968('0x8'));var _=require(_0xd968('0x9'));var squel=require(_0xd968('0xa'));var crypto=require(_0xd968('0xb'));var jsforce=require(_0xd968('0xc'));var deskjs=require(_0xd968('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd968('0xe'));var Papa=require(_0xd968('0xf'));var Redis=require('ioredis');var authService=require(_0xd968('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd968('0x11'));var hardwareService=require(_0xd968('0x12'));var logger=require(_0xd968('0x13'))(_0xd968('0x14'));var utils=require(_0xd968('0x15'));var config=require(_0xd968('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd968('0x17'))['db'];function respondWithStatusCode(_0x4f4b76,_0x161a9a){_0x161a9a=_0x161a9a||0xcc;return function(_0x201a6b){if(_0x201a6b){return _0x4f4b76[_0xd968('0x18')](_0x161a9a);}return _0x4f4b76[_0xd968('0x19')](_0x161a9a)[_0xd968('0x1a')]();};}function respondWithResult(_0x69e6a9,_0x57a2e9){_0x57a2e9=_0x57a2e9||0xc8;return function(_0x5d0152){if(_0x5d0152){return _0x69e6a9[_0xd968('0x19')](_0x57a2e9)[_0xd968('0x1b')](_0x5d0152);}};}function respondWithFilteredResult(_0x4edb50,_0x30b892){return function(_0x2443e4){if(_0x2443e4){var _0x26b568=typeof _0x30b892[_0xd968('0x1c')]===_0xd968('0x1d')&&typeof _0x30b892[_0xd968('0x1e')]==='undefined';var _0x510fb0=_0x2443e4[_0xd968('0x1f')];var _0x230b4e=_0x26b568?0x0:_0x30b892[_0xd968('0x1c')];var _0x4a1ed8=_0x26b568?_0x2443e4[_0xd968('0x1f')]:_0x30b892[_0xd968('0x1c')]+_0x30b892[_0xd968('0x1e')];var _0x2ed266;if(_0x4a1ed8>=_0x510fb0){_0x4a1ed8=_0x510fb0;_0x2ed266=0xc8;}else{_0x2ed266=0xce;}_0x4edb50[_0xd968('0x19')](_0x2ed266);return _0x4edb50[_0xd968('0x20')](_0xd968('0x21'),_0x230b4e+'-'+_0x4a1ed8+'/'+_0x510fb0)[_0xd968('0x1b')](_0x2443e4);}return null;};}function patchUpdates(_0x4fd98e){return function(_0xec432d){try{jsonpatch[_0xd968('0x22')](_0xec432d,_0x4fd98e,!![]);}catch(_0x34fb3c){return BPromise[_0xd968('0x23')](_0x34fb3c);}return _0xec432d[_0xd968('0x24')]();};}function saveUpdates(_0x4b2bf2,_0x4f2a95){return function(_0x36e875){if(_0x36e875){return _0x36e875['update'](_0x4b2bf2)[_0xd968('0x25')](function(_0x41f88c){return _0x41f88c;});}return null;};}function removeEntity(_0x1f936d,_0x23a1b0){return function(_0x3a135c){if(_0x3a135c){return _0x3a135c['destroy']()[_0xd968('0x25')](function(){_0x1f936d[_0xd968('0x19')](0xcc)[_0xd968('0x1a')]();});}};}function handleEntityNotFound(_0x1da4ce,_0xe52689){return function(_0x30cd31){if(!_0x30cd31){_0x1da4ce['sendStatus'](0x194);}return _0x30cd31;};}function handleError(_0x12c14b,_0xc6a60e){_0xc6a60e=_0xc6a60e||0x1f4;return function(_0x408789){logger[_0xd968('0x26')](_0x408789[_0xd968('0x27')]);if(_0x408789[_0xd968('0x28')]){delete _0x408789[_0xd968('0x28')];}_0x12c14b[_0xd968('0x19')](_0xc6a60e)[_0xd968('0x29')](_0x408789);};}exports['index']=function(_0x361b51,_0x3a4243){var _0x756c5a={},_0x3aa02b={},_0x47723c={'count':0x0,'rows':[]};var _0x1948b6=_['map'](db[_0xd968('0x2a')][_0xd968('0x2b')],function(_0x3d118d){return{'name':_0x3d118d[_0xd968('0x2c')],'type':_0x3d118d[_0xd968('0x2d')]['key']};});_0x3aa02b[_0xd968('0x2e')]=_[_0xd968('0x2f')](_0x1948b6,_0xd968('0x28'));_0x3aa02b[_0xd968('0x30')]=_['keys'](_0x361b51[_0xd968('0x30')]);_0x3aa02b[_0xd968('0x31')]=_[_0xd968('0x32')](_0x3aa02b[_0xd968('0x2e')],_0x3aa02b[_0xd968('0x30')]);_0x756c5a[_0xd968('0x33')]=_[_0xd968('0x32')](_0x3aa02b[_0xd968('0x2e')],qs[_0xd968('0x34')](_0x361b51[_0xd968('0x30')][_0xd968('0x34')]));_0x756c5a[_0xd968('0x33')]=_0x756c5a['attributes'][_0xd968('0x35')]?_0x756c5a[_0xd968('0x33')]:_0x3aa02b[_0xd968('0x2e')];if(!_0x361b51[_0xd968('0x30')][_0xd968('0x36')](_0xd968('0x37'))){_0x756c5a[_0xd968('0x1e')]=qs['limit'](_0x361b51[_0xd968('0x30')][_0xd968('0x1e')]);_0x756c5a[_0xd968('0x1c')]=qs['offset'](_0x361b51[_0xd968('0x30')]['offset']);}_0x756c5a[_0xd968('0x38')]=qs['sort'](_0x361b51['query'][_0xd968('0x39')]);_0x756c5a[_0xd968('0x3a')]=qs[_0xd968('0x31')](_[_0xd968('0x3b')](_0x361b51[_0xd968('0x30')],_0x3aa02b[_0xd968('0x31')]),_0x1948b6);if(_0x361b51[_0xd968('0x30')][_0xd968('0x3c')]){_0x756c5a['where']=_[_0xd968('0x3d')](_0x756c5a[_0xd968('0x3a')],{'$or':_[_0xd968('0x2f')](_0x1948b6,function(_0x530ab2){if(_0x530ab2[_0xd968('0x2d')]!==_0xd968('0x3e')){var _0x19788b={};_0x19788b[_0x530ab2[_0xd968('0x28')]]={'$like':'%'+_0x361b51[_0xd968('0x30')][_0xd968('0x3c')]+'%'};return _0x19788b;}})});}_0x756c5a=_[_0xd968('0x3d')]({},_0x756c5a,_0x361b51[_0xd968('0x3f')]);var _0x510bb4={'where':_0x756c5a[_0xd968('0x3a')]};return db[_0xd968('0x2a')][_0xd968('0x1f')](_0x510bb4)[_0xd968('0x25')](function(_0x75848c){_0x47723c[_0xd968('0x1f')]=_0x75848c;if(_0x361b51['query'][_0xd968('0x40')]){_0x756c5a[_0xd968('0x41')]=[{'all':!![]}];}return db[_0xd968('0x2a')]['findAll'](_0x756c5a);})[_0xd968('0x25')](function(_0x3494d9){_0x47723c['rows']=_0x3494d9;return _0x47723c;})[_0xd968('0x25')](respondWithFilteredResult(_0x3a4243,_0x756c5a))[_0xd968('0x42')](handleError(_0x3a4243,null));};exports['show']=function(_0x572afb,_0x566c9d){var _0x3bb799={'raw':!![],'where':{'id':_0x572afb[_0xd968('0x43')]['id']}},_0x4032ab={};_0x4032ab[_0xd968('0x2e')]=_['keys'](db[_0xd968('0x2a')][_0xd968('0x2b')]);_0x4032ab['query']=_[_0xd968('0x44')](_0x572afb['query']);_0x4032ab['filters']=_['intersection'](_0x4032ab['model'],_0x4032ab[_0xd968('0x30')]);_0x3bb799['attributes']=_[_0xd968('0x32')](_0x4032ab['model'],qs[_0xd968('0x34')](_0x572afb[_0xd968('0x30')][_0xd968('0x34')]));_0x3bb799[_0xd968('0x33')]=_0x3bb799[_0xd968('0x33')][_0xd968('0x35')]?_0x3bb799[_0xd968('0x33')]:_0x4032ab['model'];if(_0x572afb[_0xd968('0x30')]['includeAll']){_0x3bb799[_0xd968('0x41')]=[{'all':!![]}];}_0x3bb799=_[_0xd968('0x3d')]({},_0x3bb799,_0x572afb[_0xd968('0x3f')]);return db[_0xd968('0x2a')][_0xd968('0x45')](_0x3bb799)[_0xd968('0x25')](handleEntityNotFound(_0x566c9d,null))['then'](respondWithResult(_0x566c9d,null))[_0xd968('0x42')](handleError(_0x566c9d,null));};exports[_0xd968('0x46')]=function(_0x4150fe,_0x7710af){return db[_0xd968('0x2a')][_0xd968('0x46')](_0x4150fe[_0xd968('0x47')],{})['then'](respondWithResult(_0x7710af,0xc9))[_0xd968('0x42')](handleError(_0x7710af,null));};exports['update']=function(_0x18237a,_0x25b486){if(_0x18237a[_0xd968('0x47')]['id']){delete _0x18237a[_0xd968('0x47')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x18237a[_0xd968('0x43')]['id']}})[_0xd968('0x25')](handleEntityNotFound(_0x25b486,null))[_0xd968('0x25')](saveUpdates(_0x18237a[_0xd968('0x47')],null))[_0xd968('0x25')](respondWithResult(_0x25b486,null))['catch'](handleError(_0x25b486,null));};exports['destroy']=function(_0x24b617,_0x2448ab){return db[_0xd968('0x2a')][_0xd968('0x45')]({'where':{'id':_0x24b617[_0xd968('0x43')]['id']}})[_0xd968('0x25')](handleEntityNotFound(_0x2448ab,null))[_0xd968('0x25')](removeEntity(_0x2448ab,null))[_0xd968('0x42')](handleError(_0x2448ab,null));};exports['describe']=function(_0x54e11b,_0x45fa18){return db[_0xd968('0x2a')][_0xd968('0x48')]()[_0xd968('0x25')](respondWithResult(_0x45fa18,null))['catch'](handleError(_0x45fa18,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 978b936..1a493b6 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2c84fa,_0x59c5e2){var _0x5d58f7=function(_0x3da52c){while(--_0x3da52c){_0x2c84fa['push'](_0x2c84fa['shift']());}};_0x5d58f7(++_0x59c5e2);}(_0x1261,0x144));var _0x1126=function(_0x3ebcab,_0x482df2){_0x3ebcab=_0x3ebcab-0x0;var _0x4074d3=_0x1261[_0x3ebcab];return _0x4074d3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x814b,0x1a2));var _0xb814=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x814b[_0x42bb6d];return _0x1db89b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2673a47..a2df9c6 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44a=['CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','update','where','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x175f59,_0xca973e){var _0x5e63fa=function(_0x35cce3){while(--_0x35cce3){_0x175f59['push'](_0x175f59['shift']());}};_0x5e63fa(++_0xca973e);}(_0xb44a,0x1c2));var _0xab44=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0xb44a[_0xe8129c];return _0x709fc5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['create'](_0x354b09[_0xab44('0x14')],{'raw':_0x354b09[_0xab44('0x15')]?_0x354b09[_0xab44('0x15')][_0xab44('0x16')]===undefined?!![]:![]:!![]})[_0xab44('0x9')](function(_0x5123b1){logger[_0xab44('0x10')]('CreateOpenchannelQueueReport',_0x354b09);logger[_0xab44('0xb')](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x5123b1));_0x310b15(_0x5123b1);})[_0xab44('0x11')](function(_0x486317){logger[_0xab44('0xd')](_0xab44('0x12'),_0x486317[_0xab44('0xf')],_0x354b09);_0xc4b3dc(_0x44fa43[_0xab44('0xd')](0x1f4,_0x486317[_0xab44('0xf')]));});});};exports[_0xab44('0x17')]=function(_0x43f1c6){var _0x554955=this;return new Promise(function(_0x595761,_0x1d4a2f){return db['OpenchannelQueueReport'][_0xab44('0x18')](_0x43f1c6['body'],{'raw':_0x43f1c6[_0xab44('0x15')]?_0x43f1c6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f1c6[_0xab44('0x15')]?_0x43f1c6[_0xab44('0x15')][_0xab44('0x19')]||null:null,'attributes':_0x43f1c6[_0xab44('0x15')]?_0x43f1c6[_0xab44('0x15')]['attributes']||null:null,'limit':_0x43f1c6[_0xab44('0x15')]?_0x43f1c6[_0xab44('0x15')]['limit']||null:null})[_0xab44('0x9')](function(_0xebb7d1){logger[_0xab44('0x10')](_0xab44('0x17'),_0x43f1c6);logger[_0xab44('0xb')](_0xab44('0x17'),_0x43f1c6,JSON['stringify'](_0xebb7d1));_0x595761(_0xebb7d1);})[_0xab44('0x11')](function(_0x43a42d){logger[_0xab44('0xd')]('UpdateOpenchannelQueueReport',_0x43a42d['message'],_0x43f1c6);_0x1d4a2f(_0x554955[_0xab44('0xd')](0x1f4,_0x43a42d['message']));});});}; \ No newline at end of file +var _0x06ef=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueueReport,\x20%s,\x20%s','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','moment','../../config/utils','../../config/logger'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x06ef,0x185));var _0xf06e=function(_0x2490a9,_0x182636){_0x2490a9=_0x2490a9-0x0;var _0x3552f9=_0x06ef[_0x2490a9];return _0x3552f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf06e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var config=require('../../config/environment');var jayson=require(_0xf06e('0x4'));var client=jayson[_0xf06e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b74b,_0x4e05dc,_0x5cddf1){return new BPromise(function(_0x4ccbee,_0x25b56e){return client[_0xf06e('0x6')](_0x59b74b,_0x5cddf1)[_0xf06e('0x7')](function(_0x2bb08c){logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));logger[_0xf06e('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'),JSON[_0xf06e('0xb')](_0x2bb08c));if(_0x2bb08c[_0xf06e('0xc')]){if(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xd')]===0x1f4){logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);return _0x25b56e(_0x2bb08c['error'][_0xf06e('0xe')]);}logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c['error']['message']);return _0x4ccbee(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);}else{logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));_0x4ccbee(_0x2bb08c[_0xf06e('0xf')][_0xf06e('0xe')]);}})[_0xf06e('0x10')](function(_0x44157a){logger[_0xf06e('0xc')](_0xf06e('0x11'),_0x4e05dc,_0x44157a);_0x25b56e(_0x44157a);});});}exports['CreateOpenchannelQueueReport']=function(_0x380c07){var _0x55dabf=this;return new Promise(function(_0x251c9f,_0x7a9f4b){return db['OpenchannelQueueReport']['create'](_0x380c07[_0xf06e('0x12')],{'raw':_0x380c07[_0xf06e('0x13')]?_0x380c07['options']['raw']===undefined?!![]:![]:!![]})[_0xf06e('0x7')](function(_0x211590){logger[_0xf06e('0x8')]('CreateOpenchannelQueueReport',_0x380c07);logger[_0xf06e('0xa')](_0xf06e('0x14'),_0x380c07,JSON['stringify'](_0x211590));_0x251c9f(_0x211590);})[_0xf06e('0x10')](function(_0x1ba130){logger[_0xf06e('0xc')]('CreateOpenchannelQueueReport',_0x1ba130[_0xf06e('0xe')],_0x380c07);_0x7a9f4b(_0x55dabf[_0xf06e('0xc')](0x1f4,_0x1ba130[_0xf06e('0xe')]));});});};exports[_0xf06e('0x15')]=function(_0x3b410e){var _0x4c2d01=this;return new Promise(function(_0x3a969c,_0x4923d3){return db[_0xf06e('0x16')][_0xf06e('0x17')](_0x3b410e[_0xf06e('0x12')],{'raw':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x19')]||null:null,'attributes':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1a')]||null:null,'limit':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1b')]||null:null})[_0xf06e('0x7')](function(_0x89a74f){logger[_0xf06e('0x8')](_0xf06e('0x15'),_0x3b410e);logger['debug'](_0xf06e('0x15'),_0x3b410e,JSON[_0xf06e('0xb')](_0x89a74f));_0x3a969c(_0x89a74f);})[_0xf06e('0x10')](function(_0x5d21f7){logger[_0xf06e('0xc')](_0xf06e('0x15'),_0x5d21f7[_0xf06e('0xe')],_0x3b410e);_0x4923d3(_0x4c2d01[_0xf06e('0xc')](0x1f4,_0x5d21f7[_0xf06e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d46af63..784c833 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6cb=['show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x18bd2b,_0xa20c19){var _0x5a1b4d=function(_0x3c6db7){while(--_0x3c6db7){_0x18bd2b['push'](_0x18bd2b['shift']());}};_0x5a1b4d(++_0xa20c19);}(_0xc6cb,0xd6));var _0xbc6c=function(_0x466a11,_0x3edc77){_0x466a11=_0x466a11-0x0;var _0x1d7350=_0xc6cb[_0x466a11];return _0x1d7350;};'use strict';var multer=require(_0xbc6c('0x0'));var util=require(_0xbc6c('0x1'));var path=require(_0xbc6c('0x2'));var timeout=require(_0xbc6c('0x3'));var express=require(_0xbc6c('0x4'));var router=express[_0xbc6c('0x5')]();var fs_extra=require(_0xbc6c('0x6'));var auth=require(_0xbc6c('0x7'));var interaction=require(_0xbc6c('0x8'));var config=require('../../config/environment');var controller=require(_0xbc6c('0x9'));router[_0xbc6c('0xa')]('/',auth[_0xbc6c('0xb')](),controller['index']);router[_0xbc6c('0xa')](_0xbc6c('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbc6c('0xa')](_0xbc6c('0xd'),auth['isAuthenticated'](),controller[_0xbc6c('0xe')]);router[_0xbc6c('0xf')]('/',auth['isAuthenticated'](),controller[_0xbc6c('0x10')]);router['put'](_0xbc6c('0xd'),auth[_0xbc6c('0xb')](),controller['update']);router['delete'](_0xbc6c('0xd'),auth['isAuthenticated'](),controller[_0xbc6c('0x11')]);module[_0xbc6c('0x12')]=router; \ No newline at end of file +var _0x357a=['index','/describe','describe','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x357a,0xbd));var _0xa357=function(_0x5775fa,_0x240df0){_0x5775fa=_0x5775fa-0x0;var _0x410306=_0x357a[_0x5775fa];return _0x410306;};'use strict';var multer=require(_0xa357('0x0'));var util=require(_0xa357('0x1'));var path=require(_0xa357('0x2'));var timeout=require(_0xa357('0x3'));var express=require(_0xa357('0x4'));var router=express[_0xa357('0x5')]();var fs_extra=require(_0xa357('0x6'));var auth=require(_0xa357('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa357('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xa357('0x9')]('/',auth[_0xa357('0xa')](),controller[_0xa357('0xb')]);router[_0xa357('0x9')](_0xa357('0xc'),auth[_0xa357('0xa')](),controller[_0xa357('0xd')]);router[_0xa357('0x9')](_0xa357('0xe'),auth[_0xa357('0xa')](),controller[_0xa357('0xf')]);router['post']('/',auth[_0xa357('0xa')](),controller[_0xa357('0x10')]);router[_0xa357('0x11')](_0xa357('0xe'),auth[_0xa357('0xa')](),controller['update']);router[_0xa357('0x12')](_0xa357('0xe'),auth[_0xa357('0xa')](),controller['destroy']);module[_0xa357('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index aaff148..6043ebe 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x463a03,_0x13914f){var _0x5baa30=function(_0xa6d459){while(--_0xa6d459){_0x463a03['push'](_0x463a03['shift']());}};_0x5baa30(++_0x13914f);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4dc67d,_0x236c92){var _0x258f85=function(_0x3f6bd5){while(--_0x3f6bd5){_0x4dc67d['push'](_0x4dc67d['shift']());}};_0x258f85(++_0x236c92);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xcb91[_0x352e09];return _0x1b7094;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4513893..982347b 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x918c=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','rawAttributes','includeAll','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','bluebird','util','path','to-csv','ejs'];(function(_0x15265e,_0x365456){var _0x16fab4=function(_0x270484){while(--_0x270484){_0x15265e['push'](_0x15265e['shift']());}};_0x16fab4(++_0x365456);}(_0x918c,0x160));var _0xc918=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x918c[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require(_0xc918('0x0'));var rimraf=require(_0xc918('0x1'));var zipdir=require(_0xc918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc918('0x3'));var Mustache=require('mustache');var util=require(_0xc918('0x4'));var path=require(_0xc918('0x5'));var sox=require('sox');var csv=require(_0xc918('0x6'));var ejs=require(_0xc918('0x7'));var fs=require('fs');var fs_extra=require(_0xc918('0x8'));var _=require(_0xc918('0x9'));var squel=require('squel');var crypto=require(_0xc918('0xa'));var jsforce=require(_0xc918('0xb'));var deskjs=require(_0xc918('0xc'));var toCsv=require(_0xc918('0x6'));var querystring=require(_0xc918('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc918('0xe'));var as=require(_0xc918('0xf'));var hardwareService=require(_0xc918('0x10'));var logger=require(_0xc918('0x11'))(_0xc918('0x12'));var utils=require(_0xc918('0x13'));var config=require(_0xc918('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc918('0x15'))['db'];function respondWithStatusCode(_0x30951d,_0x9a3fca){_0x9a3fca=_0x9a3fca||0xcc;return function(_0x292220){if(_0x292220){return _0x30951d[_0xc918('0x16')](_0x9a3fca);}return _0x30951d['status'](_0x9a3fca)[_0xc918('0x17')]();};}function respondWithResult(_0x2c9e2a,_0x31543e){_0x31543e=_0x31543e||0xc8;return function(_0x4f3a31){if(_0x4f3a31){return _0x2c9e2a[_0xc918('0x18')](_0x31543e)['json'](_0x4f3a31);}};}function respondWithFilteredResult(_0x573cb2,_0x5280b6){return function(_0xb2a05b){if(_0xb2a05b){var _0x4e7759=typeof _0x5280b6[_0xc918('0x19')]===_0xc918('0x1a')&&typeof _0x5280b6['limit']==='undefined';var _0x26b27=_0xb2a05b['count'];var _0x42704a=_0x4e7759?0x0:_0x5280b6[_0xc918('0x19')];var _0xa86fa7=_0x4e7759?_0xb2a05b[_0xc918('0x1b')]:_0x5280b6[_0xc918('0x19')]+_0x5280b6[_0xc918('0x1c')];var _0x1646c1;if(_0xa86fa7>=_0x26b27){_0xa86fa7=_0x26b27;_0x1646c1=0xc8;}else{_0x1646c1=0xce;}_0x573cb2['status'](_0x1646c1);return _0x573cb2[_0xc918('0x1d')](_0xc918('0x1e'),_0x42704a+'-'+_0xa86fa7+'/'+_0x26b27)['json'](_0xb2a05b);}return null;};}function patchUpdates(_0xc9c8ff){return function(_0x32270a){try{jsonpatch[_0xc918('0x1f')](_0x32270a,_0xc9c8ff,!![]);}catch(_0x70b1c1){return BPromise[_0xc918('0x20')](_0x70b1c1);}return _0x32270a[_0xc918('0x21')]();};}function saveUpdates(_0x56b3ec,_0x4c3ee1){return function(_0x4d2e3b){if(_0x4d2e3b){return _0x4d2e3b['update'](_0x56b3ec)['then'](function(_0x5b97b8){return _0x5b97b8;});}return null;};}function removeEntity(_0x24abeb,_0x2d0235){return function(_0x3581d3){if(_0x3581d3){return _0x3581d3[_0xc918('0x22')]()[_0xc918('0x23')](function(){_0x24abeb['status'](0xcc)[_0xc918('0x17')]();});}};}function handleEntityNotFound(_0x2fdf30,_0x3c02f9){return function(_0x232403){if(!_0x232403){_0x2fdf30[_0xc918('0x16')](0x194);}return _0x232403;};}function handleError(_0x12c092,_0x5b187d){_0x5b187d=_0x5b187d||0x1f4;return function(_0x4c6e05){logger[_0xc918('0x24')](_0x4c6e05[_0xc918('0x25')]);if(_0x4c6e05[_0xc918('0x26')]){delete _0x4c6e05['name'];}_0x12c092['status'](_0x5b187d)['send'](_0x4c6e05);};}exports[_0xc918('0x27')]=function(_0xa06f0b,_0x1d6673){var _0x408c4b={},_0xcbe0f8={},_0x22a5f9={'count':0x0,'rows':[]};var _0x36e0ca=_[_0xc918('0x28')](db[_0xc918('0x29')]['rawAttributes'],function(_0x580656){return{'name':_0x580656['fieldName'],'type':_0x580656['type'][_0xc918('0x2a')]};});_0xcbe0f8['model']=_[_0xc918('0x28')](_0x36e0ca,_0xc918('0x26'));_0xcbe0f8[_0xc918('0x2b')]=_[_0xc918('0x2c')](_0xa06f0b[_0xc918('0x2b')]);_0xcbe0f8[_0xc918('0x2d')]=_[_0xc918('0x2e')](_0xcbe0f8[_0xc918('0x2f')],_0xcbe0f8[_0xc918('0x2b')]);_0x408c4b[_0xc918('0x30')]=_[_0xc918('0x2e')](_0xcbe0f8[_0xc918('0x2f')],qs[_0xc918('0x31')](_0xa06f0b[_0xc918('0x2b')]['fields']));_0x408c4b[_0xc918('0x30')]=_0x408c4b[_0xc918('0x30')][_0xc918('0x32')]?_0x408c4b[_0xc918('0x30')]:_0xcbe0f8[_0xc918('0x2f')];if(!_0xa06f0b['query'][_0xc918('0x33')](_0xc918('0x34'))){_0x408c4b[_0xc918('0x1c')]=qs[_0xc918('0x1c')](_0xa06f0b[_0xc918('0x2b')][_0xc918('0x1c')]);_0x408c4b[_0xc918('0x19')]=qs[_0xc918('0x19')](_0xa06f0b[_0xc918('0x2b')][_0xc918('0x19')]);}_0x408c4b['order']=qs[_0xc918('0x35')](_0xa06f0b[_0xc918('0x2b')][_0xc918('0x35')]);_0x408c4b[_0xc918('0x36')]=qs[_0xc918('0x2d')](_[_0xc918('0x37')](_0xa06f0b['query'],_0xcbe0f8[_0xc918('0x2d')]),_0x36e0ca);if(_0xa06f0b[_0xc918('0x2b')][_0xc918('0x38')]){_0x408c4b['where']=_['merge'](_0x408c4b[_0xc918('0x36')],{'$or':_[_0xc918('0x28')](_0x36e0ca,function(_0x13cfa4){if(_0x13cfa4['type']!==_0xc918('0x39')){var _0x4c3cd7={};_0x4c3cd7[_0x13cfa4[_0xc918('0x26')]]={'$like':'%'+_0xa06f0b[_0xc918('0x2b')]['filter']+'%'};return _0x4c3cd7;}})});}_0x408c4b=_[_0xc918('0x3a')]({},_0x408c4b,_0xa06f0b[_0xc918('0x3b')]);var _0x2959b6={'where':_0x408c4b[_0xc918('0x36')]};return db['OpenchannelTransferReport'][_0xc918('0x1b')](_0x2959b6)[_0xc918('0x23')](function(_0x4dcd2e){_0x22a5f9[_0xc918('0x1b')]=_0x4dcd2e;if(_0xa06f0b[_0xc918('0x2b')]['includeAll']){_0x408c4b[_0xc918('0x3c')]=[{'all':!![]}];}return db[_0xc918('0x29')][_0xc918('0x3d')](_0x408c4b);})['then'](function(_0x4f0070){_0x22a5f9['rows']=_0x4f0070;return _0x22a5f9;})['then'](respondWithFilteredResult(_0x1d6673,_0x408c4b))['catch'](handleError(_0x1d6673,null));};exports[_0xc918('0x3e')]=function(_0x5be383,_0x11b189){var _0x24b2a2={'raw':!![],'where':{'id':_0x5be383[_0xc918('0x3f')]['id']}},_0x41cc87={};_0x41cc87[_0xc918('0x2f')]=_[_0xc918('0x2c')](db[_0xc918('0x29')][_0xc918('0x40')]);_0x41cc87[_0xc918('0x2b')]=_[_0xc918('0x2c')](_0x5be383[_0xc918('0x2b')]);_0x41cc87[_0xc918('0x2d')]=_[_0xc918('0x2e')](_0x41cc87[_0xc918('0x2f')],_0x41cc87['query']);_0x24b2a2[_0xc918('0x30')]=_[_0xc918('0x2e')](_0x41cc87[_0xc918('0x2f')],qs[_0xc918('0x31')](_0x5be383[_0xc918('0x2b')][_0xc918('0x31')]));_0x24b2a2[_0xc918('0x30')]=_0x24b2a2['attributes'][_0xc918('0x32')]?_0x24b2a2[_0xc918('0x30')]:_0x41cc87[_0xc918('0x2f')];if(_0x5be383[_0xc918('0x2b')][_0xc918('0x41')]){_0x24b2a2[_0xc918('0x3c')]=[{'all':!![]}];}_0x24b2a2=_[_0xc918('0x3a')]({},_0x24b2a2,_0x5be383[_0xc918('0x3b')]);return db[_0xc918('0x29')][_0xc918('0x42')](_0x24b2a2)[_0xc918('0x23')](handleEntityNotFound(_0x11b189,null))[_0xc918('0x23')](respondWithResult(_0x11b189,null))[_0xc918('0x43')](handleError(_0x11b189,null));};exports['create']=function(_0xcbb779,_0x359e49){return db['OpenchannelTransferReport'][_0xc918('0x44')](_0xcbb779['body'],{})[_0xc918('0x23')](respondWithResult(_0x359e49,0xc9))['catch'](handleError(_0x359e49,null));};exports[_0xc918('0x45')]=function(_0x35b6ff,_0x440a02){if(_0x35b6ff[_0xc918('0x46')]['id']){delete _0x35b6ff[_0xc918('0x46')]['id'];}return db[_0xc918('0x29')]['find']({'where':{'id':_0x35b6ff[_0xc918('0x3f')]['id']}})[_0xc918('0x23')](handleEntityNotFound(_0x440a02,null))[_0xc918('0x23')](saveUpdates(_0x35b6ff['body'],null))[_0xc918('0x23')](respondWithResult(_0x440a02,null))[_0xc918('0x43')](handleError(_0x440a02,null));};exports['destroy']=function(_0xc9db3c,_0xbd172b){return db[_0xc918('0x29')][_0xc918('0x42')]({'where':{'id':_0xc9db3c[_0xc918('0x3f')]['id']}})[_0xc918('0x23')](handleEntityNotFound(_0xbd172b,null))['then'](removeEntity(_0xbd172b,null))[_0xc918('0x43')](handleError(_0xbd172b,null));};exports['describe']=function(_0x357499,_0x36bbf7){return db[_0xc918('0x29')][_0xc918('0x47')]()[_0xc918('0x23')](respondWithResult(_0x36bbf7,null))[_0xc918('0x43')](handleError(_0x36bbf7,null));}; \ No newline at end of file +var _0xf807=['body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x4b0762,_0x32b0a8){var _0x4bcba7=function(_0x31dda2){while(--_0x31dda2){_0x4b0762['push'](_0x4b0762['shift']());}};_0x4bcba7(++_0x32b0a8);}(_0xf807,0x17a));var _0x7f80=function(_0x118355,_0x201311){_0x118355=_0x118355-0x0;var _0x32f7ea=_0xf807[_0x118355];return _0x32f7ea;};'use strict';var emlformat=require(_0x7f80('0x0'));var rimraf=require(_0x7f80('0x1'));var zipdir=require(_0x7f80('0x2'));var jsonpatch=require(_0x7f80('0x3'));var rp=require(_0x7f80('0x4'));var moment=require(_0x7f80('0x5'));var BPromise=require(_0x7f80('0x6'));var Mustache=require('mustache');var util=require(_0x7f80('0x7'));var path=require(_0x7f80('0x8'));var sox=require('sox');var csv=require(_0x7f80('0x9'));var ejs=require(_0x7f80('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7f80('0xb'));var crypto=require(_0x7f80('0xc'));var jsforce=require(_0x7f80('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f80('0x9'));var querystring=require('querystring');var Papa=require(_0x7f80('0xe'));var Redis=require(_0x7f80('0xf'));var authService=require(_0x7f80('0x10'));var qs=require(_0x7f80('0x11'));var as=require(_0x7f80('0x12'));var hardwareService=require(_0x7f80('0x13'));var logger=require(_0x7f80('0x14'))(_0x7f80('0x15'));var utils=require(_0x7f80('0x16'));var config=require(_0x7f80('0x17'));var licenseUtil=require(_0x7f80('0x18'));var db=require(_0x7f80('0x19'))['db'];function respondWithStatusCode(_0x4eb643,_0x731451){_0x731451=_0x731451||0xcc;return function(_0x94cbc8){if(_0x94cbc8){return _0x4eb643[_0x7f80('0x1a')](_0x731451);}return _0x4eb643[_0x7f80('0x1b')](_0x731451)[_0x7f80('0x1c')]();};}function respondWithResult(_0x4457bf,_0x5a166e){_0x5a166e=_0x5a166e||0xc8;return function(_0x4cd613){if(_0x4cd613){return _0x4457bf[_0x7f80('0x1b')](_0x5a166e)[_0x7f80('0x1d')](_0x4cd613);}};}function respondWithFilteredResult(_0x24c288,_0x4b439b){return function(_0x22812a){if(_0x22812a){var _0x138460=typeof _0x4b439b[_0x7f80('0x1e')]===_0x7f80('0x1f')&&typeof _0x4b439b[_0x7f80('0x20')]===_0x7f80('0x1f');var _0x17c9c6=_0x22812a['count'];var _0x26fdee=_0x138460?0x0:_0x4b439b[_0x7f80('0x1e')];var _0x464a42=_0x138460?_0x22812a[_0x7f80('0x21')]:_0x4b439b['offset']+_0x4b439b[_0x7f80('0x20')];var _0x3a14bb;if(_0x464a42>=_0x17c9c6){_0x464a42=_0x17c9c6;_0x3a14bb=0xc8;}else{_0x3a14bb=0xce;}_0x24c288[_0x7f80('0x1b')](_0x3a14bb);return _0x24c288[_0x7f80('0x22')](_0x7f80('0x23'),_0x26fdee+'-'+_0x464a42+'/'+_0x17c9c6)[_0x7f80('0x1d')](_0x22812a);}return null;};}function patchUpdates(_0x52ea8b){return function(_0x31edce){try{jsonpatch['apply'](_0x31edce,_0x52ea8b,!![]);}catch(_0xcfdb23){return BPromise[_0x7f80('0x24')](_0xcfdb23);}return _0x31edce[_0x7f80('0x25')]();};}function saveUpdates(_0x50c3ba,_0x4c1573){return function(_0x451756){if(_0x451756){return _0x451756[_0x7f80('0x26')](_0x50c3ba)[_0x7f80('0x27')](function(_0x2dab92){return _0x2dab92;});}return null;};}function removeEntity(_0x4e6c35,_0x5cc161){return function(_0x3a3dab){if(_0x3a3dab){return _0x3a3dab[_0x7f80('0x28')]()[_0x7f80('0x27')](function(){_0x4e6c35['status'](0xcc)[_0x7f80('0x1c')]();});}};}function handleEntityNotFound(_0xc5dcd,_0x1846eb){return function(_0x206df6){if(!_0x206df6){_0xc5dcd[_0x7f80('0x1a')](0x194);}return _0x206df6;};}function handleError(_0x44eb1f,_0x36c470){_0x36c470=_0x36c470||0x1f4;return function(_0x4f136d){logger[_0x7f80('0x29')](_0x4f136d[_0x7f80('0x2a')]);if(_0x4f136d[_0x7f80('0x2b')]){delete _0x4f136d['name'];}_0x44eb1f[_0x7f80('0x1b')](_0x36c470)[_0x7f80('0x2c')](_0x4f136d);};}exports[_0x7f80('0x2d')]=function(_0x335999,_0x1720c9){var _0x5304ef={},_0x22b3e9={},_0x3f39d1={'count':0x0,'rows':[]};var _0x3fb228=_[_0x7f80('0x2e')](db[_0x7f80('0x2f')][_0x7f80('0x30')],function(_0x4fa134){return{'name':_0x4fa134[_0x7f80('0x31')],'type':_0x4fa134['type']['key']};});_0x22b3e9[_0x7f80('0x32')]=_['map'](_0x3fb228,_0x7f80('0x2b'));_0x22b3e9['query']=_[_0x7f80('0x33')](_0x335999[_0x7f80('0x34')]);_0x22b3e9[_0x7f80('0x35')]=_[_0x7f80('0x36')](_0x22b3e9[_0x7f80('0x32')],_0x22b3e9['query']);_0x5304ef[_0x7f80('0x37')]=_[_0x7f80('0x36')](_0x22b3e9['model'],qs[_0x7f80('0x38')](_0x335999[_0x7f80('0x34')][_0x7f80('0x38')]));_0x5304ef['attributes']=_0x5304ef[_0x7f80('0x37')][_0x7f80('0x39')]?_0x5304ef[_0x7f80('0x37')]:_0x22b3e9[_0x7f80('0x32')];if(!_0x335999[_0x7f80('0x34')][_0x7f80('0x3a')](_0x7f80('0x3b'))){_0x5304ef[_0x7f80('0x20')]=qs[_0x7f80('0x20')](_0x335999['query']['limit']);_0x5304ef[_0x7f80('0x1e')]=qs[_0x7f80('0x1e')](_0x335999['query']['offset']);}_0x5304ef['order']=qs[_0x7f80('0x3c')](_0x335999[_0x7f80('0x34')][_0x7f80('0x3c')]);_0x5304ef[_0x7f80('0x3d')]=qs[_0x7f80('0x35')](_[_0x7f80('0x3e')](_0x335999[_0x7f80('0x34')],_0x22b3e9[_0x7f80('0x35')]),_0x3fb228);if(_0x335999[_0x7f80('0x34')]['filter']){_0x5304ef['where']=_[_0x7f80('0x3f')](_0x5304ef['where'],{'$or':_[_0x7f80('0x2e')](_0x3fb228,function(_0x30343f){if(_0x30343f['type']!==_0x7f80('0x40')){var _0x1741cd={};_0x1741cd[_0x30343f[_0x7f80('0x2b')]]={'$like':'%'+_0x335999['query']['filter']+'%'};return _0x1741cd;}})});}_0x5304ef=_[_0x7f80('0x3f')]({},_0x5304ef,_0x335999[_0x7f80('0x41')]);var _0x54eb44={'where':_0x5304ef[_0x7f80('0x3d')]};return db[_0x7f80('0x2f')]['count'](_0x54eb44)[_0x7f80('0x27')](function(_0x48d59c){_0x3f39d1[_0x7f80('0x21')]=_0x48d59c;if(_0x335999[_0x7f80('0x34')][_0x7f80('0x42')]){_0x5304ef['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x7f80('0x43')](_0x5304ef);})[_0x7f80('0x27')](function(_0x5c8369){_0x3f39d1[_0x7f80('0x44')]=_0x5c8369;return _0x3f39d1;})[_0x7f80('0x27')](respondWithFilteredResult(_0x1720c9,_0x5304ef))[_0x7f80('0x45')](handleError(_0x1720c9,null));};exports[_0x7f80('0x46')]=function(_0x289979,_0xc6a2b8){var _0x421cf9={'raw':!![],'where':{'id':_0x289979[_0x7f80('0x47')]['id']}},_0x461b6e={};_0x461b6e[_0x7f80('0x32')]=_['keys'](db[_0x7f80('0x2f')][_0x7f80('0x30')]);_0x461b6e[_0x7f80('0x34')]=_[_0x7f80('0x33')](_0x289979['query']);_0x461b6e[_0x7f80('0x35')]=_[_0x7f80('0x36')](_0x461b6e['model'],_0x461b6e[_0x7f80('0x34')]);_0x421cf9['attributes']=_['intersection'](_0x461b6e['model'],qs[_0x7f80('0x38')](_0x289979[_0x7f80('0x34')][_0x7f80('0x38')]));_0x421cf9['attributes']=_0x421cf9[_0x7f80('0x37')][_0x7f80('0x39')]?_0x421cf9[_0x7f80('0x37')]:_0x461b6e[_0x7f80('0x32')];if(_0x289979[_0x7f80('0x34')][_0x7f80('0x42')]){_0x421cf9['include']=[{'all':!![]}];}_0x421cf9=_[_0x7f80('0x3f')]({},_0x421cf9,_0x289979[_0x7f80('0x41')]);return db[_0x7f80('0x2f')]['find'](_0x421cf9)[_0x7f80('0x27')](handleEntityNotFound(_0xc6a2b8,null))[_0x7f80('0x27')](respondWithResult(_0xc6a2b8,null))[_0x7f80('0x45')](handleError(_0xc6a2b8,null));};exports['create']=function(_0x494fbe,_0x49e1f0){return db['OpenchannelTransferReport']['create'](_0x494fbe[_0x7f80('0x48')],{})[_0x7f80('0x27')](respondWithResult(_0x49e1f0,0xc9))[_0x7f80('0x45')](handleError(_0x49e1f0,null));};exports[_0x7f80('0x26')]=function(_0x4167a5,_0xea6096){if(_0x4167a5[_0x7f80('0x48')]['id']){delete _0x4167a5[_0x7f80('0x48')]['id'];}return db[_0x7f80('0x2f')]['find']({'where':{'id':_0x4167a5['params']['id']}})[_0x7f80('0x27')](handleEntityNotFound(_0xea6096,null))[_0x7f80('0x27')](saveUpdates(_0x4167a5[_0x7f80('0x48')],null))[_0x7f80('0x27')](respondWithResult(_0xea6096,null))[_0x7f80('0x45')](handleError(_0xea6096,null));};exports[_0x7f80('0x28')]=function(_0xb5e72e,_0x308319){return db['OpenchannelTransferReport'][_0x7f80('0x49')]({'where':{'id':_0xb5e72e[_0x7f80('0x47')]['id']}})['then'](handleEntityNotFound(_0x308319,null))[_0x7f80('0x27')](removeEntity(_0x308319,null))['catch'](handleError(_0x308319,null));};exports[_0x7f80('0x4a')]=function(_0x55b0c6,_0x2dad0b){return db[_0x7f80('0x2f')][_0x7f80('0x4a')]()[_0x7f80('0x27')](respondWithResult(_0x2dad0b,null))[_0x7f80('0x45')](handleError(_0x2dad0b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3619b50..03e8ff1 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2154=['request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','lodash','util','../../config/logger','moment','bluebird'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x2154,0xeb));var _0x4215=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x2154[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x4215('0x0'));var util=require(_0x4215('0x1'));var logger=require(_0x4215('0x2'))('api');var moment=require(_0x4215('0x3'));var BPromise=require(_0x4215('0x4'));var rp=require(_0x4215('0x5'));var fs=require('fs');var path=require(_0x4215('0x6'));var rimraf=require(_0x4215('0x7'));var config=require('../../config/environment');var attributes=require(_0x4215('0x8'));module[_0x4215('0x9')]=function(_0x12409a,_0x562879){return _0x12409a[_0x4215('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x4215('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc24f=['exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xc24f,0x1c0));var _0xfc24=function(_0x3cab8d,_0x2c41eb){_0x3cab8d=_0x3cab8d-0x0;var _0x53eb03=_0xc24f[_0x3cab8d];return _0x53eb03;};'use strict';var _=require(_0xfc24('0x0'));var util=require('util');var logger=require(_0xfc24('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfc24('0x2'));var rp=require(_0xfc24('0x3'));var fs=require('fs');var path=require(_0xfc24('0x4'));var rimraf=require(_0xfc24('0x5'));var config=require(_0xfc24('0x6'));var attributes=require(_0xfc24('0x7'));module[_0xfc24('0x8')]=function(_0x389e71,_0x294af9){return _0x389e71[_0xfc24('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0xfc24('0xa'),'paranoid':![],'indexes':[{'name':_0xfc24('0xb'),'fields':[_0xfc24('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index ea06a00..aecb866 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf725=['http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1e8c70,_0xfe6b78){var _0x3e9093=function(_0x44e3e8){while(--_0x44e3e8){_0x1e8c70['push'](_0x1e8c70['shift']());}};_0x3e9093(++_0xfe6b78);}(_0xf725,0x7e));var _0x5f72=function(_0x2e366d,_0x1995e8){_0x2e366d=_0x2e366d-0x0;var _0x1faa52=_0xf725[_0x2e366d];return _0x1faa52;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});} \ No newline at end of file +var _0x1c88=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c1d48,_0x361ab3){var _0x359de5=function(_0x59d45b){while(--_0x59d45b){_0x3c1d48['push'](_0x3c1d48['shift']());}};_0x359de5(++_0x361ab3);}(_0x1c88,0x1a9));var _0x81c8=function(_0x2a8cb7,_0x314d29){_0x2a8cb7=_0x2a8cb7-0x0;var _0x183a1f=_0x1c88[_0x2a8cb7];return _0x183a1f;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var moment=require(_0x81c8('0x1'));var BPromise=require(_0x81c8('0x2'));var rs=require(_0x81c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x81c8('0x4'));var logger=require(_0x81c8('0x5'))(_0x81c8('0x6'));var config=require(_0x81c8('0x7'));var jayson=require(_0x81c8('0x8'));var client=jayson[_0x81c8('0x9')][_0x81c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x182e47,_0x3a1778,_0x2111ca){return new BPromise(function(_0x191c40,_0x1ba4cb){return client[_0x81c8('0xb')](_0x182e47,_0x2111ca)['then'](function(_0x34ddaf){logger[_0x81c8('0xc')](_0x81c8('0xd'),_0x3a1778,'request\x20sent');logger['debug'](_0x81c8('0xe'),_0x3a1778,_0x81c8('0xf'),JSON[_0x81c8('0x10')](_0x34ddaf));if(_0x34ddaf['error']){if(_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x12')]===0x1f4){logger['error'](_0x81c8('0xd'),_0x3a1778,_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x13')]);return _0x1ba4cb(_0x34ddaf[_0x81c8('0x11')]['message']);}logger[_0x81c8('0x11')](_0x81c8('0xd'),_0x3a1778,_0x34ddaf[_0x81c8('0x11')]['message']);return _0x191c40(_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x13')]);}else{logger[_0x81c8('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a1778,_0x81c8('0xf'));_0x191c40(_0x34ddaf[_0x81c8('0x14')][_0x81c8('0x13')]);}})[_0x81c8('0x15')](function(_0x311b6c){logger['error'](_0x81c8('0xd'),_0x3a1778,_0x311b6c);_0x1ba4cb(_0x311b6c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index cfd5ece..f229c02 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62b6=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x4aa6c8,_0xa88962){var _0x14ed6a=function(_0x4adbd2){while(--_0x4adbd2){_0x4aa6c8['push'](_0x4aa6c8['shift']());}};_0x14ed6a(++_0xa88962);}(_0x62b6,0x7a));var _0x662b=function(_0x49c843,_0x27ffa5){_0x49c843=_0x49c843-0x0;var _0x26bfdb=_0x62b6[_0x49c843];return _0x26bfdb;};'use strict';var multer=require(_0x662b('0x0'));var util=require(_0x662b('0x1'));var path=require(_0x662b('0x2'));var timeout=require(_0x662b('0x3'));var express=require(_0x662b('0x4'));var router=express[_0x662b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x662b('0x6'));var interaction=require(_0x662b('0x7'));var config=require(_0x662b('0x8'));var controller=require(_0x662b('0x9'));router[_0x662b('0xa')]('/',auth[_0x662b('0xb')](),controller['index']);router[_0x662b('0xa')](_0x662b('0xc'),auth['isAuthenticated'](),controller[_0x662b('0xd')]);router[_0x662b('0xe')]('/',auth[_0x662b('0xb')](),controller[_0x662b('0xf')]);router[_0x662b('0x10')]('/:id',auth[_0x662b('0xb')](),controller[_0x662b('0x11')]);router[_0x662b('0x12')](_0x662b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x662b('0x13')]=router; \ No newline at end of file +var _0xde1c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x32d1e6,_0x1cfb9c){var _0x1c9d05=function(_0x402d0e){while(--_0x402d0e){_0x32d1e6['push'](_0x32d1e6['shift']());}};_0x1c9d05(++_0x1cfb9c);}(_0xde1c,0x19d));var _0xcde1=function(_0x243a1b,_0x3a9ae0){_0x243a1b=_0x243a1b-0x0;var _0x2c2e88=_0xde1c[_0x243a1b];return _0x2c2e88;};'use strict';var multer=require(_0xcde1('0x0'));var util=require(_0xcde1('0x1'));var path=require(_0xcde1('0x2'));var timeout=require(_0xcde1('0x3'));var express=require(_0xcde1('0x4'));var router=express[_0xcde1('0x5')]();var fs_extra=require(_0xcde1('0x6'));var auth=require(_0xcde1('0x7'));var interaction=require(_0xcde1('0x8'));var config=require(_0xcde1('0x9'));var controller=require(_0xcde1('0xa'));router[_0xcde1('0xb')]('/',auth[_0xcde1('0xc')](),controller[_0xcde1('0xd')]);router[_0xcde1('0xb')](_0xcde1('0xe'),auth[_0xcde1('0xc')](),controller['show']);router['post']('/',auth[_0xcde1('0xc')](),controller[_0xcde1('0xf')]);router['put'](_0xcde1('0xe'),auth['isAuthenticated'](),controller[_0xcde1('0x10')]);router[_0xcde1('0x11')](_0xcde1('0xe'),auth[_0xcde1('0xc')](),controller[_0xcde1('0x12')]);module[_0xcde1('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b971240..38047f5 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf38f=['STRING'];(function(_0x3db588,_0x5aaa88){var _0x2ab8cb=function(_0x106dc3){while(--_0x106dc3){_0x3db588['push'](_0x3db588['shift']());}};_0x2ab8cb(++_0x5aaa88);}(_0xf38f,0xb6));var _0xff38=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0xf38f[_0x1f23b1];return _0x3c9197;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xff38('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd875=['sequelize','exports','STRING'];(function(_0x228eec,_0x40bdb3){var _0x2ed66c=function(_0x507e24){while(--_0x507e24){_0x228eec['push'](_0x228eec['shift']());}};_0x2ed66c(++_0x40bdb3);}(_0xd875,0x180));var _0x5d87=function(_0x5d68a2,_0x4304cf){_0x5d68a2=_0x5d68a2-0x0;var _0x5b3088=_0xd875[_0x5d68a2];return _0x5b3088;};'use strict';var Sequelize=require(_0x5d87('0x0'));module[_0x5d87('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5d87('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 47ab411..b8a2547 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c6b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','save','update','then','get','Pauses','UserProfileResource','destroy','end','error','name','map','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','type','VIRTUAL','options','Pause','includeAll','findAll','show','params','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x42f254,_0x16b4dd){var _0x579974=function(_0x1d57e5){while(--_0x1d57e5){_0x42f254['push'](_0x42f254['shift']());}};_0x579974(++_0x16b4dd);}(_0x4c6b,0xcb));var _0xb4c6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4c6b[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0xb4c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4c6('0x1'));var jsonpatch=require(_0xb4c6('0x2'));var rp=require(_0xb4c6('0x3'));var moment=require(_0xb4c6('0x4'));var BPromise=require(_0xb4c6('0x5'));var Mustache=require('mustache');var util=require(_0xb4c6('0x6'));var path=require('path');var sox=require(_0xb4c6('0x7'));var csv=require(_0xb4c6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4c6('0x9'));var _=require(_0xb4c6('0xa'));var squel=require(_0xb4c6('0xb'));var crypto=require('crypto');var jsforce=require(_0xb4c6('0xc'));var deskjs=require(_0xb4c6('0xd'));var toCsv=require(_0xb4c6('0x8'));var querystring=require(_0xb4c6('0xe'));var Papa=require(_0xb4c6('0xf'));var Redis=require(_0xb4c6('0x10'));var authService=require(_0xb4c6('0x11'));var qs=require(_0xb4c6('0x12'));var as=require(_0xb4c6('0x13'));var hardwareService=require(_0xb4c6('0x14'));var logger=require(_0xb4c6('0x15'))(_0xb4c6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb4c6('0x17'));var db=require(_0xb4c6('0x18'))['db'];function respondWithStatusCode(_0x1fef8d,_0x37ca8d){_0x37ca8d=_0x37ca8d||0xcc;return function(_0x7aca95){if(_0x7aca95){return _0x1fef8d[_0xb4c6('0x19')](_0x37ca8d);}return _0x1fef8d['status'](_0x37ca8d)['end']();};}function respondWithResult(_0x31388b,_0x772c5a){_0x772c5a=_0x772c5a||0xc8;return function(_0x19241a){if(_0x19241a){return _0x31388b[_0xb4c6('0x1a')](_0x772c5a)['json'](_0x19241a);}};}function respondWithFilteredResult(_0x573a03,_0x5c3cba){return function(_0x18dde9){if(_0x18dde9){var _0x45c0f5=typeof _0x5c3cba['offset']===_0xb4c6('0x1b')&&typeof _0x5c3cba[_0xb4c6('0x1c')]===_0xb4c6('0x1b');var _0x5a1e43=_0x18dde9[_0xb4c6('0x1d')];var _0x460897=_0x45c0f5?0x0:_0x5c3cba['offset'];var _0xb88926=_0x45c0f5?_0x18dde9[_0xb4c6('0x1d')]:_0x5c3cba[_0xb4c6('0x1e')]+_0x5c3cba[_0xb4c6('0x1c')];var _0x27008b;if(_0xb88926>=_0x5a1e43){_0xb88926=_0x5a1e43;_0x27008b=0xc8;}else{_0x27008b=0xce;}_0x573a03[_0xb4c6('0x1a')](_0x27008b);return _0x573a03[_0xb4c6('0x1f')]('Content-Range',_0x460897+'-'+_0xb88926+'/'+_0x5a1e43)['json'](_0x18dde9);}return null;};}function patchUpdates(_0x53c184){return function(_0x23aeb5){try{jsonpatch['apply'](_0x23aeb5,_0x53c184,!![]);}catch(_0x348c4f){return BPromise['reject'](_0x348c4f);}return _0x23aeb5[_0xb4c6('0x20')]();};}function saveUpdates(_0x183344,_0xf5515c){return function(_0x4f2d82){if(_0x4f2d82){return _0x4f2d82[_0xb4c6('0x21')](_0x183344)[_0xb4c6('0x22')](function(_0x3ad9ca){return _0x3ad9ca;});}return null;};}function removeEntity(_0x2b27f6,_0x32c22c){return function(_0x157a58){if(_0x157a58){return _0x157a58['destroy']()[_0xb4c6('0x22')](function(){var _0x289242=_0x157a58[_0xb4c6('0x23')]({'plain':!![]});var _0x2e2dc5=_0xb4c6('0x24');return db[_0xb4c6('0x25')][_0xb4c6('0x26')]({'where':{'type':_0x2e2dc5,'resourceId':_0x289242['id']}})[_0xb4c6('0x22')](function(){return _0x157a58;});})[_0xb4c6('0x22')](function(){_0x2b27f6[_0xb4c6('0x1a')](0xcc)[_0xb4c6('0x27')]();});}};}function handleEntityNotFound(_0x29da9c,_0x583657){return function(_0x3bbfd1){if(!_0x3bbfd1){_0x29da9c[_0xb4c6('0x19')](0x194);}return _0x3bbfd1;};}function handleError(_0x21b6f7,_0x6d7b06){_0x6d7b06=_0x6d7b06||0x1f4;return function(_0x373ef9){logger[_0xb4c6('0x28')](_0x373ef9['stack']);if(_0x373ef9[_0xb4c6('0x29')]){delete _0x373ef9['name'];}_0x21b6f7['status'](_0x6d7b06)['send'](_0x373ef9);};}exports['index']=function(_0x39ab89,_0x4505f3){var _0x4f0c9e={},_0x37ba63={},_0x46aeec={'count':0x0,'rows':[]};var _0x46d41b=_[_0xb4c6('0x2a')](db['Pause']['rawAttributes'],function(_0x37e10f){return{'name':_0x37e10f['fieldName'],'type':_0x37e10f['type']['key']};});_0x37ba63[_0xb4c6('0x2b')]=_['map'](_0x46d41b,_0xb4c6('0x29'));_0x37ba63[_0xb4c6('0x2c')]=_[_0xb4c6('0x2d')](_0x39ab89[_0xb4c6('0x2c')]);_0x37ba63['filters']=_[_0xb4c6('0x2e')](_0x37ba63[_0xb4c6('0x2b')],_0x37ba63[_0xb4c6('0x2c')]);_0x4f0c9e[_0xb4c6('0x2f')]=_[_0xb4c6('0x2e')](_0x37ba63['model'],qs[_0xb4c6('0x30')](_0x39ab89['query'][_0xb4c6('0x30')]));_0x4f0c9e[_0xb4c6('0x2f')]=_0x4f0c9e[_0xb4c6('0x2f')][_0xb4c6('0x31')]?_0x4f0c9e[_0xb4c6('0x2f')]:_0x37ba63[_0xb4c6('0x2b')];if(!_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x32')](_0xb4c6('0x33'))){_0x4f0c9e[_0xb4c6('0x1c')]=qs[_0xb4c6('0x1c')](_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x1c')]);_0x4f0c9e[_0xb4c6('0x1e')]=qs['offset'](_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x1e')]);}_0x4f0c9e['order']=qs['sort'](_0x39ab89[_0xb4c6('0x2c')]['sort']);_0x4f0c9e[_0xb4c6('0x34')]=qs[_0xb4c6('0x35')](_[_0xb4c6('0x36')](_0x39ab89[_0xb4c6('0x2c')],_0x37ba63[_0xb4c6('0x35')]),_0x46d41b);if(_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x37')]){_0x4f0c9e['where']=_['merge'](_0x4f0c9e['where'],{'$or':_[_0xb4c6('0x2a')](_0x46d41b,function(_0x1f1dd6){if(_0x1f1dd6[_0xb4c6('0x38')]!==_0xb4c6('0x39')){var _0x45ca56={};_0x45ca56[_0x1f1dd6[_0xb4c6('0x29')]]={'$like':'%'+_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x37')]+'%'};return _0x45ca56;}})});}_0x4f0c9e=_['merge']({},_0x4f0c9e,_0x39ab89[_0xb4c6('0x3a')]);var _0x31be0f={'where':_0x4f0c9e[_0xb4c6('0x34')]};return db[_0xb4c6('0x3b')][_0xb4c6('0x1d')](_0x31be0f)[_0xb4c6('0x22')](function(_0x164e65){_0x46aeec[_0xb4c6('0x1d')]=_0x164e65;if(_0x39ab89[_0xb4c6('0x2c')][_0xb4c6('0x3c')]){_0x4f0c9e['include']=[{'all':!![]}];}return db[_0xb4c6('0x3b')][_0xb4c6('0x3d')](_0x4f0c9e);})[_0xb4c6('0x22')](function(_0x35be4e){_0x46aeec['rows']=_0x35be4e;return _0x46aeec;})[_0xb4c6('0x22')](respondWithFilteredResult(_0x4505f3,_0x4f0c9e))['catch'](handleError(_0x4505f3,null));};exports[_0xb4c6('0x3e')]=function(_0x274156,_0x26383f){var _0x246334={'raw':!![],'where':{'id':_0x274156[_0xb4c6('0x3f')]['id']}},_0x124a49={};_0x124a49[_0xb4c6('0x2b')]=_[_0xb4c6('0x2d')](db[_0xb4c6('0x3b')][_0xb4c6('0x40')]);_0x124a49['query']=_['keys'](_0x274156['query']);_0x124a49['filters']=_['intersection'](_0x124a49[_0xb4c6('0x2b')],_0x124a49[_0xb4c6('0x2c')]);_0x246334[_0xb4c6('0x2f')]=_[_0xb4c6('0x2e')](_0x124a49[_0xb4c6('0x2b')],qs['fields'](_0x274156[_0xb4c6('0x2c')][_0xb4c6('0x30')]));_0x246334[_0xb4c6('0x2f')]=_0x246334[_0xb4c6('0x2f')][_0xb4c6('0x31')]?_0x246334[_0xb4c6('0x2f')]:_0x124a49[_0xb4c6('0x2b')];if(_0x274156[_0xb4c6('0x2c')][_0xb4c6('0x3c')]){_0x246334['include']=[{'all':!![]}];}_0x246334=_['merge']({},_0x246334,_0x274156['options']);return db['Pause'][_0xb4c6('0x41')](_0x246334)[_0xb4c6('0x22')](handleEntityNotFound(_0x26383f,null))[_0xb4c6('0x22')](respondWithResult(_0x26383f,null))[_0xb4c6('0x42')](handleError(_0x26383f,null));};exports['create']=function(_0x233050,_0x3a476f){return db[_0xb4c6('0x3b')][_0xb4c6('0x43')](_0x233050['body'],{})[_0xb4c6('0x22')](function(_0x466154){var _0x485102=_0x233050['user']['get']({'plain':!![]});if(!_0x485102)throw new Error(_0xb4c6('0x44'));if(_0x485102[_0xb4c6('0x45')]==='user'){var _0x36b2e6=_0x466154[_0xb4c6('0x23')]({'plain':!![]});var _0x5d57e=_0xb4c6('0x24');return db['UserProfileSection'][_0xb4c6('0x41')]({'where':{'name':_0x5d57e,'userProfileId':_0x485102[_0xb4c6('0x46')]},'raw':!![]})[_0xb4c6('0x22')](function(_0x1efa26){if(_0x1efa26&&_0x1efa26[_0xb4c6('0x47')]===0x0){return db[_0xb4c6('0x25')][_0xb4c6('0x43')]({'name':_0x36b2e6[_0xb4c6('0x29')],'resourceId':_0x36b2e6['id'],'type':_0x1efa26[_0xb4c6('0x29')],'sectionId':_0x1efa26['id']},{})[_0xb4c6('0x22')](function(){return _0x466154;});}else{return _0x466154;}})[_0xb4c6('0x42')](function(_0x2a42f7){logger[_0xb4c6('0x28')](_0xb4c6('0x48'),_0x2a42f7);throw _0x2a42f7;});}return _0x466154;})[_0xb4c6('0x22')](respondWithResult(_0x3a476f,0xc9))[_0xb4c6('0x42')](handleError(_0x3a476f,null));};exports['update']=function(_0x5c5bc0,_0x16447f){if(_0x5c5bc0['body']['id']){delete _0x5c5bc0[_0xb4c6('0x49')]['id'];}return db[_0xb4c6('0x3b')][_0xb4c6('0x41')]({'where':{'id':_0x5c5bc0['params']['id']}})[_0xb4c6('0x22')](handleEntityNotFound(_0x16447f,null))[_0xb4c6('0x22')](saveUpdates(_0x5c5bc0[_0xb4c6('0x49')],null))[_0xb4c6('0x22')](respondWithResult(_0x16447f,null))[_0xb4c6('0x42')](handleError(_0x16447f,null));};exports[_0xb4c6('0x26')]=function(_0x5b407e,_0x279ed2){return db[_0xb4c6('0x3b')][_0xb4c6('0x41')]({'where':{'id':_0x5b407e[_0xb4c6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x279ed2,null))[_0xb4c6('0x22')](removeEntity(_0x279ed2,null))[_0xb4c6('0x42')](handleError(_0x279ed2,null));}; \ No newline at end of file +var _0xf301=['request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','Pauses','UserProfileResource','end','error','stack','name','send','map','Pause','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0x16ec9d,_0x36ac5d){var _0x1e98b=function(_0x18a954){while(--_0x18a954){_0x16ec9d['push'](_0x16ec9d['shift']());}};_0x1e98b(++_0x36ac5d);}(_0xf301,0x13a));var _0x1f30=function(_0x1f3e3a,_0x1e5e70){_0x1f3e3a=_0x1f3e3a-0x0;var _0x1103ca=_0xf301[_0x1f3e3a];return _0x1103ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f30('0x0'));var zipdir=require(_0x1f30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f30('0x2'));var moment=require(_0x1f30('0x3'));var BPromise=require(_0x1f30('0x4'));var Mustache=require(_0x1f30('0x5'));var util=require(_0x1f30('0x6'));var path=require(_0x1f30('0x7'));var sox=require('sox');var csv=require(_0x1f30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f30('0x9'));var squel=require('squel');var crypto=require(_0x1f30('0xa'));var jsforce=require(_0x1f30('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f30('0xc'));var Papa=require(_0x1f30('0xd'));var Redis=require(_0x1f30('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1f30('0xf'));var as=require(_0x1f30('0x10'));var hardwareService=require(_0x1f30('0x11'));var logger=require(_0x1f30('0x12'))('api');var utils=require(_0x1f30('0x13'));var config=require(_0x1f30('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f30('0x15'))['db'];function respondWithStatusCode(_0x362766,_0x9f3aba){_0x9f3aba=_0x9f3aba||0xcc;return function(_0x62dfd4){if(_0x62dfd4){return _0x362766[_0x1f30('0x16')](_0x9f3aba);}return _0x362766[_0x1f30('0x17')](_0x9f3aba)['end']();};}function respondWithResult(_0x2a29a2,_0x4da69b){_0x4da69b=_0x4da69b||0xc8;return function(_0x3a0af9){if(_0x3a0af9){return _0x2a29a2['status'](_0x4da69b)['json'](_0x3a0af9);}};}function respondWithFilteredResult(_0x57e97f,_0x41883f){return function(_0x1efdb3){if(_0x1efdb3){var _0x5ecad4=typeof _0x41883f[_0x1f30('0x18')]===_0x1f30('0x19')&&typeof _0x41883f[_0x1f30('0x1a')]===_0x1f30('0x19');var _0x3dcaa9=_0x1efdb3[_0x1f30('0x1b')];var _0xa4a32=_0x5ecad4?0x0:_0x41883f['offset'];var _0x396e40=_0x5ecad4?_0x1efdb3[_0x1f30('0x1b')]:_0x41883f[_0x1f30('0x18')]+_0x41883f['limit'];var _0x1c40df;if(_0x396e40>=_0x3dcaa9){_0x396e40=_0x3dcaa9;_0x1c40df=0xc8;}else{_0x1c40df=0xce;}_0x57e97f[_0x1f30('0x17')](_0x1c40df);return _0x57e97f['set'](_0x1f30('0x1c'),_0xa4a32+'-'+_0x396e40+'/'+_0x3dcaa9)[_0x1f30('0x1d')](_0x1efdb3);}return null;};}function patchUpdates(_0xeb8ec7){return function(_0xd7ddc4){try{jsonpatch['apply'](_0xd7ddc4,_0xeb8ec7,!![]);}catch(_0x50a140){return BPromise[_0x1f30('0x1e')](_0x50a140);}return _0xd7ddc4[_0x1f30('0x1f')]();};}function saveUpdates(_0x2d9d37,_0x4bc445){return function(_0xec69e9){if(_0xec69e9){return _0xec69e9[_0x1f30('0x20')](_0x2d9d37)[_0x1f30('0x21')](function(_0x4436fa){return _0x4436fa;});}return null;};}function removeEntity(_0x84ea5a,_0x19b89e){return function(_0xb3ecc4){if(_0xb3ecc4){return _0xb3ecc4[_0x1f30('0x22')]()[_0x1f30('0x21')](function(){var _0x2b0981=_0xb3ecc4['get']({'plain':!![]});var _0x157f46=_0x1f30('0x23');return db[_0x1f30('0x24')][_0x1f30('0x22')]({'where':{'type':_0x157f46,'resourceId':_0x2b0981['id']}})[_0x1f30('0x21')](function(){return _0xb3ecc4;});})[_0x1f30('0x21')](function(){_0x84ea5a[_0x1f30('0x17')](0xcc)[_0x1f30('0x25')]();});}};}function handleEntityNotFound(_0x2e66c1,_0x132cb9){return function(_0x17b417){if(!_0x17b417){_0x2e66c1['sendStatus'](0x194);}return _0x17b417;};}function handleError(_0x5bad59,_0x5bd0ab){_0x5bd0ab=_0x5bd0ab||0x1f4;return function(_0x367579){logger[_0x1f30('0x26')](_0x367579[_0x1f30('0x27')]);if(_0x367579['name']){delete _0x367579[_0x1f30('0x28')];}_0x5bad59[_0x1f30('0x17')](_0x5bd0ab)[_0x1f30('0x29')](_0x367579);};}exports['index']=function(_0x5cd015,_0x703d73){var _0x56b582={},_0x51dd68={},_0x1e96d4={'count':0x0,'rows':[]};var _0x341e03=_[_0x1f30('0x2a')](db[_0x1f30('0x2b')]['rawAttributes'],function(_0x3f3abf){return{'name':_0x3f3abf[_0x1f30('0x2c')],'type':_0x3f3abf['type'][_0x1f30('0x2d')]};});_0x51dd68[_0x1f30('0x2e')]=_[_0x1f30('0x2a')](_0x341e03,_0x1f30('0x28'));_0x51dd68[_0x1f30('0x2f')]=_[_0x1f30('0x30')](_0x5cd015[_0x1f30('0x2f')]);_0x51dd68[_0x1f30('0x31')]=_[_0x1f30('0x32')](_0x51dd68[_0x1f30('0x2e')],_0x51dd68[_0x1f30('0x2f')]);_0x56b582[_0x1f30('0x33')]=_[_0x1f30('0x32')](_0x51dd68[_0x1f30('0x2e')],qs[_0x1f30('0x34')](_0x5cd015[_0x1f30('0x2f')]['fields']));_0x56b582['attributes']=_0x56b582[_0x1f30('0x33')][_0x1f30('0x35')]?_0x56b582[_0x1f30('0x33')]:_0x51dd68['model'];if(!_0x5cd015[_0x1f30('0x2f')][_0x1f30('0x36')]('nolimit')){_0x56b582[_0x1f30('0x1a')]=qs[_0x1f30('0x1a')](_0x5cd015[_0x1f30('0x2f')][_0x1f30('0x1a')]);_0x56b582[_0x1f30('0x18')]=qs[_0x1f30('0x18')](_0x5cd015['query'][_0x1f30('0x18')]);}_0x56b582[_0x1f30('0x37')]=qs[_0x1f30('0x38')](_0x5cd015[_0x1f30('0x2f')][_0x1f30('0x38')]);_0x56b582[_0x1f30('0x39')]=qs[_0x1f30('0x31')](_['pick'](_0x5cd015[_0x1f30('0x2f')],_0x51dd68[_0x1f30('0x31')]),_0x341e03);if(_0x5cd015[_0x1f30('0x2f')][_0x1f30('0x3a')]){_0x56b582[_0x1f30('0x39')]=_[_0x1f30('0x3b')](_0x56b582[_0x1f30('0x39')],{'$or':_['map'](_0x341e03,function(_0x335ffe){if(_0x335ffe['type']!==_0x1f30('0x3c')){var _0xe24d2b={};_0xe24d2b[_0x335ffe[_0x1f30('0x28')]]={'$like':'%'+_0x5cd015[_0x1f30('0x2f')][_0x1f30('0x3a')]+'%'};return _0xe24d2b;}})});}_0x56b582=_[_0x1f30('0x3b')]({},_0x56b582,_0x5cd015[_0x1f30('0x3d')]);var _0x398571={'where':_0x56b582['where']};return db[_0x1f30('0x2b')]['count'](_0x398571)[_0x1f30('0x21')](function(_0x538885){_0x1e96d4[_0x1f30('0x1b')]=_0x538885;if(_0x5cd015['query']['includeAll']){_0x56b582[_0x1f30('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x1f30('0x3f')](_0x56b582);})[_0x1f30('0x21')](function(_0x13926a){_0x1e96d4[_0x1f30('0x40')]=_0x13926a;return _0x1e96d4;})[_0x1f30('0x21')](respondWithFilteredResult(_0x703d73,_0x56b582))[_0x1f30('0x41')](handleError(_0x703d73,null));};exports['show']=function(_0x1b5c79,_0x1f2eb1){var _0x24de44={'raw':!![],'where':{'id':_0x1b5c79[_0x1f30('0x42')]['id']}},_0x4db38f={};_0x4db38f[_0x1f30('0x2e')]=_[_0x1f30('0x30')](db['Pause']['rawAttributes']);_0x4db38f['query']=_[_0x1f30('0x30')](_0x1b5c79[_0x1f30('0x2f')]);_0x4db38f['filters']=_[_0x1f30('0x32')](_0x4db38f[_0x1f30('0x2e')],_0x4db38f[_0x1f30('0x2f')]);_0x24de44[_0x1f30('0x33')]=_[_0x1f30('0x32')](_0x4db38f[_0x1f30('0x2e')],qs[_0x1f30('0x34')](_0x1b5c79['query'][_0x1f30('0x34')]));_0x24de44[_0x1f30('0x33')]=_0x24de44[_0x1f30('0x33')][_0x1f30('0x35')]?_0x24de44['attributes']:_0x4db38f[_0x1f30('0x2e')];if(_0x1b5c79[_0x1f30('0x2f')][_0x1f30('0x43')]){_0x24de44['include']=[{'all':!![]}];}_0x24de44=_[_0x1f30('0x3b')]({},_0x24de44,_0x1b5c79[_0x1f30('0x3d')]);return db['Pause'][_0x1f30('0x44')](_0x24de44)['then'](handleEntityNotFound(_0x1f2eb1,null))[_0x1f30('0x21')](respondWithResult(_0x1f2eb1,null))[_0x1f30('0x41')](handleError(_0x1f2eb1,null));};exports[_0x1f30('0x45')]=function(_0x2f37ef,_0x37a760){return db['Pause'][_0x1f30('0x45')](_0x2f37ef[_0x1f30('0x46')],{})[_0x1f30('0x21')](function(_0x51c47d){var _0x2d7239=_0x2f37ef[_0x1f30('0x47')][_0x1f30('0x48')]({'plain':!![]});if(!_0x2d7239)throw new Error(_0x1f30('0x49'));if(_0x2d7239[_0x1f30('0x4a')]===_0x1f30('0x47')){var _0x229841=_0x51c47d[_0x1f30('0x48')]({'plain':!![]});var _0x1d611c=_0x1f30('0x23');return db[_0x1f30('0x4b')][_0x1f30('0x44')]({'where':{'name':_0x1d611c,'userProfileId':_0x2d7239[_0x1f30('0x4c')]},'raw':!![]})[_0x1f30('0x21')](function(_0x5eae1e){if(_0x5eae1e&&_0x5eae1e[_0x1f30('0x4d')]===0x0){return db['UserProfileResource'][_0x1f30('0x45')]({'name':_0x229841['name'],'resourceId':_0x229841['id'],'type':_0x5eae1e[_0x1f30('0x28')],'sectionId':_0x5eae1e['id']},{})[_0x1f30('0x21')](function(){return _0x51c47d;});}else{return _0x51c47d;}})['catch'](function(_0x95496){logger[_0x1f30('0x26')](_0x1f30('0x4e'),_0x95496);throw _0x95496;});}return _0x51c47d;})[_0x1f30('0x21')](respondWithResult(_0x37a760,0xc9))[_0x1f30('0x41')](handleError(_0x37a760,null));};exports[_0x1f30('0x20')]=function(_0x328d0e,_0x1a75f9){if(_0x328d0e[_0x1f30('0x46')]['id']){delete _0x328d0e[_0x1f30('0x46')]['id'];}return db[_0x1f30('0x2b')][_0x1f30('0x44')]({'where':{'id':_0x328d0e[_0x1f30('0x42')]['id']}})[_0x1f30('0x21')](handleEntityNotFound(_0x1a75f9,null))[_0x1f30('0x21')](saveUpdates(_0x328d0e[_0x1f30('0x46')],null))['then'](respondWithResult(_0x1a75f9,null))['catch'](handleError(_0x1a75f9,null));};exports['destroy']=function(_0x36bfca,_0x5634c7){return db[_0x1f30('0x2b')][_0x1f30('0x44')]({'where':{'id':_0x36bfca[_0x1f30('0x42')]['id']}})[_0x1f30('0x21')](handleEntityNotFound(_0x5634c7,null))['then'](removeEntity(_0x5634c7,null))['catch'](handleError(_0x5634c7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 68fb491..20e8778 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x38a758,_0x4622f0){var _0x483b10=function(_0x39b2d6){while(--_0x39b2d6){_0x38a758['push'](_0x38a758['shift']());}};_0x483b10(++_0x4622f0);}(_0xabce,0x103));var _0xeabc=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xabce[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 0d137c4..1f01f40 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5d1e5,_0x4d445a){var _0x1f730d=function(_0x20e0df){while(--_0x20e0df){_0x5d1e5['push'](_0x5d1e5['shift']());}};_0x1f730d(++_0x4d445a);}(_0xb10b,0x12a));var _0xbb10=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xb10b[_0x2bcb75];return _0x175345;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x57fc34,_0x2e6d0f){var _0x171e5f=function(_0x558b41){while(--_0x558b41){_0x57fc34['push'](_0x57fc34['shift']());}};_0x171e5f(++_0x2e6d0f);}(_0xb10b,0x12a));var _0xbb10=function(_0x20025e,_0x44c8e1){_0x20025e=_0x20025e-0x0;var _0x4a5ac4=_0xb10b[_0x20025e];return _0x4a5ac4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8af954b..fa0e81c 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc978=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x106fd2,_0x56a61a){var _0x3fdbb6=function(_0x1c324a){while(--_0x1c324a){_0x106fd2['push'](_0x106fd2['shift']());}};_0x3fdbb6(++_0x56a61a);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),controller[_0x8c97('0xe')]);router[_0x8c97('0xa')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router[_0x8c97('0xa')]('/:id/download',auth[_0x8c97('0xb')](),controller[_0x8c97('0x11')]);var upload=multer({'storage':multer[_0x8c97('0x12')]({'destination':function(_0x3a34b2,_0x400eb6,_0x949a83){_0x949a83(null,path[_0x8c97('0x13')](config[_0x8c97('0x14')],_0x8c97('0x15')));},'filename':function(_0x5cf392,_0x44611a,_0x346274){_0x44611a['originalname']=_0x44611a[_0x8c97('0x16')][_0x8c97('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x346274(null,util['format'](_0x8c97('0x18'),path['basename'](_0x44611a['originalname'],path['extname'](_0x44611a[_0x8c97('0x16')])),Date[_0x8c97('0x19')](),path[_0x8c97('0x1a')](_0x44611a[_0x8c97('0x16')])));}})});router[_0x8c97('0x1b')]('/',upload[_0x8c97('0x1c')](_0x8c97('0x1d')),controller[_0x8c97('0x1e')]);router[_0x8c97('0x1b')]('/webhook',controller[_0x8c97('0x1f')]);router[_0x8c97('0x20')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x21')]);router[_0x8c97('0x22')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x22')]);module[_0x8c97('0x23')]=router; \ No newline at end of file +var _0xaba6=['get','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','put','/:id','delete','multer','util','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x7b8099,_0x287b37){var _0x4649f6=function(_0x4a1318){while(--_0x4a1318){_0x7b8099['push'](_0x7b8099['shift']());}};_0x4649f6(++_0x287b37);}(_0xaba6,0xe2));var _0x6aba=function(_0x46bf05,_0x2b1031){_0x46bf05=_0x46bf05-0x0;var _0x58cf18=_0xaba6[_0x46bf05];return _0x58cf18;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/webhook',controller[_0x6aba('0x7')]);router[_0x6aba('0x6')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);var upload=multer({'storage':multer[_0x6aba('0xc')]({'destination':function(_0xdbc119,_0x4089c6,_0x181426){_0x181426(null,path['join'](config[_0x6aba('0xd')],_0x6aba('0xe')));},'filename':function(_0x43867b,_0x254007,_0x53e604){_0x254007[_0x6aba('0xf')]=_0x254007[_0x6aba('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53e604(null,util[_0x6aba('0x10')](_0x6aba('0x11'),path[_0x6aba('0x12')](_0x254007['originalname'],path[_0x6aba('0x13')](_0x254007[_0x6aba('0xf')])),Date[_0x6aba('0x14')](),path['extname'](_0x254007[_0x6aba('0xf')])));}})});router[_0x6aba('0x15')]('/',upload[_0x6aba('0x16')](_0x6aba('0x17')),controller[_0x6aba('0x18')]);router[_0x6aba('0x15')](_0x6aba('0x19'),controller['webhookPost']);router[_0x6aba('0x1a')](_0x6aba('0x1b'),auth[_0x6aba('0x8')](),controller['update']);router[_0x6aba('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index bd0b222..5169b80 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1d0=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly'];(function(_0x4c0642,_0x56d068){var _0x4ef53e=function(_0x390e2d){while(--_0x390e2d){_0x4c0642['push'](_0x4c0642['shift']());}};_0x4ef53e(++_0x56d068);}(_0xf1d0,0x145));var _0x0f1d=function(_0x45f3a0,_0x5ebead){_0x45f3a0=_0x45f3a0-0x0;var _0x184cfc=_0xf1d0[_0x45f3a0];return _0x184cfc;};'use strict';var Sequelize=require(_0x0f1d('0x0'));module[_0x0f1d('0x1')]={'name':{'type':Sequelize[_0x0f1d('0x2')]},'type':{'type':Sequelize[_0x0f1d('0x3')](_0x0f1d('0x4'),_0x0f1d('0x5'))},'description':{'type':Sequelize[_0x0f1d('0x6')]},'version':{'type':Sequelize[_0x0f1d('0x6')]},'path':{'type':Sequelize[_0x0f1d('0x2')],'comment':_0x0f1d('0x7')},'active':{'type':Sequelize[_0x0f1d('0x8')],'defaultValue':0x0,'comment':_0x0f1d('0x9')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x0f1d('0xa'),_0x0f1d('0xb'),_0x0f1d('0xc')),'defaultValue':_0x0f1d('0xb'),'comment':_0x0f1d('0xd')},'icon':{'type':Sequelize[_0x0f1d('0x2')]},'adminUrl':{'type':Sequelize[_0x0f1d('0x2')]},'agentUrl':{'type':Sequelize[_0x0f1d('0x2')]},'scriptName':{'type':Sequelize[_0x0f1d('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc141=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never'];(function(_0x5ce1ee,_0x18b639){var _0x5658f8=function(_0x5a1121){while(--_0x5a1121){_0x5ce1ee['push'](_0x5ce1ee['shift']());}};_0x5658f8(++_0x18b639);}(_0xc141,0xaa));var _0x1c14=function(_0x3f8084,_0x5c9c82){_0x3f8084=_0x3f8084-0x0;var _0x5d9d6c=_0xc141[_0x3f8084];return _0x5d9d6c;};'use strict';var Sequelize=require(_0x1c14('0x0'));module[_0x1c14('0x1')]={'name':{'type':Sequelize[_0x1c14('0x2')]},'type':{'type':Sequelize[_0x1c14('0x3')](_0x1c14('0x4'),_0x1c14('0x5'))},'description':{'type':Sequelize[_0x1c14('0x6')]},'version':{'type':Sequelize[_0x1c14('0x6')]},'path':{'type':Sequelize[_0x1c14('0x2')],'comment':_0x1c14('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1c14('0x8')},'sidebar':{'type':Sequelize[_0x1c14('0x3')](_0x1c14('0x9'),'agentOnly',_0x1c14('0xa'),_0x1c14('0xb')),'defaultValue':_0x1c14('0xa'),'comment':_0x1c14('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x1c14('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x1c14('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5c850e4..5c0f0f8 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x910a=['Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','headers','content-length','content-type','endsWith','statusCode','method','%s%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','extract-zip','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0xc9be0f,_0x3a168e){var _0x2781ba=function(_0x310241){while(--_0x310241){_0xc9be0f['push'](_0xc9be0f['shift']());}};_0x2781ba(++_0x3a168e);}(_0x910a,0x165));var _0xa910=function(_0xa30fe0,_0x32faf3){_0xa30fe0=_0xa30fe0-0x0;var _0x299088=_0x910a[_0xa30fe0];return _0x299088;};'use strict';var emlformat=require(_0xa910('0x0'));var rimraf=require(_0xa910('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa910('0x2'));var rp=require(_0xa910('0x3'));var moment=require('moment');var BPromise=require(_0xa910('0x4'));var Mustache=require(_0xa910('0x5'));var util=require(_0xa910('0x6'));var path=require(_0xa910('0x7'));var sox=require(_0xa910('0x8'));var csv=require(_0xa910('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa910('0xa'));var squel=require(_0xa910('0xb'));var crypto=require(_0xa910('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa910('0x9'));var querystring=require('querystring');var Papa=require(_0xa910('0xd'));var extract=require(_0xa910('0xe'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xa910('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa910('0x10'));var as=require(_0xa910('0x11'));var hardwareService=require(_0xa910('0x12'));var logger=require(_0xa910('0x13'))(_0xa910('0x14'));var utils=require(_0xa910('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa910('0x16'));var db=require(_0xa910('0x17'))['db'];config[_0xa910('0x18')]=_['defaults'](config[_0xa910('0x18')],{'host':_0xa910('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa910('0x18')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x11f6f5,_0x47a7a0){_0x47a7a0=_0x47a7a0||0xcc;return function(_0x19be65){if(_0x19be65){return _0x11f6f5[_0xa910('0x1a')](_0x47a7a0);}return _0x11f6f5[_0xa910('0x1b')](_0x47a7a0)[_0xa910('0x1c')]();};}function respondWithResult(_0x44172a,_0x4f46a8){_0x4f46a8=_0x4f46a8||0xc8;return function(_0x1374ec){if(_0x1374ec){return _0x44172a[_0xa910('0x1b')](_0x4f46a8)['json'](_0x1374ec);}};}function respondWithFilteredResult(_0x4cc1bb,_0x1f5b3e){return function(_0x113573){if(_0x113573){var _0x332e7f=typeof _0x1f5b3e['offset']==='undefined'&&typeof _0x1f5b3e[_0xa910('0x1d')]===_0xa910('0x1e');var _0x5f1839=_0x113573[_0xa910('0x1f')];var _0x1ab551=_0x332e7f?0x0:_0x1f5b3e[_0xa910('0x20')];var _0x4025ea=_0x332e7f?_0x113573[_0xa910('0x1f')]:_0x1f5b3e[_0xa910('0x20')]+_0x1f5b3e[_0xa910('0x1d')];var _0xc331cf;if(_0x4025ea>=_0x5f1839){_0x4025ea=_0x5f1839;_0xc331cf=0xc8;}else{_0xc331cf=0xce;}_0x4cc1bb['status'](_0xc331cf);return _0x4cc1bb[_0xa910('0x21')]('Content-Range',_0x1ab551+'-'+_0x4025ea+'/'+_0x5f1839)[_0xa910('0x22')](_0x113573);}return null;};}function patchUpdates(_0x87e06d){return function(_0x59fb2a){try{jsonpatch[_0xa910('0x23')](_0x59fb2a,_0x87e06d,!![]);}catch(_0x410f9f){return BPromise[_0xa910('0x24')](_0x410f9f);}return _0x59fb2a[_0xa910('0x25')]();};}function saveUpdates(_0x355778,_0x9f576c){return function(_0x2dfd4c){if(_0x2dfd4c){return _0x2dfd4c[_0xa910('0x26')](_0x355778)[_0xa910('0x27')](function(_0x4a2b5a){return _0x4a2b5a;});}return null;};}function removeEntity(_0x31457d,_0x537906){return function(_0x29eef3){if(_0x29eef3){return _0x29eef3[_0xa910('0x28')]()[_0xa910('0x27')](function(){var _0x617c2b=_0x29eef3[_0xa910('0x29')]({'plain':!![]});var _0x879df='Plugins';return db[_0xa910('0x2a')][_0xa910('0x28')]({'where':{'type':_0x879df,'resourceId':_0x617c2b['id']}})[_0xa910('0x27')](function(){return _0x29eef3;});})[_0xa910('0x27')](function(){_0x31457d[_0xa910('0x1b')](0xcc)[_0xa910('0x1c')]();});}};}function handleEntityNotFound(_0x3cf1e1,_0x3f5891){return function(_0x285036){if(!_0x285036){_0x3cf1e1[_0xa910('0x1a')](0x194);}return _0x285036;};}function handleError(_0x1d68a4,_0x396199){_0x396199=_0x396199||0x1f4;return function(_0x4a2797){logger[_0xa910('0x2b')](_0x4a2797[_0xa910('0x2c')]);if(_0x4a2797[_0xa910('0x2d')]){delete _0x4a2797[_0xa910('0x2d')];}_0x1d68a4[_0xa910('0x1b')](_0x396199)[_0xa910('0x2e')](_0x4a2797);};}exports[_0xa910('0x2f')]=function(_0x106001,_0x55c5a3){var _0x1eadfc={},_0x2ae6ae={},_0x54bd85={'count':0x0,'rows':[]};var _0x339952=_[_0xa910('0x30')](db['Plugin'][_0xa910('0x31')],function(_0x12dc3d){return{'name':_0x12dc3d[_0xa910('0x32')],'type':_0x12dc3d[_0xa910('0x33')]['key']};});_0x2ae6ae[_0xa910('0x34')]=_[_0xa910('0x30')](_0x339952,_0xa910('0x2d'));_0x2ae6ae['query']=_[_0xa910('0x35')](_0x106001[_0xa910('0x36')]);_0x2ae6ae[_0xa910('0x37')]=_['intersection'](_0x2ae6ae[_0xa910('0x34')],_0x2ae6ae['query']);_0x1eadfc[_0xa910('0x38')]=_[_0xa910('0x39')](_0x2ae6ae[_0xa910('0x34')],qs[_0xa910('0x3a')](_0x106001[_0xa910('0x36')][_0xa910('0x3a')]));_0x1eadfc[_0xa910('0x38')]=_0x1eadfc[_0xa910('0x38')][_0xa910('0x3b')]?_0x1eadfc[_0xa910('0x38')]:_0x2ae6ae[_0xa910('0x34')];if(!_0x106001[_0xa910('0x36')]['hasOwnProperty']('nolimit')){_0x1eadfc[_0xa910('0x1d')]=qs[_0xa910('0x1d')](_0x106001[_0xa910('0x36')]['limit']);_0x1eadfc[_0xa910('0x20')]=qs[_0xa910('0x20')](_0x106001['query'][_0xa910('0x20')]);}_0x1eadfc['order']=qs[_0xa910('0x3c')](_0x106001['query']['sort']);_0x1eadfc['where']=qs[_0xa910('0x37')](_[_0xa910('0x3d')](_0x106001[_0xa910('0x36')],_0x2ae6ae[_0xa910('0x37')]),_0x339952);if(_0x106001[_0xa910('0x36')][_0xa910('0x3e')]){_0x1eadfc[_0xa910('0x3f')]=_[_0xa910('0x40')](_0x1eadfc[_0xa910('0x3f')],{'$or':_[_0xa910('0x30')](_0x339952,function(_0x522d7c){if(_0x522d7c[_0xa910('0x33')]!==_0xa910('0x41')){var _0x3f709d={};_0x3f709d[_0x522d7c[_0xa910('0x2d')]]={'$like':'%'+_0x106001[_0xa910('0x36')][_0xa910('0x3e')]+'%'};return _0x3f709d;}})});}_0x1eadfc=_['merge']({},_0x1eadfc,_0x106001[_0xa910('0x42')]);var _0x2cfd8e={'where':_0x1eadfc[_0xa910('0x3f')]};return db[_0xa910('0x43')][_0xa910('0x1f')](_0x2cfd8e)[_0xa910('0x27')](function(_0x39120f){_0x54bd85[_0xa910('0x1f')]=_0x39120f;if(_0x106001[_0xa910('0x36')][_0xa910('0x44')]){_0x1eadfc[_0xa910('0x45')]=[{'all':!![]}];}return db['Plugin'][_0xa910('0x46')](_0x1eadfc);})[_0xa910('0x27')](function(_0x1832cc){_0x54bd85[_0xa910('0x47')]=_0x1832cc;return _0x54bd85;})[_0xa910('0x27')](respondWithFilteredResult(_0x55c5a3,_0x1eadfc))[_0xa910('0x48')](handleError(_0x55c5a3,null));};exports[_0xa910('0x49')]=function(_0x4d51f5,_0x4271b1){var _0x504f96={'raw':!![],'where':{'id':_0x4d51f5[_0xa910('0x4a')]['id']}},_0x16d35c={};_0x16d35c[_0xa910('0x34')]=_[_0xa910('0x35')](db['Plugin']['rawAttributes']);_0x16d35c['query']=_[_0xa910('0x35')](_0x4d51f5[_0xa910('0x36')]);_0x16d35c['filters']=_['intersection'](_0x16d35c[_0xa910('0x34')],_0x16d35c[_0xa910('0x36')]);_0x504f96['attributes']=_[_0xa910('0x39')](_0x16d35c[_0xa910('0x34')],qs['fields'](_0x4d51f5[_0xa910('0x36')][_0xa910('0x3a')]));_0x504f96[_0xa910('0x38')]=_0x504f96[_0xa910('0x38')][_0xa910('0x3b')]?_0x504f96[_0xa910('0x38')]:_0x16d35c[_0xa910('0x34')];if(_0x4d51f5[_0xa910('0x36')]['includeAll']){_0x504f96[_0xa910('0x45')]=[{'all':!![]}];}_0x504f96=_[_0xa910('0x40')]({},_0x504f96,_0x4d51f5[_0xa910('0x42')]);return db[_0xa910('0x43')][_0xa910('0x4b')](_0x504f96)['then'](handleEntityNotFound(_0x4271b1,null))['then'](respondWithResult(_0x4271b1,null))['catch'](handleError(_0x4271b1,null));};exports[_0xa910('0x4c')]=function(_0x5b66c8,_0x1bd0d6,_0x5bae97){return db['Plugin']['find']({'where':{'id':_0x5b66c8['params']['id']},'attributes':['name',_0xa910('0x7')],'raw':!![]})[_0xa910('0x27')](handleEntityNotFound(_0x1bd0d6,null))['then'](function(_0x4b9245){if(_0x4b9245){var _0xac03c2=path[_0xa910('0x4d')](config[_0xa910('0x4e')],'server/files/plugins',util[_0xa910('0x4f')](_0xa910('0x50'),path[_0xa910('0x51')](_0x4b9245['path'])));var _0x5744ca=fs[_0xa910('0x52')](_0xac03c2);var _0x561928=archiver(_0xa910('0x53'),{'zlib':{'level':0x9}});_0x561928['on'](_0xa910('0x54'),function(_0x5c95d0){if(_0x5c95d0[_0xa910('0x55')]===_0xa910('0x56')){logger[_0xa910('0x2b')](_0x5c95d0);}else{throw new db['Sequelize']['Error'](_0xa910('0x57'));}});_0x561928['on']('error',function(_0x55b811){throw new db[(_0xa910('0x58'))][(_0xa910('0x59'))](_0xa910('0x57'));});_0x561928[_0xa910('0x5a')](_0x5744ca);_0x561928[_0xa910('0x5b')](_0xa910('0x5c'),{'cwd':path[_0xa910('0x4d')](config[_0xa910('0x4e')],_0xa910('0x5d'),path[_0xa910('0x5e')](_0x4b9245[_0xa910('0x7')])),'ignore':[path['join'](path[_0xa910('0x51')](_0x4b9245['path']),_0xa910('0x5f')),path['join'](path[_0xa910('0x51')](_0x4b9245['path']),_0xa910('0x60'))],'nodir':!![]})[_0xa910('0x61')]();_0x5744ca['on'](_0xa910('0x62'),function(){if(!fs[_0xa910('0x63')](_0xac03c2)){throw new db[(_0xa910('0x58'))][(_0xa910('0x59'))](_0xa910('0x64'));}return _0x1bd0d6[_0xa910('0x4c')](_0xac03c2,util[_0xa910('0x4f')](_0xa910('0x50'),path['basename'](_0x4b9245['path'])),function(_0x14bb30){if(_0x14bb30){throw new db[(_0xa910('0x58'))][(_0xa910('0x59'))](_0xa910('0x65'));}fs[_0xa910('0x66')](_0xac03c2);logger[_0xa910('0x67')](_0xa910('0x68'));logger[_0xa910('0x67')](_0xa910('0x69'));});});}return null;})[_0xa910('0x48')](handleError(_0x1bd0d6,null));};exports[_0xa910('0x6a')]=function(_0x4aa67f,_0x57b414,_0x1491f2){var _0x236f8c=path['basename'](_0x4aa67f[_0xa910('0x6b')][_0xa910('0x6c')],path[_0xa910('0x6d')](_0x4aa67f[_0xa910('0x6b')][_0xa910('0x6c')]));var _0x3abfb9=path[_0xa910('0x4d')](config[_0xa910('0x4e')],_0xa910('0x5d'),_0x4aa67f[_0xa910('0x6b')]['filename']);var _0x2dff91=path[_0xa910('0x4d')](config[_0xa910('0x4e')],_0xa910('0x5d'),_0x236f8c);logger['info'](_0xa910('0x6e'),_0x3abfb9);logger[_0xa910('0x67')](_0xa910('0x6f'),_0x2dff91);try{fs[_0xa910('0x70')](_0x3abfb9,parseInt('0777',0x8));extract(_0x3abfb9,{'dir':_0x2dff91},function(_0x108c78){if(_0x108c78){logger[_0xa910('0x2b')](_0x108c78);handleError(_0x108c78,!![]);};var _0x53a720=fs[_0xa910('0x71')](_0x2dff91);if(_0x53a720[_0xa910('0x3b')]>0x1){removeReferences(_0x3abfb9,_0x2dff91);logger[_0xa910('0x2b')](_0xa910('0x72'));return _0x1491f2(new Error(_0xa910('0x72')));}var _0x2af9fe=fs[_0xa910('0x73')](path[_0xa910('0x4d')](_0x2dff91,_0x53a720[0x0]));if(_0x2af9fe['isFile']()){removeReferences(_0x3abfb9,_0x2dff91);logger[_0xa910('0x2b')](_0xa910('0x72'));return _0x1491f2(new Error(_0xa910('0x72')));}if(_0x2af9fe[_0xa910('0x74')]()){var _0x423fba=fs[_0xa910('0x71')](path['join'](_0x2dff91,_0x53a720[0x0]));if(_0x423fba['length']===0x0){removeReferences(_0x3abfb9,_0x2dff91);logger[_0xa910('0x2b')](_0xa910('0x72'));return _0x1491f2(new Error(_0xa910('0x72')));}var _0x2557ad=_0x423fba[_0xa910('0x75')](function(_0x290ac8){return _0x290ac8===_0xa910('0x76');});if(!_0x2557ad){return _0x1491f2(new Error(_0xa910('0x77')));}var _0x13a9ab=fs[_0xa910('0x78')](path['join'](_0x2dff91,_0x53a720[0x0],_0xa910('0x76')));var _0x362b55=JSON[_0xa910('0x79')](_0x13a9ab);if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x2d')]){return _0x1491f2(new Error(_0xa910('0x7a')));}if(_0xa910('0x1e')==typeof _0x362b55['type']){return _0x1491f2(new Error(_0xa910('0x7b')));}if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7c')]){return _0x1491f2(new Error(_0xa910('0x7d')));}if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7e')]){return _0x1491f2(new Error(_0xa910('0x7f')));}if(_0x362b55[_0xa910('0x33')]===_0xa910('0x80')){if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x81')]){return _0x1491f2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x82')]&&_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x83')]){return _0x1491f2(new Error(_0xa910('0x84')));}}else if(_0x362b55[_0xa910('0x33')]==='script'){if(_0xa910('0x1e')==typeof _0x362b55['parameters'][_0xa910('0x85')]){return _0x1491f2(new Error(_0xa910('0x86')));}if(_0xa910('0x1e')==typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x87')]){return _0x1491f2(new Error(_0xa910('0x88')));}}else{return _0x1491f2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x58938e=_0x362b55[_0xa910('0x2d')];var _0x2ea417=_0x362b55[_0xa910('0x89')];var _0x3a72cb=_0x362b55[_0xa910('0x33')];var _0x483c7b=_0x362b55[_0xa910('0x8a')]?_0x362b55[_0xa910('0x8a')]:'always';var _0x3998aa=_0x362b55[_0xa910('0x8b')]?_0x362b55['icon']:'icon-apps';var _0x7bd809='';var _0x3947f0='';var _0x31f552='';var _0x1c1f47='';var _0x1e1ea0=_0x362b55['version'];if(_0x3a72cb===_0xa910('0x80')){if(_0xa910('0x1e')!=typeof _0x362b55[_0xa910('0x7e')]['views'][_0xa910('0x82')]){var _0x4f0080=_0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4f0080)){_0x7bd809=path[_0xa910('0x4d')](_0xa910('0x8c'),_0x236f8c,_0x53a720[0x0],_0x4f0080);}else{_0x7bd809=_0x4f0080;}}else{logger[_0xa910('0x67')](_0xa910('0x8d'));}if(_0xa910('0x1e')!=typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x83')]){var _0x2b658d=_0x362b55[_0xa910('0x7e')][_0xa910('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xa910('0x8e')](_0x2b658d)){_0x3947f0=path[_0xa910('0x4d')]('plugins',_0x236f8c,_0x53a720[0x0],_0x2b658d);}else{_0x3947f0=_0x2b658d;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3a72cb==='script'){_0x31f552=_0x362b55['parameters'][_0xa910('0x85')];_0x1c1f47=_0x362b55[_0xa910('0x7e')][_0xa910('0x87')];if(_0xa910('0x1e')!=typeof _0x362b55['parameters'][_0xa910('0x81')]){if(_0xa910('0x1e')!=typeof _0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x82')]){var _0x4f0080=_0x362b55[_0xa910('0x7e')]['views'][_0xa910('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xa910('0x8e')](_0x4f0080)){_0x7bd809=path[_0xa910('0x4d')](_0xa910('0x8c'),_0x236f8c,_0x53a720[0x0],_0x4f0080);}else{_0x7bd809=_0x4f0080;}}if(_0xa910('0x1e')!=typeof _0x362b55['parameters'][_0xa910('0x81')][_0xa910('0x83')]){var _0x2b658d=_0x362b55[_0xa910('0x7e')][_0xa910('0x81')][_0xa910('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xa910('0x8e')](_0x2b658d)){_0x3947f0=path[_0xa910('0x4d')]('plugins',_0x236f8c,_0x53a720[0x0],_0x2b658d);}else{_0x3947f0=_0x2b658d;}}}}var _0x4bdc28={'name':_0x58938e,'description':_0x2ea417,'path':path[_0xa910('0x4d')](_0x236f8c,_0x53a720[0x0]),'type':_0x3a72cb,'sidebar':_0x483c7b,'icon':_0x3998aa,'adminUrl':_0x7bd809,'agentUrl':_0x3947f0,'scriptName':_0x31f552,'scriptPath':_0x1c1f47,'version':_0x1e1ea0};removeReferences(_0x3abfb9,null);return db[_0xa910('0x43')][_0xa910('0x8f')](_0x4bdc28)['then'](function(_0x40fab4){var _0x1660bc={'role':_0x4aa67f[_0xa910('0x90')][_0xa910('0x91')],'userProfileId':_0x4aa67f[_0xa910('0x90')][_0xa910('0x92')]};if(!_0x1660bc)throw new Error(_0xa910('0x93'));if(_0x1660bc[_0xa910('0x91')]===_0xa910('0x94')){var _0x2c5bd1=_0x40fab4[_0xa910('0x29')]({'plain':!![]});return db[_0xa910('0x95')][_0xa910('0x4b')]({'where':{'name':_0xa910('0x96'),'userProfileId':_0x1660bc[_0xa910('0x92')]},'raw':!![]})['then'](function(_0x1e5f29){if(_0x1e5f29&&_0x1e5f29[_0xa910('0x97')]===0x0){return db[_0xa910('0x2a')][_0xa910('0x8f')]({'name':_0x2c5bd1['name'],'resourceId':_0x2c5bd1['id'],'type':_0x1e5f29['name'],'sectionId':_0x1e5f29['id']},{})[_0xa910('0x27')](function(){return _0x40fab4;});}else{return _0x40fab4;}})[_0xa910('0x48')](function(_0x5b7866){logger[_0xa910('0x2b')](_0xa910('0x98'),_0x5b7866);throw _0x5b7866;});}return _0x40fab4;})[_0xa910('0x27')](respondWithResult(_0x57b414,null))['catch'](handleError(_0x57b414,null));}});}catch(_0x42b98f){_0x57b414[_0xa910('0x1b')](0x1f4)['send'](_0x42b98f);}};function removeReferences(_0x348c07,_0x2a2ea9){try{if(_0x348c07){fs[_0xa910('0x66')](_0x348c07);logger[_0xa910('0x67')]('Zip\x20archive\x20removed');}if(_0x2a2ea9){rimraf(_0x2a2ea9,function(){});logger[_0xa910('0x67')]('Extracted\x20folder\x20removed');}}catch(_0x3f6352){logger['error'](_0x3f6352);}}exports['update']=function(_0x17dc74,_0x3a7173,_0x2b2992){return db[_0xa910('0x43')][_0xa910('0x4b')]({'where':{'id':_0x17dc74['params']['id']}})[_0xa910('0x27')](handleEntityNotFound(_0x3a7173,null))[_0xa910('0x27')](saveUpdates(_0x17dc74[_0xa910('0x90')],null))[_0xa910('0x27')](respondWithResult(_0x3a7173,null))[_0xa910('0x48')](handleError(_0x3a7173,null));};exports[_0xa910('0x99')]=function(_0x173148,_0x4c5157,_0x1d9629){return db[_0xa910('0x43')]['find']({'where':{'id':_0x173148[_0xa910('0x4a')]['id']}})[_0xa910('0x27')](function(_0x7f1307){if(_0x7f1307){return _0x7f1307[_0xa910('0x28')]();}})['then'](function(_0x409b69){rimraf(path[_0xa910('0x4d')](config[_0xa910('0x4e')],_0xa910('0x5d'),path[_0xa910('0x5e')](_0x409b69[_0xa910('0x7')])),function(){});return _0x409b69;})['then'](handleEntityNotFound(_0x4c5157,null))['then'](respondWithStatusCode(_0x4c5157,null))[_0xa910('0x48')](handleError(_0x4c5157,null));};exports[_0xa910('0x9a')]=function(_0x2ade51,_0x6506ce,_0x48d7c7){return BPromise[_0xa910('0x9b')]()['then'](function(){if(!_0x2ade51[_0xa910('0x36')][_0xa910('0x7')]){throw new Error(_0xa910('0x9c'));}if(!_0x2ade51[_0xa910('0x36')]['port']){throw new Error(_0xa910('0x9d'));}var _0x36939f=_0x2ade51[_0xa910('0x36')][_0xa910('0x9e')]?_0x2ade51['query']['hostname']+':'+_0x2ade51[_0xa910('0x36')]['port']:_0xa910('0x9f')+_0x2ade51['query'][_0xa910('0xa0')];var _0x112cfe=_0x2ade51[_0xa910('0x36')]['json']?_0x2ade51[_0xa910('0x36')][_0xa910('0x22')]:!![];var _0x501d65=_0x2ade51[_0xa910('0x36')]['encoding']?_0x2ade51['query'][_0xa910('0xa1')]:null;var _0x4f55e0={'method':_0x2ade51['method'],'uri':util[_0xa910('0x4f')]('%s%s',_0x36939f,_0x2ade51[_0xa910('0x36')][_0xa910('0x7')]),'json':_0x112cfe,'resolveWithFullResponse':!![],'encoding':_0x501d65,'qs':_0x2ade51['query']};if(_0x2ade51['headers']){_0x4f55e0['headers']=_0x2ade51[_0xa910('0xa2')];if(_0x4f55e0['headers']['content-length']){delete _0x4f55e0[_0xa910('0xa2')][_0xa910('0xa3')];}}if(_0x4f55e0['headers'][_0xa910('0xa4')]){delete _0x4f55e0[_0xa910('0xa2')][_0xa910('0xa4')];}return rp(_0x4f55e0);})[_0xa910('0x27')](function(_0x5ccdac){if(_0x5ccdac){_0x6506ce[_0xa910('0x21')](_0x5ccdac[_0xa910('0xa2')]);logger[_0xa910('0x67')](_0x5ccdac[_0xa910('0x90')]);if(_[_0xa910('0xa5')](_0x2ade51[_0xa910('0x36')][_0xa910('0x7')],_0xa910('0x4c'))&&_0x5ccdac['statusCode']==0x1f4){return _0x6506ce[_0xa910('0x1a')](_0x5ccdac[_0xa910('0xa6')]);}else{return _0x6506ce['status'](_0x5ccdac['statusCode'])[_0xa910('0x2e')](_0x5ccdac[_0xa910('0x90')]);}}else{return _0x6506ce[_0xa910('0x1a')](0xc8);}})[_0xa910('0x48')](handleError(_0x6506ce,null));};exports['webhookPost']=function(_0x1a3bf1,_0x544d4f,_0x4197f2){return BPromise[_0xa910('0x9b')]()[_0xa910('0x27')](function(){if(!_0x1a3bf1['query']['path']){throw new Error(_0xa910('0x9c'));}if(!_0x1a3bf1[_0xa910('0x36')]['port']){throw new Error(_0xa910('0x9d'));}var _0x5b6f11=_0x1a3bf1[_0xa910('0x36')][_0xa910('0x9e')]?_0x1a3bf1[_0xa910('0x36')][_0xa910('0x9e')]+':'+_0x1a3bf1[_0xa910('0x36')][_0xa910('0xa0')]:_0xa910('0x9f')+_0x1a3bf1['query'][_0xa910('0xa0')];var _0x180f24=_0x1a3bf1[_0xa910('0x36')][_0xa910('0x22')]?_0x1a3bf1['query'][_0xa910('0x22')]:!![];var _0xa3df34=_0x1a3bf1['query'][_0xa910('0xa1')]?_0x1a3bf1[_0xa910('0x36')][_0xa910('0xa1')]:null;var _0x5d7c52={'method':_0x1a3bf1[_0xa910('0xa7')],'uri':util[_0xa910('0x4f')](_0xa910('0xa8'),_0x5b6f11,_0x1a3bf1[_0xa910('0x36')]['path']),'json':_0x180f24,'resolveWithFullResponse':!![],'encoding':_0xa3df34,'body':_0x1a3bf1[_0xa910('0x90')]};if(_0x1a3bf1[_0xa910('0xa2')]){_0x5d7c52[_0xa910('0xa2')]=_0x1a3bf1[_0xa910('0xa2')];if(_0x5d7c52[_0xa910('0xa2')][_0xa910('0xa3')]){delete _0x5d7c52[_0xa910('0xa2')][_0xa910('0xa3')];}}if(_0x5d7c52[_0xa910('0xa2')][_0xa910('0xa4')]){delete _0x5d7c52['headers']['content-type'];}return rp(_0x5d7c52);})['then'](function(_0x362873){if(_0x362873){_0x544d4f[_0xa910('0x21')](_0x362873[_0xa910('0xa2')]);logger[_0xa910('0x67')](_0x362873[_0xa910('0x90')]);return _0x544d4f['status'](_0x362873[_0xa910('0xa6')])[_0xa910('0x2e')](_0x362873[_0xa910('0x90')]);}else{return _0x544d4f[_0xa910('0x1a')](0xc8);}})[_0xa910('0x48')](handleError(_0x544d4f,null));}; \ No newline at end of file +var _0x5111=['icon-apps','test','plugins','scriptName','create','body','userProfileId','role','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','finalize','existsSync','Error','Plugin\x20not\x20found','unlinkSync','info','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5111,0x16b));var _0x1511=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5111[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1511('0x0'));var rimraf=require(_0x1511('0x1'));var zipdir=require(_0x1511('0x2'));var jsonpatch=require(_0x1511('0x3'));var rp=require(_0x1511('0x4'));var moment=require('moment');var BPromise=require(_0x1511('0x5'));var Mustache=require('mustache');var util=require(_0x1511('0x6'));var path=require(_0x1511('0x7'));var sox=require(_0x1511('0x8'));var csv=require('to-csv');var ejs=require(_0x1511('0x9'));var fs=require('fs');var fs_extra=require(_0x1511('0xa'));var _=require(_0x1511('0xb'));var squel=require(_0x1511('0xc'));var crypto=require(_0x1511('0xd'));var jsforce=require(_0x1511('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1511('0xf'));var querystring=require('querystring');var Papa=require(_0x1511('0x10'));var extract=require(_0x1511('0x11'));var rimraf=require(_0x1511('0x1'));var archiver=require(_0x1511('0x12'));var Redis=require(_0x1511('0x13'));var authService=require(_0x1511('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1511('0x15'));var hardwareService=require(_0x1511('0x16'));var logger=require('../../config/logger')(_0x1511('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1511('0x18'))['db'];config[_0x1511('0x19')]=_[_0x1511('0x1a')](config[_0x1511('0x19')],{'host':_0x1511('0x1b'),'port':0x18eb});var socket=require(_0x1511('0x1c'))(new Redis(config[_0x1511('0x19')]));require(_0x1511('0x1d'))[_0x1511('0x1e')](socket);function respondWithStatusCode(_0x455ff8,_0x43e32b){_0x43e32b=_0x43e32b||0xcc;return function(_0x7f8d4){if(_0x7f8d4){return _0x455ff8[_0x1511('0x1f')](_0x43e32b);}return _0x455ff8[_0x1511('0x20')](_0x43e32b)['end']();};}function respondWithResult(_0x5c3587,_0x4ceecd){_0x4ceecd=_0x4ceecd||0xc8;return function(_0x244fbd){if(_0x244fbd){return _0x5c3587[_0x1511('0x20')](_0x4ceecd)['json'](_0x244fbd);}};}function respondWithFilteredResult(_0x206ff8,_0x49e965){return function(_0x2d1b7e){if(_0x2d1b7e){var _0x219e45=typeof _0x49e965['offset']===_0x1511('0x21')&&typeof _0x49e965[_0x1511('0x22')]==='undefined';var _0x3c7ce2=_0x2d1b7e[_0x1511('0x23')];var _0x491d9c=_0x219e45?0x0:_0x49e965[_0x1511('0x24')];var _0x4f83be=_0x219e45?_0x2d1b7e[_0x1511('0x23')]:_0x49e965[_0x1511('0x24')]+_0x49e965[_0x1511('0x22')];var _0x104cfd;if(_0x4f83be>=_0x3c7ce2){_0x4f83be=_0x3c7ce2;_0x104cfd=0xc8;}else{_0x104cfd=0xce;}_0x206ff8[_0x1511('0x20')](_0x104cfd);return _0x206ff8['set'](_0x1511('0x25'),_0x491d9c+'-'+_0x4f83be+'/'+_0x3c7ce2)[_0x1511('0x26')](_0x2d1b7e);}return null;};}function patchUpdates(_0x255b06){return function(_0x116062){try{jsonpatch['apply'](_0x116062,_0x255b06,!![]);}catch(_0x49f170){return BPromise['reject'](_0x49f170);}return _0x116062[_0x1511('0x27')]();};}function saveUpdates(_0x4dfedb,_0x5ca644){return function(_0x1e381b){if(_0x1e381b){return _0x1e381b[_0x1511('0x28')](_0x4dfedb)[_0x1511('0x29')](function(_0x2f28e2){return _0x2f28e2;});}return null;};}function removeEntity(_0x1fe70a,_0xdac60f){return function(_0x573181){if(_0x573181){return _0x573181[_0x1511('0x2a')]()[_0x1511('0x29')](function(){var _0x3c2ee8=_0x573181[_0x1511('0x2b')]({'plain':!![]});var _0x1f4541=_0x1511('0x2c');return db[_0x1511('0x2d')][_0x1511('0x2a')]({'where':{'type':_0x1f4541,'resourceId':_0x3c2ee8['id']}})[_0x1511('0x29')](function(){return _0x573181;});})[_0x1511('0x29')](function(){_0x1fe70a[_0x1511('0x20')](0xcc)[_0x1511('0x2e')]();});}};}function handleEntityNotFound(_0x36c79d,_0x5551fe){return function(_0x5e3b8d){if(!_0x5e3b8d){_0x36c79d[_0x1511('0x1f')](0x194);}return _0x5e3b8d;};}function handleError(_0x32bb4c,_0x221d32){_0x221d32=_0x221d32||0x1f4;return function(_0x2361c2){logger[_0x1511('0x2f')](_0x2361c2[_0x1511('0x30')]);if(_0x2361c2['name']){delete _0x2361c2[_0x1511('0x31')];}_0x32bb4c['status'](_0x221d32)[_0x1511('0x32')](_0x2361c2);};}exports[_0x1511('0x33')]=function(_0x4ac7ce,_0x565a28){var _0x432b44={},_0x1b01e4={},_0x3a7eff={'count':0x0,'rows':[]};var _0x1ac0ff=_[_0x1511('0x34')](db[_0x1511('0x35')][_0x1511('0x36')],function(_0x46d6ce){return{'name':_0x46d6ce[_0x1511('0x37')],'type':_0x46d6ce[_0x1511('0x38')][_0x1511('0x39')]};});_0x1b01e4[_0x1511('0x3a')]=_[_0x1511('0x34')](_0x1ac0ff,_0x1511('0x31'));_0x1b01e4[_0x1511('0x3b')]=_['keys'](_0x4ac7ce[_0x1511('0x3b')]);_0x1b01e4['filters']=_[_0x1511('0x3c')](_0x1b01e4['model'],_0x1b01e4[_0x1511('0x3b')]);_0x432b44[_0x1511('0x3d')]=_[_0x1511('0x3c')](_0x1b01e4['model'],qs[_0x1511('0x3e')](_0x4ac7ce[_0x1511('0x3b')][_0x1511('0x3e')]));_0x432b44['attributes']=_0x432b44[_0x1511('0x3d')][_0x1511('0x3f')]?_0x432b44['attributes']:_0x1b01e4[_0x1511('0x3a')];if(!_0x4ac7ce[_0x1511('0x3b')]['hasOwnProperty'](_0x1511('0x40'))){_0x432b44[_0x1511('0x22')]=qs[_0x1511('0x22')](_0x4ac7ce[_0x1511('0x3b')][_0x1511('0x22')]);_0x432b44[_0x1511('0x24')]=qs[_0x1511('0x24')](_0x4ac7ce[_0x1511('0x3b')][_0x1511('0x24')]);}_0x432b44['order']=qs[_0x1511('0x41')](_0x4ac7ce[_0x1511('0x3b')][_0x1511('0x41')]);_0x432b44[_0x1511('0x42')]=qs[_0x1511('0x43')](_[_0x1511('0x44')](_0x4ac7ce['query'],_0x1b01e4[_0x1511('0x43')]),_0x1ac0ff);if(_0x4ac7ce[_0x1511('0x3b')]['filter']){_0x432b44[_0x1511('0x42')]=_[_0x1511('0x45')](_0x432b44[_0x1511('0x42')],{'$or':_[_0x1511('0x34')](_0x1ac0ff,function(_0x4f5c03){if(_0x4f5c03[_0x1511('0x38')]!=='VIRTUAL'){var _0x25afe4={};_0x25afe4[_0x4f5c03['name']]={'$like':'%'+_0x4ac7ce['query'][_0x1511('0x46')]+'%'};return _0x25afe4;}})});}_0x432b44=_[_0x1511('0x45')]({},_0x432b44,_0x4ac7ce[_0x1511('0x47')]);var _0x31aae9={'where':_0x432b44['where']};return db['Plugin'][_0x1511('0x23')](_0x31aae9)[_0x1511('0x29')](function(_0xc8d724){_0x3a7eff[_0x1511('0x23')]=_0xc8d724;if(_0x4ac7ce[_0x1511('0x3b')][_0x1511('0x48')]){_0x432b44[_0x1511('0x49')]=[{'all':!![]}];}return db[_0x1511('0x35')][_0x1511('0x4a')](_0x432b44);})[_0x1511('0x29')](function(_0x44d984){_0x3a7eff[_0x1511('0x4b')]=_0x44d984;return _0x3a7eff;})[_0x1511('0x29')](respondWithFilteredResult(_0x565a28,_0x432b44))[_0x1511('0x4c')](handleError(_0x565a28,null));};exports['show']=function(_0x221ee7,_0x4790b5){var _0x54e4d7={'raw':!![],'where':{'id':_0x221ee7[_0x1511('0x4d')]['id']}},_0x3ed1cd={};_0x3ed1cd[_0x1511('0x3a')]=_[_0x1511('0x4e')](db['Plugin']['rawAttributes']);_0x3ed1cd['query']=_[_0x1511('0x4e')](_0x221ee7[_0x1511('0x3b')]);_0x3ed1cd['filters']=_[_0x1511('0x3c')](_0x3ed1cd[_0x1511('0x3a')],_0x3ed1cd[_0x1511('0x3b')]);_0x54e4d7[_0x1511('0x3d')]=_['intersection'](_0x3ed1cd['model'],qs['fields'](_0x221ee7[_0x1511('0x3b')][_0x1511('0x3e')]));_0x54e4d7['attributes']=_0x54e4d7[_0x1511('0x3d')]['length']?_0x54e4d7[_0x1511('0x3d')]:_0x3ed1cd[_0x1511('0x3a')];if(_0x221ee7[_0x1511('0x3b')][_0x1511('0x48')]){_0x54e4d7['include']=[{'all':!![]}];}_0x54e4d7=_['merge']({},_0x54e4d7,_0x221ee7[_0x1511('0x47')]);return db['Plugin'][_0x1511('0x4f')](_0x54e4d7)[_0x1511('0x29')](handleEntityNotFound(_0x4790b5,null))[_0x1511('0x29')](respondWithResult(_0x4790b5,null))[_0x1511('0x4c')](handleError(_0x4790b5,null));};exports[_0x1511('0x50')]=function(_0x29ed7d,_0x4fb126,_0xdf955e){return db[_0x1511('0x35')][_0x1511('0x4f')]({'where':{'id':_0x29ed7d['params']['id']},'attributes':['name',_0x1511('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x4fb126,null))[_0x1511('0x29')](function(_0x53be44){if(_0x53be44){var _0x8ef54e=path[_0x1511('0x51')](config[_0x1511('0x52')],_0x1511('0x53'),util[_0x1511('0x54')](_0x1511('0x55'),path[_0x1511('0x56')](_0x53be44[_0x1511('0x7')])));var _0x206d68=fs[_0x1511('0x57')](_0x8ef54e);var _0x18c563=archiver('zip',{'zlib':{'level':0x9}});_0x18c563['on']('warning',function(_0x19ab91){if(_0x19ab91[_0x1511('0x58')]===_0x1511('0x59')){logger[_0x1511('0x2f')](_0x19ab91);}else{throw new db['Sequelize']['Error'](_0x1511('0x5a'));}});_0x18c563['on']('error',function(_0x582824){throw new db[(_0x1511('0x5b'))]['Error'](_0x1511('0x5a'));});_0x18c563[_0x1511('0x5c')](_0x206d68);_0x18c563[_0x1511('0x5d')](_0x1511('0x5e'),{'cwd':path['join'](config[_0x1511('0x52')],_0x1511('0x53'),path[_0x1511('0x5f')](_0x53be44['path'])),'ignore':[path[_0x1511('0x51')](path['basename'](_0x53be44[_0x1511('0x7')]),_0x1511('0x60')),path[_0x1511('0x51')](path[_0x1511('0x56')](_0x53be44['path']),'attachments/**/*')],'nodir':!![]})[_0x1511('0x61')]();_0x206d68['on']('close',function(){if(!fs[_0x1511('0x62')](_0x8ef54e)){throw new db['Sequelize'][(_0x1511('0x63'))](_0x1511('0x64'));}return _0x4fb126[_0x1511('0x50')](_0x8ef54e,util['format'](_0x1511('0x55'),path['basename'](_0x53be44[_0x1511('0x7')])),function(_0x5ddb60){if(_0x5ddb60){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x1511('0x65')](_0x8ef54e);logger[_0x1511('0x66')]('Download\x20completed');logger[_0x1511('0x66')]('Temporary\x20file\x20removed');});});}return null;})[_0x1511('0x4c')](handleError(_0x4fb126,null));};exports[_0x1511('0x67')]=function(_0x53866d,_0x5269a4,_0x43c086){var _0x2a2d6b=path['basename'](_0x53866d['file'][_0x1511('0x68')],path[_0x1511('0x69')](_0x53866d[_0x1511('0x6a')][_0x1511('0x68')]));var _0x245740=path[_0x1511('0x51')](config[_0x1511('0x52')],_0x1511('0x53'),_0x53866d[_0x1511('0x6a')][_0x1511('0x68')]);var _0x1ac164=path['join'](config['root'],_0x1511('0x53'),_0x2a2d6b);logger['info'](_0x1511('0x6b'),_0x245740);logger[_0x1511('0x66')](_0x1511('0x6c'),_0x1ac164);try{fs[_0x1511('0x6d')](_0x245740,parseInt(_0x1511('0x6e'),0x8));extract(_0x245740,{'dir':_0x1ac164},function(_0x3f1d3f){if(_0x3f1d3f){logger['error'](_0x3f1d3f);handleError(_0x3f1d3f,!![]);};var _0x5c73ad=fs[_0x1511('0x6f')](_0x1ac164);if(_0x5c73ad['length']>0x1){removeReferences(_0x245740,_0x1ac164);logger['error'](_0x1511('0x70'));return _0x43c086(new Error(_0x1511('0x70')));}var _0x203773=fs[_0x1511('0x71')](path['join'](_0x1ac164,_0x5c73ad[0x0]));if(_0x203773[_0x1511('0x72')]()){removeReferences(_0x245740,_0x1ac164);logger[_0x1511('0x2f')](_0x1511('0x70'));return _0x43c086(new Error(_0x1511('0x70')));}if(_0x203773[_0x1511('0x73')]()){var _0x507bf4=fs[_0x1511('0x6f')](path[_0x1511('0x51')](_0x1ac164,_0x5c73ad[0x0]));if(_0x507bf4[_0x1511('0x3f')]===0x0){removeReferences(_0x245740,_0x1ac164);logger[_0x1511('0x2f')](_0x1511('0x70'));return _0x43c086(new Error(_0x1511('0x70')));}var _0x587e16=_0x507bf4[_0x1511('0x74')](function(_0x1a44b4){return _0x1a44b4===_0x1511('0x75');});if(!_0x587e16){return _0x43c086(new Error(_0x1511('0x76')));}var _0x24de59=fs[_0x1511('0x77')](path[_0x1511('0x51')](_0x1ac164,_0x5c73ad[0x0],_0x1511('0x75')));var _0x6e6349=JSON['parse'](_0x24de59);if(_0x1511('0x21')==typeof _0x6e6349[_0x1511('0x31')]){return _0x43c086(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x6e6349[_0x1511('0x38')]){return _0x43c086(new Error(_0x1511('0x78')));}if('undefined'==typeof _0x6e6349[_0x1511('0x79')]){return _0x43c086(new Error(_0x1511('0x7a')));}if(_0x1511('0x21')==typeof _0x6e6349['parameters']){return _0x43c086(new Error(_0x1511('0x7b')));}if(_0x6e6349['type']==='html'){if(_0x1511('0x21')==typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')]){return _0x43c086(new Error(_0x1511('0x7e')));}if(_0x1511('0x21')==typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x7f')]&&'undefined'==typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x80')]){return _0x43c086(new Error(_0x1511('0x81')));}}else if(_0x6e6349['type']===_0x1511('0x82')){if(_0x1511('0x21')==typeof _0x6e6349[_0x1511('0x7c')]['scriptName']){return _0x43c086(new Error(_0x1511('0x83')));}if(_0x1511('0x21')==typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x84')]){return _0x43c086(new Error(_0x1511('0x85')));}}else{return _0x43c086(new Error(_0x1511('0x86')));}var _0x23cfdc=_0x6e6349[_0x1511('0x31')];var _0x463e2a=_0x6e6349[_0x1511('0x87')];var _0x5d9ccb=_0x6e6349[_0x1511('0x38')];var _0x17c9ca=_0x6e6349[_0x1511('0x88')]?_0x6e6349[_0x1511('0x88')]:'always';var _0x42f5a6=_0x6e6349[_0x1511('0x89')]?_0x6e6349['icon']:_0x1511('0x8a');var _0x2608e3='';var _0x326b81='';var _0x19a420='';var _0x2d6a5e='';var _0x24de7=_0x6e6349[_0x1511('0x79')];if(_0x5d9ccb==='html'){if(_0x1511('0x21')!=typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x7f')]){var _0x3e0841=_0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x1511('0x8b')](_0x3e0841)){_0x2608e3=path[_0x1511('0x51')](_0x1511('0x8c'),_0x2a2d6b,_0x5c73ad[0x0],_0x3e0841);}else{_0x2608e3=_0x3e0841;}}else{logger[_0x1511('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x1511('0x21')!=typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')]['agent']){var _0x37d805=_0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x1511('0x8b')](_0x37d805)){_0x326b81=path[_0x1511('0x51')](_0x1511('0x8c'),_0x2a2d6b,_0x5c73ad[0x0],_0x37d805);}else{_0x326b81=_0x37d805;}}else{logger[_0x1511('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5d9ccb===_0x1511('0x82')){_0x19a420=_0x6e6349[_0x1511('0x7c')][_0x1511('0x8d')];_0x2d6a5e=_0x6e6349[_0x1511('0x7c')][_0x1511('0x84')];if(_0x1511('0x21')!=typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')]){if(_0x1511('0x21')!=typeof _0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')][_0x1511('0x7f')]){var _0x3e0841=_0x6e6349['parameters'][_0x1511('0x7d')][_0x1511('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x1511('0x8b')](_0x3e0841)){_0x2608e3=path[_0x1511('0x51')](_0x1511('0x8c'),_0x2a2d6b,_0x5c73ad[0x0],_0x3e0841);}else{_0x2608e3=_0x3e0841;}}if(_0x1511('0x21')!=typeof _0x6e6349[_0x1511('0x7c')]['views'][_0x1511('0x80')]){var _0x37d805=_0x6e6349[_0x1511('0x7c')][_0x1511('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x37d805)){_0x326b81=path[_0x1511('0x51')](_0x1511('0x8c'),_0x2a2d6b,_0x5c73ad[0x0],_0x37d805);}else{_0x326b81=_0x37d805;}}}}var _0x4a5dc0={'name':_0x23cfdc,'description':_0x463e2a,'path':path[_0x1511('0x51')](_0x2a2d6b,_0x5c73ad[0x0]),'type':_0x5d9ccb,'sidebar':_0x17c9ca,'icon':_0x42f5a6,'adminUrl':_0x2608e3,'agentUrl':_0x326b81,'scriptName':_0x19a420,'scriptPath':_0x2d6a5e,'version':_0x24de7};removeReferences(_0x245740,null);return db[_0x1511('0x35')][_0x1511('0x8e')](_0x4a5dc0)[_0x1511('0x29')](function(_0x7bbb63){var _0x4d2c17={'role':_0x53866d[_0x1511('0x8f')]['role'],'userProfileId':_0x53866d[_0x1511('0x8f')][_0x1511('0x90')]};if(!_0x4d2c17)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d2c17[_0x1511('0x91')]===_0x1511('0x92')){var _0x3245ad=_0x7bbb63['get']({'plain':!![]});return db[_0x1511('0x93')]['find']({'where':{'name':_0x1511('0x2c'),'userProfileId':_0x4d2c17[_0x1511('0x90')]},'raw':!![]})[_0x1511('0x29')](function(_0x47ff4c){if(_0x47ff4c&&_0x47ff4c[_0x1511('0x94')]===0x0){return db['UserProfileResource']['create']({'name':_0x3245ad[_0x1511('0x31')],'resourceId':_0x3245ad['id'],'type':_0x47ff4c[_0x1511('0x31')],'sectionId':_0x47ff4c['id']},{})['then'](function(){return _0x7bbb63;});}else{return _0x7bbb63;}})['catch'](function(_0x3540c4){logger[_0x1511('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3540c4);throw _0x3540c4;});}return _0x7bbb63;})['then'](respondWithResult(_0x5269a4,null))['catch'](handleError(_0x5269a4,null));}});}catch(_0x69d4a1){_0x5269a4[_0x1511('0x20')](0x1f4)[_0x1511('0x32')](_0x69d4a1);}};function removeReferences(_0x5576bc,_0x3d184c){try{if(_0x5576bc){fs['unlinkSync'](_0x5576bc);logger[_0x1511('0x66')](_0x1511('0x95'));}if(_0x3d184c){rimraf(_0x3d184c,function(){});logger[_0x1511('0x66')](_0x1511('0x96'));}}catch(_0x2cc875){logger[_0x1511('0x2f')](_0x2cc875);}}exports[_0x1511('0x28')]=function(_0x4d93c9,_0x2809e4,_0x384208){return db[_0x1511('0x35')]['find']({'where':{'id':_0x4d93c9[_0x1511('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2809e4,null))[_0x1511('0x29')](saveUpdates(_0x4d93c9[_0x1511('0x8f')],null))['then'](respondWithResult(_0x2809e4,null))['catch'](handleError(_0x2809e4,null));};exports['delete']=function(_0xf13391,_0x7714b9,_0x53bbf1){return db['Plugin'][_0x1511('0x4f')]({'where':{'id':_0xf13391[_0x1511('0x4d')]['id']}})[_0x1511('0x29')](function(_0xdeecad){if(_0xdeecad){return _0xdeecad[_0x1511('0x2a')]();}})[_0x1511('0x29')](function(_0x509eb3){rimraf(path[_0x1511('0x51')](config['root'],_0x1511('0x53'),path[_0x1511('0x5f')](_0x509eb3[_0x1511('0x7')])),function(){});return _0x509eb3;})[_0x1511('0x29')](handleEntityNotFound(_0x7714b9,null))[_0x1511('0x29')](respondWithStatusCode(_0x7714b9,null))[_0x1511('0x4c')](handleError(_0x7714b9,null));};exports[_0x1511('0x97')]=function(_0x31c210,_0x46ac07,_0x57f559){return BPromise[_0x1511('0x98')]()[_0x1511('0x29')](function(){if(!_0x31c210[_0x1511('0x3b')][_0x1511('0x7')]){throw new Error(_0x1511('0x99'));}if(!_0x31c210['query'][_0x1511('0x9a')]){throw new Error(_0x1511('0x9b'));}var _0xfba174=_0x31c210[_0x1511('0x3b')][_0x1511('0x9c')]?_0x31c210[_0x1511('0x3b')][_0x1511('0x9c')]+':'+_0x31c210['query'][_0x1511('0x9a')]:_0x1511('0x9d')+_0x31c210[_0x1511('0x3b')][_0x1511('0x9a')];var _0x45e879=_0x31c210[_0x1511('0x3b')]['json']?_0x31c210[_0x1511('0x3b')][_0x1511('0x26')]:!![];var _0x3fc93b=_0x31c210[_0x1511('0x3b')][_0x1511('0x9e')]?_0x31c210['query'][_0x1511('0x9e')]:null;var _0x2e6686={'method':_0x31c210[_0x1511('0x9f')],'uri':util[_0x1511('0x54')](_0x1511('0xa0'),_0xfba174,_0x31c210['query'][_0x1511('0x7')]),'json':_0x45e879,'resolveWithFullResponse':!![],'encoding':_0x3fc93b,'qs':_0x31c210['query']};if(_0x31c210[_0x1511('0xa1')]){_0x2e6686[_0x1511('0xa1')]=_0x31c210[_0x1511('0xa1')];if(_0x2e6686[_0x1511('0xa1')][_0x1511('0xa2')]){delete _0x2e6686[_0x1511('0xa1')][_0x1511('0xa2')];}}if(_0x2e6686[_0x1511('0xa1')][_0x1511('0xa3')]){delete _0x2e6686[_0x1511('0xa1')][_0x1511('0xa3')];}return rp(_0x2e6686);})[_0x1511('0x29')](function(_0x25d7af){if(_0x25d7af){_0x46ac07[_0x1511('0xa4')](_0x25d7af['headers']);logger[_0x1511('0x66')](_0x25d7af['body']);if(_[_0x1511('0xa5')](_0x31c210[_0x1511('0x3b')][_0x1511('0x7')],_0x1511('0x50'))&&_0x25d7af[_0x1511('0xa6')]==0x1f4){return _0x46ac07[_0x1511('0x1f')](_0x25d7af[_0x1511('0xa6')]);}else{return _0x46ac07['status'](_0x25d7af[_0x1511('0xa6')])[_0x1511('0x32')](_0x25d7af[_0x1511('0x8f')]);}}else{return _0x46ac07[_0x1511('0x1f')](0xc8);}})[_0x1511('0x4c')](handleError(_0x46ac07,null));};exports['webhookPost']=function(_0x284049,_0x42f6be,_0x5e92de){return BPromise[_0x1511('0x98')]()['then'](function(){if(!_0x284049[_0x1511('0x3b')][_0x1511('0x7')]){throw new Error(_0x1511('0x99'));}if(!_0x284049['query']['port']){throw new Error(_0x1511('0x9b'));}var _0xc969a4=_0x284049['query'][_0x1511('0x9c')]?_0x284049[_0x1511('0x3b')][_0x1511('0x9c')]+':'+_0x284049[_0x1511('0x3b')][_0x1511('0x9a')]:_0x1511('0x9d')+_0x284049['query'][_0x1511('0x9a')];var _0x487fe5=_0x284049[_0x1511('0x3b')][_0x1511('0x26')]?_0x284049[_0x1511('0x3b')]['json']:!![];var _0x2fc5bd=_0x284049[_0x1511('0x3b')]['encoding']?_0x284049[_0x1511('0x3b')]['encoding']:null;var _0x1dd573={'method':_0x284049[_0x1511('0x9f')],'uri':util[_0x1511('0x54')](_0x1511('0xa0'),_0xc969a4,_0x284049[_0x1511('0x3b')]['path']),'json':_0x487fe5,'resolveWithFullResponse':!![],'encoding':_0x2fc5bd,'body':_0x284049['body']};if(_0x284049[_0x1511('0xa1')]){_0x1dd573[_0x1511('0xa1')]=_0x284049['headers'];if(_0x1dd573[_0x1511('0xa1')][_0x1511('0xa2')]){delete _0x1dd573[_0x1511('0xa1')][_0x1511('0xa2')];}}if(_0x1dd573[_0x1511('0xa1')][_0x1511('0xa3')]){delete _0x1dd573[_0x1511('0xa1')][_0x1511('0xa3')];}return rp(_0x1dd573);})[_0x1511('0x29')](function(_0x1be881){if(_0x1be881){_0x42f6be[_0x1511('0xa4')](_0x1be881[_0x1511('0xa1')]);logger[_0x1511('0x66')](_0x1be881[_0x1511('0x8f')]);return _0x42f6be[_0x1511('0x20')](_0x1be881[_0x1511('0xa6')])['send'](_0x1be881['body']);}else{return _0x42f6be[_0x1511('0x1f')](0xc8);}})[_0x1511('0x4c')](handleError(_0x42f6be,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2c39faf..a379277 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f2d=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4bf2a7,_0xafae78){var _0x3450c0=function(_0x3ea142){while(--_0x3ea142){_0x4bf2a7['push'](_0x4bf2a7['shift']());}};_0x3450c0(++_0xafae78);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0x1f2d[_0x39d6a8];return _0x93f3db;};'use strict';var EventEmitter=require(_0xd1f2('0x0'));var Plugin=require(_0xd1f2('0x1'))['db'][_0xd1f2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd1f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1f2('0x4'),'afterDestroy':_0xd1f2('0x5')};function emitEvent(_0x13626e){return function(_0xd4f928,_0x21f154,_0x194b49){PluginEvents[_0xd1f2('0x6')](_0x13626e+':'+_0xd4f928['id'],_0xd4f928);PluginEvents[_0xd1f2('0x6')](_0x13626e,_0xd4f928);_0x194b49(null);};}for(var e in events){if(events[_0xd1f2('0x7')](e)){var event=events[e];Plugin[_0xd1f2('0x8')](e,emitEvent(event));}}module[_0xd1f2('0x9')]=PluginEvents; \ No newline at end of file +var _0x095b=['events','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x196168,_0x2b6c2c){var _0x1fb65a=function(_0x1718f3){while(--_0x1718f3){_0x196168['push'](_0x196168['shift']());}};_0x1fb65a(++_0x2b6c2c);}(_0x095b,0x6e));var _0xb095=function(_0x5f0e11,_0xca06a2){_0x5f0e11=_0x5f0e11-0x0;var _0x40f16a=_0x095b[_0x5f0e11];return _0x40f16a;};'use strict';var EventEmitter=require(_0xb095('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb095('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb095('0x2')](0x0);var events={'afterCreate':_0xb095('0x3'),'afterUpdate':_0xb095('0x4'),'afterDestroy':_0xb095('0x5')};function emitEvent(_0x48b909){return function(_0x1a42a5,_0x25f040,_0x12979f){PluginEvents[_0xb095('0x6')](_0x48b909+':'+_0x1a42a5['id'],_0x1a42a5);PluginEvents[_0xb095('0x6')](_0x48b909,_0x1a42a5);_0x12979f(null);};}for(var e in events){if(events[_0xb095('0x7')](e)){var event=events[e];Plugin[_0xb095('0x8')](e,emitEvent(event));}}module[_0xb095('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 96f991c..c0f34bf 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fbf=['plugins','lodash','util','api','moment','bluebird','path','rimraf','./plugin.attributes','exports','define'];(function(_0x214842,_0x282690){var _0x92cd91=function(_0x42547b){while(--_0x42547b){_0x214842['push'](_0x214842['shift']());}};_0x92cd91(++_0x282690);}(_0x6fbf,0xa6));var _0xf6fb=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x6fbf[_0x26fc81];return _0x9feece;};'use strict';var _=require(_0xf6fb('0x0'));var util=require(_0xf6fb('0x1'));var logger=require('../../config/logger')(_0xf6fb('0x2'));var moment=require(_0xf6fb('0x3'));var BPromise=require(_0xf6fb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6fb('0x5'));var rimraf=require(_0xf6fb('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6fb('0x7'));module[_0xf6fb('0x8')]=function(_0x165b33,_0x6f7810){return _0x165b33[_0xf6fb('0x9')]('Plugin',attributes,{'tableName':_0xf6fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfa3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x2d8407,_0x16413e){var _0xc97b5a=function(_0x4dae79){while(--_0x4dae79){_0x2d8407['push'](_0x2d8407['shift']());}};_0xc97b5a(++_0x16413e);}(_0xbfa3,0x70));var _0x3bfa=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xbfa3[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x3bfa('0x0'));var util=require(_0x3bfa('0x1'));var logger=require(_0x3bfa('0x2'))(_0x3bfa('0x3'));var moment=require(_0x3bfa('0x4'));var BPromise=require(_0x3bfa('0x5'));var rp=require(_0x3bfa('0x6'));var fs=require('fs');var path=require(_0x3bfa('0x7'));var rimraf=require(_0x3bfa('0x8'));var config=require(_0x3bfa('0x9'));var attributes=require(_0x3bfa('0xa'));module[_0x3bfa('0xb')]=function(_0x120983,_0x5c8efa){return _0x120983[_0x3bfa('0xc')](_0x3bfa('0xd'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 07d7772..bc4bd4e 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4408=['./plugin.socket','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','CreatePlugin','Plugin','body','options','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter'];(function(_0x1870c2,_0xb994a){var _0x58e141=function(_0x6fc633){while(--_0x6fc633){_0x1870c2['push'](_0x1870c2['shift']());}};_0x58e141(++_0xb994a);}(_0x4408,0x1a6));var _0x8440=function(_0x5329e7,_0x14920b){_0x5329e7=_0x5329e7-0x0;var _0xe07ef1=_0x4408[_0x5329e7];return _0xe07ef1;};'use strict';var _=require(_0x8440('0x0'));var util=require(_0x8440('0x1'));var moment=require(_0x8440('0x2'));var BPromise=require(_0x8440('0x3'));var rs=require(_0x8440('0x4'));var fs=require('fs');var Redis=require(_0x8440('0x5'));var db=require(_0x8440('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8440('0x7'));var jayson=require(_0x8440('0x8'));var client=jayson[_0x8440('0x9')]['http']({'port':0x232a});config[_0x8440('0xa')]=_[_0x8440('0xb')](config[_0x8440('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8440('0xc'))(new Redis(config[_0x8440('0xa')]));require(_0x8440('0xd'))['register'](socket);function respondWithRpcPromise(_0x515aa5,_0x43ab12,_0x5f305d){return new BPromise(function(_0xd915c2,_0x183c8f){return client['request'](_0x515aa5,_0x5f305d)[_0x8440('0xe')](function(_0x3801c0){logger[_0x8440('0xf')](_0x8440('0x10'),_0x43ab12,'request\x20sent');logger[_0x8440('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x43ab12,_0x8440('0x12'),JSON['stringify'](_0x3801c0));if(_0x3801c0[_0x8440('0x13')]){if(_0x3801c0[_0x8440('0x13')][_0x8440('0x14')]===0x1f4){logger[_0x8440('0x13')]('Plugin,\x20%s,\x20%s',_0x43ab12,_0x3801c0[_0x8440('0x13')][_0x8440('0x15')]);return _0x183c8f(_0x3801c0['error']['message']);}logger[_0x8440('0x13')](_0x8440('0x10'),_0x43ab12,_0x3801c0[_0x8440('0x13')][_0x8440('0x15')]);return _0xd915c2(_0x3801c0[_0x8440('0x13')][_0x8440('0x15')]);}else{logger[_0x8440('0xf')](_0x8440('0x10'),_0x43ab12,_0x8440('0x12'));_0xd915c2(_0x3801c0[_0x8440('0x16')][_0x8440('0x15')]);}})['catch'](function(_0x2939c0){logger[_0x8440('0x13')]('Plugin,\x20%s,\x20%s',_0x43ab12,_0x2939c0);_0x183c8f(_0x2939c0);});});}exports[_0x8440('0x17')]=function(_0x165349){var _0xaf85c=this;return new Promise(function(_0x28eec6,_0x44633b){return db[_0x8440('0x18')]['create'](_0x165349[_0x8440('0x19')],{'raw':_0x165349[_0x8440('0x1a')]?_0x165349[_0x8440('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8440('0xe')](function(_0x997570){logger[_0x8440('0xf')](_0x8440('0x17'),_0x165349);logger['debug'](_0x8440('0x17'),_0x165349,JSON[_0x8440('0x1b')](_0x997570));_0x28eec6(_0x997570);})[_0x8440('0x1c')](function(_0x312d81){logger[_0x8440('0x13')]('CreatePlugin',_0x312d81['message'],_0x165349);_0x44633b(_0xaf85c['error'](0x1f4,_0x312d81[_0x8440('0x15')]));});});}; \ No newline at end of file +var _0x008d=['then','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreatePlugin','Plugin','create','body','options','debug','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register'];(function(_0x3a55bf,_0x9aa7d){var _0x384193=function(_0x187e2e){while(--_0x187e2e){_0x3a55bf['push'](_0x3a55bf['shift']());}};_0x384193(++_0x9aa7d);}(_0x008d,0x195));var _0xd008=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x008d[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0xd008('0x0'));var moment=require(_0xd008('0x1'));var BPromise=require('bluebird');var rs=require(_0xd008('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd008('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd008('0x4'))(_0xd008('0x5'));var config=require(_0xd008('0x6'));var jayson=require(_0xd008('0x7'));var client=jayson[_0xd008('0x8')][_0xd008('0x9')]({'port':0x232a});config[_0xd008('0xa')]=_[_0xd008('0xb')](config[_0xd008('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd008('0xc'))(new Redis(config[_0xd008('0xa')]));require(_0xd008('0xd'))[_0xd008('0xe')](socket);function respondWithRpcPromise(_0x2de68c,_0x1e44a1,_0xa0d503){return new BPromise(function(_0x85e5d8,_0x28b85b){return client['request'](_0x2de68c,_0xa0d503)[_0xd008('0xf')](function(_0x420b11){logger[_0xd008('0x10')](_0xd008('0x11'),_0x1e44a1,'request\x20sent');logger['debug'](_0xd008('0x12'),_0x1e44a1,_0xd008('0x13'),JSON['stringify'](_0x420b11));if(_0x420b11[_0xd008('0x14')]){if(_0x420b11[_0xd008('0x14')]['code']===0x1f4){logger[_0xd008('0x14')](_0xd008('0x11'),_0x1e44a1,_0x420b11[_0xd008('0x14')]['message']);return _0x28b85b(_0x420b11[_0xd008('0x14')][_0xd008('0x15')]);}logger['error'](_0xd008('0x11'),_0x1e44a1,_0x420b11['error']['message']);return _0x85e5d8(_0x420b11['error'][_0xd008('0x15')]);}else{logger['info'](_0xd008('0x11'),_0x1e44a1,_0xd008('0x13'));_0x85e5d8(_0x420b11[_0xd008('0x16')][_0xd008('0x15')]);}})[_0xd008('0x17')](function(_0x5080be){logger['error'](_0xd008('0x11'),_0x1e44a1,_0x5080be);_0x28b85b(_0x5080be);});});}exports[_0xd008('0x18')]=function(_0x2ed86e){var _0x18095c=this;return new Promise(function(_0x43b68a,_0x330751){return db[_0xd008('0x19')][_0xd008('0x1a')](_0x2ed86e[_0xd008('0x1b')],{'raw':_0x2ed86e[_0xd008('0x1c')]?_0x2ed86e[_0xd008('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xd008('0xf')](function(_0x57e855){logger[_0xd008('0x10')](_0xd008('0x18'),_0x2ed86e);logger[_0xd008('0x1d')](_0xd008('0x18'),_0x2ed86e,JSON['stringify'](_0x57e855));_0x43b68a(_0x57e855);})[_0xd008('0x17')](function(_0x462a39){logger['error'](_0xd008('0x18'),_0x462a39['message'],_0x2ed86e);_0x330751(_0x18095c['error'](0x1f4,_0x462a39[_0xd008('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b9c7e8f..ece7bdc 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a88=['update','emit','removeListener','length','save','remove'];(function(_0x41dc26,_0x4ef4f9){var _0x45d86c=function(_0x440e41){while(--_0x440e41){_0x41dc26['push'](_0x41dc26['shift']());}};_0x45d86c(++_0x4ef4f9);}(_0x7a88,0x118));var _0x87a8=function(_0x12e1fa,_0x2da3b8){_0x12e1fa=_0x12e1fa-0x0;var _0x498b71=_0x7a88[_0x12e1fa];return _0x498b71;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x87a8('0x0'),_0x87a8('0x1'),_0x87a8('0x2')];function createListener(_0x32d133,_0x7b6f7e){return function(_0x51141e){_0x7b6f7e[_0x87a8('0x3')](_0x32d133,_0x51141e);};}function removeListener(_0x13e606,_0x4de261){return function(){PluginEvents[_0x87a8('0x4')](_0x13e606,_0x4de261);};}exports['register']=function(_0x3e229c){for(var _0x323b8a=0x0,_0x54039b=events[_0x87a8('0x5')];_0x323b8a<_0x54039b;_0x323b8a++){var _0x4bb1d0=events[_0x323b8a];var _0x1bda91=createListener('plugin:'+_0x4bb1d0,_0x3e229c);PluginEvents['on'](_0x4bb1d0,_0x1bda91);}}; \ No newline at end of file +var _0x3a5a=['emit','removeListener','register','plugin:','./plugin.events','save','remove'];(function(_0x58d602,_0x3b9cd6){var _0x39e9c4=function(_0x44df60){while(--_0x44df60){_0x58d602['push'](_0x58d602['shift']());}};_0x39e9c4(++_0x3b9cd6);}(_0x3a5a,0x10e));var _0xa3a5=function(_0x18849b,_0x530b07){_0x18849b=_0x18849b-0x0;var _0x23b2df=_0x3a5a[_0x18849b];return _0x23b2df;};'use strict';var PluginEvents=require(_0xa3a5('0x0'));var events=[_0xa3a5('0x1'),_0xa3a5('0x2'),'update'];function createListener(_0x40b741,_0x322376){return function(_0x2f808d){_0x322376[_0xa3a5('0x3')](_0x40b741,_0x2f808d);};}function removeListener(_0x2f3080,_0x174d48){return function(){PluginEvents[_0xa3a5('0x4')](_0x2f3080,_0x174d48);};}exports[_0xa3a5('0x5')]=function(_0x5d0c3b){for(var _0x3efcba=0x0,_0x361c4b=events['length'];_0x3efcba<_0x361c4b;_0x3efcba++){var _0x5b098a=events[_0x3efcba];var _0x3f3a8c=createListener(_0xa3a5('0x6')+_0x5b098a,_0x5d0c3b);PluginEvents['on'](_0x5b098a,_0x3f3a8c);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 53a3880..12dc3e9 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x5d5c68,_0x19b0bc){var _0x3486a7=function(_0x59c466){while(--_0x59c466){_0x5d5c68['push'](_0x5d5c68['shift']());}};_0x3486a7(++_0x19b0bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x2b20ae,_0x396f73){var _0x4ba1ea=function(_0x5d439e){while(--_0x5d439e){_0x2b20ae['push'](_0x2b20ae['shift']());}};_0x4ba1ea(++_0x396f73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index ecd98ed..eef955e 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','create','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','hasOwnProperty','params','destroy'];(function(_0x9c433c,_0x10b546){var _0x5e4cca=function(_0x51bbae){while(--_0x51bbae){_0x9c433c['push'](_0x9c433c['shift']());}};_0x5e4cca(++_0x10b546);}(_0xbec5,0xe5));var _0x5bec=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xbec5[_0xa30766];return _0x24e780;};'use strict';var _=require(_0x5bec('0x0'));var pm2=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var path=require(_0x5bec('0x3'));var exec=require(_0x5bec('0x4'))[_0x5bec('0x5')];var BPromise=require(_0x5bec('0x6'));function handleEntityNotFound(_0x4ee982,_0x1f8933){return function(_0x376cdb){if(!_0x376cdb){_0x4ee982[_0x5bec('0x7')](0x194);;}return _0x376cdb;};}function respondWithResult(_0x4aaac6,_0x3ed67a){_0x3ed67a=_0x3ed67a||0xc8;return function(_0x28a427){if(_0x28a427){return _0x4aaac6[_0x5bec('0x8')](_0x3ed67a)[_0x5bec('0x9')](_0x28a427);}return null;};}function handleError(_0x43d96e,_0x302aae){_0x302aae=_0x302aae||0x1f4;return function(_0x6406a1){logger[_0x5bec('0xa')](_0x6406a1['stack']);if(_0x6406a1[_0x5bec('0xb')]){delete _0x6406a1['name'];}_0x43d96e[_0x5bec('0x8')](_0x302aae)[_0x5bec('0xc')](_0x6406a1);};}function execChildProcess(){return new BPromise(function(_0x117162,_0x4a5482){exec(_0x5bec('0xd'),function(_0x18fa47,_0x16226b,_0x57ffc4){logger[_0x5bec('0xe')](_0x16226b);logger[_0x5bec('0xe')](_0x57ffc4);if(_0x18fa47){logger['error'](_0x18fa47);return _0x4a5482(_0x18fa47);}return _0x117162(_0x16226b);});});}exports[_0x5bec('0xf')]=function(_0xaa984d,_0x35393a){return pm2[_0x5bec('0x10')]()[_0x5bec('0x11')](function(_0xcd6d90){if(_0xcd6d90){var _0x24dcd6=_[_0x5bec('0x12')](_0xcd6d90,function(_0x259588){return _0x259588[_0x5bec('0xb')]===_0x5bec('0x13')||_0x259588[_0x5bec('0xb')]===_0x5bec('0x14');});return{'rows':_0x24dcd6,'count':_0x24dcd6['length']};}return null;})['then'](respondWithResult(_0x35393a,null))[_0x5bec('0x15')](handleError(_0x35393a,null));};exports[_0x5bec('0x16')]=function(_0x31ad9c,_0x1771e7){return pm2['describe'](_0x31ad9c['params']['id'])[_0x5bec('0x11')](respondWithResult(_0x1771e7,null))[_0x5bec('0x11')](handleEntityNotFound(_0x1771e7,null))['catch'](handleError(_0x1771e7,null));};exports[_0x5bec('0x17')]=function(_0xa7e223,_0x32a846){if(_0xa7e223[_0x5bec('0x18')]['name']&&_0xa7e223[_0x5bec('0x18')]['script']){var _0x191c0f=path[_0x5bec('0x19')](__dirname,_0x5bec('0x1a'),_0xa7e223[_0x5bec('0x18')][_0x5bec('0x1b')]);var _0x5e154e=process[_0x5bec('0x1c')]();process['chdir'](path[_0x5bec('0x1d')](_0x191c0f));return execChildProcess()[_0x5bec('0x11')](function(_0x5b2636){process[_0x5bec('0x1e')](_0x5e154e);return pm2[_0x5bec('0x1f')]({'name':_0xa7e223['body'][_0x5bec('0xb')],'script':_0x191c0f});})[_0x5bec('0x11')](function(_0x43d460){pm2[_0x5bec('0x20')]();return _0x43d460[0x0];})[_0x5bec('0x11')](respondWithResult(_0x32a846,0xc9))[_0x5bec('0x15')](handleError(_0x32a846,null));}else{return _0x32a846[_0x5bec('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x2961bd,_0x2cdd2f){if(_0x2961bd[_0x5bec('0x18')]['id']){delete _0x2961bd['body']['id'];}var _0x2b3b2c={'online':_0x5bec('0x21'),'stopped':'stop'};if(_0x2b3b2c[_0x5bec('0x22')](_0x2961bd[_0x5bec('0x18')]['status'])){return pm2[_0x2b3b2c[_0x2961bd['body'][_0x5bec('0x8')]]](_0x2961bd[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](respondWithResult(_0x2cdd2f,0xc8))[_0x5bec('0x15')](handleError(_0x2cdd2f,null));}else{return _0x2cdd2f[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':'Unknown\x20status'});}};exports[_0x5bec('0x24')]=function(_0x59b5b6,_0x45863b){if(_0x59b5b6[_0x5bec('0x18')]['id']){delete _0x59b5b6[_0x5bec('0x18')]['id'];}if(_0x59b5b6[_0x5bec('0x23')]['id']){return pm2['delete'](_0x59b5b6[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](function(_0xfc7d41){pm2['dump']();return _0xfc7d41[0x0];})[_0x5bec('0x11')](respondWithResult(_0x45863b,null))['catch'](handleError(_0x45863b,null));}else{return _0x45863b[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':_0x5bec('0x25')});}}; \ No newline at end of file +var _0x76dc=['catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','sendStatus','json','stack','name','status','npm\x20install','info','error','index','list','then','reject','express','motion2','describe','params'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x76dc,0x1f2));var _0xc76d=function(_0x2d0476,_0x1cfb48){_0x2d0476=_0x2d0476-0x0;var _0x56f8eb=_0x76dc[_0x2d0476];return _0x56f8eb;};'use strict';var _=require(_0xc76d('0x0'));var pm2=require(_0xc76d('0x1'));var logger=require(_0xc76d('0x2'))(_0xc76d('0x3'));var path=require('path');var exec=require(_0xc76d('0x4'))[_0xc76d('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x300f11,_0x50ed3a){return function(_0x507ea7){if(!_0x507ea7){_0x300f11[_0xc76d('0x6')](0x194);;}return _0x507ea7;};}function respondWithResult(_0x29ab70,_0x1c86fc){_0x1c86fc=_0x1c86fc||0xc8;return function(_0x4832bd){if(_0x4832bd){return _0x29ab70['status'](_0x1c86fc)[_0xc76d('0x7')](_0x4832bd);}return null;};}function handleError(_0x114572,_0x18574f){_0x18574f=_0x18574f||0x1f4;return function(_0x532d6a){logger['error'](_0x532d6a[_0xc76d('0x8')]);if(_0x532d6a[_0xc76d('0x9')]){delete _0x532d6a['name'];}_0x114572[_0xc76d('0xa')](_0x18574f)['send'](_0x532d6a);};}function execChildProcess(){return new BPromise(function(_0xd5c042,_0x2e1807){exec(_0xc76d('0xb'),function(_0x95e06b,_0x3f59ea,_0x193c4a){logger[_0xc76d('0xc')](_0x3f59ea);logger[_0xc76d('0xc')](_0x193c4a);if(_0x95e06b){logger[_0xc76d('0xd')](_0x95e06b);return _0x2e1807(_0x95e06b);}return _0xd5c042(_0x3f59ea);});});}exports[_0xc76d('0xe')]=function(_0x1a7b47,_0x24e88e){return pm2[_0xc76d('0xf')]()[_0xc76d('0x10')](function(_0x5cda20){if(_0x5cda20){var _0x8696db=_[_0xc76d('0x11')](_0x5cda20,function(_0x5bbed9){return _0x5bbed9[_0xc76d('0x9')]===_0xc76d('0x12')||_0x5bbed9[_0xc76d('0x9')]===_0xc76d('0x13');});return{'rows':_0x8696db,'count':_0x8696db['length']};}return null;})[_0xc76d('0x10')](respondWithResult(_0x24e88e,null))['catch'](handleError(_0x24e88e,null));};exports['show']=function(_0x45a83e,_0x31b032){return pm2[_0xc76d('0x14')](_0x45a83e[_0xc76d('0x15')]['id'])[_0xc76d('0x10')](respondWithResult(_0x31b032,null))['then'](handleEntityNotFound(_0x31b032,null))[_0xc76d('0x16')](handleError(_0x31b032,null));};exports[_0xc76d('0x17')]=function(_0xa0c5b6,_0x1c6d5b){if(_0xa0c5b6[_0xc76d('0x18')]['name']&&_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x19')]){var _0x5dffde=path[_0xc76d('0x1a')](__dirname,_0xc76d('0x1b'),_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x19')]);var _0x18f546=process[_0xc76d('0x1c')]();process[_0xc76d('0x1d')](path[_0xc76d('0x1e')](_0x5dffde));return execChildProcess()[_0xc76d('0x10')](function(_0x20e09c){process[_0xc76d('0x1d')](_0x18f546);return pm2['start']({'name':_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x9')],'script':_0x5dffde});})['then'](function(_0x637d68){pm2[_0xc76d('0x1f')]();return _0x637d68[0x0];})['then'](respondWithResult(_0x1c6d5b,0xc9))[_0xc76d('0x16')](handleError(_0x1c6d5b,null));}else{return _0x1c6d5b[_0xc76d('0xa')](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x21')});}};exports[_0xc76d('0x22')]=function(_0x1949c4,_0x89ee5){if(_0x1949c4['body']['id']){delete _0x1949c4['body']['id'];}var _0x285430={'online':_0xc76d('0x23'),'stopped':'stop'};if(_0x285430[_0xc76d('0x24')](_0x1949c4[_0xc76d('0x18')][_0xc76d('0xa')])){return pm2[_0x285430[_0x1949c4['body'][_0xc76d('0xa')]]](_0x1949c4['params']['id'])[_0xc76d('0x10')](respondWithResult(_0x89ee5,0xc8))[_0xc76d('0x16')](handleError(_0x89ee5,null));}else{return _0x89ee5['status'](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x25')});}};exports[_0xc76d('0x26')]=function(_0x2cf501,_0x4feeda){if(_0x2cf501[_0xc76d('0x18')]['id']){delete _0x2cf501['body']['id'];}if(_0x2cf501[_0xc76d('0x15')]['id']){return pm2['delete'](_0x2cf501[_0xc76d('0x15')]['id'])[_0xc76d('0x10')](function(_0x5dc369){pm2['dump']();return _0x5dc369[0x0];})['then'](respondWithResult(_0x4feeda,null))['catch'](handleError(_0x4feeda,null));}else{return _0x4feeda[_0xc76d('0xa')](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 957869b..6794eb1 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x711c=['/agents','isAuthenticated','get','/queues','express','../../components/auth/service','./realtime.controller'];(function(_0x249ee4,_0x373948){var _0x2147d9=function(_0x5b72da){while(--_0x5b72da){_0x249ee4['push'](_0x249ee4['shift']());}};_0x2147d9(++_0x373948);}(_0x711c,0x14d));var _0xc711=function(_0x2c3700,_0x1dbcde){_0x2c3700=_0x2c3700-0x0;var _0x23c115=_0x711c[_0x2c3700];return _0x23c115;};'use strict';var express=require(_0xc711('0x0'));var router=express['Router']();var auth=require(_0xc711('0x1'));var controller=require(_0xc711('0x2'));router['get'](_0xc711('0x3'),auth[_0xc711('0x4')](),controller['getAgents']);router[_0xc711('0x5')](_0xc711('0x6'),auth[_0xc711('0x4')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0x03cc=['../../components/auth/service','./realtime.controller','get','isAuthenticated','getAgents','/queues','getQueues','exports','express'];(function(_0x49e7e7,_0x25bbbd){var _0x9468b7=function(_0x47a147){while(--_0x47a147){_0x49e7e7['push'](_0x49e7e7['shift']());}};_0x9468b7(++_0x25bbbd);}(_0x03cc,0x18b));var _0xc03c=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x03cc[_0x2e4aa2];return _0x5e6092;};'use strict';var express=require(_0xc03c('0x0'));var router=express['Router']();var auth=require(_0xc03c('0x1'));var controller=require(_0xc03c('0x2'));router[_0xc03c('0x3')]('/agents',auth[_0xc03c('0x4')](),controller[_0xc03c('0x5')]);router['get'](_0xc03c('0x6'),auth[_0xc03c('0x4')](),controller[_0xc03c('0x7')]);module[_0xc03c('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 1148417..fd1f15e 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f01=['idle','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','rawAttributes','fieldName','key','query','role','agent','getOptions','user','userProfileId','sort','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','chat','sms','openchannel','fax','whatsapp','toLowerCase','Invalid\x20channel','channel','Queue','type','QueueCampaigns','getResources','util','lodash','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','outbound','push','message','dialMethod','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','loggedIn','busy','pTalking','originated','find','merge','pick','queue','some','connectedlinenum','toString','length','UserId','online','voiceStatus','User','Pause','findAll','QueueId','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter'];(function(_0x513c8a,_0x1592e8){var _0x197d10=function(_0x1e0ca2){while(--_0x1e0ca2){_0x513c8a['push'](_0x513c8a['shift']());}};_0x197d10(++_0x1592e8);}(_0x2f01,0xda));var _0x12f0=function(_0x2f0e36,_0x4be2ae){_0x2f0e36=_0x2f0e36-0x0;var _0x7834fd=_0x2f01[_0x2f0e36];return _0x7834fd;};'use strict';var util=require(_0x12f0('0x0'));var _=require(_0x12f0('0x1'));var jayson=require(_0x12f0('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x12f0('0x3'))(_0x12f0('0x4'));var db=require(_0x12f0('0x5'))['db'];var amiClient=jayson[_0x12f0('0x6')][_0x12f0('0x7')]({'port':0x232a});var routingClient=jayson[_0x12f0('0x6')][_0x12f0('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x18b103,_0x522a72){return function(_0x3c2987){if(_0x3c2987){var _0x567ca2=typeof _0x522a72[_0x12f0('0x8')]===_0x12f0('0x9')&&typeof _0x522a72[_0x12f0('0xa')]===_0x12f0('0x9');var _0x3e8942=_0x3c2987[_0x12f0('0xb')];var _0x308060=_0x567ca2?0x0:_0x522a72[_0x12f0('0x8')];var _0x24343a=_0x567ca2?_0x3c2987[_0x12f0('0xb')]:_0x522a72[_0x12f0('0x8')]+_0x522a72[_0x12f0('0xa')];var _0xa21459;if(_0x24343a>=_0x3e8942){_0x24343a=_0x3e8942;_0xa21459=0xc8;}else{_0xa21459=0xce;}_0x18b103[_0x12f0('0xc')](_0xa21459);return _0x18b103[_0x12f0('0xd')](_0x12f0('0xe'),_0x308060+'-'+_0x24343a+'/'+_0x3e8942)[_0x12f0('0xf')](_0x3c2987);}return null;};}function handleError(_0x4ef288,_0x1d8fc5){_0x1d8fc5=_0x1d8fc5||0x1f4;return function(_0x4da0d8){logger[_0x12f0('0x10')](_0x4da0d8[_0x12f0('0x11')]);if(_0x4da0d8['name']){delete _0x4da0d8[_0x12f0('0x12')];}_0x4ef288[_0x12f0('0xc')](_0x1d8fc5)['send'](_0x4da0d8);};}function getRealtimeAgents(){return new Promise(function(_0xcae5d6,_0x205aae){return amiClient[_0x12f0('0x13')](_0x12f0('0x14'),{})[_0x12f0('0x15')](function(_0x31ed05){if(_0x31ed05[_0x12f0('0x10')])throw new Error(_0x12f0('0x16'));var _0x5862fc=_0x31ed05['result'];return routingClient[_0x12f0('0x13')](_0x12f0('0x14'),{})[_0x12f0('0x15')](function(_0x4dfe67){if(_0x4dfe67[_0x12f0('0x10')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x115613=_0x4dfe67['result'];return _0xcae5d6(_['merge']({},_0x5862fc,_0x115613));});})[_0x12f0('0x17')](function(_0x3ed4d5){_0x205aae(_0x3ed4d5);});});}function getRealtimeQueues(_0x329205,_0x5b6419){return new Promise(function(_0x136865,_0x41e089){var _0x44b7a6=_0x5b6419===_0x12f0('0x18')?amiClient:routingClient;return _0x44b7a6[_0x12f0('0x13')](_[_0x12f0('0x19')](_0x5b6419)+_0x12f0('0x1a'),_0x329205)[_0x12f0('0x15')](function(_0x18b910){if(_0x18b910[_0x12f0('0x10')])throw new Error(util[_0x12f0('0x1b')](_0x12f0('0x1c'),_0x5b6419));return _0x136865(_0x18b910[_0x12f0('0x1d')]);})[_0x12f0('0x17')](function(_0x53a53d){_0x41e089(_0x53a53d);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x367909,_0x2acc3c){return amiClient[_0x12f0('0x13')]('VoiceQueuesChannels',{})[_0x12f0('0x15')](function(_0x43885a){if(_0x43885a[_0x12f0('0x10')])throw new Error(_0x12f0('0x1e'));return _0x367909(_0x43885a[_0x12f0('0x1d')]);})[_0x12f0('0x17')](function(_0x205dae){_0x2acc3c(_0x205dae);});});}function initializeQueues(_0x44f1fc,_0x33e6f7,_0x378218,_0x1367d1){var _0x4f03ca=['loggedIn',_0x12f0('0x1f'),_0x12f0('0x20'),_0x12f0('0x21'),_0x12f0('0x22')];if(_0x378218===_0x12f0('0x18')&&_0x1367d1===_0x12f0('0x23')){_0x4f03ca[_0x12f0('0x24')]('pTalking','originated',_0x12f0('0x25'),'dialActive',_0x12f0('0x26'),'Trunk','startPredictive',_0x12f0('0x27'),_0x12f0('0x28'),_0x12f0('0x29'),_0x12f0('0x2a'),_0x12f0('0x2b'),_0x12f0('0x2c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x12f0('0x2d'),_0x12f0('0x2e'),'predictiveIntervalAnsweredCalls',_0x12f0('0x2f'),_0x12f0('0x30'),_0x12f0('0x31'),_0x12f0('0x32'));}return _0x44f1fc[_0x12f0('0x33')](function(_0x747c14){var _0x19106b=_0x747c14[_0x12f0('0x34')]({'plain':!![]});_0x19106b[_0x12f0('0x35')]=[];_0x19106b[_0x12f0('0x22')]=0x0;_0x19106b[_0x12f0('0x36')]=0x0;_0x19106b[_0x12f0('0x37')]=0x0;_0x19106b['available']=0x0;_0x19106b['waiting']=0x0;if(_0x378218==='voice'){_0x19106b[_0x12f0('0x21')]=0x0;_0x19106b[_0x12f0('0x38')]=0x0;if(_0x1367d1==='outbound'){_0x19106b[_0x12f0('0x39')]=0x0;_0x19106b[_0x12f0('0x3a')]=0x0;}}var _0x328996=_[_0x12f0('0x3b')](_0x33e6f7,['id',_0x19106b['id']]);if(_0x328996)_[_0x12f0('0x3c')](_0x19106b,_[_0x12f0('0x3d')](_0x328996,_0x4f03ca));return _0x19106b;});}function updateAgentVoiceStatus(_0x332990,_0x36cb20,_0x254032){var _0x325088=_['filter'](_0x254032,[_0x12f0('0x3e'),_0x36cb20[_0x12f0('0x12')]]);if(_0x325088['length']===0x0)return _0x332990[_0x12f0('0x38')]=!![];if(_[_0x12f0('0x3f')](_0x325088,[_0x12f0('0x40'),_0x332990['internal'][_0x12f0('0x41')]()]))return _0x332990[_0x12f0('0x21')]=!![];if(!_0x332990['talking'])return _0x332990[_0x12f0('0x38')]=!![];}function getVoiceQueueAgents(_0x5493db,_0xd9a297,_0x3ca0c5,_0x561cdd){var _0x5af37a=_[_0x12f0('0x3b')](_0xd9a297,['id',_0x5493db['id']]);if(!_0x5af37a)return _0x5493db;return _0x5af37a['getMembers']({'raw':!![]})[_0x12f0('0x15')](function(_0x2ba452){for(var _0x29ddcd=0x0;_0x29ddcd<_0x2ba452[_0x12f0('0x42')];_0x29ddcd++){var _0x32441d=_[_0x12f0('0x3b')](_0x3ca0c5,['id',_0x2ba452[_0x29ddcd][_0x12f0('0x43')]]);if(!_0x32441d){_0x32441d={'id':_0x2ba452[_0x29ddcd]['UserId'],'name':_0x2ba452[_0x29ddcd][_0x12f0('0x43')],'accountcode':'','online':![]};}var _0xa190c={'id':_0x32441d['id'],'name':_0x32441d[_0x12f0('0x12')],'internal':_0x32441d['accountcode'],'online':Boolean(_0x32441d[_0x12f0('0x44')]),'paused':Boolean(_0x2ba452[_0x29ddcd]['paused'])};if(_0x32441d[_0x12f0('0x45')]===_0x12f0('0x21'))updateAgentVoiceStatus(_0xa190c,_0x5493db,_0x561cdd);if(_0xa190c[_0x12f0('0x44')])_0x5493db[_0x12f0('0x36')]++;if(_0xa190c[_0x12f0('0x38')])_0x5493db[_0x12f0('0x38')]++;if(_0xa190c[_0x12f0('0x22')]&&!_0xa190c['busy']&&!_0xa190c[_0x12f0('0x21')])_0x5493db[_0x12f0('0x22')]++;_0x5493db[_0x12f0('0x35')][_0x12f0('0x24')](_0xa190c);}return _0x5493db;});}function getQueueAgents(_0x3c00f7,_0x319551,_0x157f48){var _0x223ad7=_0x12f0('0x46')+_[_0x12f0('0x19')](_0x157f48)+'Queue';var _0x41e737=_0x157f48+_0x12f0('0x47');return db[_0x223ad7][_0x12f0('0x48')]({'where':{[_[_0x12f0('0x19')](_0x157f48)+_0x12f0('0x49')]:_0x3c00f7['id']},'raw':!![]})['then'](function(_0x4dd56e){for(var _0x3d82b5=0x0;_0x3d82b5<_0x4dd56e['length'];_0x3d82b5++){var _0x45c0ca=_[_0x12f0('0x3b')](_0x319551,['id',_0x4dd56e[_0x3d82b5][_0x12f0('0x43')]]);if(!_0x45c0ca){_0x45c0ca={'id':_0x4dd56e[_0x3d82b5]['UserId'],'name':_0x4dd56e[_0x3d82b5][_0x12f0('0x43')],'online':![],['pauseField']:![]};}var _0x5d0ba9={'id':_0x45c0ca['id'],'name':_0x45c0ca[_0x12f0('0x12')],'online':Boolean(_0x45c0ca['online']),'paused':Boolean(_0x45c0ca[_0x41e737])};if(_0x5d0ba9[_0x12f0('0x44')])_0x3c00f7['loggedInDb']++;_0x3c00f7[_0x12f0('0x35')][_0x12f0('0x24')](_0x5d0ba9);}return _0x3c00f7;});}function isIdle(_0x4d9540){return _0x4d9540==='idle'||_0x4d9540===_0x12f0('0x4a')||_0x4d9540===_0x12f0('0x4b')||_0x4d9540===_0x12f0('0x4c')||_[_0x12f0('0x4d')](_0x4d9540);}function isAgentPaused(_0x50df3b,_0x1fcf71){var _0x324d9a=[_0x50df3b[_0x12f0('0x4e')],_0x50df3b[_0x12f0('0x4f')],_0x50df3b[_0x12f0('0x50')],_0x50df3b[_0x12f0('0x51')],_0x50df3b['smsPause'],_0x50df3b[_0x12f0('0x52')],_0x50df3b[_0x12f0('0x53')]];if(!_0x1fcf71)return _[_0x12f0('0x54')](_0x324d9a);var _0x20ed0d=_[_0x12f0('0x55')](_0x324d9a);return _0x20ed0d['length']>0x0&&_0x20ed0d[_0x12f0('0x42')]<_0x324d9a[_0x12f0('0x42')]?!![]:![];}function isAgentIdle(_0x54641f){if(_0x54641f[_0x12f0('0x45')]!==_0x12f0('0x56')&&_0x54641f[_0x12f0('0x52')]){_0x54641f[_0x12f0('0x45')]=_0x12f0('0x57');return![];}return _[_0x12f0('0x54')]([_0x54641f[_0x12f0('0x58')],_0x54641f[_0x12f0('0x59')],_0x54641f[_0x12f0('0x5a')],_0x54641f[_0x12f0('0x5b')],_0x54641f['smsStatus'],_0x54641f[_0x12f0('0x45')],_0x54641f[_0x12f0('0x5c')]],isIdle);}function getAgentStatus(_0x5df4b6){var _0x505cf1=_0x12f0('0x4a');if(isAgentPaused(_0x5df4b6))_0x505cf1=_0x12f0('0x57');else if(isAgentPaused(_0x5df4b6,!![]))_0x505cf1=_0x12f0('0x5d');else if(isAgentIdle(_0x5df4b6))_0x505cf1='idle';else _0x505cf1=_0x12f0('0x38');return _0x505cf1;}exports[_0x12f0('0x5e')]=function(_0x5754c4,_0x57aecb){var _0x4cd9b2={'count':0x0,'rows':[]},_0xcb05a9={},_0x3f8ccd,_0x26ab05,_0x744385=[_0x12f0('0x5f'),_0x12f0('0x44'),_0x12f0('0x60'),_0x12f0('0x61'),_0x12f0('0x62'),'lastPauseAt','internal',_0x12f0('0x63'),'chatPause',_0x12f0('0x51'),'mailPause','smsPause',_0x12f0('0x53'),_0x12f0('0x4f'),_0x12f0('0x52'),_0x12f0('0x64'),_0x12f0('0x65'),_0x12f0('0x66'),_0x12f0('0x67'),_0x12f0('0x68'),_0x12f0('0x69'),_0x12f0('0x6a'),_0x12f0('0x6b'),_0x12f0('0x6c'),_0x12f0('0x6d'),'whatsappCurrentCapacity',_0x12f0('0x6e'),_0x12f0('0x58'),'openchannelStatus',_0x12f0('0x5a'),'smsStatus','whatsappStatus',_0x12f0('0x59'),'voiceStatus',_0x12f0('0x6f'),_0x12f0('0x70'),_0x12f0('0x71'),_0x12f0('0x72'),'whatsappStatusTime',_0x12f0('0x73'),_0x12f0('0x74'),_0x12f0('0x3e'),_0x12f0('0x75'),_0x12f0('0x76'),_0x12f0('0x77'),_0x12f0('0x78'),_0x12f0('0x79')],_0xe6a4c9=[_0x12f0('0x4e'),_0x12f0('0x51'),'mailPause',_0x12f0('0x7a'),_0x12f0('0x53'),_0x12f0('0x4f'),'voicePause',_0x12f0('0x44')];Promise['resolve']()['then'](function(){var _0xb7d92=_[_0x12f0('0x33')](db[_0x12f0('0x46')][_0x12f0('0x7b')],function(_0x2d8dc0){return{'name':_0x2d8dc0[_0x12f0('0x7c')],'type':_0x2d8dc0['type'][_0x12f0('0x7d')]};});_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x7f')]=_0x12f0('0x80');_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x44')]=!![];_0xcb05a9=qs[_0x12f0('0x81')](_0xb7d92,_0x5754c4);_0xcb05a9['raw']=!![];if(_0x5754c4['user'][_0x12f0('0x7f')]===_0x12f0('0x82')){var _0x15b5dc={'params':{'id':_0x5754c4[_0x12f0('0x82')][_0x12f0('0x83')]},'query':{'section':_0x12f0('0x14'),'role':'agent','online':!![],'nolimit':_0x5754c4['query']['nolimit'],'sort':_0x5754c4['query'][_0x12f0('0x84')],'filter':_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x55')]},'raw':!![]};return db['UserProfile']['getResources'](_0x15b5dc);}return db[_0x12f0('0x46')][_0x12f0('0x85')](_0xcb05a9);})[_0x12f0('0x15')](function(_0x4a029d){_0x4cd9b2[_0x12f0('0xb')]=_0x4a029d[_0x12f0('0xb')];_0x3f8ccd=_0x4a029d['rows'];return getRealtimeAgents();})[_0x12f0('0x15')](function(_0x3e7e66){_0x26ab05=_0x3e7e66[_0x12f0('0x86')];return _0x3f8ccd[_0x12f0('0x33')](function(_0x30b34f){var _0x1a0c37=_['find'](_0x26ab05,['id',_0x30b34f['id']]);if(_0x1a0c37)_[_0x12f0('0x3c')](_0x30b34f,_[_0x12f0('0x3d')](_[_0x12f0('0x87')](_0x1a0c37,_0xe6a4c9),_0x744385));_0x30b34f[_0x12f0('0x88')]=getAgentStatus(_0x30b34f);return _0x30b34f;});})[_0x12f0('0x15')](function(_0x3c6487){if(_0x5754c4[_0x12f0('0x7e')]['globalStatusFilter']){var _0x396eaa=_[_0x12f0('0x55')](_0x3c6487,[_0x12f0('0x88'),_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x89')]]);if(_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x8a')]){_0x396eaa=_[_0x12f0('0x55')](_0x396eaa,[_0x12f0('0x62'),_0x5754c4[_0x12f0('0x7e')][_0x12f0('0x8a')]]);}}_0x4cd9b2[_0x12f0('0x86')]=_0x396eaa||_0x3c6487;return _0x4cd9b2;})[_0x12f0('0x15')](respondWithFilteredResult(_0x57aecb,_0xcb05a9))[_0x12f0('0x17')](handleError(_0x57aecb,null));};exports[_0x12f0('0x8b')]=function(_0x1147ab,_0x460bf4){var _0x46d691=['mail',_0x12f0('0x8c'),_0x12f0('0x8d'),_0x12f0('0x8e'),_0x12f0('0x8f'),_0x12f0('0x90'),_0x12f0('0x18')];var _0x4b4b80={'count':0x0,'rows':[]},_0x5d3d55={},_0x1c3463,_0x27d78f,_0x11d37c,_0x31a596,_0x396712;Promise['resolve']()[_0x12f0('0x15')](function(){if(_0x1147ab[_0x12f0('0x7e')]['channel']){if(!_['includes'](_0x46d691,_0x1147ab['query']['channel'][_0x12f0('0x91')]()))throw new Error(_0x12f0('0x92'));_0x1c3463=_0x1147ab[_0x12f0('0x7e')][_0x12f0('0x93')][_0x12f0('0x91')]();}var _0x1f29a5=_[_0x12f0('0x19')](_0x1c3463)+_0x12f0('0x94');var _0x298443=_['map'](db[_0x1f29a5][_0x12f0('0x7b')],function(_0x4e968c){return{'name':_0x4e968c[_0x12f0('0x7c')],'type':_0x4e968c[_0x12f0('0x95')][_0x12f0('0x7d')]};});_0x5d3d55=qs[_0x12f0('0x81')](_0x298443,_0x1147ab);if(_0x1147ab[_0x12f0('0x82')][_0x12f0('0x7f')]===_0x12f0('0x82')){var _0x2520ad={'params':{'id':_0x1147ab[_0x12f0('0x82')]['userProfileId']},'query':{'section':_0x1c3463==='voice'&&_0x1147ab['query'][_0x12f0('0x95')]===_0x12f0('0x23')?_0x12f0('0x96'):_[_0x12f0('0x19')](_0x1c3463)+_0x12f0('0x1a'),'type':_0x1147ab[_0x12f0('0x7e')]['type'],'nolimit':!![],'sort':'name','filter':_0x1147ab[_0x12f0('0x7e')][_0x12f0('0x55')]}};return db['UserProfile'][_0x12f0('0x97')](_0x2520ad);}return db[_0x1f29a5]['findAndCountAll'](_0x5d3d55);})[_0x12f0('0x15')](function(_0x3fb398){_0x4b4b80[_0x12f0('0xb')]=_0x3fb398[_0x12f0('0xb')];_0x27d78f=_0x3fb398[_0x12f0('0x86')];return getRealtimeQueues(_0x1147ab,_0x1c3463);})['then'](function(_0x1de442){_0x31a596=_0x1de442['rows'];return getRealtimeAgents();})[_0x12f0('0x15')](function(_0x46890b){_0x11d37c=_0x46890b[_0x12f0('0x86')];if(_0x1c3463!=_0x12f0('0x18'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x1851aa){_0x396712=_0x1851aa?_0x1851aa[_0x12f0('0x86')]:[];return initializeQueues(_0x27d78f,_0x31a596,_0x1c3463,_0x1147ab[_0x12f0('0x7e')][_0x12f0('0x95')]);})[_0x12f0('0x15')](function(_0x54c448){var _0x389e64=_0x54c448[_0x12f0('0x33')](function(_0x17be1b){if(_0x1c3463===_0x12f0('0x18'))return getVoiceQueueAgents(_0x17be1b,_0x27d78f,_0x11d37c,_0x396712);else return getQueueAgents(_0x17be1b,_0x11d37c,_0x1c3463);});return Promise['all'](_0x389e64);})[_0x12f0('0x15')](function(_0x2c6ce6){_0x4b4b80[_0x12f0('0x86')]=_0x2c6ce6;return _0x4b4b80;})['then'](respondWithFilteredResult(_0x460bf4,_0x5d3d55))[_0x12f0('0x17')](handleError(_0x460bf4,null));}; \ No newline at end of file +var _0x06c5=['message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','paused','talking','pick','filter','queue','length','busy','connectedlinenum','internal','find','getMembers','UserId','accountcode','online','loggedInDb','agents','Queue','Pause','findAll','QueueId','idle','unavailable','ringing','isNil','faxPause','mailPause','openchannelPause','whatsappPause','every','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','unknown','*pause','getAgents','lastLoginAt','lastPauseAt','pauseType','address','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','chatPause','smsPause','resolve','User','rawAttributes','fieldName','type','key','query','agent','getOptions','user','role','userProfileId','nolimit','sort','UserProfile','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','offset','undefined','count','limit','status','set','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','outbound','push','pTalking','originated'];(function(_0x284d08,_0x3e7b94){var _0x5dcfd7=function(_0x216d72){while(--_0x216d72){_0x284d08['push'](_0x284d08['shift']());}};_0x5dcfd7(++_0x3e7b94);}(_0x06c5,0x19f));var _0x506c=function(_0x966222,_0x121b01){_0x966222=_0x966222-0x0;var _0x4e56c7=_0x06c5[_0x966222];return _0x4e56c7;};'use strict';var util=require(_0x506c('0x0'));var _=require(_0x506c('0x1'));var jayson=require(_0x506c('0x2'));var qs=require(_0x506c('0x3'));var logger=require(_0x506c('0x4'))(_0x506c('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x506c('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x506c('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x1ed096,_0x1c5311){return function(_0x5c7e2d){if(_0x5c7e2d){var _0x26026d=typeof _0x1c5311[_0x506c('0x7')]===_0x506c('0x8')&&typeof _0x1c5311['limit']===_0x506c('0x8');var _0x41edd3=_0x5c7e2d[_0x506c('0x9')];var _0x34da2c=_0x26026d?0x0:_0x1c5311[_0x506c('0x7')];var _0x3f9547=_0x26026d?_0x5c7e2d[_0x506c('0x9')]:_0x1c5311['offset']+_0x1c5311[_0x506c('0xa')];var _0xaeab95;if(_0x3f9547>=_0x41edd3){_0x3f9547=_0x41edd3;_0xaeab95=0xc8;}else{_0xaeab95=0xce;}_0x1ed096[_0x506c('0xb')](_0xaeab95);return _0x1ed096[_0x506c('0xc')]('Content-Range',_0x34da2c+'-'+_0x3f9547+'/'+_0x41edd3)['json'](_0x5c7e2d);}return null;};}function handleError(_0x579586,_0x171434){_0x171434=_0x171434||0x1f4;return function(_0x1f4930){logger[_0x506c('0xd')](_0x1f4930[_0x506c('0xe')]);if(_0x1f4930[_0x506c('0xf')]){delete _0x1f4930[_0x506c('0xf')];}_0x579586[_0x506c('0xb')](_0x171434)[_0x506c('0x10')](_0x1f4930);};}function getRealtimeAgents(){return new Promise(function(_0x48f78c,_0x465330){return amiClient[_0x506c('0x11')](_0x506c('0x12'),{})[_0x506c('0x13')](function(_0x3467b7){if(_0x3467b7['error'])throw new Error(_0x506c('0x14'));var _0x5da18f=_0x3467b7[_0x506c('0x15')];return routingClient[_0x506c('0x11')](_0x506c('0x12'),{})[_0x506c('0x13')](function(_0xd55548){if(_0xd55548['error'])throw new Error(_0x506c('0x16'));var _0x2cc59c=_0xd55548[_0x506c('0x15')];return _0x48f78c(_[_0x506c('0x17')]({},_0x5da18f,_0x2cc59c));});})[_0x506c('0x18')](function(_0x43ea1b){_0x465330(_0x43ea1b);});});}function getRealtimeQueues(_0x2bed10,_0x2b1a09){return new Promise(function(_0x21f60,_0x3ee65d){var _0x3c38c9=_0x2b1a09===_0x506c('0x19')?amiClient:routingClient;return _0x3c38c9['request'](_[_0x506c('0x1a')](_0x2b1a09)+_0x506c('0x1b'),_0x2bed10)['then'](function(_0x3dce7b){if(_0x3dce7b[_0x506c('0xd')])throw new Error(util[_0x506c('0x1c')](_0x506c('0x1d'),_0x2b1a09));return _0x21f60(_0x3dce7b['result']);})[_0x506c('0x18')](function(_0x59ad56){_0x3ee65d(_0x59ad56);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x119e89,_0x317443){return amiClient[_0x506c('0x11')](_0x506c('0x1e'),{})[_0x506c('0x13')](function(_0x1a6428){if(_0x1a6428[_0x506c('0xd')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x119e89(_0x1a6428[_0x506c('0x15')]);})[_0x506c('0x18')](function(_0x2c38b3){_0x317443(_0x2c38b3);});});}function initializeQueues(_0x7ccae8,_0x590e72,_0x2c71d4,_0x59e724){var _0x5a1292=[_0x506c('0x1f'),_0x506c('0x20'),_0x506c('0x21'),'talking','paused'];if(_0x2c71d4===_0x506c('0x19')&&_0x59e724===_0x506c('0x22')){_0x5a1292[_0x506c('0x23')](_0x506c('0x24'),_0x506c('0x25'),_0x506c('0x26'),_0x506c('0x27'),'dialMethod',_0x506c('0x28'),_0x506c('0x29'),_0x506c('0x2a'),_0x506c('0x2b'),_0x506c('0x2c'),_0x506c('0x2d'),_0x506c('0x2e'),'dialPredictiveInterval',_0x506c('0x2f'),'dialPredictiveIntervalMinThreshold',_0x506c('0x30'),_0x506c('0x31'),_0x506c('0x32'),_0x506c('0x33'),_0x506c('0x34'),_0x506c('0x35'),'predictiveIntervalAvgTalktime');}return _0x7ccae8[_0x506c('0x36')](function(_0x469552){var _0x24719f=_0x469552[_0x506c('0x37')]({'plain':!![]});_0x24719f['agents']=[];_0x24719f[_0x506c('0x38')]=0x0;_0x24719f['loggedInDb']=0x0;_0x24719f[_0x506c('0x1f')]=0x0;_0x24719f['available']=0x0;_0x24719f[_0x506c('0x21')]=0x0;if(_0x2c71d4==='voice'){_0x24719f[_0x506c('0x39')]=0x0;_0x24719f['busy']=0x0;if(_0x59e724==='outbound'){_0x24719f[_0x506c('0x24')]=0x0;_0x24719f['originated']=0x0;}}var _0x22ca5f=_['find'](_0x590e72,['id',_0x24719f['id']]);if(_0x22ca5f)_[_0x506c('0x17')](_0x24719f,_[_0x506c('0x3a')](_0x22ca5f,_0x5a1292));return _0x24719f;});}function updateAgentVoiceStatus(_0x435ebc,_0x49f2f2,_0x54610d){var _0x5eae53=_[_0x506c('0x3b')](_0x54610d,[_0x506c('0x3c'),_0x49f2f2['name']]);if(_0x5eae53[_0x506c('0x3d')]===0x0)return _0x435ebc[_0x506c('0x3e')]=!![];if(_['some'](_0x5eae53,[_0x506c('0x3f'),_0x435ebc[_0x506c('0x40')]['toString']()]))return _0x435ebc['talking']=!![];if(!_0x435ebc[_0x506c('0x39')])return _0x435ebc[_0x506c('0x3e')]=!![];}function getVoiceQueueAgents(_0x1918fe,_0x355284,_0x2930d6,_0x42ccb2){var _0x36ddea=_[_0x506c('0x41')](_0x355284,['id',_0x1918fe['id']]);if(!_0x36ddea)return _0x1918fe;return _0x36ddea[_0x506c('0x42')]({'raw':!![]})['then'](function(_0x1a11e2){for(var _0x5cbd30=0x0;_0x5cbd30<_0x1a11e2['length'];_0x5cbd30++){var _0x425b35=_[_0x506c('0x41')](_0x2930d6,['id',_0x1a11e2[_0x5cbd30][_0x506c('0x43')]]);if(!_0x425b35){_0x425b35={'id':_0x1a11e2[_0x5cbd30][_0x506c('0x43')],'name':_0x1a11e2[_0x5cbd30]['UserId'],'accountcode':'','online':![]};}var _0x222a94={'id':_0x425b35['id'],'name':_0x425b35[_0x506c('0xf')],'internal':_0x425b35[_0x506c('0x44')],'online':Boolean(_0x425b35['online']),'paused':Boolean(_0x1a11e2[_0x5cbd30][_0x506c('0x38')])};if(_0x425b35['voiceStatus']==='talking')updateAgentVoiceStatus(_0x222a94,_0x1918fe,_0x42ccb2);if(_0x222a94[_0x506c('0x45')])_0x1918fe[_0x506c('0x46')]++;if(_0x222a94['busy'])_0x1918fe[_0x506c('0x3e')]++;if(_0x222a94['paused']&&!_0x222a94[_0x506c('0x3e')]&&!_0x222a94[_0x506c('0x39')])_0x1918fe[_0x506c('0x38')]++;_0x1918fe[_0x506c('0x47')][_0x506c('0x23')](_0x222a94);}return _0x1918fe;});}function getQueueAgents(_0x3a1115,_0xfe9675,_0xda8269){var _0x2ca7db='User'+_[_0x506c('0x1a')](_0xda8269)+_0x506c('0x48');var _0x39cc9a=_0xda8269+_0x506c('0x49');return db[_0x2ca7db][_0x506c('0x4a')]({'where':{[_['startCase'](_0xda8269)+_0x506c('0x4b')]:_0x3a1115['id']},'raw':!![]})[_0x506c('0x13')](function(_0x22b6aa){for(var _0xedd9b9=0x0;_0xedd9b9<_0x22b6aa['length'];_0xedd9b9++){var _0x186242=_[_0x506c('0x41')](_0xfe9675,['id',_0x22b6aa[_0xedd9b9][_0x506c('0x43')]]);if(!_0x186242){_0x186242={'id':_0x22b6aa[_0xedd9b9]['UserId'],'name':_0x22b6aa[_0xedd9b9][_0x506c('0x43')],'online':![],['pauseField']:![]};}var _0x337ef2={'id':_0x186242['id'],'name':_0x186242[_0x506c('0xf')],'online':Boolean(_0x186242['online']),'paused':Boolean(_0x186242[_0x39cc9a])};if(_0x337ef2['online'])_0x3a1115['loggedInDb']++;_0x3a1115['agents'][_0x506c('0x23')](_0x337ef2);}return _0x3a1115;});}function isIdle(_0x4b4730){return _0x4b4730===_0x506c('0x4c')||_0x4b4730==='unknown'||_0x4b4730===_0x506c('0x4d')||_0x4b4730===_0x506c('0x4e')||_[_0x506c('0x4f')](_0x4b4730);}function isAgentPaused(_0x50c7cb,_0x586808){var _0x27c1a3=[_0x50c7cb['chatPause'],_0x50c7cb[_0x506c('0x50')],_0x50c7cb[_0x506c('0x51')],_0x50c7cb[_0x506c('0x52')],_0x50c7cb['smsPause'],_0x50c7cb['voicePause'],_0x50c7cb[_0x506c('0x53')]];if(!_0x586808)return _[_0x506c('0x54')](_0x27c1a3);var _0x17b032=_['filter'](_0x27c1a3);return _0x17b032[_0x506c('0x3d')]>0x0&&_0x17b032[_0x506c('0x3d')]<_0x27c1a3[_0x506c('0x3d')]?!![]:![];}function isAgentIdle(_0x4966b3){if(_0x4966b3[_0x506c('0x55')]!=='idle'&&_0x4966b3[_0x506c('0x56')]){_0x4966b3[_0x506c('0x55')]=_0x506c('0x57');return![];}return _['every']([_0x4966b3[_0x506c('0x58')],_0x4966b3[_0x506c('0x59')],_0x4966b3[_0x506c('0x5a')],_0x4966b3['openchannelStatus'],_0x4966b3[_0x506c('0x5b')],_0x4966b3[_0x506c('0x55')],_0x4966b3[_0x506c('0x5c')]],isIdle);}function getAgentStatus(_0x1d5ad9){var _0x12b463=_0x506c('0x5d');if(isAgentPaused(_0x1d5ad9))_0x12b463=_0x506c('0x57');else if(isAgentPaused(_0x1d5ad9,!![]))_0x12b463=_0x506c('0x5e');else if(isAgentIdle(_0x1d5ad9))_0x12b463=_0x506c('0x4c');else _0x12b463=_0x506c('0x3e');return _0x12b463;}exports[_0x506c('0x5f')]=function(_0x500232,_0x2612ef){var _0x211619={'count':0x0,'rows':[]},_0x2c4041={},_0x2a50ec,_0x37bcb1,_0x46ff8a=['userpic',_0x506c('0x45'),_0x506c('0x60'),_0x506c('0x61'),_0x506c('0x62'),_0x506c('0x61'),_0x506c('0x40'),_0x506c('0x63'),'chatPause',_0x506c('0x52'),_0x506c('0x51'),'smsPause','whatsappPause',_0x506c('0x50'),_0x506c('0x56'),_0x506c('0x64'),'openchannelCapacity','mailCapacity',_0x506c('0x65'),_0x506c('0x66'),_0x506c('0x67'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x506c('0x68'),_0x506c('0x69'),_0x506c('0x6a'),_0x506c('0x6b'),_0x506c('0x58'),_0x506c('0x6c'),_0x506c('0x5a'),_0x506c('0x5b'),_0x506c('0x5c'),'faxStatus',_0x506c('0x55'),_0x506c('0x6d'),_0x506c('0x6e'),_0x506c('0x6f'),_0x506c('0x70'),_0x506c('0x71'),_0x506c('0x72'),_0x506c('0x73'),_0x506c('0x3c'),'destconnectedlinenum',_0x506c('0x74'),_0x506c('0x75'),'phoneBarEnableAutomaticScreenRecording',_0x506c('0x76')],_0x1dd338=[_0x506c('0x77'),'openchannelPause','mailPause',_0x506c('0x78'),'whatsappPause',_0x506c('0x50'),_0x506c('0x56'),'online'];Promise[_0x506c('0x79')]()[_0x506c('0x13')](function(){var _0x4a04e1=_[_0x506c('0x36')](db[_0x506c('0x7a')][_0x506c('0x7b')],function(_0x58d3b){return{'name':_0x58d3b[_0x506c('0x7c')],'type':_0x58d3b[_0x506c('0x7d')][_0x506c('0x7e')]};});_0x500232[_0x506c('0x7f')]['role']=_0x506c('0x80');_0x500232[_0x506c('0x7f')][_0x506c('0x45')]=!![];_0x2c4041=qs[_0x506c('0x81')](_0x4a04e1,_0x500232);_0x2c4041['raw']=!![];if(_0x500232[_0x506c('0x82')][_0x506c('0x83')]===_0x506c('0x82')){var _0x5eb129={'params':{'id':_0x500232['user'][_0x506c('0x84')]},'query':{'section':_0x506c('0x12'),'role':_0x506c('0x80'),'online':!![],'nolimit':_0x500232[_0x506c('0x7f')][_0x506c('0x85')],'sort':_0x500232['query'][_0x506c('0x86')],'filter':_0x500232[_0x506c('0x7f')]['filter']},'raw':!![]};return db[_0x506c('0x87')]['getResources'](_0x5eb129);}return db[_0x506c('0x7a')][_0x506c('0x88')](_0x2c4041);})[_0x506c('0x13')](function(_0x14320b){_0x211619[_0x506c('0x9')]=_0x14320b[_0x506c('0x9')];_0x2a50ec=_0x14320b['rows'];return getRealtimeAgents();})[_0x506c('0x13')](function(_0x5d19d4){_0x37bcb1=_0x5d19d4[_0x506c('0x89')];return _0x2a50ec[_0x506c('0x36')](function(_0x556f9d){var _0x121cc6=_[_0x506c('0x41')](_0x37bcb1,['id',_0x556f9d['id']]);if(_0x121cc6)_[_0x506c('0x17')](_0x556f9d,_[_0x506c('0x3a')](_[_0x506c('0x8a')](_0x121cc6,_0x1dd338),_0x46ff8a));_0x556f9d['globalStatus']=getAgentStatus(_0x556f9d);return _0x556f9d;});})['then'](function(_0x88b9aa){if(_0x500232[_0x506c('0x7f')][_0x506c('0x8b')]){var _0x1b8eb4=_[_0x506c('0x3b')](_0x88b9aa,['globalStatus',_0x500232[_0x506c('0x7f')][_0x506c('0x8b')]]);if(_0x500232['query'][_0x506c('0x8c')]){_0x1b8eb4=_[_0x506c('0x3b')](_0x1b8eb4,['pauseType',_0x500232['query']['pauseTypeFilter']]);}}_0x211619[_0x506c('0x89')]=_0x1b8eb4||_0x88b9aa;return _0x211619;})[_0x506c('0x13')](respondWithFilteredResult(_0x2612ef,_0x2c4041))['catch'](handleError(_0x2612ef,null));};exports[_0x506c('0x8d')]=function(_0x46c3b4,_0x2da73e){var _0x566ea0=[_0x506c('0x8e'),_0x506c('0x8f'),_0x506c('0x90'),'openchannel',_0x506c('0x91'),_0x506c('0x92'),_0x506c('0x19')];var _0x96a586={'count':0x0,'rows':[]},_0x4957ef={},_0x2cc7ae,_0x4ac2ea,_0x467da5,_0x1dba25,_0x1da375;Promise['resolve']()[_0x506c('0x13')](function(){if(_0x46c3b4[_0x506c('0x7f')][_0x506c('0x93')]){if(!_['includes'](_0x566ea0,_0x46c3b4['query'][_0x506c('0x93')][_0x506c('0x94')]()))throw new Error(_0x506c('0x95'));_0x2cc7ae=_0x46c3b4['query']['channel'][_0x506c('0x94')]();}var _0xca2615=_[_0x506c('0x1a')](_0x2cc7ae)+_0x506c('0x48');var _0x195353=_[_0x506c('0x36')](db[_0xca2615][_0x506c('0x7b')],function(_0x69a64d){return{'name':_0x69a64d[_0x506c('0x7c')],'type':_0x69a64d['type'][_0x506c('0x7e')]};});_0x4957ef=qs[_0x506c('0x81')](_0x195353,_0x46c3b4);if(_0x46c3b4[_0x506c('0x82')][_0x506c('0x83')]===_0x506c('0x82')){var _0x5b6e41={'params':{'id':_0x46c3b4[_0x506c('0x82')][_0x506c('0x84')]},'query':{'section':_0x2cc7ae===_0x506c('0x19')&&_0x46c3b4[_0x506c('0x7f')][_0x506c('0x7d')]===_0x506c('0x22')?'QueueCampaigns':_[_0x506c('0x1a')](_0x2cc7ae)+'Queues','type':_0x46c3b4[_0x506c('0x7f')][_0x506c('0x7d')],'nolimit':!![],'sort':_0x506c('0xf'),'filter':_0x46c3b4[_0x506c('0x7f')][_0x506c('0x3b')]}};return db[_0x506c('0x87')]['getResources'](_0x5b6e41);}return db[_0xca2615][_0x506c('0x88')](_0x4957ef);})['then'](function(_0x12d4ea){_0x96a586[_0x506c('0x9')]=_0x12d4ea[_0x506c('0x9')];_0x4ac2ea=_0x12d4ea[_0x506c('0x89')];return getRealtimeQueues(_0x46c3b4,_0x2cc7ae);})[_0x506c('0x13')](function(_0x27b4ea){_0x1dba25=_0x27b4ea[_0x506c('0x89')];return getRealtimeAgents();})[_0x506c('0x13')](function(_0x408826){_0x467da5=_0x408826[_0x506c('0x89')];if(_0x2cc7ae!=_0x506c('0x19'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3f66e0){_0x1da375=_0x3f66e0?_0x3f66e0[_0x506c('0x89')]:[];return initializeQueues(_0x4ac2ea,_0x1dba25,_0x2cc7ae,_0x46c3b4[_0x506c('0x7f')][_0x506c('0x7d')]);})['then'](function(_0x2bc988){var _0x5a7011=_0x2bc988[_0x506c('0x36')](function(_0x25cc2d){if(_0x2cc7ae===_0x506c('0x19'))return getVoiceQueueAgents(_0x25cc2d,_0x4ac2ea,_0x467da5,_0x1da375);else return getQueueAgents(_0x25cc2d,_0x467da5,_0x2cc7ae);});return Promise[_0x506c('0x96')](_0x5a7011);})[_0x506c('0x13')](function(_0x4d2ca9){_0x96a586[_0x506c('0x89')]=_0x4d2ca9;return _0x96a586;})[_0x506c('0x13')](respondWithFilteredResult(_0x2da73e,_0x4957ef))['catch'](handleError(_0x2da73e,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2d76ceb..488a047 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4e7dbe,_0x54d66d){var _0x169ff7=function(_0x14ac59){while(--_0x14ac59){_0x4e7dbe['push'](_0x4e7dbe['shift']());}};_0x169ff7(++_0x54d66d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xb5234,_0x34c9fa){var _0x502c2f=function(_0x13f210){while(--_0x13f210){_0xb5234['push'](_0xb5234['shift']());}};_0x502c2f(++_0x34c9fa);}(_0x70e0,0x17b));var _0x070e=function(_0x4ff39f,_0x1a5bf7){_0x4ff39f=_0x4ff39f-0x0;var _0x1b1099=_0x70e0[_0x4ff39f];return _0x1b1099;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 849dabd..d9956ef 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe700=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x26f1cf,_0x3ed15f){var _0x6674e8=function(_0x1ed975){while(--_0x1ed975){_0x26f1cf['push'](_0x26f1cf['shift']());}};_0x6674e8(++_0x3ed15f);}(_0xe700,0x75));var _0x0e70=function(_0x51ee0b,_0x114040){_0x51ee0b=_0x51ee0b-0x0;var _0x368452=_0xe700[_0x51ee0b];return _0x368452;};'use strict';var Sequelize=require(_0x0e70('0x0'));module[_0x0e70('0x1')]={'state':{'type':Sequelize[_0x0e70('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0e70('0x3')]},'scheduledat':{'type':Sequelize[_0x0e70('0x4')]},'uniqueid':{'type':Sequelize[_0x0e70('0x3')]},'starttime':{'type':Sequelize[_0x0e70('0x4')]},'responsetime':{'type':Sequelize[_0x0e70('0x4')]},'ringtime':{'type':Sequelize[_0x0e70('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0e70('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0e70('0x3')]}}; \ No newline at end of file +var _0xfd6e=['DATE','STRING','sequelize','INTEGER'];(function(_0x6f8b69,_0x8e4086){var _0x4e32e8=function(_0x4c52aa){while(--_0x4c52aa){_0x6f8b69['push'](_0x6f8b69['shift']());}};_0x4e32e8(++_0x8e4086);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xefd6('0x0'));module['exports']={'state':{'type':Sequelize[_0xefd6('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xefd6('0x2')]},'uniqueid':{'type':Sequelize[_0xefd6('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xefd6('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 190b402..76c3c49 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9ec=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','util'];(function(_0x24c450,_0x29225f){var _0x1166cb=function(_0x2868c){while(--_0x2868c){_0x24c450['push'](_0x24c450['shift']());}};_0x1166cb(++_0x29225f);}(_0xf9ec,0x13e));var _0xcf9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9ec[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcf9e('0x0'));var logger=require(_0xcf9e('0x1'))('api');var moment=require(_0xcf9e('0x2'));var BPromise=require(_0xcf9e('0x3'));var rp=require(_0xcf9e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf9e('0x5'));var config=require(_0xcf9e('0x6'));var attributes=require(_0xcf9e('0x7'));module[_0xcf9e('0x8')]=function(_0x438af9,_0x15f446){return _0x438af9['define'](_0xcf9e('0x9'),attributes,{'tableName':_0xcf9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46b8=['ReportAgentPreview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x27f107,_0x4b1207){var _0xa364ed=function(_0xb514f7){while(--_0xb514f7){_0x27f107['push'](_0x27f107['shift']());}};_0xa364ed(++_0x4b1207);}(_0x46b8,0xaa));var _0x846b=function(_0x28c236,_0x5e4d4a){_0x28c236=_0x28c236-0x0;var _0x14647=_0x46b8[_0x28c236];return _0x14647;};'use strict';var _=require(_0x846b('0x0'));var util=require(_0x846b('0x1'));var logger=require(_0x846b('0x2'))(_0x846b('0x3'));var moment=require(_0x846b('0x4'));var BPromise=require(_0x846b('0x5'));var rp=require(_0x846b('0x6'));var fs=require('fs');var path=require(_0x846b('0x7'));var rimraf=require('rimraf');var config=require(_0x846b('0x8'));var attributes=require(_0x846b('0x9'));module[_0x846b('0xa')]=function(_0x299257,_0x510b52){return _0x299257[_0x846b('0xb')](_0x846b('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9621c29..d439369 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe071=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','options','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x172e7f,_0x563fd0){var _0x333891=function(_0x50a8b0){while(--_0x50a8b0){_0x172e7f['push'](_0x172e7f['shift']());}};_0x333891(++_0x563fd0);}(_0xe071,0xa4));var _0x1e07=function(_0x5cd253,_0x4162da){_0x5cd253=_0x5cd253-0x0;var _0x36e179=_0xe071[_0x5cd253];return _0x36e179;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e07('0x0'));var BPromise=require('bluebird');var rs=require(_0x1e07('0x1'));var fs=require('fs');var Redis=require(_0x1e07('0x2'));var db=require(_0x1e07('0x3'))['db'];var utils=require(_0x1e07('0x4'));var logger=require(_0x1e07('0x5'))('rpc');var config=require(_0x1e07('0x6'));var jayson=require(_0x1e07('0x7'));var client=jayson['client'][_0x1e07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x357790,_0x7cb599,_0x5271c7){return new BPromise(function(_0x1cac22,_0x250406){return client[_0x1e07('0x9')](_0x357790,_0x5271c7)[_0x1e07('0xa')](function(_0x2ee7ec){logger['info'](_0x1e07('0xb'),_0x7cb599,_0x1e07('0xc'));logger[_0x1e07('0xd')](_0x1e07('0xe'),_0x7cb599,_0x1e07('0xc'),JSON[_0x1e07('0xf')](_0x2ee7ec));if(_0x2ee7ec[_0x1e07('0x10')]){if(_0x2ee7ec[_0x1e07('0x10')][_0x1e07('0x11')]===0x1f4){logger['error'](_0x1e07('0xb'),_0x7cb599,_0x2ee7ec[_0x1e07('0x10')][_0x1e07('0x12')]);return _0x250406(_0x2ee7ec[_0x1e07('0x10')][_0x1e07('0x12')]);}logger[_0x1e07('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x7cb599,_0x2ee7ec[_0x1e07('0x10')]['message']);return _0x1cac22(_0x2ee7ec[_0x1e07('0x10')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x7cb599,_0x1e07('0xc'));_0x1cac22(_0x2ee7ec[_0x1e07('0x13')][_0x1e07('0x12')]);}})['catch'](function(_0x314e8b){logger[_0x1e07('0x10')](_0x1e07('0xb'),_0x7cb599,_0x314e8b);_0x250406(_0x314e8b);});});}exports[_0x1e07('0x14')]=function(_0x22937d){var _0xd58dfe=this;return new Promise(function(_0x375d4b,_0x4160a6){return db[_0x1e07('0x15')][_0x1e07('0x16')](_0x22937d['body'],{'raw':_0x22937d[_0x1e07('0x17')]?_0x22937d[_0x1e07('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x1e07('0xa')](function(_0x376375){logger['info'](_0x1e07('0x14'),_0x22937d);logger[_0x1e07('0xd')]('CreateReportAgentPreview',_0x22937d,JSON['stringify'](_0x376375));_0x375d4b(_0x376375);})[_0x1e07('0x18')](function(_0x156cc5){logger[_0x1e07('0x10')](_0x1e07('0x14'),_0x156cc5[_0x1e07('0x12')],_0x22937d);_0x4160a6(_0xd58dfe[_0x1e07('0x10')](0x1f4,_0x156cc5[_0x1e07('0x12')]));});});}; \ No newline at end of file +var _0xfc75=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xfc75,0x156));var _0x5fc7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfc75[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5fc7('0x0'));var util=require(_0x5fc7('0x1'));var moment=require(_0x5fc7('0x2'));var BPromise=require(_0x5fc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fc7('0x4'));var db=require(_0x5fc7('0x5'))['db'];var utils=require(_0x5fc7('0x6'));var logger=require('../../config/logger')(_0x5fc7('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fc7('0x8'));var client=jayson[_0x5fc7('0x9')][_0x5fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c351c,_0x8d10bb,_0x52f6a0){return new BPromise(function(_0xa9f974,_0x2538ae){return client[_0x5fc7('0xb')](_0x1c351c,_0x52f6a0)[_0x5fc7('0xc')](function(_0x3d9d91){logger[_0x5fc7('0xd')](_0x5fc7('0xe'),_0x8d10bb,_0x5fc7('0xf'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x8d10bb,_0x5fc7('0xf'),JSON[_0x5fc7('0x10')](_0x3d9d91));if(_0x3d9d91[_0x5fc7('0x11')]){if(_0x3d9d91[_0x5fc7('0x11')][_0x5fc7('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x8d10bb,_0x3d9d91[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0x2538ae(_0x3d9d91[_0x5fc7('0x11')][_0x5fc7('0x13')]);}logger[_0x5fc7('0x11')](_0x5fc7('0xe'),_0x8d10bb,_0x3d9d91[_0x5fc7('0x11')][_0x5fc7('0x13')]);return _0xa9f974(_0x3d9d91['error'][_0x5fc7('0x13')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x8d10bb,_0x5fc7('0xf'));_0xa9f974(_0x3d9d91[_0x5fc7('0x14')][_0x5fc7('0x13')]);}})[_0x5fc7('0x15')](function(_0x21b26b){logger[_0x5fc7('0x11')](_0x5fc7('0xe'),_0x8d10bb,_0x21b26b);_0x2538ae(_0x21b26b);});});}exports[_0x5fc7('0x16')]=function(_0xae457f){var _0x1665d8=this;return new Promise(function(_0x342b18,_0x22ca56){return db[_0x5fc7('0x17')][_0x5fc7('0x18')](_0xae457f[_0x5fc7('0x19')],{'raw':_0xae457f['options']?_0xae457f[_0x5fc7('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x5fc7('0xc')](function(_0x51125a){logger[_0x5fc7('0xd')](_0x5fc7('0x16'),_0xae457f);logger[_0x5fc7('0x1b')]('CreateReportAgentPreview',_0xae457f,JSON[_0x5fc7('0x10')](_0x51125a));_0x342b18(_0x51125a);})[_0x5fc7('0x15')](function(_0x2d3b85){logger['error'](_0x5fc7('0x16'),_0x2d3b85['message'],_0xae457f);_0x22ca56(_0x1665d8[_0x5fc7('0x11')](0x1f4,_0x2d3b85[_0x5fc7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index dcd7b1e..c0a4523 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fac=['/mail/queues/:id/notify','mail','showMailQueues','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','queueNotify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post'];(function(_0x4f83c1,_0x597d42){var _0x4c4033=function(_0x114ba1){while(--_0x114ba1){_0x4f83c1['push'](_0x4f83c1['shift']());}};_0x4c4033(++_0x597d42);}(_0x8fac,0x70));var _0xc8fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8fac[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xc8fa('0x0'));var util=require('util');var path=require(_0xc8fa('0x1'));var express=require(_0xc8fa('0x2'));var router=express[_0xc8fa('0x3')]();var auth=require(_0xc8fa('0x4'));var controller=require(_0xc8fa('0x5'));router[_0xc8fa('0x6')]('/voice/channels',auth[_0xc8fa('0x7')](),controller['voiceChannels']);router[_0xc8fa('0x6')](_0xc8fa('0x8'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x9')]);router[_0xc8fa('0x6')](_0xc8fa('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xc8fa('0x6')](_0xc8fa('0xb'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0xc')]);router[_0xc8fa('0x6')](_0xc8fa('0xd'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0xe')]);router['get'](_0xc8fa('0xf'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x10')]);router[_0xc8fa('0x6')](_0xc8fa('0x11'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x12')]);router[_0xc8fa('0x6')](_0xc8fa('0x13'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x14')]);router[_0xc8fa('0x6')](_0xc8fa('0x15'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x16')]);router[_0xc8fa('0x6')](_0xc8fa('0x17'),auth['isAuthenticated'](),controller[_0xc8fa('0x18')]);router[_0xc8fa('0x6')](_0xc8fa('0x19'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x1a')]);router[_0xc8fa('0x6')](_0xc8fa('0x1b'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x1c')]);router[_0xc8fa('0x6')](_0xc8fa('0x1d'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x1e')]);router[_0xc8fa('0x6')]('/voice/queues/channels/:uniqueid',auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x1f')]);router['get'](_0xc8fa('0x20'),auth['isAuthenticated'](),controller[_0xc8fa('0x21')]);router[_0xc8fa('0x6')](_0xc8fa('0x22'),auth['isAuthenticated'](),controller[_0xc8fa('0x23')]);router[_0xc8fa('0x6')]('/voice/queues/:id',auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x24')]);router[_0xc8fa('0x25')](_0xc8fa('0x26'),auth[_0xc8fa('0x7')](),controller['updateVoiceQueue']);router[_0xc8fa('0x6')](_0xc8fa('0x27'),auth['isAuthenticated'](),controller[_0xc8fa('0x28')]);router[_0xc8fa('0x6')](_0xc8fa('0x29'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x2a')]);router[_0xc8fa('0x6')](_0xc8fa('0x2b'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x2c')]);router[_0xc8fa('0x25')](_0xc8fa('0x2d'),auth[_0xc8fa('0x7')](),controller['agentCapacity']);router[_0xc8fa('0x6')](_0xc8fa('0x2e'),auth['isAuthenticated'](),controller['telephones']);router['get'](_0xc8fa('0x2f'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x30')]);router[_0xc8fa('0x6')](_0xc8fa('0x31'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x32')]);router[_0xc8fa('0x6')](_0xc8fa('0x33'),auth['isAuthenticated'](),controller[_0xc8fa('0x34')]);router[_0xc8fa('0x6')](_0xc8fa('0x35'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x36')]);router[_0xc8fa('0x6')](_0xc8fa('0x37'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x38')]);router['get'](_0xc8fa('0x39'),auth['isAuthenticated'](),controller[_0xc8fa('0x3a')]);router[_0xc8fa('0x6')](_0xc8fa('0x3b'),auth[_0xc8fa('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xc8fa('0x6')](_0xc8fa('0x3c'),auth['isAuthenticated'](),controller[_0xc8fa('0x3d')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0xc8fa('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xc8fa('0x3e'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xc8fa('0x3f')](_0xc8fa('0x40'),auth[_0xc8fa('0x7')](),controller['queueNotify'](_0xc8fa('0x41')));router[_0xc8fa('0x6')]('/mail/queues/:id',auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x42')]);router[_0xc8fa('0x3f')]('/chat/queues/:id/notify',auth[_0xc8fa('0x7')](),controller['queueNotify'](_0xc8fa('0x43')));router[_0xc8fa('0x6')]('/chat/queues/:id',auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x44')]);router[_0xc8fa('0x3f')](_0xc8fa('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0xc8fa('0x46')));router[_0xc8fa('0x6')](_0xc8fa('0x47'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x48')]);router[_0xc8fa('0x3f')](_0xc8fa('0x49'),auth[_0xc8fa('0x7')](),controller['queueNotify'](_0xc8fa('0x4a')));router[_0xc8fa('0x6')](_0xc8fa('0x4b'),auth['isAuthenticated'](),controller[_0xc8fa('0x4c')]);router[_0xc8fa('0x3f')](_0xc8fa('0x4d'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x4e')](_0xc8fa('0x4f')));router['post'](_0xc8fa('0x50'),auth[_0xc8fa('0x7')](),controller['queueNotify'](_0xc8fa('0x51')));router['get'](_0xc8fa('0x52'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x53')]);router[_0xc8fa('0x6')](_0xc8fa('0x54'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0xc8fa('0x3f')](_0xc8fa('0x55'),auth[_0xc8fa('0x7')](),controller[_0xc8fa('0x56')]);module[_0xc8fa('0x57')]=router; \ No newline at end of file +var _0xedea=['/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','agentNotify','multer','util','express','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x23406c,_0x54e196){var _0x193003=function(_0x3c0d59){while(--_0x3c0d59){_0x23406c['push'](_0x23406c['shift']());}};_0x193003(++_0x54e196);}(_0xedea,0x1c9));var _0xaede=function(_0x2982de,_0x51eca6){_0x2982de=_0x2982de-0x0;var _0x3dd11a=_0xedea[_0x2982de];return _0x3dd11a;};'use strict';var multer=require(_0xaede('0x0'));var util=require(_0xaede('0x1'));var path=require('path');var express=require(_0xaede('0x2'));var router=express['Router']();var auth=require(_0xaede('0x3'));var controller=require('./rpc.controller');router[_0xaede('0x4')](_0xaede('0x5'),auth[_0xaede('0x6')](),controller['voiceChannels']);router[_0xaede('0x4')](_0xaede('0x7'),auth['isAuthenticated'](),controller[_0xaede('0x8')]);router[_0xaede('0x4')](_0xaede('0x9'),auth[_0xaede('0x6')](),controller[_0xaede('0xa')]);router[_0xaede('0x4')](_0xaede('0xb'),auth['isAuthenticated'](),controller[_0xaede('0xc')]);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0xaede('0xd')]);router['get'](_0xaede('0xe'),auth[_0xaede('0x6')](),controller[_0xaede('0xf')]);router[_0xaede('0x4')](_0xaede('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router['get'](_0xaede('0x11'),auth[_0xaede('0x6')](),controller['openchannelQueues']);router[_0xaede('0x4')](_0xaede('0x12'),auth[_0xaede('0x6')](),controller[_0xaede('0x13')]);router['get']('/whatsapp/queues',auth[_0xaede('0x6')](),controller['whatsappQueues']);router[_0xaede('0x4')](_0xaede('0x14'),auth[_0xaede('0x6')](),controller[_0xaede('0x15')]);router['get'](_0xaede('0x16'),auth[_0xaede('0x6')](),controller[_0xaede('0x17')]);router[_0xaede('0x4')](_0xaede('0x18'),auth[_0xaede('0x6')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0xaede('0x6')](),controller['voiceQueuesChannel']);router[_0xaede('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xaede('0x6')](),controller[_0xaede('0x19')]);router[_0xaede('0x4')](_0xaede('0x1a'),auth[_0xaede('0x6')](),controller[_0xaede('0x1b')]);router[_0xaede('0x4')]('/voice/queues/:id',auth[_0xaede('0x6')](),controller[_0xaede('0x1c')]);router[_0xaede('0x1d')](_0xaede('0x1e'),auth[_0xaede('0x6')](),controller[_0xaede('0x1f')]);router[_0xaede('0x4')](_0xaede('0x20'),auth[_0xaede('0x6')](),controller['outbound']);router[_0xaede('0x4')](_0xaede('0x21'),auth[_0xaede('0x6')](),controller[_0xaede('0x22')]);router[_0xaede('0x4')](_0xaede('0x23'),auth[_0xaede('0x6')](),controller[_0xaede('0x24')]);router[_0xaede('0x1d')](_0xaede('0x25'),auth[_0xaede('0x6')](),controller[_0xaede('0x26')]);router[_0xaede('0x4')](_0xaede('0x27'),auth[_0xaede('0x6')](),controller['telephones']);router[_0xaede('0x4')]('/trunks',auth[_0xaede('0x6')](),controller[_0xaede('0x28')]);router[_0xaede('0x4')](_0xaede('0x29'),auth[_0xaede('0x6')](),controller['campaigns']);router['get'](_0xaede('0x2a'),auth[_0xaede('0x6')](),controller[_0xaede('0x2b')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0xaede('0x4')](_0xaede('0x2c'),auth[_0xaede('0x6')](),controller[_0xaede('0x2d')]);router[_0xaede('0x4')](_0xaede('0x2e'),auth[_0xaede('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0xaede('0x4')](_0xaede('0x2f'),auth[_0xaede('0x6')](),controller[_0xaede('0x30')]);router['get'](_0xaede('0x31'),auth[_0xaede('0x6')](),controller[_0xaede('0x32')]);router[_0xaede('0x4')](_0xaede('0x33'),auth['isAuthenticated'](),controller[_0xaede('0x34')]);router[_0xaede('0x4')](_0xaede('0x35'),auth[_0xaede('0x6')](),controller[_0xaede('0x36')]);router[_0xaede('0x37')](_0xaede('0x38'),auth[_0xaede('0x6')](),controller[_0xaede('0x39')](_0xaede('0x3a')));router[_0xaede('0x4')](_0xaede('0x3b'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xaede('0x37')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0xaede('0x39')](_0xaede('0x3c')));router[_0xaede('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0xaede('0x6')](),controller[_0xaede('0x39')]('fax'));router[_0xaede('0x4')](_0xaede('0x3d'),auth[_0xaede('0x6')](),controller[_0xaede('0x3e')]);router['post']('/openchannel/queues/:id/notify',auth[_0xaede('0x6')](),controller[_0xaede('0x39')](_0xaede('0x3f')));router[_0xaede('0x4')](_0xaede('0x40'),auth['isAuthenticated'](),controller[_0xaede('0x41')]);router[_0xaede('0x37')](_0xaede('0x42'),auth[_0xaede('0x6')](),controller[_0xaede('0x39')](_0xaede('0x43')));router[_0xaede('0x37')](_0xaede('0x44'),auth[_0xaede('0x6')](),controller['queueNotify'](_0xaede('0x45')));router[_0xaede('0x4')](_0xaede('0x46'),auth[_0xaede('0x6')](),controller['showSmsQueues']);router[_0xaede('0x4')]('/whatsapp/queues/:id',auth[_0xaede('0x6')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth['isAuthenticated'](),controller[_0xaede('0x47')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5653381..d795b89 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['VoiceQueuesChannelHangup','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','From','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0x4f417e,_0x21d1fb){var _0x477b05=function(_0x3bffbe){while(--_0x3bffbe){_0x4f417e['push'](_0x4f417e['shift']());}};_0x477b05(++_0x21d1fb);}(_0x326f,0xd1));var _0xf326=function(_0x462713,_0x2c36dc){_0x462713=_0x462713-0x0;var _0x19b2cd=_0x326f[_0x462713];return _0x19b2cd;};'use strict';var BPromise=require(_0xf326('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xf326('0x1'));var db=require(_0xf326('0x2'))['db'];var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var jayson=require(_0xf326('0x5'));var amiClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232a});var mailClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232b});var routingClient=jayson[_0xf326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=_0x165f95?_0x165f95:amiClient;return _0x4c206c['request'](_0x3c254d,_0x3851eb)[_0xf326('0x8')](function(_0x1fc80e){if(_0x1fc80e[_0xf326('0x9')]){if(_0x1fc80e[_0xf326('0x9')][_0xf326('0xa')]===0x1f4){return _0x515bfa(_0x1fc80e['error'][_0xf326('0xb')]);}return _0x1e7b8a(_0x1fc80e['error'][_0xf326('0xb')]);}else{_0x1e7b8a(_0x1fc80e['result']);}})[_0xf326('0xc')](function(_0x518ab5){_0x515bfa(_0x518ab5);});});}function respondWithResult(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xc8;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0xd')](_0x9ed463)[_0xf326('0xe')](_0x4b3966);}return _0x3162f9[_0xf326('0xf')](0x194);};}function handleError(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0x1f4;return function(_0x45c1b6){logger['error'](_0x45c1b6['stack']);if(_0x45c1b6[_0xf326('0x10')]){delete _0x45c1b6[_0xf326('0x10')];}_0x17a098[_0xf326('0xd')](_0x5c8483)[_0xf326('0x11')](_0x45c1b6);};}function findById(_0x292f4b){return function(_0x287a2a){if(!_[_0xf326('0x12')](_0x292f4b)&&!_[_0xf326('0x12')](_0x287a2a)&&!_['isNil'](_0x287a2a[_0xf326('0x13')])){return _[_0xf326('0x14')](_0x287a2a[_0xf326('0x13')],function(_0x31ffb9){return _0x31ffb9['id']==_0x292f4b;});}return null;};}exports[_0xf326('0x15')]=function(_0x311af0,_0x4d3d41){return respondWithRpcPromise('VoiceChannels',_0x311af0['query'])[_0xf326('0x8')](respondWithResult(_0x4d3d41,null))[_0xf326('0xc')](handleError(_0x4d3d41,null));};exports['voiceChannelMixMonitor']=function(_0x4cabce,_0x128c68){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x4cabce[_0xf326('0x16')],_0x4cabce[_0xf326('0x17')]))['then'](respondWithResult(_0x128c68,null))['catch'](handleError(_0x128c68,null));};exports[_0xf326('0x18')]=function(_0xb1efcf,_0x5f21a2){return respondWithRpcPromise(_0xf326('0x19'),_[_0xf326('0x1a')](_0xb1efcf[_0xf326('0x16')],_0xb1efcf[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5f21a2,null))[_0xf326('0xc')](handleError(_0x5f21a2,null));};exports['voiceQueues']=function(_0x55b9f4,_0x4f31f6){return respondWithRpcPromise(_0xf326('0x1b'),_0x55b9f4[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4f31f6,null))[_0xf326('0xc')](handleError(_0x4f31f6,null));};exports[_0xf326('0x1c')]=function(_0x410237,_0x5217d4){return respondWithRpcPromise(_0xf326('0x1b'),_0x410237[_0xf326('0x16')])[_0xf326('0x8')](findById(_0x410237['params']['id']))[_0xf326('0x8')](respondWithResult(_0x5217d4,null))['catch'](handleError(_0x5217d4,null));};exports['updateVoiceQueue']=function(_0x6a8e89,_0x1ae23a){return respondWithRpcPromise(_0xf326('0x1d'),_['merge'](_0x6a8e89[_0xf326('0x1e')],_0x6a8e89[_0xf326('0x17')]))['then'](respondWithResult(_0x1ae23a,null))[_0xf326('0xc')](handleError(_0x1ae23a,null));};exports[_0xf326('0x1f')]=function(_0xd77aba,_0x18d110){return respondWithRpcPromise(_0xf326('0x20'),_[_0xf326('0x1a')](_0xd77aba[_0xf326('0x16')],_0xd77aba[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x18d110,null))[_0xf326('0xc')](handleError(_0x18d110,null));};exports['voiceQueuesChannels']=function(_0x1035ed,_0x424104){return respondWithRpcPromise(_0xf326('0x21'),_0x1035ed['query'])[_0xf326('0x8')](respondWithResult(_0x424104,null))[_0xf326('0xc')](handleError(_0x424104,null));};exports[_0xf326('0x22')]=function(_0x4df451,_0x5b101d){return respondWithRpcPromise(_0xf326('0x23'),_[_0xf326('0x1a')](_0x4df451[_0xf326('0x16')],_0x4df451[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5b101d,null))[_0xf326('0xc')](handleError(_0x5b101d,null));};exports[_0xf326('0x24')]=function(_0x2d5f20,_0x580374){return respondWithRpcPromise(_0xf326('0x25'),_[_0xf326('0x1a')](_0x2d5f20['query'],_0x2d5f20[_0xf326('0x17')]))['then'](respondWithResult(_0x580374,null))[_0xf326('0xc')](handleError(_0x580374,null));};exports['voiceQueuesChannelRedirect']=function(_0x51f147,_0xadb020){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xf326('0x1a')](_0x51f147['query'],_0x51f147[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0xadb020,null))[_0xf326('0xc')](handleError(_0xadb020,null));};exports['outbound']=function(_0x3dcc7e,_0x4095e6){return respondWithRpcPromise('Outbound',_0x3dcc7e[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4095e6,null))[_0xf326('0xc')](handleError(_0x4095e6,null));};exports[_0xf326('0x26')]=function(_0x51076c,_0x2c4416){return respondWithRpcPromise(_0xf326('0x27'),_0x51076c[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x2c4416,null))[_0xf326('0xc')](handleError(_0x2c4416,null));};exports['agents']=function(_0x3e830d,_0x1b7bf6){var _0x5cfb97;return respondWithRpcPromise('Agents',_0x3e830d[_0xf326('0x16')])['then'](function(_0x55dfa8){_0x5cfb97=_0x55dfa8;return respondWithRpcPromise(_0xf326('0x28'),_0x3e830d['query'],routingClient);})[_0xf326('0x8')](function(_0x37a95b){return _[_0xf326('0x1a')]({},_0x37a95b,_0x5cfb97);})[_0xf326('0x8')](respondWithResult(_0x1b7bf6,null))['catch'](handleError(_0x1b7bf6,null));};exports[_0xf326('0x29')]=function(_0x45d344,_0x347e7b){if(_0x45d344[_0xf326('0x1e')]&&_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]&&_0x45d344[_0xf326('0x2b')]&&_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]){for(var _0x1227d3 in _0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]){if(_0x45d344['body'][_0xf326('0x2a')][_0xf326('0x2c')](_0x1227d3)){db[_0xf326('0x2d')][_0xf326('0x2e')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]&&_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')]?{'$notIn':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]}:{'$ne':null}}})[_0xf326('0x8')](function(_0x55361f){var _0x505344=moment()[_0xf326('0x30')](_0xf326('0x31'));for(var _0x5ed62e=0x0,_0x4bd865=_0x55361f[_0xf326('0x2f')];_0x5ed62e<_0x4bd865;_0x5ed62e+=0x1){_0x55361f[_0x5ed62e][_0xf326('0x32')]({'exitAt':_0x505344});}});for(var _0x21c98e=0x0;_0x21c98e<_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')];_0x21c98e+=0x1){db[_0xf326('0x2d')][_0xf326('0x33')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':_0xf326('0x34'),'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e],'exitAt':null},'defaults':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'interface':_[_0xf326('0x12')](_0x45d344[_0xf326('0x2b')][_0xf326('0x35')])?util[_0xf326('0x30')]('SIP/%s',_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]):_0x45d344[_0xf326('0x2b')][_0xf326('0x35')],'type':'INTERACTION','enterAt':moment()[_0xf326('0x30')](_0xf326('0x31')),'role':_0xf326('0x36'),'internal':_0x45d344[_0xf326('0x2b')]['internal'],'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e]}});}}}}return respondWithRpcPromise(_0xf326('0x37'),{'id':_0x45d344[_0xf326('0x17')]['id'],'capacity':_0x45d344[_0xf326('0x1e')]['capacity']},routingClient)['then'](respondWithResult(_0x347e7b,null))[_0xf326('0xc')](handleError(_0x347e7b,null));};exports[_0xf326('0x38')]=function(_0x2ff126,_0x4cb25b){return respondWithRpcPromise(_0xf326('0x39'),_0x2ff126[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4cb25b,null))['catch'](handleError(_0x4cb25b,null));};exports['trunks']=function(_0x36ef89,_0x5b4832){return respondWithRpcPromise(_0xf326('0x3a'),_0x36ef89['query'])[_0xf326('0x8')](respondWithResult(_0x5b4832,null))[_0xf326('0xc')](handleError(_0x5b4832,null));};exports[_0xf326('0x3b')]=function(_0x25e091,_0x212594){return respondWithRpcPromise(_0xf326('0x3c'),_0x25e091[_0xf326('0x16')])['then'](respondWithResult(_0x212594,null))[_0xf326('0xc')](handleError(_0x212594,null));};exports[_0xf326('0x3d')]=function(_0x424d24,_0x4b0d8e){return respondWithRpcPromise(_0xf326('0x3e'),_0x424d24[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4b0d8e,null))[_0xf326('0xc')](handleError(_0x4b0d8e,null));};exports[_0xf326('0x3f')]=function(_0x58fcf0,_0x161fb3){return respondWithRpcPromise(_0xf326('0x3e'),_0x58fcf0[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x58fcf0['params']['id']))[_0xf326('0x8')](respondWithResult(_0x161fb3,null))[_0xf326('0xc')](handleError(_0x161fb3,null));};exports[_0xf326('0x40')]=function(_0x29e52e,_0x4d3b9e){return respondWithRpcPromise('MailQueues',_0x29e52e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4d3b9e,null))['catch'](handleError(_0x4d3b9e,null));};exports[_0xf326('0x41')]=function(_0x29de71,_0x316609){return respondWithRpcPromise(_0xf326('0x42'),_0x29de71['query'],routingClient)[_0xf326('0x8')](findById(_0x29de71['params']['id']))['then'](respondWithResult(_0x316609,null))[_0xf326('0xc')](handleError(_0x316609,null));};exports['mailAccounts']=function(_0x173760,_0x52fb95){return respondWithRpcPromise(_0xf326('0x43'),_0x173760['query'],mailClient)['then'](respondWithResult(_0x52fb95,null))[_0xf326('0xc')](handleError(_0x52fb95,null));};exports[_0xf326('0x44')]=function(_0x33b259,_0x5d0177){return respondWithRpcPromise(_0xf326('0x45'),_0x33b259['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5d0177,null))[_0xf326('0xc')](handleError(_0x5d0177,null));};exports[_0xf326('0x46')]=function(_0x217897,_0xbd3a01){return respondWithRpcPromise(_0xf326('0x45'),_0x217897[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x217897[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0xbd3a01,null))[_0xf326('0xc')](handleError(_0xbd3a01,null));};exports[_0xf326('0x47')]=function(_0x40f7cb,_0x4ca1b8){return respondWithRpcPromise(_0xf326('0x48'),_0x40f7cb['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x4ca1b8,null))[_0xf326('0xc')](handleError(_0x4ca1b8,null));};exports['showSmsQueues']=function(_0x2b770c,_0x5283da){return respondWithRpcPromise(_0xf326('0x48'),_0x2b770c[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x2b770c[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x5283da,null))['catch'](handleError(_0x5283da,null));};exports['whatsappQueues']=function(_0x1209ca,_0x32fe3a){return respondWithRpcPromise(_0xf326('0x49'),_0x1209ca[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x32fe3a,null))['catch'](handleError(_0x32fe3a,null));};exports[_0xf326('0x4a')]=function(_0x471da8,_0x4aadc9){return respondWithRpcPromise('WhatsappQueues',_0x471da8['query'],routingClient)[_0xf326('0x8')](findById(_0x471da8[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x4aadc9,null))[_0xf326('0xc')](handleError(_0x4aadc9,null));};exports[_0xf326('0x4b')]=function(_0x23a56e,_0x230aea){return respondWithRpcPromise('FaxQueues',_0x23a56e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x230aea,null))[_0xf326('0xc')](handleError(_0x230aea,null));};exports[_0xf326('0x4c')]=function(_0x58de1e,_0x3717fe){return respondWithRpcPromise('FaxQueues',_0x58de1e['query'],routingClient)[_0xf326('0x8')](findById(_0x58de1e['params']['id']))[_0xf326('0x8')](respondWithResult(_0x3717fe,null))[_0xf326('0xc')](handleError(_0x3717fe,null));};exports[_0xf326('0x4d')]=function(_0x2ea5a2,_0x17cd36){return respondWithRpcPromise('FaxAccounts',_0x2ea5a2['query'])['then'](respondWithResult(_0x17cd36,null))[_0xf326('0xc')](handleError(_0x17cd36,null));};exports[_0xf326('0x4e')]=function(_0x229a34,_0x180616){return respondWithRpcPromise(_0xf326('0x4f'),_0x229a34['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x180616,null))[_0xf326('0xc')](handleError(_0x180616,null));};exports[_0xf326('0x50')]=function(_0x4f9a6a,_0x567492){return respondWithRpcPromise(_0xf326('0x51'),_0x4f9a6a[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x567492,null))['catch'](handleError(_0x567492,null));};exports[_0xf326('0x52')]=function(_0x5ba28d,_0xc3a897){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ba28d['query'],routingClient)['then'](respondWithResult(_0xc3a897,null))[_0xf326('0xc')](handleError(_0xc3a897,null));};exports[_0xf326('0x53')]=function(_0xd44071,_0x4838d5){return respondWithRpcPromise(_0xf326('0x54'),_0xd44071[_0xf326('0x16')],routingClient)[_0xf326('0x8')](function(_0x457f3d){if(_0xd44071[_0xf326('0x16')][_0xf326('0x55')]!==undefined){var _0x7f6d0e=_(_0x457f3d[_0xf326('0x13')])[_0xf326('0x56')]([_0xd44071['query'][_0xf326('0x55')],_0xd44071['params']['id']])[_0xf326('0x57')](_0xf326('0x58'))[_0xf326('0x59')]()['value']();return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x39c90d){return _0x7f6d0e['indexOf'](_0x39c90d[_0xf326('0x58')])>-0x1;});}else{return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x42c7cf){return _0x42c7cf['queue_id']===parseInt(_0xd44071[_0xf326('0x17')]['id']);});}})['then'](respondWithResult(_0x4838d5,null))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x5a')]=function(_0x2c36d3,_0x5af6b7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c36d3['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5af6b7,null))['catch'](handleError(_0x5af6b7,null));};exports[_0xf326('0x5b')]=function(_0x37a564,_0x3434b2){return respondWithRpcPromise(_0xf326('0x5c'),_0x37a564[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x3434b2,null))['catch'](handleError(_0x3434b2,null));};exports[_0xf326('0x5d')]=function(_0x323926,_0x5f1724){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x323926[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x5f1724,null))[_0xf326('0xc')](handleError(_0x5f1724,null));};exports[_0xf326('0x5e')]=function(_0x153027){return function(_0x363e64,_0x19d676){var _0x6e662,_0x293600;var _0x8ca46f=_[_0xf326('0x5f')](_0x153027);var _0x499cbd=_0x153027===_0xf326('0x60')?_0xf326('0x61'):'Account';return db[_0x8ca46f+_0xf326('0x62')]['findOne']({'raw':!![],'where':{'id':_0x363e64[_0xf326('0x17')]['id']}})[_0xf326('0x8')](function(_0x14e8c0){if(_['isNil'](_0x14e8c0)){throw new Error(_0x8ca46f+_0xf326('0x63'));}_0x6e662=_0x14e8c0;return db[_0x8ca46f+_0xf326('0x64')][_0xf326('0x65')]({'where':{'id':_0x363e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x8ca46f+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x8ca46f+_0x499cbd],'as':_0xf326('0x68')}]});})[_0xf326('0x8')](function(_0x38b696){if(_[_0xf326('0x12')](_0x38b696)){throw new Error(_0x8ca46f+_0xf326('0x69'));}_0x293600=_0x38b696;return _0x38b696[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x1f990d={'uniqueid':_0x153027+'.'+_0x293600['id']+'.'+_0x293600['Interaction']['id'],'FromUserId':_0x363e64[_0xf326('0x2b')]['id'],'type':_0xf326('0x6b')};_0x1f990d[_0x8ca46f+'MessageId']=_0x293600['id'];_0x1f990d[_0x8ca46f+_0xf326('0x6c')]=_0x293600[_0xf326('0x67')]['id'];_0x1f990d['From'+_0x8ca46f+_0x499cbd+'Id']=_0x293600[_0xf326('0x68')]['id'];_0x1f990d['To'+_0x8ca46f+_0xf326('0x6d')]=_0x6e662['id'];return db[_0x8ca46f+_0xf326('0x6e')][_0xf326('0x6f')](_0x1f990d);})[_0xf326('0x8')](function(){return respondWithRpcPromise(_0xf326('0x70'),{'channel':_0x153027,'interaction':_0x293600[_0xf326('0x67')],'message':_0x293600,'account':_0x293600['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x6b'),'appdata':_0x6e662[_0xf326('0x10')]+','+(_0x293600[_0xf326('0x68')][_0xf326('0x71')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0x19d676,null))[_0xf326('0xc')](handleError(_0x19d676,null));};};exports[_0xf326('0x73')]=function(_0x486e64,_0xa8e05b){var _0x2e2103,_0x49c3da;if(_[_0xf326('0x12')](_0x486e64['body'][_0xf326('0x74')])){throw new Error(_0xf326('0x75'));}var _0x16bc97=_0x486e64[_0xf326('0x1e')][_0xf326('0x74')];var _0x3097cf=_[_0xf326('0x5f')](_0x16bc97);var _0x1eb29d=_0x16bc97===_0xf326('0x60')?_0xf326('0x61'):_0xf326('0x68');return db[_0xf326('0x76')][_0xf326('0x65')]({'raw':!![],'where':{'id':_0x486e64[_0xf326('0x17')]['id'],'role':'agent'}})[_0xf326('0x8')](function(_0xdb6e40){if(_[_0xf326('0x12')](_0xdb6e40)){throw new Error(_0xf326('0x77'));}_0x2e2103=_0xdb6e40;return db[_0x3097cf+_0xf326('0x64')]['findOne']({'where':{'id':_0x486e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x3097cf+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x3097cf+_0x1eb29d],'as':_0xf326('0x68')}]});})['then'](function(_0x4b6ec0){if(_[_0xf326('0x12')](_0x4b6ec0)){throw new Error(_0x3097cf+'\x20Message\x20not\x20found');}_0x49c3da=_0x4b6ec0;return _0x4b6ec0[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x29610a={'uniqueid':_0x16bc97+'.'+_0x49c3da['id']+'.'+_0x49c3da['Interaction']['id'],'FromUserId':_0x486e64['user']['id'],'type':_0xf326('0x6b'),'ToUserId':_0x2e2103['id']};_0x29610a[_0x3097cf+_0xf326('0x78')]=_0x49c3da['id'];_0x29610a[_0x3097cf+_0xf326('0x6c')]=_0x49c3da[_0xf326('0x67')]['id'];_0x29610a[_0xf326('0x79')+_0x3097cf+_0x1eb29d+'Id']=_0x49c3da['Account']['id'];return db[_0x3097cf+_0xf326('0x6e')][_0xf326('0x6f')](_0x29610a);})[_0xf326('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x16bc97,'interaction':_0x49c3da['Interaction'],'message':_0x49c3da,'account':_0x49c3da['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x36'),'appdata':_0x2e2103[_0xf326('0x10')]+','+(_0x49c3da[_0xf326('0x68')][_0xf326('0x7a')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0xa8e05b,null))[_0xf326('0xc')](handleError(_0xa8e05b,null));}; \ No newline at end of file +var _0x5fd1=['findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise','client','http','then','error','message','result','catch','status','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes'];(function(_0x3855fd,_0x26003f){var _0x226a53=function(_0x14186f){while(--_0x14186f){_0x3855fd['push'](_0x3855fd['shift']());}};_0x226a53(++_0x26003f);}(_0x5fd1,0x155));var _0x15fd=function(_0x4d5035,_0xf75349){_0x4d5035=_0x4d5035-0x0;var _0xa9b9f2=_0x5fd1[_0x4d5035];return _0xa9b9f2;};'use strict';var BPromise=require(_0x15fd('0x0'));var moment=require('moment');var _=require(_0x15fd('0x1'));var util=require(_0x15fd('0x2'));var db=require(_0x15fd('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x15fd('0x4'));var amiClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x15fd('0x6')]({'port':0x232b});var routingClient=jayson[_0x15fd('0x5')][_0x15fd('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){var _0x19806f=_0x534e63?_0x534e63:amiClient;return _0x19806f['request'](_0x2e88bf,_0x225728)[_0x15fd('0x7')](function(_0x5c9c63){if(_0x5c9c63[_0x15fd('0x8')]){if(_0x5c9c63[_0x15fd('0x8')]['code']===0x1f4){return _0x1ee117(_0x5c9c63['error']['message']);}return _0x210e90(_0x5c9c63[_0x15fd('0x8')][_0x15fd('0x9')]);}else{_0x210e90(_0x5c9c63[_0x15fd('0xa')]);}})[_0x15fd('0xb')](function(_0x311138){_0x1ee117(_0x311138);});});}function respondWithResult(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xc8;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0xc')](_0x346ab1)['json'](_0x2660db);}return _0x2e18ec['sendStatus'](0x194);};}function handleError(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0x1f4;return function(_0x135a15){logger[_0x15fd('0x8')](_0x135a15[_0x15fd('0xd')]);if(_0x135a15[_0x15fd('0xe')]){delete _0x135a15[_0x15fd('0xe')];}_0x5784a3[_0x15fd('0xc')](_0x3fda60)[_0x15fd('0xf')](_0x135a15);};}function findById(_0x5aae13){return function(_0x4c7080){if(!_[_0x15fd('0x10')](_0x5aae13)&&!_['isNil'](_0x4c7080)&&!_[_0x15fd('0x10')](_0x4c7080['rows'])){return _[_0x15fd('0x11')](_0x4c7080[_0x15fd('0x12')],function(_0x855bae){return _0x855bae['id']==_0x5aae13;});}return null;};}exports['voiceChannels']=function(_0x367c36,_0x2ad0de){return respondWithRpcPromise(_0x15fd('0x13'),_0x367c36[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x2ad0de,null))[_0x15fd('0xb')](handleError(_0x2ad0de,null));};exports[_0x15fd('0x15')]=function(_0x2f46f1,_0x1b8b9f){return respondWithRpcPromise(_0x15fd('0x16'),_[_0x15fd('0x17')](_0x2f46f1['query'],_0x2f46f1['params']))[_0x15fd('0x7')](respondWithResult(_0x1b8b9f,null))[_0x15fd('0xb')](handleError(_0x1b8b9f,null));};exports[_0x15fd('0x18')]=function(_0x118a2b,_0x24bdaf){return respondWithRpcPromise(_0x15fd('0x19'),_[_0x15fd('0x17')](_0x118a2b['query'],_0x118a2b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x24bdaf,null))[_0x15fd('0xb')](handleError(_0x24bdaf,null));};exports['voiceQueues']=function(_0x27528f,_0x49062f){return respondWithRpcPromise(_0x15fd('0x1b'),_0x27528f[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x49062f,null))['catch'](handleError(_0x49062f,null));};exports[_0x15fd('0x1c')]=function(_0x1cbf2c,_0x24c541){return respondWithRpcPromise('VoiceQueues',_0x1cbf2c[_0x15fd('0x14')])['then'](findById(_0x1cbf2c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24c541,null))[_0x15fd('0xb')](handleError(_0x24c541,null));};exports[_0x15fd('0x1d')]=function(_0x233ed3,_0x6c213b){return respondWithRpcPromise(_0x15fd('0x1e'),_[_0x15fd('0x17')](_0x233ed3[_0x15fd('0x1f')],_0x233ed3[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x6c213b,null))['catch'](handleError(_0x6c213b,null));};exports[_0x15fd('0x20')]=function(_0x2fe61e,_0x50381a){return respondWithRpcPromise(_0x15fd('0x21'),_[_0x15fd('0x17')](_0x2fe61e['query'],_0x2fe61e[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x50381a,null))['catch'](handleError(_0x50381a,null));};exports[_0x15fd('0x22')]=function(_0x199647,_0x582af2){return respondWithRpcPromise(_0x15fd('0x23'),_0x199647[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x582af2,null))['catch'](handleError(_0x582af2,null));};exports[_0x15fd('0x24')]=function(_0x7ac52b,_0x4228ea){return respondWithRpcPromise(_0x15fd('0x25'),_['merge'](_0x7ac52b[_0x15fd('0x14')],_0x7ac52b[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4228ea,null))[_0x15fd('0xb')](handleError(_0x4228ea,null));};exports[_0x15fd('0x26')]=function(_0x296a0c,_0x4d9ff5){return respondWithRpcPromise(_0x15fd('0x27'),_[_0x15fd('0x17')](_0x296a0c['query'],_0x296a0c[_0x15fd('0x1a')]))[_0x15fd('0x7')](respondWithResult(_0x4d9ff5,null))[_0x15fd('0xb')](handleError(_0x4d9ff5,null));};exports['voiceQueuesChannelRedirect']=function(_0x25d34e,_0x309851){return respondWithRpcPromise(_0x15fd('0x28'),_[_0x15fd('0x17')](_0x25d34e[_0x15fd('0x14')],_0x25d34e[_0x15fd('0x1a')]))['then'](respondWithResult(_0x309851,null))['catch'](handleError(_0x309851,null));};exports['outbound']=function(_0x340d17,_0x289710){return respondWithRpcPromise(_0x15fd('0x29'),_0x340d17['query'])['then'](respondWithResult(_0x289710,null))[_0x15fd('0xb')](handleError(_0x289710,null));};exports['outboundChannels']=function(_0x4f1c84,_0x4c1aa8){return respondWithRpcPromise(_0x15fd('0x2a'),_0x4f1c84[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x4c1aa8,null))['catch'](handleError(_0x4c1aa8,null));};exports[_0x15fd('0x2b')]=function(_0x3a10e2,_0xd85d3e){var _0x5beb6e;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')])[_0x15fd('0x7')](function(_0xe18038){_0x5beb6e=_0xe18038;return respondWithRpcPromise(_0x15fd('0x2c'),_0x3a10e2[_0x15fd('0x14')],routingClient);})[_0x15fd('0x7')](function(_0x12a894){return _[_0x15fd('0x17')]({},_0x12a894,_0x5beb6e);})['then'](respondWithResult(_0xd85d3e,null))[_0x15fd('0xb')](handleError(_0xd85d3e,null));};exports[_0x15fd('0x2d')]=function(_0x180433,_0x304736){if(_0x180433[_0x15fd('0x1f')]&&_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]&&_0x180433[_0x15fd('0x2f')]&&_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')]){for(var _0x2eb6b6 in _0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]){if(_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')]['hasOwnProperty'](_0x2eb6b6)){db[_0x15fd('0x30')][_0x15fd('0x31')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'exitAt':null,'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6]&&_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]['length']?{'$notIn':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6]}:{'$ne':null}}})[_0x15fd('0x7')](function(_0x2741d4){var _0x5e4b62=moment()[_0x15fd('0x33')](_0x15fd('0x34'));for(var _0x131eb4=0x0,_0x2611ba=_0x2741d4[_0x15fd('0x35')];_0x131eb4<_0x2611ba;_0x131eb4+=0x1){_0x2741d4[_0x131eb4][_0x15fd('0x36')]({'exitAt':_0x5e4b62});}});for(var _0x494f83=0x0;_0x494f83<_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x15fd('0x35')];_0x494f83+=0x1){db[_0x15fd('0x30')][_0x15fd('0x37')]({'where':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'type':_0x15fd('0x32'),'uniqueid':_0x180433[_0x15fd('0x1f')][_0x15fd('0x2e')][_0x2eb6b6][_0x494f83],'exitAt':null},'defaults':{'channel':_0x2eb6b6,'membername':_0x180433[_0x15fd('0x2f')][_0x15fd('0xe')],'interface':_['isNil'](_0x180433[_0x15fd('0x2f')]['interface'])?util[_0x15fd('0x33')](_0x15fd('0x38'),_0x180433[_0x15fd('0x2f')]['name']):_0x180433[_0x15fd('0x2f')][_0x15fd('0x39')],'type':_0x15fd('0x32'),'enterAt':moment()[_0x15fd('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x15fd('0x3a'),'internal':_0x180433[_0x15fd('0x2f')][_0x15fd('0x3b')],'uniqueid':_0x180433[_0x15fd('0x1f')]['interaction'][_0x2eb6b6][_0x494f83]}});}}}}return respondWithRpcPromise(_0x15fd('0x3c'),{'id':_0x180433[_0x15fd('0x1a')]['id'],'capacity':_0x180433['body']['capacity']},routingClient)['then'](respondWithResult(_0x304736,null))[_0x15fd('0xb')](handleError(_0x304736,null));};exports[_0x15fd('0x3d')]=function(_0x366c49,_0x10cf04){return respondWithRpcPromise(_0x15fd('0x3e'),_0x366c49[_0x15fd('0x14')])['then'](respondWithResult(_0x10cf04,null))[_0x15fd('0xb')](handleError(_0x10cf04,null));};exports[_0x15fd('0x3f')]=function(_0xbb16ef,_0x516b25){return respondWithRpcPromise(_0x15fd('0x40'),_0xbb16ef['query'])[_0x15fd('0x7')](respondWithResult(_0x516b25,null))[_0x15fd('0xb')](handleError(_0x516b25,null));};exports[_0x15fd('0x41')]=function(_0x42d4de,_0x332df7){return respondWithRpcPromise(_0x15fd('0x42'),_0x42d4de[_0x15fd('0x14')])[_0x15fd('0x7')](respondWithResult(_0x332df7,null))[_0x15fd('0xb')](handleError(_0x332df7,null));};exports[_0x15fd('0x43')]=function(_0x1491a3,_0x36eaf7){return respondWithRpcPromise(_0x15fd('0x44'),_0x1491a3['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x36eaf7,null))['catch'](handleError(_0x36eaf7,null));};exports[_0x15fd('0x45')]=function(_0x509aef,_0x25bdea){return respondWithRpcPromise(_0x15fd('0x44'),_0x509aef[_0x15fd('0x14')],routingClient)['then'](findById(_0x509aef['params']['id']))[_0x15fd('0x7')](respondWithResult(_0x25bdea,null))[_0x15fd('0xb')](handleError(_0x25bdea,null));};exports[_0x15fd('0x46')]=function(_0x30ab06,_0x5d94b3){return respondWithRpcPromise(_0x15fd('0x47'),_0x30ab06[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5d94b3,null))[_0x15fd('0xb')](handleError(_0x5d94b3,null));};exports[_0x15fd('0x48')]=function(_0x321fe7,_0x59b3b4){return respondWithRpcPromise(_0x15fd('0x47'),_0x321fe7[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x321fe7[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x59b3b4,null))[_0x15fd('0xb')](handleError(_0x59b3b4,null));};exports['mailAccounts']=function(_0x4f2a17,_0x149b20){return respondWithRpcPromise(_0x15fd('0x49'),_0x4f2a17['query'],mailClient)[_0x15fd('0x7')](respondWithResult(_0x149b20,null))[_0x15fd('0xb')](handleError(_0x149b20,null));};exports['openchannelQueues']=function(_0x285fd5,_0x4626ac){return respondWithRpcPromise(_0x15fd('0x4a'),_0x285fd5['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x4626ac,null))[_0x15fd('0xb')](handleError(_0x4626ac,null));};exports[_0x15fd('0x4b')]=function(_0x2db860,_0xa206b){return respondWithRpcPromise(_0x15fd('0x4a'),_0x2db860[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x2db860[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0xa206b,null))['catch'](handleError(_0xa206b,null));};exports[_0x15fd('0x4c')]=function(_0x3a26c8,_0x5b720b){return respondWithRpcPromise('SmsQueues',_0x3a26c8[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x5b720b,null))[_0x15fd('0xb')](handleError(_0x5b720b,null));};exports[_0x15fd('0x4d')]=function(_0x12fd6c,_0x1b6f59){return respondWithRpcPromise('SmsQueues',_0x12fd6c[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x12fd6c[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x1b6f59,null))[_0x15fd('0xb')](handleError(_0x1b6f59,null));};exports[_0x15fd('0x4e')]=function(_0xf27ab4,_0x1fe6cb){return respondWithRpcPromise(_0x15fd('0x4f'),_0xf27ab4[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x1fe6cb,null))['catch'](handleError(_0x1fe6cb,null));};exports['showWhatsappQueues']=function(_0x8a8198,_0x24ea9b){return respondWithRpcPromise(_0x15fd('0x4f'),_0x8a8198[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x8a8198[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x24ea9b,null))['catch'](handleError(_0x24ea9b,null));};exports[_0x15fd('0x50')]=function(_0x5de222,_0xc8931e){return respondWithRpcPromise('FaxQueues',_0x5de222[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0xc8931e,null))[_0x15fd('0xb')](handleError(_0xc8931e,null));};exports[_0x15fd('0x51')]=function(_0x4390bc,_0x3d40f3){return respondWithRpcPromise(_0x15fd('0x52'),_0x4390bc[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](findById(_0x4390bc[_0x15fd('0x1a')]['id']))[_0x15fd('0x7')](respondWithResult(_0x3d40f3,null))['catch'](handleError(_0x3d40f3,null));};exports['faxAccounts']=function(_0x1ca245,_0x239a06){return respondWithRpcPromise(_0x15fd('0x53'),_0x1ca245['query'])[_0x15fd('0x7')](respondWithResult(_0x239a06,null))[_0x15fd('0xb')](handleError(_0x239a06,null));};exports[_0x15fd('0x54')]=function(_0x56cf8c,_0x3bf85b){return respondWithRpcPromise(_0x15fd('0x55'),_0x56cf8c['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bf85b,null))['catch'](handleError(_0x3bf85b,null));};exports[_0x15fd('0x56')]=function(_0x40a8e9,_0x74f311){return respondWithRpcPromise(_0x15fd('0x57'),_0x40a8e9[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x74f311,null))[_0x15fd('0xb')](handleError(_0x74f311,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x3c4ffa,_0x4a165f){return respondWithRpcPromise(_0x15fd('0x58'),_0x3c4ffa[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4a165f,null))[_0x15fd('0xb')](handleError(_0x4a165f,null));};exports[_0x15fd('0x59')]=function(_0x47f39a,_0x484cd1){return respondWithRpcPromise(_0x15fd('0x58'),_0x47f39a['query'],routingClient)[_0x15fd('0x7')](function(_0x2feba1){if(_0x47f39a[_0x15fd('0x14')][_0x15fd('0x5a')]!==undefined){var _0x2d1c93=_(_0x2feba1['rows'])[_0x15fd('0x5b')]([_0x47f39a[_0x15fd('0x14')]['type'],_0x47f39a[_0x15fd('0x1a')]['id']])[_0x15fd('0x5c')](_0x15fd('0x5d'))[_0x15fd('0x5e')]()[_0x15fd('0x5f')]();return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x39b777){return _0x2d1c93[_0x15fd('0x60')](_0x39b777[_0x15fd('0x5d')])>-0x1;});}else{return _0x2feba1[_0x15fd('0x12')][_0x15fd('0x5b')](function(_0x273311){return _0x273311[_0x15fd('0x5d')]===parseInt(_0x47f39a['params']['id']);});}})[_0x15fd('0x7')](respondWithResult(_0x484cd1,null))['catch'](handleError(_0x484cd1,null));};exports[_0x15fd('0x61')]=function(_0x43d0b0,_0x3bfa0b){return respondWithRpcPromise(_0x15fd('0x62'),_0x43d0b0['query'],routingClient)[_0x15fd('0x7')](respondWithResult(_0x3bfa0b,null))[_0x15fd('0xb')](handleError(_0x3bfa0b,null));};exports[_0x15fd('0x63')]=function(_0x873778,_0x4accfd){return respondWithRpcPromise(_0x15fd('0x64'),_0x873778[_0x15fd('0x14')],routingClient)['then'](respondWithResult(_0x4accfd,null))[_0x15fd('0xb')](handleError(_0x4accfd,null));};exports[_0x15fd('0x65')]=function(_0x128ee3,_0x57089a){return respondWithRpcPromise(_0x15fd('0x66'),_0x128ee3[_0x15fd('0x14')],routingClient)[_0x15fd('0x7')](respondWithResult(_0x57089a,null))[_0x15fd('0xb')](handleError(_0x57089a,null));};exports[_0x15fd('0x67')]=function(_0x2d24a2){return function(_0x4e36c0,_0x2b7737){var _0x15a645,_0x32a2a0;var _0x3bd3fb=_[_0x15fd('0x68')](_0x2d24a2);var _0x55e9dd=_0x2d24a2===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x3bd3fb+_0x15fd('0x6c')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x4e36c0['params']['id']}})['then'](function(_0x3017c6){if(_[_0x15fd('0x10')](_0x3017c6)){throw new Error(_0x3bd3fb+_0x15fd('0x6e'));}_0x15a645=_0x3017c6;return db[_0x3bd3fb+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x4e36c0[_0x15fd('0x1f')][_0x15fd('0x70')]},'include':[{'model':db[_0x3bd3fb+_0x15fd('0x71')],'as':_0x15fd('0x71')},{'model':db[_0x3bd3fb+_0x55e9dd],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x23d547){if(_['isNil'](_0x23d547)){throw new Error(_0x3bd3fb+_0x15fd('0x72'));}_0x32a2a0=_0x23d547;return _0x23d547[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x35ad47={'uniqueid':_0x2d24a2+'.'+_0x32a2a0['id']+'.'+_0x32a2a0['Interaction']['id'],'FromUserId':_0x4e36c0[_0x15fd('0x2f')]['id'],'type':_0x15fd('0x74')};_0x35ad47[_0x3bd3fb+'MessageId']=_0x32a2a0['id'];_0x35ad47[_0x3bd3fb+_0x15fd('0x75')]=_0x32a2a0[_0x15fd('0x71')]['id'];_0x35ad47[_0x15fd('0x76')+_0x3bd3fb+_0x55e9dd+'Id']=_0x32a2a0['Account']['id'];_0x35ad47['To'+_0x3bd3fb+_0x15fd('0x77')]=_0x15a645['id'];return db[_0x3bd3fb+_0x15fd('0x78')][_0x15fd('0x79')](_0x35ad47);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x2d24a2,'interaction':_0x32a2a0[_0x15fd('0x71')],'message':_0x32a2a0,'account':_0x32a2a0[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x74'),'appdata':_0x15a645['name']+','+(_0x32a2a0[_0x15fd('0x6b')][_0x15fd('0x7b')]||0x12c),'interval':_0x15fd('0x7c')}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x2b7737,null))[_0x15fd('0xb')](handleError(_0x2b7737,null));};};exports[_0x15fd('0x7d')]=function(_0x3ebb13,_0x939bfd){var _0x3a4731,_0x264a98;if(_[_0x15fd('0x10')](_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')])){throw new Error(_0x15fd('0x7f'));}var _0x4221df=_0x3ebb13[_0x15fd('0x1f')][_0x15fd('0x7e')];var _0x255dd5=_[_0x15fd('0x68')](_0x4221df);var _0x178dac=_0x4221df===_0x15fd('0x69')?_0x15fd('0x6a'):_0x15fd('0x6b');return db[_0x15fd('0x80')][_0x15fd('0x6d')]({'raw':!![],'where':{'id':_0x3ebb13[_0x15fd('0x1a')]['id'],'role':'agent'}})[_0x15fd('0x7')](function(_0x39e232){if(_['isNil'](_0x39e232)){throw new Error(_0x15fd('0x81'));}_0x3a4731=_0x39e232;return db[_0x255dd5+_0x15fd('0x6f')][_0x15fd('0x6d')]({'where':{'id':_0x3ebb13[_0x15fd('0x1f')]['messageId']},'include':[{'model':db[_0x255dd5+'Interaction'],'as':_0x15fd('0x71')},{'model':db[_0x255dd5+_0x178dac],'as':'Account'}]});})[_0x15fd('0x7')](function(_0x3e47fe){if(_[_0x15fd('0x10')](_0x3e47fe)){throw new Error(_0x255dd5+_0x15fd('0x72'));}_0x264a98=_0x3e47fe;return _0x3e47fe[_0x15fd('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x15fd('0x7')](function(){var _0x1bd38c={'uniqueid':_0x4221df+'.'+_0x264a98['id']+'.'+_0x264a98['Interaction']['id'],'FromUserId':_0x3ebb13['user']['id'],'type':_0x15fd('0x74'),'ToUserId':_0x3a4731['id']};_0x1bd38c[_0x255dd5+_0x15fd('0x82')]=_0x264a98['id'];_0x1bd38c[_0x255dd5+_0x15fd('0x75')]=_0x264a98[_0x15fd('0x71')]['id'];_0x1bd38c[_0x15fd('0x76')+_0x255dd5+_0x178dac+'Id']=_0x264a98[_0x15fd('0x6b')]['id'];return db[_0x255dd5+'TransferReport']['create'](_0x1bd38c);})[_0x15fd('0x7')](function(){return respondWithRpcPromise(_0x15fd('0x7a'),{'channel':_0x4221df,'interaction':_0x264a98[_0x15fd('0x71')],'message':_0x264a98,'account':_0x264a98[_0x15fd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x15fd('0x3a'),'appdata':_0x3a4731[_0x15fd('0xe')]+','+(_0x264a98['Account'][_0x15fd('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x15fd('0x7')](respondWithResult(_0x939bfd,null))[_0x15fd('0xb')](handleError(_0x939bfd,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 15bc94c..0cfca72 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x566c=['index','get','/:id','show','run','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x47c89e,_0x18692c){var _0x1de51e=function(_0x5a8b06){while(--_0x5a8b06){_0x47c89e['push'](_0x47c89e['shift']());}};_0x1de51e(++_0x18692c);}(_0x566c,0x115));var _0xc566=function(_0x5378ab,_0x4fcbe9){_0x5378ab=_0x5378ab-0x0;var _0x2be0f1=_0x566c[_0x5378ab];return _0x2be0f1;};'use strict';var multer=require('multer');var util=require(_0xc566('0x0'));var path=require(_0xc566('0x1'));var timeout=require(_0xc566('0x2'));var express=require(_0xc566('0x3'));var router=express['Router']();var fs_extra=require(_0xc566('0x4'));var auth=require(_0xc566('0x5'));var interaction=require(_0xc566('0x6'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0xc566('0x7')](),controller[_0xc566('0x8')]);router[_0xc566('0x9')](_0xc566('0xa'),auth[_0xc566('0x7')](),controller[_0xc566('0xb')]);router[_0xc566('0x9')]('/:id/run',auth[_0xc566('0x7')](),controller[_0xc566('0xc')]);router[_0xc566('0xd')]('/',auth[_0xc566('0x7')](),controller[_0xc566('0xe')]);router[_0xc566('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc566('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc566('0x11')]);module[_0xc566('0x12')]=router; \ No newline at end of file +var _0x7b23=['destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','create','put','update','delete'];(function(_0x348d21,_0xca66af){var _0xf66b76=function(_0x23b942){while(--_0x23b942){_0x348d21['push'](_0x348d21['shift']());}};_0xf66b76(++_0xca66af);}(_0x7b23,0xe9));var _0x37b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7b23[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x37b2('0x0'));var path=require(_0x37b2('0x1'));var timeout=require('connect-timeout');var express=require(_0x37b2('0x2'));var router=express['Router']();var fs_extra=require(_0x37b2('0x3'));var auth=require(_0x37b2('0x4'));var interaction=require(_0x37b2('0x5'));var config=require(_0x37b2('0x6'));var controller=require(_0x37b2('0x7'));router['get']('/',auth[_0x37b2('0x8')](),controller[_0x37b2('0x9')]);router[_0x37b2('0xa')](_0x37b2('0xb'),auth[_0x37b2('0x8')](),controller[_0x37b2('0xc')]);router['get'](_0x37b2('0xd'),auth[_0x37b2('0x8')](),controller[_0x37b2('0xe')]);router['post']('/',auth[_0x37b2('0x8')](),controller[_0x37b2('0xf')]);router[_0x37b2('0x10')](_0x37b2('0xb'),auth[_0x37b2('0x8')](),controller[_0x37b2('0x11')]);router[_0x37b2('0x12')](_0x37b2('0xb'),auth[_0x37b2('0x8')](),controller[_0x37b2('0x13')]);module[_0x37b2('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a19a706..7c3bb5f 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfc5=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','days','hours','minutes','csv','pdf','xlsx','custom','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xdfc5,0x110));var _0x5dfc=function(_0x5aa62c,_0x461b14){_0x5aa62c=_0x5aa62c-0x0;var _0x36ea4d=_0xdfc5[_0x5aa62c];return _0x36ea4d;};'use strict';var Sequelize=require('sequelize');module[_0x5dfc('0x0')]={'name':{'type':Sequelize[_0x5dfc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5dfc('0x1')]},'active':{'type':Sequelize[_0x5dfc('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5dfc('0x1')],'allowNull':![],'defaultValue':_0x5dfc('0x3')},'startAt':{'type':Sequelize[_0x5dfc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5dfc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5dfc('0x5')](_0x5dfc('0x6'),_0x5dfc('0x7'),_0x5dfc('0x8'),'weeks',_0x5dfc('0x9'),_0x5dfc('0xa'),_0x5dfc('0xb')),'allowNull':![],'defaultValue':_0x5dfc('0x9')},'output':{'type':Sequelize['ENUM'](_0x5dfc('0xc'),_0x5dfc('0xd'),_0x5dfc('0xe')),'allowNull':![],'defaultValue':_0x5dfc('0xc')},'type':{'type':Sequelize[_0x5dfc('0x5')](_0x5dfc('0xf'),'default'),'allowNull':![],'defaultValue':_0x5dfc('0xf')},'sendMail':{'type':Sequelize[_0x5dfc('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x5dfc('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb53c=['TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','hours','minutes','days','csv','pdf','custom','default'];(function(_0x2016ab,_0x527c6a){var _0x15f4ab=function(_0xb495f9){while(--_0xb495f9){_0x2016ab['push'](_0x2016ab['shift']());}};_0x15f4ab(++_0x527c6a);}(_0xb53c,0x100));var _0xcb53=function(_0x3323c7,_0x4fd7ab){_0x3323c7=_0x3323c7-0x0;var _0x500b7f=_0xb53c[_0x3323c7];return _0x500b7f;};'use strict';var Sequelize=require(_0xcb53('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcb53('0x1')]},'active':{'type':Sequelize[_0xcb53('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xcb53('0x1')],'allowNull':![],'defaultValue':_0xcb53('0x3')},'startAt':{'type':Sequelize[_0xcb53('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcb53('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcb53('0x6')](_0xcb53('0x7'),_0xcb53('0x8'),'months','weeks','days',_0xcb53('0x9'),_0xcb53('0xa')),'allowNull':![],'defaultValue':_0xcb53('0xb')},'output':{'type':Sequelize[_0xcb53('0x6')](_0xcb53('0xc'),_0xcb53('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xcb53('0xc')},'type':{'type':Sequelize[_0xcb53('0x6')](_0xcb53('0xe'),_0xcb53('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xcb53('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xcb53('0x1')]},'cc':{'type':Sequelize[_0xcb53('0x10')]},'bcc':{'type':Sequelize[_0xcb53('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 5847a39..0234417 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56df=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Schedule','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','run','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x3a88b8,_0x58ee44){var _0x4f434e=function(_0x550039){while(--_0x550039){_0x3a88b8['push'](_0x3a88b8['shift']());}};_0x4f434e(++_0x58ee44);}(_0x56df,0x136));var _0xf56d=function(_0x459670,_0x225617){_0x459670=_0x459670-0x0;var _0x4bdde8=_0x56df[_0x459670];return _0x4bdde8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf56d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf56d('0x1'));var rp=require(_0xf56d('0x2'));var moment=require(_0xf56d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf56d('0x4'));var util=require(_0xf56d('0x5'));var path=require(_0xf56d('0x6'));var sox=require('sox');var csv=require(_0xf56d('0x7'));var ejs=require(_0xf56d('0x8'));var fs=require('fs');var fs_extra=require(_0xf56d('0x9'));var _=require(_0xf56d('0xa'));var squel=require(_0xf56d('0xb'));var crypto=require(_0xf56d('0xc'));var jsforce=require(_0xf56d('0xd'));var deskjs=require(_0xf56d('0xe'));var toCsv=require(_0xf56d('0x7'));var querystring=require(_0xf56d('0xf'));var Papa=require(_0xf56d('0x10'));var Redis=require(_0xf56d('0x11'));var authService=require(_0xf56d('0x12'));var qs=require(_0xf56d('0x13'));var as=require(_0xf56d('0x14'));var hardwareService=require(_0xf56d('0x15'));var logger=require(_0xf56d('0x16'))(_0xf56d('0x17'));var utils=require(_0xf56d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf56d('0x19'))['db'];function respondWithStatusCode(_0x3f957a,_0x5d4d9a){_0x5d4d9a=_0x5d4d9a||0xcc;return function(_0x5a2093){if(_0x5a2093){return _0x3f957a['sendStatus'](_0x5d4d9a);}return _0x3f957a['status'](_0x5d4d9a)[_0xf56d('0x1a')]();};}function respondWithResult(_0x29d838,_0x1bc7f9){_0x1bc7f9=_0x1bc7f9||0xc8;return function(_0x2be534){if(_0x2be534){return _0x29d838[_0xf56d('0x1b')](_0x1bc7f9)['json'](_0x2be534);}};}function respondWithFilteredResult(_0x110704,_0x44b55c){return function(_0x1f5eae){if(_0x1f5eae){var _0x4940a3=typeof _0x44b55c[_0xf56d('0x1c')]===_0xf56d('0x1d')&&typeof _0x44b55c[_0xf56d('0x1e')]===_0xf56d('0x1d');var _0x3848f8=_0x1f5eae[_0xf56d('0x1f')];var _0x31cdd7=_0x4940a3?0x0:_0x44b55c['offset'];var _0x104389=_0x4940a3?_0x1f5eae['count']:_0x44b55c[_0xf56d('0x1c')]+_0x44b55c['limit'];var _0x240520;if(_0x104389>=_0x3848f8){_0x104389=_0x3848f8;_0x240520=0xc8;}else{_0x240520=0xce;}_0x110704[_0xf56d('0x1b')](_0x240520);return _0x110704[_0xf56d('0x20')](_0xf56d('0x21'),_0x31cdd7+'-'+_0x104389+'/'+_0x3848f8)[_0xf56d('0x22')](_0x1f5eae);}return null;};}function patchUpdates(_0x1e8ecc){return function(_0xd4778e){try{jsonpatch[_0xf56d('0x23')](_0xd4778e,_0x1e8ecc,!![]);}catch(_0x152022){return BPromise['reject'](_0x152022);}return _0xd4778e[_0xf56d('0x24')]();};}function saveUpdates(_0x4674ae,_0x4dc5b6){return function(_0x1db010){if(_0x1db010){return _0x1db010[_0xf56d('0x25')](_0x4674ae)[_0xf56d('0x26')](function(_0x1e6320){return _0x1e6320;});}return null;};}function removeEntity(_0x10d259,_0x38280f){return function(_0x419568){if(_0x419568){return _0x419568[_0xf56d('0x27')]()['then'](function(){var _0x33329f=_0x419568[_0xf56d('0x28')]({'plain':!![]});var _0x4365eb=_0xf56d('0x29');return db[_0xf56d('0x2a')]['destroy']({'where':{'type':_0x4365eb,'resourceId':_0x33329f['id']}})[_0xf56d('0x26')](function(){return _0x419568;});})[_0xf56d('0x26')](function(){_0x10d259[_0xf56d('0x1b')](0xcc)[_0xf56d('0x1a')]();});}};}function handleEntityNotFound(_0x300b8f,_0x302b88){return function(_0x294742){if(!_0x294742){_0x300b8f[_0xf56d('0x2b')](0x194);}return _0x294742;};}function handleError(_0x27bb67,_0x5f23fd){_0x5f23fd=_0x5f23fd||0x1f4;return function(_0x3dfbe1){logger[_0xf56d('0x2c')](_0x3dfbe1[_0xf56d('0x2d')]);if(_0x3dfbe1[_0xf56d('0x2e')]){delete _0x3dfbe1['name'];}_0x27bb67[_0xf56d('0x1b')](_0x5f23fd)[_0xf56d('0x2f')](_0x3dfbe1);};}exports[_0xf56d('0x30')]=function(_0x39eef0,_0x134c95){var _0x2f32c9={},_0x11d44d={},_0x3b0da0={'count':0x0,'rows':[]};var _0x132c4d=_[_0xf56d('0x31')](db['Schedule']['rawAttributes'],function(_0x120349){return{'name':_0x120349[_0xf56d('0x32')],'type':_0x120349['type']['key']};});_0x11d44d[_0xf56d('0x33')]=_['map'](_0x132c4d,_0xf56d('0x2e'));_0x11d44d[_0xf56d('0x34')]=_[_0xf56d('0x35')](_0x39eef0['query']);_0x11d44d[_0xf56d('0x36')]=_[_0xf56d('0x37')](_0x11d44d[_0xf56d('0x33')],_0x11d44d[_0xf56d('0x34')]);_0x2f32c9['attributes']=_[_0xf56d('0x37')](_0x11d44d['model'],qs[_0xf56d('0x38')](_0x39eef0[_0xf56d('0x34')][_0xf56d('0x38')]));_0x2f32c9[_0xf56d('0x39')]=_0x2f32c9[_0xf56d('0x39')][_0xf56d('0x3a')]?_0x2f32c9['attributes']:_0x11d44d[_0xf56d('0x33')];if(!_0x39eef0['query'][_0xf56d('0x3b')]('nolimit')){_0x2f32c9['limit']=qs['limit'](_0x39eef0[_0xf56d('0x34')]['limit']);_0x2f32c9['offset']=qs[_0xf56d('0x1c')](_0x39eef0[_0xf56d('0x34')]['offset']);}_0x2f32c9[_0xf56d('0x3c')]=qs[_0xf56d('0x3d')](_0x39eef0[_0xf56d('0x34')]['sort']);_0x2f32c9['where']=qs['filters'](_[_0xf56d('0x3e')](_0x39eef0[_0xf56d('0x34')],_0x11d44d[_0xf56d('0x36')]),_0x132c4d);if(_0x39eef0[_0xf56d('0x34')][_0xf56d('0x3f')]){_0x2f32c9[_0xf56d('0x40')]=_[_0xf56d('0x41')](_0x2f32c9['where'],{'$or':_[_0xf56d('0x31')](_0x132c4d,function(_0x3cada8){if(_0x3cada8['type']!==_0xf56d('0x42')){var _0x15172e={};_0x15172e[_0x3cada8[_0xf56d('0x2e')]]={'$like':'%'+_0x39eef0[_0xf56d('0x34')]['filter']+'%'};return _0x15172e;}})});}_0x2f32c9=_[_0xf56d('0x41')]({},_0x2f32c9,_0x39eef0[_0xf56d('0x43')]);var _0x4d30ad={'where':_0x2f32c9[_0xf56d('0x40')]};return db[_0xf56d('0x44')][_0xf56d('0x1f')](_0x4d30ad)[_0xf56d('0x26')](function(_0x2dc4c8){_0x3b0da0['count']=_0x2dc4c8;if(_0x39eef0[_0xf56d('0x34')][_0xf56d('0x45')]){_0x2f32c9[_0xf56d('0x46')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x2f32c9);})['then'](function(_0x2977f5){_0x3b0da0[_0xf56d('0x47')]=_0x2977f5;return _0x3b0da0;})[_0xf56d('0x26')](respondWithFilteredResult(_0x134c95,_0x2f32c9))[_0xf56d('0x48')](handleError(_0x134c95,null));};exports[_0xf56d('0x49')]=function(_0xc87fd3,_0x7846af){var _0x2b7652={'raw':![],'where':{'id':_0xc87fd3[_0xf56d('0x4a')]['id']}},_0x571904={};_0x571904[_0xf56d('0x33')]=_[_0xf56d('0x35')](db[_0xf56d('0x44')][_0xf56d('0x4b')]);_0x571904['query']=_[_0xf56d('0x35')](_0xc87fd3['query']);_0x571904[_0xf56d('0x36')]=_['intersection'](_0x571904[_0xf56d('0x33')],_0x571904['query']);_0x2b7652[_0xf56d('0x39')]=_[_0xf56d('0x37')](_0x571904['model'],qs[_0xf56d('0x38')](_0xc87fd3[_0xf56d('0x34')][_0xf56d('0x38')]));_0x2b7652['attributes']=_0x2b7652['attributes'][_0xf56d('0x3a')]?_0x2b7652[_0xf56d('0x39')]:_0x571904[_0xf56d('0x33')];if(_0xc87fd3['query'][_0xf56d('0x45')]){_0x2b7652[_0xf56d('0x46')]=[{'all':!![]}];}_0x2b7652=_[_0xf56d('0x41')]({},_0x2b7652,_0xc87fd3[_0xf56d('0x43')]);return db['Schedule'][_0xf56d('0x4c')](_0x2b7652)[_0xf56d('0x26')](handleEntityNotFound(_0x7846af,null))[_0xf56d('0x26')](respondWithResult(_0x7846af,null))[_0xf56d('0x48')](handleError(_0x7846af,null));};exports[_0xf56d('0x4d')]=function(_0xb5f90,_0x1a49d2){return db[_0xf56d('0x44')][_0xf56d('0x4d')](_0xb5f90[_0xf56d('0x4e')],{})[_0xf56d('0x26')](function(_0x5df4c8){var _0x25ddac=_0xb5f90[_0xf56d('0x4f')]['get']({'plain':!![]});if(!_0x25ddac)throw new Error(_0xf56d('0x50'));if(_0x25ddac[_0xf56d('0x51')]===_0xf56d('0x4f')){var _0x52b937=_0x5df4c8[_0xf56d('0x28')]({'plain':!![]});var _0x4860b9=_0xf56d('0x29');return db[_0xf56d('0x52')][_0xf56d('0x4c')]({'where':{'name':_0x4860b9,'userProfileId':_0x25ddac['userProfileId']},'raw':!![]})[_0xf56d('0x26')](function(_0x2a9f0d){if(_0x2a9f0d&&_0x2a9f0d['autoAssociation']===0x0){return db[_0xf56d('0x2a')][_0xf56d('0x4d')]({'name':_0x52b937[_0xf56d('0x2e')],'resourceId':_0x52b937['id'],'type':_0x2a9f0d[_0xf56d('0x2e')],'sectionId':_0x2a9f0d['id']},{})['then'](function(){return _0x5df4c8;});}else{return _0x5df4c8;}})[_0xf56d('0x48')](function(_0x2fbd0b){logger[_0xf56d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fbd0b);throw _0x2fbd0b;});}return _0x5df4c8;})[_0xf56d('0x26')](respondWithResult(_0x1a49d2,0xc9))[_0xf56d('0x48')](handleError(_0x1a49d2,null));};exports['update']=function(_0x2fe8bf,_0xb9c0a4){if(_0x2fe8bf[_0xf56d('0x4e')]['id']){delete _0x2fe8bf[_0xf56d('0x4e')]['id'];}return db[_0xf56d('0x44')][_0xf56d('0x4c')]({'where':{'id':_0x2fe8bf[_0xf56d('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb9c0a4,null))[_0xf56d('0x26')](saveUpdates(_0x2fe8bf[_0xf56d('0x4e')],null))['then'](respondWithResult(_0xb9c0a4,null))['catch'](handleError(_0xb9c0a4,null));};exports['destroy']=function(_0x509221,_0x50ff12){return db['Schedule'][_0xf56d('0x4c')]({'where':{'id':_0x509221[_0xf56d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50ff12,null))[_0xf56d('0x26')](removeEntity(_0x50ff12,null))['catch'](handleError(_0x50ff12,null));};exports['run']=function(_0xde5c0,_0x69886c,_0x2fedd9){var _0x465f70=require('../../config/schedule');return db[_0xf56d('0x44')][_0xf56d('0x4c')]({'where':{'id':_0xde5c0[_0xf56d('0x4a')]['id']},'raw':!![]})[_0xf56d('0x26')](handleEntityNotFound(_0x69886c,null))['then'](function(){_0x465f70[_0xf56d('0x53')](_0xde5c0[_0xf56d('0x4a')]['id']);})[_0xf56d('0x26')](respondWithStatusCode(_0x69886c,null))[_0xf56d('0x48')](handleError(_0x69886c,null));}; \ No newline at end of file +var _0x18f8=['options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2d9bfc,_0x30f351){var _0x4e6741=function(_0x1c9fa9){while(--_0x1c9fa9){_0x2d9bfc['push'](_0x2d9bfc['shift']());}};_0x4e6741(++_0x30f351);}(_0x18f8,0x161));var _0x818f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x18f8[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0x818f('0x0'));var rimraf=require(_0x818f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x818f('0x2'));var moment=require('moment');var BPromise=require(_0x818f('0x3'));var Mustache=require(_0x818f('0x4'));var util=require(_0x818f('0x5'));var path=require('path');var sox=require(_0x818f('0x6'));var csv=require(_0x818f('0x7'));var ejs=require(_0x818f('0x8'));var fs=require('fs');var fs_extra=require(_0x818f('0x9'));var _=require(_0x818f('0xa'));var squel=require(_0x818f('0xb'));var crypto=require(_0x818f('0xc'));var jsforce=require(_0x818f('0xd'));var deskjs=require(_0x818f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x818f('0xf'));var Redis=require(_0x818f('0x10'));var authService=require(_0x818f('0x11'));var qs=require(_0x818f('0x12'));var as=require(_0x818f('0x13'));var hardwareService=require(_0x818f('0x14'));var logger=require('../../config/logger')(_0x818f('0x15'));var utils=require(_0x818f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b2b00,_0x555adc){_0x555adc=_0x555adc||0xcc;return function(_0x5a4eb2){if(_0x5a4eb2){return _0x5b2b00[_0x818f('0x17')](_0x555adc);}return _0x5b2b00[_0x818f('0x18')](_0x555adc)[_0x818f('0x19')]();};}function respondWithResult(_0x47ef52,_0x508543){_0x508543=_0x508543||0xc8;return function(_0x2fb884){if(_0x2fb884){return _0x47ef52[_0x818f('0x18')](_0x508543)[_0x818f('0x1a')](_0x2fb884);}};}function respondWithFilteredResult(_0x306b4b,_0x221f95){return function(_0x305c3e){if(_0x305c3e){var _0x15c078=typeof _0x221f95[_0x818f('0x1b')]===_0x818f('0x1c')&&typeof _0x221f95['limit']===_0x818f('0x1c');var _0x37f7d4=_0x305c3e[_0x818f('0x1d')];var _0x52d54d=_0x15c078?0x0:_0x221f95[_0x818f('0x1b')];var _0x1504ff=_0x15c078?_0x305c3e[_0x818f('0x1d')]:_0x221f95[_0x818f('0x1b')]+_0x221f95[_0x818f('0x1e')];var _0x3f008d;if(_0x1504ff>=_0x37f7d4){_0x1504ff=_0x37f7d4;_0x3f008d=0xc8;}else{_0x3f008d=0xce;}_0x306b4b[_0x818f('0x18')](_0x3f008d);return _0x306b4b[_0x818f('0x1f')](_0x818f('0x20'),_0x52d54d+'-'+_0x1504ff+'/'+_0x37f7d4)[_0x818f('0x1a')](_0x305c3e);}return null;};}function patchUpdates(_0x1876e8){return function(_0x8d44b6){try{jsonpatch[_0x818f('0x21')](_0x8d44b6,_0x1876e8,!![]);}catch(_0x16334d){return BPromise['reject'](_0x16334d);}return _0x8d44b6['save']();};}function saveUpdates(_0x571796,_0x347de7){return function(_0x154f72){if(_0x154f72){return _0x154f72['update'](_0x571796)[_0x818f('0x22')](function(_0x1b52f3){return _0x1b52f3;});}return null;};}function removeEntity(_0x532fac,_0x1e2ccd){return function(_0x57e45b){if(_0x57e45b){return _0x57e45b[_0x818f('0x23')]()[_0x818f('0x22')](function(){var _0x595c55=_0x57e45b[_0x818f('0x24')]({'plain':!![]});var _0x1aa8f9=_0x818f('0x25');return db[_0x818f('0x26')][_0x818f('0x23')]({'where':{'type':_0x1aa8f9,'resourceId':_0x595c55['id']}})[_0x818f('0x22')](function(){return _0x57e45b;});})['then'](function(){_0x532fac[_0x818f('0x18')](0xcc)[_0x818f('0x19')]();});}};}function handleEntityNotFound(_0xd7b0c1,_0x579b12){return function(_0x1ed4b1){if(!_0x1ed4b1){_0xd7b0c1[_0x818f('0x17')](0x194);}return _0x1ed4b1;};}function handleError(_0x386484,_0xc5ca63){_0xc5ca63=_0xc5ca63||0x1f4;return function(_0x3980bd){logger['error'](_0x3980bd[_0x818f('0x27')]);if(_0x3980bd[_0x818f('0x28')]){delete _0x3980bd[_0x818f('0x28')];}_0x386484[_0x818f('0x18')](_0xc5ca63)[_0x818f('0x29')](_0x3980bd);};}exports[_0x818f('0x2a')]=function(_0x5afde7,_0x49ab34){var _0x58b73c={},_0x5b6725={},_0x380145={'count':0x0,'rows':[]};var _0xc06708=_[_0x818f('0x2b')](db[_0x818f('0x2c')][_0x818f('0x2d')],function(_0x2a5cba){return{'name':_0x2a5cba['fieldName'],'type':_0x2a5cba[_0x818f('0x2e')]['key']};});_0x5b6725['model']=_[_0x818f('0x2b')](_0xc06708,_0x818f('0x28'));_0x5b6725[_0x818f('0x2f')]=_[_0x818f('0x30')](_0x5afde7[_0x818f('0x2f')]);_0x5b6725[_0x818f('0x31')]=_[_0x818f('0x32')](_0x5b6725[_0x818f('0x33')],_0x5b6725['query']);_0x58b73c[_0x818f('0x34')]=_['intersection'](_0x5b6725[_0x818f('0x33')],qs[_0x818f('0x35')](_0x5afde7[_0x818f('0x2f')]['fields']));_0x58b73c[_0x818f('0x34')]=_0x58b73c[_0x818f('0x34')]['length']?_0x58b73c[_0x818f('0x34')]:_0x5b6725[_0x818f('0x33')];if(!_0x5afde7[_0x818f('0x2f')][_0x818f('0x36')]('nolimit')){_0x58b73c[_0x818f('0x1e')]=qs[_0x818f('0x1e')](_0x5afde7[_0x818f('0x2f')][_0x818f('0x1e')]);_0x58b73c[_0x818f('0x1b')]=qs[_0x818f('0x1b')](_0x5afde7['query'][_0x818f('0x1b')]);}_0x58b73c[_0x818f('0x37')]=qs[_0x818f('0x38')](_0x5afde7[_0x818f('0x2f')][_0x818f('0x38')]);_0x58b73c[_0x818f('0x39')]=qs[_0x818f('0x31')](_[_0x818f('0x3a')](_0x5afde7['query'],_0x5b6725['filters']),_0xc06708);if(_0x5afde7['query'][_0x818f('0x3b')]){_0x58b73c[_0x818f('0x39')]=_[_0x818f('0x3c')](_0x58b73c[_0x818f('0x39')],{'$or':_[_0x818f('0x2b')](_0xc06708,function(_0x1a545f){if(_0x1a545f[_0x818f('0x2e')]!==_0x818f('0x3d')){var _0x1ab083={};_0x1ab083[_0x1a545f[_0x818f('0x28')]]={'$like':'%'+_0x5afde7[_0x818f('0x2f')][_0x818f('0x3b')]+'%'};return _0x1ab083;}})});}_0x58b73c=_[_0x818f('0x3c')]({},_0x58b73c,_0x5afde7[_0x818f('0x3e')]);var _0x3ad838={'where':_0x58b73c[_0x818f('0x39')]};return db[_0x818f('0x2c')][_0x818f('0x1d')](_0x3ad838)['then'](function(_0x5d6526){_0x380145[_0x818f('0x1d')]=_0x5d6526;if(_0x5afde7[_0x818f('0x2f')][_0x818f('0x3f')]){_0x58b73c[_0x818f('0x40')]=[{'all':!![]}];}return db[_0x818f('0x2c')][_0x818f('0x41')](_0x58b73c);})[_0x818f('0x22')](function(_0x60608f){_0x380145[_0x818f('0x42')]=_0x60608f;return _0x380145;})[_0x818f('0x22')](respondWithFilteredResult(_0x49ab34,_0x58b73c))['catch'](handleError(_0x49ab34,null));};exports[_0x818f('0x43')]=function(_0x46a960,_0x2ebbdc){var _0x12499e={'raw':![],'where':{'id':_0x46a960[_0x818f('0x44')]['id']}},_0x172c4d={};_0x172c4d[_0x818f('0x33')]=_[_0x818f('0x30')](db[_0x818f('0x2c')][_0x818f('0x2d')]);_0x172c4d['query']=_['keys'](_0x46a960[_0x818f('0x2f')]);_0x172c4d[_0x818f('0x31')]=_[_0x818f('0x32')](_0x172c4d[_0x818f('0x33')],_0x172c4d[_0x818f('0x2f')]);_0x12499e[_0x818f('0x34')]=_['intersection'](_0x172c4d[_0x818f('0x33')],qs[_0x818f('0x35')](_0x46a960[_0x818f('0x2f')]['fields']));_0x12499e[_0x818f('0x34')]=_0x12499e[_0x818f('0x34')][_0x818f('0x45')]?_0x12499e[_0x818f('0x34')]:_0x172c4d['model'];if(_0x46a960[_0x818f('0x2f')][_0x818f('0x3f')]){_0x12499e[_0x818f('0x40')]=[{'all':!![]}];}_0x12499e=_[_0x818f('0x3c')]({},_0x12499e,_0x46a960[_0x818f('0x3e')]);return db[_0x818f('0x2c')][_0x818f('0x46')](_0x12499e)['then'](handleEntityNotFound(_0x2ebbdc,null))['then'](respondWithResult(_0x2ebbdc,null))['catch'](handleError(_0x2ebbdc,null));};exports['create']=function(_0x34e72d,_0x33ca24){return db[_0x818f('0x2c')][_0x818f('0x47')](_0x34e72d[_0x818f('0x48')],{})[_0x818f('0x22')](function(_0x1f8acf){var _0x954c63=_0x34e72d[_0x818f('0x49')][_0x818f('0x24')]({'plain':!![]});if(!_0x954c63)throw new Error(_0x818f('0x4a'));if(_0x954c63['role']===_0x818f('0x49')){var _0x2db25b=_0x1f8acf[_0x818f('0x24')]({'plain':!![]});var _0x1e1ed4=_0x818f('0x25');return db[_0x818f('0x4b')][_0x818f('0x46')]({'where':{'name':_0x1e1ed4,'userProfileId':_0x954c63[_0x818f('0x4c')]},'raw':!![]})[_0x818f('0x22')](function(_0x5edb7c){if(_0x5edb7c&&_0x5edb7c['autoAssociation']===0x0){return db[_0x818f('0x26')]['create']({'name':_0x2db25b[_0x818f('0x28')],'resourceId':_0x2db25b['id'],'type':_0x5edb7c[_0x818f('0x28')],'sectionId':_0x5edb7c['id']},{})['then'](function(){return _0x1f8acf;});}else{return _0x1f8acf;}})[_0x818f('0x4d')](function(_0x413e85){logger[_0x818f('0x4e')](_0x818f('0x4f'),_0x413e85);throw _0x413e85;});}return _0x1f8acf;})[_0x818f('0x22')](respondWithResult(_0x33ca24,0xc9))[_0x818f('0x4d')](handleError(_0x33ca24,null));};exports[_0x818f('0x50')]=function(_0x337fba,_0x138182){if(_0x337fba[_0x818f('0x48')]['id']){delete _0x337fba['body']['id'];}return db[_0x818f('0x2c')][_0x818f('0x46')]({'where':{'id':_0x337fba[_0x818f('0x44')]['id']}})['then'](handleEntityNotFound(_0x138182,null))[_0x818f('0x22')](saveUpdates(_0x337fba[_0x818f('0x48')],null))['then'](respondWithResult(_0x138182,null))['catch'](handleError(_0x138182,null));};exports[_0x818f('0x23')]=function(_0x50e884,_0x2d259c){return db[_0x818f('0x2c')][_0x818f('0x46')]({'where':{'id':_0x50e884[_0x818f('0x44')]['id']}})[_0x818f('0x22')](handleEntityNotFound(_0x2d259c,null))[_0x818f('0x22')](removeEntity(_0x2d259c,null))[_0x818f('0x4d')](handleError(_0x2d259c,null));};exports[_0x818f('0x51')]=function(_0x18c65d,_0x5601e3,_0x148505){var _0x4cff0d=require(_0x818f('0x52'));return db[_0x818f('0x2c')][_0x818f('0x46')]({'where':{'id':_0x18c65d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5601e3,null))['then'](function(){_0x4cff0d[_0x818f('0x51')](_0x18c65d[_0x818f('0x44')]['id']);})[_0x818f('0x22')](respondWithStatusCode(_0x5601e3,null))['catch'](handleError(_0x5601e3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c5862e6..4d4a20c 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ad6=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','Schedule','tools_schedules','../../config/logger','api'];(function(_0x23c482,_0x518417){var _0x5c16b3=function(_0x2b2951){while(--_0x2b2951){_0x23c482['push'](_0x23c482['shift']());}};_0x5c16b3(++_0x518417);}(_0x7ad6,0x134));var _0x67ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7ad6[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67ad('0x0'))(_0x67ad('0x1'));var moment=require('moment');var BPromise=require(_0x67ad('0x2'));var rp=require(_0x67ad('0x3'));var fs=require('fs');var path=require(_0x67ad('0x4'));var rimraf=require(_0x67ad('0x5'));var config=require(_0x67ad('0x6'));var attributes=require(_0x67ad('0x7'));module['exports']=function(_0x2b6463,_0x2db732){return _0x2b6463['define'](_0x67ad('0x8'),attributes,{'tableName':_0x67ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f7f=['Schedule','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x32a49f,_0x176468){var _0x4e153a=function(_0x40aa44){while(--_0x40aa44){_0x32a49f['push'](_0x32a49f['shift']());}};_0x4e153a(++_0x176468);}(_0x3f7f,0x1b9));var _0xf3f7=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x3f7f[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0xf3f7('0x0'));var logger=require(_0xf3f7('0x1'))(_0xf3f7('0x2'));var moment=require('moment');var BPromise=require(_0xf3f7('0x3'));var rp=require(_0xf3f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3f7('0x5'));var config=require(_0xf3f7('0x6'));var attributes=require(_0xf3f7('0x7'));module[_0xf3f7('0x8')]=function(_0x473c6a,_0x4c2f7d){return _0x473c6a[_0xf3f7('0x9')](_0xf3f7('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index fad830f..b0abe67 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5741=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5741,0x130));var _0x1574=function(_0xd0432e,_0x310217){_0xd0432e=_0xd0432e-0x0;var _0x56cc61=_0x5741[_0xd0432e];return _0x56cc61;};'use strict';var _=require(_0x1574('0x0'));var util=require(_0x1574('0x1'));var moment=require(_0x1574('0x2'));var BPromise=require(_0x1574('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1574('0x4'));var db=require(_0x1574('0x5'))['db'];var utils=require(_0x1574('0x6'));var logger=require(_0x1574('0x7'))(_0x1574('0x8'));var config=require(_0x1574('0x9'));var jayson=require(_0x1574('0xa'));var client=jayson[_0x1574('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d5390,_0x177cff,_0x2948f7){return new BPromise(function(_0x2b7d47,_0x5e73ae){return client[_0x1574('0xc')](_0x1d5390,_0x2948f7)[_0x1574('0xd')](function(_0x1bc47f){logger[_0x1574('0xe')](_0x1574('0xf'),_0x177cff,_0x1574('0x10'));logger[_0x1574('0x11')](_0x1574('0x12'),_0x177cff,_0x1574('0x10'),JSON[_0x1574('0x13')](_0x1bc47f));if(_0x1bc47f[_0x1574('0x14')]){if(_0x1bc47f['error'][_0x1574('0x15')]===0x1f4){logger[_0x1574('0x14')](_0x1574('0xf'),_0x177cff,_0x1bc47f[_0x1574('0x14')][_0x1574('0x16')]);return _0x5e73ae(_0x1bc47f[_0x1574('0x14')][_0x1574('0x16')]);}logger[_0x1574('0x14')](_0x1574('0xf'),_0x177cff,_0x1bc47f['error'][_0x1574('0x16')]);return _0x2b7d47(_0x1bc47f[_0x1574('0x14')][_0x1574('0x16')]);}else{logger[_0x1574('0xe')](_0x1574('0xf'),_0x177cff,_0x1574('0x10'));_0x2b7d47(_0x1bc47f[_0x1574('0x17')][_0x1574('0x16')]);}})[_0x1574('0x18')](function(_0x338c50){logger[_0x1574('0x14')]('Schedule,\x20%s,\x20%s',_0x177cff,_0x338c50);_0x5e73ae(_0x338c50);});});} \ No newline at end of file +var _0x183b=['error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','http','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x183b,0x16e));var _0xb183=function(_0x521e86,_0x505469){_0x521e86=_0x521e86-0x0;var _0x599f05=_0x183b[_0x521e86];return _0x599f05;};'use strict';var _=require(_0xb183('0x0'));var util=require(_0xb183('0x1'));var moment=require('moment');var BPromise=require(_0xb183('0x2'));var rs=require(_0xb183('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb183('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb183('0x5'));var jayson=require(_0xb183('0x6'));var client=jayson['client'][_0xb183('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cc36f,_0x393706,_0x3ed5b0){return new BPromise(function(_0x652b43,_0x232781){return client['request'](_0x4cc36f,_0x3ed5b0)[_0xb183('0x8')](function(_0x533f57){logger['info'](_0xb183('0x9'),_0x393706,_0xb183('0xa'));logger[_0xb183('0xb')](_0xb183('0xc'),_0x393706,_0xb183('0xa'),JSON[_0xb183('0xd')](_0x533f57));if(_0x533f57[_0xb183('0xe')]){if(_0x533f57[_0xb183('0xe')][_0xb183('0xf')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x393706,_0x533f57[_0xb183('0xe')][_0xb183('0x10')]);return _0x232781(_0x533f57[_0xb183('0xe')][_0xb183('0x10')]);}logger[_0xb183('0xe')](_0xb183('0x9'),_0x393706,_0x533f57[_0xb183('0xe')][_0xb183('0x10')]);return _0x652b43(_0x533f57['error'][_0xb183('0x10')]);}else{logger[_0xb183('0x11')](_0xb183('0x9'),_0x393706,_0xb183('0xa'));_0x652b43(_0x533f57[_0xb183('0x12')]['message']);}})[_0xb183('0x13')](function(_0x362640){logger[_0xb183('0xe')](_0xb183('0x9'),_0x393706,_0x362640);_0x232781(_0x362640);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 3dbb294..353f944 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a18=['/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get'];(function(_0x2cba09,_0x23ee85){var _0x10d084=function(_0x11d2e4){while(--_0x11d2e4){_0x2cba09['push'](_0x2cba09['shift']());}};_0x10d084(++_0x23ee85);}(_0x6a18,0x1ed));var _0x86a1=function(_0x1d4016,_0x2df022){_0x1d4016=_0x1d4016-0x0;var _0x1b3954=_0x6a18[_0x1d4016];return _0x1b3954;};'use strict';var multer=require('multer');var util=require(_0x86a1('0x0'));var path=require(_0x86a1('0x1'));var timeout=require(_0x86a1('0x2'));var express=require(_0x86a1('0x3'));var router=express[_0x86a1('0x4')]();var fs_extra=require(_0x86a1('0x5'));var auth=require(_0x86a1('0x6'));var interaction=require(_0x86a1('0x7'));var config=require(_0x86a1('0x8'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x86a1('0x9')](),controller[_0x86a1('0xa')]);router['get'](_0x86a1('0xb'),auth[_0x86a1('0x9')](),controller['describe']);router[_0x86a1('0xc')](_0x86a1('0xd'),auth[_0x86a1('0x9')](),controller['show']);router[_0x86a1('0xc')](_0x86a1('0xe'),auth[_0x86a1('0x9')](),controller[_0x86a1('0xf')]);router[_0x86a1('0x10')]('/',auth['isAuthenticated'](),controller[_0x86a1('0x11')]);router[_0x86a1('0x12')](_0x86a1('0xd'),auth[_0x86a1('0x9')](),controller[_0x86a1('0x13')]);router[_0x86a1('0x14')](_0x86a1('0xd'),auth[_0x86a1('0x9')](),controller[_0x86a1('0x15')]);module[_0x86a1('0x16')]=router; \ No newline at end of file +var _0xe5f7=['put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','post','create'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0xe5f7,0xa5));var _0x7e5f=function(_0x94e704,_0x1987df){_0x94e704=_0x94e704-0x0;var _0x21e9d8=_0xe5f7[_0x94e704];return _0x21e9d8;};'use strict';var multer=require('multer');var util=require(_0x7e5f('0x0'));var path=require(_0x7e5f('0x1'));var timeout=require(_0x7e5f('0x2'));var express=require(_0x7e5f('0x3'));var router=express['Router']();var fs_extra=require(_0x7e5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e5f('0x5'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x7e5f('0x6')]('/',auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x8')]);router[_0x7e5f('0x6')](_0x7e5f('0x9'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0xa')]);router[_0x7e5f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7e5f('0xb')]);router[_0x7e5f('0x6')](_0x7e5f('0xc'),auth[_0x7e5f('0x7')](),controller['download']);router[_0x7e5f('0xd')]('/',auth['isAuthenticated'](),controller[_0x7e5f('0xe')]);router[_0x7e5f('0xf')](_0x7e5f('0x10'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x11')]);router[_0x7e5f('0x12')](_0x7e5f('0x10'),auth[_0x7e5f('0x7')](),controller['destroy']);module[_0x7e5f('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 6f3b35c..63ded05 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef9=['setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','../../config/environment','exports','getDataValue','extname','value','STRING','replace'];(function(_0x1a5f16,_0x299d82){var _0x4981c7=function(_0x1558f4){while(--_0x1558f4){_0x1a5f16['push'](_0x1a5f16['shift']());}};_0x4981c7(++_0x299d82);}(_0xfef9,0xd3));var _0x9fef=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0xfef9[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x9fef('0x0'));var moment=require(_0x9fef('0x1'));var path=require('path');var config=require(_0x9fef('0x2'));module[_0x9fef('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9fef('0x4')]('value')?path[_0x9fef('0x5')](this['getDataValue'](_0x9fef('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x9fef('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x9fef('0x7')],'set':function(_0x311595){var _0x480161=_0x311595[_0x9fef('0x8')](/\\/g,'/');this[_0x9fef('0x9')](_0x9fef('0x6'),_0x480161);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9fef('0xa')],'set':function(_0x171152){this[_0x9fef('0x9')]('startedAt',moment()[_0x9fef('0xb')](_0x171152,'ms'));this['setDataValue'](_0x9fef('0xc'),moment());this[_0x9fef('0x9')](_0x9fef('0xd'),_0x171152);}},'startedAt':{'type':Sequelize[_0x9fef('0xe')],'get':function(){return moment(this[_0x9fef('0x4')](_0x9fef('0xf')))[_0x9fef('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x9fef('0x11')]();}},'closedAt':{'type':Sequelize[_0x9fef('0xe')],'get':function(){return moment(this[_0x9fef('0x4')]('closedAt'))[_0x9fef('0x10')](_0x9fef('0x12'))[_0x9fef('0x11')]();}},'createdAt':{'type':Sequelize[_0x9fef('0xe')],'get':function(){return moment(this[_0x9fef('0x4')]('createdAt'))[_0x9fef('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x9fef('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9fef('0x4')](_0x9fef('0x13')))[_0x9fef('0x10')](_0x9fef('0x12'))[_0x9fef('0x11')]();}}}; \ No newline at end of file +var _0xf79e=['startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue'];(function(_0x1d06a5,_0x4fc577){var _0xbaab59=function(_0x458664){while(--_0x458664){_0x1d06a5['push'](_0x1d06a5['shift']());}};_0xbaab59(++_0x4fc577);}(_0xf79e,0x185));var _0xef79=function(_0x30062c,_0x4fcd09){_0x30062c=_0x30062c-0x0;var _0x3c4760=_0xf79e[_0x30062c];return _0x3c4760;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xef79('0x0'));var path=require(_0xef79('0x1'));var config=require(_0xef79('0x2'));module['exports']={'format':{'type':Sequelize[_0xef79('0x3')],'get':function(){return this[_0xef79('0x4')]('value')?path['extname'](this[_0xef79('0x4')](_0xef79('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xef79('0x6')]},'channel':{'type':Sequelize[_0xef79('0x6')]},'value':{'type':Sequelize[_0xef79('0x6')],'set':function(_0x2fa668){var _0x49d0ea=_0x2fa668[_0xef79('0x7')](/\\/g,'/');this['setDataValue'](_0xef79('0x5'),_0x49d0ea);}},'rating':{'type':Sequelize[_0xef79('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x42dee6){this[_0xef79('0x9')](_0xef79('0xa'),moment()[_0xef79('0xb')](_0x42dee6,'ms'));this[_0xef79('0x9')](_0xef79('0xc'),moment());this[_0xef79('0x9')](_0xef79('0xd'),_0x42dee6);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xef79('0x4')](_0xef79('0xa')))[_0xef79('0xe')](_0xef79('0xf'))[_0xef79('0x10')]();}},'closedAt':{'type':Sequelize[_0xef79('0x11')],'get':function(){return moment(this[_0xef79('0x4')](_0xef79('0xc')))[_0xef79('0xe')](_0xef79('0xf'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xef79('0xe')](_0xef79('0xf'))[_0xef79('0x10')]();}},'updatedAt':{'type':Sequelize[_0xef79('0x11')],'get':function(){return moment(this['getDataValue'](_0xef79('0x12')))[_0xef79('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xef79('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index efbb3df..c30259b 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x512a81,_0x564977){var _0x1d5194=function(_0x44585e){while(--_0x44585e){_0x512a81['push'](_0x512a81['shift']());}};_0x1d5194(++_0x564977);}(_0x55ca,0x126));var _0xa55c=function(_0x11a383,_0x4e05ae){_0x11a383=_0x11a383-0x0;var _0x49f2bb=_0x55ca[_0x11a383];return _0x49f2bb;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));}; \ No newline at end of file +var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x3e8621,_0x55a594){var _0x268322=function(_0x23e72c){while(--_0x23e72c){_0x3e8621['push'](_0x3e8621['shift']());}};_0x268322(++_0x55a594);}(_0xabce,0x103));var _0xeabc=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xabce[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e658b41..e2df4f2 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b6e=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2c1e22,_0x22ff31){var _0x5b5639=function(_0x3f0753){while(--_0x3f0753){_0x2c1e22['push'](_0x2c1e22['shift']());}};_0x5b5639(++_0x22ff31);}(_0x3b6e,0x84));var _0xe3b6=function(_0x91a06,_0x2d8649){_0x91a06=_0x91a06-0x0;var _0xbd1732=_0x3b6e[_0x91a06];return _0xbd1732;};'use strict';var _=require(_0xe3b6('0x0'));var util=require(_0xe3b6('0x1'));var logger=require(_0xe3b6('0x2'))(_0xe3b6('0x3'));var moment=require(_0xe3b6('0x4'));var BPromise=require('bluebird');var rp=require(_0xe3b6('0x5'));var fs=require('fs');var path=require(_0xe3b6('0x6'));var rimraf=require(_0xe3b6('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3b6('0x8'));module[_0xe3b6('0x9')]=function(_0x105d89,_0x513a7d){return _0x105d89[_0xe3b6('0xa')](_0xe3b6('0xb'),attributes,{'tableName':_0xe3b6('0xc'),'paranoid':![],'indexes':[{'name':_0xe3b6('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ae4=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x49119a,_0x2fe2be){var _0x1fe250=function(_0x1c47b8){while(--_0x1c47b8){_0x49119a['push'](_0x49119a['shift']());}};_0x1fe250(++_0x2fe2be);}(_0x8ae4,0x78));var _0x48ae=function(_0x27e4a9,_0x21b31b){_0x27e4a9=_0x27e4a9-0x0;var _0x2f4a66=_0x8ae4[_0x27e4a9];return _0x2f4a66;};'use strict';var _=require(_0x48ae('0x0'));var util=require(_0x48ae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x48ae('0x2'));var BPromise=require(_0x48ae('0x3'));var rp=require(_0x48ae('0x4'));var fs=require('fs');var path=require(_0x48ae('0x5'));var rimraf=require(_0x48ae('0x6'));var config=require(_0x48ae('0x7'));var attributes=require(_0x48ae('0x8'));module[_0x48ae('0x9')]=function(_0x3cc257,_0x321f56){return _0x3cc257[_0x48ae('0xa')](_0x48ae('0xb'),attributes,{'tableName':_0x48ae('0xc'),'paranoid':![],'indexes':[{'name':_0x48ae('0xd'),'fields':[_0x48ae('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4b44a80..c46b17b 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb49f=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x65be82,_0x3b2d79){var _0x256975=function(_0x42a026){while(--_0x42a026){_0x65be82['push'](_0x65be82['shift']());}};_0x256975(++_0x3b2d79);}(_0xb49f,0xd0));var _0xfb49=function(_0x25b09d,_0x1153ba){_0x25b09d=_0x25b09d-0x0;var _0x4831cc=_0xb49f[_0x25b09d];return _0x4831cc;};'use strict';var _=require(_0xfb49('0x0'));var util=require('util');var moment=require(_0xfb49('0x1'));var BPromise=require(_0xfb49('0x2'));var rs=require(_0xfb49('0x3'));var fs=require('fs');var Redis=require(_0xfb49('0x4'));var db=require(_0xfb49('0x5'))['db'];var utils=require(_0xfb49('0x6'));var logger=require(_0xfb49('0x7'))(_0xfb49('0x8'));var config=require(_0xfb49('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24587c,_0x3c9e98,_0x4210d5){return new BPromise(function(_0xe63cf3,_0x1fb241){return client[_0xfb49('0xb')](_0x24587c,_0x4210d5)[_0xfb49('0xc')](function(_0x3f7522){logger['info'](_0xfb49('0xd'),_0x3c9e98,_0xfb49('0xe'));logger[_0xfb49('0xf')](_0xfb49('0x10'),_0x3c9e98,'request\x20sent',JSON[_0xfb49('0x11')](_0x3f7522));if(_0x3f7522[_0xfb49('0x12')]){if(_0x3f7522[_0xfb49('0x12')]['code']===0x1f4){logger[_0xfb49('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x3c9e98,_0x3f7522['error']['message']);return _0x1fb241(_0x3f7522[_0xfb49('0x12')][_0xfb49('0x13')]);}logger[_0xfb49('0x12')](_0xfb49('0xd'),_0x3c9e98,_0x3f7522[_0xfb49('0x12')][_0xfb49('0x13')]);return _0xe63cf3(_0x3f7522[_0xfb49('0x12')]['message']);}else{logger[_0xfb49('0x14')](_0xfb49('0xd'),_0x3c9e98,'request\x20sent');_0xe63cf3(_0x3f7522[_0xfb49('0x15')][_0xfb49('0x13')]);}})[_0xfb49('0x16')](function(_0x9baf58){logger[_0xfb49('0x12')](_0xfb49('0xd'),_0x3c9e98,_0x9baf58);_0x1fb241(_0x9baf58);});});} \ No newline at end of file +var _0x038f=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3fde21,_0x5c2717){var _0x51ebf9=function(_0x133816){while(--_0x133816){_0x3fde21['push'](_0x3fde21['shift']());}};_0x51ebf9(++_0x5c2717);}(_0x038f,0x1cc));var _0xf038=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x038f[_0x580971];return _0x16d873;};'use strict';var _=require(_0xf038('0x0'));var util=require(_0xf038('0x1'));var moment=require('moment');var BPromise=require(_0xf038('0x2'));var rs=require(_0xf038('0x3'));var fs=require('fs');var Redis=require(_0xf038('0x4'));var db=require(_0xf038('0x5'))['db'];var utils=require(_0xf038('0x6'));var logger=require(_0xf038('0x7'))(_0xf038('0x8'));var config=require(_0xf038('0x9'));var jayson=require(_0xf038('0xa'));var client=jayson['client'][_0xf038('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25923e,_0x1d7647,_0x4bc4c7){return new BPromise(function(_0x1a6bad,_0x3116b5){return client[_0xf038('0xc')](_0x25923e,_0x4bc4c7)['then'](function(_0x46132a){logger[_0xf038('0xd')](_0xf038('0xe'),_0x1d7647,_0xf038('0xf'));logger[_0xf038('0x10')](_0xf038('0x11'),_0x1d7647,_0xf038('0xf'),JSON[_0xf038('0x12')](_0x46132a));if(_0x46132a[_0xf038('0x13')]){if(_0x46132a['error'][_0xf038('0x14')]===0x1f4){logger[_0xf038('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1d7647,_0x46132a[_0xf038('0x13')][_0xf038('0x15')]);return _0x3116b5(_0x46132a[_0xf038('0x13')][_0xf038('0x15')]);}logger['error'](_0xf038('0xe'),_0x1d7647,_0x46132a['error'][_0xf038('0x15')]);return _0x1a6bad(_0x46132a[_0xf038('0x13')]['message']);}else{logger[_0xf038('0xd')](_0xf038('0xe'),_0x1d7647,'request\x20sent');_0x1a6bad(_0x46132a[_0xf038('0x16')]['message']);}})[_0xf038('0x17')](function(_0x5936fb){logger['error'](_0xf038('0xe'),_0x1d7647,_0x5936fb);_0x3116b5(_0x5936fb);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 1a6242a..88bc48e 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9695=['isAuthenticated','index','/:id','show','get','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','%s%s','logo','extname','originalname','post','/:id/logo','file','addLogo','root','server/files/images/logos/','format','single','addLogoLogin','join','preferred','addPreferred','addFavicon','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x444c6e,_0x203666){var _0x45e4ac=function(_0x333a57){while(--_0x333a57){_0x444c6e['push'](_0x444c6e['shift']());}};_0x45e4ac(++_0x203666);}(_0x9695,0x1c5));var _0x5969=function(_0x4c040b,_0x169fab){_0x4c040b=_0x4c040b-0x0;var _0x13fb1e=_0x9695[_0x4c040b];return _0x13fb1e;};'use strict';var multer=require(_0x5969('0x0'));var util=require(_0x5969('0x1'));var path=require('path');var timeout=require(_0x5969('0x2'));var express=require(_0x5969('0x3'));var router=express['Router']();var fs_extra=require(_0x5969('0x4'));var auth=require(_0x5969('0x5'));var interaction=require(_0x5969('0x6'));var config=require(_0x5969('0x7'));var controller=require(_0x5969('0x8'));router['get']('/',auth[_0x5969('0x9')](),controller[_0x5969('0xa')]);router['get']('/now',controller['getDate']);router['get'](_0x5969('0xb'),controller[_0x5969('0xc')]);router[_0x5969('0xd')]('/:id/logo',controller[_0x5969('0xe')]);router[_0x5969('0xd')]('/:id/logo_login',controller[_0x5969('0xf')]);router[_0x5969('0xd')](_0x5969('0x10'),controller[_0x5969('0x11')]);router['get'](_0x5969('0x12'),controller['getPreferred']);router[_0x5969('0xd')](_0x5969('0x13'),controller[_0x5969('0x14')]);var upload=multer({'storage':multer[_0x5969('0x15')]({'destination':function(_0x179107,_0x4c4b29,_0x4c3ced){_0x4c3ced(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0xfdbfd8,_0x51db59,_0xd58a28){_0xd58a28(null,util['format'](_0x5969('0x16'),_0x5969('0x17'),path[_0x5969('0x18')](_0x51db59[_0x5969('0x19')])));}})});router[_0x5969('0x1a')](_0x5969('0x1b'),upload['single'](_0x5969('0x1c')),controller[_0x5969('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c44ab,_0x542984,_0x59fe6e){_0x59fe6e(null,path['join'](config[_0x5969('0x1e')],_0x5969('0x1f')));},'filename':function(_0x2bc0ca,_0x4d2610,_0x390042){_0x390042(null,util[_0x5969('0x20')](_0x5969('0x16'),'logologin',path[_0x5969('0x18')](_0x4d2610[_0x5969('0x19')])));}})});router['post']('/:id/logo_login',upload[_0x5969('0x21')]('file'),controller[_0x5969('0x22')]);var upload=multer({'storage':multer[_0x5969('0x15')]({'destination':function(_0x5b3572,_0x28d1a9,_0x3a4cc0){_0x3a4cc0(null,path[_0x5969('0x23')](config[_0x5969('0x1e')],'server/files/images/logos/'));},'filename':function(_0x4fd6f4,_0x3cbad2,_0x204c37){_0x204c37(null,util['format'](_0x5969('0x16'),_0x5969('0x24'),path['extname'](_0x3cbad2[_0x5969('0x19')])));}})});router[_0x5969('0x1a')](_0x5969('0x12'),upload[_0x5969('0x21')](_0x5969('0x1c')),controller[_0x5969('0x25')]);var upload=multer({'storage':multer[_0x5969('0x15')]({'destination':function(_0x4e1000,_0x5a0efd,_0x59990f){_0x59990f(null,path[_0x5969('0x23')](config[_0x5969('0x1e')],_0x5969('0x1f')));},'filename':function(_0x413c7b,_0x1a6ccb,_0x5f0ac7){_0x5f0ac7(null,util[_0x5969('0x20')]('%s%s','favicon',path['extname'](_0x1a6ccb[_0x5969('0x19')])));}})});router[_0x5969('0x1a')](_0x5969('0x13'),upload[_0x5969('0x21')](_0x5969('0x1c')),controller[_0x5969('0x26')]);router[_0x5969('0x27')](_0x5969('0xb'),auth[_0x5969('0x9')](),controller[_0x5969('0x28')]);module[_0x5969('0x29')]=router; \ No newline at end of file +var _0x285d=['%s%s','logologin','single','addLogoLogin','addPreferred','favicon','/:id/favicon','addFavicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','post','file','addLogo'];(function(_0x58b09b,_0x598169){var _0x20397=function(_0x1e7891){while(--_0x1e7891){_0x58b09b['push'](_0x58b09b['shift']());}};_0x20397(++_0x598169);}(_0x285d,0xb8));var _0xd285=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x285d[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xd285('0x0'));var util=require(_0xd285('0x1'));var path=require(_0xd285('0x2'));var timeout=require(_0xd285('0x3'));var express=require(_0xd285('0x4'));var router=express[_0xd285('0x5')]();var fs_extra=require(_0xd285('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd285('0x7'));var controller=require(_0xd285('0x8'));router[_0xd285('0x9')]('/',auth[_0xd285('0xa')](),controller[_0xd285('0xb')]);router[_0xd285('0x9')](_0xd285('0xc'),controller[_0xd285('0xd')]);router[_0xd285('0x9')]('/:id',controller[_0xd285('0xe')]);router[_0xd285('0x9')](_0xd285('0xf'),controller['getLogo']);router[_0xd285('0x9')](_0xd285('0x10'),controller[_0xd285('0x11')]);router[_0xd285('0x9')]('/:id/gdpr',controller[_0xd285('0x12')]);router[_0xd285('0x9')](_0xd285('0x13'),controller['getPreferred']);router['get']('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0xd285('0x14')]({'destination':function(_0x1c8910,_0x3e1d82,_0x2b949b){_0x2b949b(null,path[_0xd285('0x15')](config[_0xd285('0x16')],_0xd285('0x17')));},'filename':function(_0x92ac6d,_0x44c9e8,_0x53d51b){_0x53d51b(null,util[_0xd285('0x18')]('%s%s',_0xd285('0x19'),path[_0xd285('0x1a')](_0x44c9e8[_0xd285('0x1b')])));}})});router[_0xd285('0x1c')]('/:id/logo',upload['single'](_0xd285('0x1d')),controller[_0xd285('0x1e')]);var upload=multer({'storage':multer[_0xd285('0x14')]({'destination':function(_0x50ff21,_0x2d316b,_0x221e06){_0x221e06(null,path[_0xd285('0x15')](config[_0xd285('0x16')],'server/files/images/logos/'));},'filename':function(_0x39e2ee,_0x132524,_0x2208da){_0x2208da(null,util[_0xd285('0x18')](_0xd285('0x1f'),_0xd285('0x20'),path[_0xd285('0x1a')](_0x132524[_0xd285('0x1b')])));}})});router[_0xd285('0x1c')](_0xd285('0x10'),upload[_0xd285('0x21')](_0xd285('0x1d')),controller[_0xd285('0x22')]);var upload=multer({'storage':multer[_0xd285('0x14')]({'destination':function(_0x88655b,_0x102dd4,_0x2d15f0){_0x2d15f0(null,path[_0xd285('0x15')](config['root'],_0xd285('0x17')));},'filename':function(_0x2cf4c0,_0x34a7d9,_0x404082){_0x404082(null,util[_0xd285('0x18')](_0xd285('0x1f'),'preferred',path['extname'](_0x34a7d9[_0xd285('0x1b')])));}})});router['post']('/:id/preferred',upload['single']('file'),controller[_0xd285('0x23')]);var upload=multer({'storage':multer[_0xd285('0x14')]({'destination':function(_0x57c8fb,_0x4ea93d,_0x19499e){_0x19499e(null,path[_0xd285('0x15')](config[_0xd285('0x16')],_0xd285('0x17')));},'filename':function(_0xd6d03c,_0x376596,_0x155e7a){_0x155e7a(null,util[_0xd285('0x18')](_0xd285('0x1f'),_0xd285('0x24'),path[_0xd285('0x1a')](_0x376596[_0xd285('0x1b')])));}})});router['post'](_0xd285('0x25'),upload[_0xd285('0x21')](_0xd285('0x1d')),controller[_0xd285('0x26')]);router[_0xd285('0x27')](_0xd285('0x28'),auth[_0xd285('0xa')](),controller[_0xd285('0x29')]);module[_0xd285('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9332b82..7ae7df1 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3f7a61,_0x29b5da){var _0x6288c3=function(_0x37b836){while(--_0x37b836){_0x3f7a61['push'](_0x3f7a61['shift']());}};_0x6288c3(++_0x29b5da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x367284,_0x26688c){var _0xe5c015=function(_0x19705e){while(--_0x19705e){_0x367284['push'](_0x367284['shift']());}};_0xe5c015(++_0x26688c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 4f8b073..b92d64d 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed1f=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','client','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x35dd3e,_0x19da96){var _0x2578a3=function(_0x370206){while(--_0x370206){_0x35dd3e['push'](_0x35dd3e['shift']());}};_0x2578a3(++_0x19da96);}(_0xed1f,0x6a));var _0xfed1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xed1f[_0x580647];return _0x5f0792;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfed1('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x529b3d,_0x3f6555,_0x397af9,_0x532537){return new BPromise(function(_0x2dde3a,_0x5b9455){var _0x4cd9d1=_0x532537||client;return _0x4cd9d1[_0xfed1('0x1b')](_0x529b3d,_0x397af9)[_0xfed1('0x1c')](function(_0x1fbb7a){logger[_0xfed1('0x1d')]('Setting,\x20%s,\x20%s',_0x3f6555,_0xfed1('0x1e'));logger['debug'](_0xfed1('0x1f'),_0x3f6555,_0xfed1('0x1e'),JSON['stringify'](_0x1fbb7a));if(_0x1fbb7a[_0xfed1('0x20')]){if(_0x1fbb7a[_0xfed1('0x20')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x3f6555,_0x1fbb7a[_0xfed1('0x20')]['message']);return _0x5b9455(_0x1fbb7a[_0xfed1('0x20')][_0xfed1('0x21')]);}logger['error'](_0xfed1('0x22'),_0x3f6555,_0x1fbb7a[_0xfed1('0x20')]['message']);return _0x2dde3a(_0x1fbb7a[_0xfed1('0x20')][_0xfed1('0x21')]);}else{logger[_0xfed1('0x1d')](_0xfed1('0x22'),_0x3f6555,'request\x20sent');_0x2dde3a(_0x1fbb7a[_0xfed1('0x23')]['message']);}})[_0xfed1('0x24')](function(_0x1317c8){logger[_0xfed1('0x20')]('Setting,\x20%s,\x20%s',_0x3f6555,_0x1317c8);_0x5b9455(_0x1317c8);});});}function respondWithStatusCode(_0x41d22c,_0x594917){_0x594917=_0x594917||0xcc;return function(_0x460555){if(_0x460555){return _0x41d22c[_0xfed1('0x25')](_0x594917);}return _0x41d22c[_0xfed1('0x26')](_0x594917)[_0xfed1('0x27')]();};}function respondWithResult(_0x186ecc,_0x1199b7){_0x1199b7=_0x1199b7||0xc8;return function(_0x527fc7){if(_0x527fc7){return _0x186ecc[_0xfed1('0x26')](_0x1199b7)[_0xfed1('0x28')](_0x527fc7);}};}function respondWithFilteredResult(_0x49072b,_0x1d6c72){return function(_0x2b9dd2){if(_0x2b9dd2){var _0x1b871a=typeof _0x1d6c72[_0xfed1('0x29')]===_0xfed1('0x2a')&&typeof _0x1d6c72[_0xfed1('0x2b')]==='undefined';var _0x4607e9=_0x2b9dd2['count'];var _0x3106ee=_0x1b871a?0x0:_0x1d6c72['offset'];var _0x53b0c9=_0x1b871a?_0x2b9dd2[_0xfed1('0x2c')]:_0x1d6c72[_0xfed1('0x29')]+_0x1d6c72[_0xfed1('0x2b')];var _0x599c23;if(_0x53b0c9>=_0x4607e9){_0x53b0c9=_0x4607e9;_0x599c23=0xc8;}else{_0x599c23=0xce;}_0x49072b[_0xfed1('0x26')](_0x599c23);return _0x49072b[_0xfed1('0x2d')](_0xfed1('0x2e'),_0x3106ee+'-'+_0x53b0c9+'/'+_0x4607e9)[_0xfed1('0x28')](_0x2b9dd2);}return null;};}function patchUpdates(_0x12399f){return function(_0x30272b){try{jsonpatch['apply'](_0x30272b,_0x12399f,!![]);}catch(_0x17e1e7){return BPromise[_0xfed1('0x2f')](_0x17e1e7);}return _0x30272b['save']();};}function saveUpdates(_0x47a90c,_0x28bd98){return function(_0x2d10f5){if(_0x2d10f5){return _0x2d10f5[_0xfed1('0x30')](_0x47a90c)[_0xfed1('0x1c')](function(_0x44c24a){return _0x44c24a;});}return null;};}function removeEntity(_0x57ca74,_0xecd1ec){return function(_0x21b292){if(_0x21b292){return _0x21b292[_0xfed1('0x31')]()[_0xfed1('0x1c')](function(){_0x57ca74[_0xfed1('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1da4b7,_0x4a81be){return function(_0x11c5bd){if(!_0x11c5bd){_0x1da4b7[_0xfed1('0x25')](0x194);}return _0x11c5bd;};}function handleError(_0x17554f,_0x321c1b){_0x321c1b=_0x321c1b||0x1f4;return function(_0x1c0523){logger[_0xfed1('0x20')](_0x1c0523[_0xfed1('0x32')]);if(_0x1c0523[_0xfed1('0x33')]){delete _0x1c0523['name'];}_0x17554f[_0xfed1('0x26')](_0x321c1b)[_0xfed1('0x34')](_0x1c0523);};}exports[_0xfed1('0x35')]=function(_0x28adfc,_0x57da75){var _0x4b1d7b={},_0x42d5df={},_0x3c026d={'count':0x0,'rows':[]};var _0x1d06af=_[_0xfed1('0x36')](db[_0xfed1('0x37')][_0xfed1('0x38')],function(_0x46a150){return{'name':_0x46a150[_0xfed1('0x39')],'type':_0x46a150['type']['key']};});_0x42d5df[_0xfed1('0x3a')]=_[_0xfed1('0x36')](_0x1d06af,'name');_0x42d5df[_0xfed1('0x3b')]=_[_0xfed1('0x3c')](_0x28adfc[_0xfed1('0x3b')]);_0x42d5df[_0xfed1('0x3d')]=_[_0xfed1('0x3e')](_0x42d5df[_0xfed1('0x3a')],_0x42d5df[_0xfed1('0x3b')]);_0x4b1d7b[_0xfed1('0x3f')]=_[_0xfed1('0x3e')](_0x42d5df['model'],qs['fields'](_0x28adfc['query'][_0xfed1('0x40')]));_0x4b1d7b[_0xfed1('0x3f')]=_0x4b1d7b[_0xfed1('0x3f')]['length']?_0x4b1d7b[_0xfed1('0x3f')]:_0x42d5df['model'];if(!_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x41')](_0xfed1('0x42'))){_0x4b1d7b['limit']=qs[_0xfed1('0x2b')](_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x2b')]);_0x4b1d7b['offset']=qs[_0xfed1('0x29')](_0x28adfc['query'][_0xfed1('0x29')]);}_0x4b1d7b[_0xfed1('0x43')]=qs[_0xfed1('0x44')](_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x44')]);_0x4b1d7b[_0xfed1('0x45')]=qs[_0xfed1('0x3d')](_[_0xfed1('0x46')](_0x28adfc[_0xfed1('0x3b')],_0x42d5df['filters']),_0x1d06af);if(_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x47')]){_0x4b1d7b[_0xfed1('0x45')]=_['merge'](_0x4b1d7b['where'],{'$or':_[_0xfed1('0x36')](_0x1d06af,function(_0x45060e){if(_0x45060e[_0xfed1('0x48')]!==_0xfed1('0x49')){var _0x40c096={};_0x40c096[_0x45060e[_0xfed1('0x33')]]={'$like':'%'+_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x47')]+'%'};return _0x40c096;}})});}_0x4b1d7b=_[_0xfed1('0x4a')]({},_0x4b1d7b,_0x28adfc[_0xfed1('0x4b')]);var _0x61f65b={'where':_0x4b1d7b[_0xfed1('0x45')]};return db['Setting'][_0xfed1('0x2c')](_0x61f65b)[_0xfed1('0x1c')](function(_0x280d6e){_0x3c026d[_0xfed1('0x2c')]=_0x280d6e;if(_0x28adfc[_0xfed1('0x3b')][_0xfed1('0x4c')]){_0x4b1d7b['include']=[{'all':!![]}];}return db[_0xfed1('0x37')][_0xfed1('0x4d')](_0x4b1d7b);})[_0xfed1('0x1c')](function(_0x4afcc1){_0x3c026d[_0xfed1('0x4e')]=_0x4afcc1;return _0x3c026d;})[_0xfed1('0x1c')](respondWithFilteredResult(_0x57da75,_0x4b1d7b))[_0xfed1('0x24')](handleError(_0x57da75,null));};exports[_0xfed1('0x4f')]=function(_0x48005b,_0x2e0de7){var _0x2a346e={'raw':![],'where':{'id':_0x48005b[_0xfed1('0x50')]['id']}},_0x2c32af={};_0x2c32af[_0xfed1('0x3a')]=_[_0xfed1('0x3c')](db[_0xfed1('0x37')][_0xfed1('0x38')]);_0x2c32af[_0xfed1('0x3b')]=_[_0xfed1('0x3c')](_0x48005b[_0xfed1('0x3b')]);_0x2c32af[_0xfed1('0x3d')]=_[_0xfed1('0x3e')](_0x2c32af[_0xfed1('0x3a')],_0x2c32af[_0xfed1('0x3b')]);_0x2a346e[_0xfed1('0x3f')]=_[_0xfed1('0x3e')](_0x2c32af[_0xfed1('0x3a')],qs['fields'](_0x48005b['query'][_0xfed1('0x40')]));_0x2a346e[_0xfed1('0x3f')]=_0x2a346e[_0xfed1('0x3f')][_0xfed1('0x51')]?_0x2a346e['attributes']:_0x2c32af[_0xfed1('0x3a')];if(_0x48005b[_0xfed1('0x3b')]['includeAll']){_0x2a346e['include']=[{'all':!![]}];}_0x2a346e=_['merge']({},_0x2a346e,_0x48005b[_0xfed1('0x4b')]);return db[_0xfed1('0x37')][_0xfed1('0x52')](_0x2a346e)[_0xfed1('0x1c')](handleEntityNotFound(_0x2e0de7,null))[_0xfed1('0x1c')](respondWithResult(_0x2e0de7,null))[_0xfed1('0x24')](handleError(_0x2e0de7,null));};exports[_0xfed1('0x30')]=function(_0x144102,_0x116a76){if(_0x144102[_0xfed1('0x53')]['id']){delete _0x144102['body']['id'];}return db['Setting'][_0xfed1('0x52')]({'where':{'id':_0x144102[_0xfed1('0x50')]['id']}})[_0xfed1('0x1c')](handleEntityNotFound(_0x116a76,null))[_0xfed1('0x1c')](saveUpdates(_0x144102[_0xfed1('0x53')],null))[_0xfed1('0x1c')](respondWithResult(_0x116a76,null))[_0xfed1('0x24')](handleError(_0x116a76,null));};exports[_0xfed1('0x54')]=function(_0x117e25,_0x427fa6,_0xbd49dc){if(_0x117e25[_0xfed1('0x55')]&&_0x117e25[_0xfed1('0x55')][_0xfed1('0x56')]){_0x117e25[_0xfed1('0x53')][_0xfed1('0x57')]=_0x117e25[_0xfed1('0x55')]['filename'];}return db['Setting'][_0xfed1('0x52')]({'where':{'id':_0x117e25[_0xfed1('0x50')]['id']}})[_0xfed1('0x1c')](handleEntityNotFound(_0x427fa6,null))[_0xfed1('0x1c')](saveUpdates(_0x117e25[_0xfed1('0x53')],null))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0x24')](handleError(_0x427fa6,null));};exports[_0xfed1('0x58')]=function(_0x25e568,_0x1f2250,_0xab1067){if(_0x25e568[_0xfed1('0x55')]&&_0x25e568[_0xfed1('0x55')][_0xfed1('0x56')]){_0x25e568['body'][_0xfed1('0x59')]=_0x25e568['file']['filename'];}return db[_0xfed1('0x37')]['find']({'where':{'id':_0x25e568[_0xfed1('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f2250,null))[_0xfed1('0x1c')](saveUpdates(_0x25e568[_0xfed1('0x53')],null))['then'](respondWithResult(_0x1f2250,null))[_0xfed1('0x24')](handleError(_0x1f2250,null));};var utilLicense=require(_0xfed1('0x18'));exports['getLogo']=function(_0x29b51e,_0x41b407,_0x1c99c6){var _0x2f37b9='server/files/images/logos';var _0x441792={'custom':![]};return utilLicense[_0xfed1('0x5a')]()[_0xfed1('0x1c')](function(_0x3b9c51){if(_0x3b9c51){_0x441792=_0x3b9c51;}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x29b51e[_0xfed1('0x50')]['id']},'attributes':[_0xfed1('0x57'),'loginLogo',_0xfed1('0x5b'),_0xfed1('0x5c'),_0xfed1('0x5d'),_0xfed1('0x5e'),_0xfed1('0x5f'),_0xfed1('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x41b407,null))['then'](function(_0x55d280){if(_0x55d280){var _0x33a479=_0x55d280[_0xfed1('0x57')]&&fs[_0xfed1('0x61')](path[_0xfed1('0x62')](config['root'],_0x2f37b9,_[_0xfed1('0x63')](_0x55d280['logo'])))?path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x2f37b9,_[_0xfed1('0x63')](_0x55d280[_0xfed1('0x57')])):path[_0xfed1('0x62')](config['root'],_0x2f37b9,_[_0xfed1('0x63')](_0xfed1('0x65')));var _0x20c31f='default'+_[_0xfed1('0x66')](_0xfed1('0x57'));if(_0x55d280[_0x20c31f]||!_0x441792[_0xfed1('0x67')]){_0x33a479=path[_0xfed1('0x62')](config['root'],_0x2f37b9,_[_0xfed1('0x63')]('default_logo.svg'));}if(!fs[_0xfed1('0x61')](_0x33a479)){throw new db[(_0xfed1('0x68'))]['ValidationError'](_['upperFirst'](_0xfed1('0x57'))+_0xfed1('0x69'));}return _0x41b407[_0xfed1('0x6a')](_0x33a479);}})[_0xfed1('0x24')](handleError(_0x41b407,null));};var utilLicense=require('../../config/license/util');exports[_0xfed1('0x6b')]=function(_0x440e40,_0x42bc11,_0x77bb48){var _0x6f174e=_0xfed1('0x6c');var _0x4961a4={'custom':![]};return utilLicense[_0xfed1('0x5a')]()[_0xfed1('0x1c')](function(_0x5ceedd){if(_0x5ceedd){_0x4961a4=_0x5ceedd;}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x440e40[_0xfed1('0x50')]['id']},'attributes':[_0xfed1('0x57'),_0xfed1('0x59'),_0xfed1('0x5b'),'favicon','defaultLogo',_0xfed1('0x5e'),'defaultPreferred',_0xfed1('0x60')],'raw':!![]});})[_0xfed1('0x1c')](handleEntityNotFound(_0x42bc11,null))[_0xfed1('0x1c')](function(_0xdc237c){if(_0xdc237c){var _0x23ee6f=_0xdc237c[_0xfed1('0x59')]&&fs[_0xfed1('0x61')](path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x6f174e,_[_0xfed1('0x63')](_0xdc237c['loginLogo'])))?path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x6f174e,_['toLower'](_0xdc237c['loginLogo'])):path[_0xfed1('0x62')](config['root'],_0x6f174e,_[_0xfed1('0x63')](_0xfed1('0x6d')));var _0x22067d='default'+_[_0xfed1('0x66')](_0xfed1('0x59'));if(_0xdc237c[_0x22067d]||!_0x4961a4[_0xfed1('0x67')]){_0x23ee6f=path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x6f174e,_['toLower'](_0xfed1('0x6d')));}if(!fs[_0xfed1('0x61')](_0x23ee6f)){throw new db[(_0xfed1('0x68'))][(_0xfed1('0x6e'))](_[_0xfed1('0x66')]('loginLogo')+_0xfed1('0x69'));}return _0x42bc11[_0xfed1('0x6a')](_0x23ee6f);}})[_0xfed1('0x24')](handleError(_0x42bc11,null));};exports[_0xfed1('0x6f')]=function(_0x2dcadd,_0x2fe5e9){return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x2dcadd[_0xfed1('0x50')]['id']},'attributes':[_0xfed1('0x70')]})['then'](respondWithResult(_0x2fe5e9,null))[_0xfed1('0x24')](handleError(_0x2fe5e9,null));};exports[_0xfed1('0x71')]=function(_0x248bae,_0x383d34,_0x194f42){if(_0x248bae['file']&&_0x248bae[_0xfed1('0x55')][_0xfed1('0x56')]){_0x248bae[_0xfed1('0x53')][_0xfed1('0x5b')]=_0x248bae[_0xfed1('0x55')][_0xfed1('0x56')];}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x248bae[_0xfed1('0x50')]['id']}})['then'](handleEntityNotFound(_0x383d34,null))['then'](saveUpdates(_0x248bae[_0xfed1('0x53')],null))['then'](respondWithResult(_0x383d34,null))[_0xfed1('0x24')](handleError(_0x383d34,null));};var utilLicense=require(_0xfed1('0x18'));exports[_0xfed1('0x72')]=function(_0x4b355d,_0x5ce292,_0x304cc0){var _0x565dbe=_0xfed1('0x6c');var _0x5c5dd4={'custom':![]};return utilLicense[_0xfed1('0x5a')]()[_0xfed1('0x1c')](function(_0x112ed5){if(_0x112ed5){_0x5c5dd4=_0x112ed5;}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x4b355d['params']['id']},'attributes':[_0xfed1('0x57'),_0xfed1('0x59'),'preferred',_0xfed1('0x5c'),_0xfed1('0x5d'),'defaultLoginLogo',_0xfed1('0x5f'),_0xfed1('0x60')],'raw':!![]});})[_0xfed1('0x1c')](handleEntityNotFound(_0x5ce292,null))['then'](function(_0x473d4a){if(_0x473d4a){var _0x220beb=_0x473d4a['preferred']&&fs[_0xfed1('0x61')](path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x565dbe,_['toLower'](_0x473d4a[_0xfed1('0x5b')])))?path[_0xfed1('0x62')](config['root'],_0x565dbe,_['toLower'](_0x473d4a[_0xfed1('0x5b')])):path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x565dbe,_[_0xfed1('0x63')](_0xfed1('0x73')));var _0x23efe3=_0xfed1('0x74')+_[_0xfed1('0x66')](_0xfed1('0x5b'));if(_0x473d4a[_0x23efe3]||!_0x5c5dd4[_0xfed1('0x67')]||!_0x5c5dd4[_0xfed1('0x5b')]){_0x220beb=path[_0xfed1('0x62')](config['root'],_0x565dbe,_[_0xfed1('0x63')](_0xfed1('0x73')));}if(!fs['existsSync'](_0x220beb)){throw new db[(_0xfed1('0x68'))][(_0xfed1('0x6e'))](_['upperFirst'](_0xfed1('0x5b'))+_0xfed1('0x69'));}return _0x5ce292[_0xfed1('0x6a')](_0x220beb);}})[_0xfed1('0x24')](handleError(_0x5ce292,null));};exports['addFavicon']=function(_0x306b86,_0x24ab18,_0x6a45ec){if(_0x306b86[_0xfed1('0x55')]&&_0x306b86[_0xfed1('0x55')][_0xfed1('0x56')]){_0x306b86[_0xfed1('0x53')][_0xfed1('0x5c')]=_0x306b86['file'][_0xfed1('0x56')];}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x306b86['params']['id']}})[_0xfed1('0x1c')](handleEntityNotFound(_0x24ab18,null))[_0xfed1('0x1c')](saveUpdates(_0x306b86[_0xfed1('0x53')],null))['then'](respondWithResult(_0x24ab18,null))['catch'](handleError(_0x24ab18,null));};var utilLicense=require(_0xfed1('0x18'));exports[_0xfed1('0x75')]=function(_0x37723b,_0x172ce8,_0x374623){var _0x57d8f7=_0xfed1('0x6c');var _0x3fc747={'custom':![]};return utilLicense[_0xfed1('0x5a')]()[_0xfed1('0x1c')](function(_0x96643e){if(_0x96643e){_0x3fc747=_0x96643e;}return db[_0xfed1('0x37')][_0xfed1('0x52')]({'where':{'id':_0x37723b[_0xfed1('0x50')]['id']},'attributes':[_0xfed1('0x57'),_0xfed1('0x59'),_0xfed1('0x5b'),_0xfed1('0x5c'),_0xfed1('0x5d'),_0xfed1('0x5e'),'defaultPreferred',_0xfed1('0x60')],'raw':!![]});})[_0xfed1('0x1c')](handleEntityNotFound(_0x172ce8,null))[_0xfed1('0x1c')](function(_0x548839){if(_0x548839){var _0x23447c=_0x548839[_0xfed1('0x5c')]&&fs[_0xfed1('0x61')](path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x57d8f7,_[_0xfed1('0x63')](_0x548839[_0xfed1('0x5c')])))?path['join'](config['root'],_0x57d8f7,_[_0xfed1('0x63')](_0x548839[_0xfed1('0x5c')])):path[_0xfed1('0x62')](config['root'],_0x57d8f7,_[_0xfed1('0x63')](_0xfed1('0x76')));var _0x1a158b='default'+_[_0xfed1('0x66')](_0xfed1('0x5c'));if(_0x548839[_0x1a158b]||!_0x3fc747[_0xfed1('0x67')]){_0x23447c=path[_0xfed1('0x62')](config[_0xfed1('0x64')],_0x57d8f7,_['toLower']('default_favicon.ico'));}if(!fs[_0xfed1('0x61')](_0x23447c)){throw new db[(_0xfed1('0x68'))]['ValidationError'](_['upperFirst'](_0xfed1('0x5c'))+_0xfed1('0x69'));}return _0x172ce8[_0xfed1('0x6a')](_0x23447c);}})[_0xfed1('0x24')](handleError(_0x172ce8,null));};exports[_0xfed1('0x77')]=function(_0x3d9838,_0x523f67){var _0x16276e={'offset':moment()[_0xfed1('0x78')]()};_0x16276e[_0xfed1('0x79')]=moment()[_0xfed1('0x78')](_0x16276e[_0xfed1('0x29')])['format'](_0xfed1('0x7a'));return _0x523f67['status'](0xc8)[_0xfed1('0x34')](_0x16276e);}; \ No newline at end of file +var _0x0a30=['findAll','rows','show','intersection','include','body','find','params','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','defaultLogo','defaultPreferred','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll'];(function(_0x99fec0,_0x422d3b){var _0x291fa8=function(_0x3150d1){while(--_0x3150d1){_0x99fec0['push'](_0x99fec0['shift']());}};_0x291fa8(++_0x422d3b);}(_0x0a30,0xaa));var _0x00a3=function(_0xbbfa5e,_0x5c4aca){_0xbbfa5e=_0xbbfa5e-0x0;var _0x12c0af=_0x0a30[_0xbbfa5e];return _0x12c0af;};'use strict';var emlformat=require(_0x00a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00a3('0x2'));var moment=require(_0x00a3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x00a3('0x4'));var path=require('path');var sox=require(_0x00a3('0x5'));var csv=require(_0x00a3('0x6'));var ejs=require(_0x00a3('0x7'));var fs=require('fs');var fs_extra=require(_0x00a3('0x8'));var _=require(_0x00a3('0x9'));var squel=require(_0x00a3('0xa'));var crypto=require(_0x00a3('0xb'));var jsforce=require(_0x00a3('0xc'));var deskjs=require(_0x00a3('0xd'));var toCsv=require(_0x00a3('0x6'));var querystring=require(_0x00a3('0xe'));var Papa=require(_0x00a3('0xf'));var Redis=require(_0x00a3('0x10'));var authService=require(_0x00a3('0x11'));var qs=require(_0x00a3('0x12'));var as=require(_0x00a3('0x13'));var hardwareService=require(_0x00a3('0x14'));var logger=require('../../config/logger')(_0x00a3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x00a3('0x16'))['db'];var jayson=require(_0x00a3('0x17'));var client=jayson[_0x00a3('0x18')][_0x00a3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5bf417,_0x39b4ca,_0x5ee60e,_0x4b50d6){return new BPromise(function(_0x4a7a4e,_0x279c9a){var _0x850506=_0x4b50d6||client;return _0x850506[_0x00a3('0x1a')](_0x5bf417,_0x5ee60e)[_0x00a3('0x1b')](function(_0x2e4924){logger[_0x00a3('0x1c')](_0x00a3('0x1d'),_0x39b4ca,_0x00a3('0x1e'));logger[_0x00a3('0x1f')](_0x00a3('0x20'),_0x39b4ca,'request\x20sent',JSON[_0x00a3('0x21')](_0x2e4924));if(_0x2e4924[_0x00a3('0x22')]){if(_0x2e4924[_0x00a3('0x22')][_0x00a3('0x23')]===0x1f4){logger[_0x00a3('0x22')](_0x00a3('0x1d'),_0x39b4ca,_0x2e4924[_0x00a3('0x22')][_0x00a3('0x24')]);return _0x279c9a(_0x2e4924[_0x00a3('0x22')][_0x00a3('0x24')]);}logger['error'](_0x00a3('0x1d'),_0x39b4ca,_0x2e4924[_0x00a3('0x22')][_0x00a3('0x24')]);return _0x4a7a4e(_0x2e4924['error'][_0x00a3('0x24')]);}else{logger[_0x00a3('0x1c')](_0x00a3('0x1d'),_0x39b4ca,_0x00a3('0x1e'));_0x4a7a4e(_0x2e4924[_0x00a3('0x25')][_0x00a3('0x24')]);}})[_0x00a3('0x26')](function(_0x1052a3){logger['error'](_0x00a3('0x1d'),_0x39b4ca,_0x1052a3);_0x279c9a(_0x1052a3);});});}function respondWithStatusCode(_0x2722e9,_0x3b8d2a){_0x3b8d2a=_0x3b8d2a||0xcc;return function(_0x1c777c){if(_0x1c777c){return _0x2722e9[_0x00a3('0x27')](_0x3b8d2a);}return _0x2722e9['status'](_0x3b8d2a)[_0x00a3('0x28')]();};}function respondWithResult(_0x306573,_0xb5ad26){_0xb5ad26=_0xb5ad26||0xc8;return function(_0x341095){if(_0x341095){return _0x306573[_0x00a3('0x29')](_0xb5ad26)[_0x00a3('0x2a')](_0x341095);}};}function respondWithFilteredResult(_0x4c77bd,_0x42d431){return function(_0x191bdc){if(_0x191bdc){var _0x5cbb64=typeof _0x42d431[_0x00a3('0x2b')]==='undefined'&&typeof _0x42d431[_0x00a3('0x2c')]===_0x00a3('0x2d');var _0x27aa37=_0x191bdc[_0x00a3('0x2e')];var _0x4dd0a3=_0x5cbb64?0x0:_0x42d431[_0x00a3('0x2b')];var _0x1d8bd7=_0x5cbb64?_0x191bdc['count']:_0x42d431[_0x00a3('0x2b')]+_0x42d431['limit'];var _0x1adcda;if(_0x1d8bd7>=_0x27aa37){_0x1d8bd7=_0x27aa37;_0x1adcda=0xc8;}else{_0x1adcda=0xce;}_0x4c77bd[_0x00a3('0x29')](_0x1adcda);return _0x4c77bd[_0x00a3('0x2f')]('Content-Range',_0x4dd0a3+'-'+_0x1d8bd7+'/'+_0x27aa37)[_0x00a3('0x2a')](_0x191bdc);}return null;};}function patchUpdates(_0x139b85){return function(_0x2a710d){try{jsonpatch[_0x00a3('0x30')](_0x2a710d,_0x139b85,!![]);}catch(_0x3bde78){return BPromise[_0x00a3('0x31')](_0x3bde78);}return _0x2a710d[_0x00a3('0x32')]();};}function saveUpdates(_0x31c00f,_0x3955d2){return function(_0x227a7f){if(_0x227a7f){return _0x227a7f[_0x00a3('0x33')](_0x31c00f)[_0x00a3('0x1b')](function(_0x2b8532){return _0x2b8532;});}return null;};}function removeEntity(_0x21fa19,_0xd2ca9c){return function(_0x9e1d07){if(_0x9e1d07){return _0x9e1d07[_0x00a3('0x34')]()[_0x00a3('0x1b')](function(){_0x21fa19[_0x00a3('0x29')](0xcc)[_0x00a3('0x28')]();});}};}function handleEntityNotFound(_0x4b70da,_0x4e2756){return function(_0x471dad){if(!_0x471dad){_0x4b70da[_0x00a3('0x27')](0x194);}return _0x471dad;};}function handleError(_0x2d2e70,_0x1247e1){_0x1247e1=_0x1247e1||0x1f4;return function(_0x24b56f){logger[_0x00a3('0x22')](_0x24b56f[_0x00a3('0x35')]);if(_0x24b56f[_0x00a3('0x36')]){delete _0x24b56f[_0x00a3('0x36')];}_0x2d2e70['status'](_0x1247e1)[_0x00a3('0x37')](_0x24b56f);};}exports[_0x00a3('0x38')]=function(_0x544677,_0x158a6d){var _0x5cc103={},_0x503267={},_0x468c3b={'count':0x0,'rows':[]};var _0x3b2951=_[_0x00a3('0x39')](db[_0x00a3('0x3a')][_0x00a3('0x3b')],function(_0x54c64e){return{'name':_0x54c64e[_0x00a3('0x3c')],'type':_0x54c64e[_0x00a3('0x3d')][_0x00a3('0x3e')]};});_0x503267[_0x00a3('0x3f')]=_['map'](_0x3b2951,_0x00a3('0x36'));_0x503267[_0x00a3('0x40')]=_[_0x00a3('0x41')](_0x544677[_0x00a3('0x40')]);_0x503267[_0x00a3('0x42')]=_['intersection'](_0x503267[_0x00a3('0x3f')],_0x503267[_0x00a3('0x40')]);_0x5cc103[_0x00a3('0x43')]=_['intersection'](_0x503267[_0x00a3('0x3f')],qs[_0x00a3('0x44')](_0x544677['query'][_0x00a3('0x44')]));_0x5cc103[_0x00a3('0x43')]=_0x5cc103[_0x00a3('0x43')][_0x00a3('0x45')]?_0x5cc103['attributes']:_0x503267[_0x00a3('0x3f')];if(!_0x544677[_0x00a3('0x40')]['hasOwnProperty'](_0x00a3('0x46'))){_0x5cc103[_0x00a3('0x2c')]=qs[_0x00a3('0x2c')](_0x544677[_0x00a3('0x40')][_0x00a3('0x2c')]);_0x5cc103[_0x00a3('0x2b')]=qs[_0x00a3('0x2b')](_0x544677[_0x00a3('0x40')][_0x00a3('0x2b')]);}_0x5cc103['order']=qs[_0x00a3('0x47')](_0x544677[_0x00a3('0x40')][_0x00a3('0x47')]);_0x5cc103[_0x00a3('0x48')]=qs[_0x00a3('0x42')](_[_0x00a3('0x49')](_0x544677[_0x00a3('0x40')],_0x503267[_0x00a3('0x42')]),_0x3b2951);if(_0x544677[_0x00a3('0x40')]['filter']){_0x5cc103['where']=_[_0x00a3('0x4a')](_0x5cc103[_0x00a3('0x48')],{'$or':_[_0x00a3('0x39')](_0x3b2951,function(_0x413dc0){if(_0x413dc0[_0x00a3('0x3d')]!=='VIRTUAL'){var _0x503302={};_0x503302[_0x413dc0['name']]={'$like':'%'+_0x544677['query'][_0x00a3('0x4b')]+'%'};return _0x503302;}})});}_0x5cc103=_[_0x00a3('0x4a')]({},_0x5cc103,_0x544677[_0x00a3('0x4c')]);var _0x58e9cf={'where':_0x5cc103[_0x00a3('0x48')]};return db[_0x00a3('0x3a')][_0x00a3('0x2e')](_0x58e9cf)[_0x00a3('0x1b')](function(_0x46c9a7){_0x468c3b[_0x00a3('0x2e')]=_0x46c9a7;if(_0x544677['query'][_0x00a3('0x4d')]){_0x5cc103['include']=[{'all':!![]}];}return db[_0x00a3('0x3a')][_0x00a3('0x4e')](_0x5cc103);})['then'](function(_0x2afe60){_0x468c3b[_0x00a3('0x4f')]=_0x2afe60;return _0x468c3b;})[_0x00a3('0x1b')](respondWithFilteredResult(_0x158a6d,_0x5cc103))[_0x00a3('0x26')](handleError(_0x158a6d,null));};exports[_0x00a3('0x50')]=function(_0x4932f5,_0x29566b){var _0x5d304d={'raw':![],'where':{'id':_0x4932f5['params']['id']}},_0x5d8494={};_0x5d8494[_0x00a3('0x3f')]=_[_0x00a3('0x41')](db['Setting']['rawAttributes']);_0x5d8494[_0x00a3('0x40')]=_[_0x00a3('0x41')](_0x4932f5[_0x00a3('0x40')]);_0x5d8494[_0x00a3('0x42')]=_[_0x00a3('0x51')](_0x5d8494[_0x00a3('0x3f')],_0x5d8494[_0x00a3('0x40')]);_0x5d304d['attributes']=_[_0x00a3('0x51')](_0x5d8494['model'],qs[_0x00a3('0x44')](_0x4932f5[_0x00a3('0x40')][_0x00a3('0x44')]));_0x5d304d[_0x00a3('0x43')]=_0x5d304d[_0x00a3('0x43')][_0x00a3('0x45')]?_0x5d304d['attributes']:_0x5d8494[_0x00a3('0x3f')];if(_0x4932f5[_0x00a3('0x40')][_0x00a3('0x4d')]){_0x5d304d[_0x00a3('0x52')]=[{'all':!![]}];}_0x5d304d=_[_0x00a3('0x4a')]({},_0x5d304d,_0x4932f5[_0x00a3('0x4c')]);return db[_0x00a3('0x3a')]['find'](_0x5d304d)[_0x00a3('0x1b')](handleEntityNotFound(_0x29566b,null))[_0x00a3('0x1b')](respondWithResult(_0x29566b,null))['catch'](handleError(_0x29566b,null));};exports[_0x00a3('0x33')]=function(_0x4a0868,_0x577fd3){if(_0x4a0868[_0x00a3('0x53')]['id']){delete _0x4a0868[_0x00a3('0x53')]['id'];}return db['Setting'][_0x00a3('0x54')]({'where':{'id':_0x4a0868[_0x00a3('0x55')]['id']}})['then'](handleEntityNotFound(_0x577fd3,null))[_0x00a3('0x1b')](saveUpdates(_0x4a0868[_0x00a3('0x53')],null))[_0x00a3('0x1b')](respondWithResult(_0x577fd3,null))[_0x00a3('0x26')](handleError(_0x577fd3,null));};exports['addLogo']=function(_0x3138d1,_0x1744d1,_0xb6967c){if(_0x3138d1[_0x00a3('0x56')]&&_0x3138d1['file'][_0x00a3('0x57')]){_0x3138d1['body'][_0x00a3('0x58')]=_0x3138d1[_0x00a3('0x56')]['filename'];}return db['Setting'][_0x00a3('0x54')]({'where':{'id':_0x3138d1[_0x00a3('0x55')]['id']}})[_0x00a3('0x1b')](handleEntityNotFound(_0x1744d1,null))[_0x00a3('0x1b')](saveUpdates(_0x3138d1[_0x00a3('0x53')],null))[_0x00a3('0x1b')](respondWithResult(_0x1744d1,null))[_0x00a3('0x26')](handleError(_0x1744d1,null));};exports[_0x00a3('0x59')]=function(_0xb39451,_0x391b68,_0x114c0b){if(_0xb39451[_0x00a3('0x56')]&&_0xb39451['file'][_0x00a3('0x57')]){_0xb39451[_0x00a3('0x53')][_0x00a3('0x5a')]=_0xb39451[_0x00a3('0x56')][_0x00a3('0x57')];}return db[_0x00a3('0x3a')][_0x00a3('0x54')]({'where':{'id':_0xb39451[_0x00a3('0x55')]['id']}})[_0x00a3('0x1b')](handleEntityNotFound(_0x391b68,null))[_0x00a3('0x1b')](saveUpdates(_0xb39451[_0x00a3('0x53')],null))[_0x00a3('0x1b')](respondWithResult(_0x391b68,null))[_0x00a3('0x26')](handleError(_0x391b68,null));};var utilLicense=require(_0x00a3('0x5b'));exports[_0x00a3('0x5c')]=function(_0x514186,_0x2ea706,_0x41f4fc){var _0x3a0376='server/files/images/logos';var _0x5a0e44={'custom':![]};return utilLicense[_0x00a3('0x5d')]()['then'](function(_0x2d08f4){if(_0x2d08f4){_0x5a0e44=_0x2d08f4;}return db[_0x00a3('0x3a')][_0x00a3('0x54')]({'where':{'id':_0x514186[_0x00a3('0x55')]['id']},'attributes':[_0x00a3('0x58'),'loginLogo',_0x00a3('0x5e'),_0x00a3('0x5f'),'defaultLogo',_0x00a3('0x60'),'defaultPreferred',_0x00a3('0x61')],'raw':!![]});})[_0x00a3('0x1b')](handleEntityNotFound(_0x2ea706,null))['then'](function(_0x5542c2){if(_0x5542c2){var _0x2ca456=_0x5542c2['logo']&&fs[_0x00a3('0x62')](path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3a0376,_[_0x00a3('0x65')](_0x5542c2['logo'])))?path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3a0376,_[_0x00a3('0x65')](_0x5542c2['logo'])):path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3a0376,_[_0x00a3('0x65')]('default_logo.svg'));var _0x3f52ef=_0x00a3('0x66')+_[_0x00a3('0x67')]('logo');if(_0x5542c2[_0x3f52ef]||!_0x5a0e44[_0x00a3('0x68')]){_0x2ca456=path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3a0376,_[_0x00a3('0x65')]('default_logo.svg'));}if(!fs[_0x00a3('0x62')](_0x2ca456)){throw new db[(_0x00a3('0x69'))][(_0x00a3('0x6a'))](_[_0x00a3('0x67')](_0x00a3('0x58'))+_0x00a3('0x6b'));}return _0x2ea706[_0x00a3('0x6c')](_0x2ca456);}})[_0x00a3('0x26')](handleError(_0x2ea706,null));};var utilLicense=require(_0x00a3('0x5b'));exports['getLogoLogin']=function(_0x198cc6,_0x3e4bb2,_0x501dae){var _0x1e1a0b=_0x00a3('0x6d');var _0x24891d={'custom':![]};return utilLicense[_0x00a3('0x5d')]()[_0x00a3('0x1b')](function(_0x2680ae){if(_0x2680ae){_0x24891d=_0x2680ae;}return db[_0x00a3('0x3a')][_0x00a3('0x54')]({'where':{'id':_0x198cc6['params']['id']},'attributes':[_0x00a3('0x58'),_0x00a3('0x5a'),'preferred',_0x00a3('0x5f'),_0x00a3('0x6e'),_0x00a3('0x60'),_0x00a3('0x6f'),_0x00a3('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x3e4bb2,null))[_0x00a3('0x1b')](function(_0xb6667e){if(_0xb6667e){var _0x111eca=_0xb6667e[_0x00a3('0x5a')]&&fs['existsSync'](path[_0x00a3('0x63')](config['root'],_0x1e1a0b,_['toLower'](_0xb6667e['loginLogo'])))?path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x1e1a0b,_[_0x00a3('0x65')](_0xb6667e[_0x00a3('0x5a')])):path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x1e1a0b,_['toLower'](_0x00a3('0x70')));var _0x4308b9='default'+_[_0x00a3('0x67')](_0x00a3('0x5a'));if(_0xb6667e[_0x4308b9]||!_0x24891d[_0x00a3('0x68')]){_0x111eca=path['join'](config['root'],_0x1e1a0b,_[_0x00a3('0x65')](_0x00a3('0x70')));}if(!fs[_0x00a3('0x62')](_0x111eca)){throw new db['Sequelize'][(_0x00a3('0x6a'))](_['upperFirst'](_0x00a3('0x5a'))+'\x20not\x20found');}return _0x3e4bb2[_0x00a3('0x6c')](_0x111eca);}})[_0x00a3('0x26')](handleError(_0x3e4bb2,null));};exports['gdpr']=function(_0x486fdc,_0x165451){return db[_0x00a3('0x3a')]['find']({'where':{'id':_0x486fdc[_0x00a3('0x55')]['id']},'attributes':[_0x00a3('0x71')]})['then'](respondWithResult(_0x165451,null))['catch'](handleError(_0x165451,null));};exports[_0x00a3('0x72')]=function(_0x1ab41a,_0x50b147,_0x248d83){if(_0x1ab41a[_0x00a3('0x56')]&&_0x1ab41a['file']['filename']){_0x1ab41a['body'][_0x00a3('0x5e')]=_0x1ab41a[_0x00a3('0x56')][_0x00a3('0x57')];}return db['Setting'][_0x00a3('0x54')]({'where':{'id':_0x1ab41a['params']['id']}})[_0x00a3('0x1b')](handleEntityNotFound(_0x50b147,null))[_0x00a3('0x1b')](saveUpdates(_0x1ab41a[_0x00a3('0x53')],null))[_0x00a3('0x1b')](respondWithResult(_0x50b147,null))[_0x00a3('0x26')](handleError(_0x50b147,null));};var utilLicense=require(_0x00a3('0x5b'));exports[_0x00a3('0x73')]=function(_0x20bcb0,_0x366ca1,_0x30d11c){var _0x3ece3a=_0x00a3('0x6d');var _0x2d8e16={'custom':![]};return utilLicense[_0x00a3('0x5d')]()[_0x00a3('0x1b')](function(_0x455f31){if(_0x455f31){_0x2d8e16=_0x455f31;}return db[_0x00a3('0x3a')][_0x00a3('0x54')]({'where':{'id':_0x20bcb0[_0x00a3('0x55')]['id']},'attributes':[_0x00a3('0x58'),_0x00a3('0x5a'),_0x00a3('0x5e'),_0x00a3('0x5f'),'defaultLogo',_0x00a3('0x60'),_0x00a3('0x6f'),_0x00a3('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x366ca1,null))[_0x00a3('0x1b')](function(_0x3e5fb3){if(_0x3e5fb3){var _0x67e258=_0x3e5fb3[_0x00a3('0x5e')]&&fs['existsSync'](path['join'](config['root'],_0x3ece3a,_[_0x00a3('0x65')](_0x3e5fb3[_0x00a3('0x5e')])))?path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3ece3a,_['toLower'](_0x3e5fb3['preferred'])):path[_0x00a3('0x63')](config[_0x00a3('0x64')],_0x3ece3a,_[_0x00a3('0x65')]('default_preferred.png'));var _0x2221e8='default'+_[_0x00a3('0x67')]('preferred');if(_0x3e5fb3[_0x2221e8]||!_0x2d8e16[_0x00a3('0x68')]||!_0x2d8e16['preferred']){_0x67e258=path['join'](config[_0x00a3('0x64')],_0x3ece3a,_[_0x00a3('0x65')](_0x00a3('0x74')));}if(!fs['existsSync'](_0x67e258)){throw new db[(_0x00a3('0x69'))][(_0x00a3('0x6a'))](_[_0x00a3('0x67')](_0x00a3('0x5e'))+_0x00a3('0x6b'));}return _0x366ca1['download'](_0x67e258);}})[_0x00a3('0x26')](handleError(_0x366ca1,null));};exports[_0x00a3('0x75')]=function(_0x3bf5fe,_0x13e437,_0x37a26a){if(_0x3bf5fe[_0x00a3('0x56')]&&_0x3bf5fe[_0x00a3('0x56')][_0x00a3('0x57')]){_0x3bf5fe[_0x00a3('0x53')][_0x00a3('0x5f')]=_0x3bf5fe['file']['filename'];}return db[_0x00a3('0x3a')][_0x00a3('0x54')]({'where':{'id':_0x3bf5fe[_0x00a3('0x55')]['id']}})[_0x00a3('0x1b')](handleEntityNotFound(_0x13e437,null))[_0x00a3('0x1b')](saveUpdates(_0x3bf5fe[_0x00a3('0x53')],null))[_0x00a3('0x1b')](respondWithResult(_0x13e437,null))[_0x00a3('0x26')](handleError(_0x13e437,null));};var utilLicense=require(_0x00a3('0x5b'));exports[_0x00a3('0x76')]=function(_0x182bc3,_0x1bfc0e,_0x1dc051){var _0x1198ae=_0x00a3('0x6d');var _0xeabe99={'custom':![]};return utilLicense[_0x00a3('0x5d')]()['then'](function(_0x29cd56){if(_0x29cd56){_0xeabe99=_0x29cd56;}return db['Setting'][_0x00a3('0x54')]({'where':{'id':_0x182bc3[_0x00a3('0x55')]['id']},'attributes':[_0x00a3('0x58'),_0x00a3('0x5a'),_0x00a3('0x5e'),_0x00a3('0x5f'),'defaultLogo',_0x00a3('0x60'),_0x00a3('0x6f'),_0x00a3('0x61')],'raw':!![]});})[_0x00a3('0x1b')](handleEntityNotFound(_0x1bfc0e,null))[_0x00a3('0x1b')](function(_0x3e9a87){if(_0x3e9a87){var _0x47c249=_0x3e9a87[_0x00a3('0x5f')]&&fs[_0x00a3('0x62')](path[_0x00a3('0x63')](config['root'],_0x1198ae,_[_0x00a3('0x65')](_0x3e9a87[_0x00a3('0x5f')])))?path['join'](config[_0x00a3('0x64')],_0x1198ae,_[_0x00a3('0x65')](_0x3e9a87[_0x00a3('0x5f')])):path['join'](config[_0x00a3('0x64')],_0x1198ae,_['toLower'](_0x00a3('0x77')));var _0x29acfc=_0x00a3('0x66')+_['upperFirst']('favicon');if(_0x3e9a87[_0x29acfc]||!_0xeabe99[_0x00a3('0x68')]){_0x47c249=path[_0x00a3('0x63')](config['root'],_0x1198ae,_[_0x00a3('0x65')](_0x00a3('0x77')));}if(!fs[_0x00a3('0x62')](_0x47c249)){throw new db[(_0x00a3('0x69'))]['ValidationError'](_['upperFirst'](_0x00a3('0x5f'))+_0x00a3('0x6b'));}return _0x1bfc0e[_0x00a3('0x6c')](_0x47c249);}})['catch'](handleError(_0x1bfc0e,null));};exports[_0x00a3('0x78')]=function(_0x4e60e5,_0x5ea35c){var _0x96f27={'offset':moment()[_0x00a3('0x79')]()};_0x96f27[_0x00a3('0x7a')]=moment()[_0x00a3('0x79')](_0x96f27[_0x00a3('0x2b')])[_0x00a3('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x5ea35c['status'](0xc8)[_0x00a3('0x37')](_0x96f27);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 22a948c..506a9e2 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x475d62,_0x3351fe){var _0x1670ea=function(_0x4342c3){while(--_0x4342c3){_0x475d62['push'](_0x475d62['shift']());}};_0x1670ea(++_0x3351fe);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b10d3,_0x130036){_0x3b10d3=_0x3b10d3-0x0;var _0xeb085b=_0xedd9[_0x3b10d3];return _0xeb085b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x55ca,0x126));var _0xa55c=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0x55ca[_0x97c6ea];return _0x2d7f50;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 8ef2f52..e88ecf9 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x519d=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','lodash','util','moment'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x519d,0x71));var _0xd519=function(_0x5f2108,_0x2e2cd5){_0x5f2108=_0x5f2108-0x0;var _0x10ef49=_0x519d[_0x5f2108];return _0x10ef49;};'use strict';var _=require(_0xd519('0x0'));var util=require(_0xd519('0x1'));var moment=require(_0xd519('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd519('0x3'));var db=require(_0xd519('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd519('0x5'));var config=require('../../config/environment');var jayson=require(_0xd519('0x6'));var client=jayson[_0xd519('0x7')][_0xd519('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59fa8a,_0x408791,_0x5a0f52){return new BPromise(function(_0x2aa817,_0x3a077d){return client[_0xd519('0x9')](_0x59fa8a,_0x5a0f52)[_0xd519('0xa')](function(_0x202e43){logger[_0xd519('0xb')](_0xd519('0xc'),_0x408791,_0xd519('0xd'));logger[_0xd519('0xe')](_0xd519('0xf'),_0x408791,_0xd519('0xd'),JSON[_0xd519('0x10')](_0x202e43));if(_0x202e43[_0xd519('0x11')]){if(_0x202e43[_0xd519('0x11')]['code']===0x1f4){logger[_0xd519('0x11')](_0xd519('0xc'),_0x408791,_0x202e43[_0xd519('0x11')]['message']);return _0x3a077d(_0x202e43['error'][_0xd519('0x12')]);}logger[_0xd519('0x11')](_0xd519('0xc'),_0x408791,_0x202e43[_0xd519('0x11')]['message']);return _0x2aa817(_0x202e43[_0xd519('0x11')][_0xd519('0x12')]);}else{logger[_0xd519('0xb')]('Setting,\x20%s,\x20%s',_0x408791,'request\x20sent');_0x2aa817(_0x202e43['result'][_0xd519('0x12')]);}})[_0xd519('0x13')](function(_0x1a302d){logger[_0xd519('0x11')](_0xd519('0xc'),_0x408791,_0x1a302d);_0x3a077d(_0x1a302d);});});}exports[_0xd519('0x14')]=function(_0x54e020){var _0x4718b1=this;return new Promise(function(_0x56f1ef,_0xb719ec){return db[_0xd519('0x15')]['find']({'raw':_0x54e020[_0xd519('0x16')]?_0x54e020['options'][_0xd519('0x17')]===undefined?!![]:![]:!![],'where':_0x54e020['options']?_0x54e020[_0xd519('0x16')][_0xd519('0x18')]||null:null,'attributes':_0x54e020[_0xd519('0x16')]?_0x54e020[_0xd519('0x16')][_0xd519('0x19')]||null:null,'include':_0x54e020['options']?_0x54e020[_0xd519('0x16')][_0xd519('0x1a')]?_[_0xd519('0x1b')](_0x54e020['options'][_0xd519('0x1a')],function(_0x3a9c31){return{'model':db[_0x3a9c31[_0xd519('0x1c')]],'as':_0x3a9c31['as'],'attributes':_0x3a9c31[_0xd519('0x19')],'include':_0x3a9c31['include']?_[_0xd519('0x1b')](_0x3a9c31[_0xd519('0x1a')],function(_0x32c5af){return{'model':db[_0x32c5af['model']],'as':_0x32c5af['as'],'attributes':_0x32c5af[_0xd519('0x19')],'include':_0x32c5af[_0xd519('0x1a')]?_[_0xd519('0x1b')](_0x32c5af[_0xd519('0x1a')],function(_0x2914c2){return{'model':db[_0x2914c2['model']],'as':_0x2914c2['as'],'attributes':_0x2914c2[_0xd519('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cabbe){logger['info'](_0xd519('0x14'),_0x54e020);logger[_0xd519('0xe')](_0xd519('0x14'),_0x54e020,JSON[_0xd519('0x10')](_0x2cabbe));_0x56f1ef(_0x2cabbe);})[_0xd519('0x13')](function(_0x946356){logger[_0xd519('0x11')](_0xd519('0x14'),_0x946356['message'],_0x54e020);_0xb719ec(_0x4718b1[_0xd519('0x11')](0x1f4,_0x946356[_0xd519('0x12')]));});});}; \ No newline at end of file +var _0x555b=['raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','find','options'];(function(_0x43c8de,_0x4ac946){var _0x17430a=function(_0x3b0199){while(--_0x3b0199){_0x43c8de['push'](_0x43c8de['shift']());}};_0x17430a(++_0x4ac946);}(_0x555b,0xe6));var _0xb555=function(_0x3811b3,_0x40c830){_0x3811b3=_0x3811b3-0x0;var _0x124c2c=_0x555b[_0x3811b3];return _0x124c2c;};'use strict';var _=require('lodash');var util=require(_0xb555('0x0'));var moment=require(_0xb555('0x1'));var BPromise=require(_0xb555('0x2'));var rs=require(_0xb555('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb555('0x4'));var logger=require(_0xb555('0x5'))('rpc');var config=require(_0xb555('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb555('0x7')][_0xb555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5be248,_0x1dd266,_0x26b047){return new BPromise(function(_0x579587,_0x2f962c){return client[_0xb555('0x9')](_0x5be248,_0x26b047)[_0xb555('0xa')](function(_0x4f5486){logger['info'](_0xb555('0xb'),_0x1dd266,_0xb555('0xc'));logger[_0xb555('0xd')](_0xb555('0xe'),_0x1dd266,_0xb555('0xc'),JSON[_0xb555('0xf')](_0x4f5486));if(_0x4f5486[_0xb555('0x10')]){if(_0x4f5486[_0xb555('0x10')][_0xb555('0x11')]===0x1f4){logger[_0xb555('0x10')](_0xb555('0xb'),_0x1dd266,_0x4f5486['error'][_0xb555('0x12')]);return _0x2f962c(_0x4f5486[_0xb555('0x10')][_0xb555('0x12')]);}logger[_0xb555('0x10')](_0xb555('0xb'),_0x1dd266,_0x4f5486[_0xb555('0x10')][_0xb555('0x12')]);return _0x579587(_0x4f5486[_0xb555('0x10')][_0xb555('0x12')]);}else{logger[_0xb555('0x13')](_0xb555('0xb'),_0x1dd266,'request\x20sent');_0x579587(_0x4f5486[_0xb555('0x14')][_0xb555('0x12')]);}})[_0xb555('0x15')](function(_0xbc6ef6){logger['error']('Setting,\x20%s,\x20%s',_0x1dd266,_0xbc6ef6);_0x2f962c(_0xbc6ef6);});});}exports[_0xb555('0x16')]=function(_0x27743e){var _0x53367c=this;return new Promise(function(_0x563866,_0x4001d4){return db[_0xb555('0x17')][_0xb555('0x18')]({'raw':_0x27743e['options']?_0x27743e[_0xb555('0x19')][_0xb555('0x1a')]===undefined?!![]:![]:!![],'where':_0x27743e['options']?_0x27743e[_0xb555('0x19')][_0xb555('0x1b')]||null:null,'attributes':_0x27743e['options']?_0x27743e['options'][_0xb555('0x1c')]||null:null,'include':_0x27743e[_0xb555('0x19')]?_0x27743e['options'][_0xb555('0x1d')]?_[_0xb555('0x1e')](_0x27743e['options']['include'],function(_0x2e75ad){return{'model':db[_0x2e75ad[_0xb555('0x1f')]],'as':_0x2e75ad['as'],'attributes':_0x2e75ad['attributes'],'include':_0x2e75ad[_0xb555('0x1d')]?_[_0xb555('0x1e')](_0x2e75ad['include'],function(_0x489d0c){return{'model':db[_0x489d0c[_0xb555('0x1f')]],'as':_0x489d0c['as'],'attributes':_0x489d0c[_0xb555('0x1c')],'include':_0x489d0c[_0xb555('0x1d')]?_[_0xb555('0x1e')](_0x489d0c['include'],function(_0xcaf0f5){return{'model':db[_0xcaf0f5[_0xb555('0x1f')]],'as':_0xcaf0f5['as'],'attributes':_0xcaf0f5[_0xb555('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb555('0xa')](function(_0x321bcf){logger[_0xb555('0x13')](_0xb555('0x16'),_0x27743e);logger['debug'](_0xb555('0x16'),_0x27743e,JSON[_0xb555('0xf')](_0x321bcf));_0x563866(_0x321bcf);})[_0xb555('0x15')](function(_0x1abc44){logger[_0xb555('0x10')](_0xb555('0x16'),_0x1abc44[_0xb555('0x12')],_0x27743e);_0x4001d4(_0x53367c[_0xb555('0x10')](0x1f4,_0x1abc44[_0xb555('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 81a9cb4..3a76991 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0xad0aaa,_0x4943c8){var _0x168b18=function(_0x6e6e35){while(--_0x6e6e35){_0xad0aaa['push'](_0xad0aaa['shift']());}};_0x168b18(++_0x4943c8);}(_0x326f,0xd1));var _0xf326=function(_0x1930bb,_0x343f2c){_0x1930bb=_0x1930bb-0x0;var _0xe2f75d=_0x326f[_0x1930bb];return _0xe2f75d;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1643cb,_0x8af3cc){var _0x2d1147=function(_0x556e53){while(--_0x556e53){_0x1643cb['push'](_0x1643cb['shift']());}};_0x2d1147(++_0x8af3cc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 332e1bf..740eeb2 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63a3=['ENUM','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x63a3,0x1b4));var _0x363a=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x63a3[_0x3d4876];return _0x58ca9d;};'use strict';var Sequelize=require(_0x363a('0x0'));var rs=require(_0x363a('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x363a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x363a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x363a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x363a('0x3')],'defaultValue':function(){return rs[_0x363a('0x4')]();}},'phone':{'type':Sequelize[_0x363a('0x3')]},'type':{'type':Sequelize[_0x363a('0x5')]('twilio',_0x363a('0x6'),_0x363a('0x7'),_0x363a('0x8'),'plivo',_0x363a('0x9'),_0x363a('0xa'),_0x363a('0xb'),_0x363a('0xc'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x363a('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x363a('0x3')]},'apiKey':{'type':Sequelize[_0x363a('0x3')]},'applicationId':{'type':Sequelize[_0x363a('0x3')]},'accountId':{'type':Sequelize[_0x363a('0x3')]},'senderString':{'type':Sequelize[_0x363a('0x3')]},'deliveryReport':{'type':Sequelize[_0x363a('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x363a('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x363a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x363a('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x363a('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x363a('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x363a('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x363a('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x363a('0xf')],'comment':_0x363a('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x363a('0xd')],'defaultValue':![],'comment':_0x363a('0x11'),'set':function(_0x382eb3){if(!_0x382eb3)this[_0x363a('0x12')](_0x363a('0x13'),null);this[_0x363a('0x12')](_0x363a('0x14'),_0x382eb3);}}}; \ No newline at end of file +var _0xa0ac=['clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','skebby','connectel'];(function(_0x1d05ef,_0x1df6a8){var _0x1436eb=function(_0x49b1ec){while(--_0x49b1ec){_0x1d05ef['push'](_0x1d05ef['shift']());}};_0x1436eb(++_0x1df6a8);}(_0xa0ac,0x66));var _0xca0a=function(_0x256c8d,_0x51114a){_0x256c8d=_0x256c8d-0x0;var _0xaa70bd=_0xa0ac[_0x256c8d];return _0xaa70bd;};'use strict';var Sequelize=require(_0xca0a('0x0'));var rs=require(_0xca0a('0x1'));module[_0xca0a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xca0a('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xca0a('0x3')],'defaultValue':function(){return rs[_0xca0a('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xca0a('0x5')]('twilio',_0xca0a('0x6'),_0xca0a('0x7'),_0xca0a('0x8'),_0xca0a('0x9'),_0xca0a('0xa'),_0xca0a('0xb'),_0xca0a('0xc'),_0xca0a('0xd'),_0xca0a('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xca0a('0x3')]},'authToken':{'type':Sequelize[_0xca0a('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xca0a('0x3')]},'password':{'type':Sequelize[_0xca0a('0x3')]},'apiKey':{'type':Sequelize[_0xca0a('0x3')]},'applicationId':{'type':Sequelize[_0xca0a('0x3')]},'accountId':{'type':Sequelize[_0xca0a('0x3')]},'senderString':{'type':Sequelize[_0xca0a('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xca0a('0x3')]},'notificationTemplate':{'type':Sequelize[_0xca0a('0xf')],'defaultValue':function(){return _0xca0a('0x10');}},'notificationSound':{'type':Sequelize[_0xca0a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca0a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca0a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca0a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca0a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xca0a('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca0a('0x12')],'comment':_0xca0a('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xca0a('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x161005){if(!_0x161005)this[_0xca0a('0x14')]('mandatoryDispositionPauseId',null);this[_0xca0a('0x14')](_0xca0a('0x15'),_0x161005);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4df91c4..685c3b2 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfffd=['update','get','SmsAccounts','UserProfileResource','destroy','then','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','include','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','account','type','twilio','From','Body','MessageSid','skebby','from','sender','text','connectel','clicksend','messageId','message_id','Text','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','DESC','list','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','agent','waitForTheAssignedAgent','Start','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','user','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./smsAccount.socket','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x4c2a3d,_0x5b62f0){var _0x256287=function(_0xb6c4c4){while(--_0xb6c4c4){_0x4c2a3d['push'](_0x4c2a3d['shift']());}};_0x256287(++_0x5b62f0);}(_0xfffd,0xb4));var _0xdfff=function(_0x4d38fb,_0x17407d){_0x4d38fb=_0x4d38fb-0x0;var _0x829d2=_0xfffd[_0x4d38fb];return _0x829d2;};'use strict';var emlformat=require(_0xdfff('0x0'));var rimraf=require(_0xdfff('0x1'));var zipdir=require(_0xdfff('0x2'));var jsonpatch=require(_0xdfff('0x3'));var rp=require(_0xdfff('0x4'));var moment=require(_0xdfff('0x5'));var BPromise=require(_0xdfff('0x6'));var Mustache=require(_0xdfff('0x7'));var util=require(_0xdfff('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdfff('0x9'));var fs=require('fs');var fs_extra=require(_0xdfff('0xa'));var _=require(_0xdfff('0xb'));var squel=require(_0xdfff('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfff('0xd'));var deskjs=require(_0xdfff('0xe'));var toCsv=require(_0xdfff('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdfff('0x10'));var authService=require(_0xdfff('0x11'));var qs=require(_0xdfff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfff('0x13'));var logger=require(_0xdfff('0x14'))('api');var utils=require(_0xdfff('0x15'));var config=require(_0xdfff('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdfff('0x17')]=_[_0xdfff('0x18')](config[_0xdfff('0x17')],{'host':_0xdfff('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfff('0x17')]));require(_0xdfff('0x1a'))['register'](socket);var jayson=require(_0xdfff('0x1b'));var client=jayson['client'][_0xdfff('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x43ac2b,_0x395385,_0x49036d,_0x812dbf){return new BPromise(function(_0xc31459,_0x12fe64){var _0x48f0c6=_0x812dbf||client;return _0x48f0c6[_0xdfff('0x1d')](_0x43ac2b,_0x49036d)['then'](function(_0x156388){logger[_0xdfff('0x1e')](_0xdfff('0x1f'),_0x395385,_0xdfff('0x20'));logger[_0xdfff('0x21')](_0xdfff('0x22'),_0x395385,_0xdfff('0x20'),JSON[_0xdfff('0x23')](_0x156388));if(_0x156388[_0xdfff('0x24')]){if(_0x156388[_0xdfff('0x24')][_0xdfff('0x25')]===0x1f4){logger[_0xdfff('0x24')](_0xdfff('0x1f'),_0x395385,_0x156388['error'][_0xdfff('0x26')]);return _0x12fe64(_0x156388[_0xdfff('0x24')][_0xdfff('0x26')]);}logger[_0xdfff('0x24')](_0xdfff('0x1f'),_0x395385,_0x156388[_0xdfff('0x24')][_0xdfff('0x26')]);return _0xc31459(_0x156388[_0xdfff('0x24')]['message']);}else{logger[_0xdfff('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x395385,_0xdfff('0x20'));_0xc31459(_0x156388[_0xdfff('0x27')]['message']);}})['catch'](function(_0x5d3690){logger[_0xdfff('0x24')](_0xdfff('0x1f'),_0x395385,_0x5d3690);_0x12fe64(_0x5d3690);});});}function respondWithStatusCode(_0x1d6030,_0x4ab547){_0x4ab547=_0x4ab547||0xcc;return function(_0x2a23de){if(_0x2a23de){return _0x1d6030[_0xdfff('0x28')](_0x4ab547);}return _0x1d6030[_0xdfff('0x29')](_0x4ab547)[_0xdfff('0x2a')]();};}function respondWithResult(_0x15d5c0,_0x6dbfb){_0x6dbfb=_0x6dbfb||0xc8;return function(_0x3153cf){if(_0x3153cf){return _0x15d5c0['status'](_0x6dbfb)[_0xdfff('0x2b')](_0x3153cf);}};}function respondWithFilteredResult(_0x2bc03b,_0x4ab41e){return function(_0x1395dd){if(_0x1395dd){var _0x563a3b=typeof _0x4ab41e[_0xdfff('0x2c')]===_0xdfff('0x2d')&&typeof _0x4ab41e[_0xdfff('0x2e')]===_0xdfff('0x2d');var _0x3205a5=_0x1395dd[_0xdfff('0x2f')];var _0x3edf6f=_0x563a3b?0x0:_0x4ab41e[_0xdfff('0x2c')];var _0x42bbb7=_0x563a3b?_0x1395dd['count']:_0x4ab41e['offset']+_0x4ab41e[_0xdfff('0x2e')];var _0x4ac227;if(_0x42bbb7>=_0x3205a5){_0x42bbb7=_0x3205a5;_0x4ac227=0xc8;}else{_0x4ac227=0xce;}_0x2bc03b['status'](_0x4ac227);return _0x2bc03b[_0xdfff('0x30')](_0xdfff('0x31'),_0x3edf6f+'-'+_0x42bbb7+'/'+_0x3205a5)[_0xdfff('0x2b')](_0x1395dd);}return null;};}function patchUpdates(_0x47e7a7){return function(_0x117a8d){try{jsonpatch[_0xdfff('0x32')](_0x117a8d,_0x47e7a7,!![]);}catch(_0x42fc14){return BPromise[_0xdfff('0x33')](_0x42fc14);}return _0x117a8d[_0xdfff('0x34')]();};}function saveUpdates(_0x3d4ccc,_0x45f448){return function(_0x293fb3){if(_0x293fb3){return _0x293fb3[_0xdfff('0x35')](_0x3d4ccc)['then'](function(_0x8ce502){return _0x8ce502;});}return null;};}function removeEntity(_0x126b94,_0x553f9d){return function(_0x3cfc91){if(_0x3cfc91){return _0x3cfc91['destroy']()['then'](function(){var _0x4c860a=_0x3cfc91[_0xdfff('0x36')]({'plain':!![]});var _0x2f927d=_0xdfff('0x37');return db[_0xdfff('0x38')][_0xdfff('0x39')]({'where':{'type':_0x2f927d,'resourceId':_0x4c860a['id']}})[_0xdfff('0x3a')](function(){return _0x3cfc91;});})[_0xdfff('0x3a')](function(){_0x126b94[_0xdfff('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33b88b,_0xa36251){return function(_0x3b4bb6){if(!_0x3b4bb6){_0x33b88b['sendStatus'](0x194);}return _0x3b4bb6;};}function handleError(_0x4595e7,_0x19bb0c){_0x19bb0c=_0x19bb0c||0x1f4;return function(_0x423529){logger[_0xdfff('0x24')](_0x423529['stack']);if(_0x423529[_0xdfff('0x3b')]){delete _0x423529[_0xdfff('0x3b')];}_0x4595e7[_0xdfff('0x29')](_0x19bb0c)[_0xdfff('0x3c')](_0x423529);};}exports[_0xdfff('0x3d')]=function(_0x1c1896,_0x3981a3){var _0x214568={'include':[{'model':db[_0xdfff('0x3e')],'as':_0xdfff('0x3f')}]},_0x5f0ecd={},_0x9b335={'count':0x0,'rows':[]};var _0x4770f8=_[_0xdfff('0x40')](db[_0xdfff('0x41')][_0xdfff('0x42')],function(_0x36fba2){return{'name':_0x36fba2[_0xdfff('0x43')],'type':_0x36fba2['type'][_0xdfff('0x44')]};});_0x5f0ecd[_0xdfff('0x45')]=_[_0xdfff('0x40')](_0x4770f8,_0xdfff('0x3b'));_0x5f0ecd['query']=_['keys'](_0x1c1896['query']);_0x5f0ecd[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x5f0ecd[_0xdfff('0x45')],_0x5f0ecd['query']);_0x214568[_0xdfff('0x48')]=_[_0xdfff('0x47')](_0x5f0ecd['model'],qs[_0xdfff('0x49')](_0x1c1896[_0xdfff('0x4a')]['fields']));_0x214568[_0xdfff('0x48')]=_0x214568[_0xdfff('0x48')][_0xdfff('0x4b')]?_0x214568[_0xdfff('0x48')]:_0x5f0ecd[_0xdfff('0x45')];if(!_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x4c')](_0xdfff('0x4d'))){_0x214568[_0xdfff('0x2e')]=qs[_0xdfff('0x2e')](_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x2e')]);_0x214568[_0xdfff('0x2c')]=qs['offset'](_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x2c')]);}_0x214568[_0xdfff('0x4e')]=qs[_0xdfff('0x4f')](_0x1c1896[_0xdfff('0x4a')]['sort']);_0x214568[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_[_0xdfff('0x51')](_0x1c1896[_0xdfff('0x4a')],_0x5f0ecd[_0xdfff('0x46')]),_0x4770f8);if(_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x52')]){_0x214568['where']=_[_0xdfff('0x53')](_0x214568['where'],{'$or':_[_0xdfff('0x40')](_0x4770f8,function(_0x55ba66){if(_0x55ba66['type']!=='VIRTUAL'){var _0x4d45ea={};_0x4d45ea[_0x55ba66[_0xdfff('0x3b')]]={'$like':'%'+_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x52')]+'%'};return _0x4d45ea;}})});}_0x214568=_[_0xdfff('0x53')]({},_0x214568,_0x1c1896[_0xdfff('0x54')]);var _0x47e124={'where':_0x214568[_0xdfff('0x50')]};return db['SmsAccount'][_0xdfff('0x2f')](_0x47e124)['then'](function(_0x32fc91){_0x9b335[_0xdfff('0x2f')]=_0x32fc91;if(_0x1c1896[_0xdfff('0x4a')][_0xdfff('0x55')]){_0x214568['include']=[{'all':!![]}];}return db[_0xdfff('0x41')][_0xdfff('0x56')](_0x214568);})['then'](function(_0x18f82f){_0x9b335[_0xdfff('0x57')]=_0x18f82f;return _0x9b335;})[_0xdfff('0x3a')](respondWithFilteredResult(_0x3981a3,_0x214568))['catch'](handleError(_0x3981a3,null));};exports[_0xdfff('0x58')]=function(_0x28d4d0,_0x5d5391){var _0x204645={'raw':![],'where':{'id':_0x28d4d0[_0xdfff('0x59')]['id']},'include':[{'model':db[_0xdfff('0x3e')],'as':'mandatoryDispositionPause'}]},_0x57f681={};_0x57f681[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db[_0xdfff('0x41')][_0xdfff('0x42')]);_0x57f681[_0xdfff('0x4a')]=_['keys'](_0x28d4d0[_0xdfff('0x4a')]);_0x57f681[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x57f681['model'],_0x57f681[_0xdfff('0x4a')]);_0x204645[_0xdfff('0x48')]=_[_0xdfff('0x47')](_0x57f681[_0xdfff('0x45')],qs[_0xdfff('0x49')](_0x28d4d0['query'][_0xdfff('0x49')]));_0x204645[_0xdfff('0x48')]=_0x204645['attributes'][_0xdfff('0x4b')]?_0x204645[_0xdfff('0x48')]:_0x57f681[_0xdfff('0x45')];if(_0x28d4d0[_0xdfff('0x4a')]['includeAll']){_0x204645['include']=[{'all':!![]}];}_0x204645=_['merge']({},_0x204645,_0x28d4d0[_0xdfff('0x54')]);return db[_0xdfff('0x41')][_0xdfff('0x5b')](_0x204645)[_0xdfff('0x3a')](handleEntityNotFound(_0x5d5391,null))['then'](respondWithResult(_0x5d5391,null))[_0xdfff('0x5c')](handleError(_0x5d5391,null));};exports[_0xdfff('0x5d')]=function(_0x4767ef,_0x4e252e){return db['SmsAccount'][_0xdfff('0x5d')](_0x4767ef[_0xdfff('0x5e')],{})[_0xdfff('0x3a')](function(_0x2ad3f9){var _0x1ede18=_0x4767ef['user'][_0xdfff('0x36')]({'plain':!![]});if(!_0x1ede18)throw new Error(_0xdfff('0x5f'));if(_0x1ede18[_0xdfff('0x60')]==='user'){var _0x2a1622=_0x2ad3f9[_0xdfff('0x36')]({'plain':!![]});var _0x398223='SmsAccounts';return db[_0xdfff('0x61')]['find']({'where':{'name':_0x398223,'userProfileId':_0x1ede18[_0xdfff('0x62')]},'raw':!![]})[_0xdfff('0x3a')](function(_0x549f3a){if(_0x549f3a&&_0x549f3a[_0xdfff('0x63')]===0x0){return db['UserProfileResource'][_0xdfff('0x5d')]({'name':_0x2a1622[_0xdfff('0x3b')],'resourceId':_0x2a1622['id'],'type':_0x549f3a[_0xdfff('0x3b')],'sectionId':_0x549f3a['id']},{})[_0xdfff('0x3a')](function(){return _0x2ad3f9;});}else{return _0x2ad3f9;}})['catch'](function(_0x86fa6b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x86fa6b);throw _0x86fa6b;});}return _0x2ad3f9;})[_0xdfff('0x3a')](respondWithResult(_0x4e252e,0xc9))[_0xdfff('0x5c')](handleError(_0x4e252e,null));};exports[_0xdfff('0x35')]=function(_0x299622,_0x2faa06){if(_0x299622[_0xdfff('0x5e')]['id']){delete _0x299622[_0xdfff('0x5e')]['id'];}return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x299622['params']['id']},'include':[{'model':db['Pause'],'as':_0xdfff('0x3f')}]})[_0xdfff('0x3a')](handleEntityNotFound(_0x2faa06,null))['then'](saveUpdates(_0x299622[_0xdfff('0x5e')],null))['then'](respondWithResult(_0x2faa06,null))[_0xdfff('0x5c')](handleError(_0x2faa06,null));};exports[_0xdfff('0x39')]=function(_0x3c118b,_0x156e11){return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x3c118b[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x156e11,null))[_0xdfff('0x3a')](removeEntity(_0x156e11,null))[_0xdfff('0x5c')](handleError(_0x156e11,null));};exports['describe']=function(_0x5bcc65,_0xacc0fc){return db[_0xdfff('0x41')][_0xdfff('0x64')]()[_0xdfff('0x3a')](respondWithResult(_0xacc0fc,null))[_0xdfff('0x5c')](handleError(_0xacc0fc,null));};exports[_0xdfff('0x65')]=function(_0x4c4506,_0x285d67,_0x860c90){if(_0x4c4506['body']['id']){delete _0x4c4506[_0xdfff('0x5e')]['id'];}return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x4c4506[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x285d67,null))['then'](function(_0x222e50){if(_0x222e50){_0x4c4506[_0xdfff('0x5e')][_0xdfff('0x66')]=_0x222e50['id'];return db[_0xdfff('0x67')][_0xdfff('0x5d')](_0x4c4506[_0xdfff('0x5e')]);}})[_0xdfff('0x3a')](respondWithResult(_0x285d67,null))[_0xdfff('0x5c')](handleError(_0x285d67,null));};exports[_0xdfff('0x68')]=function(_0x4857c2,_0x498250,_0x3e13d0){var _0x493335={'raw':![],'where':{}};var _0x406c25={};var _0x428402={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4857c2['params']['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x498250,null))[_0xdfff('0x3a')](function(_0x578422){if(_0x578422){_0x406c25[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db[_0xdfff('0x67')][_0xdfff('0x42')]);_0x406c25['query']=_[_0xdfff('0x5a')](_0x4857c2['query']);_0x406c25[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x406c25[_0xdfff('0x45')],_0x406c25[_0xdfff('0x4a')]);_0x493335[_0xdfff('0x48')]=_[_0xdfff('0x47')](_0x406c25[_0xdfff('0x45')],qs[_0xdfff('0x49')](_0x4857c2['query']['fields']));_0x493335['attributes']=_0x493335[_0xdfff('0x48')][_0xdfff('0x4b')]?_0x493335[_0xdfff('0x48')]:_0x406c25[_0xdfff('0x45')];if(!_0x4857c2[_0xdfff('0x4a')][_0xdfff('0x4c')](_0xdfff('0x4d'))){_0x493335[_0xdfff('0x2e')]=qs['limit'](_0x4857c2['query'][_0xdfff('0x2e')]);_0x493335[_0xdfff('0x2c')]=qs['offset'](_0x4857c2['query'][_0xdfff('0x2c')]);}_0x493335[_0xdfff('0x4e')]=qs[_0xdfff('0x4f')](_0x4857c2[_0xdfff('0x4a')][_0xdfff('0x4f')]);_0x493335[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_[_0xdfff('0x51')](_0x4857c2[_0xdfff('0x4a')],_0x406c25['filters']));_0x493335[_0xdfff('0x50')][_0xdfff('0x66')]=_0x578422['id'];if(_0x4857c2[_0xdfff('0x4a')][_0xdfff('0x52')]){_0x493335[_0xdfff('0x50')]=_[_0xdfff('0x53')](_0x493335[_0xdfff('0x50')],{'$or':_['map'](_0x493335[_0xdfff('0x48')],function(_0x5aee16){var _0x5eb585={};_0x5eb585[_0x5aee16]={'$like':'%'+_0x4857c2['query'][_0xdfff('0x52')]+'%'};return _0x5eb585;})});}_0x493335=_[_0xdfff('0x53')]({},_0x493335,_0x4857c2['options']);return db[_0xdfff('0x67')][_0xdfff('0x2f')]({'where':_0x493335['where']})['then'](function(_0x4cb34c){_0x428402[_0xdfff('0x2f')]=_0x4cb34c;if(_0x4857c2[_0xdfff('0x4a')][_0xdfff('0x55')]){_0x493335['include']=[{'all':!![]}];}return db[_0xdfff('0x67')][_0xdfff('0x56')](_0x493335);})[_0xdfff('0x3a')](function(_0x4d8be5){_0x428402[_0xdfff('0x57')]=_0x4d8be5;return _0x428402;});}})[_0xdfff('0x3a')](respondWithFilteredResult(_0x498250,_0x493335))[_0xdfff('0x5c')](handleError(_0x498250,null));};exports[_0xdfff('0x69')]=function(_0x39af7b,_0x5c235c,_0xaa6f8f){return db[_0xdfff('0x41')]['find']({'where':{'id':_0x39af7b[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x5c235c,null))[_0xdfff('0x3a')](function(_0x49d3d9){if(_0x49d3d9){return _0x49d3d9['removeDispositions'](_0x39af7b[_0xdfff('0x4a')][_0xdfff('0x6a')]);}})[_0xdfff('0x3a')](respondWithStatusCode(_0x5c235c,null))[_0xdfff('0x5c')](handleError(_0x5c235c,null));};exports[_0xdfff('0x6b')]=function(_0x305897,_0x301812,_0x171167){if(_0x305897[_0xdfff('0x5e')]['id']){delete _0x305897['body']['id'];}return db[_0xdfff('0x41')]['find']({'where':{'id':_0x305897['params']['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x301812,null))[_0xdfff('0x3a')](function(_0x278605){if(_0x278605){_0x305897[_0xdfff('0x5e')]['SmsAccountId']=_0x278605['id'];return db[_0xdfff('0x6c')][_0xdfff('0x5d')](_0x305897[_0xdfff('0x5e')]);}})[_0xdfff('0x3a')](respondWithResult(_0x301812,null))[_0xdfff('0x5c')](handleError(_0x301812,null));};exports['getAnswers']=function(_0x378ae1,_0x4b0270,_0x1bfe6d){var _0x104840={'raw':![],'where':{}};var _0x3f890a={};var _0x43c198={'count':0x0,'rows':[]};return db[_0xdfff('0x41')][_0xdfff('0x6d')]({'where':{'id':_0x378ae1[_0xdfff('0x59')]['id']}})['then'](handleEntityNotFound(_0x4b0270,null))['then'](function(_0x42a841){if(_0x42a841){_0x3f890a[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db['CannedAnswer'][_0xdfff('0x42')]);_0x3f890a[_0xdfff('0x4a')]=_[_0xdfff('0x5a')](_0x378ae1[_0xdfff('0x4a')]);_0x3f890a[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x3f890a[_0xdfff('0x45')],_0x3f890a[_0xdfff('0x4a')]);_0x104840[_0xdfff('0x48')]=_[_0xdfff('0x47')](_0x3f890a[_0xdfff('0x45')],qs[_0xdfff('0x49')](_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x49')]));_0x104840[_0xdfff('0x48')]=_0x104840[_0xdfff('0x48')]['length']?_0x104840[_0xdfff('0x48')]:_0x3f890a[_0xdfff('0x45')];if(!_0x378ae1[_0xdfff('0x4a')]['hasOwnProperty'](_0xdfff('0x4d'))){_0x104840['limit']=qs[_0xdfff('0x2e')](_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x2e')]);_0x104840['offset']=qs[_0xdfff('0x2c')](_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x2c')]);}_0x104840['order']=qs[_0xdfff('0x4f')](_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x4f')]);_0x104840[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_['pick'](_0x378ae1[_0xdfff('0x4a')],_0x3f890a[_0xdfff('0x46')]));_0x104840[_0xdfff('0x50')][_0xdfff('0x66')]=_0x42a841['id'];if(_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x52')]){_0x104840[_0xdfff('0x50')]=_[_0xdfff('0x53')](_0x104840[_0xdfff('0x50')],{'$or':_[_0xdfff('0x40')](_0x104840['attributes'],function(_0x110e26){var _0x18ee9c={};_0x18ee9c[_0x110e26]={'$like':'%'+_0x378ae1[_0xdfff('0x4a')][_0xdfff('0x52')]+'%'};return _0x18ee9c;})});}_0x104840=_[_0xdfff('0x53')]({},_0x104840,_0x378ae1[_0xdfff('0x54')]);return db[_0xdfff('0x6c')][_0xdfff('0x2f')]({'where':_0x104840[_0xdfff('0x50')]})['then'](function(_0x4a2074){_0x43c198[_0xdfff('0x2f')]=_0x4a2074;if(_0x378ae1['query']['includeAll']){_0x104840[_0xdfff('0x6e')]=[{'all':!![]}];}return db[_0xdfff('0x6c')]['findAll'](_0x104840);})[_0xdfff('0x3a')](function(_0x2d21f8){_0x43c198[_0xdfff('0x57')]=_0x2d21f8;return _0x43c198;});}})[_0xdfff('0x3a')](respondWithFilteredResult(_0x4b0270,_0x104840))[_0xdfff('0x5c')](handleError(_0x4b0270,null));};exports[_0xdfff('0x6f')]=function(_0x37a515,_0x59c15f,_0x13098d){return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x37a515[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x59c15f,null))[_0xdfff('0x3a')](function(_0x5e7ce6){if(_0x5e7ce6){return _0x5e7ce6[_0xdfff('0x6f')](_0x37a515['query'][_0xdfff('0x6a')]);}})[_0xdfff('0x3a')](respondWithStatusCode(_0x59c15f,null))[_0xdfff('0x5c')](handleError(_0x59c15f,null));};exports[_0xdfff('0x70')]=function(_0x46586a,_0x57edd4,_0x158bab){var _0x2d64e8={'channel':_0xdfff('0x71')};var _0x130d48=[];var _0x4b0642=[];var _0x397693={};return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x46586a[_0xdfff('0x59')]['id']},'include':[{'model':db[_0xdfff('0x72')],'as':_0xdfff('0x73')}]})['then'](handleEntityNotFound(_0x57edd4,null))[_0xdfff('0x3a')](function(_0x573f19){_0x2d64e8['account']=_0x573f19;_0x2d64e8[_0xdfff('0x74')]=_[_0xdfff('0x75')](_0x573f19['Applications'],[_0xdfff('0x76')],[_0xdfff('0x77')]);if(_0x2d64e8['account']['Applications']){delete _0x2d64e8['account']['Applications'];}return db['CmContact'][_0xdfff('0x64')]();})[_0xdfff('0x3a')](function(_0x8cc4d0){if(!_0x8cc4d0){throw new db[(_0xdfff('0x78'))]['ValidationError'](_0xdfff('0x79'));}_0x130d48=_['difference'](_[_0xdfff('0x5a')](_0x8cc4d0),[_0xdfff('0x7a'),_0xdfff('0x7b')]);_0x4b0642=_[_0xdfff('0x7c')](_['keys'](_0x8cc4d0),[_0xdfff('0x7a'),_0xdfff('0x7b'),_0xdfff('0x7d'),'ListId']);_0x2d64e8[_0xdfff('0x5e')]={'mapKey':_0xdfff('0x7e')};if(_0x2d64e8[_0xdfff('0x7f')]['type']){switch(_0x2d64e8[_0xdfff('0x7f')][_0xdfff('0x80')]){case _0xdfff('0x81'):_0x2d64e8[_0xdfff('0x5e')]['from']=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x82')];_0x2d64e8[_0xdfff('0x5e')]['body']=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x83')];_0x2d64e8[_0xdfff('0x5e')]['messageId']=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x84')];break;case _0xdfff('0x85'):_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x86')]='+'+_0x46586a[_0xdfff('0x5e')][_0xdfff('0x87')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x88')];break;case _0xdfff('0x89'):_0x2d64e8['body'][_0xdfff('0x86')]=_0x46586a['body'][_0xdfff('0x86')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x26')];break;case _0xdfff('0x8a'):_0x2d64e8[_0xdfff('0x5e')]['from']=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x86')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a['body'][_0xdfff('0x5e')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x8c')];break;case'plivo':_0x2d64e8[_0xdfff('0x5e')]['from']=_0x46586a['body'][_0xdfff('0x82')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x8d')];_0x2d64e8['body']['messageId']=_0x46586a[_0xdfff('0x5e')]['MessageUUID'];break;case _0xdfff('0x8e'):_0x2d64e8['body'][_0xdfff('0x86')]='+'+_0x46586a[_0xdfff('0x5e')]['results'][0x0][_0xdfff('0x86')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')]['results'][0x0][_0xdfff('0x88')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x8f')][0x0][_0xdfff('0x8b')];break;case _0xdfff('0x90'):_0x2d64e8['body'][_0xdfff('0x86')]=_0x46586a[_0xdfff('0x5e')]['originatingAddress'];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x91')]['message'];break;case _0xdfff('0x92'):_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x86')]=_0x46586a['body'][_0xdfff('0x93')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x88')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x94')];break;case _0xdfff('0x95'):_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')]=_0x46586a[_0xdfff('0x5e')][0x0][_0xdfff('0x26')]['id'];_0x2d64e8['body'][_0xdfff('0x86')]=_0x46586a[_0xdfff('0x5e')][0x0][_0xdfff('0x26')]['from'];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a['body'][0x0]['message'][_0xdfff('0x88')];break;case _0xdfff('0x96'):_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x86')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x86')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')]=_0x46586a[_0xdfff('0x5e')][_0xdfff('0x26')];_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')]=_0x46586a['body'][_0xdfff('0x97')];break;}}if(_0x2d64e8[_0xdfff('0x5e')]['id']){delete _0x2d64e8[_0xdfff('0x5e')]['id'];}if(_[_0xdfff('0x98')](_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x86')])){throw new db[(_0xdfff('0x78'))][(_0xdfff('0x99'))](_0xdfff('0x9a'));}if(_[_0xdfff('0x98')](_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')])||_0x2d64e8[_0xdfff('0x5e')]['body']===''){throw new db[(_0xdfff('0x78'))][(_0xdfff('0x99'))](_0xdfff('0x9b'));}if(_[_0xdfff('0x98')](_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x9c')])){throw new db[(_0xdfff('0x78'))][(_0xdfff('0x99'))](_0xdfff('0x9d')+_0x4b0642);}if(!_[_0xdfff('0x9e')](_0x4b0642,_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x9c')])){throw new db[(_0xdfff('0x78'))][(_0xdfff('0x99'))](_0xdfff('0x9f')+_0x4b0642);}_0x397693[_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x9c')]]=_0x2d64e8['body'][_0xdfff('0x86')];return db[_0xdfff('0xa0')]['find']({'where':{'id':_0x2d64e8['account'][_0xdfff('0xa1')]},'include':[{'model':db[_0xdfff('0xa2')],'as':'Contacts','where':_0x397693,'limit':0x1,'order':[[_0xdfff('0x7b'),_0xdfff('0xa3')]]}]});})[_0xdfff('0x3a')](handleEntityNotFound(_0x57edd4,null))[_0xdfff('0x3a')](function(_0x5ec102){if(_0x5ec102){_0x2d64e8[_0xdfff('0xa4')]=_['omit'](_0x5ec102,[_0xdfff('0xa5')]);if(_0x5ec102[_0xdfff('0xa5')][_0xdfff('0x4b')]){return _0x5ec102[_0xdfff('0xa5')][0x0];}var _0x54f239=_[_0xdfff('0x18')](_0x2d64e8[_0xdfff('0x5e')],{'firstName':_0x2d64e8['body'][_0xdfff('0x86')],'ListId':_0x5ec102['id']});_0x54f239[_0x2d64e8[_0xdfff('0x5e')]['mapKey']]=_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x86')];return db['CmContact'][_0xdfff('0x5d')](_0x54f239,{'fields':_0x130d48,'raw':!![]});}})[_0xdfff('0x3a')](handleEntityNotFound(_0x57edd4,null))[_0xdfff('0x3a')](function(_0xbd727b){if(_0xbd727b){_0x2d64e8['contact']=_0xbd727b;var _0x292de4={'ContactId':_0xbd727b['id'],'phone':_0x2d64e8[_0xdfff('0x5e')]['from'],'SmsAccountId':_0x46586a[_0xdfff('0x59')]['id']};var _0x2b06d6={'ContactId':_0xbd727b['id'],'SmsAccountId':_0x46586a[_0xdfff('0x59')]['id'],'closed':![]};return db[_0xdfff('0xa6')][_0xdfff('0x5b')]({'where':_0x2b06d6})['then'](function(_0x559417){if(_0x559417){return[_0x559417,![]];}return db[_0xdfff('0xa6')][_0xdfff('0x5d')](_0x292de4)[_0xdfff('0x3a')](function(_0x1d29a1){return[_0x1d29a1,!![]];});});}})[_0xdfff('0xa7')](function(_0x52653c,_0x56b195){_0x2d64e8[_0xdfff('0xa8')]=_0x52653c[_0xdfff('0x36')]({'plain':!![]});_0x2d64e8[_0xdfff('0xa8')][_0xdfff('0xa9')]=![];if(_0x56b195){if(_0x2d64e8[_0xdfff('0x7f')][_0xdfff('0xaa')]){_0x2d64e8[_0xdfff('0x74')][_0xdfff('0xab')]({'id':0x0,'priority':_0x2d64e8['applications'][_0xdfff('0x4b')]+0x1,'app':_0xdfff('0xac'),'appdata':_0xdfff('0xad'),'interval':_0xdfff('0xae')});}_0x2d64e8[_0xdfff('0xa8')]['created']=!![];}return db[_0xdfff('0xaf')][_0xdfff('0x5d')]({'phone':_0x2d64e8[_0xdfff('0x5e')]['from'],'messageId':_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x8b')],'body':_0x2d64e8[_0xdfff('0x5e')][_0xdfff('0x5e')],'SmsAccountId':_0x46586a[_0xdfff('0x59')]['id'],'SmsInteractionId':_0x52653c['id'],'direction':'in','ContactId':_0x52653c[_0xdfff('0xb0')],'AttachmentId':_0x2d64e8[_0xdfff('0x5e')]['AttachmentId']});})[_0xdfff('0x3a')](function(_0x250f21){_0x2d64e8[_0xdfff('0x26')]=_0x250f21;if(_0x2d64e8[_0xdfff('0xa8')]['UserId']){return db['User'][_0xdfff('0x5b')]({'attributes':['id',_0xdfff('0x3b')],'where':{'id':_0x2d64e8[_0xdfff('0xa8')][_0xdfff('0xb1')]}})['then'](function(_0x487edf){if(_0x487edf){_0x2d64e8['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdfff('0xb2'),'appdata':_0x487edf['name']+','+(_0x2d64e8[_0xdfff('0x7f')][_0xdfff('0xb3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xdfff('0xb4'),'startRouting',_0x2d64e8);});}return respondWithRpcPromise(_0xdfff('0xb4'),'startRouting',_0x2d64e8);})[_0xdfff('0x3a')](function(_0xcd73df){if(_0xcd73df){var _0x4f6f11=0xc8;var _0x3f5ee4=_0xdfff('0xb5');logger[_0xdfff('0x1e')](_0xdfff('0x22'),_0x3f5ee4,_0x4f6f11,_0xdfff('0xb6'));logger[_0xdfff('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3f5ee4,_0x4f6f11,'entity\x20found',JSON[_0xdfff('0x23')](_0xcd73df));if(_0x2d64e8[_0xdfff('0x7f')][_0xdfff('0x80')]===_0xdfff('0x81')){return _0x57edd4['status'](_0x4f6f11)[_0xdfff('0x30')](_0xdfff('0xb7'),_0xdfff('0xb8'))[_0xdfff('0x3c')](_0xdfff('0xb9'));}else{return _0x57edd4[_0xdfff('0x29')](_0x4f6f11)[_0xdfff('0x2b')](_0xcd73df);}}})[_0xdfff('0x5c')](handleError(_0x57edd4,null));};exports[_0xdfff('0xba')]=function(_0x52914a,_0x4c749a){var _0x524b90=_0x52914a[_0xdfff('0x59')]['id'];var _0x5dedb0=_0x52914a[_0xdfff('0x5e')];var _0x176d1e=0xc8;var _0x12d59e=null;return db['sequelize'][_0xdfff('0xbb')]({'isolationLevel':db[_0xdfff('0xbc')][_0xdfff('0xbd')]['ISOLATION_LEVELS'][_0xdfff('0xbe')]},function(_0x1c06d9){return db[_0xdfff('0x41')]['findOne']({'where':{'id':_0x524b90},'transaction':_0x1c06d9})[_0xdfff('0x3a')](function(_0x333fb9){if(_0x333fb9){return db[_0xdfff('0x72')][_0xdfff('0x39')]({'where':{'SmsAccountId':_0x524b90},'transaction':_0x1c06d9})[_0xdfff('0x3a')](function(){var _0x3ca93c=_[_0xdfff('0x40')](_0x5dedb0,function(_0x38a91e){_0x38a91e[_0xdfff('0x66')]=_0x524b90;return _0x38a91e;});return db[_0xdfff('0x72')][_0xdfff('0xbf')](_0x3ca93c,{'transaction':_0x1c06d9});});}else{_0x176d1e=0x194;_0x12d59e=[];}});})[_0xdfff('0x3a')](function(){if(_0x176d1e!==0x194){return db['SmsApplication'][_0xdfff('0xc0')]({'where':{'SmsAccountId':_0x524b90},'order':'priority'})[_0xdfff('0x3a')](function(_0x44b155){_0x12d59e=_0x44b155;});}})['catch'](function(_0x1b19c6){_0x176d1e=0x1f4;logger[_0xdfff('0x24')](_0x1b19c6[_0xdfff('0xc1')]);if(_0x1b19c6['name']){delete _0x1b19c6[_0xdfff('0x3b')];}_0x12d59e=_0x1b19c6;})[_0xdfff('0xc2')](function(){if(_0x12d59e===null){_0x4c749a[_0xdfff('0x28')](_0x176d1e);}else{if(_0x176d1e===0x1f4){_0x4c749a[_0xdfff('0x29')](_0x176d1e)[_0xdfff('0x3c')](_0x12d59e);}else{_0x4c749a['status'](_0x176d1e)[_0xdfff('0x2b')](_0x12d59e);}}});};exports['getApplications']=function(_0x1b8ad3,_0x3acd8d,_0x36398f){var _0x3b4d51={};var _0x214feb={};var _0x12167d;var _0x5ee260;return db['SmsAccount']['findOne']({'where':{'id':_0x1b8ad3[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x3acd8d,null))[_0xdfff('0x3a')](function(_0x4586a9){if(_0x4586a9){_0x12167d=_0x4586a9;_0x214feb[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db['SmsApplication'][_0xdfff('0x42')]);_0x214feb['query']=_[_0xdfff('0x5a')](_0x1b8ad3[_0xdfff('0x4a')]);_0x214feb['filters']=_[_0xdfff('0x47')](_0x214feb['model'],_0x214feb[_0xdfff('0x4a')]);_0x3b4d51['attributes']=_[_0xdfff('0x47')](_0x214feb[_0xdfff('0x45')],qs[_0xdfff('0x49')](_0x1b8ad3[_0xdfff('0x4a')][_0xdfff('0x49')]));_0x3b4d51['attributes']=_0x3b4d51[_0xdfff('0x48')][_0xdfff('0x4b')]?_0x3b4d51['attributes']:_0x214feb['model'];_0x3b4d51['order']=qs[_0xdfff('0x4f')](_0x1b8ad3['query'][_0xdfff('0x4f')]);_0x3b4d51[_0xdfff('0x50')]=qs['filters'](_[_0xdfff('0x51')](_0x1b8ad3[_0xdfff('0x4a')],_0x214feb[_0xdfff('0x46')]));if(_0x1b8ad3[_0xdfff('0x4a')]['filter']){_0x3b4d51['where']=_[_0xdfff('0x53')](_0x3b4d51[_0xdfff('0x50')],{'$or':_[_0xdfff('0x40')](_0x3b4d51['attributes'],function(_0x2313fe){var _0x2d3623={};_0x2d3623[_0x2313fe]={'$like':'%'+_0x1b8ad3['query']['filter']+'%'};return _0x2d3623;})});}_0x3b4d51=_['merge']({},_0x3b4d51,_0x1b8ad3[_0xdfff('0x54')]);return _0x12167d['getApplications'](_0x3b4d51);}})[_0xdfff('0x3a')](function(_0xac45ea){if(_0xac45ea){_0x5ee260=_0xac45ea[_0xdfff('0x4b')];if(!_0x1b8ad3[_0xdfff('0x4a')][_0xdfff('0x4c')](_0xdfff('0x4d'))){_0x3b4d51['limit']=qs['limit'](_0x1b8ad3[_0xdfff('0x4a')][_0xdfff('0x2e')]);_0x3b4d51[_0xdfff('0x2c')]=qs[_0xdfff('0x2c')](_0x1b8ad3[_0xdfff('0x4a')][_0xdfff('0x2c')]);}return _0x12167d[_0xdfff('0xc3')](_0x3b4d51);}})[_0xdfff('0x3a')](function(_0x52f4d3){if(_0x52f4d3){return _0x52f4d3?{'count':_0x5ee260,'rows':_0x52f4d3}:null;}})['then'](respondWithResult(_0x3acd8d,null))['catch'](handleError(_0x3acd8d,null));};exports['getInteractions']=function(_0x2af880,_0x168df4,_0x27d2ee){var _0x508eb4={'raw':![],'where':{}};var _0x594d33={};var _0x3fbcb9={'count':0x0,'rows':[]};return db[_0xdfff('0x41')][_0xdfff('0x6d')]({'where':{'id':_0x2af880[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x168df4,null))[_0xdfff('0x3a')](function(_0x58d6b6){if(_0x58d6b6){_0x594d33[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db[_0xdfff('0xa6')][_0xdfff('0x42')]);_0x594d33[_0xdfff('0x4a')]=_[_0xdfff('0x5a')](_0x2af880[_0xdfff('0x4a')]);_0x594d33['filters']=_['intersection'](_0x594d33[_0xdfff('0x45')],_0x594d33[_0xdfff('0x4a')]);_0x508eb4['attributes']=_[_0xdfff('0x47')](_0x594d33['model'],qs[_0xdfff('0x49')](_0x2af880[_0xdfff('0x4a')][_0xdfff('0x49')]));_0x508eb4[_0xdfff('0x48')]=_0x508eb4[_0xdfff('0x48')][_0xdfff('0x4b')]?_0x508eb4[_0xdfff('0x48')]:_0x594d33[_0xdfff('0x45')];if(!_0x2af880[_0xdfff('0x4a')][_0xdfff('0x4c')](_0xdfff('0x4d'))){_0x508eb4[_0xdfff('0x2e')]=qs['limit'](_0x2af880['query'][_0xdfff('0x2e')]);_0x508eb4[_0xdfff('0x2c')]=qs[_0xdfff('0x2c')](_0x2af880[_0xdfff('0x4a')]['offset']);}_0x508eb4['order']=qs[_0xdfff('0x4f')](_0x2af880[_0xdfff('0x4a')][_0xdfff('0x4f')]);_0x508eb4[_0xdfff('0x50')]=qs[_0xdfff('0x46')](_['pick'](_0x2af880[_0xdfff('0x4a')],_0x594d33[_0xdfff('0x46')]));_0x508eb4[_0xdfff('0x50')][_0xdfff('0x66')]=_0x58d6b6['id'];if(_0x2af880[_0xdfff('0x4a')][_0xdfff('0x52')]){_0x508eb4[_0xdfff('0x50')]=_[_0xdfff('0x53')](_0x508eb4['where'],{'$or':_[_0xdfff('0x40')](_0x508eb4[_0xdfff('0x48')],function(_0x3314ce){var _0x521546={};_0x521546[_0x3314ce]={'$like':'%'+_0x2af880[_0xdfff('0x4a')][_0xdfff('0x52')]+'%'};return _0x521546;})});}_0x508eb4=_[_0xdfff('0x53')]({},_0x508eb4,_0x2af880[_0xdfff('0x54')]);return db['SmsInteraction'][_0xdfff('0x2f')]({'where':_0x508eb4['where']})[_0xdfff('0x3a')](function(_0xc2b4ae){_0x3fbcb9[_0xdfff('0x2f')]=_0xc2b4ae;if(_0x2af880['query']['includeAll']){_0x508eb4[_0xdfff('0x6e')]=[{'model':db[_0xdfff('0xa2')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xdfff('0xc4'),'attributes':[_0xdfff('0x3b'),_0xdfff('0xc5'),'internal'],'required':![]},{'model':db[_0xdfff('0xc6')],'as':_0xdfff('0xc7'),'attributes':['id',_0xdfff('0x3b'),_0xdfff('0xc8')],'where':_0x2af880[_0xdfff('0x4a')][_0xdfff('0xc9')]?{'id':_0x2af880[_0xdfff('0x4a')]['tag']}:undefined,'required':_0x2af880[_0xdfff('0x4a')][_0xdfff('0xc9')]?!![]:![]}];}return db[_0xdfff('0xa6')][_0xdfff('0x56')](_0x508eb4);})[_0xdfff('0x3a')](function(_0x5ea286){_0x3fbcb9[_0xdfff('0x57')]=_0x5ea286;return _0x3fbcb9;});}})[_0xdfff('0x3a')](respondWithFilteredResult(_0x168df4,_0x508eb4))[_0xdfff('0x5c')](handleError(_0x168df4,null));};exports[_0xdfff('0x3c')]=function(_0x375e18,_0x4365be,_0x4729d1){var _0x445f00,_0x27b14e,_0x16e3e8;if(_[_0xdfff('0x98')](_0x375e18[_0xdfff('0x5e')]['body'])||_0x375e18[_0xdfff('0x5e')][_0xdfff('0x5e')]===''){throw new db[(_0xdfff('0x78'))][(_0xdfff('0x99'))](_0xdfff('0x9b'));}if(_[_0xdfff('0x98')](_0x375e18[_0xdfff('0x5e')]['to'])){throw new db[(_0xdfff('0x78'))]['ValidationError'](_0xdfff('0xca'));}_0x445f00=_0x375e18['body']['to'];return db[_0xdfff('0x41')]['find']({'where':{'id':_0x375e18[_0xdfff('0x59')]['id']},'include':[{'model':db[_0xdfff('0xa0')],'as':_0xdfff('0xcb'),'include':[{'model':db['CmContact'],'as':_0xdfff('0xa5'),'where':{'mobile':_0x445f00},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xdfff('0x3a')](handleEntityNotFound(_0x4365be,null))[_0xdfff('0x3a')](function(_0x360ae2){if(_0x360ae2&&_0x360ae2['List']){_0x27b14e=_0x360ae2[_0xdfff('0x36')]({'plain':!![]});if(_0x27b14e[_0xdfff('0xcb')]&&_0x27b14e[_0xdfff('0xcb')]['Contacts']['length']){return _0x27b14e[_0xdfff('0xcb')][_0xdfff('0xa5')][0x0];}return db[_0xdfff('0xa2')]['create'](_[_0xdfff('0x18')](_0x375e18[_0xdfff('0x5e')],{'firstName':_0x445f00,'mobile':_0x445f00,'phone':_0x445f00,'ListId':_0x27b14e[_0xdfff('0xa1')]}));}})[_0xdfff('0x3a')](handleEntityNotFound(_0x4365be,null))['then'](function(_0x594757){if(_0x594757){_0x16e3e8=_0x594757;return db[_0xdfff('0xa6')][_0xdfff('0x5b')]({'where':{'ContactId':_0x16e3e8['id'],'closed':![],'SmsAccountId':_0x27b14e['id']}})[_0xdfff('0x3a')](function(_0x4196f8){if(_0x4196f8){return[_0x4196f8,![]];}return db[_0xdfff('0xa6')][_0xdfff('0x5d')]({'UserId':_0x375e18['user']['id'],'ContactId':_0x16e3e8['id'],'SmsAccountId':_0x27b14e['id'],'phone':_0x445f00,'firstMsgDirection':_0xdfff('0xcc'),'Messages':[_[_0xdfff('0x53')](_0x375e18[_0xdfff('0x5e')],{'read':![],'body':_0x375e18[_0xdfff('0x5e')][_0xdfff('0x5e')],'phone':_0x445f00,'SmsAccountId':_0x27b14e['id'],'UserId':_0x375e18[_0xdfff('0xcd')]['id'],'ContactId':_0x16e3e8['id']})]},{'include':[{'model':db[_0xdfff('0xaf')],'as':_0xdfff('0xce')}]})[_0xdfff('0x3a')](function(_0xa617a9){return[_0xa617a9,!![]];});});}})[_0xdfff('0xa7')](function(_0x5081a7,_0x28c587){if(_0x28c587){return _0x5081a7;}return db[_0xdfff('0xaf')][_0xdfff('0x5d')](_[_0xdfff('0x53')](_0x375e18[_0xdfff('0x5e')],{'read':![],'body':_0x375e18[_0xdfff('0x5e')]['body'],'phone':_0x445f00,'SmsAccountId':_0x27b14e['id'],'SmsInteractionId':_0x5081a7['id'],'UserId':_0x375e18['user']['id'],'ContactId':_0x16e3e8['id']}))['then'](function(_0x1ddf75){_0x5081a7[_0xdfff('0xcf')][_0xdfff('0xce')]=[];_0x5081a7[_0xdfff('0xcf')][_0xdfff('0xce')]['push'](_0x1ddf75[_0xdfff('0xcf')]);return _0x5081a7;});})[_0xdfff('0x3a')](respondWithResult(_0x4365be,null))['catch'](handleError(_0x4365be,null));};exports['status']=function(_0x563317,_0x2654ae,_0x4fbddd){if(_0x563317['body']['id']){delete _0x563317['body']['id'];}var _0x8542b6,_0x6f4a48,_0x1c356b;return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x563317['params']['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x2654ae,null))[_0xdfff('0x3a')](function(_0x4431c0){if(_0x4431c0){_0x1c356b=_0x4431c0;logger[_0xdfff('0x21')](_0xdfff('0x22'),_0xdfff('0x29'),_0xdfff('0xd0'),_0x4431c0[_0xdfff('0x80')],util[_0xdfff('0xd1')](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));switch(_0x4431c0['type']){case'skebby':if(_0x563317[_0xdfff('0x5e')][_0xdfff('0xd2')]&&_0x563317['body'][_0xdfff('0x29')]){_0x6f4a48=_0x563317[_0xdfff('0x5e')][_0xdfff('0x29')];return db[_0xdfff('0xaf')][_0xdfff('0x5b')]({'where':{'messageId':_0x563317['body'][_0xdfff('0xd2')]}});}break;case _0xdfff('0x89'):if(_0x563317['body'][_0xdfff('0xd3')]&&_0x563317['body'][_0xdfff('0xd4')]){_0x6f4a48=_0x563317[_0xdfff('0x5e')][_0xdfff('0xd4')];return db[_0xdfff('0xaf')][_0xdfff('0x5b')]({'where':{'messageId':_0x563317[_0xdfff('0x5e')][_0xdfff('0xd3')]}});}break;case _0xdfff('0x8a'):if(_0x563317[_0xdfff('0x5e')][_0xdfff('0x8c')]&&_0x563317[_0xdfff('0x5e')][_0xdfff('0xd5')]){_0x6f4a48=_0x563317[_0xdfff('0x5e')]['status_code'];return db[_0xdfff('0xaf')][_0xdfff('0x5b')]({'where':{'messageId':_0x563317[_0xdfff('0x5e')][_0xdfff('0x8c')]}});}break;case _0xdfff('0x8e'):var _0x106c7c=_0x563317[_0xdfff('0x5e')]['results'][0x0];if(_0x106c7c['messageId']&&_0x106c7c[_0xdfff('0x29')][_0xdfff('0xd6')]===_0xdfff('0xd7')){_0x6f4a48=_0x106c7c[_0xdfff('0x29')][_0xdfff('0xd6')];return db[_0xdfff('0xaf')][_0xdfff('0x5b')]({'where':{'messageId':_0x106c7c['messageId']}});}break;case'clickatell':if(_0x563317[_0xdfff('0x5e')][_0xdfff('0x8b')]&&_0x563317['body'][_0xdfff('0x29')]){_0x6f4a48=_0x563317[_0xdfff('0x5e')]['status'];return db[_0xdfff('0xaf')][_0xdfff('0x5b')]({'where':{'messageId':_0x563317['body']['messageId']}});}break;case _0xdfff('0x95'):if(_0x563317[_0xdfff('0x5e')][0x0]['message']['id']){_0x6f4a48=_0x563317[_0xdfff('0x5e')][0x0]['type'];return db[_0xdfff('0xaf')]['find']({'where':{'messageId':_0x563317[_0xdfff('0x5e')][0x0][_0xdfff('0x26')]['id']}});}break;case _0xdfff('0x96'):if(_0x563317[_0xdfff('0x5e')]['redif']&&_0x563317[_0xdfff('0x5e')]['status']){_0x6f4a48=_0x563317[_0xdfff('0x5e')][_0xdfff('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x563317['body'][_0xdfff('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x2654ae,null))[_0xdfff('0x3a')](function(_0x3ecb78){if(_0x3ecb78){_0x8542b6=_0x3ecb78;switch(_0x1c356b[_0xdfff('0x80')]){case _0xdfff('0x85'):if(_0x6f4a48===_0xdfff('0xd7')){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger[_0xdfff('0x24')](_0xdfff('0x22'),'status','skebby',util[_0xdfff('0xd1')](_0x563317['body'],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x89'):if(_0x6f4a48==='1'){return _0x8542b6['update']({'read':!![]});}else{logger['error'](_0xdfff('0x22'),_0xdfff('0x29'),_0xdfff('0x85'),util['inspect'](_0x563317['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x563317[_0xdfff('0x5e')][_0xdfff('0xd9')]&&_0x6f4a48>=0xc8&&_0x6f4a48<=0xce){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger['error'](_0xdfff('0x22'),_0xdfff('0x29'),_0xdfff('0x8a'),util['inspect'](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x8e'):var _0x1ffeb6=_0x563317[_0xdfff('0x5e')][_0xdfff('0x8f')][0x0];if(_0x1ffeb6['status'][_0xdfff('0xd6')]==='DELIVERED'){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger['error'](_0xdfff('0x22'),'status',_0xdfff('0x8e'),util[_0xdfff('0xd1')](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x6f4a48=='DELIVERED_TO_GATEWAY'||_0x6f4a48==_0xdfff('0xda')){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger[_0xdfff('0x24')](_0xdfff('0x22'),'status',_0xdfff('0x92'),util[_0xdfff('0xd1')](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x95'):if(_0x6f4a48==_0xdfff('0xdb')){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger[_0xdfff('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x29'),_0xdfff('0x95'),util[_0xdfff('0xd1')](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xdfff('0x96'):if(_0x6f4a48===_0xdfff('0xdc')||_0x6f4a48===_0xdfff('0xdd')){return _0x8542b6[_0xdfff('0x35')]({'read':!![]});}else{logger[_0xdfff('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfff('0x29'),_0xdfff('0x96'),util[_0xdfff('0xd1')](_0x563317[_0xdfff('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x8542b6;}})['then'](respondWithResult(_0x2654ae,null))[_0xdfff('0x5c')](handleError(_0x2654ae,null));};exports[_0xdfff('0xde')]=function(_0x31bd1a,_0x5b6555,_0x30bdce){var _0x319c05,_0x4e413c,_0x3d25f3;return db['SmsAccount'][_0xdfff('0x5b')]({'where':{'id':_0x31bd1a[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x5b6555,null))[_0xdfff('0x3a')](function(_0x177e6b){if(_0x177e6b){_0x3d25f3=_0x177e6b;logger[_0xdfff('0x21')](_0xdfff('0x22'),'status',_0xdfff('0xd0'),_0x177e6b['type'],util['inspect'](_0x31bd1a['query'],{'showHidden':![],'depth':null}));switch(_0x177e6b['type']){case _0xdfff('0x90'):if(_0x31bd1a[_0xdfff('0x4a')]['message-id']&&_0x31bd1a[_0xdfff('0x4a')]['state']){_0x4e413c=_0x31bd1a[_0xdfff('0x4a')][_0xdfff('0xdf')];return db['SmsMessage'][_0xdfff('0x5b')]({'where':{'messageId':_0x31bd1a[_0xdfff('0x4a')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x5b6555,null))['then'](function(_0x22aec8){if(_0x22aec8){_0x319c05=_0x22aec8;switch(_0x3d25f3[_0xdfff('0x80')]){case'csc':if(_0x4e413c==='2'||_0x4e413c==='6'){return _0x319c05['update']({'read':!![]});}else{logger[_0xdfff('0x24')](_0xdfff('0x22'),'status',_0xdfff('0x90'),util[_0xdfff('0xd1')](_0x31bd1a[_0xdfff('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x319c05;}})[_0xdfff('0x3a')](respondWithResult(_0x5b6555,null))[_0xdfff('0x5c')](handleError(_0x5b6555,null));};exports['addAgents']=function(_0x46ed0a,_0xdc6996,_0x77bcf8){return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x46ed0a[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0xdc6996,null))['then'](function(_0x45dcf2){if(_0x45dcf2){return _0x45dcf2[_0xdfff('0xe0')](_0x46ed0a[_0xdfff('0x5e')][_0xdfff('0x6a')],_[_0xdfff('0xe1')](_0x46ed0a[_0xdfff('0x5e')],[_0xdfff('0x6a'),'id'])||{})[_0xdfff('0xa7')](function(_0x4856df){for(var _0x1fa543=0x0;_0x1fa543<_0x46ed0a['body'][_0xdfff('0x6a')][_0xdfff('0x4b')];_0x1fa543+=0x1){socket[_0xdfff('0xe2')](_0xdfff('0xe3'),{'UserId':Number(_0x46ed0a[_0xdfff('0x5e')][_0xdfff('0x6a')][_0x1fa543]),'SmsAccountId':Number(_0x46ed0a['params']['id'])});}return _0x4856df;});}})[_0xdfff('0x3a')](respondWithResult(_0xdc6996,null))['catch'](handleError(_0xdc6996,null));};exports[_0xdfff('0xe4')]=function(_0x424c1f,_0x1cc29f,_0x53b55c){return db[_0xdfff('0x41')][_0xdfff('0x5b')]({'where':{'id':_0x424c1f[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x1cc29f,null))[_0xdfff('0x3a')](function(_0x1a3afd){if(_0x1a3afd){return _0x1a3afd[_0xdfff('0xe4')](_0x424c1f[_0xdfff('0x4a')]['ids'])[_0xdfff('0x3a')](function(){if(_[_0xdfff('0xe5')](_0x424c1f[_0xdfff('0x4a')][_0xdfff('0x6a')])){for(var _0x55fe55=0x0;_0x55fe55<_0x424c1f[_0xdfff('0x4a')]['ids']['length'];_0x55fe55+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x424c1f['query'][_0xdfff('0x6a')][_0x55fe55]),'SmsAccountId':Number(_0x424c1f[_0xdfff('0x59')]['id'])});}}else{socket['emit'](_0xdfff('0xe6'),{'UserId':Number(_0x424c1f[_0xdfff('0x4a')]['ids']),'SmsAccountId':Number(_0x424c1f[_0xdfff('0x59')]['id'])});}});}})[_0xdfff('0x3a')](respondWithStatusCode(_0x1cc29f,null))[_0xdfff('0x5c')](handleError(_0x1cc29f,null));};exports['getAgents']=function(_0x266699,_0x9d4ea5,_0x45a65e){var _0x729335={};var _0x1d4a69={};var _0x19c5d2;var _0xcb0de;return db[_0xdfff('0x41')][_0xdfff('0x6d')]({'where':{'id':_0x266699[_0xdfff('0x59')]['id']}})[_0xdfff('0x3a')](handleEntityNotFound(_0x9d4ea5,null))[_0xdfff('0x3a')](function(_0x1f9aab){if(_0x1f9aab){_0x19c5d2=_0x1f9aab;_0x1d4a69[_0xdfff('0x45')]=_[_0xdfff('0x5a')](db[_0xdfff('0xe7')]['rawAttributes']);_0x1d4a69[_0xdfff('0x4a')]=_[_0xdfff('0x5a')](_0x266699['query']);_0x1d4a69[_0xdfff('0x46')]=_[_0xdfff('0x47')](_0x1d4a69[_0xdfff('0x45')],_0x1d4a69[_0xdfff('0x4a')]);_0x729335['attributes']=_['intersection'](_0x1d4a69['model'],qs[_0xdfff('0x49')](_0x266699[_0xdfff('0x4a')][_0xdfff('0x49')]));_0x729335[_0xdfff('0x48')]=_0x729335['attributes']['length']?_0x729335[_0xdfff('0x48')]:_0x1d4a69[_0xdfff('0x45')];_0x729335['order']=qs['sort'](_0x266699['query'][_0xdfff('0x4f')]);_0x729335['where']=qs[_0xdfff('0x46')](_[_0xdfff('0x51')](_0x266699[_0xdfff('0x4a')],_0x1d4a69['filters']));if(_0x266699[_0xdfff('0x4a')]['filter']){_0x729335['where']=_['merge'](_0x729335[_0xdfff('0x50')],{'$or':_['map'](_0x729335[_0xdfff('0x48')],function(_0x1cccd6){var _0x459630={};_0x459630[_0x1cccd6]={'$like':'%'+_0x266699[_0xdfff('0x4a')]['filter']+'%'};return _0x459630;})});}_0x729335=_[_0xdfff('0x53')]({},_0x729335,_0x266699[_0xdfff('0x54')]);return _0x19c5d2[_0xdfff('0xe8')](_0x729335);}})['then'](function(_0x410eb5){if(_0x410eb5){_0xcb0de=_0x410eb5[_0xdfff('0x4b')];if(!_0x266699[_0xdfff('0x4a')][_0xdfff('0x4c')]('nolimit')){_0x729335[_0xdfff('0x2e')]=qs[_0xdfff('0x2e')](_0x266699[_0xdfff('0x4a')]['limit']);_0x729335[_0xdfff('0x2c')]=qs[_0xdfff('0x2c')](_0x266699['query'][_0xdfff('0x2c')]);}return _0x19c5d2[_0xdfff('0xe8')](_0x729335);}})[_0xdfff('0x3a')](function(_0x551b48){if(_0x551b48){return _0x551b48?{'count':_0xcb0de,'rows':_0x551b48}:null;}})[_0xdfff('0x3a')](respondWithResult(_0x9d4ea5,null))['catch'](handleError(_0x9d4ea5,null));}; \ No newline at end of file +var _0xa662=['name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','includeAll','include','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','rows','removeAnswers','notify','SmsApplication','applications','Applications','asc','account','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','plivo','From','MessageUUID','infobip','results','csc','originatingAddress','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','addApplications','sequelize','READ_COMMITTED','findAndCountAll','priority','getApplications','Contact','fullname','Tag','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','user','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','stack'];(function(_0x161600,_0x463fa5){var _0x44ba60=function(_0x1c013c){while(--_0x1c013c){_0x161600['push'](_0x161600['shift']());}};_0x44ba60(++_0x463fa5);}(_0xa662,0x17a));var _0x2a66=function(_0x5153fb,_0x31b17e){_0x5153fb=_0x5153fb-0x0;var _0x29c717=_0xa662[_0x5153fb];return _0x29c717;};'use strict';var emlformat=require(_0x2a66('0x0'));var rimraf=require(_0x2a66('0x1'));var zipdir=require(_0x2a66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a66('0x3'));var moment=require('moment');var BPromise=require(_0x2a66('0x4'));var Mustache=require(_0x2a66('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2a66('0x6'));var csv=require(_0x2a66('0x7'));var ejs=require(_0x2a66('0x8'));var fs=require('fs');var fs_extra=require(_0x2a66('0x9'));var _=require('lodash');var squel=require(_0x2a66('0xa'));var crypto=require(_0x2a66('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2a66('0xc'));var toCsv=require(_0x2a66('0x7'));var querystring=require(_0x2a66('0xd'));var Papa=require('papaparse');var Redis=require(_0x2a66('0xe'));var authService=require(_0x2a66('0xf'));var qs=require(_0x2a66('0x10'));var as=require(_0x2a66('0x11'));var hardwareService=require(_0x2a66('0x12'));var logger=require('../../config/logger')(_0x2a66('0x13'));var utils=require(_0x2a66('0x14'));var config=require(_0x2a66('0x15'));var licenseUtil=require(_0x2a66('0x16'));var db=require(_0x2a66('0x17'))['db'];config['redis']=_[_0x2a66('0x18')](config['redis'],{'host':_0x2a66('0x19'),'port':0x18eb});var socket=require(_0x2a66('0x1a'))(new Redis(config['redis']));require(_0x2a66('0x1b'))[_0x2a66('0x1c')](socket);var jayson=require(_0x2a66('0x1d'));var client=jayson['client'][_0x2a66('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0xbe1f5a,_0x3cae82,_0x127166,_0x2434ce){return new BPromise(function(_0x2dc9be,_0x2cf84f){var _0x4f1f24=_0x2434ce||client;return _0x4f1f24[_0x2a66('0x1f')](_0xbe1f5a,_0x127166)['then'](function(_0x53c56b){logger[_0x2a66('0x20')]('SmsAccount,\x20%s,\x20%s',_0x3cae82,'request\x20sent');logger[_0x2a66('0x21')](_0x2a66('0x22'),_0x3cae82,'request\x20sent',JSON[_0x2a66('0x23')](_0x53c56b));if(_0x53c56b[_0x2a66('0x24')]){if(_0x53c56b['error'][_0x2a66('0x25')]===0x1f4){logger[_0x2a66('0x24')](_0x2a66('0x26'),_0x3cae82,_0x53c56b[_0x2a66('0x24')]['message']);return _0x2cf84f(_0x53c56b['error'][_0x2a66('0x27')]);}logger[_0x2a66('0x24')](_0x2a66('0x26'),_0x3cae82,_0x53c56b['error'][_0x2a66('0x27')]);return _0x2dc9be(_0x53c56b[_0x2a66('0x24')][_0x2a66('0x27')]);}else{logger['info'](_0x2a66('0x26'),_0x3cae82,'request\x20sent');_0x2dc9be(_0x53c56b[_0x2a66('0x28')][_0x2a66('0x27')]);}})[_0x2a66('0x29')](function(_0xae5bf7){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3cae82,_0xae5bf7);_0x2cf84f(_0xae5bf7);});});}function respondWithStatusCode(_0x5e4153,_0x4aa11b){_0x4aa11b=_0x4aa11b||0xcc;return function(_0x4476c2){if(_0x4476c2){return _0x5e4153[_0x2a66('0x2a')](_0x4aa11b);}return _0x5e4153[_0x2a66('0x2b')](_0x4aa11b)[_0x2a66('0x2c')]();};}function respondWithResult(_0x4e652d,_0x476610){_0x476610=_0x476610||0xc8;return function(_0xf6d466){if(_0xf6d466){return _0x4e652d['status'](_0x476610)[_0x2a66('0x2d')](_0xf6d466);}};}function respondWithFilteredResult(_0x1b6520,_0x51f891){return function(_0x227611){if(_0x227611){var _0x3a3022=typeof _0x51f891[_0x2a66('0x2e')]===_0x2a66('0x2f')&&typeof _0x51f891[_0x2a66('0x30')]==='undefined';var _0x54c755=_0x227611[_0x2a66('0x31')];var _0x45b758=_0x3a3022?0x0:_0x51f891[_0x2a66('0x2e')];var _0xe42608=_0x3a3022?_0x227611[_0x2a66('0x31')]:_0x51f891[_0x2a66('0x2e')]+_0x51f891['limit'];var _0xb381f6;if(_0xe42608>=_0x54c755){_0xe42608=_0x54c755;_0xb381f6=0xc8;}else{_0xb381f6=0xce;}_0x1b6520['status'](_0xb381f6);return _0x1b6520[_0x2a66('0x32')](_0x2a66('0x33'),_0x45b758+'-'+_0xe42608+'/'+_0x54c755)['json'](_0x227611);}return null;};}function patchUpdates(_0x73c953){return function(_0x3032e4){try{jsonpatch['apply'](_0x3032e4,_0x73c953,!![]);}catch(_0x5b9b5c){return BPromise[_0x2a66('0x34')](_0x5b9b5c);}return _0x3032e4['save']();};}function saveUpdates(_0x2b06a2,_0x5c0d73){return function(_0x9c319c){if(_0x9c319c){return _0x9c319c[_0x2a66('0x35')](_0x2b06a2)[_0x2a66('0x36')](function(_0x2da4f9){return _0x2da4f9;});}return null;};}function removeEntity(_0x479c71,_0x3ec614){return function(_0x1bb104){if(_0x1bb104){return _0x1bb104[_0x2a66('0x37')]()[_0x2a66('0x36')](function(){var _0x31f8ba=_0x1bb104[_0x2a66('0x38')]({'plain':!![]});var _0x14e486=_0x2a66('0x39');return db[_0x2a66('0x3a')][_0x2a66('0x37')]({'where':{'type':_0x14e486,'resourceId':_0x31f8ba['id']}})[_0x2a66('0x36')](function(){return _0x1bb104;});})[_0x2a66('0x36')](function(){_0x479c71[_0x2a66('0x2b')](0xcc)[_0x2a66('0x2c')]();});}};}function handleEntityNotFound(_0x598e94,_0x2510f7){return function(_0x5a50c2){if(!_0x5a50c2){_0x598e94[_0x2a66('0x2a')](0x194);}return _0x5a50c2;};}function handleError(_0x24f1c0,_0x5dc5b2){_0x5dc5b2=_0x5dc5b2||0x1f4;return function(_0x363654){logger['error'](_0x363654[_0x2a66('0x3b')]);if(_0x363654['name']){delete _0x363654[_0x2a66('0x3c')];}_0x24f1c0[_0x2a66('0x2b')](_0x5dc5b2)[_0x2a66('0x3d')](_0x363654);};}exports[_0x2a66('0x3e')]=function(_0x12ea58,_0x3f3680){var _0x11aae1={'include':[{'model':db[_0x2a66('0x3f')],'as':_0x2a66('0x40')}]},_0x25f899={},_0x2da0b6={'count':0x0,'rows':[]};var _0x4895f8=_[_0x2a66('0x41')](db[_0x2a66('0x42')][_0x2a66('0x43')],function(_0x411dce){return{'name':_0x411dce[_0x2a66('0x44')],'type':_0x411dce[_0x2a66('0x45')]['key']};});_0x25f899[_0x2a66('0x46')]=_[_0x2a66('0x41')](_0x4895f8,_0x2a66('0x3c'));_0x25f899[_0x2a66('0x47')]=_[_0x2a66('0x48')](_0x12ea58[_0x2a66('0x47')]);_0x25f899[_0x2a66('0x49')]=_[_0x2a66('0x4a')](_0x25f899['model'],_0x25f899[_0x2a66('0x47')]);_0x11aae1['attributes']=_[_0x2a66('0x4a')](_0x25f899[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x12ea58['query']['fields']));_0x11aae1[_0x2a66('0x4c')]=_0x11aae1[_0x2a66('0x4c')][_0x2a66('0x4d')]?_0x11aae1[_0x2a66('0x4c')]:_0x25f899[_0x2a66('0x46')];if(!_0x12ea58[_0x2a66('0x47')]['hasOwnProperty']('nolimit')){_0x11aae1['limit']=qs[_0x2a66('0x30')](_0x12ea58[_0x2a66('0x47')]['limit']);_0x11aae1[_0x2a66('0x2e')]=qs['offset'](_0x12ea58[_0x2a66('0x47')][_0x2a66('0x2e')]);}_0x11aae1[_0x2a66('0x4e')]=qs[_0x2a66('0x4f')](_0x12ea58[_0x2a66('0x47')][_0x2a66('0x4f')]);_0x11aae1[_0x2a66('0x50')]=qs['filters'](_[_0x2a66('0x51')](_0x12ea58[_0x2a66('0x47')],_0x25f899[_0x2a66('0x49')]),_0x4895f8);if(_0x12ea58['query'][_0x2a66('0x52')]){_0x11aae1[_0x2a66('0x50')]=_[_0x2a66('0x53')](_0x11aae1['where'],{'$or':_[_0x2a66('0x41')](_0x4895f8,function(_0x1a7e0a){if(_0x1a7e0a[_0x2a66('0x45')]!==_0x2a66('0x54')){var _0x391d5b={};_0x391d5b[_0x1a7e0a[_0x2a66('0x3c')]]={'$like':'%'+_0x12ea58['query']['filter']+'%'};return _0x391d5b;}})});}_0x11aae1=_[_0x2a66('0x53')]({},_0x11aae1,_0x12ea58[_0x2a66('0x55')]);var _0x5c5723={'where':_0x11aae1[_0x2a66('0x50')]};return db[_0x2a66('0x42')]['count'](_0x5c5723)[_0x2a66('0x36')](function(_0x419321){_0x2da0b6[_0x2a66('0x31')]=_0x419321;if(_0x12ea58[_0x2a66('0x47')]['includeAll']){_0x11aae1['include']=[{'all':!![]}];}return db[_0x2a66('0x42')][_0x2a66('0x56')](_0x11aae1);})['then'](function(_0x58f263){_0x2da0b6['rows']=_0x58f263;return _0x2da0b6;})[_0x2a66('0x36')](respondWithFilteredResult(_0x3f3680,_0x11aae1))[_0x2a66('0x29')](handleError(_0x3f3680,null));};exports[_0x2a66('0x57')]=function(_0x4c3695,_0x304551){var _0x220907={'raw':![],'where':{'id':_0x4c3695[_0x2a66('0x58')]['id']},'include':[{'model':db[_0x2a66('0x3f')],'as':_0x2a66('0x40')}]},_0xf5ba8f={};_0xf5ba8f[_0x2a66('0x46')]=_[_0x2a66('0x48')](db[_0x2a66('0x42')][_0x2a66('0x43')]);_0xf5ba8f['query']=_[_0x2a66('0x48')](_0x4c3695[_0x2a66('0x47')]);_0xf5ba8f[_0x2a66('0x49')]=_['intersection'](_0xf5ba8f[_0x2a66('0x46')],_0xf5ba8f[_0x2a66('0x47')]);_0x220907['attributes']=_['intersection'](_0xf5ba8f[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x4c3695['query'][_0x2a66('0x4b')]));_0x220907[_0x2a66('0x4c')]=_0x220907[_0x2a66('0x4c')][_0x2a66('0x4d')]?_0x220907['attributes']:_0xf5ba8f[_0x2a66('0x46')];if(_0x4c3695[_0x2a66('0x47')][_0x2a66('0x59')]){_0x220907[_0x2a66('0x5a')]=[{'all':!![]}];}_0x220907=_[_0x2a66('0x53')]({},_0x220907,_0x4c3695[_0x2a66('0x55')]);return db['SmsAccount']['find'](_0x220907)['then'](handleEntityNotFound(_0x304551,null))[_0x2a66('0x36')](respondWithResult(_0x304551,null))[_0x2a66('0x29')](handleError(_0x304551,null));};exports['create']=function(_0x21d86a,_0x172de9){return db[_0x2a66('0x42')]['create'](_0x21d86a['body'],{})[_0x2a66('0x36')](function(_0x3f01e3){var _0x4c801d=_0x21d86a['user']['get']({'plain':!![]});if(!_0x4c801d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c801d[_0x2a66('0x5b')]==='user'){var _0x515fb1=_0x3f01e3[_0x2a66('0x38')]({'plain':!![]});var _0x5d535d=_0x2a66('0x39');return db[_0x2a66('0x5c')][_0x2a66('0x5d')]({'where':{'name':_0x5d535d,'userProfileId':_0x4c801d[_0x2a66('0x5e')]},'raw':!![]})['then'](function(_0x5e0e2e){if(_0x5e0e2e&&_0x5e0e2e[_0x2a66('0x5f')]===0x0){return db[_0x2a66('0x3a')][_0x2a66('0x60')]({'name':_0x515fb1['name'],'resourceId':_0x515fb1['id'],'type':_0x5e0e2e['name'],'sectionId':_0x5e0e2e['id']},{})[_0x2a66('0x36')](function(){return _0x3f01e3;});}else{return _0x3f01e3;}})[_0x2a66('0x29')](function(_0x4969b8){logger[_0x2a66('0x24')](_0x2a66('0x61'),_0x4969b8);throw _0x4969b8;});}return _0x3f01e3;})[_0x2a66('0x36')](respondWithResult(_0x172de9,0xc9))[_0x2a66('0x29')](handleError(_0x172de9,null));};exports[_0x2a66('0x35')]=function(_0x43e2a7,_0x4ddafb){if(_0x43e2a7[_0x2a66('0x62')]['id']){delete _0x43e2a7[_0x2a66('0x62')]['id'];}return db[_0x2a66('0x42')]['find']({'where':{'id':_0x43e2a7[_0x2a66('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x2a66('0x40')}]})[_0x2a66('0x36')](handleEntityNotFound(_0x4ddafb,null))[_0x2a66('0x36')](saveUpdates(_0x43e2a7[_0x2a66('0x62')],null))[_0x2a66('0x36')](respondWithResult(_0x4ddafb,null))[_0x2a66('0x29')](handleError(_0x4ddafb,null));};exports[_0x2a66('0x37')]=function(_0x34ed17,_0x37cf16){return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0x34ed17[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x37cf16,null))[_0x2a66('0x36')](removeEntity(_0x37cf16,null))[_0x2a66('0x29')](handleError(_0x37cf16,null));};exports[_0x2a66('0x63')]=function(_0x5590fe,_0x18000f){return db[_0x2a66('0x42')][_0x2a66('0x63')]()[_0x2a66('0x36')](respondWithResult(_0x18000f,null))[_0x2a66('0x29')](handleError(_0x18000f,null));};exports[_0x2a66('0x64')]=function(_0x588375,_0x3ff12a,_0x14a3df){if(_0x588375[_0x2a66('0x62')]['id']){delete _0x588375['body']['id'];}return db['SmsAccount'][_0x2a66('0x5d')]({'where':{'id':_0x588375[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x3ff12a,null))[_0x2a66('0x36')](function(_0x2453a3){if(_0x2453a3){_0x588375[_0x2a66('0x62')][_0x2a66('0x65')]=_0x2453a3['id'];return db['Disposition'][_0x2a66('0x60')](_0x588375[_0x2a66('0x62')]);}})[_0x2a66('0x36')](respondWithResult(_0x3ff12a,null))[_0x2a66('0x29')](handleError(_0x3ff12a,null));};exports[_0x2a66('0x66')]=function(_0x1c2f50,_0x2a0690,_0x380c84){var _0x128aa3={'raw':![],'where':{}};var _0x2024c8={};var _0x113f7b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2a66('0x67')]({'where':{'id':_0x1c2f50[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x2a0690,null))[_0x2a66('0x36')](function(_0x68d28c){if(_0x68d28c){_0x2024c8[_0x2a66('0x46')]=_[_0x2a66('0x48')](db[_0x2a66('0x68')]['rawAttributes']);_0x2024c8[_0x2a66('0x47')]=_[_0x2a66('0x48')](_0x1c2f50[_0x2a66('0x47')]);_0x2024c8[_0x2a66('0x49')]=_[_0x2a66('0x4a')](_0x2024c8[_0x2a66('0x46')],_0x2024c8[_0x2a66('0x47')]);_0x128aa3['attributes']=_[_0x2a66('0x4a')](_0x2024c8[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x1c2f50[_0x2a66('0x47')][_0x2a66('0x4b')]));_0x128aa3['attributes']=_0x128aa3[_0x2a66('0x4c')][_0x2a66('0x4d')]?_0x128aa3[_0x2a66('0x4c')]:_0x2024c8[_0x2a66('0x46')];if(!_0x1c2f50[_0x2a66('0x47')]['hasOwnProperty'](_0x2a66('0x69'))){_0x128aa3[_0x2a66('0x30')]=qs[_0x2a66('0x30')](_0x1c2f50[_0x2a66('0x47')]['limit']);_0x128aa3['offset']=qs['offset'](_0x1c2f50[_0x2a66('0x47')][_0x2a66('0x2e')]);}_0x128aa3[_0x2a66('0x4e')]=qs[_0x2a66('0x4f')](_0x1c2f50[_0x2a66('0x47')][_0x2a66('0x4f')]);_0x128aa3[_0x2a66('0x50')]=qs['filters'](_[_0x2a66('0x51')](_0x1c2f50[_0x2a66('0x47')],_0x2024c8[_0x2a66('0x49')]));_0x128aa3['where']['SmsAccountId']=_0x68d28c['id'];if(_0x1c2f50[_0x2a66('0x47')][_0x2a66('0x52')]){_0x128aa3['where']=_['merge'](_0x128aa3[_0x2a66('0x50')],{'$or':_['map'](_0x128aa3[_0x2a66('0x4c')],function(_0x31f7f6){var _0x99e3c3={};_0x99e3c3[_0x31f7f6]={'$like':'%'+_0x1c2f50[_0x2a66('0x47')][_0x2a66('0x52')]+'%'};return _0x99e3c3;})});}_0x128aa3=_[_0x2a66('0x53')]({},_0x128aa3,_0x1c2f50['options']);return db[_0x2a66('0x68')][_0x2a66('0x31')]({'where':_0x128aa3[_0x2a66('0x50')]})[_0x2a66('0x36')](function(_0x35b679){_0x113f7b[_0x2a66('0x31')]=_0x35b679;if(_0x1c2f50[_0x2a66('0x47')]['includeAll']){_0x128aa3[_0x2a66('0x5a')]=[{'all':!![]}];}return db[_0x2a66('0x68')]['findAll'](_0x128aa3);})[_0x2a66('0x36')](function(_0x57f596){_0x113f7b['rows']=_0x57f596;return _0x113f7b;});}})['then'](respondWithFilteredResult(_0x2a0690,_0x128aa3))[_0x2a66('0x29')](handleError(_0x2a0690,null));};exports[_0x2a66('0x6a')]=function(_0xb962b5,_0x505486,_0x4ec606){return db[_0x2a66('0x42')]['find']({'where':{'id':_0xb962b5[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x505486,null))['then'](function(_0x33fc4a){if(_0x33fc4a){return _0x33fc4a[_0x2a66('0x6a')](_0xb962b5[_0x2a66('0x47')]['ids']);}})[_0x2a66('0x36')](respondWithStatusCode(_0x505486,null))['catch'](handleError(_0x505486,null));};exports[_0x2a66('0x6b')]=function(_0x199eaa,_0x2bf15f,_0x383961){if(_0x199eaa['body']['id']){delete _0x199eaa[_0x2a66('0x62')]['id'];}return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0x199eaa[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x2bf15f,null))['then'](function(_0x11d8fd){if(_0x11d8fd){_0x199eaa[_0x2a66('0x62')][_0x2a66('0x65')]=_0x11d8fd['id'];return db[_0x2a66('0x6c')][_0x2a66('0x60')](_0x199eaa[_0x2a66('0x62')]);}})['then'](respondWithResult(_0x2bf15f,null))[_0x2a66('0x29')](handleError(_0x2bf15f,null));};exports[_0x2a66('0x6d')]=function(_0x23c86e,_0x127dd2,_0xfbf6e5){var _0x2d90b9={'raw':![],'where':{}};var _0x1450f8={};var _0x5a29a0={'count':0x0,'rows':[]};return db[_0x2a66('0x42')]['findOne']({'where':{'id':_0x23c86e[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x127dd2,null))['then'](function(_0x1bc1e1){if(_0x1bc1e1){_0x1450f8['model']=_['keys'](db[_0x2a66('0x6c')][_0x2a66('0x43')]);_0x1450f8[_0x2a66('0x47')]=_[_0x2a66('0x48')](_0x23c86e[_0x2a66('0x47')]);_0x1450f8[_0x2a66('0x49')]=_[_0x2a66('0x4a')](_0x1450f8[_0x2a66('0x46')],_0x1450f8[_0x2a66('0x47')]);_0x2d90b9[_0x2a66('0x4c')]=_['intersection'](_0x1450f8[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x23c86e[_0x2a66('0x47')][_0x2a66('0x4b')]));_0x2d90b9['attributes']=_0x2d90b9[_0x2a66('0x4c')][_0x2a66('0x4d')]?_0x2d90b9[_0x2a66('0x4c')]:_0x1450f8['model'];if(!_0x23c86e[_0x2a66('0x47')][_0x2a66('0x6e')](_0x2a66('0x69'))){_0x2d90b9[_0x2a66('0x30')]=qs['limit'](_0x23c86e[_0x2a66('0x47')][_0x2a66('0x30')]);_0x2d90b9['offset']=qs[_0x2a66('0x2e')](_0x23c86e['query']['offset']);}_0x2d90b9[_0x2a66('0x4e')]=qs[_0x2a66('0x4f')](_0x23c86e[_0x2a66('0x47')][_0x2a66('0x4f')]);_0x2d90b9[_0x2a66('0x50')]=qs[_0x2a66('0x49')](_[_0x2a66('0x51')](_0x23c86e[_0x2a66('0x47')],_0x1450f8[_0x2a66('0x49')]));_0x2d90b9['where'][_0x2a66('0x65')]=_0x1bc1e1['id'];if(_0x23c86e[_0x2a66('0x47')][_0x2a66('0x52')]){_0x2d90b9[_0x2a66('0x50')]=_[_0x2a66('0x53')](_0x2d90b9['where'],{'$or':_['map'](_0x2d90b9[_0x2a66('0x4c')],function(_0x2d16dc){var _0x5253bd={};_0x5253bd[_0x2d16dc]={'$like':'%'+_0x23c86e[_0x2a66('0x47')]['filter']+'%'};return _0x5253bd;})});}_0x2d90b9=_['merge']({},_0x2d90b9,_0x23c86e[_0x2a66('0x55')]);return db[_0x2a66('0x6c')][_0x2a66('0x31')]({'where':_0x2d90b9[_0x2a66('0x50')]})[_0x2a66('0x36')](function(_0x743134){_0x5a29a0[_0x2a66('0x31')]=_0x743134;if(_0x23c86e['query'][_0x2a66('0x59')]){_0x2d90b9[_0x2a66('0x5a')]=[{'all':!![]}];}return db[_0x2a66('0x6c')][_0x2a66('0x56')](_0x2d90b9);})[_0x2a66('0x36')](function(_0x2aa8d6){_0x5a29a0[_0x2a66('0x6f')]=_0x2aa8d6;return _0x5a29a0;});}})[_0x2a66('0x36')](respondWithFilteredResult(_0x127dd2,_0x2d90b9))[_0x2a66('0x29')](handleError(_0x127dd2,null));};exports[_0x2a66('0x70')]=function(_0x34252f,_0x58fb82,_0x2b7904){return db[_0x2a66('0x42')]['find']({'where':{'id':_0x34252f['params']['id']}})['then'](handleEntityNotFound(_0x58fb82,null))['then'](function(_0x56ed29){if(_0x56ed29){return _0x56ed29[_0x2a66('0x70')](_0x34252f[_0x2a66('0x47')]['ids']);}})[_0x2a66('0x36')](respondWithStatusCode(_0x58fb82,null))[_0x2a66('0x29')](handleError(_0x58fb82,null));};exports[_0x2a66('0x71')]=function(_0xeb4959,_0x2e8160,_0x30b2b1){var _0x5df46d={'channel':'sms'};var _0x3020a5=[];var _0x431d28=[];var _0x295305={};return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0xeb4959[_0x2a66('0x58')]['id']},'include':[{'model':db[_0x2a66('0x72')],'as':'Applications'}]})[_0x2a66('0x36')](handleEntityNotFound(_0x2e8160,null))[_0x2a66('0x36')](function(_0x233e07){_0x5df46d['account']=_0x233e07;_0x5df46d[_0x2a66('0x73')]=_['orderBy'](_0x233e07[_0x2a66('0x74')],['priority'],[_0x2a66('0x75')]);if(_0x5df46d[_0x2a66('0x76')]['Applications']){delete _0x5df46d['account'][_0x2a66('0x74')];}return db[_0x2a66('0x77')][_0x2a66('0x63')]();})[_0x2a66('0x36')](function(_0x1e6bb1){if(!_0x1e6bb1){throw new db['Sequelize'][(_0x2a66('0x78'))](_0x2a66('0x79'));}_0x3020a5=_[_0x2a66('0x7a')](_['keys'](_0x1e6bb1),[_0x2a66('0x7b'),_0x2a66('0x7c')]);_0x431d28=_[_0x2a66('0x7a')](_['keys'](_0x1e6bb1),[_0x2a66('0x7b'),_0x2a66('0x7c'),_0x2a66('0x7d'),_0x2a66('0x7e')]);_0x5df46d[_0x2a66('0x62')]={'mapKey':'mobile'};if(_0x5df46d[_0x2a66('0x76')][_0x2a66('0x45')]){switch(_0x5df46d[_0x2a66('0x76')]['type']){case _0x2a66('0x7f'):_0x5df46d['body']['from']=_0xeb4959[_0x2a66('0x62')]['From'];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x80')];_0x5df46d['body'][_0x2a66('0x81')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x82')];break;case _0x2a66('0x83'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]='+'+_0xeb4959[_0x2a66('0x62')][_0x2a66('0x85')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x86')];break;case _0x2a66('0x87'):_0x5df46d['body'][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x84')];_0x5df46d['body'][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x27')];break;case _0x2a66('0x88'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x84')];_0x5df46d['body']['body']=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x62')];_0x5df46d[_0x2a66('0x62')]['messageId']=_0xeb4959[_0x2a66('0x62')]['message_id'];break;case _0x2a66('0x89'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x8a')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')]['Text'];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x81')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x8b')];break;case _0x2a66('0x8c'):_0x5df46d['body'][_0x2a66('0x84')]='+'+_0xeb4959[_0x2a66('0x62')][_0x2a66('0x8d')][0x0][_0x2a66('0x84')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x8d')][0x0][_0x2a66('0x86')];_0x5df46d['body']['messageId']=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x8d')][0x0][_0x2a66('0x81')];break;case _0x2a66('0x8e'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]=_0xeb4959['body'][_0x2a66('0x8f')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')]['segmentedMessage'][_0x2a66('0x27')];break;case'clickatell':_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x90')];_0x5df46d['body']['body']=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x86')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x81')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x91')];break;case _0x2a66('0x92'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x81')]=_0xeb4959[_0x2a66('0x62')][0x0]['message']['id'];_0x5df46d['body'][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')][0x0][_0x2a66('0x27')][_0x2a66('0x84')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][0x0][_0x2a66('0x27')][_0x2a66('0x86')];break;case _0x2a66('0x93'):_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')]=_0xeb4959[_0x2a66('0x62')]['from'];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]=_0xeb4959[_0x2a66('0x62')][_0x2a66('0x27')];_0x5df46d[_0x2a66('0x62')][_0x2a66('0x81')]=_0xeb4959['body'][_0x2a66('0x94')];break;}}if(_0x5df46d[_0x2a66('0x62')]['id']){delete _0x5df46d[_0x2a66('0x62')]['id'];}if(_[_0x2a66('0x95')](_0x5df46d['body'][_0x2a66('0x84')])){throw new db[(_0x2a66('0x96'))][(_0x2a66('0x78'))]('from\x20is\x20mandatory');}if(_[_0x2a66('0x95')](_0x5df46d['body'][_0x2a66('0x62')])||_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')]===''){throw new db[(_0x2a66('0x96'))][(_0x2a66('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2a66('0x95')](_0x5df46d[_0x2a66('0x62')][_0x2a66('0x97')])){throw new db['Sequelize']['ValidationError'](_0x2a66('0x98')+_0x431d28);}if(!_[_0x2a66('0x99')](_0x431d28,_0x5df46d['body']['mapKey'])){throw new db[(_0x2a66('0x96'))][(_0x2a66('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x431d28);}_0x295305[_0x5df46d[_0x2a66('0x62')]['mapKey']]=_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')];return db[_0x2a66('0x9a')][_0x2a66('0x5d')]({'where':{'id':_0x5df46d[_0x2a66('0x76')][_0x2a66('0x7e')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x295305,'limit':0x1,'order':[[_0x2a66('0x7c'),'DESC']]}]});})[_0x2a66('0x36')](handleEntityNotFound(_0x2e8160,null))[_0x2a66('0x36')](function(_0x20467c){if(_0x20467c){_0x5df46d[_0x2a66('0x9b')]=_[_0x2a66('0x9c')](_0x20467c,[_0x2a66('0x9d')]);if(_0x20467c[_0x2a66('0x9d')]['length']){return _0x20467c['Contacts'][0x0];}var _0x28742a=_['defaults'](_0x5df46d[_0x2a66('0x62')],{'firstName':_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')],'ListId':_0x20467c['id']});_0x28742a[_0x5df46d[_0x2a66('0x62')][_0x2a66('0x97')]]=_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')];return db[_0x2a66('0x77')]['create'](_0x28742a,{'fields':_0x3020a5,'raw':!![]});}})[_0x2a66('0x36')](handleEntityNotFound(_0x2e8160,null))[_0x2a66('0x36')](function(_0x1f5db3){if(_0x1f5db3){_0x5df46d['contact']=_0x1f5db3;var _0x441ff7={'ContactId':_0x1f5db3['id'],'phone':_0x5df46d[_0x2a66('0x62')][_0x2a66('0x84')],'SmsAccountId':_0xeb4959[_0x2a66('0x58')]['id']};var _0x52ad6b={'ContactId':_0x1f5db3['id'],'SmsAccountId':_0xeb4959['params']['id'],'closed':![]};return db[_0x2a66('0x9e')]['find']({'where':_0x52ad6b})[_0x2a66('0x36')](function(_0x2d47b2){if(_0x2d47b2){return[_0x2d47b2,![]];}return db[_0x2a66('0x9e')][_0x2a66('0x60')](_0x441ff7)[_0x2a66('0x36')](function(_0x40b981){return[_0x40b981,!![]];});});}})[_0x2a66('0x9f')](function(_0x4c4376,_0x3c4687){_0x5df46d['interaction']=_0x4c4376[_0x2a66('0x38')]({'plain':!![]});_0x5df46d[_0x2a66('0xa0')][_0x2a66('0xa1')]=![];if(_0x3c4687){if(_0x5df46d[_0x2a66('0x76')][_0x2a66('0xa2')]){_0x5df46d[_0x2a66('0x73')]['push']({'id':0x0,'priority':_0x5df46d[_0x2a66('0x73')][_0x2a66('0x4d')]+0x1,'app':'close','appdata':_0x2a66('0xa3'),'interval':_0x2a66('0xa4')});}_0x5df46d[_0x2a66('0xa0')][_0x2a66('0xa1')]=!![];}return db[_0x2a66('0xa5')][_0x2a66('0x60')]({'phone':_0x5df46d['body']['from'],'messageId':_0x5df46d[_0x2a66('0x62')][_0x2a66('0x81')],'body':_0x5df46d[_0x2a66('0x62')][_0x2a66('0x62')],'SmsAccountId':_0xeb4959[_0x2a66('0x58')]['id'],'SmsInteractionId':_0x4c4376['id'],'direction':'in','ContactId':_0x4c4376[_0x2a66('0xa6')],'AttachmentId':_0x5df46d[_0x2a66('0x62')][_0x2a66('0xa7')]});})[_0x2a66('0x36')](function(_0x30fa17){_0x5df46d['message']=_0x30fa17;if(_0x5df46d[_0x2a66('0xa0')][_0x2a66('0xa8')]){return db[_0x2a66('0xa9')][_0x2a66('0x5d')]({'attributes':['id',_0x2a66('0x3c')],'where':{'id':_0x5df46d['interaction'][_0x2a66('0xa8')]}})[_0x2a66('0x36')](function(_0x27c31d){if(_0x27c31d){_0x5df46d[_0x2a66('0x73')][_0x2a66('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x27c31d[_0x2a66('0x3c')]+','+(_0x5df46d['account'][_0x2a66('0xab')]||0xa),'interval':_0x2a66('0xa4')});}return respondWithRpcPromise(_0x2a66('0xac'),_0x2a66('0xad'),_0x5df46d);});}return respondWithRpcPromise(_0x2a66('0xac'),_0x2a66('0xad'),_0x5df46d);})['then'](function(_0x1a60d3){if(_0x1a60d3){var _0x1c7395=0xc8;var _0x285b1d=_0x2a66('0xae');logger[_0x2a66('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x285b1d,_0x1c7395,_0x2a66('0xaf'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x285b1d,_0x1c7395,_0x2a66('0xaf'),JSON[_0x2a66('0x23')](_0x1a60d3));if(_0x5df46d[_0x2a66('0x76')][_0x2a66('0x45')]==='twilio'){return _0x2e8160[_0x2a66('0x2b')](_0x1c7395)[_0x2a66('0x32')](_0x2a66('0xb0'),'text/xml')[_0x2a66('0x3d')](_0x2a66('0xb1'));}else{return _0x2e8160[_0x2a66('0x2b')](_0x1c7395)[_0x2a66('0x2d')](_0x1a60d3);}}})[_0x2a66('0x29')](handleError(_0x2e8160,null));};exports[_0x2a66('0xb2')]=function(_0x347f0f,_0x416e63){var _0x3d5c4b=_0x347f0f['params']['id'];var _0x43e418=_0x347f0f[_0x2a66('0x62')];var _0x15029d=0xc8;var _0xebf0f0=null;return db[_0x2a66('0xb3')]['transaction']({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x2a66('0xb4')]},function(_0x5eebed){return db[_0x2a66('0x42')][_0x2a66('0x67')]({'where':{'id':_0x3d5c4b},'transaction':_0x5eebed})[_0x2a66('0x36')](function(_0x1c2cf7){if(_0x1c2cf7){return db[_0x2a66('0x72')]['destroy']({'where':{'SmsAccountId':_0x3d5c4b},'transaction':_0x5eebed})['then'](function(){var _0x1089af=_[_0x2a66('0x41')](_0x43e418,function(_0x295c1d){_0x295c1d[_0x2a66('0x65')]=_0x3d5c4b;return _0x295c1d;});return db[_0x2a66('0x72')]['bulkCreate'](_0x1089af,{'transaction':_0x5eebed});});}else{_0x15029d=0x194;_0xebf0f0=[];}});})[_0x2a66('0x36')](function(){if(_0x15029d!==0x194){return db[_0x2a66('0x72')][_0x2a66('0xb5')]({'where':{'SmsAccountId':_0x3d5c4b},'order':_0x2a66('0xb6')})[_0x2a66('0x36')](function(_0x1c9fa9){_0xebf0f0=_0x1c9fa9;});}})[_0x2a66('0x29')](function(_0x111177){_0x15029d=0x1f4;logger[_0x2a66('0x24')](_0x111177['stack']);if(_0x111177[_0x2a66('0x3c')]){delete _0x111177[_0x2a66('0x3c')];}_0xebf0f0=_0x111177;})['finally'](function(){if(_0xebf0f0===null){_0x416e63['sendStatus'](_0x15029d);}else{if(_0x15029d===0x1f4){_0x416e63[_0x2a66('0x2b')](_0x15029d)[_0x2a66('0x3d')](_0xebf0f0);}else{_0x416e63[_0x2a66('0x2b')](_0x15029d)[_0x2a66('0x2d')](_0xebf0f0);}}});};exports[_0x2a66('0xb7')]=function(_0x39fd30,_0x90b05d,_0xe245b7){var _0x1ccb73={};var _0x14364c={};var _0x55c501;var _0x299341;return db['SmsAccount'][_0x2a66('0x67')]({'where':{'id':_0x39fd30[_0x2a66('0x58')]['id']}})['then'](handleEntityNotFound(_0x90b05d,null))['then'](function(_0x3479d8){if(_0x3479d8){_0x55c501=_0x3479d8;_0x14364c[_0x2a66('0x46')]=_[_0x2a66('0x48')](db[_0x2a66('0x72')][_0x2a66('0x43')]);_0x14364c[_0x2a66('0x47')]=_[_0x2a66('0x48')](_0x39fd30[_0x2a66('0x47')]);_0x14364c[_0x2a66('0x49')]=_[_0x2a66('0x4a')](_0x14364c[_0x2a66('0x46')],_0x14364c[_0x2a66('0x47')]);_0x1ccb73[_0x2a66('0x4c')]=_['intersection'](_0x14364c[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x39fd30[_0x2a66('0x47')][_0x2a66('0x4b')]));_0x1ccb73['attributes']=_0x1ccb73['attributes'][_0x2a66('0x4d')]?_0x1ccb73[_0x2a66('0x4c')]:_0x14364c[_0x2a66('0x46')];_0x1ccb73['order']=qs['sort'](_0x39fd30['query'][_0x2a66('0x4f')]);_0x1ccb73[_0x2a66('0x50')]=qs[_0x2a66('0x49')](_[_0x2a66('0x51')](_0x39fd30['query'],_0x14364c[_0x2a66('0x49')]));if(_0x39fd30['query'][_0x2a66('0x52')]){_0x1ccb73[_0x2a66('0x50')]=_[_0x2a66('0x53')](_0x1ccb73['where'],{'$or':_[_0x2a66('0x41')](_0x1ccb73[_0x2a66('0x4c')],function(_0x4bd3d5){var _0x37a010={};_0x37a010[_0x4bd3d5]={'$like':'%'+_0x39fd30[_0x2a66('0x47')][_0x2a66('0x52')]+'%'};return _0x37a010;})});}_0x1ccb73=_[_0x2a66('0x53')]({},_0x1ccb73,_0x39fd30[_0x2a66('0x55')]);return _0x55c501[_0x2a66('0xb7')](_0x1ccb73);}})[_0x2a66('0x36')](function(_0x41e64c){if(_0x41e64c){_0x299341=_0x41e64c[_0x2a66('0x4d')];if(!_0x39fd30[_0x2a66('0x47')]['hasOwnProperty'](_0x2a66('0x69'))){_0x1ccb73['limit']=qs[_0x2a66('0x30')](_0x39fd30[_0x2a66('0x47')][_0x2a66('0x30')]);_0x1ccb73[_0x2a66('0x2e')]=qs[_0x2a66('0x2e')](_0x39fd30['query'][_0x2a66('0x2e')]);}return _0x55c501[_0x2a66('0xb7')](_0x1ccb73);}})[_0x2a66('0x36')](function(_0x29860f){if(_0x29860f){return _0x29860f?{'count':_0x299341,'rows':_0x29860f}:null;}})[_0x2a66('0x36')](respondWithResult(_0x90b05d,null))[_0x2a66('0x29')](handleError(_0x90b05d,null));};exports['getInteractions']=function(_0x30a2d3,_0x5e1946,_0x1e1505){var _0x1494fa={'raw':![],'where':{}};var _0xc40ac1={};var _0x244cdf={'count':0x0,'rows':[]};return db[_0x2a66('0x42')][_0x2a66('0x67')]({'where':{'id':_0x30a2d3[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x5e1946,null))[_0x2a66('0x36')](function(_0x7ed58f){if(_0x7ed58f){_0xc40ac1[_0x2a66('0x46')]=_[_0x2a66('0x48')](db['SmsInteraction'][_0x2a66('0x43')]);_0xc40ac1[_0x2a66('0x47')]=_['keys'](_0x30a2d3[_0x2a66('0x47')]);_0xc40ac1[_0x2a66('0x49')]=_['intersection'](_0xc40ac1[_0x2a66('0x46')],_0xc40ac1[_0x2a66('0x47')]);_0x1494fa[_0x2a66('0x4c')]=_['intersection'](_0xc40ac1[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x30a2d3[_0x2a66('0x47')][_0x2a66('0x4b')]));_0x1494fa[_0x2a66('0x4c')]=_0x1494fa[_0x2a66('0x4c')][_0x2a66('0x4d')]?_0x1494fa[_0x2a66('0x4c')]:_0xc40ac1[_0x2a66('0x46')];if(!_0x30a2d3['query']['hasOwnProperty'](_0x2a66('0x69'))){_0x1494fa[_0x2a66('0x30')]=qs[_0x2a66('0x30')](_0x30a2d3[_0x2a66('0x47')][_0x2a66('0x30')]);_0x1494fa['offset']=qs[_0x2a66('0x2e')](_0x30a2d3[_0x2a66('0x47')]['offset']);}_0x1494fa[_0x2a66('0x4e')]=qs[_0x2a66('0x4f')](_0x30a2d3[_0x2a66('0x47')][_0x2a66('0x4f')]);_0x1494fa['where']=qs['filters'](_[_0x2a66('0x51')](_0x30a2d3['query'],_0xc40ac1[_0x2a66('0x49')]));_0x1494fa[_0x2a66('0x50')][_0x2a66('0x65')]=_0x7ed58f['id'];if(_0x30a2d3['query']['filter']){_0x1494fa[_0x2a66('0x50')]=_[_0x2a66('0x53')](_0x1494fa[_0x2a66('0x50')],{'$or':_[_0x2a66('0x41')](_0x1494fa[_0x2a66('0x4c')],function(_0x2c1994){var _0x4fb859={};_0x4fb859[_0x2c1994]={'$like':'%'+_0x30a2d3[_0x2a66('0x47')]['filter']+'%'};return _0x4fb859;})});}_0x1494fa=_[_0x2a66('0x53')]({},_0x1494fa,_0x30a2d3[_0x2a66('0x55')]);return db[_0x2a66('0x9e')][_0x2a66('0x31')]({'where':_0x1494fa[_0x2a66('0x50')]})[_0x2a66('0x36')](function(_0x4fc589){_0x244cdf['count']=_0x4fc589;if(_0x30a2d3['query']['includeAll']){_0x1494fa[_0x2a66('0x5a')]=[{'model':db[_0x2a66('0x77')],'as':_0x2a66('0xb8'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x2a66('0x3c'),_0x2a66('0xb9'),'internal'],'required':![]},{'model':db[_0x2a66('0xba')],'as':'Tags','attributes':['id',_0x2a66('0x3c'),'color'],'where':_0x30a2d3[_0x2a66('0x47')][_0x2a66('0xbb')]?{'id':_0x30a2d3[_0x2a66('0x47')][_0x2a66('0xbb')]}:undefined,'required':_0x30a2d3['query']['tag']?!![]:![]}];}return db[_0x2a66('0x9e')][_0x2a66('0x56')](_0x1494fa);})[_0x2a66('0x36')](function(_0xbc8bc0){_0x244cdf[_0x2a66('0x6f')]=_0xbc8bc0;return _0x244cdf;});}})[_0x2a66('0x36')](respondWithFilteredResult(_0x5e1946,_0x1494fa))[_0x2a66('0x29')](handleError(_0x5e1946,null));};exports[_0x2a66('0x3d')]=function(_0x52ab91,_0x57dc5c,_0x2b7d9a){var _0x3631af,_0x582d31,_0x2f36a2;if(_[_0x2a66('0x95')](_0x52ab91[_0x2a66('0x62')][_0x2a66('0x62')])||_0x52ab91['body']['body']===''){throw new db['Sequelize'][(_0x2a66('0x78'))](_0x2a66('0xbc'));}if(_[_0x2a66('0x95')](_0x52ab91[_0x2a66('0x62')]['to'])){throw new db['Sequelize'][(_0x2a66('0x78'))](_0x2a66('0xbd'));}_0x3631af=_0x52ab91[_0x2a66('0x62')]['to'];return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0x52ab91[_0x2a66('0x58')]['id']},'include':[{'model':db[_0x2a66('0x9a')],'as':_0x2a66('0xbe'),'include':[{'model':db[_0x2a66('0x77')],'as':'Contacts','where':{'mobile':_0x3631af},'limit':0x1,'order':[[_0x2a66('0x7c'),_0x2a66('0xbf')]]}]}]})[_0x2a66('0x36')](handleEntityNotFound(_0x57dc5c,null))['then'](function(_0x5934a8){if(_0x5934a8&&_0x5934a8['List']){_0x582d31=_0x5934a8['get']({'plain':!![]});if(_0x582d31[_0x2a66('0xbe')]&&_0x582d31[_0x2a66('0xbe')][_0x2a66('0x9d')][_0x2a66('0x4d')]){return _0x582d31['List'][_0x2a66('0x9d')][0x0];}return db[_0x2a66('0x77')][_0x2a66('0x60')](_['defaults'](_0x52ab91[_0x2a66('0x62')],{'firstName':_0x3631af,'mobile':_0x3631af,'phone':_0x3631af,'ListId':_0x582d31['ListId']}));}})[_0x2a66('0x36')](handleEntityNotFound(_0x57dc5c,null))[_0x2a66('0x36')](function(_0x448e30){if(_0x448e30){_0x2f36a2=_0x448e30;return db[_0x2a66('0x9e')][_0x2a66('0x5d')]({'where':{'ContactId':_0x2f36a2['id'],'closed':![],'SmsAccountId':_0x582d31['id']}})[_0x2a66('0x36')](function(_0x2618c4){if(_0x2618c4){return[_0x2618c4,![]];}return db[_0x2a66('0x9e')][_0x2a66('0x60')]({'UserId':_0x52ab91[_0x2a66('0xc0')]['id'],'ContactId':_0x2f36a2['id'],'SmsAccountId':_0x582d31['id'],'phone':_0x3631af,'firstMsgDirection':_0x2a66('0xc1'),'Messages':[_[_0x2a66('0x53')](_0x52ab91['body'],{'read':![],'body':_0x52ab91[_0x2a66('0x62')][_0x2a66('0x62')],'phone':_0x3631af,'SmsAccountId':_0x582d31['id'],'UserId':_0x52ab91[_0x2a66('0xc0')]['id'],'ContactId':_0x2f36a2['id']})]},{'include':[{'model':db[_0x2a66('0xa5')],'as':_0x2a66('0xc2')}]})[_0x2a66('0x36')](function(_0x4b82d3){return[_0x4b82d3,!![]];});});}})[_0x2a66('0x9f')](function(_0x54dc40,_0x1dfeab){if(_0x1dfeab){return _0x54dc40;}return db[_0x2a66('0xa5')][_0x2a66('0x60')](_[_0x2a66('0x53')](_0x52ab91['body'],{'read':![],'body':_0x52ab91[_0x2a66('0x62')][_0x2a66('0x62')],'phone':_0x3631af,'SmsAccountId':_0x582d31['id'],'SmsInteractionId':_0x54dc40['id'],'UserId':_0x52ab91[_0x2a66('0xc0')]['id'],'ContactId':_0x2f36a2['id']}))[_0x2a66('0x36')](function(_0x5895b7){_0x54dc40['dataValues'][_0x2a66('0xc2')]=[];_0x54dc40[_0x2a66('0xc3')]['Messages']['push'](_0x5895b7['dataValues']);return _0x54dc40;});})[_0x2a66('0x36')](respondWithResult(_0x57dc5c,null))[_0x2a66('0x29')](handleError(_0x57dc5c,null));};exports[_0x2a66('0x2b')]=function(_0x599340,_0xe937fe,_0x26405c){if(_0x599340['body']['id']){delete _0x599340[_0x2a66('0x62')]['id'];}var _0x4ffc5b,_0x143e86,_0x416141;return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0x599340[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0xe937fe,null))[_0x2a66('0x36')](function(_0x1371ab){if(_0x1371ab){_0x416141=_0x1371ab;logger[_0x2a66('0x21')](_0x2a66('0x22'),_0x2a66('0x2b'),'received\x20delivery\x20report\x20from',_0x1371ab[_0x2a66('0x45')],util[_0x2a66('0xc4')](_0x599340['body'],{'showHidden':![],'depth':null}));switch(_0x1371ab[_0x2a66('0x45')]){case _0x2a66('0x83'):if(_0x599340['body'][_0x2a66('0xc5')]&&_0x599340[_0x2a66('0x62')][_0x2a66('0x2b')]){_0x143e86=_0x599340[_0x2a66('0x62')]['status'];return db['SmsMessage'][_0x2a66('0x5d')]({'where':{'messageId':_0x599340['body'][_0x2a66('0xc5')]}});}break;case'connectel':if(_0x599340[_0x2a66('0x62')][_0x2a66('0xc6')]&&_0x599340[_0x2a66('0x62')][_0x2a66('0xc7')]){_0x143e86=_0x599340[_0x2a66('0x62')]['statusInt'];return db[_0x2a66('0xa5')][_0x2a66('0x5d')]({'where':{'messageId':_0x599340[_0x2a66('0x62')][_0x2a66('0xc6')]}});}break;case _0x2a66('0x88'):if(_0x599340[_0x2a66('0x62')]['message_id']&&_0x599340[_0x2a66('0x62')][_0x2a66('0xc8')]){_0x143e86=_0x599340[_0x2a66('0x62')][_0x2a66('0xc8')];return db[_0x2a66('0xa5')][_0x2a66('0x5d')]({'where':{'messageId':_0x599340[_0x2a66('0x62')]['message_id']}});}break;case _0x2a66('0x8c'):var _0x9e9b4b=_0x599340[_0x2a66('0x62')][_0x2a66('0x8d')][0x0];if(_0x9e9b4b[_0x2a66('0x81')]&&_0x9e9b4b['status'][_0x2a66('0xc9')]===_0x2a66('0xca')){_0x143e86=_0x9e9b4b[_0x2a66('0x2b')][_0x2a66('0xc9')];return db['SmsMessage'][_0x2a66('0x5d')]({'where':{'messageId':_0x9e9b4b[_0x2a66('0x81')]}});}break;case _0x2a66('0xcb'):if(_0x599340[_0x2a66('0x62')][_0x2a66('0x81')]&&_0x599340['body'][_0x2a66('0x2b')]){_0x143e86=_0x599340[_0x2a66('0x62')][_0x2a66('0x2b')];return db['SmsMessage'][_0x2a66('0x5d')]({'where':{'messageId':_0x599340[_0x2a66('0x62')]['messageId']}});}break;case _0x2a66('0x92'):if(_0x599340['body'][0x0][_0x2a66('0x27')]['id']){_0x143e86=_0x599340[_0x2a66('0x62')][0x0][_0x2a66('0x45')];return db[_0x2a66('0xa5')]['find']({'where':{'messageId':_0x599340[_0x2a66('0x62')][0x0][_0x2a66('0x27')]['id']}});}break;case _0x2a66('0x93'):if(_0x599340[_0x2a66('0x62')][_0x2a66('0xcc')]&&_0x599340[_0x2a66('0x62')][_0x2a66('0x2b')]){_0x143e86=_0x599340[_0x2a66('0x62')][_0x2a66('0x2b')];return db['SmsMessage'][_0x2a66('0x5d')]({'where':{'messageId':_0x599340[_0x2a66('0x62')][_0x2a66('0xcc')]}});}break;}}})[_0x2a66('0x36')](handleEntityNotFound(_0xe937fe,null))['then'](function(_0x4371e6){if(_0x4371e6){_0x4ffc5b=_0x4371e6;switch(_0x416141[_0x2a66('0x45')]){case'skebby':if(_0x143e86==='DELIVERED'){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger['error'](_0x2a66('0x22'),'status',_0x2a66('0x83'),util[_0x2a66('0xc4')](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a66('0x87'):if(_0x143e86==='1'){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),_0x2a66('0x2b'),'skebby',util[_0x2a66('0xc4')](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a66('0x88'):if(!_0x599340['body'][_0x2a66('0xcd')]&&_0x143e86>=0xc8&&_0x143e86<=0xce){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),_0x2a66('0x2b'),_0x2a66('0x88'),util[_0x2a66('0xc4')](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x33509c=_0x599340[_0x2a66('0x62')][_0x2a66('0x8d')][0x0];if(_0x33509c['status'][_0x2a66('0xc9')]==='DELIVERED'){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),_0x2a66('0x2b'),_0x2a66('0x8c'),util[_0x2a66('0xc4')](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x143e86==_0x2a66('0xce')||_0x143e86==_0x2a66('0xcf')){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),'status','clickatell',util[_0x2a66('0xc4')](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x143e86=='message-delivered'){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),'status',_0x2a66('0x92'),util['inspect'](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;case _0x2a66('0x93'):if(_0x143e86===_0x2a66('0xd0')||_0x143e86===_0x2a66('0xd1')){return _0x4ffc5b[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),_0x2a66('0x2b'),_0x2a66('0x93'),util['inspect'](_0x599340[_0x2a66('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x4ffc5b;}})[_0x2a66('0x36')](respondWithResult(_0xe937fe,null))[_0x2a66('0x29')](handleError(_0xe937fe,null));};exports[_0x2a66('0xd2')]=function(_0x1ca09c,_0x2e108d,_0x13a994){var _0x5e567a,_0x5e1c95,_0x56c538;return db[_0x2a66('0x42')][_0x2a66('0x5d')]({'where':{'id':_0x1ca09c[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x2e108d,null))['then'](function(_0x47ec18){if(_0x47ec18){_0x56c538=_0x47ec18;logger[_0x2a66('0x21')](_0x2a66('0x22'),'status',_0x2a66('0xd3'),_0x47ec18['type'],util[_0x2a66('0xc4')](_0x1ca09c[_0x2a66('0x47')],{'showHidden':![],'depth':null}));switch(_0x47ec18[_0x2a66('0x45')]){case'csc':if(_0x1ca09c['query']['message-id']&&_0x1ca09c['query'][_0x2a66('0xd4')]){_0x5e1c95=_0x1ca09c[_0x2a66('0x47')][_0x2a66('0xd4')];return db[_0x2a66('0xa5')][_0x2a66('0x5d')]({'where':{'messageId':_0x1ca09c[_0x2a66('0x47')]['message-id']}});}break;}}})[_0x2a66('0x36')](handleEntityNotFound(_0x2e108d,null))[_0x2a66('0x36')](function(_0x4de918){if(_0x4de918){_0x5e567a=_0x4de918;switch(_0x56c538[_0x2a66('0x45')]){case'csc':if(_0x5e1c95==='2'||_0x5e1c95==='6'){return _0x5e567a[_0x2a66('0x35')]({'read':!![]});}else{logger[_0x2a66('0x24')](_0x2a66('0x22'),_0x2a66('0x2b'),_0x2a66('0x8e'),util['inspect'](_0x1ca09c[_0x2a66('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x5e567a;}})['then'](respondWithResult(_0x2e108d,null))['catch'](handleError(_0x2e108d,null));};exports['addAgents']=function(_0x57f067,_0x2c636d,_0x16e9f1){return db[_0x2a66('0x42')]['find']({'where':{'id':_0x57f067[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x2c636d,null))[_0x2a66('0x36')](function(_0x47c355){if(_0x47c355){return _0x47c355[_0x2a66('0xd5')](_0x57f067['body']['ids'],_[_0x2a66('0x9c')](_0x57f067[_0x2a66('0x62')],['ids','id'])||{})[_0x2a66('0x9f')](function(_0x1e5d89){for(var _0x199eda=0x0;_0x199eda<_0x57f067[_0x2a66('0x62')][_0x2a66('0xd6')]['length'];_0x199eda+=0x1){socket[_0x2a66('0xd7')](_0x2a66('0xd8'),{'UserId':Number(_0x57f067[_0x2a66('0x62')]['ids'][_0x199eda]),'SmsAccountId':Number(_0x57f067[_0x2a66('0x58')]['id'])});}return _0x1e5d89;});}})[_0x2a66('0x36')](respondWithResult(_0x2c636d,null))[_0x2a66('0x29')](handleError(_0x2c636d,null));};exports[_0x2a66('0xd9')]=function(_0x2ca701,_0x460311,_0x155ac4){return db[_0x2a66('0x42')]['find']({'where':{'id':_0x2ca701[_0x2a66('0x58')]['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x460311,null))[_0x2a66('0x36')](function(_0xea769d){if(_0xea769d){return _0xea769d[_0x2a66('0xd9')](_0x2ca701[_0x2a66('0x47')][_0x2a66('0xd6')])[_0x2a66('0x36')](function(){if(_['isArray'](_0x2ca701[_0x2a66('0x47')][_0x2a66('0xd6')])){for(var _0xe09217=0x0;_0xe09217<_0x2ca701['query'][_0x2a66('0xd6')]['length'];_0xe09217+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2ca701[_0x2a66('0x47')][_0x2a66('0xd6')][_0xe09217]),'SmsAccountId':Number(_0x2ca701[_0x2a66('0x58')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2ca701[_0x2a66('0x47')][_0x2a66('0xd6')]),'SmsAccountId':Number(_0x2ca701[_0x2a66('0x58')]['id'])});}});}})[_0x2a66('0x36')](respondWithStatusCode(_0x460311,null))['catch'](handleError(_0x460311,null));};exports['getAgents']=function(_0x220d17,_0x3b519b,_0x425b24){var _0x5b30bd={};var _0x5f3b5f={};var _0x36a62e;var _0x1de0d6;return db[_0x2a66('0x42')][_0x2a66('0x67')]({'where':{'id':_0x220d17['params']['id']}})[_0x2a66('0x36')](handleEntityNotFound(_0x3b519b,null))[_0x2a66('0x36')](function(_0x3ab50c){if(_0x3ab50c){_0x36a62e=_0x3ab50c;_0x5f3b5f[_0x2a66('0x46')]=_['keys'](db[_0x2a66('0xa9')][_0x2a66('0x43')]);_0x5f3b5f[_0x2a66('0x47')]=_[_0x2a66('0x48')](_0x220d17['query']);_0x5f3b5f['filters']=_['intersection'](_0x5f3b5f[_0x2a66('0x46')],_0x5f3b5f[_0x2a66('0x47')]);_0x5b30bd['attributes']=_['intersection'](_0x5f3b5f[_0x2a66('0x46')],qs[_0x2a66('0x4b')](_0x220d17['query'][_0x2a66('0x4b')]));_0x5b30bd[_0x2a66('0x4c')]=_0x5b30bd['attributes']['length']?_0x5b30bd[_0x2a66('0x4c')]:_0x5f3b5f['model'];_0x5b30bd[_0x2a66('0x4e')]=qs[_0x2a66('0x4f')](_0x220d17[_0x2a66('0x47')][_0x2a66('0x4f')]);_0x5b30bd[_0x2a66('0x50')]=qs[_0x2a66('0x49')](_[_0x2a66('0x51')](_0x220d17['query'],_0x5f3b5f[_0x2a66('0x49')]));if(_0x220d17[_0x2a66('0x47')][_0x2a66('0x52')]){_0x5b30bd[_0x2a66('0x50')]=_[_0x2a66('0x53')](_0x5b30bd[_0x2a66('0x50')],{'$or':_['map'](_0x5b30bd[_0x2a66('0x4c')],function(_0x122ce4){var _0x5c28e4={};_0x5c28e4[_0x122ce4]={'$like':'%'+_0x220d17['query'][_0x2a66('0x52')]+'%'};return _0x5c28e4;})});}_0x5b30bd=_['merge']({},_0x5b30bd,_0x220d17[_0x2a66('0x55')]);return _0x36a62e[_0x2a66('0xda')](_0x5b30bd);}})[_0x2a66('0x36')](function(_0x5e989c){if(_0x5e989c){_0x1de0d6=_0x5e989c[_0x2a66('0x4d')];if(!_0x220d17[_0x2a66('0x47')]['hasOwnProperty'](_0x2a66('0x69'))){_0x5b30bd[_0x2a66('0x30')]=qs['limit'](_0x220d17[_0x2a66('0x47')][_0x2a66('0x30')]);_0x5b30bd[_0x2a66('0x2e')]=qs['offset'](_0x220d17[_0x2a66('0x47')][_0x2a66('0x2e')]);}return _0x36a62e[_0x2a66('0xda')](_0x5b30bd);}})[_0x2a66('0x36')](function(_0x3ae7da){if(_0x3ae7da){return _0x3ae7da?{'count':_0x1de0d6,'rows':_0x3ae7da}:null;}})[_0x2a66('0x36')](respondWithResult(_0x3b519b,null))['catch'](handleError(_0x3b519b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index d197734..906a28d 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d62=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','update','remove'];(function(_0xdd2d5c,_0x2a60a5){var _0xe780da=function(_0x359e33){while(--_0x359e33){_0xdd2d5c['push'](_0xdd2d5c['shift']());}};_0xe780da(++_0x2a60a5);}(_0x1d62,0x67));var _0x21d6=function(_0x320d99,_0x173f05){_0x320d99=_0x320d99-0x0;var _0x231a6f=_0x1d62[_0x320d99];return _0x231a6f;};'use strict';var EventEmitter=require(_0x21d6('0x0'));var SmsAccount=require(_0x21d6('0x1'))['db'][_0x21d6('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x21d6('0x3'),'afterDestroy':_0x21d6('0x4')};function emitEvent(_0x147f6d){return function(_0xea411d,_0x3255a3,_0x4ecc67){SmsAccountEvents[_0x21d6('0x5')](_0x147f6d+':'+_0xea411d['id'],_0xea411d);SmsAccountEvents['emit'](_0x147f6d,_0xea411d);_0x4ecc67(null);};}for(var e in events){if(events[_0x21d6('0x6')](e)){var event=events[e];SmsAccount[_0x21d6('0x7')](e,emitEvent(event));}}module[_0x21d6('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x362f=['../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x44e0d3,_0x2414e4){var _0x1ad402=function(_0x24d85d){while(--_0x24d85d){_0x44e0d3['push'](_0x44e0d3['shift']());}};_0x1ad402(++_0x2414e4);}(_0x362f,0x1e5));var _0xf362=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x362f[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xf362('0x0'));var SmsAccount=require(_0xf362('0x1'))['db'][_0xf362('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf362('0x3')](0x0);var events={'afterCreate':_0xf362('0x4'),'afterUpdate':'update','afterDestroy':_0xf362('0x5')};function emitEvent(_0x45ecab){return function(_0x4e095a,_0x467654,_0x15d520){SmsAccountEvents[_0xf362('0x6')](_0x45ecab+':'+_0x4e095a['id'],_0x4e095a);SmsAccountEvents['emit'](_0x45ecab,_0x4e095a);_0x15d520(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xf362('0x7')](e,emitEvent(event));}}module[_0xf362('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index bff085a..dcca80b 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe936=['moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x4d0896,_0x19384c){var _0x3d692d=function(_0x4c128a){while(--_0x4c128a){_0x4d0896['push'](_0x4d0896['shift']());}};_0x3d692d(++_0x19384c);}(_0xe936,0x1c5));var _0x6e93=function(_0x5c722e,_0x83c9bd){_0x5c722e=_0x5c722e-0x0;var _0x680a07=_0xe936[_0x5c722e];return _0x680a07;};'use strict';var _=require(_0x6e93('0x0'));var util=require(_0x6e93('0x1'));var logger=require(_0x6e93('0x2'))('api');var moment=require(_0x6e93('0x3'));var BPromise=require(_0x6e93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e93('0x5'));var config=require(_0x6e93('0x6'));var attributes=require(_0x6e93('0x7'));module[_0x6e93('0x8')]=function(_0x530bf1,_0x313ee7){return _0x530bf1[_0x6e93('0x9')](_0x6e93('0xa'),attributes,{'tableName':_0x6e93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3bd=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','../../config/logger','api','bluebird','request-promise'];(function(_0x5f2327,_0x123bcd){var _0x304698=function(_0x5eb594){while(--_0x5eb594){_0x5f2327['push'](_0x5f2327['shift']());}};_0x304698(++_0x123bcd);}(_0xb3bd,0x1d0));var _0xdb3b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb3bd[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb3b('0x0'))(_0xdb3b('0x1'));var moment=require('moment');var BPromise=require(_0xdb3b('0x2'));var rp=require(_0xdb3b('0x3'));var fs=require('fs');var path=require(_0xdb3b('0x4'));var rimraf=require(_0xdb3b('0x5'));var config=require(_0xdb3b('0x6'));var attributes=require(_0xdb3b('0x7'));module[_0xdb3b('0x8')]=function(_0x30039f,_0x55da55){return _0x30039f[_0xdb3b('0x9')](_0xdb3b('0xa'),attributes,{'tableName':_0xdb3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 40f66e1..bf72646 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x362b=['defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','attributes','include','map','model','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x362b,0x10f));var _0xb362=function(_0xf7eabc,_0x44dcea){_0xf7eabc=_0xf7eabc-0x0;var _0x533b37=_0x362b[_0xf7eabc];return _0x533b37;};'use strict';var _=require('lodash');var util=require(_0xb362('0x0'));var moment=require(_0xb362('0x1'));var BPromise=require('bluebird');var rs=require(_0xb362('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb362('0x3'));var logger=require(_0xb362('0x4'))(_0xb362('0x5'));var config=require('../../config/environment');var jayson=require(_0xb362('0x6'));var client=jayson['client'][_0xb362('0x7')]({'port':0x232a});config[_0xb362('0x8')]=_[_0xb362('0x9')](config[_0xb362('0x8')],{'host':_0xb362('0xa'),'port':0x18eb});var socket=require(_0xb362('0xb'))(new Redis(config[_0xb362('0x8')]));require(_0xb362('0xc'))[_0xb362('0xd')](socket);function respondWithRpcPromise(_0x5780e2,_0x68338,_0x1ea6e0){return new BPromise(function(_0x57a9a7,_0x294c7a){return client[_0xb362('0xe')](_0x5780e2,_0x1ea6e0)[_0xb362('0xf')](function(_0x5df427){logger[_0xb362('0x10')](_0xb362('0x11'),_0x68338,_0xb362('0x12'));logger[_0xb362('0x13')](_0xb362('0x14'),_0x68338,_0xb362('0x12'),JSON[_0xb362('0x15')](_0x5df427));if(_0x5df427[_0xb362('0x16')]){if(_0x5df427[_0xb362('0x16')][_0xb362('0x17')]===0x1f4){logger[_0xb362('0x16')](_0xb362('0x11'),_0x68338,_0x5df427[_0xb362('0x16')][_0xb362('0x18')]);return _0x294c7a(_0x5df427['error'][_0xb362('0x18')]);}logger[_0xb362('0x16')](_0xb362('0x11'),_0x68338,_0x5df427[_0xb362('0x16')][_0xb362('0x18')]);return _0x57a9a7(_0x5df427[_0xb362('0x16')][_0xb362('0x18')]);}else{logger[_0xb362('0x10')](_0xb362('0x11'),_0x68338,_0xb362('0x12'));_0x57a9a7(_0x5df427[_0xb362('0x19')]['message']);}})[_0xb362('0x1a')](function(_0x1eafb9){logger[_0xb362('0x16')](_0xb362('0x11'),_0x68338,_0x1eafb9);_0x294c7a(_0x1eafb9);});});}exports[_0xb362('0x1b')]=function(_0x3bc56d){var _0x2523b2=this;return new Promise(function(_0x1b8e2a,_0x59b824){return db[_0xb362('0x1c')]['find']({'raw':_0x3bc56d[_0xb362('0x1d')]?_0x3bc56d[_0xb362('0x1d')][_0xb362('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bc56d[_0xb362('0x1d')]?_0x3bc56d[_0xb362('0x1d')]['where']||null:null,'attributes':_0x3bc56d[_0xb362('0x1d')]?_0x3bc56d[_0xb362('0x1d')][_0xb362('0x1f')]||null:null,'include':_0x3bc56d[_0xb362('0x1d')]?_0x3bc56d[_0xb362('0x1d')][_0xb362('0x20')]?_[_0xb362('0x21')](_0x3bc56d[_0xb362('0x1d')]['include'],function(_0x353e22){return{'model':db[_0x353e22[_0xb362('0x22')]],'as':_0x353e22['as'],'attributes':_0x353e22[_0xb362('0x1f')],'include':_0x353e22['include']?_['map'](_0x353e22[_0xb362('0x20')],function(_0x142500){return{'model':db[_0x142500[_0xb362('0x22')]],'as':_0x142500['as'],'attributes':_0x142500[_0xb362('0x1f')],'include':_0x142500['include']?_[_0xb362('0x21')](_0x142500['include'],function(_0x172dd3){return{'model':db[_0x172dd3[_0xb362('0x22')]],'as':_0x172dd3['as'],'attributes':_0x172dd3[_0xb362('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb362('0xf')](function(_0x74e938){logger[_0xb362('0x10')]('ShowSmsAccount',_0x3bc56d);logger[_0xb362('0x13')]('ShowSmsAccount',_0x3bc56d,JSON['stringify'](_0x74e938));_0x1b8e2a(_0x74e938);})[_0xb362('0x1a')](function(_0x7161c2){logger[_0xb362('0x16')](_0xb362('0x1b'),_0x7161c2[_0xb362('0x18')],_0x3bc56d);_0x59b824(_0x2523b2[_0xb362('0x16')](0x1f4,_0x7161c2[_0xb362('0x18')]));});});}; \ No newline at end of file +var _0x6d1c=['./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x31897c,_0x153ccb){var _0x45899c=function(_0x2bbd57){while(--_0x2bbd57){_0x31897c['push'](_0x31897c['shift']());}};_0x45899c(++_0x153ccb);}(_0x6d1c,0x129));var _0xc6d1=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x6d1c[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0xc6d1('0x0'));var util=require('util');var moment=require(_0xc6d1('0x1'));var BPromise=require(_0xc6d1('0x2'));var rs=require(_0xc6d1('0x3'));var fs=require('fs');var Redis=require(_0xc6d1('0x4'));var db=require(_0xc6d1('0x5'))['db'];var utils=require(_0xc6d1('0x6'));var logger=require('../../config/logger')(_0xc6d1('0x7'));var config=require(_0xc6d1('0x8'));var jayson=require(_0xc6d1('0x9'));var client=jayson[_0xc6d1('0xa')][_0xc6d1('0xb')]({'port':0x232a});config['redis']=_[_0xc6d1('0xc')](config[_0xc6d1('0xd')],{'host':_0xc6d1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc6d1('0xf'))['register'](socket);function respondWithRpcPromise(_0x52c33c,_0x156169,_0x5ecec5){return new BPromise(function(_0x25fd01,_0x58eb66){return client[_0xc6d1('0x10')](_0x52c33c,_0x5ecec5)[_0xc6d1('0x11')](function(_0x4b605d){logger[_0xc6d1('0x12')](_0xc6d1('0x13'),_0x156169,_0xc6d1('0x14'));logger['debug'](_0xc6d1('0x15'),_0x156169,_0xc6d1('0x14'),JSON[_0xc6d1('0x16')](_0x4b605d));if(_0x4b605d[_0xc6d1('0x17')]){if(_0x4b605d[_0xc6d1('0x17')][_0xc6d1('0x18')]===0x1f4){logger[_0xc6d1('0x17')](_0xc6d1('0x13'),_0x156169,_0x4b605d[_0xc6d1('0x17')][_0xc6d1('0x19')]);return _0x58eb66(_0x4b605d[_0xc6d1('0x17')][_0xc6d1('0x19')]);}logger['error'](_0xc6d1('0x13'),_0x156169,_0x4b605d['error']['message']);return _0x25fd01(_0x4b605d['error']['message']);}else{logger[_0xc6d1('0x12')](_0xc6d1('0x13'),_0x156169,_0xc6d1('0x14'));_0x25fd01(_0x4b605d[_0xc6d1('0x1a')][_0xc6d1('0x19')]);}})[_0xc6d1('0x1b')](function(_0x52b73c){logger['error'](_0xc6d1('0x13'),_0x156169,_0x52b73c);_0x58eb66(_0x52b73c);});});}exports[_0xc6d1('0x1c')]=function(_0x4a2b85){var _0x591ccf=this;return new Promise(function(_0x23ca56,_0x4d8762){return db[_0xc6d1('0x1d')][_0xc6d1('0x1e')]({'raw':_0x4a2b85['options']?_0x4a2b85[_0xc6d1('0x1f')][_0xc6d1('0x20')]===undefined?!![]:![]:!![],'where':_0x4a2b85[_0xc6d1('0x1f')]?_0x4a2b85[_0xc6d1('0x1f')][_0xc6d1('0x21')]||null:null,'attributes':_0x4a2b85['options']?_0x4a2b85[_0xc6d1('0x1f')][_0xc6d1('0x22')]||null:null,'include':_0x4a2b85[_0xc6d1('0x1f')]?_0x4a2b85[_0xc6d1('0x1f')][_0xc6d1('0x23')]?_[_0xc6d1('0x24')](_0x4a2b85['options'][_0xc6d1('0x23')],function(_0x4a3a0d){return{'model':db[_0x4a3a0d[_0xc6d1('0x25')]],'as':_0x4a3a0d['as'],'attributes':_0x4a3a0d[_0xc6d1('0x22')],'include':_0x4a3a0d[_0xc6d1('0x23')]?_[_0xc6d1('0x24')](_0x4a3a0d[_0xc6d1('0x23')],function(_0x1d34b3){return{'model':db[_0x1d34b3['model']],'as':_0x1d34b3['as'],'attributes':_0x1d34b3[_0xc6d1('0x22')],'include':_0x1d34b3['include']?_[_0xc6d1('0x24')](_0x1d34b3[_0xc6d1('0x23')],function(_0x3b2c23){return{'model':db[_0x3b2c23[_0xc6d1('0x25')]],'as':_0x3b2c23['as'],'attributes':_0x3b2c23[_0xc6d1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc6d1('0x11')](function(_0x3709c9){logger['info'](_0xc6d1('0x1c'),_0x4a2b85);logger[_0xc6d1('0x26')](_0xc6d1('0x1c'),_0x4a2b85,JSON[_0xc6d1('0x16')](_0x3709c9));_0x23ca56(_0x3709c9);})[_0xc6d1('0x1b')](function(_0x52aa90){logger['error'](_0xc6d1('0x1c'),_0x52aa90[_0xc6d1('0x19')],_0x4a2b85);_0x4d8762(_0x591ccf['error'](0x1f4,_0x52aa90[_0xc6d1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1c5d8ce..f78e237 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 739ca57..f8bbfe4 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x363972,_0x5bc2a0){var _0x17d76a=function(_0x3c5d00){while(--_0x3c5d00){_0x363972['push'](_0x363972['shift']());}};_0x17d76a(++_0x5bc2a0);}(_0x55ca,0x126));var _0xa55c=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x55ca[_0x5c7525];return _0x2e2ec8;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x400293,_0x24a51c){var _0x44f4b7=function(_0x440b9b){while(--_0x440b9b){_0x400293['push'](_0x400293['shift']());}};_0x44f4b7(++_0x24a51c);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a04bc,_0xafe620){_0x1a04bc=_0x1a04bc-0x0;var _0x3b8611=_0xedd9[_0x1a04bc];return _0x3b8611;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9e0befc..0ab0a2d 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe3f=['sequelize','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x3043bb,_0x1d0de2){var _0x178846=function(_0x498dee){while(--_0x498dee){_0x3043bb['push'](_0x3043bb['shift']());}};_0x178846(++_0x1d0de2);}(_0xfe3f,0xb4));var _0xffe3=function(_0x2a327a,_0x1f5a1d){_0x2a327a=_0x2a327a-0x0;var _0x2a6614=_0xfe3f[_0x2a327a];return _0x2a6614;};'use strict';var Sequelize=require(_0xffe3('0x0'));module['exports']={'priority':{'type':Sequelize[_0xffe3('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xffe3('0x2')]()},'description':{'type':Sequelize[_0xffe3('0x3')]},'interval':{'type':Sequelize[_0xffe3('0x3')],'defaultValue':_0xffe3('0x4')}}; \ No newline at end of file +var _0x36b9=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x36b9,0x95));var _0x936b=function(_0x5323ef,_0xb08133){_0x5323ef=_0x5323ef-0x0;var _0x32683d=_0x36b9[_0x5323ef];return _0x32683d;};'use strict';var Sequelize=require(_0x936b('0x0'));module[_0x936b('0x1')]={'priority':{'type':Sequelize[_0x936b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x936b('0x3')],'allowNull':![],'defaultValue':_0x936b('0x4')},'appdata':{'type':Sequelize[_0x936b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x936b('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a182fe7..9672f26 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x981e=['query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','rows','show','rawAttributes','find','create','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','stack','name','send','map','SmsApplication','fieldName','type','key','model'];(function(_0x3d125a,_0x30dd85){var _0x57e527=function(_0x1865d8){while(--_0x1865d8){_0x3d125a['push'](_0x3d125a['shift']());}};_0x57e527(++_0x30dd85);}(_0x981e,0x1c8));var _0xe981=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x981e[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xe981('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe981('0x1'));var jsonpatch=require(_0xe981('0x2'));var rp=require(_0xe981('0x3'));var moment=require(_0xe981('0x4'));var BPromise=require(_0xe981('0x5'));var Mustache=require(_0xe981('0x6'));var util=require(_0xe981('0x7'));var path=require(_0xe981('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe981('0x9'));var _=require('lodash');var squel=require(_0xe981('0xa'));var crypto=require(_0xe981('0xb'));var jsforce=require(_0xe981('0xc'));var deskjs=require(_0xe981('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe981('0xe'));var Papa=require(_0xe981('0xf'));var Redis=require(_0xe981('0x10'));var authService=require(_0xe981('0x11'));var qs=require(_0xe981('0x12'));var as=require(_0xe981('0x13'));var hardwareService=require(_0xe981('0x14'));var logger=require(_0xe981('0x15'))(_0xe981('0x16'));var utils=require('../../config/utils');var config=require(_0xe981('0x17'));var licenseUtil=require(_0xe981('0x18'));var db=require(_0xe981('0x19'))['db'];function respondWithStatusCode(_0x1ad1f6,_0x4f5837){_0x4f5837=_0x4f5837||0xcc;return function(_0x290618){if(_0x290618){return _0x1ad1f6['sendStatus'](_0x4f5837);}return _0x1ad1f6[_0xe981('0x1a')](_0x4f5837)[_0xe981('0x1b')]();};}function respondWithResult(_0x174d43,_0x1480dd){_0x1480dd=_0x1480dd||0xc8;return function(_0x314261){if(_0x314261){return _0x174d43['status'](_0x1480dd)['json'](_0x314261);}};}function respondWithFilteredResult(_0x4e8a73,_0x496f72){return function(_0x45d1dd){if(_0x45d1dd){var _0x4cdc0d=typeof _0x496f72['offset']===_0xe981('0x1c')&&typeof _0x496f72[_0xe981('0x1d')]===_0xe981('0x1c');var _0x3222a2=_0x45d1dd[_0xe981('0x1e')];var _0x2669d0=_0x4cdc0d?0x0:_0x496f72[_0xe981('0x1f')];var _0x33a7f1=_0x4cdc0d?_0x45d1dd[_0xe981('0x1e')]:_0x496f72[_0xe981('0x1f')]+_0x496f72['limit'];var _0x52f454;if(_0x33a7f1>=_0x3222a2){_0x33a7f1=_0x3222a2;_0x52f454=0xc8;}else{_0x52f454=0xce;}_0x4e8a73[_0xe981('0x1a')](_0x52f454);return _0x4e8a73['set']('Content-Range',_0x2669d0+'-'+_0x33a7f1+'/'+_0x3222a2)[_0xe981('0x20')](_0x45d1dd);}return null;};}function patchUpdates(_0x6bdd7f){return function(_0x5cc231){try{jsonpatch[_0xe981('0x21')](_0x5cc231,_0x6bdd7f,!![]);}catch(_0x5ab58d){return BPromise[_0xe981('0x22')](_0x5ab58d);}return _0x5cc231[_0xe981('0x23')]();};}function saveUpdates(_0x550656,_0x246e92){return function(_0x393c9a){if(_0x393c9a){return _0x393c9a[_0xe981('0x24')](_0x550656)[_0xe981('0x25')](function(_0x305e1e){return _0x305e1e;});}return null;};}function removeEntity(_0x216e02,_0x3d2381){return function(_0x21eebc){if(_0x21eebc){return _0x21eebc[_0xe981('0x26')]()[_0xe981('0x25')](function(){_0x216e02[_0xe981('0x1a')](0xcc)[_0xe981('0x1b')]();});}};}function handleEntityNotFound(_0x6225cf,_0x5bf416){return function(_0x2a861c){if(!_0x2a861c){_0x6225cf['sendStatus'](0x194);}return _0x2a861c;};}function handleError(_0x28c40b,_0x88cbad){_0x88cbad=_0x88cbad||0x1f4;return function(_0x55eeae){logger['error'](_0x55eeae[_0xe981('0x27')]);if(_0x55eeae[_0xe981('0x28')]){delete _0x55eeae[_0xe981('0x28')];}_0x28c40b[_0xe981('0x1a')](_0x88cbad)[_0xe981('0x29')](_0x55eeae);};}exports['index']=function(_0x2095da,_0x1ae6a0){var _0x4aa14b={},_0x20c030={},_0x55a8b3={'count':0x0,'rows':[]};var _0x154573=_[_0xe981('0x2a')](db[_0xe981('0x2b')]['rawAttributes'],function(_0x20587d){return{'name':_0x20587d[_0xe981('0x2c')],'type':_0x20587d[_0xe981('0x2d')][_0xe981('0x2e')]};});_0x20c030[_0xe981('0x2f')]=_['map'](_0x154573,_0xe981('0x28'));_0x20c030[_0xe981('0x30')]=_[_0xe981('0x31')](_0x2095da[_0xe981('0x30')]);_0x20c030['filters']=_[_0xe981('0x32')](_0x20c030[_0xe981('0x2f')],_0x20c030[_0xe981('0x30')]);_0x4aa14b[_0xe981('0x33')]=_[_0xe981('0x32')](_0x20c030['model'],qs[_0xe981('0x34')](_0x2095da[_0xe981('0x30')][_0xe981('0x34')]));_0x4aa14b[_0xe981('0x33')]=_0x4aa14b['attributes']['length']?_0x4aa14b['attributes']:_0x20c030['model'];if(!_0x2095da[_0xe981('0x30')][_0xe981('0x35')]('nolimit')){_0x4aa14b[_0xe981('0x1d')]=qs[_0xe981('0x1d')](_0x2095da[_0xe981('0x30')][_0xe981('0x1d')]);_0x4aa14b['offset']=qs[_0xe981('0x1f')](_0x2095da[_0xe981('0x30')][_0xe981('0x1f')]);}_0x4aa14b[_0xe981('0x36')]=qs['sort'](_0x2095da['query'][_0xe981('0x37')]);_0x4aa14b[_0xe981('0x38')]=qs[_0xe981('0x39')](_['pick'](_0x2095da[_0xe981('0x30')],_0x20c030[_0xe981('0x39')]),_0x154573);if(_0x2095da[_0xe981('0x30')]['filter']){_0x4aa14b[_0xe981('0x38')]=_['merge'](_0x4aa14b['where'],{'$or':_[_0xe981('0x2a')](_0x154573,function(_0x3f5d2e){if(_0x3f5d2e[_0xe981('0x2d')]!==_0xe981('0x3a')){var _0x591253={};_0x591253[_0x3f5d2e['name']]={'$like':'%'+_0x2095da['query'][_0xe981('0x3b')]+'%'};return _0x591253;}})});}_0x4aa14b=_[_0xe981('0x3c')]({},_0x4aa14b,_0x2095da[_0xe981('0x3d')]);var _0x3189f1={'where':_0x4aa14b[_0xe981('0x38')]};return db[_0xe981('0x2b')]['count'](_0x3189f1)[_0xe981('0x25')](function(_0x15a349){_0x55a8b3['count']=_0x15a349;if(_0x2095da[_0xe981('0x30')][_0xe981('0x3e')]){_0x4aa14b[_0xe981('0x3f')]=[{'all':!![]}];}return db[_0xe981('0x2b')]['findAll'](_0x4aa14b);})[_0xe981('0x25')](function(_0x5168e5){_0x55a8b3[_0xe981('0x40')]=_0x5168e5;return _0x55a8b3;})[_0xe981('0x25')](respondWithFilteredResult(_0x1ae6a0,_0x4aa14b))['catch'](handleError(_0x1ae6a0,null));};exports[_0xe981('0x41')]=function(_0x1dae6f,_0x41fb2e){var _0x107080={'raw':!![],'where':{'id':_0x1dae6f['params']['id']}},_0x43cb7d={};_0x43cb7d[_0xe981('0x2f')]=_[_0xe981('0x31')](db[_0xe981('0x2b')][_0xe981('0x42')]);_0x43cb7d[_0xe981('0x30')]=_[_0xe981('0x31')](_0x1dae6f[_0xe981('0x30')]);_0x43cb7d[_0xe981('0x39')]=_[_0xe981('0x32')](_0x43cb7d[_0xe981('0x2f')],_0x43cb7d[_0xe981('0x30')]);_0x107080[_0xe981('0x33')]=_['intersection'](_0x43cb7d[_0xe981('0x2f')],qs[_0xe981('0x34')](_0x1dae6f[_0xe981('0x30')][_0xe981('0x34')]));_0x107080[_0xe981('0x33')]=_0x107080[_0xe981('0x33')]['length']?_0x107080[_0xe981('0x33')]:_0x43cb7d[_0xe981('0x2f')];if(_0x1dae6f['query']['includeAll']){_0x107080[_0xe981('0x3f')]=[{'all':!![]}];}_0x107080=_['merge']({},_0x107080,_0x1dae6f[_0xe981('0x3d')]);return db[_0xe981('0x2b')][_0xe981('0x43')](_0x107080)['then'](handleEntityNotFound(_0x41fb2e,null))[_0xe981('0x25')](respondWithResult(_0x41fb2e,null))['catch'](handleError(_0x41fb2e,null));};exports[_0xe981('0x44')]=function(_0x338840,_0x2400b0){return db['SmsApplication'][_0xe981('0x44')](_0x338840['body'],{})[_0xe981('0x25')](respondWithResult(_0x2400b0,0xc9))[_0xe981('0x45')](handleError(_0x2400b0,null));};exports['update']=function(_0x585291,_0x4636ec){if(_0x585291[_0xe981('0x46')]['id']){delete _0x585291[_0xe981('0x46')]['id'];}return db[_0xe981('0x2b')]['find']({'where':{'id':_0x585291[_0xe981('0x47')]['id']}})[_0xe981('0x25')](handleEntityNotFound(_0x4636ec,null))[_0xe981('0x25')](saveUpdates(_0x585291[_0xe981('0x46')],null))[_0xe981('0x25')](respondWithResult(_0x4636ec,null))[_0xe981('0x45')](handleError(_0x4636ec,null));};exports[_0xe981('0x26')]=function(_0x24c11f,_0x2289d5){return db[_0xe981('0x2b')][_0xe981('0x43')]({'where':{'id':_0x24c11f[_0xe981('0x47')]['id']}})['then'](handleEntityNotFound(_0x2289d5,null))[_0xe981('0x25')](removeEntity(_0x2289d5,null))[_0xe981('0x45')](handleError(_0x2289d5,null));}; \ No newline at end of file +var _0xdc27=['includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','update','body','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','reject','then','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options'];(function(_0x5a591b,_0x2c7adf){var _0x34f849=function(_0x3a6601){while(--_0x3a6601){_0x5a591b['push'](_0x5a591b['shift']());}};_0x34f849(++_0x2c7adf);}(_0xdc27,0x99));var _0x7dc2=function(_0x40459f,_0x4e3fe4){_0x40459f=_0x40459f-0x0;var _0x2e7cb9=_0xdc27[_0x40459f];return _0x2e7cb9;};'use strict';var emlformat=require(_0x7dc2('0x0'));var rimraf=require(_0x7dc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dc2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7dc2('0x3'));var util=require(_0x7dc2('0x4'));var path=require('path');var sox=require(_0x7dc2('0x5'));var csv=require(_0x7dc2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc2('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc2('0x8'));var deskjs=require(_0x7dc2('0x9'));var toCsv=require(_0x7dc2('0x6'));var querystring=require(_0x7dc2('0xa'));var Papa=require(_0x7dc2('0xb'));var Redis=require(_0x7dc2('0xc'));var authService=require(_0x7dc2('0xd'));var qs=require(_0x7dc2('0xe'));var as=require(_0x7dc2('0xf'));var hardwareService=require(_0x7dc2('0x10'));var logger=require(_0x7dc2('0x11'))(_0x7dc2('0x12'));var utils=require(_0x7dc2('0x13'));var config=require(_0x7dc2('0x14'));var licenseUtil=require(_0x7dc2('0x15'));var db=require(_0x7dc2('0x16'))['db'];function respondWithStatusCode(_0x5864f0,_0x34c09b){_0x34c09b=_0x34c09b||0xcc;return function(_0x50e13f){if(_0x50e13f){return _0x5864f0[_0x7dc2('0x17')](_0x34c09b);}return _0x5864f0[_0x7dc2('0x18')](_0x34c09b)[_0x7dc2('0x19')]();};}function respondWithResult(_0x4eb96b,_0x302369){_0x302369=_0x302369||0xc8;return function(_0x578d33){if(_0x578d33){return _0x4eb96b['status'](_0x302369)['json'](_0x578d33);}};}function respondWithFilteredResult(_0x26eacf,_0x2f3cfe){return function(_0x3d91ba){if(_0x3d91ba){var _0x295a85=typeof _0x2f3cfe['offset']===_0x7dc2('0x1a')&&typeof _0x2f3cfe['limit']==='undefined';var _0x1e420b=_0x3d91ba[_0x7dc2('0x1b')];var _0x2c060b=_0x295a85?0x0:_0x2f3cfe[_0x7dc2('0x1c')];var _0x366864=_0x295a85?_0x3d91ba[_0x7dc2('0x1b')]:_0x2f3cfe['offset']+_0x2f3cfe[_0x7dc2('0x1d')];var _0x4db29f;if(_0x366864>=_0x1e420b){_0x366864=_0x1e420b;_0x4db29f=0xc8;}else{_0x4db29f=0xce;}_0x26eacf['status'](_0x4db29f);return _0x26eacf['set'](_0x7dc2('0x1e'),_0x2c060b+'-'+_0x366864+'/'+_0x1e420b)[_0x7dc2('0x1f')](_0x3d91ba);}return null;};}function patchUpdates(_0x18f912){return function(_0x1e09ec){try{jsonpatch['apply'](_0x1e09ec,_0x18f912,!![]);}catch(_0x1cde4c){return BPromise[_0x7dc2('0x20')](_0x1cde4c);}return _0x1e09ec['save']();};}function saveUpdates(_0x5f1ce3,_0x5d9aa4){return function(_0x1f4667){if(_0x1f4667){return _0x1f4667['update'](_0x5f1ce3)['then'](function(_0x57e2d2){return _0x57e2d2;});}return null;};}function removeEntity(_0x1e0287,_0x4fec22){return function(_0x142248){if(_0x142248){return _0x142248['destroy']()[_0x7dc2('0x21')](function(){_0x1e0287['status'](0xcc)[_0x7dc2('0x19')]();});}};}function handleEntityNotFound(_0x323298,_0x411515){return function(_0x5457c4){if(!_0x5457c4){_0x323298['sendStatus'](0x194);}return _0x5457c4;};}function handleError(_0x19414f,_0x50bb0b){_0x50bb0b=_0x50bb0b||0x1f4;return function(_0x5660d1){logger[_0x7dc2('0x22')](_0x5660d1[_0x7dc2('0x23')]);if(_0x5660d1[_0x7dc2('0x24')]){delete _0x5660d1[_0x7dc2('0x24')];}_0x19414f['status'](_0x50bb0b)[_0x7dc2('0x25')](_0x5660d1);};}exports['index']=function(_0x5bda36,_0x22f854){var _0x5e52d2={},_0x5a34ef={},_0x3d2ff7={'count':0x0,'rows':[]};var _0x3cde94=_[_0x7dc2('0x26')](db[_0x7dc2('0x27')][_0x7dc2('0x28')],function(_0x412b95){return{'name':_0x412b95['fieldName'],'type':_0x412b95[_0x7dc2('0x29')][_0x7dc2('0x2a')]};});_0x5a34ef[_0x7dc2('0x2b')]=_['map'](_0x3cde94,_0x7dc2('0x24'));_0x5a34ef[_0x7dc2('0x2c')]=_['keys'](_0x5bda36[_0x7dc2('0x2c')]);_0x5a34ef['filters']=_['intersection'](_0x5a34ef[_0x7dc2('0x2b')],_0x5a34ef[_0x7dc2('0x2c')]);_0x5e52d2['attributes']=_[_0x7dc2('0x2d')](_0x5a34ef['model'],qs[_0x7dc2('0x2e')](_0x5bda36[_0x7dc2('0x2c')][_0x7dc2('0x2e')]));_0x5e52d2[_0x7dc2('0x2f')]=_0x5e52d2[_0x7dc2('0x2f')]['length']?_0x5e52d2[_0x7dc2('0x2f')]:_0x5a34ef[_0x7dc2('0x2b')];if(!_0x5bda36['query'][_0x7dc2('0x30')](_0x7dc2('0x31'))){_0x5e52d2[_0x7dc2('0x1d')]=qs[_0x7dc2('0x1d')](_0x5bda36[_0x7dc2('0x2c')]['limit']);_0x5e52d2[_0x7dc2('0x1c')]=qs[_0x7dc2('0x1c')](_0x5bda36[_0x7dc2('0x2c')][_0x7dc2('0x1c')]);}_0x5e52d2['order']=qs[_0x7dc2('0x32')](_0x5bda36[_0x7dc2('0x2c')][_0x7dc2('0x32')]);_0x5e52d2['where']=qs[_0x7dc2('0x33')](_['pick'](_0x5bda36[_0x7dc2('0x2c')],_0x5a34ef['filters']),_0x3cde94);if(_0x5bda36[_0x7dc2('0x2c')][_0x7dc2('0x34')]){_0x5e52d2[_0x7dc2('0x35')]=_[_0x7dc2('0x36')](_0x5e52d2[_0x7dc2('0x35')],{'$or':_[_0x7dc2('0x26')](_0x3cde94,function(_0x117c62){if(_0x117c62[_0x7dc2('0x29')]!==_0x7dc2('0x37')){var _0x10c5e1={};_0x10c5e1[_0x117c62[_0x7dc2('0x24')]]={'$like':'%'+_0x5bda36[_0x7dc2('0x2c')][_0x7dc2('0x34')]+'%'};return _0x10c5e1;}})});}_0x5e52d2=_[_0x7dc2('0x36')]({},_0x5e52d2,_0x5bda36[_0x7dc2('0x38')]);var _0x50f95c={'where':_0x5e52d2[_0x7dc2('0x35')]};return db[_0x7dc2('0x27')][_0x7dc2('0x1b')](_0x50f95c)[_0x7dc2('0x21')](function(_0x2ae162){_0x3d2ff7[_0x7dc2('0x1b')]=_0x2ae162;if(_0x5bda36['query'][_0x7dc2('0x39')]){_0x5e52d2[_0x7dc2('0x3a')]=[{'all':!![]}];}return db[_0x7dc2('0x27')][_0x7dc2('0x3b')](_0x5e52d2);})[_0x7dc2('0x21')](function(_0x186e3f){_0x3d2ff7[_0x7dc2('0x3c')]=_0x186e3f;return _0x3d2ff7;})[_0x7dc2('0x21')](respondWithFilteredResult(_0x22f854,_0x5e52d2))[_0x7dc2('0x3d')](handleError(_0x22f854,null));};exports[_0x7dc2('0x3e')]=function(_0x55e326,_0x53af8e){var _0x5d0105={'raw':!![],'where':{'id':_0x55e326[_0x7dc2('0x3f')]['id']}},_0x544dcf={};_0x544dcf[_0x7dc2('0x2b')]=_[_0x7dc2('0x40')](db[_0x7dc2('0x27')]['rawAttributes']);_0x544dcf[_0x7dc2('0x2c')]=_[_0x7dc2('0x40')](_0x55e326[_0x7dc2('0x2c')]);_0x544dcf[_0x7dc2('0x33')]=_['intersection'](_0x544dcf['model'],_0x544dcf[_0x7dc2('0x2c')]);_0x5d0105['attributes']=_[_0x7dc2('0x2d')](_0x544dcf[_0x7dc2('0x2b')],qs[_0x7dc2('0x2e')](_0x55e326[_0x7dc2('0x2c')][_0x7dc2('0x2e')]));_0x5d0105[_0x7dc2('0x2f')]=_0x5d0105['attributes'][_0x7dc2('0x41')]?_0x5d0105[_0x7dc2('0x2f')]:_0x544dcf[_0x7dc2('0x2b')];if(_0x55e326[_0x7dc2('0x2c')][_0x7dc2('0x39')]){_0x5d0105['include']=[{'all':!![]}];}_0x5d0105=_[_0x7dc2('0x36')]({},_0x5d0105,_0x55e326[_0x7dc2('0x38')]);return db[_0x7dc2('0x27')][_0x7dc2('0x42')](_0x5d0105)[_0x7dc2('0x21')](handleEntityNotFound(_0x53af8e,null))['then'](respondWithResult(_0x53af8e,null))[_0x7dc2('0x3d')](handleError(_0x53af8e,null));};exports['create']=function(_0x9fa65,_0x17a8d8){return db[_0x7dc2('0x27')][_0x7dc2('0x43')](_0x9fa65['body'],{})['then'](respondWithResult(_0x17a8d8,0xc9))[_0x7dc2('0x3d')](handleError(_0x17a8d8,null));};exports[_0x7dc2('0x44')]=function(_0x13b5da,_0x399164){if(_0x13b5da['body']['id']){delete _0x13b5da[_0x7dc2('0x45')]['id'];}return db[_0x7dc2('0x27')][_0x7dc2('0x42')]({'where':{'id':_0x13b5da[_0x7dc2('0x3f')]['id']}})[_0x7dc2('0x21')](handleEntityNotFound(_0x399164,null))[_0x7dc2('0x21')](saveUpdates(_0x13b5da[_0x7dc2('0x45')],null))['then'](respondWithResult(_0x399164,null))[_0x7dc2('0x3d')](handleError(_0x399164,null));};exports['destroy']=function(_0x41eec0,_0x5a0381){return db[_0x7dc2('0x27')][_0x7dc2('0x42')]({'where':{'id':_0x41eec0['params']['id']}})['then'](handleEntityNotFound(_0x5a0381,null))['then'](removeEntity(_0x5a0381,null))[_0x7dc2('0x3d')](handleError(_0x5a0381,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 8e74ff2..e039e00 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e38=['exports','define','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','./smsApplication.attributes'];(function(_0x32c19e,_0x5582d6){var _0x5f53ca=function(_0x1f288e){while(--_0x1f288e){_0x32c19e['push'](_0x32c19e['shift']());}};_0x5f53ca(++_0x5582d6);}(_0x9e38,0x107));var _0x89e3=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x9e38[_0x208d75];return _0x382d27;};'use strict';var _=require(_0x89e3('0x0'));var util=require('util');var logger=require(_0x89e3('0x1'))(_0x89e3('0x2'));var moment=require('moment');var BPromise=require(_0x89e3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89e3('0x4'));var rimraf=require(_0x89e3('0x5'));var config=require('../../config/environment');var attributes=require(_0x89e3('0x6'));module[_0x89e3('0x7')]=function(_0x2ee40c,_0x530386){return _0x2ee40c[_0x89e3('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x89e3('0x9')});}; \ No newline at end of file +var _0xcf98=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','./smsApplication.attributes','exports'];(function(_0x393c33,_0x3995b8){var _0x4efdac=function(_0x5c21c2){while(--_0x5c21c2){_0x393c33['push'](_0x393c33['shift']());}};_0x4efdac(++_0x3995b8);}(_0xcf98,0x184));var _0x8cf9=function(_0xa5c9d0,_0x25eaf7){_0xa5c9d0=_0xa5c9d0-0x0;var _0x3d07a4=_0xcf98[_0xa5c9d0];return _0x3d07a4;};'use strict';var _=require(_0x8cf9('0x0'));var util=require(_0x8cf9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cf9('0x2'));var BPromise=require('bluebird');var rp=require(_0x8cf9('0x3'));var fs=require('fs');var path=require(_0x8cf9('0x4'));var rimraf=require(_0x8cf9('0x5'));var config=require('../../config/environment');var attributes=require(_0x8cf9('0x6'));module[_0x8cf9('0x7')]=function(_0x55cb55,_0x4aa0ae){return _0x55cb55['define'](_0x8cf9('0x8'),attributes,{'tableName':_0x8cf9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8cf9('0xa'),'collate':_0x8cf9('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 846a445..3927e5a 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xafcda6,_0x2817b9){var _0x2f00c5=function(_0x20c6ff){while(--_0x20c6ff){_0xafcda6['push'](_0xafcda6['shift']());}};_0x2f00c5(++_0x2817b9);}(_0x9582,0x95));var _0x2958=function(_0x2d173e,_0x2a5a93){_0x2d173e=_0x2d173e-0x0;var _0x4de37d=_0x9582[_0x2d173e];return _0x4de37d;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('SmsApplication,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('SmsApplication,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0xcefd=['error','SmsApplication,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xca684b,_0x2285fc){var _0x4fa385=function(_0x2b9365){while(--_0x2b9365){_0xca684b['push'](_0xca684b['shift']());}};_0x4fa385(++_0x2285fc);}(_0xcefd,0x1bd));var _0xdcef=function(_0x6ab1f,_0x168847){_0x6ab1f=_0x6ab1f-0x0;var _0x52b066=_0xcefd[_0x6ab1f];return _0x52b066;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var moment=require(_0xdcef('0x1'));var BPromise=require(_0xdcef('0x2'));var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require(_0xdcef('0x6'));var logger=require('../../config/logger')(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require(_0xdcef('0x9'));var client=jayson[_0xdcef('0xa')][_0xdcef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ba458,_0x3b9fec,_0x25dfd5){return new BPromise(function(_0x3dc2b0,_0x11a5a6){return client['request'](_0x4ba458,_0x25dfd5)[_0xdcef('0xc')](function(_0xbb7067){logger[_0xdcef('0xd')]('SmsApplication,\x20%s,\x20%s',_0x3b9fec,_0xdcef('0xe'));logger['debug'](_0xdcef('0xf'),_0x3b9fec,_0xdcef('0xe'),JSON[_0xdcef('0x10')](_0xbb7067));if(_0xbb7067[_0xdcef('0x11')]){if(_0xbb7067[_0xdcef('0x11')]['code']===0x1f4){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067['error'][_0xdcef('0x13')]);return _0x11a5a6(_0xbb7067['error'][_0xdcef('0x13')]);}logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067[_0xdcef('0x11')]['message']);return _0x3dc2b0(_0xbb7067[_0xdcef('0x11')][_0xdcef('0x13')]);}else{logger['info'](_0xdcef('0x12'),_0x3b9fec,_0xdcef('0xe'));_0x3dc2b0(_0xbb7067[_0xdcef('0x14')]['message']);}})['catch'](function(_0x386368){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0x386368);_0x11a5a6(_0x386368);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 3b2400b..15f8de3 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','sms','smsinteraction:addtags','put','tracked','smsinteraction:update','delete','smsinteraction:destroy'];(function(_0xbce24c,_0x45839c){var _0x47bfed=function(_0x6f80c9){while(--_0x6f80c9){_0xbce24c['push'](_0xbce24c['shift']());}};_0x47bfed(++_0x45839c);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xe5b5[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/messages',auth[_0x5e5b('0xc')](),controller['getMessages']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5e5b('0x14')](_0x5e5b('0x15'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x14')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),interaction['tracked'](_0x5e5b('0x18'),_0x5e5b('0x19')),controller['addTags']);router[_0x5e5b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x5e5b('0x1b')](_0x5e5b('0x18'),_0x5e5b('0x1c')),controller['update']);router[_0x5e5b('0x1d')]('/:id',auth[_0x5e5b('0xc')](),interaction[_0x5e5b('0x1b')]('sms',_0x5e5b('0x1e')),controller[_0x5e5b('0x1f')]);router[_0x5e5b('0x1d')]('/:id/tags',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x20')]);module['exports']=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x18fe3d,_0x51f246){var _0x437588=function(_0x41a66f){while(--_0x41a66f){_0x18fe3d['push'](_0x18fe3d['shift']());}};_0x437588(++_0x51f246);}(_0x0972,0x64));var _0x2097=function(_0x250316,_0x16b04f){_0x250316=_0x250316-0x0;var _0x396cb9=_0x0972[_0x250316];return _0x396cb9;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 9674370..a33a078 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x744c=['sequelize','moment','exports','BOOLEAN','STRING','ENUM','out','DATE'];(function(_0x155a4b,_0x337061){var _0x3ef0ed=function(_0x5151bb){while(--_0x5151bb){_0x155a4b['push'](_0x155a4b['shift']());}};_0x3ef0ed(++_0x337061);}(_0x744c,0xa0));var _0xc744=function(_0x3da7a1,_0x151473){_0x3da7a1=_0x3da7a1-0x0;var _0x3b7290=_0x744c[_0x3da7a1];return _0x3b7290;};'use strict';var Sequelize=require(_0xc744('0x0'));var moment=require(_0xc744('0x1'));module[_0xc744('0x2')]={'closed':{'type':Sequelize[_0xc744('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc744('0x4')]},'secondDisposition':{'type':Sequelize[_0xc744('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc744('0x4')]},'note':{'type':Sequelize[_0xc744('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc744('0x5')]('in',_0xc744('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc744('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xc744('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7e4b=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x199a31,_0x3a2a10){var _0x5ea320=function(_0x3c598b){while(--_0x3c598b){_0x199a31['push'](_0x199a31['shift']());}};_0x5ea320(++_0x3a2a10);}(_0x7e4b,0x84));var _0xb7e4=function(_0x30eb2d,_0x33a9c9){_0x30eb2d=_0x30eb2d-0x0;var _0x2049d4=_0x7e4b[_0x30eb2d];return _0x2049d4;};'use strict';var Sequelize=require(_0xb7e4('0x0'));var moment=require(_0xb7e4('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb7e4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7e4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'note':{'type':Sequelize[_0xb7e4('0x4')]},'phone':{'type':Sequelize[_0xb7e4('0x4')]},'read1stAt':{'type':Sequelize[_0xb7e4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in',_0xb7e4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7e4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb7e4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 858777e..47c641a 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26ed=['renderFile','downloadInteraction.ejs','transcript-','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','total','closed','waiting','UserId','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','start','body','text','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','catch','show','params','includeAll','merge','options','create','describe','addMessage','ids','getMessages','findOne','SmsMessage','filters','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','direction','secret','SmsAccount','Account','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','Messages','System','out'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x26ed,0x1f0));var _0xd26e=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x26ed[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require(_0xd26e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd26e('0x1'));var jsonpatch=require(_0xd26e('0x2'));var rp=require('request-promise');var moment=require(_0xd26e('0x3'));var BPromise=require(_0xd26e('0x4'));var Mustache=require(_0xd26e('0x5'));var util=require(_0xd26e('0x6'));var path=require(_0xd26e('0x7'));var sox=require(_0xd26e('0x8'));var csv=require(_0xd26e('0x9'));var ejs=require(_0xd26e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd26e('0xb'));var squel=require(_0xd26e('0xc'));var crypto=require(_0xd26e('0xd'));var jsforce=require(_0xd26e('0xe'));var deskjs=require(_0xd26e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd26e('0x10'));var Papa=require(_0xd26e('0x11'));var Redis=require(_0xd26e('0x12'));var authService=require(_0xd26e('0x13'));var qs=require(_0xd26e('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xd26e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd26e('0x16'))(_0xd26e('0x17'));var utils=require(_0xd26e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd26e('0x19'));var db=require(_0xd26e('0x1a'))['db'];config[_0xd26e('0x1b')]=_[_0xd26e('0x1c')](config[_0xd26e('0x1b')],{'host':_0xd26e('0x1d'),'port':0x18eb});var socket=require(_0xd26e('0x1e'))(new Redis(config[_0xd26e('0x1b')]));require(_0xd26e('0x1f'))[_0xd26e('0x20')](socket);function respondWithStatusCode(_0x3f7df9,_0x43055d){_0x43055d=_0x43055d||0xcc;return function(_0x3570ce){if(_0x3570ce){return _0x3f7df9[_0xd26e('0x21')](_0x43055d);}return _0x3f7df9['status'](_0x43055d)[_0xd26e('0x22')]();};}function respondWithResult(_0xbeb5b6,_0x25623f){_0x25623f=_0x25623f||0xc8;return function(_0x29737c){if(_0x29737c){return _0xbeb5b6[_0xd26e('0x23')](_0x25623f)[_0xd26e('0x24')](_0x29737c);}};}function respondWithFilteredResult(_0x1d1698,_0x38609e){return function(_0x332442){if(_0x332442){var _0x148b3f=typeof _0x38609e[_0xd26e('0x25')]===_0xd26e('0x26')&&typeof _0x38609e[_0xd26e('0x27')]===_0xd26e('0x26');var _0x18f3cb=_0x332442[_0xd26e('0x28')];var _0x51e5e1=_0x148b3f?0x0:_0x38609e[_0xd26e('0x25')];var _0x133391=_0x148b3f?_0x332442[_0xd26e('0x28')]:_0x38609e[_0xd26e('0x25')]+_0x38609e[_0xd26e('0x27')];var _0x283a52;if(_0x133391>=_0x18f3cb){_0x133391=_0x18f3cb;_0x283a52=0xc8;}else{_0x283a52=0xce;}_0x1d1698[_0xd26e('0x23')](_0x283a52);return _0x1d1698[_0xd26e('0x29')](_0xd26e('0x2a'),_0x51e5e1+'-'+_0x133391+'/'+_0x18f3cb)[_0xd26e('0x24')](_0x332442);}return null;};}function patchUpdates(_0x237337){return function(_0x28d312){try{jsonpatch['apply'](_0x28d312,_0x237337,!![]);}catch(_0x3f658b){return BPromise[_0xd26e('0x2b')](_0x3f658b);}return _0x28d312['save']();};}function saveUpdates(_0x4fe0c9,_0x3f4777){return function(_0x5d4367){if(_0x5d4367){return _0x5d4367[_0xd26e('0x2c')](_0x4fe0c9)['then'](function(_0x140677){return _0x140677;});}return null;};}function removeEntity(_0x3e5867,_0xf31290){return function(_0x3ca26c){if(_0x3ca26c){return _0x3ca26c[_0xd26e('0x2d')]()[_0xd26e('0x2e')](function(){_0x3e5867[_0xd26e('0x23')](0xcc)[_0xd26e('0x22')]();});}};}function handleEntityNotFound(_0x32b2ec,_0x59f34f){return function(_0xc9afe2){if(!_0xc9afe2){_0x32b2ec[_0xd26e('0x21')](0x194);}return _0xc9afe2;};}function handleError(_0x55add5,_0xb5505d){_0xb5505d=_0xb5505d||0x1f4;return function(_0x245165){logger['error'](_0x245165[_0xd26e('0x2f')]);if(_0x245165['name']){delete _0x245165[_0xd26e('0x30')];}_0x55add5[_0xd26e('0x23')](_0xb5505d)[_0xd26e('0x31')](_0x245165);};}function getInteractionUsers(_0xb0ba40,_0x181f68){return new BPromise(function(_0x5386e8,_0x13d8db){try{if(_0x181f68[_0xb0ba40['id']]){_0xb0ba40[_0xd26e('0x32')]=_[_0xd26e('0x33')](_0x181f68[_0xb0ba40['id']],function(_0x5daa39){return{'id':_0x5daa39['id'],'fullname':_0x5daa39[_0xd26e('0x34')]};});}}catch(_0x349079){_0x13d8db(_0x349079);}_0x5386e8(_0xb0ba40);});}function getInteractionTags(_0x5dd7af,_0x2bb8d4){return new BPromise(function(_0x511a93,_0x6ddfe6){try{if(_0x5dd7af[_0xd26e('0x35')]){_0x5dd7af[_0xd26e('0x36')]=[];_0x5dd7af[_0xd26e('0x35')][_0xd26e('0x37')](',')[_0xd26e('0x38')](function(_0x375129){_0x5dd7af[_0xd26e('0x36')]['push'](_0x2bb8d4[_0x375129]);});}delete _0x5dd7af[_0xd26e('0x35')];}catch(_0x230fed){_0x6ddfe6(_0x230fed);}_0x511a93(_0x5dd7af);});}function updateSmsInteraction(_0x31c687,_0x362ef9,_0x32677e){return new BPromise(function(_0xb30bb5,_0x5a8799){return getInteractionUsers(_0x31c687,_0x32677e)['then'](function(_0x4a730b){return getInteractionTags(_0x4a730b,_0x362ef9);})[_0xd26e('0x2e')](function(_0x31b6be){return getStateInteraction(_0x31b6be);})[_0xd26e('0x2e')](function(_0x2f2a2b){_0xb30bb5(_0x2f2a2b);})['catch'](function(_0x11c777){_0x5a8799(_0x11c777);});});}function getStateInteraction(_0x15f343){return new BPromise(function(_0x52d850){_0x15f343['waiting']=0x0;_0x15f343[_0xd26e('0x39')]=0x0;_0x15f343[_0xd26e('0x3a')]=0x0;_0x15f343[_0xd26e('0x3b')]=0x0;_0x15f343[_0xd26e('0x3c')]=0x0;if(!_0x15f343[_0xd26e('0x3d')]&&!_0x15f343['UserId']){_0x15f343[_0xd26e('0x3e')]+=0x1;}if(!_0x15f343[_0xd26e('0x3d')]&&_0x15f343['UserId']){_0x15f343['talking']+=0x1;if(_0x15f343['waiting']){_0x15f343[_0xd26e('0x3e')]-=0x1;}}if(_0x15f343['closed']&&_0x15f343['UserId']){_0x15f343[_0xd26e('0x3a')]+=0x1;if(_0x15f343[_0xd26e('0x39')]){_0x15f343[_0xd26e('0x39')]-=0x1;}}if(_0x15f343['closed']&&!_0x15f343[_0xd26e('0x3f')]){_0x15f343['unmanaged']+=0x1;if(_0x15f343[_0xd26e('0x3e')]){_0x15f343[_0xd26e('0x3e')]-=0x1;}}_0x15f343[_0xd26e('0x3c')]+=0x1;_0x52d850(_0x15f343);});}exports[_0xd26e('0x40')]=function(_0x35b836,_0x2d5bba){var _0x32a3a9={},_0x168231={},_0x7dc3b3={'count':0x0,'rows':[]};var _0x21187d=_[_0xd26e('0x33')](db[_0xd26e('0x41')][_0xd26e('0x42')],function(_0x5a6401){return{'name':_0x5a6401[_0xd26e('0x43')],'type':_0x5a6401[_0xd26e('0x44')][_0xd26e('0x45')]};});_0x168231[_0xd26e('0x46')]=_[_0xd26e('0x33')](_0x21187d,_0xd26e('0x30'));_0x168231['query']=_[_0xd26e('0x47')](_0x35b836['query']);_0x168231['filters']=_['intersection'](_0x168231['model'],_0x168231[_0xd26e('0x48')]);_0x32a3a9[_0xd26e('0x49')]=_[_0xd26e('0x4a')](_0x168231[_0xd26e('0x46')],qs[_0xd26e('0x4b')](_0x35b836[_0xd26e('0x48')][_0xd26e('0x4b')]));_0x32a3a9[_0xd26e('0x49')]=_0x32a3a9['attributes']['length']?_0x32a3a9[_0xd26e('0x49')]:_0x168231[_0xd26e('0x46')];if(!_0x35b836[_0xd26e('0x48')][_0xd26e('0x4c')](_0xd26e('0x4d'))){_0x32a3a9['limit']=qs[_0xd26e('0x27')](_0x35b836['query'][_0xd26e('0x27')]);_0x32a3a9[_0xd26e('0x25')]=qs[_0xd26e('0x25')](_0x35b836['query'][_0xd26e('0x25')]);}_0x32a3a9[_0xd26e('0x4e')]=qs[_0xd26e('0x4f')](_0x35b836[_0xd26e('0x48')]['sort']);_0x32a3a9[_0xd26e('0x50')]=qs['filters'](_[_0xd26e('0x51')](_0x35b836[_0xd26e('0x48')],_0x168231['filters']),_0x21187d);var _0x3609be=[];var _0xa1c464=squel[_0xd26e('0x52')]()[_0xd26e('0x53')]('id')[_0xd26e('0x53')](_0xd26e('0x30'))['field'](_0xd26e('0x54'))['from'](_0xd26e('0x55'));var _0x4e8645=squel[_0xd26e('0x52')]()[_0xd26e('0x53')](_0xd26e('0x56'))[_0xd26e('0x53')](_0xd26e('0x57'))[_0xd26e('0x53')](_0xd26e('0x58'))[_0xd26e('0x59')]('user_has_sms_interactions','ui')[_0xd26e('0x5a')](_0xd26e('0x5b'),'u',_0xd26e('0x5c'));var _0x1397d2=squel['select']()[_0xd26e('0x59')](_0xd26e('0x5d'),'i')['left_join'](_0xd26e('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd26e('0x5a')](_0xd26e('0x5b'),'o',_0xd26e('0x5f'))[_0xd26e('0x5a')](_0xd26e('0x60'),'a','a.id\x20=\x20i.SmsAccountId')[_0xd26e('0x5a')](_0xd26e('0x61'),'me',_0xd26e('0x62'))[_0xd26e('0x5a')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xd26e('0x5a')](_0xd26e('0x55'),'t',_0xd26e('0x63'));var _0x52d184=squel[_0xd26e('0x64')]();var _0x1b1fd0=[];var _0x7bab60=squel['expr']();var _0x34be44;if(_0x35b836[_0xd26e('0x48')]['search']){_0x34be44=as[_0xd26e('0x65')](_0x35b836[_0xd26e('0x48')][_0xd26e('0x66')]);var _0x5e7565=_0x34be44[_0xd26e('0x67')];for(var _0x5c8b2e=0x0;_0x5c8b2e<_0x34be44[_0xd26e('0x68')]['length'];_0x5c8b2e++){var _0x5df232=_0x34be44[_0xd26e('0x68')][_0x5c8b2e];var _0x670ca5='i';var _0x46947e=_[_0xd26e('0x69')](_0x21187d,['name',_0x5df232[_0xd26e('0x53')]]);if(!_0x46947e){switch(_0x5df232[_0xd26e('0x53')]){case _0xd26e('0x6a'):if(_0x5df232[_0xd26e('0x6b')]==0x1){_0x1397d2[_0xd26e('0x6c')]('`'+_0x5df232['field']+_0xd26e('0x6d'));}else{_0x1397d2[_0xd26e('0x6c')]('`'+_0x5df232['field']+_0xd26e('0x6e'));}break;case _0xd26e('0x6f'):if(_0x5df232[_0xd26e('0x70')]===_0xd26e('0x71')){if(_0x5df232['value'][_0xd26e('0x37')]('\x20')[_0xd26e('0x72')]>0x1){_0x52d184[_0x5e7565](_0xd26e('0x73'),qs[_0xd26e('0x74')](_0x5df232['value']),null);}else{var _0x426532='%'+_0x5df232['value']+'%';_0x52d184[_0x5e7565]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x426532,_0x426532,_0x426532);}}else{_0x46947e=_[_0xd26e('0x69')](_0x21187d,[_0xd26e('0x30'),_0xd26e('0x75')]);_0x5df232[_0xd26e('0x53')]=_0xd26e('0x75');_0x174837=as[_0xd26e('0x76')](_0x670ca5,_0x46947e[_0xd26e('0x44')],_0x5df232);_0x52d184[_0x5e7565](_0x174837['text'],_0x174837['value']['start'],_0x174837[_0xd26e('0x6b')]['end']);}break;case _0xd26e('0x77'):var _0x1c1a81=_0x5df232['value'][_0xd26e('0x37')](',')['map'](function(_0x6cc466){return Number(_0x6cc466);});_0x1c1a81[_0xd26e('0x38')](function(_0x52c7bf){_0x7bab60['or'](_0xd26e('0x78'),'%,'+_0x52c7bf+',%');});_0x1b1fd0=_['union'](_0x1b1fd0,_0x1c1a81);break;case _0xd26e('0x79'):if(_0x5df232[_0xd26e('0x70')]==='$substring'){_0x52d184[_0x5e7565]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5df232['value']+'%',null);}else{_0x46947e=_[_0xd26e('0x69')](_0x21187d,[_0xd26e('0x30'),_0xd26e('0x3f')]);_0x5df232['field']='UserId';_0x174837=as[_0xd26e('0x76')](_0x670ca5,_0x46947e[_0xd26e('0x44')],_0x5df232);_0x52d184[_0x5e7565](_0x174837['text'],_0x174837[_0xd26e('0x6b')][_0xd26e('0x7a')],_0x174837[_0xd26e('0x6b')][_0xd26e('0x22')]);}break;case _0xd26e('0x7b'):_0x174837=as[_0xd26e('0x76')]('me',null,_0x5df232);_0x52d184[_0x5e7565](_0x174837['text'],_0x174837[_0xd26e('0x6b')][_0xd26e('0x7a')],_0x174837[_0xd26e('0x6b')][_0xd26e('0x22')]);break;}}else{var _0x174837=as[_0xd26e('0x76')](_0x670ca5,_0x46947e[_0xd26e('0x44')],_0x5df232);_0x52d184[_0x5e7565](_0x174837[_0xd26e('0x7c')],_0x174837[_0xd26e('0x6b')][_0xd26e('0x7a')],_0x174837[_0xd26e('0x6b')]['end']);}}}else{var _0x268583=_(_0x35b836['query'])[_0xd26e('0x47')]()[_0xd26e('0x33')](function(_0x5182e1){return _[_0xd26e('0x7d')](_0x21187d,[_0xd26e('0x30'),_0x5182e1])?_0x5182e1:undefined;})[_0xd26e('0x7e')]()[_0xd26e('0x6b')]();if(!_[_0xd26e('0x7f')](_0x268583)){_0x268583[_0xd26e('0x38')](function(_0x4a7c83){if(_0x4a7c83===_0xd26e('0x80')){_0x1397d2['where'](_0xd26e('0x81'),[][_0xd26e('0x82')](_0x35b836['query'][_0x4a7c83]));}else if(_0x4a7c83===_0xd26e('0x83')){var _0x5f0691=JSON['parse'](_0x35b836[_0xd26e('0x48')][_0x4a7c83])['$gte'];var _0x90ea4a=JSON[_0xd26e('0x84')](_0x35b836['query'][_0x4a7c83])[_0xd26e('0x85')];_0x1397d2['where'](_0xd26e('0x86'),_0x5f0691,_0x90ea4a);}else{if(_0x35b836['query'][_0x4a7c83]===_0xd26e('0x87')){_0x1397d2['where']('i.'+_0x4a7c83+_0xd26e('0x88'));}else{_0x1397d2[_0xd26e('0x50')]('i.'+_0x4a7c83+'\x20=\x20?',_0x35b836[_0xd26e('0x48')][_0x4a7c83]);}}});}if(_0x35b836[_0xd26e('0x48')][_0xd26e('0x89')]){if(_0x35b836[_0xd26e('0x48')][_0xd26e('0x89')]==0x1){_0x1397d2[_0xd26e('0x6c')](_0xd26e('0x8a'));}else{_0x1397d2[_0xd26e('0x6c')](_0xd26e('0x8b'));}}if(_0x35b836['query']['tag']){_0x1b1fd0=_[_0xd26e('0x8c')](_0x35b836[_0xd26e('0x48')][_0xd26e('0x8d')])?_0x35b836[_0xd26e('0x48')][_0xd26e('0x8d')]:new Array(_0x35b836[_0xd26e('0x48')][_0xd26e('0x8d')]);_0x1b1fd0['forEach'](function(_0x16ef8d){_0x7bab60['or'](_0xd26e('0x78'),'%,'+_0x16ef8d+',%');});}if(_0x35b836['query'][_0xd26e('0x8e')]){var _0x29404f=_0x35b836[_0xd26e('0x48')][_0xd26e('0x8e')][_0xd26e('0x8f')]('\x5c','\x5c\x5c')[_0xd26e('0x8f')](/'/g,'\x27\x27');if(qs[_0xd26e('0x90')](_0x29404f)){_0x52d184['or']('i.id\x20LIKE\x20?',_0x29404f+'%')['or'](_0xd26e('0x91'),_0x29404f+'%');}else{_0x52d184['or'](_0xd26e('0x92'),qs[_0xd26e('0x74')](_0x29404f))['or'](_0xd26e('0x93'),_0x29404f+'%');}}}_0x1397d2[_0xd26e('0x50')](_0x52d184);_0x1397d2[_0xd26e('0x94')](_0xd26e('0x95'));var _0x1a8eff={'type':db[_0xd26e('0x96')]['QueryTypes'][_0xd26e('0x97')],'raw':!![]};var _0x1e705c=_0x1397d2[_0xd26e('0x98')]();_0x1e705c[_0xd26e('0x53')]('i.id');_0x1e705c[_0xd26e('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd26e('0x6a'));if(_0x32a3a9[_0xd26e('0x4e')]){_0x32a3a9['order'][_0xd26e('0x38')](function(_0x52df9f){var _0x11f468=_0x52df9f[0x0]==='contactName'?_0x52df9f[0x0]:'i.'+_0x52df9f[0x0];_0x1397d2[_0xd26e('0x4e')](_0x11f468,_0x52df9f[0x1]===_0xd26e('0x99')?![]:!![]);});}if(!_[_0xd26e('0x7f')](_0x1b1fd0)){_0x1397d2[_0xd26e('0x6c')](_0x7bab60);_0x1e705c[_0xd26e('0x50')](_0xd26e('0x9a'),_0x1b1fd0);}BPromise[_0xd26e('0x9b')]()['then'](function(){if(!_0x34be44){if(_0x35b836[_0xd26e('0x48')][_0xd26e('0x80')])return;_0x1e705c['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1397d2[_0xd26e('0x50')](_0xd26e('0x9c'));return;}if(_0x35b836[_0xd26e('0x9d')][_0xd26e('0x9e')]!==_0xd26e('0x9f'))return;return _0x35b836[_0xd26e('0x9d')][_0xd26e('0xa0')]({'attributes':['id'],'raw':!![]})[_0xd26e('0x2e')](function(_0x411cf4){if(_[_0xd26e('0x7f')](_0x411cf4)){_0x1e705c[_0xd26e('0x50')](_0xd26e('0xa1'));_0x1397d2[_0xd26e('0x50')](_0xd26e('0xa1'));}else{_0x1e705c[_0xd26e('0x50')](_0xd26e('0x81'),_[_0xd26e('0x33')](_0x411cf4,'id'));_0x1397d2[_0xd26e('0x50')](_0xd26e('0x81'),_[_0xd26e('0x33')](_0x411cf4,'id'));}});})[_0xd26e('0x2e')](function(){if(_0x35b836['user'][_0xd26e('0x9e')]===_0xd26e('0x9f')&&!_0x34be44&&!_0x35b836[_0xd26e('0x48')][_0xd26e('0x80')])return[];return db[_0xd26e('0xa2')]['query'](_0x1e705c[_0xd26e('0xa3')](),_0x1a8eff);})[_0xd26e('0x2e')](function(_0x49b32f){_0x7dc3b3[_0xd26e('0x28')]=_0x49b32f[_0xd26e('0x72')];if(_0x7dc3b3[_0xd26e('0x28')]===0x0)return[];return db[_0xd26e('0xa2')][_0xd26e('0x48')](_0xa1c464['toString'](),_0x1a8eff)['then'](function(_0x567362){_0x3609be=_[_0xd26e('0xa4')](_0x567362,'id');_0x1a8eff=_['merge'](_0x1a8eff,{'model':db[_0xd26e('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35b836['query']['fields']){_0x32a3a9['attributes'][_0xd26e('0x38')](function(_0x350afd){_0x1397d2['field']('i.'+_0x350afd);});}else{_0x1397d2[_0xd26e('0x53')](_0xd26e('0xa5'),'unreadMessages');_0x1397d2['field'](_0xd26e('0xa6'),_0xd26e('0xa7'));_0x1397d2['field'](_0xd26e('0xa8'),'Account.mandatoryDisposition');_0x1397d2['field'](_0xd26e('0xa9'),'contactName');_0x1397d2['field'](_0xd26e('0xaa'));_0x1397d2[_0xd26e('0x53')](_0xd26e('0xab'),_0xd26e('0xac'));_0x1397d2[_0xd26e('0x53')](_0xd26e('0xad'),'Contact.lastName');_0x1397d2[_0xd26e('0x53')](_0xd26e('0xae'),_0xd26e('0xaf'));_0x1397d2[_0xd26e('0x53')](_0xd26e('0xb0'),_0xd26e('0xb1'));_0x1397d2[_0xd26e('0x53')]('c.mobile',_0xd26e('0xb2'));_0x1397d2[_0xd26e('0x53')](_0xd26e('0xb3'),'Contact.fax');_0x1397d2[_0xd26e('0x53')](_0xd26e('0xb4'),'Owner.fullname');_0x1397d2['field'](_0xd26e('0xb5'),_0xd26e('0xb6'));_0x1397d2[_0xd26e('0x53')](_0xd26e('0xb7'),_0xd26e('0x35'));}if(_0x32a3a9[_0xd26e('0x27')])_0x1397d2[_0xd26e('0x27')](_0x32a3a9[_0xd26e('0x27')]);if(_0x32a3a9['offset'])_0x1397d2[_0xd26e('0x25')](_0x32a3a9[_0xd26e('0x25')]);return db[_0xd26e('0xa2')][_0xd26e('0x48')](_0x1397d2[_0xd26e('0xa3')](),_0x1a8eff);})[_0xd26e('0x2e')](function(_0x4a8433){if(_0x4a8433[_0xd26e('0x72')]>0x0)_0x4e8645[_0xd26e('0x50')](_0xd26e('0xb8'),_[_0xd26e('0x33')](_0x4a8433,'id'));return db[_0xd26e('0xa2')]['query'](_0x4e8645[_0xd26e('0xa3')](),_0x1a8eff)[_0xd26e('0x2e')](function(_0x21e906){var _0x22f531=_[_0xd26e('0xb9')](_0x21e906,'SmsInteractionId');var _0x40f26d=[];_0x4a8433[_0xd26e('0x38')](function(_0x401930){_0x40f26d[_0xd26e('0xba')](updateSmsInteraction(_0x401930,_0x3609be,_0x22f531));});return BPromise[_0xd26e('0xbb')](_0x40f26d);});});})[_0xd26e('0x2e')](function(_0x2aebdd){_0x7dc3b3['rows']=_0x2aebdd;return _0x7dc3b3;})[_0xd26e('0x2e')](respondWithFilteredResult(_0x2d5bba,_0x32a3a9))[_0xd26e('0xbc')](handleError(_0x2d5bba,null));};exports[_0xd26e('0xbd')]=function(_0x1314dc,_0x40df4d){var _0x6f39ee={'raw':![],'where':{'id':_0x1314dc[_0xd26e('0xbe')]['id']}},_0x5b30e8={};_0x5b30e8[_0xd26e('0x46')]=_[_0xd26e('0x47')](db[_0xd26e('0x41')]['rawAttributes']);_0x5b30e8[_0xd26e('0x48')]=_[_0xd26e('0x47')](_0x1314dc[_0xd26e('0x48')]);_0x5b30e8['filters']=_[_0xd26e('0x4a')](_0x5b30e8[_0xd26e('0x46')],_0x5b30e8[_0xd26e('0x48')]);_0x6f39ee[_0xd26e('0x49')]=_['intersection'](_0x5b30e8['model'],qs[_0xd26e('0x4b')](_0x1314dc[_0xd26e('0x48')][_0xd26e('0x4b')]));_0x6f39ee['attributes']=_0x6f39ee[_0xd26e('0x49')][_0xd26e('0x72')]?_0x6f39ee[_0xd26e('0x49')]:_0x5b30e8[_0xd26e('0x46')];if(_0x1314dc[_0xd26e('0x48')][_0xd26e('0xbf')]){_0x6f39ee['include']=[{'all':!![]}];}_0x6f39ee=_[_0xd26e('0xc0')]({},_0x6f39ee,_0x1314dc[_0xd26e('0xc1')]);return db['SmsInteraction'][_0xd26e('0x69')](_0x6f39ee)[_0xd26e('0x2e')](handleEntityNotFound(_0x40df4d,null))[_0xd26e('0x2e')](respondWithResult(_0x40df4d,null))[_0xd26e('0xbc')](handleError(_0x40df4d,null));};exports[_0xd26e('0xc2')]=function(_0x556ae4,_0xfe30a6){return db['SmsInteraction'][_0xd26e('0xc2')](_0x556ae4[_0xd26e('0x7b')],{})[_0xd26e('0x2e')](respondWithResult(_0xfe30a6,0xc9))[_0xd26e('0xbc')](handleError(_0xfe30a6,null));};exports[_0xd26e('0x2c')]=function(_0x332a92,_0x952bc5){if(_0x332a92[_0xd26e('0x7b')]['id']){delete _0x332a92['body']['id'];}return db['SmsInteraction'][_0xd26e('0x69')]({'where':{'id':_0x332a92['params']['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x952bc5,null))['then'](saveUpdates(_0x332a92[_0xd26e('0x7b')],null))[_0xd26e('0x2e')](respondWithResult(_0x952bc5,null))[_0xd26e('0xbc')](handleError(_0x952bc5,null));};exports['destroy']=function(_0x4cd635,_0x1a76cf){return db[_0xd26e('0x41')][_0xd26e('0x69')]({'where':{'id':_0x4cd635[_0xd26e('0xbe')]['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x1a76cf,null))[_0xd26e('0x2e')](removeEntity(_0x1a76cf,null))[_0xd26e('0xbc')](handleError(_0x1a76cf,null));};exports[_0xd26e('0xc3')]=function(_0xdde66d,_0x4885e7){return db[_0xd26e('0x41')][_0xd26e('0xc3')]()[_0xd26e('0x2e')](respondWithResult(_0x4885e7,null))[_0xd26e('0xbc')](handleError(_0x4885e7,null));};exports[_0xd26e('0xc4')]=function(_0xaf294a,_0x54b96c,_0x13277e){return db['SmsMessage'][_0xd26e('0x69')]({'where':{'id':_0xaf294a[_0xd26e('0xbe')]['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x54b96c,null))['then'](function(_0x4d4409){if(_0x4d4409){return _0x4d4409['addMessage'](_0xaf294a[_0xd26e('0x7b')]['ids'],_['omit'](_0xaf294a[_0xd26e('0x7b')],[_0xd26e('0xc5'),'id'])||{});}})[_0xd26e('0x2e')](respondWithResult(_0x54b96c,null))['catch'](handleError(_0x54b96c,null));};exports[_0xd26e('0xc6')]=function(_0x4b4fce,_0x4662c1,_0x2a249f){var _0x25679f={'raw':![],'where':{}};var _0x2d425f={};var _0x1499b0={'count':0x0,'rows':[]};return db[_0xd26e('0x41')][_0xd26e('0xc7')]({'where':{'id':_0x4b4fce[_0xd26e('0xbe')]['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x4662c1,null))[_0xd26e('0x2e')](function(_0x2eb9f5){if(_0x2eb9f5){_0x2d425f['model']=_[_0xd26e('0x47')](db[_0xd26e('0xc8')][_0xd26e('0x42')]);_0x2d425f[_0xd26e('0x48')]=_[_0xd26e('0x47')](_0x4b4fce[_0xd26e('0x48')]);_0x2d425f[_0xd26e('0xc9')]=_[_0xd26e('0x4a')](_0x2d425f[_0xd26e('0x46')],_0x2d425f[_0xd26e('0x48')]);_0x25679f['attributes']=_[_0xd26e('0x4a')](_0x2d425f[_0xd26e('0x46')],qs['fields'](_0x4b4fce[_0xd26e('0x48')]['fields']));_0x25679f[_0xd26e('0x49')]=_0x25679f['attributes'][_0xd26e('0x72')]?_0x25679f[_0xd26e('0x49')]:_0x2d425f['model'];if(!_0x4b4fce[_0xd26e('0x48')][_0xd26e('0x4c')](_0xd26e('0x4d'))){_0x25679f['limit']=qs['limit'](_0x4b4fce[_0xd26e('0x48')][_0xd26e('0x27')]);_0x25679f[_0xd26e('0x25')]=qs[_0xd26e('0x25')](_0x4b4fce[_0xd26e('0x48')][_0xd26e('0x25')]);}_0x25679f[_0xd26e('0x4e')]=qs['sort'](_0x4b4fce[_0xd26e('0x48')][_0xd26e('0x4f')]);_0x25679f['where']=qs[_0xd26e('0xc9')](_[_0xd26e('0x51')](_0x4b4fce[_0xd26e('0x48')],_0x2d425f[_0xd26e('0xc9')]));_0x25679f['where']['SmsInteractionId']=_0x2eb9f5['id'];if(_0x4b4fce[_0xd26e('0x48')]['filter']){_0x25679f['where']=_[_0xd26e('0xc0')](_0x25679f[_0xd26e('0x50')],{'$or':_[_0xd26e('0x33')](_0x25679f['attributes'],function(_0x79d397){var _0x208581={};_0x208581[_0x79d397]={'$like':'%'+_0x4b4fce[_0xd26e('0x48')][_0xd26e('0x8e')]+'%'};return _0x208581;})});}if(_0x4b4fce['query']['$gte']){var _0x49d7ee=_0x4b4fce[_0xd26e('0x48')][_0xd26e('0xca')]['split'](',');var _0x4e109f={};_0x4e109f[_0x49d7ee[0x0]]={'$gte':moment(_0x49d7ee[0x1])[_0xd26e('0xcb')](_0xd26e('0xcc'))};_0x25679f[_0xd26e('0x50')]=_[_0xd26e('0xc0')](_0x25679f[_0xd26e('0x50')],_0x4e109f);}_0x25679f=_['merge']({},_0x25679f,_0x4b4fce[_0xd26e('0xc1')]);return db[_0xd26e('0xc8')][_0xd26e('0x28')]({'where':_0x25679f[_0xd26e('0x50')]})[_0xd26e('0x2e')](function(_0x55b9dc){_0x1499b0[_0xd26e('0x28')]=_0x55b9dc;if(_0x4b4fce[_0xd26e('0x48')][_0xd26e('0xbf')]){_0x25679f[_0xd26e('0xcd')]=[{'all':!![]}];}return db['SmsMessage'][_0xd26e('0xce')](_0x25679f);})['then'](function(_0xcfe410){_0x1499b0[_0xd26e('0xcf')]=_0xcfe410;return _0x1499b0;});}})['then'](respondWithFilteredResult(_0x4662c1,_0x25679f))['catch'](handleError(_0x4662c1,null));};exports[_0xd26e('0xd0')]=function(_0x11b96f,_0x3d7ef5,_0x4537bb){return db[_0xd26e('0x41')][_0xd26e('0x69')]({'where':{'id':_0x11b96f[_0xd26e('0xbe')]['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x3d7ef5,null))[_0xd26e('0x2e')](function(_0x3eff7c){if(_0x3eff7c){return _0x3eff7c[_0xd26e('0xd1')](_0x11b96f[_0xd26e('0x7b')][_0xd26e('0xc5')],_[_0xd26e('0xd2')](_0x11b96f['body'],[_0xd26e('0xc5'),'id'])||{})[_0xd26e('0xd3')](function(){return db['Tag'][_0xd26e('0xce')]({'attributes':['id',_0xd26e('0x30'),_0xd26e('0x54')],'where':{'id':_0x11b96f[_0xd26e('0x7b')][_0xd26e('0xc5')]}});})[_0xd26e('0x2e')](function(_0x6c18c3){socket[_0xd26e('0xd4')](_0xd26e('0xd5'),{'id':Number(_0x11b96f[_0xd26e('0xbe')]['id']),'tags':_0x6c18c3||[]});return{'id':Number(_0x11b96f[_0xd26e('0xbe')]['id']),'tags':_0x6c18c3||[]};});}})['then'](respondWithResult(_0x3d7ef5,null))[_0xd26e('0xbc')](handleError(_0x3d7ef5,null));};exports['removeTags']=function(_0x2f2f98,_0x1bf17b,_0xae4ac0){return db[_0xd26e('0x41')]['find']({'where':{'id':_0x2f2f98['params']['id']}})[_0xd26e('0x2e')](handleEntityNotFound(_0x1bf17b,null))[_0xd26e('0x2e')](function(_0x1bb819){if(_0x1bb819){return _0x1bb819[_0xd26e('0xd6')](_0x2f2f98[_0xd26e('0x48')][_0xd26e('0xc5')]);}})['then'](respondWithStatusCode(_0x1bf17b,null))[_0xd26e('0xbc')](handleError(_0x1bf17b,null));};exports[_0xd26e('0xd7')]=function(_0x262f2f,_0x411803){var _0x12e308=moment()['unix']()[_0xd26e('0xa3')]();var _0x80e542=path['join'](config[_0xd26e('0xd8')],_0xd26e('0xd9'),_0xd26e('0xda'),_0xd26e('0xdb'));var _0x2f76a6=path[_0xd26e('0xdc')](config[_0xd26e('0xd8')],_0xd26e('0xd9'),_0xd26e('0xda'),_0xd26e('0xdd'));var _0x566c00=path['join'](_0x80e542,_0x12e308);var _0x16bbdf=util[_0xd26e('0xcb')](_0xd26e('0xde'),_0x262f2f['params']['id'],_0x12e308);var _0x434f4e=path[_0xd26e('0xdc')](_0x80e542,_0x16bbdf);var _0x467d11=[];_0x467d11[_0xd26e('0xba')]({'model':db['User'],'as':'User','attributes':['id',_0xd26e('0x34')],'raw':!![]});_0x467d11[_0xd26e('0xba')]({'model':db[_0xd26e('0xdf')],'as':_0xd26e('0x6f'),'attributes':['id',_0xd26e('0xe0'),_0xd26e('0xe1')],'raw':!![]});var _0x59e892=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xd26e('0x7b'),_0xd26e('0x83'),_0xd26e('0xe2'),_0xd26e('0xe3'),_0xd26e('0x89')],'include':_0x467d11}];_0x59e892[_0xd26e('0xba')]({'model':db[_0xd26e('0xe4')],'as':_0xd26e('0xe5'),'attributes':['id','name']});_0x59e892[_0xd26e('0xba')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd26e('0x34')]});return db['SmsInteraction'][_0xd26e('0x69')]({'where':{'id':_0x262f2f[_0xd26e('0xbe')]['id']},'include':_0x59e892})[_0xd26e('0x2e')](handleEntityNotFound(_0x411803,null))[_0xd26e('0x2e')](function(_0x277a16){if(_0x277a16){var _0x4bd06a=_0x277a16['get']({'plain':!![]});fs[_0xd26e('0xe6')](_0x566c00);var _0x8264d7={'channel':_0xd26e('0xe7'),'account':_0x4bd06a[_0xd26e('0xe5')][_0xd26e('0x30')],'agent':_0x4bd06a[_0xd26e('0xe8')]?_0x4bd06a[_0xd26e('0xe8')]['fullname']:_0xd26e('0xe9'),'createdAt':moment(_0x4bd06a[_0xd26e('0x83')])[_0xd26e('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd26e('0xa3')](),'closedAt':_0x4bd06a[_0xd26e('0x3d')]?moment(_0x4bd06a[_0xd26e('0xea')])['format'](_0xd26e('0xcc'))[_0xd26e('0xa3')]():'','disposition':_0x4bd06a[_0xd26e('0xeb')],'messages':_(_0x4bd06a[_0xd26e('0xec')])[_0xd26e('0x8e')]({'secret':![]})[_0xd26e('0x33')](function(_0x53df28){return{'date':moment(_0x53df28['createdAt'])[_0xd26e('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd26e('0xa3')](),'sender':_0x53df28[_0xd26e('0xe2')]==='out'?_0x53df28[_0xd26e('0x79')]?_0x53df28[_0xd26e('0x79')][_0xd26e('0x34')]:_0xd26e('0xed'):_0x53df28[_0xd26e('0x6f')][_0xd26e('0xe0')]+(_0x53df28[_0xd26e('0x6f')][_0xd26e('0xe1')]?'\x20'+_0x53df28[_0xd26e('0x6f')]['lastName']:''),'body':_0x53df28['body'],'direction':_0x53df28[_0xd26e('0xe2')]===_0xd26e('0xee')?'A':'C','secret':_0x53df28['secret'],'read':_0x53df28['read']};})['value']()};return ejs[_0xd26e('0xef')](path[_0xd26e('0xdc')](config['root'],'server','views',_0xd26e('0xf0')),{'interaction':_0x8264d7})[_0xd26e('0x2e')](function(_0x33be41){var _0x30dbae=path[_0xd26e('0xdc')](_0x566c00,_0xd26e('0xf1')+_0x4bd06a['id']+'-'+_0x12e308+'.pdf');var _0x587f95={'path':_0x30dbae,'channel':'Sms','interactionId':_0x4bd06a['id']};return pdf['createPdfFromHTML'](_0x33be41,_0x587f95);})['then'](function(){return new BPromise(function(_0x1f0c41,_0x318ca2){zipdir(_0x566c00,{'saveTo':_0x434f4e},function(_0x47a28b,_0x322a58){if(_0x47a28b)return _0x318ca2(_0x47a28b);return _0x1f0c41(_0x322a58);});})['then'](function(){return new BPromise(function(_0x31fc1f,_0x511878){rimraf(_0x566c00,function(_0x1d5d68){if(_0x1d5d68)_0x511878(_0x1d5d68);return _0x31fc1f();});});})[_0xd26e('0x2e')](function(){return _0x411803[_0xd26e('0xd7')](_0x434f4e,_0x16bbdf,function(_0x1b92e9){if(_0x1b92e9){console[_0xd26e('0xf2')](_0xd26e('0xf3'),_0x1b92e9);}else{fs[_0xd26e('0xf4')](_0x434f4e);}});});});}else{return _0x411803[_0xd26e('0x21')](0xc8);}})['catch'](handleError(_0x411803,null));}; \ No newline at end of file +var _0xd0b5=['limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','push','waiting','answered','unmanaged','total','UserId','closed','talking','SmsInteraction','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','order','where','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','SmsAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IN\x20?','agent','sequelize','toString','length','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','catch','show','params','include','options','create','body','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','Tag','smsInteractionTags:save','removeTags','download','join','root','files','tmp','attachments','firstName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','System','lastName','out','renderFile','server','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','undefined'];(function(_0x311edd,_0x35b828){var _0x5ae5ea=function(_0x1b8708){while(--_0x1b8708){_0x311edd['push'](_0x311edd['shift']());}};_0x5ae5ea(++_0x35b828);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x185041,_0x29b230){_0x185041=_0x185041-0x0;var _0x419ce7=_0xd0b5[_0x185041];return _0x419ce7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d0b('0x0'));var jsonpatch=require(_0x5d0b('0x1'));var rp=require('request-promise');var moment=require(_0x5d0b('0x2'));var BPromise=require(_0x5d0b('0x3'));var Mustache=require(_0x5d0b('0x4'));var util=require(_0x5d0b('0x5'));var path=require(_0x5d0b('0x6'));var sox=require(_0x5d0b('0x7'));var csv=require(_0x5d0b('0x8'));var ejs=require(_0x5d0b('0x9'));var fs=require('fs');var fs_extra=require(_0x5d0b('0xa'));var _=require(_0x5d0b('0xb'));var squel=require(_0x5d0b('0xc'));var crypto=require(_0x5d0b('0xd'));var jsforce=require(_0x5d0b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d0b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d0b('0xf'));var authService=require(_0x5d0b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5d0b('0x11'));var pdf=require(_0x5d0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d0b('0x13'))(_0x5d0b('0x14'));var utils=require(_0x5d0b('0x15'));var config=require(_0x5d0b('0x16'));var licenseUtil=require(_0x5d0b('0x17'));var db=require(_0x5d0b('0x18'))['db'];config['redis']=_[_0x5d0b('0x19')](config[_0x5d0b('0x1a')],{'host':_0x5d0b('0x1b'),'port':0x18eb});var socket=require(_0x5d0b('0x1c'))(new Redis(config['redis']));require(_0x5d0b('0x1d'))[_0x5d0b('0x1e')](socket);function respondWithStatusCode(_0x4886f1,_0x1274e2){_0x1274e2=_0x1274e2||0xcc;return function(_0x4d5256){if(_0x4d5256){return _0x4886f1['sendStatus'](_0x1274e2);}return _0x4886f1[_0x5d0b('0x1f')](_0x1274e2)[_0x5d0b('0x20')]();};}function respondWithResult(_0x3bd719,_0x2937db){_0x2937db=_0x2937db||0xc8;return function(_0x4892a4){if(_0x4892a4){return _0x3bd719[_0x5d0b('0x1f')](_0x2937db)[_0x5d0b('0x21')](_0x4892a4);}};}function respondWithFilteredResult(_0x191589,_0x32f522){return function(_0x292b30){if(_0x292b30){var _0x2299ad=typeof _0x32f522[_0x5d0b('0x22')]===_0x5d0b('0x23')&&typeof _0x32f522[_0x5d0b('0x24')]===_0x5d0b('0x23');var _0x120b8f=_0x292b30[_0x5d0b('0x25')];var _0x5fdbc5=_0x2299ad?0x0:_0x32f522['offset'];var _0x4c6fb2=_0x2299ad?_0x292b30[_0x5d0b('0x25')]:_0x32f522[_0x5d0b('0x22')]+_0x32f522[_0x5d0b('0x24')];var _0x25d4e1;if(_0x4c6fb2>=_0x120b8f){_0x4c6fb2=_0x120b8f;_0x25d4e1=0xc8;}else{_0x25d4e1=0xce;}_0x191589[_0x5d0b('0x1f')](_0x25d4e1);return _0x191589['set'](_0x5d0b('0x26'),_0x5fdbc5+'-'+_0x4c6fb2+'/'+_0x120b8f)[_0x5d0b('0x21')](_0x292b30);}return null;};}function patchUpdates(_0x5a39f1){return function(_0x24e096){try{jsonpatch[_0x5d0b('0x27')](_0x24e096,_0x5a39f1,!![]);}catch(_0x458ae3){return BPromise[_0x5d0b('0x28')](_0x458ae3);}return _0x24e096[_0x5d0b('0x29')]();};}function saveUpdates(_0x4a6f66,_0x2c0928){return function(_0x24c044){if(_0x24c044){return _0x24c044[_0x5d0b('0x2a')](_0x4a6f66)[_0x5d0b('0x2b')](function(_0x2d9d8b){return _0x2d9d8b;});}return null;};}function removeEntity(_0x45c97f,_0x28cb69){return function(_0x482525){if(_0x482525){return _0x482525[_0x5d0b('0x2c')]()['then'](function(){_0x45c97f['status'](0xcc)[_0x5d0b('0x20')]();});}};}function handleEntityNotFound(_0x2c1b03,_0x300528){return function(_0x53b080){if(!_0x53b080){_0x2c1b03[_0x5d0b('0x2d')](0x194);}return _0x53b080;};}function handleError(_0x29d194,_0x4bfcc2){_0x4bfcc2=_0x4bfcc2||0x1f4;return function(_0x20e28b){logger[_0x5d0b('0x2e')](_0x20e28b[_0x5d0b('0x2f')]);if(_0x20e28b['name']){delete _0x20e28b[_0x5d0b('0x30')];}_0x29d194[_0x5d0b('0x1f')](_0x4bfcc2)[_0x5d0b('0x31')](_0x20e28b);};}function getInteractionUsers(_0x15e1b1,_0x2a93ec){return new BPromise(function(_0x41856f,_0x53571c){try{if(_0x2a93ec[_0x15e1b1['id']]){_0x15e1b1[_0x5d0b('0x32')]=_[_0x5d0b('0x33')](_0x2a93ec[_0x15e1b1['id']],function(_0x56a21c){return{'id':_0x56a21c['id'],'fullname':_0x56a21c[_0x5d0b('0x34')]};});}}catch(_0x21ad29){_0x53571c(_0x21ad29);}_0x41856f(_0x15e1b1);});}function getInteractionTags(_0x427bc3,_0x30adb0){return new BPromise(function(_0x1a51fb,_0x2f325f){try{if(_0x427bc3['TagIds']){_0x427bc3[_0x5d0b('0x35')]=[];_0x427bc3[_0x5d0b('0x36')][_0x5d0b('0x37')](',')['forEach'](function(_0x561a6c){_0x427bc3[_0x5d0b('0x35')][_0x5d0b('0x38')](_0x30adb0[_0x561a6c]);});}delete _0x427bc3['TagIds'];}catch(_0x37c879){_0x2f325f(_0x37c879);}_0x1a51fb(_0x427bc3);});}function updateSmsInteraction(_0xbdd1ee,_0x3b5f75,_0x437de8){return new BPromise(function(_0x23e70f,_0x2dd746){return getInteractionUsers(_0xbdd1ee,_0x437de8)[_0x5d0b('0x2b')](function(_0xe4267a){return getInteractionTags(_0xe4267a,_0x3b5f75);})['then'](function(_0x2f2e34){return getStateInteraction(_0x2f2e34);})['then'](function(_0x4fd220){_0x23e70f(_0x4fd220);})['catch'](function(_0x55d185){_0x2dd746(_0x55d185);});});}function getStateInteraction(_0x5e0ba9){return new BPromise(function(_0x14f3b2){_0x5e0ba9[_0x5d0b('0x39')]=0x0;_0x5e0ba9['talking']=0x0;_0x5e0ba9[_0x5d0b('0x3a')]=0x0;_0x5e0ba9[_0x5d0b('0x3b')]=0x0;_0x5e0ba9[_0x5d0b('0x3c')]=0x0;if(!_0x5e0ba9['closed']&&!_0x5e0ba9[_0x5d0b('0x3d')]){_0x5e0ba9[_0x5d0b('0x39')]+=0x1;}if(!_0x5e0ba9[_0x5d0b('0x3e')]&&_0x5e0ba9[_0x5d0b('0x3d')]){_0x5e0ba9['talking']+=0x1;if(_0x5e0ba9[_0x5d0b('0x39')]){_0x5e0ba9[_0x5d0b('0x39')]-=0x1;}}if(_0x5e0ba9[_0x5d0b('0x3e')]&&_0x5e0ba9[_0x5d0b('0x3d')]){_0x5e0ba9[_0x5d0b('0x3a')]+=0x1;if(_0x5e0ba9[_0x5d0b('0x3f')]){_0x5e0ba9['talking']-=0x1;}}if(_0x5e0ba9[_0x5d0b('0x3e')]&&!_0x5e0ba9['UserId']){_0x5e0ba9['unmanaged']+=0x1;if(_0x5e0ba9[_0x5d0b('0x39')]){_0x5e0ba9['waiting']-=0x1;}}_0x5e0ba9['total']+=0x1;_0x14f3b2(_0x5e0ba9);});}exports['index']=function(_0x8423dc,_0x58928d){var _0x509121={},_0x4d3129={},_0x349c84={'count':0x0,'rows':[]};var _0xe5ae0b=_[_0x5d0b('0x33')](db[_0x5d0b('0x40')][_0x5d0b('0x41')],function(_0x535def){return{'name':_0x535def['fieldName'],'type':_0x535def[_0x5d0b('0x42')][_0x5d0b('0x43')]};});_0x4d3129[_0x5d0b('0x44')]=_[_0x5d0b('0x33')](_0xe5ae0b,_0x5d0b('0x30'));_0x4d3129['query']=_[_0x5d0b('0x45')](_0x8423dc['query']);_0x4d3129[_0x5d0b('0x46')]=_[_0x5d0b('0x47')](_0x4d3129['model'],_0x4d3129[_0x5d0b('0x48')]);_0x509121['attributes']=_['intersection'](_0x4d3129[_0x5d0b('0x44')],qs['fields'](_0x8423dc[_0x5d0b('0x48')]['fields']));_0x509121[_0x5d0b('0x49')]=_0x509121['attributes']['length']?_0x509121['attributes']:_0x4d3129['model'];if(!_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0x4a')](_0x5d0b('0x4b'))){_0x509121[_0x5d0b('0x24')]=qs[_0x5d0b('0x24')](_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0x24')]);_0x509121['offset']=qs[_0x5d0b('0x22')](_0x8423dc['query'][_0x5d0b('0x22')]);}_0x509121[_0x5d0b('0x4c')]=qs['sort'](_0x8423dc['query']['sort']);_0x509121[_0x5d0b('0x4d')]=qs[_0x5d0b('0x46')](_[_0x5d0b('0x4e')](_0x8423dc[_0x5d0b('0x48')],_0x4d3129[_0x5d0b('0x46')]),_0xe5ae0b);var _0x578b05=[];var _0x40cfa6=squel[_0x5d0b('0x4f')]()[_0x5d0b('0x50')]('id')[_0x5d0b('0x50')](_0x5d0b('0x30'))[_0x5d0b('0x50')](_0x5d0b('0x51'))[_0x5d0b('0x52')](_0x5d0b('0x53'));var _0x250abf=squel[_0x5d0b('0x4f')]()[_0x5d0b('0x50')]('u.id')[_0x5d0b('0x50')](_0x5d0b('0x54'))['field'](_0x5d0b('0x55'))['from'](_0x5d0b('0x56'),'ui')['left_join']('users','u',_0x5d0b('0x57'));var _0x3d2f54=squel[_0x5d0b('0x4f')]()['from']('sms_interactions','i')[_0x5d0b('0x58')](_0x5d0b('0x59'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5d0b('0x58')](_0x5d0b('0x5a'),'o',_0x5d0b('0x5b'))[_0x5d0b('0x58')](_0x5d0b('0x5c'),'a',_0x5d0b('0x5d'))[_0x5d0b('0x58')](_0x5d0b('0x5e'),'me',_0x5d0b('0x5f'))[_0x5d0b('0x58')](_0x5d0b('0x60'),'it',_0x5d0b('0x61'))['left_join'](_0x5d0b('0x53'),'t',_0x5d0b('0x62'));var _0x41a6fd=squel[_0x5d0b('0x63')]();var _0x4610e0=[];var _0x19556f=squel[_0x5d0b('0x63')]();var _0x3127d3;if(_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0x64')]){_0x3127d3=as[_0x5d0b('0x65')](_0x8423dc['query'][_0x5d0b('0x64')]);var _0x25cf99=_0x3127d3[_0x5d0b('0x66')];for(var _0x586a=0x0;_0x586a<_0x3127d3[_0x5d0b('0x67')]['length'];_0x586a++){var _0x5d19dd=_0x3127d3[_0x5d0b('0x67')][_0x586a];var _0x301794='i';var _0x20ef46=_[_0x5d0b('0x68')](_0xe5ae0b,[_0x5d0b('0x30'),_0x5d19dd['field']]);if(!_0x20ef46){switch(_0x5d19dd[_0x5d0b('0x50')]){case _0x5d0b('0x69'):if(_0x5d19dd['value']==0x1){_0x3d2f54[_0x5d0b('0x6a')]('`'+_0x5d19dd[_0x5d0b('0x50')]+_0x5d0b('0x6b'));}else{_0x3d2f54[_0x5d0b('0x6a')]('`'+_0x5d19dd[_0x5d0b('0x50')]+_0x5d0b('0x6c'));}break;case _0x5d0b('0x6d'):if(_0x5d19dd[_0x5d0b('0x6e')]===_0x5d0b('0x6f')){if(_0x5d19dd[_0x5d0b('0x70')]['split']('\x20')['length']>0x1){_0x41a6fd[_0x25cf99](_0x5d0b('0x71'),qs[_0x5d0b('0x72')](_0x5d19dd[_0x5d0b('0x70')]),null);}else{var _0x9f2398='%'+_0x5d19dd[_0x5d0b('0x70')]+'%';_0x41a6fd[_0x25cf99](_0x5d0b('0x73'),_0x9f2398,_0x9f2398,_0x9f2398);}}else{_0x20ef46=_['find'](_0xe5ae0b,['name',_0x5d0b('0x74')]);_0x5d19dd[_0x5d0b('0x50')]=_0x5d0b('0x74');_0x4e30d2=as['buildExpression'](_0x301794,_0x20ef46[_0x5d0b('0x42')],_0x5d19dd);_0x41a6fd[_0x25cf99](_0x4e30d2[_0x5d0b('0x75')],_0x4e30d2[_0x5d0b('0x70')][_0x5d0b('0x76')],_0x4e30d2[_0x5d0b('0x70')][_0x5d0b('0x20')]);}break;case'Tag':var _0x2a4ca3=_0x5d19dd[_0x5d0b('0x70')][_0x5d0b('0x37')](',')[_0x5d0b('0x33')](function(_0x3d9b2a){return Number(_0x3d9b2a);});_0x2a4ca3[_0x5d0b('0x77')](function(_0x1bd7d3){_0x19556f['or'](_0x5d0b('0x78'),'%,'+_0x1bd7d3+',%');});_0x4610e0=_[_0x5d0b('0x79')](_0x4610e0,_0x2a4ca3);break;case _0x5d0b('0x7a'):if(_0x5d19dd[_0x5d0b('0x6e')]==='$substring'){_0x41a6fd[_0x25cf99](_0x5d0b('0x7b'),'%'+_0x5d19dd[_0x5d0b('0x70')]+'%',null);}else{_0x20ef46=_[_0x5d0b('0x68')](_0xe5ae0b,[_0x5d0b('0x30'),_0x5d0b('0x3d')]);_0x5d19dd[_0x5d0b('0x50')]='UserId';_0x4e30d2=as['buildExpression'](_0x301794,_0x20ef46[_0x5d0b('0x42')],_0x5d19dd);_0x41a6fd[_0x25cf99](_0x4e30d2[_0x5d0b('0x75')],_0x4e30d2[_0x5d0b('0x70')][_0x5d0b('0x76')],_0x4e30d2[_0x5d0b('0x70')][_0x5d0b('0x20')]);}break;case'body':_0x4e30d2=as[_0x5d0b('0x7c')]('me',null,_0x5d19dd);_0x41a6fd[_0x25cf99](_0x4e30d2[_0x5d0b('0x75')],_0x4e30d2['value'][_0x5d0b('0x76')],_0x4e30d2[_0x5d0b('0x70')]['end']);break;}}else{var _0x4e30d2=as[_0x5d0b('0x7c')](_0x301794,_0x20ef46[_0x5d0b('0x42')],_0x5d19dd);_0x41a6fd[_0x25cf99](_0x4e30d2['text'],_0x4e30d2[_0x5d0b('0x70')]['start'],_0x4e30d2[_0x5d0b('0x70')][_0x5d0b('0x20')]);}}}else{var _0x211257=_(_0x8423dc[_0x5d0b('0x48')])['keys']()[_0x5d0b('0x33')](function(_0x45ce74){return _[_0x5d0b('0x7d')](_0xe5ae0b,[_0x5d0b('0x30'),_0x45ce74])?_0x45ce74:undefined;})[_0x5d0b('0x7e')]()[_0x5d0b('0x70')]();if(!_[_0x5d0b('0x7f')](_0x211257)){_0x211257[_0x5d0b('0x77')](function(_0x1f37d4){if(_0x1f37d4===_0x5d0b('0x80')){_0x3d2f54['where']('i.SmsAccountId\x20IN\x20?',[][_0x5d0b('0x81')](_0x8423dc[_0x5d0b('0x48')][_0x1f37d4]));}else if(_0x1f37d4===_0x5d0b('0x82')){var _0x112b45=JSON['parse'](_0x8423dc[_0x5d0b('0x48')][_0x1f37d4])[_0x5d0b('0x83')];var _0x45a7e1=JSON[_0x5d0b('0x84')](_0x8423dc['query'][_0x1f37d4])[_0x5d0b('0x85')];_0x3d2f54[_0x5d0b('0x4d')](_0x5d0b('0x86'),_0x112b45,_0x45a7e1);}else{if(_0x8423dc[_0x5d0b('0x48')][_0x1f37d4]===_0x5d0b('0x87')){_0x3d2f54[_0x5d0b('0x4d')]('i.'+_0x1f37d4+_0x5d0b('0x88'));}else{_0x3d2f54[_0x5d0b('0x4d')]('i.'+_0x1f37d4+_0x5d0b('0x89'),_0x8423dc[_0x5d0b('0x48')][_0x1f37d4]);}}});}if(_0x8423dc[_0x5d0b('0x48')]['read']){if(_0x8423dc['query'][_0x5d0b('0x8a')]==0x1){_0x3d2f54[_0x5d0b('0x6a')](_0x5d0b('0x8b'));}else{_0x3d2f54[_0x5d0b('0x6a')](_0x5d0b('0x8c'));}}if(_0x8423dc['query']['tag']){_0x4610e0=_['isArray'](_0x8423dc[_0x5d0b('0x48')]['tag'])?_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0x8d')]:new Array(_0x8423dc[_0x5d0b('0x48')]['tag']);_0x4610e0['forEach'](function(_0x26dd0f){_0x19556f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26dd0f+',%');});}if(_0x8423dc[_0x5d0b('0x48')]['filter']){var _0x3aeebd=_0x8423dc['query'][_0x5d0b('0x8e')][_0x5d0b('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3aeebd)){_0x41a6fd['or']('i.id\x20LIKE\x20?',_0x3aeebd+'%')['or'](_0x5d0b('0x90'),_0x3aeebd+'%');}else{_0x41a6fd['or'](_0x5d0b('0x91'),qs[_0x5d0b('0x72')](_0x3aeebd))['or'](_0x5d0b('0x92'),_0x3aeebd+'%');}}}_0x3d2f54[_0x5d0b('0x4d')](_0x41a6fd);_0x3d2f54[_0x5d0b('0x93')](_0x5d0b('0x94'));var _0x185dc1={'type':db[_0x5d0b('0x95')]['QueryTypes']['SELECT'],'raw':!![]};var _0xf6a54f=_0x3d2f54[_0x5d0b('0x96')]();_0xf6a54f['field'](_0x5d0b('0x94'));_0xf6a54f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5d0b('0x69'));if(_0x509121[_0x5d0b('0x4c')]){_0x509121[_0x5d0b('0x4c')]['forEach'](function(_0x2e2c18){var _0x4c160c=_0x2e2c18[0x0]===_0x5d0b('0x97')?_0x2e2c18[0x0]:'i.'+_0x2e2c18[0x0];_0x3d2f54[_0x5d0b('0x4c')](_0x4c160c,_0x2e2c18[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5d0b('0x7f')](_0x4610e0)){_0x3d2f54[_0x5d0b('0x6a')](_0x19556f);_0xf6a54f['where'](_0x5d0b('0x98'),_0x4610e0);}BPromise[_0x5d0b('0x99')]()[_0x5d0b('0x2b')](function(){if(!_0x3127d3){if(_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0x80')])return;_0xf6a54f[_0x5d0b('0x4d')](_0x5d0b('0x9a'));_0x3d2f54[_0x5d0b('0x4d')](_0x5d0b('0x9a'));return;}if(_0x8423dc[_0x5d0b('0x9b')]['role']!=='agent')return;return _0x8423dc[_0x5d0b('0x9b')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x5d0b('0x2b')](function(_0x30433b){if(_['isEmpty'](_0x30433b)){_0xf6a54f[_0x5d0b('0x4d')]('i.SmsAccountId\x20IS\x20NULL');_0x3d2f54['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0xf6a54f['where'](_0x5d0b('0x9c'),_['map'](_0x30433b,'id'));_0x3d2f54[_0x5d0b('0x4d')](_0x5d0b('0x9c'),_[_0x5d0b('0x33')](_0x30433b,'id'));}});})[_0x5d0b('0x2b')](function(){if(_0x8423dc[_0x5d0b('0x9b')]['role']===_0x5d0b('0x9d')&&!_0x3127d3&&!_0x8423dc[_0x5d0b('0x48')]['SmsAccountId'])return[];return db[_0x5d0b('0x9e')][_0x5d0b('0x48')](_0xf6a54f[_0x5d0b('0x9f')](),_0x185dc1);})[_0x5d0b('0x2b')](function(_0x2d49fa){_0x349c84[_0x5d0b('0x25')]=_0x2d49fa[_0x5d0b('0xa0')];if(_0x349c84[_0x5d0b('0x25')]===0x0)return[];return db[_0x5d0b('0x9e')][_0x5d0b('0x48')](_0x40cfa6[_0x5d0b('0x9f')](),_0x185dc1)[_0x5d0b('0x2b')](function(_0x4290de){_0x578b05=_[_0x5d0b('0xa1')](_0x4290de,'id');_0x185dc1=_[_0x5d0b('0xa2')](_0x185dc1,{'model':db[_0x5d0b('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8423dc[_0x5d0b('0x48')][_0x5d0b('0xa3')]){_0x509121['attributes']['forEach'](function(_0x5cc3ef){_0x3d2f54['field']('i.'+_0x5cc3ef);});}else{_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xa4'),_0x5d0b('0x69'));_0x3d2f54['field'](_0x5d0b('0xa5'),_0x5d0b('0xa6'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xa7'),_0x5d0b('0xa8'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xa9'),'contactName');_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xaa'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xab'),_0x5d0b('0xac'));_0x3d2f54['field'](_0x5d0b('0xad'),_0x5d0b('0xae'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xaf'),_0x5d0b('0xb0'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xb1'),_0x5d0b('0xb2'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xb3'),_0x5d0b('0xb4'));_0x3d2f54['field'](_0x5d0b('0xb5'),_0x5d0b('0xb6'));_0x3d2f54[_0x5d0b('0x50')]('o.fullname','Owner.fullname');_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xb7'),_0x5d0b('0xb8'));_0x3d2f54[_0x5d0b('0x50')](_0x5d0b('0xb9'),_0x5d0b('0x36'));}if(_0x509121[_0x5d0b('0x24')])_0x3d2f54[_0x5d0b('0x24')](_0x509121[_0x5d0b('0x24')]);if(_0x509121[_0x5d0b('0x22')])_0x3d2f54['offset'](_0x509121['offset']);return db[_0x5d0b('0x9e')][_0x5d0b('0x48')](_0x3d2f54['toString'](),_0x185dc1);})[_0x5d0b('0x2b')](function(_0x51eaa3){if(_0x51eaa3[_0x5d0b('0xa0')]>0x0)_0x250abf[_0x5d0b('0x4d')](_0x5d0b('0xba'),_['map'](_0x51eaa3,'id'));return db['sequelize'][_0x5d0b('0x48')](_0x250abf[_0x5d0b('0x9f')](),_0x185dc1)[_0x5d0b('0x2b')](function(_0x54e6c2){var _0x4a1dca=_[_0x5d0b('0xbb')](_0x54e6c2,_0x5d0b('0xbc'));var _0x4db2ea=[];_0x51eaa3[_0x5d0b('0x77')](function(_0x3edeb7){_0x4db2ea['push'](updateSmsInteraction(_0x3edeb7,_0x578b05,_0x4a1dca));});return BPromise['all'](_0x4db2ea);});});})['then'](function(_0x5e499e){_0x349c84['rows']=_0x5e499e;return _0x349c84;})[_0x5d0b('0x2b')](respondWithFilteredResult(_0x58928d,_0x509121))[_0x5d0b('0xbd')](handleError(_0x58928d,null));};exports[_0x5d0b('0xbe')]=function(_0x88d1b5,_0x29ec10){var _0x199c7a={'raw':![],'where':{'id':_0x88d1b5[_0x5d0b('0xbf')]['id']}},_0xa209a3={};_0xa209a3[_0x5d0b('0x44')]=_[_0x5d0b('0x45')](db['SmsInteraction'][_0x5d0b('0x41')]);_0xa209a3[_0x5d0b('0x48')]=_[_0x5d0b('0x45')](_0x88d1b5['query']);_0xa209a3[_0x5d0b('0x46')]=_[_0x5d0b('0x47')](_0xa209a3['model'],_0xa209a3[_0x5d0b('0x48')]);_0x199c7a[_0x5d0b('0x49')]=_[_0x5d0b('0x47')](_0xa209a3['model'],qs['fields'](_0x88d1b5['query'][_0x5d0b('0xa3')]));_0x199c7a['attributes']=_0x199c7a['attributes']['length']?_0x199c7a[_0x5d0b('0x49')]:_0xa209a3[_0x5d0b('0x44')];if(_0x88d1b5[_0x5d0b('0x48')]['includeAll']){_0x199c7a[_0x5d0b('0xc0')]=[{'all':!![]}];}_0x199c7a=_[_0x5d0b('0xa2')]({},_0x199c7a,_0x88d1b5[_0x5d0b('0xc1')]);return db[_0x5d0b('0x40')][_0x5d0b('0x68')](_0x199c7a)[_0x5d0b('0x2b')](handleEntityNotFound(_0x29ec10,null))[_0x5d0b('0x2b')](respondWithResult(_0x29ec10,null))['catch'](handleError(_0x29ec10,null));};exports[_0x5d0b('0xc2')]=function(_0x1380d7,_0x296bc8){return db[_0x5d0b('0x40')][_0x5d0b('0xc2')](_0x1380d7[_0x5d0b('0xc3')],{})[_0x5d0b('0x2b')](respondWithResult(_0x296bc8,0xc9))[_0x5d0b('0xbd')](handleError(_0x296bc8,null));};exports[_0x5d0b('0x2a')]=function(_0x3aac3c,_0xe6e486){if(_0x3aac3c[_0x5d0b('0xc3')]['id']){delete _0x3aac3c[_0x5d0b('0xc3')]['id'];}return db[_0x5d0b('0x40')][_0x5d0b('0x68')]({'where':{'id':_0x3aac3c[_0x5d0b('0xbf')]['id']}})[_0x5d0b('0x2b')](handleEntityNotFound(_0xe6e486,null))[_0x5d0b('0x2b')](saveUpdates(_0x3aac3c[_0x5d0b('0xc3')],null))[_0x5d0b('0x2b')](respondWithResult(_0xe6e486,null))[_0x5d0b('0xbd')](handleError(_0xe6e486,null));};exports['destroy']=function(_0x11856c,_0x4c0fdf){return db['SmsInteraction'][_0x5d0b('0x68')]({'where':{'id':_0x11856c[_0x5d0b('0xbf')]['id']}})[_0x5d0b('0x2b')](handleEntityNotFound(_0x4c0fdf,null))['then'](removeEntity(_0x4c0fdf,null))[_0x5d0b('0xbd')](handleError(_0x4c0fdf,null));};exports[_0x5d0b('0xc4')]=function(_0x68727a,_0x58172b){return db['SmsInteraction'][_0x5d0b('0xc4')]()[_0x5d0b('0x2b')](respondWithResult(_0x58172b,null))[_0x5d0b('0xbd')](handleError(_0x58172b,null));};exports[_0x5d0b('0xc5')]=function(_0x1e57a6,_0x2111b6,_0xa7fc15){return db[_0x5d0b('0xc6')]['find']({'where':{'id':_0x1e57a6['params']['id']}})['then'](handleEntityNotFound(_0x2111b6,null))['then'](function(_0xbb8b58){if(_0xbb8b58){return _0xbb8b58['addMessage'](_0x1e57a6[_0x5d0b('0xc3')]['ids'],_[_0x5d0b('0xc7')](_0x1e57a6[_0x5d0b('0xc3')],[_0x5d0b('0xc8'),'id'])||{});}})['then'](respondWithResult(_0x2111b6,null))[_0x5d0b('0xbd')](handleError(_0x2111b6,null));};exports[_0x5d0b('0xc9')]=function(_0x3c3c76,_0x367004,_0x1e6715){var _0x3b9b48={'raw':![],'where':{}};var _0x1802b5={};var _0x1d56fa={'count':0x0,'rows':[]};return db[_0x5d0b('0x40')][_0x5d0b('0xca')]({'where':{'id':_0x3c3c76[_0x5d0b('0xbf')]['id']}})[_0x5d0b('0x2b')](handleEntityNotFound(_0x367004,null))['then'](function(_0x57f24e){if(_0x57f24e){_0x1802b5[_0x5d0b('0x44')]=_[_0x5d0b('0x45')](db[_0x5d0b('0xc6')]['rawAttributes']);_0x1802b5[_0x5d0b('0x48')]=_[_0x5d0b('0x45')](_0x3c3c76[_0x5d0b('0x48')]);_0x1802b5[_0x5d0b('0x46')]=_[_0x5d0b('0x47')](_0x1802b5['model'],_0x1802b5[_0x5d0b('0x48')]);_0x3b9b48[_0x5d0b('0x49')]=_[_0x5d0b('0x47')](_0x1802b5[_0x5d0b('0x44')],qs[_0x5d0b('0xa3')](_0x3c3c76['query'][_0x5d0b('0xa3')]));_0x3b9b48[_0x5d0b('0x49')]=_0x3b9b48[_0x5d0b('0x49')][_0x5d0b('0xa0')]?_0x3b9b48[_0x5d0b('0x49')]:_0x1802b5[_0x5d0b('0x44')];if(!_0x3c3c76['query'][_0x5d0b('0x4a')](_0x5d0b('0x4b'))){_0x3b9b48[_0x5d0b('0x24')]=qs[_0x5d0b('0x24')](_0x3c3c76[_0x5d0b('0x48')]['limit']);_0x3b9b48[_0x5d0b('0x22')]=qs[_0x5d0b('0x22')](_0x3c3c76[_0x5d0b('0x48')][_0x5d0b('0x22')]);}_0x3b9b48[_0x5d0b('0x4c')]=qs[_0x5d0b('0xcb')](_0x3c3c76['query']['sort']);_0x3b9b48[_0x5d0b('0x4d')]=qs[_0x5d0b('0x46')](_[_0x5d0b('0x4e')](_0x3c3c76[_0x5d0b('0x48')],_0x1802b5[_0x5d0b('0x46')]));_0x3b9b48[_0x5d0b('0x4d')][_0x5d0b('0xbc')]=_0x57f24e['id'];if(_0x3c3c76['query'][_0x5d0b('0x8e')]){_0x3b9b48[_0x5d0b('0x4d')]=_[_0x5d0b('0xa2')](_0x3b9b48['where'],{'$or':_[_0x5d0b('0x33')](_0x3b9b48[_0x5d0b('0x49')],function(_0x2756ea){var _0x1647ac={};_0x1647ac[_0x2756ea]={'$like':'%'+_0x3c3c76[_0x5d0b('0x48')]['filter']+'%'};return _0x1647ac;})});}if(_0x3c3c76[_0x5d0b('0x48')]['$gte']){var _0x537c4a=_0x3c3c76[_0x5d0b('0x48')][_0x5d0b('0x83')][_0x5d0b('0x37')](',');var _0x765dd1={};_0x765dd1[_0x537c4a[0x0]]={'$gte':moment(_0x537c4a[0x1])[_0x5d0b('0xcc')](_0x5d0b('0xcd'))};_0x3b9b48[_0x5d0b('0x4d')]=_[_0x5d0b('0xa2')](_0x3b9b48[_0x5d0b('0x4d')],_0x765dd1);}_0x3b9b48=_[_0x5d0b('0xa2')]({},_0x3b9b48,_0x3c3c76[_0x5d0b('0xc1')]);return db[_0x5d0b('0xc6')]['count']({'where':_0x3b9b48[_0x5d0b('0x4d')]})[_0x5d0b('0x2b')](function(_0x1a8c80){_0x1d56fa[_0x5d0b('0x25')]=_0x1a8c80;if(_0x3c3c76[_0x5d0b('0x48')][_0x5d0b('0xce')]){_0x3b9b48[_0x5d0b('0xc0')]=[{'all':!![]}];}return db[_0x5d0b('0xc6')][_0x5d0b('0xcf')](_0x3b9b48);})[_0x5d0b('0x2b')](function(_0x2d8045){_0x1d56fa['rows']=_0x2d8045;return _0x1d56fa;});}})[_0x5d0b('0x2b')](respondWithFilteredResult(_0x367004,_0x3b9b48))[_0x5d0b('0xbd')](handleError(_0x367004,null));};exports['addTags']=function(_0x428db1,_0x364460,_0x1145f7){return db['SmsInteraction']['find']({'where':{'id':_0x428db1[_0x5d0b('0xbf')]['id']}})[_0x5d0b('0x2b')](handleEntityNotFound(_0x364460,null))[_0x5d0b('0x2b')](function(_0x926efb){if(_0x926efb){return _0x926efb[_0x5d0b('0xd0')](_0x428db1['body'][_0x5d0b('0xc8')],_[_0x5d0b('0xc7')](_0x428db1[_0x5d0b('0xc3')],[_0x5d0b('0xc8'),'id'])||{})['spread'](function(){return db[_0x5d0b('0xd1')][_0x5d0b('0xcf')]({'attributes':['id',_0x5d0b('0x30'),_0x5d0b('0x51')],'where':{'id':_0x428db1[_0x5d0b('0xc3')]['ids']}});})[_0x5d0b('0x2b')](function(_0x16b988){socket['emit'](_0x5d0b('0xd2'),{'id':Number(_0x428db1['params']['id']),'tags':_0x16b988||[]});return{'id':Number(_0x428db1[_0x5d0b('0xbf')]['id']),'tags':_0x16b988||[]};});}})[_0x5d0b('0x2b')](respondWithResult(_0x364460,null))['catch'](handleError(_0x364460,null));};exports[_0x5d0b('0xd3')]=function(_0x3a5aee,_0xf6ec50,_0x391a87){return db[_0x5d0b('0x40')][_0x5d0b('0x68')]({'where':{'id':_0x3a5aee[_0x5d0b('0xbf')]['id']}})[_0x5d0b('0x2b')](handleEntityNotFound(_0xf6ec50,null))[_0x5d0b('0x2b')](function(_0x438b41){if(_0x438b41){return _0x438b41['removeTags'](_0x3a5aee[_0x5d0b('0x48')][_0x5d0b('0xc8')]);}})[_0x5d0b('0x2b')](respondWithStatusCode(_0xf6ec50,null))[_0x5d0b('0xbd')](handleError(_0xf6ec50,null));};exports[_0x5d0b('0xd4')]=function(_0x22b973,_0x5d47fa){var _0x300daf=moment()['unix']()['toString']();var _0x510513=path[_0x5d0b('0xd5')](config[_0x5d0b('0xd6')],'server',_0x5d0b('0xd7'),_0x5d0b('0xd8'));var _0x3259a4=path['join'](config[_0x5d0b('0xd6')],'server',_0x5d0b('0xd7'),_0x5d0b('0xd9'));var _0x11b9c6=path[_0x5d0b('0xd5')](_0x510513,_0x300daf);var _0x40d15a=util['format']('transcript-%d-%s.zip',_0x22b973[_0x5d0b('0xbf')]['id'],_0x300daf);var _0x2a9e37=path[_0x5d0b('0xd5')](_0x510513,_0x40d15a);var _0x34d427=[];_0x34d427['push']({'model':db[_0x5d0b('0x7a')],'as':'User','attributes':['id',_0x5d0b('0x34')],'raw':!![]});_0x34d427[_0x5d0b('0x38')]({'model':db['CmContact'],'as':_0x5d0b('0x6d'),'attributes':['id',_0x5d0b('0xda'),'lastName'],'raw':!![]});var _0x4f13c2=[{'model':db['SmsMessage'],'as':_0x5d0b('0xdb'),'attributes':['id',_0x5d0b('0xc3'),_0x5d0b('0x82'),'direction',_0x5d0b('0xdc'),'read'],'include':_0x34d427}];_0x4f13c2[_0x5d0b('0x38')]({'model':db[_0x5d0b('0xdd')],'as':_0x5d0b('0xde'),'attributes':['id',_0x5d0b('0x30')]});_0x4f13c2[_0x5d0b('0x38')]({'model':db[_0x5d0b('0x7a')],'as':_0x5d0b('0xdf'),'attributes':['id',_0x5d0b('0x34')]});return db[_0x5d0b('0x40')]['find']({'where':{'id':_0x22b973[_0x5d0b('0xbf')]['id']},'include':_0x4f13c2})[_0x5d0b('0x2b')](handleEntityNotFound(_0x5d47fa,null))[_0x5d0b('0x2b')](function(_0x478bdc){if(_0x478bdc){var _0x987307=_0x478bdc[_0x5d0b('0xe0')]({'plain':!![]});fs[_0x5d0b('0xe1')](_0x11b9c6);var _0x3b4a1e={'channel':_0x5d0b('0xe2'),'account':_0x987307['Account']['name'],'agent':_0x987307['Owner']?_0x987307['Owner'][_0x5d0b('0x34')]:'N.A.','createdAt':moment(_0x987307[_0x5d0b('0x82')])[_0x5d0b('0xcc')](_0x5d0b('0xcd'))[_0x5d0b('0x9f')](),'closedAt':_0x987307[_0x5d0b('0x3e')]?moment(_0x987307[_0x5d0b('0xe3')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5d0b('0x9f')]():'','disposition':_0x987307['disposition'],'messages':_(_0x987307['Messages'])[_0x5d0b('0x8e')]({'secret':![]})[_0x5d0b('0x33')](function(_0x45fcbf){return{'date':moment(_0x45fcbf[_0x5d0b('0x82')])[_0x5d0b('0xcc')](_0x5d0b('0xcd'))['toString'](),'sender':_0x45fcbf['direction']==='out'?_0x45fcbf[_0x5d0b('0x7a')]?_0x45fcbf[_0x5d0b('0x7a')]['fullname']:_0x5d0b('0xe4'):_0x45fcbf[_0x5d0b('0x6d')]['firstName']+(_0x45fcbf['Contact'][_0x5d0b('0xe5')]?'\x20'+_0x45fcbf[_0x5d0b('0x6d')][_0x5d0b('0xe5')]:''),'body':_0x45fcbf['body'],'direction':_0x45fcbf['direction']===_0x5d0b('0xe6')?'A':'C','secret':_0x45fcbf['secret'],'read':_0x45fcbf[_0x5d0b('0x8a')]};})[_0x5d0b('0x70')]()};return ejs[_0x5d0b('0xe7')](path[_0x5d0b('0xd5')](config[_0x5d0b('0xd6')],_0x5d0b('0xe8'),'views','downloadInteraction.ejs'),{'interaction':_0x3b4a1e})[_0x5d0b('0x2b')](function(_0x300a62){var _0x1b0571=path[_0x5d0b('0xd5')](_0x11b9c6,_0x5d0b('0xe9')+_0x987307['id']+'-'+_0x300daf+_0x5d0b('0xea'));var _0x582c36={'path':_0x1b0571,'channel':_0x5d0b('0xe2'),'interactionId':_0x987307['id']};return pdf[_0x5d0b('0xeb')](_0x300a62,_0x582c36);})['then'](function(){return new BPromise(function(_0x3e7884,_0x27cd2f){zipdir(_0x11b9c6,{'saveTo':_0x2a9e37},function(_0x56a9ef,_0x1b2fd2){if(_0x56a9ef)return _0x27cd2f(_0x56a9ef);return _0x3e7884(_0x1b2fd2);});})[_0x5d0b('0x2b')](function(){return new BPromise(function(_0x4e6c48,_0x9fb9f0){rimraf(_0x11b9c6,function(_0x25d8a5){if(_0x25d8a5)_0x9fb9f0(_0x25d8a5);return _0x4e6c48();});});})['then'](function(){return _0x5d47fa['download'](_0x2a9e37,_0x40d15a,function(_0x1653f1){if(_0x1653f1){console['log'](_0x5d0b('0xec'),_0x1653f1);}else{fs[_0x5d0b('0xed')](_0x2a9e37);}});});});}else{return _0x5d47fa[_0x5d0b('0x2d')](0xc8);}})[_0x5d0b('0xbd')](handleError(_0x5d47fa,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 44de4f8..b518395 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb11=['setMaxListeners','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','SmsInteraction','../../mysqldb'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb11[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1fb1('0x1')];var SmsMessage=require(_0x1fb1('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1fb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x190f74){return function(_0x2ae20f,_0x5af469,_0x25d44f){_0x2ae20f[_0x1fb1('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1859da){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0x7'),_0x1859da[_0x1fb1('0x8')](function(_0x161e1b){return{'id':_0x161e1b['id']};}));return SmsMessage[_0x1fb1('0x9')]({'where':{'SmsInteractionId':_0x2ae20f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1fb1('0xa')](function(_0x416625){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0xb'),_0x416625['length']);SmsInteractionEvents[_0x1fb1('0xc')](_0x190f74+':'+_0x2ae20f['id'],_0x2ae20f);SmsInteractionEvents['emit'](_0x190f74,_0x2ae20f);_0x25d44f(null);})[_0x1fb1('0xd')](_0x25d44f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x1fb1('0xe')](e,emitEvent(event));}}module[_0x1fb1('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x63a5=['hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x4d7aba,_0x34fa13){var _0x4eece7=function(_0x21a941){while(--_0x21a941){_0x4d7aba['push'](_0x4d7aba['shift']());}};_0x4eece7(++_0x34fa13);}(_0x63a5,0x18e));var _0x563a=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x63a5[_0x39e283];return _0x7de89f;};'use strict';var EventEmitter=require(_0x563a('0x0'));var SmsInteraction=require(_0x563a('0x1'))['db'][_0x563a('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x563a('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x563a('0x4'),'afterUpdate':_0x563a('0x5'),'afterDestroy':_0x563a('0x6')};function emitEvent(_0x37e617){return function(_0x5c2a8d,_0x4cc9e5,_0x1fdcb0){_0x5c2a8d['getUsers']({'attributes':['id'],'raw':!![]})[_0x563a('0x7')](function(_0x4f89b4){_0x5c2a8d['setDataValue']('Users',_0x4f89b4[_0x563a('0x8')](function(_0x32bf51){return{'id':_0x32bf51['id']};}));return SmsMessage[_0x563a('0x9')]({'where':{'SmsInteractionId':_0x5c2a8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x563a('0x7')](function(_0x255922){_0x5c2a8d[_0x563a('0xa')](_0x563a('0xb'),_0x255922[_0x563a('0xc')]);SmsInteractionEvents[_0x563a('0xd')](_0x37e617+':'+_0x5c2a8d['id'],_0x5c2a8d);SmsInteractionEvents[_0x563a('0xd')](_0x37e617,_0x5c2a8d);_0x1fdcb0(null);})[_0x563a('0xe')](_0x1fdcb0(null));};}for(var e in events){if(events[_0x563a('0xf')](e)){var event=events[e];SmsInteraction[_0x563a('0x10')](e,emitEvent(event));}}module[_0x563a('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index e366031..f300262 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x334e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','closed','closedAt','format','lodash','util'];(function(_0x41521e,_0x531716){var _0x5b3a48=function(_0xdf4b54){while(--_0xdf4b54){_0x41521e['push'](_0x41521e['shift']());}};_0x5b3a48(++_0x531716);}(_0x334e,0x18e));var _0xe334=function(_0x43b5b8,_0x36ece1){_0x43b5b8=_0x43b5b8-0x0;var _0x1726b2=_0x334e[_0x43b5b8];return _0x1726b2;};'use strict';var _=require(_0xe334('0x0'));var util=require(_0xe334('0x1'));var logger=require(_0xe334('0x2'))(_0xe334('0x3'));var moment=require(_0xe334('0x4'));var BPromise=require(_0xe334('0x5'));var rp=require(_0xe334('0x6'));var fs=require('fs');var path=require(_0xe334('0x7'));var rimraf=require('rimraf');var config=require(_0xe334('0x8'));var attributes=require(_0xe334('0x9'));module[_0xe334('0xa')]=function(_0x5ad25b,_0x14345a){return _0x5ad25b['define'](_0xe334('0xb'),attributes,{'tableName':_0xe334('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x396cc4,_0xc25777,_0x5d914b){if(_0x396cc4['changed'](_0xe334('0xd'))){_0x396cc4[_0xe334('0xe')]=moment()[_0xe334('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5d914b(null,_0x396cc4);}}});}; \ No newline at end of file +var _0x21fa=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2c9d30,_0xb7653e){var _0x2ca878=function(_0x2923ef){while(--_0x2923ef){_0x2c9d30['push'](_0x2c9d30['shift']());}};_0x2ca878(++_0xb7653e);}(_0x21fa,0x1bb));var _0xa21f=function(_0x39ad98,_0x33faae){_0x39ad98=_0x39ad98-0x0;var _0x2e1f5a=_0x21fa[_0x39ad98];return _0x2e1f5a;};'use strict';var _=require(_0xa21f('0x0'));var util=require(_0xa21f('0x1'));var logger=require(_0xa21f('0x2'))(_0xa21f('0x3'));var moment=require(_0xa21f('0x4'));var BPromise=require('bluebird');var rp=require(_0xa21f('0x5'));var fs=require('fs');var path=require(_0xa21f('0x6'));var rimraf=require(_0xa21f('0x7'));var config=require(_0xa21f('0x8'));var attributes=require(_0xa21f('0x9'));module[_0xa21f('0xa')]=function(_0xb5e195,_0x31bff5){return _0xb5e195[_0xa21f('0xb')](_0xa21f('0xc'),attributes,{'tableName':_0xa21f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x308e92,_0x3b6e49,_0x1ebb69){if(_0x308e92[_0xa21f('0xe')](_0xa21f('0xf'))){_0x308e92[_0xa21f('0x10')]=moment()['format'](_0xa21f('0x11'));}_0x1ebb69(null,_0x308e92);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c849975..50621f3 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff12=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','info','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','debug','stringify','AddTagsToSmsInteraction','find','addTags','ids','AddTags','lodash','util','moment'];(function(_0x2afaf3,_0x4ebf7a){var _0xf45003=function(_0x1db360){while(--_0x1db360){_0x2afaf3['push'](_0x2afaf3['shift']());}};_0xf45003(++_0x4ebf7a);}(_0xff12,0x11c));var _0x2ff1=function(_0x4d143f,_0x33d7e4){_0x4d143f=_0x4d143f-0x0;var _0x169109=_0xff12[_0x4d143f];return _0x169109;};'use strict';var _=require(_0x2ff1('0x0'));var util=require(_0x2ff1('0x1'));var moment=require(_0x2ff1('0x2'));var BPromise=require(_0x2ff1('0x3'));var rs=require(_0x2ff1('0x4'));var fs=require('fs');var Redis=require(_0x2ff1('0x5'));var db=require(_0x2ff1('0x6'))['db'];var utils=require(_0x2ff1('0x7'));var logger=require(_0x2ff1('0x8'))(_0x2ff1('0x9'));var config=require(_0x2ff1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2ff1('0xb')][_0x2ff1('0xc')]({'port':0x232a});config[_0x2ff1('0xd')]=_[_0x2ff1('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2ff1('0xf'))(new Redis(config[_0x2ff1('0xd')]));require('./smsInteraction.socket')[_0x2ff1('0x10')](socket);function respondWithRpcPromise(_0x41f83d,_0xe154ff,_0x4215f3){return new BPromise(function(_0x55e1fe,_0x45aed1){return client[_0x2ff1('0x11')](_0x41f83d,_0x4215f3)[_0x2ff1('0x12')](function(_0x41d95f){logger['info'](_0x2ff1('0x13'),_0xe154ff,_0x2ff1('0x14'));logger['debug'](_0x2ff1('0x15'),_0xe154ff,'request\x20sent',JSON['stringify'](_0x41d95f));if(_0x41d95f[_0x2ff1('0x16')]){if(_0x41d95f['error']['code']===0x1f4){logger['error'](_0x2ff1('0x13'),_0xe154ff,_0x41d95f[_0x2ff1('0x16')]['message']);return _0x45aed1(_0x41d95f[_0x2ff1('0x16')][_0x2ff1('0x17')]);}logger[_0x2ff1('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xe154ff,_0x41d95f[_0x2ff1('0x16')]['message']);return _0x55e1fe(_0x41d95f[_0x2ff1('0x16')]['message']);}else{logger[_0x2ff1('0x18')](_0x2ff1('0x13'),_0xe154ff,_0x2ff1('0x14'));_0x55e1fe(_0x41d95f['result'][_0x2ff1('0x17')]);}})[_0x2ff1('0x19')](function(_0x3b62c5){logger['error'](_0x2ff1('0x13'),_0xe154ff,_0x3b62c5);_0x45aed1(_0x3b62c5);});});}exports[_0x2ff1('0x1a')]=function(_0x59c219){var _0x5de4b4=this;return new Promise(function(_0x5f5cb5,_0x81d996){return db[_0x2ff1('0x1b')]['update'](_0x59c219[_0x2ff1('0x1c')],{'raw':_0x59c219[_0x2ff1('0x1d')]?_0x59c219[_0x2ff1('0x1d')][_0x2ff1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c219[_0x2ff1('0x1d')]?_0x59c219['options'][_0x2ff1('0x1f')]||null:null,'attributes':_0x59c219['options']?_0x59c219[_0x2ff1('0x1d')][_0x2ff1('0x20')]||null:null,'limit':_0x59c219['options']?_0x59c219[_0x2ff1('0x1d')][_0x2ff1('0x21')]||null:null})[_0x2ff1('0x12')](function(_0x5e741b){logger['info'](_0x2ff1('0x1a'),_0x59c219);logger[_0x2ff1('0x22')](_0x2ff1('0x1a'),_0x59c219,JSON[_0x2ff1('0x23')](_0x5e741b));_0x5f5cb5(_0x5e741b);})[_0x2ff1('0x19')](function(_0x32f202){logger[_0x2ff1('0x16')]('UpdateSmsInteraction',_0x32f202[_0x2ff1('0x17')],_0x59c219);_0x81d996(_0x5de4b4[_0x2ff1('0x16')](0x1f4,_0x32f202[_0x2ff1('0x17')]));});});};exports[_0x2ff1('0x24')]=function(_0xd8865c){return new Promise(function(_0x1ce2e6,_0xa6ed84){return db['SmsInteraction'][_0x2ff1('0x25')]({'where':_0xd8865c['options']?_0xd8865c[_0x2ff1('0x1d')][_0x2ff1('0x1f')]||null:null})[_0x2ff1('0x12')](function(_0xb74c8){if(_0xb74c8){return _0xb74c8[_0x2ff1('0x26')](_0xd8865c[_0x2ff1('0x1c')][_0x2ff1('0x27')],_['omit'](_0xd8865c['body'],[_0x2ff1('0x27'),'id'])||{});}})['spread'](function(_0x2b9bd6){logger[_0x2ff1('0x18')]('AddTags',_0xd8865c);logger[_0x2ff1('0x22')](_0x2ff1('0x28'),_0xd8865c,JSON[_0x2ff1('0x23')](_0x2b9bd6));_0x1ce2e6(_0x2b9bd6);})[_0x2ff1('0x19')](function(_0x3c7f48){logger[_0x2ff1('0x16')](_0x2ff1('0x28'),_0x3c7f48[_0x2ff1('0x17')],_0xd8865c);_0xa6ed84(_this[_0x2ff1('0x16')](0x1f4,_0x3c7f48[_0x2ff1('0x17')]));});});}; \ No newline at end of file +var _0x7b54=['socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','body','options','where','attributes','UpdateSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b54,0x19e));var _0x47b5=function(_0x3ed1c1,_0x45fe0a){_0x3ed1c1=_0x3ed1c1-0x0;var _0x11797d=_0x7b54[_0x3ed1c1];return _0x11797d;};'use strict';var _=require(_0x47b5('0x0'));var util=require(_0x47b5('0x1'));var moment=require(_0x47b5('0x2'));var BPromise=require(_0x47b5('0x3'));var rs=require(_0x47b5('0x4'));var fs=require('fs');var Redis=require(_0x47b5('0x5'));var db=require(_0x47b5('0x6'))['db'];var utils=require(_0x47b5('0x7'));var logger=require(_0x47b5('0x8'))(_0x47b5('0x9'));var config=require(_0x47b5('0xa'));var jayson=require(_0x47b5('0xb'));var client=jayson[_0x47b5('0xc')][_0x47b5('0xd')]({'port':0x232a});config['redis']=_[_0x47b5('0xe')](config[_0x47b5('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x47b5('0x10'))(new Redis(config[_0x47b5('0xf')]));require('./smsInteraction.socket')[_0x47b5('0x11')](socket);function respondWithRpcPromise(_0x2d46de,_0x5e88df,_0x1329b0){return new BPromise(function(_0x2cb328,_0x45fb10){return client[_0x47b5('0x12')](_0x2d46de,_0x1329b0)[_0x47b5('0x13')](function(_0x41f021){logger[_0x47b5('0x14')](_0x47b5('0x15'),_0x5e88df,_0x47b5('0x16'));logger[_0x47b5('0x17')](_0x47b5('0x18'),_0x5e88df,'request\x20sent',JSON[_0x47b5('0x19')](_0x41f021));if(_0x41f021[_0x47b5('0x1a')]){if(_0x41f021['error'][_0x47b5('0x1b')]===0x1f4){logger[_0x47b5('0x1a')](_0x47b5('0x15'),_0x5e88df,_0x41f021[_0x47b5('0x1a')][_0x47b5('0x1c')]);return _0x45fb10(_0x41f021['error'][_0x47b5('0x1c')]);}logger[_0x47b5('0x1a')](_0x47b5('0x15'),_0x5e88df,_0x41f021[_0x47b5('0x1a')][_0x47b5('0x1c')]);return _0x2cb328(_0x41f021[_0x47b5('0x1a')]['message']);}else{logger['info'](_0x47b5('0x15'),_0x5e88df,_0x47b5('0x16'));_0x2cb328(_0x41f021[_0x47b5('0x1d')][_0x47b5('0x1c')]);}})[_0x47b5('0x1e')](function(_0x12177f){logger[_0x47b5('0x1a')]('SmsInteraction,\x20%s,\x20%s',_0x5e88df,_0x12177f);_0x45fb10(_0x12177f);});});}exports['UpdateSmsInteraction']=function(_0x1fadfa){var _0x4c3e27=this;return new Promise(function(_0x388071,_0x5bc09f){return db[_0x47b5('0x1f')][_0x47b5('0x20')](_0x1fadfa[_0x47b5('0x21')],{'raw':_0x1fadfa['options']?_0x1fadfa[_0x47b5('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fadfa[_0x47b5('0x22')]?_0x1fadfa[_0x47b5('0x22')][_0x47b5('0x23')]||null:null,'attributes':_0x1fadfa['options']?_0x1fadfa[_0x47b5('0x22')][_0x47b5('0x24')]||null:null,'limit':_0x1fadfa[_0x47b5('0x22')]?_0x1fadfa[_0x47b5('0x22')]['limit']||null:null})[_0x47b5('0x13')](function(_0x1b80ca){logger[_0x47b5('0x14')](_0x47b5('0x25'),_0x1fadfa);logger[_0x47b5('0x17')](_0x47b5('0x25'),_0x1fadfa,JSON[_0x47b5('0x19')](_0x1b80ca));_0x388071(_0x1b80ca);})['catch'](function(_0x1af25e){logger[_0x47b5('0x1a')](_0x47b5('0x25'),_0x1af25e[_0x47b5('0x1c')],_0x1fadfa);_0x5bc09f(_0x4c3e27[_0x47b5('0x1a')](0x1f4,_0x1af25e['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x213d0f){return new Promise(function(_0x23577c,_0xa70f49){return db['SmsInteraction'][_0x47b5('0x26')]({'where':_0x213d0f[_0x47b5('0x22')]?_0x213d0f[_0x47b5('0x22')][_0x47b5('0x23')]||null:null})[_0x47b5('0x13')](function(_0x48ebec){if(_0x48ebec){return _0x48ebec[_0x47b5('0x27')](_0x213d0f[_0x47b5('0x21')][_0x47b5('0x28')],_['omit'](_0x213d0f[_0x47b5('0x21')],['ids','id'])||{});}})[_0x47b5('0x29')](function(_0x38bf8e){logger[_0x47b5('0x14')](_0x47b5('0x2a'),_0x213d0f);logger['debug'](_0x47b5('0x2a'),_0x213d0f,JSON[_0x47b5('0x19')](_0x38bf8e));_0x23577c(_0x38bf8e);})[_0x47b5('0x1e')](function(_0x309dab){logger[_0x47b5('0x1a')]('AddTags',_0x309dab[_0x47b5('0x1c')],_0x213d0f);_0xa70f49(_this[_0x47b5('0x1a')](0x1f4,_0x309dab[_0x47b5('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2007856..e0c2673 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06fb=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','length'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x06fb,0x16d));var _0xb06f=function(_0x2bc1b5,_0x4198af){_0x2bc1b5=_0x2bc1b5-0x0;var _0x313646=_0x06fb[_0x2bc1b5];return _0x313646;};'use strict';var SmsInteractionEvents=require(_0xb06f('0x0'));var events=[_0xb06f('0x1'),_0xb06f('0x2'),_0xb06f('0x3')];function createListener(_0xfb8ddf,_0x3c77ee){return function(_0x289628){_0x3c77ee[_0xb06f('0x4')](_0xfb8ddf,_0x289628);};}function removeListener(_0x4405b3,_0x49e198){return function(){SmsInteractionEvents['removeListener'](_0x4405b3,_0x49e198);};}exports['register']=function(_0x204903){for(var _0x43bffb=0x0,_0x1a7977=events[_0xb06f('0x5')];_0x43bffb<_0x1a7977;_0x43bffb++){var _0x18f985=events[_0x43bffb];var _0x11c0a4=createListener(_0xb06f('0x6')+_0x18f985,_0x204903);SmsInteractionEvents['on'](_0x18f985,_0x11c0a4);}}; \ No newline at end of file +var _0x28ca=['emit','removeListener','register','length','smsInteraction:','save','remove'];(function(_0x16f71a,_0x58ae65){var _0x27d2f5=function(_0x19105c){while(--_0x19105c){_0x16f71a['push'](_0x16f71a['shift']());}};_0x27d2f5(++_0x58ae65);}(_0x28ca,0x194));var _0xa28c=function(_0x3684ce,_0x4fb281){_0x3684ce=_0x3684ce-0x0;var _0x646469=_0x28ca[_0x3684ce];return _0x646469;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa28c('0x0'),_0xa28c('0x1'),'update'];function createListener(_0xc33ef4,_0x505367){return function(_0x10a6ee){_0x505367[_0xa28c('0x2')](_0xc33ef4,_0x10a6ee);};}function removeListener(_0x505642,_0x5d62c7){return function(){SmsInteractionEvents[_0xa28c('0x3')](_0x505642,_0x5d62c7);};}exports[_0xa28c('0x4')]=function(_0x3f92e9){for(var _0x151cc8=0x0,_0x4e5a74=events[_0xa28c('0x5')];_0x151cc8<_0x4e5a74;_0x151cc8++){var _0x166f12=events[_0x151cc8];var _0x3893e9=createListener(_0xa28c('0x6')+_0x166f12,_0x3f92e9);SmsInteractionEvents['on'](_0x166f12,_0x3893e9);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8f70a44..416c65c 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b63=['status','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get','/:id','show','tracked','sms','smsmessage:create','post'];(function(_0x37f788,_0x1dd5fd){var _0x194896=function(_0x27aafd){while(--_0x27aafd){_0x37f788['push'](_0x37f788['shift']());}};_0x194896(++_0x1dd5fd);}(_0x2b63,0x1d4));var _0x32b6=function(_0x5cd43f,_0x1b6c16){_0x5cd43f=_0x5cd43f-0x0;var _0x6209b5=_0x2b63[_0x5cd43f];return _0x6209b5;};'use strict';var multer=require(_0x32b6('0x0'));var util=require(_0x32b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x32b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x32b6('0x3'));var interaction=require(_0x32b6('0x4'));var config=require('../../config/environment');var controller=require(_0x32b6('0x5'));router['get']('/',auth[_0x32b6('0x6')](),controller[_0x32b6('0x7')]);router[_0x32b6('0x8')]('/describe',auth[_0x32b6('0x6')](),controller['describe']);router[_0x32b6('0x8')](_0x32b6('0x9'),auth['isAuthenticated'](),controller[_0x32b6('0xa')]);router['post']('/',auth[_0x32b6('0x6')](),interaction[_0x32b6('0xb')](_0x32b6('0xc'),_0x32b6('0xd')),controller['create']);router[_0x32b6('0xe')]('/:id/status',controller[_0x32b6('0xf')]);router['put'](_0x32b6('0x9'),auth[_0x32b6('0x6')](),controller['update']);router[_0x32b6('0x10')](_0x32b6('0x11'),auth[_0x32b6('0x6')](),controller['accept']);router[_0x32b6('0x10')](_0x32b6('0x12'),auth[_0x32b6('0x6')](),controller[_0x32b6('0x13')]);router[_0x32b6('0x14')](_0x32b6('0x9'),auth[_0x32b6('0x6')](),controller[_0x32b6('0x15')]);module[_0x32b6('0x16')]=router; \ No newline at end of file +var _0xd615=['show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x47890b,_0x5801b7){var _0x4ab671=function(_0x3435b1){while(--_0x3435b1){_0x47890b['push'](_0x47890b['shift']());}};_0x4ab671(++_0x5801b7);}(_0xd615,0x132));var _0x5d61=function(_0x37a002,_0x4a2b71){_0x37a002=_0x37a002-0x0;var _0x13b2db=_0xd615[_0x37a002];return _0x13b2db;};'use strict';var multer=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var path=require(_0x5d61('0x2'));var timeout=require(_0x5d61('0x3'));var express=require(_0x5d61('0x4'));var router=express[_0x5d61('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5d61('0x6'));var controller=require(_0x5d61('0x7'));router['get']('/',auth[_0x5d61('0x8')](),controller[_0x5d61('0x9')]);router[_0x5d61('0xa')]('/describe',auth[_0x5d61('0x8')](),controller[_0x5d61('0xb')]);router[_0x5d61('0xa')](_0x5d61('0xc'),auth[_0x5d61('0x8')](),controller[_0x5d61('0xd')]);router[_0x5d61('0xe')]('/',auth[_0x5d61('0x8')](),interaction[_0x5d61('0xf')](_0x5d61('0x10'),_0x5d61('0x11')),controller[_0x5d61('0x12')]);router['post'](_0x5d61('0x13'),controller[_0x5d61('0x14')]);router[_0x5d61('0x15')](_0x5d61('0xc'),auth['isAuthenticated'](),controller[_0x5d61('0x16')]);router['put'](_0x5d61('0x17'),auth[_0x5d61('0x8')](),controller['accept']);router[_0x5d61('0x15')](_0x5d61('0x18'),auth[_0x5d61('0x8')](),controller[_0x5d61('0x19')]);router[_0x5d61('0x1a')](_0x5d61('0xc'),auth['isAuthenticated'](),controller[_0x5d61('0x1b')]);module[_0x5d61('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 65d2c6f..5c82896 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x569d=['TEXT','medium','out','STRING','BOOLEAN','sequelize','exports'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x569d,0x12b));var _0xd569=function(_0x4fa1b0,_0x3cafac){_0x4fa1b0=_0x4fa1b0-0x0;var _0x3c2e33=_0x569d[_0x4fa1b0];return _0x3c2e33;};'use strict';var Sequelize=require(_0xd569('0x0'));module[_0xd569('0x1')]={'body':{'type':Sequelize[_0xd569('0x2')](_0xd569('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd569('0x4')),'defaultValue':_0xd569('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd569('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xd569('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd569('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe288=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xe288,0x104));var _0x8e28=function(_0x50a9af,_0x24df09){_0x50a9af=_0x50a9af-0x0;var _0x3478f9=_0xe288[_0x50a9af];return _0x3478f9;};'use strict';var Sequelize=require(_0x8e28('0x0'));module[_0x8e28('0x1')]={'body':{'type':Sequelize[_0x8e28('0x2')](_0x8e28('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8e28('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e28('0x5')]('in',_0x8e28('0x6')),'defaultValue':_0x8e28('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8e28('0x7')](0xbe)},'phone':{'type':Sequelize[_0x8e28('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x8e28('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8e28('0x7')]},'providerResponse':{'type':Sequelize[_0x8e28('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index f19fa14..376736d 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x605b=['result','sendStatus','end','status','offset','limit','count','set','json','apply','reject','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','find','catch','create','body','describe','sms-interactions','accept','sms','readAt','format','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','ContactId','Sequelize','User','email','manual','interface','channel','motionChannel','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','QueryTypes','SELECT','contact','SIP/%s','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','plivio','inspect','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s'];(function(_0x18983f,_0xfb6bf3){var _0x2c3777=function(_0x59ff0f){while(--_0x59ff0f){_0x18983f['push'](_0x18983f['shift']());}};_0x2c3777(++_0xfb6bf3);}(_0x605b,0xf4));var _0xb605=function(_0x4981cf,_0x319629){_0x4981cf=_0x4981cf-0x0;var _0x2728fa=_0x605b[_0x4981cf];return _0x2728fa;};'use strict';var emlformat=require(_0xb605('0x0'));var rimraf=require(_0xb605('0x1'));var zipdir=require(_0xb605('0x2'));var jsonpatch=require(_0xb605('0x3'));var rp=require('request-promise');var moment=require(_0xb605('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb605('0x5'));var path=require('path');var sox=require(_0xb605('0x6'));var csv=require(_0xb605('0x7'));var ejs=require(_0xb605('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb605('0x9'));var squel=require(_0xb605('0xa'));var crypto=require(_0xb605('0xb'));var jsforce=require(_0xb605('0xc'));var deskjs=require(_0xb605('0xd'));var toCsv=require(_0xb605('0x7'));var querystring=require(_0xb605('0xe'));var Papa=require(_0xb605('0xf'));var Redis=require(_0xb605('0x10'));var authService=require(_0xb605('0x11'));var qs=require(_0xb605('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb605('0x13'));var logger=require(_0xb605('0x14'))('api');var utils=require(_0xb605('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb605('0x16'));var db=require(_0xb605('0x17'))['db'];config[_0xb605('0x18')]=_[_0xb605('0x19')](config['redis'],{'host':_0xb605('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb605('0x18')]));require(_0xb605('0x1b'))[_0xb605('0x1c')](socket);var jayson=require(_0xb605('0x1d'));var client=jayson[_0xb605('0x1e')][_0xb605('0x1f')]({'port':0x232c});var client9002=jayson[_0xb605('0x1e')][_0xb605('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2e177b,_0x341612,_0xeff9e3,_0xa96b1d){return new BPromise(function(_0x4bc3c2,_0x2509ba){var _0x3cab37=_0xa96b1d||client;return _0x3cab37[_0xb605('0x20')](_0x2e177b,_0xeff9e3)[_0xb605('0x21')](function(_0x251829){logger[_0xb605('0x22')]('SmsMessage,\x20%s,\x20%s',_0x341612,_0xb605('0x23'));logger[_0xb605('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x341612,_0xb605('0x23'),JSON[_0xb605('0x25')](_0x251829));if(_0x251829[_0xb605('0x26')]){if(_0x251829[_0xb605('0x26')][_0xb605('0x27')]===0x1f4){logger[_0xb605('0x26')]('SmsMessage,\x20%s,\x20%s',_0x341612,_0x251829[_0xb605('0x26')][_0xb605('0x28')]);return _0x2509ba(_0x251829[_0xb605('0x26')]['message']);}logger[_0xb605('0x26')](_0xb605('0x29'),_0x341612,_0x251829[_0xb605('0x26')][_0xb605('0x28')]);return _0x4bc3c2(_0x251829[_0xb605('0x26')][_0xb605('0x28')]);}else{logger[_0xb605('0x22')](_0xb605('0x29'),_0x341612,'request\x20sent');_0x4bc3c2(_0x251829[_0xb605('0x2a')][_0xb605('0x28')]);}})['catch'](function(_0x3391e2){logger[_0xb605('0x26')](_0xb605('0x29'),_0x341612,_0x3391e2);_0x2509ba(_0x3391e2);});});}function respondWithStatusCode(_0xf68c1b,_0x4caeee){_0x4caeee=_0x4caeee||0xcc;return function(_0x19f141){if(_0x19f141){return _0xf68c1b[_0xb605('0x2b')](_0x4caeee);}return _0xf68c1b['status'](_0x4caeee)[_0xb605('0x2c')]();};}function respondWithResult(_0x2f458f,_0x36256b){_0x36256b=_0x36256b||0xc8;return function(_0x3d709a){if(_0x3d709a){return _0x2f458f[_0xb605('0x2d')](_0x36256b)['json'](_0x3d709a);}};}function respondWithFilteredResult(_0x269e28,_0x4f2936){return function(_0x1123d6){if(_0x1123d6){var _0x54ac84=typeof _0x4f2936[_0xb605('0x2e')]==='undefined'&&typeof _0x4f2936[_0xb605('0x2f')]==='undefined';var _0x112ee7=_0x1123d6[_0xb605('0x30')];var _0x2f5f12=_0x54ac84?0x0:_0x4f2936['offset'];var _0x4fe36f=_0x54ac84?_0x1123d6[_0xb605('0x30')]:_0x4f2936['offset']+_0x4f2936['limit'];var _0x2e71d9;if(_0x4fe36f>=_0x112ee7){_0x4fe36f=_0x112ee7;_0x2e71d9=0xc8;}else{_0x2e71d9=0xce;}_0x269e28['status'](_0x2e71d9);return _0x269e28[_0xb605('0x31')]('Content-Range',_0x2f5f12+'-'+_0x4fe36f+'/'+_0x112ee7)[_0xb605('0x32')](_0x1123d6);}return null;};}function patchUpdates(_0x381b02){return function(_0x458eb4){try{jsonpatch[_0xb605('0x33')](_0x458eb4,_0x381b02,!![]);}catch(_0x9eb9f5){return BPromise[_0xb605('0x34')](_0x9eb9f5);}return _0x458eb4['save']();};}function saveUpdates(_0x192ffa,_0x151ca8){return function(_0x332eaf){if(_0x332eaf){return _0x332eaf[_0xb605('0x35')](_0x192ffa)['then'](function(_0x71b907){return _0x71b907;});}return null;};}function removeEntity(_0x25eb42,_0x55018e){return function(_0x44811d){if(_0x44811d){return _0x44811d[_0xb605('0x36')]()[_0xb605('0x21')](function(){_0x25eb42[_0xb605('0x2d')](0xcc)[_0xb605('0x2c')]();});}};}function handleEntityNotFound(_0x4e125e,_0x993f15){return function(_0x1e2836){if(!_0x1e2836){_0x4e125e[_0xb605('0x2b')](0x194);}return _0x1e2836;};}function handleError(_0x2b8aa7,_0x39d871){_0x39d871=_0x39d871||0x1f4;return function(_0x539e20){logger[_0xb605('0x26')](_0x539e20[_0xb605('0x37')]);if(_0x539e20[_0xb605('0x38')]){delete _0x539e20[_0xb605('0x38')];}_0x2b8aa7[_0xb605('0x2d')](_0x39d871)[_0xb605('0x39')](_0x539e20);};}exports[_0xb605('0x3a')]=function(_0x408937,_0x2bb7a5){var _0x3dbfa2={},_0x2a0172={},_0x5149df={'count':0x0,'rows':[]};var _0x45afc7=_[_0xb605('0x3b')](db[_0xb605('0x3c')][_0xb605('0x3d')],function(_0x149039){return{'name':_0x149039[_0xb605('0x3e')],'type':_0x149039[_0xb605('0x3f')][_0xb605('0x40')]};});_0x2a0172[_0xb605('0x41')]=_[_0xb605('0x3b')](_0x45afc7,_0xb605('0x38'));_0x2a0172[_0xb605('0x42')]=_[_0xb605('0x43')](_0x408937['query']);_0x2a0172[_0xb605('0x44')]=_[_0xb605('0x45')](_0x2a0172[_0xb605('0x41')],_0x2a0172[_0xb605('0x42')]);_0x3dbfa2[_0xb605('0x46')]=_['intersection'](_0x2a0172[_0xb605('0x41')],qs[_0xb605('0x47')](_0x408937['query'][_0xb605('0x47')]));_0x3dbfa2[_0xb605('0x46')]=_0x3dbfa2[_0xb605('0x46')][_0xb605('0x48')]?_0x3dbfa2['attributes']:_0x2a0172[_0xb605('0x41')];if(!_0x408937[_0xb605('0x42')]['hasOwnProperty']('nolimit')){_0x3dbfa2[_0xb605('0x2f')]=qs[_0xb605('0x2f')](_0x408937[_0xb605('0x42')]['limit']);_0x3dbfa2[_0xb605('0x2e')]=qs[_0xb605('0x2e')](_0x408937[_0xb605('0x42')]['offset']);}_0x3dbfa2[_0xb605('0x49')]=qs[_0xb605('0x4a')](_0x408937[_0xb605('0x42')][_0xb605('0x4a')]);_0x3dbfa2[_0xb605('0x4b')]=qs[_0xb605('0x44')](_[_0xb605('0x4c')](_0x408937[_0xb605('0x42')],_0x2a0172[_0xb605('0x44')]),_0x45afc7);if(_0x408937['query'][_0xb605('0x4d')]){_0x3dbfa2['where']=_[_0xb605('0x4e')](_0x3dbfa2['where'],{'$or':_[_0xb605('0x3b')](_0x45afc7,function(_0x404791){if(_0x404791[_0xb605('0x3f')]!==_0xb605('0x4f')){var _0x59a093={};_0x59a093[_0x404791[_0xb605('0x38')]]={'$like':'%'+_0x408937[_0xb605('0x42')][_0xb605('0x4d')]+'%'};return _0x59a093;}})});}_0x3dbfa2=_[_0xb605('0x4e')]({},_0x3dbfa2,_0x408937['options']);var _0xf5c4b5={'where':_0x3dbfa2[_0xb605('0x4b')]};return db[_0xb605('0x3c')][_0xb605('0x30')](_0xf5c4b5)[_0xb605('0x21')](function(_0x18adfe){_0x5149df[_0xb605('0x30')]=_0x18adfe;if(_0x408937[_0xb605('0x42')][_0xb605('0x50')]){_0x3dbfa2['include']=[{'all':!![]}];}return db['SmsMessage'][_0xb605('0x51')](_0x3dbfa2);})['then'](function(_0x179904){_0x5149df[_0xb605('0x52')]=_0x179904;return _0x5149df;})[_0xb605('0x21')](respondWithFilteredResult(_0x2bb7a5,_0x3dbfa2))['catch'](handleError(_0x2bb7a5,null));};exports[_0xb605('0x53')]=function(_0x6cc0dc,_0x32f3){var _0x58890c={'raw':!![],'where':{'id':_0x6cc0dc[_0xb605('0x54')]['id']}},_0x23f204={};_0x23f204[_0xb605('0x41')]=_[_0xb605('0x43')](db[_0xb605('0x3c')][_0xb605('0x3d')]);_0x23f204['query']=_[_0xb605('0x43')](_0x6cc0dc[_0xb605('0x42')]);_0x23f204[_0xb605('0x44')]=_[_0xb605('0x45')](_0x23f204['model'],_0x23f204['query']);_0x58890c[_0xb605('0x46')]=_[_0xb605('0x45')](_0x23f204[_0xb605('0x41')],qs[_0xb605('0x47')](_0x6cc0dc['query'][_0xb605('0x47')]));_0x58890c[_0xb605('0x46')]=_0x58890c[_0xb605('0x46')][_0xb605('0x48')]?_0x58890c['attributes']:_0x23f204['model'];if(_0x6cc0dc[_0xb605('0x42')][_0xb605('0x50')]){_0x58890c['include']=[{'all':!![]}];}_0x58890c=_[_0xb605('0x4e')]({},_0x58890c,_0x6cc0dc[_0xb605('0x55')]);return db[_0xb605('0x3c')][_0xb605('0x56')](_0x58890c)[_0xb605('0x21')](handleEntityNotFound(_0x32f3,null))[_0xb605('0x21')](respondWithResult(_0x32f3,null))[_0xb605('0x57')](handleError(_0x32f3,null));};exports[_0xb605('0x58')]=function(_0x53d506,_0x1124ba){return db[_0xb605('0x3c')][_0xb605('0x58')](_0x53d506[_0xb605('0x59')],{})[_0xb605('0x21')](respondWithResult(_0x1124ba,0xc9))[_0xb605('0x57')](handleError(_0x1124ba,null));};exports[_0xb605('0x35')]=function(_0x56f3dd,_0x102dd7){if(_0x56f3dd['body']['id']){delete _0x56f3dd[_0xb605('0x59')]['id'];}return db['SmsMessage'][_0xb605('0x56')]({'where':{'id':_0x56f3dd[_0xb605('0x54')]['id']}})[_0xb605('0x21')](handleEntityNotFound(_0x102dd7,null))[_0xb605('0x21')](saveUpdates(_0x56f3dd[_0xb605('0x59')],null))[_0xb605('0x21')](respondWithResult(_0x102dd7,null))[_0xb605('0x57')](handleError(_0x102dd7,null));};exports[_0xb605('0x36')]=function(_0x5521d3,_0x541cac){return db[_0xb605('0x3c')][_0xb605('0x56')]({'where':{'id':_0x5521d3[_0xb605('0x54')]['id']}})[_0xb605('0x21')](handleEntityNotFound(_0x541cac,null))[_0xb605('0x21')](removeEntity(_0x541cac,null))['catch'](handleError(_0x541cac,null));};exports['describe']=function(_0x3d031b,_0x44f236){return db[_0xb605('0x3c')][_0xb605('0x5a')]()['then'](respondWithResult(_0x44f236,null))[_0xb605('0x57')](handleError(_0x44f236,null));};var interaction_log=require(_0xb605('0x14'))(_0xb605('0x5b'));exports[_0xb605('0x5c')]=function(_0x525f2b,_0x276f62,_0x29c981){var _0x46ab4f={'agent':{},'channel':_0xb605('0x5d')};if(_0x525f2b[_0xb605('0x59')]['id']){delete _0x525f2b[_0xb605('0x59')]['id'];}_0x525f2b[_0xb605('0x59')]['read']=!![];_0x525f2b['body'][_0xb605('0x5e')]=moment()[_0xb605('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x525f2b[_0xb605('0x59')][_0xb605('0x60')]=_0x525f2b[_0xb605('0x59')]['UserId']||_0x525f2b[_0xb605('0x61')]['id'];_0x46ab4f[_0xb605('0x62')]['id']=_0x525f2b[_0xb605('0x59')][_0xb605('0x60')];return db['SmsMessage'][_0xb605('0x56')]({'where':{'id':_0x525f2b[_0xb605('0x54')]['id'],'UserId':null}})[_0xb605('0x21')](handleEntityNotFound(_0x276f62,null))[_0xb605('0x21')](saveUpdates(_0x525f2b[_0xb605('0x59')],null))[_0xb605('0x21')](function(_0x5c9ba8){if(_0x5c9ba8){_0x46ab4f[_0xb605('0x28')]=_0x5c9ba8[_0xb605('0x63')]({'plain':!![]});return db['SmsInteraction'][_0xb605('0x56')]({'where':{'id':_0x5c9ba8[_0xb605('0x64')]}});}return null;})[_0xb605('0x21')](handleEntityNotFound(_0x276f62,null))['then'](function(_0x15477e){if(_0x15477e){return _0x15477e['update']({'UserId':_0x525f2b[_0xb605('0x59')][_0xb605('0x60')],'read1stAt':_[_0xb605('0x65')](_0x15477e[_0xb605('0x66')])?moment()['format'](_0xb605('0x67')):undefined});}return null;})[_0xb605('0x21')](function(_0x1b28bd){if(_0x1b28bd){_0x46ab4f[_0xb605('0x68')]=_0x1b28bd[_0xb605('0x63')]({'plain':!![]});interaction_log[_0xb605('0x22')](_0xb605('0x69'),_0x525f2b[_0xb605('0x61')]['id'],_0x525f2b['user'][_0xb605('0x38')],_0x525f2b[_0xb605('0x61')]['role'],_0x46ab4f[_0xb605('0x68')]['id'],_0x525f2b[_0xb605('0x59')]?JSON['stringify'](_0x525f2b[_0xb605('0x59')]):'null');return respondWithRpcPromise(_0xb605('0x6a'),'acceptMessage',_0x46ab4f);}return null;})[_0xb605('0x21')](function(_0x490f92){var _0x629de5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x490f92[_0xb605('0x28')][_0xb605('0x6b')];return db['sequelize']['query'](_0x629de5,{'type':db[_0xb605('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb605('0x21')](function(_0x3e8032){return _0x3e8032;});})[_0xb605('0x21')](function(_0x4856a8){if(_0x4856a8){_0x46ab4f['message']['contact']=_0x4856a8[0x0];if(!_0x525f2b[_0xb605('0x59')][_0xb605('0x60')])return;return db[_0xb605('0x6d')][_0xb605('0x56')]({'where':{'id':_0x525f2b['body'][_0xb605('0x60')],'role':_0xb605('0x62')},'attributes':['id',_0xb605('0x38'),'fullname',_0xb605('0x6e'),'internal'],'raw':!![]});}return null;})[_0xb605('0x21')](function(_0x21ae93){if(!_0x21ae93)return null;_0x46ab4f['message'][_0xb605('0x62')]=_0x21ae93;return _0x46ab4f;})[_0xb605('0x21')](function(_0x1e5b5a){if(_0x1e5b5a){if(_0x525f2b[_0xb605('0x59')][_0xb605('0x6f')]){_0x46ab4f[_0xb605('0x28')][_0xb605('0x70')]=util[_0xb605('0x5f')]('SIP/%s',_0x525f2b['user'][_0xb605('0x38')]);_0x46ab4f[_0xb605('0x28')][_0xb605('0x71')]=_0x46ab4f[_0xb605('0x71')];_0x46ab4f[_0xb605('0x28')][_0xb605('0x72')]=_0x46ab4f[_0xb605('0x71')];_0x46ab4f[_0xb605('0x28')]['event']=_0xb605('0x5c');return respondWithRpcPromise(_0xb605('0x73'),'EventManager',{'event':_0xb605('0x74'),'message':_0x46ab4f[_0xb605('0x28')]},client9002)[_0xb605('0x21')](function(){return _0x46ab4f;});}return _0x46ab4f;}return null;})['then'](respondWithResult(_0x276f62,null))[_0xb605('0x57')](handleError(_0x276f62,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xb605('0x34')]=function(_0x596014,_0x3bd062,_0x12174c){var _0x8aa5d0={'agent':{},'channel':_0xb605('0x5d')};if(_0x596014[_0xb605('0x59')]['id']){delete _0x596014[_0xb605('0x59')]['id'];}_0x596014[_0xb605('0x59')][_0xb605('0x60')]=_0x596014[_0xb605('0x59')][_0xb605('0x60')]||_0x596014[_0xb605('0x61')]['id'];_0x8aa5d0[_0xb605('0x62')]['id']=_0x596014[_0xb605('0x59')][_0xb605('0x60')];return db[_0xb605('0x3c')][_0xb605('0x56')]({'where':{'id':_0x596014[_0xb605('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3bd062,null))[_0xb605('0x21')](function(_0x1d78b1){if(_0x1d78b1){_0x8aa5d0[_0xb605('0x28')]=_0x1d78b1[_0xb605('0x63')]({'plain':!![]});return db[_0xb605('0x75')][_0xb605('0x56')]({'where':{'id':_0x1d78b1[_0xb605('0x64')]}});}return null;})[_0xb605('0x21')](handleEntityNotFound(_0x3bd062,null))[_0xb605('0x21')](function(_0x142c36){if(_0x142c36){_0x8aa5d0[_0xb605('0x68')]=_0x142c36[_0xb605('0x63')]({'plain':!![]});interaction_log['info'](_0xb605('0x76'),_0x596014[_0xb605('0x61')]['id'],_0x596014[_0xb605('0x61')][_0xb605('0x38')],_0x596014['user']['role'],_0x8aa5d0[_0xb605('0x68')]['id'],_0x596014[_0xb605('0x59')]?JSON[_0xb605('0x25')](_0x596014[_0xb605('0x59')]):_0xb605('0x77'));return respondWithRpcPromise(_0xb605('0x78'),'rejectMessage',_0x8aa5d0);}return null;})[_0xb605('0x21')](function(_0x34653c){var _0x197a9b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34653c[_0xb605('0x28')]['ContactId'];return db[_0xb605('0x79')]['query'](_0x197a9b,{'type':db[_0xb605('0x6c')][_0xb605('0x7a')][_0xb605('0x7b')],'raw':!![]})[_0xb605('0x21')](function(_0x3a483c){return _0x3a483c;});})[_0xb605('0x21')](function(_0x325861){if(_0x325861){_0x8aa5d0[_0xb605('0x28')][_0xb605('0x7c')]=_0x325861[0x0];if(!_0x596014[_0xb605('0x59')][_0xb605('0x60')])return;return db[_0xb605('0x6d')]['find']({'where':{'id':_0x596014['body']['UserId'],'role':_0xb605('0x62')},'attributes':['id',_0xb605('0x38'),'fullname',_0xb605('0x6e'),'internal'],'raw':!![]});}return null;})[_0xb605('0x21')](function(_0x546e66){if(!_0x546e66)return null;_0x8aa5d0[_0xb605('0x28')][_0xb605('0x62')]=_0x546e66;return _0x8aa5d0;})[_0xb605('0x21')](function(_0x10cf39){if(_0x10cf39){_0x10cf39[_0xb605('0x28')][_0xb605('0x70')]=util[_0xb605('0x5f')](_0xb605('0x7d'),_0x596014[_0xb605('0x61')][_0xb605('0x38')]);_0x10cf39[_0xb605('0x28')]['channel']=_0x8aa5d0[_0xb605('0x71')];_0x10cf39['message'][_0xb605('0x72')]=_0x8aa5d0[_0xb605('0x71')];_0x10cf39[_0xb605('0x28')]['event']=_0xb605('0x34');respondWithRpcPromise(_0xb605('0x73'),_0xb605('0x73'),{'event':'rejectmessage','message':_0x10cf39[_0xb605('0x28')]},client9002);return _0x8aa5d0;}return null;})['then'](respondWithResult(_0x3bd062,null))['catch'](handleError(_0x3bd062,null));};exports[_0xb605('0x2d')]=function(_0x49e1a8,_0x4b283a,_0x58f7b6){if(_0x49e1a8[_0xb605('0x59')]['id']){delete _0x49e1a8[_0xb605('0x59')]['id'];}var _0x43452d;return db['SmsMessage'][_0xb605('0x56')]({'where':{'id':_0x49e1a8[_0xb605('0x54')]['id']}})[_0xb605('0x21')](handleEntityNotFound(_0x4b283a,null))[_0xb605('0x21')](function(_0x5c5bfe){if(_0x5c5bfe){_0x43452d=_0x5c5bfe;return db[_0xb605('0x7e')][_0xb605('0x56')]({'where':{'id':_0x5c5bfe[_0xb605('0x7f')]}});}})[_0xb605('0x21')](handleEntityNotFound(_0x4b283a,null))[_0xb605('0x21')](function(_0x3d063c){if(_0x3d063c){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb605('0x2d'),_0xb605('0x80'),_0x3d063c[_0xb605('0x3f')],util['inspect'](_0x49e1a8['body'],{'showHidden':![],'depth':null}));switch(_0x3d063c[_0xb605('0x3f')]){case _0xb605('0x81'):if(_0x49e1a8['body'][_0xb605('0x82')]&&_0x49e1a8[_0xb605('0x59')][_0xb605('0x82')]===_0x43452d[_0xb605('0x83')]){return _0x43452d[_0xb605('0x35')]({'read':!![]});}else{logger['error'](_0xb605('0x84'),_0xb605('0x2d'),_0xb605('0x81'),util['inspect'](_0x49e1a8[_0xb605('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb605('0x85'):if(_0x49e1a8['body'][_0xb605('0x86')]&&_0x49e1a8['body'][_0xb605('0x86')]===_0x43452d['messageId']&&_[_0xb605('0x87')](['sent',_0xb605('0x88')],_0x49e1a8[_0xb605('0x59')][_0xb605('0x89')])>=0x0){return _0x43452d[_0xb605('0x35')]({'read':!![]});}else{logger['error'](_0xb605('0x84'),_0xb605('0x2d'),_0xb605('0x8a'),util[_0xb605('0x8b')](_0x49e1a8['body'],{'showHidden':![],'depth':null}));}break;case _0xb605('0x8c'):var _0x26f5e6=_0x49e1a8['body'][_0xb605('0x8d')][0x0];if(_0x26f5e6[_0xb605('0x2d')]['groupName']===_0xb605('0x8e')){return _0x43452d[_0xb605('0x35')]({'read':!![]});}else{logger[_0xb605('0x26')](_0xb605('0x84'),_0xb605('0x2d'),_0xb605('0x8c'),util['inspect'](_0x49e1a8[_0xb605('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x43452d;}})[_0xb605('0x21')](respondWithResult(_0x4b283a,null))[_0xb605('0x57')](handleError(_0x4b283a,null));}; \ No newline at end of file +var _0x73a1=['format','UserId','user','params','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','sms','get','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','motionChannel','event','rejectmessage','SmsAccount','SmsAccountId','inspect','type','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','end','json','limit','undefined','count','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','fields','length','includeAll','find','create','body','sms-interactions','read','readAt'];(function(_0x597834,_0x159bb6){var _0x12da6c=function(_0x161c38){while(--_0x161c38){_0x597834['push'](_0x597834['shift']());}};_0x12da6c(++_0x159bb6);}(_0x73a1,0x161));var _0x173a=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x73a1[_0x58db4e];return _0x40139a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x173a('0x0'));var jsonpatch=require(_0x173a('0x1'));var rp=require('request-promise');var moment=require(_0x173a('0x2'));var BPromise=require(_0x173a('0x3'));var Mustache=require(_0x173a('0x4'));var util=require(_0x173a('0x5'));var path=require(_0x173a('0x6'));var sox=require('sox');var csv=require(_0x173a('0x7'));var ejs=require(_0x173a('0x8'));var fs=require('fs');var fs_extra=require(_0x173a('0x9'));var _=require(_0x173a('0xa'));var squel=require(_0x173a('0xb'));var crypto=require(_0x173a('0xc'));var jsforce=require(_0x173a('0xd'));var deskjs=require(_0x173a('0xe'));var toCsv=require(_0x173a('0x7'));var querystring=require(_0x173a('0xf'));var Papa=require(_0x173a('0x10'));var Redis=require(_0x173a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x173a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x173a('0x13'));var logger=require(_0x173a('0x14'))(_0x173a('0x15'));var utils=require(_0x173a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x173a('0x17'));var db=require('../../mysqldb')['db'];config[_0x173a('0x18')]=_['defaults'](config[_0x173a('0x18')],{'host':_0x173a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x173a('0x18')]));require(_0x173a('0x1a'))[_0x173a('0x1b')](socket);var jayson=require(_0x173a('0x1c'));var client=jayson[_0x173a('0x1d')][_0x173a('0x1e')]({'port':0x232c});var client9002=jayson[_0x173a('0x1d')][_0x173a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5e4252,_0xb8e6b,_0x3bcc3a,_0x19c5fc){return new BPromise(function(_0x4b323c,_0x5616b0){var _0x5a08a4=_0x19c5fc||client;return _0x5a08a4[_0x173a('0x1f')](_0x5e4252,_0x3bcc3a)['then'](function(_0x578375){logger[_0x173a('0x20')](_0x173a('0x21'),_0xb8e6b,'request\x20sent');logger[_0x173a('0x22')](_0x173a('0x23'),_0xb8e6b,_0x173a('0x24'),JSON[_0x173a('0x25')](_0x578375));if(_0x578375[_0x173a('0x26')]){if(_0x578375[_0x173a('0x26')]['code']===0x1f4){logger[_0x173a('0x26')](_0x173a('0x21'),_0xb8e6b,_0x578375['error'][_0x173a('0x27')]);return _0x5616b0(_0x578375['error']['message']);}logger[_0x173a('0x26')](_0x173a('0x21'),_0xb8e6b,_0x578375[_0x173a('0x26')]['message']);return _0x4b323c(_0x578375[_0x173a('0x26')][_0x173a('0x27')]);}else{logger[_0x173a('0x20')](_0x173a('0x21'),_0xb8e6b,_0x173a('0x24'));_0x4b323c(_0x578375[_0x173a('0x28')]['message']);}})['catch'](function(_0x44d885){logger[_0x173a('0x26')](_0x173a('0x21'),_0xb8e6b,_0x44d885);_0x5616b0(_0x44d885);});});}function respondWithStatusCode(_0x552ea4,_0x27c810){_0x27c810=_0x27c810||0xcc;return function(_0x30c261){if(_0x30c261){return _0x552ea4['sendStatus'](_0x27c810);}return _0x552ea4[_0x173a('0x29')](_0x27c810)[_0x173a('0x2a')]();};}function respondWithResult(_0x469646,_0x451695){_0x451695=_0x451695||0xc8;return function(_0x15b98e){if(_0x15b98e){return _0x469646[_0x173a('0x29')](_0x451695)[_0x173a('0x2b')](_0x15b98e);}};}function respondWithFilteredResult(_0x230482,_0x8cfc24){return function(_0x456551){if(_0x456551){var _0x5aae65=typeof _0x8cfc24['offset']==='undefined'&&typeof _0x8cfc24[_0x173a('0x2c')]===_0x173a('0x2d');var _0x20ae9e=_0x456551[_0x173a('0x2e')];var _0x118bda=_0x5aae65?0x0:_0x8cfc24['offset'];var _0x3e3872=_0x5aae65?_0x456551[_0x173a('0x2e')]:_0x8cfc24['offset']+_0x8cfc24[_0x173a('0x2c')];var _0x324a96;if(_0x3e3872>=_0x20ae9e){_0x3e3872=_0x20ae9e;_0x324a96=0xc8;}else{_0x324a96=0xce;}_0x230482[_0x173a('0x29')](_0x324a96);return _0x230482['set'](_0x173a('0x2f'),_0x118bda+'-'+_0x3e3872+'/'+_0x20ae9e)['json'](_0x456551);}return null;};}function patchUpdates(_0xdab384){return function(_0x5a289d){try{jsonpatch['apply'](_0x5a289d,_0xdab384,!![]);}catch(_0x45829d){return BPromise[_0x173a('0x30')](_0x45829d);}return _0x5a289d[_0x173a('0x31')]();};}function saveUpdates(_0x41c181,_0x55bf07){return function(_0x14f24e){if(_0x14f24e){return _0x14f24e[_0x173a('0x32')](_0x41c181)['then'](function(_0xe2a0a1){return _0xe2a0a1;});}return null;};}function removeEntity(_0x4ef1e7,_0x159dab){return function(_0x194c33){if(_0x194c33){return _0x194c33[_0x173a('0x33')]()[_0x173a('0x34')](function(){_0x4ef1e7[_0x173a('0x29')](0xcc)[_0x173a('0x2a')]();});}};}function handleEntityNotFound(_0x423c23,_0x53319d){return function(_0x3536ad){if(!_0x3536ad){_0x423c23[_0x173a('0x35')](0x194);}return _0x3536ad;};}function handleError(_0x1b7b31,_0x5c1a69){_0x5c1a69=_0x5c1a69||0x1f4;return function(_0x5d1153){logger[_0x173a('0x26')](_0x5d1153[_0x173a('0x36')]);if(_0x5d1153[_0x173a('0x37')]){delete _0x5d1153['name'];}_0x1b7b31[_0x173a('0x29')](_0x5c1a69)[_0x173a('0x38')](_0x5d1153);};}exports[_0x173a('0x39')]=function(_0x2f4e6b,_0x56cd67){var _0x47d0c2={},_0x224e53={},_0x1e2f9c={'count':0x0,'rows':[]};var _0x899eff=_[_0x173a('0x3a')](db[_0x173a('0x3b')][_0x173a('0x3c')],function(_0x414940){return{'name':_0x414940[_0x173a('0x3d')],'type':_0x414940['type'][_0x173a('0x3e')]};});_0x224e53[_0x173a('0x3f')]=_[_0x173a('0x3a')](_0x899eff,_0x173a('0x37'));_0x224e53[_0x173a('0x40')]=_[_0x173a('0x41')](_0x2f4e6b[_0x173a('0x40')]);_0x224e53[_0x173a('0x42')]=_[_0x173a('0x43')](_0x224e53[_0x173a('0x3f')],_0x224e53[_0x173a('0x40')]);_0x47d0c2[_0x173a('0x44')]=_[_0x173a('0x43')](_0x224e53[_0x173a('0x3f')],qs['fields'](_0x2f4e6b[_0x173a('0x40')]['fields']));_0x47d0c2[_0x173a('0x44')]=_0x47d0c2[_0x173a('0x44')]['length']?_0x47d0c2['attributes']:_0x224e53[_0x173a('0x3f')];if(!_0x2f4e6b['query'][_0x173a('0x45')](_0x173a('0x46'))){_0x47d0c2[_0x173a('0x2c')]=qs['limit'](_0x2f4e6b[_0x173a('0x40')][_0x173a('0x2c')]);_0x47d0c2[_0x173a('0x47')]=qs['offset'](_0x2f4e6b[_0x173a('0x40')][_0x173a('0x47')]);}_0x47d0c2[_0x173a('0x48')]=qs['sort'](_0x2f4e6b[_0x173a('0x40')][_0x173a('0x49')]);_0x47d0c2['where']=qs[_0x173a('0x42')](_[_0x173a('0x4a')](_0x2f4e6b['query'],_0x224e53[_0x173a('0x42')]),_0x899eff);if(_0x2f4e6b['query'][_0x173a('0x4b')]){_0x47d0c2['where']=_[_0x173a('0x4c')](_0x47d0c2[_0x173a('0x4d')],{'$or':_[_0x173a('0x3a')](_0x899eff,function(_0xf5269){if(_0xf5269['type']!==_0x173a('0x4e')){var _0xbda804={};_0xbda804[_0xf5269[_0x173a('0x37')]]={'$like':'%'+_0x2f4e6b[_0x173a('0x40')][_0x173a('0x4b')]+'%'};return _0xbda804;}})});}_0x47d0c2=_[_0x173a('0x4c')]({},_0x47d0c2,_0x2f4e6b[_0x173a('0x4f')]);var _0x550d45={'where':_0x47d0c2[_0x173a('0x4d')]};return db['SmsMessage'][_0x173a('0x2e')](_0x550d45)[_0x173a('0x34')](function(_0x98d665){_0x1e2f9c[_0x173a('0x2e')]=_0x98d665;if(_0x2f4e6b['query']['includeAll']){_0x47d0c2[_0x173a('0x50')]=[{'all':!![]}];}return db[_0x173a('0x3b')][_0x173a('0x51')](_0x47d0c2);})[_0x173a('0x34')](function(_0x299bd7){_0x1e2f9c[_0x173a('0x52')]=_0x299bd7;return _0x1e2f9c;})[_0x173a('0x34')](respondWithFilteredResult(_0x56cd67,_0x47d0c2))[_0x173a('0x53')](handleError(_0x56cd67,null));};exports[_0x173a('0x54')]=function(_0x3b19b1,_0x8ed463){var _0x2653c0={'raw':!![],'where':{'id':_0x3b19b1['params']['id']}},_0x40955f={};_0x40955f['model']=_['keys'](db[_0x173a('0x3b')][_0x173a('0x3c')]);_0x40955f[_0x173a('0x40')]=_[_0x173a('0x41')](_0x3b19b1['query']);_0x40955f[_0x173a('0x42')]=_[_0x173a('0x43')](_0x40955f[_0x173a('0x3f')],_0x40955f[_0x173a('0x40')]);_0x2653c0[_0x173a('0x44')]=_[_0x173a('0x43')](_0x40955f[_0x173a('0x3f')],qs[_0x173a('0x55')](_0x3b19b1[_0x173a('0x40')][_0x173a('0x55')]));_0x2653c0['attributes']=_0x2653c0[_0x173a('0x44')][_0x173a('0x56')]?_0x2653c0[_0x173a('0x44')]:_0x40955f[_0x173a('0x3f')];if(_0x3b19b1[_0x173a('0x40')][_0x173a('0x57')]){_0x2653c0[_0x173a('0x50')]=[{'all':!![]}];}_0x2653c0=_[_0x173a('0x4c')]({},_0x2653c0,_0x3b19b1[_0x173a('0x4f')]);return db['SmsMessage'][_0x173a('0x58')](_0x2653c0)[_0x173a('0x34')](handleEntityNotFound(_0x8ed463,null))['then'](respondWithResult(_0x8ed463,null))[_0x173a('0x53')](handleError(_0x8ed463,null));};exports[_0x173a('0x59')]=function(_0x4ee855,_0x157f67){return db[_0x173a('0x3b')][_0x173a('0x59')](_0x4ee855['body'],{})[_0x173a('0x34')](respondWithResult(_0x157f67,0xc9))[_0x173a('0x53')](handleError(_0x157f67,null));};exports[_0x173a('0x32')]=function(_0x36a3e9,_0x292375){if(_0x36a3e9[_0x173a('0x5a')]['id']){delete _0x36a3e9[_0x173a('0x5a')]['id'];}return db['SmsMessage'][_0x173a('0x58')]({'where':{'id':_0x36a3e9['params']['id']}})[_0x173a('0x34')](handleEntityNotFound(_0x292375,null))[_0x173a('0x34')](saveUpdates(_0x36a3e9[_0x173a('0x5a')],null))[_0x173a('0x34')](respondWithResult(_0x292375,null))[_0x173a('0x53')](handleError(_0x292375,null));};exports['destroy']=function(_0x289442,_0x342437){return db[_0x173a('0x3b')][_0x173a('0x58')]({'where':{'id':_0x289442['params']['id']}})[_0x173a('0x34')](handleEntityNotFound(_0x342437,null))['then'](removeEntity(_0x342437,null))[_0x173a('0x53')](handleError(_0x342437,null));};exports['describe']=function(_0x6ab439,_0x543e36){return db[_0x173a('0x3b')]['describe']()['then'](respondWithResult(_0x543e36,null))[_0x173a('0x53')](handleError(_0x543e36,null));};var interaction_log=require(_0x173a('0x14'))(_0x173a('0x5b'));exports['accept']=function(_0x3c30d8,_0x5cb880,_0x1885c2){var _0x2ad0b2={'agent':{},'channel':'sms'};if(_0x3c30d8['body']['id']){delete _0x3c30d8[_0x173a('0x5a')]['id'];}_0x3c30d8['body'][_0x173a('0x5c')]=!![];_0x3c30d8[_0x173a('0x5a')][_0x173a('0x5d')]=moment()[_0x173a('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c30d8[_0x173a('0x5a')][_0x173a('0x5f')]=_0x3c30d8[_0x173a('0x5a')][_0x173a('0x5f')]||_0x3c30d8[_0x173a('0x60')]['id'];_0x2ad0b2['agent']['id']=_0x3c30d8[_0x173a('0x5a')]['UserId'];return db[_0x173a('0x3b')][_0x173a('0x58')]({'where':{'id':_0x3c30d8[_0x173a('0x61')]['id'],'UserId':null}})[_0x173a('0x34')](handleEntityNotFound(_0x5cb880,null))[_0x173a('0x34')](saveUpdates(_0x3c30d8[_0x173a('0x5a')],null))[_0x173a('0x34')](function(_0x3bf459){if(_0x3bf459){_0x2ad0b2[_0x173a('0x27')]=_0x3bf459['get']({'plain':!![]});return db['SmsInteraction'][_0x173a('0x58')]({'where':{'id':_0x3bf459['SmsInteractionId']}});}return null;})[_0x173a('0x34')](handleEntityNotFound(_0x5cb880,null))[_0x173a('0x34')](function(_0x289999){if(_0x289999){return _0x289999[_0x173a('0x32')]({'UserId':_0x3c30d8[_0x173a('0x5a')][_0x173a('0x5f')],'read1stAt':_['isNil'](_0x289999[_0x173a('0x62')])?moment()[_0x173a('0x5e')](_0x173a('0x63')):undefined});}return null;})[_0x173a('0x34')](function(_0x150626){if(_0x150626){_0x2ad0b2['interaction']=_0x150626['get']({'plain':!![]});interaction_log[_0x173a('0x20')](_0x173a('0x64'),_0x3c30d8[_0x173a('0x60')]['id'],_0x3c30d8[_0x173a('0x60')][_0x173a('0x37')],_0x3c30d8[_0x173a('0x60')]['role'],_0x2ad0b2[_0x173a('0x65')]['id'],_0x3c30d8[_0x173a('0x5a')]?JSON['stringify'](_0x3c30d8[_0x173a('0x5a')]):_0x173a('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2ad0b2);}return null;})[_0x173a('0x34')](function(_0x4129fa){var _0x14712a=_0x173a('0x67')+_0x4129fa[_0x173a('0x27')][_0x173a('0x68')];return db[_0x173a('0x69')]['query'](_0x14712a,{'type':db[_0x173a('0x6a')][_0x173a('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x2d2431){return _0x2d2431;});})[_0x173a('0x34')](function(_0x4bbf2c){if(_0x4bbf2c){_0x2ad0b2[_0x173a('0x27')][_0x173a('0x6c')]=_0x4bbf2c[0x0];if(!_0x3c30d8[_0x173a('0x5a')][_0x173a('0x5f')])return;return db[_0x173a('0x6d')][_0x173a('0x58')]({'where':{'id':_0x3c30d8['body'][_0x173a('0x5f')],'role':_0x173a('0x6e')},'attributes':['id','name',_0x173a('0x6f'),_0x173a('0x70'),_0x173a('0x71')],'raw':!![]});}return null;})[_0x173a('0x34')](function(_0x1da298){if(!_0x1da298)return null;_0x2ad0b2[_0x173a('0x27')][_0x173a('0x6e')]=_0x1da298;return _0x2ad0b2;})[_0x173a('0x34')](function(_0x35ca37){if(_0x35ca37){if(_0x3c30d8[_0x173a('0x5a')][_0x173a('0x72')]){_0x2ad0b2[_0x173a('0x27')][_0x173a('0x73')]=util[_0x173a('0x5e')](_0x173a('0x74'),_0x3c30d8[_0x173a('0x60')][_0x173a('0x37')]);_0x2ad0b2[_0x173a('0x27')][_0x173a('0x75')]=_0x2ad0b2['channel'];_0x2ad0b2[_0x173a('0x27')]['motionChannel']=_0x2ad0b2[_0x173a('0x75')];_0x2ad0b2[_0x173a('0x27')]['event']=_0x173a('0x76');return respondWithRpcPromise(_0x173a('0x77'),_0x173a('0x77'),{'event':_0x173a('0x78'),'message':_0x2ad0b2['message']},client9002)[_0x173a('0x34')](function(){return _0x2ad0b2;});}return _0x2ad0b2;}return null;})[_0x173a('0x34')](respondWithResult(_0x5cb880,null))['catch'](handleError(_0x5cb880,null));};var interaction_log=require(_0x173a('0x14'))(_0x173a('0x5b'));exports[_0x173a('0x30')]=function(_0x45fcc8,_0x30550e,_0x50dfa4){var _0x200ddc={'agent':{},'channel':_0x173a('0x79')};if(_0x45fcc8[_0x173a('0x5a')]['id']){delete _0x45fcc8[_0x173a('0x5a')]['id'];}_0x45fcc8[_0x173a('0x5a')][_0x173a('0x5f')]=_0x45fcc8[_0x173a('0x5a')][_0x173a('0x5f')]||_0x45fcc8[_0x173a('0x60')]['id'];_0x200ddc[_0x173a('0x6e')]['id']=_0x45fcc8[_0x173a('0x5a')][_0x173a('0x5f')];return db[_0x173a('0x3b')][_0x173a('0x58')]({'where':{'id':_0x45fcc8[_0x173a('0x61')]['id'],'UserId':null}})[_0x173a('0x34')](handleEntityNotFound(_0x30550e,null))[_0x173a('0x34')](function(_0x27c235){if(_0x27c235){_0x200ddc[_0x173a('0x27')]=_0x27c235[_0x173a('0x7a')]({'plain':!![]});return db[_0x173a('0x7b')][_0x173a('0x58')]({'where':{'id':_0x27c235['SmsInteractionId']}});}return null;})[_0x173a('0x34')](handleEntityNotFound(_0x30550e,null))[_0x173a('0x34')](function(_0x1e8384){if(_0x1e8384){_0x200ddc['interaction']=_0x1e8384[_0x173a('0x7a')]({'plain':!![]});interaction_log[_0x173a('0x20')](_0x173a('0x7c'),_0x45fcc8[_0x173a('0x60')]['id'],_0x45fcc8[_0x173a('0x60')][_0x173a('0x37')],_0x45fcc8[_0x173a('0x60')][_0x173a('0x7d')],_0x200ddc['interaction']['id'],_0x45fcc8[_0x173a('0x5a')]?JSON['stringify'](_0x45fcc8[_0x173a('0x5a')]):_0x173a('0x66'));return respondWithRpcPromise(_0x173a('0x7e'),_0x173a('0x7f'),_0x200ddc);}return null;})[_0x173a('0x34')](function(_0x471ac5){var _0x367cc6=_0x173a('0x67')+_0x471ac5[_0x173a('0x27')][_0x173a('0x68')];return db['sequelize'][_0x173a('0x40')](_0x367cc6,{'type':db[_0x173a('0x6a')]['QueryTypes'][_0x173a('0x80')],'raw':!![]})[_0x173a('0x34')](function(_0x293f93){return _0x293f93;});})['then'](function(_0x460fae){if(_0x460fae){_0x200ddc['message'][_0x173a('0x6c')]=_0x460fae[0x0];if(!_0x45fcc8[_0x173a('0x5a')][_0x173a('0x5f')])return;return db['User'][_0x173a('0x58')]({'where':{'id':_0x45fcc8['body']['UserId'],'role':_0x173a('0x6e')},'attributes':['id',_0x173a('0x37'),_0x173a('0x6f'),_0x173a('0x70'),_0x173a('0x71')],'raw':!![]});}return null;})[_0x173a('0x34')](function(_0x450543){if(!_0x450543)return null;_0x200ddc[_0x173a('0x27')][_0x173a('0x6e')]=_0x450543;return _0x200ddc;})['then'](function(_0x1f6301){if(_0x1f6301){_0x1f6301[_0x173a('0x27')]['interface']=util['format'](_0x173a('0x74'),_0x45fcc8[_0x173a('0x60')][_0x173a('0x37')]);_0x1f6301['message'][_0x173a('0x75')]=_0x200ddc['channel'];_0x1f6301[_0x173a('0x27')][_0x173a('0x81')]=_0x200ddc[_0x173a('0x75')];_0x1f6301[_0x173a('0x27')][_0x173a('0x82')]=_0x173a('0x30');respondWithRpcPromise('EventManager',_0x173a('0x77'),{'event':_0x173a('0x83'),'message':_0x1f6301[_0x173a('0x27')]},client9002);return _0x200ddc;}return null;})[_0x173a('0x34')](respondWithResult(_0x30550e,null))['catch'](handleError(_0x30550e,null));};exports[_0x173a('0x29')]=function(_0x2fd4cc,_0x5f1d64,_0x2ae363){if(_0x2fd4cc[_0x173a('0x5a')]['id']){delete _0x2fd4cc['body']['id'];}var _0x540a0e;return db['SmsMessage'][_0x173a('0x58')]({'where':{'id':_0x2fd4cc[_0x173a('0x61')]['id']}})[_0x173a('0x34')](handleEntityNotFound(_0x5f1d64,null))['then'](function(_0x1264b2){if(_0x1264b2){_0x540a0e=_0x1264b2;return db[_0x173a('0x84')]['find']({'where':{'id':_0x1264b2[_0x173a('0x85')]}});}})[_0x173a('0x34')](handleEntityNotFound(_0x5f1d64,null))[_0x173a('0x34')](function(_0x4cd5fd){if(_0x4cd5fd){logger[_0x173a('0x22')](_0x173a('0x23'),'status','received\x20delivery\x20report\x20from',_0x4cd5fd['type'],util[_0x173a('0x86')](_0x2fd4cc[_0x173a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x4cd5fd[_0x173a('0x87')]){case'twilio':if(_0x2fd4cc[_0x173a('0x5a')][_0x173a('0x88')]&&_0x2fd4cc[_0x173a('0x5a')][_0x173a('0x88')]===_0x540a0e[_0x173a('0x89')]){return _0x540a0e['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x173a('0x29'),_0x173a('0x8a'),util[_0x173a('0x86')](_0x2fd4cc[_0x173a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x173a('0x8b'):if(_0x2fd4cc['body'][_0x173a('0x8c')]&&_0x2fd4cc[_0x173a('0x5a')]['MessageUUID']===_0x540a0e[_0x173a('0x89')]&&_[_0x173a('0x8d')](['sent',_0x173a('0x8e')],_0x2fd4cc[_0x173a('0x5a')]['Status'])>=0x0){return _0x540a0e['update']({'read':!![]});}else{logger[_0x173a('0x26')](_0x173a('0x8f'),_0x173a('0x29'),_0x173a('0x90'),util['inspect'](_0x2fd4cc[_0x173a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x173a('0x91'):var _0x2e2cd7=_0x2fd4cc['body'][_0x173a('0x92')][0x0];if(_0x2e2cd7[_0x173a('0x29')][_0x173a('0x93')]===_0x173a('0x94')){return _0x540a0e['update']({'read':!![]});}else{logger['error'](_0x173a('0x8f'),_0x173a('0x29'),'infobip',util[_0x173a('0x86')](_0x2fd4cc[_0x173a('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x540a0e;}})[_0x173a('0x34')](respondWithResult(_0x5f1d64,null))[_0x173a('0x53')](handleError(_0x5f1d64,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index acd66ac..f47a6b0 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd911=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x457194,_0x423a1d){var _0x51d8bf=function(_0x963777){while(--_0x963777){_0x457194['push'](_0x457194['shift']());}};_0x51d8bf(++_0x423a1d);}(_0xd911,0x89));var _0x1d91=function(_0x42b949,_0x5ef2cd){_0x42b949=_0x42b949-0x0;var _0x1bd737=_0xd911[_0x42b949];return _0x1bd737;};'use strict';var EventEmitter=require(_0x1d91('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1d91('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d91('0x2'),'afterDestroy':_0x1d91('0x3')};function emitEvent(_0x30ad29){return function(_0x30288e,_0x3c47e4,_0x3b581b){SmsMessageEvents[_0x1d91('0x4')](_0x30ad29+':'+_0x30288e['id'],_0x30288e);SmsMessageEvents[_0x1d91('0x4')](_0x30ad29,_0x30288e);_0x3b581b(null);};}for(var e in events){if(events[_0x1d91('0x5')](e)){var event=events[e];SmsMessage[_0x1d91('0x6')](e,emitEvent(event));}}module[_0x1d91('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x7d20=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','../../mysqldb','SmsMessage'];(function(_0x44b48e,_0x2918f0){var _0x306f30=function(_0x482be1){while(--_0x482be1){_0x44b48e['push'](_0x44b48e['shift']());}};_0x306f30(++_0x2918f0);}(_0x7d20,0x1e6));var _0x07d2=function(_0x130ba6,_0x4079e8){_0x130ba6=_0x130ba6-0x0;var _0x9eb3b3=_0x7d20[_0x130ba6];return _0x9eb3b3;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x07d2('0x0'))['db'][_0x07d2('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x07d2('0x2')](0x0);var events={'afterCreate':_0x07d2('0x3'),'afterUpdate':'update','afterDestroy':_0x07d2('0x4')};function emitEvent(_0x1c37fd){return function(_0x504e4c,_0x3944e0,_0x91ddcd){SmsMessageEvents[_0x07d2('0x5')](_0x1c37fd+':'+_0x504e4c['id'],_0x504e4c);SmsMessageEvents[_0x07d2('0x5')](_0x1c37fd,_0x504e4c);_0x91ddcd(null);};}for(var e in events){if(events[_0x07d2('0x6')](e)){var event=events[e];SmsMessage[_0x07d2('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 5473374..da67e82 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb67=['sms_messages','messageId','fti_sms_messages','body','FULLTEXT','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','SmsAccount','find','type','twilio','phone','accountSid','messages','create','/api/sms/messages/','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','POST','requestid','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','/status?token=','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','keys','sort','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','clickatell','apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage'];(function(_0x3c37b5,_0x192c22){var _0x37ed77=function(_0x24f86e){while(--_0x24f86e){_0x3c37b5['push'](_0x3c37b5['shift']());}};_0x37ed77(++_0x192c22);}(_0xfb67,0x1e8));var _0x7fb6=function(_0x4e05f6,_0x214142){_0x4e05f6=_0x4e05f6-0x0;var _0xe82340=_0xfb67[_0x4e05f6];return _0xe82340;};'use strict';var _=require('lodash');var util=require(_0x7fb6('0x0'));var logger=require(_0x7fb6('0x1'))(_0x7fb6('0x2'));var moment=require(_0x7fb6('0x3'));var BPromise=require(_0x7fb6('0x4'));var rp=require(_0x7fb6('0x5'));var fs=require('fs');var path=require(_0x7fb6('0x6'));var rimraf=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var attributes=require(_0x7fb6('0x9'));module[_0x7fb6('0xa')]=function(_0x3e407c,_0x2c76f6){return _0x3e407c['define'](_0x7fb6('0xb'),attributes,{'tableName':_0x7fb6('0xc'),'paranoid':![],'indexes':[{'name':_0x7fb6('0xd'),'fields':['messageId']},{'name':_0x7fb6('0xe'),'fields':[_0x7fb6('0xf')],'type':_0x7fb6('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d2575,_0x15fb73,_0x3e6363){var _0x435ed3=_0x3e407c['models'];var _0x73027f=_0x1d2575['get']({'plain':!![]});if(_0x73027f['direction'][_0x7fb6('0x11')]()==='in'||_0x73027f[_0x7fb6('0x12')][_0x7fb6('0x11')]()===_0x7fb6('0x13')&&!_0x73027f[_0x7fb6('0x14')]&&!_[_0x7fb6('0x15')](_0x73027f[_0x7fb6('0x16')])&&!_['isNil'](_0x73027f[_0x7fb6('0x17')])){_0x435ed3[_0x7fb6('0x18')]['findOne']({'where':{'id':_0x73027f['SmsInteractionId']}})[_0x7fb6('0x19')](function(_0x32083b){if(_0x32083b){_0x32083b[_0x7fb6('0x1a')]({'lastMsgAt':_0x73027f[_0x7fb6('0x1b')],'lastMsgDirection':_0x73027f['direction'][_0x7fb6('0x11')]()});}})[_0x7fb6('0x1c')](function(_0x5465bf){console['error'](_0x5465bf);});}if(_0x73027f['direction']===_0x7fb6('0x13')&&!_0x73027f[_0x7fb6('0x14')]){var _0x5e3651;_0x435ed3[_0x7fb6('0x1d')][_0x7fb6('0x1e')]({'where':{'id':_0x73027f['SmsAccountId']},'raw':!![]})['then'](function(_0x230698){_0x5e3651=_0x230698;if(_0x5e3651&&_0x5e3651[_0x7fb6('0x1f')]){switch(_0x5e3651['type']){case'twilio':var _0x41825e=require(_0x7fb6('0x20'));if(_0x5e3651['accountSid']&&_0x5e3651['authToken']&&_0x5e3651[_0x7fb6('0x21')]){var _0x448675=new _0x41825e(_0x5e3651[_0x7fb6('0x22')],_0x5e3651['authToken']);_0x448675[_0x7fb6('0x23')][_0x7fb6('0x24')]({'body':_0x73027f[_0x7fb6('0xf')],'to':_0x73027f[_0x7fb6('0x21')],'from':_0x5e3651[_0x7fb6('0x21')],'statusCallback':_0x5e3651['remote']+_0x7fb6('0x25')+_0x73027f['id']+'/status?token='+_0x5e3651[_0x7fb6('0x26')]})[_0x7fb6('0x19')](function(_0x1ca5b0){if(_0x1ca5b0[_0x7fb6('0x27')]){return _0x1d2575[_0x7fb6('0x1a')]({'messageId':_0x1ca5b0['sid']});}})[_0x7fb6('0x1c')](function(_0x41196a){logger[_0x7fb6('0x28')](_0x7fb6('0x29'),'afterCreate','twilio',util[_0x7fb6('0x2a')](_0x41196a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x20'),_0x7fb6('0x2c'));}break;case _0x7fb6('0x2d'):var _0x5f40cd=_0x7fb6('0x2e');if(_0x5e3651[_0x7fb6('0x2f')]&&_0x5e3651['password']){var _0x1859b0={'recipient':[_0x73027f[_0x7fb6('0x21')]],'message':_0x73027f['body'],'message_type':_0x5e3651[_0x7fb6('0x30')]};if(_0x5e3651[_0x7fb6('0x30')]&&_0x5e3651[_0x7fb6('0x30')]!=='SI'){_0x1859b0[_0x7fb6('0x31')]=_0x5e3651[_0x7fb6('0x21')];}var _0x5a3dae={'url':_0x5f40cd+_0x7fb6('0x32')+_0x5e3651['username']+_0x7fb6('0x33')+_0x5e3651['password'],'method':_0x7fb6('0x34')};rp(_0x5a3dae)['then'](function(_0x402111){var _0x189760=_0x402111[_0x7fb6('0x35')](';');var _0x242287={'user_key':_0x189760[0x0],'session_key':_0x189760[0x1]};_0x5a3dae={'url':_0x5f40cd+_0x7fb6('0x36'),'method':'POST','headers':{'user_key':_0x242287[_0x7fb6('0x37')],'Session_key':_0x242287[_0x7fb6('0x38')]},'json':!![],'body':_0x1859b0};return rp(_0x5a3dae);})[_0x7fb6('0x19')](function(_0x46069f){if(_0x46069f['total_sent']>=0x1){var _0x4f8a24={'messageId':_0x46069f[_0x7fb6('0x39')]};if(_0x5e3651[_0x7fb6('0x30')]!=='GP'||!_0x5e3651[_0x7fb6('0x3a')]){_0x4f8a24[_0x7fb6('0x3b')]=!![];}return _0x1d2575[_0x7fb6('0x1a')](_0x4f8a24);}else{return logger['error'](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x2d'),util['inspect'](_0x46069f,{'showHidden':![],'depth':null}));}})[_0x7fb6('0x1c')](function(_0x512dde){return logger[_0x7fb6('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x2d'),util[_0x7fb6('0x2a')](_0x512dde,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x2d'),_0x7fb6('0x3c'));}break;case _0x7fb6('0x3d'):if(_0x5e3651['authToken']){var _0x2f1b70={'recipient':_0x73027f[_0x7fb6('0x21')],'message':_0x73027f[_0x7fb6('0xf')],'sender':_0x5e3651[_0x7fb6('0x3e')]||_0x5e3651[_0x7fb6('0x21')],'authorization':_0x5e3651[_0x7fb6('0x3f')]};var _0x15fb73={'method':_0x7fb6('0x40'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2f1b70,'json':!![]};rp(_0x15fb73)[_0x7fb6('0x19')](function(_0x1b9826){var _0x2b7817={'messageId':_0x1b9826[_0x7fb6('0x41')]};if(!_0x5e3651['deliveryReport']){_0x2b7817['read']=!![];}return _0x1d2575[_0x7fb6('0x1a')](_0x2b7817);})['catch'](function(_0x499d62){logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'connectel',util[_0x7fb6('0x2a')](_0x499d62,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'connectel',_0x7fb6('0x42'));}break;case _0x7fb6('0x43'):if(_0x5e3651['username']&&_0x5e3651[_0x7fb6('0x44')]){var _0x2f1b70={'messages':[{'source':_0x7fb6('0x45'),'to':_0x73027f[_0x7fb6('0x21')],'body':_0x73027f['body'],'from':_0x5e3651[_0x7fb6('0x3e')]||_0x5e3651['phone']}]};var _0x55947f=util['format'](_0x7fb6('0x46'),_0x5e3651['username'],_0x5e3651[_0x7fb6('0x44')]);var _0x15fb73={'method':_0x7fb6('0x40'),'uri':_0x7fb6('0x47'),'body':_0x2f1b70,'headers':{'Authorization':util[_0x7fb6('0x48')](_0x7fb6('0x49'),new Buffer(_0x55947f)[_0x7fb6('0x4a')](_0x7fb6('0x4b')))},'json':!![]};rp(_0x15fb73)[_0x7fb6('0x19')](function(_0x365ce8){if(_0x365ce8[_0x7fb6('0x4c')]>=0xc8&&_0x365ce8[_0x7fb6('0x4c')]<=0xce){if(_0x365ce8[_0x7fb6('0x4d')]&&_0x365ce8[_0x7fb6('0x4d')][_0x7fb6('0x4e')]>0x0){var _0x90e1ba=_[_0x7fb6('0x4f')](_0x365ce8[_0x7fb6('0x4d')][_0x7fb6('0x23')]);var _0x3b616a={'messageId':_0x90e1ba[_0x7fb6('0x50')]};if(!_0x5e3651[_0x7fb6('0x3a')]){_0x3b616a[_0x7fb6('0x3b')]=!![];}return _0x1d2575['update'](_0x3b616a);}else{logger['error'](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x51'),util[_0x7fb6('0x2a')](_0x365ce8,{'showHidden':![],'depth':null}));}}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),'afterCreate',_0x7fb6('0x51'),util[_0x7fb6('0x2a')](_0x365ce8,{'showHidden':![],'depth':null}));}})[_0x7fb6('0x1c')](function(_0x35bd88){logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x51'),util['inspect'](_0x35bd88,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'clickSend',_0x7fb6('0x3c'));}break;case'plivo':if(_0x5e3651[_0x7fb6('0x52')]&&_0x5e3651[_0x7fb6('0x3f')]){var _0x2f1b70={'dst':_0x73027f[_0x7fb6('0x21')],'text':_0x73027f[_0x7fb6('0xf')],'src':_0x5e3651[_0x7fb6('0x3e')]||_0x5e3651[_0x7fb6('0x21')],'url':_0x5e3651['remote']+_0x7fb6('0x25')+_0x73027f['id']+_0x7fb6('0x53')+_0x5e3651[_0x7fb6('0x26')]};var _0x55947f=util[_0x7fb6('0x48')](_0x7fb6('0x46'),_0x5e3651[_0x7fb6('0x52')],_0x5e3651[_0x7fb6('0x3f')]);var _0x15fb73={'method':_0x7fb6('0x40'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x5e3651[_0x7fb6('0x52')]),'body':_0x2f1b70,'headers':{'Authorization':util[_0x7fb6('0x48')](_0x7fb6('0x49'),new Buffer(_0x55947f)[_0x7fb6('0x4a')](_0x7fb6('0x4b')))},'json':!![]};rp(_0x15fb73)[_0x7fb6('0x19')](function(_0x479f14){var _0x3ecab6={'messageId':_0x479f14[_0x7fb6('0x54')][0x0]};return _0x1d2575[_0x7fb6('0x1a')](_0x3ecab6);})['catch'](function(_0x4f84f2){logger['error'](_0x7fb6('0x29'),'afterCreate',_0x7fb6('0x55'),util[_0x7fb6('0x2a')](_0x4f84f2,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x55'),_0x7fb6('0x56'));}break;case'infobip':if(_0x5e3651[_0x7fb6('0x2f')]&&_0x5e3651[_0x7fb6('0x44')]){if(_0x5e3651['baseUrl']){var _0x566bcb={'method':_0x7fb6('0x40'),'uri':_0x5e3651[_0x7fb6('0x57')]+_0x7fb6('0x58'),'body':{'username':_0x5e3651[_0x7fb6('0x2f')],'password':_0x5e3651[_0x7fb6('0x44')]},'json':!![]};return rp(_0x566bcb)[_0x7fb6('0x19')](function(_0x329df){var _0x5ee997={'method':_0x7fb6('0x40'),'uri':_0x5e3651[_0x7fb6('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5e3651[_0x7fb6('0x21')],'destinations':[{'to':_0x73027f[_0x7fb6('0x21')]}],'text':_0x73027f[_0x7fb6('0xf')],'notifyUrl':_0x5e3651[_0x7fb6('0x59')]+'/api/sms/messages/'+_0x73027f['id']+'/status?token='+_0x5e3651['token'],'notifyContentType':_0x7fb6('0x5a'),'callbackData':_0x5e3651[_0x7fb6('0x21')]+';'+_0x73027f[_0x7fb6('0xf')]}]},'headers':{'Authorization':_0x7fb6('0x5b')+_0x329df[_0x7fb6('0x26')]},'json':!![]};return rp(_0x5ee997)[_0x7fb6('0x19')](function(_0x134fc7){if(_0x134fc7[_0x7fb6('0x23')]){var _0x1269c7={'messageId':_0x134fc7[_0x7fb6('0x23')][0x0][_0x7fb6('0xd')]};if(!_0x5e3651['deliveryReport']){_0x1269c7['read']=!![];}return _0x1d2575[_0x7fb6('0x1a')](_0x1269c7);}else{return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x5c'),util[_0x7fb6('0x2a')](_0x134fc7,{'showHidden':![],'depth':null}));}});})[_0x7fb6('0x1c')](function(_0x3c9607){return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x5c'),util[_0x7fb6('0x2a')](_0x3c9607,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x5c'),_0x7fb6('0x5d'));}}else{logger[_0x7fb6('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x5c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7fb6('0x5e'):var _0x56f3ba=require(_0x7fb6('0x5f'));if(_0x5e3651['apiKey']){var _0x52c7a1={};_0x52c7a1['login']=_0x5e3651['username'];_0x52c7a1[_0x7fb6('0x21')]=_0x73027f[_0x7fb6('0x21')];_0x52c7a1['sender']=_0x5e3651[_0x7fb6('0x21')];_0x52c7a1['text']=_0x73027f[_0x7fb6('0xf')];_0x52c7a1['timestamp']=+new Date();var _0x40e493='';var _0x56a5c6='';var _0x2fbdb3=Object[_0x7fb6('0x60')](_0x52c7a1);_0x2fbdb3[_0x7fb6('0x61')]();for(var _0x4b7031=0x0;_0x4b7031<_0x2fbdb3['length'];_0x4b7031++){if(_0x40e493!=''){_0x40e493+='&';}_0x40e493+=_0x2fbdb3[_0x4b7031]+'='+encodeURIComponent(_0x52c7a1[_0x2fbdb3[_0x4b7031]]);_0x56a5c6+=_0x52c7a1[_0x2fbdb3[_0x4b7031]];}_0x56a5c6+=_0x5e3651['apiKey'];_0x56a5c6=_0x56f3ba[_0x7fb6('0x62')](_0x7fb6('0x63'))[_0x7fb6('0x1a')](_0x56a5c6)[_0x7fb6('0x64')]('hex');if(_0x40e493!==''){_0x40e493+='&';}_0x40e493+=_0x7fb6('0x65')+_0x56a5c6;var _0x5a3dae={'method':_0x7fb6('0x34'),'uri':_0x5e3651[_0x7fb6('0x57')]+_0x7fb6('0x66')+_0x40e493,'json':!![]};return rp(_0x5a3dae)[_0x7fb6('0x19')](function(_0x67ee91){var _0x520805=Object['keys'](_0x67ee91);if(_0x67ee91[_0x520805[0x0]]['error']&&parseInt(_0x67ee91[_0x520805[0x0]]['error'])===0x0){var _0x3f0590={'messageId':_0x67ee91[_0x520805[0x0]][_0x7fb6('0x67')]};if(!_0x5e3651[_0x7fb6('0x3a')]){_0x3f0590[_0x7fb6('0x3b')]=!![];}return _0x1d2575[_0x7fb6('0x1a')](_0x3f0590);}else{return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'csc',util[_0x7fb6('0x2a')](_0x67ee91[_0x7fb6('0x28')],{'showHidden':![],'depth':null}));}})[_0x7fb6('0x1c')](function(_0x4c9a40){return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'csc',util[_0x7fb6('0x2a')](_0x4c9a40,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case _0x7fb6('0x68'):if(_0x5e3651[_0x7fb6('0x69')]){var _0x94fde6={'method':_0x7fb6('0x40'),'uri':_0x7fb6('0x6a'),'headers':{'Authorization':_0x5e3651[_0x7fb6('0x69')]},'body':{'content':_0x73027f[_0x7fb6('0xf')],'to':[_0x73027f[_0x7fb6('0x21')]],'from':_0x5e3651['phone'],'binary':![],'clientMessageId':_0x7fb6('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x94fde6)[_0x7fb6('0x19')](function(_0xdbed0a){if(!_0xdbed0a['error']){var _0x318f2b={'messageId':_0xdbed0a['messages'][0x0][_0x7fb6('0x6c')]};if(!_0x5e3651[_0x7fb6('0x3a')]){_0x318f2b[_0x7fb6('0x3b')]=!![];}return _0x1d2575[_0x7fb6('0x1a')](_0x318f2b);}else{return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),'afterCreate',_0x7fb6('0x68'),util[_0x7fb6('0x2a')](_0xdbed0a[_0x7fb6('0x28')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xe88b04){return logger[_0x7fb6('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x68'),util[_0x7fb6('0x2a')](_0xe88b04,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x68'),_0x7fb6('0x6d'));}break;case _0x7fb6('0x6e'):if(_0x5e3651['username']&&_0x5e3651[_0x7fb6('0x44')]){var _0x55947f=util[_0x7fb6('0x48')](_0x7fb6('0x46'),_0x5e3651[_0x7fb6('0x2f')],_0x5e3651[_0x7fb6('0x44')]);var _0x15fb73={'method':_0x7fb6('0x40'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x5e3651[_0x7fb6('0x6f')]+_0x7fb6('0x70'),'body':{'to':[_0x73027f[_0x7fb6('0x21')]],'text':_0x73027f['body'],'from':_0x5e3651[_0x7fb6('0x21')],'applicationId':_0x5e3651[_0x7fb6('0x71')]},'headers':{'Authorization':util[_0x7fb6('0x48')](_0x7fb6('0x49'),new Buffer(_0x55947f)['toString'](_0x7fb6('0x4b')))},'json':!![]};rp(_0x15fb73)[_0x7fb6('0x19')](function(_0x36c390){if(_0x36c390['id']){var _0x24364e={'messageId':_0x36c390['id']};return _0x1d2575[_0x7fb6('0x1a')](_0x24364e);}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),'bandwidth',util[_0x7fb6('0x2a')](_0x36c390,{'showHidden':![],'depth':null}));}})[_0x7fb6('0x1c')](function(_0x3fdd86){logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x6e'),util[_0x7fb6('0x2a')](_0x3fdd86,{'showHidden':![],'depth':null}));});}else{logger[_0x7fb6('0x28')](_0x7fb6('0x29'),_0x7fb6('0x2b'),_0x7fb6('0x6e'),_0x7fb6('0x3c'));}break;case _0x7fb6('0x72'):if(_0x5e3651[_0x7fb6('0x69')]){var _0x3b5ccd={};var _0x5a3dae={'method':_0x7fb6('0x40'),'uri':_0x7fb6('0x73'),'headers':{'Authorization':_0x7fb6('0x74')+_0x5e3651[_0x7fb6('0x69')],'Content-Type':'application/json'},'body':{'from':_0x5e3651[_0x7fb6('0x21')],'to':_0x73027f[_0x7fb6('0x21')],'text':_0x73027f[_0x7fb6('0xf')]},'json':!![]};return rp(_0x5a3dae)[_0x7fb6('0x19')](function(_0x4a2b5f){if(_0x4a2b5f[_0x7fb6('0x75')]==0xca){_0x3b5ccd[_0x7fb6('0x76')]=_0x4a2b5f;var _0x53f0b={'method':_0x7fb6('0x40'),'uri':_0x7fb6('0x77'),'headers':{'Authorization':_0x7fb6('0x74')+_0x5e3651[_0x7fb6('0x69')],'Content-Type':'application/json'},'body':{'refid':_0x3b5ccd[_0x7fb6('0x76')]['refid']},'json':!![]};return rp(_0x53f0b)['then'](function(_0x102813){_0x3b5ccd[_0x7fb6('0x78')]=_0x102813;var _0x432b82={'messageId':_0x3b5ccd[_0x7fb6('0x76')]['refid'],'read':!![]};return _0x1d2575[_0x7fb6('0x1a')](_0x432b82);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fb6('0x2b'),_0x7fb6('0x72'),util['inspect'](_0x4a2b5f,{'showHidden':![],'depth':null}));}})[_0x7fb6('0x1c')](function(_0x299646){return logger['error'](_0x7fb6('0x29'),_0x7fb6('0x2b'),'intelepeer',util[_0x7fb6('0x2a')](_0x299646,{'showHidden':![],'depth':null}));});}else{return logger[_0x7fb6('0x28')](_0x7fb6('0x29'),'afterCreate',_0x7fb6('0x72'),_0x7fb6('0x79'));}break;}}})[_0x7fb6('0x7a')](function(){_0x3e6363();});}else{_0x3e6363();}}},'charset':_0x7fb6('0x7b'),'collate':_0x7fb6('0x7c')});}; \ No newline at end of file +var _0xd87e=['Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','base64','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer','finally','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','error','find','type','twilio','accountSid','phone','messages','create','body','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','username','&password=','GET','split','sms','POST','user_key','internal_order_id','deliveryReport','read','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','head','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xd87e,0x19e));var _0xed87=function(_0x3f62d8,_0x4ebd4a){_0x3f62d8=_0x3f62d8-0x0;var _0x4a649d=_0xd87e[_0x3f62d8];return _0x4a649d;};'use strict';var _=require(_0xed87('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed87('0x1'));var moment=require(_0xed87('0x2'));var BPromise=require(_0xed87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed87('0x4'));var rimraf=require(_0xed87('0x5'));var config=require(_0xed87('0x6'));var attributes=require(_0xed87('0x7'));module['exports']=function(_0x139b91,_0x582fe3){return _0x139b91[_0xed87('0x8')](_0xed87('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xed87('0xa'),'fields':[_0xed87('0xa')]},{'name':_0xed87('0xb'),'fields':['body'],'type':_0xed87('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1af25a,_0x5091fd,_0x4f1a3c){var _0x4eaeb5=_0x139b91[_0xed87('0xd')];var _0x2e103e=_0x1af25a[_0xed87('0xe')]({'plain':!![]});if(_0x2e103e[_0xed87('0xf')][_0xed87('0x10')]()==='in'||_0x2e103e[_0xed87('0xf')][_0xed87('0x10')]()===_0xed87('0x11')&&!_0x2e103e[_0xed87('0x12')]&&!_[_0xed87('0x13')](_0x2e103e[_0xed87('0x14')])&&!_[_0xed87('0x13')](_0x2e103e['SmsInteractionId'])){_0x4eaeb5[_0xed87('0x15')][_0xed87('0x16')]({'where':{'id':_0x2e103e[_0xed87('0x17')]}})[_0xed87('0x18')](function(_0x32a439){if(_0x32a439){_0x32a439['update']({'lastMsgAt':_0x2e103e[_0xed87('0x19')],'lastMsgDirection':_0x2e103e[_0xed87('0xf')][_0xed87('0x10')]()});}})[_0xed87('0x1a')](function(_0x830e97){console[_0xed87('0x1b')](_0x830e97);});}if(_0x2e103e[_0xed87('0xf')]===_0xed87('0x11')&&!_0x2e103e[_0xed87('0x12')]){var _0x4ddbf5;_0x4eaeb5['SmsAccount'][_0xed87('0x1c')]({'where':{'id':_0x2e103e['SmsAccountId']},'raw':!![]})['then'](function(_0x2f2499){_0x4ddbf5=_0x2f2499;if(_0x4ddbf5&&_0x4ddbf5[_0xed87('0x1d')]){switch(_0x4ddbf5[_0xed87('0x1d')]){case _0xed87('0x1e'):var _0x246fc8=require(_0xed87('0x1e'));if(_0x4ddbf5[_0xed87('0x1f')]&&_0x4ddbf5['authToken']&&_0x4ddbf5[_0xed87('0x20')]){var _0xd21c37=new _0x246fc8(_0x4ddbf5['accountSid'],_0x4ddbf5['authToken']);_0xd21c37[_0xed87('0x21')][_0xed87('0x22')]({'body':_0x2e103e[_0xed87('0x23')],'to':_0x2e103e[_0xed87('0x20')],'from':_0x4ddbf5[_0xed87('0x20')],'statusCallback':_0x4ddbf5['remote']+_0xed87('0x24')+_0x2e103e['id']+_0xed87('0x25')+_0x4ddbf5[_0xed87('0x26')]})['then'](function(_0x17a9a1){if(_0x17a9a1[_0xed87('0x27')]){return _0x1af25a[_0xed87('0x28')]({'messageId':_0x17a9a1[_0xed87('0x27')]});}})[_0xed87('0x1a')](function(_0x3a5122){logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x1e'),util[_0xed87('0x2b')](_0x3a5122,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x1e'),_0xed87('0x2c'));}break;case _0xed87('0x2d'):var _0x43593d=_0xed87('0x2e');if(_0x4ddbf5['username']&&_0x4ddbf5[_0xed87('0x2f')]){var _0x2e06e5={'recipient':[_0x2e103e[_0xed87('0x20')]],'message':_0x2e103e[_0xed87('0x23')],'message_type':_0x4ddbf5['smsMethod']};if(_0x4ddbf5[_0xed87('0x30')]&&_0x4ddbf5[_0xed87('0x30')]!=='SI'){_0x2e06e5[_0xed87('0x31')]=_0x4ddbf5[_0xed87('0x20')];}var _0x25f118={'url':_0x43593d+'login?username='+_0x4ddbf5[_0xed87('0x32')]+_0xed87('0x33')+_0x4ddbf5[_0xed87('0x2f')],'method':_0xed87('0x34')};rp(_0x25f118)['then'](function(_0x1c4a7c){var _0x1b5a10=_0x1c4a7c[_0xed87('0x35')](';');var _0x2daea0={'user_key':_0x1b5a10[0x0],'session_key':_0x1b5a10[0x1]};_0x25f118={'url':_0x43593d+_0xed87('0x36'),'method':_0xed87('0x37'),'headers':{'user_key':_0x2daea0[_0xed87('0x38')],'Session_key':_0x2daea0['session_key']},'json':!![],'body':_0x2e06e5};return rp(_0x25f118);})[_0xed87('0x18')](function(_0x4514e9){if(_0x4514e9['total_sent']>=0x1){var _0x40ab2a={'messageId':_0x4514e9[_0xed87('0x39')]};if(_0x4ddbf5[_0xed87('0x30')]!=='GP'||!_0x4ddbf5[_0xed87('0x3a')]){_0x40ab2a[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0x40ab2a);}else{return logger['error'](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x2d'),util['inspect'](_0x4514e9,{'showHidden':![],'depth':null}));}})[_0xed87('0x1a')](function(_0x3e937f){return logger['error'](_0xed87('0x29'),'afterCreate','skebby',util[_0xed87('0x2b')](_0x3e937f,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xed87('0x3c'):if(_0x4ddbf5[_0xed87('0x3d')]){var _0x3560d7={'recipient':_0x2e103e[_0xed87('0x20')],'message':_0x2e103e[_0xed87('0x23')],'sender':_0x4ddbf5[_0xed87('0x3e')]||_0x4ddbf5[_0xed87('0x20')],'authorization':_0x4ddbf5['authToken']};var _0x5091fd={'method':_0xed87('0x37'),'uri':_0xed87('0x3f'),'body':_0x3560d7,'json':!![]};rp(_0x5091fd)['then'](function(_0x9c14d6){var _0x2f8445={'messageId':_0x9c14d6[_0xed87('0x40')]};if(!_0x4ddbf5[_0xed87('0x3a')]){_0x2f8445[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0x2f8445);})[_0xed87('0x1a')](function(_0x3f3a6f){logger['error'](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x3c'),util['inspect'](_0x3f3a6f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0xed87('0x41'));}break;case _0xed87('0x42'):if(_0x4ddbf5[_0xed87('0x32')]&&_0x4ddbf5[_0xed87('0x2f')]){var _0x3560d7={'messages':[{'source':_0xed87('0x43'),'to':_0x2e103e[_0xed87('0x20')],'body':_0x2e103e['body'],'from':_0x4ddbf5['senderString']||_0x4ddbf5[_0xed87('0x20')]}]};var _0x286070=util[_0xed87('0x44')](_0xed87('0x45'),_0x4ddbf5[_0xed87('0x32')],_0x4ddbf5[_0xed87('0x2f')]);var _0x5091fd={'method':_0xed87('0x37'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3560d7,'headers':{'Authorization':util['format'](_0xed87('0x46'),new Buffer(_0x286070)[_0xed87('0x47')]('base64'))},'json':!![]};rp(_0x5091fd)['then'](function(_0x5c33fe){if(_0x5c33fe[_0xed87('0x48')]>=0xc8&&_0x5c33fe[_0xed87('0x48')]<=0xce){if(_0x5c33fe['data']&&_0x5c33fe['data']['queued_count']>0x0){var _0x341e4e=_[_0xed87('0x49')](_0x5c33fe[_0xed87('0x4a')]['messages']);var _0xd486d5={'messageId':_0x341e4e[_0xed87('0x4b')]};if(!_0x4ddbf5[_0xed87('0x3a')]){_0xd486d5[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0xd486d5);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xed87('0x2a'),_0xed87('0x4c'),util[_0xed87('0x2b')](_0x5c33fe,{'showHidden':![],'depth':null}));}}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),'clickSend',util[_0xed87('0x2b')](_0x5c33fe,{'showHidden':![],'depth':null}));}})[_0xed87('0x1a')](function(_0x47509d){logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x4c'),util[_0xed87('0x2b')](_0x47509d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xed87('0x29'),_0xed87('0x2a'),'clickSend',_0xed87('0x4d'));}break;case'plivo':if(_0x4ddbf5['authId']&&_0x4ddbf5[_0xed87('0x3d')]){var _0x3560d7={'dst':_0x2e103e[_0xed87('0x20')],'text':_0x2e103e[_0xed87('0x23')],'src':_0x4ddbf5[_0xed87('0x3e')]||_0x4ddbf5['phone'],'url':_0x4ddbf5['remote']+_0xed87('0x24')+_0x2e103e['id']+_0xed87('0x25')+_0x4ddbf5['token']};var _0x286070=util['format'](_0xed87('0x45'),_0x4ddbf5[_0xed87('0x4e')],_0x4ddbf5[_0xed87('0x3d')]);var _0x5091fd={'method':_0xed87('0x37'),'uri':util[_0xed87('0x44')](_0xed87('0x4f'),_0x4ddbf5[_0xed87('0x4e')]),'body':_0x3560d7,'headers':{'Authorization':util[_0xed87('0x44')](_0xed87('0x46'),new Buffer(_0x286070)['toString']('base64'))},'json':!![]};rp(_0x5091fd)[_0xed87('0x18')](function(_0x1c2066){var _0x5db759={'messageId':_0x1c2066[_0xed87('0x50')][0x0]};return _0x1af25a['update'](_0x5db759);})[_0xed87('0x1a')](function(_0x200b45){logger['error'](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x51'),util[_0xed87('0x2b')](_0x200b45,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x51'),_0xed87('0x52'));}break;case _0xed87('0x53'):if(_0x4ddbf5[_0xed87('0x32')]&&_0x4ddbf5[_0xed87('0x2f')]){if(_0x4ddbf5['baseUrl']){var _0x2ddea4={'method':_0xed87('0x37'),'uri':_0x4ddbf5[_0xed87('0x54')]+_0xed87('0x55'),'body':{'username':_0x4ddbf5['username'],'password':_0x4ddbf5[_0xed87('0x2f')]},'json':!![]};return rp(_0x2ddea4)['then'](function(_0x273156){var _0xdedee={'method':_0xed87('0x37'),'uri':_0x4ddbf5[_0xed87('0x54')]+_0xed87('0x56'),'body':{'messages':[{'from':_0x4ddbf5[_0xed87('0x20')],'destinations':[{'to':_0x2e103e[_0xed87('0x20')]}],'text':_0x2e103e[_0xed87('0x23')],'notifyUrl':_0x4ddbf5[_0xed87('0x57')]+'/api/sms/messages/'+_0x2e103e['id']+'/status?token='+_0x4ddbf5['token'],'notifyContentType':_0xed87('0x58'),'callbackData':_0x4ddbf5[_0xed87('0x20')]+';'+_0x2e103e['body']}]},'headers':{'Authorization':_0xed87('0x59')+_0x273156[_0xed87('0x26')]},'json':!![]};return rp(_0xdedee)['then'](function(_0x2a3edf){if(_0x2a3edf[_0xed87('0x21')]){var _0x3924d8={'messageId':_0x2a3edf[_0xed87('0x21')][0x0][_0xed87('0xa')]};if(!_0x4ddbf5[_0xed87('0x3a')]){_0x3924d8[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0x3924d8);}else{return logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),'infobip',util[_0xed87('0x2b')](_0x2a3edf,{'showHidden':![],'depth':null}));}});})[_0xed87('0x1a')](function(_0x35e6e5){return logger[_0xed87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xed87('0x2a'),_0xed87('0x53'),util[_0xed87('0x2b')](_0x35e6e5,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x53'),_0xed87('0x5a'));}}else{logger[_0xed87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xed87('0x53'),_0xed87('0x4d'));}break;case _0xed87('0x5b'):var _0x42f3c5=require(_0xed87('0x5c'));if(_0x4ddbf5[_0xed87('0x5d')]){var _0x237643={};_0x237643[_0xed87('0x5e')]=_0x4ddbf5['username'];_0x237643['phone']=_0x2e103e[_0xed87('0x20')];_0x237643[_0xed87('0x31')]=_0x4ddbf5[_0xed87('0x20')];_0x237643[_0xed87('0x5f')]=_0x2e103e['body'];_0x237643[_0xed87('0x60')]=+new Date();var _0x3d50c8='';var _0xc790db='';var _0x10b5c2=Object[_0xed87('0x61')](_0x237643);_0x10b5c2['sort']();for(var _0x5d9e5e=0x0;_0x5d9e5e<_0x10b5c2[_0xed87('0x62')];_0x5d9e5e++){if(_0x3d50c8!=''){_0x3d50c8+='&';}_0x3d50c8+=_0x10b5c2[_0x5d9e5e]+'='+encodeURIComponent(_0x237643[_0x10b5c2[_0x5d9e5e]]);_0xc790db+=_0x237643[_0x10b5c2[_0x5d9e5e]];}_0xc790db+=_0x4ddbf5[_0xed87('0x5d')];_0xc790db=_0x42f3c5[_0xed87('0x63')](_0xed87('0x64'))['update'](_0xc790db)[_0xed87('0x65')]('hex');if(_0x3d50c8!==''){_0x3d50c8+='&';}_0x3d50c8+=_0xed87('0x66')+_0xc790db;var _0x25f118={'method':_0xed87('0x34'),'uri':_0x4ddbf5[_0xed87('0x54')]+_0xed87('0x67')+_0x3d50c8,'json':!![]};return rp(_0x25f118)[_0xed87('0x18')](function(_0x349508){var _0x39096a=Object[_0xed87('0x61')](_0x349508);if(_0x349508[_0x39096a[0x0]][_0xed87('0x1b')]&&parseInt(_0x349508[_0x39096a[0x0]][_0xed87('0x1b')])===0x0){var _0xf557f6={'messageId':_0x349508[_0x39096a[0x0]][_0xed87('0x68')]};if(!_0x4ddbf5['deliveryReport']){_0xf557f6[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0xf557f6);}else{return logger[_0xed87('0x1b')](_0xed87('0x29'),'afterCreate',_0xed87('0x5b'),util[_0xed87('0x2b')](_0x349508['error'],{'showHidden':![],'depth':null}));}})[_0xed87('0x1a')](function(_0x4d90c5){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xed87('0x2b')](_0x4d90c5,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x5b'),_0xed87('0x69'));}break;case _0xed87('0x6a'):if(_0x4ddbf5[_0xed87('0x5d')]){var _0x45332e={'method':_0xed87('0x37'),'uri':_0xed87('0x6b'),'headers':{'Authorization':_0x4ddbf5[_0xed87('0x5d')]},'body':{'content':_0x2e103e[_0xed87('0x23')],'to':[_0x2e103e['phone']],'from':_0x4ddbf5[_0xed87('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0xed87('0x6c')},'json':!![]};rp(_0x45332e)['then'](function(_0x40cb10){if(!_0x40cb10[_0xed87('0x1b')]){var _0x2e3dc2={'messageId':_0x40cb10[_0xed87('0x21')][0x0][_0xed87('0x6d')]};if(!_0x4ddbf5[_0xed87('0x3a')]){_0x2e3dc2[_0xed87('0x3b')]=!![];}return _0x1af25a[_0xed87('0x28')](_0x2e3dc2);}else{return logger[_0xed87('0x1b')](_0xed87('0x29'),'afterCreate','clickatell',util[_0xed87('0x2b')](_0x40cb10[_0xed87('0x1b')],{'showHidden':![],'depth':null}));}})[_0xed87('0x1a')](function(_0x3a821b){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xed87('0x6a'),util['inspect'](_0x3a821b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x6a'),_0xed87('0x69'));}break;case _0xed87('0x6e'):if(_0x4ddbf5[_0xed87('0x32')]&&_0x4ddbf5[_0xed87('0x2f')]){var _0x286070=util[_0xed87('0x44')](_0xed87('0x45'),_0x4ddbf5[_0xed87('0x32')],_0x4ddbf5[_0xed87('0x2f')]);var _0x5091fd={'method':_0xed87('0x37'),'uri':_0xed87('0x6f')+_0x4ddbf5[_0xed87('0x70')]+_0xed87('0x71'),'body':{'to':[_0x2e103e[_0xed87('0x20')]],'text':_0x2e103e[_0xed87('0x23')],'from':_0x4ddbf5[_0xed87('0x20')],'applicationId':_0x4ddbf5[_0xed87('0x72')]},'headers':{'Authorization':util[_0xed87('0x44')](_0xed87('0x46'),new Buffer(_0x286070)[_0xed87('0x47')](_0xed87('0x73')))},'json':!![]};rp(_0x5091fd)[_0xed87('0x18')](function(_0x4a07c5){if(_0x4a07c5['id']){var _0x3d4bd9={'messageId':_0x4a07c5['id']};return _0x1af25a[_0xed87('0x28')](_0x3d4bd9);}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x6e'),util[_0xed87('0x2b')](_0x4a07c5,{'showHidden':![],'depth':null}));}})[_0xed87('0x1a')](function(_0x2d59e2){logger['error'](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x6e'),util[_0xed87('0x2b')](_0x2d59e2,{'showHidden':![],'depth':null}));});}else{logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x6e'),_0xed87('0x4d'));}break;case'intelepeer':if(_0x4ddbf5['apiKey']){var _0xa5495e={};var _0x25f118={'method':'POST','uri':_0xed87('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x4ddbf5[_0xed87('0x5d')],'Content-Type':_0xed87('0x58')},'body':{'from':_0x4ddbf5['phone'],'to':_0x2e103e['phone'],'text':_0x2e103e[_0xed87('0x23')]},'json':!![]};return rp(_0x25f118)[_0xed87('0x18')](function(_0x2b3257){if(_0x2b3257[_0xed87('0x75')]==0xca){_0xa5495e[_0xed87('0x76')]=_0x2b3257;var _0xe958f7={'method':'POST','uri':_0xed87('0x77'),'headers':{'Authorization':_0xed87('0x78')+_0x4ddbf5[_0xed87('0x5d')],'Content-Type':_0xed87('0x58')},'body':{'refid':_0xa5495e['message'][_0xed87('0x79')]},'json':!![]};return rp(_0xe958f7)[_0xed87('0x18')](function(_0x34c487){_0xa5495e[_0xed87('0x7a')]=_0x34c487;var _0x4e5aaa={'messageId':_0xa5495e[_0xed87('0x76')][_0xed87('0x79')],'read':!![]};return _0x1af25a[_0xed87('0x28')](_0x4e5aaa);});}else{return logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),'intelepeer',util['inspect'](_0x2b3257,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2ab386){return logger[_0xed87('0x1b')](_0xed87('0x29'),_0xed87('0x2a'),_0xed87('0x7b'),util[_0xed87('0x2b')](_0x2ab386,{'showHidden':![],'depth':null}));});}else{return logger[_0xed87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xed87('0x2a'),_0xed87('0x7b'),'Token\x20not\x20received');}break;}}})[_0xed87('0x7c')](function(){_0x4f1a3c();});}else{_0x4f1a3c();}}},'charset':'utf8mb4','collate':_0xed87('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index cd21b7c..97b84c1 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee62=['stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee62,0x160));var _0x2ee6=function(_0x1fb181,_0x2a240e){_0x1fb181=_0x1fb181-0x0;var _0x538b05=_0xee62[_0x1fb181];return _0x538b05;};'use strict';var _=require(_0x2ee6('0x0'));var util=require(_0x2ee6('0x1'));var moment=require(_0x2ee6('0x2'));var BPromise=require(_0x2ee6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ee6('0x4'));var db=require(_0x2ee6('0x5'))['db'];var utils=require(_0x2ee6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ee6('0x7'));var jayson=require(_0x2ee6('0x8'));var client=jayson[_0x2ee6('0x9')][_0x2ee6('0xa')]({'port':0x232a});config[_0x2ee6('0xb')]=_['defaults'](config[_0x2ee6('0xb')],{'host':_0x2ee6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ee6('0xb')]));require(_0x2ee6('0xd'))[_0x2ee6('0xe')](socket);function respondWithRpcPromise(_0x37fdf3,_0x2d6bf9,_0x296e18){return new BPromise(function(_0x18da72,_0x1d614d){return client[_0x2ee6('0xf')](_0x37fdf3,_0x296e18)[_0x2ee6('0x10')](function(_0x873a5b){logger[_0x2ee6('0x11')](_0x2ee6('0x12'),_0x2d6bf9,_0x2ee6('0x13'));logger[_0x2ee6('0x14')](_0x2ee6('0x15'),_0x2d6bf9,_0x2ee6('0x13'),JSON[_0x2ee6('0x16')](_0x873a5b));if(_0x873a5b[_0x2ee6('0x17')]){if(_0x873a5b[_0x2ee6('0x17')][_0x2ee6('0x18')]===0x1f4){logger[_0x2ee6('0x17')]('SmsMessage,\x20%s,\x20%s',_0x2d6bf9,_0x873a5b['error'][_0x2ee6('0x19')]);return _0x1d614d(_0x873a5b[_0x2ee6('0x17')]['message']);}logger[_0x2ee6('0x17')](_0x2ee6('0x12'),_0x2d6bf9,_0x873a5b['error']['message']);return _0x18da72(_0x873a5b[_0x2ee6('0x17')][_0x2ee6('0x19')]);}else{logger[_0x2ee6('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2d6bf9,_0x2ee6('0x13'));_0x18da72(_0x873a5b[_0x2ee6('0x1a')][_0x2ee6('0x19')]);}})[_0x2ee6('0x1b')](function(_0x37ae66){logger['error'](_0x2ee6('0x12'),_0x2d6bf9,_0x37ae66);_0x1d614d(_0x37ae66);});});}exports[_0x2ee6('0x1c')]=function(_0x17223b){var _0x12343d=this;return new Promise(function(_0xecad9f,_0xa890b8){return db[_0x2ee6('0x1d')][_0x2ee6('0x1e')](_0x17223b[_0x2ee6('0x1f')],{'raw':_0x17223b[_0x2ee6('0x20')]?_0x17223b[_0x2ee6('0x20')][_0x2ee6('0x21')]===undefined?!![]:![]:!![]})[_0x2ee6('0x10')](function(_0x6c57ea){logger[_0x2ee6('0x11')](_0x2ee6('0x1c'),_0x17223b);logger['debug'](_0x2ee6('0x1c'),_0x17223b,JSON[_0x2ee6('0x16')](_0x6c57ea));_0xecad9f(_0x6c57ea);})[_0x2ee6('0x1b')](function(_0x1221da){logger[_0x2ee6('0x17')]('CreateSmsMessage',_0x1221da['message'],_0x17223b);_0xa890b8(_0x12343d[_0x2ee6('0x17')](0x1f4,_0x1221da['message']));});});}; \ No newline at end of file +var _0x8144=['SmsMessage','create','body','options','then','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateSmsMessage'];(function(_0x379d12,_0x3737d6){var _0x3073e3=function(_0x3b3a4c){while(--_0x3b3a4c){_0x379d12['push'](_0x379d12['shift']());}};_0x3073e3(++_0x3737d6);}(_0x8144,0x1e2));var _0x4814=function(_0x56f147,_0x27319b){_0x56f147=_0x56f147-0x0;var _0x3d7896=_0x8144[_0x56f147];return _0x3d7896;};'use strict';var _=require('lodash');var util=require(_0x4814('0x0'));var moment=require(_0x4814('0x1'));var BPromise=require(_0x4814('0x2'));var rs=require(_0x4814('0x3'));var fs=require('fs');var Redis=require(_0x4814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4814('0x5'));var logger=require(_0x4814('0x6'))(_0x4814('0x7'));var config=require(_0x4814('0x8'));var jayson=require(_0x4814('0x9'));var client=jayson[_0x4814('0xa')][_0x4814('0xb')]({'port':0x232a});config[_0x4814('0xc')]=_[_0x4814('0xd')](config['redis'],{'host':_0x4814('0xe'),'port':0x18eb});var socket=require(_0x4814('0xf'))(new Redis(config[_0x4814('0xc')]));require('./smsMessage.socket')[_0x4814('0x10')](socket);function respondWithRpcPromise(_0x3bdf3f,_0x3091b3,_0x3a0fad){return new BPromise(function(_0x38084b,_0x213f9a){return client[_0x4814('0x11')](_0x3bdf3f,_0x3a0fad)['then'](function(_0x479c2f){logger['info'](_0x4814('0x12'),_0x3091b3,_0x4814('0x13'));logger['debug'](_0x4814('0x14'),_0x3091b3,_0x4814('0x13'),JSON['stringify'](_0x479c2f));if(_0x479c2f['error']){if(_0x479c2f['error'][_0x4814('0x15')]===0x1f4){logger[_0x4814('0x16')](_0x4814('0x12'),_0x3091b3,_0x479c2f[_0x4814('0x16')]['message']);return _0x213f9a(_0x479c2f[_0x4814('0x16')][_0x4814('0x17')]);}logger[_0x4814('0x16')](_0x4814('0x12'),_0x3091b3,_0x479c2f[_0x4814('0x16')]['message']);return _0x38084b(_0x479c2f[_0x4814('0x16')][_0x4814('0x17')]);}else{logger[_0x4814('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3091b3,_0x4814('0x13'));_0x38084b(_0x479c2f[_0x4814('0x19')]['message']);}})[_0x4814('0x1a')](function(_0x82f711){logger['error'](_0x4814('0x12'),_0x3091b3,_0x82f711);_0x213f9a(_0x82f711);});});}exports[_0x4814('0x1b')]=function(_0x712f5a){var _0x5a19bd=this;return new Promise(function(_0x22febf,_0x460fa5){return db[_0x4814('0x1c')][_0x4814('0x1d')](_0x712f5a[_0x4814('0x1e')],{'raw':_0x712f5a[_0x4814('0x1f')]?_0x712f5a[_0x4814('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4814('0x20')](function(_0x225204){logger[_0x4814('0x18')](_0x4814('0x1b'),_0x712f5a);logger[_0x4814('0x21')](_0x4814('0x1b'),_0x712f5a,JSON['stringify'](_0x225204));_0x22febf(_0x225204);})[_0x4814('0x1a')](function(_0x46f600){logger[_0x4814('0x16')](_0x4814('0x1b'),_0x46f600['message'],_0x712f5a);_0x460fa5(_0x5a19bd[_0x4814('0x16')](0x1f4,_0x46f600[_0x4814('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 42447b9..c2e7c20 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b51=['emit','length','smsMessage:','./smsMessage.events','remove'];(function(_0x54b315,_0x5286ce){var _0x237a6b=function(_0x1c68b2){while(--_0x1c68b2){_0x54b315['push'](_0x54b315['shift']());}};_0x237a6b(++_0x5286ce);}(_0x5b51,0x7b));var _0x15b5=function(_0x5addf7,_0x50785e){_0x5addf7=_0x5addf7-0x0;var _0xb0746a=_0x5b51[_0x5addf7];return _0xb0746a;};'use strict';var SmsMessageEvents=require(_0x15b5('0x0'));var events=['save',_0x15b5('0x1'),'update'];function createListener(_0x3a1283,_0x29ce92){return function(_0x40a181){_0x29ce92[_0x15b5('0x2')](_0x3a1283,_0x40a181);};}function removeListener(_0x54b89d,_0x52918e){return function(){SmsMessageEvents['removeListener'](_0x54b89d,_0x52918e);};}exports['register']=function(_0x306264){for(var _0xd956a3=0x0,_0x58cd34=events[_0x15b5('0x3')];_0xd956a3<_0x58cd34;_0xd956a3++){var _0x28a03a=events[_0xd956a3];var _0x3dcd3f=createListener(_0x15b5('0x4')+_0x28a03a,_0x306264);SmsMessageEvents['on'](_0x28a03a,_0x3dcd3f);}}; \ No newline at end of file +var _0x0851=['save','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x316c6d,_0x111353){var _0x353452=function(_0x4a3ad4){while(--_0x4a3ad4){_0x316c6d['push'](_0x316c6d['shift']());}};_0x353452(++_0x111353);}(_0x0851,0x17f));var _0x1085=function(_0x2d56ef,_0x399c70){_0x2d56ef=_0x2d56ef-0x0;var _0x29b4ca=_0x0851[_0x2d56ef];return _0x29b4ca;};'use strict';var SmsMessageEvents=require(_0x1085('0x0'));var events=[_0x1085('0x1'),'remove',_0x1085('0x2')];function createListener(_0x3375bd,_0x33d0cc){return function(_0x1894a7){_0x33d0cc[_0x1085('0x3')](_0x3375bd,_0x1894a7);};}function removeListener(_0xb06a16,_0x57cdad){return function(){SmsMessageEvents[_0x1085('0x4')](_0xb06a16,_0x57cdad);};}exports[_0x1085('0x5')]=function(_0x4d250e){for(var _0x1fcff0=0x0,_0x507748=events[_0x1085('0x6')];_0x1fcff0<_0x507748;_0x1fcff0++){var _0x573b2a=events[_0x1fcff0];var _0x1d9173=createListener(_0x1085('0x7')+_0x573b2a,_0x4d250e);SmsMessageEvents['on'](_0x573b2a,_0x1d9173);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index a9f05a5..7adb834 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30a9=['post','create','addTeams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x30a9,0x82));var _0x930a=function(_0x37fa53,_0x52c1ef){_0x37fa53=_0x37fa53-0x0;var _0x1831a2=_0x30a9[_0x37fa53];return _0x1831a2;};'use strict';var multer=require('multer');var util=require(_0x930a('0x0'));var path=require(_0x930a('0x1'));var timeout=require(_0x930a('0x2'));var express=require(_0x930a('0x3'));var router=express[_0x930a('0x4')]();var fs_extra=require(_0x930a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x930a('0x6'));var config=require(_0x930a('0x7'));var controller=require(_0x930a('0x8'));router[_0x930a('0x9')]('/',auth[_0x930a('0xa')](),controller[_0x930a('0xb')]);router[_0x930a('0x9')](_0x930a('0xc'),auth[_0x930a('0xa')](),controller['describe']);router[_0x930a('0x9')](_0x930a('0xd'),auth[_0x930a('0xa')](),controller[_0x930a('0xe')]);router[_0x930a('0x9')](_0x930a('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x930a('0x9')](_0x930a('0x10'),auth[_0x930a('0xa')](),controller[_0x930a('0x11')]);router[_0x930a('0x9')](_0x930a('0x12'),auth['isAuthenticated'](),controller[_0x930a('0x13')]);router[_0x930a('0x14')]('/',auth[_0x930a('0xa')](),controller[_0x930a('0x15')]);router[_0x930a('0x14')]('/:id/teams',auth[_0x930a('0xa')](),controller[_0x930a('0x16')]);router[_0x930a('0x14')](_0x930a('0x12'),auth['isAuthenticated'](),controller[_0x930a('0x17')]);router[_0x930a('0x18')](_0x930a('0xd'),auth[_0x930a('0xa')](),controller[_0x930a('0x19')]);router['delete'](_0x930a('0xd'),auth['isAuthenticated'](),controller[_0x930a('0x1a')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x930a('0x1b')]);router[_0x930a('0x1c')]('/:id/users',auth[_0x930a('0xa')](),controller[_0x930a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x2f0f=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy'];(function(_0x1a7bd0,_0x284aad){var _0x235a7a=function(_0x391fd1){while(--_0x391fd1){_0x1a7bd0['push'](_0x1a7bd0['shift']());}};_0x235a7a(++_0x284aad);}(_0x2f0f,0xf3));var _0xf2f0=function(_0x2ced4f,_0x3e2bec){_0x2ced4f=_0x2ced4f-0x0;var _0x4cf01a=_0x2f0f[_0x2ced4f];return _0x4cf01a;};'use strict';var multer=require(_0xf2f0('0x0'));var util=require(_0xf2f0('0x1'));var path=require(_0xf2f0('0x2'));var timeout=require(_0xf2f0('0x3'));var express=require('express');var router=express[_0xf2f0('0x4')]();var fs_extra=require(_0xf2f0('0x5'));var auth=require(_0xf2f0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf2f0('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf2f0('0x8')]);router[_0xf2f0('0x9')](_0xf2f0('0xa'),auth[_0xf2f0('0xb')](),controller['describe']);router[_0xf2f0('0x9')](_0xf2f0('0xc'),auth['isAuthenticated'](),controller[_0xf2f0('0xd')]);router[_0xf2f0('0x9')](_0xf2f0('0xe'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0xf')]);router[_0xf2f0('0x9')](_0xf2f0('0x10'),auth['isAuthenticated'](),controller[_0xf2f0('0x11')]);router['get'](_0xf2f0('0x12'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x13')]);router[_0xf2f0('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf2f0('0x14')](_0xf2f0('0x10'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x15')]);router[_0xf2f0('0x14')]('/:id/users',auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x16')]);router[_0xf2f0('0x17')](_0xf2f0('0xc'),auth['isAuthenticated'](),controller[_0xf2f0('0x18')]);router[_0xf2f0('0x19')](_0xf2f0('0xc'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x1a')]);router[_0xf2f0('0x19')](_0xf2f0('0x10'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x1b')]);router[_0xf2f0('0x19')](_0xf2f0('0x12'),auth[_0xf2f0('0xb')](),controller[_0xf2f0('0x1c')]);module[_0xf2f0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index a1fac6b..08db09b 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb687=['STRING','name','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x54b127,_0x17d816){var _0x5523e3=function(_0x511a7e){while(--_0x511a7e){_0x54b127['push'](_0x54b127['shift']());}};_0x5523e3(++_0x17d816);}(_0xb687,0x91));var _0x7b68=function(_0xbd2fbc,_0x294d5b){_0xbd2fbc=_0xbd2fbc-0x0;var _0x60b8fa=_0xb687[_0xbd2fbc];return _0x60b8fa;};'use strict';var Sequelize=require(_0x7b68('0x0'));module[_0x7b68('0x1')]={'name':{'type':Sequelize[_0x7b68('0x2')],'unique':_0x7b68('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b68('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b68('0x4')](_0x7b68('0x5'),_0x7b68('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x3801=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x3801,0x14e));var _0x1380=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x3801[_0x119d25];return _0x39cf30;};'use strict';var Sequelize=require(_0x1380('0x0'));module[_0x1380('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1380('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1380('0x3')]},'timeout':{'type':Sequelize[_0x1380('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1380('0x5')]('rrmemory',_0x1380('0x6'),_0x1380('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a391f7b..d22009d 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc405=['catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x4c6765,_0x20b7c3){var _0x54eb6d=function(_0x21eed5){while(--_0x21eed5){_0x4c6765['push'](_0x4c6765['shift']());}};_0x54eb6d(++_0x20b7c3);}(_0xc405,0x1f2));var _0x5c40=function(_0x3d1807,_0x4fabc2){_0x3d1807=_0x3d1807-0x0;var _0x2b15c0=_0xc405[_0x3d1807];return _0x2b15c0;};'use strict';var emlformat=require(_0x5c40('0x0'));var rimraf=require(_0x5c40('0x1'));var zipdir=require(_0x5c40('0x2'));var jsonpatch=require(_0x5c40('0x3'));var rp=require(_0x5c40('0x4'));var moment=require(_0x5c40('0x5'));var BPromise=require(_0x5c40('0x6'));var Mustache=require(_0x5c40('0x7'));var util=require(_0x5c40('0x8'));var path=require(_0x5c40('0x9'));var sox=require(_0x5c40('0xa'));var csv=require(_0x5c40('0xb'));var ejs=require(_0x5c40('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c40('0xd'));var squel=require(_0x5c40('0xe'));var crypto=require(_0x5c40('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5c40('0x10'));var toCsv=require(_0x5c40('0xb'));var querystring=require(_0x5c40('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c40('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5c40('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c40('0x14'))(_0x5c40('0x15'));var utils=require(_0x5c40('0x16'));var config=require(_0x5c40('0x17'));var licenseUtil=require(_0x5c40('0x18'));var db=require(_0x5c40('0x19'))['db'];config[_0x5c40('0x1a')]=_[_0x5c40('0x1b')](config[_0x5c40('0x1a')],{'host':_0x5c40('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c40('0x1a')]));require(_0x5c40('0x1d'))[_0x5c40('0x1e')](socket);function respondWithStatusCode(_0x172ced,_0x4295c7){_0x4295c7=_0x4295c7||0xcc;return function(_0x514412){if(_0x514412){return _0x172ced[_0x5c40('0x1f')](_0x4295c7);}return _0x172ced['status'](_0x4295c7)[_0x5c40('0x20')]();};}function respondWithResult(_0x2051ec,_0x5ea901){_0x5ea901=_0x5ea901||0xc8;return function(_0x133811){if(_0x133811){return _0x2051ec[_0x5c40('0x21')](_0x5ea901)[_0x5c40('0x22')](_0x133811);}};}function respondWithFilteredResult(_0x63145e,_0x162e6e){return function(_0x1dc5fb){if(_0x1dc5fb){var _0x3d54c0=typeof _0x162e6e[_0x5c40('0x23')]===_0x5c40('0x24')&&typeof _0x162e6e[_0x5c40('0x25')]===_0x5c40('0x24');var _0x5e8cdb=_0x1dc5fb[_0x5c40('0x26')];var _0x1f8e41=_0x3d54c0?0x0:_0x162e6e[_0x5c40('0x23')];var _0x3657b1=_0x3d54c0?_0x1dc5fb[_0x5c40('0x26')]:_0x162e6e[_0x5c40('0x23')]+_0x162e6e[_0x5c40('0x25')];var _0x7a86ab;if(_0x3657b1>=_0x5e8cdb){_0x3657b1=_0x5e8cdb;_0x7a86ab=0xc8;}else{_0x7a86ab=0xce;}_0x63145e[_0x5c40('0x21')](_0x7a86ab);return _0x63145e['set']('Content-Range',_0x1f8e41+'-'+_0x3657b1+'/'+_0x5e8cdb)[_0x5c40('0x22')](_0x1dc5fb);}return null;};}function patchUpdates(_0x1717bc){return function(_0x1a531e){try{jsonpatch[_0x5c40('0x27')](_0x1a531e,_0x1717bc,!![]);}catch(_0x5311ca){return BPromise[_0x5c40('0x28')](_0x5311ca);}return _0x1a531e['save']();};}function saveUpdates(_0xb4abb0,_0x27e442){return function(_0xd138b7){if(_0xd138b7){return _0xd138b7[_0x5c40('0x29')](_0xb4abb0)[_0x5c40('0x2a')](function(_0x58f409){return _0x58f409;});}return null;};}function removeEntity(_0x1bd2b8,_0x564914){return function(_0x176973){if(_0x176973){return _0x176973[_0x5c40('0x2b')]()[_0x5c40('0x2a')](function(){var _0x354d92=_0x176973[_0x5c40('0x2c')]({'plain':!![]});var _0x85e1c4=_0x5c40('0x2d');return db[_0x5c40('0x2e')][_0x5c40('0x2b')]({'where':{'type':_0x85e1c4,'resourceId':_0x354d92['id']}})['then'](function(){return _0x176973;});})['then'](function(){_0x1bd2b8[_0x5c40('0x21')](0xcc)[_0x5c40('0x20')]();});}};}function handleEntityNotFound(_0x4c7b3f,_0x370b39){return function(_0x58fd81){if(!_0x58fd81){_0x4c7b3f[_0x5c40('0x1f')](0x194);}return _0x58fd81;};}function handleError(_0x3a8226,_0x3f0235){_0x3f0235=_0x3f0235||0x1f4;return function(_0x546c43){logger['error'](_0x546c43[_0x5c40('0x2f')]);if(_0x546c43['name']){delete _0x546c43[_0x5c40('0x30')];}_0x3a8226[_0x5c40('0x21')](_0x3f0235)[_0x5c40('0x31')](_0x546c43);};}exports[_0x5c40('0x32')]=function(_0x5f48cf,_0x6255e1){var _0x4e8e76={},_0x5ef562={},_0x50e8ec={'count':0x0,'rows':[]};var _0x3316ea=_[_0x5c40('0x33')](db[_0x5c40('0x34')][_0x5c40('0x35')],function(_0x40ab6a){return{'name':_0x40ab6a[_0x5c40('0x36')],'type':_0x40ab6a[_0x5c40('0x37')][_0x5c40('0x38')]};});_0x5ef562[_0x5c40('0x39')]=_[_0x5c40('0x33')](_0x3316ea,_0x5c40('0x30'));_0x5ef562[_0x5c40('0x3a')]=_[_0x5c40('0x3b')](_0x5f48cf[_0x5c40('0x3a')]);_0x5ef562[_0x5c40('0x3c')]=_[_0x5c40('0x3d')](_0x5ef562[_0x5c40('0x39')],_0x5ef562['query']);_0x4e8e76[_0x5c40('0x3e')]=_[_0x5c40('0x3d')](_0x5ef562['model'],qs[_0x5c40('0x3f')](_0x5f48cf['query'][_0x5c40('0x3f')]));_0x4e8e76[_0x5c40('0x3e')]=_0x4e8e76['attributes'][_0x5c40('0x40')]?_0x4e8e76['attributes']:_0x5ef562['model'];if(!_0x5f48cf['query'][_0x5c40('0x41')](_0x5c40('0x42'))){_0x4e8e76[_0x5c40('0x25')]=qs[_0x5c40('0x25')](_0x5f48cf[_0x5c40('0x3a')][_0x5c40('0x25')]);_0x4e8e76[_0x5c40('0x23')]=qs[_0x5c40('0x23')](_0x5f48cf['query'][_0x5c40('0x23')]);}_0x4e8e76[_0x5c40('0x43')]=qs[_0x5c40('0x44')](_0x5f48cf[_0x5c40('0x3a')][_0x5c40('0x44')]);_0x4e8e76[_0x5c40('0x45')]=qs[_0x5c40('0x3c')](_[_0x5c40('0x46')](_0x5f48cf['query'],_0x5ef562[_0x5c40('0x3c')]),_0x3316ea);if(_0x5f48cf[_0x5c40('0x3a')][_0x5c40('0x47')]){_0x4e8e76[_0x5c40('0x45')]=_[_0x5c40('0x48')](_0x4e8e76['where'],{'$or':_['map'](_0x3316ea,function(_0x151ce9){if(_0x151ce9[_0x5c40('0x37')]!==_0x5c40('0x49')){var _0x14d6a3={};_0x14d6a3[_0x151ce9[_0x5c40('0x30')]]={'$like':'%'+_0x5f48cf[_0x5c40('0x3a')]['filter']+'%'};return _0x14d6a3;}})});}_0x4e8e76=_[_0x5c40('0x48')]({},_0x4e8e76,_0x5f48cf[_0x5c40('0x4a')]);var _0x1109fc={'where':_0x4e8e76[_0x5c40('0x45')]};return db[_0x5c40('0x34')]['count'](_0x1109fc)[_0x5c40('0x2a')](function(_0x34c959){_0x50e8ec[_0x5c40('0x26')]=_0x34c959;if(_0x5f48cf['query'][_0x5c40('0x4b')]){_0x4e8e76[_0x5c40('0x4c')]=[{'all':!![]}];}return db[_0x5c40('0x34')][_0x5c40('0x4d')](_0x4e8e76);})[_0x5c40('0x2a')](function(_0x5e3355){_0x50e8ec['rows']=_0x5e3355;return _0x50e8ec;})[_0x5c40('0x2a')](respondWithFilteredResult(_0x6255e1,_0x4e8e76))[_0x5c40('0x4e')](handleError(_0x6255e1,null));};exports[_0x5c40('0x4f')]=function(_0xf4557c,_0x23d89d){var _0x24d0a4={'raw':!![],'where':{'id':_0xf4557c['params']['id']}},_0x4240f7={};_0x4240f7['model']=_[_0x5c40('0x3b')](db['SmsQueue'][_0x5c40('0x35')]);_0x4240f7[_0x5c40('0x3a')]=_[_0x5c40('0x3b')](_0xf4557c[_0x5c40('0x3a')]);_0x4240f7[_0x5c40('0x3c')]=_['intersection'](_0x4240f7['model'],_0x4240f7[_0x5c40('0x3a')]);_0x24d0a4['attributes']=_[_0x5c40('0x3d')](_0x4240f7[_0x5c40('0x39')],qs[_0x5c40('0x3f')](_0xf4557c[_0x5c40('0x3a')][_0x5c40('0x3f')]));_0x24d0a4['attributes']=_0x24d0a4[_0x5c40('0x3e')][_0x5c40('0x40')]?_0x24d0a4[_0x5c40('0x3e')]:_0x4240f7[_0x5c40('0x39')];if(_0xf4557c[_0x5c40('0x3a')][_0x5c40('0x4b')]){_0x24d0a4['include']=[{'all':!![]}];}_0x24d0a4=_[_0x5c40('0x48')]({},_0x24d0a4,_0xf4557c[_0x5c40('0x4a')]);return db[_0x5c40('0x34')][_0x5c40('0x50')](_0x24d0a4)['then'](handleEntityNotFound(_0x23d89d,null))[_0x5c40('0x2a')](respondWithResult(_0x23d89d,null))[_0x5c40('0x4e')](handleError(_0x23d89d,null));};exports['create']=function(_0xfb2bd0,_0x2df8d7){return db[_0x5c40('0x34')][_0x5c40('0x51')](_0xfb2bd0[_0x5c40('0x52')],{})[_0x5c40('0x2a')](function(_0x24b21b){var _0x1fbef9=_0xfb2bd0[_0x5c40('0x53')]['get']({'plain':!![]});if(!_0x1fbef9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fbef9[_0x5c40('0x54')]==='user'){var _0x226372=_0x24b21b[_0x5c40('0x2c')]({'plain':!![]});var _0x40f0bb=_0x5c40('0x2d');return db[_0x5c40('0x55')]['find']({'where':{'name':_0x40f0bb,'userProfileId':_0x1fbef9[_0x5c40('0x56')]},'raw':!![]})[_0x5c40('0x2a')](function(_0xd1837){if(_0xd1837&&_0xd1837[_0x5c40('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x226372[_0x5c40('0x30')],'resourceId':_0x226372['id'],'type':_0xd1837[_0x5c40('0x30')],'sectionId':_0xd1837['id']},{})[_0x5c40('0x2a')](function(){return _0x24b21b;});}else{return _0x24b21b;}})[_0x5c40('0x4e')](function(_0xcfa287){logger[_0x5c40('0x58')](_0x5c40('0x59'),_0xcfa287);throw _0xcfa287;});}return _0x24b21b;})[_0x5c40('0x2a')](respondWithResult(_0x2df8d7,0xc9))[_0x5c40('0x4e')](handleError(_0x2df8d7,null));};exports[_0x5c40('0x29')]=function(_0x2664dc,_0x58000a){if(_0x2664dc[_0x5c40('0x52')]['id']){delete _0x2664dc[_0x5c40('0x52')]['id'];}return db[_0x5c40('0x34')]['find']({'where':{'id':_0x2664dc[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x58000a,null))['then'](saveUpdates(_0x2664dc[_0x5c40('0x52')],null))['then'](respondWithResult(_0x58000a,null))[_0x5c40('0x4e')](handleError(_0x58000a,null));};exports['destroy']=function(_0xa54667,_0x51ebf0){return db[_0x5c40('0x34')][_0x5c40('0x50')]({'where':{'id':_0xa54667[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x51ebf0,null))[_0x5c40('0x2a')](removeEntity(_0x51ebf0,null))[_0x5c40('0x4e')](handleError(_0x51ebf0,null));};exports[_0x5c40('0x5b')]=function(_0x335fe5,_0x4cc0b3){return db[_0x5c40('0x34')][_0x5c40('0x5b')]()[_0x5c40('0x2a')](respondWithResult(_0x4cc0b3,null))[_0x5c40('0x4e')](handleError(_0x4cc0b3,null));};exports[_0x5c40('0x5c')]=function(_0x31f511,_0x4fc224,_0x395774){var _0x1232f7={'raw':!![],'where':{}},_0x542901={},_0x5170bd;return db[_0x5c40('0x34')][_0x5c40('0x5d')]({'where':{'id':_0x31f511[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x4fc224,null))[_0x5c40('0x2a')](function(_0x36fc7d){if(_0x36fc7d){_0x5170bd=_0x36fc7d[_0x5c40('0x2c')]({'plain':!![]});_0x542901['model']=_['keys'](db[_0x5c40('0x5e')][_0x5c40('0x35')]);_0x542901[_0x5c40('0x3a')]=_['keys'](_0x31f511[_0x5c40('0x3a')]);_0x542901[_0x5c40('0x3c')]=_['intersection'](_0x542901[_0x5c40('0x39')],_0x542901[_0x5c40('0x3a')]);_0x1232f7[_0x5c40('0x3e')]=_[_0x5c40('0x3d')](_0x542901['model'],qs[_0x5c40('0x3f')](_0x31f511[_0x5c40('0x3a')][_0x5c40('0x3f')]));_0x1232f7[_0x5c40('0x3e')]=_0x1232f7[_0x5c40('0x3e')]['length']?_0x1232f7[_0x5c40('0x3e')]:_0x542901[_0x5c40('0x39')];if(!_0x31f511['query'][_0x5c40('0x41')]('nolimit')){_0x1232f7[_0x5c40('0x25')]=qs['limit'](_0x31f511[_0x5c40('0x3a')][_0x5c40('0x25')]);_0x1232f7[_0x5c40('0x23')]=qs['offset'](_0x31f511[_0x5c40('0x3a')]['offset']);}_0x1232f7[_0x5c40('0x43')]=qs[_0x5c40('0x44')](_0x31f511['query'][_0x5c40('0x44')]);_0x1232f7['where']=qs['filters'](_[_0x5c40('0x46')](_0x31f511['query'],_0x542901[_0x5c40('0x3c')]));_0x1232f7['where'][_0x5c40('0x5f')]=_0x36fc7d['id'];if(_0x31f511['query'][_0x5c40('0x47')]){_0x1232f7[_0x5c40('0x45')]=_[_0x5c40('0x48')](_0x1232f7[_0x5c40('0x45')],{'$or':_[_0x5c40('0x33')](_0x1232f7[_0x5c40('0x3e')],function(_0x4f2077){var _0x328c90={};_0x328c90[_0x4f2077]={'$like':'%'+_0x31f511[_0x5c40('0x3a')][_0x5c40('0x47')]+'%'};return _0x328c90;})});}_0x1232f7=_['merge']({},_0x1232f7,_0x31f511[_0x5c40('0x4a')]);return db[_0x5c40('0x5e')][_0x5c40('0x4d')](_0x1232f7);}})[_0x5c40('0x2a')](function(_0x5295fa){if(_0x5295fa){return db[_0x5c40('0x60')][_0x5c40('0x61')]({'where':{'id':_[_0x5c40('0x33')](_0x5295fa,_0x5c40('0x62')),'role':'agent'},'attributes':['id',_0x5c40('0x30'),_0x5c40('0x63'),'updatedAt',_0x5c40('0x64')]});}})['then'](function(_0x46223a){if(_0x46223a){return{'count':_0x46223a[_0x5c40('0x26')],'rows':_['map'](_0x46223a[_0x5c40('0x65')],function(_0x209b4f){return{'membername':_0x209b4f[_0x5c40('0x30')],'UserId':_0x209b4f['id'],'queue_name':_0x5170bd[_0x5c40('0x30')],'SmsQueueId':_0x5170bd['id'],'interface':util['format'](_0x5c40('0x66'),_0x5c40('0x67'),_0x209b4f[_0x5c40('0x30')]),'penalty':0x0,'paused':_0x209b4f[_0x5c40('0x63')],'createdAt':_0x209b4f[_0x5c40('0x64')],'updatedAt':_0x209b4f[_0x5c40('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c40('0x2a')](respondWithFilteredResult(_0x4fc224,_0x1232f7))[_0x5c40('0x4e')](handleError(_0x4fc224,null));};exports[_0x5c40('0x69')]=function(_0x4dcbcb,_0x4f0f03,_0xcafc12){var _0x3e3c98={};var _0x5100db={};var _0x4b5c3e;var _0x21b9c3;return db[_0x5c40('0x34')][_0x5c40('0x5d')]({'where':{'id':_0x4dcbcb[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x4f0f03,null))[_0x5c40('0x2a')](function(_0x2339bc){if(_0x2339bc){_0x4b5c3e=_0x2339bc;_0x5100db[_0x5c40('0x39')]=_['keys'](db[_0x5c40('0x6a')]['rawAttributes']);_0x5100db[_0x5c40('0x3a')]=_[_0x5c40('0x3b')](_0x4dcbcb[_0x5c40('0x3a')]);_0x5100db[_0x5c40('0x3c')]=_[_0x5c40('0x3d')](_0x5100db[_0x5c40('0x39')],_0x5100db[_0x5c40('0x3a')]);_0x3e3c98['attributes']=_[_0x5c40('0x3d')](_0x5100db[_0x5c40('0x39')],qs[_0x5c40('0x3f')](_0x4dcbcb[_0x5c40('0x3a')][_0x5c40('0x3f')]));_0x3e3c98[_0x5c40('0x3e')]=_0x3e3c98[_0x5c40('0x3e')]['length']?_0x3e3c98[_0x5c40('0x3e')]:_0x5100db['model'];_0x3e3c98[_0x5c40('0x43')]=qs[_0x5c40('0x44')](_0x4dcbcb[_0x5c40('0x3a')][_0x5c40('0x44')]);_0x3e3c98[_0x5c40('0x45')]=qs['filters'](_[_0x5c40('0x46')](_0x4dcbcb['query'],_0x5100db[_0x5c40('0x3c')]));if(_0x4dcbcb[_0x5c40('0x3a')][_0x5c40('0x47')]){_0x3e3c98[_0x5c40('0x45')]=_[_0x5c40('0x48')](_0x3e3c98[_0x5c40('0x45')],{'$or':_['map'](_0x3e3c98[_0x5c40('0x3e')],function(_0x56cac8){var _0x9015={};_0x9015[_0x56cac8]={'$like':'%'+_0x4dcbcb[_0x5c40('0x3a')][_0x5c40('0x47')]+'%'};return _0x9015;})});}_0x3e3c98=_[_0x5c40('0x48')]({},_0x3e3c98,_0x4dcbcb[_0x5c40('0x4a')]);return _0x4b5c3e[_0x5c40('0x69')](_0x3e3c98);}})[_0x5c40('0x2a')](function(_0x4f327d){if(_0x4f327d){_0x21b9c3=_0x4f327d[_0x5c40('0x40')];if(!_0x4dcbcb[_0x5c40('0x3a')]['hasOwnProperty'](_0x5c40('0x42'))){_0x3e3c98['limit']=qs[_0x5c40('0x25')](_0x4dcbcb[_0x5c40('0x3a')]['limit']);_0x3e3c98[_0x5c40('0x23')]=qs[_0x5c40('0x23')](_0x4dcbcb[_0x5c40('0x3a')][_0x5c40('0x23')]);}return _0x4b5c3e[_0x5c40('0x69')](_0x3e3c98);}})[_0x5c40('0x2a')](function(_0x3d8b1d){if(_0x3d8b1d){return _0x3d8b1d?{'count':_0x21b9c3,'rows':_0x3d8b1d}:null;}})['then'](respondWithResult(_0x4f0f03,null))[_0x5c40('0x4e')](handleError(_0x4f0f03,null));};exports[_0x5c40('0x6b')]=function(_0x26508b,_0x9d2854,_0x1d4c84){var _0x5eab29=_0x26508b[_0x5c40('0x52')][_0x5c40('0x6c')];return db[_0x5c40('0x6a')][_0x5c40('0x4d')]({'where':{'id':_0x5eab29},'attributes':['id'],'include':[{'model':db[_0x5c40('0x60')],'as':_0x5c40('0x6d'),'attributes':['id',_0x5c40('0x30'),_0x5c40('0x6e'),_0x5c40('0x6f'),_0x5c40('0x70')],'raw':!![]}]})['then'](function(_0x4c93ff){if(_0x4c93ff){var _0x3a0618=_['flatMap'](_0x4c93ff,function(_0x324709){var _0x25048e=_0x324709[_0x5c40('0x2c')]({'plain':!![]});return _0x25048e[_0x5c40('0x6d')];});return db[_0x5c40('0x34')][_0x5c40('0x50')]({'where':{'id':_0x26508b[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](function(_0x5ade97){return db[_0x5c40('0x71')][_0x5c40('0x72')](function(_0x43e481){return _0x5ade97[_0x5c40('0x6b')](_0x5eab29,{'transaction':_0x43e481})[_0x5c40('0x2a')](function(){return BPromise[_0x5c40('0x73')](_0x3a0618,function(_0x147947){return db[_0x5c40('0x5e')][_0x5c40('0x74')]({'where':{'UserId':_0x147947['id'],'SmsQueueId':_0x26508b[_0x5c40('0x5a')]['id']},'transaction':_0x43e481});});})[_0x5c40('0x2a')](function(){_0x3a0618[_0x5c40('0x75')](function(_0x2120e2){socket[_0x5c40('0x76')](_0x5c40('0x77'),{'UserId':_0x2120e2['id'],'SmsQueueId':_0x5ade97['id']});});});});});}})['then'](respondWithStatusCode(_0x9d2854,null))[_0x5c40('0x4e')](handleError(_0x9d2854,null));};exports['removeTeams']=function(_0x54d298,_0x299728,_0x12264e){return db[_0x5c40('0x6a')][_0x5c40('0x4d')]({'where':{'id':_0x54d298[_0x5c40('0x3a')][_0x5c40('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x5c40('0x60')],'as':_0x5c40('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x5c40('0x2a')](handleEntityNotFound(_0x299728,null))[_0x5c40('0x2a')](function(_0x542154){var _0x52e020=_[_0x5c40('0x33')](_0x542154,'id');var _0x306492=[];var _0x46ae83=[];var _0x5f2e2d=squel['select']();_0x5f2e2d[_0x5c40('0x78')](_0x5c40('0x79'))[_0x5c40('0x7a')](_0x5c40('0x7b'),'tq')[_0x5c40('0x7c')]('user_has_teams','ut',_0x5c40('0x7d'))[_0x5c40('0x45')](_0x5c40('0x7e'),_0x54d298[_0x5c40('0x5a')]['id']);for(var _0x28c4eb=0x0;_0x28c4eb<_0x542154['length'];_0x28c4eb+=0x1){let _0x1f46fb=_0x542154[_0x28c4eb];for(var _0x20008a=0x0;_0x20008a<_0x1f46fb[_0x5c40('0x6d')][_0x5c40('0x40')];_0x20008a+=0x1){let _0x38454f=_0x1f46fb['Agents'][_0x20008a];var _0x970523=_0x5f2e2d[_0x5c40('0x7f')]();_0x970523['where']('ut.UserId\x20=\x20?',_0x38454f['id']);_0x46ae83['push'](db[_0x5c40('0x71')][_0x5c40('0x3a')](_0x970523[_0x5c40('0x80')](),{'type':db[_0x5c40('0x71')][_0x5c40('0x81')]['SELECT']})[_0x5c40('0x2a')](function(_0x3d542d){if(_0x3d542d[_0x5c40('0x40')]===0x1){return _0x38454f['id'];}else{var _0x40fbc5=_[_0x5c40('0x82')](_[_0x5c40('0x33')](_0x3d542d,_0x5c40('0x83')),function(_0xebf063){return _[_0x5c40('0x84')](_0x52e020,_0xebf063);});if(_0x40fbc5){return _0x38454f['id'];}}}));}}return BPromise[_0x5c40('0x85')](_0x46ae83)[_0x5c40('0x2a')](function(_0x2b62a8){_0x306492=_(_0x306492)[_0x5c40('0x86')](_0x2b62a8)[_0x5c40('0x87')]()[_0x5c40('0x88')]();return db[_0x5c40('0x34')][_0x5c40('0x50')]({'where':{'id':_0x54d298[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](function(_0x40bd84){return db[_0x5c40('0x71')][_0x5c40('0x72')](function(_0x47e360){return _0x40bd84[_0x5c40('0x89')](_0x54d298['query'][_0x5c40('0x6c')],{'transaction':_0x47e360})[_0x5c40('0x2a')](function(){if(!_['isEmpty'](_0x306492)){return _0x40bd84[_0x5c40('0x8a')](_0x306492,{'transaction':_0x47e360});}})[_0x5c40('0x2a')](function(){_0x306492['forEach'](function(_0x96e388){socket[_0x5c40('0x76')](_0x5c40('0x8b'),{'UserId':_0x96e388,'SmsQueueId':_0x40bd84['id']});});});});});});})['then'](respondWithStatusCode(_0x299728,null))[_0x5c40('0x4e')](handleError(_0x299728,null));};exports[_0x5c40('0x8c')]=function(_0x343b61,_0x481743,_0x19d448){return db['SmsQueue']['find']({'where':{'id':_0x343b61[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x481743,null))[_0x5c40('0x2a')](function(_0x49613a){if(_0x49613a){return _0x49613a[_0x5c40('0x8c')](_0x343b61[_0x5c40('0x52')]['ids'],_[_0x5c40('0x8d')](_0x343b61[_0x5c40('0x52')],[_0x5c40('0x6c'),'id'])||{})['spread'](function(_0x159b58){for(var _0x54ae00=0x0;_0x54ae00<_0x343b61['body'][_0x5c40('0x6c')][_0x5c40('0x40')];_0x54ae00+=0x1){socket[_0x5c40('0x76')](_0x5c40('0x77'),{'UserId':Number(_0x343b61[_0x5c40('0x52')][_0x5c40('0x6c')][_0x54ae00]),'SmsQueueId':Number(_0x343b61[_0x5c40('0x5a')]['id'])});}return _0x159b58;});}})[_0x5c40('0x2a')](respondWithResult(_0x481743,null))[_0x5c40('0x4e')](handleError(_0x481743,null));};exports[_0x5c40('0x8a')]=function(_0x13809d,_0x263bb0,_0x15eba7){return db[_0x5c40('0x34')][_0x5c40('0x50')]({'where':{'id':_0x13809d[_0x5c40('0x5a')]['id']}})[_0x5c40('0x2a')](handleEntityNotFound(_0x263bb0,null))[_0x5c40('0x2a')](function(_0x4c8a23){if(_0x4c8a23){return _0x4c8a23[_0x5c40('0x8a')](_0x13809d[_0x5c40('0x3a')][_0x5c40('0x6c')])[_0x5c40('0x2a')](function(){if(_[_0x5c40('0x8e')](_0x13809d[_0x5c40('0x3a')][_0x5c40('0x6c')])){for(var _0x4e67e2=0x0;_0x4e67e2<_0x13809d[_0x5c40('0x3a')][_0x5c40('0x6c')]['length'];_0x4e67e2+=0x1){socket[_0x5c40('0x76')]('userSmsQueue:remove',{'UserId':Number(_0x13809d['query'][_0x5c40('0x6c')][_0x4e67e2]),'SmsQueueId':Number(_0x13809d[_0x5c40('0x5a')]['id'])});}}else{socket[_0x5c40('0x76')](_0x5c40('0x8b'),{'UserId':Number(_0x13809d['query'][_0x5c40('0x6c')]),'SmsQueueId':Number(_0x13809d[_0x5c40('0x5a')]['id'])});}});}})[_0x5c40('0x2a')](respondWithStatusCode(_0x263bb0,null))[_0x5c40('0x4e')](handleError(_0x263bb0,null));};exports[_0x5c40('0x8f')]=function(_0x27eca5,_0x5232a4,_0x2581c4){var _0x5f2eb1={};var _0x573188={};var _0x53088c;var _0x1312e9;return db['SmsQueue']['findOne']({'where':{'id':_0x27eca5[_0x5c40('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5232a4,null))[_0x5c40('0x2a')](function(_0x540637){if(_0x540637){_0x53088c=_0x540637;_0x573188[_0x5c40('0x39')]=_[_0x5c40('0x3b')](db[_0x5c40('0x60')][_0x5c40('0x35')]);_0x573188[_0x5c40('0x3a')]=_[_0x5c40('0x3b')](_0x27eca5[_0x5c40('0x3a')]);_0x573188[_0x5c40('0x3c')]=_[_0x5c40('0x3d')](_0x573188[_0x5c40('0x39')],_0x573188[_0x5c40('0x3a')]);_0x5f2eb1[_0x5c40('0x3e')]=_[_0x5c40('0x3d')](_0x573188['model'],qs[_0x5c40('0x3f')](_0x27eca5[_0x5c40('0x3a')][_0x5c40('0x3f')]));_0x5f2eb1[_0x5c40('0x3e')]=_0x5f2eb1[_0x5c40('0x3e')]['length']?_0x5f2eb1[_0x5c40('0x3e')]:_0x573188[_0x5c40('0x39')];_0x5f2eb1[_0x5c40('0x43')]=qs['sort'](_0x27eca5[_0x5c40('0x3a')]['sort']);_0x5f2eb1[_0x5c40('0x45')]=qs['filters'](_[_0x5c40('0x46')](_0x27eca5[_0x5c40('0x3a')],_0x573188[_0x5c40('0x3c')]));if(_0x27eca5['query'][_0x5c40('0x47')]){_0x5f2eb1['where']=_[_0x5c40('0x48')](_0x5f2eb1[_0x5c40('0x45')],{'$or':_[_0x5c40('0x33')](_0x5f2eb1[_0x5c40('0x3e')],function(_0x32c10c){var _0x2de31c={};_0x2de31c[_0x32c10c]={'$like':'%'+_0x27eca5['query']['filter']+'%'};return _0x2de31c;})});}_0x5f2eb1=_[_0x5c40('0x48')]({},_0x5f2eb1,_0x27eca5[_0x5c40('0x4a')]);return _0x53088c[_0x5c40('0x8f')](_0x5f2eb1);}})[_0x5c40('0x2a')](function(_0x4c64bd){if(_0x4c64bd){_0x1312e9=_0x4c64bd['length'];if(!_0x27eca5[_0x5c40('0x3a')][_0x5c40('0x41')]('nolimit')){_0x5f2eb1['limit']=qs[_0x5c40('0x25')](_0x27eca5[_0x5c40('0x3a')]['limit']);_0x5f2eb1['offset']=qs[_0x5c40('0x23')](_0x27eca5[_0x5c40('0x3a')][_0x5c40('0x23')]);}return _0x53088c[_0x5c40('0x8f')](_0x5f2eb1);}})[_0x5c40('0x2a')](function(_0x42bdab){if(_0x42bdab){return _0x42bdab?{'count':_0x1312e9,'rows':_0x42bdab}:null;}})[_0x5c40('0x2a')](respondWithResult(_0x5232a4,null))[_0x5c40('0x4e')](handleError(_0x5232a4,null));}; \ No newline at end of file +var _0x66fa=['QueryTypes','SELECT','TeamId','includes','all','value','removeTeams','isEmpty','forEach','userSmsQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserSmsQueue','pick','SmsQueueId','User','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','getTeams','findOne','order','addTeams','ids','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x5d1213,_0x4f98eb){var _0x125f63=function(_0x4bcbcf){while(--_0x4bcbcf){_0x5d1213['push'](_0x5d1213['shift']());}};_0x125f63(++_0x4f98eb);}(_0x66fa,0x126));var _0xa66f=function(_0x4e82c7,_0x4b1e32){_0x4e82c7=_0x4e82c7-0x0;var _0x169548=_0x66fa[_0x4e82c7];return _0x169548;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require('request-promise');var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x7'));var ejs=require(_0xa66f('0x8'));var fs=require('fs');var fs_extra=require(_0xa66f('0x9'));var _=require(_0xa66f('0xa'));var squel=require(_0xa66f('0xb'));var crypto=require(_0xa66f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xd'));var toCsv=require(_0xa66f('0x7'));var querystring=require(_0xa66f('0xe'));var Papa=require('papaparse');var Redis=require(_0xa66f('0xf'));var authService=require(_0xa66f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa66f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa66f('0x12'))(_0xa66f('0x13'));var utils=require(_0xa66f('0x14'));var config=require(_0xa66f('0x15'));var licenseUtil=require(_0xa66f('0x16'));var db=require(_0xa66f('0x17'))['db'];config[_0xa66f('0x18')]=_['defaults'](config[_0xa66f('0x18')],{'host':_0xa66f('0x19'),'port':0x18eb});var socket=require(_0xa66f('0x1a'))(new Redis(config[_0xa66f('0x18')]));require(_0xa66f('0x1b'))[_0xa66f('0x1c')](socket);function respondWithStatusCode(_0x3ea225,_0x1cac2){_0x1cac2=_0x1cac2||0xcc;return function(_0x348a2d){if(_0x348a2d){return _0x3ea225[_0xa66f('0x1d')](_0x1cac2);}return _0x3ea225[_0xa66f('0x1e')](_0x1cac2)[_0xa66f('0x1f')]();};}function respondWithResult(_0x3a79cc,_0x2ee0ac){_0x2ee0ac=_0x2ee0ac||0xc8;return function(_0x4145d9){if(_0x4145d9){return _0x3a79cc[_0xa66f('0x1e')](_0x2ee0ac)[_0xa66f('0x20')](_0x4145d9);}};}function respondWithFilteredResult(_0x59f8a1,_0x51219f){return function(_0x4cc2bc){if(_0x4cc2bc){var _0x14bd36=typeof _0x51219f[_0xa66f('0x21')]==='undefined'&&typeof _0x51219f[_0xa66f('0x22')]==='undefined';var _0x1209f0=_0x4cc2bc['count'];var _0x8da4b3=_0x14bd36?0x0:_0x51219f[_0xa66f('0x21')];var _0x131aad=_0x14bd36?_0x4cc2bc[_0xa66f('0x23')]:_0x51219f[_0xa66f('0x21')]+_0x51219f[_0xa66f('0x22')];var _0x56816;if(_0x131aad>=_0x1209f0){_0x131aad=_0x1209f0;_0x56816=0xc8;}else{_0x56816=0xce;}_0x59f8a1[_0xa66f('0x1e')](_0x56816);return _0x59f8a1[_0xa66f('0x24')]('Content-Range',_0x8da4b3+'-'+_0x131aad+'/'+_0x1209f0)[_0xa66f('0x20')](_0x4cc2bc);}return null;};}function patchUpdates(_0x1650eb){return function(_0x109699){try{jsonpatch[_0xa66f('0x25')](_0x109699,_0x1650eb,!![]);}catch(_0x50bd5e){return BPromise[_0xa66f('0x26')](_0x50bd5e);}return _0x109699[_0xa66f('0x27')]();};}function saveUpdates(_0x3c93a3,_0x4971c2){return function(_0x1ca863){if(_0x1ca863){return _0x1ca863[_0xa66f('0x28')](_0x3c93a3)[_0xa66f('0x29')](function(_0x366eba){return _0x366eba;});}return null;};}function removeEntity(_0x5b028a,_0x260531){return function(_0x21f9bc){if(_0x21f9bc){return _0x21f9bc['destroy']()['then'](function(){var _0x5af007=_0x21f9bc['get']({'plain':!![]});var _0x432bd7=_0xa66f('0x2a');return db[_0xa66f('0x2b')][_0xa66f('0x2c')]({'where':{'type':_0x432bd7,'resourceId':_0x5af007['id']}})['then'](function(){return _0x21f9bc;});})[_0xa66f('0x29')](function(){_0x5b028a[_0xa66f('0x1e')](0xcc)[_0xa66f('0x1f')]();});}};}function handleEntityNotFound(_0xd6d3cd,_0x8e822){return function(_0x9971c1){if(!_0x9971c1){_0xd6d3cd[_0xa66f('0x1d')](0x194);}return _0x9971c1;};}function handleError(_0x48f85b,_0x267fe2){_0x267fe2=_0x267fe2||0x1f4;return function(_0x3e5765){logger[_0xa66f('0x2d')](_0x3e5765[_0xa66f('0x2e')]);if(_0x3e5765[_0xa66f('0x2f')]){delete _0x3e5765[_0xa66f('0x2f')];}_0x48f85b[_0xa66f('0x1e')](_0x267fe2)['send'](_0x3e5765);};}exports[_0xa66f('0x30')]=function(_0x3fd3a4,_0x12933f){var _0x3b1b14={},_0x24ce6d={},_0x39afe3={'count':0x0,'rows':[]};var _0x2e71f8=_[_0xa66f('0x31')](db[_0xa66f('0x32')][_0xa66f('0x33')],function(_0x592903){return{'name':_0x592903[_0xa66f('0x34')],'type':_0x592903[_0xa66f('0x35')][_0xa66f('0x36')]};});_0x24ce6d[_0xa66f('0x37')]=_[_0xa66f('0x31')](_0x2e71f8,_0xa66f('0x2f'));_0x24ce6d[_0xa66f('0x38')]=_['keys'](_0x3fd3a4[_0xa66f('0x38')]);_0x24ce6d[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x24ce6d[_0xa66f('0x37')],_0x24ce6d[_0xa66f('0x38')]);_0x3b1b14[_0xa66f('0x3b')]=_[_0xa66f('0x3a')](_0x24ce6d[_0xa66f('0x37')],qs[_0xa66f('0x3c')](_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x3c')]));_0x3b1b14['attributes']=_0x3b1b14['attributes'][_0xa66f('0x3d')]?_0x3b1b14[_0xa66f('0x3b')]:_0x24ce6d[_0xa66f('0x37')];if(!_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x3e')](_0xa66f('0x3f'))){_0x3b1b14[_0xa66f('0x22')]=qs[_0xa66f('0x22')](_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x22')]);_0x3b1b14[_0xa66f('0x21')]=qs[_0xa66f('0x21')](_0x3fd3a4[_0xa66f('0x38')]['offset']);}_0x3b1b14['order']=qs['sort'](_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x40')]);_0x3b1b14[_0xa66f('0x41')]=qs[_0xa66f('0x39')](_['pick'](_0x3fd3a4[_0xa66f('0x38')],_0x24ce6d[_0xa66f('0x39')]),_0x2e71f8);if(_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x42')]){_0x3b1b14['where']=_[_0xa66f('0x43')](_0x3b1b14[_0xa66f('0x41')],{'$or':_[_0xa66f('0x31')](_0x2e71f8,function(_0x3c3a70){if(_0x3c3a70[_0xa66f('0x35')]!==_0xa66f('0x44')){var _0xc5770a={};_0xc5770a[_0x3c3a70[_0xa66f('0x2f')]]={'$like':'%'+_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x42')]+'%'};return _0xc5770a;}})});}_0x3b1b14=_[_0xa66f('0x43')]({},_0x3b1b14,_0x3fd3a4[_0xa66f('0x45')]);var _0x41d176={'where':_0x3b1b14['where']};return db[_0xa66f('0x32')]['count'](_0x41d176)[_0xa66f('0x29')](function(_0x85931e){_0x39afe3[_0xa66f('0x23')]=_0x85931e;if(_0x3fd3a4[_0xa66f('0x38')][_0xa66f('0x46')]){_0x3b1b14[_0xa66f('0x47')]=[{'all':!![]}];}return db[_0xa66f('0x32')][_0xa66f('0x48')](_0x3b1b14);})[_0xa66f('0x29')](function(_0x2979b1){_0x39afe3[_0xa66f('0x49')]=_0x2979b1;return _0x39afe3;})[_0xa66f('0x29')](respondWithFilteredResult(_0x12933f,_0x3b1b14))[_0xa66f('0x4a')](handleError(_0x12933f,null));};exports['show']=function(_0x20bc37,_0x32e076){var _0x50bae4={'raw':!![],'where':{'id':_0x20bc37['params']['id']}},_0x146404={};_0x146404[_0xa66f('0x37')]=_[_0xa66f('0x4b')](db['SmsQueue'][_0xa66f('0x33')]);_0x146404['query']=_[_0xa66f('0x4b')](_0x20bc37[_0xa66f('0x38')]);_0x146404['filters']=_[_0xa66f('0x3a')](_0x146404[_0xa66f('0x37')],_0x146404[_0xa66f('0x38')]);_0x50bae4[_0xa66f('0x3b')]=_[_0xa66f('0x3a')](_0x146404[_0xa66f('0x37')],qs[_0xa66f('0x3c')](_0x20bc37['query'][_0xa66f('0x3c')]));_0x50bae4[_0xa66f('0x3b')]=_0x50bae4[_0xa66f('0x3b')]['length']?_0x50bae4[_0xa66f('0x3b')]:_0x146404[_0xa66f('0x37')];if(_0x20bc37[_0xa66f('0x38')]['includeAll']){_0x50bae4[_0xa66f('0x47')]=[{'all':!![]}];}_0x50bae4=_['merge']({},_0x50bae4,_0x20bc37[_0xa66f('0x45')]);return db['SmsQueue'][_0xa66f('0x4c')](_0x50bae4)[_0xa66f('0x29')](handleEntityNotFound(_0x32e076,null))[_0xa66f('0x29')](respondWithResult(_0x32e076,null))[_0xa66f('0x4a')](handleError(_0x32e076,null));};exports['create']=function(_0x21f53b,_0x1ac86b){return db[_0xa66f('0x32')][_0xa66f('0x4d')](_0x21f53b[_0xa66f('0x4e')],{})['then'](function(_0x2b479a){var _0x2eb76a=_0x21f53b[_0xa66f('0x4f')][_0xa66f('0x50')]({'plain':!![]});if(!_0x2eb76a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eb76a[_0xa66f('0x51')]===_0xa66f('0x4f')){var _0x4b4276=_0x2b479a['get']({'plain':!![]});var _0x1931b3='SmsQueues';return db[_0xa66f('0x52')][_0xa66f('0x4c')]({'where':{'name':_0x1931b3,'userProfileId':_0x2eb76a[_0xa66f('0x53')]},'raw':!![]})[_0xa66f('0x29')](function(_0x591e1d){if(_0x591e1d&&_0x591e1d[_0xa66f('0x54')]===0x0){return db[_0xa66f('0x2b')]['create']({'name':_0x4b4276[_0xa66f('0x2f')],'resourceId':_0x4b4276['id'],'type':_0x591e1d[_0xa66f('0x2f')],'sectionId':_0x591e1d['id']},{})[_0xa66f('0x29')](function(){return _0x2b479a;});}else{return _0x2b479a;}})['catch'](function(_0x36d041){logger[_0xa66f('0x2d')](_0xa66f('0x55'),_0x36d041);throw _0x36d041;});}return _0x2b479a;})[_0xa66f('0x29')](respondWithResult(_0x1ac86b,0xc9))['catch'](handleError(_0x1ac86b,null));};exports[_0xa66f('0x28')]=function(_0x3a2574,_0x1d2e12){if(_0x3a2574['body']['id']){delete _0x3a2574[_0xa66f('0x4e')]['id'];}return db[_0xa66f('0x32')]['find']({'where':{'id':_0x3a2574[_0xa66f('0x56')]['id']}})[_0xa66f('0x29')](handleEntityNotFound(_0x1d2e12,null))[_0xa66f('0x29')](saveUpdates(_0x3a2574[_0xa66f('0x4e')],null))[_0xa66f('0x29')](respondWithResult(_0x1d2e12,null))[_0xa66f('0x4a')](handleError(_0x1d2e12,null));};exports['destroy']=function(_0x1863ec,_0x2bc202){return db[_0xa66f('0x32')]['find']({'where':{'id':_0x1863ec[_0xa66f('0x56')]['id']}})[_0xa66f('0x29')](handleEntityNotFound(_0x2bc202,null))['then'](removeEntity(_0x2bc202,null))[_0xa66f('0x4a')](handleError(_0x2bc202,null));};exports[_0xa66f('0x57')]=function(_0x4fd7fe,_0x3e22a8){return db[_0xa66f('0x32')][_0xa66f('0x57')]()[_0xa66f('0x29')](respondWithResult(_0x3e22a8,null))[_0xa66f('0x4a')](handleError(_0x3e22a8,null));};exports[_0xa66f('0x58')]=function(_0x190877,_0x353887,_0x14e26b){var _0x25c2a4={'raw':!![],'where':{}},_0x582c4b={},_0x911e38;return db[_0xa66f('0x32')]['findOne']({'where':{'id':_0x190877[_0xa66f('0x56')]['id']}})['then'](handleEntityNotFound(_0x353887,null))['then'](function(_0x4a230b){if(_0x4a230b){_0x911e38=_0x4a230b[_0xa66f('0x50')]({'plain':!![]});_0x582c4b[_0xa66f('0x37')]=_['keys'](db[_0xa66f('0x59')][_0xa66f('0x33')]);_0x582c4b[_0xa66f('0x38')]=_[_0xa66f('0x4b')](_0x190877['query']);_0x582c4b[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x582c4b[_0xa66f('0x37')],_0x582c4b[_0xa66f('0x38')]);_0x25c2a4[_0xa66f('0x3b')]=_[_0xa66f('0x3a')](_0x582c4b[_0xa66f('0x37')],qs[_0xa66f('0x3c')](_0x190877[_0xa66f('0x38')][_0xa66f('0x3c')]));_0x25c2a4['attributes']=_0x25c2a4[_0xa66f('0x3b')][_0xa66f('0x3d')]?_0x25c2a4['attributes']:_0x582c4b[_0xa66f('0x37')];if(!_0x190877[_0xa66f('0x38')][_0xa66f('0x3e')](_0xa66f('0x3f'))){_0x25c2a4[_0xa66f('0x22')]=qs[_0xa66f('0x22')](_0x190877['query'][_0xa66f('0x22')]);_0x25c2a4[_0xa66f('0x21')]=qs['offset'](_0x190877[_0xa66f('0x38')]['offset']);}_0x25c2a4['order']=qs[_0xa66f('0x40')](_0x190877[_0xa66f('0x38')][_0xa66f('0x40')]);_0x25c2a4[_0xa66f('0x41')]=qs[_0xa66f('0x39')](_[_0xa66f('0x5a')](_0x190877[_0xa66f('0x38')],_0x582c4b[_0xa66f('0x39')]));_0x25c2a4['where'][_0xa66f('0x5b')]=_0x4a230b['id'];if(_0x190877['query'][_0xa66f('0x42')]){_0x25c2a4['where']=_[_0xa66f('0x43')](_0x25c2a4[_0xa66f('0x41')],{'$or':_[_0xa66f('0x31')](_0x25c2a4[_0xa66f('0x3b')],function(_0x400c7c){var _0x57f610={};_0x57f610[_0x400c7c]={'$like':'%'+_0x190877[_0xa66f('0x38')][_0xa66f('0x42')]+'%'};return _0x57f610;})});}_0x25c2a4=_[_0xa66f('0x43')]({},_0x25c2a4,_0x190877[_0xa66f('0x45')]);return db[_0xa66f('0x59')][_0xa66f('0x48')](_0x25c2a4);}})['then'](function(_0x56841f){if(_0x56841f){return db[_0xa66f('0x5c')]['findAndCountAll']({'where':{'id':_[_0xa66f('0x31')](_0x56841f,_0xa66f('0x5d')),'role':_0xa66f('0x5e')},'attributes':['id',_0xa66f('0x2f'),_0xa66f('0x5f'),'updatedAt',_0xa66f('0x60')]});}})[_0xa66f('0x29')](function(_0x50677c){if(_0x50677c){return{'count':_0x50677c[_0xa66f('0x23')],'rows':_[_0xa66f('0x31')](_0x50677c[_0xa66f('0x49')],function(_0x5b7f59){return{'membername':_0x5b7f59[_0xa66f('0x2f')],'UserId':_0x5b7f59['id'],'queue_name':_0x911e38[_0xa66f('0x2f')],'SmsQueueId':_0x911e38['id'],'interface':util[_0xa66f('0x61')](_0xa66f('0x62'),_0xa66f('0x63'),_0x5b7f59[_0xa66f('0x2f')]),'penalty':0x0,'paused':_0x5b7f59[_0xa66f('0x5f')],'createdAt':_0x5b7f59['createdAt'],'updatedAt':_0x5b7f59['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa66f('0x29')](respondWithFilteredResult(_0x353887,_0x25c2a4))['catch'](handleError(_0x353887,null));};exports[_0xa66f('0x64')]=function(_0x983048,_0x30013b,_0x3d82e6){var _0x35c424={};var _0x537b59={};var _0x3385a6;var _0x2d3a6b;return db['SmsQueue'][_0xa66f('0x65')]({'where':{'id':_0x983048[_0xa66f('0x56')]['id']}})[_0xa66f('0x29')](handleEntityNotFound(_0x30013b,null))[_0xa66f('0x29')](function(_0x1b1566){if(_0x1b1566){_0x3385a6=_0x1b1566;_0x537b59['model']=_[_0xa66f('0x4b')](db['Team']['rawAttributes']);_0x537b59[_0xa66f('0x38')]=_[_0xa66f('0x4b')](_0x983048[_0xa66f('0x38')]);_0x537b59[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x537b59['model'],_0x537b59[_0xa66f('0x38')]);_0x35c424['attributes']=_['intersection'](_0x537b59[_0xa66f('0x37')],qs[_0xa66f('0x3c')](_0x983048[_0xa66f('0x38')][_0xa66f('0x3c')]));_0x35c424[_0xa66f('0x3b')]=_0x35c424[_0xa66f('0x3b')]['length']?_0x35c424[_0xa66f('0x3b')]:_0x537b59[_0xa66f('0x37')];_0x35c424[_0xa66f('0x66')]=qs[_0xa66f('0x40')](_0x983048[_0xa66f('0x38')][_0xa66f('0x40')]);_0x35c424[_0xa66f('0x41')]=qs[_0xa66f('0x39')](_[_0xa66f('0x5a')](_0x983048['query'],_0x537b59[_0xa66f('0x39')]));if(_0x983048[_0xa66f('0x38')]['filter']){_0x35c424[_0xa66f('0x41')]=_['merge'](_0x35c424[_0xa66f('0x41')],{'$or':_[_0xa66f('0x31')](_0x35c424[_0xa66f('0x3b')],function(_0x56d7d8){var _0x21ef09={};_0x21ef09[_0x56d7d8]={'$like':'%'+_0x983048['query'][_0xa66f('0x42')]+'%'};return _0x21ef09;})});}_0x35c424=_[_0xa66f('0x43')]({},_0x35c424,_0x983048['options']);return _0x3385a6[_0xa66f('0x64')](_0x35c424);}})[_0xa66f('0x29')](function(_0x1c079e){if(_0x1c079e){_0x2d3a6b=_0x1c079e[_0xa66f('0x3d')];if(!_0x983048[_0xa66f('0x38')]['hasOwnProperty'](_0xa66f('0x3f'))){_0x35c424[_0xa66f('0x22')]=qs[_0xa66f('0x22')](_0x983048['query'][_0xa66f('0x22')]);_0x35c424[_0xa66f('0x21')]=qs[_0xa66f('0x21')](_0x983048[_0xa66f('0x38')][_0xa66f('0x21')]);}return _0x3385a6['getTeams'](_0x35c424);}})[_0xa66f('0x29')](function(_0x30a1b6){if(_0x30a1b6){return _0x30a1b6?{'count':_0x2d3a6b,'rows':_0x30a1b6}:null;}})[_0xa66f('0x29')](respondWithResult(_0x30013b,null))[_0xa66f('0x4a')](handleError(_0x30013b,null));};exports[_0xa66f('0x67')]=function(_0x6f7256,_0x5663a2,_0x289bae){var _0x56b136=_0x6f7256[_0xa66f('0x4e')][_0xa66f('0x68')];return db[_0xa66f('0x69')][_0xa66f('0x48')]({'where':{'id':_0x56b136},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5c')],'as':'Agents','attributes':['id',_0xa66f('0x2f'),'online',_0xa66f('0x6a'),_0xa66f('0x6b')],'raw':!![]}]})[_0xa66f('0x29')](function(_0x4fe46d){if(_0x4fe46d){var _0x5ac2c4=_[_0xa66f('0x6c')](_0x4fe46d,function(_0x27e59a){var _0x5cf27c=_0x27e59a['get']({'plain':!![]});return _0x5cf27c[_0xa66f('0x6d')];});return db['SmsQueue']['find']({'where':{'id':_0x6f7256['params']['id']}})['then'](function(_0x36ab04){return db[_0xa66f('0x6e')][_0xa66f('0x6f')](function(_0x438837){return _0x36ab04[_0xa66f('0x67')](_0x56b136,{'transaction':_0x438837})[_0xa66f('0x29')](function(){return BPromise[_0xa66f('0x70')](_0x5ac2c4,function(_0x355120){return db[_0xa66f('0x59')][_0xa66f('0x71')]({'where':{'UserId':_0x355120['id'],'SmsQueueId':_0x6f7256['params']['id']},'transaction':_0x438837});});})[_0xa66f('0x29')](function(){_0x5ac2c4['forEach'](function(_0x432043){socket[_0xa66f('0x72')](_0xa66f('0x73'),{'UserId':_0x432043['id'],'SmsQueueId':_0x36ab04['id']});});});});});}})[_0xa66f('0x29')](respondWithStatusCode(_0x5663a2,null))[_0xa66f('0x4a')](handleError(_0x5663a2,null));};exports['removeTeams']=function(_0x16365e,_0x45b1dd,_0x484a08){return db[_0xa66f('0x69')]['findAll']({'where':{'id':_0x16365e['query'][_0xa66f('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5c')],'as':_0xa66f('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa66f('0x29')](handleEntityNotFound(_0x45b1dd,null))[_0xa66f('0x29')](function(_0x4e40a4){var _0x1897e3=_[_0xa66f('0x31')](_0x4e40a4,'id');var _0x384a76=[];var _0xc0fcbb=[];var _0x601880=squel[_0xa66f('0x74')]();_0x601880['field'](_0xa66f('0x75'))[_0xa66f('0x76')](_0xa66f('0x77'),'tq')[_0xa66f('0x78')]('user_has_teams','ut',_0xa66f('0x79'))[_0xa66f('0x41')]('SmsQueueId\x20=\x20?',_0x16365e[_0xa66f('0x56')]['id']);for(var _0x52864a=0x0;_0x52864a<_0x4e40a4['length'];_0x52864a+=0x1){let _0x43f8d0=_0x4e40a4[_0x52864a];for(var _0x5ee442=0x0;_0x5ee442<_0x43f8d0[_0xa66f('0x6d')][_0xa66f('0x3d')];_0x5ee442+=0x1){let _0x3a4f30=_0x43f8d0[_0xa66f('0x6d')][_0x5ee442];var _0x39d6d6=_0x601880[_0xa66f('0x7a')]();_0x39d6d6[_0xa66f('0x41')](_0xa66f('0x7b'),_0x3a4f30['id']);_0xc0fcbb[_0xa66f('0x7c')](db[_0xa66f('0x6e')][_0xa66f('0x38')](_0x39d6d6[_0xa66f('0x7d')](),{'type':db[_0xa66f('0x6e')][_0xa66f('0x7e')][_0xa66f('0x7f')]})[_0xa66f('0x29')](function(_0x106cea){if(_0x106cea[_0xa66f('0x3d')]===0x1){return _0x3a4f30['id'];}else{var _0x1e0cfe=_['every'](_[_0xa66f('0x31')](_0x106cea,_0xa66f('0x80')),function(_0x527286){return _[_0xa66f('0x81')](_0x1897e3,_0x527286);});if(_0x1e0cfe){return _0x3a4f30['id'];}}}));}}return BPromise[_0xa66f('0x82')](_0xc0fcbb)['then'](function(_0x4d8d80){_0x384a76=_(_0x384a76)['union'](_0x4d8d80)['compact']()[_0xa66f('0x83')]();return db['SmsQueue'][_0xa66f('0x4c')]({'where':{'id':_0x16365e[_0xa66f('0x56')]['id']}})['then'](function(_0xedd93d){return db['sequelize'][_0xa66f('0x6f')](function(_0x111bd1){return _0xedd93d[_0xa66f('0x84')](_0x16365e[_0xa66f('0x38')]['ids'],{'transaction':_0x111bd1})[_0xa66f('0x29')](function(){if(!_[_0xa66f('0x85')](_0x384a76)){return _0xedd93d['removeAgents'](_0x384a76,{'transaction':_0x111bd1});}})['then'](function(){_0x384a76[_0xa66f('0x86')](function(_0x15406e){socket[_0xa66f('0x72')](_0xa66f('0x87'),{'UserId':_0x15406e,'SmsQueueId':_0xedd93d['id']});});});});});});})[_0xa66f('0x29')](respondWithStatusCode(_0x45b1dd,null))[_0xa66f('0x4a')](handleError(_0x45b1dd,null));};exports[_0xa66f('0x88')]=function(_0x427322,_0x4ab6e6,_0x31decb){return db['SmsQueue'][_0xa66f('0x4c')]({'where':{'id':_0x427322[_0xa66f('0x56')]['id']}})[_0xa66f('0x29')](handleEntityNotFound(_0x4ab6e6,null))['then'](function(_0x310f00){if(_0x310f00){return _0x310f00[_0xa66f('0x88')](_0x427322[_0xa66f('0x4e')]['ids'],_['omit'](_0x427322[_0xa66f('0x4e')],[_0xa66f('0x68'),'id'])||{})[_0xa66f('0x89')](function(_0x22dfdd){for(var _0x39ec49=0x0;_0x39ec49<_0x427322['body']['ids'][_0xa66f('0x3d')];_0x39ec49+=0x1){socket['emit'](_0xa66f('0x73'),{'UserId':Number(_0x427322[_0xa66f('0x4e')][_0xa66f('0x68')][_0x39ec49]),'SmsQueueId':Number(_0x427322[_0xa66f('0x56')]['id'])});}return _0x22dfdd;});}})[_0xa66f('0x29')](respondWithResult(_0x4ab6e6,null))['catch'](handleError(_0x4ab6e6,null));};exports[_0xa66f('0x8a')]=function(_0x594a06,_0x37d82f,_0x1e40b5){return db[_0xa66f('0x32')][_0xa66f('0x4c')]({'where':{'id':_0x594a06[_0xa66f('0x56')]['id']}})[_0xa66f('0x29')](handleEntityNotFound(_0x37d82f,null))[_0xa66f('0x29')](function(_0x38f2dc){if(_0x38f2dc){return _0x38f2dc[_0xa66f('0x8a')](_0x594a06[_0xa66f('0x38')][_0xa66f('0x68')])[_0xa66f('0x29')](function(){if(_['isArray'](_0x594a06[_0xa66f('0x38')][_0xa66f('0x68')])){for(var _0x484b84=0x0;_0x484b84<_0x594a06[_0xa66f('0x38')][_0xa66f('0x68')][_0xa66f('0x3d')];_0x484b84+=0x1){socket[_0xa66f('0x72')](_0xa66f('0x87'),{'UserId':Number(_0x594a06[_0xa66f('0x38')]['ids'][_0x484b84]),'SmsQueueId':Number(_0x594a06[_0xa66f('0x56')]['id'])});}}else{socket[_0xa66f('0x72')](_0xa66f('0x87'),{'UserId':Number(_0x594a06['query'][_0xa66f('0x68')]),'SmsQueueId':Number(_0x594a06[_0xa66f('0x56')]['id'])});}});}})[_0xa66f('0x29')](respondWithStatusCode(_0x37d82f,null))['catch'](handleError(_0x37d82f,null));};exports[_0xa66f('0x8b')]=function(_0x49b862,_0x2d421b,_0xa5547c){var _0x4f0458={};var _0x115d00={};var _0xcd1ee6;var _0xd64e64;return db['SmsQueue'][_0xa66f('0x65')]({'where':{'id':_0x49b862[_0xa66f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d421b,null))[_0xa66f('0x29')](function(_0x4bcd19){if(_0x4bcd19){_0xcd1ee6=_0x4bcd19;_0x115d00[_0xa66f('0x37')]=_[_0xa66f('0x4b')](db[_0xa66f('0x5c')][_0xa66f('0x33')]);_0x115d00[_0xa66f('0x38')]=_[_0xa66f('0x4b')](_0x49b862[_0xa66f('0x38')]);_0x115d00[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x115d00[_0xa66f('0x37')],_0x115d00['query']);_0x4f0458[_0xa66f('0x3b')]=_[_0xa66f('0x3a')](_0x115d00[_0xa66f('0x37')],qs[_0xa66f('0x3c')](_0x49b862[_0xa66f('0x38')][_0xa66f('0x3c')]));_0x4f0458['attributes']=_0x4f0458[_0xa66f('0x3b')][_0xa66f('0x3d')]?_0x4f0458[_0xa66f('0x3b')]:_0x115d00['model'];_0x4f0458[_0xa66f('0x66')]=qs[_0xa66f('0x40')](_0x49b862[_0xa66f('0x38')]['sort']);_0x4f0458['where']=qs[_0xa66f('0x39')](_[_0xa66f('0x5a')](_0x49b862['query'],_0x115d00[_0xa66f('0x39')]));if(_0x49b862['query'][_0xa66f('0x42')]){_0x4f0458[_0xa66f('0x41')]=_[_0xa66f('0x43')](_0x4f0458[_0xa66f('0x41')],{'$or':_[_0xa66f('0x31')](_0x4f0458['attributes'],function(_0x50130c){var _0x5e24ac={};_0x5e24ac[_0x50130c]={'$like':'%'+_0x49b862['query'][_0xa66f('0x42')]+'%'};return _0x5e24ac;})});}_0x4f0458=_[_0xa66f('0x43')]({},_0x4f0458,_0x49b862[_0xa66f('0x45')]);return _0xcd1ee6[_0xa66f('0x8b')](_0x4f0458);}})[_0xa66f('0x29')](function(_0x209f1b){if(_0x209f1b){_0xd64e64=_0x209f1b[_0xa66f('0x3d')];if(!_0x49b862[_0xa66f('0x38')]['hasOwnProperty']('nolimit')){_0x4f0458[_0xa66f('0x22')]=qs[_0xa66f('0x22')](_0x49b862['query']['limit']);_0x4f0458['offset']=qs[_0xa66f('0x21')](_0x49b862['query'][_0xa66f('0x21')]);}return _0xcd1ee6[_0xa66f('0x8b')](_0x4f0458);}})[_0xa66f('0x29')](function(_0xd607d9){if(_0xd607d9){return _0xd607d9?{'count':_0xd64e64,'rows':_0xd607d9}:null;}})[_0xa66f('0x29')](respondWithResult(_0x2d421b,null))[_0xa66f('0x4a')](handleError(_0x2d421b,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 48f5ecf..9d0e9ec 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72d=['save','remove','emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x31cd81,_0x7970c9){var _0x181491=function(_0x49213f){while(--_0x49213f){_0x31cd81['push'](_0x31cd81['shift']());}};_0x181491(++_0x7970c9);}(_0xf72d,0xbc));var _0xdf72=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xf72d[_0x519756];return _0x37047e;};'use strict';var EventEmitter=require(_0xdf72('0x0'));var SmsQueue=require(_0xdf72('0x1'))['db'][_0xdf72('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xdf72('0x3')](0x0);var events={'afterCreate':_0xdf72('0x4'),'afterUpdate':'update','afterDestroy':_0xdf72('0x5')};function emitEvent(_0x590f75){return function(_0x4131bd,_0x874473,_0x57e9f5){SmsQueueEvents[_0xdf72('0x6')](_0x590f75+':'+_0x4131bd['id'],_0x4131bd);SmsQueueEvents[_0xdf72('0x6')](_0x590f75,_0x4131bd);_0x57e9f5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xdf72('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xee19=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5999ba,_0x97b26a){var _0x2140b5=function(_0x23b3fb){while(--_0x23b3fb){_0x5999ba['push'](_0x5999ba['shift']());}};_0x2140b5(++_0x97b26a);}(_0xee19,0xdb));var _0x9ee1=function(_0x5bb3e5,_0x11b489){_0x5bb3e5=_0x5bb3e5-0x0;var _0x2abfc6=_0xee19[_0x5bb3e5];return _0x2abfc6;};'use strict';var EventEmitter=require(_0x9ee1('0x0'));var SmsQueue=require(_0x9ee1('0x1'))['db'][_0x9ee1('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9ee1('0x3')](0x0);var events={'afterCreate':_0x9ee1('0x4'),'afterUpdate':_0x9ee1('0x5'),'afterDestroy':_0x9ee1('0x6')};function emitEvent(_0x2f52d5){return function(_0x44ba41,_0x165bd5,_0x3eb1f2){SmsQueueEvents[_0x9ee1('0x7')](_0x2f52d5+':'+_0x44ba41['id'],_0x44ba41);SmsQueueEvents[_0x9ee1('0x7')](_0x2f52d5,_0x44ba41);_0x3eb1f2(null);};}for(var e in events){if(events[_0x9ee1('0x8')](e)){var event=events[e];SmsQueue[_0x9ee1('0x9')](e,emitEvent(event));}}module[_0x9ee1('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b750c28..9d91117 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8486=['SmsQueue','sms_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1055d3,_0x5dce87){var _0x55b24a=function(_0x559f0a){while(--_0x559f0a){_0x1055d3['push'](_0x1055d3['shift']());}};_0x55b24a(++_0x5dce87);}(_0x8486,0x92));var _0x6848=function(_0x5c03f2,_0x3b1c3f){_0x5c03f2=_0x5c03f2-0x0;var _0x2730f6=_0x8486[_0x5c03f2];return _0x2730f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6848('0x0'))(_0x6848('0x1'));var moment=require(_0x6848('0x2'));var BPromise=require(_0x6848('0x3'));var rp=require(_0x6848('0x4'));var fs=require('fs');var path=require(_0x6848('0x5'));var rimraf=require(_0x6848('0x6'));var config=require(_0x6848('0x7'));var attributes=require('./smsQueue.attributes');module[_0x6848('0x8')]=function(_0x2586fc,_0x207ad2){return _0x2586fc[_0x6848('0x9')](_0x6848('0xa'),attributes,{'tableName':_0x6848('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38bf=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x1cf03d,_0x3c18d4){var _0x509304=function(_0x5ef8fa){while(--_0x5ef8fa){_0x1cf03d['push'](_0x1cf03d['shift']());}};_0x509304(++_0x3c18d4);}(_0x38bf,0x1ee));var _0xf38b=function(_0x4023ab,_0x31484c){_0x4023ab=_0x4023ab-0x0;var _0x4b7569=_0x38bf[_0x4023ab];return _0x4b7569;};'use strict';var _=require(_0xf38b('0x0'));var util=require(_0xf38b('0x1'));var logger=require(_0xf38b('0x2'))(_0xf38b('0x3'));var moment=require(_0xf38b('0x4'));var BPromise=require('bluebird');var rp=require(_0xf38b('0x5'));var fs=require('fs');var path=require(_0xf38b('0x6'));var rimraf=require(_0xf38b('0x7'));var config=require(_0xf38b('0x8'));var attributes=require(_0xf38b('0x9'));module[_0xf38b('0xa')]=function(_0x27df2d,_0x381c62){return _0x27df2d[_0xf38b('0xb')](_0xf38b('0xc'),attributes,{'tableName':_0xf38b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 57a468a..b452ae5 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0667=['SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include','map','model','then','catch','ShowSmsQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request'];(function(_0xca6e04,_0x3ee563){var _0x1c30db=function(_0x156d49){while(--_0x156d49){_0xca6e04['push'](_0xca6e04['shift']());}};_0x1c30db(++_0x3ee563);}(_0x0667,0x114));var _0x7066=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0667[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x7066('0x0'));var moment=require(_0x7066('0x1'));var BPromise=require(_0x7066('0x2'));var rs=require(_0x7066('0x3'));var fs=require('fs');var Redis=require(_0x7066('0x4'));var db=require(_0x7066('0x5'))['db'];var utils=require(_0x7066('0x6'));var logger=require(_0x7066('0x7'))(_0x7066('0x8'));var config=require('../../config/environment');var jayson=require(_0x7066('0x9'));var client=jayson[_0x7066('0xa')]['http']({'port':0x232a});config[_0x7066('0xb')]=_[_0x7066('0xc')](config[_0x7066('0xb')],{'host':_0x7066('0xd'),'port':0x18eb});var socket=require(_0x7066('0xe'))(new Redis(config['redis']));require(_0x7066('0xf'))[_0x7066('0x10')](socket);function respondWithRpcPromise(_0x106818,_0x3157c4,_0x23a4e9){return new BPromise(function(_0x522866,_0x45373c){return client[_0x7066('0x11')](_0x106818,_0x23a4e9)['then'](function(_0x25ddf2){logger['info'](_0x7066('0x12'),_0x3157c4,_0x7066('0x13'));logger[_0x7066('0x14')](_0x7066('0x15'),_0x3157c4,'request\x20sent',JSON[_0x7066('0x16')](_0x25ddf2));if(_0x25ddf2[_0x7066('0x17')]){if(_0x25ddf2['error'][_0x7066('0x18')]===0x1f4){logger[_0x7066('0x17')](_0x7066('0x12'),_0x3157c4,_0x25ddf2[_0x7066('0x17')][_0x7066('0x19')]);return _0x45373c(_0x25ddf2[_0x7066('0x17')][_0x7066('0x19')]);}logger['error'](_0x7066('0x12'),_0x3157c4,_0x25ddf2[_0x7066('0x17')][_0x7066('0x19')]);return _0x522866(_0x25ddf2[_0x7066('0x17')][_0x7066('0x19')]);}else{logger[_0x7066('0x1a')](_0x7066('0x12'),_0x3157c4,'request\x20sent');_0x522866(_0x25ddf2[_0x7066('0x1b')][_0x7066('0x19')]);}})['catch'](function(_0x13cf33){logger[_0x7066('0x17')](_0x7066('0x12'),_0x3157c4,_0x13cf33);_0x45373c(_0x13cf33);});});}exports[_0x7066('0x1c')]=function(_0x3a3cb3){var _0xf5ead2=this;return new Promise(function(_0xcf318,_0x54563b){return db[_0x7066('0x1d')][_0x7066('0x1e')]({'raw':_0x3a3cb3[_0x7066('0x1f')]?_0x3a3cb3[_0x7066('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3a3cb3['options']?_0x3a3cb3['options'][_0x7066('0x20')]||null:null,'attributes':_0x3a3cb3[_0x7066('0x1f')]?_0x3a3cb3[_0x7066('0x1f')][_0x7066('0x21')]||null:null,'limit':_0x3a3cb3[_0x7066('0x1f')]?_0x3a3cb3['options']['limit']||null:null,'include':_0x3a3cb3[_0x7066('0x1f')]?_0x3a3cb3['options'][_0x7066('0x22')]?_[_0x7066('0x23')](_0x3a3cb3['options'][_0x7066('0x22')],function(_0x26b6dd){return{'model':db[_0x26b6dd['model']],'as':_0x26b6dd['as'],'attributes':_0x26b6dd['attributes'],'include':_0x26b6dd[_0x7066('0x22')]?_[_0x7066('0x23')](_0x26b6dd[_0x7066('0x22')],function(_0x2a38b5){return{'model':db[_0x2a38b5[_0x7066('0x24')]],'as':_0x2a38b5['as'],'attributes':_0x2a38b5[_0x7066('0x21')],'include':_0x2a38b5[_0x7066('0x22')]?_[_0x7066('0x23')](_0x2a38b5['include'],function(_0x5c0b59){return{'model':db[_0x5c0b59[_0x7066('0x24')]],'as':_0x5c0b59['as'],'attributes':_0x5c0b59[_0x7066('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7066('0x25')](function(_0x487e7c){logger[_0x7066('0x1a')](_0x7066('0x1c'),_0x3a3cb3);logger[_0x7066('0x14')](_0x7066('0x1c'),_0x3a3cb3,JSON[_0x7066('0x16')](_0x487e7c));_0xcf318(_0x487e7c);})[_0x7066('0x26')](function(_0x226cec){logger[_0x7066('0x17')](_0x7066('0x1c'),_0x226cec['message'],_0x3a3cb3);_0x54563b(_0xf5ead2[_0x7066('0x17')](0x1f4,_0x226cec[_0x7066('0x19')]));});});};exports[_0x7066('0x27')]=function(_0x5e71ee){var _0x9b51b7=this;return new Promise(function(_0x2fe138,_0x2102be){return db[_0x7066('0x1d')][_0x7066('0x28')]({'raw':_0x5e71ee[_0x7066('0x1f')]?_0x5e71ee[_0x7066('0x1f')][_0x7066('0x29')]===undefined?!![]:![]:!![],'where':_0x5e71ee[_0x7066('0x1f')]?_0x5e71ee[_0x7066('0x1f')]['where']||null:null,'attributes':_0x5e71ee[_0x7066('0x1f')]?_0x5e71ee[_0x7066('0x1f')][_0x7066('0x21')]||null:null,'include':_0x5e71ee[_0x7066('0x1f')]?_0x5e71ee['options']['include']?_[_0x7066('0x23')](_0x5e71ee['options'][_0x7066('0x22')],function(_0x59e932){return{'model':db[_0x59e932['model']],'as':_0x59e932['as'],'attributes':_0x59e932['attributes'],'include':_0x59e932[_0x7066('0x22')]?_[_0x7066('0x23')](_0x59e932['include'],function(_0x226d66){return{'model':db[_0x226d66[_0x7066('0x24')]],'as':_0x226d66['as'],'attributes':_0x226d66['attributes'],'include':_0x226d66[_0x7066('0x22')]?_[_0x7066('0x23')](_0x226d66[_0x7066('0x22')],function(_0x1bcab4){return{'model':db[_0x1bcab4[_0x7066('0x24')]],'as':_0x1bcab4['as'],'attributes':_0x1bcab4[_0x7066('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xedb89c){logger[_0x7066('0x1a')](_0x7066('0x27'),_0x5e71ee);logger[_0x7066('0x14')]('ShowSmsQueue',_0x5e71ee,JSON[_0x7066('0x16')](_0xedb89c));_0x2fe138(_0xedb89c);})[_0x7066('0x26')](function(_0x196802){logger[_0x7066('0x17')](_0x7066('0x27'),_0x196802[_0x7066('0x19')],_0x5e71ee);_0x2102be(_0x9b51b7['error'](0x1f4,_0x196802[_0x7066('0x19')]));});});}; \ No newline at end of file +var _0xb9ff=['register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','stringify','find','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x3e7175,_0x1602e8){var _0x234233=function(_0x321948){while(--_0x321948){_0x3e7175['push'](_0x3e7175['shift']());}};_0x234233(++_0x1602e8);}(_0xb9ff,0x1a0));var _0xfb9f=function(_0x452516,_0x17f2a9){_0x452516=_0x452516-0x0;var _0x4ff29a=_0xb9ff[_0x452516];return _0x4ff29a;};'use strict';var _=require(_0xfb9f('0x0'));var util=require(_0xfb9f('0x1'));var moment=require('moment');var BPromise=require(_0xfb9f('0x2'));var rs=require(_0xfb9f('0x3'));var fs=require('fs');var Redis=require(_0xfb9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb9f('0x5'));var logger=require(_0xfb9f('0x6'))(_0xfb9f('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb9f('0x8'));var client=jayson[_0xfb9f('0x9')][_0xfb9f('0xa')]({'port':0x232a});config[_0xfb9f('0xb')]=_[_0xfb9f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0xfb9f('0xd')](socket);function respondWithRpcPromise(_0x3dab99,_0x5644ca,_0x3dbaf9){return new BPromise(function(_0x343b1d,_0x2506ba){return client[_0xfb9f('0xe')](_0x3dab99,_0x3dbaf9)[_0xfb9f('0xf')](function(_0x3939e7){logger[_0xfb9f('0x10')]('SmsQueue,\x20%s,\x20%s',_0x5644ca,'request\x20sent');logger[_0xfb9f('0x11')](_0xfb9f('0x12'),_0x5644ca,_0xfb9f('0x13'),JSON['stringify'](_0x3939e7));if(_0x3939e7[_0xfb9f('0x14')]){if(_0x3939e7[_0xfb9f('0x14')][_0xfb9f('0x15')]===0x1f4){logger[_0xfb9f('0x14')]('SmsQueue,\x20%s,\x20%s',_0x5644ca,_0x3939e7['error'][_0xfb9f('0x16')]);return _0x2506ba(_0x3939e7[_0xfb9f('0x14')][_0xfb9f('0x16')]);}logger['error'](_0xfb9f('0x17'),_0x5644ca,_0x3939e7[_0xfb9f('0x14')]['message']);return _0x343b1d(_0x3939e7[_0xfb9f('0x14')][_0xfb9f('0x16')]);}else{logger[_0xfb9f('0x10')](_0xfb9f('0x17'),_0x5644ca,_0xfb9f('0x13'));_0x343b1d(_0x3939e7[_0xfb9f('0x18')][_0xfb9f('0x16')]);}})[_0xfb9f('0x19')](function(_0x3aadf8){logger['error'](_0xfb9f('0x17'),_0x5644ca,_0x3aadf8);_0x2506ba(_0x3aadf8);});});}exports[_0xfb9f('0x1a')]=function(_0x1642e2){var _0xcba6a3=this;return new Promise(function(_0x60cf34,_0x13f5fa){return db[_0xfb9f('0x1b')][_0xfb9f('0x1c')]({'raw':_0x1642e2['options']?_0x1642e2[_0xfb9f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1642e2['options']?_0x1642e2['options'][_0xfb9f('0x1e')]||null:null,'attributes':_0x1642e2[_0xfb9f('0x1d')]?_0x1642e2[_0xfb9f('0x1d')][_0xfb9f('0x1f')]||null:null,'limit':_0x1642e2[_0xfb9f('0x1d')]?_0x1642e2[_0xfb9f('0x1d')][_0xfb9f('0x20')]||null:null,'include':_0x1642e2[_0xfb9f('0x1d')]?_0x1642e2[_0xfb9f('0x1d')][_0xfb9f('0x21')]?_[_0xfb9f('0x22')](_0x1642e2[_0xfb9f('0x1d')]['include'],function(_0x349d65){return{'model':db[_0x349d65[_0xfb9f('0x23')]],'as':_0x349d65['as'],'attributes':_0x349d65[_0xfb9f('0x1f')],'include':_0x349d65['include']?_['map'](_0x349d65[_0xfb9f('0x21')],function(_0x25c827){return{'model':db[_0x25c827[_0xfb9f('0x23')]],'as':_0x25c827['as'],'attributes':_0x25c827[_0xfb9f('0x1f')],'include':_0x25c827[_0xfb9f('0x21')]?_['map'](_0x25c827[_0xfb9f('0x21')],function(_0x2d8d36){return{'model':db[_0x2d8d36[_0xfb9f('0x23')]],'as':_0x2d8d36['as'],'attributes':_0x2d8d36[_0xfb9f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb9f('0xf')](function(_0x30379b){logger[_0xfb9f('0x10')](_0xfb9f('0x1a'),_0x1642e2);logger[_0xfb9f('0x11')](_0xfb9f('0x1a'),_0x1642e2,JSON[_0xfb9f('0x24')](_0x30379b));_0x60cf34(_0x30379b);})[_0xfb9f('0x19')](function(_0x68223c){logger['error'](_0xfb9f('0x1a'),_0x68223c[_0xfb9f('0x16')],_0x1642e2);_0x13f5fa(_0xcba6a3['error'](0x1f4,_0x68223c[_0xfb9f('0x16')]));});});};exports['ShowSmsQueue']=function(_0x575573){var _0x41d5d4=this;return new Promise(function(_0x4d2e90,_0x29663e){return db['SmsQueue'][_0xfb9f('0x25')]({'raw':_0x575573['options']?_0x575573[_0xfb9f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x575573['options']?_0x575573[_0xfb9f('0x1d')][_0xfb9f('0x1e')]||null:null,'attributes':_0x575573['options']?_0x575573[_0xfb9f('0x1d')][_0xfb9f('0x1f')]||null:null,'include':_0x575573[_0xfb9f('0x1d')]?_0x575573[_0xfb9f('0x1d')][_0xfb9f('0x21')]?_['map'](_0x575573[_0xfb9f('0x1d')]['include'],function(_0xce89cc){return{'model':db[_0xce89cc[_0xfb9f('0x23')]],'as':_0xce89cc['as'],'attributes':_0xce89cc[_0xfb9f('0x1f')],'include':_0xce89cc[_0xfb9f('0x21')]?_[_0xfb9f('0x22')](_0xce89cc[_0xfb9f('0x21')],function(_0x25075f){return{'model':db[_0x25075f[_0xfb9f('0x23')]],'as':_0x25075f['as'],'attributes':_0x25075f[_0xfb9f('0x1f')],'include':_0x25075f[_0xfb9f('0x21')]?_['map'](_0x25075f['include'],function(_0x551cd1){return{'model':db[_0x551cd1['model']],'as':_0x551cd1['as'],'attributes':_0x551cd1[_0xfb9f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb9f('0xf')](function(_0x23cd48){logger[_0xfb9f('0x10')]('ShowSmsQueue',_0x575573);logger[_0xfb9f('0x11')](_0xfb9f('0x26'),_0x575573,JSON['stringify'](_0x23cd48));_0x4d2e90(_0x23cd48);})[_0xfb9f('0x19')](function(_0x555023){logger['error'](_0xfb9f('0x26'),_0x555023[_0xfb9f('0x16')],_0x575573);_0x29663e(_0x41d5d4[_0xfb9f('0x14')](0x1f4,_0x555023[_0xfb9f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index e33111c..fd4cd2f 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62e3=['register','length','save','remove','emit','removeListener'];(function(_0x1544aa,_0x58ec5f){var _0x403ec3=function(_0x206030){while(--_0x206030){_0x1544aa['push'](_0x1544aa['shift']());}};_0x403ec3(++_0x58ec5f);}(_0x62e3,0x1b8));var _0x362e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62e3[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x362e('0x0'),_0x362e('0x1'),'update'];function createListener(_0x40b77c,_0x2c2b84){return function(_0x1fc043){_0x2c2b84[_0x362e('0x2')](_0x40b77c,_0x1fc043);};}function removeListener(_0x232059,_0x1fcf15){return function(){SmsQueueEvents[_0x362e('0x3')](_0x232059,_0x1fcf15);};}exports[_0x362e('0x4')]=function(_0x2479d8){for(var _0x2fd82a=0x0,_0x5d2788=events[_0x362e('0x5')];_0x2fd82a<_0x5d2788;_0x2fd82a++){var _0x5e2cf7=events[_0x2fd82a];var _0x53b212=createListener('smsQueue:'+_0x5e2cf7,_0x2479d8);SmsQueueEvents['on'](_0x5e2cf7,_0x53b212);}}; \ No newline at end of file +var _0x9c85=['removeListener','register','length','./smsQueue.events','save','emit'];(function(_0x2d3cf4,_0x1ca5da){var _0x2a4c38=function(_0x5aeb65){while(--_0x5aeb65){_0x2d3cf4['push'](_0x2d3cf4['shift']());}};_0x2a4c38(++_0x1ca5da);}(_0x9c85,0x16b));var _0x59c8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9c85[_0x59ee6f];return _0x4c0979;};'use strict';var SmsQueueEvents=require(_0x59c8('0x0'));var events=[_0x59c8('0x1'),'remove','update'];function createListener(_0x3500fc,_0x8d7bb7){return function(_0x2fa9d9){_0x8d7bb7[_0x59c8('0x2')](_0x3500fc,_0x2fa9d9);};}function removeListener(_0xe706e6,_0x328775){return function(){SmsQueueEvents[_0x59c8('0x3')](_0xe706e6,_0x328775);};}exports[_0x59c8('0x4')]=function(_0x981e8e){for(var _0x22d496=0x0,_0x291cec=events[_0x59c8('0x5')];_0x22d496<_0x291cec;_0x22d496++){var _0x365df7=events[_0x22d496];var _0x554895=createListener('smsQueue:'+_0x365df7,_0x981e8e);SmsQueueEvents['on'](_0x365df7,_0x554895);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 926f8c4..05ef7e1 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e41=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x34a5a9,_0x8363c1){var _0x5bf94c=function(_0x575fc6){while(--_0x575fc6){_0x34a5a9['push'](_0x34a5a9['shift']());}};_0x5bf94c(++_0x8363c1);}(_0x2e41,0x15e));var _0x12e4=function(_0xf4356f,_0x478f6d){_0xf4356f=_0xf4356f-0x0;var _0x3c304c=_0x2e41[_0xf4356f];return _0x3c304c;};'use strict';var multer=require(_0x12e4('0x0'));var util=require(_0x12e4('0x1'));var path=require(_0x12e4('0x2'));var timeout=require(_0x12e4('0x3'));var express=require('express');var router=express[_0x12e4('0x4')]();var fs_extra=require(_0x12e4('0x5'));var auth=require(_0x12e4('0x6'));var interaction=require(_0x12e4('0x7'));var config=require(_0x12e4('0x8'));var controller=require(_0x12e4('0x9'));router[_0x12e4('0xa')]('/',auth[_0x12e4('0xb')](),controller['index']);router[_0x12e4('0xa')](_0x12e4('0xc'),auth[_0x12e4('0xb')](),controller[_0x12e4('0xd')]);router[_0x12e4('0xa')](_0x12e4('0xe'),auth[_0x12e4('0xb')](),controller[_0x12e4('0xf')]);router['post']('/',auth[_0x12e4('0xb')](),controller[_0x12e4('0x10')]);router[_0x12e4('0x11')](_0x12e4('0xe'),auth[_0x12e4('0xb')](),controller[_0x12e4('0x12')]);router[_0x12e4('0x13')](_0x12e4('0xe'),auth['isAuthenticated'](),controller[_0x12e4('0x14')]);module[_0x12e4('0x15')]=router; \ No newline at end of file +var _0xce35=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xce35,0x15b));var _0x5ce3=function(_0x2ca80a,_0x1a873e){_0x2ca80a=_0x2ca80a-0x0;var _0x4c65ab=_0xce35[_0x2ca80a];return _0x4c65ab;};'use strict';var multer=require(_0x5ce3('0x0'));var util=require(_0x5ce3('0x1'));var path=require(_0x5ce3('0x2'));var timeout=require(_0x5ce3('0x3'));var express=require(_0x5ce3('0x4'));var router=express[_0x5ce3('0x5')]();var fs_extra=require(_0x5ce3('0x6'));var auth=require(_0x5ce3('0x7'));var interaction=require(_0x5ce3('0x8'));var config=require(_0x5ce3('0x9'));var controller=require(_0x5ce3('0xa'));router[_0x5ce3('0xb')]('/',auth[_0x5ce3('0xc')](),controller[_0x5ce3('0xd')]);router[_0x5ce3('0xb')](_0x5ce3('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x5ce3('0xb')](_0x5ce3('0xf'),auth[_0x5ce3('0xc')](),controller[_0x5ce3('0x10')]);router[_0x5ce3('0x11')]('/',auth[_0x5ce3('0xc')](),controller[_0x5ce3('0x12')]);router[_0x5ce3('0x13')](_0x5ce3('0xf'),auth[_0x5ce3('0xc')](),controller[_0x5ce3('0x14')]);router['delete']('/:id',auth[_0x5ce3('0xc')](),controller[_0x5ce3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b28fac0..8539441 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6cc=['DATE','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe6cc,0x190));var _0xce6c=function(_0x5d0345,_0x54340d){_0x5d0345=_0x5d0345-0x0;var _0x254913=_0xe6cc[_0x5d0345];return _0x254913;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xce6c('0x0')]={'uniqueid':{'type':Sequelize[_0xce6c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xce6c('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xce6c('0x2')]},'exitAt':{'type':Sequelize[_0xce6c('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x75ec=['STRING','DATE','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75ec,0x152));var _0xc75e=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x75ec[_0x21549c];return _0x426cbd;};'use strict';var moment=require('moment');var Sequelize=require(_0xc75e('0x0'));module[_0xc75e('0x1')]={'uniqueid':{'type':Sequelize[_0xc75e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc75e('0x2')]},'joinAt':{'type':Sequelize[_0xc75e('0x3')]},'leaveAt':{'type':Sequelize[_0xc75e('0x3')]},'acceptAt':{'type':Sequelize[_0xc75e('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc75e('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 7096391..bb1386e 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cab=['reject','save','then','destroy','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x350641,_0x88d50){var _0x3ed3e3=function(_0x4d5d9e){while(--_0x4d5d9e){_0x350641['push'](_0x350641['shift']());}};_0x3ed3e3(++_0x88d50);}(_0x0cab,0x113));var _0xb0ca=function(_0x38d4e0,_0x506569){_0x38d4e0=_0x38d4e0-0x0;var _0x3d0515=_0x0cab[_0x38d4e0];return _0x3d0515;};'use strict';var emlformat=require(_0xb0ca('0x0'));var rimraf=require(_0xb0ca('0x1'));var zipdir=require(_0xb0ca('0x2'));var jsonpatch=require(_0xb0ca('0x3'));var rp=require(_0xb0ca('0x4'));var moment=require(_0xb0ca('0x5'));var BPromise=require(_0xb0ca('0x6'));var Mustache=require(_0xb0ca('0x7'));var util=require('util');var path=require(_0xb0ca('0x8'));var sox=require(_0xb0ca('0x9'));var csv=require(_0xb0ca('0xa'));var ejs=require(_0xb0ca('0xb'));var fs=require('fs');var fs_extra=require(_0xb0ca('0xc'));var _=require(_0xb0ca('0xd'));var squel=require(_0xb0ca('0xe'));var crypto=require(_0xb0ca('0xf'));var jsforce=require(_0xb0ca('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb0ca('0xa'));var querystring=require('querystring');var Papa=require(_0xb0ca('0x11'));var Redis=require('ioredis');var authService=require(_0xb0ca('0x12'));var qs=require(_0xb0ca('0x13'));var as=require(_0xb0ca('0x14'));var hardwareService=require(_0xb0ca('0x15'));var logger=require(_0xb0ca('0x16'))(_0xb0ca('0x17'));var utils=require(_0xb0ca('0x18'));var config=require(_0xb0ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57d308,_0x341980){_0x341980=_0x341980||0xcc;return function(_0x4c0827){if(_0x4c0827){return _0x57d308[_0xb0ca('0x1a')](_0x341980);}return _0x57d308[_0xb0ca('0x1b')](_0x341980)[_0xb0ca('0x1c')]();};}function respondWithResult(_0x38ff88,_0x3b9041){_0x3b9041=_0x3b9041||0xc8;return function(_0x5538f2){if(_0x5538f2){return _0x38ff88[_0xb0ca('0x1b')](_0x3b9041)[_0xb0ca('0x1d')](_0x5538f2);}};}function respondWithFilteredResult(_0x5b11a8,_0x46d928){return function(_0x25dc99){if(_0x25dc99){var _0x576261=typeof _0x46d928['offset']===_0xb0ca('0x1e')&&typeof _0x46d928[_0xb0ca('0x1f')]==='undefined';var _0x383bcd=_0x25dc99[_0xb0ca('0x20')];var _0xa2a77c=_0x576261?0x0:_0x46d928[_0xb0ca('0x21')];var _0x158224=_0x576261?_0x25dc99[_0xb0ca('0x20')]:_0x46d928[_0xb0ca('0x21')]+_0x46d928[_0xb0ca('0x1f')];var _0x4e57e4;if(_0x158224>=_0x383bcd){_0x158224=_0x383bcd;_0x4e57e4=0xc8;}else{_0x4e57e4=0xce;}_0x5b11a8['status'](_0x4e57e4);return _0x5b11a8[_0xb0ca('0x22')](_0xb0ca('0x23'),_0xa2a77c+'-'+_0x158224+'/'+_0x383bcd)[_0xb0ca('0x1d')](_0x25dc99);}return null;};}function patchUpdates(_0x4bbf25){return function(_0x3c0c25){try{jsonpatch[_0xb0ca('0x24')](_0x3c0c25,_0x4bbf25,!![]);}catch(_0x2383ef){return BPromise[_0xb0ca('0x25')](_0x2383ef);}return _0x3c0c25[_0xb0ca('0x26')]();};}function saveUpdates(_0x484202,_0x157db5){return function(_0x6017ea){if(_0x6017ea){return _0x6017ea['update'](_0x484202)[_0xb0ca('0x27')](function(_0x56668b){return _0x56668b;});}return null;};}function removeEntity(_0x506215,_0x588b97){return function(_0x1bea97){if(_0x1bea97){return _0x1bea97[_0xb0ca('0x28')]()[_0xb0ca('0x27')](function(){_0x506215[_0xb0ca('0x1b')](0xcc)[_0xb0ca('0x1c')]();});}};}function handleEntityNotFound(_0x46d3a0,_0x25556f){return function(_0x44cd43){if(!_0x44cd43){_0x46d3a0['sendStatus'](0x194);}return _0x44cd43;};}function handleError(_0x348c69,_0x4037bb){_0x4037bb=_0x4037bb||0x1f4;return function(_0x53c541){logger[_0xb0ca('0x29')](_0x53c541['stack']);if(_0x53c541['name']){delete _0x53c541[_0xb0ca('0x2a')];}_0x348c69['status'](_0x4037bb)[_0xb0ca('0x2b')](_0x53c541);};}exports['index']=function(_0x1c7f07,_0x39ecba){var _0x255fee={},_0x3b5291={},_0x3e1489={'count':0x0,'rows':[]};var _0x20ed96=_[_0xb0ca('0x2c')](db[_0xb0ca('0x2d')][_0xb0ca('0x2e')],function(_0x366770){return{'name':_0x366770[_0xb0ca('0x2f')],'type':_0x366770['type']['key']};});_0x3b5291['model']=_['map'](_0x20ed96,_0xb0ca('0x2a'));_0x3b5291[_0xb0ca('0x30')]=_[_0xb0ca('0x31')](_0x1c7f07[_0xb0ca('0x30')]);_0x3b5291[_0xb0ca('0x32')]=_[_0xb0ca('0x33')](_0x3b5291[_0xb0ca('0x34')],_0x3b5291[_0xb0ca('0x30')]);_0x255fee[_0xb0ca('0x35')]=_['intersection'](_0x3b5291[_0xb0ca('0x34')],qs[_0xb0ca('0x36')](_0x1c7f07['query'][_0xb0ca('0x36')]));_0x255fee['attributes']=_0x255fee[_0xb0ca('0x35')][_0xb0ca('0x37')]?_0x255fee[_0xb0ca('0x35')]:_0x3b5291[_0xb0ca('0x34')];if(!_0x1c7f07[_0xb0ca('0x30')]['hasOwnProperty'](_0xb0ca('0x38'))){_0x255fee['limit']=qs['limit'](_0x1c7f07[_0xb0ca('0x30')][_0xb0ca('0x1f')]);_0x255fee[_0xb0ca('0x21')]=qs['offset'](_0x1c7f07['query'][_0xb0ca('0x21')]);}_0x255fee[_0xb0ca('0x39')]=qs[_0xb0ca('0x3a')](_0x1c7f07[_0xb0ca('0x30')][_0xb0ca('0x3a')]);_0x255fee[_0xb0ca('0x3b')]=qs[_0xb0ca('0x32')](_[_0xb0ca('0x3c')](_0x1c7f07[_0xb0ca('0x30')],_0x3b5291['filters']),_0x20ed96);if(_0x1c7f07[_0xb0ca('0x30')][_0xb0ca('0x3d')]){_0x255fee[_0xb0ca('0x3b')]=_[_0xb0ca('0x3e')](_0x255fee['where'],{'$or':_[_0xb0ca('0x2c')](_0x20ed96,function(_0x10a108){if(_0x10a108[_0xb0ca('0x3f')]!==_0xb0ca('0x40')){var _0xc49695={};_0xc49695[_0x10a108['name']]={'$like':'%'+_0x1c7f07[_0xb0ca('0x30')][_0xb0ca('0x3d')]+'%'};return _0xc49695;}})});}_0x255fee=_['merge']({},_0x255fee,_0x1c7f07[_0xb0ca('0x41')]);var _0x33d3fb={'where':_0x255fee[_0xb0ca('0x3b')]};return db[_0xb0ca('0x2d')][_0xb0ca('0x20')](_0x33d3fb)[_0xb0ca('0x27')](function(_0x3a243d){_0x3e1489['count']=_0x3a243d;if(_0x1c7f07['query'][_0xb0ca('0x42')]){_0x255fee[_0xb0ca('0x43')]=[{'all':!![]}];}return db[_0xb0ca('0x2d')][_0xb0ca('0x44')](_0x255fee);})[_0xb0ca('0x27')](function(_0x33ce90){_0x3e1489[_0xb0ca('0x45')]=_0x33ce90;return _0x3e1489;})[_0xb0ca('0x27')](respondWithFilteredResult(_0x39ecba,_0x255fee))[_0xb0ca('0x46')](handleError(_0x39ecba,null));};exports[_0xb0ca('0x47')]=function(_0x4c266f,_0x36b4fa){var _0xfd9931={'raw':!![],'where':{'id':_0x4c266f[_0xb0ca('0x48')]['id']}},_0x28ecb1={};_0x28ecb1['model']=_[_0xb0ca('0x31')](db[_0xb0ca('0x2d')][_0xb0ca('0x2e')]);_0x28ecb1['query']=_[_0xb0ca('0x31')](_0x4c266f['query']);_0x28ecb1[_0xb0ca('0x32')]=_[_0xb0ca('0x33')](_0x28ecb1[_0xb0ca('0x34')],_0x28ecb1[_0xb0ca('0x30')]);_0xfd9931[_0xb0ca('0x35')]=_[_0xb0ca('0x33')](_0x28ecb1[_0xb0ca('0x34')],qs['fields'](_0x4c266f['query'][_0xb0ca('0x36')]));_0xfd9931[_0xb0ca('0x35')]=_0xfd9931[_0xb0ca('0x35')]['length']?_0xfd9931['attributes']:_0x28ecb1[_0xb0ca('0x34')];if(_0x4c266f[_0xb0ca('0x30')][_0xb0ca('0x42')]){_0xfd9931['include']=[{'all':!![]}];}_0xfd9931=_[_0xb0ca('0x3e')]({},_0xfd9931,_0x4c266f[_0xb0ca('0x41')]);return db[_0xb0ca('0x2d')]['find'](_0xfd9931)['then'](handleEntityNotFound(_0x36b4fa,null))['then'](respondWithResult(_0x36b4fa,null))[_0xb0ca('0x46')](handleError(_0x36b4fa,null));};exports[_0xb0ca('0x49')]=function(_0x5e3f52,_0x3dbdfd){return db[_0xb0ca('0x2d')][_0xb0ca('0x49')](_0x5e3f52[_0xb0ca('0x4a')],{})[_0xb0ca('0x27')](respondWithResult(_0x3dbdfd,0xc9))[_0xb0ca('0x46')](handleError(_0x3dbdfd,null));};exports[_0xb0ca('0x4b')]=function(_0x4ac47e,_0x3f622c){if(_0x4ac47e[_0xb0ca('0x4a')]['id']){delete _0x4ac47e['body']['id'];}return db[_0xb0ca('0x2d')]['find']({'where':{'id':_0x4ac47e[_0xb0ca('0x48')]['id']}})[_0xb0ca('0x27')](handleEntityNotFound(_0x3f622c,null))['then'](saveUpdates(_0x4ac47e[_0xb0ca('0x4a')],null))[_0xb0ca('0x27')](respondWithResult(_0x3f622c,null))['catch'](handleError(_0x3f622c,null));};exports[_0xb0ca('0x28')]=function(_0x1aeeb5,_0xa82534){return db[_0xb0ca('0x2d')][_0xb0ca('0x4c')]({'where':{'id':_0x1aeeb5[_0xb0ca('0x48')]['id']}})[_0xb0ca('0x27')](handleEntityNotFound(_0xa82534,null))[_0xb0ca('0x27')](removeEntity(_0xa82534,null))['catch'](handleError(_0xa82534,null));};exports[_0xb0ca('0x4d')]=function(_0x51e5d4,_0x11326b){return db[_0xb0ca('0x2d')]['describe']()['then'](respondWithResult(_0x11326b,null))['catch'](handleError(_0x11326b,null));}; \ No newline at end of file +var _0xe653=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SmsQueueReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x32ceec,_0xdbd534){var _0x5b29c8=function(_0x8892b0){while(--_0x8892b0){_0x32ceec['push'](_0x32ceec['shift']());}};_0x5b29c8(++_0xdbd534);}(_0xe653,0x10e));var _0x3e65=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0xe653[_0x119d25];return _0x39cf30;};'use strict';var emlformat=require(_0x3e65('0x0'));var rimraf=require(_0x3e65('0x1'));var zipdir=require(_0x3e65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e65('0x3'));var Mustache=require(_0x3e65('0x4'));var util=require(_0x3e65('0x5'));var path=require(_0x3e65('0x6'));var sox=require(_0x3e65('0x7'));var csv=require('to-csv');var ejs=require(_0x3e65('0x8'));var fs=require('fs');var fs_extra=require(_0x3e65('0x9'));var _=require(_0x3e65('0xa'));var squel=require(_0x3e65('0xb'));var crypto=require(_0x3e65('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e65('0xd'));var toCsv=require(_0x3e65('0xe'));var querystring=require('querystring');var Papa=require(_0x3e65('0xf'));var Redis=require(_0x3e65('0x10'));var authService=require(_0x3e65('0x11'));var qs=require(_0x3e65('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e65('0x13'));var logger=require(_0x3e65('0x14'))(_0x3e65('0x15'));var utils=require('../../config/utils');var config=require(_0x3e65('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e65('0x17'))['db'];function respondWithStatusCode(_0x5a526a,_0x1a478b){_0x1a478b=_0x1a478b||0xcc;return function(_0x17bbf3){if(_0x17bbf3){return _0x5a526a[_0x3e65('0x18')](_0x1a478b);}return _0x5a526a['status'](_0x1a478b)[_0x3e65('0x19')]();};}function respondWithResult(_0x4d88f3,_0x168f94){_0x168f94=_0x168f94||0xc8;return function(_0x45e950){if(_0x45e950){return _0x4d88f3[_0x3e65('0x1a')](_0x168f94)[_0x3e65('0x1b')](_0x45e950);}};}function respondWithFilteredResult(_0x1b5411,_0x23dea4){return function(_0x15c94f){if(_0x15c94f){var _0x41ed6d=typeof _0x23dea4[_0x3e65('0x1c')]===_0x3e65('0x1d')&&typeof _0x23dea4[_0x3e65('0x1e')]===_0x3e65('0x1d');var _0x416f9e=_0x15c94f[_0x3e65('0x1f')];var _0x3f4d47=_0x41ed6d?0x0:_0x23dea4[_0x3e65('0x1c')];var _0x504a3f=_0x41ed6d?_0x15c94f[_0x3e65('0x1f')]:_0x23dea4['offset']+_0x23dea4[_0x3e65('0x1e')];var _0x24a744;if(_0x504a3f>=_0x416f9e){_0x504a3f=_0x416f9e;_0x24a744=0xc8;}else{_0x24a744=0xce;}_0x1b5411[_0x3e65('0x1a')](_0x24a744);return _0x1b5411[_0x3e65('0x20')](_0x3e65('0x21'),_0x3f4d47+'-'+_0x504a3f+'/'+_0x416f9e)[_0x3e65('0x1b')](_0x15c94f);}return null;};}function patchUpdates(_0x10a1bc){return function(_0x234fa9){try{jsonpatch[_0x3e65('0x22')](_0x234fa9,_0x10a1bc,!![]);}catch(_0x318303){return BPromise[_0x3e65('0x23')](_0x318303);}return _0x234fa9[_0x3e65('0x24')]();};}function saveUpdates(_0x2446e2,_0x12739d){return function(_0x3c9f64){if(_0x3c9f64){return _0x3c9f64[_0x3e65('0x25')](_0x2446e2)[_0x3e65('0x26')](function(_0x2e1d58){return _0x2e1d58;});}return null;};}function removeEntity(_0x4514dc,_0x17672a){return function(_0x23fcc5){if(_0x23fcc5){return _0x23fcc5[_0x3e65('0x27')]()[_0x3e65('0x26')](function(){_0x4514dc['status'](0xcc)[_0x3e65('0x19')]();});}};}function handleEntityNotFound(_0x795c17,_0x3d7b36){return function(_0x6ed735){if(!_0x6ed735){_0x795c17[_0x3e65('0x18')](0x194);}return _0x6ed735;};}function handleError(_0x589d99,_0xbc5851){_0xbc5851=_0xbc5851||0x1f4;return function(_0x5c8aca){logger['error'](_0x5c8aca['stack']);if(_0x5c8aca[_0x3e65('0x28')]){delete _0x5c8aca[_0x3e65('0x28')];}_0x589d99[_0x3e65('0x1a')](_0xbc5851)[_0x3e65('0x29')](_0x5c8aca);};}exports[_0x3e65('0x2a')]=function(_0x552392,_0x219477){var _0xb865f4={},_0x43fd15={},_0x5a4b76={'count':0x0,'rows':[]};var _0x1c1bd2=_[_0x3e65('0x2b')](db['SmsQueueReport'][_0x3e65('0x2c')],function(_0xe879ad){return{'name':_0xe879ad[_0x3e65('0x2d')],'type':_0xe879ad['type'][_0x3e65('0x2e')]};});_0x43fd15[_0x3e65('0x2f')]=_[_0x3e65('0x2b')](_0x1c1bd2,'name');_0x43fd15[_0x3e65('0x30')]=_[_0x3e65('0x31')](_0x552392[_0x3e65('0x30')]);_0x43fd15['filters']=_['intersection'](_0x43fd15['model'],_0x43fd15['query']);_0xb865f4[_0x3e65('0x32')]=_[_0x3e65('0x33')](_0x43fd15['model'],qs[_0x3e65('0x34')](_0x552392[_0x3e65('0x30')]['fields']));_0xb865f4[_0x3e65('0x32')]=_0xb865f4[_0x3e65('0x32')][_0x3e65('0x35')]?_0xb865f4['attributes']:_0x43fd15['model'];if(!_0x552392[_0x3e65('0x30')][_0x3e65('0x36')](_0x3e65('0x37'))){_0xb865f4[_0x3e65('0x1e')]=qs[_0x3e65('0x1e')](_0x552392[_0x3e65('0x30')][_0x3e65('0x1e')]);_0xb865f4[_0x3e65('0x1c')]=qs['offset'](_0x552392[_0x3e65('0x30')]['offset']);}_0xb865f4[_0x3e65('0x38')]=qs[_0x3e65('0x39')](_0x552392[_0x3e65('0x30')][_0x3e65('0x39')]);_0xb865f4[_0x3e65('0x3a')]=qs[_0x3e65('0x3b')](_[_0x3e65('0x3c')](_0x552392[_0x3e65('0x30')],_0x43fd15[_0x3e65('0x3b')]),_0x1c1bd2);if(_0x552392[_0x3e65('0x30')][_0x3e65('0x3d')]){_0xb865f4['where']=_[_0x3e65('0x3e')](_0xb865f4[_0x3e65('0x3a')],{'$or':_[_0x3e65('0x2b')](_0x1c1bd2,function(_0x482af9){if(_0x482af9['type']!==_0x3e65('0x3f')){var _0x5046fe={};_0x5046fe[_0x482af9[_0x3e65('0x28')]]={'$like':'%'+_0x552392[_0x3e65('0x30')][_0x3e65('0x3d')]+'%'};return _0x5046fe;}})});}_0xb865f4=_['merge']({},_0xb865f4,_0x552392['options']);var _0x4fcdde={'where':_0xb865f4[_0x3e65('0x3a')]};return db[_0x3e65('0x40')]['count'](_0x4fcdde)[_0x3e65('0x26')](function(_0x3e84eb){_0x5a4b76['count']=_0x3e84eb;if(_0x552392[_0x3e65('0x30')]['includeAll']){_0xb865f4[_0x3e65('0x41')]=[{'all':!![]}];}return db[_0x3e65('0x40')][_0x3e65('0x42')](_0xb865f4);})[_0x3e65('0x26')](function(_0x1d17e1){_0x5a4b76['rows']=_0x1d17e1;return _0x5a4b76;})[_0x3e65('0x26')](respondWithFilteredResult(_0x219477,_0xb865f4))[_0x3e65('0x43')](handleError(_0x219477,null));};exports[_0x3e65('0x44')]=function(_0x292d21,_0x58e7ea){var _0x1dc265={'raw':!![],'where':{'id':_0x292d21[_0x3e65('0x45')]['id']}},_0x4507f7={};_0x4507f7[_0x3e65('0x2f')]=_[_0x3e65('0x31')](db['SmsQueueReport'][_0x3e65('0x2c')]);_0x4507f7['query']=_[_0x3e65('0x31')](_0x292d21['query']);_0x4507f7[_0x3e65('0x3b')]=_[_0x3e65('0x33')](_0x4507f7['model'],_0x4507f7[_0x3e65('0x30')]);_0x1dc265['attributes']=_['intersection'](_0x4507f7[_0x3e65('0x2f')],qs['fields'](_0x292d21[_0x3e65('0x30')][_0x3e65('0x34')]));_0x1dc265['attributes']=_0x1dc265[_0x3e65('0x32')]['length']?_0x1dc265[_0x3e65('0x32')]:_0x4507f7['model'];if(_0x292d21[_0x3e65('0x30')][_0x3e65('0x46')]){_0x1dc265[_0x3e65('0x41')]=[{'all':!![]}];}_0x1dc265=_[_0x3e65('0x3e')]({},_0x1dc265,_0x292d21['options']);return db[_0x3e65('0x40')][_0x3e65('0x47')](_0x1dc265)['then'](handleEntityNotFound(_0x58e7ea,null))[_0x3e65('0x26')](respondWithResult(_0x58e7ea,null))[_0x3e65('0x43')](handleError(_0x58e7ea,null));};exports[_0x3e65('0x48')]=function(_0x2e8731,_0x4bc751){return db[_0x3e65('0x40')][_0x3e65('0x48')](_0x2e8731[_0x3e65('0x49')],{})[_0x3e65('0x26')](respondWithResult(_0x4bc751,0xc9))['catch'](handleError(_0x4bc751,null));};exports[_0x3e65('0x25')]=function(_0x143f21,_0x219e15){if(_0x143f21['body']['id']){delete _0x143f21[_0x3e65('0x49')]['id'];}return db[_0x3e65('0x40')][_0x3e65('0x47')]({'where':{'id':_0x143f21[_0x3e65('0x45')]['id']}})['then'](handleEntityNotFound(_0x219e15,null))[_0x3e65('0x26')](saveUpdates(_0x143f21[_0x3e65('0x49')],null))[_0x3e65('0x26')](respondWithResult(_0x219e15,null))[_0x3e65('0x43')](handleError(_0x219e15,null));};exports[_0x3e65('0x27')]=function(_0x15c234,_0x1f104a){return db[_0x3e65('0x40')][_0x3e65('0x47')]({'where':{'id':_0x15c234[_0x3e65('0x45')]['id']}})[_0x3e65('0x26')](handleEntityNotFound(_0x1f104a,null))['then'](removeEntity(_0x1f104a,null))[_0x3e65('0x43')](handleError(_0x1f104a,null));};exports[_0x3e65('0x4a')]=function(_0x3e6d32,_0x38e19a){return db[_0x3e65('0x40')][_0x3e65('0x4a')]()[_0x3e65('0x26')](respondWithResult(_0x38e19a,null))[_0x3e65('0x43')](handleError(_0x38e19a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d3c5119..1be0e6e 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x118621,_0x197b5c){var _0x527611=function(_0xcbfe12){while(--_0xcbfe12){_0x118621['push'](_0x118621['shift']());}};_0x527611(++_0x197b5c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1e0f2b,_0x9c1274){var _0x2339b9=function(_0x430f86){while(--_0x430f86){_0x1e0f2b['push'](_0x1e0f2b['shift']());}};_0x2339b9(++_0x9c1274);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a2e268b..ea9e515 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc56f=['error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','info','debug','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xc56f,0x90));var _0xfc56=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc56f[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xfc56('0x0'));var util=require(_0xfc56('0x1'));var moment=require(_0xfc56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc56('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc56('0x5'))(_0xfc56('0x6'));var config=require(_0xfc56('0x7'));var jayson=require(_0xfc56('0x8'));var client=jayson['client'][_0xfc56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56780f,_0x1fa5f9,_0x53d63d){return new BPromise(function(_0x1f3e98,_0x15b368){return client[_0xfc56('0xa')](_0x56780f,_0x53d63d)[_0xfc56('0xb')](function(_0x51092f){logger['info'](_0xfc56('0xc'),_0x1fa5f9,_0xfc56('0xd'));logger['debug'](_0xfc56('0xe'),_0x1fa5f9,_0xfc56('0xd'),JSON[_0xfc56('0xf')](_0x51092f));if(_0x51092f[_0xfc56('0x10')]){if(_0x51092f['error'][_0xfc56('0x11')]===0x1f4){logger[_0xfc56('0x10')](_0xfc56('0xc'),_0x1fa5f9,_0x51092f['error'][_0xfc56('0x12')]);return _0x15b368(_0x51092f['error']['message']);}logger[_0xfc56('0x10')](_0xfc56('0xc'),_0x1fa5f9,_0x51092f['error'][_0xfc56('0x12')]);return _0x1f3e98(_0x51092f[_0xfc56('0x10')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x1fa5f9,_0xfc56('0xd'));_0x1f3e98(_0x51092f['result']['message']);}})[_0xfc56('0x13')](function(_0x294619){logger[_0xfc56('0x10')](_0xfc56('0xc'),_0x1fa5f9,_0x294619);_0x15b368(_0x294619);});});}exports[_0xfc56('0x14')]=function(_0xca02b5){var _0xd8f3af=this;return new Promise(function(_0x1c7385,_0x314552){return db[_0xfc56('0x15')][_0xfc56('0x16')](_0xca02b5[_0xfc56('0x17')],{'raw':_0xca02b5[_0xfc56('0x18')]?_0xca02b5[_0xfc56('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2bfa08){logger[_0xfc56('0x19')](_0xfc56('0x14'),_0xca02b5);logger[_0xfc56('0x1a')]('CreateSmsQueueReport',_0xca02b5,JSON['stringify'](_0x2bfa08));_0x1c7385(_0x2bfa08);})[_0xfc56('0x13')](function(_0x1045dc){logger[_0xfc56('0x10')](_0xfc56('0x14'),_0x1045dc[_0xfc56('0x12')],_0xca02b5);_0x314552(_0xd8f3af[_0xfc56('0x10')](0x1f4,_0x1045dc['message']));});});};exports['UpdateSmsQueueReport']=function(_0x46076c){var _0x413af9=this;return new Promise(function(_0xe06503,_0x44ad52){return db[_0xfc56('0x15')][_0xfc56('0x1b')](_0x46076c[_0xfc56('0x17')],{'raw':_0x46076c['options']?_0x46076c[_0xfc56('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46076c[_0xfc56('0x18')]?_0x46076c[_0xfc56('0x18')][_0xfc56('0x1c')]||null:null,'attributes':_0x46076c[_0xfc56('0x18')]?_0x46076c[_0xfc56('0x18')][_0xfc56('0x1d')]||null:null,'limit':_0x46076c[_0xfc56('0x18')]?_0x46076c[_0xfc56('0x18')][_0xfc56('0x1e')]||null:null})['then'](function(_0xba39d8){logger['info'](_0xfc56('0x1f'),_0x46076c);logger[_0xfc56('0x1a')](_0xfc56('0x1f'),_0x46076c,JSON[_0xfc56('0xf')](_0xba39d8));_0xe06503(_0xba39d8);})['catch'](function(_0xaf75c7){logger[_0xfc56('0x10')]('UpdateSmsQueueReport',_0xaf75c7[_0xfc56('0x12')],_0x46076c);_0x44ad52(_0x413af9['error'](0x1f4,_0xaf75c7[_0xfc56('0x12')]));});});}; \ No newline at end of file +var _0xd7e1=['message','info','result','CreateSmsQueueReport','create','options','raw','then','catch','update','attributes','limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x1eaa1c,_0x75bb6c){var _0x13d761=function(_0x6ef696){while(--_0x6ef696){_0x1eaa1c['push'](_0x1eaa1c['shift']());}};_0x13d761(++_0x75bb6c);}(_0xd7e1,0x70));var _0x1d7e=function(_0x41c66d,_0x512755){_0x41c66d=_0x41c66d-0x0;var _0x4b3302=_0xd7e1[_0x41c66d];return _0x4b3302;};'use strict';var _=require(_0x1d7e('0x0'));var util=require(_0x1d7e('0x1'));var moment=require('moment');var BPromise=require(_0x1d7e('0x2'));var rs=require(_0x1d7e('0x3'));var fs=require('fs');var Redis=require(_0x1d7e('0x4'));var db=require(_0x1d7e('0x5'))['db'];var utils=require(_0x1d7e('0x6'));var logger=require(_0x1d7e('0x7'))(_0x1d7e('0x8'));var config=require(_0x1d7e('0x9'));var jayson=require(_0x1d7e('0xa'));var client=jayson[_0x1d7e('0xb')][_0x1d7e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x138b26,_0x575fc6,_0x49daed){return new BPromise(function(_0x36a7ef,_0x103186){return client[_0x1d7e('0xd')](_0x138b26,_0x49daed)['then'](function(_0x18a225){logger['info'](_0x1d7e('0xe'),_0x575fc6,'request\x20sent');logger[_0x1d7e('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x575fc6,_0x1d7e('0x10'),JSON[_0x1d7e('0x11')](_0x18a225));if(_0x18a225['error']){if(_0x18a225[_0x1d7e('0x12')][_0x1d7e('0x13')]===0x1f4){logger['error'](_0x1d7e('0xe'),_0x575fc6,_0x18a225[_0x1d7e('0x12')][_0x1d7e('0x14')]);return _0x103186(_0x18a225['error'][_0x1d7e('0x14')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x575fc6,_0x18a225[_0x1d7e('0x12')][_0x1d7e('0x14')]);return _0x36a7ef(_0x18a225['error'][_0x1d7e('0x14')]);}else{logger[_0x1d7e('0x15')](_0x1d7e('0xe'),_0x575fc6,'request\x20sent');_0x36a7ef(_0x18a225[_0x1d7e('0x16')]['message']);}})['catch'](function(_0x4df63b){logger[_0x1d7e('0x12')](_0x1d7e('0xe'),_0x575fc6,_0x4df63b);_0x103186(_0x4df63b);});});}exports[_0x1d7e('0x17')]=function(_0x2952b9){var _0x209de2=this;return new Promise(function(_0x3dd758,_0x52cc7b){return db['SmsQueueReport'][_0x1d7e('0x18')](_0x2952b9['body'],{'raw':_0x2952b9[_0x1d7e('0x19')]?_0x2952b9[_0x1d7e('0x19')][_0x1d7e('0x1a')]===undefined?!![]:![]:!![]})[_0x1d7e('0x1b')](function(_0x4506a4){logger[_0x1d7e('0x15')](_0x1d7e('0x17'),_0x2952b9);logger[_0x1d7e('0xf')](_0x1d7e('0x17'),_0x2952b9,JSON[_0x1d7e('0x11')](_0x4506a4));_0x3dd758(_0x4506a4);})[_0x1d7e('0x1c')](function(_0x157ae7){logger[_0x1d7e('0x12')](_0x1d7e('0x17'),_0x157ae7[_0x1d7e('0x14')],_0x2952b9);_0x52cc7b(_0x209de2[_0x1d7e('0x12')](0x1f4,_0x157ae7[_0x1d7e('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0xa78bee){var _0x25f60b=this;return new Promise(function(_0x519049,_0x10729a){return db['SmsQueueReport'][_0x1d7e('0x1d')](_0xa78bee['body'],{'raw':_0xa78bee[_0x1d7e('0x19')]?_0xa78bee[_0x1d7e('0x19')][_0x1d7e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa78bee[_0x1d7e('0x19')]?_0xa78bee[_0x1d7e('0x19')]['where']||null:null,'attributes':_0xa78bee[_0x1d7e('0x19')]?_0xa78bee[_0x1d7e('0x19')][_0x1d7e('0x1e')]||null:null,'limit':_0xa78bee[_0x1d7e('0x19')]?_0xa78bee['options'][_0x1d7e('0x1f')]||null:null})[_0x1d7e('0x1b')](function(_0x28f5f6){logger[_0x1d7e('0x15')](_0x1d7e('0x20'),_0xa78bee);logger[_0x1d7e('0xf')]('UpdateSmsQueueReport',_0xa78bee,JSON[_0x1d7e('0x11')](_0x28f5f6));_0x519049(_0x28f5f6);})[_0x1d7e('0x1c')](function(_0xcc5395){logger[_0x1d7e('0x12')]('UpdateSmsQueueReport',_0xcc5395['message'],_0xa78bee);_0x10729a(_0x25f60b[_0x1d7e('0x12')](0x1f4,_0xcc5395[_0x1d7e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 84adcf4..69de5fb 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3cb1d2,_0x213e56){var _0x4ed180=function(_0x31eec4){while(--_0x31eec4){_0x3cb1d2['push'](_0x3cb1d2['shift']());}};_0x4ed180(++_0x213e56);}(_0x5178,0x171));var _0x8517=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5178[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./smsTransferReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x7217,0x19e));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8fb9b35..67792b8 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x20ad04,_0x4c995a){var _0x493576=function(_0xf8ee55){while(--_0xf8ee55){_0x20ad04['push'](_0x20ad04['shift']());}};_0x493576(++_0x4c995a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0xcb91[_0x3c4e4c];return _0x144a87;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x109233,_0x5df952){var _0xba4333=function(_0x5cbe14){while(--_0x5cbe14){_0x109233['push'](_0x109233['shift']());}};_0xba4333(++_0x5df952);}(_0xf4eb,0xec));var _0xbf4e=function(_0x12cfe1,_0x21f274){_0x12cfe1=_0x12cfe1-0x0;var _0x31eaaf=_0xf4eb[_0x12cfe1];return _0x31eaaf;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 67c094c..952ab0a 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x201f=['crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x201f,0x81));var _0xf201=function(_0xde72e4,_0x9f1620){_0xde72e4=_0xde72e4-0x0;var _0x553c84=_0x201f[_0xde72e4];return _0x553c84;};'use strict';var emlformat=require(_0xf201('0x0'));var rimraf=require(_0xf201('0x1'));var zipdir=require(_0xf201('0x2'));var jsonpatch=require(_0xf201('0x3'));var rp=require(_0xf201('0x4'));var moment=require(_0xf201('0x5'));var BPromise=require(_0xf201('0x6'));var Mustache=require(_0xf201('0x7'));var util=require('util');var path=require(_0xf201('0x8'));var sox=require(_0xf201('0x9'));var csv=require(_0xf201('0xa'));var ejs=require(_0xf201('0xb'));var fs=require('fs');var fs_extra=require(_0xf201('0xc'));var _=require(_0xf201('0xd'));var squel=require(_0xf201('0xe'));var crypto=require(_0xf201('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf201('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf201('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf201('0x12'));var logger=require(_0xf201('0x13'))('api');var utils=require(_0xf201('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf201('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fa71d,_0x5e787b){_0x5e787b=_0x5e787b||0xcc;return function(_0x207431){if(_0x207431){return _0x3fa71d[_0xf201('0x16')](_0x5e787b);}return _0x3fa71d['status'](_0x5e787b)[_0xf201('0x17')]();};}function respondWithResult(_0x15d782,_0x1a6e5a){_0x1a6e5a=_0x1a6e5a||0xc8;return function(_0x49d286){if(_0x49d286){return _0x15d782[_0xf201('0x18')](_0x1a6e5a)[_0xf201('0x19')](_0x49d286);}};}function respondWithFilteredResult(_0x318f42,_0x2ea0a5){return function(_0x17ba42){if(_0x17ba42){var _0x480eee=typeof _0x2ea0a5['offset']===_0xf201('0x1a')&&typeof _0x2ea0a5[_0xf201('0x1b')]===_0xf201('0x1a');var _0x3a6973=_0x17ba42[_0xf201('0x1c')];var _0xdf2a8c=_0x480eee?0x0:_0x2ea0a5[_0xf201('0x1d')];var _0x3b3c66=_0x480eee?_0x17ba42[_0xf201('0x1c')]:_0x2ea0a5[_0xf201('0x1d')]+_0x2ea0a5[_0xf201('0x1b')];var _0xe73bbd;if(_0x3b3c66>=_0x3a6973){_0x3b3c66=_0x3a6973;_0xe73bbd=0xc8;}else{_0xe73bbd=0xce;}_0x318f42[_0xf201('0x18')](_0xe73bbd);return _0x318f42[_0xf201('0x1e')](_0xf201('0x1f'),_0xdf2a8c+'-'+_0x3b3c66+'/'+_0x3a6973)['json'](_0x17ba42);}return null;};}function patchUpdates(_0x8938c9){return function(_0x313d2d){try{jsonpatch[_0xf201('0x20')](_0x313d2d,_0x8938c9,!![]);}catch(_0x44569e){return BPromise[_0xf201('0x21')](_0x44569e);}return _0x313d2d[_0xf201('0x22')]();};}function saveUpdates(_0x23c16a,_0x45e019){return function(_0x481467){if(_0x481467){return _0x481467['update'](_0x23c16a)['then'](function(_0x403b54){return _0x403b54;});}return null;};}function removeEntity(_0x106833,_0x1703da){return function(_0x1bbeb1){if(_0x1bbeb1){return _0x1bbeb1['destroy']()[_0xf201('0x23')](function(){_0x106833[_0xf201('0x18')](0xcc)[_0xf201('0x17')]();});}};}function handleEntityNotFound(_0x3d3e84,_0x1ec4a1){return function(_0x4a731b){if(!_0x4a731b){_0x3d3e84['sendStatus'](0x194);}return _0x4a731b;};}function handleError(_0x260a8e,_0x3e4a26){_0x3e4a26=_0x3e4a26||0x1f4;return function(_0x588586){logger[_0xf201('0x24')](_0x588586[_0xf201('0x25')]);if(_0x588586[_0xf201('0x26')]){delete _0x588586[_0xf201('0x26')];}_0x260a8e[_0xf201('0x18')](_0x3e4a26)[_0xf201('0x27')](_0x588586);};}exports[_0xf201('0x28')]=function(_0x353aab,_0x52509e){var _0x3cc37f={},_0x2f1fd1={},_0x4400e1={'count':0x0,'rows':[]};var _0x3b8e15=_[_0xf201('0x29')](db[_0xf201('0x2a')][_0xf201('0x2b')],function(_0x4ae128){return{'name':_0x4ae128[_0xf201('0x2c')],'type':_0x4ae128['type'][_0xf201('0x2d')]};});_0x2f1fd1['model']=_[_0xf201('0x29')](_0x3b8e15,_0xf201('0x26'));_0x2f1fd1[_0xf201('0x2e')]=_[_0xf201('0x2f')](_0x353aab[_0xf201('0x2e')]);_0x2f1fd1[_0xf201('0x30')]=_[_0xf201('0x31')](_0x2f1fd1['model'],_0x2f1fd1[_0xf201('0x2e')]);_0x3cc37f[_0xf201('0x32')]=_[_0xf201('0x31')](_0x2f1fd1[_0xf201('0x33')],qs['fields'](_0x353aab[_0xf201('0x2e')]['fields']));_0x3cc37f[_0xf201('0x32')]=_0x3cc37f[_0xf201('0x32')]['length']?_0x3cc37f[_0xf201('0x32')]:_0x2f1fd1[_0xf201('0x33')];if(!_0x353aab[_0xf201('0x2e')][_0xf201('0x34')]('nolimit')){_0x3cc37f[_0xf201('0x1b')]=qs[_0xf201('0x1b')](_0x353aab[_0xf201('0x2e')][_0xf201('0x1b')]);_0x3cc37f[_0xf201('0x1d')]=qs[_0xf201('0x1d')](_0x353aab[_0xf201('0x2e')][_0xf201('0x1d')]);}_0x3cc37f[_0xf201('0x35')]=qs['sort'](_0x353aab[_0xf201('0x2e')]['sort']);_0x3cc37f[_0xf201('0x36')]=qs[_0xf201('0x30')](_['pick'](_0x353aab[_0xf201('0x2e')],_0x2f1fd1[_0xf201('0x30')]),_0x3b8e15);if(_0x353aab[_0xf201('0x2e')][_0xf201('0x37')]){_0x3cc37f[_0xf201('0x36')]=_[_0xf201('0x38')](_0x3cc37f['where'],{'$or':_[_0xf201('0x29')](_0x3b8e15,function(_0xf3b0a8){if(_0xf3b0a8['type']!==_0xf201('0x39')){var _0x102c59={};_0x102c59[_0xf3b0a8['name']]={'$like':'%'+_0x353aab[_0xf201('0x2e')][_0xf201('0x37')]+'%'};return _0x102c59;}})});}_0x3cc37f=_[_0xf201('0x38')]({},_0x3cc37f,_0x353aab[_0xf201('0x3a')]);var _0x329c5b={'where':_0x3cc37f[_0xf201('0x36')]};return db[_0xf201('0x2a')][_0xf201('0x1c')](_0x329c5b)[_0xf201('0x23')](function(_0x3da818){_0x4400e1[_0xf201('0x1c')]=_0x3da818;if(_0x353aab['query']['includeAll']){_0x3cc37f[_0xf201('0x3b')]=[{'all':!![]}];}return db[_0xf201('0x2a')][_0xf201('0x3c')](_0x3cc37f);})[_0xf201('0x23')](function(_0x2e2ffb){_0x4400e1[_0xf201('0x3d')]=_0x2e2ffb;return _0x4400e1;})[_0xf201('0x23')](respondWithFilteredResult(_0x52509e,_0x3cc37f))[_0xf201('0x3e')](handleError(_0x52509e,null));};exports[_0xf201('0x3f')]=function(_0x74cc6f,_0x57c71a){var _0x4c4965={'raw':!![],'where':{'id':_0x74cc6f[_0xf201('0x40')]['id']}},_0x511bed={};_0x511bed[_0xf201('0x33')]=_[_0xf201('0x2f')](db[_0xf201('0x2a')][_0xf201('0x2b')]);_0x511bed[_0xf201('0x2e')]=_[_0xf201('0x2f')](_0x74cc6f[_0xf201('0x2e')]);_0x511bed['filters']=_[_0xf201('0x31')](_0x511bed[_0xf201('0x33')],_0x511bed[_0xf201('0x2e')]);_0x4c4965[_0xf201('0x32')]=_[_0xf201('0x31')](_0x511bed[_0xf201('0x33')],qs['fields'](_0x74cc6f['query'][_0xf201('0x41')]));_0x4c4965[_0xf201('0x32')]=_0x4c4965[_0xf201('0x32')]['length']?_0x4c4965[_0xf201('0x32')]:_0x511bed[_0xf201('0x33')];if(_0x74cc6f[_0xf201('0x2e')][_0xf201('0x42')]){_0x4c4965['include']=[{'all':!![]}];}_0x4c4965=_[_0xf201('0x38')]({},_0x4c4965,_0x74cc6f[_0xf201('0x3a')]);return db[_0xf201('0x2a')][_0xf201('0x43')](_0x4c4965)['then'](handleEntityNotFound(_0x57c71a,null))[_0xf201('0x23')](respondWithResult(_0x57c71a,null))[_0xf201('0x3e')](handleError(_0x57c71a,null));};exports[_0xf201('0x44')]=function(_0xd1137,_0xe3a566){return db['SmsTransferReport'][_0xf201('0x44')](_0xd1137[_0xf201('0x45')],{})['then'](respondWithResult(_0xe3a566,0xc9))[_0xf201('0x3e')](handleError(_0xe3a566,null));};exports['update']=function(_0x134529,_0x3d29b9){if(_0x134529[_0xf201('0x45')]['id']){delete _0x134529['body']['id'];}return db[_0xf201('0x2a')]['find']({'where':{'id':_0x134529[_0xf201('0x40')]['id']}})[_0xf201('0x23')](handleEntityNotFound(_0x3d29b9,null))[_0xf201('0x23')](saveUpdates(_0x134529[_0xf201('0x45')],null))['then'](respondWithResult(_0x3d29b9,null))['catch'](handleError(_0x3d29b9,null));};exports[_0xf201('0x46')]=function(_0x293740,_0x4c6365){return db['SmsTransferReport'][_0xf201('0x43')]({'where':{'id':_0x293740[_0xf201('0x40')]['id']}})[_0xf201('0x23')](handleEntityNotFound(_0x4c6365,null))[_0xf201('0x23')](removeEntity(_0x4c6365,null))[_0xf201('0x3e')](handleError(_0x4c6365,null));};exports[_0xf201('0x47')]=function(_0xe4fd52,_0x4b6e63){return db[_0xf201('0x2a')][_0xf201('0x47')]()[_0xf201('0x23')](respondWithResult(_0x4b6e63,null))['catch'](handleError(_0x4b6e63,null));}; \ No newline at end of file +var _0x2abf=['then','error','stack','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x354ba5,_0x24cad9){var _0x74d1cb=function(_0x75aa0c){while(--_0x75aa0c){_0x354ba5['push'](_0x354ba5['shift']());}};_0x74d1cb(++_0x24cad9);}(_0x2abf,0x155));var _0xf2ab=function(_0x16996a,_0x31e7d4){_0x16996a=_0x16996a-0x0;var _0x9dc2b4=_0x2abf[_0x16996a];return _0x9dc2b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ab('0x1'));var rp=require(_0xf2ab('0x2'));var moment=require('moment');var BPromise=require(_0xf2ab('0x3'));var Mustache=require(_0xf2ab('0x4'));var util=require(_0xf2ab('0x5'));var path=require('path');var sox=require(_0xf2ab('0x6'));var csv=require(_0xf2ab('0x7'));var ejs=require(_0xf2ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf2ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf2ab('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf2ab('0xb'));var Papa=require(_0xf2ab('0xc'));var Redis=require('ioredis');var authService=require(_0xf2ab('0xd'));var qs=require(_0xf2ab('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2ab('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf2ab('0x10'));var config=require(_0xf2ab('0x11'));var licenseUtil=require(_0xf2ab('0x12'));var db=require(_0xf2ab('0x13'))['db'];function respondWithStatusCode(_0x252e3f,_0x25e468){_0x25e468=_0x25e468||0xcc;return function(_0x26727c){if(_0x26727c){return _0x252e3f[_0xf2ab('0x14')](_0x25e468);}return _0x252e3f[_0xf2ab('0x15')](_0x25e468)[_0xf2ab('0x16')]();};}function respondWithResult(_0x13c397,_0x2ec04b){_0x2ec04b=_0x2ec04b||0xc8;return function(_0x2ec27e){if(_0x2ec27e){return _0x13c397[_0xf2ab('0x15')](_0x2ec04b)[_0xf2ab('0x17')](_0x2ec27e);}};}function respondWithFilteredResult(_0x2f05e4,_0x344ffc){return function(_0x5c7cfc){if(_0x5c7cfc){var _0x3f957b=typeof _0x344ffc['offset']===_0xf2ab('0x18')&&typeof _0x344ffc[_0xf2ab('0x19')]===_0xf2ab('0x18');var _0x77b890=_0x5c7cfc[_0xf2ab('0x1a')];var _0x1496f4=_0x3f957b?0x0:_0x344ffc['offset'];var _0xfa3bf4=_0x3f957b?_0x5c7cfc[_0xf2ab('0x1a')]:_0x344ffc[_0xf2ab('0x1b')]+_0x344ffc['limit'];var _0x44b713;if(_0xfa3bf4>=_0x77b890){_0xfa3bf4=_0x77b890;_0x44b713=0xc8;}else{_0x44b713=0xce;}_0x2f05e4[_0xf2ab('0x15')](_0x44b713);return _0x2f05e4[_0xf2ab('0x1c')](_0xf2ab('0x1d'),_0x1496f4+'-'+_0xfa3bf4+'/'+_0x77b890)['json'](_0x5c7cfc);}return null;};}function patchUpdates(_0x49c5d1){return function(_0x421241){try{jsonpatch[_0xf2ab('0x1e')](_0x421241,_0x49c5d1,!![]);}catch(_0x2100ce){return BPromise[_0xf2ab('0x1f')](_0x2100ce);}return _0x421241[_0xf2ab('0x20')]();};}function saveUpdates(_0xedcc4c,_0x185e0d){return function(_0x4238dc){if(_0x4238dc){return _0x4238dc[_0xf2ab('0x21')](_0xedcc4c)[_0xf2ab('0x22')](function(_0xf92f6f){return _0xf92f6f;});}return null;};}function removeEntity(_0x168582,_0x41d22){return function(_0x3096ec){if(_0x3096ec){return _0x3096ec['destroy']()[_0xf2ab('0x22')](function(){_0x168582[_0xf2ab('0x15')](0xcc)[_0xf2ab('0x16')]();});}};}function handleEntityNotFound(_0x1fa87d,_0x207838){return function(_0x37aaf9){if(!_0x37aaf9){_0x1fa87d[_0xf2ab('0x14')](0x194);}return _0x37aaf9;};}function handleError(_0x5d60a5,_0x22355e){_0x22355e=_0x22355e||0x1f4;return function(_0x122b3f){logger[_0xf2ab('0x23')](_0x122b3f[_0xf2ab('0x24')]);if(_0x122b3f['name']){delete _0x122b3f['name'];}_0x5d60a5['status'](_0x22355e)[_0xf2ab('0x25')](_0x122b3f);};}exports[_0xf2ab('0x26')]=function(_0x35fda2,_0x4f28d8){var _0xe2c4e3={},_0x5398bb={},_0x3f8911={'count':0x0,'rows':[]};var _0x1a1115=_[_0xf2ab('0x27')](db[_0xf2ab('0x28')][_0xf2ab('0x29')],function(_0x4c8c6d){return{'name':_0x4c8c6d[_0xf2ab('0x2a')],'type':_0x4c8c6d[_0xf2ab('0x2b')][_0xf2ab('0x2c')]};});_0x5398bb['model']=_['map'](_0x1a1115,_0xf2ab('0x2d'));_0x5398bb[_0xf2ab('0x2e')]=_[_0xf2ab('0x2f')](_0x35fda2[_0xf2ab('0x2e')]);_0x5398bb[_0xf2ab('0x30')]=_['intersection'](_0x5398bb[_0xf2ab('0x31')],_0x5398bb[_0xf2ab('0x2e')]);_0xe2c4e3[_0xf2ab('0x32')]=_[_0xf2ab('0x33')](_0x5398bb[_0xf2ab('0x31')],qs[_0xf2ab('0x34')](_0x35fda2[_0xf2ab('0x2e')]['fields']));_0xe2c4e3[_0xf2ab('0x32')]=_0xe2c4e3[_0xf2ab('0x32')][_0xf2ab('0x35')]?_0xe2c4e3[_0xf2ab('0x32')]:_0x5398bb[_0xf2ab('0x31')];if(!_0x35fda2[_0xf2ab('0x2e')][_0xf2ab('0x36')](_0xf2ab('0x37'))){_0xe2c4e3[_0xf2ab('0x19')]=qs[_0xf2ab('0x19')](_0x35fda2['query'][_0xf2ab('0x19')]);_0xe2c4e3['offset']=qs[_0xf2ab('0x1b')](_0x35fda2['query'][_0xf2ab('0x1b')]);}_0xe2c4e3[_0xf2ab('0x38')]=qs['sort'](_0x35fda2[_0xf2ab('0x2e')][_0xf2ab('0x39')]);_0xe2c4e3[_0xf2ab('0x3a')]=qs[_0xf2ab('0x30')](_[_0xf2ab('0x3b')](_0x35fda2[_0xf2ab('0x2e')],_0x5398bb['filters']),_0x1a1115);if(_0x35fda2[_0xf2ab('0x2e')][_0xf2ab('0x3c')]){_0xe2c4e3[_0xf2ab('0x3a')]=_[_0xf2ab('0x3d')](_0xe2c4e3[_0xf2ab('0x3a')],{'$or':_[_0xf2ab('0x27')](_0x1a1115,function(_0x49a5c4){if(_0x49a5c4[_0xf2ab('0x2b')]!==_0xf2ab('0x3e')){var _0x5449aa={};_0x5449aa[_0x49a5c4['name']]={'$like':'%'+_0x35fda2[_0xf2ab('0x2e')][_0xf2ab('0x3c')]+'%'};return _0x5449aa;}})});}_0xe2c4e3=_[_0xf2ab('0x3d')]({},_0xe2c4e3,_0x35fda2['options']);var _0x504f8d={'where':_0xe2c4e3[_0xf2ab('0x3a')]};return db[_0xf2ab('0x28')][_0xf2ab('0x1a')](_0x504f8d)['then'](function(_0x507605){_0x3f8911['count']=_0x507605;if(_0x35fda2['query'][_0xf2ab('0x3f')]){_0xe2c4e3['include']=[{'all':!![]}];}return db[_0xf2ab('0x28')][_0xf2ab('0x40')](_0xe2c4e3);})['then'](function(_0x363780){_0x3f8911['rows']=_0x363780;return _0x3f8911;})[_0xf2ab('0x22')](respondWithFilteredResult(_0x4f28d8,_0xe2c4e3))[_0xf2ab('0x41')](handleError(_0x4f28d8,null));};exports[_0xf2ab('0x42')]=function(_0x380d3d,_0x13f904){var _0x42e857={'raw':!![],'where':{'id':_0x380d3d[_0xf2ab('0x43')]['id']}},_0x36929f={};_0x36929f[_0xf2ab('0x31')]=_['keys'](db[_0xf2ab('0x28')][_0xf2ab('0x29')]);_0x36929f[_0xf2ab('0x2e')]=_[_0xf2ab('0x2f')](_0x380d3d[_0xf2ab('0x2e')]);_0x36929f[_0xf2ab('0x30')]=_['intersection'](_0x36929f['model'],_0x36929f[_0xf2ab('0x2e')]);_0x42e857['attributes']=_[_0xf2ab('0x33')](_0x36929f[_0xf2ab('0x31')],qs[_0xf2ab('0x34')](_0x380d3d['query'][_0xf2ab('0x34')]));_0x42e857[_0xf2ab('0x32')]=_0x42e857[_0xf2ab('0x32')][_0xf2ab('0x35')]?_0x42e857[_0xf2ab('0x32')]:_0x36929f[_0xf2ab('0x31')];if(_0x380d3d[_0xf2ab('0x2e')][_0xf2ab('0x3f')]){_0x42e857[_0xf2ab('0x44')]=[{'all':!![]}];}_0x42e857=_[_0xf2ab('0x3d')]({},_0x42e857,_0x380d3d[_0xf2ab('0x45')]);return db[_0xf2ab('0x28')][_0xf2ab('0x46')](_0x42e857)[_0xf2ab('0x22')](handleEntityNotFound(_0x13f904,null))[_0xf2ab('0x22')](respondWithResult(_0x13f904,null))['catch'](handleError(_0x13f904,null));};exports['create']=function(_0x241015,_0x29b7dc){return db[_0xf2ab('0x28')][_0xf2ab('0x47')](_0x241015[_0xf2ab('0x48')],{})[_0xf2ab('0x22')](respondWithResult(_0x29b7dc,0xc9))[_0xf2ab('0x41')](handleError(_0x29b7dc,null));};exports[_0xf2ab('0x21')]=function(_0x533462,_0x2ab770){if(_0x533462[_0xf2ab('0x48')]['id']){delete _0x533462['body']['id'];}return db[_0xf2ab('0x28')][_0xf2ab('0x46')]({'where':{'id':_0x533462['params']['id']}})['then'](handleEntityNotFound(_0x2ab770,null))[_0xf2ab('0x22')](saveUpdates(_0x533462[_0xf2ab('0x48')],null))[_0xf2ab('0x22')](respondWithResult(_0x2ab770,null))['catch'](handleError(_0x2ab770,null));};exports[_0xf2ab('0x49')]=function(_0x1d5eeb,_0x258d6e){return db[_0xf2ab('0x28')][_0xf2ab('0x46')]({'where':{'id':_0x1d5eeb['params']['id']}})[_0xf2ab('0x22')](handleEntityNotFound(_0x258d6e,null))[_0xf2ab('0x22')](removeEntity(_0x258d6e,null))[_0xf2ab('0x41')](handleError(_0x258d6e,null));};exports[_0xf2ab('0x4a')]=function(_0x2284ac,_0x7ef65a){return db[_0xf2ab('0x28')][_0xf2ab('0x4a')]()[_0xf2ab('0x22')](respondWithResult(_0x7ef65a,null))[_0xf2ab('0x41')](handleError(_0x7ef65a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 794d648..116a90d 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf14b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1731db,_0x495da2){var _0x3d9a19=function(_0x3e72eb){while(--_0x3e72eb){_0x1731db['push'](_0x1731db['shift']());}};_0x3d9a19(++_0x495da2);}(_0xf14b,0xdd));var _0xbf14=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xf14b[_0x2e0443];return _0x52d450;};'use strict';var _=require(_0xbf14('0x0'));var util=require(_0xbf14('0x1'));var logger=require(_0xbf14('0x2'))(_0xbf14('0x3'));var moment=require(_0xbf14('0x4'));var BPromise=require(_0xbf14('0x5'));var rp=require(_0xbf14('0x6'));var fs=require('fs');var path=require(_0xbf14('0x7'));var rimraf=require(_0xbf14('0x8'));var config=require(_0xbf14('0x9'));var attributes=require('./smsTransferReport.attributes');module[_0xbf14('0xa')]=function(_0xb9333b,_0x1b6462){return _0xb9333b[_0xbf14('0xb')](_0xbf14('0xc'),attributes,{'tableName':_0xbf14('0xd'),'paranoid':![],'indexes':[{'name':_0xbf14('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc26a=['request-promise','path','./smsTransferReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x28d97c,_0x4076c0){var _0x5a09c1=function(_0x42d16b){while(--_0x42d16b){_0x28d97c['push'](_0x28d97c['shift']());}};_0x5a09c1(++_0x4076c0);}(_0xc26a,0x1c9));var _0xac26=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xc26a[_0x31a37b];return _0x49ae16;};'use strict';var _=require(_0xac26('0x0'));var util=require('util');var logger=require(_0xac26('0x1'))(_0xac26('0x2'));var moment=require(_0xac26('0x3'));var BPromise=require(_0xac26('0x4'));var rp=require(_0xac26('0x5'));var fs=require('fs');var path=require(_0xac26('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xac26('0x7'));module[_0xac26('0x8')]=function(_0x34451d,_0x49fad0){return _0x34451d[_0xac26('0x9')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xac26('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index a14ec76..c71769f 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ff=['stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2173c7,_0x4af7ed){var _0x56a428=function(_0x10025f){while(--_0x10025f){_0x2173c7['push'](_0x2173c7['shift']());}};_0x56a428(++_0x4af7ed);}(_0xb2ff,0x123));var _0xfb2f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2ff[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var moment=require('moment');var BPromise=require(_0xfb2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2f('0x3'));var logger=require('../../config/logger')(_0xfb2f('0x4'));var config=require(_0xfb2f('0x5'));var jayson=require(_0xfb2f('0x6'));var client=jayson[_0xfb2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0fd7,_0x28cb13,_0x4ff2df){return new BPromise(function(_0x34c04e,_0x4588d6){return client[_0xfb2f('0x8')](_0x4a0fd7,_0x4ff2df)[_0xfb2f('0x9')](function(_0x5abcdb){logger[_0xfb2f('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x28cb13,_0xfb2f('0xb'));logger['debug'](_0xfb2f('0xc'),_0x28cb13,_0xfb2f('0xb'),JSON[_0xfb2f('0xd')](_0x5abcdb));if(_0x5abcdb[_0xfb2f('0xe')]){if(_0x5abcdb[_0xfb2f('0xe')]['code']===0x1f4){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);return _0x4588d6(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb['error'][_0xfb2f('0x10')]);return _0x34c04e(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}else{logger[_0xfb2f('0xa')](_0xfb2f('0xf'),_0x28cb13,'request\x20sent');_0x34c04e(_0x5abcdb[_0xfb2f('0x11')][_0xfb2f('0x10')]);}})[_0xfb2f('0x12')](function(_0x240b79){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x240b79);_0x4588d6(_0x240b79);});});} \ No newline at end of file +var _0x7dfd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1eb402,_0x164f02){var _0x577f76=function(_0x10efd0){while(--_0x10efd0){_0x1eb402['push'](_0x1eb402['shift']());}};_0x577f76(++_0x164f02);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var BPromise=require(_0xd7df('0x3'));var rs=require(_0xd7df('0x4'));var fs=require('fs');var Redis=require(_0xd7df('0x5'));var db=require(_0xd7df('0x6'))['db'];var utils=require(_0xd7df('0x7'));var logger=require(_0xd7df('0x8'))(_0xd7df('0x9'));var config=require(_0xd7df('0xa'));var jayson=require(_0xd7df('0xb'));var client=jayson[_0xd7df('0xc')][_0xd7df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){return client[_0xd7df('0xe')](_0x354ea7,_0x2c48a4)[_0xd7df('0xf')](function(_0x3dee59){logger['info'](_0xd7df('0x10'),_0x16e50,'request\x20sent');logger[_0xd7df('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x16e50,_0xd7df('0x12'),JSON[_0xd7df('0x13')](_0x3dee59));if(_0x3dee59[_0xd7df('0x14')]){if(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x15')]===0x1f4){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0xab6742(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0x5c220a(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}else{logger['info'](_0xd7df('0x10'),_0x16e50,_0xd7df('0x12'));_0x5c220a(_0x3dee59['result'][_0xd7df('0x16')]);}})[_0xd7df('0x17')](function(_0x5d3beb){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x5d3beb);_0xab6742(_0x5d3beb);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 2ea608b..03c89fd 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02d9=['get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','originalname','replace','format','extname','now','file','create','update','delete','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./sound.controller'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x02d9,0x1a2));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x902d('0x0'));var util=require('util');var path=require(_0x902d('0x1'));var timeout=require('connect-timeout');var express=require(_0x902d('0x2'));var router=express['Router']();var fs_extra=require(_0x902d('0x3'));var auth=require(_0x902d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x902d('0x5'));var controller=require(_0x902d('0x6'));router[_0x902d('0x7')]('/',auth[_0x902d('0x8')](),controller[_0x902d('0x9')]);router['get'](_0x902d('0xa'),auth[_0x902d('0x8')](),controller['show']);router[_0x902d('0x7')](_0x902d('0xb'),auth['isAuthenticated'](),controller[_0x902d('0xc')]);var upload=multer({'storage':multer[_0x902d('0xd')]({'destination':function(_0x2d4b6b,_0x3b680c,_0x521e35){_0x521e35(null,path[_0x902d('0xe')](config[_0x902d('0xf')],'server/files/sounds/original/'));},'filename':function(_0x510ed3,_0x3bd7f2,_0x46b69c){_0x3bd7f2[_0x902d('0x10')]=_0x3bd7f2[_0x902d('0x10')][_0x902d('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46b69c(null,util[_0x902d('0x12')]('%s-%s%s',path['basename'](_0x3bd7f2[_0x902d('0x10')],path[_0x902d('0x13')](_0x3bd7f2[_0x902d('0x10')])),Date[_0x902d('0x14')](),path[_0x902d('0x13')](_0x3bd7f2[_0x902d('0x10')])));}})});router['post']('/',upload['single'](_0x902d('0x15')),controller[_0x902d('0x16')]);router['put'](_0x902d('0xa'),auth[_0x902d('0x8')](),controller[_0x902d('0x17')]);router[_0x902d('0x18')](_0x902d('0xa'),auth[_0x902d('0x8')](),controller[_0x902d('0x18')]);module['exports']=router; \ No newline at end of file +var _0x7f1a=['replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x409e3a,_0x17632e){var _0x41900b=function(_0x340930){while(--_0x340930){_0x409e3a['push'](_0x409e3a['shift']());}};_0x41900b(++_0x17632e);}(_0x7f1a,0x87));var _0xa7f1=function(_0x2946c7,_0x29a1d8){_0x2946c7=_0x2946c7-0x0;var _0x39b708=_0x7f1a[_0x2946c7];return _0x39b708;};'use strict';var multer=require(_0xa7f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa7f1('0x1'));var express=require('express');var router=express[_0xa7f1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa7f1('0x3'));var interaction=require(_0xa7f1('0x4'));var config=require('../../config/environment');var controller=require(_0xa7f1('0x5'));router[_0xa7f1('0x6')]('/',auth[_0xa7f1('0x7')](),controller[_0xa7f1('0x8')]);router[_0xa7f1('0x6')]('/:id',auth[_0xa7f1('0x7')](),controller['show']);router[_0xa7f1('0x6')]('/:id/download',auth[_0xa7f1('0x7')](),controller[_0xa7f1('0x9')]);var upload=multer({'storage':multer[_0xa7f1('0xa')]({'destination':function(_0x5372a9,_0x5a9d90,_0x208351){_0x208351(null,path[_0xa7f1('0xb')](config[_0xa7f1('0xc')],_0xa7f1('0xd')));},'filename':function(_0x127057,_0x38c0c0,_0x4dc64b){_0x38c0c0['originalname']=_0x38c0c0[_0xa7f1('0xe')][_0xa7f1('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4dc64b(null,util[_0xa7f1('0x10')](_0xa7f1('0x11'),path[_0xa7f1('0x12')](_0x38c0c0[_0xa7f1('0xe')],path[_0xa7f1('0x13')](_0x38c0c0[_0xa7f1('0xe')])),Date[_0xa7f1('0x14')](),path[_0xa7f1('0x13')](_0x38c0c0[_0xa7f1('0xe')])));}})});router[_0xa7f1('0x15')]('/',upload[_0xa7f1('0x16')](_0xa7f1('0x17')),controller[_0xa7f1('0x18')]);router[_0xa7f1('0x19')](_0xa7f1('0x1a'),auth[_0xa7f1('0x7')](),controller[_0xa7f1('0x1b')]);router[_0xa7f1('0x1c')](_0xa7f1('0x1a'),auth[_0xa7f1('0x7')](),controller['delete']);module[_0xa7f1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5ff324a..068770f 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84a8=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x2237be,_0x2ed5c1){var _0x3312ab=function(_0x448a62){while(--_0x448a62){_0x2237be['push'](_0x2237be['shift']());}};_0x3312ab(++_0x2ed5c1);}(_0x84a8,0x1d7));var _0x884a=function(_0x468ac5,_0x2edfd5){_0x468ac5=_0x468ac5-0x0;var _0x33a807=_0x84a8[_0x468ac5];return _0x33a807;};'use strict';var Sequelize=require(_0x884a('0x0'));module[_0x884a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x884a('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x884a('0x3')]},'original_sampleCount':{'type':Sequelize[_0x884a('0x4')]},'original_channelCount':{'type':Sequelize[_0x884a('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x884a('0x5')]},'converted_format':{'type':Sequelize[_0x884a('0x2')]},'converted_duration':{'type':Sequelize[_0x884a('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x884a('0x4')]},'converted_channelCount':{'type':Sequelize[_0x884a('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc00a=['INTEGER','sequelize','STRING','name','BIGINT'];(function(_0x2e5baf,_0x4b77a1){var _0x4c0797=function(_0x32f4fc){while(--_0x32f4fc){_0x2e5baf['push'](_0x2e5baf['shift']());}};_0x4c0797(++_0x4b77a1);}(_0xc00a,0xbf));var _0xac00=function(_0x2dd22e,_0xec41fe){_0x2dd22e=_0x2dd22e-0x0;var _0x257b01=_0xc00a[_0x2dd22e];return _0x257b01;};'use strict';var Sequelize=require(_0xac00('0x0'));module['exports']={'name':{'type':Sequelize[_0xac00('0x1')],'unique':_0xac00('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xac00('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xac00('0x1')]},'original_format':{'type':Sequelize[_0xac00('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xac00('0x3')]},'original_channelCount':{'type':Sequelize[_0xac00('0x4')]},'original_bitRate':{'type':Sequelize[_0xac00('0x3')]},'original_sampleRate':{'type':Sequelize[_0xac00('0x4')]},'converted_format':{'type':Sequelize[_0xac00('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xac00('0x3')]},'converted_channelCount':{'type':Sequelize[_0xac00('0x4')]},'converted_bitRate':{'type':Sequelize[_0xac00('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xac00('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0d9528b..7f8f316 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca68=['map','Sound','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','download','save_name','converted_format','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','%s.%s','format','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','destroy','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Sounds','UserProfileResource','end','error','name','send','index'];(function(_0x4b4858,_0x497bf6){var _0x542db3=function(_0x57e91b){while(--_0x57e91b){_0x4b4858['push'](_0x4b4858['shift']());}};_0x542db3(++_0x497bf6);}(_0xca68,0x1ce));var _0x8ca6=function(_0x449907,_0x148b4b){_0x449907=_0x449907-0x0;var _0x376b0b=_0xca68[_0x449907];return _0x376b0b;};'use strict';var emlformat=require(_0x8ca6('0x0'));var rimraf=require(_0x8ca6('0x1'));var zipdir=require(_0x8ca6('0x2'));var jsonpatch=require(_0x8ca6('0x3'));var rp=require(_0x8ca6('0x4'));var moment=require(_0x8ca6('0x5'));var BPromise=require(_0x8ca6('0x6'));var Mustache=require(_0x8ca6('0x7'));var util=require('util');var path=require(_0x8ca6('0x8'));var sox=require('sox');var csv=require(_0x8ca6('0x9'));var ejs=require(_0x8ca6('0xa'));var fs=require('fs');var fs_extra=require(_0x8ca6('0xb'));var _=require('lodash');var squel=require(_0x8ca6('0xc'));var crypto=require(_0x8ca6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ca6('0x9'));var querystring=require(_0x8ca6('0xe'));var Papa=require('papaparse');var Redis=require(_0x8ca6('0xf'));var authService=require(_0x8ca6('0x10'));var qs=require(_0x8ca6('0x11'));var as=require(_0x8ca6('0x12'));var hardwareService=require(_0x8ca6('0x13'));var logger=require('../../config/logger')(_0x8ca6('0x14'));var utils=require(_0x8ca6('0x15'));var config=require(_0x8ca6('0x16'));var licenseUtil=require(_0x8ca6('0x17'));var db=require(_0x8ca6('0x18'))['db'];function respondWithStatusCode(_0x5d6587,_0x16afed){_0x16afed=_0x16afed||0xcc;return function(_0x5cabd5){if(_0x5cabd5){return _0x5d6587[_0x8ca6('0x19')](_0x16afed);}return _0x5d6587[_0x8ca6('0x1a')](_0x16afed)['end']();};}function respondWithResult(_0x300c05,_0x5390bc){_0x5390bc=_0x5390bc||0xc8;return function(_0x1c1589){if(_0x1c1589){return _0x300c05[_0x8ca6('0x1a')](_0x5390bc)[_0x8ca6('0x1b')](_0x1c1589);}};}function respondWithFilteredResult(_0x94dc53,_0x331c57){return function(_0x1fea43){if(_0x1fea43){var _0x56bbe9=typeof _0x331c57[_0x8ca6('0x1c')]===_0x8ca6('0x1d')&&typeof _0x331c57['limit']===_0x8ca6('0x1d');var _0x832cec=_0x1fea43[_0x8ca6('0x1e')];var _0xec4351=_0x56bbe9?0x0:_0x331c57[_0x8ca6('0x1c')];var _0x115850=_0x56bbe9?_0x1fea43[_0x8ca6('0x1e')]:_0x331c57[_0x8ca6('0x1c')]+_0x331c57['limit'];var _0x27db04;if(_0x115850>=_0x832cec){_0x115850=_0x832cec;_0x27db04=0xc8;}else{_0x27db04=0xce;}_0x94dc53[_0x8ca6('0x1a')](_0x27db04);return _0x94dc53[_0x8ca6('0x1f')](_0x8ca6('0x20'),_0xec4351+'-'+_0x115850+'/'+_0x832cec)['json'](_0x1fea43);}return null;};}function patchUpdates(_0x14dcbe){return function(_0x5868ef){try{jsonpatch[_0x8ca6('0x21')](_0x5868ef,_0x14dcbe,!![]);}catch(_0x248537){return BPromise[_0x8ca6('0x22')](_0x248537);}return _0x5868ef[_0x8ca6('0x23')]();};}function saveUpdates(_0xbe3a62,_0xbdb57e){return function(_0xe792f1){if(_0xe792f1){return _0xe792f1[_0x8ca6('0x24')](_0xbe3a62)[_0x8ca6('0x25')](function(_0x2631ff){return _0x2631ff;});}return null;};}function removeEntity(_0x334032,_0x3f2c43){return function(_0x2a55c1){if(_0x2a55c1){return _0x2a55c1['destroy']()[_0x8ca6('0x25')](function(){var _0x2e913c=_0x2a55c1[_0x8ca6('0x26')]({'plain':!![]});var _0x369742=_0x8ca6('0x27');return db[_0x8ca6('0x28')]['destroy']({'where':{'type':_0x369742,'resourceId':_0x2e913c['id']}})['then'](function(){return _0x2a55c1;});})[_0x8ca6('0x25')](function(){_0x334032[_0x8ca6('0x1a')](0xcc)[_0x8ca6('0x29')]();});}};}function handleEntityNotFound(_0x4c5888,_0x22d516){return function(_0x16e504){if(!_0x16e504){_0x4c5888[_0x8ca6('0x19')](0x194);}return _0x16e504;};}function handleError(_0x59b6e9,_0x329868){_0x329868=_0x329868||0x1f4;return function(_0x3ca4d6){logger[_0x8ca6('0x2a')](_0x3ca4d6['stack']);if(_0x3ca4d6[_0x8ca6('0x2b')]){delete _0x3ca4d6[_0x8ca6('0x2b')];}_0x59b6e9[_0x8ca6('0x1a')](_0x329868)[_0x8ca6('0x2c')](_0x3ca4d6);};}exports[_0x8ca6('0x2d')]=function(_0x43413e,_0x266a8c){var _0xc1e2ca={},_0x2dcb9f={},_0x5a4f9f={'count':0x0,'rows':[]};var _0x4058a1=_[_0x8ca6('0x2e')](db[_0x8ca6('0x2f')]['rawAttributes'],function(_0x5a8f51){return{'name':_0x5a8f51['fieldName'],'type':_0x5a8f51[_0x8ca6('0x30')]['key']};});_0x2dcb9f[_0x8ca6('0x31')]=_[_0x8ca6('0x2e')](_0x4058a1,_0x8ca6('0x2b'));_0x2dcb9f['query']=_['keys'](_0x43413e['query']);_0x2dcb9f[_0x8ca6('0x32')]=_[_0x8ca6('0x33')](_0x2dcb9f[_0x8ca6('0x31')],_0x2dcb9f[_0x8ca6('0x34')]);_0xc1e2ca[_0x8ca6('0x35')]=_[_0x8ca6('0x33')](_0x2dcb9f[_0x8ca6('0x31')],qs['fields'](_0x43413e[_0x8ca6('0x34')][_0x8ca6('0x36')]));_0xc1e2ca['attributes']=_0xc1e2ca[_0x8ca6('0x35')][_0x8ca6('0x37')]?_0xc1e2ca[_0x8ca6('0x35')]:_0x2dcb9f['model'];if(!_0x43413e[_0x8ca6('0x34')][_0x8ca6('0x38')](_0x8ca6('0x39'))){_0xc1e2ca[_0x8ca6('0x3a')]=qs[_0x8ca6('0x3a')](_0x43413e['query']['limit']);_0xc1e2ca[_0x8ca6('0x1c')]=qs[_0x8ca6('0x1c')](_0x43413e[_0x8ca6('0x34')][_0x8ca6('0x1c')]);}_0xc1e2ca['order']=qs[_0x8ca6('0x3b')](_0x43413e[_0x8ca6('0x34')][_0x8ca6('0x3b')]);_0xc1e2ca[_0x8ca6('0x3c')]=qs['filters'](_[_0x8ca6('0x3d')](_0x43413e[_0x8ca6('0x34')],_0x2dcb9f[_0x8ca6('0x32')]),_0x4058a1);if(_0x43413e[_0x8ca6('0x34')][_0x8ca6('0x3e')]){_0xc1e2ca[_0x8ca6('0x3c')]=_['merge'](_0xc1e2ca['where'],{'$or':_['map'](_0x4058a1,function(_0x3b5e79){if(_0x3b5e79[_0x8ca6('0x30')]!=='VIRTUAL'){var _0x4fcb15={};_0x4fcb15[_0x3b5e79[_0x8ca6('0x2b')]]={'$like':'%'+_0x43413e['query']['filter']+'%'};return _0x4fcb15;}})});}_0xc1e2ca=_[_0x8ca6('0x3f')]({},_0xc1e2ca,_0x43413e[_0x8ca6('0x40')]);var _0xec8638={'where':_0xc1e2ca[_0x8ca6('0x3c')]};return db[_0x8ca6('0x2f')][_0x8ca6('0x1e')](_0xec8638)['then'](function(_0x3aa58a){_0x5a4f9f['count']=_0x3aa58a;if(_0x43413e['query'][_0x8ca6('0x41')]){_0xc1e2ca[_0x8ca6('0x42')]=[{'all':!![]}];}return db['Sound'][_0x8ca6('0x43')](_0xc1e2ca);})[_0x8ca6('0x25')](function(_0x24c386){_0x5a4f9f[_0x8ca6('0x44')]=_0x24c386;return _0x5a4f9f;})[_0x8ca6('0x25')](respondWithFilteredResult(_0x266a8c,_0xc1e2ca))[_0x8ca6('0x45')](handleError(_0x266a8c,null));};exports[_0x8ca6('0x46')]=function(_0x328d8d,_0x57e2e9){var _0x21e3d7={'raw':!![],'where':{'id':_0x328d8d[_0x8ca6('0x47')]['id']}},_0x17be97={};_0x17be97[_0x8ca6('0x31')]=_[_0x8ca6('0x48')](db[_0x8ca6('0x2f')][_0x8ca6('0x49')]);_0x17be97['query']=_[_0x8ca6('0x48')](_0x328d8d[_0x8ca6('0x34')]);_0x17be97['filters']=_[_0x8ca6('0x33')](_0x17be97[_0x8ca6('0x31')],_0x17be97['query']);_0x21e3d7[_0x8ca6('0x35')]=_[_0x8ca6('0x33')](_0x17be97[_0x8ca6('0x31')],qs[_0x8ca6('0x36')](_0x328d8d['query'][_0x8ca6('0x36')]));_0x21e3d7['attributes']=_0x21e3d7[_0x8ca6('0x35')][_0x8ca6('0x37')]?_0x21e3d7[_0x8ca6('0x35')]:_0x17be97[_0x8ca6('0x31')];if(_0x328d8d[_0x8ca6('0x34')][_0x8ca6('0x41')]){_0x21e3d7[_0x8ca6('0x42')]=[{'all':!![]}];}_0x21e3d7=_[_0x8ca6('0x3f')]({},_0x21e3d7,_0x328d8d['options']);return db[_0x8ca6('0x2f')][_0x8ca6('0x4a')](_0x21e3d7)['then'](handleEntityNotFound(_0x57e2e9,null))[_0x8ca6('0x25')](respondWithResult(_0x57e2e9,null))['catch'](handleError(_0x57e2e9,null));};exports[_0x8ca6('0x4b')]=function(_0x4b42d8,_0x30aa2e,_0x5a6485){return db['Sound'][_0x8ca6('0x4a')]({'where':{'id':_0x4b42d8[_0x8ca6('0x47')]['id']},'attributes':[_0x8ca6('0x2b'),_0x8ca6('0x4c'),_0x8ca6('0x4d')],'raw':!![]})[_0x8ca6('0x25')](handleEntityNotFound(_0x30aa2e,null))[_0x8ca6('0x25')](function(_0x2cc9c2){if(_0x2cc9c2){if(!fs['existsSync'](path['join'](config[_0x8ca6('0x4e')],_0x8ca6('0x4f'),_0x2cc9c2['save_name']+'.'+_0x2cc9c2['converted_format']))){throw new db[(_0x8ca6('0x50'))][(_0x8ca6('0x51'))](_0x8ca6('0x52'));}return _0x30aa2e[_0x8ca6('0x4b')](path[_0x8ca6('0x53')](config[_0x8ca6('0x4e')],'server/files/sounds/converted',util['format'](_0x8ca6('0x54'),_0x2cc9c2[_0x8ca6('0x4c')],_0x2cc9c2[_0x8ca6('0x4d')])),util[_0x8ca6('0x55')](_0x8ca6('0x54'),_0x2cc9c2[_0x8ca6('0x2b')],_0x2cc9c2['converted_format']));}return null;})[_0x8ca6('0x45')](handleError(_0x30aa2e,null));};exports[_0x8ca6('0x56')]=function(_0x5bfae2,_0x4bc868,_0xe9512a){var _0x3ebef4={'name':path[_0x8ca6('0x57')](_0x5bfae2['file'][_0x8ca6('0x58')],path[_0x8ca6('0x59')](_0x5bfae2['file']['originalname'])),'save_name':path[_0x8ca6('0x57')](_0x5bfae2[_0x8ca6('0x5a')][_0x8ca6('0x5b')],path[_0x8ca6('0x59')](_0x5bfae2[_0x8ca6('0x5a')][_0x8ca6('0x5b')])),'original_format':path[_0x8ca6('0x59')](_0x5bfae2[_0x8ca6('0x5a')][_0x8ca6('0x58')])[_0x8ca6('0x5c')](0x1),'converted_format':_0x8ca6('0x5d')};var _0x1d8ea9=path[_0x8ca6('0x53')](config['root'],_0x8ca6('0x5e'),_0x5bfae2[_0x8ca6('0x5a')]['filename']);var _0x27b2c6=path['join'](config['root'],_0x8ca6('0x4f'),util[_0x8ca6('0x55')](_0x8ca6('0x54'),path[_0x8ca6('0x57')](_0x5bfae2[_0x8ca6('0x5a')]['filename'],path[_0x8ca6('0x59')](_0x5bfae2[_0x8ca6('0x5a')]['filename'])),_0x3ebef4['converted_format']));logger['info'](_0x8ca6('0x5f'),_0x1d8ea9);logger[_0x8ca6('0x60')](_0x8ca6('0x61'),_0x27b2c6);try{fs[_0x8ca6('0x62')](_0x1d8ea9,parseInt(_0x8ca6('0x63'),0x8));var _0xf8d032=sox[_0x8ca6('0x64')](_0x1d8ea9,_0x27b2c6,{'sampleRate':0x1f40,'format':_0x8ca6('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf8d032['on'](_0x8ca6('0x2a'),function(_0x41f07c){fs[_0x8ca6('0x65')](_0x1d8ea9);_0x4bc868[_0x8ca6('0x1a')](0x1f4)[_0x8ca6('0x2c')](_0x41f07c);});_0xf8d032['on'](_0x8ca6('0x66'),function(_0x2d7f2e){_0x3ebef4[_0x8ca6('0x67')]=isNaN(_0x2d7f2e[_0x8ca6('0x68')])?null:_0x2d7f2e[_0x8ca6('0x68')]*0x3e8;_0x3ebef4[_0x8ca6('0x69')]=isNaN(_0x2d7f2e['sampleCount'])?null:_0x2d7f2e[_0x8ca6('0x6a')];_0x3ebef4[_0x8ca6('0x6b')]=isNaN(_0x2d7f2e['channelCount'])?null:_0x2d7f2e[_0x8ca6('0x6c')];_0x3ebef4[_0x8ca6('0x6d')]=isNaN(_0x2d7f2e['bitRate'])?null:_0x2d7f2e[_0x8ca6('0x6e')];_0x3ebef4[_0x8ca6('0x6f')]=isNaN(_0x2d7f2e[_0x8ca6('0x70')])?null:_0x2d7f2e['sampleRate'];});_0xf8d032['on']('dest',function(_0x3f9d8f){_0x3ebef4[_0x8ca6('0x71')]=isNaN(_0x3f9d8f[_0x8ca6('0x68')])?null:_0x3f9d8f[_0x8ca6('0x68')]*0x3e8;_0x3ebef4['converted_sampleCount']=isNaN(_0x3f9d8f[_0x8ca6('0x6a')])?null:_0x3f9d8f[_0x8ca6('0x6a')];_0x3ebef4[_0x8ca6('0x72')]=isNaN(_0x3f9d8f[_0x8ca6('0x6c')])?null:_0x3f9d8f['channelCount'];_0x3ebef4[_0x8ca6('0x73')]=isNaN(_0x3f9d8f['bitRate'])?null:_0x3f9d8f[_0x8ca6('0x6e')];_0x3ebef4[_0x8ca6('0x74')]=isNaN(_0x3f9d8f[_0x8ca6('0x70')])?null:_0x3f9d8f['sampleRate'];});_0xf8d032['on'](_0x8ca6('0x29'),function(){fs[_0x8ca6('0x62')](_0x27b2c6,parseInt('0777',0x8));return db[_0x8ca6('0x2f')][_0x8ca6('0x56')](_0x3ebef4)[_0x8ca6('0x25')](function(_0x1722c1){var _0x260863={'role':_0x5bfae2['body']['role'],'userProfileId':_0x5bfae2[_0x8ca6('0x75')][_0x8ca6('0x76')]};if(!_0x260863)throw new Error(_0x8ca6('0x77'));if(_0x260863['role']===_0x8ca6('0x78')){var _0xe1b9ee=_0x1722c1[_0x8ca6('0x26')]({'plain':!![]});return db[_0x8ca6('0x79')]['find']({'where':{'name':_0x8ca6('0x27'),'userProfileId':_0x260863['userProfileId']},'raw':!![]})[_0x8ca6('0x25')](function(_0x426523){if(_0x426523&&_0x426523['autoAssociation']===0x0){return db[_0x8ca6('0x28')]['create']({'name':_0xe1b9ee['name'],'resourceId':_0xe1b9ee['id'],'type':_0x426523[_0x8ca6('0x2b')],'sectionId':_0x426523['id']},{})[_0x8ca6('0x25')](function(){return _0x1722c1;});}else{return _0x1722c1;}})['catch'](function(_0x229afa){logger[_0x8ca6('0x2a')](_0x8ca6('0x7a'),_0x229afa);throw _0x229afa;});}return _0x1722c1;})[_0x8ca6('0x25')](respondWithResult(_0x4bc868,null))['catch'](handleError(_0x4bc868,null));});_0xf8d032['start']();}catch(_0x4b3858){_0x4bc868[_0x8ca6('0x1a')](0x1f4)['send'](_0x4b3858);}};exports[_0x8ca6('0x24')]=function(_0x37eac9,_0x44d671,_0x1bb5a0){return db[_0x8ca6('0x2f')][_0x8ca6('0x4a')]({'where':{'id':_0x37eac9['params']['id']}})[_0x8ca6('0x25')](handleEntityNotFound(_0x44d671,null))['then'](saveUpdates(_['pick'](_0x37eac9[_0x8ca6('0x75')],[_0x8ca6('0x2b'),_0x8ca6('0x7b')]),null))[_0x8ca6('0x25')](respondWithResult(_0x44d671,null))['catch'](handleError(_0x44d671,null));};exports[_0x8ca6('0x7c')]=function(_0x8c2b58,_0x4650a4,_0x500fdb){return db['Sound'][_0x8ca6('0x4a')]({'where':{'id':_0x8c2b58[_0x8ca6('0x47')]['id']}})[_0x8ca6('0x25')](function(_0x3e50b6){if(_0x3e50b6){return _0x3e50b6[_0x8ca6('0x7d')]();}})[_0x8ca6('0x25')](function(_0x7d2cda){var _0x290a17=path['join'](config[_0x8ca6('0x4e')],'server/files/sounds/original',util[_0x8ca6('0x55')](_0x8ca6('0x54'),_0x7d2cda[_0x8ca6('0x4c')],_0x7d2cda[_0x8ca6('0x7e')]));var _0x1bd4dc=path[_0x8ca6('0x53')](config[_0x8ca6('0x4e')],_0x8ca6('0x4f'),util[_0x8ca6('0x55')]('%s.%s',_0x7d2cda[_0x8ca6('0x4c')],_0x7d2cda[_0x8ca6('0x4d')]));fs['unlinkSync'](_0x290a17);fs[_0x8ca6('0x65')](_0x1bd4dc);return _0x7d2cda;})['then'](function(_0x12fe5e){if(_0x12fe5e){return _0x4650a4[_0x8ca6('0x1a')](0xcc)[_0x8ca6('0x29')]();}})[_0x8ca6('0x25')](handleEntityNotFound(_0x4650a4,null))[_0x8ca6('0x45')](handleError(_0x4650a4,null));}; \ No newline at end of file +var _0xc34b=['query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Sound','includeAll','include','rows','catch','params','find','download','save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','converted_format','Sound\x20upload\x20filepath:\x20%s','info','0777','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','chmodSync','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc34b,0x146));var _0xbc34=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0xc34b[_0x5ef7b8];return _0x2c7148;};'use strict';var emlformat=require(_0xbc34('0x0'));var rimraf=require(_0xbc34('0x1'));var zipdir=require(_0xbc34('0x2'));var jsonpatch=require(_0xbc34('0x3'));var rp=require(_0xbc34('0x4'));var moment=require('moment');var BPromise=require(_0xbc34('0x5'));var Mustache=require('mustache');var util=require(_0xbc34('0x6'));var path=require(_0xbc34('0x7'));var sox=require(_0xbc34('0x8'));var csv=require('to-csv');var ejs=require(_0xbc34('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc34('0xa'));var crypto=require('crypto');var jsforce=require(_0xbc34('0xb'));var deskjs=require(_0xbc34('0xc'));var toCsv=require(_0xbc34('0xd'));var querystring=require('querystring');var Papa=require(_0xbc34('0xe'));var Redis=require(_0xbc34('0xf'));var authService=require(_0xbc34('0x10'));var qs=require(_0xbc34('0x11'));var as=require(_0xbc34('0x12'));var hardwareService=require(_0xbc34('0x13'));var logger=require(_0xbc34('0x14'))('api');var utils=require(_0xbc34('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbc34('0x16'))['db'];function respondWithStatusCode(_0x4eed13,_0x32fc35){_0x32fc35=_0x32fc35||0xcc;return function(_0x11dca0){if(_0x11dca0){return _0x4eed13['sendStatus'](_0x32fc35);}return _0x4eed13['status'](_0x32fc35)[_0xbc34('0x17')]();};}function respondWithResult(_0x17af0f,_0x5698e7){_0x5698e7=_0x5698e7||0xc8;return function(_0x4608eb){if(_0x4608eb){return _0x17af0f[_0xbc34('0x18')](_0x5698e7)[_0xbc34('0x19')](_0x4608eb);}};}function respondWithFilteredResult(_0x5120ab,_0x4155f5){return function(_0x2624b4){if(_0x2624b4){var _0x3f4286=typeof _0x4155f5[_0xbc34('0x1a')]===_0xbc34('0x1b')&&typeof _0x4155f5['limit']===_0xbc34('0x1b');var _0x4f479f=_0x2624b4[_0xbc34('0x1c')];var _0x55e54a=_0x3f4286?0x0:_0x4155f5[_0xbc34('0x1a')];var _0x1efd65=_0x3f4286?_0x2624b4[_0xbc34('0x1c')]:_0x4155f5[_0xbc34('0x1a')]+_0x4155f5[_0xbc34('0x1d')];var _0x1f6e3d;if(_0x1efd65>=_0x4f479f){_0x1efd65=_0x4f479f;_0x1f6e3d=0xc8;}else{_0x1f6e3d=0xce;}_0x5120ab[_0xbc34('0x18')](_0x1f6e3d);return _0x5120ab[_0xbc34('0x1e')](_0xbc34('0x1f'),_0x55e54a+'-'+_0x1efd65+'/'+_0x4f479f)[_0xbc34('0x19')](_0x2624b4);}return null;};}function patchUpdates(_0xbe1b52){return function(_0x3248a2){try{jsonpatch[_0xbc34('0x20')](_0x3248a2,_0xbe1b52,!![]);}catch(_0x2796f2){return BPromise[_0xbc34('0x21')](_0x2796f2);}return _0x3248a2[_0xbc34('0x22')]();};}function saveUpdates(_0x4a7e36,_0x2ff0fe){return function(_0x290e4b){if(_0x290e4b){return _0x290e4b[_0xbc34('0x23')](_0x4a7e36)[_0xbc34('0x24')](function(_0x408116){return _0x408116;});}return null;};}function removeEntity(_0x148b66,_0x5e5e7d){return function(_0x3a3758){if(_0x3a3758){return _0x3a3758[_0xbc34('0x25')]()[_0xbc34('0x24')](function(){var _0x4a38c7=_0x3a3758[_0xbc34('0x26')]({'plain':!![]});var _0x48f938=_0xbc34('0x27');return db[_0xbc34('0x28')]['destroy']({'where':{'type':_0x48f938,'resourceId':_0x4a38c7['id']}})['then'](function(){return _0x3a3758;});})[_0xbc34('0x24')](function(){_0x148b66[_0xbc34('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x584263,_0x577ae1){return function(_0x52ccec){if(!_0x52ccec){_0x584263[_0xbc34('0x29')](0x194);}return _0x52ccec;};}function handleError(_0xf6cdd1,_0x4c5aa4){_0x4c5aa4=_0x4c5aa4||0x1f4;return function(_0x1a39af){logger[_0xbc34('0x2a')](_0x1a39af[_0xbc34('0x2b')]);if(_0x1a39af[_0xbc34('0x2c')]){delete _0x1a39af[_0xbc34('0x2c')];}_0xf6cdd1[_0xbc34('0x18')](_0x4c5aa4)[_0xbc34('0x2d')](_0x1a39af);};}exports[_0xbc34('0x2e')]=function(_0x5b4321,_0x2ee2af){var _0x3ceda6={},_0x5e1c4e={},_0x44639c={'count':0x0,'rows':[]};var _0x17fa10=_[_0xbc34('0x2f')](db['Sound'][_0xbc34('0x30')],function(_0x411627){return{'name':_0x411627[_0xbc34('0x31')],'type':_0x411627[_0xbc34('0x32')][_0xbc34('0x33')]};});_0x5e1c4e['model']=_[_0xbc34('0x2f')](_0x17fa10,_0xbc34('0x2c'));_0x5e1c4e[_0xbc34('0x34')]=_[_0xbc34('0x35')](_0x5b4321[_0xbc34('0x34')]);_0x5e1c4e[_0xbc34('0x36')]=_[_0xbc34('0x37')](_0x5e1c4e['model'],_0x5e1c4e[_0xbc34('0x34')]);_0x3ceda6['attributes']=_[_0xbc34('0x37')](_0x5e1c4e[_0xbc34('0x38')],qs[_0xbc34('0x39')](_0x5b4321[_0xbc34('0x34')][_0xbc34('0x39')]));_0x3ceda6[_0xbc34('0x3a')]=_0x3ceda6[_0xbc34('0x3a')][_0xbc34('0x3b')]?_0x3ceda6['attributes']:_0x5e1c4e[_0xbc34('0x38')];if(!_0x5b4321['query']['hasOwnProperty'](_0xbc34('0x3c'))){_0x3ceda6[_0xbc34('0x1d')]=qs['limit'](_0x5b4321[_0xbc34('0x34')]['limit']);_0x3ceda6[_0xbc34('0x1a')]=qs[_0xbc34('0x1a')](_0x5b4321[_0xbc34('0x34')][_0xbc34('0x1a')]);}_0x3ceda6[_0xbc34('0x3d')]=qs[_0xbc34('0x3e')](_0x5b4321[_0xbc34('0x34')][_0xbc34('0x3e')]);_0x3ceda6['where']=qs['filters'](_[_0xbc34('0x3f')](_0x5b4321['query'],_0x5e1c4e['filters']),_0x17fa10);if(_0x5b4321[_0xbc34('0x34')][_0xbc34('0x40')]){_0x3ceda6[_0xbc34('0x41')]=_[_0xbc34('0x42')](_0x3ceda6['where'],{'$or':_['map'](_0x17fa10,function(_0x47315b){if(_0x47315b[_0xbc34('0x32')]!==_0xbc34('0x43')){var _0x27ae93={};_0x27ae93[_0x47315b[_0xbc34('0x2c')]]={'$like':'%'+_0x5b4321['query'][_0xbc34('0x40')]+'%'};return _0x27ae93;}})});}_0x3ceda6=_['merge']({},_0x3ceda6,_0x5b4321[_0xbc34('0x44')]);var _0x2fbf84={'where':_0x3ceda6[_0xbc34('0x41')]};return db[_0xbc34('0x45')][_0xbc34('0x1c')](_0x2fbf84)[_0xbc34('0x24')](function(_0x2925f7){_0x44639c[_0xbc34('0x1c')]=_0x2925f7;if(_0x5b4321['query'][_0xbc34('0x46')]){_0x3ceda6[_0xbc34('0x47')]=[{'all':!![]}];}return db[_0xbc34('0x45')]['findAll'](_0x3ceda6);})[_0xbc34('0x24')](function(_0x10d846){_0x44639c[_0xbc34('0x48')]=_0x10d846;return _0x44639c;})['then'](respondWithFilteredResult(_0x2ee2af,_0x3ceda6))[_0xbc34('0x49')](handleError(_0x2ee2af,null));};exports['show']=function(_0x3191e4,_0x5dee58){var _0x258663={'raw':!![],'where':{'id':_0x3191e4[_0xbc34('0x4a')]['id']}},_0x237951={};_0x237951['model']=_['keys'](db[_0xbc34('0x45')][_0xbc34('0x30')]);_0x237951['query']=_[_0xbc34('0x35')](_0x3191e4[_0xbc34('0x34')]);_0x237951[_0xbc34('0x36')]=_['intersection'](_0x237951['model'],_0x237951[_0xbc34('0x34')]);_0x258663[_0xbc34('0x3a')]=_[_0xbc34('0x37')](_0x237951[_0xbc34('0x38')],qs[_0xbc34('0x39')](_0x3191e4[_0xbc34('0x34')][_0xbc34('0x39')]));_0x258663['attributes']=_0x258663[_0xbc34('0x3a')][_0xbc34('0x3b')]?_0x258663[_0xbc34('0x3a')]:_0x237951[_0xbc34('0x38')];if(_0x3191e4[_0xbc34('0x34')][_0xbc34('0x46')]){_0x258663[_0xbc34('0x47')]=[{'all':!![]}];}_0x258663=_[_0xbc34('0x42')]({},_0x258663,_0x3191e4[_0xbc34('0x44')]);return db['Sound'][_0xbc34('0x4b')](_0x258663)['then'](handleEntityNotFound(_0x5dee58,null))['then'](respondWithResult(_0x5dee58,null))[_0xbc34('0x49')](handleError(_0x5dee58,null));};exports[_0xbc34('0x4c')]=function(_0x4dee2f,_0xc7d6de,_0x21e1a4){return db['Sound'][_0xbc34('0x4b')]({'where':{'id':_0x4dee2f[_0xbc34('0x4a')]['id']},'attributes':[_0xbc34('0x2c'),_0xbc34('0x4d'),'converted_format'],'raw':!![]})[_0xbc34('0x24')](handleEntityNotFound(_0xc7d6de,null))[_0xbc34('0x24')](function(_0x55996e){if(_0x55996e){if(!fs[_0xbc34('0x4e')](path[_0xbc34('0x4f')](config['root'],_0xbc34('0x50'),_0x55996e['save_name']+'.'+_0x55996e['converted_format']))){throw new db[(_0xbc34('0x51'))][(_0xbc34('0x52'))](_0xbc34('0x53'));}return _0xc7d6de[_0xbc34('0x4c')](path[_0xbc34('0x4f')](config[_0xbc34('0x54')],_0xbc34('0x50'),util['format']('%s.%s',_0x55996e['save_name'],_0x55996e['converted_format'])),util[_0xbc34('0x55')](_0xbc34('0x56'),_0x55996e[_0xbc34('0x2c')],_0x55996e['converted_format']));}return null;})[_0xbc34('0x49')](handleError(_0xc7d6de,null));};exports[_0xbc34('0x57')]=function(_0x4e1c5f,_0x14edb3,_0x598d44){var _0x1719b9={'name':path[_0xbc34('0x58')](_0x4e1c5f[_0xbc34('0x59')][_0xbc34('0x5a')],path['extname'](_0x4e1c5f['file']['originalname'])),'save_name':path['basename'](_0x4e1c5f[_0xbc34('0x59')][_0xbc34('0x5b')],path[_0xbc34('0x5c')](_0x4e1c5f[_0xbc34('0x59')][_0xbc34('0x5b')])),'original_format':path['extname'](_0x4e1c5f[_0xbc34('0x59')]['originalname'])[_0xbc34('0x5d')](0x1),'converted_format':'wav'};var _0x115dd8=path[_0xbc34('0x4f')](config[_0xbc34('0x54')],_0xbc34('0x5e'),_0x4e1c5f[_0xbc34('0x59')]['filename']);var _0x2a1251=path['join'](config[_0xbc34('0x54')],_0xbc34('0x50'),util[_0xbc34('0x55')](_0xbc34('0x56'),path['basename'](_0x4e1c5f[_0xbc34('0x59')][_0xbc34('0x5b')],path['extname'](_0x4e1c5f['file'][_0xbc34('0x5b')])),_0x1719b9[_0xbc34('0x5f')]));logger['info'](_0xbc34('0x60'),_0x115dd8);logger[_0xbc34('0x61')]('Sound\x20upload\x20destination:\x20%s',_0x2a1251);try{fs['chmodSync'](_0x115dd8,parseInt(_0xbc34('0x62'),0x8));var _0x270861=sox[_0xbc34('0x63')](_0x115dd8,_0x2a1251,{'sampleRate':0x1f40,'format':_0xbc34('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x270861['on'](_0xbc34('0x2a'),function(_0x59c296){fs[_0xbc34('0x65')](_0x115dd8);_0x14edb3[_0xbc34('0x18')](0x1f4)[_0xbc34('0x2d')](_0x59c296);});_0x270861['on']('src',function(_0x574a7d){_0x1719b9[_0xbc34('0x66')]=isNaN(_0x574a7d[_0xbc34('0x67')])?null:_0x574a7d[_0xbc34('0x67')]*0x3e8;_0x1719b9[_0xbc34('0x68')]=isNaN(_0x574a7d[_0xbc34('0x69')])?null:_0x574a7d[_0xbc34('0x69')];_0x1719b9['original_channelCount']=isNaN(_0x574a7d[_0xbc34('0x6a')])?null:_0x574a7d['channelCount'];_0x1719b9[_0xbc34('0x6b')]=isNaN(_0x574a7d[_0xbc34('0x6c')])?null:_0x574a7d[_0xbc34('0x6c')];_0x1719b9[_0xbc34('0x6d')]=isNaN(_0x574a7d[_0xbc34('0x6e')])?null:_0x574a7d[_0xbc34('0x6e')];});_0x270861['on'](_0xbc34('0x6f'),function(_0x3f1bee){_0x1719b9[_0xbc34('0x70')]=isNaN(_0x3f1bee['duration'])?null:_0x3f1bee['duration']*0x3e8;_0x1719b9[_0xbc34('0x71')]=isNaN(_0x3f1bee['sampleCount'])?null:_0x3f1bee[_0xbc34('0x69')];_0x1719b9['converted_channelCount']=isNaN(_0x3f1bee[_0xbc34('0x6a')])?null:_0x3f1bee[_0xbc34('0x6a')];_0x1719b9['converted_bitRate']=isNaN(_0x3f1bee[_0xbc34('0x6c')])?null:_0x3f1bee[_0xbc34('0x6c')];_0x1719b9[_0xbc34('0x72')]=isNaN(_0x3f1bee['sampleRate'])?null:_0x3f1bee[_0xbc34('0x6e')];});_0x270861['on'](_0xbc34('0x17'),function(){fs[_0xbc34('0x73')](_0x2a1251,parseInt(_0xbc34('0x62'),0x8));return db['Sound'][_0xbc34('0x57')](_0x1719b9)[_0xbc34('0x24')](function(_0x1d6606){var _0x355c10={'role':_0x4e1c5f['body']['role'],'userProfileId':_0x4e1c5f[_0xbc34('0x74')]['userProfileId']};if(!_0x355c10)throw new Error(_0xbc34('0x75'));if(_0x355c10[_0xbc34('0x76')]==='user'){var _0x770244=_0x1d6606[_0xbc34('0x26')]({'plain':!![]});return db[_0xbc34('0x77')][_0xbc34('0x4b')]({'where':{'name':_0xbc34('0x27'),'userProfileId':_0x355c10[_0xbc34('0x78')]},'raw':!![]})[_0xbc34('0x24')](function(_0x338f53){if(_0x338f53&&_0x338f53[_0xbc34('0x79')]===0x0){return db[_0xbc34('0x28')][_0xbc34('0x57')]({'name':_0x770244[_0xbc34('0x2c')],'resourceId':_0x770244['id'],'type':_0x338f53[_0xbc34('0x2c')],'sectionId':_0x338f53['id']},{})[_0xbc34('0x24')](function(){return _0x1d6606;});}else{return _0x1d6606;}})[_0xbc34('0x49')](function(_0x531fbb){logger[_0xbc34('0x2a')](_0xbc34('0x7a'),_0x531fbb);throw _0x531fbb;});}return _0x1d6606;})[_0xbc34('0x24')](respondWithResult(_0x14edb3,null))[_0xbc34('0x49')](handleError(_0x14edb3,null));});_0x270861[_0xbc34('0x7b')]();}catch(_0x246c3f){_0x14edb3[_0xbc34('0x18')](0x1f4)[_0xbc34('0x2d')](_0x246c3f);}};exports[_0xbc34('0x23')]=function(_0x34c6cf,_0x41cc6c,_0x4fd841){return db[_0xbc34('0x45')][_0xbc34('0x4b')]({'where':{'id':_0x34c6cf[_0xbc34('0x4a')]['id']}})[_0xbc34('0x24')](handleEntityNotFound(_0x41cc6c,null))[_0xbc34('0x24')](saveUpdates(_['pick'](_0x34c6cf[_0xbc34('0x74')],[_0xbc34('0x2c'),'description']),null))[_0xbc34('0x24')](respondWithResult(_0x41cc6c,null))[_0xbc34('0x49')](handleError(_0x41cc6c,null));};exports[_0xbc34('0x7c')]=function(_0x51740b,_0x4c9dda,_0x2fc9a5){return db['Sound']['find']({'where':{'id':_0x51740b['params']['id']}})[_0xbc34('0x24')](function(_0x16a65f){if(_0x16a65f){return _0x16a65f[_0xbc34('0x25')]();}})[_0xbc34('0x24')](function(_0x3fd3fc){var _0x505990=path['join'](config['root'],_0xbc34('0x5e'),util['format'](_0xbc34('0x56'),_0x3fd3fc[_0xbc34('0x4d')],_0x3fd3fc[_0xbc34('0x7d')]));var _0xe589b8=path['join'](config[_0xbc34('0x54')],'server/files/sounds/converted',util[_0xbc34('0x55')](_0xbc34('0x56'),_0x3fd3fc['save_name'],_0x3fd3fc[_0xbc34('0x5f')]));fs[_0xbc34('0x65')](_0x505990);fs['unlinkSync'](_0xe589b8);return _0x3fd3fc;})[_0xbc34('0x24')](function(_0x320ea9){if(_0x320ea9){return _0x4c9dda[_0xbc34('0x18')](0xcc)['end']();}})[_0xbc34('0x24')](handleEntityNotFound(_0x4c9dda,null))[_0xbc34('0x49')](handleError(_0x4c9dda,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 9437162..c250df7 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9047=['../../config/environment','exports','define','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x226e5b,_0x4935ed){var _0x3c44d3=function(_0x4b3077){while(--_0x4b3077){_0x226e5b['push'](_0x226e5b['shift']());}};_0x3c44d3(++_0x4935ed);}(_0x9047,0x159));var _0x7904=function(_0xbbf40c,_0x1493a8){_0xbbf40c=_0xbbf40c-0x0;var _0x42c8ad=_0x9047[_0xbbf40c];return _0x42c8ad;};'use strict';var _=require(_0x7904('0x0'));var util=require(_0x7904('0x1'));var logger=require(_0x7904('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7904('0x3'));var rp=require(_0x7904('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7904('0x5'));var config=require(_0x7904('0x6'));var attributes=require('./sound.attributes');module[_0x7904('0x7')]=function(_0xa88502,_0x425d39){return _0xa88502[_0x7904('0x8')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0310=['exports','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xdcf175,_0x4dfa75){var _0x45df88=function(_0x287458){while(--_0x287458){_0xdcf175['push'](_0xdcf175['shift']());}};_0x45df88(++_0x4dfa75);}(_0x0310,0xbd));var _0x0031=function(_0x27ce5b,_0x4ec394){_0x27ce5b=_0x27ce5b-0x0;var _0x2e4666=_0x0310[_0x27ce5b];return _0x2e4666;};'use strict';var _=require(_0x0031('0x0'));var util=require(_0x0031('0x1'));var logger=require(_0x0031('0x2'))(_0x0031('0x3'));var moment=require(_0x0031('0x4'));var BPromise=require('bluebird');var rp=require(_0x0031('0x5'));var fs=require('fs');var path=require(_0x0031('0x6'));var rimraf=require(_0x0031('0x7'));var config=require(_0x0031('0x8'));var attributes=require('./sound.attributes');module[_0x0031('0x9')]=function(_0x131c85,_0x582b7e){return _0x131c85['define']('Sound',attributes,{'tableName':_0x0031('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 5735fa3..bd1a5b1 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfce2=['attributes','include','map','model','ShowSound','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','find','options','raw','where'];(function(_0x2da576,_0x27e8f1){var _0x4d38db=function(_0x316267){while(--_0x316267){_0x2da576['push'](_0x2da576['shift']());}};_0x4d38db(++_0x27e8f1);}(_0xfce2,0x145));var _0x2fce=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfce2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2fce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2fce('0x1'));var fs=require('fs');var Redis=require(_0x2fce('0x2'));var db=require(_0x2fce('0x3'))['db'];var utils=require(_0x2fce('0x4'));var logger=require(_0x2fce('0x5'))(_0x2fce('0x6'));var config=require('../../config/environment');var jayson=require(_0x2fce('0x7'));var client=jayson[_0x2fce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dc21e,_0x4a9663,_0x3f6cf4){return new BPromise(function(_0x419fa9,_0x167fef){return client[_0x2fce('0x9')](_0x5dc21e,_0x3f6cf4)[_0x2fce('0xa')](function(_0x4e309f){logger[_0x2fce('0xb')](_0x2fce('0xc'),_0x4a9663,'request\x20sent');logger['debug'](_0x2fce('0xd'),_0x4a9663,_0x2fce('0xe'),JSON[_0x2fce('0xf')](_0x4e309f));if(_0x4e309f[_0x2fce('0x10')]){if(_0x4e309f[_0x2fce('0x10')][_0x2fce('0x11')]===0x1f4){logger[_0x2fce('0x10')](_0x2fce('0xc'),_0x4a9663,_0x4e309f[_0x2fce('0x10')][_0x2fce('0x12')]);return _0x167fef(_0x4e309f[_0x2fce('0x10')][_0x2fce('0x12')]);}logger[_0x2fce('0x10')](_0x2fce('0xc'),_0x4a9663,_0x4e309f[_0x2fce('0x10')][_0x2fce('0x12')]);return _0x419fa9(_0x4e309f['error']['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x4a9663,_0x2fce('0xe'));_0x419fa9(_0x4e309f['result'][_0x2fce('0x12')]);}})['catch'](function(_0x2e29fe){logger[_0x2fce('0x10')]('Sound,\x20%s,\x20%s',_0x4a9663,_0x2e29fe);_0x167fef(_0x2e29fe);});});}exports['ShowSound']=function(_0xe5ba88){var _0x3a2090=this;return new Promise(function(_0x35c217,_0x15687f){return db['Sound'][_0x2fce('0x13')]({'raw':_0xe5ba88[_0x2fce('0x14')]?_0xe5ba88['options'][_0x2fce('0x15')]===undefined?!![]:![]:!![],'where':_0xe5ba88['options']?_0xe5ba88[_0x2fce('0x14')][_0x2fce('0x16')]||null:null,'attributes':_0xe5ba88[_0x2fce('0x14')]?_0xe5ba88[_0x2fce('0x14')][_0x2fce('0x17')]||null:null,'include':_0xe5ba88['options']?_0xe5ba88['options'][_0x2fce('0x18')]?_[_0x2fce('0x19')](_0xe5ba88[_0x2fce('0x14')][_0x2fce('0x18')],function(_0x2c8339){return{'model':db[_0x2c8339[_0x2fce('0x1a')]],'as':_0x2c8339['as'],'attributes':_0x2c8339[_0x2fce('0x17')],'include':_0x2c8339[_0x2fce('0x18')]?_['map'](_0x2c8339[_0x2fce('0x18')],function(_0x53fabb){return{'model':db[_0x53fabb[_0x2fce('0x1a')]],'as':_0x53fabb['as'],'attributes':_0x53fabb[_0x2fce('0x17')],'include':_0x53fabb[_0x2fce('0x18')]?_['map'](_0x53fabb[_0x2fce('0x18')],function(_0x4bcbe5){return{'model':db[_0x4bcbe5[_0x2fce('0x1a')]],'as':_0x4bcbe5['as'],'attributes':_0x4bcbe5['attributes']};}):[]};}):[]};}):[]:[]})[_0x2fce('0xa')](function(_0x1ede16){logger[_0x2fce('0xb')](_0x2fce('0x1b'),_0xe5ba88);logger[_0x2fce('0x1c')]('ShowSound',_0xe5ba88,JSON[_0x2fce('0xf')](_0x1ede16));_0x35c217(_0x1ede16);})['catch'](function(_0x5cc668){logger['error']('ShowSound',_0x5cc668[_0x2fce('0x12')],_0xe5ba88);_0x15687f(_0x3a2090[_0x2fce('0x10')](0x1f4,_0x5cc668[_0x2fce('0x12')]));});});}; \ No newline at end of file +var _0xce9f=['where','include','map','model','attributes','ShowSound','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Sound','find','options','raw'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0xce9f,0xdf));var _0xfce9=function(_0x408d62,_0x3d7a56){_0x408d62=_0x408d62-0x0;var _0x5d03cb=_0xce9f[_0x408d62];return _0x5d03cb;};'use strict';var _=require('lodash');var util=require(_0xfce9('0x0'));var moment=require(_0xfce9('0x1'));var BPromise=require(_0xfce9('0x2'));var rs=require(_0xfce9('0x3'));var fs=require('fs');var Redis=require(_0xfce9('0x4'));var db=require(_0xfce9('0x5'))['db'];var utils=require(_0xfce9('0x6'));var logger=require(_0xfce9('0x7'))(_0xfce9('0x8'));var config=require(_0xfce9('0x9'));var jayson=require(_0xfce9('0xa'));var client=jayson[_0xfce9('0xb')][_0xfce9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c1aba,_0x430ca2,_0xad0690){return new BPromise(function(_0xe4cad0,_0x5e1806){return client[_0xfce9('0xd')](_0x2c1aba,_0xad0690)[_0xfce9('0xe')](function(_0x33933b){logger['info'](_0xfce9('0xf'),_0x430ca2,_0xfce9('0x10'));logger[_0xfce9('0x11')](_0xfce9('0x12'),_0x430ca2,_0xfce9('0x10'),JSON[_0xfce9('0x13')](_0x33933b));if(_0x33933b[_0xfce9('0x14')]){if(_0x33933b[_0xfce9('0x14')][_0xfce9('0x15')]===0x1f4){logger['error'](_0xfce9('0xf'),_0x430ca2,_0x33933b[_0xfce9('0x14')][_0xfce9('0x16')]);return _0x5e1806(_0x33933b['error'][_0xfce9('0x16')]);}logger[_0xfce9('0x14')](_0xfce9('0xf'),_0x430ca2,_0x33933b[_0xfce9('0x14')]['message']);return _0xe4cad0(_0x33933b[_0xfce9('0x14')]['message']);}else{logger[_0xfce9('0x17')](_0xfce9('0xf'),_0x430ca2,'request\x20sent');_0xe4cad0(_0x33933b[_0xfce9('0x18')][_0xfce9('0x16')]);}})['catch'](function(_0x2cdebe){logger[_0xfce9('0x14')](_0xfce9('0xf'),_0x430ca2,_0x2cdebe);_0x5e1806(_0x2cdebe);});});}exports['ShowSound']=function(_0x20852b){var _0x13387f=this;return new Promise(function(_0x1b59b7,_0x27cab2){return db[_0xfce9('0x19')][_0xfce9('0x1a')]({'raw':_0x20852b[_0xfce9('0x1b')]?_0x20852b[_0xfce9('0x1b')][_0xfce9('0x1c')]===undefined?!![]:![]:!![],'where':_0x20852b[_0xfce9('0x1b')]?_0x20852b[_0xfce9('0x1b')][_0xfce9('0x1d')]||null:null,'attributes':_0x20852b[_0xfce9('0x1b')]?_0x20852b['options']['attributes']||null:null,'include':_0x20852b['options']?_0x20852b[_0xfce9('0x1b')][_0xfce9('0x1e')]?_[_0xfce9('0x1f')](_0x20852b[_0xfce9('0x1b')][_0xfce9('0x1e')],function(_0x51f3c8){return{'model':db[_0x51f3c8[_0xfce9('0x20')]],'as':_0x51f3c8['as'],'attributes':_0x51f3c8[_0xfce9('0x21')],'include':_0x51f3c8['include']?_[_0xfce9('0x1f')](_0x51f3c8[_0xfce9('0x1e')],function(_0x2ec6c6){return{'model':db[_0x2ec6c6[_0xfce9('0x20')]],'as':_0x2ec6c6['as'],'attributes':_0x2ec6c6[_0xfce9('0x21')],'include':_0x2ec6c6[_0xfce9('0x1e')]?_[_0xfce9('0x1f')](_0x2ec6c6[_0xfce9('0x1e')],function(_0xed3038){return{'model':db[_0xed3038['model']],'as':_0xed3038['as'],'attributes':_0xed3038[_0xfce9('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f92d){logger[_0xfce9('0x17')](_0xfce9('0x22'),_0x20852b);logger[_0xfce9('0x11')](_0xfce9('0x22'),_0x20852b,JSON[_0xfce9('0x13')](_0x28f92d));_0x1b59b7(_0x28f92d);})[_0xfce9('0x23')](function(_0x1ed181){logger['error'](_0xfce9('0x22'),_0x1ed181[_0xfce9('0x16')],_0x20852b);_0x27cab2(_0x13387f[_0xfce9('0x14')](0x1f4,_0x1ed181[_0xfce9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d5e1b11..6302865 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x544b3f,_0x4d8b66){var _0x15787f=function(_0x12467e){while(--_0x12467e){_0x544b3f['push'](_0x544b3f['shift']());}};_0x15787f(++_0x4d8b66);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1d7791,_0x2a291f){_0x1d7791=_0x1d7791-0x0;var _0x2293f8=_0x0b0e[_0x1d7791];return _0x2293f8;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4ac48d,_0x171a68){var _0x7537af=function(_0x1c6ca6){while(--_0x1c6ca6){_0x4ac48d['push'](_0x4ac48d['shift']());}};_0x7537af(++_0x171a68);}(_0x8603,0x190));var _0x3860=function(_0x28e96c,_0x2d75ed){_0x28e96c=_0x28e96c-0x0;var _0x1db3d5=_0x8603[_0x28e96c];return _0x1db3d5;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6f3cb10..adaeaa1 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dd6=['medium','sequelize','STRING','TEXT'];(function(_0x4fcce9,_0x34391a){var _0x1d5a34=function(_0x566046){while(--_0x566046){_0x4fcce9['push'](_0x4fcce9['shift']());}};_0x1d5a34(++_0x34391a);}(_0x7dd6,0x191));var _0x67dd=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7dd6[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0x67dd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x67dd('0x1')]},'body':{'type':Sequelize[_0x67dd('0x2')](_0x67dd('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x67dd('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb3e4=['medium','ENUM','out','TEXT','sequelize','exports','STRING'];(function(_0x57be3b,_0x485616){var _0x88c54c=function(_0x35afd8){while(--_0x35afd8){_0x57be3b['push'](_0x57be3b['shift']());}};_0x88c54c(++_0x485616);}(_0xb3e4,0x14d));var _0x4b3e=function(_0x311afe,_0x212b91){_0x311afe=_0x311afe-0x0;var _0x380b2a=_0xb3e4[_0x311afe];return _0x380b2a;};'use strict';var Sequelize=require(_0x4b3e('0x0'));module[_0x4b3e('0x1')]={'uniqueid':{'type':Sequelize[_0x4b3e('0x2')]},'body':{'type':Sequelize['TEXT'](_0x4b3e('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x4b3e('0x4')]('in',_0x4b3e('0x5')),'defaultValue':_0x4b3e('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4b3e('0x2')]},'providerResponse':{'type':Sequelize[_0x4b3e('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 15e4b9a..66f2a6a 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x158d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','SquareMessage','includeAll','include','findAll','show','rawAttributes','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3e77d8,_0x230547){var _0x3d602b=function(_0xa9190e){while(--_0xa9190e){_0x3e77d8['push'](_0x3e77d8['shift']());}};_0x3d602b(++_0x230547);}(_0x158d,0x1a2));var _0xd158=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x158d[_0x1347f8];return _0x218368;};'use strict';var emlformat=require(_0xd158('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd158('0x1'));var jsonpatch=require(_0xd158('0x2'));var rp=require(_0xd158('0x3'));var moment=require(_0xd158('0x4'));var BPromise=require(_0xd158('0x5'));var Mustache=require(_0xd158('0x6'));var util=require('util');var path=require(_0xd158('0x7'));var sox=require(_0xd158('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd158('0x9'));var _=require(_0xd158('0xa'));var squel=require(_0xd158('0xb'));var crypto=require(_0xd158('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd158('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd158('0xe'));var Papa=require(_0xd158('0xf'));var Redis=require(_0xd158('0x10'));var authService=require(_0xd158('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd158('0x12'));var hardwareService=require(_0xd158('0x13'));var logger=require(_0xd158('0x14'))(_0xd158('0x15'));var utils=require(_0xd158('0x16'));var config=require(_0xd158('0x17'));var licenseUtil=require(_0xd158('0x18'));var db=require(_0xd158('0x19'))['db'];function respondWithStatusCode(_0x415ed9,_0x729921){_0x729921=_0x729921||0xcc;return function(_0xaadcee){if(_0xaadcee){return _0x415ed9[_0xd158('0x1a')](_0x729921);}return _0x415ed9['status'](_0x729921)['end']();};}function respondWithResult(_0x67a057,_0x37d3a4){_0x37d3a4=_0x37d3a4||0xc8;return function(_0x6effd3){if(_0x6effd3){return _0x67a057[_0xd158('0x1b')](_0x37d3a4)['json'](_0x6effd3);}};}function respondWithFilteredResult(_0x51be0c,_0x3769ef){return function(_0x3ee140){if(_0x3ee140){var _0xf4d976=typeof _0x3769ef[_0xd158('0x1c')]===_0xd158('0x1d')&&typeof _0x3769ef['limit']===_0xd158('0x1d');var _0x1348c2=_0x3ee140[_0xd158('0x1e')];var _0x221cbb=_0xf4d976?0x0:_0x3769ef['offset'];var _0x427fdd=_0xf4d976?_0x3ee140[_0xd158('0x1e')]:_0x3769ef['offset']+_0x3769ef[_0xd158('0x1f')];var _0x318661;if(_0x427fdd>=_0x1348c2){_0x427fdd=_0x1348c2;_0x318661=0xc8;}else{_0x318661=0xce;}_0x51be0c[_0xd158('0x1b')](_0x318661);return _0x51be0c['set'](_0xd158('0x20'),_0x221cbb+'-'+_0x427fdd+'/'+_0x1348c2)[_0xd158('0x21')](_0x3ee140);}return null;};}function patchUpdates(_0x27993d){return function(_0x5961d7){try{jsonpatch[_0xd158('0x22')](_0x5961d7,_0x27993d,!![]);}catch(_0x12eee2){return BPromise[_0xd158('0x23')](_0x12eee2);}return _0x5961d7['save']();};}function saveUpdates(_0x469443,_0x18ffdf){return function(_0x24599b){if(_0x24599b){return _0x24599b[_0xd158('0x24')](_0x469443)[_0xd158('0x25')](function(_0x21bd4f){return _0x21bd4f;});}return null;};}function removeEntity(_0x29817a,_0x3cda0c){return function(_0x550c14){if(_0x550c14){return _0x550c14[_0xd158('0x26')]()[_0xd158('0x25')](function(){_0x29817a[_0xd158('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed999,_0x4bccd3){return function(_0x36f167){if(!_0x36f167){_0x1ed999[_0xd158('0x1a')](0x194);}return _0x36f167;};}function handleError(_0x504287,_0x43e6b0){_0x43e6b0=_0x43e6b0||0x1f4;return function(_0x15c11b){logger[_0xd158('0x27')](_0x15c11b['stack']);if(_0x15c11b[_0xd158('0x28')]){delete _0x15c11b[_0xd158('0x28')];}_0x504287[_0xd158('0x1b')](_0x43e6b0)['send'](_0x15c11b);};}exports[_0xd158('0x29')]=function(_0x440810,_0x264e0a){var _0x248958={},_0x155872={},_0x28ce38={'count':0x0,'rows':[]};var _0x393bf3=_[_0xd158('0x2a')](db['SquareMessage']['rawAttributes'],function(_0x5e301c){return{'name':_0x5e301c[_0xd158('0x2b')],'type':_0x5e301c[_0xd158('0x2c')][_0xd158('0x2d')]};});_0x155872[_0xd158('0x2e')]=_[_0xd158('0x2a')](_0x393bf3,_0xd158('0x28'));_0x155872[_0xd158('0x2f')]=_[_0xd158('0x30')](_0x440810['query']);_0x155872[_0xd158('0x31')]=_[_0xd158('0x32')](_0x155872['model'],_0x155872[_0xd158('0x2f')]);_0x248958['attributes']=_[_0xd158('0x32')](_0x155872[_0xd158('0x2e')],qs[_0xd158('0x33')](_0x440810['query'][_0xd158('0x33')]));_0x248958[_0xd158('0x34')]=_0x248958[_0xd158('0x34')][_0xd158('0x35')]?_0x248958[_0xd158('0x34')]:_0x155872[_0xd158('0x2e')];if(!_0x440810[_0xd158('0x2f')][_0xd158('0x36')]('nolimit')){_0x248958['limit']=qs[_0xd158('0x1f')](_0x440810[_0xd158('0x2f')]['limit']);_0x248958[_0xd158('0x1c')]=qs[_0xd158('0x1c')](_0x440810[_0xd158('0x2f')]['offset']);}_0x248958[_0xd158('0x37')]=qs[_0xd158('0x38')](_0x440810['query']['sort']);_0x248958[_0xd158('0x39')]=qs['filters'](_[_0xd158('0x3a')](_0x440810['query'],_0x155872[_0xd158('0x31')]),_0x393bf3);if(_0x440810[_0xd158('0x2f')]['filter']){_0x248958[_0xd158('0x39')]=_['merge'](_0x248958[_0xd158('0x39')],{'$or':_[_0xd158('0x2a')](_0x393bf3,function(_0x1d461a){if(_0x1d461a[_0xd158('0x2c')]!=='VIRTUAL'){var _0x325b56={};_0x325b56[_0x1d461a[_0xd158('0x28')]]={'$like':'%'+_0x440810['query'][_0xd158('0x3b')]+'%'};return _0x325b56;}})});}_0x248958=_[_0xd158('0x3c')]({},_0x248958,_0x440810['options']);var _0x230c83={'where':_0x248958[_0xd158('0x39')]};return db[_0xd158('0x3d')][_0xd158('0x1e')](_0x230c83)[_0xd158('0x25')](function(_0x3e548e){_0x28ce38[_0xd158('0x1e')]=_0x3e548e;if(_0x440810[_0xd158('0x2f')][_0xd158('0x3e')]){_0x248958[_0xd158('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0xd158('0x40')](_0x248958);})[_0xd158('0x25')](function(_0x2180dd){_0x28ce38['rows']=_0x2180dd;return _0x28ce38;})[_0xd158('0x25')](respondWithFilteredResult(_0x264e0a,_0x248958))['catch'](handleError(_0x264e0a,null));};exports[_0xd158('0x41')]=function(_0x485655,_0x337e8d){var _0x200a02={'raw':!![],'where':{'id':_0x485655['params']['id']}},_0x22f90c={};_0x22f90c['model']=_[_0xd158('0x30')](db[_0xd158('0x3d')][_0xd158('0x42')]);_0x22f90c['query']=_[_0xd158('0x30')](_0x485655['query']);_0x22f90c[_0xd158('0x31')]=_[_0xd158('0x32')](_0x22f90c[_0xd158('0x2e')],_0x22f90c[_0xd158('0x2f')]);_0x200a02['attributes']=_[_0xd158('0x32')](_0x22f90c[_0xd158('0x2e')],qs[_0xd158('0x33')](_0x485655[_0xd158('0x2f')][_0xd158('0x33')]));_0x200a02[_0xd158('0x34')]=_0x200a02[_0xd158('0x34')][_0xd158('0x35')]?_0x200a02[_0xd158('0x34')]:_0x22f90c[_0xd158('0x2e')];if(_0x485655[_0xd158('0x2f')][_0xd158('0x3e')]){_0x200a02[_0xd158('0x3f')]=[{'all':!![]}];}_0x200a02=_[_0xd158('0x3c')]({},_0x200a02,_0x485655[_0xd158('0x43')]);return db[_0xd158('0x3d')][_0xd158('0x44')](_0x200a02)[_0xd158('0x25')](handleEntityNotFound(_0x337e8d,null))[_0xd158('0x25')](respondWithResult(_0x337e8d,null))[_0xd158('0x45')](handleError(_0x337e8d,null));};exports[_0xd158('0x46')]=function(_0x365584,_0x4e3252){return db[_0xd158('0x3d')][_0xd158('0x46')](_0x365584[_0xd158('0x47')],{})[_0xd158('0x25')](respondWithResult(_0x4e3252,0xc9))[_0xd158('0x45')](handleError(_0x4e3252,null));};exports[_0xd158('0x24')]=function(_0x55e297,_0x5e0f24){if(_0x55e297[_0xd158('0x47')]['id']){delete _0x55e297[_0xd158('0x47')]['id'];}return db[_0xd158('0x3d')][_0xd158('0x44')]({'where':{'id':_0x55e297[_0xd158('0x48')]['id']}})[_0xd158('0x25')](handleEntityNotFound(_0x5e0f24,null))['then'](saveUpdates(_0x55e297[_0xd158('0x47')],null))[_0xd158('0x25')](respondWithResult(_0x5e0f24,null))[_0xd158('0x45')](handleError(_0x5e0f24,null));};exports[_0xd158('0x26')]=function(_0x1ade1e,_0xfbdb71){return db['SquareMessage'][_0xd158('0x44')]({'where':{'id':_0x1ade1e[_0xd158('0x48')]['id']}})[_0xd158('0x25')](handleEntityNotFound(_0xfbdb71,null))[_0xd158('0x25')](removeEntity(_0xfbdb71,null))[_0xd158('0x45')](handleError(_0xfbdb71,null));}; \ No newline at end of file +var _0x745d=['findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x745d,0xec));var _0xd745=function(_0x30dd4f,_0x2ecacc){_0x30dd4f=_0x30dd4f-0x0;var _0xe55164=_0x745d[_0x30dd4f];return _0xe55164;};'use strict';var emlformat=require(_0xd745('0x0'));var rimraf=require(_0xd745('0x1'));var zipdir=require(_0xd745('0x2'));var jsonpatch=require(_0xd745('0x3'));var rp=require(_0xd745('0x4'));var moment=require('moment');var BPromise=require(_0xd745('0x5'));var Mustache=require(_0xd745('0x6'));var util=require(_0xd745('0x7'));var path=require(_0xd745('0x8'));var sox=require(_0xd745('0x9'));var csv=require(_0xd745('0xa'));var ejs=require(_0xd745('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd745('0xc'));var squel=require(_0xd745('0xd'));var crypto=require(_0xd745('0xe'));var jsforce=require(_0xd745('0xf'));var deskjs=require(_0xd745('0x10'));var toCsv=require(_0xd745('0xa'));var querystring=require(_0xd745('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd745('0x12'));var qs=require(_0xd745('0x13'));var as=require(_0xd745('0x14'));var hardwareService=require(_0xd745('0x15'));var logger=require(_0xd745('0x16'))(_0xd745('0x17'));var utils=require(_0xd745('0x18'));var config=require(_0xd745('0x19'));var licenseUtil=require(_0xd745('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3219c9,_0x457230){_0x457230=_0x457230||0xcc;return function(_0x5b93a5){if(_0x5b93a5){return _0x3219c9[_0xd745('0x1b')](_0x457230);}return _0x3219c9[_0xd745('0x1c')](_0x457230)[_0xd745('0x1d')]();};}function respondWithResult(_0xf5e834,_0x32fad2){_0x32fad2=_0x32fad2||0xc8;return function(_0xf26235){if(_0xf26235){return _0xf5e834['status'](_0x32fad2)['json'](_0xf26235);}};}function respondWithFilteredResult(_0xd2bedc,_0x5261d2){return function(_0x3ccd76){if(_0x3ccd76){var _0x46703f=typeof _0x5261d2[_0xd745('0x1e')]===_0xd745('0x1f')&&typeof _0x5261d2[_0xd745('0x20')]===_0xd745('0x1f');var _0x530e2e=_0x3ccd76['count'];var _0x362036=_0x46703f?0x0:_0x5261d2['offset'];var _0xac8f8d=_0x46703f?_0x3ccd76[_0xd745('0x21')]:_0x5261d2['offset']+_0x5261d2[_0xd745('0x20')];var _0x11609b;if(_0xac8f8d>=_0x530e2e){_0xac8f8d=_0x530e2e;_0x11609b=0xc8;}else{_0x11609b=0xce;}_0xd2bedc[_0xd745('0x1c')](_0x11609b);return _0xd2bedc[_0xd745('0x22')](_0xd745('0x23'),_0x362036+'-'+_0xac8f8d+'/'+_0x530e2e)['json'](_0x3ccd76);}return null;};}function patchUpdates(_0x416baa){return function(_0x332b0a){try{jsonpatch[_0xd745('0x24')](_0x332b0a,_0x416baa,!![]);}catch(_0x1f79bd){return BPromise['reject'](_0x1f79bd);}return _0x332b0a[_0xd745('0x25')]();};}function saveUpdates(_0x3b2fbc,_0x107978){return function(_0x90e616){if(_0x90e616){return _0x90e616[_0xd745('0x26')](_0x3b2fbc)[_0xd745('0x27')](function(_0x453ffb){return _0x453ffb;});}return null;};}function removeEntity(_0x1125eb,_0x62d065){return function(_0x41b1a6){if(_0x41b1a6){return _0x41b1a6[_0xd745('0x28')]()['then'](function(){_0x1125eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5642f1,_0x47e8fe){return function(_0x2a4081){if(!_0x2a4081){_0x5642f1['sendStatus'](0x194);}return _0x2a4081;};}function handleError(_0x4643fd,_0x37dc5e){_0x37dc5e=_0x37dc5e||0x1f4;return function(_0x2777c8){logger['error'](_0x2777c8[_0xd745('0x29')]);if(_0x2777c8[_0xd745('0x2a')]){delete _0x2777c8['name'];}_0x4643fd[_0xd745('0x1c')](_0x37dc5e)[_0xd745('0x2b')](_0x2777c8);};}exports[_0xd745('0x2c')]=function(_0x5a7f25,_0x26597c){var _0x402807={},_0x5489b0={},_0x111bee={'count':0x0,'rows':[]};var _0x484362=_[_0xd745('0x2d')](db['SquareMessage'][_0xd745('0x2e')],function(_0x3f692a){return{'name':_0x3f692a[_0xd745('0x2f')],'type':_0x3f692a[_0xd745('0x30')][_0xd745('0x31')]};});_0x5489b0[_0xd745('0x32')]=_[_0xd745('0x2d')](_0x484362,_0xd745('0x2a'));_0x5489b0[_0xd745('0x33')]=_['keys'](_0x5a7f25[_0xd745('0x33')]);_0x5489b0[_0xd745('0x34')]=_[_0xd745('0x35')](_0x5489b0[_0xd745('0x32')],_0x5489b0[_0xd745('0x33')]);_0x402807['attributes']=_[_0xd745('0x35')](_0x5489b0[_0xd745('0x32')],qs[_0xd745('0x36')](_0x5a7f25[_0xd745('0x33')]['fields']));_0x402807[_0xd745('0x37')]=_0x402807[_0xd745('0x37')][_0xd745('0x38')]?_0x402807[_0xd745('0x37')]:_0x5489b0['model'];if(!_0x5a7f25['query']['hasOwnProperty'](_0xd745('0x39'))){_0x402807[_0xd745('0x20')]=qs['limit'](_0x5a7f25['query'][_0xd745('0x20')]);_0x402807['offset']=qs['offset'](_0x5a7f25['query'][_0xd745('0x1e')]);}_0x402807[_0xd745('0x3a')]=qs[_0xd745('0x3b')](_0x5a7f25['query'][_0xd745('0x3b')]);_0x402807[_0xd745('0x3c')]=qs[_0xd745('0x34')](_['pick'](_0x5a7f25[_0xd745('0x33')],_0x5489b0['filters']),_0x484362);if(_0x5a7f25['query'][_0xd745('0x3d')]){_0x402807[_0xd745('0x3c')]=_[_0xd745('0x3e')](_0x402807[_0xd745('0x3c')],{'$or':_[_0xd745('0x2d')](_0x484362,function(_0x2c283f){if(_0x2c283f[_0xd745('0x30')]!==_0xd745('0x3f')){var _0x47b51f={};_0x47b51f[_0x2c283f[_0xd745('0x2a')]]={'$like':'%'+_0x5a7f25['query'][_0xd745('0x3d')]+'%'};return _0x47b51f;}})});}_0x402807=_['merge']({},_0x402807,_0x5a7f25[_0xd745('0x40')]);var _0x1f2e56={'where':_0x402807[_0xd745('0x3c')]};return db[_0xd745('0x41')][_0xd745('0x21')](_0x1f2e56)['then'](function(_0x2218bb){_0x111bee[_0xd745('0x21')]=_0x2218bb;if(_0x5a7f25[_0xd745('0x33')][_0xd745('0x42')]){_0x402807[_0xd745('0x43')]=[{'all':!![]}];}return db[_0xd745('0x41')][_0xd745('0x44')](_0x402807);})[_0xd745('0x27')](function(_0x3d6f6f){_0x111bee['rows']=_0x3d6f6f;return _0x111bee;})['then'](respondWithFilteredResult(_0x26597c,_0x402807))[_0xd745('0x45')](handleError(_0x26597c,null));};exports[_0xd745('0x46')]=function(_0x24bdf8,_0x32898b){var _0x19c53a={'raw':!![],'where':{'id':_0x24bdf8[_0xd745('0x47')]['id']}},_0x403373={};_0x403373[_0xd745('0x32')]=_[_0xd745('0x48')](db[_0xd745('0x41')][_0xd745('0x2e')]);_0x403373['query']=_[_0xd745('0x48')](_0x24bdf8[_0xd745('0x33')]);_0x403373[_0xd745('0x34')]=_[_0xd745('0x35')](_0x403373[_0xd745('0x32')],_0x403373['query']);_0x19c53a['attributes']=_['intersection'](_0x403373[_0xd745('0x32')],qs[_0xd745('0x36')](_0x24bdf8[_0xd745('0x33')][_0xd745('0x36')]));_0x19c53a[_0xd745('0x37')]=_0x19c53a[_0xd745('0x37')][_0xd745('0x38')]?_0x19c53a[_0xd745('0x37')]:_0x403373[_0xd745('0x32')];if(_0x24bdf8[_0xd745('0x33')][_0xd745('0x42')]){_0x19c53a[_0xd745('0x43')]=[{'all':!![]}];}_0x19c53a=_['merge']({},_0x19c53a,_0x24bdf8[_0xd745('0x40')]);return db['SquareMessage'][_0xd745('0x49')](_0x19c53a)[_0xd745('0x27')](handleEntityNotFound(_0x32898b,null))['then'](respondWithResult(_0x32898b,null))['catch'](handleError(_0x32898b,null));};exports[_0xd745('0x4a')]=function(_0x574d05,_0x4abe68){return db[_0xd745('0x41')][_0xd745('0x4a')](_0x574d05['body'],{})[_0xd745('0x27')](respondWithResult(_0x4abe68,0xc9))[_0xd745('0x45')](handleError(_0x4abe68,null));};exports[_0xd745('0x26')]=function(_0x2eba93,_0x5f46d2){if(_0x2eba93[_0xd745('0x4b')]['id']){delete _0x2eba93[_0xd745('0x4b')]['id'];}return db[_0xd745('0x41')][_0xd745('0x49')]({'where':{'id':_0x2eba93[_0xd745('0x47')]['id']}})[_0xd745('0x27')](handleEntityNotFound(_0x5f46d2,null))[_0xd745('0x27')](saveUpdates(_0x2eba93[_0xd745('0x4b')],null))[_0xd745('0x27')](respondWithResult(_0x5f46d2,null))[_0xd745('0x45')](handleError(_0x5f46d2,null));};exports[_0xd745('0x28')]=function(_0x314bd6,_0x1c98c6){return db[_0xd745('0x41')][_0xd745('0x49')]({'where':{'id':_0x314bd6['params']['id']}})[_0xd745('0x27')](handleEntityNotFound(_0x1c98c6,null))[_0xd745('0x27')](removeEntity(_0x1c98c6,null))[_0xd745('0x45')](handleError(_0x1c98c6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 7fc9741..59efa26 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6463=['define','SquareMessage','util','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x474e6d,_0x1119b0){var _0x3839ff=function(_0xc7ad4c){while(--_0xc7ad4c){_0x474e6d['push'](_0x474e6d['shift']());}};_0x3839ff(++_0x1119b0);}(_0x6463,0xe9));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3646('0x0'));var logger=require('../../config/logger')(_0x3646('0x1'));var moment=require(_0x3646('0x2'));var BPromise=require(_0x3646('0x3'));var rp=require(_0x3646('0x4'));var fs=require('fs');var path=require(_0x3646('0x5'));var rimraf=require('rimraf');var config=require(_0x3646('0x6'));var attributes=require(_0x3646('0x7'));module[_0x3646('0x8')]=function(_0x5d4dd4,_0x47c41f){return _0x5d4dd4[_0x3646('0x9')](_0x3646('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c4=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ae268,_0x4b3d90){var _0x3fea8b=function(_0x4a0c9c){while(--_0x4a0c9c){_0x5ae268['push'](_0x5ae268['shift']());}};_0x3fea8b(++_0x4b3d90);}(_0x81c4,0x179));var _0x481c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x81c4[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x481c('0x0'))(_0x481c('0x1'));var moment=require(_0x481c('0x2'));var BPromise=require(_0x481c('0x3'));var rp=require(_0x481c('0x4'));var fs=require('fs');var path=require(_0x481c('0x5'));var rimraf=require(_0x481c('0x6'));var config=require(_0x481c('0x7'));var attributes=require(_0x481c('0x8'));module[_0x481c('0x9')]=function(_0x3c860e,_0x45c18a){return _0x3c860e['define'](_0x481c('0xa'),attributes,{'tableName':_0x481c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 0f042b3..ea8e366 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8cc=['SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd8cc,0x188));var _0xcd8c=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0xd8cc[_0x2730da];return _0xfe9991;};'use strict';var _=require(_0xcd8c('0x0'));var util=require(_0xcd8c('0x1'));var moment=require(_0xcd8c('0x2'));var BPromise=require(_0xcd8c('0x3'));var rs=require(_0xcd8c('0x4'));var fs=require('fs');var Redis=require(_0xcd8c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd8c('0x6'));var logger=require(_0xcd8c('0x7'))(_0xcd8c('0x8'));var config=require(_0xcd8c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcd8c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39f5f6,_0x3d63fb,_0x1513b7){return new BPromise(function(_0x28e3fc,_0x3ce695){return client[_0xcd8c('0xb')](_0x39f5f6,_0x1513b7)[_0xcd8c('0xc')](function(_0x4534f5){logger[_0xcd8c('0xd')](_0xcd8c('0xe'),_0x3d63fb,'request\x20sent');logger[_0xcd8c('0xf')](_0xcd8c('0x10'),_0x3d63fb,_0xcd8c('0x11'),JSON[_0xcd8c('0x12')](_0x4534f5));if(_0x4534f5[_0xcd8c('0x13')]){if(_0x4534f5['error'][_0xcd8c('0x14')]===0x1f4){logger[_0xcd8c('0x13')]('SquareMessage,\x20%s,\x20%s',_0x3d63fb,_0x4534f5[_0xcd8c('0x13')][_0xcd8c('0x15')]);return _0x3ce695(_0x4534f5[_0xcd8c('0x13')][_0xcd8c('0x15')]);}logger[_0xcd8c('0x13')]('SquareMessage,\x20%s,\x20%s',_0x3d63fb,_0x4534f5[_0xcd8c('0x13')][_0xcd8c('0x15')]);return _0x28e3fc(_0x4534f5[_0xcd8c('0x13')][_0xcd8c('0x15')]);}else{logger[_0xcd8c('0xd')](_0xcd8c('0xe'),_0x3d63fb,_0xcd8c('0x11'));_0x28e3fc(_0x4534f5['result']['message']);}})[_0xcd8c('0x16')](function(_0x3bd888){logger['error'](_0xcd8c('0xe'),_0x3d63fb,_0x3bd888);_0x3ce695(_0x3bd888);});});}exports['CreateSquareMessage']=function(_0x2fa8d2){var _0x473ce9=this;return new Promise(function(_0x56d7d6,_0x3f283f){return db[_0xcd8c('0x17')][_0xcd8c('0x18')](_0x2fa8d2[_0xcd8c('0x19')],{'raw':_0x2fa8d2[_0xcd8c('0x1a')]?_0x2fa8d2[_0xcd8c('0x1a')][_0xcd8c('0x1b')]===undefined?!![]:![]:!![]})[_0xcd8c('0xc')](function(_0x39d36c){logger[_0xcd8c('0xd')]('CreateSquareMessage',_0x2fa8d2);logger['debug'](_0xcd8c('0x1c'),_0x2fa8d2,JSON[_0xcd8c('0x12')](_0x39d36c));_0x56d7d6(_0x39d36c);})[_0xcd8c('0x16')](function(_0x5440e8){logger[_0xcd8c('0x13')](_0xcd8c('0x1c'),_0x5440e8[_0xcd8c('0x15')],_0x2fa8d2);_0x3f283f(_0x473ce9[_0xcd8c('0x13')](0x1f4,_0x5440e8[_0xcd8c('0x15')]));});});}; \ No newline at end of file +var _0x5987=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4683a1,_0x38533b){var _0x509473=function(_0x20d18b){while(--_0x20d18b){_0x4683a1['push'](_0x4683a1['shift']());}};_0x509473(++_0x38533b);}(_0x5987,0x107));var _0x7598=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5987[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x7598('0x0'));var moment=require(_0x7598('0x1'));var BPromise=require(_0x7598('0x2'));var rs=require(_0x7598('0x3'));var fs=require('fs');var Redis=require(_0x7598('0x4'));var db=require(_0x7598('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7598('0x6'))(_0x7598('0x7'));var config=require(_0x7598('0x8'));var jayson=require(_0x7598('0x9'));var client=jayson[_0x7598('0xa')][_0x7598('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d2046,_0x2a23fd,_0x4b6511){return new BPromise(function(_0x38b7dd,_0x51cb47){return client[_0x7598('0xc')](_0x3d2046,_0x4b6511)[_0x7598('0xd')](function(_0x2ce813){logger[_0x7598('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2a23fd,_0x7598('0xf'));logger[_0x7598('0x10')](_0x7598('0x11'),_0x2a23fd,'request\x20sent',JSON[_0x7598('0x12')](_0x2ce813));if(_0x2ce813[_0x7598('0x13')]){if(_0x2ce813[_0x7598('0x13')][_0x7598('0x14')]===0x1f4){logger['error'](_0x7598('0x15'),_0x2a23fd,_0x2ce813[_0x7598('0x13')][_0x7598('0x16')]);return _0x51cb47(_0x2ce813[_0x7598('0x13')][_0x7598('0x16')]);}logger[_0x7598('0x13')](_0x7598('0x15'),_0x2a23fd,_0x2ce813['error'][_0x7598('0x16')]);return _0x38b7dd(_0x2ce813[_0x7598('0x13')][_0x7598('0x16')]);}else{logger[_0x7598('0xe')](_0x7598('0x15'),_0x2a23fd,_0x7598('0xf'));_0x38b7dd(_0x2ce813[_0x7598('0x17')][_0x7598('0x16')]);}})[_0x7598('0x18')](function(_0x26bcfa){logger[_0x7598('0x13')]('SquareMessage,\x20%s,\x20%s',_0x2a23fd,_0x26bcfa);_0x51cb47(_0x26bcfa);});});}exports[_0x7598('0x19')]=function(_0x207520){var _0x44970d=this;return new Promise(function(_0x464198,_0x336c49){return db['SquareMessage'][_0x7598('0x1a')](_0x207520[_0x7598('0x1b')],{'raw':_0x207520['options']?_0x207520[_0x7598('0x1c')][_0x7598('0x1d')]===undefined?!![]:![]:!![]})[_0x7598('0xd')](function(_0x4ac203){logger['info'](_0x7598('0x19'),_0x207520);logger['debug'](_0x7598('0x19'),_0x207520,JSON['stringify'](_0x4ac203));_0x464198(_0x4ac203);})[_0x7598('0x18')](function(_0x2e0c48){logger['error'](_0x7598('0x19'),_0x2e0c48['message'],_0x207520);_0x336c49(_0x44970d[_0x7598('0x13')](0x1f4,_0x2e0c48['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c0012bf..747dd24 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b26=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','isAuthenticated','show','/:id/test','test','post','create','put','update','destroy'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x9b26,0xa2));var _0x69b2=function(_0x2726e2,_0xa9cfb8){_0x2726e2=_0x2726e2-0x0;var _0x55ae33=_0x9b26[_0x2726e2];return _0x55ae33;};'use strict';var multer=require(_0x69b2('0x0'));var util=require(_0x69b2('0x1'));var path=require(_0x69b2('0x2'));var timeout=require(_0x69b2('0x3'));var express=require(_0x69b2('0x4'));var router=express[_0x69b2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x69b2('0x6'));var interaction=require(_0x69b2('0x7'));var config=require(_0x69b2('0x8'));var controller=require(_0x69b2('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x69b2('0xa')]);router[_0x69b2('0xb')](_0x69b2('0xc'),auth[_0x69b2('0xd')](),controller[_0x69b2('0xe')]);router[_0x69b2('0xb')](_0x69b2('0xf'),auth[_0x69b2('0xd')](),timeout('15s'),controller[_0x69b2('0x10')]);router[_0x69b2('0x11')]('/',auth[_0x69b2('0xd')](),controller[_0x69b2('0x12')]);router[_0x69b2('0x13')](_0x69b2('0xc'),auth[_0x69b2('0xd')](),controller[_0x69b2('0x14')]);router['delete'](_0x69b2('0xc'),auth[_0x69b2('0xd')](),controller[_0x69b2('0x15')]);module[_0x69b2('0x16')]=router; \ No newline at end of file +var _0x5b78=['/:id/test','15s','test','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x53168e,_0x22152b){var _0x5959b6=function(_0x5818df){while(--_0x5818df){_0x53168e['push'](_0x53168e['shift']());}};_0x5959b6(++_0x22152b);}(_0x5b78,0x102));var _0x85b7=function(_0x1ea259,_0x22e770){_0x1ea259=_0x1ea259-0x0;var _0x520fbf=_0x5b78[_0x1ea259];return _0x520fbf;};'use strict';var multer=require(_0x85b7('0x0'));var util=require(_0x85b7('0x1'));var path=require(_0x85b7('0x2'));var timeout=require(_0x85b7('0x3'));var express=require(_0x85b7('0x4'));var router=express[_0x85b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x85b7('0x6'));var interaction=require(_0x85b7('0x7'));var config=require(_0x85b7('0x8'));var controller=require(_0x85b7('0x9'));router[_0x85b7('0xa')]('/',auth[_0x85b7('0xb')](),controller[_0x85b7('0xc')]);router['get'](_0x85b7('0xd'),auth[_0x85b7('0xb')](),controller[_0x85b7('0xe')]);router[_0x85b7('0xa')](_0x85b7('0xf'),auth[_0x85b7('0xb')](),timeout(_0x85b7('0x10')),controller[_0x85b7('0x11')]);router['post']('/',auth[_0x85b7('0xb')](),controller['create']);router[_0x85b7('0x12')](_0x85b7('0xd'),auth[_0x85b7('0xb')](),controller[_0x85b7('0x13')]);router['delete'](_0x85b7('0xd'),auth[_0x85b7('0xb')](),controller[_0x85b7('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 09695bf..dcb5087 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2363=['exports','STRING','name','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2363,0xf3));var _0x3236=function(_0x110333,_0x146ca7){_0x110333=_0x110333-0x0;var _0x453077=_0x2363[_0x110333];return _0x453077;};'use strict';var Sequelize=require(_0x3236('0x0'));module[_0x3236('0x1')]={'name':{'type':Sequelize[_0x3236('0x2')],'unique':_0x3236('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3236('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xadec=['STRING','exports','name'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0xadec,0x151));var _0xcade=function(_0x283479,_0x4db130){_0x283479=_0x283479-0x0;var _0x57e238=_0xadec[_0x283479];return _0x57e238;};'use strict';var Sequelize=require('sequelize');module[_0xcade('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xcade('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xcade('0x2')]},'description':{'type':Sequelize[_0xcade('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index defcdc9..c9cc557 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75ce=['name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','dsn','odbc','closeSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x75ce,0x88));var _0xe75c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x75ce[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe75c('0x0'));var jsonpatch=require(_0xe75c('0x1'));var rp=require(_0xe75c('0x2'));var moment=require(_0xe75c('0x3'));var BPromise=require(_0xe75c('0x4'));var Mustache=require(_0xe75c('0x5'));var util=require(_0xe75c('0x6'));var path=require(_0xe75c('0x7'));var sox=require(_0xe75c('0x8'));var csv=require('to-csv');var ejs=require(_0xe75c('0x9'));var fs=require('fs');var fs_extra=require(_0xe75c('0xa'));var _=require('lodash');var squel=require(_0xe75c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe75c('0xc'));var toCsv=require(_0xe75c('0xd'));var querystring=require(_0xe75c('0xe'));var Papa=require(_0xe75c('0xf'));var Redis=require(_0xe75c('0x10'));var authService=require(_0xe75c('0x11'));var qs=require(_0xe75c('0x12'));var as=require(_0xe75c('0x13'));var hardwareService=require(_0xe75c('0x14'));var logger=require(_0xe75c('0x15'))(_0xe75c('0x16'));var utils=require(_0xe75c('0x17'));var config=require(_0xe75c('0x18'));var licenseUtil=require(_0xe75c('0x19'));var db=require(_0xe75c('0x1a'))['db'];function respondWithStatusCode(_0x568b28,_0x81b3b8){_0x81b3b8=_0x81b3b8||0xcc;return function(_0x108f97){if(_0x108f97){return _0x568b28['sendStatus'](_0x81b3b8);}return _0x568b28[_0xe75c('0x1b')](_0x81b3b8)[_0xe75c('0x1c')]();};}function respondWithResult(_0x90e0fd,_0x25ac34){_0x25ac34=_0x25ac34||0xc8;return function(_0x1bf57b){if(_0x1bf57b){return _0x90e0fd[_0xe75c('0x1b')](_0x25ac34)[_0xe75c('0x1d')](_0x1bf57b);}};}function respondWithFilteredResult(_0x4db761,_0x3d3643){return function(_0xab9305){if(_0xab9305){var _0x489dd1=typeof _0x3d3643[_0xe75c('0x1e')]===_0xe75c('0x1f')&&typeof _0x3d3643['limit']===_0xe75c('0x1f');var _0x2c6d7b=_0xab9305[_0xe75c('0x20')];var _0x386329=_0x489dd1?0x0:_0x3d3643[_0xe75c('0x1e')];var _0x959301=_0x489dd1?_0xab9305[_0xe75c('0x20')]:_0x3d3643[_0xe75c('0x1e')]+_0x3d3643['limit'];var _0x5d6e5a;if(_0x959301>=_0x2c6d7b){_0x959301=_0x2c6d7b;_0x5d6e5a=0xc8;}else{_0x5d6e5a=0xce;}_0x4db761[_0xe75c('0x1b')](_0x5d6e5a);return _0x4db761['set'](_0xe75c('0x21'),_0x386329+'-'+_0x959301+'/'+_0x2c6d7b)['json'](_0xab9305);}return null;};}function patchUpdates(_0x3adb8e){return function(_0x2992d6){try{jsonpatch[_0xe75c('0x22')](_0x2992d6,_0x3adb8e,!![]);}catch(_0x39c397){return BPromise[_0xe75c('0x23')](_0x39c397);}return _0x2992d6[_0xe75c('0x24')]();};}function saveUpdates(_0x13e6e9,_0x88e9b3){return function(_0x582d98){if(_0x582d98){return _0x582d98[_0xe75c('0x25')](_0x13e6e9)[_0xe75c('0x26')](function(_0x101af0){return _0x101af0;});}return null;};}function removeEntity(_0x2f25ea,_0x4e2e56){return function(_0x3c0389){if(_0x3c0389){return _0x3c0389[_0xe75c('0x27')]()['then'](function(){var _0x140de8=_0x3c0389[_0xe75c('0x28')]({'plain':!![]});var _0xbc987b=_0xe75c('0x29');return db[_0xe75c('0x2a')]['destroy']({'where':{'type':_0xbc987b,'resourceId':_0x140de8['id']}})[_0xe75c('0x26')](function(){return _0x3c0389;});})[_0xe75c('0x26')](function(){_0x2f25ea[_0xe75c('0x1b')](0xcc)[_0xe75c('0x1c')]();});}};}function handleEntityNotFound(_0x9e75c4,_0x41fb4f){return function(_0x38eb53){if(!_0x38eb53){_0x9e75c4[_0xe75c('0x2b')](0x194);}return _0x38eb53;};}function handleError(_0x2e2daa,_0x3ea387){_0x3ea387=_0x3ea387||0x1f4;return function(_0xb16c5c){logger[_0xe75c('0x2c')](_0xb16c5c[_0xe75c('0x2d')]);if(_0xb16c5c[_0xe75c('0x2e')]){delete _0xb16c5c[_0xe75c('0x2e')];}_0x2e2daa[_0xe75c('0x1b')](_0x3ea387)[_0xe75c('0x2f')](_0xb16c5c);};}exports[_0xe75c('0x30')]=function(_0x38b27d,_0x2cdeec){var _0x1ca99c={},_0x5e9672={},_0xa75955={'count':0x0,'rows':[]};var _0x3e93b8=_[_0xe75c('0x31')](db[_0xe75c('0x32')][_0xe75c('0x33')],function(_0x3c0b35){return{'name':_0x3c0b35[_0xe75c('0x34')],'type':_0x3c0b35['type'][_0xe75c('0x35')]};});_0x5e9672[_0xe75c('0x36')]=_['map'](_0x3e93b8,_0xe75c('0x2e'));_0x5e9672['query']=_[_0xe75c('0x37')](_0x38b27d[_0xe75c('0x38')]);_0x5e9672['filters']=_[_0xe75c('0x39')](_0x5e9672[_0xe75c('0x36')],_0x5e9672[_0xe75c('0x38')]);_0x1ca99c[_0xe75c('0x3a')]=_[_0xe75c('0x39')](_0x5e9672[_0xe75c('0x36')],qs[_0xe75c('0x3b')](_0x38b27d[_0xe75c('0x38')][_0xe75c('0x3b')]));_0x1ca99c['attributes']=_0x1ca99c[_0xe75c('0x3a')][_0xe75c('0x3c')]?_0x1ca99c[_0xe75c('0x3a')]:_0x5e9672[_0xe75c('0x36')];if(!_0x38b27d[_0xe75c('0x38')][_0xe75c('0x3d')](_0xe75c('0x3e'))){_0x1ca99c['limit']=qs['limit'](_0x38b27d['query']['limit']);_0x1ca99c[_0xe75c('0x1e')]=qs['offset'](_0x38b27d[_0xe75c('0x38')]['offset']);}_0x1ca99c[_0xe75c('0x3f')]=qs[_0xe75c('0x40')](_0x38b27d[_0xe75c('0x38')][_0xe75c('0x40')]);_0x1ca99c[_0xe75c('0x41')]=qs[_0xe75c('0x42')](_[_0xe75c('0x43')](_0x38b27d['query'],_0x5e9672[_0xe75c('0x42')]),_0x3e93b8);if(_0x38b27d[_0xe75c('0x38')]['filter']){_0x1ca99c[_0xe75c('0x41')]=_['merge'](_0x1ca99c[_0xe75c('0x41')],{'$or':_['map'](_0x3e93b8,function(_0x568a02){if(_0x568a02[_0xe75c('0x44')]!==_0xe75c('0x45')){var _0x43dfa8={};_0x43dfa8[_0x568a02[_0xe75c('0x2e')]]={'$like':'%'+_0x38b27d[_0xe75c('0x38')][_0xe75c('0x46')]+'%'};return _0x43dfa8;}})});}_0x1ca99c=_['merge']({},_0x1ca99c,_0x38b27d[_0xe75c('0x47')]);var _0x34e229={'where':_0x1ca99c['where']};return db[_0xe75c('0x32')][_0xe75c('0x20')](_0x34e229)[_0xe75c('0x26')](function(_0x5bd769){_0xa75955[_0xe75c('0x20')]=_0x5bd769;if(_0x38b27d[_0xe75c('0x38')][_0xe75c('0x48')]){_0x1ca99c['include']=[{'all':!![]}];}return db[_0xe75c('0x32')][_0xe75c('0x49')](_0x1ca99c);})[_0xe75c('0x26')](function(_0x1e04ea){_0xa75955['rows']=_0x1e04ea;return _0xa75955;})[_0xe75c('0x26')](respondWithFilteredResult(_0x2cdeec,_0x1ca99c))[_0xe75c('0x4a')](handleError(_0x2cdeec,null));};exports[_0xe75c('0x4b')]=function(_0x4b4d2c,_0x1d0e82){var _0xa102d={'raw':!![],'where':{'id':_0x4b4d2c[_0xe75c('0x4c')]['id']}},_0x11e287={};_0x11e287[_0xe75c('0x36')]=_[_0xe75c('0x37')](db[_0xe75c('0x32')][_0xe75c('0x33')]);_0x11e287[_0xe75c('0x38')]=_[_0xe75c('0x37')](_0x4b4d2c[_0xe75c('0x38')]);_0x11e287[_0xe75c('0x42')]=_[_0xe75c('0x39')](_0x11e287[_0xe75c('0x36')],_0x11e287[_0xe75c('0x38')]);_0xa102d[_0xe75c('0x3a')]=_[_0xe75c('0x39')](_0x11e287[_0xe75c('0x36')],qs['fields'](_0x4b4d2c[_0xe75c('0x38')][_0xe75c('0x3b')]));_0xa102d['attributes']=_0xa102d['attributes'][_0xe75c('0x3c')]?_0xa102d[_0xe75c('0x3a')]:_0x11e287[_0xe75c('0x36')];if(_0x4b4d2c[_0xe75c('0x38')][_0xe75c('0x48')]){_0xa102d[_0xe75c('0x4d')]=[{'all':!![]}];}_0xa102d=_[_0xe75c('0x4e')]({},_0xa102d,_0x4b4d2c['options']);return db[_0xe75c('0x32')][_0xe75c('0x4f')](_0xa102d)[_0xe75c('0x26')](handleEntityNotFound(_0x1d0e82,null))['then'](respondWithResult(_0x1d0e82,null))['catch'](handleError(_0x1d0e82,null));};exports[_0xe75c('0x50')]=function(_0x33dde5,_0x46ef3d){return db['SquareOdbc']['create'](_0x33dde5[_0xe75c('0x51')],{})[_0xe75c('0x26')](function(_0x4db0ad){var _0xc00d65=_0x33dde5[_0xe75c('0x52')]['get']({'plain':!![]});if(!_0xc00d65)throw new Error(_0xe75c('0x53'));if(_0xc00d65[_0xe75c('0x54')]===_0xe75c('0x52')){var _0x570680=_0x4db0ad[_0xe75c('0x28')]({'plain':!![]});var _0x1cfda8=_0xe75c('0x29');return db[_0xe75c('0x55')][_0xe75c('0x4f')]({'where':{'name':_0x1cfda8,'userProfileId':_0xc00d65[_0xe75c('0x56')]},'raw':!![]})['then'](function(_0xf8c223){if(_0xf8c223&&_0xf8c223[_0xe75c('0x57')]===0x0){return db[_0xe75c('0x2a')][_0xe75c('0x50')]({'name':_0x570680[_0xe75c('0x2e')],'resourceId':_0x570680['id'],'type':_0xf8c223['name'],'sectionId':_0xf8c223['id']},{})['then'](function(){return _0x4db0ad;});}else{return _0x4db0ad;}})['catch'](function(_0x3f81ca){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f81ca);throw _0x3f81ca;});}return _0x4db0ad;})['then'](respondWithResult(_0x46ef3d,0xc9))[_0xe75c('0x4a')](handleError(_0x46ef3d,null));};exports[_0xe75c('0x25')]=function(_0x34fb39,_0x44d2b9){if(_0x34fb39[_0xe75c('0x51')]['id']){delete _0x34fb39['body']['id'];}return db[_0xe75c('0x32')][_0xe75c('0x4f')]({'where':{'id':_0x34fb39[_0xe75c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x44d2b9,null))[_0xe75c('0x26')](saveUpdates(_0x34fb39[_0xe75c('0x51')],null))['then'](respondWithResult(_0x44d2b9,null))['catch'](handleError(_0x44d2b9,null));};exports[_0xe75c('0x27')]=function(_0x19993,_0x1e3d15){return db[_0xe75c('0x32')][_0xe75c('0x4f')]({'where':{'id':_0x19993['params']['id']}})[_0xe75c('0x26')](handleEntityNotFound(_0x1e3d15,null))[_0xe75c('0x26')](removeEntity(_0x1e3d15,null))[_0xe75c('0x4a')](handleError(_0x1e3d15,null));};exports['test']=function(_0x5eed31,_0x507ced,_0xe6b87d){var _0x3fb8ed;return db[_0xe75c('0x32')]['find']({'where':{'id':_0x5eed31[_0xe75c('0x4c')]['id']},'attributes':['id',_0xe75c('0x58')]})[_0xe75c('0x26')](handleEntityNotFound(_0x507ced,null))[_0xe75c('0x26')](function(_0x2463bf){if(_0x2463bf){var _0x449e89=require(_0xe75c('0x59'))();_0x449e89['openSync'](_0x2463bf['dsn']);_0x449e89[_0xe75c('0x5a')]();return _0x2463bf;}})[_0xe75c('0x26')](respondWithResult(_0x507ced,null))[_0xe75c('0x4a')](handleError(_0x507ced,null));}; \ No newline at end of file +var _0x9db3=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','test','odbc','openSync','dsn','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','count','offset','limit','reject','save','update','then','destroy','get','ODBC','error','name','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9db3,0xc9));var _0x39db=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9db3[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x39db('0x0'));var rimraf=require(_0x39db('0x1'));var zipdir=require(_0x39db('0x2'));var jsonpatch=require(_0x39db('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x39db('0x4'));var Mustache=require(_0x39db('0x5'));var util=require('util');var path=require(_0x39db('0x6'));var sox=require(_0x39db('0x7'));var csv=require('to-csv');var ejs=require(_0x39db('0x8'));var fs=require('fs');var fs_extra=require(_0x39db('0x9'));var _=require(_0x39db('0xa'));var squel=require(_0x39db('0xb'));var crypto=require(_0x39db('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x39db('0xd'));var querystring=require(_0x39db('0xe'));var Papa=require(_0x39db('0xf'));var Redis=require(_0x39db('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x39db('0x11'));var as=require(_0x39db('0x12'));var hardwareService=require(_0x39db('0x13'));var logger=require(_0x39db('0x14'))(_0x39db('0x15'));var utils=require(_0x39db('0x16'));var config=require(_0x39db('0x17'));var licenseUtil=require(_0x39db('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30d0e8,_0x1a07bd){_0x1a07bd=_0x1a07bd||0xcc;return function(_0x176dd1){if(_0x176dd1){return _0x30d0e8['sendStatus'](_0x1a07bd);}return _0x30d0e8['status'](_0x1a07bd)[_0x39db('0x19')]();};}function respondWithResult(_0x448b03,_0x323811){_0x323811=_0x323811||0xc8;return function(_0x492a6f){if(_0x492a6f){return _0x448b03[_0x39db('0x1a')](_0x323811)[_0x39db('0x1b')](_0x492a6f);}};}function respondWithFilteredResult(_0x2a8175,_0xbd849e){return function(_0x13e6ec){if(_0x13e6ec){var _0x2168fc=typeof _0xbd849e['offset']===_0x39db('0x1c')&&typeof _0xbd849e['limit']===_0x39db('0x1c');var _0x49dbbe=_0x13e6ec[_0x39db('0x1d')];var _0x1a3ae3=_0x2168fc?0x0:_0xbd849e[_0x39db('0x1e')];var _0x1fd45a=_0x2168fc?_0x13e6ec['count']:_0xbd849e['offset']+_0xbd849e[_0x39db('0x1f')];var _0x864812;if(_0x1fd45a>=_0x49dbbe){_0x1fd45a=_0x49dbbe;_0x864812=0xc8;}else{_0x864812=0xce;}_0x2a8175[_0x39db('0x1a')](_0x864812);return _0x2a8175['set']('Content-Range',_0x1a3ae3+'-'+_0x1fd45a+'/'+_0x49dbbe)[_0x39db('0x1b')](_0x13e6ec);}return null;};}function patchUpdates(_0x50e8b5){return function(_0x49d5af){try{jsonpatch['apply'](_0x49d5af,_0x50e8b5,!![]);}catch(_0x4d60ae){return BPromise[_0x39db('0x20')](_0x4d60ae);}return _0x49d5af[_0x39db('0x21')]();};}function saveUpdates(_0x2691d0,_0x5b210d){return function(_0x3d61df){if(_0x3d61df){return _0x3d61df[_0x39db('0x22')](_0x2691d0)[_0x39db('0x23')](function(_0x532b69){return _0x532b69;});}return null;};}function removeEntity(_0x404f1b,_0xae1efa){return function(_0x3a7078){if(_0x3a7078){return _0x3a7078[_0x39db('0x24')]()['then'](function(){var _0x37b885=_0x3a7078[_0x39db('0x25')]({'plain':!![]});var _0x23814=_0x39db('0x26');return db['UserProfileResource'][_0x39db('0x24')]({'where':{'type':_0x23814,'resourceId':_0x37b885['id']}})['then'](function(){return _0x3a7078;});})[_0x39db('0x23')](function(){_0x404f1b[_0x39db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e6ba2,_0x2d74e9){return function(_0x353f39){if(!_0x353f39){_0x3e6ba2['sendStatus'](0x194);}return _0x353f39;};}function handleError(_0xf37f9f,_0x340058){_0x340058=_0x340058||0x1f4;return function(_0x5a7394){logger[_0x39db('0x27')](_0x5a7394['stack']);if(_0x5a7394[_0x39db('0x28')]){delete _0x5a7394[_0x39db('0x28')];}_0xf37f9f[_0x39db('0x1a')](_0x340058)['send'](_0x5a7394);};}exports['index']=function(_0x3dfbb9,_0x4a5b83){var _0x504df1={},_0x5312df={},_0x127ab3={'count':0x0,'rows':[]};var _0x3e1c41=_[_0x39db('0x29')](db[_0x39db('0x2a')][_0x39db('0x2b')],function(_0x3e2973){return{'name':_0x3e2973[_0x39db('0x2c')],'type':_0x3e2973[_0x39db('0x2d')][_0x39db('0x2e')]};});_0x5312df[_0x39db('0x2f')]=_[_0x39db('0x29')](_0x3e1c41,_0x39db('0x28'));_0x5312df[_0x39db('0x30')]=_['keys'](_0x3dfbb9[_0x39db('0x30')]);_0x5312df[_0x39db('0x31')]=_[_0x39db('0x32')](_0x5312df[_0x39db('0x2f')],_0x5312df[_0x39db('0x30')]);_0x504df1['attributes']=_[_0x39db('0x32')](_0x5312df[_0x39db('0x2f')],qs['fields'](_0x3dfbb9['query'][_0x39db('0x33')]));_0x504df1[_0x39db('0x34')]=_0x504df1[_0x39db('0x34')]['length']?_0x504df1[_0x39db('0x34')]:_0x5312df['model'];if(!_0x3dfbb9['query'][_0x39db('0x35')](_0x39db('0x36'))){_0x504df1[_0x39db('0x1f')]=qs[_0x39db('0x1f')](_0x3dfbb9[_0x39db('0x30')][_0x39db('0x1f')]);_0x504df1[_0x39db('0x1e')]=qs[_0x39db('0x1e')](_0x3dfbb9[_0x39db('0x30')][_0x39db('0x1e')]);}_0x504df1[_0x39db('0x37')]=qs[_0x39db('0x38')](_0x3dfbb9[_0x39db('0x30')][_0x39db('0x38')]);_0x504df1[_0x39db('0x39')]=qs['filters'](_['pick'](_0x3dfbb9[_0x39db('0x30')],_0x5312df[_0x39db('0x31')]),_0x3e1c41);if(_0x3dfbb9[_0x39db('0x30')][_0x39db('0x3a')]){_0x504df1[_0x39db('0x39')]=_['merge'](_0x504df1[_0x39db('0x39')],{'$or':_['map'](_0x3e1c41,function(_0x25748a){if(_0x25748a[_0x39db('0x2d')]!==_0x39db('0x3b')){var _0x4c539d={};_0x4c539d[_0x25748a[_0x39db('0x28')]]={'$like':'%'+_0x3dfbb9[_0x39db('0x30')][_0x39db('0x3a')]+'%'};return _0x4c539d;}})});}_0x504df1=_[_0x39db('0x3c')]({},_0x504df1,_0x3dfbb9[_0x39db('0x3d')]);var _0x24964b={'where':_0x504df1['where']};return db[_0x39db('0x2a')][_0x39db('0x1d')](_0x24964b)[_0x39db('0x23')](function(_0x4dc12e){_0x127ab3[_0x39db('0x1d')]=_0x4dc12e;if(_0x3dfbb9[_0x39db('0x30')][_0x39db('0x3e')]){_0x504df1[_0x39db('0x3f')]=[{'all':!![]}];}return db[_0x39db('0x2a')][_0x39db('0x40')](_0x504df1);})['then'](function(_0x2ea79c){_0x127ab3[_0x39db('0x41')]=_0x2ea79c;return _0x127ab3;})[_0x39db('0x23')](respondWithFilteredResult(_0x4a5b83,_0x504df1))['catch'](handleError(_0x4a5b83,null));};exports['show']=function(_0x274151,_0x249eca){var _0x54fcc6={'raw':!![],'where':{'id':_0x274151[_0x39db('0x42')]['id']}},_0x34c977={};_0x34c977[_0x39db('0x2f')]=_[_0x39db('0x43')](db[_0x39db('0x2a')][_0x39db('0x2b')]);_0x34c977[_0x39db('0x30')]=_[_0x39db('0x43')](_0x274151[_0x39db('0x30')]);_0x34c977[_0x39db('0x31')]=_[_0x39db('0x32')](_0x34c977[_0x39db('0x2f')],_0x34c977[_0x39db('0x30')]);_0x54fcc6[_0x39db('0x34')]=_[_0x39db('0x32')](_0x34c977[_0x39db('0x2f')],qs[_0x39db('0x33')](_0x274151[_0x39db('0x30')][_0x39db('0x33')]));_0x54fcc6[_0x39db('0x34')]=_0x54fcc6['attributes'][_0x39db('0x44')]?_0x54fcc6['attributes']:_0x34c977[_0x39db('0x2f')];if(_0x274151[_0x39db('0x30')][_0x39db('0x3e')]){_0x54fcc6['include']=[{'all':!![]}];}_0x54fcc6=_[_0x39db('0x3c')]({},_0x54fcc6,_0x274151[_0x39db('0x3d')]);return db[_0x39db('0x2a')][_0x39db('0x45')](_0x54fcc6)[_0x39db('0x23')](handleEntityNotFound(_0x249eca,null))[_0x39db('0x23')](respondWithResult(_0x249eca,null))['catch'](handleError(_0x249eca,null));};exports[_0x39db('0x46')]=function(_0x560955,_0x409776){return db[_0x39db('0x2a')][_0x39db('0x46')](_0x560955[_0x39db('0x47')],{})['then'](function(_0x3c708f){var _0x14cd3e=_0x560955[_0x39db('0x48')][_0x39db('0x25')]({'plain':!![]});if(!_0x14cd3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14cd3e[_0x39db('0x49')]==='user'){var _0x2e10bf=_0x3c708f[_0x39db('0x25')]({'plain':!![]});var _0x211a59=_0x39db('0x26');return db[_0x39db('0x4a')][_0x39db('0x45')]({'where':{'name':_0x211a59,'userProfileId':_0x14cd3e[_0x39db('0x4b')]},'raw':!![]})['then'](function(_0x39fc57){if(_0x39fc57&&_0x39fc57[_0x39db('0x4c')]===0x0){return db[_0x39db('0x4d')]['create']({'name':_0x2e10bf[_0x39db('0x28')],'resourceId':_0x2e10bf['id'],'type':_0x39fc57['name'],'sectionId':_0x39fc57['id']},{})[_0x39db('0x23')](function(){return _0x3c708f;});}else{return _0x3c708f;}})['catch'](function(_0x41559b){logger['error'](_0x39db('0x4e'),_0x41559b);throw _0x41559b;});}return _0x3c708f;})['then'](respondWithResult(_0x409776,0xc9))['catch'](handleError(_0x409776,null));};exports[_0x39db('0x22')]=function(_0x56cf39,_0x2eeb86){if(_0x56cf39[_0x39db('0x47')]['id']){delete _0x56cf39[_0x39db('0x47')]['id'];}return db[_0x39db('0x2a')][_0x39db('0x45')]({'where':{'id':_0x56cf39['params']['id']}})[_0x39db('0x23')](handleEntityNotFound(_0x2eeb86,null))['then'](saveUpdates(_0x56cf39[_0x39db('0x47')],null))[_0x39db('0x23')](respondWithResult(_0x2eeb86,null))[_0x39db('0x4f')](handleError(_0x2eeb86,null));};exports[_0x39db('0x24')]=function(_0x4c5c05,_0x322a06){return db['SquareOdbc'][_0x39db('0x45')]({'where':{'id':_0x4c5c05[_0x39db('0x42')]['id']}})[_0x39db('0x23')](handleEntityNotFound(_0x322a06,null))[_0x39db('0x23')](removeEntity(_0x322a06,null))[_0x39db('0x4f')](handleError(_0x322a06,null));};exports[_0x39db('0x50')]=function(_0x334a74,_0x17454d,_0x469ca1){var _0x545e48;return db[_0x39db('0x2a')][_0x39db('0x45')]({'where':{'id':_0x334a74[_0x39db('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x17454d,null))[_0x39db('0x23')](function(_0xd72e12){if(_0xd72e12){var _0x44cbd5=require(_0x39db('0x51'))();_0x44cbd5[_0x39db('0x52')](_0xd72e12[_0x39db('0x53')]);_0x44cbd5['closeSync']();return _0xd72e12;}})[_0x39db('0x23')](respondWithResult(_0x17454d,null))[_0x39db('0x4f')](handleError(_0x17454d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 7d345c7..71361a1 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ae7=['api','bluebird','request-promise','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','../../config/logger'];(function(_0x56429f,_0x507109){var _0x5e7e14=function(_0x2c44a8){while(--_0x2c44a8){_0x56429f['push'](_0x56429f['shift']());}};_0x5e7e14(++_0x507109);}(_0x4ae7,0x1d6));var _0x74ae=function(_0x4b031e,_0x335a63){_0x4b031e=_0x4b031e-0x0;var _0xc19fa9=_0x4ae7[_0x4b031e];return _0xc19fa9;};'use strict';var _=require(_0x74ae('0x0'));var util=require(_0x74ae('0x1'));var logger=require(_0x74ae('0x2'))(_0x74ae('0x3'));var moment=require('moment');var BPromise=require(_0x74ae('0x4'));var rp=require(_0x74ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x74ae('0x6'));var attributes=require(_0x74ae('0x7'));module[_0x74ae('0x8')]=function(_0x9c0e74,_0x3b60ec){return _0x9c0e74[_0x74ae('0x9')](_0x74ae('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb58=['SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0xf8c24a,_0x5a3b0d){var _0x183d5f=function(_0x58824b){while(--_0x58824b){_0xf8c24a['push'](_0xf8c24a['shift']());}};_0x183d5f(++_0x5a3b0d);}(_0xeb58,0x1a2));var _0x8eb5=function(_0xaf087f,_0x2ab90b){_0xaf087f=_0xaf087f-0x0;var _0x183eaa=_0xeb58[_0xaf087f];return _0x183eaa;};'use strict';var _=require(_0x8eb5('0x0'));var util=require(_0x8eb5('0x1'));var logger=require(_0x8eb5('0x2'))(_0x8eb5('0x3'));var moment=require(_0x8eb5('0x4'));var BPromise=require(_0x8eb5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eb5('0x6'));var rimraf=require(_0x8eb5('0x7'));var config=require(_0x8eb5('0x8'));var attributes=require(_0x8eb5('0x9'));module[_0x8eb5('0xa')]=function(_0x3643e9,_0x5b15e1){return _0x3643e9['define'](_0x8eb5('0xb'),attributes,{'tableName':_0x8eb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 3ab0f56..e3d2a73 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaba5=['then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','model','include','map','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x5f265e,_0x5f29c3){var _0x197592=function(_0x2b02d3){while(--_0x2b02d3){_0x5f265e['push'](_0x5f265e['shift']());}};_0x197592(++_0x5f29c3);}(_0xaba5,0x1b4));var _0x5aba=function(_0x51a343,_0x1b7f94){_0x51a343=_0x51a343-0x0;var _0x4a279e=_0xaba5[_0x51a343];return _0x4a279e;};'use strict';var _=require(_0x5aba('0x0'));var util=require(_0x5aba('0x1'));var moment=require(_0x5aba('0x2'));var BPromise=require(_0x5aba('0x3'));var rs=require(_0x5aba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5aba('0x5'))['db'];var utils=require(_0x5aba('0x6'));var logger=require(_0x5aba('0x7'))(_0x5aba('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5aba('0x9')][_0x5aba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c393,_0x55daea,_0x3db8b2){return new BPromise(function(_0x4745ad,_0x427793){return client[_0x5aba('0xb')](_0x39c393,_0x3db8b2)[_0x5aba('0xc')](function(_0x4f80c5){logger[_0x5aba('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x55daea,_0x5aba('0xe'));logger['debug'](_0x5aba('0xf'),_0x55daea,_0x5aba('0xe'),JSON[_0x5aba('0x10')](_0x4f80c5));if(_0x4f80c5[_0x5aba('0x11')]){if(_0x4f80c5[_0x5aba('0x11')][_0x5aba('0x12')]===0x1f4){logger[_0x5aba('0x11')](_0x5aba('0x13'),_0x55daea,_0x4f80c5['error']['message']);return _0x427793(_0x4f80c5[_0x5aba('0x11')]['message']);}logger[_0x5aba('0x11')](_0x5aba('0x13'),_0x55daea,_0x4f80c5['error'][_0x5aba('0x14')]);return _0x4745ad(_0x4f80c5[_0x5aba('0x11')][_0x5aba('0x14')]);}else{logger['info'](_0x5aba('0x13'),_0x55daea,_0x5aba('0xe'));_0x4745ad(_0x4f80c5['result'][_0x5aba('0x14')]);}})[_0x5aba('0x15')](function(_0x19c02e){logger[_0x5aba('0x11')](_0x5aba('0x13'),_0x55daea,_0x19c02e);_0x427793(_0x19c02e);});});}exports[_0x5aba('0x16')]=function(_0x440ce9){var _0x209cd9=this;return new Promise(function(_0x14278b,_0x1f1cfe){return db[_0x5aba('0x17')]['find']({'raw':_0x440ce9[_0x5aba('0x18')]?_0x440ce9['options'][_0x5aba('0x19')]===undefined?!![]:![]:!![],'where':_0x440ce9['options']?_0x440ce9[_0x5aba('0x18')][_0x5aba('0x1a')]||null:null,'attributes':_0x440ce9[_0x5aba('0x18')]?_0x440ce9[_0x5aba('0x18')][_0x5aba('0x1b')]||null:null,'include':_0x440ce9['options']?_0x440ce9[_0x5aba('0x18')]['include']?_['map'](_0x440ce9[_0x5aba('0x18')]['include'],function(_0xf37b89){return{'model':db[_0xf37b89[_0x5aba('0x1c')]],'as':_0xf37b89['as'],'attributes':_0xf37b89['attributes'],'include':_0xf37b89[_0x5aba('0x1d')]?_['map'](_0xf37b89['include'],function(_0x3ca877){return{'model':db[_0x3ca877[_0x5aba('0x1c')]],'as':_0x3ca877['as'],'attributes':_0x3ca877[_0x5aba('0x1b')],'include':_0x3ca877['include']?_[_0x5aba('0x1e')](_0x3ca877[_0x5aba('0x1d')],function(_0x46ebcb){return{'model':db[_0x46ebcb[_0x5aba('0x1c')]],'as':_0x46ebcb['as'],'attributes':_0x46ebcb[_0x5aba('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51128b){logger['info'](_0x5aba('0x16'),_0x440ce9);logger[_0x5aba('0x1f')](_0x5aba('0x16'),_0x440ce9,JSON[_0x5aba('0x10')](_0x51128b));_0x14278b(_0x51128b);})[_0x5aba('0x15')](function(_0x2d4486){logger[_0x5aba('0x11')](_0x5aba('0x16'),_0x2d4486[_0x5aba('0x14')],_0x440ce9);_0x1f1cfe(_0x209cd9[_0x5aba('0x11')](0x1f4,_0x2d4486[_0x5aba('0x14')]));});});}; \ No newline at end of file +var _0xe6cb=['where','attributes','include','map','model','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw'];(function(_0xad7c1d,_0x27feb9){var _0x2d172e=function(_0x4104e0){while(--_0x4104e0){_0xad7c1d['push'](_0xad7c1d['shift']());}};_0x2d172e(++_0x27feb9);}(_0xe6cb,0xa6));var _0xbe6c=function(_0x2cc751,_0x13acd3){_0x2cc751=_0x2cc751-0x0;var _0x1c84ee=_0xe6cb[_0x2cc751];return _0x1c84ee;};'use strict';var _=require(_0xbe6c('0x0'));var util=require(_0xbe6c('0x1'));var moment=require('moment');var BPromise=require(_0xbe6c('0x2'));var rs=require(_0xbe6c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe6c('0x4'))['db'];var utils=require(_0xbe6c('0x5'));var logger=require(_0xbe6c('0x6'))(_0xbe6c('0x7'));var config=require(_0xbe6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe6c('0x9')][_0xbe6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x103db8,_0x4671aa,_0x54334a){return new BPromise(function(_0x440bf2,_0x69a26f){return client[_0xbe6c('0xb')](_0x103db8,_0x54334a)[_0xbe6c('0xc')](function(_0x50ef8d){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4671aa,_0xbe6c('0xd'));logger[_0xbe6c('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4671aa,_0xbe6c('0xd'),JSON['stringify'](_0x50ef8d));if(_0x50ef8d['error']){if(_0x50ef8d[_0xbe6c('0xf')]['code']===0x1f4){logger[_0xbe6c('0xf')](_0xbe6c('0x10'),_0x4671aa,_0x50ef8d['error'][_0xbe6c('0x11')]);return _0x69a26f(_0x50ef8d[_0xbe6c('0xf')]['message']);}logger[_0xbe6c('0xf')](_0xbe6c('0x10'),_0x4671aa,_0x50ef8d['error']['message']);return _0x440bf2(_0x50ef8d['error'][_0xbe6c('0x11')]);}else{logger[_0xbe6c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x4671aa,_0xbe6c('0xd'));_0x440bf2(_0x50ef8d[_0xbe6c('0x13')][_0xbe6c('0x11')]);}})[_0xbe6c('0x14')](function(_0x2e0d45){logger[_0xbe6c('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x4671aa,_0x2e0d45);_0x69a26f(_0x2e0d45);});});}exports[_0xbe6c('0x15')]=function(_0x130c6c){var _0x5ab5f0=this;return new Promise(function(_0x2117f0,_0x534759){return db[_0xbe6c('0x16')][_0xbe6c('0x17')]({'raw':_0x130c6c[_0xbe6c('0x18')]?_0x130c6c['options'][_0xbe6c('0x19')]===undefined?!![]:![]:!![],'where':_0x130c6c['options']?_0x130c6c['options'][_0xbe6c('0x1a')]||null:null,'attributes':_0x130c6c[_0xbe6c('0x18')]?_0x130c6c[_0xbe6c('0x18')][_0xbe6c('0x1b')]||null:null,'include':_0x130c6c[_0xbe6c('0x18')]?_0x130c6c[_0xbe6c('0x18')][_0xbe6c('0x1c')]?_[_0xbe6c('0x1d')](_0x130c6c[_0xbe6c('0x18')]['include'],function(_0x52fca3){return{'model':db[_0x52fca3['model']],'as':_0x52fca3['as'],'attributes':_0x52fca3['attributes'],'include':_0x52fca3['include']?_['map'](_0x52fca3[_0xbe6c('0x1c')],function(_0x8f2664){return{'model':db[_0x8f2664[_0xbe6c('0x1e')]],'as':_0x8f2664['as'],'attributes':_0x8f2664[_0xbe6c('0x1b')],'include':_0x8f2664[_0xbe6c('0x1c')]?_[_0xbe6c('0x1d')](_0x8f2664[_0xbe6c('0x1c')],function(_0x479b12){return{'model':db[_0x479b12['model']],'as':_0x479b12['as'],'attributes':_0x479b12[_0xbe6c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe6c('0xc')](function(_0x1470d0){logger[_0xbe6c('0x12')](_0xbe6c('0x15'),_0x130c6c);logger[_0xbe6c('0xe')](_0xbe6c('0x15'),_0x130c6c,JSON[_0xbe6c('0x1f')](_0x1470d0));_0x2117f0(_0x1470d0);})['catch'](function(_0x5e2c49){logger[_0xbe6c('0xf')]('ShowSquareOdbc',_0x5e2c49[_0xbe6c('0x11')],_0x130c6c);_0x534759(_0x5ab5f0[_0xbe6c('0xf')](0x1f4,_0x5e2c49[_0xbe6c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f3d8aee..df77cfa 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3d=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','getUsers','post','addUsers','put','update','delete','removeUsers','exports','util'];(function(_0x4ffc0a,_0x47d3b7){var _0x121e11=function(_0x5c9d92){while(--_0x5c9d92){_0x4ffc0a['push'](_0x4ffc0a['shift']());}};_0x121e11(++_0x47d3b7);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x160dc2,_0x7cc777){_0x160dc2=_0x160dc2-0x0;var _0x457e76=_0x1c3d[_0x160dc2];return _0x457e76;};'use strict';var multer=require('multer');var util=require(_0xd1c3('0x0'));var path=require(_0xd1c3('0x1'));var timeout=require(_0xd1c3('0x2'));var express=require(_0xd1c3('0x3'));var router=express[_0xd1c3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd1c3('0x5'));var config=require(_0xd1c3('0x6'));var controller=require(_0xd1c3('0x7'));router[_0xd1c3('0x8')]('/',auth[_0xd1c3('0x9')](),controller[_0xd1c3('0xa')]);router['get'](_0xd1c3('0xb'),auth[_0xd1c3('0x9')](),controller['show']);router[_0xd1c3('0x8')](_0xd1c3('0xc'),auth[_0xd1c3('0x9')](),controller[_0xd1c3('0xd')]);router[_0xd1c3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd1c3('0xe')](_0xd1c3('0xc'),auth[_0xd1c3('0x9')](),controller[_0xd1c3('0xf')]);router[_0xd1c3('0x10')](_0xd1c3('0xb'),auth[_0xd1c3('0x9')](),controller[_0xd1c3('0x11')]);router[_0xd1c3('0x12')]('/:id',auth[_0xd1c3('0x9')](),controller['destroy']);router['delete'](_0xd1c3('0xc'),auth['isAuthenticated'](),controller[_0xd1c3('0x13')]);module[_0xd1c3('0x14')]=router; \ No newline at end of file +var _0xab9c=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete'];(function(_0x243070,_0x2a4b0a){var _0x50d127=function(_0x1a298e){while(--_0x1a298e){_0x243070['push'](_0x243070['shift']());}};_0x50d127(++_0x2a4b0a);}(_0xab9c,0xd0));var _0xcab9=function(_0x2ba317,_0x2df181){_0x2ba317=_0x2ba317-0x0;var _0x4c1c74=_0xab9c[_0x2ba317];return _0x4c1c74;};'use strict';var multer=require('multer');var util=require(_0xcab9('0x0'));var path=require(_0xcab9('0x1'));var timeout=require(_0xcab9('0x2'));var express=require(_0xcab9('0x3'));var router=express[_0xcab9('0x4')]();var fs_extra=require(_0xcab9('0x5'));var auth=require(_0xcab9('0x6'));var interaction=require(_0xcab9('0x7'));var config=require(_0xcab9('0x8'));var controller=require('./squareProject.controller');router[_0xcab9('0x9')]('/',auth[_0xcab9('0xa')](),controller[_0xcab9('0xb')]);router['get'](_0xcab9('0xc'),auth[_0xcab9('0xa')](),controller[_0xcab9('0xd')]);router['get'](_0xcab9('0xe'),auth[_0xcab9('0xa')](),controller[_0xcab9('0xf')]);router[_0xcab9('0x10')]('/',auth[_0xcab9('0xa')](),controller[_0xcab9('0x11')]);router[_0xcab9('0x10')](_0xcab9('0xe'),auth[_0xcab9('0xa')](),controller[_0xcab9('0x12')]);router[_0xcab9('0x13')](_0xcab9('0xc'),auth[_0xcab9('0xa')](),controller[_0xcab9('0x14')]);router[_0xcab9('0x15')](_0xcab9('0xc'),auth[_0xcab9('0xa')](),controller['destroy']);router[_0xcab9('0x15')](_0xcab9('0xe'),auth[_0xcab9('0xa')](),controller['removeUsers']);module[_0xcab9('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 53b275e..872d1b3 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13c4=['utf8','production','DATE','exports','STRING','TEXT','BLOB','long','preproduction','getDataValue','toString'];(function(_0x265cac,_0x5914c0){var _0x411145=function(_0x1a8ee9){while(--_0x1a8ee9){_0x265cac['push'](_0x265cac['shift']());}};_0x411145(++_0x5914c0);}(_0x13c4,0x121));var _0x413c=function(_0x678734,_0x329969){_0x678734=_0x678734-0x0;var _0x5a29aa=_0x13c4[_0x678734];return _0x5a29aa;};'use strict';var Sequelize=require('sequelize');module[_0x413c('0x0')]={'name':{'type':Sequelize[_0x413c('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x413c('0x1')]},'notes':{'type':Sequelize[_0x413c('0x2')]},'preproduction':{'type':Sequelize[_0x413c('0x3')](_0x413c('0x4')),'get':function(){if(this['getDataValue'](_0x413c('0x5'))){return this[_0x413c('0x6')](_0x413c('0x5'))[_0x413c('0x7')](_0x413c('0x8'));}}},'production':{'type':Sequelize[_0x413c('0x3')](_0x413c('0x4')),'get':function(){if(this[_0x413c('0x6')]('production')){return this[_0x413c('0x6')](_0x413c('0x9'))[_0x413c('0x7')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x413c('0xa')]}}; \ No newline at end of file +var _0x29ed=['DATE','sequelize','exports','STRING','name','getDataValue','preproduction','toString','utf8','BLOB','long','production'];(function(_0x43cfc3,_0x25db06){var _0x1e36ea=function(_0x57ef2e){while(--_0x57ef2e){_0x43cfc3['push'](_0x43cfc3['shift']());}};_0x1e36ea(++_0x25db06);}(_0x29ed,0x181));var _0xd29e=function(_0x130c00,_0x3a2054){_0x130c00=_0x130c00-0x0;var _0x173ba7=_0x29ed[_0x130c00];return _0x173ba7;};'use strict';var Sequelize=require(_0xd29e('0x0'));module[_0xd29e('0x1')]={'name':{'type':Sequelize[_0xd29e('0x2')],'unique':_0xd29e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd29e('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xd29e('0x4')](_0xd29e('0x5'))){return this['getDataValue']('preproduction')[_0xd29e('0x6')](_0xd29e('0x7'));}}},'production':{'type':Sequelize[_0xd29e('0x8')](_0xd29e('0x9')),'get':function(){if(this[_0xd29e('0x4')](_0xd29e('0xa'))){return this['getDataValue'](_0xd29e('0xa'))[_0xd29e('0x6')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd29e('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 93751c7..0e6ea55 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaeee=['getUsers','findOne','User','sort','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','get','SquareProjects','UserProfileResource','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','rawAttributes','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addUsers','ids','removeUsers','userSquareProject:remove','emit'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0xaeee,0x1a5));var _0xeaee=function(_0xb2b377,_0x3e4c8b){_0xb2b377=_0xb2b377-0x0;var _0x509c73=_0xaeee[_0xb2b377];return _0x509c73;};'use strict';var emlformat=require(_0xeaee('0x0'));var rimraf=require(_0xeaee('0x1'));var zipdir=require(_0xeaee('0x2'));var jsonpatch=require(_0xeaee('0x3'));var rp=require(_0xeaee('0x4'));var moment=require('moment');var BPromise=require(_0xeaee('0x5'));var Mustache=require(_0xeaee('0x6'));var util=require(_0xeaee('0x7'));var path=require('path');var sox=require(_0xeaee('0x8'));var csv=require(_0xeaee('0x9'));var ejs=require(_0xeaee('0xa'));var fs=require('fs');var fs_extra=require(_0xeaee('0xb'));var _=require(_0xeaee('0xc'));var squel=require(_0xeaee('0xd'));var crypto=require(_0xeaee('0xe'));var jsforce=require(_0xeaee('0xf'));var deskjs=require(_0xeaee('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeaee('0x11'));var Papa=require(_0xeaee('0x12'));var Redis=require('ioredis');var authService=require(_0xeaee('0x13'));var qs=require(_0xeaee('0x14'));var as=require(_0xeaee('0x15'));var hardwareService=require(_0xeaee('0x16'));var logger=require(_0xeaee('0x17'))(_0xeaee('0x18'));var utils=require(_0xeaee('0x19'));var config=require(_0xeaee('0x1a'));var licenseUtil=require(_0xeaee('0x1b'));var db=require(_0xeaee('0x1c'))['db'];config[_0xeaee('0x1d')]=_[_0xeaee('0x1e')](config[_0xeaee('0x1d')],{'host':_0xeaee('0x1f'),'port':0x18eb});var socket=require(_0xeaee('0x20'))(new Redis(config[_0xeaee('0x1d')]));require(_0xeaee('0x21'))[_0xeaee('0x22')](socket);function respondWithStatusCode(_0x39cee7,_0x5aaa93){_0x5aaa93=_0x5aaa93||0xcc;return function(_0x3a7114){if(_0x3a7114){return _0x39cee7[_0xeaee('0x23')](_0x5aaa93);}return _0x39cee7[_0xeaee('0x24')](_0x5aaa93)[_0xeaee('0x25')]();};}function respondWithResult(_0x58a9ca,_0x19cc5f){_0x19cc5f=_0x19cc5f||0xc8;return function(_0x3b99b9){if(_0x3b99b9){return _0x58a9ca[_0xeaee('0x24')](_0x19cc5f)[_0xeaee('0x26')](_0x3b99b9);}};}function respondWithFilteredResult(_0x44813f,_0x3825ed){return function(_0x4d1a9d){if(_0x4d1a9d){var _0x23821a=typeof _0x3825ed['offset']===_0xeaee('0x27')&&typeof _0x3825ed[_0xeaee('0x28')]==='undefined';var _0x28cadf=_0x4d1a9d[_0xeaee('0x29')];var _0x9281b3=_0x23821a?0x0:_0x3825ed[_0xeaee('0x2a')];var _0x268b29=_0x23821a?_0x4d1a9d['count']:_0x3825ed[_0xeaee('0x2a')]+_0x3825ed['limit'];var _0x1c1967;if(_0x268b29>=_0x28cadf){_0x268b29=_0x28cadf;_0x1c1967=0xc8;}else{_0x1c1967=0xce;}_0x44813f[_0xeaee('0x24')](_0x1c1967);return _0x44813f['set'](_0xeaee('0x2b'),_0x9281b3+'-'+_0x268b29+'/'+_0x28cadf)[_0xeaee('0x26')](_0x4d1a9d);}return null;};}function patchUpdates(_0x331ac2){return function(_0x1e5020){try{jsonpatch[_0xeaee('0x2c')](_0x1e5020,_0x331ac2,!![]);}catch(_0x3338f9){return BPromise['reject'](_0x3338f9);}return _0x1e5020[_0xeaee('0x2d')]();};}function saveUpdates(_0x3e2f97,_0x5001a5){return function(_0x4d1eff){if(_0x4d1eff){return _0x4d1eff[_0xeaee('0x2e')](_0x3e2f97)['then'](function(_0x2c044c){return _0x2c044c;});}return null;};}function removeEntity(_0x4eba8d,_0x44465c){return function(_0x31e0a3){if(_0x31e0a3){return _0x31e0a3[_0xeaee('0x2f')]()[_0xeaee('0x30')](function(){var _0x522029=_0x31e0a3[_0xeaee('0x31')]({'plain':!![]});var _0x14b0c7=_0xeaee('0x32');return db[_0xeaee('0x33')][_0xeaee('0x2f')]({'where':{'type':_0x14b0c7,'resourceId':_0x522029['id']}})[_0xeaee('0x30')](function(){return _0x31e0a3;});})['then'](function(){_0x4eba8d[_0xeaee('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x61a8b5,_0xe0af54){return function(_0x209d37){if(!_0x209d37){_0x61a8b5['sendStatus'](0x194);}return _0x209d37;};}function handleError(_0x14a6a9,_0x5d380f){_0x5d380f=_0x5d380f||0x1f4;return function(_0x530f32){logger['error'](_0x530f32[_0xeaee('0x34')]);if(_0x530f32[_0xeaee('0x35')]){delete _0x530f32[_0xeaee('0x35')];}_0x14a6a9[_0xeaee('0x24')](_0x5d380f)['send'](_0x530f32);};}exports[_0xeaee('0x36')]=function(_0x55e509,_0x2ca85f){var _0x571e97={},_0xfbb6c8={},_0x45c89a={'count':0x0,'rows':[]};var _0xff4926=_[_0xeaee('0x37')](db['SquareProject']['rawAttributes'],function(_0x26c93b){return{'name':_0x26c93b[_0xeaee('0x38')],'type':_0x26c93b[_0xeaee('0x39')][_0xeaee('0x3a')]};});_0xfbb6c8[_0xeaee('0x3b')]=_[_0xeaee('0x37')](_0xff4926,_0xeaee('0x35'));_0xfbb6c8['query']=_['keys'](_0x55e509[_0xeaee('0x3c')]);_0xfbb6c8[_0xeaee('0x3d')]=_[_0xeaee('0x3e')](_0xfbb6c8[_0xeaee('0x3b')],_0xfbb6c8[_0xeaee('0x3c')]);_0x571e97['attributes']=_[_0xeaee('0x3e')](_0xfbb6c8['model'],qs[_0xeaee('0x3f')](_0x55e509[_0xeaee('0x3c')][_0xeaee('0x3f')]));_0x571e97[_0xeaee('0x40')]=_0x571e97['attributes']['length']?_0x571e97[_0xeaee('0x40')]:_0xfbb6c8['model'];if(!_0x55e509[_0xeaee('0x3c')]['hasOwnProperty'](_0xeaee('0x41'))){_0x571e97[_0xeaee('0x28')]=qs[_0xeaee('0x28')](_0x55e509[_0xeaee('0x3c')]['limit']);_0x571e97[_0xeaee('0x2a')]=qs[_0xeaee('0x2a')](_0x55e509[_0xeaee('0x3c')][_0xeaee('0x2a')]);}_0x571e97[_0xeaee('0x42')]=qs['sort'](_0x55e509['query']['sort']);_0x571e97[_0xeaee('0x43')]=qs[_0xeaee('0x3d')](_[_0xeaee('0x44')](_0x55e509['query'],_0xfbb6c8[_0xeaee('0x3d')]),_0xff4926);if(_0x55e509['query'][_0xeaee('0x45')]){_0x571e97[_0xeaee('0x43')]=_[_0xeaee('0x46')](_0x571e97['where'],{'$or':_[_0xeaee('0x37')](_0xff4926,function(_0x593d38){if(_0x593d38['type']!==_0xeaee('0x47')){var _0x1578a5={};_0x1578a5[_0x593d38[_0xeaee('0x35')]]={'$like':'%'+_0x55e509[_0xeaee('0x3c')][_0xeaee('0x45')]+'%'};return _0x1578a5;}})});}_0x571e97=_[_0xeaee('0x46')]({},_0x571e97,_0x55e509[_0xeaee('0x48')]);var _0x570ee7={'where':_0x571e97[_0xeaee('0x43')]};return db[_0xeaee('0x49')][_0xeaee('0x29')](_0x570ee7)[_0xeaee('0x30')](function(_0x5c87b8){_0x45c89a[_0xeaee('0x29')]=_0x5c87b8;if(_0x55e509[_0xeaee('0x3c')][_0xeaee('0x4a')]){_0x571e97[_0xeaee('0x4b')]=[{'all':!![]}];}return db['SquareProject'][_0xeaee('0x4c')](_0x571e97);})[_0xeaee('0x30')](function(_0x38b595){_0x45c89a[_0xeaee('0x4d')]=_0x38b595;return _0x45c89a;})['then'](respondWithFilteredResult(_0x2ca85f,_0x571e97))[_0xeaee('0x4e')](handleError(_0x2ca85f,null));};exports['show']=function(_0x50fb8c,_0x56fae6){var _0x2fd862={'raw':![],'where':{'id':_0x50fb8c['params']['id']}},_0x5a7225={};_0x5a7225[_0xeaee('0x3b')]=_['keys'](db[_0xeaee('0x49')][_0xeaee('0x4f')]);_0x5a7225[_0xeaee('0x3c')]=_[_0xeaee('0x50')](_0x50fb8c[_0xeaee('0x3c')]);_0x5a7225['filters']=_['intersection'](_0x5a7225[_0xeaee('0x3b')],_0x5a7225[_0xeaee('0x3c')]);_0x2fd862['attributes']=_[_0xeaee('0x3e')](_0x5a7225['model'],qs[_0xeaee('0x3f')](_0x50fb8c[_0xeaee('0x3c')]['fields']));_0x2fd862[_0xeaee('0x40')]=_0x2fd862[_0xeaee('0x40')][_0xeaee('0x51')]?_0x2fd862[_0xeaee('0x40')]:_0x5a7225[_0xeaee('0x3b')];if(_0x50fb8c[_0xeaee('0x3c')][_0xeaee('0x4a')]){_0x2fd862[_0xeaee('0x4b')]=[{'all':!![]}];}_0x2fd862=_[_0xeaee('0x46')]({},_0x2fd862,_0x50fb8c[_0xeaee('0x48')]);return db[_0xeaee('0x49')]['find'](_0x2fd862)[_0xeaee('0x30')](handleEntityNotFound(_0x56fae6,null))['then'](respondWithResult(_0x56fae6,null))[_0xeaee('0x4e')](handleError(_0x56fae6,null));};exports[_0xeaee('0x52')]=function(_0x480ab9,_0x22f8a2){return db[_0xeaee('0x49')]['create'](_0x480ab9[_0xeaee('0x53')],{})[_0xeaee('0x30')](function(_0x56230d){var _0x3391ca=_0x480ab9[_0xeaee('0x54')]['get']({'plain':!![]});if(!_0x3391ca)throw new Error(_0xeaee('0x55'));if(_0x3391ca[_0xeaee('0x56')]==='user'){var _0x1efe6e=_0x56230d['get']({'plain':!![]});var _0x5a601a=_0xeaee('0x32');return db[_0xeaee('0x57')]['find']({'where':{'name':_0x5a601a,'userProfileId':_0x3391ca[_0xeaee('0x58')]},'raw':!![]})[_0xeaee('0x30')](function(_0xd4b1a5){if(_0xd4b1a5&&_0xd4b1a5[_0xeaee('0x59')]===0x0){return db['UserProfileResource'][_0xeaee('0x52')]({'name':_0x1efe6e['name'],'resourceId':_0x1efe6e['id'],'type':_0xd4b1a5[_0xeaee('0x35')],'sectionId':_0xd4b1a5['id']},{})[_0xeaee('0x30')](function(){return _0x56230d;});}else{return _0x56230d;}})[_0xeaee('0x4e')](function(_0x2e9811){logger[_0xeaee('0x5a')](_0xeaee('0x5b'),_0x2e9811);throw _0x2e9811;});}return _0x56230d;})[_0xeaee('0x30')](respondWithResult(_0x22f8a2,0xc9))[_0xeaee('0x4e')](handleError(_0x22f8a2,null));};exports['update']=function(_0x9779e6,_0x19cca2){if(_0x9779e6[_0xeaee('0x53')]['id']){delete _0x9779e6[_0xeaee('0x53')]['id'];}return db[_0xeaee('0x49')][_0xeaee('0x5c')]({'where':{'id':_0x9779e6[_0xeaee('0x5d')]['id']}})[_0xeaee('0x30')](handleEntityNotFound(_0x19cca2,null))[_0xeaee('0x30')](saveUpdates(_0x9779e6[_0xeaee('0x53')],null))[_0xeaee('0x30')](respondWithResult(_0x19cca2,null))[_0xeaee('0x4e')](handleError(_0x19cca2,null));};exports['destroy']=function(_0x61cbc3,_0x78ce12){return db[_0xeaee('0x49')][_0xeaee('0x5c')]({'where':{'id':_0x61cbc3[_0xeaee('0x5d')]['id']}})[_0xeaee('0x30')](handleEntityNotFound(_0x78ce12,null))[_0xeaee('0x30')](removeEntity(_0x78ce12,null))['catch'](handleError(_0x78ce12,null));};exports[_0xeaee('0x5e')]=function(_0x2d67c2,_0x57c295,_0x38ef86){return db['SquareProject']['find']({'where':{'id':_0x2d67c2[_0xeaee('0x5d')]['id']}})[_0xeaee('0x30')](handleEntityNotFound(_0x57c295,null))[_0xeaee('0x30')](function(_0xce9ca9){if(_0xce9ca9){return _0xce9ca9[_0xeaee('0x5e')](_0x2d67c2['body'][_0xeaee('0x5f')],_['omit'](_0x2d67c2[_0xeaee('0x53')],[_0xeaee('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x57c295,null))[_0xeaee('0x4e')](handleError(_0x57c295,null));};exports[_0xeaee('0x60')]=function(_0x570476,_0x4be389,_0x57b629){return db[_0xeaee('0x49')]['find']({'where':{'id':_0x570476[_0xeaee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4be389,null))[_0xeaee('0x30')](function(_0x2722ed){if(_0x2722ed){return _0x2722ed['removeUsers'](_0x570476['query'][_0xeaee('0x5f')])['then'](function(){if(_['isArray'](_0x570476[_0xeaee('0x3c')][_0xeaee('0x5f')])){for(var _0x21eff0=0x0;_0x21eff0<_0x570476[_0xeaee('0x3c')][_0xeaee('0x5f')]['length'];_0x21eff0+=0x1){socket['emit'](_0xeaee('0x61'),{'UserId':Number(_0x570476[_0xeaee('0x3c')]['ids'][_0x21eff0]),'SquareProjectId':Number(_0x570476[_0xeaee('0x5d')]['id'])});}}else{socket[_0xeaee('0x62')]('userSquareProject:remove',{'UserId':Number(_0x570476[_0xeaee('0x3c')][_0xeaee('0x5f')]),'SquareProjectId':Number(_0x570476[_0xeaee('0x5d')]['id'])});}});}})[_0xeaee('0x30')](respondWithStatusCode(_0x4be389,null))['catch'](handleError(_0x4be389,null));};exports[_0xeaee('0x63')]=function(_0x18a0b6,_0x5b9310,_0x24d604){var _0x1a6fb0={};var _0x279c3f={};var _0x501c88;var _0xb6dfd1;return db[_0xeaee('0x49')][_0xeaee('0x64')]({'where':{'id':_0x18a0b6[_0xeaee('0x5d')]['id']}})[_0xeaee('0x30')](handleEntityNotFound(_0x5b9310,null))[_0xeaee('0x30')](function(_0x16a629){if(_0x16a629){_0x501c88=_0x16a629;_0x279c3f[_0xeaee('0x3b')]=_[_0xeaee('0x50')](db[_0xeaee('0x65')][_0xeaee('0x4f')]);_0x279c3f['query']=_[_0xeaee('0x50')](_0x18a0b6[_0xeaee('0x3c')]);_0x279c3f[_0xeaee('0x3d')]=_[_0xeaee('0x3e')](_0x279c3f[_0xeaee('0x3b')],_0x279c3f[_0xeaee('0x3c')]);_0x1a6fb0[_0xeaee('0x40')]=_['intersection'](_0x279c3f['model'],qs[_0xeaee('0x3f')](_0x18a0b6[_0xeaee('0x3c')][_0xeaee('0x3f')]));_0x1a6fb0[_0xeaee('0x40')]=_0x1a6fb0[_0xeaee('0x40')]['length']?_0x1a6fb0['attributes']:_0x279c3f['model'];_0x1a6fb0[_0xeaee('0x42')]=qs[_0xeaee('0x66')](_0x18a0b6[_0xeaee('0x3c')]['sort']);_0x1a6fb0[_0xeaee('0x43')]=qs[_0xeaee('0x3d')](_[_0xeaee('0x44')](_0x18a0b6[_0xeaee('0x3c')],_0x279c3f[_0xeaee('0x3d')]));if(_0x18a0b6[_0xeaee('0x3c')][_0xeaee('0x45')]){_0x1a6fb0[_0xeaee('0x43')]=_[_0xeaee('0x46')](_0x1a6fb0[_0xeaee('0x43')],{'$or':_['map'](_0x1a6fb0['attributes'],function(_0x50cfc3){var _0x34d0fa={};_0x34d0fa[_0x50cfc3]={'$like':'%'+_0x18a0b6[_0xeaee('0x3c')][_0xeaee('0x45')]+'%'};return _0x34d0fa;})});}_0x1a6fb0=_[_0xeaee('0x46')]({},_0x1a6fb0,_0x18a0b6[_0xeaee('0x48')]);return _0x501c88[_0xeaee('0x63')](_0x1a6fb0);}})[_0xeaee('0x30')](function(_0x1963e9){if(_0x1963e9){_0xb6dfd1=_0x1963e9[_0xeaee('0x51')];if(!_0x18a0b6[_0xeaee('0x3c')][_0xeaee('0x67')]('nolimit')){_0x1a6fb0['limit']=qs[_0xeaee('0x28')](_0x18a0b6['query']['limit']);_0x1a6fb0[_0xeaee('0x2a')]=qs[_0xeaee('0x2a')](_0x18a0b6['query']['offset']);}return _0x501c88[_0xeaee('0x63')](_0x1a6fb0);}})['then'](function(_0x569d28){if(_0x569d28){return _0x569d28?{'count':_0xb6dfd1,'rows':_0x569d28}:null;}})[_0xeaee('0x30')](respondWithResult(_0x5b9310,null))[_0xeaee('0x4e')](handleError(_0x5b9310,null));}; \ No newline at end of file +var _0x4be7=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','update','addUsers','ids','isArray','emit','userSquareProject:remove','getUsers','User','rawAttributes','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareProject','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll'];(function(_0x463121,_0x3d78de){var _0x2526b0=function(_0xc03c47){while(--_0xc03c47){_0x463121['push'](_0x463121['shift']());}};_0x2526b0(++_0x3d78de);}(_0x4be7,0x196));var _0x74be=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0x4be7[_0x162f4b];return _0x57b00b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74be('0x0'));var zipdir=require(_0x74be('0x1'));var jsonpatch=require(_0x74be('0x2'));var rp=require(_0x74be('0x3'));var moment=require(_0x74be('0x4'));var BPromise=require(_0x74be('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x74be('0x6'));var sox=require('sox');var csv=require(_0x74be('0x7'));var ejs=require(_0x74be('0x8'));var fs=require('fs');var fs_extra=require(_0x74be('0x9'));var _=require(_0x74be('0xa'));var squel=require('squel');var crypto=require(_0x74be('0xb'));var jsforce=require(_0x74be('0xc'));var deskjs=require(_0x74be('0xd'));var toCsv=require(_0x74be('0x7'));var querystring=require(_0x74be('0xe'));var Papa=require('papaparse');var Redis=require(_0x74be('0xf'));var authService=require(_0x74be('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x74be('0x11'));var hardwareService=require(_0x74be('0x12'));var logger=require('../../config/logger')(_0x74be('0x13'));var utils=require('../../config/utils');var config=require(_0x74be('0x14'));var licenseUtil=require(_0x74be('0x15'));var db=require(_0x74be('0x16'))['db'];config[_0x74be('0x17')]=_[_0x74be('0x18')](config[_0x74be('0x17')],{'host':_0x74be('0x19'),'port':0x18eb});var socket=require(_0x74be('0x1a'))(new Redis(config[_0x74be('0x17')]));require(_0x74be('0x1b'))[_0x74be('0x1c')](socket);function respondWithStatusCode(_0x95cac2,_0x38b2bc){_0x38b2bc=_0x38b2bc||0xcc;return function(_0x2fa293){if(_0x2fa293){return _0x95cac2['sendStatus'](_0x38b2bc);}return _0x95cac2[_0x74be('0x1d')](_0x38b2bc)[_0x74be('0x1e')]();};}function respondWithResult(_0x1343d1,_0x5df9b1){_0x5df9b1=_0x5df9b1||0xc8;return function(_0x166e7d){if(_0x166e7d){return _0x1343d1[_0x74be('0x1d')](_0x5df9b1)[_0x74be('0x1f')](_0x166e7d);}};}function respondWithFilteredResult(_0x23ba2c,_0x4d9708){return function(_0x2689f2){if(_0x2689f2){var _0xd0039d=typeof _0x4d9708[_0x74be('0x20')]===_0x74be('0x21')&&typeof _0x4d9708['limit']===_0x74be('0x21');var _0x4ff4ec=_0x2689f2[_0x74be('0x22')];var _0x45895c=_0xd0039d?0x0:_0x4d9708[_0x74be('0x20')];var _0x517230=_0xd0039d?_0x2689f2[_0x74be('0x22')]:_0x4d9708['offset']+_0x4d9708['limit'];var _0x4ddef0;if(_0x517230>=_0x4ff4ec){_0x517230=_0x4ff4ec;_0x4ddef0=0xc8;}else{_0x4ddef0=0xce;}_0x23ba2c['status'](_0x4ddef0);return _0x23ba2c['set'](_0x74be('0x23'),_0x45895c+'-'+_0x517230+'/'+_0x4ff4ec)[_0x74be('0x1f')](_0x2689f2);}return null;};}function patchUpdates(_0x7c94fb){return function(_0x53144d){try{jsonpatch[_0x74be('0x24')](_0x53144d,_0x7c94fb,!![]);}catch(_0x2a0559){return BPromise[_0x74be('0x25')](_0x2a0559);}return _0x53144d[_0x74be('0x26')]();};}function saveUpdates(_0x12e6cb,_0x454067){return function(_0x19feb7){if(_0x19feb7){return _0x19feb7['update'](_0x12e6cb)[_0x74be('0x27')](function(_0x561721){return _0x561721;});}return null;};}function removeEntity(_0xbafb2f,_0x1e9f4b){return function(_0x3572cb){if(_0x3572cb){return _0x3572cb[_0x74be('0x28')]()[_0x74be('0x27')](function(){var _0xb62762=_0x3572cb[_0x74be('0x29')]({'plain':!![]});var _0x4298ae=_0x74be('0x2a');return db[_0x74be('0x2b')][_0x74be('0x28')]({'where':{'type':_0x4298ae,'resourceId':_0xb62762['id']}})[_0x74be('0x27')](function(){return _0x3572cb;});})[_0x74be('0x27')](function(){_0xbafb2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f30fa,_0x560873){return function(_0x2245ab){if(!_0x2245ab){_0x5f30fa[_0x74be('0x2c')](0x194);}return _0x2245ab;};}function handleError(_0x3e4f3f,_0x3d9c52){_0x3d9c52=_0x3d9c52||0x1f4;return function(_0x56feef){logger[_0x74be('0x2d')](_0x56feef[_0x74be('0x2e')]);if(_0x56feef[_0x74be('0x2f')]){delete _0x56feef[_0x74be('0x2f')];}_0x3e4f3f[_0x74be('0x1d')](_0x3d9c52)[_0x74be('0x30')](_0x56feef);};}exports[_0x74be('0x31')]=function(_0x534d92,_0x14fc4e){var _0x5f5d8f={},_0x53b06b={},_0x2da6c5={'count':0x0,'rows':[]};var _0x17092c=_[_0x74be('0x32')](db[_0x74be('0x33')]['rawAttributes'],function(_0x189398){return{'name':_0x189398[_0x74be('0x34')],'type':_0x189398[_0x74be('0x35')]['key']};});_0x53b06b['model']=_[_0x74be('0x32')](_0x17092c,_0x74be('0x2f'));_0x53b06b[_0x74be('0x36')]=_[_0x74be('0x37')](_0x534d92['query']);_0x53b06b[_0x74be('0x38')]=_[_0x74be('0x39')](_0x53b06b['model'],_0x53b06b[_0x74be('0x36')]);_0x5f5d8f[_0x74be('0x3a')]=_[_0x74be('0x39')](_0x53b06b[_0x74be('0x3b')],qs['fields'](_0x534d92[_0x74be('0x36')][_0x74be('0x3c')]));_0x5f5d8f[_0x74be('0x3a')]=_0x5f5d8f['attributes'][_0x74be('0x3d')]?_0x5f5d8f[_0x74be('0x3a')]:_0x53b06b[_0x74be('0x3b')];if(!_0x534d92[_0x74be('0x36')][_0x74be('0x3e')](_0x74be('0x3f'))){_0x5f5d8f[_0x74be('0x40')]=qs['limit'](_0x534d92[_0x74be('0x36')][_0x74be('0x40')]);_0x5f5d8f['offset']=qs[_0x74be('0x20')](_0x534d92['query'][_0x74be('0x20')]);}_0x5f5d8f['order']=qs[_0x74be('0x41')](_0x534d92[_0x74be('0x36')][_0x74be('0x41')]);_0x5f5d8f[_0x74be('0x42')]=qs[_0x74be('0x38')](_[_0x74be('0x43')](_0x534d92['query'],_0x53b06b['filters']),_0x17092c);if(_0x534d92[_0x74be('0x36')][_0x74be('0x44')]){_0x5f5d8f[_0x74be('0x42')]=_[_0x74be('0x45')](_0x5f5d8f[_0x74be('0x42')],{'$or':_[_0x74be('0x32')](_0x17092c,function(_0x3fbc65){if(_0x3fbc65[_0x74be('0x35')]!==_0x74be('0x46')){var _0xc8f37={};_0xc8f37[_0x3fbc65['name']]={'$like':'%'+_0x534d92[_0x74be('0x36')][_0x74be('0x44')]+'%'};return _0xc8f37;}})});}_0x5f5d8f=_[_0x74be('0x45')]({},_0x5f5d8f,_0x534d92[_0x74be('0x47')]);var _0x4fdabd={'where':_0x5f5d8f[_0x74be('0x42')]};return db['SquareProject'][_0x74be('0x22')](_0x4fdabd)[_0x74be('0x27')](function(_0x4f7aa3){_0x2da6c5['count']=_0x4f7aa3;if(_0x534d92['query']['includeAll']){_0x5f5d8f[_0x74be('0x48')]=[{'all':!![]}];}return db[_0x74be('0x33')][_0x74be('0x49')](_0x5f5d8f);})[_0x74be('0x27')](function(_0x232f67){_0x2da6c5[_0x74be('0x4a')]=_0x232f67;return _0x2da6c5;})[_0x74be('0x27')](respondWithFilteredResult(_0x14fc4e,_0x5f5d8f))[_0x74be('0x4b')](handleError(_0x14fc4e,null));};exports[_0x74be('0x4c')]=function(_0x5b2331,_0x4a42ab){var _0x388368={'raw':![],'where':{'id':_0x5b2331[_0x74be('0x4d')]['id']}},_0x42eb7a={};_0x42eb7a[_0x74be('0x3b')]=_[_0x74be('0x37')](db[_0x74be('0x33')]['rawAttributes']);_0x42eb7a[_0x74be('0x36')]=_[_0x74be('0x37')](_0x5b2331['query']);_0x42eb7a[_0x74be('0x38')]=_[_0x74be('0x39')](_0x42eb7a[_0x74be('0x3b')],_0x42eb7a[_0x74be('0x36')]);_0x388368[_0x74be('0x3a')]=_[_0x74be('0x39')](_0x42eb7a[_0x74be('0x3b')],qs[_0x74be('0x3c')](_0x5b2331[_0x74be('0x36')][_0x74be('0x3c')]));_0x388368[_0x74be('0x3a')]=_0x388368[_0x74be('0x3a')][_0x74be('0x3d')]?_0x388368[_0x74be('0x3a')]:_0x42eb7a[_0x74be('0x3b')];if(_0x5b2331['query'][_0x74be('0x4e')]){_0x388368[_0x74be('0x48')]=[{'all':!![]}];}_0x388368=_[_0x74be('0x45')]({},_0x388368,_0x5b2331[_0x74be('0x47')]);return db[_0x74be('0x33')]['find'](_0x388368)[_0x74be('0x27')](handleEntityNotFound(_0x4a42ab,null))[_0x74be('0x27')](respondWithResult(_0x4a42ab,null))[_0x74be('0x4b')](handleError(_0x4a42ab,null));};exports[_0x74be('0x4f')]=function(_0x5d3682,_0x2bf9e9){return db[_0x74be('0x33')]['create'](_0x5d3682[_0x74be('0x50')],{})['then'](function(_0x5731c1){var _0x55d632=_0x5d3682['user']['get']({'plain':!![]});if(!_0x55d632)throw new Error(_0x74be('0x51'));if(_0x55d632[_0x74be('0x52')]===_0x74be('0x53')){var _0x1dcd0d=_0x5731c1[_0x74be('0x29')]({'plain':!![]});var _0xb6356d=_0x74be('0x2a');return db[_0x74be('0x54')][_0x74be('0x55')]({'where':{'name':_0xb6356d,'userProfileId':_0x55d632[_0x74be('0x56')]},'raw':!![]})[_0x74be('0x27')](function(_0x471fa3){if(_0x471fa3&&_0x471fa3['autoAssociation']===0x0){return db[_0x74be('0x2b')][_0x74be('0x4f')]({'name':_0x1dcd0d[_0x74be('0x2f')],'resourceId':_0x1dcd0d['id'],'type':_0x471fa3[_0x74be('0x2f')],'sectionId':_0x471fa3['id']},{})[_0x74be('0x27')](function(){return _0x5731c1;});}else{return _0x5731c1;}})[_0x74be('0x4b')](function(_0x5dec37){logger[_0x74be('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dec37);throw _0x5dec37;});}return _0x5731c1;})[_0x74be('0x27')](respondWithResult(_0x2bf9e9,0xc9))[_0x74be('0x4b')](handleError(_0x2bf9e9,null));};exports[_0x74be('0x57')]=function(_0x29c963,_0x4a08f5){if(_0x29c963[_0x74be('0x50')]['id']){delete _0x29c963[_0x74be('0x50')]['id'];}return db[_0x74be('0x33')][_0x74be('0x55')]({'where':{'id':_0x29c963[_0x74be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a08f5,null))[_0x74be('0x27')](saveUpdates(_0x29c963[_0x74be('0x50')],null))[_0x74be('0x27')](respondWithResult(_0x4a08f5,null))['catch'](handleError(_0x4a08f5,null));};exports[_0x74be('0x28')]=function(_0x29b8ac,_0x2a80f6){return db[_0x74be('0x33')][_0x74be('0x55')]({'where':{'id':_0x29b8ac[_0x74be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a80f6,null))[_0x74be('0x27')](removeEntity(_0x2a80f6,null))[_0x74be('0x4b')](handleError(_0x2a80f6,null));};exports[_0x74be('0x58')]=function(_0x1f62d2,_0x5bcc0c,_0x1ea867){return db[_0x74be('0x33')][_0x74be('0x55')]({'where':{'id':_0x1f62d2['params']['id']}})[_0x74be('0x27')](handleEntityNotFound(_0x5bcc0c,null))[_0x74be('0x27')](function(_0x4603d7){if(_0x4603d7){return _0x4603d7[_0x74be('0x58')](_0x1f62d2[_0x74be('0x50')][_0x74be('0x59')],_['omit'](_0x1f62d2[_0x74be('0x50')],[_0x74be('0x59'),'id'])||{});}})[_0x74be('0x27')](respondWithResult(_0x5bcc0c,null))[_0x74be('0x4b')](handleError(_0x5bcc0c,null));};exports['removeUsers']=function(_0xe68d15,_0x4c02c4,_0x1d0aaa){return db[_0x74be('0x33')]['find']({'where':{'id':_0xe68d15[_0x74be('0x4d')]['id']}})[_0x74be('0x27')](handleEntityNotFound(_0x4c02c4,null))[_0x74be('0x27')](function(_0x164c32){if(_0x164c32){return _0x164c32['removeUsers'](_0xe68d15[_0x74be('0x36')]['ids'])[_0x74be('0x27')](function(){if(_[_0x74be('0x5a')](_0xe68d15[_0x74be('0x36')]['ids'])){for(var _0x11958d=0x0;_0x11958d<_0xe68d15[_0x74be('0x36')][_0x74be('0x59')][_0x74be('0x3d')];_0x11958d+=0x1){socket[_0x74be('0x5b')](_0x74be('0x5c'),{'UserId':Number(_0xe68d15[_0x74be('0x36')]['ids'][_0x11958d]),'SquareProjectId':Number(_0xe68d15['params']['id'])});}}else{socket[_0x74be('0x5b')](_0x74be('0x5c'),{'UserId':Number(_0xe68d15[_0x74be('0x36')][_0x74be('0x59')]),'SquareProjectId':Number(_0xe68d15[_0x74be('0x4d')]['id'])});}});}})[_0x74be('0x27')](respondWithStatusCode(_0x4c02c4,null))[_0x74be('0x4b')](handleError(_0x4c02c4,null));};exports[_0x74be('0x5d')]=function(_0x2b5cbe,_0x367770,_0x328129){var _0x105783={};var _0x5b1e95={};var _0x3b7e28;var _0x256bf3;return db['SquareProject']['findOne']({'where':{'id':_0x2b5cbe[_0x74be('0x4d')]['id']}})[_0x74be('0x27')](handleEntityNotFound(_0x367770,null))[_0x74be('0x27')](function(_0x3899e0){if(_0x3899e0){_0x3b7e28=_0x3899e0;_0x5b1e95[_0x74be('0x3b')]=_[_0x74be('0x37')](db[_0x74be('0x5e')][_0x74be('0x5f')]);_0x5b1e95[_0x74be('0x36')]=_[_0x74be('0x37')](_0x2b5cbe[_0x74be('0x36')]);_0x5b1e95[_0x74be('0x38')]=_[_0x74be('0x39')](_0x5b1e95[_0x74be('0x3b')],_0x5b1e95['query']);_0x105783[_0x74be('0x3a')]=_['intersection'](_0x5b1e95[_0x74be('0x3b')],qs[_0x74be('0x3c')](_0x2b5cbe['query'][_0x74be('0x3c')]));_0x105783[_0x74be('0x3a')]=_0x105783[_0x74be('0x3a')][_0x74be('0x3d')]?_0x105783[_0x74be('0x3a')]:_0x5b1e95[_0x74be('0x3b')];_0x105783[_0x74be('0x60')]=qs[_0x74be('0x41')](_0x2b5cbe['query']['sort']);_0x105783[_0x74be('0x42')]=qs[_0x74be('0x38')](_['pick'](_0x2b5cbe[_0x74be('0x36')],_0x5b1e95[_0x74be('0x38')]));if(_0x2b5cbe['query']['filter']){_0x105783[_0x74be('0x42')]=_[_0x74be('0x45')](_0x105783[_0x74be('0x42')],{'$or':_[_0x74be('0x32')](_0x105783['attributes'],function(_0x1203b8){var _0x178fe6={};_0x178fe6[_0x1203b8]={'$like':'%'+_0x2b5cbe[_0x74be('0x36')][_0x74be('0x44')]+'%'};return _0x178fe6;})});}_0x105783=_['merge']({},_0x105783,_0x2b5cbe[_0x74be('0x47')]);return _0x3b7e28[_0x74be('0x5d')](_0x105783);}})[_0x74be('0x27')](function(_0x17ad45){if(_0x17ad45){_0x256bf3=_0x17ad45['length'];if(!_0x2b5cbe['query'][_0x74be('0x3e')](_0x74be('0x3f'))){_0x105783['limit']=qs['limit'](_0x2b5cbe[_0x74be('0x36')]['limit']);_0x105783[_0x74be('0x20')]=qs[_0x74be('0x20')](_0x2b5cbe[_0x74be('0x36')][_0x74be('0x20')]);}return _0x3b7e28['getUsers'](_0x105783);}})[_0x74be('0x27')](function(_0x36042b){if(_0x36042b){return _0x36042b?{'count':_0x256bf3,'rows':_0x36042b}:null;}})[_0x74be('0x27')](respondWithResult(_0x367770,null))[_0x74be('0x4b')](handleError(_0x367770,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b9b4c95..5c2e096 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91e3=['emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x91e3,0x68));var _0x391e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x91e3[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x391e('0x0'))['db'][_0x391e('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x391e('0x2')](0x0);var events={'afterCreate':_0x391e('0x3'),'afterUpdate':_0x391e('0x4'),'afterDestroy':_0x391e('0x5')};function emitEvent(_0x3da46a){return function(_0x339419,_0x2c80cc,_0x3432fa){SquareProjectEvents['emit'](_0x3da46a+':'+_0x339419['id'],_0x339419);SquareProjectEvents[_0x391e('0x6')](_0x3da46a,_0x339419);_0x3432fa(null);};}for(var e in events){if(events[_0x391e('0x7')](e)){var event=events[e];SquareProject[_0x391e('0x8')](e,emitEvent(event));}}module[_0x391e('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xd1c9=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x35116d,_0x1ffe00){var _0x2f132a=function(_0x4d6d9e){while(--_0x4d6d9e){_0x35116d['push'](_0x35116d['shift']());}};_0x2f132a(++_0x1ffe00);}(_0xd1c9,0xf0));var _0x9d1c=function(_0x49dd7e,_0x48b1e5){_0x49dd7e=_0x49dd7e-0x0;var _0x4c4f6e=_0xd1c9[_0x49dd7e];return _0x4c4f6e;};'use strict';var EventEmitter=require(_0x9d1c('0x0'));var SquareProject=require(_0x9d1c('0x1'))['db'][_0x9d1c('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9d1c('0x3')](0x0);var events={'afterCreate':_0x9d1c('0x4'),'afterUpdate':_0x9d1c('0x5'),'afterDestroy':_0x9d1c('0x6')};function emitEvent(_0x18df0f){return function(_0x37bd3c,_0xaa0cf7,_0x173a55){SquareProjectEvents['emit'](_0x18df0f+':'+_0x37bd3c['id'],_0x37bd3c);SquareProjectEvents[_0x9d1c('0x7')](_0x18df0f,_0x37bd3c);_0x173a55(null);};}for(var e in events){if(events[_0x9d1c('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x9d1c('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e35bfd5..bbe8141 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc956=['../../config/logger','request-promise','path','rimraf','./squareProject.attributes','define','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc956,0x143));var _0x6c95=function(_0x556b3b,_0x2a712c){_0x556b3b=_0x556b3b-0x0;var _0x14b11c=_0xc956[_0x556b3b];return _0x14b11c;};'use strict';var _=require(_0x6c95('0x0'));var util=require('util');var logger=require(_0x6c95('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c95('0x2'));var fs=require('fs');var path=require(_0x6c95('0x3'));var rimraf=require(_0x6c95('0x4'));var config=require('../../config/environment');var attributes=require(_0x6c95('0x5'));module['exports']=function(_0x1e5e83,_0x36e59c){return _0x1e5e83[_0x6c95('0x6')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5546b5,_0xae566c,_0x4155e4){if(_0x5546b5[_0x6c95('0x7')](_0x6c95('0x8'))){_0x5546b5[_0x6c95('0x9')]=moment()[_0x6c95('0xa')](_0x6c95('0xb'));}if(_0x5546b5[_0x6c95('0x7')]('production')){_0x5546b5['publishedAt']=moment()[_0x6c95('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4155e4(null,_0x5546b5);}}});}; \ No newline at end of file +var _0xae4d=['SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes'];(function(_0xa177d5,_0x34edbc){var _0x591f25=function(_0x32b55f){while(--_0x32b55f){_0xa177d5['push'](_0xa177d5['shift']());}};_0x591f25(++_0x34edbc);}(_0xae4d,0x1ca));var _0xdae4=function(_0x5aa4d9,_0x142938){_0x5aa4d9=_0x5aa4d9-0x0;var _0x430dda=_0xae4d[_0x5aa4d9];return _0x430dda;};'use strict';var _=require(_0xdae4('0x0'));var util=require('util');var logger=require(_0xdae4('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdae4('0x2'));var rp=require(_0xdae4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdae4('0x4'));var config=require(_0xdae4('0x5'));var attributes=require(_0xdae4('0x6'));module['exports']=function(_0x270b98,_0x464d29){return _0x270b98['define'](_0xdae4('0x7'),attributes,{'tableName':_0xdae4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x459caa,_0xb4d2fa,_0x22414b){if(_0x459caa['changed'](_0xdae4('0x9'))){_0x459caa[_0xdae4('0xa')]=moment()[_0xdae4('0xb')](_0xdae4('0xc'));}if(_0x459caa['changed'](_0xdae4('0xd'))){_0x459caa[_0xdae4('0xe')]=moment()[_0xdae4('0xb')](_0xdae4('0xc'));}_0x22414b(null,_0x459caa);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4c042fe..17b43c5 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fb5=['catch','ShowSquareProject','SquareProject','options','where','include','map','model','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','then','SquareProject,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result'];(function(_0x184dae,_0x5e7a29){var _0x3e53fe=function(_0x3b1c9d){while(--_0x3b1c9d){_0x184dae['push'](_0x184dae['shift']());}};_0x3e53fe(++_0x5e7a29);}(_0x1fb5,0xae));var _0x51fb=function(_0x3d9858,_0xde67bb){_0x3d9858=_0x3d9858-0x0;var _0x2eb192=_0x1fb5[_0x3d9858];return _0x2eb192;};'use strict';var _=require('lodash');var util=require(_0x51fb('0x0'));var moment=require(_0x51fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x51fb('0x2'));var fs=require('fs');var Redis=require(_0x51fb('0x3'));var db=require(_0x51fb('0x4'))['db'];var utils=require(_0x51fb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x51fb('0x6'));var client=jayson[_0x51fb('0x7')][_0x51fb('0x8')]({'port':0x232a});config[_0x51fb('0x9')]=_[_0x51fb('0xa')](config[_0x51fb('0x9')],{'host':_0x51fb('0xb'),'port':0x18eb});var socket=require(_0x51fb('0xc'))(new Redis(config['redis']));require(_0x51fb('0xd'))['register'](socket);function respondWithRpcPromise(_0x597f55,_0x320c26,_0x4dbf0f){return new BPromise(function(_0x501a08,_0x3d78e2){return client['request'](_0x597f55,_0x4dbf0f)[_0x51fb('0xe')](function(_0x2c966c){logger['info'](_0x51fb('0xf'),_0x320c26,'request\x20sent');logger[_0x51fb('0x10')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x320c26,'request\x20sent',JSON[_0x51fb('0x11')](_0x2c966c));if(_0x2c966c[_0x51fb('0x12')]){if(_0x2c966c['error'][_0x51fb('0x13')]===0x1f4){logger[_0x51fb('0x12')]('SquareProject,\x20%s,\x20%s',_0x320c26,_0x2c966c['error'][_0x51fb('0x14')]);return _0x3d78e2(_0x2c966c['error'][_0x51fb('0x14')]);}logger[_0x51fb('0x12')]('SquareProject,\x20%s,\x20%s',_0x320c26,_0x2c966c['error'][_0x51fb('0x14')]);return _0x501a08(_0x2c966c[_0x51fb('0x12')]['message']);}else{logger[_0x51fb('0x15')](_0x51fb('0xf'),_0x320c26,_0x51fb('0x16'));_0x501a08(_0x2c966c[_0x51fb('0x17')]['message']);}})[_0x51fb('0x18')](function(_0x3a0236){logger[_0x51fb('0x12')](_0x51fb('0xf'),_0x320c26,_0x3a0236);_0x3d78e2(_0x3a0236);});});}exports[_0x51fb('0x19')]=function(_0x384d93){var _0x3c46d2=this;return new Promise(function(_0x68640c,_0x36484a){return db[_0x51fb('0x1a')]['find']({'raw':_0x384d93[_0x51fb('0x1b')]?_0x384d93[_0x51fb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x384d93[_0x51fb('0x1b')]?_0x384d93[_0x51fb('0x1b')][_0x51fb('0x1c')]||null:null,'attributes':_0x384d93[_0x51fb('0x1b')]?_0x384d93[_0x51fb('0x1b')]['attributes']||null:null,'include':_0x384d93[_0x51fb('0x1b')]?_0x384d93[_0x51fb('0x1b')][_0x51fb('0x1d')]?_[_0x51fb('0x1e')](_0x384d93[_0x51fb('0x1b')]['include'],function(_0x2b23bd){return{'model':db[_0x2b23bd[_0x51fb('0x1f')]],'as':_0x2b23bd['as'],'attributes':_0x2b23bd[_0x51fb('0x20')],'include':_0x2b23bd[_0x51fb('0x1d')]?_['map'](_0x2b23bd[_0x51fb('0x1d')],function(_0x9b842c){return{'model':db[_0x9b842c['model']],'as':_0x9b842c['as'],'attributes':_0x9b842c[_0x51fb('0x20')],'include':_0x9b842c[_0x51fb('0x1d')]?_[_0x51fb('0x1e')](_0x9b842c[_0x51fb('0x1d')],function(_0x1222da){return{'model':db[_0x1222da[_0x51fb('0x1f')]],'as':_0x1222da['as'],'attributes':_0x1222da[_0x51fb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x51fb('0xe')](function(_0x3012e5){logger[_0x51fb('0x15')](_0x51fb('0x19'),_0x384d93);logger[_0x51fb('0x10')](_0x51fb('0x19'),_0x384d93,JSON[_0x51fb('0x11')](_0x3012e5));_0x68640c(_0x3012e5);})[_0x51fb('0x18')](function(_0x5df567){logger[_0x51fb('0x12')](_0x51fb('0x19'),_0x5df567[_0x51fb('0x14')],_0x384d93);_0x36484a(_0x3c46d2[_0x51fb('0x12')](0x1f4,_0x5df567[_0x51fb('0x14')]));});});}; \ No newline at end of file +var _0x622e=['where','include','map','model','attributes','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x622e,0x92));var _0xe622=function(_0x26b9cb,_0x12bc4c){_0x26b9cb=_0x26b9cb-0x0;var _0x3f44e6=_0x622e[_0x26b9cb];return _0x3f44e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe622('0x0'));var BPromise=require(_0xe622('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe622('0x2'));var db=require(_0xe622('0x3'))['db'];var utils=require(_0xe622('0x4'));var logger=require(_0xe622('0x5'))(_0xe622('0x6'));var config=require(_0xe622('0x7'));var jayson=require(_0xe622('0x8'));var client=jayson[_0xe622('0x9')][_0xe622('0xa')]({'port':0x232a});config[_0xe622('0xb')]=_[_0xe622('0xc')](config[_0xe622('0xb')],{'host':_0xe622('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0xe622('0xe')](socket);function respondWithRpcPromise(_0x281ffe,_0x285aba,_0x57f34e){return new BPromise(function(_0xddc60,_0x32eb42){return client[_0xe622('0xf')](_0x281ffe,_0x57f34e)['then'](function(_0x1e64a2){logger[_0xe622('0x10')](_0xe622('0x11'),_0x285aba,_0xe622('0x12'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x285aba,'request\x20sent',JSON['stringify'](_0x1e64a2));if(_0x1e64a2[_0xe622('0x13')]){if(_0x1e64a2[_0xe622('0x13')][_0xe622('0x14')]===0x1f4){logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x1e64a2[_0xe622('0x13')][_0xe622('0x15')]);return _0x32eb42(_0x1e64a2['error'][_0xe622('0x15')]);}logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x1e64a2['error']['message']);return _0xddc60(_0x1e64a2[_0xe622('0x13')][_0xe622('0x15')]);}else{logger[_0xe622('0x10')](_0xe622('0x11'),_0x285aba,_0xe622('0x12'));_0xddc60(_0x1e64a2[_0xe622('0x16')][_0xe622('0x15')]);}})[_0xe622('0x17')](function(_0x398d81){logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x398d81);_0x32eb42(_0x398d81);});});}exports[_0xe622('0x18')]=function(_0x33c69a){var _0x40c84c=this;return new Promise(function(_0x25a80a,_0x3543e1){return db[_0xe622('0x19')][_0xe622('0x1a')]({'raw':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1c')]===undefined?!![]:![]:!![],'where':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1d')]||null:null,'attributes':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')]['attributes']||null:null,'include':_0x33c69a['options']?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1e')]?_[_0xe622('0x1f')](_0x33c69a['options'][_0xe622('0x1e')],function(_0x41378b){return{'model':db[_0x41378b[_0xe622('0x20')]],'as':_0x41378b['as'],'attributes':_0x41378b[_0xe622('0x21')],'include':_0x41378b['include']?_[_0xe622('0x1f')](_0x41378b[_0xe622('0x1e')],function(_0x4d2ac7){return{'model':db[_0x4d2ac7[_0xe622('0x20')]],'as':_0x4d2ac7['as'],'attributes':_0x4d2ac7['attributes'],'include':_0x4d2ac7[_0xe622('0x1e')]?_[_0xe622('0x1f')](_0x4d2ac7[_0xe622('0x1e')],function(_0x4073ca){return{'model':db[_0x4073ca['model']],'as':_0x4073ca['as'],'attributes':_0x4073ca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x323398){logger['info']('ShowSquareProject',_0x33c69a);logger[_0xe622('0x22')](_0xe622('0x18'),_0x33c69a,JSON['stringify'](_0x323398));_0x25a80a(_0x323398);})[_0xe622('0x17')](function(_0x17a3c0){logger[_0xe622('0x13')](_0xe622('0x18'),_0x17a3c0[_0xe622('0x15')],_0x33c69a);_0x3543e1(_0x40c84c[_0xe622('0x13')](0x1f4,_0x17a3c0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0cf3e1b..74b8448 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda08=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xda08,0x153));var _0x8da0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xda08[_0x57b54c];return _0x59cc19;};'use strict';var SquareProjectEvents=require(_0x8da0('0x0'));var events=[_0x8da0('0x1'),_0x8da0('0x2'),_0x8da0('0x3')];function createListener(_0x123817,_0x313b4e){return function(_0x33bf75){_0x313b4e[_0x8da0('0x4')](_0x123817,_0x33bf75);};}function removeListener(_0x54c480,_0x24172e){return function(){SquareProjectEvents[_0x8da0('0x5')](_0x54c480,_0x24172e);};}exports[_0x8da0('0x6')]=function(_0x826ce6){for(var _0x3af4b0=0x0,_0x5525a6=events[_0x8da0('0x7')];_0x3af4b0<_0x5525a6;_0x3af4b0++){var _0x5bb874=events[_0x3af4b0];var _0x1badcc=createListener(_0x8da0('0x8')+_0x5bb874,_0x826ce6);SquareProjectEvents['on'](_0x5bb874,_0x1badcc);}}; \ No newline at end of file +var _0xd5b5=['./squareProject.events','save','emit','removeListener','length','squareProject:'];(function(_0x2ff952,_0x587869){var _0x2f0445=function(_0x3cd3f2){while(--_0x3cd3f2){_0x2ff952['push'](_0x2ff952['shift']());}};_0x2f0445(++_0x587869);}(_0xd5b5,0x1ce));var _0x5d5b=function(_0x5e34f6,_0x85392f){_0x5e34f6=_0x5e34f6-0x0;var _0x21a6b1=_0xd5b5[_0x5e34f6];return _0x21a6b1;};'use strict';var SquareProjectEvents=require(_0x5d5b('0x0'));var events=[_0x5d5b('0x1'),'remove','update'];function createListener(_0x636c3b,_0x15dd98){return function(_0x31b9dd){_0x15dd98[_0x5d5b('0x2')](_0x636c3b,_0x31b9dd);};}function removeListener(_0x1daff4,_0x3b4d0c){return function(){SquareProjectEvents[_0x5d5b('0x3')](_0x1daff4,_0x3b4d0c);};}exports['register']=function(_0x1258bd){for(var _0x557391=0x0,_0x2a9185=events[_0x5d5b('0x4')];_0x557391<_0x2a9185;_0x557391++){var _0x3bf262=events[_0x557391];var _0x41382f=createListener(_0x5d5b('0x5')+_0x3bf262,_0x1258bd);SquareProjectEvents['on'](_0x3bf262,_0x41382f);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index a92f3ab..87484da 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x50e0b5,_0x3f9534){var _0x29a7cb=function(_0x342710){while(--_0x342710){_0x50e0b5['push'](_0x50e0b5['shift']());}};_0x29a7cb(++_0x3f9534);}(_0xabce,0x103));var _0xeabc=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xabce[_0x521929];return _0x632436;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x2e4883,_0x478af3){var _0x4d95e3=function(_0x4b5f70){while(--_0x4b5f70){_0x2e4883['push'](_0x2e4883['shift']());}};_0x4d95e3(++_0x478af3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x5fc3[_0x868b7c];return _0x21683c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a8da710..bb8831c 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['VIRTUAL','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x45e4d6,_0x3eab65){var _0x16f898=function(_0x4f5e98){while(--_0x4f5e98){_0x45e4d6['push'](_0x45e4d6['shift']());}};_0x16f898(++_0x3eab65);}(_0xac9d,0x14d));var _0xdac9=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0xac9d[_0x4b0830];return _0x1f53a7;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'uniqueid':{'type':Sequelize[_0xdac9('0x2')]},'callerid':{'type':Sequelize[_0xdac9('0x2')]},'calleridname':{'type':Sequelize[_0xdac9('0x2')]},'context':{'type':Sequelize[_0xdac9('0x2')]},'extension':{'type':Sequelize[_0xdac9('0x2')]},'priority':{'type':Sequelize[_0xdac9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdac9('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xdac9('0x2')]},'filename':{'type':Sequelize[_0xdac9('0x2')]},'savePath':{'type':Sequelize[_0xdac9('0x2')]},'format':{'type':Sequelize[_0xdac9('0x3')],'get':function(){var _0x1c78c5='';var _0x39f560=this['getDataValue'](_0xdac9('0x4'));if(_0x39f560){_0x1c78c5=_0x39f560['substring'](_0x39f560[_0xdac9('0x5')]('.'));}return _0x1c78c5;}}}; \ No newline at end of file +var _0xd6d6=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x7422fa,_0x3d61b5){var _0xb69488=function(_0x9e58d3){while(--_0x9e58d3){_0x7422fa['push'](_0x7422fa['shift']());}};_0xb69488(++_0x3d61b5);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5e7158,_0x2fe690){_0x5e7158=_0x5e7158-0x0;var _0x3cead3=_0xd6d6[_0x5e7158];return _0x3cead3;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'callerid':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6d6d('0x2')]},'extension':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'dnid':{'type':Sequelize[_0x6d6d('0x2')]},'projectName':{'type':Sequelize[_0x6d6d('0x2')]},'saveName':{'type':Sequelize[_0x6d6d('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x6d6d('0x2')]},'format':{'type':Sequelize[_0x6d6d('0x3')],'get':function(){var _0x44f83d='';var _0x18f824=this[_0x6d6d('0x4')](_0x6d6d('0x5'));if(_0x18f824){_0x44f83d=_0x18f824[_0x6d6d('0x6')](_0x18f824['lastIndexOf']('.'));}return _0x44f83d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4ad7475..83ab7f9 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97ca=['order','sort','where','filter','merge','VIRTUAL','then','show','includeAll','include','options','catch','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','secrets','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','destroy','error','stack','name','send','index','map','SquareRecording','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit'];(function(_0x54c6fd,_0x211650){var _0x249aa7=function(_0x11719a){while(--_0x11719a){_0x54c6fd['push'](_0x54c6fd['shift']());}};_0x249aa7(++_0x211650);}(_0x97ca,0xd2));var _0xa97c=function(_0x3713e2,_0x381fd6){_0x3713e2=_0x3713e2-0x0;var _0x4e81d8=_0x97ca[_0x3713e2];return _0x4e81d8;};'use strict';var emlformat=require(_0xa97c('0x0'));var rimraf=require(_0xa97c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa97c('0x2'));var rp=require(_0xa97c('0x3'));var moment=require(_0xa97c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa97c('0x5'));var util=require('util');var path=require(_0xa97c('0x6'));var sox=require('sox');var csv=require(_0xa97c('0x7'));var ejs=require(_0xa97c('0x8'));var fs=require('fs');var fs_extra=require(_0xa97c('0x9'));var _=require(_0xa97c('0xa'));var squel=require(_0xa97c('0xb'));var crypto=require('crypto');var jsforce=require(_0xa97c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa97c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa97c('0xd'));var authService=require(_0xa97c('0xe'));var qs=require(_0xa97c('0xf'));var as=require(_0xa97c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa97c('0x11'))('api');var utils=require(_0xa97c('0x12'));var config=require(_0xa97c('0x13'));var licenseUtil=require(_0xa97c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46efed,_0x5852e4){_0x5852e4=_0x5852e4||0xcc;return function(_0x3f869e){if(_0x3f869e){return _0x46efed[_0xa97c('0x15')](_0x5852e4);}return _0x46efed[_0xa97c('0x16')](_0x5852e4)[_0xa97c('0x17')]();};}function respondWithResult(_0x582309,_0x153daa){_0x153daa=_0x153daa||0xc8;return function(_0x5a7f1c){if(_0x5a7f1c){return _0x582309['status'](_0x153daa)[_0xa97c('0x18')](_0x5a7f1c);}};}function respondWithFilteredResult(_0x4e9f2b,_0x58c6f5){return function(_0x57400d){if(_0x57400d){var _0x1d83d6=typeof _0x58c6f5[_0xa97c('0x19')]===_0xa97c('0x1a')&&typeof _0x58c6f5['limit']===_0xa97c('0x1a');var _0x112ad9=_0x57400d[_0xa97c('0x1b')];var _0x4548e8=_0x1d83d6?0x0:_0x58c6f5[_0xa97c('0x19')];var _0x52ffb3=_0x1d83d6?_0x57400d[_0xa97c('0x1b')]:_0x58c6f5[_0xa97c('0x19')]+_0x58c6f5[_0xa97c('0x1c')];var _0x4a9855;if(_0x52ffb3>=_0x112ad9){_0x52ffb3=_0x112ad9;_0x4a9855=0xc8;}else{_0x4a9855=0xce;}_0x4e9f2b[_0xa97c('0x16')](_0x4a9855);return _0x4e9f2b[_0xa97c('0x1d')]('Content-Range',_0x4548e8+'-'+_0x52ffb3+'/'+_0x112ad9)['json'](_0x57400d);}return null;};}function patchUpdates(_0x5dbead){return function(_0x406b4f){try{jsonpatch[_0xa97c('0x1e')](_0x406b4f,_0x5dbead,!![]);}catch(_0x33b44b){return BPromise['reject'](_0x33b44b);}return _0x406b4f['save']();};}function saveUpdates(_0x449656,_0x47044){return function(_0x2d6d6c){if(_0x2d6d6c){return _0x2d6d6c[_0xa97c('0x1f')](_0x449656)['then'](function(_0x4d8ca7){return _0x4d8ca7;});}return null;};}function removeEntity(_0x26a464,_0xc8013){return function(_0x4cde7d){if(_0x4cde7d){return _0x4cde7d[_0xa97c('0x20')]()['then'](function(){_0x26a464[_0xa97c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de197,_0xdd244f){return function(_0x240b20){if(!_0x240b20){_0x1de197[_0xa97c('0x15')](0x194);}return _0x240b20;};}function handleError(_0x31f49f,_0x4496a2){_0x4496a2=_0x4496a2||0x1f4;return function(_0x255ac0){logger[_0xa97c('0x21')](_0x255ac0[_0xa97c('0x22')]);if(_0x255ac0[_0xa97c('0x23')]){delete _0x255ac0[_0xa97c('0x23')];}_0x31f49f[_0xa97c('0x16')](_0x4496a2)[_0xa97c('0x24')](_0x255ac0);};}exports[_0xa97c('0x25')]=function(_0x3dcfea,_0x2993e5){var _0x12e039={},_0x1c59ce={},_0x2c2cc2={'count':0x0,'rows':[]};var _0x1765e1=_[_0xa97c('0x26')](db[_0xa97c('0x27')]['rawAttributes'],function(_0x4a8b6c){return{'name':_0x4a8b6c[_0xa97c('0x28')],'type':_0x4a8b6c[_0xa97c('0x29')]['key']};});_0x1c59ce['model']=_['map'](_0x1765e1,_0xa97c('0x23'));_0x1c59ce[_0xa97c('0x2a')]=_[_0xa97c('0x2b')](_0x3dcfea[_0xa97c('0x2a')]);_0x1c59ce[_0xa97c('0x2c')]=_[_0xa97c('0x2d')](_0x1c59ce['model'],_0x1c59ce['query']);_0x12e039['attributes']=_[_0xa97c('0x2d')](_0x1c59ce[_0xa97c('0x2e')],qs[_0xa97c('0x2f')](_0x3dcfea[_0xa97c('0x2a')][_0xa97c('0x2f')]));_0x12e039[_0xa97c('0x30')]=_0x12e039[_0xa97c('0x30')][_0xa97c('0x31')]?_0x12e039[_0xa97c('0x30')]:_0x1c59ce['model'];if(!_0x3dcfea[_0xa97c('0x2a')]['hasOwnProperty'](_0xa97c('0x32'))){_0x12e039['limit']=qs['limit'](_0x3dcfea[_0xa97c('0x2a')][_0xa97c('0x1c')]);_0x12e039[_0xa97c('0x19')]=qs['offset'](_0x3dcfea['query'][_0xa97c('0x19')]);}_0x12e039[_0xa97c('0x33')]=qs[_0xa97c('0x34')](_0x3dcfea[_0xa97c('0x2a')]['sort']);_0x12e039[_0xa97c('0x35')]=qs[_0xa97c('0x2c')](_['pick'](_0x3dcfea[_0xa97c('0x2a')],_0x1c59ce[_0xa97c('0x2c')]),_0x1765e1);if(_0x3dcfea[_0xa97c('0x2a')][_0xa97c('0x36')]){_0x12e039[_0xa97c('0x35')]=_[_0xa97c('0x37')](_0x12e039['where'],{'$or':_[_0xa97c('0x26')](_0x1765e1,function(_0x303058){if(_0x303058[_0xa97c('0x29')]!==_0xa97c('0x38')){var _0x33e4c1={};_0x33e4c1[_0x303058['name']]={'$like':'%'+_0x3dcfea[_0xa97c('0x2a')]['filter']+'%'};return _0x33e4c1;}})});}_0x12e039=_['merge']({},_0x12e039,_0x3dcfea['options']);var _0x4a5ed2={'where':_0x12e039[_0xa97c('0x35')]};return db[_0xa97c('0x27')][_0xa97c('0x1b')](_0x4a5ed2)[_0xa97c('0x39')](function(_0x19de33){_0x2c2cc2[_0xa97c('0x1b')]=_0x19de33;if(_0x3dcfea[_0xa97c('0x2a')]['includeAll']){_0x12e039['include']=[{'all':!![]}];}return db[_0xa97c('0x27')]['findAll'](_0x12e039);})[_0xa97c('0x39')](function(_0x4edcb6){_0x2c2cc2['rows']=_0x4edcb6;return _0x2c2cc2;})[_0xa97c('0x39')](respondWithFilteredResult(_0x2993e5,_0x12e039))['catch'](handleError(_0x2993e5,null));};exports[_0xa97c('0x3a')]=function(_0x362ee1,_0x423006){var _0x506338={'raw':!![],'where':{'id':_0x362ee1['params']['id']}},_0x2e206d={};_0x2e206d[_0xa97c('0x2e')]=_[_0xa97c('0x2b')](db[_0xa97c('0x27')]['rawAttributes']);_0x2e206d[_0xa97c('0x2a')]=_['keys'](_0x362ee1[_0xa97c('0x2a')]);_0x2e206d[_0xa97c('0x2c')]=_[_0xa97c('0x2d')](_0x2e206d[_0xa97c('0x2e')],_0x2e206d['query']);_0x506338[_0xa97c('0x30')]=_['intersection'](_0x2e206d[_0xa97c('0x2e')],qs['fields'](_0x362ee1[_0xa97c('0x2a')][_0xa97c('0x2f')]));_0x506338['attributes']=_0x506338[_0xa97c('0x30')][_0xa97c('0x31')]?_0x506338[_0xa97c('0x30')]:_0x2e206d['model'];if(_0x362ee1['query'][_0xa97c('0x3b')]){_0x506338[_0xa97c('0x3c')]=[{'all':!![]}];}_0x506338=_[_0xa97c('0x37')]({},_0x506338,_0x362ee1[_0xa97c('0x3d')]);return db[_0xa97c('0x27')]['find'](_0x506338)[_0xa97c('0x39')](handleEntityNotFound(_0x423006,null))['then'](respondWithResult(_0x423006,null))[_0xa97c('0x3e')](handleError(_0x423006,null));};exports['create']=function(_0x459ca6,_0x57e92d){return db['SquareRecording'][_0xa97c('0x3f')](_0x459ca6[_0xa97c('0x40')],{})['then'](respondWithResult(_0x57e92d,0xc9))[_0xa97c('0x3e')](handleError(_0x57e92d,null));};exports[_0xa97c('0x1f')]=function(_0x343544,_0x402e0f){if(_0x343544[_0xa97c('0x40')]['id']){delete _0x343544[_0xa97c('0x40')]['id'];}return db[_0xa97c('0x27')]['find']({'where':{'id':_0x343544[_0xa97c('0x41')]['id']}})['then'](handleEntityNotFound(_0x402e0f,null))[_0xa97c('0x39')](saveUpdates(_0x343544[_0xa97c('0x40')],null))['then'](respondWithResult(_0x402e0f,null))['catch'](handleError(_0x402e0f,null));};exports[_0xa97c('0x42')]=function(_0x2c4379,_0x525ecc,_0x861097){var _0x15f76e=require(_0xa97c('0x43'));var _0x2ae5a9=![];var _0x28e74e={};if(_0x2c4379[_0xa97c('0x2a')][_0xa97c('0x29')]&&_0x2c4379['query']['type']===_0xa97c('0x44')){_0x28e74e[_0xa97c('0x44')]=_0x2c4379[_0xa97c('0x41')]['id'];}else{_0x28e74e['id']=_0x2c4379[_0xa97c('0x41')]['id'];}return db['SquareRecording']['find']({'where':_0x28e74e,'attributes':['id',_0xa97c('0x45'),_0xa97c('0x46')],'raw':!![]})[_0xa97c('0x39')](handleEntityNotFound(_0x525ecc,null))[_0xa97c('0x39')](function(_0x1494aa){if(_0x1494aa){var _0x168680=_0x1494aa['savePath'];var _0x421b0f=util['format'](_0xa97c('0x47'),_0x168680);if(fs[_0xa97c('0x48')](_0x421b0f)){_0x2ae5a9=!![];return _0x15f76e['decryptFile'](_0x421b0f,_0x168680,config[_0xa97c('0x49')]['recording'])['then'](function(){return _0x1494aa;});}return _0x1494aa;}})[_0xa97c('0x39')](function(_0x3d80c1){if(_0x3d80c1){var _0xb88986=_0x3d80c1[_0xa97c('0x45')];if(!fs[_0xa97c('0x48')](_0xb88986)){throw new db['Sequelize']['ValidationError'](_0xa97c('0x4a'));}if(_0x3d80c1[_0xa97c('0x46')]){return _0x525ecc[_0xa97c('0x42')](_0xb88986,_0x3d80c1[_0xa97c('0x46')]+path[_0xa97c('0x4b')](_0xb88986),function(){if(_0x2ae5a9){fs[_0xa97c('0x4c')](_0xb88986);}});}else{return _0x525ecc[_0xa97c('0x42')](_0xb88986,function(_0x171b38){if(_0x2ae5a9){fs['unlink'](_0xb88986);}});}}})['catch'](function(_0x5117f0){if(_0x5117f0[_0xa97c('0x4d')]===_0xa97c('0x4a')){_0x525ecc[_0xa97c('0x16')](0x194)[_0xa97c('0x24')](_0xa97c('0x4e'));}else{return handleError(_0x525ecc,null);}});};exports[_0xa97c('0x20')]=function(_0x587bb1,_0x16a081){return db[_0xa97c('0x27')]['find']({'where':{'id':_0x587bb1[_0xa97c('0x41')]['id']}})[_0xa97c('0x39')](function(_0x45fcf0){if(_[_0xa97c('0x4f')](_0x45fcf0)){throw new ReferenceError(_0xa97c('0x50'));}return _0x45fcf0;})[_0xa97c('0x39')](function(_0x2852aa){var _0x1627c7=_0x2852aa[_0xa97c('0x45')];logger[_0xa97c('0x51')](_0xa97c('0x52'),_0x1627c7);if(!_[_0xa97c('0x4f')](_0x2852aa[_0xa97c('0x45')])&&fs[_0xa97c('0x48')](_0x1627c7)){logger[_0xa97c('0x51')](_0xa97c('0x53')+_0x1627c7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x1627c7);}_0x1627c7=_0x1627c7+_0xa97c('0x54');if(!_['isNil'](_0x2852aa[_0xa97c('0x45')])&&fs['existsSync'](_0x1627c7)){logger[_0xa97c('0x51')](_0xa97c('0x53')+_0x1627c7+_0xa97c('0x55'));fs[_0xa97c('0x56')](_0x1627c7);}return _0x2852aa;})['then'](function(_0x459ca3){if(!_0x459ca3)throw new InternalError();return _0x459ca3[_0xa97c('0x20')]();})[_0xa97c('0x39')](function(){_0x16a081['status'](0xcc)[_0xa97c('0x17')]();})[_0xa97c('0x3e')](handleError(_0x16a081,null));}; \ No newline at end of file +var _0xa5b4=['Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','undefined','offset','count','apply','save','update','then','destroy','error','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','findAll','rows','catch','show','rawAttributes','length','find','create','body','download','../../components/encryptor','uniqueid','params','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording'];(function(_0x3efc28,_0x5b82b2){var _0x557f1f=function(_0x9301fe){while(--_0x9301fe){_0x3efc28['push'](_0x3efc28['shift']());}};_0x557f1f(++_0x5b82b2);}(_0xa5b4,0x186));var _0x4a5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5b4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4a5b('0x0'));var jsonpatch=require(_0x4a5b('0x1'));var rp=require('request-promise');var moment=require(_0x4a5b('0x2'));var BPromise=require(_0x4a5b('0x3'));var Mustache=require('mustache');var util=require(_0x4a5b('0x4'));var path=require(_0x4a5b('0x5'));var sox=require('sox');var csv=require(_0x4a5b('0x6'));var ejs=require(_0x4a5b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4a5b('0x8'));var crypto=require(_0x4a5b('0x9'));var jsforce=require(_0x4a5b('0xa'));var deskjs=require(_0x4a5b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a5b('0xc'));var Redis=require(_0x4a5b('0xd'));var authService=require(_0x4a5b('0xe'));var qs=require(_0x4a5b('0xf'));var as=require(_0x4a5b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a5b('0x11'))(_0x4a5b('0x12'));var utils=require(_0x4a5b('0x13'));var config=require(_0x4a5b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a5b('0x15'))['db'];function respondWithStatusCode(_0x139208,_0x354857){_0x354857=_0x354857||0xcc;return function(_0x1412a4){if(_0x1412a4){return _0x139208['sendStatus'](_0x354857);}return _0x139208['status'](_0x354857)[_0x4a5b('0x16')]();};}function respondWithResult(_0x2f2669,_0x1eeed5){_0x1eeed5=_0x1eeed5||0xc8;return function(_0x4787a2){if(_0x4787a2){return _0x2f2669[_0x4a5b('0x17')](_0x1eeed5)[_0x4a5b('0x18')](_0x4787a2);}};}function respondWithFilteredResult(_0x16b4a3,_0x5c8695){return function(_0x45067d){if(_0x45067d){var _0x285238=typeof _0x5c8695['offset']==='undefined'&&typeof _0x5c8695[_0x4a5b('0x19')]===_0x4a5b('0x1a');var _0x4f082a=_0x45067d['count'];var _0xd7fe89=_0x285238?0x0:_0x5c8695[_0x4a5b('0x1b')];var _0x3ae76a=_0x285238?_0x45067d[_0x4a5b('0x1c')]:_0x5c8695[_0x4a5b('0x1b')]+_0x5c8695['limit'];var _0x45e569;if(_0x3ae76a>=_0x4f082a){_0x3ae76a=_0x4f082a;_0x45e569=0xc8;}else{_0x45e569=0xce;}_0x16b4a3[_0x4a5b('0x17')](_0x45e569);return _0x16b4a3['set']('Content-Range',_0xd7fe89+'-'+_0x3ae76a+'/'+_0x4f082a)[_0x4a5b('0x18')](_0x45067d);}return null;};}function patchUpdates(_0x3bb102){return function(_0x520c76){try{jsonpatch[_0x4a5b('0x1d')](_0x520c76,_0x3bb102,!![]);}catch(_0x1270b8){return BPromise['reject'](_0x1270b8);}return _0x520c76[_0x4a5b('0x1e')]();};}function saveUpdates(_0x2f68b8,_0x2edd49){return function(_0x447e74){if(_0x447e74){return _0x447e74[_0x4a5b('0x1f')](_0x2f68b8)[_0x4a5b('0x20')](function(_0x21690c){return _0x21690c;});}return null;};}function removeEntity(_0x2ff905,_0x2b889b){return function(_0x1f7a0f){if(_0x1f7a0f){return _0x1f7a0f[_0x4a5b('0x21')]()['then'](function(){_0x2ff905[_0x4a5b('0x17')](0xcc)[_0x4a5b('0x16')]();});}};}function handleEntityNotFound(_0x2709f7,_0x33ea9a){return function(_0x5a9ba8){if(!_0x5a9ba8){_0x2709f7['sendStatus'](0x194);}return _0x5a9ba8;};}function handleError(_0x2e9cb5,_0x35a5de){_0x35a5de=_0x35a5de||0x1f4;return function(_0x5896c4){logger[_0x4a5b('0x22')](_0x5896c4[_0x4a5b('0x23')]);if(_0x5896c4[_0x4a5b('0x24')]){delete _0x5896c4['name'];}_0x2e9cb5['status'](_0x35a5de)[_0x4a5b('0x25')](_0x5896c4);};}exports['index']=function(_0x4565b3,_0x523374){var _0x26bd52={},_0x54083b={},_0xdf03a3={'count':0x0,'rows':[]};var _0x4c02f1=_[_0x4a5b('0x26')](db['SquareRecording']['rawAttributes'],function(_0x3f85ae){return{'name':_0x3f85ae['fieldName'],'type':_0x3f85ae[_0x4a5b('0x27')][_0x4a5b('0x28')]};});_0x54083b[_0x4a5b('0x29')]=_['map'](_0x4c02f1,_0x4a5b('0x24'));_0x54083b[_0x4a5b('0x2a')]=_[_0x4a5b('0x2b')](_0x4565b3[_0x4a5b('0x2a')]);_0x54083b[_0x4a5b('0x2c')]=_[_0x4a5b('0x2d')](_0x54083b[_0x4a5b('0x29')],_0x54083b[_0x4a5b('0x2a')]);_0x26bd52[_0x4a5b('0x2e')]=_['intersection'](_0x54083b[_0x4a5b('0x29')],qs[_0x4a5b('0x2f')](_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x2f')]));_0x26bd52['attributes']=_0x26bd52[_0x4a5b('0x2e')]['length']?_0x26bd52['attributes']:_0x54083b[_0x4a5b('0x29')];if(!_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x30')](_0x4a5b('0x31'))){_0x26bd52[_0x4a5b('0x19')]=qs[_0x4a5b('0x19')](_0x4565b3[_0x4a5b('0x2a')]['limit']);_0x26bd52['offset']=qs[_0x4a5b('0x1b')](_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x1b')]);}_0x26bd52[_0x4a5b('0x32')]=qs[_0x4a5b('0x33')](_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x33')]);_0x26bd52[_0x4a5b('0x34')]=qs[_0x4a5b('0x2c')](_[_0x4a5b('0x35')](_0x4565b3[_0x4a5b('0x2a')],_0x54083b[_0x4a5b('0x2c')]),_0x4c02f1);if(_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x36')]){_0x26bd52[_0x4a5b('0x34')]=_[_0x4a5b('0x37')](_0x26bd52[_0x4a5b('0x34')],{'$or':_['map'](_0x4c02f1,function(_0x53d6f1){if(_0x53d6f1['type']!==_0x4a5b('0x38')){var _0x528665={};_0x528665[_0x53d6f1[_0x4a5b('0x24')]]={'$like':'%'+_0x4565b3['query'][_0x4a5b('0x36')]+'%'};return _0x528665;}})});}_0x26bd52=_['merge']({},_0x26bd52,_0x4565b3[_0x4a5b('0x39')]);var _0x1a2ba4={'where':_0x26bd52[_0x4a5b('0x34')]};return db[_0x4a5b('0x3a')][_0x4a5b('0x1c')](_0x1a2ba4)[_0x4a5b('0x20')](function(_0x3ed970){_0xdf03a3['count']=_0x3ed970;if(_0x4565b3[_0x4a5b('0x2a')][_0x4a5b('0x3b')]){_0x26bd52['include']=[{'all':!![]}];}return db[_0x4a5b('0x3a')][_0x4a5b('0x3c')](_0x26bd52);})[_0x4a5b('0x20')](function(_0x42726e){_0xdf03a3[_0x4a5b('0x3d')]=_0x42726e;return _0xdf03a3;})['then'](respondWithFilteredResult(_0x523374,_0x26bd52))[_0x4a5b('0x3e')](handleError(_0x523374,null));};exports[_0x4a5b('0x3f')]=function(_0xc211fa,_0x56f8d8){var _0x696377={'raw':!![],'where':{'id':_0xc211fa['params']['id']}},_0x2e90df={};_0x2e90df['model']=_['keys'](db[_0x4a5b('0x3a')][_0x4a5b('0x40')]);_0x2e90df[_0x4a5b('0x2a')]=_[_0x4a5b('0x2b')](_0xc211fa['query']);_0x2e90df['filters']=_[_0x4a5b('0x2d')](_0x2e90df[_0x4a5b('0x29')],_0x2e90df['query']);_0x696377[_0x4a5b('0x2e')]=_[_0x4a5b('0x2d')](_0x2e90df[_0x4a5b('0x29')],qs[_0x4a5b('0x2f')](_0xc211fa[_0x4a5b('0x2a')][_0x4a5b('0x2f')]));_0x696377['attributes']=_0x696377[_0x4a5b('0x2e')][_0x4a5b('0x41')]?_0x696377['attributes']:_0x2e90df[_0x4a5b('0x29')];if(_0xc211fa[_0x4a5b('0x2a')][_0x4a5b('0x3b')]){_0x696377['include']=[{'all':!![]}];}_0x696377=_[_0x4a5b('0x37')]({},_0x696377,_0xc211fa[_0x4a5b('0x39')]);return db[_0x4a5b('0x3a')][_0x4a5b('0x42')](_0x696377)[_0x4a5b('0x20')](handleEntityNotFound(_0x56f8d8,null))[_0x4a5b('0x20')](respondWithResult(_0x56f8d8,null))[_0x4a5b('0x3e')](handleError(_0x56f8d8,null));};exports[_0x4a5b('0x43')]=function(_0x31d418,_0x1111a6){return db[_0x4a5b('0x3a')][_0x4a5b('0x43')](_0x31d418[_0x4a5b('0x44')],{})[_0x4a5b('0x20')](respondWithResult(_0x1111a6,0xc9))[_0x4a5b('0x3e')](handleError(_0x1111a6,null));};exports[_0x4a5b('0x1f')]=function(_0x5d62b0,_0x335eb8){if(_0x5d62b0[_0x4a5b('0x44')]['id']){delete _0x5d62b0[_0x4a5b('0x44')]['id'];}return db[_0x4a5b('0x3a')][_0x4a5b('0x42')]({'where':{'id':_0x5d62b0['params']['id']}})[_0x4a5b('0x20')](handleEntityNotFound(_0x335eb8,null))[_0x4a5b('0x20')](saveUpdates(_0x5d62b0['body'],null))[_0x4a5b('0x20')](respondWithResult(_0x335eb8,null))[_0x4a5b('0x3e')](handleError(_0x335eb8,null));};exports[_0x4a5b('0x45')]=function(_0x4b0fdb,_0x377745,_0x5aa612){var _0x3091c6=require(_0x4a5b('0x46'));var _0x466260=![];var _0x210f52={};if(_0x4b0fdb[_0x4a5b('0x2a')]['type']&&_0x4b0fdb[_0x4a5b('0x2a')][_0x4a5b('0x27')]===_0x4a5b('0x47')){_0x210f52[_0x4a5b('0x47')]=_0x4b0fdb[_0x4a5b('0x48')]['id'];}else{_0x210f52['id']=_0x4b0fdb[_0x4a5b('0x48')]['id'];}return db['SquareRecording'][_0x4a5b('0x42')]({'where':_0x210f52,'attributes':['id',_0x4a5b('0x49'),'filename'],'raw':!![]})[_0x4a5b('0x20')](handleEntityNotFound(_0x377745,null))['then'](function(_0x15fdf5){if(_0x15fdf5){var _0x23bc88=_0x15fdf5['savePath'];var _0xad2abf=util[_0x4a5b('0x4a')](_0x4a5b('0x4b'),_0x23bc88);if(fs[_0x4a5b('0x4c')](_0xad2abf)){_0x466260=!![];return _0x3091c6[_0x4a5b('0x4d')](_0xad2abf,_0x23bc88,config[_0x4a5b('0x4e')][_0x4a5b('0x4f')])[_0x4a5b('0x20')](function(){return _0x15fdf5;});}return _0x15fdf5;}})[_0x4a5b('0x20')](function(_0x31c8ca){if(_0x31c8ca){var _0x49e49d=_0x31c8ca[_0x4a5b('0x49')];if(!fs[_0x4a5b('0x4c')](_0x49e49d)){throw new db[(_0x4a5b('0x50'))][(_0x4a5b('0x51'))](_0x4a5b('0x52'));}if(_0x31c8ca[_0x4a5b('0x53')]){return _0x377745[_0x4a5b('0x45')](_0x49e49d,_0x31c8ca[_0x4a5b('0x53')]+path[_0x4a5b('0x54')](_0x49e49d),function(){if(_0x466260){fs['unlink'](_0x49e49d);}});}else{return _0x377745[_0x4a5b('0x45')](_0x49e49d,function(_0x544a63){if(_0x466260){fs[_0x4a5b('0x55')](_0x49e49d);}});}}})['catch'](function(_0x4726e8){if(_0x4726e8[_0x4a5b('0x56')]==='SquareRecording\x20not\x20found'){_0x377745[_0x4a5b('0x17')](0x194)[_0x4a5b('0x25')](_0x4a5b('0x57'));}else{return handleError(_0x377745,null);}});};exports[_0x4a5b('0x21')]=function(_0x5dde24,_0x8fdab4){return db[_0x4a5b('0x3a')][_0x4a5b('0x42')]({'where':{'id':_0x5dde24[_0x4a5b('0x48')]['id']}})[_0x4a5b('0x20')](function(_0x3f99dd){if(_[_0x4a5b('0x58')](_0x3f99dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3f99dd;})[_0x4a5b('0x20')](function(_0x2388af){var _0x4e4992=_0x2388af[_0x4a5b('0x49')];logger[_0x4a5b('0x59')](_0x4a5b('0x5a'),_0x4e4992);if(!_[_0x4a5b('0x58')](_0x2388af[_0x4a5b('0x49')])&&fs[_0x4a5b('0x4c')](_0x4e4992)){logger[_0x4a5b('0x59')]('File:\x20\x22'+_0x4e4992+_0x4a5b('0x5b'));fs[_0x4a5b('0x5c')](_0x4e4992);}_0x4e4992=_0x4e4992+'.cypher';if(!_[_0x4a5b('0x58')](_0x2388af['savePath'])&&fs[_0x4a5b('0x4c')](_0x4e4992)){logger[_0x4a5b('0x59')](_0x4a5b('0x5d')+_0x4e4992+_0x4a5b('0x5b'));fs['unlinkSync'](_0x4e4992);}return _0x2388af;})[_0x4a5b('0x20')](function(_0x47d2b9){if(!_0x47d2b9)throw new InternalError();return _0x47d2b9['destroy']();})[_0x4a5b('0x20')](function(){_0x8fdab4['status'](0xcc)[_0x4a5b('0x16')]();})[_0x4a5b('0x3e')](handleError(_0x8fdab4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f7a12e2..79050b0 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9120=['exports','define','SquareRecording','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0xce2019,_0x10e434){var _0x53f9d5=function(_0x248977){while(--_0x248977){_0xce2019['push'](_0xce2019['shift']());}};_0x53f9d5(++_0x10e434);}(_0x9120,0x1b3));var _0x0912=function(_0x3c9b20,_0x142c9e){_0x3c9b20=_0x3c9b20-0x0;var _0x629d1d=_0x9120[_0x3c9b20];return _0x629d1d;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var logger=require(_0x0912('0x2'))(_0x0912('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0912('0x4'));var fs=require('fs');var path=require(_0x0912('0x5'));var rimraf=require(_0x0912('0x6'));var config=require(_0x0912('0x7'));var attributes=require(_0x0912('0x8'));module[_0x0912('0x9')]=function(_0x4e7ddb,_0x42cb02){return _0x4e7ddb[_0x0912('0xa')](_0x0912('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa76e=['SquareRecording','square_recordings','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0xa76e,0xfe));var _0xea76=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xa76e[_0x1602ef];return _0x5870ee;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var logger=require(_0xea76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xea76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea76('0x3'));var rimraf=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var attributes=require('./squareRecording.attributes');module[_0xea76('0x6')]=function(_0x48ff4f,_0x337097){return _0x48ff4f['define'](_0xea76('0x7'),attributes,{'tableName':_0xea76('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6504064..11bfb93 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2372=['options','raw','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','body'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x2372,0x8a));var _0x2237=function(_0x59e26c,_0x225c23){_0x59e26c=_0x59e26c-0x0;var _0x5881af=_0x2372[_0x59e26c];return _0x5881af;};'use strict';var _=require('lodash');var util=require(_0x2237('0x0'));var moment=require(_0x2237('0x1'));var BPromise=require(_0x2237('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2237('0x3'));var db=require(_0x2237('0x4'))['db'];var utils=require(_0x2237('0x5'));var logger=require('../../config/logger')(_0x2237('0x6'));var config=require(_0x2237('0x7'));var jayson=require(_0x2237('0x8'));var client=jayson['client'][_0x2237('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23c570,_0x73449,_0x29759e){return new BPromise(function(_0x14c97b,_0x736831){return client['request'](_0x23c570,_0x29759e)[_0x2237('0xa')](function(_0x32fc52){logger[_0x2237('0xb')](_0x2237('0xc'),_0x73449,_0x2237('0xd'));logger[_0x2237('0xe')](_0x2237('0xf'),_0x73449,_0x2237('0xd'),JSON[_0x2237('0x10')](_0x32fc52));if(_0x32fc52[_0x2237('0x11')]){if(_0x32fc52[_0x2237('0x11')][_0x2237('0x12')]===0x1f4){logger['error'](_0x2237('0xc'),_0x73449,_0x32fc52[_0x2237('0x11')][_0x2237('0x13')]);return _0x736831(_0x32fc52['error'][_0x2237('0x13')]);}logger[_0x2237('0x11')](_0x2237('0xc'),_0x73449,_0x32fc52[_0x2237('0x11')][_0x2237('0x13')]);return _0x14c97b(_0x32fc52[_0x2237('0x11')][_0x2237('0x13')]);}else{logger[_0x2237('0xb')](_0x2237('0xc'),_0x73449,_0x2237('0xd'));_0x14c97b(_0x32fc52[_0x2237('0x14')][_0x2237('0x13')]);}})['catch'](function(_0x598ead){logger[_0x2237('0x11')](_0x2237('0xc'),_0x73449,_0x598ead);_0x736831(_0x598ead);});});}exports[_0x2237('0x15')]=function(_0x1501e4){var _0x2d14cf=this;return new Promise(function(_0x38cf41,_0x20abba){return db[_0x2237('0x16')]['create'](_0x1501e4[_0x2237('0x17')],{'raw':_0x1501e4[_0x2237('0x18')]?_0x1501e4[_0x2237('0x18')][_0x2237('0x19')]===undefined?!![]:![]:!![]})[_0x2237('0xa')](function(_0xb8321d){logger[_0x2237('0xb')]('CreateSquareRecording',_0x1501e4);logger[_0x2237('0xe')](_0x2237('0x15'),_0x1501e4,JSON['stringify'](_0xb8321d));_0x38cf41(_0xb8321d);})[_0x2237('0x1a')](function(_0x5d5f32){logger[_0x2237('0x11')]('CreateSquareRecording',_0x5d5f32[_0x2237('0x13')],_0x1501e4);_0x20abba(_0x2d14cf[_0x2237('0x11')](0x1f4,_0x5d5f32[_0x2237('0x13')]));});});}; \ No newline at end of file +var _0x3c9b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','moment','bluebird','randomstring'];(function(_0x14f8a8,_0x3da499){var _0x5ed0d8=function(_0x5a4930){while(--_0x5a4930){_0x14f8a8['push'](_0x14f8a8['shift']());}};_0x5ed0d8(++_0x3da499);}(_0x3c9b,0xf9));var _0xb3c9=function(_0x435c3c,_0x23fef5){_0x435c3c=_0x435c3c-0x0;var _0x149f69=_0x3c9b[_0x435c3c];return _0x149f69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb3c9('0x0'));var BPromise=require(_0xb3c9('0x1'));var rs=require(_0xb3c9('0x2'));var fs=require('fs');var Redis=require(_0xb3c9('0x3'));var db=require(_0xb3c9('0x4'))['db'];var utils=require(_0xb3c9('0x5'));var logger=require(_0xb3c9('0x6'))(_0xb3c9('0x7'));var config=require(_0xb3c9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3c9('0x9')][_0xb3c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x796e8c,_0x3e297e,_0x33ccfb){return new BPromise(function(_0x1d92b5,_0x4a7ae1){return client[_0xb3c9('0xb')](_0x796e8c,_0x33ccfb)[_0xb3c9('0xc')](function(_0x12dae0){logger[_0xb3c9('0xd')](_0xb3c9('0xe'),_0x3e297e,'request\x20sent');logger[_0xb3c9('0xf')](_0xb3c9('0x10'),_0x3e297e,'request\x20sent',JSON[_0xb3c9('0x11')](_0x12dae0));if(_0x12dae0[_0xb3c9('0x12')]){if(_0x12dae0['error']['code']===0x1f4){logger[_0xb3c9('0x12')]('SquareRecording,\x20%s,\x20%s',_0x3e297e,_0x12dae0['error'][_0xb3c9('0x13')]);return _0x4a7ae1(_0x12dae0[_0xb3c9('0x12')][_0xb3c9('0x13')]);}logger['error'](_0xb3c9('0xe'),_0x3e297e,_0x12dae0[_0xb3c9('0x12')][_0xb3c9('0x13')]);return _0x1d92b5(_0x12dae0[_0xb3c9('0x12')][_0xb3c9('0x13')]);}else{logger[_0xb3c9('0xd')](_0xb3c9('0xe'),_0x3e297e,_0xb3c9('0x14'));_0x1d92b5(_0x12dae0['result'][_0xb3c9('0x13')]);}})[_0xb3c9('0x15')](function(_0xd6079b){logger[_0xb3c9('0x12')](_0xb3c9('0xe'),_0x3e297e,_0xd6079b);_0x4a7ae1(_0xd6079b);});});}exports[_0xb3c9('0x16')]=function(_0x138633){var _0x31217a=this;return new Promise(function(_0x4b3102,_0x37b198){return db[_0xb3c9('0x17')][_0xb3c9('0x18')](_0x138633[_0xb3c9('0x19')],{'raw':_0x138633[_0xb3c9('0x1a')]?_0x138633['options'][_0xb3c9('0x1b')]===undefined?!![]:![]:!![]})[_0xb3c9('0xc')](function(_0x35ce01){logger[_0xb3c9('0xd')]('CreateSquareRecording',_0x138633);logger['debug'](_0xb3c9('0x16'),_0x138633,JSON[_0xb3c9('0x11')](_0x35ce01));_0x4b3102(_0x35ce01);})[_0xb3c9('0x15')](function(_0x4e6ca8){logger[_0xb3c9('0x12')]('CreateSquareRecording',_0x4e6ca8[_0xb3c9('0x13')],_0x138633);_0x37b198(_0x31217a[_0xb3c9('0x12')](0x1f4,_0x4e6ca8[_0xb3c9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 52183d1..bf5b87f 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x498067,_0x2c0c3c){var _0x25235c=function(_0x4a4edf){while(--_0x4a4edf){_0x498067['push'](_0x498067['shift']());}};_0x25235c(++_0x2c0c3c);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x137aa6,_0xc9ad62){var _0x24cb82=function(_0x278fcd){while(--_0x278fcd){_0x137aa6['push'](_0x137aa6['shift']());}};_0x24cb82(++_0xc9ad62);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 82a810d..a0b05db 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x076a=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x3a75b4,_0x368417){var _0x24f5cc=function(_0x336994){while(--_0x336994){_0x3a75b4['push'](_0x3a75b4['shift']());}};_0x24f5cc(++_0x368417);}(_0x076a,0x1ac));var _0xa076=function(_0x5edbac,_0xa54f78){_0x5edbac=_0x5edbac-0x0;var _0x2a5b78=_0x076a[_0x5edbac];return _0x2a5b78;};'use strict';var Sequelize=require(_0xa076('0x0'));module[_0xa076('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xa076('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa076('0x2')]},'language':{'type':Sequelize[_0xa076('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa076('0x2')]},'version':{'type':Sequelize[_0xa076('0x2')]},'callerid':{'type':Sequelize[_0xa076('0x2')]},'calleridname':{'type':Sequelize[_0xa076('0x2')]},'callingpres':{'type':Sequelize[_0xa076('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xa076('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xa076('0x2')]},'rdnis':{'type':Sequelize[_0xa076('0x2')]},'context':{'type':Sequelize[_0xa076('0x2')]},'extension':{'type':Sequelize[_0xa076('0x2')]},'priority':{'type':Sequelize[_0xa076('0x2')]},'enhanced':{'type':Sequelize[_0xa076('0x2')]},'accountcode':{'type':Sequelize[_0xa076('0x2')]},'threadid':{'type':Sequelize[_0xa076('0x2')]},'project_name':{'type':Sequelize[_0xa076('0x2')]},'joinAt':{'type':Sequelize[_0xa076('0x3')]},'leaveAt':{'type':Sequelize[_0xa076('0x3')]},'bot':{'type':Sequelize[_0xa076('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5794=['DATE','exports','STRING'];(function(_0x455b04,_0x4863bc){var _0x47fa65=function(_0x41f761){while(--_0x41f761){_0x455b04['push'](_0x455b04['shift']());}};_0x47fa65(++_0x4863bc);}(_0x5794,0x196));var _0x4579=function(_0x56160b,_0x32847d){_0x56160b=_0x56160b-0x0;var _0x2358c0=_0x5794[_0x56160b];return _0x2358c0;};'use strict';var Sequelize=require('sequelize');module[_0x4579('0x0')]={'network':{'type':Sequelize[_0x4579('0x1')]},'network_script':{'type':Sequelize[_0x4579('0x1')]},'request':{'type':Sequelize[_0x4579('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x4579('0x1')]},'callerid':{'type':Sequelize[_0x4579('0x1')]},'calleridname':{'type':Sequelize[_0x4579('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x4579('0x1')]},'callington':{'type':Sequelize[_0x4579('0x1')]},'callingtns':{'type':Sequelize[_0x4579('0x1')]},'dnid':{'type':Sequelize[_0x4579('0x1')]},'rdnis':{'type':Sequelize[_0x4579('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4579('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x4579('0x1')]},'accountcode':{'type':Sequelize[_0x4579('0x1')]},'threadid':{'type':Sequelize[_0x4579('0x1')]},'project_name':{'type':Sequelize[_0x4579('0x1')]},'joinAt':{'type':Sequelize[_0x4579('0x2')]},'leaveAt':{'type':Sequelize[_0x4579('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 334f796..df007c0 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2319=['attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','map','SquareReport','fieldName','type','model','name','query','keys','filters','intersection'];(function(_0x48aa26,_0x5a960b){var _0x2c4792=function(_0xd08a47){while(--_0xd08a47){_0x48aa26['push'](_0x48aa26['shift']());}};_0x2c4792(++_0x5a960b);}(_0x2319,0xfc));var _0x9231=function(_0x38c31e,_0x19b8e0){_0x38c31e=_0x38c31e-0x0;var _0x53a2d9=_0x2319[_0x38c31e];return _0x53a2d9;};'use strict';var emlformat=require(_0x9231('0x0'));var rimraf=require(_0x9231('0x1'));var zipdir=require(_0x9231('0x2'));var jsonpatch=require(_0x9231('0x3'));var rp=require(_0x9231('0x4'));var moment=require('moment');var BPromise=require(_0x9231('0x5'));var Mustache=require(_0x9231('0x6'));var util=require(_0x9231('0x7'));var path=require('path');var sox=require(_0x9231('0x8'));var csv=require(_0x9231('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9231('0xa'));var _=require(_0x9231('0xb'));var squel=require(_0x9231('0xc'));var crypto=require(_0x9231('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9231('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9231('0xf'));var Papa=require(_0x9231('0x10'));var Redis=require(_0x9231('0x11'));var authService=require(_0x9231('0x12'));var qs=require(_0x9231('0x13'));var as=require(_0x9231('0x14'));var hardwareService=require(_0x9231('0x15'));var logger=require(_0x9231('0x16'))(_0x9231('0x17'));var utils=require(_0x9231('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9231('0x19'));var db=require(_0x9231('0x1a'))['db'];function respondWithStatusCode(_0x15526a,_0x11a89b){_0x11a89b=_0x11a89b||0xcc;return function(_0x1c4fbf){if(_0x1c4fbf){return _0x15526a['sendStatus'](_0x11a89b);}return _0x15526a[_0x9231('0x1b')](_0x11a89b)[_0x9231('0x1c')]();};}function respondWithResult(_0x5db111,_0x1d1d54){_0x1d1d54=_0x1d1d54||0xc8;return function(_0x33116b){if(_0x33116b){return _0x5db111[_0x9231('0x1b')](_0x1d1d54)[_0x9231('0x1d')](_0x33116b);}};}function respondWithFilteredResult(_0x447773,_0x4d37d5){return function(_0x15df39){if(_0x15df39){var _0x1a728b=typeof _0x4d37d5[_0x9231('0x1e')]===_0x9231('0x1f')&&typeof _0x4d37d5['limit']===_0x9231('0x1f');var _0x53448e=_0x15df39[_0x9231('0x20')];var _0x318ec3=_0x1a728b?0x0:_0x4d37d5['offset'];var _0x29deef=_0x1a728b?_0x15df39[_0x9231('0x20')]:_0x4d37d5[_0x9231('0x1e')]+_0x4d37d5[_0x9231('0x21')];var _0x1bfe9a;if(_0x29deef>=_0x53448e){_0x29deef=_0x53448e;_0x1bfe9a=0xc8;}else{_0x1bfe9a=0xce;}_0x447773[_0x9231('0x1b')](_0x1bfe9a);return _0x447773[_0x9231('0x22')](_0x9231('0x23'),_0x318ec3+'-'+_0x29deef+'/'+_0x53448e)[_0x9231('0x1d')](_0x15df39);}return null;};}function patchUpdates(_0x303ac6){return function(_0x515b71){try{jsonpatch[_0x9231('0x24')](_0x515b71,_0x303ac6,!![]);}catch(_0x4c1401){return BPromise[_0x9231('0x25')](_0x4c1401);}return _0x515b71[_0x9231('0x26')]();};}function saveUpdates(_0x2107b5,_0x5e7047){return function(_0x372adf){if(_0x372adf){return _0x372adf[_0x9231('0x27')](_0x2107b5)[_0x9231('0x28')](function(_0x54262f){return _0x54262f;});}return null;};}function removeEntity(_0x5ec9cc,_0x2b4d6c){return function(_0x8f957){if(_0x8f957){return _0x8f957[_0x9231('0x29')]()[_0x9231('0x28')](function(){_0x5ec9cc[_0x9231('0x1b')](0xcc)[_0x9231('0x1c')]();});}};}function handleEntityNotFound(_0x444518,_0x4a206a){return function(_0x42b0fe){if(!_0x42b0fe){_0x444518[_0x9231('0x2a')](0x194);}return _0x42b0fe;};}function handleError(_0xe9bad7,_0x53c2a7){_0x53c2a7=_0x53c2a7||0x1f4;return function(_0x3b31c3){logger[_0x9231('0x2b')](_0x3b31c3[_0x9231('0x2c')]);if(_0x3b31c3['name']){delete _0x3b31c3['name'];}_0xe9bad7[_0x9231('0x1b')](_0x53c2a7)['send'](_0x3b31c3);};}exports[_0x9231('0x2d')]=function(_0x52789c,_0x497161){var _0x3a429c={},_0x4916eb={},_0x22a1fc={'count':0x0,'rows':[]};var _0x45b498=_[_0x9231('0x2e')](db[_0x9231('0x2f')]['rawAttributes'],function(_0x34e367){return{'name':_0x34e367[_0x9231('0x30')],'type':_0x34e367[_0x9231('0x31')]['key']};});_0x4916eb[_0x9231('0x32')]=_[_0x9231('0x2e')](_0x45b498,_0x9231('0x33'));_0x4916eb[_0x9231('0x34')]=_[_0x9231('0x35')](_0x52789c[_0x9231('0x34')]);_0x4916eb[_0x9231('0x36')]=_[_0x9231('0x37')](_0x4916eb[_0x9231('0x32')],_0x4916eb[_0x9231('0x34')]);_0x3a429c[_0x9231('0x38')]=_['intersection'](_0x4916eb[_0x9231('0x32')],qs[_0x9231('0x39')](_0x52789c[_0x9231('0x34')][_0x9231('0x39')]));_0x3a429c['attributes']=_0x3a429c[_0x9231('0x38')][_0x9231('0x3a')]?_0x3a429c[_0x9231('0x38')]:_0x4916eb[_0x9231('0x32')];if(!_0x52789c['query'][_0x9231('0x3b')]('nolimit')){_0x3a429c[_0x9231('0x21')]=qs['limit'](_0x52789c[_0x9231('0x34')][_0x9231('0x21')]);_0x3a429c[_0x9231('0x1e')]=qs['offset'](_0x52789c[_0x9231('0x34')][_0x9231('0x1e')]);}_0x3a429c[_0x9231('0x3c')]=qs[_0x9231('0x3d')](_0x52789c[_0x9231('0x34')][_0x9231('0x3d')]);_0x3a429c[_0x9231('0x3e')]=qs[_0x9231('0x36')](_['pick'](_0x52789c['query'],_0x4916eb[_0x9231('0x36')]),_0x45b498);if(_0x52789c['query'][_0x9231('0x3f')]){_0x3a429c[_0x9231('0x3e')]=_['merge'](_0x3a429c[_0x9231('0x3e')],{'$or':_[_0x9231('0x2e')](_0x45b498,function(_0x8f3cdb){if(_0x8f3cdb[_0x9231('0x31')]!==_0x9231('0x40')){var _0x3fd6cf={};_0x3fd6cf[_0x8f3cdb['name']]={'$like':'%'+_0x52789c[_0x9231('0x34')]['filter']+'%'};return _0x3fd6cf;}})});}_0x3a429c=_[_0x9231('0x41')]({},_0x3a429c,_0x52789c['options']);var _0x64fde={'where':_0x3a429c[_0x9231('0x3e')]};return db[_0x9231('0x2f')][_0x9231('0x20')](_0x64fde)['then'](function(_0x53621b){_0x22a1fc[_0x9231('0x20')]=_0x53621b;if(_0x52789c['query']['includeAll']){_0x3a429c[_0x9231('0x42')]=[{'all':!![]}];}return db[_0x9231('0x2f')][_0x9231('0x43')](_0x3a429c);})[_0x9231('0x28')](function(_0x3f01a9){_0x22a1fc[_0x9231('0x44')]=_0x3f01a9;return _0x22a1fc;})[_0x9231('0x28')](respondWithFilteredResult(_0x497161,_0x3a429c))[_0x9231('0x45')](handleError(_0x497161,null));};exports[_0x9231('0x46')]=function(_0x5ed7eb,_0x1c59e8){var _0x5e5540={'raw':!![],'where':{'id':_0x5ed7eb[_0x9231('0x47')]['id']}},_0x8c0972={};_0x8c0972[_0x9231('0x32')]=_[_0x9231('0x35')](db[_0x9231('0x2f')][_0x9231('0x48')]);_0x8c0972[_0x9231('0x34')]=_[_0x9231('0x35')](_0x5ed7eb[_0x9231('0x34')]);_0x8c0972[_0x9231('0x36')]=_[_0x9231('0x37')](_0x8c0972[_0x9231('0x32')],_0x8c0972[_0x9231('0x34')]);_0x5e5540[_0x9231('0x38')]=_['intersection'](_0x8c0972[_0x9231('0x32')],qs[_0x9231('0x39')](_0x5ed7eb[_0x9231('0x34')][_0x9231('0x39')]));_0x5e5540[_0x9231('0x38')]=_0x5e5540[_0x9231('0x38')][_0x9231('0x3a')]?_0x5e5540[_0x9231('0x38')]:_0x8c0972['model'];if(_0x5ed7eb[_0x9231('0x34')][_0x9231('0x49')]){_0x5e5540['include']=[{'all':!![]}];}_0x5e5540=_[_0x9231('0x41')]({},_0x5e5540,_0x5ed7eb['options']);return db['SquareReport'][_0x9231('0x4a')](_0x5e5540)[_0x9231('0x28')](handleEntityNotFound(_0x1c59e8,null))[_0x9231('0x28')](respondWithResult(_0x1c59e8,null))[_0x9231('0x45')](handleError(_0x1c59e8,null));};exports['create']=function(_0x95dc26,_0x4ec170){return db[_0x9231('0x2f')]['create'](_0x95dc26[_0x9231('0x4b')],{})[_0x9231('0x28')](respondWithResult(_0x4ec170,0xc9))['catch'](handleError(_0x4ec170,null));};exports[_0x9231('0x27')]=function(_0xb7fcf5,_0x149bb6){if(_0xb7fcf5['body']['id']){delete _0xb7fcf5['body']['id'];}return db[_0x9231('0x2f')][_0x9231('0x4a')]({'where':{'id':_0xb7fcf5['params']['id']}})[_0x9231('0x28')](handleEntityNotFound(_0x149bb6,null))['then'](saveUpdates(_0xb7fcf5[_0x9231('0x4b')],null))[_0x9231('0x28')](respondWithResult(_0x149bb6,null))[_0x9231('0x45')](handleError(_0x149bb6,null));};exports[_0x9231('0x29')]=function(_0x200e80,_0x456093){return db[_0x9231('0x2f')][_0x9231('0x4a')]({'where':{'id':_0x200e80[_0x9231('0x47')]['id']}})[_0x9231('0x28')](handleEntityNotFound(_0x456093,null))[_0x9231('0x28')](removeEntity(_0x456093,null))['catch'](handleError(_0x456093,null));};exports['describe']=function(_0x2be9a4,_0x186e09){return db[_0x9231('0x2f')][_0x9231('0x4c')]()[_0x9231('0x28')](respondWithResult(_0x186e09,null))['catch'](handleError(_0x186e09,null));}; \ No newline at end of file +var _0x6ddd=['offset','undefined','count','limit','set','Content-Range','apply','destroy','then','end','stack','name','send','map','SquareReport','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options','find','create','body','update','describe','zip-dir','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json'];(function(_0x2c892f,_0x4b04e8){var _0x26f129=function(_0x2d365b){while(--_0x2d365b){_0x2c892f['push'](_0x2c892f['shift']());}};_0x26f129(++_0x4b04e8);}(_0x6ddd,0x1b9));var _0xd6dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6ddd[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd6dd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6dd('0x1'));var BPromise=require(_0xd6dd('0x2'));var Mustache=require(_0xd6dd('0x3'));var util=require('util');var path=require(_0xd6dd('0x4'));var sox=require(_0xd6dd('0x5'));var csv=require(_0xd6dd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd6dd('0x7'));var crypto=require(_0xd6dd('0x8'));var jsforce=require(_0xd6dd('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd6dd('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd6dd('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xd6dd('0xb'));var as=require(_0xd6dd('0xc'));var hardwareService=require(_0xd6dd('0xd'));var logger=require(_0xd6dd('0xe'))(_0xd6dd('0xf'));var utils=require(_0xd6dd('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xd6dd('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2efd93,_0x127795){_0x127795=_0x127795||0xcc;return function(_0x104a3f){if(_0x104a3f){return _0x2efd93[_0xd6dd('0x12')](_0x127795);}return _0x2efd93['status'](_0x127795)['end']();};}function respondWithResult(_0x21b16a,_0x2321b9){_0x2321b9=_0x2321b9||0xc8;return function(_0x1382e5){if(_0x1382e5){return _0x21b16a[_0xd6dd('0x13')](_0x2321b9)[_0xd6dd('0x14')](_0x1382e5);}};}function respondWithFilteredResult(_0x1b03c4,_0x57d789){return function(_0x28ef0b){if(_0x28ef0b){var _0x7ee514=typeof _0x57d789[_0xd6dd('0x15')]==='undefined'&&typeof _0x57d789['limit']===_0xd6dd('0x16');var _0x25d1b9=_0x28ef0b[_0xd6dd('0x17')];var _0x55eb95=_0x7ee514?0x0:_0x57d789[_0xd6dd('0x15')];var _0x1909cf=_0x7ee514?_0x28ef0b[_0xd6dd('0x17')]:_0x57d789['offset']+_0x57d789[_0xd6dd('0x18')];var _0x4f28ec;if(_0x1909cf>=_0x25d1b9){_0x1909cf=_0x25d1b9;_0x4f28ec=0xc8;}else{_0x4f28ec=0xce;}_0x1b03c4[_0xd6dd('0x13')](_0x4f28ec);return _0x1b03c4[_0xd6dd('0x19')](_0xd6dd('0x1a'),_0x55eb95+'-'+_0x1909cf+'/'+_0x25d1b9)[_0xd6dd('0x14')](_0x28ef0b);}return null;};}function patchUpdates(_0x1e6ae4){return function(_0x4ac210){try{jsonpatch[_0xd6dd('0x1b')](_0x4ac210,_0x1e6ae4,!![]);}catch(_0xf53947){return BPromise['reject'](_0xf53947);}return _0x4ac210['save']();};}function saveUpdates(_0x4cfec8,_0x524fcb){return function(_0xb3b43){if(_0xb3b43){return _0xb3b43['update'](_0x4cfec8)['then'](function(_0x550fa4){return _0x550fa4;});}return null;};}function removeEntity(_0xefa032,_0xdc31a){return function(_0x51ca4b){if(_0x51ca4b){return _0x51ca4b[_0xd6dd('0x1c')]()[_0xd6dd('0x1d')](function(){_0xefa032['status'](0xcc)[_0xd6dd('0x1e')]();});}};}function handleEntityNotFound(_0x4e6c0,_0xa478c3){return function(_0x200172){if(!_0x200172){_0x4e6c0[_0xd6dd('0x12')](0x194);}return _0x200172;};}function handleError(_0x427582,_0x52e7b2){_0x52e7b2=_0x52e7b2||0x1f4;return function(_0x3693e8){logger['error'](_0x3693e8[_0xd6dd('0x1f')]);if(_0x3693e8[_0xd6dd('0x20')]){delete _0x3693e8['name'];}_0x427582['status'](_0x52e7b2)[_0xd6dd('0x21')](_0x3693e8);};}exports['index']=function(_0x15219b,_0x196700){var _0xa29f93={},_0x321256={},_0x2080f3={'count':0x0,'rows':[]};var _0x4c0a0a=_[_0xd6dd('0x22')](db[_0xd6dd('0x23')]['rawAttributes'],function(_0x61dd9f){return{'name':_0x61dd9f[_0xd6dd('0x24')],'type':_0x61dd9f['type'][_0xd6dd('0x25')]};});_0x321256[_0xd6dd('0x26')]=_['map'](_0x4c0a0a,_0xd6dd('0x20'));_0x321256[_0xd6dd('0x27')]=_['keys'](_0x15219b['query']);_0x321256[_0xd6dd('0x28')]=_[_0xd6dd('0x29')](_0x321256[_0xd6dd('0x26')],_0x321256[_0xd6dd('0x27')]);_0xa29f93[_0xd6dd('0x2a')]=_[_0xd6dd('0x29')](_0x321256[_0xd6dd('0x26')],qs[_0xd6dd('0x2b')](_0x15219b[_0xd6dd('0x27')][_0xd6dd('0x2b')]));_0xa29f93['attributes']=_0xa29f93[_0xd6dd('0x2a')]['length']?_0xa29f93[_0xd6dd('0x2a')]:_0x321256[_0xd6dd('0x26')];if(!_0x15219b[_0xd6dd('0x27')]['hasOwnProperty'](_0xd6dd('0x2c'))){_0xa29f93['limit']=qs[_0xd6dd('0x18')](_0x15219b[_0xd6dd('0x27')][_0xd6dd('0x18')]);_0xa29f93[_0xd6dd('0x15')]=qs[_0xd6dd('0x15')](_0x15219b['query'][_0xd6dd('0x15')]);}_0xa29f93['order']=qs[_0xd6dd('0x2d')](_0x15219b['query']['sort']);_0xa29f93[_0xd6dd('0x2e')]=qs[_0xd6dd('0x28')](_[_0xd6dd('0x2f')](_0x15219b[_0xd6dd('0x27')],_0x321256[_0xd6dd('0x28')]),_0x4c0a0a);if(_0x15219b[_0xd6dd('0x27')]['filter']){_0xa29f93[_0xd6dd('0x2e')]=_[_0xd6dd('0x30')](_0xa29f93[_0xd6dd('0x2e')],{'$or':_['map'](_0x4c0a0a,function(_0x610b1){if(_0x610b1[_0xd6dd('0x31')]!==_0xd6dd('0x32')){var _0x538f22={};_0x538f22[_0x610b1[_0xd6dd('0x20')]]={'$like':'%'+_0x15219b[_0xd6dd('0x27')]['filter']+'%'};return _0x538f22;}})});}_0xa29f93=_[_0xd6dd('0x30')]({},_0xa29f93,_0x15219b['options']);var _0x495f12={'where':_0xa29f93[_0xd6dd('0x2e')]};return db['SquareReport']['count'](_0x495f12)[_0xd6dd('0x1d')](function(_0x4090e8){_0x2080f3[_0xd6dd('0x17')]=_0x4090e8;if(_0x15219b['query'][_0xd6dd('0x33')]){_0xa29f93[_0xd6dd('0x34')]=[{'all':!![]}];}return db[_0xd6dd('0x23')][_0xd6dd('0x35')](_0xa29f93);})[_0xd6dd('0x1d')](function(_0x287fee){_0x2080f3[_0xd6dd('0x36')]=_0x287fee;return _0x2080f3;})[_0xd6dd('0x1d')](respondWithFilteredResult(_0x196700,_0xa29f93))[_0xd6dd('0x37')](handleError(_0x196700,null));};exports['show']=function(_0x137002,_0x1e6491){var _0x55fa95={'raw':!![],'where':{'id':_0x137002[_0xd6dd('0x38')]['id']}},_0x45d634={};_0x45d634[_0xd6dd('0x26')]=_[_0xd6dd('0x39')](db[_0xd6dd('0x23')][_0xd6dd('0x3a')]);_0x45d634[_0xd6dd('0x27')]=_[_0xd6dd('0x39')](_0x137002[_0xd6dd('0x27')]);_0x45d634['filters']=_['intersection'](_0x45d634[_0xd6dd('0x26')],_0x45d634[_0xd6dd('0x27')]);_0x55fa95['attributes']=_['intersection'](_0x45d634[_0xd6dd('0x26')],qs[_0xd6dd('0x2b')](_0x137002[_0xd6dd('0x27')][_0xd6dd('0x2b')]));_0x55fa95['attributes']=_0x55fa95[_0xd6dd('0x2a')][_0xd6dd('0x3b')]?_0x55fa95['attributes']:_0x45d634[_0xd6dd('0x26')];if(_0x137002[_0xd6dd('0x27')]['includeAll']){_0x55fa95[_0xd6dd('0x34')]=[{'all':!![]}];}_0x55fa95=_[_0xd6dd('0x30')]({},_0x55fa95,_0x137002[_0xd6dd('0x3c')]);return db[_0xd6dd('0x23')][_0xd6dd('0x3d')](_0x55fa95)[_0xd6dd('0x1d')](handleEntityNotFound(_0x1e6491,null))[_0xd6dd('0x1d')](respondWithResult(_0x1e6491,null))[_0xd6dd('0x37')](handleError(_0x1e6491,null));};exports[_0xd6dd('0x3e')]=function(_0x4ae471,_0x41c9fe){return db[_0xd6dd('0x23')][_0xd6dd('0x3e')](_0x4ae471[_0xd6dd('0x3f')],{})['then'](respondWithResult(_0x41c9fe,0xc9))['catch'](handleError(_0x41c9fe,null));};exports[_0xd6dd('0x40')]=function(_0x269820,_0x42f231){if(_0x269820['body']['id']){delete _0x269820['body']['id'];}return db[_0xd6dd('0x23')]['find']({'where':{'id':_0x269820[_0xd6dd('0x38')]['id']}})[_0xd6dd('0x1d')](handleEntityNotFound(_0x42f231,null))['then'](saveUpdates(_0x269820[_0xd6dd('0x3f')],null))['then'](respondWithResult(_0x42f231,null))[_0xd6dd('0x37')](handleError(_0x42f231,null));};exports[_0xd6dd('0x1c')]=function(_0xc2732e,_0x12a054){return db[_0xd6dd('0x23')][_0xd6dd('0x3d')]({'where':{'id':_0xc2732e['params']['id']}})[_0xd6dd('0x1d')](handleEntityNotFound(_0x12a054,null))[_0xd6dd('0x1d')](removeEntity(_0x12a054,null))[_0xd6dd('0x37')](handleError(_0x12a054,null));};exports[_0xd6dd('0x41')]=function(_0x16904a,_0x1ede96){return db['SquareReport'][_0xd6dd('0x41')]()[_0xd6dd('0x1d')](respondWithResult(_0x1ede96,null))[_0xd6dd('0x37')](handleError(_0x1ede96,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1f71170..f0f745b 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ab5=['path','rimraf','./squareReport.attributes','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','api','moment','bluebird'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8ab5,0x7e));var _0x58ab=function(_0x52a99e,_0x389c47){_0x52a99e=_0x52a99e-0x0;var _0x46f0d3=_0x8ab5[_0x52a99e];return _0x46f0d3;};'use strict';var _=require(_0x58ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x58ab('0x1'));var moment=require(_0x58ab('0x2'));var BPromise=require(_0x58ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ab('0x4'));var rimraf=require(_0x58ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x58ab('0x6'));module['exports']=function(_0x2d7055,_0x2853e9){return _0x2d7055[_0x58ab('0x7')]('SquareReport',attributes,{'tableName':_0x58ab('0x8'),'paranoid':![],'indexes':[{'name':_0x58ab('0x9'),'fields':[_0x58ab('0xa'),_0x58ab('0xb')]},{'name':_0x58ab('0xc'),'fields':[_0x58ab('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafb9=['report_square','uniqueid','leaveAt','lodash','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x43ba8b,_0x1867f2){var _0x2aa53d=function(_0x3e6da6){while(--_0x3e6da6){_0x43ba8b['push'](_0x43ba8b['shift']());}};_0x2aa53d(++_0x1867f2);}(_0xafb9,0xf3));var _0x9afb=function(_0x415ff8,_0x8ad351){_0x415ff8=_0x415ff8-0x0;var _0x13230c=_0xafb9[_0x415ff8];return _0x13230c;};'use strict';var _=require(_0x9afb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9afb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9afb('0x2'));var fs=require('fs');var path=require(_0x9afb('0x3'));var rimraf=require(_0x9afb('0x4'));var config=require(_0x9afb('0x5'));var attributes=require('./squareReport.attributes');module[_0x9afb('0x6')]=function(_0x142e96,_0x2edb99){return _0x142e96['define']('SquareReport',attributes,{'tableName':_0x9afb('0x7'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x9afb('0x8'),'project_name']},{'name':_0x9afb('0x9'),'fields':[_0x9afb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index a3aea0b..9759316 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1532=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','SquareReport','body','options','raw','CreateSquareReport','debug','UpdateSquareReport','update','where','attributes','limit','stringify','lodash','moment','bluebird'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x1532,0x1d9));var _0x2153=function(_0x533461,_0x864bd1){_0x533461=_0x533461-0x0;var _0x1f0eb4=_0x1532[_0x533461];return _0x1f0eb4;};'use strict';var _=require(_0x2153('0x0'));var util=require('util');var moment=require(_0x2153('0x1'));var BPromise=require(_0x2153('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2153('0x3'));var db=require(_0x2153('0x4'))['db'];var utils=require(_0x2153('0x5'));var logger=require(_0x2153('0x6'))('rpc');var config=require(_0x2153('0x7'));var jayson=require(_0x2153('0x8'));var client=jayson[_0x2153('0x9')][_0x2153('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3bb6,_0x3975cd,_0x1e15d9){return new BPromise(function(_0x18ac5d,_0x38c023){return client[_0x2153('0xb')](_0x3c3bb6,_0x1e15d9)[_0x2153('0xc')](function(_0xe35a32){logger[_0x2153('0xd')](_0x2153('0xe'),_0x3975cd,'request\x20sent');logger['debug'](_0x2153('0xf'),_0x3975cd,'request\x20sent',JSON['stringify'](_0xe35a32));if(_0xe35a32[_0x2153('0x10')]){if(_0xe35a32[_0x2153('0x10')][_0x2153('0x11')]===0x1f4){logger[_0x2153('0x10')](_0x2153('0xe'),_0x3975cd,_0xe35a32[_0x2153('0x10')]['message']);return _0x38c023(_0xe35a32[_0x2153('0x10')][_0x2153('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x3975cd,_0xe35a32['error']['message']);return _0x18ac5d(_0xe35a32['error'][_0x2153('0x12')]);}else{logger['info'](_0x2153('0xe'),_0x3975cd,_0x2153('0x13'));_0x18ac5d(_0xe35a32[_0x2153('0x14')][_0x2153('0x12')]);}})[_0x2153('0x15')](function(_0x3dbad4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3975cd,_0x3dbad4);_0x38c023(_0x3dbad4);});});}exports['CreateSquareReport']=function(_0xa40c1b){var _0x3537ce=this;return new Promise(function(_0x5b2342,_0x175cac){return db[_0x2153('0x16')]['create'](_0xa40c1b[_0x2153('0x17')],{'raw':_0xa40c1b[_0x2153('0x18')]?_0xa40c1b['options'][_0x2153('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x7a67ba){logger[_0x2153('0xd')](_0x2153('0x1a'),_0xa40c1b);logger[_0x2153('0x1b')](_0x2153('0x1a'),_0xa40c1b,JSON['stringify'](_0x7a67ba));_0x5b2342(_0x7a67ba);})['catch'](function(_0x2b2d4f){logger['error'](_0x2153('0x1a'),_0x2b2d4f[_0x2153('0x12')],_0xa40c1b);_0x175cac(_0x3537ce[_0x2153('0x10')](0x1f4,_0x2b2d4f['message']));});});};exports[_0x2153('0x1c')]=function(_0xa2bdd0){var _0x208bac=this;return new Promise(function(_0x39fcba,_0x12f47a){return db[_0x2153('0x16')][_0x2153('0x1d')](_0xa2bdd0[_0x2153('0x17')],{'raw':_0xa2bdd0[_0x2153('0x18')]?_0xa2bdd0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa2bdd0[_0x2153('0x18')]?_0xa2bdd0['options'][_0x2153('0x1e')]||null:null,'attributes':_0xa2bdd0['options']?_0xa2bdd0[_0x2153('0x18')][_0x2153('0x1f')]||null:null,'limit':_0xa2bdd0['options']?_0xa2bdd0[_0x2153('0x18')][_0x2153('0x20')]||null:null})[_0x2153('0xc')](function(_0x22fcdb){logger[_0x2153('0xd')](_0x2153('0x1c'),_0xa2bdd0);logger['debug'](_0x2153('0x1c'),_0xa2bdd0,JSON[_0x2153('0x21')](_0x22fcdb));_0x39fcba(_0x22fcdb);})['catch'](function(_0x5430a0){logger['error']('UpdateSquareReport',_0x5430a0[_0x2153('0x12')],_0xa2bdd0);_0x12f47a(_0x208bac[_0x2153('0x10')](0x1f4,_0x5430a0['message']));});});}; \ No newline at end of file +var _0x67d9=['request\x20sent','result','CreateSquareReport','body','options','then','debug','catch','UpdateSquareReport','SquareReport','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message'];(function(_0x4f683f,_0x1a5286){var _0x281191=function(_0x1287f6){while(--_0x1287f6){_0x4f683f['push'](_0x4f683f['shift']());}};_0x281191(++_0x1a5286);}(_0x67d9,0x140));var _0x967d=function(_0x479181,_0x2c30c1){_0x479181=_0x479181-0x0;var _0x2227ba=_0x67d9[_0x479181];return _0x2227ba;};'use strict';var _=require('lodash');var util=require(_0x967d('0x0'));var moment=require(_0x967d('0x1'));var BPromise=require(_0x967d('0x2'));var rs=require(_0x967d('0x3'));var fs=require('fs');var Redis=require(_0x967d('0x4'));var db=require(_0x967d('0x5'))['db'];var utils=require(_0x967d('0x6'));var logger=require(_0x967d('0x7'))('rpc');var config=require(_0x967d('0x8'));var jayson=require(_0x967d('0x9'));var client=jayson[_0x967d('0xa')][_0x967d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48330b,_0x285510,_0x3c60b7){return new BPromise(function(_0x368532,_0x37435c){return client[_0x967d('0xc')](_0x48330b,_0x3c60b7)['then'](function(_0x5bba07){logger[_0x967d('0xd')]('SquareReport,\x20%s,\x20%s',_0x285510,'request\x20sent');logger['debug'](_0x967d('0xe'),_0x285510,'request\x20sent',JSON[_0x967d('0xf')](_0x5bba07));if(_0x5bba07[_0x967d('0x10')]){if(_0x5bba07[_0x967d('0x10')][_0x967d('0x11')]===0x1f4){logger[_0x967d('0x10')](_0x967d('0x12'),_0x285510,_0x5bba07[_0x967d('0x10')][_0x967d('0x13')]);return _0x37435c(_0x5bba07[_0x967d('0x10')][_0x967d('0x13')]);}logger['error'](_0x967d('0x12'),_0x285510,_0x5bba07[_0x967d('0x10')]['message']);return _0x368532(_0x5bba07[_0x967d('0x10')][_0x967d('0x13')]);}else{logger[_0x967d('0xd')](_0x967d('0x12'),_0x285510,_0x967d('0x14'));_0x368532(_0x5bba07[_0x967d('0x15')][_0x967d('0x13')]);}})['catch'](function(_0x36649b){logger[_0x967d('0x10')]('SquareReport,\x20%s,\x20%s',_0x285510,_0x36649b);_0x37435c(_0x36649b);});});}exports[_0x967d('0x16')]=function(_0x5239f8){var _0x3a914f=this;return new Promise(function(_0x3fd163,_0x5cce51){return db['SquareReport']['create'](_0x5239f8[_0x967d('0x17')],{'raw':_0x5239f8[_0x967d('0x18')]?_0x5239f8[_0x967d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x967d('0x19')](function(_0x8414f5){logger[_0x967d('0xd')](_0x967d('0x16'),_0x5239f8);logger[_0x967d('0x1a')](_0x967d('0x16'),_0x5239f8,JSON[_0x967d('0xf')](_0x8414f5));_0x3fd163(_0x8414f5);})[_0x967d('0x1b')](function(_0x36f14f){logger['error'](_0x967d('0x16'),_0x36f14f['message'],_0x5239f8);_0x5cce51(_0x3a914f[_0x967d('0x10')](0x1f4,_0x36f14f['message']));});});};exports[_0x967d('0x1c')]=function(_0x2294ba){var _0x23c5c2=this;return new Promise(function(_0x23355d,_0x312cf9){return db[_0x967d('0x1d')]['update'](_0x2294ba['body'],{'raw':_0x2294ba[_0x967d('0x18')]?_0x2294ba[_0x967d('0x18')][_0x967d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2294ba['options']?_0x2294ba[_0x967d('0x18')][_0x967d('0x1f')]||null:null,'attributes':_0x2294ba[_0x967d('0x18')]?_0x2294ba[_0x967d('0x18')][_0x967d('0x20')]||null:null,'limit':_0x2294ba[_0x967d('0x18')]?_0x2294ba[_0x967d('0x18')][_0x967d('0x21')]||null:null})[_0x967d('0x19')](function(_0xdcfa6d){logger['info'](_0x967d('0x1c'),_0x2294ba);logger[_0x967d('0x1a')](_0x967d('0x1c'),_0x2294ba,JSON[_0x967d('0xf')](_0xdcfa6d));_0x23355d(_0xdcfa6d);})[_0x967d('0x1b')](function(_0x2d6443){logger[_0x967d('0x10')](_0x967d('0x1c'),_0x2d6443[_0x967d('0x13')],_0x2294ba);_0x312cf9(_0x23c5c2[_0x967d('0x10')](0x1f4,_0x2d6443['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 2e98b5c..1b77b28 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d3=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x373bc2,_0x33eecf){var _0x16a2c3=function(_0x27582c){while(--_0x27582c){_0x373bc2['push'](_0x373bc2['shift']());}};_0x16a2c3(++_0x33eecf);}(_0x01d3,0x102));var _0x301d=function(_0x165a48,_0x44bc9d){_0x165a48=_0x165a48-0x0;var _0x6f6735=_0x01d3[_0x165a48];return _0x6f6735;};'use strict';var multer=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var path=require(_0x301d('0x2'));var timeout=require(_0x301d('0x3'));var express=require(_0x301d('0x4'));var router=express[_0x301d('0x5')]();var fs_extra=require(_0x301d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x301d('0x7'));var config=require(_0x301d('0x8'));var controller=require(_0x301d('0x9'));router[_0x301d('0xa')]('/',auth[_0x301d('0xb')](),controller['index']);router[_0x301d('0xa')](_0x301d('0xc'),auth[_0x301d('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x301d('0xd')]);router[_0x301d('0xe')]('/',auth['isAuthenticated'](),controller[_0x301d('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x301d('0x10')]);router[_0x301d('0x11')]('/:id',auth[_0x301d('0xb')](),controller[_0x301d('0x12')]);module[_0x301d('0x13')]=router; \ No newline at end of file +var _0xbf55=['isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x1dc422,_0x379f18){var _0x299f0a=function(_0x45c38b){while(--_0x45c38b){_0x1dc422['push'](_0x1dc422['shift']());}};_0x299f0a(++_0x379f18);}(_0xbf55,0x1c3));var _0x5bf5=function(_0x1fadb3,_0x6907c0){_0x1fadb3=_0x1fadb3-0x0;var _0x409edc=_0xbf55[_0x1fadb3];return _0x409edc;};'use strict';var multer=require(_0x5bf5('0x0'));var util=require(_0x5bf5('0x1'));var path=require(_0x5bf5('0x2'));var timeout=require(_0x5bf5('0x3'));var express=require(_0x5bf5('0x4'));var router=express[_0x5bf5('0x5')]();var fs_extra=require(_0x5bf5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bf5('0x7'));var config=require(_0x5bf5('0x8'));var controller=require(_0x5bf5('0x9'));router[_0x5bf5('0xa')]('/',auth[_0x5bf5('0xb')](),controller[_0x5bf5('0xc')]);router['get'](_0x5bf5('0xd'),auth[_0x5bf5('0xb')](),controller[_0x5bf5('0xe')]);router[_0x5bf5('0xa')]('/:id',auth[_0x5bf5('0xb')](),controller[_0x5bf5('0xf')]);router['post']('/',auth[_0x5bf5('0xb')](),controller[_0x5bf5('0x10')]);router[_0x5bf5('0x11')](_0x5bf5('0x12'),auth[_0x5bf5('0xb')](),controller[_0x5bf5('0x13')]);router[_0x5bf5('0x14')](_0x5bf5('0x12'),auth['isAuthenticated'](),controller[_0x5bf5('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f7d6b19..4df0d7e 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79e3=['TEXT','exports','STRING'];(function(_0x423283,_0x46784c){var _0x526901=function(_0x5ac1f8){while(--_0x5ac1f8){_0x423283['push'](_0x423283['shift']());}};_0x526901(++_0x46784c);}(_0x79e3,0x157));var _0x379e=function(_0xc0f243,_0x3d31b3){_0xc0f243=_0xc0f243-0x0;var _0x11f600=_0x79e3[_0xc0f243];return _0x11f600;};'use strict';var Sequelize=require('sequelize');module[_0x379e('0x0')]={'uniqueid':{'type':Sequelize[_0x379e('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x379e('0x1')]},'data':{'type':Sequelize[_0x379e('0x2')]},'project_name':{'type':Sequelize[_0x379e('0x1')]},'callerid':{'type':Sequelize[_0x379e('0x1')]}}; \ No newline at end of file +var _0x2516=['exports','STRING','TEXT','sequelize'];(function(_0x2175f8,_0x3a3794){var _0x1038ae=function(_0x511a02){while(--_0x511a02){_0x2175f8['push'](_0x2175f8['shift']());}};_0x1038ae(++_0x3a3794);}(_0x2516,0x16f));var _0x6251=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x2516[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x6251('0x0'));module[_0x6251('0x1')]={'uniqueid':{'type':Sequelize[_0x6251('0x2')]},'node':{'type':Sequelize[_0x6251('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6251('0x3')]},'project_name':{'type':Sequelize[_0x6251('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 706481e..0cca3f4 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc77d=['mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3ad871,_0x269610){var _0xcce5c5=function(_0x4d0133){while(--_0x4d0133){_0x3ad871['push'](_0x3ad871['shift']());}};_0xcce5c5(++_0x269610);}(_0xc77d,0xe9));var _0xdc77=function(_0x398310,_0x26fd34){_0x398310=_0x398310-0x0;var _0x384b56=_0xc77d[_0x398310];return _0x384b56;};'use strict';var emlformat=require(_0xdc77('0x0'));var rimraf=require(_0xdc77('0x1'));var zipdir=require(_0xdc77('0x2'));var jsonpatch=require(_0xdc77('0x3'));var rp=require(_0xdc77('0x4'));var moment=require(_0xdc77('0x5'));var BPromise=require(_0xdc77('0x6'));var Mustache=require(_0xdc77('0x7'));var util=require(_0xdc77('0x8'));var path=require('path');var sox=require(_0xdc77('0x9'));var csv=require(_0xdc77('0xa'));var ejs=require(_0xdc77('0xb'));var fs=require('fs');var fs_extra=require(_0xdc77('0xc'));var _=require('lodash');var squel=require(_0xdc77('0xd'));var crypto=require(_0xdc77('0xe'));var jsforce=require(_0xdc77('0xf'));var deskjs=require(_0xdc77('0x10'));var toCsv=require(_0xdc77('0xa'));var querystring=require(_0xdc77('0x11'));var Papa=require('papaparse');var Redis=require(_0xdc77('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdc77('0x13'));var as=require(_0xdc77('0x14'));var hardwareService=require(_0xdc77('0x15'));var logger=require(_0xdc77('0x16'))(_0xdc77('0x17'));var utils=require(_0xdc77('0x18'));var config=require(_0xdc77('0x19'));var licenseUtil=require(_0xdc77('0x1a'));var db=require(_0xdc77('0x1b'))['db'];function respondWithStatusCode(_0x444ea6,_0x2ee2e2){_0x2ee2e2=_0x2ee2e2||0xcc;return function(_0x3a07a1){if(_0x3a07a1){return _0x444ea6['sendStatus'](_0x2ee2e2);}return _0x444ea6['status'](_0x2ee2e2)['end']();};}function respondWithResult(_0x3e7958,_0x535a58){_0x535a58=_0x535a58||0xc8;return function(_0x1bb22a){if(_0x1bb22a){return _0x3e7958[_0xdc77('0x1c')](_0x535a58)[_0xdc77('0x1d')](_0x1bb22a);}};}function respondWithFilteredResult(_0x122002,_0x42f27e){return function(_0x54b556){if(_0x54b556){var _0x5c3a50=typeof _0x42f27e[_0xdc77('0x1e')]==='undefined'&&typeof _0x42f27e[_0xdc77('0x1f')]===_0xdc77('0x20');var _0x494fce=_0x54b556[_0xdc77('0x21')];var _0x301a5c=_0x5c3a50?0x0:_0x42f27e[_0xdc77('0x1e')];var _0x5391fa=_0x5c3a50?_0x54b556['count']:_0x42f27e[_0xdc77('0x1e')]+_0x42f27e['limit'];var _0x47a4bf;if(_0x5391fa>=_0x494fce){_0x5391fa=_0x494fce;_0x47a4bf=0xc8;}else{_0x47a4bf=0xce;}_0x122002[_0xdc77('0x1c')](_0x47a4bf);return _0x122002[_0xdc77('0x22')](_0xdc77('0x23'),_0x301a5c+'-'+_0x5391fa+'/'+_0x494fce)['json'](_0x54b556);}return null;};}function patchUpdates(_0x5279a7){return function(_0x1e32db){try{jsonpatch[_0xdc77('0x24')](_0x1e32db,_0x5279a7,!![]);}catch(_0x557021){return BPromise[_0xdc77('0x25')](_0x557021);}return _0x1e32db[_0xdc77('0x26')]();};}function saveUpdates(_0x2a4a84,_0x149489){return function(_0x3744a0){if(_0x3744a0){return _0x3744a0[_0xdc77('0x27')](_0x2a4a84)['then'](function(_0x1abd29){return _0x1abd29;});}return null;};}function removeEntity(_0x236949,_0x2f673b){return function(_0x4ce7fe){if(_0x4ce7fe){return _0x4ce7fe['destroy']()[_0xdc77('0x28')](function(){_0x236949[_0xdc77('0x1c')](0xcc)[_0xdc77('0x29')]();});}};}function handleEntityNotFound(_0x950349,_0x50a66d){return function(_0x18da2b){if(!_0x18da2b){_0x950349[_0xdc77('0x2a')](0x194);}return _0x18da2b;};}function handleError(_0x4751f9,_0x5a1b3d){_0x5a1b3d=_0x5a1b3d||0x1f4;return function(_0x55b4d8){logger['error'](_0x55b4d8['stack']);if(_0x55b4d8[_0xdc77('0x2b')]){delete _0x55b4d8[_0xdc77('0x2b')];}_0x4751f9[_0xdc77('0x1c')](_0x5a1b3d)[_0xdc77('0x2c')](_0x55b4d8);};}exports[_0xdc77('0x2d')]=function(_0x1f641c,_0x47c15a){var _0x506a63={},_0x38ea92={},_0x3d0310={'count':0x0,'rows':[]};var _0x484a28=_[_0xdc77('0x2e')](db[_0xdc77('0x2f')][_0xdc77('0x30')],function(_0x396beb){return{'name':_0x396beb['fieldName'],'type':_0x396beb[_0xdc77('0x31')][_0xdc77('0x32')]};});_0x38ea92[_0xdc77('0x33')]=_['map'](_0x484a28,'name');_0x38ea92['query']=_[_0xdc77('0x34')](_0x1f641c[_0xdc77('0x35')]);_0x38ea92[_0xdc77('0x36')]=_['intersection'](_0x38ea92[_0xdc77('0x33')],_0x38ea92['query']);_0x506a63[_0xdc77('0x37')]=_[_0xdc77('0x38')](_0x38ea92[_0xdc77('0x33')],qs[_0xdc77('0x39')](_0x1f641c[_0xdc77('0x35')][_0xdc77('0x39')]));_0x506a63[_0xdc77('0x37')]=_0x506a63['attributes'][_0xdc77('0x3a')]?_0x506a63['attributes']:_0x38ea92[_0xdc77('0x33')];if(!_0x1f641c[_0xdc77('0x35')][_0xdc77('0x3b')](_0xdc77('0x3c'))){_0x506a63['limit']=qs[_0xdc77('0x1f')](_0x1f641c[_0xdc77('0x35')][_0xdc77('0x1f')]);_0x506a63[_0xdc77('0x1e')]=qs[_0xdc77('0x1e')](_0x1f641c[_0xdc77('0x35')][_0xdc77('0x1e')]);}_0x506a63[_0xdc77('0x3d')]=qs[_0xdc77('0x3e')](_0x1f641c[_0xdc77('0x35')][_0xdc77('0x3e')]);_0x506a63['where']=qs[_0xdc77('0x36')](_['pick'](_0x1f641c['query'],_0x38ea92[_0xdc77('0x36')]),_0x484a28);if(_0x1f641c[_0xdc77('0x35')][_0xdc77('0x3f')]){_0x506a63[_0xdc77('0x40')]=_[_0xdc77('0x41')](_0x506a63['where'],{'$or':_[_0xdc77('0x2e')](_0x484a28,function(_0x3f9a59){if(_0x3f9a59[_0xdc77('0x31')]!==_0xdc77('0x42')){var _0x1158f4={};_0x1158f4[_0x3f9a59[_0xdc77('0x2b')]]={'$like':'%'+_0x1f641c[_0xdc77('0x35')]['filter']+'%'};return _0x1158f4;}})});}_0x506a63=_['merge']({},_0x506a63,_0x1f641c[_0xdc77('0x43')]);var _0x96d11a={'where':_0x506a63[_0xdc77('0x40')]};return db[_0xdc77('0x2f')][_0xdc77('0x21')](_0x96d11a)[_0xdc77('0x28')](function(_0x304d2f){_0x3d0310['count']=_0x304d2f;if(_0x1f641c['query'][_0xdc77('0x44')]){_0x506a63[_0xdc77('0x45')]=[{'all':!![]}];}return db[_0xdc77('0x2f')][_0xdc77('0x46')](_0x506a63);})[_0xdc77('0x28')](function(_0xde5487){_0x3d0310[_0xdc77('0x47')]=_0xde5487;return _0x3d0310;})['then'](respondWithFilteredResult(_0x47c15a,_0x506a63))[_0xdc77('0x48')](handleError(_0x47c15a,null));};exports[_0xdc77('0x49')]=function(_0x546f50,_0x591abb){var _0x1884e9={'raw':!![],'where':{'id':_0x546f50[_0xdc77('0x4a')]['id']}},_0x3bf9b8={};_0x3bf9b8[_0xdc77('0x33')]=_[_0xdc77('0x34')](db['SquareDetailsReport'][_0xdc77('0x30')]);_0x3bf9b8[_0xdc77('0x35')]=_['keys'](_0x546f50[_0xdc77('0x35')]);_0x3bf9b8[_0xdc77('0x36')]=_[_0xdc77('0x38')](_0x3bf9b8[_0xdc77('0x33')],_0x3bf9b8[_0xdc77('0x35')]);_0x1884e9[_0xdc77('0x37')]=_['intersection'](_0x3bf9b8[_0xdc77('0x33')],qs[_0xdc77('0x39')](_0x546f50['query']['fields']));_0x1884e9['attributes']=_0x1884e9[_0xdc77('0x37')][_0xdc77('0x3a')]?_0x1884e9[_0xdc77('0x37')]:_0x3bf9b8[_0xdc77('0x33')];if(_0x546f50['query'][_0xdc77('0x44')]){_0x1884e9['include']=[{'all':!![]}];}_0x1884e9=_[_0xdc77('0x41')]({},_0x1884e9,_0x546f50[_0xdc77('0x43')]);return db['SquareDetailsReport'][_0xdc77('0x4b')](_0x1884e9)[_0xdc77('0x28')](handleEntityNotFound(_0x591abb,null))[_0xdc77('0x28')](respondWithResult(_0x591abb,null))[_0xdc77('0x48')](handleError(_0x591abb,null));};exports[_0xdc77('0x4c')]=function(_0x1de17c,_0x237342){return db[_0xdc77('0x2f')][_0xdc77('0x4c')](_0x1de17c[_0xdc77('0x4d')],{})[_0xdc77('0x28')](respondWithResult(_0x237342,0xc9))[_0xdc77('0x48')](handleError(_0x237342,null));};exports[_0xdc77('0x27')]=function(_0xd8db88,_0x54a3bc){if(_0xd8db88[_0xdc77('0x4d')]['id']){delete _0xd8db88[_0xdc77('0x4d')]['id'];}return db['SquareDetailsReport'][_0xdc77('0x4b')]({'where':{'id':_0xd8db88[_0xdc77('0x4a')]['id']}})[_0xdc77('0x28')](handleEntityNotFound(_0x54a3bc,null))[_0xdc77('0x28')](saveUpdates(_0xd8db88['body'],null))[_0xdc77('0x28')](respondWithResult(_0x54a3bc,null))[_0xdc77('0x48')](handleError(_0x54a3bc,null));};exports[_0xdc77('0x4e')]=function(_0x3f5167,_0x6c09ef){return db[_0xdc77('0x2f')][_0xdc77('0x4b')]({'where':{'id':_0x3f5167[_0xdc77('0x4a')]['id']}})[_0xdc77('0x28')](handleEntityNotFound(_0x6c09ef,null))[_0xdc77('0x28')](removeEntity(_0x6c09ef,null))[_0xdc77('0x48')](handleError(_0x6c09ef,null));};exports[_0xdc77('0x4f')]=function(_0x5744c,_0x3fd65e){return db['SquareDetailsReport'][_0xdc77('0x4f')]()[_0xdc77('0x28')](respondWithResult(_0x3fd65e,null))['catch'](handleError(_0x3fd65e,null));}; \ No newline at end of file +var _0x2f76=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','SquareDetailsReport','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x546201,_0x49ee3e){var _0x57e598=function(_0x54403f){while(--_0x54403f){_0x546201['push'](_0x546201['shift']());}};_0x57e598(++_0x49ee3e);}(_0x2f76,0x122));var _0x62f7=function(_0x4253f9,_0x5cc44a){_0x4253f9=_0x4253f9-0x0;var _0x2fd3f3=_0x2f76[_0x4253f9];return _0x2fd3f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62f7('0x0'));var zipdir=require(_0x62f7('0x1'));var jsonpatch=require(_0x62f7('0x2'));var rp=require(_0x62f7('0x3'));var moment=require('moment');var BPromise=require(_0x62f7('0x4'));var Mustache=require(_0x62f7('0x5'));var util=require(_0x62f7('0x6'));var path=require(_0x62f7('0x7'));var sox=require('sox');var csv=require(_0x62f7('0x8'));var ejs=require(_0x62f7('0x9'));var fs=require('fs');var fs_extra=require(_0x62f7('0xa'));var _=require(_0x62f7('0xb'));var squel=require(_0x62f7('0xc'));var crypto=require(_0x62f7('0xd'));var jsforce=require(_0x62f7('0xe'));var deskjs=require(_0x62f7('0xf'));var toCsv=require(_0x62f7('0x8'));var querystring=require('querystring');var Papa=require(_0x62f7('0x10'));var Redis=require('ioredis');var authService=require(_0x62f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x62f7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62f7('0x13'))('api');var utils=require(_0x62f7('0x14'));var config=require(_0x62f7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x62f7('0x16'))['db'];function respondWithStatusCode(_0x4a7137,_0x35206a){_0x35206a=_0x35206a||0xcc;return function(_0x2a1205){if(_0x2a1205){return _0x4a7137['sendStatus'](_0x35206a);}return _0x4a7137[_0x62f7('0x17')](_0x35206a)[_0x62f7('0x18')]();};}function respondWithResult(_0x57acab,_0x558f44){_0x558f44=_0x558f44||0xc8;return function(_0xc899a1){if(_0xc899a1){return _0x57acab['status'](_0x558f44)[_0x62f7('0x19')](_0xc899a1);}};}function respondWithFilteredResult(_0xd0e55b,_0x115637){return function(_0x1d52c9){if(_0x1d52c9){var _0xbfe3b8=typeof _0x115637[_0x62f7('0x1a')]===_0x62f7('0x1b')&&typeof _0x115637['limit']===_0x62f7('0x1b');var _0x3710f1=_0x1d52c9[_0x62f7('0x1c')];var _0x1ba25f=_0xbfe3b8?0x0:_0x115637[_0x62f7('0x1a')];var _0x41a23e=_0xbfe3b8?_0x1d52c9[_0x62f7('0x1c')]:_0x115637[_0x62f7('0x1a')]+_0x115637['limit'];var _0x3a07a8;if(_0x41a23e>=_0x3710f1){_0x41a23e=_0x3710f1;_0x3a07a8=0xc8;}else{_0x3a07a8=0xce;}_0xd0e55b[_0x62f7('0x17')](_0x3a07a8);return _0xd0e55b[_0x62f7('0x1d')](_0x62f7('0x1e'),_0x1ba25f+'-'+_0x41a23e+'/'+_0x3710f1)[_0x62f7('0x19')](_0x1d52c9);}return null;};}function patchUpdates(_0x48bde2){return function(_0x55c3fc){try{jsonpatch[_0x62f7('0x1f')](_0x55c3fc,_0x48bde2,!![]);}catch(_0x55db02){return BPromise[_0x62f7('0x20')](_0x55db02);}return _0x55c3fc[_0x62f7('0x21')]();};}function saveUpdates(_0x42afb4,_0x5cf538){return function(_0x6239ae){if(_0x6239ae){return _0x6239ae[_0x62f7('0x22')](_0x42afb4)[_0x62f7('0x23')](function(_0x4676fa){return _0x4676fa;});}return null;};}function removeEntity(_0x2563db,_0x48b17b){return function(_0xc340a5){if(_0xc340a5){return _0xc340a5[_0x62f7('0x24')]()['then'](function(){_0x2563db[_0x62f7('0x17')](0xcc)[_0x62f7('0x18')]();});}};}function handleEntityNotFound(_0x2b6393,_0x1e4e3c){return function(_0x4af8ea){if(!_0x4af8ea){_0x2b6393[_0x62f7('0x25')](0x194);}return _0x4af8ea;};}function handleError(_0x286f2b,_0x543db1){_0x543db1=_0x543db1||0x1f4;return function(_0x5e50c5){logger['error'](_0x5e50c5[_0x62f7('0x26')]);if(_0x5e50c5[_0x62f7('0x27')]){delete _0x5e50c5[_0x62f7('0x27')];}_0x286f2b[_0x62f7('0x17')](_0x543db1)[_0x62f7('0x28')](_0x5e50c5);};}exports[_0x62f7('0x29')]=function(_0x5649cb,_0x540838){var _0x8266f5={},_0xd39a27={},_0x1d92c4={'count':0x0,'rows':[]};var _0x2888e3=_[_0x62f7('0x2a')](db['SquareDetailsReport'][_0x62f7('0x2b')],function(_0x2ddabd){return{'name':_0x2ddabd[_0x62f7('0x2c')],'type':_0x2ddabd[_0x62f7('0x2d')][_0x62f7('0x2e')]};});_0xd39a27[_0x62f7('0x2f')]=_[_0x62f7('0x2a')](_0x2888e3,'name');_0xd39a27['query']=_[_0x62f7('0x30')](_0x5649cb[_0x62f7('0x31')]);_0xd39a27[_0x62f7('0x32')]=_['intersection'](_0xd39a27[_0x62f7('0x2f')],_0xd39a27[_0x62f7('0x31')]);_0x8266f5[_0x62f7('0x33')]=_[_0x62f7('0x34')](_0xd39a27['model'],qs[_0x62f7('0x35')](_0x5649cb['query'][_0x62f7('0x35')]));_0x8266f5[_0x62f7('0x33')]=_0x8266f5[_0x62f7('0x33')][_0x62f7('0x36')]?_0x8266f5[_0x62f7('0x33')]:_0xd39a27['model'];if(!_0x5649cb[_0x62f7('0x31')]['hasOwnProperty'](_0x62f7('0x37'))){_0x8266f5[_0x62f7('0x38')]=qs['limit'](_0x5649cb['query']['limit']);_0x8266f5[_0x62f7('0x1a')]=qs[_0x62f7('0x1a')](_0x5649cb[_0x62f7('0x31')][_0x62f7('0x1a')]);}_0x8266f5[_0x62f7('0x39')]=qs[_0x62f7('0x3a')](_0x5649cb[_0x62f7('0x31')][_0x62f7('0x3a')]);_0x8266f5[_0x62f7('0x3b')]=qs[_0x62f7('0x32')](_[_0x62f7('0x3c')](_0x5649cb['query'],_0xd39a27[_0x62f7('0x32')]),_0x2888e3);if(_0x5649cb[_0x62f7('0x31')][_0x62f7('0x3d')]){_0x8266f5['where']=_['merge'](_0x8266f5[_0x62f7('0x3b')],{'$or':_['map'](_0x2888e3,function(_0x16a528){if(_0x16a528['type']!==_0x62f7('0x3e')){var _0x7c0661={};_0x7c0661[_0x16a528['name']]={'$like':'%'+_0x5649cb['query'][_0x62f7('0x3d')]+'%'};return _0x7c0661;}})});}_0x8266f5=_['merge']({},_0x8266f5,_0x5649cb[_0x62f7('0x3f')]);var _0x58baf8={'where':_0x8266f5['where']};return db['SquareDetailsReport'][_0x62f7('0x1c')](_0x58baf8)[_0x62f7('0x23')](function(_0x2b1825){_0x1d92c4[_0x62f7('0x1c')]=_0x2b1825;if(_0x5649cb[_0x62f7('0x31')]['includeAll']){_0x8266f5[_0x62f7('0x40')]=[{'all':!![]}];}return db[_0x62f7('0x41')][_0x62f7('0x42')](_0x8266f5);})[_0x62f7('0x23')](function(_0x44bd5c){_0x1d92c4['rows']=_0x44bd5c;return _0x1d92c4;})['then'](respondWithFilteredResult(_0x540838,_0x8266f5))[_0x62f7('0x43')](handleError(_0x540838,null));};exports[_0x62f7('0x44')]=function(_0x3e53fe,_0x526080){var _0x1a5572={'raw':!![],'where':{'id':_0x3e53fe[_0x62f7('0x45')]['id']}},_0x4e19a1={};_0x4e19a1[_0x62f7('0x2f')]=_[_0x62f7('0x30')](db[_0x62f7('0x41')][_0x62f7('0x2b')]);_0x4e19a1[_0x62f7('0x31')]=_[_0x62f7('0x30')](_0x3e53fe[_0x62f7('0x31')]);_0x4e19a1['filters']=_[_0x62f7('0x34')](_0x4e19a1[_0x62f7('0x2f')],_0x4e19a1[_0x62f7('0x31')]);_0x1a5572[_0x62f7('0x33')]=_[_0x62f7('0x34')](_0x4e19a1[_0x62f7('0x2f')],qs[_0x62f7('0x35')](_0x3e53fe['query'][_0x62f7('0x35')]));_0x1a5572[_0x62f7('0x33')]=_0x1a5572[_0x62f7('0x33')][_0x62f7('0x36')]?_0x1a5572[_0x62f7('0x33')]:_0x4e19a1[_0x62f7('0x2f')];if(_0x3e53fe[_0x62f7('0x31')][_0x62f7('0x46')]){_0x1a5572[_0x62f7('0x40')]=[{'all':!![]}];}_0x1a5572=_['merge']({},_0x1a5572,_0x3e53fe[_0x62f7('0x3f')]);return db['SquareDetailsReport'][_0x62f7('0x47')](_0x1a5572)[_0x62f7('0x23')](handleEntityNotFound(_0x526080,null))['then'](respondWithResult(_0x526080,null))[_0x62f7('0x43')](handleError(_0x526080,null));};exports[_0x62f7('0x48')]=function(_0x1dd11f,_0x366f48){return db['SquareDetailsReport'][_0x62f7('0x48')](_0x1dd11f['body'],{})['then'](respondWithResult(_0x366f48,0xc9))['catch'](handleError(_0x366f48,null));};exports[_0x62f7('0x22')]=function(_0x56d47c,_0x573611){if(_0x56d47c[_0x62f7('0x49')]['id']){delete _0x56d47c[_0x62f7('0x49')]['id'];}return db['SquareDetailsReport'][_0x62f7('0x47')]({'where':{'id':_0x56d47c[_0x62f7('0x45')]['id']}})[_0x62f7('0x23')](handleEntityNotFound(_0x573611,null))[_0x62f7('0x23')](saveUpdates(_0x56d47c['body'],null))['then'](respondWithResult(_0x573611,null))['catch'](handleError(_0x573611,null));};exports[_0x62f7('0x24')]=function(_0x2a605d,_0x495038){return db[_0x62f7('0x41')][_0x62f7('0x47')]({'where':{'id':_0x2a605d[_0x62f7('0x45')]['id']}})[_0x62f7('0x23')](handleEntityNotFound(_0x495038,null))[_0x62f7('0x23')](removeEntity(_0x495038,null))[_0x62f7('0x43')](handleError(_0x495038,null));};exports[_0x62f7('0x4a')]=function(_0x3104b8,_0x32b9ad){return db['SquareDetailsReport'][_0x62f7('0x4a')]()[_0x62f7('0x23')](respondWithResult(_0x32b9ad,null))[_0x62f7('0x43')](handleError(_0x32b9ad,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 9877fc9..8bc94fe 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe82c=['moment','bluebird','request-promise','../../config/environment','exports','define','SquareDetailsReport','report_square_details','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe82c,0xee));var _0xce82=function(_0xf56631,_0x4b7e30){_0xf56631=_0xf56631-0x0;var _0x59c8c3=_0xe82c[_0xf56631];return _0x59c8c3;};'use strict';var _=require('lodash');var util=require(_0xce82('0x0'));var logger=require(_0xce82('0x1'))('api');var moment=require(_0xce82('0x2'));var BPromise=require(_0xce82('0x3'));var rp=require(_0xce82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xce82('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xce82('0x6')]=function(_0x53ab19,_0x4ec035){return _0x53ab19[_0xce82('0x7')](_0xce82('0x8'),attributes,{'tableName':_0xce82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3630=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','lodash'];(function(_0x2083ea,_0xb732f){var _0x1de6f7=function(_0x4c63fc){while(--_0x4c63fc){_0x2083ea['push'](_0x2083ea['shift']());}};_0x1de6f7(++_0xb732f);}(_0x3630,0xc5));var _0x0363=function(_0xbbc0d8,_0x762bb1){_0xbbc0d8=_0xbbc0d8-0x0;var _0x5651ce=_0x3630[_0xbbc0d8];return _0x5651ce;};'use strict';var _=require(_0x0363('0x0'));var util=require(_0x0363('0x1'));var logger=require(_0x0363('0x2'))(_0x0363('0x3'));var moment=require(_0x0363('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0363('0x5'));var rimraf=require(_0x0363('0x6'));var config=require(_0x0363('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x0363('0x8')]=function(_0x16426e,_0x3b8034){return _0x16426e[_0x0363('0x9')](_0x0363('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index f2b926a..29cd7a3 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac35=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x182da6,_0x389200){var _0x564adb=function(_0xad9005){while(--_0xad9005){_0x182da6['push'](_0x182da6['shift']());}};_0x564adb(++_0x389200);}(_0xac35,0x141));var _0x5ac3=function(_0x3a111c,_0x3000de){_0x3a111c=_0x3a111c-0x0;var _0x1a0650=_0xac35[_0x3a111c];return _0x1a0650;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});}exports[_0x5ac3('0x1a')]=function(_0x1c2566){var _0x200eca=this;return new Promise(function(_0x141128,_0x5aab00){return db[_0x5ac3('0x1b')][_0x5ac3('0x1c')](_0x1c2566[_0x5ac3('0x1d')],{'raw':_0x1c2566[_0x5ac3('0x1e')]?_0x1c2566[_0x5ac3('0x1e')][_0x5ac3('0x1f')]===undefined?!![]:![]:!![]})[_0x5ac3('0xf')](function(_0x2fcc26){logger[_0x5ac3('0x10')](_0x5ac3('0x1a'),_0x1c2566);logger[_0x5ac3('0x20')](_0x5ac3('0x1a'),_0x1c2566,JSON['stringify'](_0x2fcc26));_0x141128(_0x2fcc26);})[_0x5ac3('0x19')](function(_0x3cbb52){logger[_0x5ac3('0x14')](_0x5ac3('0x1a'),_0x3cbb52['message'],_0x1c2566);_0x5aab00(_0x200eca[_0x5ac3('0x14')](0x1f4,_0x3cbb52[_0x5ac3('0x16')]));});});}; \ No newline at end of file +var _0xe1e3=['jayson/promise','client','http','request','then','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','info','result','CreateSquareDetailsReport','options','raw','debug','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x231c17,_0x509500){var _0x28ab2a=function(_0x2f3823){while(--_0x2f3823){_0x231c17['push'](_0x231c17['shift']());}};_0x28ab2a(++_0x509500);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5c5587,_0x47b285){_0x5c5587=_0x5c5587-0x0;var _0x35595d=_0xe1e3[_0x5c5587];return _0x35595d;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['SquareDetailsReport']['create'](_0x1d786c['body'],{'raw':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1c5acd){logger['info'](_0x3e1e('0x14'),_0x1d786c);logger[_0x3e1e('0x17')](_0x3e1e('0x14'),_0x1d786c,JSON['stringify'](_0x1c5acd));_0x791ed8(_0x1c5acd);})[_0x3e1e('0x18')](function(_0x96396){logger[_0x3e1e('0xf')]('CreateSquareDetailsReport',_0x96396['message'],_0x1d786c);_0x1c181b(_0x39eaa7[_0x3e1e('0xf')](0x1f4,_0x96396[_0x3e1e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5274e78..ff53035 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fcf=['Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express'];(function(_0x4e06f5,_0x35802b){var _0x139428=function(_0x429571){while(--_0x429571){_0x4e06f5['push'](_0x4e06f5['shift']());}};_0x139428(++_0x35802b);}(_0x1fcf,0x167));var _0xf1fc=function(_0x1443d5,_0x21f839){_0x1443d5=_0x1443d5-0x0;var _0x3f8e34=_0x1fcf[_0x1443d5];return _0x3f8e34;};'use strict';var express=require(_0xf1fc('0x0'));var router=express[_0xf1fc('0x1')]();var auth=require(_0xf1fc('0x2'));var controller=require(_0xf1fc('0x3'));router[_0xf1fc('0x4')]('/',auth['isAuthenticated'](),controller[_0xf1fc('0x5')]);router[_0xf1fc('0x4')](_0xf1fc('0x6'),auth[_0xf1fc('0x7')](),controller[_0xf1fc('0x8')]);module[_0xf1fc('0x9')]=router; \ No newline at end of file +var _0x7d6c=['express','../../components/auth/service','./system.controller','get','index','isAuthenticated','exports'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0x7d6c,0x93));var _0xc7d6=function(_0x545b77,_0x352ebe){_0x545b77=_0x545b77-0x0;var _0x553289=_0x7d6c[_0x545b77];return _0x553289;};'use strict';var express=require(_0xc7d6('0x0'));var router=express['Router']();var auth=require(_0xc7d6('0x1'));var controller=require(_0xc7d6('0x2'));router[_0xc7d6('0x3')]('/',auth['isAuthenticated'](),controller[_0xc7d6('0x4')]);router[_0xc7d6('0x3')]('/process/:pid/kill',auth[_0xc7d6('0x5')](),controller['killProcess']);module[_0xc7d6('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 9db6e65..a0a33f0 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc90=['send','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split','indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status'];(function(_0x340d17,_0x3d6339){var _0x4a18d1=function(_0x50d179){while(--_0x50d179){_0x340d17['push'](_0x340d17['shift']());}};_0x4a18d1(++_0x3d6339);}(_0xfc90,0x1d6));var _0x0fc9=function(_0x45d58d,_0x2e87f3){_0x45d58d=_0x45d58d-0x0;var _0x499c72=_0xfc90[_0x45d58d];return _0x499c72;};'use strict';var info=require(_0x0fc9('0x0'));var exec=require(_0x0fc9('0x1'))[_0x0fc9('0x2')];var logger=require(_0x0fc9('0x3'))('api');var util=require(_0x0fc9('0x4'));var BPromise=require('bluebird');var _=require(_0x0fc9('0x5'));function handleError(_0x1b5750,_0x507e7a,_0x28b450){_0x507e7a=_0x507e7a||0x1f4;return function(_0x4b5e97){logger[_0x0fc9('0x6')](_0x0fc9('0x7'),_0x28b450,_0x507e7a,util['inspect'](_0x4b5e97,{'showHidden':![],'depth':null}));delete _0x4b5e97[_0x0fc9('0x8')];_0x1b5750[_0x0fc9('0x9')](_0x507e7a)[_0x0fc9('0xa')](_0x4b5e97);};}exports['index']=function(_0x4321b9,_0x4909e1){return info[_0x0fc9('0xb')]()[_0x0fc9('0xc')](function(_0xae6a6b){return _0x4909e1['status'](0xc8)[_0x0fc9('0xd')](_0xae6a6b);})[_0x0fc9('0xe')](function(_0x390395){return _0x4909e1[_0x0fc9('0x9')](0x1f4)['json'](_0x390395);});};exports[_0x0fc9('0xf')]=function(_0xd0eb90,_0x568420){var _0x5c930a=[_0x0fc9('0x10')];return new BPromise(function(_0x3e34c5,_0x137381){return exec(util[_0x0fc9('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xd0eb90[_0x0fc9('0x12')][_0x0fc9('0x13')]),function(_0x1a6c14,_0x495ee0,_0x36a188){if(_0x1a6c14){return _0x137381(_0x1a6c14);}return _0x3e34c5(_0x495ee0);});})['then'](function(_0x26492b){var _0x3a43c7=![];var _0x2e234d=_0x26492b[_0x0fc9('0x14')](/\n/);for(var _0x5346f2=0x0,_0x42c065=_0x5c930a['length'];_0x5346f2<_0x42c065,_0x3a43c7===![];_0x5346f2+=0x1){if(_0x26492b[_0x0fc9('0x15')](_0x5c930a[_0x5346f2])>=0x0){_0x3a43c7=!![];}}if(!_0x3a43c7){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xd0eb90[_0x0fc9('0x12')][_0x0fc9('0x13')]));}process['kill'](_0xd0eb90[_0x0fc9('0x12')][_0x0fc9('0x13')],_0x0fc9('0x16'));return _0x568420[_0x0fc9('0x9')](0xc8)[_0x0fc9('0xd')]({'message':util[_0x0fc9('0x11')](_0x0fc9('0x17'),_0xd0eb90[_0x0fc9('0x12')]['pid'])});})[_0x0fc9('0xe')](handleError(_0x568420,null,'killProcess'));}; \ No newline at end of file +var _0x59a1=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','inspect','name','status','send','index','getAllData','then','catch','json','killProcess','format'];(function(_0x3d0877,_0x2b9ab0){var _0x20bb09=function(_0x9a51b5){while(--_0x9a51b5){_0x3d0877['push'](_0x3d0877['shift']());}};_0x20bb09(++_0x2b9ab0);}(_0x59a1,0x13d));var _0x159a=function(_0x1a1d4d,_0x162a8e){_0x1a1d4d=_0x1a1d4d-0x0;var _0x270d0a=_0x59a1[_0x1a1d4d];return _0x270d0a;};'use strict';var info=require(_0x159a('0x0'));var exec=require(_0x159a('0x1'))[_0x159a('0x2')];var logger=require(_0x159a('0x3'))(_0x159a('0x4'));var util=require(_0x159a('0x5'));var BPromise=require(_0x159a('0x6'));var _=require('lodash');function handleError(_0x3b0d38,_0x341668,_0x57a3f7){_0x341668=_0x341668||0x1f4;return function(_0xf82f36){logger[_0x159a('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x57a3f7,_0x341668,util[_0x159a('0x8')](_0xf82f36,{'showHidden':![],'depth':null}));delete _0xf82f36[_0x159a('0x9')];_0x3b0d38[_0x159a('0xa')](_0x341668)[_0x159a('0xb')](_0xf82f36);};}exports[_0x159a('0xc')]=function(_0x5870c2,_0xb6af85){return info[_0x159a('0xd')]()[_0x159a('0xe')](function(_0x38783a){return _0xb6af85[_0x159a('0xa')](0xc8)['json'](_0x38783a);})[_0x159a('0xf')](function(_0x1bec67){return _0xb6af85[_0x159a('0xa')](0x1f4)[_0x159a('0x10')](_0x1bec67);});};exports[_0x159a('0x11')]=function(_0x2d6c9a,_0x34556f){var _0x44179f=['components/import/cm'];return new BPromise(function(_0x25935a,_0x764df6){return exec(util[_0x159a('0x12')](_0x159a('0x13'),_0x2d6c9a['params'][_0x159a('0x14')]),function(_0x26720d,_0x3c67c2,_0x34dcda){if(_0x26720d){return _0x764df6(_0x26720d);}return _0x25935a(_0x3c67c2);});})[_0x159a('0xe')](function(_0x1ab423){var _0x38e41=![];var _0x116f93=_0x1ab423[_0x159a('0x15')](/\n/);for(var _0x3df010=0x0,_0x17cbba=_0x44179f[_0x159a('0x16')];_0x3df010<_0x17cbba,_0x38e41===![];_0x3df010+=0x1){if(_0x1ab423[_0x159a('0x17')](_0x44179f[_0x3df010])>=0x0){_0x38e41=!![];}}if(!_0x38e41){throw new Error(util['format'](_0x159a('0x18'),_0x2d6c9a[_0x159a('0x19')][_0x159a('0x14')]));}process['kill'](_0x2d6c9a['params'][_0x159a('0x14')],_0x159a('0x1a'));return _0x34556f[_0x159a('0xa')](0xc8)['json']({'message':util[_0x159a('0x12')](_0x159a('0x1b'),_0x2d6c9a[_0x159a('0x19')][_0x159a('0x14')])});})['catch'](handleError(_0x34556f,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b94ede7..cf58832 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3059=['./tag.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1a8fbd,_0x2e5bdd){var _0x2680f9=function(_0x50a27a){while(--_0x50a27a){_0x1a8fbd['push'](_0x1a8fbd['shift']());}};_0x2680f9(++_0x2e5bdd);}(_0x3059,0x1df));var _0x9305=function(_0x580e6c,_0x13d42a){_0x580e6c=_0x580e6c-0x0;var _0x2eb241=_0x3059[_0x580e6c];return _0x2eb241;};'use strict';var multer=require('multer');var util=require(_0x9305('0x0'));var path=require(_0x9305('0x1'));var timeout=require(_0x9305('0x2'));var express=require(_0x9305('0x3'));var router=express['Router']();var fs_extra=require(_0x9305('0x4'));var auth=require(_0x9305('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9305('0x6'));var controller=require(_0x9305('0x7'));router[_0x9305('0x8')]('/',auth[_0x9305('0x9')](),controller[_0x9305('0xa')]);router['get']('/:id',auth[_0x9305('0x9')](),controller[_0x9305('0xb')]);router['post']('/',auth[_0x9305('0x9')](),controller[_0x9305('0xc')]);router[_0x9305('0xd')](_0x9305('0xe'),auth['isAuthenticated'](),controller[_0x9305('0xf')]);router['delete']('/:id',auth[_0x9305('0x9')](),controller[_0x9305('0x10')]);module[_0x9305('0x11')]=router; \ No newline at end of file +var _0xd677=['update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','index','/:id','show','post','isAuthenticated','create','put'];(function(_0x400e7a,_0xc72a95){var _0x3ea72f=function(_0x4ce67e){while(--_0x4ce67e){_0x400e7a['push'](_0x400e7a['shift']());}};_0x3ea72f(++_0xc72a95);}(_0xd677,0x94));var _0x7d67=function(_0x4a7fd1,_0x4bdde1){_0x4a7fd1=_0x4a7fd1-0x0;var _0x12ef10=_0xd677[_0x4a7fd1];return _0x12ef10;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7d67('0x0'));var express=require('express');var router=express[_0x7d67('0x1')]();var fs_extra=require(_0x7d67('0x2'));var auth=require(_0x7d67('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7d67('0x4'));var controller=require(_0x7d67('0x5'));router[_0x7d67('0x6')]('/',auth['isAuthenticated'](),controller[_0x7d67('0x7')]);router[_0x7d67('0x6')](_0x7d67('0x8'),auth['isAuthenticated'](),controller[_0x7d67('0x9')]);router[_0x7d67('0xa')]('/',auth[_0x7d67('0xb')](),controller[_0x7d67('0xc')]);router[_0x7d67('0xd')](_0x7d67('0x8'),auth[_0x7d67('0xb')](),controller[_0x7d67('0xe')]);router[_0x7d67('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7d67('0x10')]);module[_0x7d67('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5d80f20..bc1c116 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7275=['exports','STRING','sequelize'];(function(_0x1f5acc,_0x5b7140){var _0x54242d=function(_0x21814f){while(--_0x21814f){_0x1f5acc['push'](_0x1f5acc['shift']());}};_0x54242d(++_0x5b7140);}(_0x7275,0x143));var _0x5727=function(_0x3b5ed2,_0xadf380){_0x3b5ed2=_0x3b5ed2-0x0;var _0xe799b5=_0x7275[_0x3b5ed2];return _0xe799b5;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'name':{'type':Sequelize[_0x5727('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5727('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x5727('0x2')]}}; \ No newline at end of file +var _0xdf79=['name','#0091EA','STRING'];(function(_0x437abe,_0x3e33a8){var _0x51189b=function(_0x325a20){while(--_0x325a20){_0x437abe['push'](_0x437abe['shift']());}};_0x51189b(++_0x3e33a8);}(_0xdf79,0xa7));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9df7('0x0')],'unique':_0x9df7('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9df7('0x0')],'defaultValue':_0x9df7('0x2')},'description':{'type':Sequelize[_0x9df7('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d078ae9..8eab932 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00b3=['to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','Tag','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox'];(function(_0x5653b8,_0x5d5a94){var _0x4775de=function(_0x10fa00){while(--_0x10fa00){_0x5653b8['push'](_0x5653b8['shift']());}};_0x4775de(++_0x5d5a94);}(_0x00b3,0x17a));var _0x300b=function(_0x5deeb7,_0x46f6f6){_0x5deeb7=_0x5deeb7-0x0;var _0x5ed1c9=_0x00b3[_0x5deeb7];return _0x5ed1c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){var _0x2fa577=_0x3219aa[_0x300b('0x22')]({'plain':!![]});var _0x544658=_0x300b('0x23');return db[_0x300b('0x24')][_0x300b('0x21')]({'where':{'type':_0x544658,'resourceId':_0x2fa577['id']}})[_0x300b('0x20')](function(){return _0x3219aa;});})['then'](function(){_0x28bc0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39794a,_0x4a1300){return function(_0x1241c7){if(!_0x1241c7){_0x39794a[_0x300b('0x15')](0x194);}return _0x1241c7;};}function handleError(_0x60bb0c,_0x30b260){_0x30b260=_0x30b260||0x1f4;return function(_0x2d2ea7){logger[_0x300b('0x25')](_0x2d2ea7[_0x300b('0x26')]);if(_0x2d2ea7[_0x300b('0x27')]){delete _0x2d2ea7[_0x300b('0x27')];}_0x60bb0c[_0x300b('0x16')](_0x30b260)['send'](_0x2d2ea7);};}exports['index']=function(_0x35cafd,_0x2a7604){var _0x1cb3bc={},_0x3d89ab={},_0x4b8639={'count':0x0,'rows':[]};var _0x2e30df=_['map'](db['Tag']['rawAttributes'],function(_0x27d2de){return{'name':_0x27d2de[_0x300b('0x28')],'type':_0x27d2de['type'][_0x300b('0x29')]};});_0x3d89ab[_0x300b('0x2a')]=_['map'](_0x2e30df,_0x300b('0x27'));_0x3d89ab['query']=_[_0x300b('0x2b')](_0x35cafd[_0x300b('0x2c')]);_0x3d89ab[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0x3d89ab[_0x300b('0x2a')],_0x3d89ab[_0x300b('0x2c')]);_0x1cb3bc[_0x300b('0x2f')]=_['intersection'](_0x3d89ab[_0x300b('0x2a')],qs['fields'](_0x35cafd[_0x300b('0x2c')][_0x300b('0x30')]));_0x1cb3bc['attributes']=_0x1cb3bc[_0x300b('0x2f')][_0x300b('0x31')]?_0x1cb3bc['attributes']:_0x3d89ab[_0x300b('0x2a')];if(!_0x35cafd[_0x300b('0x2c')][_0x300b('0x32')]('nolimit')){_0x1cb3bc[_0x300b('0x18')]=qs[_0x300b('0x18')](_0x35cafd[_0x300b('0x2c')][_0x300b('0x18')]);_0x1cb3bc[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0x35cafd[_0x300b('0x2c')]['offset']);}_0x1cb3bc[_0x300b('0x33')]=qs[_0x300b('0x34')](_0x35cafd['query'][_0x300b('0x34')]);_0x1cb3bc['where']=qs['filters'](_[_0x300b('0x35')](_0x35cafd[_0x300b('0x2c')],_0x3d89ab[_0x300b('0x2d')]),_0x2e30df);if(_0x35cafd[_0x300b('0x2c')][_0x300b('0x36')]){_0x1cb3bc['where']=_[_0x300b('0x37')](_0x1cb3bc[_0x300b('0x38')],{'$or':_['map'](_0x2e30df,function(_0x43af8f){if(_0x43af8f['type']!==_0x300b('0x39')){var _0x262ddb={};_0x262ddb[_0x43af8f[_0x300b('0x27')]]={'$like':'%'+_0x35cafd[_0x300b('0x2c')][_0x300b('0x36')]+'%'};return _0x262ddb;}})});}_0x1cb3bc=_[_0x300b('0x37')]({},_0x1cb3bc,_0x35cafd[_0x300b('0x3a')]);var _0x2f897e={'where':_0x1cb3bc[_0x300b('0x38')]};return db[_0x300b('0x3b')][_0x300b('0x1a')](_0x2f897e)['then'](function(_0x4ee1d0){_0x4b8639[_0x300b('0x1a')]=_0x4ee1d0;if(_0x35cafd['query']['includeAll']){_0x1cb3bc[_0x300b('0x3c')]=[{'all':!![]}];}return db[_0x300b('0x3b')][_0x300b('0x3d')](_0x1cb3bc);})['then'](function(_0x7aa03a){_0x4b8639['rows']=_0x7aa03a;return _0x4b8639;})['then'](respondWithFilteredResult(_0x2a7604,_0x1cb3bc))[_0x300b('0x3e')](handleError(_0x2a7604,null));};exports[_0x300b('0x3f')]=function(_0x5f0fd1,_0x24b227){var _0x10f652={'raw':!![],'where':{'id':_0x5f0fd1[_0x300b('0x40')]['id']}},_0x54bdc9={};_0x54bdc9[_0x300b('0x2a')]=_['keys'](db[_0x300b('0x3b')][_0x300b('0x41')]);_0x54bdc9[_0x300b('0x2c')]=_[_0x300b('0x2b')](_0x5f0fd1[_0x300b('0x2c')]);_0x54bdc9[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0x54bdc9[_0x300b('0x2a')],_0x54bdc9['query']);_0x10f652['attributes']=_[_0x300b('0x2e')](_0x54bdc9['model'],qs['fields'](_0x5f0fd1[_0x300b('0x2c')][_0x300b('0x30')]));_0x10f652[_0x300b('0x2f')]=_0x10f652[_0x300b('0x2f')][_0x300b('0x31')]?_0x10f652[_0x300b('0x2f')]:_0x54bdc9['model'];if(_0x5f0fd1[_0x300b('0x2c')]['includeAll']){_0x10f652['include']=[{'all':!![]}];}_0x10f652=_[_0x300b('0x37')]({},_0x10f652,_0x5f0fd1[_0x300b('0x3a')]);return db['Tag'][_0x300b('0x42')](_0x10f652)[_0x300b('0x20')](handleEntityNotFound(_0x24b227,null))[_0x300b('0x20')](respondWithResult(_0x24b227,null))[_0x300b('0x3e')](handleError(_0x24b227,null));};exports['create']=function(_0x389256,_0x43eef6){return db['Tag'][_0x300b('0x43')](_0x389256[_0x300b('0x44')],{})[_0x300b('0x20')](function(_0x5e8e29){var _0x27c57d=_0x389256[_0x300b('0x45')][_0x300b('0x22')]({'plain':!![]});if(!_0x27c57d)throw new Error(_0x300b('0x46'));if(_0x27c57d[_0x300b('0x47')]===_0x300b('0x45')){var _0x418ac3=_0x5e8e29[_0x300b('0x22')]({'plain':!![]});var _0x186519=_0x300b('0x23');return db[_0x300b('0x48')][_0x300b('0x42')]({'where':{'name':_0x186519,'userProfileId':_0x27c57d[_0x300b('0x49')]},'raw':!![]})['then'](function(_0x5ae549){if(_0x5ae549&&_0x5ae549[_0x300b('0x4a')]===0x0){return db[_0x300b('0x24')][_0x300b('0x43')]({'name':_0x418ac3['name'],'resourceId':_0x418ac3['id'],'type':_0x5ae549[_0x300b('0x27')],'sectionId':_0x5ae549['id']},{})['then'](function(){return _0x5e8e29;});}else{return _0x5e8e29;}})[_0x300b('0x3e')](function(_0x4ffa19){logger['error'](_0x300b('0x4b'),_0x4ffa19);throw _0x4ffa19;});}return _0x5e8e29;})[_0x300b('0x20')](respondWithResult(_0x43eef6,0xc9))[_0x300b('0x3e')](handleError(_0x43eef6,null));};exports[_0x300b('0x4c')]=function(_0x5309a3,_0x224375){if(_0x5309a3['body']['id']){delete _0x5309a3[_0x300b('0x44')]['id'];}return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x5309a3[_0x300b('0x40')]['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x224375,null))[_0x300b('0x20')](saveUpdates(_0x5309a3[_0x300b('0x44')],null))[_0x300b('0x20')](respondWithResult(_0x224375,null))[_0x300b('0x3e')](handleError(_0x224375,null));};exports[_0x300b('0x21')]=function(_0x873b9a,_0x1d6672){return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x873b9a['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x1d6672,null))[_0x300b('0x20')](removeEntity(_0x1d6672,null))['catch'](handleError(_0x1d6672,null));}; \ No newline at end of file +var _0xaaa2=['keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params'];(function(_0x1a1e49,_0x196658){var _0x505773=function(_0x7c12fd){while(--_0x7c12fd){_0x1a1e49['push'](_0x1a1e49['shift']());}};_0x505773(++_0x196658);}(_0xaaa2,0xac));var _0x2aaa=function(_0x4b8d3f,_0x7ce827){_0x4b8d3f=_0x4b8d3f-0x0;var _0x44cf7d=_0xaaa2[_0x4b8d3f];return _0x44cf7d;};'use strict';var emlformat=require(_0x2aaa('0x0'));var rimraf=require(_0x2aaa('0x1'));var zipdir=require(_0x2aaa('0x2'));var jsonpatch=require(_0x2aaa('0x3'));var rp=require(_0x2aaa('0x4'));var moment=require(_0x2aaa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2aaa('0x6'));var util=require('util');var path=require(_0x2aaa('0x7'));var sox=require(_0x2aaa('0x8'));var csv=require(_0x2aaa('0x9'));var ejs=require(_0x2aaa('0xa'));var fs=require('fs');var fs_extra=require(_0x2aaa('0xb'));var _=require(_0x2aaa('0xc'));var squel=require('squel');var crypto=require(_0x2aaa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2aaa('0x9'));var querystring=require('querystring');var Papa=require(_0x2aaa('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2aaa('0xf'));var as=require(_0x2aaa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2aaa('0x11'))(_0x2aaa('0x12'));var utils=require(_0x2aaa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2aaa('0x14'));var db=require(_0x2aaa('0x15'))['db'];function respondWithStatusCode(_0x8a5be3,_0x2b51f0){_0x2b51f0=_0x2b51f0||0xcc;return function(_0xd38d6d){if(_0xd38d6d){return _0x8a5be3[_0x2aaa('0x16')](_0x2b51f0);}return _0x8a5be3[_0x2aaa('0x17')](_0x2b51f0)[_0x2aaa('0x18')]();};}function respondWithResult(_0x32dfbf,_0xe22151){_0xe22151=_0xe22151||0xc8;return function(_0x314366){if(_0x314366){return _0x32dfbf[_0x2aaa('0x17')](_0xe22151)['json'](_0x314366);}};}function respondWithFilteredResult(_0x166321,_0x4df56b){return function(_0x35fbc1){if(_0x35fbc1){var _0x1a5573=typeof _0x4df56b['offset']==='undefined'&&typeof _0x4df56b['limit']===_0x2aaa('0x19');var _0x1dc0ba=_0x35fbc1[_0x2aaa('0x1a')];var _0x3b94bf=_0x1a5573?0x0:_0x4df56b[_0x2aaa('0x1b')];var _0xdaa445=_0x1a5573?_0x35fbc1[_0x2aaa('0x1a')]:_0x4df56b['offset']+_0x4df56b[_0x2aaa('0x1c')];var _0x30951c;if(_0xdaa445>=_0x1dc0ba){_0xdaa445=_0x1dc0ba;_0x30951c=0xc8;}else{_0x30951c=0xce;}_0x166321['status'](_0x30951c);return _0x166321[_0x2aaa('0x1d')]('Content-Range',_0x3b94bf+'-'+_0xdaa445+'/'+_0x1dc0ba)['json'](_0x35fbc1);}return null;};}function patchUpdates(_0x1ec32e){return function(_0x5052eb){try{jsonpatch[_0x2aaa('0x1e')](_0x5052eb,_0x1ec32e,!![]);}catch(_0x3e7649){return BPromise[_0x2aaa('0x1f')](_0x3e7649);}return _0x5052eb[_0x2aaa('0x20')]();};}function saveUpdates(_0x2c255f,_0x24da1e){return function(_0x4f581f){if(_0x4f581f){return _0x4f581f[_0x2aaa('0x21')](_0x2c255f)[_0x2aaa('0x22')](function(_0x4836b2){return _0x4836b2;});}return null;};}function removeEntity(_0x4d35aa,_0x19153e){return function(_0x4d7151){if(_0x4d7151){return _0x4d7151[_0x2aaa('0x23')]()[_0x2aaa('0x22')](function(){var _0x4e41ee=_0x4d7151[_0x2aaa('0x24')]({'plain':!![]});var _0x3b99d8='Tags';return db[_0x2aaa('0x25')][_0x2aaa('0x23')]({'where':{'type':_0x3b99d8,'resourceId':_0x4e41ee['id']}})[_0x2aaa('0x22')](function(){return _0x4d7151;});})['then'](function(){_0x4d35aa[_0x2aaa('0x17')](0xcc)[_0x2aaa('0x18')]();});}};}function handleEntityNotFound(_0x47a9fa,_0x565860){return function(_0x3af929){if(!_0x3af929){_0x47a9fa[_0x2aaa('0x16')](0x194);}return _0x3af929;};}function handleError(_0x2f9772,_0xd9891d){_0xd9891d=_0xd9891d||0x1f4;return function(_0x3a6a63){logger[_0x2aaa('0x26')](_0x3a6a63[_0x2aaa('0x27')]);if(_0x3a6a63[_0x2aaa('0x28')]){delete _0x3a6a63[_0x2aaa('0x28')];}_0x2f9772[_0x2aaa('0x17')](_0xd9891d)[_0x2aaa('0x29')](_0x3a6a63);};}exports[_0x2aaa('0x2a')]=function(_0x4f837f,_0x101b6e){var _0x5e29de={},_0xd6482a={},_0xb22a8d={'count':0x0,'rows':[]};var _0x3dd818=_[_0x2aaa('0x2b')](db[_0x2aaa('0x2c')][_0x2aaa('0x2d')],function(_0x436179){return{'name':_0x436179[_0x2aaa('0x2e')],'type':_0x436179[_0x2aaa('0x2f')][_0x2aaa('0x30')]};});_0xd6482a['model']=_['map'](_0x3dd818,'name');_0xd6482a['query']=_['keys'](_0x4f837f[_0x2aaa('0x31')]);_0xd6482a[_0x2aaa('0x32')]=_[_0x2aaa('0x33')](_0xd6482a[_0x2aaa('0x34')],_0xd6482a[_0x2aaa('0x31')]);_0x5e29de[_0x2aaa('0x35')]=_[_0x2aaa('0x33')](_0xd6482a[_0x2aaa('0x34')],qs['fields'](_0x4f837f[_0x2aaa('0x31')][_0x2aaa('0x36')]));_0x5e29de['attributes']=_0x5e29de[_0x2aaa('0x35')][_0x2aaa('0x37')]?_0x5e29de['attributes']:_0xd6482a[_0x2aaa('0x34')];if(!_0x4f837f[_0x2aaa('0x31')][_0x2aaa('0x38')](_0x2aaa('0x39'))){_0x5e29de[_0x2aaa('0x1c')]=qs[_0x2aaa('0x1c')](_0x4f837f[_0x2aaa('0x31')]['limit']);_0x5e29de['offset']=qs[_0x2aaa('0x1b')](_0x4f837f['query'][_0x2aaa('0x1b')]);}_0x5e29de[_0x2aaa('0x3a')]=qs['sort'](_0x4f837f[_0x2aaa('0x31')][_0x2aaa('0x3b')]);_0x5e29de[_0x2aaa('0x3c')]=qs['filters'](_[_0x2aaa('0x3d')](_0x4f837f[_0x2aaa('0x31')],_0xd6482a[_0x2aaa('0x32')]),_0x3dd818);if(_0x4f837f[_0x2aaa('0x31')]['filter']){_0x5e29de[_0x2aaa('0x3c')]=_[_0x2aaa('0x3e')](_0x5e29de[_0x2aaa('0x3c')],{'$or':_[_0x2aaa('0x2b')](_0x3dd818,function(_0x372cae){if(_0x372cae[_0x2aaa('0x2f')]!==_0x2aaa('0x3f')){var _0x1a7fbd={};_0x1a7fbd[_0x372cae[_0x2aaa('0x28')]]={'$like':'%'+_0x4f837f[_0x2aaa('0x31')][_0x2aaa('0x40')]+'%'};return _0x1a7fbd;}})});}_0x5e29de=_[_0x2aaa('0x3e')]({},_0x5e29de,_0x4f837f[_0x2aaa('0x41')]);var _0x54a9c8={'where':_0x5e29de[_0x2aaa('0x3c')]};return db[_0x2aaa('0x2c')][_0x2aaa('0x1a')](_0x54a9c8)['then'](function(_0x17042f){_0xb22a8d[_0x2aaa('0x1a')]=_0x17042f;if(_0x4f837f[_0x2aaa('0x31')]['includeAll']){_0x5e29de[_0x2aaa('0x42')]=[{'all':!![]}];}return db[_0x2aaa('0x2c')][_0x2aaa('0x43')](_0x5e29de);})['then'](function(_0x57554e){_0xb22a8d[_0x2aaa('0x44')]=_0x57554e;return _0xb22a8d;})[_0x2aaa('0x22')](respondWithFilteredResult(_0x101b6e,_0x5e29de))[_0x2aaa('0x45')](handleError(_0x101b6e,null));};exports['show']=function(_0x333786,_0x127a5a){var _0x2ec436={'raw':!![],'where':{'id':_0x333786[_0x2aaa('0x46')]['id']}},_0x2d639a={};_0x2d639a[_0x2aaa('0x34')]=_[_0x2aaa('0x47')](db[_0x2aaa('0x2c')]['rawAttributes']);_0x2d639a['query']=_[_0x2aaa('0x47')](_0x333786['query']);_0x2d639a[_0x2aaa('0x32')]=_['intersection'](_0x2d639a['model'],_0x2d639a['query']);_0x2ec436[_0x2aaa('0x35')]=_[_0x2aaa('0x33')](_0x2d639a['model'],qs[_0x2aaa('0x36')](_0x333786[_0x2aaa('0x31')]['fields']));_0x2ec436[_0x2aaa('0x35')]=_0x2ec436['attributes'][_0x2aaa('0x37')]?_0x2ec436[_0x2aaa('0x35')]:_0x2d639a['model'];if(_0x333786[_0x2aaa('0x31')][_0x2aaa('0x48')]){_0x2ec436[_0x2aaa('0x42')]=[{'all':!![]}];}_0x2ec436=_[_0x2aaa('0x3e')]({},_0x2ec436,_0x333786[_0x2aaa('0x41')]);return db['Tag']['find'](_0x2ec436)['then'](handleEntityNotFound(_0x127a5a,null))[_0x2aaa('0x22')](respondWithResult(_0x127a5a,null))[_0x2aaa('0x45')](handleError(_0x127a5a,null));};exports[_0x2aaa('0x49')]=function(_0x393073,_0x23290d){return db[_0x2aaa('0x2c')][_0x2aaa('0x49')](_0x393073[_0x2aaa('0x4a')],{})[_0x2aaa('0x22')](function(_0x54d9bb){var _0x22ccf0=_0x393073[_0x2aaa('0x4b')][_0x2aaa('0x24')]({'plain':!![]});if(!_0x22ccf0)throw new Error(_0x2aaa('0x4c'));if(_0x22ccf0['role']===_0x2aaa('0x4b')){var _0xe935c3=_0x54d9bb[_0x2aaa('0x24')]({'plain':!![]});var _0x5aeb05='Tags';return db[_0x2aaa('0x4d')][_0x2aaa('0x4e')]({'where':{'name':_0x5aeb05,'userProfileId':_0x22ccf0[_0x2aaa('0x4f')]},'raw':!![]})[_0x2aaa('0x22')](function(_0x4ca930){if(_0x4ca930&&_0x4ca930['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe935c3[_0x2aaa('0x28')],'resourceId':_0xe935c3['id'],'type':_0x4ca930[_0x2aaa('0x28')],'sectionId':_0x4ca930['id']},{})[_0x2aaa('0x22')](function(){return _0x54d9bb;});}else{return _0x54d9bb;}})['catch'](function(_0x1e690d){logger[_0x2aaa('0x26')](_0x2aaa('0x50'),_0x1e690d);throw _0x1e690d;});}return _0x54d9bb;})[_0x2aaa('0x22')](respondWithResult(_0x23290d,0xc9))[_0x2aaa('0x45')](handleError(_0x23290d,null));};exports[_0x2aaa('0x21')]=function(_0x1c74de,_0x5f3ebb){if(_0x1c74de[_0x2aaa('0x4a')]['id']){delete _0x1c74de['body']['id'];}return db['Tag'][_0x2aaa('0x4e')]({'where':{'id':_0x1c74de[_0x2aaa('0x46')]['id']}})[_0x2aaa('0x22')](handleEntityNotFound(_0x5f3ebb,null))[_0x2aaa('0x22')](saveUpdates(_0x1c74de[_0x2aaa('0x4a')],null))['then'](respondWithResult(_0x5f3ebb,null))[_0x2aaa('0x45')](handleError(_0x5f3ebb,null));};exports[_0x2aaa('0x23')]=function(_0x1a5d71,_0x2639f4){return db[_0x2aaa('0x2c')][_0x2aaa('0x4e')]({'where':{'id':_0x1a5d71[_0x2aaa('0x46')]['id']}})[_0x2aaa('0x22')](handleEntityNotFound(_0x2639f4,null))[_0x2aaa('0x22')](removeEntity(_0x2639f4,null))[_0x2aaa('0x45')](handleError(_0x2639f4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 4df4c8b..c9fbec1 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5270=['path','rimraf','../../config/environment','./tag.attributes','define','Tag','lodash','util','api','moment','bluebird'];(function(_0x26cdb1,_0x4a9fb5){var _0x324f8b=function(_0x1791d9){while(--_0x1791d9){_0x26cdb1['push'](_0x26cdb1['shift']());}};_0x324f8b(++_0x4a9fb5);}(_0x5270,0xab));var _0x0527=function(_0x38f1c4,_0x8f0dc2){_0x38f1c4=_0x38f1c4-0x0;var _0x9b851b=_0x5270[_0x38f1c4];return _0x9b851b;};'use strict';var _=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var logger=require('../../config/logger')(_0x0527('0x2'));var moment=require(_0x0527('0x3'));var BPromise=require(_0x0527('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0527('0x5'));var rimraf=require(_0x0527('0x6'));var config=require(_0x0527('0x7'));var attributes=require(_0x0527('0x8'));module['exports']=function(_0x3dd3b9,_0x3dd735){return _0x3dd3b9[_0x0527('0x9')](_0x0527('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45ec=['util','../../config/logger','request-promise','rimraf','../../config/environment','./tag.attributes','Tag'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x45ec,0xb6));var _0xc45e=function(_0x3fe572,_0x3434bc){_0x3fe572=_0x3fe572-0x0;var _0x423a62=_0x45ec[_0x3fe572];return _0x423a62;};'use strict';var _=require('lodash');var util=require(_0xc45e('0x0'));var logger=require(_0xc45e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc45e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc45e('0x3'));var config=require(_0xc45e('0x4'));var attributes=require(_0xc45e('0x5'));module['exports']=function(_0x23ea14,_0x2e7888){return _0x23ea14['define'](_0xc45e('0x6'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index c9e62e5..fdd45c8 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x509a47,_0x1261b4){var _0x153a78=function(_0x2311c6){while(--_0x2311c6){_0x509a47['push'](_0x509a47['shift']());}};_0x153a78(++_0x1261b4);}(_0x579c,0xda));var _0xc579=function(_0x5c453d,_0x9709d6){_0x5c453d=_0x5c453d-0x0;var _0x54ad43=_0x579c[_0x5c453d];return _0x54ad43;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});} \ No newline at end of file +var _0x3667=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15a312,_0x5f4895){var _0x139bf8=function(_0x4ca41d){while(--_0x4ca41d){_0x15a312['push'](_0x15a312['shift']());}};_0x139bf8(++_0x5f4895);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index d0a683e..bf67f55 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 705867c..792db28 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb7e7[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2cfe4d3..c75c70c 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d73=['Teams','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','removeQueues','remove','ids','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','upsert','isNil','interface','format','SIP/%s','all','removeAgents','isArray','Fax','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','name','send','map','Team','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x13d78a,_0x350865){var _0x5507c2=function(_0x28d31d){while(--_0x28d31d){_0x13d78a['push'](_0x13d78a['shift']());}};_0x5507c2(++_0x350865);}(_0x1d73,0x189));var _0x31d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1d73[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x31d7('0x0'));var rimraf=require(_0x31d7('0x1'));var zipdir=require(_0x31d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31d7('0x3'));var moment=require('moment');var BPromise=require(_0x31d7('0x4'));var Mustache=require('mustache');var util=require(_0x31d7('0x5'));var path=require(_0x31d7('0x6'));var sox=require('sox');var csv=require(_0x31d7('0x7'));var ejs=require(_0x31d7('0x8'));var fs=require('fs');var fs_extra=require(_0x31d7('0x9'));var _=require(_0x31d7('0xa'));var squel=require(_0x31d7('0xb'));var crypto=require('crypto');var jsforce=require(_0x31d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x31d7('0x7'));var querystring=require(_0x31d7('0xd'));var Papa=require(_0x31d7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31d7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d7('0x10'));var logger=require(_0x31d7('0x11'))('api');var utils=require(_0x31d7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x31d7('0x13'));var db=require(_0x31d7('0x14'))['db'];config[_0x31d7('0x15')]=_[_0x31d7('0x16')](config[_0x31d7('0x15')],{'host':_0x31d7('0x17'),'port':0x18eb});var socket=require(_0x31d7('0x18'))(new Redis(config[_0x31d7('0x15')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x27caf4,_0x302301){_0x302301=_0x302301||0xcc;return function(_0x4cd7ce){if(_0x4cd7ce){return _0x27caf4[_0x31d7('0x19')](_0x302301);}return _0x27caf4['status'](_0x302301)[_0x31d7('0x1a')]();};}function respondWithResult(_0x2e4676,_0x3b4608){_0x3b4608=_0x3b4608||0xc8;return function(_0x5a17de){if(_0x5a17de){return _0x2e4676[_0x31d7('0x1b')](_0x3b4608)[_0x31d7('0x1c')](_0x5a17de);}};}function respondWithFilteredResult(_0x385eb2,_0x40499f){return function(_0x2006e2){if(_0x2006e2){var _0x1cfcb8=typeof _0x40499f[_0x31d7('0x1d')]==='undefined'&&typeof _0x40499f[_0x31d7('0x1e')]===_0x31d7('0x1f');var _0x3ef2d5=_0x2006e2[_0x31d7('0x20')];var _0x1b3457=_0x1cfcb8?0x0:_0x40499f[_0x31d7('0x1d')];var _0x276951=_0x1cfcb8?_0x2006e2[_0x31d7('0x20')]:_0x40499f['offset']+_0x40499f[_0x31d7('0x1e')];var _0x45ece2;if(_0x276951>=_0x3ef2d5){_0x276951=_0x3ef2d5;_0x45ece2=0xc8;}else{_0x45ece2=0xce;}_0x385eb2[_0x31d7('0x1b')](_0x45ece2);return _0x385eb2[_0x31d7('0x21')](_0x31d7('0x22'),_0x1b3457+'-'+_0x276951+'/'+_0x3ef2d5)[_0x31d7('0x1c')](_0x2006e2);}return null;};}function patchUpdates(_0x193b05){return function(_0x31360e){try{jsonpatch[_0x31d7('0x23')](_0x31360e,_0x193b05,!![]);}catch(_0xeaa1f1){return BPromise[_0x31d7('0x24')](_0xeaa1f1);}return _0x31360e[_0x31d7('0x25')]();};}function saveUpdates(_0x5251a4,_0xe19121){return function(_0x3f50a5){if(_0x3f50a5){return _0x3f50a5[_0x31d7('0x26')](_0x5251a4)[_0x31d7('0x27')](function(_0x1fbbbd){return _0x1fbbbd;});}return null;};}function handleEntityNotFound(_0x15c626,_0x1c5d60){return function(_0x27ef88){if(!_0x27ef88){_0x15c626[_0x31d7('0x19')](0x194);}return _0x27ef88;};}function handleError(_0x57f234,_0x2b9fbc){_0x2b9fbc=_0x2b9fbc||0x1f4;return function(_0x37d38b){logger['error'](_0x37d38b['stack']);if(_0x37d38b[_0x31d7('0x28')]){delete _0x37d38b[_0x31d7('0x28')];}_0x57f234[_0x31d7('0x1b')](_0x2b9fbc)[_0x31d7('0x29')](_0x37d38b);};}exports['index']=function(_0x444bef,_0x4b7025){var _0x2fd1b5={},_0x1332d3={},_0x2bfd70={'count':0x0,'rows':[]};var _0x7ddc7a=_[_0x31d7('0x2a')](db[_0x31d7('0x2b')][_0x31d7('0x2c')],function(_0x5ebd05){return{'name':_0x5ebd05['fieldName'],'type':_0x5ebd05[_0x31d7('0x2d')][_0x31d7('0x2e')]};});_0x1332d3[_0x31d7('0x2f')]=_[_0x31d7('0x2a')](_0x7ddc7a,'name');_0x1332d3[_0x31d7('0x30')]=_[_0x31d7('0x31')](_0x444bef[_0x31d7('0x30')]);_0x1332d3[_0x31d7('0x32')]=_[_0x31d7('0x33')](_0x1332d3[_0x31d7('0x2f')],_0x1332d3[_0x31d7('0x30')]);_0x2fd1b5[_0x31d7('0x34')]=_[_0x31d7('0x33')](_0x1332d3[_0x31d7('0x2f')],qs['fields'](_0x444bef[_0x31d7('0x30')]['fields']));_0x2fd1b5[_0x31d7('0x34')]=_0x2fd1b5[_0x31d7('0x34')][_0x31d7('0x35')]?_0x2fd1b5['attributes']:_0x1332d3[_0x31d7('0x2f')];if(!_0x444bef[_0x31d7('0x30')][_0x31d7('0x36')](_0x31d7('0x37'))){_0x2fd1b5[_0x31d7('0x1e')]=qs[_0x31d7('0x1e')](_0x444bef[_0x31d7('0x30')]['limit']);_0x2fd1b5[_0x31d7('0x1d')]=qs[_0x31d7('0x1d')](_0x444bef['query'][_0x31d7('0x1d')]);}_0x2fd1b5[_0x31d7('0x38')]=qs['sort'](_0x444bef[_0x31d7('0x30')][_0x31d7('0x39')]);_0x2fd1b5[_0x31d7('0x3a')]=qs[_0x31d7('0x32')](_[_0x31d7('0x3b')](_0x444bef[_0x31d7('0x30')],_0x1332d3[_0x31d7('0x32')]),_0x7ddc7a);if(_0x444bef['query'][_0x31d7('0x3c')]){_0x2fd1b5[_0x31d7('0x3a')]=_['merge'](_0x2fd1b5[_0x31d7('0x3a')],{'$or':_[_0x31d7('0x2a')](_0x7ddc7a,function(_0x1e7f82){if(_0x1e7f82['type']!==_0x31d7('0x3d')){var _0x56d9a6={};_0x56d9a6[_0x1e7f82[_0x31d7('0x28')]]={'$like':'%'+_0x444bef[_0x31d7('0x30')][_0x31d7('0x3c')]+'%'};return _0x56d9a6;}})});}_0x2fd1b5=_['merge']({},_0x2fd1b5,_0x444bef[_0x31d7('0x3e')]);var _0xbfe5e8={'where':_0x2fd1b5[_0x31d7('0x3a')]};return db[_0x31d7('0x2b')][_0x31d7('0x20')](_0xbfe5e8)['then'](function(_0x12e2c9){_0x2bfd70[_0x31d7('0x20')]=_0x12e2c9;if(_0x444bef[_0x31d7('0x30')][_0x31d7('0x3f')]){_0x2fd1b5[_0x31d7('0x40')]=[{'all':!![]}];}return db[_0x31d7('0x2b')][_0x31d7('0x41')](_0x2fd1b5);})['then'](function(_0x3d674e){_0x2bfd70[_0x31d7('0x42')]=_0x3d674e;return _0x2bfd70;})[_0x31d7('0x27')](respondWithFilteredResult(_0x4b7025,_0x2fd1b5))[_0x31d7('0x43')](handleError(_0x4b7025,null));};exports['show']=function(_0x50dfa4,_0x111442){var _0x5e0294={'raw':![],'where':{'id':_0x50dfa4[_0x31d7('0x44')]['id']}},_0xa73601={};_0xa73601[_0x31d7('0x2f')]=_[_0x31d7('0x31')](db['Team'][_0x31d7('0x2c')]);_0xa73601['query']=_[_0x31d7('0x31')](_0x50dfa4[_0x31d7('0x30')]);_0xa73601[_0x31d7('0x32')]=_[_0x31d7('0x33')](_0xa73601[_0x31d7('0x2f')],_0xa73601[_0x31d7('0x30')]);_0x5e0294[_0x31d7('0x34')]=_[_0x31d7('0x33')](_0xa73601['model'],qs[_0x31d7('0x45')](_0x50dfa4[_0x31d7('0x30')][_0x31d7('0x45')]));_0x5e0294['attributes']=_0x5e0294[_0x31d7('0x34')][_0x31d7('0x35')]?_0x5e0294[_0x31d7('0x34')]:_0xa73601[_0x31d7('0x2f')];if(_0x50dfa4[_0x31d7('0x30')][_0x31d7('0x3f')]){_0x5e0294[_0x31d7('0x40')]=[{'all':!![]}];}_0x5e0294=_[_0x31d7('0x46')]({},_0x5e0294,_0x50dfa4['options']);return db['Team'][_0x31d7('0x47')](_0x5e0294)[_0x31d7('0x27')](handleEntityNotFound(_0x111442,null))[_0x31d7('0x27')](respondWithResult(_0x111442,null))[_0x31d7('0x43')](handleError(_0x111442,null));};exports[_0x31d7('0x48')]=function(_0x40bd7a,_0x44a105){return db['Team'][_0x31d7('0x48')](_0x40bd7a[_0x31d7('0x49')],{})[_0x31d7('0x27')](function(_0x4b46b2){var _0x10cb83=_0x40bd7a[_0x31d7('0x4a')][_0x31d7('0x4b')]({'plain':!![]});if(!_0x10cb83)throw new Error(_0x31d7('0x4c'));if(_0x10cb83[_0x31d7('0x4d')]===_0x31d7('0x4a')){var _0x1d81e3=_0x4b46b2[_0x31d7('0x4b')]({'plain':!![]});var _0x3fb69e=_0x31d7('0x4e');return db[_0x31d7('0x4f')]['find']({'where':{'name':_0x3fb69e,'userProfileId':_0x10cb83['userProfileId']},'raw':!![]})[_0x31d7('0x27')](function(_0x1e58ec){if(_0x1e58ec&&_0x1e58ec[_0x31d7('0x50')]===0x0){return db[_0x31d7('0x51')][_0x31d7('0x48')]({'name':_0x1d81e3[_0x31d7('0x28')],'resourceId':_0x1d81e3['id'],'type':_0x1e58ec[_0x31d7('0x28')],'sectionId':_0x1e58ec['id']},{})[_0x31d7('0x27')](function(){return _0x4b46b2;});}else{return _0x4b46b2;}})['catch'](function(_0x139ff0){logger[_0x31d7('0x52')](_0x31d7('0x53'),_0x139ff0);throw _0x139ff0;});}return _0x4b46b2;})[_0x31d7('0x27')](respondWithResult(_0x44a105,0xc9))[_0x31d7('0x43')](handleError(_0x44a105,null));};exports[_0x31d7('0x26')]=function(_0x54e419,_0x4ac731){if(_0x54e419['body']['id']){delete _0x54e419[_0x31d7('0x49')]['id'];}return db['Team'][_0x31d7('0x47')]({'where':{'id':_0x54e419[_0x31d7('0x44')]['id']}})[_0x31d7('0x27')](handleEntityNotFound(_0x4ac731,null))[_0x31d7('0x27')](saveUpdates(_0x54e419[_0x31d7('0x49')],null))['then'](respondWithResult(_0x4ac731,null))[_0x31d7('0x43')](handleError(_0x4ac731,null));};exports[_0x31d7('0x54')]=function(_0x5d2197,_0x17d27b){var _0xa9233a=_0x5d2197['params']['id'];var _0x485229=[];return db[_0x31d7('0x55')][_0x31d7('0x56')](function(_0x3c5575){var _0x4714e6=_0x31d7('0x57')+_0xa9233a;return db['sequelize'][_0x31d7('0x30')](_0x4714e6,{'type':db[_0x31d7('0x58')]['QueryTypes'][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575})['then'](function(_0x5667e4){_0x485229=_[_0x31d7('0x2a')](_0x5667e4,function(_0x479a2a){return Number(_0x479a2a[_0x31d7('0x5a')]);});})[_0x31d7('0x27')](function(){var _0x4bbff7=_0x31d7('0x5b')+_0xa9233a;return db[_0x31d7('0x55')][_0x31d7('0x30')](_0x4bbff7,{'type':db['Sequelize'][_0x31d7('0x5c')][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575});})[_0x31d7('0x27')](function(_0x5ca0dc){var _0x4f8df3=_[_0x31d7('0x2a')](_0x5ca0dc,function(_0x76a2a5){return Number(_0x76a2a5[_0x31d7('0x5d')]);});return db[_0x31d7('0x5e')][_0x31d7('0x54')]({'where':{'UserId':{'$in':_0x485229},'VoiceQueueId':{'$in':_0x4f8df3}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){var _0x22c5c0=_0x31d7('0x5f')+_0xa9233a;return db[_0x31d7('0x55')][_0x31d7('0x30')](_0x22c5c0,{'type':db[_0x31d7('0x58')][_0x31d7('0x5c')][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575});})['then'](function(_0x581ac4){var _0x2a337a=_[_0x31d7('0x2a')](_0x581ac4,function(_0x15c237){return Number(_0x15c237[_0x31d7('0x60')]);});return db[_0x31d7('0x61')]['destroy']({'where':{'UserId':{'$in':_0x485229},'MailQueueId':{'$in':_0x2a337a}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){var _0x1d3d46=_0x31d7('0x62')+_0xa9233a;return db[_0x31d7('0x55')][_0x31d7('0x30')](_0x1d3d46,{'type':db['Sequelize'][_0x31d7('0x5c')]['SELECT'],'raw':!![],'transaction':_0x3c5575});})['then'](function(_0x5132b4){var _0xc62f50=_['map'](_0x5132b4,function(_0x3fae05){return Number(_0x3fae05[_0x31d7('0x63')]);});return db['UserSmsQueue'][_0x31d7('0x54')]({'where':{'UserId':{'$in':_0x485229},'SmsQueueId':{'$in':_0xc62f50}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){var _0x4865c4=_0x31d7('0x64')+_0xa9233a;return db[_0x31d7('0x55')]['query'](_0x4865c4,{'type':db['Sequelize']['QueryTypes'][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575});})[_0x31d7('0x27')](function(_0x17228b){var _0x2ca17c=_[_0x31d7('0x2a')](_0x17228b,function(_0x30ca25){return Number(_0x30ca25[_0x31d7('0x65')]);});return db[_0x31d7('0x66')][_0x31d7('0x54')]({'where':{'UserId':{'$in':_0x485229},'ChatQueueId':{'$in':_0x2ca17c}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){var _0x97cb81=_0x31d7('0x67')+_0xa9233a;return db[_0x31d7('0x55')][_0x31d7('0x30')](_0x97cb81,{'type':db[_0x31d7('0x58')][_0x31d7('0x5c')]['SELECT'],'raw':!![],'transaction':_0x3c5575});})[_0x31d7('0x27')](function(_0x2844ee){var _0x52b9ec=_[_0x31d7('0x2a')](_0x2844ee,function(_0x476e49){return Number(_0x476e49[_0x31d7('0x68')]);});return db[_0x31d7('0x69')][_0x31d7('0x54')]({'where':{'UserId':{'$in':_0x485229},'FaxQueueId':{'$in':_0x52b9ec}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){var _0x16b6f6='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa9233a;return db[_0x31d7('0x55')][_0x31d7('0x30')](_0x16b6f6,{'type':db['Sequelize'][_0x31d7('0x5c')][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575});})['then'](function(_0x25f55a){var _0x4fcd22=_['map'](_0x25f55a,function(_0x3e4112){return Number(_0x3e4112[_0x31d7('0x6a')]);});return db[_0x31d7('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x485229},'OpenchannelQueueId':{'$in':_0x4fcd22}},'transaction':_0x3c5575});})['then'](function(){var _0x403fa1=_0x31d7('0x6c')+_0xa9233a;return db['sequelize'][_0x31d7('0x30')](_0x403fa1,{'type':db['Sequelize'][_0x31d7('0x5c')][_0x31d7('0x59')],'raw':!![],'transaction':_0x3c5575});})[_0x31d7('0x27')](function(_0x431217){var _0x3a4b4e=_[_0x31d7('0x2a')](_0x431217,function(_0x1890de){return Number(_0x1890de[_0x31d7('0x6d')]);});return db[_0x31d7('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x485229},'WhatsappQueueId':{'$in':_0x3a4b4e}},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){return db[_0x31d7('0x6f')][_0x31d7('0x47')]({'where':{'TeamId':_0xa9233a}});})[_0x31d7('0x27')](function(_0x8f4721){if(_0x8f4721===null){return;}return db[_0x31d7('0x70')][_0x31d7('0x54')]({'where':{'UserId':{'$in':_0x485229},'VoicePrefixId':_0x8f4721[_0x31d7('0x71')]},'transaction':_0x3c5575});})[_0x31d7('0x27')](function(){return db[_0x31d7('0x2b')]['destroy']({'where':{'id':_0xa9233a},'cascade':!![],'transaction':_0x3c5575});})[_0x31d7('0x27')](function(_0x28173e){if(_0x28173e===0x0){_0x17d27b[_0x31d7('0x19')](0x194);}else{return db[_0x31d7('0x51')][_0x31d7('0x54')]({'where':{'type':'Teams','resourceId':_0xa9233a},'cascade':!![],'transaction':_0x3c5575})[_0x31d7('0x27')](function(){_0x17d27b['status'](0xcc)[_0x31d7('0x1a')]();});}})[_0x31d7('0x43')](function(_0x1d5daa){_0x17d27b[_0x31d7('0x1b')](0x1f4)[_0x31d7('0x29')](_0x1d5daa);});});};exports[_0x31d7('0x72')]=function(_0x3616c5,_0xd5fc84,_0x157db4){return db[_0x31d7('0x2b')][_0x31d7('0x73')]({'where':{'id':_0x3616c5['params']['id']}})[_0x31d7('0x27')](handleEntityNotFound(_0xd5fc84,null))[_0x31d7('0x27')](function(_0x199248){if(!_0x3616c5[_0x31d7('0x30')]['channel']||!utils[_0x31d7('0x74')](_0x3616c5['query'][_0x31d7('0x75')])){throw new db[(_0x31d7('0x58'))][(_0x31d7('0x76'))](_0x31d7('0x77'));}var _0x178fd9={};var _0x1f87d2={};_0x1f87d2['model']=_[_0x31d7('0x31')](db[_[_0x31d7('0x78')](_0x3616c5[_0x31d7('0x30')][_0x31d7('0x75')][_0x31d7('0x79')]())+_0x31d7('0x7a')]['rawAttributes']);_0x1f87d2[_0x31d7('0x30')]=_[_0x31d7('0x31')](_0x3616c5[_0x31d7('0x30')]);_0x1f87d2[_0x31d7('0x32')]=_[_0x31d7('0x33')](_0x1f87d2[_0x31d7('0x2f')],_0x1f87d2[_0x31d7('0x30')]);_0x178fd9['attributes']=_[_0x31d7('0x33')](_0x1f87d2[_0x31d7('0x2f')],qs[_0x31d7('0x45')](_0x3616c5[_0x31d7('0x30')]['fields']));_0x178fd9[_0x31d7('0x34')]=_0x178fd9['attributes'][_0x31d7('0x35')]?_0x178fd9[_0x31d7('0x34')]:_0x1f87d2[_0x31d7('0x2f')];_0x178fd9[_0x31d7('0x1e')]=qs[_0x31d7('0x1e')](_0x3616c5[_0x31d7('0x30')]['limit']);_0x178fd9[_0x31d7('0x1d')]=qs[_0x31d7('0x1d')](_0x3616c5[_0x31d7('0x30')][_0x31d7('0x1d')]);_0x178fd9[_0x31d7('0x38')]=qs['sort'](_0x3616c5['query']['sort']);_0x178fd9['where']=qs[_0x31d7('0x32')](_[_0x31d7('0x3b')](_0x3616c5[_0x31d7('0x30')],_0x1f87d2[_0x31d7('0x32')]));_0x178fd9=_[_0x31d7('0x46')]({},_0x178fd9,_0x3616c5[_0x31d7('0x3e')]);return _0x199248[_0x31d7('0x4b')+_[_0x31d7('0x78')](_0x3616c5[_0x31d7('0x30')]['channel']['toLowerCase']())+_0x31d7('0x7b')](_0x178fd9);})[_0x31d7('0x27')](respondWithResult(_0xd5fc84,null))[_0x31d7('0x43')](handleError(_0xd5fc84,null));};exports[_0x31d7('0x7c')]=function(_0xd83ab8,_0x4f6f17,_0x5334a4){return db[_0x31d7('0x2b')][_0x31d7('0x73')]({'where':{'id':_0xd83ab8['params']['id']}})[_0x31d7('0x27')](function(_0x2c3e75){if(_0x2c3e75){if(!_0xd83ab8[_0x31d7('0x49')][_0x31d7('0x75')]||!utils['isValidChannel'](_0xd83ab8[_0x31d7('0x49')][_0x31d7('0x75')])){throw new db[(_0x31d7('0x58'))][(_0x31d7('0x76'))]('Unknown\x20channel');}return _0x2c3e75[_0x31d7('0x7d')+_['capitalize'](_0xd83ab8[_0x31d7('0x49')][_0x31d7('0x75')][_0x31d7('0x79')]())+_0x31d7('0x7b')](_0xd83ab8[_0x31d7('0x49')]['ids']);}return null;})['then'](handleEntityNotFound(_0x4f6f17,null))['then'](respondWithStatusCode(_0x4f6f17,null))['catch'](handleError(_0x4f6f17,null));};exports[_0x31d7('0x7e')]=function(_0x4c6e8d,_0x33d8b3,_0x5a50f2){return db['Team'][_0x31d7('0x73')]({'where':{'id':_0x4c6e8d['params']['id']}})['then'](function(_0xad2535){if(_0xad2535){if(!_0x4c6e8d['query'][_0x31d7('0x75')]||!utils[_0x31d7('0x74')](_0x4c6e8d[_0x31d7('0x30')][_0x31d7('0x75')])){throw new db[(_0x31d7('0x58'))][(_0x31d7('0x76'))](_0x31d7('0x77'));}return _0xad2535[_0x31d7('0x7f')+_['capitalize'](_0x4c6e8d[_0x31d7('0x30')][_0x31d7('0x75')][_0x31d7('0x79')]())+_0x31d7('0x7b')](_0x4c6e8d[_0x31d7('0x30')][_0x31d7('0x80')]);}return null;})[_0x31d7('0x27')](handleEntityNotFound(_0x33d8b3,null))['then'](respondWithStatusCode(_0x33d8b3,null))['catch'](handleError(_0x33d8b3,null));};exports[_0x31d7('0x81')]=function(_0x2c3ecb,_0x45ddc6){var _0x5911d9=_['isArray'](_0x2c3ecb[_0x31d7('0x49')][_0x31d7('0x80')])?_0x2c3ecb[_0x31d7('0x49')][_0x31d7('0x80')]:[_0x2c3ecb[_0x31d7('0x49')][_0x31d7('0x80')]];var _0x2c390e=_0x2c3ecb[_0x31d7('0x44')]['id'];return db[_0x31d7('0x2b')][_0x31d7('0x47')]({'where':{'id':_0x2c390e}})[_0x31d7('0x27')](handleEntityNotFound(_0x45ddc6,null))[_0x31d7('0x27')](function(_0x29abb2){if(_0x29abb2){var _0x3f4175=[_0x31d7('0x82'),_0x31d7('0x83'),_0x31d7('0x84'),_0x31d7('0x85'),'Fax',_0x31d7('0x86'),_0x31d7('0x87')];return db[_0x31d7('0x55')][_0x31d7('0x56')](function(_0x37fcb4){var _0x2c64d0=_[_0x31d7('0x2a')](_0x3f4175,function(_0x228799){var _0x1611d3={'attributes':['id',_0x31d7('0x28')]};if(_0x228799===_0x31d7('0x82')){_0x1611d3[_0x31d7('0x88')]={'attributes':[_0x31d7('0x89')]};}return _0x29abb2['get'+_0x228799+'Queues'](_0x1611d3)[_0x31d7('0x27')](function(_0x596c09){var _0x30b927=_[_0x31d7('0x2a')](_0x596c09,function(_0x5ec168){var _0x455cf9=_[_0x31d7('0x2a')](_0x5911d9,function(_0xad1a75){var _0x1ed455={'where':{'UserId':_0xad1a75,[_0x228799+_0x31d7('0x8a')]:_0x5ec168['id']},'transaction':_0x37fcb4};if(_0x228799===_0x31d7('0x82')){_0x1ed455['defaults']={'penalty':_0x5ec168[_0x31d7('0x8b')][_0x31d7('0x89')]};}return db[_0x31d7('0x8c')+_0x228799+_0x31d7('0x7a')][_0x31d7('0x8d')](_0x1ed455)[_0x31d7('0x27')](function(){socket[_0x31d7('0x8e')]('user'+_0x228799+_0x31d7('0x8f'),{'UserId':_0xad1a75,[_0x228799+'QueueId']:_0x5ec168['id']});if(_0x228799!==_0x31d7('0x82')){return;}return db[_0x31d7('0x8c')][_0x31d7('0x41')]({'where':{'id':_0x5911d9,'online':0x1},'attributes':['id','name',_0x31d7('0x90'),_0x31d7('0x91'),'interface'],'raw':!![]})[_0x31d7('0x27')](function(_0x47b81d){var _0x50568b=_[_0x31d7('0x2a')](_0x47b81d,function(_0x3b09c9){return db['UserVoiceQueueRt'][_0x31d7('0x92')]({'membername':_0x3b09c9['name'],'UserId':_0x3b09c9['id'],'queue_name':_0x5ec168[_0x31d7('0x28')],'VoiceQueueId':_0x5ec168['id'],'interface':_[_0x31d7('0x93')](_0x3b09c9[_0x31d7('0x94')])?util[_0x31d7('0x95')](_0x31d7('0x96'),_0x3b09c9[_0x31d7('0x28')]):_0x3b09c9[_0x31d7('0x94')],'paused':_0x3b09c9[_0x31d7('0x91')]||![],'penalty':_0x5ec168[_0x31d7('0x8b')]['penalty']},{'transaction':_0x37fcb4});});return Promise[_0x31d7('0x97')](_0x50568b);});});});return Promise[_0x31d7('0x97')](_0x455cf9);});return Promise['all'](_0x30b927);})[_0x31d7('0x27')](function(){return db[_0x31d7('0x6f')]['findOne']({'where':{'teamId':_0x2c390e}})[_0x31d7('0x27')](function(_0x2d8484){if(_0x2d8484){var _0x598b72=_[_0x31d7('0x2a')](_0x5911d9,function(_0x541b40){db[_0x31d7('0x70')][_0x31d7('0x92')]({'UserId':_0x541b40,'VoicePrefixId':_0x2d8484['VoicePrefixId']});});return Promise[_0x31d7('0x97')](_0x598b72);}});});});return Promise[_0x31d7('0x97')](_0x2c64d0)['then'](function(){return _0x29abb2[_0x31d7('0x81')](_0x5911d9,{'transaction':_0x37fcb4})['spread'](function(_0xe30765){return _0xe30765;});});});}})[_0x31d7('0x27')](respondWithResult(_0x45ddc6,null))['catch'](handleError(_0x45ddc6,null));};exports[_0x31d7('0x98')]=function(_0x16dec6,_0x45f992){var _0x31dee0=_[_0x31d7('0x99')](_0x16dec6[_0x31d7('0x30')][_0x31d7('0x80')])?_0x16dec6[_0x31d7('0x30')][_0x31d7('0x80')]:[_0x16dec6['query'][_0x31d7('0x80')]];var _0x4d3acf=_0x16dec6[_0x31d7('0x44')]['id'];return db[_0x31d7('0x2b')][_0x31d7('0x47')]({'where':{'id':_0x4d3acf}})[_0x31d7('0x27')](handleEntityNotFound(_0x45f992,null))['then'](function(_0x5eb890){if(_0x5eb890){var _0x575169=[_0x31d7('0x82'),_0x31d7('0x83'),'Mail','Sms',_0x31d7('0x9a'),_0x31d7('0x86'),_0x31d7('0x87')];return db['sequelize']['transaction'](function(_0x158ab9){var _0x9a1b13=_['map'](_0x575169,function(_0x2891e1){var _0x5d6f06={'attributes':['id',_0x31d7('0x28')]};return _0x5eb890[_0x31d7('0x4b')+_0x2891e1+'Queues'](_0x5d6f06)[_0x31d7('0x27')](function(_0x40c813){var _0x38ef86=_[_0x31d7('0x2a')](_0x40c813,function(_0x10a0b5){return _0x10a0b5['removeAgents'](_0x31dee0,{'transaction':_0x158ab9})['then'](function(){var _0x481a2e=_[_0x31d7('0x2a')](_0x31dee0,function(_0x2719bf){socket[_0x31d7('0x8e')]('user'+_0x2891e1+'Queue:remove',{'UserId':Number(_0x2719bf),[_0x2891e1+_0x31d7('0x8a')]:_0x10a0b5['id']});if(_0x2891e1!==_0x31d7('0x82')){return;}return db[_0x31d7('0x9b')][_0x31d7('0x54')]({'where':{'VoiceQueueId':_0x10a0b5['id'],'UserId':_0x2719bf},'transaction':_0x158ab9});});return Promise['all'](_0x481a2e);});});return Promise['all'](_0x38ef86);});});return Promise['all'](_0x9a1b13)['then'](function(){return _0x5eb890['removeAgents'](_0x31dee0,{'transaction':_0x158ab9});})[_0x31d7('0x27')](function(){return db[_0x31d7('0x6f')][_0x31d7('0x73')]({'where':{'teamId':_0x4d3acf}})['then'](function(_0x258c46){if(_0x258c46){var _0x243664=_[_0x31d7('0x2a')](_0x31dee0,function(_0x34b490){db[_0x31d7('0x70')][_0x31d7('0x54')]({'where':{'UserId':_0x34b490,'VoicePrefixId':_0x258c46[_0x31d7('0x71')]}});});return Promise[_0x31d7('0x97')](_0x243664);}});});});}})['then'](respondWithStatusCode(_0x45f992,null))[_0x31d7('0x43')](handleError(_0x45f992,null));};exports[_0x31d7('0x9c')]=function(_0x3925ac,_0x104660,_0xa4e70c){var _0x3c73f2={};var _0xa339ad={};var _0x182a61;var _0x4c18bd;return db[_0x31d7('0x2b')][_0x31d7('0x73')]({'where':{'id':_0x3925ac[_0x31d7('0x44')]['id']}})[_0x31d7('0x27')](handleEntityNotFound(_0x104660,null))[_0x31d7('0x27')](function(_0xfb2b1d){if(_0xfb2b1d){_0x182a61=_0xfb2b1d;_0xa339ad[_0x31d7('0x2f')]=_[_0x31d7('0x31')](db[_0x31d7('0x8c')][_0x31d7('0x2c')]);_0xa339ad[_0x31d7('0x30')]=_[_0x31d7('0x31')](_0x3925ac[_0x31d7('0x30')]);_0xa339ad[_0x31d7('0x32')]=_[_0x31d7('0x33')](_0xa339ad[_0x31d7('0x2f')],_0xa339ad[_0x31d7('0x30')]);_0x3c73f2[_0x31d7('0x34')]=_['intersection'](_0xa339ad[_0x31d7('0x2f')],qs[_0x31d7('0x45')](_0x3925ac['query'][_0x31d7('0x45')]));_0x3c73f2[_0x31d7('0x34')]=_0x3c73f2['attributes']['length']?_0x3c73f2['attributes']:_0xa339ad[_0x31d7('0x2f')];_0x3c73f2[_0x31d7('0x38')]=qs[_0x31d7('0x39')](_0x3925ac[_0x31d7('0x30')][_0x31d7('0x39')]);_0x3c73f2['where']=qs[_0x31d7('0x32')](_[_0x31d7('0x3b')](_0x3925ac[_0x31d7('0x30')],_0xa339ad['filters']));if(_0x3925ac[_0x31d7('0x30')][_0x31d7('0x3c')]){_0x3c73f2[_0x31d7('0x3a')]=_['merge'](_0x3c73f2[_0x31d7('0x3a')],{'$or':_[_0x31d7('0x2a')](_0x3c73f2['attributes'],function(_0xdd60e8){var _0x589b52={};_0x589b52[_0xdd60e8]={'$like':'%'+_0x3925ac[_0x31d7('0x30')]['filter']+'%'};return _0x589b52;})});}_0x3c73f2=_[_0x31d7('0x46')]({},_0x3c73f2,_0x3925ac[_0x31d7('0x3e')]);return _0x182a61[_0x31d7('0x9c')](_0x3c73f2);}})[_0x31d7('0x27')](function(_0x3694b9){if(_0x3694b9){_0x4c18bd=_0x3694b9[_0x31d7('0x35')];if(!_0x3925ac[_0x31d7('0x30')][_0x31d7('0x36')]('nolimit')){_0x3c73f2[_0x31d7('0x1e')]=qs[_0x31d7('0x1e')](_0x3925ac[_0x31d7('0x30')][_0x31d7('0x1e')]);_0x3c73f2[_0x31d7('0x1d')]=qs[_0x31d7('0x1d')](_0x3925ac[_0x31d7('0x30')][_0x31d7('0x1d')]);}return _0x182a61[_0x31d7('0x9c')](_0x3c73f2);}})[_0x31d7('0x27')](function(_0x767473){if(_0x767473){return _0x767473?{'count':_0x4c18bd,'rows':_0x767473}:null;}})[_0x31d7('0x27')](respondWithResult(_0x104660,null))[_0x31d7('0x43')](handleError(_0x104660,null));}; \ No newline at end of file +var _0x3c42=['SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','length','capitalize','Queues','addQueues','add','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','through','QueueId','TeamVoiceQueue','penalty','findOrCreate','emit','User','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','Fax','Whatsapp','Queue:remove','getAgents','order','nolimit','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','Team','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','keys','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','transaction'];(function(_0x27ac2a,_0x41af30){var _0x41318b=function(_0x4eeeb4){while(--_0x4eeeb4){_0x27ac2a['push'](_0x27ac2a['shift']());}};_0x41318b(++_0x41af30);}(_0x3c42,0xda));var _0x23c4=function(_0x3c15e8,_0x40a976){_0x3c15e8=_0x3c15e8-0x0;var _0x562408=_0x3c42[_0x3c15e8];return _0x562408;};'use strict';var emlformat=require(_0x23c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23c4('0x1'));var jsonpatch=require(_0x23c4('0x2'));var rp=require('request-promise');var moment=require(_0x23c4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x23c4('0x4'));var util=require(_0x23c4('0x5'));var path=require(_0x23c4('0x6'));var sox=require(_0x23c4('0x7'));var csv=require(_0x23c4('0x8'));var ejs=require(_0x23c4('0x9'));var fs=require('fs');var fs_extra=require(_0x23c4('0xa'));var _=require(_0x23c4('0xb'));var squel=require(_0x23c4('0xc'));var crypto=require('crypto');var jsforce=require(_0x23c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x23c4('0x8'));var querystring=require(_0x23c4('0xe'));var Papa=require(_0x23c4('0xf'));var Redis=require(_0x23c4('0x10'));var authService=require(_0x23c4('0x11'));var qs=require(_0x23c4('0x12'));var as=require(_0x23c4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x23c4('0x14'))('api');var utils=require(_0x23c4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x23c4('0x16'));var db=require('../../mysqldb')['db'];config[_0x23c4('0x17')]=_[_0x23c4('0x18')](config[_0x23c4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x23c4('0x19'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x5d1a03,_0x206690){_0x206690=_0x206690||0xcc;return function(_0x4cd053){if(_0x4cd053){return _0x5d1a03[_0x23c4('0x1a')](_0x206690);}return _0x5d1a03[_0x23c4('0x1b')](_0x206690)[_0x23c4('0x1c')]();};}function respondWithResult(_0x535fb7,_0x2297d0){_0x2297d0=_0x2297d0||0xc8;return function(_0x337a5b){if(_0x337a5b){return _0x535fb7['status'](_0x2297d0)['json'](_0x337a5b);}};}function respondWithFilteredResult(_0x137803,_0x5bcd16){return function(_0x5086a6){if(_0x5086a6){var _0x2a5c50=typeof _0x5bcd16[_0x23c4('0x1d')]===_0x23c4('0x1e')&&typeof _0x5bcd16[_0x23c4('0x1f')]===_0x23c4('0x1e');var _0x1cbdeb=_0x5086a6[_0x23c4('0x20')];var _0x119ac6=_0x2a5c50?0x0:_0x5bcd16[_0x23c4('0x1d')];var _0x1a3e03=_0x2a5c50?_0x5086a6[_0x23c4('0x20')]:_0x5bcd16[_0x23c4('0x1d')]+_0x5bcd16[_0x23c4('0x1f')];var _0x5c65b5;if(_0x1a3e03>=_0x1cbdeb){_0x1a3e03=_0x1cbdeb;_0x5c65b5=0xc8;}else{_0x5c65b5=0xce;}_0x137803[_0x23c4('0x1b')](_0x5c65b5);return _0x137803['set'](_0x23c4('0x21'),_0x119ac6+'-'+_0x1a3e03+'/'+_0x1cbdeb)[_0x23c4('0x22')](_0x5086a6);}return null;};}function patchUpdates(_0x413ab7){return function(_0x2b3516){try{jsonpatch[_0x23c4('0x23')](_0x2b3516,_0x413ab7,!![]);}catch(_0x3f4d06){return BPromise[_0x23c4('0x24')](_0x3f4d06);}return _0x2b3516[_0x23c4('0x25')]();};}function saveUpdates(_0xd96d39,_0x10a886){return function(_0x311f31){if(_0x311f31){return _0x311f31[_0x23c4('0x26')](_0xd96d39)[_0x23c4('0x27')](function(_0x1862c3){return _0x1862c3;});}return null;};}function handleEntityNotFound(_0xb44c4f,_0x2825ec){return function(_0xcdd992){if(!_0xcdd992){_0xb44c4f[_0x23c4('0x1a')](0x194);}return _0xcdd992;};}function handleError(_0x36f4be,_0x4b0429){_0x4b0429=_0x4b0429||0x1f4;return function(_0x205bd6){logger[_0x23c4('0x28')](_0x205bd6[_0x23c4('0x29')]);if(_0x205bd6[_0x23c4('0x2a')]){delete _0x205bd6['name'];}_0x36f4be[_0x23c4('0x1b')](_0x4b0429)[_0x23c4('0x2b')](_0x205bd6);};}exports['index']=function(_0x560c57,_0x3e4372){var _0xc5a78f={},_0x17d15d={},_0x4101cc={'count':0x0,'rows':[]};var _0x4665ff=_[_0x23c4('0x2c')](db[_0x23c4('0x2d')]['rawAttributes'],function(_0xd6c41c){return{'name':_0xd6c41c['fieldName'],'type':_0xd6c41c[_0x23c4('0x2e')][_0x23c4('0x2f')]};});_0x17d15d[_0x23c4('0x30')]=_[_0x23c4('0x2c')](_0x4665ff,_0x23c4('0x2a'));_0x17d15d[_0x23c4('0x31')]=_['keys'](_0x560c57[_0x23c4('0x31')]);_0x17d15d[_0x23c4('0x32')]=_['intersection'](_0x17d15d[_0x23c4('0x30')],_0x17d15d[_0x23c4('0x31')]);_0xc5a78f[_0x23c4('0x33')]=_[_0x23c4('0x34')](_0x17d15d[_0x23c4('0x30')],qs[_0x23c4('0x35')](_0x560c57[_0x23c4('0x31')][_0x23c4('0x35')]));_0xc5a78f['attributes']=_0xc5a78f[_0x23c4('0x33')]['length']?_0xc5a78f[_0x23c4('0x33')]:_0x17d15d[_0x23c4('0x30')];if(!_0x560c57['query'][_0x23c4('0x36')]('nolimit')){_0xc5a78f[_0x23c4('0x1f')]=qs[_0x23c4('0x1f')](_0x560c57['query'][_0x23c4('0x1f')]);_0xc5a78f[_0x23c4('0x1d')]=qs[_0x23c4('0x1d')](_0x560c57[_0x23c4('0x31')][_0x23c4('0x1d')]);}_0xc5a78f['order']=qs['sort'](_0x560c57[_0x23c4('0x31')][_0x23c4('0x37')]);_0xc5a78f[_0x23c4('0x38')]=qs[_0x23c4('0x32')](_[_0x23c4('0x39')](_0x560c57[_0x23c4('0x31')],_0x17d15d[_0x23c4('0x32')]),_0x4665ff);if(_0x560c57[_0x23c4('0x31')][_0x23c4('0x3a')]){_0xc5a78f[_0x23c4('0x38')]=_['merge'](_0xc5a78f['where'],{'$or':_[_0x23c4('0x2c')](_0x4665ff,function(_0x5c2fcc){if(_0x5c2fcc[_0x23c4('0x2e')]!==_0x23c4('0x3b')){var _0x4738be={};_0x4738be[_0x5c2fcc[_0x23c4('0x2a')]]={'$like':'%'+_0x560c57[_0x23c4('0x31')]['filter']+'%'};return _0x4738be;}})});}_0xc5a78f=_[_0x23c4('0x3c')]({},_0xc5a78f,_0x560c57[_0x23c4('0x3d')]);var _0xba21e1={'where':_0xc5a78f['where']};return db[_0x23c4('0x2d')][_0x23c4('0x20')](_0xba21e1)[_0x23c4('0x27')](function(_0x2edfe3){_0x4101cc[_0x23c4('0x20')]=_0x2edfe3;if(_0x560c57[_0x23c4('0x31')][_0x23c4('0x3e')]){_0xc5a78f['include']=[{'all':!![]}];}return db['Team'][_0x23c4('0x3f')](_0xc5a78f);})[_0x23c4('0x27')](function(_0x4a2d7a){_0x4101cc[_0x23c4('0x40')]=_0x4a2d7a;return _0x4101cc;})[_0x23c4('0x27')](respondWithFilteredResult(_0x3e4372,_0xc5a78f))['catch'](handleError(_0x3e4372,null));};exports[_0x23c4('0x41')]=function(_0x2b288e,_0x142568){var _0x9b52b9={'raw':![],'where':{'id':_0x2b288e['params']['id']}},_0x2bab5f={};_0x2bab5f['model']=_[_0x23c4('0x42')](db[_0x23c4('0x2d')][_0x23c4('0x43')]);_0x2bab5f[_0x23c4('0x31')]=_[_0x23c4('0x42')](_0x2b288e[_0x23c4('0x31')]);_0x2bab5f['filters']=_[_0x23c4('0x34')](_0x2bab5f[_0x23c4('0x30')],_0x2bab5f['query']);_0x9b52b9['attributes']=_[_0x23c4('0x34')](_0x2bab5f[_0x23c4('0x30')],qs[_0x23c4('0x35')](_0x2b288e['query'][_0x23c4('0x35')]));_0x9b52b9[_0x23c4('0x33')]=_0x9b52b9[_0x23c4('0x33')]['length']?_0x9b52b9[_0x23c4('0x33')]:_0x2bab5f[_0x23c4('0x30')];if(_0x2b288e[_0x23c4('0x31')][_0x23c4('0x3e')]){_0x9b52b9['include']=[{'all':!![]}];}_0x9b52b9=_['merge']({},_0x9b52b9,_0x2b288e[_0x23c4('0x3d')]);return db['Team'][_0x23c4('0x44')](_0x9b52b9)[_0x23c4('0x27')](handleEntityNotFound(_0x142568,null))[_0x23c4('0x27')](respondWithResult(_0x142568,null))[_0x23c4('0x45')](handleError(_0x142568,null));};exports[_0x23c4('0x46')]=function(_0x2ef353,_0x3f261e){return db['Team']['create'](_0x2ef353[_0x23c4('0x47')],{})[_0x23c4('0x27')](function(_0x37beca){var _0x11dbcb=_0x2ef353['user']['get']({'plain':!![]});if(!_0x11dbcb)throw new Error(_0x23c4('0x48'));if(_0x11dbcb[_0x23c4('0x49')]===_0x23c4('0x4a')){var _0x5eb860=_0x37beca[_0x23c4('0x4b')]({'plain':!![]});var _0x40d7a2='Teams';return db[_0x23c4('0x4c')][_0x23c4('0x44')]({'where':{'name':_0x40d7a2,'userProfileId':_0x11dbcb[_0x23c4('0x4d')]},'raw':!![]})['then'](function(_0x5ebcef){if(_0x5ebcef&&_0x5ebcef[_0x23c4('0x4e')]===0x0){return db[_0x23c4('0x4f')][_0x23c4('0x46')]({'name':_0x5eb860[_0x23c4('0x2a')],'resourceId':_0x5eb860['id'],'type':_0x5ebcef[_0x23c4('0x2a')],'sectionId':_0x5ebcef['id']},{})['then'](function(){return _0x37beca;});}else{return _0x37beca;}})[_0x23c4('0x45')](function(_0x37bbf5){logger[_0x23c4('0x28')](_0x23c4('0x50'),_0x37bbf5);throw _0x37bbf5;});}return _0x37beca;})[_0x23c4('0x27')](respondWithResult(_0x3f261e,0xc9))[_0x23c4('0x45')](handleError(_0x3f261e,null));};exports[_0x23c4('0x26')]=function(_0x4ddf04,_0x2ca709){if(_0x4ddf04[_0x23c4('0x47')]['id']){delete _0x4ddf04['body']['id'];}return db[_0x23c4('0x2d')][_0x23c4('0x44')]({'where':{'id':_0x4ddf04[_0x23c4('0x51')]['id']}})[_0x23c4('0x27')](handleEntityNotFound(_0x2ca709,null))[_0x23c4('0x27')](saveUpdates(_0x4ddf04[_0x23c4('0x47')],null))['then'](respondWithResult(_0x2ca709,null))[_0x23c4('0x45')](handleError(_0x2ca709,null));};exports['destroy']=function(_0x289ce7,_0x2adf2a){var _0x2bf7cd=_0x289ce7[_0x23c4('0x51')]['id'];var _0x28f2f7=[];return db[_0x23c4('0x52')][_0x23c4('0x53')](function(_0x5c1985){var _0x10b5e4=_0x23c4('0x54')+_0x2bf7cd;return db[_0x23c4('0x52')][_0x23c4('0x31')](_0x10b5e4,{'type':db[_0x23c4('0x55')][_0x23c4('0x56')][_0x23c4('0x57')],'raw':!![],'transaction':_0x5c1985})['then'](function(_0x19ddd8){_0x28f2f7=_[_0x23c4('0x2c')](_0x19ddd8,function(_0x1a902b){return Number(_0x1a902b[_0x23c4('0x58')]);});})[_0x23c4('0x27')](function(){var _0x2c4046='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2bf7cd;return db[_0x23c4('0x52')][_0x23c4('0x31')](_0x2c4046,{'type':db[_0x23c4('0x55')][_0x23c4('0x56')]['SELECT'],'raw':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x285976){var _0x50548c=_[_0x23c4('0x2c')](_0x285976,function(_0x544491){return Number(_0x544491[_0x23c4('0x59')]);});return db[_0x23c4('0x5a')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'VoiceQueueId':{'$in':_0x50548c}},'transaction':_0x5c1985});})[_0x23c4('0x27')](function(){var _0x30a1d8=_0x23c4('0x5c')+_0x2bf7cd;return db[_0x23c4('0x52')][_0x23c4('0x31')](_0x30a1d8,{'type':db[_0x23c4('0x55')][_0x23c4('0x56')]['SELECT'],'raw':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x2aab87){var _0x27b561=_['map'](_0x2aab87,function(_0x29b5fa){return Number(_0x29b5fa[_0x23c4('0x5d')]);});return db['UserMailQueue'][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'MailQueueId':{'$in':_0x27b561}},'transaction':_0x5c1985});})[_0x23c4('0x27')](function(){var _0x4c3433='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2bf7cd;return db[_0x23c4('0x52')][_0x23c4('0x31')](_0x4c3433,{'type':db['Sequelize'][_0x23c4('0x56')][_0x23c4('0x57')],'raw':!![],'transaction':_0x5c1985});})['then'](function(_0x6abaab){var _0x1c421f=_['map'](_0x6abaab,function(_0x3e577f){return Number(_0x3e577f[_0x23c4('0x5e')]);});return db[_0x23c4('0x5f')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'SmsQueueId':{'$in':_0x1c421f}},'transaction':_0x5c1985});})['then'](function(){var _0x1fc7ed='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2bf7cd;return db['sequelize'][_0x23c4('0x31')](_0x1fc7ed,{'type':db[_0x23c4('0x55')]['QueryTypes'][_0x23c4('0x57')],'raw':!![],'transaction':_0x5c1985});})['then'](function(_0x20f44c){var _0x1b3b06=_[_0x23c4('0x2c')](_0x20f44c,function(_0x5b7f37){return Number(_0x5b7f37[_0x23c4('0x60')]);});return db[_0x23c4('0x61')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'ChatQueueId':{'$in':_0x1b3b06}},'transaction':_0x5c1985});})['then'](function(){var _0x5d755e=_0x23c4('0x62')+_0x2bf7cd;return db['sequelize'][_0x23c4('0x31')](_0x5d755e,{'type':db[_0x23c4('0x55')][_0x23c4('0x56')]['SELECT'],'raw':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x3b5ec6){var _0x4382c6=_['map'](_0x3b5ec6,function(_0x9c1665){return Number(_0x9c1665['FaxQueueId']);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x28f2f7},'FaxQueueId':{'$in':_0x4382c6}},'transaction':_0x5c1985});})[_0x23c4('0x27')](function(){var _0xdb1bae=_0x23c4('0x63')+_0x2bf7cd;return db[_0x23c4('0x52')][_0x23c4('0x31')](_0xdb1bae,{'type':db[_0x23c4('0x55')][_0x23c4('0x56')][_0x23c4('0x57')],'raw':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x5290c7){var _0x3a22f8=_['map'](_0x5290c7,function(_0xe106ce){return Number(_0xe106ce['OpenchannelQueueId']);});return db[_0x23c4('0x64')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'OpenchannelQueueId':{'$in':_0x3a22f8}},'transaction':_0x5c1985});})[_0x23c4('0x27')](function(){var _0x5431f1=_0x23c4('0x65')+_0x2bf7cd;return db['sequelize'][_0x23c4('0x31')](_0x5431f1,{'type':db[_0x23c4('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x276c28){var _0x5946fa=_[_0x23c4('0x2c')](_0x276c28,function(_0x4c2434){return Number(_0x4c2434['WhatsappQueueId']);});return db[_0x23c4('0x66')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'WhatsappQueueId':{'$in':_0x5946fa}},'transaction':_0x5c1985});})['then'](function(){return db[_0x23c4('0x67')][_0x23c4('0x44')]({'where':{'TeamId':_0x2bf7cd}});})['then'](function(_0x543afc){if(_0x543afc===null){return;}return db[_0x23c4('0x68')][_0x23c4('0x5b')]({'where':{'UserId':{'$in':_0x28f2f7},'VoicePrefixId':_0x543afc[_0x23c4('0x69')]},'transaction':_0x5c1985});})[_0x23c4('0x27')](function(){return db['Team'][_0x23c4('0x5b')]({'where':{'id':_0x2bf7cd},'cascade':!![],'transaction':_0x5c1985});})[_0x23c4('0x27')](function(_0x43b73c){if(_0x43b73c===0x0){_0x2adf2a[_0x23c4('0x1a')](0x194);}else{return db[_0x23c4('0x4f')][_0x23c4('0x5b')]({'where':{'type':_0x23c4('0x6a'),'resourceId':_0x2bf7cd},'cascade':!![],'transaction':_0x5c1985})[_0x23c4('0x27')](function(){_0x2adf2a[_0x23c4('0x1b')](0xcc)[_0x23c4('0x1c')]();});}})[_0x23c4('0x45')](function(_0x55d1c8){_0x2adf2a['status'](0x1f4)[_0x23c4('0x2b')](_0x55d1c8);});});};exports[_0x23c4('0x6b')]=function(_0x3805cd,_0x6df3ba,_0x51c5c2){return db['Team'][_0x23c4('0x6c')]({'where':{'id':_0x3805cd[_0x23c4('0x51')]['id']}})['then'](handleEntityNotFound(_0x6df3ba,null))[_0x23c4('0x27')](function(_0x4498c9){if(!_0x3805cd[_0x23c4('0x31')][_0x23c4('0x6d')]||!utils[_0x23c4('0x6e')](_0x3805cd['query']['channel'])){throw new db[(_0x23c4('0x55'))][(_0x23c4('0x6f'))](_0x23c4('0x70'));}var _0x5cf392={};var _0x1c9707={};_0x1c9707[_0x23c4('0x30')]=_[_0x23c4('0x42')](db[_['capitalize'](_0x3805cd[_0x23c4('0x31')][_0x23c4('0x6d')][_0x23c4('0x71')]())+_0x23c4('0x72')]['rawAttributes']);_0x1c9707[_0x23c4('0x31')]=_[_0x23c4('0x42')](_0x3805cd['query']);_0x1c9707['filters']=_[_0x23c4('0x34')](_0x1c9707['model'],_0x1c9707[_0x23c4('0x31')]);_0x5cf392[_0x23c4('0x33')]=_[_0x23c4('0x34')](_0x1c9707[_0x23c4('0x30')],qs[_0x23c4('0x35')](_0x3805cd[_0x23c4('0x31')][_0x23c4('0x35')]));_0x5cf392[_0x23c4('0x33')]=_0x5cf392[_0x23c4('0x33')][_0x23c4('0x73')]?_0x5cf392['attributes']:_0x1c9707[_0x23c4('0x30')];_0x5cf392[_0x23c4('0x1f')]=qs[_0x23c4('0x1f')](_0x3805cd['query'][_0x23c4('0x1f')]);_0x5cf392[_0x23c4('0x1d')]=qs[_0x23c4('0x1d')](_0x3805cd[_0x23c4('0x31')][_0x23c4('0x1d')]);_0x5cf392['order']=qs[_0x23c4('0x37')](_0x3805cd[_0x23c4('0x31')][_0x23c4('0x37')]);_0x5cf392[_0x23c4('0x38')]=qs[_0x23c4('0x32')](_['pick'](_0x3805cd['query'],_0x1c9707['filters']));_0x5cf392=_[_0x23c4('0x3c')]({},_0x5cf392,_0x3805cd[_0x23c4('0x3d')]);return _0x4498c9[_0x23c4('0x4b')+_[_0x23c4('0x74')](_0x3805cd['query'][_0x23c4('0x6d')][_0x23c4('0x71')]())+_0x23c4('0x75')](_0x5cf392);})['then'](respondWithResult(_0x6df3ba,null))[_0x23c4('0x45')](handleError(_0x6df3ba,null));};exports[_0x23c4('0x76')]=function(_0x4dcaa4,_0x462796,_0x49d44e){return db[_0x23c4('0x2d')][_0x23c4('0x6c')]({'where':{'id':_0x4dcaa4['params']['id']}})['then'](function(_0x3d2631){if(_0x3d2631){if(!_0x4dcaa4[_0x23c4('0x47')][_0x23c4('0x6d')]||!utils[_0x23c4('0x6e')](_0x4dcaa4[_0x23c4('0x47')][_0x23c4('0x6d')])){throw new db['Sequelize'][(_0x23c4('0x6f'))]('Unknown\x20channel');}return _0x3d2631[_0x23c4('0x77')+_['capitalize'](_0x4dcaa4[_0x23c4('0x47')][_0x23c4('0x6d')]['toLowerCase']())+'Queues'](_0x4dcaa4[_0x23c4('0x47')]['ids']);}return null;})[_0x23c4('0x27')](handleEntityNotFound(_0x462796,null))[_0x23c4('0x27')](respondWithStatusCode(_0x462796,null))['catch'](handleError(_0x462796,null));};exports['removeQueues']=function(_0x5bb2b4,_0x5e7429,_0x1b094e){return db[_0x23c4('0x2d')][_0x23c4('0x6c')]({'where':{'id':_0x5bb2b4[_0x23c4('0x51')]['id']}})[_0x23c4('0x27')](function(_0x596520){if(_0x596520){if(!_0x5bb2b4[_0x23c4('0x31')][_0x23c4('0x6d')]||!utils[_0x23c4('0x6e')](_0x5bb2b4['query']['channel'])){throw new db['Sequelize'][(_0x23c4('0x6f'))]('Unknown\x20channel');}return _0x596520['remove'+_[_0x23c4('0x74')](_0x5bb2b4['query'][_0x23c4('0x6d')][_0x23c4('0x71')]())+_0x23c4('0x75')](_0x5bb2b4[_0x23c4('0x31')][_0x23c4('0x78')]);}return null;})[_0x23c4('0x27')](handleEntityNotFound(_0x5e7429,null))['then'](respondWithStatusCode(_0x5e7429,null))[_0x23c4('0x45')](handleError(_0x5e7429,null));};exports[_0x23c4('0x79')]=function(_0x336040,_0x2eceb9){var _0x1f3d48=_[_0x23c4('0x7a')](_0x336040[_0x23c4('0x47')]['ids'])?_0x336040[_0x23c4('0x47')][_0x23c4('0x78')]:[_0x336040[_0x23c4('0x47')]['ids']];var _0x55fefb=_0x336040['params']['id'];return db['Team'][_0x23c4('0x44')]({'where':{'id':_0x55fefb}})[_0x23c4('0x27')](handleEntityNotFound(_0x2eceb9,null))[_0x23c4('0x27')](function(_0x4b0ec8){if(_0x4b0ec8){var _0x4d6c34=[_0x23c4('0x7b'),_0x23c4('0x7c'),_0x23c4('0x7d'),_0x23c4('0x7e'),'Fax',_0x23c4('0x7f'),'Whatsapp'];return db[_0x23c4('0x52')][_0x23c4('0x53')](function(_0x5b206c){var _0x12c907=_[_0x23c4('0x2c')](_0x4d6c34,function(_0x25f0ff){var _0x3f6d20={'attributes':['id',_0x23c4('0x2a')]};if(_0x25f0ff===_0x23c4('0x7b')){_0x3f6d20[_0x23c4('0x80')]={'attributes':['penalty']};}return _0x4b0ec8['get'+_0x25f0ff+_0x23c4('0x75')](_0x3f6d20)[_0x23c4('0x27')](function(_0x5902f0){var _0x3dcaed=_['map'](_0x5902f0,function(_0x2c2efe){var _0x450e4c=_[_0x23c4('0x2c')](_0x1f3d48,function(_0x5f305d){var _0x57a5d6={'where':{'UserId':_0x5f305d,[_0x25f0ff+_0x23c4('0x81')]:_0x2c2efe['id']},'transaction':_0x5b206c};if(_0x25f0ff==='Voice'){_0x57a5d6['defaults']={'penalty':_0x2c2efe[_0x23c4('0x82')][_0x23c4('0x83')]};}return db['User'+_0x25f0ff+_0x23c4('0x72')][_0x23c4('0x84')](_0x57a5d6)[_0x23c4('0x27')](function(){socket[_0x23c4('0x85')](_0x23c4('0x4a')+_0x25f0ff+'Queue:save',{'UserId':_0x5f305d,[_0x25f0ff+_0x23c4('0x81')]:_0x2c2efe['id']});if(_0x25f0ff!==_0x23c4('0x7b')){return;}return db[_0x23c4('0x86')][_0x23c4('0x3f')]({'where':{'id':_0x1f3d48,'online':0x1},'attributes':['id',_0x23c4('0x2a'),'online','voicePause',_0x23c4('0x87')],'raw':!![]})['then'](function(_0x13b797){var _0x1f05c0=_[_0x23c4('0x2c')](_0x13b797,function(_0x1db067){return db[_0x23c4('0x88')][_0x23c4('0x89')]({'membername':_0x1db067[_0x23c4('0x2a')],'UserId':_0x1db067['id'],'queue_name':_0x2c2efe['name'],'VoiceQueueId':_0x2c2efe['id'],'interface':_[_0x23c4('0x8a')](_0x1db067[_0x23c4('0x87')])?util[_0x23c4('0x8b')](_0x23c4('0x8c'),_0x1db067[_0x23c4('0x2a')]):_0x1db067[_0x23c4('0x87')],'paused':_0x1db067[_0x23c4('0x8d')]||![],'penalty':_0x2c2efe[_0x23c4('0x82')][_0x23c4('0x83')]},{'transaction':_0x5b206c});});return Promise[_0x23c4('0x8e')](_0x1f05c0);});});});return Promise[_0x23c4('0x8e')](_0x450e4c);});return Promise[_0x23c4('0x8e')](_0x3dcaed);})['then'](function(){return db[_0x23c4('0x67')]['findOne']({'where':{'teamId':_0x55fefb}})[_0x23c4('0x27')](function(_0x23218c){if(_0x23218c){var _0x5ebd15=_[_0x23c4('0x2c')](_0x1f3d48,function(_0x3ef0ed){db['UserVoicePrefix'][_0x23c4('0x89')]({'UserId':_0x3ef0ed,'VoicePrefixId':_0x23218c['VoicePrefixId']});});return Promise[_0x23c4('0x8e')](_0x5ebd15);}});});});return Promise['all'](_0x12c907)['then'](function(){return _0x4b0ec8[_0x23c4('0x79')](_0x1f3d48,{'transaction':_0x5b206c})[_0x23c4('0x8f')](function(_0x209247){return _0x209247;});});});}})[_0x23c4('0x27')](respondWithResult(_0x2eceb9,null))[_0x23c4('0x45')](handleError(_0x2eceb9,null));};exports[_0x23c4('0x90')]=function(_0x141f2a,_0x117bdf){var _0x6dd34=_['isArray'](_0x141f2a[_0x23c4('0x31')][_0x23c4('0x78')])?_0x141f2a[_0x23c4('0x31')]['ids']:[_0x141f2a[_0x23c4('0x31')][_0x23c4('0x78')]];var _0xb6b933=_0x141f2a['params']['id'];return db[_0x23c4('0x2d')]['find']({'where':{'id':_0xb6b933}})[_0x23c4('0x27')](handleEntityNotFound(_0x117bdf,null))[_0x23c4('0x27')](function(_0x46ed1c){if(_0x46ed1c){var _0x3238ff=['Voice','Chat',_0x23c4('0x7d'),'Sms',_0x23c4('0x91'),_0x23c4('0x7f'),_0x23c4('0x92')];return db['sequelize']['transaction'](function(_0x176943){var _0x248602=_[_0x23c4('0x2c')](_0x3238ff,function(_0x54f436){var _0x2571f4={'attributes':['id',_0x23c4('0x2a')]};return _0x46ed1c['get'+_0x54f436+_0x23c4('0x75')](_0x2571f4)[_0x23c4('0x27')](function(_0x21e013){var _0x261be4=_[_0x23c4('0x2c')](_0x21e013,function(_0xb69553){return _0xb69553[_0x23c4('0x90')](_0x6dd34,{'transaction':_0x176943})['then'](function(){var _0x165384=_[_0x23c4('0x2c')](_0x6dd34,function(_0x29f9df){socket['emit'](_0x23c4('0x4a')+_0x54f436+_0x23c4('0x93'),{'UserId':Number(_0x29f9df),[_0x54f436+_0x23c4('0x81')]:_0xb69553['id']});if(_0x54f436!==_0x23c4('0x7b')){return;}return db[_0x23c4('0x88')][_0x23c4('0x5b')]({'where':{'VoiceQueueId':_0xb69553['id'],'UserId':_0x29f9df},'transaction':_0x176943});});return Promise['all'](_0x165384);});});return Promise[_0x23c4('0x8e')](_0x261be4);});});return Promise[_0x23c4('0x8e')](_0x248602)[_0x23c4('0x27')](function(){return _0x46ed1c[_0x23c4('0x90')](_0x6dd34,{'transaction':_0x176943});})[_0x23c4('0x27')](function(){return db[_0x23c4('0x67')][_0x23c4('0x6c')]({'where':{'teamId':_0xb6b933}})['then'](function(_0x26f7dc){if(_0x26f7dc){var _0x2b2cfa=_[_0x23c4('0x2c')](_0x6dd34,function(_0x41dc9a){db[_0x23c4('0x68')][_0x23c4('0x5b')]({'where':{'UserId':_0x41dc9a,'VoicePrefixId':_0x26f7dc[_0x23c4('0x69')]}});});return Promise[_0x23c4('0x8e')](_0x2b2cfa);}});});});}})[_0x23c4('0x27')](respondWithStatusCode(_0x117bdf,null))['catch'](handleError(_0x117bdf,null));};exports[_0x23c4('0x94')]=function(_0x1a78a4,_0x3c81b8,_0x1044f8){var _0x492427={};var _0x4ec684={};var _0x3e2fa9;var _0x343e47;return db[_0x23c4('0x2d')][_0x23c4('0x6c')]({'where':{'id':_0x1a78a4[_0x23c4('0x51')]['id']}})[_0x23c4('0x27')](handleEntityNotFound(_0x3c81b8,null))['then'](function(_0x41db7e){if(_0x41db7e){_0x3e2fa9=_0x41db7e;_0x4ec684[_0x23c4('0x30')]=_[_0x23c4('0x42')](db[_0x23c4('0x86')][_0x23c4('0x43')]);_0x4ec684[_0x23c4('0x31')]=_['keys'](_0x1a78a4[_0x23c4('0x31')]);_0x4ec684['filters']=_[_0x23c4('0x34')](_0x4ec684[_0x23c4('0x30')],_0x4ec684[_0x23c4('0x31')]);_0x492427[_0x23c4('0x33')]=_[_0x23c4('0x34')](_0x4ec684[_0x23c4('0x30')],qs[_0x23c4('0x35')](_0x1a78a4[_0x23c4('0x31')][_0x23c4('0x35')]));_0x492427[_0x23c4('0x33')]=_0x492427['attributes'][_0x23c4('0x73')]?_0x492427['attributes']:_0x4ec684[_0x23c4('0x30')];_0x492427[_0x23c4('0x95')]=qs[_0x23c4('0x37')](_0x1a78a4['query'][_0x23c4('0x37')]);_0x492427[_0x23c4('0x38')]=qs[_0x23c4('0x32')](_[_0x23c4('0x39')](_0x1a78a4[_0x23c4('0x31')],_0x4ec684[_0x23c4('0x32')]));if(_0x1a78a4[_0x23c4('0x31')]['filter']){_0x492427[_0x23c4('0x38')]=_[_0x23c4('0x3c')](_0x492427[_0x23c4('0x38')],{'$or':_[_0x23c4('0x2c')](_0x492427[_0x23c4('0x33')],function(_0x4b31ec){var _0x1a8a10={};_0x1a8a10[_0x4b31ec]={'$like':'%'+_0x1a78a4[_0x23c4('0x31')][_0x23c4('0x3a')]+'%'};return _0x1a8a10;})});}_0x492427=_[_0x23c4('0x3c')]({},_0x492427,_0x1a78a4[_0x23c4('0x3d')]);return _0x3e2fa9['getAgents'](_0x492427);}})[_0x23c4('0x27')](function(_0x2720e2){if(_0x2720e2){_0x343e47=_0x2720e2[_0x23c4('0x73')];if(!_0x1a78a4[_0x23c4('0x31')][_0x23c4('0x36')](_0x23c4('0x96'))){_0x492427[_0x23c4('0x1f')]=qs[_0x23c4('0x1f')](_0x1a78a4[_0x23c4('0x31')][_0x23c4('0x1f')]);_0x492427['offset']=qs[_0x23c4('0x1d')](_0x1a78a4[_0x23c4('0x31')][_0x23c4('0x1d')]);}return _0x3e2fa9[_0x23c4('0x94')](_0x492427);}})[_0x23c4('0x27')](function(_0x564fd4){if(_0x564fd4){return _0x564fd4?{'count':_0x343e47,'rows':_0x564fd4}:null;}})['then'](respondWithResult(_0x3c81b8,null))[_0x23c4('0x45')](handleError(_0x3c81b8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b5895e7..40ca192 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x590a=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x5ae938,_0x1547ad){var _0x57e316=function(_0x566bd9){while(--_0x566bd9){_0x5ae938['push'](_0x5ae938['shift']());}};_0x57e316(++_0x1547ad);}(_0x590a,0x1a0));var _0xa590=function(_0x5305af,_0x30c57a){_0x5305af=_0x5305af-0x0;var _0x313c6e=_0x590a[_0x5305af];return _0x313c6e;};'use strict';var EventEmitter=require(_0xa590('0x0'));var Team=require(_0xa590('0x1'))['db'][_0xa590('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xa590('0x3')](0x0);var events={'afterCreate':_0xa590('0x4'),'afterUpdate':_0xa590('0x5'),'afterDestroy':'remove'};function emitEvent(_0x35c357){return function(_0x75035b,_0x552100,_0x246198){TeamEvents[_0xa590('0x6')](_0x35c357+':'+_0x75035b['id'],_0x75035b);TeamEvents[_0xa590('0x6')](_0x35c357,_0x75035b);_0x246198(null);};}for(var e in events){if(events[_0xa590('0x7')](e)){var event=events[e];Team[_0xa590('0x8')](e,emitEvent(event));}}module[_0xa590('0x9')]=TeamEvents; \ No newline at end of file +var _0xf313=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x34d6a4,_0x4fd566){var _0x448ada=function(_0x4d248d){while(--_0x4d248d){_0x34d6a4['push'](_0x34d6a4['shift']());}};_0x448ada(++_0x4fd566);}(_0xf313,0x196));var _0x3f31=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf313[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x3f31('0x0'));var Team=require(_0x3f31('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3f31('0x2'),'afterUpdate':_0x3f31('0x3'),'afterDestroy':'remove'};function emitEvent(_0x278d6d){return function(_0x17a204,_0x1d8482,_0x339b10){TeamEvents[_0x3f31('0x4')](_0x278d6d+':'+_0x17a204['id'],_0x17a204);TeamEvents[_0x3f31('0x4')](_0x278d6d,_0x17a204);_0x339b10(null);};}for(var e in events){if(events[_0x3f31('0x5')](e)){var event=events[e];Team[_0x3f31('0x6')](e,emitEvent(event));}}module[_0x3f31('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index df54665..48f0f4a 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa78f=['exports','define','Team','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes'];(function(_0x88e777,_0x1a3dca){var _0xa11e12=function(_0x1c5e2d){while(--_0x1c5e2d){_0x88e777['push'](_0x88e777['shift']());}};_0xa11e12(++_0x1a3dca);}(_0xa78f,0xc9));var _0xfa78=function(_0x5c775e,_0x1cf7cb){_0x5c775e=_0x5c775e-0x0;var _0x5746d2=_0xa78f[_0x5c775e];return _0x5746d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa78('0x0'))(_0xfa78('0x1'));var moment=require('moment');var BPromise=require(_0xfa78('0x2'));var rp=require(_0xfa78('0x3'));var fs=require('fs');var path=require(_0xfa78('0x4'));var rimraf=require(_0xfa78('0x5'));var config=require(_0xfa78('0x6'));var attributes=require(_0xfa78('0x7'));module[_0xfa78('0x8')]=function(_0x381afc,_0x15c5d2){return _0x381afc[_0xfa78('0x9')](_0xfa78('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b4=['../../config/environment','./team.attributes','exports','define','Team','teams','lodash','../../config/logger','moment','path'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xf7b4,0x1a0));var _0x4f7b=function(_0x6ce0a8,_0x3b6e27){_0x6ce0a8=_0x6ce0a8-0x0;var _0x495dbb=_0xf7b4[_0x6ce0a8];return _0x495dbb;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require(_0x4f7b('0x1'))('api');var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require('rimraf');var config=require(_0x4f7b('0x4'));var attributes=require(_0x4f7b('0x5'));module[_0x4f7b('0x6')]=function(_0xb56f40,_0x74fdee){return _0xb56f40[_0x4f7b('0x7')](_0x4f7b('0x8'),attributes,{'tableName':_0x4f7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index ea43463..5fae509 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7555=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x7555,0x170));var _0x5755=function(_0x39f03f,_0x50a392){_0x39f03f=_0x39f03f-0x0;var _0x2761d6=_0x7555[_0x39f03f];return _0x2761d6;};'use strict';var _=require(_0x5755('0x0'));var util=require(_0x5755('0x1'));var moment=require(_0x5755('0x2'));var BPromise=require(_0x5755('0x3'));var rs=require(_0x5755('0x4'));var fs=require('fs');var Redis=require(_0x5755('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5755('0x6'));var logger=require(_0x5755('0x7'))(_0x5755('0x8'));var config=require('../../config/environment');var jayson=require(_0x5755('0x9'));var client=jayson['client'][_0x5755('0xa')]({'port':0x232a});config[_0x5755('0xb')]=_[_0x5755('0xc')](config['redis'],{'host':_0x5755('0xd'),'port':0x18eb});var socket=require(_0x5755('0xe'))(new Redis(config['redis']));require(_0x5755('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c87fa,_0x42a4d2,_0xf39505){return new BPromise(function(_0xb121f9,_0x5cfcd9){return client[_0x5755('0x10')](_0x2c87fa,_0xf39505)[_0x5755('0x11')](function(_0x42e4d0){logger['info']('Team,\x20%s,\x20%s',_0x42a4d2,_0x5755('0x12'));logger[_0x5755('0x13')](_0x5755('0x14'),_0x42a4d2,_0x5755('0x12'),JSON[_0x5755('0x15')](_0x42e4d0));if(_0x42e4d0[_0x5755('0x16')]){if(_0x42e4d0[_0x5755('0x16')][_0x5755('0x17')]===0x1f4){logger[_0x5755('0x16')](_0x5755('0x18'),_0x42a4d2,_0x42e4d0['error']['message']);return _0x5cfcd9(_0x42e4d0['error'][_0x5755('0x19')]);}logger[_0x5755('0x16')](_0x5755('0x18'),_0x42a4d2,_0x42e4d0[_0x5755('0x16')][_0x5755('0x19')]);return _0xb121f9(_0x42e4d0[_0x5755('0x16')][_0x5755('0x19')]);}else{logger[_0x5755('0x1a')](_0x5755('0x18'),_0x42a4d2,_0x5755('0x12'));_0xb121f9(_0x42e4d0[_0x5755('0x1b')]['message']);}})[_0x5755('0x1c')](function(_0x569aad){logger[_0x5755('0x16')]('Team,\x20%s,\x20%s',_0x42a4d2,_0x569aad);_0x5cfcd9(_0x569aad);});});} \ No newline at end of file +var _0xb422=['redis','defaults','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5dc495,_0x526101){var _0x1327d5=function(_0x13fc3b){while(--_0x13fc3b){_0x5dc495['push'](_0x5dc495['shift']());}};_0x1327d5(++_0x526101);}(_0xb422,0x17a));var _0x2b42=function(_0x52a7a9,_0x4df6fc){_0x52a7a9=_0x52a7a9-0x0;var _0x5253e4=_0xb422[_0x52a7a9];return _0x5253e4;};'use strict';var _=require(_0x2b42('0x0'));var util=require(_0x2b42('0x1'));var moment=require('moment');var BPromise=require(_0x2b42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b42('0x3'));var db=require(_0x2b42('0x4'))['db'];var utils=require(_0x2b42('0x5'));var logger=require(_0x2b42('0x6'))(_0x2b42('0x7'));var config=require(_0x2b42('0x8'));var jayson=require(_0x2b42('0x9'));var client=jayson[_0x2b42('0xa')][_0x2b42('0xb')]({'port':0x232a});config[_0x2b42('0xc')]=_[_0x2b42('0xd')](config[_0x2b42('0xc')],{'host':_0x2b42('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b42('0xc')]));require(_0x2b42('0xf'))[_0x2b42('0x10')](socket);function respondWithRpcPromise(_0x4f805c,_0x5d43d5,_0x2ad35b){return new BPromise(function(_0x4ab036,_0x585dbb){return client[_0x2b42('0x11')](_0x4f805c,_0x2ad35b)[_0x2b42('0x12')](function(_0x4a43fc){logger['info'](_0x2b42('0x13'),_0x5d43d5,_0x2b42('0x14'));logger[_0x2b42('0x15')](_0x2b42('0x16'),_0x5d43d5,_0x2b42('0x14'),JSON[_0x2b42('0x17')](_0x4a43fc));if(_0x4a43fc[_0x2b42('0x18')]){if(_0x4a43fc[_0x2b42('0x18')][_0x2b42('0x19')]===0x1f4){logger[_0x2b42('0x18')]('Team,\x20%s,\x20%s',_0x5d43d5,_0x4a43fc[_0x2b42('0x18')][_0x2b42('0x1a')]);return _0x585dbb(_0x4a43fc[_0x2b42('0x18')]['message']);}logger[_0x2b42('0x18')](_0x2b42('0x13'),_0x5d43d5,_0x4a43fc[_0x2b42('0x18')]['message']);return _0x4ab036(_0x4a43fc['error']['message']);}else{logger[_0x2b42('0x1b')](_0x2b42('0x13'),_0x5d43d5,_0x2b42('0x14'));_0x4ab036(_0x4a43fc[_0x2b42('0x1c')][_0x2b42('0x1a')]);}})[_0x2b42('0x1d')](function(_0x957647){logger[_0x2b42('0x18')](_0x2b42('0x13'),_0x5d43d5,_0x957647);_0x585dbb(_0x957647);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3583b34..33cb272 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3889=['length','team:','./team.events','save','remove','update','emit','register'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3889,0x1c2));var _0x9388=function(_0x411504,_0x6b8657){_0x411504=_0x411504-0x0;var _0x99bdbb=_0x3889[_0x411504];return _0x99bdbb;};'use strict';var TeamEvents=require(_0x9388('0x0'));var events=[_0x9388('0x1'),_0x9388('0x2'),_0x9388('0x3')];function createListener(_0x4f9863,_0x525285){return function(_0x255bdf){_0x525285[_0x9388('0x4')](_0x4f9863,_0x255bdf);};}function removeListener(_0x5fa575,_0xeef6ba){return function(){TeamEvents['removeListener'](_0x5fa575,_0xeef6ba);};}exports[_0x9388('0x5')]=function(_0x2df228){for(var _0x2fe69c=0x0,_0x964a6f=events[_0x9388('0x6')];_0x2fe69c<_0x964a6f;_0x2fe69c++){var _0x37ad14=events[_0x2fe69c];var _0x51153f=createListener(_0x9388('0x7')+_0x37ad14,_0x2df228);TeamEvents['on'](_0x37ad14,_0x51153f);}}; \ No newline at end of file +var _0xc234=['length','save','remove','emit','removeListener','register'];(function(_0x263e7d,_0x771de5){var _0x17be5d=function(_0x193f35){while(--_0x193f35){_0x263e7d['push'](_0x263e7d['shift']());}};_0x17be5d(++_0x771de5);}(_0xc234,0x7f));var _0x4c23=function(_0x4a79e8,_0x4f3e62){_0x4a79e8=_0x4a79e8-0x0;var _0x1720f3=_0xc234[_0x4a79e8];return _0x1720f3;};'use strict';var TeamEvents=require('./team.events');var events=[_0x4c23('0x0'),_0x4c23('0x1'),'update'];function createListener(_0x203bc0,_0x5acf7d){return function(_0x1d4445){_0x5acf7d[_0x4c23('0x2')](_0x203bc0,_0x1d4445);};}function removeListener(_0x185785,_0x1d9d5a){return function(){TeamEvents[_0x4c23('0x3')](_0x185785,_0x1d9d5a);};}exports[_0x4c23('0x4')]=function(_0x4f7f08){for(var _0x1aff39=0x0,_0x4b1c09=events[_0x4c23('0x5')];_0x1aff39<_0x4b1c09;_0x1aff39++){var _0x44d13d=events[_0x1aff39];var _0xa2297d=createListener('team:'+_0x44d13d,_0x4f7f08);TeamEvents['on'](_0x44d13d,_0xa2297d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7633229..a193db1 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45c8=['INTEGER','sequelize'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x45c8,0xef));var _0x845c=function(_0x3043b8,_0x460c82){_0x3043b8=_0x3043b8-0x0;var _0x5d2091=_0x45c8[_0x3043b8];return _0x5d2091;};'use strict';var Sequelize=require(_0x845c('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x845c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x845c('0x1')]}}; \ No newline at end of file +var _0xda55=['exports','sequelize'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xda55,0x6d));var _0x5da5=function(_0x10784b,_0x59bd34){_0x10784b=_0x10784b-0x0;var _0x3123b4=_0xda55[_0x10784b];return _0x3123b4;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 4c442e6..d53862e 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcabe=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xcabe,0x1ef));var _0xecab=function(_0x147cf6,_0x3d60d3){_0x147cf6=_0x147cf6-0x0;var _0x199af6=_0xcabe[_0x147cf6];return _0x199af6;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var logger=require(_0xecab('0x1'))(_0xecab('0x2'));var moment=require('moment');var BPromise=require(_0xecab('0x3'));var rp=require(_0xecab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecab('0x5'));var config=require(_0xecab('0x6'));var attributes=require(_0xecab('0x7'));module['exports']=function(_0x2ef298,_0x2ace9c){return _0x2ef298[_0xecab('0x8')](_0xecab('0x9'),attributes,{'tableName':_0xecab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd757=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd757,0x1e5));var _0x7d75=function(_0x1386df,_0x4c943d){_0x1386df=_0x1386df-0x0;var _0x44f62b=_0xd757[_0x1386df];return _0x44f62b;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 69f3a3d..c24dca8 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb79c5d,_0xcace20){var _0x69ffa5=function(_0x3a52ea){while(--_0x3a52ea){_0xb79c5d['push'](_0xb79c5d['shift']());}};_0x69ffa5(++_0xcace20);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3c834d,_0x4f9feb){var _0x508ff4=function(_0x25b7a3){while(--_0x25b7a3){_0x3c834d['push'](_0x3c834d['shift']());}};_0x508ff4(++_0x4f9feb);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c56ab4a..0f33eda 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89fd=['INTEGER','exports'];(function(_0xa98d9f,_0x22d624){var _0x164367=function(_0x5f1c42){while(--_0x5f1c42){_0xa98d9f['push'](_0xa98d9f['shift']());}};_0x164367(++_0x22d624);}(_0x89fd,0x7f));var _0xd89f=function(_0x339f5f,_0x2a8cf2){_0x339f5f=_0x339f5f-0x0;var _0x353709=_0x89fd[_0x339f5f];return _0x353709;};'use strict';var Sequelize=require('sequelize');module[_0xd89f('0x0')]={'penalty':{'type':Sequelize[_0xd89f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x41c9=['INTEGER','sequelize','exports'];(function(_0x158111,_0x48f0a6){var _0x8d7c1c=function(_0x1ef02a){while(--_0x1ef02a){_0x158111['push'](_0x158111['shift']());}};_0x8d7c1c(++_0x48f0a6);}(_0x41c9,0x1ab));var _0x941c=function(_0x5ae524,_0x1e027b){_0x5ae524=_0x5ae524-0x0;var _0x4f4120=_0x41c9[_0x5ae524];return _0x4f4120;};'use strict';var Sequelize=require(_0x941c('0x0'));module[_0x941c('0x1')]={'penalty':{'type':Sequelize[_0x941c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 6713053..089e8e3 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x447b=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0xf59dc0,_0x232e41){var _0x4275e8=function(_0xc497f3){while(--_0xc497f3){_0xf59dc0['push'](_0xf59dc0['shift']());}};_0x4275e8(++_0x232e41);}(_0x447b,0xe4));var _0xb447=function(_0x5b58d6,_0x3043cd){_0x5b58d6=_0x5b58d6-0x0;var _0x13e026=_0x447b[_0x5b58d6];return _0x13e026;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var logger=require('../../config/logger')(_0xb447('0x2'));var moment=require(_0xb447('0x3'));var BPromise=require(_0xb447('0x4'));var rp=require(_0xb447('0x5'));var fs=require('fs');var path=require(_0xb447('0x6'));var rimraf=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var attributes=require(_0xb447('0x9'));module[_0xb447('0xa')]=function(_0x1f132a,_0x514a91){return _0x1f132a['define'](_0xb447('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61df=['api','moment','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues'];(function(_0x5ae24f,_0x48163c){var _0x4e4c76=function(_0x35806c){while(--_0x35806c){_0x5ae24f['push'](_0x5ae24f['shift']());}};_0x4e4c76(++_0x48163c);}(_0x61df,0xbd));var _0xf61d=function(_0xfb4462,_0x127716){_0xfb4462=_0xfb4462-0x0;var _0x4e55aa=_0x61df[_0xfb4462];return _0x4e55aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf61d('0x0'));var moment=require(_0xf61d('0x1'));var BPromise=require('bluebird');var rp=require(_0xf61d('0x2'));var fs=require('fs');var path=require(_0xf61d('0x3'));var rimraf=require('rimraf');var config=require(_0xf61d('0x4'));var attributes=require(_0xf61d('0x5'));module[_0xf61d('0x6')]=function(_0x458eb9,_0x2d0791){return _0x458eb9[_0xf61d('0x7')]('TeamVoiceQueue',attributes,{'tableName':_0xf61d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 722ef2b..44a1b9f 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44f8=['moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request\x20sent','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x44f8,0x1de));var _0x844f=function(_0x3019ee,_0x3d6cbb){_0x3019ee=_0x3019ee-0x0;var _0x2c37c1=_0x44f8[_0x3019ee];return _0x2c37c1;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require(_0x844f('0x3'));var rs=require(_0x844f('0x4'));var fs=require('fs');var Redis=require(_0x844f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x844f('0x7')][_0x844f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46eb2c,_0x38a334,_0x37b697){return new BPromise(function(_0x1987a9,_0x188f88){return client['request'](_0x46eb2c,_0x37b697)['then'](function(_0x39416d){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x38a334,'request\x20sent',JSON['stringify'](_0x39416d));if(_0x39416d[_0x844f('0xa')]){if(_0x39416d[_0x844f('0xa')]['code']===0x1f4){logger[_0x844f('0xa')](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')]['message']);return _0x188f88(_0x39416d['error'][_0x844f('0xc')]);}logger['error'](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);return _0x1987a9(_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));_0x1987a9(_0x39416d[_0x844f('0xd')][_0x844f('0xc')]);}})[_0x844f('0xe')](function(_0x4f7ce4){logger[_0x844f('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x38a334,_0x4f7ce4);_0x188f88(_0x4f7ce4);});});} \ No newline at end of file +var _0x3402=['jayson/promise','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3402,0x1f0));var _0x2340=function(_0x3c7724,_0xe84160){_0x3c7724=_0x3c7724-0x0;var _0x54c43a=_0x3402[_0x3c7724];return _0x54c43a;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require(_0x2340('0x2'));var rs=require(_0x2340('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require(_0x2340('0x7'));var jayson=require(_0x2340('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc37850,_0x1deef4,_0x16174f){return new BPromise(function(_0x225250,_0x152e52){return client['request'](_0xc37850,_0x16174f)[_0x2340('0x9')](function(_0x1da381){logger[_0x2340('0xa')](_0x2340('0xb'),_0x1deef4,_0x2340('0xc'));logger['debug'](_0x2340('0xd'),_0x1deef4,_0x2340('0xc'),JSON['stringify'](_0x1da381));if(_0x1da381['error']){if(_0x1da381[_0x2340('0xe')]['code']===0x1f4){logger[_0x2340('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1deef4,_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);return _0x152e52(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x1da381[_0x2340('0xe')]['message']);return _0x225250(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}else{logger[_0x2340('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1deef4,_0x2340('0xc'));_0x225250(_0x1da381[_0x2340('0x10')][_0x2340('0xf')]);}})[_0x2340('0x11')](function(_0x4dcab6){logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x4dcab6);_0x152e52(_0x4dcab6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6bf9e7b..1acfcad 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd052=['path','express','../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports'];(function(_0x302044,_0x3bc4f2){var _0x18ec41=function(_0xe46993){while(--_0xe46993){_0x302044['push'](_0x302044['shift']());}};_0x18ec41(++_0x3bc4f2);}(_0xd052,0x69));var _0x2d05=function(_0x3a9223,_0x52dd1a){_0x3a9223=_0x3a9223-0x0;var _0x2c9f0c=_0xd052[_0x3a9223];return _0x2c9f0c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d05('0x0'));var timeout=require('connect-timeout');var express=require(_0x2d05('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d05('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2d05('0x3'));var controller=require(_0x2d05('0x4'));router['get']('/',auth[_0x2d05('0x5')](),controller[_0x2d05('0x6')]);router[_0x2d05('0x7')](_0x2d05('0x8'),auth[_0x2d05('0x5')](),controller[_0x2d05('0x9')]);router[_0x2d05('0xa')]('/',auth[_0x2d05('0x5')](),controller[_0x2d05('0xb')]);router[_0x2d05('0xc')](_0x2d05('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2d05('0x8'),auth[_0x2d05('0x5')](),controller[_0x2d05('0xd')]);module[_0x2d05('0xe')]=router; \ No newline at end of file +var _0x6365=['put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x4756a1,_0x3f8d1){var _0x177c4f=function(_0xddb5e2){while(--_0xddb5e2){_0x4756a1['push'](_0x4756a1['shift']());}};_0x177c4f(++_0x3f8d1);}(_0x6365,0x148));var _0x5636=function(_0x305b41,_0x3cd2b5){_0x305b41=_0x305b41-0x0;var _0x1ed6d9=_0x6365[_0x305b41];return _0x1ed6d9;};'use strict';var multer=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var path=require(_0x5636('0x2'));var timeout=require(_0x5636('0x3'));var express=require('express');var router=express[_0x5636('0x4')]();var fs_extra=require(_0x5636('0x5'));var auth=require(_0x5636('0x6'));var interaction=require(_0x5636('0x7'));var config=require(_0x5636('0x8'));var controller=require('./template.controller');router[_0x5636('0x9')]('/',auth[_0x5636('0xa')](),controller[_0x5636('0xb')]);router[_0x5636('0x9')]('/:id',auth[_0x5636('0xa')](),controller[_0x5636('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5636('0xd')]);router[_0x5636('0xe')](_0x5636('0xf'),auth[_0x5636('0xa')](),controller['update']);router['delete'](_0x5636('0xf'),auth['isAuthenticated'](),controller[_0x5636('0x10')]);module[_0x5636('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 2f3e8e8..c797331 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c2b=['TEXT','STRING'];(function(_0x46b5bc,_0x562d12){var _0x1cb7e=function(_0x2021f9){while(--_0x2021f9){_0x46b5bc['push'](_0x46b5bc['shift']());}};_0x1cb7e(++_0x562d12);}(_0x8c2b,0xeb));var _0xb8c2=function(_0x9948a1,_0x5cab36){_0x9948a1=_0x9948a1-0x0;var _0xea4c5e=_0x8c2b[_0x9948a1];return _0xea4c5e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb8c2('0x0')]},'description':{'type':Sequelize[_0xb8c2('0x0')]},'html':{'type':Sequelize[_0xb8c2('0x1')]}}; \ No newline at end of file +var _0xb167=['sequelize','exports','STRING'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xb167,0x69));var _0x7b16=function(_0xa624a4,_0x4a4cbb){_0xa624a4=_0xa624a4-0x0;var _0x23f6d5=_0xb167[_0xa624a4];return _0x23f6d5;};'use strict';var Sequelize=require(_0x7b16('0x0'));module[_0x7b16('0x1')]={'name':{'type':Sequelize[_0x7b16('0x2')]},'description':{'type':Sequelize[_0x7b16('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c87aeaf..8e0199d 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb60c=['get','Templates','UserProfileResource','then','end','stack','name','send','index','Template','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x1a0ad5,_0x3b2f08){var _0xbccb0e=function(_0x57b161){while(--_0x57b161){_0x1a0ad5['push'](_0x1a0ad5['shift']());}};_0xbccb0e(++_0x3b2f08);}(_0xb60c,0x84));var _0xcb60=function(_0x387c28,_0x4efac4){_0x387c28=_0x387c28-0x0;var _0x5ab63d=_0xb60c[_0x387c28];return _0x5ab63d;};'use strict';var emlformat=require(_0xcb60('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb60('0x1'));var rp=require(_0xcb60('0x2'));var moment=require(_0xcb60('0x3'));var BPromise=require(_0xcb60('0x4'));var Mustache=require(_0xcb60('0x5'));var util=require('util');var path=require(_0xcb60('0x6'));var sox=require(_0xcb60('0x7'));var csv=require(_0xcb60('0x8'));var ejs=require(_0xcb60('0x9'));var fs=require('fs');var fs_extra=require(_0xcb60('0xa'));var _=require(_0xcb60('0xb'));var squel=require(_0xcb60('0xc'));var crypto=require(_0xcb60('0xd'));var jsforce=require(_0xcb60('0xe'));var deskjs=require(_0xcb60('0xf'));var toCsv=require(_0xcb60('0x8'));var querystring=require('querystring');var Papa=require(_0xcb60('0x10'));var Redis=require(_0xcb60('0x11'));var authService=require(_0xcb60('0x12'));var qs=require(_0xcb60('0x13'));var as=require(_0xcb60('0x14'));var hardwareService=require(_0xcb60('0x15'));var logger=require(_0xcb60('0x16'))(_0xcb60('0x17'));var utils=require(_0xcb60('0x18'));var config=require(_0xcb60('0x19'));var licenseUtil=require(_0xcb60('0x1a'));var db=require(_0xcb60('0x1b'))['db'];function respondWithStatusCode(_0x4dcf20,_0x1cb229){_0x1cb229=_0x1cb229||0xcc;return function(_0x242026){if(_0x242026){return _0x4dcf20[_0xcb60('0x1c')](_0x1cb229);}return _0x4dcf20[_0xcb60('0x1d')](_0x1cb229)['end']();};}function respondWithResult(_0x4d7c22,_0x2d2071){_0x2d2071=_0x2d2071||0xc8;return function(_0x2d5322){if(_0x2d5322){return _0x4d7c22[_0xcb60('0x1d')](_0x2d2071)[_0xcb60('0x1e')](_0x2d5322);}};}function respondWithFilteredResult(_0x334410,_0x39b419){return function(_0x19572b){if(_0x19572b){var _0x3acdbb=typeof _0x39b419[_0xcb60('0x1f')]===_0xcb60('0x20')&&typeof _0x39b419[_0xcb60('0x21')]==='undefined';var _0x177d5d=_0x19572b[_0xcb60('0x22')];var _0x3d5dc6=_0x3acdbb?0x0:_0x39b419[_0xcb60('0x1f')];var _0x24da19=_0x3acdbb?_0x19572b[_0xcb60('0x22')]:_0x39b419['offset']+_0x39b419[_0xcb60('0x21')];var _0x1276a2;if(_0x24da19>=_0x177d5d){_0x24da19=_0x177d5d;_0x1276a2=0xc8;}else{_0x1276a2=0xce;}_0x334410[_0xcb60('0x1d')](_0x1276a2);return _0x334410[_0xcb60('0x23')](_0xcb60('0x24'),_0x3d5dc6+'-'+_0x24da19+'/'+_0x177d5d)[_0xcb60('0x1e')](_0x19572b);}return null;};}function patchUpdates(_0xf8b7e3){return function(_0x55f478){try{jsonpatch[_0xcb60('0x25')](_0x55f478,_0xf8b7e3,!![]);}catch(_0x5c4f47){return BPromise[_0xcb60('0x26')](_0x5c4f47);}return _0x55f478[_0xcb60('0x27')]();};}function saveUpdates(_0x566541,_0x4e5d38){return function(_0x3cfde5){if(_0x3cfde5){return _0x3cfde5[_0xcb60('0x28')](_0x566541)['then'](function(_0x37b090){return _0x37b090;});}return null;};}function removeEntity(_0x79c6c9,_0x332701){return function(_0x32450b){if(_0x32450b){return _0x32450b[_0xcb60('0x29')]()['then'](function(){var _0x590407=_0x32450b[_0xcb60('0x2a')]({'plain':!![]});var _0x4eb43a=_0xcb60('0x2b');return db[_0xcb60('0x2c')][_0xcb60('0x29')]({'where':{'type':_0x4eb43a,'resourceId':_0x590407['id']}})[_0xcb60('0x2d')](function(){return _0x32450b;});})[_0xcb60('0x2d')](function(){_0x79c6c9[_0xcb60('0x1d')](0xcc)[_0xcb60('0x2e')]();});}};}function handleEntityNotFound(_0x1ef2c8,_0x2a09a7){return function(_0x2ddcfe){if(!_0x2ddcfe){_0x1ef2c8[_0xcb60('0x1c')](0x194);}return _0x2ddcfe;};}function handleError(_0x1c603b,_0x151936){_0x151936=_0x151936||0x1f4;return function(_0x53b166){logger['error'](_0x53b166[_0xcb60('0x2f')]);if(_0x53b166[_0xcb60('0x30')]){delete _0x53b166[_0xcb60('0x30')];}_0x1c603b[_0xcb60('0x1d')](_0x151936)[_0xcb60('0x31')](_0x53b166);};}exports[_0xcb60('0x32')]=function(_0x130152,_0x5b9d66){var _0xe15b15={},_0x197628={},_0x29ab01={'count':0x0,'rows':[]};var _0x469ef2=_['map'](db[_0xcb60('0x33')][_0xcb60('0x34')],function(_0x36aa4f){return{'name':_0x36aa4f[_0xcb60('0x35')],'type':_0x36aa4f[_0xcb60('0x36')]['key']};});_0x197628[_0xcb60('0x37')]=_[_0xcb60('0x38')](_0x469ef2,_0xcb60('0x30'));_0x197628[_0xcb60('0x39')]=_['keys'](_0x130152['query']);_0x197628[_0xcb60('0x3a')]=_[_0xcb60('0x3b')](_0x197628[_0xcb60('0x37')],_0x197628['query']);_0xe15b15[_0xcb60('0x3c')]=_['intersection'](_0x197628['model'],qs['fields'](_0x130152[_0xcb60('0x39')]['fields']));_0xe15b15[_0xcb60('0x3c')]=_0xe15b15[_0xcb60('0x3c')][_0xcb60('0x3d')]?_0xe15b15[_0xcb60('0x3c')]:_0x197628['model'];if(!_0x130152[_0xcb60('0x39')][_0xcb60('0x3e')](_0xcb60('0x3f'))){_0xe15b15[_0xcb60('0x21')]=qs['limit'](_0x130152[_0xcb60('0x39')]['limit']);_0xe15b15[_0xcb60('0x1f')]=qs[_0xcb60('0x1f')](_0x130152['query'][_0xcb60('0x1f')]);}_0xe15b15[_0xcb60('0x40')]=qs['sort'](_0x130152[_0xcb60('0x39')][_0xcb60('0x41')]);_0xe15b15[_0xcb60('0x42')]=qs[_0xcb60('0x3a')](_[_0xcb60('0x43')](_0x130152['query'],_0x197628[_0xcb60('0x3a')]),_0x469ef2);if(_0x130152[_0xcb60('0x39')]['filter']){_0xe15b15[_0xcb60('0x42')]=_[_0xcb60('0x44')](_0xe15b15[_0xcb60('0x42')],{'$or':_[_0xcb60('0x38')](_0x469ef2,function(_0x5ce1de){if(_0x5ce1de[_0xcb60('0x36')]!=='VIRTUAL'){var _0x413352={};_0x413352[_0x5ce1de[_0xcb60('0x30')]]={'$like':'%'+_0x130152[_0xcb60('0x39')][_0xcb60('0x45')]+'%'};return _0x413352;}})});}_0xe15b15=_['merge']({},_0xe15b15,_0x130152['options']);var _0x1e966a={'where':_0xe15b15['where']};return db[_0xcb60('0x33')]['count'](_0x1e966a)['then'](function(_0x40520b){_0x29ab01[_0xcb60('0x22')]=_0x40520b;if(_0x130152['query'][_0xcb60('0x46')]){_0xe15b15[_0xcb60('0x47')]=[{'all':!![]}];}return db[_0xcb60('0x33')][_0xcb60('0x48')](_0xe15b15);})['then'](function(_0xa0845e){_0x29ab01[_0xcb60('0x49')]=_0xa0845e;return _0x29ab01;})['then'](respondWithFilteredResult(_0x5b9d66,_0xe15b15))[_0xcb60('0x4a')](handleError(_0x5b9d66,null));};exports[_0xcb60('0x4b')]=function(_0x5cfb19,_0x5a1536){var _0x198245={'raw':!![],'where':{'id':_0x5cfb19['params']['id']}},_0x1b1c6a={};_0x1b1c6a['model']=_[_0xcb60('0x4c')](db[_0xcb60('0x33')][_0xcb60('0x34')]);_0x1b1c6a['query']=_[_0xcb60('0x4c')](_0x5cfb19[_0xcb60('0x39')]);_0x1b1c6a[_0xcb60('0x3a')]=_[_0xcb60('0x3b')](_0x1b1c6a['model'],_0x1b1c6a[_0xcb60('0x39')]);_0x198245[_0xcb60('0x3c')]=_['intersection'](_0x1b1c6a['model'],qs['fields'](_0x5cfb19[_0xcb60('0x39')]['fields']));_0x198245[_0xcb60('0x3c')]=_0x198245[_0xcb60('0x3c')][_0xcb60('0x3d')]?_0x198245['attributes']:_0x1b1c6a[_0xcb60('0x37')];if(_0x5cfb19[_0xcb60('0x39')]['includeAll']){_0x198245[_0xcb60('0x47')]=[{'all':!![]}];}_0x198245=_['merge']({},_0x198245,_0x5cfb19['options']);return db[_0xcb60('0x33')][_0xcb60('0x4d')](_0x198245)[_0xcb60('0x2d')](handleEntityNotFound(_0x5a1536,null))[_0xcb60('0x2d')](respondWithResult(_0x5a1536,null))[_0xcb60('0x4a')](handleError(_0x5a1536,null));};exports[_0xcb60('0x4e')]=function(_0x1729de,_0x2b8d6f){return db[_0xcb60('0x33')]['create'](_0x1729de['body'],{})[_0xcb60('0x2d')](function(_0x307c1b){var _0x168f02=_0x1729de['user'][_0xcb60('0x2a')]({'plain':!![]});if(!_0x168f02)throw new Error(_0xcb60('0x4f'));if(_0x168f02[_0xcb60('0x50')]==='user'){var _0x5500e3=_0x307c1b['get']({'plain':!![]});var _0x3e3d14='Templates';return db[_0xcb60('0x51')][_0xcb60('0x4d')]({'where':{'name':_0x3e3d14,'userProfileId':_0x168f02[_0xcb60('0x52')]},'raw':!![]})[_0xcb60('0x2d')](function(_0x22c8c8){if(_0x22c8c8&&_0x22c8c8['autoAssociation']===0x0){return db[_0xcb60('0x2c')][_0xcb60('0x4e')]({'name':_0x5500e3[_0xcb60('0x30')],'resourceId':_0x5500e3['id'],'type':_0x22c8c8[_0xcb60('0x30')],'sectionId':_0x22c8c8['id']},{})['then'](function(){return _0x307c1b;});}else{return _0x307c1b;}})['catch'](function(_0x4b97ac){logger[_0xcb60('0x53')](_0xcb60('0x54'),_0x4b97ac);throw _0x4b97ac;});}return _0x307c1b;})[_0xcb60('0x2d')](respondWithResult(_0x2b8d6f,0xc9))[_0xcb60('0x4a')](handleError(_0x2b8d6f,null));};exports['update']=function(_0x3fe067,_0x27fce7){if(_0x3fe067[_0xcb60('0x55')]['id']){delete _0x3fe067[_0xcb60('0x55')]['id'];}return db['Template'][_0xcb60('0x4d')]({'where':{'id':_0x3fe067['params']['id']}})[_0xcb60('0x2d')](handleEntityNotFound(_0x27fce7,null))[_0xcb60('0x2d')](saveUpdates(_0x3fe067['body'],null))[_0xcb60('0x2d')](respondWithResult(_0x27fce7,null))[_0xcb60('0x4a')](handleError(_0x27fce7,null));};exports['destroy']=function(_0x264a94,_0x1c5af2){return db[_0xcb60('0x33')]['find']({'where':{'id':_0x264a94[_0xcb60('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c5af2,null))[_0xcb60('0x2d')](removeEntity(_0x1c5af2,null))[_0xcb60('0x4a')](handleError(_0x1c5af2,null));}; \ No newline at end of file +var _0x6423=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','name','send','index','Template','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5e68f0,_0x181383){var _0x320008=function(_0x5cf8ac){while(--_0x5cf8ac){_0x5e68f0['push'](_0x5e68f0['shift']());}};_0x320008(++_0x181383);}(_0x6423,0x14d));var _0x3642=function(_0x12fa63,_0x90e680){_0x12fa63=_0x12fa63-0x0;var _0x420563=_0x6423[_0x12fa63];return _0x420563;};'use strict';var emlformat=require(_0x3642('0x0'));var rimraf=require(_0x3642('0x1'));var zipdir=require(_0x3642('0x2'));var jsonpatch=require(_0x3642('0x3'));var rp=require(_0x3642('0x4'));var moment=require(_0x3642('0x5'));var BPromise=require(_0x3642('0x6'));var Mustache=require('mustache');var util=require(_0x3642('0x7'));var path=require(_0x3642('0x8'));var sox=require(_0x3642('0x9'));var csv=require('to-csv');var ejs=require(_0x3642('0xa'));var fs=require('fs');var fs_extra=require(_0x3642('0xb'));var _=require(_0x3642('0xc'));var squel=require(_0x3642('0xd'));var crypto=require(_0x3642('0xe'));var jsforce=require(_0x3642('0xf'));var deskjs=require(_0x3642('0x10'));var toCsv=require(_0x3642('0x11'));var querystring=require(_0x3642('0x12'));var Papa=require(_0x3642('0x13'));var Redis=require(_0x3642('0x14'));var authService=require(_0x3642('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x3642('0x16'));var hardwareService=require(_0x3642('0x17'));var logger=require('../../config/logger')(_0x3642('0x18'));var utils=require(_0x3642('0x19'));var config=require(_0x3642('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3642('0x1b'))['db'];function respondWithStatusCode(_0x343eac,_0x3575f8){_0x3575f8=_0x3575f8||0xcc;return function(_0x16f27b){if(_0x16f27b){return _0x343eac[_0x3642('0x1c')](_0x3575f8);}return _0x343eac[_0x3642('0x1d')](_0x3575f8)[_0x3642('0x1e')]();};}function respondWithResult(_0x1f8ac9,_0x185ef5){_0x185ef5=_0x185ef5||0xc8;return function(_0x235c85){if(_0x235c85){return _0x1f8ac9[_0x3642('0x1d')](_0x185ef5)[_0x3642('0x1f')](_0x235c85);}};}function respondWithFilteredResult(_0x588d4b,_0x360680){return function(_0x5ee18a){if(_0x5ee18a){var _0x48a64a=typeof _0x360680['offset']===_0x3642('0x20')&&typeof _0x360680[_0x3642('0x21')]===_0x3642('0x20');var _0x5c2afe=_0x5ee18a[_0x3642('0x22')];var _0xf55582=_0x48a64a?0x0:_0x360680[_0x3642('0x23')];var _0x145970=_0x48a64a?_0x5ee18a[_0x3642('0x22')]:_0x360680[_0x3642('0x23')]+_0x360680[_0x3642('0x21')];var _0x2e93c4;if(_0x145970>=_0x5c2afe){_0x145970=_0x5c2afe;_0x2e93c4=0xc8;}else{_0x2e93c4=0xce;}_0x588d4b[_0x3642('0x1d')](_0x2e93c4);return _0x588d4b['set'](_0x3642('0x24'),_0xf55582+'-'+_0x145970+'/'+_0x5c2afe)[_0x3642('0x1f')](_0x5ee18a);}return null;};}function patchUpdates(_0x2f993b){return function(_0x5023ae){try{jsonpatch[_0x3642('0x25')](_0x5023ae,_0x2f993b,!![]);}catch(_0x10530f){return BPromise[_0x3642('0x26')](_0x10530f);}return _0x5023ae[_0x3642('0x27')]();};}function saveUpdates(_0x4a2522,_0x2a2568){return function(_0x240e2e){if(_0x240e2e){return _0x240e2e[_0x3642('0x28')](_0x4a2522)['then'](function(_0x3d0136){return _0x3d0136;});}return null;};}function removeEntity(_0x33737e,_0x524def){return function(_0x13a9a4){if(_0x13a9a4){return _0x13a9a4[_0x3642('0x29')]()[_0x3642('0x2a')](function(){var _0x4bebfe=_0x13a9a4[_0x3642('0x2b')]({'plain':!![]});var _0x227015=_0x3642('0x2c');return db[_0x3642('0x2d')][_0x3642('0x29')]({'where':{'type':_0x227015,'resourceId':_0x4bebfe['id']}})['then'](function(){return _0x13a9a4;});})[_0x3642('0x2a')](function(){_0x33737e['status'](0xcc)[_0x3642('0x1e')]();});}};}function handleEntityNotFound(_0x216147,_0xae522f){return function(_0x2ac3bb){if(!_0x2ac3bb){_0x216147[_0x3642('0x1c')](0x194);}return _0x2ac3bb;};}function handleError(_0x272cf6,_0x46dd12){_0x46dd12=_0x46dd12||0x1f4;return function(_0x5ee64c){logger['error'](_0x5ee64c['stack']);if(_0x5ee64c['name']){delete _0x5ee64c[_0x3642('0x2e')];}_0x272cf6[_0x3642('0x1d')](_0x46dd12)[_0x3642('0x2f')](_0x5ee64c);};}exports[_0x3642('0x30')]=function(_0x5a00e1,_0xba2eba){var _0x130f21={},_0x3b5007={},_0x156b1e={'count':0x0,'rows':[]};var _0x4bf261=_['map'](db[_0x3642('0x31')][_0x3642('0x32')],function(_0x17a750){return{'name':_0x17a750['fieldName'],'type':_0x17a750[_0x3642('0x33')][_0x3642('0x34')]};});_0x3b5007[_0x3642('0x35')]=_['map'](_0x4bf261,_0x3642('0x2e'));_0x3b5007[_0x3642('0x36')]=_['keys'](_0x5a00e1['query']);_0x3b5007[_0x3642('0x37')]=_[_0x3642('0x38')](_0x3b5007[_0x3642('0x35')],_0x3b5007[_0x3642('0x36')]);_0x130f21[_0x3642('0x39')]=_[_0x3642('0x38')](_0x3b5007[_0x3642('0x35')],qs[_0x3642('0x3a')](_0x5a00e1[_0x3642('0x36')][_0x3642('0x3a')]));_0x130f21[_0x3642('0x39')]=_0x130f21[_0x3642('0x39')][_0x3642('0x3b')]?_0x130f21['attributes']:_0x3b5007[_0x3642('0x35')];if(!_0x5a00e1['query'][_0x3642('0x3c')]('nolimit')){_0x130f21[_0x3642('0x21')]=qs['limit'](_0x5a00e1['query']['limit']);_0x130f21[_0x3642('0x23')]=qs['offset'](_0x5a00e1[_0x3642('0x36')][_0x3642('0x23')]);}_0x130f21[_0x3642('0x3d')]=qs[_0x3642('0x3e')](_0x5a00e1['query'][_0x3642('0x3e')]);_0x130f21[_0x3642('0x3f')]=qs[_0x3642('0x37')](_[_0x3642('0x40')](_0x5a00e1[_0x3642('0x36')],_0x3b5007[_0x3642('0x37')]),_0x4bf261);if(_0x5a00e1[_0x3642('0x36')]['filter']){_0x130f21[_0x3642('0x3f')]=_[_0x3642('0x41')](_0x130f21[_0x3642('0x3f')],{'$or':_[_0x3642('0x42')](_0x4bf261,function(_0x56601d){if(_0x56601d['type']!=='VIRTUAL'){var _0x12effb={};_0x12effb[_0x56601d[_0x3642('0x2e')]]={'$like':'%'+_0x5a00e1[_0x3642('0x36')][_0x3642('0x43')]+'%'};return _0x12effb;}})});}_0x130f21=_['merge']({},_0x130f21,_0x5a00e1[_0x3642('0x44')]);var _0x1ab1a9={'where':_0x130f21[_0x3642('0x3f')]};return db[_0x3642('0x31')][_0x3642('0x22')](_0x1ab1a9)[_0x3642('0x2a')](function(_0xc54a32){_0x156b1e[_0x3642('0x22')]=_0xc54a32;if(_0x5a00e1[_0x3642('0x36')][_0x3642('0x45')]){_0x130f21[_0x3642('0x46')]=[{'all':!![]}];}return db[_0x3642('0x31')][_0x3642('0x47')](_0x130f21);})['then'](function(_0x3c8d95){_0x156b1e[_0x3642('0x48')]=_0x3c8d95;return _0x156b1e;})[_0x3642('0x2a')](respondWithFilteredResult(_0xba2eba,_0x130f21))[_0x3642('0x49')](handleError(_0xba2eba,null));};exports[_0x3642('0x4a')]=function(_0x17812d,_0x1017d3){var _0x21ac6b={'raw':!![],'where':{'id':_0x17812d[_0x3642('0x4b')]['id']}},_0x114b46={};_0x114b46[_0x3642('0x35')]=_[_0x3642('0x4c')](db[_0x3642('0x31')][_0x3642('0x32')]);_0x114b46[_0x3642('0x36')]=_[_0x3642('0x4c')](_0x17812d[_0x3642('0x36')]);_0x114b46[_0x3642('0x37')]=_[_0x3642('0x38')](_0x114b46[_0x3642('0x35')],_0x114b46[_0x3642('0x36')]);_0x21ac6b['attributes']=_[_0x3642('0x38')](_0x114b46[_0x3642('0x35')],qs[_0x3642('0x3a')](_0x17812d[_0x3642('0x36')][_0x3642('0x3a')]));_0x21ac6b[_0x3642('0x39')]=_0x21ac6b[_0x3642('0x39')][_0x3642('0x3b')]?_0x21ac6b[_0x3642('0x39')]:_0x114b46[_0x3642('0x35')];if(_0x17812d[_0x3642('0x36')]['includeAll']){_0x21ac6b[_0x3642('0x46')]=[{'all':!![]}];}_0x21ac6b=_[_0x3642('0x41')]({},_0x21ac6b,_0x17812d[_0x3642('0x44')]);return db[_0x3642('0x31')][_0x3642('0x4d')](_0x21ac6b)[_0x3642('0x2a')](handleEntityNotFound(_0x1017d3,null))[_0x3642('0x2a')](respondWithResult(_0x1017d3,null))['catch'](handleError(_0x1017d3,null));};exports['create']=function(_0x58702e,_0x10cffc){return db[_0x3642('0x31')][_0x3642('0x4e')](_0x58702e[_0x3642('0x4f')],{})[_0x3642('0x2a')](function(_0xe66366){var _0x4b6369=_0x58702e[_0x3642('0x50')][_0x3642('0x2b')]({'plain':!![]});if(!_0x4b6369)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b6369['role']===_0x3642('0x50')){var _0x3bb02d=_0xe66366[_0x3642('0x2b')]({'plain':!![]});var _0x1f2bf1=_0x3642('0x2c');return db[_0x3642('0x51')][_0x3642('0x4d')]({'where':{'name':_0x1f2bf1,'userProfileId':_0x4b6369[_0x3642('0x52')]},'raw':!![]})['then'](function(_0x2a89cd){if(_0x2a89cd&&_0x2a89cd[_0x3642('0x53')]===0x0){return db[_0x3642('0x2d')][_0x3642('0x4e')]({'name':_0x3bb02d[_0x3642('0x2e')],'resourceId':_0x3bb02d['id'],'type':_0x2a89cd[_0x3642('0x2e')],'sectionId':_0x2a89cd['id']},{})['then'](function(){return _0xe66366;});}else{return _0xe66366;}})[_0x3642('0x49')](function(_0x4b601d){logger['error'](_0x3642('0x54'),_0x4b601d);throw _0x4b601d;});}return _0xe66366;})[_0x3642('0x2a')](respondWithResult(_0x10cffc,0xc9))[_0x3642('0x49')](handleError(_0x10cffc,null));};exports[_0x3642('0x28')]=function(_0x50c3be,_0x13ec0b){if(_0x50c3be[_0x3642('0x4f')]['id']){delete _0x50c3be[_0x3642('0x4f')]['id'];}return db[_0x3642('0x31')][_0x3642('0x4d')]({'where':{'id':_0x50c3be[_0x3642('0x4b')]['id']}})[_0x3642('0x2a')](handleEntityNotFound(_0x13ec0b,null))[_0x3642('0x2a')](saveUpdates(_0x50c3be[_0x3642('0x4f')],null))[_0x3642('0x2a')](respondWithResult(_0x13ec0b,null))[_0x3642('0x49')](handleError(_0x13ec0b,null));};exports[_0x3642('0x29')]=function(_0x11e12b,_0x29d14b){return db[_0x3642('0x31')][_0x3642('0x4d')]({'where':{'id':_0x11e12b[_0x3642('0x4b')]['id']}})[_0x3642('0x2a')](handleEntityNotFound(_0x29d14b,null))[_0x3642('0x2a')](removeEntity(_0x29d14b,null))[_0x3642('0x49')](handleError(_0x29d14b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1b27ec9..692951e 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3155=['api','moment','request-promise','path','../../config/environment','exports','define','Template','lodash','util','../../config/logger'];(function(_0x3e079f,_0x335018){var _0xa2f130=function(_0x4726fe){while(--_0x4726fe){_0x3e079f['push'](_0x3e079f['shift']());}};_0xa2f130(++_0x335018);}(_0x3155,0x15d));var _0x5315=function(_0x559cd9,_0x161f8a){_0x559cd9=_0x559cd9-0x0;var _0x40ca25=_0x3155[_0x559cd9];return _0x40ca25;};'use strict';var _=require(_0x5315('0x0'));var util=require(_0x5315('0x1'));var logger=require(_0x5315('0x2'))(_0x5315('0x3'));var moment=require(_0x5315('0x4'));var BPromise=require('bluebird');var rp=require(_0x5315('0x5'));var fs=require('fs');var path=require(_0x5315('0x6'));var rimraf=require('rimraf');var config=require(_0x5315('0x7'));var attributes=require('./template.attributes');module[_0x5315('0x8')]=function(_0x493d3d,_0x1a4b6d){return _0x493d3d[_0x5315('0x9')](_0x5315('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d22=['request-promise','rimraf','./template.attributes','exports','define','Template','lodash','util','../../config/logger','moment'];(function(_0x1f2044,_0x430e81){var _0x4121f9=function(_0xe55bea){while(--_0xe55bea){_0x1f2044['push'](_0x1f2044['shift']());}};_0x4121f9(++_0x430e81);}(_0x3d22,0xb0));var _0x23d2=function(_0x51c7b8,_0x40d121){_0x51c7b8=_0x51c7b8-0x0;var _0x3e0678=_0x3d22[_0x51c7b8];return _0x3e0678;};'use strict';var _=require(_0x23d2('0x0'));var util=require(_0x23d2('0x1'));var logger=require(_0x23d2('0x2'))('api');var moment=require(_0x23d2('0x3'));var BPromise=require('bluebird');var rp=require(_0x23d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23d2('0x5'));var config=require('../../config/environment');var attributes=require(_0x23d2('0x6'));module[_0x23d2('0x7')]=function(_0x46259d,_0x192ec2){return _0x46259d[_0x23d2('0x8')](_0x23d2('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 342a2fe..00b5068 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf93d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTemplate','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf93d,0x11f));var _0xdf93=function(_0x302c9e,_0x3b4900){_0x302c9e=_0x302c9e-0x0;var _0x4b8771=_0xf93d[_0x302c9e];return _0x4b8771;};'use strict';var _=require('lodash');var util=require(_0xdf93('0x0'));var moment=require(_0xdf93('0x1'));var BPromise=require(_0xdf93('0x2'));var rs=require(_0xdf93('0x3'));var fs=require('fs');var Redis=require(_0xdf93('0x4'));var db=require(_0xdf93('0x5'))['db'];var utils=require(_0xdf93('0x6'));var logger=require(_0xdf93('0x7'))(_0xdf93('0x8'));var config=require(_0xdf93('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdf93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d356e,_0x5bde50,_0x3cb77b){return new BPromise(function(_0x3cbd61,_0x5b0828){return client[_0xdf93('0xb')](_0x4d356e,_0x3cb77b)['then'](function(_0x5837e6){logger[_0xdf93('0xc')](_0xdf93('0xd'),_0x5bde50,_0xdf93('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5bde50,_0xdf93('0xe'),JSON[_0xdf93('0xf')](_0x5837e6));if(_0x5837e6[_0xdf93('0x10')]){if(_0x5837e6[_0xdf93('0x10')][_0xdf93('0x11')]===0x1f4){logger[_0xdf93('0x10')](_0xdf93('0xd'),_0x5bde50,_0x5837e6[_0xdf93('0x10')]['message']);return _0x5b0828(_0x5837e6[_0xdf93('0x10')][_0xdf93('0x12')]);}logger[_0xdf93('0x10')]('Template,\x20%s,\x20%s',_0x5bde50,_0x5837e6[_0xdf93('0x10')][_0xdf93('0x12')]);return _0x3cbd61(_0x5837e6['error']['message']);}else{logger[_0xdf93('0xc')](_0xdf93('0xd'),_0x5bde50,_0xdf93('0xe'));_0x3cbd61(_0x5837e6[_0xdf93('0x13')]['message']);}})['catch'](function(_0x541e5e){logger['error'](_0xdf93('0xd'),_0x5bde50,_0x541e5e);_0x5b0828(_0x541e5e);});});}exports[_0xdf93('0x14')]=function(_0x261035){var _0x490824=this;return new Promise(function(_0x44555d,_0x5f149f){return db['Template'][_0xdf93('0x15')]({'raw':_0x261035[_0xdf93('0x16')]?_0x261035[_0xdf93('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x261035[_0xdf93('0x16')]?_0x261035[_0xdf93('0x16')][_0xdf93('0x17')]||null:null,'attributes':_0x261035['options']?_0x261035[_0xdf93('0x16')][_0xdf93('0x18')]||null:null,'limit':_0x261035[_0xdf93('0x16')]?_0x261035[_0xdf93('0x16')][_0xdf93('0x19')]||null:null,'include':_0x261035[_0xdf93('0x16')]?_0x261035[_0xdf93('0x16')][_0xdf93('0x1a')]?_[_0xdf93('0x1b')](_0x261035['options']['include'],function(_0x2cb602){return{'model':db[_0x2cb602[_0xdf93('0x1c')]],'as':_0x2cb602['as'],'attributes':_0x2cb602[_0xdf93('0x18')],'include':_0x2cb602[_0xdf93('0x1a')]?_[_0xdf93('0x1b')](_0x2cb602[_0xdf93('0x1a')],function(_0x18ea16){return{'model':db[_0x18ea16[_0xdf93('0x1c')]],'as':_0x18ea16['as'],'attributes':_0x18ea16['attributes'],'include':_0x18ea16['include']?_[_0xdf93('0x1b')](_0x18ea16[_0xdf93('0x1a')],function(_0x42e35c){return{'model':db[_0x42e35c[_0xdf93('0x1c')]],'as':_0x42e35c['as'],'attributes':_0x42e35c[_0xdf93('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdf93('0x1d')](function(_0x281616){logger[_0xdf93('0xc')](_0xdf93('0x14'),_0x261035);logger[_0xdf93('0x1e')]('GetTemplate',_0x261035,JSON[_0xdf93('0xf')](_0x281616));_0x44555d(_0x281616);})[_0xdf93('0x1f')](function(_0x27bb1b){logger[_0xdf93('0x10')](_0xdf93('0x14'),_0x27bb1b[_0xdf93('0x12')],_0x261035);_0x5f149f(_0x490824[_0xdf93('0x10')](0x1f4,_0x27bb1b[_0xdf93('0x12')]));});});}; \ No newline at end of file +var _0x4dd9=['info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4dd9,0x1f2));var _0x94dd=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x4dd9[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0x94dd('0x0'));var util=require(_0x94dd('0x1'));var moment=require(_0x94dd('0x2'));var BPromise=require(_0x94dd('0x3'));var rs=require(_0x94dd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x94dd('0x5'));var logger=require(_0x94dd('0x6'))(_0x94dd('0x7'));var config=require(_0x94dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x94dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29b4b4,_0x2e197c,_0x11b74f){return new BPromise(function(_0x3391d5,_0x2c6f82){return client[_0x94dd('0xa')](_0x29b4b4,_0x11b74f)[_0x94dd('0xb')](function(_0x518074){logger[_0x94dd('0xc')](_0x94dd('0xd'),_0x2e197c,'request\x20sent');logger[_0x94dd('0xe')](_0x94dd('0xf'),_0x2e197c,_0x94dd('0x10'),JSON['stringify'](_0x518074));if(_0x518074[_0x94dd('0x11')]){if(_0x518074[_0x94dd('0x11')][_0x94dd('0x12')]===0x1f4){logger[_0x94dd('0x11')](_0x94dd('0xd'),_0x2e197c,_0x518074['error'][_0x94dd('0x13')]);return _0x2c6f82(_0x518074[_0x94dd('0x11')]['message']);}logger[_0x94dd('0x11')](_0x94dd('0xd'),_0x2e197c,_0x518074[_0x94dd('0x11')][_0x94dd('0x13')]);return _0x3391d5(_0x518074[_0x94dd('0x11')][_0x94dd('0x13')]);}else{logger[_0x94dd('0xc')](_0x94dd('0xd'),_0x2e197c,_0x94dd('0x10'));_0x3391d5(_0x518074[_0x94dd('0x14')][_0x94dd('0x13')]);}})[_0x94dd('0x15')](function(_0x170eb6){logger[_0x94dd('0x11')](_0x94dd('0xd'),_0x2e197c,_0x170eb6);_0x2c6f82(_0x170eb6);});});}exports[_0x94dd('0x16')]=function(_0x623d7e){var _0x49f1d3=this;return new Promise(function(_0x4501ce,_0x8cb21e){return db[_0x94dd('0x17')][_0x94dd('0x18')]({'raw':_0x623d7e[_0x94dd('0x19')]?_0x623d7e[_0x94dd('0x19')][_0x94dd('0x1a')]===undefined?!![]:![]:!![],'where':_0x623d7e['options']?_0x623d7e[_0x94dd('0x19')][_0x94dd('0x1b')]||null:null,'attributes':_0x623d7e[_0x94dd('0x19')]?_0x623d7e[_0x94dd('0x19')][_0x94dd('0x1c')]||null:null,'limit':_0x623d7e[_0x94dd('0x19')]?_0x623d7e['options'][_0x94dd('0x1d')]||null:null,'include':_0x623d7e[_0x94dd('0x19')]?_0x623d7e['options'][_0x94dd('0x1e')]?_['map'](_0x623d7e[_0x94dd('0x19')][_0x94dd('0x1e')],function(_0xd000f9){return{'model':db[_0xd000f9[_0x94dd('0x1f')]],'as':_0xd000f9['as'],'attributes':_0xd000f9[_0x94dd('0x1c')],'include':_0xd000f9[_0x94dd('0x1e')]?_[_0x94dd('0x20')](_0xd000f9['include'],function(_0x126d98){return{'model':db[_0x126d98[_0x94dd('0x1f')]],'as':_0x126d98['as'],'attributes':_0x126d98['attributes'],'include':_0x126d98[_0x94dd('0x1e')]?_['map'](_0x126d98['include'],function(_0x3aec18){return{'model':db[_0x3aec18[_0x94dd('0x1f')]],'as':_0x3aec18['as'],'attributes':_0x3aec18['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x993c9f){logger[_0x94dd('0xc')](_0x94dd('0x16'),_0x623d7e);logger[_0x94dd('0xe')](_0x94dd('0x16'),_0x623d7e,JSON[_0x94dd('0x21')](_0x993c9f));_0x4501ce(_0x993c9f);})[_0x94dd('0x15')](function(_0x2afaa1){logger[_0x94dd('0x11')](_0x94dd('0x16'),_0x2afaa1['message'],_0x623d7e);_0x8cb21e(_0x49f1d3['error'](0x1f4,_0x2afaa1['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1c8d827..f0e554c 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96f0=['delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','/:id/any_conditions','getActions','create','post','addAllCondition','/:id/actions','addAction','update'];(function(_0x5de235,_0x679bec){var _0x18917d=function(_0x40f6a9){while(--_0x40f6a9){_0x5de235['push'](_0x5de235['shift']());}};_0x18917d(++_0x679bec);}(_0x96f0,0x13b));var _0x096f=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x96f0[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0x096f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x096f('0x1'));var router=express[_0x096f('0x2')]();var fs_extra=require(_0x096f('0x3'));var auth=require(_0x096f('0x4'));var interaction=require(_0x096f('0x5'));var config=require(_0x096f('0x6'));var controller=require(_0x096f('0x7'));router[_0x096f('0x8')]('/',auth[_0x096f('0x9')](),controller[_0x096f('0xa')]);router[_0x096f('0x8')](_0x096f('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x096f('0xc'),auth[_0x096f('0x9')](),controller['getAllConditions']);router[_0x096f('0x8')](_0x096f('0xd'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x096f('0x8')]('/:id/actions',auth[_0x096f('0x9')](),controller[_0x096f('0xe')]);router['post']('/',auth[_0x096f('0x9')](),controller[_0x096f('0xf')]);router[_0x096f('0x10')](_0x096f('0xc'),auth[_0x096f('0x9')](),controller[_0x096f('0x11')]);router['post'](_0x096f('0xd'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x096f('0x10')](_0x096f('0x12'),auth[_0x096f('0x9')](),controller[_0x096f('0x13')]);router['put'](_0x096f('0xb'),auth[_0x096f('0x9')](),controller[_0x096f('0x14')]);router[_0x096f('0x15')](_0x096f('0xb'),auth[_0x096f('0x9')](),controller[_0x096f('0x16')]);module[_0x096f('0x17')]=router; \ No newline at end of file +var _0x5cfa=['get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./trigger.controller'];(function(_0x254dd7,_0x57459d){var _0x3037a3=function(_0x585334){while(--_0x585334){_0x254dd7['push'](_0x254dd7['shift']());}};_0x3037a3(++_0x57459d);}(_0x5cfa,0x1bb));var _0xa5cf=function(_0x5c3df0,_0x29c1fa){_0x5c3df0=_0x5c3df0-0x0;var _0xc50990=_0x5cfa[_0x5c3df0];return _0xc50990;};'use strict';var multer=require(_0xa5cf('0x0'));var util=require(_0xa5cf('0x1'));var path=require(_0xa5cf('0x2'));var timeout=require(_0xa5cf('0x3'));var express=require('express');var router=express[_0xa5cf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5cf('0x5'));var controller=require(_0xa5cf('0x6'));router[_0xa5cf('0x7')]('/',auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x9')]);router['get'](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller['show']);router[_0xa5cf('0x7')](_0xa5cf('0xb'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xc')]);router[_0xa5cf('0x7')](_0xa5cf('0xd'),auth[_0xa5cf('0x8')](),controller['getAnyConditions']);router[_0xa5cf('0x7')](_0xa5cf('0xe'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa5cf('0x10')]);router[_0xa5cf('0x11')](_0xa5cf('0xb'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x12')]);router[_0xa5cf('0x11')](_0xa5cf('0xd'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x13')]);router[_0xa5cf('0x11')](_0xa5cf('0xe'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x14')]);router[_0xa5cf('0x15')]('/:id',auth[_0xa5cf('0x8')](),controller['update']);router[_0xa5cf('0x16')](_0xa5cf('0xa'),auth[_0xa5cf('0x8')](),controller[_0xa5cf('0x17')]);module[_0xa5cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d682160..6fd2b6d 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6278=['sequelize','exports','STRING','BOOLEAN'];(function(_0x743467,_0x3c5088){var _0x4e7041=function(_0x4a237f){while(--_0x4a237f){_0x743467['push'](_0x743467['shift']());}};_0x4e7041(++_0x3c5088);}(_0x6278,0x7c));var _0x8627=function(_0x2da402,_0x14a691){_0x2da402=_0x2da402-0x0;var _0x31a57d=_0x6278[_0x2da402];return _0x31a57d;};'use strict';var Sequelize=require(_0x8627('0x0'));module[_0x8627('0x1')]={'name':{'type':Sequelize[_0x8627('0x2')]},'channel':{'type':Sequelize[_0x8627('0x2')]},'description':{'type':Sequelize[_0x8627('0x2')]},'status':{'type':Sequelize[_0x8627('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x11ea=['sequelize','STRING','BOOLEAN'];(function(_0x5f2575,_0x629eca){var _0x2afd50=function(_0x1a77e5){while(--_0x1a77e5){_0x5f2575['push'](_0x5f2575['shift']());}};_0x2afd50(++_0x629eca);}(_0x11ea,0x16e));var _0xa11e=function(_0x7fc002,_0x20912a){_0x7fc002=_0x7fc002-0x0;var _0x2d28dd=_0x11ea[_0x7fc002];return _0x2d28dd;};'use strict';var Sequelize=require(_0xa11e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa11e('0x1')]},'channel':{'type':Sequelize[_0xa11e('0x1')]},'description':{'type':Sequelize[_0xa11e('0x1')]},'status':{'type':Sequelize[_0xa11e('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index c241da0..97ca038 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd602=['../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Triggers','UserProfileResource','destroy','sendStatus','error','name','send','index','map','Trigger','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','catch','rawAttributes','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','findOne','getAllConditions','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0x3aaef5,_0x16cdc8){var _0x4c0ed5=function(_0x4f7046){while(--_0x4f7046){_0x3aaef5['push'](_0x3aaef5['shift']());}};_0x4c0ed5(++_0x16cdc8);}(_0xd602,0x15c));var _0x2d60=function(_0x3352d9,_0x135e43){_0x3352d9=_0x3352d9-0x0;var _0x1a4d15=_0xd602[_0x3352d9];return _0x1a4d15;};'use strict';var emlformat=require(_0x2d60('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d60('0x1'));var rp=require(_0x2d60('0x2'));var moment=require(_0x2d60('0x3'));var BPromise=require(_0x2d60('0x4'));var Mustache=require(_0x2d60('0x5'));var util=require('util');var path=require(_0x2d60('0x6'));var sox=require(_0x2d60('0x7'));var csv=require(_0x2d60('0x8'));var ejs=require(_0x2d60('0x9'));var fs=require('fs');var fs_extra=require(_0x2d60('0xa'));var _=require(_0x2d60('0xb'));var squel=require('squel');var crypto=require(_0x2d60('0xc'));var jsforce=require(_0x2d60('0xd'));var deskjs=require(_0x2d60('0xe'));var toCsv=require(_0x2d60('0x8'));var querystring=require(_0x2d60('0xf'));var Papa=require(_0x2d60('0x10'));var Redis=require(_0x2d60('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2d60('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d60('0x13'));var utils=require(_0x2d60('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d60('0x15'));var db=require(_0x2d60('0x16'))['db'];function respondWithStatusCode(_0x12aba0,_0x424d53){_0x424d53=_0x424d53||0xcc;return function(_0x50905d){if(_0x50905d){return _0x12aba0['sendStatus'](_0x424d53);}return _0x12aba0['status'](_0x424d53)[_0x2d60('0x17')]();};}function respondWithResult(_0x5e7c89,_0xfa33e){_0xfa33e=_0xfa33e||0xc8;return function(_0x6aa3bf){if(_0x6aa3bf){return _0x5e7c89[_0x2d60('0x18')](_0xfa33e)['json'](_0x6aa3bf);}};}function respondWithFilteredResult(_0x18d843,_0x1f2d91){return function(_0x1d89a0){if(_0x1d89a0){var _0x2acb4f=typeof _0x1f2d91[_0x2d60('0x19')]===_0x2d60('0x1a')&&typeof _0x1f2d91[_0x2d60('0x1b')]===_0x2d60('0x1a');var _0x441c1f=_0x1d89a0['count'];var _0x30c63a=_0x2acb4f?0x0:_0x1f2d91[_0x2d60('0x19')];var _0xde3067=_0x2acb4f?_0x1d89a0[_0x2d60('0x1c')]:_0x1f2d91[_0x2d60('0x19')]+_0x1f2d91[_0x2d60('0x1b')];var _0x86fdc4;if(_0xde3067>=_0x441c1f){_0xde3067=_0x441c1f;_0x86fdc4=0xc8;}else{_0x86fdc4=0xce;}_0x18d843['status'](_0x86fdc4);return _0x18d843[_0x2d60('0x1d')](_0x2d60('0x1e'),_0x30c63a+'-'+_0xde3067+'/'+_0x441c1f)[_0x2d60('0x1f')](_0x1d89a0);}return null;};}function patchUpdates(_0x4e816e){return function(_0x44c39f){try{jsonpatch[_0x2d60('0x20')](_0x44c39f,_0x4e816e,!![]);}catch(_0x56e22e){return BPromise[_0x2d60('0x21')](_0x56e22e);}return _0x44c39f['save']();};}function saveUpdates(_0x4ec522,_0x332ca0){return function(_0x449522){if(_0x449522){return _0x449522[_0x2d60('0x22')](_0x4ec522)['then'](function(_0x38be3f){return _0x38be3f;});}return null;};}function removeEntity(_0x55358f,_0x572304){return function(_0x11e523){if(_0x11e523){return _0x11e523['destroy']()[_0x2d60('0x23')](function(){var _0x5a1307=_0x11e523[_0x2d60('0x24')]({'plain':!![]});var _0x2d44ad=_0x2d60('0x25');return db[_0x2d60('0x26')][_0x2d60('0x27')]({'where':{'type':_0x2d44ad,'resourceId':_0x5a1307['id']}})[_0x2d60('0x23')](function(){return _0x11e523;});})['then'](function(){_0x55358f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe9cfd1,_0xbc7368){return function(_0x5866e9){if(!_0x5866e9){_0xe9cfd1[_0x2d60('0x28')](0x194);}return _0x5866e9;};}function handleError(_0x2146f7,_0x66efd6){_0x66efd6=_0x66efd6||0x1f4;return function(_0x1ee5ce){logger[_0x2d60('0x29')](_0x1ee5ce['stack']);if(_0x1ee5ce[_0x2d60('0x2a')]){delete _0x1ee5ce[_0x2d60('0x2a')];}_0x2146f7[_0x2d60('0x18')](_0x66efd6)[_0x2d60('0x2b')](_0x1ee5ce);};}exports[_0x2d60('0x2c')]=function(_0x6af877,_0x8e5ea4){var _0x886434={},_0x14db8b={},_0x4e8977={'count':0x0,'rows':[]};var _0x4cb27f=_[_0x2d60('0x2d')](db[_0x2d60('0x2e')]['rawAttributes'],function(_0x369b4f){return{'name':_0x369b4f[_0x2d60('0x2f')],'type':_0x369b4f[_0x2d60('0x30')]['key']};});_0x14db8b[_0x2d60('0x31')]=_[_0x2d60('0x2d')](_0x4cb27f,_0x2d60('0x2a'));_0x14db8b[_0x2d60('0x32')]=_[_0x2d60('0x33')](_0x6af877[_0x2d60('0x32')]);_0x14db8b[_0x2d60('0x34')]=_[_0x2d60('0x35')](_0x14db8b[_0x2d60('0x31')],_0x14db8b['query']);_0x886434[_0x2d60('0x36')]=_[_0x2d60('0x35')](_0x14db8b['model'],qs[_0x2d60('0x37')](_0x6af877[_0x2d60('0x32')][_0x2d60('0x37')]));_0x886434['attributes']=_0x886434[_0x2d60('0x36')][_0x2d60('0x38')]?_0x886434[_0x2d60('0x36')]:_0x14db8b[_0x2d60('0x31')];if(!_0x6af877[_0x2d60('0x32')]['hasOwnProperty'](_0x2d60('0x39'))){_0x886434['limit']=qs[_0x2d60('0x1b')](_0x6af877['query'][_0x2d60('0x1b')]);_0x886434[_0x2d60('0x19')]=qs['offset'](_0x6af877[_0x2d60('0x32')]['offset']);}_0x886434[_0x2d60('0x3a')]=qs[_0x2d60('0x3b')](_0x6af877[_0x2d60('0x32')]['sort']);_0x886434[_0x2d60('0x3c')]=qs[_0x2d60('0x34')](_[_0x2d60('0x3d')](_0x6af877[_0x2d60('0x32')],_0x14db8b[_0x2d60('0x34')]),_0x4cb27f);if(_0x6af877['query']['filter']){_0x886434[_0x2d60('0x3c')]=_['merge'](_0x886434[_0x2d60('0x3c')],{'$or':_[_0x2d60('0x2d')](_0x4cb27f,function(_0x415809){if(_0x415809['type']!==_0x2d60('0x3e')){var _0x23bd0d={};_0x23bd0d[_0x415809[_0x2d60('0x2a')]]={'$like':'%'+_0x6af877[_0x2d60('0x32')][_0x2d60('0x3f')]+'%'};return _0x23bd0d;}})});}_0x886434=_['merge']({},_0x886434,_0x6af877[_0x2d60('0x40')]);var _0x4c291f={'where':_0x886434['where']};return db[_0x2d60('0x2e')][_0x2d60('0x1c')](_0x4c291f)['then'](function(_0x34aba){_0x4e8977[_0x2d60('0x1c')]=_0x34aba;if(_0x6af877[_0x2d60('0x32')]['includeAll']){_0x886434[_0x2d60('0x41')]=[{'all':!![]}];}return db['Trigger'][_0x2d60('0x42')](_0x886434);})['then'](function(_0x3245ab){_0x4e8977[_0x2d60('0x43')]=_0x3245ab;return _0x4e8977;})[_0x2d60('0x23')](respondWithFilteredResult(_0x8e5ea4,_0x886434))[_0x2d60('0x44')](handleError(_0x8e5ea4,null));};exports['show']=function(_0x316ce0,_0x30ed8f){var _0x45d67b={'raw':![],'where':{'id':_0x316ce0['params']['id']}},_0x469250={};_0x469250[_0x2d60('0x31')]=_[_0x2d60('0x33')](db[_0x2d60('0x2e')][_0x2d60('0x45')]);_0x469250[_0x2d60('0x32')]=_[_0x2d60('0x33')](_0x316ce0[_0x2d60('0x32')]);_0x469250['filters']=_[_0x2d60('0x35')](_0x469250[_0x2d60('0x31')],_0x469250[_0x2d60('0x32')]);_0x45d67b['attributes']=_[_0x2d60('0x35')](_0x469250['model'],qs['fields'](_0x316ce0[_0x2d60('0x32')][_0x2d60('0x37')]));_0x45d67b[_0x2d60('0x36')]=_0x45d67b['attributes'][_0x2d60('0x38')]?_0x45d67b[_0x2d60('0x36')]:_0x469250[_0x2d60('0x31')];if(_0x316ce0['query']['includeAll']){_0x45d67b[_0x2d60('0x41')]=[{'all':!![]}];}_0x45d67b=_[_0x2d60('0x46')]({},_0x45d67b,_0x316ce0[_0x2d60('0x40')]);return db[_0x2d60('0x2e')][_0x2d60('0x47')](_0x45d67b)[_0x2d60('0x23')](handleEntityNotFound(_0x30ed8f,null))[_0x2d60('0x23')](respondWithResult(_0x30ed8f,null))[_0x2d60('0x44')](handleError(_0x30ed8f,null));};exports[_0x2d60('0x48')]=function(_0x4e6ad7,_0x4ae707){return db[_0x2d60('0x2e')][_0x2d60('0x48')](_0x4e6ad7[_0x2d60('0x49')],{})[_0x2d60('0x23')](function(_0x34ef10){var _0x5c15fd=_0x4e6ad7[_0x2d60('0x4a')][_0x2d60('0x24')]({'plain':!![]});if(!_0x5c15fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c15fd[_0x2d60('0x4b')]===_0x2d60('0x4a')){var _0x2babda=_0x34ef10[_0x2d60('0x24')]({'plain':!![]});var _0x2d7a36=_0x2d60('0x25');return db[_0x2d60('0x4c')][_0x2d60('0x47')]({'where':{'name':_0x2d7a36,'userProfileId':_0x5c15fd[_0x2d60('0x4d')]},'raw':!![]})[_0x2d60('0x23')](function(_0x54440c){if(_0x54440c&&_0x54440c[_0x2d60('0x4e')]===0x0){return db[_0x2d60('0x26')][_0x2d60('0x48')]({'name':_0x2babda[_0x2d60('0x2a')],'resourceId':_0x2babda['id'],'type':_0x54440c['name'],'sectionId':_0x54440c['id']},{})[_0x2d60('0x23')](function(){return _0x34ef10;});}else{return _0x34ef10;}})[_0x2d60('0x44')](function(_0x54f0cd){logger[_0x2d60('0x29')](_0x2d60('0x4f'),_0x54f0cd);throw _0x54f0cd;});}return _0x34ef10;})[_0x2d60('0x23')](respondWithResult(_0x4ae707,0xc9))[_0x2d60('0x44')](handleError(_0x4ae707,null));};exports[_0x2d60('0x22')]=function(_0x4fb61f,_0x135bff){if(_0x4fb61f['body']['id']){delete _0x4fb61f['body']['id'];}return db[_0x2d60('0x2e')][_0x2d60('0x47')]({'where':{'id':_0x4fb61f[_0x2d60('0x50')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x135bff,null))[_0x2d60('0x23')](saveUpdates(_0x4fb61f[_0x2d60('0x49')],null))['then'](respondWithResult(_0x135bff,null))[_0x2d60('0x44')](handleError(_0x135bff,null));};exports[_0x2d60('0x27')]=function(_0x4d5f53,_0x8b9f8d){return db[_0x2d60('0x2e')][_0x2d60('0x47')]({'where':{'id':_0x4d5f53[_0x2d60('0x50')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x8b9f8d,null))[_0x2d60('0x23')](removeEntity(_0x8b9f8d,null))[_0x2d60('0x44')](handleError(_0x8b9f8d,null));};exports[_0x2d60('0x51')]=function(_0x67fd2c,_0x49c98f,_0x303575){if(_0x67fd2c[_0x2d60('0x49')]['id']){delete _0x67fd2c[_0x2d60('0x49')]['id'];}return db[_0x2d60('0x2e')][_0x2d60('0x47')]({'where':{'id':_0x67fd2c['params']['id']}})['then'](handleEntityNotFound(_0x49c98f,null))['then'](function(_0x1e5233){if(_0x1e5233){_0x67fd2c[_0x2d60('0x49')][_0x2d60('0x52')]=_0x1e5233['id'];return db[_0x2d60('0x53')][_0x2d60('0x48')](_0x67fd2c[_0x2d60('0x49')]);}})['then'](respondWithResult(_0x49c98f,null))[_0x2d60('0x44')](handleError(_0x49c98f,null));};exports['addAnyCondition']=function(_0x141841,_0x151d8d,_0x3b0aa2){if(_0x141841[_0x2d60('0x49')]['id']){delete _0x141841[_0x2d60('0x49')]['id'];}return db[_0x2d60('0x2e')]['find']({'where':{'id':_0x141841[_0x2d60('0x50')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x151d8d,null))[_0x2d60('0x23')](function(_0x325745){if(_0x325745){_0x141841[_0x2d60('0x49')][_0x2d60('0x54')]=_0x325745['id'];return db[_0x2d60('0x53')][_0x2d60('0x48')](_0x141841[_0x2d60('0x49')]);}})[_0x2d60('0x23')](respondWithResult(_0x151d8d,null))[_0x2d60('0x44')](handleError(_0x151d8d,null));};exports['getAllConditions']=function(_0x4fe2e7,_0xe06d30,_0x374f4b){var _0x4a0c05={};var _0x474956={};var _0x50c7bf;var _0x3da7a8;return db[_0x2d60('0x2e')][_0x2d60('0x55')]({'where':{'id':_0x4fe2e7[_0x2d60('0x50')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0xe06d30,null))[_0x2d60('0x23')](function(_0x400046){if(_0x400046){_0x50c7bf=_0x400046;_0x474956['model']=_[_0x2d60('0x33')](db[_0x2d60('0x53')][_0x2d60('0x45')]);_0x474956['query']=_['keys'](_0x4fe2e7['query']);_0x474956[_0x2d60('0x34')]=_[_0x2d60('0x35')](_0x474956[_0x2d60('0x31')],_0x474956[_0x2d60('0x32')]);_0x4a0c05[_0x2d60('0x36')]=_['intersection'](_0x474956[_0x2d60('0x31')],qs[_0x2d60('0x37')](_0x4fe2e7[_0x2d60('0x32')][_0x2d60('0x37')]));_0x4a0c05[_0x2d60('0x36')]=_0x4a0c05['attributes'][_0x2d60('0x38')]?_0x4a0c05[_0x2d60('0x36')]:_0x474956[_0x2d60('0x31')];_0x4a0c05[_0x2d60('0x3a')]=qs[_0x2d60('0x3b')](_0x4fe2e7['query']['sort']);_0x4a0c05['where']=qs[_0x2d60('0x34')](_[_0x2d60('0x3d')](_0x4fe2e7[_0x2d60('0x32')],_0x474956[_0x2d60('0x34')]));if(_0x4fe2e7[_0x2d60('0x32')][_0x2d60('0x3f')]){_0x4a0c05['where']=_[_0x2d60('0x46')](_0x4a0c05[_0x2d60('0x3c')],{'$or':_[_0x2d60('0x2d')](_0x4a0c05[_0x2d60('0x36')],function(_0x2df98a){var _0x43aaf9={};_0x43aaf9[_0x2df98a]={'$like':'%'+_0x4fe2e7[_0x2d60('0x32')][_0x2d60('0x3f')]+'%'};return _0x43aaf9;})});}_0x4a0c05=_[_0x2d60('0x46')]({},_0x4a0c05,_0x4fe2e7[_0x2d60('0x40')]);return _0x50c7bf[_0x2d60('0x56')](_0x4a0c05);}})[_0x2d60('0x23')](function(_0x37e029){if(_0x37e029){_0x3da7a8=_0x37e029['length'];if(!_0x4fe2e7[_0x2d60('0x32')][_0x2d60('0x57')](_0x2d60('0x39'))){_0x4a0c05['limit']=qs[_0x2d60('0x1b')](_0x4fe2e7['query'][_0x2d60('0x1b')]);_0x4a0c05[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x4fe2e7[_0x2d60('0x32')][_0x2d60('0x19')]);}return _0x50c7bf['getAllConditions'](_0x4a0c05);}})[_0x2d60('0x23')](function(_0x100f6d){if(_0x100f6d){return _0x100f6d?{'count':_0x3da7a8,'rows':_0x100f6d}:null;}})[_0x2d60('0x23')](respondWithResult(_0xe06d30,null))[_0x2d60('0x44')](handleError(_0xe06d30,null));};exports['getAnyConditions']=function(_0x3a761f,_0x1eefd2,_0x297e3e){var _0x3f3d3b={};var _0x36227f={};var _0xb3a98c;var _0x45bde2;return db[_0x2d60('0x2e')][_0x2d60('0x55')]({'where':{'id':_0x3a761f[_0x2d60('0x50')]['id']}})['then'](handleEntityNotFound(_0x1eefd2,null))[_0x2d60('0x23')](function(_0x2921ba){if(_0x2921ba){_0xb3a98c=_0x2921ba;_0x36227f[_0x2d60('0x31')]=_[_0x2d60('0x33')](db[_0x2d60('0x53')]['rawAttributes']);_0x36227f[_0x2d60('0x32')]=_['keys'](_0x3a761f['query']);_0x36227f[_0x2d60('0x34')]=_[_0x2d60('0x35')](_0x36227f[_0x2d60('0x31')],_0x36227f[_0x2d60('0x32')]);_0x3f3d3b[_0x2d60('0x36')]=_[_0x2d60('0x35')](_0x36227f['model'],qs[_0x2d60('0x37')](_0x3a761f['query'][_0x2d60('0x37')]));_0x3f3d3b[_0x2d60('0x36')]=_0x3f3d3b[_0x2d60('0x36')][_0x2d60('0x38')]?_0x3f3d3b['attributes']:_0x36227f['model'];_0x3f3d3b[_0x2d60('0x3a')]=qs[_0x2d60('0x3b')](_0x3a761f['query'][_0x2d60('0x3b')]);_0x3f3d3b['where']=qs['filters'](_['pick'](_0x3a761f[_0x2d60('0x32')],_0x36227f[_0x2d60('0x34')]));if(_0x3a761f[_0x2d60('0x32')][_0x2d60('0x3f')]){_0x3f3d3b[_0x2d60('0x3c')]=_[_0x2d60('0x46')](_0x3f3d3b[_0x2d60('0x3c')],{'$or':_['map'](_0x3f3d3b[_0x2d60('0x36')],function(_0x5993bd){var _0x25ddc6={};_0x25ddc6[_0x5993bd]={'$like':'%'+_0x3a761f[_0x2d60('0x32')][_0x2d60('0x3f')]+'%'};return _0x25ddc6;})});}_0x3f3d3b=_[_0x2d60('0x46')]({},_0x3f3d3b,_0x3a761f['options']);return _0xb3a98c[_0x2d60('0x58')](_0x3f3d3b);}})[_0x2d60('0x23')](function(_0x1f54a8){if(_0x1f54a8){_0x45bde2=_0x1f54a8['length'];if(!_0x3a761f[_0x2d60('0x32')][_0x2d60('0x57')]('nolimit')){_0x3f3d3b['limit']=qs[_0x2d60('0x1b')](_0x3a761f[_0x2d60('0x32')][_0x2d60('0x1b')]);_0x3f3d3b[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x3a761f['query']['offset']);}return _0xb3a98c['getAnyConditions'](_0x3f3d3b);}})[_0x2d60('0x23')](function(_0x4dade3){if(_0x4dade3){return _0x4dade3?{'count':_0x45bde2,'rows':_0x4dade3}:null;}})[_0x2d60('0x23')](respondWithResult(_0x1eefd2,null))[_0x2d60('0x44')](handleError(_0x1eefd2,null));};exports['addAction']=function(_0x13cca7,_0x7f4278,_0x8b7bf3){if(_0x13cca7[_0x2d60('0x49')]['id']){delete _0x13cca7[_0x2d60('0x49')]['id'];}return db[_0x2d60('0x2e')][_0x2d60('0x47')]({'where':{'id':_0x13cca7['params']['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x7f4278,null))[_0x2d60('0x23')](function(_0x4a718a){if(_0x4a718a){_0x13cca7[_0x2d60('0x49')][_0x2d60('0x59')]=_0x4a718a['id'];return db[_0x2d60('0x5a')][_0x2d60('0x48')](_0x13cca7[_0x2d60('0x49')]);}})[_0x2d60('0x23')](respondWithResult(_0x7f4278,null))['catch'](handleError(_0x7f4278,null));};exports[_0x2d60('0x5b')]=function(_0x78adb7,_0xab3fc5,_0x466e6a){var _0x4465ee={};var _0x3ec73d={};var _0x372e0a;var _0x2ca977;return db[_0x2d60('0x2e')]['findOne']({'where':{'id':_0x78adb7[_0x2d60('0x50')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0xab3fc5,null))[_0x2d60('0x23')](function(_0x4dfc62){if(_0x4dfc62){_0x372e0a=_0x4dfc62;_0x3ec73d[_0x2d60('0x31')]=_[_0x2d60('0x33')](db['Action']['rawAttributes']);_0x3ec73d[_0x2d60('0x32')]=_['keys'](_0x78adb7[_0x2d60('0x32')]);_0x3ec73d['filters']=_[_0x2d60('0x35')](_0x3ec73d[_0x2d60('0x31')],_0x3ec73d[_0x2d60('0x32')]);_0x4465ee[_0x2d60('0x36')]=_['intersection'](_0x3ec73d[_0x2d60('0x31')],qs['fields'](_0x78adb7[_0x2d60('0x32')][_0x2d60('0x37')]));_0x4465ee['attributes']=_0x4465ee[_0x2d60('0x36')]['length']?_0x4465ee['attributes']:_0x3ec73d[_0x2d60('0x31')];_0x4465ee[_0x2d60('0x3a')]=qs[_0x2d60('0x3b')](_0x78adb7[_0x2d60('0x32')][_0x2d60('0x3b')]);_0x4465ee[_0x2d60('0x3c')]=qs[_0x2d60('0x34')](_[_0x2d60('0x3d')](_0x78adb7['query'],_0x3ec73d[_0x2d60('0x34')]));if(_0x78adb7[_0x2d60('0x32')][_0x2d60('0x3f')]){_0x4465ee[_0x2d60('0x3c')]=_[_0x2d60('0x46')](_0x4465ee[_0x2d60('0x3c')],{'$or':_[_0x2d60('0x2d')](_0x4465ee[_0x2d60('0x36')],function(_0x2dd87b){var _0x2513be={};_0x2513be[_0x2dd87b]={'$like':'%'+_0x78adb7[_0x2d60('0x32')][_0x2d60('0x3f')]+'%'};return _0x2513be;})});}_0x4465ee=_[_0x2d60('0x46')]({},_0x4465ee,_0x78adb7[_0x2d60('0x40')]);return _0x372e0a[_0x2d60('0x5b')](_0x4465ee);}})[_0x2d60('0x23')](function(_0x426b03){if(_0x426b03){_0x2ca977=_0x426b03[_0x2d60('0x38')];if(!_0x78adb7['query']['hasOwnProperty']('nolimit')){_0x4465ee[_0x2d60('0x1b')]=qs[_0x2d60('0x1b')](_0x78adb7['query']['limit']);_0x4465ee[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x78adb7[_0x2d60('0x32')][_0x2d60('0x19')]);}return _0x372e0a['getActions'](_0x4465ee);}})[_0x2d60('0x23')](function(_0x1def9a){if(_0x1def9a){return _0x1def9a?{'count':_0x2ca977,'rows':_0x1def9a}:null;}})[_0x2d60('0x23')](respondWithResult(_0xab3fc5,null))[_0x2d60('0x44')](handleError(_0xab3fc5,null));}; \ No newline at end of file +var _0xa997=['type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','Trigger','includeAll','findAll','rows','show','params','intersection','include','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','pick','options','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','then','get','Triggers','error','stack','name','send','map','rawAttributes'];(function(_0x2ad4c0,_0x176ba4){var _0x50553d=function(_0x14f793){while(--_0x14f793){_0x2ad4c0['push'](_0x2ad4c0['shift']());}};_0x50553d(++_0x176ba4);}(_0xa997,0xeb));var _0x7a99=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0xa997[_0x23f0e1];return _0x257f0d;};'use strict';var emlformat=require(_0x7a99('0x0'));var rimraf=require(_0x7a99('0x1'));var zipdir=require(_0x7a99('0x2'));var jsonpatch=require(_0x7a99('0x3'));var rp=require(_0x7a99('0x4'));var moment=require(_0x7a99('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7a99('0x6'));var path=require(_0x7a99('0x7'));var sox=require(_0x7a99('0x8'));var csv=require(_0x7a99('0x9'));var ejs=require(_0x7a99('0xa'));var fs=require('fs');var fs_extra=require(_0x7a99('0xb'));var _=require(_0x7a99('0xc'));var squel=require(_0x7a99('0xd'));var crypto=require(_0x7a99('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7a99('0xf'));var Papa=require(_0x7a99('0x10'));var Redis=require(_0x7a99('0x11'));var authService=require(_0x7a99('0x12'));var qs=require(_0x7a99('0x13'));var as=require(_0x7a99('0x14'));var hardwareService=require(_0x7a99('0x15'));var logger=require(_0x7a99('0x16'))('api');var utils=require(_0x7a99('0x17'));var config=require(_0x7a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a99('0x19'))['db'];function respondWithStatusCode(_0x590644,_0x540ea9){_0x540ea9=_0x540ea9||0xcc;return function(_0x551e99){if(_0x551e99){return _0x590644[_0x7a99('0x1a')](_0x540ea9);}return _0x590644[_0x7a99('0x1b')](_0x540ea9)['end']();};}function respondWithResult(_0x5b87c6,_0x1c8aa1){_0x1c8aa1=_0x1c8aa1||0xc8;return function(_0x14d5e4){if(_0x14d5e4){return _0x5b87c6['status'](_0x1c8aa1)[_0x7a99('0x1c')](_0x14d5e4);}};}function respondWithFilteredResult(_0x47b679,_0x2cd470){return function(_0x15ea62){if(_0x15ea62){var _0x411a8f=typeof _0x2cd470[_0x7a99('0x1d')]==='undefined'&&typeof _0x2cd470[_0x7a99('0x1e')]===_0x7a99('0x1f');var _0x397748=_0x15ea62[_0x7a99('0x20')];var _0xed09d4=_0x411a8f?0x0:_0x2cd470[_0x7a99('0x1d')];var _0x1dd017=_0x411a8f?_0x15ea62[_0x7a99('0x20')]:_0x2cd470[_0x7a99('0x1d')]+_0x2cd470[_0x7a99('0x1e')];var _0x5cb3e5;if(_0x1dd017>=_0x397748){_0x1dd017=_0x397748;_0x5cb3e5=0xc8;}else{_0x5cb3e5=0xce;}_0x47b679['status'](_0x5cb3e5);return _0x47b679['set'](_0x7a99('0x21'),_0xed09d4+'-'+_0x1dd017+'/'+_0x397748)[_0x7a99('0x1c')](_0x15ea62);}return null;};}function patchUpdates(_0x5c2f1e){return function(_0x2837df){try{jsonpatch[_0x7a99('0x22')](_0x2837df,_0x5c2f1e,!![]);}catch(_0x5a792c){return BPromise[_0x7a99('0x23')](_0x5a792c);}return _0x2837df[_0x7a99('0x24')]();};}function saveUpdates(_0x226134,_0x1e621d){return function(_0x3b0999){if(_0x3b0999){return _0x3b0999['update'](_0x226134)['then'](function(_0x3ebaa0){return _0x3ebaa0;});}return null;};}function removeEntity(_0x1436f1,_0x3d72a4){return function(_0x2a49f9){if(_0x2a49f9){return _0x2a49f9[_0x7a99('0x25')]()[_0x7a99('0x26')](function(){var _0xcea212=_0x2a49f9[_0x7a99('0x27')]({'plain':!![]});var _0x5a032e=_0x7a99('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a032e,'resourceId':_0xcea212['id']}})[_0x7a99('0x26')](function(){return _0x2a49f9;});})[_0x7a99('0x26')](function(){_0x1436f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43010d,_0x4c1b4f){return function(_0x732094){if(!_0x732094){_0x43010d[_0x7a99('0x1a')](0x194);}return _0x732094;};}function handleError(_0x4d0dc0,_0x59095f){_0x59095f=_0x59095f||0x1f4;return function(_0x2469f5){logger[_0x7a99('0x29')](_0x2469f5[_0x7a99('0x2a')]);if(_0x2469f5[_0x7a99('0x2b')]){delete _0x2469f5['name'];}_0x4d0dc0[_0x7a99('0x1b')](_0x59095f)[_0x7a99('0x2c')](_0x2469f5);};}exports['index']=function(_0x4325ed,_0x422065){var _0x3bafc2={},_0x409dd6={},_0x17a275={'count':0x0,'rows':[]};var _0x4a7d4c=_[_0x7a99('0x2d')](db['Trigger'][_0x7a99('0x2e')],function(_0x3bafb2){return{'name':_0x3bafb2['fieldName'],'type':_0x3bafb2[_0x7a99('0x2f')][_0x7a99('0x30')]};});_0x409dd6[_0x7a99('0x31')]=_[_0x7a99('0x2d')](_0x4a7d4c,'name');_0x409dd6['query']=_[_0x7a99('0x32')](_0x4325ed[_0x7a99('0x33')]);_0x409dd6[_0x7a99('0x34')]=_['intersection'](_0x409dd6[_0x7a99('0x31')],_0x409dd6[_0x7a99('0x33')]);_0x3bafc2[_0x7a99('0x35')]=_['intersection'](_0x409dd6['model'],qs[_0x7a99('0x36')](_0x4325ed[_0x7a99('0x33')][_0x7a99('0x36')]));_0x3bafc2[_0x7a99('0x35')]=_0x3bafc2[_0x7a99('0x35')][_0x7a99('0x37')]?_0x3bafc2[_0x7a99('0x35')]:_0x409dd6[_0x7a99('0x31')];if(!_0x4325ed[_0x7a99('0x33')][_0x7a99('0x38')](_0x7a99('0x39'))){_0x3bafc2[_0x7a99('0x1e')]=qs[_0x7a99('0x1e')](_0x4325ed[_0x7a99('0x33')][_0x7a99('0x1e')]);_0x3bafc2[_0x7a99('0x1d')]=qs['offset'](_0x4325ed[_0x7a99('0x33')][_0x7a99('0x1d')]);}_0x3bafc2[_0x7a99('0x3a')]=qs[_0x7a99('0x3b')](_0x4325ed['query']['sort']);_0x3bafc2[_0x7a99('0x3c')]=qs[_0x7a99('0x34')](_['pick'](_0x4325ed[_0x7a99('0x33')],_0x409dd6[_0x7a99('0x34')]),_0x4a7d4c);if(_0x4325ed[_0x7a99('0x33')][_0x7a99('0x3d')]){_0x3bafc2[_0x7a99('0x3c')]=_[_0x7a99('0x3e')](_0x3bafc2[_0x7a99('0x3c')],{'$or':_['map'](_0x4a7d4c,function(_0x210589){if(_0x210589['type']!==_0x7a99('0x3f')){var _0x44ed82={};_0x44ed82[_0x210589[_0x7a99('0x2b')]]={'$like':'%'+_0x4325ed['query'][_0x7a99('0x3d')]+'%'};return _0x44ed82;}})});}_0x3bafc2=_['merge']({},_0x3bafc2,_0x4325ed['options']);var _0x319c97={'where':_0x3bafc2[_0x7a99('0x3c')]};return db[_0x7a99('0x40')][_0x7a99('0x20')](_0x319c97)['then'](function(_0x481b92){_0x17a275['count']=_0x481b92;if(_0x4325ed[_0x7a99('0x33')][_0x7a99('0x41')]){_0x3bafc2['include']=[{'all':!![]}];}return db[_0x7a99('0x40')][_0x7a99('0x42')](_0x3bafc2);})[_0x7a99('0x26')](function(_0xbe930b){_0x17a275[_0x7a99('0x43')]=_0xbe930b;return _0x17a275;})['then'](respondWithFilteredResult(_0x422065,_0x3bafc2))['catch'](handleError(_0x422065,null));};exports[_0x7a99('0x44')]=function(_0x5d2e3b,_0xdf2dd7){var _0x3230e4={'raw':![],'where':{'id':_0x5d2e3b[_0x7a99('0x45')]['id']}},_0x2d06b4={};_0x2d06b4['model']=_[_0x7a99('0x32')](db[_0x7a99('0x40')][_0x7a99('0x2e')]);_0x2d06b4[_0x7a99('0x33')]=_[_0x7a99('0x32')](_0x5d2e3b['query']);_0x2d06b4[_0x7a99('0x34')]=_[_0x7a99('0x46')](_0x2d06b4['model'],_0x2d06b4[_0x7a99('0x33')]);_0x3230e4[_0x7a99('0x35')]=_[_0x7a99('0x46')](_0x2d06b4[_0x7a99('0x31')],qs[_0x7a99('0x36')](_0x5d2e3b['query'][_0x7a99('0x36')]));_0x3230e4[_0x7a99('0x35')]=_0x3230e4[_0x7a99('0x35')][_0x7a99('0x37')]?_0x3230e4[_0x7a99('0x35')]:_0x2d06b4['model'];if(_0x5d2e3b[_0x7a99('0x33')]['includeAll']){_0x3230e4[_0x7a99('0x47')]=[{'all':!![]}];}_0x3230e4=_[_0x7a99('0x3e')]({},_0x3230e4,_0x5d2e3b['options']);return db[_0x7a99('0x40')][_0x7a99('0x48')](_0x3230e4)[_0x7a99('0x26')](handleEntityNotFound(_0xdf2dd7,null))['then'](respondWithResult(_0xdf2dd7,null))[_0x7a99('0x49')](handleError(_0xdf2dd7,null));};exports[_0x7a99('0x4a')]=function(_0x45c8ab,_0x17098e){return db[_0x7a99('0x40')]['create'](_0x45c8ab[_0x7a99('0x4b')],{})[_0x7a99('0x26')](function(_0x4f60ac){var _0x2b6190=_0x45c8ab[_0x7a99('0x4c')][_0x7a99('0x27')]({'plain':!![]});if(!_0x2b6190)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b6190['role']===_0x7a99('0x4c')){var _0x36789c=_0x4f60ac[_0x7a99('0x27')]({'plain':!![]});var _0x1878c4=_0x7a99('0x28');return db[_0x7a99('0x4d')]['find']({'where':{'name':_0x1878c4,'userProfileId':_0x2b6190[_0x7a99('0x4e')]},'raw':!![]})[_0x7a99('0x26')](function(_0x599357){if(_0x599357&&_0x599357[_0x7a99('0x4f')]===0x0){return db[_0x7a99('0x50')][_0x7a99('0x4a')]({'name':_0x36789c['name'],'resourceId':_0x36789c['id'],'type':_0x599357[_0x7a99('0x2b')],'sectionId':_0x599357['id']},{})[_0x7a99('0x26')](function(){return _0x4f60ac;});}else{return _0x4f60ac;}})[_0x7a99('0x49')](function(_0x4c577e){logger['error'](_0x7a99('0x51'),_0x4c577e);throw _0x4c577e;});}return _0x4f60ac;})[_0x7a99('0x26')](respondWithResult(_0x17098e,0xc9))['catch'](handleError(_0x17098e,null));};exports[_0x7a99('0x52')]=function(_0x49d422,_0x1e07dc){if(_0x49d422['body']['id']){delete _0x49d422[_0x7a99('0x4b')]['id'];}return db[_0x7a99('0x40')][_0x7a99('0x48')]({'where':{'id':_0x49d422[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0x1e07dc,null))['then'](saveUpdates(_0x49d422[_0x7a99('0x4b')],null))[_0x7a99('0x26')](respondWithResult(_0x1e07dc,null))[_0x7a99('0x49')](handleError(_0x1e07dc,null));};exports['destroy']=function(_0x1d9bb1,_0x5df73b){return db['Trigger'][_0x7a99('0x48')]({'where':{'id':_0x1d9bb1[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0x5df73b,null))[_0x7a99('0x26')](removeEntity(_0x5df73b,null))['catch'](handleError(_0x5df73b,null));};exports[_0x7a99('0x53')]=function(_0x3e29e9,_0x5a51fe,_0x275184){if(_0x3e29e9['body']['id']){delete _0x3e29e9['body']['id'];}return db[_0x7a99('0x40')][_0x7a99('0x48')]({'where':{'id':_0x3e29e9['params']['id']}})['then'](handleEntityNotFound(_0x5a51fe,null))['then'](function(_0x2bb0cc){if(_0x2bb0cc){_0x3e29e9[_0x7a99('0x4b')]['TriggerAllId']=_0x2bb0cc['id'];return db[_0x7a99('0x54')][_0x7a99('0x4a')](_0x3e29e9[_0x7a99('0x4b')]);}})[_0x7a99('0x26')](respondWithResult(_0x5a51fe,null))[_0x7a99('0x49')](handleError(_0x5a51fe,null));};exports[_0x7a99('0x55')]=function(_0x44b062,_0x4655b4,_0x24b082){if(_0x44b062[_0x7a99('0x4b')]['id']){delete _0x44b062[_0x7a99('0x4b')]['id'];}return db[_0x7a99('0x40')][_0x7a99('0x48')]({'where':{'id':_0x44b062[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0x4655b4,null))['then'](function(_0x1ea816){if(_0x1ea816){_0x44b062['body']['TriggerAnyId']=_0x1ea816['id'];return db['Condition'][_0x7a99('0x4a')](_0x44b062['body']);}})[_0x7a99('0x26')](respondWithResult(_0x4655b4,null))[_0x7a99('0x49')](handleError(_0x4655b4,null));};exports[_0x7a99('0x56')]=function(_0x2d0a80,_0x1c4995,_0x294169){var _0xa989b7={};var _0x152723={};var _0x55a25c;var _0x564360;return db[_0x7a99('0x40')][_0x7a99('0x57')]({'where':{'id':_0x2d0a80[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0x1c4995,null))[_0x7a99('0x26')](function(_0x2bc519){if(_0x2bc519){_0x55a25c=_0x2bc519;_0x152723[_0x7a99('0x31')]=_['keys'](db[_0x7a99('0x54')][_0x7a99('0x2e')]);_0x152723[_0x7a99('0x33')]=_['keys'](_0x2d0a80[_0x7a99('0x33')]);_0x152723[_0x7a99('0x34')]=_['intersection'](_0x152723['model'],_0x152723[_0x7a99('0x33')]);_0xa989b7['attributes']=_[_0x7a99('0x46')](_0x152723[_0x7a99('0x31')],qs[_0x7a99('0x36')](_0x2d0a80['query'][_0x7a99('0x36')]));_0xa989b7[_0x7a99('0x35')]=_0xa989b7[_0x7a99('0x35')]['length']?_0xa989b7[_0x7a99('0x35')]:_0x152723['model'];_0xa989b7[_0x7a99('0x3a')]=qs[_0x7a99('0x3b')](_0x2d0a80['query'][_0x7a99('0x3b')]);_0xa989b7[_0x7a99('0x3c')]=qs[_0x7a99('0x34')](_[_0x7a99('0x58')](_0x2d0a80[_0x7a99('0x33')],_0x152723[_0x7a99('0x34')]));if(_0x2d0a80['query'][_0x7a99('0x3d')]){_0xa989b7[_0x7a99('0x3c')]=_[_0x7a99('0x3e')](_0xa989b7[_0x7a99('0x3c')],{'$or':_['map'](_0xa989b7['attributes'],function(_0x4bdcf7){var _0x2b2d2c={};_0x2b2d2c[_0x4bdcf7]={'$like':'%'+_0x2d0a80['query'][_0x7a99('0x3d')]+'%'};return _0x2b2d2c;})});}_0xa989b7=_[_0x7a99('0x3e')]({},_0xa989b7,_0x2d0a80[_0x7a99('0x59')]);return _0x55a25c[_0x7a99('0x56')](_0xa989b7);}})[_0x7a99('0x26')](function(_0x24c110){if(_0x24c110){_0x564360=_0x24c110[_0x7a99('0x37')];if(!_0x2d0a80['query'][_0x7a99('0x38')](_0x7a99('0x39'))){_0xa989b7[_0x7a99('0x1e')]=qs[_0x7a99('0x1e')](_0x2d0a80[_0x7a99('0x33')]['limit']);_0xa989b7[_0x7a99('0x1d')]=qs[_0x7a99('0x1d')](_0x2d0a80[_0x7a99('0x33')][_0x7a99('0x1d')]);}return _0x55a25c[_0x7a99('0x56')](_0xa989b7);}})[_0x7a99('0x26')](function(_0x4a881e){if(_0x4a881e){return _0x4a881e?{'count':_0x564360,'rows':_0x4a881e}:null;}})[_0x7a99('0x26')](respondWithResult(_0x1c4995,null))[_0x7a99('0x49')](handleError(_0x1c4995,null));};exports[_0x7a99('0x5a')]=function(_0x4e7c77,_0x57ad47,_0x4731b9){var _0x4fa7f1={};var _0x484407={};var _0x5f533a;var _0x1fa0eb;return db['Trigger'][_0x7a99('0x57')]({'where':{'id':_0x4e7c77[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0x57ad47,null))['then'](function(_0x14644c){if(_0x14644c){_0x5f533a=_0x14644c;_0x484407[_0x7a99('0x31')]=_[_0x7a99('0x32')](db[_0x7a99('0x54')][_0x7a99('0x2e')]);_0x484407[_0x7a99('0x33')]=_['keys'](_0x4e7c77['query']);_0x484407['filters']=_[_0x7a99('0x46')](_0x484407[_0x7a99('0x31')],_0x484407[_0x7a99('0x33')]);_0x4fa7f1[_0x7a99('0x35')]=_[_0x7a99('0x46')](_0x484407[_0x7a99('0x31')],qs[_0x7a99('0x36')](_0x4e7c77[_0x7a99('0x33')][_0x7a99('0x36')]));_0x4fa7f1[_0x7a99('0x35')]=_0x4fa7f1[_0x7a99('0x35')]['length']?_0x4fa7f1[_0x7a99('0x35')]:_0x484407['model'];_0x4fa7f1[_0x7a99('0x3a')]=qs[_0x7a99('0x3b')](_0x4e7c77[_0x7a99('0x33')][_0x7a99('0x3b')]);_0x4fa7f1['where']=qs[_0x7a99('0x34')](_['pick'](_0x4e7c77[_0x7a99('0x33')],_0x484407[_0x7a99('0x34')]));if(_0x4e7c77['query'][_0x7a99('0x3d')]){_0x4fa7f1[_0x7a99('0x3c')]=_[_0x7a99('0x3e')](_0x4fa7f1[_0x7a99('0x3c')],{'$or':_[_0x7a99('0x2d')](_0x4fa7f1['attributes'],function(_0x2c0582){var _0x1686cd={};_0x1686cd[_0x2c0582]={'$like':'%'+_0x4e7c77[_0x7a99('0x33')][_0x7a99('0x3d')]+'%'};return _0x1686cd;})});}_0x4fa7f1=_[_0x7a99('0x3e')]({},_0x4fa7f1,_0x4e7c77[_0x7a99('0x59')]);return _0x5f533a[_0x7a99('0x5a')](_0x4fa7f1);}})[_0x7a99('0x26')](function(_0x1587b7){if(_0x1587b7){_0x1fa0eb=_0x1587b7['length'];if(!_0x4e7c77['query'][_0x7a99('0x38')](_0x7a99('0x39'))){_0x4fa7f1[_0x7a99('0x1e')]=qs[_0x7a99('0x1e')](_0x4e7c77[_0x7a99('0x33')][_0x7a99('0x1e')]);_0x4fa7f1[_0x7a99('0x1d')]=qs[_0x7a99('0x1d')](_0x4e7c77[_0x7a99('0x33')][_0x7a99('0x1d')]);}return _0x5f533a[_0x7a99('0x5a')](_0x4fa7f1);}})[_0x7a99('0x26')](function(_0x1ce5a0){if(_0x1ce5a0){return _0x1ce5a0?{'count':_0x1fa0eb,'rows':_0x1ce5a0}:null;}})[_0x7a99('0x26')](respondWithResult(_0x57ad47,null))[_0x7a99('0x49')](handleError(_0x57ad47,null));};exports[_0x7a99('0x5b')]=function(_0x4c909e,_0x277561,_0x7b0aca){if(_0x4c909e[_0x7a99('0x4b')]['id']){delete _0x4c909e[_0x7a99('0x4b')]['id'];}return db[_0x7a99('0x40')]['find']({'where':{'id':_0x4c909e[_0x7a99('0x45')]['id']}})['then'](handleEntityNotFound(_0x277561,null))[_0x7a99('0x26')](function(_0x250d02){if(_0x250d02){_0x4c909e['body']['TriggerId']=_0x250d02['id'];return db[_0x7a99('0x5c')][_0x7a99('0x4a')](_0x4c909e[_0x7a99('0x4b')]);}})[_0x7a99('0x26')](respondWithResult(_0x277561,null))[_0x7a99('0x49')](handleError(_0x277561,null));};exports[_0x7a99('0x5d')]=function(_0x14aeee,_0xacaf0c,_0x28a40a){var _0x413368={};var _0x32e275={};var _0x4a6229;var _0x14f092;return db['Trigger']['findOne']({'where':{'id':_0x14aeee[_0x7a99('0x45')]['id']}})[_0x7a99('0x26')](handleEntityNotFound(_0xacaf0c,null))[_0x7a99('0x26')](function(_0x292b55){if(_0x292b55){_0x4a6229=_0x292b55;_0x32e275['model']=_[_0x7a99('0x32')](db[_0x7a99('0x5c')][_0x7a99('0x2e')]);_0x32e275['query']=_[_0x7a99('0x32')](_0x14aeee[_0x7a99('0x33')]);_0x32e275['filters']=_[_0x7a99('0x46')](_0x32e275[_0x7a99('0x31')],_0x32e275[_0x7a99('0x33')]);_0x413368[_0x7a99('0x35')]=_['intersection'](_0x32e275[_0x7a99('0x31')],qs[_0x7a99('0x36')](_0x14aeee['query'][_0x7a99('0x36')]));_0x413368[_0x7a99('0x35')]=_0x413368[_0x7a99('0x35')][_0x7a99('0x37')]?_0x413368[_0x7a99('0x35')]:_0x32e275[_0x7a99('0x31')];_0x413368[_0x7a99('0x3a')]=qs[_0x7a99('0x3b')](_0x14aeee[_0x7a99('0x33')]['sort']);_0x413368[_0x7a99('0x3c')]=qs[_0x7a99('0x34')](_[_0x7a99('0x58')](_0x14aeee['query'],_0x32e275[_0x7a99('0x34')]));if(_0x14aeee['query'][_0x7a99('0x3d')]){_0x413368['where']=_['merge'](_0x413368[_0x7a99('0x3c')],{'$or':_[_0x7a99('0x2d')](_0x413368['attributes'],function(_0x568ee0){var _0x2e95b9={};_0x2e95b9[_0x568ee0]={'$like':'%'+_0x14aeee['query'][_0x7a99('0x3d')]+'%'};return _0x2e95b9;})});}_0x413368=_[_0x7a99('0x3e')]({},_0x413368,_0x14aeee[_0x7a99('0x59')]);return _0x4a6229[_0x7a99('0x5d')](_0x413368);}})['then'](function(_0x38825c){if(_0x38825c){_0x14f092=_0x38825c[_0x7a99('0x37')];if(!_0x14aeee['query'][_0x7a99('0x38')](_0x7a99('0x39'))){_0x413368[_0x7a99('0x1e')]=qs[_0x7a99('0x1e')](_0x14aeee['query'][_0x7a99('0x1e')]);_0x413368[_0x7a99('0x1d')]=qs['offset'](_0x14aeee[_0x7a99('0x33')][_0x7a99('0x1d')]);}return _0x4a6229['getActions'](_0x413368);}})[_0x7a99('0x26')](function(_0x10384f){if(_0x10384f){return _0x10384f?{'count':_0x14f092,'rows':_0x10384f}:null;}})[_0x7a99('0x26')](respondWithResult(_0xacaf0c,null))[_0x7a99('0x49')](handleError(_0xacaf0c,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index e365b3e..139fc98 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb332=['define','lodash','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x37b80d,_0x4d9b1a){var _0x522086=function(_0x20febe){while(--_0x20febe){_0x37b80d['push'](_0x37b80d['shift']());}};_0x522086(++_0x4d9b1a);}(_0xb332,0xd9));var _0x2b33=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xb332[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var moment=require('moment');var BPromise=require(_0x2b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b33('0x4'));var rimraf=require('rimraf');var config=require(_0x2b33('0x5'));var attributes=require('./trigger.attributes');module[_0x2b33('0x6')]=function(_0x22d66,_0x478214){return _0x22d66[_0x2b33('0x7')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9417=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util'];(function(_0x92257b,_0x2d188d){var _0x5da0ee=function(_0x31445b){while(--_0x31445b){_0x92257b['push'](_0x92257b['shift']());}};_0x5da0ee(++_0x2d188d);}(_0x9417,0xb4));var _0x7941=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x9417[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x7941('0x0'));var util=require(_0x7941('0x1'));var logger=require(_0x7941('0x2'))(_0x7941('0x3'));var moment=require('moment');var BPromise=require(_0x7941('0x4'));var rp=require(_0x7941('0x5'));var fs=require('fs');var path=require(_0x7941('0x6'));var rimraf=require(_0x7941('0x7'));var config=require(_0x7941('0x8'));var attributes=require(_0x7941('0x9'));module[_0x7941('0xa')]=function(_0x3e38d8,_0x1dee1a){return _0x3e38d8[_0x7941('0xb')]('Trigger',attributes,{'tableName':_0x7941('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index a3b359d..ea3e4ff 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa13e=['Trigger','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','options','attributes','include','map','model','catch','ShowTrigger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa13e,0xc7));var _0xea13=function(_0x4ab612,_0x5166e3){_0x4ab612=_0x4ab612-0x0;var _0x1595f4=_0xa13e[_0x4ab612];return _0x1595f4;};'use strict';var _=require(_0xea13('0x0'));var util=require('util');var moment=require(_0xea13('0x1'));var BPromise=require(_0xea13('0x2'));var rs=require(_0xea13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea13('0x4'))['db'];var utils=require(_0xea13('0x5'));var logger=require(_0xea13('0x6'))(_0xea13('0x7'));var config=require(_0xea13('0x8'));var jayson=require(_0xea13('0x9'));var client=jayson[_0xea13('0xa')][_0xea13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e3a07,_0xdf00b5,_0x1f143c){return new BPromise(function(_0x4426a7,_0x5f5522){return client[_0xea13('0xc')](_0x2e3a07,_0x1f143c)[_0xea13('0xd')](function(_0xd0bfd9){logger[_0xea13('0xe')]('Trigger,\x20%s,\x20%s',_0xdf00b5,_0xea13('0xf'));logger[_0xea13('0x10')](_0xea13('0x11'),_0xdf00b5,_0xea13('0xf'),JSON[_0xea13('0x12')](_0xd0bfd9));if(_0xd0bfd9['error']){if(_0xd0bfd9['error'][_0xea13('0x13')]===0x1f4){logger[_0xea13('0x14')](_0xea13('0x15'),_0xdf00b5,_0xd0bfd9[_0xea13('0x14')][_0xea13('0x16')]);return _0x5f5522(_0xd0bfd9[_0xea13('0x14')]['message']);}logger['error'](_0xea13('0x15'),_0xdf00b5,_0xd0bfd9[_0xea13('0x14')][_0xea13('0x16')]);return _0x4426a7(_0xd0bfd9[_0xea13('0x14')][_0xea13('0x16')]);}else{logger[_0xea13('0xe')](_0xea13('0x15'),_0xdf00b5,'request\x20sent');_0x4426a7(_0xd0bfd9[_0xea13('0x17')][_0xea13('0x16')]);}})['catch'](function(_0x228814){logger[_0xea13('0x14')](_0xea13('0x15'),_0xdf00b5,_0x228814);_0x5f5522(_0x228814);});});}exports[_0xea13('0x18')]=function(_0x461818){var _0x1a7eec=this;return new Promise(function(_0x809655,_0x5e1e45){return db['Trigger']['findAll']({'raw':_0x461818[_0xea13('0x19')]?_0x461818['options']['raw']===undefined?!![]:![]:!![],'where':_0x461818[_0xea13('0x19')]?_0x461818[_0xea13('0x19')]['where']||null:null,'attributes':_0x461818[_0xea13('0x19')]?_0x461818[_0xea13('0x19')][_0xea13('0x1a')]||null:null,'limit':_0x461818[_0xea13('0x19')]?_0x461818[_0xea13('0x19')]['limit']||null:null,'include':_0x461818['options']?_0x461818['options'][_0xea13('0x1b')]?_[_0xea13('0x1c')](_0x461818[_0xea13('0x19')]['include'],function(_0x3ea3e8){return{'model':db[_0x3ea3e8[_0xea13('0x1d')]],'as':_0x3ea3e8['as'],'attributes':_0x3ea3e8[_0xea13('0x1a')],'include':_0x3ea3e8[_0xea13('0x1b')]?_[_0xea13('0x1c')](_0x3ea3e8[_0xea13('0x1b')],function(_0x5839c3){return{'model':db[_0x5839c3['model']],'as':_0x5839c3['as'],'attributes':_0x5839c3[_0xea13('0x1a')],'include':_0x5839c3[_0xea13('0x1b')]?_[_0xea13('0x1c')](_0x5839c3[_0xea13('0x1b')],function(_0x1e6ed0){return{'model':db[_0x1e6ed0['model']],'as':_0x1e6ed0['as'],'attributes':_0x1e6ed0[_0xea13('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xea13('0xd')](function(_0x16167d){logger[_0xea13('0xe')]('GetTrigger',_0x461818);logger[_0xea13('0x10')](_0xea13('0x18'),_0x461818,JSON[_0xea13('0x12')](_0x16167d));_0x809655(_0x16167d);})[_0xea13('0x1e')](function(_0x111117){logger['error']('GetTrigger',_0x111117[_0xea13('0x16')],_0x461818);_0x5e1e45(_0x1a7eec[_0xea13('0x14')](0x1f4,_0x111117[_0xea13('0x16')]));});});};exports[_0xea13('0x1f')]=function(_0x31b581){var _0x3c95c0=this;return new Promise(function(_0x23a60,_0x2f571f){return db[_0xea13('0x20')]['find']({'raw':_0x31b581[_0xea13('0x19')]?_0x31b581[_0xea13('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x31b581['options']?_0x31b581['options']['where']||null:null,'attributes':_0x31b581[_0xea13('0x19')]?_0x31b581[_0xea13('0x19')][_0xea13('0x1a')]||null:null,'include':_0x31b581['options']?_0x31b581[_0xea13('0x19')]['include']?_['map'](_0x31b581['options']['include'],function(_0x53925e){return{'model':db[_0x53925e[_0xea13('0x1d')]],'as':_0x53925e['as'],'attributes':_0x53925e[_0xea13('0x1a')],'include':_0x53925e[_0xea13('0x1b')]?_['map'](_0x53925e[_0xea13('0x1b')],function(_0x4a8ccd){return{'model':db[_0x4a8ccd[_0xea13('0x1d')]],'as':_0x4a8ccd['as'],'attributes':_0x4a8ccd[_0xea13('0x1a')],'include':_0x4a8ccd['include']?_['map'](_0x4a8ccd['include'],function(_0x152523){return{'model':db[_0x152523[_0xea13('0x1d')]],'as':_0x152523['as'],'attributes':_0x152523[_0xea13('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2487a3){logger['info'](_0xea13('0x1f'),_0x31b581);logger['debug'](_0xea13('0x1f'),_0x31b581,JSON[_0xea13('0x12')](_0x2487a3));_0x23a60(_0x2487a3);})[_0xea13('0x1e')](function(_0x451edb){logger[_0xea13('0x14')]('ShowTrigger',_0x451edb[_0xea13('0x16')],_0x31b581);_0x2f571f(_0x3c95c0[_0xea13('0x14')](0x1f4,_0x451edb[_0xea13('0x16')]));});});}; \ No newline at end of file +var _0x0a17=['../../config/logger','rpc','jayson/promise','client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrigger','Trigger','options','where','attributes','limit','include','map','model','ShowTrigger','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x581dd6,_0x23847f){var _0x4faeb3=function(_0x17a0bd){while(--_0x17a0bd){_0x581dd6['push'](_0x581dd6['shift']());}};_0x4faeb3(++_0x23847f);}(_0x0a17,0x7e));var _0x70a1=function(_0x3bf056,_0x39d0f7){_0x3bf056=_0x3bf056-0x0;var _0x343236=_0x0a17[_0x3bf056];return _0x343236;};'use strict';var _=require('lodash');var util=require(_0x70a1('0x0'));var moment=require('moment');var BPromise=require(_0x70a1('0x1'));var rs=require(_0x70a1('0x2'));var fs=require('fs');var Redis=require(_0x70a1('0x3'));var db=require(_0x70a1('0x4'))['db'];var utils=require(_0x70a1('0x5'));var logger=require(_0x70a1('0x6'))(_0x70a1('0x7'));var config=require('../../config/environment');var jayson=require(_0x70a1('0x8'));var client=jayson[_0x70a1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45bfd6,_0x635fb7,_0xf5aa13){return new BPromise(function(_0x55638b,_0x585586){return client[_0x70a1('0xa')](_0x45bfd6,_0xf5aa13)[_0x70a1('0xb')](function(_0x48260b){logger['info'](_0x70a1('0xc'),_0x635fb7,_0x70a1('0xd'));logger[_0x70a1('0xe')](_0x70a1('0xf'),_0x635fb7,_0x70a1('0xd'),JSON[_0x70a1('0x10')](_0x48260b));if(_0x48260b[_0x70a1('0x11')]){if(_0x48260b['error']['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x635fb7,_0x48260b[_0x70a1('0x11')][_0x70a1('0x12')]);return _0x585586(_0x48260b['error']['message']);}logger[_0x70a1('0x11')](_0x70a1('0xc'),_0x635fb7,_0x48260b[_0x70a1('0x11')]['message']);return _0x55638b(_0x48260b[_0x70a1('0x11')][_0x70a1('0x12')]);}else{logger[_0x70a1('0x13')](_0x70a1('0xc'),_0x635fb7,_0x70a1('0xd'));_0x55638b(_0x48260b[_0x70a1('0x14')][_0x70a1('0x12')]);}})[_0x70a1('0x15')](function(_0xfe70d6){logger[_0x70a1('0x11')](_0x70a1('0xc'),_0x635fb7,_0xfe70d6);_0x585586(_0xfe70d6);});});}exports[_0x70a1('0x16')]=function(_0x646af6){var _0x1cd628=this;return new Promise(function(_0x83fb4a,_0x3707e2){return db[_0x70a1('0x17')]['findAll']({'raw':_0x646af6[_0x70a1('0x18')]?_0x646af6['options']['raw']===undefined?!![]:![]:!![],'where':_0x646af6[_0x70a1('0x18')]?_0x646af6[_0x70a1('0x18')][_0x70a1('0x19')]||null:null,'attributes':_0x646af6[_0x70a1('0x18')]?_0x646af6[_0x70a1('0x18')][_0x70a1('0x1a')]||null:null,'limit':_0x646af6[_0x70a1('0x18')]?_0x646af6[_0x70a1('0x18')][_0x70a1('0x1b')]||null:null,'include':_0x646af6[_0x70a1('0x18')]?_0x646af6[_0x70a1('0x18')][_0x70a1('0x1c')]?_[_0x70a1('0x1d')](_0x646af6[_0x70a1('0x18')]['include'],function(_0x545e62){return{'model':db[_0x545e62[_0x70a1('0x1e')]],'as':_0x545e62['as'],'attributes':_0x545e62['attributes'],'include':_0x545e62[_0x70a1('0x1c')]?_[_0x70a1('0x1d')](_0x545e62[_0x70a1('0x1c')],function(_0x3e4b99){return{'model':db[_0x3e4b99['model']],'as':_0x3e4b99['as'],'attributes':_0x3e4b99[_0x70a1('0x1a')],'include':_0x3e4b99[_0x70a1('0x1c')]?_[_0x70a1('0x1d')](_0x3e4b99[_0x70a1('0x1c')],function(_0x1136dd){return{'model':db[_0x1136dd[_0x70a1('0x1e')]],'as':_0x1136dd['as'],'attributes':_0x1136dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x70a1('0xb')](function(_0x332b69){logger[_0x70a1('0x13')](_0x70a1('0x16'),_0x646af6);logger[_0x70a1('0xe')](_0x70a1('0x16'),_0x646af6,JSON[_0x70a1('0x10')](_0x332b69));_0x83fb4a(_0x332b69);})['catch'](function(_0x4f8fac){logger['error'](_0x70a1('0x16'),_0x4f8fac[_0x70a1('0x12')],_0x646af6);_0x3707e2(_0x1cd628['error'](0x1f4,_0x4f8fac[_0x70a1('0x12')]));});});};exports[_0x70a1('0x1f')]=function(_0x4c054e){var _0x3051e8=this;return new Promise(function(_0x2d2af7,_0x28333e){return db['Trigger']['find']({'raw':_0x4c054e[_0x70a1('0x18')]?_0x4c054e[_0x70a1('0x18')][_0x70a1('0x20')]===undefined?!![]:![]:!![],'where':_0x4c054e[_0x70a1('0x18')]?_0x4c054e[_0x70a1('0x18')]['where']||null:null,'attributes':_0x4c054e[_0x70a1('0x18')]?_0x4c054e[_0x70a1('0x18')][_0x70a1('0x1a')]||null:null,'include':_0x4c054e['options']?_0x4c054e[_0x70a1('0x18')][_0x70a1('0x1c')]?_['map'](_0x4c054e[_0x70a1('0x18')][_0x70a1('0x1c')],function(_0x408440){return{'model':db[_0x408440[_0x70a1('0x1e')]],'as':_0x408440['as'],'attributes':_0x408440[_0x70a1('0x1a')],'include':_0x408440[_0x70a1('0x1c')]?_[_0x70a1('0x1d')](_0x408440['include'],function(_0x199238){return{'model':db[_0x199238['model']],'as':_0x199238['as'],'attributes':_0x199238[_0x70a1('0x1a')],'include':_0x199238[_0x70a1('0x1c')]?_[_0x70a1('0x1d')](_0x199238[_0x70a1('0x1c')],function(_0x169cd4){return{'model':db[_0x169cd4[_0x70a1('0x1e')]],'as':_0x169cd4['as'],'attributes':_0x169cd4[_0x70a1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a4db4){logger[_0x70a1('0x13')](_0x70a1('0x1f'),_0x4c054e);logger[_0x70a1('0xe')]('ShowTrigger',_0x4c054e,JSON[_0x70a1('0x10')](_0x3a4db4));_0x2d2af7(_0x3a4db4);})[_0x70a1('0x15')](function(_0x4aadda){logger[_0x70a1('0x11')](_0x70a1('0x1f'),_0x4aadda['message'],_0x4c054e);_0x28333e(_0x3051e8[_0x70a1('0x11')](0x1f4,_0x4aadda[_0x70a1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8a87e76..be81268 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafce=['./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xafce,0x109));var _0xeafc=function(_0x4095db,_0x287ac6){_0x4095db=_0x4095db-0x0;var _0xc97464=_0xafce[_0x4095db];return _0xc97464;};'use strict';var multer=require(_0xeafc('0x0'));var util=require(_0xeafc('0x1'));var path=require(_0xeafc('0x2'));var timeout=require(_0xeafc('0x3'));var express=require(_0xeafc('0x4'));var router=express[_0xeafc('0x5')]();var fs_extra=require(_0xeafc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeafc('0x7'));var controller=require(_0xeafc('0x8'));router[_0xeafc('0x9')]('/',auth[_0xeafc('0xa')](),controller[_0xeafc('0xb')]);router[_0xeafc('0x9')](_0xeafc('0xc'),auth[_0xeafc('0xa')](),controller['show']);router[_0xeafc('0xd')](_0xeafc('0xe'),auth[_0xeafc('0xa')](),controller[_0xeafc('0xf')]);router['post']('/',auth[_0xeafc('0xa')](),controller[_0xeafc('0x10')]);router[_0xeafc('0x11')](_0xeafc('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xeafc('0x12')](_0xeafc('0xc'),auth['isAuthenticated'](),controller[_0xeafc('0x13')]);module[_0xeafc('0x14')]=router; \ No newline at end of file +var _0x6f14=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone'];(function(_0x1b669a,_0x50601b){var _0x36f7a5=function(_0x2418c1){while(--_0x2418c1){_0x1b669a['push'](_0x1b669a['shift']());}};_0x36f7a5(++_0x50601b);}(_0x6f14,0x1a9));var _0x46f1=function(_0x7d6eca,_0x59d54a){_0x7d6eca=_0x7d6eca-0x0;var _0x128263=_0x6f14[_0x7d6eca];return _0x128263;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x46f1('0x0'));var express=require(_0x46f1('0x1'));var router=express[_0x46f1('0x2')]();var fs_extra=require(_0x46f1('0x3'));var auth=require(_0x46f1('0x4'));var interaction=require(_0x46f1('0x5'));var config=require(_0x46f1('0x6'));var controller=require(_0x46f1('0x7'));router[_0x46f1('0x8')]('/',auth[_0x46f1('0x9')](),controller[_0x46f1('0xa')]);router[_0x46f1('0x8')](_0x46f1('0xb'),auth[_0x46f1('0x9')](),controller[_0x46f1('0xc')]);router[_0x46f1('0xd')](_0x46f1('0xe'),auth[_0x46f1('0x9')](),controller[_0x46f1('0xf')]);router[_0x46f1('0xd')]('/',auth[_0x46f1('0x9')](),controller['create']);router[_0x46f1('0x10')](_0x46f1('0xb'),auth[_0x46f1('0x9')](),controller[_0x46f1('0x11')]);router[_0x46f1('0x12')](_0x46f1('0xb'),auth[_0x46f1('0x9')](),controller[_0x46f1('0x13')]);module[_0x46f1('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3968531..e14a85f 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc342=['INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','sequelize','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','setDataValue','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','\x22\x22\x20<>'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xc342,0xe3));var _0x2c34=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0xc342[_0x5538d5];return _0x323b1a;};'use strict';var Sequelize=require(_0x2c34('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c34('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x3'),_0x2c34('0x4'),_0x2c34('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2c34('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x6'),_0x2c34('0x7'),_0x2c34('0x8'),_0x2c34('0x9'),_0x2c34('0xa'),_0x2c34('0xb'),'PROHIB_FAILED_SCREEN',_0x2c34('0xc'))},'deny':{'type':Sequelize[_0x2c34('0x1')]},'permit':{'type':Sequelize[_0x2c34('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x2c34('0x1')]},'remotesecret':{'type':Sequelize[_0x2c34('0x1')]},'transport':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':'udp','set':function(_0x135785){this['setDataValue'](_0x2c34('0xd'),_0x135785?_0x135785[_0x2c34('0xe')](','):null);},'get':function(){return this[_0x2c34('0xf')](_0x2c34('0xd'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x2c34('0x10')},'dtmfmode':{'type':Sequelize[_0x2c34('0x2')]('rfc2833','info',_0x2c34('0x11'),_0x2c34('0x12'),_0x2c34('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2c34('0x2')]('yes','no',_0x2c34('0x14'),_0x2c34('0x15'),_0x2c34('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2c34('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2c34('0x1')]},'directmediadeny':{'type':Sequelize[_0x2c34('0x1')]},'nat':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':_0x2c34('0x17'),'set':function(_0x55ba2f){this['setDataValue'](_0x2c34('0x18'),_0x55ba2f?_0x55ba2f['join'](','):null);},'get':function(){return this[_0x2c34('0xf')](_0x2c34('0x18'))?this[_0x2c34('0xf')](_0x2c34('0x18'))['split'](','):null;},'comment':_0x2c34('0x19')},'callgroup':{'type':Sequelize[_0x2c34('0x1')]},'namedcallgroup':{'type':Sequelize[_0x2c34('0x1')]},'pickupgroup':{'type':Sequelize[_0x2c34('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x2c34('0x1')]},'language':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2c34('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x2c34('0x1a')},'allow':{'type':Sequelize[_0x2c34('0x1')],'allowNull':![],'defaultValue':_0x2c34('0x1b'),'set':function(_0x2d1f20){this['setDataValue'](_0x2c34('0x1c'),_0x2d1f20?_0x2d1f20[_0x2c34('0xe')](';'):_0x2c34('0x1b'));},'get':function(){return this['getDataValue']('allow')?this[_0x2c34('0xf')]('allow')[_0x2c34('0x1d')](';'):null;},'comment':_0x2c34('0x1e')},'autoframing':{'type':Sequelize[_0x2c34('0x2')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x2c34('0x1f'),'set':function(_0x1b81b6){this[_0x2c34('0x20')](_0x2c34('0x21'),_0x1b81b6?_0x1b81b6[_0x2c34('0xe')](','):null);},'get':function(){return this[_0x2c34('0xf')](_0x2c34('0x21'))?this['getDataValue'](_0x2c34('0x21'))[_0x2c34('0x1d')](','):null;},'comment':_0x2c34('0x22')},'trustrpid':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2c34('0x2')]('yes','no',_0x2c34('0x24'))},'promiscredir':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'useclientcode':{'type':Sequelize[_0x2c34('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':_0x2c34('0x25')},'amaflags':{'type':Sequelize[_0x2c34('0x1')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2c34('0x23')},'busylevel':{'type':Sequelize[_0x2c34('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'allowsubscribe':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'allowtransfer':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2c34('0x23'),'no')},'subscribecontext':{'type':Sequelize[_0x2c34('0x1')]},'template':{'type':Sequelize[_0x2c34('0x1')]},'videosupport':{'type':Sequelize[_0x2c34('0x2')]('yes','no',_0x2c34('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2c34('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x2c34('0x23'),'no')},'mailbox':{'type':Sequelize[_0x2c34('0x1')]},'session_timers':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x28'),_0x2c34('0x29'),_0x2c34('0x2a'))},'session_expires':{'type':Sequelize[_0x2c34('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x2c34('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x2b'),_0x2c34('0x2c')),'defaultValue':_0x2c34('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2c34('0x1')]},'fromdomain':{'type':Sequelize[_0x2c34('0x1')]},'fromuser':{'type':Sequelize[_0x2c34('0x1')]},'port':{'type':Sequelize[_0x2c34('0x26')](0x5)},'qualify':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no'),'defaultValue':_0x2c34('0x23')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x2c34('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2c34('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x2c34('0x23'),'no',_0x2c34('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2c34('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x2c34('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2c34('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x2c34('0x1')]},'contactdeny':{'type':Sequelize[_0x2c34('0x1')]},'contactacl':{'type':Sequelize[_0x2c34('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x2c34('0x1')]},'use_q850_reason':{'type':Sequelize[_0x2c34('0x1')]},'maxforwards':{'type':Sequelize[_0x2c34('0x26')](0xb)},'encryption':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2c34('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2c34('0x23'),'no',_0x2c34('0x2e'),_0x2c34('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x2c34('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x2c34('0x1')]},'dtlscipher':{'type':Sequelize[_0x2c34('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x2c34('0x1')]},'dtlssetup':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x30'),_0x2c34('0x31'),_0x2c34('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2c34('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2c34('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x2c34('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2c34('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x2c34('0x2')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x2c34('0x1')]},'parkinglot':{'type':Sequelize[_0x2c34('0x1')]},'description':{'type':Sequelize[_0x2c34('0x1')]},'host':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':_0x2c34('0x33')},'canreinvite':{'type':Sequelize[_0x2c34('0x2')](_0x2c34('0x23'),'no',_0x2c34('0x14'),_0x2c34('0x15'),_0x2c34('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2c34('0x1')]},'otherFields':{'type':Sequelize[_0x2c34('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2c34('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x8f1a=['always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','getDataValue','transport','split','rfc2833','info','inband','auto','nonat','update','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8f1a,0xa7));var _0xa8f1=function(_0x3f2a0d,_0x2ec805){_0x3f2a0d=_0x3f2a0d-0x0;var _0x22d3e5=_0x8f1a[_0x3f2a0d];return _0x22d3e5;};'use strict';var Sequelize=require(_0xa8f1('0x0'));module[_0xa8f1('0x1')]={'name':{'type':Sequelize[_0xa8f1('0x2')],'allowNull':![],'unique':_0xa8f1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x5'),_0xa8f1('0x6'),_0xa8f1('0x7')),'allowNull':![],'defaultValue':_0xa8f1('0x5')},'context':{'type':Sequelize[_0xa8f1('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0xa8f1('0x9'),_0xa8f1('0xa'),_0xa8f1('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0xa8f1('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xa8f1('0x2')]},'transport':{'type':Sequelize[_0xa8f1('0x2')],'defaultValue':'udp','set':function(_0x5db5eb){this[_0xa8f1('0xc')]('transport',_0x5db5eb?_0x5db5eb['join'](','):null);},'get':function(){return this[_0xa8f1('0xd')](_0xa8f1('0xe'))?this[_0xa8f1('0xd')]('transport')[_0xa8f1('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x10'),_0xa8f1('0x11'),'shortinfo',_0xa8f1('0x12'),_0xa8f1('0x13')),'defaultValue':_0xa8f1('0x10')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xa8f1('0x14'),_0xa8f1('0x15'),_0xa8f1('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa8f1('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa8f1('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xa8f1('0x17'),'set':function(_0x58125b){this[_0xa8f1('0xc')]('nat',_0x58125b?_0x58125b[_0xa8f1('0x18')](','):null);},'get':function(){return this[_0xa8f1('0xd')](_0xa8f1('0x19'))?this[_0xa8f1('0xd')](_0xa8f1('0x19'))[_0xa8f1('0xf')](','):null;},'comment':_0xa8f1('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xa8f1('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa8f1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa8f1('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa8f1('0x2')],'allowNull':![],'defaultValue':_0xa8f1('0x1b'),'set':function(_0xa49440){this['setDataValue'](_0xa8f1('0x1c'),_0xa49440?_0xa49440['join'](';'):_0xa8f1('0x1b'));},'get':function(){return this[_0xa8f1('0xd')](_0xa8f1('0x1c'))?this[_0xa8f1('0xd')]('allow')[_0xa8f1('0xf')](';'):null;},'comment':_0xa8f1('0x1d')},'autoframing':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'insecure':{'type':Sequelize[_0xa8f1('0x2')],'defaultValue':_0xa8f1('0x1f'),'set':function(_0x484c48){this[_0xa8f1('0xc')](_0xa8f1('0x20'),_0x484c48?_0x484c48[_0xa8f1('0x18')](','):null);},'get':function(){return this[_0xa8f1('0xd')](_0xa8f1('0x20'))?this[_0xa8f1('0xd')](_0xa8f1('0x20'))[_0xa8f1('0xf')](','):null;},'comment':_0xa8f1('0x21')},'trustrpid':{'type':Sequelize[_0xa8f1('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no',_0xa8f1('0x22'))},'promiscredir':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xa8f1('0x1e'),'no')},'accountcode':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'setvar':{'type':Sequelize[_0xa8f1('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xa8f1('0x24')},'amaflags':{'type':Sequelize[_0xa8f1('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0xa8f1('0x1e'),'no'),'defaultValue':_0xa8f1('0x1e')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'allowtransfer':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xa8f1('0x2')]},'template':{'type':Sequelize[_0xa8f1('0x2')]},'videosupport':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no',_0xa8f1('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xa8f1('0x2')]},'session_timers':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x26'),_0xa8f1('0x27'),_0xa8f1('0x28'))},'session_expires':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa8f1('0x29'),_0xa8f1('0x2a')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xa8f1('0x2')]},'regexten':{'type':Sequelize[_0xa8f1('0x2')]},'fromdomain':{'type':Sequelize[_0xa8f1('0x2')]},'fromuser':{'type':Sequelize[_0xa8f1('0x2')]},'port':{'type':Sequelize[_0xa8f1('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xa8f1('0x1e'),'no'),'defaultValue':_0xa8f1('0x1e')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xa8f1('0x2')]},'defaultuser':{'type':Sequelize[_0xa8f1('0x2')]},'rtptimeout':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xa8f1('0x1e'),'no',_0xa8f1('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa8f1('0x2')]},'callbackextension':{'type':Sequelize[_0xa8f1('0x2')]},'timert1':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'timerb':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa8f1('0x2')]},'contactacl':{'type':Sequelize[_0xa8f1('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xa8f1('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xa8f1('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xa8f1('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xa8f1('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'dtlsverify':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no',_0xa8f1('0x2c'),_0xa8f1('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xa8f1('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa8f1('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xa8f1('0x2')]},'dtlscipher':{'type':Sequelize[_0xa8f1('0x2')]},'dtlscafile':{'type':Sequelize[_0xa8f1('0x2')]},'dtlscapath':{'type':Sequelize[_0xa8f1('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xa8f1('0x2e'),_0xa8f1('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa8f1('0x2')]},'usereqphone':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xa8f1('0x2')]},'call_limit':{'type':Sequelize[_0xa8f1('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xa8f1('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xa8f1('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa8f1('0x2')]},'host':{'type':Sequelize[_0xa8f1('0x2')],'defaultValue':_0xa8f1('0x30')},'canreinvite':{'type':Sequelize[_0xa8f1('0x4')](_0xa8f1('0x1e'),'no',_0xa8f1('0x14'),_0xa8f1('0x15'),_0xa8f1('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa8f1('0x2')]},'active':{'type':Sequelize[_0xa8f1('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index ce60582..a7c1563 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4972ac,_0x5333d9){var _0x37fa20=function(_0x12b18f){while(--_0x12b18f){_0x4972ac['push'](_0x4972ac['shift']());}};_0x37fa20(++_0x5333d9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0xf3cd[_0x260073];return _0x4ff033;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x7e8f8b,_0x156cb2){var _0x74a075=function(_0x516c4d){while(--_0x516c4d){_0x7e8f8b['push'](_0x7e8f8b['shift']());}};_0x74a075(++_0x156cb2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4b803b,_0x50d3c9){_0x4b803b=_0x4b803b-0x0;var _0x2b2da1=_0xd6d6[_0x4b803b];return _0x2b2da1;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index efaa308..3c08f39 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5371=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5371,0x13e));var _0x1537=function(_0x5d988c,_0x576fd6){_0x5d988c=_0x5d988c-0x0;var _0x512365=_0x5371[_0x5d988c];return _0x512365;};'use strict';var _=require('lodash');var util=require(_0x1537('0x0'));var logger=require(_0x1537('0x1'))(_0x1537('0x2'));var moment=require('moment');var BPromise=require(_0x1537('0x3'));var rp=require(_0x1537('0x4'));var fs=require('fs');var path=require(_0x1537('0x5'));var rimraf=require('rimraf');var config=require(_0x1537('0x6'));var attributes=require(_0x1537('0x7'));module[_0x1537('0x8')]=function(_0x31c434,_0x461611){return _0x31c434['define'](_0x1537('0x9'),attributes,{'tableName':_0x1537('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0138=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x0138,0x137));var _0x8013=function(_0x12087b,_0x3a24cd){_0x12087b=_0x12087b-0x0;var _0x48a7c2=_0x0138[_0x12087b];return _0x48a7c2;};'use strict';var _=require(_0x8013('0x0'));var util=require(_0x8013('0x1'));var logger=require(_0x8013('0x2'))('api');var moment=require(_0x8013('0x3'));var BPromise=require(_0x8013('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8013('0x5'));var config=require(_0x8013('0x6'));var attributes=require(_0x8013('0x7'));module[_0x8013('0x8')]=function(_0x1e11bf,_0x4abf06){return _0x1e11bf[_0x8013('0x9')](_0x8013('0xa'),attributes,{'tableName':_0x8013('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 46922d1..99c1de1 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf384=['request\x20sent','catch','Trunk','options','raw','where','attributes','limit','include','model','map','ShowTrunk','find','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x2b71e0,_0x38c5b2){var _0x56545f=function(_0x3abe18){while(--_0x3abe18){_0x2b71e0['push'](_0x2b71e0['shift']());}};_0x56545f(++_0x38c5b2);}(_0xf384,0x1ed));var _0x4f38=function(_0x45259f,_0x1b39a8){_0x45259f=_0x45259f-0x0;var _0x2de326=_0xf384[_0x45259f];return _0x2de326;};'use strict';var _=require(_0x4f38('0x0'));var util=require(_0x4f38('0x1'));var moment=require(_0x4f38('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f38('0x3'));var logger=require(_0x4f38('0x4'))('rpc');var config=require(_0x4f38('0x5'));var jayson=require(_0x4f38('0x6'));var client=jayson[_0x4f38('0x7')][_0x4f38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8025,_0xa8fe36,_0x328c3d){return new BPromise(function(_0x355422,_0x19c722){return client[_0x4f38('0x9')](_0x5e8025,_0x328c3d)[_0x4f38('0xa')](function(_0x5c13b0){logger[_0x4f38('0xb')](_0x4f38('0xc'),_0xa8fe36,'request\x20sent');logger[_0x4f38('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0xa8fe36,'request\x20sent',JSON[_0x4f38('0xe')](_0x5c13b0));if(_0x5c13b0[_0x4f38('0xf')]){if(_0x5c13b0[_0x4f38('0xf')]['code']===0x1f4){logger[_0x4f38('0xf')](_0x4f38('0xc'),_0xa8fe36,_0x5c13b0[_0x4f38('0xf')][_0x4f38('0x10')]);return _0x19c722(_0x5c13b0[_0x4f38('0xf')][_0x4f38('0x10')]);}logger[_0x4f38('0xf')](_0x4f38('0xc'),_0xa8fe36,_0x5c13b0[_0x4f38('0xf')]['message']);return _0x355422(_0x5c13b0[_0x4f38('0xf')][_0x4f38('0x10')]);}else{logger['info'](_0x4f38('0xc'),_0xa8fe36,_0x4f38('0x11'));_0x355422(_0x5c13b0['result'][_0x4f38('0x10')]);}})[_0x4f38('0x12')](function(_0x3f0e54){logger[_0x4f38('0xf')](_0x4f38('0xc'),_0xa8fe36,_0x3f0e54);_0x19c722(_0x3f0e54);});});}exports['GetTrunk']=function(_0x19c0ae){var _0x1f37eb=this;return new Promise(function(_0x1d8bb8,_0x313bd3){return db[_0x4f38('0x13')]['findAll']({'raw':_0x19c0ae['options']?_0x19c0ae[_0x4f38('0x14')][_0x4f38('0x15')]===undefined?!![]:![]:!![],'where':_0x19c0ae[_0x4f38('0x14')]?_0x19c0ae['options'][_0x4f38('0x16')]||null:null,'attributes':_0x19c0ae[_0x4f38('0x14')]?_0x19c0ae[_0x4f38('0x14')][_0x4f38('0x17')]||null:null,'limit':_0x19c0ae[_0x4f38('0x14')]?_0x19c0ae[_0x4f38('0x14')][_0x4f38('0x18')]||null:null,'include':_0x19c0ae[_0x4f38('0x14')]?_0x19c0ae[_0x4f38('0x14')][_0x4f38('0x19')]?_['map'](_0x19c0ae[_0x4f38('0x14')]['include'],function(_0x632469){return{'model':db[_0x632469[_0x4f38('0x1a')]],'as':_0x632469['as'],'attributes':_0x632469[_0x4f38('0x17')],'include':_0x632469[_0x4f38('0x19')]?_[_0x4f38('0x1b')](_0x632469['include'],function(_0x3b5eb3){return{'model':db[_0x3b5eb3[_0x4f38('0x1a')]],'as':_0x3b5eb3['as'],'attributes':_0x3b5eb3['attributes'],'include':_0x3b5eb3[_0x4f38('0x19')]?_[_0x4f38('0x1b')](_0x3b5eb3[_0x4f38('0x19')],function(_0x21bdd5){return{'model':db[_0x21bdd5[_0x4f38('0x1a')]],'as':_0x21bdd5['as'],'attributes':_0x21bdd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f38('0xa')](function(_0x3a6775){logger[_0x4f38('0xb')]('GetTrunk',_0x19c0ae);logger[_0x4f38('0xd')]('GetTrunk',_0x19c0ae,JSON[_0x4f38('0xe')](_0x3a6775));_0x1d8bb8(_0x3a6775);})[_0x4f38('0x12')](function(_0x5e2bdf){logger[_0x4f38('0xf')]('GetTrunk',_0x5e2bdf[_0x4f38('0x10')],_0x19c0ae);_0x313bd3(_0x1f37eb[_0x4f38('0xf')](0x1f4,_0x5e2bdf['message']));});});};exports[_0x4f38('0x1c')]=function(_0x31b992){var _0x4d2274=this;return new Promise(function(_0x54d7f7,_0x1a00d3){return db[_0x4f38('0x13')][_0x4f38('0x1d')]({'raw':_0x31b992[_0x4f38('0x14')]?_0x31b992[_0x4f38('0x14')][_0x4f38('0x15')]===undefined?!![]:![]:!![],'where':_0x31b992[_0x4f38('0x14')]?_0x31b992[_0x4f38('0x14')][_0x4f38('0x16')]||null:null,'attributes':_0x31b992[_0x4f38('0x14')]?_0x31b992[_0x4f38('0x14')][_0x4f38('0x17')]||null:null,'include':_0x31b992[_0x4f38('0x14')]?_0x31b992['options']['include']?_[_0x4f38('0x1b')](_0x31b992[_0x4f38('0x14')][_0x4f38('0x19')],function(_0x34b67d){return{'model':db[_0x34b67d[_0x4f38('0x1a')]],'as':_0x34b67d['as'],'attributes':_0x34b67d['attributes'],'include':_0x34b67d[_0x4f38('0x19')]?_[_0x4f38('0x1b')](_0x34b67d[_0x4f38('0x19')],function(_0x4293d5){return{'model':db[_0x4293d5[_0x4f38('0x1a')]],'as':_0x4293d5['as'],'attributes':_0x4293d5['attributes'],'include':_0x4293d5['include']?_[_0x4f38('0x1b')](_0x4293d5['include'],function(_0x38fe79){return{'model':db[_0x38fe79['model']],'as':_0x38fe79['as'],'attributes':_0x38fe79['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f38('0xa')](function(_0x3ecb68){logger['info'](_0x4f38('0x1c'),_0x31b992);logger[_0x4f38('0xd')](_0x4f38('0x1c'),_0x31b992,JSON['stringify'](_0x3ecb68));_0x54d7f7(_0x3ecb68);})[_0x4f38('0x12')](function(_0x4fa177){logger[_0x4f38('0xf')]('ShowTrunk',_0x4fa177[_0x4f38('0x10')],_0x31b992);_0x1a00d3(_0x4d2274[_0x4f38('0xf')](0x1f4,_0x4fa177[_0x4f38('0x10')]));});});}; \ No newline at end of file +var _0x986d=['limit','include','map','model','GetTrunk','debug','where','ShowTrunk','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','attributes'];(function(_0x48ea38,_0xb5b397){var _0xa6780=function(_0x1888ee){while(--_0x1888ee){_0x48ea38['push'](_0x48ea38['shift']());}};_0xa6780(++_0xb5b397);}(_0x986d,0x128));var _0xd986=function(_0x3df30c,_0x4f3678){_0x3df30c=_0x3df30c-0x0;var _0x18cc4f=_0x986d[_0x3df30c];return _0x18cc4f;};'use strict';var _=require(_0xd986('0x0'));var util=require(_0xd986('0x1'));var moment=require('moment');var BPromise=require(_0xd986('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd986('0x3'))(_0xd986('0x4'));var config=require(_0xd986('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd986('0x6')][_0xd986('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4b9961,_0x486d87,_0x25ae17){return new BPromise(function(_0x4c9106,_0xd77e45){return client[_0xd986('0x8')](_0x4b9961,_0x25ae17)[_0xd986('0x9')](function(_0x1da693){logger[_0xd986('0xa')](_0xd986('0xb'),_0x486d87,_0xd986('0xc'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x486d87,_0xd986('0xc'),JSON[_0xd986('0xd')](_0x1da693));if(_0x1da693[_0xd986('0xe')]){if(_0x1da693[_0xd986('0xe')][_0xd986('0xf')]===0x1f4){logger[_0xd986('0xe')](_0xd986('0xb'),_0x486d87,_0x1da693[_0xd986('0xe')][_0xd986('0x10')]);return _0xd77e45(_0x1da693['error'][_0xd986('0x10')]);}logger['error'](_0xd986('0xb'),_0x486d87,_0x1da693['error'][_0xd986('0x10')]);return _0x4c9106(_0x1da693[_0xd986('0xe')]['message']);}else{logger[_0xd986('0xa')](_0xd986('0xb'),_0x486d87,_0xd986('0xc'));_0x4c9106(_0x1da693[_0xd986('0x11')]['message']);}})[_0xd986('0x12')](function(_0x31e431){logger[_0xd986('0xe')](_0xd986('0xb'),_0x486d87,_0x31e431);_0xd77e45(_0x31e431);});});}exports['GetTrunk']=function(_0x48af20){var _0x5e8b04=this;return new Promise(function(_0x51d08f,_0x90c893){return db[_0xd986('0x13')][_0xd986('0x14')]({'raw':_0x48af20['options']?_0x48af20[_0xd986('0x15')][_0xd986('0x16')]===undefined?!![]:![]:!![],'where':_0x48af20[_0xd986('0x15')]?_0x48af20[_0xd986('0x15')]['where']||null:null,'attributes':_0x48af20[_0xd986('0x15')]?_0x48af20['options'][_0xd986('0x17')]||null:null,'limit':_0x48af20['options']?_0x48af20[_0xd986('0x15')][_0xd986('0x18')]||null:null,'include':_0x48af20[_0xd986('0x15')]?_0x48af20['options'][_0xd986('0x19')]?_[_0xd986('0x1a')](_0x48af20[_0xd986('0x15')][_0xd986('0x19')],function(_0x547765){return{'model':db[_0x547765[_0xd986('0x1b')]],'as':_0x547765['as'],'attributes':_0x547765[_0xd986('0x17')],'include':_0x547765['include']?_[_0xd986('0x1a')](_0x547765[_0xd986('0x19')],function(_0x3d198f){return{'model':db[_0x3d198f['model']],'as':_0x3d198f['as'],'attributes':_0x3d198f['attributes'],'include':_0x3d198f[_0xd986('0x19')]?_['map'](_0x3d198f[_0xd986('0x19')],function(_0x3cce05){return{'model':db[_0x3cce05[_0xd986('0x1b')]],'as':_0x3cce05['as'],'attributes':_0x3cce05[_0xd986('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd986('0x9')](function(_0x4117d6){logger['info'](_0xd986('0x1c'),_0x48af20);logger[_0xd986('0x1d')]('GetTrunk',_0x48af20,JSON['stringify'](_0x4117d6));_0x51d08f(_0x4117d6);})[_0xd986('0x12')](function(_0x2ba1b4){logger[_0xd986('0xe')](_0xd986('0x1c'),_0x2ba1b4[_0xd986('0x10')],_0x48af20);_0x90c893(_0x5e8b04['error'](0x1f4,_0x2ba1b4['message']));});});};exports['ShowTrunk']=function(_0x38f2c9){var _0x13cceb=this;return new Promise(function(_0x4166d5,_0x10d74c){return db[_0xd986('0x13')]['find']({'raw':_0x38f2c9[_0xd986('0x15')]?_0x38f2c9['options'][_0xd986('0x16')]===undefined?!![]:![]:!![],'where':_0x38f2c9[_0xd986('0x15')]?_0x38f2c9['options'][_0xd986('0x1e')]||null:null,'attributes':_0x38f2c9[_0xd986('0x15')]?_0x38f2c9[_0xd986('0x15')][_0xd986('0x17')]||null:null,'include':_0x38f2c9[_0xd986('0x15')]?_0x38f2c9['options']['include']?_[_0xd986('0x1a')](_0x38f2c9[_0xd986('0x15')][_0xd986('0x19')],function(_0xdce71b){return{'model':db[_0xdce71b[_0xd986('0x1b')]],'as':_0xdce71b['as'],'attributes':_0xdce71b['attributes'],'include':_0xdce71b[_0xd986('0x19')]?_[_0xd986('0x1a')](_0xdce71b[_0xd986('0x19')],function(_0x502db5){return{'model':db[_0x502db5['model']],'as':_0x502db5['as'],'attributes':_0x502db5['attributes'],'include':_0x502db5[_0xd986('0x19')]?_[_0xd986('0x1a')](_0x502db5[_0xd986('0x19')],function(_0x18439b){return{'model':db[_0x18439b[_0xd986('0x1b')]],'as':_0x18439b['as'],'attributes':_0x18439b[_0xd986('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1138cf){logger['info'](_0xd986('0x1f'),_0x38f2c9);logger[_0xd986('0x1d')](_0xd986('0x1f'),_0x38f2c9,JSON[_0xd986('0xd')](_0x1138cf));_0x4166d5(_0x1138cf);})[_0xd986('0x12')](function(_0xc79323){logger[_0xd986('0xe')](_0xd986('0x1f'),_0xc79323[_0xd986('0x10')],_0x38f2c9);_0x10d74c(_0x13cceb[_0xd986('0xe')](0x1f4,_0xc79323[_0xd986('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 55b6931..7737195 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35de=['/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','/:id/api_key','post','create','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/login','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','put','changePassword','delete','/:id/queues','removeQueues','removeTeams','/:id','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeOpenchannelAccounts','removeSquareProjects','removeApiKey','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','/:id/screen_recordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x35de,0x9a));var _0xe35d=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x35de[_0x5cbd7b];return _0x3fdfb8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe35d('0x0'));var timeout=require(_0xe35d('0x1'));var express=require(_0xe35d('0x2'));var router=express[_0xe35d('0x3')]();var fs_extra=require(_0xe35d('0x4'));var auth=require(_0xe35d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe35d('0x6'));var controller=require('./user.controller');router[_0xe35d('0x7')]('/',auth[_0xe35d('0x8')](),controller[_0xe35d('0x9')]);router[_0xe35d('0x7')](_0xe35d('0xa'),auth[_0xe35d('0x8')](),controller[_0xe35d('0xb')]);router['get'](_0xe35d('0xc'),auth['isAuthenticated'](),controller[_0xe35d('0xd')]);router[_0xe35d('0x7')]('/presence',auth[_0xe35d('0x8')](),controller[_0xe35d('0xe')]);router[_0xe35d('0x7')]('/:id',auth[_0xe35d('0x8')](),controller['show']);router[_0xe35d('0x7')](_0xe35d('0xf'),controller['getAvatar']);router[_0xe35d('0x7')](_0xe35d('0x10'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x11')]);router[_0xe35d('0x7')](_0xe35d('0x12'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x13')]);router[_0xe35d('0x7')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0xe35d('0x7')](_0xe35d('0x14'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x15')]);router[_0xe35d('0x7')]('/:id/groups',auth['isAuthenticated'](),controller[_0xe35d('0x16')]);router[_0xe35d('0x7')](_0xe35d('0x17'),auth['isAuthenticated'](),controller['getRecordings']);router[_0xe35d('0x7')](_0xe35d('0x18'),auth[_0xe35d('0x8')](),controller['getScreenRecordings']);router[_0xe35d('0x7')]('/:id/chat/interactions',auth[_0xe35d('0x8')](),controller['getChatInteractions']);router[_0xe35d('0x7')](_0xe35d('0x19'),auth['isAuthenticated'](),controller[_0xe35d('0x1a')]);router[_0xe35d('0x7')](_0xe35d('0x1b'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x1c')]);router['get'](_0xe35d('0x1d'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x1e')]);router[_0xe35d('0x7')](_0xe35d('0x1f'),auth[_0xe35d('0x8')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0xe35d('0x8')](),controller['getWhatsappInteractions']);router[_0xe35d('0x7')](_0xe35d('0x20'),auth['isAuthenticated'](),controller[_0xe35d('0x21')]);router[_0xe35d('0x7')](_0xe35d('0x22'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x23')]);router[_0xe35d('0x7')](_0xe35d('0x24'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x25')]);router['get'](_0xe35d('0x26'),auth['isAuthenticated'](),controller[_0xe35d('0x27')]);router[_0xe35d('0x7')]('/:id/fax_accounts',auth[_0xe35d('0x8')](),controller['getFaxAccounts']);router[_0xe35d('0x7')](_0xe35d('0x28'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x29')]);router['get'](_0xe35d('0x2a'),auth[_0xe35d('0x8')](),controller['getOpenchannelAccounts']);router[_0xe35d('0x7')](_0xe35d('0x2b'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x2c')]);router[_0xe35d('0x7')](_0xe35d('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xe35d('0x7')](_0xe35d('0x2e'),auth['isAuthenticated'](),controller[_0xe35d('0x2f')]);router[_0xe35d('0x7')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xe35d('0x30')]);router[_0xe35d('0x7')](_0xe35d('0x31'),auth[_0xe35d('0x8')](),controller['getScheduledCalls']);router['get'](_0xe35d('0x32'),auth[_0xe35d('0x8')](),controller['getApiKey']);router[_0xe35d('0x33')](_0xe35d('0x12'),auth[_0xe35d('0x8')](),controller['addContacts']);router[_0xe35d('0x33')]('/',auth[_0xe35d('0x8')](),controller[_0xe35d('0x34')]);router[_0xe35d('0x33')](_0xe35d('0x35'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x36')]);router[_0xe35d('0x33')]('/:id/queues',auth[_0xe35d('0x8')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cc904,_0x3de7af,_0x5d85d0){_0x5d85d0(null,path[_0xe35d('0x37')](config[_0xe35d('0x38')],_0xe35d('0x39')));},'filename':function(_0x17c488,_0x5205fc,_0x39cf89){_0x39cf89(null,util[_0xe35d('0x3a')](_0xe35d('0x3b'),Date['now'](),_0x5205fc[_0xe35d('0x3c')]));}})});router[_0xe35d('0x33')](_0xe35d('0xf'),upload[_0xe35d('0x3d')]('file'),controller[_0xe35d('0x3e')]);router[_0xe35d('0x33')](_0xe35d('0x3f'),auth['isAuthenticated'](),controller['login']);router['post']('/:id/logout',auth[_0xe35d('0x8')](),controller['logout']);router[_0xe35d('0x33')](_0xe35d('0x40'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x41')]);router[_0xe35d('0x33')](_0xe35d('0x42'),auth['isAuthenticated'](),controller['unpause']);router[_0xe35d('0x33')](_0xe35d('0x20'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x43')]);router[_0xe35d('0x33')](_0xe35d('0x44'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0xe35d('0x33')](_0xe35d('0x45'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x46')]);router[_0xe35d('0x33')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0xe35d('0x47'),auth[_0xe35d('0x8')](),controller['addSmsInteractions']);router[_0xe35d('0x33')](_0xe35d('0x48'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x49')]);router['post'](_0xe35d('0x4a'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x4b')]);router[_0xe35d('0x33')]('/:id/fax_accounts',auth[_0xe35d('0x8')](),controller[_0xe35d('0x4c')]);router['post'](_0xe35d('0x28'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x4d')]);router[_0xe35d('0x33')](_0xe35d('0x2a'),auth[_0xe35d('0x8')](),controller['addOpenchannelAccounts']);router[_0xe35d('0x33')]('/:id/sms_accounts',auth[_0xe35d('0x8')](),controller[_0xe35d('0x4e')]);router[_0xe35d('0x33')](_0xe35d('0x2d'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x4f')]);router[_0xe35d('0x33')](_0xe35d('0x2e'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x50')]);router[_0xe35d('0x33')](_0xe35d('0x51'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x52')]);router['post'](_0xe35d('0x32'),auth[_0xe35d('0x8')](),controller['createApiKey']);router[_0xe35d('0x53')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe35d('0x53')]('/:id/password',auth[_0xe35d('0x8')](),controller[_0xe35d('0x54')]);router[_0xe35d('0x55')](_0xe35d('0x56'),auth['isAuthenticated'](),controller[_0xe35d('0x57')]);router[_0xe35d('0x55')](_0xe35d('0x20'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x58')]);router[_0xe35d('0x55')](_0xe35d('0x59'),auth[_0xe35d('0x8')](),controller['destroy']);router[_0xe35d('0x55')](_0xe35d('0x44'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x5a')]);router[_0xe35d('0x55')](_0xe35d('0x45'),auth[_0xe35d('0x8')](),controller['removeMailInteractions']);router[_0xe35d('0x55')](_0xe35d('0x5b'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x5c')]);router[_0xe35d('0x55')]('/:id/sms_interactions',auth[_0xe35d('0x8')](),controller[_0xe35d('0x5d')]);router[_0xe35d('0x55')]('/:id/openchannel_interactions',auth[_0xe35d('0x8')](),controller[_0xe35d('0x5e')]);router[_0xe35d('0x55')](_0xe35d('0x4a'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x5f')]);router[_0xe35d('0x55')](_0xe35d('0x60'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xe35d('0x55')]('/:id/mail_accounts',auth[_0xe35d('0x8')](),controller['removeMailAccounts']);router[_0xe35d('0x55')](_0xe35d('0x2a'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x61')]);router[_0xe35d('0x55')]('/:id/sms_accounts',auth[_0xe35d('0x8')](),controller['removeSmsAccounts']);router[_0xe35d('0x55')](_0xe35d('0x2d'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xe35d('0x55')](_0xe35d('0x2e'),auth[_0xe35d('0x8')](),controller['removeWhatsappAccounts']);router['delete'](_0xe35d('0x51'),auth[_0xe35d('0x8')](),controller[_0xe35d('0x62')]);router[_0xe35d('0x55')](_0xe35d('0x32'),auth['isAuthenticated'](),controller[_0xe35d('0x63')]);module['exports']=router; \ No newline at end of file +var _0x41bc=['getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','changePassword','delete','removeTeams','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings'];(function(_0x312a5c,_0x59990a){var _0x329f31=function(_0x52791c){while(--_0x52791c){_0x312a5c['push'](_0x312a5c['shift']());}};_0x329f31(++_0x59990a);}(_0x41bc,0x153));var _0xc41b=function(_0x2e4d54,_0x1d98d0){_0x2e4d54=_0x2e4d54-0x0;var _0x394d2c=_0x41bc[_0x2e4d54];return _0x394d2c;};'use strict';var multer=require(_0xc41b('0x0'));var util=require('util');var path=require(_0xc41b('0x1'));var timeout=require(_0xc41b('0x2'));var express=require(_0xc41b('0x3'));var router=express['Router']();var fs_extra=require(_0xc41b('0x4'));var auth=require(_0xc41b('0x5'));var interaction=require(_0xc41b('0x6'));var config=require(_0xc41b('0x7'));var controller=require(_0xc41b('0x8'));router[_0xc41b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc41b('0xa')]);router[_0xc41b('0x9')](_0xc41b('0xb'),auth[_0xc41b('0xc')](),controller[_0xc41b('0xd')]);router[_0xc41b('0x9')]('/whoami',auth[_0xc41b('0xc')](),controller[_0xc41b('0xe')]);router[_0xc41b('0x9')](_0xc41b('0xf'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x10')]);router[_0xc41b('0x9')]('/:id',auth[_0xc41b('0xc')](),controller[_0xc41b('0x11')]);router[_0xc41b('0x9')](_0xc41b('0x12'),controller[_0xc41b('0x13')]);router[_0xc41b('0x9')](_0xc41b('0x14'),auth['isAuthenticated'](),controller[_0xc41b('0x15')]);router[_0xc41b('0x9')](_0xc41b('0x16'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x17')]);router['get'](_0xc41b('0x18'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x19')]);router[_0xc41b('0x9')](_0xc41b('0x1a'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x1b')]);router[_0xc41b('0x9')](_0xc41b('0x1c'),auth[_0xc41b('0xc')](),controller['getGroups']);router[_0xc41b('0x9')](_0xc41b('0x1d'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x1e')]);router[_0xc41b('0x9')]('/:id/screen_recordings',auth[_0xc41b('0xc')](),controller['getScreenRecordings']);router['get'](_0xc41b('0x1f'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x20')]);router[_0xc41b('0x9')](_0xc41b('0x21'),auth['isAuthenticated'](),controller[_0xc41b('0x22')]);router[_0xc41b('0x9')](_0xc41b('0x23'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x24')]);router[_0xc41b('0x9')](_0xc41b('0x25'),auth[_0xc41b('0xc')](),controller['getSmsInteractions']);router[_0xc41b('0x9')](_0xc41b('0x26'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x27')]);router[_0xc41b('0x9')]('/:id/whatsapp/interactions',auth[_0xc41b('0xc')](),controller[_0xc41b('0x28')]);router[_0xc41b('0x9')](_0xc41b('0x29'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x2a')]);router['get'](_0xc41b('0x2b'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x2c')]);router[_0xc41b('0x9')](_0xc41b('0x2d'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x2e')]);router[_0xc41b('0x9')](_0xc41b('0x2f'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x30')]);router['get']('/:id/fax_accounts',auth[_0xc41b('0xc')](),controller[_0xc41b('0x31')]);router[_0xc41b('0x9')](_0xc41b('0x32'),auth['isAuthenticated'](),controller[_0xc41b('0x33')]);router[_0xc41b('0x9')](_0xc41b('0x34'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x35')]);router[_0xc41b('0x9')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xc41b('0x36')]);router['get'](_0xc41b('0x37'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x38')]);router[_0xc41b('0x9')](_0xc41b('0x39'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x3a')]);router[_0xc41b('0x9')](_0xc41b('0x3b'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x3c')]);router[_0xc41b('0x9')](_0xc41b('0x3d'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x3e')]);router[_0xc41b('0x9')](_0xc41b('0x3f'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x40')]);router[_0xc41b('0x41')](_0xc41b('0x16'),auth['isAuthenticated'](),controller['addContacts']);router[_0xc41b('0x41')]('/',auth[_0xc41b('0xc')](),controller['create']);router[_0xc41b('0x41')](_0xc41b('0x42'),auth[_0xc41b('0xc')](),controller['bulkCreate']);router['post'](_0xc41b('0x18'),auth['isAuthenticated'](),controller[_0xc41b('0x43')]);var upload=multer({'storage':multer[_0xc41b('0x44')]({'destination':function(_0x272670,_0x1550a4,_0x5f343c){_0x5f343c(null,path[_0xc41b('0x45')](config[_0xc41b('0x46')],_0xc41b('0x47')));},'filename':function(_0x3bec52,_0x3d7c15,_0x1b16b9){_0x1b16b9(null,util[_0xc41b('0x48')](_0xc41b('0x49'),Date[_0xc41b('0x4a')](),_0x3d7c15['originalname']));}})});router['post']('/:id/avatar',upload[_0xc41b('0x4b')](_0xc41b('0x4c')),controller[_0xc41b('0x4d')]);router[_0xc41b('0x41')](_0xc41b('0x4e'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x4f')]);router[_0xc41b('0x41')](_0xc41b('0x50'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x51')]);router[_0xc41b('0x41')](_0xc41b('0x52'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x53')]);router['post'](_0xc41b('0x54'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x55')]);router[_0xc41b('0x41')](_0xc41b('0x29'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x56')]);router[_0xc41b('0x41')](_0xc41b('0x57'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x58')]);router[_0xc41b('0x41')]('/:id/mail_interactions',auth[_0xc41b('0xc')](),controller[_0xc41b('0x59')]);router[_0xc41b('0x41')](_0xc41b('0x5a'),auth['isAuthenticated'](),controller[_0xc41b('0x5b')]);router['post'](_0xc41b('0x5c'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x5d')]);router[_0xc41b('0x41')](_0xc41b('0x5e'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x5f')]);router[_0xc41b('0x41')](_0xc41b('0x60'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x61')]);router[_0xc41b('0x41')]('/:id/fax_accounts',auth[_0xc41b('0xc')](),controller['addFaxAccounts']);router[_0xc41b('0x41')](_0xc41b('0x32'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x62')]);router[_0xc41b('0x41')](_0xc41b('0x34'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x63')]);router[_0xc41b('0x41')](_0xc41b('0x64'),auth['isAuthenticated'](),controller[_0xc41b('0x65')]);router[_0xc41b('0x41')](_0xc41b('0x37'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x66')]);router[_0xc41b('0x41')](_0xc41b('0x39'),auth['isAuthenticated'](),controller[_0xc41b('0x67')]);router[_0xc41b('0x41')](_0xc41b('0x3b'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x68')]);router[_0xc41b('0x41')](_0xc41b('0x3f'),auth[_0xc41b('0xc')](),controller['createApiKey']);router[_0xc41b('0x69')]('/:id',auth[_0xc41b('0xc')](),controller['update']);router[_0xc41b('0x69')]('/:id/password',auth[_0xc41b('0xc')](),controller[_0xc41b('0x6a')]);router[_0xc41b('0x6b')](_0xc41b('0x18'),auth[_0xc41b('0xc')](),controller['removeQueues']);router['delete'](_0xc41b('0x29'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x6c')]);router[_0xc41b('0x6b')]('/:id',auth[_0xc41b('0xc')](),controller['destroy']);router[_0xc41b('0x6b')](_0xc41b('0x57'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x6d')]);router[_0xc41b('0x6b')](_0xc41b('0x6e'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x6f')]);router[_0xc41b('0x6b')](_0xc41b('0x5a'),auth[_0xc41b('0xc')](),controller['removeFaxInteractions']);router[_0xc41b('0x6b')](_0xc41b('0x5c'),auth[_0xc41b('0xc')](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0xc41b('0xc')](),controller[_0xc41b('0x70')]);router['delete'](_0xc41b('0x60'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x71')]);router[_0xc41b('0x6b')](_0xc41b('0x72'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x73')]);router['delete']('/:id/mail_accounts',auth[_0xc41b('0xc')](),controller[_0xc41b('0x74')]);router[_0xc41b('0x6b')](_0xc41b('0x34'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x75')]);router[_0xc41b('0x6b')](_0xc41b('0x64'),auth['isAuthenticated'](),controller[_0xc41b('0x76')]);router[_0xc41b('0x6b')]('/:id/chat_websites',auth[_0xc41b('0xc')](),controller[_0xc41b('0x77')]);router[_0xc41b('0x6b')](_0xc41b('0x39'),auth['isAuthenticated'](),controller[_0xc41b('0x78')]);router['delete']('/:id/square_projects',auth[_0xc41b('0xc')](),controller['removeSquareProjects']);router[_0xc41b('0x6b')](_0xc41b('0x3f'),auth[_0xc41b('0xc')](),controller[_0xc41b('0x79')]);module[_0xc41b('0x7a')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f78375d..2e35bd9 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c83=['PROHIB_FAILED_SCREEN','PROHIB','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','DATE','TEXT','showWebBar','get','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','dtlsprivatekey','permissions','map','split','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','exports','name','setDataValue','defaultuser','STRING','fullname','callerid','format','internal','email','toLowerCase','ENUM','admin','user','agent','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c83,0xf2));var _0x39c8=function(_0x5cd94c,_0x5d5970){_0x5cd94c=_0x5cd94c-0x0;var _0x334d05=_0x9c83[_0x5cd94c];return _0x334d05;};'use strict';var Sequelize=require(_0x39c8('0x0'));var moment=require('moment');var util=require(_0x39c8('0x1'));var _=require('lodash');module[_0x39c8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c7883){this['setDataValue'](_0x39c8('0x3'),_0x4c7883);this[_0x39c8('0x4')](_0x39c8('0x5'),_0x4c7883);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x39c8('0x6')],'allowNull':![],'set':function(_0x57c012){this['setDataValue'](_0x39c8('0x7'),_0x57c012);this['setDataValue'](_0x39c8('0x8'),util[_0x39c8('0x9')]('\x22%s\x22\x20<%s>',_0x57c012,this['getDataValue'](_0x39c8('0xa'))));}},'alias':{'type':Sequelize[_0x39c8('0x6')]},'email':{'type':Sequelize[_0x39c8('0x6')],'allowNull':![],'unique':_0x39c8('0xb'),'validate':{'isEmail':!![]},'set':function(_0x469d83){if(_0x469d83){this[_0x39c8('0x4')](_0x39c8('0xb'),_0x469d83[_0x39c8('0xc')]());}}},'role':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0xe'),_0x39c8('0xf'),_0x39c8('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x39c8('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x39c8('0x6')],'defaultValue':_0x39c8('0x11')},'internal':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':![],'unique':_0x39c8('0xa'),'set':function(_0x47ec9a){this[_0x39c8('0x4')]('internal',_0x47ec9a);this[_0x39c8('0x4')](_0x39c8('0x13'),_0x47ec9a);this['setDataValue'](_0x39c8('0x8'),util[_0x39c8('0x9')](_0x39c8('0x14'),this[_0x39c8('0x15')](_0x39c8('0x7')),_0x47ec9a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x39c8('0x6')]},'mobile':{'type':Sequelize[_0x39c8('0x6')]},'address':{'type':Sequelize[_0x39c8('0x6')]},'zipcode':{'type':Sequelize[_0x39c8('0x6')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x39c8('0x6')]},'country':{'type':Sequelize[_0x39c8('0x6')]},'online':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x39c8('0x6')],'defaultValue':_0x39c8('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x39c8('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x39c8('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x39c8('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x39c8('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x19'),'user','peer'),'allowNull':!![],'defaultValue':_0x39c8('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x1a'),'ALLOWED_PASSED_SCREEN',_0x39c8('0x1b'),_0x39c8('0x1c'),_0x39c8('0x1d'),_0x39c8('0x1e'),_0x39c8('0x1f'),_0x39c8('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![],'defaultValue':'udp','set':function(_0x44040c){this[_0x39c8('0x4')](_0x39c8('0x21'),_0x44040c?_0x44040c[_0x39c8('0x22')](','):null);},'get':function(){return this[_0x39c8('0x15')]('transport')?this[_0x39c8('0x15')](_0x39c8('0x21'))['split'](','):null;},'comment':_0x39c8('0x23')},'dtmfmode':{'type':Sequelize[_0x39c8('0xd')]('rfc2833',_0x39c8('0x24'),_0x39c8('0x25'),_0x39c8('0x26'),_0x39c8('0x27')),'allowNull':!![],'defaultValue':_0x39c8('0x28')},'directmedia':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no',_0x39c8('0x2a'),_0x39c8('0x2b'),_0x39c8('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'nat':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x4150c9){this['setDataValue'](_0x39c8('0x2d'),_0x4150c9?_0x4150c9['join'](','):null);},'get':function(){return this[_0x39c8('0x15')](_0x39c8('0x2d'))?this[_0x39c8('0x15')]('nat')['split'](','):null;},'comment':_0x39c8('0x2e')},'callgroup':{'type':Sequelize[_0x39c8('0x6')]},'namedcallgroup':{'type':Sequelize[_0x39c8('0x6')]},'pickupgroup':{'type':Sequelize[_0x39c8('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x39c8('0x6')]},'language':{'type':Sequelize[_0x39c8('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x39c8('0x6')]},'disallow':{'type':Sequelize[_0x39c8('0x6')],'allowNull':![],'defaultValue':_0x39c8('0x2f')},'allow':{'type':Sequelize[_0x39c8('0x6')],'allowNull':![],'defaultValue':_0x39c8('0x30'),'set':function(_0x5eae82){this[_0x39c8('0x4')](_0x39c8('0x31'),_0x5eae82?_0x5eae82[_0x39c8('0x22')](';'):_0x39c8('0x30'));},'get':function(){return this[_0x39c8('0x15')]('allow')?this[_0x39c8('0x15')](_0x39c8('0x31'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x39c8('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![],'set':function(_0x1e8830){this['setDataValue'](_0x39c8('0x32'),_0x1e8830?_0x1e8830[_0x39c8('0x22')](','):null);},'get':function(){return this[_0x39c8('0x15')](_0x39c8('0x32'))?this[_0x39c8('0x15')](_0x39c8('0x32'))['split'](','):null;},'comment':_0x39c8('0x33')},'trustrpid':{'type':Sequelize[_0x39c8('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x39c8('0xd')]('yes','no',_0x39c8('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![],'defaultValue':_0x39c8('0x35')},'amaflags':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':_0x39c8('0x29')},'busylevel':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'template':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no',_0x39c8('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x37'),_0x39c8('0x38'),_0x39c8('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x3a'),_0x39c8('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x39c8('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no',_0x39c8('0x3c'),_0x39c8('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x39c8('0xd')]('active',_0x39c8('0x3e'),_0x39c8('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x39c8('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x39c8('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x39c8('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no','nonat',_0x39c8('0x2b'),_0x39c8('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x39c8('0x41')]},'passwordResetAt':{'type':Sequelize[_0x39c8('0x41')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x39c8('0x42')]},'showWebBar':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0,'set':function(_0x13c181){this['setDataValue'](_0x39c8('0x43'),_0x13c181);var _0x5e3661=this[_0x39c8('0x44')]({'plain':!![]});switch(_0x13c181){case 0x0:case 0x1:var _0x2a1e62=_0x5e3661[_0x39c8('0x21')]?_['isArray'](_0x5e3661[_0x39c8('0x21')])?_0x5e3661[_0x39c8('0x21')][_0x39c8('0x22')]():_0x5e3661[_0x39c8('0x21')]:_0x39c8('0x45');if(_0x2a1e62==='wss'){_0x2a1e62=_0x39c8('0x45');}this['setDataValue'](_0x39c8('0x21'),_0x2a1e62);this['setDataValue'](_0x39c8('0x46'),'no');this[_0x39c8('0x4')](_0x39c8('0x47'),null);this[_0x39c8('0x4')](_0x39c8('0x48'),null);this[_0x39c8('0x4')](_0x39c8('0x49'),null);this[_0x39c8('0x4')](_0x39c8('0x4a'),null);this[_0x39c8('0x4')](_0x39c8('0x4b'),null);this['setDataValue'](_0x39c8('0x4c'),null);this[_0x39c8('0x4')](_0x39c8('0x4d'),null);this[_0x39c8('0x4')]('dtlsprivatekey',null);this[_0x39c8('0x4')](_0x39c8('0x4e'),'no');break;case 0x2:this[_0x39c8('0x4')](_0x39c8('0x21'),'wss');this[_0x39c8('0x4')]('encryption',_0x39c8('0x29'));this[_0x39c8('0x4')](_0x39c8('0x47'),_0x39c8('0x29'));this[_0x39c8('0x4')](_0x39c8('0x48'),'yes');this['setDataValue'](_0x39c8('0x49'),_0x39c8('0x29'));this[_0x39c8('0x4')](_0x39c8('0x4a'),'yes');this[_0x39c8('0x4')](_0x39c8('0x4b'),'no');this[_0x39c8('0x4')](_0x39c8('0x4c'),_0x39c8('0x3f'));this[_0x39c8('0x4')](_0x39c8('0x4d'),_0x5e3661[_0x39c8('0x4d')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x39c8('0x4f'),_0x5e3661['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x39c8('0x4')](_0x39c8('0x4e'),_0x39c8('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x39c8('0x42')],'set':function(_0x12a0a8){this['setDataValue'](_0x39c8('0x50'),_0x12a0a8?_0x12a0a8[_0x39c8('0x22')](','):[]);},'get':function(){return this['getDataValue'](_0x39c8('0x50'))?_[_0x39c8('0x51')](this[_0x39c8('0x15')](_0x39c8('0x50'))[_0x39c8('0x52')](','),function(_0x3acc68){return parseInt(_0x3acc68,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x39c8('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x39c8('0x6')]},'phoneBarBusyNumber':{'type':Sequelize[_0x39c8('0x6')]},'phoneBarUnconditional':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x39c8('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x39c8('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x39c8('0xd')](_0x39c8('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x39c8('0x6')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x39c8('0x53')],'get':function(){return this[_0x39c8('0x15')](_0x39c8('0x54'))?this[_0x39c8('0x15')](_0x39c8('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x39c8('0x6')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x583a4d){if(typeof _0x583a4d==='string'){var _0x308250=_0x583a4d==='1'?!![]:_0x583a4d==='0'?![]:_0x583a4d==='true'?!![]:_0x583a4d===_0x39c8('0x55')?![]:![];this['setDataValue'](_0x39c8('0x56'),_0x308250);}else{this['setDataValue'](_0x39c8('0x56'),_0x583a4d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3c46b8){this[_0x39c8('0x4')](_0x39c8('0x57'),_0x3c46b8);if(_0x3c46b8===!![]){this[_0x39c8('0x4')](_0x39c8('0x58'),moment());this[_0x39c8('0x4')](_0x39c8('0x59'),0x0);}else{this[_0x39c8('0x4')](_0x39c8('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x39c8('0x41')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x39c8('0x12')](0x5)[_0x39c8('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x39c8('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xf99c=['shortinfo','inband','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','originate','uac','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','wss','encryption','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','force_avp','dtlsverify','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','email','toLowerCase','ENUM','user','local','internal','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','from-sip','ALLOWED','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x3a9218,_0x425547){var _0x23ee25=function(_0x5fe026){while(--_0x5fe026){_0x3a9218['push'](_0x3a9218['shift']());}};_0x23ee25(++_0x425547);}(_0xf99c,0x81));var _0xcf99=function(_0x4a316d,_0xeb9a0e){_0x4a316d=_0x4a316d-0x0;var _0x23e9f9=_0xf99c[_0x4a316d];return _0x23e9f9;};'use strict';var Sequelize=require(_0xcf99('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'unique':_0xcf99('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x213562){this['setDataValue'](_0xcf99('0x2'),_0x213562);this[_0xcf99('0x3')](_0xcf99('0x4'),_0x213562);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'set':function(_0x48f682){this[_0xcf99('0x3')](_0xcf99('0x5'),_0x48f682);this[_0xcf99('0x3')](_0xcf99('0x6'),util[_0xcf99('0x7')](_0xcf99('0x8'),_0x48f682,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0xcf99('0x1')]},'email':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'unique':_0xcf99('0x9'),'validate':{'isEmail':!![]},'set':function(_0x3e3adb){if(_0x3e3adb){this[_0xcf99('0x3')](_0xcf99('0x9'),_0x3e3adb[_0xcf99('0xa')]());}}},'role':{'type':Sequelize[_0xcf99('0xb')]('admin',_0xcf99('0xc'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xcf99('0xd')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xcf99('0xe'),'set':function(_0x5346e0){this[_0xcf99('0x3')]('internal',_0x5346e0);this[_0xcf99('0x3')](_0xcf99('0xf'),_0x5346e0);this['setDataValue'](_0xcf99('0x6'),util[_0xcf99('0x7')](_0xcf99('0x8'),this['getDataValue']('fullname'),_0x5346e0));}},'salt':{'type':Sequelize[_0xcf99('0x1')]},'phone':{'type':Sequelize[_0xcf99('0x1')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xcf99('0x1')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xcf99('0x1')]},'city':{'type':Sequelize[_0xcf99('0x1')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcf99('0x1')],'defaultValue':_0xcf99('0x11')},'lastPauseAt':{'type':Sequelize[_0xcf99('0x12')]},'chatCapacity':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcf99('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xcf99('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'host':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![],'defaultValue':_0xcf99('0x14')},'ipaddr':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'port':{'type':Sequelize[_0xcf99('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x15'),'user','peer'),'allowNull':!![],'defaultValue':_0xcf99('0x15')},'context':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![],'defaultValue':_0xcf99('0x16')},'callingpres':{'type':Sequelize[_0xcf99('0xb')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xcf99('0x17'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xcf99('0x18'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'permit':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'secret':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![],'defaultValue':_0xcf99('0x19'),'set':function(_0x3ca9bd){this[_0xcf99('0x3')](_0xcf99('0x1a'),_0x3ca9bd?_0x3ca9bd[_0xcf99('0x1b')](','):null);},'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x1a'))?this[_0xcf99('0x1c')](_0xcf99('0x1a'))[_0xcf99('0x1d')](','):null;},'comment':_0xcf99('0x1e')},'dtmfmode':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x1f'),_0xcf99('0x20'),_0xcf99('0x21'),_0xcf99('0x22'),'auto'),'allowNull':!![],'defaultValue':_0xcf99('0x1f')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xcf99('0x23'),_0xcf99('0x24'),_0xcf99('0x25')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'nat':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![],'defaultValue':_0xcf99('0x27'),'set':function(_0x4150ab){this[_0xcf99('0x3')](_0xcf99('0x28'),_0x4150ab?_0x4150ab[_0xcf99('0x1b')](','):null);},'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x28'))?this[_0xcf99('0x1c')](_0xcf99('0x28'))[_0xcf99('0x1d')](','):null;},'comment':_0xcf99('0x29')},'callgroup':{'type':Sequelize[_0xcf99('0x1')]},'namedcallgroup':{'type':Sequelize[_0xcf99('0x1')]},'pickupgroup':{'type':Sequelize[_0xcf99('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xcf99('0x1')]},'language':{'type':Sequelize[_0xcf99('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcf99('0x1')]},'disallow':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'defaultValue':_0xcf99('0x2a')},'allow':{'type':Sequelize[_0xcf99('0x1')],'allowNull':![],'defaultValue':_0xcf99('0x2b'),'set':function(_0x1b3769){this[_0xcf99('0x3')](_0xcf99('0x2c'),_0x1b3769?_0x1b3769[_0xcf99('0x1b')](';'):_0xcf99('0x2b'));},'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x2c'))?this[_0xcf99('0x1c')](_0xcf99('0x2c'))[_0xcf99('0x1d')](';'):null;},'comment':_0xcf99('0x2d')},'autoframing':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![],'set':function(_0xed093f){this[_0xcf99('0x3')](_0xcf99('0x2e'),_0xed093f?_0xed093f['join'](','):null);},'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x2e'))?this[_0xcf99('0x1c')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xcf99('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no',_0xcf99('0x2f')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf99('0x30')},'amaflags':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':_0xcf99('0x26')},'busylevel':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcf99('0xb')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xcf99('0xb')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'template':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no',_0xcf99('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xcf99('0x32'),'refuse',_0xcf99('0x33')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x34'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':_0xcf99('0x26')},'keepalive':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no','fingerprint',_0xcf99('0x35')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x36'),_0xcf99('0x37'),_0xcf99('0x38')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xcf99('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xcf99('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xcf99('0xb')](_0xcf99('0x26'),'no','nonat',_0xcf99('0x24'),_0xcf99('0x39')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xcf99('0x12')]},'passwordResetAt':{'type':Sequelize[_0xcf99('0x12')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcf99('0x3a')]},'showWebBar':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0,'set':function(_0x457ff9){this['setDataValue'](_0xcf99('0x3b'),_0x457ff9);var _0x17d587=this['get']({'plain':!![]});switch(_0x457ff9){case 0x0:case 0x1:var _0x1b9943=_0x17d587['transport']?_['isArray'](_0x17d587['transport'])?_0x17d587[_0xcf99('0x1a')][_0xcf99('0x1b')]():_0x17d587[_0xcf99('0x1a')]:_0xcf99('0x19');if(_0x1b9943===_0xcf99('0x3c')){_0x1b9943=_0xcf99('0x19');}this[_0xcf99('0x3')]('transport',_0x1b9943);this[_0xcf99('0x3')](_0xcf99('0x3d'),'no');this[_0xcf99('0x3')]('avpf',null);this[_0xcf99('0x3')]('force_avp',null);this[_0xcf99('0x3')](_0xcf99('0x3e'),null);this[_0xcf99('0x3')](_0xcf99('0x3f'),null);this['setDataValue']('dtlsverify',null);this[_0xcf99('0x3')](_0xcf99('0x40'),null);this['setDataValue'](_0xcf99('0x41'),null);this[_0xcf99('0x3')](_0xcf99('0x42'),null);this['setDataValue'](_0xcf99('0x43'),'no');break;case 0x2:this[_0xcf99('0x3')](_0xcf99('0x1a'),_0xcf99('0x3c'));this[_0xcf99('0x3')](_0xcf99('0x3d'),_0xcf99('0x26'));this[_0xcf99('0x3')](_0xcf99('0x44'),'yes');this['setDataValue'](_0xcf99('0x45'),_0xcf99('0x26'));this['setDataValue'](_0xcf99('0x3e'),_0xcf99('0x26'));this['setDataValue']('dtlsenable',_0xcf99('0x26'));this['setDataValue'](_0xcf99('0x46'),'no');this[_0xcf99('0x3')]('dtlssetup',_0xcf99('0x38'));this[_0xcf99('0x3')](_0xcf99('0x41'),_0x17d587[_0xcf99('0x41')]||'/etc/pki/tls/certs/motion.crt');this[_0xcf99('0x3')](_0xcf99('0x42'),_0x17d587['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xcf99('0x3')](_0xcf99('0x43'),_0xcf99('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xcf99('0x3a')],'set':function(_0x5e7616){this[_0xcf99('0x3')](_0xcf99('0x47'),_0x5e7616?_0x5e7616[_0xcf99('0x1b')](','):[]);},'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x47'))?_[_0xcf99('0x48')](this['getDataValue']('permissions')['split'](','),function(_0x4ed623){return parseInt(_0x4ed623,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcf99('0x1')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xcf99('0x1')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xcf99('0x1')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcf99('0x1')]},'phoneBarEnableJaws':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xcf99('0x49')],'get':function(){return this[_0xcf99('0x1c')](_0xcf99('0x4a'))?this[_0xcf99('0x1c')](_0xcf99('0x4a')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xcf99('0x1')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcf99('0x1')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![],'set':function(_0x5685ef){if(typeof _0x5685ef===_0xcf99('0x4b')){var _0x296049=_0x5685ef==='1'?!![]:_0x5685ef==='0'?![]:_0x5685ef===_0xcf99('0x4c')?!![]:_0x5685ef===_0xcf99('0x4d')?![]:![];this[_0xcf99('0x3')](_0xcf99('0x4e'),_0x296049);}else{this[_0xcf99('0x3')](_0xcf99('0x4e'),_0x5685ef);}}},'blocked':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![],'set':function(_0x3b42a9){this[_0xcf99('0x3')]('blocked',_0x3b42a9);if(_0x3b42a9===!![]){this[_0xcf99('0x3')](_0xcf99('0x4f'),moment());this[_0xcf99('0x3')]('loginAttempts',0x0);}else{this[_0xcf99('0x3')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcf99('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xcf99('0x50')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xcf99('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9cb8a9f..8e1d790 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9582=['unpause','PAUSE','manual','Pause','getTeams','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','addAgent','upsert','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getVoiceQueues','Voice','removeAgent','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','omit','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$gt','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','teams','queues','flatten','lower','col','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','voiceStatus','busy','charAt','toUpperCase','slice','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','register','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','role','admin','Users','user','agent','telephone','filter','map','value','includes','find','UserProfileResource','stack','name','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','query','includeAll','include','attributes','push','rows','true','length','chat','dataValues','sms','mail','openchannel','whatsapp','all','catch','show','params','model','differenceBy','keys','filters','intersection','fields','options','fax','body','describe','addContacts','ids','internal','Setting','securePassword','validatePasswordPattern','max','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','isNil','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','103','113','110','104','106','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','Agents','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','VoiceQueue','findAll','voice','interface','format','SIP/%s','voicePause','UserVoiceQueueRt','removeQueues','channel','remove','isArray','Queue:remove','addAvatar','root','server/files/images/logos/default_profile.png','userpic','download','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','findOne','order','sort','pick','where','merge','CmList','List','Tags','tag','nolimit','Queue','Unknown\x20role','hasOwnProperty','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','bulkCreate','concat','LOGININPAUSE','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x9582,0x95));var _0x2958=function(_0x5e1436,_0x5e8a69){_0x5e1436=_0x5e1436-0x0;var _0xb49a0b=_0x9582[_0x5e1436];return _0xb49a0b;};'use strict';var moment=require(_0x2958('0x0'));var BPromise=require(_0x2958('0x1'));var util=require(_0x2958('0x2'));var path=require(_0x2958('0x3'));var fs=require('fs');var _=require(_0x2958('0x4'));var squel=require(_0x2958('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x2958('0x6'));var authService=require(_0x2958('0x7'));var qs=require(_0x2958('0x8'));var logger=require(_0x2958('0x9'))(_0x2958('0xa'));var utils=require(_0x2958('0xb'));var config=require(_0x2958('0xc'));var licenseUtil=require(_0x2958('0xd'));var db=require(_0x2958('0xe'))['db'];var socket=require(_0x2958('0xf'))(new Redis(config['redis']));require('./user.socket')[_0x2958('0x10')](socket);config['redis']=_[_0x2958('0x11')](config['redis'],{'host':_0x2958('0x12'),'port':0x18eb});var client=jayson['client'][_0x2958('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x29776c,_0x12f0b0,_0x117ff0,_0x11ec8d){return new BPromise(function(_0x4f980c,_0x4780a8){var _0x4255ee=_0x11ec8d||client;return _0x4255ee[_0x2958('0x14')](_0x29776c,_0x117ff0)[_0x2958('0x15')](function(_0x47067d){logger[_0x2958('0x16')](_0x2958('0x17'),_0x12f0b0,_0x2958('0x18'));logger['debug'](_0x2958('0x19'),_0x12f0b0,_0x2958('0x18'),JSON['stringify'](_0x47067d));if(_0x47067d['error']){if(_0x47067d[_0x2958('0x1a')][_0x2958('0x1b')]===0x1f4){logger['error'](_0x2958('0x17'),_0x12f0b0,_0x47067d['error']['message']);return _0x4780a8(_0x47067d[_0x2958('0x1a')][_0x2958('0x1c')]);}logger['error']('User,\x20%s,\x20%s',_0x12f0b0,_0x47067d[_0x2958('0x1a')][_0x2958('0x1c')]);return _0x4f980c(_0x47067d[_0x2958('0x1a')][_0x2958('0x1c')]);}else{logger[_0x2958('0x16')]('User,\x20%s,\x20%s',_0x12f0b0,_0x2958('0x18'));_0x4f980c(_0x47067d[_0x2958('0x1d')][_0x2958('0x1c')]);}})['catch'](function(_0x1e77eb){logger['error'](_0x2958('0x17'),_0x12f0b0,_0x1e77eb);_0x4780a8(_0x1e77eb);});});}function respondWithStatusCode(_0x52ea2f,_0x5eaf36){_0x5eaf36=_0x5eaf36||0xcc;return function(_0x431b41){if(_0x431b41){return _0x52ea2f[_0x2958('0x1e')](_0x5eaf36);}return _0x52ea2f[_0x2958('0x1f')](_0x5eaf36)[_0x2958('0x20')]();};}function respondWithResult(_0x2202f8,_0x412e42){_0x412e42=_0x412e42||0xc8;return function(_0x3f8641){if(_0x3f8641){return _0x2202f8[_0x2958('0x1f')](_0x412e42)[_0x2958('0x21')](_0x3f8641);}};}function respondWithFilteredResult(_0x2aa514,_0xaf5547){return function(_0xd58ae1){if(_0xd58ae1){var _0x119242=typeof _0xaf5547[_0x2958('0x22')]===_0x2958('0x23')&&typeof _0xaf5547['limit']==='undefined';var _0x3c1155=_0xd58ae1[_0x2958('0x24')];var _0x28c1f5=_0x119242?0x0:_0xaf5547[_0x2958('0x22')];var _0x52bd32=_0x119242?_0xd58ae1[_0x2958('0x24')]:_0xaf5547['offset']+_0xaf5547[_0x2958('0x25')];var _0x40adce;if(_0x52bd32>=_0x3c1155){_0x52bd32=_0x3c1155;_0x40adce=0xc8;}else{_0x40adce=0xce;}_0x2aa514[_0x2958('0x1f')](_0x40adce);return _0x2aa514[_0x2958('0x26')](_0x2958('0x27'),_0x28c1f5+'-'+_0x52bd32+'/'+_0x3c1155)[_0x2958('0x21')](_0xd58ae1);}return null;};}function saveUpdates(_0x153958){return function(_0x5d1dfc){if(_0x5d1dfc){return _0x5d1dfc[_0x2958('0x28')](_0x153958)['then'](function(_0x48650d){return _0x48650d;});}return null;};}function removeEntity(_0x28ee09){return function(_0x15bab3){if(_0x15bab3){return _0x15bab3[_0x2958('0x29')]()[_0x2958('0x15')](function(){var _0x584179=_0x15bab3[_0x2958('0x2a')]({'plain':!![]});if(_0x584179[_0x2958('0x2b')]===_0x2958('0x2c'))return;var _0x4d6348=[{'name':_0x2958('0x2d'),'value':_0x2958('0x2e'),'ignore':!![]},{'name':'Agents','value':_0x2958('0x2f'),'ignore':![]},{'name':'Telephones','value':_0x2958('0x30'),'ignore':![]}];var _0x56d9fd=_(_0x4d6348)[_0x2958('0x31')]('ignore')[_0x2958('0x32')](_0x2958('0x33'))[_0x2958('0x33')]();if(_[_0x2958('0x34')](_0x56d9fd,_0x584179[_0x2958('0x2b')])){return;}var _0x3a124a=_[_0x2958('0x35')](_0x4d6348,[_0x2958('0x33'),_0x584179[_0x2958('0x2b')]])['name'];return db[_0x2958('0x36')]['destroy']({'where':{'type':_0x3a124a,'resourceId':_0x584179['id']}})[_0x2958('0x15')](function(){return _0x15bab3;});})['then'](function(){_0x28ee09[_0x2958('0x1f')](0xcc)[_0x2958('0x20')]();});}};}function handleEntityNotFound(_0x35df90){return function(_0x36088c){if(!_0x36088c){_0x35df90[_0x2958('0x1e')](0x194);}return _0x36088c;};}function handleError(_0x24aca5,_0x3e6873){_0x3e6873=_0x3e6873||0x1f4;return function(_0x468b8e){logger[_0x2958('0x1a')](_0x468b8e[_0x2958('0x37')]);if(_0x468b8e[_0x2958('0x38')]){delete _0x468b8e[_0x2958('0x38')];}_0x24aca5[_0x2958('0x1f')](_0x3e6873)['send'](_0x468b8e);};}exports[_0x2958('0x39')]=function(_0xcdaa70,_0x281817){var _0x27edd6={},_0x4e0db4={'count':0x0,'rows':[]};var _0x2f9a28=_(db[_0x2958('0x3a')][_0x2958('0x3b')])[_0x2958('0x32')](function(_0x337bcc){return{'name':_0x337bcc[_0x2958('0x3c')],'type':_0x337bcc[_0x2958('0x3d')][_0x2958('0x3e')]};})[_0x2958('0x31')](function(_0x3ef099){return!_[_0x2958('0x34')]([_0x2958('0x3f'),_0x2958('0x40')],_0x3ef099['name']);})[_0x2958('0x33')]();_0x27edd6=qs[_0x2958('0x41')](_0x2f9a28,_0xcdaa70);var _0x5bdd8e={'where':_0x27edd6['where']};return db[_0x2958('0x3a')][_0x2958('0x24')](_0x5bdd8e)[_0x2958('0x15')](function(_0x27068b){_0x4e0db4[_0x2958('0x24')]=_0x27068b;if(_0xcdaa70[_0x2958('0x42')][_0x2958('0x43')]){_0x27edd6[_0x2958('0x44')]=[{'all':!![]}];}if(!_[_0x2958('0x34')](_0x27edd6[_0x2958('0x45')],'id')){_0x27edd6[_0x2958('0x45')][_0x2958('0x46')]('id');}return db[_0x2958('0x3a')]['findAll'](_0x27edd6);})[_0x2958('0x15')](function(_0x112256){_0x4e0db4[_0x2958('0x47')]=_0x112256;if(_0xcdaa70[_0x2958('0x42')]['openTabs']===_0x2958('0x48')){var _0x4af190=[];for(var _0x53ac56=0x0;_0x53ac56<_0x4e0db4[_0x2958('0x47')][_0x2958('0x49')];_0x53ac56++){_0x4af190[_0x2958('0x46')](get_open_tabs(_0x2958('0x4a'),_0x4e0db4[_0x2958('0x47')][_0x53ac56][_0x2958('0x4b')]));_0x4af190['push'](get_open_tabs(_0x2958('0x4c'),_0x4e0db4['rows'][_0x53ac56]['dataValues']));_0x4af190[_0x2958('0x46')](get_open_tabs('fax',_0x4e0db4[_0x2958('0x47')][_0x53ac56][_0x2958('0x4b')]));_0x4af190[_0x2958('0x46')](get_open_tabs(_0x2958('0x4d'),_0x4e0db4[_0x2958('0x47')][_0x53ac56][_0x2958('0x4b')]));_0x4af190[_0x2958('0x46')](get_open_tabs(_0x2958('0x4e'),_0x4e0db4['rows'][_0x53ac56][_0x2958('0x4b')]));_0x4af190[_0x2958('0x46')](get_open_tabs(_0x2958('0x4f'),_0x4e0db4[_0x2958('0x47')][_0x53ac56]['dataValues']));}return BPromise[_0x2958('0x50')](_0x4af190)[_0x2958('0x15')](function(_0x4a51b1){return _0x4e0db4;});}else{return _0x4e0db4;}})[_0x2958('0x15')](respondWithFilteredResult(_0x281817,_0x27edd6))[_0x2958('0x51')](handleError(_0x281817,null));};exports[_0x2958('0x52')]=function(_0x3c5431,_0x171a21){var _0x16a0a8={'raw':![],'where':{'id':_0x3c5431[_0x2958('0x53')]['id']}},_0x519fab={};_0x519fab[_0x2958('0x54')]=_[_0x2958('0x55')](_[_0x2958('0x56')](db[_0x2958('0x3a')][_0x2958('0x3b')]),[_0x2958('0x3f'),_0x2958('0x40')]);_0x519fab[_0x2958('0x42')]=_[_0x2958('0x56')](_0x3c5431[_0x2958('0x42')]);_0x519fab[_0x2958('0x57')]=_[_0x2958('0x58')](_0x519fab[_0x2958('0x54')],_0x519fab[_0x2958('0x42')]);_0x16a0a8[_0x2958('0x45')]=_[_0x2958('0x58')](_0x519fab['model'],qs[_0x2958('0x59')](_0x3c5431['query'][_0x2958('0x59')]));_0x16a0a8[_0x2958('0x45')]=_0x16a0a8[_0x2958('0x45')]['length']?_0x16a0a8['attributes']:_0x519fab[_0x2958('0x54')];if(_0x3c5431[_0x2958('0x42')][_0x2958('0x43')]){_0x16a0a8['include']=[{'all':!![]}];}_0x16a0a8=_['merge']({},_0x16a0a8,_0x3c5431[_0x2958('0x5a')]);if(!_[_0x2958('0x34')](_0x16a0a8[_0x2958('0x45')],'id')){_0x16a0a8[_0x2958('0x45')][_0x2958('0x46')]('id');}return db[_0x2958('0x3a')][_0x2958('0x35')](_0x16a0a8)[_0x2958('0x15')](handleEntityNotFound(_0x171a21,null))[_0x2958('0x15')](function(_0x4df36c){var _0x30c739=[];values=_0x4df36c;if(_0x3c5431[_0x2958('0x42')]['openTabs']===_0x2958('0x48')){_0x30c739[_0x2958('0x46')](get_open_tabs(_0x2958('0x4a'),_0x4df36c[_0x2958('0x4b')]));_0x30c739[_0x2958('0x46')](get_open_tabs(_0x2958('0x4c'),_0x4df36c['dataValues']));_0x30c739[_0x2958('0x46')](get_open_tabs(_0x2958('0x4e'),_0x4df36c[_0x2958('0x4b')]));_0x30c739['push'](get_open_tabs('whatsapp',_0x4df36c[_0x2958('0x4b')]));_0x30c739['push'](get_open_tabs(_0x2958('0x5b'),_0x4df36c['dataValues']));_0x30c739[_0x2958('0x46')](get_open_tabs(_0x2958('0x4d'),_0x4df36c[_0x2958('0x4b')]));return BPromise[_0x2958('0x50')](_0x30c739);}else{return values;}})[_0x2958('0x15')](function(_0x55cc49){return values;})['then'](respondWithResult(_0x171a21,null))[_0x2958('0x51')](handleError(_0x171a21,null));};exports[_0x2958('0x28')]=function(_0xfa171d,_0x51bf4c){if(_0xfa171d['body']['id']){delete _0xfa171d[_0x2958('0x5c')]['id'];}delete _0xfa171d[_0x2958('0x5c')][_0x2958('0x2b')];return db[_0x2958('0x3a')][_0x2958('0x35')]({'where':{'id':_0xfa171d[_0x2958('0x53')]['id']}})[_0x2958('0x15')](handleEntityNotFound(_0x51bf4c,null))[_0x2958('0x15')](saveUpdates(_0xfa171d[_0x2958('0x5c')],null))[_0x2958('0x15')](respondWithResult(_0x51bf4c,null))[_0x2958('0x51')](handleError(_0x51bf4c,null));};exports[_0x2958('0x5d')]=function(_0x3cc345,_0x49d190){return db[_0x2958('0x3a')][_0x2958('0x5d')]()[_0x2958('0x15')](respondWithResult(_0x49d190,null))[_0x2958('0x51')](handleError(_0x49d190,null));};exports[_0x2958('0x5e')]=function(_0xa848ba,_0x143b2a){return db[_0x2958('0x3a')][_0x2958('0x35')]({'where':{'id':_0xa848ba['params']['id']}})[_0x2958('0x15')](handleEntityNotFound(_0x143b2a,null))['then'](function(_0x196901){if(_0x196901){return _0x196901[_0x2958('0x5e')](_0xa848ba[_0x2958('0x5c')]['ids'],_['omit'](_0xa848ba['body'],[_0x2958('0x5f'),'id'])||{});}})[_0x2958('0x15')](respondWithResult(_0x143b2a,null))[_0x2958('0x51')](handleError(_0x143b2a,null));};function validateUser(_0x1bba2c){return new BPromise(function(_0x1b778e,_0xb2fe28){if(_0x1bba2c[_0x2958('0x60')])return _0x1b778e(_0x1bba2c);return db[_0x2958('0x61')]['findById'](0x1)['then'](function(_0x42717b){if(_0x42717b[_0x2958('0x62')])authService[_0x2958('0x63')](_0x1bba2c[_0x2958('0x3f')]);db['User'][_0x2958('0x64')](_0x2958('0x60'))[_0x2958('0x15')](function(_0x20ca93){if(_['isNil'](_0x20ca93)){_0x1bba2c['internal']=_0x42717b['min_internal']||0x1;return;}if(_['isNil'](_0x42717b[_0x2958('0x65')])||_0x42717b[_0x2958('0x65')]===_0x20ca93){_0x1bba2c['internal']=_0x20ca93+0x1;return;}if(_0x42717b[_0x2958('0x65')]>_0x20ca93){_0x1bba2c[_0x2958('0x60')]=_0x42717b[_0x2958('0x65')];return;}return db[_0x2958('0x66')][_0x2958('0x42')](_0x2958('0x67'),{'type':db['sequelize'][_0x2958('0x68')][_0x2958('0x69')]})[_0x2958('0x15')](function(_0x48160b){if(_0x48160b&&_0x48160b[_0x2958('0x49')]){for(var _0x566123=0x0,_0x546721=_0x48160b['length'];_0x566123<_0x546721&&_['isNil'](_0x1bba2c[_0x2958('0x60')]);_0x566123++){if(_0x42717b['min_internal']<=_0x48160b[_0x566123][_0x2958('0x6a')]){_0x1bba2c[_0x2958('0x60')]=_0x48160b[_0x566123][_0x2958('0x6a')];}else if(_0x42717b[_0x2958('0x65')]>_0x48160b[_0x566123][_0x2958('0x6a')]&&_0x42717b[_0x2958('0x65')]<=_0x48160b[_0x566123]['to']){_0x1bba2c['internal']=_0x42717b[_0x2958('0x65')];}}}if(_[_0x2958('0x6b')](_0x1bba2c[_0x2958('0x60')])){_0x1bba2c[_0x2958('0x60')]=_0x20ca93+0x1;}return _0x1b778e(_0x1bba2c);});});})[_0x2958('0x51')](function(_0x294acf){_0xb2fe28(_0x294acf);});});}function updateUser(_0x39c38d){return new BPromise(function(_0x3674b3,_0x2d8418){try{if(_0x39c38d[_0x2958('0x6c')]){_0x39c38d[_0x2958('0x6d')]=_0x39c38d[_0x2958('0x60')];_0x39c38d[_0x2958('0x6e')]={'mailbox':_0x39c38d[_0x2958('0x60')],'password':_0x39c38d[_0x2958('0x3f')],'fullname':_0x39c38d[_0x2958('0x6f')],'email':_0x39c38d[_0x2958('0x70')]};}if(_0x39c38d[_0x2958('0x2b')]===_0x2958('0x2f')){if(!_0x39c38d[_0x2958('0x71')])_0x39c38d[_0x2958('0x71')]=['101',_0x2958('0x72'),_0x2958('0x73'),_0x2958('0x74'),_0x2958('0x75'),_0x2958('0x76'),'105',_0x2958('0x77'),_0x2958('0x78'),_0x2958('0x79'),_0x2958('0x7a'),_0x2958('0x7b'),_0x2958('0x7c'),_0x2958('0x7d'),_0x2958('0x7e')];}_0x3674b3(_0x39c38d);}catch(_0x16c8f2){_0x2d8418(_0x16c8f2);}});}exports[_0x2958('0x7f')]=function(_0x37efd7,_0x461344){if(_0x37efd7[_0x2958('0x2e')][_0x2958('0x2b')]===_0x2958('0x2f'))throw new Error(_0x2958('0x80'));if(_0x37efd7[_0x2958('0x5c')][_0x2958('0x2b')]===_0x2958('0x2e')&&_0x37efd7[_0x2958('0x2e')][_0x2958('0x2b')]!==_0x2958('0x2c')){throw new Error(_0x2958('0x81'));}if(_0x37efd7[_0x2958('0x5c')]['role']===_0x2958('0x2c')&&_0x37efd7[_0x2958('0x2e')][_0x2958('0x2b')]!==_0x2958('0x2c')){throw new Error(_0x2958('0x82'));}return licenseUtil[_0x2958('0x83')]([_0x37efd7[_0x2958('0x5c')]])[_0x2958('0x15')](function(){return validateUser(_0x37efd7[_0x2958('0x5c')]);})[_0x2958('0x15')](function(_0x19bd4f){return updateUser(_0x19bd4f)[_0x2958('0x15')](function(_0x4e4ce9){if(_0x4e4ce9[_0x2958('0x2b')]===_0x2958('0x2c')){_0x4e4ce9[_0x2958('0x84')]=_0x37efd7[_0x2958('0x2e')][_0x2958('0x84')];delete _0x4e4ce9[_0x2958('0x85')];}return _0x4e4ce9;});})['then'](function(_0x431bd4){return db[_0x2958('0x3a')][_0x2958('0x7f')](_0x431bd4,{'include':[{'model':db[_0x2958('0x6e')],'as':_0x2958('0x6e')}]});})['then'](function(_0x158c43){if(_0x37efd7[_0x2958('0x5c')][_0x2958('0x2b')]===_0x2958('0x2e'))return _0x158c43;if(_0x37efd7[_0x2958('0x2e')][_0x2958('0x2b')]!==_0x2958('0x2e'))return _0x158c43;return db[_0x2958('0x86')][_0x2958('0x35')]({'where':{'name':_0x158c43[_0x2958('0x2b')]===_0x2958('0x2f')?'Agents':_0x2958('0x87'),'userProfileId':_0x37efd7[_0x2958('0x2e')]['userProfileId']},'raw':!![]})['then'](function(_0x37586c){if(!_0x37586c||_0x37586c[_0x2958('0x88')]!=0x0)return _0x158c43;return db['UserProfileResource'][_0x2958('0x7f')]({'name':_0x158c43[_0x2958('0x38')],'resourceId':_0x158c43['id'],'type':_0x37586c[_0x2958('0x38')],'sectionId':_0x37586c['id']},{})['then'](function(){return _0x158c43;});})[_0x2958('0x51')](function(_0x383505){logger[_0x2958('0x1a')](_0x2958('0x89'),_0x383505);throw _0x383505;});})[_0x2958('0x15')](respondWithResult(_0x461344,0xc9))[_0x2958('0x51')](handleError(_0x461344,null));};exports['bulkCreate']=function(_0x449e68,_0x675842){var _0x65e58b=_0x449e68[_0x2958('0x5c')];var _0x5bb046=[];if(_0x449e68['user']['role']===_0x2958('0x2f'))throw new Error('Unauthorized');if(_[_0x2958('0x8a')](_0x65e58b,['role','user'])&&_0x449e68[_0x2958('0x2e')][_0x2958('0x2b')]!=='admin'){throw new Error(_0x2958('0x81'));}if(_[_0x2958('0x8a')](_0x65e58b,[_0x2958('0x2b'),_0x2958('0x2c')])&&_0x449e68[_0x2958('0x2e')]['role']!==_0x2958('0x2c')){throw new Error(_0x2958('0x8b'));}return licenseUtil[_0x2958('0x83')](_0x65e58b)[_0x2958('0x15')](function(){return validateUser(_0x65e58b[0x0]);})[_0x2958('0x15')](function(){for(var _0x17b2bf=0x1;_0x17b2bf<_0x65e58b[_0x2958('0x49')];_0x17b2bf++){var _0x1142e3=_0x65e58b[_0x17b2bf-0x1][_0x2958('0x60')];if(!_0x65e58b[_0x17b2bf]['internal'])_0x65e58b[_0x17b2bf][_0x2958('0x60')]=_0x1142e3+0x1;_0x5bb046[_0x2958('0x46')](validateUser(_0x65e58b[_0x17b2bf]));}return BPromise[_0x2958('0x50')](_0x5bb046);})['then'](function(){_0x5bb046=[];for(var _0x24d1bc=0x0;_0x24d1bc<_0x65e58b[_0x2958('0x49')];_0x24d1bc++){_0x5bb046[_0x2958('0x46')](updateUser(_0x65e58b[_0x24d1bc]));}return BPromise[_0x2958('0x50')](_0x5bb046);})[_0x2958('0x15')](function(){return BPromise[_0x2958('0x8c')](_0x65e58b,function(_0xb41929){return db[_0x2958('0x3a')][_0x2958('0x7f')](_0xb41929,{'include':[{'model':db[_0x2958('0x6e')],'as':'VoiceMail'}]})[_0x2958('0x15')](function(_0x5d9ad0){_0xb41929['id']=_0x5d9ad0['id'];return _0xb41929;});});})['then'](function(_0x2f279a){if(_0x449e68[_0x2958('0x5c')]['role']==='user')return _0x2f279a;if(_0x449e68['user'][_0x2958('0x2b')]!==_0x2958('0x2e'))return _0x2f279a;var _0x486650=_[_0x2958('0x8a')](_0x2f279a,function(_0x3f31a3){return _0x3f31a3[_0x2958('0x2b')]===_0x2958('0x2f')||_0x3f31a3[_0x2958('0x2b')]===_0x2958('0x30');});if(!_0x486650)return _0x2f279a;return db[_0x2958('0x86')]['findAll']({'where':{'name':{'$or':[_0x2958('0x8d'),_0x2958('0x87')]},'userProfileId':_0x449e68[_0x2958('0x2e')][_0x2958('0x85')]},'raw':!![]})[_0x2958('0x15')](function(_0x1e7057){if(_[_0x2958('0x8e')](_0x1e7057)||!_[_0x2958('0x8a')](_0x1e7057,[_0x2958('0x88'),0x0]))return _0x2f279a;_0x5bb046=[];var _0x2c4239=_(_0x1e7057)['map'](function(_0x5a4bc5){if(_0x5a4bc5[_0x2958('0x88')]===0x1)return;return _0x5a4bc5['name']===_0x2958('0x8d')?_0x2958('0x2f'):_0x2958('0x30');})[_0x2958('0x8f')]()[_0x2958('0x33')]();for(var _0x2c8502=0x0;_0x2c8502<_0x2f279a[_0x2958('0x49')];_0x2c8502++){if(!_['includes'](_0x2c4239,_0x2f279a[_0x2c8502][_0x2958('0x2b')]))return;var _0x11479d=_0x2f279a[_0x2c8502][_0x2958('0x2b')]===_0x2958('0x2f')?_0x2958('0x8d'):'Telephones';_0x5bb046[_0x2958('0x46')](db[_0x2958('0x36')][_0x2958('0x7f')]({'name':_0x2f279a[_0x2c8502]['name'],'resourceId':_0x2f279a[_0x2c8502]['id'],'type':_0x11479d,'sectionId':_[_0x2958('0x35')](_0x1e7057,[_0x2958('0x38'),_0x11479d])['id']},{}));}return BPromise[_0x2958('0x50')](_0x5bb046);});})[_0x2958('0x15')](respondWithResult(_0x675842,0xc9))[_0x2958('0x51')](handleError(_0x675842,null));};exports[_0x2958('0x90')]=function(_0x511dd9,_0x5f4622){if(_0x511dd9[_0x2958('0x5c')]['id']){delete _0x511dd9[_0x2958('0x5c')]['id'];}return db[_0x2958('0x3a')]['find']({'where':{'id':_0x511dd9[_0x2958('0x53')]['id']}})['then'](function(_0x346a12){if(!_0x346a12)return null;if(_0x346a12['id']===_0x511dd9[_0x2958('0x2e')]['id']){if(!_0x511dd9[_0x2958('0x5c')]['oldPassword']||!_0x511dd9[_0x2958('0x5c')][_0x2958('0x91')]){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x346a12['authenticate'](_0x511dd9[_0x2958('0x5c')][_0x2958('0x94')])){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))](_0x2958('0x95'));}if(_0x511dd9['body'][_0x2958('0x94')]===_0x511dd9[_0x2958('0x5c')][_0x2958('0x91')]){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))](_0x2958('0x96'));}}else if(_0x511dd9[_0x2958('0x2e')][_0x2958('0x2b')]==='admin'){if(!_0x511dd9['body']['newPassword']){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))](_0x2958('0x97'));}}else if(_0x511dd9['user'][_0x2958('0x2b')]===_0x2958('0x2e')){if(!_0x511dd9[_0x2958('0x5c')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x2958('0x97'));}if(_0x346a12[_0x2958('0x2b')]!==_0x2958('0x2f')){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))](_0x2958('0x80'));}}else{throw new db['Sequelize'][(_0x2958('0x93'))](_0x2958('0x80'));}return _0x346a12;})[_0x2958('0x15')](handleEntityNotFound(_0x5f4622,null))[_0x2958('0x15')](function(_0x397a06){return db[_0x2958('0x61')]['findOne']({'attributes':['id','securePassword',_0x2958('0x98'),_0x2958('0x99')]})[_0x2958('0x15')](function(_0x147682){if(_0x147682[_0x2958('0x62')])authService[_0x2958('0x63')](_0x511dd9[_0x2958('0x5c')][_0x2958('0x91')]);if(!_0x147682['enforcePasswordHistory']||!_0x397a06[_0x2958('0x9a')])return _0x397a06;authService[_0x2958('0x9b')](_0x511dd9[_0x2958('0x5c')][_0x2958('0x91')],_0x397a06[_0x2958('0x9a')],_0x147682[_0x2958('0x99')]);return _0x397a06;})[_0x2958('0x15')](saveUpdates({'password':_0x511dd9[_0x2958('0x5c')]['newPassword'],'passwordResetAt':_0x511dd9[_0x2958('0x2e')]['id']==_0x511dd9[_0x2958('0x53')]['id']?moment():null,'previousPasswords':authService[_0x2958('0x9c')](_0x511dd9[_0x2958('0x5c')][_0x2958('0x91')],_0x397a06[_0x2958('0x9a')])},null));})[_0x2958('0x15')](respondWithResult(_0x5f4622,null))['catch'](handleError(_0x5f4622,null));};exports[_0x2958('0x9d')]=function(_0x1d0d0d,_0xc3b770){var _0x10ed18=_0x1d0d0d[_0x2958('0x5c')]['channel'];return db['User']['find']({'where':{'id':_0x1d0d0d[_0x2958('0x53')]['id']},'attributes':['id','name',_0x2958('0x2b'),_0x2958('0x9e'),_0x2958('0x9f'),'voicePause','interface']})[_0x2958('0x15')](handleEntityNotFound(_0xc3b770,null))[_0x2958('0x15')](function(_0x3fbe11){if(_0x3fbe11){if(!utils[_0x2958('0xa0')](_0x10ed18)){throw new db[(_0x2958('0x92'))][(_0x2958('0x93'))](_0x2958('0xa1'));}return _0x3fbe11[_0x2958('0xa2')+_[_0x2958('0xa3')](_0x10ed18[_0x2958('0xa4')]())+_0x2958('0xa5')](_0x1d0d0d[_0x2958('0x5c')][_0x2958('0x5f')],{'penalty':_0x1d0d0d[_0x2958('0x5c')][_0x2958('0xa6')]||0x0})[_0x2958('0xa7')](function(_0x18fecd){for(var _0x2c5c06=0x0;_0x2c5c06<_0x1d0d0d[_0x2958('0x5c')][_0x2958('0x5f')][_0x2958('0x49')];_0x2c5c06+=0x1){var _0x362837={'UserId':Number(_0x1d0d0d['params']['id'])};_0x362837[_[_0x2958('0xa3')](_0x10ed18[_0x2958('0xa4')]())+_0x2958('0xa8')]=Number(_0x1d0d0d[_0x2958('0x5c')]['ids'][_0x2c5c06]);socket[_0x2958('0xa9')](_0x2958('0x2e')+_['capitalize'](_0x10ed18['toLowerCase']())+'Queue:save',_0x362837);}return _0x18fecd;})[_0x2958('0x15')](function(){if(_0x10ed18==='voice'){return db[_0x2958('0xaa')][_0x2958('0xab')]({'where':{'id':_0x1d0d0d[_0x2958('0x5c')]['ids']||[]},'raw':!![],'attributes':['id',_0x2958('0x38')]});}})[_0x2958('0x15')](function(_0x21dba6){var _0x3b38b2=_0x3fbe11[_0x2958('0x2a')]({'plain':!![]});var _0x34ba48=[];if(_0x10ed18===_0x2958('0xac')&&_0x3b38b2[_0x2958('0x2b')]==='agent'&&_0x3b38b2['online']){for(var _0x1c5d40=0x0;_0x1c5d40<_0x21dba6[_0x2958('0x49')];_0x1c5d40+=0x1){_0x34ba48[_0x2958('0x46')]({'membername':_0x3b38b2[_0x2958('0x38')],'UserId':_0x3b38b2['id'],'queue_name':_0x21dba6[_0x1c5d40][_0x2958('0x38')],'VoiceQueueId':_0x21dba6[_0x1c5d40]['id'],'interface':_[_0x2958('0x6b')](_0x3b38b2[_0x2958('0xad')])?util[_0x2958('0xae')](_0x2958('0xaf'),_0x3b38b2['name']):_0x3b38b2[_0x2958('0xad')],'paused':_0x3b38b2[_0x2958('0xb0')]||![],'penalty':_0x1d0d0d['body']['penalty']||0x0});}return BPromise[_0x2958('0x8c')](_0x34ba48,function(_0x33c111){return db[_0x2958('0xb1')]['upsert'](_0x33c111);});}return _0x3fbe11;});}})[_0x2958('0x15')](respondWithStatusCode(_0xc3b770,null))[_0x2958('0x51')](handleError(_0xc3b770,null));};exports[_0x2958('0xb2')]=function(_0xd403bd,_0x97949){var _0x402518;return db['User'][_0x2958('0x35')]({'where':{'id':_0xd403bd[_0x2958('0x53')]['id']},'attributes':['id','name','role']})[_0x2958('0x15')](handleEntityNotFound(_0x97949,null))['then'](function(_0x28c11c){if(_0x28c11c){_0x402518=_0x28c11c;if(!_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')]||!utils[_0x2958('0xa0')](_0xd403bd['query']['channel'])){throw new db[(_0x2958('0x92'))]['ValidationError'](_0x2958('0xa1'));}return _0x28c11c[_0x2958('0xb4')+_[_0x2958('0xa3')](_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')][_0x2958('0xa4')]())+'Queues'](_0xd403bd[_0x2958('0x42')][_0x2958('0x5f')]);}})[_0x2958('0x15')](function(_0x2bfa7c){if(_[_0x2958('0xb5')](_0xd403bd[_0x2958('0x42')]['ids'])){for(var _0x2465db=0x0;_0x2465db<_0xd403bd[_0x2958('0x42')][_0x2958('0x5f')][_0x2958('0x49')];_0x2465db+=0x1){var _0x7bd7b={'UserId':Number(_0xd403bd[_0x2958('0x53')]['id'])};_0x7bd7b[_['capitalize'](_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')][_0x2958('0xa4')]())+_0x2958('0xa8')]=Number(_0xd403bd['query']['ids'][_0x2465db]);socket[_0x2958('0xa9')](_0x2958('0x2e')+_['capitalize'](_0xd403bd['query']['channel'][_0x2958('0xa4')]())+_0x2958('0xb6'),_0x7bd7b);}}else{var _0x7bd7b={'UserId':Number(_0xd403bd[_0x2958('0x53')]['id'])};_0x7bd7b[_['capitalize'](_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')]['toLowerCase']())+_0x2958('0xa8')]=Number(_0xd403bd['query'][_0x2958('0x5f')]);socket[_0x2958('0xa9')](_0x2958('0x2e')+_['capitalize'](_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')][_0x2958('0xa4')]())+_0x2958('0xb6'),_0x7bd7b);}return _0x2bfa7c;})[_0x2958('0x15')](function(){if(_0xd403bd[_0x2958('0x42')][_0x2958('0xb3')]==='voice'){return db[_0x2958('0xb1')][_0x2958('0x29')]({'where':{'UserId':_0xd403bd[_0x2958('0x53')]['id'],'VoiceQueueId':_0xd403bd[_0x2958('0x42')][_0x2958('0x5f')]},'individualHooks':!![]})['then'](function(){return _0x402518;});}return _0x402518;})[_0x2958('0x15')](respondWithStatusCode(_0x97949,null))[_0x2958('0x51')](handleError(_0x97949,null));};exports[_0x2958('0xb7')]=function(_0x5b1521,_0x46ac94){_0x5b1521[_0x2958('0x5c')]['userpic']=_0x5b1521['file']['filename'];return db[_0x2958('0x3a')][_0x2958('0x35')]({'where':{'id':_0x5b1521['params']['id']}})[_0x2958('0x15')](handleEntityNotFound(_0x46ac94,null))[_0x2958('0x15')](saveUpdates(_0x5b1521[_0x2958('0x5c')],null))['then'](respondWithResult(_0x46ac94,null))[_0x2958('0x51')](handleError(_0x46ac94,null));};exports['getAvatar']=function(_0x36dd39,_0x1763c0){var _0x2c992f=path['join'](config[_0x2958('0xb8')],_0x2958('0xb9'));return db[_0x2958('0x3a')][_0x2958('0x35')]({'where':{'id':_0x36dd39['params']['id']},'attributes':['id',_0x2958('0xba')],'raw':!![]})[_0x2958('0x15')](handleEntityNotFound(_0x1763c0,null))['then'](function(_0x16cf32){if(_0x16cf32){if(_[_0x2958('0x6b')](_0x16cf32['userpic'])){return _0x1763c0[_0x2958('0xbb')](_0x2c992f);}else{if(!fs['existsSync'](path[_0x2958('0xbc')](config[_0x2958('0xb8')],_0x2958('0xbd'),_0x16cf32[_0x2958('0xba')]))){return _0x1763c0[_0x2958('0xbb')](_0x2c992f);}return _0x1763c0['download'](path[_0x2958('0xbc')](config['root'],_0x2958('0xbd'),_0x16cf32[_0x2958('0xba')]));}}})[_0x2958('0x51')](handleError(_0x1763c0,null));};exports[_0x2958('0xbe')]=function(_0x41504c,_0x20bee2){return db[_0x2958('0x3a')]['find']({'where':{'id':_0x41504c[_0x2958('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x20bee2,null))[_0x2958('0x15')](function(_0x6151c){var _0x40abb1=[];values=_0x6151c['dataValues'];_0x40abb1[_0x2958('0x46')](get_open_tabs(_0x2958('0x4a'),_0x6151c['dataValues']));_0x40abb1[_0x2958('0x46')](get_open_tabs(_0x2958('0x4c'),_0x6151c['dataValues']));_0x40abb1[_0x2958('0x46')](get_open_tabs('openchannel',_0x6151c[_0x2958('0x4b')]));_0x40abb1[_0x2958('0x46')](get_open_tabs(_0x2958('0x4f'),_0x6151c[_0x2958('0x4b')]));_0x40abb1[_0x2958('0x46')](get_open_tabs(_0x2958('0x5b'),_0x6151c[_0x2958('0x4b')]));_0x40abb1[_0x2958('0x46')](get_open_tabs(_0x2958('0x4d'),_0x6151c[_0x2958('0x4b')]));return BPromise[_0x2958('0x50')](_0x40abb1);})['then'](function(_0x596dc4){var _0x3d4186=[];if(_0x596dc4){for(var _0x5161e1=0x0;_0x5161e1=_0x20a161){_0x29abdb=_0x20a161;_0x28f710=0xc8;}else{_0x28f710=0xce;}_0x524e42['status'](_0x28f710);return _0x524e42[_0x65f6('0x22')](_0x65f6('0x23'),_0x5cb131+'-'+_0x29abdb+'/'+_0x20a161)[_0x65f6('0x1d')](_0x471a33);}return null;};}function saveUpdates(_0x559330){return function(_0x4ac04b){if(_0x4ac04b){return _0x4ac04b['update'](_0x559330)[_0x65f6('0x24')](function(_0x3c032f){return _0x3c032f;});}return null;};}function removeEntity(_0x4344b3){return function(_0x408ccc){if(_0x408ccc){return _0x408ccc[_0x65f6('0x25')]()[_0x65f6('0x24')](function(){var _0x144e55=_0x408ccc['get']({'plain':!![]});if(_0x144e55['role']===_0x65f6('0x26'))return;var _0x27e284=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x65f6('0x27'),'value':_0x65f6('0x28'),'ignore':![]},{'name':_0x65f6('0x29'),'value':_0x65f6('0x2a'),'ignore':![]}];var _0x1217fd=_(_0x27e284)[_0x65f6('0x2b')]('ignore')[_0x65f6('0x2c')](_0x65f6('0x2d'))[_0x65f6('0x2d')]();if(_['includes'](_0x1217fd,_0x144e55[_0x65f6('0x2e')])){return;}var _0x2a7aa8=_[_0x65f6('0x2f')](_0x27e284,[_0x65f6('0x2d'),_0x144e55[_0x65f6('0x2e')]])[_0x65f6('0x30')];return db['UserProfileResource'][_0x65f6('0x25')]({'where':{'type':_0x2a7aa8,'resourceId':_0x144e55['id']}})[_0x65f6('0x24')](function(){return _0x408ccc;});})['then'](function(){_0x4344b3[_0x65f6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b403b){return function(_0x50494b){if(!_0x50494b){_0x2b403b[_0x65f6('0x1b')](0x194);}return _0x50494b;};}function handleError(_0x24f7fd,_0x5ce050){_0x5ce050=_0x5ce050||0x1f4;return function(_0x12dee6){logger[_0x65f6('0x18')](_0x12dee6[_0x65f6('0x31')]);if(_0x12dee6['name']){delete _0x12dee6['name'];}_0x24f7fd[_0x65f6('0x1c')](_0x5ce050)['send'](_0x12dee6);};}exports[_0x65f6('0x32')]=function(_0x4e6653,_0x22d760){var _0x2b9675={},_0x5e97f1={'count':0x0,'rows':[]};var _0x44b809=_(db['User']['rawAttributes'])[_0x65f6('0x2c')](function(_0x44f0f7){return{'name':_0x44f0f7[_0x65f6('0x33')],'type':_0x44f0f7[_0x65f6('0x34')][_0x65f6('0x35')]};})[_0x65f6('0x2b')](function(_0x1a55da){return!_[_0x65f6('0x36')](['password',_0x65f6('0x37')],_0x1a55da['name']);})[_0x65f6('0x2d')]();_0x2b9675=qs[_0x65f6('0x38')](_0x44b809,_0x4e6653);var _0x4ba7db={'where':_0x2b9675[_0x65f6('0x39')]};return db['User'][_0x65f6('0x21')](_0x4ba7db)[_0x65f6('0x24')](function(_0x413819){_0x5e97f1[_0x65f6('0x21')]=_0x413819;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x3b')]){_0x2b9675[_0x65f6('0x3c')]=[{'all':!![]}];}if(!_[_0x65f6('0x36')](_0x2b9675[_0x65f6('0x3d')],'id')){_0x2b9675['attributes'][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x40')](_0x2b9675);})[_0x65f6('0x24')](function(_0x83e2d9){_0x5e97f1[_0x65f6('0x41')]=_0x83e2d9;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x42')]===_0x65f6('0x43')){var _0x2abbed=[];for(var _0xcf19da=0x0;_0xcf19da<_0x5e97f1[_0x65f6('0x41')][_0x65f6('0x44')];_0xcf19da++){_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x48'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x49'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed[_0x65f6('0x3e')](get_open_tabs('openchannel',_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x4a'),_0x5e97f1['rows'][_0xcf19da][_0x65f6('0x47')]));}return BPromise['all'](_0x2abbed)[_0x65f6('0x24')](function(_0x4d9b76){return _0x5e97f1;});}else{return _0x5e97f1;}})[_0x65f6('0x24')](respondWithFilteredResult(_0x22d760,_0x2b9675))[_0x65f6('0x1a')](handleError(_0x22d760,null));};exports[_0x65f6('0x4b')]=function(_0x3837b2,_0x4d30c5){var _0x51bf6c={'raw':![],'where':{'id':_0x3837b2[_0x65f6('0x4c')]['id']}},_0x198e2f={};_0x198e2f[_0x65f6('0x4d')]=_[_0x65f6('0x4e')](_[_0x65f6('0x4f')](db[_0x65f6('0x3f')][_0x65f6('0x50')]),[_0x65f6('0x51'),_0x65f6('0x37')]);_0x198e2f['query']=_[_0x65f6('0x4f')](_0x3837b2[_0x65f6('0x3a')]);_0x198e2f[_0x65f6('0x52')]=_['intersection'](_0x198e2f[_0x65f6('0x4d')],_0x198e2f[_0x65f6('0x3a')]);_0x51bf6c['attributes']=_[_0x65f6('0x53')](_0x198e2f[_0x65f6('0x4d')],qs['fields'](_0x3837b2[_0x65f6('0x3a')]['fields']));_0x51bf6c[_0x65f6('0x3d')]=_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x44')]?_0x51bf6c['attributes']:_0x198e2f[_0x65f6('0x4d')];if(_0x3837b2[_0x65f6('0x3a')]['includeAll']){_0x51bf6c[_0x65f6('0x3c')]=[{'all':!![]}];}_0x51bf6c=_[_0x65f6('0x54')]({},_0x51bf6c,_0x3837b2['options']);if(!_[_0x65f6('0x36')](_0x51bf6c[_0x65f6('0x3d')],'id')){_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x2f')](_0x51bf6c)[_0x65f6('0x24')](handleEntityNotFound(_0x4d30c5,null))[_0x65f6('0x24')](function(_0x4f69d8){var _0x52c5a4=[];values=_0x4f69d8;if(_0x3837b2['query'][_0x65f6('0x42')]===_0x65f6('0x43')){_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4['push'](get_open_tabs(_0x65f6('0x55'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs('whatsapp',_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x48'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x4f69d8[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x52c5a4);}else{return values;}})[_0x65f6('0x24')](function(_0x2d8b5b){return values;})[_0x65f6('0x24')](respondWithResult(_0x4d30c5,null))[_0x65f6('0x1a')](handleError(_0x4d30c5,null));};exports[_0x65f6('0x57')]=function(_0x30adee,_0x3e3143){if(_0x30adee['body']['id']){delete _0x30adee[_0x65f6('0x58')]['id'];}delete _0x30adee[_0x65f6('0x58')][_0x65f6('0x2e')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x30adee[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3e3143,null))[_0x65f6('0x24')](saveUpdates(_0x30adee['body'],null))[_0x65f6('0x24')](respondWithResult(_0x3e3143,null))[_0x65f6('0x1a')](handleError(_0x3e3143,null));};exports[_0x65f6('0x59')]=function(_0x3e0d8b,_0x553ff0){return db[_0x65f6('0x3f')][_0x65f6('0x59')]()['then'](respondWithResult(_0x553ff0,null))[_0x65f6('0x1a')](handleError(_0x553ff0,null));};exports[_0x65f6('0x5a')]=function(_0x36c316,_0x51549d){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x36c316[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x51549d,null))[_0x65f6('0x24')](function(_0x334fa1){if(_0x334fa1){return _0x334fa1['addContacts'](_0x36c316['body']['ids'],_[_0x65f6('0x5b')](_0x36c316[_0x65f6('0x58')],[_0x65f6('0x5c'),'id'])||{});}})[_0x65f6('0x24')](respondWithResult(_0x51549d,null))[_0x65f6('0x1a')](handleError(_0x51549d,null));};function validateUser(_0x304cf9){return new BPromise(function(_0x4c5cd2,_0xfbfebc){if(_0x304cf9[_0x65f6('0x5d')])return _0x4c5cd2(_0x304cf9);return db['Setting'][_0x65f6('0x5e')](0x1)[_0x65f6('0x24')](function(_0x477489){if(_0x477489['securePassword'])authService[_0x65f6('0x5f')](_0x304cf9[_0x65f6('0x51')]);db['User'][_0x65f6('0x60')](_0x65f6('0x5d'))[_0x65f6('0x24')](function(_0x417b44){if(_[_0x65f6('0x61')](_0x417b44)){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')]||0x1;return;}if(_['isNil'](_0x477489['min_internal'])||_0x477489[_0x65f6('0x62')]===_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x417b44+0x1;return;}if(_0x477489['min_internal']>_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x477489['min_internal'];return;}return db[_0x65f6('0x63')]['query'](_0x65f6('0x64'),{'type':db[_0x65f6('0x63')][_0x65f6('0x65')][_0x65f6('0x66')]})[_0x65f6('0x24')](function(_0x264e6c){if(_0x264e6c&&_0x264e6c[_0x65f6('0x44')]){for(var _0x1cc66a=0x0,_0x2405a7=_0x264e6c['length'];_0x1cc66a<_0x2405a7&&_['isNil'](_0x304cf9[_0x65f6('0x5d')]);_0x1cc66a++){if(_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a][_0x65f6('0x67')]){_0x304cf9['internal']=_0x264e6c[_0x1cc66a]['from'];}else if(_0x477489[_0x65f6('0x62')]>_0x264e6c[_0x1cc66a][_0x65f6('0x67')]&&_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a]['to']){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')];}}}if(_[_0x65f6('0x61')](_0x304cf9['internal'])){_0x304cf9['internal']=_0x417b44+0x1;}return _0x4c5cd2(_0x304cf9);});});})[_0x65f6('0x1a')](function(_0x244f30){_0xfbfebc(_0x244f30);});});}function updateUser(_0x5543bc){return new BPromise(function(_0x219bf8,_0x4a8b60){try{if(_0x5543bc[_0x65f6('0x68')]){_0x5543bc[_0x65f6('0x69')]=_0x5543bc[_0x65f6('0x5d')];_0x5543bc[_0x65f6('0x6a')]={'mailbox':_0x5543bc['internal'],'password':_0x5543bc[_0x65f6('0x51')],'fullname':_0x5543bc[_0x65f6('0x6b')],'email':_0x5543bc[_0x65f6('0x6c')]};}if(_0x5543bc['role']==='agent'){if(!_0x5543bc[_0x65f6('0x6d')])_0x5543bc['permissions']=[_0x65f6('0x6e'),_0x65f6('0x6f'),_0x65f6('0x70'),_0x65f6('0x71'),'110','104','105',_0x65f6('0x72'),_0x65f6('0x73'),_0x65f6('0x74'),'109',_0x65f6('0x75'),_0x65f6('0x76'),_0x65f6('0x77'),'115'];}_0x219bf8(_0x5543bc);}catch(_0x40d0f7){_0x4a8b60(_0x40d0f7);}});}exports[_0x65f6('0x78')]=function(_0x4a3eab,_0x758e80){if(_0x4a3eab[_0x65f6('0x79')]['role']===_0x65f6('0x28'))throw new Error('Unauthorized');if(_0x4a3eab[_0x65f6('0x58')]['role']===_0x65f6('0x79')&&_0x4a3eab[_0x65f6('0x79')]['role']!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x26')&&_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7b'));}return licenseUtil[_0x65f6('0x7c')]([_0x4a3eab[_0x65f6('0x58')]])['then'](function(){return validateUser(_0x4a3eab[_0x65f6('0x58')]);})[_0x65f6('0x24')](function(_0x15c8b7){return updateUser(_0x15c8b7)[_0x65f6('0x24')](function(_0x5694f9){if(_0x5694f9[_0x65f6('0x2e')]===_0x65f6('0x26')){_0x5694f9['settingsEnabled']=_0x4a3eab[_0x65f6('0x79')]['settingsEnabled'];delete _0x5694f9[_0x65f6('0x7d')];}return _0x5694f9;});})['then'](function(_0x31f6c1){return db[_0x65f6('0x3f')]['create'](_0x31f6c1,{'include':[{'model':db['VoiceMail'],'as':_0x65f6('0x6a')}]});})[_0x65f6('0x24')](function(_0x5158c9){if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x79'))return _0x5158c9;if(_0x4a3eab['user'][_0x65f6('0x2e')]!==_0x65f6('0x79'))return _0x5158c9;return db['UserProfileSection'][_0x65f6('0x2f')]({'where':{'name':_0x5158c9['role']===_0x65f6('0x28')?'Agents':'Telephones','userProfileId':_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0xc82d69){if(!_0xc82d69||_0xc82d69[_0x65f6('0x7e')]!=0x0)return _0x5158c9;return db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x5158c9[_0x65f6('0x30')],'resourceId':_0x5158c9['id'],'type':_0xc82d69['name'],'sectionId':_0xc82d69['id']},{})['then'](function(){return _0x5158c9;});})[_0x65f6('0x1a')](function(_0x590801){logger[_0x65f6('0x18')](_0x65f6('0x80'),_0x590801);throw _0x590801;});})[_0x65f6('0x24')](respondWithResult(_0x758e80,0xc9))[_0x65f6('0x1a')](handleError(_0x758e80,null));};exports[_0x65f6('0x81')]=function(_0x56bd9d,_0x398cac){var _0x257247=_0x56bd9d[_0x65f6('0x58')];var _0x576ecd=[];if(_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]===_0x65f6('0x28'))throw new Error(_0x65f6('0x82'));if(_[_0x65f6('0x83')](_0x257247,[_0x65f6('0x2e'),'user'])&&_0x56bd9d['user'][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_[_0x65f6('0x83')](_0x257247,['role','admin'])&&_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x84'));}return licenseUtil[_0x65f6('0x7c')](_0x257247)[_0x65f6('0x24')](function(){return validateUser(_0x257247[0x0]);})['then'](function(){for(var _0x4d607a=0x1;_0x4d607a<_0x257247['length'];_0x4d607a++){var _0x2c59f6=_0x257247[_0x4d607a-0x1][_0x65f6('0x5d')];if(!_0x257247[_0x4d607a][_0x65f6('0x5d')])_0x257247[_0x4d607a][_0x65f6('0x5d')]=_0x2c59f6+0x1;_0x576ecd['push'](validateUser(_0x257247[_0x4d607a]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){_0x576ecd=[];for(var _0x27e44b=0x0;_0x27e44b<_0x257247['length'];_0x27e44b++){_0x576ecd[_0x65f6('0x3e')](updateUser(_0x257247[_0x27e44b]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){return BPromise['each'](_0x257247,function(_0x3a30ed){return db[_0x65f6('0x3f')]['create'](_0x3a30ed,{'include':[{'model':db[_0x65f6('0x6a')],'as':_0x65f6('0x6a')}]})[_0x65f6('0x24')](function(_0x9f6e0c){_0x3a30ed['id']=_0x9f6e0c['id'];return _0x3a30ed;});});})[_0x65f6('0x24')](function(_0x144db0){if(_0x56bd9d['body'][_0x65f6('0x2e')]==='user')return _0x144db0;if(_0x56bd9d[_0x65f6('0x79')]['role']!==_0x65f6('0x79'))return _0x144db0;var _0x3528be=_[_0x65f6('0x83')](_0x144db0,function(_0x41e59a){return _0x41e59a['role']===_0x65f6('0x28')||_0x41e59a[_0x65f6('0x2e')]===_0x65f6('0x2a');});if(!_0x3528be)return _0x144db0;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x65f6('0x27'),_0x65f6('0x29')]},'userProfileId':_0x56bd9d['user'][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0x2837fb){if(_['isEmpty'](_0x2837fb)||!_[_0x65f6('0x83')](_0x2837fb,[_0x65f6('0x7e'),0x0]))return _0x144db0;_0x576ecd=[];var _0x5df361=_(_0x2837fb)[_0x65f6('0x2c')](function(_0x7136bc){if(_0x7136bc[_0x65f6('0x7e')]===0x1)return;return _0x7136bc['name']===_0x65f6('0x27')?_0x65f6('0x28'):_0x65f6('0x2a');})['compact']()[_0x65f6('0x2d')]();for(var _0x4febfa=0x0;_0x4febfa<_0x144db0[_0x65f6('0x44')];_0x4febfa++){if(!_[_0x65f6('0x36')](_0x5df361,_0x144db0[_0x4febfa][_0x65f6('0x2e')]))return;var _0x22be6e=_0x144db0[_0x4febfa][_0x65f6('0x2e')]===_0x65f6('0x28')?'Agents':_0x65f6('0x29');_0x576ecd[_0x65f6('0x3e')](db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x144db0[_0x4febfa][_0x65f6('0x30')],'resourceId':_0x144db0[_0x4febfa]['id'],'type':_0x22be6e,'sectionId':_['find'](_0x2837fb,['name',_0x22be6e])['id']},{}));}return BPromise['all'](_0x576ecd);});})[_0x65f6('0x24')](respondWithResult(_0x398cac,0xc9))[_0x65f6('0x1a')](handleError(_0x398cac,null));};exports[_0x65f6('0x85')]=function(_0x59b715,_0x151cee){if(_0x59b715['body']['id']){delete _0x59b715['body']['id'];}return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x59b715['params']['id']}})[_0x65f6('0x24')](function(_0x3c5053){if(!_0x3c5053)return null;if(_0x3c5053['id']===_0x59b715[_0x65f6('0x79')]['id']){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]||!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x8a'));}if(!_0x3c5053[_0x65f6('0x8b')](_0x59b715[_0x65f6('0x58')]['oldPassword'])){throw new db[(_0x65f6('0x88'))]['ValidationError']('Wrong\x20credentials');}if(_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]===_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x59b715['user'][_0x65f6('0x2e')]===_0x65f6('0x26')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x59b715[_0x65f6('0x79')]['role']===_0x65f6('0x79')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3c5053['role']!==_0x65f6('0x28')){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x82'));}}else{throw new db[(_0x65f6('0x88'))]['ValidationError'](_0x65f6('0x82'));}return _0x3c5053;})[_0x65f6('0x24')](handleEntityNotFound(_0x151cee,null))[_0x65f6('0x24')](function(_0x223409){return db['Setting'][_0x65f6('0x8c')]({'attributes':['id',_0x65f6('0x8d'),_0x65f6('0x8e'),_0x65f6('0x8f')]})[_0x65f6('0x24')](function(_0x1438f5){if(_0x1438f5[_0x65f6('0x8d')])authService[_0x65f6('0x5f')](_0x59b715['body'][_0x65f6('0x87')]);if(!_0x1438f5[_0x65f6('0x8e')]||!_0x223409[_0x65f6('0x90')])return _0x223409;authService[_0x65f6('0x91')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409['previousPasswords'],_0x1438f5[_0x65f6('0x8f')]);return _0x223409;})[_0x65f6('0x24')](saveUpdates({'password':_0x59b715['body'][_0x65f6('0x87')],'passwordResetAt':_0x59b715['user']['id']==_0x59b715[_0x65f6('0x4c')]['id']?moment():null,'previousPasswords':authService[_0x65f6('0x92')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409[_0x65f6('0x90')])},null));})['then'](respondWithResult(_0x151cee,null))[_0x65f6('0x1a')](handleError(_0x151cee,null));};exports[_0x65f6('0x93')]=function(_0x2394eb,_0x31870f){var _0x99ca39=_0x2394eb['body']['channel'];return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2394eb[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role','online','loginInPause',_0x65f6('0x94'),_0x65f6('0x95')]})[_0x65f6('0x24')](handleEntityNotFound(_0x31870f,null))['then'](function(_0x12730b){if(_0x12730b){if(!utils[_0x65f6('0x96')](_0x99ca39)){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x12730b['add'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+'Queues'](_0x2394eb['body'][_0x65f6('0x5c')],{'penalty':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x9a')]||0x0})[_0x65f6('0x9b')](function(_0x17bbc9){for(var _0x57dffb=0x0;_0x57dffb<_0x2394eb[_0x65f6('0x58')]['ids'][_0x65f6('0x44')];_0x57dffb+=0x1){var _0x5d181a={'UserId':Number(_0x2394eb[_0x65f6('0x4c')]['id'])};_0x5d181a[_['capitalize'](_0x99ca39[_0x65f6('0x99')]())+'QueueId']=Number(_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')][_0x57dffb]);socket['emit']('user'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+_0x65f6('0x9c'),_0x5d181a);}return _0x17bbc9;})[_0x65f6('0x24')](function(){if(_0x99ca39===_0x65f6('0x9d')){return db[_0x65f6('0x9e')][_0x65f6('0x40')]({'where':{'id':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')]||[]},'raw':!![],'attributes':['id',_0x65f6('0x30')]});}})[_0x65f6('0x24')](function(_0x6babec){var _0x264d8b=_0x12730b[_0x65f6('0x9f')]({'plain':!![]});var _0x377855=[];if(_0x99ca39===_0x65f6('0x9d')&&_0x264d8b[_0x65f6('0x2e')]==='agent'&&_0x264d8b[_0x65f6('0xa0')]){for(var _0x91d7bf=0x0;_0x91d7bf<_0x6babec[_0x65f6('0x44')];_0x91d7bf+=0x1){_0x377855[_0x65f6('0x3e')]({'membername':_0x264d8b[_0x65f6('0x30')],'UserId':_0x264d8b['id'],'queue_name':_0x6babec[_0x91d7bf][_0x65f6('0x30')],'VoiceQueueId':_0x6babec[_0x91d7bf]['id'],'interface':_[_0x65f6('0x61')](_0x264d8b[_0x65f6('0x95')])?util[_0x65f6('0xa1')]('SIP/%s',_0x264d8b[_0x65f6('0x30')]):_0x264d8b[_0x65f6('0x95')],'paused':_0x264d8b[_0x65f6('0x94')]||![],'penalty':_0x2394eb[_0x65f6('0x58')]['penalty']||0x0});}return BPromise[_0x65f6('0xa2')](_0x377855,function(_0x39dedf){return db['UserVoiceQueueRt'][_0x65f6('0xa3')](_0x39dedf);});}return _0x12730b;});}})[_0x65f6('0x24')](respondWithStatusCode(_0x31870f,null))[_0x65f6('0x1a')](handleError(_0x31870f,null));};exports[_0x65f6('0xa4')]=function(_0x2b89d5,_0x409dd7){var _0x5f068a;return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2b89d5[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role']})['then'](handleEntityNotFound(_0x409dd7,null))['then'](function(_0x83e627){if(_0x83e627){_0x5f068a=_0x83e627;if(!_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')]||!utils[_0x65f6('0x96')](_0x2b89d5[_0x65f6('0x3a')]['channel'])){throw new db['Sequelize'][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x83e627[_0x65f6('0xa6')+_['capitalize'](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa7')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]);}})[_0x65f6('0x24')](function(_0x4632d0){if(_[_0x65f6('0xa8')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')])){for(var _0x8f7173=0x0;_0x8f7173<_0x2b89d5['query'][_0x65f6('0x5c')][_0x65f6('0x44')];_0x8f7173+=0x1){var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_['capitalize'](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+'QueueId']=Number(_0x2b89d5[_0x65f6('0x3a')]['ids'][_0x8f7173]);socket['emit'](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa9'),_0x28b9f4);}}else{var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+_0x65f6('0xaa')]=Number(_0x2b89d5['query'][_0x65f6('0x5c')]);socket[_0x65f6('0xab')](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')]['channel'][_0x65f6('0x99')]())+'Queue:remove',_0x28b9f4);}return _0x4632d0;})[_0x65f6('0x24')](function(){if(_0x2b89d5['query'][_0x65f6('0xa5')]===_0x65f6('0x9d')){return db[_0x65f6('0xac')][_0x65f6('0x25')]({'where':{'UserId':_0x2b89d5[_0x65f6('0x4c')]['id'],'VoiceQueueId':_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]},'individualHooks':!![]})[_0x65f6('0x24')](function(){return _0x5f068a;});}return _0x5f068a;})[_0x65f6('0x24')](respondWithStatusCode(_0x409dd7,null))[_0x65f6('0x1a')](handleError(_0x409dd7,null));};exports[_0x65f6('0xad')]=function(_0x2eb04c,_0x3739fd){_0x2eb04c[_0x65f6('0x58')][_0x65f6('0xae')]=_0x2eb04c[_0x65f6('0xaf')][_0x65f6('0xb0')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x2eb04c['params']['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3739fd,null))[_0x65f6('0x24')](saveUpdates(_0x2eb04c[_0x65f6('0x58')],null))[_0x65f6('0x24')](respondWithResult(_0x3739fd,null))[_0x65f6('0x1a')](handleError(_0x3739fd,null));};exports[_0x65f6('0xb1')]=function(_0x5afc8c,_0xb55829){var _0x1ac0bd=path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb4'));return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x5afc8c[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0xae')],'raw':!![]})[_0x65f6('0x24')](handleEntityNotFound(_0xb55829,null))[_0x65f6('0x24')](function(_0x4ecd83){if(_0x4ecd83){if(_['isNil'](_0x4ecd83[_0x65f6('0xae')])){return _0xb55829[_0x65f6('0xb5')](_0x1ac0bd);}else{if(!fs[_0x65f6('0xb6')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]))){return _0xb55829['download'](_0x1ac0bd);}return _0xb55829[_0x65f6('0xb5')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]));}}})[_0x65f6('0x1a')](handleError(_0xb55829,null));};exports[_0x65f6('0xb8')]=function(_0x47274e,_0x253c2e){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x47274e[_0x65f6('0x4c')]['id']},'attributes':['id']})[_0x65f6('0x24')](handleEntityNotFound(_0x253c2e,null))['then'](function(_0x59d9d5){var _0x56e0c0=[];values=_0x59d9d5[_0x65f6('0x47')];_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x59d9d5['dataValues']));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x55'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x4a'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs('fax',_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x59d9d5[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x56e0c0);})[_0x65f6('0x24')](function(_0x2558e8){var _0xa5af18=[];if(_0x2558e8){for(var _0x51474e=0x0;_0x51474e=_0x4526d1[_0x7d59('0x52')]){throw new Error(_0x7d59('0x53'));}})[_0x7d59('0xf')](function(){if(_0x566127){return db[_0x7d59('0x2a')]['destroy']({'where':{'membername':_0x566127[_0x7d59('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x566127){return _0x566127[_0x7d59('0x54')]({'raw':!![]});}})[_0x7d59('0xf')](function(_0xd0ab9){if(_0x566127){if(_0xd0ab9){var _0x32e11a=[];_0x48a309=_0xd0ab9;if(_0x48a309[_0x7d59('0x31')]){for(var _0x45b370=0x0;_0x45b370<_0x48a309[_0x7d59('0x31')];_0x45b370++){_0x32e11a[_0x7d59('0x34')](db['UserVoiceQueueRt'][_0x7d59('0x55')]({'membername':_0x566127['name'],'UserId':_0x566127['id'],'queue_name':_0x48a309[_0x45b370][_0x7d59('0x27')],'VoiceQueueId':_0x48a309[_0x45b370]['id'],'interface':_0x5ef0c7,'paused':_0x566127[_0x7d59('0x4d')]||![],'penalty':_0x48a309[_0x45b370][_0x7d59('0x56')]||0x0}));}return BPromise[_0x7d59('0x47')](_0x32e11a);}}}})[_0x7d59('0xf')](function(){if(_0x566127){return db[_0x7d59('0x2c')][_0x7d59('0x2d')]({'where':{'membername':_0x566127[_0x7d59('0x27')],'exitAt':null}});}})[_0x7d59('0xf')](function(_0x4071ba){if(_0x566127){if(_0x4071ba&&_0x4071ba[_0x7d59('0x31')]){var _0x1a28a8=[];_0x4071ba[_0x7d59('0x46')](function(_0x5419d3){_0x1a28a8['push'](_0x5419d3[_0x7d59('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7d59('0x47')](_0x1a28a8);}}})[_0x7d59('0xf')](function(_0x3453d7){if(_0x566127){var _0x37d4c5=[];var _0x153ba5=[];var _0x1a864a=utils['getChannels']();var _0x573189={'membername':_0x566127[_0x7d59('0x27')],'interface':_0x5ef0c7,'enterAt':moment()[_0x7d59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x566127['role'],'internal':_0x566127[_0x7d59('0x29')]};_0x1a864a[_0x7d59('0x46')](function(_0x51bed0){_0x37d4c5[_0x7d59('0x34')](_[_0x7d59('0x57')]({'channel':_0x51bed0,'type':_0x7d59('0x58'),'data1':'callysquare','data2':_0x5ef0c7},_0x573189));if(_0x566127[_0x7d59('0x4d')]){_0x153ba5['push'](_[_0x7d59('0x57')]({'channel':_0x51bed0,'type':_0x7d59('0x2e'),'data1':_0x7d59('0x59')},_0x573189));}});return db[_0x7d59('0x2c')][_0x7d59('0x39')](_0x37d4c5[_0x7d59('0x5a')](_0x153ba5),{'individualHooks':!![]});}})[_0x7d59('0xf')](function(){if(_0x566127){return _0x566127[_0x7d59('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x7d59('0x30')),'voicePause':_0x566127['loginInPause']||![],'mailPause':_0x566127[_0x7d59('0x4d')]||![],'chatPause':_0x566127[_0x7d59('0x4d')]||![],'faxPause':_0x566127[_0x7d59('0x4d')]||![],'smsPause':_0x566127['loginInPause']||![],'openchannelPause':_0x566127[_0x7d59('0x4d')]||![],'pauseType':_0x566127[_0x7d59('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x7d59('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5ef0c7});}})[_0x7d59('0xf')](function(_0x44b49a){_0xae9108(_0x44b49a);})[_0x7d59('0x1a')](function(_0x43862a){_0x8ee759(_0x4ce4c5['error'](0x1f4,_0x43862a[_0x7d59('0x18')]));});});}; \ No newline at end of file +var _0x7100=['mail','fax','sms','openchannel','%s%s','Pause','forEach','push','all','LogoutUser','findOne','mobile','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','./user.socket','register','request','then','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetUser','User','findAll','options','raw','where','limit','map','include','model','attributes','debug','stringify','catch','ShowUser','find','name','internal','interface','UserVoiceQueueRt','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','SIP/%s','PAUSE','body','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','update','type','UnpauseUser','isValidChannel','Unknown\x20channel','channel','system'];(function(_0x29b8e3,_0x17acf8){var _0x38b43a=function(_0x9b0c66){while(--_0x9b0c66){_0x29b8e3['push'](_0x29b8e3['shift']());}};_0x38b43a(++_0x17acf8);}(_0x7100,0x128));var _0x0710=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0x7100[_0x5b8310];return _0xd3ebc1;};'use strict';var _=require(_0x0710('0x0'));var util=require('util');var moment=require(_0x0710('0x1'));var BPromise=require(_0x0710('0x2'));var rs=require(_0x0710('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0710('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0710('0x5'))(_0x0710('0x6'));var config=require(_0x0710('0x7'));var jayson=require(_0x0710('0x8'));var client=jayson['client'][_0x0710('0x9')]({'port':0x232a});config['redis']=_[_0x0710('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0710('0xb')]));require(_0x0710('0xc'))[_0x0710('0xd')](socket);function respondWithRpcPromise(_0x5d0c26,_0x1daa6d,_0x44db45){return new BPromise(function(_0x5cceb2,_0x256b0){return client[_0x0710('0xe')](_0x5d0c26,_0x44db45)[_0x0710('0xf')](function(_0xf4d670){logger['info'](_0x0710('0x10'),_0x1daa6d,'request\x20sent');logger['debug'](_0x0710('0x11'),_0x1daa6d,_0x0710('0x12'),JSON['stringify'](_0xf4d670));if(_0xf4d670[_0x0710('0x13')]){if(_0xf4d670[_0x0710('0x13')][_0x0710('0x14')]===0x1f4){logger['error'](_0x0710('0x10'),_0x1daa6d,_0xf4d670['error'][_0x0710('0x15')]);return _0x256b0(_0xf4d670[_0x0710('0x13')][_0x0710('0x15')]);}logger['error'](_0x0710('0x10'),_0x1daa6d,_0xf4d670[_0x0710('0x13')]['message']);return _0x5cceb2(_0xf4d670[_0x0710('0x13')][_0x0710('0x15')]);}else{logger[_0x0710('0x16')](_0x0710('0x10'),_0x1daa6d,_0x0710('0x12'));_0x5cceb2(_0xf4d670[_0x0710('0x17')]['message']);}})['catch'](function(_0x4ef31f){logger[_0x0710('0x13')](_0x0710('0x10'),_0x1daa6d,_0x4ef31f);_0x256b0(_0x4ef31f);});});}exports[_0x0710('0x18')]=function(_0x23b617){var _0xa6e19a=this;return new Promise(function(_0x4b7407,_0x5ad7a1){return db[_0x0710('0x19')][_0x0710('0x1a')]({'raw':_0x23b617[_0x0710('0x1b')]?_0x23b617[_0x0710('0x1b')][_0x0710('0x1c')]===undefined?!![]:![]:!![],'where':_0x23b617[_0x0710('0x1b')]?_0x23b617[_0x0710('0x1b')][_0x0710('0x1d')]||null:null,'attributes':_0x23b617[_0x0710('0x1b')]?_0x23b617[_0x0710('0x1b')]['attributes']||null:null,'limit':_0x23b617[_0x0710('0x1b')]?_0x23b617[_0x0710('0x1b')][_0x0710('0x1e')]||null:null,'include':_0x23b617[_0x0710('0x1b')]?_0x23b617['options']['include']?_[_0x0710('0x1f')](_0x23b617['options'][_0x0710('0x20')],function(_0x2f3acd){return{'model':db[_0x2f3acd[_0x0710('0x21')]],'as':_0x2f3acd['as'],'attributes':_0x2f3acd[_0x0710('0x22')],'include':_0x2f3acd[_0x0710('0x20')]?_['map'](_0x2f3acd[_0x0710('0x20')],function(_0x19b779){return{'model':db[_0x19b779[_0x0710('0x21')]],'as':_0x19b779['as'],'attributes':_0x19b779[_0x0710('0x22')],'include':_0x19b779['include']?_[_0x0710('0x1f')](_0x19b779[_0x0710('0x20')],function(_0x5e96b2){return{'model':db[_0x5e96b2[_0x0710('0x21')]],'as':_0x5e96b2['as'],'attributes':_0x5e96b2[_0x0710('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0710('0xf')](function(_0x1db218){logger[_0x0710('0x16')]('GetUser',_0x23b617);logger[_0x0710('0x23')](_0x0710('0x18'),_0x23b617,JSON[_0x0710('0x24')](_0x1db218));_0x4b7407(_0x1db218);})[_0x0710('0x25')](function(_0x4a00e2){logger['error'](_0x0710('0x18'),_0x4a00e2[_0x0710('0x15')],_0x23b617);_0x5ad7a1(_0xa6e19a[_0x0710('0x13')](0x1f4,_0x4a00e2['message']));});});};exports[_0x0710('0x26')]=function(_0x1872b8){var _0x306285=this;return new Promise(function(_0x13b37b,_0x5da159){return db['User'][_0x0710('0x27')]({'raw':_0x1872b8[_0x0710('0x1b')]?_0x1872b8[_0x0710('0x1b')][_0x0710('0x1c')]===undefined?!![]:![]:!![],'where':_0x1872b8[_0x0710('0x1b')]?_0x1872b8[_0x0710('0x1b')]['where']||null:null,'attributes':_0x1872b8[_0x0710('0x1b')]?_0x1872b8[_0x0710('0x1b')][_0x0710('0x22')]||null:null,'include':_0x1872b8[_0x0710('0x1b')]?_0x1872b8['options'][_0x0710('0x20')]?_[_0x0710('0x1f')](_0x1872b8['options'][_0x0710('0x20')],function(_0x5dc6d6){return{'model':db[_0x5dc6d6['model']],'as':_0x5dc6d6['as'],'attributes':_0x5dc6d6[_0x0710('0x22')],'include':_0x5dc6d6[_0x0710('0x20')]?_['map'](_0x5dc6d6[_0x0710('0x20')],function(_0x3d8fbf){return{'model':db[_0x3d8fbf[_0x0710('0x21')]],'as':_0x3d8fbf['as'],'attributes':_0x3d8fbf[_0x0710('0x22')],'include':_0x3d8fbf[_0x0710('0x20')]?_['map'](_0x3d8fbf['include'],function(_0x35e77e){return{'model':db[_0x35e77e['model']],'as':_0x35e77e['as'],'attributes':_0x35e77e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0710('0xf')](function(_0x361268){logger[_0x0710('0x16')]('ShowUser',_0x1872b8);logger[_0x0710('0x23')]('ShowUser',_0x1872b8,JSON[_0x0710('0x24')](_0x361268));_0x13b37b(_0x361268);})[_0x0710('0x25')](function(_0x924063){logger['error'](_0x0710('0x26'),_0x924063[_0x0710('0x15')],_0x1872b8);_0x5da159(_0x306285[_0x0710('0x13')](0x1f4,_0x924063['message']));});});};exports['PauseUser']=function(_0x128fbe){var _0x32cab2=this;return new Promise(function(_0x12ed57,_0x22fa40){var _0x5992d4;return db[_0x0710('0x19')][_0x0710('0x27')]({'where':_0x128fbe[_0x0710('0x1b')][_0x0710('0x1d')]||{},'attributes':['id',_0x0710('0x28'),'role',_0x0710('0x29'),_0x0710('0x2a')]})['then'](function(_0x188908){if(_0x188908){_0x5992d4=_0x188908;return db[_0x0710('0x2b')]['update']({'paused':0x1},{'where':{'UserId':_0x5992d4['id']},'individualHooks':!![]});}})[_0x0710('0xf')](function(){if(_0x5992d4){return db[_0x0710('0x2c')][_0x0710('0x1a')]({'where':{'membername':_0x5992d4['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x50feeb){if(_0x5992d4){if(_0x50feeb&&_0x50feeb[_0x0710('0x2d')]){var _0x198a2e=moment()[_0x0710('0x2e')](_0x0710('0x2f'));for(var _0x5b44a5=0x0,_0x4914b3=_0x50feeb[_0x0710('0x2d')];_0x5b44a5<_0x4914b3;_0x5b44a5++){_0x50feeb[_0x5b44a5][_0x0710('0x30')]({'exitAt':_0x198a2e});}}}})[_0x0710('0xf')](function(){if(_0x5992d4){var _0x36a291=[];var _0x48a251=utils[_0x0710('0x31')]();_0x48a251['forEach'](function(_0x1961e7){_0x36a291['push']({'channel':_0x1961e7,'membername':_0x5992d4[_0x0710('0x28')],'interface':_['isNil'](_0x5992d4[_0x0710('0x2a')])?util[_0x0710('0x2e')](_0x0710('0x32'),_0x5992d4[_0x0710('0x28')]):_0x5992d4[_0x0710('0x2a')],'type':_0x0710('0x33'),'enterAt':moment()['format'](_0x0710('0x2f')),'data1':_0x128fbe[_0x0710('0x34')]['type']||_0x0710('0x35'),'role':_0x5992d4[_0x0710('0x36')],'internal':_0x5992d4[_0x0710('0x29')],'uniqueid':_0x128fbe[_0x0710('0x34')][_0x0710('0x37')]||null});});return db['MemberReport'][_0x0710('0x38')](_0x36a291,{'individualHooks':!![]});}})[_0x0710('0xf')](function(){if(_0x5992d4){return _0x5992d4[_0x0710('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x128fbe[_0x0710('0x34')][_0x0710('0x3a')]||_0x0710('0x35'),'lastPauseAt':moment()[_0x0710('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x0710('0xf')](function(_0x24b7be){_0x12ed57(_0x24b7be);})[_0x0710('0x25')](function(_0xc3eb19){_0x22fa40(_0x32cab2[_0x0710('0x13')](0x1f4,_0xc3eb19[_0x0710('0x15')]));});});};exports[_0x0710('0x3b')]=function(_0x41c5e6){var _0x33e82c=this;return new Promise(function(_0x4acfdb,_0x3d102a){var _0x546807;return db[_0x0710('0x19')]['findOne']({'where':_0x41c5e6[_0x0710('0x1b')][_0x0710('0x1d')]||{},'attributes':['id',_0x0710('0x28')]})[_0x0710('0xf')](function(_0xf81f36){if(_0xf81f36){_0x546807=_0xf81f36;if(_0x41c5e6['body']['channel']&&!utils[_0x0710('0x3c')](_0x41c5e6[_0x0710('0x34')]['channel'])){throw new Error(_0x0710('0x3d'));}switch(_0x41c5e6[_0x0710('0x34')][_0x0710('0x3e')]){case'voice':return db['UserVoiceQueueRt'][_0x0710('0x39')]({'paused':0x0},{'where':{'UserId':_0x546807['id']}})[_0x0710('0xf')](function(){return db['MemberReport'][_0x0710('0x27')]({'where':{'channel':_0x41c5e6[_0x0710('0x34')][_0x0710('0x3e')],'membername':_0x546807[_0x0710('0x28')],'type':'PAUSE','exitAt':null}});})[_0x0710('0xf')](function(_0xda7a88){if(_0xda7a88){return _0xda7a88['update']({'exitAt':moment()[_0x0710('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0710('0x3f')},{'individualHooks':!![]});}return null;})[_0x0710('0xf')](function(){return _0x546807['update']({'voicePause':![]});});case _0x0710('0x40'):case'chat':case _0x0710('0x41'):case _0x0710('0x42'):case _0x0710('0x43'):case'whatsapp':return db[_0x0710('0x2c')][_0x0710('0x27')]({'where':{'channel':_0x41c5e6[_0x0710('0x34')][_0x0710('0x3e')],'membername':_0x546807[_0x0710('0x28')],'type':'PAUSE','exitAt':null}})[_0x0710('0xf')](function(_0x3d6c56){return _0x3d6c56[_0x0710('0x39')]({'exitAt':moment()[_0x0710('0x2e')](_0x0710('0x2f')),'data2':_0x0710('0x3f')},{'individualHooks':!![]});})[_0x0710('0xf')](function(){var _0x143185={};_['set'](_0x143185,util[_0x0710('0x2e')](_0x0710('0x44'),_0x41c5e6[_0x0710('0x34')][_0x0710('0x3e')],_0x0710('0x45')),![]);return _0x546807[_0x0710('0x39')](_0x143185);});default:return db[_0x0710('0x2b')][_0x0710('0x39')]({'paused':0x0},{'where':{'UserId':_0x546807['id']}})['then'](function(){return db[_0x0710('0x2c')]['findAll']({'where':{'membername':_0x546807['name'],'type':_0x0710('0x33'),'exitAt':null}});})[_0x0710('0xf')](function(_0x30973f){var _0x2c8118=[];_0x30973f[_0x0710('0x46')](function(_0xaf8c7e){_0x2c8118[_0x0710('0x47')](_0xaf8c7e[_0x0710('0x39')]({'exitAt':moment()[_0x0710('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0710('0x3f')}));});return BPromise[_0x0710('0x48')](_0x2c8118);})[_0x0710('0xf')](function(){return _0x546807[_0x0710('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x0710('0xf')](function(_0x293feb){_0x4acfdb(_0x293feb);})[_0x0710('0x25')](function(_0x254780){_0x3d102a(_0x33e82c[_0x0710('0x13')](0x1f4,_0x254780[_0x0710('0x15')]));});});};exports[_0x0710('0x49')]=function(_0x5a70c3){var _0x28f6db=this;return new Promise(function(_0x5b1d45,_0x515d39){var _0x4a32c4;return db[_0x0710('0x19')][_0x0710('0x4a')]({'where':_0x5a70c3[_0x0710('0x1b')][_0x0710('0x1d')]||{},'attributes':['id',_0x0710('0x28')]})[_0x0710('0xf')](function(_0x4aa645){if(_0x4aa645){_0x4a32c4=_0x4aa645;return db[_0x0710('0x2b')]['destroy']({'where':{'membername':_0x4a32c4[_0x0710('0x28')]},'individualHooks':!![]});}})[_0x0710('0xf')](function(){if(_0x4a32c4){return db[_0x0710('0x2c')][_0x0710('0x1a')]({'where':{'membername':_0x4a32c4['name'],'exitAt':null}});}})[_0x0710('0xf')](function(_0x4ad713){if(_0x4a32c4){if(_0x4ad713&&_0x4ad713['length']){var _0x5995d5=[];_0x4ad713['forEach'](function(_0x201864){_0x5995d5[_0x0710('0x47')](_0x201864[_0x0710('0x39')]({'exitAt':moment()[_0x0710('0x2e')](_0x0710('0x2f'))}));});return BPromise[_0x0710('0x48')](_0x5995d5);}}})[_0x0710('0xf')](function(){if(_0x4a32c4){return _0x4a32c4[_0x0710('0x39')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x0710('0xf')](function(_0x8bb2cd){_0x5b1d45(_0x8bb2cd);})[_0x0710('0x25')](function(_0x3f9269){_0x515d39(_0x28f6db['error'](0x1f4,_0x3f9269[_0x0710('0x15')]));});});};exports['LoginUser']=function(_0x219667){var _0x1b236c=this;return new Promise(function(_0x569a62,_0x2869a2){var _0xddd61a;var _0x15cac6;var _0x1a8edc;var _0x427656;return db[_0x0710('0x19')][_0x0710('0x4a')]({'where':_0x219667[_0x0710('0x1b')]['where']||{},'attributes':['id',_0x0710('0x28'),_0x0710('0x36'),_0x0710('0x4b'),'phone','internal',_0x0710('0x4c'),_0x0710('0x2a')]})[_0x0710('0xf')](function(_0x4019d4){if(_0x4019d4){_0xddd61a=_0x4019d4;_0x427656=_0x219667[_0x0710('0x34')][_0x0710('0x2a')]?_0x219667[_0x0710('0x34')]['interface']:util['format'](_0x0710('0x32'),_0xddd61a[_0x0710('0x28')]);return db[_0x0710('0x19')][_0x0710('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xddd61a['id']}}});}})[_0x0710('0xf')](function(_0x5b8c2e){if(_0x5b8c2e){_0x1a8edc=_0x5b8c2e;return require(_0x0710('0x4e'))[_0x0710('0x4f')]();}})[_0x0710('0xf')](function(_0x32ad16){if(_0x32ad16&&_0x32ad16[_0x0710('0x50')]&&_0x1a8edc>=_0x32ad16[_0x0710('0x50')]){throw new Error(_0x0710('0x51'));}})[_0x0710('0xf')](function(){if(_0xddd61a){return db[_0x0710('0x2b')][_0x0710('0x52')]({'where':{'membername':_0xddd61a['name']},'individualHooks':!![]});}})['then'](function(){if(_0xddd61a){return _0xddd61a[_0x0710('0x53')]({'raw':!![]});}})[_0x0710('0xf')](function(_0x50c842){if(_0xddd61a){if(_0x50c842){var _0x39da44=[];_0x15cac6=_0x50c842;if(_0x15cac6[_0x0710('0x2d')]){for(var _0x21080a=0x0;_0x21080a<_0x15cac6[_0x0710('0x2d')];_0x21080a++){_0x39da44[_0x0710('0x47')](db['UserVoiceQueueRt'][_0x0710('0x54')]({'membername':_0xddd61a[_0x0710('0x28')],'UserId':_0xddd61a['id'],'queue_name':_0x15cac6[_0x21080a][_0x0710('0x28')],'VoiceQueueId':_0x15cac6[_0x21080a]['id'],'interface':_0x427656,'paused':_0xddd61a[_0x0710('0x4c')]||![],'penalty':_0x15cac6[_0x21080a][_0x0710('0x55')]||0x0}));}return BPromise[_0x0710('0x48')](_0x39da44);}}}})['then'](function(){if(_0xddd61a){return db[_0x0710('0x2c')][_0x0710('0x1a')]({'where':{'membername':_0xddd61a[_0x0710('0x28')],'exitAt':null}});}})[_0x0710('0xf')](function(_0x5dcce8){if(_0xddd61a){if(_0x5dcce8&&_0x5dcce8[_0x0710('0x2d')]){var _0x45d87f=[];_0x5dcce8['forEach'](function(_0x2fad72){_0x45d87f[_0x0710('0x47')](_0x2fad72[_0x0710('0x39')]({'exitAt':moment()[_0x0710('0x2e')](_0x0710('0x2f'))}));});return BPromise['all'](_0x45d87f);}}})[_0x0710('0xf')](function(_0x2c173e){if(_0xddd61a){var _0xd4d51d=[];var _0x248a40=[];var _0x2d7843=utils[_0x0710('0x31')]();var _0x6a610f={'membername':_0xddd61a[_0x0710('0x28')],'interface':_0x427656,'enterAt':moment()['format'](_0x0710('0x2f')),'role':_0xddd61a[_0x0710('0x36')],'internal':_0xddd61a[_0x0710('0x29')]};_0x2d7843['forEach'](function(_0x16a476){_0xd4d51d[_0x0710('0x47')](_[_0x0710('0x56')]({'channel':_0x16a476,'type':'LOGIN','data1':_0x0710('0x57'),'data2':_0x427656},_0x6a610f));if(_0xddd61a['loginInPause']){_0x248a40[_0x0710('0x47')](_['merge']({'channel':_0x16a476,'type':'PAUSE','data1':_0x0710('0x58')},_0x6a610f));}});return db[_0x0710('0x2c')][_0x0710('0x38')](_0xd4d51d[_0x0710('0x59')](_0x248a40),{'individualHooks':!![]});}})[_0x0710('0xf')](function(){if(_0xddd61a){return _0xddd61a[_0x0710('0x39')]({'online':!![],'lastLoginAt':moment()['format'](_0x0710('0x2f')),'voicePause':_0xddd61a[_0x0710('0x4c')]||![],'mailPause':_0xddd61a['loginInPause']||![],'chatPause':_0xddd61a[_0x0710('0x4c')]||![],'faxPause':_0xddd61a[_0x0710('0x4c')]||![],'smsPause':_0xddd61a['loginInPause']||![],'openchannelPause':_0xddd61a[_0x0710('0x4c')]||![],'pauseType':_0xddd61a[_0x0710('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x0710('0x2f')),'interface':_0x427656});}})[_0x0710('0xf')](function(_0x1d4b38){_0x569a62(_0x1d4b38);})['catch'](function(_0x1a02b3){_0x2869a2(_0x1b236c['error'](0x1f4,_0x1a02b3['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9dec361..0c95560 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf69=['update','removeListener','length','user:','./user.events','save','remove'];(function(_0x514c96,_0x3884de){var _0x40fc27=function(_0x4385a9){while(--_0x4385a9){_0x514c96['push'](_0x514c96['shift']());}};_0x40fc27(++_0x3884de);}(_0xcf69,0xa5));var _0x9cf6=function(_0x3a3930,_0x281f7e){_0x3a3930=_0x3a3930-0x0;var _0x46f754=_0xcf69[_0x3a3930];return _0x46f754;};'use strict';var UserEvents=require(_0x9cf6('0x0'));var events=[_0x9cf6('0x1'),_0x9cf6('0x2'),_0x9cf6('0x3')];function createListener(_0x3dda35,_0x392cf8){return function(_0xef63){_0x392cf8['emit'](_0x3dda35,_0xef63);};}function removeListener(_0x3f818e,_0x1a1d25){return function(){UserEvents[_0x9cf6('0x4')](_0x3f818e,_0x1a1d25);};}exports['register']=function(_0x30e422){for(var _0x544d65=0x0,_0x2c1430=events[_0x9cf6('0x5')];_0x544d65<_0x2c1430;_0x544d65++){var _0x504e4b=events[_0x544d65];var _0x475990=createListener(_0x9cf6('0x6')+_0x504e4b,_0x30e422);UserEvents['on'](_0x504e4b,_0x475990);}}; \ No newline at end of file +var _0x0046=['removeListener','register','user:','./user.events','save','remove','update','emit'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x0046,0x11b));var _0x6004=function(_0x34e891,_0x16f98d){_0x34e891=_0x34e891-0x0;var _0x28cbfa=_0x0046[_0x34e891];return _0x28cbfa;};'use strict';var UserEvents=require(_0x6004('0x0'));var events=[_0x6004('0x1'),_0x6004('0x2'),_0x6004('0x3')];function createListener(_0x4781f5,_0x459573){return function(_0x2cf763){_0x459573[_0x6004('0x4')](_0x4781f5,_0x2cf763);};}function removeListener(_0x162905,_0x2b4958){return function(){UserEvents[_0x6004('0x5')](_0x162905,_0x2b4958);};}exports[_0x6004('0x6')]=function(_0x2c2e15){for(var _0x4e0398=0x0,_0x49fea9=events['length'];_0x4e0398<_0x49fea9;_0x4e0398++){var _0x4ba090=events[_0x4e0398];var _0x5864e1=createListener(_0x6004('0x7')+_0x4ba090,_0x2c2e15);UserEvents['on'](_0x4ba090,_0x5864e1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d1eba51..cd0b91e 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1d3e49,_0x11c597){var _0x3e3c8d=function(_0x585f4){while(--_0x585f4){_0x1d3e49['push'](_0x1d3e49['shift']());}};_0x3e3c8d(++_0x11c597);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3786dd,_0x5777fc){var _0x4c7a8e=function(_0x119047){while(--_0x119047){_0x3786dd['push'](_0x3786dd['shift']());}};_0x4c7a8e(++_0x5777fc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 6919320..6c37230 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3677=['sequelize','exports','INTEGER'];(function(_0x4367d0,_0x2a9622){var _0x573fc7=function(_0x10b41f){while(--_0x10b41f){_0x4367d0['push'](_0x4367d0['shift']());}};_0x573fc7(++_0x2a9622);}(_0x3677,0x1e9));var _0x7367=function(_0x35173b,_0x16711b){_0x35173b=_0x35173b-0x0;var _0x51cdf4=_0x3677[_0x35173b];return _0x51cdf4;};'use strict';var Sequelize=require(_0x7367('0x0'));module[_0x7367('0x1')]={'penalty':{'type':Sequelize[_0x7367('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x21dc=['exports','INTEGER','sequelize'];(function(_0x1d3d2c,_0x554ce4){var _0x5686bf=function(_0x912386){while(--_0x912386){_0x1d3d2c['push'](_0x1d3d2c['shift']());}};_0x5686bf(++_0x554ce4);}(_0x21dc,0x170));var _0xc21d=function(_0x337af0,_0x43ba71){_0x337af0=_0x337af0-0x0;var _0x4c52d1=_0x21dc[_0x337af0];return _0x4c52d1;};'use strict';var Sequelize=require(_0xc21d('0x0'));module[_0xc21d('0x1')]={'penalty':{'type':Sequelize[_0xc21d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7c234ff..34eaf6b 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab9b=['request-promise','../../config/environment','./userChatQueue.attributes','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xab9b,0xfe));var _0xbab9=function(_0x5ebe63,_0x2956bc){_0x5ebe63=_0x5ebe63-0x0;var _0x1f91ee=_0xab9b[_0x5ebe63];return _0x1f91ee;};'use strict';var _=require(_0xbab9('0x0'));var util=require(_0xbab9('0x1'));var logger=require(_0xbab9('0x2'))(_0xbab9('0x3'));var moment=require(_0xbab9('0x4'));var BPromise=require(_0xbab9('0x5'));var rp=require(_0xbab9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbab9('0x7'));var attributes=require(_0xbab9('0x8'));module['exports']=function(_0x38b060,_0x578648){return _0x38b060['define']('UserChatQueue',attributes,{'tableName':_0xbab9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7743=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7743,0x139));var _0x3774=function(_0x3f5594,_0x53503e){_0x3f5594=_0x3f5594-0x0;var _0x153c29=_0x7743[_0x3f5594];return _0x153c29;};'use strict';var _=require(_0x3774('0x0'));var util=require(_0x3774('0x1'));var logger=require('../../config/logger')(_0x3774('0x2'));var moment=require(_0x3774('0x3'));var BPromise=require(_0x3774('0x4'));var rp=require(_0x3774('0x5'));var fs=require('fs');var path=require(_0x3774('0x6'));var rimraf=require(_0x3774('0x7'));var config=require(_0x3774('0x8'));var attributes=require(_0x3774('0x9'));module[_0x3774('0xa')]=function(_0xf6d966,_0x31c551){return _0xf6d966[_0x3774('0xb')](_0x3774('0xc'),attributes,{'tableName':_0x3774('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index eb49f35..ad8f2bb 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3210=['error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3203c7,_0x526793){var _0x46ce95=function(_0x2a8c48){while(--_0x2a8c48){_0x3203c7['push'](_0x3203c7['shift']());}};_0x46ce95(++_0x526793);}(_0x3210,0x9c));var _0x0321=function(_0x29ed8e,_0x5d3185){_0x29ed8e=_0x29ed8e-0x0;var _0x26a6ae=_0x3210[_0x29ed8e];return _0x26a6ae;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var moment=require(_0x0321('0x2'));var BPromise=require(_0x0321('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0321('0x4'));var db=require(_0x0321('0x5'))['db'];var utils=require(_0x0321('0x6'));var logger=require(_0x0321('0x7'))(_0x0321('0x8'));var config=require(_0x0321('0x9'));var jayson=require(_0x0321('0xa'));var client=jayson[_0x0321('0xb')][_0x0321('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dc59d,_0x3cebd8,_0x4d9e29){return new BPromise(function(_0x16c5c6,_0x84bd2d){return client[_0x0321('0xd')](_0x1dc59d,_0x4d9e29)[_0x0321('0xe')](function(_0x8a0bb8){logger['info'](_0x0321('0xf'),_0x3cebd8,_0x0321('0x10'));logger[_0x0321('0x11')](_0x0321('0x12'),_0x3cebd8,_0x0321('0x10'),JSON['stringify'](_0x8a0bb8));if(_0x8a0bb8[_0x0321('0x13')]){if(_0x8a0bb8[_0x0321('0x13')][_0x0321('0x14')]===0x1f4){logger['error'](_0x0321('0xf'),_0x3cebd8,_0x8a0bb8[_0x0321('0x13')][_0x0321('0x15')]);return _0x84bd2d(_0x8a0bb8[_0x0321('0x13')][_0x0321('0x15')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x3cebd8,_0x8a0bb8[_0x0321('0x13')][_0x0321('0x15')]);return _0x16c5c6(_0x8a0bb8[_0x0321('0x13')][_0x0321('0x15')]);}else{logger[_0x0321('0x16')](_0x0321('0xf'),_0x3cebd8,_0x0321('0x10'));_0x16c5c6(_0x8a0bb8[_0x0321('0x17')][_0x0321('0x15')]);}})[_0x0321('0x18')](function(_0x37163b){logger[_0x0321('0x13')](_0x0321('0xf'),_0x3cebd8,_0x37163b);_0x84bd2d(_0x37163b);});});} \ No newline at end of file +var _0x7026=['bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util'];(function(_0x4b5cd2,_0x2972aa){var _0x28597d=function(_0xb18513){while(--_0xb18513){_0x4b5cd2['push'](_0x4b5cd2['shift']());}};_0x28597d(++_0x2972aa);}(_0x7026,0x152));var _0x6702=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7026[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x6702('0x0'));var util=require(_0x6702('0x1'));var moment=require('moment');var BPromise=require(_0x6702('0x2'));var rs=require(_0x6702('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6702('0x4'))(_0x6702('0x5'));var config=require('../../config/environment');var jayson=require(_0x6702('0x6'));var client=jayson[_0x6702('0x7')][_0x6702('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d15b,_0x5d6384,_0x52cfef){return new BPromise(function(_0x59eafa,_0x1e531a){return client[_0x6702('0x9')](_0x2d15b,_0x52cfef)[_0x6702('0xa')](function(_0x30261b){logger[_0x6702('0xb')](_0x6702('0xc'),_0x5d6384,_0x6702('0xd'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5d6384,_0x6702('0xd'),JSON['stringify'](_0x30261b));if(_0x30261b[_0x6702('0xe')]){if(_0x30261b['error']['code']===0x1f4){logger['error'](_0x6702('0xc'),_0x5d6384,_0x30261b[_0x6702('0xe')]['message']);return _0x1e531a(_0x30261b['error'][_0x6702('0xf')]);}logger[_0x6702('0xe')](_0x6702('0xc'),_0x5d6384,_0x30261b[_0x6702('0xe')][_0x6702('0xf')]);return _0x59eafa(_0x30261b[_0x6702('0xe')][_0x6702('0xf')]);}else{logger[_0x6702('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x5d6384,_0x6702('0xd'));_0x59eafa(_0x30261b[_0x6702('0x10')][_0x6702('0xf')]);}})['catch'](function(_0x517c5f){logger[_0x6702('0xe')](_0x6702('0xc'),_0x5d6384,_0x517c5f);_0x1e531a(_0x517c5f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6c06d6b..231ef1f 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4ad8b8,_0x353932){var _0x4ce076=function(_0x88ef91){while(--_0x88ef91){_0x4ad8b8['push'](_0x4ad8b8['shift']());}};_0x4ce076(++_0x353932);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f571d,_0x4b1af2){_0x2f571d=_0x2f571d-0x0;var _0x1f1eef=_0xedd9[_0x2f571d];return _0x1f1eef;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f4097,_0x5b66ef){var _0x7ec05d=function(_0x1d576c){while(--_0x1d576c){_0x4f4097['push'](_0x4f4097['shift']());}};_0x7ec05d(++_0x5b66ef);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 541384b..9414b31 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34b7=['sequelize','exports','INTEGER'];(function(_0x4f9649,_0x5c63d4){var _0x5134a3=function(_0x59aef4){while(--_0x59aef4){_0x4f9649['push'](_0x4f9649['shift']());}};_0x5134a3(++_0x5c63d4);}(_0x34b7,0x8d));var _0x734b=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x34b7[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x734b('0x0'));module[_0x734b('0x1')]={'penalty':{'type':Sequelize[_0x734b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1643=['INTEGER','exports'];(function(_0x2fccab,_0xd11ec1){var _0x5026c9=function(_0x11e14a){while(--_0x11e14a){_0x2fccab['push'](_0x2fccab['shift']());}};_0x5026c9(++_0xd11ec1);}(_0x1643,0x11b));var _0x3164=function(_0x1e3028,_0x1cb8ee){_0x1e3028=_0x1e3028-0x0;var _0x313e38=_0x1643[_0x1e3028];return _0x313e38;};'use strict';var Sequelize=require('sequelize');module[_0x3164('0x0')]={'penalty':{'type':Sequelize[_0x3164('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3164('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 45180ef..f6c4f66 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc19=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5773c6,_0x540735){var _0x5d5136=function(_0x4b761d){while(--_0x4b761d){_0x5773c6['push'](_0x5773c6['shift']());}};_0x5d5136(++_0x540735);}(_0xcc19,0x1da));var _0x9cc1=function(_0x1dabf0,_0xd6ec46){_0x1dabf0=_0x1dabf0-0x0;var _0x197431=_0xcc19[_0x1dabf0];return _0x197431;};'use strict';var _=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var logger=require(_0x9cc1('0x2'))(_0x9cc1('0x3'));var moment=require(_0x9cc1('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cc1('0x5'));var fs=require('fs');var path=require(_0x9cc1('0x6'));var rimraf=require(_0x9cc1('0x7'));var config=require(_0x9cc1('0x8'));var attributes=require(_0x9cc1('0x9'));module[_0x9cc1('0xa')]=function(_0x662087,_0x2ab1d7){return _0x662087['define']('UserFaxQueue',attributes,{'tableName':_0x9cc1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30a5=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x55802c,_0x4689cc){var _0x3b12ef=function(_0x4e7aef){while(--_0x4e7aef){_0x55802c['push'](_0x55802c['shift']());}};_0x3b12ef(++_0x4689cc);}(_0x30a5,0xa8));var _0x530a=function(_0x34bfd8,_0x24eaa3){_0x34bfd8=_0x34bfd8-0x0;var _0x122c91=_0x30a5[_0x34bfd8];return _0x122c91;};'use strict';var _=require(_0x530a('0x0'));var util=require(_0x530a('0x1'));var logger=require(_0x530a('0x2'))('api');var moment=require(_0x530a('0x3'));var BPromise=require(_0x530a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x530a('0x5'));var rimraf=require(_0x530a('0x6'));var config=require(_0x530a('0x7'));var attributes=require(_0x530a('0x8'));module[_0x530a('0x9')]=function(_0x43b301,_0x240543){return _0x43b301[_0x530a('0xa')](_0x530a('0xb'),attributes,{'tableName':_0x530a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index cff264f..24a289e 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a01=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xcb70e6,_0x196e2c){var _0x28e755=function(_0x3918c6){while(--_0x3918c6){_0xcb70e6['push'](_0xcb70e6['shift']());}};_0x28e755(++_0x196e2c);}(_0x4a01,0xfd));var _0x14a0=function(_0x46dc23,_0x6c87a8){_0x46dc23=_0x46dc23-0x0;var _0x54199f=_0x4a01[_0x46dc23];return _0x54199f;};'use strict';var _=require(_0x14a0('0x0'));var util=require('util');var moment=require(_0x14a0('0x1'));var BPromise=require(_0x14a0('0x2'));var rs=require(_0x14a0('0x3'));var fs=require('fs');var Redis=require(_0x14a0('0x4'));var db=require(_0x14a0('0x5'))['db'];var utils=require(_0x14a0('0x6'));var logger=require(_0x14a0('0x7'))(_0x14a0('0x8'));var config=require(_0x14a0('0x9'));var jayson=require(_0x14a0('0xa'));var client=jayson[_0x14a0('0xb')][_0x14a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x515686,_0x2bcdfd,_0xe90b79){return new BPromise(function(_0x412996,_0x3c341b){return client[_0x14a0('0xd')](_0x515686,_0xe90b79)[_0x14a0('0xe')](function(_0x42ed6a){logger[_0x14a0('0xf')](_0x14a0('0x10'),_0x2bcdfd,_0x14a0('0x11'));logger[_0x14a0('0x12')](_0x14a0('0x13'),_0x2bcdfd,_0x14a0('0x11'),JSON[_0x14a0('0x14')](_0x42ed6a));if(_0x42ed6a[_0x14a0('0x15')]){if(_0x42ed6a['error'][_0x14a0('0x16')]===0x1f4){logger[_0x14a0('0x15')](_0x14a0('0x10'),_0x2bcdfd,_0x42ed6a[_0x14a0('0x15')][_0x14a0('0x17')]);return _0x3c341b(_0x42ed6a[_0x14a0('0x15')]['message']);}logger['error'](_0x14a0('0x10'),_0x2bcdfd,_0x42ed6a[_0x14a0('0x15')][_0x14a0('0x17')]);return _0x412996(_0x42ed6a[_0x14a0('0x15')][_0x14a0('0x17')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2bcdfd,_0x14a0('0x11'));_0x412996(_0x42ed6a[_0x14a0('0x18')][_0x14a0('0x17')]);}})[_0x14a0('0x19')](function(_0x8235a4){logger['error'](_0x14a0('0x10'),_0x2bcdfd,_0x8235a4);_0x3c341b(_0x8235a4);});});} \ No newline at end of file +var _0xa00b=['jayson/promise','client','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ab901,_0x40a33e){var _0xbd4e4a=function(_0xf9beab){while(--_0xf9beab){_0x5ab901['push'](_0x5ab901['shift']());}};_0xbd4e4a(++_0x40a33e);}(_0xa00b,0x6f));var _0xba00=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa00b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xba00('0x0'));var util=require(_0xba00('0x1'));var moment=require(_0xba00('0x2'));var BPromise=require(_0xba00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba00('0x4'));var db=require(_0xba00('0x5'))['db'];var utils=require(_0xba00('0x6'));var logger=require(_0xba00('0x7'))(_0xba00('0x8'));var config=require('../../config/environment');var jayson=require(_0xba00('0x9'));var client=jayson[_0xba00('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x168171,_0x3f0fc0,_0x2d98f3){return new BPromise(function(_0x3030bf,_0x3c7004){return client['request'](_0x168171,_0x2d98f3)['then'](function(_0x17ba40){logger['info'](_0xba00('0xb'),_0x3f0fc0,_0xba00('0xc'));logger[_0xba00('0xd')](_0xba00('0xe'),_0x3f0fc0,_0xba00('0xc'),JSON[_0xba00('0xf')](_0x17ba40));if(_0x17ba40['error']){if(_0x17ba40[_0xba00('0x10')]['code']===0x1f4){logger[_0xba00('0x10')](_0xba00('0xb'),_0x3f0fc0,_0x17ba40[_0xba00('0x10')][_0xba00('0x11')]);return _0x3c7004(_0x17ba40[_0xba00('0x10')][_0xba00('0x11')]);}logger[_0xba00('0x10')](_0xba00('0xb'),_0x3f0fc0,_0x17ba40['error'][_0xba00('0x11')]);return _0x3030bf(_0x17ba40[_0xba00('0x10')]['message']);}else{logger[_0xba00('0x12')](_0xba00('0xb'),_0x3f0fc0,_0xba00('0xc'));_0x3030bf(_0x17ba40['result'][_0xba00('0x11')]);}})[_0xba00('0x13')](function(_0x43d296){logger[_0xba00('0x10')](_0xba00('0xb'),_0x3f0fc0,_0x43d296);_0x3c7004(_0x43d296);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 58d72fe..f429514 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x27b56d,_0x4ab96a){var _0x443280=function(_0x1ce965){while(--_0x1ce965){_0x27b56d['push'](_0x27b56d['shift']());}};_0x443280(++_0x4ab96a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x135618,_0x3df26a){var _0x26ed1e=function(_0xd9c677){while(--_0xd9c677){_0x135618['push'](_0x135618['shift']());}};_0x26ed1e(++_0x3df26a);}(_0x70e0,0x17b));var _0x070e=function(_0x310b46,_0x4c2db2){_0x310b46=_0x310b46-0x0;var _0x2b032b=_0x70e0[_0x310b46];return _0x2b032b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9ca3d59..ae15f3f 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5991=['exports','INTEGER','sequelize'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x5991,0x1f4));var _0x1599=function(_0x2f8177,_0x1bb2a9){_0x2f8177=_0x2f8177-0x0;var _0x249cb4=_0x5991[_0x2f8177];return _0x249cb4;};'use strict';var Sequelize=require(_0x1599('0x0'));module[_0x1599('0x1')]={'penalty':{'type':Sequelize[_0x1599('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc27=['sequelize','INTEGER'];(function(_0x33e915,_0x8f0931){var _0x5717e0=function(_0x16fc75){while(--_0x16fc75){_0x33e915['push'](_0x33e915['shift']());}};_0x5717e0(++_0x8f0931);}(_0xfc27,0x158));var _0x7fc2=function(_0x3ae9f,_0x122b0e){_0x3ae9f=_0x3ae9f-0x0;var _0x1c0b3f=_0xfc27[_0x3ae9f];return _0x1c0b3f;};'use strict';var Sequelize=require(_0x7fc2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7fc2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 2632869..35d27cc 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9ca=['path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4060b4,_0x82eb25){var _0x32aaa1=function(_0x8c91af){while(--_0x8c91af){_0x4060b4['push'](_0x4060b4['shift']());}};_0x32aaa1(++_0x82eb25);}(_0xf9ca,0x69));var _0xaf9c=function(_0x590f41,_0x1ce5a2){_0x590f41=_0x590f41-0x0;var _0x448c6a=_0xf9ca[_0x590f41];return _0x448c6a;};'use strict';var _=require(_0xaf9c('0x0'));var util=require(_0xaf9c('0x1'));var logger=require(_0xaf9c('0x2'))('api');var moment=require(_0xaf9c('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf9c('0x4'));var fs=require('fs');var path=require(_0xaf9c('0x5'));var rimraf=require(_0xaf9c('0x6'));var config=require(_0xaf9c('0x7'));var attributes=require(_0xaf9c('0x8'));module['exports']=function(_0x486807,_0x4ca301){return _0x486807[_0xaf9c('0x9')](_0xaf9c('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5ec=['user_has_mail_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x426a98,_0x978d72){var _0x2d5495=function(_0x45cfed){while(--_0x45cfed){_0x426a98['push'](_0x426a98['shift']());}};_0x2d5495(++_0x978d72);}(_0xf5ec,0x11f));var _0xcf5e=function(_0x17558e,_0x2cd4cb){_0x17558e=_0x17558e-0x0;var _0x2b5d3e=_0xf5ec[_0x17558e];return _0x2b5d3e;};'use strict';var _=require(_0xcf5e('0x0'));var util=require('util');var logger=require(_0xcf5e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcf5e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf5e('0x3'));var rimraf=require(_0xcf5e('0x4'));var config=require(_0xcf5e('0x5'));var attributes=require(_0xcf5e('0x6'));module[_0xcf5e('0x7')]=function(_0x56bab3,_0x4b309f){return _0x56bab3[_0xcf5e('0x8')](_0xcf5e('0x9'),attributes,{'tableName':_0xcf5e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 38a9d0f..5330a14 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x316587,_0x5bf183){var _0x397f8b=function(_0x448272){while(--_0x448272){_0x316587['push'](_0x316587['shift']());}};_0x397f8b(++_0x5bf183);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x47b63a,_0x3a3c6f){_0x47b63a=_0x47b63a-0x0;var _0x19e9ce=_0x7fbe[_0x47b63a];return _0x19e9ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7217,0x19e));var _0x7721=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7217[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 585e7cd..e1530a3 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0db8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path'];(function(_0x546328,_0x56dd97){var _0x1aeddf=function(_0x755e2e){while(--_0x755e2e){_0x546328['push'](_0x546328['shift']());}};_0x1aeddf(++_0x56dd97);}(_0x0db8,0x165));var _0x80db=function(_0x31ddff,_0x332c4f){_0x31ddff=_0x31ddff-0x0;var _0xabf5b=_0x0db8[_0x31ddff];return _0xabf5b;};'use strict';var multer=require(_0x80db('0x0'));var util=require(_0x80db('0x1'));var path=require(_0x80db('0x2'));var timeout=require('connect-timeout');var express=require(_0x80db('0x3'));var router=express[_0x80db('0x4')]();var fs_extra=require(_0x80db('0x5'));var auth=require(_0x80db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x80db('0x7'));var controller=require(_0x80db('0x8'));router['post']('/',auth[_0x80db('0x9')](),controller[_0x80db('0xa')]);module[_0x80db('0xb')]=router; \ No newline at end of file +var _0xc442=['isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post'];(function(_0x4dc99e,_0x19137f){var _0x4ee0e3=function(_0x3f3231){while(--_0x3f3231){_0x4dc99e['push'](_0x4dc99e['shift']());}};_0x4ee0e3(++_0x19137f);}(_0xc442,0xd3));var _0x2c44=function(_0xa463b9,_0x4aeb9c){_0xa463b9=_0xa463b9-0x0;var _0x2daf90=_0xc442[_0xa463b9];return _0x2daf90;};'use strict';var multer=require('multer');var util=require(_0x2c44('0x0'));var path=require(_0x2c44('0x1'));var timeout=require(_0x2c44('0x2'));var express=require(_0x2c44('0x3'));var router=express[_0x2c44('0x4')]();var fs_extra=require(_0x2c44('0x5'));var auth=require(_0x2c44('0x6'));var interaction=require(_0x2c44('0x7'));var config=require(_0x2c44('0x8'));var controller=require('./userNotification.controller');router[_0x2c44('0x9')]('/',auth[_0x2c44('0xa')](),controller[_0x2c44('0xb')]);module[_0x2c44('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7b8d04b..07428ff 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb059=['exports','TEXT','STRING','sequelize'];(function(_0x2558cc,_0x63d7){var _0x41b53e=function(_0xe88f22){while(--_0xe88f22){_0x2558cc['push'](_0x2558cc['shift']());}};_0x41b53e(++_0x63d7);}(_0xb059,0xdb));var _0x9b05=function(_0x363af4,_0x3f057d){_0x363af4=_0x363af4-0x0;var _0x24bbf2=_0xb059[_0x363af4];return _0x24bbf2;};'use strict';var Sequelize=require(_0x9b05('0x0'));module[_0x9b05('0x1')]={'body':{'type':Sequelize[_0x9b05('0x2')]},'senderName':{'type':Sequelize[_0x9b05('0x3')]},'recipientsId':{'type':Sequelize[_0x9b05('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x4c2f=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0xad426,_0x336a05){var _0x401de1=function(_0x10de1a){while(--_0x10de1a){_0xad426['push'](_0xad426['shift']());}};_0x401de1(++_0x336a05);}(_0x4c2f,0x1b7));var _0xf4c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c2f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf4c2('0x0'));module['exports']={'body':{'type':Sequelize[_0xf4c2('0x1')]},'senderName':{'type':Sequelize[_0xf4c2('0x2')]},'recipientsId':{'type':Sequelize[_0xf4c2('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xf4c2('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ea26985..9ee41d3 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e37=['toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','User','union','replace','Queue','ids','all','flatten','map','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','end','error','name','send','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','some','includes','model'];(function(_0x88ffd4,_0x25f7e6){var _0x528f9c=function(_0x166382){while(--_0x166382){_0x88ffd4['push'](_0x88ffd4['shift']());}};_0x528f9c(++_0x25f7e6);}(_0x6e37,0x1ee));var _0x76e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e37[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x76e3('0x0'));var rimraf=require(_0x76e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76e3('0x2'));var rp=require('request-promise');var moment=require(_0x76e3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x76e3('0x4'));var util=require(_0x76e3('0x5'));var path=require(_0x76e3('0x6'));var sox=require(_0x76e3('0x7'));var csv=require(_0x76e3('0x8'));var ejs=require(_0x76e3('0x9'));var fs=require('fs');var fs_extra=require(_0x76e3('0xa'));var _=require(_0x76e3('0xb'));var squel=require(_0x76e3('0xc'));var crypto=require(_0x76e3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76e3('0x8'));var querystring=require(_0x76e3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x76e3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x76e3('0x10'));var hardwareService=require(_0x76e3('0x11'));var logger=require(_0x76e3('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x76e3('0x13'))['db'];config[_0x76e3('0x14')]=_[_0x76e3('0x15')](config['redis'],{'host':_0x76e3('0x16'),'port':0x18eb});var socket=require(_0x76e3('0x17'))(new Redis(config[_0x76e3('0x14')]));require(_0x76e3('0x18'))[_0x76e3('0x19')](socket);function respondWithStatusCode(_0x26127c,_0x4b984b){_0x4b984b=_0x4b984b||0xcc;return function(_0x34df66){if(_0x34df66){return _0x26127c[_0x76e3('0x1a')](_0x4b984b);}return _0x26127c[_0x76e3('0x1b')](_0x4b984b)['end']();};}function respondWithResult(_0x48a538,_0x54681e){_0x54681e=_0x54681e||0xc8;return function(_0x29b57d){if(_0x29b57d){return _0x48a538[_0x76e3('0x1b')](_0x54681e)['json'](_0x29b57d);}};}function respondWithFilteredResult(_0x51dd47,_0x2b625a){return function(_0x5a2426){if(_0x5a2426){var _0x52a476=typeof _0x2b625a[_0x76e3('0x1c')]===_0x76e3('0x1d')&&typeof _0x2b625a['limit']===_0x76e3('0x1d');var _0x256c3a=_0x5a2426['count'];var _0x58059c=_0x52a476?0x0:_0x2b625a['offset'];var _0x380ae6=_0x52a476?_0x5a2426['count']:_0x2b625a[_0x76e3('0x1c')]+_0x2b625a[_0x76e3('0x1e')];var _0x2bf959;if(_0x380ae6>=_0x256c3a){_0x380ae6=_0x256c3a;_0x2bf959=0xc8;}else{_0x2bf959=0xce;}_0x51dd47[_0x76e3('0x1b')](_0x2bf959);return _0x51dd47[_0x76e3('0x1f')](_0x76e3('0x20'),_0x58059c+'-'+_0x380ae6+'/'+_0x256c3a)[_0x76e3('0x21')](_0x5a2426);}return null;};}function patchUpdates(_0x5e0d60){return function(_0x147a0c){try{jsonpatch[_0x76e3('0x22')](_0x147a0c,_0x5e0d60,!![]);}catch(_0xf7883d){return BPromise['reject'](_0xf7883d);}return _0x147a0c[_0x76e3('0x23')]();};}function saveUpdates(_0x3538bc,_0x3cb648){return function(_0x459bd1){if(_0x459bd1){return _0x459bd1[_0x76e3('0x24')](_0x3538bc)[_0x76e3('0x25')](function(_0x1929df){return _0x1929df;});}return null;};}function removeEntity(_0x365512,_0xbb0e57){return function(_0x5ccc62){if(_0x5ccc62){return _0x5ccc62['destroy']()[_0x76e3('0x25')](function(){_0x365512['status'](0xcc)[_0x76e3('0x26')]();});}};}function handleEntityNotFound(_0x28d257,_0x1c6184){return function(_0x3a185d){if(!_0x3a185d){_0x28d257['sendStatus'](0x194);}return _0x3a185d;};}function handleError(_0x2c9745,_0x11ae9b){_0x11ae9b=_0x11ae9b||0x1f4;return function(_0x151984){logger[_0x76e3('0x27')](_0x151984['stack']);if(_0x151984[_0x76e3('0x28')]){delete _0x151984[_0x76e3('0x28')];}_0x2c9745[_0x76e3('0x1b')](_0x11ae9b)[_0x76e3('0x29')](_0x151984);};}exports['sendUserNotification']=function(_0x236fe2,_0x341144,_0x1e9427){if(!_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x2b')](_0x76e3('0x2c'))&&!_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x2b')](_0x76e3('0x2d'))){throw new db['Sequelize']['ValidationError'](_0x76e3('0x2e'));}else{if(_0x236fe2['body'][_0x76e3('0x2b')](_0x76e3('0x2d'))&&!_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x2b')](_0x76e3('0x2f'))){throw new db[(_0x76e3('0x30'))][(_0x76e3('0x31'))](_0x76e3('0x32'));}if(!_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x2b')](_0x76e3('0x33'))){throw new db[(_0x76e3('0x30'))][(_0x76e3('0x31'))](_0x76e3('0x34'));}else{try{var _0x274b1c=JSON[_0x76e3('0x35')](_0x236fe2['body']['recipients']);}catch(_0xc02b86){logger[_0x76e3('0x27')](_0xc02b86);throw new db[(_0x76e3('0x30'))]['ValidationError'](_0x76e3('0x36'));}var _0x14e75c=['chatqueue',_0x76e3('0x37'),_0x76e3('0x38'),_0x76e3('0x39'),_0x76e3('0x3a'),_0x76e3('0x3b'),'whatsappqueue','team',_0x76e3('0x3c')];if(_[_0x76e3('0x3d')](_0x274b1c,function(_0x4451a9){return!_[_0x76e3('0x3e')](_0x14e75c,_0x4451a9[_0x76e3('0x3f')][_0x76e3('0x40')]());})){throw new db['Sequelize'][(_0x76e3('0x31'))](_0x76e3('0x41'));}}}var _0x4a8e79={};_0x4a8e79['senderName']=_0x236fe2[_0x76e3('0x2a')]['hasOwnProperty'](_0x76e3('0x42'))?_0x236fe2['body'][_0x76e3('0x42')]:_0x236fe2[_0x76e3('0x3c')][_0x76e3('0x43')];_0x4a8e79[_0x76e3('0x44')]=_[_0x76e3('0x45')](_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x44')])?null:_0x236fe2[_0x76e3('0x2a')][_0x76e3('0x44')];_0x4a8e79[_0x76e3('0x46')]=_0x236fe2[_0x76e3('0x2a')]['beep']||![];_0x4a8e79['SenderId']=_0x236fe2[_0x76e3('0x3c')]['id'];return getContent(_0x236fe2[_0x76e3('0x2a')])[_0x76e3('0x25')](function(_0x4c434c){_0x4a8e79['body']=_0x4c434c;return getRecipients(_0x274b1c);})[_0x76e3('0x25')](function(_0x1fbfe6){_0x4a8e79[_0x76e3('0x47')]=_['sortBy'](_0x1fbfe6)[_0x76e3('0x48')](',');return db[_0x76e3('0x49')][_0x76e3('0x4a')](function(_0x22bf69){return db[_0x76e3('0x4b')]['create'](_0x4a8e79,{'raw':!![],'transaction':_0x22bf69})[_0x76e3('0x25')](function(_0x5046da){var _0x541b48={'sender':_0x4a8e79[_0x76e3('0x42')],'description':_0x4a8e79[_0x76e3('0x44')],'content':_0x4a8e79['body'],'beep':_0x4a8e79[_0x76e3('0x46')]};_0x1fbfe6[_0x76e3('0x4c')](function(_0x2934a9){_0x541b48[_0x76e3('0x4d')]=_0x2934a9;socket[_0x76e3('0x4e')](_0x76e3('0x4f'),_0x541b48);});return _0x5046da;});});})[_0x76e3('0x25')](respondWithResult(_0x341144,0xc9))[_0x76e3('0x50')](handleError(_0x341144,null));};function getContent(_0x1a18e6){return new BPromise(function(_0x44a63b,_0x4487e6){if(_0x1a18e6['text']){_0x44a63b(_0x1a18e6[_0x76e3('0x2c')]);return;}return db['Template'][_0x76e3('0x51')]({'attributes':['html'],'where':{'id':_0x1a18e6[_0x76e3('0x2d')]},'raw':!![]})[_0x76e3('0x25')](function(_0x497687){if(!_0x497687)throw new db['Sequelize']['ValidationError'](_0x76e3('0x52'));var _0x100d3b=Mustache[_0x76e3('0x53')](_0x497687[_0x76e3('0x54')],_0x1a18e6[_0x76e3('0x2f')]);_0x44a63b(_0x100d3b);})['catch'](function(_0x36a97d){_0x4487e6(_0x36a97d);});});}function getRecipients(_0x407ef6){return new BPromise(function(_0x243799,_0x1f5844){var _0x36a310=[];var _0x105c85=[];_0x407ef6['forEach'](function(_0x180a1c){var _0x464c0a=_['startCase'](_0x180a1c['model'][_0x76e3('0x40')]());if(_0x464c0a===_0x76e3('0x55')){_0x36a310=_[_0x76e3('0x56')](_0x36a310,_0x180a1c['ids']);}else{if(_[_0x76e3('0x3e')](_0x464c0a,'queue'))_0x464c0a=_0x464c0a[_0x76e3('0x57')]('queue',_0x76e3('0x58'));_0x180a1c[_0x76e3('0x59')][_0x76e3('0x4c')](function(_0x1cb89a){_0x105c85['push'](getAgents(_0x464c0a,_0x1cb89a));});}});return BPromise[_0x76e3('0x5a')](_0x105c85)[_0x76e3('0x25')](function(_0xfc3f49){_0x36a310=_[_0x76e3('0x56')](_0x36a310,_[_0x76e3('0x5b')](_0xfc3f49));_0x243799(_0x36a310);})[_0x76e3('0x50')](function(_0x54e8c6){_0x1f5844(_0x54e8c6);});});}function getAgents(_0x5f43a,_0x42536){return new BPromise(function(_0x2c7e0b,_0x59fcb2){return db[_0x5f43a][_0x76e3('0x51')]({'where':{'id':_0x42536}})[_0x76e3('0x25')](function(_0x2ae513){return _0x2ae513['getAgents']({'attributes':['id'],'raw':!![]})[_0x76e3('0x25')](function(_0x48db06){var _0x5d44f1=_[_0x76e3('0x5c')](_0x48db06,'id');_0x2c7e0b(_0x5d44f1);});})['catch'](function(_0x2a4d40){_0x59fcb2(_0x2a4d40);});});} \ No newline at end of file +var _0x7b4a=['text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','startCase','union','ids','queue','replace','forEach','push','all','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','sendUserNotification','body','hasOwnProperty'];(function(_0x18ee80,_0x2adf1c){var _0x2f60c2=function(_0x2bd265){while(--_0x2bd265){_0x18ee80['push'](_0x18ee80['shift']());}};_0x2f60c2(++_0x2adf1c);}(_0x7b4a,0x8e));var _0xa7b4=function(_0x2223be,_0x4e4034){_0x2223be=_0x2223be-0x0;var _0x453496=_0x7b4a[_0x2223be];return _0x453496;};'use strict';var emlformat=require(_0xa7b4('0x0'));var rimraf=require(_0xa7b4('0x1'));var zipdir=require(_0xa7b4('0x2'));var jsonpatch=require(_0xa7b4('0x3'));var rp=require(_0xa7b4('0x4'));var moment=require('moment');var BPromise=require(_0xa7b4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa7b4('0x6'));var sox=require(_0xa7b4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7b4('0x8'));var squel=require('squel');var crypto=require(_0xa7b4('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7b4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa7b4('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xa7b4('0xc'));var as=require(_0xa7b4('0xd'));var hardwareService=require(_0xa7b4('0xe'));var logger=require(_0xa7b4('0xf'))(_0xa7b4('0x10'));var utils=require(_0xa7b4('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7b4('0x12'))['db'];config[_0xa7b4('0x13')]=_[_0xa7b4('0x14')](config[_0xa7b4('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7b4('0x15'))(new Redis(config['redis']));require(_0xa7b4('0x16'))[_0xa7b4('0x17')](socket);function respondWithStatusCode(_0x2ab334,_0x3e94d4){_0x3e94d4=_0x3e94d4||0xcc;return function(_0x220ff5){if(_0x220ff5){return _0x2ab334[_0xa7b4('0x18')](_0x3e94d4);}return _0x2ab334[_0xa7b4('0x19')](_0x3e94d4)['end']();};}function respondWithResult(_0x1f1ad6,_0x3588d9){_0x3588d9=_0x3588d9||0xc8;return function(_0x5ebd7a){if(_0x5ebd7a){return _0x1f1ad6[_0xa7b4('0x19')](_0x3588d9)['json'](_0x5ebd7a);}};}function respondWithFilteredResult(_0x235d4a,_0x49d8a1){return function(_0x20e6d0){if(_0x20e6d0){var _0x140126=typeof _0x49d8a1['offset']===_0xa7b4('0x1a')&&typeof _0x49d8a1['limit']===_0xa7b4('0x1a');var _0x1859d8=_0x20e6d0[_0xa7b4('0x1b')];var _0x5d38a6=_0x140126?0x0:_0x49d8a1[_0xa7b4('0x1c')];var _0x420b49=_0x140126?_0x20e6d0[_0xa7b4('0x1b')]:_0x49d8a1[_0xa7b4('0x1c')]+_0x49d8a1[_0xa7b4('0x1d')];var _0x2c4133;if(_0x420b49>=_0x1859d8){_0x420b49=_0x1859d8;_0x2c4133=0xc8;}else{_0x2c4133=0xce;}_0x235d4a[_0xa7b4('0x19')](_0x2c4133);return _0x235d4a['set'](_0xa7b4('0x1e'),_0x5d38a6+'-'+_0x420b49+'/'+_0x1859d8)[_0xa7b4('0x1f')](_0x20e6d0);}return null;};}function patchUpdates(_0x2c425f){return function(_0x5026d0){try{jsonpatch[_0xa7b4('0x20')](_0x5026d0,_0x2c425f,!![]);}catch(_0x3b68ed){return BPromise[_0xa7b4('0x21')](_0x3b68ed);}return _0x5026d0[_0xa7b4('0x22')]();};}function saveUpdates(_0x58c769,_0x253dc5){return function(_0x3e9123){if(_0x3e9123){return _0x3e9123[_0xa7b4('0x23')](_0x58c769)[_0xa7b4('0x24')](function(_0x2aaaca){return _0x2aaaca;});}return null;};}function removeEntity(_0x49efc3,_0x478bad){return function(_0x25d19d){if(_0x25d19d){return _0x25d19d[_0xa7b4('0x25')]()[_0xa7b4('0x24')](function(){_0x49efc3['status'](0xcc)[_0xa7b4('0x26')]();});}};}function handleEntityNotFound(_0x5bf757,_0x38a64b){return function(_0x3fa9ca){if(!_0x3fa9ca){_0x5bf757[_0xa7b4('0x18')](0x194);}return _0x3fa9ca;};}function handleError(_0x4603b5,_0x2be053){_0x2be053=_0x2be053||0x1f4;return function(_0x201598){logger[_0xa7b4('0x27')](_0x201598[_0xa7b4('0x28')]);if(_0x201598[_0xa7b4('0x29')]){delete _0x201598[_0xa7b4('0x29')];}_0x4603b5[_0xa7b4('0x19')](_0x2be053)[_0xa7b4('0x2a')](_0x201598);};}exports[_0xa7b4('0x2b')]=function(_0x1e9a2c,_0x1aa3cc,_0x5c330a){if(!_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x2d')](_0xa7b4('0x2e'))&&!_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x2d')](_0xa7b4('0x2f'))){throw new db[(_0xa7b4('0x30'))]['ValidationError'](_0xa7b4('0x31'));}else{if(_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x2d')](_0xa7b4('0x2f'))&&!_0x1e9a2c['body'][_0xa7b4('0x2d')]('view')){throw new db[(_0xa7b4('0x30'))][(_0xa7b4('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x2d')](_0xa7b4('0x33'))){throw new db['Sequelize'][(_0xa7b4('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2199e0=JSON[_0xa7b4('0x34')](_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x33')]);}catch(_0x4788cf){logger['error'](_0x4788cf);throw new db['Sequelize'][(_0xa7b4('0x32'))](_0xa7b4('0x35'));}var _0x195ef1=[_0xa7b4('0x36'),_0xa7b4('0x37'),_0xa7b4('0x38'),'openchannelqueue',_0xa7b4('0x39'),'voicequeue',_0xa7b4('0x3a'),_0xa7b4('0x3b'),_0xa7b4('0x3c')];if(_['some'](_0x2199e0,function(_0x57c8b4){return!_[_0xa7b4('0x3d')](_0x195ef1,_0x57c8b4[_0xa7b4('0x3e')][_0xa7b4('0x3f')]());})){throw new db[(_0xa7b4('0x30'))][(_0xa7b4('0x32'))](_0xa7b4('0x40'));}}}var _0x296b4d={};_0x296b4d[_0xa7b4('0x41')]=_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x2d')](_0xa7b4('0x41'))?_0x1e9a2c[_0xa7b4('0x2c')]['senderName']:_0x1e9a2c['user'][_0xa7b4('0x42')];_0x296b4d['recipientsDescription']=_[_0xa7b4('0x43')](_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x44')])?null:_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x44')];_0x296b4d[_0xa7b4('0x45')]=_0x1e9a2c[_0xa7b4('0x2c')][_0xa7b4('0x45')]||![];_0x296b4d[_0xa7b4('0x46')]=_0x1e9a2c[_0xa7b4('0x3c')]['id'];return getContent(_0x1e9a2c['body'])[_0xa7b4('0x24')](function(_0x350eff){_0x296b4d['body']=_0x350eff;return getRecipients(_0x2199e0);})[_0xa7b4('0x24')](function(_0x2f4077){_0x296b4d['recipientsId']=_[_0xa7b4('0x47')](_0x2f4077)[_0xa7b4('0x48')](',');return db[_0xa7b4('0x49')][_0xa7b4('0x4a')](function(_0x59ab8f){return db[_0xa7b4('0x4b')]['create'](_0x296b4d,{'raw':!![],'transaction':_0x59ab8f})[_0xa7b4('0x24')](function(_0x5c64c4){var _0x55b3dd={'sender':_0x296b4d['senderName'],'description':_0x296b4d[_0xa7b4('0x44')],'content':_0x296b4d['body'],'beep':_0x296b4d['beep']};_0x2f4077['forEach'](function(_0x341646){_0x55b3dd['recipient']=_0x341646;socket[_0xa7b4('0x4c')](_0xa7b4('0x4d'),_0x55b3dd);});return _0x5c64c4;});});})[_0xa7b4('0x24')](respondWithResult(_0x1aa3cc,0xc9))[_0xa7b4('0x4e')](handleError(_0x1aa3cc,null));};function getContent(_0x1f34cb){return new BPromise(function(_0x1062ac,_0x5405c9){if(_0x1f34cb[_0xa7b4('0x2e')]){_0x1062ac(_0x1f34cb[_0xa7b4('0x2e')]);return;}return db[_0xa7b4('0x4f')][_0xa7b4('0x50')]({'attributes':['html'],'where':{'id':_0x1f34cb[_0xa7b4('0x2f')]},'raw':!![]})[_0xa7b4('0x24')](function(_0x298601){if(!_0x298601)throw new db['Sequelize']['ValidationError'](_0xa7b4('0x51'));var _0x23d3a8=Mustache[_0xa7b4('0x52')](_0x298601[_0xa7b4('0x53')],_0x1f34cb[_0xa7b4('0x54')]);_0x1062ac(_0x23d3a8);})['catch'](function(_0x1f1b2a){_0x5405c9(_0x1f1b2a);});});}function getRecipients(_0x167563){return new BPromise(function(_0x3ea077,_0x27f951){var _0x9dad8c=[];var _0x5e4235=[];_0x167563['forEach'](function(_0x1aea9e){var _0x140d1b=_[_0xa7b4('0x55')](_0x1aea9e[_0xa7b4('0x3e')][_0xa7b4('0x3f')]());if(_0x140d1b==='User'){_0x9dad8c=_[_0xa7b4('0x56')](_0x9dad8c,_0x1aea9e[_0xa7b4('0x57')]);}else{if(_[_0xa7b4('0x3d')](_0x140d1b,_0xa7b4('0x58')))_0x140d1b=_0x140d1b[_0xa7b4('0x59')](_0xa7b4('0x58'),'Queue');_0x1aea9e[_0xa7b4('0x57')][_0xa7b4('0x5a')](function(_0x5082ee){_0x5e4235[_0xa7b4('0x5b')](getAgents(_0x140d1b,_0x5082ee));});}});return BPromise[_0xa7b4('0x5c')](_0x5e4235)[_0xa7b4('0x24')](function(_0x413d93){_0x9dad8c=_[_0xa7b4('0x56')](_0x9dad8c,_['flatten'](_0x413d93));_0x3ea077(_0x9dad8c);})[_0xa7b4('0x4e')](function(_0x4c438e){_0x27f951(_0x4c438e);});});}function getAgents(_0x289815,_0x58c24b){return new BPromise(function(_0x1b07ed,_0x2037fc){return db[_0x289815][_0xa7b4('0x50')]({'where':{'id':_0x58c24b}})['then'](function(_0x3cfd4f){return _0x3cfd4f[_0xa7b4('0x5d')]({'attributes':['id'],'raw':!![]})[_0xa7b4('0x24')](function(_0x527102){var _0x10d104=_['map'](_0x527102,'id');_0x1b07ed(_0x10d104);});})[_0xa7b4('0x4e')](function(_0x8550ae){_0x2037fc(_0x8550ae);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 5a358cb..348f7ed 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb784=['../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x1f7962,_0x181f16){var _0x3af491=function(_0x504ecf){while(--_0x504ecf){_0x1f7962['push'](_0x1f7962['shift']());}};_0x3af491(++_0x181f16);}(_0xb784,0x13a));var _0x4b78=function(_0x1c9421,_0xb4f1fa){_0x1c9421=_0x1c9421-0x0;var _0x4cd5ff=_0xb784[_0x1c9421];return _0x4cd5ff;};'use strict';var EventEmitter=require(_0x4b78('0x0'));var UserNotification=require(_0x4b78('0x1'))['db'][_0x4b78('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4b78('0x3')](0x0);var events={'afterCreate':_0x4b78('0x4'),'afterUpdate':'update','afterDestroy':_0x4b78('0x5')};function emitEvent(_0x41d389){return function(_0x28aa10,_0x140c03,_0x286db5){UserNotificationEvents[_0x4b78('0x6')](_0x41d389+':'+_0x28aa10['id'],_0x28aa10);UserNotificationEvents[_0x4b78('0x6')](_0x41d389,_0x28aa10);_0x286db5(null);};}for(var e in events){if(events[_0x4b78('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x4b78('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x2881=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1292ce,_0x1da7ff){var _0x3181ff=function(_0x27397){while(--_0x27397){_0x1292ce['push'](_0x1292ce['shift']());}};_0x3181ff(++_0x1da7ff);}(_0x2881,0x155));var _0x1288=function(_0xb5ae9b,_0x5b66b8){_0xb5ae9b=_0xb5ae9b-0x0;var _0xdb4d1=_0x2881[_0xb5ae9b];return _0xdb4d1;};'use strict';var EventEmitter=require(_0x1288('0x0'));var UserNotification=require(_0x1288('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1288('0x2')](0x0);var events={'afterCreate':_0x1288('0x3'),'afterUpdate':'update','afterDestroy':_0x1288('0x4')};function emitEvent(_0x2e4005){return function(_0x9264c5,_0x50931b,_0x59835a){UserNotificationEvents[_0x1288('0x5')](_0x2e4005+':'+_0x9264c5['id'],_0x9264c5);UserNotificationEvents[_0x1288('0x5')](_0x2e4005,_0x9264c5);_0x59835a(null);};}for(var e in events){if(events[_0x1288('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x1288('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 85cdd48..601c5d5 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda67=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xda67,0x151));var _0x7da6=function(_0x2a0dda,_0xf4d31e){_0x2a0dda=_0x2a0dda-0x0;var _0x29c498=_0xda67[_0x2a0dda];return _0x29c498;};'use strict';var _=require(_0x7da6('0x0'));var util=require('util');var logger=require(_0x7da6('0x1'))('api');var moment=require(_0x7da6('0x2'));var BPromise=require('bluebird');var rp=require(_0x7da6('0x3'));var fs=require('fs');var path=require(_0x7da6('0x4'));var rimraf=require(_0x7da6('0x5'));var config=require(_0x7da6('0x6'));var attributes=require(_0x7da6('0x7'));module[_0x7da6('0x8')]=function(_0x1f0fde,_0x4e1bb8){return _0x1f0fde['define'](_0x7da6('0x9'),attributes,{'tableName':_0x7da6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7da6('0xb'),'collate':_0x7da6('0xc')});}; \ No newline at end of file +var _0xaa1c=['exports','define','UserNotification','userNotifications','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x849721,_0x59565f){var _0x458518=function(_0xeff1cc){while(--_0xeff1cc){_0x849721['push'](_0x849721['shift']());}};_0x458518(++_0x59565f);}(_0xaa1c,0x170));var _0xcaa1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaa1c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcaa1('0x0'));var util=require(_0xcaa1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcaa1('0x2'));var BPromise=require(_0xcaa1('0x3'));var rp=require(_0xcaa1('0x4'));var fs=require('fs');var path=require(_0xcaa1('0x5'));var rimraf=require(_0xcaa1('0x6'));var config=require(_0xcaa1('0x7'));var attributes=require(_0xcaa1('0x8'));module[_0xcaa1('0x9')]=function(_0x4b4f18,_0x95e752){return _0x4b4f18[_0xcaa1('0xa')](_0xcaa1('0xb'),attributes,{'tableName':_0xcaa1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1d3d91c..192ea5f 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3ce=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4475fa,_0x539a42){var _0x47fa6b=function(_0x5ce84a){while(--_0x5ce84a){_0x4475fa['push'](_0x4475fa['shift']());}};_0x47fa6b(++_0x539a42);}(_0xd3ce,0xad));var _0xed3c=function(_0x2656aa,_0x205687){_0x2656aa=_0x2656aa-0x0;var _0x295add=_0xd3ce[_0x2656aa];return _0x295add;};'use strict';var _=require(_0xed3c('0x0'));var util=require(_0xed3c('0x1'));var moment=require(_0xed3c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed3c('0x3'))['db'];var utils=require(_0xed3c('0x4'));var logger=require(_0xed3c('0x5'))(_0xed3c('0x6'));var config=require(_0xed3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed3c('0x8')][_0xed3c('0x9')]({'port':0x232a});config[_0xed3c('0xa')]=_[_0xed3c('0xb')](config[_0xed3c('0xa')],{'host':_0xed3c('0xc'),'port':0x18eb});var socket=require(_0xed3c('0xd'))(new Redis(config[_0xed3c('0xa')]));require('./userNotification.socket')[_0xed3c('0xe')](socket);function respondWithRpcPromise(_0x4f0959,_0xbb63ac,_0x2285ff){return new BPromise(function(_0x5f0a93,_0x1c8bba){return client['request'](_0x4f0959,_0x2285ff)[_0xed3c('0xf')](function(_0x1511d3){logger[_0xed3c('0x10')](_0xed3c('0x11'),_0xbb63ac,_0xed3c('0x12'));logger[_0xed3c('0x13')](_0xed3c('0x14'),_0xbb63ac,'request\x20sent',JSON[_0xed3c('0x15')](_0x1511d3));if(_0x1511d3['error']){if(_0x1511d3['error'][_0xed3c('0x16')]===0x1f4){logger[_0xed3c('0x17')](_0xed3c('0x11'),_0xbb63ac,_0x1511d3['error'][_0xed3c('0x18')]);return _0x1c8bba(_0x1511d3[_0xed3c('0x17')][_0xed3c('0x18')]);}logger['error'](_0xed3c('0x11'),_0xbb63ac,_0x1511d3[_0xed3c('0x17')][_0xed3c('0x18')]);return _0x5f0a93(_0x1511d3['error'][_0xed3c('0x18')]);}else{logger[_0xed3c('0x10')](_0xed3c('0x11'),_0xbb63ac,_0xed3c('0x12'));_0x5f0a93(_0x1511d3[_0xed3c('0x19')][_0xed3c('0x18')]);}})['catch'](function(_0x282bdc){logger['error']('UserNotification,\x20%s,\x20%s',_0xbb63ac,_0x282bdc);_0x1c8bba(_0x282bdc);});});} \ No newline at end of file +var _0x00e7=['./userNotification.socket','register','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x366a05,_0x3fb8f8){var _0x97b08e=function(_0xe4a5de){while(--_0xe4a5de){_0x366a05['push'](_0x366a05['shift']());}};_0x97b08e(++_0x3fb8f8);}(_0x00e7,0xcd));var _0x700e=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0x00e7[_0x4e6cbb];return _0x15ced4;};'use strict';var _=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var moment=require(_0x700e('0x2'));var BPromise=require('bluebird');var rs=require(_0x700e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x700e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x700e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x700e('0x6')]['http']({'port':0x232a});config[_0x700e('0x7')]=_[_0x700e('0x8')](config[_0x700e('0x7')],{'host':_0x700e('0x9'),'port':0x18eb});var socket=require(_0x700e('0xa'))(new Redis(config[_0x700e('0x7')]));require(_0x700e('0xb'))[_0x700e('0xc')](socket);function respondWithRpcPromise(_0x1f61a7,_0x5643ec,_0x2ad420){return new BPromise(function(_0x7d3366,_0x23b4d6){return client[_0x700e('0xd')](_0x1f61a7,_0x2ad420)[_0x700e('0xe')](function(_0xe2d728){logger[_0x700e('0xf')]('UserNotification,\x20%s,\x20%s',_0x5643ec,_0x700e('0x10'));logger['debug'](_0x700e('0x11'),_0x5643ec,_0x700e('0x10'),JSON['stringify'](_0xe2d728));if(_0xe2d728[_0x700e('0x12')]){if(_0xe2d728['error'][_0x700e('0x13')]===0x1f4){logger[_0x700e('0x12')](_0x700e('0x14'),_0x5643ec,_0xe2d728[_0x700e('0x12')][_0x700e('0x15')]);return _0x23b4d6(_0xe2d728['error'][_0x700e('0x15')]);}logger[_0x700e('0x12')](_0x700e('0x14'),_0x5643ec,_0xe2d728[_0x700e('0x12')][_0x700e('0x15')]);return _0x7d3366(_0xe2d728[_0x700e('0x12')]['message']);}else{logger[_0x700e('0xf')](_0x700e('0x14'),_0x5643ec,_0x700e('0x10'));_0x7d3366(_0xe2d728[_0x700e('0x16')]['message']);}})[_0x700e('0x17')](function(_0x53dd8e){logger[_0x700e('0x12')](_0x700e('0x14'),_0x5643ec,_0x53dd8e);_0x23b4d6(_0x53dd8e);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4c85d00..3d827de 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd9a=['length','userNotification:','./userNotification.events','save','remove','update','removeListener'];(function(_0x469e48,_0x57d2b6){var _0xa55adb=function(_0x373c1f){while(--_0x373c1f){_0x469e48['push'](_0x469e48['shift']());}};_0xa55adb(++_0x57d2b6);}(_0xdd9a,0xc6));var _0xadd9=function(_0x574f33,_0x569846){_0x574f33=_0x574f33-0x0;var _0x39f96d=_0xdd9a[_0x574f33];return _0x39f96d;};'use strict';var UserNotificationEvents=require(_0xadd9('0x0'));var events=[_0xadd9('0x1'),_0xadd9('0x2'),_0xadd9('0x3')];function createListener(_0xd7b98c,_0x1175e9){return function(_0x15fbdf){_0x1175e9['emit'](_0xd7b98c,_0x15fbdf);};}function removeListener(_0x49a4f0,_0x5b1e59){return function(){UserNotificationEvents[_0xadd9('0x4')](_0x49a4f0,_0x5b1e59);};}exports['register']=function(_0x4ba16c){for(var _0x28291e=0x0,_0x5735bf=events[_0xadd9('0x5')];_0x28291e<_0x5735bf;_0x28291e++){var _0x924e93=events[_0x28291e];var _0x4a8661=createListener(_0xadd9('0x6')+_0x924e93,_0x4ba16c);UserNotificationEvents['on'](_0x924e93,_0x4a8661);}}; \ No newline at end of file +var _0x0f83=['userNotification:','remove','update','emit','removeListener','register','length'];(function(_0x580ccd,_0x193567){var _0x3f5c83=function(_0x5976a4){while(--_0x5976a4){_0x580ccd['push'](_0x580ccd['shift']());}};_0x3f5c83(++_0x193567);}(_0x0f83,0x1ac));var _0x30f8=function(_0x41e5a8,_0x381c5a){_0x41e5a8=_0x41e5a8-0x0;var _0x18c5f5=_0x0f83[_0x41e5a8];return _0x18c5f5;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x30f8('0x0'),_0x30f8('0x1')];function createListener(_0x40061d,_0x58dbf5){return function(_0x51684e){_0x58dbf5[_0x30f8('0x2')](_0x40061d,_0x51684e);};}function removeListener(_0x25574a,_0x22391f){return function(){UserNotificationEvents[_0x30f8('0x3')](_0x25574a,_0x22391f);};}exports[_0x30f8('0x4')]=function(_0x5b69ea){for(var _0xfdc8b7=0x0,_0x2e7887=events[_0x30f8('0x5')];_0xfdc8b7<_0x2e7887;_0xfdc8b7++){var _0x5ccd23=events[_0xfdc8b7];var _0x3ac704=createListener(_0x30f8('0x6')+_0x5ccd23,_0x5b69ea);UserNotificationEvents['on'](_0x5ccd23,_0x3ac704);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8e16545..853d64a 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2df0aa,_0x5e6d29){var _0x453216=function(_0x12a873){while(--_0x12a873){_0x2df0aa['push'](_0x2df0aa['shift']());}};_0x453216(++_0x5e6d29);}(_0xe706,0xa3));var _0x6e70=function(_0x2c32ad,_0x1a12d4){_0x2c32ad=_0x2c32ad-0x0;var _0x1d474f=_0xe706[_0x2c32ad];return _0x1d474f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 07b7cce..c836da2 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a8=['sequelize'];(function(_0x49897c,_0x2a6769){var _0x3ba034=function(_0xb012a6){while(--_0xb012a6){_0x49897c['push'](_0x49897c['shift']());}};_0x3ba034(++_0x2a6769);}(_0x45a8,0x9f));var _0x845a=function(_0x1ce8cf,_0x38f192){_0x1ce8cf=_0x1ce8cf-0x0;var _0x5b0a5d=_0x45a8[_0x1ce8cf];return _0x5b0a5d;};'use strict';var Sequelize=require(_0x845a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf304=['exports','INTEGER','sequelize'];(function(_0x30b077,_0x5a9aa7){var _0x599659=function(_0x67a7fd){while(--_0x67a7fd){_0x30b077['push'](_0x30b077['shift']());}};_0x599659(++_0x5a9aa7);}(_0xf304,0x1c4));var _0x4f30=function(_0x52753e,_0x1718bc){_0x52753e=_0x52753e-0x0;var _0x5b2cd5=_0xf304[_0x52753e];return _0x5b2cd5;};'use strict';var Sequelize=require(_0x4f30('0x0'));module[_0x4f30('0x1')]={'penalty':{'type':Sequelize[_0x4f30('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 92a8830..83ce652 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eba=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','util','api'];(function(_0x497e8c,_0x2c247c){var _0x2d64cd=function(_0x49be17){while(--_0x49be17){_0x497e8c['push'](_0x497e8c['shift']());}};_0x2d64cd(++_0x2c247c);}(_0x3eba,0x82));var _0xa3eb=function(_0x3a966e,_0x58c164){_0x3a966e=_0x3a966e-0x0;var _0x251334=_0x3eba[_0x3a966e];return _0x251334;};'use strict';var _=require('lodash');var util=require(_0xa3eb('0x0'));var logger=require('../../config/logger')(_0xa3eb('0x1'));var moment=require(_0xa3eb('0x2'));var BPromise=require(_0xa3eb('0x3'));var rp=require(_0xa3eb('0x4'));var fs=require('fs');var path=require(_0xa3eb('0x5'));var rimraf=require(_0xa3eb('0x6'));var config=require(_0xa3eb('0x7'));var attributes=require(_0xa3eb('0x8'));module[_0xa3eb('0x9')]=function(_0x5b50ad,_0x49472d){return _0x5b50ad[_0xa3eb('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xa3eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fbf=['../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x58b301,_0x45e991){var _0x2171b3=function(_0x30b475){while(--_0x30b475){_0x58b301['push'](_0x58b301['shift']());}};_0x2171b3(++_0x45e991);}(_0x5fbf,0x18d));var _0xf5fb=function(_0x5e3c1f,_0x4d7429){_0x5e3c1f=_0x5e3c1f-0x0;var _0x54194f=_0x5fbf[_0x5e3c1f];return _0x54194f;};'use strict';var _=require(_0xf5fb('0x0'));var util=require(_0xf5fb('0x1'));var logger=require(_0xf5fb('0x2'))(_0xf5fb('0x3'));var moment=require(_0xf5fb('0x4'));var BPromise=require(_0xf5fb('0x5'));var rp=require(_0xf5fb('0x6'));var fs=require('fs');var path=require(_0xf5fb('0x7'));var rimraf=require(_0xf5fb('0x8'));var config=require(_0xf5fb('0x9'));var attributes=require(_0xf5fb('0xa'));module['exports']=function(_0x117922,_0x227903){return _0x117922[_0xf5fb('0xb')](_0xf5fb('0xc'),attributes,{'tableName':_0xf5fb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 055d7ea..623ef0c 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ac0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x32f4ba,_0x2814a2){var _0x100b85=function(_0x54f074){while(--_0x54f074){_0x32f4ba['push'](_0x32f4ba['shift']());}};_0x100b85(++_0x2814a2);}(_0x7ac0,0x1e3));var _0x07ac=function(_0x3d852d,_0x475a8c){_0x3d852d=_0x3d852d-0x0;var _0x10486a=_0x7ac0[_0x3d852d];return _0x10486a;};'use strict';var _=require(_0x07ac('0x0'));var util=require(_0x07ac('0x1'));var moment=require('moment');var BPromise=require(_0x07ac('0x2'));var rs=require(_0x07ac('0x3'));var fs=require('fs');var Redis=require(_0x07ac('0x4'));var db=require(_0x07ac('0x5'))['db'];var utils=require(_0x07ac('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x07ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x07ac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544c64,_0x2f7f73,_0x56eb58){return new BPromise(function(_0x16557b,_0x57a58e){return client[_0x07ac('0x9')](_0x544c64,_0x56eb58)['then'](function(_0x5abea4){logger[_0x07ac('0xa')](_0x07ac('0xb'),_0x2f7f73,_0x07ac('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2f7f73,_0x07ac('0xc'),JSON[_0x07ac('0xd')](_0x5abea4));if(_0x5abea4[_0x07ac('0xe')]){if(_0x5abea4[_0x07ac('0xe')][_0x07ac('0xf')]===0x1f4){logger[_0x07ac('0xe')](_0x07ac('0xb'),_0x2f7f73,_0x5abea4[_0x07ac('0xe')][_0x07ac('0x10')]);return _0x57a58e(_0x5abea4[_0x07ac('0xe')][_0x07ac('0x10')]);}logger[_0x07ac('0xe')](_0x07ac('0xb'),_0x2f7f73,_0x5abea4[_0x07ac('0xe')][_0x07ac('0x10')]);return _0x16557b(_0x5abea4[_0x07ac('0xe')]['message']);}else{logger['info'](_0x07ac('0xb'),_0x2f7f73,_0x07ac('0xc'));_0x16557b(_0x5abea4['result'][_0x07ac('0x10')]);}})[_0x07ac('0x11')](function(_0x44fe13){logger[_0x07ac('0xe')](_0x07ac('0xb'),_0x2f7f73,_0x44fe13);_0x57a58e(_0x44fe13);});});} \ No newline at end of file +var _0xe02e=['util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','catch','lodash'];(function(_0x2d66a8,_0x1625a2){var _0x374b6e=function(_0x35ec72){while(--_0x35ec72){_0x2d66a8['push'](_0x2d66a8['shift']());}};_0x374b6e(++_0x1625a2);}(_0xe02e,0x125));var _0xee02=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xe02e[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xee02('0x0'));var util=require(_0xee02('0x1'));var moment=require(_0xee02('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee02('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xee02('0x4'))(_0xee02('0x5'));var config=require(_0xee02('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee02('0x7')][_0xee02('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b8460,_0x20a5d2,_0x2bbe20){return new BPromise(function(_0x3f3ede,_0x53ddb5){return client[_0xee02('0x9')](_0x4b8460,_0x2bbe20)[_0xee02('0xa')](function(_0x25016b){logger[_0xee02('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x20a5d2,_0xee02('0xc'));logger[_0xee02('0xd')](_0xee02('0xe'),_0x20a5d2,'request\x20sent',JSON[_0xee02('0xf')](_0x25016b));if(_0x25016b[_0xee02('0x10')]){if(_0x25016b[_0xee02('0x10')][_0xee02('0x11')]===0x1f4){logger[_0xee02('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x20a5d2,_0x25016b[_0xee02('0x10')][_0xee02('0x12')]);return _0x53ddb5(_0x25016b['error'][_0xee02('0x12')]);}logger[_0xee02('0x10')](_0xee02('0x13'),_0x20a5d2,_0x25016b[_0xee02('0x10')]['message']);return _0x3f3ede(_0x25016b[_0xee02('0x10')][_0xee02('0x12')]);}else{logger[_0xee02('0xb')](_0xee02('0x13'),_0x20a5d2,'request\x20sent');_0x3f3ede(_0x25016b['result'][_0xee02('0x12')]);}})[_0xee02('0x14')](function(_0x19c13b){logger[_0xee02('0x10')](_0xee02('0x13'),_0x20a5d2,_0x19c13b);_0x53ddb5(_0x19c13b);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6127805..2cd0c5b 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8222=['/:id/resources','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','getResources','create','post','clone','addSections'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x8222,0x120));var _0x2822=function(_0x3d9a0a,_0x16a9bd){_0x3d9a0a=_0x3d9a0a-0x0;var _0x15ac08=_0x8222[_0x3d9a0a];return _0x15ac08;};'use strict';var multer=require(_0x2822('0x0'));var util=require(_0x2822('0x1'));var path=require(_0x2822('0x2'));var timeout=require(_0x2822('0x3'));var express=require(_0x2822('0x4'));var router=express['Router']();var fs_extra=require(_0x2822('0x5'));var auth=require(_0x2822('0x6'));var interaction=require(_0x2822('0x7'));var config=require(_0x2822('0x8'));var controller=require('./userProfile.controller');router[_0x2822('0x9')]('/',auth[_0x2822('0xa')](),controller[_0x2822('0xb')]);router[_0x2822('0x9')](_0x2822('0xc'),auth['isAuthenticated'](),controller[_0x2822('0xd')]);router[_0x2822('0x9')](_0x2822('0xe'),auth[_0x2822('0xa')](),controller['show']);router[_0x2822('0x9')](_0x2822('0xf'),auth[_0x2822('0xa')](),controller[_0x2822('0x10')]);router[_0x2822('0x9')]('/:id/resources',auth[_0x2822('0xa')](),controller[_0x2822('0x11')]);router['post']('/',auth[_0x2822('0xa')](),controller[_0x2822('0x12')]);router[_0x2822('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0x2822('0x14')]);router[_0x2822('0x13')](_0x2822('0xf'),auth[_0x2822('0xa')](),controller[_0x2822('0x15')]);router[_0x2822('0x13')](_0x2822('0x16'),auth[_0x2822('0xa')](),controller[_0x2822('0x17')]);router[_0x2822('0x18')](_0x2822('0xe'),auth[_0x2822('0xa')](),controller[_0x2822('0x19')]);router[_0x2822('0x1a')]('/:id',auth[_0x2822('0xa')](),controller[_0x2822('0x1b')]);router[_0x2822('0x1a')](_0x2822('0xf'),auth[_0x2822('0xa')](),controller[_0x2822('0x1c')]);router[_0x2822('0x1a')](_0x2822('0x16'),auth[_0x2822('0xa')](),controller[_0x2822('0x1d')]);module[_0x2822('0x1e')]=router; \ No newline at end of file +var _0xde42=['../../config/environment','isAuthenticated','get','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','delete','destroy','removeSections','removeResources','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xde42,0x153));var _0x2de4=function(_0x11cc3c,_0x3d7dcf){_0x11cc3c=_0x11cc3c-0x0;var _0x4b3627=_0xde42[_0x11cc3c];return _0x4b3627;};'use strict';var multer=require(_0x2de4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2de4('0x1'));var router=express[_0x2de4('0x2')]();var fs_extra=require(_0x2de4('0x3'));var auth=require(_0x2de4('0x4'));var interaction=require(_0x2de4('0x5'));var config=require(_0x2de4('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x2de4('0x7')](),controller['index']);router[_0x2de4('0x8')](_0x2de4('0x9'),auth['isAuthenticated'](),controller[_0x2de4('0xa')]);router[_0x2de4('0x8')](_0x2de4('0xb'),auth[_0x2de4('0x7')](),controller['show']);router[_0x2de4('0x8')](_0x2de4('0xc'),auth[_0x2de4('0x7')](),controller[_0x2de4('0xd')]);router[_0x2de4('0x8')](_0x2de4('0xe'),auth[_0x2de4('0x7')](),controller[_0x2de4('0xf')]);router[_0x2de4('0x10')]('/',auth[_0x2de4('0x7')](),controller['create']);router['post'](_0x2de4('0x11'),auth[_0x2de4('0x7')](),controller['clone']);router['post'](_0x2de4('0xc'),auth['isAuthenticated'](),controller['addSections']);router['post'](_0x2de4('0xe'),auth[_0x2de4('0x7')](),controller['addResources']);router['put'](_0x2de4('0xb'),auth[_0x2de4('0x7')](),controller['update']);router[_0x2de4('0x12')]('/:id',auth[_0x2de4('0x7')](),controller[_0x2de4('0x13')]);router[_0x2de4('0x12')](_0x2de4('0xc'),auth[_0x2de4('0x7')](),controller[_0x2de4('0x14')]);router[_0x2de4('0x12')]('/:id/resources',auth[_0x2de4('0x7')](),controller[_0x2de4('0x15')]);module[_0x2de4('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 02d99de..e7f3a0d 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5f5=['crudPermissions','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x2784f2,_0x12e27f){var _0x290a52=function(_0x364f83){while(--_0x364f83){_0x2784f2['push'](_0x2784f2['shift']());}};_0x290a52(++_0x12e27f);}(_0xa5f5,0xda));var _0x5a5f=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xa5f5[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require(_0x5a5f('0x0'));module[_0x5a5f('0x1')]={'name':{'type':Sequelize[_0x5a5f('0x2')],'allowNull':![],'unique':_0x5a5f('0x3')},'crudPermissions':{'type':Sequelize[_0x5a5f('0x2')],'set':function(_0x2145bc){this[_0x5a5f('0x4')]('crudPermissions',_0x2145bc?_0x2145bc[_0x5a5f('0x5')](''):[]);},'get':function(){return this[_0x5a5f('0x6')](_0x5a5f('0x7'))?this[_0x5a5f('0x6')](_0x5a5f('0x7'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x5a5f('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5a5f('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x771a=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x771a,0x7f));var _0xa771=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x771a[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xa771('0x0'));module[_0xa771('0x1')]={'name':{'type':Sequelize[_0xa771('0x2')],'allowNull':![],'unique':_0xa771('0x3')},'crudPermissions':{'type':Sequelize[_0xa771('0x2')],'set':function(_0x589dc0){this[_0xa771('0x4')](_0xa771('0x5'),_0x589dc0?_0x589dc0[_0xa771('0x6')](''):[]);},'get':function(){return this[_0xa771('0x7')](_0xa771('0x5'))?this[_0xa771('0x7')](_0xa771('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa771('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa771('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa771('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa771('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 0c5552d..74699b8 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17a7=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','nolimit','sort','filter','where','merge','UserProfile','includeAll','include','findAll','rows','catch','show','params','options','find','create','clone','omit','createdAt','updatedAt','body','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','each','push','get','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x17a7,0xc2));var _0x717a=function(_0x2720b0,_0x412840){_0x2720b0=_0x2720b0-0x0;var _0x1d8a11=_0x17a7[_0x2720b0];return _0x1d8a11;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x717a('0x0'));var rp=require(_0x717a('0x1'));var moment=require(_0x717a('0x2'));var BPromise=require(_0x717a('0x3'));var Mustache=require('mustache');var util=require(_0x717a('0x4'));var path=require('path');var sox=require(_0x717a('0x5'));var csv=require(_0x717a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x717a('0x7'));var _=require(_0x717a('0x8'));var squel=require(_0x717a('0x9'));var crypto=require(_0x717a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x717a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x717a('0xc'));var Papa=require('papaparse');var Redis=require(_0x717a('0xd'));var authService=require(_0x717a('0xe'));var qs=require(_0x717a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x717a('0x10'))(_0x717a('0x11'));var utils=require(_0x717a('0x12'));var config=require(_0x717a('0x13'));var licenseUtil=require(_0x717a('0x14'));var db=require('../../mysqldb')['db'];config[_0x717a('0x15')]=_['defaults'](config[_0x717a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x717a('0x16')](socket);function respondWithStatusCode(_0x546495,_0x34689b){_0x34689b=_0x34689b||0xcc;return function(_0x4ea5fd){if(_0x4ea5fd){return _0x546495[_0x717a('0x17')](_0x34689b);}return _0x546495['status'](_0x34689b)[_0x717a('0x18')]();};}function respondWithResult(_0x6ae1be,_0x11c7fa){_0x11c7fa=_0x11c7fa||0xc8;return function(_0x5c396d){if(_0x5c396d){return _0x6ae1be[_0x717a('0x19')](_0x11c7fa)['json'](_0x5c396d);}};}function respondWithFilteredResult(_0x130cb2,_0x351c3e){return function(_0x152e10){if(_0x152e10){var _0x8b295=typeof _0x351c3e[_0x717a('0x1a')]===_0x717a('0x1b')&&typeof _0x351c3e[_0x717a('0x1c')]===_0x717a('0x1b');var _0x1e798f=_0x152e10[_0x717a('0x1d')];var _0x5e60f7=_0x8b295?0x0:_0x351c3e['offset'];var _0x2e89f8=_0x8b295?_0x152e10[_0x717a('0x1d')]:_0x351c3e[_0x717a('0x1a')]+_0x351c3e[_0x717a('0x1c')];var _0x2ef0e9;if(_0x2e89f8>=_0x1e798f){_0x2e89f8=_0x1e798f;_0x2ef0e9=0xc8;}else{_0x2ef0e9=0xce;}_0x130cb2[_0x717a('0x19')](_0x2ef0e9);return _0x130cb2[_0x717a('0x1e')](_0x717a('0x1f'),_0x5e60f7+'-'+_0x2e89f8+'/'+_0x1e798f)['json'](_0x152e10);}return null;};}function patchUpdates(_0x3fc2be){return function(_0x1deb63){try{jsonpatch[_0x717a('0x20')](_0x1deb63,_0x3fc2be,!![]);}catch(_0x33947c){return BPromise[_0x717a('0x21')](_0x33947c);}return _0x1deb63['save']();};}function saveUpdates(_0x345d54,_0x630617){return function(_0x3bae98){if(_0x3bae98){return _0x3bae98['update'](_0x345d54)[_0x717a('0x22')](function(_0x36a145){return _0x36a145;});}return null;};}function removeEntity(_0x5e394f,_0x3f443a){return function(_0x329999){if(_0x329999){return _0x329999[_0x717a('0x23')]()[_0x717a('0x22')](function(){_0x5e394f[_0x717a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1654dd,_0x25bc5e){return function(_0x2d628c){if(!_0x2d628c){_0x1654dd[_0x717a('0x17')](0x194);}return _0x2d628c;};}function handleError(_0x315d64,_0x42ac79){_0x42ac79=_0x42ac79||0x1f4;return function(_0x40f3ac){logger['error'](_0x40f3ac[_0x717a('0x24')]);if(_0x40f3ac[_0x717a('0x25')]){delete _0x40f3ac[_0x717a('0x25')];}_0x315d64['status'](_0x42ac79)['send'](_0x40f3ac);};}exports[_0x717a('0x26')]=function(_0x45847a,_0x97d7a1){var _0x5007e3={},_0x2719ab={},_0x24f51d={'count':0x0,'rows':[]};var _0x4c63d8=_[_0x717a('0x27')](db['UserProfile'][_0x717a('0x28')],function(_0x13481e){return{'name':_0x13481e[_0x717a('0x29')],'type':_0x13481e[_0x717a('0x2a')]['key']};});_0x2719ab['model']=_['map'](_0x4c63d8,_0x717a('0x25'));_0x2719ab['query']=_[_0x717a('0x2b')](_0x45847a[_0x717a('0x2c')]);_0x2719ab[_0x717a('0x2d')]=_[_0x717a('0x2e')](_0x2719ab['model'],_0x2719ab['query']);_0x5007e3[_0x717a('0x2f')]=_[_0x717a('0x2e')](_0x2719ab['model'],qs[_0x717a('0x30')](_0x45847a[_0x717a('0x2c')][_0x717a('0x30')]));_0x5007e3[_0x717a('0x2f')]=_0x5007e3['attributes'][_0x717a('0x31')]?_0x5007e3[_0x717a('0x2f')]:_0x2719ab[_0x717a('0x32')];if(!_0x45847a[_0x717a('0x2c')]['hasOwnProperty'](_0x717a('0x33'))){_0x5007e3['limit']=qs['limit'](_0x45847a['query']['limit']);_0x5007e3[_0x717a('0x1a')]=qs[_0x717a('0x1a')](_0x45847a['query']['offset']);}_0x5007e3['order']=qs[_0x717a('0x34')](_0x45847a[_0x717a('0x2c')][_0x717a('0x34')]);_0x5007e3['where']=qs[_0x717a('0x2d')](_['pick'](_0x45847a['query'],_0x2719ab[_0x717a('0x2d')]),_0x4c63d8);if(_0x45847a[_0x717a('0x2c')][_0x717a('0x35')]){_0x5007e3[_0x717a('0x36')]=_[_0x717a('0x37')](_0x5007e3[_0x717a('0x36')],{'$or':_[_0x717a('0x27')](_0x4c63d8,function(_0x2b545b){if(_0x2b545b[_0x717a('0x2a')]!=='VIRTUAL'){var _0x7dfb98={};_0x7dfb98[_0x2b545b[_0x717a('0x25')]]={'$like':'%'+_0x45847a[_0x717a('0x2c')][_0x717a('0x35')]+'%'};return _0x7dfb98;}})});}_0x5007e3=_['merge']({},_0x5007e3,_0x45847a['options']);var _0x154f74={'where':_0x5007e3[_0x717a('0x36')]};return db[_0x717a('0x38')][_0x717a('0x1d')](_0x154f74)[_0x717a('0x22')](function(_0x52b944){_0x24f51d[_0x717a('0x1d')]=_0x52b944;if(_0x45847a['query'][_0x717a('0x39')]){_0x5007e3[_0x717a('0x3a')]=[{'all':!![]}];}return db['UserProfile'][_0x717a('0x3b')](_0x5007e3);})[_0x717a('0x22')](function(_0x684c41){_0x24f51d[_0x717a('0x3c')]=_0x684c41;return _0x24f51d;})[_0x717a('0x22')](respondWithFilteredResult(_0x97d7a1,_0x5007e3))[_0x717a('0x3d')](handleError(_0x97d7a1,null));};exports[_0x717a('0x3e')]=function(_0x3970c7,_0x437107){var _0x5c430f={'raw':![],'where':{'id':_0x3970c7[_0x717a('0x3f')]['id']}},_0x44cf53={};_0x44cf53[_0x717a('0x32')]=_['keys'](db['UserProfile'][_0x717a('0x28')]);_0x44cf53[_0x717a('0x2c')]=_[_0x717a('0x2b')](_0x3970c7[_0x717a('0x2c')]);_0x44cf53[_0x717a('0x2d')]=_[_0x717a('0x2e')](_0x44cf53[_0x717a('0x32')],_0x44cf53[_0x717a('0x2c')]);_0x5c430f[_0x717a('0x2f')]=_[_0x717a('0x2e')](_0x44cf53[_0x717a('0x32')],qs[_0x717a('0x30')](_0x3970c7[_0x717a('0x2c')][_0x717a('0x30')]));_0x5c430f[_0x717a('0x2f')]=_0x5c430f['attributes'][_0x717a('0x31')]?_0x5c430f['attributes']:_0x44cf53[_0x717a('0x32')];if(_0x3970c7['query'][_0x717a('0x39')]){_0x5c430f[_0x717a('0x3a')]=[{'all':!![]}];}_0x5c430f=_[_0x717a('0x37')]({},_0x5c430f,_0x3970c7[_0x717a('0x40')]);return db[_0x717a('0x38')][_0x717a('0x41')](_0x5c430f)[_0x717a('0x22')](handleEntityNotFound(_0x437107,null))[_0x717a('0x22')](respondWithResult(_0x437107,null))[_0x717a('0x3d')](handleError(_0x437107,null));};exports[_0x717a('0x42')]=function(_0x3914f4,_0x20c865){return db[_0x717a('0x38')][_0x717a('0x42')](_0x3914f4['body'],{})[_0x717a('0x22')](respondWithResult(_0x20c865,0xc9))['catch'](handleError(_0x20c865,null));};exports[_0x717a('0x43')]=function(_0xa942d2,_0x4426e7){var _0x2adff7={'where':{'id':_0xa942d2[_0x717a('0x3f')]['id']}},_0xbd3c32={};_0xbd3c32[_0x717a('0x32')]=_[_0x717a('0x2b')](db[_0x717a('0x38')][_0x717a('0x28')]);_0x2adff7['attributes']=_[_0x717a('0x2e')](_0xbd3c32[_0x717a('0x32')],qs[_0x717a('0x30')](_0xa942d2['query']['fields']));_0x2adff7[_0x717a('0x2f')]=_0x2adff7[_0x717a('0x2f')][_0x717a('0x31')]?_0x2adff7[_0x717a('0x2f')]:_0xbd3c32['model'];if(_0xa942d2[_0x717a('0x2c')][_0x717a('0x39')]){_0x2adff7['include']=[{'all':!![]}];}_0x2adff7=_[_0x717a('0x37')]({},_0x2adff7,_0xa942d2[_0x717a('0x40')]);return db[_0x717a('0x38')][_0x717a('0x41')](_0x2adff7)[_0x717a('0x22')](handleEntityNotFound(_0x4426e7,null))[_0x717a('0x22')](function(_0x430084){if(_0x430084){var _0x498077=_0x430084['get']({'plain':!![]});_0x498077=qs[_0x717a('0x44')](_0x498077,['id',_0x717a('0x45'),_0x717a('0x46'),'crudPermissions']);_0xa942d2['body']=_[_0x717a('0x44')](_0xa942d2[_0x717a('0x47')],['id',_0x717a('0x45'),_0x717a('0x46')]);return db[_0x717a('0x48')][_0x717a('0x49')](function(_0x2b4235){return db[_0x717a('0x38')][_0x717a('0x42')](_[_0x717a('0x37')](_0x498077,_0xa942d2[_0x717a('0x47')]),{'include':_0xa942d2[_0x717a('0x2c')][_0x717a('0x39')]?[{'all':!![]}]:undefined,'transaction':_0x2b4235})['then'](function(_0x29b350){var _0x568b15=_0x29b350['get']({'plain':!![]});return db[_0x717a('0x4a')][_0x717a('0x3b')]({'where':{'userProfileId':_0xa942d2['params']['id']},'raw':!![]})['then'](function(_0x1a0979){if(_0x1a0979){return BPromise['each'](_0x1a0979,function(_0x50b97d){return new BPromise(function(_0x6ab85f,_0x48c3ba){if(_0x50b97d['autoAssociation']===null||_0x50b97d[_0x717a('0x4b')]===0x1)_0x6ab85f(null);return db[_0x717a('0x4c')][_0x717a('0x3b')]({'where':{'sectionId':_0x50b97d['id']},'raw':!![]})['then'](function(_0x3d7f2e){var _0x58d4c3=_[_0x717a('0x27')](_0x3d7f2e,function(_0x257729){return qs['omit'](_0x257729,['id',_0x717a('0x45'),_0x717a('0x46'),_0x717a('0x4d')]);});_0x6ab85f(_0x58d4c3);})[_0x717a('0x3d')](function(_0x4cfdd2){_0x48c3ba(_0x4cfdd2);});})[_0x717a('0x22')](function(_0x151a86){var _0x5a8a40=qs[_0x717a('0x44')](_0x50b97d,['id',_0x717a('0x45'),_0x717a('0x46')]);_0x5a8a40[_0x717a('0x4e')]=_0x568b15['id'];if(_0x151a86)_0x5a8a40[_0x717a('0x4f')]=_0x151a86;return _0x5a8a40;})[_0x717a('0x22')](function(_0x123b84){return db[_0x717a('0x4a')][_0x717a('0x42')](_0x123b84,{'include':[{'model':db['UserProfileResource'],'as':_0x717a('0x4f')}],'raw':!![],'transaction':_0x2b4235});});})[_0x717a('0x22')](function(){return _0x568b15;});}});});});}})[_0x717a('0x22')](respondWithResult(_0x4426e7,0xc9))[_0x717a('0x3d')](handleError(_0x4426e7,null));};exports[_0x717a('0x50')]=function(_0x5cd130,_0x4e5941){if(_0x5cd130[_0x717a('0x47')]['id']){delete _0x5cd130[_0x717a('0x47')]['id'];}return db[_0x717a('0x38')][_0x717a('0x41')]({'where':{'id':_0x5cd130[_0x717a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4e5941,null))[_0x717a('0x22')](saveUpdates(_0x5cd130[_0x717a('0x47')],null))[_0x717a('0x22')](respondWithResult(_0x4e5941,null))[_0x717a('0x3d')](handleError(_0x4e5941,null));};exports[_0x717a('0x23')]=function(_0x4decf0,_0xb2180f){return db[_0x717a('0x38')][_0x717a('0x41')]({'where':{'id':_0x4decf0[_0x717a('0x3f')]['id']}})[_0x717a('0x22')](handleEntityNotFound(_0xb2180f,null))[_0x717a('0x22')](removeEntity(_0xb2180f,null))[_0x717a('0x3d')](handleError(_0xb2180f,null));};exports[_0x717a('0x51')]=function(_0x5380d0,_0x38caac){return db['UserProfile'][_0x717a('0x51')]()[_0x717a('0x22')](respondWithResult(_0x38caac,null))[_0x717a('0x3d')](handleError(_0x38caac,null));};exports[_0x717a('0x52')]=function(_0x2ab0b3,_0x395f27){var _0x1be55c=_0x2ab0b3[_0x717a('0x47')];return db['UserProfile'][_0x717a('0x41')]({'where':{'id':_0x2ab0b3[_0x717a('0x3f')]['id']}})[_0x717a('0x22')](handleEntityNotFound(_0x395f27,null))[_0x717a('0x22')](function(_0x544c18){if(_0x544c18){return db[_0x717a('0x48')][_0x717a('0x49')](function(_0x1107db){return db['UserProfileSection'][_0x717a('0x23')]({'where':{'userProfileId':_0x2ab0b3[_0x717a('0x3f')]['id'],'sectionId':_[_0x717a('0x27')](_0x1be55c,function(_0x2b6f25){return _0x2b6f25['sectionId'];})},'transaction':_0x1107db})[_0x717a('0x22')](function(){var _0xe5135c=_[_0x717a('0x27')](_0x1be55c,function(_0x480857){_0x480857[_0x717a('0x4e')]=_0x2ab0b3[_0x717a('0x3f')]['id'];return _0x480857;});var _0x5f0b36=[];return BPromise[_0x717a('0x53')](_0xe5135c,function(_0x573ee6){return db[_0x717a('0x4a')]['create'](_0x573ee6,{'include':[{'model':db['UserProfileResource'],'as':_0x717a('0x4f')}],'raw':!![],'transaction':_0x1107db})[_0x717a('0x22')](function(_0x3dae6f){_0x5f0b36[_0x717a('0x54')](_0x3dae6f[_0x717a('0x55')]({'plain':!![]}));});})[_0x717a('0x22')](function(){return _0x5f0b36;});});});}})[_0x717a('0x22')](function(_0x3742dc){return _0x3742dc;})[_0x717a('0x22')](respondWithResult(_0x395f27,null))[_0x717a('0x3d')](handleError(_0x395f27,null));};exports[_0x717a('0x56')]=function(_0x132e75,_0x5c1b1c){var _0x11050e;return db[_0x717a('0x38')][_0x717a('0x41')]({'where':{'id':_0x132e75['params']['id']},'attributes':['id','name']})[_0x717a('0x22')](handleEntityNotFound(_0x5c1b1c,null))[_0x717a('0x22')](function(_0x28ad24){if(_0x28ad24){_0x11050e=_0x28ad24;return db['UserProfileSection'][_0x717a('0x23')]({'where':{'userProfileId':_0x132e75['params']['id'],'sectionId':_0x132e75[_0x717a('0x2c')][_0x717a('0x57')]}});}})[_0x717a('0x22')](function(){return _0x11050e;})[_0x717a('0x22')](respondWithStatusCode(_0x5c1b1c,null))['catch'](handleError(_0x5c1b1c,null));};exports[_0x717a('0x58')]=function(_0x3b4bcf,_0x3bd26d){var _0x5a291b=[];var _0x2acfb5=[];return db[_0x717a('0x4a')]['findAll']({'where':{'userProfileId':_0x3b4bcf[_0x717a('0x3f')]['id']},'raw':!![]})[_0x717a('0x22')](function(_0x12bb40){_0x5a291b=_[_0x717a('0x35')](_0x12bb40,function(_0x4b5aa5){return _0x4b5aa5[_0x717a('0x59')]===0x1||_[_0x717a('0x5a')]([0x3eb,0x709],_0x4b5aa5[_0x717a('0x4d')]);});if(!_[_0x717a('0x5b')](_0x5a291b)){return _[_0x717a('0x27')](_0x5a291b,function(_0x36a590){return _0x36a590[_0x717a('0x4d')];});}else{return;}})[_0x717a('0x22')](function(_0x1364cb){if(_0x1364cb)_0x2acfb5=_0x1364cb;if(_['includes'](_0x2acfb5,0x64)){var _0xbec460=_[_0x717a('0x41')](_0x5a291b,{'sectionId':0x64});return hasDefaultDashboard(_0xbec460)[_0x717a('0x22')](function(_0x495a9c){return _[_0x717a('0x27')](_0x5a291b,function(_0x3d09e5){if(_0x3d09e5[_0x717a('0x4d')]===0x64){_0x3d09e5[_0x717a('0x5c')]=_0x495a9c;}return _0x3d09e5;});});}else{return;}})['then'](function(_0x40b95e){if(_0x40b95e)_0x5a291b=_0x40b95e;if(_[_0x717a('0x5a')](_0x2acfb5,0x3eb)){var _0x5a4c52=_[_0x717a('0x41')](_0x5a291b,{'sectionId':0x3eb});return getCustomDashboards(_0x5a4c52)[_0x717a('0x22')](function(_0x5cdeac){return _[_0x717a('0x27')](_0x5a291b,function(_0x1db3c9){if(_0x5a4c52[_0x717a('0x59')]){if(_0x1db3c9[_0x717a('0x4d')]===0x3eb){_0x1db3c9[_0x717a('0x5c')]=_0x5cdeac;}}else{if(_0x1db3c9[_0x717a('0x4d')]===0x64){_0x1db3c9[_0x717a('0x5c')]=_0x5cdeac;}}return _0x1db3c9;});});}else{return;}})[_0x717a('0x22')](function(_0x4baf44){if(_0x4baf44)_0x5a291b=_0x4baf44;if(_[_0x717a('0x5a')](_0x2acfb5,0x709)){var _0x58faec=_[_0x717a('0x41')](_0x5a291b,{'sectionId':0x709});return getPlugins(_0x58faec)[_0x717a('0x22')](function(_0x55a6f4){if(_0x58faec[_0x717a('0x59')]){return _[_0x717a('0x27')](_0x5a291b,function(_0x39e88c){if(_0x39e88c[_0x717a('0x4d')]===0x709){_0x39e88c[_0x717a('0x5c')]=_0x55a6f4;}return _0x39e88c;});}else{var _0x4cce23={'sectionId':0x76c,'enabled':0x1,'subsections':_0x55a6f4};var _0x228159=_[_0x717a('0x27')](_0x5a291b);_0x228159['push'](_0x4cce23);return _0x228159;}});}else{return;}})[_0x717a('0x22')](function(_0x31ae74){if(_0x31ae74)_0x5a291b=_0x31ae74;return _[_0x717a('0x35')](_0x5a291b,['enabled',0x1]);})[_0x717a('0x22')](respondWithResult(_0x3bd26d,null))[_0x717a('0x3d')](handleError(_0x3bd26d,null));};function hasDefaultDashboard(_0x531766){var _0x14cda8=[0x65];return new BPromise(function(_0x903dc7,_0x466a56){try{if(_0x531766['autoAssociation']){_0x903dc7(_0x14cda8);}else{return db[_0x717a('0x4c')][_0x717a('0x5d')]({'where':{'sectionId':_0x531766['id']},'raw':!![]})[_0x717a('0x22')](function(_0x2534b3){_0x2534b3?_0x903dc7(_0x14cda8):_0x903dc7();});}}catch(_0x3c3dd8){_0x466a56(_0x3c3dd8);}});}function getCustomDashboards(_0xddad2){var _0x1ecd99=[];return new BPromise(function(_0x17349b,_0x279afc){try{if(_0xddad2[_0x717a('0x4b')]){return db[_0x717a('0x5e')][_0x717a('0x3b')]({'raw':!![]})[_0x717a('0x22')](function(_0x18652){_0x18652[_0x717a('0x5f')](function(_0x435dd7){_0x1ecd99[_0x717a('0x54')](_0x435dd7['id']+0x1869f);});_0x17349b(_0x1ecd99);});}else{return db[_0x717a('0x4c')]['findAll']({'where':{'sectionId':_0xddad2['id']},'raw':!![]})[_0x717a('0x22')](function(_0x346329){_0x346329[_0x717a('0x5f')](function(_0x5700f5){_0x1ecd99[_0x717a('0x54')](_0x5700f5[_0x717a('0x60')]+0x1869f);});_0x17349b(_0x1ecd99);});}}catch(_0x1d2f57){_0x279afc(_0x1d2f57);}});}function getPlugins(_0x2b7937){var _0x2b46db=[];return new BPromise(function(_0x381e01,_0x3bfa1d){try{if(_0x2b7937[_0x717a('0x4b')]){return db[_0x717a('0x61')][_0x717a('0x3b')]({'raw':!![]})['then'](function(_0x2b107a){_0x2b107a['forEach'](function(_0x951dac){_0x2b46db[_0x717a('0x54')](_0x951dac['id']+0x15b38);});_0x381e01(_0x2b46db);});}else{return db[_0x717a('0x4c')][_0x717a('0x3b')]({'where':{'sectionId':_0x2b7937['id']},'raw':!![]})[_0x717a('0x22')](function(_0x2a7e5b){_0x2a7e5b[_0x717a('0x5f')](function(_0x39ee59){_0x2b46db['push'](_0x39ee59[_0x717a('0x60')]+0x15b38);});_0x381e01(_0x2b46db);});}}catch(_0x2e60ce){_0x3bfa1d(_0x2e60ce);}});}exports[_0x717a('0x62')]=function(_0x100a2a,_0x447692){return db['UserProfile'][_0x717a('0x41')]({'where':{'id':_0x100a2a[_0x717a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x447692,null))[_0x717a('0x22')](function(_0x569d4e){if(_0x569d4e){return db[_0x717a('0x48')][_0x717a('0x49')](function(_0x1a458e){return db[_0x717a('0x4a')][_0x717a('0x3b')]({'where':{'userProfileId':_0x100a2a[_0x717a('0x3f')]['id']},'attributes':['id'],'raw':!![]})[_0x717a('0x22')](function(_0x2821cb){if(_0x2821cb){return db[_0x717a('0x4a')][_0x717a('0x23')]({'where':{'userProfileId':_0x100a2a['params']['id'],'id':_[_0x717a('0x27')](_0x2821cb,function(_0x4ec645){return _0x4ec645['id'];})},'transaction':_0x1a458e});}})['then'](function(_0x5360b5){var _0x2bf865=_['map'](_0x100a2a[_0x717a('0x47')],function(_0x547dc4){_0x547dc4[_0x717a('0x4e')]=_0x100a2a[_0x717a('0x3f')]['id'];return _0x547dc4;});return db[_0x717a('0x4a')][_0x717a('0x63')](_0x2bf865,{'raw':!![],'transaction':_0x1a458e});})['then'](function(_0x4c68dc){var _0x39b413=_[_0x717a('0x35')](_[_0x717a('0x27')](_0x4c68dc,function(_0xf605d1){return _0xf605d1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x39b413){return db['UserProfileSection'][_0x717a('0x3b')]({'where':{'userProfileId':_0x100a2a[_0x717a('0x3f')]['id'],'sectionId':_[_0x717a('0x27')](_0x39b413,function(_0x3b75ee){return _0x3b75ee[_0x717a('0x4d')];})},'attributes':['id',_0x717a('0x4d')],'raw':!![]})[_0x717a('0x22')](function(_0x542b7e){var _0x44dcf0=_[_0x717a('0x27')](_0x100a2a[_0x717a('0x47')],function(_0x53fc09){_0x53fc09[_0x717a('0x4e')]=_0x100a2a[_0x717a('0x3f')]['id'];return _0x53fc09;});return db[_0x717a('0x4c')][_0x717a('0x63')](_0x44dcf0,{'raw':!![],'transaction':_0x1a458e});});}})[_0x717a('0x3d')](handleError(_0x447692,null));});}})['then'](function(_0x243ee5){var _0x2e8366=_[_0x717a('0x27')](_0x243ee5,function(_0x8eec8c){return _0x8eec8c['get']({'plain':!![]});});})[_0x717a('0x22')](respondWithResult(_0x447692,null))[_0x717a('0x3d')](handleError(_0x447692,null));};exports[_0x717a('0x64')]=function(_0xbd7948,_0x272c45,_0x3c156c){return db[_0x717a('0x38')][_0x717a('0x41')]({'where':{'id':_0xbd7948[_0x717a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x272c45,null))[_0x717a('0x22')](function(_0x3d15f5){if(_0x3d15f5){return _0x3d15f5[_0x717a('0x64')](_0xbd7948[_0x717a('0x2c')][_0x717a('0x57')]);}})['then'](respondWithStatusCode(_0x272c45,null))[_0x717a('0x3d')](handleError(_0x272c45,null));};exports[_0x717a('0x65')]=function(_0x1f65ee,_0x3552bf){var _0x5e10b={};if(!_0x1f65ee['query']['section'])throw new Error(_0x717a('0x66'));if(!_0x1f65ee[_0x717a('0x2c')][_0x717a('0x67')]('nolimit')){_0x5e10b['limit']=qs[_0x717a('0x1c')](_0x1f65ee[_0x717a('0x2c')][_0x717a('0x1c')]);_0x5e10b['offset']=qs[_0x717a('0x1a')](_0x1f65ee['query']['offset']);}return db[_0x717a('0x38')][_0x717a('0x41')]({'where':{'id':_0x1f65ee['params']['id']}})['then'](function(_0x5bc382){if(!_0x5bc382)throw new Error(_0x717a('0x68')+_0x1f65ee[_0x717a('0x3f')]['id']);return db['UserProfile'][_0x717a('0x65')](_0x1f65ee);})[_0x717a('0x22')](respondWithFilteredResult(_0x3552bf,_0x5e10b))['catch'](handleError(_0x3552bf,null));}; \ No newline at end of file +var _0xd1f8=['send','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','clone','find','get','omit','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','each','autoAssociation','updatedAt','sectionId','userProfileId','Resources','UserProfileResource','destroy','describe','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','stack'];(function(_0x46e94c,_0x461216){var _0x597221=function(_0x17b6d9){while(--_0x17b6d9){_0x46e94c['push'](_0x46e94c['shift']());}};_0x597221(++_0x461216);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xd1f8[_0x288f5e];return _0x476cc9;};'use strict';var emlformat=require(_0x8d1f('0x0'));var rimraf=require(_0x8d1f('0x1'));var zipdir=require(_0x8d1f('0x2'));var jsonpatch=require(_0x8d1f('0x3'));var rp=require('request-promise');var moment=require(_0x8d1f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d1f('0x5'));var util=require('util');var path=require(_0x8d1f('0x6'));var sox=require('sox');var csv=require(_0x8d1f('0x7'));var ejs=require(_0x8d1f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d1f('0x9'));var squel=require(_0x8d1f('0xa'));var crypto=require(_0x8d1f('0xb'));var jsforce=require(_0x8d1f('0xc'));var deskjs=require(_0x8d1f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8d1f('0xe'));var Papa=require(_0x8d1f('0xf'));var Redis=require('ioredis');var authService=require(_0x8d1f('0x10'));var qs=require(_0x8d1f('0x11'));var as=require(_0x8d1f('0x12'));var hardwareService=require(_0x8d1f('0x13'));var logger=require(_0x8d1f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8d1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d1f('0x16'))['db'];config[_0x8d1f('0x17')]=_['defaults'](config[_0x8d1f('0x17')],{'host':_0x8d1f('0x18'),'port':0x18eb});var socket=require(_0x8d1f('0x19'))(new Redis(config['redis']));require(_0x8d1f('0x1a'))[_0x8d1f('0x1b')](socket);function respondWithStatusCode(_0x443511,_0x2657f2){_0x2657f2=_0x2657f2||0xcc;return function(_0x63f46a){if(_0x63f46a){return _0x443511[_0x8d1f('0x1c')](_0x2657f2);}return _0x443511[_0x8d1f('0x1d')](_0x2657f2)[_0x8d1f('0x1e')]();};}function respondWithResult(_0x2463c9,_0x2422d0){_0x2422d0=_0x2422d0||0xc8;return function(_0x19dabf){if(_0x19dabf){return _0x2463c9[_0x8d1f('0x1d')](_0x2422d0)[_0x8d1f('0x1f')](_0x19dabf);}};}function respondWithFilteredResult(_0x2036ee,_0x3b33c9){return function(_0xb5c2e5){if(_0xb5c2e5){var _0x3fc761=typeof _0x3b33c9['offset']==='undefined'&&typeof _0x3b33c9[_0x8d1f('0x20')]===_0x8d1f('0x21');var _0x1cb538=_0xb5c2e5[_0x8d1f('0x22')];var _0x224b46=_0x3fc761?0x0:_0x3b33c9[_0x8d1f('0x23')];var _0x59bd2f=_0x3fc761?_0xb5c2e5[_0x8d1f('0x22')]:_0x3b33c9[_0x8d1f('0x23')]+_0x3b33c9[_0x8d1f('0x20')];var _0x9ce15f;if(_0x59bd2f>=_0x1cb538){_0x59bd2f=_0x1cb538;_0x9ce15f=0xc8;}else{_0x9ce15f=0xce;}_0x2036ee['status'](_0x9ce15f);return _0x2036ee['set'](_0x8d1f('0x24'),_0x224b46+'-'+_0x59bd2f+'/'+_0x1cb538)[_0x8d1f('0x1f')](_0xb5c2e5);}return null;};}function patchUpdates(_0x5175a5){return function(_0xc7f18e){try{jsonpatch['apply'](_0xc7f18e,_0x5175a5,!![]);}catch(_0x285e7f){return BPromise[_0x8d1f('0x25')](_0x285e7f);}return _0xc7f18e[_0x8d1f('0x26')]();};}function saveUpdates(_0x2279b9,_0x396636){return function(_0x41f46c){if(_0x41f46c){return _0x41f46c[_0x8d1f('0x27')](_0x2279b9)[_0x8d1f('0x28')](function(_0x296d0c){return _0x296d0c;});}return null;};}function removeEntity(_0x4ba072,_0x24c04a){return function(_0x213321){if(_0x213321){return _0x213321['destroy']()[_0x8d1f('0x28')](function(){_0x4ba072[_0x8d1f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1425a3,_0x2dbc3d){return function(_0x7d84d8){if(!_0x7d84d8){_0x1425a3['sendStatus'](0x194);}return _0x7d84d8;};}function handleError(_0x2e0d54,_0x225fd7){_0x225fd7=_0x225fd7||0x1f4;return function(_0x4ca54a){logger['error'](_0x4ca54a[_0x8d1f('0x29')]);if(_0x4ca54a['name']){delete _0x4ca54a['name'];}_0x2e0d54[_0x8d1f('0x1d')](_0x225fd7)[_0x8d1f('0x2a')](_0x4ca54a);};}exports[_0x8d1f('0x2b')]=function(_0x10829d,_0x409788){var _0x46e90e={},_0xec2aa={},_0x1da9f8={'count':0x0,'rows':[]};var _0x4f1fb2=_[_0x8d1f('0x2c')](db[_0x8d1f('0x2d')][_0x8d1f('0x2e')],function(_0x381547){return{'name':_0x381547[_0x8d1f('0x2f')],'type':_0x381547[_0x8d1f('0x30')]['key']};});_0xec2aa[_0x8d1f('0x31')]=_[_0x8d1f('0x2c')](_0x4f1fb2,'name');_0xec2aa[_0x8d1f('0x32')]=_[_0x8d1f('0x33')](_0x10829d['query']);_0xec2aa['filters']=_['intersection'](_0xec2aa[_0x8d1f('0x31')],_0xec2aa[_0x8d1f('0x32')]);_0x46e90e[_0x8d1f('0x34')]=_[_0x8d1f('0x35')](_0xec2aa[_0x8d1f('0x31')],qs[_0x8d1f('0x36')](_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x36')]));_0x46e90e['attributes']=_0x46e90e['attributes']['length']?_0x46e90e[_0x8d1f('0x34')]:_0xec2aa[_0x8d1f('0x31')];if(!_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x37')](_0x8d1f('0x38'))){_0x46e90e[_0x8d1f('0x20')]=qs['limit'](_0x10829d[_0x8d1f('0x32')]['limit']);_0x46e90e[_0x8d1f('0x23')]=qs[_0x8d1f('0x23')](_0x10829d['query']['offset']);}_0x46e90e[_0x8d1f('0x39')]=qs[_0x8d1f('0x3a')](_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x3a')]);_0x46e90e[_0x8d1f('0x3b')]=qs[_0x8d1f('0x3c')](_['pick'](_0x10829d[_0x8d1f('0x32')],_0xec2aa[_0x8d1f('0x3c')]),_0x4f1fb2);if(_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x3d')]){_0x46e90e[_0x8d1f('0x3b')]=_[_0x8d1f('0x3e')](_0x46e90e[_0x8d1f('0x3b')],{'$or':_[_0x8d1f('0x2c')](_0x4f1fb2,function(_0x3ebba1){if(_0x3ebba1[_0x8d1f('0x30')]!==_0x8d1f('0x3f')){var _0x5e4e9f={};_0x5e4e9f[_0x3ebba1[_0x8d1f('0x40')]]={'$like':'%'+_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x3d')]+'%'};return _0x5e4e9f;}})});}_0x46e90e=_['merge']({},_0x46e90e,_0x10829d['options']);var _0x560cb9={'where':_0x46e90e[_0x8d1f('0x3b')]};return db[_0x8d1f('0x2d')]['count'](_0x560cb9)[_0x8d1f('0x28')](function(_0x1dfd62){_0x1da9f8[_0x8d1f('0x22')]=_0x1dfd62;if(_0x10829d[_0x8d1f('0x32')][_0x8d1f('0x41')]){_0x46e90e[_0x8d1f('0x42')]=[{'all':!![]}];}return db[_0x8d1f('0x2d')][_0x8d1f('0x43')](_0x46e90e);})[_0x8d1f('0x28')](function(_0x2d891e){_0x1da9f8[_0x8d1f('0x44')]=_0x2d891e;return _0x1da9f8;})['then'](respondWithFilteredResult(_0x409788,_0x46e90e))[_0x8d1f('0x45')](handleError(_0x409788,null));};exports[_0x8d1f('0x46')]=function(_0x5dc328,_0x5bf711){var _0x396165={'raw':![],'where':{'id':_0x5dc328[_0x8d1f('0x47')]['id']}},_0x134cf7={};_0x134cf7['model']=_['keys'](db['UserProfile']['rawAttributes']);_0x134cf7[_0x8d1f('0x32')]=_[_0x8d1f('0x33')](_0x5dc328['query']);_0x134cf7[_0x8d1f('0x3c')]=_['intersection'](_0x134cf7['model'],_0x134cf7['query']);_0x396165[_0x8d1f('0x34')]=_[_0x8d1f('0x35')](_0x134cf7[_0x8d1f('0x31')],qs[_0x8d1f('0x36')](_0x5dc328['query'][_0x8d1f('0x36')]));_0x396165['attributes']=_0x396165['attributes'][_0x8d1f('0x48')]?_0x396165[_0x8d1f('0x34')]:_0x134cf7[_0x8d1f('0x31')];if(_0x5dc328[_0x8d1f('0x32')][_0x8d1f('0x41')]){_0x396165[_0x8d1f('0x42')]=[{'all':!![]}];}_0x396165=_[_0x8d1f('0x3e')]({},_0x396165,_0x5dc328[_0x8d1f('0x49')]);return db[_0x8d1f('0x2d')]['find'](_0x396165)[_0x8d1f('0x28')](handleEntityNotFound(_0x5bf711,null))[_0x8d1f('0x28')](respondWithResult(_0x5bf711,null))[_0x8d1f('0x45')](handleError(_0x5bf711,null));};exports[_0x8d1f('0x4a')]=function(_0x174093,_0x239111){return db[_0x8d1f('0x2d')][_0x8d1f('0x4a')](_0x174093[_0x8d1f('0x4b')],{})[_0x8d1f('0x28')](respondWithResult(_0x239111,0xc9))[_0x8d1f('0x45')](handleError(_0x239111,null));};exports[_0x8d1f('0x4c')]=function(_0x4027d6,_0x28114d){var _0x1bf8cd={'where':{'id':_0x4027d6['params']['id']}},_0x3f377a={};_0x3f377a[_0x8d1f('0x31')]=_[_0x8d1f('0x33')](db[_0x8d1f('0x2d')][_0x8d1f('0x2e')]);_0x1bf8cd[_0x8d1f('0x34')]=_[_0x8d1f('0x35')](_0x3f377a[_0x8d1f('0x31')],qs[_0x8d1f('0x36')](_0x4027d6[_0x8d1f('0x32')][_0x8d1f('0x36')]));_0x1bf8cd[_0x8d1f('0x34')]=_0x1bf8cd[_0x8d1f('0x34')][_0x8d1f('0x48')]?_0x1bf8cd['attributes']:_0x3f377a[_0x8d1f('0x31')];if(_0x4027d6[_0x8d1f('0x32')][_0x8d1f('0x41')]){_0x1bf8cd[_0x8d1f('0x42')]=[{'all':!![]}];}_0x1bf8cd=_[_0x8d1f('0x3e')]({},_0x1bf8cd,_0x4027d6['options']);return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')](_0x1bf8cd)[_0x8d1f('0x28')](handleEntityNotFound(_0x28114d,null))[_0x8d1f('0x28')](function(_0x5d1e71){if(_0x5d1e71){var _0x98ecac=_0x5d1e71[_0x8d1f('0x4e')]({'plain':!![]});_0x98ecac=qs[_0x8d1f('0x4f')](_0x98ecac,['id','createdAt','updatedAt',_0x8d1f('0x50')]);_0x4027d6[_0x8d1f('0x4b')]=_[_0x8d1f('0x4f')](_0x4027d6[_0x8d1f('0x4b')],['id',_0x8d1f('0x51'),'updatedAt']);return db[_0x8d1f('0x52')][_0x8d1f('0x53')](function(_0x4a3f0a){return db[_0x8d1f('0x2d')][_0x8d1f('0x4a')](_[_0x8d1f('0x3e')](_0x98ecac,_0x4027d6[_0x8d1f('0x4b')]),{'include':_0x4027d6[_0x8d1f('0x32')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4a3f0a})[_0x8d1f('0x28')](function(_0x1b1465){var _0x2fe49e=_0x1b1465[_0x8d1f('0x4e')]({'plain':!![]});return db[_0x8d1f('0x54')][_0x8d1f('0x43')]({'where':{'userProfileId':_0x4027d6[_0x8d1f('0x47')]['id']},'raw':!![]})[_0x8d1f('0x28')](function(_0x490b34){if(_0x490b34){return BPromise[_0x8d1f('0x55')](_0x490b34,function(_0x3ac0d1){return new BPromise(function(_0x466ff5,_0x3cab8f){if(_0x3ac0d1[_0x8d1f('0x56')]===null||_0x3ac0d1[_0x8d1f('0x56')]===0x1)_0x466ff5(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3ac0d1['id']},'raw':!![]})[_0x8d1f('0x28')](function(_0x470407){var _0x411841=_[_0x8d1f('0x2c')](_0x470407,function(_0x11a695){return qs[_0x8d1f('0x4f')](_0x11a695,['id',_0x8d1f('0x51'),_0x8d1f('0x57'),_0x8d1f('0x58')]);});_0x466ff5(_0x411841);})[_0x8d1f('0x45')](function(_0x4b9ab1){_0x3cab8f(_0x4b9ab1);});})[_0x8d1f('0x28')](function(_0x2bed6e){var _0x2223a6=qs['omit'](_0x3ac0d1,['id',_0x8d1f('0x51'),_0x8d1f('0x57')]);_0x2223a6[_0x8d1f('0x59')]=_0x2fe49e['id'];if(_0x2bed6e)_0x2223a6[_0x8d1f('0x5a')]=_0x2bed6e;return _0x2223a6;})[_0x8d1f('0x28')](function(_0x4b4531){return db[_0x8d1f('0x54')][_0x8d1f('0x4a')](_0x4b4531,{'include':[{'model':db[_0x8d1f('0x5b')],'as':_0x8d1f('0x5a')}],'raw':!![],'transaction':_0x4a3f0a});});})[_0x8d1f('0x28')](function(){return _0x2fe49e;});}});});});}})[_0x8d1f('0x28')](respondWithResult(_0x28114d,0xc9))[_0x8d1f('0x45')](handleError(_0x28114d,null));};exports['update']=function(_0xa95fd,_0x53dc1a){if(_0xa95fd[_0x8d1f('0x4b')]['id']){delete _0xa95fd['body']['id'];}return db[_0x8d1f('0x2d')]['find']({'where':{'id':_0xa95fd[_0x8d1f('0x47')]['id']}})[_0x8d1f('0x28')](handleEntityNotFound(_0x53dc1a,null))['then'](saveUpdates(_0xa95fd[_0x8d1f('0x4b')],null))[_0x8d1f('0x28')](respondWithResult(_0x53dc1a,null))[_0x8d1f('0x45')](handleError(_0x53dc1a,null));};exports[_0x8d1f('0x5c')]=function(_0xadb391,_0xb53777){return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')]({'where':{'id':_0xadb391[_0x8d1f('0x47')]['id']}})[_0x8d1f('0x28')](handleEntityNotFound(_0xb53777,null))[_0x8d1f('0x28')](removeEntity(_0xb53777,null))[_0x8d1f('0x45')](handleError(_0xb53777,null));};exports[_0x8d1f('0x5d')]=function(_0x34df20,_0x257364){return db[_0x8d1f('0x2d')][_0x8d1f('0x5d')]()['then'](respondWithResult(_0x257364,null))[_0x8d1f('0x45')](handleError(_0x257364,null));};exports['addSections']=function(_0x1e9c51,_0x2bd30d){var _0xc24cd2=_0x1e9c51[_0x8d1f('0x4b')];return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')]({'where':{'id':_0x1e9c51['params']['id']}})[_0x8d1f('0x28')](handleEntityNotFound(_0x2bd30d,null))['then'](function(_0x12a4ca){if(_0x12a4ca){return db[_0x8d1f('0x52')][_0x8d1f('0x53')](function(_0x34404a){return db[_0x8d1f('0x54')][_0x8d1f('0x5c')]({'where':{'userProfileId':_0x1e9c51['params']['id'],'sectionId':_[_0x8d1f('0x2c')](_0xc24cd2,function(_0xe0cb4b){return _0xe0cb4b[_0x8d1f('0x58')];})},'transaction':_0x34404a})['then'](function(){var _0x3b7d3b=_[_0x8d1f('0x2c')](_0xc24cd2,function(_0x544c93){_0x544c93[_0x8d1f('0x59')]=_0x1e9c51[_0x8d1f('0x47')]['id'];return _0x544c93;});var _0x2a0f38=[];return BPromise['each'](_0x3b7d3b,function(_0x31c658){return db[_0x8d1f('0x54')]['create'](_0x31c658,{'include':[{'model':db[_0x8d1f('0x5b')],'as':_0x8d1f('0x5a')}],'raw':!![],'transaction':_0x34404a})[_0x8d1f('0x28')](function(_0x221e29){_0x2a0f38[_0x8d1f('0x5e')](_0x221e29[_0x8d1f('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x2a0f38;});});});}})['then'](function(_0x12d376){return _0x12d376;})[_0x8d1f('0x28')](respondWithResult(_0x2bd30d,null))[_0x8d1f('0x45')](handleError(_0x2bd30d,null));};exports[_0x8d1f('0x5f')]=function(_0x2cedde,_0x30de4c){var _0x27f919;return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')]({'where':{'id':_0x2cedde[_0x8d1f('0x47')]['id']},'attributes':['id',_0x8d1f('0x40')]})[_0x8d1f('0x28')](handleEntityNotFound(_0x30de4c,null))[_0x8d1f('0x28')](function(_0x450caf){if(_0x450caf){_0x27f919=_0x450caf;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2cedde[_0x8d1f('0x47')]['id'],'sectionId':_0x2cedde[_0x8d1f('0x32')][_0x8d1f('0x60')]}});}})[_0x8d1f('0x28')](function(){return _0x27f919;})[_0x8d1f('0x28')](respondWithStatusCode(_0x30de4c,null))['catch'](handleError(_0x30de4c,null));};exports[_0x8d1f('0x61')]=function(_0xe4d4bd,_0x552350){var _0x51483b=[];var _0x531e94=[];return db[_0x8d1f('0x54')][_0x8d1f('0x43')]({'where':{'userProfileId':_0xe4d4bd['params']['id']},'raw':!![]})[_0x8d1f('0x28')](function(_0x2bc024){_0x51483b=_[_0x8d1f('0x3d')](_0x2bc024,function(_0x449b83){return _0x449b83[_0x8d1f('0x62')]===0x1||_[_0x8d1f('0x63')]([0x3eb,0x709],_0x449b83[_0x8d1f('0x58')]);});if(!_['isEmpty'](_0x51483b)){return _[_0x8d1f('0x2c')](_0x51483b,function(_0x2314ab){return _0x2314ab[_0x8d1f('0x58')];});}else{return;}})[_0x8d1f('0x28')](function(_0x1e1eaf){if(_0x1e1eaf)_0x531e94=_0x1e1eaf;if(_[_0x8d1f('0x63')](_0x531e94,0x64)){var _0x440bba=_['find'](_0x51483b,{'sectionId':0x64});return hasDefaultDashboard(_0x440bba)[_0x8d1f('0x28')](function(_0x27ef81){return _['map'](_0x51483b,function(_0x389b89){if(_0x389b89[_0x8d1f('0x58')]===0x64){_0x389b89[_0x8d1f('0x64')]=_0x27ef81;}return _0x389b89;});});}else{return;}})['then'](function(_0x104f15){if(_0x104f15)_0x51483b=_0x104f15;if(_['includes'](_0x531e94,0x3eb)){var _0x2cd6d9=_['find'](_0x51483b,{'sectionId':0x3eb});return getCustomDashboards(_0x2cd6d9)[_0x8d1f('0x28')](function(_0xd7cb25){return _[_0x8d1f('0x2c')](_0x51483b,function(_0x3626dd){if(_0x2cd6d9[_0x8d1f('0x62')]){if(_0x3626dd[_0x8d1f('0x58')]===0x3eb){_0x3626dd['subsections']=_0xd7cb25;}}else{if(_0x3626dd[_0x8d1f('0x58')]===0x64){_0x3626dd[_0x8d1f('0x64')]=_0xd7cb25;}}return _0x3626dd;});});}else{return;}})['then'](function(_0x3ace31){if(_0x3ace31)_0x51483b=_0x3ace31;if(_[_0x8d1f('0x63')](_0x531e94,0x709)){var _0x547f24=_['find'](_0x51483b,{'sectionId':0x709});return getPlugins(_0x547f24)[_0x8d1f('0x28')](function(_0x596708){if(_0x547f24[_0x8d1f('0x62')]){return _[_0x8d1f('0x2c')](_0x51483b,function(_0x94f35b){if(_0x94f35b[_0x8d1f('0x58')]===0x709){_0x94f35b[_0x8d1f('0x64')]=_0x596708;}return _0x94f35b;});}else{var _0x381333={'sectionId':0x76c,'enabled':0x1,'subsections':_0x596708};var _0x187911=_[_0x8d1f('0x2c')](_0x51483b);_0x187911['push'](_0x381333);return _0x187911;}});}else{return;}})['then'](function(_0x31b7ae){if(_0x31b7ae)_0x51483b=_0x31b7ae;return _[_0x8d1f('0x3d')](_0x51483b,['enabled',0x1]);})['then'](respondWithResult(_0x552350,null))[_0x8d1f('0x45')](handleError(_0x552350,null));};function hasDefaultDashboard(_0x28812b){var _0x320ae7=[0x65];return new BPromise(function(_0x219f35,_0x25b35e){try{if(_0x28812b[_0x8d1f('0x56')]){_0x219f35(_0x320ae7);}else{return db[_0x8d1f('0x5b')][_0x8d1f('0x65')]({'where':{'sectionId':_0x28812b['id']},'raw':!![]})[_0x8d1f('0x28')](function(_0x49a8b3){_0x49a8b3?_0x219f35(_0x320ae7):_0x219f35();});}}catch(_0x512872){_0x25b35e(_0x512872);}});}function getCustomDashboards(_0x50e0b8){var _0x523baa=[];return new BPromise(function(_0x46b5f7,_0x2e79c6){try{if(_0x50e0b8[_0x8d1f('0x56')]){return db['Dashboard'][_0x8d1f('0x43')]({'raw':!![]})[_0x8d1f('0x28')](function(_0x33d717){_0x33d717[_0x8d1f('0x66')](function(_0x5c9618){_0x523baa[_0x8d1f('0x5e')](_0x5c9618['id']+0x1869f);});_0x46b5f7(_0x523baa);});}else{return db[_0x8d1f('0x5b')]['findAll']({'where':{'sectionId':_0x50e0b8['id']},'raw':!![]})[_0x8d1f('0x28')](function(_0x11a01b){_0x11a01b[_0x8d1f('0x66')](function(_0x4c0a5d){_0x523baa[_0x8d1f('0x5e')](_0x4c0a5d[_0x8d1f('0x67')]+0x1869f);});_0x46b5f7(_0x523baa);});}}catch(_0x396653){_0x2e79c6(_0x396653);}});}function getPlugins(_0x304d81){var _0x5a3854=[];return new BPromise(function(_0x377872,_0x2ca16d){try{if(_0x304d81[_0x8d1f('0x56')]){return db[_0x8d1f('0x68')][_0x8d1f('0x43')]({'raw':!![]})['then'](function(_0x1f31ab){_0x1f31ab[_0x8d1f('0x66')](function(_0x3672c5){_0x5a3854[_0x8d1f('0x5e')](_0x3672c5['id']+0x15b38);});_0x377872(_0x5a3854);});}else{return db[_0x8d1f('0x5b')][_0x8d1f('0x43')]({'where':{'sectionId':_0x304d81['id']},'raw':!![]})['then'](function(_0x516881){_0x516881[_0x8d1f('0x66')](function(_0x2dbaba){_0x5a3854[_0x8d1f('0x5e')](_0x2dbaba['resourceId']+0x15b38);});_0x377872(_0x5a3854);});}}catch(_0x3173b9){_0x2ca16d(_0x3173b9);}});}exports['addResources']=function(_0x273ae3,_0x32b817){return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')]({'where':{'id':_0x273ae3['params']['id']}})[_0x8d1f('0x28')](handleEntityNotFound(_0x32b817,null))[_0x8d1f('0x28')](function(_0x5c2049){if(_0x5c2049){return db['sequelize'][_0x8d1f('0x53')](function(_0x1182b5){return db[_0x8d1f('0x54')][_0x8d1f('0x43')]({'where':{'userProfileId':_0x273ae3[_0x8d1f('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x8d1f('0x28')](function(_0x22ae46){if(_0x22ae46){return db[_0x8d1f('0x54')][_0x8d1f('0x5c')]({'where':{'userProfileId':_0x273ae3[_0x8d1f('0x47')]['id'],'id':_[_0x8d1f('0x2c')](_0x22ae46,function(_0xa5ff87){return _0xa5ff87['id'];})},'transaction':_0x1182b5});}})[_0x8d1f('0x28')](function(_0x2beac2){var _0x5ae39f=_['map'](_0x273ae3[_0x8d1f('0x4b')],function(_0x5f51ad){_0x5f51ad[_0x8d1f('0x59')]=_0x273ae3['params']['id'];return _0x5f51ad;});return db[_0x8d1f('0x54')][_0x8d1f('0x69')](_0x5ae39f,{'raw':!![],'transaction':_0x1182b5});})[_0x8d1f('0x28')](function(_0x1f9af9){var _0x27b211=_[_0x8d1f('0x3d')](_[_0x8d1f('0x2c')](_0x1f9af9,function(_0x45763f){return _0x45763f[_0x8d1f('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x27b211){return db['UserProfileSection'][_0x8d1f('0x43')]({'where':{'userProfileId':_0x273ae3[_0x8d1f('0x47')]['id'],'sectionId':_[_0x8d1f('0x2c')](_0x27b211,function(_0x5640cf){return _0x5640cf[_0x8d1f('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x8d1f('0x28')](function(_0x1f8996){var _0x252e14=_[_0x8d1f('0x2c')](_0x273ae3[_0x8d1f('0x4b')],function(_0x2e2a94){_0x2e2a94[_0x8d1f('0x59')]=_0x273ae3[_0x8d1f('0x47')]['id'];return _0x2e2a94;});return db[_0x8d1f('0x5b')]['bulkCreate'](_0x252e14,{'raw':!![],'transaction':_0x1182b5});});}})[_0x8d1f('0x45')](handleError(_0x32b817,null));});}})[_0x8d1f('0x28')](function(_0x54c093){var _0x409d42=_['map'](_0x54c093,function(_0x505620){return _0x505620[_0x8d1f('0x4e')]({'plain':!![]});});})[_0x8d1f('0x28')](respondWithResult(_0x32b817,null))[_0x8d1f('0x45')](handleError(_0x32b817,null));};exports[_0x8d1f('0x6a')]=function(_0xb5d6a4,_0x13ed09,_0x2ce1b9){return db[_0x8d1f('0x2d')][_0x8d1f('0x4d')]({'where':{'id':_0xb5d6a4[_0x8d1f('0x47')]['id']}})[_0x8d1f('0x28')](handleEntityNotFound(_0x13ed09,null))[_0x8d1f('0x28')](function(_0x56f1c7){if(_0x56f1c7){return _0x56f1c7[_0x8d1f('0x6a')](_0xb5d6a4[_0x8d1f('0x32')][_0x8d1f('0x60')]);}})[_0x8d1f('0x28')](respondWithStatusCode(_0x13ed09,null))['catch'](handleError(_0x13ed09,null));};exports[_0x8d1f('0x6b')]=function(_0x3c3ff3,_0xf5638b){var _0x162f58={};if(!_0x3c3ff3['query']['section'])throw new Error(_0x8d1f('0x6c'));if(!_0x3c3ff3[_0x8d1f('0x32')][_0x8d1f('0x37')](_0x8d1f('0x38'))){_0x162f58['limit']=qs[_0x8d1f('0x20')](_0x3c3ff3['query']['limit']);_0x162f58[_0x8d1f('0x23')]=qs['offset'](_0x3c3ff3[_0x8d1f('0x32')][_0x8d1f('0x23')]);}return db['UserProfile'][_0x8d1f('0x4d')]({'where':{'id':_0x3c3ff3[_0x8d1f('0x47')]['id']}})['then'](function(_0x50c7b9){if(!_0x50c7b9)throw new Error(_0x8d1f('0x6d')+_0x3c3ff3[_0x8d1f('0x47')]['id']);return db[_0x8d1f('0x2d')][_0x8d1f('0x6b')](_0x3c3ff3);})[_0x8d1f('0x28')](respondWithFilteredResult(_0xf5638b,_0x162f58))[_0x8d1f('0x45')](handleError(_0xf5638b,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d3fa6a6..15eebb0 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb96d=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserProfile'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0xb96d,0x9e));var _0xdb96=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xb96d[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xdb96('0x0'))['db'][_0xdb96('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdb96('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb96('0x3'),'afterDestroy':_0xdb96('0x4')};function emitEvent(_0x22be94){return function(_0x488b02,_0x4af3cf,_0x291c6a){UserProfileEvents[_0xdb96('0x5')](_0x22be94+':'+_0x488b02['id'],_0x488b02);UserProfileEvents[_0xdb96('0x5')](_0x22be94,_0x488b02);_0x291c6a(null);};}for(var e in events){if(events[_0xdb96('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xdb96('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1f2d=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x37dd5e,_0x526ac7){var _0x5b345a=function(_0x302a3c){while(--_0x302a3c){_0x37dd5e['push'](_0x37dd5e['shift']());}};_0x5b345a(++_0x526ac7);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x17cca1,_0x4cd1f6){_0x17cca1=_0x17cca1-0x0;var _0x2a1d4a=_0x1f2d[_0x17cca1];return _0x2a1d4a;};'use strict';var EventEmitter=require(_0xd1f2('0x0'));var UserProfile=require(_0xd1f2('0x1'))['db'][_0xd1f2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd1f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1f2('0x4'),'afterDestroy':_0xd1f2('0x5')};function emitEvent(_0x13626e){return function(_0xd4f928,_0x21f154,_0x194b49){UserProfileEvents[_0xd1f2('0x6')](_0x13626e+':'+_0xd4f928['id'],_0xd4f928);UserProfileEvents[_0xd1f2('0x6')](_0x13626e,_0xd4f928);_0x194b49(null);};}for(var e in events){if(events[_0xd1f2('0x7')](e)){var event=events[e];UserProfile[_0xd1f2('0x8')](e,emitEvent(event));}}module[_0xd1f2('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 519366c..8c471eb 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeda8=['trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','metrics','slice','Sequelize','QueryTypes','SELECT','select','ui.','from','_interactions','where','ui.UserId\x20=\x20?','then','UserProfile','user_profiles','query','section','mergeResources','length','push','UserProfileSection','find','params','isEmpty','union','ignore','all','keys','filters','attributes','intersection','fields','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','CmContact','Tag','Tags','color','tag','openTabs','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','catch','model','associatedResources','name','resolve','UserProfileResource','map','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','parentSections','projectName','projects','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','queuecampaigns','agents','telephones','Users','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers'];(function(_0x7a68b,_0x964789){var _0x110d37=function(_0x482401){while(--_0x482401){_0x7a68b['push'](_0x7a68b['shift']());}};_0x110d37(++_0x964789);}(_0xeda8,0x104));var _0x8eda=function(_0x4aae23,_0xe728d3){_0x4aae23=_0x4aae23-0x0;var _0x4d8a91=_0xeda8[_0x4aae23];return _0x4d8a91;};'use strict';var _=require(_0x8eda('0x0'));var attributes=require(_0x8eda('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x8eda('0x2'));module[_0x8eda('0x3')]=function(_0x2090a2){var _0xc01211=_0x2090a2[_0x8eda('0x4')];function _0x94b83f(_0x25b19a,_0x3eb7b1){return new Promise(function(_0x22dee9,_0x1f3556){if(!_0x3eb7b1)return _0x22dee9(null);var _0x349361=_0x3eb7b1[_0x8eda('0x5')]?{[_0x3eb7b1['filter'][_0x8eda('0x6')]]:_0x3eb7b1[_0x8eda('0x5')][_0x8eda('0x7')]}:undefined;return _0xc01211[_0x25b19a][_0x8eda('0x8')]({'where':_0x349361,'raw':!![]})['then'](function(_0x4f7893){_0x3eb7b1['associatedResources']=_['map'](_0x4f7893,'id');_0x22dee9(_0x3eb7b1);})[_0x8eda('0x9')](function(_0x2d3739){_0x1f3556(_0x2d3739);});});}function _0x41442d(_0x515c63,_0x1ef0dc){return new Promise(function(_0x5a80ca,_0x3f34c){var _0x36689a=_0x515c63[_0x8eda('0x5')]?{[_0x515c63[_0x8eda('0x5')][_0x8eda('0x6')]]:_0x515c63[_0x8eda('0x5')][_0x8eda('0x7')]}:undefined;return _0xc01211[_0x515c63[_0x8eda('0xa')]]['findAll']({'where':_0x36689a,'raw':!![]})['then'](function(_0xe04d90){_0x1ef0dc[_0x8eda('0xb')]=_['map'](_0xe04d90,function(_0x106a04){return _0x106a04[_0x8eda('0xc')];});_0x5a80ca(_0x1ef0dc);})[_0x8eda('0x9')](function(_0x56ff8a){_0x3f34c(_0x56ff8a);});});}function _0x3f2925(_0x5594ad,_0xf7d764,_0x553382){if(!_0xf7d764)return Promise[_0x8eda('0xd')](null);return new Promise(function(_0x58023b,_0x38a6a0){return _0xc01211[_0x8eda('0xe')]['findAll']({'where':{'sectionId':_0xf7d764['id']},'raw':!![]})['then'](function(_0x6a6282){if(_0x5594ad[_0x8eda('0x6')]&&_0x5594ad[_0x8eda('0x6')]!=='id'){_0xf7d764[_0x8eda('0xb')]=_[_0x8eda('0xf')](_0x6a6282,function(_0x1b46ee){return _0x1b46ee[_0x5594ad[_0x8eda('0x6')]];});}else{if(_0x553382===_0x8eda('0x10')){_0xf7d764[_0x8eda('0xb')]=_[_0x8eda('0xf')](_0x6a6282,function(_0x279ade){return{'id':_0x279ade['resourceId'],'type':_0x279ade[_0x8eda('0x11')]};});}else{_0xf7d764['associatedResources']=_[_0x8eda('0xf')](_0x6a6282,function(_0x5183bc){return _0x5183bc[_0x8eda('0x12')];});}}_0x58023b(_0xf7d764);})[_0x8eda('0x9')](function(_0x4f3e0a){_0x38a6a0(_0x4f3e0a);});});}function _0x58e54b(_0x56dba4,_0x2a4c99){var _0x17cae8={'parentSections':[]};switch(_0x56dba4['toLowerCase']()){case _0x8eda('0x13'):_0x17cae8[_0x8eda('0x14')]='SquareProject';break;case _0x8eda('0x15'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x16');break;case _0x8eda('0x17'):_0x17cae8[_0x8eda('0x14')]='SquareRecording';_0x17cae8[_0x8eda('0x18')]=[{'name':'SquareProjects','field':_0x8eda('0xc'),'foreignKey':_0x8eda('0x19')}];break;case _0x8eda('0x1a'):_0x17cae8['childModel']=_0x8eda('0x1b');break;case _0x8eda('0x1c'):_0x17cae8[_0x8eda('0x14')]='CmContact';_0x17cae8[_0x8eda('0x18')]=[{'name':_0x8eda('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0x8eda('0x1e'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x1f');break;case _0x8eda('0x20'):_0x17cae8['childModel']='CmCompany';break;case'globalcustomfields':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x21');break;case _0x8eda('0x22'):_0x17cae8['childModel']='ChatQueue';break;case'chatwebsites':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x23');break;case _0x8eda('0x24'):_0x17cae8['childModel']='FaxQueue';break;case'faxaccounts':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x25');break;case _0x8eda('0x26'):case _0x8eda('0x27'):case _0x8eda('0x28'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x29');break;case _0x8eda('0x2a'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x2b');break;case _0x8eda('0x2c'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x2d');break;case _0x8eda('0x2e'):_0x17cae8['childModel']=_0x8eda('0x2f');_0x17cae8[_0x8eda('0x18')]=[{'name':_0x8eda('0x30'),'field':'name','foreignKey':'membername','model':_0x8eda('0x31'),'filter':{'field':_0x8eda('0x32'),'value':[_0x8eda('0x33')]}},{'name':_0x8eda('0x34'),'field':'name','foreignKey':_0x8eda('0x35'),'model':_0x8eda('0x31'),'filter':{'field':_0x8eda('0x32'),'value':[_0x8eda('0x36')]}},{'name':_0x8eda('0x37'),'field':_0x8eda('0xc'),'foreignKey':'queue','model':_0x8eda('0x38'),'filter':{'field':_0x8eda('0x11'),'value':[_0x8eda('0x39')]}},{'name':_0x8eda('0x3a'),'field':_0x8eda('0xc'),'foreignKey':_0x8eda('0x3b'),'model':'VoiceQueue','filter':{'field':_0x8eda('0x11'),'value':[_0x8eda('0x3c')]}}];break;case _0x8eda('0x3d'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x3e');break;case'chanspies':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x3f');break;case _0x8eda('0x40'):_0x17cae8['childModel']=_0x8eda('0x41');break;case'ivrcampaigns':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x42');break;case _0x8eda('0x43'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x44');break;case'mailaccounts':_0x17cae8['childModel']=_0x8eda('0x45');break;case _0x8eda('0x46'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x47');break;case _0x8eda('0x48'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x49');break;case _0x8eda('0x4a'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x4b');break;case _0x8eda('0x4c'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x4d');break;case _0x8eda('0x4e'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x4f');break;case _0x8eda('0x50'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x51');break;case'whatsappaccounts':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x52');break;case'teams':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x53');break;case'voicequeues':case _0x8eda('0x54'):_0x17cae8[_0x8eda('0x14')]='VoiceQueue';if(_0x2a4c99){_0x17cae8[_0x8eda('0x18')]=[{'name':_0x8eda('0x37')},{'name':_0x8eda('0x3a')}];}break;case'users':case _0x8eda('0x55'):case _0x8eda('0x56'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x31');if(_0x2a4c99){_0x17cae8[_0x8eda('0x18')]=[{'name':_0x8eda('0x57'),'filter':{'field':_0x8eda('0x32'),'value':['admin',_0x8eda('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':_0x8eda('0x34')}];}break;case'zendeskaccounts':_0x17cae8[_0x8eda('0x14')]='ZendeskAccount';break;case _0x8eda('0x59'):_0x17cae8['childModel']=_0x8eda('0x5a');break;case _0x8eda('0x5b'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x5c');break;case _0x8eda('0x5d'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x5e');break;case _0x8eda('0x5f'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x60');break;case _0x8eda('0x61'):_0x17cae8[_0x8eda('0x14')]='ZohoAccount';break;case _0x8eda('0x62'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x31');break;case _0x8eda('0x63'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x64');break;case _0x8eda('0x65'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x66');break;case _0x8eda('0x67'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x68');break;case _0x8eda('0x69'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x6a');break;case'pauses':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x6b');break;case _0x8eda('0x6c'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x6d');break;case _0x8eda('0x6e'):_0x17cae8['childModel']=_0x8eda('0x6f');break;case _0x8eda('0x70'):_0x17cae8[_0x8eda('0x14')]='Tag';break;case _0x8eda('0x71'):_0x17cae8['childModel']=_0x8eda('0x72');break;case _0x8eda('0x73'):_0x17cae8[_0x8eda('0x14')]='Trigger';break;case _0x8eda('0x74'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x75');break;case'variables':_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x76');break;case _0x8eda('0x77'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x78');break;case _0x8eda('0x79'):_0x17cae8[_0x8eda('0x14')]=_0x8eda('0x10');_0x17cae8[_0x8eda('0x18')]=[{'name':_0x8eda('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x8eda('0x7b'):_0x17cae8[_0x8eda('0x14')]='AnalyticMetric';break;}return _0x17cae8;}function _0x709b8(_0x54df94,_0x5f51fc){var _0x4a3e61=_0x54df94['charAt'](0x0)['toUpperCase']()+_0x54df94[_0x8eda('0x7c')](0x1);var _0x4f9a28={'type':_0xc01211[_0x8eda('0x7d')][_0x8eda('0x7e')][_0x8eda('0x7f')],'raw':!![]};return new Promise(function(_0x3298fa,_0x21bd2b){var _0x302d82=squel[_0x8eda('0x80')]()['field'](_0x8eda('0x81')+_0x4a3e61+'InteractionId','id')[_0x8eda('0x6')]('ui.createdAt')[_0x8eda('0x82')]('user_has_'+_0x54df94+_0x8eda('0x83'),'ui')[_0x8eda('0x84')](_0x8eda('0x85'),_0x5f51fc['id']);return _0xc01211['sequelize']['query'](_0x302d82['toString'](),_0x4f9a28)[_0x8eda('0x86')](function(_0xbed399){_0x5f51fc[_0x4a3e61+'OpenTabs']=_0xbed399;_0x3298fa(_0xbed399);})[_0x8eda('0x9')](function(_0x4d6c1a){_0x21bd2b(_0x4d6c1a);});});}return _0x2090a2['define'](_0x8eda('0x87'),attributes,{'tableName':_0x8eda('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x284065){var _0x1a57ba={'raw':![],'where':{}};var _0x5e45ec={};var _0x503ed5={'count':0x0,'rows':[]};var _0x272026=_0x284065[_0x8eda('0x89')][_0x8eda('0x8a')];var _0x2119ce=_0x284065['query'][_0x8eda('0x8b')]||![];var _0x48235f=_0x58e54b(_0x272026,_0x2119ce);if(!_0x48235f[_0x8eda('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x272026+'\x27');var _0x16c7c4=[{'name':_0x272026}];if(!_['isEmpty'](_0x48235f[_0x8eda('0x18')]))_0x16c7c4=_0x48235f[_0x8eda('0x18')];var _0x39d93c=[];for(var _0x3e46d1=0x0;_0x3e46d1<_0x16c7c4[_0x8eda('0x8c')];_0x3e46d1++){_0x39d93c[_0x8eda('0x8d')](_0xc01211[_0x8eda('0x8e')][_0x8eda('0x8f')]({'where':{'userProfileId':_0x284065[_0x8eda('0x90')]['id'],'name':_0x16c7c4[_0x3e46d1]['name']},'raw':!![]}));}return Promise['all'](_0x39d93c)[_0x8eda('0x86')](function(_0x562819){var _0x1364b2=_[_0x8eda('0x5')](_0x562819,function(_0xd309a8){return _0xd309a8?_0xd309a8:undefined;});var _0x2ca608=_[_0x8eda('0x5')](_0x16c7c4,['ignore',!![]]);var _0x5d3e8f=_[_0x8eda('0x91')](_0x1364b2)&&_[_0x8eda('0x91')](_0x2ca608)?null:_[_0x8eda('0x92')](_0x2ca608,_0x1364b2);if(!_0x5d3e8f)return null;var _0xc6a2d8=[];for(var _0x24953a=0x0;_0x24953a<_0x5d3e8f[_0x8eda('0x8c')];_0x24953a++){var _0x10cda2=_['find'](_0x16c7c4,function(_0x283dca){return _0x5d3e8f[_0x24953a]?_0x283dca[_0x8eda('0xc')]===_0x5d3e8f[_0x24953a]['name']:null;});if(_0x10cda2){if(_0x5d3e8f[_0x24953a][_0x8eda('0x93')]){_0xc6a2d8['push'](_0x94b83f(_0x48235f['childModel'],_0x5d3e8f[_0x24953a]));}else{if(!_0x5d3e8f[_0x24953a]['autoAssociation']){_0xc6a2d8['push'](_0x3f2925(_0x10cda2,_0x5d3e8f[_0x24953a],_0x48235f[_0x8eda('0x14')]));}else{if(_0x10cda2[_0x8eda('0xa')]){_0xc6a2d8[_0x8eda('0x8d')](_0x41442d(_0x10cda2,_0x5d3e8f[_0x24953a]));}}}}}return Promise[_0x8eda('0x94')](_0xc6a2d8);})[_0x8eda('0x86')](function(_0xe5d324){var _0x589c2f=_0xe5d324;var _0x46fb9e=null;if(_0x589c2f){_0x46fb9e=_0x589c2f[_0x8eda('0x8c')]===0x1?_0x589c2f[0x0]:null;}if(!_0x46fb9e&&!_0x589c2f)return _0x503ed5;var _0x8b10bd=_0xc01211[_0x48235f[_0x8eda('0x14')]]['rawAttributes'];_0x5e45ec[_0x8eda('0xa')]=_[_0x8eda('0x95')](_0x8b10bd);_0x5e45ec[_0x8eda('0x89')]=_[_0x8eda('0x95')](_0x284065[_0x8eda('0x89')]);_0x5e45ec[_0x8eda('0x96')]=_['intersection'](_0x5e45ec[_0x8eda('0xa')],_0x5e45ec[_0x8eda('0x89')]);_0x1a57ba[_0x8eda('0x97')]=_[_0x8eda('0x98')](_0x5e45ec[_0x8eda('0xa')],qs[_0x8eda('0x99')](_0x284065[_0x8eda('0x89')][_0x8eda('0x99')]));_0x1a57ba[_0x8eda('0x97')]=_0x1a57ba[_0x8eda('0x97')][_0x8eda('0x8c')]?_0x1a57ba[_0x8eda('0x97')]:_0x5e45ec[_0x8eda('0xa')];if(!_0x284065[_0x8eda('0x89')]['hasOwnProperty']('nolimit')){_0x1a57ba[_0x8eda('0x9a')]=qs[_0x8eda('0x9a')](_0x284065[_0x8eda('0x89')][_0x8eda('0x9a')]);_0x1a57ba['offset']=qs[_0x8eda('0x9b')](_0x284065[_0x8eda('0x89')]['offset']);}_0x1a57ba[_0x8eda('0x9c')]=qs['sort'](_0x284065[_0x8eda('0x89')][_0x8eda('0x9d')]);_0x1a57ba[_0x8eda('0x84')]=qs['filters'](_[_0x8eda('0x9e')](_0x284065[_0x8eda('0x89')],_0x5e45ec[_0x8eda('0x96')]));if(_0x284065['query'][_0x8eda('0x5')]){_0x1a57ba[_0x8eda('0x84')]=_[_0x8eda('0x9f')](_0x1a57ba[_0x8eda('0x84')],{'$or':_['map'](_0x8b10bd,function(_0x4e9caa){if(_0x4e9caa[_0x8eda('0x11')][_0x8eda('0xa0')]!==_0x8eda('0xa1')){var _0xd93d5={};_0xd93d5[_0x4e9caa['field']]={'$like':'%'+_0x284065[_0x8eda('0x89')][_0x8eda('0x5')]+'%'};return _0xd93d5;}})});}var _0x1aca01=[];var _0x42e6aa=null;var _0x86e7dd={};if(_0x46fb9e){_0x42e6aa=_['find'](_0x16c7c4,[_0x8eda('0xc'),_0x46fb9e[_0x8eda('0xc')]]);if(_0x42e6aa[_0x8eda('0x6')]){_0x86e7dd={};if(_0x48235f['childModel']==='AnalyticExtractedReport'){_0x86e7dd[_0x42e6aa['foreignKey']]=_[_0x8eda('0xf')](_0x46fb9e[_0x8eda('0xb')],'id');}else{_0x86e7dd[_0x42e6aa[_0x8eda('0xa2')]]=_0x46fb9e[_0x8eda('0xb')];}_0x1aca01[_0x8eda('0x8d')](_0x86e7dd);}else{_0x1a57ba[_0x8eda('0x84')]['id']=_0x46fb9e[_0x8eda('0xb')];}}else{for(var _0x3f700a=0x0;_0x3f700a<_0x589c2f['length'];_0x3f700a++){_0x42e6aa=_[_0x8eda('0x8f')](_0x16c7c4,[_0x8eda('0xc'),_0x589c2f[_0x3f700a][_0x8eda('0xc')]]);if(_0x42e6aa['field']){_0x86e7dd={};_0x86e7dd[_0x42e6aa[_0x8eda('0xa2')]]=_0x589c2f[_0x3f700a][_0x8eda('0xb')];_0x1aca01[_0x8eda('0x8d')](_0x86e7dd);}else{if(!_0x1a57ba[_0x8eda('0x84')]['id'])_0x1a57ba[_0x8eda('0x84')]['id']=[];_0x589c2f[_0x3f700a][_0x8eda('0xb')][_0x8eda('0xa3')](function(_0x28d913){_0x1a57ba[_0x8eda('0x84')]['id'][_0x8eda('0x8d')](_0x28d913);});}}}if(!_[_0x8eda('0x91')](_0x1aca01)){_0x1a57ba['where']=_[_0x8eda('0x9f')](_0x1a57ba[_0x8eda('0x84')],{'$and':{'$or':_0x1aca01}});}_0x1a57ba=_[_0x8eda('0x9f')]({},_0x1a57ba,_0x284065[_0x8eda('0xa4')]);if(_0x46fb9e&&!_0x46fb9e[_0x8eda('0xa5')]&&_0x48235f[_0x8eda('0x14')]===_0x8eda('0x10')){if(_0x284065[_0x8eda('0x89')][_0x8eda('0xa6')]){_0x1a57ba[_0x8eda('0xa7')]=[{'all':!![]}];}return _0xc01211[_0x48235f[_0x8eda('0x14')]]['findAll'](_0x1a57ba)['then'](function(_0x49c49f){var _0x866491=[];_0x49c49f[_0x8eda('0xa3')](function(_0x5e3b35){var _0x294b79;switch(_0x5e3b35[_0x8eda('0xa8')]){case _0x8eda('0xa9'):_0x294b79=_['find'](_0x46fb9e[_0x8eda('0xb')],function(_0x4cec3f){return _0x4cec3f['id']===_0x5e3b35[_0x8eda('0xaa')]&&_0x4cec3f['type']===_0x8eda('0xab');});break;case _0x8eda('0xac'):_0x294b79=_['find'](_0x46fb9e[_0x8eda('0xb')],function(_0x4235fa){return _0x4235fa['id']===_0x5e3b35[_0x8eda('0xaa')]&&_0x4235fa[_0x8eda('0x11')]===_0x8eda('0xad');});break;}if(_0x294b79)_0x866491[_0x8eda('0x8d')](_0x5e3b35);});_0x503ed5[_0x8eda('0xae')]=_0x866491[_0x8eda('0x8c')];_0x503ed5[_0x8eda('0xaf')]=_0x866491;return _0x503ed5;});}else{return _0xc01211[_0x48235f[_0x8eda('0x14')]]['count']({'where':_0x1a57ba['where']})['then'](function(_0x5b64c8){_0x503ed5[_0x8eda('0xae')]=_0x5b64c8;if(_0x284065[_0x8eda('0x89')][_0x8eda('0xa6')]){if(_0x48235f['childModel']===_0x8eda('0xb0')){_0x1a57ba[_0x8eda('0xa7')]=[{'model':_0xc01211[_0x8eda('0xb1')],'as':_0x8eda('0xb2'),'attributes':['id',_0x8eda('0xc'),_0x8eda('0xb3')],'required':_0x284065[_0x8eda('0x89')][_0x8eda('0xb4')]?!![]:![]},{'model':_0xc01211['Tag'],'as':'ThroughTags','attributes':['id',_0x8eda('0xc'),_0x8eda('0xb3')],'through':_0x284065['query'][_0x8eda('0xb4')]?{'attributes':[],'where':{'TagId':_0x284065[_0x8eda('0x89')][_0x8eda('0xb4')]||undefined}}:{},'required':_0x284065['query'][_0x8eda('0xb4')]?!![]:![]}];}else{_0x1a57ba[_0x8eda('0xa7')]=[{'all':!![]}];}}return _0xc01211[_0x48235f[_0x8eda('0x14')]][_0x8eda('0x8')](_0x1a57ba);})[_0x8eda('0x86')](function(_0x3c0bc4){_0x503ed5[_0x8eda('0xaf')]=_0x3c0bc4;if(_0x272026==='Agents'&&_0x284065[_0x8eda('0x89')][_0x8eda('0xb5')]==='true'){var _0x5d8512=[];for(var _0x4d5b58=0x0;_0x4d5b58<_0x503ed5[_0x8eda('0xaf')][_0x8eda('0x8c')];_0x4d5b58++){_0x5d8512[_0x8eda('0x8d')](_0x709b8(_0x8eda('0xb6'),_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));_0x5d8512[_0x8eda('0x8d')](_0x709b8(_0x8eda('0xb8'),_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));_0x5d8512[_0x8eda('0x8d')](_0x709b8(_0x8eda('0xb9'),_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));_0x5d8512['push'](_0x709b8(_0x8eda('0xba'),_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));_0x5d8512[_0x8eda('0x8d')](_0x709b8('openchannel',_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));_0x5d8512[_0x8eda('0x8d')](_0x709b8(_0x8eda('0xbb'),_0x503ed5[_0x8eda('0xaf')][_0x4d5b58][_0x8eda('0xb7')]));}return Promise[_0x8eda('0x94')](_0x5d8512)[_0x8eda('0x86')](function(){return _0x503ed5;});}return _0x503ed5;});}});}}});}; \ No newline at end of file +var _0xc1c6=['query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','all','model','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','count','CmContact','Tag','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','then','map','catch','findAll','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','contacts','parentSections','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','VoiceMail','VoiceRecording','Agents','membername','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1415ee,_0x3e6af9){_0x1415ee=_0x1415ee-0x0;var _0x962c3=_0xc1c6[_0x1415ee];return _0x962c3;};'use strict';var _=require(_0x6c1c('0x0'));var attributes=require(_0x6c1c('0x1'));var qs=require(_0x6c1c('0x2'));var squel=require('squel');module[_0x6c1c('0x3')]=function(_0x4c33ca){var _0x426398=_0x4c33ca[_0x6c1c('0x4')];function _0x265d2c(_0x59f799,_0x56ed6f){return new Promise(function(_0x32af84,_0x524a6b){if(!_0x56ed6f)return _0x32af84(null);var _0x50c1bb=_0x56ed6f['filter']?{[_0x56ed6f[_0x6c1c('0x5')][_0x6c1c('0x6')]]:_0x56ed6f[_0x6c1c('0x5')][_0x6c1c('0x7')]}:undefined;return _0x426398[_0x59f799]['findAll']({'where':_0x50c1bb,'raw':!![]})[_0x6c1c('0x8')](function(_0x3ca985){_0x56ed6f['associatedResources']=_[_0x6c1c('0x9')](_0x3ca985,'id');_0x32af84(_0x56ed6f);})[_0x6c1c('0xa')](function(_0xb3bd12){_0x524a6b(_0xb3bd12);});});}function _0x1137e8(_0x49fb01,_0x3a25a2){return new Promise(function(_0x2a4fd4,_0x40cebf){var _0x5af308=_0x49fb01[_0x6c1c('0x5')]?{[_0x49fb01[_0x6c1c('0x5')][_0x6c1c('0x6')]]:_0x49fb01['filter'][_0x6c1c('0x7')]}:undefined;return _0x426398[_0x49fb01['model']][_0x6c1c('0xb')]({'where':_0x5af308,'raw':!![]})[_0x6c1c('0x8')](function(_0x2d279e){_0x3a25a2[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x2d279e,function(_0x3f532c){return _0x3f532c[_0x6c1c('0xd')];});_0x2a4fd4(_0x3a25a2);})[_0x6c1c('0xa')](function(_0x448f35){_0x40cebf(_0x448f35);});});}function _0x5f3758(_0x3df1b7,_0x174657,_0x5214ee){if(!_0x174657)return Promise[_0x6c1c('0xe')](null);return new Promise(function(_0x237cac,_0x494ffc){return _0x426398[_0x6c1c('0xf')]['findAll']({'where':{'sectionId':_0x174657['id']},'raw':!![]})[_0x6c1c('0x8')](function(_0x1a0ab9){if(_0x3df1b7['field']&&_0x3df1b7[_0x6c1c('0x6')]!=='id'){_0x174657['associatedResources']=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x3527bf){return _0x3527bf[_0x3df1b7[_0x6c1c('0x6')]];});}else{if(_0x5214ee===_0x6c1c('0x10')){_0x174657[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x1993c5){return{'id':_0x1993c5[_0x6c1c('0x11')],'type':_0x1993c5[_0x6c1c('0x12')]};});}else{_0x174657[_0x6c1c('0xc')]=_[_0x6c1c('0x9')](_0x1a0ab9,function(_0x450b1f){return _0x450b1f[_0x6c1c('0x11')];});}}_0x237cac(_0x174657);})[_0x6c1c('0xa')](function(_0x31fed2){_0x494ffc(_0x31fed2);});});}function _0x19c269(_0x2319d3,_0x12c638){var _0x3a3f13={'parentSections':[]};switch(_0x2319d3[_0x6c1c('0x13')]()){case _0x6c1c('0x14'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x16');break;case _0x6c1c('0x17'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x18');break;case _0x6c1c('0x19'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x1a');_0x3a3f13['parentSections']=[{'name':_0x6c1c('0x1b'),'field':'name','foreignKey':_0x6c1c('0x1c')}];break;case'projects':_0x3a3f13[_0x6c1c('0x15')]='JscriptyProject';break;case _0x6c1c('0x1d'):_0x3a3f13[_0x6c1c('0x15')]='CmContact';_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x6c1c('0x20'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x21');break;case _0x6c1c('0x22'):_0x3a3f13['childModel']='CmCompany';break;case _0x6c1c('0x23'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x24');break;case _0x6c1c('0x25'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x26');break;case'chatwebsites':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x27');break;case'faxqueues':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x28');break;case _0x6c1c('0x29'):_0x3a3f13[_0x6c1c('0x15')]='FaxAccount';break;case _0x6c1c('0x2a'):case _0x6c1c('0x2b'):case _0x6c1c('0x2c'):_0x3a3f13['childModel']=_0x6c1c('0x2d');break;case'contexts':_0x3a3f13[_0x6c1c('0x15')]='VoiceContext';break;case _0x6c1c('0x2e'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x2f');break;case'voicerecordings':_0x3a3f13['childModel']=_0x6c1c('0x30');_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x31'),'field':'name','foreignKey':_0x6c1c('0x32'),'model':'User','filter':{'field':'role','value':[_0x6c1c('0x33')]}},{'name':_0x6c1c('0x34'),'field':_0x6c1c('0xd'),'foreignKey':_0x6c1c('0x32'),'model':'User','filter':{'field':_0x6c1c('0x35'),'value':[_0x6c1c('0x36')]}},{'name':_0x6c1c('0x37'),'field':_0x6c1c('0xd'),'foreignKey':_0x6c1c('0x38'),'model':_0x6c1c('0x39'),'filter':{'field':_0x6c1c('0x12'),'value':[_0x6c1c('0x3a')]}},{'name':_0x6c1c('0x3b'),'field':_0x6c1c('0xd'),'foreignKey':'queue','model':_0x6c1c('0x39'),'filter':{'field':_0x6c1c('0x12'),'value':[_0x6c1c('0x3c')]}}];break;case _0x6c1c('0x3d'):_0x3a3f13[_0x6c1c('0x15')]='VoiceMusicOnHold';break;case'chanspies':_0x3a3f13['childModel']=_0x6c1c('0x3e');break;case'voiceprefixes':_0x3a3f13['childModel']=_0x6c1c('0x3f');break;case _0x6c1c('0x40'):_0x3a3f13['childModel']=_0x6c1c('0x41');break;case _0x6c1c('0x42'):_0x3a3f13[_0x6c1c('0x15')]='MailQueue';break;case _0x6c1c('0x43'):_0x3a3f13[_0x6c1c('0x15')]='MailAccount';break;case _0x6c1c('0x44'):_0x3a3f13['childModel']=_0x6c1c('0x45');break;case _0x6c1c('0x46'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x47');break;case _0x6c1c('0x48'):_0x3a3f13['childModel']=_0x6c1c('0x49');break;case _0x6c1c('0x4a'):_0x3a3f13[_0x6c1c('0x15')]='SmsQueue';break;case _0x6c1c('0x4b'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x4c');break;case _0x6c1c('0x4d'):_0x3a3f13[_0x6c1c('0x15')]='WhatsappQueue';break;case _0x6c1c('0x4e'):_0x3a3f13['childModel']='WhatsappAccount';break;case'teams':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x4f');break;case _0x6c1c('0x50'):case _0x6c1c('0x51'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x39');if(_0x12c638){_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x37')},{'name':'QueueCampaigns'}];}break;case _0x6c1c('0x52'):case _0x6c1c('0x53'):case'telephones':_0x3a3f13[_0x6c1c('0x15')]='User';if(_0x12c638){_0x3a3f13[_0x6c1c('0x1e')]=[{'name':_0x6c1c('0x54'),'filter':{'field':_0x6c1c('0x35'),'value':[_0x6c1c('0x55'),_0x6c1c('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6c1c('0x34')}];}break;case'zendeskaccounts':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x57');break;case _0x6c1c('0x58'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x59');break;case _0x6c1c('0x5a'):_0x3a3f13['childModel']=_0x6c1c('0x5b');break;case _0x6c1c('0x5c'):_0x3a3f13['childModel']=_0x6c1c('0x5d');break;case _0x6c1c('0x5e'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x5f');break;case'zohoaccounts':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x60');break;case _0x6c1c('0x61'):_0x3a3f13['childModel']='User';break;case'cannedanswers':_0x3a3f13['childModel']='CannedAnswer';break;case _0x6c1c('0x62'):_0x3a3f13[_0x6c1c('0x15')]='Disposition';break;case _0x6c1c('0x63'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x64');break;case'intervals':_0x3a3f13['childModel']=_0x6c1c('0x65');break;case _0x6c1c('0x66'):_0x3a3f13['childModel']=_0x6c1c('0x67');break;case _0x6c1c('0x68'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x69');break;case _0x6c1c('0x6a'):_0x3a3f13[_0x6c1c('0x15')]='Sound';break;case _0x6c1c('0x6b'):_0x3a3f13[_0x6c1c('0x15')]='Tag';break;case'templates':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x6c');break;case _0x6c1c('0x6d'):_0x3a3f13['childModel']=_0x6c1c('0x6e');break;case _0x6c1c('0x6f'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x70');break;case'variables':_0x3a3f13['childModel']=_0x6c1c('0x71');break;case _0x6c1c('0x72'):_0x3a3f13[_0x6c1c('0x15')]='Plugin';break;case'extractedreports':_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x10');_0x3a3f13['parentSections']=[{'name':_0x6c1c('0x73'),'field':'id','foreignKey':_0x6c1c('0x74')}];break;case _0x6c1c('0x75'):_0x3a3f13[_0x6c1c('0x15')]=_0x6c1c('0x76');break;}return _0x3a3f13;}function _0x24c993(_0x4f027a,_0x398bca){var _0x5a2692=_0x4f027a[_0x6c1c('0x77')](0x0)[_0x6c1c('0x78')]()+_0x4f027a[_0x6c1c('0x79')](0x1);var _0x319820={'type':_0x426398['Sequelize']['QueryTypes'][_0x6c1c('0x7a')],'raw':!![]};return new Promise(function(_0x3255e1,_0x612be2){var _0x54da73=squel[_0x6c1c('0x7b')]()[_0x6c1c('0x6')](_0x6c1c('0x7c')+_0x5a2692+_0x6c1c('0x7d'),'id')[_0x6c1c('0x6')](_0x6c1c('0x7e'))[_0x6c1c('0x7f')]('user_has_'+_0x4f027a+_0x6c1c('0x80'),'ui')['where'](_0x6c1c('0x81'),_0x398bca['id']);return _0x426398[_0x6c1c('0x82')][_0x6c1c('0x83')](_0x54da73[_0x6c1c('0x84')](),_0x319820)['then'](function(_0x43423e){_0x398bca[_0x5a2692+_0x6c1c('0x85')]=_0x43423e;_0x3255e1(_0x43423e);})[_0x6c1c('0xa')](function(_0x1de8c9){_0x612be2(_0x1de8c9);});});}return _0x4c33ca[_0x6c1c('0x86')](_0x6c1c('0x87'),attributes,{'tableName':_0x6c1c('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x458c01){var _0x2d248c={'raw':![],'where':{}};var _0x13963a={};var _0x26ee48={'count':0x0,'rows':[]};var _0x4fa646=_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x89')];var _0x18cb06=_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x8a')]||![];var _0x59bd3f=_0x19c269(_0x4fa646,_0x18cb06);if(!_0x59bd3f[_0x6c1c('0x15')])throw new Error(_0x6c1c('0x8b')+_0x4fa646+'\x27');var _0x494a6f=[{'name':_0x4fa646}];if(!_[_0x6c1c('0x8c')](_0x59bd3f[_0x6c1c('0x1e')]))_0x494a6f=_0x59bd3f[_0x6c1c('0x1e')];var _0x552718=[];for(var _0x3d3ed=0x0;_0x3d3ed<_0x494a6f[_0x6c1c('0x8d')];_0x3d3ed++){_0x552718[_0x6c1c('0x8e')](_0x426398[_0x6c1c('0x8f')][_0x6c1c('0x90')]({'where':{'userProfileId':_0x458c01[_0x6c1c('0x91')]['id'],'name':_0x494a6f[_0x3d3ed]['name']},'raw':!![]}));}return Promise['all'](_0x552718)[_0x6c1c('0x8')](function(_0x153ff1){var _0x5a35a1=_['filter'](_0x153ff1,function(_0x5f125d){return _0x5f125d?_0x5f125d:undefined;});var _0x45da13=_[_0x6c1c('0x5')](_0x494a6f,[_0x6c1c('0x92'),!![]]);var _0x5a7298=_['isEmpty'](_0x5a35a1)&&_[_0x6c1c('0x8c')](_0x45da13)?null:_['union'](_0x45da13,_0x5a35a1);if(!_0x5a7298)return null;var _0x5e3c65=[];for(var _0x4f3ade=0x0;_0x4f3ade<_0x5a7298[_0x6c1c('0x8d')];_0x4f3ade++){var _0x1e20a9=_[_0x6c1c('0x90')](_0x494a6f,function(_0x42ae1b){return _0x5a7298[_0x4f3ade]?_0x42ae1b[_0x6c1c('0xd')]===_0x5a7298[_0x4f3ade][_0x6c1c('0xd')]:null;});if(_0x1e20a9){if(_0x5a7298[_0x4f3ade]['ignore']){_0x5e3c65[_0x6c1c('0x8e')](_0x265d2c(_0x59bd3f[_0x6c1c('0x15')],_0x5a7298[_0x4f3ade]));}else{if(!_0x5a7298[_0x4f3ade][_0x6c1c('0x93')]){_0x5e3c65['push'](_0x5f3758(_0x1e20a9,_0x5a7298[_0x4f3ade],_0x59bd3f['childModel']));}else{if(_0x1e20a9['model']){_0x5e3c65[_0x6c1c('0x8e')](_0x1137e8(_0x1e20a9,_0x5a7298[_0x4f3ade]));}}}}}return Promise[_0x6c1c('0x94')](_0x5e3c65);})['then'](function(_0x10e499){var _0x579ca3=_0x10e499;var _0x40a0c5=null;if(_0x579ca3){_0x40a0c5=_0x579ca3[_0x6c1c('0x8d')]===0x1?_0x579ca3[0x0]:null;}if(!_0x40a0c5&&!_0x579ca3)return _0x26ee48;var _0x1a9489=_0x426398[_0x59bd3f[_0x6c1c('0x15')]]['rawAttributes'];_0x13963a[_0x6c1c('0x95')]=_[_0x6c1c('0x96')](_0x1a9489);_0x13963a['query']=_['keys'](_0x458c01[_0x6c1c('0x83')]);_0x13963a[_0x6c1c('0x97')]=_[_0x6c1c('0x98')](_0x13963a['model'],_0x13963a[_0x6c1c('0x83')]);_0x2d248c[_0x6c1c('0x99')]=_['intersection'](_0x13963a['model'],qs['fields'](_0x458c01['query'][_0x6c1c('0x9a')]));_0x2d248c['attributes']=_0x2d248c[_0x6c1c('0x99')][_0x6c1c('0x8d')]?_0x2d248c[_0x6c1c('0x99')]:_0x13963a['model'];if(!_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x9b')](_0x6c1c('0x9c'))){_0x2d248c[_0x6c1c('0x9d')]=qs[_0x6c1c('0x9d')](_0x458c01['query'][_0x6c1c('0x9d')]);_0x2d248c['offset']=qs[_0x6c1c('0x9e')](_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x9e')]);}_0x2d248c[_0x6c1c('0x9f')]=qs[_0x6c1c('0xa0')](_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa0')]);_0x2d248c[_0x6c1c('0xa1')]=qs['filters'](_[_0x6c1c('0xa2')](_0x458c01['query'],_0x13963a['filters']));if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0x5')]){_0x2d248c[_0x6c1c('0xa1')]=_[_0x6c1c('0xa3')](_0x2d248c['where'],{'$or':_[_0x6c1c('0x9')](_0x1a9489,function(_0x4c7856){if(_0x4c7856[_0x6c1c('0x12')]['key']!==_0x6c1c('0xa4')){var _0x23332d={};_0x23332d[_0x4c7856[_0x6c1c('0x6')]]={'$like':'%'+_0x458c01['query'][_0x6c1c('0x5')]+'%'};return _0x23332d;}})});}var _0xa9a844=[];var _0x19a26b=null;var _0x4b5801={};if(_0x40a0c5){_0x19a26b=_[_0x6c1c('0x90')](_0x494a6f,[_0x6c1c('0xd'),_0x40a0c5[_0x6c1c('0xd')]]);if(_0x19a26b[_0x6c1c('0x6')]){_0x4b5801={};if(_0x59bd3f['childModel']===_0x6c1c('0x10')){_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_[_0x6c1c('0x9')](_0x40a0c5[_0x6c1c('0xc')],'id');}else{_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_0x40a0c5['associatedResources'];}_0xa9a844[_0x6c1c('0x8e')](_0x4b5801);}else{_0x2d248c[_0x6c1c('0xa1')]['id']=_0x40a0c5[_0x6c1c('0xc')];}}else{for(var _0x1a5476=0x0;_0x1a5476<_0x579ca3['length'];_0x1a5476++){_0x19a26b=_[_0x6c1c('0x90')](_0x494a6f,[_0x6c1c('0xd'),_0x579ca3[_0x1a5476][_0x6c1c('0xd')]]);if(_0x19a26b['field']){_0x4b5801={};_0x4b5801[_0x19a26b[_0x6c1c('0xa5')]]=_0x579ca3[_0x1a5476][_0x6c1c('0xc')];_0xa9a844['push'](_0x4b5801);}else{if(!_0x2d248c[_0x6c1c('0xa1')]['id'])_0x2d248c['where']['id']=[];_0x579ca3[_0x1a5476][_0x6c1c('0xc')][_0x6c1c('0xa6')](function(_0x246682){_0x2d248c[_0x6c1c('0xa1')]['id']['push'](_0x246682);});}}}if(!_[_0x6c1c('0x8c')](_0xa9a844)){_0x2d248c[_0x6c1c('0xa1')]=_[_0x6c1c('0xa3')](_0x2d248c['where'],{'$and':{'$or':_0xa9a844}});}_0x2d248c=_[_0x6c1c('0xa3')]({},_0x2d248c,_0x458c01[_0x6c1c('0xa7')]);if(_0x40a0c5&&!_0x40a0c5[_0x6c1c('0x93')]&&_0x59bd3f[_0x6c1c('0x15')]==='AnalyticExtractedReport'){if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa8')]){_0x2d248c[_0x6c1c('0xa9')]=[{'all':!![]}];}return _0x426398[_0x59bd3f['childModel']][_0x6c1c('0xb')](_0x2d248c)['then'](function(_0x29c5c8){var _0x27a9ea=[];_0x29c5c8[_0x6c1c('0xa6')](function(_0x1fd7ec){var _0x29da07;switch(_0x1fd7ec[_0x6c1c('0xaa')]){case _0x6c1c('0xab'):_0x29da07=_[_0x6c1c('0x90')](_0x40a0c5['associatedResources'],function(_0x426d7c){return _0x426d7c['id']===_0x1fd7ec['reportId']&&_0x426d7c[_0x6c1c('0x12')]===_0x6c1c('0xac');});break;case _0x6c1c('0xad'):_0x29da07=_[_0x6c1c('0x90')](_0x40a0c5['associatedResources'],function(_0x357e1a){return _0x357e1a['id']===_0x1fd7ec[_0x6c1c('0x74')]&&_0x357e1a[_0x6c1c('0x12')]==='CustomReports';});break;}if(_0x29da07)_0x27a9ea[_0x6c1c('0x8e')](_0x1fd7ec);});_0x26ee48[_0x6c1c('0xae')]=_0x27a9ea['length'];_0x26ee48['rows']=_0x27a9ea;return _0x26ee48;});}else{return _0x426398[_0x59bd3f[_0x6c1c('0x15')]][_0x6c1c('0xae')]({'where':_0x2d248c[_0x6c1c('0xa1')]})[_0x6c1c('0x8')](function(_0x305cc2){_0x26ee48[_0x6c1c('0xae')]=_0x305cc2;if(_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xa8')]){if(_0x59bd3f[_0x6c1c('0x15')]===_0x6c1c('0xaf')){_0x2d248c[_0x6c1c('0xa9')]=[{'model':_0x426398[_0x6c1c('0xb0')],'as':'Tags','attributes':['id',_0x6c1c('0xd'),_0x6c1c('0xb1')],'required':_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xb2')]?!![]:![]},{'model':_0x426398[_0x6c1c('0xb0')],'as':_0x6c1c('0xb3'),'attributes':['id',_0x6c1c('0xd'),'color'],'through':_0x458c01[_0x6c1c('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x458c01['query'][_0x6c1c('0xb2')]||undefined}}:{},'required':_0x458c01[_0x6c1c('0x83')][_0x6c1c('0xb2')]?!![]:![]}];}else{_0x2d248c[_0x6c1c('0xa9')]=[{'all':!![]}];}}return _0x426398[_0x59bd3f[_0x6c1c('0x15')]][_0x6c1c('0xb')](_0x2d248c);})[_0x6c1c('0x8')](function(_0x2a2797){_0x26ee48[_0x6c1c('0xb4')]=_0x2a2797;if(_0x4fa646===_0x6c1c('0x31')&&_0x458c01['query'][_0x6c1c('0xb5')]===_0x6c1c('0xb6')){var _0x1a0da8=[];for(var _0x3efe9c=0x0;_0x3efe9c<_0x26ee48[_0x6c1c('0xb4')][_0x6c1c('0x8d')];_0x3efe9c++){_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xb7'),_0x26ee48['rows'][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xb9'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xba'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993(_0x6c1c('0xbb'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8[_0x6c1c('0x8e')](_0x24c993('openchannel',_0x26ee48['rows'][_0x3efe9c][_0x6c1c('0xb8')]));_0x1a0da8['push'](_0x24c993(_0x6c1c('0xbc'),_0x26ee48[_0x6c1c('0xb4')][_0x3efe9c][_0x6c1c('0xb8')]));}return Promise[_0x6c1c('0x94')](_0x1a0da8)[_0x6c1c('0x8')](function(){return _0x26ee48;});}return _0x26ee48;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index a108e94..5e728c1 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1419=['info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then'];(function(_0xb8e56c,_0x1e250c){var _0x2dab5a=function(_0xcc4e3c){while(--_0xcc4e3c){_0xb8e56c['push'](_0xb8e56c['shift']());}};_0x2dab5a(++_0x1e250c);}(_0x1419,0x127));var _0x9141=function(_0x509657,_0x29ae38){_0x509657=_0x509657-0x0;var _0x2cfd1b=_0x1419[_0x509657];return _0x2cfd1b;};'use strict';var _=require(_0x9141('0x0'));var util=require(_0x9141('0x1'));var moment=require(_0x9141('0x2'));var BPromise=require(_0x9141('0x3'));var rs=require(_0x9141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9141('0x5'));var logger=require(_0x9141('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9141('0x7'));var client=jayson[_0x9141('0x8')][_0x9141('0x9')]({'port':0x232a});config[_0x9141('0xa')]=_[_0x9141('0xb')](config[_0x9141('0xa')],{'host':_0x9141('0xc'),'port':0x18eb});var socket=require(_0x9141('0xd'))(new Redis(config[_0x9141('0xa')]));require(_0x9141('0xe'))['register'](socket);function respondWithRpcPromise(_0xb3ee2e,_0x406153,_0x30ce0b){return new BPromise(function(_0x1de00d,_0x2d35e3){return client[_0x9141('0xf')](_0xb3ee2e,_0x30ce0b)[_0x9141('0x10')](function(_0x1847c4){logger[_0x9141('0x11')](_0x9141('0x12'),_0x406153,'request\x20sent');logger[_0x9141('0x13')](_0x9141('0x14'),_0x406153,_0x9141('0x15'),JSON[_0x9141('0x16')](_0x1847c4));if(_0x1847c4[_0x9141('0x17')]){if(_0x1847c4[_0x9141('0x17')]['code']===0x1f4){logger['error'](_0x9141('0x12'),_0x406153,_0x1847c4[_0x9141('0x17')][_0x9141('0x18')]);return _0x2d35e3(_0x1847c4[_0x9141('0x17')][_0x9141('0x18')]);}logger[_0x9141('0x17')](_0x9141('0x12'),_0x406153,_0x1847c4[_0x9141('0x17')][_0x9141('0x18')]);return _0x1de00d(_0x1847c4['error'][_0x9141('0x18')]);}else{logger[_0x9141('0x11')]('UserProfile,\x20%s,\x20%s',_0x406153,'request\x20sent');_0x1de00d(_0x1847c4[_0x9141('0x19')]['message']);}})['catch'](function(_0x4e5a9c){logger['error'](_0x9141('0x12'),_0x406153,_0x4e5a9c);_0x2d35e3(_0x4e5a9c);});});} \ No newline at end of file +var _0x014c=['./userProfile.socket','register','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x5a1966,_0x4bd8dc){var _0x4c92d2=function(_0x3c7084){while(--_0x3c7084){_0x5a1966['push'](_0x5a1966['shift']());}};_0x4c92d2(++_0x4bd8dc);}(_0x014c,0x17b));var _0xc014=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x014c[_0x4cefc3];return _0x1cc779;};'use strict';var _=require('lodash');var util=require(_0xc014('0x0'));var moment=require('moment');var BPromise=require(_0xc014('0x1'));var rs=require(_0xc014('0x2'));var fs=require('fs');var Redis=require(_0xc014('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc014('0x4'))(_0xc014('0x5'));var config=require(_0xc014('0x6'));var jayson=require(_0xc014('0x7'));var client=jayson[_0xc014('0x8')]['http']({'port':0x232a});config[_0xc014('0x9')]=_[_0xc014('0xa')](config['redis'],{'host':_0xc014('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc014('0x9')]));require(_0xc014('0xc'))[_0xc014('0xd')](socket);function respondWithRpcPromise(_0x569ef6,_0x77540e,_0x410693){return new BPromise(function(_0x88e8ea,_0x41bda0){return client['request'](_0x569ef6,_0x410693)[_0xc014('0xe')](function(_0x4cb978){logger[_0xc014('0xf')]('UserProfile,\x20%s,\x20%s',_0x77540e,_0xc014('0x10'));logger[_0xc014('0x11')](_0xc014('0x12'),_0x77540e,_0xc014('0x10'),JSON['stringify'](_0x4cb978));if(_0x4cb978[_0xc014('0x13')]){if(_0x4cb978[_0xc014('0x13')][_0xc014('0x14')]===0x1f4){logger['error'](_0xc014('0x15'),_0x77540e,_0x4cb978['error'][_0xc014('0x16')]);return _0x41bda0(_0x4cb978[_0xc014('0x13')][_0xc014('0x16')]);}logger[_0xc014('0x13')](_0xc014('0x15'),_0x77540e,_0x4cb978[_0xc014('0x13')]['message']);return _0x88e8ea(_0x4cb978[_0xc014('0x13')][_0xc014('0x16')]);}else{logger[_0xc014('0xf')](_0xc014('0x15'),_0x77540e,'request\x20sent');_0x88e8ea(_0x4cb978['result'][_0xc014('0x16')]);}})['catch'](function(_0x5226ee){logger[_0xc014('0x13')](_0xc014('0x15'),_0x77540e,_0x5226ee);_0x41bda0(_0x5226ee);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index aff660e..5e2a4b0 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb2=['remove','update','userProfile:','./userProfile.events','save'];(function(_0x4fdb2d,_0x206489){var _0x3136fc=function(_0x47691c){while(--_0x47691c){_0x4fdb2d['push'](_0x4fdb2d['shift']());}};_0x3136fc(++_0x206489);}(_0x4eb2,0x1ca));var _0x24eb=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x4eb2[_0x1c546c];return _0x2cc384;};'use strict';var UserProfileEvents=require(_0x24eb('0x0'));var events=[_0x24eb('0x1'),_0x24eb('0x2'),_0x24eb('0x3')];function createListener(_0x3d8cd6,_0x90e9a2){return function(_0x28f90e){_0x90e9a2['emit'](_0x3d8cd6,_0x28f90e);};}function removeListener(_0x3f2eee,_0x396a19){return function(){UserProfileEvents['removeListener'](_0x3f2eee,_0x396a19);};}exports['register']=function(_0x3f3c07){for(var _0x5a62d2=0x0,_0x2bdd67=events['length'];_0x5a62d2<_0x2bdd67;_0x5a62d2++){var _0x470c8e=events[_0x5a62d2];var _0x2208b1=createListener(_0x24eb('0x4')+_0x470c8e,_0x3f3c07);UserProfileEvents['on'](_0x470c8e,_0x2208b1);}}; \ No newline at end of file +var _0xa901=['length','save','update','emit','register'];(function(_0x55c7c8,_0x56b3b9){var _0x231172=function(_0x2487c3){while(--_0x2487c3){_0x55c7c8['push'](_0x55c7c8['shift']());}};_0x231172(++_0x56b3b9);}(_0xa901,0x155));var _0x1a90=function(_0x4962f3,_0xfa602f){_0x4962f3=_0x4962f3-0x0;var _0x5bb381=_0xa901[_0x4962f3];return _0x5bb381;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x1a90('0x0'),'remove',_0x1a90('0x1')];function createListener(_0x311498,_0x428d9f){return function(_0x567266){_0x428d9f[_0x1a90('0x2')](_0x311498,_0x567266);};}function removeListener(_0x373c67,_0x48d400){return function(){UserProfileEvents['removeListener'](_0x373c67,_0x48d400);};}exports[_0x1a90('0x3')]=function(_0x2b7571){for(var _0x4d70ea=0x0,_0x11493b=events[_0x1a90('0x4')];_0x4d70ea<_0x11493b;_0x4d70ea++){var _0x2bce88=events[_0x4d70ea];var _0x200df0=createListener('userProfile:'+_0x2bce88,_0x2b7571);UserProfileEvents['on'](_0x2bce88,_0x200df0);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 66cfb74..8bcc7e7 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87b2=['post','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x30c03b,_0x2f30f7){var _0x5f0ba7=function(_0x5e2dca){while(--_0x5e2dca){_0x30c03b['push'](_0x30c03b['shift']());}};_0x5f0ba7(++_0x2f30f7);}(_0x87b2,0xa7));var _0x287b=function(_0x13418b,_0xccfc80){_0x13418b=_0x13418b-0x0;var _0x4cd2fd=_0x87b2[_0x13418b];return _0x4cd2fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x287b('0x0'));var timeout=require('connect-timeout');var express=require(_0x287b('0x1'));var router=express[_0x287b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x287b('0x3'));var interaction=require(_0x287b('0x4'));var config=require(_0x287b('0x5'));var controller=require('./userProfileResource.controller');router[_0x287b('0x6')]('/',auth['isAuthenticated'](),controller[_0x287b('0x7')]);router['get'](_0x287b('0x8'),auth[_0x287b('0x9')](),controller[_0x287b('0xa')]);router['get'](_0x287b('0xb'),auth[_0x287b('0x9')](),controller[_0x287b('0xc')]);router[_0x287b('0xd')]('/',auth['isAuthenticated'](),controller[_0x287b('0xe')]);router[_0x287b('0xf')](_0x287b('0xb'),auth[_0x287b('0x9')](),controller[_0x287b('0x10')]);router[_0x287b('0x11')](_0x287b('0xb'),auth[_0x287b('0x9')](),controller[_0x287b('0x12')]);module[_0x287b('0x13')]=router; \ No newline at end of file +var _0x96a6=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x96a6,0x182));var _0x696a=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x96a6[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x696a('0x0'));var util=require('util');var path=require(_0x696a('0x1'));var timeout=require(_0x696a('0x2'));var express=require(_0x696a('0x3'));var router=express[_0x696a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x696a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x696a('0x6'));var controller=require(_0x696a('0x7'));router[_0x696a('0x8')]('/',auth[_0x696a('0x9')](),controller[_0x696a('0xa')]);router[_0x696a('0x8')](_0x696a('0xb'),auth[_0x696a('0x9')](),controller[_0x696a('0xc')]);router['get'](_0x696a('0xd'),auth[_0x696a('0x9')](),controller[_0x696a('0xe')]);router[_0x696a('0xf')]('/',auth[_0x696a('0x9')](),controller[_0x696a('0x10')]);router[_0x696a('0x11')](_0x696a('0xd'),auth[_0x696a('0x9')](),controller[_0x696a('0x12')]);router[_0x696a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x696a('0x14')]);module[_0x696a('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index db111a2..9505d6b 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb537=['INTEGER','sequelize','exports','STRING'];(function(_0x378965,_0x24b336){var _0x264afa=function(_0x3d382c){while(--_0x3d382c){_0x378965['push'](_0x378965['shift']());}};_0x264afa(++_0x24b336);}(_0xb537,0xa1));var _0x7b53=function(_0x401f30,_0x463013){_0x401f30=_0x401f30-0x0;var _0x516d39=_0xb537[_0x401f30];return _0x516d39;};'use strict';var Sequelize=require(_0x7b53('0x0'));module[_0x7b53('0x1')]={'name':{'type':Sequelize[_0x7b53('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7b53('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7b53('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a29=['STRING','INTEGER','exports'];(function(_0x5d6916,_0x4023f5){var _0x16e351=function(_0x5e8ba4){while(--_0x5e8ba4){_0x5d6916['push'](_0x5d6916['shift']());}};_0x16e351(++_0x4023f5);}(_0x1a29,0x1a6));var _0x91a2=function(_0x407458,_0x575df1){_0x407458=_0x407458-0x0;var _0x19ec88=_0x1a29[_0x407458];return _0x19ec88;};'use strict';var Sequelize=require('sequelize');module[_0x91a2('0x0')]={'name':{'type':Sequelize[_0x91a2('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x91a2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x91a2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 71edc8b..f8c2e42 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','UserProfileResource','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x0598,0x92));var _0x8059=function(_0x3b2c7d,_0x5e3ae4){_0x3b2c7d=_0x3b2c7d-0x0;var _0x278551=_0x0598[_0x3b2c7d];return _0x278551;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['UserProfileResource']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['UserProfileResource'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file +var _0x4991=['hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','UserProfileResource','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x9f0d13,_0x345de4){var _0x4fb806=function(_0x13c18b){while(--_0x13c18b){_0x9f0d13['push'](_0x9f0d13['shift']());}};_0x4fb806(++_0x345de4);}(_0x4991,0xf7));var _0x1499=function(_0x46d7bd,_0x42e922){_0x46d7bd=_0x46d7bd-0x0;var _0x5ec87e=_0x4991[_0x46d7bd];return _0x5ec87e;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['UserProfileResource'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};exports[_0x1499('0x4a')]=function(_0x9f0520,_0x278178){return db['UserProfileResource'][_0x1499('0x4a')]()[_0x1499('0x24')](respondWithResult(_0x278178,null))['catch'](handleError(_0x278178,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a9cf604..3ab2e2d 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b51=['path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','bluebird','request-promise'];(function(_0x13b29a,_0x8a6ad){var _0x41c018=function(_0x49f63f){while(--_0x49f63f){_0x13b29a['push'](_0x13b29a['shift']());}};_0x41c018(++_0x8a6ad);}(_0x9b51,0x1db));var _0x19b5=function(_0x1efc87,_0x2774b4){_0x1efc87=_0x1efc87-0x0;var _0x29f3cd=_0x9b51[_0x1efc87];return _0x29f3cd;};'use strict';var _=require('lodash');var util=require(_0x19b5('0x0'));var logger=require(_0x19b5('0x1'))(_0x19b5('0x2'));var moment=require('moment');var BPromise=require(_0x19b5('0x3'));var rp=require(_0x19b5('0x4'));var fs=require('fs');var path=require(_0x19b5('0x5'));var rimraf=require(_0x19b5('0x6'));var config=require(_0x19b5('0x7'));var attributes=require(_0x19b5('0x8'));module['exports']=function(_0xc348b4,_0x3a4dd0){return _0xc348b4[_0x19b5('0x9')](_0x19b5('0xa'),attributes,{'tableName':_0x19b5('0xb'),'paranoid':![],'indexes':[{'name':_0x19b5('0xc'),'fields':[_0x19b5('0xd'),_0x19b5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e6b=['path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0x3e6b,0x9a));var _0xb3e6=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3e6b[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xb3e6('0x0'));var util=require(_0xb3e6('0x1'));var logger=require(_0xb3e6('0x2'))(_0xb3e6('0x3'));var moment=require(_0xb3e6('0x4'));var BPromise=require('bluebird');var rp=require(_0xb3e6('0x5'));var fs=require('fs');var path=require(_0xb3e6('0x6'));var rimraf=require(_0xb3e6('0x7'));var config=require('../../config/environment');var attributes=require(_0xb3e6('0x8'));module[_0xb3e6('0x9')]=function(_0x1163cf,_0x46ddff){return _0x1163cf[_0xb3e6('0xa')](_0xb3e6('0xb'),attributes,{'tableName':_0xb3e6('0xc'),'paranoid':![],'indexes':[{'name':_0xb3e6('0xd'),'fields':[_0xb3e6('0xe'),_0xb3e6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 691a544..7d2fa39 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4265=['info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x34c59b,_0x542910){var _0x496e97=function(_0x2ee3ff){while(--_0x2ee3ff){_0x34c59b['push'](_0x34c59b['shift']());}};_0x496e97(++_0x542910);}(_0x4265,0x186));var _0x5426=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4265[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5426('0x2'));var fs=require('fs');var Redis=require(_0x5426('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5426('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5426('0x5'));var jayson=require(_0x5426('0x6'));var client=jayson[_0x5426('0x7')][_0x5426('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53515c,_0x56ab60,_0x5f04e0){return new BPromise(function(_0x531ba9,_0x25ee8e){return client[_0x5426('0x9')](_0x53515c,_0x5f04e0)['then'](function(_0x1fa0f8){logger[_0x5426('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x56ab60,'request\x20sent');logger[_0x5426('0xb')](_0x5426('0xc'),_0x56ab60,_0x5426('0xd'),JSON[_0x5426('0xe')](_0x1fa0f8));if(_0x1fa0f8['error']){if(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x10')]===0x1f4){logger['error'](_0x5426('0x11'),_0x56ab60,_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);return _0x25ee8e(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);}logger[_0x5426('0xf')](_0x5426('0x11'),_0x56ab60,_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);return _0x531ba9(_0x1fa0f8[_0x5426('0xf')][_0x5426('0x12')]);}else{logger[_0x5426('0xa')](_0x5426('0x11'),_0x56ab60,_0x5426('0xd'));_0x531ba9(_0x1fa0f8[_0x5426('0x13')]['message']);}})['catch'](function(_0x4b6cba){logger[_0x5426('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x56ab60,_0x4b6cba);_0x25ee8e(_0x4b6cba);});});} \ No newline at end of file +var _0xa5fd=['then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3392a0,_0x349e72){var _0x420a06=function(_0x1acd1e){while(--_0x1acd1e){_0x3392a0['push'](_0x3392a0['shift']());}};_0x420a06(++_0x349e72);}(_0xa5fd,0x186));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xda5f('0x0'));var util=require('util');var moment=require(_0xda5f('0x1'));var BPromise=require(_0xda5f('0x2'));var rs=require(_0xda5f('0x3'));var fs=require('fs');var Redis=require(_0xda5f('0x4'));var db=require(_0xda5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda5f('0x6'))('rpc');var config=require(_0xda5f('0x7'));var jayson=require(_0xda5f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xce3a4,_0x25ceff,_0xcd4eeb){return new BPromise(function(_0x404bc5,_0x39b7d3){return client['request'](_0xce3a4,_0xcd4eeb)[_0xda5f('0x9')](function(_0x4292c2){logger[_0xda5f('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x25ceff,_0xda5f('0xb'));logger[_0xda5f('0xc')](_0xda5f('0xd'),_0x25ceff,'request\x20sent',JSON[_0xda5f('0xe')](_0x4292c2));if(_0x4292c2[_0xda5f('0xf')]){if(_0x4292c2[_0xda5f('0xf')][_0xda5f('0x10')]===0x1f4){logger[_0xda5f('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x25ceff,_0x4292c2['error'][_0xda5f('0x11')]);return _0x39b7d3(_0x4292c2[_0xda5f('0xf')][_0xda5f('0x11')]);}logger[_0xda5f('0xf')](_0xda5f('0x12'),_0x25ceff,_0x4292c2[_0xda5f('0xf')][_0xda5f('0x11')]);return _0x404bc5(_0x4292c2[_0xda5f('0xf')][_0xda5f('0x11')]);}else{logger['info'](_0xda5f('0x12'),_0x25ceff,'request\x20sent');_0x404bc5(_0x4292c2[_0xda5f('0x13')]['message']);}})[_0xda5f('0x14')](function(_0x17d0d6){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x25ceff,_0x17d0d6);_0x39b7d3(_0x17d0d6);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1b409ee..aa9a6ce 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5885=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5885,0x1b6));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5588('0x0'));var path=require(_0x5588('0x1'));var timeout=require(_0x5588('0x2'));var express=require(_0x5588('0x3'));var router=express[_0x5588('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5588('0x5'));var interaction=require(_0x5588('0x6'));var config=require(_0x5588('0x7'));var controller=require(_0x5588('0x8'));router[_0x5588('0x9')]('/',auth[_0x5588('0xa')](),controller[_0x5588('0xb')]);router[_0x5588('0x9')](_0x5588('0xc'),auth[_0x5588('0xa')](),controller[_0x5588('0xd')]);router[_0x5588('0x9')](_0x5588('0xe'),auth[_0x5588('0xa')](),controller['show']);router[_0x5588('0xf')]('/',auth[_0x5588('0xa')](),controller[_0x5588('0x10')]);router[_0x5588('0x11')](_0x5588('0xe'),auth['isAuthenticated'](),controller[_0x5588('0x12')]);router['delete'](_0x5588('0xe'),auth['isAuthenticated'](),controller[_0x5588('0x13')]);module[_0x5588('0x14')]=router; \ No newline at end of file +var _0x6a64=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x559682,_0x2a95d2){var _0x3bc0fc=function(_0x4e859e){while(--_0x4e859e){_0x559682['push'](_0x559682['shift']());}};_0x3bc0fc(++_0x2a95d2);}(_0x6a64,0x1c7));var _0x46a6=function(_0x3536b9,_0x124724){_0x3536b9=_0x3536b9-0x0;var _0x2ec217=_0x6a64[_0x3536b9];return _0x2ec217;};'use strict';var multer=require(_0x46a6('0x0'));var util=require('util');var path=require(_0x46a6('0x1'));var timeout=require(_0x46a6('0x2'));var express=require(_0x46a6('0x3'));var router=express[_0x46a6('0x4')]();var fs_extra=require(_0x46a6('0x5'));var auth=require(_0x46a6('0x6'));var interaction=require(_0x46a6('0x7'));var config=require(_0x46a6('0x8'));var controller=require('./userProfileSection.controller');router[_0x46a6('0x9')]('/',auth[_0x46a6('0xa')](),controller[_0x46a6('0xb')]);router[_0x46a6('0x9')](_0x46a6('0xc'),auth['isAuthenticated'](),controller[_0x46a6('0xd')]);router[_0x46a6('0x9')](_0x46a6('0xe'),auth['isAuthenticated'](),controller[_0x46a6('0xf')]);router[_0x46a6('0x10')]('/',auth[_0x46a6('0xa')](),controller[_0x46a6('0x11')]);router[_0x46a6('0x12')](_0x46a6('0xe'),auth[_0x46a6('0xa')](),controller[_0x46a6('0x13')]);router['delete'](_0x46a6('0xe'),auth['isAuthenticated'](),controller[_0x46a6('0x14')]);module[_0x46a6('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 618cf1b..d7e0492 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbb=['BOOLEAN','setDataValue','getDataValue','crudPermissions','split','sequelize','exports','STRING'];(function(_0x111b07,_0x164785){var _0x5bc2df=function(_0x72ddf8){while(--_0x72ddf8){_0x111b07['push'](_0x111b07['shift']());}};_0x5bc2df(++_0x164785);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x54d2b6,_0x59c39f){_0x54d2b6=_0x54d2b6-0x0;var _0x262afe=_0xfcbb[_0x54d2b6];return _0x262afe;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xbfcb('0x2')],'set':function(_0x135741){this[_0xbfcb('0x4')]('crudPermissions',_0x135741?_0x135741['join'](''):[]);},'get':function(){return this[_0xbfcb('0x5')](_0xbfcb('0x6'))?this[_0xbfcb('0x5')](_0xbfcb('0x6'))[_0xbfcb('0x7')](''):[];}}}; \ No newline at end of file +var _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x50af59,_0x21c28d){var _0x4958c4=function(_0x5dc3ba){while(--_0x5dc3ba){_0x50af59['push'](_0x50af59['shift']());}};_0x4958c4(++_0x21c28d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x480f1a,_0x534885){_0x480f1a=_0x480f1a-0x0;var _0x2447fe=_0x9ffd[_0x480f1a];return _0x2447fe;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd9ff('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd9ff('0x2')],'set':function(_0x53e962){this[_0xd9ff('0x5')](_0xd9ff('0x6'),_0x53e962?_0x53e962['join'](''):[]);},'get':function(){return this[_0xd9ff('0x7')](_0xd9ff('0x6'))?this[_0xd9ff('0x7')](_0xd9ff('0x6'))[_0xd9ff('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b7b58f3..f6f39ab 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5acd=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','keys','query'];(function(_0x2fbbda,_0x232a76){var _0x10fd0a=function(_0x433eb7){while(--_0x433eb7){_0x2fbbda['push'](_0x2fbbda['shift']());}};_0x10fd0a(++_0x232a76);}(_0x5acd,0x14f));var _0xd5ac=function(_0x5dca6f,_0x371feb){_0x5dca6f=_0x5dca6f-0x0;var _0x5571c3=_0x5acd[_0x5dca6f];return _0x5571c3;};'use strict';var emlformat=require(_0xd5ac('0x0'));var rimraf=require(_0xd5ac('0x1'));var zipdir=require(_0xd5ac('0x2'));var jsonpatch=require(_0xd5ac('0x3'));var rp=require('request-promise');var moment=require(_0xd5ac('0x4'));var BPromise=require(_0xd5ac('0x5'));var Mustache=require(_0xd5ac('0x6'));var util=require(_0xd5ac('0x7'));var path=require(_0xd5ac('0x8'));var sox=require(_0xd5ac('0x9'));var csv=require(_0xd5ac('0xa'));var ejs=require(_0xd5ac('0xb'));var fs=require('fs');var fs_extra=require(_0xd5ac('0xc'));var _=require(_0xd5ac('0xd'));var squel=require(_0xd5ac('0xe'));var crypto=require('crypto');var jsforce=require(_0xd5ac('0xf'));var deskjs=require(_0xd5ac('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd5ac('0x11'));var Papa=require(_0xd5ac('0x12'));var Redis=require('ioredis');var authService=require(_0xd5ac('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd5ac('0x14'));var hardwareService=require(_0xd5ac('0x15'));var logger=require(_0xd5ac('0x16'))(_0xd5ac('0x17'));var utils=require(_0xd5ac('0x18'));var config=require(_0xd5ac('0x19'));var licenseUtil=require(_0xd5ac('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x327270,_0x3c4df2){_0x3c4df2=_0x3c4df2||0xcc;return function(_0x1223ea){if(_0x1223ea){return _0x327270[_0xd5ac('0x1b')](_0x3c4df2);}return _0x327270[_0xd5ac('0x1c')](_0x3c4df2)['end']();};}function respondWithResult(_0x3fb8e3,_0x5e4792){_0x5e4792=_0x5e4792||0xc8;return function(_0x59fb6f){if(_0x59fb6f){return _0x3fb8e3['status'](_0x5e4792)[_0xd5ac('0x1d')](_0x59fb6f);}};}function respondWithFilteredResult(_0x38f668,_0xcb0184){return function(_0x2d344d){if(_0x2d344d){var _0x4c8605=typeof _0xcb0184[_0xd5ac('0x1e')]==='undefined'&&typeof _0xcb0184[_0xd5ac('0x1f')]===_0xd5ac('0x20');var _0x3b6b1e=_0x2d344d[_0xd5ac('0x21')];var _0x5ee6ba=_0x4c8605?0x0:_0xcb0184[_0xd5ac('0x1e')];var _0x1e0b87=_0x4c8605?_0x2d344d[_0xd5ac('0x21')]:_0xcb0184[_0xd5ac('0x1e')]+_0xcb0184[_0xd5ac('0x1f')];var _0x55826c;if(_0x1e0b87>=_0x3b6b1e){_0x1e0b87=_0x3b6b1e;_0x55826c=0xc8;}else{_0x55826c=0xce;}_0x38f668[_0xd5ac('0x1c')](_0x55826c);return _0x38f668[_0xd5ac('0x22')](_0xd5ac('0x23'),_0x5ee6ba+'-'+_0x1e0b87+'/'+_0x3b6b1e)[_0xd5ac('0x1d')](_0x2d344d);}return null;};}function patchUpdates(_0x22c3e4){return function(_0x41d5f5){try{jsonpatch[_0xd5ac('0x24')](_0x41d5f5,_0x22c3e4,!![]);}catch(_0x345959){return BPromise[_0xd5ac('0x25')](_0x345959);}return _0x41d5f5[_0xd5ac('0x26')]();};}function saveUpdates(_0x49f76e,_0x3879aa){return function(_0x1c75e2){if(_0x1c75e2){return _0x1c75e2[_0xd5ac('0x27')](_0x49f76e)[_0xd5ac('0x28')](function(_0x36c665){return _0x36c665;});}return null;};}function removeEntity(_0x129295,_0xc6e8e4){return function(_0x35410f){if(_0x35410f){return _0x35410f['destroy']()[_0xd5ac('0x28')](function(){_0x129295[_0xd5ac('0x1c')](0xcc)[_0xd5ac('0x29')]();});}};}function handleEntityNotFound(_0x344409,_0x171eea){return function(_0x2dfa75){if(!_0x2dfa75){_0x344409[_0xd5ac('0x1b')](0x194);}return _0x2dfa75;};}function handleError(_0x2fadb1,_0x1b9da5){_0x1b9da5=_0x1b9da5||0x1f4;return function(_0x37749f){logger[_0xd5ac('0x2a')](_0x37749f[_0xd5ac('0x2b')]);if(_0x37749f[_0xd5ac('0x2c')]){delete _0x37749f[_0xd5ac('0x2c')];}_0x2fadb1[_0xd5ac('0x1c')](_0x1b9da5)[_0xd5ac('0x2d')](_0x37749f);};}exports[_0xd5ac('0x2e')]=function(_0x5dba3a,_0x580ca0){var _0x350b7f={},_0x36600c={},_0x107b9e={'count':0x0,'rows':[]};var _0x45858d=_[_0xd5ac('0x2f')](db[_0xd5ac('0x30')][_0xd5ac('0x31')],function(_0x47b5ff){return{'name':_0x47b5ff[_0xd5ac('0x32')],'type':_0x47b5ff[_0xd5ac('0x33')]['key']};});_0x36600c[_0xd5ac('0x34')]=_[_0xd5ac('0x2f')](_0x45858d,'name');_0x36600c['query']=_[_0xd5ac('0x35')](_0x5dba3a[_0xd5ac('0x36')]);_0x36600c[_0xd5ac('0x37')]=_[_0xd5ac('0x38')](_0x36600c[_0xd5ac('0x34')],_0x36600c[_0xd5ac('0x36')]);_0x350b7f['attributes']=_[_0xd5ac('0x38')](_0x36600c[_0xd5ac('0x34')],qs[_0xd5ac('0x39')](_0x5dba3a[_0xd5ac('0x36')][_0xd5ac('0x39')]));_0x350b7f[_0xd5ac('0x3a')]=_0x350b7f['attributes'][_0xd5ac('0x3b')]?_0x350b7f[_0xd5ac('0x3a')]:_0x36600c[_0xd5ac('0x34')];if(!_0x5dba3a[_0xd5ac('0x36')][_0xd5ac('0x3c')](_0xd5ac('0x3d'))){_0x350b7f[_0xd5ac('0x1f')]=qs[_0xd5ac('0x1f')](_0x5dba3a['query'][_0xd5ac('0x1f')]);_0x350b7f[_0xd5ac('0x1e')]=qs[_0xd5ac('0x1e')](_0x5dba3a[_0xd5ac('0x36')]['offset']);}_0x350b7f['order']=qs['sort'](_0x5dba3a[_0xd5ac('0x36')]['sort']);_0x350b7f[_0xd5ac('0x3e')]=qs['filters'](_[_0xd5ac('0x3f')](_0x5dba3a[_0xd5ac('0x36')],_0x36600c['filters']),_0x45858d);if(_0x5dba3a['query'][_0xd5ac('0x40')]){_0x350b7f[_0xd5ac('0x3e')]=_[_0xd5ac('0x41')](_0x350b7f[_0xd5ac('0x3e')],{'$or':_[_0xd5ac('0x2f')](_0x45858d,function(_0x4b8825){if(_0x4b8825[_0xd5ac('0x33')]!==_0xd5ac('0x42')){var _0x5c7f52={};_0x5c7f52[_0x4b8825[_0xd5ac('0x2c')]]={'$like':'%'+_0x5dba3a['query'][_0xd5ac('0x40')]+'%'};return _0x5c7f52;}})});}_0x350b7f=_[_0xd5ac('0x41')]({},_0x350b7f,_0x5dba3a[_0xd5ac('0x43')]);var _0x3daa18={'where':_0x350b7f[_0xd5ac('0x3e')]};return db[_0xd5ac('0x30')]['count'](_0x3daa18)[_0xd5ac('0x28')](function(_0x491cb5){_0x107b9e[_0xd5ac('0x21')]=_0x491cb5;if(_0x5dba3a[_0xd5ac('0x36')][_0xd5ac('0x44')]){_0x350b7f[_0xd5ac('0x45')]=[{'all':!![]}];}return db['UserProfileSection'][_0xd5ac('0x46')](_0x350b7f);})[_0xd5ac('0x28')](function(_0x42403e){_0x107b9e[_0xd5ac('0x47')]=_0x42403e;return _0x107b9e;})[_0xd5ac('0x28')](respondWithFilteredResult(_0x580ca0,_0x350b7f))['catch'](handleError(_0x580ca0,null));};exports['show']=function(_0xb731d5,_0x5b58aa){var _0xad1ad1={'raw':![],'where':{'id':_0xb731d5[_0xd5ac('0x48')]['id']}},_0x27746f={};_0x27746f['model']=_[_0xd5ac('0x35')](db['UserProfileSection'][_0xd5ac('0x31')]);_0x27746f[_0xd5ac('0x36')]=_[_0xd5ac('0x35')](_0xb731d5[_0xd5ac('0x36')]);_0x27746f[_0xd5ac('0x37')]=_[_0xd5ac('0x38')](_0x27746f[_0xd5ac('0x34')],_0x27746f[_0xd5ac('0x36')]);_0xad1ad1['attributes']=_[_0xd5ac('0x38')](_0x27746f[_0xd5ac('0x34')],qs[_0xd5ac('0x39')](_0xb731d5['query'][_0xd5ac('0x39')]));_0xad1ad1[_0xd5ac('0x3a')]=_0xad1ad1[_0xd5ac('0x3a')][_0xd5ac('0x3b')]?_0xad1ad1['attributes']:_0x27746f[_0xd5ac('0x34')];if(_0xb731d5[_0xd5ac('0x36')]['includeAll']){_0xad1ad1[_0xd5ac('0x45')]=[{'all':!![]}];}_0xad1ad1=_[_0xd5ac('0x41')]({},_0xad1ad1,_0xb731d5[_0xd5ac('0x43')]);return db['UserProfileSection'][_0xd5ac('0x49')](_0xad1ad1)[_0xd5ac('0x28')](handleEntityNotFound(_0x5b58aa,null))['then'](respondWithResult(_0x5b58aa,null))[_0xd5ac('0x4a')](handleError(_0x5b58aa,null));};exports['create']=function(_0x3ce16d,_0x5656f1){return db[_0xd5ac('0x30')]['create'](_0x3ce16d['body'],{})['then'](respondWithResult(_0x5656f1,0xc9))[_0xd5ac('0x4a')](handleError(_0x5656f1,null));};exports[_0xd5ac('0x27')]=function(_0x3ae914,_0x2ad872){if(_0x3ae914['body']['id']){delete _0x3ae914[_0xd5ac('0x4b')]['id'];}return db['UserProfileSection'][_0xd5ac('0x49')]({'where':{'id':_0x3ae914[_0xd5ac('0x48')]['id']}})[_0xd5ac('0x28')](handleEntityNotFound(_0x2ad872,null))[_0xd5ac('0x28')](saveUpdates(_0x3ae914[_0xd5ac('0x4b')],null))[_0xd5ac('0x28')](respondWithResult(_0x2ad872,null))[_0xd5ac('0x4a')](handleError(_0x2ad872,null));};exports[_0xd5ac('0x4c')]=function(_0x4dc044,_0x1d6e85){return db[_0xd5ac('0x30')][_0xd5ac('0x49')]({'where':{'id':_0x4dc044['params']['id']}})['then'](handleEntityNotFound(_0x1d6e85,null))[_0xd5ac('0x28')](removeEntity(_0x1d6e85,null))[_0xd5ac('0x4a')](handleError(_0x1d6e85,null));};exports['describe']=function(_0x5d386f,_0x424aeb){return db['UserProfileSection'][_0xd5ac('0x4d')]()['then'](respondWithResult(_0x424aeb,null))[_0xd5ac('0x4a')](handleError(_0x424aeb,null));}; \ No newline at end of file +var _0xc224=['sort','where','filters','filter','merge','options','includeAll','include','UserProfileSection','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','map','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xf38483,_0x1109dc){var _0x47e7da=function(_0x52b6e4){while(--_0x52b6e4){_0xf38483['push'](_0xf38483['shift']());}};_0x47e7da(++_0x1109dc);}(_0xc224,0x174));var _0x4c22=function(_0x4df2cc,_0x7d3aec){_0x4df2cc=_0x4df2cc-0x0;var _0x3db146=_0xc224[_0x4df2cc];return _0x3db146;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c22('0x0'));var zipdir=require(_0x4c22('0x1'));var jsonpatch=require(_0x4c22('0x2'));var rp=require(_0x4c22('0x3'));var moment=require(_0x4c22('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c22('0x5'));var util=require(_0x4c22('0x6'));var path=require(_0x4c22('0x7'));var sox=require(_0x4c22('0x8'));var csv=require(_0x4c22('0x9'));var ejs=require(_0x4c22('0xa'));var fs=require('fs');var fs_extra=require(_0x4c22('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4c22('0xc'));var jsforce=require(_0x4c22('0xd'));var deskjs=require(_0x4c22('0xe'));var toCsv=require(_0x4c22('0x9'));var querystring=require(_0x4c22('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c22('0x10'));var authService=require(_0x4c22('0x11'));var qs=require(_0x4c22('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c22('0x13'));var logger=require(_0x4c22('0x14'))('api');var utils=require(_0x4c22('0x15'));var config=require(_0x4c22('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c22('0x17'))['db'];function respondWithStatusCode(_0x146f04,_0x2b422f){_0x2b422f=_0x2b422f||0xcc;return function(_0x52f656){if(_0x52f656){return _0x146f04[_0x4c22('0x18')](_0x2b422f);}return _0x146f04[_0x4c22('0x19')](_0x2b422f)[_0x4c22('0x1a')]();};}function respondWithResult(_0x493caf,_0x520b64){_0x520b64=_0x520b64||0xc8;return function(_0x39792e){if(_0x39792e){return _0x493caf[_0x4c22('0x19')](_0x520b64)['json'](_0x39792e);}};}function respondWithFilteredResult(_0x328ac3,_0x51be6a){return function(_0x2c4af2){if(_0x2c4af2){var _0x292c10=typeof _0x51be6a[_0x4c22('0x1b')]===_0x4c22('0x1c')&&typeof _0x51be6a[_0x4c22('0x1d')]===_0x4c22('0x1c');var _0x31db91=_0x2c4af2[_0x4c22('0x1e')];var _0x56dec8=_0x292c10?0x0:_0x51be6a[_0x4c22('0x1b')];var _0x3e9294=_0x292c10?_0x2c4af2['count']:_0x51be6a[_0x4c22('0x1b')]+_0x51be6a[_0x4c22('0x1d')];var _0x38201d;if(_0x3e9294>=_0x31db91){_0x3e9294=_0x31db91;_0x38201d=0xc8;}else{_0x38201d=0xce;}_0x328ac3['status'](_0x38201d);return _0x328ac3[_0x4c22('0x1f')](_0x4c22('0x20'),_0x56dec8+'-'+_0x3e9294+'/'+_0x31db91)[_0x4c22('0x21')](_0x2c4af2);}return null;};}function patchUpdates(_0x2e1fe9){return function(_0x285e54){try{jsonpatch['apply'](_0x285e54,_0x2e1fe9,!![]);}catch(_0x52b301){return BPromise[_0x4c22('0x22')](_0x52b301);}return _0x285e54[_0x4c22('0x23')]();};}function saveUpdates(_0x482ed4,_0xb2039f){return function(_0x461fd4){if(_0x461fd4){return _0x461fd4[_0x4c22('0x24')](_0x482ed4)['then'](function(_0x383edc){return _0x383edc;});}return null;};}function removeEntity(_0x54b2dc,_0x4fd32d){return function(_0x4d4d00){if(_0x4d4d00){return _0x4d4d00[_0x4c22('0x25')]()[_0x4c22('0x26')](function(){_0x54b2dc[_0x4c22('0x19')](0xcc)[_0x4c22('0x1a')]();});}};}function handleEntityNotFound(_0xe41543,_0x5a96dd){return function(_0x235c0c){if(!_0x235c0c){_0xe41543[_0x4c22('0x18')](0x194);}return _0x235c0c;};}function handleError(_0x4c5859,_0x4d5179){_0x4d5179=_0x4d5179||0x1f4;return function(_0x4579a4){logger['error'](_0x4579a4[_0x4c22('0x27')]);if(_0x4579a4['name']){delete _0x4579a4[_0x4c22('0x28')];}_0x4c5859['status'](_0x4d5179)['send'](_0x4579a4);};}exports['index']=function(_0x4e9f6d,_0x2eaa93){var _0x191e14={},_0x4c1110={},_0x2d2e74={'count':0x0,'rows':[]};var _0x24efaa=_[_0x4c22('0x29')](db['UserProfileSection'][_0x4c22('0x2a')],function(_0x4ba26e){return{'name':_0x4ba26e['fieldName'],'type':_0x4ba26e[_0x4c22('0x2b')]['key']};});_0x4c1110['model']=_[_0x4c22('0x29')](_0x24efaa,_0x4c22('0x28'));_0x4c1110[_0x4c22('0x2c')]=_[_0x4c22('0x2d')](_0x4e9f6d[_0x4c22('0x2c')]);_0x4c1110['filters']=_[_0x4c22('0x2e')](_0x4c1110[_0x4c22('0x2f')],_0x4c1110['query']);_0x191e14[_0x4c22('0x30')]=_['intersection'](_0x4c1110[_0x4c22('0x2f')],qs['fields'](_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x31')]));_0x191e14[_0x4c22('0x30')]=_0x191e14[_0x4c22('0x30')][_0x4c22('0x32')]?_0x191e14[_0x4c22('0x30')]:_0x4c1110[_0x4c22('0x2f')];if(!_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x33')](_0x4c22('0x34'))){_0x191e14['limit']=qs[_0x4c22('0x1d')](_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x1d')]);_0x191e14[_0x4c22('0x1b')]=qs[_0x4c22('0x1b')](_0x4e9f6d['query'][_0x4c22('0x1b')]);}_0x191e14[_0x4c22('0x35')]=qs[_0x4c22('0x36')](_0x4e9f6d['query'][_0x4c22('0x36')]);_0x191e14[_0x4c22('0x37')]=qs[_0x4c22('0x38')](_['pick'](_0x4e9f6d[_0x4c22('0x2c')],_0x4c1110[_0x4c22('0x38')]),_0x24efaa);if(_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x39')]){_0x191e14[_0x4c22('0x37')]=_[_0x4c22('0x3a')](_0x191e14['where'],{'$or':_['map'](_0x24efaa,function(_0x64dba0){if(_0x64dba0[_0x4c22('0x2b')]!=='VIRTUAL'){var _0x490430={};_0x490430[_0x64dba0[_0x4c22('0x28')]]={'$like':'%'+_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x39')]+'%'};return _0x490430;}})});}_0x191e14=_[_0x4c22('0x3a')]({},_0x191e14,_0x4e9f6d[_0x4c22('0x3b')]);var _0x23e970={'where':_0x191e14['where']};return db['UserProfileSection'][_0x4c22('0x1e')](_0x23e970)['then'](function(_0x1605f9){_0x2d2e74[_0x4c22('0x1e')]=_0x1605f9;if(_0x4e9f6d[_0x4c22('0x2c')][_0x4c22('0x3c')]){_0x191e14[_0x4c22('0x3d')]=[{'all':!![]}];}return db[_0x4c22('0x3e')]['findAll'](_0x191e14);})['then'](function(_0x541412){_0x2d2e74[_0x4c22('0x3f')]=_0x541412;return _0x2d2e74;})[_0x4c22('0x26')](respondWithFilteredResult(_0x2eaa93,_0x191e14))[_0x4c22('0x40')](handleError(_0x2eaa93,null));};exports[_0x4c22('0x41')]=function(_0x43e14f,_0x5c5d04){var _0x406b18={'raw':![],'where':{'id':_0x43e14f[_0x4c22('0x42')]['id']}},_0x299026={};_0x299026[_0x4c22('0x2f')]=_[_0x4c22('0x2d')](db[_0x4c22('0x3e')][_0x4c22('0x2a')]);_0x299026[_0x4c22('0x2c')]=_[_0x4c22('0x2d')](_0x43e14f[_0x4c22('0x2c')]);_0x299026['filters']=_[_0x4c22('0x2e')](_0x299026[_0x4c22('0x2f')],_0x299026['query']);_0x406b18[_0x4c22('0x30')]=_['intersection'](_0x299026[_0x4c22('0x2f')],qs[_0x4c22('0x31')](_0x43e14f[_0x4c22('0x2c')][_0x4c22('0x31')]));_0x406b18[_0x4c22('0x30')]=_0x406b18[_0x4c22('0x30')][_0x4c22('0x32')]?_0x406b18[_0x4c22('0x30')]:_0x299026['model'];if(_0x43e14f[_0x4c22('0x2c')]['includeAll']){_0x406b18[_0x4c22('0x3d')]=[{'all':!![]}];}_0x406b18=_[_0x4c22('0x3a')]({},_0x406b18,_0x43e14f[_0x4c22('0x3b')]);return db[_0x4c22('0x3e')][_0x4c22('0x43')](_0x406b18)['then'](handleEntityNotFound(_0x5c5d04,null))['then'](respondWithResult(_0x5c5d04,null))[_0x4c22('0x40')](handleError(_0x5c5d04,null));};exports['create']=function(_0x4c82fd,_0x83e52a){return db[_0x4c22('0x3e')][_0x4c22('0x44')](_0x4c82fd[_0x4c22('0x45')],{})[_0x4c22('0x26')](respondWithResult(_0x83e52a,0xc9))['catch'](handleError(_0x83e52a,null));};exports[_0x4c22('0x24')]=function(_0xdc413d,_0x40fe98){if(_0xdc413d[_0x4c22('0x45')]['id']){delete _0xdc413d[_0x4c22('0x45')]['id'];}return db[_0x4c22('0x3e')][_0x4c22('0x43')]({'where':{'id':_0xdc413d[_0x4c22('0x42')]['id']}})[_0x4c22('0x26')](handleEntityNotFound(_0x40fe98,null))[_0x4c22('0x26')](saveUpdates(_0xdc413d['body'],null))['then'](respondWithResult(_0x40fe98,null))[_0x4c22('0x40')](handleError(_0x40fe98,null));};exports['destroy']=function(_0x254f01,_0x3d607b){return db[_0x4c22('0x3e')][_0x4c22('0x43')]({'where':{'id':_0x254f01[_0x4c22('0x42')]['id']}})[_0x4c22('0x26')](handleEntityNotFound(_0x3d607b,null))[_0x4c22('0x26')](removeEntity(_0x3d607b,null))[_0x4c22('0x40')](handleError(_0x3d607b,null));};exports[_0x4c22('0x46')]=function(_0x5a2003,_0x1d2415){return db[_0x4c22('0x3e')][_0x4c22('0x46')]()[_0x4c22('0x26')](respondWithResult(_0x1d2415,null))[_0x4c22('0x40')](handleError(_0x1d2415,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3646184..013ccbb 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86c1=['userProfileId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','UserProfileSection','compositeIndex'];(function(_0x109da9,_0x4f10de){var _0x1dcd2f=function(_0x471793){while(--_0x471793){_0x109da9['push'](_0x109da9['shift']());}};_0x1dcd2f(++_0x4f10de);}(_0x86c1,0xfd));var _0x186c=function(_0x233df5,_0x15bf90){_0x233df5=_0x233df5-0x0;var _0x47fc28=_0x86c1[_0x233df5];return _0x47fc28;};'use strict';var _=require(_0x186c('0x0'));var util=require('util');var logger=require(_0x186c('0x1'))(_0x186c('0x2'));var moment=require(_0x186c('0x3'));var BPromise=require('bluebird');var rp=require(_0x186c('0x4'));var fs=require('fs');var path=require(_0x186c('0x5'));var rimraf=require(_0x186c('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x186c('0x7')]=function(_0x20df51,_0x146f62){return _0x20df51[_0x186c('0x8')](_0x186c('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x186c('0xa'),'fields':['sectionId',_0x186c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f6c=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x38d4ae,_0xc900c0){var _0x161125=function(_0x58b2a6){while(--_0x58b2a6){_0x38d4ae['push'](_0x38d4ae['shift']());}};_0x161125(++_0xc900c0);}(_0x6f6c,0x19b));var _0xc6f6=function(_0x47e8fb,_0x1a342d){_0x47e8fb=_0x47e8fb-0x0;var _0x3c0b99=_0x6f6c[_0x47e8fb];return _0x3c0b99;};'use strict';var _=require(_0xc6f6('0x0'));var util=require(_0xc6f6('0x1'));var logger=require(_0xc6f6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc6f6('0x3'));var rp=require(_0xc6f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6f6('0x5'));var config=require(_0xc6f6('0x6'));var attributes=require(_0xc6f6('0x7'));module[_0xc6f6('0x8')]=function(_0x16100c,_0x2bb96e){return _0x16100c[_0xc6f6('0x9')](_0xc6f6('0xa'),attributes,{'tableName':_0xc6f6('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xc6f6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e4dc1b3..a8c3d31 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1488=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x1488,0x88));var _0x8148=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0x1488[_0x1ca29f];return _0x576c3b;};'use strict';var _=require(_0x8148('0x0'));var util=require('util');var moment=require(_0x8148('0x1'));var BPromise=require(_0x8148('0x2'));var rs=require(_0x8148('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8148('0x4'));var logger=require('../../config/logger')(_0x8148('0x5'));var config=require(_0x8148('0x6'));var jayson=require(_0x8148('0x7'));var client=jayson[_0x8148('0x8')][_0x8148('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ac35d,_0x696c2c,_0x1254e9){return new BPromise(function(_0x4fb6b4,_0x29f98e){return client[_0x8148('0xa')](_0x2ac35d,_0x1254e9)[_0x8148('0xb')](function(_0x214901){logger[_0x8148('0xc')](_0x8148('0xd'),_0x696c2c,_0x8148('0xe'));logger[_0x8148('0xf')](_0x8148('0x10'),_0x696c2c,_0x8148('0xe'),JSON[_0x8148('0x11')](_0x214901));if(_0x214901[_0x8148('0x12')]){if(_0x214901['error'][_0x8148('0x13')]===0x1f4){logger[_0x8148('0x12')](_0x8148('0xd'),_0x696c2c,_0x214901['error']['message']);return _0x29f98e(_0x214901[_0x8148('0x12')][_0x8148('0x14')]);}logger['error'](_0x8148('0xd'),_0x696c2c,_0x214901[_0x8148('0x12')][_0x8148('0x14')]);return _0x4fb6b4(_0x214901[_0x8148('0x12')][_0x8148('0x14')]);}else{logger['info'](_0x8148('0xd'),_0x696c2c,'request\x20sent');_0x4fb6b4(_0x214901['result'][_0x8148('0x14')]);}})['catch'](function(_0x4af1e1){logger[_0x8148('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x696c2c,_0x4af1e1);_0x29f98e(_0x4af1e1);});});} \ No newline at end of file +var _0x7882=['UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x5ce0e9,_0x40b143){var _0x2f0810=function(_0x2430bd){while(--_0x2430bd){_0x5ce0e9['push'](_0x5ce0e9['shift']());}};_0x2f0810(++_0x40b143);}(_0x7882,0x65));var _0x2788=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0x7882[_0x3b0d98];return _0x296885;};'use strict';var _=require(_0x2788('0x0'));var util=require(_0x2788('0x1'));var moment=require(_0x2788('0x2'));var BPromise=require(_0x2788('0x3'));var rs=require(_0x2788('0x4'));var fs=require('fs');var Redis=require(_0x2788('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2788('0x6'));var logger=require(_0x2788('0x7'))(_0x2788('0x8'));var config=require('../../config/environment');var jayson=require(_0x2788('0x9'));var client=jayson[_0x2788('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43178e,_0x588fa1,_0xe67c07){return new BPromise(function(_0x2c08f9,_0x5137e5){return client[_0x2788('0xb')](_0x43178e,_0xe67c07)[_0x2788('0xc')](function(_0x31a266){logger[_0x2788('0xd')](_0x2788('0xe'),_0x588fa1,'request\x20sent');logger[_0x2788('0xf')](_0x2788('0x10'),_0x588fa1,_0x2788('0x11'),JSON['stringify'](_0x31a266));if(_0x31a266[_0x2788('0x12')]){if(_0x31a266[_0x2788('0x12')][_0x2788('0x13')]===0x1f4){logger[_0x2788('0x12')](_0x2788('0xe'),_0x588fa1,_0x31a266['error'][_0x2788('0x14')]);return _0x5137e5(_0x31a266[_0x2788('0x12')][_0x2788('0x14')]);}logger[_0x2788('0x12')](_0x2788('0xe'),_0x588fa1,_0x31a266[_0x2788('0x12')][_0x2788('0x14')]);return _0x2c08f9(_0x31a266[_0x2788('0x12')][_0x2788('0x14')]);}else{logger[_0x2788('0xd')](_0x2788('0xe'),_0x588fa1,_0x2788('0x11'));_0x2c08f9(_0x31a266[_0x2788('0x15')][_0x2788('0x14')]);}})[_0x2788('0x16')](function(_0x40126e){logger[_0x2788('0x12')](_0x2788('0xe'),_0x588fa1,_0x40126e);_0x5137e5(_0x40126e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 52dc2d8..0b78589 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x28beaf,_0x122959){var _0x2df201=function(_0x583fd1){while(--_0x583fd1){_0x28beaf['push'](_0x28beaf['shift']());}};_0x2df201(++_0x122959);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5d1709,_0x5ef244){var _0x4d1c22=function(_0x3fa94e){while(--_0x3fa94e){_0x5d1709['push'](_0x5d1709['shift']());}};_0x4d1c22(++_0x5ef244);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 736ab18..355a755 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51de=['INTEGER','sequelize','exports'];(function(_0x7dccfa,_0x571a49){var _0x433b11=function(_0x4fa5ca){while(--_0x4fa5ca){_0x7dccfa['push'](_0x7dccfa['shift']());}};_0x433b11(++_0x571a49);}(_0x51de,0x8b));var _0xe51d=function(_0x2e28d3,_0x6cbe9b){_0x2e28d3=_0x2e28d3-0x0;var _0x5e10a4=_0x51de[_0x2e28d3];return _0x5e10a4;};'use strict';var Sequelize=require(_0xe51d('0x0'));module[_0xe51d('0x1')]={'penalty':{'type':Sequelize[_0xe51d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd9ef=['exports','sequelize'];(function(_0x147f5c,_0x1e5deb){var _0x545070=function(_0x5c6534){while(--_0x5c6534){_0x147f5c['push'](_0x147f5c['shift']());}};_0x545070(++_0x1e5deb);}(_0xd9ef,0x95));var _0xfd9e=function(_0x3bcf3b,_0xd96a04){_0x3bcf3b=_0x3bcf3b-0x0;var _0xe12d4b=_0xd9ef[_0x3bcf3b];return _0xe12d4b;};'use strict';var Sequelize=require(_0xfd9e('0x0'));module[_0xfd9e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 8d26bf7..7c22596 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1623=['lodash','api','moment','bluebird','request-promise','path','./userSmsQueue.attributes','UserSmsQueue','user_has_sms_queues'];(function(_0x35923e,_0x2e80c1){var _0x1150c4=function(_0x40229e){while(--_0x40229e){_0x35923e['push'](_0x35923e['shift']());}};_0x1150c4(++_0x2e80c1);}(_0x1623,0xab));var _0x3162=function(_0x5db202,_0x3e5096){_0x5db202=_0x5db202-0x0;var _0x161b8c=_0x1623[_0x5db202];return _0x161b8c;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xfdbd[_0x43b06b];return _0x2c555b;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index a311f29..a71b486 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4ce=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x125e3c,_0x59cbb3){var _0x15e625=function(_0x31d88c){while(--_0x31d88c){_0x125e3c['push'](_0x125e3c['shift']());}};_0x15e625(++_0x59cbb3);}(_0xd4ce,0x1cc));var _0xed4c=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xd4ce[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0xed4c('0x0'));var util=require(_0xed4c('0x1'));var moment=require(_0xed4c('0x2'));var BPromise=require(_0xed4c('0x3'));var rs=require(_0xed4c('0x4'));var fs=require('fs');var Redis=require(_0xed4c('0x5'));var db=require(_0xed4c('0x6'))['db'];var utils=require(_0xed4c('0x7'));var logger=require(_0xed4c('0x8'))('rpc');var config=require(_0xed4c('0x9'));var jayson=require(_0xed4c('0xa'));var client=jayson['client'][_0xed4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x538809,_0x2e93fd,_0x20a737){return new BPromise(function(_0x59a4ec,_0x19667b){return client[_0xed4c('0xc')](_0x538809,_0x20a737)[_0xed4c('0xd')](function(_0x376a88){logger[_0xed4c('0xe')](_0xed4c('0xf'),_0x2e93fd,_0xed4c('0x10'));logger[_0xed4c('0x11')](_0xed4c('0x12'),_0x2e93fd,'request\x20sent',JSON[_0xed4c('0x13')](_0x376a88));if(_0x376a88['error']){if(_0x376a88['error']['code']===0x1f4){logger[_0xed4c('0x14')](_0xed4c('0xf'),_0x2e93fd,_0x376a88[_0xed4c('0x14')][_0xed4c('0x15')]);return _0x19667b(_0x376a88[_0xed4c('0x14')][_0xed4c('0x15')]);}logger[_0xed4c('0x14')](_0xed4c('0xf'),_0x2e93fd,_0x376a88['error'][_0xed4c('0x15')]);return _0x59a4ec(_0x376a88['error'][_0xed4c('0x15')]);}else{logger[_0xed4c('0xe')](_0xed4c('0xf'),_0x2e93fd,'request\x20sent');_0x59a4ec(_0x376a88[_0xed4c('0x16')][_0xed4c('0x15')]);}})[_0xed4c('0x17')](function(_0x2b248c){logger[_0xed4c('0x14')](_0xed4c('0xf'),_0x2e93fd,_0x2b248c);_0x19667b(_0x2b248c);});});} \ No newline at end of file +var _0xe2f3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x4df0eb,_0x1d47d3){var _0x32e50a=function(_0x40fe71){while(--_0x40fe71){_0x4df0eb['push'](_0x4df0eb['shift']());}};_0x32e50a(++_0x1d47d3);}(_0xe2f3,0x92));var _0x3e2f=function(_0x38616d,_0x22fbe5){_0x38616d=_0x38616d-0x0;var _0x505626=_0xe2f3[_0x38616d];return _0x505626;};'use strict';var _=require(_0x3e2f('0x0'));var util=require(_0x3e2f('0x1'));var moment=require(_0x3e2f('0x2'));var BPromise=require(_0x3e2f('0x3'));var rs=require(_0x3e2f('0x4'));var fs=require('fs');var Redis=require(_0x3e2f('0x5'));var db=require(_0x3e2f('0x6'))['db'];var utils=require(_0x3e2f('0x7'));var logger=require(_0x3e2f('0x8'))(_0x3e2f('0x9'));var config=require(_0x3e2f('0xa'));var jayson=require(_0x3e2f('0xb'));var client=jayson[_0x3e2f('0xc')][_0x3e2f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2581f1,_0x106e31,_0xf40362){return new BPromise(function(_0x347997,_0x3414d4){return client[_0x3e2f('0xe')](_0x2581f1,_0xf40362)[_0x3e2f('0xf')](function(_0x1fe0b5){logger[_0x3e2f('0x10')](_0x3e2f('0x11'),_0x106e31,_0x3e2f('0x12'));logger['debug'](_0x3e2f('0x13'),_0x106e31,'request\x20sent',JSON[_0x3e2f('0x14')](_0x1fe0b5));if(_0x1fe0b5[_0x3e2f('0x15')]){if(_0x1fe0b5['error'][_0x3e2f('0x16')]===0x1f4){logger['error'](_0x3e2f('0x11'),_0x106e31,_0x1fe0b5[_0x3e2f('0x15')]['message']);return _0x3414d4(_0x1fe0b5[_0x3e2f('0x15')][_0x3e2f('0x17')]);}logger[_0x3e2f('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x106e31,_0x1fe0b5[_0x3e2f('0x15')][_0x3e2f('0x17')]);return _0x347997(_0x1fe0b5['error'][_0x3e2f('0x17')]);}else{logger['info'](_0x3e2f('0x11'),_0x106e31,_0x3e2f('0x12'));_0x347997(_0x1fe0b5[_0x3e2f('0x18')][_0x3e2f('0x17')]);}})['catch'](function(_0x598f3c){logger[_0x3e2f('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x106e31,_0x598f3c);_0x3414d4(_0x598f3c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 3cbe4ea..92853b5 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e01=['exports','sequelize'];(function(_0x596c2e,_0x1f49e0){var _0x10ff6c=function(_0x712f24){while(--_0x712f24){_0x596c2e['push'](_0x596c2e['shift']());}};_0x10ff6c(++_0x1f49e0);}(_0x6e01,0xbb));var _0x16e0=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0x6e01[_0x15e6fe];return _0x34894d;};'use strict';var Sequelize=require(_0x16e0('0x0'));module[_0x16e0('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6532=['sequelize','INTEGER'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x6532,0xa2));var _0x2653=function(_0x270075,_0x142657){_0x270075=_0x270075-0x0;var _0x24a211=_0x6532[_0x270075];return _0x24a211;};'use strict';var Sequelize=require(_0x2653('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x2653('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a94fc1e..b68e1e7 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xa9cda7,_0x803d72){var _0x525499=function(_0x571a1b){while(--_0x571a1b){_0xa9cda7['push'](_0xa9cda7['shift']());}};_0x525499(++_0x803d72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5e5000,_0x57f43a){var _0x515831=function(_0x51a501){while(--_0x51a501){_0x5e5000['push'](_0x5e5000['shift']());}};_0x515831(++_0x57f43a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index d711d88..8308366 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x266945,_0x5c5e8c){var _0x4477d5=function(_0x18c0b2){while(--_0x18c0b2){_0x266945['push'](_0x266945['shift']());}};_0x4477d5(++_0x5c5e8c);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x454425,_0x3e59b5){var _0x92a960=function(_0x3dd84b){while(--_0x3dd84b){_0x454425['push'](_0x454425['shift']());}};_0x92a960(++_0x3e59b5);}(_0x70e0,0x17b));var _0x070e=function(_0xbd121c,_0x4e6ea9){_0xbd121c=_0xbd121c-0x0;var _0xbee114=_0x70e0[_0xbd121c];return _0xbee114;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 1bd17d0..e34af94 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eff=['exports','sequelize'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x0eff,0xeb));var _0xf0ef=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x0eff[_0x26f1b2];return _0x1624a4;};'use strict';var Sequelize=require(_0xf0ef('0x0'));module[_0xf0ef('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e0b=['sequelize'];(function(_0x4f5a01,_0x590de4){var _0x3c882a=function(_0x260482){while(--_0x260482){_0x4f5a01['push'](_0x4f5a01['shift']());}};_0x3c882a(++_0x590de4);}(_0x9e0b,0xc1));var _0xb9e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9e0b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb9e0('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 38c3c89..dc428b7 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b94=['path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','api','moment','bluebird','request-promise'];(function(_0x4e9db5,_0x42fe04){var _0x3011d6=function(_0x96a1a4){while(--_0x96a1a4){_0x4e9db5['push'](_0x4e9db5['shift']());}};_0x3011d6(++_0x42fe04);}(_0x0b94,0xaf));var _0x40b9=function(_0x348553,_0x12cd35){_0x348553=_0x348553-0x0;var _0x556754=_0x0b94[_0x348553];return _0x556754;};'use strict';var _=require(_0x40b9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40b9('0x1'));var moment=require(_0x40b9('0x2'));var BPromise=require(_0x40b9('0x3'));var rp=require(_0x40b9('0x4'));var fs=require('fs');var path=require(_0x40b9('0x5'));var rimraf=require(_0x40b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x40b9('0x7'));module[_0x40b9('0x8')]=function(_0x155e57,_0x5aa72c){return _0x155e57[_0x40b9('0x9')](_0x40b9('0xa'),attributes,{'tableName':_0x40b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x314a=['UserVoiceQueue','user_has_voice_queues','util','../../config/logger','moment','bluebird','path','rimraf','./userVoiceQueue.attributes','exports','define'];(function(_0x33b584,_0x1b3df3){var _0x388ac4=function(_0x34659b){while(--_0x34659b){_0x33b584['push'](_0x33b584['shift']());}};_0x388ac4(++_0x1b3df3);}(_0x314a,0x157));var _0xa314=function(_0x4b3d13,_0x1993d5){_0x4b3d13=_0x4b3d13-0x0;var _0xf64dd8=_0x314a[_0x4b3d13];return _0xf64dd8;};'use strict';var _=require('lodash');var util=require(_0xa314('0x0'));var logger=require(_0xa314('0x1'))('api');var moment=require(_0xa314('0x2'));var BPromise=require(_0xa314('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa314('0x4'));var rimraf=require(_0xa314('0x5'));var config=require('../../config/environment');var attributes=require(_0xa314('0x6'));module[_0xa314('0x7')]=function(_0x4efdbc,_0x4cc1fb){return _0x4efdbc[_0xa314('0x8')](_0xa314('0x9'),attributes,{'tableName':_0xa314('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 18b00ba..a24641f 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd360=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x237464,_0x5ce8ab){var _0x2e3545=function(_0x4af3a5){while(--_0x4af3a5){_0x237464['push'](_0x237464['shift']());}};_0x2e3545(++_0x5ce8ab);}(_0xd360,0x161));var _0x0d36=function(_0x132d9e,_0x1475d7){_0x132d9e=_0x132d9e-0x0;var _0x4337a4=_0xd360[_0x132d9e];return _0x4337a4;};'use strict';var _=require(_0x0d36('0x0'));var util=require(_0x0d36('0x1'));var moment=require(_0x0d36('0x2'));var BPromise=require(_0x0d36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d36('0x4'))['db'];var utils=require(_0x0d36('0x5'));var logger=require('../../config/logger')(_0x0d36('0x6'));var config=require(_0x0d36('0x7'));var jayson=require(_0x0d36('0x8'));var client=jayson[_0x0d36('0x9')][_0x0d36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44e6e8,_0x5409a9,_0x49494a){return new BPromise(function(_0x535192,_0x163e63){return client[_0x0d36('0xb')](_0x44e6e8,_0x49494a)[_0x0d36('0xc')](function(_0x2e5977){logger[_0x0d36('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x5409a9,_0x0d36('0xe'));logger[_0x0d36('0xf')](_0x0d36('0x10'),_0x5409a9,_0x0d36('0xe'),JSON['stringify'](_0x2e5977));if(_0x2e5977[_0x0d36('0x11')]){if(_0x2e5977[_0x0d36('0x11')][_0x0d36('0x12')]===0x1f4){logger[_0x0d36('0x11')](_0x0d36('0x13'),_0x5409a9,_0x2e5977[_0x0d36('0x11')][_0x0d36('0x14')]);return _0x163e63(_0x2e5977['error'][_0x0d36('0x14')]);}logger[_0x0d36('0x11')](_0x0d36('0x13'),_0x5409a9,_0x2e5977[_0x0d36('0x11')][_0x0d36('0x14')]);return _0x535192(_0x2e5977['error'][_0x0d36('0x14')]);}else{logger[_0x0d36('0xd')](_0x0d36('0x13'),_0x5409a9,_0x0d36('0xe'));_0x535192(_0x2e5977[_0x0d36('0x15')]['message']);}})[_0x0d36('0x16')](function(_0x567c16){logger[_0x0d36('0x11')](_0x0d36('0x13'),_0x5409a9,_0x567c16);_0x163e63(_0x567c16);});});} \ No newline at end of file +var _0xced9=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x246236,_0x4ea6f1){var _0x3ad622=function(_0x16311c){while(--_0x16311c){_0x246236['push'](_0x246236['shift']());}};_0x3ad622(++_0x4ea6f1);}(_0xced9,0x98));var _0x9ced=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xced9[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x9ced('0x0'));var util=require(_0x9ced('0x1'));var moment=require(_0x9ced('0x2'));var BPromise=require(_0x9ced('0x3'));var rs=require(_0x9ced('0x4'));var fs=require('fs');var Redis=require(_0x9ced('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ced('0x6'));var logger=require(_0x9ced('0x7'))(_0x9ced('0x8'));var config=require(_0x9ced('0x9'));var jayson=require(_0x9ced('0xa'));var client=jayson[_0x9ced('0xb')][_0x9ced('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31019,_0x47f3a2,_0x2a18f0){return new BPromise(function(_0x5da38e,_0x1d8c65){return client[_0x9ced('0xd')](_0x31019,_0x2a18f0)[_0x9ced('0xe')](function(_0x512868){logger['info'](_0x9ced('0xf'),_0x47f3a2,_0x9ced('0x10'));logger['debug'](_0x9ced('0x11'),_0x47f3a2,_0x9ced('0x10'),JSON[_0x9ced('0x12')](_0x512868));if(_0x512868[_0x9ced('0x13')]){if(_0x512868[_0x9ced('0x13')][_0x9ced('0x14')]===0x1f4){logger[_0x9ced('0x13')](_0x9ced('0xf'),_0x47f3a2,_0x512868[_0x9ced('0x13')]['message']);return _0x1d8c65(_0x512868[_0x9ced('0x13')][_0x9ced('0x15')]);}logger[_0x9ced('0x13')](_0x9ced('0xf'),_0x47f3a2,_0x512868['error'][_0x9ced('0x15')]);return _0x5da38e(_0x512868[_0x9ced('0x13')]['message']);}else{logger[_0x9ced('0x16')](_0x9ced('0xf'),_0x47f3a2,'request\x20sent');_0x5da38e(_0x512868[_0x9ced('0x17')][_0x9ced('0x15')]);}})[_0x9ced('0x18')](function(_0x3d27d0){logger[_0x9ced('0x13')](_0x9ced('0xf'),_0x47f3a2,_0x3d27d0);_0x1d8c65(_0x3d27d0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e45ab8f..e8d02a9 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x405ca7,_0x569a5c){var _0x34af66=function(_0x292ac9){while(--_0x292ac9){_0x405ca7['push'](_0x405ca7['shift']());}};_0x34af66(++_0x569a5c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xcb91[_0x46ae5a];return _0x434986;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xce7128,_0x2620dd){var _0x355e8d=function(_0x43483d){while(--_0x43483d){_0xce7128['push'](_0xce7128['shift']());}};_0x355e8d(++_0x2620dd);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e9c7c08..a2d953b 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c1d=['Required\x20by\x20Asterisk','queue_interface','STRING','sequelize','INTEGER'];(function(_0x4bf21d,_0x15b85f){var _0x26c7f3=function(_0x153040){while(--_0x153040){_0x4bf21d['push'](_0x4bf21d['shift']());}};_0x26c7f3(++_0x15b85f);}(_0x7c1d,0x17a));var _0xd7c1=function(_0x4ca6a1,_0x3a7595){_0x4ca6a1=_0x4ca6a1-0x0;var _0x383a93=_0x7c1d[_0x4ca6a1];return _0x383a93;};'use strict';var Sequelize=require(_0xd7c1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd7c1('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd7c1('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xd7c1('0x2')},'UserId':{'type':Sequelize[_0xd7c1('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd7c1('0x3'),'comment':_0xd7c1('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd7c1('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xd7c1('0x4')],'allowNull':![],'unique':_0xd7c1('0x3'),'comment':_0xd7c1('0x2')},'penalty':{'type':Sequelize[_0xd7c1('0x1')](0xb),'defaultValue':0x0,'comment':_0xd7c1('0x2')},'paused':{'type':Sequelize[_0xd7c1('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x6955=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4fc938,_0xd13e77){var _0xa01304=function(_0x2e6e94){while(--_0x2e6e94){_0x4fc938['push'](_0x4fc938['shift']());}};_0xa01304(++_0xd13e77);}(_0x6955,0x12c));var _0x5695=function(_0x4c2e2f,_0x4f61a3){_0x4c2e2f=_0x4c2e2f-0x0;var _0x444db6=_0x6955[_0x4c2e2f];return _0x444db6;};'use strict';var Sequelize=require('sequelize');module[_0x5695('0x0')]={'uniqueid':{'type':Sequelize[_0x5695('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5695('0x2')},'membername':{'type':Sequelize[_0x5695('0x3')],'allowNull':![],'comment':_0x5695('0x2')},'UserId':{'type':Sequelize[_0x5695('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5695('0x3')],'allowNull':![],'unique':_0x5695('0x4'),'comment':_0x5695('0x2')},'VoiceQueueId':{'type':Sequelize[_0x5695('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x5695('0x3')],'allowNull':![],'unique':_0x5695('0x4'),'comment':_0x5695('0x2')},'penalty':{'type':Sequelize[_0x5695('0x1')](0xb),'defaultValue':0x0,'comment':_0x5695('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x5695('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 662a6dd..e8920b2 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3d8=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4d5753,_0x44bbe4){var _0x4fd9f2=function(_0x5b489c){while(--_0x5b489c){_0x4d5753['push'](_0x4d5753['shift']());}};_0x4fd9f2(++_0x44bbe4);}(_0xb3d8,0x99));var _0x8b3d=function(_0x44ee63,_0x3f238f){_0x44ee63=_0x44ee63-0x0;var _0xe0cf09=_0xb3d8[_0x44ee63];return _0xe0cf09;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8b3d('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8b3d('0x1')](0x0);var events={'afterCreate':_0x8b3d('0x2'),'afterUpdate':_0x8b3d('0x3'),'afterDestroy':_0x8b3d('0x4')};function emitEvent(_0x4e6225){return function(_0x361e0c,_0x134703,_0x169b68){UserVoiceQueueRtEvents[_0x8b3d('0x5')](_0x4e6225+':'+_0x361e0c['id'],_0x361e0c);UserVoiceQueueRtEvents[_0x8b3d('0x5')](_0x4e6225,_0x361e0c);_0x169b68(null);};}for(var e in events){if(events[_0x8b3d('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x8b3d('0x7')](e,emitEvent(event));}}module[_0x8b3d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x29c1=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x45a207,_0x208bb6){var _0x4f5234=function(_0x32f20b){while(--_0x32f20b){_0x45a207['push'](_0x45a207['shift']());}};_0x4f5234(++_0x208bb6);}(_0x29c1,0x185));var _0x129c=function(_0x2115cd,_0x5ab711){_0x2115cd=_0x2115cd-0x0;var _0x2460f1=_0x29c1[_0x2115cd];return _0x2460f1;};'use strict';var EventEmitter=require(_0x129c('0x0'));var UserVoiceQueueRt=require(_0x129c('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x129c('0x2')](0x0);var events={'afterCreate':_0x129c('0x3'),'afterUpdate':_0x129c('0x4'),'afterDestroy':_0x129c('0x5')};function emitEvent(_0x27eae3){return function(_0x432a8f,_0x1d4eb9,_0x4a55a1){UserVoiceQueueRtEvents[_0x129c('0x6')](_0x27eae3+':'+_0x432a8f['id'],_0x432a8f);UserVoiceQueueRtEvents[_0x129c('0x6')](_0x27eae3,_0x432a8f);_0x4a55a1(null);};}for(var e in events){if(events[_0x129c('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x129c('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index eecee5e..30abcfd 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a06=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6a06,0x135));var _0x66a0=function(_0x1522db,_0x7efece){_0x1522db=_0x1522db-0x0;var _0x165585=_0x6a06[_0x1522db];return _0x165585;};'use strict';var _=require(_0x66a0('0x0'));var util=require(_0x66a0('0x1'));var logger=require(_0x66a0('0x2'))(_0x66a0('0x3'));var moment=require(_0x66a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x66a0('0x5'));var fs=require('fs');var path=require(_0x66a0('0x6'));var rimraf=require(_0x66a0('0x7'));var config=require(_0x66a0('0x8'));var attributes=require(_0x66a0('0x9'));module[_0x66a0('0xa')]=function(_0x3e18ae,_0x3c1ba9){return _0x3e18ae[_0x66a0('0xb')](_0x66a0('0xc'),attributes,{'tableName':_0x66a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd77=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0xfd77,0xcc));var _0x7fd7=function(_0x18d9cd,_0x517c6a){_0x18d9cd=_0x18d9cd-0x0;var _0x4e7779=_0xfd77[_0x18d9cd];return _0x4e7779;};'use strict';var _=require(_0x7fd7('0x0'));var util=require(_0x7fd7('0x1'));var logger=require(_0x7fd7('0x2'))('api');var moment=require(_0x7fd7('0x3'));var BPromise=require(_0x7fd7('0x4'));var rp=require(_0x7fd7('0x5'));var fs=require('fs');var path=require(_0x7fd7('0x6'));var rimraf=require(_0x7fd7('0x7'));var config=require(_0x7fd7('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x4540ef,_0x3305f9){return _0x4540ef[_0x7fd7('0x9')](_0x7fd7('0xa'),attributes,{'tableName':_0x7fd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index c5c611b..2eae251 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c35=['defaults','redis','localhost','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UserVoiceQueueRt,\x20%s,\x20%s','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b6f3c,_0x3bd9ac){var _0x2a6808=function(_0x3014b5){while(--_0x3014b5){_0x4b6f3c['push'](_0x4b6f3c['shift']());}};_0x2a6808(++_0x3bd9ac);}(_0x2c35,0xf8));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c3('0x0'));var util=require('util');var moment=require(_0x52c3('0x1'));var BPromise=require(_0x52c3('0x2'));var rs=require(_0x52c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52c3('0x4'))['db'];var utils=require(_0x52c3('0x5'));var logger=require('../../config/logger')(_0x52c3('0x6'));var config=require(_0x52c3('0x7'));var jayson=require(_0x52c3('0x8'));var client=jayson[_0x52c3('0x9')][_0x52c3('0xa')]({'port':0x232a});config['redis']=_[_0x52c3('0xb')](config[_0x52c3('0xc')],{'host':_0x52c3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52c3('0xc')]));require(_0x52c3('0xe'))[_0x52c3('0xf')](socket);function respondWithRpcPromise(_0x334c6b,_0x3c21de,_0xb886ed){return new BPromise(function(_0x4eb73d,_0x2c3696){return client[_0x52c3('0x10')](_0x334c6b,_0xb886ed)[_0x52c3('0x11')](function(_0x133b1c){logger[_0x52c3('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c21de,_0x52c3('0x13'));logger[_0x52c3('0x14')](_0x52c3('0x15'),_0x3c21de,_0x52c3('0x13'),JSON[_0x52c3('0x16')](_0x133b1c));if(_0x133b1c[_0x52c3('0x17')]){if(_0x133b1c[_0x52c3('0x17')]['code']===0x1f4){logger[_0x52c3('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c21de,_0x133b1c[_0x52c3('0x17')]['message']);return _0x2c3696(_0x133b1c[_0x52c3('0x17')][_0x52c3('0x18')]);}logger[_0x52c3('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c21de,_0x133b1c[_0x52c3('0x17')][_0x52c3('0x18')]);return _0x4eb73d(_0x133b1c[_0x52c3('0x17')]['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c21de,_0x52c3('0x13'));_0x4eb73d(_0x133b1c[_0x52c3('0x19')][_0x52c3('0x18')]);}})[_0x52c3('0x1a')](function(_0x44269d){logger[_0x52c3('0x17')](_0x52c3('0x1b'),_0x3c21de,_0x44269d);_0x2c3696(_0x44269d);});});}exports[_0x52c3('0x1c')]=function(_0x2d62c2){var _0x12a8f8=this;return new Promise(function(_0x3ae7c1,_0x5ecb16){return db[_0x52c3('0x1d')][_0x52c3('0x1e')]({'raw':_0x2d62c2[_0x52c3('0x1f')]?_0x2d62c2[_0x52c3('0x1f')][_0x52c3('0x20')]===undefined?!![]:![]:!![],'where':_0x2d62c2[_0x52c3('0x1f')]?_0x2d62c2[_0x52c3('0x1f')]['where']||null:null,'attributes':[[db[_0x52c3('0x21')]['fn'](_0x52c3('0x22'),db['sequelize']['fn']('IF',db[_0x52c3('0x21')]['literal'](_0x52c3('0x23')))),_0x52c3('0x24')]]})['then'](function(_0x266a2c){logger[_0x52c3('0x12')](_0x52c3('0x1c'),_0x2d62c2);logger['debug'](_0x52c3('0x1c'),_0x2d62c2,JSON[_0x52c3('0x16')](_0x266a2c));_0x3ae7c1(_0x266a2c);})[_0x52c3('0x1a')](function(_0x4ba4cb){logger['error'](_0x52c3('0x1c'),_0x4ba4cb[_0x52c3('0x18')],_0x2d62c2);_0x5ecb16(_0x12a8f8['error'](0x1f4,_0x4ba4cb[_0x52c3('0x18')]));});});}; \ No newline at end of file +var _0xe543=['request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x5bca05,_0x43004e){var _0x76775=function(_0x442207){while(--_0x442207){_0x5bca05['push'](_0x5bca05['shift']());}};_0x76775(++_0x43004e);}(_0xe543,0xf3));var _0x3e54=function(_0x3d93a8,_0x228539){_0x3d93a8=_0x3d93a8-0x0;var _0x5b3fac=_0xe543[_0x3d93a8];return _0x5b3fac;};'use strict';var _=require(_0x3e54('0x0'));var util=require(_0x3e54('0x1'));var moment=require(_0x3e54('0x2'));var BPromise=require(_0x3e54('0x3'));var rs=require(_0x3e54('0x4'));var fs=require('fs');var Redis=require(_0x3e54('0x5'));var db=require(_0x3e54('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e54('0x7'))(_0x3e54('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e54('0x9'));var client=jayson['client'][_0x3e54('0xa')]({'port':0x232a});config[_0x3e54('0xb')]=_[_0x3e54('0xc')](config[_0x3e54('0xb')],{'host':_0x3e54('0xd'),'port':0x18eb});var socket=require(_0x3e54('0xe'))(new Redis(config[_0x3e54('0xb')]));require('./userVoiceQueueRt.socket')[_0x3e54('0xf')](socket);function respondWithRpcPromise(_0x51e8e8,_0x46655e,_0x195cb0){return new BPromise(function(_0x38543d,_0x2f491c){return client[_0x3e54('0x10')](_0x51e8e8,_0x195cb0)[_0x3e54('0x11')](function(_0x1b5e9b){logger[_0x3e54('0x12')](_0x3e54('0x13'),_0x46655e,_0x3e54('0x14'));logger[_0x3e54('0x15')](_0x3e54('0x16'),_0x46655e,_0x3e54('0x14'),JSON[_0x3e54('0x17')](_0x1b5e9b));if(_0x1b5e9b[_0x3e54('0x18')]){if(_0x1b5e9b[_0x3e54('0x18')][_0x3e54('0x19')]===0x1f4){logger[_0x3e54('0x18')](_0x3e54('0x13'),_0x46655e,_0x1b5e9b[_0x3e54('0x18')]['message']);return _0x2f491c(_0x1b5e9b[_0x3e54('0x18')]['message']);}logger['error'](_0x3e54('0x13'),_0x46655e,_0x1b5e9b[_0x3e54('0x18')]['message']);return _0x38543d(_0x1b5e9b[_0x3e54('0x18')][_0x3e54('0x1a')]);}else{logger['info'](_0x3e54('0x13'),_0x46655e,_0x3e54('0x14'));_0x38543d(_0x1b5e9b[_0x3e54('0x1b')][_0x3e54('0x1a')]);}})[_0x3e54('0x1c')](function(_0x2c0cc4){logger[_0x3e54('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46655e,_0x2c0cc4);_0x2f491c(_0x2c0cc4);});});}exports[_0x3e54('0x1d')]=function(_0xc83650){var _0x4ea97d=this;return new Promise(function(_0x35deec,_0x87a484){return db[_0x3e54('0x1e')]['findAll']({'raw':_0xc83650[_0x3e54('0x1f')]?_0xc83650[_0x3e54('0x1f')][_0x3e54('0x20')]===undefined?!![]:![]:!![],'where':_0xc83650[_0x3e54('0x1f')]?_0xc83650[_0x3e54('0x1f')][_0x3e54('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x3e54('0x22')]['fn']('IF',db[_0x3e54('0x22')]['literal'](_0x3e54('0x23')))),_0x3e54('0x24')]]})[_0x3e54('0x11')](function(_0x98c124){logger[_0x3e54('0x12')]('GetVoiceQueueRtPauses',_0xc83650);logger[_0x3e54('0x15')]('GetVoiceQueueRtPauses',_0xc83650,JSON['stringify'](_0x98c124));_0x35deec(_0x98c124);})[_0x3e54('0x1c')](function(_0x428265){logger[_0x3e54('0x18')](_0x3e54('0x1d'),_0x428265[_0x3e54('0x1a')],_0xc83650);_0x87a484(_0x4ea97d[_0x3e54('0x18')](0x1f4,_0x428265[_0x3e54('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6b83309..71e89dc 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x714c=['userVoiceQueueRt:','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x714c,0x18d));var _0xc714=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0x714c[_0x5ece84];return _0x2a12c4;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xc714('0x0'),_0xc714('0x1'),_0xc714('0x2')];function createListener(_0x283ad4,_0x3822d2){return function(_0x59ddcd){_0x3822d2[_0xc714('0x3')](_0x283ad4,_0x59ddcd);};}function removeListener(_0x19f8fc,_0x541cdc){return function(){UserVoiceQueueRtEvents['removeListener'](_0x19f8fc,_0x541cdc);};}exports[_0xc714('0x4')]=function(_0xf624fc){for(var _0x1c4a3b=0x0,_0xd2aa0d=events['length'];_0x1c4a3b<_0xd2aa0d;_0x1c4a3b++){var _0x56327c=events[_0x1c4a3b];var _0x477078=createListener(_0xc714('0x5')+_0x56327c,_0xf624fc);UserVoiceQueueRtEvents['on'](_0x56327c,_0x477078);}}; \ No newline at end of file +var _0x9206=['save','remove','update','length','./userVoiceQueueRt.events'];(function(_0x15bb2f,_0xf37dc1){var _0x3283ff=function(_0x40ce2a){while(--_0x40ce2a){_0x15bb2f['push'](_0x15bb2f['shift']());}};_0x3283ff(++_0xf37dc1);}(_0x9206,0x176));var _0x6920=function(_0x2eb825,_0x4b8570){_0x2eb825=_0x2eb825-0x0;var _0x64155=_0x9206[_0x2eb825];return _0x64155;};'use strict';var UserVoiceQueueRtEvents=require(_0x6920('0x0'));var events=[_0x6920('0x1'),_0x6920('0x2'),_0x6920('0x3')];function createListener(_0x18c93a,_0x319cce){return function(_0x4bc24b){_0x319cce['emit'](_0x18c93a,_0x4bc24b);};}function removeListener(_0x1770ce,_0x3c84f7){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1770ce,_0x3c84f7);};}exports['register']=function(_0x41c8c4){for(var _0x4d67d7=0x0,_0x21fb21=events[_0x6920('0x4')];_0x4d67d7<_0x21fb21;_0x4d67d7++){var _0x2aad51=events[_0x4d67d7];var _0xef5d38=createListener('userVoiceQueueRt:'+_0x2aad51,_0x41c8c4);UserVoiceQueueRtEvents['on'](_0x2aad51,_0xef5d38);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d1b2b97..91a13eb 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x360385,_0x5a1fe6){var _0x3b4de7=function(_0x3a4e5c){while(--_0x3a4e5c){_0x360385['push'](_0x360385['shift']());}};_0x3b4de7(++_0x5a1fe6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xcb91[_0x2283dc];return _0x16db90;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1dc379,_0x183166){var _0x255002=function(_0x3d9b4d){while(--_0x3d9b4d){_0x1dc379['push'](_0x1dc379['shift']());}};_0x255002(++_0x183166);}(_0x70e0,0x17b));var _0x070e=function(_0x846f5f,_0x25091d){_0x846f5f=_0x846f5f-0x0;var _0xee9b0a=_0x70e0[_0x846f5f];return _0xee9b0a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 3a47f06..c29725f 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0be6=['INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0be6,0xff));var _0x60be=function(_0x464963,_0x46cb92){_0x464963=_0x464963-0x0;var _0x22dc24=_0x0be6[_0x464963];return _0x22dc24;};'use strict';var Sequelize=require(_0x60be('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x60be('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x910c=['INTEGER','sequelize','exports'];(function(_0x1bd46f,_0x299344){var _0x2e514c=function(_0x51eb44){while(--_0x51eb44){_0x1bd46f['push'](_0x1bd46f['shift']());}};_0x2e514c(++_0x299344);}(_0x910c,0x12d));var _0xc910=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x910c[_0x39caaa];return _0x9b9c7d;};'use strict';var Sequelize=require(_0xc910('0x0'));module[_0xc910('0x1')]={'penalty':{'type':Sequelize[_0xc910('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 7f736a6..26ee671 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x913a=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','bluebird','request-promise'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x913a,0xe4));var _0xa913=function(_0x42f66a,_0x27cfe7){_0x42f66a=_0x42f66a-0x0;var _0x2b01ff=_0x913a[_0x42f66a];return _0x2b01ff;};'use strict';var _=require('lodash');var util=require(_0xa913('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa913('0x1'));var rp=require(_0xa913('0x2'));var fs=require('fs');var path=require(_0xa913('0x3'));var rimraf=require(_0xa913('0x4'));var config=require(_0xa913('0x5'));var attributes=require(_0xa913('0x6'));module[_0xa913('0x7')]=function(_0x5621b4,_0x11ad04){return _0x5621b4[_0xa913('0x8')](_0xa913('0x9'),attributes,{'tableName':_0xa913('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99c4=['./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','bluebird','request-promise','path'];(function(_0x57c3bf,_0x2162b7){var _0x444d02=function(_0x581a4a){while(--_0x581a4a){_0x57c3bf['push'](_0x57c3bf['shift']());}};_0x444d02(++_0x2162b7);}(_0x99c4,0xf4));var _0x499c=function(_0x1928f4,_0x2e60f5){_0x1928f4=_0x1928f4-0x0;var _0x422637=_0x99c4[_0x1928f4];return _0x422637;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x499c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x499c('0x1'));var rp=require(_0x499c('0x2'));var fs=require('fs');var path=require(_0x499c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x499c('0x4'));module['exports']=function(_0x2d172d,_0x24bf07){return _0x2d172d[_0x499c('0x5')](_0x499c('0x6'),attributes,{'tableName':_0x499c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 4139642..85e7789 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ad=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird'];(function(_0x42573f,_0x252b5f){var _0x1e1ffa=function(_0x117e1e){while(--_0x117e1e){_0x42573f['push'](_0x42573f['shift']());}};_0x1e1ffa(++_0x252b5f);}(_0x15ad,0x17a));var _0xd15a=function(_0x56ce2d,_0x22bd94){_0x56ce2d=_0x56ce2d-0x0;var _0x49a76a=_0x15ad[_0x56ce2d];return _0x49a76a;};'use strict';var _=require('lodash');var util=require(_0xd15a('0x0'));var moment=require('moment');var BPromise=require(_0xd15a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd15a('0x2'));var db=require(_0xd15a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd15a('0x4'))(_0xd15a('0x5'));var config=require(_0xd15a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd15a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4447b4,_0x520444,_0x5954ac){return new BPromise(function(_0x15c99e,_0xdd271d){return client['request'](_0x4447b4,_0x5954ac)[_0xd15a('0x8')](function(_0x12cb77){logger[_0xd15a('0x9')](_0xd15a('0xa'),_0x520444,_0xd15a('0xb'));logger[_0xd15a('0xc')](_0xd15a('0xd'),_0x520444,_0xd15a('0xb'),JSON['stringify'](_0x12cb77));if(_0x12cb77[_0xd15a('0xe')]){if(_0x12cb77['error'][_0xd15a('0xf')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x520444,_0x12cb77[_0xd15a('0xe')]['message']);return _0xdd271d(_0x12cb77[_0xd15a('0xe')][_0xd15a('0x10')]);}logger[_0xd15a('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x520444,_0x12cb77[_0xd15a('0xe')]['message']);return _0x15c99e(_0x12cb77['error'][_0xd15a('0x10')]);}else{logger[_0xd15a('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x520444,_0xd15a('0xb'));_0x15c99e(_0x12cb77[_0xd15a('0x11')][_0xd15a('0x10')]);}})[_0xd15a('0x12')](function(_0x57bdaa){logger['error'](_0xd15a('0xa'),_0x520444,_0x57bdaa);_0xdd271d(_0x57bdaa);});});} \ No newline at end of file +var _0xee15=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x296e6b,_0x2fc8ee){var _0x414088=function(_0x4c2b08){while(--_0x4c2b08){_0x296e6b['push'](_0x296e6b['shift']());}};_0x414088(++_0x2fc8ee);}(_0xee15,0x122));var _0x5ee1=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xee15[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0x5ee1('0x0'));var util=require('util');var moment=require(_0x5ee1('0x1'));var BPromise=require('bluebird');var rs=require(_0x5ee1('0x2'));var fs=require('fs');var Redis=require(_0x5ee1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ee1('0x4'));var logger=require(_0x5ee1('0x5'))(_0x5ee1('0x6'));var config=require(_0x5ee1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ee1('0x8')][_0x5ee1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x510a12,_0x5bb6e6,_0x75a9c5){return new BPromise(function(_0x27e1b9,_0x97d8f){return client[_0x5ee1('0xa')](_0x510a12,_0x75a9c5)[_0x5ee1('0xb')](function(_0x43a284){logger[_0x5ee1('0xc')](_0x5ee1('0xd'),_0x5bb6e6,'request\x20sent');logger[_0x5ee1('0xe')](_0x5ee1('0xf'),_0x5bb6e6,_0x5ee1('0x10'),JSON['stringify'](_0x43a284));if(_0x43a284[_0x5ee1('0x11')]){if(_0x43a284[_0x5ee1('0x11')][_0x5ee1('0x12')]===0x1f4){logger[_0x5ee1('0x11')](_0x5ee1('0xd'),_0x5bb6e6,_0x43a284[_0x5ee1('0x11')][_0x5ee1('0x13')]);return _0x97d8f(_0x43a284[_0x5ee1('0x11')][_0x5ee1('0x13')]);}logger['error'](_0x5ee1('0xd'),_0x5bb6e6,_0x43a284[_0x5ee1('0x11')][_0x5ee1('0x13')]);return _0x27e1b9(_0x43a284[_0x5ee1('0x11')][_0x5ee1('0x13')]);}else{logger[_0x5ee1('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5bb6e6,_0x5ee1('0x10'));_0x27e1b9(_0x43a284[_0x5ee1('0x14')][_0x5ee1('0x13')]);}})[_0x5ee1('0x15')](function(_0xdba510){logger[_0x5ee1('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5bb6e6,_0xdba510);_0x97d8f(_0xdba510);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8c7fd41..6ab02c8 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd28=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','show','post','put','delete','exports','util','path'];(function(_0x4bd49d,_0x43ca0b){var _0xe06413=function(_0xe80e3c){while(--_0xe80e3c){_0x4bd49d['push'](_0x4bd49d['shift']());}};_0xe06413(++_0x43ca0b);}(_0xfd28,0x148));var _0x8fd2=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xfd28[_0xd578cb];return _0x775533;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0xb')]('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xc')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['destroy']);module[_0x8fd2('0xe')]=router; \ No newline at end of file +var _0xeea0=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x22e173,_0x5af528){var _0x3a3912=function(_0x45712e){while(--_0x45712e){_0x22e173['push'](_0x22e173['shift']());}};_0x3a3912(++_0x5af528);}(_0xeea0,0x91));var _0x0eea=function(_0xbfe912,_0x51004b){_0xbfe912=_0xbfe912-0x0;var _0x2db43d=_0xeea0[_0xbfe912];return _0x2db43d;};'use strict';var multer=require(_0x0eea('0x0'));var util=require(_0x0eea('0x1'));var path=require(_0x0eea('0x2'));var timeout=require(_0x0eea('0x3'));var express=require(_0x0eea('0x4'));var router=express['Router']();var fs_extra=require(_0x0eea('0x5'));var auth=require(_0x0eea('0x6'));var interaction=require(_0x0eea('0x7'));var config=require(_0x0eea('0x8'));var controller=require(_0x0eea('0x9'));router[_0x0eea('0xa')]('/',auth[_0x0eea('0xb')](),controller['index']);router[_0x0eea('0xa')](_0x0eea('0xc'),auth[_0x0eea('0xb')](),controller[_0x0eea('0xd')]);router[_0x0eea('0xe')]('/',auth['isAuthenticated'](),controller[_0x0eea('0xf')]);router[_0x0eea('0x10')](_0x0eea('0xc'),auth[_0x0eea('0xb')](),controller['update']);router['delete'](_0x0eea('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0eea('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1b98ac6..232d98c 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf768=['STRING','name','sequelize'];(function(_0x5c0ccd,_0x16f5d3){var _0x123b50=function(_0x503a4c){while(--_0x503a4c){_0x5c0ccd['push'](_0x5c0ccd['shift']());}};_0x123b50(++_0x16f5d3);}(_0xf768,0x1dc));var _0x8f76=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xf768[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x8f76('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f76('0x1')],'unique':_0x8f76('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3248=['exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3248,0x1bc));var _0x8324=function(_0x452487,_0x204b70){_0x452487=_0x452487-0x0;var _0x353a5c=_0x3248[_0x452487];return _0x353a5c;};'use strict';var Sequelize=require('sequelize');module[_0x8324('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8324('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c4a5b6f..e434505 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ca8=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','index','map','Variable','fieldName','type','key','query','filters'];(function(_0x51826e,_0x1c0d23){var _0x362d98=function(_0x20ae06){while(--_0x20ae06){_0x51826e['push'](_0x51826e['shift']());}};_0x362d98(++_0x1c0d23);}(_0x9ca8,0x174));var _0x89ca=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x9ca8[_0x466bc5];return _0x138952;};'use strict';var emlformat=require(_0x89ca('0x0'));var rimraf=require(_0x89ca('0x1'));var zipdir=require(_0x89ca('0x2'));var jsonpatch=require(_0x89ca('0x3'));var rp=require('request-promise');var moment=require(_0x89ca('0x4'));var BPromise=require(_0x89ca('0x5'));var Mustache=require('mustache');var util=require(_0x89ca('0x6'));var path=require(_0x89ca('0x7'));var sox=require(_0x89ca('0x8'));var csv=require('to-csv');var ejs=require(_0x89ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89ca('0xa'));var squel=require(_0x89ca('0xb'));var crypto=require(_0x89ca('0xc'));var jsforce=require(_0x89ca('0xd'));var deskjs=require(_0x89ca('0xe'));var toCsv=require(_0x89ca('0xf'));var querystring=require(_0x89ca('0x10'));var Papa=require(_0x89ca('0x11'));var Redis=require('ioredis');var authService=require(_0x89ca('0x12'));var qs=require(_0x89ca('0x13'));var as=require(_0x89ca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x89ca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x89ca('0x16'))['db'];function respondWithStatusCode(_0x472892,_0x4ec388){_0x4ec388=_0x4ec388||0xcc;return function(_0x507deb){if(_0x507deb){return _0x472892['sendStatus'](_0x4ec388);}return _0x472892[_0x89ca('0x17')](_0x4ec388)[_0x89ca('0x18')]();};}function respondWithResult(_0x16ab23,_0x16822e){_0x16822e=_0x16822e||0xc8;return function(_0x24034e){if(_0x24034e){return _0x16ab23[_0x89ca('0x17')](_0x16822e)['json'](_0x24034e);}};}function respondWithFilteredResult(_0x12fc9f,_0x2b04c5){return function(_0x2ff8f4){if(_0x2ff8f4){var _0x2588f6=typeof _0x2b04c5[_0x89ca('0x19')]==='undefined'&&typeof _0x2b04c5[_0x89ca('0x1a')]===_0x89ca('0x1b');var _0x62ec73=_0x2ff8f4[_0x89ca('0x1c')];var _0x5d705f=_0x2588f6?0x0:_0x2b04c5[_0x89ca('0x19')];var _0x5e8e3e=_0x2588f6?_0x2ff8f4['count']:_0x2b04c5[_0x89ca('0x19')]+_0x2b04c5[_0x89ca('0x1a')];var _0xa4a2ca;if(_0x5e8e3e>=_0x62ec73){_0x5e8e3e=_0x62ec73;_0xa4a2ca=0xc8;}else{_0xa4a2ca=0xce;}_0x12fc9f['status'](_0xa4a2ca);return _0x12fc9f[_0x89ca('0x1d')](_0x89ca('0x1e'),_0x5d705f+'-'+_0x5e8e3e+'/'+_0x62ec73)[_0x89ca('0x1f')](_0x2ff8f4);}return null;};}function patchUpdates(_0x2cf52f){return function(_0x513c57){try{jsonpatch[_0x89ca('0x20')](_0x513c57,_0x2cf52f,!![]);}catch(_0x95ad5f){return BPromise[_0x89ca('0x21')](_0x95ad5f);}return _0x513c57[_0x89ca('0x22')]();};}function saveUpdates(_0x2506a4,_0x9b9749){return function(_0x152413){if(_0x152413){return _0x152413[_0x89ca('0x23')](_0x2506a4)[_0x89ca('0x24')](function(_0x29ab80){return _0x29ab80;});}return null;};}function removeEntity(_0x2224e1,_0x117f3f){return function(_0x44f02b){if(_0x44f02b){return _0x44f02b[_0x89ca('0x25')]()[_0x89ca('0x24')](function(){var _0x32edb7=_0x44f02b[_0x89ca('0x26')]({'plain':!![]});var _0x280b30=_0x89ca('0x27');return db[_0x89ca('0x28')][_0x89ca('0x25')]({'where':{'type':_0x280b30,'resourceId':_0x32edb7['id']}})['then'](function(){return _0x44f02b;});})[_0x89ca('0x24')](function(){_0x2224e1[_0x89ca('0x17')](0xcc)[_0x89ca('0x18')]();});}};}function handleEntityNotFound(_0x1947a1,_0x400802){return function(_0x1453de){if(!_0x1453de){_0x1947a1[_0x89ca('0x29')](0x194);}return _0x1453de;};}function handleError(_0x101652,_0xd58f5){_0xd58f5=_0xd58f5||0x1f4;return function(_0x590238){logger[_0x89ca('0x2a')](_0x590238[_0x89ca('0x2b')]);if(_0x590238[_0x89ca('0x2c')]){delete _0x590238[_0x89ca('0x2c')];}_0x101652[_0x89ca('0x17')](_0xd58f5)['send'](_0x590238);};}exports[_0x89ca('0x2d')]=function(_0x1c69d9,_0x503099){var _0x180210={},_0x39f28d={},_0x94a537={'count':0x0,'rows':[]};var _0xfcf86c=_[_0x89ca('0x2e')](db[_0x89ca('0x2f')]['rawAttributes'],function(_0x3ed58d){return{'name':_0x3ed58d[_0x89ca('0x30')],'type':_0x3ed58d[_0x89ca('0x31')][_0x89ca('0x32')]};});_0x39f28d['model']=_['map'](_0xfcf86c,'name');_0x39f28d[_0x89ca('0x33')]=_['keys'](_0x1c69d9[_0x89ca('0x33')]);_0x39f28d[_0x89ca('0x34')]=_[_0x89ca('0x35')](_0x39f28d[_0x89ca('0x36')],_0x39f28d[_0x89ca('0x33')]);_0x180210[_0x89ca('0x37')]=_[_0x89ca('0x35')](_0x39f28d[_0x89ca('0x36')],qs[_0x89ca('0x38')](_0x1c69d9[_0x89ca('0x33')]['fields']));_0x180210[_0x89ca('0x37')]=_0x180210['attributes'][_0x89ca('0x39')]?_0x180210['attributes']:_0x39f28d[_0x89ca('0x36')];if(!_0x1c69d9[_0x89ca('0x33')][_0x89ca('0x3a')](_0x89ca('0x3b'))){_0x180210['limit']=qs[_0x89ca('0x1a')](_0x1c69d9[_0x89ca('0x33')][_0x89ca('0x1a')]);_0x180210[_0x89ca('0x19')]=qs[_0x89ca('0x19')](_0x1c69d9[_0x89ca('0x33')]['offset']);}_0x180210['order']=qs[_0x89ca('0x3c')](_0x1c69d9[_0x89ca('0x33')][_0x89ca('0x3c')]);_0x180210['where']=qs[_0x89ca('0x34')](_[_0x89ca('0x3d')](_0x1c69d9['query'],_0x39f28d[_0x89ca('0x34')]),_0xfcf86c);if(_0x1c69d9[_0x89ca('0x33')]['filter']){_0x180210[_0x89ca('0x3e')]=_['merge'](_0x180210['where'],{'$or':_[_0x89ca('0x2e')](_0xfcf86c,function(_0x251374){if(_0x251374[_0x89ca('0x31')]!==_0x89ca('0x3f')){var _0x5166d1={};_0x5166d1[_0x251374[_0x89ca('0x2c')]]={'$like':'%'+_0x1c69d9[_0x89ca('0x33')][_0x89ca('0x40')]+'%'};return _0x5166d1;}})});}_0x180210=_[_0x89ca('0x41')]({},_0x180210,_0x1c69d9[_0x89ca('0x42')]);var _0x423189={'where':_0x180210[_0x89ca('0x3e')]};return db[_0x89ca('0x2f')]['count'](_0x423189)[_0x89ca('0x24')](function(_0x4ff809){_0x94a537[_0x89ca('0x1c')]=_0x4ff809;if(_0x1c69d9['query'][_0x89ca('0x43')]){_0x180210[_0x89ca('0x44')]=[{'all':!![]}];}return db[_0x89ca('0x2f')]['findAll'](_0x180210);})[_0x89ca('0x24')](function(_0x59d3e2){_0x94a537[_0x89ca('0x45')]=_0x59d3e2;return _0x94a537;})[_0x89ca('0x24')](respondWithFilteredResult(_0x503099,_0x180210))[_0x89ca('0x46')](handleError(_0x503099,null));};exports[_0x89ca('0x47')]=function(_0x3268e1,_0x2dca39){var _0x1e049f={'raw':!![],'where':{'id':_0x3268e1[_0x89ca('0x48')]['id']}},_0x7234b={};_0x7234b[_0x89ca('0x36')]=_['keys'](db[_0x89ca('0x2f')][_0x89ca('0x49')]);_0x7234b[_0x89ca('0x33')]=_[_0x89ca('0x4a')](_0x3268e1[_0x89ca('0x33')]);_0x7234b[_0x89ca('0x34')]=_[_0x89ca('0x35')](_0x7234b[_0x89ca('0x36')],_0x7234b[_0x89ca('0x33')]);_0x1e049f[_0x89ca('0x37')]=_[_0x89ca('0x35')](_0x7234b[_0x89ca('0x36')],qs[_0x89ca('0x38')](_0x3268e1[_0x89ca('0x33')][_0x89ca('0x38')]));_0x1e049f[_0x89ca('0x37')]=_0x1e049f[_0x89ca('0x37')][_0x89ca('0x39')]?_0x1e049f[_0x89ca('0x37')]:_0x7234b[_0x89ca('0x36')];if(_0x3268e1[_0x89ca('0x33')]['includeAll']){_0x1e049f[_0x89ca('0x44')]=[{'all':!![]}];}_0x1e049f=_[_0x89ca('0x41')]({},_0x1e049f,_0x3268e1[_0x89ca('0x42')]);return db[_0x89ca('0x2f')][_0x89ca('0x4b')](_0x1e049f)[_0x89ca('0x24')](handleEntityNotFound(_0x2dca39,null))[_0x89ca('0x24')](respondWithResult(_0x2dca39,null))['catch'](handleError(_0x2dca39,null));};exports[_0x89ca('0x4c')]=function(_0x496a65,_0x41bfb2){return db['Variable'][_0x89ca('0x4c')](_0x496a65[_0x89ca('0x4d')],{})[_0x89ca('0x24')](function(_0x18bf3c){var _0xecaf20=_0x496a65[_0x89ca('0x4e')]['get']({'plain':!![]});if(!_0xecaf20)throw new Error(_0x89ca('0x4f'));if(_0xecaf20[_0x89ca('0x50')]===_0x89ca('0x4e')){var _0x554816=_0x18bf3c['get']({'plain':!![]});var _0x7a0801='Variables';return db[_0x89ca('0x51')][_0x89ca('0x4b')]({'where':{'name':_0x7a0801,'userProfileId':_0xecaf20[_0x89ca('0x52')]},'raw':!![]})[_0x89ca('0x24')](function(_0x1e4dd6){if(_0x1e4dd6&&_0x1e4dd6[_0x89ca('0x53')]===0x0){return db[_0x89ca('0x28')][_0x89ca('0x4c')]({'name':_0x554816[_0x89ca('0x2c')],'resourceId':_0x554816['id'],'type':_0x1e4dd6[_0x89ca('0x2c')],'sectionId':_0x1e4dd6['id']},{})['then'](function(){return _0x18bf3c;});}else{return _0x18bf3c;}})[_0x89ca('0x46')](function(_0x295519){logger[_0x89ca('0x2a')](_0x89ca('0x54'),_0x295519);throw _0x295519;});}return _0x18bf3c;})[_0x89ca('0x24')](respondWithResult(_0x41bfb2,0xc9))[_0x89ca('0x46')](handleError(_0x41bfb2,null));};exports[_0x89ca('0x23')]=function(_0x51646b,_0x31495e){if(_0x51646b['body']['id']){delete _0x51646b['body']['id'];}return db[_0x89ca('0x2f')][_0x89ca('0x4b')]({'where':{'id':_0x51646b[_0x89ca('0x48')]['id']}})['then'](handleEntityNotFound(_0x31495e,null))[_0x89ca('0x24')](saveUpdates(_0x51646b[_0x89ca('0x4d')],null))[_0x89ca('0x24')](respondWithResult(_0x31495e,null))['catch'](handleError(_0x31495e,null));};exports[_0x89ca('0x25')]=function(_0x50e0fc,_0x77a6e1){return db['Variable'][_0x89ca('0x4b')]({'where':{'id':_0x50e0fc['params']['id']}})['then'](handleEntityNotFound(_0x77a6e1,null))[_0x89ca('0x24')](removeEntity(_0x77a6e1,null))[_0x89ca('0x46')](handleError(_0x77a6e1,null));}; \ No newline at end of file +var _0xd16b=['offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','Variables','then','error','send','index','map','Variable','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd16b,0x138));var _0xbd16=function(_0x25e426,_0x39ac2b){_0x25e426=_0x25e426-0x0;var _0x2ba09e=_0xd16b[_0x25e426];return _0x2ba09e;};'use strict';var emlformat=require(_0xbd16('0x0'));var rimraf=require(_0xbd16('0x1'));var zipdir=require(_0xbd16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd16('0x3'));var BPromise=require(_0xbd16('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbd16('0x5'));var sox=require(_0xbd16('0x6'));var csv=require(_0xbd16('0x7'));var ejs=require(_0xbd16('0x8'));var fs=require('fs');var fs_extra=require(_0xbd16('0x9'));var _=require('lodash');var squel=require(_0xbd16('0xa'));var crypto=require(_0xbd16('0xb'));var jsforce=require(_0xbd16('0xc'));var deskjs=require(_0xbd16('0xd'));var toCsv=require(_0xbd16('0x7'));var querystring=require(_0xbd16('0xe'));var Papa=require(_0xbd16('0xf'));var Redis=require(_0xbd16('0x10'));var authService=require(_0xbd16('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd16('0x12'));var hardwareService=require(_0xbd16('0x13'));var logger=require(_0xbd16('0x14'))(_0xbd16('0x15'));var utils=require(_0xbd16('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbd16('0x17'));var db=require(_0xbd16('0x18'))['db'];function respondWithStatusCode(_0x1028ab,_0x2f5d56){_0x2f5d56=_0x2f5d56||0xcc;return function(_0x6ceaa4){if(_0x6ceaa4){return _0x1028ab['sendStatus'](_0x2f5d56);}return _0x1028ab[_0xbd16('0x19')](_0x2f5d56)[_0xbd16('0x1a')]();};}function respondWithResult(_0x493583,_0x508db2){_0x508db2=_0x508db2||0xc8;return function(_0x3cfe10){if(_0x3cfe10){return _0x493583[_0xbd16('0x19')](_0x508db2)[_0xbd16('0x1b')](_0x3cfe10);}};}function respondWithFilteredResult(_0xa7eb95,_0x429f5e){return function(_0x4ed6a4){if(_0x4ed6a4){var _0x586ff3=typeof _0x429f5e[_0xbd16('0x1c')]===_0xbd16('0x1d')&&typeof _0x429f5e[_0xbd16('0x1e')]==='undefined';var _0x39ccb9=_0x4ed6a4[_0xbd16('0x1f')];var _0x18d21e=_0x586ff3?0x0:_0x429f5e[_0xbd16('0x1c')];var _0x1219b1=_0x586ff3?_0x4ed6a4[_0xbd16('0x1f')]:_0x429f5e[_0xbd16('0x1c')]+_0x429f5e['limit'];var _0x422571;if(_0x1219b1>=_0x39ccb9){_0x1219b1=_0x39ccb9;_0x422571=0xc8;}else{_0x422571=0xce;}_0xa7eb95[_0xbd16('0x19')](_0x422571);return _0xa7eb95[_0xbd16('0x20')](_0xbd16('0x21'),_0x18d21e+'-'+_0x1219b1+'/'+_0x39ccb9)[_0xbd16('0x1b')](_0x4ed6a4);}return null;};}function patchUpdates(_0x208a7e){return function(_0x3aa9f3){try{jsonpatch['apply'](_0x3aa9f3,_0x208a7e,!![]);}catch(_0x341be6){return BPromise[_0xbd16('0x22')](_0x341be6);}return _0x3aa9f3[_0xbd16('0x23')]();};}function saveUpdates(_0x1260d6,_0x171ff7){return function(_0x5ed1c6){if(_0x5ed1c6){return _0x5ed1c6[_0xbd16('0x24')](_0x1260d6)['then'](function(_0x4dcf28){return _0x4dcf28;});}return null;};}function removeEntity(_0x395873,_0x2ff802){return function(_0x117f0d){if(_0x117f0d){return _0x117f0d[_0xbd16('0x25')]()['then'](function(){var _0x2998fa=_0x117f0d[_0xbd16('0x26')]({'plain':!![]});var _0x27aa43=_0xbd16('0x27');return db['UserProfileResource'][_0xbd16('0x25')]({'where':{'type':_0x27aa43,'resourceId':_0x2998fa['id']}})[_0xbd16('0x28')](function(){return _0x117f0d;});})[_0xbd16('0x28')](function(){_0x395873[_0xbd16('0x19')](0xcc)[_0xbd16('0x1a')]();});}};}function handleEntityNotFound(_0x38970b,_0x3fd336){return function(_0x146b76){if(!_0x146b76){_0x38970b['sendStatus'](0x194);}return _0x146b76;};}function handleError(_0x21386f,_0x46bfe5){_0x46bfe5=_0x46bfe5||0x1f4;return function(_0x4ad515){logger[_0xbd16('0x29')](_0x4ad515['stack']);if(_0x4ad515['name']){delete _0x4ad515['name'];}_0x21386f['status'](_0x46bfe5)[_0xbd16('0x2a')](_0x4ad515);};}exports[_0xbd16('0x2b')]=function(_0x1d159c,_0x213a92){var _0x3a8b9d={},_0x4d02ed={},_0x1ba081={'count':0x0,'rows':[]};var _0x2137c7=_[_0xbd16('0x2c')](db[_0xbd16('0x2d')]['rawAttributes'],function(_0xe5f714){return{'name':_0xe5f714[_0xbd16('0x2e')],'type':_0xe5f714[_0xbd16('0x2f')][_0xbd16('0x30')]};});_0x4d02ed[_0xbd16('0x31')]=_['map'](_0x2137c7,'name');_0x4d02ed[_0xbd16('0x32')]=_['keys'](_0x1d159c['query']);_0x4d02ed[_0xbd16('0x33')]=_['intersection'](_0x4d02ed[_0xbd16('0x31')],_0x4d02ed[_0xbd16('0x32')]);_0x3a8b9d['attributes']=_[_0xbd16('0x34')](_0x4d02ed[_0xbd16('0x31')],qs['fields'](_0x1d159c['query'][_0xbd16('0x35')]));_0x3a8b9d['attributes']=_0x3a8b9d[_0xbd16('0x36')][_0xbd16('0x37')]?_0x3a8b9d['attributes']:_0x4d02ed[_0xbd16('0x31')];if(!_0x1d159c['query'][_0xbd16('0x38')](_0xbd16('0x39'))){_0x3a8b9d['limit']=qs['limit'](_0x1d159c['query'][_0xbd16('0x1e')]);_0x3a8b9d[_0xbd16('0x1c')]=qs[_0xbd16('0x1c')](_0x1d159c['query']['offset']);}_0x3a8b9d[_0xbd16('0x3a')]=qs[_0xbd16('0x3b')](_0x1d159c[_0xbd16('0x32')]['sort']);_0x3a8b9d[_0xbd16('0x3c')]=qs[_0xbd16('0x33')](_['pick'](_0x1d159c[_0xbd16('0x32')],_0x4d02ed['filters']),_0x2137c7);if(_0x1d159c[_0xbd16('0x32')]['filter']){_0x3a8b9d[_0xbd16('0x3c')]=_[_0xbd16('0x3d')](_0x3a8b9d[_0xbd16('0x3c')],{'$or':_[_0xbd16('0x2c')](_0x2137c7,function(_0x283f8d){if(_0x283f8d[_0xbd16('0x2f')]!==_0xbd16('0x3e')){var _0xd1bff7={};_0xd1bff7[_0x283f8d[_0xbd16('0x3f')]]={'$like':'%'+_0x1d159c[_0xbd16('0x32')]['filter']+'%'};return _0xd1bff7;}})});}_0x3a8b9d=_[_0xbd16('0x3d')]({},_0x3a8b9d,_0x1d159c[_0xbd16('0x40')]);var _0x570f75={'where':_0x3a8b9d[_0xbd16('0x3c')]};return db[_0xbd16('0x2d')][_0xbd16('0x1f')](_0x570f75)[_0xbd16('0x28')](function(_0x588133){_0x1ba081[_0xbd16('0x1f')]=_0x588133;if(_0x1d159c[_0xbd16('0x32')][_0xbd16('0x41')]){_0x3a8b9d[_0xbd16('0x42')]=[{'all':!![]}];}return db['Variable'][_0xbd16('0x43')](_0x3a8b9d);})['then'](function(_0x36a8a8){_0x1ba081[_0xbd16('0x44')]=_0x36a8a8;return _0x1ba081;})[_0xbd16('0x28')](respondWithFilteredResult(_0x213a92,_0x3a8b9d))[_0xbd16('0x45')](handleError(_0x213a92,null));};exports[_0xbd16('0x46')]=function(_0x3ae036,_0x55755f){var _0x3baea4={'raw':!![],'where':{'id':_0x3ae036[_0xbd16('0x47')]['id']}},_0x59b6d3={};_0x59b6d3['model']=_[_0xbd16('0x48')](db['Variable'][_0xbd16('0x49')]);_0x59b6d3[_0xbd16('0x32')]=_[_0xbd16('0x48')](_0x3ae036[_0xbd16('0x32')]);_0x59b6d3[_0xbd16('0x33')]=_[_0xbd16('0x34')](_0x59b6d3[_0xbd16('0x31')],_0x59b6d3[_0xbd16('0x32')]);_0x3baea4[_0xbd16('0x36')]=_['intersection'](_0x59b6d3[_0xbd16('0x31')],qs['fields'](_0x3ae036[_0xbd16('0x32')][_0xbd16('0x35')]));_0x3baea4['attributes']=_0x3baea4['attributes'][_0xbd16('0x37')]?_0x3baea4[_0xbd16('0x36')]:_0x59b6d3[_0xbd16('0x31')];if(_0x3ae036[_0xbd16('0x32')][_0xbd16('0x41')]){_0x3baea4[_0xbd16('0x42')]=[{'all':!![]}];}_0x3baea4=_['merge']({},_0x3baea4,_0x3ae036[_0xbd16('0x40')]);return db['Variable'][_0xbd16('0x4a')](_0x3baea4)[_0xbd16('0x28')](handleEntityNotFound(_0x55755f,null))[_0xbd16('0x28')](respondWithResult(_0x55755f,null))['catch'](handleError(_0x55755f,null));};exports[_0xbd16('0x4b')]=function(_0x34a341,_0x57436c){return db[_0xbd16('0x2d')][_0xbd16('0x4b')](_0x34a341[_0xbd16('0x4c')],{})[_0xbd16('0x28')](function(_0x28d2f5){var _0x30b48d=_0x34a341[_0xbd16('0x4d')]['get']({'plain':!![]});if(!_0x30b48d)throw new Error(_0xbd16('0x4e'));if(_0x30b48d[_0xbd16('0x4f')]===_0xbd16('0x4d')){var _0xc35b12=_0x28d2f5[_0xbd16('0x26')]({'plain':!![]});var _0x5e8d71=_0xbd16('0x27');return db[_0xbd16('0x50')][_0xbd16('0x4a')]({'where':{'name':_0x5e8d71,'userProfileId':_0x30b48d[_0xbd16('0x51')]},'raw':!![]})[_0xbd16('0x28')](function(_0x2388b0){if(_0x2388b0&&_0x2388b0[_0xbd16('0x52')]===0x0){return db[_0xbd16('0x53')]['create']({'name':_0xc35b12[_0xbd16('0x3f')],'resourceId':_0xc35b12['id'],'type':_0x2388b0['name'],'sectionId':_0x2388b0['id']},{})[_0xbd16('0x28')](function(){return _0x28d2f5;});}else{return _0x28d2f5;}})[_0xbd16('0x45')](function(_0x34b241){logger[_0xbd16('0x29')](_0xbd16('0x54'),_0x34b241);throw _0x34b241;});}return _0x28d2f5;})[_0xbd16('0x28')](respondWithResult(_0x57436c,0xc9))['catch'](handleError(_0x57436c,null));};exports[_0xbd16('0x24')]=function(_0x522ac4,_0x47de7d){if(_0x522ac4[_0xbd16('0x4c')]['id']){delete _0x522ac4[_0xbd16('0x4c')]['id'];}return db[_0xbd16('0x2d')]['find']({'where':{'id':_0x522ac4[_0xbd16('0x47')]['id']}})[_0xbd16('0x28')](handleEntityNotFound(_0x47de7d,null))['then'](saveUpdates(_0x522ac4[_0xbd16('0x4c')],null))[_0xbd16('0x28')](respondWithResult(_0x47de7d,null))[_0xbd16('0x45')](handleError(_0x47de7d,null));};exports[_0xbd16('0x25')]=function(_0xb6b154,_0x33a9b0){return db[_0xbd16('0x2d')]['find']({'where':{'id':_0xb6b154[_0xbd16('0x47')]['id']}})[_0xbd16('0x28')](handleEntityNotFound(_0x33a9b0,null))['then'](removeEntity(_0x33a9b0,null))[_0xbd16('0x45')](handleError(_0x33a9b0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9673e2e..699a624 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26ee=['../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x535956,_0x411673){var _0x5b21ab=function(_0x428d54){while(--_0x428d54){_0x535956['push'](_0x535956['shift']());}};_0x5b21ab(++_0x411673);}(_0x26ee,0x1f2));var _0xe26e=function(_0x50d4af,_0x5777c0){_0x50d4af=_0x50d4af-0x0;var _0x3ca869=_0x26ee[_0x50d4af];return _0x3ca869;};'use strict';var _=require(_0xe26e('0x0'));var util=require('util');var logger=require(_0xe26e('0x1'))(_0xe26e('0x2'));var moment=require('moment');var BPromise=require(_0xe26e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe26e('0x4'));var rimraf=require(_0xe26e('0x5'));var config=require(_0xe26e('0x6'));var attributes=require(_0xe26e('0x7'));module[_0xe26e('0x8')]=function(_0x46809a,_0x10517f){return _0x46809a[_0xe26e('0x9')](_0xe26e('0xa'),attributes,{'tableName':_0xe26e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fa3=['../../config/environment','exports','define','tools_variables','../../config/logger','moment','path','rimraf'];(function(_0x2a1361,_0x4fcf6e){var _0x1dd1a8=function(_0xdea1d1){while(--_0xdea1d1){_0x2a1361['push'](_0x2a1361['shift']());}};_0x1dd1a8(++_0x4fcf6e);}(_0x7fa3,0x1f4));var _0x37fa=function(_0x45d1b1,_0x328cb0){_0x45d1b1=_0x45d1b1-0x0;var _0x313c30=_0x7fa3[_0x45d1b1];return _0x313c30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x37fa('0x0'))('api');var moment=require(_0x37fa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37fa('0x2'));var rimraf=require(_0x37fa('0x3'));var config=require(_0x37fa('0x4'));var attributes=require('./variable.attributes');module[_0x37fa('0x5')]=function(_0x392714,_0x54a82b){return _0x392714[_0x37fa('0x6')]('Variable',attributes,{'tableName':_0x37fa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 120981c..ac33c1e 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x4a48cf,_0x5f1870){var _0x24a970=function(_0x5a8544){while(--_0x5a8544){_0x4a48cf['push'](_0x4a48cf['shift']());}};_0x24a970(++_0x5f1870);}(_0x55ca,0x126));var _0xa55c=function(_0x22ad0c,_0x56e8a1){_0x22ad0c=_0x22ad0c-0x0;var _0x3787a9=_0x55ca[_0x22ad0c];return _0x3787a9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xa41a,0x6b));var _0xaa41=function(_0x5dd965,_0x1fe007){_0x5dd965=_0x5dd965-0x0;var _0xcf3c5e=_0xa41a[_0x5dd965];return _0xcf3c5e;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 66475c6..9efcd0e 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7db0=['express','Router','../../components/auth/service','./version.controller','get','index','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','pull','/restart','restart','/migrations','migrations','exports'];(function(_0x2242a9,_0x45a4dc){var _0x74615b=function(_0x42696d){while(--_0x42696d){_0x2242a9['push'](_0x2242a9['shift']());}};_0x74615b(++_0x45a4dc);}(_0x7db0,0xa2));var _0x07db=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x7db0[_0x347471];return _0x422b6a;};'use strict';var express=require(_0x07db('0x0'));var router=express[_0x07db('0x1')]();var auth=require(_0x07db('0x2'));var controller=require(_0x07db('0x3'));router[_0x07db('0x4')]('/',controller[_0x07db('0x5')]);router['get']('/fetch',auth['isAuthenticated'](),auth[_0x07db('0x6')](),controller[_0x07db('0x7')]);router[_0x07db('0x4')](_0x07db('0x8'),auth[_0x07db('0x9')](),auth[_0x07db('0x6')](),controller[_0x07db('0xa')]);router[_0x07db('0x4')](_0x07db('0xb'),auth[_0x07db('0x9')](),auth[_0x07db('0x6')](),controller[_0x07db('0xc')]);router['get'](_0x07db('0xd'),auth[_0x07db('0x9')](),controller[_0x07db('0xe')]);router[_0x07db('0x4')](_0x07db('0xf'),controller[_0x07db('0x10')]);module[_0x07db('0x11')]=router; \ No newline at end of file +var _0xcc2c=['exports','express','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','pull','/restart','restart','/migrations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc2c,0x89));var _0xccc2=function(_0x42012c,_0x1d8ce9){_0x42012c=_0x42012c-0x0;var _0x2c250f=_0xcc2c[_0x42012c];return _0x2c250f;};'use strict';var express=require(_0xccc2('0x0'));var router=express['Router']();var auth=require(_0xccc2('0x1'));var controller=require(_0xccc2('0x2'));router[_0xccc2('0x3')]('/',controller[_0xccc2('0x4')]);router['get'](_0xccc2('0x5'),auth['isAuthenticated'](),auth[_0xccc2('0x6')](),controller[_0xccc2('0x7')]);router[_0xccc2('0x3')](_0xccc2('0x8'),auth[_0xccc2('0x9')](),auth[_0xccc2('0x6')](),controller[_0xccc2('0xa')]);router[_0xccc2('0x3')](_0xccc2('0xb'),auth[_0xccc2('0x9')](),auth['canUpdate'](),controller[_0xccc2('0xc')]);router[_0xccc2('0x3')](_0xccc2('0xd'),auth[_0xccc2('0x9')](),controller[_0xccc2('0xe')]);router[_0xccc2('0x3')](_0xccc2('0xf'),controller['migrations']);module[_0xccc2('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 76996ed..9a105cc 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6efd=['Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','compare-versions','exec','../../mysqldb','../../config/pm2','update','simple-git','root','exports','version','query','latest','fetch','tags','status','json','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6efd,0x6f));var _0xd6ef=function(_0x3d4c05,_0x45a4f1){_0x3d4c05=_0x3d4c05-0x0;var _0x18bb9e=_0x6efd[_0x3d4c05];return _0x18bb9e;};'use strict';var Umzug=require('umzug');var path=require(_0xd6ef('0x0'));var fs=require('fs');var _=require(_0xd6ef('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xd6ef('0x2'));var exec=require('child_process')[_0xd6ef('0x3')];var db=require(_0xd6ef('0x4'))['db'];var config=require('../../config/environment');var pm2=require(_0xd6ef('0x5'));var logger=require('../../config/logger')(_0xd6ef('0x6'));var git=require(_0xd6ef('0x7'))(config[_0xd6ef('0x8')]);exports['index']=function(_0x2c571f,_0x4da0fd){var _0x21fd39={'current':module[_0xd6ef('0x9')][_0xd6ef('0xa')],'phonebar':0x2};if(_0x2c571f[_0xd6ef('0xb')]&&_0x2c571f[_0xd6ef('0xb')][_0xd6ef('0xc')]){return git[_0xd6ef('0xd')]()[_0xd6ef('0xe')](function(_0x14e0e9,_0x1a23b2){_0x21fd39[_0xd6ef('0xc')]=(_0x14e0e9?module[_0xd6ef('0x9')]['version']:_0x1a23b2['latest'])||'2.0.0';return _0x4da0fd[_0xd6ef('0xf')](0xc8)[_0xd6ef('0x10')](_0x21fd39);});}else{return _0x4da0fd[_0xd6ef('0xf')](0xc8)['json'](_0x21fd39);}};exports[_0xd6ef('0xd')]=function(_0x365e73,_0xe31f6){return git['fetch'](['origin','master'],function(_0x23f0dc){if(_0x23f0dc){logger[_0xd6ef('0x11')](_0x23f0dc);return _0xe31f6[_0xd6ef('0xf')](0x1f4)[_0xd6ef('0x10')](_0x23f0dc);}logger[_0xd6ef('0x12')](_0xd6ef('0x13'));return _0xe31f6[_0xd6ef('0xf')](0xc8)[_0xd6ef('0x10')]({'output':_0xd6ef('0x14')});});};exports[_0xd6ef('0x15')]=function(_0x4c614c,_0x33cd53){return git[_0xd6ef('0x15')]([_0xd6ef('0x16'),_0xd6ef('0x17')],function(_0x44e05a){if(_0x44e05a){logger[_0xd6ef('0x11')](_0x44e05a);return _0x33cd53[_0xd6ef('0xf')](0x1f4)['json'](_0x44e05a);}logger['info'](_0xd6ef('0x18'));return _0x33cd53['status'](0xc8)[_0xd6ef('0x10')]({'output':_0xd6ef('0x19')});});};exports[_0xd6ef('0x1a')]=function(_0x5d8f2e,_0x1c3058){exec('npm\x20install\x20--production',function(_0x22d826,_0x5d73b9,_0x423cb3){logger['info'](_0x5d73b9);logger['info'](_0x423cb3);if(_0x22d826){logger['error'](_0x22d826);return _0x1c3058[_0xd6ef('0xf')](0x1f4)[_0xd6ef('0x10')](_0x22d826);}return _0x1c3058[_0xd6ef('0xf')](0xc8)['json']({'output':_0x5d73b9});});};exports[_0xd6ef('0x1b')]=function(_0x212980,_0x2d6b64){return pm2[_0xd6ef('0x1b')](_0xd6ef('0x1c'))[_0xd6ef('0x1d')](function(_0x3b2acc){logger['info']('pm2\x20restart\x20motion\x20%s',_0x3b2acc);return _0x2d6b64[_0xd6ef('0xf')](0xc8)[_0xd6ef('0x10')]({'output':_0xd6ef('0x1e')});})['catch'](function(_0x38355d){logger[_0xd6ef('0x11')](_0x38355d);return _0x2d6b64[_0xd6ef('0xf')](0x1f4)[_0xd6ef('0x10')](_0x38355d);});};exports[_0xd6ef('0x1f')]=function(_0x18ad9d,_0x2e5023){var _0x5901f0=fs[_0xd6ef('0x20')](path[_0xd6ef('0x21')](config[_0xd6ef('0x8')],_0xd6ef('0x22'),_0xd6ef('0x1f')));var _0x4b9dc3=[];for(var _0x1117ef=0x0;_0x1117ef<_0x5901f0[_0xd6ef('0x23')];_0x1117ef++){var _0x34c2c3=_0x5901f0[_0x1117ef][_0xd6ef('0x24')](_0xd6ef('0x25'),'');if(compareVersions(module[_0xd6ef('0x9')][_0xd6ef('0xa')],_0x34c2c3)===-0x1){_0x4b9dc3[_0xd6ef('0x26')](_0x34c2c3);}}if(_0x4b9dc3[_0xd6ef('0x23')]){var _0x24e493=_0x4b9dc3['sort'](compareVersions);var _0x19af64=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd6ef('0x27')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xd6ef('0x28')][_0xd6ef('0x29')](),db[_0xd6ef('0x28')][_0xd6ef('0x2a')],function(){throw new Error(_0xd6ef('0x2b'));}],'path':path[_0xd6ef('0x21')](config[_0xd6ef('0x8')],'server','migrations'),'pattern':/\.js$/}});_0x19af64['up']({'migrations':_[_0xd6ef('0x2c')](_0x24e493,function(_0x27720c){return _0x27720c+_0xd6ef('0x25');})})[_0xd6ef('0x1d')](function(){return _0x2e5023[_0xd6ef('0xf')](0xc8)[_0xd6ef('0x10')]({'output':_0xd6ef('0x2d')+module[_0xd6ef('0x9')][_0xd6ef('0xa')]+'\x20to\x20'+_[_0xd6ef('0x2e')](_0x24e493),'migrations':_[_0xd6ef('0x21')](_0x24e493)});})[_0xd6ef('0x2f')](function(_0x485582){if(_0x485582 instanceof db[_0xd6ef('0x28')][_0xd6ef('0x30')]){return _0x2e5023[_0xd6ef('0xf')](0xc8)['json']({'output':_0xd6ef('0x31')});}else{return _0x2e5023[_0xd6ef('0xf')](0x1f4)[_0xd6ef('0x10')](_0x485582);}});}else{return _0x2e5023[_0xd6ef('0xf')](0xc8)[_0xd6ef('0x10')]({'output':_0xd6ef('0x31')});}}; \ No newline at end of file +var _0x487d=['2.0.0','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x3f3d0c,_0x3376c5){var _0x440929=function(_0x2002aa){while(--_0x2002aa){_0x3f3d0c['push'](_0x3f3d0c['shift']());}};_0x440929(++_0x3376c5);}(_0x487d,0x105));var _0xd487=function(_0x1af19c,_0x513aa2){_0x1af19c=_0x1af19c-0x0;var _0x5b94be=_0x487d[_0x1af19c];return _0x5b94be;};'use strict';var Umzug=require(_0xd487('0x0'));var path=require(_0xd487('0x1'));var fs=require('fs');var _=require(_0xd487('0x2'));var pkginfo=require(_0xd487('0x3'))(module,_0xd487('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xd487('0x5'))[_0xd487('0x6')];var db=require(_0xd487('0x7'))['db'];var config=require(_0xd487('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xd487('0x9'))(_0xd487('0xa'));var git=require(_0xd487('0xb'))(config[_0xd487('0xc')]);exports[_0xd487('0xd')]=function(_0x112391,_0x2d2ccd){var _0x563773={'current':module[_0xd487('0xe')][_0xd487('0x4')],'phonebar':0x2};if(_0x112391[_0xd487('0xf')]&&_0x112391[_0xd487('0xf')][_0xd487('0x10')]){return git[_0xd487('0x11')]()[_0xd487('0x12')](function(_0xcf2f9e,_0x59d256){_0x563773[_0xd487('0x10')]=(_0xcf2f9e?module[_0xd487('0xe')][_0xd487('0x4')]:_0x59d256[_0xd487('0x10')])||_0xd487('0x13');return _0x2d2ccd[_0xd487('0x14')](0xc8)[_0xd487('0x15')](_0x563773);});}else{return _0x2d2ccd[_0xd487('0x14')](0xc8)[_0xd487('0x15')](_0x563773);}};exports[_0xd487('0x11')]=function(_0x21ab07,_0x364deb){return git['fetch']([_0xd487('0x16'),_0xd487('0x17')],function(_0x1f8fc9){if(_0x1f8fc9){logger[_0xd487('0x18')](_0x1f8fc9);return _0x364deb['status'](0x1f4)[_0xd487('0x15')](_0x1f8fc9);}logger[_0xd487('0x19')]('git\x20fetch');return _0x364deb[_0xd487('0x14')](0xc8)[_0xd487('0x15')]({'output':_0xd487('0x1a')});});};exports['reset']=function(_0xfa2f69,_0x5a5e1c){return git[_0xd487('0x1b')]([_0xd487('0x1c'),_0xd487('0x1d')],function(_0x6b119e){if(_0x6b119e){logger[_0xd487('0x18')](_0x6b119e);return _0x5a5e1c[_0xd487('0x14')](0x1f4)[_0xd487('0x15')](_0x6b119e);}logger[_0xd487('0x19')](_0xd487('0x1e'));return _0x5a5e1c[_0xd487('0x14')](0xc8)[_0xd487('0x15')]({'output':'git\x20reset\x20--hard'});});};exports[_0xd487('0x1f')]=function(_0x23c9ca,_0x56966b){exec(_0xd487('0x20'),function(_0x290503,_0xf9f429,_0x19790e){logger[_0xd487('0x19')](_0xf9f429);logger[_0xd487('0x19')](_0x19790e);if(_0x290503){logger['error'](_0x290503);return _0x56966b[_0xd487('0x14')](0x1f4)[_0xd487('0x15')](_0x290503);}return _0x56966b['status'](0xc8)[_0xd487('0x15')]({'output':_0xf9f429});});};exports['restart']=function(_0x1bcb47,_0x22b2f3){return pm2[_0xd487('0x21')](_0xd487('0x22'))[_0xd487('0x23')](function(_0x5d613f){logger[_0xd487('0x19')](_0xd487('0x24'),_0x5d613f);return _0x22b2f3[_0xd487('0x14')](0xc8)[_0xd487('0x15')]({'output':_0xd487('0x25')});})['catch'](function(_0x4e2151){logger[_0xd487('0x18')](_0x4e2151);return _0x22b2f3[_0xd487('0x14')](0x1f4)[_0xd487('0x15')](_0x4e2151);});};exports[_0xd487('0x26')]=function(_0x1c7d1f,_0x19e338){var _0x2c1c80=fs[_0xd487('0x27')](path[_0xd487('0x28')](config[_0xd487('0xc')],_0xd487('0x29'),_0xd487('0x26')));var _0x4c2afc=[];for(var _0x1e55ec=0x0;_0x1e55ec<_0x2c1c80[_0xd487('0x2a')];_0x1e55ec++){var _0x1eca59=_0x2c1c80[_0x1e55ec]['replace'](_0xd487('0x2b'),'');if(compareVersions(module[_0xd487('0xe')][_0xd487('0x4')],_0x1eca59)===-0x1){_0x4c2afc[_0xd487('0x2c')](_0x1eca59);}}if(_0x4c2afc[_0xd487('0x2a')]){var _0x262c17=_0x4c2afc['sort'](compareVersions);var _0x4e92f9=new Umzug({'storage':_0xd487('0x2d'),'storageOptions':{'model':db[_0xd487('0x2e')],'modelName':_0xd487('0x2e'),'columnName':_0xd487('0x4')},'migrations':{'params':[db['sequelize'][_0xd487('0x2f')](),db[_0xd487('0x2d')][_0xd487('0x30')],function(){throw new Error(_0xd487('0x31'));}],'path':path[_0xd487('0x28')](config[_0xd487('0xc')],_0xd487('0x29'),_0xd487('0x26')),'pattern':/\.js$/}});_0x4e92f9['up']({'migrations':_[_0xd487('0x32')](_0x262c17,function(_0x12f2a9){return _0x12f2a9+_0xd487('0x2b');})})[_0xd487('0x23')](function(){return _0x19e338[_0xd487('0x14')](0xc8)[_0xd487('0x15')]({'output':_0xd487('0x33')+module[_0xd487('0xe')]['version']+'\x20to\x20'+_[_0xd487('0x34')](_0x262c17),'migrations':_[_0xd487('0x28')](_0x262c17)});})[_0xd487('0x35')](function(_0x2c576b){if(_0x2c576b instanceof db[_0xd487('0x2d')][_0xd487('0x36')]){return _0x19e338['status'](0xc8)[_0xd487('0x15')]({'output':_0xd487('0x37')});}else{return _0x19e338[_0xd487('0x14')](0x1f4)[_0xd487('0x15')](_0x2c576b);}});}else{return _0x19e338[_0xd487('0x14')](0xc8)[_0xd487('0x15')]({'output':_0xd487('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ea5878a..3e95869 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9016=['index','get','/describe','/:id','show','create','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated'];(function(_0x153827,_0x3799fd){var _0x56f49d=function(_0x2f7e79){while(--_0x2f7e79){_0x153827['push'](_0x153827['shift']());}};_0x56f49d(++_0x3799fd);}(_0x9016,0x198));var _0x6901=function(_0x34b98d,_0x4baf88){_0x34b98d=_0x34b98d-0x0;var _0x3370a2=_0x9016[_0x34b98d];return _0x3370a2;};'use strict';var multer=require(_0x6901('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6901('0x1'));var express=require(_0x6901('0x2'));var router=express[_0x6901('0x3')]();var fs_extra=require(_0x6901('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6901('0x5'));var config=require('../../config/environment');var controller=require(_0x6901('0x6'));router['get']('/',auth[_0x6901('0x7')](),controller[_0x6901('0x8')]);router[_0x6901('0x9')](_0x6901('0xa'),auth[_0x6901('0x7')](),controller['describe']);router['get'](_0x6901('0xb'),auth[_0x6901('0x7')](),controller[_0x6901('0xc')]);router['post']('/',auth[_0x6901('0x7')](),controller[_0x6901('0xd')]);router['put']('/:id',auth[_0x6901('0x7')](),controller['update']);router[_0x6901('0xe')](_0x6901('0xb'),auth['isAuthenticated'](),controller[_0x6901('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb904=['index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x45a416,_0x36bed6){var _0x2927d7=function(_0x36d2a4){while(--_0x36d2a4){_0x45a416['push'](_0x45a416['shift']());}};_0x2927d7(++_0x36bed6);}(_0xb904,0x115));var _0x4b90=function(_0x44afc8,_0xe64b75){_0x44afc8=_0x44afc8-0x0;var _0x250da0=_0xb904[_0x44afc8];return _0x250da0;};'use strict';var multer=require(_0x4b90('0x0'));var util=require(_0x4b90('0x1'));var path=require(_0x4b90('0x2'));var timeout=require(_0x4b90('0x3'));var express=require(_0x4b90('0x4'));var router=express[_0x4b90('0x5')]();var fs_extra=require(_0x4b90('0x6'));var auth=require(_0x4b90('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4b90('0x8'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4b90('0x9')]);router['get'](_0x4b90('0xa'),auth[_0x4b90('0xb')](),controller[_0x4b90('0xc')]);router[_0x4b90('0xd')](_0x4b90('0xe'),auth[_0x4b90('0xb')](),controller[_0x4b90('0xf')]);router[_0x4b90('0x10')]('/',auth[_0x4b90('0xb')](),controller[_0x4b90('0x11')]);router[_0x4b90('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4b90('0x13')]);router['delete'](_0x4b90('0xe'),auth[_0x4b90('0xb')](),controller[_0x4b90('0x14')]);module[_0x4b90('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7893a45..627220f 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf5d=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x541756,_0x4fec18){var _0x534bb6=function(_0xb7167a){while(--_0xb7167a){_0x541756['push'](_0x541756['shift']());}};_0x534bb6(++_0x4fec18);}(_0xdf5d,0x126));var _0xddf5=function(_0x22a4aa,_0x3b8e0e){_0x22a4aa=_0x22a4aa-0x0;var _0x1e38c7=_0xdf5d[_0x22a4aa];return _0x1e38c7;};'use strict';var Sequelize=require(_0xddf5('0x0'));module[_0xddf5('0x1')]={'type':{'type':Sequelize[_0xddf5('0x2')]},'uniqueid':{'type':Sequelize[_0xddf5('0x2')]},'calleridnum':{'type':Sequelize[_0xddf5('0x2')]},'calleridname':{'type':Sequelize[_0xddf5('0x2')]},'queue':{'type':Sequelize[_0xddf5('0x2')]},'interface':{'type':Sequelize[_0xddf5('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xddf5('0x3')]},'agentconnectAt':{'type':Sequelize[_0xddf5('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xddf5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xddf5('0x3')]},'agentdumpAt':{'type':Sequelize[_0xddf5('0x3')]},'holdtime':{'type':Sequelize[_0xddf5('0x4')]},'agentcomplete':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xddf5('0x4')]},'agentacw':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xddf5('0x4')]},'reason':{'type':Sequelize[_0xddf5('0x2')]},'lastevent':{'type':Sequelize[_0xddf5('0x2')]},'channel':{'type':Sequelize[_0xddf5('0x2')]},'channelstate':{'type':Sequelize[_0xddf5('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xddf5('0x2')]},'connectedlinename':{'type':Sequelize[_0xddf5('0x2')]},'language':{'type':Sequelize[_0xddf5('0x2')]},'accountcode':{'type':Sequelize[_0xddf5('0x2')]},'context':{'type':Sequelize[_0xddf5('0x2')]},'exten':{'type':Sequelize[_0xddf5('0x2')]},'priority':{'type':Sequelize[_0xddf5('0x2')]},'destchannel':{'type':Sequelize[_0xddf5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xddf5('0x2')]},'destcalleridname':{'type':Sequelize[_0xddf5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xddf5('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xddf5('0x2')]},'destlanguage':{'type':Sequelize[_0xddf5('0x2')]},'destaccountcode':{'type':Sequelize[_0xddf5('0x2')]},'destcontext':{'type':Sequelize[_0xddf5('0x2')]},'destexten':{'type':Sequelize[_0xddf5('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xddf5('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xddf5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xddf5('0x2')]},'transfer':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xddf5('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xddf5('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xddf5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x11f3=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x759377,_0x3a1332){var _0x5e47fd=function(_0x4de11a){while(--_0x4de11a){_0x759377['push'](_0x759377['shift']());}};_0x5e47fd(++_0x3a1332);}(_0x11f3,0x149));var _0x311f=function(_0x5a4f61,_0x5bf2dd){_0x5a4f61=_0x5a4f61-0x0;var _0x22180c=_0x11f3[_0x5a4f61];return _0x22180c;};'use strict';var Sequelize=require(_0x311f('0x0'));module[_0x311f('0x1')]={'type':{'type':Sequelize[_0x311f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x311f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x311f('0x2')]},'interface':{'type':Sequelize[_0x311f('0x2')]},'membername':{'type':Sequelize[_0x311f('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x311f('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x311f('0x3')]},'holdtime':{'type':Sequelize[_0x311f('0x4')]},'agentcomplete':{'type':Sequelize[_0x311f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x311f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x311f('0x4')]},'agentacw':{'type':Sequelize[_0x311f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x311f('0x4')]},'reason':{'type':Sequelize[_0x311f('0x2')]},'lastevent':{'type':Sequelize[_0x311f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x311f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x311f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x311f('0x2')]},'connectedlinename':{'type':Sequelize[_0x311f('0x2')]},'language':{'type':Sequelize[_0x311f('0x2')]},'accountcode':{'type':Sequelize[_0x311f('0x2')]},'context':{'type':Sequelize[_0x311f('0x2')]},'exten':{'type':Sequelize[_0x311f('0x2')]},'priority':{'type':Sequelize[_0x311f('0x2')]},'destchannel':{'type':Sequelize[_0x311f('0x2')]},'destchannelstate':{'type':Sequelize[_0x311f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x311f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x311f('0x2')]},'destcalleridname':{'type':Sequelize[_0x311f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x311f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x311f('0x2')]},'destlanguage':{'type':Sequelize[_0x311f('0x2')]},'destaccountcode':{'type':Sequelize[_0x311f('0x2')]},'destcontext':{'type':Sequelize[_0x311f('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x311f('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x311f('0x2')]},'transfer':{'type':Sequelize[_0x311f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x311f('0x2')],'comment':_0x311f('0x6')},'transferexten':{'type':Sequelize[_0x311f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x311f('0x2')]},'agententerreason':{'type':Sequelize[_0x311f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 36e1151..eff5e06 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 56e5ee8..371bb9e 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc569=['rimraf','../../config/environment','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xc569,0x159));var _0x9c56=function(_0x38de54,_0x2e309b){_0x38de54=_0x38de54-0x0;var _0x3691ed=_0xc569[_0x38de54];return _0x3691ed;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var logger=require(_0x9c56('0x2'))('api');var moment=require(_0x9c56('0x3'));var BPromise=require(_0x9c56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c56('0x5'));var rimraf=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x9c56('0x8')]=function(_0x2e2421,_0xe6ba11){return _0x2e2421[_0x9c56('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x9c56('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9c56('0xb'),_0x9c56('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56a4=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','path'];(function(_0x4fdbf4,_0x15c4e4){var _0x6e6265=function(_0x41a4a8){while(--_0x41a4a8){_0x4fdbf4['push'](_0x4fdbf4['shift']());}};_0x6e6265(++_0x15c4e4);}(_0x56a4,0x11b));var _0x456a=function(_0x144049,_0x4e6ccf){_0x144049=_0x144049-0x0;var _0x517caa=_0x56a4[_0x144049];return _0x517caa;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('VoiceAgentReport',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x456a('0xa'),_0x456a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 9c12215..928a26e 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2aa6=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent'];(function(_0x362fc4,_0xa8d546){var _0x240f90=function(_0x3d2bbd){while(--_0x3d2bbd){_0x362fc4['push'](_0x362fc4['shift']());}};_0x240f90(++_0xa8d546);}(_0x2aa6,0x1cc));var _0x62aa=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x2aa6[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x62aa('0x0'));var util=require(_0x62aa('0x1'));var moment=require(_0x62aa('0x2'));var BPromise=require(_0x62aa('0x3'));var rs=require(_0x62aa('0x4'));var fs=require('fs');var Redis=require(_0x62aa('0x5'));var db=require(_0x62aa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x62aa('0x7'))('rpc');var config=require(_0x62aa('0x8'));var jayson=require(_0x62aa('0x9'));var client=jayson[_0x62aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0f01,_0x3a7d6f,_0x296729){return new BPromise(function(_0x51c8e1,_0x28d531){return client[_0x62aa('0xb')](_0x1f0f01,_0x296729)[_0x62aa('0xc')](function(_0x39ee11){logger[_0x62aa('0xd')](_0x62aa('0xe'),_0x3a7d6f,_0x62aa('0xf'));logger[_0x62aa('0x10')](_0x62aa('0x11'),_0x3a7d6f,_0x62aa('0xf'),JSON[_0x62aa('0x12')](_0x39ee11));if(_0x39ee11[_0x62aa('0x13')]){if(_0x39ee11[_0x62aa('0x13')][_0x62aa('0x14')]===0x1f4){logger[_0x62aa('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x3a7d6f,_0x39ee11[_0x62aa('0x13')]['message']);return _0x28d531(_0x39ee11[_0x62aa('0x13')][_0x62aa('0x15')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x3a7d6f,_0x39ee11[_0x62aa('0x13')][_0x62aa('0x15')]);return _0x51c8e1(_0x39ee11['error']['message']);}else{logger[_0x62aa('0xd')](_0x62aa('0xe'),_0x3a7d6f,'request\x20sent');_0x51c8e1(_0x39ee11['result'][_0x62aa('0x15')]);}})[_0x62aa('0x16')](function(_0x245026){logger[_0x62aa('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x3a7d6f,_0x245026);_0x28d531(_0x245026);});});}exports[_0x62aa('0x17')]=function(_0x150953){var _0xb5ebd5=this;return new Promise(function(_0x193f34,_0x2d573b){return db[_0x62aa('0x18')][_0x62aa('0x19')](_0x150953[_0x62aa('0x1a')],{'raw':_0x150953['options']?_0x150953[_0x62aa('0x1b')][_0x62aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x312ddf){logger[_0x62aa('0xd')](_0x62aa('0x17'),_0x150953);logger['debug'](_0x62aa('0x17'),_0x150953,JSON['stringify'](_0x312ddf));_0x193f34(_0x312ddf);})[_0x62aa('0x16')](function(_0x47681c){logger[_0x62aa('0x13')](_0x62aa('0x17'),_0x47681c[_0x62aa('0x15')],_0x150953);_0x2d573b(_0xb5ebd5['error'](0x1f4,_0x47681c['message']));});});};exports[_0x62aa('0x1d')]=function(_0x2dba14){var _0x2eb473=this;return new Promise(function(_0x2cba1a,_0x5da43d){return db['VoiceAgentReport'][_0x62aa('0x1e')](_0x2dba14[_0x62aa('0x1a')],{'raw':_0x2dba14[_0x62aa('0x1b')]?_0x2dba14[_0x62aa('0x1b')][_0x62aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dba14[_0x62aa('0x1b')]?_0x2dba14[_0x62aa('0x1b')][_0x62aa('0x1f')]||null:null,'attributes':_0x2dba14[_0x62aa('0x1b')]?_0x2dba14[_0x62aa('0x1b')][_0x62aa('0x20')]||null:null,'limit':_0x2dba14[_0x62aa('0x1b')]?_0x2dba14[_0x62aa('0x1b')][_0x62aa('0x21')]||null:null})['then'](function(_0x40e1f5){logger[_0x62aa('0xd')]('UpdateVoiceAgentReport',_0x2dba14);logger[_0x62aa('0x10')](_0x62aa('0x1d'),_0x2dba14,JSON[_0x62aa('0x12')](_0x40e1f5));_0x2cba1a(_0x40e1f5);})[_0x62aa('0x16')](function(_0x42f9e5){logger[_0x62aa('0x13')](_0x62aa('0x1d'),_0x42f9e5[_0x62aa('0x15')],_0x2dba14);_0x5da43d(_0x2eb473[_0x62aa('0x13')](0x1f4,_0x42f9e5[_0x62aa('0x15')]));});});}; \ No newline at end of file +var _0x2570=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceAgentReport','create','options','raw','VoiceAgentReport','update','body','where','attributes','UpdateVoiceAgentReport','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x12453c,_0x5a5f56){var _0x297460=function(_0x59c3d7){while(--_0x59c3d7){_0x12453c['push'](_0x12453c['shift']());}};_0x297460(++_0x5a5f56);}(_0x2570,0x122));var _0x0257=function(_0x245c4f,_0x34b70f){_0x245c4f=_0x245c4f-0x0;var _0x3157a1=_0x2570[_0x245c4f];return _0x3157a1;};'use strict';var _=require(_0x0257('0x0'));var util=require('util');var moment=require(_0x0257('0x1'));var BPromise=require(_0x0257('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0257('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0257('0x4'))('rpc');var config=require(_0x0257('0x5'));var jayson=require(_0x0257('0x6'));var client=jayson[_0x0257('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x373153,_0x5ab4a6,_0x4c8883){return new BPromise(function(_0x9f9ccc,_0x4db9c7){return client[_0x0257('0x8')](_0x373153,_0x4c8883)[_0x0257('0x9')](function(_0x57c6e5){logger['info'](_0x0257('0xa'),_0x5ab4a6,_0x0257('0xb'));logger[_0x0257('0xc')](_0x0257('0xd'),_0x5ab4a6,_0x0257('0xb'),JSON[_0x0257('0xe')](_0x57c6e5));if(_0x57c6e5[_0x0257('0xf')]){if(_0x57c6e5[_0x0257('0xf')]['code']===0x1f4){logger[_0x0257('0xf')](_0x0257('0xa'),_0x5ab4a6,_0x57c6e5[_0x0257('0xf')][_0x0257('0x10')]);return _0x4db9c7(_0x57c6e5[_0x0257('0xf')][_0x0257('0x10')]);}logger[_0x0257('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ab4a6,_0x57c6e5[_0x0257('0xf')][_0x0257('0x10')]);return _0x9f9ccc(_0x57c6e5[_0x0257('0xf')][_0x0257('0x10')]);}else{logger[_0x0257('0x11')](_0x0257('0xa'),_0x5ab4a6,_0x0257('0xb'));_0x9f9ccc(_0x57c6e5[_0x0257('0x12')][_0x0257('0x10')]);}})[_0x0257('0x13')](function(_0x45444a){logger[_0x0257('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ab4a6,_0x45444a);_0x4db9c7(_0x45444a);});});}exports[_0x0257('0x14')]=function(_0x67084c){var _0x3c52bb=this;return new Promise(function(_0xc760b5,_0x2eb3e0){return db['VoiceAgentReport'][_0x0257('0x15')](_0x67084c['body'],{'raw':_0x67084c[_0x0257('0x16')]?_0x67084c['options'][_0x0257('0x17')]===undefined?!![]:![]:!![]})[_0x0257('0x9')](function(_0x5041c6){logger['info'](_0x0257('0x14'),_0x67084c);logger[_0x0257('0xc')](_0x0257('0x14'),_0x67084c,JSON['stringify'](_0x5041c6));_0xc760b5(_0x5041c6);})['catch'](function(_0x4e8930){logger[_0x0257('0xf')](_0x0257('0x14'),_0x4e8930[_0x0257('0x10')],_0x67084c);_0x2eb3e0(_0x3c52bb[_0x0257('0xf')](0x1f4,_0x4e8930[_0x0257('0x10')]));});});};exports['UpdateVoiceAgentReport']=function(_0x376c9e){var _0x197abe=this;return new Promise(function(_0xe7dce6,_0x5798f4){return db[_0x0257('0x18')][_0x0257('0x19')](_0x376c9e[_0x0257('0x1a')],{'raw':_0x376c9e[_0x0257('0x16')]?_0x376c9e['options'][_0x0257('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x376c9e[_0x0257('0x16')]?_0x376c9e[_0x0257('0x16')][_0x0257('0x1b')]||null:null,'attributes':_0x376c9e[_0x0257('0x16')]?_0x376c9e['options'][_0x0257('0x1c')]||null:null,'limit':_0x376c9e[_0x0257('0x16')]?_0x376c9e[_0x0257('0x16')]['limit']||null:null})[_0x0257('0x9')](function(_0x3f7af2){logger[_0x0257('0x11')](_0x0257('0x1d'),_0x376c9e);logger['debug'](_0x0257('0x1d'),_0x376c9e,JSON[_0x0257('0xe')](_0x3f7af2));_0xe7dce6(_0x3f7af2);})['catch'](function(_0x206c8e){logger['error'](_0x0257('0x1d'),_0x206c8e[_0x0257('0x10')],_0x376c9e);_0x5798f4(_0x197abe[_0x0257('0xf')](0x1f4,_0x206c8e[_0x0257('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 71baddc..1a3300f 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6334=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xc0d16e,_0x243599){var _0xe03769=function(_0x1408b8){while(--_0x1408b8){_0xc0d16e['push'](_0xc0d16e['shift']());}};_0xe03769(++_0x243599);}(_0x6334,0x119));var _0x4633=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x6334[_0x3b3210];return _0x5b5484;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),auth['isAuthenticated'](),controller[_0x4633('0xe')]);router[_0x4633('0xa')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0xf')]);router[_0x4633('0x10')]('/',auth['isAuthenticated'](),controller[_0x4633('0x11')]);router[_0x4633('0x12')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0x13')]);router[_0x4633('0x14')](_0x4633('0x15'),auth['isAuthenticated'](),controller[_0x4633('0x16')]);module[_0x4633('0x17')]=router; \ No newline at end of file +var _0xc978=['/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xa48f43,_0x491c11){var _0x58bd51=function(_0x5b8d93){while(--_0x5b8d93){_0xa48f43['push'](_0xa48f43['shift']());}};_0x58bd51(++_0x491c11);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),auth[_0x8c97('0xb')](),controller[_0x8c97('0xe')]);router[_0x8c97('0xa')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router['post']('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0x11')]);router[_0x8c97('0x12')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x13')]);router[_0x8c97('0x14')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller['destroy']);module[_0x8c97('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 45c6141..415a64a 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90d2=['STRING','TEXT','DATE','INTEGER','sequelize','exports','inbound','outbound','outbound-fax','dialer'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x90d2,0x86));var _0x290d=function(_0x296453,_0x219c2a){_0x296453=_0x296453-0x0;var _0x37b596=_0x90d2[_0x296453];return _0x37b596;};'use strict';var Sequelize=require(_0x290d('0x0'));module[_0x290d('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x290d('0x2'),'internal',_0x290d('0x3'),'inbound-fax',_0x290d('0x4'),_0x290d('0x5'))},'tag':{'type':Sequelize[_0x290d('0x6')]},'accountcode':{'type':Sequelize[_0x290d('0x6')]},'source':{'type':Sequelize[_0x290d('0x6')]},'destination':{'type':Sequelize[_0x290d('0x6')]},'destinationcontext':{'type':Sequelize[_0x290d('0x6')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x290d('0x6')]},'destinationchannel':{'type':Sequelize[_0x290d('0x6')]},'lastapplication':{'type':Sequelize[_0x290d('0x6')]},'lastdata':{'type':Sequelize[_0x290d('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x290d('0x8')]},'endtime':{'type':Sequelize[_0x290d('0x8')]},'duration':{'type':Sequelize[_0x290d('0x9')]},'billableseconds':{'type':Sequelize[_0x290d('0x9')]},'mohtime':{'type':Sequelize[_0x290d('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x290d('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x290d('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x290d('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x290d('0x6')]},'note':{'type':Sequelize[_0x290d('0x6')]},'prefix':{'type':Sequelize[_0x290d('0x6')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x290d('0x6')]}}; \ No newline at end of file +var _0xd56e=['DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer','TEXT'];(function(_0x43b9fb,_0x264551){var _0x31681=function(_0x19cd09){while(--_0x19cd09){_0x43b9fb['push'](_0x43b9fb['shift']());}};_0x31681(++_0x264551);}(_0xd56e,0xa7));var _0xed56=function(_0x34044d,_0x10b169){_0x34044d=_0x34044d-0x0;var _0x6e9d0e=_0xd56e[_0x34044d];return _0x6e9d0e;};'use strict';var Sequelize=require('sequelize');module[_0xed56('0x0')]={'uniqueid':{'type':Sequelize[_0xed56('0x1')]},'type':{'type':Sequelize[_0xed56('0x2')](_0xed56('0x3'),_0xed56('0x4'),_0xed56('0x5'),_0xed56('0x6'),'outbound-fax',_0xed56('0x7'))},'tag':{'type':Sequelize[_0xed56('0x1')]},'accountcode':{'type':Sequelize[_0xed56('0x1')]},'source':{'type':Sequelize[_0xed56('0x1')]},'destination':{'type':Sequelize[_0xed56('0x1')]},'destinationcontext':{'type':Sequelize[_0xed56('0x1')]},'callerid':{'type':Sequelize[_0xed56('0x1')]},'channel':{'type':Sequelize[_0xed56('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xed56('0x1')]},'lastdata':{'type':Sequelize[_0xed56('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xed56('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xed56('0xa')]},'mohtime':{'type':Sequelize[_0xed56('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xed56('0x1')]},'amaflags':{'type':Sequelize[_0xed56('0x1')]},'userfield':{'type':Sequelize[_0xed56('0x1')]},'userDisposition':{'type':Sequelize[_0xed56('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xed56('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xed56('0x1')]},'note':{'type':Sequelize[_0xed56('0x1')]},'prefix':{'type':Sequelize[_0xed56('0x1')]},'routeid':{'type':Sequelize[_0xed56('0xa')]},'sipcallid':{'type':Sequelize[_0xed56('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b2cf82b..c90447f 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x9cbe7a,_0x21a623){var _0x41b674=function(_0x5855aa){while(--_0x5855aa){_0x9cbe7a['push'](_0x9cbe7a['shift']());}};_0x41b674(++_0x21a623);}(_0x0b0e,0x187));var _0xe0b0=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0x0b0e[_0xfb65aa];return _0x2aee31;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x5f2f,0x73));var _0xf5f2=function(_0x15c618,_0x5c5af3){_0x15c618=_0x15c618-0x0;var _0x25f38d=_0x5f2f[_0x15c618];return _0x25f38d;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 56187a7..74aadd9 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f1e=['report_call','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x5b0034,_0x45ba7f){var _0x29b7e5=function(_0x2403a6){while(--_0x2403a6){_0x5b0034['push'](_0x5b0034['shift']());}};_0x29b7e5(++_0x45ba7f);}(_0x0f1e,0x18e));var _0xe0f1=function(_0x53a8d2,_0x44c239){_0x53a8d2=_0x53a8d2-0x0;var _0x3054e4=_0x0f1e[_0x53a8d2];return _0x3054e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0f1('0x0'))('api');var moment=require(_0xe0f1('0x1'));var BPromise=require(_0xe0f1('0x2'));var rp=require(_0xe0f1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0f1('0x4'));var config=require(_0xe0f1('0x5'));var attributes=require(_0xe0f1('0x6'));module[_0xe0f1('0x7')]=function(_0x4a3fb7,_0x58088e){return _0x4a3fb7[_0xe0f1('0x8')]('VoiceCallReport',attributes,{'tableName':_0xe0f1('0x9'),'paranoid':![],'indexes':[{'fields':[_0xe0f1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9011=['rimraf','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x50b16c,_0x30ae9a){var _0x18f7b4=function(_0x317812){while(--_0x317812){_0x50b16c['push'](_0x50b16c['shift']());}};_0x18f7b4(++_0x30ae9a);}(_0x9011,0x1f4));var _0x1901=function(_0x2e67d1,_0x3821ec){_0x2e67d1=_0x2e67d1-0x0;var _0x3411f0=_0x9011[_0x2e67d1];return _0x3411f0;};'use strict';var _=require('lodash');var util=require(_0x1901('0x0'));var logger=require(_0x1901('0x1'))(_0x1901('0x2'));var moment=require(_0x1901('0x3'));var BPromise=require(_0x1901('0x4'));var rp=require(_0x1901('0x5'));var fs=require('fs');var path=require(_0x1901('0x6'));var rimraf=require(_0x1901('0x7'));var config=require('../../config/environment');var attributes=require(_0x1901('0x8'));module[_0x1901('0x9')]=function(_0x1f62b0,_0x2113e0){return _0x1f62b0['define'](_0x1901('0xa'),attributes,{'tableName':_0x1901('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1901('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1c9da34..f251c29 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dad=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','map','include','model','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','body'];(function(_0x37bcf9,_0x4d1a77){var _0x5049d3=function(_0x1a14c7){while(--_0x1a14c7){_0x37bcf9['push'](_0x37bcf9['shift']());}};_0x5049d3(++_0x4d1a77);}(_0x3dad,0x72));var _0xd3da=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3dad[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xd3da('0x0'));var moment=require(_0xd3da('0x1'));var BPromise=require(_0xd3da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3da('0x3'))['db'];var utils=require(_0xd3da('0x4'));var logger=require(_0xd3da('0x5'))('rpc');var config=require(_0xd3da('0x6'));var jayson=require(_0xd3da('0x7'));var client=jayson[_0xd3da('0x8')][_0xd3da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46146d,_0x29d3ed,_0x13e019){return new BPromise(function(_0xf1998a,_0x53bf14){return client[_0xd3da('0xa')](_0x46146d,_0x13e019)[_0xd3da('0xb')](function(_0x549bef){logger[_0xd3da('0xc')](_0xd3da('0xd'),_0x29d3ed,_0xd3da('0xe'));logger[_0xd3da('0xf')](_0xd3da('0x10'),_0x29d3ed,_0xd3da('0xe'),JSON[_0xd3da('0x11')](_0x549bef));if(_0x549bef[_0xd3da('0x12')]){if(_0x549bef[_0xd3da('0x12')]['code']===0x1f4){logger[_0xd3da('0x12')](_0xd3da('0xd'),_0x29d3ed,_0x549bef[_0xd3da('0x12')][_0xd3da('0x13')]);return _0x53bf14(_0x549bef[_0xd3da('0x12')][_0xd3da('0x13')]);}logger[_0xd3da('0x12')](_0xd3da('0xd'),_0x29d3ed,_0x549bef[_0xd3da('0x12')]['message']);return _0xf1998a(_0x549bef[_0xd3da('0x12')][_0xd3da('0x13')]);}else{logger[_0xd3da('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x29d3ed,_0xd3da('0xe'));_0xf1998a(_0x549bef[_0xd3da('0x14')][_0xd3da('0x13')]);}})[_0xd3da('0x15')](function(_0x44062d){logger[_0xd3da('0x12')](_0xd3da('0xd'),_0x29d3ed,_0x44062d);_0x53bf14(_0x44062d);});});}exports[_0xd3da('0x16')]=function(_0x53e431){var _0x549151=this;return new Promise(function(_0x3ef445,_0x10ff9a){return db[_0xd3da('0x17')][_0xd3da('0x18')]({'raw':_0x53e431[_0xd3da('0x19')]?_0x53e431[_0xd3da('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x53e431[_0xd3da('0x19')]?_0x53e431[_0xd3da('0x19')][_0xd3da('0x1a')]||null:null,'attributes':_0x53e431['options']?_0x53e431[_0xd3da('0x19')][_0xd3da('0x1b')]||null:null,'limit':_0x53e431[_0xd3da('0x19')]?_0x53e431[_0xd3da('0x19')][_0xd3da('0x1c')]||null:null,'include':_0x53e431[_0xd3da('0x19')]?_0x53e431[_0xd3da('0x19')]['include']?_[_0xd3da('0x1d')](_0x53e431[_0xd3da('0x19')][_0xd3da('0x1e')],function(_0x40a063){return{'model':db[_0x40a063[_0xd3da('0x1f')]],'as':_0x40a063['as'],'attributes':_0x40a063['attributes'],'include':_0x40a063['include']?_[_0xd3da('0x1d')](_0x40a063[_0xd3da('0x1e')],function(_0x1c31fe){return{'model':db[_0x1c31fe[_0xd3da('0x1f')]],'as':_0x1c31fe['as'],'attributes':_0x1c31fe[_0xd3da('0x1b')],'include':_0x1c31fe['include']?_['map'](_0x1c31fe[_0xd3da('0x1e')],function(_0x7f146a){return{'model':db[_0x7f146a[_0xd3da('0x1f')]],'as':_0x7f146a['as'],'attributes':_0x7f146a[_0xd3da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3da('0xb')](function(_0x46ae7e){logger['info'](_0xd3da('0x16'),_0x53e431);logger[_0xd3da('0xf')](_0xd3da('0x16'),_0x53e431,JSON['stringify'](_0x46ae7e));_0x3ef445(_0x46ae7e);})[_0xd3da('0x15')](function(_0x4cef52){logger[_0xd3da('0x12')](_0xd3da('0x16'),_0x4cef52[_0xd3da('0x13')],_0x53e431);_0x10ff9a(_0x549151[_0xd3da('0x12')](0x1f4,_0x4cef52[_0xd3da('0x13')]));});});};exports[_0xd3da('0x20')]=function(_0x5896fa){var _0x5a2105=this;return new Promise(function(_0xe8443d,_0x3f31fa){return db[_0xd3da('0x17')][_0xd3da('0x21')](_0x5896fa['body'],{'raw':_0x5896fa['options']?_0x5896fa[_0xd3da('0x19')][_0xd3da('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x1ecaba){logger[_0xd3da('0xc')](_0xd3da('0x20'),_0x5896fa);logger['debug'](_0xd3da('0x20'),_0x5896fa,JSON[_0xd3da('0x11')](_0x1ecaba));_0xe8443d(_0x1ecaba);})[_0xd3da('0x15')](function(_0x5f4841){logger[_0xd3da('0x12')](_0xd3da('0x20'),_0x5f4841[_0xd3da('0x13')],_0x5896fa);_0x3f31fa(_0x5a2105[_0xd3da('0x12')](0x1f4,_0x5f4841[_0xd3da('0x13')]));});});};exports[_0xd3da('0x23')]=function(_0x363c7a){var _0xd543e8=this;return new Promise(function(_0x3c0c3a,_0x5dc4cc){return db[_0xd3da('0x17')][_0xd3da('0x24')](_0x363c7a[_0xd3da('0x25')],{'raw':_0x363c7a[_0xd3da('0x19')]?_0x363c7a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x363c7a[_0xd3da('0x19')]?_0x363c7a[_0xd3da('0x19')][_0xd3da('0x1a')]||null:null,'attributes':_0x363c7a[_0xd3da('0x19')]?_0x363c7a[_0xd3da('0x19')]['attributes']||null:null,'limit':_0x363c7a[_0xd3da('0x19')]?_0x363c7a[_0xd3da('0x19')]['limit']||null:null})['then'](function(_0x553bbb){logger[_0xd3da('0xc')](_0xd3da('0x23'),_0x363c7a);logger[_0xd3da('0xf')]('UpdateVoiceCallReport',_0x363c7a,JSON[_0xd3da('0x11')](_0x553bbb));_0x3c0c3a(_0x553bbb);})[_0xd3da('0x15')](function(_0x15b4f6){logger[_0xd3da('0x12')](_0xd3da('0x23'),_0x15b4f6[_0xd3da('0x13')],_0x363c7a);_0x5dc4cc(_0xd543e8[_0xd3da('0x12')](0x1f4,_0x15b4f6[_0xd3da('0x13')]));});});}; \ No newline at end of file +var _0x4380=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','limit','map','include','model','attributes','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4380,0x87));var _0x0438=function(_0x5abe4c,_0x2c6dc4){_0x5abe4c=_0x5abe4c-0x0;var _0x183656=_0x4380[_0x5abe4c];return _0x183656;};'use strict';var _=require(_0x0438('0x0'));var util=require('util');var moment=require(_0x0438('0x1'));var BPromise=require(_0x0438('0x2'));var rs=require(_0x0438('0x3'));var fs=require('fs');var Redis=require(_0x0438('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0438('0x5'));var logger=require(_0x0438('0x6'))(_0x0438('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0438('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x74080,_0x312eff,_0x4fec6a){return new BPromise(function(_0x3a8218,_0xfcc638){return client['request'](_0x74080,_0x4fec6a)[_0x0438('0x9')](function(_0x2ad7d4){logger[_0x0438('0xa')](_0x0438('0xb'),_0x312eff,_0x0438('0xc'));logger[_0x0438('0xd')](_0x0438('0xe'),_0x312eff,_0x0438('0xc'),JSON[_0x0438('0xf')](_0x2ad7d4));if(_0x2ad7d4[_0x0438('0x10')]){if(_0x2ad7d4[_0x0438('0x10')][_0x0438('0x11')]===0x1f4){logger[_0x0438('0x10')](_0x0438('0xb'),_0x312eff,_0x2ad7d4['error'][_0x0438('0x12')]);return _0xfcc638(_0x2ad7d4[_0x0438('0x10')][_0x0438('0x12')]);}logger[_0x0438('0x10')](_0x0438('0xb'),_0x312eff,_0x2ad7d4[_0x0438('0x10')][_0x0438('0x12')]);return _0x3a8218(_0x2ad7d4[_0x0438('0x10')][_0x0438('0x12')]);}else{logger[_0x0438('0xa')](_0x0438('0xb'),_0x312eff,'request\x20sent');_0x3a8218(_0x2ad7d4[_0x0438('0x13')][_0x0438('0x12')]);}})['catch'](function(_0x3fe2a6){logger[_0x0438('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x312eff,_0x3fe2a6);_0xfcc638(_0x3fe2a6);});});}exports[_0x0438('0x14')]=function(_0x7c1b3b){var _0xf6163f=this;return new Promise(function(_0x191221,_0x707c62){return db[_0x0438('0x15')][_0x0438('0x16')]({'raw':_0x7c1b3b['options']?_0x7c1b3b['options'][_0x0438('0x17')]===undefined?!![]:![]:!![],'where':_0x7c1b3b[_0x0438('0x18')]?_0x7c1b3b[_0x0438('0x18')][_0x0438('0x19')]||null:null,'attributes':_0x7c1b3b['options']?_0x7c1b3b[_0x0438('0x18')]['attributes']||null:null,'limit':_0x7c1b3b['options']?_0x7c1b3b[_0x0438('0x18')][_0x0438('0x1a')]||null:null,'include':_0x7c1b3b[_0x0438('0x18')]?_0x7c1b3b[_0x0438('0x18')]['include']?_[_0x0438('0x1b')](_0x7c1b3b['options'][_0x0438('0x1c')],function(_0x2f888e){return{'model':db[_0x2f888e[_0x0438('0x1d')]],'as':_0x2f888e['as'],'attributes':_0x2f888e[_0x0438('0x1e')],'include':_0x2f888e[_0x0438('0x1c')]?_[_0x0438('0x1b')](_0x2f888e[_0x0438('0x1c')],function(_0x373cd6){return{'model':db[_0x373cd6[_0x0438('0x1d')]],'as':_0x373cd6['as'],'attributes':_0x373cd6[_0x0438('0x1e')],'include':_0x373cd6['include']?_[_0x0438('0x1b')](_0x373cd6['include'],function(_0x3d179e){return{'model':db[_0x3d179e['model']],'as':_0x3d179e['as'],'attributes':_0x3d179e[_0x0438('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0438('0x9')](function(_0x3f0538){logger[_0x0438('0xa')](_0x0438('0x14'),_0x7c1b3b);logger[_0x0438('0xd')]('GetVoiceCallReport',_0x7c1b3b,JSON[_0x0438('0xf')](_0x3f0538));_0x191221(_0x3f0538);})[_0x0438('0x1f')](function(_0x42f26e){logger[_0x0438('0x10')](_0x0438('0x14'),_0x42f26e[_0x0438('0x12')],_0x7c1b3b);_0x707c62(_0xf6163f[_0x0438('0x10')](0x1f4,_0x42f26e[_0x0438('0x12')]));});});};exports[_0x0438('0x20')]=function(_0x7754fe){var _0x1e15cd=this;return new Promise(function(_0xfa7220,_0x1628e6){return db[_0x0438('0x15')][_0x0438('0x21')](_0x7754fe[_0x0438('0x22')],{'raw':_0x7754fe['options']?_0x7754fe[_0x0438('0x18')][_0x0438('0x17')]===undefined?!![]:![]:!![]})[_0x0438('0x9')](function(_0x1509c8){logger[_0x0438('0xa')]('CreateVoiceCallReport',_0x7754fe);logger[_0x0438('0xd')](_0x0438('0x20'),_0x7754fe,JSON[_0x0438('0xf')](_0x1509c8));_0xfa7220(_0x1509c8);})[_0x0438('0x1f')](function(_0xaa7b6e){logger[_0x0438('0x10')](_0x0438('0x20'),_0xaa7b6e[_0x0438('0x12')],_0x7754fe);_0x1628e6(_0x1e15cd[_0x0438('0x10')](0x1f4,_0xaa7b6e[_0x0438('0x12')]));});});};exports[_0x0438('0x23')]=function(_0x4f6fe9){var _0x57f34e=this;return new Promise(function(_0x266c2b,_0x44dc28){return db[_0x0438('0x15')][_0x0438('0x24')](_0x4f6fe9[_0x0438('0x22')],{'raw':_0x4f6fe9[_0x0438('0x18')]?_0x4f6fe9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6fe9['options']?_0x4f6fe9[_0x0438('0x18')]['where']||null:null,'attributes':_0x4f6fe9['options']?_0x4f6fe9[_0x0438('0x18')]['attributes']||null:null,'limit':_0x4f6fe9[_0x0438('0x18')]?_0x4f6fe9[_0x0438('0x18')][_0x0438('0x1a')]||null:null})[_0x0438('0x9')](function(_0x4409a6){logger[_0x0438('0xa')](_0x0438('0x23'),_0x4f6fe9);logger[_0x0438('0xd')]('UpdateVoiceCallReport',_0x4f6fe9,JSON[_0x0438('0xf')](_0x4409a6));_0x266c2b(_0x4409a6);})[_0x0438('0x1f')](function(_0x33aeeb){logger[_0x0438('0x10')](_0x0438('0x23'),_0x33aeeb[_0x0438('0x12')],_0x4f6fe9);_0x44dc28(_0x57f34e[_0x0438('0x10')](0x1f4,_0x33aeeb[_0x0438('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 794ed83..255e989 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd74=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd74,0xd7));var _0x4cd7=function(_0x43d710,_0x3bcb0f){_0x43d710=_0x43d710-0x0;var _0x55d60c=_0xcd74[_0x43d710];return _0x55d60c;};'use strict';var multer=require(_0x4cd7('0x0'));var util=require(_0x4cd7('0x1'));var path=require(_0x4cd7('0x2'));var timeout=require(_0x4cd7('0x3'));var express=require('express');var router=express[_0x4cd7('0x4')]();var fs_extra=require(_0x4cd7('0x5'));var auth=require(_0x4cd7('0x6'));var interaction=require(_0x4cd7('0x7'));var config=require(_0x4cd7('0x8'));var controller=require(_0x4cd7('0x9'));router[_0x4cd7('0xa')]('/',auth[_0x4cd7('0xb')](),controller[_0x4cd7('0xc')]);router[_0x4cd7('0xa')]('/:id',auth[_0x4cd7('0xb')](),controller[_0x4cd7('0xd')]);router[_0x4cd7('0xe')]('/',auth[_0x4cd7('0xb')](),controller[_0x4cd7('0xf')]);router[_0x4cd7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4cd7('0x11')]);router['delete']('/:id',auth[_0x4cd7('0xb')](),controller[_0x4cd7('0x12')]);module[_0x4cd7('0x13')]=router; \ No newline at end of file +var _0x1b06=['index','get','/:id','show','post','create','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated'];(function(_0x4838a7,_0x369cfe){var _0x4988c6=function(_0x1551c4){while(--_0x1551c4){_0x4838a7['push'](_0x4838a7['shift']());}};_0x4988c6(++_0x369cfe);}(_0x1b06,0xbd));var _0x61b0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1b06[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61b0('0x0'));var timeout=require(_0x61b0('0x1'));var express=require(_0x61b0('0x2'));var router=express[_0x61b0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x61b0('0x4'));var interaction=require(_0x61b0('0x5'));var config=require(_0x61b0('0x6'));var controller=require(_0x61b0('0x7'));router['get']('/',auth[_0x61b0('0x8')](),controller[_0x61b0('0x9')]);router[_0x61b0('0xa')](_0x61b0('0xb'),auth['isAuthenticated'](),controller[_0x61b0('0xc')]);router[_0x61b0('0xd')]('/',auth[_0x61b0('0x8')](),controller[_0x61b0('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x61b0('0xf')]);router['delete'](_0x61b0('0xb'),auth[_0x61b0('0x8')](),controller[_0x61b0('0x10')]);module[_0x61b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a97d3d9..4ac9648 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebb7=['split','BOOLEAN','exports','STRING','name','setDataValue','join','getDataValue','options'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0xebb7,0x92));var _0x7ebb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xebb7[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x7ebb('0x0')]={'name':{'type':Sequelize[_0x7ebb('0x1')]},'prefix':{'type':Sequelize[_0x7ebb('0x1')],'unique':_0x7ebb('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x7ebb('0x1')],'set':function(_0x15ed4e){this[_0x7ebb('0x3')]('options',_0x15ed4e?_0x15ed4e[_0x7ebb('0x4')](''):[]);},'get':function(){return this[_0x7ebb('0x5')](_0x7ebb('0x6'))?this[_0x7ebb('0x5')](_0x7ebb('0x6'))[_0x7ebb('0x7')](''):[];}},'auth':{'type':Sequelize[_0x7ebb('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x7ebb('0x1')]},'record':{'type':Sequelize[_0x7ebb('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7ebb('0x1')]},'description':{'type':Sequelize[_0x7ebb('0x1')]}}; \ No newline at end of file +var _0x65f9=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x65f9,0xb0));var _0x965f=function(_0x218dbf,_0x55d52d){_0x218dbf=_0x218dbf-0x0;var _0x3bd622=_0x65f9[_0x218dbf];return _0x3bd622;};'use strict';var Sequelize=require(_0x965f('0x0'));module[_0x965f('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x965f('0x2')],'unique':_0x965f('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x965f('0x2')],'set':function(_0x1483e4){this[_0x965f('0x4')](_0x965f('0x5'),_0x1483e4?_0x1483e4['join'](''):[]);},'get':function(){return this[_0x965f('0x6')](_0x965f('0x5'))?this[_0x965f('0x6')]('options')[_0x965f('0x7')](''):[];}},'auth':{'type':Sequelize[_0x965f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x965f('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x965f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1307498..edf71e0 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa25c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf'];(function(_0x542146,_0x2d7883){var _0x4bae03=function(_0x17965e){while(--_0x17965e){_0x542146['push'](_0x542146['shift']());}};_0x4bae03(++_0x2d7883);}(_0xa25c,0x13f));var _0xca25=function(_0x501fde,_0x1ee95c){_0x501fde=_0x501fde-0x0;var _0x248bbe=_0xa25c[_0x501fde];return _0x248bbe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){var _0x349364=_0x8cec43[_0xca25('0x24')]({'plain':!![]});var _0x20dc6d='ChanSpies';return db[_0xca25('0x25')][_0xca25('0x23')]({'where':{'type':_0x20dc6d,'resourceId':_0x349364['id']}})[_0xca25('0x22')](function(){return _0x8cec43;});})[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274de1,_0x41eb3a){return function(_0x3d7414){if(!_0x3d7414){_0x274de1[_0xca25('0x26')](0x194);}return _0x3d7414;};}function handleError(_0x2ae0e3,_0x375112){_0x375112=_0x375112||0x1f4;return function(_0xfd888c){logger[_0xca25('0x27')](_0xfd888c[_0xca25('0x28')]);if(_0xfd888c[_0xca25('0x29')]){delete _0xfd888c[_0xca25('0x29')];}_0x2ae0e3[_0xca25('0x16')](_0x375112)[_0xca25('0x2a')](_0xfd888c);};}exports[_0xca25('0x2b')]=function(_0x455df1,_0x2433bb){var _0x14ad0f={},_0x333a43={},_0x478d30={'count':0x0,'rows':[]};var _0x2ecabe=_[_0xca25('0x2c')](db[_0xca25('0x2d')]['rawAttributes'],function(_0xe86982){return{'name':_0xe86982[_0xca25('0x2e')],'type':_0xe86982[_0xca25('0x2f')][_0xca25('0x30')]};});_0x333a43[_0xca25('0x31')]=_[_0xca25('0x2c')](_0x2ecabe,'name');_0x333a43[_0xca25('0x32')]=_['keys'](_0x455df1[_0xca25('0x32')]);_0x333a43[_0xca25('0x33')]=_[_0xca25('0x34')](_0x333a43['model'],_0x333a43[_0xca25('0x32')]);_0x14ad0f[_0xca25('0x35')]=_[_0xca25('0x34')](_0x333a43[_0xca25('0x31')],qs[_0xca25('0x36')](_0x455df1['query'][_0xca25('0x36')]));_0x14ad0f[_0xca25('0x35')]=_0x14ad0f[_0xca25('0x35')][_0xca25('0x37')]?_0x14ad0f[_0xca25('0x35')]:_0x333a43[_0xca25('0x31')];if(!_0x455df1[_0xca25('0x32')]['hasOwnProperty']('nolimit')){_0x14ad0f[_0xca25('0x1a')]=qs[_0xca25('0x1a')](_0x455df1['query']['limit']);_0x14ad0f[_0xca25('0x1c')]=qs[_0xca25('0x1c')](_0x455df1[_0xca25('0x32')]['offset']);}_0x14ad0f[_0xca25('0x38')]=qs[_0xca25('0x39')](_0x455df1[_0xca25('0x32')][_0xca25('0x39')]);_0x14ad0f[_0xca25('0x3a')]=qs[_0xca25('0x33')](_['pick'](_0x455df1[_0xca25('0x32')],_0x333a43['filters']),_0x2ecabe);if(_0x455df1[_0xca25('0x32')][_0xca25('0x3b')]){_0x14ad0f[_0xca25('0x3a')]=_[_0xca25('0x3c')](_0x14ad0f[_0xca25('0x3a')],{'$or':_[_0xca25('0x2c')](_0x2ecabe,function(_0x99ed21){if(_0x99ed21[_0xca25('0x2f')]!==_0xca25('0x3d')){var _0x513995={};_0x513995[_0x99ed21[_0xca25('0x29')]]={'$like':'%'+_0x455df1['query'][_0xca25('0x3b')]+'%'};return _0x513995;}})});}_0x14ad0f=_['merge']({},_0x14ad0f,_0x455df1[_0xca25('0x3e')]);var _0x184ed5={'where':_0x14ad0f[_0xca25('0x3a')]};return db[_0xca25('0x2d')]['count'](_0x184ed5)[_0xca25('0x22')](function(_0x5aafa5){_0x478d30[_0xca25('0x1b')]=_0x5aafa5;if(_0x455df1[_0xca25('0x32')]['includeAll']){_0x14ad0f[_0xca25('0x3f')]=[{'all':!![]}];}return db[_0xca25('0x2d')][_0xca25('0x40')](_0x14ad0f);})[_0xca25('0x22')](function(_0x1068c9){_0x478d30[_0xca25('0x41')]=_0x1068c9;return _0x478d30;})[_0xca25('0x22')](respondWithFilteredResult(_0x2433bb,_0x14ad0f))['catch'](handleError(_0x2433bb,null));};exports[_0xca25('0x42')]=function(_0x300e20,_0x57ed5f){var _0x5b1062={'raw':![],'where':{'id':_0x300e20['params']['id']}},_0x487710={};_0x487710[_0xca25('0x31')]=_[_0xca25('0x43')](db[_0xca25('0x2d')][_0xca25('0x44')]);_0x487710['query']=_[_0xca25('0x43')](_0x300e20[_0xca25('0x32')]);_0x487710[_0xca25('0x33')]=_[_0xca25('0x34')](_0x487710['model'],_0x487710[_0xca25('0x32')]);_0x5b1062['attributes']=_[_0xca25('0x34')](_0x487710[_0xca25('0x31')],qs[_0xca25('0x36')](_0x300e20[_0xca25('0x32')][_0xca25('0x36')]));_0x5b1062[_0xca25('0x35')]=_0x5b1062['attributes'][_0xca25('0x37')]?_0x5b1062[_0xca25('0x35')]:_0x487710[_0xca25('0x31')];if(_0x300e20[_0xca25('0x32')][_0xca25('0x45')]){_0x5b1062[_0xca25('0x3f')]=[{'all':!![]}];}_0x5b1062=_[_0xca25('0x3c')]({},_0x5b1062,_0x300e20[_0xca25('0x3e')]);return db[_0xca25('0x2d')][_0xca25('0x46')](_0x5b1062)[_0xca25('0x22')](handleEntityNotFound(_0x57ed5f,null))[_0xca25('0x22')](respondWithResult(_0x57ed5f,null))[_0xca25('0x47')](handleError(_0x57ed5f,null));};exports[_0xca25('0x48')]=function(_0x3279e0,_0x1fba32){return db[_0xca25('0x2d')][_0xca25('0x48')](_0x3279e0['body'],{})[_0xca25('0x22')](function(_0x39d342){var _0x9fcba=_0x3279e0[_0xca25('0x49')]['get']({'plain':!![]});if(!_0x9fcba)throw new Error(_0xca25('0x4a'));if(_0x9fcba[_0xca25('0x4b')]==='user'){var _0x2bc528=_0x39d342[_0xca25('0x24')]({'plain':!![]});var _0x747387=_0xca25('0x4c');return db['UserProfileSection'][_0xca25('0x46')]({'where':{'name':_0x747387,'userProfileId':_0x9fcba['userProfileId']},'raw':!![]})[_0xca25('0x22')](function(_0x485252){if(_0x485252&&_0x485252['autoAssociation']===0x0){return db[_0xca25('0x25')][_0xca25('0x48')]({'name':_0x2bc528[_0xca25('0x29')],'resourceId':_0x2bc528['id'],'type':_0x485252[_0xca25('0x29')],'sectionId':_0x485252['id']},{})['then'](function(){return _0x39d342;});}else{return _0x39d342;}})['catch'](function(_0xfaf8f5){logger['error'](_0xca25('0x4d'),_0xfaf8f5);throw _0xfaf8f5;});}return _0x39d342;})[_0xca25('0x22')](respondWithResult(_0x1fba32,0xc9))[_0xca25('0x47')](handleError(_0x1fba32,null));};exports[_0xca25('0x21')]=function(_0x149dcd,_0x4d2f9c){if(_0x149dcd['body']['id']){delete _0x149dcd[_0xca25('0x4e')]['id'];}return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0x149dcd[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x4d2f9c,null))[_0xca25('0x22')](saveUpdates(_0x149dcd['body'],null))[_0xca25('0x22')](respondWithResult(_0x4d2f9c,null))[_0xca25('0x47')](handleError(_0x4d2f9c,null));};exports[_0xca25('0x23')]=function(_0xa4fec2,_0x86fc48){return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0xa4fec2[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x86fc48,null))['then'](removeEntity(_0x86fc48,null))[_0xca25('0x47')](handleError(_0x86fc48,null));}; \ No newline at end of file +var _0xba47=['VIRTUAL','includeAll','findAll','rows','show','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','reject','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge'];(function(_0x4f8b45,_0x137a79){var _0x31ad01=function(_0xb43d33){while(--_0xb43d33){_0x4f8b45['push'](_0x4f8b45['shift']());}};_0x31ad01(++_0x137a79);}(_0xba47,0x1ac));var _0x7ba4=function(_0xeeea35,_0x5ae761){_0xeeea35=_0xeeea35-0x0;var _0x18277f=_0xba47[_0xeeea35];return _0x18277f;};'use strict';var emlformat=require(_0x7ba4('0x0'));var rimraf=require(_0x7ba4('0x1'));var zipdir=require(_0x7ba4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ba4('0x3'));var moment=require(_0x7ba4('0x4'));var BPromise=require(_0x7ba4('0x5'));var Mustache=require(_0x7ba4('0x6'));var util=require('util');var path=require(_0x7ba4('0x7'));var sox=require(_0x7ba4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ba4('0x9'));var _=require(_0x7ba4('0xa'));var squel=require(_0x7ba4('0xb'));var crypto=require(_0x7ba4('0xc'));var jsforce=require(_0x7ba4('0xd'));var deskjs=require(_0x7ba4('0xe'));var toCsv=require(_0x7ba4('0xf'));var querystring=require(_0x7ba4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ba4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ba4('0x12'));var hardwareService=require(_0x7ba4('0x13'));var logger=require(_0x7ba4('0x14'))(_0x7ba4('0x15'));var utils=require('../../config/utils');var config=require(_0x7ba4('0x16'));var licenseUtil=require(_0x7ba4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83d2c,_0x266be2){_0x266be2=_0x266be2||0xcc;return function(_0x2fdee0){if(_0x2fdee0){return _0x83d2c['sendStatus'](_0x266be2);}return _0x83d2c[_0x7ba4('0x18')](_0x266be2)[_0x7ba4('0x19')]();};}function respondWithResult(_0x26da9d,_0x471e93){_0x471e93=_0x471e93||0xc8;return function(_0xcf45f6){if(_0xcf45f6){return _0x26da9d[_0x7ba4('0x18')](_0x471e93)[_0x7ba4('0x1a')](_0xcf45f6);}};}function respondWithFilteredResult(_0x1e16c5,_0x3197d9){return function(_0x480e0b){if(_0x480e0b){var _0x4b0fb7=typeof _0x3197d9[_0x7ba4('0x1b')]===_0x7ba4('0x1c')&&typeof _0x3197d9['limit']===_0x7ba4('0x1c');var _0xbc6330=_0x480e0b[_0x7ba4('0x1d')];var _0xd5bdde=_0x4b0fb7?0x0:_0x3197d9[_0x7ba4('0x1b')];var _0x988f2f=_0x4b0fb7?_0x480e0b[_0x7ba4('0x1d')]:_0x3197d9[_0x7ba4('0x1b')]+_0x3197d9['limit'];var _0x5d14ba;if(_0x988f2f>=_0xbc6330){_0x988f2f=_0xbc6330;_0x5d14ba=0xc8;}else{_0x5d14ba=0xce;}_0x1e16c5[_0x7ba4('0x18')](_0x5d14ba);return _0x1e16c5[_0x7ba4('0x1e')]('Content-Range',_0xd5bdde+'-'+_0x988f2f+'/'+_0xbc6330)[_0x7ba4('0x1a')](_0x480e0b);}return null;};}function patchUpdates(_0x14a214){return function(_0x3601ba){try{jsonpatch['apply'](_0x3601ba,_0x14a214,!![]);}catch(_0x5b1dde){return BPromise[_0x7ba4('0x1f')](_0x5b1dde);}return _0x3601ba['save']();};}function saveUpdates(_0x4bd364,_0x225b6a){return function(_0x4dffd7){if(_0x4dffd7){return _0x4dffd7['update'](_0x4bd364)[_0x7ba4('0x20')](function(_0x246943){return _0x246943;});}return null;};}function removeEntity(_0x3a3c67,_0x413a67){return function(_0x2afc11){if(_0x2afc11){return _0x2afc11[_0x7ba4('0x21')]()[_0x7ba4('0x20')](function(){var _0x575de3=_0x2afc11[_0x7ba4('0x22')]({'plain':!![]});var _0x34ee62=_0x7ba4('0x23');return db[_0x7ba4('0x24')][_0x7ba4('0x21')]({'where':{'type':_0x34ee62,'resourceId':_0x575de3['id']}})[_0x7ba4('0x20')](function(){return _0x2afc11;});})['then'](function(){_0x3a3c67[_0x7ba4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51689a,_0x5ae08d){return function(_0x29dadd){if(!_0x29dadd){_0x51689a[_0x7ba4('0x25')](0x194);}return _0x29dadd;};}function handleError(_0x32b2f1,_0xa53052){_0xa53052=_0xa53052||0x1f4;return function(_0x37d8cd){logger['error'](_0x37d8cd[_0x7ba4('0x26')]);if(_0x37d8cd[_0x7ba4('0x27')]){delete _0x37d8cd[_0x7ba4('0x27')];}_0x32b2f1[_0x7ba4('0x18')](_0xa53052)[_0x7ba4('0x28')](_0x37d8cd);};}exports[_0x7ba4('0x29')]=function(_0x4fde73,_0x4fdbc7){var _0x38e2a0={},_0x113e61={},_0x3fab7e={'count':0x0,'rows':[]};var _0x14e238=_[_0x7ba4('0x2a')](db[_0x7ba4('0x2b')][_0x7ba4('0x2c')],function(_0x41290e){return{'name':_0x41290e[_0x7ba4('0x2d')],'type':_0x41290e[_0x7ba4('0x2e')]['key']};});_0x113e61[_0x7ba4('0x2f')]=_[_0x7ba4('0x2a')](_0x14e238,'name');_0x113e61[_0x7ba4('0x30')]=_[_0x7ba4('0x31')](_0x4fde73['query']);_0x113e61[_0x7ba4('0x32')]=_[_0x7ba4('0x33')](_0x113e61['model'],_0x113e61[_0x7ba4('0x30')]);_0x38e2a0['attributes']=_['intersection'](_0x113e61[_0x7ba4('0x2f')],qs['fields'](_0x4fde73[_0x7ba4('0x30')][_0x7ba4('0x34')]));_0x38e2a0[_0x7ba4('0x35')]=_0x38e2a0[_0x7ba4('0x35')][_0x7ba4('0x36')]?_0x38e2a0[_0x7ba4('0x35')]:_0x113e61['model'];if(!_0x4fde73[_0x7ba4('0x30')][_0x7ba4('0x37')](_0x7ba4('0x38'))){_0x38e2a0[_0x7ba4('0x39')]=qs['limit'](_0x4fde73[_0x7ba4('0x30')][_0x7ba4('0x39')]);_0x38e2a0[_0x7ba4('0x1b')]=qs[_0x7ba4('0x1b')](_0x4fde73[_0x7ba4('0x30')]['offset']);}_0x38e2a0[_0x7ba4('0x3a')]=qs[_0x7ba4('0x3b')](_0x4fde73[_0x7ba4('0x30')]['sort']);_0x38e2a0[_0x7ba4('0x3c')]=qs[_0x7ba4('0x32')](_[_0x7ba4('0x3d')](_0x4fde73['query'],_0x113e61[_0x7ba4('0x32')]),_0x14e238);if(_0x4fde73['query'][_0x7ba4('0x3e')]){_0x38e2a0['where']=_[_0x7ba4('0x3f')](_0x38e2a0[_0x7ba4('0x3c')],{'$or':_[_0x7ba4('0x2a')](_0x14e238,function(_0x160ba5){if(_0x160ba5[_0x7ba4('0x2e')]!==_0x7ba4('0x40')){var _0x221ad5={};_0x221ad5[_0x160ba5[_0x7ba4('0x27')]]={'$like':'%'+_0x4fde73[_0x7ba4('0x30')][_0x7ba4('0x3e')]+'%'};return _0x221ad5;}})});}_0x38e2a0=_['merge']({},_0x38e2a0,_0x4fde73['options']);var _0x482b81={'where':_0x38e2a0[_0x7ba4('0x3c')]};return db[_0x7ba4('0x2b')]['count'](_0x482b81)[_0x7ba4('0x20')](function(_0x3daf6f){_0x3fab7e[_0x7ba4('0x1d')]=_0x3daf6f;if(_0x4fde73['query'][_0x7ba4('0x41')]){_0x38e2a0['include']=[{'all':!![]}];}return db[_0x7ba4('0x2b')][_0x7ba4('0x42')](_0x38e2a0);})[_0x7ba4('0x20')](function(_0x35b21a){_0x3fab7e[_0x7ba4('0x43')]=_0x35b21a;return _0x3fab7e;})['then'](respondWithFilteredResult(_0x4fdbc7,_0x38e2a0))['catch'](handleError(_0x4fdbc7,null));};exports[_0x7ba4('0x44')]=function(_0x45405d,_0x1d17e4){var _0x479d1b={'raw':![],'where':{'id':_0x45405d['params']['id']}},_0x6991c8={};_0x6991c8[_0x7ba4('0x2f')]=_[_0x7ba4('0x31')](db['VoiceChanSpy'][_0x7ba4('0x2c')]);_0x6991c8[_0x7ba4('0x30')]=_[_0x7ba4('0x31')](_0x45405d[_0x7ba4('0x30')]);_0x6991c8[_0x7ba4('0x32')]=_[_0x7ba4('0x33')](_0x6991c8[_0x7ba4('0x2f')],_0x6991c8[_0x7ba4('0x30')]);_0x479d1b['attributes']=_[_0x7ba4('0x33')](_0x6991c8[_0x7ba4('0x2f')],qs[_0x7ba4('0x34')](_0x45405d['query'][_0x7ba4('0x34')]));_0x479d1b['attributes']=_0x479d1b[_0x7ba4('0x35')][_0x7ba4('0x36')]?_0x479d1b['attributes']:_0x6991c8[_0x7ba4('0x2f')];if(_0x45405d[_0x7ba4('0x30')][_0x7ba4('0x41')]){_0x479d1b['include']=[{'all':!![]}];}_0x479d1b=_[_0x7ba4('0x3f')]({},_0x479d1b,_0x45405d[_0x7ba4('0x45')]);return db['VoiceChanSpy'][_0x7ba4('0x46')](_0x479d1b)['then'](handleEntityNotFound(_0x1d17e4,null))[_0x7ba4('0x20')](respondWithResult(_0x1d17e4,null))[_0x7ba4('0x47')](handleError(_0x1d17e4,null));};exports[_0x7ba4('0x48')]=function(_0x4e62d6,_0x448cb5){return db[_0x7ba4('0x2b')][_0x7ba4('0x48')](_0x4e62d6['body'],{})['then'](function(_0x2fef71){var _0x5a9a46=_0x4e62d6[_0x7ba4('0x49')]['get']({'plain':!![]});if(!_0x5a9a46)throw new Error(_0x7ba4('0x4a'));if(_0x5a9a46['role']===_0x7ba4('0x49')){var _0x7044cc=_0x2fef71['get']({'plain':!![]});var _0x65a4a3=_0x7ba4('0x23');return db[_0x7ba4('0x4b')][_0x7ba4('0x46')]({'where':{'name':_0x65a4a3,'userProfileId':_0x5a9a46[_0x7ba4('0x4c')]},'raw':!![]})['then'](function(_0x10024e){if(_0x10024e&&_0x10024e[_0x7ba4('0x4d')]===0x0){return db[_0x7ba4('0x24')][_0x7ba4('0x48')]({'name':_0x7044cc['name'],'resourceId':_0x7044cc['id'],'type':_0x10024e[_0x7ba4('0x27')],'sectionId':_0x10024e['id']},{})[_0x7ba4('0x20')](function(){return _0x2fef71;});}else{return _0x2fef71;}})[_0x7ba4('0x47')](function(_0x416e76){logger['error'](_0x7ba4('0x4e'),_0x416e76);throw _0x416e76;});}return _0x2fef71;})[_0x7ba4('0x20')](respondWithResult(_0x448cb5,0xc9))[_0x7ba4('0x47')](handleError(_0x448cb5,null));};exports[_0x7ba4('0x4f')]=function(_0x1ec321,_0x10633b){if(_0x1ec321[_0x7ba4('0x50')]['id']){delete _0x1ec321['body']['id'];}return db['VoiceChanSpy'][_0x7ba4('0x46')]({'where':{'id':_0x1ec321[_0x7ba4('0x51')]['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0x10633b,null))[_0x7ba4('0x20')](saveUpdates(_0x1ec321[_0x7ba4('0x50')],null))['then'](respondWithResult(_0x10633b,null))['catch'](handleError(_0x10633b,null));};exports['destroy']=function(_0x557eb3,_0x41880e){return db[_0x7ba4('0x2b')][_0x7ba4('0x46')]({'where':{'id':_0x557eb3['params']['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0x41880e,null))['then'](removeEntity(_0x41880e,null))[_0x7ba4('0x47')](handleError(_0x41880e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 98f7e09..b0a652c 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9bf=['destroy','lodash','util','bluebird','context','%s%s','prefix','push','Set','CDR(type)=%s','record','merge','format','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate'];(function(_0x35931b,_0x4261aa){var _0x54b0b9=function(_0x51f1e7){while(--_0x51f1e7){_0x35931b['push'](_0x35931b['shift']());}};_0x54b0b9(++_0x4261aa);}(_0xa9bf,0x18d));var _0xfa9b=function(_0x3c5b20,_0x4b0336){_0x3c5b20=_0x3c5b20-0x0;var _0x217352=_0xa9bf[_0x3c5b20];return _0x217352;};'use strict';var _=require(_0xfa9b('0x0'));var util=require(_0xfa9b('0x1'));var BPromise=require(_0xfa9b('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x591efa,_0x5292af,_0x182c9f){var _0x250e42=0x1;var _0x55ab73=[];var _0x4da2d9={'context':_0x5292af[_0xfa9b('0x3')]||'from-sip','exten':util['format'](_0xfa9b('0x4'),_0x591efa[_0xfa9b('0x5')],_0x182c9f),'type':'system','isApp':![],'ChanSpyId':_0x591efa['id'],'UserId':_0x5292af['id']};_0x55ab73[_0xfa9b('0x6')](_['merge']({'app':_0xfa9b('0x7'),'appdata':util['format'](_0xfa9b('0x8'),'chanspy'),'priority':_0x250e42++},_0x4da2d9));if(_0x591efa[_0xfa9b('0x9')]){_0x55ab73[_0xfa9b('0x6')](_[_0xfa9b('0xa')]({'app':'MixMonitor','appdata':util[_0xfa9b('0xb')](_0xfa9b('0xc'),_0x591efa[_0xfa9b('0xd')]),'priority':_0x250e42++},_0x4da2d9));}if(_0x591efa[_0xfa9b('0xe')]){_0x55ab73[_0xfa9b('0x6')](_['merge']({'app':_0xfa9b('0xf'),'appdata':_0x591efa['password'],'priority':_0x250e42++},_0x4da2d9));}_0x55ab73[_0xfa9b('0x6')](_[_0xfa9b('0xa')]({'app':_0xfa9b('0x10'),'appdata':util[_0xfa9b('0xb')](_0xfa9b('0x11'),_0x5292af[_0xfa9b('0x12')],_0x591efa['options']?_0x591efa[_0xfa9b('0x13')][_0xfa9b('0x14')](''):''),'priority':_0x250e42++},_0x4da2d9));if(_0x591efa[_0xfa9b('0x9')]){_0x55ab73['push'](_[_0xfa9b('0xa')]({'app':_0xfa9b('0x15'),'priority':_0x250e42++},_0x4da2d9));}return _0x55ab73;};var getChanSpyApplications=function(_0x58d7ec,_0x31f3e6){var _0x2fd71e=[];for(var _0x405a71=0x0,_0x52be48=0x1;_0x405a71<_0x31f3e6[_0xfa9b('0x16')];_0x405a71++,_0x52be48=0x1){_0x2fd71e=_0x2fd71e[_0xfa9b('0x17')](getUserApplications(_0x58d7ec,_0x31f3e6[_0x405a71],_0x31f3e6[_0x405a71][_0xfa9b('0x18')]));if(_0x31f3e6[_0x405a71][_0xfa9b('0x18')]!=_0x31f3e6[_0x405a71][_0xfa9b('0x12')]){_0x2fd71e=_0x2fd71e[_0xfa9b('0x17')](getUserApplications(_0x58d7ec,_0x31f3e6[_0x405a71],_0x31f3e6[_0x405a71][_0xfa9b('0x12')]));}}return _0x2fd71e;};var getChanSpyPromise=function(_0x119afb,_0x51ae12){return new BPromise(function(_0x36ee99,_0x3ca502){return _0x119afb[_0xfa9b('0x19')]['findAll']({'attributes':['id',_0xfa9b('0x12'),_0xfa9b('0x18')],'where':{'role':_0xfa9b('0x1a'),'chanspy':!![]},'raw':!![]})[_0xfa9b('0x1b')](function(_0x55cada){if(_0x55cada){return _0x36ee99(getChanSpyApplications(_0x51ae12,_0x55cada));}return _0x36ee99([]);})[_0xfa9b('0x1c')](function(_0xf557d5){_0x3ca502(_0xf557d5);});});};module[_0xfa9b('0x1d')]=function(_0x5e6f42,_0x2101a2){var _0x1fa310=_0x5e6f42[_0xfa9b('0x1e')];return _0x5e6f42[_0xfa9b('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0xfa9b('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56fa1b,_0x51ab4e,_0x246b90){return getChanSpyPromise(_0x1fa310,_0x56fa1b)[_0xfa9b('0x1b')](function(_0x486004){if(_0x486004&&_0x486004[_0xfa9b('0x16')]){return _0x1fa310[_0xfa9b('0x21')]['bulkCreate'](_0x486004);}})[_0xfa9b('0x1b')](function(){_0x246b90();})[_0xfa9b('0x1c')](function(_0x419779){_0x246b90(_0x419779);});},'afterUpdate':function(_0x365f02,_0x2f6fcc,_0x5539ae){return _0x1fa310[_0xfa9b('0x21')]['destroy']({'where':{'ChanSpyId':_0x365f02['id']}})[_0xfa9b('0x1b')](function(){return getChanSpyPromise(_0x1fa310,_0x365f02);})[_0xfa9b('0x1b')](function(_0x100cd2){if(_0x100cd2&&_0x100cd2[_0xfa9b('0x16')]){return _0x1fa310['VoiceExtension'][_0xfa9b('0x22')](_0x100cd2);}})[_0xfa9b('0x1b')](function(){_0x5539ae();})['catch'](function(_0x5139e2){_0x5539ae(_0x5139e2);});},'afterDestroy':function(_0x2ce972,_0x48ee6c,_0x361e76){return _0x1fa310[_0xfa9b('0x21')][_0xfa9b('0x23')]({'where':{'ChanSpyId':_0x2ce972['id']}})[_0xfa9b('0x1b')](function(){_0x361e76();})[_0xfa9b('0x1c')](function(_0x437ee1){_0x361e76(_0x437ee1);});}}});}; \ No newline at end of file +var _0xd074=['destroy','lodash','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','Set','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd074,0x1ae));var _0x4d07=function(_0x260ebf,_0x31c14d){_0x260ebf=_0x260ebf-0x0;var _0x1124a4=_0xd074[_0x260ebf];return _0x1124a4;};'use strict';var _=require(_0x4d07('0x0'));var util=require('util');var BPromise=require(_0x4d07('0x1'));var attributes=require(_0x4d07('0x2'));var getUserApplications=function(_0x3ca5df,_0x332a9b,_0x5682d0){var _0x255700=0x1;var _0x552289=[];var _0x368ce3={'context':_0x332a9b['context']||_0x4d07('0x3'),'exten':util[_0x4d07('0x4')](_0x4d07('0x5'),_0x3ca5df[_0x4d07('0x6')],_0x5682d0),'type':_0x4d07('0x7'),'isApp':![],'ChanSpyId':_0x3ca5df['id'],'UserId':_0x332a9b['id']};_0x552289[_0x4d07('0x8')](_[_0x4d07('0x9')]({'app':_0x4d07('0xa'),'appdata':util['format']('CDR(type)=%s',_0x4d07('0xb')),'priority':_0x255700++},_0x368ce3));if(_0x3ca5df[_0x4d07('0xc')]){_0x552289[_0x4d07('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0x4d07('0x4')](_0x4d07('0xd'),_0x3ca5df[_0x4d07('0xe')]),'priority':_0x255700++},_0x368ce3));}if(_0x3ca5df[_0x4d07('0xf')]){_0x552289['push'](_[_0x4d07('0x9')]({'app':_0x4d07('0x10'),'appdata':_0x3ca5df[_0x4d07('0x11')],'priority':_0x255700++},_0x368ce3));}_0x552289[_0x4d07('0x8')](_[_0x4d07('0x9')]({'app':_0x4d07('0x12'),'appdata':util[_0x4d07('0x4')](_0x4d07('0x13'),_0x332a9b[_0x4d07('0x14')],_0x3ca5df[_0x4d07('0x15')]?_0x3ca5df['options'][_0x4d07('0x16')](''):''),'priority':_0x255700++},_0x368ce3));if(_0x3ca5df['record']){_0x552289[_0x4d07('0x8')](_[_0x4d07('0x9')]({'app':_0x4d07('0x17'),'priority':_0x255700++},_0x368ce3));}return _0x552289;};var getChanSpyApplications=function(_0x8769f,_0x1373bf){var _0x2e65f2=[];for(var _0x39a568=0x0,_0x3673db=0x1;_0x39a568<_0x1373bf['length'];_0x39a568++,_0x3673db=0x1){_0x2e65f2=_0x2e65f2[_0x4d07('0x18')](getUserApplications(_0x8769f,_0x1373bf[_0x39a568],_0x1373bf[_0x39a568][_0x4d07('0x19')]));if(_0x1373bf[_0x39a568][_0x4d07('0x19')]!=_0x1373bf[_0x39a568][_0x4d07('0x14')]){_0x2e65f2=_0x2e65f2[_0x4d07('0x18')](getUserApplications(_0x8769f,_0x1373bf[_0x39a568],_0x1373bf[_0x39a568][_0x4d07('0x14')]));}}return _0x2e65f2;};var getChanSpyPromise=function(_0x8d4a20,_0x4a334a){return new BPromise(function(_0x142d0f,_0x4a0c31){return _0x8d4a20[_0x4d07('0x1a')][_0x4d07('0x1b')]({'attributes':['id',_0x4d07('0x14'),_0x4d07('0x19')],'where':{'role':_0x4d07('0x1c'),'chanspy':!![]},'raw':!![]})[_0x4d07('0x1d')](function(_0x468ac7){if(_0x468ac7){return _0x142d0f(getChanSpyApplications(_0x4a334a,_0x468ac7));}return _0x142d0f([]);})['catch'](function(_0x881f77){_0x4a0c31(_0x881f77);});});};module[_0x4d07('0x1e')]=function(_0x281d58,_0xaa4e7){var _0x41d7b9=_0x281d58[_0x4d07('0x1f')];return _0x281d58[_0x4d07('0x20')](_0x4d07('0x21'),attributes,{'tableName':_0x4d07('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x46a1e1,_0x30db49,_0x317c9e){return getChanSpyPromise(_0x41d7b9,_0x46a1e1)[_0x4d07('0x1d')](function(_0x5f63ee){if(_0x5f63ee&&_0x5f63ee['length']){return _0x41d7b9[_0x4d07('0x23')][_0x4d07('0x24')](_0x5f63ee);}})[_0x4d07('0x1d')](function(){_0x317c9e();})[_0x4d07('0x25')](function(_0x403165){_0x317c9e(_0x403165);});},'afterUpdate':function(_0x1b35d8,_0x285cba,_0x14a534){return _0x41d7b9[_0x4d07('0x23')][_0x4d07('0x26')]({'where':{'ChanSpyId':_0x1b35d8['id']}})['then'](function(){return getChanSpyPromise(_0x41d7b9,_0x1b35d8);})[_0x4d07('0x1d')](function(_0x5ec6cc){if(_0x5ec6cc&&_0x5ec6cc['length']){return _0x41d7b9['VoiceExtension'][_0x4d07('0x24')](_0x5ec6cc);}})[_0x4d07('0x1d')](function(){_0x14a534();})[_0x4d07('0x25')](function(_0x305c50){_0x14a534(_0x305c50);});},'afterDestroy':function(_0x38a0e8,_0x433e0d,_0x3e3d40){return _0x41d7b9['VoiceExtension'][_0x4d07('0x26')]({'where':{'ChanSpyId':_0x38a0e8['id']}})[_0x4d07('0x1d')](function(){_0x3e3d40();})[_0x4d07('0x25')](function(_0x13e8d9){_0x3e3d40(_0x13e8d9);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 81475ce..951c22d 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc36d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','lodash'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc36d,0x7d));var _0xdc36=function(_0xf13ca6,_0x5735ea){_0xf13ca6=_0xf13ca6-0x0;var _0x4a4387=_0xc36d[_0xf13ca6];return _0x4a4387;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var BPromise=require(_0xdc36('0x3'));var rs=require(_0xdc36('0x4'));var fs=require('fs');var Redis=require(_0xdc36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc36('0x6'));var logger=require(_0xdc36('0x7'))('rpc');var config=require(_0xdc36('0x8'));var jayson=require(_0xdc36('0x9'));var client=jayson[_0xdc36('0xa')][_0xdc36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e4753,_0x571311,_0x20ba02){return new BPromise(function(_0x456897,_0x2a0087){return client[_0xdc36('0xc')](_0x6e4753,_0x20ba02)['then'](function(_0x20d00a){logger[_0xdc36('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));logger[_0xdc36('0xf')](_0xdc36('0x10'),_0x571311,'request\x20sent',JSON[_0xdc36('0x11')](_0x20d00a));if(_0x20d00a[_0xdc36('0x12')]){if(_0x20d00a['error']['code']===0x1f4){logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x2a0087(_0x20d00a['error'][_0xdc36('0x14')]);}logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x456897(_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);}else{logger[_0xdc36('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));_0x456897(_0x20d00a['result']['message']);}})['catch'](function(_0x64f61e){logger[_0xdc36('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0x64f61e);_0x2a0087(_0x64f61e);});});} \ No newline at end of file +var _0xdb94=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x2b14f5,_0xbda46f){var _0x3248cd=function(_0x5b63e2){while(--_0x5b63e2){_0x2b14f5['push'](_0x2b14f5['shift']());}};_0x3248cd(++_0xbda46f);}(_0xdb94,0xab));var _0x4db9=function(_0xe80192,_0x25195d){_0xe80192=_0xe80192-0x0;var _0x34ba2b=_0xdb94[_0xe80192];return _0x34ba2b;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2114b20..9dbdab8 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1564=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','post','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x19ff38,_0x224613){var _0x5945a1=function(_0x1dbf54){while(--_0x1dbf54){_0x19ff38['push'](_0x19ff38['shift']());}};_0x5945a1(++_0x224613);}(_0x1564,0x1ed));var _0x4156=function(_0x18b23c,_0x403314){_0x18b23c=_0x18b23c-0x0;var _0x21ca9d=_0x1564[_0x18b23c];return _0x21ca9d;};'use strict';var multer=require(_0x4156('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4156('0x1'));var express=require('express');var router=express[_0x4156('0x2')]();var fs_extra=require(_0x4156('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4156('0x4'));var config=require(_0x4156('0x5'));var controller=require(_0x4156('0x6'));router[_0x4156('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4156('0x7')](_0x4156('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x4156('0x9')]('/',auth[_0x4156('0xa')](),controller['create']);router['put'](_0x4156('0x8'),auth['isAuthenticated'](),controller[_0x4156('0xb')]);router[_0x4156('0xc')]('/:id',auth[_0x4156('0xa')](),controller[_0x4156('0xd')]);module[_0x4156('0xe')]=router; \ No newline at end of file +var _0x50ac=['/:id','show','post','create','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','get'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x50ac,0x127));var _0xc50a=function(_0x18dd84,_0x5f2ba0){_0x18dd84=_0x18dd84-0x0;var _0x5e740c=_0x50ac[_0x18dd84];return _0x5e740c;};'use strict';var multer=require(_0xc50a('0x0'));var util=require(_0xc50a('0x1'));var path=require(_0xc50a('0x2'));var timeout=require(_0xc50a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc50a('0x4'));var auth=require(_0xc50a('0x5'));var interaction=require(_0xc50a('0x6'));var config=require('../../config/environment');var controller=require(_0xc50a('0x7'));router['get']('/',auth[_0xc50a('0x8')](),controller[_0xc50a('0x9')]);router[_0xc50a('0xa')](_0xc50a('0xb'),auth[_0xc50a('0x8')](),controller[_0xc50a('0xc')]);router[_0xc50a('0xd')]('/',auth[_0xc50a('0x8')](),controller[_0xc50a('0xe')]);router['put'](_0xc50a('0xb'),auth['isAuthenticated'](),controller[_0xc50a('0xf')]);router['delete'](_0xc50a('0xb'),auth[_0xc50a('0x8')](),controller['destroy']);module[_0xc50a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index adaa3ed..1235751 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd020=['STRING','name','BOOLEAN'];(function(_0x527660,_0x5a15fe){var _0x2e1784=function(_0x2bcc18){while(--_0x2bcc18){_0x527660['push'](_0x527660['shift']());}};_0x2e1784(++_0x5a15fe);}(_0xd020,0xab));var _0x0d02=function(_0x9d3f5e,_0x11c63e){_0x9d3f5e=_0x9d3f5e-0x0;var _0x2adb90=_0xd020[_0x9d3f5e];return _0x2adb90;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0d02('0x0')],'unique':_0x0d02('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0d02('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1697=['STRING','exports'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x1697,0x1b7));var _0x7169=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x1697[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require('sequelize');module[_0x7169('0x0')]={'name':{'type':Sequelize[_0x7169('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x7169('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 9c0deed..8a7831a 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ad0=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','get','end','stack','name','send','VoiceContext','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','show','options','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','update','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3a85a2,_0x568d46){var _0x4bf81e=function(_0x24e3ed){while(--_0x24e3ed){_0x3a85a2['push'](_0x3a85a2['shift']());}};_0x4bf81e(++_0x568d46);}(_0x3ad0,0x193));var _0x03ad=function(_0x5cb504,_0x4344c6){_0x5cb504=_0x5cb504-0x0;var _0x23bc02=_0x3ad0[_0x5cb504];return _0x23bc02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03ad('0x0'));var zipdir=require(_0x03ad('0x1'));var jsonpatch=require(_0x03ad('0x2'));var rp=require('request-promise');var moment=require(_0x03ad('0x3'));var BPromise=require(_0x03ad('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x03ad('0x5'));var sox=require(_0x03ad('0x6'));var csv=require(_0x03ad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03ad('0x8'));var _=require(_0x03ad('0x9'));var squel=require(_0x03ad('0xa'));var crypto=require('crypto');var jsforce=require(_0x03ad('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x03ad('0x7'));var querystring=require(_0x03ad('0xc'));var Papa=require(_0x03ad('0xd'));var Redis=require('ioredis');var authService=require(_0x03ad('0xe'));var qs=require(_0x03ad('0xf'));var as=require(_0x03ad('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03ad('0x11'))(_0x03ad('0x12'));var utils=require(_0x03ad('0x13'));var config=require(_0x03ad('0x14'));var licenseUtil=require(_0x03ad('0x15'));var db=require(_0x03ad('0x16'))['db'];var jayson=require(_0x03ad('0x17'));var client=jayson[_0x03ad('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1f32,_0x2945ea,_0x4a61c5,_0x4d51b7){return new BPromise(function(_0x631040,_0x21f2e1){var _0xa157c4=_0x4d51b7||client;return _0xa157c4[_0x03ad('0x19')](_0xd1f32,_0x4a61c5)[_0x03ad('0x1a')](function(_0x30af53){logger[_0x03ad('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x2945ea,_0x03ad('0x1c'));logger[_0x03ad('0x1d')](_0x03ad('0x1e'),_0x2945ea,_0x03ad('0x1c'),JSON[_0x03ad('0x1f')](_0x30af53));if(_0x30af53[_0x03ad('0x20')]){if(_0x30af53[_0x03ad('0x20')]['code']===0x1f4){logger[_0x03ad('0x20')]('VoiceContext,\x20%s,\x20%s',_0x2945ea,_0x30af53[_0x03ad('0x20')][_0x03ad('0x21')]);return _0x21f2e1(_0x30af53['error']['message']);}logger[_0x03ad('0x20')](_0x03ad('0x22'),_0x2945ea,_0x30af53[_0x03ad('0x20')][_0x03ad('0x21')]);return _0x631040(_0x30af53[_0x03ad('0x20')]['message']);}else{logger[_0x03ad('0x1b')](_0x03ad('0x22'),_0x2945ea,_0x03ad('0x1c'));_0x631040(_0x30af53[_0x03ad('0x23')][_0x03ad('0x21')]);}})[_0x03ad('0x24')](function(_0x359f87){logger[_0x03ad('0x20')](_0x03ad('0x22'),_0x2945ea,_0x359f87);_0x21f2e1(_0x359f87);});});}function respondWithStatusCode(_0x232889,_0x498f6c){_0x498f6c=_0x498f6c||0xcc;return function(_0x2e4283){if(_0x2e4283){return _0x232889[_0x03ad('0x25')](_0x498f6c);}return _0x232889['status'](_0x498f6c)['end']();};}function respondWithResult(_0x396b0b,_0x1d814c){_0x1d814c=_0x1d814c||0xc8;return function(_0x4c02a3){if(_0x4c02a3){return _0x396b0b[_0x03ad('0x26')](_0x1d814c)[_0x03ad('0x27')](_0x4c02a3);}};}function respondWithFilteredResult(_0x48c212,_0x306277){return function(_0x513bc5){if(_0x513bc5){var _0x5b34e8=typeof _0x306277[_0x03ad('0x28')]===_0x03ad('0x29')&&typeof _0x306277[_0x03ad('0x2a')]==='undefined';var _0x5a7f6f=_0x513bc5['count'];var _0x1fb166=_0x5b34e8?0x0:_0x306277[_0x03ad('0x28')];var _0x2a4d52=_0x5b34e8?_0x513bc5[_0x03ad('0x2b')]:_0x306277[_0x03ad('0x28')]+_0x306277[_0x03ad('0x2a')];var _0x28f5cc;if(_0x2a4d52>=_0x5a7f6f){_0x2a4d52=_0x5a7f6f;_0x28f5cc=0xc8;}else{_0x28f5cc=0xce;}_0x48c212[_0x03ad('0x26')](_0x28f5cc);return _0x48c212['set'](_0x03ad('0x2c'),_0x1fb166+'-'+_0x2a4d52+'/'+_0x5a7f6f)[_0x03ad('0x27')](_0x513bc5);}return null;};}function patchUpdates(_0x9c1155){return function(_0x1d7a05){try{jsonpatch[_0x03ad('0x2d')](_0x1d7a05,_0x9c1155,!![]);}catch(_0x488afa){return BPromise[_0x03ad('0x2e')](_0x488afa);}return _0x1d7a05['save']();};}function saveUpdates(_0x3c0d51,_0x32f5f2){return function(_0x576ddb){if(_0x576ddb){return _0x576ddb['update'](_0x3c0d51)[_0x03ad('0x1a')](function(_0x561f25){return _0x561f25;});}return null;};}function removeEntity(_0x40717f,_0x3faf14){return function(_0xc64188){if(_0xc64188){return _0xc64188[_0x03ad('0x2f')]()['then'](function(){var _0x200c82=_0xc64188[_0x03ad('0x30')]({'plain':!![]});var _0x58b77c='Contexts';return db['UserProfileResource'][_0x03ad('0x2f')]({'where':{'type':_0x58b77c,'resourceId':_0x200c82['id']}})[_0x03ad('0x1a')](function(){return _0xc64188;});})[_0x03ad('0x1a')](function(){_0x40717f[_0x03ad('0x26')](0xcc)[_0x03ad('0x31')]();});}};}function handleEntityNotFound(_0x44abe9,_0x34cd33){return function(_0x29623f){if(!_0x29623f){_0x44abe9[_0x03ad('0x25')](0x194);}return _0x29623f;};}function handleError(_0x3c4667,_0x30a2c5){_0x30a2c5=_0x30a2c5||0x1f4;return function(_0x134dc5){logger[_0x03ad('0x20')](_0x134dc5[_0x03ad('0x32')]);if(_0x134dc5[_0x03ad('0x33')]){delete _0x134dc5[_0x03ad('0x33')];}_0x3c4667[_0x03ad('0x26')](_0x30a2c5)[_0x03ad('0x34')](_0x134dc5);};}exports['index']=function(_0x2adfa8,_0x4fcc42){var _0xc7f787={},_0x319e65={},_0xeaa0ae={'count':0x0,'rows':[]};var _0x279d74=_['map'](db[_0x03ad('0x35')][_0x03ad('0x36')],function(_0x5abe66){return{'name':_0x5abe66[_0x03ad('0x37')],'type':_0x5abe66[_0x03ad('0x38')][_0x03ad('0x39')]};});_0x319e65[_0x03ad('0x3a')]=_[_0x03ad('0x3b')](_0x279d74,'name');_0x319e65['query']=_[_0x03ad('0x3c')](_0x2adfa8['query']);_0x319e65[_0x03ad('0x3d')]=_[_0x03ad('0x3e')](_0x319e65[_0x03ad('0x3a')],_0x319e65[_0x03ad('0x3f')]);_0xc7f787[_0x03ad('0x40')]=_[_0x03ad('0x3e')](_0x319e65['model'],qs[_0x03ad('0x41')](_0x2adfa8[_0x03ad('0x3f')][_0x03ad('0x41')]));_0xc7f787[_0x03ad('0x40')]=_0xc7f787['attributes'][_0x03ad('0x42')]?_0xc7f787[_0x03ad('0x40')]:_0x319e65[_0x03ad('0x3a')];if(!_0x2adfa8[_0x03ad('0x3f')]['hasOwnProperty'](_0x03ad('0x43'))){_0xc7f787[_0x03ad('0x2a')]=qs[_0x03ad('0x2a')](_0x2adfa8[_0x03ad('0x3f')][_0x03ad('0x2a')]);_0xc7f787[_0x03ad('0x28')]=qs[_0x03ad('0x28')](_0x2adfa8['query'][_0x03ad('0x28')]);}_0xc7f787[_0x03ad('0x44')]=qs[_0x03ad('0x45')](_0x2adfa8['query']['sort']);_0xc7f787[_0x03ad('0x46')]=qs['filters'](_[_0x03ad('0x47')](_0x2adfa8[_0x03ad('0x3f')],_0x319e65[_0x03ad('0x3d')]),_0x279d74);if(_0x2adfa8[_0x03ad('0x3f')][_0x03ad('0x48')]){_0xc7f787['where']=_[_0x03ad('0x49')](_0xc7f787[_0x03ad('0x46')],{'$or':_[_0x03ad('0x3b')](_0x279d74,function(_0x334f3f){if(_0x334f3f['type']!=='VIRTUAL'){var _0x54673e={};_0x54673e[_0x334f3f[_0x03ad('0x33')]]={'$like':'%'+_0x2adfa8['query'][_0x03ad('0x48')]+'%'};return _0x54673e;}})});}_0xc7f787=_[_0x03ad('0x49')]({},_0xc7f787,_0x2adfa8['options']);var _0x3b2f1f={'where':_0xc7f787['where']};return db['VoiceContext'][_0x03ad('0x2b')](_0x3b2f1f)[_0x03ad('0x1a')](function(_0x429b0a){_0xeaa0ae[_0x03ad('0x2b')]=_0x429b0a;if(_0x2adfa8[_0x03ad('0x3f')][_0x03ad('0x4a')]){_0xc7f787[_0x03ad('0x4b')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0xc7f787);})[_0x03ad('0x1a')](function(_0x5eb01c){_0xeaa0ae[_0x03ad('0x4c')]=_0x5eb01c;return _0xeaa0ae;})[_0x03ad('0x1a')](respondWithFilteredResult(_0x4fcc42,_0xc7f787))[_0x03ad('0x24')](handleError(_0x4fcc42,null));};exports[_0x03ad('0x4d')]=function(_0x720347,_0x3f9e5d){var _0x655dab={'raw':![],'where':{'id':_0x720347['params']['id']}},_0x4a060e={};_0x4a060e[_0x03ad('0x3a')]=_[_0x03ad('0x3c')](db[_0x03ad('0x35')][_0x03ad('0x36')]);_0x4a060e[_0x03ad('0x3f')]=_[_0x03ad('0x3c')](_0x720347[_0x03ad('0x3f')]);_0x4a060e[_0x03ad('0x3d')]=_['intersection'](_0x4a060e[_0x03ad('0x3a')],_0x4a060e['query']);_0x655dab['attributes']=_['intersection'](_0x4a060e[_0x03ad('0x3a')],qs[_0x03ad('0x41')](_0x720347[_0x03ad('0x3f')]['fields']));_0x655dab['attributes']=_0x655dab['attributes']['length']?_0x655dab[_0x03ad('0x40')]:_0x4a060e[_0x03ad('0x3a')];if(_0x720347[_0x03ad('0x3f')]['includeAll']){_0x655dab[_0x03ad('0x4b')]=[{'all':!![]}];}_0x655dab=_['merge']({},_0x655dab,_0x720347[_0x03ad('0x4e')]);return db[_0x03ad('0x35')][_0x03ad('0x4f')](_0x655dab)[_0x03ad('0x1a')](handleEntityNotFound(_0x3f9e5d,null))[_0x03ad('0x1a')](respondWithResult(_0x3f9e5d,null))['catch'](handleError(_0x3f9e5d,null));};exports[_0x03ad('0x50')]=function(_0x502d18,_0x3b7bc9,_0x3b01bb){var _0x299a65;return db[_0x03ad('0x35')][_0x03ad('0x50')](_0x502d18[_0x03ad('0x51')],{'raw':!![]})[_0x03ad('0x1a')](function(_0x39a374){_0x299a65=_0x39a374;return db[_0x03ad('0x35')][_0x03ad('0x52')]({'raw':!![]});})[_0x03ad('0x1a')](function(_0x157157){var _0x15caff=fs[_0x03ad('0x53')](path[_0x03ad('0x54')](config[_0x03ad('0x55')],_0x03ad('0x56')),_0x03ad('0x57'));var _0x2e6402=ejs[_0x03ad('0x58')](_0x15caff,{'contexts':_0x157157||[]});fs[_0x03ad('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2e6402);})[_0x03ad('0x1a')](function(){return respondWithRpcPromise(_0x03ad('0x5a'),'create',{'module':_0x03ad('0x5b')});})[_0x03ad('0x1a')](function(){var _0x1ee3c7=_0x502d18[_0x03ad('0x5c')][_0x03ad('0x30')]({'plain':!![]});if(!_0x1ee3c7)throw new Error(_0x03ad('0x5d'));if(_0x1ee3c7[_0x03ad('0x5e')]===_0x03ad('0x5c')){var _0x18b12b=_0x299a65[_0x03ad('0x30')]({'plain':!![]});return db[_0x03ad('0x5f')]['find']({'where':{'name':_0x03ad('0x60'),'userProfileId':_0x1ee3c7[_0x03ad('0x61')]},'raw':!![]})['then'](function(_0x14389d){if(_0x14389d&&_0x14389d[_0x03ad('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x18b12b['name'],'resourceId':_0x18b12b['id'],'type':_0x14389d[_0x03ad('0x33')],'sectionId':_0x14389d['id']},{})['then'](function(){return _0x299a65;});}else{return _0x299a65;}})['catch'](function(_0x11e066){logger['error'](_0x03ad('0x63'),_0x11e066);throw _0x11e066;});}return _0x299a65;})['then'](respondWithResult(_0x3b7bc9,0xc9))[_0x03ad('0x24')](handleError(_0x3b7bc9,null));};exports['update']=function(_0x24ea1f,_0x4698ba,_0x1280a1){var _0x109bdc;return db[_0x03ad('0x35')][_0x03ad('0x4f')]({'where':{'id':_0x24ea1f[_0x03ad('0x64')]['id']}})[_0x03ad('0x1a')](handleEntityNotFound(_0x4698ba,null))[_0x03ad('0x1a')](saveUpdates(_0x24ea1f[_0x03ad('0x51')],null))['then'](function(_0x564f71){if(_0x564f71){_0x109bdc=_0x564f71;return db['VoiceContext'][_0x03ad('0x52')]({'raw':!![]});}})['then'](function(_0x451eb7){var _0x1dbe78=fs['readFileSync'](path[_0x03ad('0x54')](config['root'],_0x03ad('0x56')),_0x03ad('0x57'));var _0x199df8=ejs['render'](_0x1dbe78,{'contexts':_0x451eb7||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x199df8);})[_0x03ad('0x1a')](function(){return respondWithRpcPromise(_0x03ad('0x5a'),_0x03ad('0x65'),{'module':_0x03ad('0x5b')});})[_0x03ad('0x1a')](function(){return _0x109bdc;})['then'](respondWithResult(_0x4698ba,null))[_0x03ad('0x24')](handleError(_0x4698ba,null));};exports[_0x03ad('0x2f')]=function(_0x2f1953,_0x2568b5,_0x1816ea){var _0x318597;return db[_0x03ad('0x35')][_0x03ad('0x4f')]({'where':{'id':_0x2f1953[_0x03ad('0x64')]['id']}})['then'](handleEntityNotFound(_0x2568b5,null))[_0x03ad('0x1a')](removeEntity(_0x2568b5,null))[_0x03ad('0x1a')](function(){return db['VoiceContext'][_0x03ad('0x52')]({'raw':!![]});})['then'](function(_0x3b850c){var _0x28dbbb=fs[_0x03ad('0x53')](path[_0x03ad('0x54')](config['root'],_0x03ad('0x56')),_0x03ad('0x57'));var _0x1d50b3=ejs['render'](_0x28dbbb,{'contexts':_0x3b850c});fs[_0x03ad('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1d50b3);return respondWithRpcPromise('Reload',_0x03ad('0x2f'),{'module':_0x03ad('0x5b')});})[_0x03ad('0x24')](handleError(_0x2568b5,null));}; \ No newline at end of file +var _0x10b1=['keys','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','findAll','show','params','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','request','then','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','VoiceContext,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','type','key'];(function(_0x3b37cb,_0x427328){var _0x1c4933=function(_0x41f8d6){while(--_0x41f8d6){_0x3b37cb['push'](_0x3b37cb['shift']());}};_0x1c4933(++_0x427328);}(_0x10b1,0x8d));var _0x110b=function(_0x32855a,_0x23d0bc){_0x32855a=_0x32855a-0x0;var _0x57f7c8=_0x10b1[_0x32855a];return _0x57f7c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x110b('0x0'));var zipdir=require(_0x110b('0x1'));var jsonpatch=require(_0x110b('0x2'));var rp=require(_0x110b('0x3'));var moment=require(_0x110b('0x4'));var BPromise=require(_0x110b('0x5'));var Mustache=require(_0x110b('0x6'));var util=require(_0x110b('0x7'));var path=require(_0x110b('0x8'));var sox=require(_0x110b('0x9'));var csv=require(_0x110b('0xa'));var ejs=require(_0x110b('0xb'));var fs=require('fs');var fs_extra=require(_0x110b('0xc'));var _=require(_0x110b('0xd'));var squel=require(_0x110b('0xe'));var crypto=require('crypto');var jsforce=require(_0x110b('0xf'));var deskjs=require(_0x110b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x110b('0x11'));var Redis=require(_0x110b('0x12'));var authService=require(_0x110b('0x13'));var qs=require(_0x110b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x110b('0x15'))(_0x110b('0x16'));var utils=require(_0x110b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x110b('0x18'));var db=require(_0x110b('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3379d9,_0x347f13,_0xf1ea16,_0x23e001){return new BPromise(function(_0x3d7d3a,_0x2cd817){var _0x286e95=_0x23e001||client;return _0x286e95[_0x110b('0x1a')](_0x3379d9,_0xf1ea16)[_0x110b('0x1b')](function(_0x584236){logger['info']('VoiceContext,\x20%s,\x20%s',_0x347f13,_0x110b('0x1c'));logger['debug'](_0x110b('0x1d'),_0x347f13,_0x110b('0x1c'),JSON[_0x110b('0x1e')](_0x584236));if(_0x584236['error']){if(_0x584236['error'][_0x110b('0x1f')]===0x1f4){logger['error'](_0x110b('0x20'),_0x347f13,_0x584236['error']['message']);return _0x2cd817(_0x584236[_0x110b('0x21')][_0x110b('0x22')]);}logger['error'](_0x110b('0x20'),_0x347f13,_0x584236[_0x110b('0x21')][_0x110b('0x22')]);return _0x3d7d3a(_0x584236['error'][_0x110b('0x22')]);}else{logger[_0x110b('0x23')](_0x110b('0x20'),_0x347f13,_0x110b('0x1c'));_0x3d7d3a(_0x584236['result']['message']);}})[_0x110b('0x24')](function(_0x37b66b){logger[_0x110b('0x21')](_0x110b('0x20'),_0x347f13,_0x37b66b);_0x2cd817(_0x37b66b);});});}function respondWithStatusCode(_0x2f502d,_0x3dfbb4){_0x3dfbb4=_0x3dfbb4||0xcc;return function(_0x400156){if(_0x400156){return _0x2f502d[_0x110b('0x25')](_0x3dfbb4);}return _0x2f502d[_0x110b('0x26')](_0x3dfbb4)[_0x110b('0x27')]();};}function respondWithResult(_0x20fa88,_0x521649){_0x521649=_0x521649||0xc8;return function(_0x538330){if(_0x538330){return _0x20fa88['status'](_0x521649)['json'](_0x538330);}};}function respondWithFilteredResult(_0x449e8d,_0x113832){return function(_0x3c688d){if(_0x3c688d){var _0xdefff5=typeof _0x113832['offset']===_0x110b('0x28')&&typeof _0x113832[_0x110b('0x29')]===_0x110b('0x28');var _0xfc106e=_0x3c688d[_0x110b('0x2a')];var _0x557e98=_0xdefff5?0x0:_0x113832[_0x110b('0x2b')];var _0x13a281=_0xdefff5?_0x3c688d[_0x110b('0x2a')]:_0x113832[_0x110b('0x2b')]+_0x113832['limit'];var _0x451857;if(_0x13a281>=_0xfc106e){_0x13a281=_0xfc106e;_0x451857=0xc8;}else{_0x451857=0xce;}_0x449e8d[_0x110b('0x26')](_0x451857);return _0x449e8d[_0x110b('0x2c')](_0x110b('0x2d'),_0x557e98+'-'+_0x13a281+'/'+_0xfc106e)[_0x110b('0x2e')](_0x3c688d);}return null;};}function patchUpdates(_0x4f0968){return function(_0x3fcd80){try{jsonpatch[_0x110b('0x2f')](_0x3fcd80,_0x4f0968,!![]);}catch(_0x3fec16){return BPromise[_0x110b('0x30')](_0x3fec16);}return _0x3fcd80[_0x110b('0x31')]();};}function saveUpdates(_0x5051e1,_0x5a81a5){return function(_0x567061){if(_0x567061){return _0x567061[_0x110b('0x32')](_0x5051e1)[_0x110b('0x1b')](function(_0x19d9da){return _0x19d9da;});}return null;};}function removeEntity(_0x8ecfa4,_0x313d2c){return function(_0x5dbce3){if(_0x5dbce3){return _0x5dbce3[_0x110b('0x33')]()[_0x110b('0x1b')](function(){var _0x297770=_0x5dbce3[_0x110b('0x34')]({'plain':!![]});var _0x4eb2de=_0x110b('0x35');return db[_0x110b('0x36')]['destroy']({'where':{'type':_0x4eb2de,'resourceId':_0x297770['id']}})[_0x110b('0x1b')](function(){return _0x5dbce3;});})[_0x110b('0x1b')](function(){_0x8ecfa4[_0x110b('0x26')](0xcc)[_0x110b('0x27')]();});}};}function handleEntityNotFound(_0x5ce3d8,_0x5e0605){return function(_0x2392ad){if(!_0x2392ad){_0x5ce3d8[_0x110b('0x25')](0x194);}return _0x2392ad;};}function handleError(_0x110b73,_0x199b03){_0x199b03=_0x199b03||0x1f4;return function(_0x50d4d5){logger[_0x110b('0x21')](_0x50d4d5[_0x110b('0x37')]);if(_0x50d4d5[_0x110b('0x38')]){delete _0x50d4d5[_0x110b('0x38')];}_0x110b73['status'](_0x199b03)[_0x110b('0x39')](_0x50d4d5);};}exports['index']=function(_0x4ec747,_0x43af97){var _0x4b8533={},_0x30aefd={},_0x37866d={'count':0x0,'rows':[]};var _0x352ed8=_[_0x110b('0x3a')](db[_0x110b('0x3b')]['rawAttributes'],function(_0x19805f){return{'name':_0x19805f[_0x110b('0x3c')],'type':_0x19805f[_0x110b('0x3d')][_0x110b('0x3e')]};});_0x30aefd['model']=_[_0x110b('0x3a')](_0x352ed8,'name');_0x30aefd['query']=_[_0x110b('0x3f')](_0x4ec747[_0x110b('0x40')]);_0x30aefd['filters']=_['intersection'](_0x30aefd[_0x110b('0x41')],_0x30aefd[_0x110b('0x40')]);_0x4b8533[_0x110b('0x42')]=_[_0x110b('0x43')](_0x30aefd[_0x110b('0x41')],qs['fields'](_0x4ec747['query'][_0x110b('0x44')]));_0x4b8533[_0x110b('0x42')]=_0x4b8533[_0x110b('0x42')][_0x110b('0x45')]?_0x4b8533[_0x110b('0x42')]:_0x30aefd['model'];if(!_0x4ec747[_0x110b('0x40')]['hasOwnProperty'](_0x110b('0x46'))){_0x4b8533[_0x110b('0x29')]=qs[_0x110b('0x29')](_0x4ec747['query'][_0x110b('0x29')]);_0x4b8533[_0x110b('0x2b')]=qs[_0x110b('0x2b')](_0x4ec747[_0x110b('0x40')][_0x110b('0x2b')]);}_0x4b8533[_0x110b('0x47')]=qs['sort'](_0x4ec747[_0x110b('0x40')][_0x110b('0x48')]);_0x4b8533[_0x110b('0x49')]=qs[_0x110b('0x4a')](_['pick'](_0x4ec747['query'],_0x30aefd[_0x110b('0x4a')]),_0x352ed8);if(_0x4ec747[_0x110b('0x40')]['filter']){_0x4b8533[_0x110b('0x49')]=_[_0x110b('0x4b')](_0x4b8533[_0x110b('0x49')],{'$or':_[_0x110b('0x3a')](_0x352ed8,function(_0x3df4cd){if(_0x3df4cd[_0x110b('0x3d')]!=='VIRTUAL'){var _0x1c4f1f={};_0x1c4f1f[_0x3df4cd['name']]={'$like':'%'+_0x4ec747[_0x110b('0x40')][_0x110b('0x4c')]+'%'};return _0x1c4f1f;}})});}_0x4b8533=_['merge']({},_0x4b8533,_0x4ec747[_0x110b('0x4d')]);var _0x37dc7a={'where':_0x4b8533['where']};return db[_0x110b('0x3b')][_0x110b('0x2a')](_0x37dc7a)[_0x110b('0x1b')](function(_0x4a75a1){_0x37866d[_0x110b('0x2a')]=_0x4a75a1;if(_0x4ec747[_0x110b('0x40')][_0x110b('0x4e')]){_0x4b8533[_0x110b('0x4f')]=[{'all':!![]}];}return db[_0x110b('0x3b')][_0x110b('0x50')](_0x4b8533);})['then'](function(_0x27d1af){_0x37866d['rows']=_0x27d1af;return _0x37866d;})[_0x110b('0x1b')](respondWithFilteredResult(_0x43af97,_0x4b8533))[_0x110b('0x24')](handleError(_0x43af97,null));};exports[_0x110b('0x51')]=function(_0x110dc3,_0x3eb841){var _0x5bd6f9={'raw':![],'where':{'id':_0x110dc3[_0x110b('0x52')]['id']}},_0x1862cf={};_0x1862cf['model']=_[_0x110b('0x3f')](db['VoiceContext']['rawAttributes']);_0x1862cf[_0x110b('0x40')]=_[_0x110b('0x3f')](_0x110dc3[_0x110b('0x40')]);_0x1862cf[_0x110b('0x4a')]=_[_0x110b('0x43')](_0x1862cf[_0x110b('0x41')],_0x1862cf[_0x110b('0x40')]);_0x5bd6f9[_0x110b('0x42')]=_['intersection'](_0x1862cf[_0x110b('0x41')],qs[_0x110b('0x44')](_0x110dc3[_0x110b('0x40')]['fields']));_0x5bd6f9[_0x110b('0x42')]=_0x5bd6f9['attributes'][_0x110b('0x45')]?_0x5bd6f9[_0x110b('0x42')]:_0x1862cf[_0x110b('0x41')];if(_0x110dc3[_0x110b('0x40')][_0x110b('0x4e')]){_0x5bd6f9['include']=[{'all':!![]}];}_0x5bd6f9=_[_0x110b('0x4b')]({},_0x5bd6f9,_0x110dc3[_0x110b('0x4d')]);return db[_0x110b('0x3b')]['find'](_0x5bd6f9)[_0x110b('0x1b')](handleEntityNotFound(_0x3eb841,null))['then'](respondWithResult(_0x3eb841,null))['catch'](handleError(_0x3eb841,null));};exports[_0x110b('0x53')]=function(_0x11c0cc,_0x4dc321,_0x1561f1){var _0x33f2f9;return db[_0x110b('0x3b')][_0x110b('0x53')](_0x11c0cc[_0x110b('0x54')],{'raw':!![]})['then'](function(_0xaf6f0b){_0x33f2f9=_0xaf6f0b;return db[_0x110b('0x3b')][_0x110b('0x50')]({'raw':!![]});})['then'](function(_0x16239a){var _0x75a8af=fs[_0x110b('0x55')](path[_0x110b('0x56')](config[_0x110b('0x57')],_0x110b('0x58')),_0x110b('0x59'));var _0x2ebfe5=ejs[_0x110b('0x5a')](_0x75a8af,{'contexts':_0x16239a||[]});fs[_0x110b('0x5b')](_0x110b('0x5c'),_0x2ebfe5);})[_0x110b('0x1b')](function(){return respondWithRpcPromise(_0x110b('0x5d'),_0x110b('0x53'),{'module':_0x110b('0x5e')});})[_0x110b('0x1b')](function(){var _0x509451=_0x11c0cc[_0x110b('0x5f')]['get']({'plain':!![]});if(!_0x509451)throw new Error(_0x110b('0x60'));if(_0x509451[_0x110b('0x61')]==='user'){var _0x2e6980=_0x33f2f9[_0x110b('0x34')]({'plain':!![]});return db['UserProfileSection'][_0x110b('0x62')]({'where':{'name':_0x110b('0x35'),'userProfileId':_0x509451[_0x110b('0x63')]},'raw':!![]})[_0x110b('0x1b')](function(_0x1abca2){if(_0x1abca2&&_0x1abca2[_0x110b('0x64')]===0x0){return db['UserProfileResource'][_0x110b('0x53')]({'name':_0x2e6980[_0x110b('0x38')],'resourceId':_0x2e6980['id'],'type':_0x1abca2[_0x110b('0x38')],'sectionId':_0x1abca2['id']},{})[_0x110b('0x1b')](function(){return _0x33f2f9;});}else{return _0x33f2f9;}})[_0x110b('0x24')](function(_0x170a0f){logger[_0x110b('0x21')](_0x110b('0x65'),_0x170a0f);throw _0x170a0f;});}return _0x33f2f9;})[_0x110b('0x1b')](respondWithResult(_0x4dc321,0xc9))[_0x110b('0x24')](handleError(_0x4dc321,null));};exports[_0x110b('0x32')]=function(_0x57211a,_0x1a0987,_0x541a84){var _0xd5f167;return db[_0x110b('0x3b')]['find']({'where':{'id':_0x57211a['params']['id']}})[_0x110b('0x1b')](handleEntityNotFound(_0x1a0987,null))[_0x110b('0x1b')](saveUpdates(_0x57211a[_0x110b('0x54')],null))[_0x110b('0x1b')](function(_0x4caf74){if(_0x4caf74){_0xd5f167=_0x4caf74;return db[_0x110b('0x3b')]['findAll']({'raw':!![]});}})[_0x110b('0x1b')](function(_0x4a741c){var _0x3acf35=fs[_0x110b('0x55')](path[_0x110b('0x56')](config[_0x110b('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x6e94e6=ejs[_0x110b('0x5a')](_0x3acf35,{'contexts':_0x4a741c||[]});fs['writeFileSync'](_0x110b('0x5c'),_0x6e94e6);})['then'](function(){return respondWithRpcPromise(_0x110b('0x5d'),_0x110b('0x32'),{'module':_0x110b('0x5e')});})[_0x110b('0x1b')](function(){return _0xd5f167;})['then'](respondWithResult(_0x1a0987,null))[_0x110b('0x24')](handleError(_0x1a0987,null));};exports['destroy']=function(_0x3d0b46,_0x5f0bb6,_0x183842){var _0x343e4f;return db[_0x110b('0x3b')][_0x110b('0x62')]({'where':{'id':_0x3d0b46[_0x110b('0x52')]['id']}})[_0x110b('0x1b')](handleEntityNotFound(_0x5f0bb6,null))[_0x110b('0x1b')](removeEntity(_0x5f0bb6,null))[_0x110b('0x1b')](function(){return db[_0x110b('0x3b')][_0x110b('0x50')]({'raw':!![]});})['then'](function(_0x759289){var _0x39bb56=fs['readFileSync'](path[_0x110b('0x56')](config[_0x110b('0x57')],_0x110b('0x58')),_0x110b('0x59'));var _0x4dde0b=ejs[_0x110b('0x5a')](_0x39bb56,{'contexts':_0x759289});fs[_0x110b('0x5b')](_0x110b('0x5c'),_0x4dde0b);return respondWithRpcPromise('Reload',_0x110b('0x33'),{'module':_0x110b('0x5e')});})['catch'](handleError(_0x5f0bb6,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 76d1d5f..93a68ae 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3746=['exports','define','VoiceContext','voice_contexts','lodash','util','api','bluebird','request-promise','../../config/environment','./voiceContext.attributes'];(function(_0x48ffca,_0x352572){var _0x381b96=function(_0x9b2e88){while(--_0x9b2e88){_0x48ffca['push'](_0x48ffca['shift']());}};_0x381b96(++_0x352572);}(_0x3746,0xa9));var _0x6374=function(_0x50a7e1,_0x21d570){_0x50a7e1=_0x50a7e1-0x0;var _0x371b8e=_0x3746[_0x50a7e1];return _0x371b8e;};'use strict';var _=require(_0x6374('0x0'));var util=require(_0x6374('0x1'));var logger=require('../../config/logger')(_0x6374('0x2'));var moment=require('moment');var BPromise=require(_0x6374('0x3'));var rp=require(_0x6374('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6374('0x5'));var attributes=require(_0x6374('0x6'));module[_0x6374('0x7')]=function(_0x3ef994,_0xa74f70){return _0x3ef994[_0x6374('0x8')](_0x6374('0x9'),attributes,{'tableName':_0x6374('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ce2=['bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0x0ce2,0x1ac));var _0x20ce=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0ce2[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x20ce('0x0'));var util=require('util');var logger=require(_0x20ce('0x1'))(_0x20ce('0x2'));var moment=require(_0x20ce('0x3'));var BPromise=require(_0x20ce('0x4'));var rp=require(_0x20ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20ce('0x6'));var config=require(_0x20ce('0x7'));var attributes=require('./voiceContext.attributes');module[_0x20ce('0x8')]=function(_0xc26b5,_0x1702dd){return _0xc26b5[_0x20ce('0x9')](_0x20ce('0xa'),attributes,{'tableName':_0x20ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 281bc29..b7674f4 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf9f=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x39dbc3,_0x5adc70){var _0x28b160=function(_0x5b1e8d){while(--_0x5b1e8d){_0x39dbc3['push'](_0x39dbc3['shift']());}};_0x28b160(++_0x5adc70);}(_0xaf9f,0x1b4));var _0xfaf9=function(_0x4cb231,_0x3d3c5b){_0x4cb231=_0x4cb231-0x0;var _0x4d5063=_0xaf9f[_0x4cb231];return _0x4d5063;};'use strict';var _=require(_0xfaf9('0x0'));var util=require('util');var moment=require(_0xfaf9('0x1'));var BPromise=require(_0xfaf9('0x2'));var rs=require(_0xfaf9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfaf9('0x4'));var logger=require(_0xfaf9('0x5'))(_0xfaf9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfaf9('0x7')][_0xfaf9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44dbe6,_0x7ffdc6,_0x48babf){return new BPromise(function(_0x1bfbf8,_0x4a8b44){return client[_0xfaf9('0x9')](_0x44dbe6,_0x48babf)[_0xfaf9('0xa')](function(_0x958f66){logger[_0xfaf9('0xb')](_0xfaf9('0xc'),_0x7ffdc6,_0xfaf9('0xd'));logger[_0xfaf9('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x7ffdc6,_0xfaf9('0xd'),JSON['stringify'](_0x958f66));if(_0x958f66['error']){if(_0x958f66[_0xfaf9('0xf')][_0xfaf9('0x10')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x7ffdc6,_0x958f66[_0xfaf9('0xf')][_0xfaf9('0x11')]);return _0x4a8b44(_0x958f66['error'][_0xfaf9('0x11')]);}logger['error'](_0xfaf9('0xc'),_0x7ffdc6,_0x958f66['error'][_0xfaf9('0x11')]);return _0x1bfbf8(_0x958f66[_0xfaf9('0xf')][_0xfaf9('0x11')]);}else{logger[_0xfaf9('0xb')](_0xfaf9('0xc'),_0x7ffdc6,_0xfaf9('0xd'));_0x1bfbf8(_0x958f66[_0xfaf9('0x12')][_0xfaf9('0x11')]);}})['catch'](function(_0xdad51e){logger[_0xfaf9('0xf')](_0xfaf9('0xc'),_0x7ffdc6,_0xdad51e);_0x4a8b44(_0xdad51e);});});} \ No newline at end of file +var _0x93b5=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util'];(function(_0x3f695a,_0x49331f){var _0x5d3826=function(_0xc7e7db){while(--_0xc7e7db){_0x3f695a['push'](_0x3f695a['shift']());}};_0x5d3826(++_0x49331f);}(_0x93b5,0x178));var _0x593b=function(_0x417c63,_0x2a0f88){_0x417c63=_0x417c63-0x0;var _0x8cb012=_0x93b5[_0x417c63];return _0x8cb012;};'use strict';var _=require(_0x593b('0x0'));var util=require(_0x593b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x593b('0x2'));var fs=require('fs');var Redis=require(_0x593b('0x3'));var db=require(_0x593b('0x4'))['db'];var utils=require(_0x593b('0x5'));var logger=require('../../config/logger')(_0x593b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x593b('0x7')][_0x593b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c2f6a,_0x11f366,_0x1ba963){return new BPromise(function(_0x5dddbc,_0x53dddf){return client[_0x593b('0x9')](_0x3c2f6a,_0x1ba963)['then'](function(_0x3b3b28){logger[_0x593b('0xa')](_0x593b('0xb'),_0x11f366,_0x593b('0xc'));logger[_0x593b('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x11f366,_0x593b('0xc'),JSON['stringify'](_0x3b3b28));if(_0x3b3b28[_0x593b('0xe')]){if(_0x3b3b28[_0x593b('0xe')]['code']===0x1f4){logger[_0x593b('0xe')](_0x593b('0xb'),_0x11f366,_0x3b3b28[_0x593b('0xe')][_0x593b('0xf')]);return _0x53dddf(_0x3b3b28[_0x593b('0xe')]['message']);}logger[_0x593b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x11f366,_0x3b3b28[_0x593b('0xe')][_0x593b('0xf')]);return _0x5dddbc(_0x3b3b28[_0x593b('0xe')][_0x593b('0xf')]);}else{logger[_0x593b('0xa')]('VoiceContext,\x20%s,\x20%s',_0x11f366,_0x593b('0xc'));_0x5dddbc(_0x3b3b28[_0x593b('0x10')]['message']);}})[_0x593b('0x11')](function(_0x146e1f){logger[_0x593b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x11f366,_0x146e1f);_0x53dddf(_0x146e1f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e50445b..74e39e9 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb885=['fs-extra','../../config/environment','./voiceDialReport.controller','isAuthenticated','/describe','describe','get','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x1199de,_0x5b7f57){var _0x51e67f=function(_0xc343fb){while(--_0xc343fb){_0x1199de['push'](_0x1199de['shift']());}};_0x51e67f(++_0x5b7f57);}(_0xb885,0x7a));var _0x5b88=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0xb885[_0x296923];return _0x29af70;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b88('0x0'));var timeout=require(_0x5b88('0x1'));var express=require(_0x5b88('0x2'));var router=express[_0x5b88('0x3')]();var fs_extra=require(_0x5b88('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b88('0x5'));var controller=require(_0x5b88('0x6'));router['get']('/',auth[_0x5b88('0x7')](),controller['index']);router['get'](_0x5b88('0x8'),auth['isAuthenticated'](),controller[_0x5b88('0x9')]);router[_0x5b88('0xa')](_0x5b88('0xb'),auth[_0x5b88('0x7')](),controller['show']);router[_0x5b88('0xc')]('/',auth[_0x5b88('0x7')](),controller[_0x5b88('0xd')]);router[_0x5b88('0xe')]('/:id',auth[_0x5b88('0x7')](),controller[_0x5b88('0xf')]);router[_0x5b88('0x10')](_0x5b88('0xb'),auth[_0x5b88('0x7')](),controller[_0x5b88('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3d4e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20994f,_0x3b8ce7){var _0x20a9bd=function(_0x159b52){while(--_0x159b52){_0x20994f['push'](_0x20994f['shift']());}};_0x20a9bd(++_0x3b8ce7);}(_0x3d4e,0x1dd));var _0xe3d4=function(_0x1c75d4,_0x1b6e9b){_0x1c75d4=_0x1c75d4-0x0;var _0xa8e13=_0x3d4e[_0x1c75d4];return _0xa8e13;};'use strict';var multer=require(_0xe3d4('0x0'));var util=require(_0xe3d4('0x1'));var path=require(_0xe3d4('0x2'));var timeout=require(_0xe3d4('0x3'));var express=require(_0xe3d4('0x4'));var router=express[_0xe3d4('0x5')]();var fs_extra=require(_0xe3d4('0x6'));var auth=require(_0xe3d4('0x7'));var interaction=require(_0xe3d4('0x8'));var config=require(_0xe3d4('0x9'));var controller=require(_0xe3d4('0xa'));router['get']('/',auth[_0xe3d4('0xb')](),controller[_0xe3d4('0xc')]);router['get'](_0xe3d4('0xd'),auth[_0xe3d4('0xb')](),controller[_0xe3d4('0xe')]);router[_0xe3d4('0xf')](_0xe3d4('0x10'),auth['isAuthenticated'](),controller[_0xe3d4('0x11')]);router[_0xe3d4('0x12')]('/',auth[_0xe3d4('0xb')](),controller['create']);router[_0xe3d4('0x13')](_0xe3d4('0x10'),auth['isAuthenticated'](),controller[_0xe3d4('0x14')]);router['delete'](_0xe3d4('0x10'),auth['isAuthenticated'](),controller[_0xe3d4('0x15')]);module[_0xe3d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 628843b..6a1cc37 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x14a65b,_0x5dbda2){var _0x4d0078=function(_0x4ff288){while(--_0x4ff288){_0x14a65b['push'](_0x14a65b['shift']());}};_0x4d0078(++_0x5dbda2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x25d1d6,_0x5c17c0){_0x25d1d6=_0x25d1d6-0x0;var _0x419592=_0x8d0e[_0x25d1d6];return _0x419592;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x55af6a,_0x10761d){var _0xe88643=function(_0x2699a6){while(--_0x2699a6){_0x55af6a['push'](_0x55af6a['shift']());}};_0xe88643(++_0x10761d);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fb043,_0x5a3da3){_0x1fb043=_0x1fb043-0x0;var _0x596ebd=_0xedd9[_0x1fb043];return _0x596ebd;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 1e9863f..3c40ece 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x661a=['sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','name','send','index','VoiceDialReport','rawAttributes','fieldName','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x141988,_0x250162){var _0xbe0ec2=function(_0x416408){while(--_0x416408){_0x141988['push'](_0x141988['shift']());}};_0xbe0ec2(++_0x250162);}(_0x661a,0x105));var _0xa661=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0x661a[_0x591cfd];return _0x4d0100;};'use strict';var emlformat=require(_0xa661('0x0'));var rimraf=require(_0xa661('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa661('0x2'));var rp=require(_0xa661('0x3'));var moment=require(_0xa661('0x4'));var BPromise=require(_0xa661('0x5'));var Mustache=require(_0xa661('0x6'));var util=require('util');var path=require(_0xa661('0x7'));var sox=require('sox');var csv=require(_0xa661('0x8'));var ejs=require(_0xa661('0x9'));var fs=require('fs');var fs_extra=require(_0xa661('0xa'));var _=require(_0xa661('0xb'));var squel=require(_0xa661('0xc'));var crypto=require(_0xa661('0xd'));var jsforce=require(_0xa661('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa661('0x8'));var querystring=require(_0xa661('0xf'));var Papa=require('papaparse');var Redis=require(_0xa661('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa661('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa661('0x12'));var logger=require(_0xa661('0x13'))('api');var utils=require(_0xa661('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa661('0x15'));var db=require(_0xa661('0x16'))['db'];function respondWithStatusCode(_0x3fab17,_0x4d4439){_0x4d4439=_0x4d4439||0xcc;return function(_0x2195a6){if(_0x2195a6){return _0x3fab17[_0xa661('0x17')](_0x4d4439);}return _0x3fab17[_0xa661('0x18')](_0x4d4439)[_0xa661('0x19')]();};}function respondWithResult(_0xf4b980,_0x11f8e4){_0x11f8e4=_0x11f8e4||0xc8;return function(_0x813553){if(_0x813553){return _0xf4b980[_0xa661('0x18')](_0x11f8e4)[_0xa661('0x1a')](_0x813553);}};}function respondWithFilteredResult(_0x38c9a2,_0x490a38){return function(_0x32605f){if(_0x32605f){var _0x122391=typeof _0x490a38[_0xa661('0x1b')]===_0xa661('0x1c')&&typeof _0x490a38['limit']===_0xa661('0x1c');var _0x436198=_0x32605f[_0xa661('0x1d')];var _0x2fdc7f=_0x122391?0x0:_0x490a38['offset'];var _0x43961f=_0x122391?_0x32605f[_0xa661('0x1d')]:_0x490a38[_0xa661('0x1b')]+_0x490a38[_0xa661('0x1e')];var _0x2b1daf;if(_0x43961f>=_0x436198){_0x43961f=_0x436198;_0x2b1daf=0xc8;}else{_0x2b1daf=0xce;}_0x38c9a2[_0xa661('0x18')](_0x2b1daf);return _0x38c9a2['set'](_0xa661('0x1f'),_0x2fdc7f+'-'+_0x43961f+'/'+_0x436198)[_0xa661('0x1a')](_0x32605f);}return null;};}function patchUpdates(_0x3cf5e0){return function(_0x8b8ca2){try{jsonpatch[_0xa661('0x20')](_0x8b8ca2,_0x3cf5e0,!![]);}catch(_0x1b5474){return BPromise[_0xa661('0x21')](_0x1b5474);}return _0x8b8ca2[_0xa661('0x22')]();};}function saveUpdates(_0x24ed30,_0x95db6b){return function(_0x14de87){if(_0x14de87){return _0x14de87['update'](_0x24ed30)['then'](function(_0x27762d){return _0x27762d;});}return null;};}function removeEntity(_0x116002,_0x444cdc){return function(_0x15139b){if(_0x15139b){return _0x15139b[_0xa661('0x23')]()[_0xa661('0x24')](function(){_0x116002[_0xa661('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6de3b9,_0x516b3e){return function(_0x39bfc6){if(!_0x39bfc6){_0x6de3b9[_0xa661('0x17')](0x194);}return _0x39bfc6;};}function handleError(_0x816cb7,_0xf6092b){_0xf6092b=_0xf6092b||0x1f4;return function(_0x4c03ee){logger['error'](_0x4c03ee['stack']);if(_0x4c03ee[_0xa661('0x25')]){delete _0x4c03ee[_0xa661('0x25')];}_0x816cb7[_0xa661('0x18')](_0xf6092b)[_0xa661('0x26')](_0x4c03ee);};}exports[_0xa661('0x27')]=function(_0x49eb51,_0x39b369){var _0x44a2b9={},_0x45a8e8={},_0x3fffce={'count':0x0,'rows':[]};var _0x1c4853=_['map'](db[_0xa661('0x28')][_0xa661('0x29')],function(_0x1b8513){return{'name':_0x1b8513[_0xa661('0x2a')],'type':_0x1b8513['type'][_0xa661('0x2b')]};});_0x45a8e8[_0xa661('0x2c')]=_[_0xa661('0x2d')](_0x1c4853,'name');_0x45a8e8['query']=_['keys'](_0x49eb51['query']);_0x45a8e8[_0xa661('0x2e')]=_[_0xa661('0x2f')](_0x45a8e8[_0xa661('0x2c')],_0x45a8e8[_0xa661('0x30')]);_0x44a2b9[_0xa661('0x31')]=_['intersection'](_0x45a8e8[_0xa661('0x2c')],qs[_0xa661('0x32')](_0x49eb51['query'][_0xa661('0x32')]));_0x44a2b9[_0xa661('0x31')]=_0x44a2b9[_0xa661('0x31')][_0xa661('0x33')]?_0x44a2b9[_0xa661('0x31')]:_0x45a8e8[_0xa661('0x2c')];if(!_0x49eb51[_0xa661('0x30')][_0xa661('0x34')]('nolimit')){_0x44a2b9['limit']=qs[_0xa661('0x1e')](_0x49eb51[_0xa661('0x30')][_0xa661('0x1e')]);_0x44a2b9[_0xa661('0x1b')]=qs['offset'](_0x49eb51[_0xa661('0x30')][_0xa661('0x1b')]);}_0x44a2b9[_0xa661('0x35')]=qs[_0xa661('0x36')](_0x49eb51[_0xa661('0x30')][_0xa661('0x36')]);_0x44a2b9[_0xa661('0x37')]=qs['filters'](_[_0xa661('0x38')](_0x49eb51['query'],_0x45a8e8[_0xa661('0x2e')]),_0x1c4853);if(_0x49eb51['query'][_0xa661('0x39')]){_0x44a2b9[_0xa661('0x37')]=_[_0xa661('0x3a')](_0x44a2b9[_0xa661('0x37')],{'$or':_['map'](_0x1c4853,function(_0x2b5e14){if(_0x2b5e14['type']!==_0xa661('0x3b')){var _0x24fd06={};_0x24fd06[_0x2b5e14[_0xa661('0x25')]]={'$like':'%'+_0x49eb51[_0xa661('0x30')]['filter']+'%'};return _0x24fd06;}})});}_0x44a2b9=_[_0xa661('0x3a')]({},_0x44a2b9,_0x49eb51['options']);var _0xd5d4e={'where':_0x44a2b9[_0xa661('0x37')]};return db[_0xa661('0x28')][_0xa661('0x1d')](_0xd5d4e)['then'](function(_0x25061d){_0x3fffce[_0xa661('0x1d')]=_0x25061d;if(_0x49eb51[_0xa661('0x30')][_0xa661('0x3c')]){_0x44a2b9[_0xa661('0x3d')]=[{'all':!![]}];}return db[_0xa661('0x28')][_0xa661('0x3e')](_0x44a2b9);})[_0xa661('0x24')](function(_0xce25e8){_0x3fffce[_0xa661('0x3f')]=_0xce25e8;return _0x3fffce;})['then'](respondWithFilteredResult(_0x39b369,_0x44a2b9))[_0xa661('0x40')](handleError(_0x39b369,null));};exports['show']=function(_0x25eecc,_0x4c78ca){var _0x5494b9={'raw':!![],'where':{'id':_0x25eecc[_0xa661('0x41')]['id']}},_0xca9b29={};_0xca9b29[_0xa661('0x2c')]=_['keys'](db['VoiceDialReport'][_0xa661('0x29')]);_0xca9b29[_0xa661('0x30')]=_['keys'](_0x25eecc[_0xa661('0x30')]);_0xca9b29[_0xa661('0x2e')]=_[_0xa661('0x2f')](_0xca9b29[_0xa661('0x2c')],_0xca9b29['query']);_0x5494b9[_0xa661('0x31')]=_[_0xa661('0x2f')](_0xca9b29[_0xa661('0x2c')],qs[_0xa661('0x32')](_0x25eecc[_0xa661('0x30')]['fields']));_0x5494b9['attributes']=_0x5494b9[_0xa661('0x31')][_0xa661('0x33')]?_0x5494b9['attributes']:_0xca9b29[_0xa661('0x2c')];if(_0x25eecc[_0xa661('0x30')][_0xa661('0x3c')]){_0x5494b9[_0xa661('0x3d')]=[{'all':!![]}];}_0x5494b9=_['merge']({},_0x5494b9,_0x25eecc['options']);return db[_0xa661('0x28')][_0xa661('0x42')](_0x5494b9)['then'](handleEntityNotFound(_0x4c78ca,null))[_0xa661('0x24')](respondWithResult(_0x4c78ca,null))[_0xa661('0x40')](handleError(_0x4c78ca,null));};exports[_0xa661('0x43')]=function(_0x4e0d4f,_0x3980c9){return db[_0xa661('0x28')][_0xa661('0x43')](_0x4e0d4f[_0xa661('0x44')],{})[_0xa661('0x24')](respondWithResult(_0x3980c9,0xc9))['catch'](handleError(_0x3980c9,null));};exports[_0xa661('0x45')]=function(_0xa1df38,_0x43c0ce){if(_0xa1df38[_0xa661('0x44')]['id']){delete _0xa1df38[_0xa661('0x44')]['id'];}return db[_0xa661('0x28')][_0xa661('0x42')]({'where':{'id':_0xa1df38[_0xa661('0x41')]['id']}})['then'](handleEntityNotFound(_0x43c0ce,null))['then'](saveUpdates(_0xa1df38['body'],null))[_0xa661('0x24')](respondWithResult(_0x43c0ce,null))[_0xa661('0x40')](handleError(_0x43c0ce,null));};exports[_0xa661('0x23')]=function(_0x58a03d,_0x403eca){return db[_0xa661('0x28')]['find']({'where':{'id':_0x58a03d[_0xa661('0x41')]['id']}})[_0xa661('0x24')](handleEntityNotFound(_0x403eca,null))['then'](removeEntity(_0x403eca,null))[_0xa661('0x40')](handleError(_0x403eca,null));};exports[_0xa661('0x46')]=function(_0x58e6c4,_0x2a57a7){return db['VoiceDialReport'][_0xa661('0x46')]()[_0xa661('0x24')](respondWithResult(_0x2a57a7,null))['catch'](handleError(_0x2a57a7,null));}; \ No newline at end of file +var _0xcebd=['reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','show','params','merge','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','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/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x49958d,_0x5148f8){var _0x2ff70a=function(_0x5c7ca7){while(--_0x5c7ca7){_0x49958d['push'](_0x49958d['shift']());}};_0x2ff70a(++_0x5148f8);}(_0xcebd,0x74));var _0xdceb=function(_0x32fb63,_0x247431){_0x32fb63=_0x32fb63-0x0;var _0x280b12=_0xcebd[_0x32fb63];return _0x280b12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdceb('0x0'));var zipdir=require(_0xdceb('0x1'));var jsonpatch=require(_0xdceb('0x2'));var rp=require('request-promise');var moment=require(_0xdceb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdceb('0x4'));var sox=require(_0xdceb('0x5'));var csv=require(_0xdceb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdceb('0x7'));var _=require(_0xdceb('0x8'));var squel=require(_0xdceb('0x9'));var crypto=require(_0xdceb('0xa'));var jsforce=require(_0xdceb('0xb'));var deskjs=require(_0xdceb('0xc'));var toCsv=require(_0xdceb('0x6'));var querystring=require(_0xdceb('0xd'));var Papa=require(_0xdceb('0xe'));var Redis=require(_0xdceb('0xf'));var authService=require(_0xdceb('0x10'));var qs=require(_0xdceb('0x11'));var as=require(_0xdceb('0x12'));var hardwareService=require(_0xdceb('0x13'));var logger=require('../../config/logger')(_0xdceb('0x14'));var utils=require('../../config/utils');var config=require(_0xdceb('0x15'));var licenseUtil=require(_0xdceb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dc5fc,_0x5c187e){_0x5c187e=_0x5c187e||0xcc;return function(_0xdcd9eb){if(_0xdcd9eb){return _0x1dc5fc[_0xdceb('0x17')](_0x5c187e);}return _0x1dc5fc[_0xdceb('0x18')](_0x5c187e)['end']();};}function respondWithResult(_0x348bbc,_0x3cb98e){_0x3cb98e=_0x3cb98e||0xc8;return function(_0x31e733){if(_0x31e733){return _0x348bbc[_0xdceb('0x18')](_0x3cb98e)[_0xdceb('0x19')](_0x31e733);}};}function respondWithFilteredResult(_0x31a4a6,_0x4accd9){return function(_0xebf255){if(_0xebf255){var _0x5d6cb5=typeof _0x4accd9['offset']===_0xdceb('0x1a')&&typeof _0x4accd9[_0xdceb('0x1b')]===_0xdceb('0x1a');var _0x401582=_0xebf255[_0xdceb('0x1c')];var _0x4a4980=_0x5d6cb5?0x0:_0x4accd9[_0xdceb('0x1d')];var _0x4c723e=_0x5d6cb5?_0xebf255[_0xdceb('0x1c')]:_0x4accd9[_0xdceb('0x1d')]+_0x4accd9[_0xdceb('0x1b')];var _0x503b85;if(_0x4c723e>=_0x401582){_0x4c723e=_0x401582;_0x503b85=0xc8;}else{_0x503b85=0xce;}_0x31a4a6[_0xdceb('0x18')](_0x503b85);return _0x31a4a6['set'](_0xdceb('0x1e'),_0x4a4980+'-'+_0x4c723e+'/'+_0x401582)['json'](_0xebf255);}return null;};}function patchUpdates(_0x304ba7){return function(_0x32dc3c){try{jsonpatch[_0xdceb('0x1f')](_0x32dc3c,_0x304ba7,!![]);}catch(_0x31431d){return BPromise[_0xdceb('0x20')](_0x31431d);}return _0x32dc3c[_0xdceb('0x21')]();};}function saveUpdates(_0xfab46,_0x5cef6e){return function(_0x3db4b0){if(_0x3db4b0){return _0x3db4b0[_0xdceb('0x22')](_0xfab46)[_0xdceb('0x23')](function(_0x26f3ac){return _0x26f3ac;});}return null;};}function removeEntity(_0x158a8a,_0x14852a){return function(_0x229e17){if(_0x229e17){return _0x229e17[_0xdceb('0x24')]()[_0xdceb('0x23')](function(){_0x158a8a[_0xdceb('0x18')](0xcc)[_0xdceb('0x25')]();});}};}function handleEntityNotFound(_0x106f90,_0x1ba2be){return function(_0x30d3d3){if(!_0x30d3d3){_0x106f90['sendStatus'](0x194);}return _0x30d3d3;};}function handleError(_0x1e8598,_0x115e7c){_0x115e7c=_0x115e7c||0x1f4;return function(_0x4b33ef){logger[_0xdceb('0x26')](_0x4b33ef[_0xdceb('0x27')]);if(_0x4b33ef[_0xdceb('0x28')]){delete _0x4b33ef[_0xdceb('0x28')];}_0x1e8598[_0xdceb('0x18')](_0x115e7c)['send'](_0x4b33ef);};}exports[_0xdceb('0x29')]=function(_0x15820b,_0x30232d){var _0x546a62={},_0x270a64={},_0x2d3608={'count':0x0,'rows':[]};var _0x9d3457=_[_0xdceb('0x2a')](db['VoiceDialReport'][_0xdceb('0x2b')],function(_0x3bab1b){return{'name':_0x3bab1b[_0xdceb('0x2c')],'type':_0x3bab1b['type']['key']};});_0x270a64['model']=_[_0xdceb('0x2a')](_0x9d3457,_0xdceb('0x28'));_0x270a64['query']=_[_0xdceb('0x2d')](_0x15820b[_0xdceb('0x2e')]);_0x270a64[_0xdceb('0x2f')]=_[_0xdceb('0x30')](_0x270a64[_0xdceb('0x31')],_0x270a64[_0xdceb('0x2e')]);_0x546a62[_0xdceb('0x32')]=_['intersection'](_0x270a64[_0xdceb('0x31')],qs[_0xdceb('0x33')](_0x15820b[_0xdceb('0x2e')][_0xdceb('0x33')]));_0x546a62[_0xdceb('0x32')]=_0x546a62[_0xdceb('0x32')][_0xdceb('0x34')]?_0x546a62['attributes']:_0x270a64[_0xdceb('0x31')];if(!_0x15820b[_0xdceb('0x2e')][_0xdceb('0x35')]('nolimit')){_0x546a62[_0xdceb('0x1b')]=qs[_0xdceb('0x1b')](_0x15820b[_0xdceb('0x2e')][_0xdceb('0x1b')]);_0x546a62[_0xdceb('0x1d')]=qs[_0xdceb('0x1d')](_0x15820b[_0xdceb('0x2e')]['offset']);}_0x546a62[_0xdceb('0x36')]=qs['sort'](_0x15820b[_0xdceb('0x2e')][_0xdceb('0x37')]);_0x546a62[_0xdceb('0x38')]=qs[_0xdceb('0x2f')](_[_0xdceb('0x39')](_0x15820b[_0xdceb('0x2e')],_0x270a64[_0xdceb('0x2f')]),_0x9d3457);if(_0x15820b[_0xdceb('0x2e')][_0xdceb('0x3a')]){_0x546a62[_0xdceb('0x38')]=_['merge'](_0x546a62[_0xdceb('0x38')],{'$or':_[_0xdceb('0x2a')](_0x9d3457,function(_0x901efb){if(_0x901efb['type']!==_0xdceb('0x3b')){var _0x50dcb9={};_0x50dcb9[_0x901efb[_0xdceb('0x28')]]={'$like':'%'+_0x15820b[_0xdceb('0x2e')][_0xdceb('0x3a')]+'%'};return _0x50dcb9;}})});}_0x546a62=_['merge']({},_0x546a62,_0x15820b[_0xdceb('0x3c')]);var _0xff8ac6={'where':_0x546a62['where']};return db[_0xdceb('0x3d')][_0xdceb('0x1c')](_0xff8ac6)[_0xdceb('0x23')](function(_0x54f03e){_0x2d3608[_0xdceb('0x1c')]=_0x54f03e;if(_0x15820b[_0xdceb('0x2e')][_0xdceb('0x3e')]){_0x546a62[_0xdceb('0x3f')]=[{'all':!![]}];}return db[_0xdceb('0x3d')][_0xdceb('0x40')](_0x546a62);})[_0xdceb('0x23')](function(_0x26da18){_0x2d3608[_0xdceb('0x41')]=_0x26da18;return _0x2d3608;})['then'](respondWithFilteredResult(_0x30232d,_0x546a62))['catch'](handleError(_0x30232d,null));};exports[_0xdceb('0x42')]=function(_0x3e9ce,_0x171828){var _0x375afb={'raw':!![],'where':{'id':_0x3e9ce[_0xdceb('0x43')]['id']}},_0x3b5397={};_0x3b5397[_0xdceb('0x31')]=_[_0xdceb('0x2d')](db[_0xdceb('0x3d')][_0xdceb('0x2b')]);_0x3b5397[_0xdceb('0x2e')]=_[_0xdceb('0x2d')](_0x3e9ce['query']);_0x3b5397[_0xdceb('0x2f')]=_[_0xdceb('0x30')](_0x3b5397[_0xdceb('0x31')],_0x3b5397[_0xdceb('0x2e')]);_0x375afb['attributes']=_['intersection'](_0x3b5397[_0xdceb('0x31')],qs['fields'](_0x3e9ce[_0xdceb('0x2e')][_0xdceb('0x33')]));_0x375afb[_0xdceb('0x32')]=_0x375afb[_0xdceb('0x32')][_0xdceb('0x34')]?_0x375afb['attributes']:_0x3b5397['model'];if(_0x3e9ce['query'][_0xdceb('0x3e')]){_0x375afb['include']=[{'all':!![]}];}_0x375afb=_[_0xdceb('0x44')]({},_0x375afb,_0x3e9ce[_0xdceb('0x3c')]);return db[_0xdceb('0x3d')][_0xdceb('0x45')](_0x375afb)[_0xdceb('0x23')](handleEntityNotFound(_0x171828,null))[_0xdceb('0x23')](respondWithResult(_0x171828,null))['catch'](handleError(_0x171828,null));};exports[_0xdceb('0x46')]=function(_0x188dcd,_0x213a9b){return db['VoiceDialReport'][_0xdceb('0x46')](_0x188dcd[_0xdceb('0x47')],{})[_0xdceb('0x23')](respondWithResult(_0x213a9b,0xc9))['catch'](handleError(_0x213a9b,null));};exports[_0xdceb('0x22')]=function(_0x8d0201,_0x3386a6){if(_0x8d0201['body']['id']){delete _0x8d0201[_0xdceb('0x47')]['id'];}return db[_0xdceb('0x3d')][_0xdceb('0x45')]({'where':{'id':_0x8d0201['params']['id']}})[_0xdceb('0x23')](handleEntityNotFound(_0x3386a6,null))[_0xdceb('0x23')](saveUpdates(_0x8d0201[_0xdceb('0x47')],null))[_0xdceb('0x23')](respondWithResult(_0x3386a6,null))[_0xdceb('0x48')](handleError(_0x3386a6,null));};exports['destroy']=function(_0x20bcf7,_0x39cf15){return db['VoiceDialReport'][_0xdceb('0x45')]({'where':{'id':_0x20bcf7[_0xdceb('0x43')]['id']}})['then'](handleEntityNotFound(_0x39cf15,null))['then'](removeEntity(_0x39cf15,null))[_0xdceb('0x48')](handleError(_0x39cf15,null));};exports[_0xdceb('0x49')]=function(_0x37e93f,_0x355042){return db[_0xdceb('0x3d')][_0xdceb('0x49')]()[_0xdceb('0x23')](respondWithResult(_0x355042,null))[_0xdceb('0x48')](handleError(_0x355042,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index dd668f9..d4b7cbf 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1196=['../../config/environment','exports','define','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x276232,_0x20b6b8){var _0x427024=function(_0x2e7ff8){while(--_0x2e7ff8){_0x276232['push'](_0x276232['shift']());}};_0x427024(++_0x20b6b8);}(_0x1196,0x156));var _0x6119=function(_0x237e58,_0x506829){_0x237e58=_0x237e58-0x0;var _0x16256c=_0x1196[_0x237e58];return _0x16256c;};'use strict';var _=require(_0x6119('0x0'));var util=require(_0x6119('0x1'));var logger=require(_0x6119('0x2'))(_0x6119('0x3'));var moment=require(_0x6119('0x4'));var BPromise=require(_0x6119('0x5'));var rp=require(_0x6119('0x6'));var fs=require('fs');var path=require(_0x6119('0x7'));var rimraf=require(_0x6119('0x8'));var config=require(_0x6119('0x9'));var attributes=require('./voiceDialReport.attributes');module[_0x6119('0xa')]=function(_0x58c18c,_0x2376ed){return _0x58c18c[_0x6119('0xb')](_0x6119('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x21d1=['bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x45d016,_0x36bdb1){var _0x54803a=function(_0x2e313b){while(--_0x2e313b){_0x45d016['push'](_0x45d016['shift']());}};_0x54803a(++_0x36bdb1);}(_0x21d1,0x1c9));var _0x121d=function(_0x20cb55,_0x52e833){_0x20cb55=_0x20cb55-0x0;var _0x3c9e11=_0x21d1[_0x20cb55];return _0x3c9e11;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var logger=require(_0x121d('0x2'))(_0x121d('0x3'));var moment=require(_0x121d('0x4'));var BPromise=require(_0x121d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var attributes=require(_0x121d('0x8'));module[_0x121d('0x9')]=function(_0x2f3987,_0x4c47ee){return _0x2f3987[_0x121d('0xa')](_0x121d('0xb'),attributes,{'tableName':_0x121d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x121d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1f6d615..74300a9 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a7a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','where','attributes','debug','util','moment','bluebird','randomstring','ioredis'];(function(_0x19faae,_0x5697bc){var _0x363543=function(_0x3434e2){while(--_0x3434e2){_0x19faae['push'](_0x19faae['shift']());}};_0x363543(++_0x5697bc);}(_0x8a7a,0x1b5));var _0xa8a7=function(_0x42fc87,_0x29e601){_0x42fc87=_0x42fc87-0x0;var _0x35c431=_0x8a7a[_0x42fc87];return _0x35c431;};'use strict';var _=require('lodash');var util=require(_0xa8a7('0x0'));var moment=require(_0xa8a7('0x1'));var BPromise=require(_0xa8a7('0x2'));var rs=require(_0xa8a7('0x3'));var fs=require('fs');var Redis=require(_0xa8a7('0x4'));var db=require(_0xa8a7('0x5'))['db'];var utils=require(_0xa8a7('0x6'));var logger=require(_0xa8a7('0x7'))(_0xa8a7('0x8'));var config=require(_0xa8a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8a7('0xa')][_0xa8a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaf8ff5,_0x16d54f,_0x3a1d9d){return new BPromise(function(_0x34ba30,_0x5573f7){return client[_0xa8a7('0xc')](_0xaf8ff5,_0x3a1d9d)[_0xa8a7('0xd')](function(_0x381a4c){logger[_0xa8a7('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x16d54f,_0xa8a7('0xf'));logger['debug'](_0xa8a7('0x10'),_0x16d54f,_0xa8a7('0xf'),JSON[_0xa8a7('0x11')](_0x381a4c));if(_0x381a4c['error']){if(_0x381a4c[_0xa8a7('0x12')][_0xa8a7('0x13')]===0x1f4){logger[_0xa8a7('0x12')](_0xa8a7('0x14'),_0x16d54f,_0x381a4c['error'][_0xa8a7('0x15')]);return _0x5573f7(_0x381a4c[_0xa8a7('0x12')][_0xa8a7('0x15')]);}logger['error'](_0xa8a7('0x14'),_0x16d54f,_0x381a4c[_0xa8a7('0x12')][_0xa8a7('0x15')]);return _0x34ba30(_0x381a4c[_0xa8a7('0x12')][_0xa8a7('0x15')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x16d54f,_0xa8a7('0xf'));_0x34ba30(_0x381a4c[_0xa8a7('0x16')][_0xa8a7('0x15')]);}})[_0xa8a7('0x17')](function(_0x5391a5){logger[_0xa8a7('0x12')](_0xa8a7('0x14'),_0x16d54f,_0x5391a5);_0x5573f7(_0x5391a5);});});}exports[_0xa8a7('0x18')]=function(_0x10a35f){var _0x9c8159=this;return new Promise(function(_0x3d1cca,_0x34d141){return db[_0xa8a7('0x19')]['create'](_0x10a35f[_0xa8a7('0x1a')],{'raw':_0x10a35f[_0xa8a7('0x1b')]?_0x10a35f[_0xa8a7('0x1b')][_0xa8a7('0x1c')]===undefined?!![]:![]:!![]})[_0xa8a7('0xd')](function(_0x51e205){logger[_0xa8a7('0xe')](_0xa8a7('0x18'),_0x10a35f);logger['debug'](_0xa8a7('0x18'),_0x10a35f,JSON[_0xa8a7('0x11')](_0x51e205));_0x3d1cca(_0x51e205);})[_0xa8a7('0x17')](function(_0x28de0d){logger[_0xa8a7('0x12')](_0xa8a7('0x18'),_0x28de0d['message'],_0x10a35f);_0x34d141(_0x9c8159[_0xa8a7('0x12')](0x1f4,_0x28de0d[_0xa8a7('0x15')]));});});};exports[_0xa8a7('0x1d')]=function(_0x42160d){var _0x2459a7=this;return new Promise(function(_0x565c8e,_0x124e83){return db[_0xa8a7('0x19')][_0xa8a7('0x1e')](_0x42160d['body'],{'raw':_0x42160d[_0xa8a7('0x1b')]?_0x42160d[_0xa8a7('0x1b')][_0xa8a7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42160d['options']?_0x42160d['options'][_0xa8a7('0x1f')]||null:null,'attributes':_0x42160d[_0xa8a7('0x1b')]?_0x42160d[_0xa8a7('0x1b')][_0xa8a7('0x20')]||null:null,'limit':_0x42160d[_0xa8a7('0x1b')]?_0x42160d['options']['limit']||null:null})['then'](function(_0x2476ab){logger[_0xa8a7('0xe')](_0xa8a7('0x1d'),_0x42160d);logger[_0xa8a7('0x21')](_0xa8a7('0x1d'),_0x42160d,JSON['stringify'](_0x2476ab));_0x565c8e(_0x2476ab);})[_0xa8a7('0x17')](function(_0x445dc9){logger['error'](_0xa8a7('0x1d'),_0x445dc9[_0xa8a7('0x15')],_0x42160d);_0x124e83(_0x2459a7['error'](0x1f4,_0x445dc9['message']));});});}; \ No newline at end of file +var _0x36c6=['where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update'];(function(_0xd622d4,_0x1562bc){var _0x110339=function(_0x26371b){while(--_0x26371b){_0xd622d4['push'](_0xd622d4['shift']());}};_0x110339(++_0x1562bc);}(_0x36c6,0x123));var _0x636c=function(_0x126d1e,_0x2d08bc){_0x126d1e=_0x126d1e-0x0;var _0x3270d4=_0x36c6[_0x126d1e];return _0x3270d4;};'use strict';var _=require('lodash');var util=require(_0x636c('0x0'));var moment=require(_0x636c('0x1'));var BPromise=require(_0x636c('0x2'));var rs=require(_0x636c('0x3'));var fs=require('fs');var Redis=require(_0x636c('0x4'));var db=require(_0x636c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x636c('0x6'))('rpc');var config=require(_0x636c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x636c('0x8')][_0x636c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe374b1,_0x436938,_0x58a021){return new BPromise(function(_0x2d620e,_0x5de874){return client[_0x636c('0xa')](_0xe374b1,_0x58a021)[_0x636c('0xb')](function(_0xf57a64){logger[_0x636c('0xc')](_0x636c('0xd'),_0x436938,_0x636c('0xe'));logger[_0x636c('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x436938,_0x636c('0xe'),JSON[_0x636c('0x10')](_0xf57a64));if(_0xf57a64[_0x636c('0x11')]){if(_0xf57a64[_0x636c('0x11')][_0x636c('0x12')]===0x1f4){logger[_0x636c('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x436938,_0xf57a64[_0x636c('0x11')][_0x636c('0x13')]);return _0x5de874(_0xf57a64['error'][_0x636c('0x13')]);}logger[_0x636c('0x11')](_0x636c('0xd'),_0x436938,_0xf57a64['error'][_0x636c('0x13')]);return _0x2d620e(_0xf57a64[_0x636c('0x11')][_0x636c('0x13')]);}else{logger[_0x636c('0xc')](_0x636c('0xd'),_0x436938,_0x636c('0xe'));_0x2d620e(_0xf57a64[_0x636c('0x14')][_0x636c('0x13')]);}})[_0x636c('0x15')](function(_0x457808){logger[_0x636c('0x11')](_0x636c('0xd'),_0x436938,_0x457808);_0x5de874(_0x457808);});});}exports['CreateVoiceDialReport']=function(_0x3ec20a){var _0x399ae9=this;return new Promise(function(_0x4efc4b,_0x45451b){return db['VoiceDialReport']['create'](_0x3ec20a[_0x636c('0x16')],{'raw':_0x3ec20a[_0x636c('0x17')]?_0x3ec20a[_0x636c('0x17')][_0x636c('0x18')]===undefined?!![]:![]:!![]})[_0x636c('0xb')](function(_0x1fd289){logger[_0x636c('0xc')](_0x636c('0x19'),_0x3ec20a);logger[_0x636c('0xf')](_0x636c('0x19'),_0x3ec20a,JSON['stringify'](_0x1fd289));_0x4efc4b(_0x1fd289);})['catch'](function(_0x2e0858){logger['error'](_0x636c('0x19'),_0x2e0858[_0x636c('0x13')],_0x3ec20a);_0x45451b(_0x399ae9[_0x636c('0x11')](0x1f4,_0x2e0858[_0x636c('0x13')]));});});};exports[_0x636c('0x1a')]=function(_0x3ffb72){var _0xcb54d8=this;return new Promise(function(_0x486966,_0x1d8503){return db[_0x636c('0x1b')][_0x636c('0x1c')](_0x3ffb72[_0x636c('0x16')],{'raw':_0x3ffb72[_0x636c('0x17')]?_0x3ffb72[_0x636c('0x17')][_0x636c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ffb72[_0x636c('0x17')]?_0x3ffb72['options'][_0x636c('0x1d')]||null:null,'attributes':_0x3ffb72['options']?_0x3ffb72[_0x636c('0x17')][_0x636c('0x1e')]||null:null,'limit':_0x3ffb72[_0x636c('0x17')]?_0x3ffb72[_0x636c('0x17')][_0x636c('0x1f')]||null:null})['then'](function(_0x5b207a){logger[_0x636c('0xc')]('UpdateVoiceDialReport',_0x3ffb72);logger[_0x636c('0xf')](_0x636c('0x1a'),_0x3ffb72,JSON['stringify'](_0x5b207a));_0x486966(_0x5b207a);})[_0x636c('0x15')](function(_0x5867ce){logger[_0x636c('0x11')](_0x636c('0x1a'),_0x5867ce[_0x636c('0x13')],_0x3ffb72);_0x1d8503(_0xcb54d8[_0x636c('0x11')](0x1f4,_0x5867ce[_0x636c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 992389f..5b302cc 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22eb=['../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3383cf,_0x3ef1a2){var _0x23072c=function(_0x1e5b31){while(--_0x1e5b31){_0x3383cf['push'](_0x3383cf['shift']());}};_0x23072c(++_0x3ef1a2);}(_0x22eb,0x143));var _0xb22e=function(_0x1cdb39,_0x5e1cce){_0x1cdb39=_0x1cdb39-0x0;var _0x590401=_0x22eb[_0x1cdb39];return _0x590401;};'use strict';var multer=require(_0xb22e('0x0'));var util=require(_0xb22e('0x1'));var path=require(_0xb22e('0x2'));var timeout=require(_0xb22e('0x3'));var express=require(_0xb22e('0x4'));var router=express['Router']();var fs_extra=require(_0xb22e('0x5'));var auth=require(_0xb22e('0x6'));var interaction=require(_0xb22e('0x7'));var config=require('../../config/environment');var controller=require(_0xb22e('0x8'));router[_0xb22e('0x9')]('/',auth[_0xb22e('0xa')](),controller[_0xb22e('0xb')]);router[_0xb22e('0x9')](_0xb22e('0xc'),auth[_0xb22e('0xa')](),controller[_0xb22e('0xd')]);router[_0xb22e('0xe')]('/',auth[_0xb22e('0xa')](),controller[_0xb22e('0xf')]);router[_0xb22e('0xe')](_0xb22e('0x10'),auth[_0xb22e('0xa')](),controller[_0xb22e('0x11')]);router[_0xb22e('0x12')](_0xb22e('0xc'),auth[_0xb22e('0xa')](),controller[_0xb22e('0x13')]);router['delete'](_0xb22e('0xc'),auth['isAuthenticated'](),controller[_0xb22e('0x14')]);module[_0xb22e('0x15')]=router; \ No newline at end of file +var _0x6124=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util'];(function(_0xf3c770,_0x59e56c){var _0x1f11c1=function(_0x504c6b){while(--_0x504c6b){_0xf3c770['push'](_0xf3c770['shift']());}};_0x1f11c1(++_0x59e56c);}(_0x6124,0x1de));var _0x4612=function(_0x52492a,_0x43086d){_0x52492a=_0x52492a-0x0;var _0x2b853f=_0x6124[_0x52492a];return _0x2b853f;};'use strict';var multer=require(_0x4612('0x0'));var util=require(_0x4612('0x1'));var path=require('path');var timeout=require(_0x4612('0x2'));var express=require(_0x4612('0x3'));var router=express[_0x4612('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4612('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4612('0x6'));var controller=require(_0x4612('0x7'));router[_0x4612('0x8')]('/',auth[_0x4612('0x9')](),controller['index']);router['get'](_0x4612('0xa'),auth[_0x4612('0x9')](),controller[_0x4612('0xb')]);router[_0x4612('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4612('0xc')](_0x4612('0xd'),auth['isAuthenticated'](),controller[_0x4612('0xe')]);router[_0x4612('0xf')](_0x4612('0xa'),auth[_0x4612('0x9')](),controller[_0x4612('0x10')]);router[_0x4612('0x11')]('/:id',auth[_0x4612('0x9')](),controller[_0x4612('0x12')]);module[_0x4612('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 1d30f5a..df93ff6 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6e2=['exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0xd6e2,0x7d));var _0x2d6e=function(_0x326ee6,_0x566a7c){_0x326ee6=_0x326ee6-0x0;var _0x2331f9=_0xd6e2[_0x326ee6];return _0x2331f9;};'use strict';var Sequelize=require(_0x2d6e('0x0'));module[_0x2d6e('0x1')]={'context':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':![],'unique':_0x2d6e('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2d6e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':![],'defaultValue':_0x2d6e('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2d6e('0x5')](_0x2d6e('0x6'),_0x2d6e('0x7'),_0x2d6e('0x8'),_0x2d6e('0x9'),_0x2d6e('0xa'),_0x2d6e('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x2d6e('0x2')]},'interval':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':![],'defaultValue':_0x2d6e('0xc')},'IntervalId':{'type':Sequelize[_0x2d6e('0xd')]},'isApp':{'type':Sequelize[_0x2d6e('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2d6e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x2d6e('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2d6e('0xd')]},'recordingFormat':{'type':Sequelize[_0x2d6e('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x2d6e('0xf')],'get':function(_0x3837a4){return this[_0x2d6e('0x10')](_0x2d6e('0x11'));}},'alias':{'type':Sequelize[_0x2d6e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x62e0=['outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','exports','compositeIndex','STRING','ENUM','inbound','outbound','internal'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x62e0,0xb4));var _0x062e=function(_0x4a4eac,_0x3cebba){_0x4a4eac=_0x4a4eac-0x0;var _0x150652=_0x62e0[_0x4a4eac];return _0x150652;};'use strict';var Sequelize=require('sequelize');module[_0x062e('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x062e('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x062e('0x2')],'allowNull':![],'unique':_0x062e('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x062e('0x1')},'tag':{'type':Sequelize[_0x062e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x062e('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x062e('0x3')](_0x062e('0x4'),_0x062e('0x5'),_0x062e('0x6'),'inbound-fax',_0x062e('0x7'),_0x062e('0x8'),_0x062e('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x062e('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x062e('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x062e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x062e('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x062e('0xc')]},'recordingFormat':{'type':Sequelize[_0x062e('0x2')],'defaultValue':_0x062e('0xd')},'answer':{'type':Sequelize[_0x062e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x062e('0xe')],'get':function(_0x329db2){return this[_0x062e('0xf')](_0x062e('0x10'));}},'alias':{'type':Sequelize[_0x062e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index cefea18..dcde159 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bce=['inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','find','UserProfileResource','stack','name','send','index','VoiceExtension','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','context','description','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','finally','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','./voiceExtension.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','InboundRoutes'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0x0bce,0x1f0));var _0xe0bc=function(_0x6c2433,_0x2fbbc1){_0x6c2433=_0x6c2433-0x0;var _0x19608=_0x0bce[_0x6c2433];return _0x19608;};'use strict';var _=require('lodash');var Redis=require(_0xe0bc('0x0'));var qs=require(_0xe0bc('0x1'));var logger=require('../../config/logger')(_0xe0bc('0x2'));var config=require(_0xe0bc('0x3'));var db=require('../../mysqldb')['db'];config[_0xe0bc('0x4')]=_[_0xe0bc('0x5')](config['redis'],{'host':_0xe0bc('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe0bc('0x7'))[_0xe0bc('0x8')](socket);function respondWithStatusCode(_0x31c5cd,_0x1ac051){_0x1ac051=_0x1ac051||0xcc;return function(_0x29f688){if(_0x29f688){return _0x31c5cd['sendStatus'](_0x1ac051);}return _0x31c5cd[_0xe0bc('0x9')](_0x1ac051)[_0xe0bc('0xa')]();};}function respondWithResult(_0x407003,_0xbce6ea){_0xbce6ea=_0xbce6ea||0xc8;return function(_0x1c1835){if(_0x1c1835){return _0x407003[_0xe0bc('0x9')](_0xbce6ea)[_0xe0bc('0xb')](_0x1c1835);}};}function respondWithFilteredResult(_0x171a0b,_0x4dbba3){return function(_0x4daeb4){if(_0x4daeb4){var _0x30058b=typeof _0x4dbba3[_0xe0bc('0xc')]===_0xe0bc('0xd')&&typeof _0x4dbba3[_0xe0bc('0xe')]==='undefined';var _0x3d75e4=_0x4daeb4[_0xe0bc('0xf')];var _0x20cb3c=_0x30058b?0x0:_0x4dbba3['offset'];var _0x5c0d21=_0x30058b?_0x4daeb4[_0xe0bc('0xf')]:_0x4dbba3[_0xe0bc('0xc')]+_0x4dbba3['limit'];var _0x5abf9b;if(_0x5c0d21>=_0x3d75e4){_0x5c0d21=_0x3d75e4;_0x5abf9b=0xc8;}else{_0x5abf9b=0xce;}_0x171a0b[_0xe0bc('0x9')](_0x5abf9b);return _0x171a0b['set'](_0xe0bc('0x10'),_0x20cb3c+'-'+_0x5c0d21+'/'+_0x3d75e4)[_0xe0bc('0xb')](_0x4daeb4);}return null;};}function removeEntity(_0xe57dbf){return function(_0x4c2c7f){if(_0x4c2c7f){return _0x4c2c7f[_0xe0bc('0x11')]()[_0xe0bc('0x12')](function(){var _0x1c3b88=_0x4c2c7f['get']({'plain':!![]});var _0x30dcd6=[{'name':_0xe0bc('0x13'),'value':_0xe0bc('0x14'),'ignore':![]},{'name':_0xe0bc('0x15'),'value':_0xe0bc('0x16'),'ignore':![]},{'name':_0xe0bc('0x17'),'value':_0xe0bc('0x18'),'ignore':![]}];var _0x31a607=_(_0x30dcd6)['filter']('ignore')[_0xe0bc('0x19')](_0xe0bc('0x1a'))['value']();if(_['includes'](_0x31a607,_0x1c3b88['type'])){return;}var _0x406d5b=_[_0xe0bc('0x1b')](_0x30dcd6,['value',_0x1c3b88['type']])['name'];return db[_0xe0bc('0x1c')]['destroy']({'where':{'type':_0x406d5b,'resourceId':_0x1c3b88['id']}})[_0xe0bc('0x12')](function(){return _0x4c2c7f;});})['then'](function(){_0xe57dbf[_0xe0bc('0x9')](0xcc)[_0xe0bc('0xa')]();});}};}function handleEntityNotFound(_0x17ee9c){return function(_0x461c67){if(!_0x461c67){_0x17ee9c['sendStatus'](0x194);}return _0x461c67;};}function handleError(_0x3826b9,_0x46f47d){_0x46f47d=_0x46f47d||0x1f4;return function(_0x375ad7){logger['error'](_0x375ad7[_0xe0bc('0x1d')]);if(_0x375ad7[_0xe0bc('0x1e')]){delete _0x375ad7[_0xe0bc('0x1e')];}_0x3826b9[_0xe0bc('0x9')](_0x46f47d)[_0xe0bc('0x1f')](_0x375ad7);};}exports[_0xe0bc('0x20')]=function(_0x46badb,_0x512b98){var _0x44a079={},_0x39196c={},_0x3535fd={'count':0x0,'rows':[]};var _0x393406=_[_0xe0bc('0x19')](db[_0xe0bc('0x21')][_0xe0bc('0x22')],function(_0x3830c7){return{'name':_0x3830c7['fieldName'],'type':_0x3830c7[_0xe0bc('0x23')][_0xe0bc('0x24')]};});_0x39196c[_0xe0bc('0x25')]=_[_0xe0bc('0x19')](_0x393406,_0xe0bc('0x1e'));_0x39196c[_0xe0bc('0x26')]=_[_0xe0bc('0x27')](_0x46badb[_0xe0bc('0x26')]);_0x39196c[_0xe0bc('0x28')]=_[_0xe0bc('0x29')](_0x39196c['model'],_0x39196c[_0xe0bc('0x26')]);_0x44a079['attributes']=_[_0xe0bc('0x29')](_0x39196c[_0xe0bc('0x25')],qs[_0xe0bc('0x2a')](_0x46badb[_0xe0bc('0x26')][_0xe0bc('0x2a')]));_0x44a079[_0xe0bc('0x2b')]=_0x44a079[_0xe0bc('0x2b')][_0xe0bc('0x2c')]?_0x44a079[_0xe0bc('0x2b')]:_0x39196c[_0xe0bc('0x25')];if(!_0x46badb[_0xe0bc('0x26')][_0xe0bc('0x2d')]('nolimit')){_0x44a079[_0xe0bc('0xe')]=qs['limit'](_0x46badb[_0xe0bc('0x26')][_0xe0bc('0xe')]);_0x44a079[_0xe0bc('0xc')]=qs['offset'](_0x46badb[_0xe0bc('0x26')][_0xe0bc('0xc')]);}_0x44a079[_0xe0bc('0x2e')]=qs['sort'](_0x46badb[_0xe0bc('0x26')]['sort']);_0x44a079['where']=qs['filters'](_[_0xe0bc('0x2f')](_0x46badb['query'],_0x39196c[_0xe0bc('0x28')]),_0x393406);if(_0x46badb[_0xe0bc('0x26')]['filter']){_0x44a079[_0xe0bc('0x30')]=_['merge'](_0x44a079[_0xe0bc('0x30')],{'$or':_['map'](_0x393406,function(_0x3f66f8){if(_0x3f66f8[_0xe0bc('0x23')]!==_0xe0bc('0x31')){var _0x27dc66={};_0x27dc66[_0x3f66f8[_0xe0bc('0x1e')]]={'$like':'%'+_0x46badb[_0xe0bc('0x26')][_0xe0bc('0x32')]+'%'};return _0x27dc66;}})});}_0x44a079=_[_0xe0bc('0x33')]({},_0x44a079,_0x46badb['options']);var _0x282625={'where':_0x44a079[_0xe0bc('0x30')]};return db[_0xe0bc('0x21')][_0xe0bc('0xf')](_0x282625)[_0xe0bc('0x12')](function(_0x12f1fd){_0x3535fd['count']=_0x12f1fd;if(_0x46badb[_0xe0bc('0x26')][_0xe0bc('0x34')]){_0x44a079[_0xe0bc('0x35')]=[{'all':!![]}];}return db[_0xe0bc('0x21')][_0xe0bc('0x36')](_0x44a079);})[_0xe0bc('0x12')](function(_0x48fa03){_0x3535fd[_0xe0bc('0x37')]=_0x48fa03;return _0x3535fd;})[_0xe0bc('0x12')](respondWithFilteredResult(_0x512b98,_0x44a079))[_0xe0bc('0x38')](handleError(_0x512b98,null));};exports[_0xe0bc('0x39')]=function(_0x12a2a7,_0x3ec334){var _0x4765c1={'raw':![],'where':{'id':_0x12a2a7[_0xe0bc('0x3a')]['id']}},_0x222e84={};_0x222e84[_0xe0bc('0x25')]=_['keys'](db['VoiceExtension'][_0xe0bc('0x22')]);_0x222e84[_0xe0bc('0x26')]=_['keys'](_0x12a2a7[_0xe0bc('0x26')]);_0x222e84[_0xe0bc('0x28')]=_[_0xe0bc('0x29')](_0x222e84[_0xe0bc('0x25')],_0x222e84[_0xe0bc('0x26')]);_0x4765c1[_0xe0bc('0x2b')]=_['intersection'](_0x222e84[_0xe0bc('0x25')],qs[_0xe0bc('0x2a')](_0x12a2a7[_0xe0bc('0x26')][_0xe0bc('0x2a')]));_0x4765c1[_0xe0bc('0x2b')]=_0x4765c1['attributes'][_0xe0bc('0x2c')]?_0x4765c1['attributes']:_0x222e84[_0xe0bc('0x25')];if(_0x12a2a7[_0xe0bc('0x26')][_0xe0bc('0x34')]){_0x4765c1[_0xe0bc('0x35')]=[{'all':!![]}];}_0x4765c1=_[_0xe0bc('0x33')]({},_0x4765c1,_0x12a2a7[_0xe0bc('0x3b')]);return db['VoiceExtension']['find'](_0x4765c1)[_0xe0bc('0x12')](handleEntityNotFound(_0x3ec334,null))[_0xe0bc('0x12')](respondWithResult(_0x3ec334,null))['catch'](handleError(_0x3ec334,null));};exports['destroy']=function(_0x3d9db0,_0x3ac153){return db[_0xe0bc('0x21')][_0xe0bc('0x1b')]({'where':{'id':_0x3d9db0[_0xe0bc('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3ac153,null))[_0xe0bc('0x12')](removeEntity(_0x3ac153,null))[_0xe0bc('0x38')](handleError(_0x3ac153,null));};exports[_0xe0bc('0x3c')]=function(_0x4f3b14,_0x55514f){if(_0x4f3b14[_0xe0bc('0x3d')][_0xe0bc('0x23')]===_0xe0bc('0x16')&&!_['startsWith'](_0x4f3b14[_0xe0bc('0x3d')][_0xe0bc('0x3e')],'_')){_0x4f3b14[_0xe0bc('0x3d')][_0xe0bc('0x3e')]='_'['concat'](_0x4f3b14[_0xe0bc('0x3d')]['exten']);}return db[_0xe0bc('0x21')][_0xe0bc('0x3c')](_0x4f3b14[_0xe0bc('0x3d')],{'raw':![]})[_0xe0bc('0x12')](function(_0x10eac3){var _0x3e8beb=_0x4f3b14[_0xe0bc('0x3f')][_0xe0bc('0x40')]({'plain':!![]});if(!_0x3e8beb)throw new Error(_0xe0bc('0x41'));if(_0x3e8beb[_0xe0bc('0x42')]===_0xe0bc('0x3f')){var _0x53afb0=_0x10eac3[_0xe0bc('0x40')]({'plain':!![]});var _0x1e84a3=[{'name':_0xe0bc('0x13'),'value':_0xe0bc('0x14')},{'name':_0xe0bc('0x15'),'value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x3f7c56=_['find'](_0x1e84a3,[_0xe0bc('0x1a'),_0x53afb0[_0xe0bc('0x23')]])['name'];return db[_0xe0bc('0x43')][_0xe0bc('0x1b')]({'where':{'name':_0x3f7c56,'userProfileId':_0x3e8beb[_0xe0bc('0x44')]},'raw':!![]})['then'](function(_0x1f66ab){if(_0x1f66ab&&_0x1f66ab[_0xe0bc('0x45')]===0x0){return db[_0xe0bc('0x1c')]['create']({'name':_0x53afb0[_0xe0bc('0x1e')],'resourceId':_0x53afb0['id'],'type':_0x1f66ab[_0xe0bc('0x1e')],'sectionId':_0x1f66ab['id']},{})['then'](function(){return _0x10eac3;});}else{return _0x10eac3;}})[_0xe0bc('0x38')](function(_0x53d4cb){logger[_0xe0bc('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53d4cb);throw _0x53d4cb;});}return _0x10eac3;})[_0xe0bc('0x12')](respondWithResult(_0x55514f,0xc9))[_0xe0bc('0x38')](handleError(_0x55514f,null));};exports[_0xe0bc('0x47')]=function(_0x4d3678,_0x3eb4c5){if(_0x4d3678[_0xe0bc('0x3d')]['id']){delete _0x4d3678[_0xe0bc('0x3d')]['id'];}return db[_0xe0bc('0x21')][_0xe0bc('0x1b')]({'where':{'id':_0x4d3678[_0xe0bc('0x3a')]['id']}})[_0xe0bc('0x12')](handleEntityNotFound(_0x3eb4c5,null))[_0xe0bc('0x12')](function(_0x13c070){if(_0x13c070){return db['VoiceExtension'][_0xe0bc('0x47')](_[_0xe0bc('0x2f')](_0x4d3678[_0xe0bc('0x3d')],[_0xe0bc('0x3e'),_0xe0bc('0x48'),_0xe0bc('0x49'),'recordingFormat','cutdigits',_0xe0bc('0x4a'),_0xe0bc('0x4b')]),{'where':{'context':_0x13c070[_0xe0bc('0x48')],'exten':_0x13c070[_0xe0bc('0x3e')]},'individualHooks':!![]})['then'](function(_0x3714ec){return _0x3714ec;});}return null;})[_0xe0bc('0x12')](respondWithStatusCode(_0x3eb4c5,null))[_0xe0bc('0x38')](handleError(_0x3eb4c5,null));};exports[_0xe0bc('0x4c')]=function(_0x978318,_0x3273cf){var _0x2143b8=_0x978318[_0xe0bc('0x3a')]['id'];var _0x11dd75=_0x978318[_0xe0bc('0x3d')];var _0x4f1b5d=0xc8;var _0x14c7ca=null;return db[_0xe0bc('0x4d')]['transaction']({'isolationLevel':db['sequelize'][_0xe0bc('0x4e')][_0xe0bc('0x4f')][_0xe0bc('0x50')]},function(_0x2ddf9c){return db['VoiceExtension'][_0xe0bc('0x51')]({'where':{'id':_0x2143b8},'transaction':_0x2ddf9c})[_0xe0bc('0x12')](function(_0x41ae4b){if(_0x41ae4b){return db[_0xe0bc('0x21')]['destroy']({'where':{'VoiceExtensionId':_0x2143b8},'transaction':_0x2ddf9c})['then'](function(){var _0x3a6aa2=_['map'](_0x11dd75,function(_0x1c7668){_0x1c7668[_0xe0bc('0x52')]=_0x2143b8;_0x1c7668[_0xe0bc('0x53')]=!![];return _0x1c7668;});return _0x41ae4b['createRouting'](_0x3a6aa2);})[_0xe0bc('0x12')](function(_0x4511f7){return db[_0xe0bc('0x21')]['bulkCreate'](_0x4511f7,{'transaction':_0x2ddf9c});});}else{_0x4f1b5d=0x194;_0x14c7ca=[];}});})[_0xe0bc('0x12')](function(){if(_0x4f1b5d!==0x194){return db['VoiceExtension'][_0xe0bc('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2143b8},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4e9c25){_0x14c7ca=_0x4e9c25;});}})[_0xe0bc('0x38')](function(_0x266e4c){_0x4f1b5d=0x1f4;logger['error'](_0x266e4c[_0xe0bc('0x1d')]);if(_0x266e4c[_0xe0bc('0x1e')]){delete _0x266e4c[_0xe0bc('0x1e')];}_0x14c7ca=_0x266e4c;})[_0xe0bc('0x55')](function(){if(_0x14c7ca===null){_0x3273cf['sendStatus'](_0x4f1b5d);}else{if(_0x4f1b5d===0x1f4){_0x3273cf[_0xe0bc('0x9')](_0x4f1b5d)[_0xe0bc('0x1f')](_0x14c7ca);}else{_0x3273cf[_0xe0bc('0x9')](_0x4f1b5d)[_0xe0bc('0xb')](_0x14c7ca);}}});}; \ No newline at end of file +var _0x7c17=['send','index','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','find','destroy','params','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','update','context','description','recordingFormat','cutdigits','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack'];(function(_0x21a9cf,_0x51f954){var _0x5d4ba7=function(_0x18d186){while(--_0x18d186){_0x21a9cf['push'](_0x21a9cf['shift']());}};_0x5d4ba7(++_0x51f954);}(_0x7c17,0x90));var _0x77c1=function(_0x3a45a2,_0x236b0d){_0x3a45a2=_0x3a45a2-0x0;var _0x484d71=_0x7c17[_0x3a45a2];return _0x484d71;};'use strict';var _=require(_0x77c1('0x0'));var Redis=require(_0x77c1('0x1'));var qs=require(_0x77c1('0x2'));var logger=require('../../config/logger')('api');var config=require(_0x77c1('0x3'));var db=require(_0x77c1('0x4'))['db'];config['redis']=_[_0x77c1('0x5')](config[_0x77c1('0x6')],{'host':_0x77c1('0x7'),'port':0x18eb});var socket=require(_0x77c1('0x8'))(new Redis(config['redis']));require(_0x77c1('0x9'))[_0x77c1('0xa')](socket);function respondWithStatusCode(_0x139f7c,_0x4666c8){_0x4666c8=_0x4666c8||0xcc;return function(_0x576b56){if(_0x576b56){return _0x139f7c[_0x77c1('0xb')](_0x4666c8);}return _0x139f7c[_0x77c1('0xc')](_0x4666c8)[_0x77c1('0xd')]();};}function respondWithResult(_0x2ce930,_0x3387eb){_0x3387eb=_0x3387eb||0xc8;return function(_0x3e0d74){if(_0x3e0d74){return _0x2ce930[_0x77c1('0xc')](_0x3387eb)[_0x77c1('0xe')](_0x3e0d74);}};}function respondWithFilteredResult(_0x5424f0,_0x438e02){return function(_0x28a46a){if(_0x28a46a){var _0x2406a3=typeof _0x438e02[_0x77c1('0xf')]===_0x77c1('0x10')&&typeof _0x438e02[_0x77c1('0x11')]==='undefined';var _0x95e89d=_0x28a46a[_0x77c1('0x12')];var _0x39837e=_0x2406a3?0x0:_0x438e02[_0x77c1('0xf')];var _0x5d29af=_0x2406a3?_0x28a46a[_0x77c1('0x12')]:_0x438e02[_0x77c1('0xf')]+_0x438e02[_0x77c1('0x11')];var _0x5bc27e;if(_0x5d29af>=_0x95e89d){_0x5d29af=_0x95e89d;_0x5bc27e=0xc8;}else{_0x5bc27e=0xce;}_0x5424f0[_0x77c1('0xc')](_0x5bc27e);return _0x5424f0[_0x77c1('0x13')](_0x77c1('0x14'),_0x39837e+'-'+_0x5d29af+'/'+_0x95e89d)[_0x77c1('0xe')](_0x28a46a);}return null;};}function removeEntity(_0x26b359){return function(_0x140b7e){if(_0x140b7e){return _0x140b7e['destroy']()[_0x77c1('0x15')](function(){var _0x3d990e=_0x140b7e[_0x77c1('0x16')]({'plain':!![]});var _0x388633=[{'name':_0x77c1('0x17'),'value':'inbound','ignore':![]},{'name':_0x77c1('0x18'),'value':_0x77c1('0x19'),'ignore':![]},{'name':_0x77c1('0x1a'),'value':_0x77c1('0x1b'),'ignore':![]}];var _0x42c564=_(_0x388633)[_0x77c1('0x1c')](_0x77c1('0x1d'))[_0x77c1('0x1e')]('value')[_0x77c1('0x1f')]();if(_[_0x77c1('0x20')](_0x42c564,_0x3d990e[_0x77c1('0x21')])){return;}var _0x3e3c7a=_['find'](_0x388633,[_0x77c1('0x1f'),_0x3d990e[_0x77c1('0x21')]])[_0x77c1('0x22')];return db[_0x77c1('0x23')]['destroy']({'where':{'type':_0x3e3c7a,'resourceId':_0x3d990e['id']}})[_0x77c1('0x15')](function(){return _0x140b7e;});})[_0x77c1('0x15')](function(){_0x26b359[_0x77c1('0xc')](0xcc)[_0x77c1('0xd')]();});}};}function handleEntityNotFound(_0x18a29b){return function(_0x34a420){if(!_0x34a420){_0x18a29b['sendStatus'](0x194);}return _0x34a420;};}function handleError(_0x597773,_0xe50e34){_0xe50e34=_0xe50e34||0x1f4;return function(_0x4c1b52){logger[_0x77c1('0x24')](_0x4c1b52[_0x77c1('0x25')]);if(_0x4c1b52[_0x77c1('0x22')]){delete _0x4c1b52[_0x77c1('0x22')];}_0x597773[_0x77c1('0xc')](_0xe50e34)[_0x77c1('0x26')](_0x4c1b52);};}exports[_0x77c1('0x27')]=function(_0x268fcd,_0x3dbc0a){var _0x18eadf={},_0x464ece={},_0x51a43b={'count':0x0,'rows':[]};var _0x2e6fa3=_[_0x77c1('0x1e')](db[_0x77c1('0x28')][_0x77c1('0x29')],function(_0x1b3c19){return{'name':_0x1b3c19['fieldName'],'type':_0x1b3c19[_0x77c1('0x21')][_0x77c1('0x2a')]};});_0x464ece[_0x77c1('0x2b')]=_['map'](_0x2e6fa3,_0x77c1('0x22'));_0x464ece[_0x77c1('0x2c')]=_[_0x77c1('0x2d')](_0x268fcd[_0x77c1('0x2c')]);_0x464ece[_0x77c1('0x2e')]=_[_0x77c1('0x2f')](_0x464ece[_0x77c1('0x2b')],_0x464ece[_0x77c1('0x2c')]);_0x18eadf[_0x77c1('0x30')]=_[_0x77c1('0x2f')](_0x464ece[_0x77c1('0x2b')],qs[_0x77c1('0x31')](_0x268fcd[_0x77c1('0x2c')][_0x77c1('0x31')]));_0x18eadf[_0x77c1('0x30')]=_0x18eadf['attributes'][_0x77c1('0x32')]?_0x18eadf['attributes']:_0x464ece['model'];if(!_0x268fcd[_0x77c1('0x2c')][_0x77c1('0x33')](_0x77c1('0x34'))){_0x18eadf['limit']=qs[_0x77c1('0x11')](_0x268fcd[_0x77c1('0x2c')]['limit']);_0x18eadf['offset']=qs[_0x77c1('0xf')](_0x268fcd[_0x77c1('0x2c')][_0x77c1('0xf')]);}_0x18eadf[_0x77c1('0x35')]=qs['sort'](_0x268fcd[_0x77c1('0x2c')][_0x77c1('0x36')]);_0x18eadf['where']=qs['filters'](_['pick'](_0x268fcd['query'],_0x464ece[_0x77c1('0x2e')]),_0x2e6fa3);if(_0x268fcd[_0x77c1('0x2c')][_0x77c1('0x1c')]){_0x18eadf[_0x77c1('0x37')]=_[_0x77c1('0x38')](_0x18eadf[_0x77c1('0x37')],{'$or':_['map'](_0x2e6fa3,function(_0x37a9ea){if(_0x37a9ea[_0x77c1('0x21')]!==_0x77c1('0x39')){var _0x11b44b={};_0x11b44b[_0x37a9ea[_0x77c1('0x22')]]={'$like':'%'+_0x268fcd[_0x77c1('0x2c')][_0x77c1('0x1c')]+'%'};return _0x11b44b;}})});}_0x18eadf=_[_0x77c1('0x38')]({},_0x18eadf,_0x268fcd['options']);var _0x23b4ac={'where':_0x18eadf['where']};return db['VoiceExtension'][_0x77c1('0x12')](_0x23b4ac)['then'](function(_0x2b2815){_0x51a43b[_0x77c1('0x12')]=_0x2b2815;if(_0x268fcd['query']['includeAll']){_0x18eadf[_0x77c1('0x3a')]=[{'all':!![]}];}return db[_0x77c1('0x28')][_0x77c1('0x3b')](_0x18eadf);})[_0x77c1('0x15')](function(_0x2f86d4){_0x51a43b[_0x77c1('0x3c')]=_0x2f86d4;return _0x51a43b;})[_0x77c1('0x15')](respondWithFilteredResult(_0x3dbc0a,_0x18eadf))[_0x77c1('0x3d')](handleError(_0x3dbc0a,null));};exports[_0x77c1('0x3e')]=function(_0x29828b,_0x5eee0c){var _0x2d5c0b={'raw':![],'where':{'id':_0x29828b['params']['id']}},_0x3190aa={};_0x3190aa[_0x77c1('0x2b')]=_[_0x77c1('0x2d')](db[_0x77c1('0x28')][_0x77c1('0x29')]);_0x3190aa[_0x77c1('0x2c')]=_['keys'](_0x29828b['query']);_0x3190aa[_0x77c1('0x2e')]=_[_0x77c1('0x2f')](_0x3190aa['model'],_0x3190aa[_0x77c1('0x2c')]);_0x2d5c0b[_0x77c1('0x30')]=_[_0x77c1('0x2f')](_0x3190aa[_0x77c1('0x2b')],qs[_0x77c1('0x31')](_0x29828b['query'][_0x77c1('0x31')]));_0x2d5c0b[_0x77c1('0x30')]=_0x2d5c0b['attributes'][_0x77c1('0x32')]?_0x2d5c0b[_0x77c1('0x30')]:_0x3190aa['model'];if(_0x29828b[_0x77c1('0x2c')][_0x77c1('0x3f')]){_0x2d5c0b['include']=[{'all':!![]}];}_0x2d5c0b=_[_0x77c1('0x38')]({},_0x2d5c0b,_0x29828b['options']);return db[_0x77c1('0x28')][_0x77c1('0x40')](_0x2d5c0b)['then'](handleEntityNotFound(_0x5eee0c,null))[_0x77c1('0x15')](respondWithResult(_0x5eee0c,null))[_0x77c1('0x3d')](handleError(_0x5eee0c,null));};exports[_0x77c1('0x41')]=function(_0x15bda4,_0x939cc7){return db[_0x77c1('0x28')][_0x77c1('0x40')]({'where':{'id':_0x15bda4[_0x77c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x939cc7,null))[_0x77c1('0x15')](removeEntity(_0x939cc7,null))['catch'](handleError(_0x939cc7,null));};exports[_0x77c1('0x43')]=function(_0xc2c6c,_0x353374){if(_0xc2c6c[_0x77c1('0x44')][_0x77c1('0x21')]===_0x77c1('0x19')&&!_['startsWith'](_0xc2c6c[_0x77c1('0x44')]['exten'],'_')){_0xc2c6c[_0x77c1('0x44')][_0x77c1('0x45')]='_'['concat'](_0xc2c6c[_0x77c1('0x44')][_0x77c1('0x45')]);}return db[_0x77c1('0x28')][_0x77c1('0x43')](_0xc2c6c[_0x77c1('0x44')],{'raw':![]})['then'](function(_0x51c659){var _0x189bba=_0xc2c6c[_0x77c1('0x46')][_0x77c1('0x16')]({'plain':!![]});if(!_0x189bba)throw new Error(_0x77c1('0x47'));if(_0x189bba[_0x77c1('0x48')]===_0x77c1('0x46')){var _0xd8850b=_0x51c659[_0x77c1('0x16')]({'plain':!![]});var _0x851dd4=[{'name':_0x77c1('0x17'),'value':_0x77c1('0x49')},{'name':_0x77c1('0x18'),'value':'outbound'},{'name':_0x77c1('0x1a'),'value':_0x77c1('0x1b')}];var _0x365b49=_[_0x77c1('0x40')](_0x851dd4,[_0x77c1('0x1f'),_0xd8850b[_0x77c1('0x21')]])[_0x77c1('0x22')];return db['UserProfileSection'][_0x77c1('0x40')]({'where':{'name':_0x365b49,'userProfileId':_0x189bba[_0x77c1('0x4a')]},'raw':!![]})['then'](function(_0x3dd70f){if(_0x3dd70f&&_0x3dd70f['autoAssociation']===0x0){return db[_0x77c1('0x23')][_0x77c1('0x43')]({'name':_0xd8850b[_0x77c1('0x22')],'resourceId':_0xd8850b['id'],'type':_0x3dd70f['name'],'sectionId':_0x3dd70f['id']},{})[_0x77c1('0x15')](function(){return _0x51c659;});}else{return _0x51c659;}})[_0x77c1('0x3d')](function(_0x4c9b45){logger[_0x77c1('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c9b45);throw _0x4c9b45;});}return _0x51c659;})[_0x77c1('0x15')](respondWithResult(_0x353374,0xc9))['catch'](handleError(_0x353374,null));};exports[_0x77c1('0x4b')]=function(_0x4ee18e,_0x55f14c){if(_0x4ee18e['body']['id']){delete _0x4ee18e[_0x77c1('0x44')]['id'];}return db['VoiceExtension'][_0x77c1('0x40')]({'where':{'id':_0x4ee18e[_0x77c1('0x42')]['id']}})[_0x77c1('0x15')](handleEntityNotFound(_0x55f14c,null))[_0x77c1('0x15')](function(_0x5b6072){if(_0x5b6072){return db[_0x77c1('0x28')][_0x77c1('0x4b')](_['pick'](_0x4ee18e[_0x77c1('0x44')],['exten',_0x77c1('0x4c'),_0x77c1('0x4d'),_0x77c1('0x4e'),_0x77c1('0x4f'),'mandatoryDisposition',_0x77c1('0x50')]),{'where':{'context':_0x5b6072[_0x77c1('0x4c')],'exten':_0x5b6072[_0x77c1('0x45')]},'individualHooks':!![]})[_0x77c1('0x15')](function(_0x4e21b5){return _0x4e21b5;});}return null;})[_0x77c1('0x15')](respondWithStatusCode(_0x55f14c,null))[_0x77c1('0x3d')](handleError(_0x55f14c,null));};exports['addApplications']=function(_0xfc2d14,_0x50ba42){var _0x23655c=_0xfc2d14[_0x77c1('0x42')]['id'];var _0x391601=_0xfc2d14[_0x77c1('0x44')];var _0x515d41=0xc8;var _0x10e33e=null;return db[_0x77c1('0x51')][_0x77c1('0x52')]({'isolationLevel':db[_0x77c1('0x51')][_0x77c1('0x53')][_0x77c1('0x54')][_0x77c1('0x55')]},function(_0x455a59){return db[_0x77c1('0x28')]['findOne']({'where':{'id':_0x23655c},'transaction':_0x455a59})[_0x77c1('0x15')](function(_0x13a39e){if(_0x13a39e){return db[_0x77c1('0x28')][_0x77c1('0x41')]({'where':{'VoiceExtensionId':_0x23655c},'transaction':_0x455a59})[_0x77c1('0x15')](function(){var _0x44d09c=_[_0x77c1('0x1e')](_0x391601,function(_0x4dcfd7){_0x4dcfd7[_0x77c1('0x56')]=_0x23655c;_0x4dcfd7[_0x77c1('0x57')]=!![];return _0x4dcfd7;});return _0x13a39e[_0x77c1('0x58')](_0x44d09c);})[_0x77c1('0x15')](function(_0x2cbc03){return db[_0x77c1('0x28')]['bulkCreate'](_0x2cbc03,{'transaction':_0x455a59});});}else{_0x515d41=0x194;_0x10e33e=[];}});})[_0x77c1('0x15')](function(){if(_0x515d41!==0x194){return db[_0x77c1('0x28')][_0x77c1('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x23655c},'order':'cast(priority\x20as\x20unsigned)'})[_0x77c1('0x15')](function(_0x219909){_0x10e33e=_0x219909;});}})[_0x77c1('0x3d')](function(_0x74f94d){_0x515d41=0x1f4;logger['error'](_0x74f94d[_0x77c1('0x25')]);if(_0x74f94d[_0x77c1('0x22')]){delete _0x74f94d['name'];}_0x10e33e=_0x74f94d;})[_0x77c1('0x5a')](function(){if(_0x10e33e===null){_0x50ba42[_0x77c1('0xb')](_0x515d41);}else{if(_0x515d41===0x1f4){_0x50ba42[_0x77c1('0xc')](_0x515d41)[_0x77c1('0x26')](_0x10e33e);}else{_0x50ba42[_0x77c1('0xc')](_0x515d41)[_0x77c1('0xe')](_0x10e33e);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index abbb435..44e8210 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f58=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55bf96,_0x7267a7){var _0x5092ef=function(_0x3ed3f1){while(--_0x3ed3f1){_0x55bf96['push'](_0x55bf96['shift']());}};_0x5092ef(++_0x7267a7);}(_0x5f58,0x77));var _0x85f5=function(_0x258c5e,_0x407908){_0x258c5e=_0x258c5e-0x0;var _0x4ce92e=_0x5f58[_0x258c5e];return _0x4ce92e;};'use strict';var EventEmitter=require(_0x85f5('0x0'));var VoiceExtension=require(_0x85f5('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x85f5('0x2')](0x0);var events={'afterCreate':_0x85f5('0x3'),'afterUpdate':_0x85f5('0x4'),'afterDestroy':_0x85f5('0x5')};function emitEvent(_0x190b55){return function(_0x370ef6,_0x4da0ba,_0x5bd9b6){VoiceExtensionEvents[_0x85f5('0x6')](_0x190b55+':'+_0x370ef6['id'],_0x370ef6);VoiceExtensionEvents[_0x85f5('0x6')](_0x190b55,_0x370ef6);_0x5bd9b6(null);};}for(var e in events){if(events[_0x85f5('0x7')](e)){var event=events[e];VoiceExtension[_0x85f5('0x8')](e,emitEvent(event));}}module[_0x85f5('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc6fd=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x572a3a,_0x3e7c02){var _0x3214a1=function(_0x2bc80a){while(--_0x2bc80a){_0x572a3a['push'](_0x572a3a['shift']());}};_0x3214a1(++_0x3e7c02);}(_0xc6fd,0x160));var _0xdc6f=function(_0xf51151,_0x4bad39){_0xf51151=_0xf51151-0x0;var _0x14ef8e=_0xc6fd[_0xf51151];return _0x14ef8e;};'use strict';var EventEmitter=require(_0xdc6f('0x0'));var VoiceExtension=require(_0xdc6f('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdc6f('0x2')](0x0);var events={'afterCreate':_0xdc6f('0x3'),'afterUpdate':_0xdc6f('0x4'),'afterDestroy':_0xdc6f('0x5')};function emitEvent(_0x55acd1){return function(_0x30d3dd,_0x214d25,_0xec7808){VoiceExtensionEvents[_0xdc6f('0x6')](_0x55acd1+':'+_0x30d3dd['id'],_0x30d3dd);VoiceExtensionEvents[_0xdc6f('0x6')](_0x55acd1,_0x30d3dd);_0xec7808(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xdc6f('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index b6b7b9e..26f00da 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc68=['replace','join','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','Set','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','options','url','split','length','name','phone','param','prefix','SIP','none','U(xcally-mixmonitor-context)'];(function(_0x173567,_0xb47ba2){var _0x374cda=function(_0x50189f){while(--_0x50189f){_0x173567['push'](_0x173567['shift']());}};_0x374cda(++_0xb47ba2);}(_0xdc68,0x16d));var _0x8dc6=function(_0x3b417e,_0x22347f){_0x3b417e=_0x3b417e-0x0;var _0x302ca8=_0xdc68[_0x3b417e];return _0x302ca8;};'use strict';var _=require(_0x8dc6('0x0'));var attributes=require(_0x8dc6('0x1'));module[_0x8dc6('0x2')]=function(_0x5c3a9c){var _0x10682e=_0x5c3a9c[_0x8dc6('0x3')];function _0x33c2b8(_0x5a39cd){var _0x26e1f5=0x2;var _0x1f218a=[{'type':_0x5a39cd[_0x8dc6('0x4')],'app':'Set','appdata':_0x8dc6('0x5')+_0x5a39cd['type'],'context':_0x5a39cd['context'],'exten':_0x5a39cd[_0x8dc6('0x6')],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']},{'type':_0x5a39cd[_0x8dc6('0x4')],'app':_0x5a39cd[_0x8dc6('0x7')]?'Set':_0x8dc6('0x8'),'appdata':_0x5a39cd['alias']?_0x8dc6('0x9')+_0x5a39cd[_0x8dc6('0x7')]:_0x8dc6('0xa'),'context':_0x5a39cd[_0x8dc6('0xb')],'exten':_0x5a39cd[_0x8dc6('0x6')],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']}];if(_0x5a39cd[_0x8dc6('0x4')]===_0x8dc6('0xc')){_0x1f218a['push']({'type':_0x8dc6('0xc'),'app':_0x8dc6('0xd'),'appdata':_0x8dc6('0xe')+_0x5a39cd['id'],'context':_0x5a39cd[_0x8dc6('0xb')],'exten':_0x5a39cd[_0x8dc6('0x6')],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']});}_0x1f218a[_0x8dc6('0xf')]({'type':_0x5a39cd[_0x8dc6('0x4')],'app':_0x8dc6('0xd'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5a39cd['context'],'exten':_0x5a39cd['exten'],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']},{'type':_0x5a39cd['type'],'app':'Set','appdata':_0x8dc6('0x10'),'context':_0x5a39cd['context'],'exten':_0x5a39cd['exten'],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']},{'type':_0x5a39cd[_0x8dc6('0x4')],'app':_0x8dc6('0xd'),'appdata':_0x8dc6('0x11'),'context':_0x5a39cd[_0x8dc6('0xb')],'exten':_0x5a39cd['exten'],'priority':_0x26e1f5++,'VoiceExtensionId':_0x5a39cd['id']});return _0x1f218a;}function _0x3a0c10(_0x4f90a3){var _0x1309f2=0x2;var _0x3f87c3=[{'type':_0x8dc6('0x12'),'app':'Set','appdata':_0x8dc6('0x13'),'context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':'outbound','app':_0x4f90a3[_0x8dc6('0x7')]?_0x8dc6('0xd'):_0x8dc6('0x8'),'appdata':_0x4f90a3[_0x8dc6('0x7')]?_0x8dc6('0x9')+_0x4f90a3[_0x8dc6('0x7')]:'No\x20alias\x20set','context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3['exten'],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x4f90a3[_0x8dc6('0x14')]?_0x8dc6('0x15')+_0x4f90a3['cutdigits']+'}':_0x8dc6('0x16')),'context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':'outbound','app':_0x8dc6('0xd'),'appdata':'CDR(routeid)='+_0x4f90a3['id'],'context':_0x4f90a3['context'],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':_0x8dc6('0x17'),'appdata':_0x8dc6('0x18')+(_0x1309f2+0x2)+_0x8dc6('0x19')+(_0x1309f2+0x1)+')','context':_0x4f90a3['context'],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':_0x8dc6('0xd'),'appdata':_0x4f90a3[_0x8dc6('0x14')]?_0x8dc6('0x1a')+_0x4f90a3[_0x8dc6('0x14')]+'}':_0x8dc6('0x1b'),'context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3['exten'],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':_0x8dc6('0xd'),'appdata':_0x8dc6('0x1c'),'context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3['exten'],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':'outbound','app':_0x8dc6('0xd'),'appdata':_0x8dc6('0x10'),'context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3['exten'],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':_0x8dc6('0xd'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':'Set','appdata':_0x8dc6('0x1d')+_0x4f90a3['id'],'context':_0x4f90a3['context'],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']}];if(_0x4f90a3[_0x8dc6('0x1e')](_0x8dc6('0x1f'))&&_0x4f90a3[_0x8dc6('0x1f')]!=='none'){_0x3f87c3['push']({'type':_0x8dc6('0x12'),'app':_0x8dc6('0xd'),'appdata':_0x8dc6('0x20'),'context':_0x4f90a3['context'],'exten':_0x4f90a3[_0x8dc6('0x6')],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']},{'type':_0x8dc6('0x12'),'app':_0x8dc6('0xd'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4f90a3[_0x8dc6('0x1f')]||'wav','context':_0x4f90a3[_0x8dc6('0xb')],'exten':_0x4f90a3['exten'],'priority':_0x1309f2++,'VoiceExtensionId':_0x4f90a3['id']});}return _0x3f87c3;}function _0x435a07(_0x298079,_0x333c9c){var _0x455310=[{'name':_0x8dc6('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x8dc6('0x22'),'param':0x2},{'name':_0x8dc6('0x23'),'param':0x3}];var _0x161038={};var _0x4a80d9=_0x333c9c[_0x8dc6('0x24')](',');var _0x1abb9d=[];for(var _0x4cd4a8=0x0;_0x4cd4a8<_0x455310[_0x8dc6('0x25')];_0x4cd4a8++){switch(_0x455310[_0x4cd4a8][_0x8dc6('0x26')]){case _0x8dc6('0x21'):_0x161038[_0x8dc6('0x21')]=_0x4a80d9[_0x455310[_0x4cd4a8]['param']]['split']('/')[0x1];_0x161038[_0x8dc6('0x27')]=_0x4a80d9[_0x455310[_0x4cd4a8][_0x8dc6('0x28')]][_0x8dc6('0x24')]('/')[0x2];_0x161038[_0x8dc6('0x29')]=_0x161038[_0x8dc6('0x27')]?_0x161038['phone']['split']('$')[0x0]:undefined;_0x161038['phone']=_0x298079['cutdigits']?(_0x161038[_0x8dc6('0x29')]||'')+_0x8dc6('0x15')+_0x298079['cutdigits']+'}':(_0x161038[_0x8dc6('0x29')]||'')+_0x8dc6('0x16');_0x1abb9d[_0x455310[_0x4cd4a8][_0x8dc6('0x28')]]=[_0x8dc6('0x2a'),_0x161038[_0x8dc6('0x21')],_0x161038['phone']]['join']('/');break;case _0x8dc6('0x22'):_0x161038[_0x8dc6('0x22')]=_0x4a80d9[_0x455310[_0x4cd4a8][_0x8dc6('0x28')]];if(_0x298079[_0x8dc6('0x1f')]!==_0x8dc6('0x2b')){if(_0x161038[_0x8dc6('0x22')]['indexOf'](_0x8dc6('0x2c'))<0x0){_0x161038[_0x8dc6('0x22')]+=_0x8dc6('0x2c');}}else{_0x161038[_0x8dc6('0x22')]=_0x161038[_0x8dc6('0x22')][_0x8dc6('0x2d')](_0x8dc6('0x2c'),'');}_0x1abb9d[_0x455310[_0x4cd4a8][_0x8dc6('0x28')]]=_0x161038[_0x8dc6('0x22')];break;default:_0x1abb9d[_0x455310[_0x4cd4a8]['param']]=_0x4a80d9[_0x455310[_0x4cd4a8][_0x8dc6('0x28')]];}}return _0x1abb9d[_0x8dc6('0x2e')](',');}function _0x41adef(_0x3e6723,_0xe795af,_0x548a6d){return new Promise(function(_0x536607,_0x246f25){var _0x44c971=[];if(_[_0x8dc6('0x2f')](_0xe795af))return _0x536607(_0x44c971);_0x10682e[_0x8dc6('0x30')][_0x8dc6('0x31')]({'attributes':['id',_0x8dc6('0x32'),'IntervalId'],'raw':!![]})[_0x8dc6('0x33')](function(_0x423935){for(var _0x361e70=0x0,_0x33f3a9=0x0;_0x361e70<_0xe795af['length'];_0x361e70++,_0x33f3a9=0x0){var _0x4b2923=_0xe795af[_0x361e70];var _0x2a14ee=[];var _0x42278b=[];delete _0x4b2923['id'];if(_0x4b2923[_0x8dc6('0x32')]!==_0x8dc6('0x34')){_0x4b2923[_0x8dc6('0x35')]=[_0x4b2923['interval']];}else{_0x4b2923[_0x8dc6('0x35')]=_0x4b2923['IntervalId']?_['map'](_['filter'](_0x423935,{'IntervalId':_0x4b2923['IntervalId']}),_0x8dc6('0x32')):[];}_0x4b2923[_0x8dc6('0xb')]=_0x3e6723[_0x8dc6('0xb')];_0x4b2923[_0x8dc6('0x6')]=_0x3e6723[_0x8dc6('0x6')];if(_0x4b2923[_0x8dc6('0x4')])_0x4b2923[_0x8dc6('0x4')]=_0x4b2923['type']['toLowerCase']();if(_0x3e6723[_0x8dc6('0x4')]===_0x8dc6('0x12')){if(_0x4b2923[_0x8dc6('0x1e')]('tag')&&_0x4b2923[_0x8dc6('0x36')]&&_0x4b2923[_0x8dc6('0x36')]!=='--'){_0x2a14ee[_0x8dc6('0xf')]({'type':_0x4b2923[_0x8dc6('0x4')][_0x8dc6('0x37')](),'app':_0x8dc6('0xd'),'appdata':'CDR(tag)='+_0x4b2923[_0x8dc6('0x36')],'context':_0x3e6723[_0x8dc6('0xb')],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923['intervals'][_0x8dc6('0x25')]+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});}_0x2a14ee[_0x8dc6('0xf')]({'type':_0x4b2923['type'][_0x8dc6('0x37')](),'app':_0x8dc6('0x17'),'appdata':_0x8dc6('0x38')+(_0x4b2923[_0x8dc6('0x39')]?_0x8dc6('0x3a')+_0x4b2923[_0x8dc6('0x39')]+')':_0x8dc6('0x3b')),'context':_0x3e6723[_0x8dc6('0xb')],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')]+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});}else{if(_0x4b2923[_0x8dc6('0x1e')](_0x8dc6('0x3c'))){if([_0x8dc6('0x3d'),'playback'][_0x8dc6('0x3e')](_0x4b2923[_0x8dc6('0x3f')][_0x8dc6('0x37')]())&&_0x4b2923['appType']!==_0x8dc6('0x40')){if(_0x4b2923['answer']){_0x2a14ee[_0x8dc6('0xf')]({'type':_0x4b2923[_0x8dc6('0x4')][_0x8dc6('0x37')](),'app':'ExecIf','appdata':_0x8dc6('0x41'),'context':_0x3e6723[_0x8dc6('0xb')],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923['intervals']['length']+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});_0x2a14ee[_0x8dc6('0xf')]({'type':_0x4b2923[_0x8dc6('0x4')]['toLowerCase'](),'app':_0x8dc6('0xd'),'appdata':_0x8dc6('0x42'),'context':_0x3e6723['context'],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')]+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});}else{_0x2a14ee[_0x8dc6('0xf')]({'type':_0x4b2923[_0x8dc6('0x4')]['toLowerCase'](),'app':_0x8dc6('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3e6723[_0x8dc6('0xb')],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')]+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});_0x2a14ee['push']({'type':_0x4b2923[_0x8dc6('0x4')][_0x8dc6('0x37')](),'app':_0x8dc6('0xd'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3e6723[_0x8dc6('0xb')],'exten':_0x3e6723[_0x8dc6('0x6')],'priority':_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')]+_0x548a6d+_0x33f3a9++,'VoiceExtensionId':_0x3e6723['id']});}}}}for(var _0x5cb244=0x0;_0x5cb244<_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')];_0x5cb244++){var _0x405421=_0x548a6d+_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')];var _0x44b6ba=_0x5cb244===_0x4b2923[_0x8dc6('0x35')][_0x8dc6('0x25')]-0x1?_0x548a6d+_0x2a14ee[_0x8dc6('0x25')]+_0x42278b[_0x8dc6('0x25')]+0x2:_0x548a6d+_0x5cb244+0x1;_0x2a14ee[_0x8dc6('0x43')](_0x5cb244,0x0,{'type':_0x3e6723[_0x8dc6('0x4')],'app':_0x8dc6('0x44'),'appdata':_0x4b2923[_0x8dc6('0x35')][_0x5cb244]+'?'+_0x3e6723[_0x8dc6('0xb')]+_0x8dc6('0x45')+_0x405421+':'+_0x3e6723['context']+_0x8dc6('0x45')+_0x44b6ba,'exten':_0x3e6723['exten'],'context':_0x3e6723[_0x8dc6('0xb')],'priority':_0x548a6d+_0x5cb244,'VoiceExtensionId':_0x3e6723['id']});}if(_0x4b2923[_0x8dc6('0x46')]===_0x8dc6('0x47'))_0x4b2923['appdata']=_0x435a07(_0x3e6723,_0x4b2923[_0x8dc6('0x48')]);_0x4b2923[_0x8dc6('0x49')]=_0x2a14ee[_0x8dc6('0x25')]?_[_0x8dc6('0x4a')](_0x2a14ee)[_0x8dc6('0x49')]+0x1:_0x548a6d;_0x44c971=_['concat'](_0x44c971,_0x2a14ee,[_0x4b2923],_0x42278b);_0x548a6d=_[_0x8dc6('0x4a')](_0x44c971)[_0x8dc6('0x49')]+0x1;}return _0x536607(_0x44c971);})[_0x8dc6('0x4b')](function(_0x491269){_0x246f25(_0x491269);});});}return _0x5c3a9c[_0x8dc6('0x4c')](_0x8dc6('0x4d'),attributes,{'tableName':_0x8dc6('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x170b96){var _0x5155a7=this[_0x8dc6('0x4f')]({'plain':!![]});var _0x5db009=_0x5155a7[_0x8dc6('0x4')]===_0x8dc6('0x12')?_0x3a0c10(_0x5155a7):_0x33c2b8(_0x5155a7);return _0x41adef(_0x5155a7,_0x170b96,_[_0x8dc6('0x4a')](_0x5db009)[_0x8dc6('0x49')]+0x1)[_0x8dc6('0x33')](function(_0x15c513){var _0x8aa47e=_[_0x8dc6('0x50')](_0x5db009,_0x15c513);_0x8aa47e['push']({'type':_0x5155a7[_0x8dc6('0x4')],'app':_0x8dc6('0x51'),'exten':_0x5155a7[_0x8dc6('0x6')],'context':_0x5155a7[_0x8dc6('0xb')],'priority':_[_0x8dc6('0x4a')](_0x8aa47e)['priority']+0x1,'VoiceExtensionId':_0x5155a7['id']});return _0x8aa47e;});}}});}; \ No newline at end of file +var _0xbf18=['then','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','queue','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','get','Hangup','exports','models','CDR(type)=','type','context','exten','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url','length','name','param','split','phone','prefix','${EXTEN:','SIP','join','options','none','U(xcally-mixmonitor-context)','interval','IntervalId'];(function(_0x53f232,_0xc329a9){var _0x418e33=function(_0x3495ae){while(--_0x3495ae){_0x53f232['push'](_0x53f232['shift']());}};_0x418e33(++_0xc329a9);}(_0xbf18,0xfa));var _0x8bf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x8bf1('0x0')]=function(_0x25d756){var _0x8d0b33=_0x25d756[_0x8bf1('0x1')];function _0x2cf5c1(_0x35c729){var _0x6337f5=0x2;var _0x4d69f4=[{'type':_0x35c729['type'],'app':'Set','appdata':_0x8bf1('0x2')+_0x35c729[_0x8bf1('0x3')],'context':_0x35c729[_0x8bf1('0x4')],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']},{'type':_0x35c729['type'],'app':_0x35c729['alias']?'Set':_0x8bf1('0x6'),'appdata':_0x35c729['alias']?_0x8bf1('0x7')+_0x35c729[_0x8bf1('0x8')]:_0x8bf1('0x9'),'context':_0x35c729[_0x8bf1('0x4')],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']}];if(_0x35c729[_0x8bf1('0x3')]===_0x8bf1('0xa')){_0x4d69f4[_0x8bf1('0xb')]({'type':_0x8bf1('0xa'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0xd')+_0x35c729['id'],'context':_0x35c729[_0x8bf1('0x4')],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']});}_0x4d69f4[_0x8bf1('0xb')]({'type':_0x35c729['type'],'app':_0x8bf1('0xc'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x35c729[_0x8bf1('0x4')],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']},{'type':_0x35c729['type'],'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0xe'),'context':_0x35c729['context'],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']},{'type':_0x35c729[_0x8bf1('0x3')],'app':'Set','appdata':_0x8bf1('0xf'),'context':_0x35c729['context'],'exten':_0x35c729[_0x8bf1('0x5')],'priority':_0x6337f5++,'VoiceExtensionId':_0x35c729['id']});return _0x4d69f4;}function _0x11ab16(_0x532f2c){var _0x50dffa=0x2;var _0x1aa822=[{'type':'outbound','app':_0x8bf1('0xc'),'appdata':'CDR(type)=outbound','context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x532f2c[_0x8bf1('0x8')]?_0x8bf1('0xc'):_0x8bf1('0x6'),'appdata':_0x532f2c[_0x8bf1('0x8')]?_0x8bf1('0x7')+_0x532f2c[_0x8bf1('0x8')]:_0x8bf1('0x9'),'context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c['exten'],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':'outbound','app':'Set','appdata':_0x8bf1('0x11')+(_0x532f2c[_0x8bf1('0x12')]?'${EXTEN:'+_0x532f2c[_0x8bf1('0x12')]+'}':_0x8bf1('0x13')),'context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c['exten'],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0xd')+_0x532f2c['id'],'context':_0x532f2c['context'],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':'outbound','app':_0x8bf1('0x14'),'appdata':_0x8bf1('0x15')+(_0x50dffa+0x2)+'):Goto('+(_0x50dffa+0x1)+')','context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c['exten'],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x532f2c[_0x8bf1('0x12')]?_0x8bf1('0x16')+_0x532f2c[_0x8bf1('0x12')]+'}':_0x8bf1('0x17'),'context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0x18'),'context':_0x532f2c['context'],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0xe'),'context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0xf'),'context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':'outbound','app':_0x8bf1('0xc'),'appdata':_0x8bf1('0x19')+_0x532f2c['id'],'context':_0x532f2c['context'],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']}];if(_0x532f2c[_0x8bf1('0x1a')](_0x8bf1('0x1b'))&&_0x532f2c[_0x8bf1('0x1b')]!=='none'){_0x1aa822[_0x8bf1('0xb')]({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']},{'type':_0x8bf1('0x10'),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0x1c')+_0x532f2c[_0x8bf1('0x1b')]||'wav','context':_0x532f2c[_0x8bf1('0x4')],'exten':_0x532f2c[_0x8bf1('0x5')],'priority':_0x50dffa++,'VoiceExtensionId':_0x532f2c['id']});}return _0x1aa822;}function _0x5d7adc(_0x22a6ca,_0x122517){var _0x9ddd34=[{'name':_0x8bf1('0x1d'),'param':0x0},{'name':_0x8bf1('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0x8bf1('0x1f'),'param':0x3}];var _0x34c555={};var _0x427c51=_0x122517['split'](',');var _0x39767b=[];for(var _0x1be41c=0x0;_0x1be41c<_0x9ddd34[_0x8bf1('0x20')];_0x1be41c++){switch(_0x9ddd34[_0x1be41c][_0x8bf1('0x21')]){case _0x8bf1('0x1d'):_0x34c555[_0x8bf1('0x1d')]=_0x427c51[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]][_0x8bf1('0x23')]('/')[0x1];_0x34c555[_0x8bf1('0x24')]=_0x427c51[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]]['split']('/')[0x2];_0x34c555[_0x8bf1('0x25')]=_0x34c555['phone']?_0x34c555[_0x8bf1('0x24')][_0x8bf1('0x23')]('$')[0x0]:undefined;_0x34c555['phone']=_0x22a6ca[_0x8bf1('0x12')]?(_0x34c555[_0x8bf1('0x25')]||'')+_0x8bf1('0x26')+_0x22a6ca['cutdigits']+'}':(_0x34c555[_0x8bf1('0x25')]||'')+'${EXTEN}';_0x39767b[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]]=[_0x8bf1('0x27'),_0x34c555['trunk'],_0x34c555[_0x8bf1('0x24')]][_0x8bf1('0x28')]('/');break;case'options':_0x34c555[_0x8bf1('0x29')]=_0x427c51[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]];if(_0x22a6ca[_0x8bf1('0x1b')]!==_0x8bf1('0x2a')){if(_0x34c555['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x34c555[_0x8bf1('0x29')]+=_0x8bf1('0x2b');}}else{_0x34c555[_0x8bf1('0x29')]=_0x34c555['options']['replace'](_0x8bf1('0x2b'),'');}_0x39767b[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]]=_0x34c555[_0x8bf1('0x29')];break;default:_0x39767b[_0x9ddd34[_0x1be41c][_0x8bf1('0x22')]]=_0x427c51[_0x9ddd34[_0x1be41c]['param']];}}return _0x39767b[_0x8bf1('0x28')](',');}function _0x4aac8b(_0x37777b,_0x32888d,_0x30c1aa){return new Promise(function(_0xdab4af,_0x29474e){var _0x2dfc35=[];if(_['isEmpty'](_0x32888d))return _0xdab4af(_0x2dfc35);_0x8d0b33['Interval']['findAll']({'attributes':['id',_0x8bf1('0x2c'),_0x8bf1('0x2d')],'raw':!![]})[_0x8bf1('0x2e')](function(_0x2d4af1){for(var _0x5af30c=0x0,_0x5bb088=0x0;_0x5af30c<_0x32888d[_0x8bf1('0x20')];_0x5af30c++,_0x5bb088=0x0){var _0x850434=_0x32888d[_0x5af30c];var _0xa064=[];var _0x2dccd3=[];delete _0x850434['id'];if(_0x850434[_0x8bf1('0x2c')]!==_0x8bf1('0x2f')){_0x850434['intervals']=[_0x850434[_0x8bf1('0x2c')]];}else{_0x850434[_0x8bf1('0x30')]=_0x850434[_0x8bf1('0x2d')]?_['map'](_[_0x8bf1('0x31')](_0x2d4af1,{'IntervalId':_0x850434[_0x8bf1('0x2d')]}),_0x8bf1('0x2c')):[];}_0x850434[_0x8bf1('0x4')]=_0x37777b[_0x8bf1('0x4')];_0x850434[_0x8bf1('0x5')]=_0x37777b[_0x8bf1('0x5')];if(_0x850434['type'])_0x850434['type']=_0x850434[_0x8bf1('0x3')][_0x8bf1('0x32')]();if(_0x37777b[_0x8bf1('0x3')]===_0x8bf1('0x10')){if(_0x850434[_0x8bf1('0x1a')](_0x8bf1('0x33'))&&_0x850434['tag']&&_0x850434['tag']!=='--'){_0xa064[_0x8bf1('0xb')]({'type':_0x850434[_0x8bf1('0x3')][_0x8bf1('0x32')](),'app':_0x8bf1('0xc'),'appdata':_0x8bf1('0x34')+_0x850434[_0x8bf1('0x33')],'context':_0x37777b[_0x8bf1('0x4')],'exten':_0x37777b[_0x8bf1('0x5')],'priority':_0x850434['intervals']['length']+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});}_0xa064[_0x8bf1('0xb')]({'type':_0x850434[_0x8bf1('0x3')][_0x8bf1('0x32')](),'app':_0x8bf1('0x14'),'appdata':_0x8bf1('0x35')+(_0x850434['callerID']?_0x8bf1('0x36')+_0x850434[_0x8bf1('0x37')]+')':_0x8bf1('0x38')),'context':_0x37777b[_0x8bf1('0x4')],'exten':_0x37777b[_0x8bf1('0x5')],'priority':_0x850434[_0x8bf1('0x30')][_0x8bf1('0x20')]+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});}else{if(_0x850434[_0x8bf1('0x1a')]('answer')){if([_0x8bf1('0x39'),'playback']['includes'](_0x850434[_0x8bf1('0x3a')][_0x8bf1('0x32')]())&&_0x850434[_0x8bf1('0x3b')]!==_0x8bf1('0x3c')){if(_0x850434['answer']){_0xa064['push']({'type':_0x850434[_0x8bf1('0x3')][_0x8bf1('0x32')](),'app':_0x8bf1('0x14'),'appdata':_0x8bf1('0x3d'),'context':_0x37777b[_0x8bf1('0x4')],'exten':_0x37777b[_0x8bf1('0x5')],'priority':_0x850434[_0x8bf1('0x30')][_0x8bf1('0x20')]+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});_0xa064[_0x8bf1('0xb')]({'type':_0x850434['type'][_0x8bf1('0x32')](),'app':_0x8bf1('0xc'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x37777b[_0x8bf1('0x4')],'exten':_0x37777b['exten'],'priority':_0x850434['intervals'][_0x8bf1('0x20')]+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});}else{_0xa064[_0x8bf1('0xb')]({'type':_0x850434['type']['toLowerCase'](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x37777b['context'],'exten':_0x37777b[_0x8bf1('0x5')],'priority':_0x850434[_0x8bf1('0x30')]['length']+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});_0xa064[_0x8bf1('0xb')]({'type':_0x850434[_0x8bf1('0x3')][_0x8bf1('0x32')](),'app':_0x8bf1('0xc'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x37777b[_0x8bf1('0x4')],'exten':_0x37777b['exten'],'priority':_0x850434[_0x8bf1('0x30')]['length']+_0x30c1aa+_0x5bb088++,'VoiceExtensionId':_0x37777b['id']});}}}}for(var _0xb38827=0x0;_0xb38827<_0x850434[_0x8bf1('0x30')][_0x8bf1('0x20')];_0xb38827++){var _0x301c0d=_0x30c1aa+_0x850434[_0x8bf1('0x30')]['length'];var _0xb024b8=_0xb38827===_0x850434['intervals']['length']-0x1?_0x30c1aa+_0xa064[_0x8bf1('0x20')]+_0x2dccd3[_0x8bf1('0x20')]+0x2:_0x30c1aa+_0xb38827+0x1;_0xa064[_0x8bf1('0x3e')](_0xb38827,0x0,{'type':_0x37777b[_0x8bf1('0x3')],'app':_0x8bf1('0x3f'),'appdata':_0x850434[_0x8bf1('0x30')][_0xb38827]+'?'+_0x37777b['context']+_0x8bf1('0x40')+_0x301c0d+':'+_0x37777b[_0x8bf1('0x4')]+_0x8bf1('0x40')+_0xb024b8,'exten':_0x37777b[_0x8bf1('0x5')],'context':_0x37777b[_0x8bf1('0x4')],'priority':_0x30c1aa+_0xb38827,'VoiceExtensionId':_0x37777b['id']});}if(_0x850434['appType']===_0x8bf1('0x41'))_0x850434[_0x8bf1('0x42')]=_0x5d7adc(_0x37777b,_0x850434[_0x8bf1('0x42')]);_0x850434[_0x8bf1('0x43')]=_0xa064[_0x8bf1('0x20')]?_[_0x8bf1('0x44')](_0xa064)[_0x8bf1('0x43')]+0x1:_0x30c1aa;_0x2dfc35=_[_0x8bf1('0x45')](_0x2dfc35,_0xa064,[_0x850434],_0x2dccd3);_0x30c1aa=_['last'](_0x2dfc35)[_0x8bf1('0x43')]+0x1;}return _0xdab4af(_0x2dfc35);})[_0x8bf1('0x46')](function(_0x54ed91){_0x29474e(_0x54ed91);});});}return _0x25d756['define'](_0x8bf1('0x47'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xd3b44a){var _0x25d326=this[_0x8bf1('0x48')]({'plain':!![]});var _0x3becc0=_0x25d326[_0x8bf1('0x3')]==='outbound'?_0x11ab16(_0x25d326):_0x2cf5c1(_0x25d326);return _0x4aac8b(_0x25d326,_0xd3b44a,_[_0x8bf1('0x44')](_0x3becc0)[_0x8bf1('0x43')]+0x1)[_0x8bf1('0x2e')](function(_0x7165f){var _0x5660ab=_['concat'](_0x3becc0,_0x7165f);_0x5660ab[_0x8bf1('0xb')]({'type':_0x25d326[_0x8bf1('0x3')],'app':_0x8bf1('0x49'),'exten':_0x25d326[_0x8bf1('0x5')],'context':_0x25d326[_0x8bf1('0x4')],'priority':_[_0x8bf1('0x44')](_0x5660ab)['priority']+0x1,'VoiceExtensionId':_0x25d326['id']});return _0x5660ab;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 272d968..c7b8ed1 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb957=['map','model','debug','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0xd07e81,_0x1ccacd){var _0x379364=function(_0x8f8eec){while(--_0x8f8eec){_0xd07e81['push'](_0xd07e81['shift']());}};_0x379364(++_0x1ccacd);}(_0xb957,0x6d));var _0x7b95=function(_0x55cfc1,_0x384632){_0x55cfc1=_0x55cfc1-0x0;var _0x47fdde=_0xb957[_0x55cfc1];return _0x47fdde;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b95('0x0'));var BPromise=require('bluebird');var rs=require(_0x7b95('0x1'));var fs=require('fs');var Redis=require(_0x7b95('0x2'));var db=require(_0x7b95('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b95('0x4'))(_0x7b95('0x5'));var config=require(_0x7b95('0x6'));var jayson=require(_0x7b95('0x7'));var client=jayson[_0x7b95('0x8')]['http']({'port':0x232a});config[_0x7b95('0x9')]=_[_0x7b95('0xa')](config[_0x7b95('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b95('0x9')]));require(_0x7b95('0xb'))[_0x7b95('0xc')](socket);function respondWithRpcPromise(_0xbbfbcd,_0x5b302b,_0x4e72cc){return new BPromise(function(_0x509a65,_0x4165dd){return client[_0x7b95('0xd')](_0xbbfbcd,_0x4e72cc)['then'](function(_0x5ace7a){logger[_0x7b95('0xe')](_0x7b95('0xf'),_0x5b302b,_0x7b95('0x10'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5b302b,_0x7b95('0x10'),JSON['stringify'](_0x5ace7a));if(_0x5ace7a[_0x7b95('0x11')]){if(_0x5ace7a[_0x7b95('0x11')][_0x7b95('0x12')]===0x1f4){logger[_0x7b95('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x5b302b,_0x5ace7a['error'][_0x7b95('0x13')]);return _0x4165dd(_0x5ace7a[_0x7b95('0x11')][_0x7b95('0x13')]);}logger[_0x7b95('0x11')](_0x7b95('0xf'),_0x5b302b,_0x5ace7a[_0x7b95('0x11')][_0x7b95('0x13')]);return _0x509a65(_0x5ace7a[_0x7b95('0x11')][_0x7b95('0x13')]);}else{logger[_0x7b95('0xe')](_0x7b95('0xf'),_0x5b302b,'request\x20sent');_0x509a65(_0x5ace7a[_0x7b95('0x14')][_0x7b95('0x13')]);}})[_0x7b95('0x15')](function(_0x2c074b){logger[_0x7b95('0x11')](_0x7b95('0xf'),_0x5b302b,_0x2c074b);_0x4165dd(_0x2c074b);});});}exports[_0x7b95('0x16')]=function(_0x3b0325){var _0x49b477=this;return new Promise(function(_0x2b8912,_0x342ecc){return db[_0x7b95('0x17')][_0x7b95('0x18')]({'raw':_0x3b0325[_0x7b95('0x19')]?_0x3b0325[_0x7b95('0x19')][_0x7b95('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b0325[_0x7b95('0x19')]?_0x3b0325[_0x7b95('0x19')][_0x7b95('0x1b')]||null:null,'attributes':_0x3b0325[_0x7b95('0x19')]?_0x3b0325[_0x7b95('0x19')][_0x7b95('0x1c')]||null:null,'limit':_0x3b0325[_0x7b95('0x19')]?_0x3b0325['options'][_0x7b95('0x1d')]||null:null,'include':_0x3b0325[_0x7b95('0x19')]?_0x3b0325['options'][_0x7b95('0x1e')]?_[_0x7b95('0x1f')](_0x3b0325[_0x7b95('0x19')][_0x7b95('0x1e')],function(_0xdfc408){return{'model':db[_0xdfc408[_0x7b95('0x20')]],'as':_0xdfc408['as'],'attributes':_0xdfc408[_0x7b95('0x1c')],'include':_0xdfc408['include']?_[_0x7b95('0x1f')](_0xdfc408['include'],function(_0x2fdc2d){return{'model':db[_0x2fdc2d[_0x7b95('0x20')]],'as':_0x2fdc2d['as'],'attributes':_0x2fdc2d[_0x7b95('0x1c')],'include':_0x2fdc2d[_0x7b95('0x1e')]?_[_0x7b95('0x1f')](_0x2fdc2d[_0x7b95('0x1e')],function(_0x492752){return{'model':db[_0x492752[_0x7b95('0x20')]],'as':_0x492752['as'],'attributes':_0x492752[_0x7b95('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a771c){logger[_0x7b95('0xe')](_0x7b95('0x16'),_0x3b0325);logger[_0x7b95('0x21')]('GetVoiceExtension',_0x3b0325,JSON[_0x7b95('0x22')](_0x3a771c));_0x2b8912(_0x3a771c);})[_0x7b95('0x15')](function(_0x45ffb5){logger['error']('GetVoiceExtension',_0x45ffb5[_0x7b95('0x13')],_0x3b0325);_0x342ecc(_0x49b477[_0x7b95('0x11')](0x1f4,_0x45ffb5['message']));});});}; \ No newline at end of file +var _0x2086=['redis','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xa8c86c,_0x44d37c){var _0x4ac529=function(_0x2c0814){while(--_0x2c0814){_0xa8c86c['push'](_0xa8c86c['shift']());}};_0x4ac529(++_0x44d37c);}(_0x2086,0x124));var _0x6208=function(_0x2819ff,_0x1c4f9a){_0x2819ff=_0x2819ff-0x0;var _0x3f7dd1=_0x2086[_0x2819ff];return _0x3f7dd1;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var moment=require(_0x6208('0x2'));var BPromise=require(_0x6208('0x3'));var rs=require(_0x6208('0x4'));var fs=require('fs');var Redis=require(_0x6208('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6208('0x6'));var logger=require(_0x6208('0x7'))('rpc');var config=require(_0x6208('0x8'));var jayson=require(_0x6208('0x9'));var client=jayson[_0x6208('0xa')][_0x6208('0xb')]({'port':0x232a});config[_0x6208('0xc')]=_['defaults'](config[_0x6208('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6208('0xc')]));require(_0x6208('0xd'))[_0x6208('0xe')](socket);function respondWithRpcPromise(_0x985f3b,_0x89fad2,_0x497a79){return new BPromise(function(_0x523b66,_0x4f1bfa){return client[_0x6208('0xf')](_0x985f3b,_0x497a79)[_0x6208('0x10')](function(_0x234c45){logger[_0x6208('0x11')](_0x6208('0x12'),_0x89fad2,'request\x20sent');logger[_0x6208('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x89fad2,_0x6208('0x14'),JSON[_0x6208('0x15')](_0x234c45));if(_0x234c45[_0x6208('0x16')]){if(_0x234c45['error'][_0x6208('0x17')]===0x1f4){logger[_0x6208('0x16')](_0x6208('0x12'),_0x89fad2,_0x234c45['error'][_0x6208('0x18')]);return _0x4f1bfa(_0x234c45[_0x6208('0x16')][_0x6208('0x18')]);}logger['error'](_0x6208('0x12'),_0x89fad2,_0x234c45[_0x6208('0x16')][_0x6208('0x18')]);return _0x523b66(_0x234c45['error']['message']);}else{logger[_0x6208('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x89fad2,'request\x20sent');_0x523b66(_0x234c45[_0x6208('0x19')]['message']);}})[_0x6208('0x1a')](function(_0x3dc8cd){logger[_0x6208('0x16')](_0x6208('0x12'),_0x89fad2,_0x3dc8cd);_0x4f1bfa(_0x3dc8cd);});});}exports[_0x6208('0x1b')]=function(_0x1c436c){var _0x35bc58=this;return new Promise(function(_0x1bc3f5,_0x328af9){return db[_0x6208('0x1c')][_0x6208('0x1d')]({'raw':_0x1c436c[_0x6208('0x1e')]?_0x1c436c['options'][_0x6208('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c436c[_0x6208('0x1e')]?_0x1c436c[_0x6208('0x1e')][_0x6208('0x20')]||null:null,'attributes':_0x1c436c[_0x6208('0x1e')]?_0x1c436c[_0x6208('0x1e')][_0x6208('0x21')]||null:null,'limit':_0x1c436c[_0x6208('0x1e')]?_0x1c436c['options'][_0x6208('0x22')]||null:null,'include':_0x1c436c[_0x6208('0x1e')]?_0x1c436c[_0x6208('0x1e')][_0x6208('0x23')]?_[_0x6208('0x24')](_0x1c436c[_0x6208('0x1e')][_0x6208('0x23')],function(_0x364b13){return{'model':db[_0x364b13[_0x6208('0x25')]],'as':_0x364b13['as'],'attributes':_0x364b13[_0x6208('0x21')],'include':_0x364b13['include']?_[_0x6208('0x24')](_0x364b13[_0x6208('0x23')],function(_0x330ac9){return{'model':db[_0x330ac9[_0x6208('0x25')]],'as':_0x330ac9['as'],'attributes':_0x330ac9[_0x6208('0x21')],'include':_0x330ac9[_0x6208('0x23')]?_['map'](_0x330ac9['include'],function(_0x76dcda){return{'model':db[_0x76dcda[_0x6208('0x25')]],'as':_0x76dcda['as'],'attributes':_0x76dcda[_0x6208('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6208('0x10')](function(_0x5663f7){logger[_0x6208('0x11')](_0x6208('0x1b'),_0x1c436c);logger['debug'](_0x6208('0x1b'),_0x1c436c,JSON['stringify'](_0x5663f7));_0x1bc3f5(_0x5663f7);})['catch'](function(_0x53f775){logger[_0x6208('0x16')]('GetVoiceExtension',_0x53f775[_0x6208('0x18')],_0x1c436c);_0x328af9(_0x35bc58['error'](0x1f4,_0x53f775[_0x6208('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7599c9e..c1ee4f2 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0xfcdf1b,_0x15d076){var _0x4ec01a=function(_0x4181bd){while(--_0x4181bd){_0xfcdf1b['push'](_0xfcdf1b['shift']());}};_0x4ec01a(++_0x15d076);}(_0xe14b,0x93));var _0xbe14=function(_0x5e5f75,_0x16b627){_0x5e5f75=_0x5e5f75-0x0;var _0x41020c=_0xe14b[_0x5e5f75];return _0x41020c;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x4a5ca4,_0x4ad2e4){var _0x1d123=function(_0x3b9fee){while(--_0x3b9fee){_0x4a5ca4['push'](_0x4a5ca4['shift']());}};_0x1d123(++_0x4ad2e4);}(_0x4975,0x86));var _0x5497=function(_0x2b262a,_0x1d89a4){_0x2b262a=_0x2b262a-0x0;var _0x4e3eb4=_0x4975[_0x2b262a];return _0x4e3eb4;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index efdb19a..ce456b9 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90b1=['getMessages','post','create','put','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/messages'];(function(_0x182648,_0x2a7b01){var _0x10d106=function(_0x343645){while(--_0x343645){_0x182648['push'](_0x182648['shift']());}};_0x10d106(++_0x2a7b01);}(_0x90b1,0x1bb));var _0x190b=function(_0x27999e,_0x1cbbd2){_0x27999e=_0x27999e-0x0;var _0x19498d=_0x90b1[_0x27999e];return _0x19498d;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0xe')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x10')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0x11')]);router['delete'](_0x190b('0x9'),auth[_0x190b('0xa')](),controller['destroy']);module[_0x190b('0x12')]=router; \ No newline at end of file +var _0x9a5a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','getMessages'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a5a,0x194));var _0xa9a5=function(_0x2a0820,_0x4cdf67){_0x2a0820=_0x2a0820-0x0;var _0x5a932d=_0x9a5a[_0x2a0820];return _0x5a932d;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')]('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0x12')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller['update']);router['delete']('/:id',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);module[_0xa9a5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index bcb301e..9cdbca9 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf950=['central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','STRING','setDataValue','string','trim'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xf950,0x14b));var _0x0f95=function(_0x531f56,_0x334fcc){_0x531f56=_0x531f56-0x0;var _0x2cd1d4=_0xf950[_0x531f56];return _0x2cd1d4;};'use strict';var Sequelize=require(_0x0f95('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x0f95('0x1')]},'context':{'type':Sequelize[_0x0f95('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x0f95('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x0f95('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0f95('0x1')],'validate':{'isEmail':!![]},'set':function(_0x29f326){this[_0x0f95('0x2')]('email',typeof _0x29f326===_0x0f95('0x3')&&_0x29f326[_0x0f95('0x4')]()?_0x29f326[_0x0f95('0x4')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x0f95('0x1')],'defaultValue':_0x0f95('0x5')},'attach':{'type':Sequelize['ENUM'](_0x0f95('0x6'),'no'),'defaultValue':_0x0f95('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':_0x0f95('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0f95('0x1')]},'callback':{'type':Sequelize[_0x0f95('0x1')]},'review':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0f95('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0f95('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x0f95('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x0f95('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0f95('0x7')](_0x0f95('0x6'),'no'),'defaultValue':_0x0f95('0x6'),'allowNull':![]},'stamp':{'type':_0x0f95('0x9')},'emailsubject':{'type':Sequelize[_0x0f95('0x1')]},'emailbody':{'type':Sequelize[_0x0f95('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0f95('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0f95('0xb')],'get':function(){return this['getDataValue']('fullname')+'\x20-\x20'+this[_0x0f95('0xc')](_0x0f95('0xd'));}}}; \ No newline at end of file +var _0x6408=['fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x1b1a64,_0x4fac87){var _0x363964=function(_0x416341){while(--_0x416341){_0x1b1a64['push'](_0x1b1a64['shift']());}};_0x363964(++_0x4fac87);}(_0x6408,0x148));var _0x8640=function(_0x1648bc,_0x18db3d){_0x1648bc=_0x1648bc-0x0;var _0x1e0c83=_0x6408[_0x1648bc];return _0x1e0c83;};'use strict';var Sequelize=require(_0x8640('0x0'));module[_0x8640('0x1')]={'customer_id':{'type':Sequelize[_0x8640('0x2')]},'context':{'type':Sequelize[_0x8640('0x2')],'defaultValue':_0x8640('0x3'),'unique':_0x8640('0x4')},'mailbox':{'type':Sequelize[_0x8640('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8640('0x4')},'password':{'type':Sequelize[_0x8640('0x2')]},'fullname':{'type':Sequelize[_0x8640('0x2')]},'email':{'type':Sequelize[_0x8640('0x2')],'validate':{'isEmail':!![]},'set':function(_0x43c8e5){this['setDataValue'](_0x8640('0x5'),typeof _0x43c8e5===_0x8640('0x6')&&_0x43c8e5[_0x8640('0x7')]()?_0x43c8e5['trim']():null);}},'pager':{'type':Sequelize[_0x8640('0x2')]},'tz':{'type':Sequelize[_0x8640('0x2')],'defaultValue':_0x8640('0x8')},'attach':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':_0x8640('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':_0x8640('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8640('0x2')]},'callback':{'type':Sequelize[_0x8640('0x2')]},'review':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8640('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x8640('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8640('0x9')](_0x8640('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8640('0xa'),'no'),'defaultValue':_0x8640('0xa'),'allowNull':![]},'stamp':{'type':_0x8640('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8640('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8640('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8640('0xd')],'get':function(){return this['getDataValue'](_0x8640('0xe'))+_0x8640('0xf')+this[_0x8640('0x10')](_0x8640('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a8cbc40..192aefe 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','VoiceMail','findAll','catch','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x37ab75,_0x51d6f6){var _0x510beb=function(_0x236060){while(--_0x236060){_0x37ab75['push'](_0x37ab75['shift']());}};_0x510beb(++_0x51d6f6);}(_0xe706,0xa3));var _0x6e70=function(_0x1d2adf,_0x8b056f){_0x1d2adf=_0x1d2adf-0x0;var _0x431bd7=_0xe706[_0x1d2adf];return _0x431bd7;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){var _0x41e352=_0x538b9c[_0x6e70('0x2a')]({'plain':!![]});var _0x51d292=_0x6e70('0x2b');return db[_0x6e70('0x2c')]['destroy']({'where':{'type':_0x51d292,'resourceId':_0x41e352['id']}})[_0x6e70('0x29')](function(){return _0x538b9c;});})[_0x6e70('0x29')](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a5fe,_0x2c4d37){return function(_0x3af17f){if(!_0x3af17f){_0x54a5fe[_0x6e70('0x1d')](0x194);}return _0x3af17f;};}function handleError(_0x114344,_0x43fee0){_0x43fee0=_0x43fee0||0x1f4;return function(_0x5d772a){logger[_0x6e70('0x2d')](_0x5d772a[_0x6e70('0x2e')]);if(_0x5d772a[_0x6e70('0x2f')]){delete _0x5d772a[_0x6e70('0x2f')];}_0x114344[_0x6e70('0x1e')](_0x43fee0)[_0x6e70('0x30')](_0x5d772a);};}exports[_0x6e70('0x31')]=function(_0x24114a,_0x3a0821){var _0x3a5d30={},_0x4b1229={},_0x1b27d8={'count':0x0,'rows':[]};var _0x50d60b=_[_0x6e70('0x32')](db['VoiceMail'][_0x6e70('0x33')],function(_0x2722e8){return{'name':_0x2722e8[_0x6e70('0x34')],'type':_0x2722e8['type'][_0x6e70('0x35')]};});_0x4b1229[_0x6e70('0x36')]=_['map'](_0x50d60b,_0x6e70('0x2f'));_0x4b1229[_0x6e70('0x37')]=_['keys'](_0x24114a[_0x6e70('0x37')]);_0x4b1229[_0x6e70('0x38')]=_[_0x6e70('0x39')](_0x4b1229[_0x6e70('0x36')],_0x4b1229[_0x6e70('0x37')]);_0x3a5d30[_0x6e70('0x3a')]=_[_0x6e70('0x39')](_0x4b1229[_0x6e70('0x36')],qs[_0x6e70('0x3b')](_0x24114a[_0x6e70('0x37')]['fields']));_0x3a5d30[_0x6e70('0x3a')]=_0x3a5d30['attributes'][_0x6e70('0x3c')]?_0x3a5d30[_0x6e70('0x3a')]:_0x4b1229[_0x6e70('0x36')];if(!_0x24114a[_0x6e70('0x37')][_0x6e70('0x3d')](_0x6e70('0x3e'))){_0x3a5d30[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x24114a[_0x6e70('0x37')][_0x6e70('0x20')]);_0x3a5d30[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x24114a[_0x6e70('0x37')]['offset']);}_0x3a5d30['order']=qs['sort'](_0x24114a[_0x6e70('0x37')][_0x6e70('0x3f')]);_0x3a5d30[_0x6e70('0x40')]=qs[_0x6e70('0x38')](_[_0x6e70('0x41')](_0x24114a[_0x6e70('0x37')],_0x4b1229['filters']),_0x50d60b);if(_0x24114a[_0x6e70('0x37')][_0x6e70('0x42')]){_0x3a5d30[_0x6e70('0x40')]=_[_0x6e70('0x43')](_0x3a5d30[_0x6e70('0x40')],{'$or':_[_0x6e70('0x32')](_0x50d60b,function(_0x246e61){if(_0x246e61[_0x6e70('0x44')]!=='VIRTUAL'){var _0x2c0bd1={};_0x2c0bd1[_0x246e61[_0x6e70('0x2f')]]={'$like':'%'+_0x24114a[_0x6e70('0x37')][_0x6e70('0x42')]+'%'};return _0x2c0bd1;}})});}_0x3a5d30=_[_0x6e70('0x43')]({},_0x3a5d30,_0x24114a[_0x6e70('0x45')]);var _0x21b0e7={'where':_0x3a5d30['where']};return db['VoiceMail']['count'](_0x21b0e7)[_0x6e70('0x29')](function(_0x2b63cc){_0x1b27d8[_0x6e70('0x21')]=_0x2b63cc;if(_0x24114a[_0x6e70('0x37')][_0x6e70('0x46')]){_0x3a5d30['include']=[{'all':!![]}];}return db[_0x6e70('0x47')][_0x6e70('0x48')](_0x3a5d30);})[_0x6e70('0x29')](function(_0x52b197){_0x1b27d8['rows']=_0x52b197;return _0x1b27d8;})['then'](respondWithFilteredResult(_0x3a0821,_0x3a5d30))[_0x6e70('0x49')](handleError(_0x3a0821,null));};exports['show']=function(_0x42f49a,_0x39913a){var _0x3fed21={'raw':!![],'where':{'id':_0x42f49a['params']['id']}},_0x75a90d={};_0x75a90d[_0x6e70('0x36')]=_['keys'](db[_0x6e70('0x47')][_0x6e70('0x33')]);_0x75a90d[_0x6e70('0x37')]=_[_0x6e70('0x4a')](_0x42f49a['query']);_0x75a90d[_0x6e70('0x38')]=_[_0x6e70('0x39')](_0x75a90d[_0x6e70('0x36')],_0x75a90d[_0x6e70('0x37')]);_0x3fed21[_0x6e70('0x3a')]=_[_0x6e70('0x39')](_0x75a90d[_0x6e70('0x36')],qs['fields'](_0x42f49a[_0x6e70('0x37')][_0x6e70('0x3b')]));_0x3fed21[_0x6e70('0x3a')]=_0x3fed21[_0x6e70('0x3a')][_0x6e70('0x3c')]?_0x3fed21[_0x6e70('0x3a')]:_0x75a90d[_0x6e70('0x36')];if(_0x42f49a['query'][_0x6e70('0x46')]){_0x3fed21['include']=[{'all':!![]}];}_0x3fed21=_[_0x6e70('0x43')]({},_0x3fed21,_0x42f49a[_0x6e70('0x45')]);return db['VoiceMail']['find'](_0x3fed21)[_0x6e70('0x29')](handleEntityNotFound(_0x39913a,null))[_0x6e70('0x29')](respondWithResult(_0x39913a,null))[_0x6e70('0x49')](handleError(_0x39913a,null));};exports['create']=function(_0x4af9b1,_0x238ebb){return db[_0x6e70('0x47')][_0x6e70('0x4b')](_0x4af9b1[_0x6e70('0x4c')],{})[_0x6e70('0x29')](function(_0x340674){var _0x4ad5a9=_0x4af9b1[_0x6e70('0x4d')][_0x6e70('0x2a')]({'plain':!![]});if(!_0x4ad5a9)throw new Error(_0x6e70('0x4e'));if(_0x4ad5a9[_0x6e70('0x4f')]===_0x6e70('0x4d')){var _0x4b354e=_0x340674['get']({'plain':!![]});var _0x2c5538=_0x6e70('0x2b');return db[_0x6e70('0x50')][_0x6e70('0x51')]({'where':{'name':_0x2c5538,'userProfileId':_0x4ad5a9[_0x6e70('0x52')]},'raw':!![]})['then'](function(_0x41bd0b){if(_0x41bd0b&&_0x41bd0b[_0x6e70('0x53')]===0x0){return db[_0x6e70('0x2c')][_0x6e70('0x4b')]({'name':_0x4b354e[_0x6e70('0x2f')],'resourceId':_0x4b354e['id'],'type':_0x41bd0b['name'],'sectionId':_0x41bd0b['id']},{})[_0x6e70('0x29')](function(){return _0x340674;});}else{return _0x340674;}})[_0x6e70('0x49')](function(_0x2c20d3){logger[_0x6e70('0x2d')](_0x6e70('0x54'),_0x2c20d3);throw _0x2c20d3;});}return _0x340674;})[_0x6e70('0x29')](respondWithResult(_0x238ebb,0xc9))['catch'](handleError(_0x238ebb,null));};exports[_0x6e70('0x28')]=function(_0x8d425d,_0x5c2396){if(_0x8d425d[_0x6e70('0x4c')]['id']){delete _0x8d425d[_0x6e70('0x4c')]['id'];}return db['VoiceMail'][_0x6e70('0x51')]({'where':{'id':_0x8d425d[_0x6e70('0x55')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x5c2396,null))[_0x6e70('0x29')](saveUpdates(_0x8d425d[_0x6e70('0x4c')],null))['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0x49')](handleError(_0x5c2396,null));};exports[_0x6e70('0x56')]=function(_0x10d655,_0x13be81){return db[_0x6e70('0x47')][_0x6e70('0x51')]({'where':{'id':_0x10d655[_0x6e70('0x55')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x13be81,null))[_0x6e70('0x29')](removeEntity(_0x13be81,null))[_0x6e70('0x49')](handleError(_0x13be81,null));};exports[_0x6e70('0x57')]=function(_0x1b12a1,_0xb8f78,_0x1fd9a6){return db[_0x6e70('0x47')][_0x6e70('0x58')]({'where':{'id':_0x1b12a1[_0x6e70('0x55')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0xb8f78,null))[_0x6e70('0x29')](function(_0x1c7dca){var _0x4c6aab;var _0x28898a={},_0x4434dd={};_0x4434dd[_0x6e70('0x36')]=_[_0x6e70('0x4a')](db[_0x6e70('0x59')][_0x6e70('0x33')]);_0x4434dd['query']=_[_0x6e70('0x4a')](_0x1b12a1[_0x6e70('0x37')]);_0x4434dd['filters']=_[_0x6e70('0x39')](_0x4434dd[_0x6e70('0x36')],_0x4434dd[_0x6e70('0x37')]);_0x28898a['attributes']=_['intersection'](_0x4434dd[_0x6e70('0x36')],qs[_0x6e70('0x3b')](_0x1b12a1[_0x6e70('0x37')][_0x6e70('0x3b')]));_0x28898a[_0x6e70('0x3a')]=_0x28898a[_0x6e70('0x3a')][_0x6e70('0x3c')]?_0x28898a['attributes']:_0x4434dd['model'];if(!_0x1b12a1[_0x6e70('0x37')][_0x6e70('0x3d')](_0x6e70('0x3e'))){_0x28898a[_0x6e70('0x20')]=qs['limit'](_0x1b12a1['query'][_0x6e70('0x20')]);_0x28898a[_0x6e70('0x22')]=qs['offset'](_0x1b12a1['query'][_0x6e70('0x22')]);}_0x28898a['order']=qs[_0x6e70('0x3f')](_0x1b12a1[_0x6e70('0x37')][_0x6e70('0x3f')]);_0x28898a[_0x6e70('0x40')]=qs[_0x6e70('0x38')](_[_0x6e70('0x41')](_0x1b12a1[_0x6e70('0x37')],_0x4434dd[_0x6e70('0x38')]));if(_0x1b12a1['query'][_0x6e70('0x42')]){_0x28898a[_0x6e70('0x40')]=_[_0x6e70('0x43')](_0x28898a[_0x6e70('0x40')],{'$or':_[_0x6e70('0x32')](_0x28898a['attributes'],function(_0x5f5b02){var _0x5979bf={};_0x5979bf[_0x5f5b02]={'$like':'%'+_0x1b12a1[_0x6e70('0x37')][_0x6e70('0x42')]+'%'};return _0x5979bf;})});}_0x28898a[_0x6e70('0x40')]=_['merge'](_0x28898a['where'],{'mailboxuser':_0x1c7dca[_0x6e70('0x5a')]});_0x28898a=_[_0x6e70('0x43')]({},_0x28898a,_0x1b12a1[_0x6e70('0x45')]);return db[_0x6e70('0x59')][_0x6e70('0x5b')](_0x28898a)[_0x6e70('0x29')](respondWithFilteredResult(_0xb8f78,_0x28898a));})['catch'](handleError(_0xb8f78,null));}; \ No newline at end of file +var _0x5423=['offset','undefined','count','limit','set','Content-Range','reject','destroy','get','Voicemails','UserProfileResource','then','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','model','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','intersection','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','params','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x31a2dd,_0x3beb5e){var _0x1bff32=function(_0x4f3b37){while(--_0x4f3b37){_0x31a2dd['push'](_0x31a2dd['shift']());}};_0x1bff32(++_0x3beb5e);}(_0x5423,0xe3));var _0x3542=function(_0x2478b6,_0x7c8ebd){_0x2478b6=_0x2478b6-0x0;var _0x23056a=_0x5423[_0x2478b6];return _0x23056a;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){var _0x160caa=_0x5d05b2[_0x3542('0x24')]({'plain':!![]});var _0x1e0723=_0x3542('0x25');return db[_0x3542('0x26')][_0x3542('0x23')]({'where':{'type':_0x1e0723,'resourceId':_0x160caa['id']}})[_0x3542('0x27')](function(){return _0x5d05b2;});})[_0x3542('0x27')](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0xfdfe62,_0x4462c4){return function(_0x220021){if(!_0x220021){_0xfdfe62[_0x3542('0x18')](0x194);}return _0x220021;};}function handleError(_0x1cab35,_0x39050a){_0x39050a=_0x39050a||0x1f4;return function(_0x303412){logger[_0x3542('0x28')](_0x303412[_0x3542('0x29')]);if(_0x303412['name']){delete _0x303412[_0x3542('0x2a')];}_0x1cab35[_0x3542('0x19')](_0x39050a)[_0x3542('0x2b')](_0x303412);};}exports['index']=function(_0x402c97,_0xc6f23b){var _0x2e883a={},_0x30b5e8={},_0x5c882f={'count':0x0,'rows':[]};var _0x5a274b=_[_0x3542('0x2c')](db[_0x3542('0x2d')][_0x3542('0x2e')],function(_0x44e8f7){return{'name':_0x44e8f7[_0x3542('0x2f')],'type':_0x44e8f7[_0x3542('0x30')][_0x3542('0x31')]};});_0x30b5e8['model']=_['map'](_0x5a274b,_0x3542('0x2a'));_0x30b5e8['query']=_['keys'](_0x402c97[_0x3542('0x32')]);_0x30b5e8['filters']=_['intersection'](_0x30b5e8[_0x3542('0x33')],_0x30b5e8[_0x3542('0x32')]);_0x2e883a[_0x3542('0x34')]=_['intersection'](_0x30b5e8[_0x3542('0x33')],qs['fields'](_0x402c97[_0x3542('0x32')][_0x3542('0x35')]));_0x2e883a['attributes']=_0x2e883a[_0x3542('0x34')]['length']?_0x2e883a[_0x3542('0x34')]:_0x30b5e8[_0x3542('0x33')];if(!_0x402c97[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x2e883a['limit']=qs[_0x3542('0x1f')](_0x402c97[_0x3542('0x32')][_0x3542('0x1f')]);_0x2e883a[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x402c97[_0x3542('0x32')][_0x3542('0x1c')]);}_0x2e883a[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x402c97[_0x3542('0x32')][_0x3542('0x38')]);_0x2e883a[_0x3542('0x39')]=qs[_0x3542('0x3a')](_['pick'](_0x402c97[_0x3542('0x32')],_0x30b5e8['filters']),_0x5a274b);if(_0x402c97['query'][_0x3542('0x3b')]){_0x2e883a[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x2e883a[_0x3542('0x39')],{'$or':_[_0x3542('0x2c')](_0x5a274b,function(_0x21aec3){if(_0x21aec3[_0x3542('0x30')]!==_0x3542('0x3d')){var _0x53eac6={};_0x53eac6[_0x21aec3[_0x3542('0x2a')]]={'$like':'%'+_0x402c97['query'][_0x3542('0x3b')]+'%'};return _0x53eac6;}})});}_0x2e883a=_[_0x3542('0x3c')]({},_0x2e883a,_0x402c97['options']);var _0x371aba={'where':_0x2e883a[_0x3542('0x39')]};return db['VoiceMail'][_0x3542('0x1e')](_0x371aba)[_0x3542('0x27')](function(_0x5e1b29){_0x5c882f[_0x3542('0x1e')]=_0x5e1b29;if(_0x402c97[_0x3542('0x32')][_0x3542('0x3e')]){_0x2e883a[_0x3542('0x3f')]=[{'all':!![]}];}return db[_0x3542('0x2d')][_0x3542('0x40')](_0x2e883a);})[_0x3542('0x27')](function(_0x4bf45a){_0x5c882f['rows']=_0x4bf45a;return _0x5c882f;})[_0x3542('0x27')](respondWithFilteredResult(_0xc6f23b,_0x2e883a))[_0x3542('0x41')](handleError(_0xc6f23b,null));};exports[_0x3542('0x42')]=function(_0xdeebd3,_0x170749){var _0x53a024={'raw':!![],'where':{'id':_0xdeebd3['params']['id']}},_0x3e6a49={};_0x3e6a49[_0x3542('0x33')]=_[_0x3542('0x43')](db[_0x3542('0x2d')]['rawAttributes']);_0x3e6a49[_0x3542('0x32')]=_[_0x3542('0x43')](_0xdeebd3['query']);_0x3e6a49[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],_0x3e6a49[_0x3542('0x32')]);_0x53a024[_0x3542('0x34')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],qs[_0x3542('0x35')](_0xdeebd3['query']['fields']));_0x53a024['attributes']=_0x53a024[_0x3542('0x34')][_0x3542('0x45')]?_0x53a024[_0x3542('0x34')]:_0x3e6a49[_0x3542('0x33')];if(_0xdeebd3[_0x3542('0x32')][_0x3542('0x3e')]){_0x53a024[_0x3542('0x3f')]=[{'all':!![]}];}_0x53a024=_['merge']({},_0x53a024,_0xdeebd3[_0x3542('0x46')]);return db[_0x3542('0x2d')][_0x3542('0x47')](_0x53a024)[_0x3542('0x27')](handleEntityNotFound(_0x170749,null))['then'](respondWithResult(_0x170749,null))[_0x3542('0x41')](handleError(_0x170749,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){return db[_0x3542('0x2d')][_0x3542('0x48')](_0x55b43a[_0x3542('0x49')],{})[_0x3542('0x27')](function(_0x244f3a){var _0x1a2ecf=_0x55b43a[_0x3542('0x4a')]['get']({'plain':!![]});if(!_0x1a2ecf)throw new Error(_0x3542('0x4b'));if(_0x1a2ecf[_0x3542('0x4c')]===_0x3542('0x4a')){var _0x392c6e=_0x244f3a[_0x3542('0x24')]({'plain':!![]});var _0x28be34=_0x3542('0x25');return db[_0x3542('0x4d')][_0x3542('0x47')]({'where':{'name':_0x28be34,'userProfileId':_0x1a2ecf['userProfileId']},'raw':!![]})['then'](function(_0x15af28){if(_0x15af28&&_0x15af28['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x392c6e[_0x3542('0x2a')],'resourceId':_0x392c6e['id'],'type':_0x15af28[_0x3542('0x2a')],'sectionId':_0x15af28['id']},{})[_0x3542('0x27')](function(){return _0x244f3a;});}else{return _0x244f3a;}})['catch'](function(_0x2db495){logger[_0x3542('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db495);throw _0x2db495;});}return _0x244f3a;})[_0x3542('0x27')](respondWithResult(_0x528f8c,0xc9))[_0x3542('0x41')](handleError(_0x528f8c,null));};exports[_0x3542('0x4e')]=function(_0x196c59,_0x179249){if(_0x196c59['body']['id']){delete _0x196c59[_0x3542('0x49')]['id'];}return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x196c59[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x179249,null))['then'](saveUpdates(_0x196c59['body'],null))[_0x3542('0x27')](respondWithResult(_0x179249,null))[_0x3542('0x41')](handleError(_0x179249,null));};exports[_0x3542('0x23')]=function(_0x5de994,_0x1dfac3){return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x5de994[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1dfac3,null))['then'](removeEntity(_0x1dfac3,null))['catch'](handleError(_0x1dfac3,null));};exports[_0x3542('0x50')]=function(_0x4cd6fd,_0x1fd8c8,_0x3610b7){return db['VoiceMail'][_0x3542('0x51')]({'where':{'id':_0x4cd6fd[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1fd8c8,null))[_0x3542('0x27')](function(_0x60b9c0){var _0x52a75b;var _0x4cb73f={},_0x271dd0={};_0x271dd0['model']=_[_0x3542('0x43')](db[_0x3542('0x52')][_0x3542('0x2e')]);_0x271dd0['query']=_[_0x3542('0x43')](_0x4cd6fd[_0x3542('0x32')]);_0x271dd0[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],_0x271dd0[_0x3542('0x32')]);_0x4cb73f['attributes']=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],qs[_0x3542('0x35')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x35')]));_0x4cb73f[_0x3542('0x34')]=_0x4cb73f['attributes'][_0x3542('0x45')]?_0x4cb73f[_0x3542('0x34')]:_0x271dd0[_0x3542('0x33')];if(!_0x4cd6fd[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x4cb73f[_0x3542('0x1f')]=qs['limit'](_0x4cd6fd['query'][_0x3542('0x1f')]);_0x4cb73f['offset']=qs[_0x3542('0x1c')](_0x4cd6fd['query']['offset']);}_0x4cb73f[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x38')]);_0x4cb73f[_0x3542('0x39')]=qs[_0x3542('0x3a')](_[_0x3542('0x53')](_0x4cd6fd['query'],_0x271dd0[_0x3542('0x3a')]));if(_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]){_0x4cb73f[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x4cb73f['where'],{'$or':_[_0x3542('0x2c')](_0x4cb73f[_0x3542('0x34')],function(_0x2c5546){var _0x361c42={};_0x361c42[_0x2c5546]={'$like':'%'+_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]+'%'};return _0x361c42;})});}_0x4cb73f[_0x3542('0x39')]=_['merge'](_0x4cb73f[_0x3542('0x39')],{'mailboxuser':_0x60b9c0['mailbox']});_0x4cb73f=_[_0x3542('0x3c')]({},_0x4cb73f,_0x4cd6fd[_0x3542('0x46')]);return db[_0x3542('0x52')][_0x3542('0x54')](_0x4cb73f)['then'](respondWithFilteredResult(_0x1fd8c8,_0x4cb73f));})['catch'](handleError(_0x1fd8c8,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index afed803..417e98b 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5afb=['path','rimraf','../../config/environment','define','voice_voicemail','mailbox','context','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e808e,_0x1c4082){var _0x2f62db=function(_0x2f8f2f){while(--_0x2f8f2f){_0x3e808e['push'](_0x3e808e['shift']());}};_0x2f62db(++_0x1c4082);}(_0x5afb,0x13f));var _0xb5af=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x5afb[_0x2d4421];return _0x2d3b01;};'use strict';var _=require('lodash');var util=require(_0xb5af('0x0'));var logger=require(_0xb5af('0x1'))('api');var moment=require(_0xb5af('0x2'));var BPromise=require(_0xb5af('0x3'));var rp=require(_0xb5af('0x4'));var fs=require('fs');var path=require(_0xb5af('0x5'));var rimraf=require(_0xb5af('0x6'));var config=require(_0xb5af('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x45dbd9,_0x37b658){return _0x45dbd9[_0xb5af('0x8')]('VoiceMail',attributes,{'tableName':_0xb5af('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xb5af('0xa'),_0xb5af('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfee0=['context','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x314d83,_0x3a75b6){var _0x489433=function(_0x4391e3){while(--_0x4391e3){_0x314d83['push'](_0x314d83['shift']());}};_0x489433(++_0x3a75b6);}(_0xfee0,0xc1));var _0x0fee=function(_0x4c8833,_0x14e755){_0x4c8833=_0x4c8833-0x0;var _0x30df54=_0xfee0[_0x4c8833];return _0x30df54;};'use strict';var _=require(_0x0fee('0x0'));var util=require(_0x0fee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0fee('0x2'));var BPromise=require(_0x0fee('0x3'));var rp=require(_0x0fee('0x4'));var fs=require('fs');var path=require(_0x0fee('0x5'));var rimraf=require(_0x0fee('0x6'));var config=require(_0x0fee('0x7'));var attributes=require(_0x0fee('0x8'));module[_0x0fee('0x9')]=function(_0x464a98,_0x37b84a){return _0x464a98[_0x0fee('0xa')](_0x0fee('0xb'),attributes,{'tableName':_0x0fee('0xc'),'paranoid':![],'indexes':[{'name':_0x0fee('0xd'),'fields':[_0x0fee('0xe'),_0x0fee('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 55a15fa..e970d1a 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8268=['client','http','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x363151,_0x38ebd5){var _0x4845f9=function(_0x2783c6){while(--_0x2783c6){_0x363151['push'](_0x363151['shift']());}};_0x4845f9(++_0x38ebd5);}(_0x8268,0x131));var _0x8826=function(_0x43fe0c,_0x5f635a){_0x43fe0c=_0x43fe0c-0x0;var _0x594a87=_0x8268[_0x43fe0c];return _0x594a87;};'use strict';var _=require(_0x8826('0x0'));var util=require(_0x8826('0x1'));var moment=require('moment');var BPromise=require(_0x8826('0x2'));var rs=require(_0x8826('0x3'));var fs=require('fs');var Redis=require(_0x8826('0x4'));var db=require(_0x8826('0x5'))['db'];var utils=require(_0x8826('0x6'));var logger=require('../../config/logger')(_0x8826('0x7'));var config=require(_0x8826('0x8'));var jayson=require(_0x8826('0x9'));var client=jayson[_0x8826('0xa')][_0x8826('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25903d,_0x12156c,_0x1a39db){return new BPromise(function(_0x39c3a9,_0x89df07){return client['request'](_0x25903d,_0x1a39db)[_0x8826('0xc')](function(_0x161cb7){logger[_0x8826('0xd')](_0x8826('0xe'),_0x12156c,'request\x20sent');logger[_0x8826('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x12156c,_0x8826('0x10'),JSON['stringify'](_0x161cb7));if(_0x161cb7['error']){if(_0x161cb7[_0x8826('0x11')][_0x8826('0x12')]===0x1f4){logger[_0x8826('0x11')](_0x8826('0xe'),_0x12156c,_0x161cb7[_0x8826('0x11')][_0x8826('0x13')]);return _0x89df07(_0x161cb7[_0x8826('0x11')][_0x8826('0x13')]);}logger[_0x8826('0x11')](_0x8826('0xe'),_0x12156c,_0x161cb7[_0x8826('0x11')]['message']);return _0x39c3a9(_0x161cb7[_0x8826('0x11')][_0x8826('0x13')]);}else{logger[_0x8826('0xd')](_0x8826('0xe'),_0x12156c,_0x8826('0x10'));_0x39c3a9(_0x161cb7[_0x8826('0x14')][_0x8826('0x13')]);}})['catch'](function(_0x3ef256){logger['error'](_0x8826('0xe'),_0x12156c,_0x3ef256);_0x89df07(_0x3ef256);});});} \ No newline at end of file +var _0xeb50=['client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x8cb738,_0x184a17){var _0x418246=function(_0x5131ac){while(--_0x5131ac){_0x8cb738['push'](_0x8cb738['shift']());}};_0x418246(++_0x184a17);}(_0xeb50,0x174));var _0x0eb5=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0xeb50[_0x25f797];return _0x157fdd;};'use strict';var _=require(_0x0eb5('0x0'));var util=require(_0x0eb5('0x1'));var moment=require('moment');var BPromise=require(_0x0eb5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0eb5('0x3'))['db'];var utils=require(_0x0eb5('0x4'));var logger=require('../../config/logger')(_0x0eb5('0x5'));var config=require(_0x0eb5('0x6'));var jayson=require(_0x0eb5('0x7'));var client=jayson[_0x0eb5('0x8')][_0x0eb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b8356,_0x942fb3,_0x1e96ea){return new BPromise(function(_0x4d6925,_0xf93634){return client['request'](_0x3b8356,_0x1e96ea)[_0x0eb5('0xa')](function(_0x29d462){logger[_0x0eb5('0xb')](_0x0eb5('0xc'),_0x942fb3,_0x0eb5('0xd'));logger[_0x0eb5('0xe')](_0x0eb5('0xf'),_0x942fb3,_0x0eb5('0xd'),JSON[_0x0eb5('0x10')](_0x29d462));if(_0x29d462['error']){if(_0x29d462['error']['code']===0x1f4){logger[_0x0eb5('0x11')](_0x0eb5('0xc'),_0x942fb3,_0x29d462[_0x0eb5('0x11')][_0x0eb5('0x12')]);return _0xf93634(_0x29d462[_0x0eb5('0x11')][_0x0eb5('0x12')]);}logger['error'](_0x0eb5('0xc'),_0x942fb3,_0x29d462[_0x0eb5('0x11')][_0x0eb5('0x12')]);return _0x4d6925(_0x29d462['error'][_0x0eb5('0x12')]);}else{logger['info'](_0x0eb5('0xc'),_0x942fb3,_0x0eb5('0xd'));_0x4d6925(_0x29d462['result'][_0x0eb5('0x12')]);}})[_0x0eb5('0x13')](function(_0x36a77d){logger[_0x0eb5('0x11')](_0x0eb5('0xc'),_0x942fb3,_0x36a77d);_0xf93634(_0x36a77d);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index bb9280e..6aae065 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e97=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x31ff0d,_0x5daa41){var _0x1570ab=function(_0x14324f){while(--_0x14324f){_0x31ff0d['push'](_0x31ff0d['shift']());}};_0x1570ab(++_0x5daa41);}(_0x3e97,0xa4));var _0x73e9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3e97[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x73e9('0x0'));var util=require(_0x73e9('0x1'));var path=require(_0x73e9('0x2'));var timeout=require(_0x73e9('0x3'));var express=require('express');var router=express[_0x73e9('0x4')]();var fs_extra=require(_0x73e9('0x5'));var auth=require(_0x73e9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73e9('0x7'));var controller=require(_0x73e9('0x8'));router[_0x73e9('0x9')]('/',auth['isAuthenticated'](),controller[_0x73e9('0xa')]);router['get'](_0x73e9('0xb'),auth[_0x73e9('0xc')](),controller[_0x73e9('0xd')]);router[_0x73e9('0x9')](_0x73e9('0xe'),auth[_0x73e9('0xc')](),controller[_0x73e9('0xf')]);router[_0x73e9('0x10')]('/',auth[_0x73e9('0xc')](),controller[_0x73e9('0x11')]);router[_0x73e9('0x12')](_0x73e9('0xb'),auth[_0x73e9('0xc')](),controller['update']);router['delete'](_0x73e9('0xb'),auth[_0x73e9('0xc')](),controller[_0x73e9('0x13')]);module[_0x73e9('0x14')]=router; \ No newline at end of file +var _0x2598=['express','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','download','post','create','delete','destroy','multer','util','path','connect-timeout'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x2598,0x13c));var _0x8259=function(_0x11cbfd,_0x3b7378){_0x11cbfd=_0x11cbfd-0x0;var _0x45f08c=_0x2598[_0x11cbfd];return _0x45f08c;};'use strict';var multer=require(_0x8259('0x0'));var util=require(_0x8259('0x1'));var path=require(_0x8259('0x2'));var timeout=require(_0x8259('0x3'));var express=require(_0x8259('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8259('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8259('0x6'));var controller=require(_0x8259('0x7'));router[_0x8259('0x8')]('/',auth[_0x8259('0x9')](),controller['index']);router[_0x8259('0x8')](_0x8259('0xa'),auth[_0x8259('0x9')](),controller['show']);router[_0x8259('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x8259('0xb')]);router[_0x8259('0xc')]('/',auth[_0x8259('0x9')](),controller[_0x8259('0xd')]);router['put'](_0x8259('0xa'),auth[_0x8259('0x9')](),controller['update']);router[_0x8259('0xe')](_0x8259('0xa'),auth['isAuthenticated'](),controller[_0x8259('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d5827ea..007222c 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x271c=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','long','TIMESTAMP','literal'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x271c,0x12a));var _0xc271=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x271c[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xc271('0x0'));module[_0xc271('0x1')]={'name':{'type':Sequelize[_0xc271('0x2')],'get':function(_0x1c90ae){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xc271('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xc271('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc271('0x4')],'defaultValue':''},'stamp':{'type':_0xc271('0x6'),'defaultValue':Sequelize[_0xc271('0x7')](_0xc271('0x8'))}}; \ No newline at end of file +var _0xeb26=['sequelize','exports','getDataValue','STRING','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x2fb3b2,_0x365db0){var _0x33eedb=function(_0x535772){while(--_0x535772){_0x2fb3b2['push'](_0x2fb3b2['shift']());}};_0x33eedb(++_0x365db0);}(_0xeb26,0x181));var _0x6eb2=function(_0x1469ff,_0x129519){_0x1469ff=_0x1469ff-0x0;var _0x564b05=_0xeb26[_0x1469ff];return _0x564b05;};'use strict';var Sequelize=require(_0x6eb2('0x0'));module[_0x6eb2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x26a474){return this[_0x6eb2('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6eb2('0x3')],'defaultValue':''},'stamp':{'type':_0x6eb2('0x4'),'defaultValue':Sequelize[_0x6eb2('0x5')](_0x6eb2('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5f4421a..7ebc4db 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65b9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','VoiceMailMessage','includeAll','findAll','catch','show','params','length','include','options','find','create','body','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x65b9,0x18f));var _0x965b=function(_0xea6f99,_0x465a69){_0xea6f99=_0xea6f99-0x0;var _0x2c5d46=_0x65b9[_0xea6f99];return _0x2c5d46;};'use strict';var emlformat=require(_0x965b('0x0'));var rimraf=require(_0x965b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x965b('0x2'));var moment=require(_0x965b('0x3'));var BPromise=require(_0x965b('0x4'));var Mustache=require('mustache');var util=require(_0x965b('0x5'));var path=require('path');var sox=require(_0x965b('0x6'));var csv=require(_0x965b('0x7'));var ejs=require(_0x965b('0x8'));var fs=require('fs');var fs_extra=require(_0x965b('0x9'));var _=require('lodash');var squel=require(_0x965b('0xa'));var crypto=require(_0x965b('0xb'));var jsforce=require(_0x965b('0xc'));var deskjs=require(_0x965b('0xd'));var toCsv=require(_0x965b('0x7'));var querystring=require(_0x965b('0xe'));var Papa=require(_0x965b('0xf'));var Redis=require(_0x965b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x965b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x965b('0x12'));var logger=require(_0x965b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x965b('0x14'));var licenseUtil=require(_0x965b('0x15'));var db=require(_0x965b('0x16'))['db'];function respondWithStatusCode(_0x4ed669,_0x1cb48a){_0x1cb48a=_0x1cb48a||0xcc;return function(_0x376f87){if(_0x376f87){return _0x4ed669[_0x965b('0x17')](_0x1cb48a);}return _0x4ed669[_0x965b('0x18')](_0x1cb48a)[_0x965b('0x19')]();};}function respondWithResult(_0x3ab9ef,_0x23883a){_0x23883a=_0x23883a||0xc8;return function(_0x4b1006){if(_0x4b1006){return _0x3ab9ef['status'](_0x23883a)[_0x965b('0x1a')](_0x4b1006);}};}function respondWithFilteredResult(_0x2c5027,_0x928407){return function(_0x5f5c3c){if(_0x5f5c3c){var _0x229338=typeof _0x928407[_0x965b('0x1b')]==='undefined'&&typeof _0x928407[_0x965b('0x1c')]===_0x965b('0x1d');var _0x35bc89=_0x5f5c3c[_0x965b('0x1e')];var _0x516f41=_0x229338?0x0:_0x928407['offset'];var _0x56db0e=_0x229338?_0x5f5c3c[_0x965b('0x1e')]:_0x928407[_0x965b('0x1b')]+_0x928407[_0x965b('0x1c')];var _0x1586ee;if(_0x56db0e>=_0x35bc89){_0x56db0e=_0x35bc89;_0x1586ee=0xc8;}else{_0x1586ee=0xce;}_0x2c5027[_0x965b('0x18')](_0x1586ee);return _0x2c5027[_0x965b('0x1f')]('Content-Range',_0x516f41+'-'+_0x56db0e+'/'+_0x35bc89)[_0x965b('0x1a')](_0x5f5c3c);}return null;};}function patchUpdates(_0x4f5f30){return function(_0x1f6277){try{jsonpatch['apply'](_0x1f6277,_0x4f5f30,!![]);}catch(_0x1b236b){return BPromise[_0x965b('0x20')](_0x1b236b);}return _0x1f6277[_0x965b('0x21')]();};}function saveUpdates(_0x1bc820,_0x47d880){return function(_0x2a20f5){if(_0x2a20f5){return _0x2a20f5[_0x965b('0x22')](_0x1bc820)[_0x965b('0x23')](function(_0x523fb8){return _0x523fb8;});}return null;};}function removeEntity(_0x6b45ab,_0x5e4f25){return function(_0x160ec7){if(_0x160ec7){return _0x160ec7[_0x965b('0x24')]()[_0x965b('0x23')](function(){_0x6b45ab[_0x965b('0x18')](0xcc)[_0x965b('0x19')]();});}};}function handleEntityNotFound(_0x52c42c,_0x5d2e18){return function(_0x47b9a9){if(!_0x47b9a9){_0x52c42c[_0x965b('0x17')](0x194);}return _0x47b9a9;};}function handleError(_0x374173,_0x3d4345){_0x3d4345=_0x3d4345||0x1f4;return function(_0x1c4f28){logger[_0x965b('0x25')](_0x1c4f28[_0x965b('0x26')]);if(_0x1c4f28['name']){delete _0x1c4f28[_0x965b('0x27')];}_0x374173['status'](_0x3d4345)[_0x965b('0x28')](_0x1c4f28);};}exports['index']=function(_0x1f9661,_0x30a407){var _0x9009c1={},_0x279cbe={},_0x50322c={'count':0x0,'rows':[]};var _0xcc75f2=_['map'](db['VoiceMailMessage'][_0x965b('0x29')],function(_0x4f9388){return{'name':_0x4f9388[_0x965b('0x2a')],'type':_0x4f9388[_0x965b('0x2b')][_0x965b('0x2c')]};});_0x279cbe[_0x965b('0x2d')]=_[_0x965b('0x2e')](_['map'](_0xcc75f2,_0x965b('0x27')),[_0x965b('0x27')]);_0x279cbe[_0x965b('0x2f')]=_[_0x965b('0x30')](_0x1f9661[_0x965b('0x2f')]);_0x279cbe['filters']=_[_0x965b('0x31')](_0x279cbe[_0x965b('0x2d')],_0x279cbe[_0x965b('0x2f')]);_0x9009c1[_0x965b('0x32')]=_['intersection'](_0x279cbe[_0x965b('0x2d')],qs[_0x965b('0x33')](_0x1f9661[_0x965b('0x2f')][_0x965b('0x33')]));_0x9009c1['attributes']=_0x9009c1[_0x965b('0x32')]['length']?_0x9009c1[_0x965b('0x32')]:_0x279cbe[_0x965b('0x2d')];if(!_0x1f9661['query'][_0x965b('0x34')](_0x965b('0x35'))){_0x9009c1[_0x965b('0x1c')]=qs[_0x965b('0x1c')](_0x1f9661[_0x965b('0x2f')]['limit']);_0x9009c1[_0x965b('0x1b')]=qs[_0x965b('0x1b')](_0x1f9661[_0x965b('0x2f')][_0x965b('0x1b')]);}_0x9009c1[_0x965b('0x36')]=qs[_0x965b('0x37')](_0x1f9661[_0x965b('0x2f')][_0x965b('0x37')]);_0x9009c1[_0x965b('0x38')]=qs[_0x965b('0x39')](_[_0x965b('0x3a')](_0x1f9661['query'],_0x279cbe[_0x965b('0x39')]),_0xcc75f2);if(_0x1f9661[_0x965b('0x2f')]['filter']){_0x9009c1[_0x965b('0x38')]=_[_0x965b('0x3b')](_0x9009c1[_0x965b('0x38')],{'$or':_['map'](_0xcc75f2,function(_0x17e597){if(_0x17e597['type']!==_0x965b('0x3c')){var _0x3b6650={};_0x3b6650[_0x17e597['name']]={'$like':'%'+_0x1f9661[_0x965b('0x2f')][_0x965b('0x3d')]+'%'};return _0x3b6650;}})});}_0x9009c1=_[_0x965b('0x3b')]({},_0x9009c1,_0x1f9661['options']);var _0x28145f={'where':_0x9009c1['where']};return db[_0x965b('0x3e')][_0x965b('0x1e')](_0x28145f)[_0x965b('0x23')](function(_0x2dd6d6){_0x50322c[_0x965b('0x1e')]=_0x2dd6d6;if(_0x1f9661['query'][_0x965b('0x3f')]){_0x9009c1['include']=[{'all':!![]}];}return db[_0x965b('0x3e')][_0x965b('0x40')](_0x9009c1);})[_0x965b('0x23')](function(_0x18f406){_0x50322c['rows']=_0x18f406;return _0x50322c;})[_0x965b('0x23')](respondWithFilteredResult(_0x30a407,_0x9009c1))[_0x965b('0x41')](handleError(_0x30a407,null));};exports[_0x965b('0x42')]=function(_0x29973e,_0x437a57){var _0x485d90={'raw':!![],'where':{'id':_0x29973e[_0x965b('0x43')]['id']}},_0x2699d0={};_0x2699d0[_0x965b('0x2d')]=_[_0x965b('0x30')](db[_0x965b('0x3e')][_0x965b('0x29')]);_0x2699d0[_0x965b('0x2f')]=_['keys'](_0x29973e[_0x965b('0x2f')]);_0x2699d0[_0x965b('0x39')]=_['intersection'](_0x2699d0[_0x965b('0x2d')],_0x2699d0[_0x965b('0x2f')]);_0x485d90[_0x965b('0x32')]=_[_0x965b('0x31')](_0x2699d0[_0x965b('0x2d')],qs[_0x965b('0x33')](_0x29973e['query']['fields']));_0x485d90[_0x965b('0x32')]=_0x485d90[_0x965b('0x32')][_0x965b('0x44')]?_0x485d90[_0x965b('0x32')]:_0x2699d0[_0x965b('0x2d')];if(_0x29973e[_0x965b('0x2f')][_0x965b('0x3f')]){_0x485d90[_0x965b('0x45')]=[{'all':!![]}];}_0x485d90=_[_0x965b('0x3b')]({},_0x485d90,_0x29973e[_0x965b('0x46')]);return db['VoiceMailMessage'][_0x965b('0x47')](_0x485d90)['then'](handleEntityNotFound(_0x437a57,null))[_0x965b('0x23')](respondWithResult(_0x437a57,null))[_0x965b('0x41')](handleError(_0x437a57,null));};exports[_0x965b('0x48')]=function(_0x2a34b2,_0x1f0ddf){return db[_0x965b('0x3e')][_0x965b('0x48')](_0x2a34b2[_0x965b('0x49')],{})[_0x965b('0x23')](respondWithResult(_0x1f0ddf,0xc9))[_0x965b('0x41')](handleError(_0x1f0ddf,null));};exports[_0x965b('0x22')]=function(_0x519fe7,_0x35e5c7){if(_0x519fe7[_0x965b('0x49')]['id']){delete _0x519fe7[_0x965b('0x49')]['id'];}return db['VoiceMailMessage'][_0x965b('0x47')]({'where':{'id':_0x519fe7[_0x965b('0x43')]['id']}})[_0x965b('0x23')](handleEntityNotFound(_0x35e5c7,null))[_0x965b('0x23')](saveUpdates(_0x519fe7[_0x965b('0x49')],null))[_0x965b('0x23')](respondWithResult(_0x35e5c7,null))['catch'](handleError(_0x35e5c7,null));};exports[_0x965b('0x24')]=function(_0xec09ee,_0x224fba){return db[_0x965b('0x3e')][_0x965b('0x47')]({'where':{'id':_0xec09ee[_0x965b('0x43')]['id']}})[_0x965b('0x23')](handleEntityNotFound(_0x224fba,null))[_0x965b('0x23')](removeEntity(_0x224fba,null))[_0x965b('0x41')](handleError(_0x224fba,null));};exports['download']=function(_0x15afa0,_0x1d241b,_0x86bf95){return db[_0x965b('0x3e')][_0x965b('0x47')]({'where':{'id':_0x15afa0[_0x965b('0x43')]['id']},'attributes':['id','recording',_0x965b('0x4a')]})[_0x965b('0x23')](handleEntityNotFound(_0x1d241b,null))[_0x965b('0x23')](function(_0x3bf131){if(_0x3bf131){if(!_0x3bf131[_0x965b('0x4b')]){throw new db[(_0x965b('0x4c'))][(_0x965b('0x4d'))](_0x965b('0x4e'));}var _0x1ae05b={'Content-Type':_0x965b('0x4f'),'Content-Disposition':_0x965b('0x50')};if(_0x3bf131[_0x965b('0x4a')]){_0x1ae05b[_0x965b('0x51')]=_0x965b('0x52')+_0x3bf131[_0x965b('0x4a')]+_0x965b('0x53');}_0x1d241b[_0x965b('0x1f')](_0x1ae05b);return _0x1d241b['send'](new Buffer(_0x3bf131[_0x965b('0x4b')]));}})['catch'](handleError(_0x1d241b,null));}; \ No newline at end of file +var _0xcfc0=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','key','differenceBy','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','params','rawAttributes','fields','find','create','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x382d7e,_0x16798c){var _0x33c721=function(_0x13d857){while(--_0x13d857){_0x382d7e['push'](_0x382d7e['shift']());}};_0x33c721(++_0x16798c);}(_0xcfc0,0x14e));var _0x0cfc=function(_0x18f751,_0x3a52c6){_0x18f751=_0x18f751-0x0;var _0x2002ff=_0xcfc0[_0x18f751];return _0x2002ff;};'use strict';var emlformat=require(_0x0cfc('0x0'));var rimraf=require(_0x0cfc('0x1'));var zipdir=require(_0x0cfc('0x2'));var jsonpatch=require(_0x0cfc('0x3'));var rp=require(_0x0cfc('0x4'));var moment=require(_0x0cfc('0x5'));var BPromise=require(_0x0cfc('0x6'));var Mustache=require(_0x0cfc('0x7'));var util=require(_0x0cfc('0x8'));var path=require(_0x0cfc('0x9'));var sox=require(_0x0cfc('0xa'));var csv=require(_0x0cfc('0xb'));var ejs=require(_0x0cfc('0xc'));var fs=require('fs');var fs_extra=require(_0x0cfc('0xd'));var _=require('lodash');var squel=require(_0x0cfc('0xe'));var crypto=require(_0x0cfc('0xf'));var jsforce=require(_0x0cfc('0x10'));var deskjs=require(_0x0cfc('0x11'));var toCsv=require(_0x0cfc('0xb'));var querystring=require('querystring');var Papa=require(_0x0cfc('0x12'));var Redis=require(_0x0cfc('0x13'));var authService=require(_0x0cfc('0x14'));var qs=require(_0x0cfc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cfc('0x16'));var utils=require(_0x0cfc('0x17'));var config=require(_0x0cfc('0x18'));var licenseUtil=require(_0x0cfc('0x19'));var db=require(_0x0cfc('0x1a'))['db'];function respondWithStatusCode(_0xfd5a09,_0x56196c){_0x56196c=_0x56196c||0xcc;return function(_0x5aa6d7){if(_0x5aa6d7){return _0xfd5a09[_0x0cfc('0x1b')](_0x56196c);}return _0xfd5a09[_0x0cfc('0x1c')](_0x56196c)[_0x0cfc('0x1d')]();};}function respondWithResult(_0x5a9f3f,_0x465d44){_0x465d44=_0x465d44||0xc8;return function(_0x472d95){if(_0x472d95){return _0x5a9f3f['status'](_0x465d44)[_0x0cfc('0x1e')](_0x472d95);}};}function respondWithFilteredResult(_0x57eb4c,_0x3ca300){return function(_0x41da68){if(_0x41da68){var _0x1289aa=typeof _0x3ca300[_0x0cfc('0x1f')]===_0x0cfc('0x20')&&typeof _0x3ca300['limit']===_0x0cfc('0x20');var _0x5aea67=_0x41da68['count'];var _0x484c19=_0x1289aa?0x0:_0x3ca300['offset'];var _0x40065a=_0x1289aa?_0x41da68[_0x0cfc('0x21')]:_0x3ca300[_0x0cfc('0x1f')]+_0x3ca300['limit'];var _0x5526c2;if(_0x40065a>=_0x5aea67){_0x40065a=_0x5aea67;_0x5526c2=0xc8;}else{_0x5526c2=0xce;}_0x57eb4c[_0x0cfc('0x1c')](_0x5526c2);return _0x57eb4c['set'](_0x0cfc('0x22'),_0x484c19+'-'+_0x40065a+'/'+_0x5aea67)[_0x0cfc('0x1e')](_0x41da68);}return null;};}function patchUpdates(_0x463683){return function(_0x31342f){try{jsonpatch[_0x0cfc('0x23')](_0x31342f,_0x463683,!![]);}catch(_0x2e07f5){return BPromise['reject'](_0x2e07f5);}return _0x31342f[_0x0cfc('0x24')]();};}function saveUpdates(_0x1ff924,_0x301c38){return function(_0xa3f010){if(_0xa3f010){return _0xa3f010[_0x0cfc('0x25')](_0x1ff924)[_0x0cfc('0x26')](function(_0x8ac3eb){return _0x8ac3eb;});}return null;};}function removeEntity(_0x3124a0,_0x604561){return function(_0x5752c7){if(_0x5752c7){return _0x5752c7[_0x0cfc('0x27')]()[_0x0cfc('0x26')](function(){_0x3124a0['status'](0xcc)[_0x0cfc('0x1d')]();});}};}function handleEntityNotFound(_0x3374a6,_0x174831){return function(_0x24b918){if(!_0x24b918){_0x3374a6[_0x0cfc('0x1b')](0x194);}return _0x24b918;};}function handleError(_0x26f817,_0x1a5ea9){_0x1a5ea9=_0x1a5ea9||0x1f4;return function(_0x50e51f){logger[_0x0cfc('0x28')](_0x50e51f[_0x0cfc('0x29')]);if(_0x50e51f[_0x0cfc('0x2a')]){delete _0x50e51f['name'];}_0x26f817[_0x0cfc('0x1c')](_0x1a5ea9)[_0x0cfc('0x2b')](_0x50e51f);};}exports[_0x0cfc('0x2c')]=function(_0x4a205b,_0x33ed06){var _0x20ce27={},_0x246262={},_0xe4e0c0={'count':0x0,'rows':[]};var _0xc1e89c=_[_0x0cfc('0x2d')](db[_0x0cfc('0x2e')]['rawAttributes'],function(_0x4f2801){return{'name':_0x4f2801[_0x0cfc('0x2f')],'type':_0x4f2801['type'][_0x0cfc('0x30')]};});_0x246262['model']=_[_0x0cfc('0x31')](_['map'](_0xc1e89c,_0x0cfc('0x2a')),[_0x0cfc('0x2a')]);_0x246262[_0x0cfc('0x32')]=_[_0x0cfc('0x33')](_0x4a205b[_0x0cfc('0x32')]);_0x246262[_0x0cfc('0x34')]=_[_0x0cfc('0x35')](_0x246262[_0x0cfc('0x36')],_0x246262[_0x0cfc('0x32')]);_0x20ce27['attributes']=_[_0x0cfc('0x35')](_0x246262['model'],qs['fields'](_0x4a205b[_0x0cfc('0x32')]['fields']));_0x20ce27['attributes']=_0x20ce27[_0x0cfc('0x37')][_0x0cfc('0x38')]?_0x20ce27['attributes']:_0x246262[_0x0cfc('0x36')];if(!_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x39')](_0x0cfc('0x3a'))){_0x20ce27[_0x0cfc('0x3b')]=qs['limit'](_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x3b')]);_0x20ce27[_0x0cfc('0x1f')]=qs[_0x0cfc('0x1f')](_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x1f')]);}_0x20ce27[_0x0cfc('0x3c')]=qs[_0x0cfc('0x3d')](_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x3d')]);_0x20ce27[_0x0cfc('0x3e')]=qs[_0x0cfc('0x34')](_[_0x0cfc('0x3f')](_0x4a205b['query'],_0x246262['filters']),_0xc1e89c);if(_0x4a205b[_0x0cfc('0x32')]['filter']){_0x20ce27[_0x0cfc('0x3e')]=_[_0x0cfc('0x40')](_0x20ce27['where'],{'$or':_[_0x0cfc('0x2d')](_0xc1e89c,function(_0x135ca0){if(_0x135ca0[_0x0cfc('0x41')]!==_0x0cfc('0x42')){var _0x1afdff={};_0x1afdff[_0x135ca0[_0x0cfc('0x2a')]]={'$like':'%'+_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x43')]+'%'};return _0x1afdff;}})});}_0x20ce27=_[_0x0cfc('0x40')]({},_0x20ce27,_0x4a205b['options']);var _0x131c2c={'where':_0x20ce27[_0x0cfc('0x3e')]};return db[_0x0cfc('0x2e')][_0x0cfc('0x21')](_0x131c2c)[_0x0cfc('0x26')](function(_0x165874){_0xe4e0c0[_0x0cfc('0x21')]=_0x165874;if(_0x4a205b[_0x0cfc('0x32')][_0x0cfc('0x44')]){_0x20ce27[_0x0cfc('0x45')]=[{'all':!![]}];}return db[_0x0cfc('0x2e')][_0x0cfc('0x46')](_0x20ce27);})[_0x0cfc('0x26')](function(_0x115be3){_0xe4e0c0['rows']=_0x115be3;return _0xe4e0c0;})[_0x0cfc('0x26')](respondWithFilteredResult(_0x33ed06,_0x20ce27))[_0x0cfc('0x47')](handleError(_0x33ed06,null));};exports['show']=function(_0xe0b2b4,_0xe9f1b1){var _0x5944be={'raw':!![],'where':{'id':_0xe0b2b4[_0x0cfc('0x48')]['id']}},_0x2d2fed={};_0x2d2fed[_0x0cfc('0x36')]=_[_0x0cfc('0x33')](db['VoiceMailMessage'][_0x0cfc('0x49')]);_0x2d2fed[_0x0cfc('0x32')]=_[_0x0cfc('0x33')](_0xe0b2b4[_0x0cfc('0x32')]);_0x2d2fed['filters']=_[_0x0cfc('0x35')](_0x2d2fed['model'],_0x2d2fed['query']);_0x5944be[_0x0cfc('0x37')]=_['intersection'](_0x2d2fed[_0x0cfc('0x36')],qs[_0x0cfc('0x4a')](_0xe0b2b4[_0x0cfc('0x32')][_0x0cfc('0x4a')]));_0x5944be[_0x0cfc('0x37')]=_0x5944be['attributes'][_0x0cfc('0x38')]?_0x5944be[_0x0cfc('0x37')]:_0x2d2fed[_0x0cfc('0x36')];if(_0xe0b2b4[_0x0cfc('0x32')][_0x0cfc('0x44')]){_0x5944be[_0x0cfc('0x45')]=[{'all':!![]}];}_0x5944be=_[_0x0cfc('0x40')]({},_0x5944be,_0xe0b2b4['options']);return db[_0x0cfc('0x2e')][_0x0cfc('0x4b')](_0x5944be)['then'](handleEntityNotFound(_0xe9f1b1,null))[_0x0cfc('0x26')](respondWithResult(_0xe9f1b1,null))[_0x0cfc('0x47')](handleError(_0xe9f1b1,null));};exports[_0x0cfc('0x4c')]=function(_0x3d9aec,_0x51139b){return db[_0x0cfc('0x2e')]['create'](_0x3d9aec[_0x0cfc('0x4d')],{})[_0x0cfc('0x26')](respondWithResult(_0x51139b,0xc9))[_0x0cfc('0x47')](handleError(_0x51139b,null));};exports['update']=function(_0x3ff4c,_0x3406b0){if(_0x3ff4c['body']['id']){delete _0x3ff4c['body']['id'];}return db[_0x0cfc('0x2e')][_0x0cfc('0x4b')]({'where':{'id':_0x3ff4c[_0x0cfc('0x48')]['id']}})[_0x0cfc('0x26')](handleEntityNotFound(_0x3406b0,null))[_0x0cfc('0x26')](saveUpdates(_0x3ff4c[_0x0cfc('0x4d')],null))[_0x0cfc('0x26')](respondWithResult(_0x3406b0,null))[_0x0cfc('0x47')](handleError(_0x3406b0,null));};exports['destroy']=function(_0xdc2757,_0x31e10d){return db[_0x0cfc('0x2e')]['find']({'where':{'id':_0xdc2757['params']['id']}})[_0x0cfc('0x26')](handleEntityNotFound(_0x31e10d,null))[_0x0cfc('0x26')](removeEntity(_0x31e10d,null))[_0x0cfc('0x47')](handleError(_0x31e10d,null));};exports[_0x0cfc('0x4e')]=function(_0x58e89e,_0x12aa93,_0x2db37d){return db[_0x0cfc('0x2e')]['find']({'where':{'id':_0x58e89e['params']['id']},'attributes':['id','recording','msg_id']})[_0x0cfc('0x26')](handleEntityNotFound(_0x12aa93,null))[_0x0cfc('0x26')](function(_0x525b5a){if(_0x525b5a){if(!_0x525b5a[_0x0cfc('0x4f')]){throw new db[(_0x0cfc('0x50'))]['ValidationError'](_0x0cfc('0x51'));}var _0x4c70ea={'Content-Type':_0x0cfc('0x52'),'Content-Disposition':_0x0cfc('0x53')};if(_0x525b5a[_0x0cfc('0x54')]){_0x4c70ea[_0x0cfc('0x55')]='attachment;\x20filename=\x22'+_0x525b5a[_0x0cfc('0x54')]+_0x0cfc('0x56');}_0x12aa93['set'](_0x4c70ea);return _0x12aa93[_0x0cfc('0x2b')](new Buffer(_0x525b5a[_0x0cfc('0x4f')]));}})[_0x0cfc('0x47')](handleError(_0x12aa93,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4099102..ea96b5f 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4088=['util','api','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash'];(function(_0x535a47,_0x36c699){var _0xd3a444=function(_0x1dd5ce){while(--_0x1dd5ce){_0x535a47['push'](_0x535a47['shift']());}};_0xd3a444(++_0x36c699);}(_0x4088,0xa4));var _0x8408=function(_0x9fdca,_0x364493){_0x9fdca=_0x9fdca-0x0;var _0x4037a3=_0x4088[_0x9fdca];return _0x4037a3;};'use strict';var _=require(_0x8408('0x0'));var util=require(_0x8408('0x1'));var logger=require('../../config/logger')(_0x8408('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8408('0x3'));var fs=require('fs');var path=require(_0x8408('0x4'));var rimraf=require(_0x8408('0x5'));var config=require(_0x8408('0x6'));var attributes=require(_0x8408('0x7'));module[_0x8408('0x8')]=function(_0xefe8b4,_0x5a0614){return _0xefe8b4['define']('VoiceMailMessage',attributes,{'tableName':_0x8408('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x8408('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xdca1=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x266b22,_0x4293f5){var _0x20a486=function(_0x45567b){while(--_0x45567b){_0x266b22['push'](_0x266b22['shift']());}};_0x20a486(++_0x4293f5);}(_0xdca1,0x186));var _0x1dca=function(_0xac1ed6,_0x535c4c){_0xac1ed6=_0xac1ed6-0x0;var _0x234b28=_0xdca1[_0xac1ed6];return _0x234b28;};'use strict';var _=require(_0x1dca('0x0'));var util=require(_0x1dca('0x1'));var logger=require(_0x1dca('0x2'))(_0x1dca('0x3'));var moment=require(_0x1dca('0x4'));var BPromise=require(_0x1dca('0x5'));var rp=require(_0x1dca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dca('0x7'));var config=require('../../config/environment');var attributes=require(_0x1dca('0x8'));module[_0x1dca('0x9')]=function(_0x590c15,_0x25d132){return _0x590c15[_0x1dca('0xa')](_0x1dca('0xb'),attributes,{'tableName':_0x1dca('0xc'),'paranoid':![],'indexes':[{'name':_0x1dca('0xd'),'fields':[_0x1dca('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 3032c55..37df8f1 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59c2=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e0279,_0x105a74){var _0x335fe2=function(_0x40ee83){while(--_0x40ee83){_0x2e0279['push'](_0x2e0279['shift']());}};_0x335fe2(++_0x105a74);}(_0x59c2,0xab));var _0x259c=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x59c2[_0x21353c];return _0xa99120;};'use strict';var _=require(_0x259c('0x0'));var util=require(_0x259c('0x1'));var moment=require(_0x259c('0x2'));var BPromise=require(_0x259c('0x3'));var rs=require(_0x259c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x259c('0x5'));var logger=require(_0x259c('0x6'))(_0x259c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x259c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c1e2,_0x26d068,_0x526345){return new BPromise(function(_0x4b08c0,_0x3fe57f){return client['request'](_0x45c1e2,_0x526345)[_0x259c('0x9')](function(_0x332a82){logger[_0x259c('0xa')](_0x259c('0xb'),_0x26d068,_0x259c('0xc'));logger[_0x259c('0xd')](_0x259c('0xe'),_0x26d068,'request\x20sent',JSON[_0x259c('0xf')](_0x332a82));if(_0x332a82[_0x259c('0x10')]){if(_0x332a82[_0x259c('0x10')][_0x259c('0x11')]===0x1f4){logger['error'](_0x259c('0xb'),_0x26d068,_0x332a82['error'][_0x259c('0x12')]);return _0x3fe57f(_0x332a82['error'][_0x259c('0x12')]);}logger[_0x259c('0x10')](_0x259c('0xb'),_0x26d068,_0x332a82[_0x259c('0x10')][_0x259c('0x12')]);return _0x4b08c0(_0x332a82['error'][_0x259c('0x12')]);}else{logger[_0x259c('0xa')](_0x259c('0xb'),_0x26d068,_0x259c('0xc'));_0x4b08c0(_0x332a82['result'][_0x259c('0x12')]);}})['catch'](function(_0x157d5e){logger['error'](_0x259c('0xb'),_0x26d068,_0x157d5e);_0x3fe57f(_0x157d5e);});});} \ No newline at end of file +var _0x9595=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2bbba0,_0x47b972){var _0x13eef0=function(_0x2c4b25){while(--_0x2c4b25){_0x2bbba0['push'](_0x2bbba0['shift']());}};_0x13eef0(++_0x47b972);}(_0x9595,0x1e6));var _0x5959=function(_0xada317,_0xd986f2){_0xada317=_0xada317-0x0;var _0x4f4880=_0x9595[_0xada317];return _0x4f4880;};'use strict';var _=require(_0x5959('0x0'));var util=require(_0x5959('0x1'));var moment=require(_0x5959('0x2'));var BPromise=require(_0x5959('0x3'));var rs=require(_0x5959('0x4'));var fs=require('fs');var Redis=require(_0x5959('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5959('0x6'));var logger=require('../../config/logger')(_0x5959('0x7'));var config=require(_0x5959('0x8'));var jayson=require(_0x5959('0x9'));var client=jayson[_0x5959('0xa')][_0x5959('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a0421,_0x2ab0f5,_0x491fc3){return new BPromise(function(_0x1d1101,_0xf93051){return client[_0x5959('0xc')](_0x4a0421,_0x491fc3)['then'](function(_0x234504){logger['info'](_0x5959('0xd'),_0x2ab0f5,'request\x20sent');logger[_0x5959('0xe')](_0x5959('0xf'),_0x2ab0f5,_0x5959('0x10'),JSON[_0x5959('0x11')](_0x234504));if(_0x234504[_0x5959('0x12')]){if(_0x234504['error'][_0x5959('0x13')]===0x1f4){logger[_0x5959('0x12')](_0x5959('0xd'),_0x2ab0f5,_0x234504['error']['message']);return _0xf93051(_0x234504[_0x5959('0x12')][_0x5959('0x14')]);}logger['error'](_0x5959('0xd'),_0x2ab0f5,_0x234504['error']['message']);return _0x1d1101(_0x234504[_0x5959('0x12')][_0x5959('0x14')]);}else{logger[_0x5959('0x15')]('VoiceMailMessage,\x20%s,\x20%s',_0x2ab0f5,'request\x20sent');_0x1d1101(_0x234504[_0x5959('0x16')]['message']);}})[_0x5959('0x17')](function(_0x1c60bc){logger[_0x5959('0x12')](_0x5959('0xd'),_0x2ab0f5,_0x1c60bc);_0xf93051(_0x1c60bc);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3d7dbe0..3cee7ef 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19cb=['get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x1bbff1,_0x542087){var _0x557ab6=function(_0x11fe02){while(--_0x11fe02){_0x1bbff1['push'](_0x1bbff1['shift']());}};_0x557ab6(++_0x542087);}(_0x19cb,0x13c));var _0xb19c=function(_0x4f0401,_0x3c9340){_0x4f0401=_0x4f0401-0x0;var _0x174624=_0x19cb[_0x4f0401];return _0x174624;};'use strict';var multer=require(_0xb19c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb19c('0x1'));var express=require(_0xb19c('0x2'));var router=express[_0xb19c('0x3')]();var fs_extra=require(_0xb19c('0x4'));var auth=require(_0xb19c('0x5'));var interaction=require(_0xb19c('0x6'));var config=require(_0xb19c('0x7'));var controller=require(_0xb19c('0x8'));router[_0xb19c('0x9')]('/',auth[_0xb19c('0xa')](),controller[_0xb19c('0xb')]);router[_0xb19c('0x9')](_0xb19c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb19c('0x9')](_0xb19c('0xd'),auth[_0xb19c('0xa')](),controller[_0xb19c('0xe')]);router[_0xb19c('0xf')]('/',auth[_0xb19c('0xa')](),controller[_0xb19c('0x10')]);router[_0xb19c('0xf')](_0xb19c('0xd'),auth[_0xb19c('0xa')](),controller[_0xb19c('0x11')]);router[_0xb19c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb19c('0x13')]);router[_0xb19c('0x14')]('/:id',auth[_0xb19c('0xa')](),controller[_0xb19c('0x15')]);router['delete'](_0xb19c('0x16'),auth[_0xb19c('0xa')](),controller[_0xb19c('0x17')]);module[_0xb19c('0x18')]=router; \ No newline at end of file +var _0x5ce4=['destroy','/:id/sounds/:id2','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','delete','/:id'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x5ce4,0x17e));var _0x45ce=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x5ce4[_0x1044e5];return _0x5ad0dd;};'use strict';var multer=require('multer');var util=require(_0x45ce('0x0'));var path=require(_0x45ce('0x1'));var timeout=require(_0x45ce('0x2'));var express=require('express');var router=express[_0x45ce('0x3')]();var fs_extra=require(_0x45ce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x45ce('0x5'));var config=require(_0x45ce('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x45ce('0x7')]('/',auth['isAuthenticated'](),controller[_0x45ce('0x8')]);router[_0x45ce('0x7')]('/:id',auth[_0x45ce('0x9')](),controller[_0x45ce('0xa')]);router[_0x45ce('0x7')](_0x45ce('0xb'),auth[_0x45ce('0x9')](),controller[_0x45ce('0xc')]);router[_0x45ce('0xd')]('/',auth['isAuthenticated'](),controller[_0x45ce('0xe')]);router[_0x45ce('0xd')](_0x45ce('0xb'),auth[_0x45ce('0x9')](),controller[_0x45ce('0xf')]);router['put']('/:id',auth[_0x45ce('0x9')](),controller['update']);router[_0x45ce('0x10')](_0x45ce('0x11'),auth[_0x45ce('0x9')](),controller[_0x45ce('0x12')]);router[_0x45ce('0x10')](_0x45ce('0x13'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 929fadf..e9da575 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47ba=['name','ENUM','custom','quietmp3nb','quietmp3','mp3','files','alpha','sequelize','STRING'];(function(_0x3842a2,_0x1ca34c){var _0x557bee=function(_0x4e6f8f){while(--_0x4e6f8f){_0x3842a2['push'](_0x3842a2['shift']());}};_0x557bee(++_0x1ca34c);}(_0x47ba,0x116));var _0xa47b=function(_0x349699,_0x369bc8){_0x349699=_0x349699-0x0;var _0x7d4bcc=_0x47ba[_0x349699];return _0x7d4bcc;};'use strict';var Sequelize=require(_0xa47b('0x0'));module['exports']={'name':{'type':Sequelize[_0xa47b('0x1')],'allowNull':![],'unique':_0xa47b('0x2')},'mode':{'type':Sequelize[_0xa47b('0x3')](_0xa47b('0x4'),'files','mp3nb',_0xa47b('0x5'),_0xa47b('0x6'),_0xa47b('0x7')),'allowNull':!![],'defaultValue':_0xa47b('0x8')},'directory':{'type':Sequelize[_0xa47b('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xa47b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa47b('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa47b('0x1')],'allowNull':!![],'defaultValue':_0xa47b('0x9')},'format':{'type':Sequelize[_0xa47b('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2802=['quietmp3nb','STRING','BOOLEAN','sequelize','exports','name','ENUM','files','mp3nb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2802,0x123));var _0x2280=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x2802[_0x467488];return _0x56107f;};'use strict';var Sequelize=require(_0x2280('0x0'));module[_0x2280('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2280('0x2')},'mode':{'type':Sequelize[_0x2280('0x3')]('custom',_0x2280('0x4'),_0x2280('0x5'),_0x2280('0x6'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2280('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2280('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2280('0x7')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2280('0x7')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2280('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index af3a8c9..752c31a 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x924c=['VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','update','body','create','sequelize','transaction','files','directory','join','root','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','extname','server/files/moh','%s.%s','symlinkSync','removeSound','findOne','id2','unlinkSync','getSounds','length','order','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type'];(function(_0x4378ac,_0x486faa){var _0x37e7f1=function(_0x1f1155){while(--_0x1f1155){_0x4378ac['push'](_0x4378ac['shift']());}};_0x37e7f1(++_0x486faa);}(_0x924c,0x10f));var _0xc924=function(_0x16bed1,_0x5ec9aa){_0x16bed1=_0x16bed1-0x0;var _0x3f8139=_0x924c[_0x16bed1];return _0x3f8139;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc924('0x0'));var jsonpatch=require(_0xc924('0x1'));var rp=require(_0xc924('0x2'));var moment=require('moment');var BPromise=require(_0xc924('0x3'));var Mustache=require(_0xc924('0x4'));var util=require(_0xc924('0x5'));var path=require('path');var sox=require(_0xc924('0x6'));var csv=require(_0xc924('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc924('0x8'));var _=require(_0xc924('0x9'));var squel=require(_0xc924('0xa'));var crypto=require(_0xc924('0xb'));var jsforce=require(_0xc924('0xc'));var deskjs=require(_0xc924('0xd'));var toCsv=require(_0xc924('0x7'));var querystring=require(_0xc924('0xe'));var Papa=require('papaparse');var Redis=require(_0xc924('0xf'));var authService=require(_0xc924('0x10'));var qs=require(_0xc924('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc924('0x12'));var logger=require('../../config/logger')(_0xc924('0x13'));var utils=require(_0xc924('0x14'));var config=require(_0xc924('0x15'));var licenseUtil=require(_0xc924('0x16'));var db=require(_0xc924('0x17'))['db'];function respondWithStatusCode(_0x5d72f3,_0x1295ae){_0x1295ae=_0x1295ae||0xcc;return function(_0x165c20){if(_0x165c20){return _0x5d72f3['sendStatus'](_0x1295ae);}return _0x5d72f3['status'](_0x1295ae)[_0xc924('0x18')]();};}function respondWithResult(_0x5a8015,_0x42bb96){_0x42bb96=_0x42bb96||0xc8;return function(_0x86abd3){if(_0x86abd3){return _0x5a8015[_0xc924('0x19')](_0x42bb96)['json'](_0x86abd3);}};}function respondWithFilteredResult(_0x4a345d,_0x5565ed){return function(_0x4b4a7b){if(_0x4b4a7b){var _0xdd3638=typeof _0x5565ed[_0xc924('0x1a')]===_0xc924('0x1b')&&typeof _0x5565ed['limit']===_0xc924('0x1b');var _0x3e18f3=_0x4b4a7b[_0xc924('0x1c')];var _0x1c44fc=_0xdd3638?0x0:_0x5565ed[_0xc924('0x1a')];var _0x44f70b=_0xdd3638?_0x4b4a7b[_0xc924('0x1c')]:_0x5565ed[_0xc924('0x1a')]+_0x5565ed[_0xc924('0x1d')];var _0x21d8cc;if(_0x44f70b>=_0x3e18f3){_0x44f70b=_0x3e18f3;_0x21d8cc=0xc8;}else{_0x21d8cc=0xce;}_0x4a345d[_0xc924('0x19')](_0x21d8cc);return _0x4a345d[_0xc924('0x1e')](_0xc924('0x1f'),_0x1c44fc+'-'+_0x44f70b+'/'+_0x3e18f3)[_0xc924('0x20')](_0x4b4a7b);}return null;};}function patchUpdates(_0x43135e){return function(_0x319fd4){try{jsonpatch[_0xc924('0x21')](_0x319fd4,_0x43135e,!![]);}catch(_0x4e1870){return BPromise[_0xc924('0x22')](_0x4e1870);}return _0x319fd4[_0xc924('0x23')]();};}function saveUpdates(_0x2ee88e,_0x3d352c){return function(_0x3c3a4b){if(_0x3c3a4b){return _0x3c3a4b['update'](_0x2ee88e)[_0xc924('0x24')](function(_0x4796e4){return _0x4796e4;});}return null;};}function removeEntity(_0x423487,_0x5c7465){return function(_0x2afa9e){if(_0x2afa9e){return _0x2afa9e[_0xc924('0x25')]()[_0xc924('0x24')](function(){var _0x35ccda=_0x2afa9e[_0xc924('0x26')]({'plain':!![]});var _0x45de43='MusicOnHolds';return db[_0xc924('0x27')][_0xc924('0x25')]({'where':{'type':_0x45de43,'resourceId':_0x35ccda['id']}})['then'](function(){return _0x2afa9e;});})[_0xc924('0x24')](function(){_0x423487['status'](0xcc)[_0xc924('0x18')]();});}};}function handleEntityNotFound(_0x501796,_0x493aa4){return function(_0x96044f){if(!_0x96044f){_0x501796[_0xc924('0x28')](0x194);}return _0x96044f;};}function handleError(_0x19286c,_0x1e5409){_0x1e5409=_0x1e5409||0x1f4;return function(_0x50334d){logger['error'](_0x50334d['stack']);if(_0x50334d[_0xc924('0x29')]){delete _0x50334d[_0xc924('0x29')];}_0x19286c[_0xc924('0x19')](_0x1e5409)['send'](_0x50334d);};}exports[_0xc924('0x2a')]=function(_0x80d6ab,_0x21dc7a){var _0x55fd4c={},_0x1463be={},_0x412e47={'count':0x0,'rows':[]};var _0x451ab0=_[_0xc924('0x2b')](db[_0xc924('0x2c')][_0xc924('0x2d')],function(_0x565432){return{'name':_0x565432[_0xc924('0x2e')],'type':_0x565432['type'][_0xc924('0x2f')]};});_0x1463be[_0xc924('0x30')]=_[_0xc924('0x2b')](_0x451ab0,_0xc924('0x29'));_0x1463be[_0xc924('0x31')]=_[_0xc924('0x32')](_0x80d6ab[_0xc924('0x31')]);_0x1463be[_0xc924('0x33')]=_[_0xc924('0x34')](_0x1463be[_0xc924('0x30')],_0x1463be[_0xc924('0x31')]);_0x55fd4c[_0xc924('0x35')]=_['intersection'](_0x1463be[_0xc924('0x30')],qs[_0xc924('0x36')](_0x80d6ab['query'][_0xc924('0x36')]));_0x55fd4c[_0xc924('0x35')]=_0x55fd4c[_0xc924('0x35')]['length']?_0x55fd4c[_0xc924('0x35')]:_0x1463be[_0xc924('0x30')];if(!_0x80d6ab['query'][_0xc924('0x37')](_0xc924('0x38'))){_0x55fd4c[_0xc924('0x1d')]=qs[_0xc924('0x1d')](_0x80d6ab[_0xc924('0x31')][_0xc924('0x1d')]);_0x55fd4c[_0xc924('0x1a')]=qs[_0xc924('0x1a')](_0x80d6ab[_0xc924('0x31')][_0xc924('0x1a')]);}_0x55fd4c['order']=qs[_0xc924('0x39')](_0x80d6ab['query'][_0xc924('0x39')]);delete _0x80d6ab[_0xc924('0x31')][_0xc924('0x39')];_0x55fd4c['where']=qs['filters'](_[_0xc924('0x3a')](_0x80d6ab[_0xc924('0x31')],_0x1463be[_0xc924('0x33')]),_0x451ab0);if(_0x80d6ab[_0xc924('0x31')][_0xc924('0x3b')]){_0x55fd4c[_0xc924('0x3c')]=_['merge'](_0x55fd4c['where'],{'$or':_[_0xc924('0x2b')](_0x451ab0,function(_0x238c1a){if(_0x238c1a[_0xc924('0x3d')]!==_0xc924('0x3e')){var _0x50908a={};_0x50908a[_0x238c1a[_0xc924('0x29')]]={'$like':'%'+_0x80d6ab[_0xc924('0x31')][_0xc924('0x3b')]+'%'};return _0x50908a;}})});}_0x55fd4c=_[_0xc924('0x3f')]({},_0x55fd4c,_0x80d6ab[_0xc924('0x40')]);var _0x2650fc={'where':_0x55fd4c['where']};return db[_0xc924('0x2c')][_0xc924('0x1c')](_0x2650fc)['then'](function(_0xa38ff1){_0x412e47[_0xc924('0x1c')]=_0xa38ff1;if(_0x80d6ab[_0xc924('0x31')][_0xc924('0x41')]){_0x55fd4c[_0xc924('0x42')]=[{'all':!![]}];}return db[_0xc924('0x2c')]['findAll'](_0x55fd4c);})[_0xc924('0x24')](function(_0x1b1213){_0x412e47[_0xc924('0x43')]=_0x1b1213;return _0x412e47;})['then'](respondWithFilteredResult(_0x21dc7a,_0x55fd4c))[_0xc924('0x44')](handleError(_0x21dc7a,null));};exports[_0xc924('0x45')]=function(_0x2426f0,_0x56c6c1){var _0x4f736f={'raw':![],'where':{'id':_0x2426f0[_0xc924('0x46')]['id']}},_0x59bf64={};_0x59bf64['model']=_[_0xc924('0x32')](db[_0xc924('0x2c')]['rawAttributes']);_0x59bf64['query']=_[_0xc924('0x32')](_0x2426f0[_0xc924('0x31')]);_0x59bf64['filters']=_[_0xc924('0x34')](_0x59bf64[_0xc924('0x30')],_0x59bf64[_0xc924('0x31')]);_0x4f736f[_0xc924('0x35')]=_[_0xc924('0x34')](_0x59bf64[_0xc924('0x30')],qs['fields'](_0x2426f0[_0xc924('0x31')][_0xc924('0x36')]));_0x4f736f[_0xc924('0x35')]=_0x4f736f[_0xc924('0x35')]['length']?_0x4f736f[_0xc924('0x35')]:_0x59bf64[_0xc924('0x30')];if(_0x2426f0['query'][_0xc924('0x41')]){_0x4f736f[_0xc924('0x42')]=[{'all':!![]}];}_0x4f736f=_[_0xc924('0x3f')]({},_0x4f736f,_0x2426f0['options']);return db[_0xc924('0x2c')][_0xc924('0x47')](_0x4f736f)[_0xc924('0x24')](handleEntityNotFound(_0x56c6c1,null))[_0xc924('0x24')](respondWithResult(_0x56c6c1,null))['catch'](handleError(_0x56c6c1,null));};exports[_0xc924('0x48')]=function(_0x11fb19,_0x45a24b){if(_0x11fb19[_0xc924('0x49')]['id']){delete _0x11fb19['body']['id'];}return db['VoiceMusicOnHold'][_0xc924('0x47')]({'where':{'id':_0x11fb19[_0xc924('0x46')]['id']}})[_0xc924('0x24')](handleEntityNotFound(_0x45a24b,null))[_0xc924('0x24')](saveUpdates(_0x11fb19[_0xc924('0x49')],null))['then'](respondWithResult(_0x45a24b,null))['catch'](handleError(_0x45a24b,null));};exports[_0xc924('0x4a')]=function(_0x5c04b0,_0x3a0a07,_0x5ec110){return db[_0xc924('0x4b')][_0xc924('0x4c')](function(_0x2811d6){if(_0x5c04b0[_0xc924('0x49')]['mode']===_0xc924('0x4d')){_0x5c04b0[_0xc924('0x49')][_0xc924('0x4e')]=path[_0xc924('0x4f')](config[_0xc924('0x50')],'server/files/moh',_0x5c04b0[_0xc924('0x49')]['name']);}return db[_0xc924('0x2c')]['create'](_0x5c04b0[_0xc924('0x49')],{'transaction':_0x2811d6})['then'](function(_0x30147b){if(_0x5c04b0[_0xc924('0x49')]['mode']===_0xc924('0x4d')){fs[_0xc924('0x51')](_0x30147b[_0xc924('0x4e')],parseInt(_0xc924('0x52'),0x8));}var _0x4eb7b1=_0x5c04b0['user'][_0xc924('0x26')]({'plain':!![]});if(!_0x4eb7b1)throw new Error(_0xc924('0x53'));if(_0x4eb7b1['role']===_0xc924('0x54')){var _0x514266=_0x30147b[_0xc924('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xc924('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4eb7b1[_0xc924('0x55')]},'raw':!![]})[_0xc924('0x24')](function(_0x28fd52){if(_0x28fd52&&_0x28fd52['autoAssociation']===0x0){return db['UserProfileResource'][_0xc924('0x4a')]({'name':_0x514266[_0xc924('0x29')],'resourceId':_0x514266['id'],'type':_0x28fd52[_0xc924('0x29')],'sectionId':_0x28fd52['id']},{})['then'](function(){return _0x30147b;});}else{return _0x30147b;}})[_0xc924('0x44')](function(_0x2ea5d8){logger[_0xc924('0x56')](_0xc924('0x57'),_0x2ea5d8);});}return _0x30147b;});})[_0xc924('0x24')](respondWithResult(_0x3a0a07,0xc9))[_0xc924('0x44')](handleError(_0x3a0a07,null));};exports[_0xc924('0x25')]=function(_0x2850c5,_0x5a9829,_0x303302){var _0x4b67d4;return db[_0xc924('0x2c')][_0xc924('0x47')]({'where':{'id':_0x2850c5[_0xc924('0x46')]['id']}})['then'](function(_0x2d917a){if(_0x2d917a){return db[_0xc924('0x4b')][_0xc924('0x4c')](function(_0x1cdb2b){return _0x2d917a[_0xc924('0x25')]({'transaction':_0x1cdb2b,'raw':!![]})[_0xc924('0x24')](function(_0x117903){if(_0x117903[_0xc924('0x4e')]){fs['readdirSync'](_0x117903[_0xc924('0x4e')])[_0xc924('0x58')](function(_0x4017b0){fs['unlinkSync'](path[_0xc924('0x4f')](_0x117903[_0xc924('0x4e')],_0x4017b0));});fs[_0xc924('0x59')](_0x117903[_0xc924('0x4e')]);}return _0x117903;});})[_0xc924('0x44')](function(_0x2193d8){throw new db[(_0xc924('0x5a'))][(_0xc924('0x5b'))](_0x2193d8[_0xc924('0x5c')]);});}})['then'](handleEntityNotFound(_0x5a9829,null))['then'](removeEntity(_0x5a9829,null))[_0xc924('0x44')](handleError(_0x5a9829,null));};exports['addSound']=function(_0x452a96,_0x581d75,_0xc6e25e){return db[_0xc924('0x4b')][_0xc924('0x4c')](function(_0xc1f9b4){var _0x4039e7;return db[_0xc924('0x2c')]['find']({'where':{'id':_0x452a96[_0xc924('0x46')]['id']}})[_0xc924('0x24')](function(_0x238f6b){if(_0x238f6b){_0x4039e7=_0x238f6b;return _0x238f6b[_0xc924('0x5d')](_0x452a96[_0xc924('0x49')]['id'],{'transaction':_0xc1f9b4});}})[_0xc924('0x24')](function(_0x4ae189){if(_0x4ae189){return db[_0xc924('0x5e')]['findOne']({'where':{'id':_0x452a96[_0xc924('0x49')]['id']},'attributes':['id',_0xc924('0x29'),_0xc924('0x5f'),_0xc924('0x60'),_0xc924('0x61')],'raw':!![]});}})[_0xc924('0x24')](function(_0x5d07ce){if(_0x5d07ce){var _0x188b0f=path[_0xc924('0x4f')](config['root'],_0xc924('0x62'),util[_0xc924('0x63')]('%s.%s',path['basename'](_0x5d07ce[_0xc924('0x5f')],path[_0xc924('0x64')](_0x5d07ce[_0xc924('0x5f')])),_0x5d07ce[_0xc924('0x60')]));var _0x113ec5=path[_0xc924('0x4f')](config[_0xc924('0x50')],_0xc924('0x65'),_0x4039e7[_0xc924('0x29')],util[_0xc924('0x63')](_0xc924('0x66'),_0x5d07ce['name'],_0x5d07ce['converted_format']));fs[_0xc924('0x67')](_0x188b0f,_0x113ec5);return _0x5d07ce;}})['catch'](function(_0x29217e){throw new db[(_0xc924('0x5a'))]['ValidationError'](_0x29217e[_0xc924('0x5c')]);});})['then'](handleEntityNotFound(_0x581d75,null))[_0xc924('0x24')](respondWithResult(_0x581d75,0xc9))[_0xc924('0x44')](handleError(_0x581d75,null));};exports[_0xc924('0x68')]=function(_0x20737e,_0x39fb17,_0x170f4e){return db[_0xc924('0x4b')][_0xc924('0x4c')](function(_0x47c6fa){var _0x279968;return db[_0xc924('0x2c')][_0xc924('0x69')]({'where':{'id':_0x20737e[_0xc924('0x46')]['id']}})[_0xc924('0x24')](handleEntityNotFound(_0x39fb17,null))[_0xc924('0x24')](function(_0x2a1ee0){if(_0x2a1ee0){_0x279968=_0x2a1ee0;return _0x2a1ee0['removeSound'](_0x20737e[_0xc924('0x46')][_0xc924('0x6a')]);}})[_0xc924('0x24')](function(_0x3b9c0d){if(_0x3b9c0d){return db[_0xc924('0x5e')]['findOne']({'where':{'id':_0x20737e['params'][_0xc924('0x6a')]},'attributes':['id',_0xc924('0x29'),'save_name',_0xc924('0x60'),_0xc924('0x61')],'raw':!![]});}})[_0xc924('0x24')](function(_0x5f3926){if(_0x5f3926){fs[_0xc924('0x6b')](path[_0xc924('0x4f')](_0x279968[_0xc924('0x4e')],util[_0xc924('0x63')]('%s.%s',_0x5f3926['name'],_0x5f3926[_0xc924('0x60')])));return _0x5f3926;}})[_0xc924('0x44')](function(_0x47e8e9){throw new db[(_0xc924('0x5a'))][(_0xc924('0x5b'))](_0x47e8e9[_0xc924('0x5c')]);});})[_0xc924('0x24')](handleEntityNotFound(_0x39fb17,null))[_0xc924('0x24')](respondWithStatusCode(_0x39fb17,0xcc))[_0xc924('0x44')](handleError(_0x39fb17,null));};exports[_0xc924('0x6c')]=function(_0x4b5113,_0x1749af,_0x9669c7){var _0xf5a3d6={};var _0x5dae97={};var _0x2090bf;var _0x238206;return db[_0xc924('0x2c')][_0xc924('0x69')]({'where':{'id':_0x4b5113[_0xc924('0x46')]['id']}})['then'](handleEntityNotFound(_0x1749af,null))['then'](function(_0xfe9f86){if(_0xfe9f86){_0x2090bf=_0xfe9f86;_0x5dae97[_0xc924('0x30')]=_[_0xc924('0x32')](db[_0xc924('0x5e')]['rawAttributes']);_0x5dae97[_0xc924('0x31')]=_['keys'](_0x4b5113[_0xc924('0x31')]);_0x5dae97[_0xc924('0x33')]=_[_0xc924('0x34')](_0x5dae97[_0xc924('0x30')],_0x5dae97[_0xc924('0x31')]);_0xf5a3d6[_0xc924('0x35')]=_[_0xc924('0x34')](_0x5dae97[_0xc924('0x30')],qs[_0xc924('0x36')](_0x4b5113[_0xc924('0x31')][_0xc924('0x36')]));_0xf5a3d6['attributes']=_0xf5a3d6[_0xc924('0x35')][_0xc924('0x6d')]?_0xf5a3d6[_0xc924('0x35')]:_0x5dae97[_0xc924('0x30')];_0xf5a3d6[_0xc924('0x6e')]=qs[_0xc924('0x39')](_0x4b5113[_0xc924('0x31')][_0xc924('0x39')]);_0xf5a3d6[_0xc924('0x3c')]=qs[_0xc924('0x33')](_[_0xc924('0x3a')](_0x4b5113[_0xc924('0x31')],_0x5dae97[_0xc924('0x33')]));if(_0x4b5113[_0xc924('0x31')]['filter']){_0xf5a3d6['where']=_[_0xc924('0x3f')](_0xf5a3d6[_0xc924('0x3c')],{'$or':_['map'](_0xf5a3d6[_0xc924('0x35')],function(_0x1e702c){var _0x3c3f41={};_0x3c3f41[_0x1e702c]={'$like':'%'+_0x4b5113['query'][_0xc924('0x3b')]+'%'};return _0x3c3f41;})});}_0xf5a3d6=_[_0xc924('0x3f')]({},_0xf5a3d6,_0x4b5113['options']);return _0x2090bf[_0xc924('0x6c')](_0xf5a3d6);}})['then'](function(_0x423b98){if(_0x423b98){_0x238206=_0x423b98[_0xc924('0x6d')];if(!_0x4b5113[_0xc924('0x31')][_0xc924('0x37')](_0xc924('0x38'))){_0xf5a3d6[_0xc924('0x1d')]=qs[_0xc924('0x1d')](_0x4b5113['query'][_0xc924('0x1d')]);_0xf5a3d6['offset']=qs[_0xc924('0x1a')](_0x4b5113[_0xc924('0x31')]['offset']);}return _0x2090bf[_0xc924('0x6c')](_0xf5a3d6);}})['then'](function(_0x57a314){if(_0x57a314){return _0x57a314?{'count':_0x238206,'rows':_0x57a314}:null;}})['then'](respondWithResult(_0x1749af,null))['catch'](handleError(_0x1749af,null));}; \ No newline at end of file +var _0x0d2c=['directory','join','root','server/files/moh','mode','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','readdirSync','forEach','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','Sequelize','removeSound','getSounds','length','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceMusicOnHold','includeAll','include','findAll','show','options','find','catch','body','params','create','transaction','files'];(function(_0x3e6fe4,_0x1e85d8){var _0x3c4da6=function(_0x58ba67){while(--_0x58ba67){_0x3e6fe4['push'](_0x3e6fe4['shift']());}};_0x3c4da6(++_0x1e85d8);}(_0x0d2c,0x171));var _0xc0d2=function(_0x523a86,_0xfbeb1c){_0x523a86=_0x523a86-0x0;var _0x1d9926=_0x0d2c[_0x523a86];return _0x1d9926;};'use strict';var emlformat=require(_0xc0d2('0x0'));var rimraf=require(_0xc0d2('0x1'));var zipdir=require(_0xc0d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc0d2('0x3'));var Mustache=require(_0xc0d2('0x4'));var util=require('util');var path=require(_0xc0d2('0x5'));var sox=require(_0xc0d2('0x6'));var csv=require(_0xc0d2('0x7'));var ejs=require(_0xc0d2('0x8'));var fs=require('fs');var fs_extra=require(_0xc0d2('0x9'));var _=require(_0xc0d2('0xa'));var squel=require(_0xc0d2('0xb'));var crypto=require(_0xc0d2('0xc'));var jsforce=require(_0xc0d2('0xd'));var deskjs=require(_0xc0d2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc0d2('0xf'));var Papa=require(_0xc0d2('0x10'));var Redis=require(_0xc0d2('0x11'));var authService=require(_0xc0d2('0x12'));var qs=require(_0xc0d2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0d2('0x14'));var logger=require(_0xc0d2('0x15'))(_0xc0d2('0x16'));var utils=require('../../config/utils');var config=require(_0xc0d2('0x17'));var licenseUtil=require(_0xc0d2('0x18'));var db=require(_0xc0d2('0x19'))['db'];function respondWithStatusCode(_0x207562,_0x4c57ec){_0x4c57ec=_0x4c57ec||0xcc;return function(_0x4e045e){if(_0x4e045e){return _0x207562[_0xc0d2('0x1a')](_0x4c57ec);}return _0x207562[_0xc0d2('0x1b')](_0x4c57ec)[_0xc0d2('0x1c')]();};}function respondWithResult(_0x403fbd,_0x1ea270){_0x1ea270=_0x1ea270||0xc8;return function(_0x9c72fb){if(_0x9c72fb){return _0x403fbd[_0xc0d2('0x1b')](_0x1ea270)[_0xc0d2('0x1d')](_0x9c72fb);}};}function respondWithFilteredResult(_0x4b2b98,_0x4e9274){return function(_0x45f58e){if(_0x45f58e){var _0xd32330=typeof _0x4e9274['offset']===_0xc0d2('0x1e')&&typeof _0x4e9274[_0xc0d2('0x1f')]==='undefined';var _0x5c4ca9=_0x45f58e[_0xc0d2('0x20')];var _0x3ca233=_0xd32330?0x0:_0x4e9274[_0xc0d2('0x21')];var _0x825979=_0xd32330?_0x45f58e['count']:_0x4e9274[_0xc0d2('0x21')]+_0x4e9274[_0xc0d2('0x1f')];var _0x15c4d0;if(_0x825979>=_0x5c4ca9){_0x825979=_0x5c4ca9;_0x15c4d0=0xc8;}else{_0x15c4d0=0xce;}_0x4b2b98[_0xc0d2('0x1b')](_0x15c4d0);return _0x4b2b98[_0xc0d2('0x22')](_0xc0d2('0x23'),_0x3ca233+'-'+_0x825979+'/'+_0x5c4ca9)[_0xc0d2('0x1d')](_0x45f58e);}return null;};}function patchUpdates(_0x4dc1be){return function(_0x525fdc){try{jsonpatch['apply'](_0x525fdc,_0x4dc1be,!![]);}catch(_0x56ae90){return BPromise[_0xc0d2('0x24')](_0x56ae90);}return _0x525fdc[_0xc0d2('0x25')]();};}function saveUpdates(_0x242ba0,_0x29a5bd){return function(_0xa77956){if(_0xa77956){return _0xa77956[_0xc0d2('0x26')](_0x242ba0)[_0xc0d2('0x27')](function(_0x480413){return _0x480413;});}return null;};}function removeEntity(_0x536d95,_0x49d4d8){return function(_0x3d2792){if(_0x3d2792){return _0x3d2792[_0xc0d2('0x28')]()[_0xc0d2('0x27')](function(){var _0xee2c00=_0x3d2792['get']({'plain':!![]});var _0x3162a0=_0xc0d2('0x29');return db[_0xc0d2('0x2a')][_0xc0d2('0x28')]({'where':{'type':_0x3162a0,'resourceId':_0xee2c00['id']}})[_0xc0d2('0x27')](function(){return _0x3d2792;});})[_0xc0d2('0x27')](function(){_0x536d95['status'](0xcc)[_0xc0d2('0x1c')]();});}};}function handleEntityNotFound(_0x1b5963,_0x5d0d66){return function(_0xcdb917){if(!_0xcdb917){_0x1b5963['sendStatus'](0x194);}return _0xcdb917;};}function handleError(_0x1b0d22,_0x112d42){_0x112d42=_0x112d42||0x1f4;return function(_0x36d93c){logger['error'](_0x36d93c[_0xc0d2('0x2b')]);if(_0x36d93c[_0xc0d2('0x2c')]){delete _0x36d93c[_0xc0d2('0x2c')];}_0x1b0d22[_0xc0d2('0x1b')](_0x112d42)[_0xc0d2('0x2d')](_0x36d93c);};}exports['index']=function(_0x5e1b04,_0x124a23){var _0x5c93bb={},_0x5bace3={},_0x995b48={'count':0x0,'rows':[]};var _0x43b475=_[_0xc0d2('0x2e')](db['VoiceMusicOnHold'][_0xc0d2('0x2f')],function(_0x3b4a22){return{'name':_0x3b4a22[_0xc0d2('0x30')],'type':_0x3b4a22[_0xc0d2('0x31')][_0xc0d2('0x32')]};});_0x5bace3[_0xc0d2('0x33')]=_['map'](_0x43b475,_0xc0d2('0x2c'));_0x5bace3[_0xc0d2('0x34')]=_[_0xc0d2('0x35')](_0x5e1b04['query']);_0x5bace3[_0xc0d2('0x36')]=_[_0xc0d2('0x37')](_0x5bace3[_0xc0d2('0x33')],_0x5bace3[_0xc0d2('0x34')]);_0x5c93bb[_0xc0d2('0x38')]=_['intersection'](_0x5bace3[_0xc0d2('0x33')],qs[_0xc0d2('0x39')](_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x39')]));_0x5c93bb['attributes']=_0x5c93bb[_0xc0d2('0x38')]['length']?_0x5c93bb[_0xc0d2('0x38')]:_0x5bace3[_0xc0d2('0x33')];if(!_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x3a')](_0xc0d2('0x3b'))){_0x5c93bb[_0xc0d2('0x1f')]=qs[_0xc0d2('0x1f')](_0x5e1b04[_0xc0d2('0x34')]['limit']);_0x5c93bb[_0xc0d2('0x21')]=qs['offset'](_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x21')]);}_0x5c93bb[_0xc0d2('0x3c')]=qs[_0xc0d2('0x3d')](_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x3d')]);delete _0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x3d')];_0x5c93bb[_0xc0d2('0x3e')]=qs[_0xc0d2('0x36')](_[_0xc0d2('0x3f')](_0x5e1b04[_0xc0d2('0x34')],_0x5bace3['filters']),_0x43b475);if(_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x40')]){_0x5c93bb[_0xc0d2('0x3e')]=_[_0xc0d2('0x41')](_0x5c93bb['where'],{'$or':_['map'](_0x43b475,function(_0xb218df){if(_0xb218df[_0xc0d2('0x31')]!=='VIRTUAL'){var _0x2f6ca2={};_0x2f6ca2[_0xb218df['name']]={'$like':'%'+_0x5e1b04[_0xc0d2('0x34')]['filter']+'%'};return _0x2f6ca2;}})});}_0x5c93bb=_[_0xc0d2('0x41')]({},_0x5c93bb,_0x5e1b04['options']);var _0x3a8652={'where':_0x5c93bb[_0xc0d2('0x3e')]};return db[_0xc0d2('0x42')][_0xc0d2('0x20')](_0x3a8652)['then'](function(_0x2f439b){_0x995b48['count']=_0x2f439b;if(_0x5e1b04[_0xc0d2('0x34')][_0xc0d2('0x43')]){_0x5c93bb[_0xc0d2('0x44')]=[{'all':!![]}];}return db[_0xc0d2('0x42')][_0xc0d2('0x45')](_0x5c93bb);})[_0xc0d2('0x27')](function(_0x180f42){_0x995b48['rows']=_0x180f42;return _0x995b48;})[_0xc0d2('0x27')](respondWithFilteredResult(_0x124a23,_0x5c93bb))['catch'](handleError(_0x124a23,null));};exports[_0xc0d2('0x46')]=function(_0x1b83d0,_0x456fd6){var _0x3188c8={'raw':![],'where':{'id':_0x1b83d0['params']['id']}},_0x3a57aa={};_0x3a57aa[_0xc0d2('0x33')]=_['keys'](db[_0xc0d2('0x42')][_0xc0d2('0x2f')]);_0x3a57aa[_0xc0d2('0x34')]=_[_0xc0d2('0x35')](_0x1b83d0[_0xc0d2('0x34')]);_0x3a57aa['filters']=_['intersection'](_0x3a57aa['model'],_0x3a57aa[_0xc0d2('0x34')]);_0x3188c8[_0xc0d2('0x38')]=_[_0xc0d2('0x37')](_0x3a57aa['model'],qs[_0xc0d2('0x39')](_0x1b83d0[_0xc0d2('0x34')]['fields']));_0x3188c8[_0xc0d2('0x38')]=_0x3188c8[_0xc0d2('0x38')]['length']?_0x3188c8[_0xc0d2('0x38')]:_0x3a57aa[_0xc0d2('0x33')];if(_0x1b83d0[_0xc0d2('0x34')]['includeAll']){_0x3188c8[_0xc0d2('0x44')]=[{'all':!![]}];}_0x3188c8=_[_0xc0d2('0x41')]({},_0x3188c8,_0x1b83d0[_0xc0d2('0x47')]);return db[_0xc0d2('0x42')][_0xc0d2('0x48')](_0x3188c8)[_0xc0d2('0x27')](handleEntityNotFound(_0x456fd6,null))['then'](respondWithResult(_0x456fd6,null))[_0xc0d2('0x49')](handleError(_0x456fd6,null));};exports[_0xc0d2('0x26')]=function(_0x323764,_0x3815c0){if(_0x323764[_0xc0d2('0x4a')]['id']){delete _0x323764[_0xc0d2('0x4a')]['id'];}return db[_0xc0d2('0x42')][_0xc0d2('0x48')]({'where':{'id':_0x323764[_0xc0d2('0x4b')]['id']}})[_0xc0d2('0x27')](handleEntityNotFound(_0x3815c0,null))[_0xc0d2('0x27')](saveUpdates(_0x323764[_0xc0d2('0x4a')],null))[_0xc0d2('0x27')](respondWithResult(_0x3815c0,null))['catch'](handleError(_0x3815c0,null));};exports[_0xc0d2('0x4c')]=function(_0x1b6872,_0xcc3742,_0x3611c2){return db['sequelize'][_0xc0d2('0x4d')](function(_0x3ad69b){if(_0x1b6872['body']['mode']===_0xc0d2('0x4e')){_0x1b6872[_0xc0d2('0x4a')][_0xc0d2('0x4f')]=path[_0xc0d2('0x50')](config[_0xc0d2('0x51')],_0xc0d2('0x52'),_0x1b6872[_0xc0d2('0x4a')][_0xc0d2('0x2c')]);}return db['VoiceMusicOnHold'][_0xc0d2('0x4c')](_0x1b6872[_0xc0d2('0x4a')],{'transaction':_0x3ad69b})['then'](function(_0x526ce3){if(_0x1b6872[_0xc0d2('0x4a')][_0xc0d2('0x53')]===_0xc0d2('0x4e')){fs['mkdirSync'](_0x526ce3[_0xc0d2('0x4f')],parseInt(_0xc0d2('0x54'),0x8));}var _0x1e53fe=_0x1b6872['user'][_0xc0d2('0x55')]({'plain':!![]});if(!_0x1e53fe)throw new Error(_0xc0d2('0x56'));if(_0x1e53fe[_0xc0d2('0x57')]==='user'){var _0x4e6c0b=_0x526ce3[_0xc0d2('0x55')]({'plain':!![]});return db[_0xc0d2('0x58')][_0xc0d2('0x48')]({'where':{'name':_0xc0d2('0x29'),'userProfileId':_0x1e53fe[_0xc0d2('0x59')]},'raw':!![]})['then'](function(_0x1c3349){if(_0x1c3349&&_0x1c3349[_0xc0d2('0x5a')]===0x0){return db[_0xc0d2('0x2a')][_0xc0d2('0x4c')]({'name':_0x4e6c0b['name'],'resourceId':_0x4e6c0b['id'],'type':_0x1c3349[_0xc0d2('0x2c')],'sectionId':_0x1c3349['id']},{})[_0xc0d2('0x27')](function(){return _0x526ce3;});}else{return _0x526ce3;}})[_0xc0d2('0x49')](function(_0x97c889){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97c889);});}return _0x526ce3;});})[_0xc0d2('0x27')](respondWithResult(_0xcc3742,0xc9))['catch'](handleError(_0xcc3742,null));};exports[_0xc0d2('0x28')]=function(_0x11832f,_0x4dbf22,_0x4d39e3){var _0x10ec1a;return db['VoiceMusicOnHold'][_0xc0d2('0x48')]({'where':{'id':_0x11832f['params']['id']}})['then'](function(_0x45c6b3){if(_0x45c6b3){return db['sequelize'][_0xc0d2('0x4d')](function(_0x3ad8e1){return _0x45c6b3['destroy']({'transaction':_0x3ad8e1,'raw':!![]})['then'](function(_0x53f4be){if(_0x53f4be[_0xc0d2('0x4f')]){fs[_0xc0d2('0x5b')](_0x53f4be[_0xc0d2('0x4f')])[_0xc0d2('0x5c')](function(_0x5dfc5a){fs['unlinkSync'](path[_0xc0d2('0x50')](_0x53f4be[_0xc0d2('0x4f')],_0x5dfc5a));});fs['rmdirSync'](_0x53f4be['directory']);}return _0x53f4be;});})[_0xc0d2('0x49')](function(_0x5da2a1){throw new db['Sequelize'][(_0xc0d2('0x5d'))](_0x5da2a1[_0xc0d2('0x5e')]);});}})[_0xc0d2('0x27')](handleEntityNotFound(_0x4dbf22,null))['then'](removeEntity(_0x4dbf22,null))[_0xc0d2('0x49')](handleError(_0x4dbf22,null));};exports[_0xc0d2('0x5f')]=function(_0x29712a,_0x282ee3,_0x504dc7){return db[_0xc0d2('0x60')][_0xc0d2('0x4d')](function(_0x370112){var _0x4e6aa1;return db['VoiceMusicOnHold'][_0xc0d2('0x48')]({'where':{'id':_0x29712a[_0xc0d2('0x4b')]['id']}})[_0xc0d2('0x27')](function(_0x38e4f8){if(_0x38e4f8){_0x4e6aa1=_0x38e4f8;return _0x38e4f8[_0xc0d2('0x5f')](_0x29712a['body']['id'],{'transaction':_0x370112});}})[_0xc0d2('0x27')](function(_0x53ad28){if(_0x53ad28){return db[_0xc0d2('0x61')][_0xc0d2('0x62')]({'where':{'id':_0x29712a[_0xc0d2('0x4a')]['id']},'attributes':['id',_0xc0d2('0x2c'),_0xc0d2('0x63'),_0xc0d2('0x64'),_0xc0d2('0x65')],'raw':!![]});}})[_0xc0d2('0x27')](function(_0x182104){if(_0x182104){var _0x5bd1b9=path[_0xc0d2('0x50')](config[_0xc0d2('0x51')],_0xc0d2('0x66'),util[_0xc0d2('0x67')]('%s.%s',path[_0xc0d2('0x68')](_0x182104[_0xc0d2('0x63')],path[_0xc0d2('0x69')](_0x182104['save_name'])),_0x182104[_0xc0d2('0x64')]));var _0x50ae92=path[_0xc0d2('0x50')](config[_0xc0d2('0x51')],'server/files/moh',_0x4e6aa1[_0xc0d2('0x2c')],util['format'](_0xc0d2('0x6a'),_0x182104['name'],_0x182104[_0xc0d2('0x64')]));fs[_0xc0d2('0x6b')](_0x5bd1b9,_0x50ae92);return _0x182104;}})[_0xc0d2('0x49')](function(_0x34d507){throw new db[(_0xc0d2('0x6c'))][(_0xc0d2('0x5d'))](_0x34d507[_0xc0d2('0x5e')]);});})[_0xc0d2('0x27')](handleEntityNotFound(_0x282ee3,null))[_0xc0d2('0x27')](respondWithResult(_0x282ee3,0xc9))['catch'](handleError(_0x282ee3,null));};exports[_0xc0d2('0x6d')]=function(_0x522775,_0x54ff37,_0x3572d5){return db[_0xc0d2('0x60')][_0xc0d2('0x4d')](function(_0x1565b5){var _0x2a89f5;return db[_0xc0d2('0x42')][_0xc0d2('0x62')]({'where':{'id':_0x522775[_0xc0d2('0x4b')]['id']}})[_0xc0d2('0x27')](handleEntityNotFound(_0x54ff37,null))['then'](function(_0x90093c){if(_0x90093c){_0x2a89f5=_0x90093c;return _0x90093c[_0xc0d2('0x6d')](_0x522775[_0xc0d2('0x4b')]['id2']);}})[_0xc0d2('0x27')](function(_0x5b6d1d){if(_0x5b6d1d){return db[_0xc0d2('0x61')][_0xc0d2('0x62')]({'where':{'id':_0x522775[_0xc0d2('0x4b')]['id2']},'attributes':['id',_0xc0d2('0x2c'),'save_name',_0xc0d2('0x64'),'createdAt'],'raw':!![]});}})[_0xc0d2('0x27')](function(_0x3e3e52){if(_0x3e3e52){fs['unlinkSync'](path['join'](_0x2a89f5[_0xc0d2('0x4f')],util[_0xc0d2('0x67')]('%s.%s',_0x3e3e52[_0xc0d2('0x2c')],_0x3e3e52[_0xc0d2('0x64')])));return _0x3e3e52;}})[_0xc0d2('0x49')](function(_0x587163){throw new db[(_0xc0d2('0x6c'))]['ValidationError'](_0x587163[_0xc0d2('0x5e')]);});})[_0xc0d2('0x27')](handleEntityNotFound(_0x54ff37,null))['then'](respondWithStatusCode(_0x54ff37,0xcc))['catch'](handleError(_0x54ff37,null));};exports[_0xc0d2('0x6e')]=function(_0x5845fe,_0xf8235b,_0x2971b4){var _0x4232c3={};var _0x452161={};var _0x5c5b99;var _0x388071;return db['VoiceMusicOnHold'][_0xc0d2('0x62')]({'where':{'id':_0x5845fe['params']['id']}})[_0xc0d2('0x27')](handleEntityNotFound(_0xf8235b,null))[_0xc0d2('0x27')](function(_0x4962f3){if(_0x4962f3){_0x5c5b99=_0x4962f3;_0x452161[_0xc0d2('0x33')]=_['keys'](db['Sound']['rawAttributes']);_0x452161[_0xc0d2('0x34')]=_[_0xc0d2('0x35')](_0x5845fe[_0xc0d2('0x34')]);_0x452161[_0xc0d2('0x36')]=_['intersection'](_0x452161[_0xc0d2('0x33')],_0x452161['query']);_0x4232c3[_0xc0d2('0x38')]=_[_0xc0d2('0x37')](_0x452161[_0xc0d2('0x33')],qs[_0xc0d2('0x39')](_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x39')]));_0x4232c3['attributes']=_0x4232c3[_0xc0d2('0x38')][_0xc0d2('0x6f')]?_0x4232c3[_0xc0d2('0x38')]:_0x452161[_0xc0d2('0x33')];_0x4232c3[_0xc0d2('0x3c')]=qs['sort'](_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x3d')]);_0x4232c3[_0xc0d2('0x3e')]=qs['filters'](_[_0xc0d2('0x3f')](_0x5845fe[_0xc0d2('0x34')],_0x452161['filters']));if(_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x40')]){_0x4232c3[_0xc0d2('0x3e')]=_[_0xc0d2('0x41')](_0x4232c3['where'],{'$or':_[_0xc0d2('0x2e')](_0x4232c3[_0xc0d2('0x38')],function(_0x1ae944){var _0x275e63={};_0x275e63[_0x1ae944]={'$like':'%'+_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x40')]+'%'};return _0x275e63;})});}_0x4232c3=_[_0xc0d2('0x41')]({},_0x4232c3,_0x5845fe['options']);return _0x5c5b99[_0xc0d2('0x6e')](_0x4232c3);}})[_0xc0d2('0x27')](function(_0x327e39){if(_0x327e39){_0x388071=_0x327e39['length'];if(!_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x3a')]('nolimit')){_0x4232c3['limit']=qs[_0xc0d2('0x1f')](_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x1f')]);_0x4232c3[_0xc0d2('0x21')]=qs[_0xc0d2('0x21')](_0x5845fe[_0xc0d2('0x34')][_0xc0d2('0x21')]);}return _0x5c5b99['getSounds'](_0x4232c3);}})[_0xc0d2('0x27')](function(_0x44af01){if(_0x44af01){return _0x44af01?{'count':_0x388071,'rows':_0x44af01}:null;}})[_0xc0d2('0x27')](respondWithResult(_0xf8235b,null))[_0xc0d2('0x49')](handleError(_0xf8235b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 994e37c..d367bcc 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0058=['moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash','../../config/logger'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x0058,0x116));var _0x8005=function(_0x470a7f,_0xb34b8a){_0x470a7f=_0x470a7f-0x0;var _0x1ffd8a=_0x0058[_0x470a7f];return _0x1ffd8a;};'use strict';var _=require(_0x8005('0x0'));var util=require('util');var logger=require(_0x8005('0x1'))('api');var moment=require(_0x8005('0x2'));var BPromise=require(_0x8005('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8005('0x4'));var rimraf=require(_0x8005('0x5'));var config=require(_0x8005('0x6'));var attributes=require(_0x8005('0x7'));module['exports']=function(_0x11c8cf,_0x180787){return _0x11c8cf[_0x8005('0x8')](_0x8005('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02f6=['request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','bluebird'];(function(_0x4734d8,_0x479950){var _0x3b1120=function(_0x4a5d1c){while(--_0x4a5d1c){_0x4734d8['push'](_0x4734d8['shift']());}};_0x3b1120(++_0x479950);}(_0x02f6,0xd4));var _0x602f=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x02f6[_0xe2c95e];return _0x42ce6f;};'use strict';var _=require('lodash');var util=require(_0x602f('0x0'));var logger=require(_0x602f('0x1'))(_0x602f('0x2'));var moment=require('moment');var BPromise=require(_0x602f('0x3'));var rp=require(_0x602f('0x4'));var fs=require('fs');var path=require(_0x602f('0x5'));var rimraf=require('rimraf');var config=require(_0x602f('0x6'));var attributes=require(_0x602f('0x7'));module[_0x602f('0x8')]=function(_0x1d2d77,_0x253e5a){return _0x1d2d77[_0x602f('0x9')](_0x602f('0xa'),attributes,{'tableName':_0x602f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 8538abd..53e549e 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x54c0cd,_0x4f609c){var _0xc3a81e=function(_0x1837bf){while(--_0x1837bf){_0x54c0cd['push'](_0x54c0cd['shift']());}};_0xc3a81e(++_0x4f609c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5ed158,_0x402940){var _0x47eedb=function(_0x592ae5){while(--_0x592ae5){_0x5ed158['push'](_0x5ed158['shift']());}};_0x47eedb(++_0x402940);}(_0x70e0,0x17b));var _0x070e=function(_0x3dd3cf,_0x4f549f){_0x3dd3cf=_0x3dd3cf-0x0;var _0x50d2a8=_0x70e0[_0x3dd3cf];return _0x50d2a8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 4dfdba3..7341c44 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2cf=['../../config/environment','./voicePrefix.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addTeams','put','delete','removeAgents','removeTeams','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18ce30,_0x437d06){var _0x4471a3=function(_0x403a4a){while(--_0x403a4a){_0x18ce30['push'](_0x18ce30['shift']());}};_0x4471a3(++_0x437d06);}(_0xf2cf,0xf5));var _0xff2c=function(_0x22eda0,_0x191a0a){_0x22eda0=_0x22eda0-0x0;var _0xa8c959=_0xf2cf[_0x22eda0];return _0xa8c959;};'use strict';var multer=require('multer');var util=require(_0xff2c('0x0'));var path=require(_0xff2c('0x1'));var timeout=require(_0xff2c('0x2'));var express=require('express');var router=express[_0xff2c('0x3')]();var fs_extra=require(_0xff2c('0x4'));var auth=require(_0xff2c('0x5'));var interaction=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var controller=require(_0xff2c('0x8'));router['get']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xa')]);router['get'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xc')]);router[_0xff2c('0xd')](_0xff2c('0xe'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xf')]);router['get'](_0xff2c('0x10'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x11')]);router['get'](_0xff2c('0x12'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xff2c('0x14')]);router[_0xff2c('0x15')]('/:id/users',auth[_0xff2c('0x9')](),controller['addAgents']);router['post'](_0xff2c('0x12'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x16')]);router[_0xff2c('0x17')]('/:id',auth[_0xff2c('0x9')](),controller['update']);router[_0xff2c('0x18')](_0xff2c('0xe'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xff2c('0x10'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x19')]);router[_0xff2c('0x18')](_0xff2c('0x12'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x1a')]);module[_0xff2c('0x1b')]=router; \ No newline at end of file +var _0x72bd=['multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/users','getAgents','getTeams','post','create','/:id/teams','update','destroy','removeAgents','delete'];(function(_0x2b59ba,_0x924d9){var _0x501dee=function(_0x377106){while(--_0x377106){_0x2b59ba['push'](_0x2b59ba['shift']());}};_0x501dee(++_0x924d9);}(_0x72bd,0xcf));var _0xd72b=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x72bd[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0xd72b('0x0'));var util=require('util');var path=require(_0xd72b('0x1'));var timeout=require(_0xd72b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd72b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd72b('0x4'));var config=require(_0xd72b('0x5'));var controller=require(_0xd72b('0x6'));router['get']('/',auth[_0xd72b('0x7')](),controller[_0xd72b('0x8')]);router[_0xd72b('0x9')](_0xd72b('0xa'),auth[_0xd72b('0x7')](),controller[_0xd72b('0xb')]);router[_0xd72b('0x9')](_0xd72b('0xc'),auth[_0xd72b('0x7')](),controller['show']);router['get'](_0xd72b('0xd'),auth[_0xd72b('0x7')](),controller[_0xd72b('0xe')]);router[_0xd72b('0x9')]('/:id/teams',auth[_0xd72b('0x7')](),controller[_0xd72b('0xf')]);router[_0xd72b('0x10')]('/',auth[_0xd72b('0x7')](),controller[_0xd72b('0x11')]);router[_0xd72b('0x10')]('/:id/users',auth[_0xd72b('0x7')](),controller['addAgents']);router[_0xd72b('0x10')](_0xd72b('0x12'),auth['isAuthenticated'](),controller['addTeams']);router['put'](_0xd72b('0xc'),auth['isAuthenticated'](),controller[_0xd72b('0x13')]);router['delete'](_0xd72b('0xc'),auth[_0xd72b('0x7')](),controller[_0xd72b('0x14')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xd72b('0x15')]);router[_0xd72b('0x16')](_0xd72b('0x12'),auth[_0xd72b('0x7')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b625305..c326d82 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9b=['STRING','name','VIRTUAL','getDataValue','INTEGER','sequelize','exports'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0xac9b,0x139));var _0xbac9=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0xac9b[_0x2e9187];return _0x1fc3a8;};'use strict';var Sequelize=require(_0xbac9('0x0'));module[_0xbac9('0x1')]={'name':{'type':Sequelize[_0xbac9('0x2')],'allowNull':![],'unique':_0xbac9('0x3')},'prefix':{'type':Sequelize[_0xbac9('0x4')],'get':function(_0x669e8a){return'system-'+this[_0xbac9('0x5')](_0xbac9('0x3'))+'-';}},'description':{'type':Sequelize[_0xbac9('0x2')]},'callerIdAll':{'type':Sequelize[_0xbac9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xbac9('0x6')]}}; \ No newline at end of file +var _0xdfb1=['system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x4072a3,_0x33d2d6){var _0x4e06b5=function(_0x1184a6){while(--_0x1184a6){_0x4072a3['push'](_0x4072a3['shift']());}};_0x4e06b5(++_0x33d2d6);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2419b7,_0x603cef){_0x2419b7=_0x2419b7-0x0;var _0x5c915f=_0xdfb1[_0x2419b7];return _0x5c915f;};'use strict';var Sequelize=require(_0x1dfb('0x0'));module[_0x1dfb('0x1')]={'name':{'type':Sequelize[_0x1dfb('0x2')],'allowNull':![],'unique':_0x1dfb('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3bb876){return _0x1dfb('0x4')+this[_0x1dfb('0x5')](_0x1dfb('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9606a10..6f7a1c9 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b12=['QueryTypes','SELECT','TeamId','includes','all','union','compact','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','context','from-sip','exten','app','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','merge','getTeams','Team','User','online','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b12,0xa3));var _0x25b1=function(_0x7ea37c,_0x68e55b){_0x7ea37c=_0x7ea37c-0x0;var _0x3b3a0b=_0x5b12[_0x7ea37c];return _0x3b3a0b;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];config[_0x25b1('0x19')]=_[_0x25b1('0x1a')](config[_0x25b1('0x19')],{'host':_0x25b1('0x1b'),'port':0x18eb});var socket=require(_0x25b1('0x1c'))(new Redis(config[_0x25b1('0x19')]));require(_0x25b1('0x1d'))['register'](socket);function respondWithStatusCode(_0x2c337a,_0x2559a1){_0x2559a1=_0x2559a1||0xcc;return function(_0x4de13f){if(_0x4de13f){return _0x2c337a[_0x25b1('0x1e')](_0x2559a1);}return _0x2c337a[_0x25b1('0x1f')](_0x2559a1)[_0x25b1('0x20')]();};}function respondWithResult(_0x4a5a58,_0x593165){_0x593165=_0x593165||0xc8;return function(_0x7b50ab){if(_0x7b50ab){return _0x4a5a58['status'](_0x593165)[_0x25b1('0x21')](_0x7b50ab);}};}function respondWithFilteredResult(_0x2ca567,_0x1be2d8){return function(_0x27ccc9){if(_0x27ccc9){var _0x1f78c2=typeof _0x1be2d8[_0x25b1('0x22')]===_0x25b1('0x23')&&typeof _0x1be2d8[_0x25b1('0x24')]==='undefined';var _0x4ecff1=_0x27ccc9[_0x25b1('0x25')];var _0x501dc8=_0x1f78c2?0x0:_0x1be2d8[_0x25b1('0x22')];var _0x50ae0f=_0x1f78c2?_0x27ccc9[_0x25b1('0x25')]:_0x1be2d8['offset']+_0x1be2d8[_0x25b1('0x24')];var _0x529310;if(_0x50ae0f>=_0x4ecff1){_0x50ae0f=_0x4ecff1;_0x529310=0xc8;}else{_0x529310=0xce;}_0x2ca567[_0x25b1('0x1f')](_0x529310);return _0x2ca567['set']('Content-Range',_0x501dc8+'-'+_0x50ae0f+'/'+_0x4ecff1)['json'](_0x27ccc9);}return null;};}function patchUpdates(_0x3bca9f){return function(_0x150436){try{jsonpatch['apply'](_0x150436,_0x3bca9f,!![]);}catch(_0x19bab8){return BPromise[_0x25b1('0x26')](_0x19bab8);}return _0x150436[_0x25b1('0x27')]();};}function saveUpdates(_0x246acd,_0x1aabbb){return function(_0x5e6b6b){if(_0x5e6b6b){return _0x5e6b6b[_0x25b1('0x28')](_0x246acd)[_0x25b1('0x29')](function(_0xd22469){return _0xd22469;});}return null;};}function removeEntity(_0x282187,_0x1f37ed){return function(_0x1292bf){if(_0x1292bf){return _0x1292bf['destroy']()[_0x25b1('0x29')](function(){var _0x27dd68=_0x1292bf[_0x25b1('0x2a')]({'plain':!![]});var _0x5bc8fc=_0x25b1('0x2b');return db[_0x25b1('0x2c')][_0x25b1('0x2d')]({'where':{'type':_0x5bc8fc,'resourceId':_0x27dd68['id']}})['then'](function(){return _0x1292bf;});})[_0x25b1('0x29')](function(){_0x282187['status'](0xcc)[_0x25b1('0x20')]();});}};}function handleEntityNotFound(_0x3febb8,_0x3a4475){return function(_0x293413){if(!_0x293413){_0x3febb8[_0x25b1('0x1e')](0x194);}return _0x293413;};}function handleError(_0x300a14,_0x46e429){_0x46e429=_0x46e429||0x1f4;return function(_0x4cd825){logger[_0x25b1('0x2e')](_0x4cd825[_0x25b1('0x2f')]);if(_0x4cd825[_0x25b1('0x30')]){delete _0x4cd825[_0x25b1('0x30')];}_0x300a14[_0x25b1('0x1f')](_0x46e429)['send'](_0x4cd825);};}exports[_0x25b1('0x31')]=function(_0x548dd0,_0x42441d){var _0x1622e8={},_0x1e1796={},_0x5a4234={'count':0x0,'rows':[]};var _0x5cbde5=_[_0x25b1('0x32')](db['VoicePrefix'][_0x25b1('0x33')],function(_0x391713){return{'name':_0x391713[_0x25b1('0x34')],'type':_0x391713['type']['key']};});_0x1e1796[_0x25b1('0x35')]=_[_0x25b1('0x32')](_0x5cbde5,_0x25b1('0x30'));_0x1e1796['query']=_[_0x25b1('0x36')](_0x548dd0[_0x25b1('0x37')]);_0x1e1796[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x1e1796['model'],_0x1e1796[_0x25b1('0x37')]);_0x1622e8[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1e1796['model'],qs['fields'](_0x548dd0[_0x25b1('0x37')]['fields']));_0x1622e8[_0x25b1('0x3a')]=_0x1622e8[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x1622e8[_0x25b1('0x3a')]:_0x1e1796[_0x25b1('0x35')];if(!_0x548dd0[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x1622e8[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x548dd0[_0x25b1('0x37')][_0x25b1('0x24')]);_0x1622e8[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x548dd0[_0x25b1('0x37')]['offset']);}_0x1622e8[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x548dd0['query'][_0x25b1('0x3f')]);_0x1622e8[_0x25b1('0x40')]=qs[_0x25b1('0x38')](_[_0x25b1('0x41')](_0x548dd0[_0x25b1('0x37')],_0x1e1796['filters']),_0x5cbde5);if(_0x548dd0[_0x25b1('0x37')]['filter']){_0x1622e8[_0x25b1('0x40')]=_['merge'](_0x1622e8[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x5cbde5,function(_0x1b354e){if(_0x1b354e[_0x25b1('0x42')]!==_0x25b1('0x43')){var _0x45713f={};_0x45713f[_0x1b354e[_0x25b1('0x30')]]={'$like':'%'+_0x548dd0[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x45713f;}})});}_0x1622e8=_['merge']({},_0x1622e8,_0x548dd0[_0x25b1('0x45')]);var _0x585c37={'where':_0x1622e8[_0x25b1('0x40')]};return db[_0x25b1('0x46')]['count'](_0x585c37)[_0x25b1('0x29')](function(_0x39b4c7){_0x5a4234[_0x25b1('0x25')]=_0x39b4c7;if(_0x548dd0[_0x25b1('0x37')][_0x25b1('0x47')]){_0x1622e8[_0x25b1('0x48')]=[{'all':!![]}];}return db[_0x25b1('0x46')][_0x25b1('0x49')](_0x1622e8);})[_0x25b1('0x29')](function(_0x453352){_0x5a4234[_0x25b1('0x4a')]=_0x453352;return _0x5a4234;})[_0x25b1('0x29')](respondWithFilteredResult(_0x42441d,_0x1622e8))[_0x25b1('0x4b')](handleError(_0x42441d,null));};exports[_0x25b1('0x4c')]=function(_0x21242a,_0x210cef){var _0x103953={'raw':![],'where':{'id':_0x21242a['params']['id']}},_0x210a13={};_0x210a13['model']=_['keys'](db[_0x25b1('0x46')]['rawAttributes']);_0x210a13[_0x25b1('0x37')]=_['keys'](_0x21242a[_0x25b1('0x37')]);_0x210a13[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x210a13[_0x25b1('0x35')],_0x210a13[_0x25b1('0x37')]);_0x103953[_0x25b1('0x3a')]=_['intersection'](_0x210a13[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x21242a[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x103953['attributes']=_0x103953[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x103953[_0x25b1('0x3a')]:_0x210a13['model'];if(_0x21242a[_0x25b1('0x37')]['includeAll']){_0x103953[_0x25b1('0x48')]=[{'all':!![]}];}_0x103953=_['merge']({},_0x103953,_0x21242a['options']);return db[_0x25b1('0x46')][_0x25b1('0x4e')](_0x103953)[_0x25b1('0x29')](handleEntityNotFound(_0x210cef,null))[_0x25b1('0x29')](respondWithResult(_0x210cef,null))['catch'](handleError(_0x210cef,null));};exports[_0x25b1('0x2d')]=function(_0x58e612,_0x7c30da){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x58e612[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x7c30da,null))['then'](removeEntity(_0x7c30da,null))[_0x25b1('0x4b')](handleError(_0x7c30da,null));};exports[_0x25b1('0x50')]=function(_0x354294,_0xf38a9e){return db[_0x25b1('0x46')][_0x25b1('0x50')]()['then'](respondWithResult(_0xf38a9e,null))[_0x25b1('0x4b')](handleError(_0xf38a9e,null));};exports[_0x25b1('0x51')]=function(_0x168931,_0x2311da){var _0x5e367;return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x40d574){return db[_0x25b1('0x46')][_0x25b1('0x51')](_0x168931[_0x25b1('0x54')],{'transaction':_0x40d574})[_0x25b1('0x29')](function(_0x4190a1){_0x5e367=_0x4190a1[_0x25b1('0x2a')]({'plain':!![]});return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x5e367[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5732a1){return createVoicePrefixExtensions(_0x5e367,_0x5732a1,_0x40d574);});});})[_0x25b1('0x29')](function(){var _0x16e61e=_0x168931[_0x25b1('0x57')][_0x25b1('0x2a')]({'plain':!![]});if(!_0x16e61e)throw new Error(_0x25b1('0x58'));if(_0x16e61e[_0x25b1('0x59')]==='user'){var _0x105587=_0x5e367;return db[_0x25b1('0x5a')][_0x25b1('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x16e61e[_0x25b1('0x5b')]},'raw':!![]})['then'](function(_0x5bd36b){if(_0x5bd36b&&_0x5bd36b['autoAssociation']===0x0){return db['UserProfileResource'][_0x25b1('0x51')]({'name':_0x105587['name'],'resourceId':_0x105587['id'],'type':_0x5bd36b[_0x25b1('0x30')],'sectionId':_0x5bd36b['id']},{})[_0x25b1('0x29')](function(){return _0x5e367;});}else{return _0x5e367;}})[_0x25b1('0x4b')](function(_0x439bab){logger[_0x25b1('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439bab);throw _0x439bab;});}return _0x5e367;})[_0x25b1('0x29')](respondWithResult(_0x2311da,null))[_0x25b1('0x4b')](handleError(_0x2311da,null));};function Extension(_0x37b58d,_0x400ec9,_0x5ecc36,_0xcca343){this[_0x25b1('0x5c')]=_0x25b1('0x5d');this[_0x25b1('0x5e')]=_0x37b58d;this[_0x25b1('0x5f')]=_0x5ecc36;this[_0x25b1('0x42')]='system';this[_0x25b1('0x60')]='Voice\x20Prefix\x20Extension';this[_0x25b1('0x61')]=_0x400ec9;this[_0x25b1('0x62')]=_0xcca343;}function createVoicePrefixExtensions(_0x49052b,_0x42a81f,_0x3d8d33){return new BPromise(function(_0x551bed,_0x1351ea){var _0x303049=new Extension(formatPrefixName(_0x49052b[_0x25b1('0x63')]),0x1,_0x25b1('0x64'),_0x25b1('0x65'));_0x303049[_0x25b1('0x66')]=_0x49052b['id'];return db[_0x25b1('0x55')][_0x25b1('0x51')](_0x303049,{'transaction':_0x3d8d33})['then'](function(_0x6f1b1f){var _0x1e2dcb=_0x6f1b1f[_0x25b1('0x2a')]({'plain':!![]});var _0x1da588=_[_0x25b1('0x32')](addVoicePrefixExtensions(_0x49052b,_0x42a81f),function(_0x2b9223){_0x2b9223[_0x25b1('0x56')]=_0x1e2dcb['id'];_0x2b9223[_0x25b1('0x66')]=_0x49052b['id'];return _0x2b9223;});return db['VoiceExtension'][_0x25b1('0x67')](_0x1da588,{'transaction':_0x3d8d33})[_0x25b1('0x29')](function(_0x51f922){if(!_0x51f922){return _0x1351ea(_0x25b1('0x68'));}else{return _0x551bed(_0x51f922);}})[_0x25b1('0x4b')](function(_0x5b71e5){return _0x1351ea(_0x5b71e5);});});;});};function addVoicePrefixExtensions(_0x26e90c,_0x498aca){var _0x44aa87=[];var _0x4e62b5=formatPrefixName(_0x26e90c[_0x25b1('0x63')]);_0x44aa87['push'](new Extension(_0x4e62b5,0x2,_0x25b1('0x69'),_0x25b1('0x6a')+_0x26e90c[_0x25b1('0x30')]));if(_0x26e90c['callerIdAll']){_0x44aa87['push'](new Extension(_0x4e62b5,0x3,_0x25b1('0x69'),_0x25b1('0x6b')+_0x26e90c[_0x25b1('0x6c')]));}else{_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x3,_0x25b1('0x64'),_0x25b1('0x6e')));}_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x4,_0x25b1('0x6f'),_0x498aca[_0x25b1('0x5c')]+','+_0x25b1('0x70')+(0x8+_0x26e90c[_0x25b1('0x30')][_0x25b1('0x3b')])+'}'+','+0x1));return _0x44aa87;}function formatPrefixName(_0x3d06ab){var _0x975b85='_';for(var _0x1c22c4=0x0;_0x1c22c4<_0x3d06ab[_0x25b1('0x3b')];_0x1c22c4++){if(_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)=='-'){_0x975b85+=_0x3d06ab[_0x25b1('0x71')](_0x1c22c4);}else{_0x975b85+='['+_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)+']';}}_0x975b85+='.';return _0x975b85;}exports[_0x25b1('0x28')]=function(_0x15272b,_0x2fe4a5,_0x584499){var _0x1a3368=_0x15272b['body'];_0x1a3368[_0x25b1('0x63')]=_0x25b1('0x72')+_0x1a3368[_0x25b1('0x30')]+'-';return db['sequelize']['transaction'](function(_0x3f9ca7){return db[_0x25b1('0x46')]['update'](_0x1a3368,{'where':{'id':_0x1a3368['id']},'transaction':_0x3f9ca7})[_0x25b1('0x29')](function(){return db[_0x25b1('0x55')][_0x25b1('0x2d')]({'where':{'VoicePrefixId':_0x1a3368['id']},'transaction':_0x3f9ca7})['then'](function(){return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x1a3368[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5f1fef){return createVoicePrefixExtensions(_0x1a3368,_0x5f1fef,_0x3f9ca7);});});});})[_0x25b1('0x29')](function(){return db[_0x25b1('0x46')][_0x25b1('0x73')](_0x1a3368['id']);})[_0x25b1('0x29')](respondWithResult(_0x2fe4a5,null))[_0x25b1('0x4b')](handleError(_0x2fe4a5,null));};exports[_0x25b1('0x74')]=function(_0x4a9fbf,_0x40400e,_0x3f77e0){return db['VoicePrefix']['find']({'where':{'id':_0x4a9fbf[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x40400e,null))[_0x25b1('0x29')](function(_0x3ff99d){if(_0x3ff99d){return _0x3ff99d[_0x25b1('0x74')](_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')],_['omit'](_0x4a9fbf[_0x25b1('0x54')],[_0x25b1('0x75'),'id'])||{})[_0x25b1('0x76')](function(_0x49fac2){for(var _0x1bbb9b=0x0;_0x1bbb9b<_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')]['length'];_0x1bbb9b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x78'),{'UserId':Number(_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')][_0x1bbb9b]),'VoicePrefixId':Number(_0x4a9fbf[_0x25b1('0x4f')]['id'])});}return _0x49fac2;});}})[_0x25b1('0x29')](respondWithResult(_0x40400e,null))[_0x25b1('0x4b')](handleError(_0x40400e,null));};exports[_0x25b1('0x79')]=function(_0x1a07cb,_0x18021f,_0x20b43f){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x1a07cb[_0x25b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18021f,null))[_0x25b1('0x29')](function(_0x45804b){if(_0x45804b){return _0x45804b[_0x25b1('0x79')](_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')])['then'](function(){if(_['isArray'](_0x1a07cb[_0x25b1('0x37')]['ids'])){for(var _0x3e7f2b=0x0;_0x3e7f2b<_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')][_0x25b1('0x3b')];_0x3e7f2b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query'][_0x25b1('0x75')][_0x3e7f2b]),'VoicePrefixId':Number(_0x1a07cb[_0x25b1('0x4f')]['id'])});}}else{socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query']['ids']),'VoicePrefixId':Number(_0x1a07cb['params']['id'])});}});}})[_0x25b1('0x29')](respondWithStatusCode(_0x18021f,null))[_0x25b1('0x4b')](handleError(_0x18021f,null));};exports['getAgents']=function(_0x49c2d3,_0x271837,_0x102b85){var _0x6bbd44={};var _0x67a4b7={};var _0x54e1a6;var _0x10409f;return db[_0x25b1('0x46')][_0x25b1('0x7b')]({'where':{'id':_0x49c2d3[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x271837,null))[_0x25b1('0x29')](function(_0x175c72){if(_0x175c72){_0x54e1a6=_0x175c72;_0x67a4b7[_0x25b1('0x35')]=_['keys'](db['User'][_0x25b1('0x33')]);_0x67a4b7[_0x25b1('0x37')]=_['keys'](_0x49c2d3['query']);_0x67a4b7[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x67a4b7['model'],_0x67a4b7[_0x25b1('0x37')]);_0x6bbd44[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x67a4b7[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x6bbd44['attributes']=_0x6bbd44[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x6bbd44[_0x25b1('0x3a')]:_0x67a4b7['model'];_0x6bbd44['order']=qs['sort'](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x6bbd44[_0x25b1('0x40')]=qs['filters'](_['pick'](_0x49c2d3[_0x25b1('0x37')],_0x67a4b7[_0x25b1('0x38')]));if(_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x44')]){_0x6bbd44[_0x25b1('0x40')]=_[_0x25b1('0x7c')](_0x6bbd44[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x6bbd44[_0x25b1('0x3a')],function(_0x4c74f8){var _0xb7494b={};_0xb7494b[_0x4c74f8]={'$like':'%'+_0x49c2d3[_0x25b1('0x37')]['filter']+'%'};return _0xb7494b;})});}_0x6bbd44=_['merge']({},_0x6bbd44,_0x49c2d3[_0x25b1('0x45')]);return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x133a5d){if(_0x133a5d){_0x10409f=_0x133a5d[_0x25b1('0x3b')];if(!_0x49c2d3['query']['hasOwnProperty']('nolimit')){_0x6bbd44[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x49c2d3['query'][_0x25b1('0x24')]);_0x6bbd44[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x22')]);}return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x954de5){if(_0x954de5){return _0x954de5?{'count':_0x10409f,'rows':_0x954de5}:null;}})['then'](respondWithResult(_0x271837,null))[_0x25b1('0x4b')](handleError(_0x271837,null));};exports['getTeams']=function(_0x198561,_0x4c2b9f,_0x5c7849){var _0x92b5d6={};var _0x1958c0={};var _0x4428d2;var _0x12e63d;return db[_0x25b1('0x46')]['findOne']({'where':{'id':_0x198561['params']['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x4c2b9f,null))['then'](function(_0x2890c1){if(_0x2890c1){_0x4428d2=_0x2890c1;_0x1958c0[_0x25b1('0x35')]=_[_0x25b1('0x36')](db['Team'][_0x25b1('0x33')]);_0x1958c0['query']=_['keys'](_0x198561['query']);_0x1958c0[_0x25b1('0x38')]=_['intersection'](_0x1958c0[_0x25b1('0x35')],_0x1958c0[_0x25b1('0x37')]);_0x92b5d6[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1958c0[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x198561[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x92b5d6[_0x25b1('0x3a')]=_0x92b5d6[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x92b5d6[_0x25b1('0x3a')]:_0x1958c0[_0x25b1('0x35')];_0x92b5d6[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x198561[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x92b5d6['where']=qs[_0x25b1('0x38')](_['pick'](_0x198561[_0x25b1('0x37')],_0x1958c0[_0x25b1('0x38')]));if(_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]){_0x92b5d6[_0x25b1('0x40')]=_['merge'](_0x92b5d6[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x92b5d6[_0x25b1('0x3a')],function(_0x5af2b6){var _0x339e82={};_0x339e82[_0x5af2b6]={'$like':'%'+_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x339e82;})});}_0x92b5d6=_[_0x25b1('0x7c')]({},_0x92b5d6,_0x198561['options']);return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x270f00){if(_0x270f00){_0x12e63d=_0x270f00['length'];if(!_0x198561[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x92b5d6['limit']=qs[_0x25b1('0x24')](_0x198561[_0x25b1('0x37')]['limit']);_0x92b5d6[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x198561['query'][_0x25b1('0x22')]);}return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x14b909){if(_0x14b909){return _0x14b909?{'count':_0x12e63d,'rows':_0x14b909}:null;}})[_0x25b1('0x29')](respondWithResult(_0x4c2b9f,null))[_0x25b1('0x4b')](handleError(_0x4c2b9f,null));};exports['addTeams']=function(_0x3496a9,_0x30f1e9,_0x18211a){var _0x3038be=_0x3496a9[_0x25b1('0x54')][_0x25b1('0x75')];var _0x310a32;return db[_0x25b1('0x7e')][_0x25b1('0x49')]({'where':{'id':_0x3038be},'attributes':['id'],'include':[{'model':db[_0x25b1('0x7f')],'as':'Agents','attributes':['id',_0x25b1('0x30'),_0x25b1('0x80'),'voicePause','interface'],'raw':!![]}]})[_0x25b1('0x29')](function(_0x96a1b0){if(_0x96a1b0){_0x310a32=_0x96a1b0;var _0x2db4a9=_[_0x25b1('0x81')](_0x96a1b0,function(_0x58e166){var _0x4c6181=_0x58e166['get']({'plain':!![]});return _0x4c6181[_0x25b1('0x82')];});return db[_0x25b1('0x46')][_0x25b1('0x4e')]({'where':{'id':_0x3496a9['params']['id']}})['then'](function(_0x16702d){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x55f740){return _0x16702d[_0x25b1('0x83')](_0x3038be,{'transaction':_0x55f740})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x310a32,function(_0x2da0d9){return db[_0x25b1('0x85')][_0x25b1('0x86')]({'TeamId':_0x2da0d9['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},{'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x2db4a9,function(_0x5c515b){return db[_0x25b1('0x87')][_0x25b1('0x88')]({'where':{'UserId':_0x5c515b['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){_0x2db4a9[_0x25b1('0x89')](function(_0x3c8c4e){socket[_0x25b1('0x77')]('userVoicePrefix:save',{'UserId':_0x3c8c4e['id'],'VoicePrefixId':_0x16702d['id']});});});});});}})[_0x25b1('0x29')](respondWithStatusCode(_0x30f1e9,null))['catch'](handleError(_0x30f1e9,null));};exports[_0x25b1('0x8a')]=function(_0x469405,_0x1010c4,_0x22d3e4){return db['Team']['findAll']({'where':{'id':_0x469405[_0x25b1('0x37')][_0x25b1('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1010c4,null))[_0x25b1('0x29')](function(_0xd05872){var _0x25c07f=_[_0x25b1('0x32')](_0xd05872,'id');var _0x1041d1=[];var _0x1f1160=[];var _0x29d8fe=squel[_0x25b1('0x8b')]();_0x29d8fe[_0x25b1('0x8c')](_0x25b1('0x8d'))[_0x25b1('0x8e')](_0x25b1('0x8f'),'tq')['join'](_0x25b1('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x25b1('0x40')](_0x25b1('0x91'),_0x469405[_0x25b1('0x4f')]['id']);for(var _0x1354c3=0x0;_0x1354c3<_0xd05872[_0x25b1('0x3b')];_0x1354c3+=0x1){let _0x3ccdab=_0xd05872[_0x1354c3];for(var _0x381a62=0x0;_0x381a62<_0x3ccdab[_0x25b1('0x82')]['length'];_0x381a62+=0x1){let _0x330ae7=_0x3ccdab[_0x25b1('0x82')][_0x381a62];var _0xbe6572=_0x29d8fe[_0x25b1('0x92')]();_0xbe6572[_0x25b1('0x40')](_0x25b1('0x93'),_0x330ae7['id']);_0x1f1160[_0x25b1('0x6d')](db['sequelize'][_0x25b1('0x37')](_0xbe6572[_0x25b1('0x94')](),{'type':db[_0x25b1('0x52')][_0x25b1('0x95')][_0x25b1('0x96')]})['then'](function(_0x4edb48){if(_0x4edb48[_0x25b1('0x3b')]===0x1){return _0x330ae7['id'];}else{var _0x2e924b=_['every'](_['map'](_0x4edb48,_0x25b1('0x97')),function(_0x16d969){return _[_0x25b1('0x98')](_0x25c07f,_0x16d969);});if(_0x2e924b){return _0x330ae7['id'];}}}));}}return BPromise[_0x25b1('0x99')](_0x1f1160)[_0x25b1('0x29')](function(_0x3128bd){_0x1041d1=_(_0x1041d1)[_0x25b1('0x9a')](_0x3128bd)[_0x25b1('0x9b')]()['value']();return db[_0x25b1('0x46')]['find']({'where':{'id':_0x469405['params']['id']}})[_0x25b1('0x29')](function(_0x4cf3e6){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x2c0147){return _0x4cf3e6[_0x25b1('0x8a')](_0x469405[_0x25b1('0x37')][_0x25b1('0x75')],{'transaction':_0x2c0147})[_0x25b1('0x29')](function(){if(!_['isEmpty'](_0x1041d1)){return _0x4cf3e6[_0x25b1('0x79')](_0x1041d1,{'transaction':_0x2c0147});}})[_0x25b1('0x29')](function(){_0x1041d1[_0x25b1('0x89')](function(_0x220f92){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':_0x220f92,'VoicePrefixId':_0x4cf3e6['id']});});});});});});})[_0x25b1('0x29')](respondWithStatusCode(_0x1010c4,null))[_0x25b1('0x4b')](handleError(_0x1010c4,null));}; \ No newline at end of file +var _0x896e=['userVoicePrefix:save','removeTeams','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','isEmpty','forEach','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','index','VoicePrefix','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','destroy','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','params','addAgents','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','order','hasOwnProperty','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate'];(function(_0x4b94c8,_0x19e64a){var _0x3205ba=function(_0x7d0b6a){while(--_0x7d0b6a){_0x4b94c8['push'](_0x4b94c8['shift']());}};_0x3205ba(++_0x19e64a);}(_0x896e,0x1e9));var _0xe896=function(_0x267b6a,_0x192297){_0x267b6a=_0x267b6a-0x0;var _0x178400=_0x896e[_0x267b6a];return _0x178400;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];config[_0xe896('0x1a')]=_['defaults'](config[_0xe896('0x1a')],{'host':_0xe896('0x1b'),'port':0x18eb});var socket=require(_0xe896('0x1c'))(new Redis(config['redis']));require(_0xe896('0x1d'))[_0xe896('0x1e')](socket);function respondWithStatusCode(_0x1e7ef8,_0x564758){_0x564758=_0x564758||0xcc;return function(_0x5a7957){if(_0x5a7957){return _0x1e7ef8[_0xe896('0x1f')](_0x564758);}return _0x1e7ef8[_0xe896('0x20')](_0x564758)['end']();};}function respondWithResult(_0x5e78d6,_0x11f41c){_0x11f41c=_0x11f41c||0xc8;return function(_0x16e272){if(_0x16e272){return _0x5e78d6['status'](_0x11f41c)[_0xe896('0x21')](_0x16e272);}};}function respondWithFilteredResult(_0x4e062a,_0x41cbd7){return function(_0x32f86d){if(_0x32f86d){var _0x2d4cf0=typeof _0x41cbd7['offset']===_0xe896('0x22')&&typeof _0x41cbd7[_0xe896('0x23')]===_0xe896('0x22');var _0xbebbe1=_0x32f86d[_0xe896('0x24')];var _0x3ac8b8=_0x2d4cf0?0x0:_0x41cbd7[_0xe896('0x25')];var _0x32d3d3=_0x2d4cf0?_0x32f86d['count']:_0x41cbd7[_0xe896('0x25')]+_0x41cbd7['limit'];var _0x5d2c8d;if(_0x32d3d3>=_0xbebbe1){_0x32d3d3=_0xbebbe1;_0x5d2c8d=0xc8;}else{_0x5d2c8d=0xce;}_0x4e062a[_0xe896('0x20')](_0x5d2c8d);return _0x4e062a[_0xe896('0x26')](_0xe896('0x27'),_0x3ac8b8+'-'+_0x32d3d3+'/'+_0xbebbe1)[_0xe896('0x21')](_0x32f86d);}return null;};}function patchUpdates(_0x498469){return function(_0x468479){try{jsonpatch['apply'](_0x468479,_0x498469,!![]);}catch(_0x5001f7){return BPromise[_0xe896('0x28')](_0x5001f7);}return _0x468479[_0xe896('0x29')]();};}function saveUpdates(_0x1e952a,_0x2e2c10){return function(_0x20e295){if(_0x20e295){return _0x20e295[_0xe896('0x2a')](_0x1e952a)[_0xe896('0x2b')](function(_0x4b71cc){return _0x4b71cc;});}return null;};}function removeEntity(_0x390128,_0x163a75){return function(_0xc3cd05){if(_0xc3cd05){return _0xc3cd05['destroy']()[_0xe896('0x2b')](function(){var _0xd50fe2=_0xc3cd05[_0xe896('0x2c')]({'plain':!![]});var _0xe93aa0=_0xe896('0x2d');return db[_0xe896('0x2e')]['destroy']({'where':{'type':_0xe93aa0,'resourceId':_0xd50fe2['id']}})[_0xe896('0x2b')](function(){return _0xc3cd05;});})[_0xe896('0x2b')](function(){_0x390128[_0xe896('0x20')](0xcc)[_0xe896('0x2f')]();});}};}function handleEntityNotFound(_0xace03f,_0x5e0d9b){return function(_0x47c268){if(!_0x47c268){_0xace03f['sendStatus'](0x194);}return _0x47c268;};}function handleError(_0x504d7c,_0x562ddd){_0x562ddd=_0x562ddd||0x1f4;return function(_0x291290){logger[_0xe896('0x30')](_0x291290[_0xe896('0x31')]);if(_0x291290[_0xe896('0x32')]){delete _0x291290[_0xe896('0x32')];}_0x504d7c[_0xe896('0x20')](_0x562ddd)[_0xe896('0x33')](_0x291290);};}exports[_0xe896('0x34')]=function(_0x4ab96b,_0x4ce052){var _0x142d29={},_0x255dd1={},_0x29be89={'count':0x0,'rows':[]};var _0x76c0c3=_['map'](db[_0xe896('0x35')]['rawAttributes'],function(_0x57c6e8){return{'name':_0x57c6e8[_0xe896('0x36')],'type':_0x57c6e8[_0xe896('0x37')][_0xe896('0x38')]};});_0x255dd1['model']=_['map'](_0x76c0c3,'name');_0x255dd1[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x4ab96b[_0xe896('0x39')]);_0x255dd1[_0xe896('0x3b')]=_[_0xe896('0x3c')](_0x255dd1['model'],_0x255dd1[_0xe896('0x39')]);_0x142d29[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x255dd1[_0xe896('0x3e')],qs[_0xe896('0x3f')](_0x4ab96b[_0xe896('0x39')][_0xe896('0x3f')]));_0x142d29[_0xe896('0x3d')]=_0x142d29['attributes'][_0xe896('0x40')]?_0x142d29[_0xe896('0x3d')]:_0x255dd1['model'];if(!_0x4ab96b[_0xe896('0x39')]['hasOwnProperty'](_0xe896('0x41'))){_0x142d29['limit']=qs[_0xe896('0x23')](_0x4ab96b['query'][_0xe896('0x23')]);_0x142d29[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x4ab96b[_0xe896('0x39')][_0xe896('0x25')]);}_0x142d29['order']=qs['sort'](_0x4ab96b[_0xe896('0x39')][_0xe896('0x42')]);_0x142d29[_0xe896('0x43')]=qs[_0xe896('0x3b')](_[_0xe896('0x44')](_0x4ab96b['query'],_0x255dd1['filters']),_0x76c0c3);if(_0x4ab96b[_0xe896('0x39')][_0xe896('0x45')]){_0x142d29['where']=_['merge'](_0x142d29[_0xe896('0x43')],{'$or':_[_0xe896('0x46')](_0x76c0c3,function(_0x911adb){if(_0x911adb[_0xe896('0x37')]!==_0xe896('0x47')){var _0x41fa6f={};_0x41fa6f[_0x911adb[_0xe896('0x32')]]={'$like':'%'+_0x4ab96b[_0xe896('0x39')][_0xe896('0x45')]+'%'};return _0x41fa6f;}})});}_0x142d29=_[_0xe896('0x48')]({},_0x142d29,_0x4ab96b[_0xe896('0x49')]);var _0x1bc76a={'where':_0x142d29['where']};return db[_0xe896('0x35')][_0xe896('0x24')](_0x1bc76a)['then'](function(_0x57366b){_0x29be89['count']=_0x57366b;if(_0x4ab96b[_0xe896('0x39')][_0xe896('0x4a')]){_0x142d29[_0xe896('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0xe896('0x4c')](_0x142d29);})[_0xe896('0x2b')](function(_0x55a8ba){_0x29be89['rows']=_0x55a8ba;return _0x29be89;})['then'](respondWithFilteredResult(_0x4ce052,_0x142d29))[_0xe896('0x4d')](handleError(_0x4ce052,null));};exports[_0xe896('0x4e')]=function(_0x16927a,_0x402aef){var _0x4452aa={'raw':![],'where':{'id':_0x16927a['params']['id']}},_0x2ae833={};_0x2ae833[_0xe896('0x3e')]=_[_0xe896('0x3a')](db['VoicePrefix'][_0xe896('0x4f')]);_0x2ae833[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x16927a[_0xe896('0x39')]);_0x2ae833['filters']=_[_0xe896('0x3c')](_0x2ae833[_0xe896('0x3e')],_0x2ae833[_0xe896('0x39')]);_0x4452aa[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x2ae833[_0xe896('0x3e')],qs['fields'](_0x16927a[_0xe896('0x39')]['fields']));_0x4452aa[_0xe896('0x3d')]=_0x4452aa[_0xe896('0x3d')][_0xe896('0x40')]?_0x4452aa[_0xe896('0x3d')]:_0x2ae833[_0xe896('0x3e')];if(_0x16927a[_0xe896('0x39')]['includeAll']){_0x4452aa[_0xe896('0x4b')]=[{'all':!![]}];}_0x4452aa=_[_0xe896('0x48')]({},_0x4452aa,_0x16927a['options']);return db[_0xe896('0x35')][_0xe896('0x50')](_0x4452aa)['then'](handleEntityNotFound(_0x402aef,null))[_0xe896('0x2b')](respondWithResult(_0x402aef,null))['catch'](handleError(_0x402aef,null));};exports[_0xe896('0x51')]=function(_0xb90690,_0x3fd073){return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0xb90690['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x3fd073,null))[_0xe896('0x2b')](removeEntity(_0x3fd073,null))[_0xe896('0x4d')](handleError(_0x3fd073,null));};exports['describe']=function(_0x2ceae5,_0x5d205b){return db['VoicePrefix'][_0xe896('0x52')]()[_0xe896('0x2b')](respondWithResult(_0x5d205b,null))['catch'](handleError(_0x5d205b,null));};exports[_0xe896('0x53')]=function(_0x3d137b,_0x5bfd1e){var _0x58497a;return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x5b8719){return db[_0xe896('0x35')][_0xe896('0x53')](_0x3d137b[_0xe896('0x56')],{'transaction':_0x5b8719})[_0xe896('0x2b')](function(_0x16d1c8){_0x58497a=_0x16d1c8[_0xe896('0x2c')]({'plain':!![]});return db[_0xe896('0x57')][_0xe896('0x50')]({'where':{'id':_0x58497a[_0xe896('0x58')]},'raw':!![]})[_0xe896('0x2b')](function(_0x357302){return createVoicePrefixExtensions(_0x58497a,_0x357302,_0x5b8719);});});})['then'](function(){var _0x1d7e31=_0x3d137b[_0xe896('0x59')][_0xe896('0x2c')]({'plain':!![]});if(!_0x1d7e31)throw new Error(_0xe896('0x5a'));if(_0x1d7e31[_0xe896('0x5b')]===_0xe896('0x59')){var _0x157946=_0x58497a;return db[_0xe896('0x5c')][_0xe896('0x50')]({'where':{'name':_0xe896('0x2d'),'userProfileId':_0x1d7e31[_0xe896('0x5d')]},'raw':!![]})[_0xe896('0x2b')](function(_0x5d8265){if(_0x5d8265&&_0x5d8265[_0xe896('0x5e')]===0x0){return db[_0xe896('0x2e')][_0xe896('0x53')]({'name':_0x157946['name'],'resourceId':_0x157946['id'],'type':_0x5d8265['name'],'sectionId':_0x5d8265['id']},{})['then'](function(){return _0x58497a;});}else{return _0x58497a;}})[_0xe896('0x4d')](function(_0x29aa11){logger[_0xe896('0x30')](_0xe896('0x5f'),_0x29aa11);throw _0x29aa11;});}return _0x58497a;})['then'](respondWithResult(_0x5bfd1e,null))[_0xe896('0x4d')](handleError(_0x5bfd1e,null));};function Extension(_0x28396c,_0x57ed84,_0x3c893a,_0x5d6c1c){this[_0xe896('0x60')]=_0xe896('0x61');this['exten']=_0x28396c;this[_0xe896('0x62')]=_0x3c893a;this[_0xe896('0x37')]='system';this['description']=_0xe896('0x63');this[_0xe896('0x64')]=_0x57ed84;this[_0xe896('0x65')]=_0x5d6c1c;}function createVoicePrefixExtensions(_0x11291a,_0x2a1858,_0x4e4092){return new BPromise(function(_0xdadb92,_0x3c82d1){var _0x113b00=new Extension(formatPrefixName(_0x11291a[_0xe896('0x66')]),0x1,'NoOp','Voice\x20Prefix');_0x113b00[_0xe896('0x67')]=_0x11291a['id'];return db[_0xe896('0x57')]['create'](_0x113b00,{'transaction':_0x4e4092})[_0xe896('0x2b')](function(_0x4f2d6e){var _0x3ccaad=_0x4f2d6e[_0xe896('0x2c')]({'plain':!![]});var _0xce2b25=_[_0xe896('0x46')](addVoicePrefixExtensions(_0x11291a,_0x2a1858),function(_0x11b001){_0x11b001[_0xe896('0x58')]=_0x3ccaad['id'];_0x11b001[_0xe896('0x67')]=_0x11291a['id'];return _0x11b001;});return db[_0xe896('0x57')][_0xe896('0x68')](_0xce2b25,{'transaction':_0x4e4092})[_0xe896('0x2b')](function(_0xcb329a){if(!_0xcb329a){return _0x3c82d1(_0xe896('0x69'));}else{return _0xdadb92(_0xcb329a);}})[_0xe896('0x4d')](function(_0x14d88e){return _0x3c82d1(_0x14d88e);});});;});};function addVoicePrefixExtensions(_0x468fd7,_0x33bd1b){var _0x404b42=[];var _0x26e75d=formatPrefixName(_0x468fd7[_0xe896('0x66')]);_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x2,_0xe896('0x6b'),_0xe896('0x6c')+_0x468fd7['name']));if(_0x468fd7['callerIdAll']){_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x3,_0xe896('0x6b'),'PREFIX-CALLERIDALL='+_0x468fd7[_0xe896('0x6d')]));}else{_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x3,_0xe896('0x6e'),_0xe896('0x6f')));}_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x4,_0xe896('0x70'),_0x33bd1b[_0xe896('0x60')]+','+_0xe896('0x71')+(0x8+_0x468fd7[_0xe896('0x32')][_0xe896('0x40')])+'}'+','+0x1));return _0x404b42;}function formatPrefixName(_0x1479c8){var _0x4e417a='_';for(var _0x3d299a=0x0;_0x3d299a<_0x1479c8[_0xe896('0x40')];_0x3d299a++){if(_0x1479c8['charAt'](_0x3d299a)=='-'){_0x4e417a+=_0x1479c8[_0xe896('0x72')](_0x3d299a);}else{_0x4e417a+='['+_0x1479c8['charAt'](_0x3d299a)+']';}}_0x4e417a+='.';return _0x4e417a;}exports['update']=function(_0x1f3e10,_0x1bbeeb,_0x4fd476){var _0x56223c=_0x1f3e10[_0xe896('0x56')];_0x56223c['prefix']='system-'+_0x56223c[_0xe896('0x32')]+'-';return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x539f6d){return db[_0xe896('0x35')][_0xe896('0x2a')](_0x56223c,{'where':{'id':_0x56223c['id']},'transaction':_0x539f6d})[_0xe896('0x2b')](function(){return db['VoiceExtension'][_0xe896('0x51')]({'where':{'VoicePrefixId':_0x56223c['id']},'transaction':_0x539f6d})[_0xe896('0x2b')](function(){return db[_0xe896('0x57')][_0xe896('0x50')]({'where':{'id':_0x56223c['VoiceExtensionId']},'raw':!![]})[_0xe896('0x2b')](function(_0x37d951){return createVoicePrefixExtensions(_0x56223c,_0x37d951,_0x539f6d);});});});})[_0xe896('0x2b')](function(){return db[_0xe896('0x35')]['findById'](_0x56223c['id']);})[_0xe896('0x2b')](respondWithResult(_0x1bbeeb,null))[_0xe896('0x4d')](handleError(_0x1bbeeb,null));};exports['addAgents']=function(_0x2d910b,_0x129ff2,_0x35ed8c){return db[_0xe896('0x35')]['find']({'where':{'id':_0x2d910b[_0xe896('0x73')]['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x129ff2,null))[_0xe896('0x2b')](function(_0x1ea3ea){if(_0x1ea3ea){return _0x1ea3ea[_0xe896('0x74')](_0x2d910b[_0xe896('0x56')]['ids'],_['omit'](_0x2d910b['body'],[_0xe896('0x75'),'id'])||{})[_0xe896('0x76')](function(_0x10421d){for(var _0x270121=0x0;_0x270121<_0x2d910b[_0xe896('0x56')][_0xe896('0x75')][_0xe896('0x40')];_0x270121+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x2d910b[_0xe896('0x56')]['ids'][_0x270121]),'VoicePrefixId':Number(_0x2d910b[_0xe896('0x73')]['id'])});}return _0x10421d;});}})['then'](respondWithResult(_0x129ff2,null))[_0xe896('0x4d')](handleError(_0x129ff2,null));};exports['removeAgents']=function(_0x2d2978,_0x36994f,_0x2ffb63){return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0x2d2978['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x36994f,null))[_0xe896('0x2b')](function(_0x690a75){if(_0x690a75){return _0x690a75[_0xe896('0x77')](_0x2d2978[_0xe896('0x39')][_0xe896('0x75')])[_0xe896('0x2b')](function(){if(_['isArray'](_0x2d2978[_0xe896('0x39')]['ids'])){for(var _0x2008a9=0x0;_0x2008a9<_0x2d2978[_0xe896('0x39')][_0xe896('0x75')]['length'];_0x2008a9+=0x1){socket[_0xe896('0x78')](_0xe896('0x79'),{'UserId':Number(_0x2d2978[_0xe896('0x39')][_0xe896('0x75')][_0x2008a9]),'VoicePrefixId':Number(_0x2d2978[_0xe896('0x73')]['id'])});}}else{socket[_0xe896('0x78')](_0xe896('0x79'),{'UserId':Number(_0x2d2978[_0xe896('0x39')][_0xe896('0x75')]),'VoicePrefixId':Number(_0x2d2978[_0xe896('0x73')]['id'])});}});}})[_0xe896('0x2b')](respondWithStatusCode(_0x36994f,null))['catch'](handleError(_0x36994f,null));};exports[_0xe896('0x7a')]=function(_0x317880,_0x3d3a1b,_0x3b0f36){var _0x48885e={};var _0x12f5f6={};var _0x129fe0;var _0x8089;return db[_0xe896('0x35')][_0xe896('0x7b')]({'where':{'id':_0x317880[_0xe896('0x73')]['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x3d3a1b,null))[_0xe896('0x2b')](function(_0x1f37e4){if(_0x1f37e4){_0x129fe0=_0x1f37e4;_0x12f5f6[_0xe896('0x3e')]=_[_0xe896('0x3a')](db[_0xe896('0x7c')]['rawAttributes']);_0x12f5f6[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x317880[_0xe896('0x39')]);_0x12f5f6['filters']=_[_0xe896('0x3c')](_0x12f5f6['model'],_0x12f5f6['query']);_0x48885e[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x12f5f6[_0xe896('0x3e')],qs['fields'](_0x317880[_0xe896('0x39')][_0xe896('0x3f')]));_0x48885e['attributes']=_0x48885e['attributes'][_0xe896('0x40')]?_0x48885e[_0xe896('0x3d')]:_0x12f5f6[_0xe896('0x3e')];_0x48885e[_0xe896('0x7d')]=qs[_0xe896('0x42')](_0x317880[_0xe896('0x39')][_0xe896('0x42')]);_0x48885e['where']=qs['filters'](_[_0xe896('0x44')](_0x317880['query'],_0x12f5f6['filters']));if(_0x317880[_0xe896('0x39')][_0xe896('0x45')]){_0x48885e[_0xe896('0x43')]=_[_0xe896('0x48')](_0x48885e['where'],{'$or':_[_0xe896('0x46')](_0x48885e[_0xe896('0x3d')],function(_0x487d67){var _0x13da47={};_0x13da47[_0x487d67]={'$like':'%'+_0x317880[_0xe896('0x39')][_0xe896('0x45')]+'%'};return _0x13da47;})});}_0x48885e=_[_0xe896('0x48')]({},_0x48885e,_0x317880[_0xe896('0x49')]);return _0x129fe0[_0xe896('0x7a')](_0x48885e);}})[_0xe896('0x2b')](function(_0x1c5812){if(_0x1c5812){_0x8089=_0x1c5812[_0xe896('0x40')];if(!_0x317880[_0xe896('0x39')][_0xe896('0x7e')](_0xe896('0x41'))){_0x48885e[_0xe896('0x23')]=qs['limit'](_0x317880[_0xe896('0x39')][_0xe896('0x23')]);_0x48885e[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x317880[_0xe896('0x39')][_0xe896('0x25')]);}return _0x129fe0[_0xe896('0x7a')](_0x48885e);}})[_0xe896('0x2b')](function(_0x2bf6d5){if(_0x2bf6d5){return _0x2bf6d5?{'count':_0x8089,'rows':_0x2bf6d5}:null;}})[_0xe896('0x2b')](respondWithResult(_0x3d3a1b,null))['catch'](handleError(_0x3d3a1b,null));};exports['getTeams']=function(_0x41e6c4,_0x42c83c,_0x3822cd){var _0x56ee2d={};var _0x100804={};var _0x13b335;var _0x54f5e5;return db[_0xe896('0x35')][_0xe896('0x7b')]({'where':{'id':_0x41e6c4['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x42c83c,null))[_0xe896('0x2b')](function(_0x20cfaf){if(_0x20cfaf){_0x13b335=_0x20cfaf;_0x100804[_0xe896('0x3e')]=_[_0xe896('0x3a')](db[_0xe896('0x7f')][_0xe896('0x4f')]);_0x100804[_0xe896('0x39')]=_['keys'](_0x41e6c4[_0xe896('0x39')]);_0x100804[_0xe896('0x3b')]=_[_0xe896('0x3c')](_0x100804[_0xe896('0x3e')],_0x100804[_0xe896('0x39')]);_0x56ee2d['attributes']=_[_0xe896('0x3c')](_0x100804[_0xe896('0x3e')],qs[_0xe896('0x3f')](_0x41e6c4['query'][_0xe896('0x3f')]));_0x56ee2d[_0xe896('0x3d')]=_0x56ee2d[_0xe896('0x3d')][_0xe896('0x40')]?_0x56ee2d[_0xe896('0x3d')]:_0x100804[_0xe896('0x3e')];_0x56ee2d[_0xe896('0x7d')]=qs[_0xe896('0x42')](_0x41e6c4[_0xe896('0x39')]['sort']);_0x56ee2d[_0xe896('0x43')]=qs['filters'](_[_0xe896('0x44')](_0x41e6c4[_0xe896('0x39')],_0x100804[_0xe896('0x3b')]));if(_0x41e6c4[_0xe896('0x39')]['filter']){_0x56ee2d[_0xe896('0x43')]=_[_0xe896('0x48')](_0x56ee2d['where'],{'$or':_[_0xe896('0x46')](_0x56ee2d[_0xe896('0x3d')],function(_0x474924){var _0x498987={};_0x498987[_0x474924]={'$like':'%'+_0x41e6c4[_0xe896('0x39')]['filter']+'%'};return _0x498987;})});}_0x56ee2d=_['merge']({},_0x56ee2d,_0x41e6c4[_0xe896('0x49')]);return _0x13b335[_0xe896('0x80')](_0x56ee2d);}})['then'](function(_0x1cf246){if(_0x1cf246){_0x54f5e5=_0x1cf246[_0xe896('0x40')];if(!_0x41e6c4['query']['hasOwnProperty']('nolimit')){_0x56ee2d['limit']=qs[_0xe896('0x23')](_0x41e6c4[_0xe896('0x39')][_0xe896('0x23')]);_0x56ee2d[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x41e6c4[_0xe896('0x39')][_0xe896('0x25')]);}return _0x13b335[_0xe896('0x80')](_0x56ee2d);}})['then'](function(_0xd345d8){if(_0xd345d8){return _0xd345d8?{'count':_0x54f5e5,'rows':_0xd345d8}:null;}})[_0xe896('0x2b')](respondWithResult(_0x42c83c,null))[_0xe896('0x4d')](handleError(_0x42c83c,null));};exports[_0xe896('0x81')]=function(_0x5a254b,_0x4f4d26,_0x2f30a9){var _0x33fbb8=_0x5a254b['body']['ids'];var _0x419fc7;return db[_0xe896('0x7f')][_0xe896('0x4c')]({'where':{'id':_0x33fbb8},'attributes':['id'],'include':[{'model':db[_0xe896('0x7c')],'as':_0xe896('0x82'),'attributes':['id','name',_0xe896('0x83'),_0xe896('0x84'),_0xe896('0x85')],'raw':!![]}]})['then'](function(_0x231dcd){if(_0x231dcd){_0x419fc7=_0x231dcd;var _0x219ef1=_[_0xe896('0x86')](_0x231dcd,function(_0xdeaa37){var _0x43676c=_0xdeaa37['get']({'plain':!![]});return _0x43676c[_0xe896('0x82')];});return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0x5a254b['params']['id']}})[_0xe896('0x2b')](function(_0x5bfd3b){return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x1e1820){return _0x5bfd3b[_0xe896('0x81')](_0x33fbb8,{'transaction':_0x1e1820})[_0xe896('0x2b')](function(){return BPromise[_0xe896('0x87')](_0x419fc7,function(_0x4870d7){return db['TeamVoicePrefix'][_0xe896('0x88')]({'TeamId':_0x4870d7['id'],'VoicePrefixId':_0x5a254b['params']['id']},{'transaction':_0x1e1820});});})[_0xe896('0x2b')](function(){return BPromise[_0xe896('0x87')](_0x219ef1,function(_0x5ac4ad){return db[_0xe896('0x89')][_0xe896('0x8a')]({'where':{'UserId':_0x5ac4ad['id'],'VoicePrefixId':_0x5a254b['params']['id']},'transaction':_0x1e1820});});})[_0xe896('0x2b')](function(){_0x219ef1['forEach'](function(_0x326c67){socket[_0xe896('0x78')](_0xe896('0x8b'),{'UserId':_0x326c67['id'],'VoicePrefixId':_0x5bfd3b['id']});});});});});}})[_0xe896('0x2b')](respondWithStatusCode(_0x4f4d26,null))['catch'](handleError(_0x4f4d26,null));};exports[_0xe896('0x8c')]=function(_0x25b297,_0x111c0d,_0x22ac85){return db[_0xe896('0x7f')][_0xe896('0x4c')]({'where':{'id':_0x25b297[_0xe896('0x39')][_0xe896('0x75')]},'attributes':['id'],'include':[{'model':db[_0xe896('0x7c')],'as':_0xe896('0x82'),'attributes':['id'],'raw':!![]}]})[_0xe896('0x2b')](handleEntityNotFound(_0x111c0d,null))[_0xe896('0x2b')](function(_0x23049d){var _0x39e735=_[_0xe896('0x46')](_0x23049d,'id');var _0xc0cb7c=[];var _0x16b398=[];var _0x4edeaf=squel[_0xe896('0x8d')]();_0x4edeaf[_0xe896('0x8e')]('tq.TeamId')['from'](_0xe896('0x8f'),'tq')[_0xe896('0x90')](_0xe896('0x91'),'ut',_0xe896('0x92'))[_0xe896('0x43')](_0xe896('0x93'),_0x25b297[_0xe896('0x73')]['id']);for(var _0x46a4f0=0x0;_0x46a4f0<_0x23049d['length'];_0x46a4f0+=0x1){let _0x13eb9a=_0x23049d[_0x46a4f0];for(var _0x3c70a3=0x0;_0x3c70a3<_0x13eb9a[_0xe896('0x82')][_0xe896('0x40')];_0x3c70a3+=0x1){let _0x59bea9=_0x13eb9a[_0xe896('0x82')][_0x3c70a3];var _0x54b2f0=_0x4edeaf['clone']();_0x54b2f0[_0xe896('0x43')](_0xe896('0x94'),_0x59bea9['id']);_0x16b398[_0xe896('0x6a')](db[_0xe896('0x54')][_0xe896('0x39')](_0x54b2f0[_0xe896('0x95')](),{'type':db[_0xe896('0x54')]['QueryTypes'][_0xe896('0x96')]})[_0xe896('0x2b')](function(_0x98bc8){if(_0x98bc8[_0xe896('0x40')]===0x1){return _0x59bea9['id'];}else{var _0xe78476=_[_0xe896('0x97')](_[_0xe896('0x46')](_0x98bc8,_0xe896('0x98')),function(_0x3c377e){return _['includes'](_0x39e735,_0x3c377e);});if(_0xe78476){return _0x59bea9['id'];}}}));}}return BPromise[_0xe896('0x99')](_0x16b398)[_0xe896('0x2b')](function(_0x4983ea){_0xc0cb7c=_(_0xc0cb7c)[_0xe896('0x9a')](_0x4983ea)['compact']()['value']();return db[_0xe896('0x35')]['find']({'where':{'id':_0x25b297['params']['id']}})[_0xe896('0x2b')](function(_0x1af1a2){return db[_0xe896('0x54')]['transaction'](function(_0x2b72af){return _0x1af1a2['removeTeams'](_0x25b297[_0xe896('0x39')][_0xe896('0x75')],{'transaction':_0x2b72af})['then'](function(){if(!_[_0xe896('0x9b')](_0xc0cb7c)){return _0x1af1a2[_0xe896('0x77')](_0xc0cb7c,{'transaction':_0x2b72af});}})['then'](function(){_0xc0cb7c[_0xe896('0x9c')](function(_0x5478f3){socket['emit']('userVoicePrefix:remove',{'UserId':_0x5478f3,'VoicePrefixId':_0x1af1a2['id']});});});});});});})[_0xe896('0x2b')](respondWithStatusCode(_0x111c0d,null))['catch'](handleError(_0x111c0d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index b891e5d..92cf274 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd59=['exports','events','../../mysqldb','setMaxListeners','emit'];(function(_0x4cdcfb,_0x489c3b){var _0x5c240f=function(_0x1e6a75){while(--_0x1e6a75){_0x4cdcfb['push'](_0x4cdcfb['shift']());}};_0x5c240f(++_0x489c3b);}(_0xcd59,0x9c));var _0x9cd5=function(_0x1f0f2a,_0x14f11a){_0x1f0f2a=_0x1f0f2a-0x0;var _0x145cd9=_0xcd59[_0x1f0f2a];return _0x145cd9;};'use strict';var EventEmitter=require(_0x9cd5('0x0'));var VoicePrefix=require(_0x9cd5('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9cd5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x92d6e0){return function(_0x343667,_0xd5b6c2,_0x5e701d){VoicePrefixEvents[_0x9cd5('0x3')](_0x92d6e0+':'+_0x343667['id'],_0x343667);VoicePrefixEvents[_0x9cd5('0x3')](_0x92d6e0,_0x343667);_0x5e701d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9cd5('0x4')]=VoicePrefixEvents; \ No newline at end of file +var _0x2faf=['hook','exports','events','../../mysqldb','VoicePrefix','save','update','remove','emit','hasOwnProperty'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x2faf,0x16a));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xf2fa('0x0'));var VoicePrefix=require(_0xf2fa('0x1'))['db'][_0xf2fa('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf2fa('0x3'),'afterUpdate':_0xf2fa('0x4'),'afterDestroy':_0xf2fa('0x5')};function emitEvent(_0x418bca){return function(_0x206428,_0x2fa80d,_0x50ec04){VoicePrefixEvents['emit'](_0x418bca+':'+_0x206428['id'],_0x206428);VoicePrefixEvents[_0xf2fa('0x6')](_0x418bca,_0x206428);_0x50ec04(null);};}for(var e in events){if(events[_0xf2fa('0x7')](e)){var event=events[e];VoicePrefix[_0xf2fa('0x8')](e,emitEvent(event));}}module[_0xf2fa('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 20cd177..bfd0ebb 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x827b=['rimraf','../../config/environment','exports','define','voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x48cf9f,_0x22c0bb){var _0x4166d4=function(_0x336c9c){while(--_0x336c9c){_0x48cf9f['push'](_0x48cf9f['shift']());}};_0x4166d4(++_0x22c0bb);}(_0x827b,0x185));var _0xb827=function(_0x303f76,_0x25c014){_0x303f76=_0x303f76-0x0;var _0x1a4b94=_0x827b[_0x303f76];return _0x1a4b94;};'use strict';var _=require(_0xb827('0x0'));var util=require(_0xb827('0x1'));var logger=require('../../config/logger')(_0xb827('0x2'));var moment=require(_0xb827('0x3'));var BPromise=require(_0xb827('0x4'));var rp=require(_0xb827('0x5'));var fs=require('fs');var path=require(_0xb827('0x6'));var rimraf=require(_0xb827('0x7'));var config=require(_0xb827('0x8'));var attributes=require('./voicePrefix.attributes');module[_0xb827('0x9')]=function(_0x7120e4,_0x4f67c1){return _0x7120e4[_0xb827('0xa')]('VoicePrefix',attributes,{'tableName':_0xb827('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd72d=['bluebird','request-promise','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xd72d,0xc7));var _0xdd72=function(_0x383c9f,_0xe6d2a6){_0x383c9f=_0x383c9f-0x0;var _0x5ee5ab=_0xd72d[_0x383c9f];return _0x5ee5ab;};'use strict';var _=require(_0xdd72('0x0'));var util=require(_0xdd72('0x1'));var logger=require(_0xdd72('0x2'))(_0xdd72('0x3'));var moment=require(_0xdd72('0x4'));var BPromise=require(_0xdd72('0x5'));var rp=require(_0xdd72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd72('0x7'));module[_0xdd72('0x8')]=function(_0x5d1f7c,_0x4a62e7){return _0x5d1f7c[_0xdd72('0x9')](_0xdd72('0xa'),attributes,{'tableName':_0xdd72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index eebf2b6..b8d37ad 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d95=['VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x340b14,_0x23d9b6){var _0x49db07=function(_0x5c436c){while(--_0x5c436c){_0x340b14['push'](_0x340b14['shift']());}};_0x49db07(++_0x23d9b6);}(_0x2d95,0xca));var _0x52d9=function(_0x53c866,_0x4e1b69){_0x53c866=_0x53c866-0x0;var _0x23d503=_0x2d95[_0x53c866];return _0x23d503;};'use strict';var _=require(_0x52d9('0x0'));var util=require('util');var moment=require(_0x52d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x52d9('0x2'));var fs=require('fs');var Redis=require(_0x52d9('0x3'));var db=require(_0x52d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52d9('0x5'))(_0x52d9('0x6'));var config=require(_0x52d9('0x7'));var jayson=require(_0x52d9('0x8'));var client=jayson[_0x52d9('0x9')][_0x52d9('0xa')]({'port':0x232a});config[_0x52d9('0xb')]=_[_0x52d9('0xc')](config[_0x52d9('0xb')],{'host':_0x52d9('0xd'),'port':0x18eb});var socket=require(_0x52d9('0xe'))(new Redis(config[_0x52d9('0xb')]));require(_0x52d9('0xf'))[_0x52d9('0x10')](socket);function respondWithRpcPromise(_0x5b0892,_0x57ffbd,_0x5a2ec3){return new BPromise(function(_0x28dbf4,_0x4474c2){return client[_0x52d9('0x11')](_0x5b0892,_0x5a2ec3)[_0x52d9('0x12')](function(_0xe82376){logger['info'](_0x52d9('0x13'),_0x57ffbd,_0x52d9('0x14'));logger[_0x52d9('0x15')](_0x52d9('0x16'),_0x57ffbd,'request\x20sent',JSON['stringify'](_0xe82376));if(_0xe82376[_0x52d9('0x17')]){if(_0xe82376[_0x52d9('0x17')][_0x52d9('0x18')]===0x1f4){logger[_0x52d9('0x17')](_0x52d9('0x13'),_0x57ffbd,_0xe82376[_0x52d9('0x17')]['message']);return _0x4474c2(_0xe82376[_0x52d9('0x17')][_0x52d9('0x19')]);}logger[_0x52d9('0x17')](_0x52d9('0x13'),_0x57ffbd,_0xe82376['error'][_0x52d9('0x19')]);return _0x28dbf4(_0xe82376['error'][_0x52d9('0x19')]);}else{logger['info'](_0x52d9('0x13'),_0x57ffbd,_0x52d9('0x14'));_0x28dbf4(_0xe82376[_0x52d9('0x1a')][_0x52d9('0x19')]);}})[_0x52d9('0x1b')](function(_0x359f0b){logger[_0x52d9('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x57ffbd,_0x359f0b);_0x4474c2(_0x359f0b);});});} \ No newline at end of file +var _0x6691=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x6691,0x12d));var _0x1669=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6691[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});config[_0x1669('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1669('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x56e0ee,_0x52b44f,_0x408538){return new BPromise(function(_0x93d633,_0xdf793d){return client[_0x1669('0xf')](_0x56e0ee,_0x408538)[_0x1669('0x10')](function(_0x3d6f5e){logger[_0x1669('0x11')](_0x1669('0x12'),_0x52b44f,_0x1669('0x13'));logger[_0x1669('0x14')](_0x1669('0x15'),_0x52b44f,_0x1669('0x13'),JSON[_0x1669('0x16')](_0x3d6f5e));if(_0x3d6f5e[_0x1669('0x17')]){if(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x18')]===0x1f4){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0xdf793d(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}logger[_0x1669('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0x93d633(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}else{logger[_0x1669('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x52b44f,'request\x20sent');_0x93d633(_0x3d6f5e[_0x1669('0x1a')][_0x1669('0x19')]);}})[_0x1669('0x1b')](function(_0x4fcf1c){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x4fcf1c);_0xdf793d(_0x4fcf1c);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 820fc61..0b9766f 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bdf=['./voicePrefix.events','save','remove','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x64d2e0,_0x4fc64b){var _0x523a63=function(_0x574821){while(--_0x574821){_0x64d2e0['push'](_0x64d2e0['shift']());}};_0x523a63(++_0x4fc64b);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8bdf[_0x297fd3];return _0x2af381;};'use strict';var VoicePrefixEvents=require(_0xf8bd('0x0'));var events=[_0xf8bd('0x1'),_0xf8bd('0x2'),_0xf8bd('0x3')];function createListener(_0x336d9f,_0x57e7be){return function(_0x35ddcf){_0x57e7be[_0xf8bd('0x4')](_0x336d9f,_0x35ddcf);};}function removeListener(_0x147fea,_0x3b32a1){return function(){VoicePrefixEvents[_0xf8bd('0x5')](_0x147fea,_0x3b32a1);};}exports[_0xf8bd('0x6')]=function(_0x59eff9){for(var _0x4ed701=0x0,_0x504c82=events[_0xf8bd('0x7')];_0x4ed701<_0x504c82;_0x4ed701++){var _0x22a277=events[_0x4ed701];var _0x3e1db1=createListener(_0xf8bd('0x8')+_0x22a277,_0x59eff9);VoicePrefixEvents['on'](_0x22a277,_0x3e1db1);}}; \ No newline at end of file +var _0xcab6=['length','voicePrefix:','./voicePrefix.events','remove','update','emit','register'];(function(_0x42db23,_0x112b01){var _0x2d1e4e=function(_0x96342f){while(--_0x96342f){_0x42db23['push'](_0x42db23['shift']());}};_0x2d1e4e(++_0x112b01);}(_0xcab6,0xd4));var _0x6cab=function(_0x402bbd,_0x3a64f0){_0x402bbd=_0x402bbd-0x0;var _0xe62380=_0xcab6[_0x402bbd];return _0xe62380;};'use strict';var VoicePrefixEvents=require(_0x6cab('0x0'));var events=['save',_0x6cab('0x1'),_0x6cab('0x2')];function createListener(_0x1ff0cd,_0x1b8153){return function(_0xae3b53){_0x1b8153[_0x6cab('0x3')](_0x1ff0cd,_0xae3b53);};}function removeListener(_0x5ea2d8,_0xa8b534){return function(){VoicePrefixEvents['removeListener'](_0x5ea2d8,_0xa8b534);};}exports[_0x6cab('0x4')]=function(_0x1953cd){for(var _0x13464a=0x0,_0x53e159=events[_0x6cab('0x5')];_0x13464a<_0x53e159;_0x13464a++){var _0x229e5a=events[_0x13464a];var _0x230f8b=createListener(_0x6cab('0x6')+_0x229e5a,_0x1953cd);VoicePrefixEvents['on'](_0x229e5a,_0x230f8b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e54efba..49fe3db 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1e30c5,_0x832371){var _0x58a812=function(_0x4246f4){while(--_0x4246f4){_0x1e30c5['push'](_0x1e30c5['shift']());}};_0x58a812(++_0x832371);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0xb10b,0x12a));var _0xbb10=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xb10b[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index f6a7183..495d5a2 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc25d=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','ENUM','outbound','inbound','STRING','default','ringall','fewestcalls','random','rrmemory','linear','setDataValue','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x38aaa6,_0x563616){var _0x3ad60c=function(_0x395bb6){while(--_0x395bb6){_0x38aaa6['push'](_0x38aaa6['shift']());}};_0x3ad60c(++_0x563616);}(_0xc25d,0x1ec));var _0xdc25=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xc25d[_0x5f4cd7];return _0x47c93f;};'use strict';var Sequelize=require(_0xdc25('0x0'));module[_0xdc25('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdc25('0x2')]('inbound',_0xdc25('0x3')),'allowNull':![],'defaultValue':_0xdc25('0x4')},'musiconhold':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':_0xdc25('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xdc25('0x7'),'leastrecent',_0xdc25('0x8'),_0xdc25('0x9'),_0xdc25('0xa'),_0xdc25('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x48b75e){this[_0xdc25('0xc')]('strategy',_0x48b75e?_0x48b75e:'rrmemory');},'get':function(){var _0x43df97=this[_0xdc25('0xd')](_0xdc25('0xe'));var _0x543ff5=this[_0xdc25('0xd')](_0xdc25('0xf'));var _0x2ab44f=this[_0xdc25('0xd')]('strategy');if(_0x43df97==='inbound'){return _0x2ab44f;}if(_0x543ff5===_0xdc25('0x10')&&_0x2ab44f===_0xdc25('0xa')||_0x543ff5===_0xdc25('0x10')&&_0x2ab44f===_0xdc25('0x11')){return _0x2ab44f;}if(_0x543ff5===_0xdc25('0x12')||_0x543ff5===_0xdc25('0x13')||_0x543ff5==='power'){return _0x2ab44f;}return null;}},'servicelevel':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdc25('0x14')](0xb)},'timeout':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdc25('0x5')]},'weight':{'type':Sequelize[_0xdc25('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xdc25('0x2')]('yes','no'),'defaultValue':_0xdc25('0x15')},'autopause':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no',_0xdc25('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdc25('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xdc25('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xdc25('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdc25('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdc25('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no'),'defaultValue':_0xdc25('0x15')},'announce_holdtime':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no',_0xdc25('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xdc25('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdc25('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdc25('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdc25('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdc25('0x5')]},'queue_quantity1':{'type':Sequelize[_0xdc25('0x5')]},'queue_quantity2':{'type':Sequelize[_0xdc25('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0xdc25('0x5')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xdc25('0x18')],'set':function(_0x5bdd85){this[_0xdc25('0xc')]('periodic_announce',_0x5bdd85?_0x5bdd85[_0xdc25('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xdc25('0x1a'))?this[_0xdc25('0xd')](_0xdc25('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':_0xdc25('0x15'),'set':function(_0x10d827){this[_0xdc25('0xc')](_0xdc25('0x1b'),_0x10d827?_0x10d827[_0xdc25('0x19')](','):undefined);},'get':function(){return this[_0xdc25('0xd')](_0xdc25('0x1b'))?this[_0xdc25('0xd')](_0xdc25('0x1b'))[_0xdc25('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':'no','set':function(_0x530f8a){this[_0xdc25('0xc')]('leavewhenempty',_0x530f8a?_0x530f8a[_0xdc25('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xdc25('0x1d'))?this[_0xdc25('0xd')](_0xdc25('0x1d'))[_0xdc25('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xdc25('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xdc25('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdc25('0x5')]},'description':{'type':Sequelize[_0xdc25('0x5')]},'acw':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':0x0,'set':function(_0xef034d){this[_0xdc25('0xc')]('acw',_0xef034d);if(_0xef034d){if(this['getDataValue']('wrapuptime')<0x2){this[_0xdc25('0xc')](_0xdc25('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdc25('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x20'),_0xdc25('0x12'),_0xdc25('0x21'),'predictive',_0xdc25('0x10')),'defaultValue':_0xdc25('0x12'),'comment':_0xdc25('0x22')},'dialLimitChannel':{'type':Sequelize[_0xdc25('0x14')](0x4)[_0xdc25('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdc25('0x24')},'dialLimitQueue':{'type':Sequelize[_0xdc25('0x14')](0x4)[_0xdc25('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdc25('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xdc25('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdc25('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xdc25('0x27'),_0xdc25('0x28')),'defaultValue':_0xdc25('0x28'),'comment':_0xdc25('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdc25('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdc25('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdc25('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdc25('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xdc25('0x2d'),'comment':_0xdc25('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x2f')},'dialQueueProject':{'type':Sequelize[_0xdc25('0x5')],'comment':_0xdc25('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)[_0xdc25('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdc25('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdc25('0x37')},'dialTimezone':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdc25('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x38'),_0xdc25('0x39'),'onlyIfOpen'),'defaultValue':_0xdc25('0x38')},'dialAMDActive':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':0x0,'comment':_0xdc25('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdc25('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdc25('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdc25('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdc25('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdc25('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdc25('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdc25('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdc25('0x14')](0x5)[_0xdc25('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdc25('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdc25('0x14')](0x9)[_0xdc25('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xdc25('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdc25('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xdc25('0x2')](_0xdc25('0x43'),_0xdc25('0x44')),'defaultValue':_0xdc25('0x43')},'dialQueueProject2':{'type':Sequelize[_0xdc25('0x5')],'comment':_0xdc25('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc25('0x45')},'dialCutDigit':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc25('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)[_0xdc25('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)[_0xdc25('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc25('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0xdc25('0x14')](0x3)[_0xdc25('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc25('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdc25('0x14')](0x5)[_0xdc25('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc25('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc25('0x14')],'allowNull':!![],'comment':_0xdc25('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':![],'comment':_0xdc25('0x4f'),'set':function(_0x28eda9){if(!_0x28eda9)this[_0xdc25('0xc')](_0xdc25('0x50'),null);this[_0xdc25('0xc')]('mandatoryDisposition',_0x28eda9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdc25('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xdc25('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xdc25('0x1e')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8243=['wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN'];(function(_0x29357c,_0x134e6a){var _0x3e8315=function(_0xebebef){while(--_0xebebef){_0x29357c['push'](_0x29357c['shift']());}};_0x3e8315(++_0x134e6a);}(_0x8243,0xbe));var _0x3824=function(_0xfb0db0,_0x46419c){_0xfb0db0=_0xfb0db0-0x0;var _0x56dc34=_0x8243[_0xfb0db0];return _0x56dc34;};'use strict';var Sequelize=require(_0x3824('0x0'));module[_0x3824('0x1')]={'name':{'type':Sequelize[_0x3824('0x2')],'allowNull':![],'unique':_0x3824('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x3824('0x5')},'musiconhold':{'type':Sequelize[_0x3824('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x3824('0x4')]('rr',_0x3824('0x6'),_0x3824('0x7'),_0x3824('0x8'),_0x3824('0x9'),_0x3824('0xa'),_0x3824('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x149493){this[_0x3824('0xc')](_0x3824('0xd'),_0x149493?_0x149493:'rrmemory');},'get':function(){var _0x29e88b=this[_0x3824('0xe')](_0x3824('0xf'));var _0x2d2b11=this[_0x3824('0xe')](_0x3824('0x10'));var _0x2529eb=this['getDataValue'](_0x3824('0xd'));if(_0x29e88b===_0x3824('0x5')){return _0x2529eb;}if(_0x2d2b11==='booked'&&_0x2529eb===_0x3824('0xa')||_0x2d2b11===_0x3824('0x11')&&_0x2529eb==='roundrobin'){return _0x2529eb;}if(_0x2d2b11===_0x3824('0x12')||_0x2d2b11===_0x3824('0x13')||_0x2d2b11===_0x3824('0x14')){return _0x2529eb;}return null;}},'servicelevel':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3824('0x15')](0xb)},'timeout':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3824('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3824('0x16')},'autopause':{'type':Sequelize['ENUM'](_0x3824('0x16'),'no',_0x3824('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3824('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x3824('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3824('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3824('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3824('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3824('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':_0x3824('0x16')},'announce_holdtime':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no',_0x3824('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x3824('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3824('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3824('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3824('0x2')]},'queue_youarenext':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3824('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3824('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x3824('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x3824('0x19')],'set':function(_0x249728){this[_0x3824('0xc')](_0x3824('0x1a'),_0x249728?_0x249728[_0x3824('0x1b')](','):[]);},'get':function(){return this[_0x3824('0xe')](_0x3824('0x1a'))?this['getDataValue'](_0x3824('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3824('0x2')],'defaultValue':_0x3824('0x16'),'set':function(_0x15e463){this['setDataValue'](_0x3824('0x1c'),_0x15e463?_0x15e463[_0x3824('0x1b')](','):undefined);},'get':function(){return this[_0x3824('0xe')](_0x3824('0x1c'))?this[_0x3824('0xe')]('joinempty')[_0x3824('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3824('0x2')],'defaultValue':'no','set':function(_0x4ed254){this['setDataValue'](_0x3824('0x1e'),_0x4ed254?_0x4ed254[_0x3824('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x3824('0x1e'))?this['getDataValue'](_0x3824('0x1e'))[_0x3824('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3824('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3824('0x2')]},'description':{'type':Sequelize[_0x3824('0x2')]},'acw':{'type':Sequelize[_0x3824('0x1f')],'defaultValue':0x0,'set':function(_0x4b9fb0){this[_0x3824('0xc')]('acw',_0x4b9fb0);if(_0x4b9fb0){if(this[_0x3824('0xe')](_0x3824('0x20'))<0x2){this[_0x3824('0xc')](_0x3824('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3824('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3824('0x21')},'dialMethod':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x22'),'progressive',_0x3824('0x14'),_0x3824('0x13'),_0x3824('0x11')),'defaultValue':'progressive','comment':_0x3824('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3824('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3824('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x3824('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3824('0x26')},'dialPowerLevel':{'type':Sequelize[_0x3824('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x3824('0x28')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3824('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3824('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3824('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3824('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3824('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3824('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x3824('0x2')],'defaultValue':_0x3824('0x2b'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3824('0x2c')},'dialQueueProject':{'type':Sequelize[_0x3824('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3824('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3824('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3824('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x31'),_0x3824('0x32'),_0x3824('0x33')),'defaultValue':_0x3824('0x31')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3824('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0x3824('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3824('0x35')},'dialAMDGreeting':{'type':Sequelize[_0x3824('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3824('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3824('0x15')](0x9)[_0x3824('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3824('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3824('0x37')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3824('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3824('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3824('0x15')](0x9)[_0x3824('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3824('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3824('0x15')](0x9)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3824('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3824('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3824('0x15')](0x9)[_0x3824('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3824('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x3824('0x1f')],'defaultValue':0x0,'comment':_0x3824('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3824('0x4')](_0x3824('0x3e'),_0x3824('0x3f')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3824('0x2')],'comment':_0x3824('0x40')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3824('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3824('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3824('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3824('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x42')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3824('0x43')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3824('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3824('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3824('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3824('0x15')](0x5)[_0x3824('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3824('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3824('0x48'),'set':function(_0x751d57){if(!_0x751d57)this[_0x3824('0xc')](_0x3824('0x49'),null);this[_0x3824('0xc')]('mandatoryDisposition',_0x751d57);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3824('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3824('0x15')](0x3)[_0x3824('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3824('0x1f')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 65df3f0..6c2ce62 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4030=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','findOne','pick','CmHopper','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','ids','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','online','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','scheduledAt','field','phone','ContactId','CmListId','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','save','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','type','find','UserProfileResource','end','error','name','send','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2cdc2e,_0x3cf95d){var _0x460c6e=function(_0x572ff2){while(--_0x572ff2){_0x2cdc2e['push'](_0x2cdc2e['shift']());}};_0x460c6e(++_0x3cf95d);}(_0x4030,0x1cc));var _0x0403=function(_0x386078,_0x49ad4f){_0x386078=_0x386078-0x0;var _0xd6675c=_0x4030[_0x386078];return _0xd6675c;};'use strict';var emlformat=require(_0x0403('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0403('0x1'));var rp=require(_0x0403('0x2'));var moment=require(_0x0403('0x3'));var BPromise=require(_0x0403('0x4'));var Mustache=require('mustache');var util=require(_0x0403('0x5'));var path=require(_0x0403('0x6'));var sox=require(_0x0403('0x7'));var csv=require('to-csv');var ejs=require(_0x0403('0x8'));var fs=require('fs');var fs_extra=require(_0x0403('0x9'));var _=require(_0x0403('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0403('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0403('0xc'));var Redis=require('ioredis');var authService=require(_0x0403('0xd'));var qs=require(_0x0403('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0403('0xf'))(_0x0403('0x10'));var utils=require(_0x0403('0x11'));var config=require(_0x0403('0x12'));var licenseUtil=require(_0x0403('0x13'));var db=require(_0x0403('0x14'))['db'];config[_0x0403('0x15')]=_[_0x0403('0x16')](config[_0x0403('0x15')],{'host':_0x0403('0x17'),'port':0x18eb});var socket=require(_0x0403('0x18'))(new Redis(config['redis']));require(_0x0403('0x19'))[_0x0403('0x1a')](socket);function respondWithStatusCode(_0x126be0,_0xa41369){_0xa41369=_0xa41369||0xcc;return function(_0x4001e9){if(_0x4001e9){return _0x126be0[_0x0403('0x1b')](_0xa41369);}return _0x126be0[_0x0403('0x1c')](_0xa41369)['end']();};}function respondWithResult(_0x589fc0,_0x39ea2f){_0x39ea2f=_0x39ea2f||0xc8;return function(_0x1d2b2a){if(_0x1d2b2a){return _0x589fc0[_0x0403('0x1c')](_0x39ea2f)['json'](_0x1d2b2a);}};}function respondWithFilteredResult(_0x30246b,_0x57714e){return function(_0x2bfdfb){if(_0x2bfdfb){var _0x57c47d=typeof _0x57714e['offset']==='undefined'&&typeof _0x57714e['limit']==='undefined';var _0x32171f=_0x2bfdfb[_0x0403('0x1d')];var _0x16c027=_0x57c47d?0x0:_0x57714e[_0x0403('0x1e')];var _0x5da4b6=_0x57c47d?_0x2bfdfb[_0x0403('0x1d')]:_0x57714e[_0x0403('0x1e')]+_0x57714e[_0x0403('0x1f')];var _0x1f81b0;if(_0x5da4b6>=_0x32171f){_0x5da4b6=_0x32171f;_0x1f81b0=0xc8;}else{_0x1f81b0=0xce;}_0x30246b[_0x0403('0x1c')](_0x1f81b0);return _0x30246b[_0x0403('0x20')](_0x0403('0x21'),_0x16c027+'-'+_0x5da4b6+'/'+_0x32171f)[_0x0403('0x22')](_0x2bfdfb);}return null;};}function patchUpdates(_0x1644d1){return function(_0x1f894b){try{jsonpatch['apply'](_0x1f894b,_0x1644d1,!![]);}catch(_0x39d7e9){return BPromise['reject'](_0x39d7e9);}return _0x1f894b[_0x0403('0x23')]();};}function saveUpdates(_0x327360,_0x4a3264){return function(_0x102dd6){if(_0x102dd6){return _0x102dd6['update'](_0x327360)['then'](function(_0x2c945e){return _0x2c945e;});}return null;};}function removeEntity(_0x4275ab,_0x2973c5){return function(_0x4c01d3){if(_0x4c01d3){return _0x4c01d3[_0x0403('0x24')]()[_0x0403('0x25')](function(){var _0x36de0c=_0x4c01d3[_0x0403('0x26')]({'plain':!![]});var _0x3d9336=[{'name':_0x0403('0x27'),'value':_0x0403('0x28'),'ignore':![]},{'name':_0x0403('0x29'),'value':_0x0403('0x2a'),'ignore':![]}];var _0x44c79d=_(_0x3d9336)[_0x0403('0x2b')](_0x0403('0x2c'))['map'](_0x0403('0x2d'))[_0x0403('0x2d')]();if(_['includes'](_0x44c79d,_0x36de0c[_0x0403('0x2e')])){return;}var _0x1f5ffa=_[_0x0403('0x2f')](_0x3d9336,['value',_0x36de0c[_0x0403('0x2e')]])['name'];return db[_0x0403('0x30')][_0x0403('0x24')]({'where':{'type':_0x1f5ffa,'resourceId':_0x36de0c['id']}})[_0x0403('0x25')](function(){return _0x4c01d3;});})[_0x0403('0x25')](function(){_0x4275ab['status'](0xcc)[_0x0403('0x31')]();});}};}function handleEntityNotFound(_0x1f15a3,_0x521bf2){return function(_0x15d739){if(!_0x15d739){_0x1f15a3[_0x0403('0x1b')](0x194);}return _0x15d739;};}function handleError(_0x5b6c80,_0xae303d){_0xae303d=_0xae303d||0x1f4;return function(_0x2586cb){logger[_0x0403('0x32')](_0x2586cb['stack']);if(_0x2586cb[_0x0403('0x33')]){delete _0x2586cb[_0x0403('0x33')];}_0x5b6c80['status'](_0xae303d)[_0x0403('0x34')](_0x2586cb);};}exports['index']=function(_0x66828f,_0x2a4367){var _0x5d0e1c={},_0x462eaf={},_0xdb7602={'count':0x0,'rows':[]};var _0x4ace34=_[_0x0403('0x35')](db[_0x0403('0x36')][_0x0403('0x37')],function(_0x1d1856){return{'name':_0x1d1856[_0x0403('0x38')],'type':_0x1d1856[_0x0403('0x2e')][_0x0403('0x39')]};});_0x462eaf[_0x0403('0x3a')]=_[_0x0403('0x35')](_0x4ace34,_0x0403('0x33'));_0x462eaf[_0x0403('0x3b')]=_[_0x0403('0x3c')](_0x66828f['query']);_0x462eaf[_0x0403('0x3d')]=_['intersection'](_0x462eaf[_0x0403('0x3a')],_0x462eaf['query']);_0x5d0e1c[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x462eaf[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x66828f[_0x0403('0x3b')][_0x0403('0x40')]));_0x5d0e1c[_0x0403('0x3e')]=_0x5d0e1c[_0x0403('0x3e')][_0x0403('0x41')]?_0x5d0e1c['attributes']:_0x462eaf[_0x0403('0x3a')];if(!_0x66828f[_0x0403('0x3b')][_0x0403('0x42')](_0x0403('0x43'))){_0x5d0e1c['limit']=qs[_0x0403('0x1f')](_0x66828f[_0x0403('0x3b')][_0x0403('0x1f')]);_0x5d0e1c[_0x0403('0x1e')]=qs['offset'](_0x66828f[_0x0403('0x3b')]['offset']);}_0x5d0e1c[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x66828f['query'][_0x0403('0x45')]);_0x5d0e1c['where']=qs[_0x0403('0x3d')](_['pick'](_0x66828f[_0x0403('0x3b')],_0x462eaf[_0x0403('0x3d')]),_0x4ace34);if(_0x66828f[_0x0403('0x3b')][_0x0403('0x2b')]){_0x5d0e1c[_0x0403('0x46')]=_['merge'](_0x5d0e1c[_0x0403('0x46')],{'$or':_['map'](_0x4ace34,function(_0x2e9445){if(_0x2e9445[_0x0403('0x2e')]!==_0x0403('0x47')){var _0x339f8f={};_0x339f8f[_0x2e9445['name']]={'$like':'%'+_0x66828f['query']['filter']+'%'};return _0x339f8f;}})});}_0x5d0e1c=_[_0x0403('0x48')]({},_0x5d0e1c,_0x66828f[_0x0403('0x49')]);var _0x34b220={'where':_0x5d0e1c[_0x0403('0x46')]};return db[_0x0403('0x36')][_0x0403('0x1d')](_0x34b220)[_0x0403('0x25')](function(_0x1fafef){_0xdb7602[_0x0403('0x1d')]=_0x1fafef;if(_0x66828f[_0x0403('0x3b')][_0x0403('0x4a')]){_0x5d0e1c[_0x0403('0x4b')]=[{'all':!![]}];}return db['VoiceQueue'][_0x0403('0x4c')](_0x5d0e1c);})[_0x0403('0x25')](function(_0x18fd0b){_0xdb7602[_0x0403('0x4d')]=_0x18fd0b;return _0xdb7602;})[_0x0403('0x25')](respondWithFilteredResult(_0x2a4367,_0x5d0e1c))[_0x0403('0x4e')](handleError(_0x2a4367,null));};exports[_0x0403('0x4f')]=function(_0x2b69a5,_0x1e87a9){var _0x57ea25={'raw':![],'where':{'id':_0x2b69a5[_0x0403('0x50')]['id']}},_0x209558={};_0x209558[_0x0403('0x3a')]=_[_0x0403('0x3c')](db['VoiceQueue']['rawAttributes']);_0x209558[_0x0403('0x3b')]=_[_0x0403('0x3c')](_0x2b69a5[_0x0403('0x3b')]);_0x209558[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x209558[_0x0403('0x3a')],_0x209558['query']);_0x57ea25['attributes']=_[_0x0403('0x3f')](_0x209558[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x2b69a5[_0x0403('0x3b')][_0x0403('0x40')]));_0x57ea25[_0x0403('0x3e')]=_0x57ea25[_0x0403('0x3e')][_0x0403('0x41')]?_0x57ea25[_0x0403('0x3e')]:_0x209558[_0x0403('0x3a')];if(_0x2b69a5['query'][_0x0403('0x4a')]){_0x57ea25[_0x0403('0x4b')]=[{'all':!![]}];}_0x57ea25=_[_0x0403('0x48')]({},_0x57ea25,_0x2b69a5['options']);return db['VoiceQueue']['find'](_0x57ea25)[_0x0403('0x25')](handleEntityNotFound(_0x1e87a9,null))[_0x0403('0x25')](respondWithResult(_0x1e87a9,null))[_0x0403('0x4e')](handleError(_0x1e87a9,null));};exports[_0x0403('0x51')]=function(_0x5b6cb7,_0x5dc511){return db[_0x0403('0x36')][_0x0403('0x51')](_0x5b6cb7[_0x0403('0x52')],{})[_0x0403('0x25')](function(_0x19b593){var _0x1d8b76=_0x5b6cb7[_0x0403('0x53')][_0x0403('0x26')]({'plain':!![]});if(!_0x1d8b76)throw new Error(_0x0403('0x54'));if(_0x1d8b76[_0x0403('0x55')]==='user'){var _0x42ac09=_0x19b593[_0x0403('0x26')]({'plain':!![]});var _0x37cdf4=[{'name':'VoiceQueues','value':_0x0403('0x28')},{'name':'QueueCampaigns','value':_0x0403('0x2a')}];var _0x4dc6fa=_[_0x0403('0x2f')](_0x37cdf4,[_0x0403('0x2d'),_0x42ac09[_0x0403('0x2e')]])[_0x0403('0x33')];return db[_0x0403('0x56')][_0x0403('0x2f')]({'where':{'name':_0x4dc6fa,'userProfileId':_0x1d8b76[_0x0403('0x57')]},'raw':!![]})[_0x0403('0x25')](function(_0x5996bb){if(_0x5996bb&&_0x5996bb[_0x0403('0x58')]===0x0){return db[_0x0403('0x30')]['create']({'name':_0x42ac09['name'],'resourceId':_0x42ac09['id'],'type':_0x5996bb[_0x0403('0x33')],'sectionId':_0x5996bb['id']},{})[_0x0403('0x25')](function(){return _0x19b593;});}else{return _0x19b593;}})[_0x0403('0x4e')](function(_0x1076bb){logger[_0x0403('0x32')](_0x0403('0x59'),_0x1076bb);throw _0x1076bb;});}return _0x19b593;})[_0x0403('0x25')](respondWithResult(_0x5dc511,0xc9))[_0x0403('0x4e')](handleError(_0x5dc511,null));};exports[_0x0403('0x5a')]=function(_0x4113aa,_0x2cfaf7){var _0x370b21={'where':{'id':_0x4113aa[_0x0403('0x50')]['id']}},_0x11cc27={};_0x11cc27[_0x0403('0x3a')]=_['keys'](db['VoiceQueue'][_0x0403('0x37')]);_0x370b21[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x11cc27[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x4113aa[_0x0403('0x3b')]['fields']));_0x370b21[_0x0403('0x3e')]=_0x370b21[_0x0403('0x3e')][_0x0403('0x41')]?_0x370b21['attributes']:_0x11cc27['model'];if(_0x4113aa['query'][_0x0403('0x4a')]){_0x370b21[_0x0403('0x4b')]=[{'all':!![]}];}_0x370b21=_[_0x0403('0x48')]({},_0x370b21,_0x4113aa[_0x0403('0x49')]);return db[_0x0403('0x36')][_0x0403('0x2f')](_0x370b21)[_0x0403('0x25')](handleEntityNotFound(_0x2cfaf7,null))['then'](function(_0x50074d){if(_0x50074d){var _0x4ecca5=_0x50074d[_0x0403('0x26')]({'plain':!![]});_0x4ecca5=qs['omit'](_0x4ecca5,['id',_0x0403('0x5b'),_0x0403('0x5c')]);_0x4113aa[_0x0403('0x52')]=_[_0x0403('0x5d')](_0x4113aa[_0x0403('0x52')],['id',_0x0403('0x5b'),'updatedAt']);return db[_0x0403('0x36')]['create'](_['merge'](_0x4ecca5,_0x4113aa['body']),{'include':_0x4113aa[_0x0403('0x3b')][_0x0403('0x4a')]?[{'all':!![]}]:undefined})[_0x0403('0x25')](function(_0x145dc1){var _0x59f0a3=_0x4113aa[_0x0403('0x53')][_0x0403('0x26')]({'plain':!![]});if(!_0x59f0a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59f0a3[_0x0403('0x55')]==='user'){var _0x2ca87a=_0x145dc1[_0x0403('0x26')]({'plain':!![]});var _0xc39d9c=[{'name':_0x0403('0x27'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x0403('0x2a')}];var _0x54fd51=_[_0x0403('0x2f')](_0xc39d9c,[_0x0403('0x2d'),_0x2ca87a[_0x0403('0x2e')]])[_0x0403('0x33')];return db[_0x0403('0x56')]['find']({'where':{'name':_0x54fd51,'userProfileId':_0x59f0a3[_0x0403('0x57')]},'raw':!![]})[_0x0403('0x25')](function(_0x3ed111){if(_0x3ed111&&_0x3ed111[_0x0403('0x58')]===0x0){return db[_0x0403('0x30')][_0x0403('0x51')]({'name':_0x2ca87a[_0x0403('0x33')],'resourceId':_0x2ca87a['id'],'type':_0x3ed111[_0x0403('0x33')],'sectionId':_0x3ed111['id']},{})['then'](function(){return _0x145dc1;});}else{return _0x145dc1;}})[_0x0403('0x4e')](function(_0x13403c){logger[_0x0403('0x32')](_0x0403('0x59'),_0x13403c);throw _0x13403c;});}return _0x145dc1;});}})[_0x0403('0x25')](respondWithResult(_0x2cfaf7,0xc9))[_0x0403('0x4e')](handleError(_0x2cfaf7,null));};exports['update']=function(_0x478469,_0x1e91cf){if(_0x478469['body']['id']){delete _0x478469[_0x0403('0x52')]['id'];}return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x478469[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x1e91cf,null))['then'](saveUpdates(_0x478469[_0x0403('0x52')],null))['then'](respondWithResult(_0x1e91cf,null))['catch'](handleError(_0x1e91cf,null));};exports['destroy']=function(_0x2b5bfb,_0x2045f2){return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x2b5bfb[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x2045f2,null))['then'](removeEntity(_0x2045f2,null))[_0x0403('0x4e')](handleError(_0x2045f2,null));};exports['getHoppers']=function(_0x4db348,_0x17881c,_0x37f746){var _0x3d9ec9={'raw':![],'where':{}};var _0x418698={};var _0xcb0071={'count':0x0,'rows':[]};return db[_0x0403('0x36')][_0x0403('0x5e')]({'where':{'id':_0x4db348['params']['id']}})['then'](handleEntityNotFound(_0x17881c,null))[_0x0403('0x25')](function(_0x3f0208){if(_0x3f0208){_0x418698[_0x0403('0x3a')]=_['keys'](db['CmHopper'][_0x0403('0x37')]);_0x418698['query']=_[_0x0403('0x3c')](_0x4db348['query']);_0x418698[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x418698[_0x0403('0x3a')],_0x418698[_0x0403('0x3b')]);_0x3d9ec9[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x418698[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x4db348['query']['fields']));_0x3d9ec9['attributes']=_0x3d9ec9['attributes'][_0x0403('0x41')]?_0x3d9ec9[_0x0403('0x3e')]:_0x418698['model'];if(!_0x4db348['query'][_0x0403('0x42')](_0x0403('0x43'))){_0x3d9ec9[_0x0403('0x1f')]=qs['limit'](_0x4db348[_0x0403('0x3b')]['limit']);_0x3d9ec9['offset']=qs[_0x0403('0x1e')](_0x4db348[_0x0403('0x3b')]['offset']);}_0x3d9ec9[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x4db348['query']['sort']);_0x3d9ec9['where']=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x4db348[_0x0403('0x3b')],_0x418698[_0x0403('0x3d')]));_0x3d9ec9[_0x0403('0x46')]['VoiceQueueId']=_0x3f0208['id'];if(_0x4db348[_0x0403('0x3b')]['filter']){_0x3d9ec9[_0x0403('0x46')]=_[_0x0403('0x48')](_0x3d9ec9[_0x0403('0x46')],{'$or':_['map'](_0x3d9ec9[_0x0403('0x3e')],function(_0x4c4c52){var _0x8f7989={};_0x8f7989[_0x4c4c52]={'$like':'%'+_0x4db348[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0x8f7989;})});}_0x3d9ec9=_[_0x0403('0x48')]({},_0x3d9ec9,_0x4db348[_0x0403('0x49')]);return db['CmHopper'][_0x0403('0x1d')]({'where':_0x3d9ec9[_0x0403('0x46')]})['then'](function(_0x51994b){_0xcb0071[_0x0403('0x1d')]=_0x51994b;if(_0x4db348['query'][_0x0403('0x4a')]){_0x3d9ec9[_0x0403('0x4b')]=[{'all':!![]}];}return db[_0x0403('0x60')][_0x0403('0x4c')](_0x3d9ec9);})['then'](function(_0x48fd53){_0xcb0071['rows']=_0x48fd53;return _0xcb0071;});}})['then'](respondWithFilteredResult(_0x17881c,_0x3d9ec9))[_0x0403('0x4e')](handleError(_0x17881c,null));};exports[_0x0403('0x61')]=function(_0x383098,_0x3ef256,_0x1ebdb0){var _0x1ed2f6={'raw':!![],'where':{}};var _0x5de85c={};var _0x350ff3={'count':0x0,'rows':[]};return db[_0x0403('0x36')][_0x0403('0x5e')]({'where':{'id':_0x383098[_0x0403('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ef256,null))[_0x0403('0x25')](function(_0x19f609){if(_0x19f609){_0x5de85c[_0x0403('0x3a')]=_['keys'](db['CmHopperHistory'][_0x0403('0x37')]);_0x5de85c['query']=_[_0x0403('0x3c')](_0x383098['query']);_0x5de85c[_0x0403('0x3d')]=_['intersection'](_0x5de85c['model'],_0x5de85c[_0x0403('0x3b')]);_0x1ed2f6[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x5de85c[_0x0403('0x3a')],qs['fields'](_0x383098[_0x0403('0x3b')][_0x0403('0x40')]));_0x1ed2f6[_0x0403('0x3e')]=_0x1ed2f6[_0x0403('0x3e')][_0x0403('0x41')]?_0x1ed2f6[_0x0403('0x3e')]:_0x5de85c[_0x0403('0x3a')];if(!_0x383098[_0x0403('0x3b')][_0x0403('0x42')](_0x0403('0x43'))){_0x1ed2f6['limit']=qs['limit'](_0x383098['query']['limit']);_0x1ed2f6[_0x0403('0x1e')]=qs['offset'](_0x383098['query']['offset']);}_0x1ed2f6[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x383098[_0x0403('0x3b')][_0x0403('0x45')]);_0x1ed2f6[_0x0403('0x46')]=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x383098[_0x0403('0x3b')],_0x5de85c[_0x0403('0x3d')]));_0x1ed2f6[_0x0403('0x46')][_0x0403('0x62')]=_0x19f609['id'];if(_0x383098[_0x0403('0x3b')][_0x0403('0x2b')]){_0x1ed2f6[_0x0403('0x46')]=_['merge'](_0x1ed2f6[_0x0403('0x46')],{'$or':_['map'](_0x1ed2f6[_0x0403('0x3e')],function(_0x271961){var _0x46df25={};_0x46df25[_0x271961]={'$like':'%'+_0x383098[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0x46df25;})});}_0x1ed2f6=_[_0x0403('0x48')]({},_0x1ed2f6,_0x383098[_0x0403('0x49')]);return db[_0x0403('0x63')][_0x0403('0x1d')]({'where':_0x1ed2f6[_0x0403('0x46')]})[_0x0403('0x25')](function(_0x9b31fa){_0x350ff3[_0x0403('0x1d')]=_0x9b31fa;if(_0x383098[_0x0403('0x3b')]['includeAll']){_0x1ed2f6['include']=[{'all':!![]}];}return db[_0x0403('0x63')][_0x0403('0x4c')](_0x1ed2f6);})[_0x0403('0x25')](function(_0x3bdd1a){_0x350ff3[_0x0403('0x4d')]=_0x3bdd1a;return _0x350ff3;});}})[_0x0403('0x25')](respondWithFilteredResult(_0x3ef256,_0x1ed2f6))['catch'](handleError(_0x3ef256,null));};exports[_0x0403('0x64')]=function(_0x1f9a63,_0x12fef4,_0x4e2a78){var _0xd769d8={'raw':!![],'where':{}};var _0x2f1f58={};var _0x12c4d4={'count':0x0,'rows':[]};return db[_0x0403('0x36')][_0x0403('0x5e')]({'where':{'id':_0x1f9a63[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x12fef4,null))[_0x0403('0x25')](function(_0x47c965){if(_0x47c965){_0x2f1f58[_0x0403('0x3a')]=_['keys'](db[_0x0403('0x65')][_0x0403('0x37')]);_0x2f1f58[_0x0403('0x3b')]=_[_0x0403('0x3c')](_0x1f9a63[_0x0403('0x3b')]);_0x2f1f58[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x2f1f58[_0x0403('0x3a')],_0x2f1f58['query']);_0xd769d8[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x2f1f58['model'],qs[_0x0403('0x40')](_0x1f9a63[_0x0403('0x3b')]['fields']));_0xd769d8[_0x0403('0x3e')]=_0xd769d8['attributes'][_0x0403('0x41')]?_0xd769d8['attributes']:_0x2f1f58[_0x0403('0x3a')];if(!_0x1f9a63[_0x0403('0x3b')][_0x0403('0x42')]('nolimit')){_0xd769d8['limit']=qs[_0x0403('0x1f')](_0x1f9a63[_0x0403('0x3b')][_0x0403('0x1f')]);_0xd769d8[_0x0403('0x1e')]=qs[_0x0403('0x1e')](_0x1f9a63[_0x0403('0x3b')][_0x0403('0x1e')]);}_0xd769d8[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x1f9a63['query'][_0x0403('0x45')]);_0xd769d8['where']=qs['filters'](_[_0x0403('0x5f')](_0x1f9a63[_0x0403('0x3b')],_0x2f1f58[_0x0403('0x3d')]));_0xd769d8[_0x0403('0x46')][_0x0403('0x62')]=_0x47c965['id'];if(_0x1f9a63['query']['filter']){_0xd769d8[_0x0403('0x46')]=_[_0x0403('0x48')](_0xd769d8[_0x0403('0x46')],{'$or':_[_0x0403('0x35')](_0xd769d8['attributes'],function(_0x508cdf){var _0x40677c={};_0x40677c[_0x508cdf]={'$like':'%'+_0x1f9a63[_0x0403('0x3b')]['filter']+'%'};return _0x40677c;})});}_0xd769d8=_[_0x0403('0x48')]({},_0xd769d8,_0x1f9a63[_0x0403('0x49')]);return db[_0x0403('0x65')][_0x0403('0x1d')]({'where':_0xd769d8[_0x0403('0x46')]})[_0x0403('0x25')](function(_0xa9cbba){_0x12c4d4[_0x0403('0x1d')]=_0xa9cbba;if(_0x1f9a63[_0x0403('0x3b')][_0x0403('0x4a')]){_0xd769d8[_0x0403('0x4b')]=[{'all':!![]}];}return db[_0x0403('0x65')][_0x0403('0x4c')](_0xd769d8);})[_0x0403('0x25')](function(_0x30a3e2){_0x12c4d4['rows']=_0x30a3e2;return _0x12c4d4;});}})[_0x0403('0x25')](respondWithFilteredResult(_0x12fef4,_0xd769d8))[_0x0403('0x4e')](handleError(_0x12fef4,null));};exports[_0x0403('0x66')]=function(_0x11ddc9,_0x3ec3fb,_0x1042a2){var _0x2056f4={'raw':!![],'where':{}};var _0x9e0ea3={};var _0x57e5e8={'count':0x0,'rows':[]};return db[_0x0403('0x36')][_0x0403('0x5e')]({'where':{'id':_0x11ddc9[_0x0403('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ec3fb,null))[_0x0403('0x25')](function(_0x1163dd){if(_0x1163dd){_0x9e0ea3[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x67')][_0x0403('0x37')]);_0x9e0ea3[_0x0403('0x3b')]=_['keys'](_0x11ddc9[_0x0403('0x3b')]);_0x9e0ea3['filters']=_[_0x0403('0x3f')](_0x9e0ea3[_0x0403('0x3a')],_0x9e0ea3[_0x0403('0x3b')]);_0x2056f4[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x9e0ea3['model'],qs['fields'](_0x11ddc9[_0x0403('0x3b')]['fields']));_0x2056f4[_0x0403('0x3e')]=_0x2056f4['attributes'][_0x0403('0x41')]?_0x2056f4[_0x0403('0x3e')]:_0x9e0ea3[_0x0403('0x3a')];if(!_0x11ddc9[_0x0403('0x3b')][_0x0403('0x42')]('nolimit')){_0x2056f4[_0x0403('0x1f')]=qs['limit'](_0x11ddc9[_0x0403('0x3b')][_0x0403('0x1f')]);_0x2056f4[_0x0403('0x1e')]=qs['offset'](_0x11ddc9[_0x0403('0x3b')][_0x0403('0x1e')]);}_0x2056f4[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x11ddc9[_0x0403('0x3b')]['sort']);_0x2056f4[_0x0403('0x46')]=qs['filters'](_[_0x0403('0x5f')](_0x11ddc9[_0x0403('0x3b')],_0x9e0ea3[_0x0403('0x3d')]));_0x2056f4[_0x0403('0x46')][_0x0403('0x62')]=_0x1163dd['id'];if(_0x11ddc9[_0x0403('0x3b')][_0x0403('0x2b')]){_0x2056f4[_0x0403('0x46')]=_['merge'](_0x2056f4['where'],{'$or':_[_0x0403('0x35')](_0x2056f4[_0x0403('0x3e')],function(_0x19ac3a){var _0xda82a7={};_0xda82a7[_0x19ac3a]={'$like':'%'+_0x11ddc9[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0xda82a7;})});}_0x2056f4=_[_0x0403('0x48')]({},_0x2056f4,_0x11ddc9[_0x0403('0x49')]);return db['CmHopperBlack'][_0x0403('0x1d')]({'where':_0x2056f4['where']})[_0x0403('0x25')](function(_0xaa2e8e){_0x57e5e8['count']=_0xaa2e8e;if(_0x11ddc9[_0x0403('0x3b')][_0x0403('0x4a')]){_0x2056f4[_0x0403('0x4b')]=[{'all':!![]}];}return db[_0x0403('0x67')][_0x0403('0x4c')](_0x2056f4);})[_0x0403('0x25')](function(_0x413c1e){_0x57e5e8[_0x0403('0x4d')]=_0x413c1e;return _0x57e5e8;});}})['then'](respondWithFilteredResult(_0x3ec3fb,_0x2056f4))[_0x0403('0x4e')](handleError(_0x3ec3fb,null));};exports['getTeams']=function(_0x585d72,_0x5a21cb,_0x48eaa2){var _0x29397d={};var _0x52a0c1={};var _0xa31622;var _0x3a06b6;return db[_0x0403('0x36')][_0x0403('0x5e')]({'where':{'id':_0x585d72[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x5a21cb,null))[_0x0403('0x25')](function(_0x15e6e7){if(_0x15e6e7){_0xa31622=_0x15e6e7;_0x52a0c1[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x68')]['rawAttributes']);_0x52a0c1[_0x0403('0x3b')]=_[_0x0403('0x3c')](_0x585d72['query']);_0x52a0c1[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x52a0c1[_0x0403('0x3a')],_0x52a0c1['query']);_0x29397d['attributes']=_[_0x0403('0x3f')](_0x52a0c1[_0x0403('0x3a')],qs['fields'](_0x585d72[_0x0403('0x3b')][_0x0403('0x40')]));_0x29397d['attributes']=_0x29397d[_0x0403('0x3e')]['length']?_0x29397d[_0x0403('0x3e')]:_0x52a0c1[_0x0403('0x3a')];_0x29397d[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x585d72['query'][_0x0403('0x45')]);_0x29397d[_0x0403('0x46')]=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x585d72['query'],_0x52a0c1['filters']));if(_0x585d72[_0x0403('0x3b')][_0x0403('0x2b')]){_0x29397d[_0x0403('0x46')]=_[_0x0403('0x48')](_0x29397d['where'],{'$or':_[_0x0403('0x35')](_0x29397d[_0x0403('0x3e')],function(_0x5875fb){var _0x50fe8b={};_0x50fe8b[_0x5875fb]={'$like':'%'+_0x585d72['query'][_0x0403('0x2b')]+'%'};return _0x50fe8b;})});}_0x29397d=_[_0x0403('0x48')]({},_0x29397d,_0x585d72[_0x0403('0x49')]);return _0xa31622['getTeams'](_0x29397d);}})[_0x0403('0x25')](function(_0x536fb5){if(_0x536fb5){_0x3a06b6=_0x536fb5[_0x0403('0x41')];if(!_0x585d72[_0x0403('0x3b')][_0x0403('0x42')]('nolimit')){_0x29397d[_0x0403('0x1f')]=qs[_0x0403('0x1f')](_0x585d72['query'][_0x0403('0x1f')]);_0x29397d[_0x0403('0x1e')]=qs['offset'](_0x585d72[_0x0403('0x3b')][_0x0403('0x1e')]);}return _0xa31622[_0x0403('0x69')](_0x29397d);}})['then'](function(_0x247504){if(_0x247504){return _0x247504?{'count':_0x3a06b6,'rows':_0x247504}:null;}})['then'](respondWithResult(_0x5a21cb,null))['catch'](handleError(_0x5a21cb,null));};exports['addTeams']=function(_0x34b6f1,_0x49ddd0,_0x557bc6){var _0x303cf9=_0x34b6f1[_0x0403('0x52')][_0x0403('0x6a')];var _0x54cd66=_['map'](_0x303cf9,'id');return db[_0x0403('0x68')][_0x0403('0x4c')]({'where':{'id':_0x54cd66},'attributes':['id'],'include':[{'model':db[_0x0403('0x6b')],'as':'Agents','attributes':['id',_0x0403('0x33'),'online',_0x0403('0x6c'),_0x0403('0x6d')],'raw':!![]}]})[_0x0403('0x25')](function(_0x2a4fc7){if(_0x2a4fc7){var _0x5ae4fe=_[_0x0403('0x6e')](_0x2a4fc7,function(_0x199aac){var _0x406655=_0x199aac[_0x0403('0x26')]({'plain':!![]});_0x406655[_0x0403('0x6f')][_0x0403('0x70')](function(_0x4e8234){_0x4e8234[_0x0403('0x71')]=_[_0x0403('0x2f')](_0x303cf9,{'id':_0x406655['id']})[_0x0403('0x71')];});return _0x406655[_0x0403('0x6f')];});return db[_0x0403('0x36')]['find']({'where':{'id':_0x34b6f1[_0x0403('0x50')]['id']}})[_0x0403('0x25')](function(_0x458744){return db[_0x0403('0x72')]['transaction'](function(_0x4102d6){return _0x458744['addTeams'](_0x54cd66,{'transaction':_0x4102d6})[_0x0403('0x25')](function(){return BPromise[_0x0403('0x73')](_0x303cf9,function(_0x1d8f6a){return db[_0x0403('0x74')][_0x0403('0x75')]({'TeamId':_0x1d8f6a['id'],'VoiceQueueId':_0x34b6f1[_0x0403('0x50')]['id'],'penalty':_0x1d8f6a[_0x0403('0x71')]},{'transaction':_0x4102d6});});})['then'](function(){return BPromise[_0x0403('0x73')](_0x5ae4fe,function(_0x379b7a){return db[_0x0403('0x76')][_0x0403('0x77')]({'where':{'UserId':_0x379b7a['id'],'VoiceQueueId':_0x34b6f1[_0x0403('0x50')]['id']},'defaults':{'penalty':_0x379b7a[_0x0403('0x71')]},'transaction':_0x4102d6});});})[_0x0403('0x25')](function(){return BPromise[_0x0403('0x73')](_[_0x0403('0x2b')](_0x5ae4fe,{'online':!![]}),function(_0x4b1cb8){return db[_0x0403('0x78')][_0x0403('0x75')]({'membername':_0x4b1cb8['name'],'UserId':_0x4b1cb8['id'],'queue_name':_0x458744[_0x0403('0x33')],'VoiceQueueId':_0x458744['id'],'interface':_[_0x0403('0x79')](_0x4b1cb8['interface'])?util[_0x0403('0x7a')]('SIP/%s',_0x4b1cb8[_0x0403('0x33')]):_0x4b1cb8[_0x0403('0x6d')],'paused':_0x4b1cb8[_0x0403('0x6c')]||![],'penalty':_0x4b1cb8['penalty']},{'transaction':_0x4102d6});});})[_0x0403('0x25')](function(){_0x5ae4fe['forEach'](function(_0x4c52a7){socket[_0x0403('0x7b')](_0x0403('0x7c'),{'UserId':_0x4c52a7['id'],'VoiceQueueId':_0x458744['id']});});});});});}})[_0x0403('0x25')](respondWithStatusCode(_0x49ddd0,null))[_0x0403('0x4e')](handleError(_0x49ddd0,null));};exports['removeTeams']=function(_0x35a32f,_0xb174d5,_0x28b855){return db[_0x0403('0x68')][_0x0403('0x4c')]({'where':{'id':_0x35a32f[_0x0403('0x3b')][_0x0403('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x0403('0x6b')],'as':_0x0403('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x0403('0x25')](handleEntityNotFound(_0xb174d5,null))[_0x0403('0x25')](function(_0x4567ad){var _0x3b3051=_[_0x0403('0x35')](_0x4567ad,'id');var _0x34744f=[];var _0x2edbb0=[];var _0xc1881d=squel[_0x0403('0x7e')]();_0xc1881d['field'](_0x0403('0x7f'))[_0x0403('0x80')](_0x0403('0x81'),'tq')[_0x0403('0x82')]('user_has_teams','ut',_0x0403('0x83'))['where'](_0x0403('0x84'),_0x35a32f[_0x0403('0x50')]['id']);for(var _0x4ac566=0x0;_0x4ac566<_0x4567ad[_0x0403('0x41')];_0x4ac566+=0x1){let _0x2ac914=_0x4567ad[_0x4ac566];for(var _0xd2e0b5=0x0;_0xd2e0b5<_0x2ac914[_0x0403('0x6f')][_0x0403('0x41')];_0xd2e0b5+=0x1){let _0x5d98d1=_0x2ac914[_0x0403('0x6f')][_0xd2e0b5];var _0x5391d5=_0xc1881d[_0x0403('0x5a')]();_0x5391d5[_0x0403('0x46')](_0x0403('0x85'),_0x5d98d1['id']);_0x2edbb0[_0x0403('0x86')](db[_0x0403('0x72')][_0x0403('0x3b')](_0x5391d5[_0x0403('0x87')](),{'type':db[_0x0403('0x72')][_0x0403('0x88')][_0x0403('0x89')]})[_0x0403('0x25')](function(_0x2270aa){if(_0x2270aa[_0x0403('0x41')]===0x1){return _0x5d98d1['id'];}else{var _0x24954d=_[_0x0403('0x8a')](_['map'](_0x2270aa,_0x0403('0x8b')),function(_0x3662f4){return _[_0x0403('0x8c')](_0x3b3051,_0x3662f4);});if(_0x24954d){return _0x5d98d1['id'];}}}));}}return BPromise[_0x0403('0x8d')](_0x2edbb0)[_0x0403('0x25')](function(_0x3c8ac2){_0x34744f=_(_0x34744f)['union'](_0x3c8ac2)['compact']()[_0x0403('0x2d')]();return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x35a32f['params']['id']}})[_0x0403('0x25')](function(_0x3e15b8){return db[_0x0403('0x72')][_0x0403('0x8e')](function(_0x28c9a3){return _0x3e15b8[_0x0403('0x8f')](_0x35a32f['query'][_0x0403('0x7d')],{'transaction':_0x28c9a3})['then'](function(){if(!_[_0x0403('0x90')](_0x34744f)){return _0x3e15b8[_0x0403('0x91')](_0x34744f,{'transaction':_0x28c9a3})['then'](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x35a32f[_0x0403('0x50')]['id'],'UserId':_0x34744f},'transaction':_0x28c9a3});});}})['then'](function(){_0x34744f[_0x0403('0x70')](function(_0x440cbe){socket[_0x0403('0x7b')](_0x0403('0x92'),{'UserId':_0x440cbe,'VoiceQueueId':_0x3e15b8['id']});});});});});});})[_0x0403('0x25')](respondWithStatusCode(_0xb174d5,null))['catch'](handleError(_0xb174d5,null));};exports[_0x0403('0x93')]=function(_0x25c086,_0x59ad62,_0x4f5515){var _0x150b1b,_0x447f83;return db[_0x0403('0x36')]['find']({'where':{'id':_0x25c086[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x59ad62,null))[_0x0403('0x25')](function(_0x88679f){if(_0x88679f){_0x447f83=_0x88679f;return _0x88679f[_0x0403('0x93')](_0x25c086[_0x0403('0x52')][_0x0403('0x7d')],_['omit'](_0x25c086[_0x0403('0x52')],[_0x0403('0x7d'),'id'])||{})[_0x0403('0x94')](function(_0x55b97b){for(var _0x178f47=0x0;_0x178f47<_0x25c086[_0x0403('0x52')][_0x0403('0x7d')][_0x0403('0x41')];_0x178f47+=0x1){socket['emit'](_0x0403('0x7c'),{'UserId':Number(_0x25c086[_0x0403('0x52')]['ids'][_0x178f47]),'VoiceQueueId':Number(_0x25c086[_0x0403('0x50')]['id'])});}return _0x55b97b;});}})[_0x0403('0x25')](function(_0x410789){_0x150b1b=_0x410789||[];if(_0x447f83){return db[_0x0403('0x6b')][_0x0403('0x4c')]({'where':{'id':_0x25c086['body']['ids']},'attributes':['id',_0x0403('0x33'),_0x0403('0x95'),_0x0403('0x6c'),_0x0403('0x6d')],'raw':!![]});}})[_0x0403('0x25')](function(_0x12e1bd){if(!_['isEmpty'](_0x12e1bd)){var _0x4ed658=[];for(var _0x8fa49b=0x0;_0x8fa49b<_0x12e1bd[_0x0403('0x41')];_0x8fa49b++){if(_0x12e1bd[_0x8fa49b][_0x0403('0x95')]){_0x4ed658['push'](db['UserVoiceQueueRt'][_0x0403('0x75')]({'membername':_0x12e1bd[_0x8fa49b][_0x0403('0x33')],'UserId':_0x12e1bd[_0x8fa49b]['id'],'queue_name':_0x447f83[_0x0403('0x33')],'VoiceQueueId':_0x447f83['id'],'interface':_[_0x0403('0x79')](_0x12e1bd[_0x8fa49b][_0x0403('0x6d')])?util[_0x0403('0x7a')](_0x0403('0x96'),_0x12e1bd[_0x8fa49b][_0x0403('0x33')]):_0x12e1bd[_0x8fa49b]['interface'],'paused':_0x12e1bd[_0x8fa49b][_0x0403('0x6c')]||![],'penalty':_0x25c086[_0x0403('0x52')][_0x0403('0x71')]||0x0}));}}return BPromise[_0x0403('0x8d')](_0x4ed658);}})[_0x0403('0x25')](function(){return _0x150b1b;})['then'](respondWithResult(_0x59ad62,null))['catch'](handleError(_0x59ad62,null));};exports[_0x0403('0x91')]=function(_0x3310a4,_0x243459,_0x5c9e0c){return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x3310a4[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x243459,null))[_0x0403('0x25')](function(_0x51369f){if(_0x51369f){return _0x51369f['removeAgents'](_0x3310a4[_0x0403('0x3b')]['ids'])[_0x0403('0x25')](function(){if(_['isArray'](_0x3310a4[_0x0403('0x3b')][_0x0403('0x7d')])){for(var _0x5b6943=0x0;_0x5b6943<_0x3310a4['query'][_0x0403('0x7d')][_0x0403('0x41')];_0x5b6943+=0x1){socket[_0x0403('0x7b')]('userVoiceQueue:remove',{'UserId':Number(_0x3310a4[_0x0403('0x3b')][_0x0403('0x7d')][_0x5b6943]),'VoiceQueueId':Number(_0x3310a4[_0x0403('0x50')]['id'])});}}else{socket[_0x0403('0x7b')](_0x0403('0x92'),{'UserId':Number(_0x3310a4[_0x0403('0x3b')]['ids']),'VoiceQueueId':Number(_0x3310a4[_0x0403('0x50')]['id'])});}});}})['then'](function(_0x205d40){return db[_0x0403('0x78')][_0x0403('0x24')]({'where':{'VoiceQueueId':_0x3310a4['params']['id'],'UserId':_0x3310a4[_0x0403('0x3b')]['ids']}})[_0x0403('0x25')](function(){return _0x205d40;});})[_0x0403('0x25')](respondWithStatusCode(_0x243459,null))[_0x0403('0x4e')](handleError(_0x243459,null));};exports['getAgents']=function(_0x27a849,_0x30ebbd,_0x4ea724){var _0x12b6c9={};var _0x3f93f3={};var _0x182dde;var _0xad5cdd;return db['VoiceQueue']['findOne']({'where':{'id':_0x27a849[_0x0403('0x50')]['id']}})['then'](handleEntityNotFound(_0x30ebbd,null))[_0x0403('0x25')](function(_0x13b3f4){if(_0x13b3f4){_0x182dde=_0x13b3f4;_0x3f93f3[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x6b')][_0x0403('0x37')]);_0x3f93f3[_0x0403('0x3b')]=_[_0x0403('0x3c')](_0x27a849[_0x0403('0x3b')]);_0x3f93f3[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x3f93f3[_0x0403('0x3a')],_0x3f93f3['query']);_0x12b6c9[_0x0403('0x3e')]=_['intersection'](_0x3f93f3[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x27a849[_0x0403('0x3b')]['fields']));_0x12b6c9[_0x0403('0x3e')]=_0x12b6c9[_0x0403('0x3e')][_0x0403('0x41')]?_0x12b6c9[_0x0403('0x3e')]:_0x3f93f3[_0x0403('0x3a')];_0x12b6c9['order']=qs[_0x0403('0x45')](_0x27a849[_0x0403('0x3b')][_0x0403('0x45')]);_0x12b6c9[_0x0403('0x46')]=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x27a849[_0x0403('0x3b')],_0x3f93f3[_0x0403('0x3d')]));if(_0x27a849[_0x0403('0x3b')][_0x0403('0x2b')]){_0x12b6c9[_0x0403('0x46')]=_[_0x0403('0x48')](_0x12b6c9['where'],{'$or':_[_0x0403('0x35')](_0x12b6c9[_0x0403('0x3e')],function(_0x554839){var _0x5f4b88={};_0x5f4b88[_0x554839]={'$like':'%'+_0x27a849['query'][_0x0403('0x2b')]+'%'};return _0x5f4b88;})});}_0x12b6c9=_['merge']({},_0x12b6c9,_0x27a849[_0x0403('0x49')]);return _0x182dde[_0x0403('0x97')](_0x12b6c9);}})[_0x0403('0x25')](function(_0x2863f0){if(_0x2863f0){_0xad5cdd=_0x2863f0[_0x0403('0x41')];if(!_0x27a849['query'][_0x0403('0x42')]('nolimit')){_0x12b6c9['limit']=qs[_0x0403('0x1f')](_0x27a849[_0x0403('0x3b')][_0x0403('0x1f')]);_0x12b6c9[_0x0403('0x1e')]=qs['offset'](_0x27a849[_0x0403('0x3b')][_0x0403('0x1e')]);}return _0x182dde[_0x0403('0x97')](_0x12b6c9);}})[_0x0403('0x25')](function(_0x288013){if(_0x288013){return _0x288013?{'count':_0xad5cdd,'rows':_0x288013}:null;}})[_0x0403('0x25')](respondWithResult(_0x30ebbd,null))[_0x0403('0x4e')](handleError(_0x30ebbd,null));};exports['getMembers']=function(_0x3fadd5,_0x3ab907,_0x3cd47e){var _0x3bec8e={};var _0x1839fa={};var _0xe92ec4;var _0x88666e;return db['VoiceQueue'][_0x0403('0x5e')]({'where':{'id':_0x3fadd5['params']['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x3ab907,null))[_0x0403('0x25')](function(_0x50491b){if(_0x50491b){_0xe92ec4=_0x50491b;_0x1839fa[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x78')][_0x0403('0x37')]);_0x1839fa[_0x0403('0x3b')]=_['keys'](_0x3fadd5[_0x0403('0x3b')]);_0x1839fa['filters']=_['intersection'](_0x1839fa[_0x0403('0x3a')],_0x1839fa[_0x0403('0x3b')]);_0x3bec8e[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x1839fa[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x3fadd5[_0x0403('0x3b')][_0x0403('0x40')]));_0x3bec8e['attributes']=_0x3bec8e['attributes'][_0x0403('0x41')]?_0x3bec8e[_0x0403('0x3e')]:_0x1839fa[_0x0403('0x3a')];_0x3bec8e[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x3fadd5['query'][_0x0403('0x45')]);_0x3bec8e[_0x0403('0x46')]=qs['filters'](_[_0x0403('0x5f')](_0x3fadd5[_0x0403('0x3b')],_0x1839fa[_0x0403('0x3d')]));if(_0x3fadd5[_0x0403('0x3b')]['filter']){_0x3bec8e[_0x0403('0x46')]=_[_0x0403('0x48')](_0x3bec8e['where'],{'$or':_['map'](_0x3bec8e[_0x0403('0x3e')],function(_0x1decd9){var _0x462575={};_0x462575[_0x1decd9]={'$like':'%'+_0x3fadd5[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0x462575;})});}_0x3bec8e=_[_0x0403('0x48')]({},_0x3bec8e,_0x3fadd5['options']);return _0xe92ec4['getMembers'](_0x3bec8e);}})[_0x0403('0x25')](function(_0x18c817){if(_0x18c817){_0x88666e=_0x18c817['length'];if(!_0x3fadd5[_0x0403('0x3b')][_0x0403('0x42')]('nolimit')){_0x3bec8e[_0x0403('0x1f')]=qs['limit'](_0x3fadd5[_0x0403('0x3b')][_0x0403('0x1f')]);_0x3bec8e['offset']=qs['offset'](_0x3fadd5[_0x0403('0x3b')][_0x0403('0x1e')]);}return _0xe92ec4[_0x0403('0x98')](_0x3bec8e);}})[_0x0403('0x25')](function(_0x3e9673){return _0x3e9673?{'count':_0x88666e,'rows':_0x3e9673}:null;})[_0x0403('0x25')](respondWithResult(_0x3ab907,null))['catch'](handleError(_0x3ab907,null));};exports[_0x0403('0x99')]=function(_0x511359,_0x12b030,_0x56b006){var _0x3b28e5={};var _0x54553d={};var _0x152191;var _0x25acc3;return db['VoiceQueue'][_0x0403('0x5e')]({'where':{'id':_0x511359[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x12b030,null))[_0x0403('0x25')](function(_0x2e693e){if(_0x2e693e){_0x152191=_0x2e693e;_0x54553d[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x9a')][_0x0403('0x37')]);_0x54553d[_0x0403('0x3b')]=_['keys'](_0x511359[_0x0403('0x3b')]);_0x54553d[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x54553d['model'],_0x54553d[_0x0403('0x3b')]);_0x3b28e5[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x54553d[_0x0403('0x3a')],qs[_0x0403('0x40')](_0x511359[_0x0403('0x3b')]['fields']));_0x3b28e5[_0x0403('0x3e')]=_0x3b28e5[_0x0403('0x3e')][_0x0403('0x41')]?_0x3b28e5[_0x0403('0x3e')]:_0x54553d[_0x0403('0x3a')];_0x3b28e5[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x511359[_0x0403('0x3b')][_0x0403('0x45')]);_0x3b28e5[_0x0403('0x46')]=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x511359[_0x0403('0x3b')],_0x54553d[_0x0403('0x3d')]));if(_0x511359[_0x0403('0x3b')]['filter']){_0x3b28e5[_0x0403('0x46')]=_[_0x0403('0x48')](_0x3b28e5[_0x0403('0x46')],{'$or':_['map'](_0x3b28e5[_0x0403('0x3e')],function(_0x340fb7){var _0x1e0e2a={};_0x1e0e2a[_0x340fb7]={'$like':'%'+_0x511359[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0x1e0e2a;})});}_0x3b28e5=_[_0x0403('0x48')]({},_0x3b28e5,_0x511359[_0x0403('0x49')]);return _0x152191[_0x0403('0x99')](_0x3b28e5);}})[_0x0403('0x25')](function(_0x2dd1e3){if(_0x2dd1e3){_0x25acc3=_0x2dd1e3[_0x0403('0x41')];if(!_0x511359['query'][_0x0403('0x42')]('nolimit')){_0x3b28e5[_0x0403('0x1f')]=qs[_0x0403('0x1f')](_0x511359[_0x0403('0x3b')][_0x0403('0x1f')]);_0x3b28e5[_0x0403('0x1e')]=qs[_0x0403('0x1e')](_0x511359[_0x0403('0x3b')][_0x0403('0x1e')]);}return _0x152191[_0x0403('0x99')](_0x3b28e5);}})[_0x0403('0x25')](function(_0x30b2ad){if(_0x30b2ad){return _0x30b2ad?{'count':_0x25acc3,'rows':_0x30b2ad}:null;}})[_0x0403('0x25')](respondWithResult(_0x12b030,null))[_0x0403('0x4e')](handleError(_0x12b030,null));};exports[_0x0403('0x9b')]=function(_0x580929,_0x14a821,_0x2b3677){var _0x2c8ccf,_0x21e79e;return db['VoiceQueue'][_0x0403('0x2f')]({'where':{'id':_0x580929[_0x0403('0x50')]['id']}})['then'](handleEntityNotFound(_0x14a821,null))[_0x0403('0x25')](function(_0x254362){if(_0x254362){_0x21e79e=_0x254362;return _0x254362[_0x0403('0x9b')](_0x580929[_0x0403('0x52')]['ids'],_[_0x0403('0x5d')](_0x580929[_0x0403('0x52')],['ids','id'])||{});}return null;})[_0x0403('0x94')](function(_0x1ec444){var _0x539a28;_0x2c8ccf=_0x1ec444||[];var _0xcf2181=[];if(_0x1ec444){for(var _0x43f709=0x0;_0x43f709<_0x1ec444[_0x0403('0x41')];_0x43f709+=0x1){var _0x2bcb65=_0x1ec444[_0x43f709][_0x0403('0x26')]({'plain':!![]});_0x21e79e['dialCheckDuplicateType']=_0x580929[_0x0403('0x52')][_0x0403('0x9c')]?_0x580929[_0x0403('0x52')][_0x0403('0x9c')]:_0x21e79e['dialCheckDuplicateType'];switch(_0x21e79e['dialCheckDuplicateType']){case _0x0403('0x9d'):_0x539a28=squel[_0x0403('0x9e')]()['into'](_0x0403('0x9f'))['fromQuery'](['phone',_0x0403('0xa0'),'ContactId','ListId',_0x0403('0x62'),_0x0403('0x5b'),_0x0403('0x5c')],squel[_0x0403('0x7e')]()[_0x0403('0xa1')](_0x0403('0xa2'),_0x0403('0xa2'))['field']('NOW()',_0x0403('0xa0'))[_0x0403('0xa1')]('id',_0x0403('0xa3'))[_0x0403('0xa1')](_0x2bcb65[_0x0403('0xa4')][_0x0403('0x87')](),_0x0403('0xa5'))[_0x0403('0xa1')](_0x580929[_0x0403('0x50')]['id'][_0x0403('0x87')](),'VoiceQueueId')[_0x0403('0xa1')](_0x0403('0xa6'),_0x0403('0x5b'))['field']('NOW()','updatedAt')['from'](_0x0403('0xa7'))['where'](_0x0403('0xa8'))[_0x0403('0x46')](_0x0403('0xa9'),_0x2bcb65[_0x0403('0xa4')]['toString']())['where'](_0x0403('0xaa'))[_0x0403('0x46')](_0x0403('0xab'),squel['select']()[_0x0403('0xa1')](_0x0403('0xac'))[_0x0403('0x80')](_0x0403('0xad'))[_0x0403('0x46')](_0x0403('0x84'),_0x580929[_0x0403('0x50')]['id'][_0x0403('0x87')]()))[_0x0403('0x46')](_0x0403('0xab'),squel[_0x0403('0x7e')]()[_0x0403('0xa1')](_0x0403('0xae'))[_0x0403('0x80')](_0x0403('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0x580929[_0x0403('0x50')]['id'][_0x0403('0x87')]())))[_0x0403('0x87')]();break;case _0x0403('0xaf'):_0x539a28=squel[_0x0403('0x9e')]()[_0x0403('0xb0')](_0x0403('0x9f'))[_0x0403('0xb1')](['phone','scheduledAt',_0x0403('0xa3'),'ListId',_0x0403('0x62'),_0x0403('0x5b'),_0x0403('0x5c')],squel[_0x0403('0x7e')]()['field'](_0x0403('0xa2'),_0x0403('0xa2'))[_0x0403('0xa1')](_0x0403('0xa6'),'scheduledAt')[_0x0403('0xa1')]('id',_0x0403('0xa3'))[_0x0403('0xa1')](_0x2bcb65[_0x0403('0xa4')]['toString'](),_0x0403('0xa5'))[_0x0403('0xa1')](_0x580929[_0x0403('0x50')]['id']['toString'](),_0x0403('0x62'))[_0x0403('0xa1')](_0x0403('0xa6'),'createdAt')[_0x0403('0xa1')]('NOW()',_0x0403('0x5c'))[_0x0403('0x80')](_0x0403('0xa7'))[_0x0403('0x46')](_0x0403('0xa8'))[_0x0403('0x46')](_0x0403('0xa9'),_0x2bcb65[_0x0403('0xa4')][_0x0403('0x87')]())[_0x0403('0x46')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0403('0x7e')]()[_0x0403('0xa1')](_0x0403('0xae'))[_0x0403('0x80')]('cm_hopper')[_0x0403('0x46')](_0x0403('0x84'),_0x580929[_0x0403('0x50')]['id'][_0x0403('0x87')]())))[_0x0403('0x87')]();break;default:_0x539a28=squel['insert']()['into'](_0x0403('0x9f'))[_0x0403('0xb1')]([_0x0403('0xa2'),_0x0403('0xa0'),_0x0403('0xa3'),_0x0403('0xa5'),_0x0403('0x62'),_0x0403('0x5b'),_0x0403('0x5c')],squel['select']()[_0x0403('0xa1')](_0x0403('0xa2'),'phone')[_0x0403('0xa1')](_0x0403('0xa6'),_0x0403('0xa0'))[_0x0403('0xa1')]('id',_0x0403('0xa3'))[_0x0403('0xa1')](_0x2bcb65[_0x0403('0xa4')][_0x0403('0x87')](),'ListId')[_0x0403('0xa1')](_0x580929[_0x0403('0x50')]['id'][_0x0403('0x87')](),_0x0403('0x62'))[_0x0403('0xa1')]('NOW()',_0x0403('0x5b'))[_0x0403('0xa1')](_0x0403('0xa6'),_0x0403('0x5c'))['from'](_0x0403('0xa7'))[_0x0403('0x46')](_0x0403('0xa8'))[_0x0403('0x46')](_0x0403('0xa9'),_0x2bcb65[_0x0403('0xa4')][_0x0403('0x87')]())[_0x0403('0x46')](_0x0403('0xaa')))['toString']();}_0xcf2181[_0x0403('0x86')](db[_0x0403('0x72')][_0x0403('0x3b')](_0x539a28));}return BPromise[_0x0403('0x8d')](_0xcf2181);}})[_0x0403('0x25')](function(){return _0x2c8ccf;})[_0x0403('0x25')](respondWithResult(_0x14a821,null))[_0x0403('0x4e')](handleError(_0x14a821,null));};exports[_0x0403('0xb2')]=function(_0x22a83a,_0x56fe2c,_0x5d9fe9){return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x22a83a[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x56fe2c,null))[_0x0403('0x25')](function(_0x2a5e55){if(_0x2a5e55){return _0x2a5e55[_0x0403('0xb2')](_0x22a83a[_0x0403('0x3b')][_0x0403('0x7d')]);}})[_0x0403('0x25')](function(_0x135b34){if(_0x135b34){return db['CmHopper'][_0x0403('0x24')]({'where':{'ListId':_0x22a83a[_0x0403('0x3b')]['ids'],'VoiceQueueId':_0x22a83a['params']['id']}})[_0x0403('0x25')](function(){return _0x135b34;});}})[_0x0403('0x25')](respondWithStatusCode(_0x56fe2c,null))[_0x0403('0x4e')](handleError(_0x56fe2c,null));};exports[_0x0403('0xb3')]=function(_0x1191fb,_0x587e25,_0x41538c){var _0x2a7a6c={};var _0x4b5f2e={};var _0x295fb0;var _0x4577b2;return db['VoiceQueue'][_0x0403('0x5e')]({'where':{'id':_0x1191fb['params']['id']}})['then'](handleEntityNotFound(_0x587e25,null))[_0x0403('0x25')](function(_0x48f378){if(_0x48f378){_0x295fb0=_0x48f378;_0x4b5f2e[_0x0403('0x3a')]=_[_0x0403('0x3c')](db[_0x0403('0x9a')][_0x0403('0x37')]);_0x4b5f2e[_0x0403('0x3b')]=_['keys'](_0x1191fb['query']);_0x4b5f2e[_0x0403('0x3d')]=_[_0x0403('0x3f')](_0x4b5f2e[_0x0403('0x3a')],_0x4b5f2e[_0x0403('0x3b')]);_0x2a7a6c[_0x0403('0x3e')]=_[_0x0403('0x3f')](_0x4b5f2e['model'],qs[_0x0403('0x40')](_0x1191fb[_0x0403('0x3b')]['fields']));_0x2a7a6c['attributes']=_0x2a7a6c[_0x0403('0x3e')][_0x0403('0x41')]?_0x2a7a6c['attributes']:_0x4b5f2e[_0x0403('0x3a')];_0x2a7a6c[_0x0403('0x44')]=qs[_0x0403('0x45')](_0x1191fb['query'][_0x0403('0x45')]);_0x2a7a6c[_0x0403('0x46')]=qs[_0x0403('0x3d')](_[_0x0403('0x5f')](_0x1191fb[_0x0403('0x3b')],_0x4b5f2e[_0x0403('0x3d')]));if(_0x1191fb[_0x0403('0x3b')]['filter']){_0x2a7a6c[_0x0403('0x46')]=_[_0x0403('0x48')](_0x2a7a6c[_0x0403('0x46')],{'$or':_[_0x0403('0x35')](_0x2a7a6c[_0x0403('0x3e')],function(_0x42fdcf){var _0xde3bf={};_0xde3bf[_0x42fdcf]={'$like':'%'+_0x1191fb[_0x0403('0x3b')][_0x0403('0x2b')]+'%'};return _0xde3bf;})});}_0x2a7a6c=_['merge']({},_0x2a7a6c,_0x1191fb[_0x0403('0x49')]);return _0x295fb0[_0x0403('0xb3')](_0x2a7a6c);}})[_0x0403('0x25')](function(_0x2b1aaa){if(_0x2b1aaa){_0x4577b2=_0x2b1aaa['length'];if(!_0x1191fb[_0x0403('0x3b')][_0x0403('0x42')](_0x0403('0x43'))){_0x2a7a6c[_0x0403('0x1f')]=qs['limit'](_0x1191fb['query'][_0x0403('0x1f')]);_0x2a7a6c['offset']=qs[_0x0403('0x1e')](_0x1191fb['query'][_0x0403('0x1e')]);}return _0x295fb0['getBlackLists'](_0x2a7a6c);}})[_0x0403('0x25')](function(_0x5e9fcc){if(_0x5e9fcc){return _0x5e9fcc?{'count':_0x4577b2,'rows':_0x5e9fcc}:null;}})[_0x0403('0x25')](respondWithResult(_0x587e25,null))[_0x0403('0x4e')](handleError(_0x587e25,null));};exports[_0x0403('0xb4')]=function(_0x28b89e,_0x52ec7f,_0x1aac8){var _0x4ace21,_0x5f3bdb;return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x28b89e[_0x0403('0x50')]['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x52ec7f,null))[_0x0403('0x25')](function(_0x1f0c56){if(_0x1f0c56){_0x5f3bdb=_0x1f0c56;return _0x1f0c56['addBlackLists'](_0x28b89e[_0x0403('0x52')][_0x0403('0x7d')],_[_0x0403('0x5d')](_0x28b89e[_0x0403('0x52')],[_0x0403('0x7d'),'id'])||{});}return null;})[_0x0403('0x94')](function(_0x7f0cd){var _0x528fac;_0x4ace21=_0x7f0cd||[];var _0x111dcf=[];if(_0x7f0cd){for(var _0x318971=0x0;_0x318971<_0x7f0cd['length'];_0x318971+=0x1){var _0x4f442f=_0x7f0cd[_0x318971][_0x0403('0x26')]({'plain':!![]});_0x528fac=squel[_0x0403('0x9e')]()[_0x0403('0xb0')](_0x0403('0xb5'))[_0x0403('0xb1')](['phone','ContactId','ListId','VoiceQueueId',_0x0403('0x5b'),_0x0403('0x5c')],squel[_0x0403('0x7e')]()[_0x0403('0xa1')](_0x0403('0xa2'),_0x0403('0xa2'))[_0x0403('0xa1')]('id','ContactId')[_0x0403('0xa1')](_0x4f442f['CmListId'][_0x0403('0x87')](),_0x0403('0xa5'))[_0x0403('0xa1')](_0x28b89e[_0x0403('0x50')]['id'][_0x0403('0x87')](),_0x0403('0x62'))['field'](_0x0403('0xa6'),'createdAt')[_0x0403('0xa1')](_0x0403('0xa6'),_0x0403('0x5c'))['from'](_0x0403('0xa7'))[_0x0403('0x46')](_0x0403('0xa8'))['where'](_0x0403('0xa9'),_0x4f442f[_0x0403('0xa4')][_0x0403('0x87')]())[_0x0403('0x46')](_0x0403('0xaa')))[_0x0403('0x87')]();_0x111dcf[_0x0403('0x86')](db[_0x0403('0x72')][_0x0403('0x3b')](_0x528fac));}return BPromise['all'](_0x111dcf);}})[_0x0403('0x25')](function(){return _0x4ace21;})[_0x0403('0x25')](respondWithResult(_0x52ec7f,null))['catch'](handleError(_0x52ec7f,null));};exports[_0x0403('0xb6')]=function(_0x3dffe3,_0x499ed3,_0x572c8c){return db[_0x0403('0x36')][_0x0403('0x2f')]({'where':{'id':_0x3dffe3['params']['id']}})[_0x0403('0x25')](handleEntityNotFound(_0x499ed3,null))[_0x0403('0x25')](function(_0x527faa){if(_0x527faa){return _0x527faa[_0x0403('0xb6')](_0x3dffe3[_0x0403('0x3b')]['ids']);}})[_0x0403('0x25')](function(_0x58fef1){if(_0x58fef1){return db[_0x0403('0x67')][_0x0403('0x24')]({'where':{'ListId':_0x3dffe3[_0x0403('0x3b')]['ids'],'VoiceQueueId':_0x3dffe3[_0x0403('0x50')]['id']}})['then'](function(){return _0x58fef1;});}})[_0x0403('0x25')](respondWithStatusCode(_0x499ed3,null))['catch'](handleError(_0x499ed3,null));}; \ No newline at end of file +var _0x6f1f=['dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','VoiceQueue','includeAll','rows','show','params','fields','include','options','catch','create','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','findOne','CmHopper','VoiceQueueId','findAll','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','teams','Team','User','Agents','online','interface','flatMap','forEach','sequelize','addTeams','each','upsert','penalty','UserVoiceQueue','findOrCreate','isNil','SIP/%s','voicePause','emit','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','ids','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','userVoiceQueue:save','push','isArray','getAgents','getMembers','CmList','getLists','addLists','spread'];(function(_0x5432d7,_0x29c1de){var _0x29d6da=function(_0xc1167e){while(--_0xc1167e){_0x5432d7['push'](_0x5432d7['shift']());}};_0x29d6da(++_0x29c1de);}(_0x6f1f,0x183));var _0xf6f1=function(_0x2ac775,_0x49d10f){_0x2ac775=_0x2ac775-0x0;var _0x539e73=_0x6f1f[_0x2ac775];return _0x539e73;};'use strict';var emlformat=require(_0xf6f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6f1('0x1'));var jsonpatch=require(_0xf6f1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6f1('0x3'));var Mustache=require('mustache');var util=require(_0xf6f1('0x4'));var path=require(_0xf6f1('0x5'));var sox=require(_0xf6f1('0x6'));var csv=require(_0xf6f1('0x7'));var ejs=require(_0xf6f1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6f1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf6f1('0xa'));var deskjs=require(_0xf6f1('0xb'));var toCsv=require(_0xf6f1('0x7'));var querystring=require('querystring');var Papa=require(_0xf6f1('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf6f1('0xd'));var as=require(_0xf6f1('0xe'));var hardwareService=require(_0xf6f1('0xf'));var logger=require(_0xf6f1('0x10'))(_0xf6f1('0x11'));var utils=require(_0xf6f1('0x12'));var config=require(_0xf6f1('0x13'));var licenseUtil=require(_0xf6f1('0x14'));var db=require(_0xf6f1('0x15'))['db'];config[_0xf6f1('0x16')]=_[_0xf6f1('0x17')](config['redis'],{'host':_0xf6f1('0x18'),'port':0x18eb});var socket=require(_0xf6f1('0x19'))(new Redis(config[_0xf6f1('0x16')]));require('./voiceQueue.socket')[_0xf6f1('0x1a')](socket);function respondWithStatusCode(_0x770a09,_0x49f867){_0x49f867=_0x49f867||0xcc;return function(_0x5099f5){if(_0x5099f5){return _0x770a09['sendStatus'](_0x49f867);}return _0x770a09[_0xf6f1('0x1b')](_0x49f867)['end']();};}function respondWithResult(_0x5b0449,_0x4598dd){_0x4598dd=_0x4598dd||0xc8;return function(_0x59b9a7){if(_0x59b9a7){return _0x5b0449[_0xf6f1('0x1b')](_0x4598dd)['json'](_0x59b9a7);}};}function respondWithFilteredResult(_0x4605bd,_0x5a0905){return function(_0x5adb2c){if(_0x5adb2c){var _0x4dfeb9=typeof _0x5a0905[_0xf6f1('0x1c')]===_0xf6f1('0x1d')&&typeof _0x5a0905[_0xf6f1('0x1e')]==='undefined';var _0x2f5d8d=_0x5adb2c[_0xf6f1('0x1f')];var _0x24851c=_0x4dfeb9?0x0:_0x5a0905[_0xf6f1('0x1c')];var _0x46d5f2=_0x4dfeb9?_0x5adb2c['count']:_0x5a0905[_0xf6f1('0x1c')]+_0x5a0905[_0xf6f1('0x1e')];var _0x2726a;if(_0x46d5f2>=_0x2f5d8d){_0x46d5f2=_0x2f5d8d;_0x2726a=0xc8;}else{_0x2726a=0xce;}_0x4605bd['status'](_0x2726a);return _0x4605bd['set'](_0xf6f1('0x20'),_0x24851c+'-'+_0x46d5f2+'/'+_0x2f5d8d)['json'](_0x5adb2c);}return null;};}function patchUpdates(_0x4cad68){return function(_0x114ec){try{jsonpatch['apply'](_0x114ec,_0x4cad68,!![]);}catch(_0x4882f3){return BPromise[_0xf6f1('0x21')](_0x4882f3);}return _0x114ec[_0xf6f1('0x22')]();};}function saveUpdates(_0x1e2109,_0x44d0c2){return function(_0x24dbf2){if(_0x24dbf2){return _0x24dbf2[_0xf6f1('0x23')](_0x1e2109)[_0xf6f1('0x24')](function(_0x4b0719){return _0x4b0719;});}return null;};}function removeEntity(_0x53a503,_0x324af9){return function(_0xfb20b6){if(_0xfb20b6){return _0xfb20b6[_0xf6f1('0x25')]()[_0xf6f1('0x24')](function(){var _0x2b311b=_0xfb20b6['get']({'plain':!![]});var _0x14092c=[{'name':_0xf6f1('0x26'),'value':_0xf6f1('0x27'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf6f1('0x28'),'ignore':![]}];var _0x27340e=_(_0x14092c)[_0xf6f1('0x29')](_0xf6f1('0x2a'))[_0xf6f1('0x2b')](_0xf6f1('0x2c'))['value']();if(_[_0xf6f1('0x2d')](_0x27340e,_0x2b311b[_0xf6f1('0x2e')])){return;}var _0x139395=_[_0xf6f1('0x2f')](_0x14092c,[_0xf6f1('0x2c'),_0x2b311b['type']])[_0xf6f1('0x30')];return db[_0xf6f1('0x31')][_0xf6f1('0x25')]({'where':{'type':_0x139395,'resourceId':_0x2b311b['id']}})[_0xf6f1('0x24')](function(){return _0xfb20b6;});})[_0xf6f1('0x24')](function(){_0x53a503[_0xf6f1('0x1b')](0xcc)[_0xf6f1('0x32')]();});}};}function handleEntityNotFound(_0x20eab9,_0x54b92e){return function(_0x1ecfec){if(!_0x1ecfec){_0x20eab9[_0xf6f1('0x33')](0x194);}return _0x1ecfec;};}function handleError(_0x11b1b1,_0x5a21cb){_0x5a21cb=_0x5a21cb||0x1f4;return function(_0x580d1a){logger[_0xf6f1('0x34')](_0x580d1a[_0xf6f1('0x35')]);if(_0x580d1a['name']){delete _0x580d1a[_0xf6f1('0x30')];}_0x11b1b1[_0xf6f1('0x1b')](_0x5a21cb)[_0xf6f1('0x36')](_0x580d1a);};}exports[_0xf6f1('0x37')]=function(_0x5ade5,_0x2e4e62){var _0x1f77de={},_0x47f9dd={},_0x10f6b7={'count':0x0,'rows':[]};var _0x5c800a=_['map'](db['VoiceQueue'][_0xf6f1('0x38')],function(_0x4ffb3b){return{'name':_0x4ffb3b[_0xf6f1('0x39')],'type':_0x4ffb3b['type'][_0xf6f1('0x3a')]};});_0x47f9dd[_0xf6f1('0x3b')]=_[_0xf6f1('0x2b')](_0x5c800a,_0xf6f1('0x30'));_0x47f9dd[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x5ade5[_0xf6f1('0x3c')]);_0x47f9dd[_0xf6f1('0x3e')]=_['intersection'](_0x47f9dd[_0xf6f1('0x3b')],_0x47f9dd[_0xf6f1('0x3c')]);_0x1f77de['attributes']=_[_0xf6f1('0x3f')](_0x47f9dd[_0xf6f1('0x3b')],qs['fields'](_0x5ade5[_0xf6f1('0x3c')]['fields']));_0x1f77de[_0xf6f1('0x40')]=_0x1f77de[_0xf6f1('0x40')][_0xf6f1('0x41')]?_0x1f77de['attributes']:_0x47f9dd[_0xf6f1('0x3b')];if(!_0x5ade5[_0xf6f1('0x3c')][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x1f77de[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x5ade5[_0xf6f1('0x3c')]['limit']);_0x1f77de[_0xf6f1('0x1c')]=qs[_0xf6f1('0x1c')](_0x5ade5[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}_0x1f77de[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x5ade5['query'][_0xf6f1('0x45')]);_0x1f77de['where']=qs[_0xf6f1('0x3e')](_['pick'](_0x5ade5[_0xf6f1('0x3c')],_0x47f9dd[_0xf6f1('0x3e')]),_0x5c800a);if(_0x5ade5[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x1f77de[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x1f77de[_0xf6f1('0x46')],{'$or':_['map'](_0x5c800a,function(_0x13773e){if(_0x13773e['type']!==_0xf6f1('0x48')){var _0x3d8237={};_0x3d8237[_0x13773e[_0xf6f1('0x30')]]={'$like':'%'+_0x5ade5[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x3d8237;}})});}_0x1f77de=_[_0xf6f1('0x47')]({},_0x1f77de,_0x5ade5['options']);var _0x225885={'where':_0x1f77de[_0xf6f1('0x46')]};return db[_0xf6f1('0x49')][_0xf6f1('0x1f')](_0x225885)[_0xf6f1('0x24')](function(_0x53c64a){_0x10f6b7['count']=_0x53c64a;if(_0x5ade5['query'][_0xf6f1('0x4a')]){_0x1f77de['include']=[{'all':!![]}];}return db[_0xf6f1('0x49')]['findAll'](_0x1f77de);})[_0xf6f1('0x24')](function(_0x3b028d){_0x10f6b7[_0xf6f1('0x4b')]=_0x3b028d;return _0x10f6b7;})[_0xf6f1('0x24')](respondWithFilteredResult(_0x2e4e62,_0x1f77de))['catch'](handleError(_0x2e4e62,null));};exports[_0xf6f1('0x4c')]=function(_0x4aeb3f,_0x93758){var _0x1b1bb0={'raw':![],'where':{'id':_0x4aeb3f[_0xf6f1('0x4d')]['id']}},_0x8a1745={};_0x8a1745[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x49')][_0xf6f1('0x38')]);_0x8a1745[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x4aeb3f['query']);_0x8a1745[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x8a1745[_0xf6f1('0x3b')],_0x8a1745['query']);_0x1b1bb0[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x8a1745[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x4aeb3f[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x1b1bb0[_0xf6f1('0x40')]=_0x1b1bb0[_0xf6f1('0x40')][_0xf6f1('0x41')]?_0x1b1bb0[_0xf6f1('0x40')]:_0x8a1745[_0xf6f1('0x3b')];if(_0x4aeb3f['query']['includeAll']){_0x1b1bb0[_0xf6f1('0x4f')]=[{'all':!![]}];}_0x1b1bb0=_['merge']({},_0x1b1bb0,_0x4aeb3f[_0xf6f1('0x50')]);return db['VoiceQueue'][_0xf6f1('0x2f')](_0x1b1bb0)[_0xf6f1('0x24')](handleEntityNotFound(_0x93758,null))[_0xf6f1('0x24')](respondWithResult(_0x93758,null))[_0xf6f1('0x51')](handleError(_0x93758,null));};exports['create']=function(_0x1af585,_0x2a912b){return db[_0xf6f1('0x49')][_0xf6f1('0x52')](_0x1af585[_0xf6f1('0x53')],{})['then'](function(_0x8eba64){var _0x33b2ee=_0x1af585[_0xf6f1('0x54')][_0xf6f1('0x55')]({'plain':!![]});if(!_0x33b2ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33b2ee['role']===_0xf6f1('0x54')){var _0x51050f=_0x8eba64[_0xf6f1('0x55')]({'plain':!![]});var _0x5d94bb=[{'name':_0xf6f1('0x26'),'value':_0xf6f1('0x27')},{'name':'QueueCampaigns','value':_0xf6f1('0x28')}];var _0x5d8c27=_['find'](_0x5d94bb,[_0xf6f1('0x2c'),_0x51050f[_0xf6f1('0x2e')]])[_0xf6f1('0x30')];return db['UserProfileSection'][_0xf6f1('0x2f')]({'where':{'name':_0x5d8c27,'userProfileId':_0x33b2ee[_0xf6f1('0x56')]},'raw':!![]})[_0xf6f1('0x24')](function(_0x257fd1){if(_0x257fd1&&_0x257fd1[_0xf6f1('0x57')]===0x0){return db[_0xf6f1('0x31')][_0xf6f1('0x52')]({'name':_0x51050f[_0xf6f1('0x30')],'resourceId':_0x51050f['id'],'type':_0x257fd1[_0xf6f1('0x30')],'sectionId':_0x257fd1['id']},{})[_0xf6f1('0x24')](function(){return _0x8eba64;});}else{return _0x8eba64;}})[_0xf6f1('0x51')](function(_0xd53ab7){logger[_0xf6f1('0x34')](_0xf6f1('0x58'),_0xd53ab7);throw _0xd53ab7;});}return _0x8eba64;})[_0xf6f1('0x24')](respondWithResult(_0x2a912b,0xc9))[_0xf6f1('0x51')](handleError(_0x2a912b,null));};exports[_0xf6f1('0x59')]=function(_0x161eef,_0x2a2a05){var _0xe2986b={'where':{'id':_0x161eef['params']['id']}},_0x320977={};_0x320977[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x49')][_0xf6f1('0x38')]);_0xe2986b['attributes']=_[_0xf6f1('0x3f')](_0x320977['model'],qs[_0xf6f1('0x4e')](_0x161eef[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0xe2986b['attributes']=_0xe2986b['attributes'][_0xf6f1('0x41')]?_0xe2986b[_0xf6f1('0x40')]:_0x320977[_0xf6f1('0x3b')];if(_0x161eef[_0xf6f1('0x3c')][_0xf6f1('0x4a')]){_0xe2986b['include']=[{'all':!![]}];}_0xe2986b=_[_0xf6f1('0x47')]({},_0xe2986b,_0x161eef['options']);return db[_0xf6f1('0x49')]['find'](_0xe2986b)[_0xf6f1('0x24')](handleEntityNotFound(_0x2a2a05,null))[_0xf6f1('0x24')](function(_0x11a461){if(_0x11a461){var _0x56a54d=_0x11a461[_0xf6f1('0x55')]({'plain':!![]});_0x56a54d=qs[_0xf6f1('0x5a')](_0x56a54d,['id','createdAt',_0xf6f1('0x5b')]);_0x161eef['body']=_[_0xf6f1('0x5a')](_0x161eef[_0xf6f1('0x53')],['id',_0xf6f1('0x5c'),'updatedAt']);return db['VoiceQueue']['create'](_[_0xf6f1('0x47')](_0x56a54d,_0x161eef['body']),{'include':_0x161eef[_0xf6f1('0x3c')]['includeAll']?[{'all':!![]}]:undefined})[_0xf6f1('0x24')](function(_0x17470a){var _0x87954a=_0x161eef[_0xf6f1('0x54')][_0xf6f1('0x55')]({'plain':!![]});if(!_0x87954a)throw new Error(_0xf6f1('0x5d'));if(_0x87954a['role']===_0xf6f1('0x54')){var _0x51183f=_0x17470a['get']({'plain':!![]});var _0x594fa8=[{'name':'VoiceQueues','value':_0xf6f1('0x27')},{'name':_0xf6f1('0x5e'),'value':_0xf6f1('0x28')}];var _0x3231ca=_[_0xf6f1('0x2f')](_0x594fa8,['value',_0x51183f[_0xf6f1('0x2e')]])[_0xf6f1('0x30')];return db[_0xf6f1('0x5f')][_0xf6f1('0x2f')]({'where':{'name':_0x3231ca,'userProfileId':_0x87954a[_0xf6f1('0x56')]},'raw':!![]})[_0xf6f1('0x24')](function(_0x550049){if(_0x550049&&_0x550049[_0xf6f1('0x57')]===0x0){return db[_0xf6f1('0x31')][_0xf6f1('0x52')]({'name':_0x51183f[_0xf6f1('0x30')],'resourceId':_0x51183f['id'],'type':_0x550049[_0xf6f1('0x30')],'sectionId':_0x550049['id']},{})[_0xf6f1('0x24')](function(){return _0x17470a;});}else{return _0x17470a;}})[_0xf6f1('0x51')](function(_0x30b03e){logger[_0xf6f1('0x34')](_0xf6f1('0x58'),_0x30b03e);throw _0x30b03e;});}return _0x17470a;});}})[_0xf6f1('0x24')](respondWithResult(_0x2a2a05,0xc9))['catch'](handleError(_0x2a2a05,null));};exports[_0xf6f1('0x23')]=function(_0x16e2e1,_0x4b84a0){if(_0x16e2e1[_0xf6f1('0x53')]['id']){delete _0x16e2e1[_0xf6f1('0x53')]['id'];}return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x16e2e1[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x4b84a0,null))[_0xf6f1('0x24')](saveUpdates(_0x16e2e1['body'],null))[_0xf6f1('0x24')](respondWithResult(_0x4b84a0,null))[_0xf6f1('0x51')](handleError(_0x4b84a0,null));};exports[_0xf6f1('0x25')]=function(_0xfc3560,_0x377a05){return db[_0xf6f1('0x49')]['find']({'where':{'id':_0xfc3560[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x377a05,null))[_0xf6f1('0x24')](removeEntity(_0x377a05,null))[_0xf6f1('0x51')](handleError(_0x377a05,null));};exports['getHoppers']=function(_0x211e89,_0x21a5ff,_0x29c043){var _0x10872a={'raw':![],'where':{}};var _0x4cba10={};var _0x2ef8f2={'count':0x0,'rows':[]};return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x211e89[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x21a5ff,null))['then'](function(_0x573961){if(_0x573961){_0x4cba10['model']=_['keys'](db[_0xf6f1('0x61')][_0xf6f1('0x38')]);_0x4cba10[_0xf6f1('0x3c')]=_['keys'](_0x211e89[_0xf6f1('0x3c')]);_0x4cba10['filters']=_[_0xf6f1('0x3f')](_0x4cba10['model'],_0x4cba10[_0xf6f1('0x3c')]);_0x10872a[_0xf6f1('0x40')]=_['intersection'](_0x4cba10[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x211e89[_0xf6f1('0x3c')]['fields']));_0x10872a[_0xf6f1('0x40')]=_0x10872a[_0xf6f1('0x40')]['length']?_0x10872a['attributes']:_0x4cba10['model'];if(!_0x211e89[_0xf6f1('0x3c')]['hasOwnProperty'](_0xf6f1('0x43'))){_0x10872a[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x1e')]);_0x10872a[_0xf6f1('0x1c')]=qs[_0xf6f1('0x1c')](_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}_0x10872a['order']=qs['sort'](_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x45')]);_0x10872a[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_['pick'](_0x211e89[_0xf6f1('0x3c')],_0x4cba10['filters']));_0x10872a['where'][_0xf6f1('0x62')]=_0x573961['id'];if(_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x10872a[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x10872a[_0xf6f1('0x46')],{'$or':_[_0xf6f1('0x2b')](_0x10872a[_0xf6f1('0x40')],function(_0x12245d){var _0x5432d1={};_0x5432d1[_0x12245d]={'$like':'%'+_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x5432d1;})});}_0x10872a=_[_0xf6f1('0x47')]({},_0x10872a,_0x211e89[_0xf6f1('0x50')]);return db[_0xf6f1('0x61')][_0xf6f1('0x1f')]({'where':_0x10872a['where']})[_0xf6f1('0x24')](function(_0x20d022){_0x2ef8f2[_0xf6f1('0x1f')]=_0x20d022;if(_0x211e89[_0xf6f1('0x3c')][_0xf6f1('0x4a')]){_0x10872a[_0xf6f1('0x4f')]=[{'all':!![]}];}return db[_0xf6f1('0x61')][_0xf6f1('0x63')](_0x10872a);})[_0xf6f1('0x24')](function(_0x3017a9){_0x2ef8f2['rows']=_0x3017a9;return _0x2ef8f2;});}})[_0xf6f1('0x24')](respondWithFilteredResult(_0x21a5ff,_0x10872a))['catch'](handleError(_0x21a5ff,null));};exports['getHopperHistories']=function(_0x25ff01,_0x2af4a5,_0x3d549d){var _0x3d8630={'raw':!![],'where':{}};var _0x201c24={};var _0x27ef0e={'count':0x0,'rows':[]};return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x25ff01['params']['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x2af4a5,null))[_0xf6f1('0x24')](function(_0x59ac7c){if(_0x59ac7c){_0x201c24[_0xf6f1('0x3b')]=_['keys'](db[_0xf6f1('0x64')][_0xf6f1('0x38')]);_0x201c24[_0xf6f1('0x3c')]=_['keys'](_0x25ff01[_0xf6f1('0x3c')]);_0x201c24[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x201c24[_0xf6f1('0x3b')],_0x201c24[_0xf6f1('0x3c')]);_0x3d8630[_0xf6f1('0x40')]=_['intersection'](_0x201c24[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x25ff01[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x3d8630[_0xf6f1('0x40')]=_0x3d8630[_0xf6f1('0x40')][_0xf6f1('0x41')]?_0x3d8630[_0xf6f1('0x40')]:_0x201c24[_0xf6f1('0x3b')];if(!_0x25ff01['query'][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x3d8630[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x25ff01['query'][_0xf6f1('0x1e')]);_0x3d8630[_0xf6f1('0x1c')]=qs['offset'](_0x25ff01['query'][_0xf6f1('0x1c')]);}_0x3d8630[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x25ff01[_0xf6f1('0x3c')][_0xf6f1('0x45')]);_0x3d8630[_0xf6f1('0x46')]=qs['filters'](_[_0xf6f1('0x65')](_0x25ff01['query'],_0x201c24['filters']));_0x3d8630[_0xf6f1('0x46')]['VoiceQueueId']=_0x59ac7c['id'];if(_0x25ff01[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x3d8630['where']=_[_0xf6f1('0x47')](_0x3d8630[_0xf6f1('0x46')],{'$or':_['map'](_0x3d8630[_0xf6f1('0x40')],function(_0x2a99a7){var _0x4a5220={};_0x4a5220[_0x2a99a7]={'$like':'%'+_0x25ff01[_0xf6f1('0x3c')]['filter']+'%'};return _0x4a5220;})});}_0x3d8630=_[_0xf6f1('0x47')]({},_0x3d8630,_0x25ff01[_0xf6f1('0x50')]);return db['CmHopperHistory'][_0xf6f1('0x1f')]({'where':_0x3d8630[_0xf6f1('0x46')]})['then'](function(_0x2673ce){_0x27ef0e[_0xf6f1('0x1f')]=_0x2673ce;if(_0x25ff01[_0xf6f1('0x3c')]['includeAll']){_0x3d8630[_0xf6f1('0x4f')]=[{'all':!![]}];}return db[_0xf6f1('0x64')][_0xf6f1('0x63')](_0x3d8630);})[_0xf6f1('0x24')](function(_0x285690){_0x27ef0e['rows']=_0x285690;return _0x27ef0e;});}})[_0xf6f1('0x24')](respondWithFilteredResult(_0x2af4a5,_0x3d8630))['catch'](handleError(_0x2af4a5,null));};exports[_0xf6f1('0x66')]=function(_0x4c11a8,_0x4e22f4,_0x477002){var _0x27e91f={'raw':!![],'where':{}};var _0x4682a1={};var _0x1b522b={'count':0x0,'rows':[]};return db[_0xf6f1('0x49')]['findOne']({'where':{'id':_0x4c11a8[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x4e22f4,null))[_0xf6f1('0x24')](function(_0xbc966a){if(_0xbc966a){_0x4682a1[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x67')][_0xf6f1('0x38')]);_0x4682a1[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x4c11a8[_0xf6f1('0x3c')]);_0x4682a1[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x4682a1[_0xf6f1('0x3b')],_0x4682a1['query']);_0x27e91f[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x4682a1['model'],qs['fields'](_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x27e91f['attributes']=_0x27e91f[_0xf6f1('0x40')]['length']?_0x27e91f[_0xf6f1('0x40')]:_0x4682a1[_0xf6f1('0x3b')];if(!_0x4c11a8['query'][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x27e91f[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x1e')]);_0x27e91f[_0xf6f1('0x1c')]=qs[_0xf6f1('0x1c')](_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}_0x27e91f['order']=qs[_0xf6f1('0x45')](_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x45')]);_0x27e91f[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_[_0xf6f1('0x65')](_0x4c11a8['query'],_0x4682a1[_0xf6f1('0x3e')]));_0x27e91f[_0xf6f1('0x46')][_0xf6f1('0x62')]=_0xbc966a['id'];if(_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x27e91f[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x27e91f[_0xf6f1('0x46')],{'$or':_[_0xf6f1('0x2b')](_0x27e91f[_0xf6f1('0x40')],function(_0x34bd93){var _0x36b1ad={};_0x36b1ad[_0x34bd93]={'$like':'%'+_0x4c11a8[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x36b1ad;})});}_0x27e91f=_[_0xf6f1('0x47')]({},_0x27e91f,_0x4c11a8['options']);return db[_0xf6f1('0x67')]['count']({'where':_0x27e91f['where']})[_0xf6f1('0x24')](function(_0x59d63a){_0x1b522b['count']=_0x59d63a;if(_0x4c11a8[_0xf6f1('0x3c')]['includeAll']){_0x27e91f[_0xf6f1('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xf6f1('0x63')](_0x27e91f);})[_0xf6f1('0x24')](function(_0x339787){_0x1b522b[_0xf6f1('0x4b')]=_0x339787;return _0x1b522b;});}})[_0xf6f1('0x24')](respondWithFilteredResult(_0x4e22f4,_0x27e91f))[_0xf6f1('0x51')](handleError(_0x4e22f4,null));};exports['getHopperBlacks']=function(_0x2742dc,_0x3c2cb8,_0x3790d6){var _0x31364d={'raw':!![],'where':{}};var _0xd609e4={};var _0x3498d0={'count':0x0,'rows':[]};return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x2742dc[_0xf6f1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3c2cb8,null))[_0xf6f1('0x24')](function(_0x31fbb3){if(_0x31fbb3){_0xd609e4[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x68')]['rawAttributes']);_0xd609e4[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x2742dc[_0xf6f1('0x3c')]);_0xd609e4[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0xd609e4[_0xf6f1('0x3b')],_0xd609e4[_0xf6f1('0x3c')]);_0x31364d[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0xd609e4[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x31364d[_0xf6f1('0x40')]=_0x31364d['attributes'][_0xf6f1('0x41')]?_0x31364d['attributes']:_0xd609e4[_0xf6f1('0x3b')];if(!_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x31364d['limit']=qs[_0xf6f1('0x1e')](_0x2742dc[_0xf6f1('0x3c')]['limit']);_0x31364d['offset']=qs[_0xf6f1('0x1c')](_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}_0x31364d[_0xf6f1('0x44')]=qs['sort'](_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x45')]);_0x31364d['where']=qs[_0xf6f1('0x3e')](_[_0xf6f1('0x65')](_0x2742dc['query'],_0xd609e4[_0xf6f1('0x3e')]));_0x31364d[_0xf6f1('0x46')][_0xf6f1('0x62')]=_0x31fbb3['id'];if(_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x31364d[_0xf6f1('0x46')]=_['merge'](_0x31364d['where'],{'$or':_[_0xf6f1('0x2b')](_0x31364d['attributes'],function(_0x28c363){var _0xd361a={};_0xd361a[_0x28c363]={'$like':'%'+_0x2742dc[_0xf6f1('0x3c')]['filter']+'%'};return _0xd361a;})});}_0x31364d=_[_0xf6f1('0x47')]({},_0x31364d,_0x2742dc[_0xf6f1('0x50')]);return db['CmHopperBlack'][_0xf6f1('0x1f')]({'where':_0x31364d['where']})[_0xf6f1('0x24')](function(_0x413d83){_0x3498d0[_0xf6f1('0x1f')]=_0x413d83;if(_0x2742dc[_0xf6f1('0x3c')][_0xf6f1('0x4a')]){_0x31364d[_0xf6f1('0x4f')]=[{'all':!![]}];}return db[_0xf6f1('0x68')][_0xf6f1('0x63')](_0x31364d);})[_0xf6f1('0x24')](function(_0xe279ff){_0x3498d0[_0xf6f1('0x4b')]=_0xe279ff;return _0x3498d0;});}})[_0xf6f1('0x24')](respondWithFilteredResult(_0x3c2cb8,_0x31364d))[_0xf6f1('0x51')](handleError(_0x3c2cb8,null));};exports[_0xf6f1('0x69')]=function(_0x8d9fca,_0x3bd238,_0x38df2b){var _0x2078fc={};var _0x4086f6={};var _0x54bd23;var _0x4971d0;return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x8d9fca[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x3bd238,null))[_0xf6f1('0x24')](function(_0x10be58){if(_0x10be58){_0x54bd23=_0x10be58;_0x4086f6[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db['Team'][_0xf6f1('0x38')]);_0x4086f6[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x8d9fca[_0xf6f1('0x3c')]);_0x4086f6[_0xf6f1('0x3e')]=_['intersection'](_0x4086f6['model'],_0x4086f6[_0xf6f1('0x3c')]);_0x2078fc[_0xf6f1('0x40')]=_['intersection'](_0x4086f6[_0xf6f1('0x3b')],qs['fields'](_0x8d9fca['query'][_0xf6f1('0x4e')]));_0x2078fc[_0xf6f1('0x40')]=_0x2078fc[_0xf6f1('0x40')][_0xf6f1('0x41')]?_0x2078fc[_0xf6f1('0x40')]:_0x4086f6[_0xf6f1('0x3b')];_0x2078fc[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x8d9fca['query']['sort']);_0x2078fc[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_[_0xf6f1('0x65')](_0x8d9fca[_0xf6f1('0x3c')],_0x4086f6['filters']));if(_0x8d9fca['query'][_0xf6f1('0x29')]){_0x2078fc[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x2078fc[_0xf6f1('0x46')],{'$or':_[_0xf6f1('0x2b')](_0x2078fc[_0xf6f1('0x40')],function(_0xb89a79){var _0x23d2a7={};_0x23d2a7[_0xb89a79]={'$like':'%'+_0x8d9fca[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x23d2a7;})});}_0x2078fc=_[_0xf6f1('0x47')]({},_0x2078fc,_0x8d9fca['options']);return _0x54bd23[_0xf6f1('0x69')](_0x2078fc);}})['then'](function(_0x298c24){if(_0x298c24){_0x4971d0=_0x298c24['length'];if(!_0x8d9fca[_0xf6f1('0x3c')][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x2078fc[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x8d9fca[_0xf6f1('0x3c')][_0xf6f1('0x1e')]);_0x2078fc['offset']=qs[_0xf6f1('0x1c')](_0x8d9fca[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}return _0x54bd23[_0xf6f1('0x69')](_0x2078fc);}})['then'](function(_0x49856a){if(_0x49856a){return _0x49856a?{'count':_0x4971d0,'rows':_0x49856a}:null;}})['then'](respondWithResult(_0x3bd238,null))['catch'](handleError(_0x3bd238,null));};exports['addTeams']=function(_0x532617,_0x5179e0,_0x3e5c85){var _0x357b9d=_0x532617[_0xf6f1('0x53')][_0xf6f1('0x6a')];var _0x29c4d3=_['map'](_0x357b9d,'id');return db[_0xf6f1('0x6b')][_0xf6f1('0x63')]({'where':{'id':_0x29c4d3},'attributes':['id'],'include':[{'model':db[_0xf6f1('0x6c')],'as':_0xf6f1('0x6d'),'attributes':['id',_0xf6f1('0x30'),_0xf6f1('0x6e'),'voicePause',_0xf6f1('0x6f')],'raw':!![]}]})[_0xf6f1('0x24')](function(_0x6bd8d2){if(_0x6bd8d2){var _0x5360da=_[_0xf6f1('0x70')](_0x6bd8d2,function(_0x4ec0e0){var _0x1fa7ec=_0x4ec0e0['get']({'plain':!![]});_0x1fa7ec[_0xf6f1('0x6d')][_0xf6f1('0x71')](function(_0x76166f){_0x76166f['penalty']=_['find'](_0x357b9d,{'id':_0x1fa7ec['id']})['penalty'];});return _0x1fa7ec[_0xf6f1('0x6d')];});return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x532617[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](function(_0x47b7cf){return db[_0xf6f1('0x72')]['transaction'](function(_0x3abc06){return _0x47b7cf[_0xf6f1('0x73')](_0x29c4d3,{'transaction':_0x3abc06})[_0xf6f1('0x24')](function(){return BPromise[_0xf6f1('0x74')](_0x357b9d,function(_0x46b22a){return db['TeamVoiceQueue'][_0xf6f1('0x75')]({'TeamId':_0x46b22a['id'],'VoiceQueueId':_0x532617[_0xf6f1('0x4d')]['id'],'penalty':_0x46b22a[_0xf6f1('0x76')]},{'transaction':_0x3abc06});});})[_0xf6f1('0x24')](function(){return BPromise[_0xf6f1('0x74')](_0x5360da,function(_0x1e9790){return db[_0xf6f1('0x77')][_0xf6f1('0x78')]({'where':{'UserId':_0x1e9790['id'],'VoiceQueueId':_0x532617[_0xf6f1('0x4d')]['id']},'defaults':{'penalty':_0x1e9790['penalty']},'transaction':_0x3abc06});});})[_0xf6f1('0x24')](function(){return BPromise[_0xf6f1('0x74')](_[_0xf6f1('0x29')](_0x5360da,{'online':!![]}),function(_0x1d9b6b){return db['UserVoiceQueueRt']['upsert']({'membername':_0x1d9b6b[_0xf6f1('0x30')],'UserId':_0x1d9b6b['id'],'queue_name':_0x47b7cf['name'],'VoiceQueueId':_0x47b7cf['id'],'interface':_[_0xf6f1('0x79')](_0x1d9b6b['interface'])?util['format'](_0xf6f1('0x7a'),_0x1d9b6b[_0xf6f1('0x30')]):_0x1d9b6b['interface'],'paused':_0x1d9b6b[_0xf6f1('0x7b')]||![],'penalty':_0x1d9b6b['penalty']},{'transaction':_0x3abc06});});})[_0xf6f1('0x24')](function(){_0x5360da[_0xf6f1('0x71')](function(_0x11767d){socket[_0xf6f1('0x7c')]('userVoiceQueue:save',{'UserId':_0x11767d['id'],'VoiceQueueId':_0x47b7cf['id']});});});});});}})['then'](respondWithStatusCode(_0x5179e0,null))[_0xf6f1('0x51')](handleError(_0x5179e0,null));};exports['removeTeams']=function(_0x4be24c,_0x3ac39e,_0xeeb27f){return db[_0xf6f1('0x6b')][_0xf6f1('0x63')]({'where':{'id':_0x4be24c[_0xf6f1('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf6f1('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ac39e,null))['then'](function(_0x257cd9){var _0x270924=_[_0xf6f1('0x2b')](_0x257cd9,'id');var _0x27c9dc=[];var _0x109c47=[];var _0x174e17=squel[_0xf6f1('0x7d')]();_0x174e17[_0xf6f1('0x7e')](_0xf6f1('0x7f'))[_0xf6f1('0x80')](_0xf6f1('0x81'),'tq')['join'](_0xf6f1('0x82'),'ut',_0xf6f1('0x83'))[_0xf6f1('0x46')](_0xf6f1('0x84'),_0x4be24c[_0xf6f1('0x4d')]['id']);for(var _0x50f3d4=0x0;_0x50f3d4<_0x257cd9[_0xf6f1('0x41')];_0x50f3d4+=0x1){let _0x6442ad=_0x257cd9[_0x50f3d4];for(var _0x355783=0x0;_0x355783<_0x6442ad[_0xf6f1('0x6d')][_0xf6f1('0x41')];_0x355783+=0x1){let _0xb8949e=_0x6442ad['Agents'][_0x355783];var _0x558eff=_0x174e17[_0xf6f1('0x59')]();_0x558eff['where']('ut.UserId\x20=\x20?',_0xb8949e['id']);_0x109c47['push'](db[_0xf6f1('0x72')][_0xf6f1('0x3c')](_0x558eff['toString'](),{'type':db['sequelize'][_0xf6f1('0x85')][_0xf6f1('0x86')]})[_0xf6f1('0x24')](function(_0x97dff1){if(_0x97dff1[_0xf6f1('0x41')]===0x1){return _0xb8949e['id'];}else{var _0x1eff2d=_[_0xf6f1('0x87')](_[_0xf6f1('0x2b')](_0x97dff1,_0xf6f1('0x88')),function(_0x31ae81){return _['includes'](_0x270924,_0x31ae81);});if(_0x1eff2d){return _0xb8949e['id'];}}}));}}return BPromise[_0xf6f1('0x89')](_0x109c47)[_0xf6f1('0x24')](function(_0x2ddd6c){_0x27c9dc=_(_0x27c9dc)['union'](_0x2ddd6c)[_0xf6f1('0x8a')]()[_0xf6f1('0x2c')]();return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x4be24c[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](function(_0x8805b6){return db[_0xf6f1('0x72')][_0xf6f1('0x8b')](function(_0x3b22ee){return _0x8805b6[_0xf6f1('0x8c')](_0x4be24c['query'][_0xf6f1('0x8d')],{'transaction':_0x3b22ee})[_0xf6f1('0x24')](function(){if(!_[_0xf6f1('0x8e')](_0x27c9dc)){return _0x8805b6[_0xf6f1('0x8f')](_0x27c9dc,{'transaction':_0x3b22ee})[_0xf6f1('0x24')](function(){return db[_0xf6f1('0x90')][_0xf6f1('0x25')]({'where':{'VoiceQueueId':_0x4be24c[_0xf6f1('0x4d')]['id'],'UserId':_0x27c9dc},'transaction':_0x3b22ee});});}})['then'](function(){_0x27c9dc[_0xf6f1('0x71')](function(_0x2a2828){socket[_0xf6f1('0x7c')](_0xf6f1('0x91'),{'UserId':_0x2a2828,'VoiceQueueId':_0x8805b6['id']});});});});});});})[_0xf6f1('0x24')](respondWithStatusCode(_0x3ac39e,null))[_0xf6f1('0x51')](handleError(_0x3ac39e,null));};exports['addAgents']=function(_0x4c88a4,_0x46212b,_0x141068){var _0x4d1ee2,_0x1751a3;return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x4c88a4[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x46212b,null))[_0xf6f1('0x24')](function(_0x226547){if(_0x226547){_0x1751a3=_0x226547;return _0x226547[_0xf6f1('0x92')](_0x4c88a4[_0xf6f1('0x53')][_0xf6f1('0x8d')],_[_0xf6f1('0x5a')](_0x4c88a4['body'],['ids','id'])||{})['spread'](function(_0x291beb){for(var _0x37af6c=0x0;_0x37af6c<_0x4c88a4[_0xf6f1('0x53')][_0xf6f1('0x8d')][_0xf6f1('0x41')];_0x37af6c+=0x1){socket[_0xf6f1('0x7c')](_0xf6f1('0x93'),{'UserId':Number(_0x4c88a4[_0xf6f1('0x53')][_0xf6f1('0x8d')][_0x37af6c]),'VoiceQueueId':Number(_0x4c88a4[_0xf6f1('0x4d')]['id'])});}return _0x291beb;});}})[_0xf6f1('0x24')](function(_0x5d57b4){_0x4d1ee2=_0x5d57b4||[];if(_0x1751a3){return db[_0xf6f1('0x6c')][_0xf6f1('0x63')]({'where':{'id':_0x4c88a4[_0xf6f1('0x53')][_0xf6f1('0x8d')]},'attributes':['id',_0xf6f1('0x30'),_0xf6f1('0x6e'),_0xf6f1('0x7b'),_0xf6f1('0x6f')],'raw':!![]});}})[_0xf6f1('0x24')](function(_0x55b1bf){if(!_[_0xf6f1('0x8e')](_0x55b1bf)){var _0x579eab=[];for(var _0x8981af=0x0;_0x8981af<_0x55b1bf['length'];_0x8981af++){if(_0x55b1bf[_0x8981af][_0xf6f1('0x6e')]){_0x579eab[_0xf6f1('0x94')](db[_0xf6f1('0x90')][_0xf6f1('0x75')]({'membername':_0x55b1bf[_0x8981af][_0xf6f1('0x30')],'UserId':_0x55b1bf[_0x8981af]['id'],'queue_name':_0x1751a3['name'],'VoiceQueueId':_0x1751a3['id'],'interface':_[_0xf6f1('0x79')](_0x55b1bf[_0x8981af][_0xf6f1('0x6f')])?util['format']('SIP/%s',_0x55b1bf[_0x8981af][_0xf6f1('0x30')]):_0x55b1bf[_0x8981af][_0xf6f1('0x6f')],'paused':_0x55b1bf[_0x8981af][_0xf6f1('0x7b')]||![],'penalty':_0x4c88a4[_0xf6f1('0x53')][_0xf6f1('0x76')]||0x0}));}}return BPromise[_0xf6f1('0x89')](_0x579eab);}})[_0xf6f1('0x24')](function(){return _0x4d1ee2;})[_0xf6f1('0x24')](respondWithResult(_0x46212b,null))[_0xf6f1('0x51')](handleError(_0x46212b,null));};exports[_0xf6f1('0x8f')]=function(_0x2cdf58,_0x516967,_0x129e91){return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x2cdf58[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x516967,null))['then'](function(_0x4aa56c){if(_0x4aa56c){return _0x4aa56c['removeAgents'](_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')])['then'](function(){if(_[_0xf6f1('0x95')](_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')])){for(var _0x4619db=0x0;_0x4619db<_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')]['length'];_0x4619db+=0x1){socket[_0xf6f1('0x7c')](_0xf6f1('0x91'),{'UserId':Number(_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')][_0x4619db]),'VoiceQueueId':Number(_0x2cdf58[_0xf6f1('0x4d')]['id'])});}}else{socket[_0xf6f1('0x7c')](_0xf6f1('0x91'),{'UserId':Number(_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')]),'VoiceQueueId':Number(_0x2cdf58[_0xf6f1('0x4d')]['id'])});}});}})['then'](function(_0x2d4622){return db[_0xf6f1('0x90')][_0xf6f1('0x25')]({'where':{'VoiceQueueId':_0x2cdf58[_0xf6f1('0x4d')]['id'],'UserId':_0x2cdf58[_0xf6f1('0x3c')][_0xf6f1('0x8d')]}})[_0xf6f1('0x24')](function(){return _0x2d4622;});})['then'](respondWithStatusCode(_0x516967,null))['catch'](handleError(_0x516967,null));};exports['getAgents']=function(_0x19426b,_0x4ced5c,_0x299c68){var _0x1fa93a={};var _0x358936={};var _0x5a38e5;var _0x4b17c6;return db['VoiceQueue'][_0xf6f1('0x60')]({'where':{'id':_0x19426b['params']['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x4ced5c,null))[_0xf6f1('0x24')](function(_0x1a9662){if(_0x1a9662){_0x5a38e5=_0x1a9662;_0x358936[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x6c')][_0xf6f1('0x38')]);_0x358936[_0xf6f1('0x3c')]=_['keys'](_0x19426b[_0xf6f1('0x3c')]);_0x358936[_0xf6f1('0x3e')]=_['intersection'](_0x358936[_0xf6f1('0x3b')],_0x358936['query']);_0x1fa93a[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x358936[_0xf6f1('0x3b')],qs['fields'](_0x19426b[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x1fa93a['attributes']=_0x1fa93a['attributes'][_0xf6f1('0x41')]?_0x1fa93a[_0xf6f1('0x40')]:_0x358936[_0xf6f1('0x3b')];_0x1fa93a[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x19426b[_0xf6f1('0x3c')][_0xf6f1('0x45')]);_0x1fa93a[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_['pick'](_0x19426b['query'],_0x358936['filters']));if(_0x19426b['query']['filter']){_0x1fa93a['where']=_[_0xf6f1('0x47')](_0x1fa93a[_0xf6f1('0x46')],{'$or':_[_0xf6f1('0x2b')](_0x1fa93a[_0xf6f1('0x40')],function(_0x303ac8){var _0x22fd94={};_0x22fd94[_0x303ac8]={'$like':'%'+_0x19426b[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x22fd94;})});}_0x1fa93a=_[_0xf6f1('0x47')]({},_0x1fa93a,_0x19426b['options']);return _0x5a38e5[_0xf6f1('0x96')](_0x1fa93a);}})[_0xf6f1('0x24')](function(_0x1d418f){if(_0x1d418f){_0x4b17c6=_0x1d418f[_0xf6f1('0x41')];if(!_0x19426b['query'][_0xf6f1('0x42')]('nolimit')){_0x1fa93a[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x19426b[_0xf6f1('0x3c')][_0xf6f1('0x1e')]);_0x1fa93a[_0xf6f1('0x1c')]=qs[_0xf6f1('0x1c')](_0x19426b['query'][_0xf6f1('0x1c')]);}return _0x5a38e5[_0xf6f1('0x96')](_0x1fa93a);}})['then'](function(_0x349eae){if(_0x349eae){return _0x349eae?{'count':_0x4b17c6,'rows':_0x349eae}:null;}})[_0xf6f1('0x24')](respondWithResult(_0x4ced5c,null))[_0xf6f1('0x51')](handleError(_0x4ced5c,null));};exports['getMembers']=function(_0x37cf33,_0x852891,_0x5db7a8){var _0x3190bc={};var _0x3026a4={};var _0xb6f9a7;var _0x5c046c;return db[_0xf6f1('0x49')]['findOne']({'where':{'id':_0x37cf33['params']['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x852891,null))[_0xf6f1('0x24')](function(_0x2d106b){if(_0x2d106b){_0xb6f9a7=_0x2d106b;_0x3026a4[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db['UserVoiceQueueRt'][_0xf6f1('0x38')]);_0x3026a4[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x37cf33[_0xf6f1('0x3c')]);_0x3026a4[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x3026a4[_0xf6f1('0x3b')],_0x3026a4['query']);_0x3190bc[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x3026a4[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x37cf33[_0xf6f1('0x3c')]['fields']));_0x3190bc[_0xf6f1('0x40')]=_0x3190bc['attributes'][_0xf6f1('0x41')]?_0x3190bc[_0xf6f1('0x40')]:_0x3026a4[_0xf6f1('0x3b')];_0x3190bc[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x37cf33[_0xf6f1('0x3c')]['sort']);_0x3190bc['where']=qs[_0xf6f1('0x3e')](_['pick'](_0x37cf33[_0xf6f1('0x3c')],_0x3026a4[_0xf6f1('0x3e')]));if(_0x37cf33[_0xf6f1('0x3c')]['filter']){_0x3190bc['where']=_[_0xf6f1('0x47')](_0x3190bc[_0xf6f1('0x46')],{'$or':_['map'](_0x3190bc['attributes'],function(_0x4e60af){var _0x310825={};_0x310825[_0x4e60af]={'$like':'%'+_0x37cf33[_0xf6f1('0x3c')]['filter']+'%'};return _0x310825;})});}_0x3190bc=_[_0xf6f1('0x47')]({},_0x3190bc,_0x37cf33[_0xf6f1('0x50')]);return _0xb6f9a7[_0xf6f1('0x97')](_0x3190bc);}})[_0xf6f1('0x24')](function(_0x5c3923){if(_0x5c3923){_0x5c046c=_0x5c3923[_0xf6f1('0x41')];if(!_0x37cf33[_0xf6f1('0x3c')][_0xf6f1('0x42')](_0xf6f1('0x43'))){_0x3190bc[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x37cf33['query'][_0xf6f1('0x1e')]);_0x3190bc[_0xf6f1('0x1c')]=qs[_0xf6f1('0x1c')](_0x37cf33[_0xf6f1('0x3c')]['offset']);}return _0xb6f9a7[_0xf6f1('0x97')](_0x3190bc);}})[_0xf6f1('0x24')](function(_0x1391cc){return _0x1391cc?{'count':_0x5c046c,'rows':_0x1391cc}:null;})[_0xf6f1('0x24')](respondWithResult(_0x852891,null))[_0xf6f1('0x51')](handleError(_0x852891,null));};exports['getLists']=function(_0x3015e8,_0x7aec5a,_0x4e590f){var _0x535f72={};var _0x58fe5c={};var _0x2afdcc;var _0xa33ddc;return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x3015e8[_0xf6f1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7aec5a,null))[_0xf6f1('0x24')](function(_0x1ac159){if(_0x1ac159){_0x2afdcc=_0x1ac159;_0x58fe5c[_0xf6f1('0x3b')]=_['keys'](db[_0xf6f1('0x98')][_0xf6f1('0x38')]);_0x58fe5c[_0xf6f1('0x3c')]=_[_0xf6f1('0x3d')](_0x3015e8[_0xf6f1('0x3c')]);_0x58fe5c[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x58fe5c[_0xf6f1('0x3b')],_0x58fe5c[_0xf6f1('0x3c')]);_0x535f72[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x58fe5c[_0xf6f1('0x3b')],qs[_0xf6f1('0x4e')](_0x3015e8['query'][_0xf6f1('0x4e')]));_0x535f72[_0xf6f1('0x40')]=_0x535f72['attributes'][_0xf6f1('0x41')]?_0x535f72[_0xf6f1('0x40')]:_0x58fe5c[_0xf6f1('0x3b')];_0x535f72['order']=qs['sort'](_0x3015e8[_0xf6f1('0x3c')]['sort']);_0x535f72[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_[_0xf6f1('0x65')](_0x3015e8[_0xf6f1('0x3c')],_0x58fe5c[_0xf6f1('0x3e')]));if(_0x3015e8[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x535f72[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x535f72['where'],{'$or':_['map'](_0x535f72[_0xf6f1('0x40')],function(_0x14ce42){var _0x5e36ad={};_0x5e36ad[_0x14ce42]={'$like':'%'+_0x3015e8[_0xf6f1('0x3c')][_0xf6f1('0x29')]+'%'};return _0x5e36ad;})});}_0x535f72=_[_0xf6f1('0x47')]({},_0x535f72,_0x3015e8[_0xf6f1('0x50')]);return _0x2afdcc['getLists'](_0x535f72);}})['then'](function(_0x2e1994){if(_0x2e1994){_0xa33ddc=_0x2e1994[_0xf6f1('0x41')];if(!_0x3015e8[_0xf6f1('0x3c')][_0xf6f1('0x42')]('nolimit')){_0x535f72[_0xf6f1('0x1e')]=qs[_0xf6f1('0x1e')](_0x3015e8['query'][_0xf6f1('0x1e')]);_0x535f72[_0xf6f1('0x1c')]=qs['offset'](_0x3015e8[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}return _0x2afdcc[_0xf6f1('0x99')](_0x535f72);}})[_0xf6f1('0x24')](function(_0x376b6e){if(_0x376b6e){return _0x376b6e?{'count':_0xa33ddc,'rows':_0x376b6e}:null;}})[_0xf6f1('0x24')](respondWithResult(_0x7aec5a,null))[_0xf6f1('0x51')](handleError(_0x7aec5a,null));};exports[_0xf6f1('0x9a')]=function(_0x335a7a,_0x19537d,_0x56727b){var _0x4955c2,_0x3c1540;return db['VoiceQueue'][_0xf6f1('0x2f')]({'where':{'id':_0x335a7a['params']['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x19537d,null))[_0xf6f1('0x24')](function(_0x999a0c){if(_0x999a0c){_0x3c1540=_0x999a0c;return _0x999a0c[_0xf6f1('0x9a')](_0x335a7a[_0xf6f1('0x53')][_0xf6f1('0x8d')],_[_0xf6f1('0x5a')](_0x335a7a[_0xf6f1('0x53')],[_0xf6f1('0x8d'),'id'])||{});}return null;})[_0xf6f1('0x9b')](function(_0x10bedb){var _0x35cb9d;_0x4955c2=_0x10bedb||[];var _0x5d8f85=[];if(_0x10bedb){for(var _0x454b98=0x0;_0x454b98<_0x10bedb[_0xf6f1('0x41')];_0x454b98+=0x1){var _0x3f2134=_0x10bedb[_0x454b98][_0xf6f1('0x55')]({'plain':!![]});_0x3c1540[_0xf6f1('0x9c')]=_0x335a7a[_0xf6f1('0x53')][_0xf6f1('0x9c')]?_0x335a7a[_0xf6f1('0x53')][_0xf6f1('0x9c')]:_0x3c1540['dialCheckDuplicateType'];switch(_0x3c1540['dialCheckDuplicateType']){case _0xf6f1('0x9d'):_0x35cb9d=squel[_0xf6f1('0x9e')]()[_0xf6f1('0x9f')](_0xf6f1('0xa0'))[_0xf6f1('0xa1')]([_0xf6f1('0xa2'),_0xf6f1('0xa3'),_0xf6f1('0xa4'),'ListId',_0xf6f1('0x62'),_0xf6f1('0x5c'),_0xf6f1('0x5b')],squel[_0xf6f1('0x7d')]()['field'](_0xf6f1('0xa2'),_0xf6f1('0xa2'))['field'](_0xf6f1('0xa5'),_0xf6f1('0xa3'))[_0xf6f1('0x7e')]('id',_0xf6f1('0xa4'))[_0xf6f1('0x7e')](_0x3f2134[_0xf6f1('0xa6')][_0xf6f1('0xa7')](),_0xf6f1('0xa8'))[_0xf6f1('0x7e')](_0x335a7a[_0xf6f1('0x4d')]['id'][_0xf6f1('0xa7')](),_0xf6f1('0x62'))[_0xf6f1('0x7e')](_0xf6f1('0xa5'),_0xf6f1('0x5c'))['field'](_0xf6f1('0xa5'),'updatedAt')[_0xf6f1('0x80')](_0xf6f1('0xa9'))[_0xf6f1('0x46')](_0xf6f1('0xaa'))[_0xf6f1('0x46')]('ListId\x20=\x20?',_0x3f2134[_0xf6f1('0xa6')][_0xf6f1('0xa7')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xf6f1('0x46')](_0xf6f1('0xab'),squel[_0xf6f1('0x7d')]()[_0xf6f1('0x7e')](_0xf6f1('0xac'))[_0xf6f1('0x80')]('cm_hopper_final')[_0xf6f1('0x46')](_0xf6f1('0x84'),_0x335a7a[_0xf6f1('0x4d')]['id']['toString']()))[_0xf6f1('0x46')](_0xf6f1('0xab'),squel[_0xf6f1('0x7d')]()[_0xf6f1('0x7e')](_0xf6f1('0xad'))[_0xf6f1('0x80')](_0xf6f1('0xa0'))[_0xf6f1('0x46')](_0xf6f1('0x84'),_0x335a7a[_0xf6f1('0x4d')]['id'][_0xf6f1('0xa7')]())))[_0xf6f1('0xa7')]();break;case _0xf6f1('0xae'):_0x35cb9d=squel['insert']()['into'](_0xf6f1('0xa0'))[_0xf6f1('0xa1')]([_0xf6f1('0xa2'),_0xf6f1('0xa3'),'ContactId','ListId',_0xf6f1('0x62'),_0xf6f1('0x5c'),_0xf6f1('0x5b')],squel['select']()['field'](_0xf6f1('0xa2'),'phone')['field'](_0xf6f1('0xa5'),'scheduledAt')['field']('id',_0xf6f1('0xa4'))[_0xf6f1('0x7e')](_0x3f2134['CmListId'][_0xf6f1('0xa7')](),_0xf6f1('0xa8'))['field'](_0x335a7a[_0xf6f1('0x4d')]['id']['toString'](),_0xf6f1('0x62'))[_0xf6f1('0x7e')](_0xf6f1('0xa5'),'createdAt')['field'](_0xf6f1('0xa5'),_0xf6f1('0x5b'))['from'](_0xf6f1('0xa9'))[_0xf6f1('0x46')]('deletedAt\x20IS\x20NULL')[_0xf6f1('0x46')](_0xf6f1('0xaf'),_0x3f2134[_0xf6f1('0xa6')][_0xf6f1('0xa7')]())[_0xf6f1('0x46')](_0xf6f1('0xb0'))[_0xf6f1('0x46')](_0xf6f1('0xab'),squel[_0xf6f1('0x7d')]()['field'](_0xf6f1('0xad'))[_0xf6f1('0x80')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x335a7a['params']['id'][_0xf6f1('0xa7')]())))[_0xf6f1('0xa7')]();break;default:_0x35cb9d=squel[_0xf6f1('0x9e')]()['into'](_0xf6f1('0xa0'))[_0xf6f1('0xa1')]([_0xf6f1('0xa2'),_0xf6f1('0xa3'),_0xf6f1('0xa4'),_0xf6f1('0xa8'),_0xf6f1('0x62'),'createdAt',_0xf6f1('0x5b')],squel['select']()['field'](_0xf6f1('0xa2'),_0xf6f1('0xa2'))[_0xf6f1('0x7e')]('NOW()',_0xf6f1('0xa3'))[_0xf6f1('0x7e')]('id',_0xf6f1('0xa4'))['field'](_0x3f2134['CmListId'][_0xf6f1('0xa7')](),_0xf6f1('0xa8'))['field'](_0x335a7a[_0xf6f1('0x4d')]['id'][_0xf6f1('0xa7')](),_0xf6f1('0x62'))[_0xf6f1('0x7e')](_0xf6f1('0xa5'),_0xf6f1('0x5c'))[_0xf6f1('0x7e')]('NOW()',_0xf6f1('0x5b'))[_0xf6f1('0x80')](_0xf6f1('0xa9'))['where'](_0xf6f1('0xaa'))[_0xf6f1('0x46')](_0xf6f1('0xaf'),_0x3f2134[_0xf6f1('0xa6')][_0xf6f1('0xa7')]())[_0xf6f1('0x46')](_0xf6f1('0xb0')))[_0xf6f1('0xa7')]();}_0x5d8f85[_0xf6f1('0x94')](db[_0xf6f1('0x72')]['query'](_0x35cb9d));}return BPromise[_0xf6f1('0x89')](_0x5d8f85);}})['then'](function(){return _0x4955c2;})['then'](respondWithResult(_0x19537d,null))[_0xf6f1('0x51')](handleError(_0x19537d,null));};exports[_0xf6f1('0xb1')]=function(_0x586869,_0x2a3dde,_0x29cc26){return db[_0xf6f1('0x49')]['find']({'where':{'id':_0x586869[_0xf6f1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a3dde,null))[_0xf6f1('0x24')](function(_0x2c8c65){if(_0x2c8c65){return _0x2c8c65[_0xf6f1('0xb1')](_0x586869[_0xf6f1('0x3c')]['ids']);}})['then'](function(_0x4c4244){if(_0x4c4244){return db['CmHopper'][_0xf6f1('0x25')]({'where':{'ListId':_0x586869['query']['ids'],'VoiceQueueId':_0x586869[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](function(){return _0x4c4244;});}})['then'](respondWithStatusCode(_0x2a3dde,null))[_0xf6f1('0x51')](handleError(_0x2a3dde,null));};exports[_0xf6f1('0xb2')]=function(_0x231910,_0x56b1fd,_0x74af9c){var _0x3c4d11={};var _0x4d7628={};var _0x54e0dd;var _0x213410;return db[_0xf6f1('0x49')][_0xf6f1('0x60')]({'where':{'id':_0x231910[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x56b1fd,null))[_0xf6f1('0x24')](function(_0x3e527f){if(_0x3e527f){_0x54e0dd=_0x3e527f;_0x4d7628[_0xf6f1('0x3b')]=_[_0xf6f1('0x3d')](db[_0xf6f1('0x98')][_0xf6f1('0x38')]);_0x4d7628[_0xf6f1('0x3c')]=_['keys'](_0x231910['query']);_0x4d7628[_0xf6f1('0x3e')]=_[_0xf6f1('0x3f')](_0x4d7628['model'],_0x4d7628[_0xf6f1('0x3c')]);_0x3c4d11[_0xf6f1('0x40')]=_[_0xf6f1('0x3f')](_0x4d7628[_0xf6f1('0x3b')],qs['fields'](_0x231910[_0xf6f1('0x3c')][_0xf6f1('0x4e')]));_0x3c4d11[_0xf6f1('0x40')]=_0x3c4d11['attributes'][_0xf6f1('0x41')]?_0x3c4d11[_0xf6f1('0x40')]:_0x4d7628[_0xf6f1('0x3b')];_0x3c4d11[_0xf6f1('0x44')]=qs[_0xf6f1('0x45')](_0x231910['query']['sort']);_0x3c4d11[_0xf6f1('0x46')]=qs[_0xf6f1('0x3e')](_['pick'](_0x231910[_0xf6f1('0x3c')],_0x4d7628[_0xf6f1('0x3e')]));if(_0x231910[_0xf6f1('0x3c')][_0xf6f1('0x29')]){_0x3c4d11[_0xf6f1('0x46')]=_[_0xf6f1('0x47')](_0x3c4d11[_0xf6f1('0x46')],{'$or':_[_0xf6f1('0x2b')](_0x3c4d11[_0xf6f1('0x40')],function(_0x2d7c7f){var _0x250f21={};_0x250f21[_0x2d7c7f]={'$like':'%'+_0x231910[_0xf6f1('0x3c')]['filter']+'%'};return _0x250f21;})});}_0x3c4d11=_[_0xf6f1('0x47')]({},_0x3c4d11,_0x231910[_0xf6f1('0x50')]);return _0x54e0dd['getBlackLists'](_0x3c4d11);}})[_0xf6f1('0x24')](function(_0x584f66){if(_0x584f66){_0x213410=_0x584f66[_0xf6f1('0x41')];if(!_0x231910[_0xf6f1('0x3c')]['hasOwnProperty'](_0xf6f1('0x43'))){_0x3c4d11[_0xf6f1('0x1e')]=qs['limit'](_0x231910[_0xf6f1('0x3c')]['limit']);_0x3c4d11[_0xf6f1('0x1c')]=qs['offset'](_0x231910[_0xf6f1('0x3c')][_0xf6f1('0x1c')]);}return _0x54e0dd[_0xf6f1('0xb2')](_0x3c4d11);}})[_0xf6f1('0x24')](function(_0x179e1b){if(_0x179e1b){return _0x179e1b?{'count':_0x213410,'rows':_0x179e1b}:null;}})[_0xf6f1('0x24')](respondWithResult(_0x56b1fd,null))[_0xf6f1('0x51')](handleError(_0x56b1fd,null));};exports['addBlackLists']=function(_0x376830,_0x1a93fd,_0x1ce1cc){var _0x57ec65,_0x4f0b44;return db[_0xf6f1('0x49')]['find']({'where':{'id':_0x376830[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x1a93fd,null))[_0xf6f1('0x24')](function(_0x448f67){if(_0x448f67){_0x4f0b44=_0x448f67;return _0x448f67[_0xf6f1('0xb3')](_0x376830[_0xf6f1('0x53')][_0xf6f1('0x8d')],_[_0xf6f1('0x5a')](_0x376830[_0xf6f1('0x53')],['ids','id'])||{});}return null;})['spread'](function(_0x13b82a){var _0x20ea3f;_0x57ec65=_0x13b82a||[];var _0xfe5e79=[];if(_0x13b82a){for(var _0x2046a1=0x0;_0x2046a1<_0x13b82a[_0xf6f1('0x41')];_0x2046a1+=0x1){var _0x3c46ed=_0x13b82a[_0x2046a1]['get']({'plain':!![]});_0x20ea3f=squel[_0xf6f1('0x9e')]()['into']('cm_hopper_black')[_0xf6f1('0xa1')]([_0xf6f1('0xa2'),_0xf6f1('0xa4'),'ListId',_0xf6f1('0x62'),_0xf6f1('0x5c'),_0xf6f1('0x5b')],squel[_0xf6f1('0x7d')]()[_0xf6f1('0x7e')](_0xf6f1('0xa2'),_0xf6f1('0xa2'))[_0xf6f1('0x7e')]('id',_0xf6f1('0xa4'))[_0xf6f1('0x7e')](_0x3c46ed[_0xf6f1('0xa6')][_0xf6f1('0xa7')](),'ListId')[_0xf6f1('0x7e')](_0x376830[_0xf6f1('0x4d')]['id']['toString'](),_0xf6f1('0x62'))['field'](_0xf6f1('0xa5'),'createdAt')[_0xf6f1('0x7e')]('NOW()','updatedAt')[_0xf6f1('0x80')](_0xf6f1('0xa9'))['where']('deletedAt\x20IS\x20NULL')[_0xf6f1('0x46')](_0xf6f1('0xaf'),_0x3c46ed[_0xf6f1('0xa6')][_0xf6f1('0xa7')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf6f1('0xa7')]();_0xfe5e79[_0xf6f1('0x94')](db['sequelize'][_0xf6f1('0x3c')](_0x20ea3f));}return BPromise[_0xf6f1('0x89')](_0xfe5e79);}})[_0xf6f1('0x24')](function(){return _0x57ec65;})[_0xf6f1('0x24')](respondWithResult(_0x1a93fd,null))[_0xf6f1('0x51')](handleError(_0x1a93fd,null));};exports[_0xf6f1('0xb4')]=function(_0x568a09,_0x2c48c6,_0x48ca0a){return db[_0xf6f1('0x49')][_0xf6f1('0x2f')]({'where':{'id':_0x568a09[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](handleEntityNotFound(_0x2c48c6,null))['then'](function(_0x136fac){if(_0x136fac){return _0x136fac['removeBlackLists'](_0x568a09[_0xf6f1('0x3c')]['ids']);}})[_0xf6f1('0x24')](function(_0x3ddcd1){if(_0x3ddcd1){return db[_0xf6f1('0x68')][_0xf6f1('0x25')]({'where':{'ListId':_0x568a09[_0xf6f1('0x3c')][_0xf6f1('0x8d')],'VoiceQueueId':_0x568a09[_0xf6f1('0x4d')]['id']}})[_0xf6f1('0x24')](function(){return _0x3ddcd1;});}})[_0xf6f1('0x24')](respondWithStatusCode(_0x2c48c6,null))[_0xf6f1('0x51')](handleError(_0x2c48c6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6428435..08e646c 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4664=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x4664,0x1e9));var _0x4466=function(_0x13f2ec,_0x407206){_0x13f2ec=_0x13f2ec-0x0;var _0x389ca9=_0x4664[_0x13f2ec];return _0x389ca9;};'use strict';var EventEmitter=require(_0x4466('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x4466('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4466('0x2')](0x0);var events={'afterCreate':_0x4466('0x3'),'afterUpdate':_0x4466('0x4'),'afterDestroy':_0x4466('0x5')};function emitEvent(_0x14ce47){return function(_0x10c4ab,_0x2c5211,_0x4fa127){VoiceQueueEvents[_0x4466('0x6')](_0x14ce47+':'+_0x10c4ab['id'],_0x10c4ab);VoiceQueueEvents[_0x4466('0x6')](_0x14ce47,_0x10c4ab);_0x4fa127(null);};}for(var e in events){if(events[_0x4466('0x7')](e)){var event=events[e];VoiceQueue[_0x4466('0x8')](e,emitEvent(event));}}module[_0x4466('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xb9db=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x41b01c,_0x12fb61){var _0x4d3af0=function(_0x30236c){while(--_0x30236c){_0x41b01c['push'](_0x41b01c['shift']());}};_0x4d3af0(++_0x12fb61);}(_0xb9db,0xa7));var _0xbb9d=function(_0x37cfb5,_0x3133df){_0x37cfb5=_0x37cfb5-0x0;var _0x439515=_0xb9db[_0x37cfb5];return _0x439515;};'use strict';var EventEmitter=require(_0xbb9d('0x0'));var VoiceQueue=require(_0xbb9d('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbb9d('0x2')](0x0);var events={'afterCreate':_0xbb9d('0x3'),'afterUpdate':_0xbb9d('0x4'),'afterDestroy':_0xbb9d('0x5')};function emitEvent(_0x3150cc){return function(_0x483899,_0x88ce49,_0x36d725){VoiceQueueEvents[_0xbb9d('0x6')](_0x3150cc+':'+_0x483899['id'],_0x483899);VoiceQueueEvents[_0xbb9d('0x6')](_0x3150cc,_0x483899);_0x36d725(null);};}for(var e in events){if(events[_0xbb9d('0x7')](e)){var event=events[e];VoiceQueue[_0xbb9d('0x8')](e,emitEvent(event));}}module[_0xbb9d('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 8d0ce40..e801146 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1b0565,_0x318694){var _0xa87ea7=function(_0x2c971d){while(--_0x2c971d){_0x1b0565['push'](_0x1b0565['shift']());}};_0xa87ea7(++_0x318694);}(_0x70e0,0x17b));var _0x070e=function(_0x222089,_0x2f935f){_0x222089=_0x222089-0x0;var _0x132992=_0x70e0[_0x222089];return _0x132992;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x34951f,_0x277327){var _0x487db1=function(_0x452a5f){while(--_0x452a5f){_0x34951f['push'](_0x34951f['shift']());}};_0x487db1(++_0x277327);}(_0x008c,0x188));var _0xc008=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x008c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 872e309..18535ad 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x521e=['raw','where','attributes','map','include','model','then','GetVoiceQueue','ShowVoiceQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','VoiceQueue','findAll','options'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x521e,0x19a));var _0xe521=function(_0x2a1f28,_0x1b6a8d){_0x2a1f28=_0x2a1f28-0x0;var _0x5d5185=_0x521e[_0x2a1f28];return _0x5d5185;};'use strict';var _=require(_0xe521('0x0'));var util=require(_0xe521('0x1'));var moment=require(_0xe521('0x2'));var BPromise=require(_0xe521('0x3'));var rs=require(_0xe521('0x4'));var fs=require('fs');var Redis=require(_0xe521('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe521('0x6'));var logger=require(_0xe521('0x7'))(_0xe521('0x8'));var config=require(_0xe521('0x9'));var jayson=require(_0xe521('0xa'));var client=jayson[_0xe521('0xb')]['http']({'port':0x232a});config['redis']=_[_0xe521('0xc')](config['redis'],{'host':_0xe521('0xd'),'port':0x18eb});var socket=require(_0xe521('0xe'))(new Redis(config['redis']));require(_0xe521('0xf'))[_0xe521('0x10')](socket);function respondWithRpcPromise(_0xb17ce1,_0x17a412,_0x18ebc6){return new BPromise(function(_0x341b9a,_0x1691ed){return client[_0xe521('0x11')](_0xb17ce1,_0x18ebc6)['then'](function(_0x566c65){logger['info'](_0xe521('0x12'),_0x17a412,_0xe521('0x13'));logger[_0xe521('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x17a412,'request\x20sent',JSON[_0xe521('0x15')](_0x566c65));if(_0x566c65[_0xe521('0x16')]){if(_0x566c65[_0xe521('0x16')][_0xe521('0x17')]===0x1f4){logger[_0xe521('0x16')](_0xe521('0x12'),_0x17a412,_0x566c65[_0xe521('0x16')]['message']);return _0x1691ed(_0x566c65[_0xe521('0x16')]['message']);}logger[_0xe521('0x16')](_0xe521('0x12'),_0x17a412,_0x566c65[_0xe521('0x16')][_0xe521('0x18')]);return _0x341b9a(_0x566c65['error'][_0xe521('0x18')]);}else{logger[_0xe521('0x19')](_0xe521('0x12'),_0x17a412,_0xe521('0x13'));_0x341b9a(_0x566c65[_0xe521('0x1a')][_0xe521('0x18')]);}})['catch'](function(_0x2c6a3b){logger[_0xe521('0x16')](_0xe521('0x12'),_0x17a412,_0x2c6a3b);_0x1691ed(_0x2c6a3b);});});}exports['GetVoiceQueue']=function(_0x45f419){var _0x4a03c5=this;return new Promise(function(_0xf2ce97,_0x2ce288){return db[_0xe521('0x1b')][_0xe521('0x1c')]({'raw':_0x45f419[_0xe521('0x1d')]?_0x45f419[_0xe521('0x1d')][_0xe521('0x1e')]===undefined?!![]:![]:!![],'where':_0x45f419[_0xe521('0x1d')]?_0x45f419['options'][_0xe521('0x1f')]||null:null,'attributes':_0x45f419[_0xe521('0x1d')]?_0x45f419[_0xe521('0x1d')][_0xe521('0x20')]||null:null,'limit':_0x45f419['options']?_0x45f419[_0xe521('0x1d')]['limit']||null:null,'include':_0x45f419[_0xe521('0x1d')]?_0x45f419[_0xe521('0x1d')]['include']?_[_0xe521('0x21')](_0x45f419['options'][_0xe521('0x22')],function(_0x286c34){return{'model':db[_0x286c34['model']],'as':_0x286c34['as'],'attributes':_0x286c34['attributes'],'include':_0x286c34['include']?_['map'](_0x286c34[_0xe521('0x22')],function(_0x596983){return{'model':db[_0x596983['model']],'as':_0x596983['as'],'attributes':_0x596983['attributes'],'include':_0x596983[_0xe521('0x22')]?_[_0xe521('0x21')](_0x596983[_0xe521('0x22')],function(_0x1c49ef){return{'model':db[_0x1c49ef[_0xe521('0x23')]],'as':_0x1c49ef['as'],'attributes':_0x1c49ef[_0xe521('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe521('0x24')](function(_0x1de1f0){logger['info']('GetVoiceQueue',_0x45f419);logger[_0xe521('0x14')](_0xe521('0x25'),_0x45f419,JSON[_0xe521('0x15')](_0x1de1f0));_0xf2ce97(_0x1de1f0);})['catch'](function(_0x2b4eb7){logger[_0xe521('0x16')](_0xe521('0x25'),_0x2b4eb7[_0xe521('0x18')],_0x45f419);_0x2ce288(_0x4a03c5[_0xe521('0x16')](0x1f4,_0x2b4eb7[_0xe521('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x358b88){var _0x56c4f1=this;return new Promise(function(_0x26164f,_0xe5178e){return db[_0xe521('0x1b')]['find']({'raw':_0x358b88[_0xe521('0x1d')]?_0x358b88['options'][_0xe521('0x1e')]===undefined?!![]:![]:!![],'where':_0x358b88[_0xe521('0x1d')]?_0x358b88['options'][_0xe521('0x1f')]||null:null,'attributes':_0x358b88['options']?_0x358b88[_0xe521('0x1d')][_0xe521('0x20')]||null:null,'include':_0x358b88[_0xe521('0x1d')]?_0x358b88[_0xe521('0x1d')][_0xe521('0x22')]?_[_0xe521('0x21')](_0x358b88[_0xe521('0x1d')][_0xe521('0x22')],function(_0x3edc5c){return{'model':db[_0x3edc5c[_0xe521('0x23')]],'as':_0x3edc5c['as'],'attributes':_0x3edc5c['attributes'],'include':_0x3edc5c[_0xe521('0x22')]?_['map'](_0x3edc5c['include'],function(_0x30bf89){return{'model':db[_0x30bf89[_0xe521('0x23')]],'as':_0x30bf89['as'],'attributes':_0x30bf89['attributes'],'include':_0x30bf89['include']?_[_0xe521('0x21')](_0x30bf89[_0xe521('0x22')],function(_0x305ad7){return{'model':db[_0x305ad7[_0xe521('0x23')]],'as':_0x305ad7['as'],'attributes':_0x305ad7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe521('0x24')](function(_0x3ff397){logger[_0xe521('0x19')](_0xe521('0x26'),_0x358b88);logger[_0xe521('0x14')](_0xe521('0x26'),_0x358b88,JSON[_0xe521('0x15')](_0x3ff397));_0x26164f(_0x3ff397);})[_0xe521('0x27')](function(_0x77a14b){logger[_0xe521('0x16')]('ShowVoiceQueue',_0x77a14b[_0xe521('0x18')],_0x358b88);_0xe5178e(_0x56c4f1[_0xe521('0x16')](0x1f4,_0x77a14b[_0xe521('0x18')]));});});}; \ No newline at end of file +var _0x63dd=['include','map','model','ShowVoiceQueue','find','where','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit'];(function(_0x368b37,_0x526a35){var _0x380a7b=function(_0x123ed3){while(--_0x123ed3){_0x368b37['push'](_0x368b37['shift']());}};_0x380a7b(++_0x526a35);}(_0x63dd,0xa0));var _0xd63d=function(_0xdd74bb,_0x49e2b8){_0xdd74bb=_0xdd74bb-0x0;var _0x4d8939=_0x63dd[_0xdd74bb];return _0x4d8939;};'use strict';var _=require(_0xd63d('0x0'));var util=require(_0xd63d('0x1'));var moment=require(_0xd63d('0x2'));var BPromise=require(_0xd63d('0x3'));var rs=require(_0xd63d('0x4'));var fs=require('fs');var Redis=require(_0xd63d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd63d('0x6'));var jayson=require(_0xd63d('0x7'));var client=jayson[_0xd63d('0x8')][_0xd63d('0x9')]({'port':0x232a});config[_0xd63d('0xa')]=_[_0xd63d('0xb')](config[_0xd63d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd63d('0xa')]));require(_0xd63d('0xc'))[_0xd63d('0xd')](socket);function respondWithRpcPromise(_0x2fa2ca,_0x14a305,_0x437397){return new BPromise(function(_0x184466,_0x150d96){return client[_0xd63d('0xe')](_0x2fa2ca,_0x437397)[_0xd63d('0xf')](function(_0x49586d){logger[_0xd63d('0x10')](_0xd63d('0x11'),_0x14a305,'request\x20sent');logger[_0xd63d('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x14a305,_0xd63d('0x13'),JSON['stringify'](_0x49586d));if(_0x49586d[_0xd63d('0x14')]){if(_0x49586d[_0xd63d('0x14')][_0xd63d('0x15')]===0x1f4){logger[_0xd63d('0x14')](_0xd63d('0x11'),_0x14a305,_0x49586d[_0xd63d('0x14')][_0xd63d('0x16')]);return _0x150d96(_0x49586d['error']['message']);}logger['error'](_0xd63d('0x11'),_0x14a305,_0x49586d[_0xd63d('0x14')][_0xd63d('0x16')]);return _0x184466(_0x49586d[_0xd63d('0x14')][_0xd63d('0x16')]);}else{logger[_0xd63d('0x10')](_0xd63d('0x11'),_0x14a305,'request\x20sent');_0x184466(_0x49586d[_0xd63d('0x17')][_0xd63d('0x16')]);}})['catch'](function(_0x35c933){logger[_0xd63d('0x14')](_0xd63d('0x11'),_0x14a305,_0x35c933);_0x150d96(_0x35c933);});});}exports[_0xd63d('0x18')]=function(_0x2e208d){var _0x44e951=this;return new Promise(function(_0x541d92,_0x40f617){return db[_0xd63d('0x19')]['findAll']({'raw':_0x2e208d[_0xd63d('0x1a')]?_0x2e208d[_0xd63d('0x1a')][_0xd63d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e208d[_0xd63d('0x1a')]?_0x2e208d[_0xd63d('0x1a')]['where']||null:null,'attributes':_0x2e208d[_0xd63d('0x1a')]?_0x2e208d[_0xd63d('0x1a')][_0xd63d('0x1c')]||null:null,'limit':_0x2e208d['options']?_0x2e208d[_0xd63d('0x1a')][_0xd63d('0x1d')]||null:null,'include':_0x2e208d[_0xd63d('0x1a')]?_0x2e208d[_0xd63d('0x1a')][_0xd63d('0x1e')]?_[_0xd63d('0x1f')](_0x2e208d[_0xd63d('0x1a')][_0xd63d('0x1e')],function(_0x1d24ec){return{'model':db[_0x1d24ec[_0xd63d('0x20')]],'as':_0x1d24ec['as'],'attributes':_0x1d24ec['attributes'],'include':_0x1d24ec['include']?_[_0xd63d('0x1f')](_0x1d24ec[_0xd63d('0x1e')],function(_0x44e35b){return{'model':db[_0x44e35b[_0xd63d('0x20')]],'as':_0x44e35b['as'],'attributes':_0x44e35b[_0xd63d('0x1c')],'include':_0x44e35b[_0xd63d('0x1e')]?_[_0xd63d('0x1f')](_0x44e35b[_0xd63d('0x1e')],function(_0x1ee4be){return{'model':db[_0x1ee4be['model']],'as':_0x1ee4be['as'],'attributes':_0x1ee4be[_0xd63d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd63d('0xf')](function(_0x2889c9){logger[_0xd63d('0x10')](_0xd63d('0x18'),_0x2e208d);logger['debug'](_0xd63d('0x18'),_0x2e208d,JSON['stringify'](_0x2889c9));_0x541d92(_0x2889c9);})['catch'](function(_0x2223f3){logger[_0xd63d('0x14')]('GetVoiceQueue',_0x2223f3[_0xd63d('0x16')],_0x2e208d);_0x40f617(_0x44e951[_0xd63d('0x14')](0x1f4,_0x2223f3[_0xd63d('0x16')]));});});};exports[_0xd63d('0x21')]=function(_0x4326dd){var _0x505a68=this;return new Promise(function(_0x20c2d6,_0xb3acb1){return db[_0xd63d('0x19')][_0xd63d('0x22')]({'raw':_0x4326dd['options']?_0x4326dd[_0xd63d('0x1a')][_0xd63d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4326dd[_0xd63d('0x1a')]?_0x4326dd[_0xd63d('0x1a')][_0xd63d('0x23')]||null:null,'attributes':_0x4326dd[_0xd63d('0x1a')]?_0x4326dd[_0xd63d('0x1a')][_0xd63d('0x1c')]||null:null,'include':_0x4326dd[_0xd63d('0x1a')]?_0x4326dd['options'][_0xd63d('0x1e')]?_[_0xd63d('0x1f')](_0x4326dd['options']['include'],function(_0x2abb13){return{'model':db[_0x2abb13[_0xd63d('0x20')]],'as':_0x2abb13['as'],'attributes':_0x2abb13['attributes'],'include':_0x2abb13[_0xd63d('0x1e')]?_[_0xd63d('0x1f')](_0x2abb13[_0xd63d('0x1e')],function(_0x5dc29d){return{'model':db[_0x5dc29d['model']],'as':_0x5dc29d['as'],'attributes':_0x5dc29d['attributes'],'include':_0x5dc29d[_0xd63d('0x1e')]?_[_0xd63d('0x1f')](_0x5dc29d[_0xd63d('0x1e')],function(_0x554034){return{'model':db[_0x554034[_0xd63d('0x20')]],'as':_0x554034['as'],'attributes':_0x554034[_0xd63d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd63d('0xf')](function(_0x4b0f19){logger[_0xd63d('0x10')]('ShowVoiceQueue',_0x4326dd);logger[_0xd63d('0x12')](_0xd63d('0x21'),_0x4326dd,JSON[_0xd63d('0x24')](_0x4b0f19));_0x20c2d6(_0x4b0f19);})[_0xd63d('0x25')](function(_0x2b7d41){logger['error'](_0xd63d('0x21'),_0x2b7d41[_0xd63d('0x16')],_0x4326dd);_0xb3acb1(_0x505a68[_0xd63d('0x14')](0x1f4,_0x2b7d41[_0xd63d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index cdb7efc..3a573a8 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf482=['./voiceQueue.events','save','update','emit','removeListener','length','voiceQueue:'];(function(_0xa17720,_0x20d772){var _0x4c1821=function(_0x31a80c){while(--_0x31a80c){_0xa17720['push'](_0xa17720['shift']());}};_0x4c1821(++_0x20d772);}(_0xf482,0x1b9));var _0x2f48=function(_0x5c43f0,_0x1b7db6){_0x5c43f0=_0x5c43f0-0x0;var _0x3067fa=_0xf482[_0x5c43f0];return _0x3067fa;};'use strict';var VoiceQueueEvents=require(_0x2f48('0x0'));var events=[_0x2f48('0x1'),'remove',_0x2f48('0x2')];function createListener(_0x247965,_0x29ced4){return function(_0x4fa21f){_0x29ced4[_0x2f48('0x3')](_0x247965,_0x4fa21f);};}function removeListener(_0x2c0318,_0x1786c2){return function(){VoiceQueueEvents[_0x2f48('0x4')](_0x2c0318,_0x1786c2);};}exports['register']=function(_0x250bf4){for(var _0x5797c1=0x0,_0x52ccbb=events[_0x2f48('0x5')];_0x5797c1<_0x52ccbb;_0x5797c1++){var _0xd3acc7=events[_0x5797c1];var _0x56c55c=createListener(_0x2f48('0x6')+_0xd3acc7,_0x250bf4);VoiceQueueEvents['on'](_0xd3acc7,_0x56c55c);}}; \ No newline at end of file +var _0xbc6a=['update','emit','removeListener','register','length','voiceQueue:','save','remove'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xbc6a,0x106));var _0xabc6=function(_0x2c4f3c,_0x155175){_0x2c4f3c=_0x2c4f3c-0x0;var _0xcea6dd=_0xbc6a[_0x2c4f3c];return _0xcea6dd;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xabc6('0x0'),_0xabc6('0x1'),_0xabc6('0x2')];function createListener(_0x334681,_0x585af0){return function(_0x1255bf){_0x585af0[_0xabc6('0x3')](_0x334681,_0x1255bf);};}function removeListener(_0x244603,_0x187108){return function(){VoiceQueueEvents[_0xabc6('0x4')](_0x244603,_0x187108);};}exports[_0xabc6('0x5')]=function(_0x24dc52){for(var _0x3ee10f=0x0,_0x91a889=events[_0xabc6('0x6')];_0x3ee10f<_0x91a889;_0x3ee10f++){var _0x5b624b=events[_0x3ee10f];var _0x58b763=createListener(_0xabc6('0x7')+_0x5b624b,_0x24dc52);VoiceQueueEvents['on'](_0x5b624b,_0x58b763);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9deb8f2..1f34a7b 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd91f=['index','/describe','/index','getVoiceQueuesReport','show','post','/:id','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated'];(function(_0x1ebfeb,_0x706229){var _0x3c8eaa=function(_0x70b583){while(--_0x70b583){_0x1ebfeb['push'](_0x1ebfeb['shift']());}};_0x3c8eaa(++_0x706229);}(_0xd91f,0x105));var _0xfd91=function(_0xe957e3,_0x2f333e){_0xe957e3=_0xe957e3-0x0;var _0x21e397=_0xd91f[_0xe957e3];return _0x21e397;};'use strict';var multer=require(_0xfd91('0x0'));var util=require(_0xfd91('0x1'));var path=require(_0xfd91('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfd91('0x3')]();var fs_extra=require(_0xfd91('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd91('0x5'));var controller=require(_0xfd91('0x6'));router[_0xfd91('0x7')]('/',auth[_0xfd91('0x8')](),controller[_0xfd91('0x9')]);router[_0xfd91('0x7')](_0xfd91('0xa'),auth[_0xfd91('0x8')](),controller['describe']);router[_0xfd91('0x7')](_0xfd91('0xb'),auth['isAuthenticated'](),controller[_0xfd91('0xc')]);router[_0xfd91('0x7')]('/:id',auth[_0xfd91('0x8')](),controller[_0xfd91('0xd')]);router[_0xfd91('0xe')]('/',auth[_0xfd91('0x8')](),controller['create']);router['put'](_0xfd91('0xf'),auth[_0xfd91('0x8')](),controller['update']);router[_0xfd91('0x10')](_0xfd91('0xf'),auth[_0xfd91('0x8')](),controller[_0xfd91('0x11')]);module['exports']=router; \ No newline at end of file +var _0x55ce=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x25c3f9,_0x20ca4c){var _0xb82785=function(_0x190b19){while(--_0x190b19){_0x25c3f9['push'](_0x25c3f9['shift']());}};_0xb82785(++_0x20ca4c);}(_0x55ce,0x192));var _0xe55c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x55ce[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe55c('0x0'));var util=require(_0xe55c('0x1'));var path=require(_0xe55c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe55c('0x3'));var auth=require(_0xe55c('0x4'));var interaction=require(_0xe55c('0x5'));var config=require(_0xe55c('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xe55c('0x7')](),controller[_0xe55c('0x8')]);router[_0xe55c('0x9')](_0xe55c('0xa'),auth[_0xe55c('0x7')](),controller[_0xe55c('0xb')]);router['get']('/index',auth[_0xe55c('0x7')](),controller['getVoiceQueuesReport']);router[_0xe55c('0x9')](_0xe55c('0xc'),auth[_0xe55c('0x7')](),controller[_0xe55c('0xd')]);router['post']('/',auth[_0xe55c('0x7')](),controller[_0xe55c('0xe')]);router[_0xe55c('0xf')]('/:id',auth[_0xe55c('0x7')](),controller[_0xe55c('0x10')]);router[_0xe55c('0x11')](_0xe55c('0xc'),auth[_0xe55c('0x7')](),controller[_0xe55c('0x12')]);module[_0xe55c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a58224a..db6907d 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a5c=['setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x7a5c,0x198));var _0xc7a5=function(_0x1cc309,_0x434fa4){_0x1cc309=_0x1cc309-0x0;var _0x54e37e=_0x7a5c[_0x1cc309];return _0x54e37e;};'use strict';var Sequelize=require(_0xc7a5('0x0'));var moment=require(_0xc7a5('0x1'));module['exports']={'type':{'type':Sequelize[_0xc7a5('0x2')]},'uniqueid':{'type':Sequelize[_0xc7a5('0x2')]},'calleridnum':{'type':Sequelize[_0xc7a5('0x2')]},'calleridname':{'type':Sequelize[_0xc7a5('0x2')]},'queue':{'type':Sequelize[_0xc7a5('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xc7a5('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xc7a5('0x3')],'set':function(_0x57d680){var _0x872aa7=moment(_0x57d680);var _0x33f9c3=moment(this['getDataValue'](_0xc7a5('0x4')))['format'](_0xc7a5('0x5'));var _0x3c43b1=_0x872aa7[_0xc7a5('0x6')](_0x33f9c3,_0xc7a5('0x7'));this['setDataValue']('queuecallerleaveAt',_0x57d680);this[_0xc7a5('0x8')]('holdtime',_0x3c43b1||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xc7a5('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xc7a5('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc7a5('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xc7a5('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc7a5('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc7a5('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xc7a5('0xb')},'originalposition':{'type':Sequelize[_0xc7a5('0x9')]},'channel':{'type':Sequelize[_0xc7a5('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc7a5('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc7a5('0x2')]},'holdtime':{'type':Sequelize[_0xc7a5('0x9')]},'mohtime':{'type':Sequelize[_0xc7a5('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc7a5('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc7a5('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xc7a5('0xc')},'transferexten':{'type':Sequelize[_0xc7a5('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc7a5('0x2')]},'secondDisposition':{'type':Sequelize[_0xc7a5('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xc7a5('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc199=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x24f638,_0x43554a){var _0x4a451b=function(_0x1b4a9c){while(--_0x1b4a9c){_0x24f638['push'](_0x24f638['shift']());}};_0x4a451b(++_0x43554a);}(_0xc199,0x9b));var _0x9c19=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xc199[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require(_0x9c19('0x0'));var moment=require(_0x9c19('0x1'));module[_0x9c19('0x2')]={'type':{'type':Sequelize[_0x9c19('0x3')]},'uniqueid':{'type':Sequelize[_0x9c19('0x3')]},'calleridnum':{'type':Sequelize[_0x9c19('0x3')]},'calleridname':{'type':Sequelize[_0x9c19('0x3')]},'queue':{'type':Sequelize[_0x9c19('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9c19('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9c19('0x4')],'set':function(_0x109d23){var _0x5452c9=moment(_0x109d23);var _0x5780a2=moment(this[_0x9c19('0x5')](_0x9c19('0x6')))[_0x9c19('0x7')](_0x9c19('0x8'));var _0x58affd=_0x5452c9['diff'](_0x5780a2,_0x9c19('0x9'));this['setDataValue'](_0x9c19('0xa'),_0x109d23);this[_0x9c19('0xb')](_0x9c19('0xc'),_0x58affd||null);}},'position':{'type':Sequelize[_0x9c19('0xd')]},'count':{'type':Sequelize[_0x9c19('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9c19('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9c19('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9c19('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9c19('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9c19('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x9c19('0x3')],'comment':_0x9c19('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9c19('0x3')]},'connectedlinename':{'type':Sequelize[_0x9c19('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9c19('0x3')]},'exten':{'type':Sequelize[_0x9c19('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x9c19('0xd')]},'mohtime':{'type':Sequelize[_0x9c19('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9c19('0x3')]},'transfer':{'type':Sequelize[_0x9c19('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9c19('0x3')],'comment':_0x9c19('0x10')},'transferexten':{'type':Sequelize[_0x9c19('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9c19('0x3')]},'disposition':{'type':Sequelize[_0x9c19('0x3')]},'secondDisposition':{'type':Sequelize[_0x9c19('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9c19('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 9abd2ea..1618200 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ddb=['find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x6643d8,_0x4c4e24){var _0xa5e314=function(_0x304de8){while(--_0x304de8){_0x6643d8['push'](_0x6643d8['shift']());}};_0xa5e314(++_0x4c4e24);}(_0x3ddb,0xb1));var _0xb3dd=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x3ddb[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0xb3dd('0x0'));var rimraf=require(_0xb3dd('0x1'));var zipdir=require(_0xb3dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3dd('0x3'));var moment=require(_0xb3dd('0x4'));var BPromise=require(_0xb3dd('0x5'));var Mustache=require(_0xb3dd('0x6'));var util=require(_0xb3dd('0x7'));var path=require(_0xb3dd('0x8'));var sox=require(_0xb3dd('0x9'));var csv=require(_0xb3dd('0xa'));var ejs=require(_0xb3dd('0xb'));var fs=require('fs');var fs_extra=require(_0xb3dd('0xc'));var _=require('lodash');var squel=require(_0xb3dd('0xd'));var crypto=require(_0xb3dd('0xe'));var jsforce=require(_0xb3dd('0xf'));var deskjs=require(_0xb3dd('0x10'));var toCsv=require(_0xb3dd('0xa'));var querystring=require(_0xb3dd('0x11'));var Papa=require(_0xb3dd('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb3dd('0x13'));var as=require(_0xb3dd('0x14'));var hardwareService=require(_0xb3dd('0x15'));var logger=require('../../config/logger')(_0xb3dd('0x16'));var utils=require(_0xb3dd('0x17'));var config=require(_0xb3dd('0x18'));var licenseUtil=require(_0xb3dd('0x19'));var db=require(_0xb3dd('0x1a'))['db'];config['redis']=_[_0xb3dd('0x1b')](config[_0xb3dd('0x1c')],{'host':_0xb3dd('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3dd('0x1c')]));require(_0xb3dd('0x1e'))[_0xb3dd('0x1f')](socket);function respondWithStatusCode(_0x58b6de,_0x2ecc03){_0x2ecc03=_0x2ecc03||0xcc;return function(_0x2ad849){if(_0x2ad849){return _0x58b6de['sendStatus'](_0x2ecc03);}return _0x58b6de[_0xb3dd('0x20')](_0x2ecc03)['end']();};}function respondWithResult(_0x5a1afa,_0x4920ca){_0x4920ca=_0x4920ca||0xc8;return function(_0x38d235){if(_0x38d235){return _0x5a1afa['status'](_0x4920ca)[_0xb3dd('0x21')](_0x38d235);}};}function respondWithFilteredResult(_0x320fde,_0x5c5a3b){return function(_0x4a3f45){if(_0x4a3f45){var _0x3e3735=typeof _0x5c5a3b[_0xb3dd('0x22')]==='undefined'&&typeof _0x5c5a3b['limit']===_0xb3dd('0x23');var _0xc412f2=_0x4a3f45['count'];var _0x560bfa=_0x3e3735?0x0:_0x5c5a3b['offset'];var _0x69931c=_0x3e3735?_0x4a3f45[_0xb3dd('0x24')]:_0x5c5a3b[_0xb3dd('0x22')]+_0x5c5a3b[_0xb3dd('0x25')];var _0xc3361c;if(_0x69931c>=_0xc412f2){_0x69931c=_0xc412f2;_0xc3361c=0xc8;}else{_0xc3361c=0xce;}_0x320fde[_0xb3dd('0x20')](_0xc3361c);return _0x320fde[_0xb3dd('0x26')](_0xb3dd('0x27'),_0x560bfa+'-'+_0x69931c+'/'+_0xc412f2)[_0xb3dd('0x21')](_0x4a3f45);}return null;};}function patchUpdates(_0x55a7aa){return function(_0x37a06f){try{jsonpatch['apply'](_0x37a06f,_0x55a7aa,!![]);}catch(_0x34faab){return BPromise['reject'](_0x34faab);}return _0x37a06f[_0xb3dd('0x28')]();};}function saveUpdates(_0x43ee4e,_0x4532d4){return function(_0x3d7643){if(_0x3d7643){return _0x3d7643[_0xb3dd('0x29')](_0x43ee4e)[_0xb3dd('0x2a')](function(_0x2dda09){return _0x2dda09;});}return null;};}function removeEntity(_0x3aab20,_0xbfa065){return function(_0x40d308){if(_0x40d308){return _0x40d308[_0xb3dd('0x2b')]()[_0xb3dd('0x2a')](function(){_0x3aab20['status'](0xcc)[_0xb3dd('0x2c')]();});}};}function handleEntityNotFound(_0xcc1ebe,_0x2f296a){return function(_0x5e559e){if(!_0x5e559e){_0xcc1ebe['sendStatus'](0x194);}return _0x5e559e;};}function handleError(_0x34960f,_0x2109ef){_0x2109ef=_0x2109ef||0x1f4;return function(_0x4fa8c4){logger[_0xb3dd('0x2d')](_0x4fa8c4[_0xb3dd('0x2e')]);if(_0x4fa8c4[_0xb3dd('0x2f')]){delete _0x4fa8c4[_0xb3dd('0x2f')];}_0x34960f[_0xb3dd('0x20')](_0x2109ef)[_0xb3dd('0x30')](_0x4fa8c4);};}exports[_0xb3dd('0x31')]=function(_0x4f03d3,_0x1deb35){var _0x453f1d={},_0x132b41={},_0x4e62ae={'count':0x0,'rows':[]};var _0x50c487=_[_0xb3dd('0x32')](db[_0xb3dd('0x33')][_0xb3dd('0x34')],function(_0x48baad){return{'name':_0x48baad[_0xb3dd('0x35')],'type':_0x48baad[_0xb3dd('0x36')][_0xb3dd('0x37')]};});_0x132b41[_0xb3dd('0x38')]=_[_0xb3dd('0x32')](_0x50c487,_0xb3dd('0x2f'));_0x132b41[_0xb3dd('0x39')]=_[_0xb3dd('0x3a')](_0x4f03d3['query']);_0x132b41['filters']=_[_0xb3dd('0x3b')](_0x132b41[_0xb3dd('0x38')],_0x132b41[_0xb3dd('0x39')]);_0x453f1d[_0xb3dd('0x3c')]=_['intersection'](_0x132b41['model'],qs[_0xb3dd('0x3d')](_0x4f03d3['query'][_0xb3dd('0x3d')]));_0x453f1d[_0xb3dd('0x3c')]=_0x453f1d['attributes'][_0xb3dd('0x3e')]?_0x453f1d[_0xb3dd('0x3c')]:_0x132b41['model'];if(!_0x4f03d3['query'][_0xb3dd('0x3f')](_0xb3dd('0x40'))){_0x453f1d[_0xb3dd('0x25')]=qs[_0xb3dd('0x25')](_0x4f03d3[_0xb3dd('0x39')]['limit']);_0x453f1d[_0xb3dd('0x22')]=qs[_0xb3dd('0x22')](_0x4f03d3[_0xb3dd('0x39')][_0xb3dd('0x22')]);}_0x453f1d[_0xb3dd('0x41')]=qs[_0xb3dd('0x42')](_0x4f03d3['query'][_0xb3dd('0x42')]);_0x453f1d['where']=qs[_0xb3dd('0x43')](_[_0xb3dd('0x44')](_0x4f03d3['query'],_0x132b41[_0xb3dd('0x43')]),_0x50c487);if(_0x4f03d3['query'][_0xb3dd('0x45')]){_0x453f1d[_0xb3dd('0x46')]=_[_0xb3dd('0x47')](_0x453f1d[_0xb3dd('0x46')],{'$or':_['map'](_0x50c487,function(_0x3bd4d6){if(_0x3bd4d6[_0xb3dd('0x36')]!==_0xb3dd('0x48')){var _0x28c1a8={};_0x28c1a8[_0x3bd4d6[_0xb3dd('0x2f')]]={'$like':'%'+_0x4f03d3['query']['filter']+'%'};return _0x28c1a8;}})});}_0x453f1d=_[_0xb3dd('0x47')]({},_0x453f1d,_0x4f03d3[_0xb3dd('0x49')]);var _0x4bdd03={'where':_0x453f1d[_0xb3dd('0x46')]};return db['VoiceQueueReport'][_0xb3dd('0x24')](_0x4bdd03)['then'](function(_0x35ddd6){_0x4e62ae[_0xb3dd('0x24')]=_0x35ddd6;if(_0x4f03d3[_0xb3dd('0x39')][_0xb3dd('0x4a')]){_0x453f1d[_0xb3dd('0x4b')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xb3dd('0x4c')](_0x453f1d);})[_0xb3dd('0x2a')](function(_0x4f68ec){_0x4e62ae[_0xb3dd('0x4d')]=_0x4f68ec;return _0x4e62ae;})['then'](respondWithFilteredResult(_0x1deb35,_0x453f1d))[_0xb3dd('0x4e')](handleError(_0x1deb35,null));};exports[_0xb3dd('0x4f')]=function(_0x261293,_0xfece0f){var _0x5980f0={'raw':![],'where':{'id':_0x261293[_0xb3dd('0x50')]['id']}},_0x45df8d={};_0x45df8d[_0xb3dd('0x38')]=_['keys'](db['VoiceQueueReport'][_0xb3dd('0x34')]);_0x45df8d[_0xb3dd('0x39')]=_[_0xb3dd('0x3a')](_0x261293[_0xb3dd('0x39')]);_0x45df8d[_0xb3dd('0x43')]=_[_0xb3dd('0x3b')](_0x45df8d[_0xb3dd('0x38')],_0x45df8d['query']);_0x5980f0[_0xb3dd('0x3c')]=_[_0xb3dd('0x3b')](_0x45df8d[_0xb3dd('0x38')],qs['fields'](_0x261293[_0xb3dd('0x39')]['fields']));_0x5980f0['attributes']=_0x5980f0[_0xb3dd('0x3c')][_0xb3dd('0x3e')]?_0x5980f0[_0xb3dd('0x3c')]:_0x45df8d['model'];if(_0x261293['query'][_0xb3dd('0x4a')]){_0x5980f0['include']=[{'all':!![]}];}_0x5980f0=_[_0xb3dd('0x47')]({},_0x5980f0,_0x261293[_0xb3dd('0x49')]);return db[_0xb3dd('0x33')][_0xb3dd('0x51')](_0x5980f0)[_0xb3dd('0x2a')](handleEntityNotFound(_0xfece0f,null))[_0xb3dd('0x2a')](respondWithResult(_0xfece0f,null))[_0xb3dd('0x4e')](handleError(_0xfece0f,null));};exports[_0xb3dd('0x52')]=function(_0x4634b7,_0x15d41d){return db[_0xb3dd('0x33')]['create'](_0x4634b7[_0xb3dd('0x53')],{})[_0xb3dd('0x2a')](respondWithResult(_0x15d41d,0xc9))[_0xb3dd('0x4e')](handleError(_0x15d41d,null));};exports[_0xb3dd('0x29')]=function(_0x5571f3,_0x1da962){if(_0x5571f3[_0xb3dd('0x53')]['id']){delete _0x5571f3[_0xb3dd('0x53')]['id'];}return db['VoiceQueueReport'][_0xb3dd('0x51')]({'where':{'id':_0x5571f3[_0xb3dd('0x50')]['id']}})[_0xb3dd('0x2a')](handleEntityNotFound(_0x1da962,null))['then'](saveUpdates(_0x5571f3[_0xb3dd('0x53')],null))[_0xb3dd('0x2a')](respondWithResult(_0x1da962,null))[_0xb3dd('0x4e')](handleError(_0x1da962,null));};exports[_0xb3dd('0x2b')]=function(_0x3ea118,_0x5ae417){return db[_0xb3dd('0x33')][_0xb3dd('0x51')]({'where':{'id':_0x3ea118['params']['id']}})[_0xb3dd('0x2a')](handleEntityNotFound(_0x5ae417,null))['then'](removeEntity(_0x5ae417,null))['catch'](handleError(_0x5ae417,null));};exports[_0xb3dd('0x54')]=function(_0x1060ee,_0x420258){return db[_0xb3dd('0x33')][_0xb3dd('0x54')]()[_0xb3dd('0x2a')](respondWithResult(_0x420258,null))[_0xb3dd('0x4e')](handleError(_0x420258,null));};exports['getVoiceQueuesReport']=function(_0x2be274,_0x17d6e4){var _0x2f1fc9={},_0x60de2b={},_0x4341f8={'count':0x0,'rows':[]};_0x60de2b[_0xb3dd('0x38')]=_[_0xb3dd('0x3a')](db[_0xb3dd('0x33')]['rawAttributes']);_0x60de2b['query']=_[_0xb3dd('0x3a')](_0x2be274[_0xb3dd('0x39')]);_0x60de2b[_0xb3dd('0x43')]=_[_0xb3dd('0x3b')](_0x60de2b[_0xb3dd('0x38')],_0x60de2b[_0xb3dd('0x39')]);_0x2f1fc9[_0xb3dd('0x3c')]=_['intersection'](_0x60de2b['model'],qs[_0xb3dd('0x3d')](_0x2be274[_0xb3dd('0x39')][_0xb3dd('0x3d')]));_0x2f1fc9[_0xb3dd('0x3c')]=_0x2f1fc9[_0xb3dd('0x3c')][_0xb3dd('0x3e')]?_0x2f1fc9[_0xb3dd('0x3c')]:_0x60de2b[_0xb3dd('0x38')];if(!_0x2be274[_0xb3dd('0x39')]['hasOwnProperty'](_0xb3dd('0x40'))){_0x2f1fc9[_0xb3dd('0x25')]=qs[_0xb3dd('0x25')](_0x2be274['query']['limit']);_0x2f1fc9[_0xb3dd('0x22')]=qs[_0xb3dd('0x22')](_0x2be274[_0xb3dd('0x39')]['offset']);}_0x2f1fc9[_0xb3dd('0x41')]=qs[_0xb3dd('0x42')](_0x2be274[_0xb3dd('0x39')]['sort']);_0x2f1fc9[_0xb3dd('0x46')]=qs[_0xb3dd('0x43')](_[_0xb3dd('0x44')](_0x2be274['query'],_0x60de2b[_0xb3dd('0x43')]));if(_0x2be274[_0xb3dd('0x39')][_0xb3dd('0x45')]){_0x2f1fc9['where']=_['merge'](_0x2f1fc9[_0xb3dd('0x46')],{'$or':_[_0xb3dd('0x32')](_0x2f1fc9[_0xb3dd('0x3c')],function(_0x1a57e5){var _0x59930f={};_0x59930f[_0x1a57e5]={'$like':'%'+_0x2be274[_0xb3dd('0x39')][_0xb3dd('0x45')]+'%'};return _0x59930f;})});}_0x2f1fc9=_[_0xb3dd('0x47')]({},_0x2f1fc9,_0x2be274[_0xb3dd('0x49')]);var _0x149d1c={'where':_0x2f1fc9['where']};return db[_0xb3dd('0x33')]['count'](_0x149d1c)['then'](function(_0x403665){_0x4341f8[_0xb3dd('0x24')]=_0x403665;if(_0x2be274[_0xb3dd('0x39')][_0xb3dd('0x4a')]){_0x2f1fc9[_0xb3dd('0x4b')]=[{'all':!![]}];}return db[_0xb3dd('0x33')][_0xb3dd('0x4c')](_0x2f1fc9);})[_0xb3dd('0x2a')](function(_0x2dbb59){_0x4341f8[_0xb3dd('0x4d')]=_0x2dbb59;return _0x4341f8;})['then'](respondWithFilteredResult(_0x17d6e4,_0x2f1fc9,_0xb3dd('0x55')))[_0xb3dd('0x4e')](handleError(_0x17d6e4,null,_0xb3dd('0x55')));}; \ No newline at end of file +var _0x39a0=['apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','find','catch','create','body','describe','getVoiceQueuesReport','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x3cda1e,_0x5522bb){var _0x1e3367=function(_0xfd2979){while(--_0xfd2979){_0x3cda1e['push'](_0x3cda1e['shift']());}};_0x1e3367(++_0x5522bb);}(_0x39a0,0x135));var _0x039a=function(_0x1607ed,_0x3ea125){_0x1607ed=_0x1607ed-0x0;var _0x4c4cc4=_0x39a0[_0x1607ed];return _0x4c4cc4;};'use strict';var emlformat=require(_0x039a('0x0'));var rimraf=require(_0x039a('0x1'));var zipdir=require(_0x039a('0x2'));var jsonpatch=require(_0x039a('0x3'));var rp=require(_0x039a('0x4'));var moment=require(_0x039a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x039a('0x6'));var util=require(_0x039a('0x7'));var path=require(_0x039a('0x8'));var sox=require(_0x039a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x039a('0xa'));var _=require(_0x039a('0xb'));var squel=require(_0x039a('0xc'));var crypto=require(_0x039a('0xd'));var jsforce=require(_0x039a('0xe'));var deskjs=require(_0x039a('0xf'));var toCsv=require(_0x039a('0x10'));var querystring=require(_0x039a('0x11'));var Papa=require(_0x039a('0x12'));var Redis=require(_0x039a('0x13'));var authService=require(_0x039a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x039a('0x15'));var hardwareService=require(_0x039a('0x16'));var logger=require('../../config/logger')(_0x039a('0x17'));var utils=require('../../config/utils');var config=require(_0x039a('0x18'));var licenseUtil=require(_0x039a('0x19'));var db=require(_0x039a('0x1a'))['db'];config[_0x039a('0x1b')]=_[_0x039a('0x1c')](config[_0x039a('0x1b')],{'host':_0x039a('0x1d'),'port':0x18eb});var socket=require(_0x039a('0x1e'))(new Redis(config[_0x039a('0x1b')]));require(_0x039a('0x1f'))[_0x039a('0x20')](socket);function respondWithStatusCode(_0x16d9d5,_0x3dced2){_0x3dced2=_0x3dced2||0xcc;return function(_0x24a117){if(_0x24a117){return _0x16d9d5[_0x039a('0x21')](_0x3dced2);}return _0x16d9d5[_0x039a('0x22')](_0x3dced2)[_0x039a('0x23')]();};}function respondWithResult(_0x11fc16,_0xe7dae){_0xe7dae=_0xe7dae||0xc8;return function(_0x58548f){if(_0x58548f){return _0x11fc16['status'](_0xe7dae)['json'](_0x58548f);}};}function respondWithFilteredResult(_0xe2ff7c,_0x5ddc9d){return function(_0x4c5d86){if(_0x4c5d86){var _0x13e861=typeof _0x5ddc9d[_0x039a('0x24')]===_0x039a('0x25')&&typeof _0x5ddc9d[_0x039a('0x26')]===_0x039a('0x25');var _0x1acbb6=_0x4c5d86[_0x039a('0x27')];var _0x270abc=_0x13e861?0x0:_0x5ddc9d[_0x039a('0x24')];var _0x5e77cd=_0x13e861?_0x4c5d86[_0x039a('0x27')]:_0x5ddc9d[_0x039a('0x24')]+_0x5ddc9d[_0x039a('0x26')];var _0x1c9f78;if(_0x5e77cd>=_0x1acbb6){_0x5e77cd=_0x1acbb6;_0x1c9f78=0xc8;}else{_0x1c9f78=0xce;}_0xe2ff7c[_0x039a('0x22')](_0x1c9f78);return _0xe2ff7c[_0x039a('0x28')](_0x039a('0x29'),_0x270abc+'-'+_0x5e77cd+'/'+_0x1acbb6)[_0x039a('0x2a')](_0x4c5d86);}return null;};}function patchUpdates(_0x32fdb3){return function(_0x2a7003){try{jsonpatch[_0x039a('0x2b')](_0x2a7003,_0x32fdb3,!![]);}catch(_0x3aaf19){return BPromise[_0x039a('0x2c')](_0x3aaf19);}return _0x2a7003[_0x039a('0x2d')]();};}function saveUpdates(_0x57a27c,_0x2f6b89){return function(_0xb19346){if(_0xb19346){return _0xb19346[_0x039a('0x2e')](_0x57a27c)[_0x039a('0x2f')](function(_0xb25683){return _0xb25683;});}return null;};}function removeEntity(_0x263f29,_0x465ffe){return function(_0x391c6a){if(_0x391c6a){return _0x391c6a[_0x039a('0x30')]()[_0x039a('0x2f')](function(){_0x263f29[_0x039a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a16b7,_0x133db6){return function(_0x3708fc){if(!_0x3708fc){_0x5a16b7[_0x039a('0x21')](0x194);}return _0x3708fc;};}function handleError(_0x507142,_0x2a162e){_0x2a162e=_0x2a162e||0x1f4;return function(_0x136a7d){logger[_0x039a('0x31')](_0x136a7d[_0x039a('0x32')]);if(_0x136a7d[_0x039a('0x33')]){delete _0x136a7d['name'];}_0x507142[_0x039a('0x22')](_0x2a162e)[_0x039a('0x34')](_0x136a7d);};}exports[_0x039a('0x35')]=function(_0x4b3ee7,_0x20d3e0){var _0x24b7e5={},_0x1c066c={},_0x5e985b={'count':0x0,'rows':[]};var _0x187e7b=_[_0x039a('0x36')](db[_0x039a('0x37')][_0x039a('0x38')],function(_0x3aad83){return{'name':_0x3aad83[_0x039a('0x39')],'type':_0x3aad83[_0x039a('0x3a')][_0x039a('0x3b')]};});_0x1c066c['model']=_[_0x039a('0x36')](_0x187e7b,_0x039a('0x33'));_0x1c066c[_0x039a('0x3c')]=_[_0x039a('0x3d')](_0x4b3ee7[_0x039a('0x3c')]);_0x1c066c[_0x039a('0x3e')]=_['intersection'](_0x1c066c[_0x039a('0x3f')],_0x1c066c[_0x039a('0x3c')]);_0x24b7e5[_0x039a('0x40')]=_[_0x039a('0x41')](_0x1c066c[_0x039a('0x3f')],qs[_0x039a('0x42')](_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x42')]));_0x24b7e5[_0x039a('0x40')]=_0x24b7e5[_0x039a('0x40')][_0x039a('0x43')]?_0x24b7e5['attributes']:_0x1c066c[_0x039a('0x3f')];if(!_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x44')](_0x039a('0x45'))){_0x24b7e5[_0x039a('0x26')]=qs[_0x039a('0x26')](_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x26')]);_0x24b7e5[_0x039a('0x24')]=qs[_0x039a('0x24')](_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x24')]);}_0x24b7e5[_0x039a('0x46')]=qs[_0x039a('0x47')](_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x47')]);_0x24b7e5[_0x039a('0x48')]=qs['filters'](_[_0x039a('0x49')](_0x4b3ee7['query'],_0x1c066c[_0x039a('0x3e')]),_0x187e7b);if(_0x4b3ee7['query'][_0x039a('0x4a')]){_0x24b7e5[_0x039a('0x48')]=_[_0x039a('0x4b')](_0x24b7e5[_0x039a('0x48')],{'$or':_[_0x039a('0x36')](_0x187e7b,function(_0x24a2ac){if(_0x24a2ac[_0x039a('0x3a')]!==_0x039a('0x4c')){var _0x1b4996={};_0x1b4996[_0x24a2ac[_0x039a('0x33')]]={'$like':'%'+_0x4b3ee7[_0x039a('0x3c')]['filter']+'%'};return _0x1b4996;}})});}_0x24b7e5=_['merge']({},_0x24b7e5,_0x4b3ee7['options']);var _0x8a817={'where':_0x24b7e5[_0x039a('0x48')]};return db[_0x039a('0x37')][_0x039a('0x27')](_0x8a817)[_0x039a('0x2f')](function(_0x327595){_0x5e985b['count']=_0x327595;if(_0x4b3ee7[_0x039a('0x3c')][_0x039a('0x4d')]){_0x24b7e5[_0x039a('0x4e')]=[{'all':!![]}];}return db[_0x039a('0x37')][_0x039a('0x4f')](_0x24b7e5);})[_0x039a('0x2f')](function(_0x148a2e){_0x5e985b['rows']=_0x148a2e;return _0x5e985b;})[_0x039a('0x2f')](respondWithFilteredResult(_0x20d3e0,_0x24b7e5))['catch'](handleError(_0x20d3e0,null));};exports['show']=function(_0x5af1b5,_0x47612a){var _0x1016c3={'raw':![],'where':{'id':_0x5af1b5[_0x039a('0x50')]['id']}},_0x4383fc={};_0x4383fc['model']=_[_0x039a('0x3d')](db[_0x039a('0x37')][_0x039a('0x38')]);_0x4383fc['query']=_['keys'](_0x5af1b5[_0x039a('0x3c')]);_0x4383fc[_0x039a('0x3e')]=_[_0x039a('0x41')](_0x4383fc[_0x039a('0x3f')],_0x4383fc[_0x039a('0x3c')]);_0x1016c3['attributes']=_[_0x039a('0x41')](_0x4383fc[_0x039a('0x3f')],qs[_0x039a('0x42')](_0x5af1b5['query'][_0x039a('0x42')]));_0x1016c3[_0x039a('0x40')]=_0x1016c3[_0x039a('0x40')][_0x039a('0x43')]?_0x1016c3[_0x039a('0x40')]:_0x4383fc[_0x039a('0x3f')];if(_0x5af1b5[_0x039a('0x3c')][_0x039a('0x4d')]){_0x1016c3[_0x039a('0x4e')]=[{'all':!![]}];}_0x1016c3=_[_0x039a('0x4b')]({},_0x1016c3,_0x5af1b5['options']);return db[_0x039a('0x37')][_0x039a('0x51')](_0x1016c3)[_0x039a('0x2f')](handleEntityNotFound(_0x47612a,null))[_0x039a('0x2f')](respondWithResult(_0x47612a,null))[_0x039a('0x52')](handleError(_0x47612a,null));};exports[_0x039a('0x53')]=function(_0x24981f,_0xc58f1b){return db['VoiceQueueReport']['create'](_0x24981f['body'],{})[_0x039a('0x2f')](respondWithResult(_0xc58f1b,0xc9))[_0x039a('0x52')](handleError(_0xc58f1b,null));};exports[_0x039a('0x2e')]=function(_0x403e1d,_0x2a35c2){if(_0x403e1d[_0x039a('0x54')]['id']){delete _0x403e1d[_0x039a('0x54')]['id'];}return db[_0x039a('0x37')][_0x039a('0x51')]({'where':{'id':_0x403e1d[_0x039a('0x50')]['id']}})[_0x039a('0x2f')](handleEntityNotFound(_0x2a35c2,null))[_0x039a('0x2f')](saveUpdates(_0x403e1d[_0x039a('0x54')],null))[_0x039a('0x2f')](respondWithResult(_0x2a35c2,null))[_0x039a('0x52')](handleError(_0x2a35c2,null));};exports[_0x039a('0x30')]=function(_0x2c9e58,_0x229a0d){return db[_0x039a('0x37')][_0x039a('0x51')]({'where':{'id':_0x2c9e58[_0x039a('0x50')]['id']}})[_0x039a('0x2f')](handleEntityNotFound(_0x229a0d,null))[_0x039a('0x2f')](removeEntity(_0x229a0d,null))['catch'](handleError(_0x229a0d,null));};exports['describe']=function(_0x250f6b,_0x2e9883){return db[_0x039a('0x37')][_0x039a('0x55')]()[_0x039a('0x2f')](respondWithResult(_0x2e9883,null))[_0x039a('0x52')](handleError(_0x2e9883,null));};exports[_0x039a('0x56')]=function(_0xe37f69,_0x4e33f9){var _0x3572ce={},_0x588554={},_0x535a76={'count':0x0,'rows':[]};_0x588554[_0x039a('0x3f')]=_['keys'](db['VoiceQueueReport'][_0x039a('0x38')]);_0x588554[_0x039a('0x3c')]=_['keys'](_0xe37f69[_0x039a('0x3c')]);_0x588554[_0x039a('0x3e')]=_[_0x039a('0x41')](_0x588554['model'],_0x588554[_0x039a('0x3c')]);_0x3572ce[_0x039a('0x40')]=_[_0x039a('0x41')](_0x588554[_0x039a('0x3f')],qs[_0x039a('0x42')](_0xe37f69[_0x039a('0x3c')][_0x039a('0x42')]));_0x3572ce['attributes']=_0x3572ce[_0x039a('0x40')][_0x039a('0x43')]?_0x3572ce[_0x039a('0x40')]:_0x588554[_0x039a('0x3f')];if(!_0xe37f69[_0x039a('0x3c')]['hasOwnProperty'](_0x039a('0x45'))){_0x3572ce[_0x039a('0x26')]=qs[_0x039a('0x26')](_0xe37f69[_0x039a('0x3c')][_0x039a('0x26')]);_0x3572ce['offset']=qs[_0x039a('0x24')](_0xe37f69[_0x039a('0x3c')][_0x039a('0x24')]);}_0x3572ce[_0x039a('0x46')]=qs[_0x039a('0x47')](_0xe37f69[_0x039a('0x3c')][_0x039a('0x47')]);_0x3572ce['where']=qs[_0x039a('0x3e')](_[_0x039a('0x49')](_0xe37f69[_0x039a('0x3c')],_0x588554[_0x039a('0x3e')]));if(_0xe37f69[_0x039a('0x3c')][_0x039a('0x4a')]){_0x3572ce[_0x039a('0x48')]=_[_0x039a('0x4b')](_0x3572ce[_0x039a('0x48')],{'$or':_[_0x039a('0x36')](_0x3572ce['attributes'],function(_0x268991){var _0x364fd4={};_0x364fd4[_0x268991]={'$like':'%'+_0xe37f69[_0x039a('0x3c')][_0x039a('0x4a')]+'%'};return _0x364fd4;})});}_0x3572ce=_[_0x039a('0x4b')]({},_0x3572ce,_0xe37f69[_0x039a('0x57')]);var _0xefb155={'where':_0x3572ce[_0x039a('0x48')]};return db[_0x039a('0x37')][_0x039a('0x27')](_0xefb155)['then'](function(_0x5797a6){_0x535a76[_0x039a('0x27')]=_0x5797a6;if(_0xe37f69[_0x039a('0x3c')][_0x039a('0x4d')]){_0x3572ce[_0x039a('0x4e')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x039a('0x4f')](_0x3572ce);})[_0x039a('0x2f')](function(_0x10e130){_0x535a76['rows']=_0x10e130;return _0x535a76;})['then'](respondWithFilteredResult(_0x4e33f9,_0x3572ce,'getVoiceQueuesReport'))['catch'](handleError(_0x4e33f9,null,_0x039a('0x56')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 59872ff..950baf6 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f9c=['hook','../../mysqldb','VoiceQueueReport','save','remove','hasOwnProperty'];(function(_0x5baf32,_0x103278){var _0x539cae=function(_0x43c0c2){while(--_0x43c0c2){_0x5baf32['push'](_0x5baf32['shift']());}};_0x539cae(++_0x103278);}(_0x1f9c,0xa9));var _0xc1f9=function(_0x16cceb,_0x4a2003){_0x16cceb=_0x16cceb-0x0;var _0x49a084=_0x1f9c[_0x16cceb];return _0x49a084;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xc1f9('0x0'))['db'][_0xc1f9('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1f9('0x2'),'afterUpdate':'update','afterDestroy':_0xc1f9('0x3')};function emitEvent(_0x14f288){return function(_0x2f1660,_0x422a7a,_0x42f492){VoiceQueueReportEvents['emit'](_0x14f288+':'+_0x2f1660['id'],_0x2f1660);VoiceQueueReportEvents['emit'](_0x14f288,_0x2f1660);_0x42f492(null);};}for(var e in events){if(events[_0xc1f9('0x4')](e)){var event=events[e];VoiceQueueReport[_0xc1f9('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x1596=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x5a83aa,_0x2c0331){var _0x18d7c3=function(_0x6a3301){while(--_0x6a3301){_0x5a83aa['push'](_0x5a83aa['shift']());}};_0x18d7c3(++_0x2c0331);}(_0x1596,0xbc));var _0x6159=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1596[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x6159('0x0'));var VoiceQueueReport=require(_0x6159('0x1'))['db'][_0x6159('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6159('0x3')](0x0);var events={'afterCreate':_0x6159('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5020f1){return function(_0x36afff,_0xd7dbda,_0x3f3f0f){VoiceQueueReportEvents[_0x6159('0x5')](_0x5020f1+':'+_0x36afff['id'],_0x36afff);VoiceQueueReportEvents[_0x6159('0x5')](_0x5020f1,_0x36afff);_0x3f3f0f(null);};}for(var e in events){if(events[_0x6159('0x6')](e)){var event=events[e];VoiceQueueReport[_0x6159('0x7')](e,emitEvent(event));}}module[_0x6159('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9921092..2f3544f 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd394=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd394,0x1eb));var _0x4d39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd394[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d39('0x0'));var util=require(_0x4d39('0x1'));var logger=require('../../config/logger')(_0x4d39('0x2'));var moment=require(_0x4d39('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d39('0x4'));var fs=require('fs');var path=require(_0x4d39('0x5'));var rimraf=require(_0x4d39('0x6'));var config=require(_0x4d39('0x7'));var attributes=require(_0x4d39('0x8'));module[_0x4d39('0x9')]=function(_0x5809b8,_0x3367a1){return _0x5809b8[_0x4d39('0xa')](_0x4d39('0xb'),attributes,{'tableName':_0x4d39('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4d39('0xd')]},{'fields':[_0x4d39('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb8=['exports','define','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0xadb8,0x1ba));var _0x8adb=function(_0x431c26,_0x4b8f47){_0x431c26=_0x431c26-0x0;var _0x3092fd=_0xadb8[_0x431c26];return _0x3092fd;};'use strict';var _=require(_0x8adb('0x0'));var util=require('util');var logger=require(_0x8adb('0x1'))(_0x8adb('0x2'));var moment=require(_0x8adb('0x3'));var BPromise=require(_0x8adb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8adb('0x5'));var rimraf=require(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var attributes=require(_0x8adb('0x8'));module[_0x8adb('0x9')]=function(_0x468d28,_0x1a903d){return _0x468d28[_0x8adb('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c1b9cc9..9566fc9 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc885=['findAll','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceQueueReport'];(function(_0x136f04,_0x13c0e8){var _0x14daee=function(_0x47479b){while(--_0x47479b){_0x136f04['push'](_0x136f04['shift']());}};_0x14daee(++_0x13c0e8);}(_0xc885,0x91));var _0x5c88=function(_0x49754e,_0x52476e){_0x49754e=_0x49754e-0x0;var _0x19d226=_0xc885[_0x49754e];return _0x19d226;};'use strict';var _=require(_0x5c88('0x0'));var util=require(_0x5c88('0x1'));var moment=require(_0x5c88('0x2'));var BPromise=require(_0x5c88('0x3'));var rs=require(_0x5c88('0x4'));var fs=require('fs');var Redis=require(_0x5c88('0x5'));var db=require(_0x5c88('0x6'))['db'];var utils=require(_0x5c88('0x7'));var logger=require(_0x5c88('0x8'))(_0x5c88('0x9'));var config=require('../../config/environment');var jayson=require(_0x5c88('0xa'));var client=jayson['client'][_0x5c88('0xb')]({'port':0x232a});config['redis']=_[_0x5c88('0xc')](config[_0x5c88('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c88('0xe'))(new Redis(config[_0x5c88('0xd')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x12af65,_0x1d1bf7,_0x18be61){return new BPromise(function(_0x42d2e2,_0x445c84){return client['request'](_0x12af65,_0x18be61)[_0x5c88('0xf')](function(_0x47d32f){logger[_0x5c88('0x10')](_0x5c88('0x11'),_0x1d1bf7,'request\x20sent');logger[_0x5c88('0x12')](_0x5c88('0x13'),_0x1d1bf7,_0x5c88('0x14'),JSON['stringify'](_0x47d32f));if(_0x47d32f[_0x5c88('0x15')]){if(_0x47d32f[_0x5c88('0x15')][_0x5c88('0x16')]===0x1f4){logger[_0x5c88('0x15')](_0x5c88('0x11'),_0x1d1bf7,_0x47d32f[_0x5c88('0x15')][_0x5c88('0x17')]);return _0x445c84(_0x47d32f[_0x5c88('0x15')][_0x5c88('0x17')]);}logger[_0x5c88('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d1bf7,_0x47d32f[_0x5c88('0x15')][_0x5c88('0x17')]);return _0x42d2e2(_0x47d32f[_0x5c88('0x15')][_0x5c88('0x17')]);}else{logger[_0x5c88('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d1bf7,_0x5c88('0x14'));_0x42d2e2(_0x47d32f[_0x5c88('0x18')][_0x5c88('0x17')]);}})[_0x5c88('0x19')](function(_0x1002c2){logger['error'](_0x5c88('0x11'),_0x1d1bf7,_0x1002c2);_0x445c84(_0x1002c2);});});}exports['GetVoiceQueueReport']=function(_0x438514){var _0x38c6bd=this;return new Promise(function(_0xfcb83c,_0x57e30d){return db[_0x5c88('0x1a')][_0x5c88('0x1b')]({'raw':_0x438514[_0x5c88('0x1c')]?_0x438514[_0x5c88('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x438514[_0x5c88('0x1c')]?_0x438514[_0x5c88('0x1c')][_0x5c88('0x1d')]||null:null,'attributes':_0x438514[_0x5c88('0x1c')]?_0x438514[_0x5c88('0x1c')][_0x5c88('0x1e')]||null:null,'limit':_0x438514['options']?_0x438514['options'][_0x5c88('0x1f')]||null:null,'include':_0x438514[_0x5c88('0x1c')]?_0x438514[_0x5c88('0x1c')][_0x5c88('0x20')]?_['map'](_0x438514[_0x5c88('0x1c')][_0x5c88('0x20')],function(_0x12d6b6){return{'model':db[_0x12d6b6['model']],'as':_0x12d6b6['as'],'attributes':_0x12d6b6[_0x5c88('0x1e')],'include':_0x12d6b6['include']?_[_0x5c88('0x21')](_0x12d6b6[_0x5c88('0x20')],function(_0x1ca254){return{'model':db[_0x1ca254['model']],'as':_0x1ca254['as'],'attributes':_0x1ca254[_0x5c88('0x1e')],'include':_0x1ca254['include']?_[_0x5c88('0x21')](_0x1ca254[_0x5c88('0x20')],function(_0x5d909c){return{'model':db[_0x5d909c[_0x5c88('0x22')]],'as':_0x5d909c['as'],'attributes':_0x5d909c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c88('0xf')](function(_0x36fb19){logger[_0x5c88('0x10')](_0x5c88('0x23'),_0x438514);logger[_0x5c88('0x12')]('GetVoiceQueueReport',_0x438514,JSON[_0x5c88('0x24')](_0x36fb19));_0xfcb83c(_0x36fb19);})['catch'](function(_0x126dc1){logger['error'](_0x5c88('0x23'),_0x126dc1['message'],_0x438514);_0x57e30d(_0x38c6bd[_0x5c88('0x15')](0x1f4,_0x126dc1['message']));});});};exports[_0x5c88('0x25')]=function(_0x1622b0){var _0x42f3fa=this;return new Promise(function(_0x19fa84,_0xe1132){return db[_0x5c88('0x1a')][_0x5c88('0x26')](_0x1622b0[_0x5c88('0x27')],{'raw':_0x1622b0[_0x5c88('0x1c')]?_0x1622b0[_0x5c88('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5c88('0xf')](function(_0x10bc0c){logger[_0x5c88('0x10')](_0x5c88('0x25'),_0x1622b0);logger[_0x5c88('0x12')](_0x5c88('0x25'),_0x1622b0,JSON[_0x5c88('0x24')](_0x10bc0c));_0x19fa84(_0x10bc0c);})[_0x5c88('0x19')](function(_0x382e92){logger[_0x5c88('0x15')](_0x5c88('0x25'),_0x382e92['message'],_0x1622b0);_0xe1132(_0x42f3fa['error'](0x1f4,_0x382e92[_0x5c88('0x17')]));});});};exports[_0x5c88('0x28')]=function(_0x36e854){var _0x53b8aa=this;return new Promise(function(_0x305772,_0x3cb330){return db[_0x5c88('0x1a')][_0x5c88('0x29')](_0x36e854[_0x5c88('0x27')],{'raw':_0x36e854[_0x5c88('0x1c')]?_0x36e854[_0x5c88('0x1c')][_0x5c88('0x2a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e854['options']?_0x36e854[_0x5c88('0x1c')][_0x5c88('0x1d')]||null:null,'attributes':_0x36e854[_0x5c88('0x1c')]?_0x36e854[_0x5c88('0x1c')][_0x5c88('0x1e')]||null:null,'limit':_0x36e854[_0x5c88('0x1c')]?_0x36e854[_0x5c88('0x1c')][_0x5c88('0x1f')]||null:null})[_0x5c88('0xf')](function(_0x2ccc3a){logger[_0x5c88('0x10')](_0x5c88('0x28'),_0x36e854);logger[_0x5c88('0x12')](_0x5c88('0x28'),_0x36e854,JSON[_0x5c88('0x24')](_0x2ccc3a));_0x305772(_0x2ccc3a);})[_0x5c88('0x19')](function(_0x4b7206){logger[_0x5c88('0x15')](_0x5c88('0x28'),_0x4b7206[_0x5c88('0x17')],_0x36e854);_0x3cb330(_0x53b8aa['error'](0x1f4,_0x4b7206['message']));});});}; \ No newline at end of file +var _0x1b2e=['info','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','attributes','limit','include','model','map','debug','CreateVoiceQueueReport','create','raw','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then'];(function(_0x442866,_0x4f988d){var _0x2f30cb=function(_0x34a2fc){while(--_0x34a2fc){_0x442866['push'](_0x442866['shift']());}};_0x2f30cb(++_0x4f988d);}(_0x1b2e,0x70));var _0xe1b2=function(_0x13a985,_0x1587b9){_0x13a985=_0x13a985-0x0;var _0x336a59=_0x1b2e[_0x13a985];return _0x336a59;};'use strict';var _=require(_0xe1b2('0x0'));var util=require(_0xe1b2('0x1'));var moment=require(_0xe1b2('0x2'));var BPromise=require(_0xe1b2('0x3'));var rs=require(_0xe1b2('0x4'));var fs=require('fs');var Redis=require(_0xe1b2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1b2('0x6'));var logger=require(_0xe1b2('0x7'))(_0xe1b2('0x8'));var config=require(_0xe1b2('0x9'));var jayson=require(_0xe1b2('0xa'));var client=jayson[_0xe1b2('0xb')][_0xe1b2('0xc')]({'port':0x232a});config[_0xe1b2('0xd')]=_['defaults'](config[_0xe1b2('0xd')],{'host':_0xe1b2('0xe'),'port':0x18eb});var socket=require(_0xe1b2('0xf'))(new Redis(config[_0xe1b2('0xd')]));require(_0xe1b2('0x10'))[_0xe1b2('0x11')](socket);function respondWithRpcPromise(_0x1039fd,_0x1c816c,_0x216480){return new BPromise(function(_0x4055ce,_0x323cec){return client[_0xe1b2('0x12')](_0x1039fd,_0x216480)[_0xe1b2('0x13')](function(_0xb5a5ea){logger[_0xe1b2('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c816c,'request\x20sent');logger['debug'](_0xe1b2('0x15'),_0x1c816c,_0xe1b2('0x16'),JSON[_0xe1b2('0x17')](_0xb5a5ea));if(_0xb5a5ea[_0xe1b2('0x18')]){if(_0xb5a5ea[_0xe1b2('0x18')][_0xe1b2('0x19')]===0x1f4){logger[_0xe1b2('0x18')](_0xe1b2('0x1a'),_0x1c816c,_0xb5a5ea['error'][_0xe1b2('0x1b')]);return _0x323cec(_0xb5a5ea[_0xe1b2('0x18')]['message']);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1c816c,_0xb5a5ea['error'][_0xe1b2('0x1b')]);return _0x4055ce(_0xb5a5ea['error'][_0xe1b2('0x1b')]);}else{logger['info'](_0xe1b2('0x1a'),_0x1c816c,_0xe1b2('0x16'));_0x4055ce(_0xb5a5ea['result'][_0xe1b2('0x1b')]);}})[_0xe1b2('0x1c')](function(_0xc5d9f0){logger['error'](_0xe1b2('0x1a'),_0x1c816c,_0xc5d9f0);_0x323cec(_0xc5d9f0);});});}exports[_0xe1b2('0x1d')]=function(_0x1e6f1b){var _0x5c9bd7=this;return new Promise(function(_0x33657,_0x26273c){return db[_0xe1b2('0x1e')]['findAll']({'raw':_0x1e6f1b[_0xe1b2('0x1f')]?_0x1e6f1b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e6f1b[_0xe1b2('0x1f')]?_0x1e6f1b[_0xe1b2('0x1f')]['where']||null:null,'attributes':_0x1e6f1b[_0xe1b2('0x1f')]?_0x1e6f1b['options'][_0xe1b2('0x20')]||null:null,'limit':_0x1e6f1b[_0xe1b2('0x1f')]?_0x1e6f1b[_0xe1b2('0x1f')][_0xe1b2('0x21')]||null:null,'include':_0x1e6f1b[_0xe1b2('0x1f')]?_0x1e6f1b[_0xe1b2('0x1f')][_0xe1b2('0x22')]?_['map'](_0x1e6f1b[_0xe1b2('0x1f')]['include'],function(_0x403d22){return{'model':db[_0x403d22[_0xe1b2('0x23')]],'as':_0x403d22['as'],'attributes':_0x403d22['attributes'],'include':_0x403d22[_0xe1b2('0x22')]?_['map'](_0x403d22['include'],function(_0x4c5db8){return{'model':db[_0x4c5db8['model']],'as':_0x4c5db8['as'],'attributes':_0x4c5db8[_0xe1b2('0x20')],'include':_0x4c5db8[_0xe1b2('0x22')]?_[_0xe1b2('0x24')](_0x4c5db8[_0xe1b2('0x22')],function(_0x30cf02){return{'model':db[_0x30cf02['model']],'as':_0x30cf02['as'],'attributes':_0x30cf02[_0xe1b2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49ef1c){logger[_0xe1b2('0x14')](_0xe1b2('0x1d'),_0x1e6f1b);logger[_0xe1b2('0x25')](_0xe1b2('0x1d'),_0x1e6f1b,JSON[_0xe1b2('0x17')](_0x49ef1c));_0x33657(_0x49ef1c);})[_0xe1b2('0x1c')](function(_0x57d372){logger[_0xe1b2('0x18')](_0xe1b2('0x1d'),_0x57d372[_0xe1b2('0x1b')],_0x1e6f1b);_0x26273c(_0x5c9bd7[_0xe1b2('0x18')](0x1f4,_0x57d372[_0xe1b2('0x1b')]));});});};exports[_0xe1b2('0x26')]=function(_0x4080cd){var _0x36ad3c=this;return new Promise(function(_0x118c95,_0x14b50a){return db[_0xe1b2('0x1e')][_0xe1b2('0x27')](_0x4080cd['body'],{'raw':_0x4080cd[_0xe1b2('0x1f')]?_0x4080cd['options'][_0xe1b2('0x28')]===undefined?!![]:![]:!![]})['then'](function(_0x1f493){logger[_0xe1b2('0x14')](_0xe1b2('0x26'),_0x4080cd);logger[_0xe1b2('0x25')](_0xe1b2('0x26'),_0x4080cd,JSON['stringify'](_0x1f493));_0x118c95(_0x1f493);})[_0xe1b2('0x1c')](function(_0x5b0789){logger[_0xe1b2('0x18')](_0xe1b2('0x26'),_0x5b0789[_0xe1b2('0x1b')],_0x4080cd);_0x14b50a(_0x36ad3c['error'](0x1f4,_0x5b0789['message']));});});};exports[_0xe1b2('0x29')]=function(_0x13ae6f){var _0x3f9eed=this;return new Promise(function(_0x43fdf1,_0x40d92b){return db[_0xe1b2('0x1e')][_0xe1b2('0x2a')](_0x13ae6f[_0xe1b2('0x2b')],{'raw':_0x13ae6f[_0xe1b2('0x1f')]?_0x13ae6f['options'][_0xe1b2('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13ae6f[_0xe1b2('0x1f')]?_0x13ae6f['options']['where']||null:null,'attributes':_0x13ae6f[_0xe1b2('0x1f')]?_0x13ae6f[_0xe1b2('0x1f')][_0xe1b2('0x20')]||null:null,'limit':_0x13ae6f['options']?_0x13ae6f[_0xe1b2('0x1f')][_0xe1b2('0x21')]||null:null})[_0xe1b2('0x13')](function(_0x4b0ff5){logger[_0xe1b2('0x14')](_0xe1b2('0x29'),_0x13ae6f);logger['debug'](_0xe1b2('0x29'),_0x13ae6f,JSON['stringify'](_0x4b0ff5));_0x43fdf1(_0x4b0ff5);})['catch'](function(_0x168679){logger[_0xe1b2('0x18')](_0xe1b2('0x29'),_0x168679[_0xe1b2('0x1b')],_0x13ae6f);_0x40d92b(_0x3f9eed[_0xe1b2('0x18')](0x1f4,_0x168679[_0xe1b2('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f988b83..a676790 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23d3=['remove','emit','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x2b0633,_0x5450af){var _0x424611=function(_0x1e9afc){while(--_0x1e9afc){_0x2b0633['push'](_0x2b0633['shift']());}};_0x424611(++_0x5450af);}(_0x23d3,0xe8));var _0x323d=function(_0x3981f6,_0x2bc005){_0x3981f6=_0x3981f6-0x0;var _0x4a123a=_0x23d3[_0x3981f6];return _0x4a123a;};'use strict';var VoiceQueueReportEvents=require(_0x323d('0x0'));var events=[_0x323d('0x1'),_0x323d('0x2'),'update'];function createListener(_0x2401c5,_0x106782){return function(_0x231c35){_0x106782[_0x323d('0x3')](_0x2401c5,_0x231c35);};}function removeListener(_0xeb2e57,_0x3ab786){return function(){VoiceQueueReportEvents['removeListener'](_0xeb2e57,_0x3ab786);};}exports[_0x323d('0x4')]=function(_0x34f513){for(var _0x160a18=0x0,_0x1057c2=events['length'];_0x160a18<_0x1057c2;_0x160a18++){var _0xbcfbc9=events[_0x160a18];var _0x380ae6=createListener(_0x323d('0x5')+_0xbcfbc9,_0x34f513);VoiceQueueReportEvents['on'](_0xbcfbc9,_0x380ae6);}}; \ No newline at end of file +var _0x5495=['emit','register','length','voiceQueueReport:','save','remove','update'];(function(_0xa4bbf3,_0x1d9787){var _0x45d0be=function(_0x41ddd7){while(--_0x41ddd7){_0xa4bbf3['push'](_0xa4bbf3['shift']());}};_0x45d0be(++_0x1d9787);}(_0x5495,0x6d));var _0x5549=function(_0x32acb6,_0xa8fd88){_0x32acb6=_0x32acb6-0x0;var _0x2ebb79=_0x5495[_0x32acb6];return _0x2ebb79;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x5549('0x0'),_0x5549('0x1'),_0x5549('0x2')];function createListener(_0x4393db,_0x3564c1){return function(_0x40bae2){_0x3564c1[_0x5549('0x3')](_0x4393db,_0x40bae2);};}function removeListener(_0x49bef8,_0x320690){return function(){VoiceQueueReportEvents['removeListener'](_0x49bef8,_0x320690);};}exports[_0x5549('0x4')]=function(_0x11aef1){for(var _0x5ba199=0x0,_0x203a8f=events[_0x5549('0x5')];_0x5ba199<_0x203a8f;_0x5ba199++){var _0x34f1cd=events[_0x5ba199];var _0x41cb1f=createListener(_0x5549('0x6')+_0x34f1cd,_0x11aef1);VoiceQueueReportEvents['on'](_0x34f1cd,_0x41cb1f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 73b1c2d..fe0115e 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0534=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x33fa50,_0x5ee37a){var _0x342099=function(_0x5c5d78){while(--_0x5c5d78){_0x33fa50['push'](_0x33fa50['shift']());}};_0x342099(++_0x5ee37a);}(_0x0534,0x190));var _0x4053=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x0534[_0x12f688];return _0x59c3de;};'use strict';var multer=require(_0x4053('0x0'));var util=require(_0x4053('0x1'));var path=require('path');var timeout=require(_0x4053('0x2'));var express=require('express');var router=express[_0x4053('0x3')]();var fs_extra=require(_0x4053('0x4'));var auth=require(_0x4053('0x5'));var interaction=require(_0x4053('0x6'));var config=require(_0x4053('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x4053('0x8')]('/',auth[_0x4053('0x9')](),controller[_0x4053('0xa')]);router[_0x4053('0x8')]('/:id',auth[_0x4053('0x9')](),controller[_0x4053('0xb')]);router[_0x4053('0xc')]('/',auth[_0x4053('0x9')](),controller[_0x4053('0xd')]);router[_0x4053('0xe')](_0x4053('0xf'),auth['isAuthenticated'](),controller[_0x4053('0x10')]);router[_0x4053('0x11')](_0x4053('0xf'),auth[_0x4053('0x9')](),controller[_0x4053('0x12')]);module[_0x4053('0x13')]=router; \ No newline at end of file +var _0xb55a=['create','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x5de86a,_0x23eee9){var _0x1475e6=function(_0x4aadab){while(--_0x4aadab){_0x5de86a['push'](_0x5de86a['shift']());}};_0x1475e6(++_0x23eee9);}(_0xb55a,0x1c3));var _0xab55=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xb55a[_0x20589d];return _0x422de9;};'use strict';var multer=require('multer');var util=require(_0xab55('0x0'));var path=require(_0xab55('0x1'));var timeout=require(_0xab55('0x2'));var express=require(_0xab55('0x3'));var router=express['Router']();var fs_extra=require(_0xab55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab55('0x5'));var config=require('../../config/environment');var controller=require(_0xab55('0x6'));router[_0xab55('0x7')]('/',auth[_0xab55('0x8')](),controller[_0xab55('0x9')]);router[_0xab55('0x7')](_0xab55('0xa'),auth[_0xab55('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xab55('0xb')]);router['put'](_0xab55('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xab55('0xc')](_0xab55('0xa'),auth[_0xab55('0x8')](),controller[_0xab55('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index e13b86e..cfd1d5d 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13c7=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x13c7,0x13c));var _0x713c=function(_0x3d7240,_0x94b1c6){_0x3d7240=_0x3d7240-0x0;var _0x281048=_0x13c7[_0x3d7240];return _0x281048;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x713c('0x0'));module[_0x713c('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x713c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x713c('0x3')],'allowNull':![],'defaultValue':moment()[_0x713c('0x4')](_0x713c('0x5'))}}; \ No newline at end of file +var _0xb145=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x256337,_0x11b4bf){var _0x474f65=function(_0x41892d){while(--_0x41892d){_0x256337['push'](_0x256337['shift']());}};_0x474f65(++_0x11b4bf);}(_0xb145,0xa3));var _0x5b14=function(_0x482369,_0x21b002){_0x482369=_0x482369-0x0;var _0x2692bc=_0xb145[_0x482369];return _0x2692bc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5b14('0x0'));module[_0x5b14('0x1')]={'time':{'type':Sequelize[_0x5b14('0x2')]},'callid':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x5b14('0x3')](_0x5b14('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e244500..843827d 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fb9=['body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','name','send','VoiceQueuesLog','fieldName','type','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','model','rawAttributes','find','create'];(function(_0x9fdd0c,_0x59b230){var _0x224beb=function(_0x4a606e){while(--_0x4a606e){_0x9fdd0c['push'](_0x9fdd0c['shift']());}};_0x224beb(++_0x59b230);}(_0x9fb9,0x1e4));var _0x99fb=function(_0x177c9e,_0x5c52d8){_0x177c9e=_0x177c9e-0x0;var _0x29543a=_0x9fb9[_0x177c9e];return _0x29543a;};'use strict';var emlformat=require(_0x99fb('0x0'));var rimraf=require(_0x99fb('0x1'));var zipdir=require(_0x99fb('0x2'));var jsonpatch=require(_0x99fb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x99fb('0x4'));var Mustache=require(_0x99fb('0x5'));var util=require(_0x99fb('0x6'));var path=require(_0x99fb('0x7'));var sox=require(_0x99fb('0x8'));var csv=require(_0x99fb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99fb('0xa'));var _=require(_0x99fb('0xb'));var squel=require(_0x99fb('0xc'));var crypto=require(_0x99fb('0xd'));var jsforce=require(_0x99fb('0xe'));var deskjs=require(_0x99fb('0xf'));var toCsv=require(_0x99fb('0x9'));var querystring=require(_0x99fb('0x10'));var Papa=require(_0x99fb('0x11'));var Redis=require('ioredis');var authService=require(_0x99fb('0x12'));var qs=require(_0x99fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x99fb('0x14'));var utils=require(_0x99fb('0x15'));var config=require(_0x99fb('0x16'));var licenseUtil=require(_0x99fb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4967e8,_0x2375d3){_0x2375d3=_0x2375d3||0xcc;return function(_0x35535d){if(_0x35535d){return _0x4967e8['sendStatus'](_0x2375d3);}return _0x4967e8[_0x99fb('0x18')](_0x2375d3)[_0x99fb('0x19')]();};}function respondWithResult(_0x1d89fe,_0x55e34a){_0x55e34a=_0x55e34a||0xc8;return function(_0x304cf1){if(_0x304cf1){return _0x1d89fe[_0x99fb('0x18')](_0x55e34a)[_0x99fb('0x1a')](_0x304cf1);}};}function respondWithFilteredResult(_0x9f5396,_0x4bf011){return function(_0xf4c64f){if(_0xf4c64f){var _0x38bbe8=typeof _0x4bf011[_0x99fb('0x1b')]==='undefined'&&typeof _0x4bf011[_0x99fb('0x1c')]==='undefined';var _0x406ebf=_0xf4c64f['count'];var _0x385acf=_0x38bbe8?0x0:_0x4bf011[_0x99fb('0x1b')];var _0x4be192=_0x38bbe8?_0xf4c64f[_0x99fb('0x1d')]:_0x4bf011[_0x99fb('0x1b')]+_0x4bf011[_0x99fb('0x1c')];var _0x266f2a;if(_0x4be192>=_0x406ebf){_0x4be192=_0x406ebf;_0x266f2a=0xc8;}else{_0x266f2a=0xce;}_0x9f5396[_0x99fb('0x18')](_0x266f2a);return _0x9f5396[_0x99fb('0x1e')]('Content-Range',_0x385acf+'-'+_0x4be192+'/'+_0x406ebf)['json'](_0xf4c64f);}return null;};}function patchUpdates(_0x2f547e){return function(_0x55bbc6){try{jsonpatch[_0x99fb('0x1f')](_0x55bbc6,_0x2f547e,!![]);}catch(_0x2834fb){return BPromise[_0x99fb('0x20')](_0x2834fb);}return _0x55bbc6['save']();};}function saveUpdates(_0x165d98,_0x5c359e){return function(_0x1a438b){if(_0x1a438b){return _0x1a438b[_0x99fb('0x21')](_0x165d98)[_0x99fb('0x22')](function(_0x4953fb){return _0x4953fb;});}return null;};}function removeEntity(_0x2b3e3e,_0x2fcb16){return function(_0x4025d3){if(_0x4025d3){return _0x4025d3[_0x99fb('0x23')]()[_0x99fb('0x22')](function(){_0x2b3e3e[_0x99fb('0x18')](0xcc)[_0x99fb('0x19')]();});}};}function handleEntityNotFound(_0x3983ae,_0x410521){return function(_0xc4e2be){if(!_0xc4e2be){_0x3983ae[_0x99fb('0x24')](0x194);}return _0xc4e2be;};}function handleError(_0xac03f4,_0x37ae12){_0x37ae12=_0x37ae12||0x1f4;return function(_0x14f586){logger['error'](_0x14f586['stack']);if(_0x14f586[_0x99fb('0x25')]){delete _0x14f586['name'];}_0xac03f4[_0x99fb('0x18')](_0x37ae12)[_0x99fb('0x26')](_0x14f586);};}exports['index']=function(_0x3d5c80,_0x224756){var _0x55b298={},_0x1d08c3={},_0x32bb85={'count':0x0,'rows':[]};var _0x5ace40=_['map'](db[_0x99fb('0x27')]['rawAttributes'],function(_0x4a7710){return{'name':_0x4a7710[_0x99fb('0x28')],'type':_0x4a7710[_0x99fb('0x29')]['key']};});_0x1d08c3['model']=_['map'](_0x5ace40,_0x99fb('0x25'));_0x1d08c3['query']=_[_0x99fb('0x2a')](_0x3d5c80[_0x99fb('0x2b')]);_0x1d08c3['filters']=_[_0x99fb('0x2c')](_0x1d08c3['model'],_0x1d08c3[_0x99fb('0x2b')]);_0x55b298[_0x99fb('0x2d')]=_[_0x99fb('0x2c')](_0x1d08c3['model'],qs[_0x99fb('0x2e')](_0x3d5c80[_0x99fb('0x2b')][_0x99fb('0x2e')]));_0x55b298[_0x99fb('0x2d')]=_0x55b298[_0x99fb('0x2d')][_0x99fb('0x2f')]?_0x55b298['attributes']:_0x1d08c3['model'];if(!_0x3d5c80['query'][_0x99fb('0x30')](_0x99fb('0x31'))){_0x55b298[_0x99fb('0x1c')]=qs[_0x99fb('0x1c')](_0x3d5c80[_0x99fb('0x2b')][_0x99fb('0x1c')]);_0x55b298[_0x99fb('0x1b')]=qs['offset'](_0x3d5c80['query'][_0x99fb('0x1b')]);}_0x55b298['order']=qs[_0x99fb('0x32')](_0x3d5c80[_0x99fb('0x2b')]['sort']);_0x55b298['where']=qs[_0x99fb('0x33')](_[_0x99fb('0x34')](_0x3d5c80[_0x99fb('0x2b')],_0x1d08c3['filters']),_0x5ace40);if(_0x3d5c80['query'][_0x99fb('0x35')]){_0x55b298[_0x99fb('0x36')]=_[_0x99fb('0x37')](_0x55b298['where'],{'$or':_['map'](_0x5ace40,function(_0x3f3b7d){if(_0x3f3b7d[_0x99fb('0x29')]!==_0x99fb('0x38')){var _0x44d8a2={};_0x44d8a2[_0x3f3b7d[_0x99fb('0x25')]]={'$like':'%'+_0x3d5c80[_0x99fb('0x2b')][_0x99fb('0x35')]+'%'};return _0x44d8a2;}})});}_0x55b298=_[_0x99fb('0x37')]({},_0x55b298,_0x3d5c80[_0x99fb('0x39')]);var _0x5695a9={'where':_0x55b298[_0x99fb('0x36')]};return db[_0x99fb('0x27')][_0x99fb('0x1d')](_0x5695a9)['then'](function(_0x3f8602){_0x32bb85[_0x99fb('0x1d')]=_0x3f8602;if(_0x3d5c80[_0x99fb('0x2b')][_0x99fb('0x3a')]){_0x55b298[_0x99fb('0x3b')]=[{'all':!![]}];}return db[_0x99fb('0x27')]['findAll'](_0x55b298);})[_0x99fb('0x22')](function(_0x4e66a4){_0x32bb85[_0x99fb('0x3c')]=_0x4e66a4;return _0x32bb85;})[_0x99fb('0x22')](respondWithFilteredResult(_0x224756,_0x55b298))[_0x99fb('0x3d')](handleError(_0x224756,null));};exports[_0x99fb('0x3e')]=function(_0x3156ea,_0x317377){var _0x7c5653={'raw':!![],'where':{'id':_0x3156ea[_0x99fb('0x3f')]['id']}},_0x1927a9={};_0x1927a9[_0x99fb('0x40')]=_[_0x99fb('0x2a')](db['VoiceQueuesLog'][_0x99fb('0x41')]);_0x1927a9[_0x99fb('0x2b')]=_[_0x99fb('0x2a')](_0x3156ea[_0x99fb('0x2b')]);_0x1927a9[_0x99fb('0x33')]=_['intersection'](_0x1927a9[_0x99fb('0x40')],_0x1927a9['query']);_0x7c5653['attributes']=_[_0x99fb('0x2c')](_0x1927a9['model'],qs[_0x99fb('0x2e')](_0x3156ea['query'][_0x99fb('0x2e')]));_0x7c5653['attributes']=_0x7c5653[_0x99fb('0x2d')][_0x99fb('0x2f')]?_0x7c5653['attributes']:_0x1927a9[_0x99fb('0x40')];if(_0x3156ea[_0x99fb('0x2b')][_0x99fb('0x3a')]){_0x7c5653[_0x99fb('0x3b')]=[{'all':!![]}];}_0x7c5653=_[_0x99fb('0x37')]({},_0x7c5653,_0x3156ea[_0x99fb('0x39')]);return db[_0x99fb('0x27')][_0x99fb('0x42')](_0x7c5653)[_0x99fb('0x22')](handleEntityNotFound(_0x317377,null))[_0x99fb('0x22')](respondWithResult(_0x317377,null))[_0x99fb('0x3d')](handleError(_0x317377,null));};exports[_0x99fb('0x43')]=function(_0x4353e5,_0x187af6){return db['VoiceQueuesLog'][_0x99fb('0x43')](_0x4353e5[_0x99fb('0x44')],{})[_0x99fb('0x22')](respondWithResult(_0x187af6,0xc9))['catch'](handleError(_0x187af6,null));};exports['update']=function(_0x554ac9,_0x1e5c53){if(_0x554ac9[_0x99fb('0x44')]['id']){delete _0x554ac9[_0x99fb('0x44')]['id'];}return db[_0x99fb('0x27')][_0x99fb('0x42')]({'where':{'id':_0x554ac9['params']['id']}})[_0x99fb('0x22')](handleEntityNotFound(_0x1e5c53,null))[_0x99fb('0x22')](saveUpdates(_0x554ac9[_0x99fb('0x44')],null))['then'](respondWithResult(_0x1e5c53,null))['catch'](handleError(_0x1e5c53,null));};exports[_0x99fb('0x23')]=function(_0x19923f,_0x2993c3){return db[_0x99fb('0x27')]['find']({'where':{'id':_0x19923f['params']['id']}})['then'](handleEntityNotFound(_0x2993c3,null))['then'](removeEntity(_0x2993c3,null))['catch'](handleError(_0x2993c3,null));}; \ No newline at end of file +var _0x8e82=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','destroy','stack','name','send','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','intersection','length','then','catch','create','body','find','eml-format','rimraf','request-promise'];(function(_0xeb7786,_0x53a053){var _0x120bbc=function(_0x291f05){while(--_0x291f05){_0xeb7786['push'](_0xeb7786['shift']());}};_0x120bbc(++_0x53a053);}(_0x8e82,0xcc));var _0x28e8=function(_0xaab024,_0x5a1762){_0xaab024=_0xaab024-0x0;var _0x39bd4a=_0x8e82[_0xaab024];return _0x39bd4a;};'use strict';var emlformat=require(_0x28e8('0x0'));var rimraf=require(_0x28e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28e8('0x2'));var moment=require('moment');var BPromise=require(_0x28e8('0x3'));var Mustache=require(_0x28e8('0x4'));var util=require(_0x28e8('0x5'));var path=require(_0x28e8('0x6'));var sox=require(_0x28e8('0x7'));var csv=require(_0x28e8('0x8'));var ejs=require(_0x28e8('0x9'));var fs=require('fs');var fs_extra=require(_0x28e8('0xa'));var _=require(_0x28e8('0xb'));var squel=require(_0x28e8('0xc'));var crypto=require(_0x28e8('0xd'));var jsforce=require(_0x28e8('0xe'));var deskjs=require(_0x28e8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28e8('0x10'));var Papa=require('papaparse');var Redis=require(_0x28e8('0x11'));var authService=require(_0x28e8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28e8('0x13'));var logger=require(_0x28e8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x28e8('0x15'));var licenseUtil=require(_0x28e8('0x16'));var db=require(_0x28e8('0x17'))['db'];function respondWithStatusCode(_0x4ea5b0,_0x544098){_0x544098=_0x544098||0xcc;return function(_0x59c42f){if(_0x59c42f){return _0x4ea5b0[_0x28e8('0x18')](_0x544098);}return _0x4ea5b0[_0x28e8('0x19')](_0x544098)['end']();};}function respondWithResult(_0x4e66a9,_0x2aa276){_0x2aa276=_0x2aa276||0xc8;return function(_0x32d20f){if(_0x32d20f){return _0x4e66a9[_0x28e8('0x19')](_0x2aa276)[_0x28e8('0x1a')](_0x32d20f);}};}function respondWithFilteredResult(_0x142c02,_0x2e9006){return function(_0x517226){if(_0x517226){var _0x25d278=typeof _0x2e9006[_0x28e8('0x1b')]===_0x28e8('0x1c')&&typeof _0x2e9006[_0x28e8('0x1d')]==='undefined';var _0x2b8f77=_0x517226[_0x28e8('0x1e')];var _0x4d9bd9=_0x25d278?0x0:_0x2e9006['offset'];var _0x58e946=_0x25d278?_0x517226[_0x28e8('0x1e')]:_0x2e9006[_0x28e8('0x1b')]+_0x2e9006['limit'];var _0x10d7c2;if(_0x58e946>=_0x2b8f77){_0x58e946=_0x2b8f77;_0x10d7c2=0xc8;}else{_0x10d7c2=0xce;}_0x142c02[_0x28e8('0x19')](_0x10d7c2);return _0x142c02['set']('Content-Range',_0x4d9bd9+'-'+_0x58e946+'/'+_0x2b8f77)[_0x28e8('0x1a')](_0x517226);}return null;};}function patchUpdates(_0x3f50bb){return function(_0x13e5c1){try{jsonpatch['apply'](_0x13e5c1,_0x3f50bb,!![]);}catch(_0x1852d4){return BPromise[_0x28e8('0x1f')](_0x1852d4);}return _0x13e5c1[_0x28e8('0x20')]();};}function saveUpdates(_0x27d165,_0x1dc94e){return function(_0x59e310){if(_0x59e310){return _0x59e310[_0x28e8('0x21')](_0x27d165)['then'](function(_0x20d334){return _0x20d334;});}return null;};}function removeEntity(_0x1d19e4,_0xf8ab81){return function(_0xf6743b){if(_0xf6743b){return _0xf6743b[_0x28e8('0x22')]()['then'](function(){_0x1d19e4[_0x28e8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a698d,_0x103ba9){return function(_0x212142){if(!_0x212142){_0x5a698d[_0x28e8('0x18')](0x194);}return _0x212142;};}function handleError(_0x4a1465,_0x20ac41){_0x20ac41=_0x20ac41||0x1f4;return function(_0x3c870b){logger['error'](_0x3c870b[_0x28e8('0x23')]);if(_0x3c870b[_0x28e8('0x24')]){delete _0x3c870b[_0x28e8('0x24')];}_0x4a1465[_0x28e8('0x19')](_0x20ac41)[_0x28e8('0x25')](_0x3c870b);};}exports['index']=function(_0x26a509,_0x336104){var _0x51bb1f={},_0x4a45b6={},_0x5c68c1={'count':0x0,'rows':[]};var _0x4d4ea6=_['map'](db[_0x28e8('0x26')][_0x28e8('0x27')],function(_0x293b77){return{'name':_0x293b77[_0x28e8('0x28')],'type':_0x293b77[_0x28e8('0x29')]['key']};});_0x4a45b6[_0x28e8('0x2a')]=_[_0x28e8('0x2b')](_0x4d4ea6,_0x28e8('0x24'));_0x4a45b6[_0x28e8('0x2c')]=_[_0x28e8('0x2d')](_0x26a509[_0x28e8('0x2c')]);_0x4a45b6[_0x28e8('0x2e')]=_['intersection'](_0x4a45b6['model'],_0x4a45b6[_0x28e8('0x2c')]);_0x51bb1f[_0x28e8('0x2f')]=_['intersection'](_0x4a45b6[_0x28e8('0x2a')],qs['fields'](_0x26a509['query'][_0x28e8('0x30')]));_0x51bb1f[_0x28e8('0x2f')]=_0x51bb1f[_0x28e8('0x2f')]['length']?_0x51bb1f[_0x28e8('0x2f')]:_0x4a45b6['model'];if(!_0x26a509['query'][_0x28e8('0x31')](_0x28e8('0x32'))){_0x51bb1f[_0x28e8('0x1d')]=qs[_0x28e8('0x1d')](_0x26a509[_0x28e8('0x2c')][_0x28e8('0x1d')]);_0x51bb1f[_0x28e8('0x1b')]=qs['offset'](_0x26a509['query'][_0x28e8('0x1b')]);}_0x51bb1f['order']=qs[_0x28e8('0x33')](_0x26a509[_0x28e8('0x2c')][_0x28e8('0x33')]);_0x51bb1f[_0x28e8('0x34')]=qs[_0x28e8('0x2e')](_[_0x28e8('0x35')](_0x26a509[_0x28e8('0x2c')],_0x4a45b6['filters']),_0x4d4ea6);if(_0x26a509[_0x28e8('0x2c')]['filter']){_0x51bb1f[_0x28e8('0x34')]=_[_0x28e8('0x36')](_0x51bb1f[_0x28e8('0x34')],{'$or':_[_0x28e8('0x2b')](_0x4d4ea6,function(_0xfae4b4){if(_0xfae4b4[_0x28e8('0x29')]!==_0x28e8('0x37')){var _0x12b028={};_0x12b028[_0xfae4b4[_0x28e8('0x24')]]={'$like':'%'+_0x26a509[_0x28e8('0x2c')][_0x28e8('0x38')]+'%'};return _0x12b028;}})});}_0x51bb1f=_[_0x28e8('0x36')]({},_0x51bb1f,_0x26a509[_0x28e8('0x39')]);var _0x103128={'where':_0x51bb1f[_0x28e8('0x34')]};return db['VoiceQueuesLog'][_0x28e8('0x1e')](_0x103128)['then'](function(_0x2733c6){_0x5c68c1[_0x28e8('0x1e')]=_0x2733c6;if(_0x26a509[_0x28e8('0x2c')]['includeAll']){_0x51bb1f[_0x28e8('0x3a')]=[{'all':!![]}];}return db[_0x28e8('0x26')][_0x28e8('0x3b')](_0x51bb1f);})['then'](function(_0x59448f){_0x5c68c1['rows']=_0x59448f;return _0x5c68c1;})['then'](respondWithFilteredResult(_0x336104,_0x51bb1f))['catch'](handleError(_0x336104,null));};exports[_0x28e8('0x3c')]=function(_0x10048a,_0x3f6c30){var _0xd96af5={'raw':!![],'where':{'id':_0x10048a[_0x28e8('0x3d')]['id']}},_0xcd2b19={};_0xcd2b19[_0x28e8('0x2a')]=_[_0x28e8('0x2d')](db['VoiceQueuesLog'][_0x28e8('0x27')]);_0xcd2b19[_0x28e8('0x2c')]=_[_0x28e8('0x2d')](_0x10048a[_0x28e8('0x2c')]);_0xcd2b19[_0x28e8('0x2e')]=_[_0x28e8('0x3e')](_0xcd2b19[_0x28e8('0x2a')],_0xcd2b19[_0x28e8('0x2c')]);_0xd96af5[_0x28e8('0x2f')]=_[_0x28e8('0x3e')](_0xcd2b19[_0x28e8('0x2a')],qs['fields'](_0x10048a['query'][_0x28e8('0x30')]));_0xd96af5[_0x28e8('0x2f')]=_0xd96af5[_0x28e8('0x2f')][_0x28e8('0x3f')]?_0xd96af5[_0x28e8('0x2f')]:_0xcd2b19[_0x28e8('0x2a')];if(_0x10048a[_0x28e8('0x2c')]['includeAll']){_0xd96af5[_0x28e8('0x3a')]=[{'all':!![]}];}_0xd96af5=_[_0x28e8('0x36')]({},_0xd96af5,_0x10048a['options']);return db[_0x28e8('0x26')]['find'](_0xd96af5)[_0x28e8('0x40')](handleEntityNotFound(_0x3f6c30,null))[_0x28e8('0x40')](respondWithResult(_0x3f6c30,null))[_0x28e8('0x41')](handleError(_0x3f6c30,null));};exports[_0x28e8('0x42')]=function(_0x1c31d7,_0x2a7c81){return db[_0x28e8('0x26')]['create'](_0x1c31d7[_0x28e8('0x43')],{})[_0x28e8('0x40')](respondWithResult(_0x2a7c81,0xc9))[_0x28e8('0x41')](handleError(_0x2a7c81,null));};exports['update']=function(_0x2225f4,_0xf4ace0){if(_0x2225f4[_0x28e8('0x43')]['id']){delete _0x2225f4[_0x28e8('0x43')]['id'];}return db[_0x28e8('0x26')][_0x28e8('0x44')]({'where':{'id':_0x2225f4[_0x28e8('0x3d')]['id']}})['then'](handleEntityNotFound(_0xf4ace0,null))[_0x28e8('0x40')](saveUpdates(_0x2225f4[_0x28e8('0x43')],null))[_0x28e8('0x40')](respondWithResult(_0xf4ace0,null))['catch'](handleError(_0xf4ace0,null));};exports[_0x28e8('0x22')]=function(_0x3a422f,_0x5d6ed2){return db[_0x28e8('0x26')][_0x28e8('0x44')]({'where':{'id':_0x3a422f['params']['id']}})[_0x28e8('0x40')](handleEntityNotFound(_0x5d6ed2,null))[_0x28e8('0x40')](removeEntity(_0x5d6ed2,null))[_0x28e8('0x41')](handleError(_0x5d6ed2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1791ba7..296ec09 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9bb=['event','dtm','../../config/logger','api','path','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm'];(function(_0xe74d5a,_0x5909a4){var _0x47deb7=function(_0x36e87a){while(--_0x36e87a){_0xe74d5a['push'](_0xe74d5a['shift']());}};_0x47deb7(++_0x5909a4);}(_0xb9bb,0xa4));var _0xbb9b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb9bb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbb9b('0x0'))(_0xbb9b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb9b('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbb9b('0x3'));module[_0xbb9b('0x4')]=function(_0x1afa70,_0x224710){return _0x1afa70['define'](_0xbb9b('0x5'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xbb9b('0x6'),'fields':[_0xbb9b('0x7'),_0xbb9b('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd4bd=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','dtm'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0xd4bd,0x15f));var _0xdd4b=function(_0x5012a0,_0x25c11b){_0x5012a0=_0x5012a0-0x0;var _0x37839d=_0xd4bd[_0x5012a0];return _0x37839d;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var logger=require(_0xdd4b('0x2'))(_0xdd4b('0x3'));var moment=require(_0xdd4b('0x4'));var BPromise=require('bluebird');var rp=require(_0xdd4b('0x5'));var fs=require('fs');var path=require(_0xdd4b('0x6'));var rimraf=require(_0xdd4b('0x7'));var config=require(_0xdd4b('0x8'));var attributes=require(_0xdd4b('0x9'));module['exports']=function(_0x48eda4,_0x1c72c7){return _0x48eda4['define'](_0xdd4b('0xa'),attributes,{'tableName':_0xdd4b('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xdd4b('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c27fb12..665e291 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc79=['result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x99cd79,_0x4b87cf){var _0xb7d6e1=function(_0x298e57){while(--_0x298e57){_0x99cd79['push'](_0x99cd79['shift']());}};_0xb7d6e1(++_0x4b87cf);}(_0xfc79,0x1c3));var _0x9fc7=function(_0x494c8b,_0x19dedf){_0x494c8b=_0x494c8b-0x0;var _0x93dfee=_0xfc79[_0x494c8b];return _0x93dfee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9fc7('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fc7('0x1'));var db=require(_0x9fc7('0x2'))['db'];var utils=require(_0x9fc7('0x3'));var logger=require(_0x9fc7('0x4'))('rpc');var config=require(_0x9fc7('0x5'));var jayson=require(_0x9fc7('0x6'));var client=jayson['client'][_0x9fc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x517ce1,_0x2b6bdf,_0x1d6aa8){return new BPromise(function(_0x9dd61b,_0xa95f71){return client[_0x9fc7('0x8')](_0x517ce1,_0x1d6aa8)[_0x9fc7('0x9')](function(_0x47d8c2){logger['info'](_0x9fc7('0xa'),_0x2b6bdf,_0x9fc7('0xb'));logger[_0x9fc7('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2b6bdf,'request\x20sent',JSON[_0x9fc7('0xd')](_0x47d8c2));if(_0x47d8c2[_0x9fc7('0xe')]){if(_0x47d8c2[_0x9fc7('0xe')][_0x9fc7('0xf')]===0x1f4){logger['error'](_0x9fc7('0xa'),_0x2b6bdf,_0x47d8c2[_0x9fc7('0xe')][_0x9fc7('0x10')]);return _0xa95f71(_0x47d8c2['error'][_0x9fc7('0x10')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2b6bdf,_0x47d8c2[_0x9fc7('0xe')][_0x9fc7('0x10')]);return _0x9dd61b(_0x47d8c2[_0x9fc7('0xe')][_0x9fc7('0x10')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x2b6bdf,_0x9fc7('0xb'));_0x9dd61b(_0x47d8c2[_0x9fc7('0x11')][_0x9fc7('0x10')]);}})['catch'](function(_0x5223bd){logger[_0x9fc7('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b6bdf,_0x5223bd);_0xa95f71(_0x5223bd);});});} \ No newline at end of file +var _0x5137=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','message','result','catch','VoiceQueuesLog,\x20%s,\x20%s','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x5137,0x1c9));var _0x7513=function(_0x53de9a,_0x25a9fa){_0x53de9a=_0x53de9a-0x0;var _0x8bbd1=_0x5137[_0x53de9a];return _0x8bbd1;};'use strict';var _=require(_0x7513('0x0'));var util=require('util');var moment=require(_0x7513('0x1'));var BPromise=require(_0x7513('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7513('0x3'));var db=require(_0x7513('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7513('0x5'))(_0x7513('0x6'));var config=require(_0x7513('0x7'));var jayson=require(_0x7513('0x8'));var client=jayson[_0x7513('0x9')][_0x7513('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a090,_0x4ab635,_0x5bad5f){return new BPromise(function(_0x13dbe8,_0x72877e){return client[_0x7513('0xb')](_0x49a090,_0x5bad5f)[_0x7513('0xc')](function(_0x285b89){logger[_0x7513('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4ab635,_0x7513('0xe'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4ab635,'request\x20sent',JSON[_0x7513('0xf')](_0x285b89));if(_0x285b89[_0x7513('0x10')]){if(_0x285b89[_0x7513('0x10')]['code']===0x1f4){logger[_0x7513('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4ab635,_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);return _0x72877e(_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4ab635,_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);return _0x13dbe8(_0x285b89[_0x7513('0x10')][_0x7513('0x11')]);}else{logger[_0x7513('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4ab635,_0x7513('0xe'));_0x13dbe8(_0x285b89[_0x7513('0x12')][_0x7513('0x11')]);}})[_0x7513('0x13')](function(_0x6e3b4f){logger[_0x7513('0x10')](_0x7513('0x14'),_0x4ab635,_0x6e3b4f);_0x72877e(_0x6e3b4f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ca9a0fd..d2c64a6 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3304=['index','/describe','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x43b24f,_0x25463){var _0x203afa=function(_0x278969){while(--_0x278969){_0x43b24f['push'](_0x43b24f['shift']());}};_0x203afa(++_0x25463);}(_0x3304,0x1c9));var _0x4330=function(_0x286233,_0xd2a3c8){_0x286233=_0x286233-0x0;var _0x1ffdfa=_0x3304[_0x286233];return _0x1ffdfa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4330('0x0'));var timeout=require(_0x4330('0x1'));var express=require(_0x4330('0x2'));var router=express[_0x4330('0x3')]();var fs_extra=require(_0x4330('0x4'));var auth=require(_0x4330('0x5'));var interaction=require(_0x4330('0x6'));var config=require(_0x4330('0x7'));var controller=require(_0x4330('0x8'));router[_0x4330('0x9')]('/',auth[_0x4330('0xa')](),controller[_0x4330('0xb')]);router['get'](_0x4330('0xc'),auth['isAuthenticated'](),controller[_0x4330('0xd')]);router['get'](_0x4330('0xe'),auth[_0x4330('0xa')](),controller['show']);router[_0x4330('0x9')](_0x4330('0xf'),auth[_0x4330('0xa')](),controller[_0x4330('0x10')]);router[_0x4330('0x9')](_0x4330('0x11'),controller[_0x4330('0x12')]);router[_0x4330('0x9')](_0x4330('0x13'),auth[_0x4330('0xa')](),controller['downloadTranscribe']);router[_0x4330('0x14')]('/',auth['isAuthenticated'](),controller[_0x4330('0x15')]);router['post'](_0x4330('0x13'),auth['isAuthenticated'](),controller[_0x4330('0x16')]);router[_0x4330('0x17')](_0x4330('0xe'),auth[_0x4330('0xa')](),controller[_0x4330('0x18')]);router[_0x4330('0x19')](_0x4330('0xe'),auth[_0x4330('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x41e7=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x33331a,_0x5dd74d){var _0x264e26=function(_0xbd24fc){while(--_0xbd24fc){_0x33331a['push'](_0x33331a['shift']());}};_0x264e26(++_0x5dd74d);}(_0x41e7,0x1a1));var _0x741e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x41e7[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x741e('0x0'));var path=require(_0x741e('0x1'));var timeout=require(_0x741e('0x2'));var express=require(_0x741e('0x3'));var router=express[_0x741e('0x4')]();var fs_extra=require(_0x741e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x741e('0x6'));var config=require(_0x741e('0x7'));var controller=require(_0x741e('0x8'));router['get']('/',auth[_0x741e('0x9')](),controller[_0x741e('0xa')]);router[_0x741e('0xb')](_0x741e('0xc'),auth[_0x741e('0x9')](),controller[_0x741e('0xd')]);router[_0x741e('0xb')](_0x741e('0xe'),auth[_0x741e('0x9')](),controller[_0x741e('0xf')]);router[_0x741e('0xb')](_0x741e('0x10'),auth['isAuthenticated'](),controller[_0x741e('0x11')]);router['get'](_0x741e('0x12'),controller[_0x741e('0x13')]);router[_0x741e('0xb')](_0x741e('0x14'),auth[_0x741e('0x9')](),controller[_0x741e('0x15')]);router[_0x741e('0x16')]('/',auth[_0x741e('0x9')](),controller['create']);router[_0x741e('0x16')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x741e('0x17')]);router['put'](_0x741e('0xe'),auth['isAuthenticated'](),controller[_0x741e('0x18')]);router[_0x741e('0x19')]('/:id',auth[_0x741e('0x9')](),controller[_0x741e('0x1a')]);module[_0x741e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 925a99b..0f2aa1b 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 27fcd7b..c49384f 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41af=['[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribeAccountId','language','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceRecording','includeAll','include','show','keys','intersection','find','catch','create','params','body','describe','download','../../components/encryptor','uniqueid','recording','value','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','col','token','$and','push','%s.cypher','decryptFile','secrets','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location'];(function(_0x34bff5,_0x2f1ccd){var _0xcaf4da=function(_0x30f9bc){while(--_0x30f9bc){_0x34bff5['push'](_0x34bff5['shift']());}};_0xcaf4da(++_0x2f1ccd);}(_0x41af,0x1e9));var _0xf41a=function(_0x527bf8,_0x1c4c54){_0x527bf8=_0x527bf8-0x0;var _0x23d5f4=_0x41af[_0x527bf8];return _0x23d5f4;};'use strict';var emlformat=require(_0xf41a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf41a('0x1'));var jsonpatch=require(_0xf41a('0x2'));var rp=require(_0xf41a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf41a('0x4'));var path=require(_0xf41a('0x5'));var sox=require(_0xf41a('0x6'));var csv=require('to-csv');var ejs=require(_0xf41a('0x7'));var fs=require('fs');var fs_extra=require(_0xf41a('0x8'));var _=require(_0xf41a('0x9'));var squel=require(_0xf41a('0xa'));var crypto=require(_0xf41a('0xb'));var jsforce=require(_0xf41a('0xc'));var deskjs=require(_0xf41a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf41a('0xe'));var Papa=require(_0xf41a('0xf'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0xf41a('0x10'));var authService=require(_0xf41a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf41a('0x12'));var logger=require(_0xf41a('0x13'))(_0xf41a('0x14'));var utils=require(_0xf41a('0x15'));var config=require(_0xf41a('0x16'));var licenseUtil=require(_0xf41a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d4657,_0xd37e25){_0xd37e25=_0xd37e25||0xcc;return function(_0x52197e){if(_0x52197e){return _0x4d4657['sendStatus'](_0xd37e25);}return _0x4d4657['status'](_0xd37e25)['end']();};}function respondWithResult(_0x121c06,_0x3cf94d){_0x3cf94d=_0x3cf94d||0xc8;return function(_0x548ce6){if(_0x548ce6){return _0x121c06[_0xf41a('0x18')](_0x3cf94d)[_0xf41a('0x19')](_0x548ce6);}};}function respondWithFilteredResult(_0xfa1c7f,_0x2e4df9){return function(_0x44f49d){if(_0x44f49d){var _0x3cb36e=typeof _0x2e4df9['offset']===_0xf41a('0x1a')&&typeof _0x2e4df9[_0xf41a('0x1b')]==='undefined';var _0x17efcf=_0x44f49d[_0xf41a('0x1c')];var _0x5172fe=_0x3cb36e?0x0:_0x2e4df9[_0xf41a('0x1d')];var _0x40b075=_0x3cb36e?_0x44f49d[_0xf41a('0x1c')]:_0x2e4df9[_0xf41a('0x1d')]+_0x2e4df9['limit'];var _0x43feaa;if(_0x40b075>=_0x17efcf){_0x40b075=_0x17efcf;_0x43feaa=0xc8;}else{_0x43feaa=0xce;}_0xfa1c7f['status'](_0x43feaa);return _0xfa1c7f['set'](_0xf41a('0x1e'),_0x5172fe+'-'+_0x40b075+'/'+_0x17efcf)[_0xf41a('0x19')](_0x44f49d);}return null;};}function patchUpdates(_0x5c104c){return function(_0x1c59fc){try{jsonpatch[_0xf41a('0x1f')](_0x1c59fc,_0x5c104c,!![]);}catch(_0x4560f3){return BPromise[_0xf41a('0x20')](_0x4560f3);}return _0x1c59fc[_0xf41a('0x21')]();};}function saveUpdates(_0x5e6071,_0x3cf6c9){return function(_0x168e40){if(_0x168e40){return _0x168e40[_0xf41a('0x22')](_0x5e6071)['then'](function(_0x141a7f){return _0x141a7f;});}return null;};}function removeEntity(_0x28ea81,_0x5ae3c8){return function(_0x3699f5){if(_0x3699f5){return _0x3699f5['destroy']()[_0xf41a('0x23')](function(){_0x28ea81[_0xf41a('0x18')](0xcc)[_0xf41a('0x24')]();});}};}function handleEntityNotFound(_0x37d38d,_0x5b69d1){return function(_0x1c36c9){if(!_0x1c36c9){_0x37d38d[_0xf41a('0x25')](0x194);}return _0x1c36c9;};}function handleError(_0x48c659,_0x1f10c8){_0x1f10c8=_0x1f10c8||0x1f4;return function(_0x3a1dee){logger[_0xf41a('0x26')](_0x3a1dee[_0xf41a('0x27')]);if(_0x3a1dee['name']){delete _0x3a1dee[_0xf41a('0x28')];}_0x48c659[_0xf41a('0x18')](_0x1f10c8)[_0xf41a('0x29')](_0x3a1dee);};}exports['index']=function(_0xe014ca,_0x13c634){var _0x21b53e={},_0xc32faa={},_0x2756e2={'count':0x0,'rows':[]};var _0x22919d=_['map'](db['VoiceRecording'][_0xf41a('0x2a')],function(_0x1d86ad){return{'name':_0x1d86ad[_0xf41a('0x2b')],'type':_0x1d86ad[_0xf41a('0x2c')][_0xf41a('0x2d')]};});_0xc32faa[_0xf41a('0x2e')]=_[_0xf41a('0x2f')](_[_0xf41a('0x30')](_0x22919d,_0xf41a('0x28')),[_0xf41a('0x31')]);_0xc32faa['query']=_['keys'](_0xe014ca[_0xf41a('0x32')]);_0xc32faa[_0xf41a('0x33')]=_['intersection'](_0xc32faa['model'],_0xc32faa[_0xf41a('0x32')]);_0x21b53e['attributes']=_['intersection'](_0xc32faa[_0xf41a('0x2e')],qs[_0xf41a('0x34')](_0xe014ca[_0xf41a('0x32')]['fields']));_0x21b53e[_0xf41a('0x35')]=_0x21b53e[_0xf41a('0x35')][_0xf41a('0x36')]?_0x21b53e[_0xf41a('0x35')]:_0xc32faa[_0xf41a('0x2e')];if(!_0xe014ca[_0xf41a('0x32')]['hasOwnProperty'](_0xf41a('0x37'))){_0x21b53e['limit']=qs[_0xf41a('0x1b')](_0xe014ca['query'][_0xf41a('0x1b')]);_0x21b53e[_0xf41a('0x1d')]=qs['offset'](_0xe014ca[_0xf41a('0x32')][_0xf41a('0x1d')]);}_0x21b53e[_0xf41a('0x38')]=qs[_0xf41a('0x39')](_0xe014ca[_0xf41a('0x32')][_0xf41a('0x39')]);_0x21b53e[_0xf41a('0x3a')]=qs['filters'](_[_0xf41a('0x3b')](_0xe014ca[_0xf41a('0x32')],_0xc32faa[_0xf41a('0x33')]),_0x22919d);if(_0xe014ca[_0xf41a('0x32')]['filter']){_0x21b53e['where']=_[_0xf41a('0x3c')](_0x21b53e[_0xf41a('0x3a')],{'$or':_['map'](_0x22919d,function(_0x5c826b){if(_0x5c826b['type']!==_0xf41a('0x3d')){var _0x20a98c={};_0x20a98c[_0x5c826b[_0xf41a('0x28')]]={'$like':'%'+_0xe014ca['query'][_0xf41a('0x3e')]+'%'};return _0x20a98c;}})});}_0x21b53e=_[_0xf41a('0x3c')]({},_0x21b53e,_0xe014ca[_0xf41a('0x3f')]);var _0x23fb3f={'where':_0x21b53e[_0xf41a('0x3a')]};return db[_0xf41a('0x40')]['count'](_0x23fb3f)['then'](function(_0x3a45f7){_0x2756e2[_0xf41a('0x1c')]=_0x3a45f7;if(_0xe014ca['query'][_0xf41a('0x41')]){_0x21b53e[_0xf41a('0x42')]=[{'all':!![]}];}return db[_0xf41a('0x40')]['findAll'](_0x21b53e);})['then'](function(_0x596bdc){_0x2756e2['rows']=_0x596bdc;return _0x2756e2;})[_0xf41a('0x23')](respondWithFilteredResult(_0x13c634,_0x21b53e))['catch'](handleError(_0x13c634,null));};exports[_0xf41a('0x43')]=function(_0x4b76e3,_0x56d375){var _0x48736d={'raw':![],'where':{'id':_0x4b76e3['params']['id']}},_0x4b265c={};_0x4b265c['model']=_[_0xf41a('0x44')](db['VoiceRecording'][_0xf41a('0x2a')]);_0x4b265c[_0xf41a('0x32')]=_[_0xf41a('0x44')](_0x4b76e3['query']);_0x4b265c[_0xf41a('0x33')]=_[_0xf41a('0x45')](_0x4b265c[_0xf41a('0x2e')],_0x4b265c[_0xf41a('0x32')]);_0x48736d[_0xf41a('0x35')]=_['intersection'](_0x4b265c['model'],qs[_0xf41a('0x34')](_0x4b76e3[_0xf41a('0x32')][_0xf41a('0x34')]));_0x48736d[_0xf41a('0x35')]=_0x48736d['attributes'][_0xf41a('0x36')]?_0x48736d[_0xf41a('0x35')]:_0x4b265c[_0xf41a('0x2e')];if(_0x4b76e3[_0xf41a('0x32')][_0xf41a('0x41')]){_0x48736d[_0xf41a('0x42')]=[{'all':!![]}];}_0x48736d=_[_0xf41a('0x3c')]({},_0x48736d,_0x4b76e3['options']);return db[_0xf41a('0x40')][_0xf41a('0x46')](_0x48736d)['then'](handleEntityNotFound(_0x56d375,null))[_0xf41a('0x23')](respondWithResult(_0x56d375,null))[_0xf41a('0x47')](handleError(_0x56d375,null));};exports[_0xf41a('0x48')]=function(_0x14e691,_0x507f7f){return db['VoiceRecording'][_0xf41a('0x48')](_0x14e691['body'],{})[_0xf41a('0x23')](respondWithResult(_0x507f7f,0xc9))['catch'](handleError(_0x507f7f,null));};exports[_0xf41a('0x22')]=function(_0x3b2a8c,_0x56e328){if(_0x3b2a8c['body']['id']){delete _0x3b2a8c['body']['id'];}return db[_0xf41a('0x40')][_0xf41a('0x46')]({'where':{'id':_0x3b2a8c[_0xf41a('0x49')]['id']}})[_0xf41a('0x23')](handleEntityNotFound(_0x56e328,null))[_0xf41a('0x23')](saveUpdates(_0x3b2a8c[_0xf41a('0x4a')],null))[_0xf41a('0x23')](respondWithResult(_0x56e328,null))[_0xf41a('0x47')](handleError(_0x56e328,null));};exports['describe']=function(_0x143ae2,_0x3c46fe){return db[_0xf41a('0x40')][_0xf41a('0x4b')]()[_0xf41a('0x23')](respondWithResult(_0x3c46fe,null))['catch'](handleError(_0x3c46fe,null));};exports[_0xf41a('0x4c')]=function(_0xbcd5ca,_0x47d999,_0x1d2cff){var _0x2901ef=require(_0xf41a('0x4d'));var _0x1541c2=![];var _0x3d2ad1={};if(_0xbcd5ca[_0xf41a('0x32')]['type']&&_0xbcd5ca[_0xf41a('0x32')]['type']==='uniqueid'){_0x3d2ad1[_0xf41a('0x4e')]=_0xbcd5ca[_0xf41a('0x49')]['id'];}else{_0x3d2ad1['id']=_0xbcd5ca[_0xf41a('0x49')]['id'];}return db[_0xf41a('0x40')][_0xf41a('0x46')]({'where':_0x3d2ad1,'attributes':['id','value'],'raw':!![]})[_0xf41a('0x23')](handleEntityNotFound(_0x47d999,null))[_0xf41a('0x23')](function(_0x220208){if(_0x220208){var _0x4a1371=_0x220208['value'];var _0x189f47=util[_0xf41a('0x31')]('%s.cypher',_0x4a1371);if(fs['existsSync'](_0x189f47)){_0x1541c2=!![];return _0x2901ef['decryptFile'](_0x189f47,_0x4a1371,config['secrets'][_0xf41a('0x4f')])[_0xf41a('0x23')](function(){return _0x220208;});}return _0x220208;}})[_0xf41a('0x23')](function(_0x3be644){if(_0x3be644){var _0x5dd868=_0x3be644[_0xf41a('0x50')];if(!fs[_0xf41a('0x51')](_0x5dd868)){throw new db[(_0xf41a('0x52'))][(_0xf41a('0x53'))](_0xf41a('0x54'));}if(_0x3be644[_0xf41a('0x55')]){return _0x47d999['download'](_0x5dd868,_0x3be644['filename']+path[_0xf41a('0x56')](_0x5dd868),function(){if(_0x1541c2){fs['unlink'](_0x5dd868);}});}else{return _0x47d999[_0xf41a('0x4c')](_0x5dd868,function(_0x1ace44){if(_0x1541c2){fs[_0xf41a('0x57')](_0x5dd868);}});}}})[_0xf41a('0x47')](function(_0x2625e0){if(_0x2625e0[_0xf41a('0x58')]===_0xf41a('0x54')){_0x47d999[_0xf41a('0x18')](0x194)[_0xf41a('0x29')](_0xf41a('0x59'));}else{return handleError(_0x47d999,null);}});};exports['downloads']=function(_0x7a4c2,_0x3d6c25,_0x347675){var _0x5038e5=require('../../components/encryptor');var _0x19feeb=![];var _0x4ba2ba={'$and':[db[_0xf41a('0x5a')][_0xf41a('0x3a')](db[_0xf41a('0x5a')]['fn']('MD5',db[_0xf41a('0x5a')][_0xf41a('0x5b')](_0xf41a('0x4e'))),_0x7a4c2['query'][_0xf41a('0x5c')])]};if(_0x7a4c2[_0xf41a('0x32')]['type']&&_0x7a4c2[_0xf41a('0x32')][_0xf41a('0x2c')]===_0xf41a('0x4e')){_0x4ba2ba[_0xf41a('0x5d')][_0xf41a('0x5e')]({'uniqueid':_0x7a4c2[_0xf41a('0x49')]['id']});}else{_0x4ba2ba[_0xf41a('0x5d')][_0xf41a('0x5e')]({'id':_0x7a4c2[_0xf41a('0x49')]['id']});}return db[_0xf41a('0x40')][_0xf41a('0x46')]({'where':_0x4ba2ba,'attributes':['id',_0xf41a('0x50')],'raw':!![]})[_0xf41a('0x23')](handleEntityNotFound(_0x3d6c25,null))['then'](function(_0x245367){if(_0x245367){var _0x3ff951=util['format'](_0xf41a('0x5f'),_0x245367[_0xf41a('0x50')]);if(fs['existsSync'](_0x3ff951)){_0x19feeb=!![];return _0x5038e5[_0xf41a('0x60')](_0x3ff951,_0x245367[_0xf41a('0x50')],config[_0xf41a('0x61')][_0xf41a('0x4f')])[_0xf41a('0x23')](function(){return _0x245367;});}return _0x245367;}})[_0xf41a('0x23')](function(_0x2ba844){if(_0x2ba844){if(!fs['existsSync'](_0x2ba844[_0xf41a('0x50')])){throw new db[(_0xf41a('0x52'))]['ValidationError'](_0xf41a('0x54'));}if(_0x2ba844['filename']){return _0x3d6c25[_0xf41a('0x4c')](_0x2ba844[_0xf41a('0x50')],_0x2ba844['filename']+path[_0xf41a('0x56')](_0x2ba844[_0xf41a('0x50')]),function(){if(_0x19feeb){fs['unlink'](_0x2ba844[_0xf41a('0x50')]);}});}else{return _0x3d6c25[_0xf41a('0x4c')](_0x2ba844[_0xf41a('0x50')],function(_0x18a67d){if(_0x19feeb){fs['unlink'](_0x2ba844[_0xf41a('0x50')]);}});}}})['catch'](handleError(_0x3d6c25,null));};exports[_0xf41a('0x62')]=function(_0x51bf2a,_0xb648f9){return db[_0xf41a('0x40')]['find']({'where':{'id':_0x51bf2a[_0xf41a('0x49')]['id']}})[_0xf41a('0x23')](function(_0x434f93){if(_[_0xf41a('0x63')](_0x434f93)){throw new ReferenceError(_0xf41a('0x64'));}return _0x434f93;})[_0xf41a('0x23')](function(_0x2f2ff7){var _0x457b8c=_0x2f2ff7[_0xf41a('0x50')];logger['info'](_0xf41a('0x65'),_0x457b8c);if(!_[_0xf41a('0x63')](_0x2f2ff7[_0xf41a('0x50')])&&fs['existsSync'](_0x457b8c)){logger['info'](_0xf41a('0x66')+_0x457b8c+_0xf41a('0x67'));fs[_0xf41a('0x68')](_0x457b8c);}_0x457b8c=_0x457b8c+_0xf41a('0x69');if(!_[_0xf41a('0x63')](_0x2f2ff7['value'])&&fs[_0xf41a('0x51')](_0x457b8c)){logger[_0xf41a('0x6a')](_0xf41a('0x66')+_0x457b8c+_0xf41a('0x67'));fs['unlinkSync'](_0x457b8c);}return _0x2f2ff7;})[_0xf41a('0x23')](function(_0x43a8b8){if(!_0x43a8b8)throw new InternalError();return _0x43a8b8['destroy']();})['then'](function(){_0xb648f9[_0xf41a('0x18')](0xcc)[_0xf41a('0x24')]();})['catch'](handleError(_0xb648f9,null));};function getBucketslist(_0x4a3d8b,_0x12516c,_0x31034e){return new Promise(function(_0x3db2ed,_0x207462){var _0x45e620=new AWS['S3']({'accessKeyId':_0x12516c,'secretAccessKey':_0x4a3d8b,'region':_0x31034e});_0x45e620[_0xf41a('0x6b')]({},function(_0x4ea35b,_0x45f000){if(_0x4ea35b){return _0x207462(_0x4ea35b);}else{return _0x3db2ed(_0x45f000);}});});}function createBucket(_0x5bb0dd,_0xe80e,_0x4abd6b,_0x386150){return new Promise(function(_0x4c1f3f,_0x300f98){var _0x411fe1=new AWS['S3']({'accessKeyId':_0xe80e,'secretAccessKey':_0x5bb0dd,'region':_0x4abd6b});_0x411fe1[_0xf41a('0x6c')]({'Bucket':_0x386150},function(_0x58e800,_0x4c4add){if(_0x58e800){return _0x300f98(_0x58e800);}else{return _0x4c1f3f(_0x4c4add);}});});}function uploadFile(_0x588527,_0x2bddfe,_0x1b918e,_0x524198,_0x577f83,_0x5cf105){return new Promise(function(_0x54e3af,_0x193ace){var _0x2e8c6d=new AWS['S3']({'accessKeyId':_0x2bddfe,'secretAccessKey':_0x588527,'region':_0x1b918e});_0x2e8c6d[_0xf41a('0x6d')]({'Bucket':_0x524198,'Key':_0x577f83,'Body':_0x5cf105},function(_0x3f6afe,_0x3a5a24){if(_0x3f6afe){return _0x193ace(_0x3f6afe);}else{return _0x54e3af(_0x3a5a24);}});});}function startTranscribe(_0x5e96a8,_0x5b8a94,_0x2c0705,_0x531639,_0x301d11,_0x4878da){return new Promise(function(_0x13745f,_0x99ed7f){var _0x16a332=new AWS[(_0xf41a('0x6e'))]({'accessKeyId':_0x5b8a94,'secretAccessKey':_0x5e96a8,'region':_0x2c0705});_0x16a332['startTranscriptionJob']({'TranscriptionJobName':_0x531639,'LanguageCode':_0x301d11,'Media':{'MediaFileUri':_0x4878da}},function(_0x314ee1,_0x107e99){if(_0x314ee1){return _0x99ed7f(_0x314ee1);}else{return _0x13745f(_0x107e99);}});});}function transcribe(_0x5e0c78,_0x2da0da,_0x47677c,_0x1248f9,_0x33b1a1,_0x717fb1,_0x2a5c93){return new Promise(function(_0x31269e,_0x37f665){var _0x29aa50={};logger[_0xf41a('0x6a')](util[_0xf41a('0x31')](_0xf41a('0x6f'),_0x5e0c78,_0x33b1a1));return uploadFile(_0x2da0da,_0x47677c,_0x1248f9,_0x33b1a1,path[_0xf41a('0x70')](_0x717fb1),fs[_0xf41a('0x71')](_0x717fb1))['then'](function(_0xa64764){logger[_0xf41a('0x6a')](util[_0xf41a('0x31')](_0xf41a('0x72'),_0x5e0c78,_0x33b1a1,_0xa64764[_0xf41a('0x73')]));_0x29aa50[_0xf41a('0x74')]=_0xa64764[_0xf41a('0x75')];_0x29aa50[_0xf41a('0x76')]=_0xa64764[_0xf41a('0x73')];logger['info'](util[_0xf41a('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x5e0c78));return startTranscribe(_0x2da0da,_0x47677c,_0x1248f9,uuidv4(),_0x2a5c93,_0xa64764[_0xf41a('0x73')]);})[_0xf41a('0x23')](function(_0x5ec0e0){logger['info'](util['format'](_0xf41a('0x77'),_0x5e0c78,_0x5ec0e0[_0xf41a('0x78')][_0xf41a('0x79')]));_0x29aa50[_0xf41a('0x7a')]=_0x5ec0e0[_0xf41a('0x78')]['TranscriptionJobName'];_0x29aa50[_0xf41a('0x7b')]=_0x5ec0e0['TranscriptionJob'][_0xf41a('0x7c')];return _0x31269e(_0x29aa50);})['catch'](function(_0x566f3a){return _0x37f665(_0x566f3a);});});}exports[_0xf41a('0x7d')]=function(_0x5ab568,_0x1035d0,_0x52acf1){var _0x459f17;var _0x442fdf;var _0x388558;var _0x43b0d2=require('../../components/encryptor');return db[_0xf41a('0x40')][_0xf41a('0x7e')]({'where':{'id':_0x5ab568['params']['id']}})['then'](function(_0x4b7391){if(_0x4b7391){var _0x58e629=util[_0xf41a('0x31')](_0xf41a('0x5f'),_0x4b7391[_0xf41a('0x50')]);if(fs[_0xf41a('0x51')](_0x58e629)){cypher=!![];return _0x43b0d2[_0xf41a('0x60')](_0x58e629,_0x4b7391[_0xf41a('0x50')],config[_0xf41a('0x61')][_0xf41a('0x4f')])[_0xf41a('0x23')](function(){return _0x4b7391;});}return _0x4b7391;}})[_0xf41a('0x23')](function(_0x4e81ca){if(!_0x4e81ca){throw new db['Sequelize']['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x442fdf=_0x4e81ca;return db[_0xf41a('0x7f')][_0xf41a('0x7e')]({'where':{'id':0x1}});})[_0xf41a('0x23')](handleEntityNotFound(_0x1035d0,null))[_0xf41a('0x23')](function(_0x62faa2){if(_0x62faa2){_0x459f17=_0x62faa2;if(!_0x459f17['transcribe']||!_0x459f17[_0xf41a('0x80')]||!_0x459f17['transcribeRegion']||!_0x459f17[_0xf41a('0x81')]||!_0x459f17[_0xf41a('0x74')]){throw new db['Sequelize'][(_0xf41a('0x53'))]('Transcribe\x20not\x20configured');}if(_0x5ab568[_0xf41a('0x4a')]['runSentiment']&&(!_0x459f17[_0xf41a('0x82')]||!_0x459f17[_0xf41a('0x83')]||!_0x459f17['sentimentRegion']||!_0x459f17[_0xf41a('0x81')]||!_0x459f17['bucket'])){throw new db[(_0xf41a('0x52'))]['ValidationError'](_0xf41a('0x84'));}return db[_0xf41a('0x85')][_0xf41a('0x7e')]({'where':{'id':_0x459f17[_0xf41a('0x80')]}});}})[_0xf41a('0x23')](function(_0x384dd2){if(!_0x384dd2){throw new db[(_0xf41a('0x52'))][(_0xf41a('0x53'))](_0xf41a('0x86'));}if(!_0x384dd2[_0xf41a('0x87')]||!_0x384dd2[_0xf41a('0x88')]){throw new db[(_0xf41a('0x52'))][(_0xf41a('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x388558=_0x384dd2;return getBucketslist(_0x388558['data1'],_0x388558[_0xf41a('0x88')],_0x459f17[_0xf41a('0x89')]);})[_0xf41a('0x23')](function(_0x859020){if(_0x859020&&_0x859020[_0xf41a('0x8a')]){var _0x3d5835=_[_0xf41a('0x46')](_0x859020['Buckets'],function(_0x5ee3e7){return _0x5ee3e7['Name']===_0x459f17[_0xf41a('0x74')];});if(!_0x3d5835){logger['info'](util[_0xf41a('0x31')](_0xf41a('0x8b'),_0x5ab568[_0xf41a('0x49')]['id'],_0x459f17['bucket']));return createBucket(_0x388558[_0xf41a('0x87')],_0x388558['data2'],_0x459f17[_0xf41a('0x89')],_0x459f17[_0xf41a('0x74')]);}logger['info'](util[_0xf41a('0x31')](_0xf41a('0x8c'),_0x5ab568[_0xf41a('0x49')]['id'],_0x459f17[_0xf41a('0x74')]));return;}})[_0xf41a('0x23')](function(_0x2590ed){if(_0x442fdf[_0xf41a('0x7b')]===_0xf41a('0x8d')){return transcribe(_0x5ab568[_0xf41a('0x49')]['id'],_0x388558[_0xf41a('0x87')],_0x388558[_0xf41a('0x88')],_0x459f17[_0xf41a('0x89')],_0x459f17[_0xf41a('0x74')],_0x442fdf[_0xf41a('0x50')],_0x459f17[_0xf41a('0x81')]);}else{logger[_0xf41a('0x6a')](util[_0xf41a('0x31')](_0xf41a('0x8e'),_0x5ab568[_0xf41a('0x49')]['id']));return{'transcribeStatus':_0xf41a('0x8f')};}})['then'](function(_0x1f187a){if(_0x1f187a){_0x1f187a[_0xf41a('0x90')]=_0x5ab568[_0xf41a('0x4a')][_0xf41a('0x91')];return _0x442fdf[_0xf41a('0x92')](_0x1f187a);}})[_0xf41a('0x23')](respondWithResult(_0x1035d0,null))[_0xf41a('0x47')](handleError(_0x1035d0,null));};function writeFile(_0x16e8c4,_0x2a819a){return new Promise(function(_0x46a5e9,_0x53d7bb){fs['writeFile'](_0x2a819a,_0x16e8c4,function(_0x44f326,_0x59efb0){if(_0x44f326){return _0x53d7bb(_0x44f326);}else{return _0x46a5e9(_0x59efb0);}});});}exports[_0xf41a('0x93')]=function(_0x21a2c,_0x9fbe1d,_0x5d391d){return db[_0xf41a('0x40')][_0xf41a('0x7e')]({'where':{'id':_0x21a2c[_0xf41a('0x49')]['id']}})[_0xf41a('0x23')](handleEntityNotFound(_0x9fbe1d))[_0xf41a('0x23')](function(_0x570ed2){if(_0x570ed2&&_0x570ed2['fileText']){var _0x3afb10=_0x570ed2['fileText'];var _0x267d66=config[_0xf41a('0x94')]+_0xf41a('0x95')+_0x570ed2['id']+_0xf41a('0x96');if(fs[_0xf41a('0x51')](_0x267d66)){return _0x267d66;}return writeFile(_0x3afb10,_0x267d66)[_0xf41a('0x23')](function(){return _0x267d66;});}else{throw new db[(_0xf41a('0x52'))][(_0xf41a('0x53'))](_0xf41a('0x97'));}})[_0xf41a('0x23')](function(_0x4693fb){return _0x9fbe1d[_0xf41a('0x4c')](_0x4693fb);})[_0xf41a('0x47')](handleError(_0x9fbe1d));}; \ No newline at end of file +var _0x5511=['upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','body','update','find','describe','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','col','token','$and','push','existsSync','decryptFile','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','listBuckets','createBucket'];(function(_0x5864dc,_0x54ca00){var _0x3453=function(_0x28ca94){while(--_0x28ca94){_0x5864dc['push'](_0x5864dc['shift']());}};_0x3453(++_0x54ca00);}(_0x5511,0x1e1));var _0x1551=function(_0x125aec,_0x48d4db){_0x125aec=_0x125aec-0x0;var _0x4d5f54=_0x5511[_0x125aec];return _0x4d5f54;};'use strict';var emlformat=require(_0x1551('0x0'));var rimraf=require(_0x1551('0x1'));var zipdir=require(_0x1551('0x2'));var jsonpatch=require(_0x1551('0x3'));var rp=require(_0x1551('0x4'));var moment=require('moment');var BPromise=require(_0x1551('0x5'));var Mustache=require(_0x1551('0x6'));var util=require(_0x1551('0x7'));var path=require(_0x1551('0x8'));var sox=require(_0x1551('0x9'));var csv=require(_0x1551('0xa'));var ejs=require(_0x1551('0xb'));var fs=require('fs');var fs_extra=require(_0x1551('0xc'));var _=require(_0x1551('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1551('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1551('0xa'));var querystring=require(_0x1551('0xf'));var Papa=require(_0x1551('0x10'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x1551('0x11'));var qs=require(_0x1551('0x12'));var as=require(_0x1551('0x13'));var hardwareService=require(_0x1551('0x14'));var logger=require(_0x1551('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1551('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fc743,_0x7996c0){_0x7996c0=_0x7996c0||0xcc;return function(_0x59aaac){if(_0x59aaac){return _0x4fc743[_0x1551('0x17')](_0x7996c0);}return _0x4fc743[_0x1551('0x18')](_0x7996c0)['end']();};}function respondWithResult(_0x58469b,_0x3c21e3){_0x3c21e3=_0x3c21e3||0xc8;return function(_0x29b68f){if(_0x29b68f){return _0x58469b[_0x1551('0x18')](_0x3c21e3)[_0x1551('0x19')](_0x29b68f);}};}function respondWithFilteredResult(_0x1ca6e6,_0x3fff82){return function(_0x2347e9){if(_0x2347e9){var _0x4ba22f=typeof _0x3fff82[_0x1551('0x1a')]===_0x1551('0x1b')&&typeof _0x3fff82['limit']===_0x1551('0x1b');var _0xe7e17a=_0x2347e9['count'];var _0x209510=_0x4ba22f?0x0:_0x3fff82[_0x1551('0x1a')];var _0x54f5c6=_0x4ba22f?_0x2347e9[_0x1551('0x1c')]:_0x3fff82['offset']+_0x3fff82[_0x1551('0x1d')];var _0x2ac8a9;if(_0x54f5c6>=_0xe7e17a){_0x54f5c6=_0xe7e17a;_0x2ac8a9=0xc8;}else{_0x2ac8a9=0xce;}_0x1ca6e6[_0x1551('0x18')](_0x2ac8a9);return _0x1ca6e6[_0x1551('0x1e')](_0x1551('0x1f'),_0x209510+'-'+_0x54f5c6+'/'+_0xe7e17a)[_0x1551('0x19')](_0x2347e9);}return null;};}function patchUpdates(_0x291cee){return function(_0x11f121){try{jsonpatch[_0x1551('0x20')](_0x11f121,_0x291cee,!![]);}catch(_0x4cc4ec){return BPromise[_0x1551('0x21')](_0x4cc4ec);}return _0x11f121[_0x1551('0x22')]();};}function saveUpdates(_0x2421bc,_0x2c6930){return function(_0x22201b){if(_0x22201b){return _0x22201b['update'](_0x2421bc)[_0x1551('0x23')](function(_0x556194){return _0x556194;});}return null;};}function removeEntity(_0x69402d,_0x17bea2){return function(_0x361242){if(_0x361242){return _0x361242['destroy']()[_0x1551('0x23')](function(){_0x69402d[_0x1551('0x18')](0xcc)[_0x1551('0x24')]();});}};}function handleEntityNotFound(_0x875871,_0xcd24d9){return function(_0x1d4dfb){if(!_0x1d4dfb){_0x875871[_0x1551('0x17')](0x194);}return _0x1d4dfb;};}function handleError(_0x19e259,_0x45b3b7){_0x45b3b7=_0x45b3b7||0x1f4;return function(_0x260fc1){logger[_0x1551('0x25')](_0x260fc1[_0x1551('0x26')]);if(_0x260fc1[_0x1551('0x27')]){delete _0x260fc1[_0x1551('0x27')];}_0x19e259['status'](_0x45b3b7)[_0x1551('0x28')](_0x260fc1);};}exports['index']=function(_0x5488ff,_0x293b3b){var _0x10074a={},_0x13dbea={},_0x16e790={'count':0x0,'rows':[]};var _0x346221=_[_0x1551('0x29')](db[_0x1551('0x2a')][_0x1551('0x2b')],function(_0x2dc91f){return{'name':_0x2dc91f[_0x1551('0x2c')],'type':_0x2dc91f[_0x1551('0x2d')][_0x1551('0x2e')]};});_0x13dbea['model']=_[_0x1551('0x2f')](_[_0x1551('0x29')](_0x346221,_0x1551('0x27')),[_0x1551('0x30')]);_0x13dbea[_0x1551('0x31')]=_[_0x1551('0x32')](_0x5488ff[_0x1551('0x31')]);_0x13dbea[_0x1551('0x33')]=_[_0x1551('0x34')](_0x13dbea[_0x1551('0x35')],_0x13dbea[_0x1551('0x31')]);_0x10074a[_0x1551('0x36')]=_['intersection'](_0x13dbea['model'],qs[_0x1551('0x37')](_0x5488ff[_0x1551('0x31')][_0x1551('0x37')]));_0x10074a[_0x1551('0x36')]=_0x10074a['attributes'][_0x1551('0x38')]?_0x10074a[_0x1551('0x36')]:_0x13dbea['model'];if(!_0x5488ff['query']['hasOwnProperty']('nolimit')){_0x10074a[_0x1551('0x1d')]=qs[_0x1551('0x1d')](_0x5488ff[_0x1551('0x31')][_0x1551('0x1d')]);_0x10074a[_0x1551('0x1a')]=qs[_0x1551('0x1a')](_0x5488ff['query'][_0x1551('0x1a')]);}_0x10074a[_0x1551('0x39')]=qs[_0x1551('0x3a')](_0x5488ff[_0x1551('0x31')][_0x1551('0x3a')]);_0x10074a['where']=qs[_0x1551('0x33')](_[_0x1551('0x3b')](_0x5488ff['query'],_0x13dbea['filters']),_0x346221);if(_0x5488ff[_0x1551('0x31')][_0x1551('0x3c')]){_0x10074a[_0x1551('0x3d')]=_['merge'](_0x10074a['where'],{'$or':_['map'](_0x346221,function(_0x5bfb9a){if(_0x5bfb9a['type']!==_0x1551('0x3e')){var _0x498372={};_0x498372[_0x5bfb9a[_0x1551('0x27')]]={'$like':'%'+_0x5488ff['query'][_0x1551('0x3c')]+'%'};return _0x498372;}})});}_0x10074a=_[_0x1551('0x3f')]({},_0x10074a,_0x5488ff['options']);var _0xe90780={'where':_0x10074a[_0x1551('0x3d')]};return db[_0x1551('0x2a')][_0x1551('0x1c')](_0xe90780)[_0x1551('0x23')](function(_0x1d60b8){_0x16e790[_0x1551('0x1c')]=_0x1d60b8;if(_0x5488ff[_0x1551('0x31')][_0x1551('0x40')]){_0x10074a[_0x1551('0x41')]=[{'all':!![]}];}return db[_0x1551('0x2a')][_0x1551('0x42')](_0x10074a);})[_0x1551('0x23')](function(_0x560a96){_0x16e790[_0x1551('0x43')]=_0x560a96;return _0x16e790;})[_0x1551('0x23')](respondWithFilteredResult(_0x293b3b,_0x10074a))[_0x1551('0x44')](handleError(_0x293b3b,null));};exports['show']=function(_0x220581,_0x8e4604){var _0x49eaca={'raw':![],'where':{'id':_0x220581[_0x1551('0x45')]['id']}},_0x19c7a2={};_0x19c7a2[_0x1551('0x35')]=_[_0x1551('0x32')](db[_0x1551('0x2a')][_0x1551('0x2b')]);_0x19c7a2[_0x1551('0x31')]=_['keys'](_0x220581[_0x1551('0x31')]);_0x19c7a2[_0x1551('0x33')]=_[_0x1551('0x34')](_0x19c7a2[_0x1551('0x35')],_0x19c7a2['query']);_0x49eaca[_0x1551('0x36')]=_['intersection'](_0x19c7a2['model'],qs[_0x1551('0x37')](_0x220581[_0x1551('0x31')][_0x1551('0x37')]));_0x49eaca[_0x1551('0x36')]=_0x49eaca[_0x1551('0x36')][_0x1551('0x38')]?_0x49eaca['attributes']:_0x19c7a2[_0x1551('0x35')];if(_0x220581['query'][_0x1551('0x40')]){_0x49eaca[_0x1551('0x41')]=[{'all':!![]}];}_0x49eaca=_[_0x1551('0x3f')]({},_0x49eaca,_0x220581[_0x1551('0x46')]);return db[_0x1551('0x2a')]['find'](_0x49eaca)[_0x1551('0x23')](handleEntityNotFound(_0x8e4604,null))[_0x1551('0x23')](respondWithResult(_0x8e4604,null))[_0x1551('0x44')](handleError(_0x8e4604,null));};exports['create']=function(_0x122ca8,_0x53103e){return db[_0x1551('0x2a')]['create'](_0x122ca8[_0x1551('0x47')],{})[_0x1551('0x23')](respondWithResult(_0x53103e,0xc9))[_0x1551('0x44')](handleError(_0x53103e,null));};exports[_0x1551('0x48')]=function(_0x3e189e,_0x103a21){if(_0x3e189e['body']['id']){delete _0x3e189e[_0x1551('0x47')]['id'];}return db[_0x1551('0x2a')][_0x1551('0x49')]({'where':{'id':_0x3e189e[_0x1551('0x45')]['id']}})[_0x1551('0x23')](handleEntityNotFound(_0x103a21,null))['then'](saveUpdates(_0x3e189e[_0x1551('0x47')],null))[_0x1551('0x23')](respondWithResult(_0x103a21,null))[_0x1551('0x44')](handleError(_0x103a21,null));};exports[_0x1551('0x4a')]=function(_0x12d0e9,_0x350011){return db[_0x1551('0x2a')][_0x1551('0x4a')]()[_0x1551('0x23')](respondWithResult(_0x350011,null))[_0x1551('0x44')](handleError(_0x350011,null));};exports['download']=function(_0x52b43b,_0x3edc51,_0x4eae36){var _0xb0ec5c=require(_0x1551('0x4b'));var _0x55dedf=![];var _0x5bccb6={};if(_0x52b43b['query'][_0x1551('0x2d')]&&_0x52b43b[_0x1551('0x31')][_0x1551('0x2d')]===_0x1551('0x4c')){_0x5bccb6[_0x1551('0x4c')]=_0x52b43b[_0x1551('0x45')]['id'];}else{_0x5bccb6['id']=_0x52b43b[_0x1551('0x45')]['id'];}return db[_0x1551('0x2a')][_0x1551('0x49')]({'where':_0x5bccb6,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3edc51,null))['then'](function(_0x245176){if(_0x245176){var _0x3f0756=_0x245176['value'];var _0x480c0b=util[_0x1551('0x30')](_0x1551('0x4d'),_0x3f0756);if(fs['existsSync'](_0x480c0b)){_0x55dedf=!![];return _0xb0ec5c['decryptFile'](_0x480c0b,_0x3f0756,config[_0x1551('0x4e')][_0x1551('0x4f')])[_0x1551('0x23')](function(){return _0x245176;});}return _0x245176;}})[_0x1551('0x23')](function(_0xb70897){if(_0xb70897){var _0x2f9d6f=_0xb70897[_0x1551('0x50')];if(!fs['existsSync'](_0x2f9d6f)){throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))](_0x1551('0x53'));}if(_0xb70897['filename']){return _0x3edc51['download'](_0x2f9d6f,_0xb70897[_0x1551('0x54')]+path[_0x1551('0x55')](_0x2f9d6f),function(){if(_0x55dedf){fs[_0x1551('0x56')](_0x2f9d6f);}});}else{return _0x3edc51['download'](_0x2f9d6f,function(_0x34f616){if(_0x55dedf){fs[_0x1551('0x56')](_0x2f9d6f);}});}}})[_0x1551('0x44')](function(_0x788f94){if(_0x788f94[_0x1551('0x57')]===_0x1551('0x53')){_0x3edc51[_0x1551('0x18')](0x194)[_0x1551('0x28')]('Not\x20found');}else{return handleError(_0x3edc51,null);}});};exports[_0x1551('0x58')]=function(_0x4fd882,_0x3395c5,_0x3fc90b){var _0x17022c=require(_0x1551('0x4b'));var _0x676886=![];var _0x19dd3b={'$and':[db[_0x1551('0x59')]['where'](db[_0x1551('0x59')]['fn']('MD5',db[_0x1551('0x59')][_0x1551('0x5a')](_0x1551('0x4c'))),_0x4fd882[_0x1551('0x31')][_0x1551('0x5b')])]};if(_0x4fd882[_0x1551('0x31')][_0x1551('0x2d')]&&_0x4fd882[_0x1551('0x31')][_0x1551('0x2d')]===_0x1551('0x4c')){_0x19dd3b[_0x1551('0x5c')]['push']({'uniqueid':_0x4fd882[_0x1551('0x45')]['id']});}else{_0x19dd3b[_0x1551('0x5c')][_0x1551('0x5d')]({'id':_0x4fd882[_0x1551('0x45')]['id']});}return db['VoiceRecording']['find']({'where':_0x19dd3b,'attributes':['id',_0x1551('0x50')],'raw':!![]})[_0x1551('0x23')](handleEntityNotFound(_0x3395c5,null))['then'](function(_0xb10e95){if(_0xb10e95){var _0x2cb46d=util[_0x1551('0x30')]('%s.cypher',_0xb10e95[_0x1551('0x50')]);if(fs[_0x1551('0x5e')](_0x2cb46d)){_0x676886=!![];return _0x17022c[_0x1551('0x5f')](_0x2cb46d,_0xb10e95[_0x1551('0x50')],config[_0x1551('0x4e')]['recording'])['then'](function(){return _0xb10e95;});}return _0xb10e95;}})['then'](function(_0x2d03a3){if(_0x2d03a3){if(!fs[_0x1551('0x5e')](_0x2d03a3[_0x1551('0x50')])){throw new db[(_0x1551('0x51'))]['ValidationError'](_0x1551('0x53'));}if(_0x2d03a3[_0x1551('0x54')]){return _0x3395c5['download'](_0x2d03a3[_0x1551('0x50')],_0x2d03a3[_0x1551('0x54')]+path[_0x1551('0x55')](_0x2d03a3[_0x1551('0x50')]),function(){if(_0x676886){fs[_0x1551('0x56')](_0x2d03a3[_0x1551('0x50')]);}});}else{return _0x3395c5['download'](_0x2d03a3[_0x1551('0x50')],function(_0x15b047){if(_0x676886){fs['unlink'](_0x2d03a3[_0x1551('0x50')]);}});}}})[_0x1551('0x44')](handleError(_0x3395c5,null));};exports['destroy']=function(_0x15e2fd,_0x59247c){return db[_0x1551('0x2a')][_0x1551('0x49')]({'where':{'id':_0x15e2fd[_0x1551('0x45')]['id']}})[_0x1551('0x23')](function(_0x371187){if(_[_0x1551('0x60')](_0x371187)){throw new ReferenceError(_0x1551('0x61'));}return _0x371187;})['then'](function(_0x14c500){var _0x25dbf9=_0x14c500[_0x1551('0x50')];logger[_0x1551('0x62')](_0x1551('0x63'),_0x25dbf9);if(!_[_0x1551('0x60')](_0x14c500[_0x1551('0x50')])&&fs[_0x1551('0x5e')](_0x25dbf9)){logger[_0x1551('0x62')](_0x1551('0x64')+_0x25dbf9+_0x1551('0x65'));fs[_0x1551('0x66')](_0x25dbf9);}_0x25dbf9=_0x25dbf9+_0x1551('0x67');if(!_[_0x1551('0x60')](_0x14c500[_0x1551('0x50')])&&fs[_0x1551('0x5e')](_0x25dbf9)){logger['info'](_0x1551('0x64')+_0x25dbf9+_0x1551('0x65'));fs['unlinkSync'](_0x25dbf9);}return _0x14c500;})[_0x1551('0x23')](function(_0x2d9125){if(!_0x2d9125)throw new InternalError();return _0x2d9125[_0x1551('0x68')]();})['then'](function(){_0x59247c[_0x1551('0x18')](0xcc)[_0x1551('0x24')]();})[_0x1551('0x44')](handleError(_0x59247c,null));};function getBucketslist(_0x52f129,_0x2b35d6,_0x329e6d){return new Promise(function(_0x4ddca0,_0x5b36e4){var _0x3e8cef=new AWS['S3']({'accessKeyId':_0x2b35d6,'secretAccessKey':_0x52f129,'region':_0x329e6d});_0x3e8cef[_0x1551('0x69')]({},function(_0x470efb,_0x4b3bfa){if(_0x470efb){return _0x5b36e4(_0x470efb);}else{return _0x4ddca0(_0x4b3bfa);}});});}function createBucket(_0x3c2412,_0x1b009a,_0x27559b,_0x364aa3){return new Promise(function(_0x1e3208,_0x5eef73){var _0x169bfd=new AWS['S3']({'accessKeyId':_0x1b009a,'secretAccessKey':_0x3c2412,'region':_0x27559b});_0x169bfd[_0x1551('0x6a')]({'Bucket':_0x364aa3},function(_0x976805,_0x2588a1){if(_0x976805){return _0x5eef73(_0x976805);}else{return _0x1e3208(_0x2588a1);}});});}function uploadFile(_0x622d6a,_0x371176,_0x4969b1,_0x23fbfb,_0x57267f,_0x4193b6){return new Promise(function(_0x2b0133,_0x1ccee0){var _0x31bd0f=new AWS['S3']({'accessKeyId':_0x371176,'secretAccessKey':_0x622d6a,'region':_0x4969b1});_0x31bd0f[_0x1551('0x6b')]({'Bucket':_0x23fbfb,'Key':_0x57267f,'Body':_0x4193b6},function(_0x1dceec,_0x32663e){if(_0x1dceec){return _0x1ccee0(_0x1dceec);}else{return _0x2b0133(_0x32663e);}});});}function startTranscribe(_0x4007e6,_0x277062,_0x1ec744,_0x288657,_0xed03f5,_0x809d61){return new Promise(function(_0x4e6cfa,_0x4fd207){var _0x20832a=new AWS[(_0x1551('0x6c'))]({'accessKeyId':_0x277062,'secretAccessKey':_0x4007e6,'region':_0x1ec744});_0x20832a['startTranscriptionJob']({'TranscriptionJobName':_0x288657,'LanguageCode':_0xed03f5,'Media':{'MediaFileUri':_0x809d61}},function(_0xe44670,_0xe84733){if(_0xe44670){return _0x4fd207(_0xe44670);}else{return _0x4e6cfa(_0xe84733);}});});}function transcribe(_0x2608d8,_0x2b1186,_0x8eb2d4,_0x30d327,_0x1c5ec7,_0x215b44,_0x2c3f3f){return new Promise(function(_0x57c265,_0x48b258){var _0x3ead1c={};logger[_0x1551('0x62')](util[_0x1551('0x30')](_0x1551('0x6d'),_0x2608d8,_0x1c5ec7));return uploadFile(_0x2b1186,_0x8eb2d4,_0x30d327,_0x1c5ec7,path['basename'](_0x215b44),fs[_0x1551('0x6e')](_0x215b44))[_0x1551('0x23')](function(_0x1413ab){logger['info'](util[_0x1551('0x30')](_0x1551('0x6f'),_0x2608d8,_0x1c5ec7,_0x1413ab[_0x1551('0x70')]));_0x3ead1c[_0x1551('0x71')]=_0x1413ab[_0x1551('0x72')];_0x3ead1c[_0x1551('0x73')]=_0x1413ab[_0x1551('0x70')];logger[_0x1551('0x62')](util[_0x1551('0x30')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2608d8));return startTranscribe(_0x2b1186,_0x8eb2d4,_0x30d327,uuidv4(),_0x2c3f3f,_0x1413ab['Location']);})[_0x1551('0x23')](function(_0x435be0){logger['info'](util[_0x1551('0x30')](_0x1551('0x74'),_0x2608d8,_0x435be0[_0x1551('0x75')]['TranscriptionJobName']));_0x3ead1c[_0x1551('0x76')]=_0x435be0[_0x1551('0x75')][_0x1551('0x77')];_0x3ead1c[_0x1551('0x78')]=_0x435be0[_0x1551('0x75')]['TranscriptionJobStatus'];return _0x57c265(_0x3ead1c);})[_0x1551('0x44')](function(_0xbb0321){return _0x48b258(_0xbb0321);});});}exports[_0x1551('0x79')]=function(_0xe4eca1,_0x401796,_0x4c211c){var _0x52610a;var _0x21559d;var _0x1977c3;var _0x166094=require(_0x1551('0x4b'));return db['VoiceRecording'][_0x1551('0x7a')]({'where':{'id':_0xe4eca1[_0x1551('0x45')]['id']}})['then'](function(_0x53d986){if(_0x53d986){var _0x1c65eb=util[_0x1551('0x30')](_0x1551('0x4d'),_0x53d986['value']);if(fs[_0x1551('0x5e')](_0x1c65eb)){cypher=!![];return _0x166094['decryptFile'](_0x1c65eb,_0x53d986[_0x1551('0x50')],config[_0x1551('0x4e')]['recording'])[_0x1551('0x23')](function(){return _0x53d986;});}return _0x53d986;}})[_0x1551('0x23')](function(_0x2b6172){if(!_0x2b6172){throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))](_0x1551('0x7b'));}_0x21559d=_0x2b6172;return db[_0x1551('0x7c')][_0x1551('0x7a')]({'where':{'id':0x1}});})[_0x1551('0x23')](handleEntityNotFound(_0x401796,null))[_0x1551('0x23')](function(_0x102fe6){if(_0x102fe6){_0x52610a=_0x102fe6;if(!_0x52610a[_0x1551('0x7d')]||!_0x52610a['transcribeAccountId']||!_0x52610a['transcribeRegion']||!_0x52610a['language']||!_0x52610a['bucket']){throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))](_0x1551('0x7e'));}if(_0xe4eca1[_0x1551('0x47')][_0x1551('0x7f')]&&(!_0x52610a['sentiment']||!_0x52610a[_0x1551('0x80')]||!_0x52610a[_0x1551('0x81')]||!_0x52610a[_0x1551('0x82')]||!_0x52610a[_0x1551('0x71')])){throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x1551('0x83')][_0x1551('0x7a')]({'where':{'id':_0x52610a['transcribeAccountId']}});}})[_0x1551('0x23')](function(_0x1328ae){if(!_0x1328ae){throw new db[(_0x1551('0x51'))]['ValidationError'](_0x1551('0x84'));}if(!_0x1328ae['data1']||!_0x1328ae[_0x1551('0x85')]){throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))](_0x1551('0x86'));}_0x1977c3=_0x1328ae;return getBucketslist(_0x1977c3[_0x1551('0x87')],_0x1977c3[_0x1551('0x85')],_0x52610a['transcribeRegion']);})[_0x1551('0x23')](function(_0x29688){if(_0x29688&&_0x29688['Buckets']){var _0x187b2a=_[_0x1551('0x49')](_0x29688['Buckets'],function(_0x3e49e7){return _0x3e49e7['Name']===_0x52610a[_0x1551('0x71')];});if(!_0x187b2a){logger['info'](util[_0x1551('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xe4eca1['params']['id'],_0x52610a[_0x1551('0x71')]));return createBucket(_0x1977c3[_0x1551('0x87')],_0x1977c3[_0x1551('0x85')],_0x52610a[_0x1551('0x88')],_0x52610a[_0x1551('0x71')]);}logger[_0x1551('0x62')](util[_0x1551('0x30')](_0x1551('0x89'),_0xe4eca1[_0x1551('0x45')]['id'],_0x52610a[_0x1551('0x71')]));return;}})[_0x1551('0x23')](function(_0x284d01){if(_0x21559d[_0x1551('0x78')]==='NEW'){return transcribe(_0xe4eca1['params']['id'],_0x1977c3[_0x1551('0x87')],_0x1977c3['data2'],_0x52610a['transcribeRegion'],_0x52610a['bucket'],_0x21559d[_0x1551('0x50')],_0x52610a[_0x1551('0x82')]);}else{logger[_0x1551('0x62')](util[_0x1551('0x30')](_0x1551('0x8a'),_0xe4eca1[_0x1551('0x45')]['id']));return{'transcribeStatus':_0x1551('0x8b')};}})[_0x1551('0x23')](function(_0x298778){if(_0x298778){_0x298778[_0x1551('0x8c')]=_0xe4eca1[_0x1551('0x47')][_0x1551('0x7f')];return _0x21559d[_0x1551('0x8d')](_0x298778);}})[_0x1551('0x23')](respondWithResult(_0x401796,null))['catch'](handleError(_0x401796,null));};function writeFile(_0x31ab4f,_0x3c7db4){return new Promise(function(_0x4c1da9,_0x3dd67c){fs[_0x1551('0x8e')](_0x3c7db4,_0x31ab4f,function(_0x267a4a,_0x4f4f0b){if(_0x267a4a){return _0x3dd67c(_0x267a4a);}else{return _0x4c1da9(_0x4f4f0b);}});});}exports['downloadTranscribe']=function(_0x58767b,_0x2fae73,_0x3328df){return db['VoiceRecording'][_0x1551('0x7a')]({'where':{'id':_0x58767b['params']['id']}})[_0x1551('0x23')](handleEntityNotFound(_0x2fae73))[_0x1551('0x23')](function(_0x261d2b){if(_0x261d2b&&_0x261d2b[_0x1551('0x8f')]){var _0xf0b76e=_0x261d2b[_0x1551('0x8f')];var _0x57dace=config['root']+_0x1551('0x90')+_0x261d2b['id']+'.txt';if(fs[_0x1551('0x5e')](_0x57dace)){return _0x57dace;}return writeFile(_0xf0b76e,_0x57dace)[_0x1551('0x23')](function(){return _0x57dace;});}else{throw new db[(_0x1551('0x51'))][(_0x1551('0x52'))](_0x1551('0x91'));}})[_0x1551('0x23')](function(_0x483ada){return _0x2fae73[_0x1551('0x92')](_0x483ada);})[_0x1551('0x44')](handleError(_0x2fae73));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8f40479..9f97ce3 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa848=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0xbd8972,_0x441803){var _0x4ebd73=function(_0x36f655){while(--_0x36f655){_0xbd8972['push'](_0xbd8972['shift']());}};_0x4ebd73(++_0x441803);}(_0xa848,0x99));var _0x8a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa848[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var logger=require(_0x8a84('0x2'))('api');var moment=require(_0x8a84('0x3'));var BPromise=require(_0x8a84('0x4'));var rp=require(_0x8a84('0x5'));var fs=require('fs');var path=require(_0x8a84('0x6'));var rimraf=require(_0x8a84('0x7'));var config=require(_0x8a84('0x8'));var attributes=require(_0x8a84('0x9'));module[_0x8a84('0xa')]=function(_0x13acad,_0x3ee596){return _0x13acad[_0x8a84('0xb')](_0x8a84('0xc'),attributes,{'tableName':_0x8a84('0xd'),'paranoid':![],'indexes':[{'name':_0x8a84('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x052c=['moment','bluebird','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x052c,0xe6));var _0xc052=function(_0x24b3a2,_0x81eb9c){_0x24b3a2=_0x24b3a2-0x0;var _0x236d48=_0x052c[_0x24b3a2];return _0x236d48;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));var logger=require(_0xc052('0x2'))(_0xc052('0x3'));var moment=require(_0xc052('0x4'));var BPromise=require(_0xc052('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc052('0x6'));var config=require(_0xc052('0x7'));var attributes=require('./voiceRecording.attributes');module[_0xc052('0x8')]=function(_0x22a664,_0x1a96e7){return _0x22a664[_0xc052('0x9')](_0xc052('0xa'),attributes,{'tableName':_0xc052('0xb'),'paranoid':![],'indexes':[{'name':_0xc052('0xc'),'fields':[_0xc052('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7b29a89..b5f8811 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0xd943,0x15d));var _0x3d94=function(_0x9a4904,_0x167eba){_0x9a4904=_0x9a4904-0x0;var _0x27802e=_0xd943[_0x9a4904];return _0x27802e;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['update'](_0x2acee3[_0x3d94('0x16')],{'raw':_0x2acee3['options']?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x19')]||null:null,'attributes':_0x2acee3['options']?_0x2acee3['options'][_0x3d94('0x1a')]||null:null,'limit':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')]['limit']||null:null})[_0x3d94('0xa')](function(_0x2e8c91){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1b')](_0x3d94('0x14'),_0x2acee3,JSON[_0x3d94('0x1c')](_0x2e8c91));_0x4afc92(_0x2e8c91);})[_0x3d94('0x13')](function(_0xee7b8d){logger[_0x3d94('0xe')](_0x3d94('0x14'),_0xee7b8d[_0x3d94('0x11')],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0xee7b8d[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1d')]=function(_0x5b3b31){var _0x123183=this;return new Promise(function(_0x558fd2,_0x28a698){var _0x1d0a7a=require(_0x3d94('0x1e'));var _0x439173;return db[_0x3d94('0x1f')][_0x3d94('0x20')]({'attributes':['id',_0x3d94('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x584c4a){_0x439173=_0x584c4a;return db[_0x3d94('0x15')]['create'](_0x5b3b31['body']);})[_0x3d94('0xa')](function(_0x58c0d0){if(_0x439173[_0x3d94('0x21')]&&fs[_0x3d94('0x22')](_0x58c0d0[_0x3d94('0x23')])){var _0x4cef9c=util[_0x3d94('0x24')]('%s.cypher',_0x58c0d0[_0x3d94('0x23')]);return _0x1d0a7a['encryptFile'](_0x58c0d0[_0x3d94('0x23')],_0x4cef9c,config[_0x3d94('0x25')][_0x3d94('0x26')])[_0x3d94('0xa')](function(){fs['unlink'](_0x58c0d0[_0x3d94('0x23')]);logger['info'](_0x3d94('0x27'));return _0x58c0d0;});}return _0x58c0d0;})[_0x3d94('0xa')](function(_0x51d308){logger['info'](_0x3d94('0x1d'),_0x5b3b31);logger[_0x3d94('0x1b')](_0x3d94('0x1d'),_0x5b3b31,JSON['stringify'](_0x51d308));_0x558fd2(_0x51d308);})[_0x3d94('0x13')](function(_0x3d29fd){logger['error'](_0x3d94('0x1d'),_0x3d29fd[_0x3d94('0x11')],_0x5b3b31);_0x28a698(_0x123183[_0x3d94('0xe')](0x1f4,_0x3d29fd[_0x3d94('0x11')]));});});}; \ No newline at end of file +var _0x0120=['attributes','limit','then','debug','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','value','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x437e4c,_0x1fb6b7){var _0x3ad2ce=function(_0x1eb0a4){while(--_0x1eb0a4){_0x437e4c['push'](_0x437e4c['shift']());}};_0x3ad2ce(++_0x1fb6b7);}(_0x0120,0x6f));var _0x0012=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0120[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['VoiceRecording'][_0x0012('0x17')](_0x1d0423[_0x0012('0x18')],{'raw':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')]['where']||null:null,'attributes':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')][_0x0012('0x1c')]||null:null})[_0x0012('0x1d')](function(_0x2c9a96){logger[_0x0012('0xd')]('UpdateVoiceRecording',_0x1d0423);logger[_0x0012('0x1e')](_0x0012('0x16'),_0x1d0423,JSON['stringify'](_0x2c9a96));_0x1e78ee(_0x2c9a96);})[_0x0012('0x1f')](function(_0x13a78e){logger[_0x0012('0x12')](_0x0012('0x16'),_0x13a78e[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1['error'](0x1f4,_0x13a78e[_0x0012('0x14')]));});});};exports[_0x0012('0x20')]=function(_0xbb5b55){var _0x2a0302=this;return new Promise(function(_0x173cb3,_0xb37ef5){var _0x15d48a=require(_0x0012('0x21'));var _0x300e13;return db[_0x0012('0x22')][_0x0012('0x23')]({'attributes':['id',_0x0012('0x24')],'where':{'id':0x1},'raw':!![]})[_0x0012('0x1d')](function(_0x3ce788){_0x300e13=_0x3ce788;return db[_0x0012('0x25')][_0x0012('0x26')](_0xbb5b55[_0x0012('0x18')]);})[_0x0012('0x1d')](function(_0x1c23e0){if(_0x300e13[_0x0012('0x24')]&&fs[_0x0012('0x27')](_0x1c23e0['value'])){var _0x283134=util[_0x0012('0x28')]('%s.cypher',_0x1c23e0[_0x0012('0x29')]);return _0x15d48a[_0x0012('0x2a')](_0x1c23e0[_0x0012('0x29')],_0x283134,config[_0x0012('0x2b')][_0x0012('0x2c')])['then'](function(){fs[_0x0012('0x2d')](_0x1c23e0[_0x0012('0x29')]);logger[_0x0012('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1c23e0;});}return _0x1c23e0;})[_0x0012('0x1d')](function(_0x31225a){logger[_0x0012('0xd')](_0x0012('0x20'),_0xbb5b55);logger[_0x0012('0x1e')](_0x0012('0x20'),_0xbb5b55,JSON['stringify'](_0x31225a));_0x173cb3(_0x31225a);})[_0x0012('0x1f')](function(_0x30dfd8){logger[_0x0012('0x12')](_0x0012('0x20'),_0x30dfd8['message'],_0xbb5b55);_0xb37ef5(_0x2a0302['error'](0x1f4,_0x30dfd8[_0x0012('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1789ea7..f7f81dc 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d9b=['index','get','/describe','describe','/:id','create','put','delete','destroy','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x2d9b,0xe6));var _0xb2d9=function(_0x36fa06,_0x1426ea){_0x36fa06=_0x36fa06-0x0;var _0x18bcfa=_0x2d9b[_0x36fa06];return _0x18bcfa;};'use strict';var multer=require(_0xb2d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb2d9('0x1'));var express=require('express');var router=express[_0xb2d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb2d9('0x3'));var interaction=require(_0xb2d9('0x4'));var config=require(_0xb2d9('0x5'));var controller=require(_0xb2d9('0x6'));router['get']('/',auth[_0xb2d9('0x7')](),controller[_0xb2d9('0x8')]);router[_0xb2d9('0x9')](_0xb2d9('0xa'),auth[_0xb2d9('0x7')](),controller[_0xb2d9('0xb')]);router[_0xb2d9('0x9')](_0xb2d9('0xc'),auth[_0xb2d9('0x7')](),controller['show']);router['post']('/',auth[_0xb2d9('0x7')](),controller[_0xb2d9('0xd')]);router[_0xb2d9('0xe')](_0xb2d9('0xc'),auth[_0xb2d9('0x7')](),controller['update']);router[_0xb2d9('0xf')](_0xb2d9('0xc'),auth[_0xb2d9('0x7')](),controller[_0xb2d9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe995=['exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy'];(function(_0x32cc63,_0x358ec5){var _0x38033c=function(_0x20f5dd){while(--_0x20f5dd){_0x32cc63['push'](_0x32cc63['shift']());}};_0x38033c(++_0x358ec5);}(_0xe995,0x6d));var _0x5e99=function(_0x4be9b6,_0x58d19b){_0x4be9b6=_0x4be9b6-0x0;var _0x537b66=_0xe995[_0x4be9b6];return _0x537b66;};'use strict';var multer=require(_0x5e99('0x0'));var util=require('util');var path=require(_0x5e99('0x1'));var timeout=require(_0x5e99('0x2'));var express=require(_0x5e99('0x3'));var router=express['Router']();var fs_extra=require(_0x5e99('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e99('0x5'));var controller=require(_0x5e99('0x6'));router[_0x5e99('0x7')]('/',auth['isAuthenticated'](),controller[_0x5e99('0x8')]);router[_0x5e99('0x7')]('/describe',auth[_0x5e99('0x9')](),controller['describe']);router[_0x5e99('0x7')]('/:id',auth[_0x5e99('0x9')](),controller[_0x5e99('0xa')]);router[_0x5e99('0xb')]('/',auth['isAuthenticated'](),controller[_0x5e99('0xc')]);router[_0x5e99('0xd')](_0x5e99('0xe'),auth[_0x5e99('0x9')](),controller['update']);router[_0x5e99('0xf')]('/:id',auth[_0x5e99('0x9')](),controller[_0x5e99('0x10')]);module[_0x5e99('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 573664b..5201e95 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb5=['ENUM','blind','STRING','Yes','sequelize','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4eb5,0x1f0));var _0x54eb=function(_0xa99aa8,_0x42b42a){_0xa99aa8=_0xa99aa8-0x0;var _0x1d909e=_0x4eb5[_0xa99aa8];return _0x1d909e;};'use strict';var Sequelize=require(_0x54eb('0x0'));var moment=require(_0x54eb('0x1'));module['exports']={'type':{'type':Sequelize[_0x54eb('0x2')](_0x54eb('0x3'),'attended')},'result':{'type':Sequelize[_0x54eb('0x4')]},'transfererchannel':{'type':Sequelize[_0x54eb('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x54eb('0x4')]},'transferercalleridname':{'type':Sequelize[_0x54eb('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x54eb('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x54eb('0x4')]},'transferercontext':{'type':Sequelize[_0x54eb('0x4')]},'transfererexten':{'type':Sequelize[_0x54eb('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x54eb('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x54eb('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x54eb('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x54eb('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x54eb('0x4')]},'transfereecontext':{'type':Sequelize[_0x54eb('0x4')]},'transfereeexten':{'type':Sequelize[_0x54eb('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x54eb('0x4')]},'isexternal':{'type':Sequelize[_0x54eb('0x2')](_0x54eb('0x5'),'No')},'context':{'type':Sequelize[_0x54eb('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8896=['ENUM','blind','attended','STRING','sequelize','moment','exports'];(function(_0x42bdb4,_0x5419e5){var _0x4db7f4=function(_0x568d05){while(--_0x568d05){_0x42bdb4['push'](_0x42bdb4['shift']());}};_0x4db7f4(++_0x5419e5);}(_0x8896,0x162));var _0x6889=function(_0x5ca10f,_0x239ec9){_0x5ca10f=_0x5ca10f-0x0;var _0x5ca553=_0x8896[_0x5ca10f];return _0x5ca553;};'use strict';var Sequelize=require(_0x6889('0x0'));var moment=require(_0x6889('0x1'));module[_0x6889('0x2')]={'type':{'type':Sequelize[_0x6889('0x3')](_0x6889('0x4'),_0x6889('0x5'))},'result':{'type':Sequelize[_0x6889('0x6')]},'transfererchannel':{'type':Sequelize[_0x6889('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x6889('0x6')]},'transferercalleridname':{'type':Sequelize[_0x6889('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x6889('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x6889('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x6889('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x6889('0x6')]},'transfereechannel':{'type':Sequelize[_0x6889('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x6889('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6889('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x6889('0x6')]},'transfereecontext':{'type':Sequelize[_0x6889('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x6889('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x6889('0x6')]},'extension':{'type':Sequelize[_0x6889('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6d0eace..6ba5eb3 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfcb=['mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','reject','save','update','then','destroy','end','error','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xcfcb,0x19f));var _0xbcfc=function(_0x1de01d,_0xeb122c){_0x1de01d=_0x1de01d-0x0;var _0x2865ef=_0xcfcb[_0x1de01d];return _0x2865ef;};'use strict';var emlformat=require(_0xbcfc('0x0'));var rimraf=require(_0xbcfc('0x1'));var zipdir=require(_0xbcfc('0x2'));var jsonpatch=require(_0xbcfc('0x3'));var rp=require('request-promise');var moment=require(_0xbcfc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbcfc('0x5'));var util=require(_0xbcfc('0x6'));var path=require('path');var sox=require(_0xbcfc('0x7'));var csv=require(_0xbcfc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbcfc('0x9'));var crypto=require('crypto');var jsforce=require(_0xbcfc('0xa'));var deskjs=require(_0xbcfc('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbcfc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbcfc('0xd'));var qs=require(_0xbcfc('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcfc('0xf'))(_0xbcfc('0x10'));var utils=require(_0xbcfc('0x11'));var config=require(_0xbcfc('0x12'));var licenseUtil=require(_0xbcfc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2980,_0x38d9f0){_0x38d9f0=_0x38d9f0||0xcc;return function(_0x2b959d){if(_0x2b959d){return _0x2e2980[_0xbcfc('0x14')](_0x38d9f0);}return _0x2e2980[_0xbcfc('0x15')](_0x38d9f0)['end']();};}function respondWithResult(_0x3e4cac,_0x4bbffc){_0x4bbffc=_0x4bbffc||0xc8;return function(_0x134b21){if(_0x134b21){return _0x3e4cac[_0xbcfc('0x15')](_0x4bbffc)[_0xbcfc('0x16')](_0x134b21);}};}function respondWithFilteredResult(_0x12efea,_0x2b9562){return function(_0x794231){if(_0x794231){var _0x1f9ef2=typeof _0x2b9562[_0xbcfc('0x17')]===_0xbcfc('0x18')&&typeof _0x2b9562['limit']==='undefined';var _0x3bd7ae=_0x794231[_0xbcfc('0x19')];var _0x32d30a=_0x1f9ef2?0x0:_0x2b9562[_0xbcfc('0x17')];var _0x32399f=_0x1f9ef2?_0x794231[_0xbcfc('0x19')]:_0x2b9562[_0xbcfc('0x17')]+_0x2b9562['limit'];var _0x2782ca;if(_0x32399f>=_0x3bd7ae){_0x32399f=_0x3bd7ae;_0x2782ca=0xc8;}else{_0x2782ca=0xce;}_0x12efea['status'](_0x2782ca);return _0x12efea['set']('Content-Range',_0x32d30a+'-'+_0x32399f+'/'+_0x3bd7ae)['json'](_0x794231);}return null;};}function patchUpdates(_0x473064){return function(_0x59489e){try{jsonpatch['apply'](_0x59489e,_0x473064,!![]);}catch(_0x14ae5){return BPromise[_0xbcfc('0x1a')](_0x14ae5);}return _0x59489e[_0xbcfc('0x1b')]();};}function saveUpdates(_0x3f48c3,_0x8e0b37){return function(_0x10c957){if(_0x10c957){return _0x10c957[_0xbcfc('0x1c')](_0x3f48c3)[_0xbcfc('0x1d')](function(_0x127f12){return _0x127f12;});}return null;};}function removeEntity(_0x1a9607,_0xc8f168){return function(_0x3f27e7){if(_0x3f27e7){return _0x3f27e7[_0xbcfc('0x1e')]()['then'](function(){_0x1a9607[_0xbcfc('0x15')](0xcc)[_0xbcfc('0x1f')]();});}};}function handleEntityNotFound(_0x1c7b57,_0x347a18){return function(_0x232009){if(!_0x232009){_0x1c7b57[_0xbcfc('0x14')](0x194);}return _0x232009;};}function handleError(_0x1dd430,_0x53be93){_0x53be93=_0x53be93||0x1f4;return function(_0xd7a847){logger[_0xbcfc('0x20')](_0xd7a847['stack']);if(_0xd7a847['name']){delete _0xd7a847['name'];}_0x1dd430[_0xbcfc('0x15')](_0x53be93)[_0xbcfc('0x21')](_0xd7a847);};}exports[_0xbcfc('0x22')]=function(_0x1aae6f,_0x3d71ae){var _0x61feec={},_0x1d3d69={},_0x2fe84f={'count':0x0,'rows':[]};var _0x1c7d3f=_[_0xbcfc('0x23')](db[_0xbcfc('0x24')][_0xbcfc('0x25')],function(_0xcb0ed7){return{'name':_0xcb0ed7[_0xbcfc('0x26')],'type':_0xcb0ed7[_0xbcfc('0x27')]['key']};});_0x1d3d69[_0xbcfc('0x28')]=_[_0xbcfc('0x23')](_0x1c7d3f,_0xbcfc('0x29'));_0x1d3d69[_0xbcfc('0x2a')]=_[_0xbcfc('0x2b')](_0x1aae6f['query']);_0x1d3d69[_0xbcfc('0x2c')]=_['intersection'](_0x1d3d69['model'],_0x1d3d69[_0xbcfc('0x2a')]);_0x61feec['attributes']=_[_0xbcfc('0x2d')](_0x1d3d69[_0xbcfc('0x28')],qs['fields'](_0x1aae6f[_0xbcfc('0x2a')][_0xbcfc('0x2e')]));_0x61feec['attributes']=_0x61feec['attributes']['length']?_0x61feec[_0xbcfc('0x2f')]:_0x1d3d69[_0xbcfc('0x28')];if(!_0x1aae6f[_0xbcfc('0x2a')][_0xbcfc('0x30')](_0xbcfc('0x31'))){_0x61feec[_0xbcfc('0x32')]=qs[_0xbcfc('0x32')](_0x1aae6f['query'][_0xbcfc('0x32')]);_0x61feec[_0xbcfc('0x17')]=qs[_0xbcfc('0x17')](_0x1aae6f[_0xbcfc('0x2a')][_0xbcfc('0x17')]);}_0x61feec[_0xbcfc('0x33')]=qs[_0xbcfc('0x34')](_0x1aae6f[_0xbcfc('0x2a')]['sort']);_0x61feec[_0xbcfc('0x35')]=qs[_0xbcfc('0x2c')](_[_0xbcfc('0x36')](_0x1aae6f[_0xbcfc('0x2a')],_0x1d3d69[_0xbcfc('0x2c')]),_0x1c7d3f);if(_0x1aae6f[_0xbcfc('0x2a')][_0xbcfc('0x37')]){_0x61feec[_0xbcfc('0x35')]=_['merge'](_0x61feec[_0xbcfc('0x35')],{'$or':_['map'](_0x1c7d3f,function(_0x440a6f){if(_0x440a6f[_0xbcfc('0x27')]!=='VIRTUAL'){var _0x3e8c69={};_0x3e8c69[_0x440a6f[_0xbcfc('0x29')]]={'$like':'%'+_0x1aae6f[_0xbcfc('0x2a')][_0xbcfc('0x37')]+'%'};return _0x3e8c69;}})});}_0x61feec=_[_0xbcfc('0x38')]({},_0x61feec,_0x1aae6f[_0xbcfc('0x39')]);var _0x289c47={'where':_0x61feec[_0xbcfc('0x35')]};return db['VoiceTransferReport'][_0xbcfc('0x19')](_0x289c47)[_0xbcfc('0x1d')](function(_0x3412bc){_0x2fe84f['count']=_0x3412bc;if(_0x1aae6f[_0xbcfc('0x2a')]['includeAll']){_0x61feec[_0xbcfc('0x3a')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xbcfc('0x3b')](_0x61feec);})[_0xbcfc('0x1d')](function(_0x3f4b24){_0x2fe84f[_0xbcfc('0x3c')]=_0x3f4b24;return _0x2fe84f;})[_0xbcfc('0x1d')](respondWithFilteredResult(_0x3d71ae,_0x61feec))[_0xbcfc('0x3d')](handleError(_0x3d71ae,null));};exports[_0xbcfc('0x3e')]=function(_0x183f81,_0x8e0f02){var _0x5d34ec={'raw':!![],'where':{'id':_0x183f81[_0xbcfc('0x3f')]['id']}},_0x59849a={};_0x59849a[_0xbcfc('0x28')]=_[_0xbcfc('0x2b')](db['VoiceTransferReport'][_0xbcfc('0x25')]);_0x59849a[_0xbcfc('0x2a')]=_['keys'](_0x183f81[_0xbcfc('0x2a')]);_0x59849a[_0xbcfc('0x2c')]=_['intersection'](_0x59849a[_0xbcfc('0x28')],_0x59849a[_0xbcfc('0x2a')]);_0x5d34ec['attributes']=_[_0xbcfc('0x2d')](_0x59849a[_0xbcfc('0x28')],qs[_0xbcfc('0x2e')](_0x183f81[_0xbcfc('0x2a')][_0xbcfc('0x2e')]));_0x5d34ec[_0xbcfc('0x2f')]=_0x5d34ec['attributes'][_0xbcfc('0x40')]?_0x5d34ec[_0xbcfc('0x2f')]:_0x59849a[_0xbcfc('0x28')];if(_0x183f81[_0xbcfc('0x2a')][_0xbcfc('0x41')]){_0x5d34ec[_0xbcfc('0x3a')]=[{'all':!![]}];}_0x5d34ec=_['merge']({},_0x5d34ec,_0x183f81['options']);return db[_0xbcfc('0x24')][_0xbcfc('0x42')](_0x5d34ec)[_0xbcfc('0x1d')](handleEntityNotFound(_0x8e0f02,null))['then'](respondWithResult(_0x8e0f02,null))[_0xbcfc('0x3d')](handleError(_0x8e0f02,null));};exports[_0xbcfc('0x43')]=function(_0x20d5ab,_0x5b4766){return db[_0xbcfc('0x24')]['create'](_0x20d5ab[_0xbcfc('0x44')],{})[_0xbcfc('0x1d')](respondWithResult(_0x5b4766,0xc9))[_0xbcfc('0x3d')](handleError(_0x5b4766,null));};exports[_0xbcfc('0x1c')]=function(_0x1c09ef,_0x4d75ad){if(_0x1c09ef[_0xbcfc('0x44')]['id']){delete _0x1c09ef[_0xbcfc('0x44')]['id'];}return db[_0xbcfc('0x24')][_0xbcfc('0x42')]({'where':{'id':_0x1c09ef[_0xbcfc('0x3f')]['id']}})[_0xbcfc('0x1d')](handleEntityNotFound(_0x4d75ad,null))[_0xbcfc('0x1d')](saveUpdates(_0x1c09ef['body'],null))['then'](respondWithResult(_0x4d75ad,null))['catch'](handleError(_0x4d75ad,null));};exports[_0xbcfc('0x1e')]=function(_0x5480a3,_0x5d69b7){return db[_0xbcfc('0x24')][_0xbcfc('0x42')]({'where':{'id':_0x5480a3[_0xbcfc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d69b7,null))[_0xbcfc('0x1d')](removeEntity(_0x5d69b7,null))[_0xbcfc('0x3d')](handleError(_0x5d69b7,null));};exports[_0xbcfc('0x45')]=function(_0x59caf8,_0x359554){return db['VoiceTransferReport'][_0xbcfc('0x45')]()[_0xbcfc('0x1d')](respondWithResult(_0x359554,null))[_0xbcfc('0x3d')](handleError(_0x359554,null));}; \ No newline at end of file +var _0xcb34=['fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','length','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4d8aeb,_0x2f4959){var _0x8a0194=function(_0x2af768){while(--_0x2af768){_0x4d8aeb['push'](_0x4d8aeb['shift']());}};_0x8a0194(++_0x2f4959);}(_0xcb34,0x9b));var _0x4cb3=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xcb34[_0x616290];return _0x453879;};'use strict';var emlformat=require(_0x4cb3('0x0'));var rimraf=require(_0x4cb3('0x1'));var zipdir=require(_0x4cb3('0x2'));var jsonpatch=require(_0x4cb3('0x3'));var rp=require(_0x4cb3('0x4'));var moment=require(_0x4cb3('0x5'));var BPromise=require(_0x4cb3('0x6'));var Mustache=require(_0x4cb3('0x7'));var util=require(_0x4cb3('0x8'));var path=require(_0x4cb3('0x9'));var sox=require(_0x4cb3('0xa'));var csv=require(_0x4cb3('0xb'));var ejs=require(_0x4cb3('0xc'));var fs=require('fs');var fs_extra=require(_0x4cb3('0xd'));var _=require(_0x4cb3('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4cb3('0xf'));var deskjs=require(_0x4cb3('0x10'));var toCsv=require(_0x4cb3('0xb'));var querystring=require(_0x4cb3('0x11'));var Papa=require(_0x4cb3('0x12'));var Redis=require(_0x4cb3('0x13'));var authService=require(_0x4cb3('0x14'));var qs=require(_0x4cb3('0x15'));var as=require(_0x4cb3('0x16'));var hardwareService=require(_0x4cb3('0x17'));var logger=require(_0x4cb3('0x18'))(_0x4cb3('0x19'));var utils=require(_0x4cb3('0x1a'));var config=require(_0x4cb3('0x1b'));var licenseUtil=require(_0x4cb3('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c8226,_0xb9f980){_0xb9f980=_0xb9f980||0xcc;return function(_0x490b24){if(_0x490b24){return _0x4c8226[_0x4cb3('0x1d')](_0xb9f980);}return _0x4c8226[_0x4cb3('0x1e')](_0xb9f980)[_0x4cb3('0x1f')]();};}function respondWithResult(_0x384c36,_0xefb178){_0xefb178=_0xefb178||0xc8;return function(_0x3c60be){if(_0x3c60be){return _0x384c36[_0x4cb3('0x1e')](_0xefb178)[_0x4cb3('0x20')](_0x3c60be);}};}function respondWithFilteredResult(_0x12c3dc,_0x3a79a0){return function(_0x22e50a){if(_0x22e50a){var _0x326825=typeof _0x3a79a0[_0x4cb3('0x21')]==='undefined'&&typeof _0x3a79a0[_0x4cb3('0x22')]===_0x4cb3('0x23');var _0x57de9c=_0x22e50a[_0x4cb3('0x24')];var _0x381a64=_0x326825?0x0:_0x3a79a0[_0x4cb3('0x21')];var _0x2e636f=_0x326825?_0x22e50a[_0x4cb3('0x24')]:_0x3a79a0[_0x4cb3('0x21')]+_0x3a79a0[_0x4cb3('0x22')];var _0x212694;if(_0x2e636f>=_0x57de9c){_0x2e636f=_0x57de9c;_0x212694=0xc8;}else{_0x212694=0xce;}_0x12c3dc[_0x4cb3('0x1e')](_0x212694);return _0x12c3dc['set'](_0x4cb3('0x25'),_0x381a64+'-'+_0x2e636f+'/'+_0x57de9c)[_0x4cb3('0x20')](_0x22e50a);}return null;};}function patchUpdates(_0xe61e91){return function(_0x4ad07c){try{jsonpatch[_0x4cb3('0x26')](_0x4ad07c,_0xe61e91,!![]);}catch(_0x15a3f1){return BPromise[_0x4cb3('0x27')](_0x15a3f1);}return _0x4ad07c[_0x4cb3('0x28')]();};}function saveUpdates(_0xfc0673,_0x42d864){return function(_0x4c430b){if(_0x4c430b){return _0x4c430b[_0x4cb3('0x29')](_0xfc0673)[_0x4cb3('0x2a')](function(_0x199411){return _0x199411;});}return null;};}function removeEntity(_0x4f197e,_0x29598f){return function(_0x13603e){if(_0x13603e){return _0x13603e[_0x4cb3('0x2b')]()[_0x4cb3('0x2a')](function(){_0x4f197e['status'](0xcc)[_0x4cb3('0x1f')]();});}};}function handleEntityNotFound(_0x4c9e9c,_0x4cb50f){return function(_0x19904b){if(!_0x19904b){_0x4c9e9c[_0x4cb3('0x1d')](0x194);}return _0x19904b;};}function handleError(_0x5b2142,_0x46cce3){_0x46cce3=_0x46cce3||0x1f4;return function(_0x5346c2){logger[_0x4cb3('0x2c')](_0x5346c2[_0x4cb3('0x2d')]);if(_0x5346c2[_0x4cb3('0x2e')]){delete _0x5346c2['name'];}_0x5b2142[_0x4cb3('0x1e')](_0x46cce3)[_0x4cb3('0x2f')](_0x5346c2);};}exports[_0x4cb3('0x30')]=function(_0x2c79ca,_0x4a9626){var _0x237173={},_0x20fc77={},_0x252780={'count':0x0,'rows':[]};var _0x4f9dc0=_['map'](db[_0x4cb3('0x31')][_0x4cb3('0x32')],function(_0x66d2a3){return{'name':_0x66d2a3[_0x4cb3('0x33')],'type':_0x66d2a3[_0x4cb3('0x34')][_0x4cb3('0x35')]};});_0x20fc77['model']=_[_0x4cb3('0x36')](_0x4f9dc0,_0x4cb3('0x2e'));_0x20fc77[_0x4cb3('0x37')]=_[_0x4cb3('0x38')](_0x2c79ca[_0x4cb3('0x37')]);_0x20fc77[_0x4cb3('0x39')]=_[_0x4cb3('0x3a')](_0x20fc77['model'],_0x20fc77[_0x4cb3('0x37')]);_0x237173[_0x4cb3('0x3b')]=_['intersection'](_0x20fc77[_0x4cb3('0x3c')],qs[_0x4cb3('0x3d')](_0x2c79ca[_0x4cb3('0x37')][_0x4cb3('0x3d')]));_0x237173[_0x4cb3('0x3b')]=_0x237173[_0x4cb3('0x3b')]['length']?_0x237173[_0x4cb3('0x3b')]:_0x20fc77['model'];if(!_0x2c79ca[_0x4cb3('0x37')][_0x4cb3('0x3e')](_0x4cb3('0x3f'))){_0x237173[_0x4cb3('0x22')]=qs[_0x4cb3('0x22')](_0x2c79ca[_0x4cb3('0x37')][_0x4cb3('0x22')]);_0x237173[_0x4cb3('0x21')]=qs[_0x4cb3('0x21')](_0x2c79ca[_0x4cb3('0x37')]['offset']);}_0x237173[_0x4cb3('0x40')]=qs[_0x4cb3('0x41')](_0x2c79ca[_0x4cb3('0x37')]['sort']);_0x237173['where']=qs[_0x4cb3('0x39')](_[_0x4cb3('0x42')](_0x2c79ca[_0x4cb3('0x37')],_0x20fc77['filters']),_0x4f9dc0);if(_0x2c79ca[_0x4cb3('0x37')][_0x4cb3('0x43')]){_0x237173[_0x4cb3('0x44')]=_[_0x4cb3('0x45')](_0x237173[_0x4cb3('0x44')],{'$or':_[_0x4cb3('0x36')](_0x4f9dc0,function(_0x299204){if(_0x299204[_0x4cb3('0x34')]!==_0x4cb3('0x46')){var _0xda92a9={};_0xda92a9[_0x299204[_0x4cb3('0x2e')]]={'$like':'%'+_0x2c79ca[_0x4cb3('0x37')][_0x4cb3('0x43')]+'%'};return _0xda92a9;}})});}_0x237173=_[_0x4cb3('0x45')]({},_0x237173,_0x2c79ca['options']);var _0x2a0790={'where':_0x237173[_0x4cb3('0x44')]};return db[_0x4cb3('0x31')][_0x4cb3('0x24')](_0x2a0790)[_0x4cb3('0x2a')](function(_0x324d9a){_0x252780[_0x4cb3('0x24')]=_0x324d9a;if(_0x2c79ca['query']['includeAll']){_0x237173[_0x4cb3('0x47')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x4cb3('0x48')](_0x237173);})[_0x4cb3('0x2a')](function(_0x2906cc){_0x252780[_0x4cb3('0x49')]=_0x2906cc;return _0x252780;})[_0x4cb3('0x2a')](respondWithFilteredResult(_0x4a9626,_0x237173))[_0x4cb3('0x4a')](handleError(_0x4a9626,null));};exports[_0x4cb3('0x4b')]=function(_0x54e91e,_0x28bb5f){var _0x12e85a={'raw':!![],'where':{'id':_0x54e91e['params']['id']}},_0x5752b2={};_0x5752b2[_0x4cb3('0x3c')]=_[_0x4cb3('0x38')](db[_0x4cb3('0x31')][_0x4cb3('0x32')]);_0x5752b2[_0x4cb3('0x37')]=_[_0x4cb3('0x38')](_0x54e91e[_0x4cb3('0x37')]);_0x5752b2[_0x4cb3('0x39')]=_[_0x4cb3('0x3a')](_0x5752b2[_0x4cb3('0x3c')],_0x5752b2['query']);_0x12e85a['attributes']=_[_0x4cb3('0x3a')](_0x5752b2[_0x4cb3('0x3c')],qs[_0x4cb3('0x3d')](_0x54e91e[_0x4cb3('0x37')][_0x4cb3('0x3d')]));_0x12e85a[_0x4cb3('0x3b')]=_0x12e85a[_0x4cb3('0x3b')][_0x4cb3('0x4c')]?_0x12e85a[_0x4cb3('0x3b')]:_0x5752b2[_0x4cb3('0x3c')];if(_0x54e91e['query'][_0x4cb3('0x4d')]){_0x12e85a[_0x4cb3('0x47')]=[{'all':!![]}];}_0x12e85a=_[_0x4cb3('0x45')]({},_0x12e85a,_0x54e91e[_0x4cb3('0x4e')]);return db[_0x4cb3('0x31')][_0x4cb3('0x4f')](_0x12e85a)[_0x4cb3('0x2a')](handleEntityNotFound(_0x28bb5f,null))[_0x4cb3('0x2a')](respondWithResult(_0x28bb5f,null))[_0x4cb3('0x4a')](handleError(_0x28bb5f,null));};exports[_0x4cb3('0x50')]=function(_0x2eb46d,_0x1a49e5){return db[_0x4cb3('0x31')][_0x4cb3('0x50')](_0x2eb46d[_0x4cb3('0x51')],{})['then'](respondWithResult(_0x1a49e5,0xc9))[_0x4cb3('0x4a')](handleError(_0x1a49e5,null));};exports[_0x4cb3('0x29')]=function(_0x1a29b1,_0x25b883){if(_0x1a29b1[_0x4cb3('0x51')]['id']){delete _0x1a29b1['body']['id'];}return db[_0x4cb3('0x31')][_0x4cb3('0x4f')]({'where':{'id':_0x1a29b1[_0x4cb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x25b883,null))[_0x4cb3('0x2a')](saveUpdates(_0x1a29b1[_0x4cb3('0x51')],null))[_0x4cb3('0x2a')](respondWithResult(_0x25b883,null))['catch'](handleError(_0x25b883,null));};exports['destroy']=function(_0x3a814c,_0x59c85b){return db[_0x4cb3('0x31')][_0x4cb3('0x4f')]({'where':{'id':_0x3a814c[_0x4cb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x59c85b,null))[_0x4cb3('0x2a')](removeEntity(_0x59c85b,null))[_0x4cb3('0x4a')](handleError(_0x59c85b,null));};exports[_0x4cb3('0x53')]=function(_0x2ba619,_0x331105){return db[_0x4cb3('0x31')][_0x4cb3('0x53')]()[_0x4cb3('0x2a')](respondWithResult(_0x331105,null))[_0x4cb3('0x4a')](handleError(_0x331105,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 23b01a9..ad226f5 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e45=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0xc8c12b,_0x1271b0){var _0x4fc308=function(_0x822809){while(--_0x822809){_0xc8c12b['push'](_0xc8c12b['shift']());}};_0x4fc308(++_0x1271b0);}(_0x6e45,0x145));var _0x56e4=function(_0x59beb6,_0x57ff96){_0x59beb6=_0x59beb6-0x0;var _0x49c37b=_0x6e45[_0x59beb6];return _0x49c37b;};'use strict';var _=require(_0x56e4('0x0'));var util=require(_0x56e4('0x1'));var logger=require(_0x56e4('0x2'))(_0x56e4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56e4('0x4'));var fs=require('fs');var path=require(_0x56e4('0x5'));var rimraf=require(_0x56e4('0x6'));var config=require(_0x56e4('0x7'));var attributes=require(_0x56e4('0x8'));module[_0x56e4('0x9')]=function(_0x25b1e6,_0x4410a8){return _0x25b1e6[_0x56e4('0xa')](_0x56e4('0xb'),attributes,{'tableName':_0x56e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x960f=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x593683,_0x2b3213){var _0x44cc39=function(_0x5f085d){while(--_0x5f085d){_0x593683['push'](_0x593683['shift']());}};_0x44cc39(++_0x2b3213);}(_0x960f,0x1b4));var _0xf960=function(_0x23884b,_0x50c307){_0x23884b=_0x23884b-0x0;var _0x28113b=_0x960f[_0x23884b];return _0x28113b;};'use strict';var _=require(_0xf960('0x0'));var util=require(_0xf960('0x1'));var logger=require(_0xf960('0x2'))(_0xf960('0x3'));var moment=require(_0xf960('0x4'));var BPromise=require(_0xf960('0x5'));var rp=require(_0xf960('0x6'));var fs=require('fs');var path=require(_0xf960('0x7'));var rimraf=require(_0xf960('0x8'));var config=require(_0xf960('0x9'));var attributes=require(_0xf960('0xa'));module[_0xf960('0xb')]=function(_0x5950f5,_0x2b5ced){return _0x5950f5['define']('VoiceTransferReport',attributes,{'tableName':_0xf960('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 6f6b5cd..b59e24f 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2476=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x9d1e17,_0x2ed37){var _0x3430eb=function(_0x28576f){while(--_0x28576f){_0x9d1e17['push'](_0x9d1e17['shift']());}};_0x3430eb(++_0x2ed37);}(_0x2476,0xd4));var _0x6247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2476[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6247('0x0'));var util=require(_0x6247('0x1'));var moment=require('moment');var BPromise=require(_0x6247('0x2'));var rs=require(_0x6247('0x3'));var fs=require('fs');var Redis=require(_0x6247('0x4'));var db=require(_0x6247('0x5'))['db'];var utils=require(_0x6247('0x6'));var logger=require(_0x6247('0x7'))('rpc');var config=require(_0x6247('0x8'));var jayson=require(_0x6247('0x9'));var client=jayson['client'][_0x6247('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e8539,_0xc73644,_0x11bc18){return new BPromise(function(_0x424021,_0x5b4924){return client[_0x6247('0xb')](_0x2e8539,_0x11bc18)[_0x6247('0xc')](function(_0x272857){logger[_0x6247('0xd')](_0x6247('0xe'),_0xc73644,_0x6247('0xf'));logger[_0x6247('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xc73644,_0x6247('0xf'),JSON[_0x6247('0x11')](_0x272857));if(_0x272857[_0x6247('0x12')]){if(_0x272857['error'][_0x6247('0x13')]===0x1f4){logger[_0x6247('0x12')](_0x6247('0xe'),_0xc73644,_0x272857['error'][_0x6247('0x14')]);return _0x5b4924(_0x272857['error'][_0x6247('0x14')]);}logger['error'](_0x6247('0xe'),_0xc73644,_0x272857[_0x6247('0x12')][_0x6247('0x14')]);return _0x424021(_0x272857['error'][_0x6247('0x14')]);}else{logger['info'](_0x6247('0xe'),_0xc73644,_0x6247('0xf'));_0x424021(_0x272857['result'][_0x6247('0x14')]);}})[_0x6247('0x15')](function(_0x1b1d06){logger[_0x6247('0x12')](_0x6247('0xe'),_0xc73644,_0x1b1d06);_0x5b4924(_0x1b1d06);});});}exports[_0x6247('0x16')]=function(_0x20e6d8){var _0x300ad4=this;return new Promise(function(_0x2b13c9,_0x406940){return db['VoiceTransferReport'][_0x6247('0x17')](_0x20e6d8[_0x6247('0x18')],{'raw':_0x20e6d8['options']?_0x20e6d8[_0x6247('0x19')][_0x6247('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f09c6){logger['info'](_0x6247('0x16'),_0x20e6d8);logger['debug'](_0x6247('0x16'),_0x20e6d8,JSON['stringify'](_0x3f09c6));_0x2b13c9(_0x3f09c6);})[_0x6247('0x15')](function(_0x1ff313){logger[_0x6247('0x12')](_0x6247('0x16'),_0x1ff313['message'],_0x20e6d8);_0x406940(_0x300ad4[_0x6247('0x12')](0x1f4,_0x1ff313[_0x6247('0x14')]));});});}; \ No newline at end of file +var _0x67e5=['rpc','jayson/promise','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x282b86,_0x457a74){var _0x1db97d=function(_0x296424){while(--_0x296424){_0x282b86['push'](_0x282b86['shift']());}};_0x1db97d(++_0x457a74);}(_0x67e5,0x106));var _0x567e=function(_0x465620,_0x4d4aa0){_0x465620=_0x465620-0x0;var _0x1cfd2d=_0x67e5[_0x465620];return _0x1cfd2d;};'use strict';var _=require(_0x567e('0x0'));var util=require(_0x567e('0x1'));var moment=require(_0x567e('0x2'));var BPromise=require(_0x567e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x567e('0x4'));var db=require(_0x567e('0x5'))['db'];var utils=require(_0x567e('0x6'));var logger=require(_0x567e('0x7'))(_0x567e('0x8'));var config=require('../../config/environment');var jayson=require(_0x567e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e4a71,_0x48a47a,_0x104177){return new BPromise(function(_0x10ffd6,_0x211522){return client[_0x567e('0xa')](_0x5e4a71,_0x104177)[_0x567e('0xb')](function(_0x4bdf32){logger[_0x567e('0xc')](_0x567e('0xd'),_0x48a47a,_0x567e('0xe'));logger[_0x567e('0xf')](_0x567e('0x10'),_0x48a47a,_0x567e('0xe'),JSON[_0x567e('0x11')](_0x4bdf32));if(_0x4bdf32[_0x567e('0x12')]){if(_0x4bdf32['error'][_0x567e('0x13')]===0x1f4){logger[_0x567e('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x48a47a,_0x4bdf32['error']['message']);return _0x211522(_0x4bdf32['error']['message']);}logger[_0x567e('0x12')](_0x567e('0xd'),_0x48a47a,_0x4bdf32['error'][_0x567e('0x14')]);return _0x10ffd6(_0x4bdf32[_0x567e('0x12')][_0x567e('0x14')]);}else{logger[_0x567e('0xc')](_0x567e('0xd'),_0x48a47a,_0x567e('0xe'));_0x10ffd6(_0x4bdf32[_0x567e('0x15')][_0x567e('0x14')]);}})[_0x567e('0x16')](function(_0x431979){logger[_0x567e('0x12')](_0x567e('0xd'),_0x48a47a,_0x431979);_0x211522(_0x431979);});});}exports[_0x567e('0x17')]=function(_0x35b76b){var _0x4ce5f8=this;return new Promise(function(_0x5e3419,_0xcd0c60){return db['VoiceTransferReport'][_0x567e('0x18')](_0x35b76b['body'],{'raw':_0x35b76b[_0x567e('0x19')]?_0x35b76b[_0x567e('0x19')][_0x567e('0x1a')]===undefined?!![]:![]:!![]})[_0x567e('0xb')](function(_0x31ceaf){logger['info'](_0x567e('0x17'),_0x35b76b);logger[_0x567e('0xf')](_0x567e('0x17'),_0x35b76b,JSON[_0x567e('0x11')](_0x31ceaf));_0x5e3419(_0x31ceaf);})[_0x567e('0x16')](function(_0x4fa030){logger[_0x567e('0x12')](_0x567e('0x17'),_0x4fa030[_0x567e('0x14')],_0x35b76b);_0xcd0c60(_0x4ce5f8[_0x567e('0x12')](0x1f4,_0x4fa030[_0x567e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 631048d..99fcd64 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xcb91[_0x11005e];return _0x29338f;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0xf89841,_0x50c661){var _0x45c3fb=function(_0x4d4e7c){while(--_0x4d4e7c){_0xf89841['push'](_0xf89841['shift']());}};_0x45c3fb(++_0x50c661);}(_0x54ef,0x112));var _0xf54e=function(_0x241c8e,_0x5533ab){_0x241c8e=_0x241c8e-0x0;var _0x2fd248=_0x54ef[_0x241c8e];return _0x2fd248;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 53f0b38..e7d30e8 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17ba=['webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','log','error','stack','name','status','send','request','code','message','result','catch','VoiceChannels','all','then','filter','rows','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callbackUrl','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','user:%s'];(function(_0x211e36,_0x4b7fbd){var _0x179c3f=function(_0x1fd207){while(--_0x1fd207){_0x211e36['push'](_0x211e36['shift']());}};_0x179c3f(++_0x4b7fbd);}(_0x17ba,0xab));var _0xa17b=function(_0xb2d5a8,_0x11abbc){_0xb2d5a8=_0xb2d5a8-0x0;var _0x52caf0=_0x17ba[_0xb2d5a8];return _0x52caf0;};'use strict';var path=require(_0xa17b('0x0'));var fs=require('fs');var _=require(_0xa17b('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xa17b('0x2'));var util=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var jayson=require(_0xa17b('0x5'));var amiClient=jayson[_0xa17b('0x6')][_0xa17b('0x7')]({'port':0x232a});var logger=require(_0xa17b('0x8'))(_0xa17b('0x9'));var Redis=require(_0xa17b('0xa'));config[_0xa17b('0xb')]=_[_0xa17b('0xc')](config[_0xa17b('0xb')],{'host':_0xa17b('0xd'),'port':0x18eb});var io=require(_0xa17b('0xe'))(new Redis(config[_0xa17b('0xb')]));var Schema=require(_0xa17b('0xf'));var originateValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'callNumber':{'type':_0xa17b('0x12'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa17b('0x12')},'callbackUrl':{'type':_0xa17b('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':_0xa17b('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':_0xa17b('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xa17b('0x12'),'required':[!![],_0xa17b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa17b('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]}});function emit(_0x1c0578,_0x1f8141,_0x4870fb){logger[_0xa17b('0x14')](_0x1c0578,_0x1f8141,JSON['stringify'](_0x4870fb));io['to'](_0x1c0578)['emit'](_0x1f8141,_0x4870fb);}function handleError(_0x47d80b){return function(_0x36f985){console[_0xa17b('0x15')]('handleError:',_0x36f985,_0x36f985 instanceof RangeError);logger[_0xa17b('0x16')](_0x36f985[_0xa17b('0x17')]);if(_0x36f985 instanceof RangeError){if(_0x36f985[_0xa17b('0x18')]){delete _0x36f985[_0xa17b('0x18')];}_0x47d80b[_0xa17b('0x19')](0x194)[_0xa17b('0x1a')](_0x36f985);}else{if(_0x36f985[_0xa17b('0x18')]){delete _0x36f985['name'];}_0x47d80b[_0xa17b('0x19')](0x1f4)[_0xa17b('0x1a')](_0x36f985);}};}function checkError(){return function(_0x45bd0c){if(!_0x45bd0c){throw new RangeError('NotFound');}return _0x45bd0c;};}function respondWithRpcPromise(_0x44f7bc,_0x1a6471){return new BPromise(function(_0x24d305,_0xbbbb62){var _0x3c7ec2=amiClient;return _0x3c7ec2[_0xa17b('0x1b')](_0x44f7bc,_0x1a6471)['then'](function(_0x3df11f){if(_0x3df11f['error']){if(_0x3df11f[_0xa17b('0x16')][_0xa17b('0x1c')]===0x1f4){return _0xbbbb62(_0x3df11f['error']['message']);}return _0x24d305(_0x3df11f[_0xa17b('0x16')][_0xa17b('0x1d')]);}else{_0x24d305(_0x3df11f[_0xa17b('0x1e')]);}})[_0xa17b('0x1f')](function(_0x3c32a5){_0xbbbb62(_0x3c32a5);});});}function getAgent(_0x3a64f5){return db['User']['findOne']({'where':{'id':_0x3a64f5,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x2b1708,_0x5ef356){return new BPromise(function(_0x295e67,_0x4ff3f8){var _0x14671b=respondWithRpcPromise(_0xa17b('0x20'));var _0x32cad9=getAgent(_0x2b1708);Promise[_0xa17b('0x21')]([_0x14671b,_0x32cad9])[_0xa17b('0x22')](function(_0x3ccdb8){var _0x2fbbe8=_0x3ccdb8[0x0];var _0x366b47=_0x3ccdb8[0x1];var _0x43b1f5=_[_0xa17b('0x23')](_0x2fbbe8[_0xa17b('0x24')],function(_0x573585){return _0x573585['UserId']==_0x366b47['id']&&_0x573585['sessionId']==_0x5ef356;});if(_0x43b1f5[_0xa17b('0x25')]==0x1){_0x295e67(_0x366b47);}else{_0x4ff3f8(new RangeError(_0xa17b('0x26')+_0x5ef356+_0xa17b('0x27')));}});});}exports[_0xa17b('0x28')]=function(_0x16dd1f,_0x156409){logger[_0xa17b('0x14')](_0xa17b('0x29'),_0x16dd1f['body']);var _0x1e33bf=originateValidation['validate'](_0x16dd1f[_0xa17b('0x2a')]);if(_0x1e33bf[_0xa17b('0x25')]>0x0){return _0x156409[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x1e33bf);}var _0x4ec38d=_0x16dd1f[_0xa17b('0x2a')]['userId'];var _0x3031b5=_0x16dd1f[_0xa17b('0x2a')][_0xa17b('0x2c')];var _0x12d8af=_0x16dd1f[_0xa17b('0x2a')]['callerId'];var _0x2db32a=_0x16dd1f['body'][_0xa17b('0x2d')];return getAgent(_0x4ec38d)['then'](function(_0x449faa){logger[_0xa17b('0x14')]('entityFound:',_0x449faa[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x449faa[_0xa17b('0x18')]),_0xa17b('0x2f'),{'callNumber':_0x3031b5,'callerId':_0x12d8af,'callbackUrl':_0x2db32a});return _0x156409[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':_0xa17b('0x30')});})['catch'](handleError(_0x156409));};exports[_0xa17b('0x31')]=function(_0x506488,_0x26786d){logger['info'](_0xa17b('0x32'),_0x506488['body']);var _0x1e457e=hangupValidation['validate'](_0x506488[_0xa17b('0x2a')]);if(_0x1e457e['length']>0x0){return _0x26786d[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x1e457e);}var _0x5bfb5=_0x506488[_0xa17b('0x2a')][_0xa17b('0x33')];var _0xdd429f=_0x506488[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x5bfb5)['then'](function(_0x468c92){logger[_0xa17b('0x14')]('entityFound:',_0x468c92[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')](_0xa17b('0x35'),_0x468c92[_0xa17b('0x18')]),_0xa17b('0x36'),{'sessionId':_0xdd429f});return _0x26786d[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':_0xa17b('0x37')});})[_0xa17b('0x1f')](handleError(_0x26786d));};exports[_0xa17b('0x38')]=function(_0x5ec459,_0x54b65c){logger['info'](_0xa17b('0x39'),_0x5ec459[_0xa17b('0x2a')]);var _0x3c2788=answerValidation[_0xa17b('0xf')](_0x5ec459[_0xa17b('0x2a')]);if(_0x3c2788[_0xa17b('0x25')]>0x0){return _0x54b65c[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x3c2788);}var _0x1704ba=_0x5ec459[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x1267de=_0x5ec459['body'][_0xa17b('0x34')];return getAgent(_0x1704ba)[_0xa17b('0x22')](function(_0x384c12){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x384c12[_0xa17b('0x18')]);emit(util['format'](_0xa17b('0x35'),_0x384c12[_0xa17b('0x18')]),_0xa17b('0x3b'),{'sessionId':_0x1267de});return _0x54b65c[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':'answer\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x54b65c));};exports[_0xa17b('0x3c')]=function(_0x2b4831,_0x1dc0f7){logger['info'](_0xa17b('0x3d'),_0x2b4831[_0xa17b('0x2a')]);var _0x421470=holdValidation[_0xa17b('0xf')](_0x2b4831[_0xa17b('0x2a')]);if(_0x421470[_0xa17b('0x25')]>0x0){return _0x1dc0f7[_0xa17b('0x19')](0x190)['json'](_0x421470);}var _0x43b5d5=_0x2b4831[_0xa17b('0x2a')]['userId'];var _0xb4b4d=_0x2b4831[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x43b5d5)['then'](function(_0x187237){logger[_0xa17b('0x14')]('entityFound:',_0x187237[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x187237[_0xa17b('0x18')]),_0xa17b('0x3e'),{'sessionId':_0xb4b4d});return _0x1dc0f7['status'](0xc8)[_0xa17b('0x2b')]({'error':![],'message':_0xa17b('0x3f')});})[_0xa17b('0x1f')](handleError(_0x1dc0f7));};exports[_0xa17b('0x40')]=function(_0x2f4a2c,_0x133823){logger[_0xa17b('0x14')]('unhold\x20fired:',_0x2f4a2c[_0xa17b('0x2a')]);var _0x3ff07a=unholdValidation[_0xa17b('0xf')](_0x2f4a2c[_0xa17b('0x2a')]);if(_0x3ff07a[_0xa17b('0x25')]>0x0){return _0x133823[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x3ff07a);}var _0x100d14=_0x2f4a2c[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x1e4b67=_0x2f4a2c[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x100d14)['then'](function(_0x4c62a3){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x4c62a3[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')](_0xa17b('0x35'),_0x4c62a3[_0xa17b('0x18')]),_0xa17b('0x41'),{'sessionId':_0x1e4b67});return _0x133823[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x133823));};exports[_0xa17b('0x42')]=function(_0x55b0e4,_0x568f27){logger['info'](_0xa17b('0x43'),_0x568f27[_0xa17b('0x2a')]);var _0x3aeae5=callsValidation[_0xa17b('0xf')](_0x55b0e4[_0xa17b('0x2a')]);if(_0x3aeae5[_0xa17b('0x25')]>0x0){return _0x568f27['status'](0x190)['json'](_0x3aeae5);}var _0x555529=_0x55b0e4['body']['userId'];var _0x2a62e4=respondWithRpcPromise(_0xa17b('0x20'));var _0x20fe4a=getAgent(_0x555529);return Promise[_0xa17b('0x21')]([_0x2a62e4,_0x20fe4a])[_0xa17b('0x22')](function(_0x273671){var _0x3270a0=_0x273671[0x0];var _0x55b98a=_0x273671[0x1];var _0x3e739a=_[_0xa17b('0x23')](_0x3270a0[_0xa17b('0x24')],function(_0x2d744d){return _0x2d744d[_0xa17b('0x44')]==_0x55b98a['id'];});return _0x568f27[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'count':_0x3e739a[_0xa17b('0x25')],'rows':_0x3e739a});})[_0xa17b('0x1f')](handleError(_0x568f27));};exports[_0xa17b('0x45')]=function(_0x3d9a89,_0xef6b2e){logger['info'](_0xa17b('0x46'),_0x3d9a89['body']);var _0x3de0d8=conferenceValidation[_0xa17b('0xf')](_0x3d9a89[_0xa17b('0x2a')]);if(_0x3de0d8[_0xa17b('0x25')]>0x0){return _0xef6b2e['status'](0x190)[_0xa17b('0x2b')](_0x3de0d8);}var _0x57a1d9=_0x3d9a89[_0xa17b('0x2a')]['userId'];return getAgent(_0x57a1d9)['then'](function(_0x299c83){logger[_0xa17b('0x14')]('entityFound:',_0x299c83[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x299c83['name']),_0xa17b('0x47'));return _0xef6b2e[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':_0xa17b('0x48')});})[_0xa17b('0x1f')](handleError(_0xef6b2e));};exports['transfer']=function(_0x27ba7a,_0x3ad933){logger[_0xa17b('0x14')](_0xa17b('0x49'),_0x27ba7a[_0xa17b('0x2a')]);var _0x521468=transferValidation[_0xa17b('0xf')](_0x27ba7a[_0xa17b('0x2a')]);if(_0x521468[_0xa17b('0x25')]>0x0){return _0x3ad933[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x521468);}var _0x2e65b1=_0x27ba7a[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x3fb393=_0x27ba7a[_0xa17b('0x2a')]['sessionId'];var _0x36ae46=_0x27ba7a[_0xa17b('0x2a')]['transferNumber'];return getAgent(_0x2e65b1)['then'](function(_0x14dbba){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x14dbba[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x14dbba[_0xa17b('0x18')]),_0xa17b('0x4a'),{'sessionId':_0x3fb393,'transferNumber':_0x36ae46});return _0x3ad933[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':'transfer\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x3ad933));}; \ No newline at end of file +var _0x765e=['NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','hold','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send'];(function(_0x3971cd,_0x100691){var _0x1bae4c=function(_0x4f5270){while(--_0x4f5270){_0x3971cd['push'](_0x3971cd['shift']());}};_0x1bae4c(++_0x100691);}(_0x765e,0x131));var _0xe765=function(_0x1d9176,_0x4a02ee){_0x1d9176=_0x1d9176-0x0;var _0x444975=_0x765e[_0x1d9176];return _0x444975;};'use strict';var path=require(_0xe765('0x0'));var fs=require('fs');var _=require(_0xe765('0x1'));var db=require(_0xe765('0x2'))['db'];var config=require(_0xe765('0x3'));var util=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var jayson=require(_0xe765('0x6'));var amiClient=jayson[_0xe765('0x7')][_0xe765('0x8')]({'port':0x232a});var logger=require(_0xe765('0x9'))(_0xe765('0xa'));var Redis=require(_0xe765('0xb'));config[_0xe765('0xc')]=_[_0xe765('0xd')](config[_0xe765('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xe765('0xe'))(new Redis(config[_0xe765('0xc')]));var Schema=require(_0xe765('0xf'));var originateValidation=new Schema({'userId':{'type':_0xe765('0x10'),'required':[!![],_0xe765('0x11')]},'callNumber':{'type':_0xe765('0x12'),'required':[!![],_0xe765('0x13')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe765('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xe765('0x10'),'required':[!![],_0xe765('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe765('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe765('0x11')]},'sessionId':{'type':_0xe765('0x12'),'required':[!![],_0xe765('0x14')]},'transferNumber':{'type':_0xe765('0x12'),'required':[!![],_0xe765('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe765('0x11')]},'sessionId':{'type':_0xe765('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe765('0x10'),'required':[!![],_0xe765('0x11')]},'sessionId':{'type':_0xe765('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xe765('0x10'),'required':[!![],_0xe765('0x11')]}});function emit(_0x3c887b,_0x4856fe,_0xb240d6){logger[_0xe765('0x16')](_0x3c887b,_0x4856fe,JSON[_0xe765('0x17')](_0xb240d6));io['to'](_0x3c887b)[_0xe765('0x18')](_0x4856fe,_0xb240d6);}function handleError(_0x2fcb46){return function(_0xf93371){console[_0xe765('0x19')](_0xe765('0x1a'),_0xf93371,_0xf93371 instanceof RangeError);logger[_0xe765('0x1b')](_0xf93371['stack']);if(_0xf93371 instanceof RangeError){if(_0xf93371[_0xe765('0x1c')]){delete _0xf93371['name'];}_0x2fcb46[_0xe765('0x1d')](0x194)[_0xe765('0x1e')](_0xf93371);}else{if(_0xf93371['name']){delete _0xf93371[_0xe765('0x1c')];}_0x2fcb46['status'](0x1f4)[_0xe765('0x1e')](_0xf93371);}};}function checkError(){return function(_0x368b7e){if(!_0x368b7e){throw new RangeError(_0xe765('0x1f'));}return _0x368b7e;};}function respondWithRpcPromise(_0x50970b,_0x51813d){return new BPromise(function(_0x4b789b,_0x1c6de4){var _0x2a4427=amiClient;return _0x2a4427[_0xe765('0x20')](_0x50970b,_0x51813d)[_0xe765('0x21')](function(_0x54b59c){if(_0x54b59c['error']){if(_0x54b59c[_0xe765('0x1b')][_0xe765('0x22')]===0x1f4){return _0x1c6de4(_0x54b59c[_0xe765('0x1b')][_0xe765('0x23')]);}return _0x4b789b(_0x54b59c[_0xe765('0x1b')]['message']);}else{_0x4b789b(_0x54b59c[_0xe765('0x24')]);}})['catch'](function(_0x2b1f66){_0x1c6de4(_0x2b1f66);});});}function getAgent(_0xff097f){return db[_0xe765('0x25')][_0xe765('0x26')]({'where':{'id':_0xff097f,'role':_0xe765('0x27')}})[_0xe765('0x21')](checkError());}function getAgentCheckSession(_0x471d57,_0x530838){return new BPromise(function(_0x55086d,_0x52476f){var _0x4bc5c1=respondWithRpcPromise(_0xe765('0x28'));var _0x3f7493=getAgent(_0x471d57);Promise[_0xe765('0x29')]([_0x4bc5c1,_0x3f7493])[_0xe765('0x21')](function(_0x1a8c01){var _0x4fce2c=_0x1a8c01[0x0];var _0x43349b=_0x1a8c01[0x1];var _0x865ae8=_[_0xe765('0x2a')](_0x4fce2c['rows'],function(_0x5947c1){return _0x5947c1[_0xe765('0x2b')]==_0x43349b['id']&&_0x5947c1['sessionId']==_0x530838;});if(_0x865ae8[_0xe765('0x2c')]==0x1){_0x55086d(_0x43349b);}else{_0x52476f(new RangeError(_0xe765('0x2d')+_0x530838+_0xe765('0x2e')));}});});}exports[_0xe765('0x2f')]=function(_0x3b659a,_0x56127d){logger['info'](_0xe765('0x30'),_0x3b659a[_0xe765('0x31')]);var _0x2eee38=originateValidation[_0xe765('0xf')](_0x3b659a[_0xe765('0x31')]);if(_0x2eee38['length']>0x0){return _0x56127d['status'](0x190)[_0xe765('0x32')](_0x2eee38);}var _0x5bdd4b=_0x3b659a[_0xe765('0x31')][_0xe765('0x33')];var _0xd7ce30=_0x3b659a[_0xe765('0x31')][_0xe765('0x34')];var _0x45fd85=_0x3b659a[_0xe765('0x31')]['callerId'];var _0x494213=_0x3b659a['body'][_0xe765('0x35')];return getAgent(_0x5bdd4b)[_0xe765('0x21')](function(_0x120ca9){logger[_0xe765('0x16')]('entityFound:',_0x120ca9[_0xe765('0x1c')]);emit(util[_0xe765('0x36')](_0xe765('0x37'),_0x120ca9[_0xe765('0x1c')]),'webbar:originate',{'callNumber':_0xd7ce30,'callerId':_0x45fd85,'callbackUrl':_0x494213});return _0x56127d[_0xe765('0x1d')](0xc8)['json']({'error':![],'message':_0xe765('0x38')});})[_0xe765('0x39')](handleError(_0x56127d));};exports[_0xe765('0x3a')]=function(_0x1f58ef,_0x1be855){logger[_0xe765('0x16')](_0xe765('0x3b'),_0x1f58ef[_0xe765('0x31')]);var _0xc6618c=hangupValidation[_0xe765('0xf')](_0x1f58ef['body']);if(_0xc6618c[_0xe765('0x2c')]>0x0){return _0x1be855[_0xe765('0x1d')](0x190)[_0xe765('0x32')](_0xc6618c);}var _0x531cce=_0x1f58ef['body']['userId'];var _0x43bea6=_0x1f58ef['body'][_0xe765('0x3c')];return getAgent(_0x531cce)[_0xe765('0x21')](function(_0x3be7d7){logger[_0xe765('0x16')]('entityFound:',_0x3be7d7[_0xe765('0x1c')]);emit(util[_0xe765('0x36')](_0xe765('0x37'),_0x3be7d7[_0xe765('0x1c')]),_0xe765('0x3d'),{'sessionId':_0x43bea6});return _0x1be855[_0xe765('0x1d')](0xc8)[_0xe765('0x32')]({'error':![],'message':_0xe765('0x3e')});})[_0xe765('0x39')](handleError(_0x1be855));};exports[_0xe765('0x3f')]=function(_0x495e4e,_0x3d3a24){logger['info'](_0xe765('0x40'),_0x495e4e[_0xe765('0x31')]);var _0x4d2814=answerValidation[_0xe765('0xf')](_0x495e4e['body']);if(_0x4d2814['length']>0x0){return _0x3d3a24['status'](0x190)[_0xe765('0x32')](_0x4d2814);}var _0xb77b5e=_0x495e4e[_0xe765('0x31')]['userId'];var _0x2de9de=_0x495e4e[_0xe765('0x31')][_0xe765('0x3c')];return getAgent(_0xb77b5e)[_0xe765('0x21')](function(_0x2f664c){logger[_0xe765('0x16')](_0xe765('0x41'),_0x2f664c[_0xe765('0x1c')]);emit(util[_0xe765('0x36')]('user:%s',_0x2f664c[_0xe765('0x1c')]),'webbar:answer',{'sessionId':_0x2de9de});return _0x3d3a24['status'](0xc8)[_0xe765('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0xe765('0x39')](handleError(_0x3d3a24));};exports[_0xe765('0x42')]=function(_0x1707aa,_0x48b8a5){logger[_0xe765('0x16')]('hold\x20fired:',_0x1707aa[_0xe765('0x31')]);var _0x14421d=holdValidation[_0xe765('0xf')](_0x1707aa['body']);if(_0x14421d[_0xe765('0x2c')]>0x0){return _0x48b8a5[_0xe765('0x1d')](0x190)[_0xe765('0x32')](_0x14421d);}var _0x2d360e=_0x1707aa['body']['userId'];var _0x5391c8=_0x1707aa[_0xe765('0x31')][_0xe765('0x3c')];return getAgent(_0x2d360e)[_0xe765('0x21')](function(_0x58310d){logger[_0xe765('0x16')]('entityFound:',_0x58310d[_0xe765('0x1c')]);emit(util[_0xe765('0x36')](_0xe765('0x37'),_0x58310d[_0xe765('0x1c')]),_0xe765('0x43'),{'sessionId':_0x5391c8});return _0x48b8a5[_0xe765('0x1d')](0xc8)['json']({'error':![],'message':_0xe765('0x44')});})[_0xe765('0x39')](handleError(_0x48b8a5));};exports[_0xe765('0x45')]=function(_0x1214a8,_0x14c3b5){logger[_0xe765('0x16')]('unhold\x20fired:',_0x1214a8['body']);var _0x99f318=unholdValidation[_0xe765('0xf')](_0x1214a8[_0xe765('0x31')]);if(_0x99f318['length']>0x0){return _0x14c3b5[_0xe765('0x1d')](0x190)[_0xe765('0x32')](_0x99f318);}var _0x2be110=_0x1214a8[_0xe765('0x31')][_0xe765('0x33')];var _0x1f75a2=_0x1214a8[_0xe765('0x31')][_0xe765('0x3c')];return getAgent(_0x2be110)['then'](function(_0x4ae23b){logger[_0xe765('0x16')]('entityFound:',_0x4ae23b[_0xe765('0x1c')]);emit(util[_0xe765('0x36')](_0xe765('0x37'),_0x4ae23b['name']),_0xe765('0x46'),{'sessionId':_0x1f75a2});return _0x14c3b5[_0xe765('0x1d')](0xc8)['json']({'error':![],'message':_0xe765('0x47')});})[_0xe765('0x39')](handleError(_0x14c3b5));};exports[_0xe765('0x48')]=function(_0x457667,_0xabbaa1){logger[_0xe765('0x16')](_0xe765('0x49'),_0xabbaa1[_0xe765('0x31')]);var _0x45be53=callsValidation[_0xe765('0xf')](_0x457667[_0xe765('0x31')]);if(_0x45be53[_0xe765('0x2c')]>0x0){return _0xabbaa1[_0xe765('0x1d')](0x190)['json'](_0x45be53);}var _0x11c08a=_0x457667[_0xe765('0x31')][_0xe765('0x33')];var _0x3563a2=respondWithRpcPromise(_0xe765('0x28'));var _0x3d5553=getAgent(_0x11c08a);return Promise[_0xe765('0x29')]([_0x3563a2,_0x3d5553])[_0xe765('0x21')](function(_0x60844c){var _0x557217=_0x60844c[0x0];var _0x138118=_0x60844c[0x1];var _0x478d32=_[_0xe765('0x2a')](_0x557217[_0xe765('0x4a')],function(_0x4dd273){return _0x4dd273[_0xe765('0x2b')]==_0x138118['id'];});return _0xabbaa1[_0xe765('0x1d')](0xc8)[_0xe765('0x32')]({'count':_0x478d32[_0xe765('0x2c')],'rows':_0x478d32});})[_0xe765('0x39')](handleError(_0xabbaa1));};exports[_0xe765('0x4b')]=function(_0x414ec2,_0x4a19d8){logger[_0xe765('0x16')](_0xe765('0x4c'),_0x414ec2['body']);var _0x413849=conferenceValidation[_0xe765('0xf')](_0x414ec2[_0xe765('0x31')]);if(_0x413849['length']>0x0){return _0x4a19d8[_0xe765('0x1d')](0x190)[_0xe765('0x32')](_0x413849);}var _0x118d34=_0x414ec2['body']['userId'];return getAgent(_0x118d34)['then'](function(_0x39342b){logger[_0xe765('0x16')]('entityFound:',_0x39342b['name']);emit(util[_0xe765('0x36')]('user:%s',_0x39342b[_0xe765('0x1c')]),_0xe765('0x4d'));return _0x4a19d8[_0xe765('0x1d')](0xc8)[_0xe765('0x32')]({'error':![],'message':_0xe765('0x4e')});})[_0xe765('0x39')](handleError(_0x4a19d8));};exports[_0xe765('0x4f')]=function(_0x335aa5,_0x23ee0a){logger[_0xe765('0x16')](_0xe765('0x50'),_0x335aa5['body']);var _0x7f2a02=transferValidation[_0xe765('0xf')](_0x335aa5[_0xe765('0x31')]);if(_0x7f2a02[_0xe765('0x2c')]>0x0){return _0x23ee0a['status'](0x190)[_0xe765('0x32')](_0x7f2a02);}var _0xe1a631=_0x335aa5[_0xe765('0x31')]['userId'];var _0x20ad2a=_0x335aa5[_0xe765('0x31')][_0xe765('0x3c')];var _0x129468=_0x335aa5[_0xe765('0x31')][_0xe765('0x51')];return getAgent(_0xe1a631)[_0xe765('0x21')](function(_0x1dfa27){logger[_0xe765('0x16')](_0xe765('0x41'),_0x1dfa27[_0xe765('0x1c')]);emit(util[_0xe765('0x36')]('user:%s',_0x1dfa27[_0xe765('0x1c')]),_0xe765('0x52'),{'sessionId':_0x20ad2a,'transferNumber':_0x129468});return _0x23ee0a['status'](0xc8)[_0xe765('0x32')]({'error':![],'message':_0xe765('0x53')});})[_0xe765('0x39')](handleError(_0x23ee0a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 150eaee..0c971c0 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x3af2b9,_0x3f5b38){var _0x5455c0=function(_0x12dd1a){while(--_0x12dd1a){_0x3af2b9['push'](_0x3af2b9['shift']());}};_0x5455c0(++_0x3f5b38);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0x0b0e[_0x53b6ae];return _0x34f4b2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file +var _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x3086d7,_0x1ba077){var _0x1ed28b=function(_0x232e91){while(--_0x232e91){_0x3086d7['push'](_0x3086d7['shift']());}};_0x1ed28b(++_0x1ba077);}(_0x66fa,0x117));var _0xa66f=function(_0x45d316,_0xb56e56){_0x45d316=_0x45d316-0x0;var _0x3da718=_0x66fa[_0x45d316];return _0x3da718;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3634575..a3c5d67 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1997=['generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x1997,0xdc));var _0x7199=function(_0x4a1226,_0x2da540){_0x4a1226=_0x4a1226-0x0;var _0x2cfb93=_0x1997[_0x4a1226];return _0x2cfb93;};'use strict';var Sequelize=require(_0x7199('0x0'));var rs=require('randomstring');module[_0x7199('0x1')]={'name':{'type':Sequelize[_0x7199('0x2')],'unique':_0x7199('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7199('0x4')]();}},'phone':{'type':Sequelize[_0x7199('0x2')]},'type':{'type':Sequelize[_0x7199('0x5')]('twilio',_0x7199('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x7199('0x2')]},'authToken':{'type':Sequelize[_0x7199('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7199('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7199('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7199('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7199('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7199('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7199('0x9')],'comment':_0x7199('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x7199('0x8')],'defaultValue':![],'comment':_0x7199('0xb'),'set':function(_0x1c3015){if(!_0x1c3015){this[_0x7199('0xc')](_0x7199('0xd'),null);}this[_0x7199('0xc')]('mandatoryDisposition',_0x1c3015);}},'description':{'type':Sequelize[_0x7199('0x2')]}}; \ No newline at end of file +var _0x0630=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x45f29f,_0x5b90b2){var _0x437044=function(_0x20c3da){while(--_0x20c3da){_0x45f29f['push'](_0x45f29f['shift']());}};_0x437044(++_0x5b90b2);}(_0x0630,0xa5));var _0x0063=function(_0x4d2615,_0x103ca8){_0x4d2615=_0x4d2615-0x0;var _0x344154=_0x0630[_0x4d2615];return _0x344154;};'use strict';var Sequelize=require(_0x0063('0x0'));var rs=require(_0x0063('0x1'));module[_0x0063('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0063('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0063('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x0063('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x0063('0x4')],'defaultValue':function(){return rs[_0x0063('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0063('0x6')](_0x0063('0x7'),_0x0063('0x8'))},'accountSid':{'type':Sequelize[_0x0063('0x4')]},'baseUrl':{'type':Sequelize[_0x0063('0x4')]},'authToken':{'type':Sequelize[_0x0063('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0063('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0063('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0063('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0063('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0063('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0063('0xb')],'comment':_0x0063('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x0063('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x56b35c){if(!_0x56b35c){this[_0x0063('0xd')](_0x0063('0xe'),null);}this[_0x0063('0xd')](_0x0063('0xf'),_0x56b35c);}},'description':{'type':Sequelize[_0x0063('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 05c42a1..728f12a 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x581b=['WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','type','merge','options','includeAll','include','findAll','show','find','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','filter','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','hasOwnProperty','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','WhatsappApplication','bulkCreate','findAndCountAll','priority','send','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','DESC','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','\x0a','List','Messages','dataValues','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','sendStatus','name','index','Pause','mandatoryDispositionPause','map'];(function(_0x20ef83,_0xea60f9){var _0x18c673=function(_0x57653d){while(--_0x57653d){_0x20ef83['push'](_0x20ef83['shift']());}};_0x18c673(++_0xea60f9);}(_0x581b,0x142));var _0xb581=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x581b[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb581('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb581('0x1'));var rp=require(_0xb581('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb581('0x3'));var util=require('util');var path=require('path');var sox=require(_0xb581('0x4'));var csv=require(_0xb581('0x5'));var ejs=require(_0xb581('0x6'));var fs=require('fs');var fs_extra=require(_0xb581('0x7'));var _=require(_0xb581('0x8'));var squel=require(_0xb581('0x9'));var crypto=require(_0xb581('0xa'));var jsforce=require(_0xb581('0xb'));var deskjs=require(_0xb581('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb581('0xd'));var Papa=require(_0xb581('0xe'));var Redis=require(_0xb581('0xf'));var authService=require(_0xb581('0x10'));var qs=require(_0xb581('0x11'));var as=require(_0xb581('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb581('0x13'))('api');var utils=require(_0xb581('0x14'));var config=require(_0xb581('0x15'));var licenseUtil=require(_0xb581('0x16'));var db=require(_0xb581('0x17'))['db'];config[_0xb581('0x18')]=_[_0xb581('0x19')](config[_0xb581('0x18')],{'host':_0xb581('0x1a'),'port':0x18eb});var socket=require(_0xb581('0x1b'))(new Redis(config[_0xb581('0x18')]));require(_0xb581('0x1c'))[_0xb581('0x1d')](socket);var jayson=require(_0xb581('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2f1a48,_0x47ca53,_0x16d4d2,_0x4938fb){return new BPromise(function(_0x3d14cd,_0x5eb8e9){var _0x1a252f=_0x4938fb||client;return _0x1a252f[_0xb581('0x1f')](_0x2f1a48,_0x16d4d2)[_0xb581('0x20')](function(_0x4dca66){logger[_0xb581('0x21')](_0xb581('0x22'),_0x47ca53,_0xb581('0x23'));logger[_0xb581('0x24')](_0xb581('0x25'),_0x47ca53,'request\x20sent',JSON[_0xb581('0x26')](_0x4dca66));if(_0x4dca66[_0xb581('0x27')]){if(_0x4dca66['error'][_0xb581('0x28')]===0x1f4){logger[_0xb581('0x27')](_0xb581('0x22'),_0x47ca53,_0x4dca66[_0xb581('0x27')][_0xb581('0x29')]);return _0x5eb8e9(_0x4dca66[_0xb581('0x27')][_0xb581('0x29')]);}logger[_0xb581('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x47ca53,_0x4dca66[_0xb581('0x27')][_0xb581('0x29')]);return _0x3d14cd(_0x4dca66[_0xb581('0x27')]['message']);}else{logger[_0xb581('0x21')](_0xb581('0x22'),_0x47ca53,_0xb581('0x23'));_0x3d14cd(_0x4dca66[_0xb581('0x2a')][_0xb581('0x29')]);}})[_0xb581('0x2b')](function(_0x1ff51f){logger[_0xb581('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x47ca53,_0x1ff51f);_0x5eb8e9(_0x1ff51f);});});}function respondWithStatusCode(_0x496940,_0x19b89c){_0x19b89c=_0x19b89c||0xcc;return function(_0x6f803f){if(_0x6f803f){return _0x496940['sendStatus'](_0x19b89c);}return _0x496940[_0xb581('0x2c')](_0x19b89c)[_0xb581('0x2d')]();};}function respondWithResult(_0xc734e0,_0x268189){_0x268189=_0x268189||0xc8;return function(_0x3c62d8){if(_0x3c62d8){return _0xc734e0[_0xb581('0x2c')](_0x268189)[_0xb581('0x2e')](_0x3c62d8);}};}function respondWithFilteredResult(_0x198f41,_0x479c34){return function(_0x4aeb72){if(_0x4aeb72){var _0xe0199=typeof _0x479c34['offset']===_0xb581('0x2f')&&typeof _0x479c34[_0xb581('0x30')]===_0xb581('0x2f');var _0x23b200=_0x4aeb72[_0xb581('0x31')];var _0x1fc5c0=_0xe0199?0x0:_0x479c34['offset'];var _0x18f9b=_0xe0199?_0x4aeb72['count']:_0x479c34['offset']+_0x479c34['limit'];var _0xd8551a;if(_0x18f9b>=_0x23b200){_0x18f9b=_0x23b200;_0xd8551a=0xc8;}else{_0xd8551a=0xce;}_0x198f41[_0xb581('0x2c')](_0xd8551a);return _0x198f41[_0xb581('0x32')](_0xb581('0x33'),_0x1fc5c0+'-'+_0x18f9b+'/'+_0x23b200)[_0xb581('0x2e')](_0x4aeb72);}return null;};}function patchUpdates(_0x1542ff){return function(_0x101e03){try{jsonpatch['apply'](_0x101e03,_0x1542ff,!![]);}catch(_0xb7298e){return BPromise[_0xb581('0x34')](_0xb7298e);}return _0x101e03[_0xb581('0x35')]();};}function saveUpdates(_0x262e33,_0x5c33a8){return function(_0x4e5998){if(_0x4e5998){return _0x4e5998[_0xb581('0x36')](_0x262e33)[_0xb581('0x20')](function(_0x5e0f9d){return _0x5e0f9d;});}return null;};}function removeEntity(_0x25f041,_0x4e3c8b){return function(_0x13f5be){if(_0x13f5be){return _0x13f5be[_0xb581('0x37')]()[_0xb581('0x20')](function(){var _0x4d5878=_0x13f5be[_0xb581('0x38')]({'plain':!![]});var _0xb19d5b=_0xb581('0x39');return db['UserProfileResource'][_0xb581('0x37')]({'where':{'type':_0xb19d5b,'resourceId':_0x4d5878['id']}})[_0xb581('0x20')](function(){return _0x13f5be;});})[_0xb581('0x20')](function(){_0x25f041[_0xb581('0x2c')](0xcc)[_0xb581('0x2d')]();});}};}function handleEntityNotFound(_0x3cfad2,_0x38a3c7){return function(_0x29c35c){if(!_0x29c35c){_0x3cfad2[_0xb581('0x3a')](0x194);}return _0x29c35c;};}function handleError(_0x4fb152,_0x38a6d0){_0x38a6d0=_0x38a6d0||0x1f4;return function(_0x316099){logger[_0xb581('0x27')](_0x316099['stack']);if(_0x316099[_0xb581('0x3b')]){delete _0x316099[_0xb581('0x3b')];}_0x4fb152[_0xb581('0x2c')](_0x38a6d0)['send'](_0x316099);};}exports[_0xb581('0x3c')]=function(_0x23ac67,_0x18981d){var _0x384365={'include':[{'model':db[_0xb581('0x3d')],'as':_0xb581('0x3e')}]},_0x12bb06={},_0x1ffc60={'count':0x0,'rows':[]};var _0x2a101a=_[_0xb581('0x3f')](db[_0xb581('0x40')][_0xb581('0x41')],function(_0x5b7637){return{'name':_0x5b7637[_0xb581('0x42')],'type':_0x5b7637['type'][_0xb581('0x43')]};});_0x12bb06[_0xb581('0x44')]=_['map'](_0x2a101a,_0xb581('0x3b'));_0x12bb06[_0xb581('0x45')]=_[_0xb581('0x46')](_0x23ac67[_0xb581('0x45')]);_0x12bb06[_0xb581('0x47')]=_[_0xb581('0x48')](_0x12bb06['model'],_0x12bb06[_0xb581('0x45')]);_0x384365[_0xb581('0x49')]=_[_0xb581('0x48')](_0x12bb06[_0xb581('0x44')],qs[_0xb581('0x4a')](_0x23ac67[_0xb581('0x45')][_0xb581('0x4a')]));_0x384365[_0xb581('0x49')]=_0x384365[_0xb581('0x49')][_0xb581('0x4b')]?_0x384365[_0xb581('0x49')]:_0x12bb06[_0xb581('0x44')];if(!_0x23ac67[_0xb581('0x45')]['hasOwnProperty'](_0xb581('0x4c'))){_0x384365[_0xb581('0x30')]=qs['limit'](_0x23ac67[_0xb581('0x45')][_0xb581('0x30')]);_0x384365['offset']=qs[_0xb581('0x4d')](_0x23ac67[_0xb581('0x45')][_0xb581('0x4d')]);}_0x384365[_0xb581('0x4e')]=qs[_0xb581('0x4f')](_0x23ac67[_0xb581('0x45')]['sort']);_0x384365[_0xb581('0x50')]=qs[_0xb581('0x47')](_[_0xb581('0x51')](_0x23ac67['query'],_0x12bb06[_0xb581('0x47')]),_0x2a101a);if(_0x23ac67['query']['filter']){_0x384365[_0xb581('0x50')]=_['merge'](_0x384365[_0xb581('0x50')],{'$or':_[_0xb581('0x3f')](_0x2a101a,function(_0xdb08f2){if(_0xdb08f2[_0xb581('0x52')]!=='VIRTUAL'){var _0x3c2e78={};_0x3c2e78[_0xdb08f2[_0xb581('0x3b')]]={'$like':'%'+_0x23ac67[_0xb581('0x45')]['filter']+'%'};return _0x3c2e78;}})});}_0x384365=_[_0xb581('0x53')]({},_0x384365,_0x23ac67[_0xb581('0x54')]);var _0x19434c={'where':_0x384365[_0xb581('0x50')]};return db[_0xb581('0x40')][_0xb581('0x31')](_0x19434c)['then'](function(_0x2186c8){_0x1ffc60['count']=_0x2186c8;if(_0x23ac67[_0xb581('0x45')][_0xb581('0x55')]){_0x384365[_0xb581('0x56')]=[{'all':!![]}];}return db[_0xb581('0x40')][_0xb581('0x57')](_0x384365);})[_0xb581('0x20')](function(_0x2557ca){_0x1ffc60['rows']=_0x2557ca;return _0x1ffc60;})['then'](respondWithFilteredResult(_0x18981d,_0x384365))['catch'](handleError(_0x18981d,null));};exports[_0xb581('0x58')]=function(_0xd9df92,_0xdfd985){var _0x46e998={'raw':![],'where':{'id':_0xd9df92['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5bab3d={};_0x5bab3d[_0xb581('0x44')]=_[_0xb581('0x46')](db[_0xb581('0x40')][_0xb581('0x41')]);_0x5bab3d[_0xb581('0x45')]=_['keys'](_0xd9df92[_0xb581('0x45')]);_0x5bab3d[_0xb581('0x47')]=_[_0xb581('0x48')](_0x5bab3d[_0xb581('0x44')],_0x5bab3d['query']);_0x46e998[_0xb581('0x49')]=_[_0xb581('0x48')](_0x5bab3d[_0xb581('0x44')],qs[_0xb581('0x4a')](_0xd9df92[_0xb581('0x45')][_0xb581('0x4a')]));_0x46e998[_0xb581('0x49')]=_0x46e998[_0xb581('0x49')][_0xb581('0x4b')]?_0x46e998[_0xb581('0x49')]:_0x5bab3d[_0xb581('0x44')];if(_0xd9df92[_0xb581('0x45')][_0xb581('0x55')]){_0x46e998[_0xb581('0x56')]=[{'all':!![]}];}_0x46e998=_['merge']({},_0x46e998,_0xd9df92[_0xb581('0x54')]);return db[_0xb581('0x40')][_0xb581('0x59')](_0x46e998)[_0xb581('0x20')](handleEntityNotFound(_0xdfd985,null))[_0xb581('0x20')](respondWithResult(_0xdfd985,null))[_0xb581('0x2b')](handleError(_0xdfd985,null));};exports[_0xb581('0x5a')]=function(_0x222fbf,_0x405159){return db[_0xb581('0x40')]['create'](_0x222fbf[_0xb581('0x5b')],{})[_0xb581('0x20')](function(_0x34bf36){var _0x47b31b=_0x222fbf['user'][_0xb581('0x38')]({'plain':!![]});if(!_0x47b31b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b31b[_0xb581('0x5c')]===_0xb581('0x5d')){var _0x2cc997=_0x34bf36['get']({'plain':!![]});var _0xaabc34=_0xb581('0x39');return db[_0xb581('0x5e')][_0xb581('0x59')]({'where':{'name':_0xaabc34,'userProfileId':_0x47b31b['userProfileId']},'raw':!![]})[_0xb581('0x20')](function(_0x163c85){if(_0x163c85&&_0x163c85['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2cc997[_0xb581('0x3b')],'resourceId':_0x2cc997['id'],'type':_0x163c85[_0xb581('0x3b')],'sectionId':_0x163c85['id']},{})[_0xb581('0x20')](function(){return _0x34bf36;});}else{return _0x34bf36;}})[_0xb581('0x2b')](function(_0x390c03){logger[_0xb581('0x27')](_0xb581('0x5f'),_0x390c03);throw _0x390c03;});}return _0x34bf36;})[_0xb581('0x20')](respondWithResult(_0x405159,0xc9))[_0xb581('0x2b')](handleError(_0x405159,null));};exports[_0xb581('0x36')]=function(_0x4a7edd,_0x2dd1a6){if(_0x4a7edd['body']['id']){delete _0x4a7edd['body']['id'];}return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x4a7edd['params']['id']},'include':[{'model':db[_0xb581('0x3d')],'as':_0xb581('0x3e')}]})['then'](handleEntityNotFound(_0x2dd1a6,null))[_0xb581('0x20')](saveUpdates(_0x4a7edd['body'],null))[_0xb581('0x20')](respondWithResult(_0x2dd1a6,null))[_0xb581('0x2b')](handleError(_0x2dd1a6,null));};exports[_0xb581('0x37')]=function(_0x35e0d8,_0x11c8de){return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x35e0d8[_0xb581('0x60')]['id']}})['then'](handleEntityNotFound(_0x11c8de,null))['then'](removeEntity(_0x11c8de,null))[_0xb581('0x2b')](handleError(_0x11c8de,null));};exports['describe']=function(_0xb654a,_0x163fd1){return db[_0xb581('0x40')][_0xb581('0x61')]()[_0xb581('0x20')](respondWithResult(_0x163fd1,null))[_0xb581('0x2b')](handleError(_0x163fd1,null));};exports[_0xb581('0x62')]=function(_0xbfcdab,_0x45dcf2,_0x452e44){if(_0xbfcdab[_0xb581('0x5b')]['id']){delete _0xbfcdab[_0xb581('0x5b')]['id'];}return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0xbfcdab[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x45dcf2,null))['then'](function(_0x72ed88){if(_0x72ed88){_0xbfcdab[_0xb581('0x5b')][_0xb581('0x63')]=_0x72ed88['id'];return db[_0xb581('0x64')]['create'](_0xbfcdab[_0xb581('0x5b')]);}})[_0xb581('0x20')](respondWithResult(_0x45dcf2,null))[_0xb581('0x2b')](handleError(_0x45dcf2,null));};exports[_0xb581('0x65')]=function(_0x226b17,_0x9ea7bb,_0x31a833){var _0x47910b={'raw':![],'where':{}};var _0x30ba16={};var _0x30c1fa={'count':0x0,'rows':[]};return db[_0xb581('0x40')]['findOne']({'where':{'id':_0x226b17[_0xb581('0x60')]['id']}})['then'](handleEntityNotFound(_0x9ea7bb,null))['then'](function(_0x38cbb6){if(_0x38cbb6){_0x30ba16[_0xb581('0x44')]=_[_0xb581('0x46')](db[_0xb581('0x64')][_0xb581('0x41')]);_0x30ba16[_0xb581('0x45')]=_['keys'](_0x226b17[_0xb581('0x45')]);_0x30ba16[_0xb581('0x47')]=_[_0xb581('0x48')](_0x30ba16[_0xb581('0x44')],_0x30ba16[_0xb581('0x45')]);_0x47910b[_0xb581('0x49')]=_[_0xb581('0x48')](_0x30ba16[_0xb581('0x44')],qs[_0xb581('0x4a')](_0x226b17['query']['fields']));_0x47910b['attributes']=_0x47910b[_0xb581('0x49')][_0xb581('0x4b')]?_0x47910b[_0xb581('0x49')]:_0x30ba16[_0xb581('0x44')];if(!_0x226b17[_0xb581('0x45')]['hasOwnProperty'](_0xb581('0x4c'))){_0x47910b[_0xb581('0x30')]=qs[_0xb581('0x30')](_0x226b17[_0xb581('0x45')]['limit']);_0x47910b[_0xb581('0x4d')]=qs[_0xb581('0x4d')](_0x226b17[_0xb581('0x45')]['offset']);}_0x47910b['order']=qs[_0xb581('0x4f')](_0x226b17[_0xb581('0x45')][_0xb581('0x4f')]);_0x47910b[_0xb581('0x50')]=qs[_0xb581('0x47')](_[_0xb581('0x51')](_0x226b17[_0xb581('0x45')],_0x30ba16[_0xb581('0x47')]));_0x47910b[_0xb581('0x50')][_0xb581('0x63')]=_0x38cbb6['id'];if(_0x226b17[_0xb581('0x45')][_0xb581('0x66')]){_0x47910b[_0xb581('0x50')]=_[_0xb581('0x53')](_0x47910b[_0xb581('0x50')],{'$or':_[_0xb581('0x3f')](_0x47910b[_0xb581('0x49')],function(_0x35bb30){var _0x55d639={};_0x55d639[_0x35bb30]={'$like':'%'+_0x226b17[_0xb581('0x45')][_0xb581('0x66')]+'%'};return _0x55d639;})});}_0x47910b=_[_0xb581('0x53')]({},_0x47910b,_0x226b17[_0xb581('0x54')]);return db[_0xb581('0x64')][_0xb581('0x31')]({'where':_0x47910b['where']})['then'](function(_0x2da4f7){_0x30c1fa[_0xb581('0x31')]=_0x2da4f7;if(_0x226b17[_0xb581('0x45')]['includeAll']){_0x47910b[_0xb581('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xb581('0x57')](_0x47910b);})[_0xb581('0x20')](function(_0xe5399b){_0x30c1fa[_0xb581('0x67')]=_0xe5399b;return _0x30c1fa;});}})[_0xb581('0x20')](respondWithFilteredResult(_0x9ea7bb,_0x47910b))['catch'](handleError(_0x9ea7bb,null));};exports['removeDispositions']=function(_0x58215a,_0x5be6be,_0x6c66ba){return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x58215a[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x5be6be,null))['then'](function(_0x428b40){if(_0x428b40){return _0x428b40[_0xb581('0x68')](_0x58215a[_0xb581('0x45')][_0xb581('0x69')]);}})[_0xb581('0x20')](respondWithStatusCode(_0x5be6be,null))[_0xb581('0x2b')](handleError(_0x5be6be,null));};exports[_0xb581('0x6a')]=function(_0x475d49,_0x59ca30,_0x10b4ab){if(_0x475d49['body']['id']){delete _0x475d49[_0xb581('0x5b')]['id'];}return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x475d49[_0xb581('0x60')]['id']}})['then'](handleEntityNotFound(_0x59ca30,null))[_0xb581('0x20')](function(_0x37696e){if(_0x37696e){_0x475d49[_0xb581('0x5b')][_0xb581('0x63')]=_0x37696e['id'];return db[_0xb581('0x6b')]['create'](_0x475d49[_0xb581('0x5b')]);}})['then'](respondWithResult(_0x59ca30,null))[_0xb581('0x2b')](handleError(_0x59ca30,null));};exports[_0xb581('0x6c')]=function(_0x335391,_0x4f0562,_0x297396){var _0x3e06eb={'raw':![],'where':{}};var _0x417a7b={};var _0x3a89d6={'count':0x0,'rows':[]};return db[_0xb581('0x40')]['findOne']({'where':{'id':_0x335391[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x4f0562,null))[_0xb581('0x20')](function(_0x52f02c){if(_0x52f02c){_0x417a7b[_0xb581('0x44')]=_[_0xb581('0x46')](db[_0xb581('0x6b')][_0xb581('0x41')]);_0x417a7b[_0xb581('0x45')]=_[_0xb581('0x46')](_0x335391[_0xb581('0x45')]);_0x417a7b[_0xb581('0x47')]=_[_0xb581('0x48')](_0x417a7b[_0xb581('0x44')],_0x417a7b['query']);_0x3e06eb[_0xb581('0x49')]=_[_0xb581('0x48')](_0x417a7b['model'],qs[_0xb581('0x4a')](_0x335391[_0xb581('0x45')][_0xb581('0x4a')]));_0x3e06eb[_0xb581('0x49')]=_0x3e06eb[_0xb581('0x49')][_0xb581('0x4b')]?_0x3e06eb[_0xb581('0x49')]:_0x417a7b[_0xb581('0x44')];if(!_0x335391['query']['hasOwnProperty'](_0xb581('0x4c'))){_0x3e06eb['limit']=qs[_0xb581('0x30')](_0x335391[_0xb581('0x45')]['limit']);_0x3e06eb[_0xb581('0x4d')]=qs[_0xb581('0x4d')](_0x335391[_0xb581('0x45')][_0xb581('0x4d')]);}_0x3e06eb['order']=qs[_0xb581('0x4f')](_0x335391[_0xb581('0x45')][_0xb581('0x4f')]);_0x3e06eb[_0xb581('0x50')]=qs[_0xb581('0x47')](_[_0xb581('0x51')](_0x335391['query'],_0x417a7b[_0xb581('0x47')]));_0x3e06eb[_0xb581('0x50')]['WhatsappAccountId']=_0x52f02c['id'];if(_0x335391[_0xb581('0x45')][_0xb581('0x66')]){_0x3e06eb[_0xb581('0x50')]=_[_0xb581('0x53')](_0x3e06eb[_0xb581('0x50')],{'$or':_['map'](_0x3e06eb[_0xb581('0x49')],function(_0x26769a){var _0x3704a2={};_0x3704a2[_0x26769a]={'$like':'%'+_0x335391[_0xb581('0x45')][_0xb581('0x66')]+'%'};return _0x3704a2;})});}_0x3e06eb=_[_0xb581('0x53')]({},_0x3e06eb,_0x335391[_0xb581('0x54')]);return db[_0xb581('0x6b')][_0xb581('0x31')]({'where':_0x3e06eb[_0xb581('0x50')]})[_0xb581('0x20')](function(_0x117082){_0x3a89d6[_0xb581('0x31')]=_0x117082;if(_0x335391[_0xb581('0x45')]['includeAll']){_0x3e06eb[_0xb581('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb581('0x57')](_0x3e06eb);})[_0xb581('0x20')](function(_0x13a5bd){_0x3a89d6[_0xb581('0x67')]=_0x13a5bd;return _0x3a89d6;});}})[_0xb581('0x20')](respondWithFilteredResult(_0x4f0562,_0x3e06eb))[_0xb581('0x2b')](handleError(_0x4f0562,null));};exports['removeAnswers']=function(_0x17b1aa,_0x13e66b,_0x251416){return db[_0xb581('0x40')]['find']({'where':{'id':_0x17b1aa['params']['id']}})['then'](handleEntityNotFound(_0x13e66b,null))['then'](function(_0x47d10e){if(_0x47d10e){return _0x47d10e[_0xb581('0x6d')](_0x17b1aa[_0xb581('0x45')][_0xb581('0x69')]);}})[_0xb581('0x20')](respondWithStatusCode(_0x13e66b,null))['catch'](handleError(_0x13e66b,null));};exports[_0xb581('0x6e')]=function(_0x54ad18,_0x2d4079,_0x101155){return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x54ad18[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x2d4079,null))[_0xb581('0x20')](function(_0x273660){if(_0x273660){return _0x273660[_0xb581('0x6e')](_0x54ad18[_0xb581('0x5b')][_0xb581('0x69')],_[_0xb581('0x6f')](_0x54ad18[_0xb581('0x5b')],[_0xb581('0x69'),'id'])||{})[_0xb581('0x70')](function(_0x4dd327){for(var _0x5cfe5f=0x0;_0x5cfe5f<_0x54ad18[_0xb581('0x5b')][_0xb581('0x69')][_0xb581('0x4b')];_0x5cfe5f+=0x1){socket['emit'](_0xb581('0x71'),{'UserId':Number(_0x54ad18[_0xb581('0x5b')][_0xb581('0x69')][_0x5cfe5f]),'WhatsappAccountId':Number(_0x54ad18['params']['id'])});}return _0x4dd327;});}})[_0xb581('0x20')](respondWithResult(_0x2d4079,null))[_0xb581('0x2b')](handleError(_0x2d4079,null));};exports[_0xb581('0x72')]=function(_0x563c10,_0x454f4d,_0x16012f){return db['WhatsappAccount']['find']({'where':{'id':_0x563c10[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x454f4d,null))['then'](function(_0x4fc296){if(_0x4fc296){return _0x4fc296[_0xb581('0x72')](_0x563c10['query'][_0xb581('0x69')])[_0xb581('0x20')](function(){if(_[_0xb581('0x73')](_0x563c10[_0xb581('0x45')]['ids'])){for(var _0x48ea1f=0x0;_0x48ea1f<_0x563c10[_0xb581('0x45')][_0xb581('0x69')][_0xb581('0x4b')];_0x48ea1f+=0x1){socket[_0xb581('0x74')](_0xb581('0x75'),{'UserId':Number(_0x563c10['query'][_0xb581('0x69')][_0x48ea1f]),'WhatsappAccountId':Number(_0x563c10[_0xb581('0x60')]['id'])});}}else{socket[_0xb581('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x563c10['query']['ids']),'WhatsappAccountId':Number(_0x563c10[_0xb581('0x60')]['id'])});}});}})[_0xb581('0x20')](respondWithStatusCode(_0x454f4d,null))[_0xb581('0x2b')](handleError(_0x454f4d,null));};exports[_0xb581('0x76')]=function(_0x13071f,_0x10d3c2,_0x20f6ff){var _0x36a0f4={};var _0x67e21={};var _0x19d082;var _0x51e6f8;return db[_0xb581('0x40')]['findOne']({'where':{'id':_0x13071f[_0xb581('0x60')]['id']}})['then'](handleEntityNotFound(_0x10d3c2,null))[_0xb581('0x20')](function(_0x5eb3ac){if(_0x5eb3ac){_0x19d082=_0x5eb3ac;_0x67e21[_0xb581('0x44')]=_[_0xb581('0x46')](db[_0xb581('0x77')][_0xb581('0x41')]);_0x67e21[_0xb581('0x45')]=_[_0xb581('0x46')](_0x13071f[_0xb581('0x45')]);_0x67e21[_0xb581('0x47')]=_[_0xb581('0x48')](_0x67e21[_0xb581('0x44')],_0x67e21[_0xb581('0x45')]);_0x36a0f4[_0xb581('0x49')]=_['intersection'](_0x67e21[_0xb581('0x44')],qs[_0xb581('0x4a')](_0x13071f[_0xb581('0x45')][_0xb581('0x4a')]));_0x36a0f4[_0xb581('0x49')]=_0x36a0f4[_0xb581('0x49')][_0xb581('0x4b')]?_0x36a0f4[_0xb581('0x49')]:_0x67e21[_0xb581('0x44')];_0x36a0f4[_0xb581('0x4e')]=qs[_0xb581('0x4f')](_0x13071f[_0xb581('0x45')][_0xb581('0x4f')]);_0x36a0f4[_0xb581('0x50')]=qs['filters'](_['pick'](_0x13071f[_0xb581('0x45')],_0x67e21[_0xb581('0x47')]));if(_0x13071f[_0xb581('0x45')][_0xb581('0x66')]){_0x36a0f4[_0xb581('0x50')]=_['merge'](_0x36a0f4[_0xb581('0x50')],{'$or':_[_0xb581('0x3f')](_0x36a0f4[_0xb581('0x49')],function(_0x42c2ac){var _0x3b1564={};_0x3b1564[_0x42c2ac]={'$like':'%'+_0x13071f[_0xb581('0x45')][_0xb581('0x66')]+'%'};return _0x3b1564;})});}_0x36a0f4=_['merge']({},_0x36a0f4,_0x13071f[_0xb581('0x54')]);return _0x19d082[_0xb581('0x76')](_0x36a0f4);}})[_0xb581('0x20')](function(_0x3a0ec7){if(_0x3a0ec7){_0x51e6f8=_0x3a0ec7['length'];if(!_0x13071f[_0xb581('0x45')][_0xb581('0x78')]('nolimit')){_0x36a0f4[_0xb581('0x30')]=qs[_0xb581('0x30')](_0x13071f[_0xb581('0x45')]['limit']);_0x36a0f4[_0xb581('0x4d')]=qs[_0xb581('0x4d')](_0x13071f['query']['offset']);}return _0x19d082[_0xb581('0x76')](_0x36a0f4);}})[_0xb581('0x20')](function(_0x5215d7){if(_0x5215d7){return _0x5215d7?{'count':_0x51e6f8,'rows':_0x5215d7}:null;}})['then'](respondWithResult(_0x10d3c2,null))[_0xb581('0x2b')](handleError(_0x10d3c2,null));};exports['addApplications']=function(_0x3fbe0a,_0x2f2bfd){var _0x383c03=_0x3fbe0a['params']['id'];var _0x2d268d=_0x3fbe0a[_0xb581('0x5b')];var _0x25317b=0xc8;var _0x4d42d3=null;return db[_0xb581('0x79')][_0xb581('0x7a')]({'isolationLevel':db[_0xb581('0x79')]['Transaction'][_0xb581('0x7b')][_0xb581('0x7c')]},function(_0x14a99c){return db[_0xb581('0x40')][_0xb581('0x7d')]({'where':{'id':_0x383c03},'transaction':_0x14a99c})[_0xb581('0x20')](function(_0x4c8564){if(_0x4c8564){return db[_0xb581('0x7e')][_0xb581('0x37')]({'where':{'WhatsappAccountId':_0x383c03},'transaction':_0x14a99c})[_0xb581('0x20')](function(){var _0x4f0dcb=_[_0xb581('0x3f')](_0x2d268d,function(_0x9bae20){_0x9bae20[_0xb581('0x63')]=_0x383c03;return _0x9bae20;});return db[_0xb581('0x7e')][_0xb581('0x7f')](_0x4f0dcb,{'transaction':_0x14a99c});});}else{_0x25317b=0x194;_0x4d42d3=[];}});})[_0xb581('0x20')](function(){if(_0x25317b!==0x194){return db[_0xb581('0x7e')][_0xb581('0x80')]({'where':{'WhatsappAccountId':_0x383c03},'order':_0xb581('0x81')})[_0xb581('0x20')](function(_0x35978f){_0x4d42d3=_0x35978f;});}})[_0xb581('0x2b')](function(_0x47ac30){_0x25317b=0x1f4;logger[_0xb581('0x27')](_0x47ac30['stack']);if(_0x47ac30[_0xb581('0x3b')]){delete _0x47ac30['name'];}_0x4d42d3=_0x47ac30;})['finally'](function(){if(_0x4d42d3===null){_0x2f2bfd['sendStatus'](_0x25317b);}else{if(_0x25317b===0x1f4){_0x2f2bfd[_0xb581('0x2c')](_0x25317b)[_0xb581('0x82')](_0x4d42d3);}else{_0x2f2bfd[_0xb581('0x2c')](_0x25317b)[_0xb581('0x2e')](_0x4d42d3);}}});};exports['getApplications']=function(_0x4797b3,_0x498982,_0x4435bd){var _0x34ed31={};var _0x594eb3={};var _0x19a03e;var _0x36925a;return db[_0xb581('0x40')][_0xb581('0x7d')]({'where':{'id':_0x4797b3[_0xb581('0x60')]['id']}})[_0xb581('0x20')](handleEntityNotFound(_0x498982,null))[_0xb581('0x20')](function(_0x10892b){if(_0x10892b){_0x19a03e=_0x10892b;_0x594eb3[_0xb581('0x44')]=_[_0xb581('0x46')](db[_0xb581('0x7e')][_0xb581('0x41')]);_0x594eb3[_0xb581('0x45')]=_[_0xb581('0x46')](_0x4797b3[_0xb581('0x45')]);_0x594eb3[_0xb581('0x47')]=_[_0xb581('0x48')](_0x594eb3[_0xb581('0x44')],_0x594eb3[_0xb581('0x45')]);_0x34ed31[_0xb581('0x49')]=_['intersection'](_0x594eb3[_0xb581('0x44')],qs['fields'](_0x4797b3[_0xb581('0x45')][_0xb581('0x4a')]));_0x34ed31[_0xb581('0x49')]=_0x34ed31[_0xb581('0x49')][_0xb581('0x4b')]?_0x34ed31['attributes']:_0x594eb3['model'];_0x34ed31['order']=qs[_0xb581('0x4f')](_0x4797b3['query'][_0xb581('0x4f')]);_0x34ed31['where']=qs[_0xb581('0x47')](_['pick'](_0x4797b3['query'],_0x594eb3[_0xb581('0x47')]));if(_0x4797b3[_0xb581('0x45')][_0xb581('0x66')]){_0x34ed31['where']=_[_0xb581('0x53')](_0x34ed31[_0xb581('0x50')],{'$or':_[_0xb581('0x3f')](_0x34ed31[_0xb581('0x49')],function(_0x5e8d5a){var _0x31286e={};_0x31286e[_0x5e8d5a]={'$like':'%'+_0x4797b3[_0xb581('0x45')][_0xb581('0x66')]+'%'};return _0x31286e;})});}_0x34ed31=_[_0xb581('0x53')]({},_0x34ed31,_0x4797b3[_0xb581('0x54')]);return _0x19a03e['getApplications'](_0x34ed31);}})['then'](function(_0x1bb5f6){if(_0x1bb5f6){_0x36925a=_0x1bb5f6['length'];if(!_0x4797b3[_0xb581('0x45')]['hasOwnProperty'](_0xb581('0x4c'))){_0x34ed31['limit']=qs[_0xb581('0x30')](_0x4797b3[_0xb581('0x45')][_0xb581('0x30')]);_0x34ed31[_0xb581('0x4d')]=qs[_0xb581('0x4d')](_0x4797b3[_0xb581('0x45')][_0xb581('0x4d')]);}return _0x19a03e[_0xb581('0x83')](_0x34ed31);}})[_0xb581('0x20')](function(_0x3be41a){if(_0x3be41a){return _0x3be41a?{'count':_0x36925a,'rows':_0x3be41a}:null;}})[_0xb581('0x20')](respondWithResult(_0x498982,null))[_0xb581('0x2b')](handleError(_0x498982,null));};exports[_0xb581('0x84')]=function(_0x35a751,_0x2f08c3,_0x3ba764){var _0x2e263e={'channel':_0xb581('0x85')};var _0x43e083=[];var _0x5a93cf=[];var _0x1f44cf={};return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x35a751['params']['id']},'include':[{'model':db[_0xb581('0x7e')],'as':_0xb581('0x86')}]})['then'](handleEntityNotFound(_0x2f08c3,null))['then'](function(_0x5020c1){_0x2e263e['account']=_0x5020c1;if(_0x2e263e[_0xb581('0x87')]&&_0x2e263e[_0xb581('0x87')]['type']==='sinch'&&_0x35a751[_0xb581('0x5b')][_0xb581('0x88')]){if(_0x35a751['body'][_0xb581('0x88')][_0xb581('0x4b')]===0x0)return;if(_0x35a751[_0xb581('0x5b')][_0xb581('0x88')][0x0][_0xb581('0x89')]!==_0xb581('0x8a'))return;return db[_0xb581('0x8b')]['update']({'read':!![],'readAt':_0x35a751['body'][_0xb581('0x88')][0x0][_0xb581('0x8c')]},{'where':{'messageId':_0x35a751[_0xb581('0x5b')][_0xb581('0x88')][0x0][_0xb581('0x8d')]},'individualHooks':!![]})[_0xb581('0x20')](function(_0x6dd9fb){return _0x2f08c3[_0xb581('0x2c')](0xc8)['json'](_0x6dd9fb);});}_0x2e263e[_0xb581('0x8e')]=_[_0xb581('0x8f')](_0x5020c1[_0xb581('0x86')],['priority'],[_0xb581('0x90')]);if(_0x2e263e[_0xb581('0x87')][_0xb581('0x86')]){delete _0x2e263e['account']['Applications'];}return db['CmContact'][_0xb581('0x61')]()[_0xb581('0x20')](function(_0x48ae66){if(!_0x48ae66){throw new db[(_0xb581('0x91'))][(_0xb581('0x92'))](_0xb581('0x93'));}_0x43e083=_[_0xb581('0x94')](_[_0xb581('0x46')](_0x48ae66),[_0xb581('0x95'),'updatedAt']);_0x5a93cf=_[_0xb581('0x94')](_['keys'](_0x48ae66),[_0xb581('0x95'),_0xb581('0x96'),_0xb581('0x97'),_0xb581('0x98')]);_0x2e263e['body']={'mapKey':_0xb581('0x99')};if(_0x2e263e[_0xb581('0x87')]&&_0x2e263e[_0xb581('0x87')][_0xb581('0x52')]==='twilio'){_0x2e263e[_0xb581('0x5b')][_0xb581('0x9a')]=_0x35a751[_0xb581('0x5b')][_0xb581('0x9b')]['replace']('whatsapp:','');_0x2e263e['body'][_0xb581('0x5b')]=_0x35a751[_0xb581('0x5b')][_0xb581('0x9c')];_0x2e263e[_0xb581('0x5b')][_0xb581('0x9d')]=_0x35a751[_0xb581('0x5b')]['MessageSid'];}if(_0x2e263e[_0xb581('0x87')]&&_0x2e263e[_0xb581('0x87')]['type']==='sinch'){_0x2e263e[_0xb581('0x5b')][_0xb581('0x9a')]=_0x35a751['body'][_0xb581('0x9e')][0x0][_0xb581('0x9a')];_0x2e263e[_0xb581('0x5b')][_0xb581('0x5b')]=_0x35a751[_0xb581('0x5b')][_0xb581('0x9e')][0x0][_0xb581('0x29')][_0xb581('0x5b')];_0x2e263e[_0xb581('0x5b')]['messageId']=_0x35a751[_0xb581('0x5b')][_0xb581('0x9e')][0x0]['message_id'];}if(_0x2e263e[_0xb581('0x5b')]['id']){delete _0x2e263e[_0xb581('0x5b')]['id'];}if(_[_0xb581('0x9f')](_0x2e263e[_0xb581('0x5b')]['from'])){throw new db['Sequelize']['ValidationError'](_0xb581('0xa0'));}if(_[_0xb581('0x9f')](_0x2e263e[_0xb581('0x5b')]['body'])||_0x2e263e[_0xb581('0x5b')][_0xb581('0x5b')]===''){throw new db[(_0xb581('0x91'))][(_0xb581('0x92'))](_0xb581('0xa1'));}if(_['isNil'](_0x2e263e[_0xb581('0x5b')][_0xb581('0xa2')])){throw new db[(_0xb581('0x91'))][(_0xb581('0x92'))](_0xb581('0xa3')+_0x5a93cf);}if(!_[_0xb581('0xa4')](_0x5a93cf,_0x2e263e['body'][_0xb581('0xa2')])){throw new db['Sequelize'][(_0xb581('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a93cf);}_0x1f44cf[_0x2e263e[_0xb581('0x5b')][_0xb581('0xa2')]]=_0x2e263e[_0xb581('0x5b')]['from'];return db[_0xb581('0xa5')][_0xb581('0x59')]({'where':{'id':_0x2e263e[_0xb581('0x87')][_0xb581('0x98')]},'include':[{'model':db[_0xb581('0xa6')],'as':'Contacts','where':_0x1f44cf,'limit':0x1,'order':[['updatedAt',_0xb581('0xa7')]]}]});})[_0xb581('0x20')](handleEntityNotFound(_0x2f08c3,null))[_0xb581('0x20')](function(_0x56d072){if(_0x56d072){_0x2e263e['list']=_[_0xb581('0x6f')](_0x56d072,['Contacts']);if(_0x56d072[_0xb581('0xa8')][_0xb581('0x4b')]){return _0x56d072[_0xb581('0xa8')][0x0];}var _0x576ff8=_[_0xb581('0x19')](_0x2e263e[_0xb581('0x5b')],{'firstName':_0x2e263e[_0xb581('0x5b')]['from'],'ListId':_0x56d072['id']});_0x576ff8[_0x2e263e[_0xb581('0x5b')]['mapKey']]=_0x2e263e['body']['from'];return db[_0xb581('0xa6')]['create'](_0x576ff8,{'fields':_0x43e083,'raw':!![]});}})[_0xb581('0x20')](handleEntityNotFound(_0x2f08c3,null))['then'](function(_0x2ed347){if(_0x2ed347){_0x2e263e[_0xb581('0xa9')]=_0x2ed347;var _0x13a774={'ContactId':_0x2ed347['id'],'phone':_0x2e263e[_0xb581('0x5b')]['from'],'WhatsappAccountId':_0x35a751['params']['id']};var _0xa3e753={'ContactId':_0x2ed347['id'],'WhatsappAccountId':_0x35a751['params']['id'],'closed':![]};return db[_0xb581('0xaa')][_0xb581('0x59')]({'where':_0xa3e753})[_0xb581('0x20')](function(_0x2a1192){if(_0x2a1192){return[_0x2a1192,![]];}return db[_0xb581('0xaa')]['create'](_0x13a774)[_0xb581('0x20')](function(_0x5a49e3){return[_0x5a49e3,!![]];});});}})['spread'](function(_0xf39bd4,_0x4ce849){_0x2e263e[_0xb581('0xab')]=_0xf39bd4['get']({'plain':!![]});_0x2e263e[_0xb581('0xab')][_0xb581('0xac')]=![];if(_0x4ce849){if(_0x2e263e[_0xb581('0x87')][_0xb581('0xad')]){_0x2e263e[_0xb581('0x8e')][_0xb581('0xae')]({'id':0x0,'priority':_0x2e263e['applications'][_0xb581('0x4b')]+0x1,'app':_0xb581('0xaf'),'appdata':_0xb581('0xb0'),'interval':_0xb581('0xb1')});}_0x2e263e['interaction']['created']=!![];}return db[_0xb581('0x8b')][_0xb581('0x5a')]({'phone':_0x2e263e[_0xb581('0x5b')][_0xb581('0x9a')],'messageId':_0x2e263e['body']['messageId'],'body':_0x2e263e[_0xb581('0x5b')][_0xb581('0x5b')],'WhatsappAccountId':_0x35a751[_0xb581('0x60')]['id'],'WhatsappInteractionId':_0xf39bd4['id'],'direction':'in','ContactId':_0xf39bd4[_0xb581('0xb2')],'AttachmentId':_0x2e263e['body'][_0xb581('0xb3')]});})[_0xb581('0x20')](function(_0x373242){_0x2e263e['message']=_0x373242;if(_0x2e263e[_0xb581('0xab')][_0xb581('0xb4')]){return db['User'][_0xb581('0x59')]({'attributes':['id','name'],'where':{'id':_0x2e263e[_0xb581('0xab')][_0xb581('0xb4')]}})[_0xb581('0x20')](function(_0x8e1a15){if(_0x8e1a15){_0x2e263e[_0xb581('0x8e')][_0xb581('0xb5')]({'id':0x0,'priority':0x0,'app':_0xb581('0xb6'),'appdata':_0x8e1a15[_0xb581('0x3b')]+','+(_0x2e263e[_0xb581('0x87')][_0xb581('0xb7')]||0xa),'interval':_0xb581('0xb1')});}return respondWithRpcPromise(_0xb581('0xb8'),_0xb581('0xb9'),_0x2e263e);});}return respondWithRpcPromise(_0xb581('0xb8'),_0xb581('0xb9'),_0x2e263e);})[_0xb581('0x20')](function(_0x295e11){if(_0x295e11){var _0x225e68=0xc8;var _0x2ab6c9='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2ab6c9,_0x225e68,_0xb581('0xba'));logger[_0xb581('0x24')](_0xb581('0xbb'),_0x2ab6c9,_0x225e68,_0xb581('0xba'),JSON[_0xb581('0x26')](_0x295e11));if(_0x2e263e[_0xb581('0x87')][_0xb581('0x52')]===_0xb581('0xbc')){return _0x2f08c3['status'](_0x225e68)['set']('Content-Type','text/xml')[_0xb581('0x82')](_0xb581('0xbd'));}else{return _0x2f08c3['status'](_0x225e68)[_0xb581('0x2e')](_0x295e11);}}});})['catch'](handleError(_0x2f08c3,null));};exports[_0xb581('0x82')]=function(_0x1e99c7,_0x5a266d,_0x3b02a3){var _0x24b46f,_0xf69ed,_0x1f7294;if(_[_0xb581('0x9f')](_0x1e99c7[_0xb581('0x5b')][_0xb581('0x5b')])||_0x1e99c7[_0xb581('0x5b')][_0xb581('0x5b')]===''){throw new db[(_0xb581('0x91'))][(_0xb581('0x92'))](_0xb581('0xa1'));}if(_['isNil'](_0x1e99c7[_0xb581('0x5b')]['to'])){throw new db[(_0xb581('0x91'))][(_0xb581('0x92'))]('to\x20is\x20mandatory');}_0x24b46f=_0x1e99c7['body']['to'];return db[_0xb581('0x40')][_0xb581('0x59')]({'where':{'id':_0x1e99c7[_0xb581('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xb581('0xa8'),'where':{'mobile':_0x24b46f},'limit':0x1,'order':[[_0xb581('0x96'),_0xb581('0xa7')]]}]}]})[_0xb581('0x20')](handleEntityNotFound(_0x5a266d,null))[_0xb581('0x20')](function(_0x251c0a){if(_0x251c0a&&_0x251c0a[_0xb581('0xbe')]){_0xf69ed=_0x251c0a[_0xb581('0x38')]({'plain':!![]});if(_0xf69ed[_0xb581('0xbe')]&&_0xf69ed[_0xb581('0xbe')][_0xb581('0xa8')][_0xb581('0x4b')]){return _0xf69ed[_0xb581('0xbe')][_0xb581('0xa8')][0x0];}return db[_0xb581('0xa6')][_0xb581('0x5a')](_[_0xb581('0x19')](_0x1e99c7[_0xb581('0x5b')],{'firstName':_0x24b46f,'mobile':_0x24b46f,'phone':_0x24b46f,'ListId':_0xf69ed[_0xb581('0x98')]}));}})[_0xb581('0x20')](handleEntityNotFound(_0x5a266d,null))[_0xb581('0x20')](function(_0x5871b9){if(_0x5871b9){_0x1f7294=_0x5871b9;return db[_0xb581('0xaa')][_0xb581('0x59')]({'where':{'ContactId':_0x1f7294['id'],'closed':![],'WhatsappAccountId':_0xf69ed['id']}})[_0xb581('0x20')](function(_0x496334){if(_0x496334){return[_0x496334,![]];}return db[_0xb581('0xaa')][_0xb581('0x5a')]({'UserId':_0x1e99c7['user']['id'],'ContactId':_0x1f7294['id'],'WhatsappAccountId':_0xf69ed['id'],'phone':_0x24b46f,'firstMsgDirection':'out','Messages':[_[_0xb581('0x53')](_0x1e99c7[_0xb581('0x5b')],{'read':![],'body':_0x1e99c7[_0xb581('0x5b')][_0xb581('0x5b')],'phone':_0x24b46f,'WhatsappAccountId':_0xf69ed['id'],'UserId':_0x1e99c7[_0xb581('0x5d')]['id'],'ContactId':_0x1f7294['id']})]},{'include':[{'model':db[_0xb581('0x8b')],'as':_0xb581('0xbf')}]})[_0xb581('0x20')](function(_0x527112){return[_0x527112,!![]];});});}})[_0xb581('0x70')](function(_0x51a298,_0x3e0d79){if(_0x3e0d79){return _0x51a298;}return db[_0xb581('0x8b')][_0xb581('0x5a')](_[_0xb581('0x53')](_0x1e99c7[_0xb581('0x5b')],{'read':![],'body':_0x1e99c7[_0xb581('0x5b')][_0xb581('0x5b')],'phone':_0x24b46f,'WhatsappAccountId':_0xf69ed['id'],'WhatsappInteractionId':_0x51a298['id'],'UserId':_0x1e99c7['user']['id'],'ContactId':_0x1f7294['id']}))[_0xb581('0x20')](function(_0x5653e7){_0x51a298[_0xb581('0xc0')]['Messages']=[];_0x51a298[_0xb581('0xc0')][_0xb581('0xbf')]['push'](_0x5653e7['dataValues']);return _0x51a298;});})[_0xb581('0x20')](respondWithResult(_0x5a266d,null))[_0xb581('0x2b')](handleError(_0x5a266d,null));}; \ No newline at end of file +var _0x4ef9=['where','pick','merge','VIRTUAL','findAll','rows','catch','show','params','Pause','mandatoryDispositionPause','fields','includeAll','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','filter','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','transaction','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','from','notifications','message_id','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','CmContact','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','WhatsappMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappAccounts','sendStatus','stack','name','send','index','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x3d90b4,_0x1e2fc6){var _0x4c65d3=function(_0x311abc){while(--_0x311abc){_0x3d90b4['push'](_0x3d90b4['shift']());}};_0x4c65d3(++_0x1e2fc6);}(_0x4ef9,0x77));var _0x94ef=function(_0x48efc4,_0x4035c0){_0x48efc4=_0x48efc4-0x0;var _0x151c20=_0x4ef9[_0x48efc4];return _0x151c20;};'use strict';var emlformat=require(_0x94ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94ef('0x1'));var jsonpatch=require(_0x94ef('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x94ef('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94ef('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ef('0x5'));var squel=require(_0x94ef('0x6'));var crypto=require('crypto');var jsforce=require(_0x94ef('0x7'));var deskjs=require(_0x94ef('0x8'));var toCsv=require(_0x94ef('0x9'));var querystring=require(_0x94ef('0xa'));var Papa=require('papaparse');var Redis=require(_0x94ef('0xb'));var authService=require(_0x94ef('0xc'));var qs=require(_0x94ef('0xd'));var as=require(_0x94ef('0xe'));var hardwareService=require(_0x94ef('0xf'));var logger=require('../../config/logger')(_0x94ef('0x10'));var utils=require(_0x94ef('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x94ef('0x12'));var db=require(_0x94ef('0x13'))['db'];config[_0x94ef('0x14')]=_[_0x94ef('0x15')](config[_0x94ef('0x14')],{'host':_0x94ef('0x16'),'port':0x18eb});var socket=require(_0x94ef('0x17'))(new Redis(config['redis']));require(_0x94ef('0x18'))['register'](socket);var jayson=require(_0x94ef('0x19'));var client=jayson[_0x94ef('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3545ce,_0x59ab46,_0x321451,_0x164a84){return new BPromise(function(_0x58e777,_0x29dca1){var _0x1cd7dc=_0x164a84||client;return _0x1cd7dc[_0x94ef('0x1b')](_0x3545ce,_0x321451)['then'](function(_0x48b765){logger[_0x94ef('0x1c')](_0x94ef('0x1d'),_0x59ab46,_0x94ef('0x1e'));logger[_0x94ef('0x1f')](_0x94ef('0x20'),_0x59ab46,'request\x20sent',JSON[_0x94ef('0x21')](_0x48b765));if(_0x48b765[_0x94ef('0x22')]){if(_0x48b765[_0x94ef('0x22')][_0x94ef('0x23')]===0x1f4){logger['error'](_0x94ef('0x1d'),_0x59ab46,_0x48b765['error'][_0x94ef('0x24')]);return _0x29dca1(_0x48b765['error']['message']);}logger[_0x94ef('0x22')](_0x94ef('0x1d'),_0x59ab46,_0x48b765[_0x94ef('0x22')][_0x94ef('0x24')]);return _0x58e777(_0x48b765[_0x94ef('0x22')][_0x94ef('0x24')]);}else{logger[_0x94ef('0x1c')](_0x94ef('0x1d'),_0x59ab46,_0x94ef('0x1e'));_0x58e777(_0x48b765['result']['message']);}})['catch'](function(_0x4f2462){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x59ab46,_0x4f2462);_0x29dca1(_0x4f2462);});});}function respondWithStatusCode(_0x2b3ea0,_0x3c1da7){_0x3c1da7=_0x3c1da7||0xcc;return function(_0x1f6c3d){if(_0x1f6c3d){return _0x2b3ea0['sendStatus'](_0x3c1da7);}return _0x2b3ea0[_0x94ef('0x25')](_0x3c1da7)[_0x94ef('0x26')]();};}function respondWithResult(_0x4677df,_0x16431f){_0x16431f=_0x16431f||0xc8;return function(_0x4bd3f4){if(_0x4bd3f4){return _0x4677df['status'](_0x16431f)[_0x94ef('0x27')](_0x4bd3f4);}};}function respondWithFilteredResult(_0x3891ba,_0x13855a){return function(_0x5ed438){if(_0x5ed438){var _0x3de213=typeof _0x13855a[_0x94ef('0x28')]===_0x94ef('0x29')&&typeof _0x13855a['limit']==='undefined';var _0x47b18c=_0x5ed438[_0x94ef('0x2a')];var _0x396350=_0x3de213?0x0:_0x13855a[_0x94ef('0x28')];var _0x2428e9=_0x3de213?_0x5ed438['count']:_0x13855a[_0x94ef('0x28')]+_0x13855a['limit'];var _0x4e12a8;if(_0x2428e9>=_0x47b18c){_0x2428e9=_0x47b18c;_0x4e12a8=0xc8;}else{_0x4e12a8=0xce;}_0x3891ba[_0x94ef('0x25')](_0x4e12a8);return _0x3891ba[_0x94ef('0x2b')](_0x94ef('0x2c'),_0x396350+'-'+_0x2428e9+'/'+_0x47b18c)[_0x94ef('0x27')](_0x5ed438);}return null;};}function patchUpdates(_0x253fdb){return function(_0x1b65de){try{jsonpatch[_0x94ef('0x2d')](_0x1b65de,_0x253fdb,!![]);}catch(_0x529e84){return BPromise[_0x94ef('0x2e')](_0x529e84);}return _0x1b65de[_0x94ef('0x2f')]();};}function saveUpdates(_0x3b5fc1,_0x2fcdf3){return function(_0x4774be){if(_0x4774be){return _0x4774be[_0x94ef('0x30')](_0x3b5fc1)[_0x94ef('0x31')](function(_0x331a81){return _0x331a81;});}return null;};}function removeEntity(_0x17564b,_0x12ec8a){return function(_0x57ca75){if(_0x57ca75){return _0x57ca75[_0x94ef('0x32')]()[_0x94ef('0x31')](function(){var _0x24fe30=_0x57ca75[_0x94ef('0x33')]({'plain':!![]});var _0x38ce9a=_0x94ef('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x38ce9a,'resourceId':_0x24fe30['id']}})[_0x94ef('0x31')](function(){return _0x57ca75;});})[_0x94ef('0x31')](function(){_0x17564b[_0x94ef('0x25')](0xcc)[_0x94ef('0x26')]();});}};}function handleEntityNotFound(_0x342e1c,_0xdf0fa3){return function(_0x2f5256){if(!_0x2f5256){_0x342e1c[_0x94ef('0x35')](0x194);}return _0x2f5256;};}function handleError(_0xa2861a,_0x150558){_0x150558=_0x150558||0x1f4;return function(_0x2acf75){logger[_0x94ef('0x22')](_0x2acf75[_0x94ef('0x36')]);if(_0x2acf75[_0x94ef('0x37')]){delete _0x2acf75[_0x94ef('0x37')];}_0xa2861a[_0x94ef('0x25')](_0x150558)[_0x94ef('0x38')](_0x2acf75);};}exports[_0x94ef('0x39')]=function(_0xcbd6b3,_0x2bbb7d){var _0x435d2f={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2a1164={},_0xf8f52d={'count':0x0,'rows':[]};var _0x549680=_[_0x94ef('0x3a')](db[_0x94ef('0x3b')][_0x94ef('0x3c')],function(_0x41f845){return{'name':_0x41f845[_0x94ef('0x3d')],'type':_0x41f845[_0x94ef('0x3e')][_0x94ef('0x3f')]};});_0x2a1164[_0x94ef('0x40')]=_[_0x94ef('0x3a')](_0x549680,_0x94ef('0x37'));_0x2a1164[_0x94ef('0x41')]=_[_0x94ef('0x42')](_0xcbd6b3[_0x94ef('0x41')]);_0x2a1164[_0x94ef('0x43')]=_[_0x94ef('0x44')](_0x2a1164[_0x94ef('0x40')],_0x2a1164['query']);_0x435d2f[_0x94ef('0x45')]=_[_0x94ef('0x44')](_0x2a1164[_0x94ef('0x40')],qs['fields'](_0xcbd6b3[_0x94ef('0x41')]['fields']));_0x435d2f[_0x94ef('0x45')]=_0x435d2f[_0x94ef('0x45')][_0x94ef('0x46')]?_0x435d2f[_0x94ef('0x45')]:_0x2a1164[_0x94ef('0x40')];if(!_0xcbd6b3[_0x94ef('0x41')][_0x94ef('0x47')](_0x94ef('0x48'))){_0x435d2f[_0x94ef('0x49')]=qs[_0x94ef('0x49')](_0xcbd6b3['query'][_0x94ef('0x49')]);_0x435d2f[_0x94ef('0x28')]=qs[_0x94ef('0x28')](_0xcbd6b3[_0x94ef('0x41')][_0x94ef('0x28')]);}_0x435d2f[_0x94ef('0x4a')]=qs['sort'](_0xcbd6b3[_0x94ef('0x41')][_0x94ef('0x4b')]);_0x435d2f[_0x94ef('0x4c')]=qs['filters'](_[_0x94ef('0x4d')](_0xcbd6b3['query'],_0x2a1164['filters']),_0x549680);if(_0xcbd6b3[_0x94ef('0x41')]['filter']){_0x435d2f['where']=_[_0x94ef('0x4e')](_0x435d2f[_0x94ef('0x4c')],{'$or':_['map'](_0x549680,function(_0x196553){if(_0x196553['type']!==_0x94ef('0x4f')){var _0xe6f287={};_0xe6f287[_0x196553[_0x94ef('0x37')]]={'$like':'%'+_0xcbd6b3[_0x94ef('0x41')]['filter']+'%'};return _0xe6f287;}})});}_0x435d2f=_['merge']({},_0x435d2f,_0xcbd6b3['options']);var _0x385f20={'where':_0x435d2f['where']};return db[_0x94ef('0x3b')]['count'](_0x385f20)[_0x94ef('0x31')](function(_0x2017a3){_0xf8f52d['count']=_0x2017a3;if(_0xcbd6b3['query']['includeAll']){_0x435d2f['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x94ef('0x50')](_0x435d2f);})[_0x94ef('0x31')](function(_0x1b435b){_0xf8f52d[_0x94ef('0x51')]=_0x1b435b;return _0xf8f52d;})[_0x94ef('0x31')](respondWithFilteredResult(_0x2bbb7d,_0x435d2f))[_0x94ef('0x52')](handleError(_0x2bbb7d,null));};exports[_0x94ef('0x53')]=function(_0x105cef,_0x2441bb){var _0x57e2c2={'raw':![],'where':{'id':_0x105cef[_0x94ef('0x54')]['id']},'include':[{'model':db[_0x94ef('0x55')],'as':_0x94ef('0x56')}]},_0xe95186={};_0xe95186[_0x94ef('0x40')]=_[_0x94ef('0x42')](db[_0x94ef('0x3b')][_0x94ef('0x3c')]);_0xe95186['query']=_[_0x94ef('0x42')](_0x105cef[_0x94ef('0x41')]);_0xe95186[_0x94ef('0x43')]=_['intersection'](_0xe95186[_0x94ef('0x40')],_0xe95186[_0x94ef('0x41')]);_0x57e2c2[_0x94ef('0x45')]=_['intersection'](_0xe95186[_0x94ef('0x40')],qs['fields'](_0x105cef[_0x94ef('0x41')][_0x94ef('0x57')]));_0x57e2c2[_0x94ef('0x45')]=_0x57e2c2[_0x94ef('0x45')][_0x94ef('0x46')]?_0x57e2c2[_0x94ef('0x45')]:_0xe95186[_0x94ef('0x40')];if(_0x105cef[_0x94ef('0x41')][_0x94ef('0x58')]){_0x57e2c2[_0x94ef('0x59')]=[{'all':!![]}];}_0x57e2c2=_['merge']({},_0x57e2c2,_0x105cef[_0x94ef('0x5a')]);return db[_0x94ef('0x3b')]['find'](_0x57e2c2)[_0x94ef('0x31')](handleEntityNotFound(_0x2441bb,null))['then'](respondWithResult(_0x2441bb,null))[_0x94ef('0x52')](handleError(_0x2441bb,null));};exports['create']=function(_0x583224,_0x51ec63){return db['WhatsappAccount'][_0x94ef('0x5b')](_0x583224[_0x94ef('0x5c')],{})[_0x94ef('0x31')](function(_0x3515db){var _0x1f986d=_0x583224[_0x94ef('0x5d')][_0x94ef('0x33')]({'plain':!![]});if(!_0x1f986d)throw new Error(_0x94ef('0x5e'));if(_0x1f986d[_0x94ef('0x5f')]===_0x94ef('0x5d')){var _0x34adce=_0x3515db['get']({'plain':!![]});var _0x53561f=_0x94ef('0x34');return db[_0x94ef('0x60')][_0x94ef('0x61')]({'where':{'name':_0x53561f,'userProfileId':_0x1f986d['userProfileId']},'raw':!![]})['then'](function(_0x8aeb03){if(_0x8aeb03&&_0x8aeb03[_0x94ef('0x62')]===0x0){return db[_0x94ef('0x63')][_0x94ef('0x5b')]({'name':_0x34adce[_0x94ef('0x37')],'resourceId':_0x34adce['id'],'type':_0x8aeb03[_0x94ef('0x37')],'sectionId':_0x8aeb03['id']},{})['then'](function(){return _0x3515db;});}else{return _0x3515db;}})[_0x94ef('0x52')](function(_0x215d51){logger[_0x94ef('0x22')](_0x94ef('0x64'),_0x215d51);throw _0x215d51;});}return _0x3515db;})[_0x94ef('0x31')](respondWithResult(_0x51ec63,0xc9))[_0x94ef('0x52')](handleError(_0x51ec63,null));};exports[_0x94ef('0x30')]=function(_0xf5114b,_0xe98f71){if(_0xf5114b[_0x94ef('0x5c')]['id']){delete _0xf5114b['body']['id'];}return db[_0x94ef('0x3b')]['find']({'where':{'id':_0xf5114b[_0x94ef('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x94ef('0x56')}]})[_0x94ef('0x31')](handleEntityNotFound(_0xe98f71,null))[_0x94ef('0x31')](saveUpdates(_0xf5114b[_0x94ef('0x5c')],null))[_0x94ef('0x31')](respondWithResult(_0xe98f71,null))['catch'](handleError(_0xe98f71,null));};exports['destroy']=function(_0x2c0023,_0x2badb9){return db[_0x94ef('0x3b')]['find']({'where':{'id':_0x2c0023['params']['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x2badb9,null))[_0x94ef('0x31')](removeEntity(_0x2badb9,null))[_0x94ef('0x52')](handleError(_0x2badb9,null));};exports[_0x94ef('0x65')]=function(_0x250d81,_0x191873){return db[_0x94ef('0x3b')][_0x94ef('0x65')]()[_0x94ef('0x31')](respondWithResult(_0x191873,null))[_0x94ef('0x52')](handleError(_0x191873,null));};exports[_0x94ef('0x66')]=function(_0x5dff4d,_0x4ca966,_0x21b4f4){if(_0x5dff4d['body']['id']){delete _0x5dff4d[_0x94ef('0x5c')]['id'];}return db[_0x94ef('0x3b')]['find']({'where':{'id':_0x5dff4d[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x4ca966,null))[_0x94ef('0x31')](function(_0x52da6d){if(_0x52da6d){_0x5dff4d['body']['WhatsappAccountId']=_0x52da6d['id'];return db[_0x94ef('0x67')][_0x94ef('0x5b')](_0x5dff4d[_0x94ef('0x5c')]);}})[_0x94ef('0x31')](respondWithResult(_0x4ca966,null))['catch'](handleError(_0x4ca966,null));};exports[_0x94ef('0x68')]=function(_0x1001f1,_0x2589d2,_0x51bf6e){var _0x36f986={'raw':![],'where':{}};var _0x213149={};var _0x44afde={'count':0x0,'rows':[]};return db[_0x94ef('0x3b')][_0x94ef('0x69')]({'where':{'id':_0x1001f1[_0x94ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x2589d2,null))['then'](function(_0x1b7041){if(_0x1b7041){_0x213149[_0x94ef('0x40')]=_[_0x94ef('0x42')](db[_0x94ef('0x67')][_0x94ef('0x3c')]);_0x213149[_0x94ef('0x41')]=_[_0x94ef('0x42')](_0x1001f1[_0x94ef('0x41')]);_0x213149[_0x94ef('0x43')]=_[_0x94ef('0x44')](_0x213149['model'],_0x213149[_0x94ef('0x41')]);_0x36f986[_0x94ef('0x45')]=_[_0x94ef('0x44')](_0x213149[_0x94ef('0x40')],qs[_0x94ef('0x57')](_0x1001f1[_0x94ef('0x41')]['fields']));_0x36f986[_0x94ef('0x45')]=_0x36f986[_0x94ef('0x45')]['length']?_0x36f986[_0x94ef('0x45')]:_0x213149['model'];if(!_0x1001f1[_0x94ef('0x41')][_0x94ef('0x47')](_0x94ef('0x48'))){_0x36f986[_0x94ef('0x49')]=qs[_0x94ef('0x49')](_0x1001f1[_0x94ef('0x41')][_0x94ef('0x49')]);_0x36f986[_0x94ef('0x28')]=qs[_0x94ef('0x28')](_0x1001f1[_0x94ef('0x41')]['offset']);}_0x36f986[_0x94ef('0x4a')]=qs[_0x94ef('0x4b')](_0x1001f1[_0x94ef('0x41')]['sort']);_0x36f986[_0x94ef('0x4c')]=qs['filters'](_[_0x94ef('0x4d')](_0x1001f1[_0x94ef('0x41')],_0x213149[_0x94ef('0x43')]));_0x36f986[_0x94ef('0x4c')][_0x94ef('0x6a')]=_0x1b7041['id'];if(_0x1001f1[_0x94ef('0x41')][_0x94ef('0x6b')]){_0x36f986[_0x94ef('0x4c')]=_[_0x94ef('0x4e')](_0x36f986[_0x94ef('0x4c')],{'$or':_[_0x94ef('0x3a')](_0x36f986[_0x94ef('0x45')],function(_0x3141ee){var _0x23553b={};_0x23553b[_0x3141ee]={'$like':'%'+_0x1001f1[_0x94ef('0x41')][_0x94ef('0x6b')]+'%'};return _0x23553b;})});}_0x36f986=_[_0x94ef('0x4e')]({},_0x36f986,_0x1001f1[_0x94ef('0x5a')]);return db[_0x94ef('0x67')][_0x94ef('0x2a')]({'where':_0x36f986[_0x94ef('0x4c')]})['then'](function(_0x5bca05){_0x44afde[_0x94ef('0x2a')]=_0x5bca05;if(_0x1001f1['query']['includeAll']){_0x36f986[_0x94ef('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x36f986);})[_0x94ef('0x31')](function(_0x475866){_0x44afde[_0x94ef('0x51')]=_0x475866;return _0x44afde;});}})[_0x94ef('0x31')](respondWithFilteredResult(_0x2589d2,_0x36f986))[_0x94ef('0x52')](handleError(_0x2589d2,null));};exports['removeDispositions']=function(_0x3cde1d,_0x28d5cd,_0x153c46){return db[_0x94ef('0x3b')][_0x94ef('0x61')]({'where':{'id':_0x3cde1d[_0x94ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x28d5cd,null))['then'](function(_0x1eed35){if(_0x1eed35){return _0x1eed35[_0x94ef('0x6c')](_0x3cde1d[_0x94ef('0x41')][_0x94ef('0x6d')]);}})[_0x94ef('0x31')](respondWithStatusCode(_0x28d5cd,null))[_0x94ef('0x52')](handleError(_0x28d5cd,null));};exports['addAnswer']=function(_0x12f121,_0x10a442,_0x4a163c){if(_0x12f121[_0x94ef('0x5c')]['id']){delete _0x12f121[_0x94ef('0x5c')]['id'];}return db[_0x94ef('0x3b')][_0x94ef('0x61')]({'where':{'id':_0x12f121[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x10a442,null))[_0x94ef('0x31')](function(_0x46ceb7){if(_0x46ceb7){_0x12f121['body']['WhatsappAccountId']=_0x46ceb7['id'];return db[_0x94ef('0x6e')][_0x94ef('0x5b')](_0x12f121['body']);}})['then'](respondWithResult(_0x10a442,null))[_0x94ef('0x52')](handleError(_0x10a442,null));};exports[_0x94ef('0x6f')]=function(_0x4b9ea5,_0x5631da,_0x170813){var _0x25d80b={'raw':![],'where':{}};var _0x2f2110={};var _0x21ebcb={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x94ef('0x69')]({'where':{'id':_0x4b9ea5[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x5631da,null))['then'](function(_0x4ae415){if(_0x4ae415){_0x2f2110[_0x94ef('0x40')]=_[_0x94ef('0x42')](db[_0x94ef('0x6e')][_0x94ef('0x3c')]);_0x2f2110[_0x94ef('0x41')]=_[_0x94ef('0x42')](_0x4b9ea5[_0x94ef('0x41')]);_0x2f2110[_0x94ef('0x43')]=_[_0x94ef('0x44')](_0x2f2110[_0x94ef('0x40')],_0x2f2110[_0x94ef('0x41')]);_0x25d80b[_0x94ef('0x45')]=_[_0x94ef('0x44')](_0x2f2110[_0x94ef('0x40')],qs[_0x94ef('0x57')](_0x4b9ea5['query'][_0x94ef('0x57')]));_0x25d80b[_0x94ef('0x45')]=_0x25d80b[_0x94ef('0x45')][_0x94ef('0x46')]?_0x25d80b[_0x94ef('0x45')]:_0x2f2110[_0x94ef('0x40')];if(!_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x47')](_0x94ef('0x48'))){_0x25d80b[_0x94ef('0x49')]=qs[_0x94ef('0x49')](_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x49')]);_0x25d80b[_0x94ef('0x28')]=qs[_0x94ef('0x28')](_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x28')]);}_0x25d80b[_0x94ef('0x4a')]=qs[_0x94ef('0x4b')](_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x4b')]);_0x25d80b[_0x94ef('0x4c')]=qs['filters'](_[_0x94ef('0x4d')](_0x4b9ea5[_0x94ef('0x41')],_0x2f2110['filters']));_0x25d80b[_0x94ef('0x4c')][_0x94ef('0x6a')]=_0x4ae415['id'];if(_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x6b')]){_0x25d80b[_0x94ef('0x4c')]=_[_0x94ef('0x4e')](_0x25d80b['where'],{'$or':_[_0x94ef('0x3a')](_0x25d80b[_0x94ef('0x45')],function(_0x349d99){var _0x257081={};_0x257081[_0x349d99]={'$like':'%'+_0x4b9ea5[_0x94ef('0x41')][_0x94ef('0x6b')]+'%'};return _0x257081;})});}_0x25d80b=_['merge']({},_0x25d80b,_0x4b9ea5['options']);return db[_0x94ef('0x6e')][_0x94ef('0x2a')]({'where':_0x25d80b[_0x94ef('0x4c')]})['then'](function(_0x50c1c7){_0x21ebcb[_0x94ef('0x2a')]=_0x50c1c7;if(_0x4b9ea5['query'][_0x94ef('0x58')]){_0x25d80b['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x94ef('0x50')](_0x25d80b);})['then'](function(_0x288024){_0x21ebcb[_0x94ef('0x51')]=_0x288024;return _0x21ebcb;});}})[_0x94ef('0x31')](respondWithFilteredResult(_0x5631da,_0x25d80b))[_0x94ef('0x52')](handleError(_0x5631da,null));};exports['removeAnswers']=function(_0x2efc46,_0x1afbab,_0x590339){return db['WhatsappAccount'][_0x94ef('0x61')]({'where':{'id':_0x2efc46[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x1afbab,null))[_0x94ef('0x31')](function(_0x126ddf){if(_0x126ddf){return _0x126ddf[_0x94ef('0x70')](_0x2efc46[_0x94ef('0x41')][_0x94ef('0x6d')]);}})[_0x94ef('0x31')](respondWithStatusCode(_0x1afbab,null))['catch'](handleError(_0x1afbab,null));};exports[_0x94ef('0x71')]=function(_0x40b756,_0x1926e4,_0x57ce0c){return db['WhatsappAccount'][_0x94ef('0x61')]({'where':{'id':_0x40b756[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x1926e4,null))[_0x94ef('0x31')](function(_0x4a4293){if(_0x4a4293){return _0x4a4293[_0x94ef('0x71')](_0x40b756[_0x94ef('0x5c')][_0x94ef('0x6d')],_[_0x94ef('0x72')](_0x40b756['body'],['ids','id'])||{})[_0x94ef('0x73')](function(_0x2e972e){for(var _0x156cd8=0x0;_0x156cd8<_0x40b756[_0x94ef('0x5c')][_0x94ef('0x6d')][_0x94ef('0x46')];_0x156cd8+=0x1){socket['emit'](_0x94ef('0x74'),{'UserId':Number(_0x40b756[_0x94ef('0x5c')][_0x94ef('0x6d')][_0x156cd8]),'WhatsappAccountId':Number(_0x40b756[_0x94ef('0x54')]['id'])});}return _0x2e972e;});}})[_0x94ef('0x31')](respondWithResult(_0x1926e4,null))[_0x94ef('0x52')](handleError(_0x1926e4,null));};exports[_0x94ef('0x75')]=function(_0x2b4706,_0x27443c,_0x501a5f){return db['WhatsappAccount']['find']({'where':{'id':_0x2b4706[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0x27443c,null))[_0x94ef('0x31')](function(_0x303a86){if(_0x303a86){return _0x303a86[_0x94ef('0x75')](_0x2b4706['query'][_0x94ef('0x6d')])[_0x94ef('0x31')](function(){if(_[_0x94ef('0x76')](_0x2b4706[_0x94ef('0x41')]['ids'])){for(var _0x569b1b=0x0;_0x569b1b<_0x2b4706['query'][_0x94ef('0x6d')]['length'];_0x569b1b+=0x1){socket['emit'](_0x94ef('0x77'),{'UserId':Number(_0x2b4706[_0x94ef('0x41')][_0x94ef('0x6d')][_0x569b1b]),'WhatsappAccountId':Number(_0x2b4706[_0x94ef('0x54')]['id'])});}}else{socket['emit'](_0x94ef('0x77'),{'UserId':Number(_0x2b4706[_0x94ef('0x41')][_0x94ef('0x6d')]),'WhatsappAccountId':Number(_0x2b4706[_0x94ef('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x27443c,null))[_0x94ef('0x52')](handleError(_0x27443c,null));};exports[_0x94ef('0x78')]=function(_0x1a517c,_0xb30afc,_0x3374f8){var _0x2ca60a={};var _0xbd0314={};var _0x2435b8;var _0x1ed409;return db[_0x94ef('0x3b')][_0x94ef('0x69')]({'where':{'id':_0x1a517c[_0x94ef('0x54')]['id']}})[_0x94ef('0x31')](handleEntityNotFound(_0xb30afc,null))[_0x94ef('0x31')](function(_0x4d0f92){if(_0x4d0f92){_0x2435b8=_0x4d0f92;_0xbd0314[_0x94ef('0x40')]=_[_0x94ef('0x42')](db[_0x94ef('0x79')][_0x94ef('0x3c')]);_0xbd0314[_0x94ef('0x41')]=_[_0x94ef('0x42')](_0x1a517c[_0x94ef('0x41')]);_0xbd0314['filters']=_['intersection'](_0xbd0314[_0x94ef('0x40')],_0xbd0314['query']);_0x2ca60a[_0x94ef('0x45')]=_[_0x94ef('0x44')](_0xbd0314[_0x94ef('0x40')],qs[_0x94ef('0x57')](_0x1a517c[_0x94ef('0x41')][_0x94ef('0x57')]));_0x2ca60a[_0x94ef('0x45')]=_0x2ca60a[_0x94ef('0x45')][_0x94ef('0x46')]?_0x2ca60a[_0x94ef('0x45')]:_0xbd0314[_0x94ef('0x40')];_0x2ca60a[_0x94ef('0x4a')]=qs[_0x94ef('0x4b')](_0x1a517c[_0x94ef('0x41')][_0x94ef('0x4b')]);_0x2ca60a[_0x94ef('0x4c')]=qs['filters'](_[_0x94ef('0x4d')](_0x1a517c['query'],_0xbd0314[_0x94ef('0x43')]));if(_0x1a517c[_0x94ef('0x41')][_0x94ef('0x6b')]){_0x2ca60a[_0x94ef('0x4c')]=_[_0x94ef('0x4e')](_0x2ca60a[_0x94ef('0x4c')],{'$or':_[_0x94ef('0x3a')](_0x2ca60a[_0x94ef('0x45')],function(_0x41ca43){var _0x3246e9={};_0x3246e9[_0x41ca43]={'$like':'%'+_0x1a517c['query'][_0x94ef('0x6b')]+'%'};return _0x3246e9;})});}_0x2ca60a=_['merge']({},_0x2ca60a,_0x1a517c[_0x94ef('0x5a')]);return _0x2435b8[_0x94ef('0x78')](_0x2ca60a);}})[_0x94ef('0x31')](function(_0x25ed10){if(_0x25ed10){_0x1ed409=_0x25ed10[_0x94ef('0x46')];if(!_0x1a517c[_0x94ef('0x41')]['hasOwnProperty'](_0x94ef('0x48'))){_0x2ca60a[_0x94ef('0x49')]=qs[_0x94ef('0x49')](_0x1a517c[_0x94ef('0x41')][_0x94ef('0x49')]);_0x2ca60a[_0x94ef('0x28')]=qs[_0x94ef('0x28')](_0x1a517c['query'][_0x94ef('0x28')]);}return _0x2435b8[_0x94ef('0x78')](_0x2ca60a);}})[_0x94ef('0x31')](function(_0x59407e){if(_0x59407e){return _0x59407e?{'count':_0x1ed409,'rows':_0x59407e}:null;}})[_0x94ef('0x31')](respondWithResult(_0xb30afc,null))[_0x94ef('0x52')](handleError(_0xb30afc,null));};exports['addApplications']=function(_0xf64dd9,_0x39ef55){var _0x36b9c4=_0xf64dd9[_0x94ef('0x54')]['id'];var _0x246714=_0xf64dd9[_0x94ef('0x5c')];var _0x3d2f49=0xc8;var _0x110068=null;return db['sequelize'][_0x94ef('0x7a')]({'isolationLevel':db[_0x94ef('0x7b')][_0x94ef('0x7c')][_0x94ef('0x7d')]['READ_COMMITTED']},function(_0x3cde91){return db[_0x94ef('0x3b')][_0x94ef('0x69')]({'where':{'id':_0x36b9c4},'transaction':_0x3cde91})['then'](function(_0x38b8d4){if(_0x38b8d4){return db[_0x94ef('0x7e')][_0x94ef('0x32')]({'where':{'WhatsappAccountId':_0x36b9c4},'transaction':_0x3cde91})[_0x94ef('0x31')](function(){var _0x5f4c94=_[_0x94ef('0x3a')](_0x246714,function(_0x492428){_0x492428['WhatsappAccountId']=_0x36b9c4;return _0x492428;});return db['WhatsappApplication'][_0x94ef('0x7f')](_0x5f4c94,{'transaction':_0x3cde91});});}else{_0x3d2f49=0x194;_0x110068=[];}});})[_0x94ef('0x31')](function(){if(_0x3d2f49!==0x194){return db[_0x94ef('0x7e')][_0x94ef('0x80')]({'where':{'WhatsappAccountId':_0x36b9c4},'order':_0x94ef('0x81')})[_0x94ef('0x31')](function(_0x1cbe3f){_0x110068=_0x1cbe3f;});}})[_0x94ef('0x52')](function(_0x5f3cb3){_0x3d2f49=0x1f4;logger[_0x94ef('0x22')](_0x5f3cb3[_0x94ef('0x36')]);if(_0x5f3cb3[_0x94ef('0x37')]){delete _0x5f3cb3['name'];}_0x110068=_0x5f3cb3;})[_0x94ef('0x82')](function(){if(_0x110068===null){_0x39ef55[_0x94ef('0x35')](_0x3d2f49);}else{if(_0x3d2f49===0x1f4){_0x39ef55[_0x94ef('0x25')](_0x3d2f49)[_0x94ef('0x38')](_0x110068);}else{_0x39ef55[_0x94ef('0x25')](_0x3d2f49)['json'](_0x110068);}}});};exports['getApplications']=function(_0x12ebf0,_0x498287,_0x2f9556){var _0x4afcdf={};var _0x42652c={};var _0x5c0ffc;var _0x309435;return db[_0x94ef('0x3b')][_0x94ef('0x69')]({'where':{'id':_0x12ebf0[_0x94ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x498287,null))[_0x94ef('0x31')](function(_0x55a07e){if(_0x55a07e){_0x5c0ffc=_0x55a07e;_0x42652c[_0x94ef('0x40')]=_[_0x94ef('0x42')](db[_0x94ef('0x7e')][_0x94ef('0x3c')]);_0x42652c['query']=_['keys'](_0x12ebf0[_0x94ef('0x41')]);_0x42652c[_0x94ef('0x43')]=_[_0x94ef('0x44')](_0x42652c[_0x94ef('0x40')],_0x42652c[_0x94ef('0x41')]);_0x4afcdf[_0x94ef('0x45')]=_['intersection'](_0x42652c[_0x94ef('0x40')],qs['fields'](_0x12ebf0[_0x94ef('0x41')]['fields']));_0x4afcdf[_0x94ef('0x45')]=_0x4afcdf[_0x94ef('0x45')][_0x94ef('0x46')]?_0x4afcdf['attributes']:_0x42652c['model'];_0x4afcdf['order']=qs[_0x94ef('0x4b')](_0x12ebf0['query'][_0x94ef('0x4b')]);_0x4afcdf[_0x94ef('0x4c')]=qs['filters'](_[_0x94ef('0x4d')](_0x12ebf0[_0x94ef('0x41')],_0x42652c[_0x94ef('0x43')]));if(_0x12ebf0[_0x94ef('0x41')][_0x94ef('0x6b')]){_0x4afcdf[_0x94ef('0x4c')]=_[_0x94ef('0x4e')](_0x4afcdf[_0x94ef('0x4c')],{'$or':_['map'](_0x4afcdf[_0x94ef('0x45')],function(_0x481237){var _0x939fb={};_0x939fb[_0x481237]={'$like':'%'+_0x12ebf0['query'][_0x94ef('0x6b')]+'%'};return _0x939fb;})});}_0x4afcdf=_[_0x94ef('0x4e')]({},_0x4afcdf,_0x12ebf0[_0x94ef('0x5a')]);return _0x5c0ffc['getApplications'](_0x4afcdf);}})[_0x94ef('0x31')](function(_0x4be211){if(_0x4be211){_0x309435=_0x4be211[_0x94ef('0x46')];if(!_0x12ebf0[_0x94ef('0x41')][_0x94ef('0x47')](_0x94ef('0x48'))){_0x4afcdf[_0x94ef('0x49')]=qs['limit'](_0x12ebf0[_0x94ef('0x41')][_0x94ef('0x49')]);_0x4afcdf['offset']=qs[_0x94ef('0x28')](_0x12ebf0[_0x94ef('0x41')][_0x94ef('0x28')]);}return _0x5c0ffc[_0x94ef('0x83')](_0x4afcdf);}})['then'](function(_0x8b8e7d){if(_0x8b8e7d){return _0x8b8e7d?{'count':_0x309435,'rows':_0x8b8e7d}:null;}})[_0x94ef('0x31')](respondWithResult(_0x498287,null))['catch'](handleError(_0x498287,null));};exports[_0x94ef('0x84')]=function(_0x31ae2f,_0x3ac2a6,_0x1044ce){var _0x111a9={'channel':_0x94ef('0x85')};var _0x176a1e=[];var _0x4eae65=[];var _0x4e0bcf={};return db['WhatsappAccount'][_0x94ef('0x61')]({'where':{'id':_0x31ae2f[_0x94ef('0x54')]['id']},'include':[{'model':db[_0x94ef('0x7e')],'as':_0x94ef('0x86')}]})['then'](handleEntityNotFound(_0x3ac2a6,null))['then'](function(_0x1933e3){_0x111a9[_0x94ef('0x87')]=_0x1933e3;if(_0x111a9[_0x94ef('0x87')]&&_0x111a9[_0x94ef('0x87')][_0x94ef('0x3e')]==='sinch'&&_0x31ae2f[_0x94ef('0x5c')]['statuses']){if(_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x88')][_0x94ef('0x46')]===0x0)return;if(_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x88')][0x0][_0x94ef('0x89')]!=='read')return;return db['WhatsappMessage'][_0x94ef('0x30')]({'read':!![],'readAt':_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x88')][0x0]['timestamp']},{'where':{'messageId':_0x31ae2f['body'][_0x94ef('0x88')][0x0]['message_id']},'individualHooks':!![]})[_0x94ef('0x31')](function(_0x867dc2){return _0x3ac2a6[_0x94ef('0x25')](0xc8)['json'](_0x867dc2);});}_0x111a9[_0x94ef('0x8a')]=_['orderBy'](_0x1933e3[_0x94ef('0x86')],[_0x94ef('0x81')],[_0x94ef('0x8b')]);if(_0x111a9[_0x94ef('0x87')][_0x94ef('0x86')]){delete _0x111a9['account'][_0x94ef('0x86')];}return db['CmContact'][_0x94ef('0x65')]()['then'](function(_0x12005f){if(!_0x12005f){throw new db[(_0x94ef('0x8c'))][(_0x94ef('0x8d'))](_0x94ef('0x8e'));}_0x176a1e=_[_0x94ef('0x8f')](_[_0x94ef('0x42')](_0x12005f),[_0x94ef('0x90'),_0x94ef('0x91')]);_0x4eae65=_['difference'](_[_0x94ef('0x42')](_0x12005f),[_0x94ef('0x90'),_0x94ef('0x91'),_0x94ef('0x92'),_0x94ef('0x93')]);_0x111a9[_0x94ef('0x5c')]={'mapKey':'mobile'};if(_0x111a9['account']&&_0x111a9['account'][_0x94ef('0x3e')]==='twilio'){_0x111a9[_0x94ef('0x5c')]['from']=_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x94')][_0x94ef('0x95')](_0x94ef('0x96'),'');_0x111a9[_0x94ef('0x5c')][_0x94ef('0x5c')]=_0x31ae2f['body'][_0x94ef('0x97')];_0x111a9[_0x94ef('0x5c')][_0x94ef('0x98')]=_0x31ae2f['body'][_0x94ef('0x99')];}if(_0x111a9[_0x94ef('0x87')]&&_0x111a9['account'][_0x94ef('0x3e')]===_0x94ef('0x9a')){_0x111a9[_0x94ef('0x5c')][_0x94ef('0x9b')]=_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x9c')][0x0][_0x94ef('0x9b')];_0x111a9[_0x94ef('0x5c')][_0x94ef('0x5c')]=_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x9c')][0x0][_0x94ef('0x24')][_0x94ef('0x5c')];_0x111a9[_0x94ef('0x5c')]['messageId']=_0x31ae2f[_0x94ef('0x5c')][_0x94ef('0x9c')][0x0][_0x94ef('0x9d')];}if(_0x111a9['body']['id']){delete _0x111a9[_0x94ef('0x5c')]['id'];}if(_['isNil'](_0x111a9[_0x94ef('0x5c')][_0x94ef('0x9b')])){throw new db[(_0x94ef('0x8c'))]['ValidationError'](_0x94ef('0x9e'));}if(_[_0x94ef('0x9f')](_0x111a9['body'][_0x94ef('0x5c')])||_0x111a9[_0x94ef('0x5c')][_0x94ef('0x5c')]===''){throw new db[(_0x94ef('0x8c'))][(_0x94ef('0x8d'))](_0x94ef('0xa0'));}if(_[_0x94ef('0x9f')](_0x111a9[_0x94ef('0x5c')]['mapKey'])){throw new db[(_0x94ef('0x8c'))][(_0x94ef('0x8d'))](_0x94ef('0xa1')+_0x4eae65);}if(!_[_0x94ef('0xa2')](_0x4eae65,_0x111a9['body'][_0x94ef('0xa3')])){throw new db[(_0x94ef('0x8c'))][(_0x94ef('0x8d'))](_0x94ef('0xa4')+_0x4eae65);}_0x4e0bcf[_0x111a9['body'][_0x94ef('0xa3')]]=_0x111a9[_0x94ef('0x5c')][_0x94ef('0x9b')];return db['CmList'][_0x94ef('0x61')]({'where':{'id':_0x111a9[_0x94ef('0x87')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x94ef('0xa5'),'where':_0x4e0bcf,'limit':0x1,'order':[[_0x94ef('0x91'),_0x94ef('0xa6')]]}]});})[_0x94ef('0x31')](handleEntityNotFound(_0x3ac2a6,null))[_0x94ef('0x31')](function(_0x3cf8fc){if(_0x3cf8fc){_0x111a9[_0x94ef('0xa7')]=_[_0x94ef('0x72')](_0x3cf8fc,[_0x94ef('0xa5')]);if(_0x3cf8fc[_0x94ef('0xa5')][_0x94ef('0x46')]){return _0x3cf8fc[_0x94ef('0xa5')][0x0];}var _0x17adcd=_['defaults'](_0x111a9['body'],{'firstName':_0x111a9[_0x94ef('0x5c')][_0x94ef('0x9b')],'ListId':_0x3cf8fc['id']});_0x17adcd[_0x111a9[_0x94ef('0x5c')]['mapKey']]=_0x111a9[_0x94ef('0x5c')]['from'];return db[_0x94ef('0xa8')][_0x94ef('0x5b')](_0x17adcd,{'fields':_0x176a1e,'raw':!![]});}})[_0x94ef('0x31')](handleEntityNotFound(_0x3ac2a6,null))[_0x94ef('0x31')](function(_0x5ba46f){if(_0x5ba46f){_0x111a9[_0x94ef('0xa9')]=_0x5ba46f;var _0x5d41f7={'ContactId':_0x5ba46f['id'],'phone':_0x111a9[_0x94ef('0x5c')][_0x94ef('0x9b')],'WhatsappAccountId':_0x31ae2f[_0x94ef('0x54')]['id']};var _0x1749e3={'ContactId':_0x5ba46f['id'],'WhatsappAccountId':_0x31ae2f['params']['id'],'closed':![]};return db[_0x94ef('0xaa')]['find']({'where':_0x1749e3})[_0x94ef('0x31')](function(_0x2d7d9d){if(_0x2d7d9d){return[_0x2d7d9d,![]];}return db[_0x94ef('0xaa')][_0x94ef('0x5b')](_0x5d41f7)['then'](function(_0x2cb1b7){return[_0x2cb1b7,!![]];});});}})[_0x94ef('0x73')](function(_0x5ca7cb,_0x459f20){_0x111a9[_0x94ef('0xab')]=_0x5ca7cb['get']({'plain':!![]});_0x111a9['interaction'][_0x94ef('0xac')]=![];if(_0x459f20){if(_0x111a9['account']['autoclose']){_0x111a9[_0x94ef('0x8a')][_0x94ef('0xad')]({'id':0x0,'priority':_0x111a9[_0x94ef('0x8a')]['length']+0x1,'app':_0x94ef('0xae'),'appdata':_0x94ef('0xaf'),'interval':_0x94ef('0xb0')});}_0x111a9[_0x94ef('0xab')][_0x94ef('0xac')]=!![];}return db['WhatsappMessage'][_0x94ef('0x5b')]({'phone':_0x111a9[_0x94ef('0x5c')]['from'],'messageId':_0x111a9['body']['messageId'],'body':_0x111a9[_0x94ef('0x5c')][_0x94ef('0x5c')],'WhatsappAccountId':_0x31ae2f[_0x94ef('0x54')]['id'],'WhatsappInteractionId':_0x5ca7cb['id'],'direction':'in','ContactId':_0x5ca7cb[_0x94ef('0xb1')],'AttachmentId':_0x111a9['body'][_0x94ef('0xb2')]});})[_0x94ef('0x31')](function(_0x550d80){_0x111a9[_0x94ef('0x24')]=_0x550d80;if(_0x111a9[_0x94ef('0xab')][_0x94ef('0xb3')]){return db[_0x94ef('0x79')][_0x94ef('0x61')]({'attributes':['id',_0x94ef('0x37')],'where':{'id':_0x111a9[_0x94ef('0xab')]['UserId']}})['then'](function(_0x1665a0){if(_0x1665a0){_0x111a9[_0x94ef('0x8a')][_0x94ef('0xb4')]({'id':0x0,'priority':0x0,'app':_0x94ef('0xb5'),'appdata':_0x1665a0[_0x94ef('0x37')]+','+(_0x111a9['account']['waitForTheAssignedAgent']||0xa),'interval':_0x94ef('0xb0')});}return respondWithRpcPromise(_0x94ef('0xb6'),'startRouting',_0x111a9);});}return respondWithRpcPromise('Start','startRouting',_0x111a9);})[_0x94ef('0x31')](function(_0x1743ef){if(_0x1743ef){var _0x2602bf=0xc8;var _0x5352c3='receiveMessage';logger['info'](_0x94ef('0x20'),_0x5352c3,_0x2602bf,_0x94ef('0xb7'));logger[_0x94ef('0x1f')](_0x94ef('0xb8'),_0x5352c3,_0x2602bf,_0x94ef('0xb7'),JSON[_0x94ef('0x21')](_0x1743ef));if(_0x111a9[_0x94ef('0x87')]['type']===_0x94ef('0xb9')){return _0x3ac2a6['status'](_0x2602bf)['set']('Content-Type',_0x94ef('0xba'))[_0x94ef('0x38')](_0x94ef('0xbb'));}else{return _0x3ac2a6[_0x94ef('0x25')](_0x2602bf)['json'](_0x1743ef);}}});})[_0x94ef('0x52')](handleError(_0x3ac2a6,null));};exports[_0x94ef('0x38')]=function(_0x2b372a,_0x2d50d3,_0x50581a){var _0x1d7056,_0x476669,_0x497322;if(_[_0x94ef('0x9f')](_0x2b372a['body'][_0x94ef('0x5c')])||_0x2b372a[_0x94ef('0x5c')]['body']===''){throw new db[(_0x94ef('0x8c'))]['ValidationError'](_0x94ef('0xa0'));}if(_[_0x94ef('0x9f')](_0x2b372a[_0x94ef('0x5c')]['to'])){throw new db[(_0x94ef('0x8c'))][(_0x94ef('0x8d'))](_0x94ef('0xbc'));}_0x1d7056=_0x2b372a[_0x94ef('0x5c')]['to'];return db[_0x94ef('0x3b')]['find']({'where':{'id':_0x2b372a['params']['id']},'include':[{'model':db[_0x94ef('0xbd')],'as':_0x94ef('0xbe'),'include':[{'model':db[_0x94ef('0xa8')],'as':_0x94ef('0xa5'),'where':{'mobile':_0x1d7056},'limit':0x1,'order':[['updatedAt',_0x94ef('0xa6')]]}]}]})[_0x94ef('0x31')](handleEntityNotFound(_0x2d50d3,null))[_0x94ef('0x31')](function(_0x1736db){if(_0x1736db&&_0x1736db[_0x94ef('0xbe')]){_0x476669=_0x1736db[_0x94ef('0x33')]({'plain':!![]});if(_0x476669[_0x94ef('0xbe')]&&_0x476669[_0x94ef('0xbe')][_0x94ef('0xa5')][_0x94ef('0x46')]){return _0x476669[_0x94ef('0xbe')][_0x94ef('0xa5')][0x0];}return db[_0x94ef('0xa8')][_0x94ef('0x5b')](_[_0x94ef('0x15')](_0x2b372a[_0x94ef('0x5c')],{'firstName':_0x1d7056,'mobile':_0x1d7056,'phone':_0x1d7056,'ListId':_0x476669[_0x94ef('0x93')]}));}})[_0x94ef('0x31')](handleEntityNotFound(_0x2d50d3,null))[_0x94ef('0x31')](function(_0x2e2ca2){if(_0x2e2ca2){_0x497322=_0x2e2ca2;return db[_0x94ef('0xaa')]['find']({'where':{'ContactId':_0x497322['id'],'closed':![],'WhatsappAccountId':_0x476669['id']}})[_0x94ef('0x31')](function(_0x1fcca1){if(_0x1fcca1){return[_0x1fcca1,![]];}return db[_0x94ef('0xaa')][_0x94ef('0x5b')]({'UserId':_0x2b372a[_0x94ef('0x5d')]['id'],'ContactId':_0x497322['id'],'WhatsappAccountId':_0x476669['id'],'phone':_0x1d7056,'firstMsgDirection':_0x94ef('0xbf'),'Messages':[_[_0x94ef('0x4e')](_0x2b372a['body'],{'read':![],'body':_0x2b372a['body'][_0x94ef('0x5c')],'phone':_0x1d7056,'WhatsappAccountId':_0x476669['id'],'UserId':_0x2b372a[_0x94ef('0x5d')]['id'],'ContactId':_0x497322['id']})]},{'include':[{'model':db[_0x94ef('0xc0')],'as':_0x94ef('0xc1')}]})['then'](function(_0x192f31){return[_0x192f31,!![]];});});}})[_0x94ef('0x73')](function(_0x565bf2,_0x15263e){if(_0x15263e){return _0x565bf2;}return db[_0x94ef('0xc0')]['create'](_[_0x94ef('0x4e')](_0x2b372a['body'],{'read':![],'body':_0x2b372a['body']['body'],'phone':_0x1d7056,'WhatsappAccountId':_0x476669['id'],'WhatsappInteractionId':_0x565bf2['id'],'UserId':_0x2b372a[_0x94ef('0x5d')]['id'],'ContactId':_0x497322['id']}))['then'](function(_0x458f38){_0x565bf2[_0x94ef('0xc2')]['Messages']=[];_0x565bf2['dataValues'][_0x94ef('0xc1')][_0x94ef('0xad')](_0x458f38[_0x94ef('0xc2')]);return _0x565bf2;});})[_0x94ef('0x31')](respondWithResult(_0x2d50d3,null))[_0x94ef('0x52')](handleError(_0x2d50d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 47def4b..3f6e079 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b4a=['WhatsappAccount','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1e78b2,_0x248b66){var _0x1c8571=function(_0x51aa07){while(--_0x51aa07){_0x1e78b2['push'](_0x1e78b2['shift']());}};_0x1c8571(++_0x248b66);}(_0x5b4a,0x170));var _0xa5b4=function(_0x35042f,_0x1a8f5e){_0x35042f=_0x35042f-0x0;var _0x3a0a54=_0x5b4a[_0x35042f];return _0x3a0a54;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xa5b4('0x0'))['db'][_0xa5b4('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa5b4('0x2'),'afterUpdate':_0xa5b4('0x3'),'afterDestroy':_0xa5b4('0x4')};function emitEvent(_0x2ff688){return function(_0x2e9edb,_0x15f341,_0x33ed7b){WhatsappAccountEvents['emit'](_0x2ff688+':'+_0x2e9edb['id'],_0x2e9edb);WhatsappAccountEvents[_0xa5b4('0x5')](_0x2ff688,_0x2e9edb);_0x33ed7b(null);};}for(var e in events){if(events[_0xa5b4('0x6')](e)){var event=events[e];WhatsappAccount[_0xa5b4('0x7')](e,emitEvent(event));}}module[_0xa5b4('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xad20=['update','remove','emit','hasOwnProperty','events','../../mysqldb','save'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xad20,0x162));var _0x0ad2=function(_0x5df55d,_0x590727){_0x5df55d=_0x5df55d-0x0;var _0x36b1f0=_0xad20[_0x5df55d];return _0x36b1f0;};'use strict';var EventEmitter=require(_0x0ad2('0x0'));var WhatsappAccount=require(_0x0ad2('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ad2('0x2'),'afterUpdate':_0x0ad2('0x3'),'afterDestroy':_0x0ad2('0x4')};function emitEvent(_0x265b4a){return function(_0x20a5f7,_0x2dc316,_0x15d6df){WhatsappAccountEvents[_0x0ad2('0x5')](_0x265b4a+':'+_0x20a5f7['id'],_0x20a5f7);WhatsappAccountEvents[_0x0ad2('0x5')](_0x265b4a,_0x20a5f7);_0x15d6df(null);};}for(var e in events){if(events[_0x0ad2('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 77fa501..eda6cfc 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcda3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x5e064f,_0x5d3c5d){var _0x4347ef=function(_0x25ce80){while(--_0x25ce80){_0x5e064f['push'](_0x5e064f['shift']());}};_0x4347ef(++_0x5d3c5d);}(_0xcda3,0x1cc));var _0x3cda=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xcda3[_0xf2f332];return _0x56cce3;};'use strict';var _=require(_0x3cda('0x0'));var util=require(_0x3cda('0x1'));var logger=require(_0x3cda('0x2'))(_0x3cda('0x3'));var moment=require(_0x3cda('0x4'));var BPromise=require(_0x3cda('0x5'));var rp=require(_0x3cda('0x6'));var fs=require('fs');var path=require(_0x3cda('0x7'));var rimraf=require(_0x3cda('0x8'));var config=require('../../config/environment');var attributes=require(_0x3cda('0x9'));module[_0x3cda('0xa')]=function(_0x5c741d,_0x5b0011){return _0x5c741d[_0x3cda('0xb')](_0x3cda('0xc'),attributes,{'tableName':_0x3cda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf75f=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts'];(function(_0x2c93e2,_0x4fb5e2){var _0x57264e=function(_0x386895){while(--_0x386895){_0x2c93e2['push'](_0x2c93e2['shift']());}};_0x57264e(++_0x4fb5e2);}(_0xf75f,0x120));var _0xff75=function(_0x363eec,_0x98451b){_0x363eec=_0x363eec-0x0;var _0x3d71d9=_0xf75f[_0x363eec];return _0x3d71d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff75('0x0'))('api');var moment=require(_0xff75('0x1'));var BPromise=require(_0xff75('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff75('0x3'));var config=require(_0xff75('0x4'));var attributes=require(_0xff75('0x5'));module[_0xff75('0x6')]=function(_0x49979a,_0x4980ce){return _0x49979a['define'](_0xff75('0x7'),attributes,{'tableName':_0xff75('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index b668980..3d26b12 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c96=['WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','options','raw','where','attributes','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','info'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x5c96,0x133));var _0x65c9=function(_0x39b2a2,_0x1f2d18){_0x39b2a2=_0x39b2a2-0x0;var _0x12d79e=_0x5c96[_0x39b2a2];return _0x12d79e;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65c9('0x4'));var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x65c9('0xb')],{'host':_0x65c9('0xc'),'port':0x18eb});var socket=require(_0x65c9('0xd'))(new Redis(config['redis']));require(_0x65c9('0xe'))[_0x65c9('0xf')](socket);function respondWithRpcPromise(_0x9498d6,_0x2ed1d6,_0x4106e9){return new BPromise(function(_0x34b7c6,_0x292827){return client['request'](_0x9498d6,_0x4106e9)['then'](function(_0x5a29dd){logger[_0x65c9('0x10')](_0x65c9('0x11'),_0x2ed1d6,_0x65c9('0x12'));logger[_0x65c9('0x13')](_0x65c9('0x14'),_0x2ed1d6,'request\x20sent',JSON[_0x65c9('0x15')](_0x5a29dd));if(_0x5a29dd[_0x65c9('0x16')]){if(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x17')]===0x1f4){logger['error'](_0x65c9('0x11'),_0x2ed1d6,_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);return _0x292827(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);}logger[_0x65c9('0x16')](_0x65c9('0x11'),_0x2ed1d6,_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);return _0x34b7c6(_0x5a29dd[_0x65c9('0x16')][_0x65c9('0x18')]);}else{logger[_0x65c9('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x2ed1d6,'request\x20sent');_0x34b7c6(_0x5a29dd[_0x65c9('0x19')][_0x65c9('0x18')]);}})[_0x65c9('0x1a')](function(_0x1caf2a){logger[_0x65c9('0x16')](_0x65c9('0x11'),_0x2ed1d6,_0x1caf2a);_0x292827(_0x1caf2a);});});}exports[_0x65c9('0x1b')]=function(_0x483c1d){var _0x42f7f2=this;return new Promise(function(_0x4fccab,_0x5b275d){return db['WhatsappAccount']['find']({'raw':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1e')]||null:null,'attributes':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x1f')]||null:null,'include':_0x483c1d[_0x65c9('0x1c')]?_0x483c1d[_0x65c9('0x1c')]['include']?_[_0x65c9('0x20')](_0x483c1d[_0x65c9('0x1c')][_0x65c9('0x21')],function(_0x3841a7){return{'model':db[_0x3841a7[_0x65c9('0x22')]],'as':_0x3841a7['as'],'attributes':_0x3841a7[_0x65c9('0x1f')],'include':_0x3841a7[_0x65c9('0x21')]?_['map'](_0x3841a7[_0x65c9('0x21')],function(_0x453612){return{'model':db[_0x453612['model']],'as':_0x453612['as'],'attributes':_0x453612[_0x65c9('0x1f')],'include':_0x453612[_0x65c9('0x21')]?_['map'](_0x453612[_0x65c9('0x21')],function(_0xfeac3a){return{'model':db[_0xfeac3a['model']],'as':_0xfeac3a['as'],'attributes':_0xfeac3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x65c9('0x23')](function(_0x5612e9){logger[_0x65c9('0x10')]('ShowWhatsappAccount',_0x483c1d);logger[_0x65c9('0x13')]('ShowWhatsappAccount',_0x483c1d,JSON[_0x65c9('0x15')](_0x5612e9));_0x4fccab(_0x5612e9);})[_0x65c9('0x1a')](function(_0x5780fb){logger['error'](_0x65c9('0x1b'),_0x5780fb[_0x65c9('0x18')],_0x483c1d);_0x5b275d(_0x42f7f2['error'](0x1f4,_0x5780fb[_0x65c9('0x18')]));});});}; \ No newline at end of file +var _0x1f93=['stringify','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','ShowWhatsappAccount','WhatsappAccount','find','options','attributes','include','map','model'];(function(_0x31820a,_0x151492){var _0x4f18b6=function(_0x358259){while(--_0x358259){_0x31820a['push'](_0x31820a['shift']());}};_0x4f18b6(++_0x151492);}(_0x1f93,0x112));var _0x31f9=function(_0xc9ada3,_0x321b72){_0xc9ada3=_0xc9ada3-0x0;var _0x5acfe4=_0x1f93[_0xc9ada3];return _0x5acfe4;};'use strict';var _=require(_0x31f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x31f9('0x1'));var rs=require(_0x31f9('0x2'));var fs=require('fs');var Redis=require(_0x31f9('0x3'));var db=require(_0x31f9('0x4'))['db'];var utils=require(_0x31f9('0x5'));var logger=require(_0x31f9('0x6'))(_0x31f9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x31f9('0x8')][_0x31f9('0x9')]({'port':0x232a});config[_0x31f9('0xa')]=_[_0x31f9('0xb')](config[_0x31f9('0xa')],{'host':_0x31f9('0xc'),'port':0x18eb});var socket=require(_0x31f9('0xd'))(new Redis(config[_0x31f9('0xa')]));require(_0x31f9('0xe'))[_0x31f9('0xf')](socket);function respondWithRpcPromise(_0x2614b7,_0x336020,_0x1e635c){return new BPromise(function(_0x56898e,_0x26ea60){return client['request'](_0x2614b7,_0x1e635c)[_0x31f9('0x10')](function(_0xc4a187){logger['info'](_0x31f9('0x11'),_0x336020,'request\x20sent');logger[_0x31f9('0x12')](_0x31f9('0x13'),_0x336020,_0x31f9('0x14'),JSON['stringify'](_0xc4a187));if(_0xc4a187[_0x31f9('0x15')]){if(_0xc4a187[_0x31f9('0x15')]['code']===0x1f4){logger['error'](_0x31f9('0x11'),_0x336020,_0xc4a187[_0x31f9('0x15')][_0x31f9('0x16')]);return _0x26ea60(_0xc4a187[_0x31f9('0x15')][_0x31f9('0x16')]);}logger[_0x31f9('0x15')](_0x31f9('0x11'),_0x336020,_0xc4a187['error'][_0x31f9('0x16')]);return _0x56898e(_0xc4a187[_0x31f9('0x15')][_0x31f9('0x16')]);}else{logger[_0x31f9('0x17')](_0x31f9('0x11'),_0x336020,_0x31f9('0x14'));_0x56898e(_0xc4a187['result'][_0x31f9('0x16')]);}})['catch'](function(_0x538de6){logger[_0x31f9('0x15')](_0x31f9('0x11'),_0x336020,_0x538de6);_0x26ea60(_0x538de6);});});}exports[_0x31f9('0x18')]=function(_0x345a7d){var _0x4df698=this;return new Promise(function(_0x1dfa5f,_0x34e8de){return db[_0x31f9('0x19')][_0x31f9('0x1a')]({'raw':_0x345a7d[_0x31f9('0x1b')]?_0x345a7d['options']['raw']===undefined?!![]:![]:!![],'where':_0x345a7d['options']?_0x345a7d[_0x31f9('0x1b')]['where']||null:null,'attributes':_0x345a7d[_0x31f9('0x1b')]?_0x345a7d[_0x31f9('0x1b')][_0x31f9('0x1c')]||null:null,'include':_0x345a7d[_0x31f9('0x1b')]?_0x345a7d[_0x31f9('0x1b')][_0x31f9('0x1d')]?_[_0x31f9('0x1e')](_0x345a7d[_0x31f9('0x1b')][_0x31f9('0x1d')],function(_0x199aca){return{'model':db[_0x199aca[_0x31f9('0x1f')]],'as':_0x199aca['as'],'attributes':_0x199aca[_0x31f9('0x1c')],'include':_0x199aca[_0x31f9('0x1d')]?_[_0x31f9('0x1e')](_0x199aca[_0x31f9('0x1d')],function(_0xdb213){return{'model':db[_0xdb213[_0x31f9('0x1f')]],'as':_0xdb213['as'],'attributes':_0xdb213['attributes'],'include':_0xdb213['include']?_[_0x31f9('0x1e')](_0xdb213[_0x31f9('0x1d')],function(_0x178d8d){return{'model':db[_0x178d8d['model']],'as':_0x178d8d['as'],'attributes':_0x178d8d[_0x31f9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x31f9('0x10')](function(_0x272ef5){logger[_0x31f9('0x17')]('ShowWhatsappAccount',_0x345a7d);logger[_0x31f9('0x12')](_0x31f9('0x18'),_0x345a7d,JSON[_0x31f9('0x20')](_0x272ef5));_0x1dfa5f(_0x272ef5);})[_0x31f9('0x21')](function(_0x1c97d7){logger[_0x31f9('0x15')](_0x31f9('0x18'),_0x1c97d7[_0x31f9('0x16')],_0x345a7d);_0x34e8de(_0x4df698[_0x31f9('0x15')](0x1f4,_0x1c97d7[_0x31f9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index f5eecd5..aac8bce 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8363=['removeListener','register','length','whatsappAccount:','remove'];(function(_0x2d23de,_0x4e71ca){var _0x27b393=function(_0x43d55b){while(--_0x43d55b){_0x2d23de['push'](_0x2d23de['shift']());}};_0x27b393(++_0x4e71ca);}(_0x8363,0x86));var _0x3836=function(_0x5c999a,_0x4b0f56){_0x5c999a=_0x5c999a-0x0;var _0x34bc3b=_0x8363[_0x5c999a];return _0x34bc3b;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x3836('0x0'),'update'];function createListener(_0x1c7e9e,_0x44ce79){return function(_0x5116ce){_0x44ce79['emit'](_0x1c7e9e,_0x5116ce);};}function removeListener(_0x273ac9,_0x29ed63){return function(){WhatsappAccountEvents[_0x3836('0x1')](_0x273ac9,_0x29ed63);};}exports[_0x3836('0x2')]=function(_0x49d42f){for(var _0x5a2608=0x0,_0x341f3a=events[_0x3836('0x3')];_0x5a2608<_0x341f3a;_0x5a2608++){var _0xeddec4=events[_0x5a2608];var _0x36b95c=createListener(_0x3836('0x4')+_0xeddec4,_0x49d42f);WhatsappAccountEvents['on'](_0xeddec4,_0x36b95c);}}; \ No newline at end of file +var _0xb72e=['emit','length','./whatsappAccount.events','remove','update'];(function(_0x43d328,_0x3858ee){var _0x3a37af=function(_0x101c4a){while(--_0x101c4a){_0x43d328['push'](_0x43d328['shift']());}};_0x3a37af(++_0x3858ee);}(_0xb72e,0x93));var _0xeb72=function(_0x44cc78,_0xca3b3d){_0x44cc78=_0x44cc78-0x0;var _0x4efe34=_0xb72e[_0x44cc78];return _0x4efe34;};'use strict';var WhatsappAccountEvents=require(_0xeb72('0x0'));var events=['save',_0xeb72('0x1'),_0xeb72('0x2')];function createListener(_0x3b7382,_0x39d06c){return function(_0x172cdd){_0x39d06c[_0xeb72('0x3')](_0x3b7382,_0x172cdd);};}function removeListener(_0x1476a9,_0x460646){return function(){WhatsappAccountEvents['removeListener'](_0x1476a9,_0x460646);};}exports['register']=function(_0x1d4d07){for(var _0x365ee9=0x0,_0x35366f=events[_0xeb72('0x4')];_0x365ee9<_0x35366f;_0x365ee9++){var _0x4e2ecb=events[_0x365ee9];var _0x47c08f=createListener('whatsappAccount:'+_0x4e2ecb,_0x1d4d07);WhatsappAccountEvents['on'](_0x4e2ecb,_0x47c08f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 4c96e90..055d6fc 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd350=['/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x16bdc2,_0x16c9fd){var _0x435db3=function(_0x384042){while(--_0x384042){_0x16bdc2['push'](_0x16bdc2['shift']());}};_0x435db3(++_0x16c9fd);}(_0xd350,0x1be));var _0x0d35=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xd350[_0x5c2e5e];return _0x46a5da;};'use strict';var multer=require(_0x0d35('0x0'));var util=require(_0x0d35('0x1'));var path=require(_0x0d35('0x2'));var timeout=require(_0x0d35('0x3'));var express=require(_0x0d35('0x4'));var router=express[_0x0d35('0x5')]();var fs_extra=require(_0x0d35('0x6'));var auth=require(_0x0d35('0x7'));var interaction=require(_0x0d35('0x8'));var config=require(_0x0d35('0x9'));var controller=require(_0x0d35('0xa'));router[_0x0d35('0xb')]('/',auth[_0x0d35('0xc')](),controller[_0x0d35('0xd')]);router['get'](_0x0d35('0xe'),auth['isAuthenticated'](),controller[_0x0d35('0xf')]);router['post']('/',auth[_0x0d35('0xc')](),controller['create']);router[_0x0d35('0x10')]('/:id',auth[_0x0d35('0xc')](),controller[_0x0d35('0x11')]);router['delete'](_0x0d35('0xe'),auth[_0x0d35('0xc')](),controller[_0x0d35('0x12')]);module[_0x0d35('0x13')]=router; \ No newline at end of file +var _0xb0e5=['isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x35c97a,_0x513aba){var _0x388917=function(_0xa1f4e1){while(--_0xa1f4e1){_0x35c97a['push'](_0x35c97a['shift']());}};_0x388917(++_0x513aba);}(_0xb0e5,0x1c2));var _0x5b0e=function(_0x49acee,_0x49c7ab){_0x49acee=_0x49acee-0x0;var _0x18a8f8=_0xb0e5[_0x49acee];return _0x18a8f8;};'use strict';var multer=require('multer');var util=require(_0x5b0e('0x0'));var path=require(_0x5b0e('0x1'));var timeout=require(_0x5b0e('0x2'));var express=require(_0x5b0e('0x3'));var router=express[_0x5b0e('0x4')]();var fs_extra=require(_0x5b0e('0x5'));var auth=require(_0x5b0e('0x6'));var interaction=require(_0x5b0e('0x7'));var config=require(_0x5b0e('0x8'));var controller=require('./whatsappApplication.controller');router[_0x5b0e('0x9')]('/',auth[_0x5b0e('0xa')](),controller[_0x5b0e('0xb')]);router[_0x5b0e('0x9')]('/:id',auth[_0x5b0e('0xa')](),controller[_0x5b0e('0xc')]);router[_0x5b0e('0xd')]('/',auth[_0x5b0e('0xa')](),controller[_0x5b0e('0xe')]);router[_0x5b0e('0xf')](_0x5b0e('0x10'),auth['isAuthenticated'](),controller[_0x5b0e('0x11')]);router['delete'](_0x5b0e('0x10'),auth['isAuthenticated'](),controller[_0x5b0e('0x12')]);module[_0x5b0e('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b1f2e72..209de01 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fe9=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4fe9,0x180));var _0x94fe=function(_0x581e69,_0x122823){_0x581e69=_0x581e69-0x0;var _0x417bd4=_0x4fe9[_0x581e69];return _0x417bd4;};'use strict';var Sequelize=require(_0x94fe('0x0'));module[_0x94fe('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x94fe('0x2')],'allowNull':![],'defaultValue':_0x94fe('0x3')},'appdata':{'type':Sequelize[_0x94fe('0x4')]()},'description':{'type':Sequelize[_0x94fe('0x2')]},'interval':{'type':Sequelize[_0x94fe('0x2')],'defaultValue':_0x94fe('0x5')}}; \ No newline at end of file +var _0xedac=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x8455f8,_0x176ef0){var _0xf5ff07=function(_0xab6acc){while(--_0xab6acc){_0x8455f8['push'](_0x8455f8['shift']());}};_0xf5ff07(++_0x176ef0);}(_0xedac,0x1d3));var _0xceda=function(_0x3fad3d,_0x43d324){_0x3fad3d=_0x3fad3d-0x0;var _0x560433=_0xedac[_0x3fad3d];return _0x560433;};'use strict';var Sequelize=require('sequelize');module[_0xceda('0x0')]={'priority':{'type':Sequelize[_0xceda('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xceda('0x2')],'allowNull':![],'defaultValue':_0xceda('0x3')},'appdata':{'type':Sequelize[_0xceda('0x4')]()},'description':{'type':Sequelize[_0xceda('0x2')]},'interval':{'type':Sequelize[_0xceda('0x2')],'defaultValue':_0xceda('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 121c141..cccf25b 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['error','stack','name','send','index','WhatsappApplication','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x28da36,_0x5b1cd7){var _0x6bd1f1=function(_0x2e3cae){while(--_0x2e3cae){_0x28da36['push'](_0x28da36['shift']());}};_0x6bd1f1(++_0x5b1cd7);}(_0xdb28,0x106));var _0x8db2=function(_0x229ecc,_0xe09975){_0x229ecc=_0x229ecc-0x0;var _0x349b38=_0xdb28[_0x229ecc];return _0x349b38;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x1c52=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','send','index','map','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','merge','WhatsappApplication','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x1c52,0x7c));var _0x21c5=function(_0x423954,_0x584fa9){_0x423954=_0x423954-0x0;var _0x4369d0=_0x1c52[_0x423954];return _0x4369d0;};'use strict';var emlformat=require(_0x21c5('0x0'));var rimraf=require(_0x21c5('0x1'));var zipdir=require(_0x21c5('0x2'));var jsonpatch=require(_0x21c5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x21c5('0x4'));var util=require(_0x21c5('0x5'));var path=require('path');var sox=require(_0x21c5('0x6'));var csv=require(_0x21c5('0x7'));var ejs=require(_0x21c5('0x8'));var fs=require('fs');var fs_extra=require(_0x21c5('0x9'));var _=require('lodash');var squel=require(_0x21c5('0xa'));var crypto=require(_0x21c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x21c5('0xc'));var toCsv=require(_0x21c5('0x7'));var querystring=require(_0x21c5('0xd'));var Papa=require(_0x21c5('0xe'));var Redis=require('ioredis');var authService=require(_0x21c5('0xf'));var qs=require(_0x21c5('0x10'));var as=require(_0x21c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21c5('0x12'))('api');var utils=require(_0x21c5('0x13'));var config=require(_0x21c5('0x14'));var licenseUtil=require(_0x21c5('0x15'));var db=require(_0x21c5('0x16'))['db'];function respondWithStatusCode(_0x511e96,_0x36b869){_0x36b869=_0x36b869||0xcc;return function(_0x59bfc2){if(_0x59bfc2){return _0x511e96[_0x21c5('0x17')](_0x36b869);}return _0x511e96[_0x21c5('0x18')](_0x36b869)['end']();};}function respondWithResult(_0x17be3d,_0x4afb87){_0x4afb87=_0x4afb87||0xc8;return function(_0x4791f7){if(_0x4791f7){return _0x17be3d[_0x21c5('0x18')](_0x4afb87)[_0x21c5('0x19')](_0x4791f7);}};}function respondWithFilteredResult(_0x47030b,_0x20902a){return function(_0x15de0c){if(_0x15de0c){var _0x102433=typeof _0x20902a[_0x21c5('0x1a')]==='undefined'&&typeof _0x20902a[_0x21c5('0x1b')]==='undefined';var _0x495f5c=_0x15de0c[_0x21c5('0x1c')];var _0x56696e=_0x102433?0x0:_0x20902a['offset'];var _0x1bc8a4=_0x102433?_0x15de0c['count']:_0x20902a[_0x21c5('0x1a')]+_0x20902a['limit'];var _0x30fb8a;if(_0x1bc8a4>=_0x495f5c){_0x1bc8a4=_0x495f5c;_0x30fb8a=0xc8;}else{_0x30fb8a=0xce;}_0x47030b['status'](_0x30fb8a);return _0x47030b['set'](_0x21c5('0x1d'),_0x56696e+'-'+_0x1bc8a4+'/'+_0x495f5c)[_0x21c5('0x19')](_0x15de0c);}return null;};}function patchUpdates(_0x2840b7){return function(_0x300178){try{jsonpatch[_0x21c5('0x1e')](_0x300178,_0x2840b7,!![]);}catch(_0x1fb82d){return BPromise[_0x21c5('0x1f')](_0x1fb82d);}return _0x300178[_0x21c5('0x20')]();};}function saveUpdates(_0x1905a9,_0x493fbf){return function(_0x8021db){if(_0x8021db){return _0x8021db[_0x21c5('0x21')](_0x1905a9)[_0x21c5('0x22')](function(_0x1aa54e){return _0x1aa54e;});}return null;};}function removeEntity(_0x123a7a,_0x4bf186){return function(_0x251c9d){if(_0x251c9d){return _0x251c9d[_0x21c5('0x23')]()[_0x21c5('0x22')](function(){_0x123a7a[_0x21c5('0x18')](0xcc)[_0x21c5('0x24')]();});}};}function handleEntityNotFound(_0x4d3215,_0x51c0b1){return function(_0x4f877c){if(!_0x4f877c){_0x4d3215[_0x21c5('0x17')](0x194);}return _0x4f877c;};}function handleError(_0x200bc4,_0x442fac){_0x442fac=_0x442fac||0x1f4;return function(_0x2ae029){logger[_0x21c5('0x25')](_0x2ae029['stack']);if(_0x2ae029['name']){delete _0x2ae029['name'];}_0x200bc4[_0x21c5('0x18')](_0x442fac)[_0x21c5('0x26')](_0x2ae029);};}exports[_0x21c5('0x27')]=function(_0x3f056f,_0x52d551){var _0x887b={},_0x428b60={},_0x26dc04={'count':0x0,'rows':[]};var _0x1f3892=_[_0x21c5('0x28')](db['WhatsappApplication']['rawAttributes'],function(_0xda0d70){return{'name':_0xda0d70[_0x21c5('0x29')],'type':_0xda0d70[_0x21c5('0x2a')][_0x21c5('0x2b')]};});_0x428b60[_0x21c5('0x2c')]=_[_0x21c5('0x28')](_0x1f3892,_0x21c5('0x2d'));_0x428b60[_0x21c5('0x2e')]=_[_0x21c5('0x2f')](_0x3f056f[_0x21c5('0x2e')]);_0x428b60['filters']=_['intersection'](_0x428b60[_0x21c5('0x2c')],_0x428b60['query']);_0x887b[_0x21c5('0x30')]=_[_0x21c5('0x31')](_0x428b60[_0x21c5('0x2c')],qs[_0x21c5('0x32')](_0x3f056f['query'][_0x21c5('0x32')]));_0x887b['attributes']=_0x887b[_0x21c5('0x30')]['length']?_0x887b[_0x21c5('0x30')]:_0x428b60[_0x21c5('0x2c')];if(!_0x3f056f[_0x21c5('0x2e')]['hasOwnProperty'](_0x21c5('0x33'))){_0x887b['limit']=qs[_0x21c5('0x1b')](_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x1b')]);_0x887b['offset']=qs[_0x21c5('0x1a')](_0x3f056f['query']['offset']);}_0x887b[_0x21c5('0x34')]=qs[_0x21c5('0x35')](_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x35')]);_0x887b['where']=qs[_0x21c5('0x36')](_[_0x21c5('0x37')](_0x3f056f[_0x21c5('0x2e')],_0x428b60[_0x21c5('0x36')]),_0x1f3892);if(_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x38')]){_0x887b[_0x21c5('0x39')]=_[_0x21c5('0x3a')](_0x887b['where'],{'$or':_[_0x21c5('0x28')](_0x1f3892,function(_0x29f3c1){if(_0x29f3c1[_0x21c5('0x2a')]!=='VIRTUAL'){var _0x44d12e={};_0x44d12e[_0x29f3c1[_0x21c5('0x2d')]]={'$like':'%'+_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x38')]+'%'};return _0x44d12e;}})});}_0x887b=_[_0x21c5('0x3a')]({},_0x887b,_0x3f056f['options']);var _0x5a08ad={'where':_0x887b[_0x21c5('0x39')]};return db[_0x21c5('0x3b')][_0x21c5('0x1c')](_0x5a08ad)[_0x21c5('0x22')](function(_0x59a2fb){_0x26dc04[_0x21c5('0x1c')]=_0x59a2fb;if(_0x3f056f[_0x21c5('0x2e')][_0x21c5('0x3c')]){_0x887b[_0x21c5('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x21c5('0x3e')](_0x887b);})[_0x21c5('0x22')](function(_0x4f0e0b){_0x26dc04[_0x21c5('0x3f')]=_0x4f0e0b;return _0x26dc04;})[_0x21c5('0x22')](respondWithFilteredResult(_0x52d551,_0x887b))[_0x21c5('0x40')](handleError(_0x52d551,null));};exports['show']=function(_0x22af70,_0x35693c){var _0x19d698={'raw':!![],'where':{'id':_0x22af70[_0x21c5('0x41')]['id']}},_0x56547e={};_0x56547e['model']=_[_0x21c5('0x2f')](db[_0x21c5('0x3b')][_0x21c5('0x42')]);_0x56547e[_0x21c5('0x2e')]=_[_0x21c5('0x2f')](_0x22af70['query']);_0x56547e['filters']=_['intersection'](_0x56547e[_0x21c5('0x2c')],_0x56547e['query']);_0x19d698[_0x21c5('0x30')]=_[_0x21c5('0x31')](_0x56547e[_0x21c5('0x2c')],qs[_0x21c5('0x32')](_0x22af70['query'][_0x21c5('0x32')]));_0x19d698[_0x21c5('0x30')]=_0x19d698[_0x21c5('0x30')][_0x21c5('0x43')]?_0x19d698[_0x21c5('0x30')]:_0x56547e[_0x21c5('0x2c')];if(_0x22af70[_0x21c5('0x2e')][_0x21c5('0x3c')]){_0x19d698[_0x21c5('0x3d')]=[{'all':!![]}];}_0x19d698=_['merge']({},_0x19d698,_0x22af70[_0x21c5('0x44')]);return db['WhatsappApplication'][_0x21c5('0x45')](_0x19d698)[_0x21c5('0x22')](handleEntityNotFound(_0x35693c,null))[_0x21c5('0x22')](respondWithResult(_0x35693c,null))[_0x21c5('0x40')](handleError(_0x35693c,null));};exports[_0x21c5('0x46')]=function(_0x24242a,_0x29e4d3){return db[_0x21c5('0x3b')][_0x21c5('0x46')](_0x24242a[_0x21c5('0x47')],{})[_0x21c5('0x22')](respondWithResult(_0x29e4d3,0xc9))[_0x21c5('0x40')](handleError(_0x29e4d3,null));};exports['update']=function(_0x5e4586,_0x5513c5){if(_0x5e4586[_0x21c5('0x47')]['id']){delete _0x5e4586[_0x21c5('0x47')]['id'];}return db[_0x21c5('0x3b')]['find']({'where':{'id':_0x5e4586[_0x21c5('0x41')]['id']}})[_0x21c5('0x22')](handleEntityNotFound(_0x5513c5,null))[_0x21c5('0x22')](saveUpdates(_0x5e4586['body'],null))['then'](respondWithResult(_0x5513c5,null))[_0x21c5('0x40')](handleError(_0x5513c5,null));};exports[_0x21c5('0x23')]=function(_0x3fa0c4,_0x2b3ebc){return db['WhatsappApplication'][_0x21c5('0x45')]({'where':{'id':_0x3fa0c4[_0x21c5('0x41')]['id']}})[_0x21c5('0x22')](handleEntityNotFound(_0x2b3ebc,null))[_0x21c5('0x22')](removeEntity(_0x2b3ebc,null))['catch'](handleError(_0x2b3ebc,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index df91db4..dfe744b 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98d3=['bluebird','path','rimraf','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x29979c,_0x1aeb58){var _0x101e0d=function(_0x4d0018){while(--_0x4d0018){_0x29979c['push'](_0x29979c['shift']());}};_0x101e0d(++_0x1aeb58);}(_0x98d3,0x173));var _0x398d=function(_0x379307,_0x2b2f76){_0x379307=_0x379307-0x0;var _0x483904=_0x98d3[_0x379307];return _0x483904;};'use strict';var _=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var logger=require('../../config/logger')(_0x398d('0x2'));var moment=require('moment');var BPromise=require(_0x398d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x398d('0x4'));var rimraf=require(_0x398d('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0x398d('0x6')]=function(_0x25d38f,_0x2c3c4c){return _0x25d38f['define'](_0x398d('0x7'),attributes,{'tableName':_0x398d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x398d('0x9'),'collate':_0x398d('0xa')});}; \ No newline at end of file +var _0xaa7c=['utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x209a40,_0x8f655e){var _0x7b9c5=function(_0xdcbea6){while(--_0xdcbea6){_0x209a40['push'](_0x209a40['shift']());}};_0x7b9c5(++_0x8f655e);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x5d53be,_0x44cbff){_0x5d53be=_0x5d53be-0x0;var _0x14dac7=_0xaa7c[_0x5d53be];return _0x14dac7;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcaa7('0x1'));var rp=require(_0xcaa7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa7('0x3'));var config=require(_0xcaa7('0x4'));var attributes=require(_0xcaa7('0x5'));module[_0xcaa7('0x6')]=function(_0x27e610,_0x5a3674){return _0x27e610[_0xcaa7('0x7')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcaa7('0x8'),'collate':_0xcaa7('0x9')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index cb98d57..5463d21 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x16ec81,_0x385f15){var _0x1a0cac=function(_0x3d9a6a){while(--_0x3d9a6a){_0x16ec81['push'](_0x16ec81['shift']());}};_0x1a0cac(++_0x385f15);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x56cd53,_0x38e740){_0x56cd53=_0x56cd53-0x0;var _0x468a0b=_0x8d0e[_0x56cd53];return _0x468a0b;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x281958,_0x15b761){var _0x31dab8=function(_0x5ad840){while(--_0x5ad840){_0x281958['push'](_0x281958['shift']());}};_0x31dab8(++_0x15b761);}(_0xac31,0xca));var _0x1ac3=function(_0x401272,_0x4ce308){_0x401272=_0x401272-0x0;var _0x392647=_0xac31[_0x401272];return _0x392647;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 52fe581..29fd70e 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b1=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports'];(function(_0x146b3f,_0x182706){var _0x20f4ad=function(_0x804bca){while(--_0x804bca){_0x146b3f['push'](_0x146b3f['shift']());}};_0x20f4ad(++_0x182706);}(_0xd8b1,0x105));var _0x1d8b=function(_0x294fa2,_0x17ef9d){_0x294fa2=_0x294fa2-0x0;var _0x27667c=_0xd8b1[_0x294fa2];return _0x27667c;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['get']('/:id/messages',auth[_0x1d8b('0xa')](),controller['getMessages']);router[_0x1d8b('0xc')]('/:id/download',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xe')]);router[_0x1d8b('0xf')]('/',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0xf')]('/:id/messages',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x11')]);router[_0x1d8b('0xf')](_0x1d8b('0x12'),auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x15')),controller['addTags']);router[_0x1d8b('0x16')](_0x1d8b('0x17'),auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x18')),controller[_0x1d8b('0x19')]);router['delete']('/:id',auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x1a')),controller[_0x1d8b('0x1b')]);router['delete'](_0x1d8b('0x12'),auth[_0x1d8b('0xa')](),controller['removeTags']);module[_0x1d8b('0x1c')]=router; \ No newline at end of file +var _0x7ee1=['whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','/:id','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7ee1,0x8d));var _0x17ee=function(_0x308ff9,_0x3148cb){_0x308ff9=_0x308ff9-0x0;var _0x148225=_0x7ee1[_0x308ff9];return _0x148225;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['get']('/:id/messages',auth[_0x17ee('0x9')](),controller['getMessages']);router[_0x17ee('0x7')](_0x17ee('0xb'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);router['post']('/',auth[_0x17ee('0x9')](),controller['create']);router[_0x17ee('0xd')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xf')]);router[_0x17ee('0xd')](_0x17ee('0x10'),auth[_0x17ee('0x9')](),interaction[_0x17ee('0x11')](_0x17ee('0x12'),_0x17ee('0x13')),controller[_0x17ee('0x14')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x17ee('0x12'),_0x17ee('0x15')),controller[_0x17ee('0x16')]);router[_0x17ee('0x17')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),interaction[_0x17ee('0x11')]('whatsapp',_0x17ee('0x18')),controller[_0x17ee('0x19')]);router[_0x17ee('0x17')](_0x17ee('0x10'),auth[_0x17ee('0x9')](),controller['removeTags']);module[_0x17ee('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index a8942f1..15253e9 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8de=['moment','exports','DATE','STRING','ENUM','BOOLEAN'];(function(_0x4349f3,_0x3221fc){var _0x2f6f56=function(_0x4329fd){while(--_0x4329fd){_0x4349f3['push'](_0x4349f3['shift']());}};_0x2f6f56(++_0x3221fc);}(_0xf8de,0x1d4));var _0xef8d=function(_0x28bb82,_0x480402){_0x28bb82=_0x28bb82-0x0;var _0x434691=_0xf8de[_0x28bb82];return _0x434691;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xef8d('0x0'));module[_0xef8d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xef8d('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xef8d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xef8d('0x3')]},'note':{'type':Sequelize[_0xef8d('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xef8d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xef8d('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xef8d('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xef8d('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x2cd3=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x2cd3,0xf1));var _0x32cd=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x2cd3[_0x57cb4f];return _0x29bb45;};'use strict';var Sequelize=require(_0x32cd('0x0'));var moment=require('moment');module[_0x32cd('0x1')]={'closed':{'type':Sequelize[_0x32cd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x32cd('0x3')]},'disposition':{'type':Sequelize[_0x32cd('0x4')]},'secondDisposition':{'type':Sequelize[_0x32cd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x32cd('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x32cd('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x32cd('0x5')]('in',_0x32cd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x32cd('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x32cd('0x5')]('in',_0x32cd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x32cd('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a30b69c..6172164 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f81=['System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','error','name','send','Users','fullname','TagIds','split','Tags','push','then','waiting','talking','answered','unmanaged','total','closed','UserId','index','map','WhatsappInteraction','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_whatsapp_interactions','left_join','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','some','isEmpty','forEach','WhatsappAccountId','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','filters','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','$gte','includeAll','findAll','setTags','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','tmp','server','format','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4f81,0x1e3));var _0x14f8=function(_0xd84f6b,_0x4f59ed){_0xd84f6b=_0xd84f6b-0x0;var _0x1ddd6a=_0x4f81[_0xd84f6b];return _0x1ddd6a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14f8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14f8('0x1'));var moment=require(_0x14f8('0x2'));var BPromise=require(_0x14f8('0x3'));var Mustache=require(_0x14f8('0x4'));var util=require(_0x14f8('0x5'));var path=require(_0x14f8('0x6'));var sox=require(_0x14f8('0x7'));var csv=require('to-csv');var ejs=require(_0x14f8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14f8('0x9'));var squel=require(_0x14f8('0xa'));var crypto=require('crypto');var jsforce=require(_0x14f8('0xb'));var deskjs=require(_0x14f8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x14f8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x14f8('0xe'));var qs=require(_0x14f8('0xf'));var as=require(_0x14f8('0x10'));var pdf=require(_0x14f8('0x11'));var hardwareService=require(_0x14f8('0x12'));var logger=require(_0x14f8('0x13'))(_0x14f8('0x14'));var utils=require(_0x14f8('0x15'));var config=require(_0x14f8('0x16'));var licenseUtil=require(_0x14f8('0x17'));var db=require(_0x14f8('0x18'))['db'];config[_0x14f8('0x19')]=_['defaults'](config[_0x14f8('0x19')],{'host':_0x14f8('0x1a'),'port':0x18eb});var socket=require(_0x14f8('0x1b'))(new Redis(config[_0x14f8('0x19')]));require(_0x14f8('0x1c'))[_0x14f8('0x1d')](socket);function respondWithStatusCode(_0x12f39e,_0x37e020){_0x37e020=_0x37e020||0xcc;return function(_0x4022a3){if(_0x4022a3){return _0x12f39e[_0x14f8('0x1e')](_0x37e020);}return _0x12f39e['status'](_0x37e020)[_0x14f8('0x1f')]();};}function respondWithResult(_0xb396ab,_0x463944){_0x463944=_0x463944||0xc8;return function(_0x27b132){if(_0x27b132){return _0xb396ab[_0x14f8('0x20')](_0x463944)[_0x14f8('0x21')](_0x27b132);}};}function respondWithFilteredResult(_0x3ea647,_0x4a1a90){return function(_0x1d3fd0){if(_0x1d3fd0){var _0x4495de=typeof _0x4a1a90['offset']==='undefined'&&typeof _0x4a1a90['limit']===_0x14f8('0x22');var _0x471a81=_0x1d3fd0[_0x14f8('0x23')];var _0x5225c0=_0x4495de?0x0:_0x4a1a90[_0x14f8('0x24')];var _0x30c2cd=_0x4495de?_0x1d3fd0[_0x14f8('0x23')]:_0x4a1a90['offset']+_0x4a1a90[_0x14f8('0x25')];var _0x567f2e;if(_0x30c2cd>=_0x471a81){_0x30c2cd=_0x471a81;_0x567f2e=0xc8;}else{_0x567f2e=0xce;}_0x3ea647[_0x14f8('0x20')](_0x567f2e);return _0x3ea647[_0x14f8('0x26')]('Content-Range',_0x5225c0+'-'+_0x30c2cd+'/'+_0x471a81)['json'](_0x1d3fd0);}return null;};}function patchUpdates(_0x55c1fb){return function(_0x4a471c){try{jsonpatch[_0x14f8('0x27')](_0x4a471c,_0x55c1fb,!![]);}catch(_0x12f47f){return BPromise[_0x14f8('0x28')](_0x12f47f);}return _0x4a471c[_0x14f8('0x29')]();};}function saveUpdates(_0x12122d,_0x18350e){return function(_0x527632){if(_0x527632){return _0x527632[_0x14f8('0x2a')](_0x12122d)['then'](function(_0x16360d){return _0x16360d;});}return null;};}function removeEntity(_0x26e370,_0x1e938b){return function(_0x52fe4d){if(_0x52fe4d){return _0x52fe4d[_0x14f8('0x2b')]()['then'](function(){_0x26e370[_0x14f8('0x20')](0xcc)[_0x14f8('0x1f')]();});}};}function handleEntityNotFound(_0x5618d3,_0x1ccbb5){return function(_0xbe6007){if(!_0xbe6007){_0x5618d3[_0x14f8('0x1e')](0x194);}return _0xbe6007;};}function handleError(_0x4b319f,_0x408d99){_0x408d99=_0x408d99||0x1f4;return function(_0x43bb3d){logger[_0x14f8('0x2c')](_0x43bb3d['stack']);if(_0x43bb3d[_0x14f8('0x2d')]){delete _0x43bb3d[_0x14f8('0x2d')];}_0x4b319f[_0x14f8('0x20')](_0x408d99)[_0x14f8('0x2e')](_0x43bb3d);};}function getInteractionUsers(_0x2a4b48,_0x366292){return new BPromise(function(_0x21a482,_0x55b4b1){try{if(_0x366292[_0x2a4b48['id']]){_0x2a4b48[_0x14f8('0x2f')]=_['map'](_0x366292[_0x2a4b48['id']],function(_0x5afec9){return{'id':_0x5afec9['id'],'fullname':_0x5afec9[_0x14f8('0x30')]};});}}catch(_0x5b4fb0){_0x55b4b1(_0x5b4fb0);}_0x21a482(_0x2a4b48);});}function getInteractionTags(_0x3e4a27,_0x2f4dae){return new BPromise(function(_0x320ead,_0x25ce34){try{if(_0x3e4a27[_0x14f8('0x31')]){_0x3e4a27['Tags']=[];_0x3e4a27[_0x14f8('0x31')][_0x14f8('0x32')](',')['forEach'](function(_0x5697ed){_0x3e4a27[_0x14f8('0x33')][_0x14f8('0x34')](_0x2f4dae[_0x5697ed]);});}delete _0x3e4a27['TagIds'];}catch(_0x3a6974){_0x25ce34(_0x3a6974);}_0x320ead(_0x3e4a27);});}function updateWhatsappInteraction(_0x550477,_0x5511d8,_0x492b59){return new BPromise(function(_0x3ed862,_0x29aeee){return getInteractionUsers(_0x550477,_0x492b59)[_0x14f8('0x35')](function(_0x4f369b){return getInteractionTags(_0x4f369b,_0x5511d8);})[_0x14f8('0x35')](function(_0x4ac7b0){return getStateInteraction(_0x4ac7b0);})[_0x14f8('0x35')](function(_0x2109d1){_0x3ed862(_0x2109d1);})['catch'](function(_0x17a2ff){_0x29aeee(_0x17a2ff);});});}function getStateInteraction(_0x40adc6){return new BPromise(function(_0x5dd6bb){_0x40adc6[_0x14f8('0x36')]=0x0;_0x40adc6[_0x14f8('0x37')]=0x0;_0x40adc6[_0x14f8('0x38')]=0x0;_0x40adc6[_0x14f8('0x39')]=0x0;_0x40adc6[_0x14f8('0x3a')]=0x0;if(!_0x40adc6[_0x14f8('0x3b')]&&!_0x40adc6['UserId']){_0x40adc6[_0x14f8('0x36')]+=0x1;}if(!_0x40adc6['closed']&&_0x40adc6['UserId']){_0x40adc6[_0x14f8('0x37')]+=0x1;if(_0x40adc6['waiting']){_0x40adc6['waiting']-=0x1;}}if(_0x40adc6[_0x14f8('0x3b')]&&_0x40adc6[_0x14f8('0x3c')]){_0x40adc6[_0x14f8('0x38')]+=0x1;if(_0x40adc6['talking']){_0x40adc6['talking']-=0x1;}}if(_0x40adc6['closed']&&!_0x40adc6[_0x14f8('0x3c')]){_0x40adc6[_0x14f8('0x39')]+=0x1;if(_0x40adc6[_0x14f8('0x36')]){_0x40adc6[_0x14f8('0x36')]-=0x1;}}_0x40adc6[_0x14f8('0x3a')]+=0x1;_0x5dd6bb(_0x40adc6);});}exports[_0x14f8('0x3d')]=function(_0x3ed8bc,_0xcc7e66){var _0x30f0c3={},_0x5121d3={},_0x49fe0f={'count':0x0,'rows':[]};var _0x181451=_[_0x14f8('0x3e')](db[_0x14f8('0x3f')][_0x14f8('0x40')],function(_0x2c20f3){return{'name':_0x2c20f3['fieldName'],'type':_0x2c20f3[_0x14f8('0x41')][_0x14f8('0x42')]};});_0x5121d3[_0x14f8('0x43')]=_[_0x14f8('0x3e')](_0x181451,_0x14f8('0x2d'));_0x5121d3['query']=_[_0x14f8('0x44')](_0x3ed8bc[_0x14f8('0x45')]);_0x5121d3['filters']=_[_0x14f8('0x46')](_0x5121d3[_0x14f8('0x43')],_0x5121d3['query']);_0x30f0c3[_0x14f8('0x47')]=_[_0x14f8('0x46')](_0x5121d3[_0x14f8('0x43')],qs[_0x14f8('0x48')](_0x3ed8bc['query'][_0x14f8('0x48')]));_0x30f0c3['attributes']=_0x30f0c3[_0x14f8('0x47')][_0x14f8('0x49')]?_0x30f0c3[_0x14f8('0x47')]:_0x5121d3[_0x14f8('0x43')];if(!_0x3ed8bc[_0x14f8('0x45')]['hasOwnProperty'](_0x14f8('0x4a'))){_0x30f0c3[_0x14f8('0x25')]=qs[_0x14f8('0x25')](_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x25')]);_0x30f0c3[_0x14f8('0x24')]=qs[_0x14f8('0x24')](_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x24')]);}_0x30f0c3[_0x14f8('0x4b')]=qs[_0x14f8('0x4c')](_0x3ed8bc[_0x14f8('0x45')]['sort']);_0x30f0c3[_0x14f8('0x4d')]=qs['filters'](_[_0x14f8('0x4e')](_0x3ed8bc[_0x14f8('0x45')],_0x5121d3['filters']),_0x181451);var _0x232cad=[];var _0x1d1fe7=squel[_0x14f8('0x4f')]()[_0x14f8('0x50')]('id')['field'](_0x14f8('0x2d'))['field'](_0x14f8('0x51'))[_0x14f8('0x52')]('tools_tags');var _0x5ee8c4=squel[_0x14f8('0x4f')]()[_0x14f8('0x50')](_0x14f8('0x53'))[_0x14f8('0x50')](_0x14f8('0x54'))[_0x14f8('0x50')]('ui.WhatsappInteractionId')[_0x14f8('0x52')](_0x14f8('0x55'),'ui')[_0x14f8('0x56')]('users','u','u.id\x20=\x20ui.UserId');var _0x36ef7c=squel[_0x14f8('0x4f')]()[_0x14f8('0x52')](_0x14f8('0x57'),'i')[_0x14f8('0x56')]('cm_contacts','c',_0x14f8('0x58'))[_0x14f8('0x56')](_0x14f8('0x59'),'o',_0x14f8('0x5a'))[_0x14f8('0x56')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x14f8('0x56')](_0x14f8('0x5b'),'me',_0x14f8('0x5c'))[_0x14f8('0x56')]('whatsapp_interaction_has_tags','it',_0x14f8('0x5d'))[_0x14f8('0x56')](_0x14f8('0x5e'),'t',_0x14f8('0x5f'));var _0x58a1fe=squel[_0x14f8('0x60')]();var _0x57c872=[];var _0x4f79fd=squel['expr']();var _0xe0ffc6;if(_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x61')]){_0xe0ffc6=as[_0x14f8('0x62')](_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x61')]);var _0x2dac9c=_0xe0ffc6[_0x14f8('0x63')];for(var _0x134619=0x0;_0x134619<_0xe0ffc6['conditions'][_0x14f8('0x49')];_0x134619++){var _0x4d29ba=_0xe0ffc6[_0x14f8('0x64')][_0x134619];var _0x41f2ae='i';var _0xae02e5=_['find'](_0x181451,[_0x14f8('0x2d'),_0x4d29ba['field']]);if(!_0xae02e5){switch(_0x4d29ba['field']){case'unreadMessages':if(_0x4d29ba[_0x14f8('0x65')]==0x1){_0x36ef7c[_0x14f8('0x66')]('`'+_0x4d29ba['field']+'`\x20=\x200');}else{_0x36ef7c[_0x14f8('0x66')]('`'+_0x4d29ba['field']+'`\x20>\x200');}break;case _0x14f8('0x67'):if(_0x4d29ba[_0x14f8('0x68')]===_0x14f8('0x69')){if(_0x4d29ba[_0x14f8('0x65')][_0x14f8('0x32')]('\x20')[_0x14f8('0x49')]>0x1){_0x58a1fe[_0x2dac9c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x14f8('0x6a')](_0x4d29ba[_0x14f8('0x65')]),null);}else{var _0x52c1e8='%'+_0x4d29ba['value']+'%';_0x58a1fe[_0x2dac9c](_0x14f8('0x6b'),_0x52c1e8,_0x52c1e8,_0x52c1e8);}}else{_0xae02e5=_['find'](_0x181451,[_0x14f8('0x2d'),'ContactId']);_0x4d29ba[_0x14f8('0x50')]=_0x14f8('0x6c');_0x34feca=as[_0x14f8('0x6d')](_0x41f2ae,_0xae02e5[_0x14f8('0x41')],_0x4d29ba);_0x58a1fe[_0x2dac9c](_0x34feca[_0x14f8('0x6e')],_0x34feca[_0x14f8('0x65')][_0x14f8('0x6f')],_0x34feca[_0x14f8('0x65')][_0x14f8('0x1f')]);}break;case _0x14f8('0x70'):var _0x59a8bf=_0x4d29ba[_0x14f8('0x65')][_0x14f8('0x32')](',')[_0x14f8('0x3e')](function(_0x15d855){return Number(_0x15d855);});_0x59a8bf['forEach'](function(_0x335a71){_0x4f79fd['or'](_0x14f8('0x71'),'%,'+_0x335a71+',%');});_0x57c872=_[_0x14f8('0x72')](_0x57c872,_0x59a8bf);break;case _0x14f8('0x73'):if(_0x4d29ba['operator']==='$substring'){_0x58a1fe[_0x2dac9c](_0x14f8('0x74'),'%'+_0x4d29ba[_0x14f8('0x65')]+'%',null);}else{_0xae02e5=_[_0x14f8('0x75')](_0x181451,['name','UserId']);_0x4d29ba[_0x14f8('0x50')]=_0x14f8('0x3c');_0x34feca=as[_0x14f8('0x6d')](_0x41f2ae,_0xae02e5[_0x14f8('0x41')],_0x4d29ba);_0x58a1fe[_0x2dac9c](_0x34feca[_0x14f8('0x6e')],_0x34feca[_0x14f8('0x65')][_0x14f8('0x6f')],_0x34feca['value']['end']);}break;case _0x14f8('0x76'):_0x34feca=as[_0x14f8('0x6d')]('me',null,_0x4d29ba);_0x58a1fe[_0x2dac9c](_0x34feca[_0x14f8('0x6e')],_0x34feca[_0x14f8('0x65')][_0x14f8('0x6f')],_0x34feca[_0x14f8('0x65')]['end']);break;}}else{var _0x34feca=as[_0x14f8('0x6d')](_0x41f2ae,_0xae02e5[_0x14f8('0x41')],_0x4d29ba);_0x58a1fe[_0x2dac9c](_0x34feca[_0x14f8('0x6e')],_0x34feca[_0x14f8('0x65')][_0x14f8('0x6f')],_0x34feca[_0x14f8('0x65')]['end']);}}}else{var _0x4b3599=_(_0x3ed8bc[_0x14f8('0x45')])['keys']()[_0x14f8('0x3e')](function(_0x91f73a){return _[_0x14f8('0x77')](_0x181451,[_0x14f8('0x2d'),_0x91f73a])?_0x91f73a:undefined;})['compact']()[_0x14f8('0x65')]();if(!_[_0x14f8('0x78')](_0x4b3599)){_0x4b3599[_0x14f8('0x79')](function(_0xc2476d){if(_0xc2476d===_0x14f8('0x7a')){_0x36ef7c[_0x14f8('0x4d')]('i.WhatsappAccountId\x20IN\x20?',[][_0x14f8('0x7b')](_0x3ed8bc[_0x14f8('0x45')][_0xc2476d]));}else if(_0xc2476d===_0x14f8('0x7c')){var _0xa0da90=JSON[_0x14f8('0x7d')](_0x3ed8bc[_0x14f8('0x45')][_0xc2476d])['$gte'];var _0x1ed07e=JSON[_0x14f8('0x7d')](_0x3ed8bc[_0x14f8('0x45')][_0xc2476d])['$lte'];_0x36ef7c[_0x14f8('0x4d')](_0x14f8('0x7e'),_0xa0da90,_0x1ed07e);}else{if(_0x3ed8bc[_0x14f8('0x45')][_0xc2476d]===_0x14f8('0x7f')){_0x36ef7c['where']('i.'+_0xc2476d+'\x20IS\x20NULL');}else{_0x36ef7c[_0x14f8('0x4d')]('i.'+_0xc2476d+_0x14f8('0x80'),_0x3ed8bc[_0x14f8('0x45')][_0xc2476d]);}}});}if(_0x3ed8bc[_0x14f8('0x45')]['read']){if(_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x81')]==0x1){_0x36ef7c[_0x14f8('0x66')]('`unreadMessages`\x20=\x200');}else{_0x36ef7c[_0x14f8('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x3ed8bc['query'][_0x14f8('0x82')]){_0x57c872=_['isArray'](_0x3ed8bc['query'][_0x14f8('0x82')])?_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x82')]:new Array(_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x82')]);_0x57c872[_0x14f8('0x79')](function(_0x31e388){_0x4f79fd['or'](_0x14f8('0x71'),'%,'+_0x31e388+',%');});}if(_0x3ed8bc[_0x14f8('0x45')]['filter']){var _0x968bd0=_0x3ed8bc[_0x14f8('0x45')][_0x14f8('0x83')][_0x14f8('0x84')]('\x5c','\x5c\x5c')[_0x14f8('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x968bd0)){_0x58a1fe['or'](_0x14f8('0x85'),_0x968bd0+'%')['or'](_0x14f8('0x86'),_0x968bd0+'%');}else{_0x58a1fe['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x968bd0))['or'](_0x14f8('0x87'),_0x968bd0+'%');}}}_0x36ef7c[_0x14f8('0x4d')](_0x58a1fe);_0x36ef7c[_0x14f8('0x88')](_0x14f8('0x89'));var _0x36d299={'type':db[_0x14f8('0x8a')][_0x14f8('0x8b')]['SELECT'],'raw':!![]};var _0x3ca380=_0x36ef7c[_0x14f8('0x8c')]();_0x3ca380[_0x14f8('0x50')](_0x14f8('0x89'));_0x3ca380['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x30f0c3[_0x14f8('0x4b')]){_0x30f0c3[_0x14f8('0x4b')][_0x14f8('0x79')](function(_0xa3dd2b){var _0x3fd242=_0xa3dd2b[0x0]===_0x14f8('0x8d')?_0xa3dd2b[0x0]:'i.'+_0xa3dd2b[0x0];_0x36ef7c[_0x14f8('0x4b')](_0x3fd242,_0xa3dd2b[0x1]===_0x14f8('0x8e')?![]:!![]);});}if(!_[_0x14f8('0x78')](_0x57c872)){_0x36ef7c[_0x14f8('0x66')](_0x4f79fd);_0x3ca380[_0x14f8('0x4d')](_0x14f8('0x8f'),_0x57c872);}BPromise[_0x14f8('0x90')]()[_0x14f8('0x35')](function(){if(!_0xe0ffc6){if(_0x3ed8bc['query'][_0x14f8('0x7a')])return;_0x3ca380[_0x14f8('0x4d')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x36ef7c[_0x14f8('0x4d')](_0x14f8('0x91'));return;}if(_0x3ed8bc[_0x14f8('0x92')][_0x14f8('0x93')]!==_0x14f8('0x94'))return;return _0x3ed8bc[_0x14f8('0x92')][_0x14f8('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x198e6f){if(_[_0x14f8('0x78')](_0x198e6f)){_0x3ca380[_0x14f8('0x4d')](_0x14f8('0x96'));_0x36ef7c[_0x14f8('0x4d')](_0x14f8('0x96'));}else{_0x3ca380[_0x14f8('0x4d')]('i.WhatsappAccountId\x20IN\x20?',_[_0x14f8('0x3e')](_0x198e6f,'id'));_0x36ef7c[_0x14f8('0x4d')](_0x14f8('0x97'),_[_0x14f8('0x3e')](_0x198e6f,'id'));}});})[_0x14f8('0x35')](function(){if(_0x3ed8bc[_0x14f8('0x92')]['role']===_0x14f8('0x94')&&!_0xe0ffc6&&!_0x3ed8bc[_0x14f8('0x45')]['WhatsappAccountId'])return[];return db[_0x14f8('0x98')]['query'](_0x3ca380['toString'](),_0x36d299);})['then'](function(_0x7b165c){_0x49fe0f[_0x14f8('0x23')]=_0x7b165c['length'];if(_0x49fe0f['count']===0x0)return[];return db[_0x14f8('0x98')][_0x14f8('0x45')](_0x1d1fe7[_0x14f8('0x99')](),_0x36d299)[_0x14f8('0x35')](function(_0x11ee0b){_0x232cad=_[_0x14f8('0x9a')](_0x11ee0b,'id');_0x36d299=_[_0x14f8('0x9b')](_0x36d299,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ed8bc['query'][_0x14f8('0x48')]){_0x30f0c3['attributes'][_0x14f8('0x79')](function(_0x1c6bf1){_0x36ef7c['field']('i.'+_0x1c6bf1);});}else{_0x36ef7c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x14f8('0x9c'));_0x36ef7c['field'](_0x14f8('0x9d'),_0x14f8('0x9e'));_0x36ef7c[_0x14f8('0x50')](_0x14f8('0x9f'),_0x14f8('0xa0'));_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xa1'),'contactName');_0x36ef7c[_0x14f8('0x50')]('i.*');_0x36ef7c['field'](_0x14f8('0xa2'),'Contact.firstName');_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xa3'),_0x14f8('0xa4'));_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xa5'),_0x14f8('0xa6'));_0x36ef7c['field'](_0x14f8('0xa7'),'Contact.phone');_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xa8'),_0x14f8('0xa9'));_0x36ef7c['field']('c.fax',_0x14f8('0xaa'));_0x36ef7c['field'](_0x14f8('0xab'),_0x14f8('0xac'));_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xad'),_0x14f8('0xae'));_0x36ef7c[_0x14f8('0x50')](_0x14f8('0xaf'),_0x14f8('0x31'));}if(_0x30f0c3[_0x14f8('0x25')])_0x36ef7c[_0x14f8('0x25')](_0x30f0c3['limit']);if(_0x30f0c3[_0x14f8('0x24')])_0x36ef7c['offset'](_0x30f0c3[_0x14f8('0x24')]);return db[_0x14f8('0x98')][_0x14f8('0x45')](_0x36ef7c['toString'](),_0x36d299);})[_0x14f8('0x35')](function(_0x4ed259){if(_0x4ed259[_0x14f8('0x49')]>0x0)_0x5ee8c4[_0x14f8('0x4d')](_0x14f8('0xb0'),_['map'](_0x4ed259,'id'));return db[_0x14f8('0x98')]['query'](_0x5ee8c4[_0x14f8('0x99')](),_0x36d299)[_0x14f8('0x35')](function(_0x5026a0){var _0x41a0b2=_[_0x14f8('0xb1')](_0x5026a0,'WhatsappInteractionId');var _0xd55df0=[];_0x4ed259[_0x14f8('0x79')](function(_0x57e760){_0xd55df0[_0x14f8('0x34')](updateWhatsappInteraction(_0x57e760,_0x232cad,_0x41a0b2));});return BPromise[_0x14f8('0xb2')](_0xd55df0);});});})[_0x14f8('0x35')](function(_0x57e2bf){_0x49fe0f[_0x14f8('0xb3')]=_0x57e2bf;return _0x49fe0f;})[_0x14f8('0x35')](respondWithFilteredResult(_0xcc7e66,_0x30f0c3))[_0x14f8('0xb4')](handleError(_0xcc7e66,null));};exports['show']=function(_0x2cd2b5,_0xc3bf2d){var _0x616f49={'raw':![],'where':{'id':_0x2cd2b5[_0x14f8('0xb5')]['id']}},_0x412250={};_0x412250[_0x14f8('0x43')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x412250[_0x14f8('0x45')]=_[_0x14f8('0x44')](_0x2cd2b5[_0x14f8('0x45')]);_0x412250[_0x14f8('0xb6')]=_[_0x14f8('0x46')](_0x412250[_0x14f8('0x43')],_0x412250[_0x14f8('0x45')]);_0x616f49[_0x14f8('0x47')]=_['intersection'](_0x412250['model'],qs['fields'](_0x2cd2b5[_0x14f8('0x45')][_0x14f8('0x48')]));_0x616f49[_0x14f8('0x47')]=_0x616f49[_0x14f8('0x47')][_0x14f8('0x49')]?_0x616f49[_0x14f8('0x47')]:_0x412250[_0x14f8('0x43')];if(_0x2cd2b5['query']['includeAll']){_0x616f49[_0x14f8('0xb7')]=[{'all':!![]}];}_0x616f49=_['merge']({},_0x616f49,_0x2cd2b5[_0x14f8('0xb8')]);return db[_0x14f8('0x3f')][_0x14f8('0x75')](_0x616f49)['then'](handleEntityNotFound(_0xc3bf2d,null))['then'](respondWithResult(_0xc3bf2d,null))[_0x14f8('0xb4')](handleError(_0xc3bf2d,null));};exports[_0x14f8('0xb9')]=function(_0x16a8f3,_0xc901c9){return db[_0x14f8('0x3f')][_0x14f8('0xb9')](_0x16a8f3[_0x14f8('0x76')],{})[_0x14f8('0x35')](respondWithResult(_0xc901c9,0xc9))[_0x14f8('0xb4')](handleError(_0xc901c9,null));};exports['update']=function(_0xc2b7cc,_0xa87977){if(_0xc2b7cc[_0x14f8('0x76')]['id']){delete _0xc2b7cc['body']['id'];}return db[_0x14f8('0x3f')][_0x14f8('0x75')]({'where':{'id':_0xc2b7cc[_0x14f8('0xb5')]['id']}})['then'](handleEntityNotFound(_0xa87977,null))['then'](saveUpdates(_0xc2b7cc[_0x14f8('0x76')],null))[_0x14f8('0x35')](respondWithResult(_0xa87977,null))[_0x14f8('0xb4')](handleError(_0xa87977,null));};exports[_0x14f8('0x2b')]=function(_0x39dc2f,_0x5ccc63){return db['WhatsappInteraction'][_0x14f8('0x75')]({'where':{'id':_0x39dc2f[_0x14f8('0xb5')]['id']}})[_0x14f8('0x35')](handleEntityNotFound(_0x5ccc63,null))[_0x14f8('0x35')](removeEntity(_0x5ccc63,null))[_0x14f8('0xb4')](handleError(_0x5ccc63,null));};exports[_0x14f8('0xba')]=function(_0x31fb91,_0x420a3a){return db[_0x14f8('0x3f')][_0x14f8('0xba')]()[_0x14f8('0x35')](respondWithResult(_0x420a3a,null))['catch'](handleError(_0x420a3a,null));};exports[_0x14f8('0xbb')]=function(_0x4c5e74,_0x1dae3d,_0x8e5467){return db[_0x14f8('0xbc')][_0x14f8('0x75')]({'where':{'id':_0x4c5e74[_0x14f8('0xb5')]['id']}})[_0x14f8('0x35')](handleEntityNotFound(_0x1dae3d,null))['then'](function(_0x300d7b){if(_0x300d7b){return _0x300d7b[_0x14f8('0xbb')](_0x4c5e74[_0x14f8('0x76')][_0x14f8('0xbd')],_[_0x14f8('0xbe')](_0x4c5e74[_0x14f8('0x76')],[_0x14f8('0xbd'),'id'])||{});}})[_0x14f8('0x35')](respondWithResult(_0x1dae3d,null))[_0x14f8('0xb4')](handleError(_0x1dae3d,null));};exports[_0x14f8('0xbf')]=function(_0x57e97c,_0x3c3f69,_0x205fae){var _0x3a6eac={'raw':![],'where':{}};var _0x49257b={};var _0x57bb83={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x14f8('0xc0')]({'where':{'id':_0x57e97c[_0x14f8('0xb5')]['id']}})[_0x14f8('0x35')](handleEntityNotFound(_0x3c3f69,null))[_0x14f8('0x35')](function(_0x4b4e80){if(_0x4b4e80){_0x49257b[_0x14f8('0x43')]=_[_0x14f8('0x44')](db['WhatsappMessage'][_0x14f8('0x40')]);_0x49257b[_0x14f8('0x45')]=_[_0x14f8('0x44')](_0x57e97c[_0x14f8('0x45')]);_0x49257b['filters']=_[_0x14f8('0x46')](_0x49257b[_0x14f8('0x43')],_0x49257b[_0x14f8('0x45')]);_0x3a6eac['attributes']=_[_0x14f8('0x46')](_0x49257b[_0x14f8('0x43')],qs[_0x14f8('0x48')](_0x57e97c[_0x14f8('0x45')][_0x14f8('0x48')]));_0x3a6eac[_0x14f8('0x47')]=_0x3a6eac[_0x14f8('0x47')][_0x14f8('0x49')]?_0x3a6eac['attributes']:_0x49257b[_0x14f8('0x43')];if(!_0x57e97c[_0x14f8('0x45')]['hasOwnProperty']('nolimit')){_0x3a6eac[_0x14f8('0x25')]=qs[_0x14f8('0x25')](_0x57e97c[_0x14f8('0x45')][_0x14f8('0x25')]);_0x3a6eac['offset']=qs['offset'](_0x57e97c['query'][_0x14f8('0x24')]);}_0x3a6eac[_0x14f8('0x4b')]=qs[_0x14f8('0x4c')](_0x57e97c['query'][_0x14f8('0x4c')]);_0x3a6eac[_0x14f8('0x4d')]=qs[_0x14f8('0xb6')](_[_0x14f8('0x4e')](_0x57e97c[_0x14f8('0x45')],_0x49257b[_0x14f8('0xb6')]));_0x3a6eac[_0x14f8('0x4d')][_0x14f8('0xc1')]=_0x4b4e80['id'];if(_0x57e97c[_0x14f8('0x45')]['filter']){_0x3a6eac[_0x14f8('0x4d')]=_[_0x14f8('0x9b')](_0x3a6eac[_0x14f8('0x4d')],{'$or':_['map'](_0x3a6eac[_0x14f8('0x47')],function(_0x1f5657){var _0x2a43ee={};_0x2a43ee[_0x1f5657]={'$like':'%'+_0x57e97c[_0x14f8('0x45')][_0x14f8('0x83')]+'%'};return _0x2a43ee;})});}if(_0x57e97c['query'][_0x14f8('0xc2')]){var _0x2ba287=_0x57e97c[_0x14f8('0x45')][_0x14f8('0xc2')][_0x14f8('0x32')](',');var _0x45a854={};_0x45a854[_0x2ba287[0x0]]={'$gte':moment(_0x2ba287[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3a6eac[_0x14f8('0x4d')]=_[_0x14f8('0x9b')](_0x3a6eac['where'],_0x45a854);}_0x3a6eac=_[_0x14f8('0x9b')]({},_0x3a6eac,_0x57e97c[_0x14f8('0xb8')]);return db[_0x14f8('0xbc')][_0x14f8('0x23')]({'where':_0x3a6eac[_0x14f8('0x4d')]})['then'](function(_0x38112a){_0x57bb83[_0x14f8('0x23')]=_0x38112a;if(_0x57e97c[_0x14f8('0x45')][_0x14f8('0xc3')]){_0x3a6eac[_0x14f8('0xb7')]=[{'all':!![]}];}return db[_0x14f8('0xbc')][_0x14f8('0xc4')](_0x3a6eac);})[_0x14f8('0x35')](function(_0x5b890c){_0x57bb83[_0x14f8('0xb3')]=_0x5b890c;return _0x57bb83;});}})[_0x14f8('0x35')](respondWithFilteredResult(_0x3c3f69,_0x3a6eac))['catch'](handleError(_0x3c3f69,null));};exports['addTags']=function(_0x4e1e64,_0x2a3ec9,_0x2a532c){return db[_0x14f8('0x3f')][_0x14f8('0x75')]({'where':{'id':_0x4e1e64[_0x14f8('0xb5')]['id']}})[_0x14f8('0x35')](handleEntityNotFound(_0x2a3ec9,null))[_0x14f8('0x35')](function(_0x2c92e6){if(_0x2c92e6){return _0x2c92e6[_0x14f8('0xc5')](_0x4e1e64[_0x14f8('0x76')][_0x14f8('0xbd')],_[_0x14f8('0xbe')](_0x4e1e64[_0x14f8('0x76')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x14f8('0xc4')]({'attributes':['id',_0x14f8('0x2d'),'color'],'where':{'id':_0x4e1e64[_0x14f8('0x76')][_0x14f8('0xbd')]}});})['then'](function(_0x2570aa){socket[_0x14f8('0xc6')](_0x14f8('0xc7'),{'id':Number(_0x4e1e64[_0x14f8('0xb5')]['id']),'tags':_0x2570aa||[]});return{'id':Number(_0x4e1e64[_0x14f8('0xb5')]['id']),'tags':_0x2570aa||[]};});}})[_0x14f8('0x35')](respondWithResult(_0x2a3ec9,null))[_0x14f8('0xb4')](handleError(_0x2a3ec9,null));};exports[_0x14f8('0xc8')]=function(_0x4181c3,_0x1e4944,_0x50e56d){return db[_0x14f8('0x3f')][_0x14f8('0x75')]({'where':{'id':_0x4181c3[_0x14f8('0xb5')]['id']}})[_0x14f8('0x35')](handleEntityNotFound(_0x1e4944,null))[_0x14f8('0x35')](function(_0x5ef27a){if(_0x5ef27a){return _0x5ef27a[_0x14f8('0xc8')](_0x4181c3['query'][_0x14f8('0xbd')]);}})[_0x14f8('0x35')](respondWithStatusCode(_0x1e4944,null))['catch'](handleError(_0x1e4944,null));};exports[_0x14f8('0xc9')]=function(_0x329502,_0x306143){var _0x202fa5=moment()[_0x14f8('0xca')]()[_0x14f8('0x99')]();var _0x96af4a=path[_0x14f8('0xcb')](config[_0x14f8('0xcc')],'server','files',_0x14f8('0xcd'));var _0x561451=path[_0x14f8('0xcb')](config[_0x14f8('0xcc')],_0x14f8('0xce'),'files','attachments');var _0x527ffd=path[_0x14f8('0xcb')](_0x96af4a,_0x202fa5);var _0x38e376=util[_0x14f8('0xcf')]('transcript-%d-%s.zip',_0x329502[_0x14f8('0xb5')]['id'],_0x202fa5);var _0x769c54=path[_0x14f8('0xcb')](_0x96af4a,_0x38e376);var _0x4f0b2c=[];_0x4f0b2c[_0x14f8('0x34')]({'model':db[_0x14f8('0x73')],'as':'User','attributes':['id',_0x14f8('0x30')],'raw':!![]});_0x4f0b2c[_0x14f8('0x34')]({'model':db['CmContact'],'as':_0x14f8('0x67'),'attributes':['id',_0x14f8('0xd0'),_0x14f8('0xd1')],'raw':!![]});if(_0x329502[_0x14f8('0x45')]['attachments']){_0x4f0b2c['push']({'model':db['Attachment'],'as':_0x14f8('0xd2'),'raw':!![]});}var _0x54035a=[{'model':db['WhatsappMessage'],'as':_0x14f8('0xd3'),'attributes':['id',_0x14f8('0x76'),_0x14f8('0x7c'),_0x14f8('0xd4'),'secret',_0x14f8('0x81')],'include':_0x4f0b2c}];_0x54035a[_0x14f8('0x34')]({'model':db[_0x14f8('0xd5')],'as':'Account','attributes':['id',_0x14f8('0x2d')]});_0x54035a['push']({'model':db[_0x14f8('0x73')],'as':_0x14f8('0xd6'),'attributes':['id',_0x14f8('0x30')]});return db['WhatsappInteraction'][_0x14f8('0x75')]({'where':{'id':_0x329502['params']['id']},'include':_0x54035a})['then'](handleEntityNotFound(_0x306143,null))[_0x14f8('0x35')](function(_0x62b829){if(_0x62b829){var _0x32e8ce=_0x62b829['get']({'plain':!![]});fs[_0x14f8('0xd7')](_0x527ffd);var _0x2bb639={'channel':_0x14f8('0xd8'),'account':_0x32e8ce[_0x14f8('0xd9')][_0x14f8('0x2d')],'agent':_0x32e8ce[_0x14f8('0xd6')]?_0x32e8ce[_0x14f8('0xd6')]['fullname']:_0x14f8('0xda'),'createdAt':moment(_0x32e8ce[_0x14f8('0x7c')])[_0x14f8('0xcf')](_0x14f8('0xdb'))[_0x14f8('0x99')](),'closedAt':_0x32e8ce[_0x14f8('0x3b')]?moment(_0x32e8ce[_0x14f8('0xdc')])[_0x14f8('0xcf')](_0x14f8('0xdb'))[_0x14f8('0x99')]():'','disposition':_0x32e8ce[_0x14f8('0xdd')],'messages':_(_0x32e8ce[_0x14f8('0xd3')])[_0x14f8('0x83')]({'secret':![]})['map'](function(_0x5016fc){if(_0x5016fc[_0x14f8('0xd2')]){var _0x56b28e=path[_0x14f8('0xcb')](_0x561451,_0x5016fc[_0x14f8('0xd2')][_0x14f8('0xde')]);if(fs[_0x14f8('0xdf')](_0x56b28e)){fs[_0x14f8('0xe0')](_0x56b28e)[_0x14f8('0xe1')](fs[_0x14f8('0xe2')](path[_0x14f8('0xcb')](_0x527ffd,_0x5016fc[_0x14f8('0xd2')][_0x14f8('0xde')])));}}return{'date':moment(_0x5016fc[_0x14f8('0x7c')])[_0x14f8('0xcf')](_0x14f8('0xdb'))[_0x14f8('0x99')](),'sender':_0x5016fc['direction']===_0x14f8('0xe3')?_0x5016fc[_0x14f8('0x73')]?_0x5016fc[_0x14f8('0x73')][_0x14f8('0x30')]:_0x14f8('0xe4'):_0x5016fc['Contact'][_0x14f8('0xd0')]+(_0x5016fc[_0x14f8('0x67')][_0x14f8('0xd1')]?'\x20'+_0x5016fc[_0x14f8('0x67')][_0x14f8('0xd1')]:''),'body':_0x5016fc[_0x14f8('0xd2')]?_0x5016fc[_0x14f8('0xd2')]['basename']:_0x5016fc[_0x14f8('0x76')],'direction':_0x5016fc['direction']===_0x14f8('0xe3')?'A':'C','secret':_0x5016fc[_0x14f8('0xe5')],'read':_0x5016fc[_0x14f8('0x81')],'attachment':_0x5016fc[_0x14f8('0xd2')]};})[_0x14f8('0x65')]()};return ejs[_0x14f8('0xe6')](path[_0x14f8('0xcb')](config[_0x14f8('0xcc')],_0x14f8('0xce'),_0x14f8('0xe7'),_0x14f8('0xe8')),{'interaction':_0x2bb639})[_0x14f8('0x35')](function(_0x5773f6){var _0x29abab=path[_0x14f8('0xcb')](_0x527ffd,_0x14f8('0xe9')+_0x32e8ce['id']+'-'+_0x202fa5+_0x14f8('0xea'));var _0x2b6ad3={'path':_0x29abab,'channel':_0x14f8('0xd8'),'interactionId':_0x32e8ce['id']};return pdf[_0x14f8('0xeb')](_0x5773f6,_0x2b6ad3);})[_0x14f8('0x35')](function(){return new BPromise(function(_0x12f91d,_0x5b9274){zipdir(_0x527ffd,{'saveTo':_0x769c54},function(_0x4b123d,_0x39381d){if(_0x4b123d)return _0x5b9274(_0x4b123d);return _0x12f91d(_0x39381d);});})[_0x14f8('0x35')](function(){return new BPromise(function(_0x5c9d57,_0x1a7943){rimraf(_0x527ffd,function(_0xf7bd46){if(_0xf7bd46)_0x1a7943(_0xf7bd46);return _0x5c9d57();});});})['then'](function(){return _0x306143[_0x14f8('0xc9')](_0x769c54,_0x38e376,function(_0x5c2fb2){if(_0x5c2fb2){console[_0x14f8('0xec')]('err',_0x5c2fb2);}else{fs['unlinkSync'](_0x769c54);}});});});}else{return _0x306143['sendStatus'](0xc8);}})['catch'](handleError(_0x306143,null));}; \ No newline at end of file +var _0xcaf2=['search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','include','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','omit','Tag','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','fullname','CmContact','Contact','lastName','Attachment','Messages','Owner','get','Whatsapp','N.A.','existsSync','pipe','createWriteStream','direction','out','System','firstName','basename','secret','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','TagIds','split','forEach','Tags','push','catch','talking','answered','unmanaged','total','UserId','waiting','closed','index','WhatsappInteraction','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr'];(function(_0x57214d,_0x4e317e){var _0x1c8af0=function(_0x5493e4){while(--_0x5493e4){_0x57214d['push'](_0x57214d['shift']());}};_0x1c8af0(++_0x4e317e);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2c4570,_0x21871d){_0x2c4570=_0x2c4570-0x0;var _0x26f4b0=_0xcaf2[_0x2c4570];return _0x26f4b0;};'use strict';var emlformat=require(_0x2caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2caf('0x1'));var jsonpatch=require(_0x2caf('0x2'));var rp=require('request-promise');var moment=require(_0x2caf('0x3'));var BPromise=require(_0x2caf('0x4'));var Mustache=require('mustache');var util=require(_0x2caf('0x5'));var path=require('path');var sox=require(_0x2caf('0x6'));var csv=require(_0x2caf('0x7'));var ejs=require(_0x2caf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x7'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var as=require(_0x2caf('0x12'));var pdf=require(_0x2caf('0x13'));var hardwareService=require(_0x2caf('0x14'));var logger=require('../../config/logger')(_0x2caf('0x15'));var utils=require(_0x2caf('0x16'));var config=require(_0x2caf('0x17'));var licenseUtil=require(_0x2caf('0x18'));var db=require(_0x2caf('0x19'))['db'];config[_0x2caf('0x1a')]=_[_0x2caf('0x1b')](config[_0x2caf('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2caf('0x1c'))(new Redis(config[_0x2caf('0x1a')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5f1e93,_0x27bca8){_0x27bca8=_0x27bca8||0xcc;return function(_0x4da5ba){if(_0x4da5ba){return _0x5f1e93[_0x2caf('0x1d')](_0x27bca8);}return _0x5f1e93[_0x2caf('0x1e')](_0x27bca8)[_0x2caf('0x1f')]();};}function respondWithResult(_0x32ff41,_0x486b8d){_0x486b8d=_0x486b8d||0xc8;return function(_0x184355){if(_0x184355){return _0x32ff41['status'](_0x486b8d)[_0x2caf('0x20')](_0x184355);}};}function respondWithFilteredResult(_0x57f3cd,_0x4a33fc){return function(_0x3e975f){if(_0x3e975f){var _0x58047b=typeof _0x4a33fc[_0x2caf('0x21')]===_0x2caf('0x22')&&typeof _0x4a33fc['limit']===_0x2caf('0x22');var _0x1eeb76=_0x3e975f[_0x2caf('0x23')];var _0x255c08=_0x58047b?0x0:_0x4a33fc[_0x2caf('0x21')];var _0x595f2f=_0x58047b?_0x3e975f[_0x2caf('0x23')]:_0x4a33fc[_0x2caf('0x21')]+_0x4a33fc[_0x2caf('0x24')];var _0x358445;if(_0x595f2f>=_0x1eeb76){_0x595f2f=_0x1eeb76;_0x358445=0xc8;}else{_0x358445=0xce;}_0x57f3cd[_0x2caf('0x1e')](_0x358445);return _0x57f3cd[_0x2caf('0x25')](_0x2caf('0x26'),_0x255c08+'-'+_0x595f2f+'/'+_0x1eeb76)[_0x2caf('0x20')](_0x3e975f);}return null;};}function patchUpdates(_0x3332b1){return function(_0xb60d47){try{jsonpatch[_0x2caf('0x27')](_0xb60d47,_0x3332b1,!![]);}catch(_0x5231fc){return BPromise[_0x2caf('0x28')](_0x5231fc);}return _0xb60d47[_0x2caf('0x29')]();};}function saveUpdates(_0x1f29b0,_0x401ea2){return function(_0x3efa4e){if(_0x3efa4e){return _0x3efa4e[_0x2caf('0x2a')](_0x1f29b0)[_0x2caf('0x2b')](function(_0x164da){return _0x164da;});}return null;};}function removeEntity(_0x2e0a75,_0x31f059){return function(_0x5ad211){if(_0x5ad211){return _0x5ad211[_0x2caf('0x2c')]()[_0x2caf('0x2b')](function(){_0x2e0a75[_0x2caf('0x1e')](0xcc)[_0x2caf('0x1f')]();});}};}function handleEntityNotFound(_0x3c60d1,_0x17d3c6){return function(_0x13e8d9){if(!_0x13e8d9){_0x3c60d1[_0x2caf('0x1d')](0x194);}return _0x13e8d9;};}function handleError(_0x23f765,_0x2304f1){_0x2304f1=_0x2304f1||0x1f4;return function(_0x30da75){logger[_0x2caf('0x2d')](_0x30da75[_0x2caf('0x2e')]);if(_0x30da75['name']){delete _0x30da75[_0x2caf('0x2f')];}_0x23f765[_0x2caf('0x1e')](_0x2304f1)[_0x2caf('0x30')](_0x30da75);};}function getInteractionUsers(_0x25bbfc,_0xa8523b){return new BPromise(function(_0x1f52bf,_0x3812cd){try{if(_0xa8523b[_0x25bbfc['id']]){_0x25bbfc['Users']=_[_0x2caf('0x31')](_0xa8523b[_0x25bbfc['id']],function(_0x4068e0){return{'id':_0x4068e0['id'],'fullname':_0x4068e0['fullname']};});}}catch(_0x302e39){_0x3812cd(_0x302e39);}_0x1f52bf(_0x25bbfc);});}function getInteractionTags(_0x1e9cfc,_0xfd34a2){return new BPromise(function(_0x4fc545,_0xd4a8bf){try{if(_0x1e9cfc['TagIds']){_0x1e9cfc['Tags']=[];_0x1e9cfc[_0x2caf('0x32')][_0x2caf('0x33')](',')[_0x2caf('0x34')](function(_0xcf8f31){_0x1e9cfc[_0x2caf('0x35')][_0x2caf('0x36')](_0xfd34a2[_0xcf8f31]);});}delete _0x1e9cfc[_0x2caf('0x32')];}catch(_0x34d8fe){_0xd4a8bf(_0x34d8fe);}_0x4fc545(_0x1e9cfc);});}function updateWhatsappInteraction(_0x20818e,_0x58c0a3,_0x155ad2){return new BPromise(function(_0x154bcc,_0x185e77){return getInteractionUsers(_0x20818e,_0x155ad2)[_0x2caf('0x2b')](function(_0x17c1b4){return getInteractionTags(_0x17c1b4,_0x58c0a3);})[_0x2caf('0x2b')](function(_0x14cbb2){return getStateInteraction(_0x14cbb2);})[_0x2caf('0x2b')](function(_0x398de1){_0x154bcc(_0x398de1);})[_0x2caf('0x37')](function(_0x105ec7){_0x185e77(_0x105ec7);});});}function getStateInteraction(_0xd98ec6){return new BPromise(function(_0x4d1dec){_0xd98ec6['waiting']=0x0;_0xd98ec6[_0x2caf('0x38')]=0x0;_0xd98ec6[_0x2caf('0x39')]=0x0;_0xd98ec6[_0x2caf('0x3a')]=0x0;_0xd98ec6[_0x2caf('0x3b')]=0x0;if(!_0xd98ec6['closed']&&!_0xd98ec6[_0x2caf('0x3c')]){_0xd98ec6[_0x2caf('0x3d')]+=0x1;}if(!_0xd98ec6[_0x2caf('0x3e')]&&_0xd98ec6[_0x2caf('0x3c')]){_0xd98ec6[_0x2caf('0x38')]+=0x1;if(_0xd98ec6[_0x2caf('0x3d')]){_0xd98ec6[_0x2caf('0x3d')]-=0x1;}}if(_0xd98ec6[_0x2caf('0x3e')]&&_0xd98ec6['UserId']){_0xd98ec6['answered']+=0x1;if(_0xd98ec6[_0x2caf('0x38')]){_0xd98ec6[_0x2caf('0x38')]-=0x1;}}if(_0xd98ec6[_0x2caf('0x3e')]&&!_0xd98ec6[_0x2caf('0x3c')]){_0xd98ec6[_0x2caf('0x3a')]+=0x1;if(_0xd98ec6[_0x2caf('0x3d')]){_0xd98ec6[_0x2caf('0x3d')]-=0x1;}}_0xd98ec6[_0x2caf('0x3b')]+=0x1;_0x4d1dec(_0xd98ec6);});}exports[_0x2caf('0x3f')]=function(_0x179c87,_0x37673d){var _0x4955c5={},_0x35ad7f={},_0x3cfd28={'count':0x0,'rows':[]};var _0x3dc8f2=_['map'](db[_0x2caf('0x40')][_0x2caf('0x41')],function(_0x179597){return{'name':_0x179597['fieldName'],'type':_0x179597[_0x2caf('0x42')][_0x2caf('0x43')]};});_0x35ad7f['model']=_[_0x2caf('0x31')](_0x3dc8f2,_0x2caf('0x2f'));_0x35ad7f['query']=_[_0x2caf('0x44')](_0x179c87[_0x2caf('0x45')]);_0x35ad7f[_0x2caf('0x46')]=_[_0x2caf('0x47')](_0x35ad7f[_0x2caf('0x48')],_0x35ad7f[_0x2caf('0x45')]);_0x4955c5[_0x2caf('0x49')]=_[_0x2caf('0x47')](_0x35ad7f['model'],qs[_0x2caf('0x4a')](_0x179c87['query'][_0x2caf('0x4a')]));_0x4955c5[_0x2caf('0x49')]=_0x4955c5[_0x2caf('0x49')]['length']?_0x4955c5['attributes']:_0x35ad7f[_0x2caf('0x48')];if(!_0x179c87['query'][_0x2caf('0x4b')](_0x2caf('0x4c'))){_0x4955c5[_0x2caf('0x24')]=qs[_0x2caf('0x24')](_0x179c87[_0x2caf('0x45')][_0x2caf('0x24')]);_0x4955c5[_0x2caf('0x21')]=qs[_0x2caf('0x21')](_0x179c87[_0x2caf('0x45')][_0x2caf('0x21')]);}_0x4955c5[_0x2caf('0x4d')]=qs[_0x2caf('0x4e')](_0x179c87[_0x2caf('0x45')][_0x2caf('0x4e')]);_0x4955c5[_0x2caf('0x4f')]=qs[_0x2caf('0x46')](_[_0x2caf('0x50')](_0x179c87[_0x2caf('0x45')],_0x35ad7f[_0x2caf('0x46')]),_0x3dc8f2);var _0x3a598b=[];var _0x136dc9=squel['select']()[_0x2caf('0x51')]('id')[_0x2caf('0x51')]('name')['field'](_0x2caf('0x52'))[_0x2caf('0x53')]('tools_tags');var _0x35f96b=squel[_0x2caf('0x54')]()[_0x2caf('0x51')](_0x2caf('0x55'))[_0x2caf('0x51')](_0x2caf('0x56'))[_0x2caf('0x51')](_0x2caf('0x57'))[_0x2caf('0x53')](_0x2caf('0x58'),'ui')[_0x2caf('0x59')](_0x2caf('0x5a'),'u',_0x2caf('0x5b'));var _0x5b8d66=squel[_0x2caf('0x54')]()[_0x2caf('0x53')](_0x2caf('0x5c'),'i')['left_join'](_0x2caf('0x5d'),'c',_0x2caf('0x5e'))[_0x2caf('0x59')](_0x2caf('0x5a'),'o',_0x2caf('0x5f'))[_0x2caf('0x59')](_0x2caf('0x60'),'a',_0x2caf('0x61'))[_0x2caf('0x59')](_0x2caf('0x62'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x2caf('0x59')](_0x2caf('0x63'),'it',_0x2caf('0x64'))['left_join'](_0x2caf('0x65'),'t',_0x2caf('0x66'));var _0x84f5c1=squel['expr']();var _0x3708e0=[];var _0x1a3f9a=squel[_0x2caf('0x67')]();var _0x22668a;if(_0x179c87['query'][_0x2caf('0x68')]){_0x22668a=as[_0x2caf('0x69')](_0x179c87[_0x2caf('0x45')]['search']);var _0x377111=_0x22668a[_0x2caf('0x6a')];for(var _0x4c1a77=0x0;_0x4c1a77<_0x22668a[_0x2caf('0x6b')][_0x2caf('0x6c')];_0x4c1a77++){var _0x445d53=_0x22668a['conditions'][_0x4c1a77];var _0x2f3b87='i';var _0x531f80=_[_0x2caf('0x6d')](_0x3dc8f2,[_0x2caf('0x2f'),_0x445d53['field']]);if(!_0x531f80){switch(_0x445d53['field']){case _0x2caf('0x6e'):if(_0x445d53[_0x2caf('0x6f')]==0x1){_0x5b8d66[_0x2caf('0x70')]('`'+_0x445d53[_0x2caf('0x51')]+_0x2caf('0x71'));}else{_0x5b8d66['having']('`'+_0x445d53[_0x2caf('0x51')]+_0x2caf('0x72'));}break;case'Contact':if(_0x445d53[_0x2caf('0x73')]===_0x2caf('0x74')){if(_0x445d53['value']['split']('\x20')[_0x2caf('0x6c')]>0x1){_0x84f5c1[_0x377111]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2caf('0x75')](_0x445d53[_0x2caf('0x6f')]),null);}else{var _0x447e01='%'+_0x445d53[_0x2caf('0x6f')]+'%';_0x84f5c1[_0x377111](_0x2caf('0x76'),_0x447e01,_0x447e01,_0x447e01);}}else{_0x531f80=_['find'](_0x3dc8f2,[_0x2caf('0x2f'),'ContactId']);_0x445d53[_0x2caf('0x51')]='ContactId';_0x5ed955=as[_0x2caf('0x77')](_0x2f3b87,_0x531f80['type'],_0x445d53);_0x84f5c1[_0x377111](_0x5ed955['text'],_0x5ed955[_0x2caf('0x6f')]['start'],_0x5ed955[_0x2caf('0x6f')]['end']);}break;case'Tag':var _0x44ad75=_0x445d53[_0x2caf('0x6f')][_0x2caf('0x33')](',')[_0x2caf('0x31')](function(_0x2f30be){return Number(_0x2f30be);});_0x44ad75['forEach'](function(_0x3b2171){_0x1a3f9a['or'](_0x2caf('0x78'),'%,'+_0x3b2171+',%');});_0x3708e0=_['union'](_0x3708e0,_0x44ad75);break;case _0x2caf('0x79'):if(_0x445d53['operator']===_0x2caf('0x74')){_0x84f5c1[_0x377111](_0x2caf('0x7a'),'%'+_0x445d53[_0x2caf('0x6f')]+'%',null);}else{_0x531f80=_[_0x2caf('0x6d')](_0x3dc8f2,[_0x2caf('0x2f'),'UserId']);_0x445d53['field']=_0x2caf('0x3c');_0x5ed955=as[_0x2caf('0x77')](_0x2f3b87,_0x531f80[_0x2caf('0x42')],_0x445d53);_0x84f5c1[_0x377111](_0x5ed955[_0x2caf('0x7b')],_0x5ed955[_0x2caf('0x6f')][_0x2caf('0x7c')],_0x5ed955[_0x2caf('0x6f')]['end']);}break;case _0x2caf('0x7d'):_0x5ed955=as[_0x2caf('0x77')]('me',null,_0x445d53);_0x84f5c1[_0x377111](_0x5ed955[_0x2caf('0x7b')],_0x5ed955[_0x2caf('0x6f')][_0x2caf('0x7c')],_0x5ed955['value'][_0x2caf('0x1f')]);break;}}else{var _0x5ed955=as[_0x2caf('0x77')](_0x2f3b87,_0x531f80[_0x2caf('0x42')],_0x445d53);_0x84f5c1[_0x377111](_0x5ed955[_0x2caf('0x7b')],_0x5ed955[_0x2caf('0x6f')][_0x2caf('0x7c')],_0x5ed955['value'][_0x2caf('0x1f')]);}}}else{var _0x5a90a7=_(_0x179c87[_0x2caf('0x45')])[_0x2caf('0x44')]()['map'](function(_0xd05b25){return _[_0x2caf('0x7e')](_0x3dc8f2,[_0x2caf('0x2f'),_0xd05b25])?_0xd05b25:undefined;})[_0x2caf('0x7f')]()[_0x2caf('0x6f')]();if(!_[_0x2caf('0x80')](_0x5a90a7)){_0x5a90a7['forEach'](function(_0x412c91){if(_0x412c91==='WhatsappAccountId'){_0x5b8d66[_0x2caf('0x4f')]('i.WhatsappAccountId\x20IN\x20?',[][_0x2caf('0x81')](_0x179c87[_0x2caf('0x45')][_0x412c91]));}else if(_0x412c91===_0x2caf('0x82')){var _0x4a12ba=JSON[_0x2caf('0x83')](_0x179c87[_0x2caf('0x45')][_0x412c91])[_0x2caf('0x84')];var _0xdd5ae=JSON[_0x2caf('0x83')](_0x179c87['query'][_0x412c91])[_0x2caf('0x85')];_0x5b8d66[_0x2caf('0x4f')](_0x2caf('0x86'),_0x4a12ba,_0xdd5ae);}else{if(_0x179c87[_0x2caf('0x45')][_0x412c91]===_0x2caf('0x87')){_0x5b8d66[_0x2caf('0x4f')]('i.'+_0x412c91+'\x20IS\x20NULL');}else{_0x5b8d66[_0x2caf('0x4f')]('i.'+_0x412c91+'\x20=\x20?',_0x179c87[_0x2caf('0x45')][_0x412c91]);}}});}if(_0x179c87[_0x2caf('0x45')][_0x2caf('0x88')]){if(_0x179c87[_0x2caf('0x45')][_0x2caf('0x88')]==0x1){_0x5b8d66[_0x2caf('0x70')](_0x2caf('0x89'));}else{_0x5b8d66[_0x2caf('0x70')]('`unreadMessages`\x20>\x200');}}if(_0x179c87[_0x2caf('0x45')][_0x2caf('0x8a')]){_0x3708e0=_[_0x2caf('0x8b')](_0x179c87['query'][_0x2caf('0x8a')])?_0x179c87[_0x2caf('0x45')][_0x2caf('0x8a')]:new Array(_0x179c87['query'][_0x2caf('0x8a')]);_0x3708e0[_0x2caf('0x34')](function(_0x2cdc9e){_0x1a3f9a['or'](_0x2caf('0x78'),'%,'+_0x2cdc9e+',%');});}if(_0x179c87['query']['filter']){var _0x191ac3=_0x179c87[_0x2caf('0x45')][_0x2caf('0x8c')][_0x2caf('0x8d')]('\x5c','\x5c\x5c')[_0x2caf('0x8d')](/'/g,'\x27\x27');if(qs[_0x2caf('0x8e')](_0x191ac3)){_0x84f5c1['or'](_0x2caf('0x8f'),_0x191ac3+'%')['or'](_0x2caf('0x90'),_0x191ac3+'%');}else{_0x84f5c1['or'](_0x2caf('0x91'),qs[_0x2caf('0x75')](_0x191ac3))['or'](_0x2caf('0x92'),_0x191ac3+'%');}}}_0x5b8d66[_0x2caf('0x4f')](_0x84f5c1);_0x5b8d66[_0x2caf('0x93')](_0x2caf('0x94'));var _0x53b179={'type':db[_0x2caf('0x95')][_0x2caf('0x96')]['SELECT'],'raw':!![]};var _0x23e2ce=_0x5b8d66[_0x2caf('0x97')]();_0x23e2ce[_0x2caf('0x51')]('i.id');_0x23e2ce['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2caf('0x6e'));if(_0x4955c5[_0x2caf('0x4d')]){_0x4955c5[_0x2caf('0x4d')]['forEach'](function(_0x80e43f){var _0x1aa9e1=_0x80e43f[0x0]===_0x2caf('0x98')?_0x80e43f[0x0]:'i.'+_0x80e43f[0x0];_0x5b8d66['order'](_0x1aa9e1,_0x80e43f[0x1]===_0x2caf('0x99')?![]:!![]);});}if(!_[_0x2caf('0x80')](_0x3708e0)){_0x5b8d66['having'](_0x1a3f9a);_0x23e2ce[_0x2caf('0x4f')](_0x2caf('0x9a'),_0x3708e0);}BPromise[_0x2caf('0x9b')]()['then'](function(){if(!_0x22668a){if(_0x179c87[_0x2caf('0x45')][_0x2caf('0x9c')])return;_0x23e2ce[_0x2caf('0x4f')](_0x2caf('0x9d'));_0x5b8d66[_0x2caf('0x4f')](_0x2caf('0x9d'));return;}if(_0x179c87['user']['role']!==_0x2caf('0x9e'))return;return _0x179c87[_0x2caf('0x9f')][_0x2caf('0xa0')]({'attributes':['id'],'raw':!![]})[_0x2caf('0x2b')](function(_0x1638bf){if(_[_0x2caf('0x80')](_0x1638bf)){_0x23e2ce[_0x2caf('0x4f')](_0x2caf('0xa1'));_0x5b8d66[_0x2caf('0x4f')](_0x2caf('0xa1'));}else{_0x23e2ce[_0x2caf('0x4f')](_0x2caf('0xa2'),_['map'](_0x1638bf,'id'));_0x5b8d66[_0x2caf('0x4f')](_0x2caf('0xa2'),_[_0x2caf('0x31')](_0x1638bf,'id'));}});})['then'](function(){if(_0x179c87[_0x2caf('0x9f')]['role']==='agent'&&!_0x22668a&&!_0x179c87['query'][_0x2caf('0x9c')])return[];return db[_0x2caf('0xa3')][_0x2caf('0x45')](_0x23e2ce[_0x2caf('0xa4')](),_0x53b179);})['then'](function(_0x229753){_0x3cfd28[_0x2caf('0x23')]=_0x229753['length'];if(_0x3cfd28[_0x2caf('0x23')]===0x0)return[];return db[_0x2caf('0xa3')][_0x2caf('0x45')](_0x136dc9[_0x2caf('0xa4')](),_0x53b179)['then'](function(_0x4e71e8){_0x3a598b=_[_0x2caf('0xa5')](_0x4e71e8,'id');_0x53b179=_['merge'](_0x53b179,{'model':db[_0x2caf('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x179c87['query'][_0x2caf('0x4a')]){_0x4955c5['attributes']['forEach'](function(_0x19e2bd){_0x5b8d66['field']('i.'+_0x19e2bd);});}else{_0x5b8d66['field'](_0x2caf('0xa6'),_0x2caf('0x6e'));_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xa7'),_0x2caf('0xa8'));_0x5b8d66['field'](_0x2caf('0xa9'),'Account.mandatoryDisposition');_0x5b8d66['field'](_0x2caf('0xaa'),'contactName');_0x5b8d66['field'](_0x2caf('0xab'));_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xac'),'Contact.firstName');_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xad'),'Contact.lastName');_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xae'),_0x2caf('0xaf'));_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xb0'),_0x2caf('0xb1'));_0x5b8d66['field']('c.mobile',_0x2caf('0xb2'));_0x5b8d66['field'](_0x2caf('0xb3'),'Contact.fax');_0x5b8d66['field']('o.fullname','Owner.fullname');_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xb4'),_0x2caf('0xb5'));_0x5b8d66[_0x2caf('0x51')](_0x2caf('0xb6'),_0x2caf('0x32'));}if(_0x4955c5[_0x2caf('0x24')])_0x5b8d66[_0x2caf('0x24')](_0x4955c5[_0x2caf('0x24')]);if(_0x4955c5['offset'])_0x5b8d66[_0x2caf('0x21')](_0x4955c5[_0x2caf('0x21')]);return db['sequelize']['query'](_0x5b8d66[_0x2caf('0xa4')](),_0x53b179);})[_0x2caf('0x2b')](function(_0x170070){if(_0x170070[_0x2caf('0x6c')]>0x0)_0x35f96b['where'](_0x2caf('0xb7'),_[_0x2caf('0x31')](_0x170070,'id'));return db[_0x2caf('0xa3')][_0x2caf('0x45')](_0x35f96b[_0x2caf('0xa4')](),_0x53b179)[_0x2caf('0x2b')](function(_0x58c736){var _0x1580c2=_[_0x2caf('0xb8')](_0x58c736,_0x2caf('0xb9'));var _0x5b580a=[];_0x170070[_0x2caf('0x34')](function(_0x3bea54){_0x5b580a['push'](updateWhatsappInteraction(_0x3bea54,_0x3a598b,_0x1580c2));});return BPromise[_0x2caf('0xba')](_0x5b580a);});});})[_0x2caf('0x2b')](function(_0x5a0501){_0x3cfd28['rows']=_0x5a0501;return _0x3cfd28;})[_0x2caf('0x2b')](respondWithFilteredResult(_0x37673d,_0x4955c5))[_0x2caf('0x37')](handleError(_0x37673d,null));};exports[_0x2caf('0xbb')]=function(_0x53263e,_0xbdcca){var _0x318cc0={'raw':![],'where':{'id':_0x53263e[_0x2caf('0xbc')]['id']}},_0x8edf29={};_0x8edf29[_0x2caf('0x48')]=_[_0x2caf('0x44')](db['WhatsappInteraction'][_0x2caf('0x41')]);_0x8edf29[_0x2caf('0x45')]=_[_0x2caf('0x44')](_0x53263e['query']);_0x8edf29[_0x2caf('0x46')]=_[_0x2caf('0x47')](_0x8edf29['model'],_0x8edf29['query']);_0x318cc0[_0x2caf('0x49')]=_[_0x2caf('0x47')](_0x8edf29[_0x2caf('0x48')],qs[_0x2caf('0x4a')](_0x53263e[_0x2caf('0x45')][_0x2caf('0x4a')]));_0x318cc0[_0x2caf('0x49')]=_0x318cc0['attributes'][_0x2caf('0x6c')]?_0x318cc0[_0x2caf('0x49')]:_0x8edf29[_0x2caf('0x48')];if(_0x53263e[_0x2caf('0x45')]['includeAll']){_0x318cc0[_0x2caf('0xbd')]=[{'all':!![]}];}_0x318cc0=_['merge']({},_0x318cc0,_0x53263e['options']);return db['WhatsappInteraction'][_0x2caf('0x6d')](_0x318cc0)[_0x2caf('0x2b')](handleEntityNotFound(_0xbdcca,null))[_0x2caf('0x2b')](respondWithResult(_0xbdcca,null))[_0x2caf('0x37')](handleError(_0xbdcca,null));};exports['create']=function(_0x314503,_0xa19e7b){return db['WhatsappInteraction'][_0x2caf('0xbe')](_0x314503[_0x2caf('0x7d')],{})[_0x2caf('0x2b')](respondWithResult(_0xa19e7b,0xc9))['catch'](handleError(_0xa19e7b,null));};exports['update']=function(_0x42760e,_0x18cded){if(_0x42760e[_0x2caf('0x7d')]['id']){delete _0x42760e[_0x2caf('0x7d')]['id'];}return db[_0x2caf('0x40')][_0x2caf('0x6d')]({'where':{'id':_0x42760e[_0x2caf('0xbc')]['id']}})[_0x2caf('0x2b')](handleEntityNotFound(_0x18cded,null))[_0x2caf('0x2b')](saveUpdates(_0x42760e[_0x2caf('0x7d')],null))[_0x2caf('0x2b')](respondWithResult(_0x18cded,null))[_0x2caf('0x37')](handleError(_0x18cded,null));};exports[_0x2caf('0x2c')]=function(_0x137ff1,_0x1698a9){return db['WhatsappInteraction'][_0x2caf('0x6d')]({'where':{'id':_0x137ff1['params']['id']}})[_0x2caf('0x2b')](handleEntityNotFound(_0x1698a9,null))['then'](removeEntity(_0x1698a9,null))['catch'](handleError(_0x1698a9,null));};exports[_0x2caf('0xbf')]=function(_0xe843a6,_0x1a1250){return db[_0x2caf('0x40')][_0x2caf('0xbf')]()[_0x2caf('0x2b')](respondWithResult(_0x1a1250,null))[_0x2caf('0x37')](handleError(_0x1a1250,null));};exports[_0x2caf('0xc0')]=function(_0x4821d9,_0xa4a136,_0x10b9d1){return db[_0x2caf('0xc1')][_0x2caf('0x6d')]({'where':{'id':_0x4821d9[_0x2caf('0xbc')]['id']}})['then'](handleEntityNotFound(_0xa4a136,null))[_0x2caf('0x2b')](function(_0x2a3b20){if(_0x2a3b20){return _0x2a3b20[_0x2caf('0xc0')](_0x4821d9[_0x2caf('0x7d')][_0x2caf('0xc2')],_['omit'](_0x4821d9[_0x2caf('0x7d')],[_0x2caf('0xc2'),'id'])||{});}})[_0x2caf('0x2b')](respondWithResult(_0xa4a136,null))['catch'](handleError(_0xa4a136,null));};exports[_0x2caf('0xc3')]=function(_0x2b5104,_0x29b188,_0x13c399){var _0x3c9cb9={'raw':![],'where':{}};var _0x1dce28={};var _0xd06543={'count':0x0,'rows':[]};return db[_0x2caf('0x40')][_0x2caf('0xc4')]({'where':{'id':_0x2b5104['params']['id']}})[_0x2caf('0x2b')](handleEntityNotFound(_0x29b188,null))[_0x2caf('0x2b')](function(_0x684d84){if(_0x684d84){_0x1dce28[_0x2caf('0x48')]=_['keys'](db['WhatsappMessage'][_0x2caf('0x41')]);_0x1dce28[_0x2caf('0x45')]=_[_0x2caf('0x44')](_0x2b5104['query']);_0x1dce28[_0x2caf('0x46')]=_['intersection'](_0x1dce28['model'],_0x1dce28[_0x2caf('0x45')]);_0x3c9cb9[_0x2caf('0x49')]=_['intersection'](_0x1dce28['model'],qs[_0x2caf('0x4a')](_0x2b5104['query']['fields']));_0x3c9cb9[_0x2caf('0x49')]=_0x3c9cb9[_0x2caf('0x49')][_0x2caf('0x6c')]?_0x3c9cb9[_0x2caf('0x49')]:_0x1dce28[_0x2caf('0x48')];if(!_0x2b5104[_0x2caf('0x45')][_0x2caf('0x4b')](_0x2caf('0x4c'))){_0x3c9cb9[_0x2caf('0x24')]=qs[_0x2caf('0x24')](_0x2b5104[_0x2caf('0x45')][_0x2caf('0x24')]);_0x3c9cb9[_0x2caf('0x21')]=qs[_0x2caf('0x21')](_0x2b5104['query'][_0x2caf('0x21')]);}_0x3c9cb9[_0x2caf('0x4d')]=qs[_0x2caf('0x4e')](_0x2b5104[_0x2caf('0x45')][_0x2caf('0x4e')]);_0x3c9cb9['where']=qs[_0x2caf('0x46')](_[_0x2caf('0x50')](_0x2b5104['query'],_0x1dce28['filters']));_0x3c9cb9[_0x2caf('0x4f')][_0x2caf('0xb9')]=_0x684d84['id'];if(_0x2b5104[_0x2caf('0x45')][_0x2caf('0x8c')]){_0x3c9cb9[_0x2caf('0x4f')]=_[_0x2caf('0xc5')](_0x3c9cb9[_0x2caf('0x4f')],{'$or':_[_0x2caf('0x31')](_0x3c9cb9[_0x2caf('0x49')],function(_0x41099f){var _0x52e29b={};_0x52e29b[_0x41099f]={'$like':'%'+_0x2b5104[_0x2caf('0x45')][_0x2caf('0x8c')]+'%'};return _0x52e29b;})});}if(_0x2b5104['query'][_0x2caf('0x84')]){var _0x2d4bbb=_0x2b5104[_0x2caf('0x45')][_0x2caf('0x84')]['split'](',');var _0x52be30={};_0x52be30[_0x2d4bbb[0x0]]={'$gte':moment(_0x2d4bbb[0x1])[_0x2caf('0xc6')](_0x2caf('0xc7'))};_0x3c9cb9[_0x2caf('0x4f')]=_[_0x2caf('0xc5')](_0x3c9cb9[_0x2caf('0x4f')],_0x52be30);}_0x3c9cb9=_[_0x2caf('0xc5')]({},_0x3c9cb9,_0x2b5104[_0x2caf('0xc8')]);return db[_0x2caf('0xc1')]['count']({'where':_0x3c9cb9['where']})[_0x2caf('0x2b')](function(_0x1eb81a){_0xd06543[_0x2caf('0x23')]=_0x1eb81a;if(_0x2b5104[_0x2caf('0x45')][_0x2caf('0xc9')]){_0x3c9cb9['include']=[{'all':!![]}];}return db[_0x2caf('0xc1')][_0x2caf('0xca')](_0x3c9cb9);})[_0x2caf('0x2b')](function(_0x177113){_0xd06543[_0x2caf('0xcb')]=_0x177113;return _0xd06543;});}})['then'](respondWithFilteredResult(_0x29b188,_0x3c9cb9))[_0x2caf('0x37')](handleError(_0x29b188,null));};exports[_0x2caf('0xcc')]=function(_0x571446,_0x49daa4,_0x1a365a){return db[_0x2caf('0x40')][_0x2caf('0x6d')]({'where':{'id':_0x571446['params']['id']}})[_0x2caf('0x2b')](handleEntityNotFound(_0x49daa4,null))[_0x2caf('0x2b')](function(_0x552629){if(_0x552629){return _0x552629['setTags'](_0x571446[_0x2caf('0x7d')]['ids'],_[_0x2caf('0xcd')](_0x571446['body'],['ids','id'])||{})['spread'](function(){return db[_0x2caf('0xce')]['findAll']({'attributes':['id',_0x2caf('0x2f'),_0x2caf('0x52')],'where':{'id':_0x571446[_0x2caf('0x7d')][_0x2caf('0xc2')]}});})['then'](function(_0x37688a){socket['emit'](_0x2caf('0xcf'),{'id':Number(_0x571446['params']['id']),'tags':_0x37688a||[]});return{'id':Number(_0x571446[_0x2caf('0xbc')]['id']),'tags':_0x37688a||[]};});}})[_0x2caf('0x2b')](respondWithResult(_0x49daa4,null))['catch'](handleError(_0x49daa4,null));};exports[_0x2caf('0xd0')]=function(_0x584eb9,_0x2f0333,_0xa8ff0c){return db[_0x2caf('0x40')][_0x2caf('0x6d')]({'where':{'id':_0x584eb9[_0x2caf('0xbc')]['id']}})[_0x2caf('0x2b')](handleEntityNotFound(_0x2f0333,null))['then'](function(_0x42407f){if(_0x42407f){return _0x42407f[_0x2caf('0xd0')](_0x584eb9[_0x2caf('0x45')][_0x2caf('0xc2')]);}})[_0x2caf('0x2b')](respondWithStatusCode(_0x2f0333,null))[_0x2caf('0x37')](handleError(_0x2f0333,null));};exports[_0x2caf('0xd1')]=function(_0x718a16,_0x5555e9){var _0x537cee=moment()[_0x2caf('0xd2')]()['toString']();var _0x160529=path[_0x2caf('0xd3')](config[_0x2caf('0xd4')],_0x2caf('0xd5'),_0x2caf('0xd6'),_0x2caf('0xd7'));var _0x58b223=path['join'](config[_0x2caf('0xd4')],_0x2caf('0xd5'),'files',_0x2caf('0xd8'));var _0x412003=path[_0x2caf('0xd3')](_0x160529,_0x537cee);var _0x3f52bf=util[_0x2caf('0xc6')]('transcript-%d-%s.zip',_0x718a16['params']['id'],_0x537cee);var _0x271226=path[_0x2caf('0xd3')](_0x160529,_0x3f52bf);var _0x1c2f7b=[];_0x1c2f7b[_0x2caf('0x36')]({'model':db[_0x2caf('0x79')],'as':'User','attributes':['id',_0x2caf('0xd9')],'raw':!![]});_0x1c2f7b[_0x2caf('0x36')]({'model':db[_0x2caf('0xda')],'as':_0x2caf('0xdb'),'attributes':['id','firstName',_0x2caf('0xdc')],'raw':!![]});if(_0x718a16[_0x2caf('0x45')][_0x2caf('0xd8')]){_0x1c2f7b[_0x2caf('0x36')]({'model':db[_0x2caf('0xdd')],'as':_0x2caf('0xdd'),'raw':!![]});}var _0x2fb7a9=[{'model':db[_0x2caf('0xc1')],'as':_0x2caf('0xde'),'attributes':['id',_0x2caf('0x7d'),_0x2caf('0x82'),'direction','secret',_0x2caf('0x88')],'include':_0x1c2f7b}];_0x2fb7a9['push']({'model':db['WhatsappAccount'],'as':'Account','attributes':['id','name']});_0x2fb7a9['push']({'model':db[_0x2caf('0x79')],'as':_0x2caf('0xdf'),'attributes':['id',_0x2caf('0xd9')]});return db[_0x2caf('0x40')][_0x2caf('0x6d')]({'where':{'id':_0x718a16[_0x2caf('0xbc')]['id']},'include':_0x2fb7a9})['then'](handleEntityNotFound(_0x5555e9,null))['then'](function(_0x5dc35b){if(_0x5dc35b){var _0x47f77d=_0x5dc35b[_0x2caf('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x412003);var _0x42e899={'channel':_0x2caf('0xe1'),'account':_0x47f77d['Account'][_0x2caf('0x2f')],'agent':_0x47f77d['Owner']?_0x47f77d[_0x2caf('0xdf')][_0x2caf('0xd9')]:_0x2caf('0xe2'),'createdAt':moment(_0x47f77d[_0x2caf('0x82')])[_0x2caf('0xc6')](_0x2caf('0xc7'))['toString'](),'closedAt':_0x47f77d['closed']?moment(_0x47f77d['closedAt'])[_0x2caf('0xc6')](_0x2caf('0xc7'))[_0x2caf('0xa4')]():'','disposition':_0x47f77d['disposition'],'messages':_(_0x47f77d['Messages'])['filter']({'secret':![]})[_0x2caf('0x31')](function(_0x494d49){if(_0x494d49['Attachment']){var _0x17e86b=path[_0x2caf('0xd3')](_0x58b223,_0x494d49[_0x2caf('0xdd')]['basename']);if(fs[_0x2caf('0xe3')](_0x17e86b)){fs['createReadStream'](_0x17e86b)[_0x2caf('0xe4')](fs[_0x2caf('0xe5')](path[_0x2caf('0xd3')](_0x412003,_0x494d49[_0x2caf('0xdd')]['basename'])));}}return{'date':moment(_0x494d49[_0x2caf('0x82')])['format'](_0x2caf('0xc7'))[_0x2caf('0xa4')](),'sender':_0x494d49[_0x2caf('0xe6')]===_0x2caf('0xe7')?_0x494d49['User']?_0x494d49[_0x2caf('0x79')][_0x2caf('0xd9')]:_0x2caf('0xe8'):_0x494d49[_0x2caf('0xdb')][_0x2caf('0xe9')]+(_0x494d49['Contact']['lastName']?'\x20'+_0x494d49[_0x2caf('0xdb')][_0x2caf('0xdc')]:''),'body':_0x494d49[_0x2caf('0xdd')]?_0x494d49[_0x2caf('0xdd')][_0x2caf('0xea')]:_0x494d49[_0x2caf('0x7d')],'direction':_0x494d49[_0x2caf('0xe6')]===_0x2caf('0xe7')?'A':'C','secret':_0x494d49[_0x2caf('0xeb')],'read':_0x494d49[_0x2caf('0x88')],'attachment':_0x494d49['Attachment']};})[_0x2caf('0x6f')]()};return ejs['renderFile'](path[_0x2caf('0xd3')](config['root'],_0x2caf('0xd5'),_0x2caf('0xec'),_0x2caf('0xed')),{'interaction':_0x42e899})[_0x2caf('0x2b')](function(_0x16f8de){var _0x59114e=path[_0x2caf('0xd3')](_0x412003,'transcript-'+_0x47f77d['id']+'-'+_0x537cee+_0x2caf('0xee'));var _0x3d6f09={'path':_0x59114e,'channel':_0x2caf('0xe1'),'interactionId':_0x47f77d['id']};return pdf['createPdfFromHTML'](_0x16f8de,_0x3d6f09);})[_0x2caf('0x2b')](function(){return new BPromise(function(_0x611c9e,_0x35a9e2){zipdir(_0x412003,{'saveTo':_0x271226},function(_0x54f58b,_0x4a5523){if(_0x54f58b)return _0x35a9e2(_0x54f58b);return _0x611c9e(_0x4a5523);});})['then'](function(){return new BPromise(function(_0x3bc953,_0x1cdc23){rimraf(_0x412003,function(_0x9dba8b){if(_0x9dba8b)_0x1cdc23(_0x9dba8b);return _0x3bc953();});});})[_0x2caf('0x2b')](function(){return _0x5555e9[_0x2caf('0xd1')](_0x271226,_0x3f52bf,function(_0x541665){if(_0x541665){console[_0x2caf('0xef')](_0x2caf('0xf0'),_0x541665);}else{fs[_0x2caf('0xf1')](_0x271226);}});});});}else{return _0x5555e9[_0x2caf('0x1d')](0xc8);}})[_0x2caf('0x37')](handleError(_0x5555e9,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index a41643c..f170b27 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eaa=['unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','findAll','then'];(function(_0x153452,_0x4344ec){var _0x1cbd60=function(_0x5ab39f){while(--_0x5ab39f){_0x153452['push'](_0x153452['shift']());}};_0x1cbd60(++_0x4344ec);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0xd3c63e,_0x33fdfe){_0xd3c63e=_0xd3c63e-0x0;var _0x4e2473=_0x0eaa[_0xd3c63e];return _0x4e2473;};'use strict';var EventEmitter=require(_0xa0ea('0x0'));var WhatsappInteraction=require(_0xa0ea('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0xa0ea('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa0ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0ea('0x4'),'afterDestroy':_0xa0ea('0x5')};function emitEvent(_0x30dd52){return function(_0x1404ab,_0x1d27f8,_0x5636ed){_0x1404ab[_0xa0ea('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4b8856){_0x1404ab[_0xa0ea('0x7')](_0xa0ea('0x8'),_0x4b8856['map'](function(_0x4dbe00){return{'id':_0x4dbe00['id']};}));return WhatsappMessage[_0xa0ea('0x9')]({'where':{'WhatsappInteractionId':_0x1404ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa0ea('0xa')](function(_0x28cd6d){_0x1404ab[_0xa0ea('0x7')](_0xa0ea('0xb'),_0x28cd6d['length']);WhatsappInteractionEvents[_0xa0ea('0xc')](_0x30dd52+':'+_0x1404ab['id'],_0x1404ab);WhatsappInteractionEvents[_0xa0ea('0xc')](_0x30dd52,_0x1404ab);_0x5636ed(null);})[_0xa0ea('0xd')](_0x5636ed(null));};}for(var e in events){if(events[_0xa0ea('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xa0ea('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xf2fa=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xaf2f('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xaf2f('0x1'))['db'][_0xaf2f('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaf2f('0x3')](0x0);var events={'afterCreate':_0xaf2f('0x4'),'afterUpdate':_0xaf2f('0x5'),'afterDestroy':_0xaf2f('0x6')};function emitEvent(_0x96c9f7){return function(_0x4e2440,_0x48b333,_0x3709f9){_0x4e2440['getUsers']({'attributes':['id'],'raw':!![]})[_0xaf2f('0x7')](function(_0x2dfba7){_0x4e2440[_0xaf2f('0x8')](_0xaf2f('0x9'),_0x2dfba7[_0xaf2f('0xa')](function(_0x5e8ad0){return{'id':_0x5e8ad0['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4e2440['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xfd9db5){_0x4e2440[_0xaf2f('0x8')](_0xaf2f('0xb'),_0xfd9db5[_0xaf2f('0xc')]);WhatsappInteractionEvents[_0xaf2f('0xd')](_0x96c9f7+':'+_0x4e2440['id'],_0x4e2440);WhatsappInteractionEvents[_0xaf2f('0xd')](_0x96c9f7,_0x4e2440);_0x3709f9(null);})[_0xaf2f('0xe')](_0x3709f9(null));};}for(var e in events){if(events[_0xaf2f('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xaf2f('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 124db4a..90ffe82 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb728=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5a34b8,_0x2dcfbf){var _0x36d1b4=function(_0x4facc7){while(--_0x4facc7){_0x5a34b8['push'](_0x5a34b8['shift']());}};_0x36d1b4(++_0x2dcfbf);}(_0xb728,0xe2));var _0x8b72=function(_0x3661f4,_0x1aa736){_0x3661f4=_0x3661f4-0x0;var _0x50bad5=_0xb728[_0x3661f4];return _0x50bad5;};'use strict';var _=require(_0x8b72('0x0'));var util=require(_0x8b72('0x1'));var logger=require(_0x8b72('0x2'))(_0x8b72('0x3'));var moment=require('moment');var BPromise=require(_0x8b72('0x4'));var rp=require(_0x8b72('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b72('0x6'));var config=require(_0x8b72('0x7'));var attributes=require(_0x8b72('0x8'));module[_0x8b72('0x9')]=function(_0x462703,_0x425832){return _0x462703[_0x8b72('0xa')](_0x8b72('0xb'),attributes,{'tableName':_0x8b72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cfaa6,_0x5e1366,_0x1dfd26){if(_0x2cfaa6[_0x8b72('0xd')](_0x8b72('0xe'))){_0x2cfaa6[_0x8b72('0xf')]=moment()[_0x8b72('0x10')](_0x8b72('0x11'));}_0x1dfd26(null,_0x2cfaa6);}}});}; \ No newline at end of file +var _0x5b38=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format'];(function(_0x4f90ee,_0x2f61e8){var _0x581f58=function(_0x53a049){while(--_0x53a049){_0x4f90ee['push'](_0x4f90ee['shift']());}};_0x581f58(++_0x2f61e8);}(_0x5b38,0x81));var _0x85b3=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x5b38[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x85b3('0x0'));var util=require(_0x85b3('0x1'));var logger=require(_0x85b3('0x2'))('api');var moment=require(_0x85b3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x85b3('0x4'));var rimraf=require(_0x85b3('0x5'));var config=require(_0x85b3('0x6'));var attributes=require(_0x85b3('0x7'));module[_0x85b3('0x8')]=function(_0x254cb5,_0x3db978){return _0x254cb5[_0x85b3('0x9')](_0x85b3('0xa'),attributes,{'tableName':_0x85b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1999d4,_0xa8087a,_0x42a6e7){if(_0x1999d4[_0x85b3('0xc')]('closed')){_0x1999d4[_0x85b3('0xd')]=moment()[_0x85b3('0xe')](_0x85b3('0xf'));}_0x42a6e7(null,_0x1999d4);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index efcd2db..1961b2a 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc624=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc624,0x73));var _0x4c62=function(_0x2e14e3,_0x1ed432){_0x2e14e3=_0x2e14e3-0x0;var _0x173c9b=_0xc624[_0x2e14e3];return _0x173c9b;};'use strict';var _=require(_0x4c62('0x0'));var util=require(_0x4c62('0x1'));var moment=require(_0x4c62('0x2'));var BPromise=require(_0x4c62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c62('0x4'));var db=require(_0x4c62('0x5'))['db'];var utils=require(_0x4c62('0x6'));var logger=require('../../config/logger')(_0x4c62('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c62('0x8'));var client=jayson[_0x4c62('0x9')][_0x4c62('0xa')]({'port':0x232a});config[_0x4c62('0xb')]=_[_0x4c62('0xc')](config[_0x4c62('0xb')],{'host':_0x4c62('0xd'),'port':0x18eb});var socket=require(_0x4c62('0xe'))(new Redis(config[_0x4c62('0xb')]));require(_0x4c62('0xf'))[_0x4c62('0x10')](socket);function respondWithRpcPromise(_0x28d914,_0x43022f,_0x4cd6e4){return new BPromise(function(_0x4d8557,_0x4cba40){return client[_0x4c62('0x11')](_0x28d914,_0x4cd6e4)[_0x4c62('0x12')](function(_0x576736){logger[_0x4c62('0x13')](_0x4c62('0x14'),_0x43022f,_0x4c62('0x15'));logger[_0x4c62('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x43022f,_0x4c62('0x15'),JSON[_0x4c62('0x17')](_0x576736));if(_0x576736[_0x4c62('0x18')]){if(_0x576736[_0x4c62('0x18')][_0x4c62('0x19')]===0x1f4){logger[_0x4c62('0x18')](_0x4c62('0x14'),_0x43022f,_0x576736[_0x4c62('0x18')][_0x4c62('0x1a')]);return _0x4cba40(_0x576736[_0x4c62('0x18')][_0x4c62('0x1a')]);}logger['error'](_0x4c62('0x14'),_0x43022f,_0x576736[_0x4c62('0x18')]['message']);return _0x4d8557(_0x576736[_0x4c62('0x18')]['message']);}else{logger[_0x4c62('0x13')](_0x4c62('0x14'),_0x43022f,_0x4c62('0x15'));_0x4d8557(_0x576736['result'][_0x4c62('0x1a')]);}})[_0x4c62('0x1b')](function(_0x27bcb2){logger['error'](_0x4c62('0x14'),_0x43022f,_0x27bcb2);_0x4cba40(_0x27bcb2);});});}exports[_0x4c62('0x1c')]=function(_0xe7a9a5){var _0x4705a0=this;return new Promise(function(_0x6f71c0,_0x1a7831){return db[_0x4c62('0x1d')][_0x4c62('0x1e')](_0xe7a9a5[_0x4c62('0x1f')],{'raw':_0xe7a9a5[_0x4c62('0x20')]?_0xe7a9a5[_0x4c62('0x20')][_0x4c62('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe7a9a5[_0x4c62('0x20')]?_0xe7a9a5[_0x4c62('0x20')][_0x4c62('0x22')]||null:null,'attributes':_0xe7a9a5[_0x4c62('0x20')]?_0xe7a9a5[_0x4c62('0x20')][_0x4c62('0x23')]||null:null,'limit':_0xe7a9a5[_0x4c62('0x20')]?_0xe7a9a5[_0x4c62('0x20')]['limit']||null:null})[_0x4c62('0x12')](function(_0x5c8a5a){logger['info'](_0x4c62('0x1c'),_0xe7a9a5);logger[_0x4c62('0x16')](_0x4c62('0x1c'),_0xe7a9a5,JSON[_0x4c62('0x17')](_0x5c8a5a));_0x6f71c0(_0x5c8a5a);})[_0x4c62('0x1b')](function(_0x56cf7c){logger[_0x4c62('0x18')](_0x4c62('0x1c'),_0x56cf7c[_0x4c62('0x1a')],_0xe7a9a5);_0x1a7831(_0x4705a0['error'](0x1f4,_0x56cf7c[_0x4c62('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x342393){return new Promise(function(_0x39c9e9,_0x3cfe6e){return db['WhatsappInteraction']['find']({'where':_0x342393[_0x4c62('0x20')]?_0x342393['options'][_0x4c62('0x22')]||null:null})['then'](function(_0x182031){if(_0x182031){return _0x182031[_0x4c62('0x24')](_0x342393['body']['ids'],_['omit'](_0x342393[_0x4c62('0x1f')],[_0x4c62('0x25'),'id'])||{});}})[_0x4c62('0x26')](function(_0x523244){logger[_0x4c62('0x13')](_0x4c62('0x27'),_0x342393);logger[_0x4c62('0x16')]('AddTags',_0x342393,JSON[_0x4c62('0x17')](_0x523244));_0x39c9e9(_0x523244);})['catch'](function(_0xd170f){logger[_0x4c62('0x18')](_0x4c62('0x27'),_0xd170f['message'],_0x342393);_0x3cfe6e(_this[_0x4c62('0x18')](0x1f4,_0xd170f[_0x4c62('0x1a')]));});});}; \ No newline at end of file +var _0x4494=['WhatsappInteraction','body','options','where','limit','find','addTags','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction'];(function(_0x5b07a0,_0x5a74ee){var _0x39f46c=function(_0x19fa51){while(--_0x19fa51){_0x5b07a0['push'](_0x5b07a0['shift']());}};_0x39f46c(++_0x5a74ee);}(_0x4494,0x153));var _0x4449=function(_0x12f9a7,_0x5241aa){_0x12f9a7=_0x12f9a7-0x0;var _0x17dfb7=_0x4494[_0x12f9a7];return _0x17dfb7;};'use strict';var _=require(_0x4449('0x0'));var util=require(_0x4449('0x1'));var moment=require(_0x4449('0x2'));var BPromise=require(_0x4449('0x3'));var rs=require(_0x4449('0x4'));var fs=require('fs');var Redis=require(_0x4449('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4449('0x6'));var logger=require(_0x4449('0x7'))(_0x4449('0x8'));var config=require(_0x4449('0x9'));var jayson=require(_0x4449('0xa'));var client=jayson[_0x4449('0xb')]['http']({'port':0x232a});config[_0x4449('0xc')]=_[_0x4449('0xd')](config[_0x4449('0xc')],{'host':_0x4449('0xe'),'port':0x18eb});var socket=require(_0x4449('0xf'))(new Redis(config[_0x4449('0xc')]));require('./whatsappInteraction.socket')[_0x4449('0x10')](socket);function respondWithRpcPromise(_0x4244b6,_0xc1ebec,_0x12d303){return new BPromise(function(_0x119521,_0x4c42b3){return client[_0x4449('0x11')](_0x4244b6,_0x12d303)[_0x4449('0x12')](function(_0x33e35f){logger[_0x4449('0x13')](_0x4449('0x14'),_0xc1ebec,_0x4449('0x15'));logger['debug'](_0x4449('0x16'),_0xc1ebec,_0x4449('0x15'),JSON[_0x4449('0x17')](_0x33e35f));if(_0x33e35f[_0x4449('0x18')]){if(_0x33e35f[_0x4449('0x18')][_0x4449('0x19')]===0x1f4){logger[_0x4449('0x18')](_0x4449('0x14'),_0xc1ebec,_0x33e35f[_0x4449('0x18')][_0x4449('0x1a')]);return _0x4c42b3(_0x33e35f[_0x4449('0x18')][_0x4449('0x1a')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xc1ebec,_0x33e35f['error']['message']);return _0x119521(_0x33e35f[_0x4449('0x18')][_0x4449('0x1a')]);}else{logger[_0x4449('0x13')](_0x4449('0x14'),_0xc1ebec,_0x4449('0x15'));_0x119521(_0x33e35f[_0x4449('0x1b')][_0x4449('0x1a')]);}})[_0x4449('0x1c')](function(_0x5c2020){logger[_0x4449('0x18')](_0x4449('0x14'),_0xc1ebec,_0x5c2020);_0x4c42b3(_0x5c2020);});});}exports[_0x4449('0x1d')]=function(_0x4249e5){var _0x34173f=this;return new Promise(function(_0x509d1d,_0x47a3f1){return db[_0x4449('0x1e')]['update'](_0x4249e5[_0x4449('0x1f')],{'raw':_0x4249e5['options']?_0x4249e5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4249e5[_0x4449('0x20')]?_0x4249e5[_0x4449('0x20')][_0x4449('0x21')]||null:null,'attributes':_0x4249e5[_0x4449('0x20')]?_0x4249e5[_0x4449('0x20')]['attributes']||null:null,'limit':_0x4249e5[_0x4449('0x20')]?_0x4249e5[_0x4449('0x20')][_0x4449('0x22')]||null:null})[_0x4449('0x12')](function(_0x19ecdf){logger[_0x4449('0x13')](_0x4449('0x1d'),_0x4249e5);logger['debug'](_0x4449('0x1d'),_0x4249e5,JSON[_0x4449('0x17')](_0x19ecdf));_0x509d1d(_0x19ecdf);})[_0x4449('0x1c')](function(_0x4f7f73){logger[_0x4449('0x18')](_0x4449('0x1d'),_0x4f7f73['message'],_0x4249e5);_0x47a3f1(_0x34173f[_0x4449('0x18')](0x1f4,_0x4f7f73[_0x4449('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x31100a){return new Promise(function(_0x2afe1e,_0x310109){return db[_0x4449('0x1e')][_0x4449('0x23')]({'where':_0x31100a[_0x4449('0x20')]?_0x31100a[_0x4449('0x20')][_0x4449('0x21')]||null:null})[_0x4449('0x12')](function(_0x1a02fc){if(_0x1a02fc){return _0x1a02fc[_0x4449('0x24')](_0x31100a[_0x4449('0x1f')][_0x4449('0x25')],_['omit'](_0x31100a[_0x4449('0x1f')],[_0x4449('0x25'),'id'])||{});}})[_0x4449('0x26')](function(_0x58235f){logger[_0x4449('0x13')](_0x4449('0x27'),_0x31100a);logger[_0x4449('0x28')](_0x4449('0x27'),_0x31100a,JSON[_0x4449('0x17')](_0x58235f));_0x2afe1e(_0x58235f);})[_0x4449('0x1c')](function(_0x24328a){logger[_0x4449('0x18')](_0x4449('0x27'),_0x24328a[_0x4449('0x1a')],_0x31100a);_0x310109(_this[_0x4449('0x18')](0x1f4,_0x24328a[_0x4449('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 528b7b0..ef7c9ec 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeed5=['update','emit','removeListener','register','./whatsappInteraction.events','save','remove'];(function(_0x5ffa31,_0xbcd77a){var _0x104915=function(_0x4dcf60){while(--_0x4dcf60){_0x5ffa31['push'](_0x5ffa31['shift']());}};_0x104915(++_0xbcd77a);}(_0xeed5,0xd6));var _0x5eed=function(_0x5ce2ec,_0x18343b){_0x5ce2ec=_0x5ce2ec-0x0;var _0xbb93ff=_0xeed5[_0x5ce2ec];return _0xbb93ff;};'use strict';var WhatsappInteractionEvents=require(_0x5eed('0x0'));var events=[_0x5eed('0x1'),_0x5eed('0x2'),_0x5eed('0x3')];function createListener(_0x18a738,_0x43a102){return function(_0x2b936f){_0x43a102[_0x5eed('0x4')](_0x18a738,_0x2b936f);};}function removeListener(_0x38eb58,_0x32c463){return function(){WhatsappInteractionEvents[_0x5eed('0x5')](_0x38eb58,_0x32c463);};}exports[_0x5eed('0x6')]=function(_0x443f67){for(var _0x397529=0x0,_0x11846f=events['length'];_0x397529<_0x11846f;_0x397529++){var _0x4e9a2c=events[_0x397529];var _0x2d5fd7=createListener('whatsappInteraction:'+_0x4e9a2c,_0x443f67);WhatsappInteractionEvents['on'](_0x4e9a2c,_0x2d5fd7);}}; \ No newline at end of file +var _0x5d28=['emit','whatsappInteraction:','save','remove','update'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x5d28,0x124));var _0x85d2=function(_0x442790,_0x35f770){_0x442790=_0x442790-0x0;var _0x3ab507=_0x5d28[_0x442790];return _0x3ab507;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x85d2('0x0'),_0x85d2('0x1'),_0x85d2('0x2')];function createListener(_0x3c4c9e,_0x218e45){return function(_0x32db7f){_0x218e45[_0x85d2('0x3')](_0x3c4c9e,_0x32db7f);};}function removeListener(_0x5d6ef7,_0x1e56f2){return function(){WhatsappInteractionEvents['removeListener'](_0x5d6ef7,_0x1e56f2);};}exports['register']=function(_0x27884a){for(var _0x1b4c29=0x0,_0xa00d88=events['length'];_0x1b4c29<_0xa00d88;_0x1b4c29++){var _0x2f7fcd=events[_0x1b4c29];var _0x2750ad=createListener(_0x85d2('0x4')+_0x2f7fcd,_0x27884a);WhatsappInteractionEvents['on'](_0x2f7fcd,_0x2750ad);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 820e5e9..3837ced 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6452=['./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','post','/:id/status','status','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x51bf76,_0x303b1c){var _0x3ec8d3=function(_0x114f58){while(--_0x114f58){_0x51bf76['push'](_0x51bf76['shift']());}};_0x3ec8d3(++_0x303b1c);}(_0x6452,0x95));var _0x2645=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x6452[_0x4fbb86];return _0xb141fe;};'use strict';var multer=require(_0x2645('0x0'));var util=require(_0x2645('0x1'));var path=require(_0x2645('0x2'));var timeout=require(_0x2645('0x3'));var express=require(_0x2645('0x4'));var router=express[_0x2645('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2645('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2645('0x7'));router[_0x2645('0x8')]('/',auth[_0x2645('0x9')](),controller[_0x2645('0xa')]);router[_0x2645('0x8')](_0x2645('0xb'),auth[_0x2645('0x9')](),controller[_0x2645('0xc')]);router['get'](_0x2645('0xd'),auth['isAuthenticated'](),controller[_0x2645('0xe')]);router['post']('/',auth[_0x2645('0x9')](),interaction[_0x2645('0xf')](_0x2645('0x10'),'whatsappmessage:create'),controller['create']);router[_0x2645('0x11')](_0x2645('0x12'),controller[_0x2645('0x13')]);router[_0x2645('0x14')](_0x2645('0xd'),auth[_0x2645('0x9')](),controller['update']);router[_0x2645('0x14')](_0x2645('0x15'),auth[_0x2645('0x9')](),controller['accept']);router[_0x2645('0x14')](_0x2645('0x16'),auth[_0x2645('0x9')](),controller[_0x2645('0x17')]);router['delete'](_0x2645('0xd'),auth[_0x2645('0x9')](),controller[_0x2645('0x18')]);module[_0x2645('0x19')]=router; \ No newline at end of file +var _0x0b78=['get','isAuthenticated','/describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller'];(function(_0x3c8499,_0x1e052e){var _0x51d346=function(_0x311729){while(--_0x311729){_0x3c8499['push'](_0x3c8499['shift']());}};_0x51d346(++_0x1e052e);}(_0x0b78,0x1cb));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var path=require('path');var timeout=require(_0x80b7('0x2'));var express=require('express');var router=express[_0x80b7('0x3')]();var fs_extra=require(_0x80b7('0x4'));var auth=require(_0x80b7('0x5'));var interaction=require(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var controller=require(_0x80b7('0x8'));router[_0x80b7('0x9')]('/',auth[_0x80b7('0xa')](),controller['index']);router[_0x80b7('0x9')](_0x80b7('0xb'),auth[_0x80b7('0xa')](),controller['describe']);router['get'](_0x80b7('0xc'),auth[_0x80b7('0xa')](),controller[_0x80b7('0xd')]);router[_0x80b7('0xe')]('/',auth[_0x80b7('0xa')](),interaction[_0x80b7('0xf')]('whatsapp',_0x80b7('0x10')),controller['create']);router[_0x80b7('0xe')](_0x80b7('0x11'),controller['status']);router[_0x80b7('0x12')](_0x80b7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x80b7('0x12')](_0x80b7('0x13'),auth[_0x80b7('0xa')](),controller[_0x80b7('0x14')]);router['put'](_0x80b7('0x15'),auth[_0x80b7('0xa')](),controller[_0x80b7('0x16')]);router[_0x80b7('0x17')](_0x80b7('0xc'),auth['isAuthenticated'](),controller[_0x80b7('0x18')]);module[_0x80b7('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f9c1d7b..8614170 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x642b=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x19c8d0,_0x17c993){var _0x1e70b9=function(_0x8bb85e){while(--_0x8bb85e){_0x19c8d0['push'](_0x19c8d0['shift']());}};_0x1e70b9(++_0x17c993);}(_0x642b,0x196));var _0xb642=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x642b[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require('sequelize');module[_0xb642('0x0')]={'body':{'type':Sequelize[_0xb642('0x1')](_0xb642('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb642('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb642('0x4')]('in',_0xb642('0x5')),'defaultValue':_0xb642('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb642('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb642('0x6')]},'readAt':{'type':Sequelize[_0xb642('0x7')]},'secret':{'type':Sequelize[_0xb642('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb642('0x6')]},'providerResponse':{'type':Sequelize[_0xb642('0x1')]}}; \ No newline at end of file +var _0xa3d9=['exports','TEXT','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0xda2c1e,_0x3d09ce){var _0x46b626=function(_0x575546){while(--_0x575546){_0xda2c1e['push'](_0xda2c1e['shift']());}};_0x46b626(++_0x3d09ce);}(_0xa3d9,0x150));var _0x9a3d=function(_0x29cdcf,_0x421f53){_0x29cdcf=_0x29cdcf-0x0;var _0x1f1c92=_0xa3d9[_0x29cdcf];return _0x1f1c92;};'use strict';var Sequelize=require('sequelize');module[_0x9a3d('0x0')]={'body':{'type':Sequelize[_0x9a3d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a3d('0x2')]('in','out'),'defaultValue':_0x9a3d('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9a3d('0x4')](0xbe)},'phone':{'type':Sequelize[_0x9a3d('0x4')]},'readAt':{'type':Sequelize[_0x9a3d('0x5')]},'secret':{'type':Sequelize[_0x9a3d('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9a3d('0x4')]},'providerResponse':{'type':Sequelize[_0x9a3d('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e6afcf3..d88dcaa 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbabc=['WhatsappMessage,\x20%s,\x20%s','message','sendStatus','status','json','offset','undefined','count','set','apply','destroy','then','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','fields','includeAll','options','find','create','body','update','describe','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','fullname','email','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x427658,_0x141516){var _0x424a61=function(_0x89c288){while(--_0x89c288){_0x427658['push'](_0x427658['shift']());}};_0x424a61(++_0x141516);}(_0xbabc,0x17a));var _0xcbab=function(_0x1d2a6c,_0x4523a9){_0x1d2a6c=_0x1d2a6c-0x0;var _0x30e0c9=_0xbabc[_0x1d2a6c];return _0x30e0c9;};'use strict';var emlformat=require(_0xcbab('0x0'));var rimraf=require(_0xcbab('0x1'));var zipdir=require(_0xcbab('0x2'));var jsonpatch=require(_0xcbab('0x3'));var rp=require(_0xcbab('0x4'));var moment=require(_0xcbab('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcbab('0x6'));var path=require(_0xcbab('0x7'));var sox=require(_0xcbab('0x8'));var csv=require(_0xcbab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbab('0xa'));var _=require(_0xcbab('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbab('0xc'));var deskjs=require(_0xcbab('0xd'));var toCsv=require(_0xcbab('0x9'));var querystring=require('querystring');var Papa=require(_0xcbab('0xe'));var Redis=require(_0xcbab('0xf'));var authService=require(_0xcbab('0x10'));var qs=require(_0xcbab('0x11'));var as=require(_0xcbab('0x12'));var hardwareService=require(_0xcbab('0x13'));var logger=require(_0xcbab('0x14'))(_0xcbab('0x15'));var utils=require(_0xcbab('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcbab('0x17'));var db=require(_0xcbab('0x18'))['db'];config[_0xcbab('0x19')]=_['defaults'](config[_0xcbab('0x19')],{'host':_0xcbab('0x1a'),'port':0x18eb});var socket=require(_0xcbab('0x1b'))(new Redis(config[_0xcbab('0x19')]));require(_0xcbab('0x1c'))[_0xcbab('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcbab('0x1e')][_0xcbab('0x1f')]({'port':0x232c});var client9002=jayson[_0xcbab('0x1e')][_0xcbab('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2a4996,_0x1a7401,_0x2e07c1,_0x9c2bcc){return new BPromise(function(_0x4c457c,_0x136f89){var _0x4fded6=_0x9c2bcc||client;return _0x4fded6['request'](_0x2a4996,_0x2e07c1)['then'](function(_0x5e32c0){logger[_0xcbab('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x1a7401,'request\x20sent');logger[_0xcbab('0x21')](_0xcbab('0x22'),_0x1a7401,_0xcbab('0x23'),JSON[_0xcbab('0x24')](_0x5e32c0));if(_0x5e32c0['error']){if(_0x5e32c0['error'][_0xcbab('0x25')]===0x1f4){logger[_0xcbab('0x26')](_0xcbab('0x27'),_0x1a7401,_0x5e32c0['error'][_0xcbab('0x28')]);return _0x136f89(_0x5e32c0[_0xcbab('0x26')][_0xcbab('0x28')]);}logger[_0xcbab('0x26')](_0xcbab('0x27'),_0x1a7401,_0x5e32c0[_0xcbab('0x26')]['message']);return _0x4c457c(_0x5e32c0[_0xcbab('0x26')][_0xcbab('0x28')]);}else{logger['info'](_0xcbab('0x27'),_0x1a7401,'request\x20sent');_0x4c457c(_0x5e32c0['result'][_0xcbab('0x28')]);}})['catch'](function(_0x2f2984){logger[_0xcbab('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x1a7401,_0x2f2984);_0x136f89(_0x2f2984);});});}function respondWithStatusCode(_0xd2956c,_0x455443){_0x455443=_0x455443||0xcc;return function(_0x4fe549){if(_0x4fe549){return _0xd2956c[_0xcbab('0x29')](_0x455443);}return _0xd2956c[_0xcbab('0x2a')](_0x455443)['end']();};}function respondWithResult(_0x58fc50,_0x540556){_0x540556=_0x540556||0xc8;return function(_0x10193b){if(_0x10193b){return _0x58fc50[_0xcbab('0x2a')](_0x540556)[_0xcbab('0x2b')](_0x10193b);}};}function respondWithFilteredResult(_0x3c2874,_0x4b76ce){return function(_0x23bf7d){if(_0x23bf7d){var _0x30bc97=typeof _0x4b76ce[_0xcbab('0x2c')]===_0xcbab('0x2d')&&typeof _0x4b76ce['limit']==='undefined';var _0x17a065=_0x23bf7d[_0xcbab('0x2e')];var _0x33a1e3=_0x30bc97?0x0:_0x4b76ce[_0xcbab('0x2c')];var _0x1881cc=_0x30bc97?_0x23bf7d[_0xcbab('0x2e')]:_0x4b76ce[_0xcbab('0x2c')]+_0x4b76ce['limit'];var _0x221a53;if(_0x1881cc>=_0x17a065){_0x1881cc=_0x17a065;_0x221a53=0xc8;}else{_0x221a53=0xce;}_0x3c2874[_0xcbab('0x2a')](_0x221a53);return _0x3c2874[_0xcbab('0x2f')]('Content-Range',_0x33a1e3+'-'+_0x1881cc+'/'+_0x17a065)['json'](_0x23bf7d);}return null;};}function patchUpdates(_0x22ef64){return function(_0x262491){try{jsonpatch[_0xcbab('0x30')](_0x262491,_0x22ef64,!![]);}catch(_0x303c5a){return BPromise['reject'](_0x303c5a);}return _0x262491['save']();};}function saveUpdates(_0x373878,_0x1b78ff){return function(_0x4ff160){if(_0x4ff160){return _0x4ff160['update'](_0x373878)['then'](function(_0x4db736){return _0x4db736;});}return null;};}function removeEntity(_0x26a9e6,_0x3f9a4e){return function(_0x306b74){if(_0x306b74){return _0x306b74[_0xcbab('0x31')]()[_0xcbab('0x32')](function(){_0x26a9e6['status'](0xcc)[_0xcbab('0x33')]();});}};}function handleEntityNotFound(_0x535ebf,_0x54f52d){return function(_0x39e0e5){if(!_0x39e0e5){_0x535ebf[_0xcbab('0x29')](0x194);}return _0x39e0e5;};}function handleError(_0x356095,_0x2fee6b){_0x2fee6b=_0x2fee6b||0x1f4;return function(_0x3bc8ad){logger['error'](_0x3bc8ad[_0xcbab('0x34')]);if(_0x3bc8ad[_0xcbab('0x35')]){delete _0x3bc8ad[_0xcbab('0x35')];}_0x356095[_0xcbab('0x2a')](_0x2fee6b)[_0xcbab('0x36')](_0x3bc8ad);};}exports[_0xcbab('0x37')]=function(_0x4638bb,_0x4bf47b){var _0x532621={},_0x168806={},_0x3ea50b={'count':0x0,'rows':[]};var _0x32f1c7=_[_0xcbab('0x38')](db[_0xcbab('0x39')][_0xcbab('0x3a')],function(_0xc18829){return{'name':_0xc18829[_0xcbab('0x3b')],'type':_0xc18829[_0xcbab('0x3c')][_0xcbab('0x3d')]};});_0x168806[_0xcbab('0x3e')]=_[_0xcbab('0x38')](_0x32f1c7,'name');_0x168806[_0xcbab('0x3f')]=_[_0xcbab('0x40')](_0x4638bb[_0xcbab('0x3f')]);_0x168806[_0xcbab('0x41')]=_[_0xcbab('0x42')](_0x168806['model'],_0x168806[_0xcbab('0x3f')]);_0x532621[_0xcbab('0x43')]=_[_0xcbab('0x42')](_0x168806['model'],qs['fields'](_0x4638bb[_0xcbab('0x3f')]['fields']));_0x532621[_0xcbab('0x43')]=_0x532621[_0xcbab('0x43')][_0xcbab('0x44')]?_0x532621[_0xcbab('0x43')]:_0x168806['model'];if(!_0x4638bb['query'][_0xcbab('0x45')](_0xcbab('0x46'))){_0x532621['limit']=qs['limit'](_0x4638bb[_0xcbab('0x3f')][_0xcbab('0x47')]);_0x532621['offset']=qs['offset'](_0x4638bb[_0xcbab('0x3f')][_0xcbab('0x2c')]);}_0x532621['order']=qs[_0xcbab('0x48')](_0x4638bb[_0xcbab('0x3f')][_0xcbab('0x48')]);_0x532621['where']=qs[_0xcbab('0x41')](_[_0xcbab('0x49')](_0x4638bb[_0xcbab('0x3f')],_0x168806[_0xcbab('0x41')]),_0x32f1c7);if(_0x4638bb[_0xcbab('0x3f')][_0xcbab('0x4a')]){_0x532621[_0xcbab('0x4b')]=_[_0xcbab('0x4c')](_0x532621[_0xcbab('0x4b')],{'$or':_['map'](_0x32f1c7,function(_0x3d825f){if(_0x3d825f[_0xcbab('0x3c')]!==_0xcbab('0x4d')){var _0x58bffe={};_0x58bffe[_0x3d825f[_0xcbab('0x35')]]={'$like':'%'+_0x4638bb[_0xcbab('0x3f')][_0xcbab('0x4a')]+'%'};return _0x58bffe;}})});}_0x532621=_[_0xcbab('0x4c')]({},_0x532621,_0x4638bb['options']);var _0x49a4c4={'where':_0x532621[_0xcbab('0x4b')]};return db[_0xcbab('0x39')]['count'](_0x49a4c4)[_0xcbab('0x32')](function(_0x169fc6){_0x3ea50b['count']=_0x169fc6;if(_0x4638bb[_0xcbab('0x3f')]['includeAll']){_0x532621[_0xcbab('0x4e')]=[{'all':!![]}];}return db[_0xcbab('0x39')][_0xcbab('0x4f')](_0x532621);})[_0xcbab('0x32')](function(_0x23f6ef){_0x3ea50b['rows']=_0x23f6ef;return _0x3ea50b;})[_0xcbab('0x32')](respondWithFilteredResult(_0x4bf47b,_0x532621))[_0xcbab('0x50')](handleError(_0x4bf47b,null));};exports[_0xcbab('0x51')]=function(_0xcb1ddc,_0x5e7218){var _0x45e347={'raw':!![],'where':{'id':_0xcb1ddc[_0xcbab('0x52')]['id']}},_0x369f01={};_0x369f01[_0xcbab('0x3e')]=_[_0xcbab('0x40')](db[_0xcbab('0x39')][_0xcbab('0x3a')]);_0x369f01['query']=_[_0xcbab('0x40')](_0xcb1ddc[_0xcbab('0x3f')]);_0x369f01[_0xcbab('0x41')]=_[_0xcbab('0x42')](_0x369f01[_0xcbab('0x3e')],_0x369f01[_0xcbab('0x3f')]);_0x45e347[_0xcbab('0x43')]=_[_0xcbab('0x42')](_0x369f01[_0xcbab('0x3e')],qs[_0xcbab('0x53')](_0xcb1ddc[_0xcbab('0x3f')][_0xcbab('0x53')]));_0x45e347[_0xcbab('0x43')]=_0x45e347[_0xcbab('0x43')][_0xcbab('0x44')]?_0x45e347[_0xcbab('0x43')]:_0x369f01['model'];if(_0xcb1ddc[_0xcbab('0x3f')][_0xcbab('0x54')]){_0x45e347[_0xcbab('0x4e')]=[{'all':!![]}];}_0x45e347=_[_0xcbab('0x4c')]({},_0x45e347,_0xcb1ddc[_0xcbab('0x55')]);return db[_0xcbab('0x39')][_0xcbab('0x56')](_0x45e347)[_0xcbab('0x32')](handleEntityNotFound(_0x5e7218,null))[_0xcbab('0x32')](respondWithResult(_0x5e7218,null))[_0xcbab('0x50')](handleError(_0x5e7218,null));};exports[_0xcbab('0x57')]=function(_0x33bc07,_0xf3ec03){return db[_0xcbab('0x39')][_0xcbab('0x57')](_0x33bc07[_0xcbab('0x58')],{})[_0xcbab('0x32')](respondWithResult(_0xf3ec03,0xc9))['catch'](handleError(_0xf3ec03,null));};exports[_0xcbab('0x59')]=function(_0x45d076,_0x3906b3){if(_0x45d076[_0xcbab('0x58')]['id']){delete _0x45d076[_0xcbab('0x58')]['id'];}return db[_0xcbab('0x39')][_0xcbab('0x56')]({'where':{'id':_0x45d076[_0xcbab('0x52')]['id']}})[_0xcbab('0x32')](handleEntityNotFound(_0x3906b3,null))[_0xcbab('0x32')](saveUpdates(_0x45d076[_0xcbab('0x58')],null))[_0xcbab('0x32')](respondWithResult(_0x3906b3,null))[_0xcbab('0x50')](handleError(_0x3906b3,null));};exports[_0xcbab('0x31')]=function(_0x38da18,_0x2b1869){return db['WhatsappMessage'][_0xcbab('0x56')]({'where':{'id':_0x38da18[_0xcbab('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b1869,null))[_0xcbab('0x32')](removeEntity(_0x2b1869,null))[_0xcbab('0x50')](handleError(_0x2b1869,null));};exports[_0xcbab('0x5a')]=function(_0x3849d1,_0x347ee6){return db['WhatsappMessage'][_0xcbab('0x5a')]()[_0xcbab('0x32')](respondWithResult(_0x347ee6,null))[_0xcbab('0x50')](handleError(_0x347ee6,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['accept']=function(_0x281e82,_0x28296f,_0x459931){var _0xeb75b0={'agent':{},'channel':_0xcbab('0x5b')};if(_0x281e82[_0xcbab('0x58')]['id']){delete _0x281e82[_0xcbab('0x58')]['id'];}_0x281e82[_0xcbab('0x58')][_0xcbab('0x5c')]=!![];_0x281e82[_0xcbab('0x58')][_0xcbab('0x5d')]=moment()['format'](_0xcbab('0x5e'));_0x281e82[_0xcbab('0x58')]['UserId']=_0x281e82[_0xcbab('0x58')][_0xcbab('0x5f')]||_0x281e82[_0xcbab('0x60')]['id'];_0xeb75b0[_0xcbab('0x61')]['id']=_0x281e82[_0xcbab('0x58')][_0xcbab('0x5f')];return db[_0xcbab('0x39')]['find']({'where':{'id':_0x281e82[_0xcbab('0x52')]['id'],'UserId':null}})[_0xcbab('0x32')](handleEntityNotFound(_0x28296f,null))['then'](saveUpdates(_0x281e82[_0xcbab('0x58')],null))['then'](function(_0x232a07){if(_0x232a07){_0xeb75b0[_0xcbab('0x28')]=_0x232a07[_0xcbab('0x62')]({'plain':!![]});return db[_0xcbab('0x63')][_0xcbab('0x56')]({'where':{'id':_0x232a07[_0xcbab('0x64')]}});}return null;})[_0xcbab('0x32')](handleEntityNotFound(_0x28296f,null))['then'](function(_0x41a586){if(_0x41a586){return _0x41a586['update']({'UserId':_0x281e82[_0xcbab('0x58')][_0xcbab('0x5f')],'read1stAt':_[_0xcbab('0x65')](_0x41a586[_0xcbab('0x66')])?moment()[_0xcbab('0x67')](_0xcbab('0x5e')):undefined});}return null;})[_0xcbab('0x32')](function(_0x4fd6e7){if(_0x4fd6e7){_0xeb75b0[_0xcbab('0x68')]=_0x4fd6e7['get']({'plain':!![]});interaction_log[_0xcbab('0x20')](_0xcbab('0x69'),_0x281e82[_0xcbab('0x60')]['id'],_0x281e82[_0xcbab('0x60')][_0xcbab('0x35')],_0x281e82[_0xcbab('0x60')][_0xcbab('0x6a')],_0xeb75b0[_0xcbab('0x68')]['id'],_0x281e82[_0xcbab('0x58')]?JSON[_0xcbab('0x24')](_0x281e82['body']):_0xcbab('0x6b'));return respondWithRpcPromise(_0xcbab('0x6c'),_0xcbab('0x6d'),_0xeb75b0);}return null;})[_0xcbab('0x32')](function(_0x2c2f0f){var _0x4ff7e3=_0xcbab('0x6e')+_0x2c2f0f[_0xcbab('0x28')][_0xcbab('0x6f')];return db['sequelize'][_0xcbab('0x3f')](_0x4ff7e3,{'type':db[_0xcbab('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0xcbab('0x32')](function(_0x2d1008){return _0x2d1008;});})['then'](function(_0x17ecd4){if(_0x17ecd4){_0xeb75b0[_0xcbab('0x28')][_0xcbab('0x71')]=_0x17ecd4[0x0];if(!_0x281e82[_0xcbab('0x58')]['UserId'])return;return db['User'][_0xcbab('0x56')]({'where':{'id':_0x281e82['body']['UserId'],'role':_0xcbab('0x61')},'attributes':['id',_0xcbab('0x35'),'fullname','email',_0xcbab('0x72')],'raw':!![]});}return null;})[_0xcbab('0x32')](function(_0x23702e){if(!_0x23702e)return null;_0xeb75b0[_0xcbab('0x28')][_0xcbab('0x61')]=_0x23702e;return _0xeb75b0;})[_0xcbab('0x32')](function(_0x48793f){if(_0x48793f){if(_0x281e82[_0xcbab('0x58')][_0xcbab('0x73')]){_0xeb75b0[_0xcbab('0x28')][_0xcbab('0x74')]=util[_0xcbab('0x67')](_0xcbab('0x75'),_0x281e82[_0xcbab('0x60')][_0xcbab('0x35')]);_0xeb75b0[_0xcbab('0x28')][_0xcbab('0x76')]=_0xeb75b0[_0xcbab('0x76')];_0xeb75b0['message'][_0xcbab('0x77')]=_0xeb75b0['channel'];_0xeb75b0[_0xcbab('0x28')][_0xcbab('0x78')]=_0xcbab('0x79');return respondWithRpcPromise('EventManager',_0xcbab('0x7a'),{'event':_0xcbab('0x7b'),'message':_0xeb75b0[_0xcbab('0x28')]},client9002)[_0xcbab('0x32')](function(){return _0xeb75b0;});}return _0xeb75b0;}return null;})[_0xcbab('0x32')](respondWithResult(_0x28296f,null))[_0xcbab('0x50')](handleError(_0x28296f,null));};var interaction_log=require(_0xcbab('0x14'))(_0xcbab('0x7c'));exports['reject']=function(_0xe07052,_0x44e884,_0x59d321){var _0x4631c={'agent':{},'channel':_0xcbab('0x5b')};if(_0xe07052['body']['id']){delete _0xe07052[_0xcbab('0x58')]['id'];}_0xe07052[_0xcbab('0x58')][_0xcbab('0x5f')]=_0xe07052[_0xcbab('0x58')]['UserId']||_0xe07052[_0xcbab('0x60')]['id'];_0x4631c[_0xcbab('0x61')]['id']=_0xe07052[_0xcbab('0x58')][_0xcbab('0x5f')];return db['WhatsappMessage'][_0xcbab('0x56')]({'where':{'id':_0xe07052[_0xcbab('0x52')]['id'],'UserId':null}})[_0xcbab('0x32')](handleEntityNotFound(_0x44e884,null))[_0xcbab('0x32')](function(_0x4d2dd8){if(_0x4d2dd8){_0x4631c[_0xcbab('0x28')]=_0x4d2dd8[_0xcbab('0x62')]({'plain':!![]});return db[_0xcbab('0x63')][_0xcbab('0x56')]({'where':{'id':_0x4d2dd8['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x44e884,null))[_0xcbab('0x32')](function(_0x2755ae){if(_0x2755ae){_0x4631c[_0xcbab('0x68')]=_0x2755ae[_0xcbab('0x62')]({'plain':!![]});interaction_log[_0xcbab('0x20')](_0xcbab('0x7d'),_0xe07052[_0xcbab('0x60')]['id'],_0xe07052[_0xcbab('0x60')]['name'],_0xe07052[_0xcbab('0x60')][_0xcbab('0x6a')],_0x4631c[_0xcbab('0x68')]['id'],_0xe07052[_0xcbab('0x58')]?JSON[_0xcbab('0x24')](_0xe07052['body']):_0xcbab('0x6b'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4631c);}return null;})['then'](function(_0x355df6){var _0x382916=_0xcbab('0x6e')+_0x355df6[_0xcbab('0x28')]['ContactId'];return db[_0xcbab('0x7e')][_0xcbab('0x3f')](_0x382916,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xcbab('0x32')](function(_0x126678){return _0x126678;});})[_0xcbab('0x32')](function(_0x4ebfae){if(_0x4ebfae){_0x4631c[_0xcbab('0x28')][_0xcbab('0x71')]=_0x4ebfae[0x0];if(!_0xe07052['body'][_0xcbab('0x5f')])return;return db['User'][_0xcbab('0x56')]({'where':{'id':_0xe07052[_0xcbab('0x58')][_0xcbab('0x5f')],'role':_0xcbab('0x61')},'attributes':['id',_0xcbab('0x35'),_0xcbab('0x7f'),_0xcbab('0x80'),_0xcbab('0x72')],'raw':!![]});}return null;})[_0xcbab('0x32')](function(_0x63149){if(!_0x63149)return null;_0x4631c['message'][_0xcbab('0x61')]=_0x63149;return _0x4631c;})[_0xcbab('0x32')](function(_0x57e285){if(_0x57e285){_0x57e285['message'][_0xcbab('0x74')]=util[_0xcbab('0x67')]('SIP/%s',_0xe07052['user'][_0xcbab('0x35')]);_0x57e285['message']['channel']=_0x4631c[_0xcbab('0x76')];_0x57e285['message']['motionChannel']=_0x4631c[_0xcbab('0x76')];_0x57e285[_0xcbab('0x28')][_0xcbab('0x78')]=_0xcbab('0x81');respondWithRpcPromise(_0xcbab('0x7a'),_0xcbab('0x7a'),{'event':_0xcbab('0x82'),'message':_0x57e285[_0xcbab('0x28')]},client9002);return _0x4631c;}return null;})['then'](respondWithResult(_0x44e884,null))[_0xcbab('0x50')](handleError(_0x44e884,null));};exports['status']=function(_0x53dbea,_0x5e2994,_0x47808b){if(_0x53dbea[_0xcbab('0x58')]['id']){delete _0x53dbea[_0xcbab('0x58')]['id'];}var _0x5b2b85;return db[_0xcbab('0x39')][_0xcbab('0x56')]({'where':{'id':_0x53dbea[_0xcbab('0x52')]['id']}})[_0xcbab('0x32')](handleEntityNotFound(_0x5e2994,null))['then'](function(_0x2c145c){if(_0x2c145c){_0x5b2b85=_0x2c145c;return db[_0xcbab('0x83')][_0xcbab('0x56')]({'where':{'id':_0x2c145c[_0xcbab('0x84')]}});}})['then'](handleEntityNotFound(_0x5e2994,null))[_0xcbab('0x32')](function(_0x2f4510){if(_0x2f4510){logger[_0xcbab('0x21')](_0xcbab('0x85'),_0xcbab('0x2a'),_0xcbab('0x86'),_0x2f4510[_0xcbab('0x3c')],util[_0xcbab('0x87')](_0x53dbea[_0xcbab('0x58')],{'showHidden':![],'depth':null}));switch(_0x2f4510[_0xcbab('0x3c')]){case _0xcbab('0x88'):if(_0x53dbea[_0xcbab('0x58')]['MessageSid']&&_0x53dbea['body'][_0xcbab('0x89')]===_0x5b2b85['messageId']&&_0x53dbea[_0xcbab('0x58')][_0xcbab('0x8a')]&&_0x53dbea[_0xcbab('0x58')]['MessageStatus']===_0xcbab('0x5c')){return _0x5b2b85[_0xcbab('0x59')]({'read':!![]});}else{logger[_0xcbab('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcbab('0x2a'),_0xcbab('0x88'),util[_0xcbab('0x87')](_0x53dbea[_0xcbab('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x5b2b85;}})[_0xcbab('0x32')](respondWithResult(_0x5e2994,null))[_0xcbab('0x50')](handleError(_0x5e2994,null));}; \ No newline at end of file +var _0xc3b7=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp-interactions','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','User','internal','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','destroy','end','name','send','index','map','WhatsappMessage','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','rawAttributes','merge','find','create','body','params','describe','accept','whatsapp'];(function(_0x2eec8a,_0x5b25fa){var _0x37e31e=function(_0xd3001){while(--_0xd3001){_0x2eec8a['push'](_0x2eec8a['shift']());}};_0x37e31e(++_0x5b25fa);}(_0xc3b7,0x147));var _0x7c3b=function(_0x306b5e,_0x19652d){_0x306b5e=_0x306b5e-0x0;var _0x15bc2c=_0xc3b7[_0x306b5e];return _0x15bc2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c3b('0x0'));var zipdir=require(_0x7c3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c3b('0x2'));var moment=require(_0x7c3b('0x3'));var BPromise=require(_0x7c3b('0x4'));var Mustache=require(_0x7c3b('0x5'));var util=require(_0x7c3b('0x6'));var path=require(_0x7c3b('0x7'));var sox=require(_0x7c3b('0x8'));var csv=require('to-csv');var ejs=require(_0x7c3b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c3b('0xa'));var squel=require(_0x7c3b('0xb'));var crypto=require(_0x7c3b('0xc'));var jsforce=require(_0x7c3b('0xd'));var deskjs=require(_0x7c3b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7c3b('0xf'));var Papa=require(_0x7c3b('0x10'));var Redis=require(_0x7c3b('0x11'));var authService=require(_0x7c3b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7c3b('0x13'));var hardwareService=require(_0x7c3b('0x14'));var logger=require(_0x7c3b('0x15'))(_0x7c3b('0x16'));var utils=require(_0x7c3b('0x17'));var config=require(_0x7c3b('0x18'));var licenseUtil=require(_0x7c3b('0x19'));var db=require(_0x7c3b('0x1a'))['db'];config[_0x7c3b('0x1b')]=_[_0x7c3b('0x1c')](config[_0x7c3b('0x1b')],{'host':_0x7c3b('0x1d'),'port':0x18eb});var socket=require(_0x7c3b('0x1e'))(new Redis(config[_0x7c3b('0x1b')]));require(_0x7c3b('0x1f'))[_0x7c3b('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7c3b('0x21')][_0x7c3b('0x22')]({'port':0x232c});var client9002=jayson[_0x7c3b('0x21')][_0x7c3b('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x210400,_0x50b63e,_0x499038,_0x29dd00){return new BPromise(function(_0x565fe2,_0x956f93){var _0x23bec2=_0x29dd00||client;return _0x23bec2['request'](_0x210400,_0x499038)[_0x7c3b('0x23')](function(_0x21bbad){logger['info'](_0x7c3b('0x24'),_0x50b63e,'request\x20sent');logger[_0x7c3b('0x25')](_0x7c3b('0x26'),_0x50b63e,_0x7c3b('0x27'),JSON[_0x7c3b('0x28')](_0x21bbad));if(_0x21bbad['error']){if(_0x21bbad['error']['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x50b63e,_0x21bbad[_0x7c3b('0x29')]['message']);return _0x956f93(_0x21bbad[_0x7c3b('0x29')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x50b63e,_0x21bbad['error']['message']);return _0x565fe2(_0x21bbad[_0x7c3b('0x29')][_0x7c3b('0x2a')]);}else{logger[_0x7c3b('0x2b')](_0x7c3b('0x24'),_0x50b63e,_0x7c3b('0x27'));_0x565fe2(_0x21bbad['result']['message']);}})[_0x7c3b('0x2c')](function(_0x2dc57f){logger[_0x7c3b('0x29')](_0x7c3b('0x24'),_0x50b63e,_0x2dc57f);_0x956f93(_0x2dc57f);});});}function respondWithStatusCode(_0x184083,_0x467805){_0x467805=_0x467805||0xcc;return function(_0x53255c){if(_0x53255c){return _0x184083[_0x7c3b('0x2d')](_0x467805);}return _0x184083['status'](_0x467805)['end']();};}function respondWithResult(_0x4a2b17,_0x29b6fa){_0x29b6fa=_0x29b6fa||0xc8;return function(_0x4142dd){if(_0x4142dd){return _0x4a2b17['status'](_0x29b6fa)[_0x7c3b('0x2e')](_0x4142dd);}};}function respondWithFilteredResult(_0x1e6f6d,_0x3ae700){return function(_0x42307a){if(_0x42307a){var _0x3991b5=typeof _0x3ae700[_0x7c3b('0x2f')]===_0x7c3b('0x30')&&typeof _0x3ae700[_0x7c3b('0x31')]===_0x7c3b('0x30');var _0x461f24=_0x42307a[_0x7c3b('0x32')];var _0x45f7e5=_0x3991b5?0x0:_0x3ae700[_0x7c3b('0x2f')];var _0x3cf151=_0x3991b5?_0x42307a['count']:_0x3ae700['offset']+_0x3ae700[_0x7c3b('0x31')];var _0x1a686a;if(_0x3cf151>=_0x461f24){_0x3cf151=_0x461f24;_0x1a686a=0xc8;}else{_0x1a686a=0xce;}_0x1e6f6d[_0x7c3b('0x33')](_0x1a686a);return _0x1e6f6d[_0x7c3b('0x34')](_0x7c3b('0x35'),_0x45f7e5+'-'+_0x3cf151+'/'+_0x461f24)[_0x7c3b('0x2e')](_0x42307a);}return null;};}function patchUpdates(_0x368052){return function(_0x14b86a){try{jsonpatch[_0x7c3b('0x36')](_0x14b86a,_0x368052,!![]);}catch(_0x3727d8){return BPromise['reject'](_0x3727d8);}return _0x14b86a['save']();};}function saveUpdates(_0x703d25,_0x57228c){return function(_0x55683e){if(_0x55683e){return _0x55683e[_0x7c3b('0x37')](_0x703d25)['then'](function(_0x338082){return _0x338082;});}return null;};}function removeEntity(_0x5eb57d,_0xc7989f){return function(_0x1fef9f){if(_0x1fef9f){return _0x1fef9f[_0x7c3b('0x38')]()[_0x7c3b('0x23')](function(){_0x5eb57d[_0x7c3b('0x33')](0xcc)[_0x7c3b('0x39')]();});}};}function handleEntityNotFound(_0x1688da,_0x50c9bc){return function(_0x21c36a){if(!_0x21c36a){_0x1688da[_0x7c3b('0x2d')](0x194);}return _0x21c36a;};}function handleError(_0x2951b5,_0x570710){_0x570710=_0x570710||0x1f4;return function(_0x1a862d){logger[_0x7c3b('0x29')](_0x1a862d['stack']);if(_0x1a862d[_0x7c3b('0x3a')]){delete _0x1a862d[_0x7c3b('0x3a')];}_0x2951b5[_0x7c3b('0x33')](_0x570710)[_0x7c3b('0x3b')](_0x1a862d);};}exports[_0x7c3b('0x3c')]=function(_0x4a8a4e,_0x1a93b9){var _0x281856={},_0x5a4366={},_0x2ad09={'count':0x0,'rows':[]};var _0x1fa269=_[_0x7c3b('0x3d')](db[_0x7c3b('0x3e')]['rawAttributes'],function(_0x100a74){return{'name':_0x100a74['fieldName'],'type':_0x100a74['type']['key']};});_0x5a4366['model']=_[_0x7c3b('0x3d')](_0x1fa269,'name');_0x5a4366[_0x7c3b('0x3f')]=_['keys'](_0x4a8a4e['query']);_0x5a4366[_0x7c3b('0x40')]=_[_0x7c3b('0x41')](_0x5a4366[_0x7c3b('0x42')],_0x5a4366[_0x7c3b('0x3f')]);_0x281856[_0x7c3b('0x43')]=_[_0x7c3b('0x41')](_0x5a4366[_0x7c3b('0x42')],qs['fields'](_0x4a8a4e[_0x7c3b('0x3f')][_0x7c3b('0x44')]));_0x281856['attributes']=_0x281856[_0x7c3b('0x43')][_0x7c3b('0x45')]?_0x281856[_0x7c3b('0x43')]:_0x5a4366[_0x7c3b('0x42')];if(!_0x4a8a4e[_0x7c3b('0x3f')]['hasOwnProperty'](_0x7c3b('0x46'))){_0x281856['limit']=qs['limit'](_0x4a8a4e[_0x7c3b('0x3f')][_0x7c3b('0x31')]);_0x281856[_0x7c3b('0x2f')]=qs[_0x7c3b('0x2f')](_0x4a8a4e[_0x7c3b('0x3f')]['offset']);}_0x281856[_0x7c3b('0x47')]=qs['sort'](_0x4a8a4e[_0x7c3b('0x3f')][_0x7c3b('0x48')]);_0x281856[_0x7c3b('0x49')]=qs[_0x7c3b('0x40')](_[_0x7c3b('0x4a')](_0x4a8a4e[_0x7c3b('0x3f')],_0x5a4366[_0x7c3b('0x40')]),_0x1fa269);if(_0x4a8a4e[_0x7c3b('0x3f')][_0x7c3b('0x4b')]){_0x281856[_0x7c3b('0x49')]=_['merge'](_0x281856['where'],{'$or':_[_0x7c3b('0x3d')](_0x1fa269,function(_0x10229c){if(_0x10229c['type']!==_0x7c3b('0x4c')){var _0x50a76d={};_0x50a76d[_0x10229c[_0x7c3b('0x3a')]]={'$like':'%'+_0x4a8a4e[_0x7c3b('0x3f')]['filter']+'%'};return _0x50a76d;}})});}_0x281856=_['merge']({},_0x281856,_0x4a8a4e[_0x7c3b('0x4d')]);var _0x216e19={'where':_0x281856[_0x7c3b('0x49')]};return db[_0x7c3b('0x3e')]['count'](_0x216e19)['then'](function(_0x451d95){_0x2ad09[_0x7c3b('0x32')]=_0x451d95;if(_0x4a8a4e['query'][_0x7c3b('0x4e')]){_0x281856[_0x7c3b('0x4f')]=[{'all':!![]}];}return db[_0x7c3b('0x3e')][_0x7c3b('0x50')](_0x281856);})[_0x7c3b('0x23')](function(_0x5939fe){_0x2ad09[_0x7c3b('0x51')]=_0x5939fe;return _0x2ad09;})[_0x7c3b('0x23')](respondWithFilteredResult(_0x1a93b9,_0x281856))['catch'](handleError(_0x1a93b9,null));};exports[_0x7c3b('0x52')]=function(_0x2409f5,_0x2918fb){var _0x4bba7c={'raw':!![],'where':{'id':_0x2409f5['params']['id']}},_0x49b27f={};_0x49b27f['model']=_[_0x7c3b('0x53')](db['WhatsappMessage'][_0x7c3b('0x54')]);_0x49b27f[_0x7c3b('0x3f')]=_[_0x7c3b('0x53')](_0x2409f5['query']);_0x49b27f[_0x7c3b('0x40')]=_[_0x7c3b('0x41')](_0x49b27f['model'],_0x49b27f[_0x7c3b('0x3f')]);_0x4bba7c[_0x7c3b('0x43')]=_[_0x7c3b('0x41')](_0x49b27f['model'],qs[_0x7c3b('0x44')](_0x2409f5[_0x7c3b('0x3f')][_0x7c3b('0x44')]));_0x4bba7c[_0x7c3b('0x43')]=_0x4bba7c[_0x7c3b('0x43')][_0x7c3b('0x45')]?_0x4bba7c['attributes']:_0x49b27f[_0x7c3b('0x42')];if(_0x2409f5[_0x7c3b('0x3f')]['includeAll']){_0x4bba7c[_0x7c3b('0x4f')]=[{'all':!![]}];}_0x4bba7c=_[_0x7c3b('0x55')]({},_0x4bba7c,_0x2409f5[_0x7c3b('0x4d')]);return db['WhatsappMessage'][_0x7c3b('0x56')](_0x4bba7c)[_0x7c3b('0x23')](handleEntityNotFound(_0x2918fb,null))['then'](respondWithResult(_0x2918fb,null))[_0x7c3b('0x2c')](handleError(_0x2918fb,null));};exports[_0x7c3b('0x57')]=function(_0x2fa55c,_0x518077){return db[_0x7c3b('0x3e')]['create'](_0x2fa55c[_0x7c3b('0x58')],{})['then'](respondWithResult(_0x518077,0xc9))[_0x7c3b('0x2c')](handleError(_0x518077,null));};exports[_0x7c3b('0x37')]=function(_0x41c080,_0x3044de){if(_0x41c080[_0x7c3b('0x58')]['id']){delete _0x41c080[_0x7c3b('0x58')]['id'];}return db[_0x7c3b('0x3e')][_0x7c3b('0x56')]({'where':{'id':_0x41c080['params']['id']}})[_0x7c3b('0x23')](handleEntityNotFound(_0x3044de,null))[_0x7c3b('0x23')](saveUpdates(_0x41c080['body'],null))['then'](respondWithResult(_0x3044de,null))[_0x7c3b('0x2c')](handleError(_0x3044de,null));};exports['destroy']=function(_0x128fc7,_0x417dc3){return db[_0x7c3b('0x3e')][_0x7c3b('0x56')]({'where':{'id':_0x128fc7[_0x7c3b('0x59')]['id']}})[_0x7c3b('0x23')](handleEntityNotFound(_0x417dc3,null))[_0x7c3b('0x23')](removeEntity(_0x417dc3,null))[_0x7c3b('0x2c')](handleError(_0x417dc3,null));};exports['describe']=function(_0xd7d313,_0x391467){return db[_0x7c3b('0x3e')][_0x7c3b('0x5a')]()[_0x7c3b('0x23')](respondWithResult(_0x391467,null))[_0x7c3b('0x2c')](handleError(_0x391467,null));};var interaction_log=require(_0x7c3b('0x15'))('whatsapp-interactions');exports[_0x7c3b('0x5b')]=function(_0x219428,_0x5b712c,_0x41cf4){var _0x2ca229={'agent':{},'channel':_0x7c3b('0x5c')};if(_0x219428[_0x7c3b('0x58')]['id']){delete _0x219428[_0x7c3b('0x58')]['id'];}_0x219428['body'][_0x7c3b('0x5d')]=!![];_0x219428['body'][_0x7c3b('0x5e')]=moment()[_0x7c3b('0x5f')](_0x7c3b('0x60'));_0x219428['body'][_0x7c3b('0x61')]=_0x219428[_0x7c3b('0x58')][_0x7c3b('0x61')]||_0x219428['user']['id'];_0x2ca229[_0x7c3b('0x62')]['id']=_0x219428[_0x7c3b('0x58')][_0x7c3b('0x61')];return db[_0x7c3b('0x3e')]['find']({'where':{'id':_0x219428[_0x7c3b('0x59')]['id'],'UserId':null}})[_0x7c3b('0x23')](handleEntityNotFound(_0x5b712c,null))[_0x7c3b('0x23')](saveUpdates(_0x219428[_0x7c3b('0x58')],null))[_0x7c3b('0x23')](function(_0x40ef5e){if(_0x40ef5e){_0x2ca229[_0x7c3b('0x2a')]=_0x40ef5e[_0x7c3b('0x63')]({'plain':!![]});return db[_0x7c3b('0x64')][_0x7c3b('0x56')]({'where':{'id':_0x40ef5e[_0x7c3b('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5b712c,null))[_0x7c3b('0x23')](function(_0xc5a23f){if(_0xc5a23f){return _0xc5a23f[_0x7c3b('0x37')]({'UserId':_0x219428[_0x7c3b('0x58')]['UserId'],'read1stAt':_['isNil'](_0xc5a23f['read1stAt'])?moment()[_0x7c3b('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2c3dfc){if(_0x2c3dfc){_0x2ca229['interaction']=_0x2c3dfc['get']({'plain':!![]});interaction_log[_0x7c3b('0x2b')](_0x7c3b('0x66'),_0x219428[_0x7c3b('0x67')]['id'],_0x219428[_0x7c3b('0x67')][_0x7c3b('0x3a')],_0x219428['user'][_0x7c3b('0x68')],_0x2ca229[_0x7c3b('0x69')]['id'],_0x219428[_0x7c3b('0x58')]?JSON['stringify'](_0x219428[_0x7c3b('0x58')]):_0x7c3b('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2ca229);}return null;})[_0x7c3b('0x23')](function(_0xdb39ac){var _0x484f91=_0x7c3b('0x6b')+_0xdb39ac['message'][_0x7c3b('0x6c')];return db[_0x7c3b('0x6d')][_0x7c3b('0x3f')](_0x484f91,{'type':db[_0x7c3b('0x6e')]['QueryTypes'][_0x7c3b('0x6f')],'raw':!![]})[_0x7c3b('0x23')](function(_0x4f7ac4){return _0x4f7ac4;});})[_0x7c3b('0x23')](function(_0x10ca19){if(_0x10ca19){_0x2ca229['message'][_0x7c3b('0x70')]=_0x10ca19[0x0];if(!_0x219428[_0x7c3b('0x58')]['UserId'])return;return db['User'][_0x7c3b('0x56')]({'where':{'id':_0x219428[_0x7c3b('0x58')]['UserId'],'role':_0x7c3b('0x62')},'attributes':['id',_0x7c3b('0x3a'),_0x7c3b('0x71'),_0x7c3b('0x72'),'internal'],'raw':!![]});}return null;})[_0x7c3b('0x23')](function(_0x149c98){if(!_0x149c98)return null;_0x2ca229[_0x7c3b('0x2a')][_0x7c3b('0x62')]=_0x149c98;return _0x2ca229;})[_0x7c3b('0x23')](function(_0xa201b7){if(_0xa201b7){if(_0x219428[_0x7c3b('0x58')]['manual']){_0x2ca229[_0x7c3b('0x2a')][_0x7c3b('0x73')]=util['format'](_0x7c3b('0x74'),_0x219428['user'][_0x7c3b('0x3a')]);_0x2ca229['message'][_0x7c3b('0x75')]=_0x2ca229[_0x7c3b('0x75')];_0x2ca229[_0x7c3b('0x2a')][_0x7c3b('0x76')]=_0x2ca229[_0x7c3b('0x75')];_0x2ca229[_0x7c3b('0x2a')]['event']=_0x7c3b('0x5b');return respondWithRpcPromise(_0x7c3b('0x77'),_0x7c3b('0x77'),{'event':_0x7c3b('0x78'),'message':_0x2ca229['message']},client9002)[_0x7c3b('0x23')](function(){return _0x2ca229;});}return _0x2ca229;}return null;})[_0x7c3b('0x23')](respondWithResult(_0x5b712c,null))['catch'](handleError(_0x5b712c,null));};var interaction_log=require('../../config/logger')(_0x7c3b('0x79'));exports[_0x7c3b('0x7a')]=function(_0x20fb42,_0x168e0b,_0x311751){var _0x95352={'agent':{},'channel':_0x7c3b('0x5c')};if(_0x20fb42[_0x7c3b('0x58')]['id']){delete _0x20fb42[_0x7c3b('0x58')]['id'];}_0x20fb42[_0x7c3b('0x58')][_0x7c3b('0x61')]=_0x20fb42[_0x7c3b('0x58')]['UserId']||_0x20fb42[_0x7c3b('0x67')]['id'];_0x95352['agent']['id']=_0x20fb42[_0x7c3b('0x58')]['UserId'];return db[_0x7c3b('0x3e')][_0x7c3b('0x56')]({'where':{'id':_0x20fb42[_0x7c3b('0x59')]['id'],'UserId':null}})[_0x7c3b('0x23')](handleEntityNotFound(_0x168e0b,null))[_0x7c3b('0x23')](function(_0x556ad8){if(_0x556ad8){_0x95352[_0x7c3b('0x2a')]=_0x556ad8[_0x7c3b('0x63')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x556ad8['WhatsappInteractionId']}});}return null;})[_0x7c3b('0x23')](handleEntityNotFound(_0x168e0b,null))[_0x7c3b('0x23')](function(_0x4880ec){if(_0x4880ec){_0x95352[_0x7c3b('0x69')]=_0x4880ec[_0x7c3b('0x63')]({'plain':!![]});interaction_log[_0x7c3b('0x2b')](_0x7c3b('0x7b'),_0x20fb42['user']['id'],_0x20fb42['user'][_0x7c3b('0x3a')],_0x20fb42[_0x7c3b('0x67')][_0x7c3b('0x68')],_0x95352[_0x7c3b('0x69')]['id'],_0x20fb42[_0x7c3b('0x58')]?JSON['stringify'](_0x20fb42[_0x7c3b('0x58')]):_0x7c3b('0x6a'));return respondWithRpcPromise(_0x7c3b('0x7c'),_0x7c3b('0x7d'),_0x95352);}return null;})[_0x7c3b('0x23')](function(_0x1bf04a){var _0x2a6be2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bf04a[_0x7c3b('0x2a')]['ContactId'];return db['sequelize'][_0x7c3b('0x3f')](_0x2a6be2,{'type':db[_0x7c3b('0x6e')][_0x7c3b('0x7e')][_0x7c3b('0x6f')],'raw':!![]})[_0x7c3b('0x23')](function(_0x43e274){return _0x43e274;});})[_0x7c3b('0x23')](function(_0x163c22){if(_0x163c22){_0x95352[_0x7c3b('0x2a')][_0x7c3b('0x70')]=_0x163c22[0x0];if(!_0x20fb42[_0x7c3b('0x58')][_0x7c3b('0x61')])return;return db[_0x7c3b('0x7f')]['find']({'where':{'id':_0x20fb42['body'][_0x7c3b('0x61')],'role':_0x7c3b('0x62')},'attributes':['id','name',_0x7c3b('0x71'),_0x7c3b('0x72'),_0x7c3b('0x80')],'raw':!![]});}return null;})[_0x7c3b('0x23')](function(_0x4cdcc5){if(!_0x4cdcc5)return null;_0x95352[_0x7c3b('0x2a')]['agent']=_0x4cdcc5;return _0x95352;})[_0x7c3b('0x23')](function(_0x72e05a){if(_0x72e05a){_0x72e05a[_0x7c3b('0x2a')][_0x7c3b('0x73')]=util[_0x7c3b('0x5f')](_0x7c3b('0x74'),_0x20fb42[_0x7c3b('0x67')][_0x7c3b('0x3a')]);_0x72e05a[_0x7c3b('0x2a')][_0x7c3b('0x75')]=_0x95352[_0x7c3b('0x75')];_0x72e05a[_0x7c3b('0x2a')][_0x7c3b('0x76')]=_0x95352[_0x7c3b('0x75')];_0x72e05a[_0x7c3b('0x2a')][_0x7c3b('0x81')]='reject';respondWithRpcPromise(_0x7c3b('0x77'),'EventManager',{'event':'rejectmessage','message':_0x72e05a[_0x7c3b('0x2a')]},client9002);return _0x95352;}return null;})[_0x7c3b('0x23')](respondWithResult(_0x168e0b,null))[_0x7c3b('0x2c')](handleError(_0x168e0b,null));};exports[_0x7c3b('0x33')]=function(_0x5022ad,_0x1de570,_0x5f53cb){if(_0x5022ad[_0x7c3b('0x58')]['id']){delete _0x5022ad[_0x7c3b('0x58')]['id'];}var _0x396a5d;return db[_0x7c3b('0x3e')]['find']({'where':{'id':_0x5022ad[_0x7c3b('0x59')]['id']}})[_0x7c3b('0x23')](handleEntityNotFound(_0x1de570,null))[_0x7c3b('0x23')](function(_0x3e01b3){if(_0x3e01b3){_0x396a5d=_0x3e01b3;return db[_0x7c3b('0x82')][_0x7c3b('0x56')]({'where':{'id':_0x3e01b3[_0x7c3b('0x83')]}});}})[_0x7c3b('0x23')](handleEntityNotFound(_0x1de570,null))[_0x7c3b('0x23')](function(_0x3d8c33){if(_0x3d8c33){logger[_0x7c3b('0x25')](_0x7c3b('0x84'),_0x7c3b('0x33'),_0x7c3b('0x85'),_0x3d8c33['type'],util['inspect'](_0x5022ad[_0x7c3b('0x58')],{'showHidden':![],'depth':null}));switch(_0x3d8c33['type']){case _0x7c3b('0x86'):if(_0x5022ad[_0x7c3b('0x58')][_0x7c3b('0x87')]&&_0x5022ad[_0x7c3b('0x58')][_0x7c3b('0x87')]===_0x396a5d[_0x7c3b('0x88')]&&_0x5022ad[_0x7c3b('0x58')][_0x7c3b('0x89')]&&_0x5022ad[_0x7c3b('0x58')][_0x7c3b('0x89')]===_0x7c3b('0x5d')){return _0x396a5d[_0x7c3b('0x37')]({'read':!![]});}else{logger[_0x7c3b('0x29')](_0x7c3b('0x8a'),_0x7c3b('0x33'),_0x7c3b('0x86'),util[_0x7c3b('0x8b')](_0x5022ad[_0x7c3b('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x396a5d;}})[_0x7c3b('0x23')](respondWithResult(_0x1de570,null))[_0x7c3b('0x2c')](handleError(_0x1de570,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 715d1f4..6ccd3d6 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb574=['setMaxListeners','save','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x16dc66,_0x58fb62){var _0x265de4=function(_0x525f1a){while(--_0x525f1a){_0x16dc66['push'](_0x16dc66['shift']());}};_0x265de4(++_0x58fb62);}(_0xb574,0x106));var _0x4b57=function(_0x12a92d,_0x1c986b){_0x12a92d=_0x12a92d-0x0;var _0x330cbb=_0xb574[_0x12a92d];return _0x330cbb;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var WhatsappMessage=require(_0x4b57('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4b57('0x2')](0x0);var events={'afterCreate':_0x4b57('0x3'),'afterUpdate':'update','afterDestroy':_0x4b57('0x4')};function emitEvent(_0x1c9d28){return function(_0x168524,_0x919851,_0xe2ae86){WhatsappMessageEvents['emit'](_0x1c9d28+':'+_0x168524['id'],_0x168524);WhatsappMessageEvents['emit'](_0x1c9d28,_0x168524);_0xe2ae86(null);};}for(var e in events){if(events[_0x4b57('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x4227=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x25d7f4,_0x25f79f){var _0x4112d8=function(_0x471151){while(--_0x471151){_0x25d7f4['push'](_0x25d7f4['shift']());}};_0x4112d8(++_0x25f79f);}(_0x4227,0x89));var _0x7422=function(_0x5d83a1,_0x17aafb){_0x5d83a1=_0x5d83a1-0x0;var _0x559e38=_0x4227[_0x5d83a1];return _0x559e38;};'use strict';var EventEmitter=require(_0x7422('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7422('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7422('0x2'),'afterDestroy':_0x7422('0x3')};function emitEvent(_0x3e69ca){return function(_0x57e279,_0x2de51f,_0x1cd829){WhatsappMessageEvents[_0x7422('0x4')](_0x3e69ca+':'+_0x57e279['id'],_0x57e279);WhatsappMessageEvents[_0x7422('0x4')](_0x3e69ca,_0x57e279);_0x1cd829(null);};}for(var e in events){if(events[_0x7422('0x5')](e)){var event=events[e];WhatsappMessage[_0x7422('0x6')](e,emitEvent(event));}}module[_0x7422('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 355c282..988ba74 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7af=['then','update','createdAt','catch','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','whatsapp_messages','messageId','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne'];(function(_0x274e79,_0x21b423){var _0x8b873c=function(_0x5cdc0a){while(--_0x5cdc0a){_0x274e79['push'](_0x274e79['shift']());}};_0x8b873c(++_0x21b423);}(_0xa7af,0x13e));var _0xfa7a=function(_0x212a17,_0x1749f6){_0x212a17=_0x212a17-0x0;var _0x578aa4=_0xa7af[_0x212a17];return _0x578aa4;};'use strict';var _=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var logger=require(_0xfa7a('0x2'))(_0xfa7a('0x3'));var moment=require(_0xfa7a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa7a('0x5'));var fetch=require(_0xfa7a('0x6'));var fs=require('fs');var path=require(_0xfa7a('0x7'));var rimraf=require(_0xfa7a('0x8'));var config=require(_0xfa7a('0x9'));var attributes=require(_0xfa7a('0xa'));module['exports']=function(_0x5d6eef,_0x4f4b05){return _0x5d6eef['define']('WhatsappMessage',attributes,{'tableName':_0xfa7a('0xb'),'paranoid':![],'indexes':[{'name':_0xfa7a('0xc'),'fields':[_0xfa7a('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0xfa7a('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x347a07,_0x9cf71a,_0x46960e){var _0x574018=_0x5d6eef[_0xfa7a('0xe')];var _0x13be90=_0x347a07[_0xfa7a('0xf')]({'plain':!![]});if(_0x13be90['direction'][_0xfa7a('0x10')]()==='in'||_0x13be90[_0xfa7a('0x11')][_0xfa7a('0x10')]()===_0xfa7a('0x12')&&!_0x13be90[_0xfa7a('0x13')]&&!_[_0xfa7a('0x14')](_0x13be90[_0xfa7a('0x15')])){_0x574018[_0xfa7a('0x16')][_0xfa7a('0x17')]({'where':{'id':_0x13be90['WhatsappInteractionId']}})[_0xfa7a('0x18')](function(_0xc2fd0e){if(_0xc2fd0e){_0xc2fd0e[_0xfa7a('0x19')]({'lastMsgAt':_0x13be90[_0xfa7a('0x1a')],'lastMsgDirection':_0x13be90[_0xfa7a('0x11')]['toLowerCase']()});}})[_0xfa7a('0x1b')](function(_0x5e8fba){console['error'](_0x5e8fba);});}if(_0x13be90[_0xfa7a('0x11')]===_0xfa7a('0x12')&&!_0x13be90[_0xfa7a('0x13')]){var _0x21c5c5;_0x574018['WhatsappAccount']['find']({'where':{'id':_0x13be90[_0xfa7a('0x1c')]},'raw':!![]})['then'](function(_0x567880){_0x21c5c5=_0x567880;if(_0x21c5c5&&_0x21c5c5[_0xfa7a('0x1d')]){switch(_0x21c5c5['type']){case _0xfa7a('0x1e'):var _0x3ad63e=require('twilio');if(_0x21c5c5['accountSid']&&_0x21c5c5[_0xfa7a('0x1f')]&&_0x21c5c5[_0xfa7a('0x20')]){var _0x32e7bc=new _0x3ad63e(_0x21c5c5[_0xfa7a('0x21')],_0x21c5c5[_0xfa7a('0x1f')]);_0x32e7bc[_0xfa7a('0x22')][_0xfa7a('0x23')]({'body':_0x13be90[_0xfa7a('0xd')],'to':_0xfa7a('0x24')+_0x13be90[_0xfa7a('0x20')],'from':_0xfa7a('0x24')+_0x21c5c5[_0xfa7a('0x20')],'statusCallback':_0x21c5c5[_0xfa7a('0x25')]+_0xfa7a('0x26')+_0x13be90['id']+_0xfa7a('0x27')+_0x21c5c5['token']})[_0xfa7a('0x18')](function(_0x2b1c2a){if(_0x2b1c2a[_0xfa7a('0x28')]){return _0x347a07[_0xfa7a('0x19')]({'messageId':_0x2b1c2a['sid']});}})[_0xfa7a('0x1b')](function(_0x1554e4){logger[_0xfa7a('0x29')](_0xfa7a('0x2a'),_0xfa7a('0x2b'),_0xfa7a('0x1e'),util['inspect'](_0x1554e4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa7a('0x2a'),'afterCreate','twilio',_0xfa7a('0x2c'));}break;case'sinch':var _0x343282=_0x21c5c5[_0xfa7a('0x21')];var _0x337418=_0x21c5c5[_0xfa7a('0x1f')];var _0x49fdc4=_0x21c5c5[_0xfa7a('0x2d')]+_0xfa7a('0x2e')+_0x343282+_0xfa7a('0x2f');var _0x389f5d={'to':[_0x13be90['phone']],'message':{'type':'text','text':_0x13be90[_0xfa7a('0xd')]}};var _0x1ba85a={'method':_0xfa7a('0x30'),'uri':_0x49fdc4,'headers':{'Authorization':'Bearer\x20'+_0x337418,'Content-Type':_0xfa7a('0x31')},'body':_0x389f5d,'json':!![]};rp(_0x1ba85a)[_0xfa7a('0x18')](function(_0x58715f){if(_0x58715f[_0xfa7a('0x32')][0x0][_0xfa7a('0x33')]){return _0x347a07[_0xfa7a('0x19')]({'messageId':_0x58715f[_0xfa7a('0x32')][0x0][_0xfa7a('0x33')]});}})[_0xfa7a('0x1b')](function(_0x28b67f){logger[_0xfa7a('0x34')](_0xfa7a('0x35'),_0x28b67f);});break;}}})[_0xfa7a('0x36')](function(){_0x46960e();});}else{_0x46960e();}}},'charset':_0xfa7a('0x37'),'collate':_0xfa7a('0x38')});}; \ No newline at end of file +var _0x2e44=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','phone','authToken','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x3d75f2,_0x140c12){var _0x1499cd=function(_0x5475e1){while(--_0x5475e1){_0x3d75f2['push'](_0x3d75f2['shift']());}};_0x1499cd(++_0x140c12);}(_0x2e44,0x16a));var _0x42e4=function(_0x4a63fc,_0x167a02){_0x4a63fc=_0x4a63fc-0x0;var _0x30d4c3=_0x2e44[_0x4a63fc];return _0x30d4c3;};'use strict';var _=require(_0x42e4('0x0'));var util=require(_0x42e4('0x1'));var logger=require(_0x42e4('0x2'))(_0x42e4('0x3'));var moment=require(_0x42e4('0x4'));var BPromise=require(_0x42e4('0x5'));var rp=require(_0x42e4('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x42e4('0x7'));var rimraf=require(_0x42e4('0x8'));var config=require(_0x42e4('0x9'));var attributes=require(_0x42e4('0xa'));module[_0x42e4('0xb')]=function(_0x441bdf,_0x2d54a0){return _0x441bdf['define'](_0x42e4('0xc'),attributes,{'tableName':_0x42e4('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x42e4('0xe')]},{'name':_0x42e4('0xf'),'fields':['body'],'type':_0x42e4('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4765cc,_0x1da269,_0x3a326e){var _0x42f792=_0x441bdf[_0x42e4('0x11')];var _0x170ecf=_0x4765cc[_0x42e4('0x12')]({'plain':!![]});if(_0x170ecf[_0x42e4('0x13')]['toLowerCase']()==='in'||_0x170ecf['direction'][_0x42e4('0x14')]()===_0x42e4('0x15')&&!_0x170ecf['secret']&&!_['isNil'](_0x170ecf[_0x42e4('0x16')])){_0x42f792[_0x42e4('0x17')][_0x42e4('0x18')]({'where':{'id':_0x170ecf[_0x42e4('0x19')]}})[_0x42e4('0x1a')](function(_0x165b9b){if(_0x165b9b){_0x165b9b[_0x42e4('0x1b')]({'lastMsgAt':_0x170ecf[_0x42e4('0x1c')],'lastMsgDirection':_0x170ecf['direction'][_0x42e4('0x14')]()});}})[_0x42e4('0x1d')](function(_0x498771){console[_0x42e4('0x1e')](_0x498771);});}if(_0x170ecf['direction']===_0x42e4('0x15')&&!_0x170ecf['secret']){var _0x3b9b43;_0x42f792[_0x42e4('0x1f')]['find']({'where':{'id':_0x170ecf[_0x42e4('0x20')]},'raw':!![]})[_0x42e4('0x1a')](function(_0x5a2cf7){_0x3b9b43=_0x5a2cf7;if(_0x3b9b43&&_0x3b9b43[_0x42e4('0x21')]){switch(_0x3b9b43[_0x42e4('0x21')]){case _0x42e4('0x22'):var _0x4db8bd=require(_0x42e4('0x22'));if(_0x3b9b43['accountSid']&&_0x3b9b43['authToken']&&_0x3b9b43[_0x42e4('0x23')]){var _0x40be73=new _0x4db8bd(_0x3b9b43['accountSid'],_0x3b9b43[_0x42e4('0x24')]);_0x40be73['messages'][_0x42e4('0x25')]({'body':_0x170ecf[_0x42e4('0x26')],'to':_0x42e4('0x27')+_0x170ecf[_0x42e4('0x23')],'from':_0x42e4('0x27')+_0x3b9b43[_0x42e4('0x23')],'statusCallback':_0x3b9b43[_0x42e4('0x28')]+_0x42e4('0x29')+_0x170ecf['id']+_0x42e4('0x2a')+_0x3b9b43[_0x42e4('0x2b')]})['then'](function(_0x2dd437){if(_0x2dd437[_0x42e4('0x2c')]){return _0x4765cc[_0x42e4('0x1b')]({'messageId':_0x2dd437[_0x42e4('0x2c')]});}})['catch'](function(_0x5e4e4d){logger['error'](_0x42e4('0x2d'),_0x42e4('0x2e'),_0x42e4('0x22'),util[_0x42e4('0x2f')](_0x5e4e4d,{'showHidden':![],'depth':null}));});}else{logger[_0x42e4('0x1e')](_0x42e4('0x2d'),_0x42e4('0x2e'),_0x42e4('0x22'),_0x42e4('0x30'));}break;case _0x42e4('0x31'):var _0x45b41a=_0x3b9b43[_0x42e4('0x32')];var _0x276f4=_0x3b9b43['authToken'];var _0x254046=_0x3b9b43['baseUrl']+_0x42e4('0x33')+_0x45b41a+_0x42e4('0x34');var _0x2bab10={'to':[_0x170ecf[_0x42e4('0x23')]],'message':{'type':'text','text':_0x170ecf[_0x42e4('0x26')]}};var _0x2f73ce={'method':_0x42e4('0x35'),'uri':_0x254046,'headers':{'Authorization':_0x42e4('0x36')+_0x276f4,'Content-Type':_0x42e4('0x37')},'body':_0x2bab10,'json':!![]};rp(_0x2f73ce)[_0x42e4('0x1a')](function(_0x49df7d){if(_0x49df7d[_0x42e4('0x38')][0x0][_0x42e4('0x39')]){return _0x4765cc['update']({'messageId':_0x49df7d[_0x42e4('0x38')][0x0]['message_id']});}})[_0x42e4('0x1d')](function(_0xc1db45){logger[_0x42e4('0x3a')]('WhatsappMessage,\x20%s',_0xc1db45);});break;}}})[_0x42e4('0x3b')](function(){_0x3a326e();});}else{_0x3a326e();}}},'charset':_0x42e4('0x3c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 6f4a198..f3ce242 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5243=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','debug','util','moment','bluebird','randomstring'];(function(_0x31bac6,_0x2bff22){var _0x14b106=function(_0x175a17){while(--_0x175a17){_0x31bac6['push'](_0x31bac6['shift']());}};_0x14b106(++_0x2bff22);}(_0x5243,0x1dc));var _0x3524=function(_0x5686b0,_0x51773d){_0x5686b0=_0x5686b0-0x0;var _0x544b4d=_0x5243[_0x5686b0];return _0x544b4d;};'use strict';var _=require('lodash');var util=require(_0x3524('0x0'));var moment=require(_0x3524('0x1'));var BPromise=require(_0x3524('0x2'));var rs=require(_0x3524('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3524('0x4'))['db'];var utils=require(_0x3524('0x5'));var logger=require('../../config/logger')(_0x3524('0x6'));var config=require('../../config/environment');var jayson=require(_0x3524('0x7'));var client=jayson[_0x3524('0x8')][_0x3524('0x9')]({'port':0x232a});config['redis']=_[_0x3524('0xa')](config[_0x3524('0xb')],{'host':_0x3524('0xc'),'port':0x18eb});var socket=require(_0x3524('0xd'))(new Redis(config[_0x3524('0xb')]));require(_0x3524('0xe'))[_0x3524('0xf')](socket);function respondWithRpcPromise(_0x269d8e,_0x5dfb25,_0x13784e){return new BPromise(function(_0x3b2a85,_0x338ac7){return client[_0x3524('0x10')](_0x269d8e,_0x13784e)[_0x3524('0x11')](function(_0x382d5c){logger[_0x3524('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x5dfb25,_0x3524('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5dfb25,_0x3524('0x13'),JSON[_0x3524('0x14')](_0x382d5c));if(_0x382d5c['error']){if(_0x382d5c[_0x3524('0x15')][_0x3524('0x16')]===0x1f4){logger['error'](_0x3524('0x17'),_0x5dfb25,_0x382d5c['error'][_0x3524('0x18')]);return _0x338ac7(_0x382d5c[_0x3524('0x15')][_0x3524('0x18')]);}logger[_0x3524('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5dfb25,_0x382d5c['error'][_0x3524('0x18')]);return _0x3b2a85(_0x382d5c[_0x3524('0x15')][_0x3524('0x18')]);}else{logger[_0x3524('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x5dfb25,_0x3524('0x13'));_0x3b2a85(_0x382d5c['result']['message']);}})[_0x3524('0x19')](function(_0x5c155c){logger[_0x3524('0x15')](_0x3524('0x17'),_0x5dfb25,_0x5c155c);_0x338ac7(_0x5c155c);});});}exports[_0x3524('0x1a')]=function(_0x3acf7d){var _0x2b2fdf=this;return new Promise(function(_0x29152c,_0x473472){return db[_0x3524('0x1b')][_0x3524('0x1c')](_0x3acf7d[_0x3524('0x1d')],{'raw':_0x3acf7d[_0x3524('0x1e')]?_0x3acf7d[_0x3524('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3e9cfb){logger['info'](_0x3524('0x1a'),_0x3acf7d);logger[_0x3524('0x1f')](_0x3524('0x1a'),_0x3acf7d,JSON[_0x3524('0x14')](_0x3e9cfb));_0x29152c(_0x3e9cfb);})['catch'](function(_0x258415){logger[_0x3524('0x15')](_0x3524('0x1a'),_0x258415[_0x3524('0x18')],_0x3acf7d);_0x473472(_0x2b2fdf[_0x3524('0x15')](0x1f4,_0x258415[_0x3524('0x18')]));});});}; \ No newline at end of file +var _0x0587=['error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','info','lodash','util','moment','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0587,0x114));var _0x7058=function(_0x3c6ff6,_0x4e136a){_0x3c6ff6=_0x3c6ff6-0x0;var _0x4ac5ba=_0x0587[_0x3c6ff6];return _0x4ac5ba;};'use strict';var _=require(_0x7058('0x0'));var util=require(_0x7058('0x1'));var moment=require(_0x7058('0x2'));var BPromise=require('bluebird');var rs=require(_0x7058('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7058('0x4'))('rpc');var config=require(_0x7058('0x5'));var jayson=require(_0x7058('0x6'));var client=jayson[_0x7058('0x7')][_0x7058('0x8')]({'port':0x232a});config[_0x7058('0x9')]=_[_0x7058('0xa')](config[_0x7058('0x9')],{'host':_0x7058('0xb'),'port':0x18eb});var socket=require(_0x7058('0xc'))(new Redis(config['redis']));require(_0x7058('0xd'))[_0x7058('0xe')](socket);function respondWithRpcPromise(_0x41bf4a,_0x4d6f0b,_0x1d2e02){return new BPromise(function(_0x5ce92e,_0x5cbb51){return client[_0x7058('0xf')](_0x41bf4a,_0x1d2e02)['then'](function(_0x4cd4f5){logger['info'](_0x7058('0x10'),_0x4d6f0b,_0x7058('0x11'));logger[_0x7058('0x12')](_0x7058('0x13'),_0x4d6f0b,_0x7058('0x11'),JSON[_0x7058('0x14')](_0x4cd4f5));if(_0x4cd4f5['error']){if(_0x4cd4f5[_0x7058('0x15')]['code']===0x1f4){logger[_0x7058('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4d6f0b,_0x4cd4f5[_0x7058('0x15')][_0x7058('0x16')]);return _0x5cbb51(_0x4cd4f5[_0x7058('0x15')][_0x7058('0x16')]);}logger[_0x7058('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4d6f0b,_0x4cd4f5['error'][_0x7058('0x16')]);return _0x5ce92e(_0x4cd4f5[_0x7058('0x15')][_0x7058('0x16')]);}else{logger['info'](_0x7058('0x10'),_0x4d6f0b,_0x7058('0x11'));_0x5ce92e(_0x4cd4f5[_0x7058('0x17')][_0x7058('0x16')]);}})[_0x7058('0x18')](function(_0x52d28a){logger[_0x7058('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4d6f0b,_0x52d28a);_0x5cbb51(_0x52d28a);});});}exports[_0x7058('0x19')]=function(_0x312a68){var _0x2f6ff7=this;return new Promise(function(_0x568a58,_0x243e5d){return db[_0x7058('0x1a')][_0x7058('0x1b')](_0x312a68[_0x7058('0x1c')],{'raw':_0x312a68['options']?_0x312a68[_0x7058('0x1d')][_0x7058('0x1e')]===undefined?!![]:![]:!![]})[_0x7058('0x1f')](function(_0xce3a92){logger[_0x7058('0x20')](_0x7058('0x19'),_0x312a68);logger[_0x7058('0x12')](_0x7058('0x19'),_0x312a68,JSON['stringify'](_0xce3a92));_0x568a58(_0xce3a92);})[_0x7058('0x18')](function(_0x6aad47){logger[_0x7058('0x15')]('CreateWhatsappMessage',_0x6aad47[_0x7058('0x16')],_0x312a68);_0x243e5d(_0x2f6ff7[_0x7058('0x15')](0x1f4,_0x6aad47[_0x7058('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 94b7f00..8026cea 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e54=['length','./whatsappMessage.events','save','remove','update','removeListener','register'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x0e54,0xda));var _0x40e5=function(_0x216202,_0x1550b7){_0x216202=_0x216202-0x0;var _0x32661e=_0x0e54[_0x216202];return _0x32661e;};'use strict';var WhatsappMessageEvents=require(_0x40e5('0x0'));var events=[_0x40e5('0x1'),_0x40e5('0x2'),_0x40e5('0x3')];function createListener(_0xf37bdf,_0x276938){return function(_0x166279){_0x276938['emit'](_0xf37bdf,_0x166279);};}function removeListener(_0x15c7f4,_0x2beb48){return function(){WhatsappMessageEvents[_0x40e5('0x4')](_0x15c7f4,_0x2beb48);};}exports[_0x40e5('0x5')]=function(_0x3550e9){for(var _0x103520=0x0,_0x43466a=events[_0x40e5('0x6')];_0x103520<_0x43466a;_0x103520++){var _0x51bcf7=events[_0x103520];var _0x3db9dc=createListener('whatsappMessage:'+_0x51bcf7,_0x3550e9);WhatsappMessageEvents['on'](_0x51bcf7,_0x3db9dc);}}; \ No newline at end of file +var _0x80e5=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x161993,_0x1b8849){var _0x28e018=function(_0xfcf60a){while(--_0xfcf60a){_0x161993['push'](_0x161993['shift']());}};_0x28e018(++_0x1b8849);}(_0x80e5,0x1cc));var _0x580e=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x80e5[_0x3f6e26];return _0x474345;};'use strict';var WhatsappMessageEvents=require(_0x580e('0x0'));var events=[_0x580e('0x1'),_0x580e('0x2'),_0x580e('0x3')];function createListener(_0x545c49,_0x3d7725){return function(_0x4dac5b){_0x3d7725[_0x580e('0x4')](_0x545c49,_0x4dac5b);};}function removeListener(_0x48119a,_0x11b1d5){return function(){WhatsappMessageEvents[_0x580e('0x5')](_0x48119a,_0x11b1d5);};}exports[_0x580e('0x6')]=function(_0x374237){for(var _0x4fd017=0x0,_0x56f470=events['length'];_0x4fd017<_0x56f470;_0x4fd017++){var _0x537194=events[_0x4fd017];var _0x5ddaa0=createListener(_0x580e('0x7')+_0x537194,_0x374237);WhatsappMessageEvents['on'](_0x537194,_0x5ddaa0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index de5ddfc..c042709 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc50f=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','index','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','addTeams','update','delete','destroy','/:id/teams'];(function(_0x2cf5f8,_0x21b175){var _0x6ed7f0=function(_0x233d27){while(--_0x233d27){_0x2cf5f8['push'](_0x2cf5f8['shift']());}};_0x6ed7f0(++_0x21b175);}(_0xc50f,0x153));var _0xfc50=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc50f[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xfc50('0x0'));var util=require(_0xfc50('0x1'));var path=require(_0xfc50('0x2'));var timeout=require(_0xfc50('0x3'));var express=require('express');var router=express[_0xfc50('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc50('0x5'));var config=require(_0xfc50('0x6'));var controller=require(_0xfc50('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc50('0x8')]);router[_0xfc50('0x9')]('/describe',auth[_0xfc50('0xa')](),controller[_0xfc50('0xb')]);router[_0xfc50('0x9')](_0xfc50('0xc'),auth[_0xfc50('0xa')](),controller[_0xfc50('0xd')]);router[_0xfc50('0x9')](_0xfc50('0xe'),auth[_0xfc50('0xa')](),controller[_0xfc50('0xf')]);router[_0xfc50('0x9')]('/:id/teams',auth[_0xfc50('0xa')](),controller[_0xfc50('0x10')]);router[_0xfc50('0x9')](_0xfc50('0x11'),auth[_0xfc50('0xa')](),controller[_0xfc50('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfc50('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xfc50('0x14')]);router[_0xfc50('0x13')]('/:id/users',auth[_0xfc50('0xa')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfc50('0x15')]);router[_0xfc50('0x16')](_0xfc50('0xc'),auth['isAuthenticated'](),controller[_0xfc50('0x17')]);router[_0xfc50('0x16')](_0xfc50('0x18'),auth[_0xfc50('0xa')](),controller[_0xfc50('0x19')]);router['delete'](_0xfc50('0x11'),auth[_0xfc50('0xa')](),controller[_0xfc50('0x1a')]);module[_0xfc50('0x1b')]=router; \ No newline at end of file +var _0xf446=['isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get'];(function(_0x471dbb,_0x50a0ed){var _0x16911f=function(_0x9ca5b4){while(--_0x9ca5b4){_0x471dbb['push'](_0x471dbb['shift']());}};_0x16911f(++_0x50a0ed);}(_0xf446,0x1c0));var _0x6f44=function(_0x5ea279,_0x348468){_0x5ea279=_0x5ea279-0x0;var _0x4376e5=_0xf446[_0x5ea279];return _0x4376e5;};'use strict';var multer=require(_0x6f44('0x0'));var util=require('util');var path=require(_0x6f44('0x1'));var timeout=require(_0x6f44('0x2'));var express=require('express');var router=express[_0x6f44('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f44('0x4'));var interaction=require(_0x6f44('0x5'));var config=require('../../config/environment');var controller=require(_0x6f44('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6f44('0x7')]('/describe',auth[_0x6f44('0x8')](),controller['describe']);router['get'](_0x6f44('0x9'),auth['isAuthenticated'](),controller[_0x6f44('0xa')]);router[_0x6f44('0x7')](_0x6f44('0xb'),auth[_0x6f44('0x8')](),controller[_0x6f44('0xc')]);router[_0x6f44('0x7')](_0x6f44('0xd'),auth[_0x6f44('0x8')](),controller['getTeams']);router[_0x6f44('0x7')](_0x6f44('0xe'),auth[_0x6f44('0x8')](),controller['getAgents']);router[_0x6f44('0xf')]('/',auth[_0x6f44('0x8')](),controller[_0x6f44('0x10')]);router[_0x6f44('0xf')]('/:id/teams',auth[_0x6f44('0x8')](),controller['addTeams']);router[_0x6f44('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0x6f44('0x11')]);router[_0x6f44('0x12')](_0x6f44('0x9'),auth[_0x6f44('0x8')](),controller[_0x6f44('0x13')]);router[_0x6f44('0x14')](_0x6f44('0x9'),auth[_0x6f44('0x8')](),controller[_0x6f44('0x15')]);router[_0x6f44('0x14')](_0x6f44('0xd'),auth['isAuthenticated'](),controller[_0x6f44('0x16')]);router[_0x6f44('0x14')](_0x6f44('0xe'),auth[_0x6f44('0x8')](),controller[_0x6f44('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index eca4b61..f06fde3 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x049e=['roundrobin','STRING','sequelize','exports','name','ENUM','rrmemory','beepall'];(function(_0x123815,_0x3eb80c){var _0x435110=function(_0xcacd4){while(--_0xcacd4){_0x123815['push'](_0x123815['shift']());}};_0x435110(++_0x3eb80c);}(_0x049e,0x16a));var _0xe049=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x049e[_0x568a61];return _0x334c3b;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe049('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe049('0x3')](_0xe049('0x4'),_0xe049('0x5'),_0xe049('0x6'))},'description':{'type':Sequelize[_0xe049('0x7')]}}; \ No newline at end of file +var _0xb945=['roundrobin','sequelize','STRING','INTEGER','beepall'];(function(_0xd7cc70,_0x23394c){var _0x33fee6=function(_0x1ba0e1){while(--_0x1ba0e1){_0xd7cc70['push'](_0xd7cc70['shift']());}};_0x33fee6(++_0x23394c);}(_0xb945,0x97));var _0x5b94=function(_0x51cbd1,_0x183e5f){_0x51cbd1=_0x51cbd1-0x0;var _0x591c08=_0xb945[_0x51cbd1];return _0x591c08;};'use strict';var Sequelize=require(_0x5b94('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b94('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5b94('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5b94('0x3'),_0x5b94('0x4'))},'description':{'type':Sequelize[_0x5b94('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 651cdfd..3a36cf0 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb25a=['WhatsappQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','name','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','type','includeAll','include','findAll','rows','catch','show','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x1a1968,_0x4b58eb){var _0x4ba77c=function(_0x51a032){while(--_0x51a032){_0x1a1968['push'](_0x1a1968['shift']());}};_0x4ba77c(++_0x4b58eb);}(_0xb25a,0xcf));var _0xab25=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb25a[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xab25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab25('0x1'));var jsonpatch=require(_0xab25('0x2'));var rp=require(_0xab25('0x3'));var moment=require('moment');var BPromise=require(_0xab25('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab25('0x5'));var sox=require(_0xab25('0x6'));var csv=require(_0xab25('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab25('0x8'));var _=require(_0xab25('0x9'));var squel=require(_0xab25('0xa'));var crypto=require(_0xab25('0xb'));var jsforce=require(_0xab25('0xc'));var deskjs=require(_0xab25('0xd'));var toCsv=require(_0xab25('0x7'));var querystring=require(_0xab25('0xe'));var Papa=require(_0xab25('0xf'));var Redis=require(_0xab25('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xab25('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab25('0x12'));var logger=require(_0xab25('0x13'))(_0xab25('0x14'));var utils=require('../../config/utils');var config=require(_0xab25('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xab25('0x16'))['db'];config[_0xab25('0x17')]=_[_0xab25('0x18')](config[_0xab25('0x17')],{'host':_0xab25('0x19'),'port':0x18eb});var socket=require(_0xab25('0x1a'))(new Redis(config[_0xab25('0x17')]));require(_0xab25('0x1b'))[_0xab25('0x1c')](socket);function respondWithStatusCode(_0x5b7488,_0x3fced5){_0x3fced5=_0x3fced5||0xcc;return function(_0x2a71d5){if(_0x2a71d5){return _0x5b7488[_0xab25('0x1d')](_0x3fced5);}return _0x5b7488[_0xab25('0x1e')](_0x3fced5)[_0xab25('0x1f')]();};}function respondWithResult(_0x485289,_0x5f8996){_0x5f8996=_0x5f8996||0xc8;return function(_0x555d4e){if(_0x555d4e){return _0x485289[_0xab25('0x1e')](_0x5f8996)[_0xab25('0x20')](_0x555d4e);}};}function respondWithFilteredResult(_0x5c0da9,_0x5daece){return function(_0x4770ae){if(_0x4770ae){var _0xa9b6f9=typeof _0x5daece[_0xab25('0x21')]===_0xab25('0x22')&&typeof _0x5daece[_0xab25('0x23')]==='undefined';var _0x58d165=_0x4770ae[_0xab25('0x24')];var _0x46cf8c=_0xa9b6f9?0x0:_0x5daece[_0xab25('0x21')];var _0x3f9ff3=_0xa9b6f9?_0x4770ae['count']:_0x5daece['offset']+_0x5daece[_0xab25('0x23')];var _0x93176f;if(_0x3f9ff3>=_0x58d165){_0x3f9ff3=_0x58d165;_0x93176f=0xc8;}else{_0x93176f=0xce;}_0x5c0da9['status'](_0x93176f);return _0x5c0da9[_0xab25('0x25')](_0xab25('0x26'),_0x46cf8c+'-'+_0x3f9ff3+'/'+_0x58d165)['json'](_0x4770ae);}return null;};}function patchUpdates(_0x2dd188){return function(_0xa65e59){try{jsonpatch['apply'](_0xa65e59,_0x2dd188,!![]);}catch(_0x542f98){return BPromise['reject'](_0x542f98);}return _0xa65e59[_0xab25('0x27')]();};}function saveUpdates(_0x357ca6,_0x3438f3){return function(_0x5e16f8){if(_0x5e16f8){return _0x5e16f8[_0xab25('0x28')](_0x357ca6)[_0xab25('0x29')](function(_0x25cb08){return _0x25cb08;});}return null;};}function removeEntity(_0x454897,_0x4eb40e){return function(_0x2d91ef){if(_0x2d91ef){return _0x2d91ef[_0xab25('0x2a')]()[_0xab25('0x29')](function(){var _0x594e49=_0x2d91ef[_0xab25('0x2b')]({'plain':!![]});var _0x44b26e='WhatsappQueues';return db[_0xab25('0x2c')]['destroy']({'where':{'type':_0x44b26e,'resourceId':_0x594e49['id']}})[_0xab25('0x29')](function(){return _0x2d91ef;});})[_0xab25('0x29')](function(){_0x454897[_0xab25('0x1e')](0xcc)[_0xab25('0x1f')]();});}};}function handleEntityNotFound(_0x485bff,_0x2e6d7d){return function(_0x30638b){if(!_0x30638b){_0x485bff[_0xab25('0x1d')](0x194);}return _0x30638b;};}function handleError(_0x56dcd4,_0x281b06){_0x281b06=_0x281b06||0x1f4;return function(_0x28adfa){logger[_0xab25('0x2d')](_0x28adfa['stack']);if(_0x28adfa[_0xab25('0x2e')]){delete _0x28adfa[_0xab25('0x2e')];}_0x56dcd4[_0xab25('0x1e')](_0x281b06)['send'](_0x28adfa);};}exports[_0xab25('0x2f')]=function(_0x4c420c,_0x1adc0f){var _0x581f57={},_0x19f57a={},_0x9d6102={'count':0x0,'rows':[]};var _0x494551=_[_0xab25('0x30')](db[_0xab25('0x31')][_0xab25('0x32')],function(_0x106ed9){return{'name':_0x106ed9[_0xab25('0x33')],'type':_0x106ed9['type'][_0xab25('0x34')]};});_0x19f57a[_0xab25('0x35')]=_[_0xab25('0x30')](_0x494551,_0xab25('0x2e'));_0x19f57a[_0xab25('0x36')]=_[_0xab25('0x37')](_0x4c420c[_0xab25('0x36')]);_0x19f57a[_0xab25('0x38')]=_[_0xab25('0x39')](_0x19f57a['model'],_0x19f57a[_0xab25('0x36')]);_0x581f57[_0xab25('0x3a')]=_[_0xab25('0x39')](_0x19f57a['model'],qs['fields'](_0x4c420c[_0xab25('0x36')][_0xab25('0x3b')]));_0x581f57[_0xab25('0x3a')]=_0x581f57[_0xab25('0x3a')][_0xab25('0x3c')]?_0x581f57[_0xab25('0x3a')]:_0x19f57a[_0xab25('0x35')];if(!_0x4c420c['query'][_0xab25('0x3d')](_0xab25('0x3e'))){_0x581f57[_0xab25('0x23')]=qs[_0xab25('0x23')](_0x4c420c[_0xab25('0x36')][_0xab25('0x23')]);_0x581f57['offset']=qs['offset'](_0x4c420c[_0xab25('0x36')]['offset']);}_0x581f57['order']=qs['sort'](_0x4c420c[_0xab25('0x36')][_0xab25('0x3f')]);_0x581f57['where']=qs['filters'](_[_0xab25('0x40')](_0x4c420c['query'],_0x19f57a[_0xab25('0x38')]),_0x494551);if(_0x4c420c['query']['filter']){_0x581f57['where']=_[_0xab25('0x41')](_0x581f57[_0xab25('0x42')],{'$or':_[_0xab25('0x30')](_0x494551,function(_0x20b368){if(_0x20b368[_0xab25('0x43')]!=='VIRTUAL'){var _0x225473={};_0x225473[_0x20b368[_0xab25('0x2e')]]={'$like':'%'+_0x4c420c['query']['filter']+'%'};return _0x225473;}})});}_0x581f57=_[_0xab25('0x41')]({},_0x581f57,_0x4c420c['options']);var _0x15ae59={'where':_0x581f57[_0xab25('0x42')]};return db[_0xab25('0x31')][_0xab25('0x24')](_0x15ae59)[_0xab25('0x29')](function(_0x47ccf0){_0x9d6102[_0xab25('0x24')]=_0x47ccf0;if(_0x4c420c['query'][_0xab25('0x44')]){_0x581f57[_0xab25('0x45')]=[{'all':!![]}];}return db[_0xab25('0x31')][_0xab25('0x46')](_0x581f57);})['then'](function(_0x1c3f20){_0x9d6102[_0xab25('0x47')]=_0x1c3f20;return _0x9d6102;})[_0xab25('0x29')](respondWithFilteredResult(_0x1adc0f,_0x581f57))[_0xab25('0x48')](handleError(_0x1adc0f,null));};exports[_0xab25('0x49')]=function(_0x390f83,_0x475bbc){var _0x507488={'raw':!![],'where':{'id':_0x390f83['params']['id']}},_0x82c1f1={};_0x82c1f1[_0xab25('0x35')]=_[_0xab25('0x37')](db[_0xab25('0x31')][_0xab25('0x32')]);_0x82c1f1['query']=_[_0xab25('0x37')](_0x390f83[_0xab25('0x36')]);_0x82c1f1['filters']=_['intersection'](_0x82c1f1['model'],_0x82c1f1[_0xab25('0x36')]);_0x507488['attributes']=_[_0xab25('0x39')](_0x82c1f1[_0xab25('0x35')],qs['fields'](_0x390f83['query'][_0xab25('0x3b')]));_0x507488[_0xab25('0x3a')]=_0x507488[_0xab25('0x3a')][_0xab25('0x3c')]?_0x507488[_0xab25('0x3a')]:_0x82c1f1[_0xab25('0x35')];if(_0x390f83[_0xab25('0x36')][_0xab25('0x44')]){_0x507488[_0xab25('0x45')]=[{'all':!![]}];}_0x507488=_[_0xab25('0x41')]({},_0x507488,_0x390f83[_0xab25('0x4a')]);return db[_0xab25('0x31')]['find'](_0x507488)[_0xab25('0x29')](handleEntityNotFound(_0x475bbc,null))[_0xab25('0x29')](respondWithResult(_0x475bbc,null))[_0xab25('0x48')](handleError(_0x475bbc,null));};exports[_0xab25('0x4b')]=function(_0x2bffe2,_0x16e9a7){return db[_0xab25('0x31')][_0xab25('0x4b')](_0x2bffe2['body'],{})[_0xab25('0x29')](function(_0xf4447d){var _0x17368a=_0x2bffe2['user'][_0xab25('0x2b')]({'plain':!![]});if(!_0x17368a)throw new Error(_0xab25('0x4c'));if(_0x17368a[_0xab25('0x4d')]===_0xab25('0x4e')){var _0x2b52ed=_0xf4447d[_0xab25('0x2b')]({'plain':!![]});var _0x25b2ef=_0xab25('0x4f');return db[_0xab25('0x50')][_0xab25('0x51')]({'where':{'name':_0x25b2ef,'userProfileId':_0x17368a[_0xab25('0x52')]},'raw':!![]})['then'](function(_0x3f41df){if(_0x3f41df&&_0x3f41df['autoAssociation']===0x0){return db[_0xab25('0x2c')][_0xab25('0x4b')]({'name':_0x2b52ed['name'],'resourceId':_0x2b52ed['id'],'type':_0x3f41df[_0xab25('0x2e')],'sectionId':_0x3f41df['id']},{})[_0xab25('0x29')](function(){return _0xf4447d;});}else{return _0xf4447d;}})['catch'](function(_0x5708ff){logger[_0xab25('0x2d')](_0xab25('0x53'),_0x5708ff);throw _0x5708ff;});}return _0xf4447d;})[_0xab25('0x29')](respondWithResult(_0x16e9a7,0xc9))['catch'](handleError(_0x16e9a7,null));};exports[_0xab25('0x28')]=function(_0x4e94b4,_0x7bee07){if(_0x4e94b4['body']['id']){delete _0x4e94b4[_0xab25('0x54')]['id'];}return db[_0xab25('0x31')][_0xab25('0x51')]({'where':{'id':_0x4e94b4[_0xab25('0x55')]['id']}})[_0xab25('0x29')](handleEntityNotFound(_0x7bee07,null))[_0xab25('0x29')](saveUpdates(_0x4e94b4[_0xab25('0x54')],null))[_0xab25('0x29')](respondWithResult(_0x7bee07,null))[_0xab25('0x48')](handleError(_0x7bee07,null));};exports[_0xab25('0x2a')]=function(_0x666b31,_0xa3bbb){return db[_0xab25('0x31')][_0xab25('0x51')]({'where':{'id':_0x666b31[_0xab25('0x55')]['id']}})[_0xab25('0x29')](handleEntityNotFound(_0xa3bbb,null))[_0xab25('0x29')](removeEntity(_0xa3bbb,null))[_0xab25('0x48')](handleError(_0xa3bbb,null));};exports[_0xab25('0x56')]=function(_0x30805f,_0x428a0b){return db[_0xab25('0x31')][_0xab25('0x56')]()[_0xab25('0x29')](respondWithResult(_0x428a0b,null))['catch'](handleError(_0x428a0b,null));};exports[_0xab25('0x57')]=function(_0x18fa2c,_0x14fdbb,_0x4d243e){var _0x5f45cc={'raw':!![],'where':{}},_0x3a3429={},_0x17db80;return db[_0xab25('0x31')][_0xab25('0x58')]({'where':{'id':_0x18fa2c[_0xab25('0x55')]['id']}})['then'](handleEntityNotFound(_0x14fdbb,null))['then'](function(_0x25ca6b){if(_0x25ca6b){_0x17db80=_0x25ca6b[_0xab25('0x2b')]({'plain':!![]});_0x3a3429[_0xab25('0x35')]=_['keys'](db[_0xab25('0x59')]['rawAttributes']);_0x3a3429[_0xab25('0x36')]=_[_0xab25('0x37')](_0x18fa2c['query']);_0x3a3429[_0xab25('0x38')]=_[_0xab25('0x39')](_0x3a3429[_0xab25('0x35')],_0x3a3429[_0xab25('0x36')]);_0x5f45cc[_0xab25('0x3a')]=_[_0xab25('0x39')](_0x3a3429[_0xab25('0x35')],qs[_0xab25('0x3b')](_0x18fa2c[_0xab25('0x36')][_0xab25('0x3b')]));_0x5f45cc[_0xab25('0x3a')]=_0x5f45cc[_0xab25('0x3a')]['length']?_0x5f45cc[_0xab25('0x3a')]:_0x3a3429[_0xab25('0x35')];if(!_0x18fa2c[_0xab25('0x36')]['hasOwnProperty'](_0xab25('0x3e'))){_0x5f45cc[_0xab25('0x23')]=qs[_0xab25('0x23')](_0x18fa2c['query'][_0xab25('0x23')]);_0x5f45cc[_0xab25('0x21')]=qs[_0xab25('0x21')](_0x18fa2c[_0xab25('0x36')][_0xab25('0x21')]);}_0x5f45cc[_0xab25('0x5a')]=qs[_0xab25('0x3f')](_0x18fa2c['query'][_0xab25('0x3f')]);_0x5f45cc[_0xab25('0x42')]=qs[_0xab25('0x38')](_[_0xab25('0x40')](_0x18fa2c[_0xab25('0x36')],_0x3a3429['filters']));_0x5f45cc[_0xab25('0x42')][_0xab25('0x5b')]=_0x25ca6b['id'];if(_0x18fa2c[_0xab25('0x36')][_0xab25('0x5c')]){_0x5f45cc[_0xab25('0x42')]=_[_0xab25('0x41')](_0x5f45cc['where'],{'$or':_[_0xab25('0x30')](_0x5f45cc[_0xab25('0x3a')],function(_0x22e886){var _0x27fea5={};_0x27fea5[_0x22e886]={'$like':'%'+_0x18fa2c[_0xab25('0x36')][_0xab25('0x5c')]+'%'};return _0x27fea5;})});}_0x5f45cc=_[_0xab25('0x41')]({},_0x5f45cc,_0x18fa2c[_0xab25('0x4a')]);return db[_0xab25('0x59')][_0xab25('0x46')](_0x5f45cc);}})[_0xab25('0x29')](function(_0x3e851d){if(_0x3e851d){return db[_0xab25('0x5d')][_0xab25('0x5e')]({'where':{'id':_[_0xab25('0x30')](_0x3e851d,_0xab25('0x5f')),'role':_0xab25('0x60')},'attributes':['id',_0xab25('0x2e'),_0xab25('0x61'),_0xab25('0x62'),_0xab25('0x63')]});}})[_0xab25('0x29')](function(_0x4202a4){if(_0x4202a4){return{'count':_0x4202a4[_0xab25('0x24')],'rows':_[_0xab25('0x30')](_0x4202a4[_0xab25('0x47')],function(_0x1050be){return{'membername':_0x1050be[_0xab25('0x2e')],'UserId':_0x1050be['id'],'queue_name':_0x17db80[_0xab25('0x2e')],'WhatsappQueueId':_0x17db80['id'],'interface':util[_0xab25('0x64')](_0xab25('0x65'),_0xab25('0x66'),_0x1050be[_0xab25('0x2e')]),'penalty':0x0,'paused':_0x1050be['whatsappPause'],'createdAt':_0x1050be[_0xab25('0x63')],'updatedAt':_0x1050be[_0xab25('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xab25('0x29')](respondWithFilteredResult(_0x14fdbb,_0x5f45cc))[_0xab25('0x48')](handleError(_0x14fdbb,null));};exports[_0xab25('0x67')]=function(_0x5b687c,_0x1db56a,_0x4d94fe){var _0x10ce81={};var _0x406f0d={};var _0x114452;var _0x5be683;return db[_0xab25('0x31')][_0xab25('0x58')]({'where':{'id':_0x5b687c[_0xab25('0x55')]['id']}})['then'](handleEntityNotFound(_0x1db56a,null))[_0xab25('0x29')](function(_0x5611fe){if(_0x5611fe){_0x114452=_0x5611fe;_0x406f0d[_0xab25('0x35')]=_['keys'](db[_0xab25('0x68')][_0xab25('0x32')]);_0x406f0d[_0xab25('0x36')]=_[_0xab25('0x37')](_0x5b687c[_0xab25('0x36')]);_0x406f0d[_0xab25('0x38')]=_[_0xab25('0x39')](_0x406f0d[_0xab25('0x35')],_0x406f0d[_0xab25('0x36')]);_0x10ce81[_0xab25('0x3a')]=_['intersection'](_0x406f0d['model'],qs[_0xab25('0x3b')](_0x5b687c[_0xab25('0x36')][_0xab25('0x3b')]));_0x10ce81[_0xab25('0x3a')]=_0x10ce81[_0xab25('0x3a')][_0xab25('0x3c')]?_0x10ce81[_0xab25('0x3a')]:_0x406f0d[_0xab25('0x35')];_0x10ce81[_0xab25('0x5a')]=qs[_0xab25('0x3f')](_0x5b687c[_0xab25('0x36')]['sort']);_0x10ce81['where']=qs[_0xab25('0x38')](_[_0xab25('0x40')](_0x5b687c[_0xab25('0x36')],_0x406f0d['filters']));if(_0x5b687c[_0xab25('0x36')][_0xab25('0x5c')]){_0x10ce81[_0xab25('0x42')]=_[_0xab25('0x41')](_0x10ce81[_0xab25('0x42')],{'$or':_[_0xab25('0x30')](_0x10ce81[_0xab25('0x3a')],function(_0x515fd3){var _0x54a9e6={};_0x54a9e6[_0x515fd3]={'$like':'%'+_0x5b687c[_0xab25('0x36')][_0xab25('0x5c')]+'%'};return _0x54a9e6;})});}_0x10ce81=_[_0xab25('0x41')]({},_0x10ce81,_0x5b687c[_0xab25('0x4a')]);return _0x114452[_0xab25('0x67')](_0x10ce81);}})[_0xab25('0x29')](function(_0x41ac38){if(_0x41ac38){_0x5be683=_0x41ac38['length'];if(!_0x5b687c[_0xab25('0x36')][_0xab25('0x3d')](_0xab25('0x3e'))){_0x10ce81[_0xab25('0x23')]=qs[_0xab25('0x23')](_0x5b687c[_0xab25('0x36')][_0xab25('0x23')]);_0x10ce81[_0xab25('0x21')]=qs[_0xab25('0x21')](_0x5b687c['query']['offset']);}return _0x114452[_0xab25('0x67')](_0x10ce81);}})[_0xab25('0x29')](function(_0x18531f){if(_0x18531f){return _0x18531f?{'count':_0x5be683,'rows':_0x18531f}:null;}})[_0xab25('0x29')](respondWithResult(_0x1db56a,null))[_0xab25('0x48')](handleError(_0x1db56a,null));};exports[_0xab25('0x69')]=function(_0x4d6764,_0x58f6a1,_0x3aff2c){var _0x14305b=_0x4d6764['body'][_0xab25('0x6a')];return db['Team'][_0xab25('0x46')]({'where':{'id':_0x14305b},'attributes':['id'],'include':[{'model':db[_0xab25('0x5d')],'as':_0xab25('0x6b'),'attributes':['id',_0xab25('0x2e'),'online',_0xab25('0x6c'),_0xab25('0x6d')],'raw':!![]}]})[_0xab25('0x29')](function(_0x3516c0){if(_0x3516c0){var _0x1b708e=_[_0xab25('0x6e')](_0x3516c0,function(_0x3e4818){var _0x4fd7ce=_0x3e4818['get']({'plain':!![]});return _0x4fd7ce[_0xab25('0x6b')];});return db[_0xab25('0x31')][_0xab25('0x51')]({'where':{'id':_0x4d6764[_0xab25('0x55')]['id']}})['then'](function(_0x32a550){return db[_0xab25('0x6f')][_0xab25('0x70')](function(_0x555245){return _0x32a550['addTeams'](_0x14305b,{'transaction':_0x555245})['then'](function(){return BPromise[_0xab25('0x71')](_0x1b708e,function(_0x56004a){return db[_0xab25('0x59')]['findOrCreate']({'where':{'UserId':_0x56004a['id'],'WhatsappQueueId':_0x4d6764[_0xab25('0x55')]['id']},'transaction':_0x555245});});})[_0xab25('0x29')](function(){_0x1b708e[_0xab25('0x72')](function(_0xbe51ab){socket[_0xab25('0x73')](_0xab25('0x74'),{'UserId':_0xbe51ab['id'],'WhatsappQueueId':_0x32a550['id']});});});});});}})[_0xab25('0x29')](respondWithStatusCode(_0x58f6a1,null))[_0xab25('0x48')](handleError(_0x58f6a1,null));};exports[_0xab25('0x75')]=function(_0x5d353a,_0x1daf6c,_0x302c62){return db[_0xab25('0x68')][_0xab25('0x46')]({'where':{'id':_0x5d353a['query'][_0xab25('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xab25('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xab25('0x29')](handleEntityNotFound(_0x1daf6c,null))[_0xab25('0x29')](function(_0x2a7b45){var _0x2475d1=_[_0xab25('0x30')](_0x2a7b45,'id');var _0x1930e1=[];var _0x282fdf=[];var _0x151794=squel['select']();_0x151794[_0xab25('0x76')](_0xab25('0x77'))['from'](_0xab25('0x78'),'tq')[_0xab25('0x79')](_0xab25('0x7a'),'ut',_0xab25('0x7b'))[_0xab25('0x42')](_0xab25('0x7c'),_0x5d353a[_0xab25('0x55')]['id']);for(var _0x5a25a7=0x0;_0x5a25a7<_0x2a7b45[_0xab25('0x3c')];_0x5a25a7+=0x1){let _0x11be3f=_0x2a7b45[_0x5a25a7];for(var _0x561dc7=0x0;_0x561dc7<_0x11be3f[_0xab25('0x6b')]['length'];_0x561dc7+=0x1){let _0xb48fe3=_0x11be3f[_0xab25('0x6b')][_0x561dc7];var _0x8b17ed=_0x151794[_0xab25('0x7d')]();_0x8b17ed[_0xab25('0x42')](_0xab25('0x7e'),_0xb48fe3['id']);_0x282fdf[_0xab25('0x7f')](db[_0xab25('0x6f')][_0xab25('0x36')](_0x8b17ed[_0xab25('0x80')](),{'type':db['sequelize'][_0xab25('0x81')][_0xab25('0x82')]})[_0xab25('0x29')](function(_0x3d6fb3){if(_0x3d6fb3[_0xab25('0x3c')]===0x1){return _0xb48fe3['id'];}else{var _0x7a113c=_['every'](_[_0xab25('0x30')](_0x3d6fb3,_0xab25('0x83')),function(_0x109d28){return _[_0xab25('0x84')](_0x2475d1,_0x109d28);});if(_0x7a113c){return _0xb48fe3['id'];}}}));}}return BPromise['all'](_0x282fdf)[_0xab25('0x29')](function(_0x494790){_0x1930e1=_(_0x1930e1)['union'](_0x494790)[_0xab25('0x85')]()[_0xab25('0x86')]();return db['WhatsappQueue'][_0xab25('0x51')]({'where':{'id':_0x5d353a[_0xab25('0x55')]['id']}})[_0xab25('0x29')](function(_0x57ba6c){return db['sequelize'][_0xab25('0x70')](function(_0x4bd803){return _0x57ba6c[_0xab25('0x75')](_0x5d353a[_0xab25('0x36')]['ids'],{'transaction':_0x4bd803})['then'](function(){if(!_[_0xab25('0x87')](_0x1930e1)){return _0x57ba6c[_0xab25('0x88')](_0x1930e1,{'transaction':_0x4bd803});}})[_0xab25('0x29')](function(){_0x1930e1[_0xab25('0x72')](function(_0x238438){socket[_0xab25('0x73')]('userWhatsappQueue:remove',{'UserId':_0x238438,'WhatsappQueueId':_0x57ba6c['id']});});});});});});})[_0xab25('0x29')](respondWithStatusCode(_0x1daf6c,null))[_0xab25('0x48')](handleError(_0x1daf6c,null));};exports[_0xab25('0x89')]=function(_0x4f1676,_0x219c4c,_0x2e51c){return db[_0xab25('0x31')][_0xab25('0x51')]({'where':{'id':_0x4f1676[_0xab25('0x55')]['id']}})['then'](handleEntityNotFound(_0x219c4c,null))[_0xab25('0x29')](function(_0xf58c61){if(_0xf58c61){return _0xf58c61['addAgents'](_0x4f1676[_0xab25('0x54')][_0xab25('0x6a')],_[_0xab25('0x8a')](_0x4f1676[_0xab25('0x54')],[_0xab25('0x6a'),'id'])||{})[_0xab25('0x8b')](function(_0x3a1191){for(var _0x3856a7=0x0;_0x3856a7<_0x4f1676['body']['ids'][_0xab25('0x3c')];_0x3856a7+=0x1){socket[_0xab25('0x73')]('userWhatsappQueue:save',{'UserId':Number(_0x4f1676[_0xab25('0x54')][_0xab25('0x6a')][_0x3856a7]),'WhatsappQueueId':Number(_0x4f1676[_0xab25('0x55')]['id'])});}return _0x3a1191;});}})[_0xab25('0x29')](respondWithResult(_0x219c4c,null))[_0xab25('0x48')](handleError(_0x219c4c,null));};exports[_0xab25('0x88')]=function(_0x25037f,_0x1b6e29,_0x1c3119){return db[_0xab25('0x31')][_0xab25('0x51')]({'where':{'id':_0x25037f['params']['id']}})['then'](handleEntityNotFound(_0x1b6e29,null))[_0xab25('0x29')](function(_0x37fe36){if(_0x37fe36){return _0x37fe36[_0xab25('0x88')](_0x25037f[_0xab25('0x36')]['ids'])[_0xab25('0x29')](function(){if(_[_0xab25('0x8c')](_0x25037f[_0xab25('0x36')]['ids'])){for(var _0x395a01=0x0;_0x395a01<_0x25037f[_0xab25('0x36')][_0xab25('0x6a')][_0xab25('0x3c')];_0x395a01+=0x1){socket[_0xab25('0x73')](_0xab25('0x8d'),{'UserId':Number(_0x25037f['query'][_0xab25('0x6a')][_0x395a01]),'WhatsappQueueId':Number(_0x25037f['params']['id'])});}}else{socket[_0xab25('0x73')](_0xab25('0x8d'),{'UserId':Number(_0x25037f[_0xab25('0x36')][_0xab25('0x6a')]),'WhatsappQueueId':Number(_0x25037f['params']['id'])});}});}})[_0xab25('0x29')](respondWithStatusCode(_0x1b6e29,null))[_0xab25('0x48')](handleError(_0x1b6e29,null));};exports['getAgents']=function(_0x2608e7,_0x2df5fe,_0x5974ba){var _0x18a473={};var _0x2315ca={};var _0x3c3d9f;var _0x4ffccb;return db[_0xab25('0x31')][_0xab25('0x58')]({'where':{'id':_0x2608e7[_0xab25('0x55')]['id']}})['then'](handleEntityNotFound(_0x2df5fe,null))['then'](function(_0xb20892){if(_0xb20892){_0x3c3d9f=_0xb20892;_0x2315ca[_0xab25('0x35')]=_[_0xab25('0x37')](db['User']['rawAttributes']);_0x2315ca[_0xab25('0x36')]=_['keys'](_0x2608e7['query']);_0x2315ca['filters']=_[_0xab25('0x39')](_0x2315ca[_0xab25('0x35')],_0x2315ca[_0xab25('0x36')]);_0x18a473[_0xab25('0x3a')]=_[_0xab25('0x39')](_0x2315ca[_0xab25('0x35')],qs[_0xab25('0x3b')](_0x2608e7[_0xab25('0x36')]['fields']));_0x18a473[_0xab25('0x3a')]=_0x18a473[_0xab25('0x3a')][_0xab25('0x3c')]?_0x18a473[_0xab25('0x3a')]:_0x2315ca[_0xab25('0x35')];_0x18a473[_0xab25('0x5a')]=qs[_0xab25('0x3f')](_0x2608e7['query'][_0xab25('0x3f')]);_0x18a473[_0xab25('0x42')]=qs['filters'](_[_0xab25('0x40')](_0x2608e7[_0xab25('0x36')],_0x2315ca['filters']));if(_0x2608e7['query'][_0xab25('0x5c')]){_0x18a473[_0xab25('0x42')]=_[_0xab25('0x41')](_0x18a473[_0xab25('0x42')],{'$or':_[_0xab25('0x30')](_0x18a473['attributes'],function(_0x491483){var _0x334e21={};_0x334e21[_0x491483]={'$like':'%'+_0x2608e7[_0xab25('0x36')][_0xab25('0x5c')]+'%'};return _0x334e21;})});}_0x18a473=_[_0xab25('0x41')]({},_0x18a473,_0x2608e7[_0xab25('0x4a')]);return _0x3c3d9f['getAgents'](_0x18a473);}})[_0xab25('0x29')](function(_0x4abb2a){if(_0x4abb2a){_0x4ffccb=_0x4abb2a['length'];if(!_0x2608e7[_0xab25('0x36')][_0xab25('0x3d')](_0xab25('0x3e'))){_0x18a473[_0xab25('0x23')]=qs[_0xab25('0x23')](_0x2608e7[_0xab25('0x36')][_0xab25('0x23')]);_0x18a473[_0xab25('0x21')]=qs[_0xab25('0x21')](_0x2608e7[_0xab25('0x36')][_0xab25('0x21')]);}return _0x3c3d9f[_0xab25('0x8e')](_0x18a473);}})[_0xab25('0x29')](function(_0x50a109){if(_0x50a109){return _0x50a109?{'count':_0x4ffccb,'rows':_0x50a109}:null;}})[_0xab25('0x29')](respondWithResult(_0x2df5fe,null))[_0xab25('0x48')](handleError(_0x2df5fe,null));}; \ No newline at end of file +var _0x1011=['set','Content-Range','apply','update','then','WhatsappQueues','UserProfileResource','destroy','status','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','length','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','nolimit','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userWhatsappQueue:save','ids','select','field','tq.TeamId','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','json','offset','undefined','limit','count'];(function(_0x57a402,_0x40596b){var _0x753a36=function(_0x13b76b){while(--_0x13b76b){_0x57a402['push'](_0x57a402['shift']());}};_0x753a36(++_0x40596b);}(_0x1011,0xf5));var _0x1101=function(_0xcca4ce,_0x50fbb6){_0xcca4ce=_0xcca4ce-0x0;var _0x4640ad=_0x1011[_0xcca4ce];return _0x4640ad;};'use strict';var emlformat=require(_0x1101('0x0'));var rimraf=require(_0x1101('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1101('0x2'));var rp=require(_0x1101('0x3'));var moment=require(_0x1101('0x4'));var BPromise=require(_0x1101('0x5'));var Mustache=require('mustache');var util=require(_0x1101('0x6'));var path=require('path');var sox=require(_0x1101('0x7'));var csv=require(_0x1101('0x8'));var ejs=require(_0x1101('0x9'));var fs=require('fs');var fs_extra=require(_0x1101('0xa'));var _=require(_0x1101('0xb'));var squel=require(_0x1101('0xc'));var crypto=require(_0x1101('0xd'));var jsforce=require(_0x1101('0xe'));var deskjs=require(_0x1101('0xf'));var toCsv=require(_0x1101('0x8'));var querystring=require(_0x1101('0x10'));var Papa=require('papaparse');var Redis=require(_0x1101('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1101('0x12'));var as=require(_0x1101('0x13'));var hardwareService=require(_0x1101('0x14'));var logger=require(_0x1101('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1101('0x16'));var licenseUtil=require(_0x1101('0x17'));var db=require(_0x1101('0x18'))['db'];config[_0x1101('0x19')]=_[_0x1101('0x1a')](config[_0x1101('0x19')],{'host':_0x1101('0x1b'),'port':0x18eb});var socket=require(_0x1101('0x1c'))(new Redis(config[_0x1101('0x19')]));require(_0x1101('0x1d'))['register'](socket);function respondWithStatusCode(_0x2e46c2,_0x40203f){_0x40203f=_0x40203f||0xcc;return function(_0x4860e8){if(_0x4860e8){return _0x2e46c2[_0x1101('0x1e')](_0x40203f);}return _0x2e46c2['status'](_0x40203f)[_0x1101('0x1f')]();};}function respondWithResult(_0x41196e,_0x55ebab){_0x55ebab=_0x55ebab||0xc8;return function(_0x1d3025){if(_0x1d3025){return _0x41196e['status'](_0x55ebab)[_0x1101('0x20')](_0x1d3025);}};}function respondWithFilteredResult(_0xf39fd6,_0x1e0750){return function(_0x3c51ce){if(_0x3c51ce){var _0x48b90a=typeof _0x1e0750[_0x1101('0x21')]===_0x1101('0x22')&&typeof _0x1e0750[_0x1101('0x23')]==='undefined';var _0x2eadc3=_0x3c51ce[_0x1101('0x24')];var _0x425b60=_0x48b90a?0x0:_0x1e0750[_0x1101('0x21')];var _0x22e8b3=_0x48b90a?_0x3c51ce[_0x1101('0x24')]:_0x1e0750['offset']+_0x1e0750[_0x1101('0x23')];var _0x2a0b3f;if(_0x22e8b3>=_0x2eadc3){_0x22e8b3=_0x2eadc3;_0x2a0b3f=0xc8;}else{_0x2a0b3f=0xce;}_0xf39fd6['status'](_0x2a0b3f);return _0xf39fd6[_0x1101('0x25')](_0x1101('0x26'),_0x425b60+'-'+_0x22e8b3+'/'+_0x2eadc3)[_0x1101('0x20')](_0x3c51ce);}return null;};}function patchUpdates(_0x53b8c7){return function(_0x5c385b){try{jsonpatch[_0x1101('0x27')](_0x5c385b,_0x53b8c7,!![]);}catch(_0x125414){return BPromise['reject'](_0x125414);}return _0x5c385b['save']();};}function saveUpdates(_0x1a4b68,_0x46c656){return function(_0x2ede56){if(_0x2ede56){return _0x2ede56[_0x1101('0x28')](_0x1a4b68)['then'](function(_0x20bf6a){return _0x20bf6a;});}return null;};}function removeEntity(_0x688713,_0x2fb4c4){return function(_0x2ebe07){if(_0x2ebe07){return _0x2ebe07['destroy']()[_0x1101('0x29')](function(){var _0x43fb43=_0x2ebe07['get']({'plain':!![]});var _0x428d9a=_0x1101('0x2a');return db[_0x1101('0x2b')][_0x1101('0x2c')]({'where':{'type':_0x428d9a,'resourceId':_0x43fb43['id']}})['then'](function(){return _0x2ebe07;});})[_0x1101('0x29')](function(){_0x688713[_0x1101('0x2d')](0xcc)[_0x1101('0x1f')]();});}};}function handleEntityNotFound(_0x4a2b30,_0x1609c2){return function(_0x50241b){if(!_0x50241b){_0x4a2b30[_0x1101('0x1e')](0x194);}return _0x50241b;};}function handleError(_0x10c5a5,_0x47a17b){_0x47a17b=_0x47a17b||0x1f4;return function(_0x3b713a){logger['error'](_0x3b713a[_0x1101('0x2e')]);if(_0x3b713a['name']){delete _0x3b713a[_0x1101('0x2f')];}_0x10c5a5[_0x1101('0x2d')](_0x47a17b)[_0x1101('0x30')](_0x3b713a);};}exports['index']=function(_0x55999a,_0x306663){var _0x261d6a={},_0xeb81b9={},_0x494683={'count':0x0,'rows':[]};var _0x3d7247=_[_0x1101('0x31')](db[_0x1101('0x32')][_0x1101('0x33')],function(_0x5578dd){return{'name':_0x5578dd[_0x1101('0x34')],'type':_0x5578dd[_0x1101('0x35')]['key']};});_0xeb81b9[_0x1101('0x36')]=_['map'](_0x3d7247,_0x1101('0x2f'));_0xeb81b9['query']=_[_0x1101('0x37')](_0x55999a[_0x1101('0x38')]);_0xeb81b9[_0x1101('0x39')]=_[_0x1101('0x3a')](_0xeb81b9[_0x1101('0x36')],_0xeb81b9[_0x1101('0x38')]);_0x261d6a[_0x1101('0x3b')]=_[_0x1101('0x3a')](_0xeb81b9[_0x1101('0x36')],qs[_0x1101('0x3c')](_0x55999a[_0x1101('0x38')][_0x1101('0x3c')]));_0x261d6a['attributes']=_0x261d6a['attributes']['length']?_0x261d6a['attributes']:_0xeb81b9[_0x1101('0x36')];if(!_0x55999a[_0x1101('0x38')]['hasOwnProperty']('nolimit')){_0x261d6a['limit']=qs[_0x1101('0x23')](_0x55999a[_0x1101('0x38')][_0x1101('0x23')]);_0x261d6a[_0x1101('0x21')]=qs[_0x1101('0x21')](_0x55999a[_0x1101('0x38')][_0x1101('0x21')]);}_0x261d6a[_0x1101('0x3d')]=qs[_0x1101('0x3e')](_0x55999a[_0x1101('0x38')][_0x1101('0x3e')]);_0x261d6a[_0x1101('0x3f')]=qs[_0x1101('0x39')](_['pick'](_0x55999a[_0x1101('0x38')],_0xeb81b9[_0x1101('0x39')]),_0x3d7247);if(_0x55999a[_0x1101('0x38')]['filter']){_0x261d6a['where']=_[_0x1101('0x40')](_0x261d6a['where'],{'$or':_[_0x1101('0x31')](_0x3d7247,function(_0x45a8b2){if(_0x45a8b2['type']!==_0x1101('0x41')){var _0x31e209={};_0x31e209[_0x45a8b2[_0x1101('0x2f')]]={'$like':'%'+_0x55999a[_0x1101('0x38')][_0x1101('0x42')]+'%'};return _0x31e209;}})});}_0x261d6a=_[_0x1101('0x40')]({},_0x261d6a,_0x55999a['options']);var _0x2ab699={'where':_0x261d6a[_0x1101('0x3f')]};return db[_0x1101('0x32')][_0x1101('0x24')](_0x2ab699)[_0x1101('0x29')](function(_0x3d774b){_0x494683[_0x1101('0x24')]=_0x3d774b;if(_0x55999a['query'][_0x1101('0x43')]){_0x261d6a[_0x1101('0x44')]=[{'all':!![]}];}return db[_0x1101('0x32')][_0x1101('0x45')](_0x261d6a);})[_0x1101('0x29')](function(_0x105a86){_0x494683['rows']=_0x105a86;return _0x494683;})[_0x1101('0x29')](respondWithFilteredResult(_0x306663,_0x261d6a))[_0x1101('0x46')](handleError(_0x306663,null));};exports[_0x1101('0x47')]=function(_0x1591eb,_0x5566ed){var _0x399c34={'raw':!![],'where':{'id':_0x1591eb[_0x1101('0x48')]['id']}},_0x3f6af8={};_0x3f6af8[_0x1101('0x36')]=_[_0x1101('0x37')](db['WhatsappQueue']['rawAttributes']);_0x3f6af8['query']=_[_0x1101('0x37')](_0x1591eb['query']);_0x3f6af8['filters']=_[_0x1101('0x3a')](_0x3f6af8[_0x1101('0x36')],_0x3f6af8[_0x1101('0x38')]);_0x399c34['attributes']=_[_0x1101('0x3a')](_0x3f6af8[_0x1101('0x36')],qs[_0x1101('0x3c')](_0x1591eb[_0x1101('0x38')]['fields']));_0x399c34[_0x1101('0x3b')]=_0x399c34[_0x1101('0x3b')][_0x1101('0x49')]?_0x399c34['attributes']:_0x3f6af8[_0x1101('0x36')];if(_0x1591eb[_0x1101('0x38')]['includeAll']){_0x399c34[_0x1101('0x44')]=[{'all':!![]}];}_0x399c34=_[_0x1101('0x40')]({},_0x399c34,_0x1591eb[_0x1101('0x4a')]);return db[_0x1101('0x32')][_0x1101('0x4b')](_0x399c34)[_0x1101('0x29')](handleEntityNotFound(_0x5566ed,null))[_0x1101('0x29')](respondWithResult(_0x5566ed,null))['catch'](handleError(_0x5566ed,null));};exports[_0x1101('0x4c')]=function(_0x54eb64,_0x161cd6){return db[_0x1101('0x32')]['create'](_0x54eb64['body'],{})['then'](function(_0xb36ce2){var _0x56bafb=_0x54eb64[_0x1101('0x4d')][_0x1101('0x4e')]({'plain':!![]});if(!_0x56bafb)throw new Error(_0x1101('0x4f'));if(_0x56bafb[_0x1101('0x50')]===_0x1101('0x4d')){var _0xf52c54=_0xb36ce2['get']({'plain':!![]});var _0x227f7b=_0x1101('0x2a');return db[_0x1101('0x51')][_0x1101('0x4b')]({'where':{'name':_0x227f7b,'userProfileId':_0x56bafb[_0x1101('0x52')]},'raw':!![]})['then'](function(_0xa010d1){if(_0xa010d1&&_0xa010d1[_0x1101('0x53')]===0x0){return db[_0x1101('0x2b')]['create']({'name':_0xf52c54['name'],'resourceId':_0xf52c54['id'],'type':_0xa010d1[_0x1101('0x2f')],'sectionId':_0xa010d1['id']},{})[_0x1101('0x29')](function(){return _0xb36ce2;});}else{return _0xb36ce2;}})['catch'](function(_0x3d5764){logger[_0x1101('0x54')](_0x1101('0x55'),_0x3d5764);throw _0x3d5764;});}return _0xb36ce2;})[_0x1101('0x29')](respondWithResult(_0x161cd6,0xc9))[_0x1101('0x46')](handleError(_0x161cd6,null));};exports['update']=function(_0x4199ee,_0x1b9ba2){if(_0x4199ee[_0x1101('0x56')]['id']){delete _0x4199ee[_0x1101('0x56')]['id'];}return db[_0x1101('0x32')][_0x1101('0x4b')]({'where':{'id':_0x4199ee['params']['id']}})['then'](handleEntityNotFound(_0x1b9ba2,null))[_0x1101('0x29')](saveUpdates(_0x4199ee['body'],null))[_0x1101('0x29')](respondWithResult(_0x1b9ba2,null))[_0x1101('0x46')](handleError(_0x1b9ba2,null));};exports['destroy']=function(_0x181c64,_0x1a0274){return db[_0x1101('0x32')][_0x1101('0x4b')]({'where':{'id':_0x181c64[_0x1101('0x48')]['id']}})[_0x1101('0x29')](handleEntityNotFound(_0x1a0274,null))[_0x1101('0x29')](removeEntity(_0x1a0274,null))[_0x1101('0x46')](handleError(_0x1a0274,null));};exports[_0x1101('0x57')]=function(_0x1f5ca,_0x54a79c){return db[_0x1101('0x32')][_0x1101('0x57')]()[_0x1101('0x29')](respondWithResult(_0x54a79c,null))[_0x1101('0x46')](handleError(_0x54a79c,null));};exports[_0x1101('0x58')]=function(_0x2c2d82,_0x8caef3,_0x57db09){var _0x53a7d5={'raw':!![],'where':{}},_0x9e6cfb={},_0x528764;return db[_0x1101('0x32')][_0x1101('0x59')]({'where':{'id':_0x2c2d82['params']['id']}})['then'](handleEntityNotFound(_0x8caef3,null))[_0x1101('0x29')](function(_0x5a1d69){if(_0x5a1d69){_0x528764=_0x5a1d69['get']({'plain':!![]});_0x9e6cfb['model']=_['keys'](db[_0x1101('0x5a')][_0x1101('0x33')]);_0x9e6cfb[_0x1101('0x38')]=_[_0x1101('0x37')](_0x2c2d82[_0x1101('0x38')]);_0x9e6cfb['filters']=_['intersection'](_0x9e6cfb['model'],_0x9e6cfb['query']);_0x53a7d5[_0x1101('0x3b')]=_['intersection'](_0x9e6cfb[_0x1101('0x36')],qs[_0x1101('0x3c')](_0x2c2d82[_0x1101('0x38')][_0x1101('0x3c')]));_0x53a7d5[_0x1101('0x3b')]=_0x53a7d5[_0x1101('0x3b')][_0x1101('0x49')]?_0x53a7d5[_0x1101('0x3b')]:_0x9e6cfb[_0x1101('0x36')];if(!_0x2c2d82['query'][_0x1101('0x5b')]('nolimit')){_0x53a7d5[_0x1101('0x23')]=qs[_0x1101('0x23')](_0x2c2d82['query']['limit']);_0x53a7d5[_0x1101('0x21')]=qs['offset'](_0x2c2d82[_0x1101('0x38')][_0x1101('0x21')]);}_0x53a7d5[_0x1101('0x3d')]=qs[_0x1101('0x3e')](_0x2c2d82['query']['sort']);_0x53a7d5[_0x1101('0x3f')]=qs['filters'](_[_0x1101('0x5c')](_0x2c2d82[_0x1101('0x38')],_0x9e6cfb[_0x1101('0x39')]));_0x53a7d5[_0x1101('0x3f')][_0x1101('0x5d')]=_0x5a1d69['id'];if(_0x2c2d82['query'][_0x1101('0x42')]){_0x53a7d5[_0x1101('0x3f')]=_['merge'](_0x53a7d5[_0x1101('0x3f')],{'$or':_[_0x1101('0x31')](_0x53a7d5['attributes'],function(_0x46b879){var _0x5a1dfd={};_0x5a1dfd[_0x46b879]={'$like':'%'+_0x2c2d82['query'][_0x1101('0x42')]+'%'};return _0x5a1dfd;})});}_0x53a7d5=_[_0x1101('0x40')]({},_0x53a7d5,_0x2c2d82[_0x1101('0x4a')]);return db[_0x1101('0x5a')][_0x1101('0x45')](_0x53a7d5);}})[_0x1101('0x29')](function(_0x40c6d3){if(_0x40c6d3){return db[_0x1101('0x5e')][_0x1101('0x5f')]({'where':{'id':_[_0x1101('0x31')](_0x40c6d3,_0x1101('0x60')),'role':_0x1101('0x61')},'attributes':['id',_0x1101('0x2f'),_0x1101('0x62'),_0x1101('0x63'),_0x1101('0x64')]});}})[_0x1101('0x29')](function(_0x4eae87){if(_0x4eae87){return{'count':_0x4eae87['count'],'rows':_[_0x1101('0x31')](_0x4eae87[_0x1101('0x65')],function(_0x37fd2e){return{'membername':_0x37fd2e['name'],'UserId':_0x37fd2e['id'],'queue_name':_0x528764[_0x1101('0x2f')],'WhatsappQueueId':_0x528764['id'],'interface':util['format'](_0x1101('0x66'),'SIP',_0x37fd2e['name']),'penalty':0x0,'paused':_0x37fd2e['whatsappPause'],'createdAt':_0x37fd2e[_0x1101('0x64')],'updatedAt':_0x37fd2e[_0x1101('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1101('0x29')](respondWithFilteredResult(_0x8caef3,_0x53a7d5))[_0x1101('0x46')](handleError(_0x8caef3,null));};exports[_0x1101('0x67')]=function(_0x4739d9,_0x338f3e,_0xfd6830){var _0x23e584={};var _0x17e311={};var _0x1367c5;var _0x10708a;return db[_0x1101('0x32')][_0x1101('0x59')]({'where':{'id':_0x4739d9[_0x1101('0x48')]['id']}})[_0x1101('0x29')](handleEntityNotFound(_0x338f3e,null))[_0x1101('0x29')](function(_0x54e9f4){if(_0x54e9f4){_0x1367c5=_0x54e9f4;_0x17e311[_0x1101('0x36')]=_['keys'](db[_0x1101('0x68')]['rawAttributes']);_0x17e311[_0x1101('0x38')]=_['keys'](_0x4739d9['query']);_0x17e311['filters']=_[_0x1101('0x3a')](_0x17e311[_0x1101('0x36')],_0x17e311[_0x1101('0x38')]);_0x23e584[_0x1101('0x3b')]=_[_0x1101('0x3a')](_0x17e311['model'],qs[_0x1101('0x3c')](_0x4739d9[_0x1101('0x38')]['fields']));_0x23e584[_0x1101('0x3b')]=_0x23e584[_0x1101('0x3b')][_0x1101('0x49')]?_0x23e584[_0x1101('0x3b')]:_0x17e311['model'];_0x23e584[_0x1101('0x3d')]=qs[_0x1101('0x3e')](_0x4739d9[_0x1101('0x38')]['sort']);_0x23e584[_0x1101('0x3f')]=qs[_0x1101('0x39')](_['pick'](_0x4739d9['query'],_0x17e311[_0x1101('0x39')]));if(_0x4739d9[_0x1101('0x38')][_0x1101('0x42')]){_0x23e584['where']=_['merge'](_0x23e584[_0x1101('0x3f')],{'$or':_['map'](_0x23e584[_0x1101('0x3b')],function(_0x5e3211){var _0x1cac41={};_0x1cac41[_0x5e3211]={'$like':'%'+_0x4739d9['query'][_0x1101('0x42')]+'%'};return _0x1cac41;})});}_0x23e584=_[_0x1101('0x40')]({},_0x23e584,_0x4739d9[_0x1101('0x4a')]);return _0x1367c5[_0x1101('0x67')](_0x23e584);}})[_0x1101('0x29')](function(_0x37826f){if(_0x37826f){_0x10708a=_0x37826f[_0x1101('0x49')];if(!_0x4739d9['query'][_0x1101('0x5b')](_0x1101('0x69'))){_0x23e584['limit']=qs[_0x1101('0x23')](_0x4739d9[_0x1101('0x38')]['limit']);_0x23e584[_0x1101('0x21')]=qs[_0x1101('0x21')](_0x4739d9[_0x1101('0x38')][_0x1101('0x21')]);}return _0x1367c5[_0x1101('0x67')](_0x23e584);}})[_0x1101('0x29')](function(_0x24c959){if(_0x24c959){return _0x24c959?{'count':_0x10708a,'rows':_0x24c959}:null;}})[_0x1101('0x29')](respondWithResult(_0x338f3e,null))['catch'](handleError(_0x338f3e,null));};exports['addTeams']=function(_0x3d768b,_0x509d91,_0x53fd18){var _0x28824a=_0x3d768b[_0x1101('0x56')]['ids'];return db['Team'][_0x1101('0x45')]({'where':{'id':_0x28824a},'attributes':['id'],'include':[{'model':db[_0x1101('0x5e')],'as':_0x1101('0x6a'),'attributes':['id',_0x1101('0x2f'),'online',_0x1101('0x6b'),_0x1101('0x6c')],'raw':!![]}]})[_0x1101('0x29')](function(_0x39c34e){if(_0x39c34e){var _0x37bcd7=_[_0x1101('0x6d')](_0x39c34e,function(_0x3c636c){var _0x53dda5=_0x3c636c['get']({'plain':!![]});return _0x53dda5[_0x1101('0x6a')];});return db['WhatsappQueue'][_0x1101('0x4b')]({'where':{'id':_0x3d768b['params']['id']}})[_0x1101('0x29')](function(_0x4e60d9){return db[_0x1101('0x6e')][_0x1101('0x6f')](function(_0x404805){return _0x4e60d9[_0x1101('0x70')](_0x28824a,{'transaction':_0x404805})[_0x1101('0x29')](function(){return BPromise[_0x1101('0x71')](_0x37bcd7,function(_0x44abf4){return db['UserWhatsappQueue'][_0x1101('0x72')]({'where':{'UserId':_0x44abf4['id'],'WhatsappQueueId':_0x3d768b[_0x1101('0x48')]['id']},'transaction':_0x404805});});})['then'](function(){_0x37bcd7['forEach'](function(_0x11dde4){socket[_0x1101('0x73')](_0x1101('0x74'),{'UserId':_0x11dde4['id'],'WhatsappQueueId':_0x4e60d9['id']});});});});});}})[_0x1101('0x29')](respondWithStatusCode(_0x509d91,null))[_0x1101('0x46')](handleError(_0x509d91,null));};exports['removeTeams']=function(_0x388ac7,_0x4c704a,_0x912cb6){return db[_0x1101('0x68')][_0x1101('0x45')]({'where':{'id':_0x388ac7[_0x1101('0x38')][_0x1101('0x75')]},'attributes':['id'],'include':[{'model':db[_0x1101('0x5e')],'as':_0x1101('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c704a,null))['then'](function(_0x1dcca5){var _0x259be5=_[_0x1101('0x31')](_0x1dcca5,'id');var _0x329c46=[];var _0x44c986=[];var _0x122d39=squel[_0x1101('0x76')]();_0x122d39[_0x1101('0x77')](_0x1101('0x78'))['from']('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0x1101('0x79'))[_0x1101('0x3f')](_0x1101('0x7a'),_0x388ac7[_0x1101('0x48')]['id']);for(var _0x4b9b8=0x0;_0x4b9b8<_0x1dcca5['length'];_0x4b9b8+=0x1){let _0x8952be=_0x1dcca5[_0x4b9b8];for(var _0xee5afc=0x0;_0xee5afc<_0x8952be[_0x1101('0x6a')][_0x1101('0x49')];_0xee5afc+=0x1){let _0x5c9580=_0x8952be[_0x1101('0x6a')][_0xee5afc];var _0xc486bf=_0x122d39[_0x1101('0x7b')]();_0xc486bf[_0x1101('0x3f')](_0x1101('0x7c'),_0x5c9580['id']);_0x44c986[_0x1101('0x7d')](db['sequelize'][_0x1101('0x38')](_0xc486bf[_0x1101('0x7e')](),{'type':db[_0x1101('0x6e')][_0x1101('0x7f')][_0x1101('0x80')]})[_0x1101('0x29')](function(_0x53c5c0){if(_0x53c5c0['length']===0x1){return _0x5c9580['id'];}else{var _0x3b8436=_[_0x1101('0x81')](_[_0x1101('0x31')](_0x53c5c0,_0x1101('0x82')),function(_0x2ee3a2){return _[_0x1101('0x83')](_0x259be5,_0x2ee3a2);});if(_0x3b8436){return _0x5c9580['id'];}}}));}}return BPromise['all'](_0x44c986)[_0x1101('0x29')](function(_0xe66161){_0x329c46=_(_0x329c46)['union'](_0xe66161)['compact']()[_0x1101('0x84')]();return db[_0x1101('0x32')]['find']({'where':{'id':_0x388ac7[_0x1101('0x48')]['id']}})[_0x1101('0x29')](function(_0x5f25b7){return db['sequelize']['transaction'](function(_0x2183eb){return _0x5f25b7[_0x1101('0x85')](_0x388ac7['query'][_0x1101('0x75')],{'transaction':_0x2183eb})['then'](function(){if(!_[_0x1101('0x86')](_0x329c46)){return _0x5f25b7[_0x1101('0x87')](_0x329c46,{'transaction':_0x2183eb});}})[_0x1101('0x29')](function(){_0x329c46['forEach'](function(_0x30dd0c){socket[_0x1101('0x73')]('userWhatsappQueue:remove',{'UserId':_0x30dd0c,'WhatsappQueueId':_0x5f25b7['id']});});});});});});})[_0x1101('0x29')](respondWithStatusCode(_0x4c704a,null))['catch'](handleError(_0x4c704a,null));};exports[_0x1101('0x88')]=function(_0x1e09cd,_0x214b37,_0x57265d){return db[_0x1101('0x32')][_0x1101('0x4b')]({'where':{'id':_0x1e09cd[_0x1101('0x48')]['id']}})['then'](handleEntityNotFound(_0x214b37,null))[_0x1101('0x29')](function(_0x4c0e61){if(_0x4c0e61){return _0x4c0e61[_0x1101('0x88')](_0x1e09cd[_0x1101('0x56')][_0x1101('0x75')],_[_0x1101('0x89')](_0x1e09cd[_0x1101('0x56')],[_0x1101('0x75'),'id'])||{})[_0x1101('0x8a')](function(_0x1c40d9){for(var _0x6c57f2=0x0;_0x6c57f2<_0x1e09cd['body']['ids'][_0x1101('0x49')];_0x6c57f2+=0x1){socket[_0x1101('0x73')](_0x1101('0x74'),{'UserId':Number(_0x1e09cd[_0x1101('0x56')][_0x1101('0x75')][_0x6c57f2]),'WhatsappQueueId':Number(_0x1e09cd[_0x1101('0x48')]['id'])});}return _0x1c40d9;});}})[_0x1101('0x29')](respondWithResult(_0x214b37,null))['catch'](handleError(_0x214b37,null));};exports[_0x1101('0x87')]=function(_0x50c685,_0x38b71f,_0x2bca11){return db[_0x1101('0x32')][_0x1101('0x4b')]({'where':{'id':_0x50c685[_0x1101('0x48')]['id']}})[_0x1101('0x29')](handleEntityNotFound(_0x38b71f,null))[_0x1101('0x29')](function(_0x277f90){if(_0x277f90){return _0x277f90['removeAgents'](_0x50c685['query'][_0x1101('0x75')])[_0x1101('0x29')](function(){if(_['isArray'](_0x50c685[_0x1101('0x38')]['ids'])){for(var _0x460a3e=0x0;_0x460a3e<_0x50c685[_0x1101('0x38')][_0x1101('0x75')][_0x1101('0x49')];_0x460a3e+=0x1){socket[_0x1101('0x73')](_0x1101('0x8b'),{'UserId':Number(_0x50c685[_0x1101('0x38')][_0x1101('0x75')][_0x460a3e]),'WhatsappQueueId':Number(_0x50c685[_0x1101('0x48')]['id'])});}}else{socket[_0x1101('0x73')](_0x1101('0x8b'),{'UserId':Number(_0x50c685[_0x1101('0x38')][_0x1101('0x75')]),'WhatsappQueueId':Number(_0x50c685[_0x1101('0x48')]['id'])});}});}})[_0x1101('0x29')](respondWithStatusCode(_0x38b71f,null))[_0x1101('0x46')](handleError(_0x38b71f,null));};exports[_0x1101('0x8c')]=function(_0x5990a2,_0x5dc0e0,_0x5206d8){var _0x2fa5f7={};var _0x4b8af0={};var _0x47da9f;var _0x37ff2f;return db[_0x1101('0x32')][_0x1101('0x59')]({'where':{'id':_0x5990a2['params']['id']}})[_0x1101('0x29')](handleEntityNotFound(_0x5dc0e0,null))['then'](function(_0x418fe5){if(_0x418fe5){_0x47da9f=_0x418fe5;_0x4b8af0[_0x1101('0x36')]=_['keys'](db[_0x1101('0x5e')][_0x1101('0x33')]);_0x4b8af0[_0x1101('0x38')]=_[_0x1101('0x37')](_0x5990a2[_0x1101('0x38')]);_0x4b8af0[_0x1101('0x39')]=_[_0x1101('0x3a')](_0x4b8af0['model'],_0x4b8af0[_0x1101('0x38')]);_0x2fa5f7[_0x1101('0x3b')]=_[_0x1101('0x3a')](_0x4b8af0[_0x1101('0x36')],qs['fields'](_0x5990a2[_0x1101('0x38')][_0x1101('0x3c')]));_0x2fa5f7[_0x1101('0x3b')]=_0x2fa5f7[_0x1101('0x3b')][_0x1101('0x49')]?_0x2fa5f7[_0x1101('0x3b')]:_0x4b8af0[_0x1101('0x36')];_0x2fa5f7[_0x1101('0x3d')]=qs[_0x1101('0x3e')](_0x5990a2[_0x1101('0x38')][_0x1101('0x3e')]);_0x2fa5f7[_0x1101('0x3f')]=qs[_0x1101('0x39')](_[_0x1101('0x5c')](_0x5990a2[_0x1101('0x38')],_0x4b8af0[_0x1101('0x39')]));if(_0x5990a2['query'][_0x1101('0x42')]){_0x2fa5f7[_0x1101('0x3f')]=_[_0x1101('0x40')](_0x2fa5f7[_0x1101('0x3f')],{'$or':_[_0x1101('0x31')](_0x2fa5f7[_0x1101('0x3b')],function(_0xa6e8ce){var _0x2b3dd8={};_0x2b3dd8[_0xa6e8ce]={'$like':'%'+_0x5990a2[_0x1101('0x38')][_0x1101('0x42')]+'%'};return _0x2b3dd8;})});}_0x2fa5f7=_['merge']({},_0x2fa5f7,_0x5990a2[_0x1101('0x4a')]);return _0x47da9f['getAgents'](_0x2fa5f7);}})[_0x1101('0x29')](function(_0x1ab4c6){if(_0x1ab4c6){_0x37ff2f=_0x1ab4c6['length'];if(!_0x5990a2['query']['hasOwnProperty']('nolimit')){_0x2fa5f7[_0x1101('0x23')]=qs[_0x1101('0x23')](_0x5990a2[_0x1101('0x38')]['limit']);_0x2fa5f7[_0x1101('0x21')]=qs[_0x1101('0x21')](_0x5990a2[_0x1101('0x38')][_0x1101('0x21')]);}return _0x47da9f[_0x1101('0x8c')](_0x2fa5f7);}})[_0x1101('0x29')](function(_0x21475c){if(_0x21475c){return _0x21475c?{'count':_0x37ff2f,'rows':_0x21475c}:null;}})[_0x1101('0x29')](respondWithResult(_0x5dc0e0,null))[_0x1101('0x46')](handleError(_0x5dc0e0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 17f185d..756fa15 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe387=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x52eaf7,_0x494faa){var _0x51e6f0=function(_0x1574c8){while(--_0x1574c8){_0x52eaf7['push'](_0x52eaf7['shift']());}};_0x51e6f0(++_0x494faa);}(_0xe387,0x6f));var _0x7e38=function(_0x2c9f96,_0x3a6dbf){_0x2c9f96=_0x2c9f96-0x0;var _0x2c6ada=_0xe387[_0x2c9f96];return _0x2c6ada;};'use strict';var EventEmitter=require(_0x7e38('0x0'));var WhatsappQueue=require(_0x7e38('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7e38('0x2')](0x0);var events={'afterCreate':_0x7e38('0x3'),'afterUpdate':_0x7e38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x40013c){return function(_0x57ce20,_0x3a0de4,_0x17e90d){WhatsappQueueEvents[_0x7e38('0x5')](_0x40013c+':'+_0x57ce20['id'],_0x57ce20);WhatsappQueueEvents['emit'](_0x40013c,_0x57ce20);_0x17e90d(null);};}for(var e in events){if(events[_0x7e38('0x6')](e)){var event=events[e];WhatsappQueue[_0x7e38('0x7')](e,emitEvent(event));}}module[_0x7e38('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x5f8b=['hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','save','remove','emit'];(function(_0x59c2b2,_0x3980e9){var _0x630821=function(_0x54ca2c){while(--_0x54ca2c){_0x59c2b2['push'](_0x59c2b2['shift']());}};_0x630821(++_0x3980e9);}(_0x5f8b,0xaa));var _0xb5f8=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x5f8b[_0x1589dd];return _0x1bddd1;};'use strict';var EventEmitter=require(_0xb5f8('0x0'));var WhatsappQueue=require(_0xb5f8('0x1'))['db'][_0xb5f8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb5f8('0x3'),'afterUpdate':'update','afterDestroy':_0xb5f8('0x4')};function emitEvent(_0x413927){return function(_0x24478a,_0x256f29,_0xcc7815){WhatsappQueueEvents[_0xb5f8('0x5')](_0x413927+':'+_0x24478a['id'],_0x24478a);WhatsappQueueEvents[_0xb5f8('0x5')](_0x413927,_0x24478a);_0xcc7815(null);};}for(var e in events){if(events[_0xb5f8('0x6')](e)){var event=events[e];WhatsappQueue[_0xb5f8('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 8b307a2..34f3a68 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfdc=['../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfdc,0x126));var _0xccfd=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcfdc[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xccfd('0x0'));var util=require('util');var logger=require(_0xccfd('0x1'))(_0xccfd('0x2'));var moment=require(_0xccfd('0x3'));var BPromise=require(_0xccfd('0x4'));var rp=require(_0xccfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xccfd('0x6'));var attributes=require(_0xccfd('0x7'));module[_0xccfd('0x8')]=function(_0x1f4523,_0x3e938b){return _0x1f4523[_0xccfd('0x9')](_0xccfd('0xa'),attributes,{'tableName':_0xccfd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f49=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x15af6c,_0x47fe2d){var _0x13c017=function(_0x25a621){while(--_0x25a621){_0x15af6c['push'](_0x15af6c['shift']());}};_0x13c017(++_0x47fe2d);}(_0x8f49,0x12d));var _0x98f4=function(_0x250393,_0x2efd7c){_0x250393=_0x250393-0x0;var _0x4c56cd=_0x8f49[_0x250393];return _0x4c56cd;};'use strict';var _=require(_0x98f4('0x0'));var util=require(_0x98f4('0x1'));var logger=require(_0x98f4('0x2'))(_0x98f4('0x3'));var moment=require(_0x98f4('0x4'));var BPromise=require(_0x98f4('0x5'));var rp=require(_0x98f4('0x6'));var fs=require('fs');var path=require(_0x98f4('0x7'));var rimraf=require(_0x98f4('0x8'));var config=require(_0x98f4('0x9'));var attributes=require('./whatsappQueue.attributes');module[_0x98f4('0xa')]=function(_0x4eb8d8,_0x3749be){return _0x4eb8d8['define'](_0x98f4('0xb'),attributes,{'tableName':_0x98f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index e273b07..07bc503 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x583c=['rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','model','map','ShowWhatsappQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x583c,0x1db));var _0xc583=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x583c[_0x25a42a];return _0x1129b1;};'use strict';var _=require('lodash');var util=require(_0xc583('0x0'));var moment=require('moment');var BPromise=require(_0xc583('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x2'));var db=require(_0xc583('0x3'))['db'];var utils=require(_0xc583('0x4'));var logger=require(_0xc583('0x5'))(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc583('0x8')]({'port':0x232a});config[_0xc583('0x9')]=_['defaults'](config[_0xc583('0x9')],{'host':_0xc583('0xa'),'port':0x18eb});var socket=require(_0xc583('0xb'))(new Redis(config['redis']));require(_0xc583('0xc'))[_0xc583('0xd')](socket);function respondWithRpcPromise(_0x4d6f22,_0x26e47f,_0x59f77c){return new BPromise(function(_0x11e138,_0x418df3){return client[_0xc583('0xe')](_0x4d6f22,_0x59f77c)[_0xc583('0xf')](function(_0x33ba7e){logger[_0xc583('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x26e47f,'request\x20sent');logger[_0xc583('0x11')](_0xc583('0x12'),_0x26e47f,'request\x20sent',JSON[_0xc583('0x13')](_0x33ba7e));if(_0x33ba7e[_0xc583('0x14')]){if(_0x33ba7e[_0xc583('0x14')]['code']===0x1f4){logger[_0xc583('0x14')](_0xc583('0x15'),_0x26e47f,_0x33ba7e[_0xc583('0x14')]['message']);return _0x418df3(_0x33ba7e[_0xc583('0x14')]['message']);}logger[_0xc583('0x14')](_0xc583('0x15'),_0x26e47f,_0x33ba7e['error'][_0xc583('0x16')]);return _0x11e138(_0x33ba7e['error']['message']);}else{logger[_0xc583('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x26e47f,'request\x20sent');_0x11e138(_0x33ba7e[_0xc583('0x17')]['message']);}})[_0xc583('0x18')](function(_0x42b471){logger[_0xc583('0x14')](_0xc583('0x15'),_0x26e47f,_0x42b471);_0x418df3(_0x42b471);});});}exports[_0xc583('0x19')]=function(_0xb59c6a){var _0x5f1096=this;return new Promise(function(_0x1a3341,_0x674ff6){return db[_0xc583('0x1a')][_0xc583('0x1b')]({'raw':_0xb59c6a['options']?_0xb59c6a[_0xc583('0x1c')][_0xc583('0x1d')]===undefined?!![]:![]:!![],'where':_0xb59c6a['options']?_0xb59c6a[_0xc583('0x1c')][_0xc583('0x1e')]||null:null,'attributes':_0xb59c6a[_0xc583('0x1c')]?_0xb59c6a[_0xc583('0x1c')][_0xc583('0x1f')]||null:null,'limit':_0xb59c6a[_0xc583('0x1c')]?_0xb59c6a[_0xc583('0x1c')]['limit']||null:null,'include':_0xb59c6a[_0xc583('0x1c')]?_0xb59c6a[_0xc583('0x1c')][_0xc583('0x20')]?_['map'](_0xb59c6a[_0xc583('0x1c')]['include'],function(_0x2e2b9b){return{'model':db[_0x2e2b9b[_0xc583('0x21')]],'as':_0x2e2b9b['as'],'attributes':_0x2e2b9b[_0xc583('0x1f')],'include':_0x2e2b9b['include']?_[_0xc583('0x22')](_0x2e2b9b[_0xc583('0x20')],function(_0x2ecc76){return{'model':db[_0x2ecc76[_0xc583('0x21')]],'as':_0x2ecc76['as'],'attributes':_0x2ecc76[_0xc583('0x1f')],'include':_0x2ecc76[_0xc583('0x20')]?_[_0xc583('0x22')](_0x2ecc76[_0xc583('0x20')],function(_0x3b3174){return{'model':db[_0x3b3174['model']],'as':_0x3b3174['as'],'attributes':_0x3b3174[_0xc583('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc583('0xf')](function(_0xaf788d){logger['info']('GetWhatsappQueue',_0xb59c6a);logger[_0xc583('0x11')](_0xc583('0x19'),_0xb59c6a,JSON[_0xc583('0x13')](_0xaf788d));_0x1a3341(_0xaf788d);})[_0xc583('0x18')](function(_0x592557){logger[_0xc583('0x14')](_0xc583('0x19'),_0x592557['message'],_0xb59c6a);_0x674ff6(_0x5f1096['error'](0x1f4,_0x592557[_0xc583('0x16')]));});});};exports[_0xc583('0x23')]=function(_0x5867f5){var _0x35f106=this;return new Promise(function(_0x514d35,_0x55ea6c){return db['WhatsappQueue'][_0xc583('0x24')]({'raw':_0x5867f5[_0xc583('0x1c')]?_0x5867f5[_0xc583('0x1c')][_0xc583('0x1d')]===undefined?!![]:![]:!![],'where':_0x5867f5[_0xc583('0x1c')]?_0x5867f5[_0xc583('0x1c')][_0xc583('0x1e')]||null:null,'attributes':_0x5867f5[_0xc583('0x1c')]?_0x5867f5[_0xc583('0x1c')][_0xc583('0x1f')]||null:null,'include':_0x5867f5[_0xc583('0x1c')]?_0x5867f5['options']['include']?_[_0xc583('0x22')](_0x5867f5[_0xc583('0x1c')][_0xc583('0x20')],function(_0x32ae2a){return{'model':db[_0x32ae2a[_0xc583('0x21')]],'as':_0x32ae2a['as'],'attributes':_0x32ae2a[_0xc583('0x1f')],'include':_0x32ae2a[_0xc583('0x20')]?_[_0xc583('0x22')](_0x32ae2a['include'],function(_0x39cf04){return{'model':db[_0x39cf04['model']],'as':_0x39cf04['as'],'attributes':_0x39cf04['attributes'],'include':_0x39cf04[_0xc583('0x20')]?_[_0xc583('0x22')](_0x39cf04[_0xc583('0x20')],function(_0x49d43e){return{'model':db[_0x49d43e[_0xc583('0x21')]],'as':_0x49d43e['as'],'attributes':_0x49d43e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc583('0xf')](function(_0x1a7094){logger[_0xc583('0x10')](_0xc583('0x23'),_0x5867f5);logger[_0xc583('0x11')](_0xc583('0x23'),_0x5867f5,JSON[_0xc583('0x13')](_0x1a7094));_0x514d35(_0x1a7094);})[_0xc583('0x18')](function(_0x308655){logger['error']('ShowWhatsappQueue',_0x308655[_0xc583('0x16')],_0x5867f5);_0x55ea6c(_0x35f106[_0xc583('0x14')](0x1f4,_0x308655[_0xc583('0x16')]));});});}; \ No newline at end of file +var _0x3364=['catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','WhatsappQueue','find','ShowWhatsappQueue','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x16ca8d,_0x55aebc){var _0x305b05=function(_0x1a0db8){while(--_0x1a0db8){_0x16ca8d['push'](_0x16ca8d['shift']());}};_0x305b05(++_0x55aebc);}(_0x3364,0xc8));var _0x4336=function(_0x111720,_0x25abf0){_0x111720=_0x111720-0x0;var _0x41e1aa=_0x3364[_0x111720];return _0x41e1aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4336('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4336('0x1'));var db=require(_0x4336('0x2'))['db'];var utils=require(_0x4336('0x3'));var logger=require(_0x4336('0x4'))(_0x4336('0x5'));var config=require(_0x4336('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4336('0x7')][_0x4336('0x8')]({'port':0x232a});config['redis']=_[_0x4336('0x9')](config[_0x4336('0xa')],{'host':_0x4336('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4336('0xc'))[_0x4336('0xd')](socket);function respondWithRpcPromise(_0x449127,_0x5d7207,_0x20d98c){return new BPromise(function(_0x7521ec,_0x21502a){return client['request'](_0x449127,_0x20d98c)[_0x4336('0xe')](function(_0x40e48c){logger[_0x4336('0xf')](_0x4336('0x10'),_0x5d7207,_0x4336('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5d7207,_0x4336('0x11'),JSON[_0x4336('0x12')](_0x40e48c));if(_0x40e48c[_0x4336('0x13')]){if(_0x40e48c[_0x4336('0x13')]['code']===0x1f4){logger[_0x4336('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x5d7207,_0x40e48c[_0x4336('0x13')][_0x4336('0x14')]);return _0x21502a(_0x40e48c[_0x4336('0x13')][_0x4336('0x14')]);}logger[_0x4336('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x5d7207,_0x40e48c[_0x4336('0x13')][_0x4336('0x14')]);return _0x7521ec(_0x40e48c['error'][_0x4336('0x14')]);}else{logger['info'](_0x4336('0x10'),_0x5d7207,_0x4336('0x11'));_0x7521ec(_0x40e48c[_0x4336('0x15')][_0x4336('0x14')]);}})[_0x4336('0x16')](function(_0x2ed726){logger[_0x4336('0x13')](_0x4336('0x10'),_0x5d7207,_0x2ed726);_0x21502a(_0x2ed726);});});}exports[_0x4336('0x17')]=function(_0x6d8b4){var _0x122807=this;return new Promise(function(_0x3c1ad2,_0x54e384){return db['WhatsappQueue'][_0x4336('0x18')]({'raw':_0x6d8b4[_0x4336('0x19')]?_0x6d8b4[_0x4336('0x19')][_0x4336('0x1a')]===undefined?!![]:![]:!![],'where':_0x6d8b4[_0x4336('0x19')]?_0x6d8b4['options'][_0x4336('0x1b')]||null:null,'attributes':_0x6d8b4[_0x4336('0x19')]?_0x6d8b4[_0x4336('0x19')][_0x4336('0x1c')]||null:null,'limit':_0x6d8b4[_0x4336('0x19')]?_0x6d8b4[_0x4336('0x19')][_0x4336('0x1d')]||null:null,'include':_0x6d8b4[_0x4336('0x19')]?_0x6d8b4[_0x4336('0x19')]['include']?_[_0x4336('0x1e')](_0x6d8b4[_0x4336('0x19')][_0x4336('0x1f')],function(_0x5c50e2){return{'model':db[_0x5c50e2[_0x4336('0x20')]],'as':_0x5c50e2['as'],'attributes':_0x5c50e2[_0x4336('0x1c')],'include':_0x5c50e2[_0x4336('0x1f')]?_['map'](_0x5c50e2[_0x4336('0x1f')],function(_0x3cfe39){return{'model':db[_0x3cfe39['model']],'as':_0x3cfe39['as'],'attributes':_0x3cfe39['attributes'],'include':_0x3cfe39['include']?_['map'](_0x3cfe39['include'],function(_0x5b16b3){return{'model':db[_0x5b16b3[_0x4336('0x20')]],'as':_0x5b16b3['as'],'attributes':_0x5b16b3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3de40b){logger['info'](_0x4336('0x17'),_0x6d8b4);logger[_0x4336('0x21')](_0x4336('0x17'),_0x6d8b4,JSON[_0x4336('0x12')](_0x3de40b));_0x3c1ad2(_0x3de40b);})[_0x4336('0x16')](function(_0x317dc1){logger[_0x4336('0x13')](_0x4336('0x17'),_0x317dc1[_0x4336('0x14')],_0x6d8b4);_0x54e384(_0x122807['error'](0x1f4,_0x317dc1[_0x4336('0x14')]));});});};exports['ShowWhatsappQueue']=function(_0x110049){var _0x57fcf6=this;return new Promise(function(_0x5d4913,_0x4ed82d){return db[_0x4336('0x22')][_0x4336('0x23')]({'raw':_0x110049['options']?_0x110049['options']['raw']===undefined?!![]:![]:!![],'where':_0x110049[_0x4336('0x19')]?_0x110049[_0x4336('0x19')][_0x4336('0x1b')]||null:null,'attributes':_0x110049[_0x4336('0x19')]?_0x110049[_0x4336('0x19')]['attributes']||null:null,'include':_0x110049[_0x4336('0x19')]?_0x110049[_0x4336('0x19')][_0x4336('0x1f')]?_[_0x4336('0x1e')](_0x110049[_0x4336('0x19')][_0x4336('0x1f')],function(_0x499ad8){return{'model':db[_0x499ad8[_0x4336('0x20')]],'as':_0x499ad8['as'],'attributes':_0x499ad8[_0x4336('0x1c')],'include':_0x499ad8[_0x4336('0x1f')]?_[_0x4336('0x1e')](_0x499ad8[_0x4336('0x1f')],function(_0x3c7a2b){return{'model':db[_0x3c7a2b[_0x4336('0x20')]],'as':_0x3c7a2b['as'],'attributes':_0x3c7a2b[_0x4336('0x1c')],'include':_0x3c7a2b['include']?_[_0x4336('0x1e')](_0x3c7a2b['include'],function(_0x928908){return{'model':db[_0x928908['model']],'as':_0x928908['as'],'attributes':_0x928908[_0x4336('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14fc09){logger[_0x4336('0xf')]('ShowWhatsappQueue',_0x110049);logger[_0x4336('0x21')](_0x4336('0x24'),_0x110049,JSON[_0x4336('0x12')](_0x14fc09));_0x5d4913(_0x14fc09);})[_0x4336('0x16')](function(_0x25389d){logger[_0x4336('0x13')](_0x4336('0x24'),_0x25389d['message'],_0x110049);_0x4ed82d(_0x57fcf6[_0x4336('0x13')](0x1f4,_0x25389d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4e22ffe..3d6e5f3 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a46=['save','update','emit','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a46,0xe9));var _0x63a4=function(_0x3378b8,_0x383b4c){_0x3378b8=_0x3378b8-0x0;var _0x576956=_0x3a46[_0x3378b8];return _0x576956;};'use strict';var WhatsappQueueEvents=require(_0x63a4('0x0'));var events=[_0x63a4('0x1'),'remove',_0x63a4('0x2')];function createListener(_0x4751f8,_0x494206){return function(_0x1637cd){_0x494206[_0x63a4('0x3')](_0x4751f8,_0x1637cd);};}function removeListener(_0x54ecf9,_0x568a64){return function(){WhatsappQueueEvents['removeListener'](_0x54ecf9,_0x568a64);};}exports['register']=function(_0x55c862){for(var _0x4eb605=0x0,_0x4c62af=events[_0x63a4('0x4')];_0x4eb605<_0x4c62af;_0x4eb605++){var _0x22b3a0=events[_0x4eb605];var _0x540480=createListener(_0x63a4('0x5')+_0x22b3a0,_0x55c862);WhatsappQueueEvents['on'](_0x22b3a0,_0x540480);}}; \ No newline at end of file +var _0x41b2=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x41b2,0x10f));var _0x241b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b2[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0x241b('0x0'));var events=[_0x241b('0x1'),_0x241b('0x2'),_0x241b('0x3')];function createListener(_0x690e2d,_0x29c76e){return function(_0x25ef59){_0x29c76e[_0x241b('0x4')](_0x690e2d,_0x25ef59);};}function removeListener(_0x489dd5,_0x76849f){return function(){WhatsappQueueEvents[_0x241b('0x5')](_0x489dd5,_0x76849f);};}exports[_0x241b('0x6')]=function(_0x524648){for(var _0x163457=0x0,_0x116d14=events[_0x241b('0x7')];_0x163457<_0x116d14;_0x163457++){var _0x477e56=events[_0x163457];var _0x394af8=createListener(_0x241b('0x8')+_0x477e56,_0x524648);WhatsappQueueEvents['on'](_0x477e56,_0x394af8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b55f7c4..4fae36e 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8064=['Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x54b784,_0x686cd8){var _0x21c29f=function(_0x272353){while(--_0x272353){_0x54b784['push'](_0x54b784['shift']());}};_0x21c29f(++_0x686cd8);}(_0x8064,0x14f));var _0x4806=function(_0x2d3699,_0x3de736){_0x2d3699=_0x2d3699-0x0;var _0xd344f=_0x8064[_0x2d3699];return _0xd344f;};'use strict';var multer=require(_0x4806('0x0'));var util=require(_0x4806('0x1'));var path=require(_0x4806('0x2'));var timeout=require(_0x4806('0x3'));var express=require(_0x4806('0x4'));var router=express[_0x4806('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4806('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x4806('0x7')]('/',auth[_0x4806('0x8')](),controller[_0x4806('0x9')]);router[_0x4806('0x7')](_0x4806('0xa'),auth[_0x4806('0x8')](),controller[_0x4806('0xb')]);router['get'](_0x4806('0xc'),auth[_0x4806('0x8')](),controller[_0x4806('0xd')]);router[_0x4806('0xe')]('/',auth[_0x4806('0x8')](),controller[_0x4806('0xf')]);router[_0x4806('0x10')](_0x4806('0xc'),auth['isAuthenticated'](),controller[_0x4806('0x11')]);router['delete']('/:id',auth[_0x4806('0x8')](),controller[_0x4806('0x12')]);module[_0x4806('0x13')]=router; \ No newline at end of file +var _0x9983=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','get','describe','/:id','show','post','create','put','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x9983,0x14f));var _0x3998=function(_0x5c3f3c,_0x2e3c79){_0x5c3f3c=_0x5c3f3c-0x0;var _0x26ff74=_0x9983[_0x5c3f3c];return _0x26ff74;};'use strict';var multer=require(_0x3998('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3998('0x1'));var express=require(_0x3998('0x2'));var router=express[_0x3998('0x3')]();var fs_extra=require(_0x3998('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3998('0x5'));var config=require(_0x3998('0x6'));var controller=require(_0x3998('0x7'));router['get']('/',auth[_0x3998('0x8')](),controller['index']);router[_0x3998('0x9')]('/describe',auth[_0x3998('0x8')](),controller[_0x3998('0xa')]);router[_0x3998('0x9')](_0x3998('0xb'),auth['isAuthenticated'](),controller[_0x3998('0xc')]);router[_0x3998('0xd')]('/',auth[_0x3998('0x8')](),controller[_0x3998('0xe')]);router[_0x3998('0xf')](_0x3998('0xb'),auth[_0x3998('0x8')](),controller['update']);router['delete'](_0x3998('0xb'),auth[_0x3998('0x8')](),controller['destroy']);module[_0x3998('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 79754cc..fb0440d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x262e35,_0x1c096f){var _0x368821=function(_0x21019a){while(--_0x21019a){_0x262e35['push'](_0x262e35['shift']());}};_0x368821(++_0x1c096f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0xdfb3fb,_0x4dd7d4){var _0x1ff202=function(_0xd16512){while(--_0xd16512){_0xdfb3fb['push'](_0xdfb3fb['shift']());}};_0x1ff202(++_0x4dd7d4);}(_0x7a54,0x106));var _0x47a5=function(_0x343721,_0x2574d0){_0x343721=_0x343721-0x0;var _0x15a656=_0x7a54[_0x343721];return _0x15a656;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index c53c6a7..5806a88 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['fields','length','nolimit','offset','order','sort','pick','type','VIRTUAL','filter','options','where','then','include','findAll','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','query','filters','intersection','attributes'];(function(_0x555714,_0x296b0b){var _0x3c76e5=function(_0x2ced27){while(--_0x2ced27){_0x555714['push'](_0x555714['shift']());}};_0x3c76e5(++_0x296b0b);}(_0x9c00,0x1a0));var _0x09c0=function(_0x58675f,_0x390355){_0x58675f=_0x58675f-0x0;var _0x1cc7f0=_0x9c00[_0x58675f];return _0x1cc7f0;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x56d883,_0x2c7202){return function(_0x163a59){if(!_0x163a59){_0x56d883[_0x09c0('0x1b')](0x194);}return _0x163a59;};}function handleError(_0x30c2a1,_0x1f8131){_0x1f8131=_0x1f8131||0x1f4;return function(_0x1d2d9d){logger[_0x09c0('0x27')](_0x1d2d9d[_0x09c0('0x28')]);if(_0x1d2d9d[_0x09c0('0x29')]){delete _0x1d2d9d[_0x09c0('0x29')];}_0x30c2a1[_0x09c0('0x1c')](_0x1f8131)['send'](_0x1d2d9d);};}exports[_0x09c0('0x2a')]=function(_0x1bdde9,_0x53a7b8){var _0x1d09e0={},_0x5aa0b9={},_0x3f5b10={'count':0x0,'rows':[]};var _0x4d6bdc=_[_0x09c0('0x2b')](db[_0x09c0('0x2c')][_0x09c0('0x2d')],function(_0x4159bc){return{'name':_0x4159bc['fieldName'],'type':_0x4159bc['type'][_0x09c0('0x2e')]};});_0x5aa0b9[_0x09c0('0x2f')]=_[_0x09c0('0x2b')](_0x4d6bdc,'name');_0x5aa0b9[_0x09c0('0x30')]=_['keys'](_0x1bdde9[_0x09c0('0x30')]);_0x5aa0b9[_0x09c0('0x31')]=_[_0x09c0('0x32')](_0x5aa0b9['model'],_0x5aa0b9[_0x09c0('0x30')]);_0x1d09e0[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x5aa0b9[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x34')]));_0x1d09e0['attributes']=_0x1d09e0[_0x09c0('0x33')][_0x09c0('0x35')]?_0x1d09e0[_0x09c0('0x33')]:_0x5aa0b9[_0x09c0('0x2f')];if(!_0x1bdde9[_0x09c0('0x30')]['hasOwnProperty'](_0x09c0('0x36'))){_0x1d09e0[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x20')]);_0x1d09e0['offset']=qs[_0x09c0('0x37')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x37')]);}_0x1d09e0[_0x09c0('0x38')]=qs[_0x09c0('0x39')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x39')]);_0x1d09e0['where']=qs[_0x09c0('0x31')](_[_0x09c0('0x3a')](_0x1bdde9[_0x09c0('0x30')],_0x5aa0b9[_0x09c0('0x31')]),_0x4d6bdc);if(_0x1bdde9[_0x09c0('0x30')]['filter']){_0x1d09e0['where']=_['merge'](_0x1d09e0['where'],{'$or':_[_0x09c0('0x2b')](_0x4d6bdc,function(_0x15c631){if(_0x15c631[_0x09c0('0x3b')]!==_0x09c0('0x3c')){var _0x1a8c0c={};_0x1a8c0c[_0x15c631['name']]={'$like':'%'+_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x3d')]+'%'};return _0x1a8c0c;}})});}_0x1d09e0=_['merge']({},_0x1d09e0,_0x1bdde9[_0x09c0('0x3e')]);var _0x5d50b9={'where':_0x1d09e0[_0x09c0('0x3f')]};return db['WhatsappQueueReport'][_0x09c0('0x21')](_0x5d50b9)[_0x09c0('0x40')](function(_0x56a511){_0x3f5b10[_0x09c0('0x21')]=_0x56a511;if(_0x1bdde9[_0x09c0('0x30')]['includeAll']){_0x1d09e0[_0x09c0('0x41')]=[{'all':!![]}];}return db[_0x09c0('0x2c')][_0x09c0('0x42')](_0x1d09e0);})[_0x09c0('0x40')](function(_0xeb8191){_0x3f5b10[_0x09c0('0x43')]=_0xeb8191;return _0x3f5b10;})['then'](respondWithFilteredResult(_0x53a7b8,_0x1d09e0))[_0x09c0('0x44')](handleError(_0x53a7b8,null));};exports[_0x09c0('0x45')]=function(_0x2d6344,_0x57835c){var _0x193ed2={'raw':!![],'where':{'id':_0x2d6344[_0x09c0('0x46')]['id']}},_0x30c0c5={};_0x30c0c5['model']=_[_0x09c0('0x47')](db[_0x09c0('0x2c')]['rawAttributes']);_0x30c0c5['query']=_[_0x09c0('0x47')](_0x2d6344[_0x09c0('0x30')]);_0x30c0c5['filters']=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],_0x30c0c5['query']);_0x193ed2[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x2d6344[_0x09c0('0x30')]['fields']));_0x193ed2[_0x09c0('0x33')]=_0x193ed2['attributes']['length']?_0x193ed2[_0x09c0('0x33')]:_0x30c0c5[_0x09c0('0x2f')];if(_0x2d6344[_0x09c0('0x30')][_0x09c0('0x48')]){_0x193ed2[_0x09c0('0x41')]=[{'all':!![]}];}_0x193ed2=_[_0x09c0('0x49')]({},_0x193ed2,_0x2d6344['options']);return db['WhatsappQueueReport']['find'](_0x193ed2)[_0x09c0('0x40')](handleEntityNotFound(_0x57835c,null))[_0x09c0('0x40')](respondWithResult(_0x57835c,null))[_0x09c0('0x44')](handleError(_0x57835c,null));};exports['create']=function(_0xdf1553,_0xff9650){return db[_0x09c0('0x2c')][_0x09c0('0x4a')](_0xdf1553[_0x09c0('0x4b')],{})[_0x09c0('0x40')](respondWithResult(_0xff9650,0xc9))[_0x09c0('0x44')](handleError(_0xff9650,null));};exports[_0x09c0('0x25')]=function(_0x3f6d14,_0x38085c){if(_0x3f6d14[_0x09c0('0x4b')]['id']){delete _0x3f6d14[_0x09c0('0x4b')]['id'];}return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x3f6d14[_0x09c0('0x46')]['id']}})[_0x09c0('0x40')](handleEntityNotFound(_0x38085c,null))[_0x09c0('0x40')](saveUpdates(_0x3f6d14[_0x09c0('0x4b')],null))[_0x09c0('0x40')](respondWithResult(_0x38085c,null))[_0x09c0('0x44')](handleError(_0x38085c,null));};exports['destroy']=function(_0x4acf54,_0x44befb){return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x4acf54[_0x09c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x44befb,null))[_0x09c0('0x40')](removeEntity(_0x44befb,null))[_0x09c0('0x44')](handleError(_0x44befb,null));};exports[_0x09c0('0x4d')]=function(_0x4a92c0,_0xe0b82a){return db[_0x09c0('0x2c')][_0x09c0('0x4d')]()[_0x09c0('0x40')](respondWithResult(_0xe0b82a,null))[_0x09c0('0x44')](handleError(_0xe0b82a,null));}; \ No newline at end of file +var _0x1d2d=['options','WhatsappQueueReport','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x523936,_0x7c2250){var _0x27d654=function(_0x1d2254){while(--_0x1d2254){_0x523936['push'](_0x523936['shift']());}};_0x27d654(++_0x7c2250);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x333405,_0x47853e){_0x333405=_0x333405-0x0;var _0x4ed28b=_0x1d2d[_0x333405];return _0x4ed28b;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['WhatsappQueueReport'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));};exports[_0xd1d2('0x4b')]=function(_0xfd8024,_0xa013ce){return db[_0xd1d2('0x41')][_0xd1d2('0x4b')]()[_0xd1d2('0x26')](respondWithResult(_0xa013ce,null))[_0xd1d2('0x44')](handleError(_0xa013ce,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c285cc7..fe07eef 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55c0=['../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x55c0,0x13e));var _0x055c=function(_0x353856,_0x5ce89d){_0x353856=_0x353856-0x0;var _0xa58048=_0x55c0[_0x353856];return _0xa58048;};'use strict';var _=require('lodash');var util=require(_0x055c('0x0'));var logger=require(_0x055c('0x1'))(_0x055c('0x2'));var moment=require(_0x055c('0x3'));var BPromise=require(_0x055c('0x4'));var rp=require(_0x055c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x055c('0x6'));var config=require(_0x055c('0x7'));var attributes=require(_0x055c('0x8'));module['exports']=function(_0xff9d88,_0x194b17){return _0xff9d88[_0x055c('0x9')](_0x055c('0xa'),attributes,{'tableName':_0x055c('0xb'),'paranoid':![],'indexes':[{'name':_0x055c('0xc'),'fields':[_0x055c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa285=['rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x275657,_0x1c7045){var _0x15a70b=function(_0x201aa2){while(--_0x201aa2){_0x275657['push'](_0x275657['shift']());}};_0x15a70b(++_0x1c7045);}(_0xa285,0x1ab));var _0x5a28=function(_0x1f1195,_0x40f94c){_0x1f1195=_0x1f1195-0x0;var _0x383f46=_0xa285[_0x1f1195];return _0x383f46;};'use strict';var _=require(_0x5a28('0x0'));var util=require(_0x5a28('0x1'));var logger=require(_0x5a28('0x2'))(_0x5a28('0x3'));var moment=require(_0x5a28('0x4'));var BPromise=require(_0x5a28('0x5'));var rp=require(_0x5a28('0x6'));var fs=require('fs');var path=require(_0x5a28('0x7'));var rimraf=require(_0x5a28('0x8'));var config=require(_0x5a28('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0x5a28('0xa')]=function(_0x39bf98,_0x349d95){return _0x39bf98[_0x5a28('0xb')](_0x5a28('0xc'),attributes,{'tableName':_0x5a28('0xd'),'paranoid':![],'indexes':[{'name':_0x5a28('0xe'),'fields':[_0x5a28('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4f1e91d..67f62bc 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb1a=['WhatsappQueueReport','body','options','stringify','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport'];(function(_0x2d3bed,_0x17a9e9){var _0x2ce190=function(_0x287818){while(--_0x287818){_0x2d3bed['push'](_0x2d3bed['shift']());}};_0x2ce190(++_0x17a9e9);}(_0xbb1a,0x166));var _0xabb1=function(_0x2fffe3,_0x20cf38){_0x2fffe3=_0x2fffe3-0x0;var _0x51e792=_0xbb1a[_0x2fffe3];return _0x51e792;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var moment=require('moment');var BPromise=require(_0xabb1('0x2'));var rs=require(_0xabb1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xabb1('0x4'));var logger=require(_0xabb1('0x5'))('rpc');var config=require(_0xabb1('0x6'));var jayson=require(_0xabb1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7ef8,_0x458e9b,_0x296651){return new BPromise(function(_0x2e9ba4,_0x1e881f){return client[_0xabb1('0x8')](_0x2e7ef8,_0x296651)[_0xabb1('0x9')](function(_0x5311a2){logger[_0xabb1('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x458e9b,_0xabb1('0xb'));logger[_0xabb1('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x458e9b,'request\x20sent',JSON['stringify'](_0x5311a2));if(_0x5311a2[_0xabb1('0xd')]){if(_0x5311a2[_0xabb1('0xd')]['code']===0x1f4){logger[_0xabb1('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x458e9b,_0x5311a2[_0xabb1('0xd')][_0xabb1('0xe')]);return _0x1e881f(_0x5311a2[_0xabb1('0xd')][_0xabb1('0xe')]);}logger[_0xabb1('0xd')](_0xabb1('0xf'),_0x458e9b,_0x5311a2['error'][_0xabb1('0xe')]);return _0x2e9ba4(_0x5311a2[_0xabb1('0xd')]['message']);}else{logger[_0xabb1('0xa')](_0xabb1('0xf'),_0x458e9b,_0xabb1('0xb'));_0x2e9ba4(_0x5311a2[_0xabb1('0x10')][_0xabb1('0xe')]);}})[_0xabb1('0x11')](function(_0x20ac55){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x458e9b,_0x20ac55);_0x1e881f(_0x20ac55);});});}exports[_0xabb1('0x12')]=function(_0x49a489){var _0x5521d1=this;return new Promise(function(_0x46966c,_0x29c0fc){return db[_0xabb1('0x13')]['create'](_0x49a489[_0xabb1('0x14')],{'raw':_0x49a489['options']?_0x49a489[_0xabb1('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xabb1('0x9')](function(_0x27024e){logger['info'](_0xabb1('0x12'),_0x49a489);logger[_0xabb1('0xc')](_0xabb1('0x12'),_0x49a489,JSON[_0xabb1('0x16')](_0x27024e));_0x46966c(_0x27024e);})[_0xabb1('0x11')](function(_0x4631e7){logger[_0xabb1('0xd')](_0xabb1('0x12'),_0x4631e7[_0xabb1('0xe')],_0x49a489);_0x29c0fc(_0x5521d1[_0xabb1('0xd')](0x1f4,_0x4631e7['message']));});});};exports[_0xabb1('0x17')]=function(_0x4845ce){var _0x1953ef=this;return new Promise(function(_0x197005,_0x59822c){return db[_0xabb1('0x13')][_0xabb1('0x18')](_0x4845ce[_0xabb1('0x14')],{'raw':_0x4845ce['options']?_0x4845ce[_0xabb1('0x15')][_0xabb1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4845ce['options']?_0x4845ce[_0xabb1('0x15')][_0xabb1('0x1a')]||null:null,'attributes':_0x4845ce['options']?_0x4845ce[_0xabb1('0x15')][_0xabb1('0x1b')]||null:null,'limit':_0x4845ce[_0xabb1('0x15')]?_0x4845ce['options'][_0xabb1('0x1c')]||null:null})[_0xabb1('0x9')](function(_0x178884){logger[_0xabb1('0xa')](_0xabb1('0x17'),_0x4845ce);logger[_0xabb1('0xc')](_0xabb1('0x17'),_0x4845ce,JSON[_0xabb1('0x16')](_0x178884));_0x197005(_0x178884);})['catch'](function(_0x2fbe61){logger[_0xabb1('0xd')](_0xabb1('0x17'),_0x2fbe61['message'],_0x4845ce);_0x59822c(_0x1953ef['error'](0x1f4,_0x2fbe61[_0xabb1('0xe')]));});});}; \ No newline at end of file +var _0x3a63=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','limit','then','lodash','bluebird','randomstring','ioredis'];(function(_0xe2e0dc,_0x3070a1){var _0x1918d9=function(_0x43685f){while(--_0x43685f){_0xe2e0dc['push'](_0xe2e0dc['shift']());}};_0x1918d9(++_0x3070a1);}(_0x3a63,0x11e));var _0x33a6=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x3a63[_0x1e8b1e];return _0x4a0fde;};'use strict';var _=require(_0x33a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x33a6('0x1'));var rs=require(_0x33a6('0x2'));var fs=require('fs');var Redis=require(_0x33a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x33a6('0x4'));var logger=require('../../config/logger')(_0x33a6('0x5'));var config=require(_0x33a6('0x6'));var jayson=require(_0x33a6('0x7'));var client=jayson[_0x33a6('0x8')][_0x33a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52385c,_0xdbad2b,_0xb692b5){return new BPromise(function(_0x1c9e91,_0x2e4938){return client['request'](_0x52385c,_0xb692b5)['then'](function(_0x5bcfc4){logger[_0x33a6('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0xdbad2b,_0x33a6('0xb'));logger[_0x33a6('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0xdbad2b,_0x33a6('0xb'),JSON[_0x33a6('0xd')](_0x5bcfc4));if(_0x5bcfc4[_0x33a6('0xe')]){if(_0x5bcfc4[_0x33a6('0xe')][_0x33a6('0xf')]===0x1f4){logger[_0x33a6('0xe')](_0x33a6('0x10'),_0xdbad2b,_0x5bcfc4[_0x33a6('0xe')]['message']);return _0x2e4938(_0x5bcfc4[_0x33a6('0xe')]['message']);}logger['error'](_0x33a6('0x10'),_0xdbad2b,_0x5bcfc4[_0x33a6('0xe')][_0x33a6('0x11')]);return _0x1c9e91(_0x5bcfc4[_0x33a6('0xe')][_0x33a6('0x11')]);}else{logger[_0x33a6('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0xdbad2b,_0x33a6('0xb'));_0x1c9e91(_0x5bcfc4['result'][_0x33a6('0x11')]);}})[_0x33a6('0x12')](function(_0x44d295){logger[_0x33a6('0xe')](_0x33a6('0x10'),_0xdbad2b,_0x44d295);_0x2e4938(_0x44d295);});});}exports[_0x33a6('0x13')]=function(_0x49bb93){var _0x51f86d=this;return new Promise(function(_0x14e647,_0x55261){return db[_0x33a6('0x14')][_0x33a6('0x15')](_0x49bb93[_0x33a6('0x16')],{'raw':_0x49bb93[_0x33a6('0x17')]?_0x49bb93['options'][_0x33a6('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x454a81){logger[_0x33a6('0xa')](_0x33a6('0x13'),_0x49bb93);logger[_0x33a6('0xc')](_0x33a6('0x13'),_0x49bb93,JSON[_0x33a6('0xd')](_0x454a81));_0x14e647(_0x454a81);})[_0x33a6('0x12')](function(_0x4a6845){logger[_0x33a6('0xe')]('CreateWhatsappQueueReport',_0x4a6845[_0x33a6('0x11')],_0x49bb93);_0x55261(_0x51f86d[_0x33a6('0xe')](0x1f4,_0x4a6845[_0x33a6('0x11')]));});});};exports[_0x33a6('0x19')]=function(_0x3e41ed){var _0x4f4b91=this;return new Promise(function(_0x1b234e,_0x483f1f){return db[_0x33a6('0x14')][_0x33a6('0x1a')](_0x3e41ed[_0x33a6('0x16')],{'raw':_0x3e41ed[_0x33a6('0x17')]?_0x3e41ed[_0x33a6('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e41ed['options']?_0x3e41ed[_0x33a6('0x17')]['where']||null:null,'attributes':_0x3e41ed[_0x33a6('0x17')]?_0x3e41ed[_0x33a6('0x17')]['attributes']||null:null,'limit':_0x3e41ed['options']?_0x3e41ed[_0x33a6('0x17')][_0x33a6('0x1b')]||null:null})[_0x33a6('0x1c')](function(_0x5c2794){logger['info'](_0x33a6('0x19'),_0x3e41ed);logger['debug'](_0x33a6('0x19'),_0x3e41ed,JSON[_0x33a6('0xd')](_0x5c2794));_0x1b234e(_0x5c2794);})[_0x33a6('0x12')](function(_0x3f89ae){logger[_0x33a6('0xe')](_0x33a6('0x19'),_0x3f89ae[_0x33a6('0x11')],_0x3e41ed);_0x483f1f(_0x4f4b91[_0x33a6('0xe')](0x1f4,_0x3f89ae['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f9c060a..e5acced 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc44=['../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc44,0x13c));var _0x4fc4=function(_0x4c0bf2,_0x25b8e4){_0x4c0bf2=_0x4c0bf2-0x0;var _0x2a402b=_0xfc44[_0x4c0bf2];return _0x2a402b;};'use strict';var multer=require(_0x4fc4('0x0'));var util=require(_0x4fc4('0x1'));var path=require(_0x4fc4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4fc4('0x3')]();var fs_extra=require(_0x4fc4('0x4'));var auth=require(_0x4fc4('0x5'));var interaction=require(_0x4fc4('0x6'));var config=require(_0x4fc4('0x7'));var controller=require(_0x4fc4('0x8'));router[_0x4fc4('0x9')]('/',auth[_0x4fc4('0xa')](),controller[_0x4fc4('0xb')]);router['get'](_0x4fc4('0xc'),auth[_0x4fc4('0xa')](),controller[_0x4fc4('0xd')]);router[_0x4fc4('0x9')](_0x4fc4('0xe'),auth[_0x4fc4('0xa')](),controller[_0x4fc4('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4fc4('0xe'),auth[_0x4fc4('0xa')](),controller[_0x4fc4('0x10')]);router['delete'](_0x4fc4('0xe'),auth[_0x4fc4('0xa')](),controller[_0x4fc4('0x11')]);module[_0x4fc4('0x12')]=router; \ No newline at end of file +var _0x5d9d=['show','post','create','put','update','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x5dd701,_0x1f9d9b){var _0x4b7302=function(_0x2d5d81){while(--_0x2d5d81){_0x5dd701['push'](_0x5dd701['shift']());}};_0x4b7302(++_0x1f9d9b);}(_0x5d9d,0x9f));var _0xd5d9=function(_0x1a8138,_0xf328e9){_0x1a8138=_0x1a8138-0x0;var _0x26551b=_0x5d9d[_0x1a8138];return _0x26551b;};'use strict';var multer=require('multer');var util=require(_0xd5d9('0x0'));var path=require(_0xd5d9('0x1'));var timeout=require(_0xd5d9('0x2'));var express=require(_0xd5d9('0x3'));var router=express['Router']();var fs_extra=require(_0xd5d9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5d9('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xd5d9('0x6')]('/',auth[_0xd5d9('0x7')](),controller[_0xd5d9('0x8')]);router[_0xd5d9('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xd5d9('0x9')]);router[_0xd5d9('0x6')](_0xd5d9('0xa'),auth[_0xd5d9('0x7')](),controller[_0xd5d9('0xb')]);router[_0xd5d9('0xc')]('/',auth[_0xd5d9('0x7')](),controller[_0xd5d9('0xd')]);router[_0xd5d9('0xe')](_0xd5d9('0xa'),auth[_0xd5d9('0x7')](),controller[_0xd5d9('0xf')]);router['delete']('/:id',auth[_0xd5d9('0x7')](),controller['destroy']);module[_0xd5d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5f468ec..3175fae 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48ac=['ENUM','account','agent','DATE','exports'];(function(_0x464549,_0x32a5d2){var _0x2f00bd=function(_0x5bebc8){while(--_0x5bebc8){_0x464549['push'](_0x464549['shift']());}};_0x2f00bd(++_0x32a5d2);}(_0x48ac,0xe0));var _0xc48a=function(_0x8f3660,_0x5a5157){_0x8f3660=_0x8f3660-0x0;var _0x3b3b90=_0x48ac[_0x8f3660];return _0x3b3b90;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc48a('0x1')](_0xc48a('0x2'),_0xc48a('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc48a('0x4')]}}; \ No newline at end of file +var _0x3611=['queue','DATE','sequelize','ENUM'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x3611,0x136));var _0x1361=function(_0x5b1776,_0x4710a2){_0x5b1776=_0x5b1776-0x0;var _0x52a6d1=_0x3611[_0x5b1776];return _0x52a6d1;};'use strict';var Sequelize=require(_0x1361('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1361('0x1')]('account','agent',_0x1361('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1361('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index abf6408..e84d679 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c4b=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x855e25,_0x5cc86d){var _0x4c2b86=function(_0x1ab233){while(--_0x1ab233){_0x855e25['push'](_0x855e25['shift']());}};_0x4c2b86(++_0x5cc86d);}(_0x5c4b,0xa2));var _0xb5c4=function(_0x27de90,_0x57e3f7){_0x27de90=_0x27de90-0x0;var _0x33132f=_0x5c4b[_0x27de90];return _0x33132f;};'use strict';var emlformat=require(_0xb5c4('0x0'));var rimraf=require(_0xb5c4('0x1'));var zipdir=require(_0xb5c4('0x2'));var jsonpatch=require(_0xb5c4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5c4('0x4'));var Mustache=require(_0xb5c4('0x5'));var util=require('util');var path=require(_0xb5c4('0x6'));var sox=require('sox');var csv=require(_0xb5c4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5c4('0x8'));var crypto=require(_0xb5c4('0x9'));var jsforce=require(_0xb5c4('0xa'));var deskjs=require(_0xb5c4('0xb'));var toCsv=require(_0xb5c4('0x7'));var querystring=require('querystring');var Papa=require(_0xb5c4('0xc'));var Redis=require(_0xb5c4('0xd'));var authService=require(_0xb5c4('0xe'));var qs=require(_0xb5c4('0xf'));var as=require(_0xb5c4('0x10'));var hardwareService=require(_0xb5c4('0x11'));var logger=require(_0xb5c4('0x12'))('api');var utils=require(_0xb5c4('0x13'));var config=require(_0xb5c4('0x14'));var licenseUtil=require(_0xb5c4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121e7b,_0x575ba2){_0x575ba2=_0x575ba2||0xcc;return function(_0x2727ef){if(_0x2727ef){return _0x121e7b[_0xb5c4('0x16')](_0x575ba2);}return _0x121e7b[_0xb5c4('0x17')](_0x575ba2)[_0xb5c4('0x18')]();};}function respondWithResult(_0x52b299,_0x50e2bf){_0x50e2bf=_0x50e2bf||0xc8;return function(_0x169dfd){if(_0x169dfd){return _0x52b299[_0xb5c4('0x17')](_0x50e2bf)[_0xb5c4('0x19')](_0x169dfd);}};}function respondWithFilteredResult(_0x173029,_0x4588e9){return function(_0x15e21c){if(_0x15e21c){var _0x5c6531=typeof _0x4588e9[_0xb5c4('0x1a')]==='undefined'&&typeof _0x4588e9['limit']==='undefined';var _0x370835=_0x15e21c[_0xb5c4('0x1b')];var _0x403092=_0x5c6531?0x0:_0x4588e9['offset'];var _0x1daeb0=_0x5c6531?_0x15e21c['count']:_0x4588e9['offset']+_0x4588e9['limit'];var _0x1ae96b;if(_0x1daeb0>=_0x370835){_0x1daeb0=_0x370835;_0x1ae96b=0xc8;}else{_0x1ae96b=0xce;}_0x173029[_0xb5c4('0x17')](_0x1ae96b);return _0x173029[_0xb5c4('0x1c')](_0xb5c4('0x1d'),_0x403092+'-'+_0x1daeb0+'/'+_0x370835)[_0xb5c4('0x19')](_0x15e21c);}return null;};}function patchUpdates(_0x148bfb){return function(_0x1779ae){try{jsonpatch[_0xb5c4('0x1e')](_0x1779ae,_0x148bfb,!![]);}catch(_0xb21865){return BPromise[_0xb5c4('0x1f')](_0xb21865);}return _0x1779ae[_0xb5c4('0x20')]();};}function saveUpdates(_0x474b64,_0x1fd99c){return function(_0x4b430d){if(_0x4b430d){return _0x4b430d[_0xb5c4('0x21')](_0x474b64)[_0xb5c4('0x22')](function(_0x22f9f7){return _0x22f9f7;});}return null;};}function removeEntity(_0xb468ba,_0x21420b){return function(_0x2bcd94){if(_0x2bcd94){return _0x2bcd94[_0xb5c4('0x23')]()[_0xb5c4('0x22')](function(){_0xb468ba[_0xb5c4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edb3c,_0x1a2fe4){return function(_0x13d08b){if(!_0x13d08b){_0x4edb3c[_0xb5c4('0x16')](0x194);}return _0x13d08b;};}function handleError(_0x4d4c91,_0xb0ec99){_0xb0ec99=_0xb0ec99||0x1f4;return function(_0x27c2cb){logger['error'](_0x27c2cb[_0xb5c4('0x24')]);if(_0x27c2cb[_0xb5c4('0x25')]){delete _0x27c2cb[_0xb5c4('0x25')];}_0x4d4c91[_0xb5c4('0x17')](_0xb0ec99)[_0xb5c4('0x26')](_0x27c2cb);};}exports['index']=function(_0x128e77,_0x5b39c0){var _0x1ff5e9={},_0x113cae={},_0x36073d={'count':0x0,'rows':[]};var _0x5e6744=_[_0xb5c4('0x27')](db[_0xb5c4('0x28')][_0xb5c4('0x29')],function(_0x51356a){return{'name':_0x51356a['fieldName'],'type':_0x51356a[_0xb5c4('0x2a')][_0xb5c4('0x2b')]};});_0x113cae[_0xb5c4('0x2c')]=_['map'](_0x5e6744,'name');_0x113cae[_0xb5c4('0x2d')]=_[_0xb5c4('0x2e')](_0x128e77[_0xb5c4('0x2d')]);_0x113cae[_0xb5c4('0x2f')]=_[_0xb5c4('0x30')](_0x113cae['model'],_0x113cae[_0xb5c4('0x2d')]);_0x1ff5e9['attributes']=_[_0xb5c4('0x30')](_0x113cae[_0xb5c4('0x2c')],qs[_0xb5c4('0x31')](_0x128e77[_0xb5c4('0x2d')]['fields']));_0x1ff5e9['attributes']=_0x1ff5e9[_0xb5c4('0x32')][_0xb5c4('0x33')]?_0x1ff5e9[_0xb5c4('0x32')]:_0x113cae[_0xb5c4('0x2c')];if(!_0x128e77[_0xb5c4('0x2d')][_0xb5c4('0x34')](_0xb5c4('0x35'))){_0x1ff5e9[_0xb5c4('0x36')]=qs[_0xb5c4('0x36')](_0x128e77[_0xb5c4('0x2d')][_0xb5c4('0x36')]);_0x1ff5e9[_0xb5c4('0x1a')]=qs[_0xb5c4('0x1a')](_0x128e77[_0xb5c4('0x2d')][_0xb5c4('0x1a')]);}_0x1ff5e9['order']=qs[_0xb5c4('0x37')](_0x128e77[_0xb5c4('0x2d')]['sort']);_0x1ff5e9[_0xb5c4('0x38')]=qs[_0xb5c4('0x2f')](_[_0xb5c4('0x39')](_0x128e77[_0xb5c4('0x2d')],_0x113cae[_0xb5c4('0x2f')]),_0x5e6744);if(_0x128e77['query'][_0xb5c4('0x3a')]){_0x1ff5e9[_0xb5c4('0x38')]=_[_0xb5c4('0x3b')](_0x1ff5e9[_0xb5c4('0x38')],{'$or':_[_0xb5c4('0x27')](_0x5e6744,function(_0x4766b1){if(_0x4766b1['type']!==_0xb5c4('0x3c')){var _0xfb1270={};_0xfb1270[_0x4766b1[_0xb5c4('0x25')]]={'$like':'%'+_0x128e77[_0xb5c4('0x2d')][_0xb5c4('0x3a')]+'%'};return _0xfb1270;}})});}_0x1ff5e9=_[_0xb5c4('0x3b')]({},_0x1ff5e9,_0x128e77[_0xb5c4('0x3d')]);var _0x301cc8={'where':_0x1ff5e9['where']};return db['WhatsappTransferReport']['count'](_0x301cc8)['then'](function(_0x14cbe8){_0x36073d[_0xb5c4('0x1b')]=_0x14cbe8;if(_0x128e77[_0xb5c4('0x2d')][_0xb5c4('0x3e')]){_0x1ff5e9[_0xb5c4('0x3f')]=[{'all':!![]}];}return db[_0xb5c4('0x28')][_0xb5c4('0x40')](_0x1ff5e9);})[_0xb5c4('0x22')](function(_0xb34d8d){_0x36073d[_0xb5c4('0x41')]=_0xb34d8d;return _0x36073d;})['then'](respondWithFilteredResult(_0x5b39c0,_0x1ff5e9))[_0xb5c4('0x42')](handleError(_0x5b39c0,null));};exports[_0xb5c4('0x43')]=function(_0x1c7b58,_0x2185e3){var _0x2a715b={'raw':!![],'where':{'id':_0x1c7b58[_0xb5c4('0x44')]['id']}},_0x40d19d={};_0x40d19d[_0xb5c4('0x2c')]=_[_0xb5c4('0x2e')](db[_0xb5c4('0x28')][_0xb5c4('0x29')]);_0x40d19d['query']=_[_0xb5c4('0x2e')](_0x1c7b58[_0xb5c4('0x2d')]);_0x40d19d[_0xb5c4('0x2f')]=_[_0xb5c4('0x30')](_0x40d19d['model'],_0x40d19d[_0xb5c4('0x2d')]);_0x2a715b[_0xb5c4('0x32')]=_['intersection'](_0x40d19d[_0xb5c4('0x2c')],qs[_0xb5c4('0x31')](_0x1c7b58[_0xb5c4('0x2d')][_0xb5c4('0x31')]));_0x2a715b[_0xb5c4('0x32')]=_0x2a715b[_0xb5c4('0x32')][_0xb5c4('0x33')]?_0x2a715b[_0xb5c4('0x32')]:_0x40d19d['model'];if(_0x1c7b58[_0xb5c4('0x2d')][_0xb5c4('0x3e')]){_0x2a715b['include']=[{'all':!![]}];}_0x2a715b=_['merge']({},_0x2a715b,_0x1c7b58[_0xb5c4('0x3d')]);return db['WhatsappTransferReport'][_0xb5c4('0x45')](_0x2a715b)['then'](handleEntityNotFound(_0x2185e3,null))[_0xb5c4('0x22')](respondWithResult(_0x2185e3,null))[_0xb5c4('0x42')](handleError(_0x2185e3,null));};exports['create']=function(_0x2987ae,_0x4be281){return db[_0xb5c4('0x28')][_0xb5c4('0x46')](_0x2987ae[_0xb5c4('0x47')],{})[_0xb5c4('0x22')](respondWithResult(_0x4be281,0xc9))[_0xb5c4('0x42')](handleError(_0x4be281,null));};exports['update']=function(_0x2013a7,_0x2ef73a){if(_0x2013a7['body']['id']){delete _0x2013a7['body']['id'];}return db[_0xb5c4('0x28')]['find']({'where':{'id':_0x2013a7['params']['id']}})['then'](handleEntityNotFound(_0x2ef73a,null))[_0xb5c4('0x22')](saveUpdates(_0x2013a7['body'],null))[_0xb5c4('0x22')](respondWithResult(_0x2ef73a,null))[_0xb5c4('0x42')](handleError(_0x2ef73a,null));};exports[_0xb5c4('0x23')]=function(_0x5d5bd7,_0x4d42a0){return db[_0xb5c4('0x28')][_0xb5c4('0x45')]({'where':{'id':_0x5d5bd7[_0xb5c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d42a0,null))[_0xb5c4('0x22')](removeEntity(_0x4d42a0,null))[_0xb5c4('0x42')](handleError(_0x4d42a0,null));};exports[_0xb5c4('0x48')]=function(_0x25325c,_0x369613){return db[_0xb5c4('0x28')][_0xb5c4('0x48')]()[_0xb5c4('0x22')](respondWithResult(_0x369613,null))[_0xb5c4('0x42')](handleError(_0x369613,null));}; \ No newline at end of file +var _0x98d1=['count','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x599041,_0x40fbea){var _0x1c4969=function(_0x138048){while(--_0x138048){_0x599041['push'](_0x599041['shift']());}};_0x1c4969(++_0x40fbea);}(_0x98d1,0x13e));var _0x198d=function(_0x46d4aa,_0x216562){_0x46d4aa=_0x46d4aa-0x0;var _0x1d8ae6=_0x98d1[_0x46d4aa];return _0x1d8ae6;};'use strict';var emlformat=require(_0x198d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x198d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x198d('0x2'));var moment=require(_0x198d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x198d('0x4'));var util=require(_0x198d('0x5'));var path=require(_0x198d('0x6'));var sox=require(_0x198d('0x7'));var csv=require(_0x198d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x198d('0x9'));var _=require(_0x198d('0xa'));var squel=require(_0x198d('0xb'));var crypto=require(_0x198d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x198d('0xd'));var Papa=require(_0x198d('0xe'));var Redis=require('ioredis');var authService=require(_0x198d('0xf'));var qs=require(_0x198d('0x10'));var as=require(_0x198d('0x11'));var hardwareService=require(_0x198d('0x12'));var logger=require(_0x198d('0x13'))(_0x198d('0x14'));var utils=require(_0x198d('0x15'));var config=require(_0x198d('0x16'));var licenseUtil=require(_0x198d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2284,_0x582e88){_0x582e88=_0x582e88||0xcc;return function(_0x27ced2){if(_0x27ced2){return _0x1c2284['sendStatus'](_0x582e88);}return _0x1c2284['status'](_0x582e88)['end']();};}function respondWithResult(_0x16b365,_0x1fda2c){_0x1fda2c=_0x1fda2c||0xc8;return function(_0x11ffda){if(_0x11ffda){return _0x16b365[_0x198d('0x18')](_0x1fda2c)[_0x198d('0x19')](_0x11ffda);}};}function respondWithFilteredResult(_0x45d28f,_0x53d27c){return function(_0x377def){if(_0x377def){var _0x17414b=typeof _0x53d27c[_0x198d('0x1a')]===_0x198d('0x1b')&&typeof _0x53d27c['limit']==='undefined';var _0x93fb6d=_0x377def['count'];var _0x535889=_0x17414b?0x0:_0x53d27c['offset'];var _0x9170c8=_0x17414b?_0x377def['count']:_0x53d27c['offset']+_0x53d27c['limit'];var _0x1a8fd9;if(_0x9170c8>=_0x93fb6d){_0x9170c8=_0x93fb6d;_0x1a8fd9=0xc8;}else{_0x1a8fd9=0xce;}_0x45d28f['status'](_0x1a8fd9);return _0x45d28f[_0x198d('0x1c')]('Content-Range',_0x535889+'-'+_0x9170c8+'/'+_0x93fb6d)['json'](_0x377def);}return null;};}function patchUpdates(_0x55e911){return function(_0x1cffd2){try{jsonpatch[_0x198d('0x1d')](_0x1cffd2,_0x55e911,!![]);}catch(_0x2ded1f){return BPromise[_0x198d('0x1e')](_0x2ded1f);}return _0x1cffd2[_0x198d('0x1f')]();};}function saveUpdates(_0x38d0ab,_0x1f657c){return function(_0x1e82b2){if(_0x1e82b2){return _0x1e82b2[_0x198d('0x20')](_0x38d0ab)[_0x198d('0x21')](function(_0x2a7d3d){return _0x2a7d3d;});}return null;};}function removeEntity(_0x270bd6,_0xb0c309){return function(_0x1bf976){if(_0x1bf976){return _0x1bf976[_0x198d('0x22')]()[_0x198d('0x21')](function(){_0x270bd6['status'](0xcc)[_0x198d('0x23')]();});}};}function handleEntityNotFound(_0x207137,_0xb505fd){return function(_0x48320e){if(!_0x48320e){_0x207137[_0x198d('0x24')](0x194);}return _0x48320e;};}function handleError(_0x386897,_0x45fc61){_0x45fc61=_0x45fc61||0x1f4;return function(_0x4513cc){logger[_0x198d('0x25')](_0x4513cc[_0x198d('0x26')]);if(_0x4513cc[_0x198d('0x27')]){delete _0x4513cc[_0x198d('0x27')];}_0x386897['status'](_0x45fc61)[_0x198d('0x28')](_0x4513cc);};}exports[_0x198d('0x29')]=function(_0x3a36fe,_0x1fc533){var _0x39e859={},_0x61e503={},_0x2f7cad={'count':0x0,'rows':[]};var _0x37df31=_['map'](db[_0x198d('0x2a')][_0x198d('0x2b')],function(_0x37c1f2){return{'name':_0x37c1f2['fieldName'],'type':_0x37c1f2[_0x198d('0x2c')][_0x198d('0x2d')]};});_0x61e503[_0x198d('0x2e')]=_[_0x198d('0x2f')](_0x37df31,_0x198d('0x27'));_0x61e503[_0x198d('0x30')]=_[_0x198d('0x31')](_0x3a36fe['query']);_0x61e503[_0x198d('0x32')]=_[_0x198d('0x33')](_0x61e503[_0x198d('0x2e')],_0x61e503[_0x198d('0x30')]);_0x39e859[_0x198d('0x34')]=_[_0x198d('0x33')](_0x61e503[_0x198d('0x2e')],qs['fields'](_0x3a36fe['query']['fields']));_0x39e859['attributes']=_0x39e859[_0x198d('0x34')][_0x198d('0x35')]?_0x39e859[_0x198d('0x34')]:_0x61e503[_0x198d('0x2e')];if(!_0x3a36fe[_0x198d('0x30')][_0x198d('0x36')]('nolimit')){_0x39e859[_0x198d('0x37')]=qs[_0x198d('0x37')](_0x3a36fe[_0x198d('0x30')][_0x198d('0x37')]);_0x39e859[_0x198d('0x1a')]=qs[_0x198d('0x1a')](_0x3a36fe['query'][_0x198d('0x1a')]);}_0x39e859[_0x198d('0x38')]=qs[_0x198d('0x39')](_0x3a36fe[_0x198d('0x30')][_0x198d('0x39')]);_0x39e859[_0x198d('0x3a')]=qs[_0x198d('0x32')](_['pick'](_0x3a36fe[_0x198d('0x30')],_0x61e503[_0x198d('0x32')]),_0x37df31);if(_0x3a36fe[_0x198d('0x30')][_0x198d('0x3b')]){_0x39e859['where']=_['merge'](_0x39e859[_0x198d('0x3a')],{'$or':_[_0x198d('0x2f')](_0x37df31,function(_0x40716c){if(_0x40716c[_0x198d('0x2c')]!==_0x198d('0x3c')){var _0x5b1c46={};_0x5b1c46[_0x40716c['name']]={'$like':'%'+_0x3a36fe[_0x198d('0x30')][_0x198d('0x3b')]+'%'};return _0x5b1c46;}})});}_0x39e859=_[_0x198d('0x3d')]({},_0x39e859,_0x3a36fe['options']);var _0x54d232={'where':_0x39e859['where']};return db[_0x198d('0x2a')][_0x198d('0x3e')](_0x54d232)[_0x198d('0x21')](function(_0x32924c){_0x2f7cad[_0x198d('0x3e')]=_0x32924c;if(_0x3a36fe[_0x198d('0x30')]['includeAll']){_0x39e859[_0x198d('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x198d('0x40')](_0x39e859);})['then'](function(_0x2e760f){_0x2f7cad[_0x198d('0x41')]=_0x2e760f;return _0x2f7cad;})['then'](respondWithFilteredResult(_0x1fc533,_0x39e859))[_0x198d('0x42')](handleError(_0x1fc533,null));};exports[_0x198d('0x43')]=function(_0x5cbeb8,_0x5f17cc){var _0x477b8a={'raw':!![],'where':{'id':_0x5cbeb8[_0x198d('0x44')]['id']}},_0x39e17d={};_0x39e17d[_0x198d('0x2e')]=_['keys'](db[_0x198d('0x2a')][_0x198d('0x2b')]);_0x39e17d['query']=_[_0x198d('0x31')](_0x5cbeb8['query']);_0x39e17d[_0x198d('0x32')]=_[_0x198d('0x33')](_0x39e17d['model'],_0x39e17d[_0x198d('0x30')]);_0x477b8a[_0x198d('0x34')]=_[_0x198d('0x33')](_0x39e17d[_0x198d('0x2e')],qs[_0x198d('0x45')](_0x5cbeb8[_0x198d('0x30')][_0x198d('0x45')]));_0x477b8a['attributes']=_0x477b8a[_0x198d('0x34')][_0x198d('0x35')]?_0x477b8a[_0x198d('0x34')]:_0x39e17d[_0x198d('0x2e')];if(_0x5cbeb8[_0x198d('0x30')][_0x198d('0x46')]){_0x477b8a['include']=[{'all':!![]}];}_0x477b8a=_[_0x198d('0x3d')]({},_0x477b8a,_0x5cbeb8[_0x198d('0x47')]);return db['WhatsappTransferReport'][_0x198d('0x48')](_0x477b8a)[_0x198d('0x21')](handleEntityNotFound(_0x5f17cc,null))[_0x198d('0x21')](respondWithResult(_0x5f17cc,null))[_0x198d('0x42')](handleError(_0x5f17cc,null));};exports[_0x198d('0x49')]=function(_0x12e131,_0x482bb9){return db['WhatsappTransferReport'][_0x198d('0x49')](_0x12e131['body'],{})[_0x198d('0x21')](respondWithResult(_0x482bb9,0xc9))['catch'](handleError(_0x482bb9,null));};exports[_0x198d('0x20')]=function(_0x521742,_0x18402a){if(_0x521742[_0x198d('0x4a')]['id']){delete _0x521742['body']['id'];}return db['WhatsappTransferReport'][_0x198d('0x48')]({'where':{'id':_0x521742[_0x198d('0x44')]['id']}})[_0x198d('0x21')](handleEntityNotFound(_0x18402a,null))[_0x198d('0x21')](saveUpdates(_0x521742['body'],null))[_0x198d('0x21')](respondWithResult(_0x18402a,null))['catch'](handleError(_0x18402a,null));};exports['destroy']=function(_0x286b9c,_0x470135){return db[_0x198d('0x2a')][_0x198d('0x48')]({'where':{'id':_0x286b9c['params']['id']}})[_0x198d('0x21')](handleEntityNotFound(_0x470135,null))[_0x198d('0x21')](removeEntity(_0x470135,null))[_0x198d('0x42')](handleError(_0x470135,null));};exports[_0x198d('0x4b')]=function(_0x366ac4,_0x182471){return db[_0x198d('0x2a')][_0x198d('0x4b')]()['then'](respondWithResult(_0x182471,null))[_0x198d('0x42')](handleError(_0x182471,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3f31443..f806998 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54e4=['exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x282301,_0x3589ca){var _0x58096b=function(_0xe9d02c){while(--_0xe9d02c){_0x282301['push'](_0x282301['shift']());}};_0x58096b(++_0x3589ca);}(_0x54e4,0x1b4));var _0x454e=function(_0x768ddd,_0x5951b6){_0x768ddd=_0x768ddd-0x0;var _0xb45a99=_0x54e4[_0x768ddd];return _0xb45a99;};'use strict';var _=require(_0x454e('0x0'));var util=require(_0x454e('0x1'));var logger=require(_0x454e('0x2'))(_0x454e('0x3'));var moment=require(_0x454e('0x4'));var BPromise=require(_0x454e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x454e('0x6'));var config=require(_0x454e('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x454e('0x8')]=function(_0x3d7282,_0x8ef163){return _0x3d7282[_0x454e('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x454e('0xa'),'paranoid':![],'indexes':[{'name':_0x454e('0xb'),'fields':[_0x454e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1001=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5969ea,_0x14095d){var _0x39a51a=function(_0xc46a1e){while(--_0xc46a1e){_0x5969ea['push'](_0x5969ea['shift']());}};_0x39a51a(++_0x14095d);}(_0x1001,0x16b));var _0x1100=function(_0x46208f,_0xc8371a){_0x46208f=_0x46208f-0x0;var _0x3e4a45=_0x1001[_0x46208f];return _0x3e4a45;};'use strict';var _=require(_0x1100('0x0'));var util=require('util');var logger=require(_0x1100('0x1'))(_0x1100('0x2'));var moment=require('moment');var BPromise=require(_0x1100('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1100('0x4'));var rimraf=require(_0x1100('0x5'));var config=require(_0x1100('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x1100('0x7')]=function(_0x4e04cb,_0x1f9df1){return _0x4e04cb[_0x1100('0x8')](_0x1100('0x9'),attributes,{'tableName':_0x1100('0xa'),'paranoid':![],'indexes':[{'name':_0x1100('0xb'),'fields':[_0x1100('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 7b25434..664f490 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5253=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','message','result','catch','WhatsappTransferReport,\x20%s,\x20%s','lodash','util'];(function(_0x59a513,_0x7cc7){var _0x50d94d=function(_0x5b1f20){while(--_0x5b1f20){_0x59a513['push'](_0x59a513['shift']());}};_0x50d94d(++_0x7cc7);}(_0x5253,0xfb));var _0x3525=function(_0x23af4d,_0x5f345b){_0x23af4d=_0x23af4d-0x0;var _0x1fffa9=_0x5253[_0x23af4d];return _0x1fffa9;};'use strict';var _=require(_0x3525('0x0'));var util=require(_0x3525('0x1'));var moment=require(_0x3525('0x2'));var BPromise=require('bluebird');var rs=require(_0x3525('0x3'));var fs=require('fs');var Redis=require(_0x3525('0x4'));var db=require(_0x3525('0x5'))['db'];var utils=require(_0x3525('0x6'));var logger=require(_0x3525('0x7'))(_0x3525('0x8'));var config=require(_0x3525('0x9'));var jayson=require(_0x3525('0xa'));var client=jayson['client'][_0x3525('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4096c4,_0x2aa2d8,_0x303489){return new BPromise(function(_0x940140,_0x26bb19){return client[_0x3525('0xc')](_0x4096c4,_0x303489)[_0x3525('0xd')](function(_0x215f32){logger[_0x3525('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2aa2d8,_0x3525('0xf'));logger[_0x3525('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2aa2d8,_0x3525('0xf'),JSON[_0x3525('0x11')](_0x215f32));if(_0x215f32[_0x3525('0x12')]){if(_0x215f32[_0x3525('0x12')]['code']===0x1f4){logger[_0x3525('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2aa2d8,_0x215f32['error']['message']);return _0x26bb19(_0x215f32[_0x3525('0x12')][_0x3525('0x13')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x2aa2d8,_0x215f32[_0x3525('0x12')][_0x3525('0x13')]);return _0x940140(_0x215f32[_0x3525('0x12')][_0x3525('0x13')]);}else{logger[_0x3525('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2aa2d8,_0x3525('0xf'));_0x940140(_0x215f32[_0x3525('0x14')][_0x3525('0x13')]);}})[_0x3525('0x15')](function(_0x291ac6){logger[_0x3525('0x12')](_0x3525('0x16'),_0x2aa2d8,_0x291ac6);_0x26bb19(_0x291ac6);});});} \ No newline at end of file +var _0x2fae=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x531c13,_0x2c9dbb){var _0x2f6a9d=function(_0x37c6ec){while(--_0x37c6ec){_0x531c13['push'](_0x531c13['shift']());}};_0x2f6a9d(++_0x2c9dbb);}(_0x2fae,0x88));var _0xe2fa=function(_0x26bebe,_0x97e3c7){_0x26bebe=_0x26bebe-0x0;var _0x4f8edb=_0x2fae[_0x26bebe];return _0x4f8edb;};'use strict';var _=require('lodash');var util=require(_0xe2fa('0x0'));var moment=require(_0xe2fa('0x1'));var BPromise=require(_0xe2fa('0x2'));var rs=require(_0xe2fa('0x3'));var fs=require('fs');var Redis=require(_0xe2fa('0x4'));var db=require(_0xe2fa('0x5'))['db'];var utils=require(_0xe2fa('0x6'));var logger=require('../../config/logger')(_0xe2fa('0x7'));var config=require('../../config/environment');var jayson=require(_0xe2fa('0x8'));var client=jayson[_0xe2fa('0x9')][_0xe2fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd97736,_0x5c38df,_0x3ae3cf){return new BPromise(function(_0x5d7cd6,_0x3fb98b){return client[_0xe2fa('0xb')](_0xd97736,_0x3ae3cf)['then'](function(_0x127171){logger[_0xe2fa('0xc')](_0xe2fa('0xd'),_0x5c38df,_0xe2fa('0xe'));logger[_0xe2fa('0xf')](_0xe2fa('0x10'),_0x5c38df,'request\x20sent',JSON[_0xe2fa('0x11')](_0x127171));if(_0x127171[_0xe2fa('0x12')]){if(_0x127171['error']['code']===0x1f4){logger[_0xe2fa('0x12')](_0xe2fa('0xd'),_0x5c38df,_0x127171[_0xe2fa('0x12')][_0xe2fa('0x13')]);return _0x3fb98b(_0x127171[_0xe2fa('0x12')][_0xe2fa('0x13')]);}logger[_0xe2fa('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c38df,_0x127171['error']['message']);return _0x5d7cd6(_0x127171['error'][_0xe2fa('0x13')]);}else{logger[_0xe2fa('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c38df,_0xe2fa('0xe'));_0x5d7cd6(_0x127171[_0xe2fa('0x14')][_0xe2fa('0x13')]);}})[_0xe2fa('0x15')](function(_0x3aa763){logger[_0xe2fa('0x12')](_0xe2fa('0xd'),_0x5c38df,_0x3aa763);_0x3fb98b(_0x3aa763);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index f1acda3..6ad26e8 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3290=['info','start','Online\x20apps:','map','filter','name','join','online','None','seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3290,0xc4));var _0x0329=function(_0x3ef973,_0x1c7e7d){_0x3ef973=_0x3ef973-0x0;var _0x43ecc3=_0x3290[_0x3ef973];return _0x43ecc3;};'use strict';var _=require('lodash');var mysqldb=require(_0x0329('0x0'));var rpc=require(_0x0329('0x1'));var config=require(_0x0329('0x2'));var logger=require(_0x0329('0x3'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x0329('0x4'));var schedule=require(_0x0329('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x0329('0x6'));var transcribe=require(_0x0329('0x7'));function main(){return mysqldb['db'][_0x0329('0x8')][_0x0329('0x9')]()[_0x0329('0xa')](function(){return rpc[_0x0329('0xb')]();})['then'](function(_0x11cf6e){logger[_0x0329('0xc')](_0x11cf6e);return chat[_0x0329('0xd')]();})[_0x0329('0xa')](function(){return whatsapp[_0x0329('0xd')]();})[_0x0329('0xa')](function(){return schedule[_0x0329('0xd')]();})['then'](function(){return transcribe[_0x0329('0xd')]();})[_0x0329('0xa')](function(_0x12a9a){logger['info'](_0x12a9a);return pm2[_0x0329('0xd')](pm2Config);})[_0x0329('0xa')](function(_0x44c92d){logger['info'](_0x0329('0xe'),_[_0x0329('0xf')](_[_0x0329('0x10')](_0x44c92d,{'status':'online'}),_0x0329('0x11'))[_0x0329('0x12')]());logger['info']('Offline\x20apps:',_[_0x0329('0xf')](_[_0x0329('0x10')](_0x44c92d,function(_0x164934){return _0x164934['status']!==_0x0329('0x13');}),'name')[_0x0329('0x12')]()||_0x0329('0x14'));config[_0x0329('0x15')]&&require('./config/seedDB')[_0x0329('0x16')]();require('./config/license')[_0x0329('0x16')]();})['catch'](function(_0x467bb3){logger[_0x0329('0x17')](_0x0329('0x18'),_0x467bb3);process[_0x0329('0x19')](0x1);});}main(); \ No newline at end of file +var _0xf7c1=['lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','info','start','then','Online\x20apps:','map','filter','name','Offline\x20apps:','status','online','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x5c619e,_0xd5d312){var _0x4e4572=function(_0x467172){while(--_0x467172){_0x5c619e['push'](_0x5c619e['shift']());}};_0x4e4572(++_0xd5d312);}(_0xf7c1,0xf8));var _0x1f7c=function(_0x3614d5,_0xbdd503){_0x3614d5=_0x3614d5-0x0;var _0x2ad3a8=_0xf7c1[_0x3614d5];return _0x2ad3a8;};'use strict';var _=require(_0x1f7c('0x0'));var mysqldb=require(_0x1f7c('0x1'));var rpc=require('./rpc');var config=require(_0x1f7c('0x2'));var logger=require(_0x1f7c('0x3'))(_0x1f7c('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x1f7c('0x5'));var schedule=require(_0x1f7c('0x6'));var chat=require(_0x1f7c('0x7'));var whatsapp=require(_0x1f7c('0x8'));var transcribe=require(_0x1f7c('0x9'));function main(){return mysqldb['db']['sequelize'][_0x1f7c('0xa')]()['then'](function(){return rpc['listen']();})['then'](function(_0x244864){logger[_0x1f7c('0xb')](_0x244864);return chat[_0x1f7c('0xc')]();})['then'](function(){return whatsapp[_0x1f7c('0xc')]();})[_0x1f7c('0xd')](function(){return schedule[_0x1f7c('0xc')]();})['then'](function(){return transcribe[_0x1f7c('0xc')]();})[_0x1f7c('0xd')](function(_0x4a2c95){logger[_0x1f7c('0xb')](_0x4a2c95);return pm2[_0x1f7c('0xc')](pm2Config);})[_0x1f7c('0xd')](function(_0x2267d9){logger[_0x1f7c('0xb')](_0x1f7c('0xe'),_[_0x1f7c('0xf')](_[_0x1f7c('0x10')](_0x2267d9,{'status':'online'}),_0x1f7c('0x11'))['join']());logger[_0x1f7c('0xb')](_0x1f7c('0x12'),_[_0x1f7c('0xf')](_[_0x1f7c('0x10')](_0x2267d9,function(_0x17a5b8){return _0x17a5b8[_0x1f7c('0x13')]!==_0x1f7c('0x14');}),'name')[_0x1f7c('0x15')]()||_0x1f7c('0x16'));config[_0x1f7c('0x17')]&&require(_0x1f7c('0x18'))[_0x1f7c('0x19')]();require(_0x1f7c('0x1a'))[_0x1f7c('0x19')]();})[_0x1f7c('0x1b')](function(_0x411ab7){logger[_0x1f7c('0x1c')](_0x1f7c('0x1d'),_0x411ab7);process[_0x1f7c('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 0180529..f046932 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6940=['Bearer','Unknown\x20authorization\x20format','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','role','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','length','splice','unshift','encryptString','join','sign','secret','payload','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','secrets','session','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','status','unmanaged','Forbidden.','catch','authorization','startsWith','headers','User','find','then','authenticate','pass','json','Wrong\x20credentials.'];(function(_0x4d82fa,_0x3cb5b3){var _0x2ee038=function(_0xa25927){while(--_0xa25927){_0x4d82fa['push'](_0x4d82fa['shift']());}};_0x2ee038(++_0x3cb5b3);}(_0x6940,0x141));var _0x0694=function(_0x132f7a,_0x85458e){_0x132f7a=_0x132f7a-0x0;var _0x110ec4=_0x6940[_0x132f7a];return _0x110ec4;};'use strict';var db=require(_0x0694('0x0'))['db'];var config=require(_0x0694('0x1'));var hardwareConf=require(_0x0694('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x0694('0x3'));var jwt=require(_0x0694('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x0694('0x5'));var basicAuth=require(_0x0694('0x6'));var crypto=require(_0x0694('0x7'));var BPromise=require(_0x0694('0x8'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x0694('0x9')][_0x0694('0xa')]});var userAttributes=['id','role',_0x0694('0xb'),_0x0694('0xc'),_0x0694('0xd'),_0x0694('0xe'),_0x0694('0xf'),_0x0694('0x10'),_0x0694('0x11'),_0x0694('0x12'),_0x0694('0x13'),_0x0694('0x14'),_0x0694('0x15'),_0x0694('0x16'),_0x0694('0x17'),_0x0694('0x18'),'showWebBar',_0x0694('0x19'),'lastPauseAt',_0x0694('0x1a'),_0x0694('0x1b'),_0x0694('0x1c'),'alias',_0x0694('0x1d'),_0x0694('0x1e'),_0x0694('0x1f'),'phoneBarEnableRecording',_0x0694('0x20'),_0x0694('0x21'),_0x0694('0x22'),_0x0694('0x23'),_0x0694('0x24'),_0x0694('0x25'),_0x0694('0x26'),_0x0694('0x27'),_0x0694('0x28'),_0x0694('0x29'),_0x0694('0x2a'),_0x0694('0x2b'),_0x0694('0x2c'),'downloadOmnichannelInteractions',_0x0694('0x2d'),_0x0694('0x2e'),_0x0694('0x2f')];exports[_0x0694('0x30')]=function(){return this[_0x0694('0x31')](!![])[_0x0694('0x32')](function(_0x3b93f2,_0x5ef2ed,_0x7adecf){if(_0x3b93f2[_0x0694('0x33')]){_0x7adecf();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x3b93f2[_0x0694('0x34')]['id']},'attributes':['id',_0x0694('0x35'),_0x0694('0x36')],'raw':!![]})['then'](function(_0x10fec8){if(_0x10fec8&&_0x10fec8[_0x0694('0x35')]){return _0x5ef2ed[_0x0694('0x37')](_0x10fec8[_0x0694('0x36')]==='unmanaged'?0x195:0x193)['json']({'message':_0x10fec8[_0x0694('0x36')]===_0x0694('0x38')?'Unmanaged.':_0x0694('0x39')});}else{_0x7adecf();}})[_0x0694('0x3a')](function(_0x52c10c){_0x7adecf(_0x52c10c);});}});};exports[_0x0694('0x31')]=function isAuthenticated(_0x2b675a){return compose()[_0x0694('0x32')](function(_0x545496,_0x1f3872,_0x75f497){var _0x3e8574;if(_0x545496['headers'][_0x0694('0x3b')]){if(_[_0x0694('0x3c')](_0x545496[_0x0694('0x3d')][_0x0694('0x3b')],'Basic')){var _0x26cc1d=basicAuth(_0x545496);db[_0x0694('0x3e')][_0x0694('0x3f')]({'where':{'name':_0x26cc1d[_0x0694('0xc')]}})[_0x0694('0x40')](function(_0x425019){if(!_0x425019||!_0x425019[_0x0694('0x41')](_0x26cc1d[_0x0694('0x42')])){return _0x1f3872[_0x0694('0x37')](0x191)[_0x0694('0x43')]({'message':_0x0694('0x44')});}_0x545496[_0x0694('0x33')]={'id':_0x425019['id']};_0x75f497();})['catch'](function(_0x42fb54){_0x75f497(_0x42fb54);});}else if(_['startsWith'](_0x545496['headers']['authorization'],_0x0694('0x45'))){validateJwt(_0x545496,_0x1f3872,_0x75f497);}else{if(_0x2b675a){_0x75f497();}else{return _0x1f3872[_0x0694('0x37')](0x193)[_0x0694('0x43')]({'message':_0x0694('0x46')});}}}else if(_0x545496['query'][_0x0694('0x47')]){try{var _0x4669e8={'audience':hardwareConf[_0x0694('0x48')](),'issuer':hardwareConf[_0x0694('0x48')]()};verifyJwt(_0x545496['query'][_0x0694('0x47')],_0x4669e8)[_0x0694('0x40')](function(_0x76376d){return db[_0x0694('0x3e')][_0x0694('0x3f')]({'where':{'id':_0x76376d[_0x0694('0x49')]}})[_0x0694('0x40')](function(_0x222c0c){_0x3e8574=_0x222c0c;return db[_0x0694('0x4a')][_0x0694('0x4b')]({'where':{'id':0x1},'attributes':[_0x0694('0x4c'),_0x0694('0x4d')],'raw':!![]});})[_0x0694('0x40')](function(_0x482951){if(!_0x3e8574||!_[_0x0694('0x4e')](_0x3e8574['apiKeyNonce'],_0x76376d[_0x0694('0x4f')])){return _0x1f3872[_0x0694('0x37')](0x191)['json']({'message':_0x0694('0x50')});}if(_0x3e8574['disabled']){return _0x1f3872[_0x0694('0x37')](0x191)[_0x0694('0x43')]({'message':_0x0694('0x51')});}if(_0x3e8574[_0x0694('0x52')]){if(_0x482951[_0x0694('0x4d')]>0x0){if(moment(_0x3e8574[_0x0694('0x53')])[_0x0694('0x54')](_0x482951[_0x0694('0x4d')],_0x0694('0x55'))>moment()){return _0x1f3872[_0x0694('0x37')](0x191)[_0x0694('0x43')]({'message':_0x0694('0x51')});}}else{return _0x1f3872[_0x0694('0x37')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x545496['user']={'id':_0x3e8574['id']};_0x75f497();});})[_0x0694('0x3a')](function(){return _0x1f3872['status'](0x191)[_0x0694('0x43')]({'message':_0x0694('0x51')});});}catch(_0xc57926){_0x75f497(_0xc57926);}}else if(_0x2b675a){_0x75f497();}else{return _0x1f3872[_0x0694('0x37')](0x193)['json']({'message':_0x0694('0x46')});}})[_0x0694('0x32')](function(_0x2da208,_0x3731a2,_0x1af656){if(_0x2da208[_0x0694('0x33')]){db['User'][_0x0694('0x3f')]({'where':{'id':_0x2da208[_0x0694('0x33')]['id']},'attributes':userAttributes})[_0x0694('0x40')](function(_0x22003f){if(!_0x22003f){return _0x3731a2[_0x0694('0x37')](0x194)[_0x0694('0x43')]({'message':_0x0694('0x56')});}_0x2da208[_0x0694('0x33')]=_0x22003f;_0x1af656();})[_0x0694('0x3a')](function(_0x186c3c){_0x1af656(_0x186c3c);});}else if(_0x2b675a){_0x1af656();}else{return _0x3731a2[_0x0694('0x37')](0x194)[_0x0694('0x43')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x0694('0x57')]=function canUpdate(){return compose()['use'](function(_0xf0ccd2,_0x115a4c,_0x320a3c){return licenseUtil[_0x0694('0x58')]()['then'](function(_0x44dfad){if(_0x44dfad[_0x0694('0x59')]){_0x320a3c();}else{return _0x115a4c[_0x0694('0x37')](0x193)[_0x0694('0x43')]({'message':'Forbidden'});}})[_0x0694('0x3a')](function(_0xdfb1d9){_0x320a3c(_0xdfb1d9);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x0694('0x32')](function(_0x33b455,_0x126f0c,_0x584427){return licenseUtil[_0x0694('0x58')]()[_0x0694('0x40')](function(_0xc06cf3){if(_0xc06cf3['webrtc']){_0x584427();}else{return _0x126f0c[_0x0694('0x37')](0x193)['json']({'message':_0x0694('0x5a')});}})[_0x0694('0x3a')](function(_0x163d37){_0x584427(_0x163d37);});});};exports[_0x0694('0x5b')]=function(_0x29fcee,_0x309c6a,_0x3bc80f){_0x29fcee['isMiddleware']=!![];return _0x3bc80f();};exports['signToken']=function signToken(_0x6e8e01){return signJwt(_0x6e8e01);};exports[_0x0694('0x5c')]=function(_0x2cea1b,_0x3c5df6){if(!_0x2cea1b[_0x0694('0x33')]){return _0x3c5df6[_0x0694('0x37')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4c04f4={'payload':{'id':_0x2cea1b['user']['id'],'role':_0x2cea1b['user'][_0x0694('0x5d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4c04f4)[_0x0694('0x40')](function(_0x1fc811){_0x3c5df6[_0x0694('0x5e')](_0x0694('0x5f'),_0x1fc811);_0x3c5df6['redirect'](_0x0694('0x60'));})['catch'](function(_0x37cec5){return _0x3c5df6[_0x0694('0x37')](0x1f4)[_0x0694('0x61')](_0x37cec5);});};exports[_0x0694('0x62')]=function(_0x1150a9){if(_[_0x0694('0x63')](_0x1150a9[_0x0694('0x64')])||_[_0x0694('0x63')](_0x1150a9[_0x0694('0x65')])){return null;}else{return createJwt(_0x1150a9);}};exports[_0x0694('0x66')]=function(_0x2b13a0){_0x2b13a0['apiKeyNonce']=generateNonce();_0x2b13a0[_0x0694('0x65')]=generateIssuedAt();return createJwt(_0x2b13a0);};exports[_0x0694('0x67')]=function(_0x317da4,_0x564231){var _0x40ed9e=_0x317da4[_0x0694('0x68')][_0x0694('0x47')];if(_0x40ed9e){var _0x38b27a={'nonce':_0x564231[_0x0694('0x64')],'iat':_0x564231[_0x0694('0x65')],'audience':hardwareConf[_0x0694('0x48')](),'issuer':hardwareConf[_0x0694('0x48')]()};return verifyJwt(_0x40ed9e,_0x38b27a)['then'](function(){return generateApiKey(_0x564231);});}else{throw{'message':_0x0694('0x69')};}};exports['validatePasswordPattern']=function(_0x2c9a66){var _0x11635a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x11635a[_0x0694('0x6a')](_0x2c9a66))throw new db['Sequelize'][(_0x0694('0x6b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5395e5,_0x4190af,_0x46124e){var _0x568c20=encryptor[_0x0694('0x6c')](_0x4190af)[_0x0694('0x6d')](',');for(var _0x3935c6=0x0;_0x3935c6<_0x46124e;_0x3935c6++){if(!_0x568c20[_0x3935c6])break;if(_0x5395e5[_0x0694('0x6e')]()===_0x568c20[_0x3935c6][_0x0694('0x6e')]()){var _0x27a6e8=util[_0x0694('0x6f')](_0x0694('0x70'),_0x46124e);if(_0x46124e===0x1){_0x27a6e8=_0x0694('0x71');}throw new db[(_0x0694('0x72'))][(_0x0694('0x6b'))](_0x27a6e8);}}return;};exports['updatePasswordsHistory']=function(_0x31fe65,_0x327981){var _0x4a7af8=_0x327981?encryptor[_0x0694('0x6c')](_0x327981)['split'](','):[];if(_0x4a7af8[_0x0694('0x73')]===0x5){_0x4a7af8[_0x0694('0x74')](-0x1,0x1);}_0x4a7af8[_0x0694('0x75')](_0x31fe65);return encryptor[_0x0694('0x76')](_0x4a7af8[_0x0694('0x77')](','));};function signJwt(_0x430b6e){var _0x3afde=BPromise['promisify'](jwt[_0x0694('0x78')],{'context':jwt});var _0x69c6ba=_0x430b6e[_0x0694('0x79')]||config[_0x0694('0x9')][_0x0694('0xa')];return new BPromise(function(_0x2b39b8,_0x3f2038){_0x3afde(_0x430b6e[_0x0694('0x7a')],_0x69c6ba,_0x430b6e['options'])[_0x0694('0x40')](function(_0x5c0c38){_0x2b39b8(_0x5c0c38);})[_0x0694('0x3a')](function(_0x3e3b87){_0x3f2038(_0x3e3b87);});});}function verifyJwt(_0x5f0e05,_0x4bcc65,_0xf15d25){var _0x27bfe7=BPromise['promisify'](jwt[_0x0694('0x7b')],{'context':jwt});var _0x3d5ca8=_0xf15d25||config[_0x0694('0x9')]['session'];return new BPromise(function(_0x250db5,_0x119fe6){_0x27bfe7(_0x5f0e05,_0x3d5ca8,_0x4bcc65)[_0x0694('0x40')](function(_0x45bef5){_0x250db5(_0x45bef5);})[_0x0694('0x3a')](function(_0x78b581){_0x119fe6(_0x78b581);});});}function generateNonce(){return crypto[_0x0694('0x7c')](0x10)[_0x0694('0x7d')](_0x0694('0x7e'));}function generateIssuedAt(){return Math[_0x0694('0x7f')](Date[_0x0694('0x80')]()/0x3e8)[_0x0694('0x7d')]();}function createJwt(_0x56f95b){var _0x39de9d={'payload':{'iat':_0x56f95b[_0x0694('0x65')],'nonce':_0x56f95b[_0x0694('0x64')]},'options':{'algorithm':_0x0694('0x81'),'subject':_0x56f95b['id'][_0x0694('0x7d')](),'issuer':hardwareConf[_0x0694('0x48')](),'audience':hardwareConf[_0x0694('0x48')]()}};return signJwt(_0x39de9d)[_0x0694('0x40')](function(_0xb2abe0){return{'iat':_0x56f95b['apiKeyIat'],'nonce':_0x56f95b['apiKeyNonce'],'token':_0xb2abe0};});} \ No newline at end of file +var _0xe839=['test','Sequelize','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','moment','secrets','session','role','name','internal','email','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','use','authorization','startsWith','User','authenticate','pass','Wrong\x20credentials.','headers','Unknown\x20authorization\x20format','query','getUuid','apikey','find','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern'];(function(_0x5f4717,_0x1b4290){var _0x576c24=function(_0x328eba){while(--_0x328eba){_0x5f4717['push'](_0x5f4717['shift']());}};_0x576c24(++_0x1b4290);}(_0xe839,0x1a5));var _0x9e83=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xe839[_0x817d9b];return _0x2752e1;};'use strict';var db=require(_0x9e83('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x9e83('0x1'));var licenseUtil=require(_0x9e83('0x2'));var encryptor=require(_0x9e83('0x3'));var _=require(_0x9e83('0x4'));var jwt=require(_0x9e83('0x5'));var expressJwt=require(_0x9e83('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x9e83('0x7'));var BPromise=require(_0x9e83('0x8'));var util=require(_0x9e83('0x9'));var moment=require(_0x9e83('0xa'));var validateJwt=expressJwt({'secret':config[_0x9e83('0xb')][_0x9e83('0xc')]});var userAttributes=['id',_0x9e83('0xd'),'fullname',_0x9e83('0xe'),_0x9e83('0xf'),_0x9e83('0x10'),'userpic',_0x9e83('0x11'),'md5secret',_0x9e83('0x12'),_0x9e83('0x13'),_0x9e83('0x14'),_0x9e83('0x15'),_0x9e83('0x16'),_0x9e83('0x17'),_0x9e83('0x18'),_0x9e83('0x19'),'lastLoginAt',_0x9e83('0x1a'),'crudPermissions',_0x9e83('0x1b'),'passwordResetAt',_0x9e83('0x1c'),_0x9e83('0x1d'),_0x9e83('0x1e'),_0x9e83('0x1f'),_0x9e83('0x20'),'phoneBarEnableDtmfTone',_0x9e83('0x21'),_0x9e83('0x22'),_0x9e83('0x23'),_0x9e83('0x24'),_0x9e83('0x25'),_0x9e83('0x26'),_0x9e83('0x27'),_0x9e83('0x28'),_0x9e83('0x29'),_0x9e83('0x2a'),_0x9e83('0x2b'),_0x9e83('0x2c'),_0x9e83('0x2d'),_0x9e83('0x2e'),'ignorePauseForPreviewCalls',_0x9e83('0x2f')];exports[_0x9e83('0x30')]=function(){return this[_0x9e83('0x31')](!![])['use'](function(_0x30137b,_0xb2dca3,_0x4ff071){if(_0x30137b[_0x9e83('0x32')]){_0x4ff071();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x30137b[_0x9e83('0x33')]['id']},'attributes':['id',_0x9e83('0x34'),_0x9e83('0x35')],'raw':!![]})[_0x9e83('0x36')](function(_0x3d852d){if(_0x3d852d&&_0x3d852d['closed']){return _0xb2dca3[_0x9e83('0x37')](_0x3d852d[_0x9e83('0x35')]===_0x9e83('0x38')?0x195:0x193)[_0x9e83('0x39')]({'message':_0x3d852d[_0x9e83('0x35')]===_0x9e83('0x38')?'Unmanaged.':_0x9e83('0x3a')});}else{_0x4ff071();}})[_0x9e83('0x3b')](function(_0x177bd3){_0x4ff071(_0x177bd3);});}});};exports[_0x9e83('0x31')]=function isAuthenticated(_0x387796){return compose()[_0x9e83('0x3c')](function(_0x3ad63e,_0x3531e1,_0x54e2c2){var _0x660848;if(_0x3ad63e['headers'][_0x9e83('0x3d')]){if(_[_0x9e83('0x3e')](_0x3ad63e['headers'][_0x9e83('0x3d')],'Basic')){var _0x958671=basicAuth(_0x3ad63e);db[_0x9e83('0x3f')]['find']({'where':{'name':_0x958671[_0x9e83('0xe')]}})[_0x9e83('0x36')](function(_0x224b45){if(!_0x224b45||!_0x224b45[_0x9e83('0x40')](_0x958671[_0x9e83('0x41')])){return _0x3531e1[_0x9e83('0x37')](0x191)[_0x9e83('0x39')]({'message':_0x9e83('0x42')});}_0x3ad63e[_0x9e83('0x32')]={'id':_0x224b45['id']};_0x54e2c2();})[_0x9e83('0x3b')](function(_0x2f30f1){_0x54e2c2(_0x2f30f1);});}else if(_[_0x9e83('0x3e')](_0x3ad63e[_0x9e83('0x43')]['authorization'],'Bearer')){validateJwt(_0x3ad63e,_0x3531e1,_0x54e2c2);}else{if(_0x387796){_0x54e2c2();}else{return _0x3531e1[_0x9e83('0x37')](0x193)['json']({'message':_0x9e83('0x44')});}}}else if(_0x3ad63e[_0x9e83('0x45')]['apikey']){try{var _0x590e8d={'audience':hardwareConf[_0x9e83('0x46')](),'issuer':hardwareConf[_0x9e83('0x46')]()};verifyJwt(_0x3ad63e[_0x9e83('0x45')][_0x9e83('0x47')],_0x590e8d)[_0x9e83('0x36')](function(_0x30715f){return db[_0x9e83('0x3f')][_0x9e83('0x48')]({'where':{'id':_0x30715f[_0x9e83('0x49')]}})[_0x9e83('0x36')](function(_0x3bff18){_0x660848=_0x3bff18;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x9e83('0x4a'),_0x9e83('0x4b')],'raw':!![]});})[_0x9e83('0x36')](function(_0x4ea0c5){if(!_0x660848||!_[_0x9e83('0x4c')](_0x660848[_0x9e83('0x4d')],_0x30715f[_0x9e83('0x4e')])){return _0x3531e1[_0x9e83('0x37')](0x191)[_0x9e83('0x39')]({'message':_0x9e83('0x4f')});}if(_0x660848['disabled']){return _0x3531e1[_0x9e83('0x37')](0x191)['json']({'message':_0x9e83('0x50')});}if(_0x660848['blocked']){if(_0x4ea0c5[_0x9e83('0x4b')]>0x0){if(moment(_0x660848[_0x9e83('0x51')])[_0x9e83('0x52')](_0x4ea0c5[_0x9e83('0x4b')],_0x9e83('0x53'))>moment()){return _0x3531e1['status'](0x191)[_0x9e83('0x39')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3531e1['status'](0x191)[_0x9e83('0x39')]({'message':_0x9e83('0x50')});}}_0x3ad63e['user']={'id':_0x660848['id']};_0x54e2c2();});})[_0x9e83('0x3b')](function(){return _0x3531e1['status'](0x191)['json']({'message':_0x9e83('0x50')});});}catch(_0x143f66){_0x54e2c2(_0x143f66);}}else if(_0x387796){_0x54e2c2();}else{return _0x3531e1[_0x9e83('0x37')](0x193)[_0x9e83('0x39')]({'message':'Unknown\x20authorization\x20format'});}})[_0x9e83('0x3c')](function(_0x32878d,_0x5c7c3f,_0x5d1f5c){if(_0x32878d[_0x9e83('0x32')]){db[_0x9e83('0x3f')][_0x9e83('0x48')]({'where':{'id':_0x32878d['user']['id']},'attributes':userAttributes})[_0x9e83('0x36')](function(_0x2e705a){if(!_0x2e705a){return _0x5c7c3f['status'](0x194)['json']({'message':_0x9e83('0x54')});}_0x32878d[_0x9e83('0x32')]=_0x2e705a;_0x5d1f5c();})[_0x9e83('0x3b')](function(_0x3726a7){_0x5d1f5c(_0x3726a7);});}else if(_0x387796){_0x5d1f5c();}else{return _0x5c7c3f['status'](0x194)['json']({'message':_0x9e83('0x55')});}});};exports[_0x9e83('0x56')]=function canUpdate(){return compose()[_0x9e83('0x3c')](function(_0x21550c,_0x375cb8,_0x1e359c){return licenseUtil[_0x9e83('0x57')]()['then'](function(_0x59165c){if(_0x59165c[_0x9e83('0x58')]){_0x1e359c();}else{return _0x375cb8['status'](0x193)[_0x9e83('0x39')]({'message':_0x9e83('0x59')});}})[_0x9e83('0x3b')](function(_0x2bdd93){_0x1e359c(_0x2bdd93);});});};exports[_0x9e83('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0xa3f12c,_0x5db507,_0xb3e76b){return licenseUtil['getLicense']()[_0x9e83('0x36')](function(_0x14f3d3){if(_0x14f3d3[_0x9e83('0x5b')]){_0xb3e76b();}else{return _0x5db507[_0x9e83('0x37')](0x193)['json']({'message':_0x9e83('0x59')});}})[_0x9e83('0x3b')](function(_0x1c5611){_0xb3e76b(_0x1c5611);});});};exports[_0x9e83('0x5c')]=function(_0x283fc8,_0x562635,_0x13715b){_0x283fc8[_0x9e83('0x5c')]=!![];return _0x13715b();};exports[_0x9e83('0x5d')]=function signToken(_0x430271){return signJwt(_0x430271);};exports[_0x9e83('0x5e')]=function(_0x3f26b5,_0x29657e){if(!_0x3f26b5[_0x9e83('0x32')]){return _0x29657e[_0x9e83('0x37')](0x194)[_0x9e83('0x39')]({'message':_0x9e83('0x5f')});}var _0xc673f8={'payload':{'id':_0x3f26b5[_0x9e83('0x32')]['id'],'role':_0x3f26b5[_0x9e83('0x32')][_0x9e83('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0xc673f8)[_0x9e83('0x36')](function(_0x3c1d08){_0x29657e[_0x9e83('0x60')](_0x9e83('0x61'),_0x3c1d08);_0x29657e[_0x9e83('0x62')](_0x9e83('0x63'));})[_0x9e83('0x3b')](function(_0x4f55df){return _0x29657e[_0x9e83('0x37')](0x1f4)[_0x9e83('0x64')](_0x4f55df);});};exports[_0x9e83('0x65')]=function(_0x5e80c8){if(_[_0x9e83('0x66')](_0x5e80c8['apiKeyNonce'])||_['isNil'](_0x5e80c8['apiKeyIat'])){return null;}else{return createJwt(_0x5e80c8);}};exports['generateApiKey']=function(_0x1bbeea){_0x1bbeea[_0x9e83('0x4d')]=generateNonce();_0x1bbeea[_0x9e83('0x67')]=generateIssuedAt();return createJwt(_0x1bbeea);};exports[_0x9e83('0x68')]=function(_0x50c26f,_0x4013e4){var _0x3f3d44=_0x50c26f['query'][_0x9e83('0x47')];if(_0x3f3d44){var _0x5888b6={'nonce':_0x4013e4[_0x9e83('0x4d')],'iat':_0x4013e4[_0x9e83('0x67')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x9e83('0x46')]()};return verifyJwt(_0x3f3d44,_0x5888b6)[_0x9e83('0x36')](function(){return generateApiKey(_0x4013e4);});}else{throw{'message':_0x9e83('0x69')};}};exports[_0x9e83('0x6a')]=function(_0x17ae20){var _0x7e84a6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x7e84a6[_0x9e83('0x6b')](_0x17ae20))throw new db[(_0x9e83('0x6c'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x9e83('0x6d')]=function(_0x10b75f,_0x598126,_0xc9bca){var _0x362787=encryptor[_0x9e83('0x6e')](_0x598126)[_0x9e83('0x6f')](',');for(var _0x16bb8a=0x0;_0x16bb8a<_0xc9bca;_0x16bb8a++){if(!_0x362787[_0x16bb8a])break;if(_0x10b75f[_0x9e83('0x70')]()===_0x362787[_0x16bb8a][_0x9e83('0x70')]()){var _0x31eed8=util[_0x9e83('0x71')](_0x9e83('0x72'),_0xc9bca);if(_0xc9bca===0x1){_0x31eed8='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x9e83('0x73'))](_0x31eed8);}}return;};exports['updatePasswordsHistory']=function(_0x155b41,_0xd016da){var _0x9270ef=_0xd016da?encryptor[_0x9e83('0x6e')](_0xd016da)[_0x9e83('0x6f')](','):[];if(_0x9270ef[_0x9e83('0x74')]===0x5){_0x9270ef[_0x9e83('0x75')](-0x1,0x1);}_0x9270ef[_0x9e83('0x76')](_0x155b41);return encryptor[_0x9e83('0x77')](_0x9270ef[_0x9e83('0x78')](','));};function signJwt(_0x19e0d0){var _0x289818=BPromise[_0x9e83('0x79')](jwt[_0x9e83('0x7a')],{'context':jwt});var _0x2023ae=_0x19e0d0[_0x9e83('0x7b')]||config[_0x9e83('0xb')][_0x9e83('0xc')];return new BPromise(function(_0x3b6ef0,_0x3edd4e){_0x289818(_0x19e0d0[_0x9e83('0x7c')],_0x2023ae,_0x19e0d0[_0x9e83('0x7d')])['then'](function(_0x186702){_0x3b6ef0(_0x186702);})[_0x9e83('0x3b')](function(_0x4d3280){_0x3edd4e(_0x4d3280);});});}function verifyJwt(_0x4f35bd,_0x394d13,_0x5ef99c){var _0x488619=BPromise[_0x9e83('0x79')](jwt['verify'],{'context':jwt});var _0x1923ee=_0x5ef99c||config[_0x9e83('0xb')]['session'];return new BPromise(function(_0x404afc,_0x1453c4){_0x488619(_0x4f35bd,_0x1923ee,_0x394d13)[_0x9e83('0x36')](function(_0x5ce537){_0x404afc(_0x5ce537);})[_0x9e83('0x3b')](function(_0x2f10aa){_0x1453c4(_0x2f10aa);});});}function generateNonce(){return crypto[_0x9e83('0x7e')](0x10)[_0x9e83('0x7f')](_0x9e83('0x80'));}function generateIssuedAt(){return Math[_0x9e83('0x81')](Date[_0x9e83('0x82')]()/0x3e8)[_0x9e83('0x7f')]();}function createJwt(_0x2317ec){var _0x48d9d9={'payload':{'iat':_0x2317ec[_0x9e83('0x67')],'nonce':_0x2317ec[_0x9e83('0x4d')]},'options':{'algorithm':_0x9e83('0x83'),'subject':_0x2317ec['id'][_0x9e83('0x7f')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x48d9d9)['then'](function(_0x262358){return{'iat':_0x2317ec[_0x9e83('0x67')],'nonce':_0x2317ec[_0x9e83('0x4d')],'token':_0x262358};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index a13efb8..5dfe460 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1a2=['encryptFile','createWriteStream','createCipher','data','binary','write','end','final','close','unlink','createReadStream','createDecipher','update','encryptString','base64','decryptString','secret','utf8','crypto','bluebird','app','secrets','session','aes-256-ctr','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xe1a2,0xcc));var _0x2e1a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xe1a2[_0x4792c8];return _0x35edb1;};'use strict';var crypto=require(_0x2e1a('0x0'));var fs=require('fs');var BPromise=require(_0x2e1a('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x2e1a('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2e1a('0x3')][_0x2e1a('0x4')],'algorithm':_0x2e1a('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x2e1a('0x6')]&&config['encrypt'][_0x2e1a('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x2e1a('0x7')]);if(isSupported){fileOptions[_0x2e1a('0x7')]=config[_0x2e1a('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x2e1a('0x6')][_0x2e1a('0x7')],_0x2e1a('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x553f58){return AES_SUPPORTED_RX[_0x2e1a('0x9')](_0x553f58);}function getSupportedCiphers(){return crypto[_0x2e1a('0xa')]()[_0x2e1a('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x20cce0){return getSupportedCiphers()[_0x2e1a('0xc')](_0x20cce0)>-0x1;}function combineOptions(_0x414dd1){var _0x54a75a={};for(var _0x302be3 in fileOptions){if(fileOptions['hasOwnProperty'](_0x302be3)){_0x54a75a[_0x302be3]=fileOptions[_0x302be3];}}if(_0x414dd1){for(var _0x266f81 in _0x414dd1){if(_0x414dd1['hasOwnProperty'](_0x266f81)){_0x54a75a[_0x266f81]=_0x414dd1[_0x266f81];}}}return _0x54a75a;}exports[_0x2e1a('0xd')]=function(_0x17db3b,_0x55be4d,_0x9dd5fc,_0x1b6c1b){return new BPromise(function(_0x29b387,_0x63f823){_0x1b6c1b=combineOptions(_0x1b6c1b);var _0x59f937=new Buffer(_0x9dd5fc);var _0x426786=fs['createReadStream'](_0x17db3b);var _0x52d75d=fs[_0x2e1a('0xe')](_0x55be4d);var _0x283ce=crypto[_0x2e1a('0xf')](_0x1b6c1b[_0x2e1a('0x7')],_0x59f937);_0x426786['on'](_0x2e1a('0x10'),function(_0x50d56c){var _0x3dd4d3=new Buffer(_0x283ce['update'](_0x50d56c),_0x2e1a('0x11'));_0x52d75d[_0x2e1a('0x12')](_0x3dd4d3);});_0x426786['on'](_0x2e1a('0x13'),function(){try{var _0x3c2e1d=new Buffer(_0x283ce[_0x2e1a('0x14')]('binary'),_0x2e1a('0x11'));_0x52d75d['write'](_0x3c2e1d);_0x52d75d[_0x2e1a('0x13')]();_0x52d75d['on'](_0x2e1a('0x15'),function(){return _0x29b387(_0x55be4d);});}catch(_0x446bab){fs[_0x2e1a('0x16')](_0x55be4d);return _0x63f823(_0x446bab);}});});};exports['decryptFile']=function(_0x3a6767,_0x1896ef,_0x38be4b,_0x2ca692){return new BPromise(function(_0x2a2985,_0x499654){_0x2ca692=combineOptions(_0x2ca692);var _0x45640e=new Buffer(_0x38be4b);var _0x3f3ab8=fs[_0x2e1a('0x17')](_0x3a6767);var _0x583d55=fs[_0x2e1a('0xe')](_0x1896ef);var _0x23d250=crypto[_0x2e1a('0x18')](_0x2ca692[_0x2e1a('0x7')],_0x45640e);_0x3f3ab8['on'](_0x2e1a('0x10'),function(_0x2e0df3){var _0x238f6f=new Buffer(_0x23d250[_0x2e1a('0x19')](_0x2e0df3),_0x2e1a('0x11'));_0x583d55[_0x2e1a('0x12')](_0x238f6f);});_0x3f3ab8['on'](_0x2e1a('0x13'),function(){try{var _0x3dd002=new Buffer(_0x23d250['final']('binary'),'binary');_0x583d55[_0x2e1a('0x12')](_0x3dd002);_0x583d55['end']();_0x583d55['on'](_0x2e1a('0x15'),function(){return _0x2a2985(_0x1896ef);});}catch(_0x3cfc8e){fs['unlink'](_0x1896ef);return _0x499654(_0x3cfc8e);}});});};exports[_0x2e1a('0x1a')]=function(_0x982686,_0x5d9429,_0x5ace9d){var _0x204a6e=_0x5ace9d||stringOptions[_0x2e1a('0x7')];var _0x250320=_0x5d9429||stringOptions['secret'];var _0x47d8fc=crypto['createCipher'](_0x204a6e,_0x250320);var _0x39cce9=_0x47d8fc['update'](_0x982686,'utf8',_0x2e1a('0x1b'));_0x39cce9+=_0x47d8fc[_0x2e1a('0x14')](_0x2e1a('0x1b'));return _0x39cce9;};exports[_0x2e1a('0x1c')]=function(_0xf07abb,_0x3c6718,_0x4ed585){var _0x4e3f9b=_0x4ed585||stringOptions[_0x2e1a('0x7')];var _0x597114=_0x3c6718||stringOptions[_0x2e1a('0x1d')];var _0x3dd9e2=crypto['createDecipher'](_0x4e3f9b,_0x597114);var _0x26a971=_0x3dd9e2[_0x2e1a('0x19')](_0xf07abb,_0x2e1a('0x1b'),_0x2e1a('0x1e'));_0x26a971+=_0x3dd9e2[_0x2e1a('0x14')](_0x2e1a('0x1e'));return _0x26a971;}; \ No newline at end of file +var _0x218c=['final','unlink','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','encrypt','algorithm','join','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','write','end','binary','close','decryptFile','createWriteStream'];(function(_0x215fea,_0x2969a7){var _0x37e114=function(_0x48d974){while(--_0x48d974){_0x215fea['push'](_0x215fea['shift']());}};_0x37e114(++_0x2969a7);}(_0x218c,0x92));var _0xc218=function(_0x55c76f,_0x13b7f4){_0x55c76f=_0x55c76f-0x0;var _0x1571ff=_0x218c[_0x55c76f];return _0x1571ff;};'use strict';var crypto=require(_0xc218('0x0'));var fs=require('fs');var BPromise=require(_0xc218('0x1'));var _=require(_0xc218('0x2'));var config=require(_0xc218('0x3'));var logger=require('../../config/logger')(_0xc218('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc218('0x5')]['session'],'algorithm':_0xc218('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xc218('0x7')]&&config['encrypt'][_0xc218('0x8')]){var isSupported=isAlgorithmSupported(config[_0xc218('0x7')][_0xc218('0x8')]);if(isSupported){fileOptions[_0xc218('0x8')]=config[_0xc218('0x7')][_0xc218('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc218('0x9')](',\x20');logger['error'](config['encrypt'][_0xc218('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4dd07f){return AES_SUPPORTED_RX['test'](_0x4dd07f);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x326f23){return getSupportedCiphers()[_0xc218('0xa')](_0x326f23)>-0x1;}function combineOptions(_0x5a72d7){var _0x271c08={};for(var _0x20440d in fileOptions){if(fileOptions[_0xc218('0xb')](_0x20440d)){_0x271c08[_0x20440d]=fileOptions[_0x20440d];}}if(_0x5a72d7){for(var _0x461843 in _0x5a72d7){if(_0x5a72d7['hasOwnProperty'](_0x461843)){_0x271c08[_0x461843]=_0x5a72d7[_0x461843];}}}return _0x271c08;}exports['encryptFile']=function(_0x544eef,_0x2345c6,_0x3bd062,_0x5622d6){return new BPromise(function(_0x1b4bc1,_0x17b5b7){_0x5622d6=combineOptions(_0x5622d6);var _0x188bd3=new Buffer(_0x3bd062);var _0x56ffc9=fs[_0xc218('0xc')](_0x544eef);var _0x7a5431=fs['createWriteStream'](_0x2345c6);var _0x44f23c=crypto[_0xc218('0xd')](_0x5622d6[_0xc218('0x8')],_0x188bd3);_0x56ffc9['on'](_0xc218('0xe'),function(_0x1e01ad){var _0x2e4962=new Buffer(_0x44f23c[_0xc218('0xf')](_0x1e01ad),'binary');_0x7a5431[_0xc218('0x10')](_0x2e4962);});_0x56ffc9['on'](_0xc218('0x11'),function(){try{var _0x30144c=new Buffer(_0x44f23c['final'](_0xc218('0x12')),_0xc218('0x12'));_0x7a5431[_0xc218('0x10')](_0x30144c);_0x7a5431[_0xc218('0x11')]();_0x7a5431['on'](_0xc218('0x13'),function(){return _0x1b4bc1(_0x2345c6);});}catch(_0x46ab00){fs['unlink'](_0x2345c6);return _0x17b5b7(_0x46ab00);}});});};exports[_0xc218('0x14')]=function(_0x458797,_0x240bd7,_0x5ada2c,_0xe859b4){return new BPromise(function(_0x27b2c6,_0x445f15){_0xe859b4=combineOptions(_0xe859b4);var _0x3f0fc6=new Buffer(_0x5ada2c);var _0x5dc395=fs[_0xc218('0xc')](_0x458797);var _0x3e87d8=fs[_0xc218('0x15')](_0x240bd7);var _0x168088=crypto['createDecipher'](_0xe859b4[_0xc218('0x8')],_0x3f0fc6);_0x5dc395['on'](_0xc218('0xe'),function(_0x42b876){var _0x151694=new Buffer(_0x168088['update'](_0x42b876),_0xc218('0x12'));_0x3e87d8[_0xc218('0x10')](_0x151694);});_0x5dc395['on']('end',function(){try{var _0x24082f=new Buffer(_0x168088[_0xc218('0x16')](_0xc218('0x12')),_0xc218('0x12'));_0x3e87d8[_0xc218('0x10')](_0x24082f);_0x3e87d8[_0xc218('0x11')]();_0x3e87d8['on'](_0xc218('0x13'),function(){return _0x27b2c6(_0x240bd7);});}catch(_0x197548){fs[_0xc218('0x17')](_0x240bd7);return _0x445f15(_0x197548);}});});};exports[_0xc218('0x18')]=function(_0x236d20,_0x169dbf,_0x276017){var _0x95b758=_0x276017||stringOptions[_0xc218('0x8')];var _0x3db6af=_0x169dbf||stringOptions[_0xc218('0x19')];var _0x502e5e=crypto[_0xc218('0xd')](_0x95b758,_0x3db6af);var _0x41b91=_0x502e5e[_0xc218('0xf')](_0x236d20,_0xc218('0x1a'),'base64');_0x41b91+=_0x502e5e[_0xc218('0x16')](_0xc218('0x1b'));return _0x41b91;};exports['decryptString']=function(_0x42235a,_0x302b2d,_0x4993d4){var _0x1228b1=_0x4993d4||stringOptions[_0xc218('0x8')];var _0x504505=_0x302b2d||stringOptions[_0xc218('0x19')];var _0x1a99b8=crypto['createDecipher'](_0x1228b1,_0x504505);var _0x164c79=_0x1a99b8['update'](_0x42235a,_0xc218('0x1b'),_0xc218('0x1a'));_0x164c79+=_0x1a99b8[_0xc218('0x16')](_0xc218('0x1a'));return _0x164c79;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index aeb6681..320a94a 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36c0=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize'];(function(_0x45345b,_0x30959f){var _0x45866f=function(_0x15762d){while(--_0x15762d){_0x45345b['push'](_0x45345b['shift']());}};_0x45866f(++_0x30959f);}(_0x36c0,0x184));var _0x036c=function(_0x5ce1f4,_0x3d4d52){_0x5ce1f4=_0x5ce1f4-0x0;var _0x3cf822=_0x36c0[_0x5ce1f4];return _0x3cf822;};'use strict';var util=require(_0x036c('0x0'));var path=require('path');var _=require(_0x036c('0x1'));var csv=require(_0x036c('0x2'));var fs=require('fs');var BPromise=require(_0x036c('0x3'));var zipdir=require(_0x036c('0x4'));var rimraf=require(_0x036c('0x5'));var db=require(_0x036c('0x6'))['db'];var dbH=require(_0x036c('0x6'))[_0x036c('0x7')];var logger=require(_0x036c('0x8'))(_0x036c('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x036c('0xa')][0x2]);var QUERY=process[_0x036c('0xa')][0x3];var PATH=process[_0x036c('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x56280c,_0x517d54){var _0xc189a5={'status':_0x56280c};var _0x3d1bd0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x517d54){_0xc189a5[_0x036c('0xb')]=_0x517d54;}return db['AnalyticExtractedReport']['update'](_0xc189a5,_0x3d1bd0);}function main(){var _0xac0751=0x1388;var _0x25ab57;logger[_0x036c('0xc')](util[_0x036c('0xd')](_0x036c('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x036c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x036c('0x10'),_0x036c('0x11')]})[_0x036c('0x12')](function(_0x21cb7e){if(_0x21cb7e){_0x25ab57=_0x21cb7e;_0xac0751=_0x25ab57['splitSizeCsv']||0x1388;}})[_0x036c('0x12')](function(){return dbH[_0x036c('0x13')]['query'](util[_0x036c('0xd')](_0x036c('0x14'),QUERY),{'type':dbH[_0x036c('0x13')][_0x036c('0x15')][_0x036c('0x16')]});})[_0x036c('0x12')](function(_0x20a25f){if(!_0x20a25f[0x0]['num']){return analyticExtractedReport(_0x036c('0x17'));}var _0x35a292=[];var _0x3e092f=0x0;if(_0x25ab57[_0x036c('0x10')]){if(_0x20a25f&&_0x20a25f[_0x036c('0x18')]){var _0x3cfd91=_[_0x036c('0x19')](_0x20a25f[0x0][_0x036c('0x1a')]/_0xac0751);var _0x1d5884=Number[_0x036c('0x1b')](_0x20a25f[0x0][_0x036c('0x1a')]/_0xac0751)?_0x20a25f[0x0][_0x036c('0x1a')]%_0xac0751:0x0;_0x3cfd91[_0x036c('0x1c')](function(_0x4172ea){if(_0x4172ea>0x0){_0x3e092f+=_0xac0751;}_0x35a292[_0x036c('0x1d')](dbH['sequelize'][_0x036c('0x1e')](util['format'](_0x036c('0x1f'),QUERY,_0xac0751,_0x3e092f),{'type':dbH['sequelize'][_0x036c('0x15')][_0x036c('0x16')]}));});if(_0x1d5884>0x0){_0x3e092f+=_0xac0751;_0x35a292[_0x036c('0x1d')](dbH['sequelize'][_0x036c('0x1e')](util['format'](_0x036c('0x1f'),QUERY,_0x1d5884,_0x3e092f),{'type':dbH[_0x036c('0x13')][_0x036c('0x15')][_0x036c('0x16')]}));}}}else{_0x35a292[_0x036c('0x1d')](dbH[_0x036c('0x13')][_0x036c('0x1e')](QUERY,{'type':dbH['sequelize'][_0x036c('0x15')][_0x036c('0x16')]}));}var _0x18cc78=path[_0x036c('0x20')](PATH);var _0x1ee0cd=path[_0x036c('0x21')](PATH,_0x036c('0x22'));var _0x31cf62=_0x25ab57[_0x036c('0x10')]&&_0x35a292['length']>0x1;var _0x45293a=[];if(!fs[_0x036c('0x23')](path[_0x036c('0x24')](_0x18cc78,_0x1ee0cd))&&_0x31cf62){fs['mkdirSync'](path[_0x036c('0x24')](_0x18cc78,_0x1ee0cd));}return BPromise[_0x036c('0x25')](_0x35a292,function(_0x418dc6){_0x45293a['push'](_0x418dc6);})[_0x036c('0x12')](function(){for(var _0xaefef3=0x0;_0xaefef3<_0x45293a[_0x036c('0x18')];_0xaefef3+=0x1){var _0x5d05d8;var _0x630ccc=_0x45293a[_0xaefef3];if(_0x31cf62){_0x5d05d8=path[_0x036c('0x24')](_0x18cc78,_0x1ee0cd,util[_0x036c('0xd')]('%s%d.%s',_0x1ee0cd,_0xaefef3,_0x036c('0x26')));}else{_0x5d05d8=path[_0x036c('0x24')](_0x18cc78,util[_0x036c('0xd')](_0x036c('0x27'),_0x1ee0cd,_0x036c('0x26')));}fs[_0x036c('0x28')](_0x5d05d8,csv(_0x630ccc));}})['then'](function(){if(_0x31cf62){return new Promise(function(_0xfa844d){zipdir(path['join'](_0x18cc78,_0x1ee0cd),{'saveTo':path['join'](_0x18cc78,util[_0x036c('0xd')](_0x036c('0x27'),_0x1ee0cd,_0x036c('0x29')))},function(_0x2c40ff,_0x308b7d){rimraf(path[_0x036c('0x24')](_0x18cc78,_0x1ee0cd),function(){});_0xfa844d(_0x036c('0x2a'));});});}})[_0x036c('0x12')](function(){logger[_0x036c('0xc')](util[_0x036c('0xd')](_0x036c('0x2b'),EXTRACTED_REPORT_ID,_0x036c('0x2c')));return analyticExtractedReport('Completed',_0x31cf62?util[_0x036c('0xd')](_0x036c('0x27'),_0x1ee0cd,_0x31cf62?_0x036c('0x29'):_0x036c('0x26')):null);});})[_0x036c('0x2d')](function(_0x3be864){logger[_0x036c('0xc')](util[_0x036c('0xd')](_0x036c('0x2e'),EXTRACTED_REPORT_ID,_0x036c('0x2c')),util[_0x036c('0x2f')](_0x3be864,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x036c('0x30'));})[_0x036c('0x31')](function(){process[_0x036c('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1517=['sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','split','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x1517,0x8d));var _0x7151=function(_0x51e136,_0x4eecfd){_0x51e136=_0x51e136-0x0;var _0x52b4f3=_0x1517[_0x51e136];return _0x52b4f3;};'use strict';var util=require(_0x7151('0x0'));var path=require(_0x7151('0x1'));var _=require(_0x7151('0x2'));var csv=require(_0x7151('0x3'));var fs=require('fs');var BPromise=require(_0x7151('0x4'));var zipdir=require(_0x7151('0x5'));var rimraf=require(_0x7151('0x6'));var db=require(_0x7151('0x7'))['db'];var dbH=require(_0x7151('0x7'))[_0x7151('0x8')];var logger=require(_0x7151('0x9'))(_0x7151('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x7151('0xb')][0x2]);var QUERY=process[_0x7151('0xb')][0x3];var PATH=process[_0x7151('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4add96,_0x560470){var _0x3d56e4={'status':_0x4add96};var _0x3989d4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x560470){_0x3d56e4['savename']=_0x560470;}return db[_0x7151('0xc')][_0x7151('0xd')](_0x3d56e4,_0x3989d4);}function main(){var _0x460efc=0x1388;var _0x55258e;logger['info'](util[_0x7151('0xe')](_0x7151('0xf'),EXTRACTED_REPORT_ID,_0x7151('0x10')));return db[_0x7151('0x11')][_0x7151('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7151('0x13')]})['then'](function(_0x2c0f01){if(_0x2c0f01){_0x55258e=_0x2c0f01;_0x460efc=_0x55258e[_0x7151('0x13')]||0x1388;}})[_0x7151('0x14')](function(){return dbH[_0x7151('0x15')]['query'](util[_0x7151('0xe')](_0x7151('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x7151('0x14')](function(_0x401730){if(!_0x401730[0x0][_0x7151('0x17')]){return analyticExtractedReport(_0x7151('0x18'));}var _0xfe723c=[];var _0x11788a=0x0;if(_0x55258e[_0x7151('0x19')]){if(_0x401730&&_0x401730[_0x7151('0x1a')]){var _0x267aa9=_[_0x7151('0x1b')](_0x401730[0x0][_0x7151('0x17')]/_0x460efc);var _0x47d0a9=Number[_0x7151('0x1c')](_0x401730[0x0][_0x7151('0x17')]/_0x460efc)?_0x401730[0x0][_0x7151('0x17')]%_0x460efc:0x0;_0x267aa9[_0x7151('0x1d')](function(_0x2ff1ab){if(_0x2ff1ab>0x0){_0x11788a+=_0x460efc;}_0xfe723c[_0x7151('0x1e')](dbH[_0x7151('0x15')][_0x7151('0x1f')](util['format'](_0x7151('0x20'),QUERY,_0x460efc,_0x11788a),{'type':dbH['sequelize'][_0x7151('0x21')][_0x7151('0x22')]}));});if(_0x47d0a9>0x0){_0x11788a+=_0x460efc;_0xfe723c[_0x7151('0x1e')](dbH[_0x7151('0x15')][_0x7151('0x1f')](util[_0x7151('0xe')](_0x7151('0x20'),QUERY,_0x47d0a9,_0x11788a),{'type':dbH[_0x7151('0x15')][_0x7151('0x21')][_0x7151('0x22')]}));}}}else{_0xfe723c[_0x7151('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x7151('0x15')][_0x7151('0x21')][_0x7151('0x22')]}));}var _0x3e8d64=path[_0x7151('0x23')](PATH);var _0x2eae3d=path[_0x7151('0x24')](PATH,_0x7151('0x25'));var _0x41f1cc=_0x55258e[_0x7151('0x19')]&&_0xfe723c[_0x7151('0x1a')]>0x1;var _0x1f6d72=[];if(!fs[_0x7151('0x26')](path['join'](_0x3e8d64,_0x2eae3d))&&_0x41f1cc){fs['mkdirSync'](path[_0x7151('0x27')](_0x3e8d64,_0x2eae3d));}return BPromise[_0x7151('0x28')](_0xfe723c,function(_0x5ba854){_0x1f6d72['push'](_0x5ba854);})['then'](function(){for(var _0x16bce6=0x0;_0x16bce6<_0x1f6d72[_0x7151('0x1a')];_0x16bce6+=0x1){var _0x1345f8;var _0x3de270=_0x1f6d72[_0x16bce6];if(_0x41f1cc){_0x1345f8=path[_0x7151('0x27')](_0x3e8d64,_0x2eae3d,util[_0x7151('0xe')](_0x7151('0x29'),_0x2eae3d,_0x16bce6,_0x7151('0x2a')));}else{_0x1345f8=path[_0x7151('0x27')](_0x3e8d64,util['format'](_0x7151('0x2b'),_0x2eae3d,_0x7151('0x2a')));}fs[_0x7151('0x2c')](_0x1345f8,csv(_0x3de270));}})[_0x7151('0x14')](function(){if(_0x41f1cc){return new Promise(function(_0x107695){zipdir(path[_0x7151('0x27')](_0x3e8d64,_0x2eae3d),{'saveTo':path[_0x7151('0x27')](_0x3e8d64,util[_0x7151('0xe')](_0x7151('0x2b'),_0x2eae3d,_0x7151('0x2d')))},function(_0x4772fe,_0x4fdc79){rimraf(path['join'](_0x3e8d64,_0x2eae3d),function(){});_0x107695(_0x7151('0x2e'));});});}})[_0x7151('0x14')](function(){logger[_0x7151('0x2f')](util[_0x7151('0xe')](_0x7151('0x30'),EXTRACTED_REPORT_ID,_0x7151('0x10')));return analyticExtractedReport(_0x7151('0x31'),_0x41f1cc?util[_0x7151('0xe')](_0x7151('0x2b'),_0x2eae3d,_0x41f1cc?_0x7151('0x2d'):_0x7151('0x2a')):null);});})[_0x7151('0x32')](function(_0x5302ee){logger['info'](util[_0x7151('0xe')](_0x7151('0x33'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x5302ee,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7151('0x34')](function(){process[_0x7151('0x35')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c71abd8..0cf7d33 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf14a=['landscape','\x20/\x20','footer','Arial','black','right','num','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','query','SELECT','basename','split','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','util','path','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','fill','length','auto','body','push','concat','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','pageBreak','before'];(function(_0xf0e391,_0x5433d4){var _0x1c126d=function(_0x520c70){while(--_0x520c70){_0xf0e391['push'](_0xf0e391['shift']());}};_0x1c126d(++_0x5433d4);}(_0xf14a,0x137));var _0xaf14=function(_0xb176ce,_0x2e7888){_0xb176ce=_0xb176ce-0x0;var _0x36502a=_0xf14a[_0xb176ce];return _0x36502a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xaf14('0x0'));var path=require(_0xaf14('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xaf14('0x2'));var PdfPrinter=require(_0xaf14('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xaf14('0x4'));var JSDOM=require(_0xaf14('0x5'))[_0xaf14('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xaf14('0x7'));var db=require(_0xaf14('0x8'))['db'];var dbH=require('../../mysqldb')[_0xaf14('0x9')];var logger=require('../../config/logger')(_0xaf14('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xaf14('0xb')][0x3];var PATH=process[_0xaf14('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xaf14('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x318885,_0x328823){var _0x1f02d8={'status':_0x318885};var _0x311ce8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x328823){_0x1f02d8[_0xaf14('0xd')]=_0x328823;}return db['AnalyticExtractedReport'][_0xaf14('0xe')](_0x1f02d8,_0x311ce8);}function getHeaders(_0x2efc0a){return _[_0xaf14('0xf')](_0x2efc0a,function(_0x55c186){return{'text':_0x55c186,'style':'tableHeader'};});}function getRows(_0x22f7cb,_0x46a4b0){return _[_0xaf14('0xf')](_0x46a4b0,function(_0x374981){return _(_0x374981)[_0xaf14('0x10')](_0x22f7cb)[_0xaf14('0xf')](function(_0x4ea6ba){return _0x4ea6ba?_[_0xaf14('0x11')](_0x4ea6ba):'';})[_0xaf14('0x12')]();});}function createTable(_0x3cccef,_0x3e1814){var _0x4bef21={'widths':_[_0xaf14('0x13')](Array(_0x3cccef[_0xaf14('0x14')]),0x91),'heights':function(_0x28bac7){return _0x28bac7===0x0?_0xaf14('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x7d43a0=getHeaders(_0x3cccef);_0x4bef21[_0xaf14('0x16')][_0xaf14('0x17')](_0x7d43a0);var _0x1f788c=getRows(_0x3cccef,_0x3e1814);_0x4bef21[_0xaf14('0x16')]=_0x4bef21[_0xaf14('0x16')][_0xaf14('0x18')](_0x1f788c);return _0x4bef21;}function createTables(_0x24ff06){var _0x5bbda7=[];var _0x474c7e=_['chunk'](Object['keys'](_0x24ff06[0x0]),0x5);_0x474c7e[_0xaf14('0x19')](function(_0x419d79){_0x5bbda7[_0xaf14('0x17')](createTable(_0x419d79,_0x24ff06));});return _0x5bbda7;}function getPDFDocDefinition(_0x57bb95){var _0x555561=util['format'](_0xaf14('0x1a'),NAME,EXTRACTED_REPORT[_0xaf14('0x1b')],moment(EXTRACTED_REPORT[_0xaf14('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xaf14('0x1d')](FORMAT));var _0x19fdb4=[];for(var _0x34c5f3=0x0;_0x34c5f3<_0x57bb95[_0xaf14('0x14')];_0x34c5f3++){var _0x2ac188=[];if(_0x34c5f3===0x0){_0x2ac188[_0xaf14('0x17')]({'text':_0x555561,'style':_0xaf14('0x1e')});}var _0x3c5a74={'table':_0x57bb95[_0x34c5f3]};if(_0x34c5f3>0x0){_0x3c5a74[_0xaf14('0x1f')]=_0xaf14('0x20');_0x3c5a74['margin']=[0x0,0x46,0x0,0x0];}_0x2ac188['push'](_0x3c5a74);_0x19fdb4['push'](_0x2ac188);}return{'pageSize':'A4','pageOrientation':_0xaf14('0x21'),'content':_0x19fdb4,'footer':function(_0x31150c,_0xe71e45){return{'text':_0x31150c[_0xaf14('0x11')]()+_0xaf14('0x22')+_0xe71e45,'style':_0xaf14('0x23')};},'defaultStyle':{'font':_0xaf14('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xaf14('0x25')},'footer':{'alignment':_0xaf14('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x19d684){var _0x37bc4c=0x1388;var _0x454c2a;if(!_0x19d684[0x0][_0xaf14('0x27')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xaf14('0x28')]})[_0xaf14('0x29')](function(_0x2d32f4){if(_0x2d32f4){_0x454c2a=_0x2d32f4;_0x37bc4c=_0x454c2a[_0xaf14('0x28')]||0x3e8;}})[_0xaf14('0x29')](function(){var _0x4f9959=[];var _0x5e7f7c=0x0;if(_0x454c2a['split']){if(_0x19d684&&_0x19d684[_0xaf14('0x14')]){var _0xb42d18=_[_0xaf14('0x2a')](_0x19d684[0x0]['num']/_0x37bc4c);var _0x2c22af=Number[_0xaf14('0x2b')](_0x19d684[0x0][_0xaf14('0x27')]/_0x37bc4c)?_0x19d684[0x0][_0xaf14('0x27')]%_0x37bc4c:0x0;_0xb42d18[_0xaf14('0x19')](function(_0x5be034){if(_0x5be034>0x0){_0x5e7f7c+=_0x37bc4c;}_0x4f9959[_0xaf14('0x17')](dbH[_0xaf14('0x2c')]['query'](util[_0xaf14('0x1d')](_0xaf14('0x2d'),QUERY,_0x37bc4c,_0x5e7f7c),{'type':dbH[_0xaf14('0x2c')]['QueryTypes']['SELECT']}));});if(_0x2c22af>0x0){_0x5e7f7c+=_0x37bc4c;_0x4f9959['push'](dbH['sequelize'][_0xaf14('0x2e')](util[_0xaf14('0x1d')](_0xaf14('0x2d'),QUERY,_0x2c22af,_0x5e7f7c),{'type':dbH[_0xaf14('0x2c')]['QueryTypes']['SELECT']}));}}}else{_0x4f9959[_0xaf14('0x17')](dbH[_0xaf14('0x2c')][_0xaf14('0x2e')](QUERY,{'type':dbH[_0xaf14('0x2c')]['QueryTypes'][_0xaf14('0x2f')]}));}var _0x19c290=path['dirname'](PATH);var _0x436d7b=path[_0xaf14('0x30')](PATH,'.pdf');var _0x197ebe=_0x454c2a[_0xaf14('0x31')]&&_0x4f9959['length']>0x1;var _0x7f6bd1=[];if(!fs[_0xaf14('0x32')](path[_0xaf14('0x33')](_0x19c290,_0x436d7b))&&_0x197ebe){fs[_0xaf14('0x34')](path[_0xaf14('0x33')](_0x19c290,_0x436d7b));}return BPromise['each'](_0x4f9959,function(_0xe5523c){_0x7f6bd1[_0xaf14('0x17')](_0xe5523c);})[_0xaf14('0x29')](function(){var _0x3a62cc=[];for(var _0xf75b67=0x0;_0xf75b67<_0x7f6bd1['length'];_0xf75b67+=0x1){var _0xbe0826=_0x7f6bd1[_0xf75b67];var _0x327717=createTables(_[_0xaf14('0x35')](_0xbe0826));var _0x5ac080;var _0x37f5d8=getPDFDocDefinition(_0x327717);var _0x39b0b1=getPDFPrinter();var _0x27256b=_0x39b0b1[_0xaf14('0x36')](_0x37f5d8);if(_0x197ebe){_0x5ac080=path[_0xaf14('0x33')](_0x19c290,_0x436d7b,util[_0xaf14('0x1d')](_0xaf14('0x37'),_0x436d7b,_0xf75b67,_0xaf14('0x38')));}else{_0x5ac080=path[_0xaf14('0x33')](_0x19c290,util['format'](_0xaf14('0x39'),_0x436d7b,'pdf'));}_0x3a62cc[_0xaf14('0x17')](writePDFDocument(_0x27256b,_0x5ac080));}return Promise[_0xaf14('0x3a')](_0x3a62cc);})['then'](function(){if(_0x197ebe){return new Promise(function(_0x3cb0e6){zipdir(path['join'](_0x19c290,_0x436d7b),{'saveTo':path['join'](_0x19c290,util[_0xaf14('0x1d')](_0xaf14('0x39'),_0x436d7b,'zip'))},function(){rimraf(path[_0xaf14('0x33')](_0x19c290,_0x436d7b),function(){});_0x3cb0e6(_0xaf14('0x3b'));});});}})['then'](function(){if(!_0x197ebe)return;rimraf(path[_0xaf14('0x33')](_0x19c290,_0x436d7b),function(){});})['then'](function(){logger[_0xaf14('0x3c')](util[_0xaf14('0x1d')](_0xaf14('0x3d'),EXTRACTED_REPORT_ID,_0xaf14('0x3e')));return analyticExtractedReport(_0xaf14('0x3f'),_0x197ebe?util[_0xaf14('0x1d')]('%s.%s',_0x436d7b,_0x197ebe?'zip':_0xaf14('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xaf14('0x3c')](util[_0xaf14('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xaf14('0x3e')));return db[_0xaf14('0x40')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xaf14('0x29')](function(_0x8b7e6d){EXTRACTED_REPORT=_0x8b7e6d;return dbH[_0xaf14('0x2c')][_0xaf14('0x2e')](util[_0xaf14('0x1d')](_0xaf14('0x41'),QUERY),{'type':dbH[_0xaf14('0x2c')][_0xaf14('0x42')][_0xaf14('0x2f')]});})['then'](extractReport)[_0xaf14('0x43')](function(_0x771991){logger[_0xaf14('0x3c')](util[_0xaf14('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xaf14('0x3e')),util[_0xaf14('0x44')](_0x771991,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xaf14('0x45'));})[_0xaf14('0x46')](function(){process[_0xaf14('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x252f02=new PdfPrinter({'Arial':{'normal':__dirname+_0xaf14('0x48'),'bold':__dirname+_0xaf14('0x49'),'italics':__dirname+_0xaf14('0x4a'),'bolditalics':__dirname+_0xaf14('0x4b')}});return _0x252f02;}function getPDFDocDefinitionFromHTML(_0x1ce396,_0x55ef2e){var _0x283c0b=util['format']('%s\x20#%d',_0x55ef2e[_0xaf14('0x4c')],_0x55ef2e[_0xaf14('0x4d')]);var _0x20e731=moment()[_0xaf14('0x1d')](_0xaf14('0x4e'))['toString']();var _0x2c21fc=htmlToPdfmake(_0x1ce396,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2c21fc],'defaultStyle':{'font':_0xaf14('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xaf14('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xaf14('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xaf14('0x50'),'style':_0xaf14('0x1e')}];},'footer':function(_0x141578,_0x3e5133){return[{'text':util[_0xaf14('0x1d')](_0xaf14('0x51'),_0x283c0b,_0x141578,_0x3e5133,_0x20e731),'style':_0xaf14('0x23')}];}};}function writePDFDocument(_0xbda680,_0x563f39){return new Promise(function(_0x15cc14,_0x5c2a5f){var _0x31d24f=_0xbda680[_0xaf14('0x52')](fs[_0xaf14('0x53')](_0x563f39));_0x31d24f['on'](_0xaf14('0x54'),function(){_0x15cc14(_0xaf14('0x54'));});_0x31d24f['on'](_0xaf14('0x55'),function(_0x21adf7){_0x5c2a5f(_0x21adf7);});_0xbda680['end']();});}exports['createPdfFromHTML']=function(_0x413857,_0x1ccc62){var _0x5599de=getPDFPrinter();var _0x47800b=getPDFDocDefinitionFromHTML(_0x413857,_0x1ccc62);var _0x54c833=_0x5599de[_0xaf14('0x36')](_0x47800b);return writePDFDocument(_0x54c833,_0x1ccc62[_0xaf14('0x1')])[_0xaf14('0x43')](function(_0x260093){throw _0x260093;});}; \ No newline at end of file +var _0x99cd=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','auto','body','chunk','keys','forEach','push','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','black','right','num','Empty','find','splitSizePdf','then','split','range','isInteger','sequelize','query','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','length','flatten','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed'];(function(_0x29a3c0,_0x4acd84){var _0x5709fa=function(_0x25fb1e){while(--_0x25fb1e){_0x29a3c0['push'](_0x29a3c0['shift']());}};_0x5709fa(++_0x4acd84);}(_0x99cd,0xd1));var _0xd99c=function(_0xe6da3c,_0xd0da0d){_0xe6da3c=_0xe6da3c-0x0;var _0x14ad01=_0x99cd[_0xe6da3c];return _0x14ad01;};'use strict';var _=require(_0xd99c('0x0'));var fs=require('fs');var util=require(_0xd99c('0x1'));var path=require(_0xd99c('0x2'));var moment=require(_0xd99c('0x3'));var htmlToPdfmake=require(_0xd99c('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xd99c('0x5'));var rimraf=require(_0xd99c('0x6'));var JSDOM=require(_0xd99c('0x7'))[_0xd99c('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0xd99c('0x9'));var db=require(_0xd99c('0xa'))['db'];var dbH=require(_0xd99c('0xa'))['dbH'];var logger=require(_0xd99c('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd99c('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xd99c('0xc')][0x5];var FORMAT=_0xd99c('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x14ff8b,_0x5d5633){var _0x52558b={'status':_0x14ff8b};var _0x87bde4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d5633){_0x52558b[_0xd99c('0xe')]=_0x5d5633;}return db[_0xd99c('0xf')][_0xd99c('0x10')](_0x52558b,_0x87bde4);}function getHeaders(_0x2279b7){return _[_0xd99c('0x11')](_0x2279b7,function(_0x5a1ffb){return{'text':_0x5a1ffb,'style':_0xd99c('0x12')};});}function getRows(_0x2023ab,_0x5edd81){return _[_0xd99c('0x11')](_0x5edd81,function(_0x1b33d2){return _(_0x1b33d2)[_0xd99c('0x13')](_0x2023ab)['map'](function(_0x4ab2fe){return _0x4ab2fe?_['toString'](_0x4ab2fe):'';})[_0xd99c('0x14')]();});}function createTable(_0x35b413,_0x377339){var _0x42eb86={'widths':_['fill'](Array(_0x35b413['length']),0x91),'heights':function(_0x4e9594){return _0x4e9594===0x0?_0xd99c('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x22490f=getHeaders(_0x35b413);_0x42eb86[_0xd99c('0x16')]['push'](_0x22490f);var _0x5b7628=getRows(_0x35b413,_0x377339);_0x42eb86[_0xd99c('0x16')]=_0x42eb86[_0xd99c('0x16')]['concat'](_0x5b7628);return _0x42eb86;}function createTables(_0x4f51ca){var _0x4ac88f=[];var _0x4e219e=_[_0xd99c('0x17')](Object[_0xd99c('0x18')](_0x4f51ca[0x0]),0x5);_0x4e219e[_0xd99c('0x19')](function(_0x5c5964){_0x4ac88f[_0xd99c('0x1a')](createTable(_0x5c5964,_0x4f51ca));});return _0x4ac88f;}function getPDFDocDefinition(_0x3d82d1){var _0x2c1d6a=util[_0xd99c('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xd99c('0x1c')],moment(EXTRACTED_REPORT[_0xd99c('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xd99c('0x1e')])['format'](FORMAT));var _0x27176f=[];for(var _0x39c623=0x0;_0x39c623<_0x3d82d1['length'];_0x39c623++){var _0x1185f8=[];if(_0x39c623===0x0){_0x1185f8['push']({'text':_0x2c1d6a,'style':_0xd99c('0x1f')});}var _0x6e88={'table':_0x3d82d1[_0x39c623]};if(_0x39c623>0x0){_0x6e88[_0xd99c('0x20')]=_0xd99c('0x21');_0x6e88[_0xd99c('0x22')]=[0x0,0x46,0x0,0x0];}_0x1185f8[_0xd99c('0x1a')](_0x6e88);_0x27176f['push'](_0x1185f8);}return{'pageSize':'A4','pageOrientation':_0xd99c('0x23'),'content':_0x27176f,'footer':function(_0x33b889,_0x2db001){return{'text':_0x33b889[_0xd99c('0x24')]()+_0xd99c('0x25')+_0x2db001,'style':_0xd99c('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd99c('0x27')},'footer':{'alignment':_0xd99c('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d4b36){var _0x20684e=0x1388;var _0x5fa8fc;if(!_0x3d4b36[0x0][_0xd99c('0x29')]){return analyticExtractedReport(_0xd99c('0x2a'));}return db['Setting'][_0xd99c('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd99c('0x2c')]})[_0xd99c('0x2d')](function(_0x27b979){if(_0x27b979){_0x5fa8fc=_0x27b979;_0x20684e=_0x5fa8fc[_0xd99c('0x2c')]||0x3e8;}})['then'](function(){var _0x1d1438=[];var _0x94450d=0x0;if(_0x5fa8fc[_0xd99c('0x2e')]){if(_0x3d4b36&&_0x3d4b36['length']){var _0x3d55fa=_[_0xd99c('0x2f')](_0x3d4b36[0x0][_0xd99c('0x29')]/_0x20684e);var _0x24ba5e=Number[_0xd99c('0x30')](_0x3d4b36[0x0][_0xd99c('0x29')]/_0x20684e)?_0x3d4b36[0x0][_0xd99c('0x29')]%_0x20684e:0x0;_0x3d55fa[_0xd99c('0x19')](function(_0xb297a9){if(_0xb297a9>0x0){_0x94450d+=_0x20684e;}_0x1d1438[_0xd99c('0x1a')](dbH[_0xd99c('0x31')][_0xd99c('0x32')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20684e,_0x94450d),{'type':dbH[_0xd99c('0x31')][_0xd99c('0x33')][_0xd99c('0x34')]}));});if(_0x24ba5e>0x0){_0x94450d+=_0x20684e;_0x1d1438['push'](dbH[_0xd99c('0x31')][_0xd99c('0x32')](util[_0xd99c('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24ba5e,_0x94450d),{'type':dbH[_0xd99c('0x31')][_0xd99c('0x33')][_0xd99c('0x34')]}));}}}else{_0x1d1438[_0xd99c('0x1a')](dbH[_0xd99c('0x31')]['query'](QUERY,{'type':dbH[_0xd99c('0x31')]['QueryTypes'][_0xd99c('0x34')]}));}var _0xee350d=path[_0xd99c('0x35')](PATH);var _0x42ca61=path[_0xd99c('0x36')](PATH,_0xd99c('0x37'));var _0x26aaed=_0x5fa8fc['split']&&_0x1d1438['length']>0x1;var _0x39c01e=[];if(!fs[_0xd99c('0x38')](path['join'](_0xee350d,_0x42ca61))&&_0x26aaed){fs['mkdirSync'](path[_0xd99c('0x39')](_0xee350d,_0x42ca61));}return BPromise[_0xd99c('0x3a')](_0x1d1438,function(_0x53b9f2){_0x39c01e[_0xd99c('0x1a')](_0x53b9f2);})[_0xd99c('0x2d')](function(){var _0x59dd03=[];for(var _0x122ec4=0x0;_0x122ec4<_0x39c01e[_0xd99c('0x3b')];_0x122ec4+=0x1){var _0x275592=_0x39c01e[_0x122ec4];var _0x569c40=createTables(_[_0xd99c('0x3c')](_0x275592));var _0x17cbfa;var _0x14e303=getPDFDocDefinition(_0x569c40);var _0x35ccb7=getPDFPrinter();var _0x550d48=_0x35ccb7[_0xd99c('0x3d')](_0x14e303);if(_0x26aaed){_0x17cbfa=path[_0xd99c('0x39')](_0xee350d,_0x42ca61,util[_0xd99c('0x1b')]('%s%d.%s',_0x42ca61,_0x122ec4,_0xd99c('0x3e')));}else{_0x17cbfa=path[_0xd99c('0x39')](_0xee350d,util['format'](_0xd99c('0x3f'),_0x42ca61,_0xd99c('0x3e')));}_0x59dd03['push'](writePDFDocument(_0x550d48,_0x17cbfa));}return Promise['all'](_0x59dd03);})[_0xd99c('0x2d')](function(){if(_0x26aaed){return new Promise(function(_0x2e2937){zipdir(path[_0xd99c('0x39')](_0xee350d,_0x42ca61),{'saveTo':path['join'](_0xee350d,util[_0xd99c('0x1b')](_0xd99c('0x3f'),_0x42ca61,_0xd99c('0x40')))},function(){rimraf(path[_0xd99c('0x39')](_0xee350d,_0x42ca61),function(){});_0x2e2937(_0xd99c('0x41'));});});}})['then'](function(){if(!_0x26aaed)return;rimraf(path[_0xd99c('0x39')](_0xee350d,_0x42ca61),function(){});})[_0xd99c('0x2d')](function(){logger[_0xd99c('0x42')](util[_0xd99c('0x1b')](_0xd99c('0x43'),EXTRACTED_REPORT_ID,_0xd99c('0x44')));return analyticExtractedReport(_0xd99c('0x45'),_0x26aaed?util[_0xd99c('0x1b')]('%s.%s',_0x42ca61,_0x26aaed?_0xd99c('0x40'):_0xd99c('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd99c('0x42')](util[_0xd99c('0x1b')](_0xd99c('0x46'),EXTRACTED_REPORT_ID,_0xd99c('0x44')));return db[_0xd99c('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd99c('0x2d')](function(_0x303de9){EXTRACTED_REPORT=_0x303de9;return dbH[_0xd99c('0x31')][_0xd99c('0x32')](util['format'](_0xd99c('0x47'),QUERY),{'type':dbH[_0xd99c('0x31')]['QueryTypes']['SELECT']});})[_0xd99c('0x2d')](extractReport)[_0xd99c('0x48')](function(_0x182546){logger['info'](util[_0xd99c('0x1b')](_0xd99c('0x49'),EXTRACTED_REPORT_ID,_0xd99c('0x44')),util['inspect'](_0x182546,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd99c('0x4a'));})[_0xd99c('0x4b')](function(){process[_0xd99c('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5a90b8=new PdfPrinter({'Arial':{'normal':__dirname+_0xd99c('0x4d'),'bold':__dirname+_0xd99c('0x4e'),'italics':__dirname+_0xd99c('0x4f'),'bolditalics':__dirname+_0xd99c('0x50')}});return _0x5a90b8;}function getPDFDocDefinitionFromHTML(_0x23025b,_0x553fd7){var _0xf398ef=util[_0xd99c('0x1b')](_0xd99c('0x51'),_0x553fd7[_0xd99c('0x52')],_0x553fd7[_0xd99c('0x53')]);var _0x5466d5=moment()[_0xd99c('0x1b')](_0xd99c('0x54'))[_0xd99c('0x24')]();var _0x41c790=htmlToPdfmake(_0x23025b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x41c790],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd99c('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd99c('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd99c('0x55')}},'header':function(){return[{'text':_0xd99c('0x56'),'style':_0xd99c('0x1f')}];},'footer':function(_0xb10f11,_0x710432){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0xf398ef,_0xb10f11,_0x710432,_0x5466d5),'style':_0xd99c('0x26')}];}};}function writePDFDocument(_0xa371fe,_0x4eb48e){return new Promise(function(_0x800b4,_0x271030){var _0x3fb4aa=_0xa371fe[_0xd99c('0x57')](fs[_0xd99c('0x58')](_0x4eb48e));_0x3fb4aa['on'](_0xd99c('0x59'),function(){_0x800b4(_0xd99c('0x59'));});_0x3fb4aa['on'](_0xd99c('0x5a'),function(_0x136e75){_0x271030(_0x136e75);});_0xa371fe[_0xd99c('0x5b')]();});}exports[_0xd99c('0x5c')]=function(_0x435df4,_0x23f7cf){var _0x4026b5=getPDFPrinter();var _0x10f999=getPDFDocDefinitionFromHTML(_0x435df4,_0x23f7cf);var _0x1dffd7=_0x4026b5['createPdfKitDocument'](_0x10f999);return writePDFDocument(_0x1dffd7,_0x23f7cf[_0xd99c('0x2')])[_0xd99c('0x48')](function(_0x226bc8){throw _0x226bc8;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 66fc752..f4608ea 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x143a=['util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','length','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','XLSX','catch','inspect','Failed','finally','exit'];(function(_0x574de7,_0x24ce60){var _0x568f46=function(_0x516004){while(--_0x516004){_0x574de7['push'](_0x574de7['shift']());}};_0x568f46(++_0x24ce60);}(_0x143a,0x1b9));var _0xa143=function(_0x7440e0,_0x42d9b8){_0x7440e0=_0x7440e0-0x0;var _0x33ee99=_0x143a[_0x7440e0];return _0x33ee99;};'use strict';var util=require(_0xa143('0x0'));var path=require(_0xa143('0x1'));var _=require(_0xa143('0x2'));var fs=require('fs');var json2xls=require(_0xa143('0x3'));var BPromise=require(_0xa143('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xa143('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa143('0x6'))['dbH'];var logger=require(_0xa143('0x7'))(_0xa143('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa143('0x9')][0x2]);var QUERY=process[_0xa143('0x9')][0x3];var PATH=process[_0xa143('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x21cc36,_0x345a40){var _0x1d3f6f={'status':_0x21cc36};var _0x3f4c0d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x345a40){_0x1d3f6f[_0xa143('0xa')]=_0x345a40;}return db[_0xa143('0xb')][_0xa143('0xc')](_0x1d3f6f,_0x3f4c0d);}function main(){var _0x48e5b8=0x1388;var _0x3c9120;logger[_0xa143('0xd')](util[_0xa143('0xe')](_0xa143('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xa143('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa143('0x11'),_0xa143('0x12')]})[_0xa143('0x13')](function(_0xc3cc21){if(_0xc3cc21){_0x3c9120=_0xc3cc21;_0x48e5b8=_0x3c9120[_0xa143('0x12')]||0x1388;}})[_0xa143('0x13')](function(){return dbH[_0xa143('0x14')][_0xa143('0x15')](util[_0xa143('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa143('0x14')][_0xa143('0x16')][_0xa143('0x17')]});})[_0xa143('0x13')](function(_0x4318c1){if(!_0x4318c1[0x0]['num']){return analyticExtractedReport(_0xa143('0x18'));}var _0x3f2771=[];var _0x3e6572=0x0;if(_0x3c9120['split']){if(_0x4318c1&&_0x4318c1['length']){var _0x2c44f2=_[_0xa143('0x19')](_0x4318c1[0x0]['num']/_0x48e5b8);var _0x7b534e=Number[_0xa143('0x1a')](_0x4318c1[0x0]['num']/_0x48e5b8)?_0x4318c1[0x0]['num']%_0x48e5b8:0x0;_0x2c44f2[_0xa143('0x1b')](function(_0x147a4d){if(_0x147a4d>0x0){_0x3e6572+=_0x48e5b8;}_0x3f2771[_0xa143('0x1c')](dbH['sequelize'][_0xa143('0x15')](util['format'](_0xa143('0x1d'),QUERY,_0x48e5b8,_0x3e6572),{'type':dbH[_0xa143('0x14')][_0xa143('0x16')][_0xa143('0x17')]}));});if(_0x7b534e>0x0){_0x3e6572+=_0x48e5b8;_0x3f2771[_0xa143('0x1c')](dbH['sequelize'][_0xa143('0x15')](util[_0xa143('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x7b534e,_0x3e6572),{'type':dbH[_0xa143('0x14')][_0xa143('0x16')]['SELECT']}));}}}else{_0x3f2771[_0xa143('0x1c')](dbH[_0xa143('0x14')][_0xa143('0x15')](QUERY,{'type':dbH[_0xa143('0x14')][_0xa143('0x16')][_0xa143('0x17')]}));}var _0x26b7f1=path[_0xa143('0x1e')](PATH);var _0x2467ac=path[_0xa143('0x1f')](PATH,_0xa143('0x20'));var _0x5f4bca=_0x3c9120[_0xa143('0x11')]&&_0x3f2771['length']>0x1;var _0x84591a=[];if(!fs[_0xa143('0x21')](path[_0xa143('0x22')](_0x26b7f1,_0x2467ac))&&_0x5f4bca){fs['mkdirSync'](path['join'](_0x26b7f1,_0x2467ac));}return BPromise['each'](_0x3f2771,function(_0x533e13){_0x84591a[_0xa143('0x1c')](_0x533e13);})['then'](function(){for(var _0x3a7bbe=0x0;_0x3a7bbe<_0x84591a[_0xa143('0x23')];_0x3a7bbe+=0x1){var _0xb6144c;var _0x4494b1=_0x84591a[_0x3a7bbe];if(_0x5f4bca){_0xb6144c=path[_0xa143('0x22')](_0x26b7f1,_0x2467ac,util['format'](_0xa143('0x24'),_0x2467ac,_0x3a7bbe,_0xa143('0x25')));}else{_0xb6144c=path['join'](_0x26b7f1,util['format']('%s.%s',_0x2467ac,_0xa143('0x25')));}fs[_0xa143('0x26')](_0xb6144c,json2xls(_0x4494b1),_0xa143('0x27'));}})[_0xa143('0x13')](function(){if(_0x5f4bca){return new Promise(function(_0x53e262){zipdir(path['join'](_0x26b7f1,_0x2467ac),{'saveTo':path[_0xa143('0x22')](_0x26b7f1,util[_0xa143('0xe')](_0xa143('0x28'),_0x2467ac,_0xa143('0x29')))},function(_0x34403f,_0x567d2b){rimraf(path['join'](_0x26b7f1,_0x2467ac),function(){});_0x53e262(_0xa143('0x2a'));});});}})[_0xa143('0x13')](function(){logger[_0xa143('0xd')](util[_0xa143('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa143('0x2b')));return analyticExtractedReport('Completed',_0x5f4bca?util[_0xa143('0xe')](_0xa143('0x28'),_0x2467ac,_0x5f4bca?_0xa143('0x29'):_0xa143('0x25')):null);});})[_0xa143('0x2c')](function(_0x28c09d){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0xa143('0x2d')](_0x28c09d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa143('0x2e'));})[_0xa143('0x2f')](function(){process[_0xa143('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7be1=['format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','join','mkdirSync','each','%s%d.%s','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','info'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x7be1,0x165));var _0x17be=function(_0x146fc2,_0x4beccc){_0x146fc2=_0x146fc2-0x0;var _0x3600ee=_0x7be1[_0x146fc2];return _0x3600ee;};'use strict';var util=require(_0x17be('0x0'));var path=require(_0x17be('0x1'));var _=require(_0x17be('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x17be('0x3'));var zipdir=require(_0x17be('0x4'));var rimraf=require(_0x17be('0x5'));var db=require(_0x17be('0x6'))['db'];var dbH=require(_0x17be('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x17be('0x7')][0x2]);var QUERY=process[_0x17be('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x326f4d,_0x23f19f){var _0x2c74b2={'status':_0x326f4d};var _0xfd9c5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23f19f){_0x2c74b2[_0x17be('0x8')]=_0x23f19f;}return db[_0x17be('0x9')]['update'](_0x2c74b2,_0xfd9c5);}function main(){var _0x41e383=0x1388;var _0x589cdb;logger[_0x17be('0xa')](util[_0x17be('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x17be('0xc')));return db[_0x17be('0xd')][_0x17be('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x17be('0xf'),'splitSizeXlsx']})[_0x17be('0x10')](function(_0x52a62c){if(_0x52a62c){_0x589cdb=_0x52a62c;_0x41e383=_0x589cdb[_0x17be('0x11')]||0x1388;}})['then'](function(){return dbH[_0x17be('0x12')][_0x17be('0x13')](util[_0x17be('0xb')](_0x17be('0x14'),QUERY),{'type':dbH[_0x17be('0x12')]['QueryTypes'][_0x17be('0x15')]});})['then'](function(_0x53c86d){if(!_0x53c86d[0x0][_0x17be('0x16')]){return analyticExtractedReport('Empty');}var _0x2a37ec=[];var _0x4abdbc=0x0;if(_0x589cdb[_0x17be('0xf')]){if(_0x53c86d&&_0x53c86d[_0x17be('0x17')]){var _0x5d5ed7=_[_0x17be('0x18')](_0x53c86d[0x0]['num']/_0x41e383);var _0x222009=Number['isInteger'](_0x53c86d[0x0][_0x17be('0x16')]/_0x41e383)?_0x53c86d[0x0][_0x17be('0x16')]%_0x41e383:0x0;_0x5d5ed7[_0x17be('0x19')](function(_0x3e087c){if(_0x3e087c>0x0){_0x4abdbc+=_0x41e383;}_0x2a37ec[_0x17be('0x1a')](dbH['sequelize'][_0x17be('0x13')](util[_0x17be('0xb')](_0x17be('0x1b'),QUERY,_0x41e383,_0x4abdbc),{'type':dbH[_0x17be('0x12')]['QueryTypes'][_0x17be('0x15')]}));});if(_0x222009>0x0){_0x4abdbc+=_0x41e383;_0x2a37ec['push'](dbH['sequelize'][_0x17be('0x13')](util[_0x17be('0xb')](_0x17be('0x1b'),QUERY,_0x222009,_0x4abdbc),{'type':dbH[_0x17be('0x12')]['QueryTypes'][_0x17be('0x15')]}));}}}else{_0x2a37ec[_0x17be('0x1a')](dbH['sequelize'][_0x17be('0x13')](QUERY,{'type':dbH['sequelize'][_0x17be('0x1c')][_0x17be('0x15')]}));}var _0x47f00d=path[_0x17be('0x1d')](PATH);var _0x53320b=path[_0x17be('0x1e')](PATH,'.xlsx');var _0x48ae1f=_0x589cdb[_0x17be('0xf')]&&_0x2a37ec['length']>0x1;var _0x39f237=[];if(!fs['existsSync'](path[_0x17be('0x1f')](_0x47f00d,_0x53320b))&&_0x48ae1f){fs[_0x17be('0x20')](path[_0x17be('0x1f')](_0x47f00d,_0x53320b));}return BPromise[_0x17be('0x21')](_0x2a37ec,function(_0x339d11){_0x39f237[_0x17be('0x1a')](_0x339d11);})[_0x17be('0x10')](function(){for(var _0x22100=0x0;_0x22100<_0x39f237['length'];_0x22100+=0x1){var _0x35cce2;var _0x1f437e=_0x39f237[_0x22100];if(_0x48ae1f){_0x35cce2=path[_0x17be('0x1f')](_0x47f00d,_0x53320b,util[_0x17be('0xb')](_0x17be('0x22'),_0x53320b,_0x22100,'xlsx'));}else{_0x35cce2=path[_0x17be('0x1f')](_0x47f00d,util[_0x17be('0xb')](_0x17be('0x23'),_0x53320b,'xlsx'));}fs['writeFileSync'](_0x35cce2,json2xls(_0x1f437e),_0x17be('0x24'));}})[_0x17be('0x10')](function(){if(_0x48ae1f){return new Promise(function(_0x57c5b2){zipdir(path[_0x17be('0x1f')](_0x47f00d,_0x53320b),{'saveTo':path['join'](_0x47f00d,util[_0x17be('0xb')](_0x17be('0x23'),_0x53320b,_0x17be('0x25')))},function(_0x3e53e8,_0x2ac6f3){rimraf(path[_0x17be('0x1f')](_0x47f00d,_0x53320b),function(){});_0x57c5b2(_0x17be('0x26'));});});}})[_0x17be('0x10')](function(){logger['info'](util[_0x17be('0xb')](_0x17be('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x17be('0x28'),_0x48ae1f?util[_0x17be('0xb')]('%s.%s',_0x53320b,_0x48ae1f?_0x17be('0x25'):'xlsx'):null);});})[_0x17be('0x29')](function(_0xf01ac1){logger['info'](util[_0x17be('0xb')](_0x17be('0x2a'),EXTRACTED_REPORT_ID,_0x17be('0xc')),util[_0x17be('0x2b')](_0xf01ac1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x17be('0x2c'));})[_0x17be('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index fccb08d..f104dc2 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4b8=['${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','util','models','Interval','then','intervals','findAll','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits'];(function(_0x310ca4,_0x195e91){var _0x303c6f=function(_0x53dbf2){while(--_0x53dbf2){_0x310ca4['push'](_0x310ca4['shift']());}};_0x303c6f(++_0x195e91);}(_0xa4b8,0x197));var _0x8a4b=function(_0x2edf70,_0x3b24e1){_0x2edf70=_0x2edf70-0x0;var _0x193515=_0xa4b8[_0x2edf70];return _0x193515;};'use strict';var _=require('lodash');var util=require(_0x8a4b('0x0'));function rewrite(_0x2cc344,_0x3b57ef){var _0x3c8ec6=this;return _0x2cc344[_0x8a4b('0x1')][_0x8a4b('0x2')]['findAll']({'raw':!![]})[_0x8a4b('0x3')](function(_0x5683e0){_0x3c8ec6[_0x8a4b('0x4')]=_0x5683e0;return _0x2cc344['models']['VoiceExtension'][_0x8a4b('0x5')]({'where':{'IntervalId':_0x3b57ef['IntervalId']},'raw':!![]});})[_0x8a4b('0x3')](function(_0x2e899b){return _0x2cc344[_0x8a4b('0x1')][_0x8a4b('0x6')][_0x8a4b('0x5')]({'where':{'exten':{'$in':_[_0x8a4b('0x7')](_[_0x8a4b('0x8')](_0x2e899b,'exten'))}},'order':[{'raw':_0x8a4b('0x9')}],'raw':!![]});})[_0x8a4b('0x3')](function(_0x483aee){var _0x4f581d=_[_0x8a4b('0xa')](_0x483aee,{'priority':'1'});var _0x37fb6e=_['filter'](_0x483aee,{'isApp':0x1});var _0x11d1f9=_[_0x8a4b('0xb')](_0x37fb6e,_0x8a4b('0xc'));var _0x424b8d=['queue',_0x8a4b('0xd')];var _0x4c738e=[];var _0x4360ad=[];for(var _0x234acd in _0x11d1f9){if(_0x11d1f9[_0x8a4b('0xe')](_0x234acd)){_0x3c8ec6[_0x8a4b('0xf')]=0x2;_0x3c8ec6[_0x8a4b('0x10')]=[];_0x3c8ec6[_0x8a4b('0x11')]=_[_0x8a4b('0x12')](_0x4f581d,{'exten':_0x11d1f9[_0x234acd][0x0]['exten']});_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':util[_0x8a4b('0x16')](_0x8a4b('0x17'),_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')]),'context':_0x11d1f9[_0x234acd][0x0]['context'],'exten':_0x11d1f9[_0x234acd][0x0]['exten'],'priority':_0x3c8ec6['priority']++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});if(_0x11d1f9[_0x234acd][0x0]['type']===_0x8a4b('0x19')){_0x3c8ec6[_0x8a4b('0x10')]['push']({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':'Set','appdata':_0x8a4b('0x1a')+_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')],'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6['priority']++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});}else if(_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')]===_0x8a4b('0x1c')){if(_0x3c8ec6['extension']){_0x3c8ec6['extensions'][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':_0x8a4b('0x1d')+(_0x3c8ec6[_0x8a4b('0x11')][_0x8a4b('0x1e')]?_0x8a4b('0x1f')+_0x3c8ec6[_0x8a4b('0x11')]['cutdigits']+'}':_0x8a4b('0x20')),'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});}_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0]['type'],'app':_0x8a4b('0x15'),'appdata':'CDR(routeid)='+_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')],'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});var _0xcb1fde=_0x3c8ec6[_0x8a4b('0xf')]++;_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0]['type'],'app':_0x8a4b('0x21'),'appdata':_0x8a4b('0x22')+(_0xcb1fde+0x2)+_0x8a4b('0x23')+(_0xcb1fde+0x1)+')','context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0]['exten'],'priority':_0xcb1fde,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});if(_0x3c8ec6[_0x8a4b('0x11')]){_0x3c8ec6['extensions'][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':_0x3c8ec6[_0x8a4b('0x11')]['cutdigits']?_0x8a4b('0x24')+_0x3c8ec6[_0x8a4b('0x11')][_0x8a4b('0x1e')]+'}':_0x8a4b('0x25'),'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0]['exten'],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});}_0x3c8ec6['extensions'][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':'outboundrouteid='+_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')],'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});if(_0x3c8ec6[_0x8a4b('0x11')]&&_0x3c8ec6['extension'][_0x8a4b('0xe')]('recordingFormat')&&_0x3c8ec6['extension'][_0x8a4b('0x26')]!==_0x8a4b('0x27')){_0x3c8ec6['extensions'][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0]['type'],'app':_0x8a4b('0x15'),'appdata':_0x8a4b('0x28'),'context':_0x11d1f9[_0x234acd][0x0]['context'],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0]['type'],'app':_0x8a4b('0x15'),'appdata':_0x8a4b('0x29')+_0x3c8ec6[_0x8a4b('0x11')]['recordingFormat']||_0x8a4b('0x2a'),'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0]['VoiceExtensionId']});}}_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0]['exten'],'priority':_0x3c8ec6['priority']++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0]['VoiceExtensionId']});_0x3c8ec6[_0x8a4b('0x10')][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0]['exten'],'priority':_0x3c8ec6[_0x8a4b('0xf')]++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});_0x3c8ec6['extensions']['push']({'type':_0x11d1f9[_0x234acd][0x0]['type'],'app':_0x8a4b('0x15'),'appdata':_0x8a4b('0x2b'),'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'priority':_0x3c8ec6['priority']++,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});for(var _0x3c79fd=0x0,_0x4de2f0=0x0;_0x3c79fd<_0x11d1f9[_0x234acd]['length'];_0x3c79fd+=0x1,_0x4de2f0=0x0){var _0x59e9f2=_0x11d1f9[_0x234acd][_0x3c79fd];if(_0x59e9f2[_0x8a4b('0x14')]){_0x59e9f2[_0x8a4b('0x14')]=_0x59e9f2['type']['toLowerCase']();}var _0x423fed=[];var _0x3804f6=[];delete _0x59e9f2['id'];delete _0x59e9f2[_0x8a4b('0x2c')];delete _0x59e9f2[_0x8a4b('0x2d')];var _0x23fd6d=_0x59e9f2[_0x8a4b('0x2e')]!==_0x8a4b('0x2f')?[_0x59e9f2['interval']]:_0x59e9f2['IntervalId']?_[_0x8a4b('0x8')](_[_0x8a4b('0xa')](_0x3c8ec6[_0x8a4b('0x4')],{'IntervalId':_0x59e9f2[_0x8a4b('0x30')]}),_0x8a4b('0x2e')):[];if(_0x59e9f2['hasOwnProperty'](_0x8a4b('0x31'))){if(_0x59e9f2[_0x8a4b('0x31')]&&_0x59e9f2[_0x8a4b('0x31')]!=='--'){_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':'CDR(tag)='+_0x59e9f2[_0x8a4b('0x31')],'context':_0x59e9f2[_0x8a4b('0x1b')],'exten':_0x59e9f2[_0x8a4b('0xc')],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6[_0x8a4b('0xf')]+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2['VoiceExtensionId']});}}if(_0x59e9f2['type']===_0x8a4b('0x1c')&&_0x59e9f2[_0x8a4b('0xe')]('callerID')){if(_0x59e9f2[_0x8a4b('0x33')]){_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x21'),'appdata':_0x8a4b('0x34')+_0x59e9f2[_0x8a4b('0x33')]+')','context':_0x59e9f2[_0x8a4b('0x1b')],'exten':_0x59e9f2['exten'],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6[_0x8a4b('0xf')]+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2[_0x8a4b('0x18')]});}else{_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x21'),'appdata':_0x8a4b('0x35'),'context':_0x59e9f2['context'],'exten':_0x59e9f2[_0x8a4b('0xc')],'priority':_0x23fd6d['length']+_0x3c8ec6['priority']+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2['VoiceExtensionId']});}}if(_0x59e9f2[_0x8a4b('0xe')](_0x8a4b('0x36'))){if(_0x424b8d[_0x8a4b('0x37')](_0x59e9f2[_0x8a4b('0x38')][_0x8a4b('0x39')]())>=0x0&&_0x59e9f2[_0x8a4b('0x3a')]!==_0x8a4b('0x3b')){if(_0x59e9f2['answer']){_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x59e9f2[_0x8a4b('0x1b')],'exten':_0x59e9f2[_0x8a4b('0xc')],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6['priority']+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2[_0x8a4b('0x18')]});_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':_0x8a4b('0x3c'),'context':_0x59e9f2['context'],'exten':_0x59e9f2['exten'],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6['priority']+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2[_0x8a4b('0x18')]});}else{_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x21'),'appdata':_0x8a4b('0x3d'),'context':_0x59e9f2[_0x8a4b('0x1b')],'exten':_0x59e9f2[_0x8a4b('0xc')],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6[_0x8a4b('0xf')]+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2[_0x8a4b('0x18')]});_0x423fed[_0x8a4b('0x13')]({'type':_0x59e9f2[_0x8a4b('0x14')],'app':_0x8a4b('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x59e9f2[_0x8a4b('0x1b')],'exten':_0x59e9f2[_0x8a4b('0xc')],'priority':_0x23fd6d[_0x8a4b('0x32')]+_0x3c8ec6[_0x8a4b('0xf')]+_0x4de2f0++,'VoiceExtensionId':_0x59e9f2[_0x8a4b('0x18')]});}}}for(var _0x3d1e4b=0x0;_0x3d1e4b<_0x23fd6d[_0x8a4b('0x32')];_0x3d1e4b+=0x1){var _0x3bef3a=_0x3c8ec6['priority']+_0x23fd6d[_0x8a4b('0x32')];var _0x4edd02=_0x3d1e4b===_0x23fd6d[_0x8a4b('0x32')]-0x1?_0x3c8ec6[_0x8a4b('0xf')]+_0x423fed[_0x8a4b('0x32')]+_0x3804f6[_0x8a4b('0x32')]+0x2:_0x3c8ec6['priority']+_0x3d1e4b+0x1;_0x423fed[_0x8a4b('0x3e')](_0x3d1e4b,0x0,{'type':_0x59e9f2['type'],'app':_0x8a4b('0x3f'),'appdata':_0x23fd6d[_0x3d1e4b]+'?'+_0x59e9f2[_0x8a4b('0x1b')]+_0x8a4b('0x40')+_0x3bef3a+':'+_0x59e9f2['context']+_0x8a4b('0x40')+_0x4edd02,'exten':_0x59e9f2[_0x8a4b('0xc')],'context':_0x59e9f2[_0x8a4b('0x1b')],'priority':_0x3c8ec6[_0x8a4b('0xf')]+_0x3d1e4b,'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});}_0x59e9f2['priority']=_0x423fed[_0x8a4b('0x32')]?_[_0x8a4b('0x41')](_0x423fed)[_0x8a4b('0xf')]+0x1:_0x3c8ec6[_0x8a4b('0xf')];_0x3c8ec6['priority']=(_0x3804f6['length']?_[_0x8a4b('0x41')](_0x3804f6)[_0x8a4b('0xf')]:_0x59e9f2[_0x8a4b('0xf')])+0x1;_0x3c8ec6[_0x8a4b('0x10')]=_['concat'](_0x3c8ec6[_0x8a4b('0x10')],_0x423fed,[_0x59e9f2],_0x3804f6);}_0x3c8ec6['extensions'][_0x8a4b('0x13')]({'type':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x14')],'app':'Hangup','exten':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0xc')],'context':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x1b')],'priority':_0x3c8ec6[_0x8a4b('0xf')],'VoiceExtensionId':_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]});_0x4c738e[_0x8a4b('0x13')](_0x11d1f9[_0x234acd][0x0][_0x8a4b('0x18')]);_0x4360ad=_[_0x8a4b('0x42')](_0x4360ad,_0x3c8ec6[_0x8a4b('0x10')]);}}return _0x2cc344[_0x8a4b('0x43')](function(_0x4ee17b){return _0x2cc344[_0x8a4b('0x1')][_0x8a4b('0x6')][_0x8a4b('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x4c738e}},'transaction':_0x4ee17b})[_0x8a4b('0x3')](function(_0x2638ba){return _0x2cc344[_0x8a4b('0x1')]['VoiceExtension'][_0x8a4b('0x45')](_[_0x8a4b('0x46')](_0x4360ad,_0x8a4b('0xf')),{'transaction':_0x4ee17b});});});})[_0x8a4b('0x47')](function(_0x1c7831){console[_0x8a4b('0x48')](_0x1c7831);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x371d=['filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','type','Set','context','VoiceExtensionId','inbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','push','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','Interval','findAll','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x371d,0x8a));var _0xd371=function(_0x17f4f0,_0x4959f1){_0x17f4f0=_0x17f4f0-0x0;var _0x50abaf=_0x371d[_0x17f4f0];return _0x50abaf;};'use strict';var _=require(_0xd371('0x0'));var util=require(_0xd371('0x1'));function rewrite(_0x104fd2,_0xcbf85e){var _0x376c97=this;return _0x104fd2[_0xd371('0x2')][_0xd371('0x3')][_0xd371('0x4')]({'raw':!![]})['then'](function(_0x202aba){_0x376c97['intervals']=_0x202aba;return _0x104fd2[_0xd371('0x2')][_0xd371('0x5')][_0xd371('0x4')]({'where':{'IntervalId':_0xcbf85e[_0xd371('0x6')]},'raw':!![]});})[_0xd371('0x7')](function(_0x1ec0dc){return _0x104fd2['models'][_0xd371('0x5')][_0xd371('0x4')]({'where':{'exten':{'$in':_[_0xd371('0x8')](_[_0xd371('0x9')](_0x1ec0dc,_0xd371('0xa')))}},'order':[{'raw':_0xd371('0xb')}],'raw':!![]});})['then'](function(_0x50d7ca){var _0x25b9b2=_[_0xd371('0xc')](_0x50d7ca,{'priority':'1'});var _0x4530b1=_[_0xd371('0xc')](_0x50d7ca,{'isApp':0x1});var _0x4fb6c2=_[_0xd371('0xd')](_0x4530b1,_0xd371('0xa'));var _0x5e7938=[_0xd371('0xe'),_0xd371('0xf')];var _0x949850=[];var _0x5329a7=[];for(var _0x207ae2 in _0x4fb6c2){if(_0x4fb6c2[_0xd371('0x10')](_0x207ae2)){_0x376c97[_0xd371('0x11')]=0x2;_0x376c97[_0xd371('0x12')]=[];_0x376c97['extension']=_['find'](_0x25b9b2,{'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')]});_0x376c97[_0xd371('0x12')]['push']({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':util['format']('CDR(type)=%s',_0x4fb6c2[_0x207ae2][0x0]['type']),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});if(_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')]===_0xd371('0x17')){_0x376c97[_0xd371('0x12')]['push']({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':'CDR(routeid)='+_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')],'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});}else if(_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')]==='outbound'){if(_0x376c97['extension']){_0x376c97[_0xd371('0x12')]['push']({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':_0xd371('0x18')+(_0x376c97[_0xd371('0x19')][_0xd371('0x1a')]?_0xd371('0x1b')+_0x376c97[_0xd371('0x19')][_0xd371('0x1a')]+'}':_0xd371('0x1c')),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});}_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':'CDR(routeid)='+_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')],'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0]['VoiceExtensionId']});var _0x48c599=_0x376c97[_0xd371('0x11')]++;_0x376c97['extensions'][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0]['type'],'app':_0xd371('0x1e'),'appdata':_0xd371('0x1f')+(_0x48c599+0x2)+_0xd371('0x20')+(_0x48c599+0x1)+')','context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x48c599,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});if(_0x376c97[_0xd371('0x19')]){_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0]['type'],'app':_0xd371('0x14'),'appdata':_0x376c97['extension'][_0xd371('0x1a')]?_0xd371('0x21')+_0x376c97[_0xd371('0x19')][_0xd371('0x1a')]+'}':_0xd371('0x22'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97['priority']++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});}_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0]['type'],'app':_0xd371('0x14'),'appdata':_0xd371('0x23')+_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')],'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});if(_0x376c97[_0xd371('0x19')]&&_0x376c97[_0xd371('0x19')][_0xd371('0x10')](_0xd371('0x24'))&&_0x376c97[_0xd371('0x19')]['recordingFormat']!==_0xd371('0x25')){_0x376c97[_0xd371('0x12')]['push']({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':'Set','appdata':_0xd371('0x26'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0]['VoiceExtensionId']});_0x376c97['extensions'][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':_0xd371('0x27')+_0x376c97[_0xd371('0x19')]['recordingFormat']||_0xd371('0x28'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0]['exten'],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0]['VoiceExtensionId']});}}_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':_0xd371('0x29'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0]['VoiceExtensionId']});_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0]['type'],'app':_0xd371('0x14'),'appdata':_0xd371('0x2a'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});_0x376c97[_0xd371('0x12')][_0xd371('0x1d')]({'type':_0x4fb6c2[_0x207ae2][0x0]['type'],'app':'Set','appdata':_0xd371('0x2b'),'context':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x15')],'exten':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0xa')],'priority':_0x376c97[_0xd371('0x11')]++,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});for(var _0x1412c3=0x0,_0xf66091=0x0;_0x1412c3<_0x4fb6c2[_0x207ae2][_0xd371('0x2c')];_0x1412c3+=0x1,_0xf66091=0x0){var _0x4988c1=_0x4fb6c2[_0x207ae2][_0x1412c3];if(_0x4988c1[_0xd371('0x13')]){_0x4988c1[_0xd371('0x13')]=_0x4988c1[_0xd371('0x13')][_0xd371('0x2d')]();}var _0x34c2cd=[];var _0x52bd73=[];delete _0x4988c1['id'];delete _0x4988c1[_0xd371('0x2e')];delete _0x4988c1[_0xd371('0x2f')];var _0x364e93=_0x4988c1[_0xd371('0x30')]!==_0xd371('0x31')?[_0x4988c1[_0xd371('0x30')]]:_0x4988c1[_0xd371('0x6')]?_[_0xd371('0x9')](_[_0xd371('0xc')](_0x376c97[_0xd371('0x32')],{'IntervalId':_0x4988c1[_0xd371('0x6')]}),'interval'):[];if(_0x4988c1[_0xd371('0x10')]('tag')){if(_0x4988c1[_0xd371('0x33')]&&_0x4988c1['tag']!=='--'){_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1['type'],'app':_0xd371('0x14'),'appdata':'CDR(tag)='+_0x4988c1[_0xd371('0x33')],'context':_0x4988c1['context'],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93[_0xd371('0x2c')]+_0x376c97['priority']+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});}}if(_0x4988c1[_0xd371('0x13')]===_0xd371('0x34')&&_0x4988c1[_0xd371('0x10')](_0xd371('0x35'))){if(_0x4988c1[_0xd371('0x35')]){_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1[_0xd371('0x13')],'app':_0xd371('0x1e'),'appdata':_0xd371('0x36')+_0x4988c1[_0xd371('0x35')]+')','context':_0x4988c1['context'],'exten':_0x4988c1['exten'],'priority':_0x364e93[_0xd371('0x2c')]+_0x376c97['priority']+_0xf66091++,'VoiceExtensionId':_0x4988c1['VoiceExtensionId']});}else{_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1[_0xd371('0x13')],'app':_0xd371('0x1e'),'appdata':_0xd371('0x37'),'context':_0x4988c1[_0xd371('0x15')],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93[_0xd371('0x2c')]+_0x376c97[_0xd371('0x11')]+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});}}if(_0x4988c1[_0xd371('0x10')](_0xd371('0x38'))){if(_0x5e7938[_0xd371('0x39')](_0x4988c1[_0xd371('0x3a')][_0xd371('0x2d')]())>=0x0&&_0x4988c1[_0xd371('0x3b')]!=='custom'){if(_0x4988c1[_0xd371('0x38')]){_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1[_0xd371('0x13')],'app':'ExecIf','appdata':_0xd371('0x3c'),'context':_0x4988c1[_0xd371('0x15')],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93[_0xd371('0x2c')]+_0x376c97[_0xd371('0x11')]+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});_0x34c2cd['push']({'type':_0x4988c1[_0xd371('0x13')],'app':'Set','appdata':_0xd371('0x3d'),'context':_0x4988c1[_0xd371('0x15')],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93['length']+_0x376c97['priority']+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});}else{_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1[_0xd371('0x13')],'app':'ExecIf','appdata':_0xd371('0x3e'),'context':_0x4988c1['context'],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93[_0xd371('0x2c')]+_0x376c97[_0xd371('0x11')]+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});_0x34c2cd[_0xd371('0x1d')]({'type':_0x4988c1[_0xd371('0x13')],'app':_0xd371('0x14'),'appdata':_0xd371('0x3f'),'context':_0x4988c1['context'],'exten':_0x4988c1[_0xd371('0xa')],'priority':_0x364e93['length']+_0x376c97[_0xd371('0x11')]+_0xf66091++,'VoiceExtensionId':_0x4988c1[_0xd371('0x16')]});}}}for(var _0x51953f=0x0;_0x51953f<_0x364e93[_0xd371('0x2c')];_0x51953f+=0x1){var _0x51e547=_0x376c97[_0xd371('0x11')]+_0x364e93[_0xd371('0x2c')];var _0x409155=_0x51953f===_0x364e93[_0xd371('0x2c')]-0x1?_0x376c97['priority']+_0x34c2cd['length']+_0x52bd73['length']+0x2:_0x376c97[_0xd371('0x11')]+_0x51953f+0x1;_0x34c2cd['splice'](_0x51953f,0x0,{'type':_0x4988c1[_0xd371('0x13')],'app':_0xd371('0x40'),'appdata':_0x364e93[_0x51953f]+'?'+_0x4988c1[_0xd371('0x15')]+',${EXTEN},'+_0x51e547+':'+_0x4988c1[_0xd371('0x15')]+_0xd371('0x41')+_0x409155,'exten':_0x4988c1[_0xd371('0xa')],'context':_0x4988c1['context'],'priority':_0x376c97[_0xd371('0x11')]+_0x51953f,'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});}_0x4988c1[_0xd371('0x11')]=_0x34c2cd[_0xd371('0x2c')]?_[_0xd371('0x42')](_0x34c2cd)[_0xd371('0x11')]+0x1:_0x376c97['priority'];_0x376c97[_0xd371('0x11')]=(_0x52bd73[_0xd371('0x2c')]?_[_0xd371('0x42')](_0x52bd73)[_0xd371('0x11')]:_0x4988c1[_0xd371('0x11')])+0x1;_0x376c97[_0xd371('0x12')]=_[_0xd371('0x43')](_0x376c97['extensions'],_0x34c2cd,[_0x4988c1],_0x52bd73);}_0x376c97[_0xd371('0x12')]['push']({'type':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x13')],'app':_0xd371('0x44'),'exten':_0x4fb6c2[_0x207ae2][0x0]['exten'],'context':_0x4fb6c2[_0x207ae2][0x0]['context'],'priority':_0x376c97[_0xd371('0x11')],'VoiceExtensionId':_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]});_0x949850[_0xd371('0x1d')](_0x4fb6c2[_0x207ae2][0x0][_0xd371('0x16')]);_0x5329a7=_[_0xd371('0x43')](_0x5329a7,_0x376c97['extensions']);}}return _0x104fd2[_0xd371('0x45')](function(_0x3617d1){return _0x104fd2[_0xd371('0x2')][_0xd371('0x5')][_0xd371('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x949850}},'transaction':_0x3617d1})[_0xd371('0x7')](function(_0x358bed){return _0x104fd2['models'][_0xd371('0x5')][_0xd371('0x47')](_['sortBy'](_0x5329a7,_0xd371('0x11')),{'transaction':_0x3617d1});});});})[_0xd371('0x48')](function(_0x3b79b5){console[_0xd371('0x49')](_0x3b79b5);});}exports[_0xd371('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e7a76a3..88661a0 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x529a=['cm_hopper','ContactId','createdAt','updatedAt','select','field','scheduledAt','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','Lists','then','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','CmList','BlackLists','Campaign','get','CampaignId','findAll','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x529a,0xaa));var _0xa529=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x529a[_0x3ce2c4];return _0x4047c1;};'use strict';var BPromise=require(_0xa529('0x0'));var util=require(_0xa529('0x1'));var _=require(_0xa529('0x2'));var fs=require('fs');var squel=require(_0xa529('0x3'));var Papa=require('papaparse');var Redis=require(_0xa529('0x4'));var db=require(_0xa529('0x5'))['db'];var config=require(_0xa529('0x6'));var logger=require('../../../config/logger')(_0xa529('0x7'));config[_0xa529('0x8')]=_[_0xa529('0x9')](config[_0xa529('0x8')],{'host':_0xa529('0xa'),'port':0x18eb});var socket=require(_0xa529('0xb'))(new Redis(config[_0xa529('0x8')]));require(_0xa529('0xc'))[_0xa529('0xd')](socket);try{if(!process[_0xa529('0xe')][0x2]||process['argv'][0x2]===_0xa529('0xf')||process[_0xa529('0xe')][0x2]===_0xa529('0x10')){throw new Error(_0xa529('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0xa529('0xe')][0x3]||process[_0xa529('0xe')][0x3]===_0xa529('0xf')||process['argv'][0x3]===_0xa529('0x10')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0xa529('0x10')){throw new Error(_0xa529('0x12'));}var FIELDS=_[_0xa529('0x13')](process['argv'][0x3][_0xa529('0x14')](','),process[_0xa529('0xe')][0x4][_0xa529('0x14')](','));if(!process['argv'][0x5]||process[_0xa529('0xe')][0x5]===_0xa529('0xf')||process['argv'][0x5]==='null'){throw new Error(_0xa529('0x15'));}var LISTID=process[_0xa529('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xa529('0xe')][0x6]!==_0xa529('0xf')&&process[_0xa529('0xe')][0x6]!=='null'?process[_0xa529('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xa529('0xe')][0x7]!==_0xa529('0xf')&&process[_0xa529('0xe')][0x7]!==_0xa529('0x10')?process[_0xa529('0xe')][0x7]:null;if(!process[_0xa529('0xe')][0x8]||process['argv'][0x8]===_0xa529('0xf')||process[_0xa529('0xe')][0x8]===_0xa529('0x10')){throw new Error(_0xa529('0x16'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2f5da5){logger[_0xa529('0x17')](_0x2f5da5);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4c2981,_0x395c30,_0x26debb,_0x50f096){var _0x4e8d03={'message':_0x395c30};_0x4e8d03[_0x4c2981]=!![];if(_0x26debb){_0x4e8d03['contact']=_0x26debb;}if(_0x50f096){_0x4e8d03['index']=_0x50f096;}return _0x4e8d03;}function isEmail(_0x5acb28){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xa529('0x18')](_0x5acb28);}function checkRow(_0x5181f1,_0x9ac8a5,_0x544b8e){return new BPromise(function(_0x418f5a,_0x354d8b){if(_[_0xa529('0x19')](_0x5181f1)){return _0x354d8b(handleCheckRowError(_0xa529('0x17'),_0xa529('0x1a'),null,_0x544b8e));}if(_0x5181f1['errors']&&_0x5181f1[_0xa529('0x1b')][_0xa529('0x1c')]){var _0x1b0b16=_[_0xa529('0x1d')](_0x5181f1[_0xa529('0x1b')],_0xa529('0x1e'))[_0xa529('0x1f')](';');return _0x354d8b(handleCheckRowError(_0xa529('0x17'),_0x1b0b16,null,_0x544b8e));}var _0x5cfd9f={};for(var _0x1f11cd in FIELDS){if(FIELDS[_0xa529('0x20')](_0x1f11cd)&&FIELDS[_0x1f11cd]){_0x5cfd9f[_0x1f11cd]=_0x5181f1[_0xa529('0x21')][0x0][FIELDS[_0x1f11cd]]||_0x5181f1[_0xa529('0x21')][0x0]['\ufeff'+FIELDS[_0x1f11cd]];}}if(!_0x5cfd9f[_0xa529('0x22')]){return _0x354d8b(handleCheckRowError('error',_0xa529('0x23'),null,_0x544b8e));}if(!_0x5cfd9f[_0xa529('0x24')]){return _0x354d8b(handleCheckRowError('error',_0xa529('0x25'),null,_0x544b8e));}if(_0x5cfd9f[_0xa529('0x26')]){var _0x416965=moment(_0x5cfd9f[_0xa529('0x26')],_0xa529('0x27'));if(!_0x416965[_0xa529('0x28')]()){return _0x354d8b(handleCheckRowError(_0xa529('0x17'),_0xa529('0x29'),null,_0x544b8e));}}if(_0x5cfd9f[_0xa529('0x2a')]){if(!isEmail(_0x5cfd9f['email'])){return _0x354d8b(handleCheckRowError(_0xa529('0x17'),_0xa529('0x2b'),null,_0x544b8e));}}_0x5cfd9f[_0xa529('0x2c')]=LISTID;_0x5cfd9f[_0xa529('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x9ac8a5){var _0x5ccef3={};for(var _0x5bc269=0x0,_0x313a48=DUPLICATES[_0xa529('0x1c')];_0x5bc269<_0x313a48;_0x5bc269+=0x1){_0x5ccef3[DUPLICATES[_0x5bc269]]=_0x5cfd9f[DUPLICATES[_0x5bc269]];}var _0x582bae=_['find'](_0x9ac8a5,_0x5ccef3);if(_0x582bae){return _0x354d8b(handleCheckRowError(_0xa529('0x2e'),'Duplicate\x20Contact',_0x582bae,_0x544b8e));}}return db[_0xa529('0x2f')][_0xa529('0x30')](_0x5cfd9f,{'raw':!![],'hooks':![],'fields':_[_0xa529('0x31')](_0x5cfd9f)})['then'](function(_0x2cf9fa){if(DUPLICATES&&DUPLICATES[_0xa529('0x1c')]&&_0x9ac8a5){_0x9ac8a5[_0xa529('0x32')](_[_0xa529('0x33')](_0x5cfd9f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2cf9fa['id'];return _0x418f5a();})[_0xa529('0x34')](function(_0x25b23a){return _0x354d8b(handleCheckRowError(_0xa529('0x17'),_0xa529('0x35')+(_0x25b23a[_0xa529('0x1e')]||JSON['stringify'](_0x25b23a)),null,_0x544b8e));});});}function checkHopper(){function _0x39e242(){return function(_0x4983ac){logger[_0xa529('0x17')](_0xa529('0x36'),_0xa529('0x37'),util[_0xa529('0x38')](_0x4983ac,{'showHidden':![],'depth':null}));};}var _0x2b38be=function(_0x5c65d0,_0x55e0a6){var _0x289b14=squel[_0xa529('0x39')]()['into'](_0xa529('0x3a'))['fromQuery'](['phone','scheduledAt',_0xa529('0x3b'),_0xa529('0x2c'),_0x55e0a6,_0xa529('0x3c'),_0xa529('0x3d')],squel[_0xa529('0x3e')]()[_0xa529('0x3f')]('phone',_0xa529('0x24'))[_0xa529('0x3f')]('NOW()',_0xa529('0x40'))[_0xa529('0x3f')]('id',_0xa529('0x3b'))[_0xa529('0x3f')](LISTID[_0xa529('0x41')](),_0xa529('0x2c'))[_0xa529('0x3f')](_0x5c65d0['id']['toString'](),_0x55e0a6)[_0xa529('0x3f')](_0xa529('0x42'),_0xa529('0x3c'))[_0xa529('0x3f')](_0xa529('0x42'),_0xa529('0x3d'))[_0xa529('0x43')](_0xa529('0x44'))[_0xa529('0x45')](_0xa529('0x46'))[_0xa529('0x45')](_0xa529('0x47'),LISTID[_0xa529('0x41')]())[_0xa529('0x45')](_0xa529('0x48'))[_0xa529('0x45')](_0xa529('0x49'),squel[_0xa529('0x3e')]()['field']('phone')[_0xa529('0x43')](_0xa529('0x3a'))[_0xa529('0x45')](_0x55e0a6+'\x20=\x20?',_0x5c65d0['id'][_0xa529('0x41')]())))[_0xa529('0x41')]();return _0x289b14;};var _0x3c0a1e=function(_0x251d93,_0xff603e){var _0x160993=squel[_0xa529('0x39')]()['into'](_0xa529('0x3a'))[_0xa529('0x4a')](['phone',_0xa529('0x40'),_0xa529('0x3b'),_0xa529('0x2c'),_0xff603e,_0xa529('0x3c'),_0xa529('0x3d')],squel[_0xa529('0x3e')]()[_0xa529('0x3f')](_0xa529('0x24'),_0xa529('0x24'))['field'](_0xa529('0x42'),_0xa529('0x40'))[_0xa529('0x3f')]('id',_0xa529('0x3b'))[_0xa529('0x3f')](LISTID[_0xa529('0x41')](),_0xa529('0x2c'))[_0xa529('0x3f')](_0x251d93['id'][_0xa529('0x41')](),_0xff603e)['field']('NOW()',_0xa529('0x3c'))[_0xa529('0x3f')](_0xa529('0x42'),_0xa529('0x3d'))[_0xa529('0x43')](_0xa529('0x44'))[_0xa529('0x45')]('deletedAt\x20IS\x20NULL')[_0xa529('0x45')]('ListId\x20=\x20?',LISTID[_0xa529('0x41')]())[_0xa529('0x45')](_0xa529('0x4b'),squel[_0xa529('0x4c')](hopperContacts))[_0xa529('0x45')](_0xa529('0x48'))[_0xa529('0x45')](_0xa529('0x49'),squel[_0xa529('0x3e')]()['field'](_0xa529('0x4d'))['from'](_0xa529('0x4e'))[_0xa529('0x45')](_0xff603e+'\x20=\x20?',_0x251d93['id'][_0xa529('0x41')]()))['where'](_0xa529('0x49'),squel[_0xa529('0x3e')]()[_0xa529('0x3f')](_0xa529('0x24'))[_0xa529('0x43')](_0xa529('0x3a'))[_0xa529('0x45')](_0xff603e+_0xa529('0x4f'),_0x251d93['id'][_0xa529('0x41')]())))[_0xa529('0x41')]();return _0x160993;};function _0x43b35c(_0x6b15b9,_0x2a5f1e){var _0x165418=squel['insert']()['into'](_0xa529('0x3a'))['fromQuery']([_0xa529('0x24'),_0xa529('0x40'),_0xa529('0x3b'),_0xa529('0x2c'),_0x2a5f1e,_0xa529('0x3c'),_0xa529('0x3d')],squel[_0xa529('0x3e')]()['field'](_0xa529('0x24'),_0xa529('0x24'))[_0xa529('0x3f')](_0xa529('0x42'),_0xa529('0x40'))['field']('id',_0xa529('0x3b'))['field'](LISTID[_0xa529('0x41')](),_0xa529('0x2c'))[_0xa529('0x3f')](_0x6b15b9['id'][_0xa529('0x41')](),_0x2a5f1e)[_0xa529('0x3f')](_0xa529('0x42'),'createdAt')[_0xa529('0x3f')](_0xa529('0x42'),_0xa529('0x3d'))[_0xa529('0x43')](_0xa529('0x44'))['where'](_0xa529('0x46'))[_0xa529('0x45')]('ListId\x20=\x20?',LISTID[_0xa529('0x41')]())[_0xa529('0x45')](_0xa529('0x4b'),squel[_0xa529('0x4c')](hopperContacts))['where'](_0xa529('0x48')))[_0xa529('0x41')]();return _0x165418;}function _0x2f3549(_0x56d4f0,_0x416af2){var _0x2967dd=squel[_0xa529('0x39')]()['into'](_0xa529('0x50'))[_0xa529('0x4a')]([_0xa529('0x24'),_0xa529('0x3b'),_0xa529('0x2c'),_0x416af2,_0xa529('0x3c'),_0xa529('0x3d')],squel['select']()[_0xa529('0x3f')]('phone',_0xa529('0x24'))[_0xa529('0x3f')]('id',_0xa529('0x3b'))[_0xa529('0x3f')](LISTID['toString'](),_0xa529('0x2c'))['field'](_0x56d4f0['id']['toString'](),_0x416af2)['field']('NOW()',_0xa529('0x3c'))[_0xa529('0x3f')]('NOW()','updatedAt')['from'](_0xa529('0x44'))[_0xa529('0x45')](_0xa529('0x46'))['where'](_0xa529('0x47'),LISTID[_0xa529('0x41')]())[_0xa529('0x45')](_0xa529('0x4b'),squel[_0xa529('0x4c')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa529('0x41')]();return _0x2967dd;}return db[_0xa529('0x51')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xa529('0x52')],'include':[{'model':db['CmList'],'as':_0xa529('0x53'),'where':{'id':LISTID}}]})[_0xa529('0x54')](function(_0x48791a){var _0x495bb9=[];if(_0x48791a){var _0x29ecf4;for(var _0x1dccc9=0x0,_0x55aa4d;_0x1dccc9<_0x48791a['length'];_0x1dccc9+=0x1){_0x55aa4d=_0x48791a[_0x1dccc9]['get']({'plain':!![]});switch(_0x55aa4d[_0xa529('0x52')]){case _0xa529('0x55'):_0x495bb9[_0xa529('0x32')](db['sequelize'][_0xa529('0x56')](_0x3c0a1e(_0x55aa4d,_0xa529('0x57')))[_0xa529('0x54')](function(){})[_0xa529('0x34')](_0x39e242()));break;case _0xa529('0x58'):_0x495bb9[_0xa529('0x32')](db[_0xa529('0x59')][_0xa529('0x56')](_0x2b38be(_0x55aa4d,_0xa529('0x57')))[_0xa529('0x54')](function(){})[_0xa529('0x34')](_0x39e242()));break;default:_0x495bb9[_0xa529('0x32')](db[_0xa529('0x59')]['query'](_0x43b35c(_0x55aa4d,_0xa529('0x57')))['then'](function(){})[_0xa529('0x34')](_0x39e242()));}}}return _0x495bb9;})[_0xa529('0x5a')]()[_0xa529('0x54')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xa529('0x5b')],'as':_0xa529('0x5c'),'where':{'id':LISTID}}]})[_0xa529('0x54')](function(_0x5f1b28){var _0x2a19fc=[];if(_0x5f1b28){var _0x3e9625;for(var _0x3d7811=0x0,_0x4af187;_0x3d7811<_0x5f1b28[_0xa529('0x1c')];_0x3d7811+=0x1){_0x4af187=_0x5f1b28[_0x3d7811]['get']({'plain':!![]});_0x2a19fc[_0xa529('0x32')](db[_0xa529('0x59')]['query'](_0x2f3549(_0x4af187,_0xa529('0x57')))['then'](function(){})['catch'](_0x39e242()));}}return _0x2a19fc;})['all']();})[_0xa529('0x54')](function(){return db[_0xa529('0x5d')]['findAll']({'attributes':['id',_0xa529('0x52')],'include':[{'model':db['CmList'],'as':_0xa529('0x53'),'where':{'id':LISTID}}]})[_0xa529('0x54')](function(_0x56019f){var _0x4ccc57=[];if(_0x56019f){for(var _0x4dc364=0x0,_0x4feff5;_0x4dc364<_0x56019f[_0xa529('0x1c')];_0x4dc364+=0x1){_0x4feff5=_0x56019f[_0x4dc364][_0xa529('0x5e')]({'plain':!![]});switch(_0x4feff5['dialCheckDuplicateType']){case _0xa529('0x55'):_0x4ccc57[_0xa529('0x32')](db[_0xa529('0x59')][_0xa529('0x56')](_0x3c0a1e(_0x4feff5,_0xa529('0x5f')))[_0xa529('0x54')](function(){})[_0xa529('0x34')](_0x39e242()));break;case _0xa529('0x58'):_0x4ccc57[_0xa529('0x32')](db[_0xa529('0x59')][_0xa529('0x56')](_0x2b38be(_0x4feff5,_0xa529('0x5f')))[_0xa529('0x54')](function(){})[_0xa529('0x34')](_0x39e242()));break;default:_0x4ccc57[_0xa529('0x32')](db[_0xa529('0x59')][_0xa529('0x56')](_0x43b35c(_0x4feff5,_0xa529('0x5f')))[_0xa529('0x54')](function(){})['catch'](_0x39e242()));}}}return _0x4ccc57;})[_0xa529('0x5a')]();})[_0xa529('0x54')](function(){return db[_0xa529('0x5d')][_0xa529('0x60')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa529('0x5c'),'where':{'id':LISTID}}]})[_0xa529('0x54')](function(_0xe07bd4){var _0x25e0d1=[];if(_0xe07bd4){for(var _0x5739fc=0x0,_0x3ee39e;_0x5739fc<_0xe07bd4[_0xa529('0x1c')];_0x5739fc+=0x1){_0x3ee39e=_0xe07bd4[_0x5739fc][_0xa529('0x5e')]({'plain':!![]});_0x25e0d1[_0xa529('0x32')](db[_0xa529('0x59')][_0xa529('0x56')](_0x2f3549(_0x3ee39e,_0xa529('0x5f')))[_0xa529('0x54')](function(){})[_0xa529('0x34')](_0x39e242()));}}return _0x25e0d1;})['all']();})[_0xa529('0x34')](function(_0x4d415d){logger[_0xa529('0x17')]('cmContact,\x20%s,\x20%s',_0xa529('0x61'),_0x4d415d[_0xa529('0x1e')]);});}var processPromises=function(_0x47112b){return BPromise['all'](promises)[_0xa529('0x54')](function(_0x54f4f6){})[_0xa529('0x34')](function(_0x23b13c){logger['error'](_0xa529('0x62'),JSON[_0xa529('0x63')](_0x23b13c));})[_0xa529('0x64')](function(){socket[_0xa529('0x65')](_0xa529('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x47112b){return _0x47112b[_0xa529('0x67')]();}});};var endCsv=function(){return BPromise[_0xa529('0x68')]()[_0xa529('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0xa529('0x54')](function(){socket[_0xa529('0x65')](_0xa529('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa529('0x69')](FILEPATH);}catch(_0x2d00e5){logger[_0xa529('0x17')](_0xa529('0x6a'),JSON['stringify'](_0x2d00e5));}finally{process['exit'](0x0);}});};process['on'](_0xa529('0x6b'),function(){logger[_0xa529('0x6c')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa529('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa529('0x14')](',');return db[_0xa529('0x2f')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa529('0x54')](function(_0x4a6d0a){var _0x55aa25=fs[_0xa529('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa529('0x6e')](_0x55aa25,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ab6fd,_0x5bee26){total+=0x1;var _0x2dc74e=total;promises[_0xa529('0x32')](checkRow(_0x5ab6fd,_0x4a6d0a,_0x2dc74e)[_0xa529('0x54')](function(){success+=0x1;})['catch'](function(_0x31397b){if(_0x31397b[_0xa529('0x17')]){errors+=0x1;delete _0x31397b[_0xa529('0x17')];}else if(_0x31397b[_0xa529('0x2e')]){duplicates+=0x1;delete _0x31397b[_0xa529('0x2e')];}rows[_0xa529('0x32')](_0x31397b);}));if(total%0xc8===0x0){_0x5bee26[_0xa529('0x6f')]();return processPromises(_0x5bee26);}},'complete':function(){return processPromises()[_0xa529('0x54')](function(){logger['info'](_0xa529('0x70'));endCsv();});},'error':function(_0xddef2f,_0x3398c6){logger[_0xa529('0x6c')](_0xa529('0x71'),JSON[_0xa529('0x63')](_0xddef2f));endCsv();}});})[_0xa529('0x34')](function(_0x3582d3){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x3582d3));});}main(); \ No newline at end of file +var _0x4113=['cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','data','firstName\x20not\x20specified!','phone','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','push','pick','stringify','cmContact','checkHopper','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','insert','calleridnum','phone\x20NOT\x20IN\x20(?)','cm_contacts','id\x20IN\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','query','VoiceQueueId','catch','onlyIfOpen','sequelize','all','VoiceQueue','Campaign','CampaignId'];(function(_0x73e603,_0x58b1a9){var _0x1abc5d=function(_0x1c74a1){while(--_0x1c74a1){_0x73e603['push'](_0x73e603['shift']());}};_0x1abc5d(++_0x58b1a9);}(_0x4113,0x1f2));var _0x3411=function(_0x541ab7,_0x6bd0fe){_0x541ab7=_0x541ab7-0x0;var _0x340700=_0x4113[_0x541ab7];return _0x340700;};'use strict';var BPromise=require(_0x3411('0x0'));var util=require(_0x3411('0x1'));var _=require(_0x3411('0x2'));var fs=require('fs');var squel=require(_0x3411('0x3'));var Papa=require('papaparse');var Redis=require(_0x3411('0x4'));var db=require(_0x3411('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x3411('0x6'))(_0x3411('0x7'));config[_0x3411('0x8')]=_[_0x3411('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3411('0xa'))[_0x3411('0xb')](socket);try{if(!process[_0x3411('0xc')][0x2]||process[_0x3411('0xc')][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x3411('0xc')][0x2];if(!process['argv'][0x3]||process[_0x3411('0xc')][0x3]===_0x3411('0xd')||process['argv'][0x3]==='null'||!process[_0x3411('0xc')][0x4]||process[_0x3411('0xc')][0x4]===_0x3411('0xd')||process[_0x3411('0xc')][0x4]===_0x3411('0xe')){throw new Error(_0x3411('0xf'));}var FIELDS=_[_0x3411('0x10')](process[_0x3411('0xc')][0x3][_0x3411('0x11')](','),process[_0x3411('0xc')][0x4][_0x3411('0x11')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x3411('0xd')||process[_0x3411('0xc')][0x5]===_0x3411('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x3411('0xc')][0x5];var COMPANYID=process[_0x3411('0xc')][0x6]&&process[_0x3411('0xc')][0x6]!==_0x3411('0xd')&&process['argv'][0x6]!==_0x3411('0xe')?process[_0x3411('0xc')][0x6]:null;var DUPLICATES=process[_0x3411('0xc')][0x7]&&process[_0x3411('0xc')][0x7]!==_0x3411('0xd')&&process[_0x3411('0xc')][0x7]!==_0x3411('0xe')?process[_0x3411('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x3411('0xc')][0x8]===_0x3411('0xd')||process[_0x3411('0xc')][0x8]===_0x3411('0xe')){throw new Error(_0x3411('0x12'));}var SOCKET_TIMESTAMP=process[_0x3411('0xc')][0x8];}catch(_0x4a08dd){logger[_0x3411('0x13')](_0x4a08dd);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x50802a,_0x1a864a,_0x1f217e,_0x3dc752){var _0x34e246={'message':_0x1a864a};_0x34e246[_0x50802a]=!![];if(_0x1f217e){_0x34e246[_0x3411('0x14')]=_0x1f217e;}if(_0x3dc752){_0x34e246['index']=_0x3dc752;}return _0x34e246;}function isEmail(_0x1df2b1){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1df2b1);}function checkRow(_0x43ee2b,_0x2d50c7,_0x50d516){return new BPromise(function(_0x401be4,_0x37cfb2){if(_[_0x3411('0x15')](_0x43ee2b)){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),_0x3411('0x16'),null,_0x50d516));}if(_0x43ee2b[_0x3411('0x17')]&&_0x43ee2b[_0x3411('0x17')][_0x3411('0x18')]){var _0x422f78=_['map'](_0x43ee2b[_0x3411('0x17')],'message')[_0x3411('0x19')](';');return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),_0x422f78,null,_0x50d516));}var _0x2025c9={};for(var _0x4332d2 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4332d2)&&FIELDS[_0x4332d2]){_0x2025c9[_0x4332d2]=_0x43ee2b[_0x3411('0x1a')][0x0][FIELDS[_0x4332d2]]||_0x43ee2b['data'][0x0]['\ufeff'+FIELDS[_0x4332d2]];}}if(!_0x2025c9['firstName']){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),_0x3411('0x1b'),null,_0x50d516));}if(!_0x2025c9[_0x3411('0x1c')]){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),'phone\x20not\x20specified!',null,_0x50d516));}if(_0x2025c9['birthDate']){var _0x454201=moment(_0x2025c9['birthDate'],_0x3411('0x1d'));if(!_0x454201['isValid']()){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x50d516));}}if(_0x2025c9[_0x3411('0x1e')]){if(!isEmail(_0x2025c9[_0x3411('0x1e')])){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),_0x3411('0x1f'),null,_0x50d516));}}_0x2025c9[_0x3411('0x20')]=LISTID;_0x2025c9[_0x3411('0x21')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3411('0x18')]&&_0x2d50c7){var _0xe85ce4={};for(var _0x1c99ff=0x0,_0x4b1315=DUPLICATES['length'];_0x1c99ff<_0x4b1315;_0x1c99ff+=0x1){_0xe85ce4[DUPLICATES[_0x1c99ff]]=_0x2025c9[DUPLICATES[_0x1c99ff]];}var _0x5c15ba=_[_0x3411('0x22')](_0x2d50c7,_0xe85ce4);if(_0x5c15ba){return _0x37cfb2(handleCheckRowError(_0x3411('0x23'),'Duplicate\x20Contact',_0x5c15ba,_0x50d516));}}return db[_0x3411('0x24')][_0x3411('0x25')](_0x2025c9,{'raw':!![],'hooks':![],'fields':_[_0x3411('0x26')](_0x2025c9)})['then'](function(_0x184aa9){if(DUPLICATES&&DUPLICATES['length']&&_0x2d50c7){_0x2d50c7[_0x3411('0x27')](_[_0x3411('0x28')](_0x2025c9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x184aa9['id'];return _0x401be4();})['catch'](function(_0x3ae856){return _0x37cfb2(handleCheckRowError(_0x3411('0x13'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3ae856['message']||JSON[_0x3411('0x29')](_0x3ae856)),null,_0x50d516));});});}function checkHopper(){function _0x18f61c(){return function(_0x35e044){logger[_0x3411('0x13')](_0x3411('0x2a'),_0x3411('0x2b'),util['inspect'](_0x35e044,{'showHidden':![],'depth':null}));};}var _0x2cf959=function(_0x4449b5,_0x5afee1){var _0x41031e=squel['insert']()[_0x3411('0x2c')](_0x3411('0x2d'))[_0x3411('0x2e')]([_0x3411('0x1c'),_0x3411('0x2f'),_0x3411('0x30'),_0x3411('0x20'),_0x5afee1,'createdAt',_0x3411('0x31')],squel[_0x3411('0x32')]()[_0x3411('0x33')](_0x3411('0x1c'),_0x3411('0x1c'))[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x2f'))[_0x3411('0x33')]('id',_0x3411('0x30'))['field'](LISTID[_0x3411('0x35')](),_0x3411('0x20'))[_0x3411('0x33')](_0x4449b5['id']['toString'](),_0x5afee1)[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x36'))[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x31'))[_0x3411('0x37')]('cm_contacts')[_0x3411('0x38')](_0x3411('0x39'))[_0x3411('0x38')](_0x3411('0x3a'),LISTID[_0x3411('0x35')]())[_0x3411('0x38')](_0x3411('0x3b'))[_0x3411('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3411('0x32')]()[_0x3411('0x33')](_0x3411('0x1c'))[_0x3411('0x37')](_0x3411('0x2d'))[_0x3411('0x38')](_0x5afee1+_0x3411('0x3c'),_0x4449b5['id']['toString']())))[_0x3411('0x35')]();return _0x41031e;};var _0x43d2cc=function(_0x226516,_0x4f9e97){var _0x7e7789=squel[_0x3411('0x3d')]()[_0x3411('0x2c')](_0x3411('0x2d'))[_0x3411('0x2e')]([_0x3411('0x1c'),_0x3411('0x2f'),_0x3411('0x30'),_0x3411('0x20'),_0x4f9e97,'createdAt',_0x3411('0x31')],squel[_0x3411('0x32')]()[_0x3411('0x33')](_0x3411('0x1c'),_0x3411('0x1c'))['field'](_0x3411('0x34'),_0x3411('0x2f'))[_0x3411('0x33')]('id',_0x3411('0x30'))[_0x3411('0x33')](LISTID[_0x3411('0x35')](),_0x3411('0x20'))[_0x3411('0x33')](_0x226516['id']['toString'](),_0x4f9e97)[_0x3411('0x33')]('NOW()','createdAt')[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x31'))[_0x3411('0x37')]('cm_contacts')[_0x3411('0x38')](_0x3411('0x39'))['where'](_0x3411('0x3a'),LISTID[_0x3411('0x35')]())[_0x3411('0x38')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x3411('0x38')](_0x3411('0x3b'))[_0x3411('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3411('0x32')]()['field'](_0x3411('0x3e'))[_0x3411('0x37')]('cm_hopper_final')[_0x3411('0x38')](_0x4f9e97+_0x3411('0x3c'),_0x226516['id'][_0x3411('0x35')]()))['where'](_0x3411('0x3f'),squel[_0x3411('0x32')]()[_0x3411('0x33')](_0x3411('0x1c'))['from'](_0x3411('0x2d'))['where'](_0x4f9e97+_0x3411('0x3c'),_0x226516['id'][_0x3411('0x35')]())))['toString']();return _0x7e7789;};function _0x2e5e4c(_0x5183c5,_0x17ee33){var _0x1eaa11=squel[_0x3411('0x3d')]()[_0x3411('0x2c')](_0x3411('0x2d'))[_0x3411('0x2e')]([_0x3411('0x1c'),'scheduledAt',_0x3411('0x30'),_0x3411('0x20'),_0x17ee33,_0x3411('0x36'),_0x3411('0x31')],squel['select']()[_0x3411('0x33')](_0x3411('0x1c'),_0x3411('0x1c'))[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x2f'))['field']('id',_0x3411('0x30'))[_0x3411('0x33')](LISTID[_0x3411('0x35')](),_0x3411('0x20'))[_0x3411('0x33')](_0x5183c5['id'][_0x3411('0x35')](),_0x17ee33)[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x36'))[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x31'))[_0x3411('0x37')](_0x3411('0x40'))['where']('deletedAt\x20IS\x20NULL')[_0x3411('0x38')](_0x3411('0x3a'),LISTID['toString']())[_0x3411('0x38')](_0x3411('0x41'),squel['str'](hopperContacts))[_0x3411('0x38')](_0x3411('0x3b')))[_0x3411('0x35')]();return _0x1eaa11;}function _0x5b0b80(_0x125b11,_0x10b5ff){var _0x2ef163=squel[_0x3411('0x3d')]()[_0x3411('0x2c')](_0x3411('0x42'))[_0x3411('0x2e')](['phone',_0x3411('0x30'),_0x3411('0x20'),_0x10b5ff,_0x3411('0x36'),_0x3411('0x31')],squel[_0x3411('0x32')]()[_0x3411('0x33')](_0x3411('0x1c'),'phone')[_0x3411('0x33')]('id',_0x3411('0x30'))[_0x3411('0x33')](LISTID[_0x3411('0x35')](),_0x3411('0x20'))[_0x3411('0x33')](_0x125b11['id']['toString'](),_0x10b5ff)[_0x3411('0x33')](_0x3411('0x34'),_0x3411('0x36'))['field']('NOW()','updatedAt')[_0x3411('0x37')](_0x3411('0x40'))[_0x3411('0x38')](_0x3411('0x39'))['where'](_0x3411('0x3a'),LISTID[_0x3411('0x35')]())[_0x3411('0x38')](_0x3411('0x41'),squel['str'](hopperContacts))[_0x3411('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x3411('0x35')]();return _0x2ef163;}return db['VoiceQueue'][_0x3411('0x43')]({'where':{'type':_0x3411('0x44')},'attributes':['id',_0x3411('0x45')],'include':[{'model':db[_0x3411('0x46')],'as':_0x3411('0x47'),'where':{'id':LISTID}}]})[_0x3411('0x48')](function(_0x30038d){var _0xb9440c=[];if(_0x30038d){var _0x282d2d;for(var _0x4dd537=0x0,_0x413505;_0x4dd537<_0x30038d[_0x3411('0x18')];_0x4dd537+=0x1){_0x413505=_0x30038d[_0x4dd537][_0x3411('0x49')]({'plain':!![]});switch(_0x413505[_0x3411('0x45')]){case _0x3411('0x4a'):_0xb9440c[_0x3411('0x27')](db['sequelize'][_0x3411('0x4b')](_0x43d2cc(_0x413505,_0x3411('0x4c')))['then'](function(){})[_0x3411('0x4d')](_0x18f61c()));break;case _0x3411('0x4e'):_0xb9440c['push'](db[_0x3411('0x4f')][_0x3411('0x4b')](_0x2cf959(_0x413505,_0x3411('0x4c')))[_0x3411('0x48')](function(){})['catch'](_0x18f61c()));break;default:_0xb9440c[_0x3411('0x27')](db[_0x3411('0x4f')][_0x3411('0x4b')](_0x2e5e4c(_0x413505,'VoiceQueueId'))['then'](function(){})[_0x3411('0x4d')](_0x18f61c()));}}}return _0xb9440c;})[_0x3411('0x50')]()[_0x3411('0x48')](function(){return db[_0x3411('0x51')][_0x3411('0x43')]({'where':{'type':_0x3411('0x44')},'attributes':['id'],'include':[{'model':db[_0x3411('0x46')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3411('0x48')](function(_0x18bc62){var _0x22a859=[];if(_0x18bc62){var _0x1ae69b;for(var _0x5b0a7f=0x0,_0x2d3ef8;_0x5b0a7f<_0x18bc62['length'];_0x5b0a7f+=0x1){_0x2d3ef8=_0x18bc62[_0x5b0a7f][_0x3411('0x49')]({'plain':!![]});_0x22a859[_0x3411('0x27')](db[_0x3411('0x4f')]['query'](_0x5b0b80(_0x2d3ef8,_0x3411('0x4c')))[_0x3411('0x48')](function(){})[_0x3411('0x4d')](_0x18f61c()));}}return _0x22a859;})['all']();})[_0x3411('0x48')](function(){return db[_0x3411('0x52')][_0x3411('0x43')]({'attributes':['id',_0x3411('0x45')],'include':[{'model':db[_0x3411('0x46')],'as':_0x3411('0x47'),'where':{'id':LISTID}}]})[_0x3411('0x48')](function(_0x5accdc){var _0x267cec=[];if(_0x5accdc){for(var _0x7c4ec5=0x0,_0x3eb853;_0x7c4ec5<_0x5accdc[_0x3411('0x18')];_0x7c4ec5+=0x1){_0x3eb853=_0x5accdc[_0x7c4ec5][_0x3411('0x49')]({'plain':!![]});switch(_0x3eb853[_0x3411('0x45')]){case _0x3411('0x4a'):_0x267cec[_0x3411('0x27')](db[_0x3411('0x4f')][_0x3411('0x4b')](_0x43d2cc(_0x3eb853,_0x3411('0x53')))['then'](function(){})[_0x3411('0x4d')](_0x18f61c()));break;case _0x3411('0x4e'):_0x267cec[_0x3411('0x27')](db[_0x3411('0x4f')][_0x3411('0x4b')](_0x2cf959(_0x3eb853,_0x3411('0x53')))['then'](function(){})['catch'](_0x18f61c()));break;default:_0x267cec[_0x3411('0x27')](db[_0x3411('0x4f')][_0x3411('0x4b')](_0x2e5e4c(_0x3eb853,'CampaignId'))[_0x3411('0x48')](function(){})[_0x3411('0x4d')](_0x18f61c()));}}}return _0x267cec;})['all']();})[_0x3411('0x48')](function(){return db[_0x3411('0x52')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3411('0x46')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0xb2bdb6){var _0xd435b8=[];if(_0xb2bdb6){for(var _0x36d80f=0x0,_0x4579e4;_0x36d80f<_0xb2bdb6[_0x3411('0x18')];_0x36d80f+=0x1){_0x4579e4=_0xb2bdb6[_0x36d80f]['get']({'plain':!![]});_0xd435b8[_0x3411('0x27')](db['sequelize'][_0x3411('0x4b')](_0x5b0b80(_0x4579e4,_0x3411('0x53')))['then'](function(){})[_0x3411('0x4d')](_0x18f61c()));}}return _0xd435b8;})[_0x3411('0x50')]();})['catch'](function(_0x4732f5){logger[_0x3411('0x13')](_0x3411('0x54'),'generalCheckHopper',_0x4732f5['message']);});}var processPromises=function(_0x5c4b78){return BPromise[_0x3411('0x50')](promises)[_0x3411('0x48')](function(_0x2f1aa6){})['catch'](function(_0x34d84c){logger['error'](_0x3411('0x55'),JSON['stringify'](_0x34d84c));})[_0x3411('0x56')](function(){socket[_0x3411('0x57')](_0x3411('0x58')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5c4b78){return _0x5c4b78['resume']();}});};var endCsv=function(){return BPromise[_0x3411('0x59')]()[_0x3411('0x48')](function(){if(hopperContacts){return checkHopper();}})[_0x3411('0x48')](function(){socket[_0x3411('0x57')](_0x3411('0x58')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x538d5f){logger['error'](_0x3411('0x5a'),JSON[_0x3411('0x29')](_0x538d5f));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x3411('0x5b'));endCsv();});function main(){return BPromise['resolve']()[_0x3411('0x48')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3411('0x11')](',');return db[_0x3411('0x24')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3411('0x48')](function(_0x22eaee){var _0x204677=fs[_0x3411('0x5c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x204677,{'header':!![],'skipEmptyLines':!![],'step':function(_0x53c8d8,_0x38150d){total+=0x1;var _0x55fdb4=total;promises['push'](checkRow(_0x53c8d8,_0x22eaee,_0x55fdb4)['then'](function(){success+=0x1;})[_0x3411('0x4d')](function(_0x57efb5){if(_0x57efb5['error']){errors+=0x1;delete _0x57efb5[_0x3411('0x13')];}else if(_0x57efb5[_0x3411('0x23')]){duplicates+=0x1;delete _0x57efb5[_0x3411('0x23')];}rows[_0x3411('0x27')](_0x57efb5);}));if(total%0xc8===0x0){_0x38150d[_0x3411('0x5d')]();return processPromises(_0x38150d);}},'complete':function(){return processPromises()[_0x3411('0x48')](function(){logger[_0x3411('0x5e')](_0x3411('0x5f'));endCsv();});},'error':function(_0x294f57,_0x430486){logger['info']('CSV\x20parse\x20error',JSON[_0x3411('0x29')](_0x294f57));endCsv();}});})[_0x3411('0x4d')](function(_0x25e6cc){logger[_0x3411('0x13')](_0x3411('0x60'),JSON[_0x3411('0x29')](_0x25e6cc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 10f5cf1..5c0baf4 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d3e=['contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.phone','cm_hopper_black','cm_contacts','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','push','sequelize','spread','catch','info','main','send','start','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','errors','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','rows','emit'];(function(_0x445cee,_0x4eb611){var _0x205200=function(_0x25f41f){while(--_0x25f41f){_0x445cee['push'](_0x445cee['shift']());}};_0x205200(++_0x4eb611);}(_0x7d3e,0x13d));var _0xe7d3=function(_0x170fe2,_0x295e91){_0x170fe2=_0x170fe2-0x0;var _0x50d948=_0x7d3e[_0x170fe2];return _0x50d948;};'use strict';var fs=require('fs');var path=require(_0xe7d3('0x0'));var _=require(_0xe7d3('0x1'));var Papa=require(_0xe7d3('0x2'));var util=require(_0xe7d3('0x3'));var BPromise=require(_0xe7d3('0x4'));var moment=require(_0xe7d3('0x5'));var squel=require(_0xe7d3('0x6'));var Redis=require(_0xe7d3('0x7'));var db=require(_0xe7d3('0x8'))['db'];var config=require(_0xe7d3('0x9'));var logger=require(_0xe7d3('0xa'))(_0xe7d3('0xb'));config['redis']=_[_0xe7d3('0xc')](config[_0xe7d3('0xd')],{'host':_0xe7d3('0xe'),'port':0x18eb});var socket=require(_0xe7d3('0xf'))(new Redis(config[_0xe7d3('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xe7d3('0x10')](_0xe7d3('0x11'));function isEmail(_0x2e561b){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xe7d3('0x12')](_0x2e561b);}function selectNotIn(_0x322291,_0x1bb27e,_0x2f246e,_0x1030f9,_0xf97183){return squel[_0xe7d3('0x13')]()[_0xe7d3('0x14')](_0xe7d3('0x15'))[_0xe7d3('0x16')](_0x1030f9)[_0xe7d3('0x17')](_0x1bb27e,null,_0x1bb27e+_0xe7d3('0x18')+_0x1030f9+'.'+_0x2f246e)['where'](_0x1030f9+'.'+_0x2f246e+_0xe7d3('0x19')+_0x322291+'.'+_0x2f246e)[_0xe7d3('0x1a')](_0x1bb27e+_0xe7d3('0x1b')+_0xf97183['join']()+')');}function insertCmHopper(_0x294906,_0x4cbb3e,_0x37e927,_0x1a8f79,_0x51fd12){var _0x308a49=['cm_contacts.phone','cm_contacts.scheduledat',_0xe7d3('0x1c'),_0xe7d3('0x1d'),_0x4cbb3e+'.'+_0x1a8f79,_0xe7d3('0x1e'),_0xe7d3('0x1f'),_0xe7d3('0x20'),_0xe7d3('0x21'),'\x22'+_0x51fd12+'\x22'];return squel[_0xe7d3('0x22')]()[_0xe7d3('0x23')](_0xe7d3('0x24'))[_0xe7d3('0x25')](['phone',_0xe7d3('0x26'),_0xe7d3('0x27'),_0xe7d3('0x28'),_0x1a8f79,_0xe7d3('0x29'),_0xe7d3('0x2a'),_0xe7d3('0x2b'),_0xe7d3('0x2c'),_0xe7d3('0x2d')],squel[_0xe7d3('0x13')]()[_0xe7d3('0x2e')](_0x308a49)['from'](_0x4cbb3e)[_0xe7d3('0x17')]('cm_contacts',null,_0xe7d3('0x2f')+_0x4cbb3e+_0xe7d3('0x30'))[_0xe7d3('0x17')](_0x37e927,null,_0x37e927+_0xe7d3('0x18')+_0x4cbb3e+'.'+_0x1a8f79)[_0xe7d3('0x1a')](_0x4cbb3e+_0xe7d3('0x31'),_0x294906)[_0xe7d3('0x1a')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe7d3('0x1a')](_0xe7d3('0x32'),selectNotIn(_0x4cbb3e,_0x37e927,_0x1a8f79,'cm_hopper',[_0xe7d3('0x33'),'\x22onlyIfOpen\x22']))['where'](_0xe7d3('0x32'),selectNotIn(_0x4cbb3e,_0x37e927,_0x1a8f79,_0xe7d3('0x24'),[_0xe7d3('0x33')])))['toString']();}function insertCmHopperBlack(_0x211792,_0x3fa414,_0x568a5f,_0x236d67){var _0x3803e2=[_0xe7d3('0x34'),'cm_contacts.id','cm_contacts.ListId',_0x3fa414+'.'+_0x236d67,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xe7d3('0x22')]()[_0xe7d3('0x23')](_0xe7d3('0x35'))[_0xe7d3('0x25')]([_0xe7d3('0x15'),_0xe7d3('0x27'),_0xe7d3('0x28'),_0x236d67,_0xe7d3('0x29'),'updatedAt'],squel[_0xe7d3('0x13')]()[_0xe7d3('0x2e')](_0x3803e2)['from'](_0x3fa414)[_0xe7d3('0x17')](_0xe7d3('0x36'),null,_0xe7d3('0x2f')+_0x3fa414+_0xe7d3('0x30'))[_0xe7d3('0x17')](_0x568a5f,null,_0x568a5f+_0xe7d3('0x18')+_0x3fa414+'.'+_0x236d67)[_0xe7d3('0x1a')](_0x3fa414+_0xe7d3('0x31'),_0x211792)[_0xe7d3('0x1a')](_0xe7d3('0x37'),NOW)['where'](_0xe7d3('0x32'),squel[_0xe7d3('0x13')]()[_0xe7d3('0x14')]('phone')[_0xe7d3('0x16')](_0xe7d3('0x35'))[_0xe7d3('0x1a')](_0xe7d3('0x38'),_0x211792)[_0xe7d3('0x1a')](_0x236d67+_0xe7d3('0x39'),_0x3fa414+'.'+_0x236d67)))[_0xe7d3('0x3a')]();}function insertCmContact(_0x25ff0f,_0x26767d,_0x41ec09,_0x112055){var _0x112ae2=_[_0xe7d3('0x3b')](_[_0xe7d3('0x3c')](_0x112055),[_0xe7d3('0x28'),_0xe7d3('0x3d'),_0xe7d3('0x29'),'updatedAt']);return squel[_0xe7d3('0x22')]()[_0xe7d3('0x23')]('cm_contacts')[_0xe7d3('0x25')](_0x112ae2,squel['select']()[_0xe7d3('0x2e')](_0x112ae2)['from'](_0x26767d)[_0xe7d3('0x1a')]('('+_0x41ec09[_0xe7d3('0x17')](',')+_0xe7d3('0x3e'),squel['select']()[_0xe7d3('0x2e')](_0x41ec09)[_0xe7d3('0x16')]('cm_contacts')[_0xe7d3('0x1a')](_0xe7d3('0x38'),_0x25ff0f)[_0xe7d3('0x1a')]('deletedAt\x20IS\x20NULL'))[_0xe7d3('0x1a')](_0xe7d3('0x3f'),squel['select']()[_0xe7d3('0x14')](_0xe7d3('0x40'),_0xe7d3('0x41'))[_0xe7d3('0x16')](_0x26767d)[_0xe7d3('0x42')](_0x41ec09[_0xe7d3('0x17')](','))))[_0xe7d3('0x3a')]();}function handleStop(){logger['info'](_0xe7d3('0x43'));stopped=!![];}function handleUncaughtException(_0x3d6ba0){logger[_0xe7d3('0x44')](_0x3d6ba0[_0xe7d3('0x45')]);process['exit'](0x1);}function handleError(_0x744afd,_0x305c11){stats['errors'][_0xe7d3('0x46')]({'name':_0x305c11['code'],'message':_0x305c11[_0xe7d3('0x45')],'row':_0x744afd});}function handleQuery(_0x19c343){logger['info'](_0x19c343);return db[_0xe7d3('0x47')]['query'](_0x19c343)[_0xe7d3('0x48')](function(_0x4b4260){results[_0xe7d3('0x46')](_0x4b4260);})[_0xe7d3('0x49')](function(_0x1ffbbb){logger[_0xe7d3('0x44')](_0x1ffbbb['message']);});}function main(_0x53a40b,_0x35e7b5,_0x525366,_0x321983){logger[_0xe7d3('0x4a')](_0xe7d3('0x4b'),_0x53a40b,JSON['stringify'](_0x35e7b5));process[_0xe7d3('0x4c')](_0xe7d3('0x4d'));var _0x5e7702=_0x35e7b5['binding'];var _0x2e1a8c=_0x35e7b5[_0xe7d3('0x4e')];var _0x4a72ef=path['join'](config['root'],_0xe7d3('0x4f'),_0x2e1a8c+_0xe7d3('0x50'));var _0x39eebb=_[_0xe7d3('0x3c')](_0x5e7702)[_0xe7d3('0x17')]();logger[_0xe7d3('0x4a')](_0xe7d3('0x51'),_0x39eebb);fs[_0xe7d3('0x52')](_0x4a72ef,_0x39eebb+'\x0a');Papa[_0xe7d3('0x53')](fs[_0xe7d3('0x54')](_0x53a40b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2df78b,_0x48664b){try{for(var _0x4839a1=0x0,_0x4b7bb1=[];_0x4839a1<_0x2df78b['data'][_0xe7d3('0x55')];_0x4839a1++){stats['rows']+=0x1;if(_0x2df78b[_0xe7d3('0x56')][_0x4839a1]){handleError(_0x2df78b[_0xe7d3('0x57')][_0x4839a1],_0x2df78b[_0xe7d3('0x56')][_0x4839a1]);}else{var _0xe64722=[];for(var _0x24df82 in _0x5e7702){if(_0x5e7702['hasOwnProperty'](_0x24df82)){if(_0x2df78b[_0xe7d3('0x57')][_0x4839a1][_0x5e7702[_0x24df82]]){var _0x4b3816=_[_0xe7d3('0x58')](_0x2df78b['data'][_0x4839a1][_0x5e7702[_0x24df82]][_0xe7d3('0x59')](/"/g,'\x27'));switch(_0x24df82){case _0xe7d3('0x26'):var _0x2b023d=moment(_0x4b3816,_0xe7d3('0x11'),!![]);if(_0x2b023d[_0xe7d3('0x5a')]()){_0x4b7bb1['push']('\x22'+_0x4b3816+'\x22');}else{_0xe64722[_0xe7d3('0x46')](_0xe7d3('0x5b'));}break;case _0xe7d3('0x2b'):var _0x3c2faa=parseInt(_0x4b3816);_0x4b3816=_[_0xe7d3('0x5c')](_0x3c2faa)||_0x3c2faa<0x0||_0x3c2faa>0x4?_0x321983?0x3:0x2:_0x3c2faa;_0x4b7bb1['push']('\x22'+_0x4b3816+'\x22');break;case _0xe7d3('0x2c'):var _0x58cde7=parseInt(_0x4b3816);if(_['isNumber'](_0x58cde7)&&_[_0xe7d3('0x5d')](_0x525366,_0x58cde7)){_0x4b7bb1['push']('\x22'+_0x58cde7+'\x22');}else{_0xe64722['push'](_0xe7d3('0x5e'));}break;case'email':if(isEmail(_0x4b3816)){_0x4b7bb1[_0xe7d3('0x46')]('\x22'+_0x4b3816+'\x22');}else{_0xe64722[_0xe7d3('0x46')]('email\x20wrong\x20format');}break;case _0xe7d3('0x5f'):var _0x195e67=moment(_0x4b3816,_0xe7d3('0x60'),!![]);if(_0x195e67[_0xe7d3('0x5a')]()){_0x4b7bb1['push']('\x22'+_0x4b3816+'\x22');}else{_0xe64722[_0xe7d3('0x46')](_0xe7d3('0x61'));}break;default:_0x4b7bb1[_0xe7d3('0x46')]('\x22'+_0x4b3816+'\x22');}}else{switch(_0x24df82){case'firstName':case _0xe7d3('0x15'):_0xe64722[_0xe7d3('0x46')](_0x24df82+_0xe7d3('0x62'));break;default:_0x4b7bb1[_0xe7d3('0x46')]('\x22\x22');}}}}if(_0xe64722[_0xe7d3('0x55')]){handleError(_0x2df78b[_0xe7d3('0x57')][_0x4839a1],{'code':_0xe7d3('0x63'),'message':_0xe64722[_0xe7d3('0x17')]()});}else{fs[_0xe7d3('0x64')](_0x4a72ef,_0x4b7bb1[_0xe7d3('0x17')]()+'\x0a');}_0x4b7bb1=[];}if(!(stats[_0xe7d3('0x65')]%0xc8)){socket[_0xe7d3('0x66')](_0xe7d3('0x67')+_0x2e1a8c,stats);stats[_0xe7d3('0x56')]=[];}}if(stopped){logger[_0xe7d3('0x4a')](_0xe7d3('0x68'));_0x48664b[_0xe7d3('0x69')]();}}catch(_0x1d7736){handleError(_0x2df78b['data'][_0x4839a1],{'code':_0xe7d3('0x6a'),'message':_0x1d7736['message']});logger['error'](_0xe7d3('0x6b'),_0x1d7736[_0xe7d3('0x45')]);}},'complete':function(){try{var _0x3f75cb=[];var _0x2aa550='cm_contacts';if(_0x35e7b5['duplicates']&&_0x35e7b5[_0xe7d3('0x6c')]['length']){_0x2aa550=_0xe7d3('0x6d')+_0x2e1a8c;_0x3f75cb['push'](_0xe7d3('0x6e')+_0x2aa550+_0xe7d3('0x6f'));}var _0x2d6879=util[_0xe7d3('0x10')](_0xe7d3('0x70'),_0x4a72ef,_0x2aa550,_0x39eebb,_0x35e7b5['ListId'],_0x35e7b5[_0xe7d3('0x3d')]||null,NOW,NOW);if(_['isNil'](_0x5e7702[_0xe7d3('0x26')])){_0x2d6879+=_0xe7d3('0x71');}_0x3f75cb['push'](_0x2d6879);if(_0x35e7b5['duplicates']&&_0x35e7b5['duplicates'][_0xe7d3('0x55')]){_0x3f75cb['push'](insertCmContact(_0x35e7b5[_0xe7d3('0x28')],_0x2aa550,_0x35e7b5['duplicates'],_0x5e7702));_0x3f75cb[_0xe7d3('0x46')](_0xe7d3('0x72')+_0x2aa550+';');}_0x3f75cb[_0xe7d3('0x46')](insertCmHopper(_0x35e7b5[_0xe7d3('0x28')],'voice_queues_has_cm_lists',_0xe7d3('0x73'),_0xe7d3('0x74'),_0x321983));_0x3f75cb[_0xe7d3('0x46')](insertCmHopperBlack(_0x35e7b5[_0xe7d3('0x28')],'voice_queues_has_cm_blacklists',_0xe7d3('0x73'),_0xe7d3('0x74')));_0x3f75cb['push'](insertCmHopper(_0x35e7b5[_0xe7d3('0x28')],'campaigns_has_cm_lists','campaigns',_0xe7d3('0x75'),_0x321983));_0x3f75cb[_0xe7d3('0x46')](insertCmHopperBlack(_0x35e7b5[_0xe7d3('0x28')],_0xe7d3('0x76'),_0xe7d3('0x77'),_0xe7d3('0x75')));BPromise[_0xe7d3('0x78')](_0x3f75cb,handleQuery)[_0xe7d3('0x79')](function(_0x3af65b){stats[_0xe7d3('0x7a')]=!![];stats[_0xe7d3('0x7b')]=_0x35e7b5['duplicates']&&_0x35e7b5[_0xe7d3('0x6c')][_0xe7d3('0x55')]?results[0x2][_0xe7d3('0x7b')]:results[0x0][_0xe7d3('0x7b')];socket[_0xe7d3('0x66')]('contact:import:'+_0x2e1a8c,stats);fs[_0xe7d3('0x7c')](_0x53a40b);fs['unlink'](_0x4a72ef);process[_0xe7d3('0x7d')](0x0);})['catch'](function(_0x50b146){logger[_0xe7d3('0x44')](_0x50b146['message']);process['exit'](0x1);});}catch(_0x46d300){logger['error'](_0xe7d3('0x7e'),_0x46d300[_0xe7d3('0x45')]);process[_0xe7d3('0x7d')](0x1);}},'error':function(_0x560e66,_0x55419a,_0x2c5daf,_0x445199){throw new Error(_0x445199);}});}function validate(){if(process['argv']&&process[_0xe7d3('0x7f')][_0xe7d3('0x55')]<0x4){throw new Error(_0xe7d3('0x80'));}var _0x5adfdc=path[_0xe7d3('0x17')](config[_0xe7d3('0x81')],_0xe7d3('0x4f'),process[_0xe7d3('0x7f')][0x2]);if(!fs[_0xe7d3('0x82')](_0x5adfdc)){throw new Error(_0xe7d3('0x83'));}var _0x3ce79b={};try{_0x3ce79b=JSON['parse'](process['argv'][0x3]);if(!_0x3ce79b['binding']){throw new Error(_0xe7d3('0x84'));}if(!_0x3ce79b[_0xe7d3('0x85')][_0xe7d3('0x15')]){throw new Error(_0xe7d3('0x86'));}if(!_0x3ce79b[_0xe7d3('0x85')]['firstName']){throw new Error(_0xe7d3('0x87'));}var _0x3bd57d=0x0;if(_0x3ce79b['binding'][_0xe7d3('0x2c')]){_0x3bd57d=0x1;}if(!_0x3ce79b[_0xe7d3('0x28')]){throw new Error(_0xe7d3('0x88'));}}catch(_0x23d416){throw new Error(_0xe7d3('0x89'));}var _0x142d85=[];try{_0x142d85=_['map'](JSON['parse'](process[_0xe7d3('0x7f')][0x4]),'id');}catch(_0x348489){logger[_0xe7d3('0x4a')]('No\x20agent\x20available');}main(_0x5adfdc,_0x3ce79b,_0x142d85,_0x3bd57d);}validate();process['on'](_0xe7d3('0x8a'),handleStop);process['on'](_0xe7d3('0x8b'),handleUncaughtException); \ No newline at end of file +var _0x1ab8=['../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','insert','into','cm_hopper_black','phone','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId','fields','id\x20IN\x20?','group','info','Received\x20SIGINT','error','exit','push','code','message','query','spread','catch','main','send','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','errors','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','length','SystemRow','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1ab8,0xf4));var _0x81ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1ab8[_0x1facfa];return _0x9ec701;};'use strict';var fs=require('fs');var path=require(_0x81ab('0x0'));var _=require(_0x81ab('0x1'));var Papa=require(_0x81ab('0x2'));var util=require(_0x81ab('0x3'));var BPromise=require(_0x81ab('0x4'));var moment=require(_0x81ab('0x5'));var squel=require(_0x81ab('0x6'));var Redis=require(_0x81ab('0x7'));var db=require(_0x81ab('0x8'))['db'];var config=require(_0x81ab('0x9'));var logger=require(_0x81ab('0xa'))(_0x81ab('0xb'));config[_0x81ab('0xc')]=_[_0x81ab('0xd')](config[_0x81ab('0xc')],{'host':_0x81ab('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81ab('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x81ab('0xf')](_0x81ab('0x10'));function isEmail(_0x4d8885){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x4d8885);}function selectNotIn(_0x43ef4c,_0x5c7e9b,_0x335e0e,_0x4bdf5d,_0x23fe94){return squel[_0x81ab('0x11')]()[_0x81ab('0x12')]('phone')[_0x81ab('0x13')](_0x4bdf5d)['join'](_0x5c7e9b,null,_0x5c7e9b+_0x81ab('0x14')+_0x4bdf5d+'.'+_0x335e0e)[_0x81ab('0x15')](_0x4bdf5d+'.'+_0x335e0e+_0x81ab('0x16')+_0x43ef4c+'.'+_0x335e0e)[_0x81ab('0x15')](_0x5c7e9b+_0x81ab('0x17')+_0x23fe94['join']()+')');}function insertCmHopper(_0x112d7e,_0x38b207,_0x56a028,_0x4556f0,_0x313f87){var _0x33e848=[_0x81ab('0x18'),_0x81ab('0x19'),_0x81ab('0x1a'),'cm_contacts.ListId',_0x38b207+'.'+_0x4556f0,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x81ab('0x1b'),'cm_contacts.UserId','\x22'+_0x313f87+'\x22'];return squel['insert']()['into'](_0x81ab('0x1c'))[_0x81ab('0x1d')](['phone',_0x81ab('0x1e'),_0x81ab('0x1f'),_0x81ab('0x20'),_0x4556f0,_0x81ab('0x21'),_0x81ab('0x22'),_0x81ab('0x23'),_0x81ab('0x24'),_0x81ab('0x25')],squel[_0x81ab('0x11')]()['fields'](_0x33e848)[_0x81ab('0x13')](_0x38b207)[_0x81ab('0x26')](_0x81ab('0x27'),null,_0x81ab('0x28')+_0x38b207+_0x81ab('0x29'))[_0x81ab('0x26')](_0x56a028,null,_0x56a028+'.id\x20=\x20'+_0x38b207+'.'+_0x4556f0)[_0x81ab('0x15')](_0x38b207+_0x81ab('0x2a'),_0x112d7e)[_0x81ab('0x15')](_0x81ab('0x2b'),NOW)[_0x81ab('0x15')](_0x81ab('0x2c'),selectNotIn(_0x38b207,_0x56a028,_0x4556f0,_0x81ab('0x1c'),[_0x81ab('0x2d'),'\x22onlyIfOpen\x22']))[_0x81ab('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x38b207,_0x56a028,_0x4556f0,_0x81ab('0x1c'),[_0x81ab('0x2d')])))[_0x81ab('0x2e')]();}function insertCmHopperBlack(_0x22cfd5,_0x6b092b,_0x49e340,_0xc52c0){var _0x17bee4=[_0x81ab('0x18'),_0x81ab('0x1a'),_0x81ab('0x2f'),_0x6b092b+'.'+_0xc52c0,'cm_contacts.createdAt',_0x81ab('0x30')];return squel[_0x81ab('0x31')]()[_0x81ab('0x32')](_0x81ab('0x33'))[_0x81ab('0x1d')]([_0x81ab('0x34'),_0x81ab('0x1f'),_0x81ab('0x20'),_0xc52c0,_0x81ab('0x21'),'updatedAt'],squel[_0x81ab('0x11')]()['fields'](_0x17bee4)[_0x81ab('0x13')](_0x6b092b)['join'](_0x81ab('0x27'),null,_0x81ab('0x28')+_0x6b092b+_0x81ab('0x29'))[_0x81ab('0x26')](_0x49e340,null,_0x49e340+'.id\x20=\x20'+_0x6b092b+'.'+_0xc52c0)[_0x81ab('0x15')](_0x6b092b+_0x81ab('0x2a'),_0x22cfd5)[_0x81ab('0x15')](_0x81ab('0x2b'),NOW)[_0x81ab('0x15')](_0x81ab('0x2c'),squel['select']()[_0x81ab('0x12')](_0x81ab('0x34'))[_0x81ab('0x13')](_0x81ab('0x33'))[_0x81ab('0x15')](_0x81ab('0x35'),_0x22cfd5)[_0x81ab('0x15')](_0xc52c0+_0x81ab('0x36'),_0x6b092b+'.'+_0xc52c0)))[_0x81ab('0x2e')]();}function insertCmContact(_0x1461e5,_0x12706c,_0x465664,_0x233caf){var _0x13b896=_['concat'](_[_0x81ab('0x37')](_0x233caf),[_0x81ab('0x20'),_0x81ab('0x38'),_0x81ab('0x21'),_0x81ab('0x22')]);return squel[_0x81ab('0x31')]()['into'](_0x81ab('0x27'))[_0x81ab('0x1d')](_0x13b896,squel['select']()[_0x81ab('0x39')](_0x13b896)[_0x81ab('0x13')](_0x12706c)[_0x81ab('0x15')]('('+_0x465664[_0x81ab('0x26')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x81ab('0x39')](_0x465664)[_0x81ab('0x13')](_0x81ab('0x27'))[_0x81ab('0x15')](_0x81ab('0x35'),_0x1461e5)[_0x81ab('0x15')]('deletedAt\x20IS\x20NULL'))['where'](_0x81ab('0x3a'),squel['select']()[_0x81ab('0x12')]('MIN(id)','min_id')[_0x81ab('0x13')](_0x12706c)[_0x81ab('0x3b')](_0x465664[_0x81ab('0x26')](','))))[_0x81ab('0x2e')]();}function handleStop(){logger[_0x81ab('0x3c')](_0x81ab('0x3d'));stopped=!![];}function handleUncaughtException(_0x3557f1){logger[_0x81ab('0x3e')](_0x3557f1['message']);process[_0x81ab('0x3f')](0x1);}function handleError(_0x2cc73c,_0x37bd8f){stats['errors'][_0x81ab('0x40')]({'name':_0x37bd8f[_0x81ab('0x41')],'message':_0x37bd8f[_0x81ab('0x42')],'row':_0x2cc73c});}function handleQuery(_0x2f014a){logger[_0x81ab('0x3c')](_0x2f014a);return db['sequelize'][_0x81ab('0x43')](_0x2f014a)[_0x81ab('0x44')](function(_0x538799){results[_0x81ab('0x40')](_0x538799);})[_0x81ab('0x45')](function(_0x1d50f4){logger[_0x81ab('0x3e')](_0x1d50f4[_0x81ab('0x42')]);});}function main(_0x2b8726,_0x46222f,_0x1bd877,_0xe774cc){logger[_0x81ab('0x3c')](_0x81ab('0x46'),_0x2b8726,JSON['stringify'](_0x46222f));process[_0x81ab('0x47')]('start');var _0x3e947d=_0x46222f[_0x81ab('0x48')];var _0x18fad3=_0x46222f['socket_timestamp'];var _0x10e5dc=path[_0x81ab('0x26')](config[_0x81ab('0x49')],_0x81ab('0x4a'),_0x18fad3+_0x81ab('0x4b'));var _0x6fca00=_['keys'](_0x3e947d)[_0x81ab('0x26')]();logger[_0x81ab('0x3c')](_0x81ab('0x4c'),_0x6fca00);fs[_0x81ab('0x4d')](_0x10e5dc,_0x6fca00+'\x0a');Papa[_0x81ab('0x4e')](fs[_0x81ab('0x4f')](_0x2b8726),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4918c8,_0x2822d6){try{for(var _0x54001c=0x0,_0x51aab6=[];_0x54001c<_0x4918c8[_0x81ab('0x50')]['length'];_0x54001c++){stats['rows']+=0x1;if(_0x4918c8[_0x81ab('0x51')][_0x54001c]){handleError(_0x4918c8['data'][_0x54001c],_0x4918c8[_0x81ab('0x51')][_0x54001c]);}else{var _0x3e376c=[];for(var _0x5c95c4 in _0x3e947d){if(_0x3e947d[_0x81ab('0x52')](_0x5c95c4)){if(_0x4918c8[_0x81ab('0x50')][_0x54001c][_0x3e947d[_0x5c95c4]]){var _0x607800=_[_0x81ab('0x53')](_0x4918c8['data'][_0x54001c][_0x3e947d[_0x5c95c4]]['replace'](/"/g,'\x27'));switch(_0x5c95c4){case _0x81ab('0x1e'):var _0xa8c477=moment(_0x607800,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xa8c477[_0x81ab('0x54')]()){_0x51aab6[_0x81ab('0x40')]('\x22'+_0x607800+'\x22');}else{_0x3e376c[_0x81ab('0x40')](_0x81ab('0x55'));}break;case _0x81ab('0x23'):var _0x3cea94=parseInt(_0x607800);_0x607800=_[_0x81ab('0x56')](_0x3cea94)||_0x3cea94<0x0||_0x3cea94>0x4?_0xe774cc?0x3:0x2:_0x3cea94;_0x51aab6[_0x81ab('0x40')]('\x22'+_0x607800+'\x22');break;case _0x81ab('0x24'):var _0x1f705e=parseInt(_0x607800);if(_[_0x81ab('0x57')](_0x1f705e)&&_['includes'](_0x1bd877,_0x1f705e)){_0x51aab6[_0x81ab('0x40')]('\x22'+_0x1f705e+'\x22');}else{_0x3e376c[_0x81ab('0x40')](_0x81ab('0x58'));}break;case _0x81ab('0x59'):if(isEmail(_0x607800)){_0x51aab6['push']('\x22'+_0x607800+'\x22');}else{_0x3e376c[_0x81ab('0x40')]('email\x20wrong\x20format');}break;case _0x81ab('0x5a'):var _0x1b3dcb=moment(_0x607800,_0x81ab('0x5b'),!![]);if(_0x1b3dcb[_0x81ab('0x54')]()){_0x51aab6['push']('\x22'+_0x607800+'\x22');}else{_0x3e376c[_0x81ab('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x51aab6[_0x81ab('0x40')]('\x22'+_0x607800+'\x22');}}else{switch(_0x5c95c4){case _0x81ab('0x5c'):case'phone':_0x3e376c['push'](_0x5c95c4+_0x81ab('0x5d'));break;default:_0x51aab6[_0x81ab('0x40')]('\x22\x22');}}}}if(_0x3e376c[_0x81ab('0x5e')]){handleError(_0x4918c8['data'][_0x54001c],{'code':_0x81ab('0x5f'),'message':_0x3e376c[_0x81ab('0x26')]()});}else{fs['appendFileSync'](_0x10e5dc,_0x51aab6[_0x81ab('0x26')]()+'\x0a');}_0x51aab6=[];}if(!(stats['rows']%0xc8)){socket[_0x81ab('0x60')](_0x81ab('0x61')+_0x18fad3,stats);stats[_0x81ab('0x51')]=[];}}if(stopped){logger[_0x81ab('0x3c')](_0x81ab('0x62'));_0x2822d6['abort']();}}catch(_0x114b31){handleError(_0x4918c8[_0x81ab('0x50')][_0x54001c],{'code':_0x81ab('0x63'),'message':_0x114b31[_0x81ab('0x42')]});logger[_0x81ab('0x3e')](_0x81ab('0x64'),_0x114b31[_0x81ab('0x42')]);}},'complete':function(){try{var _0x4fae88=[];var _0x593e19=_0x81ab('0x27');if(_0x46222f[_0x81ab('0x65')]&&_0x46222f['duplicates'][_0x81ab('0x5e')]){_0x593e19=_0x81ab('0x66')+_0x18fad3;_0x4fae88[_0x81ab('0x40')](_0x81ab('0x67')+_0x593e19+_0x81ab('0x68'));}var _0x4e5a55=util[_0x81ab('0xf')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x10e5dc,_0x593e19,_0x6fca00,_0x46222f[_0x81ab('0x20')],_0x46222f['CompanyId']||null,NOW,NOW);if(_[_0x81ab('0x69')](_0x3e947d[_0x81ab('0x1e')])){_0x4e5a55+=_0x81ab('0x6a');}_0x4fae88[_0x81ab('0x40')](_0x4e5a55);if(_0x46222f['duplicates']&&_0x46222f['duplicates'][_0x81ab('0x5e')]){_0x4fae88[_0x81ab('0x40')](insertCmContact(_0x46222f[_0x81ab('0x20')],_0x593e19,_0x46222f[_0x81ab('0x65')],_0x3e947d));_0x4fae88[_0x81ab('0x40')](_0x81ab('0x6b')+_0x593e19+';');}_0x4fae88['push'](insertCmHopper(_0x46222f[_0x81ab('0x20')],_0x81ab('0x6c'),'voice_queues','VoiceQueueId',_0xe774cc));_0x4fae88[_0x81ab('0x40')](insertCmHopperBlack(_0x46222f[_0x81ab('0x20')],_0x81ab('0x6d'),_0x81ab('0x6e'),_0x81ab('0x6f')));_0x4fae88[_0x81ab('0x40')](insertCmHopper(_0x46222f[_0x81ab('0x20')],_0x81ab('0x70'),_0x81ab('0x71'),_0x81ab('0x72'),_0xe774cc));_0x4fae88['push'](insertCmHopperBlack(_0x46222f['ListId'],_0x81ab('0x73'),_0x81ab('0x71'),'CampaignId'));BPromise[_0x81ab('0x74')](_0x4fae88,handleQuery)['then'](function(_0x4227c0){stats['finish']=!![];stats[_0x81ab('0x75')]=_0x46222f['duplicates']&&_0x46222f['duplicates'][_0x81ab('0x5e')]?results[0x2][_0x81ab('0x75')]:results[0x0]['affectedRows'];socket[_0x81ab('0x60')](_0x81ab('0x61')+_0x18fad3,stats);fs[_0x81ab('0x76')](_0x2b8726);fs['unlink'](_0x10e5dc);process['exit'](0x0);})[_0x81ab('0x45')](function(_0xc706ab){logger[_0x81ab('0x3e')](_0xc706ab['message']);process[_0x81ab('0x3f')](0x1);});}catch(_0x130c96){logger[_0x81ab('0x3e')](_0x81ab('0x77'),_0x130c96['message']);process[_0x81ab('0x3f')](0x1);}},'error':function(_0x4070af,_0x9201a5,_0x52f7c0,_0x11bab0){throw new Error(_0x11bab0);}});}function validate(){if(process[_0x81ab('0x78')]&&process[_0x81ab('0x78')][_0x81ab('0x5e')]<0x4){throw new Error(_0x81ab('0x79'));}var _0x43f86c=path['join'](config['root'],_0x81ab('0x4a'),process[_0x81ab('0x78')][0x2]);if(!fs[_0x81ab('0x7a')](_0x43f86c)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x4a0215={};try{_0x4a0215=JSON['parse'](process[_0x81ab('0x78')][0x3]);if(!_0x4a0215[_0x81ab('0x48')]){throw new Error(_0x81ab('0x7b'));}if(!_0x4a0215['binding'][_0x81ab('0x34')]){throw new Error(_0x81ab('0x7c'));}if(!_0x4a0215['binding'][_0x81ab('0x5c')]){throw new Error(_0x81ab('0x7d'));}var _0xfe6588=0x0;if(_0x4a0215['binding']['UserId']){_0xfe6588=0x1;}if(!_0x4a0215['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x42d80b){throw new Error('body\x20id\x20mandatory');}var _0x1e7bf2=[];try{_0x1e7bf2=_[_0x81ab('0x7e')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x4ada60){logger[_0x81ab('0x3c')]('No\x20agent\x20available');}main(_0x43f86c,_0x4a0215,_0x1e7bf2,_0xfe6588);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7f2bd25..d864a64 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02fc=['Agent\x20Complete','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Ring','Agent\x20Connect','agentconnectAt'];(function(_0x19dae4,_0x460eef){var _0x403c38=function(_0x5452df){while(--_0x5452df){_0x19dae4['push'](_0x19dae4['shift']());}};_0x403c38(++_0x460eef);}(_0x02fc,0x124));var _0xc02f=function(_0x1dd7a4,_0x2439eb){_0x1dd7a4=_0x1dd7a4-0x0;var _0x3d04f0=_0x02fc[_0x1dd7a4];return _0x3d04f0;};'use strict';exports[_0xc02f('0x0')]=function(_0x5aba1d,_0x2911fe){var _0x371d64=[{'type':_0xc02f('0x1'),'content':_0xc02f('0x2'),'variableName':null}];switch(_0x5aba1d[_0xc02f('0x3')]()){case _0xc02f('0x4'):switch(_0x2911fe['toLowerCase']()){case _0xc02f('0x5'):_0x371d64['push']({'type':_0xc02f('0x6'),'content':'','variableName':_0xc02f('0x7')});_0x371d64[_0xc02f('0x8')]({'type':_0xc02f('0x6'),'content':'','variableName':_0xc02f('0x9')});break;case _0xc02f('0xa'):_0x371d64['push']({'type':_0xc02f('0x1'),'content':_0xc02f('0xb'),'variableName':null});_0x371d64[_0xc02f('0x8')]({'type':'variable','content':'','variableName':_0xc02f('0xc')});break;}}return _0x371d64;};exports[_0xc02f('0xd')]=function(_0x408622,_0x1b7285){var _0x2b4ea6=[];switch(_0x408622['toLowerCase']()){case _0xc02f('0x4'):switch(_0x1b7285[_0xc02f('0x3')]()){case'inbound':_0x2b4ea6=[{'type':'string','content':_0xc02f('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x10'),'keyType':'variable','variableName':_0xc02f('0x9')},{'type':'keyValue','content':'','key':_0xc02f('0x11'),'keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x12')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x13'),'keyType':_0xc02f('0x6'),'variableName':'destexten'},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x14'),'keyType':'variable','variableName':_0xc02f('0x7')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x15'),'keyType':_0xc02f('0x6'),'variableName':'uniqueid'},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x16'),'keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x17')},{'type':_0xc02f('0x1'),'content':_0xc02f('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc02f('0x19'),'keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x1a')},{'type':_0xc02f('0xf'),'content':'','key':'Agent\x20Number','keyType':_0xc02f('0x6'),'variableName':_0xc02f('0xc')},{'type':_0xc02f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc02f('0x1b'),'keyType':'variable','variableName':_0xc02f('0x17')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x1c'),'keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x1d')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x1e'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x1f'),'keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x20')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xc02f('0x6'),'variableName':_0xc02f('0x21')}];break;case'outbound':_0x2b4ea6=[{'type':_0xc02f('0x1'),'content':_0xc02f('0xe'),'variableName':null},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x22'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x23'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x24')},{'type':'keyValue','content':'','key':_0xc02f('0x15'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x25')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x16'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x26')},{'type':_0xc02f('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x27'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x28')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x29'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x2a')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x2b'),'keyType':_0xc02f('0x6'),'keyContent':'','variableName':_0xc02f('0x2c')},{'type':_0xc02f('0xf'),'content':'','key':_0xc02f('0x2d'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x2b4ea6;}; \ No newline at end of file +var _0x917f=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','holdtime','outbound','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','toLowerCase','voice','inbound','push','variable','queue','calleridnum','string','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x843151,_0x172e4c){var _0xd88526=function(_0x2af39e){while(--_0x2af39e){_0x843151['push'](_0x843151['shift']());}};_0xd88526(++_0x172e4c);}(_0x917f,0x1e5));var _0xf917=function(_0x57f4ef,_0x141375){_0x57f4ef=_0x57f4ef-0x0;var _0xea5aad=_0x917f[_0x57f4ef];return _0xea5aad;};'use strict';exports['getSubjects']=function(_0x49123e,_0x4e3f5b){var _0x17c35a=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x49123e[_0xf917('0x0')]()){case _0xf917('0x1'):switch(_0x4e3f5b[_0xf917('0x0')]()){case _0xf917('0x2'):_0x17c35a[_0xf917('0x3')]({'type':_0xf917('0x4'),'content':'','variableName':_0xf917('0x5')});_0x17c35a['push']({'type':_0xf917('0x4'),'content':'','variableName':_0xf917('0x6')});break;case'outbound':_0x17c35a[_0xf917('0x3')]({'type':_0xf917('0x7'),'content':'Outbound\x20Call','variableName':null});_0x17c35a['push']({'type':_0xf917('0x4'),'content':'','variableName':_0xf917('0x8')});break;}}return _0x17c35a;};exports[_0xf917('0x9')]=function(_0x28acba,_0x5835bc){var _0x394863=[];switch(_0x28acba['toLowerCase']()){case'voice':switch(_0x5835bc[_0xf917('0x0')]()){case'inbound':_0x394863=[{'type':'string','content':_0xf917('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0xf917('0xb'),'content':'','key':'Caller\x20Number','keyType':_0xf917('0x4'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0xf917('0x4'),'variableName':_0xf917('0xc')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0xd'),'keyType':_0xf917('0x4'),'variableName':_0xf917('0xe')},{'type':_0xf917('0xb'),'content':'','key':'Queue','keyType':'variable','variableName':_0xf917('0x5')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0xf'),'keyType':_0xf917('0x4'),'variableName':_0xf917('0x10')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x11'),'keyType':_0xf917('0x4'),'variableName':_0xf917('0x12')},{'type':_0xf917('0x7'),'content':_0xf917('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x14'),'keyType':_0xf917('0x4'),'variableName':_0xf917('0x15')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x16'),'keyType':_0xf917('0x4'),'variableName':'destcalleridnum'},{'type':_0xf917('0x7'),'content':_0xf917('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0xf917('0x4'),'variableName':_0xf917('0x12')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x18'),'keyType':_0xf917('0x4'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0xf917('0x19'),'keyType':_0xf917('0x4'),'variableName':_0xf917('0x1a')},{'type':_0xf917('0xb'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0xf917('0x1b')},{'type':_0xf917('0xb'),'content':'','key':'Talk\x20Time','keyType':_0xf917('0x4'),'variableName':'talktime'}];break;case _0xf917('0x1c'):_0x394863=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x8')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x1d'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x1e')},{'type':'keyValue','content':'','key':_0xf917('0xf'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf917('0x11'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x1f')},{'type':'string','content':_0xf917('0x17')},{'type':'keyValue','content':'','key':_0xf917('0x20'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':'answertime'},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x21'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x22')},{'type':_0xf917('0xb'),'content':'','key':_0xf917('0x23'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x24')},{'type':'keyValue','content':'','key':_0xf917('0x25'),'keyType':_0xf917('0x4'),'keyContent':'','variableName':_0xf917('0x26')}];break;}}return _0x394863;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a4f688a..ed735e3 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf94d=['error','tracked','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update','catch'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0xf94d,0x18a));var _0xdf94=function(_0x5ac7d1,_0x3011ff){_0x5ac7d1=_0x5ac7d1-0x0;var _0x46bb0a=_0xf94d[_0x5ac7d1];return _0x46bb0a;};'use strict';var _=require(_0xdf94('0x0'));var db=require(_0xdf94('0x1'))['db'];var loggers={'openchannel':require(_0xdf94('0x2'))(_0xdf94('0x3')),'mail':require(_0xdf94('0x2'))(_0xdf94('0x4')),'fax':require(_0xdf94('0x2'))(_0xdf94('0x5')),'sms':require('../../config/logger')(_0xdf94('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xdf94('0x2'))(_0xdf94('0x7'))};function getInteractionId(_0x445eb2,_0x33a5fe,_0x25ecef){if(_0x445eb2&&_0x445eb2[_[_0xdf94('0x8')](_0x25ecef)+_0xdf94('0x9')]){return _0x445eb2[_['upperFirst'](_0x25ecef)+_0xdf94('0x9')];}else if(_0x445eb2&&_0x445eb2['id']){return _0x445eb2['id'];}else if(_0x33a5fe&&_0x33a5fe['id']){return _0x33a5fe['id'];}else{return _0xdf94('0xa');}}function log(_0x13b185,_0x2fedf0,_0xd10e05,_0x454bbf,_0x56c5ca,_0x346792){loggers[_0x56c5ca[_0xdf94('0xb')]()][_0x13b185](_0xdf94('0xc'),_0x346792[_0xdf94('0xd')](),_0x2fedf0?_0x2fedf0['id']:null,_0x2fedf0?_0x2fedf0[_0xdf94('0xe')]:null,_0x2fedf0?_0x2fedf0[_0xdf94('0xf')]:null,getInteractionId(_0xd10e05,_0x454bbf,_0x56c5ca),_0xd10e05?JSON[_0xdf94('0x10')](_0xd10e05):_0xdf94('0x11'));}function updateUser(_0x124465,_0xb9ce9,_0x2f51ce,_0x46881d,_0x2c2a1f){db[_[_0xdf94('0x8')](_0x46881d)+'Interaction'][_0xdf94('0x12')]({'where':{'id':getInteractionId(_0xb9ce9,_0x2f51ce,_0x46881d)}})[_0xdf94('0x13')](function(_0x59e444){if(_0x59e444){return _0x59e444[_0xdf94('0x14')]({'UserId':_0x124465?_0x124465['id']:null});}})[_0xdf94('0x13')](function(_0x108c51){if(_0x108c51){log('info',_0x124465,_0xb9ce9,_0x2f51ce,_0x46881d,_0x2c2a1f);}})[_0xdf94('0x15')](function(){log(_0xdf94('0x16'),_0x124465,_0xb9ce9,_0x2f51ce,_0x46881d,_0x2c2a1f);});}exports[_0xdf94('0x17')]=function(_0x2f4db0,_0x3b26f1){return function(_0x306682,_0x5cde38,_0x435fe9){var _0x51f45d=_0x306682['user'];var _0x2e4185={};var _0x25f6ea=_0x306682[_0xdf94('0x18')];if(_0x2e4185){_0x2e4185=_[_0xdf94('0x19')](_0x306682[_0xdf94('0x1a')]);_0x2e4185=_[_0xdf94('0x1b')](_0x2e4185,[_0xdf94('0x1a'),_0xdf94('0x1c'),_0xdf94('0x1d'),_0xdf94('0x1e'),_0xdf94('0x1f')]);}updateUser(_0x51f45d,_0x2e4185,_0x25f6ea,_0x2f4db0,_0x3b26f1);_0x435fe9(null);};}; \ No newline at end of file +var _0x57fb=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','update','then','catch','error','tracked','user','clone','body','html','phone','mobile','../../config/logger','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown'];(function(_0x19166e,_0x38bfc7){var _0x26a01e=function(_0x387a9b){while(--_0x387a9b){_0x19166e['push'](_0x19166e['shift']());}};_0x26a01e(++_0x38bfc7);}(_0x57fb,0x90));var _0xb57f=function(_0x2678a9,_0x40d822){_0x2678a9=_0x2678a9-0x0;var _0x143dba=_0x57fb[_0x2678a9];return _0x143dba;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xb57f('0x0'))('openchannel-interactions'),'mail':require(_0xb57f('0x0'))('mail-interactions'),'fax':require('../../config/logger')(_0xb57f('0x1')),'sms':require(_0xb57f('0x0'))('sms-interactions'),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xb57f('0x0'))(_0xb57f('0x2'))};function getInteractionId(_0x44fba9,_0x958a4d,_0x1e0867){if(_0x44fba9&&_0x44fba9[_[_0xb57f('0x3')](_0x1e0867)+_0xb57f('0x4')]){return _0x44fba9[_[_0xb57f('0x3')](_0x1e0867)+_0xb57f('0x4')];}else if(_0x44fba9&&_0x44fba9['id']){return _0x44fba9['id'];}else if(_0x958a4d&&_0x958a4d['id']){return _0x958a4d['id'];}else{return _0xb57f('0x5');}}function log(_0xd0cb35,_0x2d570a,_0x1b8892,_0x7948f0,_0x3747f3,_0x3129b8){loggers[_0x3747f3['toLowerCase']()][_0xd0cb35](_0xb57f('0x6'),_0x3129b8[_0xb57f('0x7')](),_0x2d570a?_0x2d570a['id']:null,_0x2d570a?_0x2d570a[_0xb57f('0x8')]:null,_0x2d570a?_0x2d570a[_0xb57f('0x9')]:null,getInteractionId(_0x1b8892,_0x7948f0,_0x3747f3),_0x1b8892?JSON[_0xb57f('0xa')](_0x1b8892):_0xb57f('0xb'));}function updateUser(_0x4ccb5d,_0x507962,_0x49a646,_0x5ce03e,_0x14d7f0){db[_[_0xb57f('0x3')](_0x5ce03e)+_0xb57f('0xc')][_0xb57f('0xd')]({'where':{'id':getInteractionId(_0x507962,_0x49a646,_0x5ce03e)}})['then'](function(_0x8aac4e){if(_0x8aac4e){return _0x8aac4e[_0xb57f('0xe')]({'UserId':_0x4ccb5d?_0x4ccb5d['id']:null});}})[_0xb57f('0xf')](function(_0x4b0f44){if(_0x4b0f44){log('info',_0x4ccb5d,_0x507962,_0x49a646,_0x5ce03e,_0x14d7f0);}})[_0xb57f('0x10')](function(){log(_0xb57f('0x11'),_0x4ccb5d,_0x507962,_0x49a646,_0x5ce03e,_0x14d7f0);});}exports[_0xb57f('0x12')]=function(_0x1405b0,_0x15039d){return function(_0x397c44,_0x46292b,_0x3b8149){var _0x2156b4=_0x397c44[_0xb57f('0x13')];var _0x95984c={};var _0x3fa314=_0x397c44['query'];if(_0x95984c){_0x95984c=_[_0xb57f('0x14')](_0x397c44[_0xb57f('0x15')]);_0x95984c=_['omit'](_0x95984c,['body',_0xb57f('0x16'),_0xb57f('0x17'),'fax',_0xb57f('0x18')]);}updateUser(_0x2156b4,_0x95984c,_0x3fa314,_0x1405b0,_0x15039d);_0x3b8149(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index f0641e9..4639255 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc28e=['final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','%s:%s:%s','base64','utf8'];(function(_0x590d3c,_0x165691){var _0x1e5389=function(_0x1d597c){while(--_0x1d597c){_0x590d3c['push'](_0x590d3c['shift']());}};_0x1e5389(++_0x165691);}(_0xc28e,0x1af));var _0xec28=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xc28e[_0x245afe];return _0x4eefde;};'use strict';var crypto=require(_0xec28('0x0'));var util=require(_0xec28('0x1'));var compose=require(_0xec28('0x2'));var db=require(_0xec28('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x50a033,_0x470027){if(_0x50a033&&_0x470027){if(_0x470027[_0xec28('0x4')]&&_0x470027[_0xec28('0x5')]){var _0x24f2a7=_0x470027[_0xec28('0x4')];var _0x96b15b=_0x470027[_0xec28('0x5')];var _0x5ad27a=_0x24f2a7[_0xec28('0x6')]('-')[0x4];var _0x353aee=_0x24f2a7['split']('-')[0x0];var _0x361c69=crypto['createDecipher'](_0xec28('0x7'),util['format'](_0xec28('0x8'),_0x5ad27a,_0x24f2a7,_0x353aee));var _0x57c41f=_0x361c69['update'](_0x96b15b,_0xec28('0x9'),_0xec28('0xa'));_0x57c41f+=_0x361c69[_0xec28('0xb')](_0xec28('0xa'));var _0x2c614c=JSON[_0xec28('0xc')](_0x57c41f);return _0x2c614c[_0xec28('0xd')](_0x50a033)?_0x2c614c[_0x50a033]:null;}}return null;}function isLimit(_0x217ea5,_0x1049a0,_0x25466f,_0x5bd9fd){var _0x150f14=_0x1049a0;return compose()[_0xec28('0xe')](function(_0x2f582e,_0x15554a,_0x53e1f5){return db['License'][_0xec28('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xec28('0x10')](function(_0x2ce43d){var _0x33eb14=getValueFromLicense(_0x217ea5,_0x2ce43d);return _0x33eb14?_0x33eb14:_0x150f14;})[_0xec28('0x10')](function(_0x5bd95f){_0x150f14=_0x5bd95f;return _0x25466f[_0xec28('0x11')](_0x5bd9fd);})['then'](function(_0x2c6eb2){if(_0x2c6eb2>=_0x150f14){return _0x15554a[_0xec28('0x12')](0x193)[_0xec28('0x13')]({'message':util['format'](_0xec28('0x14'),_0x217ea5)});}_0x53e1f5();})[_0xec28('0x15')](function(_0x215b8d){_0x53e1f5(_0x215b8d);});});}function isUserLimit(){return isLimit(_0xec28('0x16'),0x1,db[_0xec28('0x17')],{'where':{'$or':[{'role':_0xec28('0x18')},{'role':_0xec28('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x3209=['status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','isUserLimit','crypto','util','../../mysqldb','../../config/environment','license','data1','split','format','%s:%s:%s','base64','utf8','final','hasOwnProperty','use','License','findOne','then','count'];(function(_0x2ba69c,_0x1f9608){var _0x1445b4=function(_0x509e2e){while(--_0x509e2e){_0x2ba69c['push'](_0x2ba69c['shift']());}};_0x1445b4(++_0x1f9608);}(_0x3209,0x7e));var _0x9320=function(_0x3ca34b,_0x221983){_0x3ca34b=_0x3ca34b-0x0;var _0x527bef=_0x3209[_0x3ca34b];return _0x527bef;};'use strict';var crypto=require(_0x9320('0x0'));var util=require(_0x9320('0x1'));var compose=require('composable-middleware');var db=require(_0x9320('0x2'))['db'];var config=require(_0x9320('0x3'));function getValueFromLicense(_0x146a6b,_0x3e5d93){if(_0x146a6b&&_0x3e5d93){if(_0x3e5d93['data1']&&_0x3e5d93[_0x9320('0x4')]){var _0x49a6f5=_0x3e5d93[_0x9320('0x5')];var _0x5d7897=_0x3e5d93[_0x9320('0x4')];var _0x24c6ae=_0x49a6f5[_0x9320('0x6')]('-')[0x4];var _0x4de44e=_0x49a6f5[_0x9320('0x6')]('-')[0x0];var _0x40fd64=crypto['createDecipher']('aes-256-ctr',util[_0x9320('0x7')](_0x9320('0x8'),_0x24c6ae,_0x49a6f5,_0x4de44e));var _0x587c10=_0x40fd64['update'](_0x5d7897,_0x9320('0x9'),_0x9320('0xa'));_0x587c10+=_0x40fd64[_0x9320('0xb')](_0x9320('0xa'));var _0xcd0739=JSON['parse'](_0x587c10);return _0xcd0739[_0x9320('0xc')](_0x146a6b)?_0xcd0739[_0x146a6b]:null;}}return null;}function isLimit(_0x25947b,_0x530aee,_0xaab975,_0x34a4b7){var _0x33cd33=_0x530aee;return compose()[_0x9320('0xd')](function(_0x233494,_0xa466cd,_0x48708e){return db[_0x9320('0xe')][_0x9320('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x9320('0x10')](function(_0x1b649e){var _0x39ee14=getValueFromLicense(_0x25947b,_0x1b649e);return _0x39ee14?_0x39ee14:_0x33cd33;})[_0x9320('0x10')](function(_0x433655){_0x33cd33=_0x433655;return _0xaab975[_0x9320('0x11')](_0x34a4b7);})[_0x9320('0x10')](function(_0x4195c7){if(_0x4195c7>=_0x33cd33){return _0xa466cd[_0x9320('0x12')](0x193)[_0x9320('0x13')]({'message':util[_0x9320('0x7')](_0x9320('0x14'),_0x25947b)});}_0x48708e();})['catch'](function(_0x54dcf2){_0x48708e(_0x54dcf2);});});}function isUserLimit(){return isLimit(_0x9320('0x15'),0x1,db[_0x9320('0x16')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x9320('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 278a0ef..1ac4d10 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc604=['parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','slice','forEach','filter','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','$lt','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','hours','minutes','seconds','lodash'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0xc604,0x179));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c60('0x0'));var moment=require('moment');exports[_0x4c60('0x1')]=function(_0x224765){var _0x3d6062={'conditions':[]};_0x3d6062[_0x4c60('0x2')]=_[_0x4c60('0x3')](_0x224765,_0x4c60('0x4'))?'or':'and';var _0x52c063=_0x224765[_0x4c60('0x5')]('[$and]','')[_0x4c60('0x5')](_0x4c60('0x4'),'')[_0x4c60('0x6')]('||');for(var _0x5a7cff=0x0;_0x5a7cff<_0x52c063[_0x4c60('0x7')];_0x5a7cff++){var _0x2d9e38=_0x52c063[_0x5a7cff][_0x4c60('0x6')](':=');var _0xf71ac3=_0x2d9e38[0x0];var _0x2bab72=_0x2d9e38[_0x4c60('0x8')](0x1);_0x2bab72[_0x4c60('0x9')](function(_0x2b10b6){var _0x138838=_0x2b10b6[_0x4c60('0x6')]('[')['shift']();var _0x414eae=_0x2b10b6['match'](/\[(.*?)\]/g);_0x414eae[_0x4c60('0x9')](function(_0x24b646){var _0x2ba054=_0x24b646['split']('[')[_0x4c60('0xa')](function(_0x2141dd){return _0x2141dd['indexOf'](']')>-0x1;})[_0x4c60('0xb')](function(_0x145bbc){return _0x145bbc[_0x4c60('0x6')](']')[0x0];})[0x0];_0x3d6062[_0x4c60('0xc')][_0x4c60('0xd')]({'field':_0xf71ac3,'operator':_0x138838,'value':_0x2ba054});});});}return _0x3d6062;};exports[_0x4c60('0xe')]=function(_0x83cb90,_0x25c6aa,_0x36b87c){var _0x11e276={};if(_0x25c6aa===_0x4c60('0xf')){if(_0x36b87c[_0x4c60('0x10')]===_0x4c60('0x11')){_0x36b87c[_0x4c60('0x10')]=_0x4c60('0x12');_0x36b87c[_0x4c60('0x13')]+=','+_0x36b87c[_0x4c60('0x13')];}else if(_['includes'](['$gt',_0x4c60('0x14')],_0x36b87c[_0x4c60('0x10')])){_0x36b87c[_0x4c60('0x13')]=moment(_0x36b87c[_0x4c60('0x13')])[_0x4c60('0x15')](0x1,_0x4c60('0x16'))[_0x4c60('0x17')](_0x4c60('0x18'));}}if(_0x36b87c[_0x4c60('0x19')]){_0x25c6aa=_0x36b87c[_0x4c60('0x19')];_0x11e276[_0x4c60('0x1a')]=_0x4c60('0x1b')+_0x83cb90+'.'+_0x36b87c[_0x4c60('0x1c')]+_0x4c60('0x1d')+_0x36b87c[_0x4c60('0x19')]+')\x20'+parseOperator(_0x36b87c['operator']);}else{_0x11e276[_0x4c60('0x1a')]=_0x83cb90+'.'+_0x36b87c['field']+'\x20'+parseOperator(_0x36b87c[_0x4c60('0x10')]);}if(_[_0x4c60('0x1e')]([_0x4c60('0x1f'),_0x4c60('0x20')],_0x36b87c[_0x4c60('0x10')]))_0x11e276['text']='('+_0x11e276['text']+_0x4c60('0x21')+_0x83cb90+'.'+_0x36b87c[_0x4c60('0x1c')]+_0x4c60('0x22');_0x11e276[_0x4c60('0x13')]=parseValue(_0x25c6aa,_0x36b87c[_0x4c60('0x10')],_0x36b87c[_0x4c60('0x13')]);return _0x11e276;};function parseOperator(_0x47f4fa){var _0x481fc5;switch(_0x47f4fa){case _0x4c60('0x23'):_0x481fc5='IN\x20?';break;case _0x4c60('0x20'):_0x481fc5=_0x4c60('0x24');break;case'$eq':_0x481fc5=_0x4c60('0x25');break;case _0x4c60('0x1f'):_0x481fc5=_0x4c60('0x26');break;case'$substring':case _0x4c60('0x27'):case _0x4c60('0x28'):_0x481fc5='LIKE\x20?';break;case _0x4c60('0x29'):_0x481fc5='<\x20?';break;case _0x4c60('0x2a'):_0x481fc5='>\x20?';break;case _0x4c60('0x14'):_0x481fc5=_0x4c60('0x2b');break;case _0x4c60('0x2c'):_0x481fc5=_0x4c60('0x2d');break;case _0x4c60('0x12'):_0x481fc5=_0x4c60('0x2e');break;}return _0x481fc5;}function parseValue(_0xe4b0e2,_0x175abb,_0x13c596){var _0x1a61ff={'start':undefined,'end':undefined};switch(_0x175abb){case _0x4c60('0x23'):case _0x4c60('0x20'):_0x1a61ff[_0x4c60('0x2f')]=_0x13c596['split'](',');break;case _0x4c60('0x30'):_0x1a61ff[_0x4c60('0x2f')]='%'+_0x13c596+'%';break;case _0x4c60('0x27'):_0x1a61ff[_0x4c60('0x2f')]=_0x13c596+'%';break;case _0x4c60('0x28'):_0x1a61ff[_0x4c60('0x2f')]='%'+_0x13c596;break;case _0x4c60('0x12'):var _0x28a179=_0x13c596[_0x4c60('0x6')](',');var _0x13c596=_0x28a179['shift']();var _0x19f8ed=_0x28a179[_0x4c60('0x31')]();if(_0xe4b0e2===_0x4c60('0xf')){_0x13c596=moment(_0x13c596)[_0x4c60('0x32')](0x0,!![])[_0x4c60('0x17')]();_0x19f8ed=moment(_0x19f8ed)[_0x4c60('0x32')](0x0,!![])[_0x4c60('0x15')](0x17,_0x4c60('0x33'))[_0x4c60('0x15')](0x3b,_0x4c60('0x34'))[_0x4c60('0x15')](0x3b,_0x4c60('0x35'))[_0x4c60('0x17')]();}_0x1a61ff={'start':_0x13c596,'end':_0x19f8ed};break;default:_0x1a61ff[_0x4c60('0x2f')]=_0x13c596;break;}return _0x1a61ff;} \ No newline at end of file +var _0xca1a=['pop','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','replace','split','length','slice','shift','forEach','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','days','format','castTo','text','CAST(','\x20AS\x20','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start'];(function(_0xd5ef4d,_0x38ad5d){var _0x67107=function(_0x6f8830){while(--_0x6f8830){_0xd5ef4d['push'](_0xd5ef4d['shift']());}};_0x67107(++_0x38ad5d);}(_0xca1a,0x71));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaca1('0x0'));var moment=require(_0xaca1('0x1'));exports['parseSearch']=function(_0x40b6e6){var _0x3c7c5c={'conditions':[]};_0x3c7c5c[_0xaca1('0x2')]=_[_0xaca1('0x3')](_0x40b6e6,_0xaca1('0x4'))?'or':'and';var _0x17a732=_0x40b6e6['replace']('[$and]','')[_0xaca1('0x5')](_0xaca1('0x4'),'')[_0xaca1('0x6')]('||');for(var _0x49cb2c=0x0;_0x49cb2c<_0x17a732[_0xaca1('0x7')];_0x49cb2c++){var _0x27b126=_0x17a732[_0x49cb2c][_0xaca1('0x6')](':=');var _0x4c1960=_0x27b126[0x0];var _0x3f2f2a=_0x27b126[_0xaca1('0x8')](0x1);_0x3f2f2a['forEach'](function(_0x4f3eda){var _0x431156=_0x4f3eda[_0xaca1('0x6')]('[')[_0xaca1('0x9')]();var _0x332699=_0x4f3eda['match'](/\[(.*?)\]/g);_0x332699[_0xaca1('0xa')](function(_0x16c3f2){var _0x21f115=_0x16c3f2[_0xaca1('0x6')]('[')['filter'](function(_0x3061a2){return _0x3061a2['indexOf'](']')>-0x1;})[_0xaca1('0xb')](function(_0x479a77){return _0x479a77[_0xaca1('0x6')](']')[0x0];})[0x0];_0x3c7c5c[_0xaca1('0xc')][_0xaca1('0xd')]({'field':_0x4c1960,'operator':_0x431156,'value':_0x21f115});});});}return _0x3c7c5c;};exports[_0xaca1('0xe')]=function(_0x5aac65,_0xb9dcf4,_0x1815c8){var _0x5202cd={};if(_0xb9dcf4===_0xaca1('0xf')){if(_0x1815c8[_0xaca1('0x10')]===_0xaca1('0x11')){_0x1815c8[_0xaca1('0x10')]=_0xaca1('0x12');_0x1815c8[_0xaca1('0x13')]+=','+_0x1815c8[_0xaca1('0x13')];}else if(_['includes']([_0xaca1('0x14'),'$lte'],_0x1815c8[_0xaca1('0x10')])){_0x1815c8[_0xaca1('0x13')]=moment(_0x1815c8[_0xaca1('0x13')])[_0xaca1('0x15')](0x1,_0xaca1('0x16'))[_0xaca1('0x17')]('YYYY-MM-DD');}}if(_0x1815c8['castTo']){_0xb9dcf4=_0x1815c8[_0xaca1('0x18')];_0x5202cd[_0xaca1('0x19')]=_0xaca1('0x1a')+_0x5aac65+'.'+_0x1815c8['field']+_0xaca1('0x1b')+_0x1815c8['castTo']+')\x20'+parseOperator(_0x1815c8[_0xaca1('0x10')]);}else{_0x5202cd[_0xaca1('0x19')]=_0x5aac65+'.'+_0x1815c8[_0xaca1('0x1c')]+'\x20'+parseOperator(_0x1815c8[_0xaca1('0x10')]);}if(_[_0xaca1('0x1d')]([_0xaca1('0x1e'),_0xaca1('0x1f')],_0x1815c8[_0xaca1('0x10')]))_0x5202cd[_0xaca1('0x19')]='('+_0x5202cd[_0xaca1('0x19')]+_0xaca1('0x20')+_0x5aac65+'.'+_0x1815c8[_0xaca1('0x1c')]+_0xaca1('0x21');_0x5202cd[_0xaca1('0x13')]=parseValue(_0xb9dcf4,_0x1815c8['operator'],_0x1815c8['value']);return _0x5202cd;};function parseOperator(_0x29a9b1){var _0x8c49c1;switch(_0x29a9b1){case'$in':_0x8c49c1=_0xaca1('0x22');break;case'$notIn':_0x8c49c1=_0xaca1('0x23');break;case _0xaca1('0x11'):_0x8c49c1=_0xaca1('0x24');break;case'$ne':_0x8c49c1='<>\x20?';break;case'$substring':case _0xaca1('0x25'):case _0xaca1('0x26'):_0x8c49c1='LIKE\x20?';break;case _0xaca1('0x27'):_0x8c49c1=_0xaca1('0x28');break;case'$gt':_0x8c49c1=_0xaca1('0x29');break;case _0xaca1('0x2a'):_0x8c49c1=_0xaca1('0x2b');break;case _0xaca1('0x2c'):_0x8c49c1=_0xaca1('0x2d');break;case _0xaca1('0x12'):_0x8c49c1=_0xaca1('0x2e');break;}return _0x8c49c1;}function parseValue(_0x2c637c,_0x46264e,_0x3a6740){var _0x30d86e={'start':undefined,'end':undefined};switch(_0x46264e){case _0xaca1('0x2f'):case _0xaca1('0x1f'):_0x30d86e[_0xaca1('0x30')]=_0x3a6740[_0xaca1('0x6')](',');break;case'$substring':_0x30d86e[_0xaca1('0x30')]='%'+_0x3a6740+'%';break;case'$startsWith':_0x30d86e[_0xaca1('0x30')]=_0x3a6740+'%';break;case'$endsWith':_0x30d86e[_0xaca1('0x30')]='%'+_0x3a6740;break;case _0xaca1('0x12'):var _0x5206b4=_0x3a6740[_0xaca1('0x6')](',');var _0x3a6740=_0x5206b4[_0xaca1('0x9')]();var _0x4a4e70=_0x5206b4[_0xaca1('0x31')]();if(_0x2c637c===_0xaca1('0xf')){_0x3a6740=moment(_0x3a6740)[_0xaca1('0x32')](0x0,!![])[_0xaca1('0x17')]();_0x4a4e70=moment(_0x4a4e70)[_0xaca1('0x32')](0x0,!![])[_0xaca1('0x15')](0x17,_0xaca1('0x33'))[_0xaca1('0x15')](0x3b,_0xaca1('0x34'))[_0xaca1('0x15')](0x3b,_0xaca1('0x35'))['format']();}_0x30d86e={'start':_0x3a6740,'end':_0x4a4e70};break;default:_0x30d86e[_0xaca1('0x30')]=_0x3a6740;break;}return _0x30d86e;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 09ab191..2188143 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe107=['lower','options','lodash','moment','parse','includes','keys','fields','split','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','isArray','limit','sort','map','priority','cast','col','substr','DESC','unsigned','ASC','isObject','isString','length','unset','hasOwnProperty','omit','isNumeric','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','match','push','join','query','$id','model','filters','intersection','attributes','offset','order','where','filter','object','columns','merge','VIRTUAL'];(function(_0x3c7cac,_0x220bf8){var _0x3bd774=function(_0x45614d){while(--_0x45614d){_0x3c7cac['push'](_0x3c7cac['shift']());}};_0x3bd774(++_0x220bf8);}(_0xe107,0xb3));var _0x7e10=function(_0x342209,_0x1601c6){_0x342209=_0x342209-0x0;var _0x14f40d=_0xe107[_0x342209];return _0x14f40d;};'use strict';var _=require(_0x7e10('0x0'));var sequelize=require('sequelize');var moment=require(_0x7e10('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x73dc05){var _0x2871b0=['ne'];try{var _0x570b2a=JSON[_0x7e10('0x2')](_0x73dc05);var _0x56db00=Object['keys'](_0x570b2a)[0x0];return _0x2871b0[_0x7e10('0x3')](_0x56db00);}catch(_0x46e807){return![];}}function getOperatorValue(_0x841f6d){var _0x5be19f=JSON['parse'](_0x841f6d);var _0x1dd3de=Object[_0x7e10('0x4')](_0x5be19f)[0x0];var _0x156c56=_0x5be19f[_0x1dd3de];return{['$'+_0x1dd3de]:_0x156c56};}exports[_0x7e10('0x5')]=function(_0x493958){var _0x48520c=null;if(_0x493958){_0x48520c=_0x493958[_0x7e10('0x6')](',');}return _0x48520c;};exports['filters']=function(_0x4e6825,_0x82e6f3){var _0x303f73={};if(!_[_0x7e10('0x7')](_0x4e6825)){_[_0x7e10('0x8')](_0x4e6825,function(_0x256cb1,_0x52ba74){try{if(_0x82e6f3){var _0x3576c2=_['find'](_0x82e6f3,{'name':_0x52ba74})||{};if(hasSequelizeOperator(_0x256cb1)){_0x303f73[_0x52ba74]=getOperatorValue(_0x256cb1);}else if(_0x3576c2[_0x7e10('0x9')]===_0x7e10('0xa')&&_[_0x7e10('0xb')](_0x256cb1)){var _0x5434dd=JSON[_0x7e10('0x2')](_0x256cb1);var _0x46def9={'$gte':moment(moment(_0x5434dd[_0x7e10('0xc')])[_0x7e10('0xd')](_0x7e10('0xe')))[_0x7e10('0xf')]()[_0x7e10('0xd')](),'$lte':moment(moment(_0x5434dd[_0x7e10('0x10')])['format'](_0x7e10('0xe')))[_0x7e10('0xf')]()['subtract'](0x1,'s')['format']()};_0x303f73[_0x52ba74]=_0x46def9;}else if(_0x3576c2[_0x7e10('0x11')]==='uniqueid'){_0x303f73[_0x52ba74]=_0x256cb1;}else{_0x303f73[_0x52ba74]=_[_0x7e10('0x12')](_0x256cb1)?_0x256cb1:JSON[_0x7e10('0x2')](_0x256cb1);}}else{_0x303f73[_0x52ba74]=_[_0x7e10('0x12')](_0x256cb1)?_0x256cb1:JSON[_0x7e10('0x2')](_0x256cb1);}}catch(_0x4fd639){_0x303f73[_0x52ba74]=_0x256cb1[_0x7e10('0x6')](',');}});}return _0x303f73;};exports[_0x7e10('0x13')]=function(_0x2bca7b){_0x2bca7b=parseInt(_0x2bca7b,0xa);if(!_0x2bca7b||_0x2bca7b<0x0){_0x2bca7b=LIMIT_VALUE;}return _0x2bca7b;};exports['offset']=function(_0x3b9ea2){_0x3b9ea2=parseInt(_0x3b9ea2,0xa);if(!_0x3b9ea2||_0x3b9ea2<0x0){_0x3b9ea2=0x0;}return _0x3b9ea2;};exports[_0x7e10('0x14')]=function(_0x157b22){var _0x585df5,_0xd742e4=null;if(_0x157b22){_0x585df5=_0x157b22['split'](',');_0xd742e4=_[_0x7e10('0x15')](_0x585df5,function(_0x2c6227){if(_0x2c6227['indexOf']('-')===0x0){return[_0x2c6227===_0x7e10('0x16')?sequelize[_0x7e10('0x17')](sequelize[_0x7e10('0x18')](_0x7e10('0x16')),'unsigned'):_0x2c6227[_0x7e10('0x19')](0x1),_0x7e10('0x1a')];}else{return[_0x2c6227===_0x7e10('0x16')?sequelize[_0x7e10('0x17')](sequelize[_0x7e10('0x18')](_0x7e10('0x16')),_0x7e10('0x1b')):_0x2c6227,_0x7e10('0x1c')];}});}return _0xd742e4;};exports['omit']=function(_0x4ad422,_0x11e9cc){if(_[_0x7e10('0x7')](_0x4ad422)){return _0x4ad422;}if(_[_0x7e10('0x12')](_0x4ad422)){for(var _0x13eeb3=0x0;_0x13eeb3<_0x4ad422['length'];_0x13eeb3+=0x1){_0x4ad422[_0x13eeb3]=this['omit'](_0x4ad422[_0x13eeb3],_0x11e9cc);}return _0x4ad422;}if(!_[_0x7e10('0x1d')](_0x4ad422)){return _0x4ad422;}if(_[_0x7e10('0x1e')](_0x11e9cc)){_0x11e9cc=[_0x11e9cc];}if(!_[_0x7e10('0x12')](_0x11e9cc)){return _0x4ad422;}for(var _0x13c7d4=0x0;_0x13c7d4<_0x11e9cc[_0x7e10('0x1f')];_0x13c7d4+=0x1){_[_0x7e10('0x20')](_0x4ad422,_0x11e9cc[_0x13c7d4]);}for(var _0x330103 in _0x4ad422){if(_0x4ad422[_0x7e10('0x21')](_0x330103)){_0x4ad422[_0x330103]=this[_0x7e10('0x22')](_0x4ad422[_0x330103],_0x11e9cc);}}return _0x4ad422;};exports[_0x7e10('0x23')]=function(_0x5691f8){return _0x5691f8['match'](RegExp(_0x7e10('0x24')))?!![]:![];};exports[_0x7e10('0x25')]=function(_0x560460){return _0x560460['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7e10('0x26')]=function(_0x271c49){var _0x537587=[];_0x271c49[_0x7e10('0x6')](/[ ,]+/)['forEach'](function(_0x18ff90){_0x18ff90=_0x18ff90[_0x7e10('0x27')](/([^:]")"+/g,'$1');_0x18ff90='+'+_0x18ff90+'*';var _0x1ca818=/[ `!@#$%^&*()_\-?~]/;if(_0x18ff90[_0x7e10('0x28')](_0x1ca818))_0x18ff90='\x22'+_0x18ff90+'\x22';_0x537587[_0x7e10('0x29')](_0x18ff90);});return _0x537587[_0x7e10('0x2a')]('\x20');};exports['getOptions']=function(_0x3567d2,_0x5dce0d,_0xc770e4){var _0x417cef={},_0x446b23={};if(_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x2c')]){_0x5dce0d[_0x7e10('0x2b')]['id']=_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x2c')];delete _0x5dce0d[_0x7e10('0x2b')]['$id'];}_0x417cef[_0x7e10('0x2d')]=_[_0x7e10('0x15')](_0x3567d2,_0x7e10('0x11'));_0x417cef[_0x7e10('0x2b')]=_[_0x7e10('0x4')](_0x5dce0d['query']);_0x417cef[_0x7e10('0x2e')]=_[_0x7e10('0x2f')](_0x417cef[_0x7e10('0x2d')],_0x417cef[_0x7e10('0x2b')]);_0x446b23['attributes']=_['intersection'](_0x417cef[_0x7e10('0x2d')],this[_0x7e10('0x5')](_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x5')]));_0x446b23['attributes']=_0x446b23[_0x7e10('0x30')][_0x7e10('0x1f')]?_0x446b23['attributes']:_0x417cef[_0x7e10('0x2d')];if(!_0x5dce0d[_0x7e10('0x2b')]['hasOwnProperty']('nolimit')){_0x446b23['limit']=this[_0x7e10('0x13')](_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x13')]);_0x446b23[_0x7e10('0x31')]=this[_0x7e10('0x31')](_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x31')]);}_0x446b23[_0x7e10('0x32')]=this['sort'](_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x14')]);_0x446b23[_0x7e10('0x33')]=this[_0x7e10('0x2e')](_['pick'](_0x5dce0d[_0x7e10('0x2b')],_0x417cef[_0x7e10('0x2e')]),_0x3567d2);if(_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x34')]){var _0x3ad2f0=_0x3567d2;var _0x4013f8=_0x5dce0d[_0x7e10('0x2b')]['filter'];if(typeof _0x4013f8===_0x7e10('0x35')){_0x3ad2f0=_[_0x7e10('0x34')](_0x3567d2,function(_0x57a832){return _[_0x7e10('0x3')](_0x4013f8[_0x7e10('0x36')],_0x57a832[_0x7e10('0x11')]);});_0x4013f8=_0x4013f8['value'];}_0x446b23[_0x7e10('0x33')]=_[_0x7e10('0x37')](_0x446b23[_0x7e10('0x33')],{'$or':_[_0x7e10('0x15')](_0x3ad2f0,function(_0x3c6a01){if(_0x3c6a01['type']!==_0x7e10('0x38')){if(_0xc770e4){return sequelize[_0x7e10('0x33')](sequelize['fn'](_0x7e10('0x39'),sequelize[_0x7e10('0x18')](_0x3c6a01[_0x7e10('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x34')]+'%')});}else{var _0x5bf832={};_0x5bf832[_0x3c6a01['name']]={'$like':'%'+_0x5dce0d[_0x7e10('0x2b')][_0x7e10('0x34')]+'%'};return _0x5bf832;}}})});}_0x446b23=_['merge']({},_0x446b23,_0x5dce0d[_0x7e10('0x3a')]);return _0x446b23;}; \ No newline at end of file +var _0x2123=['subtract','name','uniqueid','isArray','sort','map','priority','cast','col','substr','DESC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','where','pick','filter','object','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte'];(function(_0xbe4b36,_0x53cc47){var _0xfa0d1d=function(_0x19f2e1){while(--_0x19f2e1){_0xbe4b36['push'](_0xbe4b36['shift']());}};_0xfa0d1d(++_0x53cc47);}(_0x2123,0x190));var _0x3212=function(_0x35d7e3,_0x2489dc){_0x35d7e3=_0x35d7e3-0x0;var _0xcd2635=_0x2123[_0x35d7e3];return _0xcd2635;};'use strict';var _=require(_0x3212('0x0'));var sequelize=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3424c2){var _0x7158b8=['ne'];try{var _0x2ff863=JSON[_0x3212('0x3')](_0x3424c2);var _0x2e951f=Object[_0x3212('0x4')](_0x2ff863)[0x0];return _0x7158b8[_0x3212('0x5')](_0x2e951f);}catch(_0x37058e){return![];}}function getOperatorValue(_0x265328){var _0x5d9d36=JSON[_0x3212('0x3')](_0x265328);var _0x2b1302=Object[_0x3212('0x4')](_0x5d9d36)[0x0];var _0x4b35e9=_0x5d9d36[_0x2b1302];return{['$'+_0x2b1302]:_0x4b35e9};}exports[_0x3212('0x6')]=function(_0x56c38f){var _0x313265=null;if(_0x56c38f){_0x313265=_0x56c38f[_0x3212('0x7')](',');}return _0x313265;};exports[_0x3212('0x8')]=function(_0x1db498,_0x54f331){var _0x4a46c2={};if(!_[_0x3212('0x9')](_0x1db498)){_[_0x3212('0xa')](_0x1db498,function(_0x1a3b2f,_0x23f7e3){try{if(_0x54f331){var _0x9c01c3=_[_0x3212('0xb')](_0x54f331,{'name':_0x23f7e3})||{};if(hasSequelizeOperator(_0x1a3b2f)){_0x4a46c2[_0x23f7e3]=getOperatorValue(_0x1a3b2f);}else if(_0x9c01c3[_0x3212('0xc')]===_0x3212('0xd')&&_[_0x3212('0xe')](_0x1a3b2f)){var _0x2d5fce=JSON[_0x3212('0x3')](_0x1a3b2f);var _0x2e4cf0={'$gte':moment(moment(_0x2d5fce[_0x3212('0xf')])[_0x3212('0x10')](_0x3212('0x11')))[_0x3212('0x12')]()[_0x3212('0x10')](),'$lte':moment(moment(_0x2d5fce[_0x3212('0x13')])[_0x3212('0x10')](_0x3212('0x11')))[_0x3212('0x12')]()[_0x3212('0x14')](0x1,'s')['format']()};_0x4a46c2[_0x23f7e3]=_0x2e4cf0;}else if(_0x9c01c3[_0x3212('0x15')]===_0x3212('0x16')){_0x4a46c2[_0x23f7e3]=_0x1a3b2f;}else{_0x4a46c2[_0x23f7e3]=_[_0x3212('0x17')](_0x1a3b2f)?_0x1a3b2f:JSON[_0x3212('0x3')](_0x1a3b2f);}}else{_0x4a46c2[_0x23f7e3]=_[_0x3212('0x17')](_0x1a3b2f)?_0x1a3b2f:JSON[_0x3212('0x3')](_0x1a3b2f);}}catch(_0x21954a){_0x4a46c2[_0x23f7e3]=_0x1a3b2f['split'](',');}});}return _0x4a46c2;};exports['limit']=function(_0x1cad7b){_0x1cad7b=parseInt(_0x1cad7b,0xa);if(!_0x1cad7b||_0x1cad7b<0x0){_0x1cad7b=LIMIT_VALUE;}return _0x1cad7b;};exports['offset']=function(_0x2380e8){_0x2380e8=parseInt(_0x2380e8,0xa);if(!_0x2380e8||_0x2380e8<0x0){_0x2380e8=0x0;}return _0x2380e8;};exports[_0x3212('0x18')]=function(_0xb0b717){var _0x28a4cd,_0x27ccad=null;if(_0xb0b717){_0x28a4cd=_0xb0b717['split'](',');_0x27ccad=_[_0x3212('0x19')](_0x28a4cd,function(_0x462094){if(_0x462094['indexOf']('-')===0x0){return[_0x462094===_0x3212('0x1a')?sequelize[_0x3212('0x1b')](sequelize[_0x3212('0x1c')]('priority'),'unsigned'):_0x462094[_0x3212('0x1d')](0x1),_0x3212('0x1e')];}else{return[_0x462094===_0x3212('0x1a')?sequelize[_0x3212('0x1b')](sequelize[_0x3212('0x1c')](_0x3212('0x1a')),'unsigned'):_0x462094,'ASC'];}});}return _0x27ccad;};exports[_0x3212('0x1f')]=function(_0x47cfdc,_0x24cdf3){if(_[_0x3212('0x9')](_0x47cfdc)){return _0x47cfdc;}if(_[_0x3212('0x17')](_0x47cfdc)){for(var _0x5bb0a5=0x0;_0x5bb0a5<_0x47cfdc[_0x3212('0x20')];_0x5bb0a5+=0x1){_0x47cfdc[_0x5bb0a5]=this[_0x3212('0x1f')](_0x47cfdc[_0x5bb0a5],_0x24cdf3);}return _0x47cfdc;}if(!_[_0x3212('0x21')](_0x47cfdc)){return _0x47cfdc;}if(_['isString'](_0x24cdf3)){_0x24cdf3=[_0x24cdf3];}if(!_[_0x3212('0x17')](_0x24cdf3)){return _0x47cfdc;}for(var _0x35b4eb=0x0;_0x35b4eb<_0x24cdf3[_0x3212('0x20')];_0x35b4eb+=0x1){_[_0x3212('0x22')](_0x47cfdc,_0x24cdf3[_0x35b4eb]);}for(var _0x21f003 in _0x47cfdc){if(_0x47cfdc[_0x3212('0x23')](_0x21f003)){_0x47cfdc[_0x21f003]=this[_0x3212('0x1f')](_0x47cfdc[_0x21f003],_0x24cdf3);}}return _0x47cfdc;};exports[_0x3212('0x24')]=function(_0x1de338){return _0x1de338[_0x3212('0x25')](RegExp(_0x3212('0x26')))?!![]:![];};exports[_0x3212('0x27')]=function(_0x57613f){return _0x57613f[_0x3212('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x3212('0x28')]=function(_0x4726fb){var _0x1cbab5=[];_0x4726fb[_0x3212('0x7')](/[ ,]+/)[_0x3212('0x29')](function(_0x3a7883){_0x3a7883=_0x3a7883['replace'](/([^:]")"+/g,'$1');_0x3a7883='+'+_0x3a7883+'*';var _0x3cbd1a=/[ `!@#$%^&*()_\-?~]/;if(_0x3a7883['match'](_0x3cbd1a))_0x3a7883='\x22'+_0x3a7883+'\x22';_0x1cbab5[_0x3212('0x2a')](_0x3a7883);});return _0x1cbab5['join']('\x20');};exports[_0x3212('0x2b')]=function(_0x4ddc8f,_0x4d17bb,_0x38f56a){var _0x571ae0={},_0x294422={};if(_0x4d17bb[_0x3212('0x2c')][_0x3212('0x2d')]){_0x4d17bb['query']['id']=_0x4d17bb[_0x3212('0x2c')][_0x3212('0x2d')];delete _0x4d17bb[_0x3212('0x2c')]['$id'];}_0x571ae0[_0x3212('0x2e')]=_[_0x3212('0x19')](_0x4ddc8f,_0x3212('0x15'));_0x571ae0[_0x3212('0x2c')]=_[_0x3212('0x4')](_0x4d17bb['query']);_0x571ae0[_0x3212('0x8')]=_[_0x3212('0x2f')](_0x571ae0[_0x3212('0x2e')],_0x571ae0['query']);_0x294422[_0x3212('0x30')]=_[_0x3212('0x2f')](_0x571ae0[_0x3212('0x2e')],this[_0x3212('0x6')](_0x4d17bb['query'][_0x3212('0x6')]));_0x294422[_0x3212('0x30')]=_0x294422[_0x3212('0x30')][_0x3212('0x20')]?_0x294422['attributes']:_0x571ae0['model'];if(!_0x4d17bb['query']['hasOwnProperty'](_0x3212('0x31'))){_0x294422[_0x3212('0x32')]=this[_0x3212('0x32')](_0x4d17bb[_0x3212('0x2c')]['limit']);_0x294422[_0x3212('0x33')]=this[_0x3212('0x33')](_0x4d17bb[_0x3212('0x2c')][_0x3212('0x33')]);}_0x294422['order']=this['sort'](_0x4d17bb[_0x3212('0x2c')][_0x3212('0x18')]);_0x294422[_0x3212('0x34')]=this[_0x3212('0x8')](_[_0x3212('0x35')](_0x4d17bb[_0x3212('0x2c')],_0x571ae0[_0x3212('0x8')]),_0x4ddc8f);if(_0x4d17bb['query'][_0x3212('0x36')]){var _0x3768a=_0x4ddc8f;var _0x3e1e84=_0x4d17bb[_0x3212('0x2c')]['filter'];if(typeof _0x3e1e84===_0x3212('0x37')){_0x3768a=_[_0x3212('0x36')](_0x4ddc8f,function(_0x1c71f7){return _[_0x3212('0x5')](_0x3e1e84['columns'],_0x1c71f7[_0x3212('0x15')]);});_0x3e1e84=_0x3e1e84['value'];}_0x294422[_0x3212('0x34')]=_[_0x3212('0x38')](_0x294422[_0x3212('0x34')],{'$or':_[_0x3212('0x19')](_0x3768a,function(_0x9a24e3){if(_0x9a24e3[_0x3212('0xc')]!==_0x3212('0x39')){if(_0x38f56a){return sequelize[_0x3212('0x34')](sequelize['fn']('lower',sequelize[_0x3212('0x1c')](_0x9a24e3[_0x3212('0x15')])),{'$like':sequelize['fn'](_0x3212('0x3a'),'%'+_0x4d17bb[_0x3212('0x2c')][_0x3212('0x36')]+'%')});}else{var _0x36ccb2={};_0x36ccb2[_0x9a24e3[_0x3212('0x15')]]={'$like':'%'+_0x4d17bb['query'][_0x3212('0x36')]+'%'};return _0x36ccb2;}}})});}_0x294422=_[_0x3212('0x38')]({},_0x294422,_0x4d17bb[_0x3212('0x3b')]);return _0x294422;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e4e8f15..78f0898 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d6e=['join','root','public','development','test','client','json\x20replacer','toISOString','split','static','get','views','/server/views','engine','html','ejs','renderFile','use','urlencoded','50mb','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','default','env','production','set','appPath'];(function(_0x3c2e78,_0x73b9ab){var _0x8f2d0d=function(_0x5ac5ea){while(--_0x5ac5ea){_0x3c2e78['push'](_0x3c2e78['shift']());}};_0x8f2d0d(++_0x73b9ab);}(_0x4d6e,0xc5));var _0xe4d6=function(_0x3ba0af,_0xccb8a1){_0x3ba0af=_0x3ba0af-0x0;var _0x650db7=_0x4d6e[_0x3ba0af];return _0x650db7;};'use strict';var express=require(_0xe4d6('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xe4d6('0x1'));var methodOverride=require(_0xe4d6('0x2'));var cookieParser=require(_0xe4d6('0x3'));var errorHandler=require(_0xe4d6('0x4'));var path=require(_0xe4d6('0x5'));var passport=require('passport');var cors=require(_0xe4d6('0x6'));var moment=require(_0xe4d6('0x7'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0xe4d6('0x8')]=function(_0x4b4fce){var _0x1ca388=_0x4b4fce['get'](_0xe4d6('0x9'));if(_0x1ca388===_0xe4d6('0xa')){_0x4b4fce[_0xe4d6('0xb')](_0xe4d6('0xc'),path[_0xe4d6('0xd')](config[_0xe4d6('0xe')],_0xe4d6('0xf')));}if(_0x1ca388===_0xe4d6('0x10')||_0x1ca388===_0xe4d6('0x11')){_0x4b4fce[_0xe4d6('0xb')](_0xe4d6('0xc'),path[_0xe4d6('0xd')](config[_0xe4d6('0xe')],_0xe4d6('0x12')));_0x4b4fce['use'](errorHandler());}_0x4b4fce[_0xe4d6('0xb')](_0xe4d6('0x13'),function(_0x24f25c,_0x2f42fd){if(this[_0x24f25c]instanceof Date){_0x2f42fd=this[_0x24f25c][_0xe4d6('0x14')]()[_0xe4d6('0x15')]('.')[0x0]+'Z';}return _0x2f42fd;});_0x4b4fce['use'](express[_0xe4d6('0x16')](_0x4b4fce[_0xe4d6('0x17')](_0xe4d6('0xc'))));_0x4b4fce[_0xe4d6('0xb')](_0xe4d6('0x18'),config['root']+_0xe4d6('0x19'));_0x4b4fce[_0xe4d6('0x1a')](_0xe4d6('0x1b'),require(_0xe4d6('0x1c'))[_0xe4d6('0x1d')]);_0x4b4fce['set']('view\x20engine','html');_0x4b4fce[_0xe4d6('0x1e')](bodyParser[_0xe4d6('0x1f')]({'limit':_0xe4d6('0x20'),'extended':!![]}));_0x4b4fce['use'](bodyParser[_0xe4d6('0x21')]({'limit':'50mb'}));_0x4b4fce[_0xe4d6('0x1e')](cors());_0x4b4fce[_0xe4d6('0x1e')](methodOverride());_0x4b4fce[_0xe4d6('0x1e')](cookieParser());_0x4b4fce[_0xe4d6('0x1e')](passport[_0xe4d6('0x22')]());}; \ No newline at end of file +var _0x9ce2=['cookie-parser','errorhandler','passport','./environment','../mysqldb','default','get','env','set','join','root','public','development','test','appPath','client','use','json\x20replacer','toISOString','static','views','/server/views','html','ejs','urlencoded','50mb','initialize','express','serve-favicon','body-parser','method-override'];(function(_0xcb3af8,_0x396b77){var _0x1bc99d=function(_0x39b9e8){while(--_0x39b9e8){_0xcb3af8['push'](_0xcb3af8['shift']());}};_0x1bc99d(++_0x396b77);}(_0x9ce2,0x170));var _0x29ce=function(_0x5504fc,_0x2e161c){_0x5504fc=_0x5504fc-0x0;var _0xbad34c=_0x9ce2[_0x5504fc];return _0xbad34c;};'use strict';var express=require(_0x29ce('0x0'));var favicon=require(_0x29ce('0x1'));var bodyParser=require(_0x29ce('0x2'));var methodOverride=require(_0x29ce('0x3'));var cookieParser=require(_0x29ce('0x4'));var errorHandler=require(_0x29ce('0x5'));var path=require('path');var passport=require(_0x29ce('0x6'));var cors=require('cors');var moment=require('moment');var config=require(_0x29ce('0x7'));var db=require(_0x29ce('0x8'))['db'];exports[_0x29ce('0x9')]=function(_0x41a9c0){var _0x48ccef=_0x41a9c0[_0x29ce('0xa')](_0x29ce('0xb'));if(_0x48ccef==='production'){_0x41a9c0[_0x29ce('0xc')]('appPath',path[_0x29ce('0xd')](config[_0x29ce('0xe')],_0x29ce('0xf')));}if(_0x48ccef===_0x29ce('0x10')||_0x48ccef===_0x29ce('0x11')){_0x41a9c0['set'](_0x29ce('0x12'),path[_0x29ce('0xd')](config['root'],_0x29ce('0x13')));_0x41a9c0[_0x29ce('0x14')](errorHandler());}_0x41a9c0['set'](_0x29ce('0x15'),function(_0x2be40a,_0xc6de52){if(this[_0x2be40a]instanceof Date){_0xc6de52=this[_0x2be40a][_0x29ce('0x16')]()['split']('.')[0x0]+'Z';}return _0xc6de52;});_0x41a9c0[_0x29ce('0x14')](express[_0x29ce('0x17')](_0x41a9c0['get'](_0x29ce('0x12'))));_0x41a9c0[_0x29ce('0xc')](_0x29ce('0x18'),config[_0x29ce('0xe')]+_0x29ce('0x19'));_0x41a9c0['engine'](_0x29ce('0x1a'),require(_0x29ce('0x1b'))['renderFile']);_0x41a9c0['set']('view\x20engine',_0x29ce('0x1a'));_0x41a9c0[_0x29ce('0x14')](bodyParser[_0x29ce('0x1c')]({'limit':_0x29ce('0x1d'),'extended':!![]}));_0x41a9c0[_0x29ce('0x14')](bodyParser['json']({'limit':'50mb'}));_0x41a9c0[_0x29ce('0x14')](cors());_0x41a9c0[_0x29ce('0x14')](methodOverride());_0x41a9c0[_0x29ce('0x14')](cookieParser());_0x41a9c0['use'](passport[_0x29ce('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e964a2f..5072835 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b11=['dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32'];(function(_0xb18968,_0x2cf402){var _0x5ac6fd=function(_0x24653e){while(--_0x24653e){_0xb18968['push'](_0xb18968['shift']());}};_0x5ac6fd(++_0x2cf402);}(_0x4b11,0x1a9));var _0x14b1=function(_0x37c180,_0x2b92e8){_0x37c180=_0x37c180-0x0;var _0x4c19c8=_0x4b11[_0x37c180];return _0x4c19c8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x14b1('0x0'));var machine=require(_0x14b1('0x1'));var exec=require(_0x14b1('0x2'))[_0x14b1('0x3')];var config=require(_0x14b1('0x4'));function getInterfaces(){var _0x270bef=[];var _0x336ff3=os[_0x14b1('0x5')]();var _0xc7b395=_[_0x14b1('0x6')](_[_0x14b1('0x7')](_0x336ff3));for(var _0x5ca2bb=0x0;_0x5ca2bb<_0xc7b395[_0x14b1('0x8')];_0x5ca2bb++){var _0x4124cb=_0x336ff3[_0xc7b395[_0x5ca2bb]][_0x14b1('0x9')](function(_0x3594cc){return _0x3594cc[_0x14b1('0xa')]==='IPv4'&&_0x3594cc[_0x14b1('0xb')]===![];});_0x270bef=_0x270bef[_0x14b1('0xc')](_0x4124cb);}return _0x270bef;}function getFirstInterface(){var _0x3966c6=_[_0x14b1('0xd')](getInterfaces());return{'macAddress':_0x3966c6&&_0x3966c6['mac']?_0x3966c6[_0x14b1('0xe')]:'00:00:00:00:00:00','ipAddress':_0x3966c6&&_0x3966c6[_0x14b1('0xf')]?_0x3966c6[_0x14b1('0xf')]:_0x14b1('0x10')};}exports[_0x14b1('0x11')]=getFirstInterface;function getCPUhash(){var _0x199f97=_['orderBy'](os[_0x14b1('0x12')]()['map'](function(_0x5992b8){return _0x5992b8[_0x14b1('0x13')];}))[_0x14b1('0x14')](':');return crypto[_0x14b1('0x15')](_0x14b1('0x16'))[_0x14b1('0x17')](_0x199f97)[_0x14b1('0x18')](_0x14b1('0x19'));}exports[_0x14b1('0x1a')]=function(){var _0xab01a2=os[_0x14b1('0x1b')]();var _0x1dc59e=/[0-9a-f-]{36}/;if(config[_0x14b1('0x1c')]&&_0x1dc59e['test'](config[_0x14b1('0x1c')])){return config[_0x14b1('0x1c')];}else if(_0xab01a2===_0x14b1('0x1d')){return exec(_0x14b1('0x1e'),{'encoding':_0x14b1('0x1f')})[_0x14b1('0x20')]('\x0d\x0a','');}else{var _0x33a918=getFirstInterface();var _0x3fd580=getCPUhash();var _0xc4f22a=_0x3fd580+'|'+os['hostname']()+'|'+_0x33a918[_0x14b1('0x21')]+'|'+_0x33a918['ipAddress'];var _0x443afe=crypto[_0x14b1('0x15')](_0x14b1('0x16'))[_0x14b1('0x17')](_0xc4f22a)[_0x14b1('0x18')](_0x14b1('0x19'));return _0x443afe[_0x14b1('0x22')](0x0,0x8)+'-'+_0x443afe[_0x14b1('0x22')](0x8,0xc)+'-'+_0x443afe[_0x14b1('0x22')](0xc,0x10)+'-'+_0x443afe['substring'](0x10,0x14)+'-'+_0x443afe[_0x14b1('0x22')](0x14);}}; \ No newline at end of file +var _0x80a8=['family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','map','join','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','createHash','substring','lodash','crypto','execSync','../environment','orderBy','length','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80a8,0x110));var _0x880a=function(_0x3b53b0,_0x23dc58){_0x3b53b0=_0x3b53b0-0x0;var _0x4eddc6=_0x80a8[_0x3b53b0];return _0x4eddc6;};'use strict';var _=require(_0x880a('0x0'));var os=require('os');var crypto=require(_0x880a('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x880a('0x2')];var config=require(_0x880a('0x3'));function getInterfaces(){var _0x2c00b6=[];var _0x313a87=os['networkInterfaces']();var _0x19852d=_[_0x880a('0x4')](_['keys'](_0x313a87));for(var _0x57dd2b=0x0;_0x57dd2b<_0x19852d[_0x880a('0x5')];_0x57dd2b++){var _0x5490b8=_0x313a87[_0x19852d[_0x57dd2b]][_0x880a('0x6')](function(_0x26e07a){return _0x26e07a[_0x880a('0x7')]===_0x880a('0x8')&&_0x26e07a[_0x880a('0x9')]===![];});_0x2c00b6=_0x2c00b6[_0x880a('0xa')](_0x5490b8);}return _0x2c00b6;}function getFirstInterface(){var _0x1104fd=_[_0x880a('0xb')](getInterfaces());return{'macAddress':_0x1104fd&&_0x1104fd[_0x880a('0xc')]?_0x1104fd[_0x880a('0xc')]:_0x880a('0xd'),'ipAddress':_0x1104fd&&_0x1104fd[_0x880a('0xe')]?_0x1104fd[_0x880a('0xe')]:_0x880a('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x43da28=_[_0x880a('0x4')](os['cpus']()[_0x880a('0x10')](function(_0xad33cf){return _0xad33cf['model'];}))[_0x880a('0x11')](':');return crypto['createHash']('md5')[_0x880a('0x12')](_0x43da28)[_0x880a('0x13')](_0x880a('0x14'));}exports[_0x880a('0x15')]=function(){var _0xed4169=os[_0x880a('0x16')]();var _0x3d88d7=/[0-9a-f-]{36}/;if(config[_0x880a('0x17')]&&_0x3d88d7['test'](config[_0x880a('0x17')])){return config[_0x880a('0x17')];}else if(_0xed4169===_0x880a('0x18')){return exec(_0x880a('0x19'),{'encoding':'utf8'})[_0x880a('0x1a')]('\x0d\x0a','');}else{var _0x45950d=getFirstInterface();var _0x5ad214=getCPUhash();var _0x25111d=_0x5ad214+'|'+os[_0x880a('0x1b')]()+'|'+_0x45950d['macAddress']+'|'+_0x45950d[_0x880a('0x1c')];var _0x3c3b9e=crypto[_0x880a('0x1d')]('md5')[_0x880a('0x12')](_0x25111d)['digest'](_0x880a('0x14'));return _0x3c3b9e[_0x880a('0x1e')](0x0,0x8)+'-'+_0x3c3b9e[_0x880a('0x1e')](0x8,0xc)+'-'+_0x3c3b9e[_0x880a('0x1e')](0xc,0x10)+'-'+_0x3c3b9e[_0x880a('0x1e')](0x10,0x14)+'-'+_0x3c3b9e[_0x880a('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3582afa..dce483c 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x574f=['../../mysqldb','../../components/encryptor','license','format','exports','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','moment','request-promise','bluebird','pkginfo','version'];(function(_0x1a843f,_0x5e30e3){var _0x3d5ad0=function(_0x57720e){while(--_0x57720e){_0x1a843f['push'](_0x1a843f['shift']());}};_0x3d5ad0(++_0x5e30e3);}(_0x574f,0xdf));var _0xf574=function(_0x2871b4,_0x502643){_0x2871b4=_0x2871b4-0x0;var _0x40efd0=_0x574f[_0x2871b4];return _0x40efd0;};'use strict';var util=require('util');var moment=require(_0xf574('0x0'));var rp=require(_0xf574('0x1'));var BPromise=require(_0xf574('0x2'));var pkginfo=require(_0xf574('0x3'))(module,_0xf574('0x4'));var db=require(_0xf574('0x5'))['db'];var encryptor=require(_0xf574('0x6'));var hardware=require('./hardware');var logger=require('../logger')(_0xf574('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2cda3e){return new BPromise(function(_0x3002de,_0x5e74eb){var _0x42974c=util[_0xf574('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x2cda3e,module[_0xf574('0x9')][_0xf574('0x4')]);if(oldToken){_0x42974c=util[_0xf574('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2cda3e,module[_0xf574('0x9')][_0xf574('0x4')],oldToken);}var _0x47fba2={'uri':_0x42974c,'method':_0xf574('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x47fba2)[_0xf574('0xb')](function(_0x37d154){_0x3002de(_0x37d154);})[_0xf574('0xc')](function(_0x3b8c3d){_0x5e74eb(_0x3b8c3d);});});}function manageLicense(_0x10ea61,_0x4d698a){var _0x23b56e=_0x4d698a[_0xf574('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x23b56e['data1']!==_0x10ea61&&!_0x23b56e[_0xf574('0xe')]){oldToken=_0x23b56e[_0xf574('0xf')];}httpRequest(_0x10ea61)[_0xf574('0xb')](function(_0x2b2e8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b2e8[_0xf574('0x10')]){isOldTokenSent=![];if(!_0x23b56e['license']&&_0x23b56e[_0xf574('0x7')]!=_0x2b2e8[_0xf574('0x7')]||_0x23b56e[_0xf574('0x7')]&&_0x23b56e[_0xf574('0xe')]){logger[_0xf574('0x11')](_0xf574('0x12'));}if(_0x23b56e[_0xf574('0x7')]&&!_0x23b56e['data2']&&_0x23b56e[_0xf574('0x7')]!=_0x2b2e8[_0xf574('0x7')]){logger[_0xf574('0x11')](_0xf574('0x13'));}if(_0x23b56e[_0xf574('0x7')]&&!_0x23b56e[_0xf574('0xe')]&&_0x23b56e[_0xf574('0x7')]==_0x2b2e8[_0xf574('0x7')]){return _0x4d698a;}return _0x4d698a[_0xf574('0x14')]({'data1':_0x10ea61,'data2':null,'license':_0x2b2e8[_0xf574('0x7')]});}else{if(_0x2b2e8[_0xf574('0x7')]||_0x23b56e['license']){if(!_0x23b56e[_0xf574('0xe')]){if(_0x23b56e['data1']==_0x10ea61){GRAY_PERIOD_REASON='Disabled';logger[_0xf574('0x11')](_0xf574('0x15'));}else{GRAY_PERIOD_REASON=_0xf574('0x16');logger[_0xf574('0x11')](_0xf574('0x17'),_0x23b56e[_0xf574('0xf')],_0x10ea61);}logger['info'](_0xf574('0x18'),GRAY_PERIOD_REASON[_0xf574('0x19')](),moment()[_0xf574('0x8')](_0xf574('0x1a')));return _0x4d698a[_0xf574('0x14')]({'data2':encryptor['encryptString'](moment()['format'](_0xf574('0x1a')))});}else{if(moment()[_0xf574('0x1b')](encryptor[_0xf574('0x1c')](_0x23b56e['data2']),_0xf574('0x1d'))>DAYS){logger[_0xf574('0x11')](_0xf574('0x1e'),moment()[_0xf574('0x8')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4d698a[_0xf574('0x14')]({'data1':_0x10ea61,'data2':null,'license':null});}}}else{if(_0x23b56e[_0xf574('0xf')]!=_0x10ea61){logger[_0xf574('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x23b56e['data1'],_0x10ea61);return _0x4d698a[_0xf574('0x14')]({'data1':_0x10ea61,'data2':null,'license':null});}}}return _0x4d698a;})[_0xf574('0xb')](function(_0x1f34de){_0x4d698a=_0x1f34de;})[_0xf574('0xc')](function(_0x2204ef){logger[_0xf574('0x1f')](_0x2204ef['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xf574('0x20')](),_0x4d698a);},TIME);});}function defaultLicense(){var _0x774e6c=hardware[_0xf574('0x20')]();if(_0x774e6c){return db['License'][_0xf574('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x774e6c}})[_0xf574('0x22')](function(_0x5188ce,_0x3de6a3){logger[_0xf574('0x11')](_0xf574('0x23'),_0x774e6c);manageLicense(_0x774e6c,_0x5188ce);})[_0xf574('0xc')](function(_0x239010){logger[_0xf574('0x1f')](_0x239010[_0xf574('0x24')]);});}}exports[_0xf574('0x25')]=defaultLicense; \ No newline at end of file +var _0xb850=['./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor'];(function(_0x5e758f,_0x5eb1c7){var _0x122a02=function(_0x5c3532){while(--_0x5c3532){_0x5e758f['push'](_0x5e758f['shift']());}};_0x122a02(++_0x5eb1c7);}(_0xb850,0x112));var _0x0b85=function(_0x2f257e,_0x49af2c){_0x2f257e=_0x2f257e-0x0;var _0x16293c=_0xb850[_0x2f257e];return _0x16293c;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x0b85('0x0'));var BPromise=require(_0x0b85('0x1'));var pkginfo=require(_0x0b85('0x2'))(module,_0x0b85('0x3'));var db=require(_0x0b85('0x4'))['db'];var encryptor=require(_0x0b85('0x5'));var hardware=require(_0x0b85('0x6'));var logger=require(_0x0b85('0x7'))(_0x0b85('0x8'));var HOST=_0x0b85('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x219cb1){return new BPromise(function(_0x50d0fc,_0x36edb8){var _0x6691bc=util[_0x0b85('0xa')](_0x0b85('0xb'),HOST,_0x219cb1,module[_0x0b85('0xc')][_0x0b85('0x3')]);if(oldToken){_0x6691bc=util[_0x0b85('0xa')](_0x0b85('0xd'),HOST,_0x219cb1,module['exports'][_0x0b85('0x3')],oldToken);}var _0x2533df={'uri':_0x6691bc,'method':_0x0b85('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x2533df)[_0x0b85('0xf')](function(_0x419dff){_0x50d0fc(_0x419dff);})[_0x0b85('0x10')](function(_0x1e5d8f){_0x36edb8(_0x1e5d8f);});});}function manageLicense(_0x5662ab,_0x2b36fd){var _0x2f2800=_0x2b36fd[_0x0b85('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x2f2800[_0x0b85('0x12')]!==_0x5662ab&&!_0x2f2800['data2']){oldToken=_0x2f2800['data1'];}httpRequest(_0x5662ab)[_0x0b85('0xf')](function(_0x29705e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x29705e[_0x0b85('0x13')]){isOldTokenSent=![];if(!_0x2f2800[_0x0b85('0x8')]&&_0x2f2800[_0x0b85('0x8')]!=_0x29705e[_0x0b85('0x8')]||_0x2f2800[_0x0b85('0x8')]&&_0x2f2800[_0x0b85('0x14')]){logger[_0x0b85('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2f2800['license']&&!_0x2f2800[_0x0b85('0x14')]&&_0x2f2800['license']!=_0x29705e['license']){logger[_0x0b85('0x15')](_0x0b85('0x16'));}if(_0x2f2800[_0x0b85('0x8')]&&!_0x2f2800[_0x0b85('0x14')]&&_0x2f2800[_0x0b85('0x8')]==_0x29705e[_0x0b85('0x8')]){return _0x2b36fd;}return _0x2b36fd[_0x0b85('0x17')]({'data1':_0x5662ab,'data2':null,'license':_0x29705e[_0x0b85('0x8')]});}else{if(_0x29705e['license']||_0x2f2800[_0x0b85('0x8')]){if(!_0x2f2800[_0x0b85('0x14')]){if(_0x2f2800['data1']==_0x5662ab){GRAY_PERIOD_REASON=_0x0b85('0x18');logger[_0x0b85('0x15')](_0x0b85('0x19'));}else{GRAY_PERIOD_REASON=_0x0b85('0x1a');logger[_0x0b85('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2f2800[_0x0b85('0x12')],_0x5662ab);}logger[_0x0b85('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0b85('0x1b')](),moment()[_0x0b85('0xa')](_0x0b85('0x1c')));return _0x2b36fd[_0x0b85('0x17')]({'data2':encryptor[_0x0b85('0x1d')](moment()[_0x0b85('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x2f2800[_0x0b85('0x14')]),_0x0b85('0x1e'))>DAYS){logger['info'](_0x0b85('0x1f'),moment()[_0x0b85('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2b36fd[_0x0b85('0x17')]({'data1':_0x5662ab,'data2':null,'license':null});}}}else{if(_0x2f2800[_0x0b85('0x12')]!=_0x5662ab){logger[_0x0b85('0x15')](_0x0b85('0x20'),_0x2f2800[_0x0b85('0x12')],_0x5662ab);return _0x2b36fd[_0x0b85('0x17')]({'data1':_0x5662ab,'data2':null,'license':null});}}}return _0x2b36fd;})['then'](function(_0x319715){_0x2b36fd=_0x319715;})[_0x0b85('0x10')](function(_0x109306){logger[_0x0b85('0x21')](_0x109306[_0x0b85('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0b85('0x23')](),_0x2b36fd);},TIME);});}function defaultLicense(){var _0x2dfd14=hardware[_0x0b85('0x23')]();if(_0x2dfd14){return db[_0x0b85('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2dfd14}})[_0x0b85('0x25')](function(_0x570b6e,_0x41fc37){logger[_0x0b85('0x15')](_0x0b85('0x26'),_0x2dfd14);manageLicense(_0x2dfd14,_0x570b6e);})[_0x0b85('0x10')](function(_0xd5cb95){logger[_0x0b85('0x21')](_0xd5cb95[_0x0b85('0x22')]);});}}exports[_0x0b85('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6f942d1..3fcfdb6 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e77=['Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','format','parse','machineUuid','decryptString','gray','deadline','add','days','changed','disabled','message','User','findAll','sequelize','COUNT','col','count','role','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid'];(function(_0x4b5e89,_0xa8dda1){var _0x2bda16=function(_0x45aa80){while(--_0x45aa80){_0x4b5e89['push'](_0x4b5e89['shift']());}};_0x2bda16(++_0xa8dda1);}(_0x1e77,0x123));var _0x71e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1e77[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x71e7('0x0'));var _=require(_0x71e7('0x1'));var moment=require(_0x71e7('0x2'));var BPromise=require(_0x71e7('0x3'));var hardware=require(_0x71e7('0x4'));var encryptor=require(_0x71e7('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x71e7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x71e7('0x7'),'machineUuid':hardware[_0x71e7('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x71e7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x71e7('0x9'),'machineUuid':hardware[_0x71e7('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2a1486){return new BPromise(function(_0x38c216,_0x5097bf){return db[_0x71e7('0xa')][_0x71e7('0xb')](_[_0x71e7('0xc')](_0x2a1486,{'raw':!![],'where':{'id':0x1}}))[_0x71e7('0xd')](function(_0xd4d6f){return checkLicense(_0xd4d6f,null);})[_0x71e7('0xd')](function(_0x56c088){_0x38c216(_0x56c088);return;})[_0x71e7('0xe')](function(_0x4124ee){_0x5097bf(_0x4124ee);});});}function checkLicense(_0x3171a5,_0x50be82){if(!_0x3171a5){demoLicense[_0x71e7('0xf')]=_0x3171a5[_0x71e7('0x10')];return demoLicense;}try{var _0x4a942a=_0x50be82||_0x3171a5[_0x71e7('0x11')];if(_['isEmpty'](_0x4a942a)){throw new Error(_0x71e7('0x12'));}var _0x5d4a12=_0x3171a5[_0x71e7('0x10')];var _0x466886=_0x3171a5[_0x71e7('0x13')];var _0x1ac678=_0x5d4a12[_0x71e7('0x14')]('-')[0x4];var _0x17cf0a=_0x5d4a12[_0x71e7('0x14')]('-')[0x0];var _0x528d22=encryptor['decryptString'](_0x4a942a,util[_0x71e7('0x15')]('%s:%s:%s',_0x1ac678,_0x5d4a12,_0x17cf0a));var _0x131bc6=JSON[_0x71e7('0x16')](_0x528d22);_0x131bc6['demo']=![];_0x131bc6[_0x71e7('0xf')]=_0x5d4a12;_0x131bc6[_0x71e7('0x17')]=hardware[_0x71e7('0x8')]();if(_0x466886){var _0x2338eb=encryptor[_0x71e7('0x18')](_0x466886);_0x131bc6[_0x71e7('0x19')]=_0x2338eb;_0x131bc6[_0x71e7('0x1a')]=moment(_0x2338eb)[_0x71e7('0x1b')](0x7,_0x71e7('0x1c'))[_0x71e7('0x15')]();_0x131bc6['grayReason']=_0x131bc6[_0x71e7('0xf')]!=_0x131bc6[_0x71e7('0x17')]?_0x71e7('0x1d'):_0x71e7('0x1e');}return _0x131bc6;}catch(_0x1bf27c){breakingLicense[_0x71e7('0xf')]=_0x3171a5['data1'];breakingLicense[_0x71e7('0x1f')]=_0x1bf27c[_0x71e7('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x18b089,_0x55a961){getLicense()[_0x71e7('0xd')](function(_0x54b9db){return db[_0x71e7('0x20')][_0x71e7('0x21')]({'attributes':['role',[db[_0x71e7('0x22')]['fn'](_0x71e7('0x23'),db['sequelize'][_0x71e7('0x24')]('role')),_0x71e7('0x25')]],'group':_0x71e7('0x26'),'where':{'role':{'$or':[_0x71e7('0x27'),_0x71e7('0x28'),_0x71e7('0x29')]}},'raw':!![]})['then'](function(_0x3691e8){var _0x354599={'user':_0x54b9db[_0x71e7('0x2a')]||0x0,'telephone':_0x54b9db[_0x71e7('0x2b')]||0x0};_0x3691e8[_0x71e7('0x2c')](function(_0x52048c){var _0x168a62=_0x52048c['role']===_0x71e7('0x27')?'user':_0x52048c[_0x71e7('0x26')];_0x354599[_0x168a62]-=_0x52048c[_0x71e7('0x25')];if(_0x354599[_0x168a62]<0x0)_0x354599[_0x168a62]=0x0;});_0x18b089(_0x354599);return;});})[_0x71e7('0xe')](function(_0x3ab14f){_0x55a961(_0x3ab14f);});});}function checkUserLimits(_0x387f40){return new BPromise(function(_0xf91fea,_0x2ba6a3){getLimits()['then'](function(_0x3dd170){var _0x54f04d=_[_0x71e7('0x2d')](_[_0x71e7('0x2e')](_0x387f40,'role'),[_0x71e7('0x27'),_0x71e7('0x28'),'telephone']);var _0x31f37d=(_0x54f04d[_0x71e7('0x27')]||0x0)+(_0x54f04d[_0x71e7('0x28')]||0x0);var _0x59642e=_0x54f04d['telephone']||0x0;if(_0x31f37d>_0x3dd170[_0x71e7('0x28')])return _0x2ba6a3(_0x71e7('0x2f'));if(_0x59642e>_0x3dd170[_0x71e7('0x29')])return _0x2ba6a3(_0x71e7('0x30'));return _0xf91fea();})['catch'](function(_0x51811b){_0x2ba6a3(_0x51811b);});});}module[_0x71e7('0x31')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xeb5f=['util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','gray','add','days','machineUuid','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports'];(function(_0x5892f2,_0x4b8dae){var _0x41aa7a=function(_0xc9acd0){while(--_0xc9acd0){_0x5892f2['push'](_0x5892f2['shift']());}};_0x41aa7a(++_0x4b8dae);}(_0xeb5f,0xdc));var _0xfeb5=function(_0xc95674,_0x54b46a){_0xc95674=_0xc95674-0x0;var _0x24245d=_0xeb5f[_0xc95674];return _0x24245d;};'use strict';var util=require(_0xfeb5('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xfeb5('0x1'));var hardware=require(_0xfeb5('0x2'));var encryptor=require(_0xfeb5('0x3'));var db=require(_0xfeb5('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfeb5('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xfeb5('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfeb5('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xfeb5('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1ef332){return new BPromise(function(_0x308686,_0x18a523){return db[_0xfeb5('0x7')][_0xfeb5('0x8')](_[_0xfeb5('0x9')](_0x1ef332,{'raw':!![],'where':{'id':0x1}}))[_0xfeb5('0xa')](function(_0x2f332c){return checkLicense(_0x2f332c,null);})[_0xfeb5('0xa')](function(_0x2cc98a){_0x308686(_0x2cc98a);return;})[_0xfeb5('0xb')](function(_0x1140e0){_0x18a523(_0x1140e0);});});}function checkLicense(_0x494f2f,_0x35cce1){if(!_0x494f2f){demoLicense[_0xfeb5('0xc')]=_0x494f2f[_0xfeb5('0xd')];return demoLicense;}try{var _0x21a11e=_0x35cce1||_0x494f2f[_0xfeb5('0xe')];if(_[_0xfeb5('0xf')](_0x21a11e)){throw new Error(_0xfeb5('0x10'));}var _0x4c7e57=_0x494f2f[_0xfeb5('0xd')];var _0x135ece=_0x494f2f[_0xfeb5('0x11')];var _0x59b244=_0x4c7e57[_0xfeb5('0x12')]('-')[0x4];var _0x2e6669=_0x4c7e57['split']('-')[0x0];var _0x50c013=encryptor[_0xfeb5('0x13')](_0x21a11e,util[_0xfeb5('0x14')]('%s:%s:%s',_0x59b244,_0x4c7e57,_0x2e6669));var _0x33d9ce=JSON[_0xfeb5('0x15')](_0x50c013);_0x33d9ce['demo']=![];_0x33d9ce['uuid']=_0x4c7e57;_0x33d9ce['machineUuid']=hardware['getUuid']();if(_0x135ece){var _0x28155a=encryptor['decryptString'](_0x135ece);_0x33d9ce[_0xfeb5('0x16')]=_0x28155a;_0x33d9ce['deadline']=moment(_0x28155a)[_0xfeb5('0x17')](0x7,_0xfeb5('0x18'))[_0xfeb5('0x14')]();_0x33d9ce['grayReason']=_0x33d9ce[_0xfeb5('0xc')]!=_0x33d9ce[_0xfeb5('0x19')]?'changed':_0xfeb5('0x1a');}return _0x33d9ce;}catch(_0x43ba29){breakingLicense[_0xfeb5('0xc')]=_0x494f2f['data1'];breakingLicense[_0xfeb5('0x1b')]=_0x43ba29['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x10ca3e,_0x43ba97){getLicense()[_0xfeb5('0xa')](function(_0x6d4021){return db[_0xfeb5('0x1c')][_0xfeb5('0x1d')]({'attributes':[_0xfeb5('0x1e'),[db[_0xfeb5('0x1f')]['fn'](_0xfeb5('0x20'),db[_0xfeb5('0x1f')][_0xfeb5('0x21')]('role')),_0xfeb5('0x22')]],'group':_0xfeb5('0x1e'),'where':{'role':{'$or':[_0xfeb5('0x23'),_0xfeb5('0x24'),'telephone']}},'raw':!![]})[_0xfeb5('0xa')](function(_0x29a41c){var _0x31eb4f={'user':_0x6d4021['users']||0x0,'telephone':_0x6d4021['telephones']||0x0};_0x29a41c[_0xfeb5('0x25')](function(_0x4da92f){var _0x4d2b05=_0x4da92f['role']===_0xfeb5('0x23')?_0xfeb5('0x24'):_0x4da92f[_0xfeb5('0x1e')];_0x31eb4f[_0x4d2b05]-=_0x4da92f[_0xfeb5('0x22')];if(_0x31eb4f[_0x4d2b05]<0x0)_0x31eb4f[_0x4d2b05]=0x0;});_0x10ca3e(_0x31eb4f);return;});})[_0xfeb5('0xb')](function(_0x3fb081){_0x43ba97(_0x3fb081);});});}function checkUserLimits(_0x3e5075){return new BPromise(function(_0x20b60a,_0x10f22e){getLimits()[_0xfeb5('0xa')](function(_0x18776f){var _0x5c7216=_[_0xfeb5('0x26')](_[_0xfeb5('0x27')](_0x3e5075,_0xfeb5('0x1e')),[_0xfeb5('0x23'),_0xfeb5('0x24'),_0xfeb5('0x28')]);var _0x46d631=(_0x5c7216[_0xfeb5('0x23')]||0x0)+(_0x5c7216[_0xfeb5('0x24')]||0x0);var _0x2eaa52=_0x5c7216[_0xfeb5('0x28')]||0x0;if(_0x46d631>_0x18776f[_0xfeb5('0x24')])return _0x10f22e(_0xfeb5('0x29'));if(_0x2eaa52>_0x18776f[_0xfeb5('0x28')])return _0x10f22e(_0xfeb5('0x2a'));return _0x20b60a();})[_0xfeb5('0xb')](function(_0x8340f3){_0x10f22e(_0x8340f3);});});}module[_0xfeb5('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 8d3f822..c1ed041 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['app-id','exports','http://localhost:9000'];(function(_0xf82311,_0x29504b){var _0x39d8fa=function(_0x27c1d2){while(--_0x27c1d2){_0xf82311['push'](_0xf82311['shift']());}};_0x39d8fa(++_0x29504b);}(_0xe511,0x16f));var _0x1e51=function(_0x3468d3,_0x5f0f55){_0x3468d3=_0x3468d3-0x0;var _0x549184=_0xe511[_0x3468d3];return _0x549184;};'use strict';module[_0x1e51('0x0')]={'DOMAIN':_0x1e51('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x1e51('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x351d=['exports','myappanuglar-secret','app-id','secret'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x351d,0x90));var _0xd351=function(_0x3b6220,_0xe6d107){_0x3b6220=_0x3b6220-0x0;var _0x1c2709=_0x351d[_0x3b6220];return _0x1c2709;};'use strict';module[_0xd351('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xd351('0x1'),'GOOGLE_ID':_0xd351('0x2'),'GOOGLE_SECRET':_0xd351('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 73f85d2..8210b16 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe811=['File','%s-%s','error','transports','info','Console','env','moment','winston','util','path','INFO','join','/var','log','xcally','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0xe811,0xfa));var _0x1e81=function(_0x1fdaf8,_0x14d006){_0x1fdaf8=_0x1fdaf8-0x0;var _0x555df1=_0xe811[_0x1fdaf8];return _0x555df1;};'use strict';var moment=require(_0x1e81('0x0'));var winston=require(_0x1e81('0x1'));var util=require(_0x1e81('0x2'));var path=require(_0x1e81('0x3'));var debugLevel=_0x1e81('0x4');function filename(_0x2a9b27,_0x3fdf43){return path[_0x1e81('0x5')](_0x1e81('0x6'),_0x1e81('0x7'),_0x1e81('0x8'),util['format'](_0x1e81('0x9'),_0x2a9b27,_0x3fdf43));}function formatter(_0x27a3d1,_0x14f38e){_0x14f38e[_0x1e81('0xa')]=_0x14f38e[_0x1e81('0xa')][_0x1e81('0xb')](/@@{/g,_0x1e81('0xc'))[_0x1e81('0xb')](/}@@/g,_0x1e81('0xd'))[_0x1e81('0xb')](/@{/g,'{{')[_0x1e81('0xb')](/}@/g,'}}');return util[_0x1e81('0xe')](_0x1e81('0xf'),moment()[_0x1e81('0xe')](_0x1e81('0x10')),_0x14f38e[_0x1e81('0x11')][_0x1e81('0x12')](),_0x27a3d1,_0x14f38e['message']);}module['exports']=function(_0x3422ce){return new winston[(_0x1e81('0x13'))]({'transports':[new winston['transports'][(_0x1e81('0x14'))]({'name':util[_0x1e81('0xe')](_0x1e81('0x15'),_0x3422ce,_0x1e81('0x16')),'filename':filename(_0x3422ce,'error'),'level':_0x1e81('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x451867){return formatter(_0x3422ce,_0x451867);}}),new winston[(_0x1e81('0x17'))][(_0x1e81('0x14'))]({'name':util[_0x1e81('0xe')](_0x1e81('0x15'),_0x3422ce,_0x1e81('0x18')),'filename':filename(_0x3422ce,_0x1e81('0x18')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x169b77){return formatter(_0x3422ce,_0x169b77);}}),new winston[(_0x1e81('0x17'))][(_0x1e81('0x19'))]({'level':process[_0x1e81('0x1a')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x50de80){return formatter(_0x3422ce,_0x50de80);}})]});}; \ No newline at end of file +var _0x8298=['File','%s-%s','error','info','Console','env','moment','winston','INFO','join','/var','log','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports'];(function(_0x16e63c,_0x521391){var _0x5d6c50=function(_0x2d0b64){while(--_0x2d0b64){_0x16e63c['push'](_0x16e63c['shift']());}};_0x5d6c50(++_0x521391);}(_0x8298,0x150));var _0x8829=function(_0x20dd9b,_0x3c0fb8){_0x20dd9b=_0x20dd9b-0x0;var _0x2de3b0=_0x8298[_0x20dd9b];return _0x2de3b0;};'use strict';var moment=require(_0x8829('0x0'));var winston=require(_0x8829('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x8829('0x2');function filename(_0x1905d3,_0x4d948b){return path[_0x8829('0x3')](_0x8829('0x4'),_0x8829('0x5'),'xcally',util[_0x8829('0x6')](_0x8829('0x7'),_0x1905d3,_0x4d948b));}function formatter(_0x140107,_0xd667ef){_0xd667ef[_0x8829('0x8')]=_0xd667ef[_0x8829('0x8')][_0x8829('0x9')](/@@{/g,'{{{')[_0x8829('0x9')](/}@@/g,_0x8829('0xa'))[_0x8829('0x9')](/@{/g,'{{')[_0x8829('0x9')](/}@/g,'}}');return util[_0x8829('0x6')](_0x8829('0xb'),moment()['format'](_0x8829('0xc')),_0xd667ef[_0x8829('0xd')][_0x8829('0xe')](),_0x140107,_0xd667ef['message']);}module['exports']=function(_0x2c7e28){return new winston['Logger']({'transports':[new winston[(_0x8829('0xf'))][(_0x8829('0x10'))]({'name':util[_0x8829('0x6')](_0x8829('0x11'),_0x2c7e28,'error'),'filename':filename(_0x2c7e28,_0x8829('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x218050){return formatter(_0x2c7e28,_0x218050);}}),new winston[(_0x8829('0xf'))][(_0x8829('0x10'))]({'name':util[_0x8829('0x6')](_0x8829('0x11'),_0x2c7e28,_0x8829('0x13')),'filename':filename(_0x2c7e28,_0x8829('0x13')),'level':_0x8829('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x27df34){return formatter(_0x2c7e28,_0x27df34);}}),new winston[(_0x8829('0xf'))][(_0x8829('0x14'))]({'level':process[_0x8829('0x15')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4fde66){return formatter(_0x2c7e28,_0x4fde66);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b207ae9..ffcf36f 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4d0=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x369adf,_0x1e4428){var _0x164b44=function(_0x133edd){while(--_0x133edd){_0x369adf['push'](_0x369adf['shift']());}};_0x164b44(++_0x1e4428);}(_0xd4d0,0x1da));var _0x0d4d=function(_0x231a4f,_0x10af9b){_0x231a4f=_0x231a4f-0x0;var _0x26371c=_0xd4d0[_0x231a4f];return _0x26371c;};'use strict';var path=require(_0x0d4d('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x0d4d('0x1'),'script':path[_0x0d4d('0x2')](__dirname,_0x0d4d('0x3'))},{'name':_0x0d4d('0x4'),'script':path[_0x0d4d('0x2')](__dirname,_0x0d4d('0x5'))},{'name':_0x0d4d('0x6'),'script':path[_0x0d4d('0x2')](__dirname,_0x0d4d('0x7'))},{'name':_0x0d4d('0x8'),'script':path[_0x0d4d('0x2')](__dirname,_0x0d4d('0x9'))},{'name':_0x0d4d('0xa'),'script':path[_0x0d4d('0x2')](__dirname,_0x0d4d('0xb'))}]};module['exports']=config; \ No newline at end of file +var _0x4b67=['email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js','join','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x1135b4,_0x3da633){var _0xca35a8=function(_0x326a8c){while(--_0x326a8c){_0x1135b4['push'](_0x1135b4['shift']());}};_0xca35a8(++_0x3da633);}(_0x4b67,0x10e));var _0x74b6=function(_0x31050a,_0x194a67){_0x31050a=_0x31050a-0x0;var _0x39a61d=_0x4b67[_0x31050a];return _0x39a61d;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x74b6('0x0'),'script':path['join'](__dirname,_0x74b6('0x1'))},{'name':'ami','script':path[_0x74b6('0x2')](__dirname,_0x74b6('0x3'))},{'name':_0x74b6('0x4'),'script':path[_0x74b6('0x2')](__dirname,_0x74b6('0x5'))},{'name':_0x74b6('0x6'),'script':path[_0x74b6('0x2')](__dirname,_0x74b6('0x7'))},{'name':_0x74b6('0x8'),'script':path[_0x74b6('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x74b6('0x9'),'script':path[_0x74b6('0x2')](__dirname,_0x74b6('0xa'))}]};module[_0x74b6('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 03d2962..def4ba9 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a37=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','then','disconnect'];(function(_0x5b0b84,_0x4af9fe){var _0x475fdd=function(_0x5a802b){while(--_0x5a802b){_0x5b0b84['push'](_0x5b0b84['shift']());}};_0x475fdd(++_0x4af9fe);}(_0x1a37,0x7c));var _0x71a3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1a37[_0x167cc1];return _0x10bc4b;};'use strict';var pm2=require(_0x71a3('0x0'));var BPromise=require(_0x71a3('0x1'));var config=require(_0x71a3('0x2'));function connect(){return new BPromise(function(_0x2d9e97,_0x3ef69c){return pm2[_0x71a3('0x3')](function(_0x818681){if(_0x818681){return _0x3ef69c(_0x818681);}return _0x2d9e97('connected');});});};exports['start']=function(_0x5a27ff){return connect()[_0x71a3('0x4')](function(){return new BPromise(function(_0x212330,_0x1e8358){return pm2['start'](_0x5a27ff,function(_0xc30212,_0x230f4e){if(_0xc30212){return _0x1e8358(_0xc30212);}pm2[_0x71a3('0x5')]();return _0x212330(_0x230f4e);});});});};exports[_0x71a3('0x6')]=function(_0x35fccd){return connect()[_0x71a3('0x4')](function(){return new BPromise(function(_0x1f3810,_0x2c67d4){return pm2['stop'](_0x35fccd,function(_0x13547e,_0xcbab42){if(_0x13547e){return _0x2c67d4(_0x13547e);}pm2['disconnect']();return _0x1f3810(_0xcbab42);});});});};exports[_0x71a3('0x7')]=function(_0x210573){return connect()['then'](function(){return new BPromise(function(_0x2245c8,_0x3e8969){return pm2[_0x71a3('0x7')](_0x210573,function(_0x307ab9,_0x444847){if(_0x307ab9){return _0x3e8969(_0x307ab9);}pm2[_0x71a3('0x5')]();return _0x2245c8(_0x444847);});});});};exports[_0x71a3('0x8')]=function(){return connect()[_0x71a3('0x4')](function(){return new BPromise(function(_0x20e45b,_0x539432){return pm2[_0x71a3('0x8')](function(_0x2e3333,_0x19fed1){if(_0x2e3333){return _0x539432(_0x2e3333);}pm2[_0x71a3('0x5')]();return _0x20e45b(_0x19fed1);});});});};exports[_0x71a3('0x9')]=function(_0x382526){return connect()[_0x71a3('0x4')](function(){return new BPromise(function(_0x390c3f,_0x5876c3){return pm2['describe'](_0x382526,function(_0x126ee4,_0x216e2b){if(_0x126ee4){return _0x5876c3(_0x126ee4);}pm2['disconnect']();return _0x390c3f(_0x216e2b);});});});};exports[_0x71a3('0xa')]=function(_0x378ca1){return connect()['then'](function(){return new BPromise(function(_0xf276b3,_0x5af301){return pm2[_0x71a3('0xa')](_0x378ca1,function(_0x364ae5,_0x2b333c){if(_0x364ae5){return _0x5af301(_0x364ae5);}pm2[_0x71a3('0x5')]();return _0xf276b3(_0x2b333c);});});});};exports[_0x71a3('0xb')]=function(){return connect()[_0x71a3('0x4')](function(){return new BPromise(function(_0x3c2e2e,_0x1983ad){return pm2[_0x71a3('0xb')](function(_0x41d7cb){if(_0x41d7cb){return _0x1983ad(_0x41d7cb);}return _0x3c2e2e(_0x71a3('0xc'));});});});}; \ No newline at end of file +var _0x9421=['disconnect','stop','restart','list','describe','delete','dump','saved','./config','connect','connected','start','then'];(function(_0x17e4f9,_0x4318be){var _0xf6cb46=function(_0x329493){while(--_0x329493){_0x17e4f9['push'](_0x17e4f9['shift']());}};_0xf6cb46(++_0x4318be);}(_0x9421,0xb1));var _0x1942=function(_0x1fd37a,_0x272d39){_0x1fd37a=_0x1fd37a-0x0;var _0x244db0=_0x9421[_0x1fd37a];return _0x244db0;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1942('0x0'));function connect(){return new BPromise(function(_0x3ad37b,_0x5eb23c){return pm2[_0x1942('0x1')](function(_0x49304){if(_0x49304){return _0x5eb23c(_0x49304);}return _0x3ad37b(_0x1942('0x2'));});});};exports[_0x1942('0x3')]=function(_0xa446d7){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x594a3d,_0x3498bf){return pm2['start'](_0xa446d7,function(_0x17af92,_0x43773f){if(_0x17af92){return _0x3498bf(_0x17af92);}pm2[_0x1942('0x5')]();return _0x594a3d(_0x43773f);});});});};exports['stop']=function(_0x575dfd){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x196756,_0x5250ee){return pm2[_0x1942('0x6')](_0x575dfd,function(_0x2a2e05,_0x907e9f){if(_0x2a2e05){return _0x5250ee(_0x2a2e05);}pm2[_0x1942('0x5')]();return _0x196756(_0x907e9f);});});});};exports[_0x1942('0x7')]=function(_0x30de85){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x281d98,_0x585e6f){return pm2['restart'](_0x30de85,function(_0x4d2bd1,_0xff17ca){if(_0x4d2bd1){return _0x585e6f(_0x4d2bd1);}pm2['disconnect']();return _0x281d98(_0xff17ca);});});});};exports[_0x1942('0x8')]=function(){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x5b429c,_0x1da492){return pm2[_0x1942('0x8')](function(_0x53e9fd,_0x26db07){if(_0x53e9fd){return _0x1da492(_0x53e9fd);}pm2[_0x1942('0x5')]();return _0x5b429c(_0x26db07);});});});};exports['describe']=function(_0x35c962){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x352183,_0x3c0249){return pm2[_0x1942('0x9')](_0x35c962,function(_0xa70fae,_0x24f83e){if(_0xa70fae){return _0x3c0249(_0xa70fae);}pm2[_0x1942('0x5')]();return _0x352183(_0x24f83e);});});});};exports[_0x1942('0xa')]=function(_0x30126f){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x3e68ed,_0x5b56de){return pm2[_0x1942('0xa')](_0x30126f,function(_0x9e9760,_0x1e30ad){if(_0x9e9760){return _0x5b56de(_0x9e9760);}pm2[_0x1942('0x5')]();return _0x3e68ed(_0x1e30ad);});});});};exports[_0x1942('0xb')]=function(){return connect()[_0x1942('0x4')](function(){return new BPromise(function(_0x393cba,_0x23a4fa){return pm2[_0x1942('0xb')](function(_0x53099e){if(_0x53099e){return _0x23a4fa(_0x53099e);}return _0x393cba(_0x1942('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 6fda6d9..13b1e6b 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c0e=['subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x8c0e,0x17b));var _0xe8c0=function(_0x1a696b,_0x3b844b){_0x1a696b=_0x1a696b-0x0;var _0x1fa4ae=_0x8c0e[_0x1a696b];return _0x1fa4ae;};'use strict';var _=require('lodash');var moment=require(_0xe8c0('0x0'));var Redis=require(_0xe8c0('0x1'));var util=require('util');var config=require(_0xe8c0('0x2'));var db=require(_0xe8c0('0x3'))['db'];var logger=require(_0xe8c0('0x4'))(_0xe8c0('0x5'));config[_0xe8c0('0x6')]=_[_0xe8c0('0x7')](config[_0xe8c0('0x6')],{'host':_0xe8c0('0x8'),'port':0x18eb});var io=require(_0xe8c0('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x19a0ce=0x0;var _0x59e6a0=[];return db[_0xe8c0('0xa')][_0xe8c0('0xb')]({'raw':!![],'attributes':['id',_0xe8c0('0xc')],'where':{'id':0x1}})[_0xe8c0('0xd')](function(_0x1fc42f){_0x19a0ce=_0x1fc42f[_0xe8c0('0xc')];if(_0x19a0ce){return db[_0xe8c0('0xe')][_0xe8c0('0xf')]({'raw':!![],'attributes':['id',_0xe8c0('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe8c0('0x11')](_0x1fc42f['chatTimeout'],_0xe8c0('0x12'))}}});}else{return[];}})[_0xe8c0('0xd')](function(_0x45a87e){if(_0x45a87e&&_0x45a87e[_0xe8c0('0x13')]){_0x59e6a0=_[_0xe8c0('0x14')](_0x45a87e||[],'id');logger[_0xe8c0('0x15')](_0xe8c0('0x16'),_0x59e6a0[_0xe8c0('0x17')]());return db[_0xe8c0('0xe')][_0xe8c0('0x18')]({'closeReason':_0xe8c0('0x19'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xe8c0('0x1a')](_0xe8c0('0x1b'))},{'where':{'id':_0x59e6a0}});}})['then'](function(){if(_0x59e6a0&&_0x59e6a0[_0xe8c0('0x13')]){logger['info'](_0xe8c0('0x1c'),_0x59e6a0[_0xe8c0('0x17')]());for(var _0x55e165=0x0;_0x55e165<_0x59e6a0[_0xe8c0('0x13')];_0x55e165++){io[_0xe8c0('0x1d')](_0xe8c0('0x1e'),{'id':_0x59e6a0[_0x55e165],'closed':!![]});}}})[_0xe8c0('0x1f')](function(_0x8a85ff){logger[_0xe8c0('0x20')](_0xe8c0('0x21'),_0x8a85ff?util[_0xe8c0('0x22')](_0x8a85ff,{'showHidden':![],'depth':null}):'');});}exports[_0xe8c0('0x23')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xacbc=['chatInteraction:update','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit'];(function(_0x208ff7,_0x12129a){var _0x266751=function(_0xc816a1){while(--_0xc816a1){_0x208ff7['push'](_0x208ff7['shift']());}};_0x266751(++_0x12129a);}(_0xacbc,0x1e3));var _0xcacb=function(_0x44cbde,_0x2bcb1b){_0x44cbde=_0x44cbde-0x0;var _0x27c329=_0xacbc[_0x44cbde];return _0x27c329;};'use strict';var _=require(_0xcacb('0x0'));var moment=require(_0xcacb('0x1'));var Redis=require(_0xcacb('0x2'));var util=require(_0xcacb('0x3'));var config=require(_0xcacb('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xcacb('0x5'))('schedule');config[_0xcacb('0x6')]=_['defaults'](config[_0xcacb('0x6')],{'host':_0xcacb('0x7'),'port':0x18eb});var io=require(_0xcacb('0x8'))(new Redis(config[_0xcacb('0x6')]));function closeInteractions(){var _0x4b1981=0x0;var _0xa82494=[];return db[_0xcacb('0x9')][_0xcacb('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xcacb('0xb')](function(_0x17f355){_0x4b1981=_0x17f355[_0xcacb('0xc')];if(_0x4b1981){return db[_0xcacb('0xd')][_0xcacb('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcacb('0xf')](_0x17f355[_0xcacb('0xc')],_0xcacb('0x10'))}}});}else{return[];}})[_0xcacb('0xb')](function(_0x194b4d){if(_0x194b4d&&_0x194b4d[_0xcacb('0x11')]){_0xa82494=_[_0xcacb('0x12')](_0x194b4d||[],'id');logger[_0xcacb('0x13')](_0xcacb('0x14'),_0xa82494['join']());return db[_0xcacb('0xd')][_0xcacb('0x15')]({'closeReason':_0xcacb('0x16'),'disposition':_0xcacb('0x17'),'closed':!![],'closedAt':moment()[_0xcacb('0x18')](_0xcacb('0x19'))},{'where':{'id':_0xa82494}});}})[_0xcacb('0xb')](function(){if(_0xa82494&&_0xa82494[_0xcacb('0x11')]){logger['info'](_0xcacb('0x1a'),_0xa82494[_0xcacb('0x1b')]());for(var _0x2a1cf8=0x0;_0x2a1cf8<_0xa82494[_0xcacb('0x11')];_0x2a1cf8++){io[_0xcacb('0x1c')](_0xcacb('0x1d'),{'id':_0xa82494[_0x2a1cf8],'closed':!![]});}}})['catch'](function(_0x929455){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x929455?util[_0xcacb('0x1e')](_0x929455,{'showHidden':![],'depth':null}):'');});}exports[_0xcacb('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 138da98..13fd8e9 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd560=['attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','toRun','length','index','resolve','run\x20job','cron','startAt','endAt','add','add\x20cron','stop\x20cron','active','isBetween','update\x20cron','run','start','util','path','moment','cron-job-manager','jayson/promise','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','service','Smtp','host','MailAccount','port','secure','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify'];(function(_0x482a6d,_0x7c6a59){var _0x5f3244=function(_0x591855){while(--_0x591855){_0x482a6d['push'](_0x482a6d['shift']());}};_0x5f3244(++_0x7c6a59);}(_0xd560,0xe5));var _0x0d56=function(_0x23b398,_0x352612){_0x23b398=_0x23b398-0x0;var _0x3bbd45=_0xd560[_0x23b398];return _0x3bbd45;};'use strict';var fs=require('fs');var util=require(_0x0d56('0x0'));var path=require(_0x0d56('0x1'));var _=require('lodash');var moment=require(_0x0d56('0x2'));var CronJobManager=require(_0x0d56('0x3'));var jayson=require(_0x0d56('0x4'));var BPromise=require('bluebird');var logger=require(_0x0d56('0x5'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x0d56('0x6'));var analyticDefaultReportController=require(_0x0d56('0x7'));var client=jayson[_0x0d56('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x56466,_0x29fb2f){return function(){logger[_0x0d56('0x9')](_0x0d56('0xa'),_0x56466[_0x0d56('0xb')]);var _0xf439ea=!![];var _0x34544f={'tls':{'rejectUnauthorized':![]}};if(_0x56466['MailAccount']['Smtp']['service']){_0x34544f[_0x0d56('0xc')]=_0x56466['MailAccount'][_0x0d56('0xd')][_0x0d56('0xc')];}else{_0x34544f[_0x0d56('0xe')]=_0x56466[_0x0d56('0xf')]['Smtp'][_0x0d56('0xe')];_0x34544f[_0x0d56('0x10')]=_0x56466[_0x0d56('0xf')][_0x0d56('0xd')][_0x0d56('0x10')];_0x34544f[_0x0d56('0x11')]=_0x56466['MailAccount'][_0x0d56('0xd')][_0x0d56('0x11')];}if(_0x56466[_0x0d56('0xf')]['Smtp']['authentication']){_0x34544f['auth']={'user':_0x56466[_0x0d56('0xf')][_0x0d56('0xd')][_0x0d56('0x12')],'pass':_0x56466[_0x0d56('0xf')][_0x0d56('0xd')][_0x0d56('0x13')]};}var _0x3905ad={'account':_0x34544f,'message':{'from':util['format'](_0x0d56('0x14'),_0x56466[_0x0d56('0xf')][_0x0d56('0x15')],_0x56466['MailAccount'][_0x0d56('0xb')]||_0x56466[_0x0d56('0xf')][_0x0d56('0xd')][_0x0d56('0x12')]),'to':_0x56466[_0x0d56('0xb')],'cc':_0x56466['cc'],'bcc':_0x56466[_0x0d56('0x16')],'subject':util[_0x0d56('0x17')](_0x0d56('0x18'),_0x29fb2f[_0x0d56('0x15')],_0x56466[_0x0d56('0x19')],_0x56466[_0x0d56('0x1a')])}};var _0x1318d1=path[_0x0d56('0x1b')](__dirname,_0x0d56('0x1c'));var _0x1e1825=_0x29fb2f[_0x0d56('0x1d')];var _0x458efd=util[_0x0d56('0x17')](_0x0d56('0x1e'),path[_0x0d56('0x1f')](_0x29fb2f[_0x0d56('0x1d')],path[_0x0d56('0x20')](_0x29fb2f[_0x0d56('0x1d')])),_0x0d56('0x21'));var _0x4588fe=path[_0x0d56('0x1b')](_0x1318d1,_0x1e1825);var _0x357ebb=path['join'](_0x1318d1,_0x458efd);if(fs[_0x0d56('0x22')](_0x4588fe)){_0x29fb2f[_0x0d56('0x23')]=_0x0d56('0x24');_0x3905ad[_0x0d56('0x25')]['attachments']=[{'filename':_0x1e1825,'path':_0x4588fe}];_0x3905ad[_0x0d56('0x25')][_0x0d56('0x26')]=util[_0x0d56('0x17')](_0x0d56('0x27'),JSON[_0x0d56('0x28')](_0x29fb2f,null,0x2));}else if(fs['existsSync'](_0x357ebb)){_0x29fb2f[_0x0d56('0x23')]='Sent';_0x3905ad[_0x0d56('0x25')][_0x0d56('0x29')]=[{'filename':_0x458efd,'path':_0x357ebb}];}else{_0x3905ad[_0x0d56('0x25')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x56466[_0x0d56('0x2a')]){_0xf439ea=![];logger[_0x0d56('0x9')](_0x0d56('0x2b'));}}if(_0xf439ea){return client[_0x0d56('0x2c')]('SendMail',_0x3905ad)[_0x0d56('0x2d')](function(_0x24c7ae){if(_0x24c7ae['error']){return logger[_0x0d56('0x2e')]('error\x20mail',JSON['stringify'](_0x24c7ae));}return logger['info'](_0x0d56('0x2f'));})[_0x0d56('0x30')](function(_0x48947b){return logger[_0x0d56('0x2e')]('error\x20mail',JSON[_0x0d56('0x28')](_0x48947b));});}};}function handleError(){return function(_0x4182f3){return logger['error'](JSON[_0x0d56('0x28')](_0x4182f3));};}function handleResult(_0x2e3c89){return function(_0x301f3f){logger[_0x0d56('0x9')](_0x0d56('0x31'),JSON[_0x0d56('0x28')](_0x301f3f));if(_0x2e3c89[_0x0d56('0xf')]&&_0x2e3c89[_0x0d56('0xf')][_0x0d56('0xd')]&&!_['isNil'](_0x2e3c89['email'])){setTimeout(handleSendEmail(_0x2e3c89,_0x301f3f),0x3c*0x3e8);}};}function handleJob(_0x4ceda7){return function(){try{if(_[_0x0d56('0x32')](_0x4ceda7[_0x0d56('0x19')])){return logger['info'](_0x0d56('0x33'));}if(_[_0x0d56('0x32')](_0x4ceda7[_0x0d56('0x1a')])){return logger[_0x0d56('0x9')](_0x0d56('0x34'));}var _0x4fa72d={'startDate':moment()[_0x0d56('0x35')](_0x4ceda7['subtractNumber'],_0x4ceda7[_0x0d56('0x1a')])[_0x0d56('0x17')](_0x0d56('0x36')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x4ceda7[_0x0d56('0x37')],'name':_0x4ceda7[_0x0d56('0x15')]};if(!_['isNil'](_0x4ceda7['DefaultReportId'])){logger[_0x0d56('0x9')](_0x0d56('0x38'),_0x4ceda7[_0x0d56('0x39')]);return analyticDefaultReportController[_0x0d56('0x3a')]({'id':_0x4ceda7[_0x0d56('0x39')]},_0x4fa72d)[_0x0d56('0x2d')](handleResult(_0x4ceda7))['catch'](handleError());}if(!_[_0x0d56('0x32')](_0x4ceda7[_0x0d56('0x3b')])){logger[_0x0d56('0x9')](_0x0d56('0x3c'),_0x4ceda7[_0x0d56('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x4ceda7['CustomReportId']},_0x4fa72d)[_0x0d56('0x2d')](handleResult(_0x4ceda7))[_0x0d56('0x30')](handleError());}}catch(_0x39c06b){logger[_0x0d56('0x2e')](JSON[_0x0d56('0x28')](_0x39c06b));}return logger[_0x0d56('0x9')]('no\x20report\x20id');};}function getJobs(_0x1b5f44){var _0x4ee352={};if(_0x1b5f44){_0x4ee352['id']=_0x1b5f44;}return db[_0x0d56('0x3d')][_0x0d56('0x3e')]({'where':_0x4ee352,'include':[{'model':db[_0x0d56('0xf')],'attributes':['id',_0x0d56('0x15'),'email'],'include':[{'model':db[_0x0d56('0x3f')],'as':_0x0d56('0xd')}]}]})[_0x0d56('0x2d')](function(_0x533bb5){var _0x8c0940=_[_0x0d56('0x40')](manager[_0x0d56('0x41')]);var _0x502420=_[_0x0d56('0x42')](_0x533bb5,function(_0x1837f4){return _0x1837f4['id'][_0x0d56('0x43')]();});var _0xf1a3c2=_[_0x0d56('0x44')](_0x533bb5,function(_0x4887b9){return _0x4887b9['id'][_0x0d56('0x43')]();});var _0x2b136f=_0x1b5f44?_0x502420:_[_0x0d56('0x45')](_0x502420,_0x8c0940);var _0x37f07c=_[_0x0d56('0x46')](_0x502420,_0x8c0940);var _0x5a1d43=_['difference'](_0x8c0940,_0x502420);var _0x4110ce;var _0x2409a1;for(_0x4110ce=0x0;_0x4110ce<_0x5a1d43['length']&&!_0x1b5f44;_0x4110ce+=0x1){_0x2409a1=_0x5a1d43[_0x4110ce][_0x0d56('0x43')]();if(manager[_0x0d56('0x47')](_0x2409a1)){manager[_0x0d56('0x48')](_0x2409a1);manager[_0x0d56('0x49')](_0x2409a1);logger[_0x0d56('0x9')]('delete\x20cron',_0x2409a1);}}logger[_0x0d56('0x9')](_0x0d56('0x4a'),JSON['stringify'](_0x2b136f));for(_0x4110ce=0x0;_0x4110ce<_0x2b136f[_0x0d56('0x4b')];_0x4110ce+=0x1){_0x2409a1=_0x2b136f[_0x4110ce][_0x0d56('0x43')]();logger['info'](_0x0d56('0x4c'),_0x2409a1);if(_0x1b5f44){logger['info']('my\x20id',_0x1b5f44);logger[_0x0d56('0x9')](JSON[_0x0d56('0x28')](_0xf1a3c2[_0x2409a1]));BPromise[_0x0d56('0x4d')]()[_0x0d56('0x2d')](handleJob(_0xf1a3c2[_0x2409a1]));logger[_0x0d56('0x9')](_0x0d56('0x4e'),_0xf1a3c2[_0x2409a1][_0x0d56('0x15')],_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')]);}else if(_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')]&&_0xf1a3c2[_0x2409a1]['active']&&moment()['isBetween'](_0xf1a3c2[_0x2409a1][_0x0d56('0x50')],_0xf1a3c2[_0x2409a1][_0x0d56('0x51')])){manager[_0x0d56('0x52')](_0x2409a1,_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')],handleJob(_0xf1a3c2[_0x2409a1]));manager['start'](_0x2409a1);logger['info'](_0x0d56('0x53'),_0xf1a3c2[_0x2409a1][_0x0d56('0x15')],_0xf1a3c2[_0x2409a1]['cron']);}else if(manager[_0x0d56('0x47')](_0x2409a1)){manager[_0x0d56('0x48')](_0x2409a1);manager[_0x0d56('0x49')](_0x2409a1);logger[_0x0d56('0x9')](_0x0d56('0x54'),_0xf1a3c2[_0x2409a1][_0x0d56('0x15')],_0xf1a3c2[_0x2409a1]['cron']);}}for(_0x4110ce=0x0,_0x2409a1;_0x4110ce<_0x37f07c[_0x0d56('0x4b')]&&!_0x1b5f44;_0x4110ce+=0x1){_0x2409a1=_0x37f07c[_0x4110ce][_0x0d56('0x43')]();if(manager[_0x0d56('0x47')](_0x2409a1)){if(_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')]&&_0xf1a3c2[_0x2409a1][_0x0d56('0x55')]&&moment()[_0x0d56('0x56')](_0xf1a3c2[_0x2409a1][_0x0d56('0x50')],_0xf1a3c2[_0x2409a1][_0x0d56('0x51')])){manager['update'](_0x2409a1,_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')],handleJob(_0xf1a3c2[_0x2409a1]));logger[_0x0d56('0x9')](_0x0d56('0x57'),_0xf1a3c2[_0x2409a1][_0x0d56('0x15')],_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')]);}else{manager[_0x0d56('0x48')](_0x2409a1);manager[_0x0d56('0x49')](_0x2409a1);logger[_0x0d56('0x9')](_0x0d56('0x54'),_0xf1a3c2[_0x2409a1][_0x0d56('0x15')],_0xf1a3c2[_0x2409a1][_0x0d56('0x4f')]);}}}})['catch'](function(_0x340743){logger['error'](JSON['stringify'](_0x340743));});}exports[_0x0d56('0x58')]=function(_0x336e52){return getJobs(_0x336e52);};exports[_0x0d56('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4606=['resolve','run\x20job','cron','active','startAt','add','start','add\x20cron','stop','isBetween','endAt','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','Smtp','service','host','port','MailAccount','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','text','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','Schedule','MailServerOut','keys','map','toString','keyBy','intersection','difference','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id'];(function(_0x2e65ee,_0x29dad9){var _0x4c712a=function(_0xca593f){while(--_0xca593f){_0x2e65ee['push'](_0x2e65ee['shift']());}};_0x4c712a(++_0x29dad9);}(_0x4606,0x183));var _0x6460=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4606[_0x3ab51d];return _0x29a04e;};'use strict';var fs=require('fs');var util=require(_0x6460('0x0'));var path=require(_0x6460('0x1'));var _=require(_0x6460('0x2'));var moment=require(_0x6460('0x3'));var CronJobManager=require(_0x6460('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x6460('0x5'));var logger=require(_0x6460('0x6'))(_0x6460('0x7'));var db=require(_0x6460('0x8'))['db'];var analyticCustomReportController=require(_0x6460('0x9'));var analyticDefaultReportController=require(_0x6460('0xa'));var client=jayson[_0x6460('0xb')][_0x6460('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x63bb30,_0x1ad143){return function(){logger[_0x6460('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x63bb30[_0x6460('0xe')]);var _0x11181a=!![];var _0x413e07={'tls':{'rejectUnauthorized':![]}};if(_0x63bb30['MailAccount'][_0x6460('0xf')][_0x6460('0x10')]){_0x413e07['service']=_0x63bb30['MailAccount'][_0x6460('0xf')][_0x6460('0x10')];}else{_0x413e07['host']=_0x63bb30['MailAccount']['Smtp'][_0x6460('0x11')];_0x413e07[_0x6460('0x12')]=_0x63bb30[_0x6460('0x13')][_0x6460('0xf')]['port'];_0x413e07[_0x6460('0x14')]=_0x63bb30[_0x6460('0x13')][_0x6460('0xf')][_0x6460('0x14')];}if(_0x63bb30['MailAccount'][_0x6460('0xf')][_0x6460('0x15')]){_0x413e07[_0x6460('0x16')]={'user':_0x63bb30[_0x6460('0x13')][_0x6460('0xf')][_0x6460('0x17')],'pass':_0x63bb30[_0x6460('0x13')]['Smtp'][_0x6460('0x18')]};}var _0x22e55a={'account':_0x413e07,'message':{'from':util['format'](_0x6460('0x19'),_0x63bb30[_0x6460('0x13')]['name'],_0x63bb30[_0x6460('0x13')]['email']||_0x63bb30['MailAccount'][_0x6460('0xf')][_0x6460('0x17')]),'to':_0x63bb30[_0x6460('0xe')],'cc':_0x63bb30['cc'],'bcc':_0x63bb30[_0x6460('0x1a')],'subject':util[_0x6460('0x1b')](_0x6460('0x1c'),_0x1ad143[_0x6460('0x1d')],_0x63bb30['subtractNumber'],_0x63bb30['subtractUnit'])}};var _0x12e574=path[_0x6460('0x1e')](__dirname,_0x6460('0x1f'));var _0x40ee13=_0x1ad143[_0x6460('0x20')];var _0x15b509=util[_0x6460('0x1b')]('%s.%s',path[_0x6460('0x21')](_0x1ad143[_0x6460('0x20')],path[_0x6460('0x22')](_0x1ad143[_0x6460('0x20')])),_0x6460('0x23'));var _0x3cd521=path[_0x6460('0x1e')](_0x12e574,_0x40ee13);var _0x569340=path[_0x6460('0x1e')](_0x12e574,_0x15b509);if(fs[_0x6460('0x24')](_0x3cd521)){_0x1ad143[_0x6460('0x25')]=_0x6460('0x26');_0x22e55a[_0x6460('0x27')]['attachments']=[{'filename':_0x40ee13,'path':_0x3cd521}];_0x22e55a[_0x6460('0x27')][_0x6460('0x28')]=util[_0x6460('0x1b')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x6460('0x29')](_0x1ad143,null,0x2));}else if(fs[_0x6460('0x24')](_0x569340)){_0x1ad143['status']='Sent';_0x22e55a[_0x6460('0x27')][_0x6460('0x2a')]=[{'filename':_0x15b509,'path':_0x569340}];}else{_0x22e55a[_0x6460('0x27')][_0x6460('0x28')]=_0x6460('0x2b');if(!_0x63bb30[_0x6460('0x2c')]){_0x11181a=![];logger[_0x6460('0xd')](_0x6460('0x2d'));}}if(_0x11181a){return client[_0x6460('0x2e')](_0x6460('0x2f'),_0x22e55a)[_0x6460('0x30')](function(_0x19d979){if(_0x19d979[_0x6460('0x31')]){return logger['error'](_0x6460('0x32'),JSON[_0x6460('0x29')](_0x19d979));}return logger[_0x6460('0xd')](_0x6460('0x33'));})[_0x6460('0x34')](function(_0x557738){return logger[_0x6460('0x31')](_0x6460('0x32'),JSON[_0x6460('0x29')](_0x557738));});}};}function handleError(){return function(_0x5f411a){return logger[_0x6460('0x31')](JSON[_0x6460('0x29')](_0x5f411a));};}function handleResult(_0x2b8f93){return function(_0x1f41a5){logger[_0x6460('0xd')]('data',JSON[_0x6460('0x29')](_0x1f41a5));if(_0x2b8f93[_0x6460('0x13')]&&_0x2b8f93['MailAccount'][_0x6460('0xf')]&&!_[_0x6460('0x35')](_0x2b8f93[_0x6460('0xe')])){setTimeout(handleSendEmail(_0x2b8f93,_0x1f41a5),0x3c*0x3e8);}};}function handleJob(_0x45e580){return function(){try{if(_[_0x6460('0x35')](_0x45e580[_0x6460('0x36')])){return logger['info'](_0x6460('0x37'));}if(_[_0x6460('0x35')](_0x45e580[_0x6460('0x38')])){return logger['info'](_0x6460('0x39'));}var _0x470be1={'startDate':moment()[_0x6460('0x3a')](_0x45e580[_0x6460('0x36')],_0x45e580['subtractUnit'])['format'](_0x6460('0x3b')),'endDate':moment()[_0x6460('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x45e580['output'],'name':_0x45e580[_0x6460('0x1d')]};if(!_[_0x6460('0x35')](_0x45e580[_0x6460('0x3c')])){logger[_0x6460('0xd')](_0x6460('0x3d'),_0x45e580[_0x6460('0x3c')]);return analyticDefaultReportController['runReport']({'id':_0x45e580['DefaultReportId']},_0x470be1)[_0x6460('0x30')](handleResult(_0x45e580))[_0x6460('0x34')](handleError());}if(!_[_0x6460('0x35')](_0x45e580['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x45e580[_0x6460('0x3e')]);return analyticCustomReportController['runReport']({'id':_0x45e580[_0x6460('0x3e')]},_0x470be1)['then'](handleResult(_0x45e580))[_0x6460('0x34')](handleError());}}catch(_0x21aad4){logger[_0x6460('0x31')](JSON[_0x6460('0x29')](_0x21aad4));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x558145){var _0x528d8f={};if(_0x558145){_0x528d8f['id']=_0x558145;}return db[_0x6460('0x3f')]['findAll']({'where':_0x528d8f,'include':[{'model':db[_0x6460('0x13')],'attributes':['id','name',_0x6460('0xe')],'include':[{'model':db[_0x6460('0x40')],'as':'Smtp'}]}]})[_0x6460('0x30')](function(_0x5d4f5c){var _0x14d119=_[_0x6460('0x41')](manager['jobs']);var _0x23597d=_[_0x6460('0x42')](_0x5d4f5c,function(_0x21142e){return _0x21142e['id'][_0x6460('0x43')]();});var _0x174c30=_[_0x6460('0x44')](_0x5d4f5c,function(_0x5052ef){return _0x5052ef['id'][_0x6460('0x43')]();});var _0x1a7623=_0x558145?_0x23597d:_['difference'](_0x23597d,_0x14d119);var _0x295ea4=_[_0x6460('0x45')](_0x23597d,_0x14d119);var _0x39ec1c=_[_0x6460('0x46')](_0x14d119,_0x23597d);var _0x1f0aa4;var _0x296f32;for(_0x1f0aa4=0x0;_0x1f0aa4<_0x39ec1c[_0x6460('0x47')]&&!_0x558145;_0x1f0aa4+=0x1){_0x296f32=_0x39ec1c[_0x1f0aa4][_0x6460('0x43')]();if(manager[_0x6460('0x48')](_0x296f32)){manager['stop'](_0x296f32);manager[_0x6460('0x49')](_0x296f32);logger[_0x6460('0xd')](_0x6460('0x4a'),_0x296f32);}}logger[_0x6460('0xd')](_0x6460('0x4b'),JSON[_0x6460('0x29')](_0x1a7623));for(_0x1f0aa4=0x0;_0x1f0aa4<_0x1a7623[_0x6460('0x47')];_0x1f0aa4+=0x1){_0x296f32=_0x1a7623[_0x1f0aa4][_0x6460('0x43')]();logger[_0x6460('0xd')](_0x6460('0x4c'),_0x296f32);if(_0x558145){logger['info'](_0x6460('0x4d'),_0x558145);logger[_0x6460('0xd')](JSON[_0x6460('0x29')](_0x174c30[_0x296f32]));BPromise[_0x6460('0x4e')]()['then'](handleJob(_0x174c30[_0x296f32]));logger[_0x6460('0xd')](_0x6460('0x4f'),_0x174c30[_0x296f32][_0x6460('0x1d')],_0x174c30[_0x296f32][_0x6460('0x50')]);}else if(_0x174c30[_0x296f32]['cron']&&_0x174c30[_0x296f32][_0x6460('0x51')]&&moment()['isBetween'](_0x174c30[_0x296f32][_0x6460('0x52')],_0x174c30[_0x296f32]['endAt'])){manager[_0x6460('0x53')](_0x296f32,_0x174c30[_0x296f32][_0x6460('0x50')],handleJob(_0x174c30[_0x296f32]));manager[_0x6460('0x54')](_0x296f32);logger['info'](_0x6460('0x55'),_0x174c30[_0x296f32]['name'],_0x174c30[_0x296f32]['cron']);}else if(manager['exists'](_0x296f32)){manager[_0x6460('0x56')](_0x296f32);manager['deleteJob'](_0x296f32);logger[_0x6460('0xd')]('stop\x20cron',_0x174c30[_0x296f32][_0x6460('0x1d')],_0x174c30[_0x296f32]['cron']);}}for(_0x1f0aa4=0x0,_0x296f32;_0x1f0aa4<_0x295ea4[_0x6460('0x47')]&&!_0x558145;_0x1f0aa4+=0x1){_0x296f32=_0x295ea4[_0x1f0aa4][_0x6460('0x43')]();if(manager[_0x6460('0x48')](_0x296f32)){if(_0x174c30[_0x296f32][_0x6460('0x50')]&&_0x174c30[_0x296f32][_0x6460('0x51')]&&moment()[_0x6460('0x57')](_0x174c30[_0x296f32][_0x6460('0x52')],_0x174c30[_0x296f32][_0x6460('0x58')])){manager[_0x6460('0x59')](_0x296f32,_0x174c30[_0x296f32][_0x6460('0x50')],handleJob(_0x174c30[_0x296f32]));logger[_0x6460('0xd')](_0x6460('0x5a'),_0x174c30[_0x296f32]['name'],_0x174c30[_0x296f32][_0x6460('0x50')]);}else{manager[_0x6460('0x56')](_0x296f32);manager[_0x6460('0x49')](_0x296f32);logger[_0x6460('0xd')](_0x6460('0x5b'),_0x174c30[_0x296f32][_0x6460('0x1d')],_0x174c30[_0x296f32][_0x6460('0x50')]);}}}})['catch'](function(_0x4e1223){logger[_0x6460('0x31')](JSON[_0x6460('0x29')](_0x4e1223));});}exports[_0x6460('0x5c')]=function(_0x37927a){return getJobs(_0x37927a);};exports[_0x6460('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 499b36c..daaade8 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae8e=['update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Neutral','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','fileText'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0xae8e,0xc3));var _0xeae8=function(_0x131bb1,_0x5c91cc){_0x131bb1=_0x131bb1-0x0;var _0x4b006b=_0xae8e[_0x131bb1];return _0x4b006b;};var _=require(_0xeae8('0x0'));var AWS=require(_0xeae8('0x1'));var rp=require(_0xeae8('0x2'));var util=require(_0xeae8('0x3'));var BPromise=require(_0xeae8('0x4'));var db=require(_0xeae8('0x5'))['db'];var logger=require(_0xeae8('0x6'))(_0xeae8('0x7'));function getTranscriptionJob(_0x150137,_0x1e2859,_0x16c179,_0x27545b){return new Promise(function(_0x23b0d7,_0x17345e){var _0x1a573d=new AWS[(_0xeae8('0x8'))]({'accessKeyId':_0x1e2859,'secretAccessKey':_0x150137,'region':_0x16c179});_0x1a573d[_0xeae8('0x9')]({'TranscriptionJobName':_0x27545b},function(_0xb4a0eb,_0x16e287){if(_0xb4a0eb){return _0x17345e(_0xb4a0eb);}else{return _0x23b0d7(_0x16e287);}});});}function sentiment(_0x36f7cf,_0x171b2a,_0x25af4f,_0xd67ad2,_0x3630b7){return new Promise(function(_0xf289d2,_0x37b73b){var _0x1c6e8a=new AWS[(_0xeae8('0xa'))]({'accessKeyId':_0x171b2a,'secretAccessKey':_0x36f7cf,'region':_0x25af4f});_0x1c6e8a[_0xeae8('0xb')]({'Text':_0xd67ad2,'LanguageCode':_0x3630b7[_0xeae8('0xc')](0x0,0x2)},function(_0x390e06,_0x5479ed){if(_0x390e06){return _0x37b73b(_0x390e06);}else{return _0xf289d2(_0x5479ed);}});});}function checkTranscribeJob(_0x21975a,_0x1a2d05,_0x2f80a8){var _0x15431e;return new BPromise(function(_0x87b89a,_0x2a2ee6){logger['info'](util[_0xeae8('0xd')](_0xeae8('0xe'),_0x21975a['id'],_0x21975a[_0xeae8('0xf')]));return getTranscriptionJob(_0x2f80a8[_0xeae8('0x10')],_0x2f80a8[_0xeae8('0x11')],_0x1a2d05[_0xeae8('0x12')],_0x21975a[_0xeae8('0xf')])['then'](function(_0x2290d3){logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x14'),_0x21975a['id'],_0x21975a[_0xeae8('0xf')],_0x2290d3[_0xeae8('0x15')][_0xeae8('0x16')]));if(!_0x21975a['fileText']){switch(_0x2290d3['TranscriptionJob']['TranscriptionJobStatus']){case _0xeae8('0x17'):var _0x5b204f={'transcribeStatus':_0x2290d3['TranscriptionJob'][_0xeae8('0x16')],'fileUri':_0x2290d3[_0xeae8('0x15')][_0xeae8('0x18')][_0xeae8('0x19')]};logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x1a'),_0x21975a['id']));return rp({'uri':_0x2290d3[_0xeae8('0x15')][_0xeae8('0x18')][_0xeae8('0x19')],'json':!![]})[_0xeae8('0x1b')](function(_0x59aaae){logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x1c'),_0x21975a['id']));if(_0x59aaae&&_0x59aaae['results']&&_0x59aaae['results'][_0xeae8('0x1d')]&&_0x59aaae[_0xeae8('0x1e')][_0xeae8('0x1d')][_0xeae8('0x1f')]){_0x5b204f[_0xeae8('0x20')]='';for(var _0x3c41ae=0x0;_0x3c41ae<_0x59aaae[_0xeae8('0x1e')][_0xeae8('0x1d')][_0xeae8('0x1f')];_0x3c41ae++){_0x5b204f[_0xeae8('0x20')]+=_0x59aaae[_0xeae8('0x1e')][_0xeae8('0x1d')][_0x3c41ae]['transcript']+'';}}return _0x21975a[_0xeae8('0x21')](_0x5b204f);})[_0xeae8('0x1b')](function(){logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x22'),_0x21975a['id']));if(!_0x21975a[_0xeae8('0x23')]){throw new db[(_0xeae8('0x24'))]['ValidationError'](_0xeae8('0x25'));}if(!_0x1a2d05['sentiment']||!_0x1a2d05[_0xeae8('0x26')]||!_0x1a2d05[_0xeae8('0x27')]||!_0x1a2d05[_0xeae8('0x28')]||!_0x1a2d05[_0xeae8('0x29')]){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))](_0xeae8('0x2b'));}if(!_0x5b204f[_0xeae8('0x20')]){throw new Error(_0xeae8('0x2c'));}if(_0x1a2d05[_0xeae8('0x26')]===_0x2f80a8['id']){return _0x2f80a8;}else{return db[_0xeae8('0x2d')][_0xeae8('0x2e')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xeae8('0x1b')](function(_0x1c72c2){if(!_0x1c72c2){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))](_0xeae8('0x2f'));}if(!_0x1c72c2[_0xeae8('0x10')]||!_0x1c72c2[_0xeae8('0x11')]){throw new db['Sequelize'][(_0xeae8('0x2a'))](_0xeae8('0x30'));}_0x15431e=_0x1c72c2;logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x31'),_0x21975a['id']));return sentiment(_0x15431e[_0xeae8('0x10')],_0x15431e['data2'],_0x1a2d05[_0xeae8('0x27')],_0x5b204f['fileText'],_0x1a2d05[_0xeae8('0x28')]);})['then'](function(_0x5657c3){logger[_0xeae8('0x13')](util[_0xeae8('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x21975a['id']));return _0x21975a['update']({'sentiment':_0x5657c3['Sentiment'],'sPositive':_0x5657c3[_0xeae8('0x32')][_0xeae8('0x33')],'sNegative':_0x5657c3['SentimentScore'][_0xeae8('0x34')],'sMixed':_0x5657c3[_0xeae8('0x32')][_0xeae8('0x35')],'sNeutral':_0x5657c3[_0xeae8('0x32')]['Neutral']});})[_0xeae8('0x1b')](function(){logger[_0xeae8('0x13')](util[_0xeae8('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x21975a['id']));_0x87b89a();});case _0xeae8('0x36'):return _0x21975a[_0xeae8('0x21')]({'transcribeStatus':'FAILED','failureReason':_0x2290d3['TranscriptionJob'][_0xeae8('0x37')]})[_0xeae8('0x1b')](function(){logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x22'),_0x21975a['id']));_0x87b89a();});default:logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x38'),_0x21975a['id']));break;}}else{return BPromise['resolve']()[_0xeae8('0x1b')](function(){if(!_0x21975a[_0xeae8('0x23')]){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))](_0xeae8('0x25'));}if(!_0x1a2d05[_0xeae8('0x39')]||!_0x1a2d05[_0xeae8('0x26')]||!_0x1a2d05[_0xeae8('0x27')]||!_0x1a2d05[_0xeae8('0x28')]||!_0x1a2d05[_0xeae8('0x29')]){throw new db['Sequelize'][(_0xeae8('0x2a'))](_0xeae8('0x2b'));}if(!_0x21975a[_0xeae8('0x20')]){throw new Error(_0xeae8('0x2c'));}if(_0x1a2d05['sentimentAccountId']===_0x2f80a8['id']){return _0x2f80a8;}else{return db[_0xeae8('0x2d')][_0xeae8('0x2e')]({'where':{'id':_settings[_0xeae8('0x26')]}});}})[_0xeae8('0x1b')](function(_0x48da6b){if(!_0x48da6b){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))](_0xeae8('0x2f'));}if(!_0x48da6b[_0xeae8('0x10')]||!_0x48da6b[_0xeae8('0x11')]){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))](_0xeae8('0x30'));}_0x15431e=_0x48da6b;logger[_0xeae8('0x13')](util[_0xeae8('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x21975a['id']));return sentiment(_0x15431e['data1'],_0x15431e[_0xeae8('0x11')],_0x1a2d05[_0xeae8('0x27')],_0x21975a['fileText'],_0x1a2d05[_0xeae8('0x28')]);})['then'](function(_0x3eb665){logger[_0xeae8('0x13')](util[_0xeae8('0xd')](_0xeae8('0x3a'),_0x21975a['id']));return _0x21975a[_0xeae8('0x21')]({'sentiment':_0x3eb665[_0xeae8('0x3b')],'sPositive':_0x3eb665[_0xeae8('0x32')][_0xeae8('0x33')],'sNegative':_0x3eb665[_0xeae8('0x32')]['Negative'],'sMixed':_0x3eb665[_0xeae8('0x32')]['Mixed'],'sNeutral':_0x3eb665[_0xeae8('0x32')][_0xeae8('0x3c')],'transcribeStatus':_0xeae8('0x17')});})['then'](function(){logger[_0xeae8('0x13')](util[_0xeae8('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x21975a['id']));_0x87b89a();});}})[_0xeae8('0x3d')](function(_0x417b11){if(_0x417b11){if(!_0x417b11[_0xeae8('0x3e')]||_0x417b11[_0xeae8('0x3e')]!=='SequelizeValidationError'){logger[_0xeae8('0x3f')](util[_0xeae8('0xd')](_0xeae8('0x40'),_0x21975a['id']),util[_0xeae8('0x41')](_0x417b11,{'showHidden':![],'depth':null}));}}_0x87b89a();});});}function checkTranscribe(){var _0x25c342;var _0x16a7f4;var _0x2c0c35;return db[_0xeae8('0x42')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xeae8('0x1b')](function(_0x33b7cd){if(!_0x33b7cd||!_0x33b7cd[_0xeae8('0x1f')]){throw new db['Sequelize'][(_0xeae8('0x2a'))](_0xeae8('0x43'));}_0x25c342=_0x33b7cd;return db[_0xeae8('0x44')][_0xeae8('0x2e')]({'where':{'id':0x1}});})[_0xeae8('0x1b')](function(_0x22f44d){if(!_0x22f44d){throw new db['Sequelize'][(_0xeae8('0x2a'))](_0xeae8('0x45'));}_0x16a7f4=_0x22f44d;if(!_0x16a7f4['transcribe']||!_0x16a7f4['transcribeAccountId']||!_0x16a7f4[_0xeae8('0x12')]||!_0x16a7f4['language']||!_0x16a7f4['bucket']){throw new db[(_0xeae8('0x24'))]['ValidationError'](_0xeae8('0x46'));}return db[_0xeae8('0x2d')][_0xeae8('0x2e')]({'where':{'id':_0x16a7f4[_0xeae8('0x47')]}});})['then'](function(_0x52fdab){if(!_0x52fdab){throw new db[(_0xeae8('0x24'))]['ValidationError'](_0xeae8('0x2f'));}if(!_0x52fdab[_0xeae8('0x10')]||!_0x52fdab['data2']){throw new db[(_0xeae8('0x24'))][(_0xeae8('0x2a'))]('Cloud\x20Provider\x20not\x20configured');}_0x2c0c35=_0x52fdab;var _0x1d8284=[];_0x25c342[_0xeae8('0x48')](function(_0x5a57a0){_0x1d8284['push'](checkTranscribeJob(_0x5a57a0,_0x16a7f4,_0x2c0c35));});return BPromise[_0xeae8('0x49')](_0x1d8284);})[_0xeae8('0x3d')](function(_0x20216d){if(_0x20216d){if(!_0x20216d[_0xeae8('0x3e')]||_0x20216d[_0xeae8('0x3e')]!==_0xeae8('0x4a')){logger[_0xeae8('0x3f')](util['inspect'](_0x20216d,{'showHidden':![],'depth':null}));}}});}exports[_0xeae8('0x4b')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x851a=['Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','error','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError'];(function(_0x160055,_0x3b55c2){var _0x5a8a7c=function(_0x103b31){while(--_0x103b31){_0x160055['push'](_0x160055['shift']());}};_0x5a8a7c(++_0x3b55c2);}(_0x851a,0x19b));var _0xa851=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x851a[_0x4a53d];return _0x27410e;};var _=require(_0xa851('0x0'));var AWS=require('aws-sdk');var rp=require(_0xa851('0x1'));var util=require(_0xa851('0x2'));var BPromise=require(_0xa851('0x3'));var db=require(_0xa851('0x4'))['db'];var logger=require(_0xa851('0x5'))(_0xa851('0x6'));function getTranscriptionJob(_0x1b30dc,_0x3f317d,_0x4a10c8,_0xdd4995){return new Promise(function(_0x57a7c4,_0x1cba67){var _0x2fc0e0=new AWS[(_0xa851('0x7'))]({'accessKeyId':_0x3f317d,'secretAccessKey':_0x1b30dc,'region':_0x4a10c8});_0x2fc0e0['getTranscriptionJob']({'TranscriptionJobName':_0xdd4995},function(_0x3e1e9d,_0xa2162e){if(_0x3e1e9d){return _0x1cba67(_0x3e1e9d);}else{return _0x57a7c4(_0xa2162e);}});});}function sentiment(_0x1334a1,_0x459f94,_0x51f1be,_0x393900,_0x156b4c){return new Promise(function(_0x5a3726,_0x3b1a9b){var _0x23dd94=new AWS[(_0xa851('0x8'))]({'accessKeyId':_0x459f94,'secretAccessKey':_0x1334a1,'region':_0x51f1be});_0x23dd94[_0xa851('0x9')]({'Text':_0x393900,'LanguageCode':_0x156b4c[_0xa851('0xa')](0x0,0x2)},function(_0x3316aa,_0x18059e){if(_0x3316aa){return _0x3b1a9b(_0x3316aa);}else{return _0x5a3726(_0x18059e);}});});}function checkTranscribeJob(_0x2fb982,_0x24c9b0,_0x184d51){var _0x349d2d;return new BPromise(function(_0x25efd8,_0x94f6d9){logger[_0xa851('0xb')](util[_0xa851('0xc')](_0xa851('0xd'),_0x2fb982['id'],_0x2fb982[_0xa851('0xe')]));return getTranscriptionJob(_0x184d51[_0xa851('0xf')],_0x184d51['data2'],_0x24c9b0[_0xa851('0x10')],_0x2fb982[_0xa851('0xe')])[_0xa851('0x11')](function(_0x3d4dd6){logger['info'](util[_0xa851('0xc')](_0xa851('0x12'),_0x2fb982['id'],_0x2fb982[_0xa851('0xe')],_0x3d4dd6[_0xa851('0x13')][_0xa851('0x14')]));if(!_0x2fb982['fileText']){switch(_0x3d4dd6[_0xa851('0x13')]['TranscriptionJobStatus']){case _0xa851('0x15'):var _0x7afd4={'transcribeStatus':_0x3d4dd6[_0xa851('0x13')][_0xa851('0x14')],'fileUri':_0x3d4dd6[_0xa851('0x13')][_0xa851('0x16')][_0xa851('0x17')]};logger[_0xa851('0xb')](util[_0xa851('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x2fb982['id']));return rp({'uri':_0x3d4dd6[_0xa851('0x13')][_0xa851('0x16')]['TranscriptFileUri'],'json':!![]})[_0xa851('0x11')](function(_0x258266){logger['info'](util[_0xa851('0xc')](_0xa851('0x18'),_0x2fb982['id']));if(_0x258266&&_0x258266[_0xa851('0x19')]&&_0x258266[_0xa851('0x19')][_0xa851('0x1a')]&&_0x258266[_0xa851('0x19')][_0xa851('0x1a')][_0xa851('0x1b')]){_0x7afd4[_0xa851('0x1c')]='';for(var _0x3f5428=0x0;_0x3f5428<_0x258266[_0xa851('0x19')][_0xa851('0x1a')]['length'];_0x3f5428++){_0x7afd4[_0xa851('0x1c')]+=_0x258266[_0xa851('0x19')][_0xa851('0x1a')][_0x3f5428]['transcript']+'';}}return _0x2fb982[_0xa851('0x1d')](_0x7afd4);})['then'](function(){logger[_0xa851('0xb')](util['format'](_0xa851('0x1e'),_0x2fb982['id']));if(!_0x2fb982[_0xa851('0x1f')]){throw new db['Sequelize'][(_0xa851('0x20'))](_0xa851('0x21'));}if(!_0x24c9b0[_0xa851('0x22')]||!_0x24c9b0[_0xa851('0x23')]||!_0x24c9b0[_0xa851('0x24')]||!_0x24c9b0[_0xa851('0x25')]||!_0x24c9b0['bucket']){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x27'));}if(!_0x7afd4['fileText']){throw new Error(_0xa851('0x28'));}if(_0x24c9b0[_0xa851('0x23')]===_0x184d51['id']){return _0x184d51;}else{return db[_0xa851('0x29')][_0xa851('0x2a')]({'where':{'id':_settings[_0xa851('0x23')]}});}})[_0xa851('0x11')](function(_0x1b35f8){if(!_0x1b35f8){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x2b'));}if(!_0x1b35f8[_0xa851('0xf')]||!_0x1b35f8[_0xa851('0x2c')]){throw new db['Sequelize'][(_0xa851('0x20'))](_0xa851('0x2d'));}_0x349d2d=_0x1b35f8;logger[_0xa851('0xb')](util[_0xa851('0xc')](_0xa851('0x2e'),_0x2fb982['id']));return sentiment(_0x349d2d[_0xa851('0xf')],_0x349d2d['data2'],_0x24c9b0['sentimentRegion'],_0x7afd4[_0xa851('0x1c')],_0x24c9b0[_0xa851('0x25')]);})['then'](function(_0x26ca81){logger[_0xa851('0xb')](util[_0xa851('0xc')](_0xa851('0x2f'),_0x2fb982['id']));return _0x2fb982[_0xa851('0x1d')]({'sentiment':_0x26ca81[_0xa851('0x30')],'sPositive':_0x26ca81[_0xa851('0x31')][_0xa851('0x32')],'sNegative':_0x26ca81[_0xa851('0x31')]['Negative'],'sMixed':_0x26ca81[_0xa851('0x31')][_0xa851('0x33')],'sNeutral':_0x26ca81[_0xa851('0x31')][_0xa851('0x34')]});})[_0xa851('0x11')](function(){logger[_0xa851('0xb')](util['format'](_0xa851('0x1e'),_0x2fb982['id']));_0x25efd8();});case _0xa851('0x35'):return _0x2fb982['update']({'transcribeStatus':_0xa851('0x35'),'failureReason':_0x3d4dd6['TranscriptionJob'][_0xa851('0x36')]})[_0xa851('0x11')](function(){logger[_0xa851('0xb')](util['format'](_0xa851('0x1e'),_0x2fb982['id']));_0x25efd8();});default:logger['info'](util[_0xa851('0xc')](_0xa851('0x37'),_0x2fb982['id']));break;}}else{return BPromise[_0xa851('0x38')]()[_0xa851('0x11')](function(){if(!_0x2fb982[_0xa851('0x1f')]){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x21'));}if(!_0x24c9b0[_0xa851('0x22')]||!_0x24c9b0[_0xa851('0x23')]||!_0x24c9b0[_0xa851('0x24')]||!_0x24c9b0[_0xa851('0x25')]||!_0x24c9b0[_0xa851('0x39')]){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x27'));}if(!_0x2fb982[_0xa851('0x1c')]){throw new Error(_0xa851('0x28'));}if(_0x24c9b0[_0xa851('0x23')]===_0x184d51['id']){return _0x184d51;}else{return db['CloudProvider'][_0xa851('0x2a')]({'where':{'id':_settings[_0xa851('0x23')]}});}})[_0xa851('0x11')](function(_0x569128){if(!_0x569128){throw new db['Sequelize'][(_0xa851('0x20'))](_0xa851('0x2b'));}if(!_0x569128['data1']||!_0x569128[_0xa851('0x2c')]){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x2d'));}_0x349d2d=_0x569128;logger[_0xa851('0xb')](util[_0xa851('0xc')](_0xa851('0x2e'),_0x2fb982['id']));return sentiment(_0x349d2d[_0xa851('0xf')],_0x349d2d['data2'],_0x24c9b0[_0xa851('0x24')],_0x2fb982['fileText'],_0x24c9b0[_0xa851('0x25')]);})[_0xa851('0x11')](function(_0x4effed){logger[_0xa851('0xb')](util[_0xa851('0xc')](_0xa851('0x2f'),_0x2fb982['id']));return _0x2fb982[_0xa851('0x1d')]({'sentiment':_0x4effed[_0xa851('0x30')],'sPositive':_0x4effed[_0xa851('0x31')]['Positive'],'sNegative':_0x4effed[_0xa851('0x31')][_0xa851('0x3a')],'sMixed':_0x4effed[_0xa851('0x31')][_0xa851('0x33')],'sNeutral':_0x4effed[_0xa851('0x31')][_0xa851('0x34')],'transcribeStatus':_0xa851('0x15')});})['then'](function(){logger[_0xa851('0xb')](util[_0xa851('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fb982['id']));_0x25efd8();});}})[_0xa851('0x3b')](function(_0xc5e352){if(_0xc5e352){if(!_0xc5e352[_0xa851('0x3c')]||_0xc5e352[_0xa851('0x3c')]!==_0xa851('0x3d')){logger['error'](util[_0xa851('0xc')](_0xa851('0x3e'),_0x2fb982['id']),util[_0xa851('0x3f')](_0xc5e352,{'showHidden':![],'depth':null}));}}_0x25efd8();});});}function checkTranscribe(){var _0x459c04;var _0x2b489a;var _0xa5dde8;return db['VoiceRecording'][_0xa851('0x40')]({'where':{'transcribeStatus':_0xa851('0x41')}})['then'](function(_0x3c5263){if(!_0x3c5263||!_0x3c5263[_0xa851('0x1b')]){throw new db['Sequelize'][(_0xa851('0x20'))](_0xa851('0x42'));}_0x459c04=_0x3c5263;return db[_0xa851('0x43')][_0xa851('0x2a')]({'where':{'id':0x1}});})[_0xa851('0x11')](function(_0x1bf34b){if(!_0x1bf34b){throw new db['Sequelize'][(_0xa851('0x20'))](_0xa851('0x44'));}_0x2b489a=_0x1bf34b;if(!_0x2b489a[_0xa851('0x6')]||!_0x2b489a[_0xa851('0x45')]||!_0x2b489a[_0xa851('0x10')]||!_0x2b489a[_0xa851('0x25')]||!_0x2b489a[_0xa851('0x39')]){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x46'));}return db[_0xa851('0x29')][_0xa851('0x2a')]({'where':{'id':_0x2b489a[_0xa851('0x45')]}});})[_0xa851('0x11')](function(_0x492b9a){if(!_0x492b9a){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x2b'));}if(!_0x492b9a[_0xa851('0xf')]||!_0x492b9a[_0xa851('0x2c')]){throw new db[(_0xa851('0x26'))][(_0xa851('0x20'))](_0xa851('0x2d'));}_0xa5dde8=_0x492b9a;var _0x4d838b=[];_0x459c04[_0xa851('0x47')](function(_0x94eacd){_0x4d838b['push'](checkTranscribeJob(_0x94eacd,_0x2b489a,_0xa5dde8));});return BPromise['all'](_0x4d838b);})[_0xa851('0x3b')](function(_0x188ae8){if(_0x188ae8){if(!_0x188ae8[_0xa851('0x3c')]||_0x188ae8[_0xa851('0x3c')]!==_0xa851('0x3d')){logger[_0xa851('0x48')](util[_0xa851('0x3f')](_0x188ae8,{'showHidden':![],'depth':null}));}}});}exports[_0xa851('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 37ba118..91ffe4c 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf10=['emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x50daa4,_0x3c336d){var _0x389935=function(_0x292d12){while(--_0x292d12){_0x50daa4['push'](_0x50daa4['shift']());}};_0x389935(++_0x3c336d);}(_0xbf10,0x114));var _0x0bf1=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xbf10[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0bf1('0x0'));var moment=require(_0x0bf1('0x1'));var Redis=require('ioredis');var util=require(_0x0bf1('0x2'));var config=require(_0x0bf1('0x3'));var db=require(_0x0bf1('0x4'))['db'];var logger=require('../logger')(_0x0bf1('0x5'));config[_0x0bf1('0x6')]=_[_0x0bf1('0x7')](config['redis'],{'host':_0x0bf1('0x8'),'port':0x18eb});var io=require(_0x0bf1('0x9'))(new Redis(config[_0x0bf1('0x6')]));function closeInteractions(){var _0x4a68cc=[];return db[_0x0bf1('0xa')][_0x0bf1('0xb')]({'raw':!![],'attributes':['id',_0x0bf1('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0bf1('0xd')](0x18,'hours')}}})[_0x0bf1('0xe')](function(_0xeb1571){if(_0xeb1571&&_0xeb1571['length']){_0x4a68cc=_[_0x0bf1('0xf')](_0xeb1571||[],'id');logger[_0x0bf1('0x10')](_0x0bf1('0x11'),_0x4a68cc[_0x0bf1('0x12')]());return db[_0x0bf1('0xa')]['update']({'closeReason':_0x0bf1('0x13'),'disposition':_0x0bf1('0x14'),'closed':!![],'closedAt':moment()[_0x0bf1('0x15')](_0x0bf1('0x16'))},{'where':{'id':_0x4a68cc}});}})[_0x0bf1('0xe')](function(){if(_0x4a68cc&&_0x4a68cc[_0x0bf1('0x17')]){logger[_0x0bf1('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4a68cc[_0x0bf1('0x12')]());for(var _0x2c335a=0x0;_0x2c335a<_0x4a68cc['length'];_0x2c335a++){io[_0x0bf1('0x18')]('whatsappInteraction:update',{'id':_0x4a68cc[_0x2c335a],'closed':!![]});}}})[_0x0bf1('0x19')](function(_0x8558c6){logger[_0x0bf1('0x1a')](_0x0bf1('0x1b'),_0x8558c6?util[_0x0bf1('0x1c')](_0x8558c6,{'showHidden':![],'depth':null}):'');});}exports[_0x0bf1('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x80e6=['redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','schedule','defaults'];(function(_0x351a2a,_0x39128c){var _0x41f2b0=function(_0x2ec973){while(--_0x2ec973){_0x351a2a['push'](_0x351a2a['shift']());}};_0x41f2b0(++_0x39128c);}(_0x80e6,0x1e7));var _0x680e=function(_0x1e5898,_0x403bda){_0x1e5898=_0x1e5898-0x0;var _0x474e78=_0x80e6[_0x1e5898];return _0x474e78;};'use strict';var _=require('lodash');var moment=require(_0x680e('0x0'));var Redis=require(_0x680e('0x1'));var util=require('util');var config=require(_0x680e('0x2'));var db=require(_0x680e('0x3'))['db'];var logger=require('../logger')(_0x680e('0x4'));config['redis']=_[_0x680e('0x5')](config[_0x680e('0x6')],{'host':_0x680e('0x7'),'port':0x18eb});var io=require(_0x680e('0x8'))(new Redis(config[_0x680e('0x6')]));function closeInteractions(){var _0x29ce29=[];return db[_0x680e('0x9')][_0x680e('0xa')]({'raw':!![],'attributes':['id',_0x680e('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x680e('0xc')](0x18,_0x680e('0xd'))}}})[_0x680e('0xe')](function(_0x18f7e3){if(_0x18f7e3&&_0x18f7e3[_0x680e('0xf')]){_0x29ce29=_['map'](_0x18f7e3||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x29ce29[_0x680e('0x10')]());return db[_0x680e('0x9')][_0x680e('0x11')]({'closeReason':_0x680e('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x680e('0x13')](_0x680e('0x14'))},{'where':{'id':_0x29ce29}});}})[_0x680e('0xe')](function(){if(_0x29ce29&&_0x29ce29[_0x680e('0xf')]){logger['info'](_0x680e('0x15'),_0x29ce29[_0x680e('0x10')]());for(var _0x3466da=0x0;_0x3466da<_0x29ce29[_0x680e('0xf')];_0x3466da++){io[_0x680e('0x16')](_0x680e('0x17'),{'id':_0x29ce29[_0x3466da],'closed':!![]});}}})[_0x680e('0x18')](function(_0xf5a8b){logger[_0x680e('0x19')](_0x680e('0x1a'),_0xf5a8b?util[_0x680e('0x1b')](_0xf5a8b,{'showHidden':![],'depth':null}):'');});}exports[_0x680e('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7be1247..a824181 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf47=['log','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy','bulkCreate','then','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x3283bc,_0x3d8a52){var _0x347e02=function(_0x166539){while(--_0x166539){_0x3283bc['push'](_0x3283bc['shift']());}};_0x347e02(++_0x3d8a52);}(_0xbf47,0x75));var _0x7bf4=function(_0x21b677,_0x3e5acd){_0x21b677=_0x21b677-0x0;var _0x4d3601=_0xbf47[_0x21b677];return _0x4d3601;};'use strict';var util=require(_0x7bf4('0x0'));var db=require(_0x7bf4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7bf4('0x2')]({'id':i,'firstName':_0x7bf4('0x3')+i,'lastName':_0x7bf4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7bf4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7bf4('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7bf4('0x6')](),'updatedAt':Date[_0x7bf4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7bf4('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7bf4('0x4')+i,'phone':0xf879fb460+i,'email':_0x7bf4('0x7')+i+_0x7bf4('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7bf4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7bf4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7bf4('0x6')](),'updatedAt':Date['now']()});}db[_0x7bf4('0x8')][_0x7bf4('0x9')]({'where':{}})['then'](function(){return db[_0x7bf4('0x8')][_0x7bf4('0xa')](contacts);})[_0x7bf4('0xb')](function(){console['log'](_0x7bf4('0xc'),_0x7bf4('0xd'));return db['CmHopper'][_0x7bf4('0x9')]({'where':{}});})[_0x7bf4('0xb')](function(){return db[_0x7bf4('0xe')][_0x7bf4('0xa')](hopper);})['then'](function(){console['log']('finished\x20populating',_0x7bf4('0xf'));return db[_0x7bf4('0x8')]['bulkCreate'](contacts2);})[_0x7bf4('0xb')](function(){console[_0x7bf4('0x10')](_0x7bf4('0xc'),_0x7bf4('0x11'));return db[_0x7bf4('0xe')]['bulkCreate'](hopper2);})[_0x7bf4('0xb')](function(){console[_0x7bf4('0x10')](_0x7bf4('0xc'),_0x7bf4('0x12'));})['catch'](function(_0x3cdfe3){console[_0x7bf4('0x10')](_0x3cdfe3);}); \ No newline at end of file +var _0xdd2f=['Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','catch','util','../mysqldb','push'];(function(_0x5c76b7,_0x4f391e){var _0x45d6c3=function(_0xce05e7){while(--_0xce05e7){_0x5c76b7['push'](_0x5c76b7['shift']());}};_0x45d6c3(++_0x4f391e);}(_0xdd2f,0x10b));var _0xfdd2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdd2f[_0x160c73];return _0xd9302;};'use strict';var util=require(_0xfdd2('0x0'));var db=require(_0xfdd2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfdd2('0x2')]({'id':i,'firstName':_0xfdd2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xfdd2('0x4')+i+_0xfdd2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xfdd2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xfdd2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xfdd2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xfdd2('0x2')]({'id':i,'firstName':_0xfdd2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xfdd2('0x4')+i+_0xfdd2('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xfdd2('0x6')]()});}db[_0xfdd2('0x7')][_0xfdd2('0x8')]({'where':{}})[_0xfdd2('0x9')](function(){return db[_0xfdd2('0x7')][_0xfdd2('0xa')](contacts);})['then'](function(){console[_0xfdd2('0xb')](_0xfdd2('0xc'),_0xfdd2('0xd'));return db[_0xfdd2('0xe')][_0xfdd2('0x8')]({'where':{}});})[_0xfdd2('0x9')](function(){return db[_0xfdd2('0xe')][_0xfdd2('0xa')](hopper);})['then'](function(){console[_0xfdd2('0xb')](_0xfdd2('0xc'),_0xfdd2('0xf'));return db[_0xfdd2('0x7')][_0xfdd2('0xa')](contacts2);})[_0xfdd2('0x9')](function(){console[_0xfdd2('0xb')]('finished\x20populating',_0xfdd2('0x10'));return db[_0xfdd2('0xe')]['bulkCreate'](hopper2);})[_0xfdd2('0x9')](function(){console[_0xfdd2('0xb')]('finished\x20populating','hopper2');})[_0xfdd2('0x11')](function(_0x3a2753){console['log'](_0x3a2753);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c7e94c3..6662b96 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ec3=['push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','bulkCreate','then','log','add\x20user','catch','util','../mysqldb'];(function(_0x2bbf4e,_0x21ddbc){var _0x39d499=function(_0x3184f9){while(--_0x3184f9){_0x2bbf4e['push'](_0x2bbf4e['shift']());}};_0x39d499(++_0x21ddbc);}(_0x9ec3,0x1ae));var _0x39ec=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x9ec3[_0x3c04ef];return _0x6a3a69;};'use strict';var util=require(_0x39ec('0x0'));var db=require(_0x39ec('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x39ec('0x2')]({'name':util[_0x39ec('0x3')](_0x39ec('0x4'),_0x39ec('0x5'),i),'fullname':util[_0x39ec('0x3')](_0x39ec('0x4'),'agent',i),'email':util['format'](_0x39ec('0x6'),_0x39ec('0x5'),i),'role':_0x39ec('0x5'),'password':'password','internal':0xfa0+i,'type':_0x39ec('0x7'),'transport':[_0x39ec('0x8'),'ws',_0x39ec('0x9')],'disallow':['all'],'allow':[_0x39ec('0xa')],'defaultuser':util[_0x39ec('0x3')](_0x39ec('0x4'),'agent',i),'encryption':'yes','avpf':'yes','force_avp':_0x39ec('0xb'),'icesupport':_0x39ec('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x39ec('0xc'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x39ec('0x4'),_0x39ec('0x5'),i),0xfa0+i)});}db['User'][_0x39ec('0xd')](users)[_0x39ec('0xe')](function(){console[_0x39ec('0xf')](_0x39ec('0x10'));})[_0x39ec('0x11')](function(_0x28031c){console[_0x39ec('0xf')](_0x28031c);}); \ No newline at end of file +var _0x3242=['format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','User','bulkCreate','then','add\x20user','catch','../mysqldb','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3242,0x174));var _0x2324=function(_0xa84d0b,_0x5d2067){_0xa84d0b=_0xa84d0b-0x0;var _0x896a17=_0x3242[_0xa84d0b];return _0x896a17;};'use strict';var util=require('util');var db=require(_0x2324('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2324('0x1')]({'name':util[_0x2324('0x2')](_0x2324('0x3'),_0x2324('0x4'),i),'fullname':util['format'](_0x2324('0x3'),_0x2324('0x4'),i),'email':util[_0x2324('0x2')](_0x2324('0x5'),'agent',i),'role':_0x2324('0x4'),'password':'password','internal':0xfa0+i,'type':_0x2324('0x6'),'transport':[_0x2324('0x7'),'ws',_0x2324('0x8')],'disallow':['all'],'allow':[_0x2324('0x9')],'defaultuser':util[_0x2324('0x2')](_0x2324('0x3'),_0x2324('0x4'),i),'encryption':_0x2324('0xa'),'avpf':'yes','force_avp':_0x2324('0xa'),'icesupport':_0x2324('0xa'),'dtlsenable':_0x2324('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x2324('0xb'),'dtlssetup':'actpass','callerid':util[_0x2324('0x2')]('\x22%s\x22\x20<%s>',util[_0x2324('0x2')]('%s%s','agent',i),0xfa0+i)});}db[_0x2324('0xc')][_0x2324('0xd')](users)[_0x2324('0xe')](function(){console['log'](_0x2324('0xf'));})[_0x2324('0x10')](function(_0x4472b2){console['log'](_0x4472b2);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index f0489ff..5b99291 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ab9=['autoAssociation','VoiceQueues','ChatQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','resourceId','where','role','Campaign','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueues','OpenchannelQueues','Trunks','getFaxQueues','getSmsQueues','getMailQueues','all','length','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','leave','MailInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','connection','remoteAddress','request','SocketIO\x20','nsp','disconnect','DISCONNECTED','util','../mysqldb','./environment','name','User','agent','telephone','type','ivr','UserProfileSection','findOne','then'];(function(_0x27452d,_0xaf9365){var _0x26a713=function(_0x4bee9d){while(--_0x4bee9d){_0x27452d['push'](_0x27452d['shift']());}};_0x26a713(++_0xaf9365);}(_0x5ab9,0x117));var _0x95ab=function(_0x42b030,_0x252cb6){_0x42b030=_0x42b030-0x0;var _0x112303=_0x5ab9[_0x42b030];return _0x112303;};'use strict';var _=require('lodash');var util=require(_0x95ab('0x0'));var BPromise=require('bluebird');var db=require(_0x95ab('0x1'))['db'];var config=require(_0x95ab('0x2'));var queryQueues={'attributes':['id',_0x95ab('0x3')],'include':[{'as':'Agents','model':db[_0x95ab('0x4')],'attributes':['id',_0x95ab('0x3'),'role'],'raw':!![],'where':{'role':_0x95ab('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x95ab('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x95ab('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x95ab('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x95ab('0x7')],'where':{'type':_0x95ab('0x8')}};function getAssociatedResources(_0x1f32c8,_0x2e2696,_0x93e862){return db[_0x95ab('0x9')][_0x95ab('0xa')]({'where':{'name':_0x1f32c8,'userProfileId':_0x2e2696},'raw':!![]})[_0x95ab('0xb')](function(_0x3608ea){if(_0x3608ea){if(_0x3608ea[_0x95ab('0xc')]){switch(_0x1f32c8){case _0x95ab('0xd'):case _0x95ab('0xe'):case'FaxQueues':case'SmsQueues':case _0x95ab('0xf'):case'OpenchannelQueues':case _0x95ab('0x10'):return db[_0x93e862][_0x95ab('0x11')](queryQueues);case _0x95ab('0x12'):return db[_0x93e862]['findAll'](queryTelephones);case'Trunks':return db[_0x93e862][_0x95ab('0x11')](queryTrunks);case _0x95ab('0x13'):return db[_0x93e862][_0x95ab('0x11')](queryCampaigns);}}else{return db[_0x95ab('0x14')][_0x95ab('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x3608ea['id']},'raw':!![]})[_0x95ab('0xb')](function(_0x8743ad){if(_0x8743ad){var _0x27e1a3={'where':{'id':_[_0x95ab('0x15')](_0x8743ad,_0x95ab('0x16'))},'raw':!![]};switch(_0x93e862){case'User':_0x27e1a3[_0x95ab('0x17')][_0x95ab('0x18')]='telephone';break;case _0x95ab('0x19'):_0x27e1a3[_0x95ab('0x17')][_0x95ab('0x7')]=_0x95ab('0x8');break;}return db[_0x93e862][_0x95ab('0x11')](_0x27e1a3);}else{return[];}});}}else{return[];}})[_0x95ab('0xb')](function(_0x87fa32){return _0x87fa32;});}function joinOrLeaveQueues(_0x2ce167,_0x57ddba,_0x504107,_0x337ff3){_0x2ce167[_0x57ddba](util[_0x95ab('0x1a')](_0x95ab('0x1b'),_0x504107,_0x337ff3[_0x95ab('0x3')]));if(_0x337ff3['Agents']){for(var _0x4e5b9b=0x0;_0x4e5b9b<_0x337ff3[_0x95ab('0x1c')]['length'];_0x4e5b9b+=0x1){_0x2ce167[_0x57ddba](util['format'](_0x95ab('0x1d'),_0x337ff3[_0x95ab('0x1c')][_0x4e5b9b][_0x95ab('0x3')]));}}}function joinOrLeave(_0x5c8f59,_0x5ebcc8,_0x2d71f8){var _0x11e92d;if(_0x5c8f59[_0x95ab('0x1e')][_0x95ab('0x1f')]['id']){db[_0x95ab('0x4')][_0x95ab('0x20')]({'attributes':['id',_0x95ab('0x3'),_0x95ab('0x18'),_0x95ab('0x21')],'where':{'id':_0x5c8f59['handshake']['query']['id']},'include':[{'model':db[_0x95ab('0x22')],'as':_0x95ab('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x95ab('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x95ab('0x25')],'as':_0x95ab('0x26'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x95ab('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x95ab('0x28')],'as':_0x95ab('0x29'),'attributes':['id'],'raw':!![]}]})[_0x95ab('0xb')](function(_0x1f5ee8){if(_0x1f5ee8){_0x11e92d=_0x1f5ee8;_0x5c8f59[_0x5ebcc8](util[_0x95ab('0x1a')]('user:%s',_0x1f5ee8[_0x95ab('0x3')]));var _0x24d8e4=[];switch(_0x1f5ee8['role']){case _0x95ab('0x2a'):_0x5c8f59[_0x5ebcc8](_0x95ab('0x2b'));_0x5c8f59[_0x5ebcc8](_0x95ab('0x2c'));if(queryQueues['hasOwnProperty'](_0x95ab('0x2d'))){delete queryQueues[_0x95ab('0x2d')];}_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x2f')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db['ChatQueue'][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x30')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x31')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x32')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x33')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x34')][_0x95ab('0x11')](queryQueues));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x4')][_0x95ab('0x11')](queryTelephones));_0x24d8e4['push'](db[_0x95ab('0x35')][_0x95ab('0x11')](queryTrunks));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x19')][_0x95ab('0x11')](queryCampaigns));_0x24d8e4[_0x95ab('0x2e')](db[_0x95ab('0x4')][_0x95ab('0x11')](queryAgents));break;case _0x95ab('0x36'):_0x5c8f59[_0x5ebcc8](_0x95ab('0x2b'));_0x5c8f59[_0x5ebcc8](_0x95ab('0x2c'));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0xd'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x2f')));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources('ChatQueues',_0x1f5ee8['userProfileId'],'ChatQueue'));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0x37'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x30')));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources('SmsQueues',_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x31')));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources('MailQueues',_0x1f5ee8[_0x95ab('0x21')],'MailQueue'));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0x38'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x33')));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0x10'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x34')));_0x24d8e4['push'](getAssociatedResources(_0x95ab('0x12'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x4')));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0x39'),_0x1f5ee8[_0x95ab('0x21')],'Trunk'));_0x24d8e4[_0x95ab('0x2e')](getAssociatedResources(_0x95ab('0x13'),_0x1f5ee8[_0x95ab('0x21')],_0x95ab('0x19')));_0x24d8e4['push'](db[_0x95ab('0x4')][_0x95ab('0x11')](queryAgents));break;case _0x95ab('0x5'):_0x5c8f59[_0x5ebcc8](_0x95ab('0x2b'));_0x5c8f59[_0x5ebcc8](_0x95ab('0x2c'));_0x24d8e4['push'](_0x1f5ee8['getVoiceQueues']({'attributes':['id',_0x95ab('0x3')]}));_0x24d8e4['push'](_0x1f5ee8['getChatQueues']({'attributes':['id',_0x95ab('0x3')]}));_0x24d8e4[_0x95ab('0x2e')](_0x1f5ee8[_0x95ab('0x3a')]({'attributes':['id',_0x95ab('0x3')]}));_0x24d8e4['push'](_0x1f5ee8[_0x95ab('0x3b')]({'attributes':['id',_0x95ab('0x3')]}));_0x24d8e4[_0x95ab('0x2e')](_0x1f5ee8[_0x95ab('0x3c')]({'attributes':['id','name']}));_0x24d8e4[_0x95ab('0x2e')](_0x1f5ee8['getOpenchannelQueues']({'attributes':['id',_0x95ab('0x3')]}));_0x24d8e4[_0x95ab('0x2e')](_0x1f5ee8['getWhatsappQueues']({'attributes':['id',_0x95ab('0x3')]}));break;}return BPromise[_0x95ab('0x3d')](_0x24d8e4);}})[_0x95ab('0xb')](function(_0x3ea9f0){if(_0x3ea9f0&&_0x3ea9f0[_0x95ab('0x3e')]){for(var _0x215831=0x0;_0x215831<_0x3ea9f0[_0x95ab('0x3e')];_0x215831+=0x1){for(var _0x416a90=0x0;_0x416a90<_0x3ea9f0[_0x215831][_0x95ab('0x3e')];_0x416a90+=0x1){switch(_0x215831){case 0x0:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x3f'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x1:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x40'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x2:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x41'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x3:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x42'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x4:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x43'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x5:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,'openchannel',_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x6:joinOrLeaveQueues(_0x5c8f59,_0x5ebcc8,_0x95ab('0x44'),_0x3ea9f0[_0x215831][_0x416a90]);break;case 0x7:if(_0x11e92d['role']!==_0x95ab('0x5'))_0x5c8f59[_0x5ebcc8](util[_0x95ab('0x1a')](_0x95ab('0x45'),_0x3ea9f0[_0x215831][_0x416a90][_0x95ab('0x3')]));break;case 0x8:if(_0x11e92d[_0x95ab('0x18')]!==_0x95ab('0x5'))_0x5c8f59[_0x5ebcc8](util[_0x95ab('0x1a')](_0x95ab('0x46'),_0x3ea9f0[_0x215831][_0x416a90]['name']));break;case 0x9:if(_0x11e92d['role']!=='agent')_0x5c8f59[_0x5ebcc8](util[_0x95ab('0x1a')](_0x95ab('0x47'),_0x3ea9f0[_0x215831][_0x416a90][_0x95ab('0x7')],_0x3ea9f0[_0x215831][_0x416a90][_0x95ab('0x3')]));break;case 0xa:_0x5c8f59[_0x5ebcc8](util['format'](_0x95ab('0x1d'),_0x3ea9f0[_0x215831][_0x416a90][_0x95ab('0x3')]));break;}}}}})['then'](function(){if(_0x5ebcc8==='leave'){var _0x382ce4=_[_0x95ab('0x15')](_0x11e92d['ChatInteractions'],'id');return _0x11e92d[_0x95ab('0x48')](_0x382ce4)['then'](function(){for(var _0x37096c=0x0;_0x37096c<_0x382ce4['length'];_0x37096c+=0x1){_0x2d71f8['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x382ce4[_0x37096c]),'UserId':Number(_0x11e92d['id'])});}});}})[_0x95ab('0xb')](function(){if(_0x5ebcc8===_0x95ab('0x49')){var _0x26b4a7=_['map'](_0x11e92d[_0x95ab('0x4a')],'id');return _0x11e92d[_0x95ab('0x4b')](_0x26b4a7)[_0x95ab('0xb')](function(){for(var _0x1b6994=0x0;_0x1b6994<_0x26b4a7['length'];_0x1b6994+=0x1){_0x2d71f8[_0x95ab('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x26b4a7[_0x1b6994]),'UserId':Number(_0x11e92d['id'])});}});}})[_0x95ab('0xb')](function(){if(_0x5ebcc8==='leave'){var _0x2bba99=_[_0x95ab('0x15')](_0x11e92d[_0x95ab('0x24')],'id');return _0x11e92d[_0x95ab('0x4d')](_0x2bba99)[_0x95ab('0xb')](function(){for(var _0x4c5a77=0x0;_0x4c5a77<_0x2bba99[_0x95ab('0x3e')];_0x4c5a77+=0x1){_0x2d71f8[_0x95ab('0x4c')](_0x95ab('0x4e'),{'FaxInteractionId':Number(_0x2bba99[_0x4c5a77]),'UserId':Number(_0x11e92d['id'])});}});}})[_0x95ab('0xb')](function(){if(_0x5ebcc8==='leave'){var _0x3fa51e=_[_0x95ab('0x15')](_0x11e92d[_0x95ab('0x26')],'id');return _0x11e92d[_0x95ab('0x4f')](_0x3fa51e)[_0x95ab('0xb')](function(){for(var _0x4f238d=0x0;_0x4f238d<_0x3fa51e[_0x95ab('0x3e')];_0x4f238d+=0x1){_0x2d71f8[_0x95ab('0x4c')](_0x95ab('0x50'),{'SmsInteractionId':Number(_0x3fa51e[_0x4f238d]),'UserId':Number(_0x11e92d['id'])});}});}})[_0x95ab('0xb')](function(){if(_0x5ebcc8===_0x95ab('0x49')){var _0x27d306=_[_0x95ab('0x15')](_0x11e92d[_0x95ab('0x27')],'id');return _0x11e92d[_0x95ab('0x51')](_0x27d306)['then'](function(){for(var _0x4cd278=0x0;_0x4cd278<_0x27d306[_0x95ab('0x3e')];_0x4cd278+=0x1){_0x2d71f8[_0x95ab('0x4c')](_0x95ab('0x52'),{'OpenchannelInteractionId':Number(_0x27d306[_0x4cd278]),'UserId':Number(_0x11e92d['id'])});}});}})[_0x95ab('0xb')](function(){if(_0x5ebcc8===_0x95ab('0x49')){var _0x32d3f0=_[_0x95ab('0x15')](_0x11e92d[_0x95ab('0x29')],'id');return _0x11e92d[_0x95ab('0x53')](_0x32d3f0)['then'](function(){for(var _0x5c3f0b=0x0;_0x5c3f0b<_0x32d3f0[_0x95ab('0x3e')];_0x5c3f0b+=0x1){_0x2d71f8[_0x95ab('0x4c')](_0x95ab('0x54'),{'WhatsappInteractionId':Number(_0x32d3f0[_0x5c3f0b]),'UserId':Number(_0x11e92d['id'])});}});}})['catch'](function(_0x4ee7a1){_0x5c8f59[_0x95ab('0x55')](_0x4ee7a1);});}}function onDisconnect(_0x4be3c3,_0x1d3eb9){joinOrLeave(_0x4be3c3,_0x95ab('0x49'),_0x1d3eb9);}function onConnect(_0x2f82a1){joinOrLeave(_0x2f82a1,_0x95ab('0x56'));}exports[_0x95ab('0x57')]=function(_0x6a0bd){_0x6a0bd['on']('connection',function(_0x696fe7){_0x696fe7[_0x95ab('0x58')](0x0);_0x696fe7[_0x95ab('0x59')]=_0x696fe7['request'][_0x95ab('0x5a')][_0x95ab('0x5b')]+':'+_0x696fe7[_0x95ab('0x5c')][_0x95ab('0x5a')]['remotePort'];_0x696fe7['connectedAt']=new Date();_0x696fe7[_0x95ab('0x55')]=function(_0x54a0f2){console[_0x95ab('0x55')](_0x95ab('0x5d')+_0x696fe7[_0x95ab('0x5e')][_0x95ab('0x3')]+'['+_0x696fe7[_0x95ab('0x59')]+']',_0x54a0f2);};_0x696fe7['on'](_0x95ab('0x5f'),function(){onDisconnect(_0x696fe7,_0x6a0bd);_0x696fe7['log'](_0x95ab('0x60'));});onConnect(_0x696fe7);_0x696fe7[_0x95ab('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0xa68e=['user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','resourceId','map','where','telephone','Campaign','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:outbound','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','all','then','length','voice','fax','mail','openchannel','whatsapp','telephone:%s','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove'];(function(_0x5deac3,_0x3c2ff8){var _0x45d0d8=function(_0x2728bf){while(--_0x2728bf){_0x5deac3['push'](_0x5deac3['shift']());}};_0x45d0d8(++_0x3c2ff8);}(_0xa68e,0xd3));var _0xea68=function(_0x19f137,_0x69a6c5){_0x19f137=_0x19f137-0x0;var _0x13021f=_0xa68e[_0x19f137];return _0x13021f;};'use strict';var _=require(_0xea68('0x0'));var util=require(_0xea68('0x1'));var BPromise=require('bluebird');var db=require(_0xea68('0x2'))['db'];var config=require(_0xea68('0x3'));var queryQueues={'attributes':['id',_0xea68('0x4')],'include':[{'as':_0xea68('0x5'),'model':db[_0xea68('0x6')],'attributes':['id',_0xea68('0x4'),_0xea68('0x7')],'raw':!![],'where':{'role':_0xea68('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xea68('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xea68('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xea68('0x4')],'where':{'role':_0xea68('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xea68('0x4'),_0xea68('0x9')],'where':{'type':_0xea68('0xa')}};function getAssociatedResources(_0x226ae1,_0x2f042e,_0x106679){return db['UserProfileSection']['findOne']({'where':{'name':_0x226ae1,'userProfileId':_0x2f042e},'raw':!![]})['then'](function(_0x3c45c9){if(_0x3c45c9){if(_0x3c45c9[_0xea68('0xb')]){switch(_0x226ae1){case'VoiceQueues':case _0xea68('0xc'):case _0xea68('0xd'):case _0xea68('0xe'):case _0xea68('0xf'):case _0xea68('0x10'):case _0xea68('0x11'):return db[_0x106679][_0xea68('0x12')](queryQueues);case _0xea68('0x13'):return db[_0x106679][_0xea68('0x12')](queryTelephones);case _0xea68('0x14'):return db[_0x106679][_0xea68('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x106679][_0xea68('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0xea68('0x12')]({'attributes':[_0xea68('0x15')],'where':{'sectionId':_0x3c45c9['id']},'raw':!![]})['then'](function(_0x4b520a){if(_0x4b520a){var _0x3f591d={'where':{'id':_[_0xea68('0x16')](_0x4b520a,_0xea68('0x15'))},'raw':!![]};switch(_0x106679){case _0xea68('0x6'):_0x3f591d[_0xea68('0x17')][_0xea68('0x7')]=_0xea68('0x18');break;case _0xea68('0x19'):_0x3f591d[_0xea68('0x17')][_0xea68('0x9')]='ivr';break;}return db[_0x106679]['findAll'](_0x3f591d);}else{return[];}});}}else{return[];}})['then'](function(_0x3b1f75){return _0x3b1f75;});}function joinOrLeaveQueues(_0x43cbbe,_0x9b3bc4,_0x594295,_0x4acb71){_0x43cbbe[_0x9b3bc4](util[_0xea68('0x1a')]('%s:queue:%s',_0x594295,_0x4acb71[_0xea68('0x4')]));if(_0x4acb71[_0xea68('0x5')]){for(var _0x1d2eb5=0x0;_0x1d2eb5<_0x4acb71[_0xea68('0x5')]['length'];_0x1d2eb5+=0x1){_0x43cbbe[_0x9b3bc4](util['format'](_0xea68('0x1b'),_0x4acb71['Agents'][_0x1d2eb5][_0xea68('0x4')]));}}}function joinOrLeave(_0x3293b0,_0x1744f3,_0x577d0a){var _0x151a69;if(_0x3293b0[_0xea68('0x1c')][_0xea68('0x1d')]['id']){db[_0xea68('0x6')][_0xea68('0x1e')]({'attributes':['id','name',_0xea68('0x7'),_0xea68('0x1f')],'where':{'id':_0x3293b0[_0xea68('0x1c')][_0xea68('0x1d')]['id']},'include':[{'model':db[_0xea68('0x20')],'as':_0xea68('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xea68('0x22')],'as':_0xea68('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xea68('0x24')],'as':_0xea68('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xea68('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xea68('0x27')],'as':_0xea68('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xea68('0x29')],'as':_0xea68('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x8c72ed){if(_0x8c72ed){_0x151a69=_0x8c72ed;_0x3293b0[_0x1744f3](util['format'](_0xea68('0x1b'),_0x8c72ed['name']));var _0x1877cc=[];switch(_0x8c72ed[_0xea68('0x7')]){case _0xea68('0x2b'):_0x3293b0[_0x1744f3](_0xea68('0x2c'));_0x3293b0[_0x1744f3]('voice:outbound');if(queryQueues[_0xea68('0x2d')](_0xea68('0x2e'))){delete queryQueues[_0xea68('0x2e')];}_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x30')][_0xea68('0x12')](queryQueues));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x31')][_0xea68('0x12')](queryQueues));_0x1877cc['push'](db[_0xea68('0x32')]['findAll'](queryQueues));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x33')][_0xea68('0x12')](queryQueues));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x34')]['findAll'](queryQueues));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x35')]['findAll'](queryQueues));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x36')][_0xea68('0x12')](queryQueues));_0x1877cc[_0xea68('0x2f')](db['User']['findAll'](queryTelephones));_0x1877cc[_0xea68('0x2f')](db['Trunk'][_0xea68('0x12')](queryTrunks));_0x1877cc['push'](db[_0xea68('0x19')][_0xea68('0x12')](queryCampaigns));_0x1877cc[_0xea68('0x2f')](db['User']['findAll'](queryAgents));break;case _0xea68('0x37'):_0x3293b0[_0x1744f3]('voice:inbound');_0x3293b0[_0x1744f3](_0xea68('0x38'));_0x1877cc[_0xea68('0x2f')](getAssociatedResources('VoiceQueues',_0x8c72ed[_0xea68('0x1f')],'VoiceQueue'));_0x1877cc[_0xea68('0x2f')](getAssociatedResources(_0xea68('0xc'),_0x8c72ed[_0xea68('0x1f')],_0xea68('0x31')));_0x1877cc['push'](getAssociatedResources(_0xea68('0xd'),_0x8c72ed['userProfileId'],_0xea68('0x32')));_0x1877cc['push'](getAssociatedResources(_0xea68('0xe'),_0x8c72ed[_0xea68('0x1f')],_0xea68('0x33')));_0x1877cc['push'](getAssociatedResources('MailQueues',_0x8c72ed[_0xea68('0x1f')],_0xea68('0x34')));_0x1877cc[_0xea68('0x2f')](getAssociatedResources(_0xea68('0x10'),_0x8c72ed[_0xea68('0x1f')],_0xea68('0x35')));_0x1877cc['push'](getAssociatedResources('WhatsappQueues',_0x8c72ed[_0xea68('0x1f')],'WhatsappQueue'));_0x1877cc[_0xea68('0x2f')](getAssociatedResources(_0xea68('0x13'),_0x8c72ed[_0xea68('0x1f')],_0xea68('0x6')));_0x1877cc[_0xea68('0x2f')](getAssociatedResources('Trunks',_0x8c72ed[_0xea68('0x1f')],_0xea68('0x39')));_0x1877cc['push'](getAssociatedResources(_0xea68('0x3a'),_0x8c72ed[_0xea68('0x1f')],_0xea68('0x19')));_0x1877cc[_0xea68('0x2f')](db[_0xea68('0x6')][_0xea68('0x12')](queryAgents));break;case _0xea68('0x8'):_0x3293b0[_0x1744f3](_0xea68('0x2c'));_0x3293b0[_0x1744f3](_0xea68('0x38'));_0x1877cc['push'](_0x8c72ed[_0xea68('0x3b')]({'attributes':['id','name']}));_0x1877cc[_0xea68('0x2f')](_0x8c72ed[_0xea68('0x3c')]({'attributes':['id','name']}));_0x1877cc[_0xea68('0x2f')](_0x8c72ed['getFaxQueues']({'attributes':['id',_0xea68('0x4')]}));_0x1877cc[_0xea68('0x2f')](_0x8c72ed[_0xea68('0x3d')]({'attributes':['id','name']}));_0x1877cc['push'](_0x8c72ed['getMailQueues']({'attributes':['id','name']}));_0x1877cc['push'](_0x8c72ed[_0xea68('0x3e')]({'attributes':['id',_0xea68('0x4')]}));_0x1877cc['push'](_0x8c72ed['getWhatsappQueues']({'attributes':['id',_0xea68('0x4')]}));break;}return BPromise[_0xea68('0x3f')](_0x1877cc);}})[_0xea68('0x40')](function(_0x295f93){if(_0x295f93&&_0x295f93[_0xea68('0x41')]){for(var _0x3c7124=0x0;_0x3c7124<_0x295f93[_0xea68('0x41')];_0x3c7124+=0x1){for(var _0x2ae325=0x0;_0x2ae325<_0x295f93[_0x3c7124][_0xea68('0x41')];_0x2ae325+=0x1){switch(_0x3c7124){case 0x0:joinOrLeaveQueues(_0x3293b0,_0x1744f3,_0xea68('0x42'),_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x1:joinOrLeaveQueues(_0x3293b0,_0x1744f3,'chat',_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x2:joinOrLeaveQueues(_0x3293b0,_0x1744f3,_0xea68('0x43'),_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x3:joinOrLeaveQueues(_0x3293b0,_0x1744f3,'sms',_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x4:joinOrLeaveQueues(_0x3293b0,_0x1744f3,_0xea68('0x44'),_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x5:joinOrLeaveQueues(_0x3293b0,_0x1744f3,_0xea68('0x45'),_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x6:joinOrLeaveQueues(_0x3293b0,_0x1744f3,_0xea68('0x46'),_0x295f93[_0x3c7124][_0x2ae325]);break;case 0x7:if(_0x151a69[_0xea68('0x7')]!==_0xea68('0x8'))_0x3293b0[_0x1744f3](util[_0xea68('0x1a')](_0xea68('0x47'),_0x295f93[_0x3c7124][_0x2ae325][_0xea68('0x4')]));break;case 0x8:if(_0x151a69[_0xea68('0x7')]!=='agent')_0x3293b0[_0x1744f3](util[_0xea68('0x1a')]('trunk:%s',_0x295f93[_0x3c7124][_0x2ae325]['name']));break;case 0x9:if(_0x151a69[_0xea68('0x7')]!=='agent')_0x3293b0[_0x1744f3](util[_0xea68('0x1a')]('campaign:%s:%s',_0x295f93[_0x3c7124][_0x2ae325][_0xea68('0x9')],_0x295f93[_0x3c7124][_0x2ae325]['name']));break;case 0xa:_0x3293b0[_0x1744f3](util[_0xea68('0x1a')](_0xea68('0x1b'),_0x295f93[_0x3c7124][_0x2ae325][_0xea68('0x4')]));break;}}}}})[_0xea68('0x40')](function(){if(_0x1744f3==='leave'){var _0x1f624b=_['map'](_0x151a69['ChatInteractions'],'id');return _0x151a69['removeChatInteractions'](_0x1f624b)[_0xea68('0x40')](function(){for(var _0x1fdf9f=0x0;_0x1fdf9f<_0x1f624b['length'];_0x1fdf9f+=0x1){_0x577d0a[_0xea68('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1f624b[_0x1fdf9f]),'UserId':Number(_0x151a69['id'])});}});}})[_0xea68('0x40')](function(){if(_0x1744f3===_0xea68('0x49')){var _0x57ad6d=_[_0xea68('0x16')](_0x151a69['MailInteractions'],'id');return _0x151a69[_0xea68('0x4a')](_0x57ad6d)['then'](function(){for(var _0x20b688=0x0;_0x20b688<_0x57ad6d[_0xea68('0x41')];_0x20b688+=0x1){_0x577d0a['emit'](_0xea68('0x4b'),{'MailInteractionId':Number(_0x57ad6d[_0x20b688]),'UserId':Number(_0x151a69['id'])});}});}})['then'](function(){if(_0x1744f3==='leave'){var _0x2a6b03=_['map'](_0x151a69[_0xea68('0x25')],'id');return _0x151a69['removeFaxInteractions'](_0x2a6b03)[_0xea68('0x40')](function(){for(var _0x13af3c=0x0;_0x13af3c<_0x2a6b03[_0xea68('0x41')];_0x13af3c+=0x1){_0x577d0a['emit'](_0xea68('0x4c'),{'FaxInteractionId':Number(_0x2a6b03[_0x13af3c]),'UserId':Number(_0x151a69['id'])});}});}})[_0xea68('0x40')](function(){if(_0x1744f3===_0xea68('0x49')){var _0x2b8da0=_[_0xea68('0x16')](_0x151a69['SmsInteractions'],'id');return _0x151a69['removeSmsInteractions'](_0x2b8da0)[_0xea68('0x40')](function(){for(var _0x46feff=0x0;_0x46feff<_0x2b8da0[_0xea68('0x41')];_0x46feff+=0x1){_0x577d0a[_0xea68('0x48')](_0xea68('0x4d'),{'SmsInteractionId':Number(_0x2b8da0[_0x46feff]),'UserId':Number(_0x151a69['id'])});}});}})[_0xea68('0x40')](function(){if(_0x1744f3===_0xea68('0x49')){var _0x115e6e=_[_0xea68('0x16')](_0x151a69['OpenchannelInteractions'],'id');return _0x151a69[_0xea68('0x4e')](_0x115e6e)['then'](function(){for(var _0x2151cf=0x0;_0x2151cf<_0x115e6e[_0xea68('0x41')];_0x2151cf+=0x1){_0x577d0a['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x115e6e[_0x2151cf]),'UserId':Number(_0x151a69['id'])});}});}})[_0xea68('0x40')](function(){if(_0x1744f3==='leave'){var _0x1324a9=_[_0xea68('0x16')](_0x151a69[_0xea68('0x2a')],'id');return _0x151a69[_0xea68('0x4f')](_0x1324a9)[_0xea68('0x40')](function(){for(var _0x2e20b4=0x0;_0x2e20b4<_0x1324a9[_0xea68('0x41')];_0x2e20b4+=0x1){_0x577d0a[_0xea68('0x48')](_0xea68('0x50'),{'WhatsappInteractionId':Number(_0x1324a9[_0x2e20b4]),'UserId':Number(_0x151a69['id'])});}});}})[_0xea68('0x51')](function(_0x2b5037){_0x3293b0[_0xea68('0x52')](_0x2b5037);});}}function onDisconnect(_0x23e0b8,_0x4bd6c1){joinOrLeave(_0x23e0b8,_0xea68('0x49'),_0x4bd6c1);}function onConnect(_0x14f8e6){joinOrLeave(_0x14f8e6,_0xea68('0x53'));}exports[_0xea68('0x54')]=function(_0x34564d){_0x34564d['on'](_0xea68('0x55'),function(_0x47fd23){_0x47fd23[_0xea68('0x56')](0x0);_0x47fd23[_0xea68('0x57')]=_0x47fd23[_0xea68('0x58')][_0xea68('0x55')][_0xea68('0x59')]+':'+_0x47fd23[_0xea68('0x58')][_0xea68('0x55')]['remotePort'];_0x47fd23[_0xea68('0x5a')]=new Date();_0x47fd23[_0xea68('0x52')]=function(_0x4261f1){console['log'](_0xea68('0x5b')+_0x47fd23[_0xea68('0x5c')]['name']+'['+_0x47fd23[_0xea68('0x57')]+']',_0x4261f1);};_0x47fd23['on'](_0xea68('0x5d'),function(){onDisconnect(_0x47fd23,_0x34564d);_0x47fd23[_0xea68('0x52')](_0xea68('0x5e'));});onConnect(_0x47fd23);_0x47fd23[_0xea68('0x52')](_0xea68('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c2b9c54..d97cfab 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e16=['ChatInteraction','newinteraction','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','code','error','catch','get','motionChannel','event','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','contact','UserId','undefined','interface','format','name','agent','channel','incomingmessage','AfterCreateMessage','opened','QueryTypes','SELECT','changed','closed','substatus','User','find','fullname','email','internal','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat'];(function(_0x3c945e,_0x448c99){var _0x123dcb=function(_0x2cf13d){while(--_0x2cf13d){_0x3c945e['push'](_0x3c945e['shift']());}};_0x123dcb(++_0x448c99);}(_0x3e16,0x11c));var _0x63e1=function(_0x6b9d73,_0xa7f098){_0x6b9d73=_0x6b9d73-0x0;var _0x552870=_0x3e16[_0x6b9d73];return _0x552870;};'use strict';var util=require(_0x63e1('0x0'));var db=require(_0x63e1('0x1'))['db'];var jayson=require(_0x63e1('0x2'));var logger=require(_0x63e1('0x3'))(_0x63e1('0x4'));var client=jayson[_0x63e1('0x5')][_0x63e1('0x6')]({'port':0x232a});var triggers=[{'channel':_0x63e1('0x7'),'model':_0x63e1('0x8'),'event':'afterCreate','condition':_0x63e1('0x9'),'callback':afterCreate},{'channel':_0x63e1('0x7'),'model':_0x63e1('0x8'),'event':'afterUpdate','condition':_0x63e1('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0x63e1('0xb'),'event':_0x63e1('0xc'),'condition':_0x63e1('0xd'),'callback':afterCreateMessage},{'channel':_0x63e1('0xe'),'model':'SmsInteraction','event':_0x63e1('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x63e1('0xe'),'model':'SmsInteraction','event':_0x63e1('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x63e1('0xe'),'model':_0x63e1('0x10'),'event':'afterCreate','condition':_0x63e1('0xd'),'callback':afterCreateMessage},{'channel':_0x63e1('0x11'),'model':_0x63e1('0x12'),'event':_0x63e1('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x63e1('0x11'),'model':_0x63e1('0x12'),'event':_0x63e1('0xf'),'condition':_0x63e1('0xa'),'callback':afterUpdate},{'channel':_0x63e1('0x11'),'model':_0x63e1('0x13'),'event':_0x63e1('0xc'),'condition':_0x63e1('0xd'),'callback':afterCreateMessage},{'channel':_0x63e1('0x14'),'model':_0x63e1('0x15'),'event':_0x63e1('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x63e1('0x14'),'model':_0x63e1('0x15'),'event':'afterUpdate','condition':_0x63e1('0xa'),'callback':afterUpdate},{'channel':_0x63e1('0x14'),'model':_0x63e1('0x16'),'event':_0x63e1('0xc'),'condition':_0x63e1('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x63e1('0x17'),'event':_0x63e1('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x63e1('0x18'),'model':_0x63e1('0x17'),'event':_0x63e1('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x63e1('0x18'),'model':'MailMessage','event':'afterCreate','condition':_0x63e1('0xd'),'callback':afterCreateMessage},{'channel':_0x63e1('0x19'),'model':_0x63e1('0x1a'),'event':_0x63e1('0xc'),'condition':_0x63e1('0x9'),'callback':afterCreate},{'channel':'Openchannel','model':_0x63e1('0x1a'),'event':_0x63e1('0xf'),'condition':_0x63e1('0xa'),'callback':afterUpdate},{'channel':_0x63e1('0x19'),'model':_0x63e1('0x1b'),'event':_0x63e1('0xc'),'condition':_0x63e1('0xd'),'callback':afterCreateMessage}];function request(_0xea9866){return client[_0x63e1('0x1c')](_0x63e1('0x1d'),_0xea9866)[_0x63e1('0x1e')](function(_0x33671d){logger[_0x63e1('0x1f')](_0x63e1('0x20'),_0x63e1('0x1d'),_0x33671d);if(_0x33671d['error']){if(_0x33671d['error'][_0x63e1('0x21')]===0x1f4){logger[_0x63e1('0x22')]('Trigger,\x20%s','EventManager',_0x33671d[_0x63e1('0x22')]);}}})[_0x63e1('0x23')](function(_0x13cfd4){logger[_0x63e1('0x22')]('Trigger,\x20%s',_0x63e1('0x1d'),_0x13cfd4);});}function afterCreateMessage(_0x4a60b5){return function(_0x49f7f8){_0x49f7f8=_0x49f7f8[_0x63e1('0x24')]({'plain':!![]});_0x49f7f8['channel']=_0x4a60b5;_0x49f7f8[_0x63e1('0x25')]=_0x4a60b5;_0x49f7f8[_0x63e1('0x26')]=_0x49f7f8['direction'];Promise[_0x63e1('0x27')]()[_0x63e1('0x1e')](function(){if(typeof _0x49f7f8[_0x63e1('0x28')]==='undefined')return null;var _0x56b64c=_0x63e1('0x29')+_0x49f7f8[_0x63e1('0x28')];return db[_0x63e1('0x2a')][_0x63e1('0x2b')](_0x56b64c,{'type':db[_0x63e1('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x355079){if(_0x355079){_0x49f7f8[_0x63e1('0x2d')]=_0x355079[0x0];}if(typeof _0x49f7f8[_0x63e1('0x2e')]===_0x63e1('0x2f'))return;return getAgent(_0x49f7f8[_0x63e1('0x2e')]);})[_0x63e1('0x1e')](function(_0x461c88){if(_0x461c88){_0x49f7f8[_0x63e1('0x30')]=util[_0x63e1('0x31')]('SIP/%s',_0x461c88[_0x63e1('0x32')]);_0x49f7f8[_0x63e1('0x33')]=_0x461c88;_0x49f7f8[_0x63e1('0x34')]=_0x4a60b5;return request({'event':_0x63e1('0x35'),'message':_0x49f7f8});}else{return request({'event':'outgoingmessage','message':_0x49f7f8});}})[_0x63e1('0x23')](function(_0x80782c){logger['error'](_0x63e1('0x20'),_0x63e1('0x36'),_0x80782c);});};}function afterCreate(_0x71c874,_0x150821){return function(_0xcc1ad5){_0xcc1ad5=_0xcc1ad5[_0x63e1('0x24')]({'plain':!![]});_0xcc1ad5[_0x63e1('0x34')]=_0x71c874;_0xcc1ad5[_0x63e1('0x25')]=_0x71c874;_0xcc1ad5[_0x63e1('0x26')]=_0x63e1('0x37');Promise[_0x63e1('0x27')]()[_0x63e1('0x1e')](function(){var _0x5545df=_0x63e1('0x29')+_0xcc1ad5['ContactId'];return db[_0x63e1('0x2a')][_0x63e1('0x2b')](_0x5545df,{'type':db[_0x63e1('0x2c')][_0x63e1('0x38')][_0x63e1('0x39')],'raw':!![]});})['then'](function(_0x4b1d83){if(_0x4b1d83){_0xcc1ad5[_0x63e1('0x2d')]=_0x4b1d83[0x0];}if(typeof _0xcc1ad5[_0x63e1('0x2e')]==='undefined')return;return getAgent(_0xcc1ad5[_0x63e1('0x2e')]);})[_0x63e1('0x1e')](function(_0x96b126){if(_0x96b126){_0xcc1ad5[_0x63e1('0x30')]=util[_0x63e1('0x31')]('SIP/%s',_0x96b126[_0x63e1('0x32')]);_0xcc1ad5[_0x63e1('0x33')]=_0x96b126;}return request({'event':_0x150821,'message':_0xcc1ad5});})['catch'](function(_0x1446b9){logger[_0x63e1('0x22')](_0x63e1('0x20'),'AfterCreate',_0x1446b9);});};}function afterUpdate(_0x2adf28){return function(_0x1c3e06){var _0x3806fb=_0x1c3e06[_0x63e1('0x3a')](_0x63e1('0x3b'))&&_0x1c3e06[_0x63e1('0x3b')];var _0x2e167f=_0x1c3e06[_0x63e1('0x3a')](_0x63e1('0x3c'));if(_0x3806fb||_0x2e167f){var _0x5225e2=_0x3806fb?'closedinteraction':_0x63e1('0x3c');var _0x789bca=_0x1c3e06[_0x63e1('0x24')]({'plain':!![]});_0x789bca[_0x63e1('0x34')]=_0x2adf28;_0x789bca[_0x63e1('0x25')]=_0x2adf28;_0x789bca[_0x63e1('0x26')]=_0x3806fb?_0x63e1('0x3b'):_0x63e1('0x3c');var _0x26dd0b=_0x63e1('0x29')+_0x789bca[_0x63e1('0x28')];return db[_0x63e1('0x2a')]['query'](_0x26dd0b,{'type':db[_0x63e1('0x2c')][_0x63e1('0x38')]['SELECT'],'raw':!![]})[_0x63e1('0x1e')](function(_0x29350d){if(_0x29350d){_0x789bca[_0x63e1('0x2d')]=_0x29350d[0x0];}if(typeof _0x789bca[_0x63e1('0x2e')]===_0x63e1('0x2f'))return;return getAgent(_0x789bca[_0x63e1('0x2e')]);})[_0x63e1('0x1e')](function(_0x47a975){if(_0x47a975){_0x789bca[_0x63e1('0x30')]=util[_0x63e1('0x31')]('SIP/%s',_0x47a975[_0x63e1('0x32')]);_0x789bca['agent']=_0x47a975;}return request({'event':_0x5225e2,'message':_0x789bca});})[_0x63e1('0x23')](function(_0x58d447){logger['error'](_0x63e1('0x20'),'AfterUpdate',_0x58d447);});}};}function getAgent(_0x3e415e){return db[_0x63e1('0x3d')][_0x63e1('0x3e')]({'where':{'id':_0x3e415e},'attributes':['id','name',_0x63e1('0x3f'),_0x63e1('0x40'),_0x63e1('0x41')],'raw':!![]})[_0x63e1('0x1e')](function(_0x41e6bc){return _0x41e6bc;});}exports[_0x63e1('0x42')]=function(){for(var _0xd184d3=0x0;_0xd184d3=_0x399125[_0x7ff2('0x17')]){throw Error(_0x7ff2('0x18'));}_0x3a14ce(_0x17764f);})['catch'](function(_0x1286d7){_0x37a0fa(_0x1286d7);});});}; \ No newline at end of file +var _0xa654=['./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','includes','clearBlockUser','blockedAt','updateAttributes','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird'];(function(_0x1b734e,_0x456cd8){var _0x841eed=function(_0x15da60){while(--_0x15da60){_0x1b734e['push'](_0x1b734e['shift']());}};_0x841eed(++_0x456cd8);}(_0xa654,0x107));var _0x4a65=function(_0x243b7e,_0x2ebdec){_0x243b7e=_0x243b7e-0x0;var _0x47ff9a=_0xa654[_0x243b7e];return _0x47ff9a;};'use strict';var _=require('lodash');var BPromise=require(_0x4a65('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x4a65('0x1'));var channels=[_0x4a65('0x2'),_0x4a65('0x3'),_0x4a65('0x4'),_0x4a65('0x5'),_0x4a65('0x6'),_0x4a65('0x7'),_0x4a65('0x8')];exports[_0x4a65('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x10b1e8){_0x10b1e8=_0x10b1e8['toLowerCase']();return _[_0x4a65('0xa')](channels,_0x10b1e8);};exports[_0x4a65('0xb')]=function(_0x1da1d6,_0x6c07ae,_0x415feb,_0x2e7fcf){var _0x553827={'loginAttempts':_0x6c07ae,'blocked':_0x415feb};if(!_['isUndefined'](_0x2e7fcf)){_0x553827[_0x4a65('0xc')]=_0x2e7fcf;}return _0x1da1d6[_0x4a65('0xd')](_0x553827);};exports['getLicense']=function(_0x3fd38c){return new BPromise(function(_0x392515,_0x26d07c){var _0x75d9a9=0x0;if(_0x3fd38c[_0x4a65('0xe')]!==_0x4a65('0xf')){_0x392515(_0x3fd38c);}db[_0x4a65('0x10')][_0x4a65('0x11')]({'where':{'role':_0x4a65('0xf'),'online':!![],'id':{'$ne':_0x3fd38c['id']}}})[_0x4a65('0x12')](function(_0x485e4b){_0x75d9a9=_0x485e4b;return util[_0x4a65('0x13')]();})[_0x4a65('0x12')](function(_0x13a500){if(_0x13a500&&_0x13a500[_0x4a65('0x14')]&&_0x75d9a9>=_0x13a500[_0x4a65('0x14')]){throw Error(_0x4a65('0x15'));}_0x392515(_0x3fd38c);})['catch'](function(_0x35d565){_0x26d07c(_0x35d565);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 91627a1..8b46c5d 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9cd=['json','exports','404','status','render'];(function(_0x2aab6c,_0x2ff617){var _0x29dc52=function(_0x11579e){while(--_0x11579e){_0x2aab6c['push'](_0x2aab6c['shift']());}};_0x29dc52(++_0x2ff617);}(_0xa9cd,0x187));var _0xda9c=function(_0x385585,_0x49ba80){_0x385585=_0x385585-0x0;var _0x26ff97=_0xa9cd[_0x385585];return _0x26ff97;};'use strict';module[_0xda9c('0x0')][0x194]=function pageNotFound(_0x250e89,_0x312f90){var _0x22a267=_0xda9c('0x1');var _0x31c88b=0x194;var _0x125eeb={'status':_0x31c88b};_0x312f90[_0xda9c('0x2')](_0x125eeb['status']);_0x312f90[_0xda9c('0x3')](_0x22a267,{},function(_0x11b24f,_0x20e4b9){if(_0x11b24f){return _0x312f90[_0xda9c('0x2')](_0x125eeb[_0xda9c('0x2')])[_0xda9c('0x4')](_0x125eeb);}_0x312f90['send'](_0x20e4b9);});}; \ No newline at end of file +var _0x23a8=['status','send'];(function(_0x1a918d,_0x42d401){var _0x515bc4=function(_0x5cf1fd){while(--_0x5cf1fd){_0x1a918d['push'](_0x1a918d['shift']());}};_0x515bc4(++_0x42d401);}(_0x23a8,0x172));var _0x823a=function(_0x370f5b,_0x390dd8){_0x370f5b=_0x370f5b-0x0;var _0x132243=_0x23a8[_0x370f5b];return _0x132243;};'use strict';module['exports'][0x194]=function pageNotFound(_0xc7c743,_0x587396){var _0x333a68='404';var _0x39a117=0x194;var _0x413513={'status':_0x39a117};_0x587396['status'](_0x413513[_0x823a('0x0')]);_0x587396['render'](_0x333a68,{},function(_0x2d8217,_0x2ad2cb){if(_0x2d8217){return _0x587396[_0x823a('0x0')](_0x413513[_0x823a('0x0')])['json'](_0x413513);}_0x587396[_0x823a('0x1')](_0x2ad2cb);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2db3c7a..e1fd3e7 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotification','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','FaxInteraction','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','hasOne','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','List','Agents','team_has_mail_queues','Teams','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Account','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','Users','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','CompanyId','JscriptySessions','OpenchannelInteractions','cm_contact_has_tags','OwnerId','CampaignId','OneAll','AutomationAllId','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','fax_interaction_has_tags','TriggerAllId','AnyConditions','AnyCondition','Fields','AnalyticMetric','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Subjects','DeskConfiguration','int_desk_configuration_has_tags','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','Dynamics365Configuration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','FaxQueues','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','FromAgent','ToChatQueueId','ToQueue','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','xcall','utf8','username','password','options','database','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport'];(function(_0x43f1d2,_0x2d477e){var _0x43e130=function(_0x597d70){while(--_0x597d70){_0x43f1d2['push'](_0x43f1d2['shift']());}};_0x43e130(++_0x2d477e);}(_0x153f,0x15b));var _0xf153=function(_0x21e80,_0x5ad3c3){_0x21e80=_0x21e80-0x0;var _0x427d5b=_0x153f[_0x21e80];return _0x427d5b;};'use strict';var config=require(_0xf153('0x0'));var Sequelize=require(_0xf153('0x1'));var _=require(_0xf153('0x2'));var jstz=require(_0xf153('0x3'));var timezone=jstz[_0xf153('0x4')]();config[_0xf153('0x1')]=_[_0xf153('0x5')](config['sequelize'],{'database':_0xf153('0x6'),'username':'xcall','password':_0xf153('0x7'),'options':{'host':_0xf153('0x8'),'port':0xcea,'dialect':_0xf153('0x9'),'dialectOptions':{'charset':_0xf153('0xa')},'logging':![],'timezone':timezone[_0xf153('0xb')](),'define':{'charset':'utf8','collate':_0xf153('0xc')}}});config[_0xf153('0xd')]=_[_0xf153('0x5')](config[_0xf153('0xd')],{'database':_0xf153('0x6'),'username':_0xf153('0xe'),'password':_0xf153('0x7'),'options':{'host':_0xf153('0x8'),'port':0xcea,'dialect':_0xf153('0x9'),'dialectOptions':{'charset':_0xf153('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf153('0xf'),'collate':_0xf153('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf153('0x1')]['database'],config[_0xf153('0x1')][_0xf153('0x10')],config[_0xf153('0x1')][_0xf153('0x11')],config[_0xf153('0x1')][_0xf153('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf153('0xd')][_0xf153('0x13')],config[_0xf153('0xd')]['username'],config[_0xf153('0xd')][_0xf153('0x11')],config[_0xf153('0xd')][_0xf153('0x12')])};db[_0xf153('0x14')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x16'));db['VoiceChanSpy']=db[_0xf153('0x1')]['import'](_0xf153('0x17'));db[_0xf153('0x18')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/voiceContext/voiceContext.model');db[_0xf153('0x19')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x1a'));db[_0xf153('0x1b')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x1c'));db[_0xf153('0x1d')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x1e'));db['VoiceRecording']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x1f'));db[_0xf153('0x20')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x21'));db[_0xf153('0x22')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x23'));db[_0xf153('0x24')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x25'));db[_0xf153('0x26')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x27'));db[_0xf153('0x28')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x29'));db['VoiceAgentReport']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xf153('0x2a')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x2b'));db[_0xf153('0x2c')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x2d'));db[_0xf153('0x2e')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x2f'));db['VoiceTransferReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x30'));db[_0xf153('0x31')]=db['sequelize']['import'](_0xf153('0x32'));db['UserVoiceQueue']=db['sequelize'][_0xf153('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf153('0x33')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x34'));db['UserMailQueue']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x35'));db[_0xf153('0x36')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xf153('0x37')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x38'));db[_0xf153('0x39')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x3a'));db['UserWhatsappQueue']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x3b'));db['MailServerIn']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x3c'));db[_0xf153('0x3d')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xf153('0x3e')]=db[_0xf153('0x1')]['import'](_0xf153('0x3f'));db[_0xf153('0x40')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x41'));db[_0xf153('0x42')]=db[_0xf153('0x1')]['import'](_0xf153('0x43'));db[_0xf153('0x44')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x45'));db[_0xf153('0x46')]=db['sequelize']['import'](_0xf153('0x47'));db['MailApplication']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x48'));db[_0xf153('0x49')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/dashboard/dashboard.model');db[_0xf153('0x4a')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x4b'));db[_0xf153('0x4c')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x4d'));db[_0xf153('0x4e')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x4f'));db['FaxInteraction']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x50'));db['FaxMessage']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/faxMessage/faxMessage.model');db[_0xf153('0x51')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x52'));db[_0xf153('0x53')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x54'));db[_0xf153('0x55')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/smsAccount/smsAccount.model');db[_0xf153('0x56')]=db[_0xf153('0x1')]['import'](_0xf153('0x57'));db[_0xf153('0x58')]=db[_0xf153('0x1')]['import'](_0xf153('0x59'));db[_0xf153('0x5a')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x5b'));db[_0xf153('0x5c')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x5d'));db['OpenchannelAccount']=db[_0xf153('0x1')]['import']('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xf153('0x5e')]=db[_0xf153('0x1')]['import'](_0xf153('0x5f'));db[_0xf153('0x60')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x61'));db[_0xf153('0x62')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x63'));db['ChatWebsite']=db['sequelize'][_0xf153('0x15')](_0xf153('0x64'));db[_0xf153('0x65')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x66'));db['ChatApplication']=db[_0xf153('0x1')]['import'](_0xf153('0x67'));db[_0xf153('0x68')]=db[_0xf153('0x1')]['import'](_0xf153('0x69'));db[_0xf153('0x6a')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x6b'));db[_0xf153('0x6c')]=db[_0xf153('0x1')]['import'](_0xf153('0x6d'));db[_0xf153('0x6e')]=db[_0xf153('0x1')]['import'](_0xf153('0x6f'));db[_0xf153('0x70')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x71'));db[_0xf153('0x72')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xf153('0x73')]=db[_0xf153('0x1')]['import'](_0xf153('0x74'));db[_0xf153('0x75')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x76'));db[_0xf153('0x77')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x78'));db[_0xf153('0x79')]=db[_0xf153('0x1')]['import'](_0xf153('0x7a'));db[_0xf153('0x7b')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x7c'));db[_0xf153('0x7d')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x7e'));db[_0xf153('0x7f')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x80'));db[_0xf153('0x81')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x82'));db[_0xf153('0x83')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/action/action.model');db[_0xf153('0x84')]=db[_0xf153('0x1')]['import'](_0xf153('0x85'));db['CannedAnswer']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0xf153('0x86')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x87'));db[_0xf153('0x88')]=db[_0xf153('0x1')]['import'](_0xf153('0x89'));db[_0xf153('0x8a')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x8b'));db[_0xf153('0x8c')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/pause/pause.model');db[_0xf153('0x8d')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x8e'));db['VoiceQueuesLog']=db['sequelize'][_0xf153('0x15')](_0xf153('0x8f'));db['Schedule']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x90'));db['Sound']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x91'));db[_0xf153('0x92')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x93'));db[_0xf153('0x94')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x95'));db[_0xf153('0x96')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x97'));db[_0xf153('0x98')]=db['sequelize'][_0xf153('0x15')]('../api/variable/variable.model');db['Integration']=db[_0xf153('0x1')]['import'](_0xf153('0x99'));db[_0xf153('0x9a')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x9b'));db[_0xf153('0x9c')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x9d'));db[_0xf153('0x9e')]=db['sequelize']['import'](_0xf153('0x9f'));db[_0xf153('0xa0')]=db[_0xf153('0x1')]['import'](_0xf153('0xa1'));db['AnalyticMetric']=db['sequelize'][_0xf153('0x15')](_0xf153('0xa2'));db[_0xf153('0xa3')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xa4'));db['AnalyticTreeReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xa5'));db[_0xf153('0xa6')]=db[_0xf153('0x1')]['import'](_0xf153('0xa7'));db[_0xf153('0xa8')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xa9'));db[_0xf153('0xaa')]=db[_0xf153('0x1')]['import'](_0xf153('0xab'));db[_0xf153('0xac')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xad'));db[_0xf153('0xae')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xaf'));db[_0xf153('0xb0')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xb1'));db[_0xf153('0xb2')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xb3'));db['DeskConfiguration']=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xf153('0xb4')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xb5'));db[_0xf153('0xb6')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xb7'));db[_0xf153('0xb8')]=db[_0xf153('0x1')]['import'](_0xf153('0xb9'));db[_0xf153('0xba')]=db[_0xf153('0x1')]['import'](_0xf153('0xbb'));db['ZendeskAccount']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xbc'));db['ZendeskConfiguration']=db['sequelize']['import'](_0xf153('0xbd'));db[_0xf153('0xbe')]=db['sequelize']['import'](_0xf153('0xbf'));db['FreshdeskAccount']=db[_0xf153('0x1')]['import'](_0xf153('0xc0'));db[_0xf153('0xc1')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xc2'));db[_0xf153('0xc3')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xc4'));db['VtigerAccount']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xc5'));db[_0xf153('0xc6')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xc7'));db['VtigerField']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xc8'));db[_0xf153('0xc9')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xca'));db[_0xf153('0xcb')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xcc'));db[_0xf153('0xcd')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0xf153('0xce')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xf153('0x1')]['import'](_0xf153('0xcf'));db[_0xf153('0xd0')]=db[_0xf153('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xf153('0xd1')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xf153('0xd2')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xd3'));db[_0xf153('0xd4')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xd5'));db[_0xf153('0xd6')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x99'));db[_0xf153('0xd7')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xd8'));db[_0xf153('0xd9')]=db['sequelize']['import'](_0xf153('0xda'));db['ChatInternalMessage']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xf153('0xdb')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xdc'));db[_0xf153('0xdd')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xde'));db['JscriptySessionReport']=db[_0xf153('0x1')][_0xf153('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xf153('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0xf153('0xdf')]=db[_0xf153('0x1')]['import'](_0xf153('0xe0'));db[_0xf153('0xe1')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xe2'));db[_0xf153('0xe3')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xe4'));db['Setting']=db[_0xf153('0x1')]['import'](_0xf153('0xe5'));db['SquareOdbc']=db[_0xf153('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0xf153('0xe6')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xe7'));db['SquareRecording']=db['sequelize'][_0xf153('0x15')](_0xf153('0xe8'));db[_0xf153('0xe9')]=db['sequelize'][_0xf153('0x15')](_0xf153('0xea'));db[_0xf153('0xeb')]=db[_0xf153('0x1')]['import'](_0xf153('0xec'));db[_0xf153('0xed')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xee'));db[_0xf153('0xef')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xf0'));db[_0xf153('0xf1')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/migration/migration.model');db[_0xf153('0xf2')]=db[_0xf153('0x1')]['import'](_0xf153('0xf3'));db[_0xf153('0xf4')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xf5'));db['MailTransferReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xf6'));db[_0xf153('0xf7')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xf8'));db[_0xf153('0xf9')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xfa'));db[_0xf153('0xfb')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xfc'));db['SmsTransferReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xfd'));db[_0xf153('0xfe')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0xff'));db[_0xf153('0x100')]=db['sequelize'][_0xf153('0x15')](_0xf153('0x101'));db[_0xf153('0x102')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/userProfile/userProfile.model');db[_0xf153('0x103')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x104'));db['UserProfileResource']=db['sequelize'][_0xf153('0x15')](_0xf153('0x105'));db['UserNotification']=db['sequelize'][_0xf153('0x15')](_0xf153('0x106'));db[_0xf153('0x107')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x108'));db[_0xf153('0x109')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0xf153('0x10a')]=db[_0xf153('0x1')]['import'](_0xf153('0x10b'));db[_0xf153('0x10c')]=db[_0xf153('0x1')][_0xf153('0x15')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x10d'));db['WhatsappTransferReport']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x10e'));db[_0xf153('0x10f')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x110'));db['CloudProvider']=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x111'));db[_0xf153('0x112')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x113'));db[_0xf153('0x114')]=db[_0xf153('0x1')]['import'](_0xf153('0x115'));db[_0xf153('0x116')]=db[_0xf153('0x1')][_0xf153('0x15')](_0xf153('0x117'));db[_0xf153('0x14')]['hasOne'](db[_0xf153('0x22')],{'as':_0xf153('0x22'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x119')});db['User'][_0xf153('0x11a')](db[_0xf153('0x11b')],{'as':_0xf153('0x11c'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x14')]['hasMany'](db[_0xf153('0x31')],{'as':_0xf153('0x11d'),'foreignKey':'UserId'});db[_0xf153('0x14')]['hasMany'](db[_0xf153('0x19')],{'as':_0xf153('0x11e'),'onDelete':_0xf153('0x118'),'hooks':!![]});db[_0xf153('0x14')]['hasMany'](db[_0xf153('0x7b')],{'as':_0xf153('0x11f'),'foreignKey':'UserId'});db[_0xf153('0x14')]['hasMany'](db[_0xf153('0x7d')],{'as':_0xf153('0x120'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xf153('0x7f')],{'as':_0xf153('0x7f'),'foreignKey':'UserId'});db[_0xf153('0x14')][_0xf153('0x11a')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xf153('0x119')});db[_0xf153('0x14')][_0xf153('0x11a')](db[_0xf153('0x68')],{'as':_0xf153('0x121'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x14')][_0xf153('0x11a')](db[_0xf153('0x58')],{'as':_0xf153('0x122'),'foreignKey':'UserId'});db[_0xf153('0x14')]['hasMany'](db['FaxInteraction'],{'as':_0xf153('0x123'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x14')][_0xf153('0x11a')](db['MailInteraction'],{'as':_0xf153('0x124'),'foreignKey':'UserId'});db[_0xf153('0x14')][_0xf153('0x11a')](db[_0xf153('0x10a')],{'as':'WhatsappInteractions','foreignKey':_0xf153('0x119')});db[_0xf153('0x14')]['hasMany'](db[_0xf153('0x125')],{'as':'UserNotifications','foreignKey':_0xf153('0x126')});db[_0xf153('0x14')][_0xf153('0x127')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xf153('0x128')});db['User'][_0xf153('0x129')](db[_0xf153('0x70')],{'as':_0xf153('0x12a'),'through':_0xf153('0x12b')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x75')],{'as':_0xf153('0x12c'),'through':_0xf153('0x12d')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0xfe')],{'as':_0xf153('0x12e'),'through':_0xf153('0x12f')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0xeb')],{'through':'user_has_teams'});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x44')],{'as':'MailInteractions','through':_0xf153('0x130')});db[_0xf153('0x14')][_0xf153('0x129')](db['ChatInteraction'],{'as':_0xf153('0x121'),'through':_0xf153('0x131')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x132')],{'as':'FaxInteractions','through':_0xf153('0x133')});db['User'][_0xf153('0x129')](db['SmsInteraction'],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0xf153('0x14')]['belongsToMany'](db[_0xf153('0x5e')],{'as':'OpenchannelInteractions','through':_0xf153('0x134')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x10a')],{'as':'WhatsappInteractions','through':_0xf153('0x135')});db[_0xf153('0x14')]['belongsToMany'](db[_0xf153('0x1d')],{'as':_0xf153('0x136'),'through':_0xf153('0x137'),'required':![]});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x100')],{'as':_0xf153('0x138'),'through':'UserVoicePrefix','required':![]});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x40')],{'as':_0xf153('0x139'),'through':_0xf153('0x13a'),'required':![]});db[_0xf153('0x14')][_0xf153('0x129')](db['ChatQueue'],{'as':_0xf153('0x13b'),'through':_0xf153('0x33'),'required':![],'hooks':!![]});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x51')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0xf153('0x14')][_0xf153('0x129')](db['SmsQueue'],{'as':_0xf153('0x13c'),'through':_0xf153('0x37'),'required':![]});db[_0xf153('0x14')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xf153('0x13d'),'through':_0xf153('0x39'),'required':![]});db[_0xf153('0x14')]['belongsToMany'](db[_0xf153('0x10f')],{'as':_0xf153('0x13e'),'through':_0xf153('0x13f'),'required':![]});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0xfe')],{'through':_0xf153('0x12f')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x140')],{'as':_0xf153('0x141'),'through':_0xf153('0x142')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x4c')],{'as':_0xf153('0x143'),'through':_0xf153('0x144')});db[_0xf153('0x14')]['belongsToMany'](db[_0xf153('0x3e')],{'as':'MailAccounts','through':_0xf153('0x145')});db[_0xf153('0x14')]['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0xf153('0x146')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x55')],{'as':'SmsAccounts','through':_0xf153('0x147')});db[_0xf153('0x14')][_0xf153('0x129')](db[_0xf153('0x107')],{'as':_0xf153('0x148'),'through':_0xf153('0x149')});db[_0xf153('0x14')][_0xf153('0x129')](db['SquareProject'],{'as':_0xf153('0x14a'),'through':_0xf153('0x14b')});db['VoiceChanSpy']['hasMany'](db[_0xf153('0x19')],{'as':_0xf153('0x14c'),'onDelete':'cascade','foreignKey':_0xf153('0x14d')});db['VoiceContext'][_0xf153('0x11a')](db[_0xf153('0x19')],{'onDelete':_0xf153('0x118')});db[_0xf153('0x19')][_0xf153('0x11a')](db['VoiceExtension'],{'as':_0xf153('0x14e'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xf153('0x129')](db[_0xf153('0x14f')],{'as':_0xf153('0x150'),'through':_0xf153('0x151')});db['VoiceQueue'][_0xf153('0x11a')](db[_0xf153('0x31')],{'as':_0xf153('0x152'),'foreignKey':_0xf153('0x153')});db[_0xf153('0x1d')][_0xf153('0x11a')](db[_0xf153('0x77')],{'as':_0xf153('0x154'),'foreignKey':'VoiceQueueId'});db[_0xf153('0x1d')][_0xf153('0x11a')](db[_0xf153('0x7b')],{'as':_0xf153('0x11f'),'foreignKey':_0xf153('0x153')});db[_0xf153('0x1d')][_0xf153('0x11a')](db[_0xf153('0x7d')],{'as':_0xf153('0x155'),'foreignKey':_0xf153('0x153')});db[_0xf153('0x1d')][_0xf153('0x11a')](db['ReportAgentPreview'],{'as':_0xf153('0x7f'),'foreignKey':_0xf153('0x153')});db['VoiceQueue'][_0xf153('0x11a')](db[_0xf153('0x79')],{'as':_0xf153('0x156'),'foreignKey':_0xf153('0x153')});db[_0xf153('0x1d')][_0xf153('0x11a')](db[_0xf153('0x157')],{'as':'JscriptySessions','foreignKey':_0xf153('0x153')});db[_0xf153('0x1d')][_0xf153('0x127')](db[_0xf153('0x2e')],{'as':'Trunk','foreignKey':_0xf153('0x158')});db[_0xf153('0x1d')]['belongsTo'](db[_0xf153('0x2e')],{'as':'TrunkBackup','foreignKey':_0xf153('0x159')});db['VoiceQueue'][_0xf153('0x127')](db[_0xf153('0x8a')],{'as':_0xf153('0x8a'),'foreignKey':_0xf153('0x15a')});db['VoiceQueue'][_0xf153('0x127')](db['Pause'],{'as':_0xf153('0x15b'),'foreignKey':_0xf153('0x15c')});db[_0xf153('0x1d')][_0xf153('0x129')](db[_0xf153('0xfe')],{'as':_0xf153('0x12e'),'through':'voice_queues_has_cm_lists'});db[_0xf153('0x1d')]['belongsToMany'](db[_0xf153('0x14')],{'as':'Agents','through':_0xf153('0x137')});db[_0xf153('0x1d')][_0xf153('0x129')](db[_0xf153('0xeb')],{'as':'Teams','through':_0xf153('0x112')});db['VoiceQueue'][_0xf153('0x129')](db['CmList'],{'as':_0xf153('0x15d'),'through':_0xf153('0x15e')});db[_0xf153('0x11b')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x14'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x20')]['belongsTo'](db[_0xf153('0x14')],{'as':_0xf153('0x14'),'foreignKey':'UserId'});db[_0xf153('0x22')][_0xf153('0x11a')](db[_0xf153('0x24')],{'as':_0xf153('0x15f'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x160'),'sourceKey':_0xf153('0x161')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0xf153('0x160'),'targetKey':_0xf153('0x161')});db[_0xf153('0x26')]['hasMany'](db['VoiceQueueReport'],{'as':_0xf153('0x162'),'foreignKey':'uniqueid','constraints':![]});db[_0xf153('0x26')][_0xf153('0x11a')](db[_0xf153('0x163')],{'as':_0xf153('0x164'),'foreignKey':_0xf153('0x165'),'constraints':![]});db['VoiceCallReport'][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x14'),'foreignKey':'UserId'});db[_0xf153('0x26')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x168')][_0xf153('0x127')](db[_0xf153('0x3e')],{'as':_0xf153('0x3e'),'foreignKey':_0xf153('0x169')});db[_0xf153('0x3d')][_0xf153('0x127')](db[_0xf153('0x3e')],{'as':_0xf153('0x3e'),'foreignKey':_0xf153('0x169')});db[_0xf153('0x3e')][_0xf153('0x16a')](db['MailServerIn'],{'as':_0xf153('0x16b'),'onDelete':_0xf153('0x118')});db[_0xf153('0x3e')][_0xf153('0x16a')](db['MailServerOut'],{'as':_0xf153('0x16c'),'onDelete':_0xf153('0x118')});db[_0xf153('0x3e')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':'MailAccountId','onDelete':_0xf153('0x118')});db[_0xf153('0x3e')]['hasMany'](db[_0xf153('0x16e')],{'as':_0xf153('0x16f'),'foreignKey':_0xf153('0x169')});db[_0xf153('0x3e')][_0xf153('0x11a')](db[_0xf153('0x46')],{'as':_0xf153('0x15f'),'foreignKey':_0xf153('0x169')});db[_0xf153('0x3e')][_0xf153('0x11a')](db[_0xf153('0x44')],{'as':_0xf153('0x170')});db[_0xf153('0x3e')]['hasMany'](db[_0xf153('0x171')],{'as':_0xf153('0x14e')});db[_0xf153('0x3e')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':'ListId'});db['MailAccount'][_0xf153('0x127')](db[_0xf153('0x94')],{'as':_0xf153('0x94'),'foreignKey':'TemplateId'});db[_0xf153('0x3e')][_0xf153('0x127')](db[_0xf153('0x8c')],{'as':_0xf153('0x15b'),'foreignKey':_0xf153('0x15c')});db[_0xf153('0x3e')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xf153('0x40')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x13a')});db['MailQueue'][_0xf153('0x129')](db[_0xf153('0xeb')],{'through':_0xf153('0x174'),'as':_0xf153('0x175')});db[_0xf153('0x44')]['hasMany'](db[_0xf153('0x46')],{'as':'Messages','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x176')});db[_0xf153('0x44')][_0xf153('0x127')](db[_0xf153('0x3e')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xf153('0x44')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x44')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x177'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x44')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':_0xf153('0x178'),'as':_0xf153('0x179')});db[_0xf153('0x44')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':_0xf153('0x178'),'as':_0xf153('0x17a')});db[_0xf153('0x44')][_0xf153('0x129')](db['User'],{'as':'Users','through':_0xf153('0x130'),'foreignKey':_0xf153('0x176')});db[_0xf153('0x46')]['hasMany'](db[_0xf153('0xf2')],{'as':_0xf153('0x17b'),'onDelete':_0xf153('0x118')});db['MailMessage'][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x14')});db[_0xf153('0x46')]['belongsTo'](db[_0xf153('0x75')],{'onDelete':'cascade','as':_0xf153('0x166')});db[_0xf153('0x46')][_0xf153('0x127')](db[_0xf153('0x44')],{'as':'Interaction','foreignKey':_0xf153('0x176')});db['MailMessage'][_0xf153('0x127')](db[_0xf153('0x3e')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x169')});db[_0xf153('0x46')][_0xf153('0x127')](db[_0xf153('0x140')],{'as':_0xf153('0x140'),'foreignKey':_0xf153('0x17d')});db['MailMessage']['belongsTo'](db[_0xf153('0x6c')],{'as':_0xf153('0x6c'),'foreignKey':_0xf153('0x17e')});db['MailApplication'][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x17f')});db['MailApplication'][_0xf153('0x127')](db[_0xf153('0x40')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x171')]['belongsTo'](db['MailAccount'],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x171')][_0xf153('0x127')](db[_0xf153('0x8a')],{'onDelete':'restrict','foreignKey':_0xf153('0x15a')});db[_0xf153('0x171')][_0xf153('0x127')](db[_0xf153('0x92')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x180')});db[_0xf153('0x49')][_0xf153('0x127')](db[_0xf153('0x3e')],{});db[_0xf153('0x49')]['belongsTo'](db['CmList'],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db[_0xf153('0x49')]['belongsTo'](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':'ContactId'});db[_0xf153('0x49')][_0xf153('0x127')](db['MailInteraction'],{});db['MailQueueReport'][_0xf153('0x127')](db['MailMessage'],{});db[_0xf153('0x49')][_0xf153('0x127')](db[_0xf153('0x14')],{});db['MailQueueReport'][_0xf153('0x127')](db[_0xf153('0x40')],{});db['Dashboard'][_0xf153('0x11a')](db['DashboardItem'],{'as':'Items','onDelete':_0xf153('0x118')});db[_0xf153('0x4c')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':_0xf153('0x182'),'onDelete':'cascade'});db[_0xf153('0x4c')][_0xf153('0x11a')](db[_0xf153('0x16e')],{'as':_0xf153('0x16f'),'foreignKey':_0xf153('0x182')});db[_0xf153('0x4c')][_0xf153('0x11a')](db[_0xf153('0x132')],{'as':'Interactions'});db[_0xf153('0x4c')][_0xf153('0x11a')](db['FaxApplication'],{'as':_0xf153('0x14e')});db[_0xf153('0x4c')][_0xf153('0x11a')](db['VoiceExtension'],{'as':_0xf153('0x183'),'onDelete':_0xf153('0x118')});db[_0xf153('0x4c')][_0xf153('0x11a')](db[_0xf153('0x184')],{'as':_0xf153('0x15f')});db[_0xf153('0x4c')][_0xf153('0x127')](db[_0xf153('0x2e')],{'as':_0xf153('0x2e')});db[_0xf153('0x4c')]['belongsTo'](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db[_0xf153('0x4c')][_0xf153('0x127')](db[_0xf153('0x8c')],{'as':_0xf153('0x15b'),'foreignKey':_0xf153('0x15c')});db[_0xf153('0x4c')][_0xf153('0x129')](db['User'],{'as':_0xf153('0x173'),'through':_0xf153('0x144')});db[_0xf153('0x4e')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x4e')][_0xf153('0x127')](db['FaxQueue'],{'onDelete':'restrict'});db[_0xf153('0x4e')]['belongsTo'](db[_0xf153('0x4c')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x4e')][_0xf153('0x127')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf153('0x180')});db[_0xf153('0x132')][_0xf153('0x11a')](db[_0xf153('0x184')],{'as':_0xf153('0x15f'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x185')});db[_0xf153('0x132')][_0xf153('0x127')](db[_0xf153('0x4c')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x182')});db[_0xf153('0x132')][_0xf153('0x127')](db['CmContact'],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x132')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x177'),'foreignKey':_0xf153('0x119')});db[_0xf153('0x132')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':'fax_interaction_has_tags','as':_0xf153('0x179')});db[_0xf153('0x132')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':'fax_interaction_has_tags','as':_0xf153('0x17a')});db['FaxInteraction']['belongsToMany'](db['User'],{'as':'Users','through':_0xf153('0x133'),'foreignKey':_0xf153('0x185')});db[_0xf153('0x184')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':'cascade','as':_0xf153('0x14')});db[_0xf153('0x184')]['belongsTo'](db[_0xf153('0x132')],{'as':_0xf153('0x186'),'foreignKey':'FaxInteractionId'});db[_0xf153('0x184')]['belongsTo'](db[_0xf153('0x75')],{'onDelete':'cascade','as':_0xf153('0x166')});db['FaxMessage'][_0xf153('0x127')](db[_0xf153('0xf2')],{'as':_0xf153('0xf2'),'foreignKey':_0xf153('0x187')});db[_0xf153('0x184')]['belongsTo'](db[_0xf153('0x4c')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x182')});db[_0xf153('0x51')]['belongsToMany'](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x36')});db[_0xf153('0x51')][_0xf153('0x129')](db['Team'],{'through':_0xf153('0x188'),'as':_0xf153('0x175')});db[_0xf153('0x53')][_0xf153('0x127')](db['FaxAccount'],{});db[_0xf153('0x53')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db['FaxQueueReport'][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x53')][_0xf153('0x127')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xf153('0x127')](db[_0xf153('0x184')],{});db[_0xf153('0x53')][_0xf153('0x127')](db[_0xf153('0x14')],{});db['FaxQueueReport'][_0xf153('0x127')](db[_0xf153('0x51')],{});db[_0xf153('0x55')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':'Dispositions','foreignKey':_0xf153('0x189'),'onDelete':_0xf153('0x118')});db['SmsAccount'][_0xf153('0x11a')](db[_0xf153('0x16e')],{'as':'Answers','foreignKey':_0xf153('0x189')});db['SmsAccount'][_0xf153('0x11a')](db[_0xf153('0x5a')],{'as':_0xf153('0x15f'),'foreignKey':_0xf153('0x189')});db[_0xf153('0x55')]['hasMany'](db[_0xf153('0x58')],{'as':'Interactions'});db[_0xf153('0x55')][_0xf153('0x11a')](db[_0xf153('0x56')],{'as':_0xf153('0x14e')});db[_0xf153('0x55')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db['SmsAccount'][_0xf153('0x127')](db[_0xf153('0x8c')],{'as':_0xf153('0x15b'),'foreignKey':_0xf153('0x15c')});db['SmsAccount'][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Agents','through':_0xf153('0x147')});db[_0xf153('0x56')]['belongsTo'](db[_0xf153('0x14')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x56')][_0xf153('0x127')](db[_0xf153('0x5c')],{'onDelete':_0xf153('0x17f')});db['SmsApplication'][_0xf153('0x127')](db[_0xf153('0x55')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x56')][_0xf153('0x127')](db[_0xf153('0x8a')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x15a')});db['SmsApplication'][_0xf153('0x127')](db[_0xf153('0x92')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x180')});db[_0xf153('0x58')][_0xf153('0x11a')](db['SmsMessage'],{'as':_0xf153('0x15f'),'onDelete':_0xf153('0x118'),'foreignKey':'SmsInteractionId'});db[_0xf153('0x58')][_0xf153('0x127')](db[_0xf153('0x55')],{'as':_0xf153('0x17c'),'foreignKey':'SmsAccountId'});db[_0xf153('0x58')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x58')]['belongsTo'](db[_0xf153('0x14')],{'as':_0xf153('0x177'),'foreignKey':_0xf153('0x119')});db['SmsInteraction'][_0xf153('0x129')](db['Tag'],{'through':_0xf153('0x18a'),'as':_0xf153('0x179')});db[_0xf153('0x58')][_0xf153('0x129')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xf153('0x17a')});db[_0xf153('0x58')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x18b'),'through':_0xf153('0x18c'),'foreignKey':_0xf153('0x18d')});db[_0xf153('0x5a')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x14')});db[_0xf153('0x5a')][_0xf153('0x127')](db[_0xf153('0x75')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x166')});db[_0xf153('0x5a')]['belongsTo'](db[_0xf153('0x58')],{'onDelete':_0xf153('0x118'),'as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xf153('0x127')](db[_0xf153('0x55')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x189')});db[_0xf153('0x5c')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':'UserSmsQueue','foreignKey':_0xf153('0x18e')});db[_0xf153('0x5c')][_0xf153('0x129')](db['Team'],{'through':_0xf153('0x18f'),'as':_0xf153('0x175')});db[_0xf153('0x190')][_0xf153('0x11a')](db['Disposition'],{'as':_0xf153('0x16d'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xf153('0x190')][_0xf153('0x11a')](db[_0xf153('0x16e')],{'as':_0xf153('0x16f'),'foreignKey':_0xf153('0x191')});db[_0xf153('0x190')][_0xf153('0x11a')](db[_0xf153('0x5e')],{'as':'Interactions','foreignKey':_0xf153('0x191')});db[_0xf153('0x190')][_0xf153('0x11a')](db[_0xf153('0x60')],{'as':_0xf153('0x15f'),'foreignKey':_0xf153('0x191')});db[_0xf153('0x190')]['hasMany'](db[_0xf153('0x192')],{'as':_0xf153('0x14e'),'foreignKey':'OpenchannelAccountId'});db[_0xf153('0x190')][_0xf153('0x127')](db['CmList'],{'as':'List','foreignKey':_0xf153('0x181')});db['OpenchannelAccount']['belongsTo'](db['Pause'],{'as':_0xf153('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf153('0x190')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0xf153('0x192')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x192')][_0xf153('0x127')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0xf153('0x193')});db[_0xf153('0x192')]['belongsTo'](db[_0xf153('0x190')],{'onDelete':'restrict','foreignKey':_0xf153('0x191')});db[_0xf153('0x192')]['belongsTo'](db[_0xf153('0x8a')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x15a')});db['OpenchannelApplication'][_0xf153('0x127')](db[_0xf153('0x92')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x180')});db[_0xf153('0x5e')][_0xf153('0x11a')](db['OpenchannelMessage'],{'as':_0xf153('0x15f'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x194')});db[_0xf153('0x5e')][_0xf153('0x127')](db[_0xf153('0x190')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x191')});db[_0xf153('0x5e')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x5e')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x177'),'foreignKey':_0xf153('0x119')});db['OpenchannelInteraction']['belongsToMany'](db[_0xf153('0x92')],{'through':_0xf153('0x195'),'as':_0xf153('0x179')});db[_0xf153('0x5e')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':'openchannel_interaction_has_tags','as':_0xf153('0x17a')});db['OpenchannelInteraction']['belongsToMany'](db[_0xf153('0x14')],{'as':_0xf153('0x18b'),'through':_0xf153('0x134'),'foreignKey':_0xf153('0x194')});db[_0xf153('0x60')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x118'),'as':'User'});db[_0xf153('0x60')][_0xf153('0x127')](db[_0xf153('0x75')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x166')});db[_0xf153('0x60')][_0xf153('0x127')](db[_0xf153('0x5e')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x186'),'foreignKey':_0xf153('0x194')});db[_0xf153('0x60')][_0xf153('0x127')](db['Attachment'],{'as':_0xf153('0xf2'),'foreignKey':_0xf153('0x187')});db[_0xf153('0x60')][_0xf153('0x127')](db[_0xf153('0x190')],{'as':'Account','foreignKey':_0xf153('0x191')});db[_0xf153('0x62')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x39'),'foreignKey':_0xf153('0x193')});db['OpenchannelQueue'][_0xf153('0x129')](db[_0xf153('0xeb')],{'through':_0xf153('0x196'),'as':_0xf153('0x175')});db[_0xf153('0x140')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':_0xf153('0x17d'),'onDelete':_0xf153('0x118')});db['ChatWebsite'][_0xf153('0x11a')](db[_0xf153('0x16e')],{'as':_0xf153('0x16f'),'foreignKey':_0xf153('0x17d')});db[_0xf153('0x140')][_0xf153('0x11a')](db[_0xf153('0x72')],{'as':_0xf153('0x197')});db['ChatWebsite'][_0xf153('0x11a')](db[_0xf153('0x68')],{'as':_0xf153('0x170')});db['ChatWebsite'][_0xf153('0x11a')](db[_0xf153('0x198')],{'as':'Applications'});db[_0xf153('0x140')][_0xf153('0x11a')](db[_0xf153('0x6a')],{'as':_0xf153('0x15f')});db[_0xf153('0x140')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':'ListId'});db['ChatWebsite']['belongsTo'](db[_0xf153('0x8a')],{'as':_0xf153('0x8a'),'foreignKey':_0xf153('0x15a')});db[_0xf153('0x140')][_0xf153('0x127')](db[_0xf153('0x3e')],{'as':_0xf153('0x3e'),'foreignKey':_0xf153('0x169')});db['ChatWebsite']['belongsTo'](db[_0xf153('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xf153('0x129')](db['User'],{'as':_0xf153('0x173'),'through':_0xf153('0x142')});db[_0xf153('0x65')][_0xf153('0x127')](db[_0xf153('0x190')],{});db[_0xf153('0x65')]['belongsTo'](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db[_0xf153('0x65')][_0xf153('0x127')](db['CmContact'],{'as':_0xf153('0x166'),'foreignKey':'ContactId'});db[_0xf153('0x65')]['belongsTo'](db[_0xf153('0x5e')],{});db['OpenchannelQueueReport'][_0xf153('0x127')](db['OpenchannelMessage'],{});db[_0xf153('0x65')][_0xf153('0x127')](db['User'],{});db[_0xf153('0x65')][_0xf153('0x127')](db[_0xf153('0x62')],{});db[_0xf153('0x198')]['belongsTo'](db[_0xf153('0x14')],{'as':_0xf153('0x199'),'foreignKey':_0xf153('0x119'),'onDelete':'restrict'});db[_0xf153('0x198')][_0xf153('0x127')](db[_0xf153('0x6e')],{'as':_0xf153('0x19a'),'foreignKey':_0xf153('0x19b'),'onDelete':_0xf153('0x17f')});db[_0xf153('0x198')][_0xf153('0x127')](db[_0xf153('0x140')],{'as':_0xf153('0x19c'),'foreignKey':_0xf153('0x17d'),'onDelete':_0xf153('0x17f')});db[_0xf153('0x198')][_0xf153('0x127')](db[_0xf153('0x92')],{'onDelete':_0xf153('0x17f'),'foreignKey':_0xf153('0x180')});db['ChatInteraction']['hasMany'](db[_0xf153('0x6a')],{'as':_0xf153('0x15f'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x19d')});db[_0xf153('0x68')][_0xf153('0x127')](db[_0xf153('0x140')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x17d')});db['ChatInteraction'][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':'ContactId'});db[_0xf153('0x68')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':'Owner','foreignKey':_0xf153('0x119')});db[_0xf153('0x68')]['belongsToMany'](db[_0xf153('0x92')],{'through':_0xf153('0x19e'),'as':_0xf153('0x179')});db[_0xf153('0x68')]['belongsToMany'](db[_0xf153('0x92')],{'through':_0xf153('0x19e'),'as':_0xf153('0x17a')});db['ChatInteraction']['belongsToMany'](db[_0xf153('0x14')],{'as':_0xf153('0x18b'),'through':_0xf153('0x131'),'foreignKey':_0xf153('0x19d')});db[_0xf153('0x6a')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x14')});db[_0xf153('0x6a')][_0xf153('0x127')](db[_0xf153('0x75')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db['ChatMessage'][_0xf153('0x127')](db[_0xf153('0x68')],{'onDelete':'cascade','as':_0xf153('0x186'),'foreignKey':'ChatInteractionId'});db[_0xf153('0x6a')]['belongsTo'](db[_0xf153('0xf2')],{'as':_0xf153('0xf2'),'foreignKey':'AttachmentId'});db[_0xf153('0x6a')][_0xf153('0x127')](db[_0xf153('0x140')],{'as':_0xf153('0x17c'),'foreignKey':'ChatWebsiteId'});db[_0xf153('0x6c')][_0xf153('0x11a')](db['Attachment'],{'as':'Attachments','foreignKey':_0xf153('0x17e'),'onDelete':_0xf153('0x118'),'hooks':!![]});db[_0xf153('0x6c')][_0xf153('0x127')](db[_0xf153('0x75')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0x6c')][_0xf153('0x127')](db['ChatWebsite'],{'as':_0xf153('0x17c'),'foreignKey':'ChatWebsiteId'});db[_0xf153('0x6e')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x33'),'hooks':!![]});db[_0xf153('0x6e')][_0xf153('0x129')](db['Team'],{'through':_0xf153('0x19f'),'as':'Teams'});db['ChatGroup']['hasMany'](db[_0xf153('0x1a0')],{'as':_0xf153('0x15f'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db['ChatGroup'][_0xf153('0x129')](db['User'],{'as':_0xf153('0x152'),'through':_0xf153('0x12b')});db['ChatProactiveAction'][_0xf153('0x127')](db[_0xf153('0x140')],{'as':_0xf153('0x19c'),'foreignKey':_0xf153('0x17d')});db['CmCompany'][_0xf153('0x11a')](db[_0xf153('0x75')],{'as':'Contacts','foreignKey':_0xf153('0x1a1')});db['CmContact'][_0xf153('0x11a')](db['CmHopper'],{'as':_0xf153('0x154'),'foreignKey':'ContactId'});db[_0xf153('0x75')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xf153('0x167')});db[_0xf153('0x75')]['hasMany'](db['CmHopperHistory'],{'as':_0xf153('0x155'),'foreignKey':'ContactId'});db['CmContact'][_0xf153('0x11a')](db[_0xf153('0x7f')],{'as':_0xf153('0x7f'),'foreignKey':_0xf153('0x167')});db['CmContact'][_0xf153('0x11a')](db[_0xf153('0x157')],{'as':_0xf153('0x1a2'),'foreignKey':'ContactId'});db[_0xf153('0x75')]['hasMany'](db[_0xf153('0x5e')],{'as':_0xf153('0x1a3'),'foreignKey':_0xf153('0x167'),'onDelete':'restrict'});db[_0xf153('0x75')][_0xf153('0x11a')](db[_0xf153('0x68')],{'as':_0xf153('0x121'),'foreignKey':'ContactId','onDelete':_0xf153('0x17f')});db[_0xf153('0x75')][_0xf153('0x11a')](db[_0xf153('0x58')],{'as':_0xf153('0x122'),'foreignKey':_0xf153('0x167'),'onDelete':_0xf153('0x17f')});db[_0xf153('0x75')][_0xf153('0x11a')](db[_0xf153('0x132')],{'as':_0xf153('0x123'),'foreignKey':_0xf153('0x167'),'onDelete':_0xf153('0x17f')});db[_0xf153('0x75')][_0xf153('0x11a')](db[_0xf153('0x44')],{'as':_0xf153('0x124'),'foreignKey':'ContactId','onDelete':_0xf153('0x17f')});db[_0xf153('0x75')][_0xf153('0x127')](db[_0xf153('0x73')],{'as':'Company','foreignKey':_0xf153('0x1a1')});db['CmContact'][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181'),'onDelete':_0xf153('0x118')});db[_0xf153('0x75')][_0xf153('0x129')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0xf153('0x75')][_0xf153('0x129')](db[_0xf153('0x92')],{'as':_0xf153('0x179'),'through':_0xf153('0x1a4')});db[_0xf153('0x75')]['belongsToMany'](db[_0xf153('0x92')],{'through':'cm_contact_has_tags','as':_0xf153('0x17a')});db['CmHopper'][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167'),'onDelete':_0xf153('0x118')});db[_0xf153('0x77')]['belongsTo'](db['CmList'],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181'),'onDelete':_0xf153('0x118')});db[_0xf153('0x77')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':_0xf153('0x199'),'foreignKey':'UserId'});db[_0xf153('0x77')][_0xf153('0x127')](db[_0xf153('0x1d')],{'as':_0xf153('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0xf153('0x118')});db[_0xf153('0x77')][_0xf153('0x127')](db[_0xf153('0xef')],{'as':_0xf153('0xef'),'foreignKey':'CampaignId','onDelete':_0xf153('0x118')});db[_0xf153('0x77')]['belongsTo'](db[_0xf153('0x14')],{'as':_0xf153('0x177'),'foreignKey':_0xf153('0x1a5')});db[_0xf153('0x79')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167'),'onDelete':_0xf153('0x118')});db[_0xf153('0x79')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':'List','foreignKey':_0xf153('0x181'),'onDelete':_0xf153('0x118')});db[_0xf153('0x79')]['belongsTo'](db['VoiceQueue'],{'as':_0xf153('0x19a'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xf153('0x79')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0xf153('0x1a6'),'onDelete':_0xf153('0x118')});db[_0xf153('0x84')][_0xf153('0x11a')](db[_0xf153('0x88')],{'as':{'plural':'All','singular':_0xf153('0x1a7')},'foreignKey':_0xf153('0x1a8'),'onDelete':_0xf153('0x118'),'hooks':!![]});db[_0xf153('0x84')]['hasMany'](db[_0xf153('0x88')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0xf153('0x1a9'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xf153('0x11a')](db['Action'],{'as':_0xf153('0x1aa'),'foreignKey':'AutomationId','onDelete':_0xf153('0x118'),'hooks':!![]});db[_0xf153('0x86')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':_0xf153('0x1ab'),'onDelete':'cascade'});db['Interval']['hasMany'](db[_0xf153('0x8a')],{'as':_0xf153('0x1ac'),'foreignKey':_0xf153('0x15a'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xf153('0x8a')][_0xf153('0x11a')](db[_0xf153('0x19')],{'as':_0xf153('0x11e'),'foreignKey':_0xf153('0x15a'),'onDelete':_0xf153('0x17f')});db['Interval'][_0xf153('0x11a')](db['MailApplication'],{'as':_0xf153('0x1ad'),'foreignKey':_0xf153('0x15a')});db['Interval']['hasMany'](db[_0xf153('0x198')],{'as':'ChatApplications','foreignKey':_0xf153('0x15a')});db[_0xf153('0x8a')][_0xf153('0x11a')](db['FaxApplication'],{'as':_0xf153('0x1ae'),'foreignKey':'IntervalId'});db[_0xf153('0x8a')][_0xf153('0x11a')](db[_0xf153('0x56')],{'as':_0xf153('0x1af'),'foreignKey':'IntervalId'});db[_0xf153('0x1b0')][_0xf153('0x127')](db[_0xf153('0x3e')],{});db[_0xf153('0x1b0')][_0xf153('0x127')](db['AnalyticDefaultReport'],{'foreignKey':_0xf153('0x1b1')});db[_0xf153('0x1b0')][_0xf153('0x127')](db[_0xf153('0x9c')],{'foreignKey':'CustomReportId'});db[_0xf153('0x14f')][_0xf153('0x129')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xf153('0x151'),'onDelete':_0xf153('0x17f')});db['Tag'][_0xf153('0x129')](db['CmContact'],{'through':_0xf153('0x1a4')});db[_0xf153('0x92')][_0xf153('0x129')](db[_0xf153('0x68')],{'through':_0xf153('0x19e')});db[_0xf153('0x92')][_0xf153('0x129')](db['MailInteraction'],{'through':_0xf153('0x178')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xf153('0x92')]['belongsToMany'](db[_0xf153('0x132')],{'through':_0xf153('0x1b2')});db[_0xf153('0x92')][_0xf153('0x129')](db[_0xf153('0x5e')],{'through':_0xf153('0x195')});db['Tag'][_0xf153('0x129')](db[_0xf153('0x10a')],{'through':'whatsapp_interaction_has_tags'});db[_0xf153('0x96')][_0xf153('0x11a')](db[_0xf153('0x88')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xf153('0x1b3'),'onDelete':'cascade','hooks':!![]});db[_0xf153('0x96')][_0xf153('0x11a')](db[_0xf153('0x88')],{'as':{'plural':_0xf153('0x1b4'),'singular':_0xf153('0x1b5')},'foreignKey':'TriggerAnyId','onDelete':_0xf153('0x118'),'hooks':!![]});db[_0xf153('0x96')]['hasMany'](db[_0xf153('0x83')],{'as':_0xf153('0x1aa'),'foreignKey':'TriggerId','onDelete':_0xf153('0x118'),'hooks':!![]});db['AnalyticCustomReport'][_0xf153('0x11a')](db[_0xf153('0xa3')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xf153('0x9e')][_0xf153('0x11a')](db[_0xf153('0xa3')],{'as':_0xf153('0x1b6'),'onDelete':'cascade','foreignKey':_0xf153('0x1b1')});db[_0xf153('0x1b7')][_0xf153('0x11a')](db[_0xf153('0xa3')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1b8')});db[_0xf153('0xa3')]['belongsTo'](db[_0xf153('0x1b7')],{'foreignKey':'MetricId'});db[_0xf153('0xa6')]['hasMany'](db[_0xf153('0xa8')],{'as':_0xf153('0x1b9'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0xa8')][_0xf153('0x11a')](db[_0xf153('0xaa')],{'as':'Subjects','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xa8')][_0xf153('0x11a')](db[_0xf153('0xaa')],{'as':_0xf153('0x1bc'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bd')});db['SalesforceConfiguration'][_0xf153('0x11a')](db[_0xf153('0xaa')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1be')});db['SalesforceConfiguration'][_0xf153('0x127')](db[_0xf153('0xa6')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0xaa')][_0xf153('0x11a')](db[_0xf153('0xaa')],{'as':_0xf153('0x1bf'),'foreignKey':'SubjectId'});db[_0xf153('0xaa')][_0xf153('0x11a')](db[_0xf153('0xaa')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db['SalesforceField']['hasMany'](db[_0xf153('0xaa')],{'as':_0xf153('0x1c1'),'foreignKey':'FieldId'});db['SalesforceField'][_0xf153('0x127')](db[_0xf153('0x98')],{'as':'Variable','foreignKey':_0xf153('0x1c2')});db[_0xf153('0xac')][_0xf153('0x11a')](db['SugarcrmConfiguration'],{'as':_0xf153('0x1b9'),'onDelete':'cascade','foreignKey':_0xf153('0x1ba')});db[_0xf153('0xae')][_0xf153('0x11a')](db[_0xf153('0xb0')],{'as':_0xf153('0x1c3'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xae')]['hasMany'](db[_0xf153('0xb0')],{'as':_0xf153('0x1bc'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xae')][_0xf153('0x11a')](db[_0xf153('0xb0')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1be')});db['SugarcrmConfiguration']['belongsTo'](db[_0xf153('0xac')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0xb0')][_0xf153('0x11a')](db[_0xf153('0xb0')],{'as':_0xf153('0x1bf'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xb0')][_0xf153('0x11a')](db[_0xf153('0xb0')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db['SugarcrmField'][_0xf153('0x11a')](db[_0xf153('0xb0')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xb0')][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0xb2')][_0xf153('0x11a')](db[_0xf153('0x1c4')],{'as':'Configurations','onDelete':_0xf153('0x118'),'foreignKey':'AccountId'});db[_0xf153('0x1c4')][_0xf153('0x11a')](db['DeskField'],{'as':_0xf153('0x1c3'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0x1c4')][_0xf153('0x11a')](db[_0xf153('0xb4')],{'as':'Descriptions','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0x1c4')][_0xf153('0x11a')](db[_0xf153('0xb4')],{'as':'Fields','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0x1c4')][_0xf153('0x127')](db[_0xf153('0xb2')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0x1c4')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':_0xf153('0x1c5')});db[_0xf153('0xb4')][_0xf153('0x11a')](db[_0xf153('0xb4')],{'as':_0xf153('0x1bf'),'foreignKey':'SubjectId'});db[_0xf153('0xb4')][_0xf153('0x11a')](db['DeskField'],{'as':'Description','foreignKey':_0xf153('0x1bd')});db['DeskField'][_0xf153('0x11a')](db[_0xf153('0xb4')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db['DeskField'][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0xb6')][_0xf153('0x11a')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1ba')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xf153('0x1c3'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db['ZohoConfiguration'][_0xf153('0x11a')](db[_0xf153('0xba')],{'as':_0xf153('0x1bc'),'onDelete':_0xf153('0x118'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xf153('0x11a')](db[_0xf153('0xba')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xb8')]['belongsTo'](db[_0xf153('0xb6')],{'as':'Account','foreignKey':_0xf153('0x1ba')});db[_0xf153('0xba')][_0xf153('0x11a')](db[_0xf153('0xba')],{'as':_0xf153('0x1bf'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xba')][_0xf153('0x11a')](db['ZohoField'],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xba')][_0xf153('0x11a')](db[_0xf153('0xba')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xba')][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':'VariableId'});db[_0xf153('0x1c6')][_0xf153('0x11a')](db[_0xf153('0x1c7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf153('0x1ba')});db[_0xf153('0x1c7')][_0xf153('0x11a')](db[_0xf153('0xbe')],{'as':_0xf153('0x1c3'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0x1c7')][_0xf153('0x11a')](db[_0xf153('0xbe')],{'as':_0xf153('0x1bc'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0x1c7')][_0xf153('0x11a')](db['ZendeskField'],{'as':_0xf153('0x1b6'),'foreignKey':_0xf153('0x1be')});db['ZendeskConfiguration'][_0xf153('0x127')](db[_0xf153('0x1c6')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0x1c7')]['belongsToMany'](db['Tag'],{'through':_0xf153('0x1c8')});db[_0xf153('0xbe')][_0xf153('0x11a')](db[_0xf153('0xbe')],{'as':_0xf153('0x1bf'),'foreignKey':'SubjectId'});db['ZendeskField'][_0xf153('0x11a')](db[_0xf153('0xbe')],{'as':'Description','foreignKey':_0xf153('0x1bd')});db['ZendeskField']['hasMany'](db[_0xf153('0xbe')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xbe')][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0x1c9')]['hasMany'](db[_0xf153('0xc1')],{'as':'Configurations','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1ba')});db['FreshdeskConfiguration']['hasMany'](db[_0xf153('0xc3')],{'as':_0xf153('0x1c3'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db['FreshdeskConfiguration'][_0xf153('0x11a')](db[_0xf153('0xc3')],{'as':_0xf153('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf153('0xc1')][_0xf153('0x11a')](db['FreshdeskField'],{'as':_0xf153('0x1b6'),'onDelete':'cascade','foreignKey':_0xf153('0x1be')});db[_0xf153('0xc1')][_0xf153('0x127')](db[_0xf153('0x1c9')],{'as':_0xf153('0x17c'),'foreignKey':'AccountId'});db[_0xf153('0xc1')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':_0xf153('0x1ca')});db[_0xf153('0xc3')][_0xf153('0x11a')](db['FreshdeskField'],{'as':_0xf153('0x1bf'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xc3')]['hasMany'](db[_0xf153('0xc3')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xc3')]['hasMany'](db['FreshdeskField'],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xc3')]['belongsTo'](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0x1cb')][_0xf153('0x11a')](db[_0xf153('0xc6')],{'as':'Configurations','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1ba')});db['VtigerConfiguration'][_0xf153('0x11a')](db[_0xf153('0x1cc')],{'as':_0xf153('0x1c3'),'foreignKey':'SubjectId'});db[_0xf153('0xc6')]['hasMany'](db[_0xf153('0x1cc')],{'as':_0xf153('0x1bc'),'foreignKey':'DescriptionId'});db[_0xf153('0xc6')][_0xf153('0x11a')](db[_0xf153('0x1cc')],{'as':_0xf153('0x1b6'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xc6')][_0xf153('0x127')](db[_0xf153('0x1cb')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0x1cc')][_0xf153('0x11a')](db[_0xf153('0x1cc')],{'as':_0xf153('0x1bf'),'foreignKey':'SubjectId'});db[_0xf153('0x1cc')][_0xf153('0x11a')](db[_0xf153('0x1cc')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0x1cc')]['hasMany'](db[_0xf153('0x1cc')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db['VtigerField'][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0xc9')]['hasMany'](db[_0xf153('0xcb')],{'as':_0xf153('0x1b9'),'onDelete':'cascade','foreignKey':_0xf153('0x1ba')});db[_0xf153('0xcb')][_0xf153('0x11a')](db[_0xf153('0xcd')],{'as':_0xf153('0x1c3'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xcb')][_0xf153('0x11a')](db['ServicenowField'],{'as':_0xf153('0x1bc'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xcb')][_0xf153('0x11a')](db[_0xf153('0xcd')],{'as':_0xf153('0x1b6'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xcb')][_0xf153('0x127')](db[_0xf153('0xc9')],{'as':_0xf153('0x17c'),'foreignKey':'AccountId'});db['ServicenowField'][_0xf153('0x11a')](db['ServicenowField'],{'as':'Subject','foreignKey':_0xf153('0x1bb')});db['ServicenowField']['hasMany'](db[_0xf153('0xcd')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xcd')][_0xf153('0x11a')](db[_0xf153('0xcd')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xcd')][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':'VariableId'});db[_0xf153('0xce')][_0xf153('0x11a')](db[_0xf153('0x1cd')],{'as':_0xf153('0x1b9'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1ba')});db['Dynamics365Configuration']['hasMany'](db[_0xf153('0xd0')],{'as':'Subjects','onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1bb')});db['Dynamics365Configuration']['hasMany'](db[_0xf153('0xd0')],{'as':_0xf153('0x1bc'),'onDelete':'cascade','foreignKey':_0xf153('0x1bd')});db['Dynamics365Configuration'][_0xf153('0x11a')](db[_0xf153('0xd0')],{'as':_0xf153('0x1b6'),'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0x1cd')]['belongsTo'](db[_0xf153('0xce')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0xd0')][_0xf153('0x11a')](db[_0xf153('0xd0')],{'as':_0xf153('0x1bf'),'foreignKey':'SubjectId'});db[_0xf153('0xd0')]['hasMany'](db[_0xf153('0xd0')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xd0')]['hasMany'](db['Dynamics365Field'],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db['Dynamics365Field'][_0xf153('0x127')](db[_0xf153('0x98')],{'as':_0xf153('0x98'),'foreignKey':_0xf153('0x1c2')});db[_0xf153('0xd1')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0xf153('0x1b9'),'onDelete':'cascade','foreignKey':_0xf153('0x1ba')});db['FreshsalesConfiguration']['hasMany'](db[_0xf153('0xd4')],{'as':_0xf153('0x1c3'),'foreignKey':'SubjectId'});db[_0xf153('0xd2')][_0xf153('0x11a')](db['FreshsalesField'],{'as':_0xf153('0x1bc'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xd2')]['hasMany'](db[_0xf153('0xd4')],{'as':_0xf153('0x1b6'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xd2')][_0xf153('0x127')](db[_0xf153('0xd1')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1ba')});db[_0xf153('0xd4')][_0xf153('0x11a')](db[_0xf153('0xd4')],{'as':_0xf153('0x1bf'),'foreignKey':_0xf153('0x1bb')});db[_0xf153('0xd4')][_0xf153('0x11a')](db[_0xf153('0xd4')],{'as':_0xf153('0x1c0'),'foreignKey':_0xf153('0x1bd')});db[_0xf153('0xd4')][_0xf153('0x11a')](db[_0xf153('0xd4')],{'as':_0xf153('0x1c1'),'foreignKey':_0xf153('0x1be')});db[_0xf153('0xd4')][_0xf153('0x127')](db[_0xf153('0x98')],{'as':'Variable','foreignKey':_0xf153('0x1c2')});db['ChatQueueReport'][_0xf153('0x127')](db[_0xf153('0x140')],{});db['ChatQueueReport'][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db[_0xf153('0xd9')][_0xf153('0x127')](db['CmContact'],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db[_0xf153('0xd9')][_0xf153('0x127')](db[_0xf153('0x68')],{});db[_0xf153('0xd9')][_0xf153('0x127')](db[_0xf153('0x6a')],{});db['ChatQueueReport'][_0xf153('0x127')](db['User'],{});db[_0xf153('0xd9')][_0xf153('0x127')](db[_0xf153('0x6e')],{});db[_0xf153('0x1a0')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0xf153('0x1ce')});db[_0xf153('0x1a0')][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':_0xf153('0x118'),'foreignKey':_0xf153('0x1cf')});db[_0xf153('0x157')][_0xf153('0x11a')](db[_0xf153('0xdd')],{'foreignKey':_0xf153('0x1d0'),'onDelete':'cascade'});db[_0xf153('0x157')][_0xf153('0x11a')](db[_0xf153('0xdb')],{'foreignKey':_0xf153('0x1d0'),'onDelete':'cascade'});db['SmsQueueReport'][_0xf153('0x127')](db['SmsAccount'],{});db[_0xf153('0x1d1')]['belongsTo'](db[_0xf153('0xfe')],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db['SmsQueueReport'][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':_0xf153('0x167')});db['SmsQueueReport'][_0xf153('0x127')](db[_0xf153('0x58')],{});db[_0xf153('0x1d1')][_0xf153('0x127')](db[_0xf153('0x5a')],{});db['SmsQueueReport']['belongsTo'](db[_0xf153('0x14')],{});db[_0xf153('0x1d1')][_0xf153('0x127')](db[_0xf153('0x5c')],{});db['JscriptyProject'][_0xf153('0x11a')](db[_0xf153('0x157')],{'foreignKey':'ProjectId'});db[_0xf153('0xe3')][_0xf153('0x11a')](db[_0xf153('0xdd')],{'foreignKey':_0xf153('0x1d2')});db[_0xf153('0xe3')][_0xf153('0x11a')](db[_0xf153('0xdb')],{'foreignKey':_0xf153('0x1d2')});db[_0xf153('0xe6')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x18b'),'through':'user_has_square_projects'});db[_0xf153('0xeb')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Agents','through':'user_has_teams'});db['Team'][_0xf153('0x129')](db[_0xf153('0x1d')],{'through':'TeamVoiceQueue','as':_0xf153('0x136')});db[_0xf153('0xeb')]['belongsToMany'](db['MailQueue'],{'through':_0xf153('0x174'),'as':_0xf153('0x139')});db[_0xf153('0xeb')][_0xf153('0x129')](db[_0xf153('0x6e')],{'through':_0xf153('0x19f'),'as':_0xf153('0x13b')});db['Team'][_0xf153('0x129')](db['FaxQueue'],{'through':_0xf153('0x188'),'as':_0xf153('0x1d3')});db[_0xf153('0xeb')]['belongsToMany'](db['SmsQueue'],{'through':_0xf153('0x18f'),'as':_0xf153('0x13c')});db[_0xf153('0xeb')]['belongsToMany'](db[_0xf153('0x62')],{'through':_0xf153('0x196'),'as':_0xf153('0x13d')});db['Team']['belongsToMany'](db[_0xf153('0x10f')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xf153('0xeb')][_0xf153('0x129')](db['VoicePrefix'],{'through':_0xf153('0x114'),'as':_0xf153('0x138')});db['Campaign']['hasMany'](db[_0xf153('0x77')],{'as':_0xf153('0x154'),'foreignKey':_0xf153('0x1a6')});db['Campaign'][_0xf153('0x11a')](db[_0xf153('0x7b')],{'as':'HopperFinals','foreignKey':_0xf153('0x1a6')});db['Campaign']['hasMany'](db[_0xf153('0x7d')],{'as':_0xf153('0x155'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0xf153('0x79')],{'as':_0xf153('0x156'),'foreignKey':'CampaignId'});db['Campaign'][_0xf153('0x127')](db[_0xf153('0x2e')],{'as':'Trunk','foreignKey':_0xf153('0x158')});db['Campaign'][_0xf153('0x127')](db[_0xf153('0x2e')],{'as':_0xf153('0x1d4'),'foreignKey':_0xf153('0x159')});db[_0xf153('0xef')][_0xf153('0x127')](db[_0xf153('0x8a')],{'as':_0xf153('0x8a'),'foreignKey':_0xf153('0x15a')});db[_0xf153('0xef')][_0xf153('0x127')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xf153('0x1d5')});db[_0xf153('0xef')]['belongsToMany'](db[_0xf153('0xfe')],{'as':_0xf153('0x12e'),'through':'campaigns_has_cm_lists'});db[_0xf153('0xef')][_0xf153('0x129')](db['CmList'],{'as':'BlackLists','through':_0xf153('0x1d6')});db['Attachment'][_0xf153('0x127')](db[_0xf153('0x6c')],{'as':_0xf153('0x6c'),'foreignKey':'ChatOfflineMessageId'});db[_0xf153('0x1d7')][_0xf153('0x127')](db[_0xf153('0x46')],{});db[_0xf153('0x1d7')][_0xf153('0x127')](db[_0xf153('0x44')],{});db['MailTransferReport']['belongsTo'](db[_0xf153('0x3e')],{'foreignKey':_0xf153('0x1d8'),'as':_0xf153('0x1d9')});db[_0xf153('0x1d7')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport'][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1da'),'as':_0xf153('0x1db')});db[_0xf153('0x1d7')][_0xf153('0x127')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0xf153('0x1d7')][_0xf153('0x127')](db[_0xf153('0x3e')],{'foreignKey':_0xf153('0x1dc'),'as':_0xf153('0x1dd')});db[_0xf153('0xf7')][_0xf153('0x127')](db[_0xf153('0x6a')],{});db['ChatTransferReport']['belongsTo'](db[_0xf153('0x68')],{});db[_0xf153('0xf7')][_0xf153('0x127')](db[_0xf153('0x140')],{'foreignKey':_0xf153('0x1de'),'as':_0xf153('0x1d9')});db[_0xf153('0xf7')]['belongsTo'](db['User'],{'foreignKey':_0xf153('0x1df'),'as':_0xf153('0x1e0')});db[_0xf153('0xf7')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1da'),'as':'ToAgent'});db['ChatTransferReport'][_0xf153('0x127')](db['ChatQueue'],{'foreignKey':_0xf153('0x1e1'),'as':_0xf153('0x1e2')});db[_0xf153('0xf7')][_0xf153('0x127')](db[_0xf153('0x140')],{'foreignKey':'ToChatWebsiteId','as':_0xf153('0x1dd')});db[_0xf153('0xf9')]['belongsTo'](db[_0xf153('0x184')],{});db['FaxTransferReport'][_0xf153('0x127')](db[_0xf153('0x132')],{});db[_0xf153('0xf9')][_0xf153('0x127')](db[_0xf153('0x4c')],{'foreignKey':_0xf153('0x1e3'),'as':'FromAccount'});db[_0xf153('0xf9')][_0xf153('0x127')](db['User'],{'foreignKey':'FromUserId','as':_0xf153('0x1e0')});db[_0xf153('0xf9')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1da'),'as':_0xf153('0x1db')});db[_0xf153('0xf9')]['belongsTo'](db[_0xf153('0x51')],{'foreignKey':_0xf153('0x1e4'),'as':_0xf153('0x1e2')});db[_0xf153('0xf9')][_0xf153('0x127')](db[_0xf153('0x4c')],{'foreignKey':'ToFaxAccountId','as':_0xf153('0x1dd')});db[_0xf153('0xfb')][_0xf153('0x127')](db[_0xf153('0x60')],{});db[_0xf153('0xfb')][_0xf153('0x127')](db[_0xf153('0x5e')],{});db[_0xf153('0xfb')][_0xf153('0x127')](db[_0xf153('0x190')],{'foreignKey':_0xf153('0x1e5'),'as':'FromAccount'});db[_0xf153('0xfb')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':'FromUserId','as':_0xf153('0x1e0')});db[_0xf153('0xfb')]['belongsTo'](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1da'),'as':_0xf153('0x1db')});db['OpenchannelTransferReport'][_0xf153('0x127')](db[_0xf153('0x62')],{'foreignKey':_0xf153('0x1e6'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xf153('0x127')](db['OpenchannelAccount'],{'foreignKey':_0xf153('0x1e7'),'as':_0xf153('0x1dd')});db[_0xf153('0x1e8')][_0xf153('0x127')](db[_0xf153('0x5a')],{});db[_0xf153('0x1e8')][_0xf153('0x127')](db[_0xf153('0x58')],{});db['SmsTransferReport'][_0xf153('0x127')](db[_0xf153('0x55')],{'foreignKey':_0xf153('0x1e9'),'as':_0xf153('0x1d9')});db[_0xf153('0x1e8')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1df'),'as':_0xf153('0x1e0')});db[_0xf153('0x1e8')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':_0xf153('0x1da'),'as':_0xf153('0x1db')});db['SmsTransferReport'][_0xf153('0x127')](db[_0xf153('0x5c')],{'foreignKey':_0xf153('0x1ea'),'as':_0xf153('0x1e2')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0xf153('0x1eb'),'as':_0xf153('0x1dd')});db[_0xf153('0xfe')]['hasMany'](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':_0xf153('0x181'),'onDelete':'cascade'});db['CmList'][_0xf153('0x11a')](db[_0xf153('0x81')],{'as':_0xf153('0x1ec'),'foreignKey':'ListId'});db[_0xf153('0xfe')][_0xf153('0x11a')](db[_0xf153('0x75')],{'as':'Contacts','onDelete':_0xf153('0x118'),'foreignKey':'ListId'});db[_0xf153('0xfe')]['hasMany'](db[_0xf153('0x7b')],{'as':_0xf153('0x11f'),'foreignKey':'ListId'});db[_0xf153('0xfe')][_0xf153('0x11a')](db['CmHopperHistory'],{'as':_0xf153('0x120'),'foreignKey':_0xf153('0x181')});db[_0xf153('0xfe')][_0xf153('0x11a')](db[_0xf153('0x7f')],{'as':'ReportAgentPreview','foreignKey':_0xf153('0x181')});db['CmList'][_0xf153('0x129')](db['VoiceQueue'],{'as':_0xf153('0x1ed'),'through':_0xf153('0x1ee')});db[_0xf153('0xfe')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x12f')});db[_0xf153('0x100')][_0xf153('0x11a')](db['VoiceExtension'],{'as':_0xf153('0x11e'),'onDelete':'cascade'});db[_0xf153('0x100')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xf153('0x100')][_0xf153('0x129')](db['Team'],{'through':_0xf153('0x114'),'as':_0xf153('0x175')});db[_0xf153('0x102')][_0xf153('0x11a')](db[_0xf153('0x14')],{'as':'Users','foreignKey':_0xf153('0x128')});db[_0xf153('0x102')][_0xf153('0x11a')](db[_0xf153('0x103')],{'as':_0xf153('0x1ef'),'foreignKey':'userProfileId','onDelete':_0xf153('0x118')});db[_0xf153('0x103')][_0xf153('0x11a')](db[_0xf153('0x1f0')],{'as':'Resources','foreignKey':_0xf153('0x1f1'),'onDelete':'cascade'});db[_0xf153('0x107')][_0xf153('0x11a')](db[_0xf153('0x86')],{'as':_0xf153('0x16d'),'foreignKey':_0xf153('0x1f2'),'onDelete':_0xf153('0x118')});db['WhatsappAccount'][_0xf153('0x11a')](db[_0xf153('0x16e')],{'as':_0xf153('0x16f'),'foreignKey':_0xf153('0x1f2')});db[_0xf153('0x107')]['hasMany'](db['WhatsappMessage'],{'as':_0xf153('0x15f'),'foreignKey':'WhatsappAccountId'});db[_0xf153('0x107')][_0xf153('0x11a')](db[_0xf153('0x10a')],{'as':_0xf153('0x170')});db[_0xf153('0x107')][_0xf153('0x11a')](db[_0xf153('0x109')],{'as':_0xf153('0x14e')});db[_0xf153('0x107')][_0xf153('0x127')](db[_0xf153('0xfe')],{'as':'List','foreignKey':_0xf153('0x181')});db[_0xf153('0x107')][_0xf153('0x127')](db[_0xf153('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0xf153('0x15c')});db['WhatsappAccount']['belongsToMany'](db[_0xf153('0x14')],{'as':_0xf153('0x173'),'through':_0xf153('0x149')});db['WhatsappApplication'][_0xf153('0x127')](db[_0xf153('0x14')],{'onDelete':'restrict'});db[_0xf153('0x109')]['belongsTo'](db[_0xf153('0x10f')],{'onDelete':_0xf153('0x17f')});db[_0xf153('0x109')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xf153('0x127')](db[_0xf153('0x8a')],{'onDelete':'restrict','foreignKey':_0xf153('0x15a')});db[_0xf153('0x109')][_0xf153('0x127')](db[_0xf153('0x92')],{'onDelete':'restrict','foreignKey':_0xf153('0x180')});db[_0xf153('0x10a')]['hasMany'](db[_0xf153('0x10c')],{'as':_0xf153('0x15f'),'onDelete':'cascade','foreignKey':_0xf153('0x1f3')});db[_0xf153('0x10a')]['belongsTo'](db[_0xf153('0x107')],{'as':_0xf153('0x17c'),'foreignKey':'WhatsappAccountId'});db[_0xf153('0x10a')]['belongsTo'](db['CmContact'],{'as':_0xf153('0x166'),'foreignKey':'ContactId'});db[_0xf153('0x10a')][_0xf153('0x127')](db[_0xf153('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0xf153('0x10a')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':_0xf153('0x1f4'),'as':_0xf153('0x179')});db[_0xf153('0x10a')][_0xf153('0x129')](db[_0xf153('0x92')],{'through':'whatsapp_interaction_has_tags','as':_0xf153('0x17a')});db[_0xf153('0x10a')][_0xf153('0x129')](db[_0xf153('0x14')],{'as':'Users','through':_0xf153('0x135'),'foreignKey':_0xf153('0x1f3')});db[_0xf153('0x10c')][_0xf153('0x127')](db['User'],{'as':_0xf153('0x14')});db['WhatsappMessage'][_0xf153('0x127')](db[_0xf153('0x75')],{'onDelete':_0xf153('0x118'),'as':'Contact'});db[_0xf153('0x10c')]['belongsTo'](db[_0xf153('0x10a')],{'onDelete':_0xf153('0x118'),'as':_0xf153('0x186'),'foreignKey':'WhatsappInteractionId'});db[_0xf153('0x10c')][_0xf153('0x127')](db[_0xf153('0x107')],{'as':_0xf153('0x17c'),'foreignKey':_0xf153('0x1f2')});db['WhatsappQueueReport'][_0xf153('0x127')](db['WhatsappAccount'],{});db[_0xf153('0x1f5')][_0xf153('0x127')](db['CmList'],{'as':_0xf153('0x172'),'foreignKey':_0xf153('0x181')});db[_0xf153('0x1f5')][_0xf153('0x127')](db[_0xf153('0x75')],{'as':_0xf153('0x166'),'foreignKey':'ContactId'});db[_0xf153('0x1f5')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xf153('0x1f5')][_0xf153('0x127')](db['WhatsappQueue'],{});db[_0xf153('0x1f5')]['belongsTo'](db[_0xf153('0x10c')],{});db[_0xf153('0x1f5')]['belongsTo'](db[_0xf153('0x14')],{});db[_0xf153('0x1f6')][_0xf153('0x127')](db[_0xf153('0x10c')],{});db[_0xf153('0x1f6')][_0xf153('0x127')](db[_0xf153('0x10a')],{});db[_0xf153('0x1f6')][_0xf153('0x127')](db[_0xf153('0x107')],{'foreignKey':_0xf153('0x1f7'),'as':_0xf153('0x1d9')});db[_0xf153('0x1f6')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0xf153('0x1dd')});db[_0xf153('0x1f6')][_0xf153('0x127')](db[_0xf153('0x10f')],{'foreignKey':'ToQueueId','as':_0xf153('0x1e2')});db[_0xf153('0x1f6')][_0xf153('0x127')](db['User'],{'foreignKey':_0xf153('0x1df'),'as':'FromAgent'});db[_0xf153('0x1f6')][_0xf153('0x127')](db[_0xf153('0x14')],{'foreignKey':'ToUserId','as':_0xf153('0x1db')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xf153('0x1f8')});db[_0xf153('0x10f')]['belongsToMany'](db[_0xf153('0xeb')],{'through':'team_has_whatsapp_queues','as':'Teams'});module[_0xf153('0x1f9')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xcb91=['MailApplication','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','cascade','UserId','hasMany','Recordings','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','Groups','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_teams','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefixes','MailQueue','MailQueues','ChatQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','IntervalId','Pause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','MailServerOut','Imap','Dispositions','Answers','Interactions','ListId','TemplateId','mandatoryDispositionPause','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','restrict','TagId','MailQueueReport','List','Items','FaxAccountId','Applications','FaxQueue','fax_interaction_has_tags','FaxInteractionId','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','Queue','ChatQueueId','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','CustomReportId','Mohs','AllConditions','AllCondition','AnyConditions','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','Configurations','AccountId','int_desk_configuration_has_tags','ZohoAccount','ZohoField','ZendeskAccount','ZendeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FreshsalesAccount','ChatQueueReport','FromId','SessionId','ProjectId','VoiceQueues','team_has_mail_queues','FaxQueues','team_has_openchannel_queues','TrunkBackup','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToQueue','ToMailAccountId','ChatTransferReport','FromAgent','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','lodash','jstz','determine','sequelize','motion2','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','database','username','options','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model'];(function(_0x5daa01,_0x1b45a1){var _0x270e3b=function(_0x654064){while(--_0x654064){_0x5daa01['push'](_0x5daa01['shift']());}};_0x270e3b(++_0x1b45a1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x1cb9('0x0'));var jstz=require(_0x1cb9('0x1'));var timezone=jstz[_0x1cb9('0x2')]();config[_0x1cb9('0x3')]=_['defaultsDeep'](config[_0x1cb9('0x3')],{'database':_0x1cb9('0x4'),'username':'xcall','password':_0x1cb9('0x5'),'options':{'host':_0x1cb9('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x1cb9('0x7')},'logging':![],'timezone':timezone[_0x1cb9('0x8')](),'define':{'charset':'utf8','collate':_0x1cb9('0x9')}}});config[_0x1cb9('0xa')]=_['defaultsDeep'](config[_0x1cb9('0xa')],{'database':'motion2','username':'xcall','password':_0x1cb9('0x5'),'options':{'host':_0x1cb9('0x6'),'port':0xcea,'dialect':_0x1cb9('0xb'),'dialectOptions':{'charset':_0x1cb9('0x7')},'logging':![],'timezone':timezone[_0x1cb9('0x8')](),'define':{'charset':'utf8','collate':_0x1cb9('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1cb9('0x3')][_0x1cb9('0xc')],config[_0x1cb9('0x3')][_0x1cb9('0xd')],config['sequelize']['password'],config['sequelize'][_0x1cb9('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1cb9('0xa')][_0x1cb9('0xc')],config[_0x1cb9('0xa')]['username'],config[_0x1cb9('0xa')][_0x1cb9('0xf')],config[_0x1cb9('0xa')][_0x1cb9('0xe')])};db[_0x1cb9('0x10')]=db['sequelize']['import'](_0x1cb9('0x11'));db[_0x1cb9('0x12')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x14'));db[_0x1cb9('0x15')]=db[_0x1cb9('0x3')]['import']('../api/voiceContext/voiceContext.model');db[_0x1cb9('0x16')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x17'));db[_0x1cb9('0x18')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x19'));db[_0x1cb9('0x1a')]=db['sequelize']['import'](_0x1cb9('0x1b'));db[_0x1cb9('0x1c')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x1d'));db[_0x1cb9('0x1e')]=db['sequelize']['import'](_0x1cb9('0x1f'));db['VoiceMailMessage']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x20'));db[_0x1cb9('0x21')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x22'));db[_0x1cb9('0x23')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x24'));db[_0x1cb9('0x25')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x26'));db[_0x1cb9('0x27')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x28'));db['MemberReport']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x29'));db['Trunk']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x2a'));db[_0x1cb9('0x2b')]=db['sequelize'][_0x1cb9('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x1cb9('0x2c')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x1cb9('0x2d')]=db['sequelize'][_0x1cb9('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x1cb9('0x2e')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x2f'));db['UserMailQueue']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x30'));db[_0x1cb9('0x31')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x32'));db[_0x1cb9('0x33')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x34'));db[_0x1cb9('0x35')]=db[_0x1cb9('0x3')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x1cb9('0x36')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x37'));db[_0x1cb9('0x38')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x39'));db['MailServerOut']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x3a'));db['MailAccount']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x3b'));db['MailQueue']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x3c'));db[_0x1cb9('0x3d')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x3e'));db['MailInteraction']=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x3f'));db[_0x1cb9('0x40')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x41'));db[_0x1cb9('0x42')]=db['sequelize'][_0x1cb9('0x13')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x43'));db[_0x1cb9('0x44')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/dashboard/dashboard.model');db[_0x1cb9('0x45')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x46'));db[_0x1cb9('0x47')]=db['sequelize'][_0x1cb9('0x13')]('../api/faxAccount/faxAccount.model');db[_0x1cb9('0x48')]=db[_0x1cb9('0x3')]['import']('../api/faxApplication/faxApplication.model');db[_0x1cb9('0x49')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x4a'));db[_0x1cb9('0x4b')]=db['sequelize'][_0x1cb9('0x13')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x4c'));db[_0x1cb9('0x4d')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x4e'));db[_0x1cb9('0x4f')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x50'));db[_0x1cb9('0x51')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x52'));db[_0x1cb9('0x53')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x54'));db[_0x1cb9('0x55')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/smsMessage/smsMessage.model');db[_0x1cb9('0x56')]=db['sequelize'][_0x1cb9('0x13')]('../api/smsQueue/smsQueue.model');db[_0x1cb9('0x57')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x58'));db['OpenchannelApplication']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x59'));db[_0x1cb9('0x5a')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x5b'));db[_0x1cb9('0x5c')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x5d'));db[_0x1cb9('0x5e')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x5f'));db[_0x1cb9('0x60')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x1cb9('0x61')]=db['sequelize'][_0x1cb9('0x13')]('../api/chatApplication/chatApplication.model');db[_0x1cb9('0x62')]=db['sequelize']['import'](_0x1cb9('0x63'));db[_0x1cb9('0x64')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x65'));db[_0x1cb9('0x66')]=db['sequelize']['import'](_0x1cb9('0x67'));db[_0x1cb9('0x68')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x69'));db[_0x1cb9('0x6a')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x6b'));db[_0x1cb9('0x6c')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x6d'));db[_0x1cb9('0x6e')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x6f'));db[_0x1cb9('0x70')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x71'));db[_0x1cb9('0x72')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x73'));db[_0x1cb9('0x74')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x75'));db[_0x1cb9('0x76')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x77'));db[_0x1cb9('0x78')]=db[_0x1cb9('0x3')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x1cb9('0x79')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x7a'));db[_0x1cb9('0x7b')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x7c'));db['Action']=db['sequelize'][_0x1cb9('0x13')]('../api/action/action.model');db['Automation']=db['sequelize']['import']('../api/automation/automation.model');db[_0x1cb9('0x7d')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x7e'));db[_0x1cb9('0x7f')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x80'));db[_0x1cb9('0x81')]=db['sequelize']['import'](_0x1cb9('0x82'));db[_0x1cb9('0x83')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x84'));db['Pause']=db['sequelize']['import'](_0x1cb9('0x85'));db[_0x1cb9('0x86')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x87'));db['VoiceQueuesLog']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x88'));db[_0x1cb9('0x89')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x8a'));db[_0x1cb9('0x8b')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x8c'));db[_0x1cb9('0x8d')]=db[_0x1cb9('0x3')]['import']('../api/template/template.model');db[_0x1cb9('0x8e')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x8f'));db[_0x1cb9('0x90')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x91'));db['Integration']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/integration/integration.model');db[_0x1cb9('0x92')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/integrationReport/integrationReport.model');db[_0x1cb9('0x93')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x94'));db[_0x1cb9('0x95')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x96'));db[_0x1cb9('0x97')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x98'));db[_0x1cb9('0x99')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x1cb9('0x9a')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x9b'));db['AnalyticTreeReport']=db[_0x1cb9('0x3')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x1cb9('0x9c')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0x9d'));db['SalesforceConfiguration']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x9e'));db[_0x1cb9('0x9f')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xa0'));db[_0x1cb9('0xa1')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xa2'));db['SugarcrmConfiguration']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xa3'));db[_0x1cb9('0xa4')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x1cb9('0xa5')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xa6'));db[_0x1cb9('0xa7')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xa8'));db[_0x1cb9('0xa9')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xaa'));db['ZohoAccount']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x1cb9('0xab')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xac'));db['ZohoField']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xad'));db['ZendeskAccount']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xae'));db[_0x1cb9('0xaf')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xb0'));db['ZendeskField']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xb1'));db[_0x1cb9('0xb2')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x1cb9('0xb3')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xb4'));db[_0x1cb9('0xb5')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xb6'));db['VtigerAccount']=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x1cb9('0xb7')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xb8'));db[_0x1cb9('0xb9')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xba'));db['ServicenowAccount']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xbb'));db['ServicenowConfiguration']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x1cb9('0xbc')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xbd'));db['Dynamics365Account']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0x1cb9('0x3')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xbe'));db[_0x1cb9('0xbf')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xc0'));db[_0x1cb9('0xc1')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xc2'));db[_0x1cb9('0xc3')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xc4'));db['ChatQueueReport']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xc5'));db['ChatInternalMessage']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xc6'));db[_0x1cb9('0xc7')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xc8'));db[_0x1cb9('0xc9')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xca'));db[_0x1cb9('0xcb')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xcc'));db[_0x1cb9('0xcd')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xce'));db[_0x1cb9('0xcf')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xd0'));db[_0x1cb9('0xd1')]=db['sequelize']['import'](_0x1cb9('0xd2'));db[_0x1cb9('0xd3')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xd4'));db[_0x1cb9('0xd5')]=db[_0x1cb9('0x3')]['import']('../api/setting/setting.model');db[_0x1cb9('0xd6')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xd7'));db[_0x1cb9('0xd8')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xd9'));db[_0x1cb9('0xda')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xdb'));db[_0x1cb9('0xdc')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xdd'));db[_0x1cb9('0xde')]=db['sequelize']['import']('../api/team/team.model');db[_0x1cb9('0xdf')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/license/license.model');db[_0x1cb9('0xe0')]=db['sequelize']['import'](_0x1cb9('0xe1'));db[_0x1cb9('0xe2')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xe3'));db[_0x1cb9('0xe4')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xe5'));db[_0x1cb9('0xe6')]=db['sequelize']['import'](_0x1cb9('0xe7'));db[_0x1cb9('0xe8')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x1cb9('0xe9')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xea'));db[_0x1cb9('0xeb')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xec'));db[_0x1cb9('0xed')]=db[_0x1cb9('0x3')]['import'](_0x1cb9('0xee'));db[_0x1cb9('0xef')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x1cb9('0xf0')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xf1'));db[_0x1cb9('0xf2')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xf3'));db['UserProfileSection']=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xf4'));db[_0x1cb9('0xf5')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xf6'));db[_0x1cb9('0xf7')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xf8'));db[_0x1cb9('0xf9')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0xfa'));db['WhatsappApplication']=db['sequelize']['import'](_0x1cb9('0xfb'));db[_0x1cb9('0xfc')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xfd'));db[_0x1cb9('0xfe')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0xff'));db[_0x1cb9('0x100')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x1cb9('0x101')]=db['sequelize']['import'](_0x1cb9('0x102'));db[_0x1cb9('0x103')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x104'));db[_0x1cb9('0x105')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x1cb9('0x106')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')](_0x1cb9('0x107'));db[_0x1cb9('0x108')]=db['sequelize'][_0x1cb9('0x13')](_0x1cb9('0x109'));db[_0x1cb9('0x10a')]=db[_0x1cb9('0x3')][_0x1cb9('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x1cb9('0x10')][_0x1cb9('0x10b')](db[_0x1cb9('0x1e')],{'as':'VoiceMail','onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0x1a')],{'as':_0x1cb9('0x10f'),'foreignKey':'UserId'});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')]['hasMany'](db['VoiceExtension'],{'as':_0x1cb9('0x110'),'onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0x76')],{'as':'HopperFinals','foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0x78')],{'as':_0x1cb9('0x111'),'foreignKey':'UserId'});db['User'][_0x1cb9('0x10e')](db[_0x1cb9('0x79')],{'as':_0x1cb9('0x79'),'foreignKey':'UserId'});db['User'][_0x1cb9('0x10e')](db[_0x1cb9('0x5a')],{'as':_0x1cb9('0x112'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x1cb9('0x62')],{'as':_0x1cb9('0x113'),'foreignKey':_0x1cb9('0x10d')});db['User'][_0x1cb9('0x10e')](db['SmsInteraction'],{'as':_0x1cb9('0x114'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0x49')],{'as':'FaxInteractions','foreignKey':_0x1cb9('0x10d')});db['User'][_0x1cb9('0x10e')](db[_0x1cb9('0x115')],{'as':_0x1cb9('0x116'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')]['hasMany'](db[_0x1cb9('0xfc')],{'as':_0x1cb9('0x117'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x10')][_0x1cb9('0x10e')](db[_0x1cb9('0xf7')],{'as':_0x1cb9('0x118'),'foreignKey':'SenderId'});db['User'][_0x1cb9('0x119')](db[_0x1cb9('0xf2')],{'as':_0x1cb9('0xf2'),'foreignKey':_0x1cb9('0x11a')});db[_0x1cb9('0x10')]['belongsToMany'](db[_0x1cb9('0x6a')],{'as':_0x1cb9('0x11b'),'through':'chat_group_has_users'});db['User'][_0x1cb9('0x11c')](db['CmContact'],{'as':_0x1cb9('0x11d'),'through':'cm_user_has_contacts'});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x11e'),'through':_0x1cb9('0x11f')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':_0x1cb9('0x120')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x115')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User']['belongsToMany'](db[_0x1cb9('0x62')],{'as':_0x1cb9('0x113'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x1cb9('0x49')],{'as':_0x1cb9('0x121'),'through':_0x1cb9('0x122')});db[_0x1cb9('0x10')]['belongsToMany'](db[_0x1cb9('0x53')],{'as':_0x1cb9('0x114'),'through':_0x1cb9('0x123')});db['User'][_0x1cb9('0x11c')](db[_0x1cb9('0x5a')],{'as':'OpenchannelInteractions','through':_0x1cb9('0x124')});db['User'][_0x1cb9('0x11c')](db[_0x1cb9('0xfc')],{'as':_0x1cb9('0x117'),'through':_0x1cb9('0x125')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x126')],{'as':'VoiceQueues','through':_0x1cb9('0x2d'),'required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xf0')],{'as':_0x1cb9('0x127'),'through':_0x1cb9('0x10a'),'required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x128')],{'as':_0x1cb9('0x129'),'through':'UserMailQueue','required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x68')],{'as':_0x1cb9('0x12a'),'through':_0x1cb9('0x2e'),'required':![],'hooks':!![]});db['User'][_0x1cb9('0x11c')](db['FaxQueue'],{'as':'FaxQueues','through':_0x1cb9('0x31'),'required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x56')],{'as':_0x1cb9('0x12b'),'through':_0x1cb9('0x33'),'required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x12c')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x103')],{'as':_0x1cb9('0x12d'),'through':_0x1cb9('0x36'),'required':![]});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xef')],{'through':_0x1cb9('0x11f')});db[_0x1cb9('0x10')]['belongsToMany'](db[_0x1cb9('0x5e')],{'as':_0x1cb9('0x12e'),'through':_0x1cb9('0x12f')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x47')],{'as':'FaxAccounts','through':_0x1cb9('0x130')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x131')],{'as':_0x1cb9('0x132'),'through':_0x1cb9('0x133')});db[_0x1cb9('0x10')]['belongsToMany'](db[_0x1cb9('0x57')],{'as':_0x1cb9('0x134'),'through':_0x1cb9('0x135')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0x4f')],{'as':_0x1cb9('0x136'),'through':_0x1cb9('0x137')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xf9')],{'as':_0x1cb9('0x138'),'through':_0x1cb9('0x139')});db[_0x1cb9('0x10')][_0x1cb9('0x11c')](db[_0x1cb9('0xd8')],{'as':_0x1cb9('0x13a'),'through':_0x1cb9('0x13b')});db[_0x1cb9('0x12')][_0x1cb9('0x10e')](db[_0x1cb9('0x16')],{'as':_0x1cb9('0x13c'),'onDelete':'cascade','foreignKey':_0x1cb9('0x13d')});db[_0x1cb9('0x15')][_0x1cb9('0x10e')](db[_0x1cb9('0x16')],{'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x16')]['hasMany'](db[_0x1cb9('0x16')],{'as':'Applications','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x18')][_0x1cb9('0x11c')](db['Sound'],{'as':_0x1cb9('0x13e'),'through':_0x1cb9('0x13f')});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db['UserVoiceQueueRt'],{'as':_0x1cb9('0x140'),'foreignKey':_0x1cb9('0x141')});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db['CmHopper'],{'as':_0x1cb9('0x142'),'foreignKey':_0x1cb9('0x141')});db['VoiceQueue'][_0x1cb9('0x10e')](db[_0x1cb9('0x76')],{'as':_0x1cb9('0x143'),'foreignKey':_0x1cb9('0x141')});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db[_0x1cb9('0x78')],{'as':_0x1cb9('0x144'),'foreignKey':_0x1cb9('0x141')});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db['ReportAgentPreview'],{'as':_0x1cb9('0x79'),'foreignKey':'VoiceQueueId'});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db[_0x1cb9('0x74')],{'as':_0x1cb9('0x145'),'foreignKey':_0x1cb9('0x141')});db[_0x1cb9('0x126')][_0x1cb9('0x10e')](db[_0x1cb9('0xcb')],{'as':_0x1cb9('0x146'),'foreignKey':_0x1cb9('0x141')});db[_0x1cb9('0x126')][_0x1cb9('0x119')](db[_0x1cb9('0x147')],{'as':'Trunk','foreignKey':_0x1cb9('0x148')});db[_0x1cb9('0x126')][_0x1cb9('0x119')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x1cb9('0x126')][_0x1cb9('0x119')](db['Interval'],{'as':_0x1cb9('0x83'),'foreignKey':_0x1cb9('0x149')});db[_0x1cb9('0x126')][_0x1cb9('0x119')](db[_0x1cb9('0x14a')],{'as':'mandatoryDispositionPause','foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0x126')][_0x1cb9('0x11c')](db[_0x1cb9('0xef')],{'as':'Lists','through':_0x1cb9('0x14c')});db[_0x1cb9('0x126')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x2d')});db['VoiceQueue'][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'as':_0x1cb9('0x14e'),'through':_0x1cb9('0x106')});db[_0x1cb9('0x126')][_0x1cb9('0x11c')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x14f'),'through':_0x1cb9('0x150')});db[_0x1cb9('0x1a')][_0x1cb9('0x119')](db['User'],{'as':_0x1cb9('0x10'),'foreignKey':_0x1cb9('0x10d')});db['ScreenRecording'][_0x1cb9('0x119')](db['User'],{'as':_0x1cb9('0x10'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x1e')][_0x1cb9('0x10e')](db[_0x1cb9('0x151')],{'as':_0x1cb9('0x152'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x153'),'sourceKey':_0x1cb9('0x154')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0x1cb9('0x153'),'targetKey':_0x1cb9('0x154')});db[_0x1cb9('0x21')]['hasMany'](db[_0x1cb9('0x27')],{'as':_0x1cb9('0x155'),'foreignKey':_0x1cb9('0x156'),'constraints':![]});db[_0x1cb9('0x21')]['hasMany'](db['VoiceAgentReport'],{'as':_0x1cb9('0x157'),'foreignKey':_0x1cb9('0x156'),'constraints':![]});db['VoiceCallReport'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'as':'User','foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x21')][_0x1cb9('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x38')]['belongsTo'](db[_0x1cb9('0x131')],{'as':_0x1cb9('0x131'),'foreignKey':_0x1cb9('0x159')});db[_0x1cb9('0x15a')]['belongsTo'](db[_0x1cb9('0x131')],{'as':_0x1cb9('0x131'),'foreignKey':_0x1cb9('0x159')});db[_0x1cb9('0x131')][_0x1cb9('0x10b')](db['MailServerIn'],{'as':_0x1cb9('0x15b'),'onDelete':'cascade'});db[_0x1cb9('0x131')]['hasOne'](db[_0x1cb9('0x15a')],{'as':'Smtp','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x131')][_0x1cb9('0x10e')](db[_0x1cb9('0x7f')],{'as':_0x1cb9('0x15c'),'foreignKey':_0x1cb9('0x159'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x131')]['hasMany'](db[_0x1cb9('0x7d')],{'as':_0x1cb9('0x15d'),'foreignKey':_0x1cb9('0x159')});db[_0x1cb9('0x131')][_0x1cb9('0x10e')](db[_0x1cb9('0x40')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x1cb9('0x131')][_0x1cb9('0x10e')](db[_0x1cb9('0x115')],{'as':_0x1cb9('0x15e')});db[_0x1cb9('0x131')][_0x1cb9('0x10e')](db['MailApplication'],{'as':'Applications'});db[_0x1cb9('0x131')][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':'List','foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x131')][_0x1cb9('0x119')](db['Template'],{'as':_0x1cb9('0x8d'),'foreignKey':_0x1cb9('0x160')});db[_0x1cb9('0x131')][_0x1cb9('0x119')](db[_0x1cb9('0x14a')],{'as':_0x1cb9('0x161'),'foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0x131')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x133')});db['MailQueue'][_0x1cb9('0x11c')](db['User'],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':'team_has_mail_queues','as':_0x1cb9('0x14e')});db['MailInteraction'][_0x1cb9('0x10e')](db[_0x1cb9('0x40')],{'as':_0x1cb9('0x152'),'onDelete':'cascade','foreignKey':_0x1cb9('0x162')});db[_0x1cb9('0x115')][_0x1cb9('0x119')](db[_0x1cb9('0x131')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x159')});db[_0x1cb9('0x115')][_0x1cb9('0x119')](db['CmContact'],{'as':_0x1cb9('0x164'),'foreignKey':'ContactId'});db[_0x1cb9('0x115')]['belongsTo'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x165'),'foreignKey':_0x1cb9('0x10d')});db['MailInteraction'][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x166'),'as':_0x1cb9('0x167')});db[_0x1cb9('0x115')]['belongsToMany'](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x166'),'as':_0x1cb9('0x168')});db['MailInteraction'][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x16a'),'foreignKey':'MailInteractionId'});db[_0x1cb9('0x40')]['hasMany'](db['Attachment'],{'as':_0x1cb9('0x16b'),'onDelete':'cascade'});db[_0x1cb9('0x40')]['belongsTo'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x10')});db['MailMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x164')});db[_0x1cb9('0x40')][_0x1cb9('0x119')](db['MailInteraction'],{'as':_0x1cb9('0x16c'),'foreignKey':_0x1cb9('0x162')});db[_0x1cb9('0x40')][_0x1cb9('0x119')](db[_0x1cb9('0x131')],{'as':_0x1cb9('0x163'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'as':_0x1cb9('0x5e'),'foreignKey':_0x1cb9('0x16d')});db['MailMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x66')],{'as':_0x1cb9('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x1cb9('0x42')][_0x1cb9('0x119')](db['User'],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x42')]['belongsTo'](db[_0x1cb9('0x128')],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x42')][_0x1cb9('0x119')](db[_0x1cb9('0x131')],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x42')]['belongsTo'](db[_0x1cb9('0x83')],{'onDelete':'restrict','foreignKey':_0x1cb9('0x149')});db[_0x1cb9('0x42')][_0x1cb9('0x119')](db[_0x1cb9('0x8b')],{'onDelete':'restrict','foreignKey':_0x1cb9('0x16f')});db[_0x1cb9('0x170')][_0x1cb9('0x119')](db['MailAccount'],{});db[_0x1cb9('0x170')]['belongsTo'](db['CmList'],{'as':_0x1cb9('0x171'),'foreignKey':'ListId'});db[_0x1cb9('0x170')]['belongsTo'](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x170')][_0x1cb9('0x119')](db[_0x1cb9('0x115')],{});db[_0x1cb9('0x170')][_0x1cb9('0x119')](db[_0x1cb9('0x40')],{});db[_0x1cb9('0x170')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{});db[_0x1cb9('0x170')]['belongsTo'](db[_0x1cb9('0x128')],{});db[_0x1cb9('0x44')]['hasMany'](db['DashboardItem'],{'as':_0x1cb9('0x172'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x47')]['hasMany'](db[_0x1cb9('0x7f')],{'as':_0x1cb9('0x15c'),'foreignKey':'FaxAccountId','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x47')][_0x1cb9('0x10e')](db[_0x1cb9('0x7d')],{'as':_0x1cb9('0x15d'),'foreignKey':_0x1cb9('0x173')});db['FaxAccount'][_0x1cb9('0x10e')](db['FaxInteraction'],{'as':_0x1cb9('0x15e')});db['FaxAccount'][_0x1cb9('0x10e')](db[_0x1cb9('0x48')],{'as':_0x1cb9('0x174')});db[_0x1cb9('0x47')][_0x1cb9('0x10e')](db[_0x1cb9('0x16')],{'as':'Exntensions','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x47')][_0x1cb9('0x10e')](db['FaxMessage'],{'as':'Messages'});db[_0x1cb9('0x47')]['belongsTo'](db[_0x1cb9('0x147')],{'as':_0x1cb9('0x147')});db['FaxAccount'][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x47')][_0x1cb9('0x119')](db[_0x1cb9('0x14a')],{'as':_0x1cb9('0x161'),'foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0x47')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x130')});db[_0x1cb9('0x48')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':_0x1cb9('0x16e')});db['FaxApplication'][_0x1cb9('0x119')](db[_0x1cb9('0x175')],{'onDelete':'restrict'});db[_0x1cb9('0x48')][_0x1cb9('0x119')](db[_0x1cb9('0x47')],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x48')][_0x1cb9('0x119')](db['Tag'],{'onDelete':_0x1cb9('0x16e'),'foreignKey':_0x1cb9('0x16f')});db['FaxInteraction'][_0x1cb9('0x10e')](db[_0x1cb9('0x4b')],{'as':_0x1cb9('0x152'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x1cb9('0x49')][_0x1cb9('0x119')](db[_0x1cb9('0x47')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x173')});db[_0x1cb9('0x49')][_0x1cb9('0x119')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x1cb9('0x49')]['belongsTo'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x165'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x49')][_0x1cb9('0x11c')](db['Tag'],{'through':_0x1cb9('0x176'),'as':'Tags'});db['FaxInteraction'][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x176'),'as':'ThroughTags'});db[_0x1cb9('0x49')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x122'),'foreignKey':_0x1cb9('0x177')});db[_0x1cb9('0x4b')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x10')});db[_0x1cb9('0x4b')][_0x1cb9('0x119')](db[_0x1cb9('0x49')],{'as':_0x1cb9('0x16c'),'foreignKey':'FaxInteractionId'});db[_0x1cb9('0x4b')]['belongsTo'](db['CmContact'],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x164')});db[_0x1cb9('0x4b')][_0x1cb9('0x119')](db[_0x1cb9('0xe4')],{'as':_0x1cb9('0xe4'),'foreignKey':_0x1cb9('0x178')});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x173')});db['FaxQueue']['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x31')});db['FaxQueue'][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':'team_has_fax_queues','as':_0x1cb9('0x14e')});db[_0x1cb9('0x4d')][_0x1cb9('0x119')](db[_0x1cb9('0x47')],{});db[_0x1cb9('0x4d')][_0x1cb9('0x119')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x1cb9('0x4d')]['belongsTo'](db['CmContact'],{'as':_0x1cb9('0x164'),'foreignKey':'ContactId'});db[_0x1cb9('0x4d')]['belongsTo'](db[_0x1cb9('0x49')],{});db['FaxQueueReport'][_0x1cb9('0x119')](db['FaxMessage'],{});db[_0x1cb9('0x4d')][_0x1cb9('0x119')](db['User'],{});db[_0x1cb9('0x4d')][_0x1cb9('0x119')](db[_0x1cb9('0x175')],{});db[_0x1cb9('0x4f')][_0x1cb9('0x10e')](db['Disposition'],{'as':_0x1cb9('0x15c'),'foreignKey':'SmsAccountId','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x4f')][_0x1cb9('0x10e')](db[_0x1cb9('0x7d')],{'as':_0x1cb9('0x15d'),'foreignKey':_0x1cb9('0x179')});db[_0x1cb9('0x4f')][_0x1cb9('0x10e')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x1cb9('0x4f')][_0x1cb9('0x10e')](db[_0x1cb9('0x53')],{'as':_0x1cb9('0x15e')});db[_0x1cb9('0x4f')][_0x1cb9('0x10e')](db[_0x1cb9('0x51')],{'as':_0x1cb9('0x174')});db[_0x1cb9('0x4f')]['belongsTo'](db['CmList'],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x4f')][_0x1cb9('0x119')](db[_0x1cb9('0x14a')],{'as':_0x1cb9('0x161'),'foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0x4f')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x137')});db[_0x1cb9('0x51')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':'restrict'});db[_0x1cb9('0x51')][_0x1cb9('0x119')](db[_0x1cb9('0x56')],{'onDelete':_0x1cb9('0x16e')});db['SmsApplication'][_0x1cb9('0x119')](db[_0x1cb9('0x4f')],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x51')][_0x1cb9('0x119')](db[_0x1cb9('0x83')],{'onDelete':_0x1cb9('0x16e'),'foreignKey':_0x1cb9('0x149')});db['SmsApplication']['belongsTo'](db['Tag'],{'onDelete':_0x1cb9('0x16e'),'foreignKey':'TagId'});db['SmsInteraction'][_0x1cb9('0x10e')](db[_0x1cb9('0x55')],{'as':'Messages','onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x17a')});db['SmsInteraction'][_0x1cb9('0x119')](db[_0x1cb9('0x4f')],{'as':'Account','foreignKey':_0x1cb9('0x179')});db[_0x1cb9('0x53')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db['SmsInteraction']['belongsTo'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x165'),'foreignKey':'UserId'});db[_0x1cb9('0x53')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x1cb9('0x53')][_0x1cb9('0x11c')](db['Tag'],{'through':_0x1cb9('0x17b'),'as':_0x1cb9('0x168')});db[_0x1cb9('0x53')]['belongsToMany'](db['User'],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x123'),'foreignKey':_0x1cb9('0x17a')});db[_0x1cb9('0x55')]['belongsTo'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x10')});db[_0x1cb9('0x55')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x1cb9('0x55')][_0x1cb9('0x119')](db[_0x1cb9('0x53')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x16c'),'foreignKey':_0x1cb9('0x17a')});db['SmsMessage'][_0x1cb9('0x119')](db['SmsAccount'],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x179')});db['SmsQueue']['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':'UserSmsQueue','foreignKey':_0x1cb9('0x17c')});db[_0x1cb9('0x56')][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':_0x1cb9('0x17d'),'as':_0x1cb9('0x14e')});db[_0x1cb9('0x57')][_0x1cb9('0x10e')](db[_0x1cb9('0x7f')],{'as':_0x1cb9('0x15c'),'foreignKey':_0x1cb9('0x17e'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x57')]['hasMany'](db[_0x1cb9('0x7d')],{'as':_0x1cb9('0x15d'),'foreignKey':_0x1cb9('0x17e')});db[_0x1cb9('0x57')][_0x1cb9('0x10e')](db[_0x1cb9('0x5a')],{'as':'Interactions','foreignKey':_0x1cb9('0x17e')});db[_0x1cb9('0x57')]['hasMany'](db[_0x1cb9('0x5c')],{'as':_0x1cb9('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0x1cb9('0x57')][_0x1cb9('0x10e')](db[_0x1cb9('0x17f')],{'as':_0x1cb9('0x174'),'foreignKey':_0x1cb9('0x17e')});db[_0x1cb9('0x57')]['belongsTo'](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db['OpenchannelAccount'][_0x1cb9('0x119')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0x57')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x135')});db[_0x1cb9('0x17f')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x17f')][_0x1cb9('0x119')](db['OpenchannelQueue'],{'onDelete':_0x1cb9('0x16e'),'foreignKey':_0x1cb9('0x180')});db[_0x1cb9('0x17f')]['belongsTo'](db[_0x1cb9('0x57')],{'onDelete':'restrict','foreignKey':_0x1cb9('0x17e')});db[_0x1cb9('0x17f')][_0x1cb9('0x119')](db[_0x1cb9('0x83')],{'onDelete':_0x1cb9('0x16e'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db['Tag'],{'onDelete':_0x1cb9('0x16e'),'foreignKey':'TagId'});db[_0x1cb9('0x5a')]['hasMany'](db[_0x1cb9('0x5c')],{'as':_0x1cb9('0x152'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x181')});db[_0x1cb9('0x5a')][_0x1cb9('0x119')](db[_0x1cb9('0x57')],{'as':_0x1cb9('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x1cb9('0x5a')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db['OpenchannelInteraction']['belongsTo'](db[_0x1cb9('0x10')],{'as':'Owner','foreignKey':'UserId'});db['OpenchannelInteraction'][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x182'),'as':_0x1cb9('0x167')});db[_0x1cb9('0x5a')]['belongsToMany'](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x182'),'as':'ThroughTags'});db[_0x1cb9('0x5a')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x124'),'foreignKey':_0x1cb9('0x181')});db[_0x1cb9('0x5c')]['belongsTo'](db[_0x1cb9('0x10')],{'onDelete':'cascade','as':'User'});db[_0x1cb9('0x5c')]['belongsTo'](db[_0x1cb9('0x70')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x164')});db['OpenchannelMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x5a')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x16c'),'foreignKey':_0x1cb9('0x181')});db[_0x1cb9('0x5c')]['belongsTo'](db[_0x1cb9('0xe4')],{'as':_0x1cb9('0xe4'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x57')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x17e')});db[_0x1cb9('0x12c')]['belongsToMany'](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x35'),'foreignKey':_0x1cb9('0x180')});db[_0x1cb9('0x12c')][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':'team_has_openchannel_queues','as':_0x1cb9('0x14e')});db['ChatWebsite'][_0x1cb9('0x10e')](db['Disposition'],{'as':_0x1cb9('0x15c'),'foreignKey':_0x1cb9('0x16d'),'onDelete':'cascade'});db[_0x1cb9('0x5e')]['hasMany'](db[_0x1cb9('0x7d')],{'as':_0x1cb9('0x15d'),'foreignKey':'ChatWebsiteId'});db[_0x1cb9('0x5e')][_0x1cb9('0x10e')](db[_0x1cb9('0x6c')],{'as':_0x1cb9('0x183')});db['ChatWebsite']['hasMany'](db[_0x1cb9('0x62')],{'as':_0x1cb9('0x15e')});db[_0x1cb9('0x5e')][_0x1cb9('0x10e')](db['ChatApplication'],{'as':_0x1cb9('0x174')});db[_0x1cb9('0x5e')]['hasMany'](db[_0x1cb9('0x64')],{'as':_0x1cb9('0x152')});db[_0x1cb9('0x5e')]['belongsTo'](db[_0x1cb9('0xef')],{'as':'List','foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x5e')]['belongsTo'](db[_0x1cb9('0x83')],{'as':_0x1cb9('0x83'),'foreignKey':_0x1cb9('0x149')});db['ChatWebsite'][_0x1cb9('0x119')](db[_0x1cb9('0x131')],{'as':'MailAccount','foreignKey':_0x1cb9('0x159')});db[_0x1cb9('0x5e')][_0x1cb9('0x119')](db[_0x1cb9('0x14a')],{'as':'mandatoryDispositionPause','foreignKey':_0x1cb9('0x14b')});db['ChatWebsite']['belongsToMany'](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x12f')});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db['OpenchannelAccount'],{});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db['OpenchannelInteraction'],{});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db[_0x1cb9('0x5c')],{});db[_0x1cb9('0x60')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{});db['OpenchannelQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0x12c')],{});db[_0x1cb9('0x61')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'as':'Agent','foreignKey':_0x1cb9('0x10d'),'onDelete':'restrict'});db[_0x1cb9('0x61')][_0x1cb9('0x119')](db[_0x1cb9('0x68')],{'as':_0x1cb9('0x184'),'foreignKey':_0x1cb9('0x185'),'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x61')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x61')][_0x1cb9('0x119')](db[_0x1cb9('0x8b')],{'onDelete':_0x1cb9('0x16e'),'foreignKey':_0x1cb9('0x16f')});db[_0x1cb9('0x62')]['hasMany'](db[_0x1cb9('0x64')],{'as':'Messages','onDelete':_0x1cb9('0x10c'),'foreignKey':'ChatInteractionId'});db[_0x1cb9('0x62')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x1cb9('0x62')]['belongsTo'](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x62')][_0x1cb9('0x119')](db['User'],{'as':_0x1cb9('0x165'),'foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0x62')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x186'),'as':_0x1cb9('0x167')});db['ChatInteraction'][_0x1cb9('0x11c')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x1cb9('0x168')});db[_0x1cb9('0x62')]['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x187'),'foreignKey':_0x1cb9('0x188')});db[_0x1cb9('0x64')][_0x1cb9('0x119')](db['User'],{'onDelete':_0x1cb9('0x10c'),'as':'User'});db[_0x1cb9('0x64')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x1cb9('0x158')});db['ChatMessage']['belongsTo'](db[_0x1cb9('0x62')],{'onDelete':_0x1cb9('0x10c'),'as':'Interaction','foreignKey':_0x1cb9('0x188')});db[_0x1cb9('0x64')][_0x1cb9('0x119')](db[_0x1cb9('0xe4')],{'as':_0x1cb9('0xe4'),'foreignKey':'AttachmentId'});db[_0x1cb9('0x64')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'as':_0x1cb9('0x163'),'foreignKey':'ChatWebsiteId'});db[_0x1cb9('0x66')][_0x1cb9('0x10e')](db['Attachment'],{'as':_0x1cb9('0x16b'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x66')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'onDelete':'cascade','as':_0x1cb9('0x164'),'foreignKey':'ContactId'});db[_0x1cb9('0x66')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x16d')});db[_0x1cb9('0x68')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x2e'),'hooks':!![]});db[_0x1cb9('0x68')][_0x1cb9('0x11c')](db['Team'],{'through':_0x1cb9('0x189'),'as':_0x1cb9('0x14e')});db[_0x1cb9('0x6a')][_0x1cb9('0x10e')](db[_0x1cb9('0x18a')],{'as':_0x1cb9('0x152'),'foreignKey':_0x1cb9('0x18b'),'onDelete':_0x1cb9('0x10c')});db['ChatGroup'][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x140'),'through':'chat_group_has_users'});db[_0x1cb9('0x6c')]['belongsTo'](db[_0x1cb9('0x5e')],{'as':_0x1cb9('0x18c'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x1cb9('0x10e')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x11d'),'foreignKey':_0x1cb9('0x18d')});db[_0x1cb9('0x70')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x70')][_0x1cb9('0x10e')](db[_0x1cb9('0x76')],{'as':_0x1cb9('0x143'),'foreignKey':_0x1cb9('0x158')});db['CmContact']['hasMany'](db[_0x1cb9('0x78')],{'as':_0x1cb9('0x144'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x70')]['hasMany'](db[_0x1cb9('0x79')],{'as':_0x1cb9('0x79'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x70')][_0x1cb9('0x10e')](db[_0x1cb9('0xcb')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0x1cb9('0x10e')](db[_0x1cb9('0x5a')],{'as':'OpenchannelInteractions','foreignKey':_0x1cb9('0x158'),'onDelete':'restrict'});db[_0x1cb9('0x70')][_0x1cb9('0x10e')](db[_0x1cb9('0x62')],{'as':_0x1cb9('0x113'),'foreignKey':_0x1cb9('0x158'),'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x70')][_0x1cb9('0x10e')](db[_0x1cb9('0x53')],{'as':_0x1cb9('0x114'),'foreignKey':_0x1cb9('0x158'),'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x70')][_0x1cb9('0x10e')](db['FaxInteraction'],{'as':_0x1cb9('0x121'),'foreignKey':_0x1cb9('0x158'),'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x70')]['hasMany'](db[_0x1cb9('0x115')],{'as':_0x1cb9('0x116'),'foreignKey':_0x1cb9('0x158'),'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x70')]['belongsTo'](db[_0x1cb9('0x6e')],{'as':_0x1cb9('0x18e'),'foreignKey':_0x1cb9('0x18d')});db[_0x1cb9('0x70')][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':'ListId','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x70')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':'cm_user_has_contacts'});db[_0x1cb9('0x70')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'as':_0x1cb9('0x167'),'through':_0x1cb9('0x18f')});db[_0x1cb9('0x70')]['belongsToMany'](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x18f'),'as':'ThroughTags'});db[_0x1cb9('0x72')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x72')][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':'ListId','onDelete':_0x1cb9('0x10c')});db['CmHopper'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'as':'Agent','foreignKey':_0x1cb9('0x10d')});db['CmHopper'][_0x1cb9('0x119')](db[_0x1cb9('0x126')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x1cb9('0x10c')});db['CmHopper'][_0x1cb9('0x119')](db[_0x1cb9('0xe0')],{'as':_0x1cb9('0xe0'),'foreignKey':_0x1cb9('0x190'),'onDelete':_0x1cb9('0x10c')});db['CmHopper'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x165'),'foreignKey':_0x1cb9('0x191')});db[_0x1cb9('0x74')][_0x1cb9('0x119')](db['CmContact'],{'as':_0x1cb9('0x164'),'foreignKey':'ContactId','onDelete':_0x1cb9('0x10c')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1cb9('0x15f'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x74')][_0x1cb9('0x119')](db[_0x1cb9('0x126')],{'as':_0x1cb9('0x184'),'foreignKey':_0x1cb9('0x141'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x74')]['belongsTo'](db[_0x1cb9('0xe0')],{'as':_0x1cb9('0xe0'),'foreignKey':_0x1cb9('0x190'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x192')][_0x1cb9('0x10e')](db[_0x1cb9('0x81')],{'as':{'plural':_0x1cb9('0x193'),'singular':'OneAll'},'foreignKey':_0x1cb9('0x194'),'onDelete':_0x1cb9('0x10c'),'hooks':!![]});db['Automation'][_0x1cb9('0x10e')](db[_0x1cb9('0x81')],{'as':{'plural':_0x1cb9('0x195'),'singular':_0x1cb9('0x196')},'foreignKey':'AutomationAnyId','onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x192')][_0x1cb9('0x10e')](db[_0x1cb9('0x197')],{'as':_0x1cb9('0x198'),'foreignKey':_0x1cb9('0x199'),'onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x7f')][_0x1cb9('0x10e')](db[_0x1cb9('0x7f')],{'as':_0x1cb9('0x15c'),'foreignKey':_0x1cb9('0x19a'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x83')]['hasMany'](db[_0x1cb9('0x83')],{'as':_0x1cb9('0x19b'),'foreignKey':_0x1cb9('0x149'),'onDelete':_0x1cb9('0x10c'),'hooks':!![],'required':![]});db[_0x1cb9('0x83')]['hasMany'](db[_0x1cb9('0x16')],{'as':_0x1cb9('0x110'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0x1cb9('0x10e')](db['MailApplication'],{'as':_0x1cb9('0x19c'),'foreignKey':'IntervalId'});db[_0x1cb9('0x83')]['hasMany'](db[_0x1cb9('0x61')],{'as':_0x1cb9('0x19d'),'foreignKey':'IntervalId'});db[_0x1cb9('0x83')]['hasMany'](db[_0x1cb9('0x48')],{'as':_0x1cb9('0x19e'),'foreignKey':'IntervalId'});db['Interval'][_0x1cb9('0x10e')](db[_0x1cb9('0x51')],{'as':'SmsApplications','foreignKey':_0x1cb9('0x149')});db[_0x1cb9('0x19f')]['belongsTo'](db['MailAccount'],{});db[_0x1cb9('0x19f')]['belongsTo'](db[_0x1cb9('0x95')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x1cb9('0x119')](db[_0x1cb9('0x93')],{'foreignKey':_0x1cb9('0x1a0')});db[_0x1cb9('0x89')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x1cb9('0x1a1'),'through':'moh_has_sounds','onDelete':_0x1cb9('0x16e')});db['Tag']['belongsToMany'](db['CmContact'],{'through':_0x1cb9('0x18f')});db[_0x1cb9('0x8b')][_0x1cb9('0x11c')](db['ChatInteraction'],{'through':_0x1cb9('0x186')});db['Tag'][_0x1cb9('0x11c')](db[_0x1cb9('0x115')],{'through':'mail_interaction_has_tags'});db[_0x1cb9('0x8b')]['belongsToMany'](db[_0x1cb9('0x53')],{'through':_0x1cb9('0x17b')});db[_0x1cb9('0x8b')]['belongsToMany'](db[_0x1cb9('0x49')],{'through':_0x1cb9('0x176')});db[_0x1cb9('0x8b')][_0x1cb9('0x11c')](db[_0x1cb9('0x5a')],{'through':_0x1cb9('0x182')});db[_0x1cb9('0x8b')][_0x1cb9('0x11c')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x1cb9('0x8e')][_0x1cb9('0x10e')](db[_0x1cb9('0x81')],{'as':{'plural':_0x1cb9('0x1a2'),'singular':_0x1cb9('0x1a3')},'foreignKey':'TriggerAllId','onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x8e')]['hasMany'](db[_0x1cb9('0x81')],{'as':{'plural':_0x1cb9('0x1a4'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x1cb9('0x10c'),'hooks':!![]});db[_0x1cb9('0x8e')][_0x1cb9('0x10e')](db[_0x1cb9('0x197')],{'as':_0x1cb9('0x198'),'foreignKey':_0x1cb9('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0x1cb9('0x93')][_0x1cb9('0x10e')](db[_0x1cb9('0x9a')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x1cb9('0x1a0'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x1cb9('0x9a')],{'as':_0x1cb9('0x1a6'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1a7')});db[_0x1cb9('0x99')][_0x1cb9('0x10e')](db[_0x1cb9('0x9a')],{'as':_0x1cb9('0x1a6'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x1cb9('0x119')](db[_0x1cb9('0x99')],{'foreignKey':_0x1cb9('0x1a8')});db['SalesforceAccount'][_0x1cb9('0x10e')](db[_0x1cb9('0x1a9')],{'as':'Configurations','onDelete':_0x1cb9('0x10c'),'foreignKey':'AccountId'});db[_0x1cb9('0x1a9')]['hasMany'](db[_0x1cb9('0x9f')],{'as':_0x1cb9('0x1aa'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'SubjectId'});db[_0x1cb9('0x1a9')][_0x1cb9('0x10e')](db['SalesforceField'],{'as':_0x1cb9('0x1ab'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1a9')]['hasMany'](db[_0x1cb9('0x9f')],{'as':'Fields','onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0x1a9')][_0x1cb9('0x119')](db['SalesforceAccount'],{'as':_0x1cb9('0x163'),'foreignKey':'AccountId'});db[_0x1cb9('0x9f')][_0x1cb9('0x10e')](db[_0x1cb9('0x9f')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0x9f')][_0x1cb9('0x10e')](db[_0x1cb9('0x9f')],{'as':_0x1cb9('0x1b0'),'foreignKey':_0x1cb9('0x1ac')});db['SalesforceField'][_0x1cb9('0x10e')](db[_0x1cb9('0x9f')],{'as':_0x1cb9('0x1b1'),'foreignKey':'FieldId'});db[_0x1cb9('0x9f')][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':'Variable','foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0xa1')][_0x1cb9('0x10e')](db[_0x1cb9('0x1b3')],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'AccountId'});db[_0x1cb9('0x1b3')][_0x1cb9('0x10e')](db['SugarcrmField'],{'as':_0x1cb9('0x1aa'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'SubjectId'});db[_0x1cb9('0x1b3')][_0x1cb9('0x10e')](db['SugarcrmField'],{'as':_0x1cb9('0x1ab'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1b3')][_0x1cb9('0x10e')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0x1b3')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0xa4')][_0x1cb9('0x10e')](db['SugarcrmField'],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db['SugarcrmField'][_0x1cb9('0x10e')](db[_0x1cb9('0xa4')],{'as':'Description','foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xa4')][_0x1cb9('0x10e')](db[_0x1cb9('0xa4')],{'as':_0x1cb9('0x1b1'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xa4')][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db['DeskAccount'][_0x1cb9('0x10e')](db['DeskConfiguration'],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0xa9')],{'as':_0x1cb9('0x1aa'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0xa9')],{'as':_0x1cb9('0x1ab'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xa7')][_0x1cb9('0x10e')](db[_0x1cb9('0xa9')],{'as':_0x1cb9('0x1a6'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'FieldId'});db[_0x1cb9('0xa7')][_0x1cb9('0x119')](db[_0x1cb9('0xa5')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0xa7')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x1b6')});db[_0x1cb9('0xa9')][_0x1cb9('0x10e')](db[_0x1cb9('0xa9')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0xa9')][_0x1cb9('0x10e')](db[_0x1cb9('0xa9')],{'as':_0x1cb9('0x1b0'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xa9')]['hasMany'](db[_0x1cb9('0xa9')],{'as':'Field','foreignKey':'FieldId'});db[_0x1cb9('0xa9')][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0x1b7')][_0x1cb9('0x10e')](db[_0x1cb9('0xab')],{'as':_0x1cb9('0x1b4'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x1cb9('0xab')][_0x1cb9('0x10e')](db['ZohoField'],{'as':_0x1cb9('0x1aa'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0xab')][_0x1cb9('0x10e')](db[_0x1cb9('0x1b8')],{'as':_0x1cb9('0x1ab'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ac')});db['ZohoConfiguration']['hasMany'](db[_0x1cb9('0x1b8')],{'as':_0x1cb9('0x1a6'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xab')][_0x1cb9('0x119')](db['ZohoAccount'],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0x1b8')][_0x1cb9('0x10e')](db[_0x1cb9('0x1b8')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0x1b8')]['hasMany'](db[_0x1cb9('0x1b8')],{'as':_0x1cb9('0x1b0'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1b8')][_0x1cb9('0x10e')](db['ZohoField'],{'as':_0x1cb9('0x1b1'),'foreignKey':'FieldId'});db['ZohoField'][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0x1b9')]['hasMany'](db[_0x1cb9('0xaf')],{'as':_0x1cb9('0x1b4'),'onDelete':'cascade','foreignKey':_0x1cb9('0x1b5')});db['ZendeskConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0x1ba')],{'as':_0x1cb9('0x1aa'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0xaf')][_0x1cb9('0x10e')](db[_0x1cb9('0x1ba')],{'as':_0x1cb9('0x1ab'),'foreignKey':_0x1cb9('0x1ac')});db['ZendeskConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0x1ba')],{'as':_0x1cb9('0x1a6'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xaf')][_0x1cb9('0x119')](db[_0x1cb9('0x1b9')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0xaf')]['belongsToMany'](db[_0x1cb9('0x8b')],{'through':'int_zendesk_configuration_has_tags'});db[_0x1cb9('0x1ba')][_0x1cb9('0x10e')](db['ZendeskField'],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db['ZendeskField'][_0x1cb9('0x10e')](db[_0x1cb9('0x1ba')],{'as':'Description','foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1ba')][_0x1cb9('0x10e')](db[_0x1cb9('0x1ba')],{'as':_0x1cb9('0x1b1'),'foreignKey':'FieldId'});db[_0x1cb9('0x1ba')]['belongsTo'](db['Variable'],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db['FreshdeskAccount'][_0x1cb9('0x10e')](db[_0x1cb9('0xb3')],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1b5')});db['FreshdeskConfiguration'][_0x1cb9('0x10e')](db['FreshdeskField'],{'as':_0x1cb9('0x1aa'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'SubjectId'});db[_0x1cb9('0xb3')][_0x1cb9('0x10e')](db[_0x1cb9('0xb5')],{'as':_0x1cb9('0x1ab'),'onDelete':'cascade','foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xb3')][_0x1cb9('0x10e')](db[_0x1cb9('0xb5')],{'as':_0x1cb9('0x1a6'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xb3')][_0x1cb9('0x119')](db[_0x1cb9('0xb2')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0xb3')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':_0x1cb9('0x1bb')});db['FreshdeskField']['hasMany'](db[_0x1cb9('0xb5')],{'as':_0x1cb9('0x1ae'),'foreignKey':'SubjectId'});db[_0x1cb9('0xb5')][_0x1cb9('0x10e')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xb5')][_0x1cb9('0x10e')](db[_0x1cb9('0xb5')],{'as':_0x1cb9('0x1b1'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xb5')][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0x1bc')][_0x1cb9('0x10e')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x1cb9('0x10c'),'foreignKey':'AccountId'});db[_0x1cb9('0xb7')][_0x1cb9('0x10e')](db[_0x1cb9('0xb9')],{'as':_0x1cb9('0x1aa'),'foreignKey':_0x1cb9('0x1af')});db['VtigerConfiguration'][_0x1cb9('0x10e')](db['VtigerField'],{'as':_0x1cb9('0x1ab'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xb7')][_0x1cb9('0x10e')](db[_0x1cb9('0xb9')],{'as':_0x1cb9('0x1a6'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xb7')]['belongsTo'](db[_0x1cb9('0x1bc')],{'as':_0x1cb9('0x163'),'foreignKey':'AccountId'});db['VtigerField'][_0x1cb9('0x10e')](db[_0x1cb9('0xb9')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db['VtigerField'][_0x1cb9('0x10e')](db[_0x1cb9('0xb9')],{'as':'Description','foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xb9')][_0x1cb9('0x10e')](db[_0x1cb9('0xb9')],{'as':_0x1cb9('0x1b1'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xb9')][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db['ServicenowAccount']['hasMany'](db[_0x1cb9('0x1bd')],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0x1bd')][_0x1cb9('0x10e')](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1aa'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0x1bd')][_0x1cb9('0x10e')](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1ab'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1a6'),'foreignKey':'FieldId'});db[_0x1cb9('0x1bd')]['belongsTo'](db['ServicenowAccount'],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db['ServicenowField'][_0x1cb9('0x10e')](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0xbc')]['hasMany'](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1b0'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0xbc')][_0x1cb9('0x10e')](db[_0x1cb9('0xbc')],{'as':_0x1cb9('0x1b1'),'foreignKey':_0x1cb9('0x1ad')});db[_0x1cb9('0xbc')]['belongsTo'](db[_0x1cb9('0x90')],{'as':'Variable','foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0x1be')][_0x1cb9('0x10e')](db[_0x1cb9('0x1bf')],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':'AccountId'});db[_0x1cb9('0x1bf')][_0x1cb9('0x10e')](db[_0x1cb9('0x1c0')],{'as':_0x1cb9('0x1aa'),'onDelete':'cascade','foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0x1bf')]['hasMany'](db['Dynamics365Field'],{'as':_0x1cb9('0x1ab'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1bf')]['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x1cb9('0x10c'),'foreignKey':'FieldId'});db[_0x1cb9('0x1bf')][_0x1cb9('0x119')](db[_0x1cb9('0x1be')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1b5')});db['Dynamics365Field']['hasMany'](db[_0x1cb9('0x1c0')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0x1c0')][_0x1cb9('0x10e')](db['Dynamics365Field'],{'as':_0x1cb9('0x1b0'),'foreignKey':_0x1cb9('0x1ac')});db[_0x1cb9('0x1c0')]['hasMany'](db['Dynamics365Field'],{'as':_0x1cb9('0x1b1'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x1cb9('0x119')](db[_0x1cb9('0x90')],{'as':'Variable','foreignKey':_0x1cb9('0x1b2')});db['FreshsalesAccount'][_0x1cb9('0x10e')](db[_0x1cb9('0x1c1')],{'as':_0x1cb9('0x1b4'),'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1b5')});db[_0x1cb9('0x1c1')]['hasMany'](db[_0x1cb9('0xbf')],{'as':_0x1cb9('0x1aa'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0x1cb9('0x10e')](db[_0x1cb9('0xbf')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x1cb9('0x1c1')]['hasMany'](db[_0x1cb9('0xbf')],{'as':_0x1cb9('0x1a6'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x1cb9('0x119')](db[_0x1cb9('0x1c2')],{'as':'Account','foreignKey':'AccountId'});db[_0x1cb9('0xbf')][_0x1cb9('0x10e')](db[_0x1cb9('0xbf')],{'as':_0x1cb9('0x1ae'),'foreignKey':_0x1cb9('0x1af')});db[_0x1cb9('0xbf')][_0x1cb9('0x10e')](db[_0x1cb9('0xbf')],{'as':_0x1cb9('0x1b0'),'foreignKey':'DescriptionId'});db[_0x1cb9('0xbf')][_0x1cb9('0x10e')](db[_0x1cb9('0xbf')],{'as':_0x1cb9('0x1b1'),'foreignKey':_0x1cb9('0x1ad')});db['FreshsalesField']['belongsTo'](db[_0x1cb9('0x90')],{'as':_0x1cb9('0x90'),'foreignKey':_0x1cb9('0x1b2')});db[_0x1cb9('0x1c3')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{});db[_0x1cb9('0x1c3')][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x1c3')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x1c3')][_0x1cb9('0x119')](db[_0x1cb9('0x62')],{});db[_0x1cb9('0x1c3')][_0x1cb9('0x119')](db[_0x1cb9('0x64')],{});db['ChatQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{});db[_0x1cb9('0x1c3')]['belongsTo'](db[_0x1cb9('0x68')],{});db[_0x1cb9('0x18a')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':_0x1cb9('0x10c'),'foreignKey':_0x1cb9('0x1c4')});db['ChatInternalMessage'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':'cascade','foreignKey':'ToId'});db['JscriptySessionReport'][_0x1cb9('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':_0x1cb9('0x1c5'),'onDelete':_0x1cb9('0x10c')});db['JscriptySessionReport'][_0x1cb9('0x10e')](db[_0x1cb9('0xc7')],{'foreignKey':'SessionId','onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0xcd')]['belongsTo'](db[_0x1cb9('0x4f')],{});db[_0x1cb9('0xcd')]['belongsTo'](db['CmList'],{'as':_0x1cb9('0x171'),'foreignKey':'ListId'});db[_0x1cb9('0xcd')][_0x1cb9('0x119')](db['CmContact'],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db['SmsQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0x53')],{});db['SmsQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0x55')],{});db[_0x1cb9('0xcd')][_0x1cb9('0x119')](db['User'],{});db[_0x1cb9('0xcd')][_0x1cb9('0x119')](db['SmsQueue'],{});db[_0x1cb9('0xd3')][_0x1cb9('0x10e')](db[_0x1cb9('0xcb')],{'foreignKey':_0x1cb9('0x1c6')});db[_0x1cb9('0xd3')][_0x1cb9('0x10e')](db[_0x1cb9('0xc9')],{'foreignKey':_0x1cb9('0x1c6')});db[_0x1cb9('0xd3')][_0x1cb9('0x10e')](db[_0x1cb9('0xc7')],{'foreignKey':_0x1cb9('0x1c6')});db[_0x1cb9('0xd8')][_0x1cb9('0x11c')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'through':_0x1cb9('0x13b')});db['Team']['belongsToMany'](db[_0x1cb9('0x10')],{'as':'Agents','through':_0x1cb9('0x120')});db[_0x1cb9('0xde')]['belongsToMany'](db[_0x1cb9('0x126')],{'through':_0x1cb9('0x106'),'as':_0x1cb9('0x1c7')});db[_0x1cb9('0xde')][_0x1cb9('0x11c')](db[_0x1cb9('0x128')],{'through':_0x1cb9('0x1c8'),'as':_0x1cb9('0x129')});db['Team'][_0x1cb9('0x11c')](db[_0x1cb9('0x68')],{'through':_0x1cb9('0x189'),'as':_0x1cb9('0x12a')});db['Team'][_0x1cb9('0x11c')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x1cb9('0x1c9')});db[_0x1cb9('0xde')][_0x1cb9('0x11c')](db[_0x1cb9('0x56')],{'through':_0x1cb9('0x17d'),'as':'SmsQueues'});db[_0x1cb9('0xde')][_0x1cb9('0x11c')](db['OpenchannelQueue'],{'through':_0x1cb9('0x1ca'),'as':'OpenchannelQueues'});db[_0x1cb9('0xde')]['belongsToMany'](db[_0x1cb9('0x103')],{'through':'team_has_whatsapp_queues','as':_0x1cb9('0x12d')});db['Team'][_0x1cb9('0x11c')](db[_0x1cb9('0xf0')],{'through':_0x1cb9('0x108'),'as':'VoicePrefixes'});db[_0x1cb9('0xe0')][_0x1cb9('0x10e')](db[_0x1cb9('0x72')],{'as':_0x1cb9('0x142'),'foreignKey':_0x1cb9('0x190')});db[_0x1cb9('0xe0')][_0x1cb9('0x10e')](db[_0x1cb9('0x76')],{'as':_0x1cb9('0x143'),'foreignKey':_0x1cb9('0x190')});db[_0x1cb9('0xe0')][_0x1cb9('0x10e')](db[_0x1cb9('0x78')],{'as':_0x1cb9('0x144'),'foreignKey':'CampaignId'});db['Campaign'][_0x1cb9('0x10e')](db[_0x1cb9('0x74')],{'as':_0x1cb9('0x145'),'foreignKey':_0x1cb9('0x190')});db[_0x1cb9('0xe0')][_0x1cb9('0x119')](db[_0x1cb9('0x147')],{'as':'Trunk','foreignKey':_0x1cb9('0x148')});db['Campaign'][_0x1cb9('0x119')](db[_0x1cb9('0x147')],{'as':_0x1cb9('0x1cb'),'foreignKey':'TrunkBackupId'});db[_0x1cb9('0xe0')]['belongsTo'](db['Interval'],{'as':_0x1cb9('0x83'),'foreignKey':_0x1cb9('0x149')});db['Campaign'][_0x1cb9('0x119')](db[_0x1cb9('0xd8')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db['Campaign'][_0x1cb9('0x11c')](db['CmList'],{'as':_0x1cb9('0x11e'),'through':'campaigns_has_cm_lists'});db[_0x1cb9('0xe0')][_0x1cb9('0x11c')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x14f'),'through':_0x1cb9('0x1cc')});db[_0x1cb9('0xe4')]['belongsTo'](db[_0x1cb9('0x66')],{'as':_0x1cb9('0x66'),'foreignKey':_0x1cb9('0x1cd')});db[_0x1cb9('0xe8')][_0x1cb9('0x119')](db['MailMessage'],{});db[_0x1cb9('0xe8')][_0x1cb9('0x119')](db[_0x1cb9('0x115')],{});db[_0x1cb9('0xe8')]['belongsTo'](db[_0x1cb9('0x131')],{'foreignKey':_0x1cb9('0x1ce'),'as':_0x1cb9('0x1cf')});db[_0x1cb9('0xe8')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d0'),'as':'FromAgent'});db[_0x1cb9('0xe8')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d1'),'as':_0x1cb9('0x1d2')});db[_0x1cb9('0xe8')][_0x1cb9('0x119')](db[_0x1cb9('0x128')],{'foreignKey':'ToMailQueueId','as':_0x1cb9('0x1d3')});db[_0x1cb9('0xe8')]['belongsTo'](db[_0x1cb9('0x131')],{'foreignKey':_0x1cb9('0x1d4'),'as':'ToAccount'});db['ChatTransferReport'][_0x1cb9('0x119')](db['ChatMessage'],{});db[_0x1cb9('0x1d5')][_0x1cb9('0x119')](db['ChatInteraction'],{});db[_0x1cb9('0x1d5')][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x1cb9('0x1d5')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d0'),'as':_0x1cb9('0x1d6')});db[_0x1cb9('0x1d5')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':'ToUserId','as':_0x1cb9('0x1d2')});db[_0x1cb9('0x1d5')][_0x1cb9('0x119')](db[_0x1cb9('0x68')],{'foreignKey':'ToChatQueueId','as':_0x1cb9('0x1d3')});db['ChatTransferReport'][_0x1cb9('0x119')](db[_0x1cb9('0x5e')],{'foreignKey':'ToChatWebsiteId','as':_0x1cb9('0x1d7')});db[_0x1cb9('0xe9')]['belongsTo'](db[_0x1cb9('0x4b')],{});db['FaxTransferReport'][_0x1cb9('0x119')](db[_0x1cb9('0x49')],{});db[_0x1cb9('0xe9')][_0x1cb9('0x119')](db['FaxAccount'],{'foreignKey':_0x1cb9('0x1d8'),'as':_0x1cb9('0x1cf')});db[_0x1cb9('0xe9')][_0x1cb9('0x119')](db['User'],{'foreignKey':_0x1cb9('0x1d0'),'as':_0x1cb9('0x1d6')});db[_0x1cb9('0xe9')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d1'),'as':_0x1cb9('0x1d2')});db[_0x1cb9('0xe9')][_0x1cb9('0x119')](db[_0x1cb9('0x175')],{'foreignKey':_0x1cb9('0x1d9'),'as':_0x1cb9('0x1d3')});db[_0x1cb9('0xe9')]['belongsTo'](db[_0x1cb9('0x47')],{'foreignKey':_0x1cb9('0x1da'),'as':_0x1cb9('0x1d7')});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db[_0x1cb9('0x5c')],{});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db[_0x1cb9('0x5a')],{});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x1cb9('0x1cf')});db['OpenchannelTransferReport'][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d1'),'as':_0x1cb9('0x1d2')});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db[_0x1cb9('0x12c')],{'foreignKey':_0x1cb9('0x1db'),'as':_0x1cb9('0x1d3')});db[_0x1cb9('0xeb')][_0x1cb9('0x119')](db[_0x1cb9('0x57')],{'foreignKey':_0x1cb9('0x1dc'),'as':_0x1cb9('0x1d7')});db['SmsTransferReport'][_0x1cb9('0x119')](db[_0x1cb9('0x55')],{});db[_0x1cb9('0xed')][_0x1cb9('0x119')](db['SmsInteraction'],{});db[_0x1cb9('0xed')][_0x1cb9('0x119')](db[_0x1cb9('0x4f')],{'foreignKey':_0x1cb9('0x1dd'),'as':'FromAccount'});db[_0x1cb9('0xed')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d0'),'as':_0x1cb9('0x1d6')});db[_0x1cb9('0xed')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':'ToUserId','as':_0x1cb9('0x1d2')});db[_0x1cb9('0xed')][_0x1cb9('0x119')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x1cb9('0x1d3')});db['SmsTransferReport']['belongsTo'](db[_0x1cb9('0x4f')],{'foreignKey':_0x1cb9('0x1de'),'as':_0x1cb9('0x1d7')});db['CmList'][_0x1cb9('0x10e')](db[_0x1cb9('0x7f')],{'as':_0x1cb9('0x15c'),'foreignKey':_0x1cb9('0x15f'),'onDelete':_0x1cb9('0x10c')});db['CmList'][_0x1cb9('0x10e')](db[_0x1cb9('0x7b')],{'as':_0x1cb9('0x1df'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0xef')][_0x1cb9('0x10e')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x11d'),'onDelete':'cascade','foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0xef')][_0x1cb9('0x10e')](db[_0x1cb9('0x76')],{'as':_0x1cb9('0x143'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0xef')]['hasMany'](db[_0x1cb9('0x78')],{'as':'HopperHistory','foreignKey':_0x1cb9('0x15f')});db['CmList'][_0x1cb9('0x10e')](db[_0x1cb9('0x79')],{'as':_0x1cb9('0x79'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0xef')]['belongsToMany'](db[_0x1cb9('0x126')],{'as':'Queues','through':_0x1cb9('0x14c')});db[_0x1cb9('0xef')]['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x11f')});db[_0x1cb9('0xf0')][_0x1cb9('0x10e')](db[_0x1cb9('0x16')],{'as':_0x1cb9('0x110'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0xf0')][_0x1cb9('0x11c')](db['User'],{'as':'Agents','through':_0x1cb9('0x10a')});db[_0x1cb9('0xf0')]['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':_0x1cb9('0x14e')});db['UserProfile']['hasMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x169'),'foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0x1cb9('0x1e0')],{'as':_0x1cb9('0x1e1'),'foreignKey':_0x1cb9('0x11a'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0x1e0')][_0x1cb9('0x10e')](db[_0x1cb9('0xf5')],{'as':'Resources','foreignKey':_0x1cb9('0x1e2'),'onDelete':_0x1cb9('0x10c')});db[_0x1cb9('0xf9')]['hasMany'](db[_0x1cb9('0x7f')],{'as':'Dispositions','foreignKey':_0x1cb9('0x1e3'),'onDelete':'cascade'});db[_0x1cb9('0xf9')][_0x1cb9('0x10e')](db['CannedAnswer'],{'as':_0x1cb9('0x15d'),'foreignKey':_0x1cb9('0x1e3')});db[_0x1cb9('0xf9')][_0x1cb9('0x10e')](db[_0x1cb9('0xfe')],{'as':_0x1cb9('0x152'),'foreignKey':_0x1cb9('0x1e3')});db[_0x1cb9('0xf9')][_0x1cb9('0x10e')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x1cb9('0xf9')][_0x1cb9('0x10e')](db[_0x1cb9('0x1e4')],{'as':'Applications'});db['WhatsappAccount'][_0x1cb9('0x119')](db['CmList'],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0xf9')][_0x1cb9('0x119')](db['Pause'],{'as':_0x1cb9('0x161'),'foreignKey':_0x1cb9('0x14b')});db[_0x1cb9('0xf9')]['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':_0x1cb9('0x139')});db[_0x1cb9('0x1e4')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'onDelete':_0x1cb9('0x16e')});db['WhatsappApplication'][_0x1cb9('0x119')](db['WhatsappQueue'],{'onDelete':_0x1cb9('0x16e')});db[_0x1cb9('0x1e4')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x1cb9('0x16e')});db['WhatsappApplication'][_0x1cb9('0x119')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x1cb9('0x149')});db[_0x1cb9('0x1e4')][_0x1cb9('0x119')](db[_0x1cb9('0x8b')],{'onDelete':_0x1cb9('0x16e'),'foreignKey':'TagId'});db[_0x1cb9('0xfc')][_0x1cb9('0x10e')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1cb9('0x1e5')});db['WhatsappInteraction'][_0x1cb9('0x119')](db[_0x1cb9('0xf9')],{'as':_0x1cb9('0x163'),'foreignKey':_0x1cb9('0x1e3')});db[_0x1cb9('0xfc')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':_0x1cb9('0x164'),'foreignKey':_0x1cb9('0x158')});db['WhatsappInteraction'][_0x1cb9('0x119')](db['User'],{'as':'Owner','foreignKey':_0x1cb9('0x10d')});db[_0x1cb9('0xfc')][_0x1cb9('0x11c')](db[_0x1cb9('0x8b')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x1cb9('0xfc')][_0x1cb9('0x11c')](db['Tag'],{'through':_0x1cb9('0x1e6'),'as':_0x1cb9('0x168')});db[_0x1cb9('0xfc')][_0x1cb9('0x11c')](db['User'],{'as':_0x1cb9('0x169'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x1cb9('0xfe')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x10')});db[_0x1cb9('0xfe')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'onDelete':'cascade','as':_0x1cb9('0x164')});db[_0x1cb9('0xfe')][_0x1cb9('0x119')](db[_0x1cb9('0xfc')],{'onDelete':_0x1cb9('0x10c'),'as':_0x1cb9('0x16c'),'foreignKey':_0x1cb9('0x1e5')});db[_0x1cb9('0xfe')][_0x1cb9('0x119')](db[_0x1cb9('0xf9')],{'as':'Account','foreignKey':_0x1cb9('0x1e3')});db['WhatsappQueueReport'][_0x1cb9('0x119')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0xef')],{'as':_0x1cb9('0x171'),'foreignKey':_0x1cb9('0x15f')});db[_0x1cb9('0x100')][_0x1cb9('0x119')](db[_0x1cb9('0x70')],{'as':'Contact','foreignKey':_0x1cb9('0x158')});db[_0x1cb9('0x100')][_0x1cb9('0x119')](db[_0x1cb9('0xfc')],{});db['WhatsappQueueReport'][_0x1cb9('0x119')](db[_0x1cb9('0x103')],{});db[_0x1cb9('0x100')][_0x1cb9('0x119')](db['WhatsappMessage'],{});db[_0x1cb9('0x100')][_0x1cb9('0x119')](db['User'],{});db[_0x1cb9('0x101')]['belongsTo'](db[_0x1cb9('0xfe')],{});db['WhatsappTransferReport'][_0x1cb9('0x119')](db[_0x1cb9('0xfc')],{});db[_0x1cb9('0x101')][_0x1cb9('0x119')](db['WhatsappAccount'],{'foreignKey':_0x1cb9('0x1e7'),'as':'FromAccount'});db[_0x1cb9('0x101')][_0x1cb9('0x119')](db['WhatsappAccount'],{'foreignKey':_0x1cb9('0x1e8'),'as':_0x1cb9('0x1d7')});db['WhatsappTransferReport'][_0x1cb9('0x119')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x1cb9('0x1d3')});db[_0x1cb9('0x101')][_0x1cb9('0x119')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x1cb9('0x101')][_0x1cb9('0x119')](db[_0x1cb9('0x10')],{'foreignKey':_0x1cb9('0x1d1'),'as':_0x1cb9('0x1d2')});db[_0x1cb9('0x103')]['belongsToMany'](db[_0x1cb9('0x10')],{'as':_0x1cb9('0x14d'),'through':'UserWhatsappQueue','foreignKey':_0x1cb9('0x1e9')});db['WhatsappQueue'][_0x1cb9('0x11c')](db[_0x1cb9('0xde')],{'through':_0x1cb9('0x1ea'),'as':_0x1cb9('0x14e')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 7d19385..e0208db 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e04=['/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','firstName','street','fax','email','clientId','clientSecret','securityToken','accessKey','token','accessToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','localstationid','dsn','secret','isPlainObject','isArray','isString','replace','@@{','}@@','lodash','path','express','util','./config/logger','api','auth','safeTemplate','default','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','url','role','other','agent_id','agent_name','test','use','/api/users','./api/user','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage'];(function(_0x5824c1,_0x1d2e44){var _0x5009e1=function(_0x1b2afe){while(--_0x1b2afe){_0x5824c1['push'](_0x5824c1['shift']());}};_0x5009e1(++_0x1d2e44);}(_0x7e04,0xd6));var _0x47e0=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x7e04[_0x432044];return _0x108d8d;};'use strict';var _=require(_0x47e0('0x0'));var path=require(_0x47e0('0x1'));var express=require(_0x47e0('0x2'));var ewinston=require('express-winston');var util=require(_0x47e0('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x47e0('0x4'))(_0x47e0('0x5'));var authLogger=require('./config/logger')(_0x47e0('0x6'));var safeTemplate=require('./safe-template')[_0x47e0('0x7')];exports[_0x47e0('0x8')]=function(_0xbcdc9c){_0xbcdc9c['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x18f831,_0x2ac307){var _0x31fd30='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x18f831[_0x47e0('0x9')])){_0x31fd30+=_0x47e0('0xa');var _0x10303c=_0x18f831[_0x47e0('0x9')];maskSensitiveData(_0x10303c);}return safeTemplate(util[_0x47e0('0xb')](_0x31fd30,_0x18f831[_0x47e0('0xc')],_0x18f831[_0x47e0('0xd')]['x-forwarded-for']?_0x18f831[_0x47e0('0xd')][_0x47e0('0xe')]:_0x18f831[_0x47e0('0xf')][_0x47e0('0x10')]||_0x18f831['ip'],_0x18f831['url'],_0x2ac307[_0x47e0('0x11')],_0x2ac307[_0x47e0('0x12')],_0x18f831[_0x47e0('0x13')]?_0x18f831['user']['id']:null,_0x18f831[_0x47e0('0x13')]?_0x18f831[_0x47e0('0x13')][_0x47e0('0x14')]:null,_0x18f831[_0x47e0('0x13')]?_0x18f831[_0x47e0('0x13')]['role']:null,_0x10303c?util[_0x47e0('0x15')](_0x10303c,![],null):''));}}));_0xbcdc9c['use'](ewinston[_0x47e0('0x16')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2831dd,_0x216df1){var _0x194854=_0x47e0('0x17');if(_0x2831dd['body']&&_0x2831dd[_0x47e0('0x9')][_0x47e0('0x18')]&&_0x2831dd[_0x47e0('0x9')]['agent_id']){_0x194854='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x47e0('0xb')](_0x194854,_0x2831dd[_0x47e0('0xc')],_0x2831dd[_0x47e0('0xd')][_0x47e0('0xe')]?_0x2831dd[_0x47e0('0xd')][_0x47e0('0xe')]:_0x2831dd[_0x47e0('0xf')][_0x47e0('0x10')]||_0x2831dd['ip'],_0x2831dd[_0x47e0('0x19')],_0x216df1['statusCode'],_0x216df1[_0x47e0('0x12')],_0x2831dd[_0x47e0('0x13')]?_0x2831dd[_0x47e0('0x13')]['id']:null,_0x2831dd[_0x47e0('0x13')]?_0x2831dd['user'][_0x47e0('0x14')]:null,_0x2831dd['user']?_0x2831dd[_0x47e0('0x13')][_0x47e0('0x1a')]:null,_0x2831dd[_0x47e0('0x9')]&&_0x2831dd[_0x47e0('0x9')][_0x47e0('0x18')]?_0x2831dd['body'][_0x47e0('0x18')]:_0x47e0('0x1b'),_0x2831dd[_0x47e0('0x9')]&&_0x2831dd[_0x47e0('0x9')][_0x47e0('0x1c')]?_0x2831dd[_0x47e0('0x9')][_0x47e0('0x1c')]:'',_0x2831dd[_0x47e0('0x9')]&&_0x2831dd[_0x47e0('0x9')][_0x47e0('0x1d')]?_0x2831dd['body'][_0x47e0('0x1d')]:'');},'ignoreRoute':function(_0x320bf0){var _0x23c205=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x23c205[_0x47e0('0x1e')](_0x320bf0[_0x47e0('0x19')]);}}));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x20'),require(_0x47e0('0x21')));_0xbcdc9c['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0xbcdc9c[_0x47e0('0x1f')]('/api/voice/contexts',require(_0x47e0('0x22')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x23'),require(_0x47e0('0x24')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x25'),require(_0x47e0('0x26')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x27'),require(_0x47e0('0x28')));_0xbcdc9c['use'](_0x47e0('0x29'),require(_0x47e0('0x2a')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x2b'),require(_0x47e0('0x2c')));_0xbcdc9c['use'](_0x47e0('0x2d'),require(_0x47e0('0x2e')));_0xbcdc9c['use']('/api/voice/mails/messages',require(_0x47e0('0x2f')));_0xbcdc9c[_0x47e0('0x1f')]('/api/voice/calls/reports',require(_0x47e0('0x30')));_0xbcdc9c['use'](_0x47e0('0x31'),require(_0x47e0('0x32')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x33'),require(_0x47e0('0x34')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x35'),require(_0x47e0('0x36')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x37'),require(_0x47e0('0x38')));_0xbcdc9c[_0x47e0('0x1f')]('/api/trunks',require(_0x47e0('0x39')));_0xbcdc9c['use'](_0x47e0('0x3a'),require(_0x47e0('0x3b')));_0xbcdc9c[_0x47e0('0x1f')]('/api/mail/out_servers',require('./api/mailServerOut'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x3c'),require(_0x47e0('0x3d')));_0xbcdc9c['use'](_0x47e0('0x3e'),require(_0x47e0('0x3f')));_0xbcdc9c['use'](_0x47e0('0x40'),require(_0x47e0('0x41')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x42'),require(_0x47e0('0x43')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x44'),require(_0x47e0('0x45')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x46'),require(_0x47e0('0x47')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x48'),require(_0x47e0('0x49')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x4a'),require('./api/dashboard'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x4b'),require(_0x47e0('0x4c')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x4d'),require(_0x47e0('0x4e')));_0xbcdc9c['use'](_0x47e0('0x4f'),require(_0x47e0('0x50')));_0xbcdc9c['use']('/api/fax/interactions',require(_0x47e0('0x51')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x52'),require('./api/faxMessage'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x53'),require(_0x47e0('0x54')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x55'),require(_0x47e0('0x56')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x57'),require(_0x47e0('0x58')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x59'),require('./api/smsApplication'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x5a'),require('./api/smsInteraction'));_0xbcdc9c['use'](_0x47e0('0x5b'),require('./api/smsMessage'));_0xbcdc9c['use'](_0x47e0('0x5c'),require('./api/smsQueue'));_0xbcdc9c['use'](_0x47e0('0x5d'),require('./api/openchannelAccount'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x5e'),require(_0x47e0('0x5f')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x60'),require(_0x47e0('0x61')));_0xbcdc9c['use'](_0x47e0('0x62'),require('./api/openchannelMessage'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x63'),require(_0x47e0('0x64')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x65'),require(_0x47e0('0x66')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x67'),require(_0x47e0('0x68')));_0xbcdc9c['use']('/api/chat/applications',require(_0x47e0('0x69')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x6a'),require('./api/chatInteraction'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x6b'),require(_0x47e0('0x6c')));_0xbcdc9c['use']('/api/chat/offline_messages',require(_0x47e0('0x6d')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x6e'),require(_0x47e0('0x6f')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x70'),require(_0x47e0('0x71')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x72'),require('./api/chatProactiveAction'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x73'),require(_0x47e0('0x74')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x75'),require('./api/cmContact'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x76'),require(_0x47e0('0x77')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x78'),require('./api/cmHopperBlack'));_0xbcdc9c['use'](_0x47e0('0x79'),require('./api/cmHopperFinal'));_0xbcdc9c['use'](_0x47e0('0x7a'),require(_0x47e0('0x7b')));_0xbcdc9c['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x7c'),require(_0x47e0('0x7d')));_0xbcdc9c['use'](_0x47e0('0x7e'),require(_0x47e0('0x7f')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x80'),require('./api/cannedAnswer'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x81'),require(_0x47e0('0x82')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x83'),require('./api/condition'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x84'),require(_0x47e0('0x85')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x86'),require(_0x47e0('0x87')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x88'),require('./api/cdr'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x89'),require(_0x47e0('0x8a')));_0xbcdc9c[_0x47e0('0x1f')]('/api/schedules',require(_0x47e0('0x8b')));_0xbcdc9c['use'](_0x47e0('0x8c'),require('./api/sound'));_0xbcdc9c['use']('/api/tags',require(_0x47e0('0x8d')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x8e'),require(_0x47e0('0x8f')));_0xbcdc9c['use'](_0x47e0('0x90'),require(_0x47e0('0x91')));_0xbcdc9c['use'](_0x47e0('0x92'),require('./api/variable'));_0xbcdc9c[_0x47e0('0x1f')]('/api/integrations',require(_0x47e0('0x93')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x94'),require(_0x47e0('0x95')));_0xbcdc9c[_0x47e0('0x1f')]('/api/analytics/custom_reports',require(_0x47e0('0x96')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x97'),require(_0x47e0('0x98')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x99'),require(_0x47e0('0x9a')));_0xbcdc9c['use'](_0x47e0('0x9b'),require('./api/analyticMetric'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x9c'),require('./api/analyticFieldReport'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x9d'),require(_0x47e0('0x9e')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x9f'),require(_0x47e0('0xa0')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa1'),require('./api/intSalesforceConfiguration'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa2'),require('./api/intSalesforceField'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa3'),require(_0x47e0('0xa4')));_0xbcdc9c[_0x47e0('0x1f')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa5'),require(_0x47e0('0xa6')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa7'),require(_0x47e0('0xa8')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xa9'),require('./api/intDeskConfiguration'));_0xbcdc9c[_0x47e0('0x1f')]('/api/integrations/desk/fields',require(_0x47e0('0xaa')));_0xbcdc9c['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0xbcdc9c['use']('/api/integrations/zoho/configurations',require(_0x47e0('0xab')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xac'),require('./api/intZohoField'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xad'),require(_0x47e0('0xae')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xaf'),require('./api/intZendeskConfiguration'));_0xbcdc9c['use']('/api/integrations/zendesk/fields',require(_0x47e0('0xb0')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xb1'),require(_0x47e0('0xb2')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xb3'),require(_0x47e0('0xb4')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xb5'),require('./api/intFreshdeskField'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xb6'),require('./api/intVtigerAccount'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xb7'),require(_0x47e0('0xb8')));_0xbcdc9c['use'](_0x47e0('0xb9'),require(_0x47e0('0xba')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xbb'),require(_0x47e0('0xbc')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xbd'),require('./api/intServicenowConfiguration'));_0xbcdc9c['use'](_0x47e0('0xbe'),require(_0x47e0('0xbf')));_0xbcdc9c['use'](_0x47e0('0xc0'),require(_0x47e0('0xc1')));_0xbcdc9c[_0x47e0('0x1f')]('/api/integrations/dynamics365/configurations',require(_0x47e0('0xc2')));_0xbcdc9c['use'](_0x47e0('0xc3'),require(_0x47e0('0xc4')));_0xbcdc9c['use'](_0x47e0('0xc5'),require('./api/intFreshsalesAccount'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xc6'),require(_0x47e0('0xc7')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xc8'),require(_0x47e0('0xc9')));_0xbcdc9c['use'](_0x47e0('0xca'),require(_0x47e0('0xcb')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xcc'),require('./api/chatQueueReport'));_0xbcdc9c[_0x47e0('0x1f')]('/api/chat/internal/messages',require(_0x47e0('0xcd')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xce'),require(_0x47e0('0xcf')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xd0'),require(_0x47e0('0xd1')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xd2'),require(_0x47e0('0xd3')));_0xbcdc9c['use'](_0x47e0('0xd4'),require(_0x47e0('0xd5')));_0xbcdc9c['use'](_0x47e0('0xd6'),require('./api/squareReport'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xd7'),require(_0x47e0('0xd8')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xd9'),require(_0x47e0('0xda')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xdb'),require('./api/setting'));_0xbcdc9c['use']('/api/square/odbc',require(_0x47e0('0xdc')));_0xbcdc9c['use']('/api/square/projects',require(_0x47e0('0xdd')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xde'),require('./api/squareRecording'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xdf'),require(_0x47e0('0xe0')));_0xbcdc9c['use'](_0x47e0('0xe1'),require(_0x47e0('0xe2')));_0xbcdc9c['use'](_0x47e0('0xe3'),require(_0x47e0('0xe4')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xe5'),require(_0x47e0('0xe6')));_0xbcdc9c[_0x47e0('0x1f')]('/api/migrations',require(_0x47e0('0xe7')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xe8'),require('./api/attachment'));_0xbcdc9c[_0x47e0('0x1f')]('/api/plugins',require('./api/plugin'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xe9'),require(_0x47e0('0xea')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xeb'),require(_0x47e0('0xec')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xed'),require(_0x47e0('0xee')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xef'),require('./api/openchannelTransferReport'));_0xbcdc9c['use'](_0x47e0('0xf0'),require('./api/smsTransferReport'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xf1'),require(_0x47e0('0xf2')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xf3'),require(_0x47e0('0xf4')));_0xbcdc9c['use'](_0x47e0('0xf5'),require(_0x47e0('0xf6')));_0xbcdc9c[_0x47e0('0x1f')]('/api/userProfile/sections',require(_0x47e0('0xf7')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xf8'),require(_0x47e0('0xf9')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xfa'),require(_0x47e0('0xfb')));_0xbcdc9c['use']('/api/whatsapp/accounts',require(_0x47e0('0xfc')));_0xbcdc9c[_0x47e0('0x1f')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0xbcdc9c['use'](_0x47e0('0xfd'),require('./api/whatsappInteraction'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0xfe'),require(_0x47e0('0xff')));_0xbcdc9c['use'](_0x47e0('0x100'),require(_0x47e0('0x101')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x102'),require('./api/whatsappTransferReport'));_0xbcdc9c['use'](_0x47e0('0x103'),require('./api/whatsappQueue'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x104'),require(_0x47e0('0x105')));_0xbcdc9c[_0x47e0('0x1f')]('/api/realtime',require('./api/realtime'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x106'),require(_0x47e0('0x107')));_0xbcdc9c['use']('/api/auth/google',require(_0x47e0('0x108')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x109'),require('./api/authActiveDirectory'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x10a'),require('./api/jira'));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x10b'),require(_0x47e0('0x10c')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x10d'),require('./api/version'));_0xbcdc9c['use']('/api/system',require(_0x47e0('0x10e')));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x10f'),require(_0x47e0('0x110')));_0xbcdc9c['use'](_0x47e0('0x111'),require('./api/webbar'));_0xbcdc9c[_0x47e0('0x1f')]('/apidoc',express[_0x47e0('0x112')](path[_0x47e0('0x113')](config[_0x47e0('0x114')],_0x47e0('0x115'))));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x116'),express[_0x47e0('0x112')](path[_0x47e0('0x113')](config['root'],_0x47e0('0x116'))));_0xbcdc9c['use'](_0x47e0('0x117'),express['static'](path[_0x47e0('0x113')](config[_0x47e0('0x114')],_0x47e0('0x117'))));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x118'),express['static'](path[_0x47e0('0x113')](config[_0x47e0('0x114')],_0x47e0('0x119'),_0x47e0('0x11a'))));_0xbcdc9c[_0x47e0('0x1f')](_0x47e0('0x11b'),express['static'](path['join'](config[_0x47e0('0x114')],_0x47e0('0x11c'))));_0xbcdc9c[_0x47e0('0x11d')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x47e0('0x11e')](errors[0x194]);_0xbcdc9c[_0x47e0('0x11d')]('/*')[_0x47e0('0x11e')](function(_0x303720,_0x5390bb){_0x5390bb[_0x47e0('0x11f')](path[_0x47e0('0x120')](_0xbcdc9c[_0x47e0('0x11e')]('appPath')+_0x47e0('0x121')));});};var sensitiveFields=[_0x47e0('0x122'),_0x47e0('0x123'),_0x47e0('0x124'),_0x47e0('0x125'),_0x47e0('0x126'),'lastName',_0x47e0('0x127'),'phone','mobile',_0x47e0('0x128'),_0x47e0('0x129'),_0x47e0('0x12a'),_0x47e0('0x12b'),_0x47e0('0x12c'),'code',_0x47e0('0x12d'),'tenantId',_0x47e0('0x12e'),'channelSecret',_0x47e0('0x12f'),'accessTokenSecret','authToken',_0x47e0('0x130'),_0x47e0('0x131'),_0x47e0('0x132'),_0x47e0('0x133'),_0x47e0('0x134'),_0x47e0('0x135'),_0x47e0('0x136'),_0x47e0('0x137'),_0x47e0('0x138'),'accesskeyid',_0x47e0('0x139'),_0x47e0('0x13a'),'user','pass','accountSid',_0x47e0('0x13b'),_0x47e0('0x13c'),_0x47e0('0x13d'),'registry','oldPassword'];function maskSensitiveData(_0x18cc44){var _0x215cfb=/(?!^)[\s\S](?!$)/g;if(!_[_0x47e0('0x13e')](_0x18cc44))return;for(var _0x2d59ed in _0x18cc44){if(_[_0x47e0('0x13f')](_0x18cc44[_0x2d59ed])){for(var _0xe7f180=0x0;_0xe7f180<_0x18cc44[_0x2d59ed]['length'];_0xe7f180++){maskSensitiveData(_0x18cc44[_0x2d59ed][_0xe7f180]);}}else if(_[_0x47e0('0x13e')](_0x18cc44[_0x2d59ed])){maskSensitiveData(_0x18cc44[_0x2d59ed]);}else if(_[_0x47e0('0x140')](_0x18cc44[_0x2d59ed])){_0x18cc44[_0x2d59ed]=_0x18cc44[_0x2d59ed][_0x47e0('0x141')](/{{{/g,_0x47e0('0x142'))['replace'](/}}}/g,_0x47e0('0x143'))[_0x47e0('0x141')](/{{/g,'@{')[_0x47e0('0x141')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x2d59ed)){_0x18cc44[_0x2d59ed]=_0x18cc44[_0x2d59ed]['replace'](_0x215cfb,'*');}}}} \ No newline at end of file +var _0x1e97=['/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','./api/version','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','route','get','resolve','appPath','/index.html','username','newPassword','firstName','lastName','street','fax','email','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','length','isString','@@{','replace','}@@','includes','lodash','path','express','util','./config/environment','./config/logger','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','inspect','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','statusCode','other','agent_id','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration'];(function(_0x436afd,_0x29af34){var _0xb84fc8=function(_0x58439d){while(--_0x58439d){_0x436afd['push'](_0x436afd['shift']());}};_0xb84fc8(++_0x29af34);}(_0x1e97,0x90));var _0x71e9=function(_0xdddbd1,_0x162217){_0xdddbd1=_0xdddbd1-0x0;var _0x1de7fc=_0x1e97[_0xdddbd1];return _0x1de7fc;};'use strict';var _=require(_0x71e9('0x0'));var path=require(_0x71e9('0x1'));var express=require(_0x71e9('0x2'));var ewinston=require('express-winston');var util=require(_0x71e9('0x3'));var errors=require('./errors');var config=require(_0x71e9('0x4'));var logger=require(_0x71e9('0x5'))(_0x71e9('0x6'));var authLogger=require(_0x71e9('0x5'))(_0x71e9('0x7'));var safeTemplate=require(_0x71e9('0x8'))[_0x71e9('0x9')];exports[_0x71e9('0xa')]=function(_0x32996e){_0x32996e[_0x71e9('0xb')](ewinston[_0x71e9('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3babcb,_0x50c1fa){var _0x5512bb=_0x71e9('0xd');if(!_[_0x71e9('0xe')](_0x3babcb[_0x71e9('0xf')])){_0x5512bb+=_0x71e9('0x10');var _0x23a609=_0x3babcb[_0x71e9('0xf')];maskSensitiveData(_0x23a609);}return safeTemplate(util[_0x71e9('0x11')](_0x5512bb,_0x3babcb['method'],_0x3babcb[_0x71e9('0x12')]['x-forwarded-for']?_0x3babcb[_0x71e9('0x12')][_0x71e9('0x13')]:_0x3babcb[_0x71e9('0x14')][_0x71e9('0x15')]||_0x3babcb['ip'],_0x3babcb[_0x71e9('0x16')],_0x50c1fa['statusCode'],_0x50c1fa[_0x71e9('0x17')],_0x3babcb[_0x71e9('0x18')]?_0x3babcb[_0x71e9('0x18')]['id']:null,_0x3babcb[_0x71e9('0x18')]?_0x3babcb[_0x71e9('0x18')][_0x71e9('0x19')]:null,_0x3babcb['user']?_0x3babcb[_0x71e9('0x18')][_0x71e9('0x1a')]:null,_0x23a609?util[_0x71e9('0x1b')](_0x23a609,![],null):''));}}));_0x32996e[_0x71e9('0xb')](ewinston[_0x71e9('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1e0bd0,_0x3da31c){var _0x1999d6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1e0bd0[_0x71e9('0xf')]&&_0x1e0bd0['body'][_0x71e9('0x1c')]&&_0x1e0bd0[_0x71e9('0xf')]['agent_id']){_0x1999d6=_0x71e9('0x1d');}return util['format'](_0x1999d6,_0x1e0bd0[_0x71e9('0x1e')],_0x1e0bd0[_0x71e9('0x12')][_0x71e9('0x13')]?_0x1e0bd0[_0x71e9('0x12')][_0x71e9('0x13')]:_0x1e0bd0[_0x71e9('0x14')]['remoteAddress']||_0x1e0bd0['ip'],_0x1e0bd0[_0x71e9('0x16')],_0x3da31c[_0x71e9('0x1f')],_0x3da31c[_0x71e9('0x17')],_0x1e0bd0[_0x71e9('0x18')]?_0x1e0bd0['user']['id']:null,_0x1e0bd0['user']?_0x1e0bd0[_0x71e9('0x18')][_0x71e9('0x19')]:null,_0x1e0bd0[_0x71e9('0x18')]?_0x1e0bd0['user']['role']:null,_0x1e0bd0[_0x71e9('0xf')]&&_0x1e0bd0['body'][_0x71e9('0x1c')]?_0x1e0bd0['body'][_0x71e9('0x1c')]:_0x71e9('0x20'),_0x1e0bd0[_0x71e9('0xf')]&&_0x1e0bd0[_0x71e9('0xf')][_0x71e9('0x21')]?_0x1e0bd0[_0x71e9('0xf')]['agent_id']:'',_0x1e0bd0[_0x71e9('0xf')]&&_0x1e0bd0[_0x71e9('0xf')][_0x71e9('0x22')]?_0x1e0bd0['body']['agent_name']:'');},'ignoreRoute':function(_0x553eb0){var _0x480801=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x480801[_0x71e9('0x23')](_0x553eb0[_0x71e9('0x16')]);}}));_0x32996e[_0x71e9('0xb')](_0x71e9('0x24'),require('./api/user'));_0x32996e[_0x71e9('0xb')]('/api/voice/chanspy',require(_0x71e9('0x25')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x26'),require('./api/voiceContext'));_0x32996e['use']('/api/voice/extensions',require(_0x71e9('0x27')));_0x32996e[_0x71e9('0xb')]('/api/voice/mohs',require(_0x71e9('0x28')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x29'),require(_0x71e9('0x2a')));_0x32996e['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x2b'),require(_0x71e9('0x2c')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x2d'),require(_0x71e9('0x2e')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x2f'),require(_0x71e9('0x30')));_0x32996e['use']('/api/voice/calls/reports',require(_0x71e9('0x31')));_0x32996e['use'](_0x71e9('0x32'),require(_0x71e9('0x33')));_0x32996e[_0x71e9('0xb')]('/api/voice/agents/reports',require(_0x71e9('0x34')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x35'),require(_0x71e9('0x36')));_0x32996e[_0x71e9('0xb')]('/api/members/reports',require(_0x71e9('0x37')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x38'),require(_0x71e9('0x39')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x3a'),require(_0x71e9('0x3b')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x3c'),require(_0x71e9('0x3d')));_0x32996e[_0x71e9('0xb')]('/api/mail/accounts',require(_0x71e9('0x3e')));_0x32996e['use'](_0x71e9('0x3f'),require(_0x71e9('0x40')));_0x32996e['use'](_0x71e9('0x41'),require('./api/mailSubstatus'));_0x32996e['use']('/api/mail/interactions',require(_0x71e9('0x42')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x43'),require('./api/mailMessage'));_0x32996e[_0x71e9('0xb')]('/api/mail/applications',require('./api/mailApplication'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x44'),require('./api/mailQueueReport'));_0x32996e['use'](_0x71e9('0x45'),require(_0x71e9('0x46')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x47'),require('./api/dashboardItem'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x48'),require(_0x71e9('0x49')));_0x32996e[_0x71e9('0xb')]('/api/fax/applications',require(_0x71e9('0x4a')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x4b'),require(_0x71e9('0x4c')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x4d'),require('./api/faxMessage'));_0x32996e['use'](_0x71e9('0x4e'),require('./api/faxQueue'));_0x32996e['use']('/api/fax/reports/queue',require(_0x71e9('0x4f')));_0x32996e[_0x71e9('0xb')]('/api/sms/accounts',require(_0x71e9('0x50')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x51'),require(_0x71e9('0x52')));_0x32996e[_0x71e9('0xb')]('/api/sms/interactions',require(_0x71e9('0x53')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x54'),require(_0x71e9('0x55')));_0x32996e[_0x71e9('0xb')]('/api/sms/queues',require(_0x71e9('0x56')));_0x32996e[_0x71e9('0xb')]('/api/openchannel/accounts',require(_0x71e9('0x57')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x58'),require(_0x71e9('0x59')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x5a'),require('./api/openchannelInteraction'));_0x32996e['use'](_0x71e9('0x5b'),require(_0x71e9('0x5c')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x5d'),require(_0x71e9('0x5e')));_0x32996e['use'](_0x71e9('0x5f'),require('./api/chatWebsite'));_0x32996e['use']('/api/openchannel/reports/queue',require(_0x71e9('0x60')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x61'),require(_0x71e9('0x62')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x63'),require(_0x71e9('0x64')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x65'),require(_0x71e9('0x66')));_0x32996e['use'](_0x71e9('0x67'),require(_0x71e9('0x68')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x69'),require(_0x71e9('0x6a')));_0x32996e['use'](_0x71e9('0x6b'),require(_0x71e9('0x6c')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x6d'),require(_0x71e9('0x6e')));_0x32996e[_0x71e9('0xb')]('/api/cm/companies',require(_0x71e9('0x6f')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x70'),require('./api/cmContact'));_0x32996e[_0x71e9('0xb')]('/api/cm/hopper',require(_0x71e9('0x71')));_0x32996e[_0x71e9('0xb')]('/api/cm/hopper_black',require(_0x71e9('0x72')));_0x32996e['use'](_0x71e9('0x73'),require('./api/cmHopperFinal'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x74'),require(_0x71e9('0x75')));_0x32996e[_0x71e9('0xb')]('/api/cm/custom_fields',require(_0x71e9('0x76')));_0x32996e[_0x71e9('0xb')]('/api/actions',require(_0x71e9('0x77')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x78'),require(_0x71e9('0x79')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x7a'),require(_0x71e9('0x7b')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x7c'),require(_0x71e9('0x7d')));_0x32996e['use'](_0x71e9('0x7e'),require(_0x71e9('0x7f')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x80'),require('./api/interval'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x81'),require(_0x71e9('0x82')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x83'),require(_0x71e9('0x84')));_0x32996e['use'](_0x71e9('0x85'),require('./api/voiceQueuesLog'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x86'),require(_0x71e9('0x87')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x88'),require(_0x71e9('0x89')));_0x32996e['use'](_0x71e9('0x8a'),require(_0x71e9('0x8b')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x8c'),require(_0x71e9('0x8d')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x8e'),require(_0x71e9('0x8f')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x90'),require(_0x71e9('0x91')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x92'),require('./api/integration'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x93'),require('./api/integrationReport'));_0x32996e['use'](_0x71e9('0x94'),require(_0x71e9('0x95')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x96'),require('./api/analyticDefaultReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x97'),require('./api/analyticExtractedReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x98'),require('./api/analyticMetric'));_0x32996e['use']('/api/analytics/field_reports',require(_0x71e9('0x99')));_0x32996e[_0x71e9('0xb')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x9a'),require('./api/intSalesforceAccount'));_0x32996e[_0x71e9('0xb')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x32996e[_0x71e9('0xb')]('/api/integrations/salesforce/fields',require(_0x71e9('0x9b')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x9c'),require(_0x71e9('0x9d')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x9e'),require('./api/intSugarcrmConfiguration'));_0x32996e['use']('/api/integrations/sugarcrm/fields',require(_0x71e9('0x9f')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xa0'),require('./api/intDeskAccount'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xa1'),require(_0x71e9('0xa2')));_0x32996e[_0x71e9('0xb')]('/api/integrations/desk/fields',require(_0x71e9('0xa3')));_0x32996e[_0x71e9('0xb')]('/api/integrations/zoho/accounts',require(_0x71e9('0xa4')));_0x32996e['use'](_0x71e9('0xa5'),require(_0x71e9('0xa6')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xa7'),require(_0x71e9('0xa8')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xa9'),require(_0x71e9('0xaa')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xab'),require(_0x71e9('0xac')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xad'),require('./api/intZendeskField'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xae'),require(_0x71e9('0xaf')));_0x32996e[_0x71e9('0xb')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xb0'),require(_0x71e9('0xb1')));_0x32996e[_0x71e9('0xb')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xb2'),require(_0x71e9('0xb3')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xb4'),require('./api/intVtigerField'));_0x32996e['use'](_0x71e9('0xb5'),require(_0x71e9('0xb6')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xb7'),require('./api/intServicenowConfiguration'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xb8'),require(_0x71e9('0xb9')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xba'),require('./api/intDynamics365Account'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xbb'),require(_0x71e9('0xbc')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xbd'),require('./api/intDynamics365Field'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xbe'),require(_0x71e9('0xbf')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xc0'),require(_0x71e9('0xc1')));_0x32996e[_0x71e9('0xb')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x32996e['use'](_0x71e9('0xc2'),require(_0x71e9('0xc3')));_0x32996e['use'](_0x71e9('0xc4'),require(_0x71e9('0xc5')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xc6'),require(_0x71e9('0xc7')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xc8'),require('./api/jscriptyAnswerReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xc9'),require(_0x71e9('0xca')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xcb'),require(_0x71e9('0xcc')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xcd'),require('./api/smsQueueReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xce'),require('./api/squareReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xcf'),require(_0x71e9('0xd0')));_0x32996e['use'](_0x71e9('0xd1'),require(_0x71e9('0xd2')));_0x32996e[_0x71e9('0xb')]('/api/settings',require(_0x71e9('0xd3')));_0x32996e['use']('/api/square/odbc',require('./api/squareOdbc'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xd4'),require(_0x71e9('0xd5')));_0x32996e[_0x71e9('0xb')]('/api/square/recordings',require(_0x71e9('0xd6')));_0x32996e['use'](_0x71e9('0xd7'),require(_0x71e9('0xd8')));_0x32996e['use']('/api/teams',require(_0x71e9('0xd9')));_0x32996e['use'](_0x71e9('0xda'),require(_0x71e9('0xdb')));_0x32996e[_0x71e9('0xb')]('/api/campaigns',require(_0x71e9('0xdc')));_0x32996e[_0x71e9('0xb')]('/api/migrations',require('./api/migration'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xdd'),require(_0x71e9('0xde')));_0x32996e['use'](_0x71e9('0xdf'),require(_0x71e9('0xe0')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xe1'),require(_0x71e9('0xe2')));_0x32996e['use'](_0x71e9('0xe3'),require(_0x71e9('0xe4')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xe5'),require(_0x71e9('0xe6')));_0x32996e['use']('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xe7'),require(_0x71e9('0xe8')));_0x32996e['use'](_0x71e9('0xe9'),require(_0x71e9('0xea')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xeb'),require(_0x71e9('0xec')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xed'),require(_0x71e9('0xee')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xef'),require(_0x71e9('0xf0')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xf1'),require(_0x71e9('0xf2')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xf3'),require(_0x71e9('0xf4')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xf5'),require(_0x71e9('0xf6')));_0x32996e['use'](_0x71e9('0xf7'),require(_0x71e9('0xf8')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xf9'),require(_0x71e9('0xfa')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xfb'),require(_0x71e9('0xfc')));_0x32996e[_0x71e9('0xb')](_0x71e9('0xfd'),require('./api/whatsappQueueReport'));_0x32996e[_0x71e9('0xb')](_0x71e9('0xfe'),require(_0x71e9('0xff')));_0x32996e[_0x71e9('0xb')]('/api/whatsapp/queues',require(_0x71e9('0x100')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x101'),require(_0x71e9('0x102')));_0x32996e['use']('/api/realtime',require(_0x71e9('0x103')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x104'),require(_0x71e9('0x105')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x106'),require(_0x71e9('0x107')));_0x32996e[_0x71e9('0xb')](_0x71e9('0x108'),require(_0x71e9('0x109')));_0x32996e[_0x71e9('0xb')]('/api/jira',require(_0x71e9('0x10a')));_0x32996e[_0x71e9('0xb')]('/api/rpc',require(_0x71e9('0x10b')));_0x32996e[_0x71e9('0xb')]('/api/version',require(_0x71e9('0x10c')));_0x32996e['use']('/api/system',require(_0x71e9('0x10d')));_0x32996e['use'](_0x71e9('0x10e'),require(_0x71e9('0x10f')));_0x32996e[_0x71e9('0xb')]('/api/webbar',require('./api/webbar'));_0x32996e[_0x71e9('0xb')](_0x71e9('0x110'),express[_0x71e9('0x111')](path[_0x71e9('0x112')](config[_0x71e9('0x113')],_0x71e9('0x110'))));_0x32996e[_0x71e9('0xb')](_0x71e9('0x114'),express['static'](path['join'](config[_0x71e9('0x113')],'/www')));_0x32996e['use'](_0x71e9('0x115'),express[_0x71e9('0x111')](path[_0x71e9('0x112')](config['root'],_0x71e9('0x115'))));_0x32996e['use'](_0x71e9('0x116'),express['static'](path[_0x71e9('0x112')](config[_0x71e9('0x113')],'snippet',_0x71e9('0x117'))));_0x32996e[_0x71e9('0xb')](_0x71e9('0x118'),express[_0x71e9('0x111')](path[_0x71e9('0x112')](config['root'],'/server/files/plugins')));_0x32996e[_0x71e9('0x119')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x71e9('0x11a')](errors[0x194]);_0x32996e[_0x71e9('0x119')]('/*')['get'](function(_0x196e87,_0x277a25){_0x277a25['sendFile'](path[_0x71e9('0x11b')](_0x32996e[_0x71e9('0x11a')](_0x71e9('0x11c'))+_0x71e9('0x11d')));});};var sensitiveFields=[_0x71e9('0x11e'),'password',_0x71e9('0x11f'),'apiKey',_0x71e9('0x120'),_0x71e9('0x121'),_0x71e9('0x122'),'phone','mobile',_0x71e9('0x123'),_0x71e9('0x124'),'clientId',_0x71e9('0x125'),_0x71e9('0x126'),_0x71e9('0x127'),_0x71e9('0x128'),_0x71e9('0x129'),_0x71e9('0x12a'),_0x71e9('0x12b'),'accessToken','accessTokenSecret',_0x71e9('0x12c'),_0x71e9('0x12d'),'consumerSecret',_0x71e9('0x12e'),_0x71e9('0x12f'),_0x71e9('0x130'),_0x71e9('0x131'),_0x71e9('0x132'),_0x71e9('0x133'),_0x71e9('0x134'),'accesskeyid',_0x71e9('0x135'),_0x71e9('0x136'),'user','pass',_0x71e9('0x137'),_0x71e9('0x138'),_0x71e9('0x139'),_0x71e9('0x13a'),_0x71e9('0x13b'),_0x71e9('0x13c')];function maskSensitiveData(_0x12c428){var _0xc3f71d=/(?!^)[\s\S](?!$)/g;if(!_[_0x71e9('0x13d')](_0x12c428))return;for(var _0x155d3b in _0x12c428){if(_['isArray'](_0x12c428[_0x155d3b])){for(var _0x1591b3=0x0;_0x1591b3<_0x12c428[_0x155d3b][_0x71e9('0x13e')];_0x1591b3++){maskSensitiveData(_0x12c428[_0x155d3b][_0x1591b3]);}}else if(_[_0x71e9('0x13d')](_0x12c428[_0x155d3b])){maskSensitiveData(_0x12c428[_0x155d3b]);}else if(_[_0x71e9('0x13f')](_0x12c428[_0x155d3b])){_0x12c428[_0x155d3b]=_0x12c428[_0x155d3b]['replace'](/{{{/g,_0x71e9('0x140'))[_0x71e9('0x141')](/}}}/g,_0x71e9('0x142'))[_0x71e9('0x141')](/{{/g,'@{')[_0x71e9('0x141')](/}}/g,'}@');if(_[_0x71e9('0x143')](sensitiveFields,_0x155d3b)){_0x12c428[_0x155d3b]=_0x12c428[_0x155d3b][_0x71e9('0x141')](_0xc3f71d,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b78b946..597f703 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbd5=['../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc'];(function(_0x3a1ca7,_0x7a9e57){var _0x5d6b88=function(_0x3d07fa){while(--_0x3d07fa){_0x3a1ca7['push'](_0x3a1ca7['shift']());}};_0x5d6b88(++_0x7a9e57);}(_0xcbd5,0xfb));var _0x5cbd=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0xcbd5[_0x5d30b4];return _0x1acfb8;};'use strict';var jayson=require(_0x5cbd('0x0'));var BPromise=require(_0x5cbd('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0x5cbd('0x2')]=function(){return new BPromise(function(_0x5b9f45,_0x3247c0){var _0xeccdf3={};_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x4')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x5')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x6')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x7')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x8')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x9')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xa')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xb')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xc')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xd')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xe')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0xf')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x10')));_0xeccdf3=_['merge'](_0xeccdf3,require('../api/mailAccount/mailAccount.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x11')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x12')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x13')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x14')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x15')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/faxAccount/faxAccount.rpc'));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x16')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x17')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x18')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x19')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/smsAccount/smsAccount.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x1a')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/smsMessage/smsMessage.rpc'));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x1b')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x1c')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x1d')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/openchannelMessage/openchannelMessage.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x1e')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x1f')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x20')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x21')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x22')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x23')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/cmHopper/cmHopper.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x24')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x25')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x26')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x27')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/pause/pause.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x28')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x29')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x2a')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/variable/variable.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x2b')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x2c')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x2d')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x2e')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x2f')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x30')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x31')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x32')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x33')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x34')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x35')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x36')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x37')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x38')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/squareProject/squareProject.rpc'));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x39')));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x3a')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/campaign/campaign.rpc'));_0xeccdf3=_['merge'](_0xeccdf3,require(_0x5cbd('0x3b')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x3c')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x3d')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x3e')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x3f')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require(_0x5cbd('0x40')));_0xeccdf3=_[_0x5cbd('0x3')](_0xeccdf3,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4e5508=jayson['server'](_0xeccdf3)[_0x5cbd('0x41')]();var _0x10e317=config['rpc'][_0x5cbd('0x42')]||config['port']+0x1;var _0x2805da=config[_0x5cbd('0x43')]['ip']||_0x5cbd('0x44');_0x4e5508['on'](_0x5cbd('0x45'),function(_0xd6d830){return _0x3247c0(_0xd6d830);});_0x4e5508[_0x5cbd('0x2')](_0x10e317,_0x2805da,function(){console[_0x5cbd('0x46')](_0x5cbd('0x47'),_0x2805da,_0x10e317);require(_0x5cbd('0x48'))[_0x5cbd('0x49')]();return _0x5b9f45(_0x5cbd('0x4a')+_0x2805da+':'+_0x10e317);});});}; \ No newline at end of file +var _0x4823=['jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','port','localhost','error','log','RPC\x20listening\x20on\x20'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x4823,0xd8));var _0x3482=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x4823[_0x2ca2d0];return _0x521c23;};'use strict';var jayson=require(_0x3482('0x0'));var BPromise=require(_0x3482('0x1'));var _=require(_0x3482('0x2'));var config=require('../config/environment');exports[_0x3482('0x3')]=function(){return new BPromise(function(_0xc67110,_0x2f2dab){var _0x5db482={};_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x5')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x6')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/voiceQueue/voiceQueue.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x7')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x8')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x9')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0xa')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0xb')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0xc')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0xd')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0xe')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0xf')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x10')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x11')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/mailQueue/mailQueue.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x12')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/mailMessage/mailMessage.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x13')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x14')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/faxAccount/faxAccount.rpc'));_0x5db482=_['merge'](_0x5db482,require('../api/faxApplication/faxApplication.rpc'));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x15')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x16')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x17')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x18')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x19')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x1a')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x1b')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x1c')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x1d')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x1e')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x1f')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x20')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x21')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x22')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x23')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/cmContact/cmContact.rpc'));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x24')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x25')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x26')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x27')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x28')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x29')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x2a')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x2b')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/trigger/trigger.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x2c')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x2d')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x2e')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x2f')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x30')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x31')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x32')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x33')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x34')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x35')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x36')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x37')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x38')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x39')));_0x5db482=_['merge'](_0x5db482,require(_0x3482('0x3a')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x3b')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/squareProject/squareProject.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x3c')));_0x5db482=_['merge'](_0x5db482,require('../api/squareMessage/squareMessage.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x3d')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x3e')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x3f')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x40')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require(_0x3482('0x41')));_0x5db482=_[_0x3482('0x4')](_0x5db482,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5db482=_['merge'](_0x5db482,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4497d8=jayson[_0x3482('0x42')](_0x5db482)['http']();var _0x4a5f79=config['rpc'][_0x3482('0x43')]||config[_0x3482('0x43')]+0x1;var _0x127201=config['rpc']['ip']||_0x3482('0x44');_0x4497d8['on'](_0x3482('0x45'),function(_0x43c8e1){return _0x2f2dab(_0x43c8e1);});_0x4497d8[_0x3482('0x3')](_0x4a5f79,_0x127201,function(){console[_0x3482('0x46')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x127201,_0x4a5f79);require('../config/triggers')['default']();return _0xc67110(_0x3482('0x47')+_0x127201+':'+_0x4a5f79);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index f883d61..bf085d2 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0x2c4eff,_0x9d211c){var _0x57867b=function(_0x5b14fa){while(--_0x5b14fa){_0x2c4eff['push'](_0x2c4eff['shift']());}};_0x57867b(++_0x9d211c);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file +var _0x5eb8=['{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate'];(function(_0x25680f,_0x49646a){var _0x135948=function(_0x4b6ebe){while(--_0x4b6ebe){_0x25680f['push'](_0x25680f['shift']());}};_0x135948(++_0x49646a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x384447,_0x41669a){_0x384447=_0x384447-0x0;var _0x3810db=_0x5eb8[_0x384447];return _0x3810db;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57e9bc){return _0x57e9bc==='{{'?_0x85eb('0x0'):_0x85eb('0x1');}function safeTemplate(_0x393a8a){var _0xd2f5dc=_0x393a8a;if(typeof _0x393a8a===_0x85eb('0x2')){_0xd2f5dc=_0x393a8a[_0x85eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x85eb('0x4')](_0x393a8a)){_0xd2f5dc=_0x393a8a[_0x85eb('0x5')](function(_0x3c5798){return safeTemplate(_0x3c5798);});}else if(_[_0x85eb('0x6')](_0x393a8a)){_0xd2f5dc=Object[_0x85eb('0x7')](_0x393a8a)[_0x85eb('0x8')](function(_0x4a8814,_0x16d7b9){_0x4a8814[_0x16d7b9]=safeTemplate(_0x393a8a[_0x16d7b9]);return _0x4a8814;},{});}return _0xd2f5dc;}module[_0x85eb('0x9')][_0x85eb('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 9746bf6..3d195b1 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2186=['SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','replace','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','prototype','sync','answer','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','sendRequest','VERBOSE\x20\x22%s\x22','isArray','join','format','EXEC\x20%s\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits'];(function(_0x2f1f08,_0x158f35){var _0x32f365=function(_0x2cc60e){while(--_0x2cc60e){_0x2f1f08['push'](_0x2f1f08['shift']());}};_0x32f365(++_0x158f35);}(_0x2186,0x1ca));var _0x6218=function(_0x4be753,_0x9c5de9){_0x4be753=_0x4be753-0x0;var _0x447d0a=_0x2186[_0x4be753];return _0x447d0a;};'use strict';var util=require(_0x6218('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x6218('0x1'));var AGIError=require(_0x6218('0x2'));function AGIChannel(_0x2a138e){var _0x587b23=this,_0x10aa49=new AGIReply(),_0x1bc6b1=![],_0x2b0e28={};EventEmitter[_0x6218('0x3')](_0x587b23);_0x2a138e[_0x6218('0x4')]('utf8');_0x2a138e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x10aa49['setEncoding'](_0x6218('0x5'));_0x10aa49['on'](_0x6218('0x6'),function(_0x300ff1){for(var _0x345066 in _0x300ff1){_0x587b23[_0x345066]=_0x300ff1[_0x345066];}_0x587b23[_0x6218('0x7')]('ready');});_0x10aa49['on'](_0x6218('0x8'),function(_0xcbd3c2){if(_0xcbd3c2[_0x6218('0x9')]()==_0x6218('0xa')){_0x587b23[_0x6218('0x7')](_0x6218('0xa'));return;}if(_0xcbd3c2[_0x6218('0xb')](0x0,0xb)=='520-Invalid'){_0x1bc6b1=!![];}if(_0x1bc6b1){_0x2b0e28['rx']+=_0xcbd3c2+'\x0a';if(_0xcbd3c2[_0x6218('0xc')](_0x6218('0xd'))!=-0x1){_0x1bc6b1=![];}}else{_0x2b0e28['rx']=_0xcbd3c2;}if(_0x1bc6b1){return;}if(typeof _0x2b0e28['cb']==_0x6218('0xe')){var _0x432b92=_0x2b0e28['rx']['substring'](0x0,0x3),_0x4e4c17=null,_0x5e1a69=null;_0x432b92=parseInt(_0x432b92);if(isNaN(_0x432b92)){_0x2b0e28['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x432b92!=0xc8){_0x2b0e28['cb'](null,{'code':_0x432b92,'result':-0x1,'extra':'KO'});return;}_0x4e4c17=_0x2b0e28['rx'][_0x6218('0xb')](0x4)[_0x6218('0xf')]('result=','');if(_0x4e4c17[_0x6218('0x10')]('\x20')!=-0x1){_0x4e4c17=_0x4e4c17[_0x6218('0x11')](0x0,_0x4e4c17['indexOf']('\x20'));}if(_[_0x6218('0x12')](_0x4e4c17,'-1')){_0x4e4c17=parseInt(_0x4e4c17);}_0x5e1a69=_0x2b0e28['rx'][_0x6218('0x13')]('\x20');if(_0x5e1a69[_0x6218('0x14')]==0x3){_0x5e1a69=_0x5e1a69[0x2][_0x6218('0xb')](0x1,_0x5e1a69[0x2]['length']-0x1);}else if(_0x5e1a69[_0x6218('0x14')]>0x3){var _0x416655=/\((.+)\)/;var _0x15f297=_0x2b0e28['rx'][_0x6218('0x15')](_0x416655);if(_0x15f297){_0x5e1a69=_0x15f297[0x1];}else{_0x5e1a69=null;}}else{_0x5e1a69=null;}_0x2b0e28['cb'](null,{'code':_0x432b92,'result':_0x4e4c17,'extra':_0x5e1a69});}});_0x2a138e['on'](_0x6218('0x16'),function(_0x4825ef){_0x587b23[_0x6218('0x7')](_0x6218('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x4825ef[_0x6218('0x17')]));});_0x2a138e['on'](_0x6218('0x18'),function(){_0x587b23['emit'](_0x6218('0x18'),new AGIError(_0x6218('0x19')));});_0x2a138e['on'](_0x6218('0x1a'),function(){_0x587b23[_0x6218('0x7')]('timeout',new AGIError(_0x6218('0x1b')));_0x2a138e[_0x6218('0x1c')]();});_0x2a138e[_0x6218('0x1d')](_0x10aa49);this['command']=function(_0x58732a,_0x4c84f8){var _0x58732a=_0x58732a||'',_0x4c84f8=typeof _0x4c84f8==_0x6218('0xe')?_0x4c84f8:new Function();_0x2b0e28={'tx':_0x58732a,'rx':'','cb':_0x4c84f8};_0x2a138e[_0x6218('0x1e')](_0x58732a+'\x0a');},this[_0x6218('0x18')]=function(){_0x2a138e[_0x6218('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x6218('0x1f')]['sendRequest']=function(_0x514f43){return this['command'][_0x6218('0x20')](this,_0x514f43);};AGIChannel['prototype'][_0x6218('0x21')]=function(){return this['sendRequest'](_0x6218('0x22'));};AGIChannel['prototype'][_0x6218('0x23')]=function(_0x26ecf4,_0x5704ee,_0x596e67){_0x26ecf4=_0x26ecf4===undefined?'beep':_0x26ecf4;_0x5704ee=_0x5704ee===undefined?'5':_0x5704ee;_0x596e67=_0x596e67===undefined?'1':_0x596e67;return this['sendRequest'](util['format'](_0x6218('0x24'),_0x26ecf4,_0x5704ee*0x3e8,_0x596e67));};AGIChannel['prototype']['noop']=function(_0x32e19c){_0x32e19c=_0x32e19c||_0x6218('0x25');return this[_0x6218('0x26')](util['format'](_0x6218('0x27'),_0x32e19c));};AGIChannel[_0x6218('0x1f')]['exec']=function(_0x503186,_0x23a0f1){if(_[_0x6218('0x28')](_0x23a0f1)){return this[_0x6218('0x26')](util['format']('EXEC\x20%s\x20%s',_0x503186,_0x23a0f1[_0x6218('0x29')](',')));}return this[_0x6218('0x26')](util[_0x6218('0x2a')](_0x6218('0x2b'),_0x503186,_0x23a0f1));};AGIChannel['prototype']['setContext']=function(_0x518578){return this['sendRequest'](util[_0x6218('0x2a')]('SET\x20CONTEXT\x20%s',_0x518578));};AGIChannel['prototype'][_0x6218('0x2c')]=function(_0x2c4378){return this[_0x6218('0x26')](util[_0x6218('0x2a')]('SET\x20EXTENSION\x20%s',_0x2c4378));};AGIChannel[_0x6218('0x1f')][_0x6218('0x2d')]=function(_0x36ac38){return this['sendRequest'](util[_0x6218('0x2a')](_0x6218('0x2e'),_0x36ac38));};AGIChannel[_0x6218('0x1f')][_0x6218('0xa')]=function(){return this[_0x6218('0x26')]('HANGUP');};AGIChannel[_0x6218('0x1f')]['setVariable']=function(_0x2b643f,_0x40534e){var _0x44fb5b=_['isBoolean'](_0x40534e)||_[_0x6218('0x2f')](_0x40534e)?_0x40534e[_0x6218('0x30')]():_0x40534e;return this[_0x6218('0x26')](util['format'](_0x6218('0x31'),_0x2b643f,_0x44fb5b?_0x44fb5b['toString']()[_0x6218('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x6218('0x32')]=function(_0x198eb2,_0x4a7722){return this[_0x6218('0x26')](util['format'](_0x6218('0x33'),_0x198eb2,_0x4a7722));};AGIChannel[_0x6218('0x1f')][_0x6218('0x34')]=function(_0x46b0bb,_0x18e468){return this[_0x6218('0x26')](util[_0x6218('0x2a')](_0x6218('0x35'),_0x46b0bb,_0x18e468));};AGIChannel[_0x6218('0x1f')][_0x6218('0x36')]=function(_0x2129ac,_0x5393bd){return this[_0x6218('0x26')](util['format'](_0x6218('0x37'),_0x2129ac,_0x5393bd));};AGIChannel['prototype']['continueAt']=function(_0xb1f894,_0x2af08f,_0x4cccbf){_0x2af08f=_0x2af08f||this[_0x6218('0x38')];_0x4cccbf=_0x4cccbf||0x1;this[_0x6218('0x39')](_0xb1f894);this[_0x6218('0x2c')](_0x2af08f);this[_0x6218('0x2d')](_0x4cccbf);return this[_0x6218('0x3a')](util[_0x6218('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0xb1f894,_0x2af08f,_0x4cccbf));};AGIChannel[_0x6218('0x1f')][_0x6218('0x3b')]=function(_0x41d2ae){return this[_0x6218('0x26')](util[_0x6218('0x2a')](_0x6218('0x3c'),_0x41d2ae));};AGIChannel[_0x6218('0x1f')][_0x6218('0x3d')]=function(_0x53e729,_0x4c8196,_0x43fb88,_0x2e2d04,_0x4029f9,_0x451006){_0x4c8196=_0x4c8196||_0x6218('0x3e');_0x43fb88=_0x43fb88||'';_0x2e2d04=_0x2e2d04===undefined?-0x1:_0x2e2d04==='-1'?-0x1:_0x2e2d04*0x3e8;_0x4029f9=_0x4029f9===undefined?'':'s='+_0x4029f9;_0x451006=_0x451006?_0x6218('0x3f'):'';return this['sendRequest'](util['format'](_0x6218('0x40'),_0x53e729,_0x4c8196,_0x43fb88,_0x2e2d04,_0x451006,_0x4029f9));};AGIChannel[_0x6218('0x1f')][_0x6218('0x41')]=function(_0x548481,_0x1afeec){_0x1afeec=_0x1afeec||'';return this['sendRequest'](util[_0x6218('0x2a')](_0x6218('0x42'),_0x548481,_0x1afeec));};AGIChannel[_0x6218('0x1f')][_0x6218('0x43')]=function(_0x31b0e1){return this[_0x6218('0x44')](_0x6218('0x45'),_0x31b0e1);};AGIChannel[_0x6218('0x1f')][_0x6218('0x46')]=function(_0x49d042){return this['exec']('WAIT',_0x49d042);};AGIChannel[_0x6218('0x1f')][_0x6218('0x16')]=function(_0x1c1b18,_0x364731){this['noop'](util[_0x6218('0x2a')](_0x6218('0x47'),_0x1c1b18['id'],_0x1c1b18[_0x6218('0x48')],_0x364731));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x2b0a=['timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','call','setEncoding','utf8','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0x2b0a,0x84));var _0xa2b0=function(_0x3827c0,_0x37ce26){_0x3827c0=_0x3827c0-0x0;var _0x3643d0=_0x2b0a[_0x3827c0];return _0x3643d0;};'use strict';var util=require(_0xa2b0('0x0'));var _=require(_0xa2b0('0x1'));var EventEmitter=require('events')[_0xa2b0('0x2')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x539b10){var _0x545b81=this,_0x1f6a6e=new AGIReply(),_0x852694=![],_0x1a285a={};EventEmitter[_0xa2b0('0x3')](_0x545b81);_0x539b10[_0xa2b0('0x4')](_0xa2b0('0x5'));_0x539b10['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1f6a6e['setEncoding'](_0xa2b0('0x5'));_0x1f6a6e['on']('headers',function(_0x53be2f){for(var _0x1fb62b in _0x53be2f){_0x545b81[_0x1fb62b]=_0x53be2f[_0x1fb62b];}_0x545b81[_0xa2b0('0x6')](_0xa2b0('0x7'));});_0x1f6a6e['on'](_0xa2b0('0x8'),function(_0x1b3a5c){if(_0x1b3a5c[_0xa2b0('0x9')]()=='hangup'){_0x545b81[_0xa2b0('0x6')](_0xa2b0('0xa'));return;}if(_0x1b3a5c[_0xa2b0('0xb')](0x0,0xb)=='520-Invalid'){_0x852694=!![];}if(_0x852694){_0x1a285a['rx']+=_0x1b3a5c+'\x0a';if(_0x1b3a5c[_0xa2b0('0xc')](_0xa2b0('0xd'))!=-0x1){_0x852694=![];}}else{_0x1a285a['rx']=_0x1b3a5c;}if(_0x852694){return;}if(typeof _0x1a285a['cb']=='function'){var _0x42c56f=_0x1a285a['rx'][_0xa2b0('0xb')](0x0,0x3),_0x49ba7b=null,_0x13a45e=null;_0x42c56f=parseInt(_0x42c56f);if(isNaN(_0x42c56f)){_0x1a285a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa2b0('0xe')});return;}if(_0x42c56f!=0xc8){_0x1a285a['cb'](null,{'code':_0x42c56f,'result':-0x1,'extra':'KO'});return;}_0x49ba7b=_0x1a285a['rx'][_0xa2b0('0xb')](0x4)[_0xa2b0('0xf')](_0xa2b0('0x10'),'');if(_0x49ba7b[_0xa2b0('0x11')]('\x20')!=-0x1){_0x49ba7b=_0x49ba7b[_0xa2b0('0x12')](0x0,_0x49ba7b[_0xa2b0('0x11')]('\x20'));}if(_[_0xa2b0('0x13')](_0x49ba7b,'-1')){_0x49ba7b=parseInt(_0x49ba7b);}_0x13a45e=_0x1a285a['rx'][_0xa2b0('0x14')]('\x20');if(_0x13a45e[_0xa2b0('0x15')]==0x3){_0x13a45e=_0x13a45e[0x2]['substring'](0x1,_0x13a45e[0x2]['length']-0x1);}else if(_0x13a45e['length']>0x3){var _0xe2ed83=/\((.+)\)/;var _0x50632c=_0x1a285a['rx'][_0xa2b0('0x16')](_0xe2ed83);if(_0x50632c){_0x13a45e=_0x50632c[0x1];}else{_0x13a45e=null;}}else{_0x13a45e=null;}_0x1a285a['cb'](null,{'code':_0x42c56f,'result':_0x49ba7b,'extra':_0x13a45e});}});_0x539b10['on']('error',function(_0x6c07f1){_0x545b81[_0xa2b0('0x6')](_0xa2b0('0x17'),new AGIError(_0xa2b0('0x18'),_0x6c07f1[_0xa2b0('0x19')]));});_0x539b10['on'](_0xa2b0('0x1a'),function(){_0x545b81[_0xa2b0('0x6')]('close',new AGIError(_0xa2b0('0x1b')));});_0x539b10['on']('timeout',function(){_0x545b81[_0xa2b0('0x6')](_0xa2b0('0x1c'),new AGIError(_0xa2b0('0x1d')));_0x539b10[_0xa2b0('0x1e')]();});_0x539b10[_0xa2b0('0x1f')](_0x1f6a6e);this[_0xa2b0('0x20')]=function(_0x581946,_0x158172){var _0x581946=_0x581946||'',_0x158172=typeof _0x158172==_0xa2b0('0x21')?_0x158172:new Function();_0x1a285a={'tx':_0x581946,'rx':'','cb':_0x158172};_0x539b10[_0xa2b0('0x22')](_0x581946+'\x0a');},this['close']=function(){_0x539b10[_0xa2b0('0x1e')]();};}util[_0xa2b0('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x25')]=function(_0x2fdd99){return this[_0xa2b0('0x20')][_0xa2b0('0x26')](this,_0x2fdd99);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0xa2b0('0x27'));};AGIChannel[_0xa2b0('0x24')]['getData']=function(_0xda713a,_0x370570,_0x47033c){_0xda713a=_0xda713a===undefined?_0xa2b0('0x28'):_0xda713a;_0x370570=_0x370570===undefined?'5':_0x370570;_0x47033c=_0x47033c===undefined?'1':_0x47033c;return this['sendRequest'](util[_0xa2b0('0x29')](_0xa2b0('0x2a'),_0xda713a,_0x370570*0x3e8,_0x47033c));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x2b')]=function(_0x1ee72b){_0x1ee72b=_0x1ee72b||_0xa2b0('0x2c');return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')]('VERBOSE\x20\x22%s\x22',_0x1ee72b));};AGIChannel['prototype'][_0xa2b0('0x2d')]=function(_0x30cb7c,_0x595c79){if(_[_0xa2b0('0x2e')](_0x595c79)){return this['sendRequest'](util[_0xa2b0('0x29')](_0xa2b0('0x2f'),_0x30cb7c,_0x595c79[_0xa2b0('0x30')](',')));}return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x2f'),_0x30cb7c,_0x595c79));};AGIChannel['prototype'][_0xa2b0('0x31')]=function(_0x4713cd){return this[_0xa2b0('0x25')](util['format'](_0xa2b0('0x32'),_0x4713cd));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x33')]=function(_0x4577b9){return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x34'),_0x4577b9));};AGIChannel['prototype'][_0xa2b0('0x35')]=function(_0xe810f0){return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x36'),_0xe810f0));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0xa')]=function(){return this[_0xa2b0('0x25')](_0xa2b0('0x37'));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x38')]=function(_0x416982,_0x53c08e){var _0xbc2e7d=_[_0xa2b0('0x39')](_0x53c08e)||_[_0xa2b0('0x3a')](_0x53c08e)?_0x53c08e['toString']():_0x53c08e;return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x416982,_0xbc2e7d?_0xbc2e7d[_0xa2b0('0x3b')]()[_0xa2b0('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x3c')]=function(_0x511caa,_0x1c8c80){return this['sendRequest'](util['format'](_0xa2b0('0x3d'),_0x511caa,_0x1c8c80));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x3e')]=function(_0x3c108f,_0x9f79ac){return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x3f'),_0x3c108f,_0x9f79ac));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x40')]=function(_0xbed5e4,_0xe17331){return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x41'),_0xbed5e4,_0xe17331));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x42')]=function(_0x1d9535,_0x13db22,_0x135446){_0x13db22=_0x13db22||this[_0xa2b0('0x43')];_0x135446=_0x135446||0x1;this[_0xa2b0('0x31')](_0x1d9535);this[_0xa2b0('0x33')](_0x13db22);this[_0xa2b0('0x35')](_0x135446);return this[_0xa2b0('0x2b')](util[_0xa2b0('0x29')](_0xa2b0('0x44'),_0x1d9535,_0x13db22,_0x135446));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x45')]=function(_0x4cb041){return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')](_0xa2b0('0x46'),_0x4cb041));};AGIChannel['prototype'][_0xa2b0('0x47')]=function(_0x5e7919,_0x407190,_0x2ad9d1,_0x2f211f,_0x502c76,_0x24338f){_0x407190=_0x407190||'wav';_0x2ad9d1=_0x2ad9d1||'';_0x2f211f=_0x2f211f===undefined?-0x1:_0x2f211f==='-1'?-0x1:_0x2f211f*0x3e8;_0x502c76=_0x502c76===undefined?'':'s='+_0x502c76;_0x24338f=_0x24338f?_0xa2b0('0x48'):'';return this[_0xa2b0('0x25')](util['format'](_0xa2b0('0x49'),_0x5e7919,_0x407190,_0x2ad9d1,_0x2f211f,_0x24338f,_0x502c76));};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x4a')]=function(_0x3098f0,_0x430ab8){_0x430ab8=_0x430ab8||'';return this[_0xa2b0('0x25')](util[_0xa2b0('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3098f0,_0x430ab8));};AGIChannel[_0xa2b0('0x24')]['agi']=function(_0x3be737){return this[_0xa2b0('0x2d')]('AGI',_0x3be737);};AGIChannel[_0xa2b0('0x24')][_0xa2b0('0x4b')]=function(_0x596281){return this[_0xa2b0('0x2d')](_0xa2b0('0x4c'),_0x596281);};AGIChannel['prototype'][_0xa2b0('0x17')]=function(_0xcd1e5d,_0x361176){this[_0xa2b0('0x2b')](util['format'](_0xa2b0('0x4d'),_0xcd1e5d['id'],_0xcd1e5d[_0xa2b0('0x4e')],_0x361176));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xa2b0('0x4f')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 61afc7e..bc9165f 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ff0=['format','apply','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push'];(function(_0x123d3d,_0x114ea5){var _0x5707bf=function(_0x9e1a39){while(--_0x9e1a39){_0x123d3d['push'](_0x123d3d['shift']());}};_0x5707bf(++_0x114ea5);}(_0x1ff0,0x1a5));var _0x01ff=function(_0x353cc7,_0x11fbce){_0x353cc7=_0x353cc7-0x0;var _0x417206=_0x1ff0[_0x353cc7];return _0x417206;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x01ff('0x0'),'E_AGI_ARGUMENT_PORT':_0x01ff('0x1'),'E_AGI_SERVER_ERROR':_0x01ff('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x01ff('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x01ff('0x4'),'E_AGI_SOCKET_CLOSE':_0x01ff('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x01ff('0x6'),'E_AGI_COMMAND_EMPTY':_0x01ff('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x01ff('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x392325){var _0x392325=_0x392325||null,_0x11cc96=_0x11cc96||[],_0x5948d7=0x1,_0x5b8a2e='';if(!error[_0x392325]){_0x392325=_0x01ff('0x9');}_0x11cc96[_0x01ff('0xa')](error[_0x392325]);while(arguments[_0x5948d7]){_0x11cc96[_0x01ff('0xa')](arguments[_0x5948d7]);_0x5948d7++;}_0x5b8a2e=util[_0x01ff('0xb')][_0x01ff('0xc')](util,_0x11cc96);this[_0x01ff('0xd')]=_0x5b8a2e;this[_0x01ff('0xe')]=_0x392325;}module[_0x01ff('0xf')]=AGIError; \ No newline at end of file +var _0x2909=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x2909,0x194));var _0x9290=function(_0x1d49fa,_0x3f3f77){_0x1d49fa=_0x1d49fa-0x0;var _0x5e5243=_0x2909[_0x1d49fa];return _0x5e5243;};'use strict';var util=require(_0x9290('0x0'));var error={'E_AGI_UNDEFINED':_0x9290('0x1'),'E_AGI_ARGUMENT_PORT':_0x9290('0x2'),'E_AGI_SERVER_ERROR':_0x9290('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x9290('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x9290('0x5'),'E_AGI_SOCKET_ERROR':_0x9290('0x6'),'E_AGI_SOCKET_CLOSE':_0x9290('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x9290('0x8'),'E_AGI_COMMAND_EMPTY':_0x9290('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x9290('0xa')};function AGIError(_0x43daa5){var _0x43daa5=_0x43daa5||null,_0xddb9e=_0xddb9e||[],_0x39c3f9=0x1,_0x15649c='';if(!error[_0x43daa5]){_0x43daa5=_0x9290('0xb');}_0xddb9e[_0x9290('0xc')](error[_0x43daa5]);while(arguments[_0x39c3f9]){_0xddb9e[_0x9290('0xc')](arguments[_0x39c3f9]);_0x39c3f9++;}_0x15649c=util[_0x9290('0xd')][_0x9290('0xe')](util,_0xddb9e);this['message']=_0x15649c;this[_0x9290('0xf')]=_0x43daa5;}module[_0x9290('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index bc3c8ad..8923a94 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba47=['lodash','agi','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','addEdge','size','vertices','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','target','invalid','agicommand','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0xba47,0xae));var _0x7ba4=function(_0x5d7852,_0x13ea6b){_0x5d7852=_0x5d7852-0x0;var _0x2da8c2=_0xba47[_0x5d7852];return _0x2da8c2;};'use strict';var _=require(_0x7ba4('0x0'));var logger=require('../../../config/logger')(_0x7ba4('0x1'));var verticesWithRetry=['menu',_0x7ba4('0x2'),_0x7ba4('0x3')];var Graph=function(){this['vertices']={};this[_0x7ba4('0x4')]={};this[_0x7ba4('0x5')]=0x0;};Graph[_0x7ba4('0x6')][_0x7ba4('0x7')]=function(_0x3b7f54){this['vertices'][_0x3b7f54['id']]=_0x3b7f54;this[_0x7ba4('0x4')][_0x3b7f54['id']]=[];};Graph[_0x7ba4('0x6')][_0x7ba4('0x8')]=function(_0x36ef8e,_0x1d0421,_0x366684){this[_0x7ba4('0x4')][_0x36ef8e]['push']({'target':_0x1d0421,'condition':_0x366684});this[_0x7ba4('0x5')]+=0x1;};Graph[_0x7ba4('0x6')][_0x7ba4('0x9')]=function(){return _[_0x7ba4('0x9')](this[_0x7ba4('0xa')]);};Graph[_0x7ba4('0x6')][_0x7ba4('0xb')]=function(){return this[_0x7ba4('0x5')];};Graph[_0x7ba4('0x6')][_0x7ba4('0xc')]=function(_0x4a67ec){return this['vertices'][_0x4a67ec];};Graph['prototype']['traverseBFS']=function(_0x1bde9c,_0x5a219d){if(!this[_0x7ba4('0xa')][_0x1bde9c]){return logger[_0x7ba4('0xd')](_0x7ba4('0xe'));}var _0x3a5519=_0x5a219d(this['vertices'][_0x1bde9c]);if(!_0x3a5519){return logger['info'](_0x7ba4('0xf'));}if(this['edges'][_0x1bde9c]['length']===0x0){return logger['info'](_0x7ba4('0x10'));}for(var _0x42201b=0x0,_0x2acb79=[],_0x33fda1=![];_0x42201b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./vertices','defaults','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','agicommand','hasOwnProperty','retry','addVertex','omit','isArray','length','target','addEdge','source','value','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell'];(function(_0x54f685,_0x54899f){var _0x2659d3=function(_0x530521){while(--_0x530521){_0x54f685['push'](_0x54f685['shift']());}};_0x2659d3(++_0x54899f);}(_0x904b,0x75));var _0xb904=function(_0xd3bbd0,_0x25e5f5){_0xd3bbd0=_0xd3bbd0-0x0;var _0x588ecf=_0x904b[_0xd3bbd0];return _0x588ecf;};'use strict';var parser=require('xml2json');var _=require(_0xb904('0x0'));var syncho=require(_0xb904('0x1'));var util=require('util');var moment=require(_0xb904('0x2'));var config=require(_0xb904('0x3'));var logger=require(_0xb904('0x4'))(_0xb904('0x5'));var utilLicense=require(_0xb904('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xb904('0x7'));var Graph=require('./graph');var Vertices=require(_0xb904('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xb904('0x5')]=_[_0xb904('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x114433){process[_0xb904('0xa')](function(){syncho(function(){try{setChannelVariables(_0x114433);agiHandler(_0x114433);}catch(_0x527aff){logger[_0xb904('0xb')](_0x527aff[_0xb904('0xc')]);}});});}function listeningHandler(){console[_0xb904('0xd')](_0xb904('0xe'),config['agi'][_0xb904('0xf')]);logger[_0xb904('0x10')](util[_0xb904('0x11')](_0xb904('0x12'),config['agi']['ip'],config['agi'][_0xb904('0xf')]));}function errorHandler(_0x2968a2){if(_0x2968a2&&_0x2968a2[_0xb904('0x13')]&&_0x2968a2[_0xb904('0x14')]){logger[_0xb904('0xb')](util[_0xb904('0x11')](_0xb904('0x15'),_0x2968a2[_0xb904('0x13')],_0x2968a2[_0xb904('0x14')]));}else{logger['error'](util[_0xb904('0x11')](_0xb904('0x16'),_0x2968a2['stack']));}}function closeHandler(){logger[_0xb904('0x10')](util[_0xb904('0x11')](_0xb904('0x17'),this[_0xb904('0x18')],this[_0xb904('0x19')],this[_0xb904('0x1a')],this[_0xb904('0x1b')],this[_0xb904('0x1c')]));try{createSquareReport(this);}catch(_0x31d7cf){logger['error'](_0x31d7cf[_0xb904('0xc')]);}}function timeoutHandler(){logger[_0xb904('0x10')](util['format'](_0xb904('0x1d'),this[_0xb904('0x18')],this['calleridname'],this['callerid'],this[_0xb904('0x1b')],this[_0xb904('0x1c')]));}function hangupHandler(){logger[_0xb904('0x10')](util[_0xb904('0x11')](_0xb904('0x1e'),this['arg_1'],this[_0xb904('0x19')],this[_0xb904('0x1a')],this[_0xb904('0x1b')],this['uniqueid']));this[_0xb904('0x1f')]=!![];}function getRoot(_0x512529){return parser['toJson'](_0x512529,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x26db37,_0x2ec728,_0x204b23){_0x2ec728[_0xb904('0x20')]=_0x204b23;if(_0x2ec728[_0xb904('0x21')](_0xb904('0x22'))){_0x2ec728['maxRetry']=parseInt(_0x2ec728[_0xb904('0x22')],0xa);}_0x26db37[_0xb904('0x23')](_[_0xb904('0x24')](_0x2ec728,'mxCell'));}function initGraph(_0x1328ca,_0x4b9d44){var _0x4901ee=new Graph();for(var _0x10340d in _0x1328ca){if(_0x1328ca[_0xb904('0x21')](_0x10340d)){if(_[_0xb904('0x25')](_0x1328ca[_0x10340d])){for(var _0x49a06a=0x0;_0x49a06a<_0x1328ca[_0x10340d][_0xb904('0x26')];_0x49a06a+=0x1){addVertex(_0x4901ee,_0x1328ca[_0x10340d][_0x49a06a],_0x10340d);}}else{addVertex(_0x4901ee,_0x1328ca[_0x10340d],_0x10340d);}}}for(var _0x58ff12=0x0;_0x58ff12<_0x4b9d44[_0xb904('0x26')];_0x58ff12+=0x1){if(_0x4b9d44[_0x58ff12]['source']&&_0x4b9d44[_0x58ff12][_0xb904('0x27')]){_0x4901ee[_0xb904('0x28')](_0x4b9d44[_0x58ff12][_0xb904('0x29')],_0x4b9d44[_0x58ff12]['target'],_0x4b9d44[_0x58ff12][_0xb904('0x2a')]);}}return _0x4901ee;}function getSquareProject(_0x478c86,_0x2ccffb){rpc['getSquareProject'](_0x478c86)[_0xb904('0x2b')](function(_0x3aed79){_0x2ccffb(null,_0x3aed79);})[_0xb904('0x2c')](function(_0x1bac20){_0x2ccffb(null,_0x1bac20);});}function createSquareReport(_0x502136,_0x29dfe7){rpc[_0xb904('0x2d')](_0x502136)[_0xb904('0x2b')](function(_0x2e30f3){if(_0x29dfe7){_0x29dfe7(null,_0x2e30f3);}})['catch'](function(_0x168183){if(_0x29dfe7){_0x29dfe7(null,_0x168183);}});}function setChannelVariables(_0x46153a){for(var _0x2a8fe7 in _0x46153a){if(_0x46153a['hasOwnProperty'](_0x2a8fe7)){if(_0x2a8fe7[_0xb904('0x2e')](_0xb904('0x2f'))===0x0){_0x46153a[_0x2a8fe7[_0xb904('0x30')](0x4)]=_0x46153a[_0x2a8fe7];delete _0x46153a[_0x2a8fe7];}}}}function getLogFromObject(_0x218b94){return util[_0xb904('0x31')](_0x218b94,{'showHidden':![],'depth':null});}function agiHandler(_0x2fc015){var _0x3865bb,_0x561f49,_0x421559,_0x59567a,_0x24dfc9;logger[_0xb904('0x32')](_0xb904('0x33'),JSON[_0xb904('0x34')](_0x2fc015,null,0x2));logger[_0xb904('0x10')](util[_0xb904('0x11')](_0xb904('0x35'),_0x2fc015[_0xb904('0x18')],_0x2fc015[_0xb904('0x19')],_0x2fc015[_0xb904('0x1a')],_0x2fc015['dnid'],_0x2fc015[_0xb904('0x1c')]));_0x2fc015['on'](_0xb904('0xb'),errorHandler);_0x2fc015['on'](_0xb904('0x36'),closeHandler);_0x2fc015['on']('timeout',timeoutHandler);_0x2fc015['evtHangup']=![];_0x2fc015['on'](_0xb904('0x37'),hangupHandler);var _0x319be6=getSquareProject[_0xb904('0x38')](null,_0x2fc015[_0xb904('0x18')]);if(_0x319be6){if(_0x319be6['production']){_0x3865bb=getRoot(_0x319be6['production']);if(_0x3865bb&&_0x3865bb[_0xb904('0x39')]){logger[_0xb904('0x32')]('root',JSON[_0xb904('0x34')](_0x3865bb,null,0x2));_0x2fc015[_0xb904('0x3a')]=moment()[_0xb904('0x11')](_0xb904('0x3b'));_0x561f49=initGraph(_[_0xb904('0x24')](_0x3865bb,_0xb904('0x3c')),_0x3865bb[_0xb904('0x3c')]);_0x421559=new Vertices(_0x2fc015,rpc,mailRpc);logger[_0xb904('0x10')](util[_0xb904('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2fc015[_0xb904('0x18')],_0x2fc015[_0xb904('0x19')],_0x2fc015[_0xb904('0x1a')],_0x2fc015['dnid'],_0x2fc015['uniqueid']));_0x561f49[_0xb904('0x3d')](_0x3865bb[_0xb904('0x39')]['id'],function(_0x20d78a){try{_0x20d78a=_0x421559[_0xb904('0x3e')](_0x20d78a);logger[_0xb904('0x32')](_0xb904('0x3f'),JSON['stringify'](_0x20d78a,null,0x2));if(_0x20d78a[_0xb904('0x20')]===_0xb904('0x40')){logger[_0xb904('0x10')](_0xb904('0x41'));_0x2fc015['context']=_0x20d78a[_0xb904('0x42')]||_0x2fc015[_0xb904('0x42')];_0x2fc015[_0xb904('0x43')]=_0x20d78a[_0xb904('0x43')];_0x2fc015[_0xb904('0x44')]=_0x20d78a[_0xb904('0x44')]?_0x20d78a[_0xb904('0x44')]-0x1:0x1;return null;}else if(_0x20d78a&&_0x421559[_0x20d78a['agicommand']]){_0x24dfc9=_0x421559[_0x20d78a[_0xb904('0x20')]](_0x20d78a);logger['info'](_0xb904('0x45'),JSON[_0xb904('0x34')](_0x24dfc9,null,0x2));if(_0x24dfc9&&_0x24dfc9[_0xb904('0x46')]===AGI_CODE_SUCCESS&&_0x24dfc9[_0xb904('0x47')]!==AGI_RESULT_ERROR&&!_0x2fc015['evtHangup']){logger[_0xb904('0x32')](_0xb904('0x45'),getLogFromObject(_0x24dfc9));return _[_0xb904('0x48')](_0x24dfc9['result'])?null:_0x24dfc9[_0xb904('0x47')][_0xb904('0x49')]();}else{logger[_0xb904('0xb')]('response',getLogFromObject(_0x24dfc9));return null;}}else{logger[_0xb904('0xb')](_0xb904('0x4a'));return null;}}catch(_0xd1f26){logger[_0xb904('0xb')](_0xd1f26[_0xb904('0xc')]);return null;}});if(_0x3865bb[_0xb904('0x4b')]){logger[_0xb904('0x10')](util['format'](_0xb904('0x4c'),_0x2fc015['arg_1'],_0x2fc015['calleridname'],_0x2fc015['callerid'],_0x2fc015['dnid'],_0x2fc015['uniqueid']));_0x561f49[_0xb904('0x3d')](_0x3865bb['finally']['id'],function(_0x25b69e){try{_0x25b69e=_0x421559[_0xb904('0x3e')](_0x25b69e);logger[_0xb904('0x32')]('vertex',JSON[_0xb904('0x34')](_0x25b69e,null,0x2));if(_0x25b69e&&_0x421559[_0x25b69e['agicommand']]){_0x24dfc9=_0x421559[_0x25b69e[_0xb904('0x20')]](_0x25b69e);if(_0x24dfc9){logger[_0xb904('0x32')](_0xb904('0x45'),getLogFromObject(_0x24dfc9));return _[_0xb904('0x48')](_0x24dfc9[_0xb904('0x47')])?null:_0x24dfc9[_0xb904('0x47')][_0xb904('0x49')]();}else{logger[_0xb904('0xb')]('response',getLogFromObject(_0x24dfc9));return null;}}else{logger[_0xb904('0xb')](_0xb904('0x4a'));return null;}}catch(_0x266466){logger[_0xb904('0xb')](_0x266466[_0xb904('0xc')]);return null;}});}logger[_0xb904('0x10')](util[_0xb904('0x11')](_0xb904('0x4d'),_0x2fc015[_0xb904('0x18')],_0x2fc015['calleridname'],_0x2fc015[_0xb904('0x1a')],_0x2fc015[_0xb904('0x1b')],_0x2fc015[_0xb904('0x1c')]));logger[_0xb904('0x10')](util['format'](_0xb904('0x4e'),_0x2fc015[_0xb904('0x42')],_0x2fc015[_0xb904('0x43')],parseInt(_0x2fc015[_0xb904('0x44')],0xa)+0x1));_0x2fc015[_0xb904('0x4f')](_0x2fc015[_0xb904('0x42')],_0x2fc015[_0xb904('0x43')],parseInt(_0x2fc015[_0xb904('0x44')],0xa)+0x1);_0x2fc015['close']();}}else{logger[_0xb904('0xb')](util[_0xb904('0x11')](_0xb904('0x50'),_0x2fc015['arg_1']));_0x2fc015[_0xb904('0x4f')](_0x2fc015['context'],_0x2fc015[_0xb904('0x43')],parseInt(_0x2fc015[_0xb904('0x44')],0xa)+0x1);_0x2fc015[_0xb904('0x36')]();}}else{logger[_0xb904('0xb')](util[_0xb904('0x11')](_0xb904('0x51'),_0x2fc015[_0xb904('0x18')]));_0x2fc015['continueAt'](_0x2fc015[_0xb904('0x42')],_0x2fc015[_0xb904('0x43')],parseInt(_0x2fc015[_0xb904('0x44')],0xa)+0x1);_0x2fc015['close']();}}function main(){var _0x24d846;return utilLicense['getLicense']()[_0xb904('0x2b')](function(_0x2454e9){if(_0x2454e9){if(_0x2454e9[_0xb904('0x52')]){if(_0x2454e9[_0xb904('0x53')]&&_0x2454e9['callysquare']>0x0){logger[_0xb904('0x10')](util[_0xb904('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x2454e9['callysquare']));_0x24d846=_0x2454e9[_0xb904('0x53')];}else{logger['info'](_0xb904('0x54'));}}else{logger[_0xb904('0x10')](_0xb904('0x55'));_0x24d846=-0x1;}}})[_0xb904('0x2c')](function(_0x1be003){logger[_0xb904('0xb')](_0xb904('0x56'),_0x1be003[_0xb904('0xc')]);})[_0xb904('0x4b')](function(){var _0x450e6e=require(_0xb904('0x57'))(config[_0xb904('0x5')][_0xb904('0xf')],config[_0xb904('0x5')]['ip'],_0x24d846);_0x450e6e['on'](_0xb904('0xb'),errorHandler);_0x450e6e['on'](_0xb904('0x58'),listeningHandler);_0x450e6e['on']('connection',connectionHandler);_0x450e6e['on'](_0xb904('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x16a4=['[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','production','start','debug','root','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','agi','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','error','stack','arg_1','calleridname','dnid','uniqueid'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x16a4,0x97));var _0x416a=function(_0x34b185,_0x36264b){_0x34b185=_0x34b185-0x0;var _0x2989f2=_0x16a4[_0x34b185];return _0x2989f2;};'use strict';var parser=require(_0x416a('0x0'));var _=require(_0x416a('0x1'));var syncho=require(_0x416a('0x2'));var util=require(_0x416a('0x3'));var moment=require(_0x416a('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x416a('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x416a('0x6'));var mailRpc=require(_0x416a('0x7'));var Graph=require(_0x416a('0x8'));var Vertices=require(_0x416a('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x416a('0x5')]=_[_0x416a('0xa')](config['agi'],{'ip':_0x416a('0xb'),'port':0x11dd});function connectionHandler(_0x5e0c2d){process[_0x416a('0xc')](function(){syncho(function(){try{setChannelVariables(_0x5e0c2d);agiHandler(_0x5e0c2d);}catch(_0x73f98b){logger['error'](_0x73f98b['stack']);}});});}function listeningHandler(){console[_0x416a('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x416a('0xe')]);logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x11'),config[_0x416a('0x5')]['ip'],config[_0x416a('0x5')]['port']));}function errorHandler(_0x447a98){if(_0x447a98&&_0x447a98[_0x416a('0x12')]&&_0x447a98[_0x416a('0x13')]){logger['error'](util[_0x416a('0x10')](_0x416a('0x14'),_0x447a98[_0x416a('0x12')],_0x447a98[_0x416a('0x13')]));}else{logger[_0x416a('0x15')](util[_0x416a('0x10')]('[ERROR]\x20%s',_0x447a98[_0x416a('0x16')]));}}function closeHandler(){logger[_0x416a('0xf')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x416a('0x17')],this[_0x416a('0x18')],this['callerid'],this[_0x416a('0x19')],this[_0x416a('0x1a')]));try{createSquareReport(this);}catch(_0x22fb9f){logger[_0x416a('0x15')](_0x22fb9f[_0x416a('0x16')]);}}function timeoutHandler(){logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x1b'),this[_0x416a('0x17')],this['calleridname'],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x416a('0xf')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x416a('0x17')],this[_0x416a('0x18')],this[_0x416a('0x1c')],this[_0x416a('0x19')],this[_0x416a('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x10bb49){return parser[_0x416a('0x1d')](_0x10bb49,{'object':!![]})[_0x416a('0x1e')]['root'];}function addVertex(_0x1e3ee2,_0x2af04a,_0x1859e5){_0x2af04a[_0x416a('0x1f')]=_0x1859e5;if(_0x2af04a[_0x416a('0x20')](_0x416a('0x21'))){_0x2af04a[_0x416a('0x22')]=parseInt(_0x2af04a[_0x416a('0x21')],0xa);}_0x1e3ee2[_0x416a('0x23')](_[_0x416a('0x24')](_0x2af04a,_0x416a('0x25')));}function initGraph(_0x148fa2,_0x591fd2){var _0x36f908=new Graph();for(var _0x42f70c in _0x148fa2){if(_0x148fa2[_0x416a('0x20')](_0x42f70c)){if(_[_0x416a('0x26')](_0x148fa2[_0x42f70c])){for(var _0x2a3b8e=0x0;_0x2a3b8e<_0x148fa2[_0x42f70c][_0x416a('0x27')];_0x2a3b8e+=0x1){addVertex(_0x36f908,_0x148fa2[_0x42f70c][_0x2a3b8e],_0x42f70c);}}else{addVertex(_0x36f908,_0x148fa2[_0x42f70c],_0x42f70c);}}}for(var _0x700e1d=0x0;_0x700e1d<_0x591fd2[_0x416a('0x27')];_0x700e1d+=0x1){if(_0x591fd2[_0x700e1d][_0x416a('0x28')]&&_0x591fd2[_0x700e1d]['target']){_0x36f908[_0x416a('0x29')](_0x591fd2[_0x700e1d][_0x416a('0x28')],_0x591fd2[_0x700e1d][_0x416a('0x2a')],_0x591fd2[_0x700e1d][_0x416a('0x2b')]);}}return _0x36f908;}function getSquareProject(_0x1c5acb,_0xc727a9){rpc[_0x416a('0x2c')](_0x1c5acb)[_0x416a('0x2d')](function(_0x5e52fe){_0xc727a9(null,_0x5e52fe);})['catch'](function(_0x456273){_0xc727a9(null,_0x456273);});}function createSquareReport(_0x5184ac,_0x4ffb6f){rpc[_0x416a('0x2e')](_0x5184ac)[_0x416a('0x2d')](function(_0x37aa4f){if(_0x4ffb6f){_0x4ffb6f(null,_0x37aa4f);}})[_0x416a('0x2f')](function(_0x169396){if(_0x4ffb6f){_0x4ffb6f(null,_0x169396);}});}function setChannelVariables(_0x1be312){for(var _0x4b9d8d in _0x1be312){if(_0x1be312[_0x416a('0x20')](_0x4b9d8d)){if(_0x4b9d8d[_0x416a('0x30')](_0x416a('0x31'))===0x0){_0x1be312[_0x4b9d8d['substring'](0x4)]=_0x1be312[_0x4b9d8d];delete _0x1be312[_0x4b9d8d];}}}}function getLogFromObject(_0x9659f5){return util[_0x416a('0x32')](_0x9659f5,{'showHidden':![],'depth':null});}function agiHandler(_0x5c0fc9){var _0xce7219,_0x43e619,_0x4848c0,_0x881649,_0x2d2950;logger['debug']('variables',JSON[_0x416a('0x33')](_0x5c0fc9,null,0x2));logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x34'),_0x5c0fc9[_0x416a('0x17')],_0x5c0fc9[_0x416a('0x18')],_0x5c0fc9[_0x416a('0x1c')],_0x5c0fc9['dnid'],_0x5c0fc9[_0x416a('0x1a')]));_0x5c0fc9['on']('error',errorHandler);_0x5c0fc9['on']('close',closeHandler);_0x5c0fc9['on'](_0x416a('0x35'),timeoutHandler);_0x5c0fc9['evtHangup']=![];_0x5c0fc9['on']('hangup',hangupHandler);var _0x271849=getSquareProject['sync'](null,_0x5c0fc9['arg_1']);if(_0x271849){if(_0x271849[_0x416a('0x36')]){_0xce7219=getRoot(_0x271849[_0x416a('0x36')]);if(_0xce7219&&_0xce7219[_0x416a('0x37')]){logger[_0x416a('0x38')](_0x416a('0x39'),JSON['stringify'](_0xce7219,null,0x2));_0x5c0fc9[_0x416a('0x3a')]=moment()[_0x416a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x43e619=initGraph(_['omit'](_0xce7219,_0x416a('0x25')),_0xce7219['mxCell']);_0x4848c0=new Vertices(_0x5c0fc9,rpc,mailRpc);logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x3b'),_0x5c0fc9[_0x416a('0x17')],_0x5c0fc9[_0x416a('0x18')],_0x5c0fc9[_0x416a('0x1c')],_0x5c0fc9[_0x416a('0x19')],_0x5c0fc9[_0x416a('0x1a')]));_0x43e619[_0x416a('0x3c')](_0xce7219[_0x416a('0x37')]['id'],function(_0x212434){try{_0x212434=_0x4848c0[_0x416a('0x3d')](_0x212434);logger[_0x416a('0x38')](_0x416a('0x3e'),JSON[_0x416a('0x33')](_0x212434,null,0x2));if(_0x212434[_0x416a('0x1f')]===_0x416a('0x3f')){logger[_0x416a('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5c0fc9[_0x416a('0x40')]=_0x212434[_0x416a('0x40')]||_0x5c0fc9[_0x416a('0x40')];_0x5c0fc9['extension']=_0x212434[_0x416a('0x41')];_0x5c0fc9['priority']=_0x212434['priority']?_0x212434[_0x416a('0x42')]-0x1:0x1;return null;}else if(_0x212434&&_0x4848c0[_0x212434['agicommand']]){_0x2d2950=_0x4848c0[_0x212434[_0x416a('0x1f')]](_0x212434);logger[_0x416a('0xf')](_0x416a('0x43'),JSON[_0x416a('0x33')](_0x2d2950,null,0x2));if(_0x2d2950&&_0x2d2950[_0x416a('0x44')]===AGI_CODE_SUCCESS&&_0x2d2950[_0x416a('0x45')]!==AGI_RESULT_ERROR&&!_0x5c0fc9[_0x416a('0x46')]){logger['debug'](_0x416a('0x43'),getLogFromObject(_0x2d2950));return _[_0x416a('0x47')](_0x2d2950[_0x416a('0x45')])?null:_0x2d2950[_0x416a('0x45')][_0x416a('0x48')]();}else{logger[_0x416a('0x15')](_0x416a('0x43'),getLogFromObject(_0x2d2950));return null;}}else{logger[_0x416a('0x15')](_0x416a('0x49'));return null;}}catch(_0x16c935){logger[_0x416a('0x15')](_0x16c935[_0x416a('0x16')]);return null;}});if(_0xce7219['finally']){logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x4a'),_0x5c0fc9[_0x416a('0x17')],_0x5c0fc9[_0x416a('0x18')],_0x5c0fc9[_0x416a('0x1c')],_0x5c0fc9[_0x416a('0x19')],_0x5c0fc9['uniqueid']));_0x43e619[_0x416a('0x3c')](_0xce7219[_0x416a('0x4b')]['id'],function(_0x194819){try{_0x194819=_0x4848c0[_0x416a('0x3d')](_0x194819);logger[_0x416a('0x38')]('vertex',JSON[_0x416a('0x33')](_0x194819,null,0x2));if(_0x194819&&_0x4848c0[_0x194819[_0x416a('0x1f')]]){_0x2d2950=_0x4848c0[_0x194819[_0x416a('0x1f')]](_0x194819);if(_0x2d2950){logger[_0x416a('0x38')](_0x416a('0x43'),getLogFromObject(_0x2d2950));return _[_0x416a('0x47')](_0x2d2950['result'])?null:_0x2d2950[_0x416a('0x45')][_0x416a('0x48')]();}else{logger['error']('response',getLogFromObject(_0x2d2950));return null;}}else{logger[_0x416a('0x15')](_0x416a('0x49'));return null;}}catch(_0x5ee411){logger[_0x416a('0x15')](_0x5ee411[_0x416a('0x16')]);return null;}});}logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x4c'),_0x5c0fc9[_0x416a('0x17')],_0x5c0fc9[_0x416a('0x18')],_0x5c0fc9[_0x416a('0x1c')],_0x5c0fc9[_0x416a('0x19')],_0x5c0fc9[_0x416a('0x1a')]));logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x4d'),_0x5c0fc9[_0x416a('0x40')],_0x5c0fc9[_0x416a('0x41')],parseInt(_0x5c0fc9[_0x416a('0x42')],0xa)+0x1));_0x5c0fc9[_0x416a('0x4e')](_0x5c0fc9['context'],_0x5c0fc9[_0x416a('0x41')],parseInt(_0x5c0fc9[_0x416a('0x42')],0xa)+0x1);_0x5c0fc9['close']();}}else{logger['error'](util['format'](_0x416a('0x4f'),_0x5c0fc9[_0x416a('0x17')]));_0x5c0fc9[_0x416a('0x4e')](_0x5c0fc9[_0x416a('0x40')],_0x5c0fc9[_0x416a('0x41')],parseInt(_0x5c0fc9[_0x416a('0x42')],0xa)+0x1);_0x5c0fc9[_0x416a('0x50')]();}}else{logger[_0x416a('0x15')](util['format'](_0x416a('0x51'),_0x5c0fc9[_0x416a('0x17')]));_0x5c0fc9['continueAt'](_0x5c0fc9[_0x416a('0x40')],_0x5c0fc9['extension'],parseInt(_0x5c0fc9[_0x416a('0x42')],0xa)+0x1);_0x5c0fc9['close']();}}function main(){var _0x26c465;return utilLicense['getLicense']()[_0x416a('0x2d')](function(_0x121919){if(_0x121919){if(_0x121919['voice']){if(_0x121919['callysquare']&&_0x121919[_0x416a('0x52')]>0x0){logger[_0x416a('0xf')](util[_0x416a('0x10')](_0x416a('0x53'),_0x121919['callysquare']));_0x26c465=_0x121919['callysquare'];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x416a('0x54'));_0x26c465=-0x1;}}})[_0x416a('0x2f')](function(_0x3028a3){logger[_0x416a('0x15')](_0x416a('0x55'),_0x3028a3[_0x416a('0x16')]);})[_0x416a('0x4b')](function(){var _0x5c623a=require(_0x416a('0x56'))(config['agi'][_0x416a('0xe')],config[_0x416a('0x5')]['ip'],_0x26c465);_0x5c623a['on'](_0x416a('0x15'),errorHandler);_0x5c623a['on'](_0x416a('0x57'),listeningHandler);_0x5c623a['on'](_0x416a('0x58'),connectionHandler);_0x5c623a['on'](_0x416a('0x50'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index ae1bd31..65d9033 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabbb=['bluebird','jayson/promise','http','then','error','message','result','catch','sendMailMessage'];(function(_0x4ba611,_0x2efb0f){var _0x5e5f48=function(_0x490cd6){while(--_0x490cd6){_0x4ba611['push'](_0x4ba611['shift']());}};_0x5e5f48(++_0x2efb0f);}(_0xabbb,0xc6));var _0xbabb=function(_0x3d1da,_0x36346d){_0x3d1da=_0x3d1da-0x0;var _0x4b1a7a=_0xabbb[_0x3d1da];return _0x4b1a7a;};'use strict';var BPromise=require(_0xbabb('0x0'));var jayson=require(_0xbabb('0x1'));var client=jayson['client'][_0xbabb('0x2')]({'port':0x232b});function request(_0x20ef01,_0x33be94){return new BPromise(function(_0x89cc92,_0x2ce5d4){return client['request'](_0x20ef01,_0x33be94)[_0xbabb('0x3')](function(_0x279c10){if(_0x279c10[_0xbabb('0x4')]){return _0x2ce5d4(_0x279c10[_0xbabb('0x4')][_0xbabb('0x5')]);}else{return _0x89cc92(_0x279c10[_0xbabb('0x6')]);}})[_0xbabb('0x7')](function(_0x23ab94){return _0x2ce5d4(_0x23ab94);});});}exports[_0xbabb('0x8')]=function(_0xd3c914,_0x438edb){return request('SendMail',{'account':_0xd3c914,'message':_0x438edb});}; \ No newline at end of file +var _0x1ca7=['catch','SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result'];(function(_0x5f4ec0,_0x1092e7){var _0xa57cc6=function(_0x1f0f55){while(--_0x1f0f55){_0x5f4ec0['push'](_0x5f4ec0['shift']());}};_0xa57cc6(++_0x1092e7);}(_0x1ca7,0x199));var _0x71ca=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1ca7[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x71ca('0x0'));var jayson=require(_0x71ca('0x1'));var client=jayson[_0x71ca('0x2')][_0x71ca('0x3')]({'port':0x232b});function request(_0x34b4ad,_0x72361a){return new BPromise(function(_0x1aa145,_0x5e81da){return client[_0x71ca('0x4')](_0x34b4ad,_0x72361a)[_0x71ca('0x5')](function(_0xc4909d){if(_0xc4909d[_0x71ca('0x6')]){return _0x5e81da(_0xc4909d[_0x71ca('0x6')][_0x71ca('0x7')]);}else{return _0x1aa145(_0xc4909d[_0x71ca('0x8')]);}})[_0x71ca('0x9')](function(_0x2c4ab5){return _0x5e81da(_0x2c4ab5);});});}exports['sendMailMessage']=function(_0x35f490,_0x58808b){return request(_0x71ca('0xa'),{'account':_0x35f490,'message':_0x58808b});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 533ade9..601f8bd 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x069d=['_inBody','indexOf','substring','length','split','slice','trim','emit','line','exports','util','Transform','call','_localBuffer','inherits','prototype','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x069d,0x11a));var _0xd069=function(_0x58bd2b,_0x12b115){_0x58bd2b=_0x58bd2b-0x0;var _0x4be40a=_0x069d[_0x58bd2b];return _0x4be40a;};'use strict';var util=require(_0xd069('0x0'));var Transform=require('stream')[_0xd069('0x1')];function AGIReply(_0x53f389){Transform[_0xd069('0x2')](this,_0x53f389);this[_0xd069('0x3')]='';this['_inBody']=![];}util[_0xd069('0x4')](AGIReply,Transform);AGIReply[_0xd069('0x5')]['_transform']=function(_0xd3aedc,_0x3f89a5,_0x50ee01){var _0x2935b6='\x0a',_0x349aaf=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x539b81=-0x1,_0x12428d=-0x1,_0x1c04de='',_0x471c44=0x0,_0x5c100b='',_0x55847f='';this[_0xd069('0x3')]+=_0xd3aedc[_0xd069('0x6')]();_0x5c100b=this[_0xd069('0x3')];if(!this[_0xd069('0x7')]){_0x471c44=0x0;while(_0x349aaf[_0x471c44]){while((_0x12428d=_0x5c100b[_0xd069('0x8')](_0x349aaf[_0x471c44]))!=-0x1){_0x1c04de=_0x349aaf[_0x471c44];_0x55847f=_0x5c100b[_0xd069('0x9')](0x0,_0x12428d);_0x5c100b=_0x5c100b[_0xd069('0x9')](_0x12428d+_0x1c04de[_0xd069('0xa')]);var _0x9ebed7=_0x55847f[_0xd069('0xb')](_0x2935b6),_0x18fbc1=0x0,_0x3f7d18={},_0x1f67d4='',_0x23ed36='',_0x568227=-0x1;while(_0x9ebed7[_0x18fbc1]){_0x568227=_0x9ebed7[_0x18fbc1]['indexOf'](':');if(_0x568227!=-0x1){_0x1f67d4=_0x9ebed7[_0x18fbc1][_0xd069('0xc')](0x0,_0x568227)[_0xd069('0xd')]();_0x23ed36=_0x9ebed7[_0x18fbc1][_0xd069('0xc')](_0x568227+0x1)[_0xd069('0xd')]();if(_0x1f67d4[_0xd069('0xa')]>0x0){_0x3f7d18[_0x1f67d4]=_0x23ed36;}}else{}_0x18fbc1++;}this[_0xd069('0xe')]('headers',_0x3f7d18);this[_0xd069('0x7')]=!![];}_0x471c44++;}this['_localBuffer']=_0x5c100b;}else{while((_0x539b81=_0x5c100b[_0xd069('0x8')](_0x2935b6))!=-0x1){_0x55847f=_0x5c100b[_0xd069('0x9')](0x0,_0x539b81);this['emit'](_0xd069('0xf'),_0x55847f);_0x5c100b=_0x5c100b[_0xd069('0x9')](_0x539b81+_0x2935b6[_0xd069('0xa')]);}this[_0xd069('0x3')]=_0x5c100b;}_0x50ee01();};module[_0xd069('0x10')]=AGIReply; \ No newline at end of file +var _0xe387=['headers','line','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','slice','trim'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe387,0x92));var _0x7e38=function(_0x5c9239,_0x1bfc1b){_0x5c9239=_0x5c9239-0x0;var _0x1f7d0d=_0xe387[_0x5c9239];return _0x1f7d0d;};'use strict';var util=require('util');var Transform=require(_0x7e38('0x0'))[_0x7e38('0x1')];function AGIReply(_0x16d454){Transform[_0x7e38('0x2')](this,_0x16d454);this[_0x7e38('0x3')]='';this[_0x7e38('0x4')]=![];}util[_0x7e38('0x5')](AGIReply,Transform);AGIReply[_0x7e38('0x6')][_0x7e38('0x7')]=function(_0x1b108a,_0x1db240,_0x17d118){var _0x1c20d6='\x0a',_0x5643d5=['\x0a\x0a',_0x7e38('0x8')],_0x2fce00=-0x1,_0x5509c3=-0x1,_0x21dcd6='',_0x1d4370=0x0,_0x208691='',_0x4a71e9='';this[_0x7e38('0x3')]+=_0x1b108a['toString']();_0x208691=this[_0x7e38('0x3')];if(!this[_0x7e38('0x4')]){_0x1d4370=0x0;while(_0x5643d5[_0x1d4370]){while((_0x5509c3=_0x208691[_0x7e38('0x9')](_0x5643d5[_0x1d4370]))!=-0x1){_0x21dcd6=_0x5643d5[_0x1d4370];_0x4a71e9=_0x208691[_0x7e38('0xa')](0x0,_0x5509c3);_0x208691=_0x208691[_0x7e38('0xa')](_0x5509c3+_0x21dcd6[_0x7e38('0xb')]);var _0x4d5f34=_0x4a71e9['split'](_0x1c20d6),_0x230989=0x0,_0x4ec9c6={},_0x219625='',_0x16d182='',_0xa71b95=-0x1;while(_0x4d5f34[_0x230989]){_0xa71b95=_0x4d5f34[_0x230989]['indexOf'](':');if(_0xa71b95!=-0x1){_0x219625=_0x4d5f34[_0x230989][_0x7e38('0xc')](0x0,_0xa71b95)[_0x7e38('0xd')]();_0x16d182=_0x4d5f34[_0x230989][_0x7e38('0xc')](_0xa71b95+0x1)[_0x7e38('0xd')]();if(_0x219625['length']>0x0){_0x4ec9c6[_0x219625]=_0x16d182;}}else{}_0x230989++;}this['emit'](_0x7e38('0xe'),_0x4ec9c6);this['_inBody']=!![];}_0x1d4370++;}this[_0x7e38('0x3')]=_0x208691;}else{while((_0x2fce00=_0x208691[_0x7e38('0x9')](_0x1c20d6))!=-0x1){_0x4a71e9=_0x208691[_0x7e38('0xa')](0x0,_0x2fce00);this['emit'](_0x7e38('0xf'),_0x4a71e9);_0x208691=_0x208691[_0x7e38('0xa')](_0x2fce00+_0x1c20d6['length']);}this['_localBuffer']=_0x208691;}_0x17d118();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ecf82ef..6982be0 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe87f=['lodash','util','jayson/promise','request','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','email','getSquareProjectById','name','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment'];(function(_0x3499dd,_0x55136a){var _0x488aa5=function(_0x1a4feb){while(--_0x1a4feb){_0x3499dd['push'](_0x3499dd['shift']());}};_0x488aa5(++_0x55136a);}(_0xe87f,0x187));var _0xfe87=function(_0x175e9b,_0x4bdc82){_0x175e9b=_0x175e9b-0x0;var _0x4f07f3=_0xe87f[_0x175e9b];return _0x4f07f3;};'use strict';var BPromise=require('bluebird');var moment=require(_0xfe87('0x0'));var _=require(_0xfe87('0x1'));var util=require(_0xfe87('0x2'));var jayson=require(_0xfe87('0x3'));var client=jayson['client']['http']({'port':0x2329});function request(_0xfc0ad3,_0x425cb9){return new BPromise(function(_0x7e7398,_0x964840){return client[_0xfe87('0x4')](_0xfc0ad3,_0x425cb9)['then'](function(_0x35d269){if(_0x35d269[_0xfe87('0x5')]){return _0x964840(_0x35d269[_0xfe87('0x5')]['message']);}else{return _0x7e7398(_0x35d269[_0xfe87('0x6')]);}})[_0xfe87('0x7')](function(_0x30acd6){return _0x964840(_0x30acd6);});});}exports[_0xfe87('0x8')]=function(_0x114408){return request(_0xfe87('0x9'),{'options':{'raw':![],'where':{'name':_0x114408},'attributes':[_0xfe87('0xa')]}});};exports[_0xfe87('0xb')]=function(_0x916e89){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x916e89},'include':[{'model':_0xfe87('0xc'),'as':'Smtp'}],'attributes':['id','name',_0xfe87('0xd')]}});};exports[_0xfe87('0xe')]=function(_0x48066d){return request('ShowSquareProject',{'options':{'where':{'id':_0x48066d},'attributes':[_0xfe87('0xf')]}});};exports[_0xfe87('0x10')]=function(_0x226497){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x226497},'attributes':[_0xfe87('0xf')]}});};exports[_0xfe87('0x11')]=function(_0x49a125){return request(_0xfe87('0x12'),{'options':{'where':{'id':_0x49a125},'attributes':[_0xfe87('0xf')]}});};exports[_0xfe87('0x13')]=function(_0x5891d9){return request(_0xfe87('0x14'),{'options':{'where':{'id':_0x5891d9},'attributes':['dsn']}});};exports['getUserById']=function(_0x414b57){return request(_0xfe87('0x15'),{'options':{'where':{'id':_0x414b57},'attributes':['name']}});};exports[_0xfe87('0x16')]=function(_0x1722e6){return request(_0xfe87('0x17'),{'options':{'where':{'id':_0x1722e6},'attributes':['name']}});};exports[_0xfe87('0x18')]=function(_0x538eb2){return request(_0xfe87('0x19'),{'options':{'where':{'id':_0x538eb2},'attributes':['save_name']}});};exports[_0xfe87('0x1a')]=function(_0xc76fd7){return request(_0xfe87('0x1b'),{'options':{'raw':![],'where':{'id':_0xc76fd7},'include':[{'model':_0xfe87('0x1c'),'as':'Intervals'}]}});};exports[_0xfe87('0x1d')]=function(_0x14af87){return request(_0xfe87('0x1e'),{'options':{'where':{'id':_0x14af87},'attributes':['id','name']}});};exports[_0xfe87('0x1f')]=function(_0x552582){return request(_0xfe87('0x20'),{'body':_0x552582});};exports[_0xfe87('0x21')]=function(_0xdabbd1){return request('CreateSquareDetailsReport',{'body':_0xdabbd1});};exports[_0xfe87('0x22')]=function(_0x367c73){return request(_0xfe87('0x23'),{'body':_['merge'](_0x367c73,{'project_name':_0x367c73[_0xfe87('0x24')],'prev_project_name':_0x367c73['arg_2']||'','is_subproject':_0x367c73[_0xfe87('0x25')]?!![]:![],'leaveAt':moment()[_0xfe87('0x26')](_0xfe87('0x27'))})});};exports[_0xfe87('0x28')]=function(_0x5ba628){return request(_0xfe87('0x29'),{'body':_0x5ba628});};exports[_0xfe87('0x2a')]=function(_0xedbc67){return request('CreateSquareMessage',{'body':_0xedbc67});};exports[_0xfe87('0x2b')]=function(_0x3869b2){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3869b2['phone'],'ListId':_0x3869b2[_0xfe87('0x2c')]}}})[_0xfe87('0x2d')](function(_0x4a6b6f){if(_0x4a6b6f){return _0x4a6b6f;}return request(_0xfe87('0x2e'),{'body':_0x3869b2});});};exports[_0xfe87('0x2f')]=function(_0x4f2970){return request(_0xfe87('0x30'),{'options':{'where':{'id':_0x4f2970},'attributes':['name']}});};exports[_0xfe87('0x31')]=function(_0x5861be,_0x474c85){return request(_0xfe87('0x32'),{'body':{'interface':_0x474c85},'options':{'where':_0x5861be}});};exports[_0xfe87('0x33')]=function(_0x2a6b61,_0x56308f,_0x24ea71){return request('PauseUser',{'body':{'type':_0x56308f,'uniqueid':_0x24ea71},'options':{'where':_0x2a6b61}});};exports[_0xfe87('0x34')]=function(_0x458301){return request(_0xfe87('0x35'),{'body':{},'options':{'where':_0x458301}});};exports[_0xfe87('0x36')]=function(_0x1af323){return request(_0xfe87('0x37'),{'body':{},'options':{'where':_0x1af323}});}; \ No newline at end of file +var _0xae70=['UnpauseUser','bluebird','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','getSquareProjectById','name','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','LoginUser','agentPause','PauseUser','agentUnpause'];(function(_0x114572,_0x54f406){var _0x226ab3=function(_0x2a7e14){while(--_0x2a7e14){_0x114572['push'](_0x114572['shift']());}};_0x226ab3(++_0x54f406);}(_0xae70,0x145));var _0x0ae7=function(_0x1e2af5,_0xeeca7c){_0x1e2af5=_0x1e2af5-0x0;var _0x59a5bd=_0xae70[_0x1e2af5];return _0x59a5bd;};'use strict';var BPromise=require(_0x0ae7('0x0'));var moment=require(_0x0ae7('0x1'));var _=require(_0x0ae7('0x2'));var util=require(_0x0ae7('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x0ae7('0x4')][_0x0ae7('0x5')]({'port':0x2329});function request(_0x462e2d,_0x33c864){return new BPromise(function(_0xa544a7,_0x597fd1){return client[_0x0ae7('0x6')](_0x462e2d,_0x33c864)[_0x0ae7('0x7')](function(_0x114eaf){if(_0x114eaf[_0x0ae7('0x8')]){return _0x597fd1(_0x114eaf[_0x0ae7('0x8')][_0x0ae7('0x9')]);}else{return _0xa544a7(_0x114eaf[_0x0ae7('0xa')]);}})[_0x0ae7('0xb')](function(_0x2f1258){return _0x597fd1(_0x2f1258);});});}exports[_0x0ae7('0xc')]=function(_0x42684d){return request(_0x0ae7('0xd'),{'options':{'raw':![],'where':{'name':_0x42684d},'attributes':[_0x0ae7('0xe')]}});};exports[_0x0ae7('0xf')]=function(_0x583b78){return request(_0x0ae7('0x10'),{'options':{'raw':![],'where':{'id':_0x583b78},'include':[{'model':_0x0ae7('0x11'),'as':'Smtp'}],'attributes':['id','name','email']}});};exports[_0x0ae7('0x12')]=function(_0x8b197){return request(_0x0ae7('0xd'),{'options':{'where':{'id':_0x8b197},'attributes':[_0x0ae7('0x13')]}});};exports['getVoiceQueueById']=function(_0x83ccf5){return request(_0x0ae7('0x14'),{'options':{'where':{'id':_0x83ccf5},'attributes':['name']}});};exports['getVariableById']=function(_0x218be1){return request('ShowVariable',{'options':{'where':{'id':_0x218be1},'attributes':[_0x0ae7('0x13')]}});};exports[_0x0ae7('0x15')]=function(_0x8f9094){return request(_0x0ae7('0x16'),{'options':{'where':{'id':_0x8f9094},'attributes':[_0x0ae7('0x17')]}});};exports['getUserById']=function(_0x9ffe50){return request(_0x0ae7('0x18'),{'options':{'where':{'id':_0x9ffe50},'attributes':['name']}});};exports[_0x0ae7('0x19')]=function(_0x2b85a7){return request(_0x0ae7('0x1a'),{'options':{'where':{'id':_0x2b85a7},'attributes':[_0x0ae7('0x13')]}});};exports[_0x0ae7('0x1b')]=function(_0x34fa3e){return request(_0x0ae7('0x1c'),{'options':{'where':{'id':_0x34fa3e},'attributes':[_0x0ae7('0x1d')]}});};exports[_0x0ae7('0x1e')]=function(_0x5a580a){return request(_0x0ae7('0x1f'),{'options':{'raw':![],'where':{'id':_0x5a580a},'include':[{'model':_0x0ae7('0x20'),'as':'Intervals'}]}});};exports[_0x0ae7('0x21')]=function(_0xa79d1b){return request(_0x0ae7('0x22'),{'options':{'where':{'id':_0xa79d1b},'attributes':['id','name']}});};exports[_0x0ae7('0x23')]=function(_0x8eac66){return request('CreateSmsMessage',{'body':_0x8eac66});};exports[_0x0ae7('0x24')]=function(_0x3eb5ca){return request('CreateSquareDetailsReport',{'body':_0x3eb5ca});};exports['createSquareReport']=function(_0x1abcea){return request(_0x0ae7('0x25'),{'body':_[_0x0ae7('0x26')](_0x1abcea,{'project_name':_0x1abcea[_0x0ae7('0x27')],'prev_project_name':_0x1abcea[_0x0ae7('0x28')]||'','is_subproject':_0x1abcea[_0x0ae7('0x28')]?!![]:![],'leaveAt':moment()[_0x0ae7('0x29')](_0x0ae7('0x2a'))})});};exports['createSquareRecording']=function(_0xe5e090){return request(_0x0ae7('0x2b'),{'body':_0xe5e090});};exports['createSquareMessage']=function(_0x1f97cb){return request(_0x0ae7('0x2c'),{'body':_0x1f97cb});};exports[_0x0ae7('0x2d')]=function(_0x30e101){return request(_0x0ae7('0x2e'),{'options':{'raw':![],'where':{'phone':_0x30e101[_0x0ae7('0x2f')],'ListId':_0x30e101['ListId']}}})['then'](function(_0xf46ec6){if(_0xf46ec6){return _0xf46ec6;}return request(_0x0ae7('0x30'),{'body':_0x30e101});});};exports['getPauseById']=function(_0x25548f){return request('ShowPause',{'options':{'where':{'id':_0x25548f},'attributes':[_0x0ae7('0x13')]}});};exports['agentLogin']=function(_0x261d44,_0x2b93f3){return request(_0x0ae7('0x31'),{'body':{'interface':_0x2b93f3},'options':{'where':_0x261d44}});};exports[_0x0ae7('0x32')]=function(_0x2d611e,_0x524712,_0x3cb168){return request(_0x0ae7('0x33'),{'body':{'type':_0x524712,'uniqueid':_0x3cb168},'options':{'where':_0x2d611e}});};exports[_0x0ae7('0x34')]=function(_0x32bfee){return request(_0x0ae7('0x35'),{'body':{},'options':{'where':_0x32bfee}});};exports['agentLogout']=function(_0x931d82){return request('LogoutUser',{'body':{},'options':{'where':_0x931d82}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 61de1dd..7c37214 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafca=['exports','./polly'];(function(_0x3c76fc,_0x39e116){var _0x4755f5=function(_0x493e01){while(--_0x493e01){_0x3c76fc['push'](_0x3c76fc['shift']());}};_0x4755f5(++_0x39e116);}(_0xafca,0x1ef));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};var polly=require(_0xaafc('0x0'));var lex=require('./lex');module[_0xaafc('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x3981=['./polly','exports'];(function(_0xf919d1,_0x11561d){var _0x1c52c6=function(_0x43ccb1){while(--_0x43ccb1){_0xf919d1['push'](_0xf919d1['shift']());}};_0x1c52c6(++_0x11561d);}(_0x3981,0x144));var _0x1398=function(_0x2db10b,_0x2a85ae){_0x2db10b=_0x2db10b-0x0;var _0x1bc275=_0x3981[_0x2db10b];return _0x1bc275;};var polly=require(_0x1398('0x0'));var lex=require('./lex');module[_0x1398('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index f508000..b13e180 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['./lib/api'];(function(_0x7fa18a,_0x18859b){var _0x1b643f=function(_0x46ebc7){while(--_0x46ebc7){_0x7fa18a['push'](_0x7fa18a['shift']());}};_0x1b643f(++_0x18859b);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5f0a68,_0x27f1e8){_0x5f0a68=_0x5f0a68-0x0;var _0x53a805=_0xee5b[_0x5f0a68];return _0x53a805;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x516402,_0x2e97a4){var _0x51a2fe=function(_0x3a2b8e){while(--_0x3a2b8e){_0x516402['push'](_0x516402['shift']());}};_0x51a2fe(++_0x2e97a4);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 21a55dc..61ea3a1 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1c5665,_0x33d33c){var _0x169c1f=function(_0x4e6837){while(--_0x4e6837){_0x1c5665['push'](_0x1c5665['shift']());}};_0x169c1f(++_0x33d33c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x25ff52,_0x29d289){var _0x67038d=function(_0x490f91){while(--_0x490f91){_0x25ff52['push'](_0x25ff52['shift']());}};_0x67038d(++_0x29d289);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 0693be5..3100f95 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b22=['./lib/api','exports'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x8b22,0xf8));var _0x28b2=function(_0x5bda24,_0x183467){_0x5bda24=_0x5bda24-0x0;var _0x17586e=_0x8b22[_0x5bda24];return _0x17586e;};'use strict';var polly=require(_0x28b2('0x0'));module[_0x28b2('0x1')]=function(_0x363d6f,_0x45b079,_0x2c0b04,_0x49b691,_0x18c248,_0x26f9e9,_0x50df5a){return polly(_0x363d6f,_0x45b079,_0x2c0b04,_0x49b691,_0x18c248,_0x26f9e9,_0x50df5a);}; \ No newline at end of file +var _0x866f=['./lib/api'];(function(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0x866f,0x1e6));var _0xf866=function(_0x442d29,_0x11d4a1){_0x442d29=_0x442d29-0x0;var _0x45b441=_0x866f[_0x442d29];return _0x45b441;};'use strict';var polly=require(_0xf866('0x0'));module['exports']=function(_0x2aafbe,_0x32892b,_0x5eff5b,_0x401e64,_0x3efdb0,_0x3cd4e0,_0x598f16){return polly(_0x2aafbe,_0x32892b,_0x5eff5b,_0x401e64,_0x3efdb0,_0x3cd4e0,_0x598f16);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 5c81585..3eb6c1e 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7de2=['aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7de2,0x1b9));var _0x27de=function(_0x5c8ff2,_0x501f58){_0x5c8ff2=_0x5c8ff2-0x0;var _0x272632=_0x7de2[_0x5c8ff2];return _0x272632;};'use strict';var fs=require('fs');var path=require(_0x27de('0x0'));var BPromise=require(_0x27de('0x1'));var rs=require(_0x27de('0x2'));var AWS=require(_0x27de('0x3'));function pollyResult(_0x1e646c,_0x82d002,_0x3314ea){return new BPromise(function(_0x2c0379,_0x1e09dd){_0x1e646c[_0x27de('0x4')](_0x82d002,function(_0x56dac1,_0x5d7753){if(_0x56dac1){_0x1e09dd(_0x56dac1);}else if(_0x5d7753){if(_0x5d7753['AudioStream']instanceof Buffer){fs[_0x27de('0x5')](_0x3314ea,_0x5d7753[_0x27de('0x6')],function(_0x3c3a4e){if(_0x3c3a4e){_0x1e09dd(_0x3c3a4e);}else{_0x2c0379();}});}else{_0x1e09dd(new Error(_0x27de('0x7')));}}else{_0x1e09dd(new Error(_0x27de('0x8')));}});});}module['exports']=function(_0x570efa,_0x653916,_0x6c45e,_0x4c72df,_0x275ee5,_0x29e4fd,_0x155cb7){var _0x1fd48c=new AWS[(_0x27de('0x9'))]({'accessKeyId':_0x570efa,'secretAccessKey':_0x653916,'region':_0x6c45e});var _0x48bc18={'Text':_0x275ee5,'TextType':_0x29e4fd||_0x27de('0xa'),'OutputFormat':_0x27de('0xb'),'VoiceId':_0x4c72df};return pollyResult(_0x1fd48c,_0x48bc18,_0x155cb7);}; \ No newline at end of file +var _0x0b59=['text','mp3','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x4d048b,_0x2cc987){var _0x26ed6e=function(_0x5d8469){while(--_0x5d8469){_0x4d048b['push'](_0x4d048b['shift']());}};_0x26ed6e(++_0x2cc987);}(_0x0b59,0x16a));var _0x90b5=function(_0x541bb4,_0x27a859){_0x541bb4=_0x541bb4-0x0;var _0x280cdf=_0x0b59[_0x541bb4];return _0x280cdf;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x90b5('0x0'));function pollyResult(_0x5754bf,_0x5539c2,_0x5e14a7){return new BPromise(function(_0x3ae6bc,_0x59db1d){_0x5754bf['synthesizeSpeech'](_0x5539c2,function(_0x4407df,_0x3b43c6){if(_0x4407df){_0x59db1d(_0x4407df);}else if(_0x3b43c6){if(_0x3b43c6[_0x90b5('0x1')]instanceof Buffer){fs[_0x90b5('0x2')](_0x5e14a7,_0x3b43c6[_0x90b5('0x1')],function(_0x5e49fe){if(_0x5e49fe){_0x59db1d(_0x5e49fe);}else{_0x3ae6bc();}});}else{_0x59db1d(new Error(_0x90b5('0x3')));}}else{_0x59db1d(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x90b5('0x4')]=function(_0x2e76ac,_0x322bde,_0x41b604,_0x25a857,_0x566890,_0xd1bfd4,_0x1c17f1){var _0x343e87=new AWS[(_0x90b5('0x5'))]({'accessKeyId':_0x2e76ac,'secretAccessKey':_0x322bde,'region':_0x41b604});var _0x390610={'Text':_0x566890,'TextType':_0xd1bfd4||_0x90b5('0x6'),'OutputFormat':_0x90b5('0x7'),'VoiceId':_0x25a857};return pollyResult(_0x343e87,_0x390610,_0x1c17f1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index e3c372e..c216a00 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd67=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd67,0xf5));var _0x7cd6=function(_0x4b1051,_0x51f114){_0x4b1051=_0x4b1051-0x0;var _0x2bdab5=_0xcd67[_0x4b1051];return _0x2bdab5;};'use strict';var asr=require('./lib/api');module[_0x7cd6('0x0')]=function(_0x3bd9d7,_0xf053f8,_0x103118,_0x14ff97){return asr(_0x3bd9d7,_0xf053f8,_0x103118);}; \ No newline at end of file +var _0xddf8=['./lib/api','exports'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0xddf8,0xac));var _0x8ddf=function(_0x3eb4bb,_0x1b1c6d){_0x3eb4bb=_0x3eb4bb-0x0;var _0xa9427d=_0xddf8[_0x3eb4bb];return _0xa9427d;};'use strict';var asr=require(_0x8ddf('0x0'));module[_0x8ddf('0x1')]=function(_0x4b29e7,_0x57921a,_0x1d62c1,_0x192551){return asr(_0x4b29e7,_0x57921a,_0x1d62c1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 690b730..d9896b0 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd52d=['readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x488c74,_0x54a056){var _0x284625=function(_0x1a46cb){while(--_0x1a46cb){_0x488c74['push'](_0x488c74['shift']());}};_0x284625(++_0x54a056);}(_0xd52d,0x1c7));var _0xdd52=function(_0x3ff454,_0x463732){_0x3ff454=_0x3ff454-0x0;var _0x5cbf95=_0xd52d[_0x3ff454];return _0x5cbf95;};'use strict';var url=require('url');var BPromise=require(_0xdd52('0x0'));var fs=require('fs');var host=_0xdd52('0x1');module['exports']=function(_0x3bed6e,_0x52e3a8,_0x593052){return new BPromise(function(_0x1dfed5,_0x211062){var _0x30fb04;if(typeof _0x3bed6e!==_0xdd52('0x2')||_0x3bed6e[_0xdd52('0x3')]===0x0){return _0x211062(_0xdd52('0x4'));}if(typeof _0x52e3a8!==_0xdd52('0x2')||_0x52e3a8[_0xdd52('0x3')]===0x0){return _0x211062('key\x20should\x20be\x20a\x20string');}if(typeof _0x593052!==_0xdd52('0x5')&&(typeof _0x593052!==_0xdd52('0x2')||_0x593052[_0xdd52('0x3')]===0x0)){return _0x211062(_0xdd52('0x6'));}try{_0x30fb04=fs[_0xdd52('0x7')](_0x3bed6e)[_0xdd52('0x8')](_0xdd52('0x9'));}catch(_0x3e41e1){return _0x211062(_0x3e41e1);}return _0x1dfed5({'method':_0xdd52('0xa'),'uri':host+_0xdd52('0xb')+_0x52e3a8,'body':{'config':{'encoding':_0xdd52('0xc'),'sampleRateHertz':_0xdd52('0xd'),'languageCode':_0x593052},'audio':{'content':_0x30fb04}},'json':!![]});});}; \ No newline at end of file +var _0x04d0=['POST','LINEAR16','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x40af95,_0x1d5bea){var _0x3aac13=function(_0x5a3f96){while(--_0x5a3f96){_0x40af95['push'](_0x40af95['shift']());}};_0x3aac13(++_0x1d5bea);}(_0x04d0,0x10a));var _0x004d=function(_0x1e3da8,_0x2de75a){_0x1e3da8=_0x1e3da8-0x0;var _0x1239f0=_0x04d0[_0x1e3da8];return _0x1239f0;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x004d('0x0');module[_0x004d('0x1')]=function(_0x421661,_0x386bc3,_0x1c0219){return new BPromise(function(_0x5f000c,_0x516d73){var _0x2638dd;if(typeof _0x421661!=='string'||_0x421661[_0x004d('0x2')]===0x0){return _0x516d73(_0x004d('0x3'));}if(typeof _0x386bc3!=='string'||_0x386bc3[_0x004d('0x2')]===0x0){return _0x516d73(_0x004d('0x4'));}if(typeof _0x1c0219!=='undefined'&&(typeof _0x1c0219!==_0x004d('0x5')||_0x1c0219['length']===0x0)){return _0x516d73(_0x004d('0x6'));}try{_0x2638dd=fs[_0x004d('0x7')](_0x421661)[_0x004d('0x8')]('base64');}catch(_0x230f6c){return _0x516d73(_0x230f6c);}return _0x5f000c({'method':_0x004d('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x386bc3,'body':{'config':{'encoding':_0x004d('0xa'),'sampleRateHertz':'8000','languageCode':_0x1c0219},'audio':{'content':_0x2638dd}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 10cb4be..7afae81 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x284b=['exports'];(function(_0x4dda69,_0x2a0fe4){var _0x9014a9=function(_0x3d2b40){while(--_0x3d2b40){_0x4dda69['push'](_0x4dda69['shift']());}};_0x9014a9(++_0x2a0fe4);}(_0x284b,0x1ec));var _0xb284=function(_0x2eb8eb,_0x365a46){_0x2eb8eb=_0x2eb8eb-0x0;var _0x3210c0=_0x284b[_0x2eb8eb];return _0x3210c0;};var asr=require('./asr');module[_0xb284('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index e097c93..6a6d663 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfa8=['download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','then','from','audioContent','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','stringify','null','generic','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./sestek','./tilde','../../../config/logger','agi','https:','host','path','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink'];(function(_0x13434b,_0xa47338){var _0x5b4154=function(_0x211093){while(--_0x211093){_0x13434b['push'](_0x13434b['shift']());}};_0x5b4154(++_0xa47338);}(_0xdfa8,0xf6));var _0x8dfa=function(_0x2bbbea,_0x5c6c34){_0x2bbbea=_0x2bbbea-0x0;var _0x2df636=_0xdfa8[_0x2bbbea];return _0x2df636;};'use strict';var apiai=require(_0x8dfa('0x0'));var BPromise=require(_0x8dfa('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x8dfa('0x2'));var https=require(_0x8dfa('0x3'));var md5=require(_0x8dfa('0x4'));var path=require('path');var querystring=require(_0x8dfa('0x5'));var rp=require(_0x8dfa('0x6'));var rs=require(_0x8dfa('0x7'));var sox=require(_0x8dfa('0x8'));var tts=require(_0x8dfa('0x9'));var urlParse=require(_0x8dfa('0xa'))['parse'];var util=require(_0x8dfa('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x8dfa('0xc'));var tilde=require(_0x8dfa('0xd'));var logger=require(_0x8dfa('0xe'))(_0x8dfa('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x3d26fa,_0x2b42d7){return new BPromise(function(_0x40afe6,_0x213dd6){var _0x284a86=urlParse(_0x3d26fa);var _0x2ddb2e=_0x284a86['protocol']===_0x8dfa('0x10')?https:http;var _0x44782e={'host':_0x284a86[_0x8dfa('0x11')],'path':_0x284a86[_0x8dfa('0x12')],'headers':{'user-agent':_0x8dfa('0x13')}};_0x2ddb2e['get'](_0x44782e,function(_0x42801f){if(_0x42801f[_0x8dfa('0x14')]!==0xc8){logger[_0x8dfa('0x15')](_0x8dfa('0x16')+_0x3d26fa+_0x8dfa('0x17')+_0x42801f[_0x8dfa('0x14')]+'\x20('+_0x42801f[_0x8dfa('0x18')]+')');_0x213dd6(new Error(_0x8dfa('0x16')+_0x3d26fa+'\x20failed,\x20status\x20code\x20=\x20'+_0x42801f['statusCode']+'\x20('+_0x42801f[_0x8dfa('0x18')]+')'));return;}var _0x28e7b2=fs[_0x8dfa('0x19')](_0x2b42d7);_0x28e7b2['on'](_0x8dfa('0x1a'),function(){logger[_0x8dfa('0x1b')](_0x8dfa('0x1c'));_0x28e7b2['close'](_0x40afe6);});_0x28e7b2['on'](_0x8dfa('0x15'),function(_0x3260ee){fs[_0x8dfa('0x1d')](_0x2b42d7);logger[_0x8dfa('0x15')](_0x8dfa('0x1e'),_0x3260ee);_0x213dd6(_0x3260ee);});_0x42801f[_0x8dfa('0x1f')](_0x28e7b2);})['on']('error',function(_0x5106b5){logger[_0x8dfa('0x15')](_0x5106b5);_0x213dd6(_0x5106b5);})[_0x8dfa('0x20')]();});}function uploadFile(_0x527a15){return new BPromise(function(_0x57e6db,_0x5d63b8){var _0x59a401=urlParse(_0x527a15);var _0x4622a7=_0x59a401['protocol']==='https:'?https:http;var _0x5a679c={'host':_0x59a401['host'],'path':_0x59a401[_0x8dfa('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x4622a7['get'](_0x5a679c,function(_0x499c59){if(_0x499c59[_0x8dfa('0x14')]!==0xc8){_0x5d63b8(new Error(_0x8dfa('0x16')+_0x527a15+_0x8dfa('0x17')+_0x499c59[_0x8dfa('0x14')]+'\x20('+_0x499c59[_0x8dfa('0x18')]+')'));return;}var _0xab6718='';_0x499c59['on'](_0x8dfa('0x21'),function(_0x2848bb){_0xab6718+=_0x2848bb;});_0x499c59['on'](_0x8dfa('0x20'),function(){_0x57e6db(_0xab6718);});})['on'](_0x8dfa('0x15'),function(_0x459a8e){_0x5d63b8(_0x459a8e);})[_0x8dfa('0x20')]();});}function convertFile(_0x44e087,_0x448116){return new BPromise(function(_0x611c98,_0x289ced){var _0x1e23ee=sox[_0x8dfa('0x22')](_0x44e087,_0x448116,{'sampleRate':0x1f40,'format':_0x8dfa('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1e23ee['on'](_0x8dfa('0x15'),function(_0x458862){logger[_0x8dfa('0x15')](_0x8dfa('0x24'),_0x458862);_0x289ced(_0x458862);});_0x1e23ee['on']('end',function(){logger['info'](_0x8dfa('0x25'));_0x611c98();});_0x1e23ee[_0x8dfa('0x26')]();});}function base64Decode(_0xd60c0f,_0x2c41c4){var _0x17b802=path[_0x8dfa('0x27')](__dirname,_0x8dfa('0x28'),rs[_0x8dfa('0x29')](0x4)+_0x8dfa('0x2a'));fs[_0x8dfa('0x2b')](_0x17b802,_0xd60c0f,_0x8dfa('0x2c'));return convertFile(_0x17b802,_0x2c41c4)['then'](function(){try{fs[_0x8dfa('0x1d')](_0x17b802);fs[_0x8dfa('0x2d')](_0x2c41c4,'777');}catch(_0x1518ad){logger['error'](_0x1518ad);}return _0x2c41c4[_0x8dfa('0x2e')]('.')[0x0];});}function base64Encode(_0x1e05cf){var _0x3ac71c=fs[_0x8dfa('0x2f')](_0x1e05cf);return new Buffer(_0x3ac71c)[_0x8dfa('0x30')](_0x8dfa('0x2c'));}exports[_0x8dfa('0x31')]=function(_0x17898f,_0x5752f7,_0x4f5845,_0x5ea9d6,_0x1d1811,_0x1aa420){var _0x303a9b,_0x2319e4;var _0x2d4cd7=_0x8dfa('0x32');var _0x34c756=_0x8dfa('0x33')+_0x17898f;var _0x3ad99e={};if(_0x5752f7==='ssml'){_0x3ad99e[_0x8dfa('0x34')]={'ssml':_0x4f5845};}else{_0x3ad99e[_0x8dfa('0x34')]={'text':_0x4f5845};};_0x3ad99e['voice']={'languageCode':_0x5ea9d6,'ssmlGender':_0x1d1811};_0x3ad99e['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x49bf14={'url':_0x2d4cd7+'text:synthesize'+_0x34c756,'method':'POST','json':!![],'body':_0x3ad99e};return rp(_0x49bf14)[_0x8dfa('0x35')](function(_0x4b2be1){return new BPromise(function(_0x56dcae,_0x5ad32a){_0x303a9b=path[_0x8dfa('0x27')](__dirname,'tmp',rs[_0x8dfa('0x29')](0x4)+'.mp3');var _0x577dc8=Buffer[_0x8dfa('0x36')](_0x4b2be1[_0x8dfa('0x37')],_0x8dfa('0x2c'));return fs['writeFile'](_0x303a9b,_0x577dc8,function(_0x5ec6ce){_0x5ad32a(_0x5ec6ce);},function(_0x2a8116){fs[_0x8dfa('0x2d')](_0x303a9b,_0x8dfa('0x38'));_0x56dcae(_0x2a8116);});});})[_0x8dfa('0x35')](function(_0x240922){_0x2319e4=path[_0x8dfa('0x27')](__dirname,_0x8dfa('0x28'),rs['generate'](0x4)+_0x8dfa('0x2a'));return convertFile(_0x303a9b,_0x2319e4);})['then'](function(){try{fs[_0x8dfa('0x1d')](_0x303a9b);fs[_0x8dfa('0x2d')](_0x2319e4,_0x8dfa('0x38'));}catch(_0x5255a3){logger['error'](_0x5255a3);}logger[_0x8dfa('0x1b')](_0x8dfa('0x39'),_0x2319e4[_0x8dfa('0x2e')]('.')[0x0]);return _0x2319e4[_0x8dfa('0x2e')]('.')[0x0];});};exports[_0x8dfa('0x3a')]=function(_0x15b70e,_0x419378){var _0x4f37aa=_0x8dfa('0x3b');var _0x272b6c,_0x3e19d1;var _0x3eff10;var _0x217b15={'encoding':_0x8dfa('0x3c'),'method':_0x8dfa('0x3d'),'timeout':0x2710,'url':_0x4f37aa,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x8dfa('0x3e')+encodeURIComponent(JSON[_0x8dfa('0x3f')]([[['jQ1olc',JSON[_0x8dfa('0x3f')]([_0x15b70e,_0x419378||'en',![],_0x8dfa('0x40')]),null,_0x8dfa('0x41')]]]))};return rp(_0x217b15)[_0x8dfa('0x35')](function(_0x89ce7a){try{_0x3eff10=eval(_0x89ce7a['slice'](0x5))[0x0][0x2];}catch(_0x42d2d4){throw new Error('parse\x20response\x20failed:\x0a'+_0x89ce7a['data']);}if(!_0x3eff10){if(_0x15b70e[_0x8dfa('0x42')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x419378+_0x8dfa('0x43'));}}try{_0x3eff10=eval(_0x3eff10)[0x0];}catch(_0x3f7fef){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x8dfa('0x21')]);}const _0xa545df=_0x3eff10;_0x272b6c=path['resolve'](__dirname,'tmp',rs[_0x8dfa('0x29')](0x4)+'.mp3');fs[_0x8dfa('0x2b')](_0x272b6c,_0x3eff10,{'encoding':_0x8dfa('0x2c')});_0x3e19d1=path['resolve'](__dirname,_0x8dfa('0x28'),rs[_0x8dfa('0x29')](0x4)+_0x8dfa('0x2a'));return convertFile(_0x272b6c,_0x3e19d1);})[_0x8dfa('0x35')](function(){try{fs['unlink'](_0x272b6c);fs[_0x8dfa('0x2d')](_0x3e19d1,_0x8dfa('0x38'));}catch(_0x155462){logger[_0x8dfa('0x15')](_0x155462);}logger[_0x8dfa('0x1b')](_0x8dfa('0x44'),_0x3e19d1[_0x8dfa('0x2e')]('.')[0x0]);return _0x3e19d1[_0x8dfa('0x2e')]('.')[0x0];});};exports[_0x8dfa('0x45')]=function(_0x52592a,_0x28035a,_0x428c3f){return google[_0x8dfa('0x46')](_0x52592a,_0x28035a,_0x428c3f)[_0x8dfa('0x35')](function(_0x422332){logger[_0x8dfa('0x1b')](_0x422332[_0x8dfa('0x47')]);return rp(_0x422332);})[_0x8dfa('0x35')](function(_0x744972){var _0x126166='';var _0x1f4f9a=0x0;try{fs['unlink'](_0x52592a);}catch(_0x327d44){logger[_0x8dfa('0x15')](_0x327d44);}if(_0x744972&&_0x744972[_0x8dfa('0x48')]){_0x126166=_0x744972[_0x8dfa('0x48')][_0x8dfa('0x49')](function(_0x13ff0d){return _0x13ff0d&&_0x13ff0d[_0x8dfa('0x4a')][0x0]&&_0x13ff0d['alternatives'][0x0][_0x8dfa('0x4b')]?_0x13ff0d[_0x8dfa('0x4a')][0x0]['transcript']:'';})[_0x8dfa('0x4c')]('\x0a');_0x1f4f9a=_0x744972[_0x8dfa('0x48')]['map'](function(_0x18077c){return _0x18077c&&_0x18077c[_0x8dfa('0x4a')][0x0]&&_0x18077c[_0x8dfa('0x4a')][0x0][_0x8dfa('0x4d')]?_0x18077c[_0x8dfa('0x4a')][0x0]['confidence']:0x0;})[_0x8dfa('0x4c')]('\x0a');}logger[_0x8dfa('0x1b')](_0x8dfa('0x4e'),_0x126166);logger[_0x8dfa('0x1b')](_0x8dfa('0x4f'),_0x1f4f9a);return{'transcript':_0x126166,'confidence':_0x1f4f9a};})[_0x8dfa('0x50')](function(_0xbc8f6b){logger[_0x8dfa('0x15')](_0x8dfa('0x51'),_0xbc8f6b[_0x8dfa('0x14')],_0xbc8f6b[_0x8dfa('0x52')],_0xbc8f6b['message']);});};exports[_0x8dfa('0x53')]=function(_0x302bda,_0x53f526,_0x2b492a,_0x45764c){var _0x5d2c5c=apiai(_0x53f526,{'language':_0x45764c||'en'});return _0x5d2c5c[_0x8dfa('0x54')](_0x2b492a,{'sessionId':md5(_0x302bda)})[_0x8dfa('0x35')](function(_0x378af9){logger[_0x8dfa('0x1b')](JSON['stringify'](_0x378af9));return{'source':_0x378af9[_0x8dfa('0x55')][_0x8dfa('0x56')],'resolvedQuery':_0x378af9[_0x8dfa('0x55')][_0x8dfa('0x57')],'action':_0x378af9['result'][_0x8dfa('0x58')],'actionIncomplete':_0x378af9[_0x8dfa('0x55')][_0x8dfa('0x59')],'speech':_0x378af9[_0x8dfa('0x55')]['fulfillment'][_0x8dfa('0x5a')],'score':_0x378af9['result'][_0x8dfa('0x5b')],'statusCode':_0x378af9[_0x8dfa('0x5c')]['code'],'endConversation':_0x378af9['result'][_0x8dfa('0x5d')][_0x8dfa('0x5e')]||![],'isFallbackIntent':_0x378af9['result'][_0x8dfa('0x5d')][_0x8dfa('0x5f')]};});};exports[_0x8dfa('0x60')]=function(_0x5514c9,_0x3cb4cd,_0x129133,_0x3e41ae,_0x8be12c,_0x1f54b1){var _0x34974f=_0x3e41ae[_0x8dfa('0x61')](/\\n/g,'\x0a');var _0x4db376={'credentials':{'private_key':_0x34974f,'client_email':_0x129133}};var _0x25bf2a=new dialogflow[(_0x8dfa('0x62'))](_0x4db376);var _0x427e4d=_0x25bf2a['sessionPath'](_0x3cb4cd,md5(_0x5514c9));var _0x377e35={'session':_0x427e4d,'queryInput':{'text':{'text':_0x8be12c,'languageCode':_0x1f54b1}}};return _0x25bf2a[_0x8dfa('0x63')](_0x377e35)[_0x8dfa('0x35')](function(_0x3edbcf){if(_0x3edbcf&&_0x3edbcf[_0x8dfa('0x42')]){logger[_0x8dfa('0x1b')](_0x8dfa('0x64'),JSON[_0x8dfa('0x3f')](_0x3edbcf));var _0x4be33b=_0x3edbcf[0x0];if(_0x4be33b){var _0x4b293f={'action':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x58')],'allRequiredParamsPresent':_0x4be33b[_0x8dfa('0x65')]['allRequiredParamsPresent'],'endConversation':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x66')]&&_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x66')][_0x8dfa('0x67')]?_0x4be33b['queryResult'][_0x8dfa('0x66')][_0x8dfa('0x67')][_0x8dfa('0x68')][_0x8dfa('0x69')]:![],'fulfillmentText':_0x4be33b['queryResult'][_0x8dfa('0x6a')],'intentName':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x6b')][_0x8dfa('0x52')],'intentDisplayName':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x6b')][_0x8dfa('0x6c')],'isFallbackIntent':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x6b')][_0x8dfa('0x6d')],'languageCode':_0x4be33b[_0x8dfa('0x65')][_0x8dfa('0x6e')],'queryText':_0x4be33b['queryResult'][_0x8dfa('0x6f')],'responseId':_0x4be33b[_0x8dfa('0x70')],'score':_0x4be33b['queryResult'][_0x8dfa('0x71')],'speech':_0x4be33b['queryResult'][_0x8dfa('0x6a')],'providerResponse':JSON[_0x8dfa('0x3f')](_0x3edbcf)};return _0x4b293f;}}});};exports[_0x8dfa('0x72')]=function(_0x4a511d,_0x236949,_0x18c1c9,_0x44d48d){return tilde[_0x8dfa('0x46')](_0x4a511d,_0x236949,_0x18c1c9,_0x44d48d)[_0x8dfa('0x35')](function(_0x23a25f){try{fs['unlink'](_0x4a511d);}catch(_0x4d5791){logger[_0x8dfa('0x15')](_0x4d5791);}logger[_0x8dfa('0x1b')](_0x8dfa('0x73'),_0x23a25f['transcript']);logger['info'](_0x8dfa('0x74'),_0x23a25f['confidence']);return _0x23a25f;});};exports[_0x8dfa('0x75')]=function(_0xea301f,_0x5013d1,_0xb18f33,_0x3f77f6,_0x42900a,_0x42ada8){var _0x5655c4=path[_0x8dfa('0x27')](__dirname,_0x8dfa('0x28'),rs['generate'](0x4)+_0x8dfa('0x76'));var _0x1e721d;return aws[_0x8dfa('0x77')](_0xea301f,_0x5013d1,_0xb18f33,_0x3f77f6,_0x42900a,_0x42ada8,_0x5655c4)[_0x8dfa('0x35')](function(){_0x1e721d=path['resolve'](__dirname,_0x8dfa('0x28'),rs[_0x8dfa('0x29')](0x4)+_0x8dfa('0x2a'));return convertFile(_0x5655c4,_0x1e721d);})[_0x8dfa('0x35')](function(){try{fs['unlink'](_0x5655c4);fs['chmodSync'](_0x1e721d,_0x8dfa('0x38'));}catch(_0x479868){logger[_0x8dfa('0x15')](_0x479868);}return _0x1e721d[_0x8dfa('0x2e')]('.')[0x0];});};exports[_0x8dfa('0x78')]=function(_0x3b5b23,_0x4ad7d3,_0x534894,_0x34eda4,_0x415483,_0x24cce4){return aws[_0x8dfa('0x79')](_0x3b5b23,_0x4ad7d3,_0x534894,_0x34eda4,_0x415483,_0x24cce4)[_0x8dfa('0x35')](function(_0x548bc6){logger[_0x8dfa('0x1b')](JSON[_0x8dfa('0x3f')](_0x548bc6));return _0x548bc6;});};exports[_0x8dfa('0x7a')]=function(_0x4edb1f,_0xd452a7,_0x344330,_0x1614e5){var _0x44394a=util[_0x8dfa('0x7b')](_0x8dfa('0x7c'),ISPEECH_API,_0x4edb1f,encodeURIComponent(_0xd452a7),_0x344330,_0x1614e5);var _0x554fe8=path[_0x8dfa('0x27')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5d418d;return downloadFile(_0x44394a,_0x554fe8)['then'](function(){_0x5d418d=path[_0x8dfa('0x27')](__dirname,_0x8dfa('0x28'),rs[_0x8dfa('0x29')](0x4)+_0x8dfa('0x2a'));return convertFile(_0x554fe8,_0x5d418d);})[_0x8dfa('0x35')](function(){try{fs['unlink'](_0x554fe8);fs['chmodSync'](_0x5d418d,_0x8dfa('0x38'));}catch(_0x406bc7){logger[_0x8dfa('0x15')](_0x406bc7);}return _0x5d418d[_0x8dfa('0x2e')]('.')[0x0];});};exports[_0x8dfa('0x7d')]=function(_0x27c2dc,_0x423efa,_0x2bc1e6,_0x35c6f1){var _0x27ee45=util[_0x8dfa('0x7b')](_0x8dfa('0x7e'),ISPEECH_API,_0x423efa,_0x2bc1e6,base64Encode(_0x27c2dc),_0x35c6f1?util[_0x8dfa('0x7b')](_0x8dfa('0x7f'),encodeURIComponent(_0x35c6f1)):'freeform=3');return uploadFile(_0x27ee45)[_0x8dfa('0x35')](function(_0x54fd8b){return querystring['parse'](_0x54fd8b);});};exports[_0x8dfa('0x80')]=function(_0x3be48d,_0x5407b2){return sestek[_0x8dfa('0x81')](_0x3be48d,_0x5407b2)[_0x8dfa('0x35')](function(_0xb21878){logger[_0x8dfa('0x1b')](JSON[_0x8dfa('0x3f')](_0xb21878));var _0x22421a={'speech':_0xb21878[_0x8dfa('0x82')],'action':_0xb21878[_0x8dfa('0x83')]?_0xb21878[_0x8dfa('0x83')][_0x8dfa('0x84')]:undefined,'actiondata':_0xb21878[_0x8dfa('0x83')]?_0xb21878['channelData'][_0x8dfa('0x85')]:undefined};if(_0xb21878[_0x8dfa('0x83')]&&_0xb21878['channelData'][_0x8dfa('0x86')]){return base64Decode(_0xb21878['channelData'][_0x8dfa('0x86')][_0x8dfa('0x87')],path['resolve'](__dirname,'tmp',rs[_0x8dfa('0x29')](0x4)+'.wav'))[_0x8dfa('0x35')](function(_0x16c876){_0x22421a[_0x8dfa('0x88')]=_0x16c876;return _0x22421a;});}return _0x22421a;});};exports[_0x8dfa('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0xe7ee=['error\x20convert','finish\x20to\x20convert','generate','writeFileSync','base64','then','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','tmp','.mp3','from','audioContent','writeFile','chmodSync','resolve','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','responseId','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','randomstring','sox','parse','util','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','unlink','download\x20error','error','data','end','wav'];(function(_0x72576f,_0x2a603a){var _0x2dce9e=function(_0x18f658){while(--_0x18f658){_0x72576f['push'](_0x72576f['shift']());}};_0x2dce9e(++_0x2a603a);}(_0xe7ee,0x6b));var _0xee7e=function(_0x4eaf51,_0x749e09){_0x4eaf51=_0x4eaf51-0x0;var _0x142bc9=_0xe7ee[_0x4eaf51];return _0x142bc9;};'use strict';var apiai=require(_0xee7e('0x0'));var BPromise=require(_0xee7e('0x1'));var dialogflow=require(_0xee7e('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xee7e('0x3'));var path=require(_0xee7e('0x4'));var querystring=require(_0xee7e('0x5'));var rp=require(_0xee7e('0x6'));var rs=require(_0xee7e('0x7'));var sox=require(_0xee7e('0x8'));var tts=require('google-tts-api');var urlParse=require('url')[_0xee7e('0x9')];var util=require(_0xee7e('0xa'));var aws=require('./aws');var google=require(_0xee7e('0xb'));var sestek=require(_0xee7e('0xc'));var tilde=require(_0xee7e('0xd'));var logger=require(_0xee7e('0xe'))('agi');var ISPEECH_API=_0xee7e('0xf');function downloadFile(_0xc57a15,_0x2d9a6a){return new BPromise(function(_0x1c00b2,_0x1abea5){var _0x74e7ec=urlParse(_0xc57a15);var _0x4b697a=_0x74e7ec[_0xee7e('0x10')]===_0xee7e('0x11')?https:http;var _0x2b5737={'host':_0x74e7ec[_0xee7e('0x12')],'path':_0x74e7ec['path'],'headers':{'user-agent':_0xee7e('0x13')}};_0x4b697a[_0xee7e('0x14')](_0x2b5737,function(_0x5e2521){if(_0x5e2521['statusCode']!==0xc8){logger['error'](_0xee7e('0x15')+_0xc57a15+'\x20failed,\x20status\x20code\x20=\x20'+_0x5e2521[_0xee7e('0x16')]+'\x20('+_0x5e2521[_0xee7e('0x17')]+')');_0x1abea5(new Error('request\x20to\x20'+_0xc57a15+_0xee7e('0x18')+_0x5e2521[_0xee7e('0x16')]+'\x20('+_0x5e2521[_0xee7e('0x17')]+')'));return;}var _0x21847b=fs[_0xee7e('0x19')](_0x2d9a6a);_0x21847b['on'](_0xee7e('0x1a'),function(){logger[_0xee7e('0x1b')]('finish\x20download\x20file');_0x21847b[_0xee7e('0x1c')](_0x1c00b2);});_0x21847b['on']('error',function(_0x43094f){fs[_0xee7e('0x1d')](_0x2d9a6a);logger['error'](_0xee7e('0x1e'),_0x43094f);_0x1abea5(_0x43094f);});_0x5e2521['pipe'](_0x21847b);})['on'](_0xee7e('0x1f'),function(_0x116081){logger[_0xee7e('0x1f')](_0x116081);_0x1abea5(_0x116081);})['end']();});}function uploadFile(_0xe986c2){return new BPromise(function(_0x3be897,_0x27d172){var _0x48df5d=urlParse(_0xe986c2);var _0x44d9fc=_0x48df5d[_0xee7e('0x10')]===_0xee7e('0x11')?https:http;var _0x390d5e={'host':_0x48df5d['host'],'path':_0x48df5d['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x44d9fc[_0xee7e('0x14')](_0x390d5e,function(_0x32919e){if(_0x32919e['statusCode']!==0xc8){_0x27d172(new Error('request\x20to\x20'+_0xe986c2+_0xee7e('0x18')+_0x32919e[_0xee7e('0x16')]+'\x20('+_0x32919e[_0xee7e('0x17')]+')'));return;}var _0x4bcacd='';_0x32919e['on'](_0xee7e('0x20'),function(_0x2a6183){_0x4bcacd+=_0x2a6183;});_0x32919e['on'](_0xee7e('0x21'),function(){_0x3be897(_0x4bcacd);});})['on'](_0xee7e('0x1f'),function(_0x571bbb){_0x27d172(_0x571bbb);})['end']();});}function convertFile(_0x554a51,_0x2a65ff){return new BPromise(function(_0x432530,_0x469722){var _0x337277=sox['transcode'](_0x554a51,_0x2a65ff,{'sampleRate':0x1f40,'format':_0xee7e('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x337277['on'](_0xee7e('0x1f'),function(_0xe07560){logger['error'](_0xee7e('0x23'),_0xe07560);_0x469722(_0xe07560);});_0x337277['on'](_0xee7e('0x21'),function(){logger[_0xee7e('0x1b')](_0xee7e('0x24'));_0x432530();});_0x337277['start']();});}function base64Decode(_0x599de2,_0x1bda35){var _0x179de9=path['resolve'](__dirname,'tmp',rs[_0xee7e('0x25')](0x4)+'.wav');fs[_0xee7e('0x26')](_0x179de9,_0x599de2,_0xee7e('0x27'));return convertFile(_0x179de9,_0x1bda35)[_0xee7e('0x28')](function(){try{fs[_0xee7e('0x1d')](_0x179de9);fs['chmodSync'](_0x1bda35,_0xee7e('0x29'));}catch(_0x1b77c6){logger[_0xee7e('0x1f')](_0x1b77c6);}return _0x1bda35[_0xee7e('0x2a')]('.')[0x0];});}function base64Encode(_0x4e4d67){var _0x4fbc4e=fs[_0xee7e('0x2b')](_0x4e4d67);return new Buffer(_0x4fbc4e)['toString']('base64');}exports[_0xee7e('0x2c')]=function(_0x2e9693,_0x3554cf,_0x4da975,_0x5e9906,_0x4f813d,_0x7399ea){var _0x40c357,_0x12d48d;var _0x36fbf4=_0xee7e('0x2d');var _0x33a2b1=_0xee7e('0x2e')+_0x2e9693;var _0x23a21b={};if(_0x3554cf===_0xee7e('0x2f')){_0x23a21b[_0xee7e('0x30')]={'ssml':_0x4da975};}else{_0x23a21b[_0xee7e('0x30')]={'text':_0x4da975};};_0x23a21b[_0xee7e('0x31')]={'languageCode':_0x5e9906,'ssmlGender':_0x4f813d};_0x23a21b[_0xee7e('0x32')]={'audioEncoding':_0xee7e('0x33'),'sampleRateHertz':0x1f40};var _0x4033d4={'url':_0x36fbf4+_0xee7e('0x34')+_0x33a2b1,'method':'POST','json':!![],'body':_0x23a21b};return rp(_0x4033d4)[_0xee7e('0x28')](function(_0xa503b3){return new BPromise(function(_0x316e85,_0x197b68){_0x40c357=path['resolve'](__dirname,_0xee7e('0x35'),rs[_0xee7e('0x25')](0x4)+_0xee7e('0x36'));var _0x54ec41=Buffer[_0xee7e('0x37')](_0xa503b3[_0xee7e('0x38')],_0xee7e('0x27'));return fs[_0xee7e('0x39')](_0x40c357,_0x54ec41,function(_0x5bd969){_0x197b68(_0x5bd969);},function(_0x11017a){fs[_0xee7e('0x3a')](_0x40c357,_0xee7e('0x29'));_0x316e85(_0x11017a);});});})[_0xee7e('0x28')](function(_0x16f2c0){_0x12d48d=path[_0xee7e('0x3b')](__dirname,_0xee7e('0x35'),rs['generate'](0x4)+_0xee7e('0x3c'));return convertFile(_0x40c357,_0x12d48d);})[_0xee7e('0x28')](function(){try{fs['unlink'](_0x40c357);fs[_0xee7e('0x3a')](_0x12d48d,_0xee7e('0x29'));}catch(_0x3405e3){logger[_0xee7e('0x1f')](_0x3405e3);}logger[_0xee7e('0x1b')](_0xee7e('0x3d'),_0x12d48d[_0xee7e('0x2a')]('.')[0x0]);return _0x12d48d[_0xee7e('0x2a')]('.')[0x0];});};exports[_0xee7e('0x3e')]=function(_0x357fad,_0x1faaeb){var _0x2df15b=_0xee7e('0x3f');var _0x275e59,_0x4f1e59;var _0x2bd1f2;var _0x8e0a42={'encoding':_0xee7e('0x40'),'method':_0xee7e('0x41'),'timeout':0x2710,'url':_0x2df15b,'headers':{'Content-Type':_0xee7e('0x42')},'body':_0xee7e('0x43')+encodeURIComponent(JSON[_0xee7e('0x44')]([[['jQ1olc',JSON[_0xee7e('0x44')]([_0x357fad,_0x1faaeb||'en',![],_0xee7e('0x45')]),null,_0xee7e('0x46')]]]))};return rp(_0x8e0a42)['then'](function(_0x1c2e45){try{_0x2bd1f2=eval(_0x1c2e45['slice'](0x5))[0x0][0x2];}catch(_0x5169fa){throw new Error(_0xee7e('0x47')+_0x1c2e45['data']);}if(!_0x2bd1f2){if(_0x357fad[_0xee7e('0x48')]>0xc8){throw new Error(_0xee7e('0x49'));}else{throw new Error('lang\x20\x22'+_0x1faaeb+_0xee7e('0x4a'));}}try{_0x2bd1f2=eval(_0x2bd1f2)[0x0];}catch(_0xdbe839){throw new Error(_0xee7e('0x47')+res[_0xee7e('0x20')]);}const _0x25fa56=_0x2bd1f2;_0x275e59=path[_0xee7e('0x3b')](__dirname,_0xee7e('0x35'),rs[_0xee7e('0x25')](0x4)+_0xee7e('0x36'));fs[_0xee7e('0x26')](_0x275e59,_0x2bd1f2,{'encoding':_0xee7e('0x27')});_0x4f1e59=path['resolve'](__dirname,'tmp',rs[_0xee7e('0x25')](0x4)+_0xee7e('0x3c'));return convertFile(_0x275e59,_0x4f1e59);})[_0xee7e('0x28')](function(){try{fs['unlink'](_0x275e59);fs[_0xee7e('0x3a')](_0x4f1e59,_0xee7e('0x29'));}catch(_0x174284){logger[_0xee7e('0x1f')](_0x174284);}logger['info'](_0xee7e('0x4b'),_0x4f1e59['split']('.')[0x0]);return _0x4f1e59[_0xee7e('0x2a')]('.')[0x0];});};exports[_0xee7e('0x4c')]=function(_0x3e6e36,_0x4bc9e0,_0x9690dc){return google[_0xee7e('0x4d')](_0x3e6e36,_0x4bc9e0,_0x9690dc)['then'](function(_0x142cc4){logger[_0xee7e('0x1b')](_0x142cc4[_0xee7e('0x4e')]);return rp(_0x142cc4);})['then'](function(_0x13571c){var _0x234d6f='';var _0x3dce37=0x0;try{fs[_0xee7e('0x1d')](_0x3e6e36);}catch(_0x6e049a){logger[_0xee7e('0x1f')](_0x6e049a);}if(_0x13571c&&_0x13571c[_0xee7e('0x4f')]){_0x234d6f=_0x13571c[_0xee7e('0x4f')]['map'](function(_0x38c1e9){return _0x38c1e9&&_0x38c1e9[_0xee7e('0x50')][0x0]&&_0x38c1e9['alternatives'][0x0]['transcript']?_0x38c1e9[_0xee7e('0x50')][0x0]['transcript']:'';})[_0xee7e('0x51')]('\x0a');_0x3dce37=_0x13571c[_0xee7e('0x4f')][_0xee7e('0x52')](function(_0x5583af){return _0x5583af&&_0x5583af[_0xee7e('0x50')][0x0]&&_0x5583af[_0xee7e('0x50')][0x0][_0xee7e('0x53')]?_0x5583af[_0xee7e('0x50')][0x0]['confidence']:0x0;})[_0xee7e('0x51')]('\x0a');}logger[_0xee7e('0x1b')](_0xee7e('0x54'),_0x234d6f);logger[_0xee7e('0x1b')](_0xee7e('0x55'),_0x3dce37);return{'transcript':_0x234d6f,'confidence':_0x3dce37};})[_0xee7e('0x56')](function(_0x11bf0c){logger['error'](_0xee7e('0x57'),_0x11bf0c['statusCode'],_0x11bf0c['name'],_0x11bf0c[_0xee7e('0x58')]);});};exports[_0xee7e('0x59')]=function(_0x7407b1,_0x57fd4c,_0x27dc65,_0x1e7676){var _0x48381d=apiai(_0x57fd4c,{'language':_0x1e7676||'en'});return _0x48381d[_0xee7e('0x5a')](_0x27dc65,{'sessionId':md5(_0x7407b1)})[_0xee7e('0x28')](function(_0x1e83b8){logger[_0xee7e('0x1b')](JSON[_0xee7e('0x44')](_0x1e83b8));return{'source':_0x1e83b8['result'][_0xee7e('0x5b')],'resolvedQuery':_0x1e83b8['result'][_0xee7e('0x5c')],'action':_0x1e83b8[_0xee7e('0x5d')][_0xee7e('0x5e')],'actionIncomplete':_0x1e83b8[_0xee7e('0x5d')][_0xee7e('0x5f')],'speech':_0x1e83b8[_0xee7e('0x5d')][_0xee7e('0x60')]['speech'],'score':_0x1e83b8[_0xee7e('0x5d')][_0xee7e('0x61')],'statusCode':_0x1e83b8[_0xee7e('0x62')][_0xee7e('0x63')],'endConversation':_0x1e83b8['result'][_0xee7e('0x64')][_0xee7e('0x65')]||![],'isFallbackIntent':_0x1e83b8[_0xee7e('0x5d')][_0xee7e('0x64')][_0xee7e('0x66')]};});};exports[_0xee7e('0x67')]=function(_0x3cac0a,_0x308690,_0x4b9cdc,_0x326b54,_0x33d88c,_0x146aee){var _0x213b8c=_0x326b54[_0xee7e('0x68')](/\\n/g,'\x0a');var _0x2582b8={'credentials':{'private_key':_0x213b8c,'client_email':_0x4b9cdc}};var _0x377441=new dialogflow[(_0xee7e('0x69'))](_0x2582b8);var _0x55d3f8=_0x377441['sessionPath'](_0x308690,md5(_0x3cac0a));var _0x30a972={'session':_0x55d3f8,'queryInput':{'text':{'text':_0x33d88c,'languageCode':_0x146aee}}};return _0x377441[_0xee7e('0x6a')](_0x30a972)[_0xee7e('0x28')](function(_0x82b4be){if(_0x82b4be&&_0x82b4be['length']){logger[_0xee7e('0x1b')](_0xee7e('0x6b'),JSON['stringify'](_0x82b4be));var _0x237606=_0x82b4be[0x0];if(_0x237606){var _0x5bca33={'action':_0x237606[_0xee7e('0x6c')][_0xee7e('0x5e')],'allRequiredParamsPresent':_0x237606[_0xee7e('0x6c')][_0xee7e('0x6d')],'endConversation':_0x237606['queryResult'][_0xee7e('0x6e')]&&_0x237606[_0xee7e('0x6c')][_0xee7e('0x6e')][_0xee7e('0x6f')]?_0x237606[_0xee7e('0x6c')]['diagnosticInfo']['fields']['end_conversation'][_0xee7e('0x70')]:![],'fulfillmentText':_0x237606[_0xee7e('0x6c')][_0xee7e('0x71')],'intentName':_0x237606['queryResult'][_0xee7e('0x72')][_0xee7e('0x73')],'intentDisplayName':_0x237606['queryResult'][_0xee7e('0x72')][_0xee7e('0x74')],'isFallbackIntent':_0x237606[_0xee7e('0x6c')][_0xee7e('0x72')][_0xee7e('0x75')],'languageCode':_0x237606[_0xee7e('0x6c')][_0xee7e('0x76')],'queryText':_0x237606['queryResult']['queryText'],'responseId':_0x237606[_0xee7e('0x77')],'score':_0x237606[_0xee7e('0x6c')]['intentDetectionConfidence'],'speech':_0x237606[_0xee7e('0x6c')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x82b4be)};return _0x5bca33;}}});};exports[_0xee7e('0x78')]=function(_0x32c4f2,_0x2d3be3,_0x2b3f0f,_0x156a93){return tilde[_0xee7e('0x4d')](_0x32c4f2,_0x2d3be3,_0x2b3f0f,_0x156a93)[_0xee7e('0x28')](function(_0x18f291){try{fs['unlink'](_0x32c4f2);}catch(_0x3b8374){logger[_0xee7e('0x1f')](_0x3b8374);}logger[_0xee7e('0x1b')](_0xee7e('0x79'),_0x18f291[_0xee7e('0x7a')]);logger[_0xee7e('0x1b')](_0xee7e('0x7b'),_0x18f291['confidence']);return _0x18f291;});};exports[_0xee7e('0x7c')]=function(_0x2a1188,_0x1da87e,_0x23cc8f,_0x348d70,_0x1a47fa,_0x353bd9){var _0x59d22f=path[_0xee7e('0x3b')](__dirname,'tmp',rs[_0xee7e('0x25')](0x4)+'.mp3');var _0x4494d3;return aws[_0xee7e('0x7d')](_0x2a1188,_0x1da87e,_0x23cc8f,_0x348d70,_0x1a47fa,_0x353bd9,_0x59d22f)[_0xee7e('0x28')](function(){_0x4494d3=path[_0xee7e('0x3b')](__dirname,_0xee7e('0x35'),rs['generate'](0x4)+_0xee7e('0x3c'));return convertFile(_0x59d22f,_0x4494d3);})[_0xee7e('0x28')](function(){try{fs[_0xee7e('0x1d')](_0x59d22f);fs[_0xee7e('0x3a')](_0x4494d3,'777');}catch(_0x396ee9){logger['error'](_0x396ee9);}return _0x4494d3[_0xee7e('0x2a')]('.')[0x0];});};exports[_0xee7e('0x7e')]=function(_0x4dbe5a,_0x306bb3,_0x4a6943,_0x10b442,_0x3f40e0,_0x1771dc){return aws[_0xee7e('0x7f')](_0x4dbe5a,_0x306bb3,_0x4a6943,_0x10b442,_0x3f40e0,_0x1771dc)[_0xee7e('0x28')](function(_0x1b5dac){logger['info'](JSON[_0xee7e('0x44')](_0x1b5dac));return _0x1b5dac;});};exports[_0xee7e('0x80')]=function(_0x3070c3,_0x4a1f62,_0x111ae1,_0x150fbc){var _0xe4cee8=util[_0xee7e('0x81')](_0xee7e('0x82'),ISPEECH_API,_0x3070c3,encodeURIComponent(_0x4a1f62),_0x111ae1,_0x150fbc);var _0x5163d6=path[_0xee7e('0x3b')](__dirname,_0xee7e('0x35'),rs[_0xee7e('0x25')](0x4)+_0xee7e('0x36'));var _0x1fa592;return downloadFile(_0xe4cee8,_0x5163d6)[_0xee7e('0x28')](function(){_0x1fa592=path['resolve'](__dirname,_0xee7e('0x35'),rs['generate'](0x4)+_0xee7e('0x3c'));return convertFile(_0x5163d6,_0x1fa592);})[_0xee7e('0x28')](function(){try{fs['unlink'](_0x5163d6);fs[_0xee7e('0x3a')](_0x1fa592,_0xee7e('0x29'));}catch(_0xae4a08){logger[_0xee7e('0x1f')](_0xae4a08);}return _0x1fa592[_0xee7e('0x2a')]('.')[0x0];});};exports[_0xee7e('0x83')]=function(_0x3ced63,_0x4c1866,_0xe7058b,_0x43c7c1){var _0x1c77ca=util[_0xee7e('0x81')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4c1866,_0xe7058b,base64Encode(_0x3ced63),_0x43c7c1?util[_0xee7e('0x81')](_0xee7e('0x84'),encodeURIComponent(_0x43c7c1)):'freeform=3');return uploadFile(_0x1c77ca)['then'](function(_0x17217c){return querystring[_0xee7e('0x9')](_0x17217c);});};exports[_0xee7e('0x85')]=function(_0x1fae20,_0x23decf){return sestek['nda'](_0x1fae20,_0x23decf)[_0xee7e('0x28')](function(_0x19a905){logger[_0xee7e('0x1b')](JSON[_0xee7e('0x44')](_0x19a905));var _0x55f176={'speech':_0x19a905[_0xee7e('0x86')],'action':_0x19a905[_0xee7e('0x87')]?_0x19a905[_0xee7e('0x87')][_0xee7e('0x88')]:undefined,'actiondata':_0x19a905[_0xee7e('0x87')]?_0x19a905['channelData'][_0xee7e('0x89')]:undefined};if(_0x19a905[_0xee7e('0x87')]&&_0x19a905['channelData'][_0xee7e('0x8a')]){return base64Decode(_0x19a905['channelData'][_0xee7e('0x8a')][_0xee7e('0x8b')],path[_0xee7e('0x3b')](__dirname,'tmp',rs[_0xee7e('0x25')](0x4)+_0xee7e('0x3c')))[_0xee7e('0x28')](function(_0x51510e){_0x55f176[_0xee7e('0x8c')]=_0x51510e;return _0x55f176;});}return _0x55f176;});};exports[_0xee7e('0x8d')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 0eda926..bf8f9ce 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3bf=['exports','./nda'];(function(_0x59fffc,_0x526e06){var _0x4e168e=function(_0x2194d8){while(--_0x2194d8){_0x59fffc['push'](_0x59fffc['shift']());}};_0x4e168e(++_0x526e06);}(_0xb3bf,0x175));var _0xfb3b=function(_0x5be2a6,_0x4dd539){_0x5be2a6=_0x5be2a6-0x0;var _0x525fa5=_0xb3bf[_0x5be2a6];return _0x525fa5;};var nda=require(_0xfb3b('0x0'));module[_0xfb3b('0x1')]={'nda':nda}; \ No newline at end of file +var _0xfa57=['./nda'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xfa57,0x175));var _0x7fa5=function(_0x43ec9a,_0x2b4c01){_0x43ec9a=_0x43ec9a-0x0;var _0x45c100=_0xfa57[_0x43ec9a];return _0x45c100;};var nda=require(_0x7fa5('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 632f086..52b3586 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f69=['AudioOutputSettings','CustomAction','custom_action','custom_action_data','channelData','CustomActionData','stringify','../../../../../config/logger','exports','POST','ndauth_url','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','extension','Bearer\x20','body','ProjectName','project','ndagenerate_audio'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x0f69,0x173));var _0x90f6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0f69[_0xfae23b];return _0x200640;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x90f6('0x0'))('agi');module[_0x90f6('0x1')]=function(_0xac4ba6,_0x4a1481){var _0xd26ab5={'method':_0x90f6('0x2'),'uri':url['resolve'](_0x4a1481[_0x90f6('0x3')],'/token'),'form':{'grant_type':_0x90f6('0x4'),'username':_0x4a1481[_0x90f6('0x5')],'password':_0x4a1481[_0x90f6('0x4')]},'json':!![]};return rp(_0xd26ab5)[_0x90f6('0x6')](function(_0x3bc2eb){var _0x42044f={'method':_0x90f6('0x2'),'uri':url[_0x90f6('0x7')](_0x4a1481[_0x90f6('0x8')],_0x90f6('0x9')),'body':{'type':_0x4a1481[_0x90f6('0xa')]||_0x90f6('0xb'),'channelId':_0x90f6('0xc'),'conversation':{'id':_0xac4ba6['uniqueid']},'from':{'id':_0xac4ba6[_0x90f6('0xd')],'name':_0xac4ba6[_0x90f6('0xe')]},'recipient':{'id':_0xac4ba6['dnid'],'name':_0xac4ba6[_0x90f6('0xf')]},'text':_0x4a1481['text'],'channelData':{}},'headers':{'Authorization':_0x90f6('0x10')+_0x3bc2eb['access_token']},'json':!![]};if(_0x4a1481['project']){_0x42044f[_0x90f6('0x11')]['channelData'][_0x90f6('0x12')]=_0x4a1481[_0x90f6('0x13')];}if(_0x4a1481[_0x90f6('0x14')]=='1'){_0x42044f[_0x90f6('0x11')]['channelData'][_0x90f6('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x4a1481['custom_action']){_0x42044f[_0x90f6('0x11')]['channelData'][_0x90f6('0x16')]=_0x4a1481[_0x90f6('0x17')];if(_0x4a1481[_0x90f6('0x18')]){_0x42044f[_0x90f6('0x11')][_0x90f6('0x19')][_0x90f6('0x1a')]=_0x4a1481[_0x90f6('0x18')];}}logger['info'](JSON[_0x90f6('0x1b')](_0x42044f));return rp(_0x42044f);});}; \ No newline at end of file +var _0x8ec7=['stringify','request-promise','url','agi','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info'];(function(_0x2655de,_0x281ede){var _0x2d62cd=function(_0x45da99){while(--_0x45da99){_0x2655de['push'](_0x2655de['shift']());}};_0x2d62cd(++_0x281ede);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x8ec7[_0x117f4c];return _0x2b24e9;};'use strict';var rp=require(_0x78ec('0x0'));var url=require(_0x78ec('0x1'));var logger=require('../../../../../config/logger')(_0x78ec('0x2'));module['exports']=function(_0x47d4c9,_0x1271a1){var _0x3b9496={'method':'POST','uri':url[_0x78ec('0x3')](_0x1271a1[_0x78ec('0x4')],_0x78ec('0x5')),'form':{'grant_type':_0x78ec('0x6'),'username':_0x1271a1[_0x78ec('0x7')],'password':_0x1271a1['password']},'json':!![]};return rp(_0x3b9496)[_0x78ec('0x8')](function(_0x4ca55e){var _0x372108={'method':_0x78ec('0x9'),'uri':url[_0x78ec('0x3')](_0x1271a1['ndassistant_url'],_0x78ec('0xa')),'body':{'type':_0x1271a1[_0x78ec('0xb')]||_0x78ec('0xc'),'channelId':_0x78ec('0xd'),'conversation':{'id':_0x47d4c9[_0x78ec('0xe')]},'from':{'id':_0x47d4c9['callerid'],'name':_0x47d4c9['calleridname']},'recipient':{'id':_0x47d4c9[_0x78ec('0xf')],'name':_0x47d4c9[_0x78ec('0x10')]},'text':_0x1271a1[_0x78ec('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4ca55e[_0x78ec('0x12')]},'json':!![]};if(_0x1271a1[_0x78ec('0x13')]){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x16')]=_0x1271a1[_0x78ec('0x13')];}if(_0x1271a1[_0x78ec('0x17')]=='1'){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x78ec('0x19')};}if(_0x1271a1['custom_action']){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x1a')]=_0x1271a1[_0x78ec('0x1b')];if(_0x1271a1[_0x78ec('0x1c')]){_0x372108['body']['channelData']['CustomActionData']=_0x1271a1['custom_action_data'];}}logger[_0x78ec('0x1d')](JSON[_0x78ec('0x1e')](_0x372108));return rp(_0x372108);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index 3bdcf5f..e2c5c20 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0205=['./lib/api','exports'];(function(_0x245707,_0x30e2e5){var _0x455909=function(_0x55e675){while(--_0x55e675){_0x245707['push'](_0x245707['shift']());}};_0x455909(++_0x30e2e5);}(_0x0205,0xfc));var _0x5020=function(_0x5372a9,_0xa3b70b){_0x5372a9=_0x5372a9-0x0;var _0x43d842=_0x0205[_0x5372a9];return _0x43d842;};'use strict';var asr=require(_0x5020('0x0'));module[_0x5020('0x1')]=function(_0x60ce70,_0x36c980,_0x31ed5c,_0x43d8b3){return asr(_0x60ce70,_0x36c980,_0x31ed5c,_0x43d8b3);}; \ No newline at end of file +var _0x1d5a=['exports','./lib/api'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1d5a,0x17b));var _0xa1d5=function(_0x2db55f,_0x41581b){_0x2db55f=_0x2db55f-0x0;var _0x375691=_0x1d5a[_0x2db55f];return _0x375691;};'use strict';var asr=require(_0xa1d5('0x0'));module[_0xa1d5('0x1')]=function(_0x5d2feb,_0x15795e,_0x125ff9,_0x3688d5){return asr(_0x5d2feb,_0x15795e,_0x125ff9,_0x3688d5);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index 2670b65..0678bf3 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7081=['stringify','createReadStream','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','send'];(function(_0x527a13,_0x45fb6c){var _0x1a5304=function(_0x3cfd34){while(--_0x3cfd34){_0x527a13['push'](_0x527a13['shift']());}};_0x1a5304(++_0x45fb6c);}(_0x7081,0xb3));var _0x1708=function(_0x281a28,_0x34542c){_0x281a28=_0x281a28-0x0;var _0x54f40c=_0x7081[_0x281a28];return _0x54f40c;};'use strict';var BPromise=require(_0x1708('0x0'));var _=require(_0x1708('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1708('0x2'));var crypto=require(_0x1708('0x3'));var logger=require(_0x1708('0x4'))(_0x1708('0x5'));module[_0x1708('0x6')]=function(_0x28bc09,_0x4256d7,_0x10979d,_0x2c7486){return new BPromise(function(_0x405a58,_0x4a8d5b){logger[_0x1708('0x7')](_0x1708('0x8'),_0x2c7486||_0x1708('0x9'));var _0x2eb11f=new WebSocket(_0x2c7486||_0x1708('0x9'),{'perMessageDeflate':![]});var _0x581e6f='';var _0x4f0d35='0';var _0x302cc9='1';var _0x209a9b=_0x1708('0xa');function _0x5ed6fc(_0x63795d){var _0x5ec688=crypto[_0x1708('0xb')](_0x1708('0xc'));_0x5ec688['update'](_0x63795d);return _0x5ec688[_0x1708('0xd')](_0x1708('0xe'));}function _0x3cf4bb(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x23a47b=moment()['unix']();var _0x121324=_0x5ed6fc(_0x23a47b+_0x4256d7+_0x10979d);_0x2eb11f[_0x1708('0xf')](JSON[_0x1708('0x10')]({'appID':_0x4256d7,'timestamp':_0x23a47b,'appKey':_0x121324}));var _0x5675d2=fs[_0x1708('0x11')](_0x28bc09);_0x5675d2['on']('data',function(_0x31c332){_0x2eb11f[_0x1708('0xf')](_0x31c332);});_0x5675d2['on'](_0x1708('0x12'),function(){_0x2eb11f[_0x1708('0xf')]('EOS');});}catch(_0xeef4c4){logger['error'](_0x1708('0x13'),JSON[_0x1708('0x10')](_0xeef4c4));_0x2eb11f[_0x1708('0x14')]();}}function _0xcfe969(_0x49a8a1){try{if(_0x49a8a1){var _0x337513=JSON[_0x1708('0x15')](_0x49a8a1);switch(_0x337513[_0x1708('0x16')]){case 0x0:if(_0x337513[_0x1708('0x17')]){if(_0x337513['result'][_0x1708('0x18')]){logger[_0x1708('0x7')](_0x1708('0x19'),JSON[_0x1708('0x10')](_0x337513[_0x1708('0x17')][_0x1708('0x1a')]));_0x581e6f=_0x337513['result'][_0x1708('0x1a')][0x0]['transcript'];_0x4f0d35=_0x337513[_0x1708('0x17')][_0x1708('0x1a')][0x0][_0x1708('0x1b')];_0x302cc9='0';_0x209a9b=_0x1708('0x1c');_0x2eb11f[_0x1708('0x14')]();}}break;case 0x1:logger['info'](_0x1708('0xa'));_0x302cc9='1';_0x209a9b=_0x1708('0xa');break;case 0x2:logger[_0x1708('0x7')](_0x1708('0x1d'));_0x302cc9='2';_0x209a9b=_0x1708('0x1d');break;case 0x9:logger[_0x1708('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x302cc9='9';_0x209a9b=_0x1708('0x1e');break;case 0xa:logger[_0x1708('0x7')]('Authentication\x20failed.');_0x302cc9='10';_0x209a9b=_0x1708('0x1f');break;case 0xb:logger[_0x1708('0x7')](_0x1708('0x20'));_0x302cc9='11';_0x209a9b=_0x1708('0x20');}}}catch(_0x316636){logger[_0x1708('0x21')](_0x1708('0x22'),JSON[_0x1708('0x10')](_0x316636));_0x2eb11f['terminate']();}}function _0x3d3de0(){logger[_0x1708('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0x405a58({'transcript':_0x581e6f,'confidence':_0x4f0d35,'status':_0x302cc9,'status_message':_0x209a9b});}function _0x1d2639(_0x295be3){logger[_0x1708('0x21')](_0x1708('0x23'));if(!_[_0x1708('0x24')](_0x295be3)){logger[_0x1708('0x21')](_[_0x1708('0x25')](_0x295be3)?JSON[_0x1708('0x10')](_0x295be3):_0x295be3);}}_0x2eb11f['on']('open',_0x3cf4bb);_0x2eb11f['on'](_0x1708('0x26'),_0xcfe969);_0x2eb11f['on'](_0x1708('0x12'),_0x3d3de0);_0x2eb11f['on'](_0x1708('0x21'),_0x1d2639);});}; \ No newline at end of file +var _0xa490=['hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xa490,0x1dc));var _0x0a49=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa490[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x0a49('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0a49('0x1'));var crypto=require(_0x0a49('0x2'));var logger=require(_0x0a49('0x3'))(_0x0a49('0x4'));module[_0x0a49('0x5')]=function(_0x2f5a90,_0x55245f,_0x4547d3,_0x102fd6){return new BPromise(function(_0x3824b9,_0x5859c0){logger[_0x0a49('0x6')](_0x0a49('0x7'),_0x102fd6||_0x0a49('0x8'));var _0x2e67d4=new WebSocket(_0x102fd6||_0x0a49('0x8'),{'perMessageDeflate':![]});var _0x2aecac='';var _0x192b72='0';var _0x3ffb32='1';var _0x120980=_0x0a49('0x9');function _0x53b9a3(_0x4f8235){var _0x4aece5=crypto[_0x0a49('0xa')](_0x0a49('0xb'));_0x4aece5['update'](_0x4f8235);return _0x4aece5[_0x0a49('0xc')]('hex');}function _0x59c45e(){try{logger[_0x0a49('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x3a9aec=moment()[_0x0a49('0xd')]();var _0x50bee9=_0x53b9a3(_0x3a9aec+_0x55245f+_0x4547d3);_0x2e67d4[_0x0a49('0xe')](JSON[_0x0a49('0xf')]({'appID':_0x55245f,'timestamp':_0x3a9aec,'appKey':_0x50bee9}));var _0x145988=fs[_0x0a49('0x10')](_0x2f5a90);_0x145988['on'](_0x0a49('0x11'),function(_0x25d840){_0x2e67d4[_0x0a49('0xe')](_0x25d840);});_0x145988['on'](_0x0a49('0x12'),function(){_0x2e67d4[_0x0a49('0xe')](_0x0a49('0x13'));});}catch(_0x4f6fac){logger[_0x0a49('0x14')](_0x0a49('0x15'),JSON[_0x0a49('0xf')](_0x4f6fac));_0x2e67d4[_0x0a49('0x16')]();}}function _0x222d29(_0x4b7eb0){try{if(_0x4b7eb0){var _0x5dd7f7=JSON[_0x0a49('0x17')](_0x4b7eb0);switch(_0x5dd7f7[_0x0a49('0x18')]){case 0x0:if(_0x5dd7f7[_0x0a49('0x19')]){if(_0x5dd7f7[_0x0a49('0x19')][_0x0a49('0x1a')]){logger[_0x0a49('0x6')](_0x0a49('0x1b'),JSON[_0x0a49('0xf')](_0x5dd7f7['result'][_0x0a49('0x1c')]));_0x2aecac=_0x5dd7f7['result']['hypotheses'][0x0][_0x0a49('0x1d')];_0x192b72=_0x5dd7f7['result']['hypotheses'][0x0][_0x0a49('0x1e')];_0x3ffb32='0';_0x120980=_0x0a49('0x1f');_0x2e67d4['terminate']();}}break;case 0x1:logger[_0x0a49('0x6')](_0x0a49('0x9'));_0x3ffb32='1';_0x120980=_0x0a49('0x9');break;case 0x2:logger[_0x0a49('0x6')](_0x0a49('0x20'));_0x3ffb32='2';_0x120980='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x0a49('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3ffb32='9';_0x120980=_0x0a49('0x21');break;case 0xa:logger[_0x0a49('0x6')](_0x0a49('0x22'));_0x3ffb32='10';_0x120980=_0x0a49('0x22');break;case 0xb:logger[_0x0a49('0x6')](_0x0a49('0x23'));_0x3ffb32='11';_0x120980=_0x0a49('0x23');}}}catch(_0x4cfc32){logger[_0x0a49('0x14')](_0x0a49('0x24'),JSON[_0x0a49('0xf')](_0x4cfc32));_0x2e67d4[_0x0a49('0x16')]();}}function _0x217c55(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x3824b9({'transcript':_0x2aecac,'confidence':_0x192b72,'status':_0x3ffb32,'status_message':_0x120980});}function _0x129b07(_0x477843){logger[_0x0a49('0x14')](_0x0a49('0x25'));if(!_[_0x0a49('0x26')](_0x477843)){logger[_0x0a49('0x14')](_[_0x0a49('0x27')](_0x477843)?JSON[_0x0a49('0xf')](_0x477843):_0x477843);}}_0x2e67d4['on'](_0x0a49('0x28'),_0x59c45e);_0x2e67d4['on'](_0x0a49('0x29'),_0x222d29);_0x2e67d4['on'](_0x0a49('0x12'),_0x217c55);_0x2e67d4['on'](_0x0a49('0x14'),_0x129b07);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 6e28e1e..1f14954 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e03=['exports'];(function(_0x8aef0f,_0x37c5b9){var _0xd726f7=function(_0x1c6501){while(--_0x1c6501){_0x8aef0f['push'](_0x8aef0f['shift']());}};_0xd726f7(++_0x37c5b9);}(_0x5e03,0x151));var _0x35e0=function(_0x1757a4,_0x40ed2d){_0x1757a4=_0x1757a4-0x0;var _0x354b64=_0x5e03[_0x1757a4];return _0x354b64;};var asr=require('./asr');module[_0x35e0('0x0')]={'asr':asr}; \ No newline at end of file +var _0xbb86=['exports','./asr'];(function(_0x2a7e52,_0x3765ff){var _0x37c7e2=function(_0x92203a){while(--_0x92203a){_0x2a7e52['push'](_0x2a7e52['shift']());}};_0x37c7e2(++_0x3765ff);}(_0xbb86,0x141));var _0x6bb8=function(_0x4a5356,_0x20f134){_0x4a5356=_0x4a5356-0x0;var _0x4beb93=_0xbb86[_0x4a5356];return _0x4beb93;};var asr=require(_0x6bb8('0x0'));module[_0x6bb8('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 071c178..627b82d 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x100f=['events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net'];(function(_0x3ff63e,_0x417994){var _0x238941=function(_0x48672d){while(--_0x48672d){_0x3ff63e['push'](_0x3ff63e['shift']());}};_0x238941(++_0x417994);}(_0x100f,0x12a));var _0xf100=function(_0x24e729,_0x4a3bfb){_0x24e729=_0x24e729-0x0;var _0x2a4804=_0x100f[_0x24e729];return _0x2a4804;};'use strict';var util=require(_0xf100('0x0'));var net=require(_0xf100('0x1'));var EventEmitter=require(_0xf100('0x2'))[_0xf100('0x3')];var AGIError=require(_0xf100('0x4'));var AGIChannel=require(_0xf100('0x5'));var AGIServer=function(_0x5c6c45,_0x1937e5,_0x59e81f){var _0x36c922=this,_0x5c6c45=_0x5c6c45||0x11dd,_0x1937e5=_0x1937e5||_0xf100('0x6'),_0x1f90ca=null,_0x4727e1=0x0;EventEmitter[_0xf100('0x7')](_0x36c922);function _0x42f742(){if(!_0x5c6c45){_0x36c922[_0xf100('0x8')](_0xf100('0x9'),new AGIError(_0xf100('0xa')));return![];}_0x1f90ca=net['createServer']();_0x1f90ca[_0xf100('0xb')](_0x5c6c45,_0x1937e5);_0x1f90ca['on'](_0xf100('0xc'),function(){_0x36c922[_0xf100('0x8')](_0xf100('0xc'));});_0x1f90ca['on'](_0xf100('0xd'),function(_0x4a0da1){_0x1f90ca[_0xf100('0xe')](function(_0x58914d,_0x5c045e){if(_0x58914d){_0x36c922[_0xf100('0x8')](_0xf100('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x58914d));}else if(_0x59e81f&&_0x59e81f<0x0){_0x36c922[_0xf100('0x8')]('error',new AGIError(_0xf100('0xf')));_0x4a0da1[_0xf100('0x10')]();}else if(_0x59e81f&&_0x59e81f>0x0&&_0x59e81f<_0x5c045e){_0x4727e1+=0x1;_0x36c922[_0xf100('0x8')](_0xf100('0x9'),new AGIError(_0xf100('0x11'),_0x4727e1));_0x4a0da1[_0xf100('0x10')]();}else{var _0x5a9da8=new AGIChannel(_0x4a0da1);_0x5a9da8['on'](_0xf100('0x12'),function(){_0x36c922[_0xf100('0x8')]('connection',_0x5a9da8);});}});});_0x1f90ca['on'](_0xf100('0x9'),function(_0x5aff30){_0x36c922[_0xf100('0x8')](_0xf100('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x5aff30[_0xf100('0x13')]));});_0x1f90ca['on'](_0xf100('0x14'),function(){_0x36c922[_0xf100('0x8')](_0xf100('0x14'),new AGIError(_0xf100('0x15')));});}process[_0xf100('0x16')](function(){_0x42f742();});};util[_0xf100('0x17')](AGIServer,EventEmitter);module[_0xf100('0x18')]=function(_0x4e387c,_0x4b3587,_0x3d972a){return new AGIServer(_0x4e387c,_0x4b3587,_0x3d972a);}; \ No newline at end of file +var _0x2416=['getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','E_AGI_SERVER_CLOSE','nextTick','inherits','net','./channel','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection'];(function(_0x4f7328,_0xb7c747){var _0xf5da4a=function(_0x4476cc){while(--_0x4476cc){_0x4f7328['push'](_0x4f7328['shift']());}};_0xf5da4a(++_0xb7c747);}(_0x2416,0x1bb));var _0x6241=function(_0x3df0b6,_0xc408a9){_0x3df0b6=_0x3df0b6-0x0;var _0x439783=_0x2416[_0x3df0b6];return _0x439783;};'use strict';var util=require('util');var net=require(_0x6241('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x6241('0x1'));var AGIServer=function(_0x5d6a22,_0x1e5e16,_0x167476){var _0x398fc4=this,_0x5d6a22=_0x5d6a22||0x11dd,_0x1e5e16=_0x1e5e16||'127.0.0.1',_0x17149d=null,_0xc1c10a=0x0;EventEmitter['call'](_0x398fc4);function _0x10e6d7(){if(!_0x5d6a22){_0x398fc4[_0x6241('0x2')]('error',new AGIError(_0x6241('0x3')));return![];}_0x17149d=net['createServer']();_0x17149d[_0x6241('0x4')](_0x5d6a22,_0x1e5e16);_0x17149d['on'](_0x6241('0x5'),function(){_0x398fc4[_0x6241('0x2')](_0x6241('0x5'));});_0x17149d['on'](_0x6241('0x6'),function(_0x2c3120){_0x17149d[_0x6241('0x7')](function(_0x5f5420,_0x234421){if(_0x5f5420){_0x398fc4[_0x6241('0x2')](_0x6241('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x5f5420));}else if(_0x167476&&_0x167476<0x0){_0x398fc4[_0x6241('0x2')](_0x6241('0x8'),new AGIError(_0x6241('0x9')));_0x2c3120[_0x6241('0xa')]();}else if(_0x167476&&_0x167476>0x0&&_0x167476<_0x234421){_0xc1c10a+=0x1;_0x398fc4[_0x6241('0x2')](_0x6241('0x8'),new AGIError(_0x6241('0xb'),_0xc1c10a));_0x2c3120[_0x6241('0xa')]();}else{var _0x2bc172=new AGIChannel(_0x2c3120);_0x2bc172['on'](_0x6241('0xc'),function(){_0x398fc4[_0x6241('0x2')]('connection',_0x2bc172);});}});});_0x17149d['on'](_0x6241('0x8'),function(_0x5f3fd7){_0x398fc4[_0x6241('0x2')]('error',new AGIError(_0x6241('0xd'),_0x5f3fd7[_0x6241('0xe')]));});_0x17149d['on']('close',function(){_0x398fc4[_0x6241('0x2')]('close',new AGIError(_0x6241('0xf')));});}process[_0x6241('0x10')](function(){_0x10e6d7();});};util[_0x6241('0x11')](AGIServer,EventEmitter);module['exports']=function(_0x9e68ce,_0x35556d,_0x377098){return new AGIServer(_0x9e68ce,_0x35556d,_0x377098);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d68d777..0aaecf8 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdd6=['../../config/environment','./scripts','rawHeaders','menu','getdigits','getsecretdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','getPause','getPauseById','agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','text','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','method','timeout','number','includes','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','url','render','headers','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','result','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','delay','minutes','callback_priority','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','phone','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','getData','maxdigit','toString','test','stringify','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','toLowerCase','QUEUE','macro','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi'];(function(_0x20e899,_0x441dd0){var _0xf78e7a=function(_0x5498fe){while(--_0x5498fe){_0x20e899['push'](_0x20e899['shift']());}};_0xf78e7a(++_0x441dd0);}(_0xcdd6,0x1be));var _0x6cdd=function(_0xeba907,_0x48670c){_0xeba907=_0xeba907-0x0;var _0x2f4776=_0xcdd6[_0xeba907];return _0x2f4776;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x6cdd('0x0'));var _=require(_0x6cdd('0x1'));var sh=require(_0x6cdd('0x2'));var odbc=require(_0x6cdd('0x3'))();var rs=require('randomstring');var moment=require(_0x6cdd('0x4'));var Mustache=require('mustache');var rp=require(_0x6cdd('0x5'));var logger=require(_0x6cdd('0x6'))(_0x6cdd('0x7'));var config=require(_0x6cdd('0x8'));var scripts=require(_0x6cdd('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x6cdd('0xa'),'rawBody'];var verticesWithRetry=[_0x6cdd('0xb'),_0x6cdd('0xc'),_0x6cdd('0xd')];var AGIVertices=function(_0x2bd89d,_0x3e4b9f,_0x1229e3){this['channel']=_0x2bd89d;this['rpc']=_0x3e4b9f;this[_0x6cdd('0xe')]=_0x1229e3;};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x10')]=function(_0xda0be5,_0x16a76a){this[_0x6cdd('0x11')][_0x6cdd('0x12')](_0xda0be5)[_0x6cdd('0x13')](function(_0x5844ca){_0x16a76a(null,_0x5844ca?_0x5844ca['name']:![]);})[_0x6cdd('0x14')](function(_0x1407fd){_0x16a76a(_0x1407fd);});};AGIVertices['prototype'][_0x6cdd('0x15')]=function(_0x189989,_0x328e7a){this[_0x6cdd('0x11')][_0x6cdd('0x16')](_0x189989)[_0x6cdd('0x13')](function(_0x212b9d){_0x328e7a(null,_0x212b9d?_0x212b9d[_0x6cdd('0x17')]:![]);})[_0x6cdd('0x14')](function(_0x2b95d8){_0x328e7a(_0x2b95d8);});};AGIVertices['prototype'][_0x6cdd('0x18')]=function(_0x5a70c9,_0x5a6da3){this[_0x6cdd('0x11')][_0x6cdd('0x19')](_0x5a70c9)[_0x6cdd('0x13')](function(_0x10843f){_0x5a6da3(null,_0x10843f?_0x10843f['name']:![]);})[_0x6cdd('0x14')](function(_0x3b73ff){_0x5a6da3(_0x3b73ff);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1a')]=function(_0x58c8d1,_0x3617d5){this[_0x6cdd('0x11')]['getSquareOdbcById'](_0x58c8d1)['then'](function(_0x2efb7d){_0x3617d5(null,_0x2efb7d?_0x2efb7d[_0x6cdd('0x1b')]:![]);})[_0x6cdd('0x14')](function(_0x462709){_0x3617d5(_0x462709);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1c')]=function(_0x1fc6ee,_0x100b82){this[_0x6cdd('0x11')][_0x6cdd('0x1d')](_0x1fc6ee)[_0x6cdd('0x13')](function(_0x56a0c7){_0x100b82(null,_0x56a0c7?_0x56a0c7[_0x6cdd('0x17')]:![]);})[_0x6cdd('0x14')](function(_0x42c682){_0x100b82(_0x42c682);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1e')]=function(_0xbe1d4b,_0x52c533){this[_0x6cdd('0x11')][_0x6cdd('0x1f')](_0xbe1d4b)['then'](function(_0x1c298f){_0x52c533(null,_0x1c298f?_0x1c298f[_0x6cdd('0x17')]:![]);})[_0x6cdd('0x14')](function(_0x43e2b4){_0x52c533(_0x43e2b4);});};AGIVertices[_0x6cdd('0xf')]['getSound']=function(_0x250e0d,_0x194853){var _0x316184=this;this[_0x6cdd('0x11')][_0x6cdd('0x20')](_0x250e0d)[_0x6cdd('0x13')](function(_0x3bb04f){_0x194853(null,_0x3bb04f?_0x316184[_0x6cdd('0x21')](_0x3bb04f['save_name']):![]);})['catch'](function(_0x587c65){_0x194853(_0x587c65);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x22')]=function(_0x151617,_0x14d9bc){this['rpc'][_0x6cdd('0x23')](_0x151617)['then'](function(_0x560ff9){_0x14d9bc(null,_0x560ff9?_0x560ff9:![]);})[_0x6cdd('0x14')](function(_0x3b5276){_0x14d9bc(_0x3b5276);});};AGIVertices[_0x6cdd('0xf')]['sendMailMessage']=function(_0x380d65,_0xea8320,_0x406a80){this[_0x6cdd('0xe')][_0x6cdd('0x24')](_0x380d65,_0xea8320)[_0x6cdd('0x13')](function(){_0x406a80(null);})[_0x6cdd('0x14')](function(_0x541396){_0x406a80(_0x541396);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x25')]=function(_0x1332e4,_0x469496){this[_0x6cdd('0x11')][_0x6cdd('0x26')](_0x1332e4)['then'](function(_0x2979d1){if(_0x2979d1){if(_0x2979d1[_0x6cdd('0x27')]){_0x469496(null,[_0x2979d1[_0x6cdd('0x28')]]);}else{_0x469496(null,_[_0x6cdd('0x29')](_0x2979d1['Intervals'],_0x6cdd('0x28')));}}else{_0x469496(null,![]);}})[_0x6cdd('0x14')](function(_0x1ad660){_0x469496(_0x1ad660);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x21')]=function(_0x564c44){return util[_0x6cdd('0x2a')](_0x6cdd('0x2b'),FILES_PATH,_0x564c44);};AGIVertices['prototype'][_0x6cdd('0x2c')]=function(_0x3618a5,_0x11dd90,_0x3f28c3){odbc['open'](_0x3618a5,function(_0x308fb5){if(_0x308fb5){logger[_0x6cdd('0x2d')](_0x6cdd('0x2e'),_0x308fb5);_0x3f28c3(_0x308fb5);}else{logger[_0x6cdd('0x2f')](_0x6cdd('0x30'));odbc['query'](_0x11dd90,function(_0x3370ea,_0x59bed8){if(_0x3370ea){logger[_0x6cdd('0x2f')](_0x6cdd('0x31'),_0x11dd90);_0x3f28c3(_0x3370ea);}else{logger[_0x6cdd('0x2f')](_0x6cdd('0x32'),_0x11dd90);odbc['close'](function(_0x2265bd){if(_0x2265bd){logger[_0x6cdd('0x2d')](_0x6cdd('0x33'),_0x2265bd);}_0x3f28c3(null,_0x59bed8);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x3684a3,_0x124773){this[_0x6cdd('0x11')][_0x6cdd('0x34')](_0x3684a3)[_0x6cdd('0x13')](function(_0xdd2173){_0x124773(null,_0xdd2173?_0xdd2173:![]);})[_0x6cdd('0x14')](function(_0x5e9afa){_0x124773(_0x5e9afa);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x35')]=function(_0x590bd5,_0x334f56){this['rpc'][_0x6cdd('0x35')](_0x590bd5)[_0x6cdd('0x13')](function(_0x522902){_0x334f56(null,_0x522902);})[_0x6cdd('0x14')](function(_0x405069){_0x334f56(_0x405069);});};AGIVertices[_0x6cdd('0xf')]['createSquareDetailsReport']=function(_0x5796d7,_0x570d09,_0x2acafe){this[_0x6cdd('0x11')][_0x6cdd('0x36')]({'uniqueid':this[_0x6cdd('0x37')][_0x6cdd('0x38')],'node':_0x5796d7[_0x6cdd('0x39')],'application':_0x5796d7[_0x6cdd('0x3a')],'data':_0x570d09||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x6cdd('0x37')][_0x6cdd('0x3b')]})[_0x6cdd('0x13')](function(_0x5570d7){if(_0x2acafe){_0x2acafe(null,_0x5570d7);}})[_0x6cdd('0x14')](function(_0x3c99e1){if(_0x2acafe){_0x2acafe(_0x3c99e1);}});};AGIVertices['prototype'][_0x6cdd('0x3c')]=function(_0x4ad327,_0x434806,_0x2dc809,_0x19bba4){this[_0x6cdd('0x11')]['createSquareRecording']({'uniqueid':this[_0x6cdd('0x37')][_0x6cdd('0x38')],'callerid':this['channel'][_0x6cdd('0x3b')],'calleridname':this[_0x6cdd('0x37')][_0x6cdd('0x3d')],'context':this[_0x6cdd('0x37')][_0x6cdd('0x3e')],'extension':this[_0x6cdd('0x37')][_0x6cdd('0x3f')],'priority':this['channel']['priority'],'accountcode':this['channel'][_0x6cdd('0x40')],'dnid':this['channel'][_0x6cdd('0x41')],'projectName':this[_0x6cdd('0x37')][_0x6cdd('0x42')],'saveName':_0x434806,'filename':_0x4ad327['file']||_0x434806,'savePath':_0x2dc809})['then'](function(_0x447472){_0x19bba4(null,_0x447472);})[_0x6cdd('0x14')](function(_0x10ba07){_0x19bba4(_0x10ba07);});};AGIVertices['prototype'][_0x6cdd('0x43')]=function(_0x58a3cc,_0x585be4,_0x4d8c7e,_0x571cfd,_0x230575){this[_0x6cdd('0x11')][_0x6cdd('0x43')]({'uniqueid':this[_0x6cdd('0x37')]['uniqueid'],'body':_0x58a3cc,'direction':_0x585be4,'providerName':_0x4d8c7e,'providerResponse':_0x571cfd})[_0x6cdd('0x13')](function(_0x5ee208){if(_0x230575){_0x230575(null,_0x5ee208);}})['catch'](function(_0x334120){if(_0x230575){_0x230575(_0x334120);}});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x44')]=function(_0x9c1950,_0x20e5ee){this[_0x6cdd('0x11')][_0x6cdd('0x44')]({'firstName':_[_0x6cdd('0x45')](_0x9c1950[_0x6cdd('0x17')])||_[_0x6cdd('0x46')](_0x9c1950['name'])?_0x6cdd('0x47')+Math[_0x6cdd('0x48')]():_0x9c1950[_0x6cdd('0x17')],'lastName':_[_0x6cdd('0x45')](_0x9c1950[_0x6cdd('0x49')])||_[_0x6cdd('0x46')](_0x9c1950[_0x6cdd('0x49')])?null:_0x9c1950[_0x6cdd('0x49')],'phone':_0x9c1950['phone'],'ListId':_0x9c1950[_0x6cdd('0x4a')],'scheduledat':_0x9c1950[_0x6cdd('0x4b')],'callbackUniqueid':this[_0x6cdd('0x37')][_0x6cdd('0x38')],'tags':_0x6cdd('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x9c1950[_0x6cdd('0x4b')]['toString'](),'priority':_0x9c1950['callback_priority']})['then'](function(_0x3a5759){_0x20e5ee(null,_0x3a5759);})['catch'](function(_0x451236){_0x20e5ee(_0x451236);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x4d')]=function(_0x1662de,_0x5171db){this['rpc'][_0x6cdd('0x4e')](_0x1662de)['then'](function(_0x341975){_0x5171db(null,_0x341975?_0x341975[_0x6cdd('0x17')]:![]);})[_0x6cdd('0x14')](function(_0x7547e8){_0x5171db(_0x7547e8);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x4f')]=function(_0x55911d,_0xe75ac9,_0x147712){var _0x5f336a={'role':_0x6cdd('0x50')};_0x5f336a[_0x55911d]=this[_0x6cdd('0x37')][_0x6cdd('0x3b')];this[_0x6cdd('0x11')]['agentPause'](_0x5f336a,_0xe75ac9,this[_0x6cdd('0x37')]['uniqueid'])['then'](function(_0x80a412){_0x147712(null,_[_0x6cdd('0x46')](_0x80a412)?![]:!![]);})['catch'](function(_0x50be02){logger[_0x6cdd('0x2d')](_0x50be02);_0x147712(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x58a635,_0x45a466){var _0x44cf5d={'role':'agent'};_0x44cf5d[_0x58a635]=this['channel'][_0x6cdd('0x3b')];this[_0x6cdd('0x11')]['agentUnpause'](_0x44cf5d)[_0x6cdd('0x13')](function(_0x2b7a0c){_0x45a466(null,_['isNil'](_0x2b7a0c)?![]:!![]);})[_0x6cdd('0x14')](function(_0x5ab52f){logger[_0x6cdd('0x2d')](_0x5ab52f);_0x45a466(null,![]);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x51')]=function(_0x5892e4,_0x33b17d){var _0x3a82dd={'role':'agent'};_0x3a82dd[_0x5892e4]=this[_0x6cdd('0x37')][_0x6cdd('0x3b')];this['rpc'][_0x6cdd('0x51')](_0x3a82dd)['then'](function(_0x2b3c47){_0x33b17d(null,_[_0x6cdd('0x46')](_0x2b3c47)?![]:!![]);})[_0x6cdd('0x14')](function(_0x5dd088){logger['error'](_0x5dd088);_0x33b17d(null,![]);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x52')]=function(_0x2b4c2e,_0x3705e7){var _0x3174d2={'role':_0x6cdd('0x50')};_0x3174d2[_0x2b4c2e]=this['channel'][_0x6cdd('0x3b')];var _0x7cf615=_0x2b4c2e!=_0x6cdd('0x53')?util[_0x6cdd('0x2a')](_0x6cdd('0x54'),_0x6cdd('0x55'),this['channel'][_0x6cdd('0x3b')]):undefined;this[_0x6cdd('0x11')][_0x6cdd('0x52')](_0x3174d2,_0x7cf615)['then'](function(_0x4d84b8){_0x3705e7(null,_[_0x6cdd('0x46')](_0x4d84b8)?![]:!![]);})[_0x6cdd('0x14')](function(_0x27e82d){logger[_0x6cdd('0x2d')](_0x27e82d);_0x3705e7(null,![]);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x56')]=function(_0x56ad22,_0x4192ec){sh[_0x6cdd('0x57')](_[_0x6cdd('0x58')](_0x56ad22),function(_0x4460a1,_0x55c5e4){var _0x371c0d=_0x55c5e4['replace'](/(\r\n|\n|\r)/gm,'');_0x4192ec(null,_0x371c0d);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x59')]=function(_0x270501,_0x1f1104){scripts[_0x6cdd('0x59')](_0x270501['apiKey'],_0x270501['google_cloud_tts_text_type']||_0x6cdd('0x5a'),_0x270501['text'],_0x270501['languageCode']||_0x6cdd('0x5b'),_0x270501[_0x6cdd('0x5c')]||'MALE',_0x270501[_0x6cdd('0x5d')]||'MP3')['then'](function(_0x4634c4){_0x1f1104(null,_0x4634c4);})[_0x6cdd('0x14')](function(_0x258535){_0x1f1104(_0x258535);});};AGIVertices['prototype']['googleTTS']=function(_0x429c9a,_0x51ce1a){scripts[_0x6cdd('0x5e')](_0x429c9a[_0x6cdd('0x5a')],_0x429c9a[_0x6cdd('0x5f')]||'en',0x1)['then'](function(_0x5bbc89){_0x51ce1a(null,_0x5bbc89);})['catch'](function(_0x93a764){_0x51ce1a(_0x93a764);});};AGIVertices['prototype']['restAPI']=function(_0x3f701c,_0x4bb0a6){var _0x3c671a={'uri':_0x3f701c['url'],'method':_0x3f701c[_0x6cdd('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3f701c[_0x6cdd('0x61')])===_0x6cdd('0x62')&&parseInt(_0x3f701c[_0x6cdd('0x61')])>=0x1?parseInt(_0x3f701c[_0x6cdd('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x6cdd('0x63')](['POST','PUT'],_0x3c671a['method']['toUpperCase']())){try{_0x3c671a[_0x6cdd('0x64')]=_0x3f701c[_0x6cdd('0x65')]?JSON[_0x6cdd('0x66')](_0x3f701c[_0x6cdd('0x65')]):{};}catch(_0x49c3ef){logger[_0x6cdd('0x2d')](_0x6cdd('0x67'),_0x49c3ef);}}try{_0x3c671a['headers']=_0x3f701c[_0x6cdd('0xa')]?JSON[_0x6cdd('0x66')](_0x3f701c[_0x6cdd('0xa')]):{};}catch(_0x104f77){logger[_0x6cdd('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x104f77);}if(_0x3f701c[_0x6cdd('0x68')]){try{var _0x422b91=require(_0x3f701c[_0x6cdd('0x68')])['sync'](this,_0x3c671a);_0x3c671a[_0x6cdd('0x69')]=Mustache['render'](_0x3f701c[_0x6cdd('0x6a')],_0x422b91,{},['$$','$$']);if(_0x3c671a['headers']){_0x3c671a['headers']=JSON['parse'](Mustache[_0x6cdd('0x6b')](JSON['stringify'](_0x3c671a[_0x6cdd('0x6c')]),_0x422b91,{},['$$','$$']));}if(_0x3c671a[_0x6cdd('0x64')]){_0x3c671a[_0x6cdd('0x64')]=JSON[_0x6cdd('0x66')](Mustache[_0x6cdd('0x6b')](JSON['stringify'](_0x3c671a[_0x6cdd('0x64')]),_0x422b91,{},['$$','$$']));}}catch(_0x126fac){logger[_0x6cdd('0x2d')](_0x6cdd('0x6d'),_0x126fac);}}rp(_0x3c671a)[_0x6cdd('0x13')](function(_0x80b3cd){var _0x3943a5={'statusCode':_0x80b3cd[_0x6cdd('0x6e')]||0xc8,'statusMessage':_0x80b3cd[_0x6cdd('0x6f')]||'OK','headers':_0x80b3cd[_0x6cdd('0x6c')]||{},'body':_0x80b3cd[_0x6cdd('0x64')]||{}};_0x4bb0a6(null,_0x3943a5);})['catch'](function(_0x510b9f){var _0x53256d={'statusCode':_0x510b9f['statusCode']||0x1f4,'statusMessage':_0x510b9f[_0x6cdd('0x70')]||_0x6cdd('0x71'),'headers':_0x510b9f[_0x6cdd('0x72')][_0x6cdd('0x6c')]||{},'body':_0x510b9f[_0x6cdd('0x72')][_0x6cdd('0x64')]||{}};_0x4bb0a6(null,_0x53256d);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x73')]=function(_0x4297cb,_0x47b92c){scripts[_0x6cdd('0x73')](this['channel'][_0x6cdd('0x38')],_0x4297cb['key'],_0x4297cb[_0x6cdd('0x5a')],_0x4297cb[_0x6cdd('0x74')]||'en')[_0x6cdd('0x13')](function(_0x32f418){_0x47b92c(null,_0x32f418);})[_0x6cdd('0x14')](function(_0x366a39){_0x47b92c(_0x366a39);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x75')]=function(_0x26ce68,_0x2bfb25){scripts['googleDialogflowV2'](this['channel'][_0x6cdd('0x38')],_0x26ce68[_0x6cdd('0x76')],_0x26ce68[_0x6cdd('0x77')],_0x26ce68[_0x6cdd('0x78')],_0x26ce68[_0x6cdd('0x5a')],_0x26ce68['dialogflowV2_language']||'en')[_0x6cdd('0x13')](function(_0x55ecf7){_0x2bfb25(null,_0x55ecf7);})[_0x6cdd('0x14')](function(_0x31f282){_0x2bfb25(_0x31f282);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x79')]=function(_0x9131c2,_0x218243){scripts[_0x6cdd('0x79')](this[_0x6cdd('0x37')],_0x9131c2)[_0x6cdd('0x13')](function(_0x406873){_0x218243(null,_0x406873);})[_0x6cdd('0x14')](function(_0x295720){_0x218243(_0x295720);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x7a')]=function(_0x3e085e,_0x4d2537){scripts[_0x6cdd('0x7a')](_0x3e085e[_0x6cdd('0x7b')],_0x3e085e[_0x6cdd('0x5a')],_0x3e085e[_0x6cdd('0x7c')]||_0x6cdd('0x5b'),_0x3e085e['speed'])[_0x6cdd('0x13')](function(_0x15a137){_0x4d2537(null,_0x15a137);})['catch'](function(_0x3579e2){_0x4d2537(_0x3579e2);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x7d')]=function(_0x1edf0c,_0x32cf4e,_0x3aa4b3){scripts[_0x6cdd('0x7d')](_0x32cf4e,_0x1edf0c[_0x6cdd('0x7b')],_0x1edf0c['ispeech_asr_language']||_0x6cdd('0x5b'),this[_0x6cdd('0x7e')](_0x1edf0c['model'])?_0x1edf0c['model']:undefined)[_0x6cdd('0x13')](function(_0x84f695){_0x3aa4b3(null,_0x84f695);})[_0x6cdd('0x14')](function(_0x52e553){_0x3aa4b3(_0x52e553);});};AGIVertices['prototype']['awsPolly']=function(_0x5ec501,_0x1dc589){scripts[_0x6cdd('0x7f')](_0x5ec501[_0x6cdd('0x80')],_0x5ec501['aws_secret_access_key'],_0x5ec501['aws_polly_region'],_0x5ec501[_0x6cdd('0x81')]||_0x6cdd('0x82'),_0x5ec501[_0x6cdd('0x5a')],_0x5ec501[_0x6cdd('0x83')]||'text')['then'](function(_0x233892){_0x1dc589(null,_0x233892);})[_0x6cdd('0x14')](function(_0x33695d){_0x1dc589(_0x33695d);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x84')]=function(_0x1b1601,_0xb7977c){scripts[_0x6cdd('0x84')](this[_0x6cdd('0x37')]['uniqueid'],_0x1b1601[_0x6cdd('0x80')],_0x1b1601[_0x6cdd('0x85')],_0x1b1601[_0x6cdd('0x86')],_0x1b1601[_0x6cdd('0x5a')],_0x1b1601[_0x6cdd('0x87')])[_0x6cdd('0x13')](function(_0x9338ce){_0xb7977c(null,_0x9338ce);})[_0x6cdd('0x14')](function(_0x3bc5d9){_0xb7977c(_0x3bc5d9);});};AGIVertices[_0x6cdd('0xf')]['googleASR']=function(_0xcf717f,_0x45bd66,_0x1463ba){scripts[_0x6cdd('0x88')](_0x45bd66,_0xcf717f[_0x6cdd('0x7b')],_0xcf717f['google_asr_language']||_0x6cdd('0x5b'))[_0x6cdd('0x13')](function(_0x5efdb5){_0x1463ba(null,_0x5efdb5);})[_0x6cdd('0x14')](function(_0x5de3df){_0x1463ba(_0x5de3df);});};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x89')]=function(_0x2ed3d8,_0x400c2a,_0x263930){scripts[_0x6cdd('0x89')](_0x400c2a,_0x2ed3d8[_0x6cdd('0x8a')],_0x2ed3d8[_0x6cdd('0x8b')],_0x2ed3d8[_0x6cdd('0x69')])['then'](function(_0x1c6987){_0x263930(null,_0x1c6987);})[_0x6cdd('0x14')](function(_0x533085){_0x263930(_0x533085);});};AGIVertices[_0x6cdd('0xf')]['clear']=function(_0x15f807){var _0x3ad74e=_[_0x6cdd('0x63')](verticesWithRetry,_0x15f807[_0x6cdd('0x3a')])?_0x15f807:_[_0x6cdd('0x8c')](_0x15f807);for(var _0x52c849 in _0x3ad74e){if(_0x3ad74e['hasOwnProperty'](_0x52c849)){if(_0x3ad74e[_0x52c849]&&_[_0x6cdd('0x8d')](_0x3ad74e[_0x52c849])){if(_[_0x6cdd('0x63')](recursiveMapAttributes,_0x52c849)){_0x3ad74e[_0x52c849]=this['replaceObjectAllVariables'](_0x3ad74e[_0x52c849]);}else{_0x3ad74e[_0x52c849]=this[_0x6cdd('0x8e')](_0x3ad74e[_0x52c849]);}}}}return _0x3ad74e;};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x8f')]=function(_0x4d49f8){for(var _0x4f7cfe in _0x4d49f8){if(_0x4d49f8[_0x6cdd('0x90')](_0x4f7cfe)){if(_[_0x6cdd('0x91')](_0x4d49f8[_0x4f7cfe])){this[_0x6cdd('0x8f')](_0x4d49f8[_0x4f7cfe]);}else if(_[_0x6cdd('0x92')](_0x4d49f8[_0x4f7cfe])){for(var _0xd0d12d=0x0;_0xd0d12d<_0x4d49f8[_0x4f7cfe][_0x6cdd('0x93')];_0xd0d12d++){this[_0x6cdd('0x8f')](_0x4d49f8[_0x4f7cfe][_0xd0d12d]);}}else if(_['isString'](_0x4d49f8[_0x4f7cfe])){_0x4d49f8[_0x4f7cfe]=this[_0x6cdd('0x8e')](_0x4d49f8[_0x4f7cfe]);}}}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x94')]=function(_0x3376d7,_0x34b90b){for(var _0x303acf in _0x3376d7){if(_0x3376d7[_0x6cdd('0x90')](_0x303acf)){if(_[_0x6cdd('0x91')](_0x3376d7[_0x303acf])){if(!_[_0x6cdd('0x45')](_0x3376d7[_0x303acf])){this['saveRestApiResult'](_0x3376d7[_0x303acf],util[_0x6cdd('0x2a')](_0x6cdd('0x95'),_0x34b90b,_0x303acf));}}else if(_[_0x6cdd('0x92')](_0x3376d7[_0x303acf])){for(var _0x421c46=0x0;_0x421c46<_0x3376d7[_0x303acf][_0x6cdd('0x93')];_0x421c46++){this[_0x6cdd('0x94')](_0x3376d7[_0x303acf][_0x421c46],util['format'](_0x6cdd('0x95'),_0x34b90b,_0x303acf+'['+_0x421c46+']'));}}else{if(!_[_0x6cdd('0x46')](_0x3376d7[_0x303acf])){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util['format']('%s.%s',_0x34b90b,_0x303acf),_0x3376d7[_0x303acf]);}}}}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x97')]=function(_0x29e0d5){try{var _0x2ecedf=JSON[_0x6cdd('0x66')](_0x29e0d5);this['recursiveNodeIndex'](_0x2ecedf);return JSON['stringify'](_0x2ecedf);}catch(_0x307da4){return this[_0x6cdd('0x8e')](_0x29e0d5);}};AGIVertices[_0x6cdd('0xf')]['replaceAllVariables']=function(_0x31c343){var _0x5901ca=_0x31c343[_0x6cdd('0x98')]('{');for(var _0x2522bf=0x1;_0x2522bf<_0x5901ca[_0x6cdd('0x93')];_0x2522bf+=0x1){var _0x5b1ff7=_0x5901ca[_0x2522bf][_0x6cdd('0x98')]('}');if(_0x5b1ff7[_0x6cdd('0x93')]>0x1){_0x31c343=_0x31c343['replaceAll']('{'+_0x5b1ff7[0x0]+'}',this[_0x6cdd('0x37')]['getVariable'](_0x5b1ff7[0x0])['extra']||_0x5b1ff7[0x0]);}}if(_0x5901ca[_0x6cdd('0x93')]===0x1){return _0x31c343['toString']();}return this[_0x6cdd('0x8e')](_0x31c343);};AGIVertices[_0x6cdd('0xf')]['getAndSetVariable']=function(_0x9520e3,_0x4f98c7){var _0x565021=this[_0x6cdd('0x37')][_0x6cdd('0x10')](_0x9520e3);if(_0x565021[_0x6cdd('0x99')]===-0x1){return _0x565021;}logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4f98c7,_0x565021[_0x6cdd('0x9a')]));return this[_0x6cdd('0x37')]['setVariable'](_0x4f98c7,_0x565021[_0x6cdd('0x9a')]);};AGIVertices[_0x6cdd('0xf')]['isConfigured']=function(_0x488296){return _0x488296&&_0x488296!=='0'&&_0x488296!=='-1'&&_0x488296!=='';};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x9b')]=function(_0x2e4556){this[_0x6cdd('0x36')]['sync'](this,_0x2e4556,'-');_0x2e4556[_0x6cdd('0x9c')]=_0x2e4556[_0x6cdd('0x9b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x9d')]=function(_0x87ee5e){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x9e'),_0x87ee5e[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x87ee5e[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}var _0x479354='\x22'+_0x87ee5e[_0x6cdd('0x5a')]+'\x22';if(this['isConfigured'](_0x87ee5e[_0x6cdd('0x72')])){_0x479354+=','+_0x87ee5e[_0x6cdd('0x72')];}var _0x1d1e51=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0xa1'),_0x479354);if(_0x1d1e51['result']===-0x1){return _0x1d1e51;}return this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xa2'),_0x479354));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xa3')]=function(_0x24d866){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xa4'),_0x24d866['label']));if(!this['isConfigured'](_0x24d866[_0x6cdd('0xa5')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0xa6'));}var _0x2f628b=_0x24d866['grammar'];if(this['isConfigured'](_0x24d866[_0x6cdd('0x72')])){_0x2f628b+=','+_0x24d866[_0x6cdd('0x72')];}var _0x2ed1b3=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0xa7'),_0x2f628b);if(_0x2ed1b3[_0x6cdd('0x99')]===-0x1){return _0x2ed1b3;}var _0x9bf1af=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x6cdd('0xa8'));if(_0x9bf1af[_0x6cdd('0x99')]===-0x1){return _0x9bf1af;}var _0x120572=this[_0x6cdd('0xa9')](_0x6cdd('0xaa'),_0x6cdd('0xab'));if(_0x120572['result']===-0x1){return _0x120572;}var _0x38ba93=this['getAndSetVariable'](_0x6cdd('0xac'),'MRCP_RECOG_INSTANCE');if(_0x38ba93[_0x6cdd('0x99')]===-0x1){return _0x38ba93;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xad'),_0x2f628b));};AGIVertices[_0x6cdd('0xf')]['agi']=function(_0x468e83){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xae'),_0x468e83[_0x6cdd('0x39')]));return this[_0x6cdd('0x37')][_0x6cdd('0x7')]([_0x468e83[_0x6cdd('0xaf')],_0x468e83['args']]);};AGIVertices['prototype'][_0x6cdd('0xb0')]=function(_0x1fb76c){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xb1'),_0x1fb76c[_0x6cdd('0x39')]));if(this[_0x6cdd('0x7e')](_0x1fb76c[_0x6cdd('0x61')])){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0xb2'),_0x1fb76c['timeout']));var _0x1deaa6=this[_0x6cdd('0x37')][_0x6cdd('0xb3')](_0x1fb76c['timeout']);if(_0x1deaa6['result']===-0x1){return _0x1deaa6;}}return this[_0x6cdd('0x37')][_0x6cdd('0xb0')]();};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x4c')]=function(_0x2c71b7){logger['info'](util[_0x6cdd('0x2a')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2c71b7[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x2c71b7[_0x6cdd('0x4a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x2c71b7,'no\x20list\x20selected');}_0x2c71b7[_0x6cdd('0x4b')]=moment();if(this[_0x6cdd('0x7e')](_0x2c71b7[_0x6cdd('0xb4')])){_0x2c71b7[_0x6cdd('0x4b')]=moment()['add'](_0x2c71b7[_0x6cdd('0xb4')],_0x6cdd('0xb5'));}if(!this[_0x6cdd('0x7e')](_0x2c71b7[_0x6cdd('0xb6')])){_0x2c71b7[_0x6cdd('0xb6')]=0x2;}this[_0x6cdd('0x44')][_0x6cdd('0xb7')](this,_0x2c71b7);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xb8'),_0x2c71b7['phone'],_0x2c71b7[_0x6cdd('0x4a')],_0x2c71b7[_0x6cdd('0x4b')]));};AGIVertices['prototype'][_0x6cdd('0xb9')]=function(_0x4b9a14){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4b9a14[_0x6cdd('0x39')]));var _0x2859f4=this['channel'][_0x6cdd('0x57')](_0x4b9a14['application'],_0x4b9a14[_0x6cdd('0x72')]);if(_0x2859f4[_0x6cdd('0x99')]===-0x1){return _0x2859f4;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format'](_0x6cdd('0xba'),_0x4b9a14[_0x6cdd('0xbb')],_0x4b9a14[_0x6cdd('0x72')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x3eb355){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0xbc'),_0x3eb355[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x3eb355[_0x6cdd('0x5a')])){return this['channel'][_0x6cdd('0x9f')]('no\x20text\x20configured');}var _0x4ee68a='\x22'+_0x3eb355[_0x6cdd('0x5a')]+'\x22';if(this[_0x6cdd('0x7e')](_0x3eb355[_0x6cdd('0x72')])){_0x4ee68a+=','+_0x3eb355[_0x6cdd('0x72')];}var _0x47bcea=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0xa1'),_0x4ee68a);if(_0x47bcea['result']===-0x1){return _0x47bcea;}return this[_0x6cdd('0x37')]['noop'](util['format'](_0x6cdd('0xa2'),_0x4ee68a));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xbd')]=function(_0x357186){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xbe'),_0x357186[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x357186[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}var _0x5b3520='\x22'+_0x357186[_0x6cdd('0x5a')]+'\x22';if(this['isConfigured'](_0x357186[_0x6cdd('0x72')])){_0x5b3520+=','+_0x357186[_0x6cdd('0x72')];}var _0x3ddd72=this[_0x6cdd('0x37')][_0x6cdd('0x57')]('MRCPSynth',_0x5b3520);if(_0x3ddd72[_0x6cdd('0x99')]===-0x1){return _0x3ddd72;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5b3520));};AGIVertices['prototype'][_0x6cdd('0xbf')]=function(_0x1f8623){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xc0'),_0x1f8623[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x1f8623['grammar'])){return this[_0x6cdd('0x37')]['noop']('no\x20grammar\x20configured');}var _0x279904=_0x1f8623['grammar'];if(this[_0x6cdd('0x7e')](_0x1f8623[_0x6cdd('0x72')])){_0x279904+=','+_0x1f8623['options'];}var _0x32a769=this[_0x6cdd('0x37')][_0x6cdd('0x57')]('MRCPRecog',_0x279904);if(_0x32a769[_0x6cdd('0x99')]===-0x1){return _0x32a769;}var _0x417a68=this[_0x6cdd('0xa9')](_0x6cdd('0xc1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x417a68[_0x6cdd('0x99')]===-0x1){return _0x417a68;}var _0x342937=this['getAndSetVariable'](_0x6cdd('0xaa'),_0x6cdd('0xc2'));if(_0x342937['result']===-0x1){return _0x342937;}var _0x4b0f85=this['getAndSetVariable'](_0x6cdd('0xac'),_0x6cdd('0xc3'));if(_0x4b0f85['result']===-0x1){return _0x4b0f85;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x279904));};AGIVertices[_0x6cdd('0xf')]['sestekasr']=function(_0x284d4a){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xc4'),_0x284d4a[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x284d4a[_0x6cdd('0xa5')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')]('no\x20grammar\x20configured');}var _0xcff3f1=_0x284d4a[_0x6cdd('0xa5')];if(this[_0x6cdd('0x7e')](_0x284d4a[_0x6cdd('0x72')])){_0xcff3f1+=','+_0x284d4a[_0x6cdd('0x72')];}var _0x3e3c61=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0xa7'),_0xcff3f1);if(_0x3e3c61['result']===-0x1){return _0x3e3c61;}var _0x7d8757=this[_0x6cdd('0xa9')](_0x6cdd('0xc1'),'SESTEK_ASR_CONFIDENCE');if(_0x7d8757['result']===-0x1){return _0x7d8757;}var _0x227a04=this[_0x6cdd('0xa9')]('RECOG_INPUT()',_0x6cdd('0xc5'));if(_0x227a04['result']===-0x1){return _0x227a04;}var _0x21e2ad=this['getAndSetVariable'](_0x6cdd('0xac'),_0x6cdd('0xc6'));if(_0x21e2ad[_0x6cdd('0x99')]===-0x1){return _0x21e2ad;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format'](_0x6cdd('0xad'),_0xcff3f1));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xc7')]=function(_0x338829){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0xc8'),_0x338829['label']));if(!this[_0x6cdd('0x7e')](_0x338829[_0x6cdd('0xc9')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x338829,_0x6cdd('0xca'));}var _0x1c25ff=this[_0x6cdd('0x1a')][_0x6cdd('0xb7')](this,_0x338829[_0x6cdd('0xc9')]);if(!_0x1c25ff){return this[_0x6cdd('0x37')]['error'](_0x338829,_0x6cdd('0xcb'));}if(!this['isConfigured'](_0x338829[_0x6cdd('0xcc')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x338829,_0x6cdd('0xcd'));}var _0xe5ace2=_0x338829[_0x6cdd('0xcc')][_0x6cdd('0xce')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xcf'),_0xe5ace2));var _0x2f2287=this['getQueryOdbc'][_0x6cdd('0xb7')](this,_0x1c25ff,_0xe5ace2);this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x338829,_0xe5ace2);if(!this[_0x6cdd('0x7e')](_0x338829[_0x6cdd('0xd0')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xd1'));}var _0x3042b9=this[_0x6cdd('0x10')][_0x6cdd('0xb7')](this,_0x338829[_0x6cdd('0xd0')]);if(!_0x3042b9){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x338829,_0x6cdd('0xd2'));}var _0x3c2565=this;_0x2f2287[_0x6cdd('0xd3')](function(_0x95fff2,_0xa12fe7){Object[_0x6cdd('0xd4')](_0x95fff2)['forEach'](function(_0x162fec){_0x3c2565['channel'][_0x6cdd('0x96')](util[_0x6cdd('0x2a')]('%s[%s][%s]',_0x3042b9,_0xa12fe7,_0x162fec),_0x95fff2[_0x162fec]);});});this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')](_0x6cdd('0xd5'),_0x3042b9),_0x2f2287[_0x6cdd('0x93')]);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xd6'),_0x3042b9));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xd7')]=function(_0x337f71){logger['debug'](util[_0x6cdd('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x337f71[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x337f71[_0x6cdd('0xd8')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x337f71,_0x6cdd('0xd9'));}var _0x4f8fd8=this[_0x6cdd('0x1c')][_0x6cdd('0xb7')](this,_0x337f71['sip_id']);if(!_0x4f8fd8){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x337f71,_0x6cdd('0xda'));}var _0x2c861d=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0xdb'),[util[_0x6cdd('0x2a')](_0x6cdd('0xdc'),_0x4f8fd8),_0x337f71[_0x6cdd('0x61')],_0x337f71[_0x6cdd('0xdd')],_0x337f71[_0x6cdd('0x6a')]]);if(_0x2c861d[_0x6cdd('0x99')]===-0x1){return _0x2c861d;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xde'),_0x6cdd('0xdb')));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xdf')]=function(_0x11d9b4){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0xe0'),_0x11d9b4[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x11d9b4['key'])){return this['channel'][_0x6cdd('0x9f')]('no\x20key\x20configured');}if(!this[_0x6cdd('0x7e')](_0x11d9b4[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}this[_0x6cdd('0x37')][_0x6cdd('0xe1')]=!![];this[_0x6cdd('0x36')](_0x11d9b4);this['createSquareMessage'](_0x11d9b4[_0x6cdd('0x5a')],'in','','');this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x11d9b4[_0x6cdd('0x5a')]));var _0x2cd515=this[_0x6cdd('0x73')]['sync'](this,_0x11d9b4);if(_0x2cd515){for(var _0x155ce5 in _0x2cd515){if(_0x2cd515[_0x6cdd('0x90')](_0x155ce5)){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')](_0x6cdd('0xe2'),_0x155ce5[_0x6cdd('0xe3')]()),_0x2cd515[_0x155ce5]);}}this[_0x6cdd('0x43')](_0x2cd515[_0x6cdd('0xe4')],_0x6cdd('0xe5'),_0x6cdd('0xdf'),'');return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format'](_0x6cdd('0xe6'),_0x2cd515['speech']));}return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x11d9b4,_0x6cdd('0xe7'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xe8')]=function(_0x31fc50){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x31fc50['label']));if(!this[_0x6cdd('0x7e')](_0x31fc50['dialogflowV2_project_id'])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x6cdd('0x7e')](_0x31fc50[_0x6cdd('0x77')])){return this['channel'][_0x6cdd('0x9f')](_0x6cdd('0xe9'));}if(!this[_0x6cdd('0x7e')](_0x31fc50[_0x6cdd('0x78')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xea'));}if(!this[_0x6cdd('0x7e')](_0x31fc50['dialogflowV2_language'])){return this['channel'][_0x6cdd('0x9f')](_0x6cdd('0xeb'));}if(!this['isConfigured'](_0x31fc50[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}this[_0x6cdd('0x37')]['bot']=!![];this['createSquareDetailsReport'](_0x31fc50);this['createSquareMessage'](_0x31fc50[_0x6cdd('0x5a')],'in','','');this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xec'),_0x31fc50[_0x6cdd('0x5a')]));var _0x6e6e8a=this[_0x6cdd('0x75')]['sync'](this,_0x31fc50);if(_0x6e6e8a){for(var _0x1b0de2 in _0x6e6e8a){if(_0x6e6e8a[_0x6cdd('0x90')](_0x1b0de2)){if(_0x1b0de2!==_0x6cdd('0xed')){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util['format'](_0x6cdd('0xe2'),_0x1b0de2[_0x6cdd('0xe3')]()),_0x6e6e8a[_0x1b0de2]);}}}this[_0x6cdd('0x43')](_0x6e6e8a[_0x6cdd('0xe4')],_0x6cdd('0xe5'),'dialogflowV2',_0x6e6e8a[_0x6cdd('0xed')]);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xee'),_0x6e6e8a[_0x6cdd('0xe4')]));}return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x31fc50,_0x6cdd('0xef'));};AGIVertices[_0x6cdd('0xf')]['sesteknda']=function(_0x4df3ae){logger['info'](util[_0x6cdd('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4df3ae[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x4df3ae[_0x6cdd('0xf0')])){return this[_0x6cdd('0x37')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x4df3ae[_0x6cdd('0xf1')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0xf2'));}if(!this[_0x6cdd('0x7e')](_0x4df3ae[_0x6cdd('0xf3')])){return this['channel'][_0x6cdd('0x9f')]('no\x20password\x20configured');}if(!this[_0x6cdd('0x7e')](_0x4df3ae[_0x6cdd('0xf4')])){return this['channel']['noop'](_0x6cdd('0xa0'));}this['channel']['bot']=!![];this[_0x6cdd('0x36')](_0x4df3ae);this['createSquareMessage'](_0x4df3ae[_0x6cdd('0x5a')],'in','','');this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format']('Trying\x20SestekNDA:\x20%s',_0x4df3ae[_0x6cdd('0x5a')]));var _0x52bc54=this[_0x6cdd('0x79')][_0x6cdd('0xb7')](this,_0x4df3ae);if(_0x52bc54){for(var _0x455e35 in _0x52bc54){if(_0x52bc54[_0x6cdd('0x90')](_0x455e35)){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util['format']('SESTEK_NDA_%s',_0x455e35[_0x6cdd('0xe3')]()),_0x52bc54[_0x455e35]);}}this['createSquareMessage'](_0x52bc54[_0x6cdd('0xe4')],_0x6cdd('0xe5'),_0x6cdd('0xf5'),'');if(_0x52bc54[_0x6cdd('0xf6')]){this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xf7'),_0x52bc54['audiofile']));var _0x51b8d3=this[_0x6cdd('0x37')][_0x6cdd('0xf8')](_0x52bc54['audiofile']);try{fs[_0x6cdd('0xf9')](_0x52bc54[_0x6cdd('0xf6')]+_0x6cdd('0xfa'));}catch(_0x3292d2){logger[_0x6cdd('0x2d')](_0x3292d2);}return _0x51b8d3;}else{return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format']('SestekNDA\x20Result\x20%s',_0x52bc54[_0x6cdd('0xe4')]));}}return this['channel'][_0x6cdd('0x2d')](_0x4df3ae,_0x6cdd('0xfb'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xfc')]=function(_0x34a031){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x34a031[_0x6cdd('0x39')]));return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xfc'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xfd')]=function(_0xdb5884){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xdb5884[_0x6cdd('0x39')]));var _0x5b1612='';if(_0xdb5884[_0x6cdd('0xfe')]){if(!this['isConfigured'](_0xdb5884[_0x6cdd('0xfe')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xdb5884,'no\x20trunk\x20selected');}else{var _0x1a6cbf=parseInt(_0xdb5884[_0x6cdd('0xfe')],0xa);if(isNaN(_0x1a6cbf)){_0x5b1612=_0xdb5884[_0x6cdd('0xfe')];}else{_0x5b1612=this[_0x6cdd('0x1e')][_0x6cdd('0xb7')](this,_0xdb5884[_0x6cdd('0xfe')]);if(!_0x5b1612){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xdb5884,_0x6cdd('0xff'));}}}}else if(_0xdb5884['trunk_name']){_0x5b1612=_0xdb5884[_0x6cdd('0x100')];}else{return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xdb5884,_0x6cdd('0x101'));}var _0x32ddc1=this[_0x6cdd('0x37')]['exec'](_0x6cdd('0xdb'),[util[_0x6cdd('0x2a')](_0x6cdd('0x102'),_0x5b1612,_0xdb5884[_0x6cdd('0x103')]),_0xdb5884[_0x6cdd('0x61')],_0xdb5884[_0x6cdd('0xdd')],_0xdb5884[_0x6cdd('0x6a')]]);if(_0x32ddc1[_0x6cdd('0x99')]===-0x1){return _0x32ddc1;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xde'),_0x6cdd('0xdb')));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x104')]=function(_0x59711b){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x59711b['label']));return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x104'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0xc')]=function(_0x56ac01){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0x105'),_0x56ac01[_0x6cdd('0x39')]));if(_0x56ac01[_0x6cdd('0x9c')]===0x0){return this[_0x6cdd('0x9b')](_0x56ac01);}_0x56ac01[_0x6cdd('0x9c')]-=0x1;if(!this[_0x6cdd('0x7e')](_0x56ac01[_0x6cdd('0x106')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x56ac01,_0x6cdd('0x107'));}var _0x1508ef=this[_0x6cdd('0x108')]['sync'](this,_0x56ac01[_0x6cdd('0x106')]);if(!_0x1508ef){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x56ac01,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x56ac01[_0x6cdd('0xd0')])){return this['channel'][_0x6cdd('0x2d')](_0x6cdd('0xd1'));}var _0x265edf=this['channel'][_0x6cdd('0x109')](_0x1508ef,_0x56ac01['response'],_0x56ac01[_0x6cdd('0x10a')]);var _0x4480ba=_0x265edf['result']?_0x265edf['result'][_0x6cdd('0x10b')]():'';logger[_0x6cdd('0x2f')](_0x6cdd('0x10c'),JSON[_0x6cdd('0x10d')](_0x265edf));if(_0x265edf[_0x6cdd('0x99')]===-0x1){this['createSquareDetailsReport'][_0x6cdd('0xb7')](this,_0x56ac01,_0x4480ba);return _0x265edf;}else if(_0x265edf['extra']==='timeout'){_0x265edf['result']=_0x4480ba[_0x6cdd('0x93')]>=parseInt(_0x56ac01[_0x6cdd('0x10e')])?'x':'i';}else{_0x265edf['result']=_0x4480ba[_0x6cdd('0x93')]>=parseInt(_0x56ac01['mindigit'])&&_0x4480ba[_0x6cdd('0x93')]<=parseInt(_0x56ac01['maxdigit'])?'x':'i';}var _0x4ab93f=this[_0x6cdd('0x10')][_0x6cdd('0xb7')](this,_0x56ac01[_0x6cdd('0xd0')]);if(!_0x4ab93f){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x56ac01,'no\x20variable\x20found');}this[_0x6cdd('0x37')][_0x6cdd('0x96')](_0x4ab93f,_0x4480ba);if(this[_0x6cdd('0x7e')](_0x56ac01[_0x6cdd('0x10f')])){var _0x2de50a=parseInt(_0x56ac01['hiddendigitsnum'],0xa);var _0x2c5b6f=rs[_0x6cdd('0x110')]({'charset':'*','length':_0x2de50a});var _0x3ebd82=_0x4480ba[_0x6cdd('0x93')];if(_0x3ebd82>0x0){if(_0x3ebd82>_0x2de50a){this['createSquareDetailsReport'][_0x6cdd('0xb7')](this,_0x56ac01,_0x56ac01['hiddendigitspos']==='first'?_0x2c5b6f+_0x4480ba[_0x6cdd('0x111')](_0x2de50a):_0x4480ba[_0x6cdd('0x111')](0x0,_0x3ebd82-_0x2de50a)+_0x2c5b6f);}else{this[_0x6cdd('0x36')]['sync'](this,_0x56ac01,rs[_0x6cdd('0x110')]({'charset':'*','length':_0x3ebd82}));}}else{this['createSquareDetailsReport'][_0x6cdd('0xb7')](this,_0x56ac01,'');}}else{this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x56ac01,_0x4480ba);}return _0x265edf;};AGIVertices['prototype'][_0x6cdd('0xd')]=function(_0x714f3){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0x112'),_0x714f3['label']));return this['getdigits'](_0x714f3);};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x113')]=function(_0xfdd516){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xfdd516[_0x6cdd('0x39')]));this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0xfdd516,_0xfdd516[_0x6cdd('0x114')]);return this['channel']['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x115'),_0xfdd516[_0x6cdd('0x114')]));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x116')]=function(_0x6909ec){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x117'),_0x6909ec[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x6909ec[_0x6cdd('0x80')])||!this[_0x6cdd('0x7e')](_0x6909ec[_0x6cdd('0x85')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x118'));}if(!this[_0x6cdd('0x7e')](_0x6909ec[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0xa0'));}this[_0x6cdd('0x37')]['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x119'),_0x6909ec[_0x6cdd('0x5a')]));var _0xa1f825=this['awsPolly'][_0x6cdd('0xb7')](this,_0x6909ec);if(_0xa1f825){this['channel']['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x11a'),_0xa1f825));var _0x562da1=this[_0x6cdd('0x37')][_0x6cdd('0xf8')](_0xa1f825);try{fs[_0x6cdd('0xf9')](_0xa1f825+_0x6cdd('0xfa'));}catch(_0x45250d){logger['error'](_0x45250d);}return _0x562da1;}return this[_0x6cdd('0x37')]['error'](_0x6909ec,_0x6cdd('0x11b'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x11c')]=function(_0x76a0cb){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x11d'),_0x76a0cb[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x76a0cb[_0x6cdd('0x80')])||!this['isConfigured'](_0x76a0cb[_0x6cdd('0x85')])){return this['channel'][_0x6cdd('0x9f')](_0x6cdd('0x118'));}if(!this[_0x6cdd('0x7e')](_0x76a0cb[_0x6cdd('0x87')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x11e'));}if(!this[_0x6cdd('0x7e')](_0x76a0cb['text'])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')]('no\x20text\x20configured');}this['channel'][_0x6cdd('0xe1')]=!![];this['createSquareDetailsReport'](_0x76a0cb);this['createSquareMessage'](_0x76a0cb[_0x6cdd('0x5a')],'in','','');this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x11f'),_0x76a0cb[_0x6cdd('0x5a')]));var _0x2c59f7=this[_0x6cdd('0x84')][_0x6cdd('0xb7')](this,_0x76a0cb);if(_0x2c59f7){for(var _0x3a8e40 in _0x2c59f7){if(_0x2c59f7[_0x6cdd('0x90')](_0x3a8e40)&&_[_0x6cdd('0x8d')](_0x2c59f7[_0x3a8e40])){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')]('AWS_LEX_%s',_0x3a8e40['toUpperCase']()),_0x2c59f7[_0x3a8e40]);}}if(_[_0x6cdd('0x46')](_0x2c59f7['message'])){return this['channel']['noop'](_0x6cdd('0x120'));}else{this['createSquareMessage'](_0x2c59f7[_0x6cdd('0x70')],_0x6cdd('0xe5'),_0x6cdd('0x121'),'');return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x122'),_0x2c59f7[_0x6cdd('0x70')]));}}return this[_0x6cdd('0x37')]['error'](_0x76a0cb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype']['googleasr']=function(_0x19e452){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x123'),_0x19e452[_0x6cdd('0x39')],_0x19e452[_0x6cdd('0x61')]));if(!this[_0x6cdd('0x7e')](_0x19e452['key'])){return this[_0x6cdd('0x37')]['noop']('no\x20key\x20configured');}var _0x4ff13d=_0x6cdd('0x124');var _0x177178=util['format'](_0x6cdd('0x125'),FILES_PATH,rs['generate'](0x4));var _0x2c1794=util['format'](_0x6cdd('0x95'),_0x177178,_0x4ff13d);var _0x4d48b4=!![];if(_0x19e452['beep']===_0x6cdd('0x126')){_0x4d48b4=![];}var _0x3263fc=this[_0x6cdd('0x37')][_0x6cdd('0x127')](_0x177178,_0x4ff13d,_0x19e452[_0x6cdd('0x128')],_0x19e452['timeout'],undefined,_0x4d48b4);if(_0x3263fc[_0x6cdd('0x99')]!==-0x1){this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x129'),_0x2c1794));var _0x11b682=this[_0x6cdd('0x88')][_0x6cdd('0xb7')](this,_0x19e452,_0x2c1794);if(_0x11b682){for(var _0x3feb05 in _0x11b682){if(_0x11b682['hasOwnProperty'](_0x3feb05)){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')]('GOOGLE_ASR_%s',_0x3feb05[_0x6cdd('0xe3')]()),_0x11b682[_0x3feb05]);}}return this[_0x6cdd('0x37')]['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x12a'),JSON['stringify'](_0x11b682)));}}return _0x3263fc;};AGIVertices['prototype'][_0x6cdd('0x12b')]=function(_0x17a14c){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x17a14c[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x17a14c['appid'])){return this['channel'][_0x6cdd('0x9f')]('no\x20appid\x20configured');}if(!this[_0x6cdd('0x7e')](_0x17a14c[_0x6cdd('0x8b')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0x12c'));}var _0xb9ca92=_0x6cdd('0x124');var _0x3f6de9=util[_0x6cdd('0x2a')](_0x6cdd('0x125'),FILES_PATH,rs[_0x6cdd('0x110')](0x4));var _0x21a252=util[_0x6cdd('0x2a')](_0x6cdd('0x95'),_0x3f6de9,_0xb9ca92);var _0x3819d9=!![];if(_0x17a14c[_0x6cdd('0x12d')]===_0x6cdd('0x126')){_0x3819d9=![];}var _0x29b3c0=this[_0x6cdd('0x37')]['recordFile'](_0x3f6de9,_0xb9ca92,_0x17a14c[_0x6cdd('0x128')],_0x17a14c[_0x6cdd('0x61')],undefined,_0x3819d9);if(_0x29b3c0['result']!==-0x1){this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x12e'),_0x21a252));var _0x466f17=this[_0x6cdd('0x89')][_0x6cdd('0xb7')](this,_0x17a14c,_0x21a252);if(_0x466f17){for(var _0x5bdd97 in _0x466f17){if(_0x466f17['hasOwnProperty'](_0x5bdd97)){this[_0x6cdd('0x37')]['setVariable'](util[_0x6cdd('0x2a')]('TILDE_ASR_%s',_0x5bdd97[_0x6cdd('0xe3')]()),_0x466f17[_0x5bdd97]);}}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x12f'),JSON['stringify'](_0x466f17)));}}return _0x29b3c0;};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x130')]=function(_0x5517be){logger[_0x6cdd('0x2f')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5517be['label']));return this[_0x6cdd('0x37')][_0x6cdd('0x131')](_0x5517be[_0x6cdd('0x3e')],_0x5517be[_0x6cdd('0x3f')],_0x5517be[_0x6cdd('0x132')]);};AGIVertices['prototype'][_0x6cdd('0x133')]=function(_0x21df8d){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x134'),_0x21df8d[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x21df8d['condition'])){return this['channel'][_0x6cdd('0x2d')](_0x21df8d,_0x6cdd('0x135'));}try{var _0x3d83a2=eval(_0x21df8d[_0x6cdd('0x136')])?_0x6cdd('0x137'):_0x6cdd('0x138');this[_0x6cdd('0x37')]['noop'](util[_0x6cdd('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x21df8d['condition'],_0x3d83a2));return{'code':0xc8,'result':_0x3d83a2};}catch(_0x464912){return{'code':0xc8,'result':_0x6cdd('0x138')};}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x139')]=function(_0x221cc7){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x13a'),_0x221cc7[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x221cc7[_0x6cdd('0x13b')])){return this[_0x6cdd('0x37')]['error'](_0x221cc7,_0x6cdd('0x13c'));}var _0xa4f374=this[_0x6cdd('0x25')]['sync'](this,_0x221cc7[_0x6cdd('0x13b')]);if(!_0xa4f374){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x221cc7,'no\x20intervals\x20found');}for(var _0x39bf89=0x0;_0x39bf89<_0xa4f374[_0x6cdd('0x93')];_0x39bf89+=0x1){var _0x9ca0c=this[_0x6cdd('0x37')][_0x6cdd('0x10')](util['format']('IFTIME(%s?true:false)',_0xa4f374[_0x39bf89]));if(_0x9ca0c[_0x6cdd('0x99')]===-0x1){return _0x9ca0c;}logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x13d'),_0xa4f374[_0x39bf89],_0x9ca0c[_0x6cdd('0x9a')]));if(_0x9ca0c[_0x6cdd('0x9a')]===_0x6cdd('0x137')){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x13d'),_0xa4f374[_0x39bf89],'true'));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x13d'),_0xa4f374[_0x39bf89],_0x6cdd('0x137')));return{'code':0xc8,'result':_0x6cdd('0x137')};}else{logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x13d'),_0xa4f374[_0x39bf89],_0x6cdd('0x138')));this['channel']['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x13d'),_0xa4f374[_0x39bf89],'false'));}}return{'code':0xc8,'result':_0x6cdd('0x138')};};AGIVertices['prototype']['hangup']=function(_0x4d4847){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4d4847[_0x6cdd('0x39')]));return this['channel'][_0x6cdd('0x13e')]();};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x13f')]=function(_0x2d69a6){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x140'),_0x2d69a6[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x2d69a6[_0x6cdd('0x7b')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x141'));}var _0x3fabb1=_0x6cdd('0x124');var _0x477f42=util[_0x6cdd('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x37c890=util[_0x6cdd('0x2a')](_0x6cdd('0x95'),_0x477f42,_0x3fabb1);var _0xc9feb4=!![];if(_0x2d69a6[_0x6cdd('0x12d')]===_0x6cdd('0x126')){_0xc9feb4=![];}var _0x599a09=this[_0x6cdd('0x37')]['recordFile'](_0x477f42,_0x3fabb1,_0x2d69a6[_0x6cdd('0x128')],_0x2d69a6[_0x6cdd('0x61')],undefined,_0xc9feb4);if(_0x599a09[_0x6cdd('0x99')]!==-0x1){this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format'](_0x6cdd('0x142'),_0x37c890));var _0x2721cf=this['ispeechASR'][_0x6cdd('0xb7')](this,_0x2d69a6,_0x37c890);if(_0x2721cf){for(var _0x46fcf9 in _0x2721cf){if(_0x2721cf[_0x6cdd('0x90')](_0x46fcf9)){this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')](_0x6cdd('0x143'),_0x46fcf9[_0x6cdd('0xe3')]()),_0x2721cf[_0x46fcf9]);}}return this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x144'),JSON[_0x6cdd('0x10d')](_0x2721cf)));}}return _0x599a09;};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x145')]=function(_0x3eb43f){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3eb43f[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x3eb43f[_0x6cdd('0x7b')])){return this['channel']['noop'](_0x6cdd('0x141'));}if(!this[_0x6cdd('0x7e')](_0x3eb43f[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')]('no\x20text\x20configured');}this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('Trying\x20ispeech\x20TTS\x20%s',_0x3eb43f[_0x6cdd('0x5a')]));var _0x1d04af=this['ispeechTTS'][_0x6cdd('0xb7')](this,_0x3eb43f);if(_0x1d04af){this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x142'),_0x1d04af));var _0x25ff2a=this[_0x6cdd('0x37')]['streamFile'](_0x1d04af,_0x3eb43f[_0x6cdd('0x128')]);try{fs[_0x6cdd('0xf9')](_0x1d04af+_0x6cdd('0xfa'));}catch(_0x5eb2ca){logger[_0x6cdd('0x2d')](_0x5eb2ca);}return _0x25ff2a;}return this['channel'][_0x6cdd('0x2d')](_0x3eb43f,_0x6cdd('0x146'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x147')]=function(_0x3016fb){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x148'),_0x3016fb[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x3016fb[_0x6cdd('0x149')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x3016fb,_0x6cdd('0x14a'));}logger['info'](util[_0x6cdd('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x3016fb[_0x6cdd('0x149')]));var _0x460484=this['agentLogin'][_0x6cdd('0xb7')](this,_0x3016fb[_0x6cdd('0x149')]);if(_0x460484){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x14b'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x3016fb['findBy']));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util['format'](_0x6cdd('0x14b'),this['channel']['callerid'],_0x3016fb[_0x6cdd('0x149')]));return{'code':0xc8,'result':_0x6cdd('0x14c')};}else{logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x3016fb[_0x6cdd('0x149')]));this['channel'][_0x6cdd('0x9f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x3016fb[_0x6cdd('0x149')]));return{'code':0xc8,'result':_0x6cdd('0x14d')};}};AGIVertices['prototype'][_0x6cdd('0x14e')]=function(_0x373c67){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x14f'),_0x373c67['label']));if(!this[_0x6cdd('0x7e')](_0x373c67[_0x6cdd('0x149')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x373c67,'no\x20find\x20by\x20configured');}logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x150'),this[_0x6cdd('0x37')]['callerid'],_0x373c67[_0x6cdd('0x149')]));var _0x1458a6=this[_0x6cdd('0x51')][_0x6cdd('0xb7')](this,_0x373c67[_0x6cdd('0x149')]);if(_0x1458a6){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x373c67['findBy']));this[_0x6cdd('0x37')]['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x14b'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x373c67[_0x6cdd('0x149')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x151'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x373c67[_0x6cdd('0x149')]));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x151'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x373c67[_0x6cdd('0x149')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x152')]=function(_0x4ce68d){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x153'),_0x4ce68d['label']));if(!this[_0x6cdd('0x7e')](_0x4ce68d[_0x6cdd('0x154')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x4ce68d,_0x6cdd('0x155'));}this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x156'),_0x4ce68d['operation']));var _0x457d3b=eval(_0x4ce68d[_0x6cdd('0x154')]);if(!this[_0x6cdd('0x7e')](_0x4ce68d[_0x6cdd('0xd0')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xd1'));}var _0xee098a=this[_0x6cdd('0x10')][_0x6cdd('0xb7')](this,_0x4ce68d[_0x6cdd('0xd0')]);if(!_0xee098a){return this['channel']['error'](_0x4ce68d,_0x6cdd('0xd2'));}if(_[_0x6cdd('0x92')](_0x457d3b)){var _0x230f6d=this;_0x457d3b[_0x6cdd('0xd3')](function(_0x4037d2,_0x4884d5){_0x230f6d[_0x6cdd('0x37')]['setVariable'](util[_0x6cdd('0x2a')](_0x6cdd('0x157'),_0xee098a,_0x4884d5),_0x4037d2);});return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x158'),_0xee098a));}else{return this[_0x6cdd('0x37')][_0x6cdd('0x96')](_0xee098a,_0x457d3b);}};AGIVertices['prototype']['menu']=function(_0xd258a6){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x159'),_0xd258a6[_0x6cdd('0x39')]));if(_0xd258a6[_0x6cdd('0x9c')]===0x0){return this[_0x6cdd('0x9b')](_0xd258a6);}_0xd258a6[_0x6cdd('0x9c')]-=0x1;if(!this[_0x6cdd('0x7e')](_0xd258a6[_0x6cdd('0x106')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xd258a6,_0x6cdd('0x107'));}var _0x1e8f10=this['getSound'][_0x6cdd('0xb7')](this,_0xd258a6[_0x6cdd('0x106')]);if(!_0x1e8f10){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xd258a6,'no\x20file\x20audio\x20found');}var _0x3a4a07=this[_0x6cdd('0x37')][_0x6cdd('0x109')](_0x1e8f10,_0xd258a6[_0x6cdd('0x15a')],_0xd258a6['digit']);var _0x30f6ce=_0x3a4a07[_0x6cdd('0x99')];if(_0x3a4a07[_0x6cdd('0x99')]===-0x1){this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0xd258a6,'-1');return _0x3a4a07;}else if(_0x3a4a07[_0x6cdd('0x9a')]===_0x6cdd('0x61')){_0x3a4a07[_0x6cdd('0x99')]=_0x3a4a07['result'][_0x6cdd('0x93')]>0x0?_0x3a4a07[_0x6cdd('0x99')]:'t';}else if(_['isEmpty'](_0x3a4a07[_0x6cdd('0x99')])){_0x3a4a07[_0x6cdd('0x99')]='#';_0x30f6ce='#';}if(!this[_0x6cdd('0x7e')](_0xd258a6[_0x6cdd('0xd0')])){this[_0x6cdd('0x37')][_0x6cdd('0x9f')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x237b3f=this[_0x6cdd('0x10')][_0x6cdd('0xb7')](this,_0xd258a6['variable_id']);if(!_0x237b3f){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0xd258a6,'no\x20variable\x20found');}this[_0x6cdd('0x37')]['setVariable'](_0x237b3f,_0x30f6ce);}this['createSquareDetailsReport'][_0x6cdd('0xb7')](this,_0xd258a6,_0x30f6ce);return _0x3a4a07;};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x9f')]=function(_0x5d5c4a){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x15b'),_0x5d5c4a['label']));return this[_0x6cdd('0x37')]['noop'](_0x5d5c4a[_0x6cdd('0x15c')]||_0x5d5c4a[_0x6cdd('0x39')]);};AGIVertices['prototype']['pause']=function(_0x584c9c){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x15d'),_0x584c9c[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x584c9c[_0x6cdd('0x149')])){return this['channel'][_0x6cdd('0x2d')](_0x584c9c,_0x6cdd('0x14a'));}logger[_0x6cdd('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x584c9c[_0x6cdd('0x149')]));var _0x1c3a08=this[_0x6cdd('0x4d')][_0x6cdd('0xb7')](this,_0x584c9c[_0x6cdd('0x15e')]);var _0x145ea4=this[_0x6cdd('0x4f')]['sync'](this,_0x584c9c[_0x6cdd('0x149')],_0x1c3a08);if(_0x145ea4){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x14b'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x584c9c[_0x6cdd('0x149')]));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6cdd('0x37')]['callerid'],_0x584c9c[_0x6cdd('0x149')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x151'),this['channel']['callerid'],_0x584c9c[_0x6cdd('0x149')]));this['channel'][_0x6cdd('0x9f')](util['format'](_0x6cdd('0x14b'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x584c9c[_0x6cdd('0x149')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x15f')]=function(_0x261424){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x160'),_0x261424[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x261424[_0x6cdd('0x106')])){return this['channel'][_0x6cdd('0x2d')](_0x261424,'no\x20file\x20audio\x20selected');}var _0x110eca=this['getSound'][_0x6cdd('0xb7')](this,_0x261424[_0x6cdd('0x106')]);if(!_0x110eca){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x261424,_0x6cdd('0x161'));}var _0x20ce11=this[_0x6cdd('0x37')][_0x6cdd('0x57')]('PLAYBACK',[_0x110eca,_0x261424[_0x6cdd('0xdd')]]);if(_0x20ce11[_0x6cdd('0x99')]===-0x1){return _0x20ce11;}return this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xba'),'PLAYBACK',_0x110eca));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x162')]=function(_0x22d9fd){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0x163'),_0x22d9fd['label']));if(!this[_0x6cdd('0x7e')](_0x22d9fd[_0x6cdd('0x164')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x22d9fd,'no\x20queue\x20selected');}var _0x1ed2f4='';var _0x35d13a=parseInt(_0x22d9fd[_0x6cdd('0x164')],0xa);if(isNaN(_0x35d13a)){_0x1ed2f4=_0x22d9fd[_0x6cdd('0x164')];}else{_0x1ed2f4=this['getVoiceQueue'][_0x6cdd('0xb7')](this,_0x22d9fd['queue_id']);if(!_0x1ed2f4){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x22d9fd,'no\x20queue\x20found');}}var _0x4008de='';if(this[_0x6cdd('0x7e')](_0x22d9fd[_0x6cdd('0x106')])){var _0x499a63=this[_0x6cdd('0x108')][_0x6cdd('0xb7')](this,_0x22d9fd[_0x6cdd('0x106')]);if(_0x499a63){_0x4008de=_0x499a63;}}this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x22d9fd,_0x1ed2f4);if(_0x22d9fd[_0x6cdd('0xdd')][_0x6cdd('0x165')]('x')<0x0){_0x22d9fd[_0x6cdd('0xdd')]+='x';}if(_0x22d9fd[_0x6cdd('0xdd')]['indexOf']('X')<0x0){_0x22d9fd[_0x6cdd('0xdd')]+='X';}this[_0x6cdd('0x37')]['setVariable']('XMCS-QUEUE',_0x1ed2f4?_0x1ed2f4[_0x6cdd('0x166')]():'');var _0x3467c8=this[_0x6cdd('0x37')][_0x6cdd('0x57')](_0x6cdd('0x167'),[_0x1ed2f4,_0x22d9fd[_0x6cdd('0xdd')],_0x22d9fd['url'],_0x4008de,_0x22d9fd[_0x6cdd('0x61')],_0x22d9fd[_0x6cdd('0x7')],_0x22d9fd[_0x6cdd('0x168')],_0x22d9fd['gosub'],'',_0x22d9fd[_0x6cdd('0x169')]]);if(_0x3467c8[_0x6cdd('0x99')]===-0x1){return _0x3467c8;}return this['channel'][_0x6cdd('0x9f')](util['format']('Executed\x20command\x20%s\x20%s',_0x6cdd('0x167'),_0x1ed2f4));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x16a')]=function(_0x26d363){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x26d363['label']));var _0x1fd686=_0x26d363[_0x6cdd('0x16b')]||_0x6cdd('0x124');var _0x4ecda9=util[_0x6cdd('0x2a')](_0x6cdd('0x16c'),this[_0x6cdd('0x37')]['uniqueid'],rs[_0x6cdd('0x110')](0x5));var _0xf6af72=util[_0x6cdd('0x2a')](_0x6cdd('0x16d'),FILES_PATH,_0x4ecda9,_0x1fd686);var _0x14b132=util[_0x6cdd('0x2a')](_0x6cdd('0x125'),FILES_PATH,_0x4ecda9);this[_0x6cdd('0x3c')]['sync'](this,_0x26d363,_0x4ecda9,_0xf6af72);this[_0x6cdd('0x37')][_0x6cdd('0x96')](_0x6cdd('0x16e'),_0x4ecda9);logger[_0x6cdd('0x2f')](_0x6cdd('0x16f'),_0x14b132,_0x1fd686,_0x26d363['escape_digits'],_0x26d363[_0x6cdd('0x61')]);return this[_0x6cdd('0x37')][_0x6cdd('0x127')](_0x14b132,_0x1fd686,_0x26d363[_0x6cdd('0x170')],_0x26d363[_0x6cdd('0x61')],undefined,!![]);};AGIVertices[_0x6cdd('0xf')]['restapi']=function(_0x156eaf){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x171'),_0x156eaf[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x156eaf['url'])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x172'));}var _0x4451d5=this[_0x6cdd('0x173')][_0x6cdd('0xb7')](this,_0x156eaf);logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x174'),util['inspect'](_0x4451d5,{'showHidden':![],'depth':null})));if(!this[_0x6cdd('0x7e')](_0x156eaf[_0x6cdd('0xd0')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x175'));}var _0x124bdc=this['getVariable']['sync'](this,_0x156eaf['variable_id']);if(!_0x124bdc){return this['channel'][_0x6cdd('0x2d')](_0x156eaf,_0x6cdd('0xd2'));}this[_0x6cdd('0x37')]['setVariable'](util[_0x6cdd('0x2a')](_0x6cdd('0x176'),_0x124bdc),_0x4451d5[_0x6cdd('0x6e')]?_0x4451d5['statusCode']:_0x6cdd('0x177'));this[_0x6cdd('0x37')][_0x6cdd('0x96')](util[_0x6cdd('0x2a')](_0x6cdd('0x178'),_0x124bdc),_0x4451d5[_0x6cdd('0x6f')]?_0x4451d5[_0x6cdd('0x6f')]:'OK');if(_0x4451d5[_0x6cdd('0x64')]){try{this['saveRestApiResult'](_0x4451d5[_0x6cdd('0x64')],_0x124bdc);}catch(_0x441add){logger[_0x6cdd('0x2d')](util[_0x6cdd('0x2a')](_0x6cdd('0x179'),_0x124bdc));}}return this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xd6'),_0x124bdc));};AGIVertices['prototype'][_0x6cdd('0x17a')]=function(_0x4395c5){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x4395c5[_0x6cdd('0x39')]));return this[_0x6cdd('0x37')][_0x6cdd('0x17b')](_0x4395c5[_0x6cdd('0x17c')]['replace'](/\s+/g,''),_0x4395c5['escape_digits']);};AGIVertices[_0x6cdd('0xf')]['saynumber']=function(_0x28a9b0){logger['info'](util[_0x6cdd('0x2a')](_0x6cdd('0x17d'),_0x28a9b0['label']));return this[_0x6cdd('0x37')][_0x6cdd('0x17e')](_0x28a9b0['number']['replace'](/\s+/g,''),_0x28a9b0['escape_digits']);};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x17f')]=function(_0x36f2d7){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x180'),_0x36f2d7['label']));return this['channel'][_0x6cdd('0x181')](_0x36f2d7[_0x6cdd('0x5a')],_0x36f2d7[_0x6cdd('0x170')]);};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x182')]=function(_0x535aa2){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x535aa2[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x535aa2[_0x6cdd('0x183')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0x184'));}var _0x2d394d=this['getMailAccount'][_0x6cdd('0xb7')](this,_0x535aa2[_0x6cdd('0x183')]);if(!_0x2d394d||!_0x2d394d['Smtp']){return this['channel'][_0x6cdd('0x2d')](_0x535aa2,_0x6cdd('0x185'));}var _0x3fcee2={'from':util[_0x6cdd('0x2a')](_0x6cdd('0x186'),_0x2d394d[_0x6cdd('0x17')],_0x2d394d[_0x6cdd('0x187')]||_0x2d394d[_0x6cdd('0x188')][_0x6cdd('0x189')]),'to':_0x535aa2['to']||'','cc':_0x535aa2['cc']||'','bcc':_0x535aa2[_0x6cdd('0x18a')]||'','subject':_0x535aa2[_0x6cdd('0x18b')],'html':_0x535aa2[_0x6cdd('0x5a')],'text':_0x535aa2[_0x6cdd('0x5a')]};var _0x340c5c={'tls':{'rejectUnauthorized':![]}};if(_0x2d394d['Smtp'][_0x6cdd('0x18c')]){_0x340c5c['service']=_0x2d394d[_0x6cdd('0x188')]['service'];}else{_0x340c5c[_0x6cdd('0x18d')]=_0x2d394d[_0x6cdd('0x188')][_0x6cdd('0x18d')];_0x340c5c[_0x6cdd('0x18e')]=_0x2d394d['Smtp']['port'];_0x340c5c[_0x6cdd('0x18f')]=_0x2d394d['Smtp'][_0x6cdd('0x18f')];}if(_0x2d394d['Smtp'][_0x6cdd('0x190')]){_0x340c5c[_0x6cdd('0x191')]={'user':_0x2d394d['Smtp']['user'],'pass':_0x2d394d[_0x6cdd('0x188')]['pass']};}if(this[_0x6cdd('0x7e')](_0x535aa2[_0x6cdd('0x192')])){}logger[_0x6cdd('0x193')]('sendMail\x20message',JSON[_0x6cdd('0x10d')](_0x3fcee2));this['createSquareDetailsReport'][_0x6cdd('0xb7')](this,_0x535aa2,_0x535aa2[_0x6cdd('0x183')]);this['channel'][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x194'),_0x2d394d[_0x6cdd('0x17')]));this[_0x6cdd('0x24')][_0x6cdd('0xb7')](this,_0x340c5c,_0x3fcee2);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x195'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x196')]=function(_0x2592b6){logger['info'](util['format'](_0x6cdd('0x197'),_0x2592b6[_0x6cdd('0x39')]));return this['channel'][_0x6cdd('0x9f')](_0x6cdd('0x198'));};AGIVertices['prototype'][_0x6cdd('0x199')]=function(_0x1811bb){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x19a'),_0x1811bb[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x1811bb[_0x6cdd('0x19b')])){return this[_0x6cdd('0x37')]['noop'](_0x6cdd('0x19c'));}var _0x1bd554=this[_0x6cdd('0x19d')][_0x6cdd('0xb7')](this,_0x1811bb[_0x6cdd('0x19b')]);if(!_0x1bd554){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x1811bb,_0x6cdd('0x19e'));}var _0x398a44={'body':_0x1811bb[_0x6cdd('0x19f')],'phone':_0x1811bb['to']||'','SmsAccountId':_0x1bd554['id']};logger[_0x6cdd('0x193')]('sendSMS\x20message',JSON[_0x6cdd('0x10d')](_0x398a44));this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x1811bb,_0x1811bb[_0x6cdd('0x19b')]);this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1a0'),_0x1bd554[_0x6cdd('0x17')]));this[_0x6cdd('0x35')][_0x6cdd('0xb7')](this,_0x398a44);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x1a1'));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1a2')]=function(_0x482587){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1a3'),_0x482587[_0x6cdd('0x39')]));if(!this['isConfigured'](_0x482587[_0x6cdd('0xd0')])){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x482587,'no\x20variable\x20selected');}var _0x4a8df2=this[_0x6cdd('0x10')]['sync'](this,_0x482587['variable_id']);if(!_0x4a8df2){return this[_0x6cdd('0x37')]['error'](_0x482587,_0x6cdd('0xd2'));}return this[_0x6cdd('0x37')][_0x6cdd('0x96')](_0x4a8df2,_0x482587['variable_value']);};AGIVertices[_0x6cdd('0xf')]['start']=function(_0x2f2206){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x1a4'),_0x2f2206['label']));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x1a5'));if(_0x2f2206[_0x6cdd('0xb0')]===_0x6cdd('0x1a6')){this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x1a7'));return this[_0x6cdd('0x37')]['answer']();}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x1a8'));};AGIVertices[_0x6cdd('0xf')]['subproject']=function(_0x1f4560){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1a9'),_0x1f4560[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x1f4560[_0x6cdd('0x1aa')])){return this['channel'][_0x6cdd('0x2d')](_0x1f4560,_0x6cdd('0x1ab'));}var _0x198714=this[_0x6cdd('0x18')][_0x6cdd('0xb7')](this,_0x1f4560[_0x6cdd('0x1aa')]);if(!this[_0x6cdd('0x7e')](_0x198714)){return this['channel'][_0x6cdd('0x2d')](_0x1f4560,util['format'](_0x6cdd('0x1ac'),_0x1f4560[_0x6cdd('0x1aa')]));}if(_0x198714===this[_0x6cdd('0x37')]['arg_1']){return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x1f4560,_0x6cdd('0x1ad'));}this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x1f4560,_0x198714);var _0x343389=this['channel']['exec']('AGI',util[_0x6cdd('0x2a')](_0x6cdd('0x1ae'),config[_0x6cdd('0x7')][_0x6cdd('0x18d')]||_0x6cdd('0x1af'),_0x198714,this[_0x6cdd('0x37')][_0x6cdd('0x42')]));if(_0x343389[_0x6cdd('0x99')]===-0x1){return _0x343389;}return this['channel'][_0x6cdd('0x9f')](util['format'](_0x6cdd('0xba'),_0x6cdd('0x1b0'),_0x198714));};AGIVertices[_0x6cdd('0xf')]['system']=function(_0x58b5e0){logger[_0x6cdd('0x2f')](util['format'](_0x6cdd('0x1b1'),_0x58b5e0[_0x6cdd('0x39')]));var _0x407ac4=this[_0x6cdd('0x56')][_0x6cdd('0xb7')](this,_0x58b5e0['command']);this[_0x6cdd('0x36')][_0x6cdd('0xb7')](this,_0x58b5e0,_0x58b5e0[_0x6cdd('0xaf')]);if(this['isConfigured'](_0x58b5e0['variable_id'])){var _0x466032=this[_0x6cdd('0x10')]['sync'](this,_0x58b5e0[_0x6cdd('0xd0')]);if(_0x466032){this[_0x6cdd('0x37')][_0x6cdd('0x96')](_0x466032,_0x407ac4);return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1b2'),_0x58b5e0[_0x6cdd('0xaf')],_0x466032));}}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1b3'),_0x58b5e0[_0x6cdd('0xaf')]));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1b4')]=function(_0x433eac){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1b5'),_0x433eac[_0x6cdd('0x39')]));_0x433eac[_0x6cdd('0x5a')]=_0x433eac[_0x6cdd('0x5a')][_0x6cdd('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6cdd('0x7e')](_0x433eac[_0x6cdd('0x1b6')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0x1b7'));}if(!this[_0x6cdd('0x7e')](_0x433eac[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}this['channel']['noop'](util[_0x6cdd('0x2a')](_0x6cdd('0x1b8'),_0x433eac[_0x6cdd('0x5a')]));var _0x5940c2=this['googleCloudTTS'][_0x6cdd('0xb7')](this,_0x433eac);if(_0x5940c2){this['channel']['noop'](util['format'](_0x6cdd('0x1b9'),_0x5940c2));var _0x21a53e=this['channel']['streamFile'](_0x5940c2);try{fs['unlink'](_0x5940c2+_0x6cdd('0xfa'));}catch(_0x4d478f){logger[_0x6cdd('0x2d')](_0x4d478f);}return _0x21a53e;}return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x433eac,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1ba')]=function(_0x42a120){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1bb'),_0x42a120[_0x6cdd('0x39')]));_0x42a120['text']=_0x42a120[_0x6cdd('0x5a')][_0x6cdd('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6cdd('0x7e')](_0x42a120[_0x6cdd('0x5a')])){return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](_0x6cdd('0xa0'));}this['channel'][_0x6cdd('0x9f')](util['format'](_0x6cdd('0x1bc'),_0x42a120['text']));var _0xcdd2bc=this[_0x6cdd('0x5e')]['sync'](this,_0x42a120);if(_0xcdd2bc){this[_0x6cdd('0x37')]['noop'](util[_0x6cdd('0x2a')]('Google\x20TTS\x20%s\x20file\x20created',_0xcdd2bc));var _0x588c66=this[_0x6cdd('0x37')][_0x6cdd('0xf8')](_0xcdd2bc);try{fs[_0x6cdd('0xf9')](_0xcdd2bc+'.wav');}catch(_0x430fab){logger[_0x6cdd('0x2d')](_0x430fab);}return _0x588c66;}return this[_0x6cdd('0x37')][_0x6cdd('0x2d')](_0x42a120,_0x6cdd('0x1bd'));};AGIVertices[_0x6cdd('0xf')]['unpause']=function(_0x5d6482){logger['info'](util[_0x6cdd('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5d6482[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x5d6482[_0x6cdd('0x149')])){return this['channel'][_0x6cdd('0x2d')](_0x5d6482,_0x6cdd('0x14a'));}logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x5d6482[_0x6cdd('0x149')]));var _0x5af717=this[_0x6cdd('0x1be')][_0x6cdd('0xb7')](this,_0x5d6482[_0x6cdd('0x149')]);if(_0x5af717){logger[_0x6cdd('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x5d6482[_0x6cdd('0x149')]));this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x5d6482['findBy']));return{'code':0xc8,'result':_0x6cdd('0x14c')};}else{logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x151'),this[_0x6cdd('0x37')][_0x6cdd('0x3b')],_0x5d6482[_0x6cdd('0x149')]));this['channel'][_0x6cdd('0x9f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6cdd('0x37')]['callerid'],_0x5d6482[_0x6cdd('0x149')]));return{'code':0xc8,'result':_0x6cdd('0x14d')};}};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1bf')]=function(_0x406d29){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1c0'),_0x406d29[_0x6cdd('0x39')]));var _0x53cce7=this[_0x6cdd('0x37')]['exec']('VOICEMAIL',[_0x406d29['mailbox'],_0x406d29['options']]);if(_0x53cce7[_0x6cdd('0x99')]===-0x1){return _0x53cce7;}return this[_0x6cdd('0x37')][_0x6cdd('0x9f')](util[_0x6cdd('0x2a')](_0x6cdd('0xba'),_0x6cdd('0x1c1'),_0x406d29[_0x6cdd('0x1c2')]));};AGIVertices[_0x6cdd('0xf')][_0x6cdd('0x1c3')]=function(_0x4234ce){logger[_0x6cdd('0x2f')](util[_0x6cdd('0x2a')](_0x6cdd('0x1c4'),_0x4234ce[_0x6cdd('0x39')]));if(!this[_0x6cdd('0x7e')](_0x4234ce[_0x6cdd('0xd0')])){return this[_0x6cdd('0x37')]['error'](_0x4234ce,'no\x20variable\x20selected');}var _0x4afba1=this[_0x6cdd('0x10')][_0x6cdd('0xb7')](this,_0x4234ce['variable_id']);if(!_0x4afba1){return this[_0x6cdd('0x37')]['error'](_0x4234ce,_0x6cdd('0xd2'));}var _0x39a109=this[_0x6cdd('0x37')][_0x6cdd('0x10')](_0x4afba1);return{'code':0xc8,'result':_0x39a109[_0x6cdd('0x9a')]?_0x39a109[_0x6cdd('0x9a')]:'-'};};String[_0x6cdd('0xf')][_0x6cdd('0x1c5')]=function(_0x67ec8e,_0x478f81){return this[_0x6cdd('0x98')](_0x67ec8e)['join'](_0x478f81);};module['exports']=AGIVertices; \ No newline at end of file +var _0x202a=['sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','generate','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','opts','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','email','user','bcc','subject','service','host','secure','authentication','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','prototype','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','arg_1','callerid','createSquareRecording','uniqueid','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentLogout','internal','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_bot_name','googleASR','tildeASR','appid','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','createSquareDetailsReport','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured'];(function(_0x18de45,_0x5de730){var _0xe7cf0a=function(_0x1dbc8e){while(--_0x1dbc8e){_0x18de45['push'](_0x18de45['shift']());}};_0xe7cf0a(++_0x5de730);}(_0x202a,0xf8));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xa202('0x0'));var _=require('lodash');var sh=require(_0xa202('0x1'));var odbc=require(_0xa202('0x2'))();var rs=require(_0xa202('0x3'));var moment=require('moment');var Mustache=require(_0xa202('0x4'));var rp=require(_0xa202('0x5'));var logger=require(_0xa202('0x6'))('agi');var config=require(_0xa202('0x7'));var scripts=require(_0xa202('0x8'));var FILES_PATH=_0xa202('0x9');var recursiveMapAttributes=[_0xa202('0xa'),_0xa202('0xb')];var verticesWithRetry=[_0xa202('0xc'),_0xa202('0xd'),_0xa202('0xe')];var AGIVertices=function(_0x3e7773,_0x1376ca,_0x152dbe){this[_0xa202('0xf')]=_0x3e7773;this['rpc']=_0x1376ca;this[_0xa202('0x10')]=_0x152dbe;};AGIVertices['prototype'][_0xa202('0x11')]=function(_0xb4e41e,_0x5298cc){this[_0xa202('0x12')][_0xa202('0x13')](_0xb4e41e)['then'](function(_0x136d93){_0x5298cc(null,_0x136d93?_0x136d93[_0xa202('0x14')]:![]);})[_0xa202('0x15')](function(_0x1dca69){_0x5298cc(_0x1dca69);});};AGIVertices['prototype'][_0xa202('0x16')]=function(_0x104569,_0x3d83ee){this[_0xa202('0x12')][_0xa202('0x17')](_0x104569)[_0xa202('0x18')](function(_0x5baa14){_0x3d83ee(null,_0x5baa14?_0x5baa14[_0xa202('0x14')]:![]);})['catch'](function(_0x16b3d5){_0x3d83ee(_0x16b3d5);});};AGIVertices[_0xa202('0x19')][_0xa202('0x1a')]=function(_0x473c41,_0x29bb74){this[_0xa202('0x12')][_0xa202('0x1b')](_0x473c41)['then'](function(_0x5ea51d){_0x29bb74(null,_0x5ea51d?_0x5ea51d[_0xa202('0x14')]:![]);})[_0xa202('0x15')](function(_0x5b018d){_0x29bb74(_0x5b018d);});};AGIVertices[_0xa202('0x19')][_0xa202('0x1c')]=function(_0x28d479,_0x16d885){this[_0xa202('0x12')][_0xa202('0x1d')](_0x28d479)[_0xa202('0x18')](function(_0xce5cc7){_0x16d885(null,_0xce5cc7?_0xce5cc7[_0xa202('0x1e')]:![]);})[_0xa202('0x15')](function(_0x266dd7){_0x16d885(_0x266dd7);});};AGIVertices['prototype']['getUser']=function(_0x2b8983,_0x8a840f){this[_0xa202('0x12')][_0xa202('0x1f')](_0x2b8983)[_0xa202('0x18')](function(_0x72b956){_0x8a840f(null,_0x72b956?_0x72b956[_0xa202('0x14')]:![]);})[_0xa202('0x15')](function(_0x3bb45a){_0x8a840f(_0x3bb45a);});};AGIVertices['prototype'][_0xa202('0x20')]=function(_0x4ec325,_0x3f513d){this['rpc']['getTrunkById'](_0x4ec325)[_0xa202('0x18')](function(_0x3ae1cd){_0x3f513d(null,_0x3ae1cd?_0x3ae1cd[_0xa202('0x14')]:![]);})['catch'](function(_0x17c2b8){_0x3f513d(_0x17c2b8);});};AGIVertices[_0xa202('0x19')][_0xa202('0x21')]=function(_0x334930,_0x33b414){var _0x978ea4=this;this[_0xa202('0x12')][_0xa202('0x22')](_0x334930)[_0xa202('0x18')](function(_0x5e3307){_0x33b414(null,_0x5e3307?_0x978ea4[_0xa202('0x23')](_0x5e3307[_0xa202('0x24')]):![]);})[_0xa202('0x15')](function(_0x4b8305){_0x33b414(_0x4b8305);});};AGIVertices[_0xa202('0x19')][_0xa202('0x25')]=function(_0x595720,_0x3939c6){this[_0xa202('0x12')]['getMailAccountById'](_0x595720)['then'](function(_0x3a3e6d){_0x3939c6(null,_0x3a3e6d?_0x3a3e6d:![]);})['catch'](function(_0x4a3287){_0x3939c6(_0x4a3287);});};AGIVertices[_0xa202('0x19')][_0xa202('0x26')]=function(_0x2fce3e,_0x25ee7c,_0x1d14ea){this[_0xa202('0x10')][_0xa202('0x26')](_0x2fce3e,_0x25ee7c)[_0xa202('0x18')](function(){_0x1d14ea(null);})[_0xa202('0x15')](function(_0x7a4407){_0x1d14ea(_0x7a4407);});};AGIVertices[_0xa202('0x19')][_0xa202('0x27')]=function(_0x355e11,_0x140698){this[_0xa202('0x12')][_0xa202('0x28')](_0x355e11)[_0xa202('0x18')](function(_0x1673c0){if(_0x1673c0){if(_0x1673c0['IntervalId']){_0x140698(null,[_0x1673c0[_0xa202('0x29')]]);}else{_0x140698(null,_[_0xa202('0x2a')](_0x1673c0[_0xa202('0x2b')],_0xa202('0x29')));}}else{_0x140698(null,![]);}})[_0xa202('0x15')](function(_0x4e5bed){_0x140698(_0x4e5bed);});};AGIVertices[_0xa202('0x19')]['getSoundPath']=function(_0x4b839d){return util[_0xa202('0x2c')](_0xa202('0x2d'),FILES_PATH,_0x4b839d);};AGIVertices['prototype'][_0xa202('0x2e')]=function(_0x17e31c,_0x1f673d,_0x199c93){odbc[_0xa202('0x2f')](_0x17e31c,function(_0x375d96){if(_0x375d96){logger['error'](_0xa202('0x30'),_0x375d96);_0x199c93(_0x375d96);}else{logger[_0xa202('0x31')](_0xa202('0x32'));odbc[_0xa202('0x33')](_0x1f673d,function(_0x57847b,_0x22af1c){if(_0x57847b){logger[_0xa202('0x31')](_0xa202('0x34'),_0x1f673d);_0x199c93(_0x57847b);}else{logger['info'](_0xa202('0x35'),_0x1f673d);odbc['close'](function(_0x3e9b1f){if(_0x3e9b1f){logger[_0xa202('0x36')](_0xa202('0x37'),_0x3e9b1f);}_0x199c93(null,_0x22af1c);});}});}});};AGIVertices[_0xa202('0x19')]['getSmsAccount']=function(_0x4ad9fe,_0x132ea1){this[_0xa202('0x12')]['getSmsAccountById'](_0x4ad9fe)[_0xa202('0x18')](function(_0x30ca68){_0x132ea1(null,_0x30ca68?_0x30ca68:![]);})['catch'](function(_0x592b35){_0x132ea1(_0x592b35);});};AGIVertices[_0xa202('0x19')][_0xa202('0x38')]=function(_0x2f3928,_0x1b711c){this[_0xa202('0x12')][_0xa202('0x38')](_0x2f3928)[_0xa202('0x18')](function(_0x2b8110){_0x1b711c(null,_0x2b8110);})[_0xa202('0x15')](function(_0x5ecdb6){_0x1b711c(_0x5ecdb6);});};AGIVertices[_0xa202('0x19')]['createSquareDetailsReport']=function(_0xd3ce4b,_0x59bb2e,_0x5b3441){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0xa202('0xf')]['uniqueid'],'node':_0xd3ce4b['label'],'application':_0xd3ce4b['agicommand'],'data':_0x59bb2e||null,'project_name':this[_0xa202('0xf')][_0xa202('0x39')],'callerid':this['channel'][_0xa202('0x3a')]})[_0xa202('0x18')](function(_0x1e2be4){if(_0x5b3441){_0x5b3441(null,_0x1e2be4);}})[_0xa202('0x15')](function(_0x416eea){if(_0x5b3441){_0x5b3441(_0x416eea);}});};AGIVertices[_0xa202('0x19')]['createSquareRecording']=function(_0x3846c0,_0xb1fb27,_0x5b493d,_0x5ec71b){this[_0xa202('0x12')][_0xa202('0x3b')]({'uniqueid':this[_0xa202('0xf')][_0xa202('0x3c')],'callerid':this[_0xa202('0xf')][_0xa202('0x3a')],'calleridname':this['channel']['calleridname'],'context':this[_0xa202('0xf')]['context'],'extension':this[_0xa202('0xf')]['extension'],'priority':this[_0xa202('0xf')]['priority'],'accountcode':this[_0xa202('0xf')]['accountcode'],'dnid':this[_0xa202('0xf')]['dnid'],'projectName':this['channel'][_0xa202('0x39')],'saveName':_0xb1fb27,'filename':_0x3846c0[_0xa202('0x3d')]||_0xb1fb27,'savePath':_0x5b493d})[_0xa202('0x18')](function(_0x499d55){_0x5ec71b(null,_0x499d55);})[_0xa202('0x15')](function(_0x2f69df){_0x5ec71b(_0x2f69df);});};AGIVertices[_0xa202('0x19')][_0xa202('0x3e')]=function(_0x30e06b,_0x46b037,_0x1a7ec1,_0x2e578c,_0x4be0e0){this[_0xa202('0x12')][_0xa202('0x3e')]({'uniqueid':this['channel']['uniqueid'],'body':_0x30e06b,'direction':_0x46b037,'providerName':_0x1a7ec1,'providerResponse':_0x2e578c})[_0xa202('0x18')](function(_0x12a620){if(_0x4be0e0){_0x4be0e0(null,_0x12a620);}})['catch'](function(_0x2a10df){if(_0x4be0e0){_0x4be0e0(_0x2a10df);}});};AGIVertices[_0xa202('0x19')][_0xa202('0x3f')]=function(_0x4fa6bb,_0x3c151c){this[_0xa202('0x12')][_0xa202('0x3f')]({'firstName':_['isEmpty'](_0x4fa6bb[_0xa202('0x14')])||_[_0xa202('0x40')](_0x4fa6bb['name'])?_0xa202('0x41')+Math['random']():_0x4fa6bb[_0xa202('0x14')],'lastName':_[_0xa202('0x42')](_0x4fa6bb[_0xa202('0x43')])||_[_0xa202('0x40')](_0x4fa6bb[_0xa202('0x43')])?null:_0x4fa6bb[_0xa202('0x43')],'phone':_0x4fa6bb[_0xa202('0x44')],'ListId':_0x4fa6bb[_0xa202('0x45')],'scheduledat':_0x4fa6bb[_0xa202('0x46')],'callbackUniqueid':this[_0xa202('0xf')][_0xa202('0x3c')],'tags':'callback','description':_0xa202('0x47')+_0x4fa6bb[_0xa202('0x46')][_0xa202('0x48')](),'priority':_0x4fa6bb[_0xa202('0x49')]})[_0xa202('0x18')](function(_0x4b759c){_0x3c151c(null,_0x4b759c);})['catch'](function(_0x4f0b34){_0x3c151c(_0x4f0b34);});};AGIVertices[_0xa202('0x19')][_0xa202('0x4a')]=function(_0x29a0c3,_0x455708){this[_0xa202('0x12')]['getPauseById'](_0x29a0c3)[_0xa202('0x18')](function(_0x20ab43){_0x455708(null,_0x20ab43?_0x20ab43[_0xa202('0x14')]:![]);})[_0xa202('0x15')](function(_0x1f174d){_0x455708(_0x1f174d);});};AGIVertices['prototype'][_0xa202('0x4b')]=function(_0x111591,_0x352ea9,_0x28ccbb){var _0x141857={'role':_0xa202('0x4c')};_0x141857[_0x111591]=this[_0xa202('0xf')][_0xa202('0x3a')];this[_0xa202('0x12')]['agentPause'](_0x141857,_0x352ea9,this[_0xa202('0xf')][_0xa202('0x3c')])[_0xa202('0x18')](function(_0x148c04){_0x28ccbb(null,_[_0xa202('0x40')](_0x148c04)?![]:!![]);})['catch'](function(_0x1335f2){logger[_0xa202('0x36')](_0x1335f2);_0x28ccbb(null,![]);});};AGIVertices[_0xa202('0x19')]['agentUnpause']=function(_0xda9871,_0x5c2b16){var _0x441d98={'role':_0xa202('0x4c')};_0x441d98[_0xda9871]=this[_0xa202('0xf')][_0xa202('0x3a')];this['rpc']['agentUnpause'](_0x441d98)[_0xa202('0x18')](function(_0x245ed7){_0x5c2b16(null,_[_0xa202('0x40')](_0x245ed7)?![]:!![]);})[_0xa202('0x15')](function(_0x31bbdb){logger[_0xa202('0x36')](_0x31bbdb);_0x5c2b16(null,![]);});};AGIVertices[_0xa202('0x19')][_0xa202('0x4d')]=function(_0x461820,_0x39480e){var _0x3438aa={'role':_0xa202('0x4c')};_0x3438aa[_0x461820]=this[_0xa202('0xf')][_0xa202('0x3a')];this[_0xa202('0x12')]['agentLogout'](_0x3438aa)[_0xa202('0x18')](function(_0x2bc8be){_0x39480e(null,_[_0xa202('0x40')](_0x2bc8be)?![]:!![]);})[_0xa202('0x15')](function(_0x4badb1){logger[_0xa202('0x36')](_0x4badb1);_0x39480e(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x23304c,_0x422c02){var _0x1b7fec={'role':_0xa202('0x4c')};_0x1b7fec[_0x23304c]=this[_0xa202('0xf')][_0xa202('0x3a')];var _0x28cddd=_0x23304c!=_0xa202('0x4e')?util[_0xa202('0x2c')]('%s/%s@from-sip/n',_0xa202('0x4f'),this['channel'][_0xa202('0x3a')]):undefined;this[_0xa202('0x12')][_0xa202('0x50')](_0x1b7fec,_0x28cddd)[_0xa202('0x18')](function(_0x4b5ecd){_0x422c02(null,_[_0xa202('0x40')](_0x4b5ecd)?![]:!![]);})[_0xa202('0x15')](function(_0x14d8da){logger[_0xa202('0x36')](_0x14d8da);_0x422c02(null,![]);});};AGIVertices['prototype'][_0xa202('0x51')]=function(_0x4bdff7,_0xaea4a4){sh[_0xa202('0x52')](_[_0xa202('0x53')](_0x4bdff7),function(_0x2089da,_0x2b6391){var _0x4a8ff6=_0x2b6391[_0xa202('0x54')](/(\r\n|\n|\r)/gm,'');_0xaea4a4(null,_0x4a8ff6);});};AGIVertices[_0xa202('0x19')][_0xa202('0x55')]=function(_0x5dc543,_0x468aa5){scripts[_0xa202('0x55')](_0x5dc543[_0xa202('0x56')],_0x5dc543[_0xa202('0x57')]||_0xa202('0x58'),_0x5dc543['text'],_0x5dc543[_0xa202('0x59')]||_0xa202('0x5a'),_0x5dc543[_0xa202('0x5b')]||'MALE',_0x5dc543[_0xa202('0x5c')]||_0xa202('0x5d'))[_0xa202('0x18')](function(_0x531797){_0x468aa5(null,_0x531797);})['catch'](function(_0x2e46f6){_0x468aa5(_0x2e46f6);});};AGIVertices['prototype']['googleTTS']=function(_0x315517,_0x1093be){scripts[_0xa202('0x5e')](_0x315517[_0xa202('0x58')],_0x315517[_0xa202('0x5f')]||'en',0x1)[_0xa202('0x18')](function(_0x4ca712){_0x1093be(null,_0x4ca712);})[_0xa202('0x15')](function(_0x26c2cc){_0x1093be(_0x26c2cc);});};AGIVertices[_0xa202('0x19')][_0xa202('0x60')]=function(_0x4a5bb,_0x3d76f2){var _0x35d846={'uri':_0x4a5bb[_0xa202('0x61')],'method':_0x4a5bb[_0xa202('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4a5bb['timeout'])===_0xa202('0x63')&&parseInt(_0x4a5bb['timeout'])>=0x1?parseInt(_0x4a5bb['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa202('0x64')]([_0xa202('0x65'),_0xa202('0x66')],_0x35d846[_0xa202('0x62')][_0xa202('0x67')]())){try{_0x35d846[_0xa202('0x68')]=_0x4a5bb['rawBody']?JSON['parse'](_0x4a5bb['rawBody']):{};}catch(_0x5051f9){logger[_0xa202('0x36')](_0xa202('0x69'),_0x5051f9);}}try{_0x35d846['headers']=_0x4a5bb[_0xa202('0xa')]?JSON[_0xa202('0x6a')](_0x4a5bb[_0xa202('0xa')]):{};}catch(_0x4ddd03){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4ddd03);}if(_0x4a5bb[_0xa202('0x6b')]){try{var _0x500123=require(_0x4a5bb[_0xa202('0x6b')])[_0xa202('0x6c')](this,_0x35d846);_0x35d846[_0xa202('0x6d')]=Mustache[_0xa202('0x6e')](_0x4a5bb[_0xa202('0x61')],_0x500123,{},['$$','$$']);if(_0x35d846[_0xa202('0x6f')]){_0x35d846['headers']=JSON['parse'](Mustache[_0xa202('0x6e')](JSON[_0xa202('0x70')](_0x35d846[_0xa202('0x6f')]),_0x500123,{},['$$','$$']));}if(_0x35d846[_0xa202('0x68')]){_0x35d846[_0xa202('0x68')]=JSON[_0xa202('0x6a')](Mustache[_0xa202('0x6e')](JSON[_0xa202('0x70')](_0x35d846[_0xa202('0x68')]),_0x500123,{},['$$','$$']));}}catch(_0x121740){logger[_0xa202('0x36')](_0xa202('0x71'),_0x121740);}}rp(_0x35d846)[_0xa202('0x18')](function(_0x23a3cd){var _0x7ecc3e={'statusCode':_0x23a3cd['statusCode']||0xc8,'statusMessage':_0x23a3cd[_0xa202('0x72')]||'OK','headers':_0x23a3cd[_0xa202('0x6f')]||{},'body':_0x23a3cd[_0xa202('0x68')]||{}};_0x3d76f2(null,_0x7ecc3e);})[_0xa202('0x15')](function(_0x2b60e4){var _0x4f6a45={'statusCode':_0x2b60e4['statusCode']||0x1f4,'statusMessage':_0x2b60e4[_0xa202('0x73')]||_0xa202('0x74'),'headers':_0x2b60e4[_0xa202('0x75')][_0xa202('0x6f')]||{},'body':_0x2b60e4['options'][_0xa202('0x68')]||{}};_0x3d76f2(null,_0x4f6a45);});};AGIVertices[_0xa202('0x19')][_0xa202('0x76')]=function(_0x48ba3f,_0x1d352f){scripts[_0xa202('0x76')](this[_0xa202('0xf')][_0xa202('0x3c')],_0x48ba3f[_0xa202('0x77')],_0x48ba3f[_0xa202('0x58')],_0x48ba3f[_0xa202('0x78')]||'en')['then'](function(_0x5159c2){_0x1d352f(null,_0x5159c2);})[_0xa202('0x15')](function(_0xafdcb1){_0x1d352f(_0xafdcb1);});};AGIVertices[_0xa202('0x19')]['googleDialogflowV2']=function(_0x30d4d9,_0xf6f596){scripts[_0xa202('0x79')](this[_0xa202('0xf')][_0xa202('0x3c')],_0x30d4d9[_0xa202('0x7a')],_0x30d4d9[_0xa202('0x7b')],_0x30d4d9[_0xa202('0x7c')],_0x30d4d9[_0xa202('0x58')],_0x30d4d9[_0xa202('0x7d')]||'en')[_0xa202('0x18')](function(_0x3ef6c9){_0xf6f596(null,_0x3ef6c9);})[_0xa202('0x15')](function(_0x534233){_0xf6f596(_0x534233);});};AGIVertices[_0xa202('0x19')][_0xa202('0x7e')]=function(_0x5ca753,_0x59c7b4){scripts['sestekNDA'](this[_0xa202('0xf')],_0x5ca753)[_0xa202('0x18')](function(_0x408a0c){_0x59c7b4(null,_0x408a0c);})[_0xa202('0x15')](function(_0x149ae7){_0x59c7b4(_0x149ae7);});};AGIVertices['prototype'][_0xa202('0x7f')]=function(_0x3b46bc,_0x2f1f44){scripts[_0xa202('0x7f')](_0x3b46bc[_0xa202('0x77')],_0x3b46bc[_0xa202('0x58')],_0x3b46bc['ispeech_tts_language']||_0xa202('0x5a'),_0x3b46bc[_0xa202('0x80')])[_0xa202('0x18')](function(_0x50f8e4){_0x2f1f44(null,_0x50f8e4);})[_0xa202('0x15')](function(_0x58719a){_0x2f1f44(_0x58719a);});};AGIVertices[_0xa202('0x19')][_0xa202('0x81')]=function(_0x3bb677,_0x47b67c,_0x22407c){scripts[_0xa202('0x81')](_0x47b67c,_0x3bb677[_0xa202('0x77')],_0x3bb677[_0xa202('0x82')]||_0xa202('0x5a'),this[_0xa202('0x83')](_0x3bb677[_0xa202('0x84')])?_0x3bb677[_0xa202('0x84')]:undefined)[_0xa202('0x18')](function(_0x4053f2){_0x22407c(null,_0x4053f2);})[_0xa202('0x15')](function(_0x50278d){_0x22407c(_0x50278d);});};AGIVertices['prototype'][_0xa202('0x85')]=function(_0x345dac,_0x4a0124){scripts[_0xa202('0x85')](_0x345dac[_0xa202('0x86')],_0x345dac['aws_secret_access_key'],_0x345dac[_0xa202('0x87')],_0x345dac[_0xa202('0x88')]||_0xa202('0x89'),_0x345dac['text'],_0x345dac['aws_text_type']||_0xa202('0x58'))[_0xa202('0x18')](function(_0x560047){_0x4a0124(null,_0x560047);})['catch'](function(_0x5b5a8c){_0x4a0124(_0x5b5a8c);});};AGIVertices[_0xa202('0x19')]['awsLex']=function(_0x5f4523,_0x2e6a39){scripts['awsLex'](this[_0xa202('0xf')][_0xa202('0x3c')],_0x5f4523['aws_access_key_id'],_0x5f4523['aws_secret_access_key'],_0x5f4523['aws_lex_region'],_0x5f4523[_0xa202('0x58')],_0x5f4523[_0xa202('0x8a')])['then'](function(_0x44cede){_0x2e6a39(null,_0x44cede);})[_0xa202('0x15')](function(_0x4a4b9d){_0x2e6a39(_0x4a4b9d);});};AGIVertices[_0xa202('0x19')][_0xa202('0x8b')]=function(_0x263867,_0x6ba75b,_0x50fcdf){scripts[_0xa202('0x8b')](_0x6ba75b,_0x263867[_0xa202('0x77')],_0x263867['google_asr_language']||_0xa202('0x5a'))['then'](function(_0x1b6d3e){_0x50fcdf(null,_0x1b6d3e);})[_0xa202('0x15')](function(_0x3b7978){_0x50fcdf(_0x3b7978);});};AGIVertices[_0xa202('0x19')][_0xa202('0x8c')]=function(_0x34e511,_0x326282,_0x2ffbab){scripts[_0xa202('0x8c')](_0x326282,_0x34e511[_0xa202('0x8d')],_0x34e511['appsecret'],_0x34e511[_0xa202('0x6d')])['then'](function(_0x33c924){_0x2ffbab(null,_0x33c924);})['catch'](function(_0x3edf76){_0x2ffbab(_0x3edf76);});};AGIVertices[_0xa202('0x19')][_0xa202('0x8e')]=function(_0xaaf591){var _0x4cd1b2=_['includes'](verticesWithRetry,_0xaaf591[_0xa202('0x8f')])?_0xaaf591:_[_0xa202('0x90')](_0xaaf591);for(var _0x54aaf9 in _0x4cd1b2){if(_0x4cd1b2[_0xa202('0x91')](_0x54aaf9)){if(_0x4cd1b2[_0x54aaf9]&&_[_0xa202('0x92')](_0x4cd1b2[_0x54aaf9])){if(_['includes'](recursiveMapAttributes,_0x54aaf9)){_0x4cd1b2[_0x54aaf9]=this[_0xa202('0x93')](_0x4cd1b2[_0x54aaf9]);}else{_0x4cd1b2[_0x54aaf9]=this['replaceAllVariables'](_0x4cd1b2[_0x54aaf9]);}}}}return _0x4cd1b2;};AGIVertices[_0xa202('0x19')][_0xa202('0x94')]=function(_0x2e6c09){for(var _0x3c954b in _0x2e6c09){if(_0x2e6c09[_0xa202('0x91')](_0x3c954b)){if(_[_0xa202('0x95')](_0x2e6c09[_0x3c954b])){this['recursiveNodeIndex'](_0x2e6c09[_0x3c954b]);}else if(_[_0xa202('0x96')](_0x2e6c09[_0x3c954b])){for(var _0x346887=0x0;_0x346887<_0x2e6c09[_0x3c954b][_0xa202('0x97')];_0x346887++){this[_0xa202('0x94')](_0x2e6c09[_0x3c954b][_0x346887]);}}else if(_['isString'](_0x2e6c09[_0x3c954b])){_0x2e6c09[_0x3c954b]=this[_0xa202('0x98')](_0x2e6c09[_0x3c954b]);}}}};AGIVertices[_0xa202('0x19')][_0xa202('0x99')]=function(_0xefaac5,_0xe3df6f){for(var _0x57d6bf in _0xefaac5){if(_0xefaac5['hasOwnProperty'](_0x57d6bf)){if(_['isPlainObject'](_0xefaac5[_0x57d6bf])){if(!_[_0xa202('0x42')](_0xefaac5[_0x57d6bf])){this['saveRestApiResult'](_0xefaac5[_0x57d6bf],util['format'](_0xa202('0x9a'),_0xe3df6f,_0x57d6bf));}}else if(_[_0xa202('0x96')](_0xefaac5[_0x57d6bf])){for(var _0xa1553e=0x0;_0xa1553e<_0xefaac5[_0x57d6bf][_0xa202('0x97')];_0xa1553e++){this[_0xa202('0x99')](_0xefaac5[_0x57d6bf][_0xa1553e],util['format'](_0xa202('0x9a'),_0xe3df6f,_0x57d6bf+'['+_0xa1553e+']'));}}else{if(!_[_0xa202('0x40')](_0xefaac5[_0x57d6bf])){this[_0xa202('0xf')]['setVariable'](util[_0xa202('0x2c')](_0xa202('0x9a'),_0xe3df6f,_0x57d6bf),_0xefaac5[_0x57d6bf]);}}}}};AGIVertices[_0xa202('0x19')][_0xa202('0x93')]=function(_0x1ea3b0){try{var _0x319c1d=JSON[_0xa202('0x6a')](_0x1ea3b0);this[_0xa202('0x94')](_0x319c1d);return JSON[_0xa202('0x70')](_0x319c1d);}catch(_0x3261ca){return this['replaceAllVariables'](_0x1ea3b0);}};AGIVertices[_0xa202('0x19')][_0xa202('0x98')]=function(_0x1dc58b){var _0x47548e=_0x1dc58b[_0xa202('0x9b')]('{');for(var _0x3214a8=0x1;_0x3214a8<_0x47548e['length'];_0x3214a8+=0x1){var _0x416179=_0x47548e[_0x3214a8]['split']('}');if(_0x416179[_0xa202('0x97')]>0x1){_0x1dc58b=_0x1dc58b[_0xa202('0x9c')]('{'+_0x416179[0x0]+'}',this['channel'][_0xa202('0x11')](_0x416179[0x0])[_0xa202('0x9d')]||_0x416179[0x0]);}}if(_0x47548e[_0xa202('0x97')]===0x1){return _0x1dc58b[_0xa202('0x48')]();}return this[_0xa202('0x98')](_0x1dc58b);};AGIVertices[_0xa202('0x19')][_0xa202('0x9e')]=function(_0x1ddee2,_0x52d985){var _0x3d0eab=this[_0xa202('0xf')]['getVariable'](_0x1ddee2);if(_0x3d0eab[_0xa202('0x9f')]===-0x1){return _0x3d0eab;}logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xa0'),_0x52d985,_0x3d0eab[_0xa202('0x9d')]));return this[_0xa202('0xf')][_0xa202('0xa1')](_0x52d985,_0x3d0eab[_0xa202('0x9d')]);};AGIVertices[_0xa202('0x19')][_0xa202('0x83')]=function(_0x33691e){return _0x33691e&&_0x33691e!=='0'&&_0x33691e!=='-1'&&_0x33691e!=='';};AGIVertices[_0xa202('0x19')][_0xa202('0xa2')]=function(_0x15e7e1){this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x15e7e1,'-');_0x15e7e1['retry']=_0x15e7e1['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa202('0x19')]['mrcpsynth']=function(_0x4fc5a4){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xa4'),_0x4fc5a4[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x4fc5a4[_0xa202('0x58')])){return this['channel'][_0xa202('0xa6')]('no\x20text\x20configured');}var _0x48283b='\x22'+_0x4fc5a4[_0xa202('0x58')]+'\x22';if(this['isConfigured'](_0x4fc5a4['options'])){_0x48283b+=','+_0x4fc5a4['options'];}var _0x395060=this[_0xa202('0xf')]['exec'](_0xa202('0xa7'),_0x48283b);if(_0x395060[_0xa202('0x9f')]===-0x1){return _0x395060;}return this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')](_0xa202('0xa8'),_0x48283b));};AGIVertices['prototype'][_0xa202('0xa9')]=function(_0x1cfae6){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1cfae6[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x1cfae6[_0xa202('0xaa')])){return this[_0xa202('0xf')]['noop']('no\x20grammar\x20configured');}var _0xf587f3=_0x1cfae6['grammar'];if(this[_0xa202('0x83')](_0x1cfae6['options'])){_0xf587f3+=','+_0x1cfae6[_0xa202('0x75')];}var _0x51d20a=this[_0xa202('0xf')]['exec'](_0xa202('0xab'),_0xf587f3);if(_0x51d20a[_0xa202('0x9f')]===-0x1){return _0x51d20a;}var _0x508779=this['getAndSetVariable'](_0xa202('0xac'),_0xa202('0xad'));if(_0x508779[_0xa202('0x9f')]===-0x1){return _0x508779;}var _0x250427=this[_0xa202('0x9e')](_0xa202('0xae'),_0xa202('0xaf'));if(_0x250427[_0xa202('0x9f')]===-0x1){return _0x250427;}var _0x12feba=this['getAndSetVariable'](_0xa202('0xb0'),_0xa202('0xb1'));if(_0x12feba[_0xa202('0x9f')]===-0x1){return _0x12feba;}return this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')](_0xa202('0xb2'),_0xf587f3));};AGIVertices[_0xa202('0x19')][_0xa202('0xb3')]=function(_0x52993d){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x52993d[_0xa202('0xa5')]));return this[_0xa202('0xf')][_0xa202('0xb3')]([_0x52993d[_0xa202('0xb4')],_0x52993d[_0xa202('0xb5')]]);};AGIVertices[_0xa202('0x19')]['answer']=function(_0x56662d){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xb6'),_0x56662d['label']));if(this[_0xa202('0x83')](_0x56662d['timeout'])){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xb7'),_0x56662d[_0xa202('0xb8')]));var _0x55bc73=this[_0xa202('0xf')][_0xa202('0xb9')](_0x56662d[_0xa202('0xb8')]);if(_0x55bc73[_0xa202('0x9f')]===-0x1){return _0x55bc73;}}return this[_0xa202('0xf')][_0xa202('0xba')]();};AGIVertices[_0xa202('0x19')][_0xa202('0xbb')]=function(_0x2c5ef0){logger[_0xa202('0x31')](util['format'](_0xa202('0xbc'),_0x2c5ef0['label']));if(!this[_0xa202('0x83')](_0x2c5ef0[_0xa202('0x45')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x2c5ef0,_0xa202('0xbd'));}_0x2c5ef0[_0xa202('0x46')]=moment();if(this['isConfigured'](_0x2c5ef0[_0xa202('0xbe')])){_0x2c5ef0[_0xa202('0x46')]=moment()['add'](_0x2c5ef0['delay'],_0xa202('0xbf'));}if(!this[_0xa202('0x83')](_0x2c5ef0[_0xa202('0x49')])){_0x2c5ef0['callback_priority']=0x2;}this[_0xa202('0x3f')][_0xa202('0x6c')](this,_0x2c5ef0);return this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0xc0'),_0x2c5ef0[_0xa202('0x44')],_0x2c5ef0[_0xa202('0x45')],_0x2c5ef0[_0xa202('0x46')]));};AGIVertices['prototype'][_0xa202('0xc1')]=function(_0xb38420){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xc2'),_0xb38420[_0xa202('0xa5')]));var _0x6cf91e=this[_0xa202('0xf')][_0xa202('0x52')](_0xb38420[_0xa202('0xc3')],_0xb38420[_0xa202('0x75')]);if(_0x6cf91e[_0xa202('0x9f')]===-0x1){return _0x6cf91e;}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xc4'),_0xb38420[_0xa202('0xc3')],_0xb38420['options']));};AGIVertices[_0xa202('0x19')][_0xa202('0xc5')]=function(_0x189bb2){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xc6'),_0x189bb2['label']));if(!this[_0xa202('0x83')](_0x189bb2[_0xa202('0x58')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xc7'));}var _0x3fb9ec='\x22'+_0x189bb2[_0xa202('0x58')]+'\x22';if(this[_0xa202('0x83')](_0x189bb2[_0xa202('0x75')])){_0x3fb9ec+=','+_0x189bb2['options'];}var _0x3ce874=this[_0xa202('0xf')][_0xa202('0x52')]('MRCPSynth',_0x3fb9ec);if(_0x3ce874[_0xa202('0x9f')]===-0x1){return _0x3ce874;}return this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xa8'),_0x3fb9ec));};AGIVertices['prototype'][_0xa202('0xc8')]=function(_0x5ce2db){logger['info'](util[_0xa202('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5ce2db['label']));if(!this[_0xa202('0x83')](_0x5ce2db[_0xa202('0x58')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xc7'));}var _0x30b5a7='\x22'+_0x5ce2db[_0xa202('0x58')]+'\x22';if(this['isConfigured'](_0x5ce2db[_0xa202('0x75')])){_0x30b5a7+=','+_0x5ce2db[_0xa202('0x75')];}var _0x5dc54e=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0xa7'),_0x30b5a7);if(_0x5dc54e[_0xa202('0x9f')]===-0x1){return _0x5dc54e;}return this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0xa8'),_0x30b5a7));};AGIVertices['prototype']['lumenvoxasr']=function(_0x497c4a){logger['info'](util[_0xa202('0x2c')](_0xa202('0xc9'),_0x497c4a[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x497c4a[_0xa202('0xaa')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xca'));}var _0x436890=_0x497c4a[_0xa202('0xaa')];if(this[_0xa202('0x83')](_0x497c4a[_0xa202('0x75')])){_0x436890+=','+_0x497c4a[_0xa202('0x75')];}var _0x3662e7=this[_0xa202('0xf')]['exec']('MRCPRecog',_0x436890);if(_0x3662e7[_0xa202('0x9f')]===-0x1){return _0x3662e7;}var _0x2aa4eb=this[_0xa202('0x9e')](_0xa202('0xac'),_0xa202('0xcb'));if(_0x2aa4eb[_0xa202('0x9f')]===-0x1){return _0x2aa4eb;}var _0x5472d1=this[_0xa202('0x9e')](_0xa202('0xae'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5472d1[_0xa202('0x9f')]===-0x1){return _0x5472d1;}var _0x318846=this[_0xa202('0x9e')](_0xa202('0xb0'),_0xa202('0xcc'));if(_0x318846[_0xa202('0x9f')]===-0x1){return _0x318846;}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xb2'),_0x436890));};AGIVertices[_0xa202('0x19')][_0xa202('0xcd')]=function(_0x5da937){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xce'),_0x5da937[_0xa202('0xa5')]));if(!this['isConfigured'](_0x5da937['grammar'])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xca'));}var _0x3f18e7=_0x5da937['grammar'];if(this['isConfigured'](_0x5da937[_0xa202('0x75')])){_0x3f18e7+=','+_0x5da937[_0xa202('0x75')];}var _0x392248=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0xab'),_0x3f18e7);if(_0x392248[_0xa202('0x9f')]===-0x1){return _0x392248;}var _0x5e1706=this[_0xa202('0x9e')](_0xa202('0xac'),_0xa202('0xcf'));if(_0x5e1706[_0xa202('0x9f')]===-0x1){return _0x5e1706;}var _0x2b15ec=this[_0xa202('0x9e')](_0xa202('0xae'),'SESTEK_ASR_TRANSCRIPT');if(_0x2b15ec[_0xa202('0x9f')]===-0x1){return _0x2b15ec;}var _0x5cf7c9=this[_0xa202('0x9e')]('RECOG_INSTANCE()',_0xa202('0xd0'));if(_0x5cf7c9[_0xa202('0x9f')]===-0x1){return _0x5cf7c9;}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3f18e7));};AGIVertices['prototype'][_0xa202('0xd1')]=function(_0x1ebef8){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xd2'),_0x1ebef8[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x1ebef8[_0xa202('0xd3')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x1ebef8,_0xa202('0xd4'));}var _0x17f279=this['getSquareOdbc']['sync'](this,_0x1ebef8[_0xa202('0xd3')]);if(!_0x17f279){return this[_0xa202('0xf')][_0xa202('0x36')](_0x1ebef8,'no\x20odbc\x20database\x20found');}if(!this[_0xa202('0x83')](_0x1ebef8[_0xa202('0x33')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x1ebef8,_0xa202('0xd5'));}var _0x4aec20=_0x1ebef8[_0xa202('0x33')][_0xa202('0x54')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xa202('0x2c')](_0xa202('0xd6'),_0x4aec20));var _0x22ca01=this['getQueryOdbc']['sync'](this,_0x17f279,_0x4aec20);this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x1ebef8,_0x4aec20);if(!this['isConfigured'](_0x1ebef8[_0xa202('0xd7')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xd8'));}var _0x3a1689=this[_0xa202('0x11')][_0xa202('0x6c')](this,_0x1ebef8['variable_id']);if(!_0x3a1689){return this[_0xa202('0xf')][_0xa202('0x36')](_0x1ebef8,_0xa202('0xd9'));}var _0x46ef7c=this;_0x22ca01[_0xa202('0xda')](function(_0x512282,_0x126129){Object['keys'](_0x512282)['forEach'](function(_0xc088c0){_0x46ef7c[_0xa202('0xf')][_0xa202('0xa1')](util[_0xa202('0x2c')]('%s[%s][%s]',_0x3a1689,_0x126129,_0xc088c0),_0x512282[_0xc088c0]);});});this[_0xa202('0xf')][_0xa202('0xa1')](util['format']('%s_ROWS_COUNT',_0x3a1689),_0x22ca01[_0xa202('0x97')]);return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xdb'),_0x3a1689));};AGIVertices[_0xa202('0x19')][_0xa202('0xdc')]=function(_0x2fdd41){logger[_0xa202('0xdd')](util['format'](_0xa202('0xde'),_0x2fdd41[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x2fdd41[_0xa202('0xdf')])){return this[_0xa202('0xf')]['error'](_0x2fdd41,_0xa202('0xe0'));}var _0x2da163=this[_0xa202('0xe1')][_0xa202('0x6c')](this,_0x2fdd41[_0xa202('0xdf')]);if(!_0x2da163){return this[_0xa202('0xf')][_0xa202('0x36')](_0x2fdd41,'no\x20user\x20found');}var _0x3f4b03=this[_0xa202('0xf')]['exec']('DIAL',[util[_0xa202('0x2c')](_0xa202('0xe2'),_0x2da163),_0x2fdd41[_0xa202('0xb8')],_0x2fdd41['opts'],_0x2fdd41[_0xa202('0x61')]]);if(_0x3f4b03['result']===-0x1){return _0x3f4b03;}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xe3'),'DIAL'));};AGIVertices[_0xa202('0x19')][_0xa202('0xe4')]=function(_0x1073f1){logger[_0xa202('0x31')](util['format'](_0xa202('0xe5'),_0x1073f1['label']));if(!this[_0xa202('0x83')](_0x1073f1[_0xa202('0x77')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xe6'));}if(!this[_0xa202('0x83')](_0x1073f1[_0xa202('0x58')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xc7'));}this[_0xa202('0xf')][_0xa202('0xe7')]=!![];this[_0xa202('0xa3')](_0x1073f1);this[_0xa202('0x3e')](_0x1073f1[_0xa202('0x58')],'in','','');this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xe8'),_0x1073f1['text']));var _0x3180e5=this[_0xa202('0x76')]['sync'](this,_0x1073f1);if(_0x3180e5){for(var _0x2c2b07 in _0x3180e5){if(_0x3180e5['hasOwnProperty'](_0x2c2b07)){this['channel'][_0xa202('0xa1')](util['format']('DIALOGFLOW_%s',_0x2c2b07[_0xa202('0x67')]()),_0x3180e5[_0x2c2b07]);}}this[_0xa202('0x3e')](_0x3180e5[_0xa202('0xe9')],_0xa202('0xea'),_0xa202('0xe4'),'');return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xeb'),_0x3180e5[_0xa202('0xe9')]));}return this[_0xa202('0xf')][_0xa202('0x36')](_0x1073f1,_0xa202('0xec'));};AGIVertices[_0xa202('0x19')][_0xa202('0xed')]=function(_0xfdc5d0){logger[_0xa202('0x31')](util['format'](_0xa202('0xee'),_0xfdc5d0[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0xfdc5d0[_0xa202('0x7a')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xef'));}if(!this[_0xa202('0x83')](_0xfdc5d0[_0xa202('0x7b')])){return this['channel'][_0xa202('0xa6')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0xfdc5d0[_0xa202('0x7c')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xf0'));}if(!this['isConfigured'](_0xfdc5d0[_0xa202('0x7d')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xf1'));}if(!this['isConfigured'](_0xfdc5d0[_0xa202('0x58')])){return this[_0xa202('0xf')]['noop'](_0xa202('0xc7'));}this['channel'][_0xa202('0xe7')]=!![];this[_0xa202('0xa3')](_0xfdc5d0);this['createSquareMessage'](_0xfdc5d0[_0xa202('0x58')],'in','','');this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('Trying\x20DialogflowV2:\x20%s',_0xfdc5d0[_0xa202('0x58')]));var _0x1d6224=this[_0xa202('0x79')]['sync'](this,_0xfdc5d0);if(_0x1d6224){for(var _0x1d3c8f in _0x1d6224){if(_0x1d6224[_0xa202('0x91')](_0x1d3c8f)){if(_0x1d3c8f!==_0xa202('0xf2')){this[_0xa202('0xf')][_0xa202('0xa1')](util[_0xa202('0x2c')](_0xa202('0xf3'),_0x1d3c8f[_0xa202('0x67')]()),_0x1d6224[_0x1d3c8f]);}}}this[_0xa202('0x3e')](_0x1d6224[_0xa202('0xe9')],_0xa202('0xea'),_0xa202('0xed'),_0x1d6224[_0xa202('0xf2')]);return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xf4'),_0x1d6224['speech']));}return this[_0xa202('0xf')]['error'](_0xfdc5d0,_0xa202('0xf5'));};AGIVertices[_0xa202('0x19')][_0xa202('0xf6')]=function(_0x39fed5){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0xf7'),_0x39fed5[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x39fed5['ndauth_url'])){return this['channel']['noop'](_0xa202('0xf8'));}if(!this[_0xa202('0x83')](_0x39fed5[_0xa202('0xf9')])){return this['channel'][_0xa202('0xa6')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x39fed5[_0xa202('0xfa')])){return this['channel'][_0xa202('0xa6')](_0xa202('0xfb'));}if(!this[_0xa202('0x83')](_0x39fed5[_0xa202('0xfc')])){return this[_0xa202('0xf')]['noop'](_0xa202('0xc7'));}this[_0xa202('0xf')][_0xa202('0xe7')]=!![];this['createSquareDetailsReport'](_0x39fed5);this['createSquareMessage'](_0x39fed5[_0xa202('0x58')],'in','','');this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0xfd'),_0x39fed5[_0xa202('0x58')]));var _0x26366b=this[_0xa202('0x7e')][_0xa202('0x6c')](this,_0x39fed5);if(_0x26366b){for(var _0x39ff80 in _0x26366b){if(_0x26366b[_0xa202('0x91')](_0x39ff80)){this[_0xa202('0xf')][_0xa202('0xa1')](util['format'](_0xa202('0xfe'),_0x39ff80['toUpperCase']()),_0x26366b[_0x39ff80]);}}this['createSquareMessage'](_0x26366b[_0xa202('0xe9')],'out','sesteknda','');if(_0x26366b[_0xa202('0xff')]){this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x100'),_0x26366b[_0xa202('0xff')]));var _0x41d0ac=this[_0xa202('0xf')][_0xa202('0x101')](_0x26366b[_0xa202('0xff')]);try{fs[_0xa202('0x102')](_0x26366b[_0xa202('0xff')]+_0xa202('0x103'));}catch(_0x14b5c6){logger[_0xa202('0x36')](_0x14b5c6);}return _0x41d0ac;}else{return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('SestekNDA\x20Result\x20%s',_0x26366b[_0xa202('0xe9')]));}}return this[_0xa202('0xf')]['error'](_0x39fed5,_0xa202('0x104'));};AGIVertices[_0xa202('0x19')]['end']=function(_0x5d3781){logger['info'](util[_0xa202('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5d3781[_0xa202('0xa5')]));return this['channel'][_0xa202('0xa6')](_0xa202('0x105'));};AGIVertices['prototype'][_0xa202('0x106')]=function(_0x312362){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x312362[_0xa202('0xa5')]));var _0x165c42='';if(_0x312362['trunk_id']){if(!this[_0xa202('0x83')](_0x312362[_0xa202('0x107')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x312362,_0xa202('0x108'));}else{var _0x189a71=parseInt(_0x312362[_0xa202('0x107')],0xa);if(isNaN(_0x189a71)){_0x165c42=_0x312362[_0xa202('0x107')];}else{_0x165c42=this[_0xa202('0x20')][_0xa202('0x6c')](this,_0x312362[_0xa202('0x107')]);if(!_0x165c42){return this['channel']['error'](_0x312362,_0xa202('0x109'));}}}}else if(_0x312362['trunk_name']){_0x165c42=_0x312362[_0xa202('0x10a')];}else{return this[_0xa202('0xf')][_0xa202('0x36')](_0x312362,_0xa202('0x108'));}var _0x9bc85d=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0x10b'),[util[_0xa202('0x2c')](_0xa202('0x10c'),_0x165c42,_0x312362[_0xa202('0x44')]),_0x312362[_0xa202('0xb8')],_0x312362['opts'],_0x312362[_0xa202('0x61')]]);if(_0x9bc85d[_0xa202('0x9f')]===-0x1){return _0x9bc85d;}return this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')](_0xa202('0xe3'),'DIAL'));};AGIVertices[_0xa202('0x19')][_0xa202('0x10d')]=function(_0x2e13d9){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2e13d9['label']));return this[_0xa202('0xf')]['noop'](_0xa202('0x10d'));};AGIVertices['prototype'][_0xa202('0xd')]=function(_0x272547){logger['info'](util[_0xa202('0x2c')](_0xa202('0x10e'),_0x272547[_0xa202('0xa5')]));if(_0x272547[_0xa202('0x10f')]===0x0){return this[_0xa202('0xa2')](_0x272547);}_0x272547['retry']-=0x1;if(!this[_0xa202('0x83')](_0x272547['file_id'])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x272547,_0xa202('0x110'));}var _0x256446=this[_0xa202('0x21')]['sync'](this,_0x272547[_0xa202('0x111')]);if(!_0x256446){return this[_0xa202('0xf')][_0xa202('0x36')](_0x272547,_0xa202('0x112'));}if(!this[_0xa202('0x83')](_0x272547['variable_id'])){return this[_0xa202('0xf')][_0xa202('0x36')](_0xa202('0xd8'));}var _0x44a90b=this[_0xa202('0xf')][_0xa202('0x113')](_0x256446,_0x272547[_0xa202('0x114')],_0x272547[_0xa202('0x115')]);var _0x5314ce=_0x44a90b[_0xa202('0x9f')]?_0x44a90b[_0xa202('0x9f')][_0xa202('0x48')]():'';logger[_0xa202('0x31')](_0xa202('0x116'),JSON['stringify'](_0x44a90b));if(_0x44a90b[_0xa202('0x9f')]===-0x1){this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x272547,_0x5314ce);return _0x44a90b;}else if(_0x44a90b['extra']===_0xa202('0xb8')){_0x44a90b['result']=_0x5314ce[_0xa202('0x97')]>=parseInt(_0x272547[_0xa202('0x117')])?'x':'i';}else{_0x44a90b[_0xa202('0x9f')]=_0x5314ce[_0xa202('0x97')]>=parseInt(_0x272547[_0xa202('0x117')])&&_0x5314ce[_0xa202('0x97')]<=parseInt(_0x272547[_0xa202('0x115')])?'x':'i';}var _0x39b7f0=this[_0xa202('0x11')][_0xa202('0x6c')](this,_0x272547[_0xa202('0xd7')]);if(!_0x39b7f0){return this['channel']['error'](_0x272547,_0xa202('0xd9'));}this[_0xa202('0xf')][_0xa202('0xa1')](_0x39b7f0,_0x5314ce);if(this[_0xa202('0x83')](_0x272547[_0xa202('0x118')])){var _0x23291b=parseInt(_0x272547[_0xa202('0x118')],0xa);var _0x47b4b0=rs['generate']({'charset':'*','length':_0x23291b});var _0x47f910=_0x5314ce['length'];if(_0x47f910>0x0){if(_0x47f910>_0x23291b){this['createSquareDetailsReport']['sync'](this,_0x272547,_0x272547[_0xa202('0x119')]===_0xa202('0x11a')?_0x47b4b0+_0x5314ce['substr'](_0x23291b):_0x5314ce['substr'](0x0,_0x47f910-_0x23291b)+_0x47b4b0);}else{this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x272547,rs['generate']({'charset':'*','length':_0x47f910}));}}else{this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x272547,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x272547,_0x5314ce);}return _0x44a90b;};AGIVertices[_0xa202('0x19')]['getsecretdigits']=function(_0x4edb53){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4edb53[_0xa202('0xa5')]));return this[_0xa202('0xd')](_0x4edb53);};AGIVertices[_0xa202('0x19')][_0xa202('0x11b')]=function(_0x3d0d91){logger['info'](util[_0xa202('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x3d0d91['label']));this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x3d0d91,_0x3d0d91[_0xa202('0x11c')]);return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x11d'),_0x3d0d91['goalname']));};AGIVertices[_0xa202('0x19')]['awspolly']=function(_0x5938dd){logger['info'](util[_0xa202('0x2c')](_0xa202('0x11e'),_0x5938dd[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x5938dd[_0xa202('0x86')])||!this[_0xa202('0x83')](_0x5938dd[_0xa202('0x11f')])){return this['channel'][_0xa202('0xa6')](_0xa202('0x120'));}if(!this[_0xa202('0x83')](_0x5938dd['text'])){return this['channel'][_0xa202('0xa6')](_0xa202('0xc7'));}this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x121'),_0x5938dd[_0xa202('0x58')]));var _0x30700a=this[_0xa202('0x85')][_0xa202('0x6c')](this,_0x5938dd);if(_0x30700a){this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0x122'),_0x30700a));var _0x3313d8=this[_0xa202('0xf')][_0xa202('0x101')](_0x30700a);try{fs[_0xa202('0x102')](_0x30700a+_0xa202('0x103'));}catch(_0x1dd558){logger[_0xa202('0x36')](_0x1dd558);}return _0x3313d8;}return this['channel']['error'](_0x5938dd,_0xa202('0x123'));};AGIVertices[_0xa202('0x19')][_0xa202('0x124')]=function(_0x542690){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x125'),_0x542690[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x542690[_0xa202('0x86')])||!this[_0xa202('0x83')](_0x542690[_0xa202('0x11f')])){return this[_0xa202('0xf')]['noop'](_0xa202('0x120'));}if(!this[_0xa202('0x83')](_0x542690[_0xa202('0x8a')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x126'));}if(!this[_0xa202('0x83')](_0x542690['text'])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xc7'));}this[_0xa202('0xf')]['bot']=!![];this[_0xa202('0xa3')](_0x542690);this['createSquareMessage'](_0x542690[_0xa202('0x58')],'in','','');this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x127'),_0x542690[_0xa202('0x58')]));var _0xd2ccc0=this[_0xa202('0x128')][_0xa202('0x6c')](this,_0x542690);if(_0xd2ccc0){for(var _0x22b7cd in _0xd2ccc0){if(_0xd2ccc0['hasOwnProperty'](_0x22b7cd)&&_[_0xa202('0x92')](_0xd2ccc0[_0x22b7cd])){this[_0xa202('0xf')]['setVariable'](util[_0xa202('0x2c')](_0xa202('0x129'),_0x22b7cd[_0xa202('0x67')]()),_0xd2ccc0[_0x22b7cd]);}}if(_[_0xa202('0x40')](_0xd2ccc0[_0xa202('0x73')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x12a'));}else{this[_0xa202('0x3e')](_0xd2ccc0[_0xa202('0x73')],_0xa202('0xea'),_0xa202('0x12b'),'');return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x12c'),_0xd2ccc0[_0xa202('0x73')]));}}return this[_0xa202('0xf')]['error'](_0x542690,_0xa202('0x12d'));};AGIVertices[_0xa202('0x19')]['googleasr']=function(_0xfded86){logger[_0xa202('0x31')](util['format'](_0xa202('0x12e'),_0xfded86['label'],_0xfded86[_0xa202('0xb8')]));if(!this[_0xa202('0x83')](_0xfded86[_0xa202('0x77')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xe6'));}var _0x3999b6=_0xa202('0x12f');var _0x425ece=util[_0xa202('0x2c')](_0xa202('0x130'),FILES_PATH,rs[_0xa202('0x131')](0x4));var _0x3bb77c=util['format'](_0xa202('0x9a'),_0x425ece,_0x3999b6);var _0x1ccc7d=!![];if(_0xfded86[_0xa202('0x132')]===_0xa202('0x133')){_0x1ccc7d=![];}var _0x2e70c7=this[_0xa202('0xf')][_0xa202('0x134')](_0x425ece,_0x3999b6,_0xfded86[_0xa202('0x135')],_0xfded86[_0xa202('0xb8')],undefined,_0x1ccc7d);if(_0x2e70c7[_0xa202('0x9f')]!==-0x1){this['channel'][_0xa202('0xa6')](util['format']('google\x20%s\x20file\x20created',_0x3bb77c));var _0x7e38e7=this['googleASR'][_0xa202('0x6c')](this,_0xfded86,_0x3bb77c);if(_0x7e38e7){for(var _0x338849 in _0x7e38e7){if(_0x7e38e7[_0xa202('0x91')](_0x338849)){this[_0xa202('0xf')][_0xa202('0xa1')](util[_0xa202('0x2c')](_0xa202('0x136'),_0x338849[_0xa202('0x67')]()),_0x7e38e7[_0x338849]);}}return this['channel']['noop'](util[_0xa202('0x2c')](_0xa202('0x137'),JSON['stringify'](_0x7e38e7)));}}return _0x2e70c7;};AGIVertices[_0xa202('0x19')][_0xa202('0x138')]=function(_0x2022db){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2022db[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x2022db[_0xa202('0x8d')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x139'));}if(!this[_0xa202('0x83')](_0x2022db[_0xa202('0x13a')])){return this['channel'][_0xa202('0xa6')]('no\x20appsecret\x20configured');}var _0x154a2f='wav';var _0x335561=util[_0xa202('0x2c')](_0xa202('0x130'),FILES_PATH,rs[_0xa202('0x131')](0x4));var _0x9ea448=util[_0xa202('0x2c')](_0xa202('0x9a'),_0x335561,_0x154a2f);var _0x108337=!![];if(_0x2022db[_0xa202('0x132')]===_0xa202('0x133')){_0x108337=![];}var _0x202668=this[_0xa202('0xf')]['recordFile'](_0x335561,_0x154a2f,_0x2022db[_0xa202('0x135')],_0x2022db[_0xa202('0xb8')],undefined,_0x108337);if(_0x202668[_0xa202('0x9f')]!==-0x1){this[_0xa202('0xf')]['noop'](util['format'](_0xa202('0x13b'),_0x9ea448));var _0x3f06da=this['tildeASR'][_0xa202('0x6c')](this,_0x2022db,_0x9ea448);if(_0x3f06da){for(var _0x1d66c8 in _0x3f06da){if(_0x3f06da['hasOwnProperty'](_0x1d66c8)){this[_0xa202('0xf')][_0xa202('0xa1')](util['format'](_0xa202('0x13c'),_0x1d66c8[_0xa202('0x67')]()),_0x3f06da[_0x1d66c8]);}}return this[_0xa202('0xf')]['noop'](util['format'](_0xa202('0x13d'),JSON[_0xa202('0x70')](_0x3f06da)));}}return _0x202668;};AGIVertices[_0xa202('0x19')]['gotoc']=function(_0x3aec59){logger['info'](util['format'](_0xa202('0x13e'),_0x3aec59[_0xa202('0xa5')]));return this[_0xa202('0xf')][_0xa202('0x13f')](_0x3aec59[_0xa202('0x140')],_0x3aec59[_0xa202('0x141')],_0x3aec59[_0xa202('0x142')]);};AGIVertices[_0xa202('0x19')][_0xa202('0x143')]=function(_0x27335e){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x144'),_0x27335e[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x27335e[_0xa202('0x145')])){return this[_0xa202('0xf')]['error'](_0x27335e,_0xa202('0x146'));}try{var _0x37f875=eval(_0x27335e[_0xa202('0x145')])?'true':_0xa202('0x147');this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0x148'),_0x27335e['condition'],_0x37f875));return{'code':0xc8,'result':_0x37f875};}catch(_0xb470c6){return{'code':0xc8,'result':_0xa202('0x147')};}};AGIVertices[_0xa202('0x19')][_0xa202('0x149')]=function(_0x556ea3){logger[_0xa202('0x31')](util['format'](_0xa202('0x14a'),_0x556ea3['label']));if(!this[_0xa202('0x83')](_0x556ea3['interval_id'])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x556ea3,_0xa202('0x14b'));}var _0x2434b1=this[_0xa202('0x27')][_0xa202('0x6c')](this,_0x556ea3[_0xa202('0x14c')]);if(!_0x2434b1){return this[_0xa202('0xf')][_0xa202('0x36')](_0x556ea3,_0xa202('0x14d'));}for(var _0x179b60=0x0;_0x179b60<_0x2434b1[_0xa202('0x97')];_0x179b60+=0x1){var _0x482ed4=this[_0xa202('0xf')]['getVariable'](util[_0xa202('0x2c')](_0xa202('0x14e'),_0x2434b1[_0x179b60]));if(_0x482ed4[_0xa202('0x9f')]===-0x1){return _0x482ed4;}logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x14f'),_0x2434b1[_0x179b60],_0x482ed4[_0xa202('0x9d')]));if(_0x482ed4['extra']===_0xa202('0x150')){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x14f'),_0x2434b1[_0x179b60],_0xa202('0x150')));this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x14f'),_0x2434b1[_0x179b60],_0xa202('0x150')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0xa202('0x14f'),_0x2434b1[_0x179b60],'false'));this[_0xa202('0xf')]['noop'](util['format'](_0xa202('0x14f'),_0x2434b1[_0x179b60],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x264bdd){logger['info'](util[_0xa202('0x2c')](_0xa202('0x151'),_0x264bdd[_0xa202('0xa5')]));return this[_0xa202('0xf')][_0xa202('0x152')]();};AGIVertices[_0xa202('0x19')]['ispeechasr']=function(_0xe0b92){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0xe0b92[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0xe0b92[_0xa202('0x77')])){return this['channel'][_0xa202('0xa6')]('no\x20key\x20configured');}var _0x914692='wav';var _0x3f678f=util['format'](_0xa202('0x130'),FILES_PATH,rs['generate'](0x4));var _0x2b0276=util[_0xa202('0x2c')](_0xa202('0x9a'),_0x3f678f,_0x914692);var _0x2daa4c=!![];if(_0xe0b92['beep']==='NOBEEP'){_0x2daa4c=![];}var _0x2c34e4=this[_0xa202('0xf')][_0xa202('0x134')](_0x3f678f,_0x914692,_0xe0b92[_0xa202('0x135')],_0xe0b92[_0xa202('0xb8')],undefined,_0x2daa4c);if(_0x2c34e4[_0xa202('0x9f')]!==-0x1){this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x153'),_0x2b0276));var _0x249909=this[_0xa202('0x81')][_0xa202('0x6c')](this,_0xe0b92,_0x2b0276);if(_0x249909){for(var _0x1bff47 in _0x249909){if(_0x249909[_0xa202('0x91')](_0x1bff47)){this[_0xa202('0xf')][_0xa202('0xa1')](util[_0xa202('0x2c')](_0xa202('0x154'),_0x1bff47['toUpperCase']()),_0x249909[_0x1bff47]);}}return this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0x155'),JSON['stringify'](_0x249909)));}}return _0x2c34e4;};AGIVertices[_0xa202('0x19')][_0xa202('0x156')]=function(_0xe28e75){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x157'),_0xe28e75[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0xe28e75[_0xa202('0x77')])){return this[_0xa202('0xf')]['noop'](_0xa202('0xe6'));}if(!this['isConfigured'](_0xe28e75[_0xa202('0x58')])){return this[_0xa202('0xf')]['noop'](_0xa202('0xc7'));}this['channel']['noop'](util[_0xa202('0x2c')](_0xa202('0x158'),_0xe28e75[_0xa202('0x58')]));var _0x2b3912=this[_0xa202('0x7f')][_0xa202('0x6c')](this,_0xe28e75);if(_0x2b3912){this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x153'),_0x2b3912));var _0x4c7570=this['channel'][_0xa202('0x101')](_0x2b3912,_0xe28e75['intKey']);try{fs[_0xa202('0x102')](_0x2b3912+'.wav');}catch(_0x4e1940){logger[_0xa202('0x36')](_0x4e1940);}return _0x4c7570;}return this['channel']['error'](_0xe28e75,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xa202('0x159')]=function(_0x3fd8c5){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x15a'),_0x3fd8c5[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x3fd8c5['findBy'])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x3fd8c5,_0xa202('0x15b'));}logger[_0xa202('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xa202('0x3a')],_0x3fd8c5[_0xa202('0x15c')]));var _0x589e7b=this[_0xa202('0x50')][_0xa202('0x6c')](this,_0x3fd8c5['findBy']);if(_0x589e7b){logger['info'](util[_0xa202('0x2c')](_0xa202('0x15d'),this['channel'][_0xa202('0x3a')],_0x3fd8c5[_0xa202('0x15c')]));this[_0xa202('0xf')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa202('0xf')][_0xa202('0x3a')],_0x3fd8c5[_0xa202('0x15c')]));return{'code':0xc8,'result':_0xa202('0x15e')};}else{logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x15f'),this[_0xa202('0xf')]['callerid'],_0x3fd8c5[_0xa202('0x15c')]));this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x15f'),this['channel']['callerid'],_0x3fd8c5['findBy']));return{'code':0xc8,'result':_0xa202('0x160')};}};AGIVertices[_0xa202('0x19')][_0xa202('0x161')]=function(_0x36b40e){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x36b40e['label']));if(!this['isConfigured'](_0x36b40e['findBy'])){return this['channel'][_0xa202('0x36')](_0x36b40e,_0xa202('0x15b'));}logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x162'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x36b40e['findBy']));var _0x31ccf2=this[_0xa202('0x4d')]['sync'](this,_0x36b40e['findBy']);if(_0x31ccf2){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa202('0xf')][_0xa202('0x3a')],_0x36b40e[_0xa202('0x15c')]));this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa202('0xf')][_0xa202('0x3a')],_0x36b40e['findBy']));return{'code':0xc8,'result':_0xa202('0x15e')};}else{logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x15f'),this['channel'][_0xa202('0x3a')],_0x36b40e[_0xa202('0x15c')]));this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x15f'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x36b40e['findBy']));return{'code':0xc8,'result':_0xa202('0x160')};}};AGIVertices['prototype'][_0xa202('0x163')]=function(_0x5adb5d){logger['info'](util[_0xa202('0x2c')](_0xa202('0x164'),_0x5adb5d[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x5adb5d[_0xa202('0x165')])){return this[_0xa202('0xf')]['error'](_0x5adb5d,_0xa202('0x166'));}this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x167'),_0x5adb5d['operation']));var _0x31ae70=eval(_0x5adb5d[_0xa202('0x165')]);if(!this[_0xa202('0x83')](_0x5adb5d[_0xa202('0xd7')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0xd8'));}var _0x2d1c84=this[_0xa202('0x11')]['sync'](this,_0x5adb5d['variable_id']);if(!_0x2d1c84){return this['channel'][_0xa202('0x36')](_0x5adb5d,_0xa202('0xd9'));}if(_[_0xa202('0x96')](_0x31ae70)){var _0x3355f7=this;_0x31ae70[_0xa202('0xda')](function(_0x19bc61,_0x4d46e2){_0x3355f7[_0xa202('0xf')][_0xa202('0xa1')](util[_0xa202('0x2c')](_0xa202('0x168'),_0x2d1c84,_0x4d46e2),_0x19bc61);});return this[_0xa202('0xf')][_0xa202('0xa6')](util['format']('variable\x20%s[key]\x20set',_0x2d1c84));}else{return this[_0xa202('0xf')][_0xa202('0xa1')](_0x2d1c84,_0x31ae70);}};AGIVertices[_0xa202('0x19')][_0xa202('0xc')]=function(_0xbc5fa3){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x169'),_0xbc5fa3['label']));if(_0xbc5fa3[_0xa202('0x10f')]===0x0){return this[_0xa202('0xa2')](_0xbc5fa3);}_0xbc5fa3[_0xa202('0x10f')]-=0x1;if(!this['isConfigured'](_0xbc5fa3['file_id'])){return this[_0xa202('0xf')][_0xa202('0x36')](_0xbc5fa3,_0xa202('0x110'));}var _0x212872=this[_0xa202('0x21')][_0xa202('0x6c')](this,_0xbc5fa3['file_id']);if(!_0x212872){return this[_0xa202('0xf')]['error'](_0xbc5fa3,'no\x20file\x20audio\x20found');}var _0x566eaf=this[_0xa202('0xf')][_0xa202('0x113')](_0x212872,_0xbc5fa3['response'],_0xbc5fa3['digit']);var _0x55d42f=_0x566eaf[_0xa202('0x9f')];if(_0x566eaf['result']===-0x1){this['createSquareDetailsReport'][_0xa202('0x6c')](this,_0xbc5fa3,'-1');return _0x566eaf;}else if(_0x566eaf['extra']===_0xa202('0xb8')){_0x566eaf['result']=_0x566eaf[_0xa202('0x9f')][_0xa202('0x97')]>0x0?_0x566eaf[_0xa202('0x9f')]:'t';}else if(_[_0xa202('0x42')](_0x566eaf['result'])){_0x566eaf[_0xa202('0x9f')]='#';_0x55d42f='#';}if(!this[_0xa202('0x83')](_0xbc5fa3['variable_id'])){this[_0xa202('0xf')]['noop'](_0xa202('0xd8'));}else{var _0x22dc34=this[_0xa202('0x11')][_0xa202('0x6c')](this,_0xbc5fa3[_0xa202('0xd7')]);if(!_0x22dc34){return this[_0xa202('0xf')][_0xa202('0x36')](_0xbc5fa3,_0xa202('0xd9'));}this['channel'][_0xa202('0xa1')](_0x22dc34,_0x55d42f);}this['createSquareDetailsReport']['sync'](this,_0xbc5fa3,_0x55d42f);return _0x566eaf;};AGIVertices[_0xa202('0x19')]['noop']=function(_0x1551a8){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x16a'),_0x1551a8[_0xa202('0xa5')]));return this['channel'][_0xa202('0xa6')](_0x1551a8[_0xa202('0x16b')]||_0x1551a8[_0xa202('0xa5')]);};AGIVertices[_0xa202('0x19')][_0xa202('0x16c')]=function(_0x541cad){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x541cad[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x541cad[_0xa202('0x15c')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x541cad,_0xa202('0x15b'));}logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x162'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x541cad[_0xa202('0x15c')]));var _0x1125b3=this['getPause'][_0xa202('0x6c')](this,_0x541cad[_0xa202('0x16d')]);var _0x24d46d=this[_0xa202('0x4b')]['sync'](this,_0x541cad[_0xa202('0x15c')],_0x1125b3);if(_0x24d46d){logger['info'](util['format'](_0xa202('0x15d'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x541cad[_0xa202('0x15c')]));this['channel'][_0xa202('0xa6')](util['format'](_0xa202('0x15d'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x541cad[_0xa202('0x15c')]));return{'code':0xc8,'result':_0xa202('0x15e')};}else{logger['info'](util[_0xa202('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa202('0xf')][_0xa202('0x3a')],_0x541cad[_0xa202('0x15c')]));this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa202('0xf')][_0xa202('0x3a')],_0x541cad['findBy']));return{'code':0xc8,'result':_0xa202('0x160')};}};AGIVertices[_0xa202('0x19')][_0xa202('0x16e')]=function(_0x38bc2a){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x38bc2a[_0xa202('0xa5')]));if(!this['isConfigured'](_0x38bc2a[_0xa202('0x111')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x38bc2a,_0xa202('0x110'));}var _0x751603=this[_0xa202('0x21')][_0xa202('0x6c')](this,_0x38bc2a[_0xa202('0x111')]);if(!_0x751603){return this[_0xa202('0xf')][_0xa202('0x36')](_0x38bc2a,'no\x20file\x20audio\x20found');}var _0x46c59c=this[_0xa202('0xf')]['exec']('PLAYBACK',[_0x751603,_0x38bc2a[_0xa202('0x16f')]]);if(_0x46c59c[_0xa202('0x9f')]===-0x1){return _0x46c59c;}return this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0xc4'),'PLAYBACK',_0x751603));};AGIVertices[_0xa202('0x19')][_0xa202('0x170')]=function(_0x41d30c){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x41d30c['label']));if(!this[_0xa202('0x83')](_0x41d30c[_0xa202('0x171')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x41d30c,_0xa202('0x172'));}var _0x235fb1='';var _0x5d984f=parseInt(_0x41d30c[_0xa202('0x171')],0xa);if(isNaN(_0x5d984f)){_0x235fb1=_0x41d30c['queue_id'];}else{_0x235fb1=this[_0xa202('0x16')][_0xa202('0x6c')](this,_0x41d30c[_0xa202('0x171')]);if(!_0x235fb1){return this[_0xa202('0xf')][_0xa202('0x36')](_0x41d30c,'no\x20queue\x20found');}}var _0x1013ac='';if(this[_0xa202('0x83')](_0x41d30c[_0xa202('0x111')])){var _0x217344=this[_0xa202('0x21')][_0xa202('0x6c')](this,_0x41d30c[_0xa202('0x111')]);if(_0x217344){_0x1013ac=_0x217344;}}this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x41d30c,_0x235fb1);if(_0x41d30c[_0xa202('0x16f')]['indexOf']('x')<0x0){_0x41d30c[_0xa202('0x16f')]+='x';}if(_0x41d30c[_0xa202('0x16f')][_0xa202('0x173')]('X')<0x0){_0x41d30c[_0xa202('0x16f')]+='X';}this['channel'][_0xa202('0xa1')](_0xa202('0x174'),_0x235fb1?_0x235fb1['toLowerCase']():'');var _0x100211=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0x175'),[_0x235fb1,_0x41d30c[_0xa202('0x16f')],_0x41d30c[_0xa202('0x61')],_0x1013ac,_0x41d30c[_0xa202('0xb8')],_0x41d30c['agi'],_0x41d30c['macro'],_0x41d30c[_0xa202('0x176')],'',_0x41d30c[_0xa202('0x177')]]);if(_0x100211[_0xa202('0x9f')]===-0x1){return _0x100211;}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0xc4'),_0xa202('0x175'),_0x235fb1));};AGIVertices['prototype'][_0xa202('0x178')]=function(_0x25e4f1){logger['info'](util[_0xa202('0x2c')](_0xa202('0x179'),_0x25e4f1[_0xa202('0xa5')]));var _0x310c4d=_0x25e4f1['recordingFormat']||_0xa202('0x12f');var _0x3b5923=util[_0xa202('0x2c')]('%s_%s',this[_0xa202('0xf')][_0xa202('0x3c')],rs[_0xa202('0x131')](0x5));var _0x572ba9=util[_0xa202('0x2c')](_0xa202('0x17a'),FILES_PATH,_0x3b5923,_0x310c4d);var _0x4a898a=util[_0xa202('0x2c')]('%s/recordings/%s',FILES_PATH,_0x3b5923);this['createSquareRecording']['sync'](this,_0x25e4f1,_0x3b5923,_0x572ba9);this[_0xa202('0xf')][_0xa202('0xa1')](_0xa202('0x17b'),_0x3b5923);logger[_0xa202('0x31')](_0xa202('0x17c'),_0x4a898a,_0x310c4d,_0x25e4f1[_0xa202('0x17d')],_0x25e4f1[_0xa202('0xb8')]);return this[_0xa202('0xf')]['recordFile'](_0x4a898a,_0x310c4d,_0x25e4f1[_0xa202('0x17d')],_0x25e4f1[_0xa202('0xb8')],undefined,!![]);};AGIVertices['prototype'][_0xa202('0x17e')]=function(_0x3a6f35){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x3a6f35[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x3a6f35[_0xa202('0x61')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x17f'));}var _0x130d0c=this[_0xa202('0x60')][_0xa202('0x6c')](this,_0x3a6f35);logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Response:',util[_0xa202('0x180')](_0x130d0c,{'showHidden':![],'depth':null})));if(!this[_0xa202('0x83')](_0x3a6f35[_0xa202('0xd7')])){return this[_0xa202('0xf')]['noop'](_0xa202('0x181'));}var _0x163bb4=this[_0xa202('0x11')]['sync'](this,_0x3a6f35[_0xa202('0xd7')]);if(!_0x163bb4){return this[_0xa202('0xf')][_0xa202('0x36')](_0x3a6f35,_0xa202('0xd9'));}this[_0xa202('0xf')]['setVariable'](util['format'](_0xa202('0x182'),_0x163bb4),_0x130d0c[_0xa202('0x183')]?_0x130d0c[_0xa202('0x183')]:_0xa202('0x184'));this[_0xa202('0xf')][_0xa202('0xa1')](util['format']('%s_STATUS_MESSAGE',_0x163bb4),_0x130d0c[_0xa202('0x72')]?_0x130d0c['statusMessage']:'OK');if(_0x130d0c['body']){try{this[_0xa202('0x99')](_0x130d0c[_0xa202('0x68')],_0x163bb4);}catch(_0x3bfc38){logger[_0xa202('0x36')](util[_0xa202('0x2c')](_0xa202('0x185'),_0x163bb4));}}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('variable\x20%s\x20set',_0x163bb4));};AGIVertices[_0xa202('0x19')]['saydigits']=function(_0x43081d){logger[_0xa202('0x31')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x43081d[_0xa202('0xa5')]));return this[_0xa202('0xf')][_0xa202('0x186')](_0x43081d['digits']['replace'](/\s+/g,''),_0x43081d[_0xa202('0x17d')]);};AGIVertices[_0xa202('0x19')][_0xa202('0x187')]=function(_0x2d907e){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2d907e['label']));return this[_0xa202('0xf')][_0xa202('0x188')](_0x2d907e[_0xa202('0x63')][_0xa202('0x54')](/\s+/g,''),_0x2d907e['escape_digits']);};AGIVertices[_0xa202('0x19')][_0xa202('0x189')]=function(_0x2604ff){logger[_0xa202('0x31')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2604ff[_0xa202('0xa5')]));return this[_0xa202('0xf')][_0xa202('0x18a')](_0x2604ff[_0xa202('0x58')],_0x2604ff[_0xa202('0x17d')]);};AGIVertices[_0xa202('0x19')][_0xa202('0x18b')]=function(_0x378611){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x18c'),_0x378611[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x378611[_0xa202('0x18d')])){return this['channel'][_0xa202('0xa6')](_0xa202('0x18e'));}var _0x4dfa73=this[_0xa202('0x25')]['sync'](this,_0x378611[_0xa202('0x18d')]);if(!_0x4dfa73||!_0x4dfa73[_0xa202('0x18f')]){return this[_0xa202('0xf')][_0xa202('0x36')](_0x378611,'no\x20mail\x20account\x20found');}var _0x345947={'from':util[_0xa202('0x2c')]('\x22%s\x22\x20<%s>',_0x4dfa73[_0xa202('0x14')],_0x4dfa73[_0xa202('0x190')]||_0x4dfa73['Smtp'][_0xa202('0x191')]),'to':_0x378611['to']||'','cc':_0x378611['cc']||'','bcc':_0x378611[_0xa202('0x192')]||'','subject':_0x378611[_0xa202('0x193')],'html':_0x378611['text'],'text':_0x378611[_0xa202('0x58')]};var _0x34f15f={'tls':{'rejectUnauthorized':![]}};if(_0x4dfa73[_0xa202('0x18f')][_0xa202('0x194')]){_0x34f15f['service']=_0x4dfa73['Smtp'][_0xa202('0x194')];}else{_0x34f15f['host']=_0x4dfa73[_0xa202('0x18f')][_0xa202('0x195')];_0x34f15f['port']=_0x4dfa73[_0xa202('0x18f')]['port'];_0x34f15f[_0xa202('0x196')]=_0x4dfa73['Smtp'][_0xa202('0x196')];}if(_0x4dfa73['Smtp'][_0xa202('0x197')]){_0x34f15f['auth']={'user':_0x4dfa73[_0xa202('0x18f')]['user'],'pass':_0x4dfa73['Smtp'][_0xa202('0x198')]};}if(this[_0xa202('0x83')](_0x378611['template_id'])){}logger[_0xa202('0xdd')](_0xa202('0x199'),JSON[_0xa202('0x70')](_0x345947));this[_0xa202('0xa3')]['sync'](this,_0x378611,_0x378611[_0xa202('0x18d')]);this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x19a'),_0x4dfa73['name']));this['sendMailMessage'][_0xa202('0x6c')](this,_0x34f15f,_0x345947);return this[_0xa202('0xf')][_0xa202('0xa6')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xa202('0x19b')]=function(_0x408023){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x19c'),_0x408023[_0xa202('0xa5')]));return this[_0xa202('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa202('0x19')][_0xa202('0x19d')]=function(_0x43d466){logger['info'](util[_0xa202('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x43d466[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x43d466[_0xa202('0x19e')])){return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x19f'));}var _0x5217ef=this['getSmsAccount'][_0xa202('0x6c')](this,_0x43d466[_0xa202('0x19e')]);if(!_0x5217ef){return this[_0xa202('0xf')][_0xa202('0x36')](_0x43d466,_0xa202('0x1a0'));}var _0x3fabb0={'body':_0x43d466['sms_text'],'phone':_0x43d466['to']||'','SmsAccountId':_0x5217ef['id']};logger[_0xa202('0xdd')](_0xa202('0x1a1'),JSON['stringify'](_0x3fabb0));this['createSquareDetailsReport'][_0xa202('0x6c')](this,_0x43d466,_0x43d466[_0xa202('0x19e')]);this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x1a2'),_0x5217ef[_0xa202('0x14')]));this[_0xa202('0x38')][_0xa202('0x6c')](this,_0x3fabb0);return this[_0xa202('0xf')][_0xa202('0xa6')](_0xa202('0x1a3'));};AGIVertices[_0xa202('0x19')]['set']=function(_0x2ac6b5){logger[_0xa202('0x31')](util['format'](_0xa202('0x1a4'),_0x2ac6b5[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x2ac6b5[_0xa202('0xd7')])){return this['channel']['error'](_0x2ac6b5,_0xa202('0x1a5'));}var _0x47f6b3=this[_0xa202('0x11')][_0xa202('0x6c')](this,_0x2ac6b5[_0xa202('0xd7')]);if(!_0x47f6b3){return this[_0xa202('0xf')][_0xa202('0x36')](_0x2ac6b5,_0xa202('0xd9'));}return this[_0xa202('0xf')][_0xa202('0xa1')](_0x47f6b3,_0x2ac6b5['variable_value']);};AGIVertices[_0xa202('0x19')]['start']=function(_0x11f79e){logger[_0xa202('0x31')](util['format'](_0xa202('0x1a6'),_0x11f79e['label']));this['channel'][_0xa202('0xa6')]('START\x20CALLY\x20SQUARE');if(_0x11f79e['answer']===_0xa202('0x1a7')){this['channel'][_0xa202('0xa6')](_0xa202('0x1a8'));return this[_0xa202('0xf')][_0xa202('0xba')]();}return this[_0xa202('0xf')][_0xa202('0xa6')]('Skipped\x20Answer');};AGIVertices[_0xa202('0x19')]['subproject']=function(_0x159f72){logger['info'](util[_0xa202('0x2c')](_0xa202('0x1a9'),_0x159f72['label']));if(!this[_0xa202('0x83')](_0x159f72[_0xa202('0x1aa')])){return this['channel'][_0xa202('0x36')](_0x159f72,_0xa202('0x1ab'));}var _0x49c4ee=this[_0xa202('0x1a')][_0xa202('0x6c')](this,_0x159f72[_0xa202('0x1aa')]);if(!this[_0xa202('0x83')](_0x49c4ee)){return this['channel']['error'](_0x159f72,util[_0xa202('0x2c')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x159f72['project_id']));}if(_0x49c4ee===this[_0xa202('0xf')][_0xa202('0x39')]){return this[_0xa202('0xf')][_0xa202('0x36')](_0x159f72,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x159f72,_0x49c4ee);var _0x505ef5=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0x1ac'),util[_0xa202('0x2c')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xa202('0xb3')]['host']||'127.0.0.1',_0x49c4ee,this[_0xa202('0xf')]['arg_1']));if(_0x505ef5[_0xa202('0x9f')]===-0x1){return _0x505ef5;}return this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')]('Executed\x20command\x20%s\x20%s','AGI',_0x49c4ee));};AGIVertices['prototype'][_0xa202('0x1ad')]=function(_0x595e4c){logger['info'](util[_0xa202('0x2c')](_0xa202('0x1ae'),_0x595e4c[_0xa202('0xa5')]));var _0x4b2be8=this[_0xa202('0x51')]['sync'](this,_0x595e4c['command']);this[_0xa202('0xa3')][_0xa202('0x6c')](this,_0x595e4c,_0x595e4c[_0xa202('0xb4')]);if(this[_0xa202('0x83')](_0x595e4c[_0xa202('0xd7')])){var _0x3a0268=this[_0xa202('0x11')][_0xa202('0x6c')](this,_0x595e4c[_0xa202('0xd7')]);if(_0x3a0268){this[_0xa202('0xf')][_0xa202('0xa1')](_0x3a0268,_0x4b2be8);return this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0x1af'),_0x595e4c[_0xa202('0xb4')],_0x3a0268));}}return this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x595e4c[_0xa202('0xb4')]));};AGIVertices[_0xa202('0x19')][_0xa202('0x1b0')]=function(_0x51b2f9){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x51b2f9[_0xa202('0xa5')]));_0x51b2f9['text']=_0x51b2f9[_0xa202('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa202('0x83')](_0x51b2f9[_0xa202('0x56')])){return this[_0xa202('0xf')][_0xa202('0xa6')]('no\x20apiKey\x20configured');}if(!this[_0xa202('0x83')](_0x51b2f9[_0xa202('0x58')])){return this[_0xa202('0xf')][_0xa202('0xa6')]('no\x20text\x20configured');}this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')](_0xa202('0x1b1'),_0x51b2f9['text']));var _0xac41e4=this[_0xa202('0x55')]['sync'](this,_0x51b2f9);if(_0xac41e4){this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')](_0xa202('0x1b2'),_0xac41e4));var _0x1dc16b=this[_0xa202('0xf')]['streamFile'](_0xac41e4);try{fs[_0xa202('0x102')](_0xac41e4+'.wav');}catch(_0x360495){logger[_0xa202('0x36')](_0x360495);}return _0x1dc16b;}return this['channel'][_0xa202('0x36')](_0x51b2f9,_0xa202('0x1b3'));};AGIVertices['prototype'][_0xa202('0x1b4')]=function(_0x37cff4){logger['info'](util['format'](_0xa202('0x1b5'),_0x37cff4[_0xa202('0xa5')]));_0x37cff4[_0xa202('0x58')]=_0x37cff4[_0xa202('0x58')][_0xa202('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa202('0x83')](_0x37cff4[_0xa202('0x58')])){return this[_0xa202('0xf')]['noop']('no\x20text\x20configured');}this[_0xa202('0xf')][_0xa202('0xa6')](util[_0xa202('0x2c')]('Trying\x20Google\x20TTS\x20%s',_0x37cff4[_0xa202('0x58')]));var _0x1f6461=this[_0xa202('0x5e')]['sync'](this,_0x37cff4);if(_0x1f6461){this[_0xa202('0xf')]['noop'](util[_0xa202('0x2c')](_0xa202('0x1b6'),_0x1f6461));var _0x20c3c9=this['channel']['streamFile'](_0x1f6461);try{fs[_0xa202('0x102')](_0x1f6461+_0xa202('0x103'));}catch(_0x8b9a7e){logger[_0xa202('0x36')](_0x8b9a7e);}return _0x20c3c9;}return this[_0xa202('0xf')][_0xa202('0x36')](_0x37cff4,_0xa202('0x1b7'));};AGIVertices[_0xa202('0x19')]['unpause']=function(_0x3a57a6){logger[_0xa202('0x31')](util[_0xa202('0x2c')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3a57a6[_0xa202('0xa5')]));if(!this[_0xa202('0x83')](_0x3a57a6[_0xa202('0x15c')])){return this['channel'][_0xa202('0x36')](_0x3a57a6,_0xa202('0x15b'));}logger['info'](util[_0xa202('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xa202('0x3a')],_0x3a57a6[_0xa202('0x15c')]));var _0x1df897=this[_0xa202('0x1b8')][_0xa202('0x6c')](this,_0x3a57a6[_0xa202('0x15c')]);if(_0x1df897){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x15d'),this['channel'][_0xa202('0x3a')],_0x3a57a6[_0xa202('0x15c')]));this['channel']['noop'](util[_0xa202('0x2c')](_0xa202('0x15d'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x3a57a6[_0xa202('0x15c')]));return{'code':0xc8,'result':_0xa202('0x15e')};}else{logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x15f'),this[_0xa202('0xf')][_0xa202('0x3a')],_0x3a57a6[_0xa202('0x15c')]));this[_0xa202('0xf')][_0xa202('0xa6')](util['format'](_0xa202('0x15f'),this['channel']['callerid'],_0x3a57a6[_0xa202('0x15c')]));return{'code':0xc8,'result':_0xa202('0x160')};}};AGIVertices[_0xa202('0x19')][_0xa202('0x1b9')]=function(_0x16e0ec){logger[_0xa202('0x31')](util[_0xa202('0x2c')](_0xa202('0x1ba'),_0x16e0ec[_0xa202('0xa5')]));var _0x58603a=this[_0xa202('0xf')][_0xa202('0x52')](_0xa202('0x1bb'),[_0x16e0ec[_0xa202('0x1bc')],_0x16e0ec[_0xa202('0x75')]]);if(_0x58603a[_0xa202('0x9f')]===-0x1){return _0x58603a;}return this['channel'][_0xa202('0xa6')](util[_0xa202('0x2c')]('Executed\x20command\x20%s\x20%s',_0xa202('0x1bb'),_0x16e0ec[_0xa202('0x1bc')]));};AGIVertices['prototype'][_0xa202('0x1bd')]=function(_0x55e787){logger['info'](util[_0xa202('0x2c')](_0xa202('0x1be'),_0x55e787['label']));if(!this[_0xa202('0x83')](_0x55e787[_0xa202('0xd7')])){return this[_0xa202('0xf')][_0xa202('0x36')](_0x55e787,'no\x20variable\x20selected');}var _0x22f418=this['getVariable'][_0xa202('0x6c')](this,_0x55e787['variable_id']);if(!_0x22f418){return this[_0xa202('0xf')]['error'](_0x55e787,_0xa202('0xd9'));}var _0xd68ec3=this[_0xa202('0xf')][_0xa202('0x11')](_0x22f418);return{'code':0xc8,'result':_0xd68ec3[_0xa202('0x9d')]?_0xd68ec3[_0xa202('0x9d')]:'-'};};String[_0xa202('0x19')][_0xa202('0x9c')]=function(_0x1256c0,_0x544909){return this['split'](_0x1256c0)['join'](_0x544909);};module[_0xa202('0x1bf')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c25e856..666edf8 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8298=['transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','custom:agentConnectPreview','milliseconds','diff','prototype','startAcw','queue','mandatoryDispositionPause','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','secondtransfereruniqueid','isNil'];(function(_0x613ee8,_0x4011e3){var _0xc95a8f=function(_0xb0f10d){while(--_0xb0f10d){_0x613ee8['push'](_0x613ee8['shift']());}};_0xc95a8f(++_0x4011e3);}(_0x8298,0xff));var _0x8829=function(_0x328cdc,_0xe9775){_0x328cdc=_0x328cdc-0x0;var _0x17eea7=_0x8298[_0x328cdc];return _0x17eea7;};'use strict';var util=require(_0x8829('0x0'));var _=require(_0x8829('0x1'));var moment=require('moment');var ami=require(_0x8829('0x2'));var logger=require('../../../config/logger')(_0x8829('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x8829('0x4'));function Acw(_0xdc4bd){this[_0x8829('0x5')]=_0xdc4bd['voiceQueues'];this[_0x8829('0x6')]=_0xdc4bd[_0x8829('0x6')];this[_0x8829('0x7')]=_0xdc4bd[_0x8829('0x7')];this[_0x8829('0x8')]={};ami['on'](_0x8829('0x9'),this['syncAgentConnect'][_0x8829('0xa')](this));ami['on'](_0x8829('0xb'),this[_0x8829('0xc')]['bind'](this));ami['on'](_0x8829('0xd'),this[_0x8829('0xe')][_0x8829('0xa')](this));ami['on'](_0x8829('0xf'),this['syncAgentRingNoAnswer'][_0x8829('0xa')](this));ami['on'](_0x8829('0x10'),this['syncAttendedTransfer'][_0x8829('0xa')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x8829('0xa')](this));ami['on'](_0x8829('0x11'),this['syncAgentConnectPreview'][_0x8829('0xa')](this));}function getDiff(_0x4d1854){var _0x26f85a=moment()[_0x8829('0x12')](0x0);var _0x26794b=moment(_0x4d1854)[_0x8829('0x12')](0x0);return _0x26f85a[_0x8829('0x13')](_0x26794b,'seconds');}Acw[_0x8829('0x14')][_0x8829('0x15')]=function(_0x36162e){try{var _0x40cf3f=this;var _0x544463=this[_0x8829('0x8')][_0x36162e]['interface'];var _0x4ed494=this[_0x8829('0x8')][_0x36162e][_0x8829('0x16')];var _0xb344c7=this[_0x8829('0x5')][_0x4ed494];var _0x17bb33=![];var _0x32d3ad='ACW';if(_0xb344c7['mandatoryDisposition']){if(_0xb344c7['mandatoryDispositionPause']['name']){_0x17bb33=!![];_0x32d3ad=_0xb344c7[_0x8829('0x17')]['name'];}}ami['Action']({'action':_0x8829('0x18'),'interface':_0x544463,'paused':!![],'reason':_0x32d3ad})[_0x8829('0x19')](function(_0x3ccd0d){if(_0x40cf3f[_0x8829('0x6')][_0x544463]){return RpcUser[_0x8829('0x1a')](_0x40cf3f[_0x8829('0x6')][_0x544463]['id'])[_0x8829('0x19')](function(_0x590074){if(_0x590074&&!_0x590074[_0x8829('0x1b')]){logger[_0x8829('0x1c')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x36162e,_0x544463,_0x4ed494);var _0x2c03ce=_0x40cf3f[_0x8829('0x8')][_0x36162e][_0x8829('0x1d')]&&_0x40cf3f['channels'][_0x36162e][_0x8829('0x1e')]?_0x40cf3f['channels'][_0x36162e]['destlinkedid']:_0x36162e;return RpcUser['savePause'](_0x40cf3f[_0x8829('0x6')][_0x544463],_0x32d3ad,_0x2c03ce)[_0x8829('0x19')](function(_0x1c667e){if(!_0x17bb33){_0x40cf3f[_0x8829('0x7')][_0x544463]={};logger[_0x8829('0x1c')](_0x8829('0x1f'),_0x36162e,_0x40cf3f['voiceQueues'][_0x4ed494][_0x8829('0x20')],_0x544463,_0x4ed494);_0x40cf3f[_0x8829('0x7')][_0x544463][_0x8829('0x21')]=setTimeout(_0x40cf3f['stopAcw']['bind'](_0x40cf3f,_0x544463),_0x40cf3f[_0x8829('0x5')][_0x4ed494][_0x8829('0x20')]*0x3e8);_0x40cf3f[_0x8829('0x7')][_0x544463]['lastPauseAt']=moment()[_0x8829('0x22')](_0x8829('0x23'));_0x40cf3f['timers'][_0x544463][_0x8829('0x24')]=_0x36162e;_0x40cf3f['timers'][_0x544463][_0x8829('0x16')]=_0x4ed494;_0x40cf3f[_0x8829('0x7')][_0x544463]['updateAcw']=function(){var _0x826095=getDiff(_0x40cf3f[_0x8829('0x7')][_0x544463]['lastPauseAt']);clearTimeout(_0x40cf3f[_0x8829('0x7')][_0x544463][_0x8829('0x21')]);_0x40cf3f['timers'][_0x544463][_0x8829('0x21')]=![];RpcVoiceAgentReport[_0x8829('0x25')]({'acwtime':_0x826095},_0x40cf3f[_0x8829('0x7')][_0x544463][_0x8829('0x24')],_0x544463)[_0x8829('0x19')](function(_0x41fc0a){logger[_0x8829('0x1c')](_0x8829('0x26'),_0x36162e,_0x826095,_0x41fc0a);})[_0x8829('0x27')](function(_0x10af3b){logger['error'](_0x8829('0x28'),_0x36162e,_0x10af3b);});delete _0x40cf3f['timers'][_0x544463];};}});}else{logger['info'](_0x8829('0x29'),_0x36162e,_0x544463,_0x4ed494);}});}})[_0x8829('0x27')](function(_0x425141){logger[_0x8829('0x2a')](_0x8829('0x1f'),_0x36162e,_0x40cf3f[_0x8829('0x5')][_0x4ed494][_0x8829('0x20')],_0x544463,_0x4ed494);})[_0x8829('0x2b')](function(){delete _0x40cf3f[_0x8829('0x8')][_0x36162e];});}catch(_0x2c8494){logger[_0x8829('0x2a')](_0x8829('0x2c'),_0x2c8494[_0x8829('0x2d')]);}};Acw['prototype']['stopAcw']=function(_0x3b046a){try{var _0x51f6f3=this;if(_0x51f6f3[_0x8829('0x7')][_0x3b046a]){_0x51f6f3[_0x8829('0x7')][_0x3b046a][_0x8829('0x21')]=![];var _0x1f0832=_0x51f6f3[_0x8829('0x7')][_0x3b046a]['uniqueid'];var _0x3f5cfb=_0x51f6f3[_0x8829('0x7')][_0x3b046a][_0x8829('0x16')];var _0xba3662=_0x51f6f3[_0x8829('0x5')][_0x3f5cfb]['acwTimeout'];logger['info'](_0x8829('0x2e'),_0x1f0832,_0x3b046a);RpcUser['saveUnpause'](this[_0x8829('0x6')][_0x3b046a]);RpcVoiceAgentReport[_0x8829('0x25')]({'acwtime':_0xba3662,'agentacw':!![]},_0x1f0832,_0x3b046a)[_0x8829('0x19')](function(_0x1e9bbf){logger['info'](_0x8829('0x26'),_0x1f0832,_0xba3662,_0x1e9bbf);})['catch'](function(_0x33f2b6){logger[_0x8829('0x2a')](_0x8829('0x28'),_0x1f0832,_0x33f2b6);});}else{logger[_0x8829('0x2a')](_0x8829('0x2f'),_0x3b046a);if(_0x51f6f3[_0x8829('0x7')]){logger[_0x8829('0x1c')]('[ACW][TIMERS]',JSON[_0x8829('0x30')](_0x51f6f3[_0x8829('0x7')]));}}}catch(_0x43cc2e){logger['error'](_0x8829('0x31'),_0x43cc2e[_0x8829('0x2d')]);}};Acw['prototype'][_0x8829('0x32')]=function(_0xf1d0b5){try{if(this['voiceQueues'][_0xf1d0b5['queue']]&&(this[_0x8829('0x5')][_0xf1d0b5[_0x8829('0x16')]]['acw']||this[_0x8829('0x5')][_0xf1d0b5['queue']][_0x8829('0x33')])){if(this[_0x8829('0x6')][_0xf1d0b5[_0x8829('0x34')]]){this[_0x8829('0x8')][_0xf1d0b5[_0x8829('0x24')]]={'queue':_0xf1d0b5[_0x8829('0x16')],'interface':_0xf1d0b5[_0x8829('0x34')],'destlinkedid':_0xf1d0b5[_0x8829('0x1e')]};}}}catch(_0x4a198e){logger[_0x8829('0x2a')](_0x8829('0x35'),_0x4a198e[_0x8829('0x2d')]);}};Acw[_0x8829('0x14')][_0x8829('0x36')]=function(_0x24a811){try{if(this['voiceQueues'][_0x24a811[_0x8829('0x16')]]&&(this[_0x8829('0x5')][_0x24a811['queue']][_0x8829('0x3')]||this[_0x8829('0x5')][_0x24a811[_0x8829('0x16')]][_0x8829('0x33')])){if(this[_0x8829('0x6')][_0x24a811[_0x8829('0x34')]]){this[_0x8829('0x8')][_0x24a811['uniqueid']]={'queue':_0x24a811[_0x8829('0x16')],'interface':_0x24a811[_0x8829('0x34')]};}}}catch(_0x3c1219){logger[_0x8829('0x2a')](_0x8829('0x37'),_0x3c1219[_0x8829('0x2d')]);}};Acw['prototype']['syncHangupRequest']=function(_0x4f432d){try{if(this[_0x8829('0x8')][_0x4f432d['uniqueid']]&&_[_0x8829('0x38')](this[_0x8829('0x8')][_0x4f432d['uniqueid']]['attended'])){logger[_0x8829('0x1c')](_0x8829('0x39'),_0x4f432d[_0x8829('0x24')]);this[_0x8829('0x15')](_0x4f432d[_0x8829('0x24')]);}else if(this[_0x8829('0x8')][_0x4f432d[_0x8829('0x3a')]]&&_[_0x8829('0x38')](this['channels'][_0x4f432d['linkedid']][_0x8829('0x1d')])){logger[_0x8829('0x1c')](_0x8829('0x3b'),_0x4f432d[_0x8829('0x3a')]);this[_0x8829('0x15')](_0x4f432d[_0x8829('0x3a')]);}}catch(_0x992796){logger[_0x8829('0x2a')](_0x8829('0x3c'),_0x992796[_0x8829('0x2d')]);}};Acw[_0x8829('0x14')][_0x8829('0xe')]=function(_0x456fee){try{if(this['channels'][_0x456fee['uniqueid']]&&this[_0x8829('0x8')][_0x456fee[_0x8829('0x24')]][_0x8829('0x1d')]){logger[_0x8829('0x1c')](_0x8829('0x3d'),_0x456fee[_0x8829('0x24')]);this[_0x8829('0x15')](_0x456fee[_0x8829('0x24')]);}else if(this['channels'][_0x456fee[_0x8829('0x3a')]]&&this[_0x8829('0x8')][_0x456fee[_0x8829('0x3a')]][_0x8829('0x1d')]){logger[_0x8829('0x1c')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x456fee[_0x8829('0x3a')]);this[_0x8829('0x15')](_0x456fee['linkedid']);}}catch(_0x2c62f2){logger[_0x8829('0x2a')](_0x8829('0x3e'),_0x2c62f2[_0x8829('0x2d')]);}};Acw[_0x8829('0x14')]['syncAttendedTransfer']=function(_0x47ae50){try{if(!_['isNil'](this[_0x8829('0x8')][_0x47ae50['transfereeuniqueid']])){this[_0x8829('0x15')](_0x47ae50['transfereeuniqueid']);if(this[_0x8829('0x8')][_0x47ae50['secondtransfereruniqueid']]){this['channels'][_0x47ae50[_0x8829('0x3f')]][_0x8829('0x1d')]=!![];this[_0x8829('0x8')][_0x47ae50['transfertargetuniqueid']]=this[_0x8829('0x8')][_0x47ae50[_0x8829('0x3f')]];delete this['channels'][_0x47ae50[_0x8829('0x3f')]];}}else if(!_[_0x8829('0x40')](this['channels'][_0x47ae50[_0x8829('0x41')]])){this['startAcw'](_0x47ae50['transfertargetuniqueid']);if(this[_0x8829('0x8')][_0x47ae50[_0x8829('0x42')]]){this['channels'][_0x47ae50['origtransfereruniqueid']][_0x8829('0x1d')]=!![];this[_0x8829('0x8')][_0x47ae50[_0x8829('0x43')]]=this[_0x8829('0x8')][_0x47ae50['origtransfereruniqueid']];delete this[_0x8829('0x8')][_0x47ae50[_0x8829('0x42')]];}}}catch(_0x44272b){logger[_0x8829('0x2a')](_0x8829('0x44'),_0x44272b[_0x8829('0x2d')]);}};Acw['prototype'][_0x8829('0x45')]=function(_0x313bc6){try{if(this[_0x8829('0x8')][_0x313bc6[_0x8829('0x46')]]){logger['info'](_0x8829('0x47'),JSON['stringify'](_0x313bc6[_0x8829('0x46')]));this['startAcw'](_0x313bc6[_0x8829('0x46')]);}else if(this[_0x8829('0x8')][_0x313bc6[_0x8829('0x48')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x8829('0x30')](_0x313bc6['transfererlinkedid']));this[_0x8829('0x15')](_0x313bc6[_0x8829('0x48')]);}}catch(_0x2b329e){logger[_0x8829('0x2a')](_0x8829('0x49'),_0x2b329e[_0x8829('0x2d')]);}};Acw[_0x8829('0x14')][_0x8829('0x4a')]=function(_0x1514d8){try{if(this[_0x8829('0x5')][_0x1514d8[_0x8829('0x16')]]&&this['voiceQueues'][_0x1514d8['queue']][_0x8829('0x4b')]==='all'){if(this['agents'][_0x1514d8[_0x8829('0x34')]]){logger[_0x8829('0x1c')](_0x8829('0x4c'),_0x1514d8[_0x8829('0x24')],_0x1514d8[_0x8829('0x34')],_0x1514d8[_0x8829('0x16')]);return RpcUser[_0x8829('0x4d')](this[_0x8829('0x6')][_0x1514d8[_0x8829('0x34')]],_0x8829('0x4e'),_0x1514d8[_0x8829('0x24')]);}}}catch(_0x3b432a){logger[_0x8829('0x2a')](_0x8829('0x4f'),_0x3b432a[_0x8829('0x2d')]);}};module['exports']=Acw; \ No newline at end of file +var _0x5e2e=['mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','prototype','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','moment','../../../config/logger','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','interface','queue','ACW','mandatoryDisposition'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e2e,0xdb));var _0xe5e2=function(_0x46f5ec,_0x335dd1){_0x46f5ec=_0x46f5ec-0x0;var _0x4efc84=_0x5e2e[_0x46f5ec];return _0x4efc84;};'use strict';var util=require(_0xe5e2('0x0'));var _=require(_0xe5e2('0x1'));var moment=require(_0xe5e2('0x2'));var ami=require('../ami');var logger=require(_0xe5e2('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x53d1b0){this[_0xe5e2('0x4')]=_0x53d1b0['voiceQueues'];this['agents']=_0x53d1b0[_0xe5e2('0x5')];this[_0xe5e2('0x6')]=_0x53d1b0['timers'];this[_0xe5e2('0x7')]={};ami['on'](_0xe5e2('0x8'),this[_0xe5e2('0x9')][_0xe5e2('0xa')](this));ami['on'](_0xe5e2('0xb'),this[_0xe5e2('0xc')]['bind'](this));ami['on'](_0xe5e2('0xd'),this[_0xe5e2('0xe')][_0xe5e2('0xa')](this));ami['on'](_0xe5e2('0xf'),this[_0xe5e2('0x10')][_0xe5e2('0xa')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xe5e2('0x11'),this[_0xe5e2('0x12')][_0xe5e2('0xa')](this));ami['on'](_0xe5e2('0x13'),this[_0xe5e2('0x14')]['bind'](this));}function getDiff(_0x5ee045){var _0x200c57=moment()[_0xe5e2('0x15')](0x0);var _0x4bf2aa=moment(_0x5ee045)[_0xe5e2('0x15')](0x0);return _0x200c57[_0xe5e2('0x16')](_0x4bf2aa,'seconds');}Acw['prototype']['startAcw']=function(_0x21ff52){try{var _0x35b5e7=this;var _0x259516=this[_0xe5e2('0x7')][_0x21ff52][_0xe5e2('0x17')];var _0x493257=this[_0xe5e2('0x7')][_0x21ff52][_0xe5e2('0x18')];var _0x5828dd=this['voiceQueues'][_0x493257];var _0xc58e17=![];var _0x2ffe98=_0xe5e2('0x19');if(_0x5828dd[_0xe5e2('0x1a')]){if(_0x5828dd[_0xe5e2('0x1b')][_0xe5e2('0x1c')]){_0xc58e17=!![];_0x2ffe98=_0x5828dd[_0xe5e2('0x1b')][_0xe5e2('0x1c')];}}ami['Action']({'action':_0xe5e2('0x1d'),'interface':_0x259516,'paused':!![],'reason':_0x2ffe98})[_0xe5e2('0x1e')](function(_0x4d386d){if(_0x35b5e7[_0xe5e2('0x5')][_0x259516]){return RpcUser[_0xe5e2('0x1f')](_0x35b5e7['agents'][_0x259516]['id'])['then'](function(_0x225f13){if(_0x225f13&&!_0x225f13[_0xe5e2('0x20')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x21ff52,_0x259516,_0x493257);var _0xf58675=_0x35b5e7[_0xe5e2('0x7')][_0x21ff52][_0xe5e2('0x21')]&&_0x35b5e7[_0xe5e2('0x7')][_0x21ff52][_0xe5e2('0x22')]?_0x35b5e7[_0xe5e2('0x7')][_0x21ff52][_0xe5e2('0x22')]:_0x21ff52;return RpcUser[_0xe5e2('0x23')](_0x35b5e7[_0xe5e2('0x5')][_0x259516],_0x2ffe98,_0xf58675)[_0xe5e2('0x1e')](function(_0x3736bc){if(!_0xc58e17){_0x35b5e7['timers'][_0x259516]={};logger[_0xe5e2('0x24')](_0xe5e2('0x25'),_0x21ff52,_0x35b5e7['voiceQueues'][_0x493257][_0xe5e2('0x26')],_0x259516,_0x493257);_0x35b5e7['timers'][_0x259516][_0xe5e2('0x27')]=setTimeout(_0x35b5e7[_0xe5e2('0x28')][_0xe5e2('0xa')](_0x35b5e7,_0x259516),_0x35b5e7['voiceQueues'][_0x493257][_0xe5e2('0x26')]*0x3e8);_0x35b5e7[_0xe5e2('0x6')][_0x259516]['lastPauseAt']=moment()[_0xe5e2('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0x35b5e7['timers'][_0x259516][_0xe5e2('0x2a')]=_0x21ff52;_0x35b5e7[_0xe5e2('0x6')][_0x259516][_0xe5e2('0x18')]=_0x493257;_0x35b5e7[_0xe5e2('0x6')][_0x259516][_0xe5e2('0x2b')]=function(){var _0x16b400=getDiff(_0x35b5e7[_0xe5e2('0x6')][_0x259516][_0xe5e2('0x2c')]);clearTimeout(_0x35b5e7[_0xe5e2('0x6')][_0x259516][_0xe5e2('0x27')]);_0x35b5e7['timers'][_0x259516]['timer']=![];RpcVoiceAgentReport[_0xe5e2('0x2d')]({'acwtime':_0x16b400},_0x35b5e7[_0xe5e2('0x6')][_0x259516][_0xe5e2('0x2a')],_0x259516)[_0xe5e2('0x1e')](function(_0x47fa28){logger[_0xe5e2('0x24')](_0xe5e2('0x2e'),_0x21ff52,_0x16b400,_0x47fa28);})[_0xe5e2('0x2f')](function(_0x239e0c){logger['error'](_0xe5e2('0x30'),_0x21ff52,_0x239e0c);});delete _0x35b5e7[_0xe5e2('0x6')][_0x259516];};}});}else{logger[_0xe5e2('0x24')](_0xe5e2('0x31'),_0x21ff52,_0x259516,_0x493257);}});}})[_0xe5e2('0x2f')](function(_0x5f1ba4){logger[_0xe5e2('0x32')](_0xe5e2('0x25'),_0x21ff52,_0x35b5e7[_0xe5e2('0x4')][_0x493257][_0xe5e2('0x26')],_0x259516,_0x493257);})[_0xe5e2('0x33')](function(){delete _0x35b5e7['channels'][_0x21ff52];});}catch(_0x70ccae){logger[_0xe5e2('0x32')](_0xe5e2('0x34'),_0x70ccae[_0xe5e2('0x35')]);}};Acw['prototype'][_0xe5e2('0x28')]=function(_0x2401bb){try{var _0x3d2230=this;if(_0x3d2230[_0xe5e2('0x6')][_0x2401bb]){_0x3d2230[_0xe5e2('0x6')][_0x2401bb]['timer']=![];var _0x54c5c9=_0x3d2230[_0xe5e2('0x6')][_0x2401bb][_0xe5e2('0x2a')];var _0x5e4985=_0x3d2230[_0xe5e2('0x6')][_0x2401bb][_0xe5e2('0x18')];var _0x15932b=_0x3d2230[_0xe5e2('0x4')][_0x5e4985]['acwTimeout'];logger[_0xe5e2('0x24')]('[%s][TIMER][STOP][AGENT:%s]',_0x54c5c9,_0x2401bb);RpcUser['saveUnpause'](this[_0xe5e2('0x5')][_0x2401bb]);RpcVoiceAgentReport['update']({'acwtime':_0x15932b,'agentacw':!![]},_0x54c5c9,_0x2401bb)['then'](function(_0x10c76f){logger['info'](_0xe5e2('0x2e'),_0x54c5c9,_0x15932b,_0x10c76f);})['catch'](function(_0x5cef90){logger[_0xe5e2('0x32')](_0xe5e2('0x30'),_0x54c5c9,_0x5cef90);});}else{logger[_0xe5e2('0x32')](_0xe5e2('0x36'),_0x2401bb);if(_0x3d2230['timers']){logger[_0xe5e2('0x24')]('[ACW][TIMERS]',JSON[_0xe5e2('0x37')](_0x3d2230[_0xe5e2('0x6')]));}}}catch(_0xf57657){logger[_0xe5e2('0x32')](_0xe5e2('0x38'),_0xf57657[_0xe5e2('0x35')]);}};Acw[_0xe5e2('0x39')][_0xe5e2('0x9')]=function(_0x3c95ea){try{if(this[_0xe5e2('0x4')][_0x3c95ea['queue']]&&(this[_0xe5e2('0x4')][_0x3c95ea[_0xe5e2('0x18')]]['acw']||this[_0xe5e2('0x4')][_0x3c95ea[_0xe5e2('0x18')]][_0xe5e2('0x1a')])){if(this['agents'][_0x3c95ea[_0xe5e2('0x17')]]){this[_0xe5e2('0x7')][_0x3c95ea[_0xe5e2('0x2a')]]={'queue':_0x3c95ea[_0xe5e2('0x18')],'interface':_0x3c95ea[_0xe5e2('0x17')],'destlinkedid':_0x3c95ea[_0xe5e2('0x22')]};}}}catch(_0x2fffa6){logger[_0xe5e2('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x2fffa6[_0xe5e2('0x35')]);}};Acw[_0xe5e2('0x39')][_0xe5e2('0x14')]=function(_0x2b2f4a){try{if(this[_0xe5e2('0x4')][_0x2b2f4a[_0xe5e2('0x18')]]&&(this[_0xe5e2('0x4')][_0x2b2f4a['queue']][_0xe5e2('0x3a')]||this[_0xe5e2('0x4')][_0x2b2f4a['queue']]['mandatoryDisposition'])){if(this['agents'][_0x2b2f4a['interface']]){this[_0xe5e2('0x7')][_0x2b2f4a[_0xe5e2('0x2a')]]={'queue':_0x2b2f4a[_0xe5e2('0x18')],'interface':_0x2b2f4a[_0xe5e2('0x17')]};}}}catch(_0x33f173){logger[_0xe5e2('0x32')](_0xe5e2('0x3b'),_0x33f173['message']);}};Acw[_0xe5e2('0x39')][_0xe5e2('0xc')]=function(_0x23b339){try{if(this[_0xe5e2('0x7')][_0x23b339[_0xe5e2('0x2a')]]&&_[_0xe5e2('0x3c')](this[_0xe5e2('0x7')][_0x23b339[_0xe5e2('0x2a')]][_0xe5e2('0x21')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x23b339[_0xe5e2('0x2a')]);this[_0xe5e2('0x3d')](_0x23b339['uniqueid']);}else if(this[_0xe5e2('0x7')][_0x23b339[_0xe5e2('0x3e')]]&&_[_0xe5e2('0x3c')](this[_0xe5e2('0x7')][_0x23b339[_0xe5e2('0x3e')]][_0xe5e2('0x21')])){logger['info'](_0xe5e2('0x3f'),_0x23b339[_0xe5e2('0x3e')]);this[_0xe5e2('0x3d')](_0x23b339[_0xe5e2('0x3e')]);}}catch(_0x491300){logger[_0xe5e2('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x491300[_0xe5e2('0x35')]);}};Acw['prototype'][_0xe5e2('0xe')]=function(_0x5cb98a){try{if(this[_0xe5e2('0x7')][_0x5cb98a[_0xe5e2('0x2a')]]&&this[_0xe5e2('0x7')][_0x5cb98a['uniqueid']][_0xe5e2('0x21')]){logger[_0xe5e2('0x24')](_0xe5e2('0x40'),_0x5cb98a['uniqueid']);this[_0xe5e2('0x3d')](_0x5cb98a[_0xe5e2('0x2a')]);}else if(this[_0xe5e2('0x7')][_0x5cb98a[_0xe5e2('0x3e')]]&&this[_0xe5e2('0x7')][_0x5cb98a[_0xe5e2('0x3e')]][_0xe5e2('0x21')]){logger['info'](_0xe5e2('0x41'),_0x5cb98a[_0xe5e2('0x3e')]);this[_0xe5e2('0x3d')](_0x5cb98a['linkedid']);}}catch(_0x318084){logger[_0xe5e2('0x32')](_0xe5e2('0x42'),_0x318084[_0xe5e2('0x35')]);}};Acw[_0xe5e2('0x39')][_0xe5e2('0x43')]=function(_0x2ca4ee){try{if(!_[_0xe5e2('0x44')](this['channels'][_0x2ca4ee[_0xe5e2('0x45')]])){this['startAcw'](_0x2ca4ee['transfereeuniqueid']);if(this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x46')]]){this['channels'][_0x2ca4ee[_0xe5e2('0x46')]][_0xe5e2('0x21')]=!![];this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x47')]]=this[_0xe5e2('0x7')][_0x2ca4ee['secondtransfereruniqueid']];delete this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x46')]];}}else if(!_[_0xe5e2('0x44')](this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x47')]])){this[_0xe5e2('0x3d')](_0x2ca4ee[_0xe5e2('0x47')]);if(this['channels'][_0x2ca4ee['origtransfereruniqueid']]){this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x48')]][_0xe5e2('0x21')]=!![];this['channels'][_0x2ca4ee[_0xe5e2('0x45')]]=this['channels'][_0x2ca4ee['origtransfereruniqueid']];delete this[_0xe5e2('0x7')][_0x2ca4ee[_0xe5e2('0x48')]];}}}catch(_0x362ae2){logger[_0xe5e2('0x32')](_0xe5e2('0x49'),_0x362ae2[_0xe5e2('0x35')]);}};Acw[_0xe5e2('0x39')][_0xe5e2('0x12')]=function(_0x320e85){try{if(this[_0xe5e2('0x7')][_0x320e85[_0xe5e2('0x4a')]]){logger[_0xe5e2('0x24')](_0xe5e2('0x4b'),JSON[_0xe5e2('0x37')](_0x320e85[_0xe5e2('0x4a')]));this[_0xe5e2('0x3d')](_0x320e85[_0xe5e2('0x4a')]);}else if(this[_0xe5e2('0x7')][_0x320e85['transfererlinkedid']]){logger[_0xe5e2('0x24')](_0xe5e2('0x4c'),JSON[_0xe5e2('0x37')](_0x320e85[_0xe5e2('0x4d')]));this['startAcw'](_0x320e85[_0xe5e2('0x4d')]);}}catch(_0x1236a8){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x1236a8[_0xe5e2('0x35')]);}};Acw[_0xe5e2('0x39')][_0xe5e2('0x10')]=function(_0x155809){try{if(this[_0xe5e2('0x4')][_0x155809['queue']]&&this[_0xe5e2('0x4')][_0x155809['queue']]['autopause']===_0xe5e2('0x4e')){if(this[_0xe5e2('0x5')][_0x155809[_0xe5e2('0x17')]]){logger[_0xe5e2('0x24')](_0xe5e2('0x4f'),_0x155809[_0xe5e2('0x2a')],_0x155809[_0xe5e2('0x17')],_0x155809['queue']);return RpcUser[_0xe5e2('0x23')](this[_0xe5e2('0x5')][_0x155809[_0xe5e2('0x17')]],_0xe5e2('0x50'),_0x155809[_0xe5e2('0x2a')]);}}}catch(_0x20f2a9){logger[_0xe5e2('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x20f2a9[_0xe5e2('0x35')]);}};module[_0xe5e2('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3fa2d21..b459876 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x458441,_0x48e84e){var _0x274cee=function(_0x185554){while(--_0x185554){_0x458441['push'](_0x458441['shift']());}};_0x274cee(++_0x48e84e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x466244,_0x4e38b4){var _0xaaa782=function(_0x220a98){while(--_0x220a98){_0x466244['push'](_0x466244['shift']());}};_0xaaa782(++_0x4e38b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3834189..29068be 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x154f26,_0x228c67){var _0x2a1b3f=function(_0x1a93a3){while(--_0x1a93a3){_0x154f26['push'](_0x154f26['shift']());}};_0x2a1b3f(++_0x228c67);}(_0xaa88,0x137));var _0x8aa8=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xaa88[_0x5c4f6b];return _0x104c4e;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0xc57669,_0x44ea37){var _0xe78b5f=function(_0x1da61c){while(--_0x1da61c){_0xc57669['push'](_0xc57669['shift']());}};_0xe78b5f(++_0x44ea37);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 81bc2c5..3c3cbf9 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d92=['callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','number','getQueue','util','lodash','moment','string','isNil','voiceQueue','name','Contact','firstName','lastName','phone','queue','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x49ce1a,_0x84e3ca){var _0x3fa24f=function(_0x231cea){while(--_0x231cea){_0x49ce1a['push'](_0x49ce1a['shift']());}};_0x3fa24f(++_0x84e3ca);}(_0x1d92,0xff));var _0x21d9=function(_0x38c160,_0x1318fa){_0x38c160=_0x38c160-0x0;var _0x780b56=_0x1d92[_0x38c160];return _0x780b56;};'use strict';var util=require(_0x21d9('0x0'));var _=require(_0x21d9('0x1'));var moment=require(_0x21d9('0x2'));function checkNameSurname(_0x11b8da,_0x5cfd67,_0x5a34f0){var _0x40806c='';if(!_['isNil'](_0x5cfd67)&&_0x21d9('0x3')===typeof _0x5cfd67){_0x40806c+=_0x5cfd67;}if(!_[_0x21d9('0x4')](_0x5a34f0)&&_0x21d9('0x3')===typeof _0x5a34f0){_0x40806c+='\x20'+_0x5a34f0;}if(_0x40806c!==''){return _0x40806c;}return _0x11b8da;}function Action(_0x588f51,_0x396c3e,_0x5aaebb){this[_0x21d9('0x5')]=_0x588f51;this['uniqueid']=_0x5aaebb||undefined;this[_0x21d9('0x6')]=checkNameSurname(_0x396c3e['Contact']['phone'],_0x396c3e[_0x21d9('0x7')][_0x21d9('0x8')],_0x396c3e[_0x21d9('0x7')][_0x21d9('0x9')]);this['number']=_0x396c3e[_0x21d9('0x7')][_0x21d9('0xa')];this[_0x21d9('0xb')]=_0x588f51[_0x21d9('0x6')];this['active']=_0x396c3e['active']||![];this[_0x21d9('0xc')]=_0x588f51[_0x21d9('0xc')];this['dialQueueTimeout']=_0x588f51['dialQueueTimeout']||0x3;this['scheduledat']=_0x396c3e[_0x21d9('0xd')];this[_0x21d9('0xe')]=_0x396c3e[_0x21d9('0xe')];this[_0x21d9('0xf')]=_0x396c3e[_0x21d9('0xf')];this[_0x21d9('0x10')]=_0x396c3e[_0x21d9('0x10')];this[_0x21d9('0x11')]=_0x396c3e[_0x21d9('0x11')];this[_0x21d9('0x12')]=_0x396c3e[_0x21d9('0x12')];this[_0x21d9('0x13')]=_0x396c3e[_0x21d9('0x13')];this[_0x21d9('0x14')]=_0x396c3e['countmachineretry'];this['countagentrejectretry']=_0x396c3e[_0x21d9('0x15')];this[_0x21d9('0x16')]=_0x396c3e[_0x21d9('0x16')];this['ListId']=_0x396c3e[_0x21d9('0x17')];this[_0x21d9('0x18')]=_0x396c3e[_0x21d9('0x18')];this[_0x21d9('0x19')]=_0x396c3e[_0x21d9('0x19')];this['CampaignId']=_0x396c3e[_0x21d9('0x1a')];this[_0x21d9('0x1b')]=_0x396c3e['id'];this[_0x21d9('0x1c')]=_0x396c3e['Contact'][_0x21d9('0x8')]||'';this[_0x21d9('0x1d')]=moment()[_0x21d9('0x1e')](_0x21d9('0x1f'));this['callback']=_0x396c3e['callback'];this['callbackuniqueid']=_0x396c3e[_0x21d9('0x20')];this['callbackat']=_0x396c3e[_0x21d9('0x21')];this[_0x21d9('0x22')]=_0x396c3e[_0x21d9('0x22')];this[_0x21d9('0x23')]='';this['originatecalleridname']='';}Action[_0x21d9('0x24')][_0x21d9('0x25')]=function(){return util[_0x21d9('0x1e')]('\x22%s\x22\x20<%s>',this[_0x21d9('0x6')],this[_0x21d9('0x5')][_0x21d9('0x26')]>0x0?this['number']['substring'](this['voiceQueue'][_0x21d9('0x26')]):this[_0x21d9('0x27')]);};Action[_0x21d9('0x24')][_0x21d9('0x28')]=function(){return this[_0x21d9('0xb')];};module['exports']=Action; \ No newline at end of file +var _0xe859=['queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number'];(function(_0x49716c,_0x3ddc67){var _0x167f96=function(_0x11dfa2){while(--_0x11dfa2){_0x49716c['push'](_0x49716c['shift']());}};_0x167f96(++_0x3ddc67);}(_0xe859,0x114));var _0x9e85=function(_0x587cb3,_0x5cddc1){_0x587cb3=_0x587cb3-0x0;var _0x444931=_0xe859[_0x587cb3];return _0x444931;};'use strict';var util=require(_0x9e85('0x0'));var _=require('lodash');var moment=require(_0x9e85('0x1'));function checkNameSurname(_0x402159,_0x4600d5,_0xe06817){var _0x27d2c3='';if(!_[_0x9e85('0x2')](_0x4600d5)&&_0x9e85('0x3')===typeof _0x4600d5){_0x27d2c3+=_0x4600d5;}if(!_[_0x9e85('0x2')](_0xe06817)&&'string'===typeof _0xe06817){_0x27d2c3+='\x20'+_0xe06817;}if(_0x27d2c3!==''){return _0x27d2c3;}return _0x402159;}function Action(_0x4e0ab7,_0x4c04b9,_0x4c80ed){this[_0x9e85('0x4')]=_0x4e0ab7;this[_0x9e85('0x5')]=_0x4c80ed||undefined;this[_0x9e85('0x6')]=checkNameSurname(_0x4c04b9[_0x9e85('0x7')][_0x9e85('0x8')],_0x4c04b9[_0x9e85('0x7')][_0x9e85('0x9')],_0x4c04b9['Contact']['lastName']);this[_0x9e85('0xa')]=_0x4c04b9[_0x9e85('0x7')][_0x9e85('0x8')];this[_0x9e85('0xb')]=_0x4e0ab7['name'];this[_0x9e85('0xc')]=_0x4c04b9[_0x9e85('0xc')]||![];this['type']=_0x4e0ab7[_0x9e85('0xd')];this[_0x9e85('0xe')]=_0x4e0ab7['dialQueueTimeout']||0x3;this['scheduledat']=_0x4c04b9[_0x9e85('0xf')];this[_0x9e85('0x10')]=_0x4c04b9[_0x9e85('0x10')];this['countcongestionretry']=_0x4c04b9[_0x9e85('0x11')];this['countnoanswerretry']=_0x4c04b9[_0x9e85('0x12')];this['countnosuchnumberretry']=_0x4c04b9['countnosuchnumberretry'];this['countdropretry']=_0x4c04b9[_0x9e85('0x13')];this[_0x9e85('0x14')]=_0x4c04b9['countabandonedretry'];this[_0x9e85('0x15')]=_0x4c04b9[_0x9e85('0x15')];this['countagentrejectretry']=_0x4c04b9[_0x9e85('0x16')];this['ContactId']=_0x4c04b9['ContactId'];this['ListId']=_0x4c04b9[_0x9e85('0x17')];this[_0x9e85('0x18')]=_0x4c04b9[_0x9e85('0x18')];this[_0x9e85('0x19')]=_0x4c04b9[_0x9e85('0x19')];this[_0x9e85('0x1a')]=_0x4c04b9[_0x9e85('0x1a')];this[_0x9e85('0x1b')]=_0x4c04b9['id'];this[_0x9e85('0x1c')]=_0x4c04b9[_0x9e85('0x7')][_0x9e85('0x9')]||'';this[_0x9e85('0x1d')]=moment()[_0x9e85('0x1e')](_0x9e85('0x1f'));this[_0x9e85('0x20')]=_0x4c04b9['callback'];this['callbackuniqueid']=_0x4c04b9[_0x9e85('0x21')];this['callbackat']=_0x4c04b9[_0x9e85('0x22')];this[_0x9e85('0x23')]=_0x4c04b9[_0x9e85('0x23')];this[_0x9e85('0x24')]='';this['originatecalleridname']='';}Action[_0x9e85('0x25')][_0x9e85('0x26')]=function(){return util['format'](_0x9e85('0x27'),this[_0x9e85('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x9e85('0xa')]['substring'](this[_0x9e85('0x4')][_0x9e85('0x28')]):this[_0x9e85('0xa')]);};Action[_0x9e85('0x25')]['getQueue']=function(){return this[_0x9e85('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index cfb91e4..f914237 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x2456b3,_0x5826bb){var _0x226b4d=function(_0x10eac4){while(--_0x10eac4){_0x2456b3['push'](_0x2456b3['shift']());}};_0x226b4d(++_0x5826bb);}(_0xad8c,0x7c));var _0xcad8=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xad8c[_0x4409e7];return _0x24c751;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xcad8('0x0'));function getSeconds(_0x49951d,_0x36ab3e){var _0x4fbd70=moment(_0x49951d)[_0xcad8('0x1')](0x0);var _0x3570a0=moment(_0x36ab3e)[_0xcad8('0x1')](0x0);return _0x4fbd70[_0xcad8('0x2')](_0x3570a0,_0xcad8('0x3'));}function AgentComplete(_0x20e675,_0x8c1c9f){this[_0xcad8('0x4')]=0x4;this[_0xcad8('0x5')]=_0xcad8('0x6');this[_0xcad8('0x7')]=_0x20e675[_0xcad8('0x7')];this[_0xcad8('0x8')]=_0x20e675['type'];this[_0xcad8('0x9')]=_0x20e675[_0xcad8('0x8')]===_0xcad8('0xa')?'queue':_0x20e675[_0xcad8('0x8')];this[_0xcad8('0xb')]=_0x20e675[_0xcad8('0xb')];this[_0xcad8('0xc')]=_0x20e675[_0xcad8('0xc')];this[_0xcad8('0xd')]=_0x20e675[_0xcad8('0xd')];this[_0xcad8('0xe')]=_0x20e675['countbusyretry']+_0x20e675[_0xcad8('0xc')]+_0x20e675['countnoanswerretry']+_0x20e675['countnosuchnumberretry']+_0x20e675['countdropretry']+_0x20e675[_0xcad8('0xf')]+_0x20e675[_0xcad8('0x10')]+_0x20e675[_0xcad8('0x11')];this[_0xcad8('0x12')]=_0x20e675['countnosuchnumberretry'];this[_0xcad8('0x13')]=_0x20e675['countdropretry'];this['countabandonedretry']=_0x20e675['countabandonedretry'];this[_0xcad8('0x10')]=_0x20e675[_0xcad8('0x10')];this[_0xcad8('0x11')]=_0x20e675[_0xcad8('0x11')];this[_0xcad8('0x14')]=_0x8c1c9f[_0xcad8('0x14')];this[_0xcad8('0x15')]=_0x20e675['name'];this[_0xcad8('0x16')]=_0x20e675[_0xcad8('0x17')];this[_0xcad8('0x18')]=_0x20e675[_0xcad8('0x18')];this[_0xcad8('0x19')]=_0x20e675[_0xcad8('0x19')];this[_0xcad8('0x1a')]=_0x20e675[_0xcad8('0x1a')];this[_0xcad8('0x1b')]=moment()['format'](_0xcad8('0x1c'));this[_0xcad8('0x1d')]=getSeconds(_0x20e675[_0xcad8('0x19')],_0x20e675['starttime']);this[_0xcad8('0x1e')]=getSeconds(_0x20e675[_0xcad8('0x1a')],_0x20e675['responsetime']);this[_0xcad8('0x1f')]=getSeconds(this[_0xcad8('0x1b')],_0x20e675[_0xcad8('0x1a')]);this[_0xcad8('0x20')]=_0x8c1c9f[_0xcad8('0x20')];this['membername']=_0x8c1c9f['membername'];this[_0xcad8('0x21')]=_0x8c1c9f[_0xcad8('0x21')];this[_0xcad8('0x22')]=_0x20e675[_0xcad8('0x22')];this[_0xcad8('0x23')]=_0x20e675[_0xcad8('0x23')];this[_0xcad8('0x24')]=_0x20e675[_0xcad8('0x24')];this[_0xcad8('0x25')]=_0x20e675[_0xcad8('0x25')];this[_0xcad8('0x26')]=_0x20e675[_0xcad8('0x26')];this[_0xcad8('0x27')]=_0x20e675[_0xcad8('0x27')];this[_0xcad8('0x28')]=_0x20e675[_0xcad8('0x28')];this[_0xcad8('0x29')]=_0x20e675[_0xcad8('0x29')];this[_0xcad8('0x2a')]=_0x20e675[_0xcad8('0x2a')];this[_0xcad8('0x2b')]=_0x20e675['originatecalleridnum']||'';this[_0xcad8('0x2c')]=_0x20e675[_0xcad8('0x2c')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x09d2=['countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x33f03b,_0x5944fb){var _0x170f9c=function(_0x4f5b76){while(--_0x4f5b76){_0x33f03b['push'](_0x33f03b['shift']());}};_0x170f9c(++_0x5944fb);}(_0x09d2,0x1d2));var _0x209d=function(_0x471759,_0x1c6ec8){_0x471759=_0x471759-0x0;var _0x1bdcca=_0x09d2[_0x471759];return _0x1bdcca;};'use strict';var util=require(_0x209d('0x0'));var _=require(_0x209d('0x1'));var moment=require(_0x209d('0x2'));function getSeconds(_0x2443c0,_0x7fcf33){var _0x3062a3=moment(_0x2443c0)[_0x209d('0x3')](0x0);var _0x18ecfb=moment(_0x7fcf33)[_0x209d('0x3')](0x0);return _0x3062a3[_0x209d('0x4')](_0x18ecfb,'seconds');}function AgentComplete(_0x272732,_0x315ec7){this[_0x209d('0x5')]=0x4;this[_0x209d('0x6')]=_0x209d('0x7');this['scheduledat']=_0x272732['scheduledat'];this[_0x209d('0x8')]=_0x272732[_0x209d('0x8')];this[_0x209d('0x9')]=_0x272732['type']===_0x209d('0xa')?'queue':_0x272732[_0x209d('0x8')];this[_0x209d('0xb')]=_0x272732[_0x209d('0xb')];this[_0x209d('0xc')]=_0x272732[_0x209d('0xc')];this[_0x209d('0xd')]=_0x272732[_0x209d('0xd')];this[_0x209d('0xe')]=_0x272732[_0x209d('0xb')]+_0x272732[_0x209d('0xc')]+_0x272732[_0x209d('0xd')]+_0x272732[_0x209d('0xf')]+_0x272732['countdropretry']+_0x272732[_0x209d('0x10')]+_0x272732[_0x209d('0x11')]+_0x272732[_0x209d('0x12')];this['countnosuchnumberretry']=_0x272732['countnosuchnumberretry'];this[_0x209d('0x13')]=_0x272732['countdropretry'];this['countabandonedretry']=_0x272732[_0x209d('0x10')];this[_0x209d('0x11')]=_0x272732[_0x209d('0x11')];this['countagentrejectretry']=_0x272732[_0x209d('0x12')];this[_0x209d('0x14')]=_0x315ec7[_0x209d('0x14')];this[_0x209d('0x15')]=_0x272732['name'];this[_0x209d('0x16')]=_0x272732[_0x209d('0x17')];this[_0x209d('0x18')]=_0x272732['starttime'];this['responsetime']=_0x272732[_0x209d('0x19')];this['answertime']=_0x272732[_0x209d('0x1a')];this[_0x209d('0x1b')]=moment()[_0x209d('0x1c')](_0x209d('0x1d'));this[_0x209d('0x1e')]=getSeconds(_0x272732[_0x209d('0x19')],_0x272732[_0x209d('0x18')]);this[_0x209d('0x1f')]=getSeconds(_0x272732[_0x209d('0x1a')],_0x272732[_0x209d('0x19')]);this[_0x209d('0x20')]=getSeconds(this[_0x209d('0x1b')],_0x272732[_0x209d('0x1a')]);this[_0x209d('0x21')]=_0x315ec7[_0x209d('0x21')];this[_0x209d('0x22')]=_0x315ec7[_0x209d('0x22')];this[_0x209d('0x23')]=_0x315ec7[_0x209d('0x23')];this[_0x209d('0x24')]=_0x272732[_0x209d('0x24')];this['callbackuniqueid']=_0x272732[_0x209d('0x25')];this[_0x209d('0x26')]=_0x272732['callbackat'];this[_0x209d('0x27')]=_0x272732['recallme'];this[_0x209d('0x28')]=_0x272732[_0x209d('0x28')];this[_0x209d('0x29')]=_0x272732[_0x209d('0x29')];this[_0x209d('0x2a')]=_0x272732[_0x209d('0x2a')];this[_0x209d('0x2b')]=_0x272732[_0x209d('0x2b')];this[_0x209d('0x2c')]=_0x272732['CampaignId'];this[_0x209d('0x2d')]=_0x272732[_0x209d('0x2d')]||'';this[_0x209d('0x2e')]=_0x272732[_0x209d('0x2e')]||'';}module[_0x209d('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 8a546f1..da21f8f 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x3e4720,_0x42638f){var _0x4c7364=function(_0x13a8f3){while(--_0x13a8f3){_0x3e4720['push'](_0x3e4720['shift']());}};_0x4c7364(++_0x42638f);}(_0x8ef6,0xf2));var _0x68ef=function(_0xab8bab,_0x10d684){_0xab8bab=_0xab8bab-0x0;var _0x138077=_0x8ef6[_0xab8bab];return _0x138077;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));function getSeconds(_0x279e08,_0x2cc97b){var _0x44e0d3=moment(_0x279e08)[_0x68ef('0x3')](0x0);var _0x4a72b8=moment(_0x2cc97b)[_0x68ef('0x3')](0x0);return _0x44e0d3[_0x68ef('0x4')](_0x4a72b8,_0x68ef('0x5'));}function Final(_0x2ac782){this['uniqueid']=_0x2ac782['uniqueid'];this[_0x68ef('0x6')]=_0x2ac782[_0x68ef('0x6')];this[_0x68ef('0x7')]=_0x2ac782['type'];this[_0x68ef('0x8')]=_0x2ac782[_0x68ef('0x7')]===_0x68ef('0x9')?_0x68ef('0xa'):_0x2ac782[_0x68ef('0x7')];this[_0x68ef('0xb')]=_0x2ac782[_0x68ef('0xb')];this[_0x68ef('0xc')]=_0x2ac782[_0x68ef('0xc')];this[_0x68ef('0xd')]=_0x2ac782[_0x68ef('0xd')];this[_0x68ef('0xe')]=_0x2ac782['countbusyretry']+_0x2ac782[_0x68ef('0xc')]+_0x2ac782[_0x68ef('0xd')]+_0x2ac782[_0x68ef('0xf')]+_0x2ac782[_0x68ef('0x10')]+_0x2ac782[_0x68ef('0x11')]+_0x2ac782[_0x68ef('0x12')]+_0x2ac782['countagentrejectretry'];this[_0x68ef('0xf')]=_0x2ac782[_0x68ef('0xf')];this[_0x68ef('0x10')]=_0x2ac782['countdropretry'];this[_0x68ef('0x11')]=_0x2ac782[_0x68ef('0x11')];this[_0x68ef('0x12')]=_0x2ac782['countmachineretry'];this[_0x68ef('0x13')]=_0x2ac782[_0x68ef('0x13')];this[_0x68ef('0xa')]=_0x2ac782[_0x68ef('0xa')];this['calleridname']=_0x2ac782[_0x68ef('0x14')];this['calleridnum']=_0x2ac782['calleridnum'];this[_0x68ef('0x15')]=_0x2ac782[_0x68ef('0x15')];this['responsetime']=_0x2ac782['responsetime'];this[_0x68ef('0x16')]=_0x2ac782[_0x68ef('0x17')];this[_0x68ef('0x18')]=_0x2ac782['ringtime']||0x0;this[_0x68ef('0x19')]=_0x2ac782[_0x68ef('0x19')]||0x0;this[_0x68ef('0x1a')]=_0x2ac782['talktime']||0x0;this[_0x68ef('0x1b')]=_0x2ac782[_0x68ef('0x1b')];this['callbackuniqueid']=_0x2ac782[_0x68ef('0x1c')];this[_0x68ef('0x1d')]=_0x2ac782[_0x68ef('0x1d')];this['recallme']=_0x2ac782['recallme'];this['ContactId']=_0x2ac782[_0x68ef('0x1e')];this[_0x68ef('0x1f')]=_0x2ac782[_0x68ef('0x1f')];this[_0x68ef('0x20')]=_0x2ac782[_0x68ef('0x20')];this[_0x68ef('0x21')]=_0x2ac782[_0x68ef('0x21')];this[_0x68ef('0x22')]=_0x2ac782[_0x68ef('0x22')];this[_0x68ef('0x23')]=_0x2ac782['originatecalleridnum']||'';this[_0x68ef('0x24')]=_0x2ac782['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0xa1f6=['ListId','UserId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x5a905e,_0x31aa4a){var _0x4124d6=function(_0x37c28a){while(--_0x37c28a){_0x5a905e['push'](_0x5a905e['shift']());}};_0x4124d6(++_0x31aa4a);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0xa1f6[_0x591a90];return _0x551587;};'use strict';var util=require(_0x6a1f('0x0'));var _=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));function getSeconds(_0x28788a,_0x198e14){var _0x123ad4=moment(_0x28788a)['milliseconds'](0x0);var _0x52b77b=moment(_0x198e14)['milliseconds'](0x0);return _0x123ad4['diff'](_0x52b77b,'seconds');}function Final(_0xc7a556){this[_0x6a1f('0x3')]=_0xc7a556[_0x6a1f('0x3')];this[_0x6a1f('0x4')]=_0xc7a556[_0x6a1f('0x4')];this[_0x6a1f('0x5')]=_0xc7a556[_0x6a1f('0x5')];this['campaigntype']=_0xc7a556[_0x6a1f('0x5')]===_0x6a1f('0x6')?_0x6a1f('0x7'):_0xc7a556[_0x6a1f('0x5')];this[_0x6a1f('0x8')]=_0xc7a556['countbusyretry'];this[_0x6a1f('0x9')]=_0xc7a556[_0x6a1f('0x9')];this[_0x6a1f('0xa')]=_0xc7a556[_0x6a1f('0xa')];this['countglobal']=_0xc7a556[_0x6a1f('0x8')]+_0xc7a556['countcongestionretry']+_0xc7a556[_0x6a1f('0xa')]+_0xc7a556[_0x6a1f('0xb')]+_0xc7a556[_0x6a1f('0xc')]+_0xc7a556[_0x6a1f('0xd')]+_0xc7a556[_0x6a1f('0xe')]+_0xc7a556[_0x6a1f('0xf')];this[_0x6a1f('0xb')]=_0xc7a556[_0x6a1f('0xb')];this[_0x6a1f('0xc')]=_0xc7a556[_0x6a1f('0xc')];this[_0x6a1f('0xd')]=_0xc7a556[_0x6a1f('0xd')];this[_0x6a1f('0xe')]=_0xc7a556[_0x6a1f('0xe')];this[_0x6a1f('0xf')]=_0xc7a556[_0x6a1f('0xf')];this[_0x6a1f('0x7')]=_0xc7a556[_0x6a1f('0x7')];this[_0x6a1f('0x10')]=_0xc7a556['calleridname'];this[_0x6a1f('0x11')]=_0xc7a556[_0x6a1f('0x11')];this[_0x6a1f('0x12')]=_0xc7a556[_0x6a1f('0x12')];this[_0x6a1f('0x13')]=_0xc7a556[_0x6a1f('0x13')];this[_0x6a1f('0x14')]=_0xc7a556[_0x6a1f('0x13')];this['ringtime']=_0xc7a556[_0x6a1f('0x15')]||0x0;this['holdtime']=_0xc7a556[_0x6a1f('0x16')]||0x0;this[_0x6a1f('0x17')]=_0xc7a556[_0x6a1f('0x17')]||0x0;this[_0x6a1f('0x18')]=_0xc7a556[_0x6a1f('0x18')];this['callbackuniqueid']=_0xc7a556[_0x6a1f('0x19')];this[_0x6a1f('0x1a')]=_0xc7a556[_0x6a1f('0x1a')];this[_0x6a1f('0x1b')]=_0xc7a556[_0x6a1f('0x1b')];this[_0x6a1f('0x1c')]=_0xc7a556[_0x6a1f('0x1c')];this[_0x6a1f('0x1d')]=_0xc7a556['ListId'];this[_0x6a1f('0x1e')]=_0xc7a556[_0x6a1f('0x1e')];this['VoiceQueueId']=_0xc7a556['VoiceQueueId'];this['CampaignId']=_0xc7a556['CampaignId'];this[_0x6a1f('0x1f')]=_0xc7a556['originatecalleridnum']||'';this['originatecalleridname']=_0xc7a556[_0x6a1f('0x20')]||'';}module[_0x6a1f('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b567d32..0fa1a11 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04e6=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x20b996,_0x285526){var _0x268d6b=function(_0x3655de){while(--_0x3655de){_0x20b996['push'](_0x20b996['shift']());}};_0x268d6b(++_0x285526);}(_0x04e6,0x8f));var _0x604e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x04e6[_0x3b0731];return _0x4204d7;};'use strict';var util=require(_0x604e('0x0'));var _=require(_0x604e('0x1'));var moment=require('moment');function getSeconds(_0x4d556b,_0x58460f){var _0x3179a0=moment(_0x4d556b)[_0x604e('0x2')](0x0);var _0x56a778=moment(_0x58460f)[_0x604e('0x2')](0x0);return _0x3179a0[_0x604e('0x3')](_0x56a778,'seconds');}function Hangup(_0x4cec94,_0x34798f){this[_0x604e('0x4')]=0x4;this[_0x604e('0x5')]=_0x604e('0x6');this[_0x604e('0x7')]=_0x4cec94['scheduledat'];this[_0x604e('0x8')]=_0x4cec94['type'];this[_0x604e('0x9')]=_0x4cec94[_0x604e('0x8')]===_0x604e('0xa')?'queue':_0x4cec94[_0x604e('0x8')];this[_0x604e('0xb')]=_0x4cec94[_0x604e('0xb')];this[_0x604e('0xc')]=_0x4cec94['countcongestionretry'];this[_0x604e('0xd')]=_0x4cec94[_0x604e('0xd')];this[_0x604e('0xe')]=_0x4cec94[_0x604e('0xb')]+_0x4cec94['countcongestionretry']+_0x4cec94[_0x604e('0xd')]+_0x4cec94[_0x604e('0xf')]+_0x4cec94[_0x604e('0x10')]+_0x4cec94[_0x604e('0x11')]+_0x4cec94[_0x604e('0x12')]+_0x4cec94[_0x604e('0x13')];this['countnosuchnumberretry']=_0x4cec94[_0x604e('0xf')];this[_0x604e('0x10')]=_0x4cec94['countdropretry'];this[_0x604e('0x11')]=_0x4cec94[_0x604e('0x11')];this[_0x604e('0x12')]=_0x4cec94[_0x604e('0x12')];this[_0x604e('0x13')]=_0x4cec94[_0x604e('0x13')];this[_0x604e('0x14')]=_0x34798f['uniqueid'];this[_0x604e('0x15')]=_0x4cec94[_0x604e('0x16')];this['calleridnum']=_0x4cec94['number'];this['starttime']=_0x4cec94[_0x604e('0x17')];this[_0x604e('0x18')]=_0x4cec94[_0x604e('0x18')];this[_0x604e('0x19')]=moment()[_0x604e('0x1a')](_0x604e('0x1b'));this['ringtime']=getSeconds(_0x4cec94[_0x604e('0x18')],_0x4cec94[_0x604e('0x17')]);this[_0x604e('0x1c')]=0x0;this[_0x604e('0x1d')]=getSeconds(this[_0x604e('0x19')],_0x4cec94[_0x604e('0x18')]);this['queue']=_0x4cec94['queue'];this[_0x604e('0x1e')]=_0x604e('0x1f');this['reason']=_0x34798f[_0x604e('0x20')];this['callback']=_0x4cec94[_0x604e('0x21')];this[_0x604e('0x22')]=_0x4cec94['callbackuniqueid'];this[_0x604e('0x23')]=_0x4cec94[_0x604e('0x23')];this[_0x604e('0x24')]=_0x4cec94[_0x604e('0x24')];this['ContactId']=_0x4cec94['ContactId'];this[_0x604e('0x25')]=_0x4cec94[_0x604e('0x25')];this[_0x604e('0x26')]=_0x4cec94[_0x604e('0x26')];this['VoiceQueueId']=_0x4cec94['VoiceQueueId'];this['CampaignId']=_0x4cec94['CampaignId'];}module[_0x604e('0x27')]=Hangup; \ No newline at end of file +var _0x4162=['scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','ringtime','holdtime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','exports','lodash','moment','milliseconds','diff','seconds','state'];(function(_0x19cf1b,_0x37c5ae){var _0x2e8bb0=function(_0x4533ed){while(--_0x4533ed){_0x19cf1b['push'](_0x19cf1b['shift']());}};_0x2e8bb0(++_0x37c5ae);}(_0x4162,0x1ce));var _0x2416=function(_0x4b7298,_0x5d8d2e){_0x4b7298=_0x4b7298-0x0;var _0x4450ab=_0x4162[_0x4b7298];return _0x4450ab;};'use strict';var util=require('util');var _=require(_0x2416('0x0'));var moment=require(_0x2416('0x1'));function getSeconds(_0x3e755e,_0x42021f){var _0x423a3d=moment(_0x3e755e)[_0x2416('0x2')](0x0);var _0x51f67f=moment(_0x42021f)[_0x2416('0x2')](0x0);return _0x423a3d[_0x2416('0x3')](_0x51f67f,_0x2416('0x4'));}function Hangup(_0x1d664b,_0x5236f8){this[_0x2416('0x5')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x1d664b[_0x2416('0x6')];this[_0x2416('0x7')]=_0x1d664b[_0x2416('0x7')];this[_0x2416('0x8')]=_0x1d664b[_0x2416('0x7')]==='outbound'?_0x2416('0x9'):_0x1d664b['type'];this[_0x2416('0xa')]=_0x1d664b[_0x2416('0xa')];this['countcongestionretry']=_0x1d664b['countcongestionretry'];this['countnoanswerretry']=_0x1d664b[_0x2416('0xb')];this[_0x2416('0xc')]=_0x1d664b[_0x2416('0xa')]+_0x1d664b[_0x2416('0xd')]+_0x1d664b['countnoanswerretry']+_0x1d664b[_0x2416('0xe')]+_0x1d664b[_0x2416('0xf')]+_0x1d664b[_0x2416('0x10')]+_0x1d664b['countmachineretry']+_0x1d664b['countagentrejectretry'];this[_0x2416('0xe')]=_0x1d664b[_0x2416('0xe')];this['countdropretry']=_0x1d664b['countdropretry'];this[_0x2416('0x10')]=_0x1d664b[_0x2416('0x10')];this[_0x2416('0x11')]=_0x1d664b[_0x2416('0x11')];this['countagentrejectretry']=_0x1d664b[_0x2416('0x12')];this['uniqueid']=_0x5236f8[_0x2416('0x13')];this[_0x2416('0x14')]=_0x1d664b[_0x2416('0x15')];this[_0x2416('0x16')]=_0x1d664b[_0x2416('0x17')];this[_0x2416('0x18')]=_0x1d664b['starttime'];this[_0x2416('0x19')]=_0x1d664b[_0x2416('0x19')];this['endtime']=moment()[_0x2416('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2416('0x1b')]=getSeconds(_0x1d664b[_0x2416('0x19')],_0x1d664b[_0x2416('0x18')]);this[_0x2416('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x2416('0x1d')],_0x1d664b[_0x2416('0x19')]);this[_0x2416('0x9')]=_0x1d664b[_0x2416('0x9')];this[_0x2416('0x1e')]='IVR';this[_0x2416('0x1f')]=_0x5236f8['cause-txt'];this[_0x2416('0x20')]=_0x1d664b['callback'];this['callbackuniqueid']=_0x1d664b['callbackuniqueid'];this[_0x2416('0x21')]=_0x1d664b['callbackat'];this[_0x2416('0x22')]=_0x1d664b[_0x2416('0x22')];this['ContactId']=_0x1d664b[_0x2416('0x23')];this[_0x2416('0x24')]=_0x1d664b[_0x2416('0x24')];this[_0x2416('0x25')]=_0x1d664b[_0x2416('0x25')];this['VoiceQueueId']=_0x1d664b['VoiceQueueId'];this['CampaignId']=_0x1d664b['CampaignId'];}module[_0x2416('0x26')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 494c1d6..52d2323 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5490=['UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x5bc018,_0x3ef7fc){var _0x289248=function(_0x25232d){while(--_0x25232d){_0x5bc018['push'](_0x5bc018['shift']());}};_0x289248(++_0x3ef7fc);}(_0x5490,0x19b));var _0x0549=function(_0x3ec484,_0xbd87d0){_0x3ec484=_0x3ec484-0x0;var _0x46b2c3=_0x5490[_0x3ec484];return _0x46b2c3;};'use strict';var util=require(_0x0549('0x0'));var _=require(_0x0549('0x1'));var moment=require(_0x0549('0x2'));function getSeconds(_0x25c1f7,_0x308bef){var _0x4e4e07=moment(_0x25c1f7)[_0x0549('0x3')](0x0);var _0x1d33bf=moment(_0x308bef)[_0x0549('0x3')](0x0);return _0x4e4e07[_0x0549('0x4')](_0x1d33bf,'seconds');}function History(_0x20e3c3){this['uniqueid']=_0x20e3c3[_0x0549('0x5')];this['scheduledat']=_0x20e3c3[_0x0549('0x6')]||undefined;this[_0x0549('0x7')]=_0x20e3c3[_0x0549('0x7')];this['campaigntype']=_0x20e3c3[_0x0549('0x7')]==='outbound'?_0x0549('0x8'):_0x20e3c3[_0x0549('0x7')];this[_0x0549('0x9')]=_0x20e3c3['countbusyretry'];this[_0x0549('0xa')]=_0x20e3c3['countcongestionretry'];this[_0x0549('0xb')]=_0x20e3c3['countnoanswerretry'];this[_0x0549('0xc')]=_0x20e3c3[_0x0549('0x9')]+_0x20e3c3[_0x0549('0xa')]+_0x20e3c3[_0x0549('0xb')]+_0x20e3c3[_0x0549('0xd')]+_0x20e3c3[_0x0549('0xe')]+_0x20e3c3[_0x0549('0xf')]+_0x20e3c3[_0x0549('0x10')]+_0x20e3c3['countagentrejectretry'];this[_0x0549('0xd')]=_0x20e3c3[_0x0549('0xd')];this['countdropretry']=_0x20e3c3[_0x0549('0xe')];this[_0x0549('0xf')]=_0x20e3c3[_0x0549('0xf')];this[_0x0549('0x10')]=_0x20e3c3['countmachineretry'];this[_0x0549('0x11')]=_0x20e3c3[_0x0549('0x11')];this[_0x0549('0x8')]=_0x20e3c3[_0x0549('0x8')];this[_0x0549('0x12')]=_0x20e3c3[_0x0549('0x13')];this[_0x0549('0x14')]=_0x20e3c3[_0x0549('0x15')];this['starttime']=_0x20e3c3[_0x0549('0x16')];this[_0x0549('0x17')]=_0x20e3c3['responsetime'];this['endtime']=_0x20e3c3[_0x0549('0x17')];this[_0x0549('0x18')]=getSeconds(_0x20e3c3[_0x0549('0x17')],_0x20e3c3[_0x0549('0x16')]);this[_0x0549('0x19')]=0x0;this[_0x0549('0x1a')]=0x0;this[_0x0549('0x1b')]=_0x20e3c3[_0x0549('0x1b')];this[_0x0549('0x1c')]=_0x20e3c3[_0x0549('0x1c')];this[_0x0549('0x1d')]=_0x20e3c3['callbackat'];this[_0x0549('0x1e')]=_0x20e3c3[_0x0549('0x1e')];this[_0x0549('0x1f')]=_0x20e3c3[_0x0549('0x1f')];this['ListId']=_0x20e3c3[_0x0549('0x20')];this[_0x0549('0x21')]=_0x20e3c3['UserId'];this[_0x0549('0x22')]=_0x20e3c3['VoiceQueueId'];this[_0x0549('0x23')]=_0x20e3c3[_0x0549('0x23')];this['originatecalleridnum']=_0x20e3c3['originatecalleridnum']||'';this[_0x0549('0x24')]=_0x20e3c3[_0x0549('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x6cb4=['CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x162bb4,_0x160428){var _0x376a7e=function(_0x3e10e7){while(--_0x3e10e7){_0x162bb4['push'](_0x162bb4['shift']());}};_0x376a7e(++_0x160428);}(_0x6cb4,0xff));var _0x46cb=function(_0x45ee6e,_0x230c46){_0x45ee6e=_0x45ee6e-0x0;var _0x505f62=_0x6cb4[_0x45ee6e];return _0x505f62;};'use strict';var util=require(_0x46cb('0x0'));var _=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));function getSeconds(_0x3403fc,_0x375bef){var _0x36add6=moment(_0x3403fc)[_0x46cb('0x3')](0x0);var _0x786ab7=moment(_0x375bef)[_0x46cb('0x3')](0x0);return _0x36add6['diff'](_0x786ab7,_0x46cb('0x4'));}function History(_0x5cb9a4){this[_0x46cb('0x5')]=_0x5cb9a4['uniqueid'];this[_0x46cb('0x6')]=_0x5cb9a4[_0x46cb('0x6')]||undefined;this[_0x46cb('0x7')]=_0x5cb9a4[_0x46cb('0x7')];this[_0x46cb('0x8')]=_0x5cb9a4[_0x46cb('0x7')]==='outbound'?_0x46cb('0x9'):_0x5cb9a4[_0x46cb('0x7')];this['countbusyretry']=_0x5cb9a4[_0x46cb('0xa')];this[_0x46cb('0xb')]=_0x5cb9a4['countcongestionretry'];this[_0x46cb('0xc')]=_0x5cb9a4[_0x46cb('0xc')];this['countglobal']=_0x5cb9a4['countbusyretry']+_0x5cb9a4['countcongestionretry']+_0x5cb9a4[_0x46cb('0xc')]+_0x5cb9a4[_0x46cb('0xd')]+_0x5cb9a4[_0x46cb('0xe')]+_0x5cb9a4[_0x46cb('0xf')]+_0x5cb9a4['countmachineretry']+_0x5cb9a4[_0x46cb('0x10')];this[_0x46cb('0xd')]=_0x5cb9a4[_0x46cb('0xd')];this[_0x46cb('0xe')]=_0x5cb9a4[_0x46cb('0xe')];this[_0x46cb('0xf')]=_0x5cb9a4[_0x46cb('0xf')];this[_0x46cb('0x11')]=_0x5cb9a4[_0x46cb('0x11')];this[_0x46cb('0x10')]=_0x5cb9a4[_0x46cb('0x10')];this['queue']=_0x5cb9a4[_0x46cb('0x9')];this['calleridname']=_0x5cb9a4[_0x46cb('0x12')];this['calleridnum']=_0x5cb9a4['number'];this['starttime']=_0x5cb9a4[_0x46cb('0x13')];this[_0x46cb('0x14')]=_0x5cb9a4[_0x46cb('0x14')];this[_0x46cb('0x15')]=_0x5cb9a4[_0x46cb('0x14')];this[_0x46cb('0x16')]=getSeconds(_0x5cb9a4[_0x46cb('0x14')],_0x5cb9a4[_0x46cb('0x13')]);this[_0x46cb('0x17')]=0x0;this[_0x46cb('0x18')]=0x0;this[_0x46cb('0x19')]=_0x5cb9a4[_0x46cb('0x19')];this[_0x46cb('0x1a')]=_0x5cb9a4[_0x46cb('0x1a')];this[_0x46cb('0x1b')]=_0x5cb9a4[_0x46cb('0x1b')];this[_0x46cb('0x1c')]=_0x5cb9a4[_0x46cb('0x1c')];this[_0x46cb('0x1d')]=_0x5cb9a4[_0x46cb('0x1d')];this[_0x46cb('0x1e')]=_0x5cb9a4[_0x46cb('0x1e')];this[_0x46cb('0x1f')]=_0x5cb9a4[_0x46cb('0x1f')];this[_0x46cb('0x20')]=_0x5cb9a4['VoiceQueueId'];this['CampaignId']=_0x5cb9a4[_0x46cb('0x21')];this[_0x46cb('0x22')]=_0x5cb9a4[_0x46cb('0x22')]||'';this[_0x46cb('0x23')]=_0x5cb9a4[_0x46cb('0x23')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 59d6183..b811cc9 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd68e=['checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','SIP/%s','status','reachable','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','dialAMDActive','HANGUP','state','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','Machine','dialGlobalMaxRetry','VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','outboundDropCallsDayTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','actionid','roundrobin','locked','paused','stateinterface','push','merge','pick','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIfTime','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','getContactDialerIvr','[getContactCampaign2][Empty]','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[actionOriginate]\x20','[handlePredictive][limitChannel]','tryOriginatePredictive','checkContactBlack','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','uuid','moment','md5','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','strategy','answered','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','Trunk','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','undefined','isNil','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd68e,0x167));var _0xed68=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xd68e[_0x2d3d0d];return _0xca35b6;};'use strict';var util=require(_0xed68('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xed68('0x1'));var moment=require(_0xed68('0x2'));var rr=require('rr');var md5=require(_0xed68('0x3'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0xed68('0x4'));var logger=require(_0xed68('0x5'))(_0xed68('0x6'));var loggerBooked=require('../../../config/logger')(_0xed68('0x7'));var loggerPredictive=require(_0xed68('0x5'))('predictive');var loggerPredictiveCalls=require(_0xed68('0x5'))(_0xed68('0x8'));var loggerSyncQueueSummary=require(_0xed68('0x5'))('syncQueueSummary');var ami=require(_0xed68('0x9'));config['redis']=_[_0xed68('0xa')](config[_0xed68('0xb')],{'host':_0xed68('0xc'),'port':0x18eb});var io=require(_0xed68('0xd'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xed68('0xe'));var cmHopperBlack=require(_0xed68('0xf'));var voiceQueueRt=require(_0xed68('0x10'));var Action=require('./action');var History=require(_0xed68('0x11'));var Final=require('./final');var AgentComplete=require(_0xed68('0x12'));var QueueCallerAbandon=require(_0xed68('0x13'));var Hangup=require(_0xed68('0x14'));var ipAgi=process['env'][_0xed68('0x15')]||_0xed68('0x16');var strategy={'rrmemory':_0xed68('0x17'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xed68('0x18')][_0xed68('0x19')]=function(_0x42f6d2){this[_0xed68('0x1a')]=this[_0xed68('0x1a')]?this[_0xed68('0x1a')][_0xed68('0x1b')](_0x42f6d2):_0x42f6d2();};function Dialer(_0x4e419f,_0x477797){this[_0xed68('0x1c')]=new Sequence();this[_0xed68('0x1d')]=_0x477797;this[_0xed68('0x1e')]=_0x4e419f[_0xed68('0x1e')];this[_0xed68('0x1f')]=_0x4e419f[_0xed68('0x1f')];this[_0xed68('0x20')]=_0x4e419f[_0xed68('0x20')];this['trunks']=_0x4e419f[_0xed68('0x21')];this[_0xed68('0x22')]=config[_0xed68('0x22')]||0x2;this['channels']={};this['actions']={};this[_0xed68('0x23')]={};this['uniqueId']={};this['optionPredictive']={};this[_0xed68('0x24')]={};this[_0xed68('0x25')]={};this[_0xed68('0x26')]={};this[_0xed68('0x27')]={};this[_0xed68('0x28')]={};ami['on'](_0xed68('0x29'),this[_0xed68('0x2a')]['bind'](this));ami['on'](_0xed68('0x2b'),this[_0xed68('0x2c')][_0xed68('0x2d')](this));ami['on'](_0xed68('0x2e'),this[_0xed68('0x2f')][_0xed68('0x2d')](this));ami['on'](_0xed68('0x30'),this[_0xed68('0x31')][_0xed68('0x2d')](this));ami['on'](_0xed68('0x32'),this[_0xed68('0x33')][_0xed68('0x2d')](this));ami['on']('hangup',this[_0xed68('0x34')][_0xed68('0x2d')](this));ami['on'](_0xed68('0x35'),this[_0xed68('0x36')]['bind'](this));ami['on'](_0xed68('0x37'),this[_0xed68('0x38')]['bind'](this));ami['on'](_0xed68('0x39'),this[_0xed68('0x3a')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xed68('0x2d')](this));this[_0xed68('0x3b')]();this[_0xed68('0x3c')]();}function isNotNull(_0x495472){return _0x495472!==null&&!_['isUndefined'](_0x495472);}function checkIsLoggedIn(_0x18f64d,_0x3cc04d){return function(){if(_0x3cc04d<=0x0){_0x18f64d[_0xed68('0x3d')]='AGENTS_NOT_LOGGED';throw _0x18f64d[_0xed68('0x3e')]+_0xed68('0x3f');}};}function isActive(_0x279077){return _0x279077;}function checkIsActive(_0x47e34d,_0x1502bd){return function(){if(!isActive(_0x1502bd)){_0x47e34d['message']=_0xed68('0x40');throw _0x47e34d['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x1e414a){return function(){if(!isNotNull(_0x1e414a[_0xed68('0x41')])){_0x1e414a[_0xed68('0x3d')]=_0xed68('0x42');throw _0x1e414a[_0xed68('0x3e')]+_0xed68('0x43');}if(!isNotNull(_0x1e414a[_0xed68('0x41')][_0xed68('0x44')])){_0x1e414a[_0xed68('0x3d')]=_0xed68('0x42');throw _0x1e414a[_0xed68('0x3e')]+_0xed68('0x43');}if(!isNotNull(_[_0xed68('0x45')](_0x1e414a[_0xed68('0x41')]['Intervals']))){_0x1e414a[_0xed68('0x3d')]='INTERVAL_IS_NULL';throw _0x1e414a[_0xed68('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xc363c4,_0x44aa97,_0x1029e9){return{'action':_0xc363c4,'response':_0x44aa97,'message':_0x1029e9,'stack':_0x1029e9};}function myreject(_0x32271d){return function(_0x4a64ac){return _0x32271d(msgResponse(_0xed68('0x46'),_0xed68('0x47'),JSON[_0xed68('0x48')](_0x4a64ac)));};}function getSeconds(_0x5a8401,_0x3db378){var _0xd7bf0a=moment(_0x5a8401)[_0xed68('0x49')](0x0);var _0x19508f=moment(_0x3db378)[_0xed68('0x49')](0x0);return _0xd7bf0a['diff'](_0x19508f,_0xed68('0x4a'));}function emit(_0x77862d,_0x530111,_0x52cf6f){io['to'](_0x77862d)[_0xed68('0x4b')](_0x530111,_0x52cf6f);}function emitVoiceQueueSummary(_0x4ce0ef){if(_0x4ce0ef['type']==='outbound'){var _0x178a7f={'id':_0x4ce0ef['id'],'name':_0x4ce0ef[_0xed68('0x3e')],'strategy':_0x4ce0ef[_0xed68('0x4c')],'answered':_0x4ce0ef[_0xed68('0x4d')],'available':_0x4ce0ef['available'],'loggedIn':_0x4ce0ef[_0xed68('0x4e')],'pTalking':_0x4ce0ef['pTalking'],'sumBillable':_0x4ce0ef[_0xed68('0x4f')],'sumDuration':_0x4ce0ef['sumDuration'],'sumHoldTime':_0x4ce0ef[_0xed68('0x50')]||0x0,'talking':_0x4ce0ef['talking'],'total':_0x4ce0ef[_0xed68('0x51')],'type':_0x4ce0ef[_0xed68('0x52')],'unmanaged':_0x4ce0ef[_0xed68('0x53')],'abandoned':_0x4ce0ef['abandoned'],'waiting':_0x4ce0ef[_0xed68('0x54')],'loggedInDb':_0x4ce0ef[_0xed68('0x55')],'dialActive':_0x4ce0ef[_0xed68('0x56')],'dialMethod':_0x4ce0ef[_0xed68('0x57')],'dialOriginateCallerIdName':_0x4ce0ef['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4ce0ef[_0xed68('0x58')],'dialOriginateTimeout':_0x4ce0ef[_0xed68('0x59')],'dialPrefix':_0x4ce0ef[_0xed68('0x5a')],'outboundAnswerAgiCallsDay':_0x4ce0ef[_0xed68('0x5b')],'outboundAnswerCallsDay':_0x4ce0ef[_0xed68('0x5c')],'outboundBlacklistCallsDay':_0x4ce0ef[_0xed68('0x5d')],'outboundBusyCallsDay':_0x4ce0ef[_0xed68('0x5e')],'outboundCongestionCallsDay':_0x4ce0ef[_0xed68('0x5f')],'outboundDropCallsDayACS':_0x4ce0ef[_0xed68('0x60')],'outboundDropCallsDayCallersExit':_0x4ce0ef['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4ce0ef['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4ce0ef[_0xed68('0x61')],'outboundNoSuchCallsDay':_0x4ce0ef[_0xed68('0x62')],'outboundOriginateFailureCallsDay':_0x4ce0ef[_0xed68('0x63')],'outboundReCallsDay':_0x4ce0ef[_0xed68('0x64')],'outboundRejectCallsDay':_0x4ce0ef[_0xed68('0x65')],'outboundUnknownCallsDay':_0x4ce0ef[_0xed68('0x66')],'predictiveIntervalAnsweredCalls':_0x4ce0ef[_0xed68('0x67')],'predictiveIntervalAvgHoldtime':_0x4ce0ef['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4ce0ef[_0xed68('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x4ce0ef[_0xed68('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x4ce0ef[_0xed68('0x6a')],'predictiveIntervalErlangCalls':_0x4ce0ef[_0xed68('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x4ce0ef['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4ce0ef['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4ce0ef['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4ce0ef['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4ce0ef['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4ce0ef[_0xed68('0x6c')],'message':_0x4ce0ef[_0xed68('0x3d')],'originated':_0x4ce0ef['originated'],'erlangCalls':_0x4ce0ef[_0xed68('0x6d')],'erlangCallToSecond':_0x4ce0ef[_0xed68('0x6e')],'erlangAbandonmentRate':_0x4ce0ef['erlangAbandonmentRate'],'erlangBusyFactor':_0x4ce0ef['erlangBusyFactor'],'startPredictive':_0x4ce0ef[_0xed68('0x24')],'startProgressive':_0x4ce0ef['startProgressive']};if(_0x4ce0ef[_0xed68('0x6f')]){_0x178a7f[_0xed68('0x6f')]={'id':_0x4ce0ef[_0xed68('0x6f')]['id'],'name':_0x4ce0ef[_0xed68('0x6f')][_0xed68('0x3e')],'active':_0x4ce0ef[_0xed68('0x6f')]['active'],'callerid':_0x4ce0ef[_0xed68('0x6f')]['callerid']};}if(_0x4ce0ef[_0xed68('0x41')]){_0x178a7f[_0xed68('0x41')]={'id':_0x4ce0ef[_0xed68('0x41')]['id'],'name':_0x4ce0ef[_0xed68('0x41')][_0xed68('0x3e')]};}var _0x5cda84=md5(JSON['stringify'](_0x178a7f));if(_0x4ce0ef[_0xed68('0x3')]!==_0x5cda84){_0x4ce0ef[_0xed68('0x3')]=_0x5cda84;emit(util[_0xed68('0x70')](_0xed68('0x71'),_0x178a7f['name']),'voice_queue:save',_0x178a7f);}}}function emitCampaignSummary(_0x1cf2fa){if(_0x1cf2fa['type']===_0xed68('0x72')){emit(util[_0xed68('0x70')](_0xed68('0x73'),_0x1cf2fa[_0xed68('0x3e')]),_0xed68('0x74'),_0x1cf2fa);}}function checkGetDataPredictive(_0x1e080f){if(isNotNull(_0x1e080f)&&!_[_0xed68('0x45')](_0x1e080f)){loggerPredictive[_0xed68('0x75')](_0xed68('0x76'));loggerPredictive[_0xed68('0x75')](_0xed68('0x77'),_0x1e080f[_0xed68('0x6c')]);loggerPredictive[_0xed68('0x75')](_0xed68('0x78'),_0x1e080f['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xed68('0x75')](_0xed68('0x79'),_0x1e080f[_0xed68('0x6a')]);loggerPredictive['info'](_0xed68('0x7a'),_0x1e080f[_0xed68('0x69')]);loggerPredictive['info'](_0xed68('0x7b'),_0x1e080f[_0xed68('0x7c')]);loggerPredictive['info'](_0xed68('0x7d'),_0x1e080f[_0xed68('0x68')]);loggerPredictive['info'](_0xed68('0x7e'));if(_0x1e080f[_0xed68('0x6c')]>0x0){if(!_['isUndefined'](_0x1e080f[_0xed68('0x68')])&&_0x1e080f[_0xed68('0x68')]>0x0){return!![];}loggerPredictive[_0xed68('0x75')](_0xed68('0x7f'));if(!_[_0xed68('0x80')](_0x1e080f[_0xed68('0x7c')])&&_0x1e080f[_0xed68('0x7c')]>0x0){return!![];}loggerPredictive[_0xed68('0x75')](_0xed68('0x81'));}else{loggerPredictive[_0xed68('0x75')](_0xed68('0x82'));}}else{loggerPredictive[_0xed68('0x75')](_0xed68('0x83'));}return![];}function mergeDataErlangB(_0x21df45){return function(_0x2eb8f9){loggerPredictive[_0xed68('0x75')](_0xed68('0x84'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2eb8f9[_0xed68('0x6d')]);loggerPredictive[_0xed68('0x75')](_0xed68('0x85'),_0x2eb8f9[_0xed68('0x6e')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2eb8f9[_0xed68('0x86')]);loggerPredictive[_0xed68('0x75')](_0xed68('0x87'),_0x2eb8f9['erlangBusyFactor']);loggerPredictive[_0xed68('0x75')](_0xed68('0x88'),_0x2eb8f9['erlangAbandonmentRate']);loggerPredictive['info'](_0xed68('0x7e'));_['merge'](_0x21df45,_0x2eb8f9);};}function getDiff(_0x26b9c7){var _0x21b95e=moment()[_0xed68('0x49')](0x0);var _0x47560f=moment(_0x26b9c7)[_0xed68('0x49')](0x0);return _0x21b95e['diff'](_0x47560f,_0xed68('0x4a'));}function ifInterval(_0x48dc12,_0x470f09){if(_[_0xed68('0x80')](_0x470f09)){return![];}return getDiff(_0x470f09)<_0x48dc12*0x3c;}function freeVariablesPredictive(_0x29b946){if(isNotNull(_0x29b946)){if(!_['isUndefined'](_0x29b946[_0xed68('0x25')])){_0x29b946['startProgressive']=undefined;loggerPredictive['info'](_0x29b946[_0xed68('0x3e')],_0xed68('0x89'));}if(!_[_0xed68('0x80')](_0x29b946['startPredictive'])){_0x29b946[_0xed68('0x24')]=undefined;loggerPredictive[_0xed68('0x75')](_0x29b946['name'],_0xed68('0x8a'));}if(!_[_0xed68('0x80')](_0x29b946[_0xed68('0x8b')])){clearInterval(_0x29b946[_0xed68('0x8b')]);_0x29b946['handlePredictive']=undefined;loggerPredictive['info'](_0x29b946[_0xed68('0x3e')],_0xed68('0x8c'));}}}function erlangb(_0x3bc8c9,_0x3c77ed){if(_0x3c77ed===0x0){return 0x0;}var _0x2589d1=0x1;for(var _0x3c71cb=0x1;_0x3c71cb<=_0x3c77ed;_0x3c71cb+=0x1){_0x2589d1=0x1+_0x2589d1*_0x3c71cb/_0x3bc8c9;}return 0x1/_0x2589d1;}function isVoiceQueueOutbound(_0xf6c767){return _0xf6c767==='outbound';}function isNotPreview(_0x4ac7fa){return _0x4ac7fa!==_0xed68('0x1d');}function isCampaignIvr(_0xd80381){return _0xd80381==='ivr';}function getCallerId(_0x58e249,_0x19862e,_0x4a73a1){if(!_[_0xed68('0x80')](_0x4a73a1)&&typeof _0x4a73a1===_0xed68('0x8d')&&!_[_0xed68('0x45')](_0x4a73a1)){if(!_[_0xed68('0x80')](_0x19862e)&&typeof _0x19862e===_0xed68('0x8d')&&!_[_0xed68('0x45')](_0x19862e)){return util[_0xed68('0x70')]('\x22%s\x22\x20<%s>',_0x19862e,_0x4a73a1);}return util[_0xed68('0x70')]('\x22%s\x22\x20<%s>',_0x4a73a1,_0x4a73a1);}if(!_[_0xed68('0x80')](_0x58e249)&&typeof _0x58e249===_0xed68('0x8d')&&!_[_0xed68('0x45')](_0x58e249)){return _0x58e249;}return _0xed68('0x8e');}function loggerCatchQueueSummary(_0xe2b624,_0x192790){return function(_0x4f0f3a){freeVariablesPredictive(_0x192790);emitVoiceQueueSummary(_0x192790);emitCampaignSummary(_0x192790);loggerSyncQueueSummary[_0xed68('0x8f')](_0xe2b624,util[_0xed68('0x90')](_0x4f0f3a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x39847a,_0xe6983){return function(_0x168d4b){loggerPredictive['error'](_0xe6983[_0xed68('0x3e')],_0x39847a);loggerPredictive['error'](_0x168d4b[_0xed68('0x91')]);freeVariablesPredictive(_0xe6983);};}function loggerCatch(_0x409d83){return function(_0x410bfc){logger[_0xed68('0x8f')](_0x409d83,util[_0xed68('0x90')](_0x410bfc,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x27ea05){return _0x27ea05&&!_[_0xed68('0x80')](_0x27ea05)&&_0x27ea05[_0xed68('0x92')]>0x0;}function decremetOriginate(_0x4e7698){if(!_[_0xed68('0x80')](_0x4e7698)&&_0x4e7698!==null){if(typeof _0x4e7698[_0xed68('0x93')]!=='undefined'){if(_0x4e7698[_0xed68('0x93')]>0x0){_0x4e7698[_0xed68('0x93')]-=0x1;}else{logger[_0xed68('0x8f')](_0xed68('0x94'));}}}else{logger[_0xed68('0x8f')](_0xed68('0x95'));}}function checkContactLowerLimitOriginate(_0x2662e5,_0x3704ce,_0x3cf6d9){if(_0x3704ce>_0x3cf6d9){for(var _0x5f2398=0x0;_0x5f2398<_0x3704ce-_0x3cf6d9;_0x5f2398+=0x1){decremetOriginate(_0x2662e5);}}}function loggerGetContactDialer(_0x40c91d,_0x1a8486,_0xcba315){return function(_0x2f7243){checkContactLowerLimitOriginate(_0x1a8486,_0xcba315,0x0);logger['error'](_0x40c91d,util['inspect'](_0x2f7243,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x10b7a1){return function(_0x274b22){if(isNotNull(_0x274b22)&&isNotNull(_0x274b22[0x0])){if(_0x274b22[0x0][_0xed68('0x96')]>0x0){_0x10b7a1[_0xed68('0x3d')]=_0xed68('0x97');logger[_0xed68('0x75')](_0xed68('0x98')+_0x10b7a1[_0xed68('0x3e')],_0x274b22[0x0][_0xed68('0x96')],'contacts');}else{_0x10b7a1[_0xed68('0x3d')]=_0xed68('0x99');logger['info'](_0xed68('0x9a')+_0x10b7a1[_0xed68('0x3e')]);}}};}function notSendMessagesQueue(_0x50aa55){if(_0x50aa55[_0xed68('0x9b')]){freeVariablesPredictive(_0x50aa55);if(_0x50aa55[_0xed68('0x93')]===0x0&&_0x50aa55[_0xed68('0x9c')]===0x0&&_0x50aa55[_0xed68('0x54')]===0x0&&(_0x50aa55[_0xed68('0x9d')]||0x0)===0x0){_0x50aa55[_0xed68('0x9b')]=![];_0x50aa55['available']=0x0;_0x50aa55[_0xed68('0x3d')]=_0xed68('0x40');loggerSyncQueueSummary[_0xed68('0x8f')](_0xed68('0x9e'),_0x50aa55[_0xed68('0x3e')],_0xed68('0x9f'));}else{_0x50aa55[_0xed68('0x3d')]=_0xed68('0xa0');loggerSyncQueueSummary['error'](_0xed68('0x9e'),_0x50aa55[_0xed68('0x3e')],'is\x20disactive');}emitVoiceQueueSummary(_0x50aa55);}}function notSendMessagesCampaign(_0x2f3207){if(_0x2f3207[_0xed68('0x9b')]){if(_0x2f3207[_0xed68('0x93')]===0x0){_0x2f3207[_0xed68('0x9b')]=![];_0x2f3207[_0xed68('0x3d')]=_0xed68('0x40');loggerSyncQueueSummary[_0xed68('0x8f')](_0xed68('0xa1'),_0x2f3207[_0xed68('0x3e')],_0xed68('0x9f'));}else{_0x2f3207[_0xed68('0x3d')]=_0xed68('0xa0');loggerSyncQueueSummary[_0xed68('0x8f')](_0xed68('0xa1'),_0x2f3207[_0xed68('0x3e')],_0xed68('0xa2'));}emitCampaignSummary(_0x2f3207);}}function createObjHistory(_0x16bdf3,_0x3371bc,_0x11044a,_0x29edb5,_0x2d8c97){_0x16bdf3[_0xed68('0x3d')]=_0x11044a;var _0x5e5b05=new Action(_0x16bdf3,_0x3371bc);var _0x587770=new History(_0x5e5b05);_0x587770['state']=_0x29edb5;_0x587770[_0xed68('0xa3')]=_0x2d8c97;_0x587770[_0xed68('0xa4')]=_0x5e5b05[_0xed68('0xa5')];return _0x587770;}Dialer[_0xed68('0x18')]['loopClearZombieChannels']=function(){var _0x416f77=this;setInterval(function(){_0x416f77[_0xed68('0xa6')](_0x416f77[_0xed68('0xa7')],_0xed68('0xa8'));_0x416f77[_0xed68('0xa6')](_0x416f77['actions'],_0xed68('0xa9'));},0x32c8);};Dialer[_0xed68('0x18')][_0xed68('0xa6')]=function(_0x457679,_0x6be95){var _0x5cb57f=this;for(var _0x442cbe in _0x457679){if(typeof _0x457679[_0x442cbe]!==_0xed68('0xaa')){this[_0xed68('0x1c')][_0xed68('0x19')](function(){if(!_[_0xed68('0xab')](_0x457679[_0x442cbe])){return ami['Action']({'action':'status','channel':_0x457679[_0x442cbe][_0xed68('0xac')]})[_0xed68('0xad')](function(_0x1e4bb9){if(_0x1e4bb9[_0xed68('0x3d')]===_0xed68('0xae')){setTimeout(function(){if(_0x457679[_0x442cbe]&&_0x457679[_0x442cbe][_0xed68('0x52')]!==_0xed68('0x72')){_0x5cb57f[_0xed68('0xaf')](_0x5cb57f[_0xed68('0x1e')][_0x457679[_0x442cbe][_0xed68('0xb0')]]);logger[_0xed68('0x8f')](_0xed68('0xb1'),_0x6be95,_0x442cbe,_0x457679[_0x442cbe][_0xed68('0xb0')]);delete _0x457679[_0x442cbe];}if(_0x457679[_0x442cbe]&&_0x457679[_0x442cbe][_0xed68('0x52')]===_0xed68('0x72')){_0x5cb57f['updateOriginated'](_0x5cb57f['campaigns'][_0x457679[_0x442cbe][_0xed68('0xb0')]]);logger['error'](_0xed68('0xb2'),_0x6be95,_0x442cbe,_0x457679[_0x442cbe][_0xed68('0xb0')]);delete _0x457679[_0x442cbe];}},0x2328);}});}});}}};Dialer[_0xed68('0x18')][_0xed68('0xb3')]=function(_0x43247f){return BPromise[_0xed68('0xb4')]()[_0xed68('0xb5')](cmHopper[_0xed68('0xb3')](_0x43247f))[_0xed68('0xad')](loggerCatch(_0xed68('0xb6')));};Dialer[_0xed68('0x18')]['checkIsBlackList']=function(_0x2dc07f){return BPromise[_0xed68('0xb4')]()[_0xed68('0xb5')](cmHopperBlack[_0xed68('0xb7')](_0x2dc07f))[_0xed68('0xad')](loggerCatch(_0xed68('0xb8')));};Dialer[_0xed68('0x18')][_0xed68('0xb9')]=function(_0x594117){return BPromise[_0xed68('0xb4')]()[_0xed68('0xb5')](cmHopperBlack['checkIsBlackListIvr'](_0x594117))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xed68('0x18')][_0xed68('0xba')]=function(_0x4cf453){return BPromise['resolve']()[_0xed68('0xb5')](cmHopperHistory[_0xed68('0xbb')](_0x4cf453))['catch'](loggerCatch(_0xed68('0xbc')));};Dialer['prototype'][_0xed68('0xbd')]=function(_0x30e0f7){return BPromise['resolve']()['then'](cmHopper[_0xed68('0xbd')](_0x30e0f7))['catch'](loggerCatch(_0xed68('0xbe')));};Dialer[_0xed68('0x18')][_0xed68('0xbf')]=function(_0x62523,_0x1205b8,_0x4331b3){return BPromise[_0xed68('0xb4')]()['then'](cmHopper[_0xed68('0xbf')](_0x62523,_0x1205b8,_0x4331b3))['catch'](loggerCatch(_0xed68('0xc0')));};Dialer[_0xed68('0x18')]['getContactDialer']=function(_0x2535d6,_0x4f89f6,_0x5bc830,_0x220724,_0x551ddc){return BPromise['resolve']()[_0xed68('0xb5')](cmHopper[_0xed68('0xc1')](_0x2535d6,_0x4f89f6,_0x5bc830,_0x220724))[_0xed68('0xad')](function(_0x169144){_0x551ddc['temp']-=_0x5bc830;_0x551ddc[_0xed68('0xc2')]=_0x551ddc[_0xed68('0xc2')]>0x0?_0x551ddc[_0xed68('0xc2')]:0x0;loggerCatch(_0xed68('0xc3'))(_0x169144);});};Dialer['prototype']['getContactDialerIvr']=function(_0x2c968d,_0x573f62,_0x46fb45,_0x1fa18e){return BPromise[_0xed68('0xb4')]()['then'](cmHopper['getContactDialerIvr'](_0x2c968d,_0x573f62,_0x46fb45))[_0xed68('0xad')](function(_0xe79d4b){_0x1fa18e[_0xed68('0xc2')]-=_0x573f62;_0x1fa18e[_0xed68('0xc2')]=_0x1fa18e[_0xed68('0xc2')]>0x0?_0x1fa18e[_0xed68('0xc2')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xe79d4b);});};Dialer['prototype'][_0xed68('0xc4')]=function(_0x444a8b){return BPromise[_0xed68('0xb4')]()['then'](voiceQueueRt[_0xed68('0xc4')](_0x444a8b))[_0xed68('0xad')](loggerCatch(_0xed68('0xc5')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x332fbc){return BPromise[_0xed68('0xb4')]()[_0xed68('0xb5')](cmHopper[_0xed68('0xc6')](_0x332fbc))[_0xed68('0xad')](loggerCatch(_0xed68('0xc7')));};Dialer['prototype'][_0xed68('0xc8')]=function(_0x413ddd){return BPromise['resolve']()[_0xed68('0xb5')](cmHopperHistory[_0xed68('0xc8')](_0x413ddd))[_0xed68('0xad')](loggerCatch(_0xed68('0xc9')));};Dialer[_0xed68('0x18')][_0xed68('0xaf')]=function(_0x1f6bac){if(!_[_0xed68('0x80')](_0x1f6bac)&&_0x1f6bac!==null){if(typeof _0x1f6bac['originated']!==_0xed68('0xaa')){if(_0x1f6bac[_0xed68('0x93')]>0x0){_0x1f6bac['originated']-=0x1;}else{logger[_0xed68('0x8f')](_0xed68('0xca'));}}}else{logger[_0xed68('0x8f')](_0xed68('0xcb'));}};Dialer[_0xed68('0x18')][_0xed68('0xcc')]=function(_0x105491,_0x2005ea){var _0x3b7572=this;return function(_0x54877d){_0x3b7572[_0xed68('0xaf')](_0x2005ea);logger[_0xed68('0x8f')](_0x105491,util[_0xed68('0x90')](_0x54877d,{'showHidden':![],'depth':null}));};};Dialer[_0xed68('0x18')][_0xed68('0xcd')]=function(_0x40a4a3,_0x41d149,_0x565529){var _0x37f765={'state':0x19,'statedesc':_0xed68('0xce')};this['updateOriginated'](_0x41d149);this['saveInDb'](_['merge'](_0x37f765,_['pick'](_0x565529,[_0xed68('0xcf'),'ListId',_0xed68('0xd0'),'VoiceQueueId',_0xed68('0xd1')])),_0xed68('0xd2'),_0xed68('0xd3'));logger['error'](_0x40a4a3);};Dialer['prototype'][_0xed68('0xd4')]=function(_0x4f37f3){return _0x4f37f3===_0xed68('0xd5');};Dialer[_0xed68('0x18')]['isTrunkReachable']=function(_0x21fcf7){return!_['isUndefined'](_0x21fcf7)&&_0x21fcf7&&!_[_0xed68('0x80')](_0x21fcf7[_0xed68('0x3e')])&&!_['isUndefined'](_0x21fcf7[_0xed68('0xd6')])&&_0x21fcf7[_0xed68('0xd6')]&&(this[_0xed68('0x21')][util[_0xed68('0x70')](_0xed68('0xd7'),_0x21fcf7[_0xed68('0x3e')])][_0xed68('0xd8')]===_0xed68('0xd9')||this['trunks'][util[_0xed68('0x70')](_0xed68('0xd7'),_0x21fcf7[_0xed68('0x3e')])]['status']===_0xed68('0xda'));};Dialer[_0xed68('0x18')][_0xed68('0xdb')]=function(_0x44fa74,_0x587f7c,_0x3fe987){this[_0xed68('0xc8')](_0x44fa74)[_0xed68('0xad')](loggerCatch(_0x587f7c));this[_0xed68('0xc6')](_0x44fa74)[_0xed68('0xad')](loggerCatch(_0x3fe987));};Dialer[_0xed68('0x18')][_0xed68('0x38')]=function(_0x136896){var _0x1b062a=this['uniqueId'][_0x136896[_0xed68('0xdc')]];var _0x196504;if(!_[_0xed68('0xab')](_0x136896)&&!_['isNil'](_0x136896[_0xed68('0xdd')])&&!_[_0xed68('0xab')](_0x136896[_0xed68('0xdd')][_0xed68('0xde')])&&_0x136896[_0xed68('0xdf')]==='xcally-motion-dialer'&&_0x1b062a){if(_0x1b062a[_0xed68('0x52')]!==_0xed68('0x72')&&this['voiceQueues'][_0x1b062a[_0xed68('0xb0')]][_0xed68('0xe0')]&&_0x136896['value']===_0xed68('0xe1')){delete this[_0xed68('0xa7')][_0x136896[_0xed68('0xdc')]];this[_0xed68('0xaf')](this[_0xed68('0x1e')][_0x1b062a['queue']]);this[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]][_0xed68('0x5b')]+=0x1;_0x196504=new Hangup(_0x1b062a,_0x136896);_0x196504[_0xed68('0xe2')]=0x12;_0x196504['statedesc']='HangupInAMD';_0x196504[_0xed68('0xe3')]=_0xed68('0xe4');ami[_0xed68('0x4b')](_0xed68('0xe5'),ut[_0xed68('0xe6')](_0x196504,_0xed68('0xe7')));this[_0xed68('0xdb')](_0x196504,_0xed68('0xe8'),_0xed68('0xe9'));}if(_0x1b062a[_0xed68('0x52')]!==_0xed68('0x72')&&this[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]][_0xed68('0xe0')]&&_0x136896[_0xed68('0xea')]===_0xed68('0xeb')){var _0x39e5b4=this;return new BPromise(function(_0x49396f,_0x748e0f){delete _0x39e5b4[_0xed68('0xa7')][_0x136896['uniqueid']];_0x39e5b4[_0xed68('0xaf')](_0x39e5b4[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]]);_0x39e5b4[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x39e5b4[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]][_0xed68('0x5b')]+=0x1;var _0x574016=_0x39e5b4[_0xed68('0x1e')][_0x1b062a[_0xed68('0xb0')]];var _0x925a4c=new Hangup(_0x1b062a,_0x136896);_0x925a4c[_0xed68('0xe2')]=0x13;_0x925a4c[_0xed68('0xa3')]='Machine';_0x925a4c[_0xed68('0xe3')]='AMD';_0x925a4c[_0xed68('0xec')]+=0x1;_0x925a4c[_0xed68('0xed')]+=0x1;_0x925a4c['amd']=!![];ami[_0xed68('0x4b')](_0xed68('0xe5'),ut[_0xed68('0xe6')](_0x925a4c,_0xed68('0xe7')));_0x39e5b4[_0xed68('0xc8')](_0x925a4c)[_0xed68('0xad')](loggerCatch(_0xed68('0xee')));if(_0x925a4c[_0xed68('0xef')]+_0x925a4c[_0xed68('0xf0')]+_0x925a4c[_0xed68('0xf1')]+_0x925a4c[_0xed68('0xf2')]+_0x925a4c[_0xed68('0xf3')]+_0x925a4c[_0xed68('0xf4')]+_0x925a4c[_0xed68('0xec')]+_0x925a4c[_0xed68('0xf5')]>=_0x574016['dialGlobalMaxRetry']){_0x39e5b4[_0xed68('0xf6')](_0x925a4c,_0x49396f,_0x748e0f,_0xed68('0xf7'));}else{if(_0x925a4c[_0xed68('0xec')]>=_0x574016[_0xed68('0xf8')]){_0x39e5b4[_0xed68('0xf9')](_0x925a4c,_0x49396f,_0x748e0f,_0xed68('0xfa'));}else{_0x39e5b4['rescheduleContact']({'active':![],'countmachineretry':_0x925a4c['countmachineretry'],'scheduledat':moment()[_0xed68('0xfb')](_0x574016[_0xed68('0xfc')],'minutes')['format'](_0xed68('0xfd')),'ContactId':_0x925a4c[_0xed68('0xcf')],'ListId':_0x925a4c[_0xed68('0xfe')],'VoiceQueueId':_0x925a4c['VoiceQueueId']||undefined,'CampaignId':_0x925a4c['CampaignId']||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0xff')));_0x49396f({'reschedule':0x1});}}});}if(_0x1b062a['type']===_0xed68('0x72')&&this[_0xed68('0x1f')][_0x1b062a['queue']]['dialAMDActive']&&_0x136896[_0xed68('0xea')]===_0xed68('0xe1')){delete this[_0xed68('0xa7')][_0x136896[_0xed68('0xdc')]];this[_0xed68('0xaf')](this[_0xed68('0x1f')][_0x1b062a[_0xed68('0xb0')]]);_0x196504=new Hangup(_0x1b062a,_0x136896);_0x196504['state']=0x12;_0x196504[_0xed68('0xa3')]='HangupInAMD';_0x196504[_0xed68('0xe3')]='AMD';ami[_0xed68('0x4b')](_0xed68('0xe5'),ut[_0xed68('0xe6')](_0x196504,_0xed68('0xe7')));this[_0xed68('0xdb')](_0x196504,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x1b062a[_0xed68('0x52')]==='ivr'&&this[_0xed68('0x1f')][_0x1b062a[_0xed68('0xb0')]][_0xed68('0xe0')]&&_0x136896[_0xed68('0xea')]===_0xed68('0xeb')){var _0x39e5b4=this;return new BPromise(function(_0x445273,_0x48e8b0){delete _0x39e5b4[_0xed68('0xa7')][_0x136896[_0xed68('0xdc')]];_0x39e5b4[_0xed68('0xaf')](_0x39e5b4[_0xed68('0x1f')][_0x1b062a['queue']]);_0x39e5b4[_0xed68('0x1f')][_0x1b062a['queue']][_0xed68('0x5c')]+=0x1;_0x39e5b4[_0xed68('0x1f')][_0x1b062a[_0xed68('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4ac8f2=_0x39e5b4[_0xed68('0x1f')][_0x1b062a['queue']];var _0x4ec8f6=new Hangup(_0x1b062a,_0x136896);_0x4ec8f6[_0xed68('0xe2')]=0x13;_0x4ec8f6[_0xed68('0xa3')]=_0xed68('0x100');_0x4ec8f6[_0xed68('0xe3')]=_0xed68('0xe4');_0x4ec8f6[_0xed68('0xec')]+=0x1;_0x4ec8f6['countglobal']+=0x1;_0x4ec8f6['amd']=!![];ami[_0xed68('0x4b')]('custom:amd',ut[_0xed68('0xe6')](_0x4ec8f6,_0xed68('0xe7')));_0x39e5b4['createHistory'](_0x4ec8f6)[_0xed68('0xad')](loggerCatch(_0xed68('0xee')));if(_0x4ec8f6[_0xed68('0xef')]+_0x4ec8f6[_0xed68('0xf0')]+_0x4ec8f6[_0xed68('0xf1')]+_0x4ec8f6[_0xed68('0xf2')]+_0x4ec8f6['countdropretry']+_0x4ec8f6['countabandonedretry']+_0x4ec8f6['countmachineretry']+_0x4ec8f6[_0xed68('0xf5')]>=_0x4ac8f2[_0xed68('0x101')]){_0x39e5b4['stateGlobal'](_0x4ec8f6,_0x445273,_0x48e8b0,_0xed68('0xf7'));}else{if(_0x4ec8f6[_0xed68('0xec')]>=_0x4ac8f2[_0xed68('0xf8')]){_0x39e5b4[_0xed68('0xf9')](_0x4ec8f6,_0x445273,_0x48e8b0,_0xed68('0xfa'));}else{_0x39e5b4[_0xed68('0xbd')]({'active':![],'countmachineretry':_0x4ec8f6[_0xed68('0xec')],'scheduledat':moment()[_0xed68('0xfb')](_0x4ac8f2[_0xed68('0xfc')],'minutes')[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4ec8f6[_0xed68('0xcf')],'ListId':_0x4ec8f6['ListId'],'VoiceQueueId':_0x4ec8f6[_0xed68('0x102')]||undefined,'CampaignId':_0x4ec8f6[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0xff')));_0x445273({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xed68('0x34')]=function(_0x2f9d45){var _0x389044=this[_0xed68('0xa7')][_0x2f9d45['uniqueid']];var _0x5c0728=this;var _0x58b84d;if(_0x389044&&_0x389044[_0xed68('0x52')]===_0xed68('0x72')){delete this[_0xed68('0xa7')][_0x2f9d45[_0xed68('0xdc')]];this[_0xed68('0xaf')](this[_0xed68('0x1f')][_0x389044[_0xed68('0xb0')]]);this[_0xed68('0x1f')][_0x389044['queue']][_0xed68('0x103')]+=0x1;_0x58b84d=new Hangup(_0x389044,_0x2f9d45);this[_0xed68('0xc8')](_0x58b84d)[_0xed68('0xad')](loggerCatch(_0xed68('0x104')));this[_0xed68('0xc6')](_0x58b84d)['catch'](loggerCatch(_0xed68('0x105')));}if(_0x389044&&_0x389044['type']!==_0xed68('0x72')&&isNotNull(this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]][_0xed68('0x106')])){delete this[_0xed68('0xa7')][_0x2f9d45['uniqueid']];this[_0xed68('0xaf')](this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]]);this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]][_0xed68('0x5c')]+=0x1;this[_0xed68('0x1e')][_0x389044['queue']][_0xed68('0x5b')]+=0x1;_0x58b84d=new Hangup(_0x389044,_0x2f9d45);_0x58b84d[_0xed68('0xe2')]=0x10;_0x58b84d[_0xed68('0xa3')]=_0xed68('0x107');_0x58b84d[_0xed68('0xe3')]=_0xed68('0x108');this[_0xed68('0xc8')](_0x58b84d)[_0xed68('0xad')](loggerCatch(_0xed68('0x104')));this[_0xed68('0xc6')](_0x58b84d)[_0xed68('0xad')](loggerCatch(_0xed68('0x105')));}if(_0x389044&&_0x389044[_0xed68('0x52')]!==_0xed68('0x72')&&!isNotNull(this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]]['dialQueueProject'])){delete this[_0xed68('0xa7')][_0x2f9d45[_0xed68('0xdc')]];this[_0xed68('0xaf')](this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]]);this[_0xed68('0x1e')][_0x389044[_0xed68('0xb0')]][_0xed68('0x66')]+=0x1;_0x58b84d=new Hangup(_0x389044,_0x2f9d45);_0x58b84d[_0xed68('0xe2')]=0xc;_0x58b84d['statedesc']=_0x2f9d45[_0xed68('0x109')];_0x58b84d[_0xed68('0xe3')]=_0xed68('0x10a');this['createHistory'](_0x58b84d)[_0xed68('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xed68('0xc6')](_0x58b84d)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xed68('0x18')][_0xed68('0x31')]=function(_0x5f5d31){var _0x1bd4af=this[_0xed68('0xa7')][_0x5f5d31['uniqueid']];var _0x55aee9=this;if(this[_0xed68('0x1e')][_0x5f5d31[_0xed68('0xb0')]]){if(_0x1bd4af&&_0x1bd4af[_0xed68('0x52')]!==_0xed68('0x72')){delete this['uniqueId'][_0x5f5d31[_0xed68('0xdc')]];this[_0xed68('0x1e')][_0x5f5d31[_0xed68('0xb0')]][_0xed68('0x5c')]+=0x1;var _0x45dc65=new AgentComplete(_0x1bd4af,_0x5f5d31);if(_0x5f5d31[_0xed68('0x10b')]===_0xed68('0x10c')){_0x45dc65[_0xed68('0x10d')]=this[_0xed68('0x1e')][_0x5f5d31[_0xed68('0xb0')]][_0xed68('0x10e')]&&this['voiceQueues'][_0x5f5d31[_0xed68('0xb0')]][_0xed68('0x10f')]?moment()[_0xed68('0x70')](_0xed68('0xfd')):undefined;}this['createHistory'](_0x45dc65)[_0xed68('0xad')](loggerCatch(_0xed68('0x110')));this[_0xed68('0xc6')](_0x45dc65)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xed68('0x18')][_0xed68('0x2a')]=function(_0x2245b5){if(this[_0xed68('0x1e')][_0x2245b5[_0xed68('0xb0')]]){if(this[_0xed68('0xa7')][_0x2245b5[_0xed68('0xdc')]]&&this[_0xed68('0xa7')][_0x2245b5[_0xed68('0xdc')]][_0xed68('0x52')]!==_0xed68('0x72')){this['updateOriginated'](this[_0xed68('0x1e')][_0x2245b5[_0xed68('0xb0')]]);this[_0xed68('0xa7')][_0x2245b5[_0xed68('0xdc')]][_0xed68('0x111')]=moment()[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xed68('0x18')][_0xed68('0x112')]=function(_0x2645cf){this[_0xed68('0xc8')](_0x2645cf)['catch'](loggerCatch(_0xed68('0x110')));this['moveContactManagedDialer'](_0x2645cf)[_0xed68('0xad')](loggerCatch(_0xed68('0x113')));};Dialer[_0xed68('0x18')][_0xed68('0x2c')]=function(_0x1a5f49){var _0x467fcf=this[_0xed68('0xa7')][_0x1a5f49[_0xed68('0xdc')]];var _0x339f9c=this;if(this['voiceQueues'][_0x1a5f49[_0xed68('0xb0')]]){if(_0x467fcf&&_0x467fcf[_0xed68('0x52')]!=='ivr'){delete this[_0xed68('0xa7')][_0x1a5f49[_0xed68('0xdc')]];this[_0xed68('0xaf')](this[_0xed68('0x1e')][_0x1a5f49[_0xed68('0xb0')]]);_0x467fcf[_0xed68('0x114')]=moment()['format'](_0xed68('0xfd'));var _0xe0ee0=new QueueCallerAbandon(_0x467fcf,_0x1a5f49);if(getSeconds(_0x467fcf['droptime'],_0x467fcf[_0xed68('0x115')])>=_0x467fcf['dialQueueTimeout']){this[_0xed68('0x1e')][_0x1a5f49[_0xed68('0xb0')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x1a5f49['queue']][_0xed68('0x116')]+=0x1;this[_0xed68('0x1e')][_0x1a5f49['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xe0ee0[_0xed68('0xe2')]=0xa;_0xe0ee0[_0xed68('0xa3')]=_0xed68('0x117');_0xe0ee0[_0xed68('0x118')]='TIMEOUT';_0xe0ee0[_0xed68('0x10d')]=this[_0xed68('0x1e')][_0x1a5f49['queue']][_0xed68('0x10e')]?moment()[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xe0ee0[_0xed68('0xf3')]+=0x1;_0xe0ee0['countglobal']+=0x1;if(_0xe0ee0['countdropretry']>=this[_0xed68('0x1e')][_0x1a5f49[_0xed68('0xb0')]][_0xed68('0x119')]){this[_0xed68('0x112')](_0xe0ee0);}else{this['rescheduleContact']({'active':![],'countdropretry':_0xe0ee0[_0xed68('0xf3')],'scheduledat':moment()[_0xed68('0xfb')](this['voiceQueues'][_0x1a5f49[_0xed68('0xb0')]][_0xed68('0x11a')],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x467fcf['ContactId'],'ListId':_0x467fcf[_0xed68('0xfe')],'VoiceQueueId':_0x467fcf[_0xed68('0x102')]||undefined,'CampaignId':_0x467fcf[_0xed68('0xd1')]||undefined})['catch'](loggerCatch(_0xed68('0x11c')));var _0x2a638c=new History(_0xe0ee0);_0x2a638c[_0xed68('0xe2')]=0xa;_0x2a638c['statedesc']=_0xed68('0x117');_0x2a638c[_0xed68('0xa5')]=moment()[_0xed68('0x70')](_0xed68('0xfd'));_0x2a638c[_0xed68('0xa4')]=_0x2a638c[_0xed68('0xa5')];_0x2a638c['calleridname']=_0xe0ee0[_0xed68('0x11d')];_0x2a638c[_0xed68('0x11e')]=_0xe0ee0['calleridnum'];this[_0xed68('0xc8')](_0x2a638c)[_0xed68('0xad')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xed68('0x1e')][_0x1a5f49[_0xed68('0xb0')]][_0xed68('0x69')]+=0x1;this[_0xed68('0x1e')][_0x1a5f49[_0xed68('0xb0')]][_0xed68('0x11f')]+=0x1;_0xe0ee0[_0xed68('0xe2')]=0xb;_0xe0ee0[_0xed68('0xa3')]=_0xed68('0x120');_0xe0ee0[_0xed68('0x118')]=_0xed68('0x121');_0xe0ee0[_0xed68('0xf4')]+=0x1;_0xe0ee0[_0xed68('0xed')]+=0x1;if(_0xe0ee0[_0xed68('0xf4')]>=this['voiceQueues'][_0x1a5f49[_0xed68('0xb0')]][_0xed68('0x122')]){this['queueCallerAbandonCreateState'](_0xe0ee0);}else{this[_0xed68('0xbd')]({'active':![],'countabandonedretry':_0xe0ee0['countabandonedretry'],'scheduledat':moment()[_0xed68('0xfb')](this['voiceQueues'][_0x1a5f49['queue']][_0xed68('0x123')],_0xed68('0x11b'))['format'](_0xed68('0xfd')),'ContactId':_0x467fcf[_0xed68('0xcf')],'ListId':_0x467fcf[_0xed68('0xfe')],'VoiceQueueId':_0x467fcf[_0xed68('0x102')]||undefined,'CampaignId':_0x467fcf[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x124')));var _0x2a638c=new History(_0xe0ee0);_0x2a638c[_0xed68('0xe2')]=0xb;_0x2a638c[_0xed68('0xa3')]=_0xed68('0x120');_0x2a638c[_0xed68('0xa5')]=moment()['format'](_0xed68('0xfd'));_0x2a638c[_0xed68('0xa4')]=_0x2a638c[_0xed68('0xa5')];_0x2a638c[_0xed68('0x11d')]=_0xe0ee0[_0xed68('0x11d')];_0x2a638c[_0xed68('0x11e')]=_0xe0ee0[_0xed68('0x11e')];this['createHistory'](_0x2a638c)[_0xed68('0xad')](loggerCatch(_0xed68('0x125')));}}}}};Dialer[_0xed68('0x18')][_0xed68('0x36')]=function(_0x18fb49){if(this['actions'][_0x18fb49['uniqueid']]){this['actions'][_0x18fb49[_0xed68('0xdc')]]['channel']=_0x18fb49[_0xed68('0xac')];}if(this[_0xed68('0xa7')][_0x18fb49[_0xed68('0xdc')]]){this[_0xed68('0xa7')][_0x18fb49['uniqueid']][_0xed68('0xac')]=_0x18fb49['channel'];}};Dialer['prototype'][_0xed68('0x3a')]=function(_0x1e01ac){if(strategy[this['voiceQueues'][this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]]['queue']][_0xed68('0x4c')]]===_0xed68('0x128')){if(this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]]&&_[_0xed68('0xab')](this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]][_0xed68('0x129')])&&_0x1e01ac[_0xed68('0xd8')]==='1'&&_0x1e01ac[_0xed68('0x12a')]==='0'){if(this[_0xed68('0x20')][_0x1e01ac[_0xed68('0x12b')]]){if(!this[_0xed68('0x20')][_0x1e01ac[_0xed68('0x12b')]][_0xed68('0x129')]){this[_0xed68('0x20')][_0x1e01ac[_0xed68('0x12b')]][_0xed68('0x129')]=!![];this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]][_0xed68('0x129')]=!![];this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]][_0xed68('0x12b')]=_0x1e01ac[_0xed68('0x12b')];}}}}else if((strategy[this[_0xed68('0x1e')][this[_0xed68('0x126')][_0x1e01ac['actionid']][_0xed68('0xb0')]][_0xed68('0x4c')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x1e01ac['actionid']]){if(this[_0xed68('0x20')][_0x1e01ac[_0xed68('0x12b')]]){this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]][_0xed68('0x12b')]=_0x1e01ac[_0xed68('0x12b')];if(_[_0xed68('0xab')](this[_0xed68('0x27')][this[_0xed68('0x126')][_0x1e01ac['actionid']]['queue']])){this[_0xed68('0x27')][this['actions'][_0x1e01ac[_0xed68('0x127')]][_0xed68('0xb0')]]=[];}this[_0xed68('0x27')][this['actions'][_0x1e01ac['actionid']][_0xed68('0xb0')]][_0xed68('0x12c')](_[_0xed68('0x12d')](_[_0xed68('0x12e')](this[_0xed68('0x126')][_0x1e01ac[_0xed68('0x127')]],[_0xed68('0x12f'),_0xed68('0x12b')]),{'status':_0x1e01ac[_0xed68('0xd8')],'paused':_0x1e01ac['paused']}));}}}};function unlockQueueStatus(_0x24072e,_0x56d919){setTimeout(function(){if(_[_0xed68('0x80')](_0x24072e[_0xed68('0x130')])){loggerBooked[_0xed68('0x8f')]('[unlockQueueStatus][undefined]',_0x56d919);}_0x24072e[_0xed68('0x130')]=!![];loggerBooked[_0xed68('0x75')](_0xed68('0x131'),_0x56d919,JSON[_0xed68('0x48')](_[_0xed68('0x12e')](_0x24072e,['name',_0xed68('0x130')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x49a072){var _0x2fa57d=this;var _0x5a2b3d=_0x2fa57d['voiceQueues'][_0x2fa57d[_0xed68('0x126')][_0x49a072['actionid']][_0xed68('0xb0')]];if(strategy[this[_0xed68('0x1e')][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]][_0xed68('0x4c')]]==='roundrobin'){if(this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]&&this[_0xed68('0x126')][_0x49a072['actionid']][_0xed68('0x12b')]){this[_0xed68('0x1d')][_0xed68('0x132')](this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]['idHopper'],this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]['stateinterface'])['catch'](function(_0x15fd9a){logger[_0xed68('0x8f')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xed68('0x90')](_0x15fd9a,{'showHidden':![],'depth':null}));})[_0xed68('0x1b')](function(){_0x2fa57d[_0xed68('0xaf')](_0x2fa57d['voiceQueues'][_0x2fa57d[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]['queue']]);_0x2fa57d[_0xed68('0x20')][_0x2fa57d[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]['stateinterface']][_0xed68('0x129')]=![];delete _0x2fa57d[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]];unlockQueueStatus(_0x5a2b3d);});}else{this[_0xed68('0xaf')](this[_0xed68('0x1e')][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xcf')],'ListId':this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xfe')],'VoiceQueueId':this['actions'][_0x49a072['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x49a072[_0xed68('0x127')]][_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x133')));delete this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]];unlockQueueStatus(_0x5a2b3d);}}else if((strategy[this[_0xed68('0x1e')][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]][_0xed68('0x4c')]]||_0xed68('0x17'))===_0xed68('0x17')){var _0x16df8;if(this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]]&&!_[_0xed68('0x45')](this['queueBooked'][this['actions'][_0x49a072['actionid']][_0xed68('0xb0')]])){if(this[_0xed68('0x28')][_0x2fa57d[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]]){this[_0xed68('0x28')][_0x2fa57d['actions'][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]]=this[_0xed68('0x28')][this[_0xed68('0x126')][_0x49a072['actionid']][_0xed68('0xb0')]]?this[_0xed68('0x28')][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]]:this['queueBooked'][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]]?this['queueBooked'][this[_0xed68('0x126')][_0x49a072[_0xed68('0x127')]][_0xed68('0xb0')]][_0xed68('0x134')]||0x0:0x0;}this[_0xed68('0x27')][this[_0xed68('0x126')][_0x49a072['actionid']][_0xed68('0xb0')]][_0xed68('0x134')]=this[_0xed68('0x28')][this[_0xed68('0x126')][_0x49a072['actionid']][_0xed68('0xb0')]];for(var _0x25514b=0x0;_0x25514b=0x0;})[_0xed68('0xad')](myreject(_0x4e10c7)));}}else{_0x22379e[_0xed68('0x12c')](ami['Action']({'action':_0xed68('0x14e'),'command':util[_0xed68('0x70')](_0xed68('0x14f'),_0x4bf0e9,!_[_0xed68('0x80')](config[_0xed68('0x151')][_0x1ceafe])?_0x1ceafe:'')})['then'](function(_0xac0bad){return _0xac0bad[_0xed68('0x152')][_0xed68('0x153')](_0xed68('0x154'))>=0x0;})['catch'](myreject(_0x4e10c7)));}BPromise['all'](_0x22379e)[_0xed68('0xb5')](function(_0x2b2ca5){var _0x1a7a2d=_[_0xed68('0x155')](_0x2b2ca5);if(_0x1a7a2d){return _0xc96953(_0x1a7a2d);}else{_0x542493[_0xed68('0x3d')]=_0x18d09b?_0xed68('0x156'):'INTERVAL_IS_OVERTIME';return _0x4e10c7(msgResponse(_0xed68('0x157'),_0xed68('0x149'),_0xed68('0x158')+_0x18d09b+'\x20'+_0x18cac0+_0xed68('0x159')+util[_0xed68('0x90')](_0x4bf0e9,{'showHidden':![],'depth':null})+_0xed68('0x15a')+_0x1ceafe));}})[_0xed68('0xad')](function(_0xe80b82){return _0x4e10c7(msgResponse(_0xed68('0x146'),_0xed68('0x149'),JSON['stringify'](_0xe80b82)));});});};Dialer[_0xed68('0x18')][_0xed68('0x15b')]=function(_0x5bcf65){var _0x13b038=this;return function(){switch(_0x5bcf65[_0xed68('0x57')]){case _0xed68('0x15c'):freeVariablesPredictive(_0x5bcf65);_0x13b038['handlePower'](_0x5bcf65,0x1);break;case _0xed68('0x15d'):freeVariablesPredictive(_0x5bcf65);_0x13b038[_0xed68('0x15e')](_0x5bcf65,_0x5bcf65[_0xed68('0x15f')]);break;case _0xed68('0x160'):_0x13b038[_0xed68('0x160')](_0x5bcf65);break;case _0xed68('0x7'):freeVariablesPredictive(_0x5bcf65);_0x13b038['handlePower'](_0x5bcf65,0x1);break;default:freeVariablesPredictive(_0x5bcf65);logger[_0xed68('0x8f')](_0xed68('0x161'),_0x5bcf65[_0xed68('0x3e')],_0xed68('0x162'));}};};Dialer[_0xed68('0x18')]['launchHandleIvr']=function(_0x50ccaa){var _0x47a4e1=this;return function(){_0x47a4e1[_0xed68('0x163')](_0x50ccaa);};};Dialer[_0xed68('0x18')][_0xed68('0x33')]=function(_0x55a1b2){var _0x50fd3f=this;if(isNotPreview(_0x55a1b2[_0xed68('0x57')])){if(isVoiceQueueOutbound(_0x55a1b2[_0xed68('0x52')])&&isActive(_0x55a1b2[_0xed68('0x56')])){_0x55a1b2[_0xed68('0x9b')]=!![];BPromise[_0xed68('0xb4')]()['then'](checkIsLoggedIn(_0x55a1b2,_0x55a1b2[_0xed68('0x4e')]))['then'](checkIsActive(_0x55a1b2,_0x55a1b2[_0xed68('0x56')]))['then'](checkInterval(_0x55a1b2))[_0xed68('0xb5')](_0x50fd3f['checkIsTrunkReachable'](_0x55a1b2))[_0xed68('0xb5')](_0x50fd3f['checkIfTime'](_0x55a1b2[_0xed68('0x164')],_0x55a1b2['dialTimezone'],_0x55a1b2[_0xed68('0x3e')],_0x55a1b2))['then'](_0x50fd3f[_0xed68('0x147')](_0x55a1b2[_0xed68('0x41')],_0x55a1b2[_0xed68('0x165')],_0x55a1b2[_0xed68('0x3e')],_0x55a1b2))['then'](_0x50fd3f[_0xed68('0x15b')](_0x55a1b2))[_0xed68('0xad')](loggerCatchQueueSummary(_0xed68('0x166'),_0x55a1b2));}else{notSendMessagesQueue(_0x55a1b2);}}else{freeVariablesPredictive(_0x55a1b2);}};Dialer[_0xed68('0x18')]['syncCampaigns']=function(){var _0x54421f=this;var _0xbeb759;for(var _0x5c608d in this[_0xed68('0x1f')]){if(typeof this[_0xed68('0x1f')][_0x5c608d]!==_0xed68('0xaa')){_0xbeb759=this[_0xed68('0x1f')][_0x5c608d];if(isCampaignIvr(_0xbeb759[_0xed68('0x52')])&&isActive(_0xbeb759['active'])){_0xbeb759[_0xed68('0x9b')]=!![];BPromise[_0xed68('0xb4')]()[_0xed68('0xb5')](checkIsActive(_0xbeb759,_0xbeb759['active']))['then'](checkInterval(_0xbeb759))['then'](_0x54421f['checkIsTrunkReachable'](_0xbeb759))[_0xed68('0xb5')](_0x54421f[_0xed68('0x167')](_0xbeb759[_0xed68('0x164')],_0xbeb759[_0xed68('0x165')],_0xbeb759[_0xed68('0x3e')],_0xbeb759))[_0xed68('0xb5')](_0x54421f[_0xed68('0x147')](_0xbeb759[_0xed68('0x41')],_0xbeb759[_0xed68('0x165')],_0xbeb759['name'],_0xbeb759))['then'](_0x54421f['launchHandleIvr'](_0xbeb759))['catch'](loggerCatchQueueSummary(_0xed68('0x168'),_0xbeb759));}else{notSendMessagesCampaign(_0xbeb759);}}}};function getCallerIdRandom(_0x453a1b,_0x60f87e){var _0xb7f3be;var _0x15fb59;var _0x439eaa;if(_0x60f87e<=0x0){_0x60f87e=0x1;}_0xb7f3be=new RegExp(_0xed68('0x169')+_0x60f87e+'}$');_0x15fb59=Math[_0xed68('0x16a')](0xa,_0x60f87e-0x1);_0x439eaa=Math[_0xed68('0x16a')](0xa,_0x60f87e)-0x1;return util[_0xed68('0x70')]('%s',_[_0xed68('0x16b')](_0x453a1b,_0xb7f3be,_[_0xed68('0x16c')](_0x15fb59,_0x439eaa)));}function extractCalleridName(_0x429afa){var _0x2dc874=_0x429afa[_0xed68('0x16d')](/"(.*?)"/);return _0x2dc874?_0x2dc874[0x1]:_0x429afa;}function extractCalleridNumber(_0x5e77a4){var _0x154981=_0x5e77a4[_0xed68('0x16d')](/<(.*?)>/);return _0x154981?_0x154981[0x1]:_0x5e77a4;}Dialer[_0xed68('0x18')]['actionOriginate']=function(_0x51bfd0,_0x379d19){var _0x52d7ab=this;var _0x2a31eb=uuid['v4']();this[_0xed68('0x126')][_0x2a31eb]=new Action(_0x51bfd0,_0x379d19,_0x2a31eb);return new BPromise(function(_0x3dee16,_0x5221d9){if(_[_0xed68('0x80')](_0x51bfd0)&&typeof _0x51bfd0!==_0xed68('0x16e')){return _0x5221d9(msgResponse(_0xed68('0x16f'),_0xed68('0x149'),_0xed68('0x170')));}if(_[_0xed68('0x80')](_0x379d19[_0xed68('0x171')][_0xed68('0x172')])||_0x379d19[_0xed68('0x171')][_0xed68('0x172')]===null){return _0x5221d9(msgResponse(_0xed68('0x16f'),_0xed68('0x149'),_0xed68('0x173')));}var _0x4d092c={'XMD-CALLERID':_0x52d7ab[_0xed68('0x126')][_0x2a31eb][_0xed68('0x174')](),'XMD-AGI':_0x51bfd0[_0xed68('0x106')]?util[_0xed68('0x70')](_0xed68('0x175'),ipAgi,_0x51bfd0[_0xed68('0x106')]):_0xed68('0x176'),'XMD-AGIAFTER':_0x51bfd0[_0xed68('0x10e')]?util[_0xed68('0x70')]('\x22agi://%s/square,%s\x22',ipAgi,_0x51bfd0[_0xed68('0x10e')]):_0xed68('0x176'),'XMD-QUEUE':_0x51bfd0['type']===_0xed68('0x177')?util[_0xed68('0x70')](_0xed68('0x178'),_0x51bfd0['name'],_0x51bfd0[_0xed68('0x179')]||'',_0x51bfd0['dialAgiAfterHangupAgent']?'c':'',_0x51bfd0['dialQueueTimeout']||0x3):_0xed68('0x176'),'XMD-CONTACTID':_0x379d19['ContactId'],'XMD-CDRTYPE':_0xed68('0x6'),'CALLERID(all)':_0x52d7ab[_0xed68('0x126')][_0x2a31eb][_0xed68('0x174')](),'XMD-AMD':_0x51bfd0[_0xed68('0xe0')]?_0xed68('0x17a'):_0xed68('0x176'),'XMD-DESTINATION':_0xed68('0x17b')};if(_0x51bfd0[_0xed68('0xe0')]){_0x4d092c[_0xed68('0x17c')]=_0x51bfd0[_0xed68('0x17d')]||0x9c4;_0x4d092c[_0xed68('0x17e')]=_0x51bfd0['dialAMDGreeting']||0x5dc;_0x4d092c[_0xed68('0x17f')]=_0x51bfd0[_0xed68('0x180')]||0x320;_0x4d092c[_0xed68('0x181')]=_0x51bfd0['dialAMDTotalAnalysisTime']||0x1388;_0x4d092c[_0xed68('0x182')]=_0x51bfd0[_0xed68('0x183')]||0x64;_0x4d092c[_0xed68('0x184')]=_0x51bfd0['dialAMDBetweenWordsSilence']||0x32;_0x4d092c['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x51bfd0['dialAMDMaximumNumberOfWords']||0x3;_0x4d092c['XMD-AMDSILENCETHRESHOLD']=_0x51bfd0['dialAMDSilenceThreshold']||0x100;_0x4d092c[_0xed68('0x185')]=_0x51bfd0['dialAMDMaximumWordLength']||0x1388;}if(_0x51bfd0[_0xed68('0x52')]==='outbound'){_0x4d092c[_0xed68('0x186')]=_0x379d19[_0xed68('0x102')];}else{_0x4d092c[_0xed68('0x187')]=_0x379d19[_0xed68('0xd1')];}for(var _0x50772e in _0x379d19[_0xed68('0x171')]){if(typeof _0x379d19[_0xed68('0x171')][_0x50772e]!==_0xed68('0xaa')){if(isNotNull(_0x379d19[_0xed68('0x171')][_0x50772e])&&_0x50772e!=='id'&&_0x50772e!==_0xed68('0x188')&&_0x50772e!==_0xed68('0x189')&&_0x50772e!=='updatedAt'){_0x4d092c[util[_0xed68('0x70')]('%s%s',_0xed68('0x18a'),_[_0xed68('0x18b')](_0x50772e))]=_0x379d19[_0xed68('0x171')][_0x50772e];}}}var _0x9f4d95=_0x52d7ab[_0xed68('0x143')](_0x51bfd0[_0xed68('0x6f')])?getCallerId(_0x51bfd0['Trunk'][_0xed68('0x18c')],_0x51bfd0[_0xed68('0x18d')],_0x51bfd0[_0xed68('0x18e')]>0x0?getCallerIdRandom(_0x51bfd0[_0xed68('0x58')],_0x51bfd0[_0xed68('0x18e')]):_0x51bfd0['dialOriginateCallerIdNumber']):getCallerId(_[_0xed68('0xab')](_0x51bfd0[_0xed68('0x18f')])?_0x51bfd0['Trunk'][_0xed68('0x18c')]:_0x51bfd0['TrunkBackup'][_0xed68('0x18c')],_0x51bfd0[_0xed68('0x18d')],_0x51bfd0[_0xed68('0x18e')]>0x0?getCallerIdRandom(_0x51bfd0[_0xed68('0x58')],_0x51bfd0[_0xed68('0x18e')]):_0x51bfd0[_0xed68('0x58')]);if(_0x9f4d95){_0x4d092c[_0xed68('0x190')]=_0x52d7ab[_0xed68('0x126')][_0x2a31eb][_0xed68('0x191')]=extractCalleridName(_0x9f4d95);_0x4d092c[_0xed68('0x192')]=_0x52d7ab['actions'][_0x2a31eb][_0xed68('0x193')]=extractCalleridNumber(_0x9f4d95);}return ami[_0xed68('0x14d')]({'actionid':_0x2a31eb,'action':_0xed68('0x16f'),'channel':_0x52d7ab[_0xed68('0x143')](_0x51bfd0[_0xed68('0x6f')])?util[_0xed68('0x70')](_0xed68('0x194'),_0x51bfd0[_0xed68('0x6f')][_0xed68('0x3e')],isNotNull(_0x51bfd0['dialPrefix'])?_0x51bfd0[_0xed68('0x5a')][_0xed68('0x195')]()||'':'',_0x51bfd0['dialCutDigit']>0x0?_0x379d19[_0xed68('0x171')][_0xed68('0x172')][_0xed68('0x196')](_0x51bfd0[_0xed68('0x197')]):_0x379d19[_0xed68('0x171')][_0xed68('0x172')]):util['format'](_0xed68('0x194'),_['isNil'](_0x51bfd0[_0xed68('0x18f')])?_0x51bfd0[_0xed68('0x6f')][_0xed68('0x3e')]:_0x51bfd0[_0xed68('0x18f')][_0xed68('0x3e')],isNotNull(_0x51bfd0[_0xed68('0x5a')])?_0x51bfd0[_0xed68('0x5a')]['trim']()||'':'',_0x51bfd0[_0xed68('0x197')]>0x0?_0x379d19['Contact']['phone'][_0xed68('0x196')](_0x51bfd0['dialCutDigit']):_0x379d19[_0xed68('0x171')][_0xed68('0x172')]),'callerid':_0x9f4d95,'Exten':_0xed68('0x17b'),'Context':_0xed68('0x198'),'Priority':'1','variable':_0x4d092c,'timeout':(_0x51bfd0[_0xed68('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2a31eb})[_0xed68('0xb5')](function(_0x57b492){return _0x3dee16(_0x57b492);})[_0xed68('0xad')](function(_0x235dc9){_0x51bfd0['outboundOriginateFailureCallsDay']+=0x1;var _0x429209=new History(_0x52d7ab[_0xed68('0x126')][_0x2a31eb]);logger[_0xed68('0x8f')](util['format']('[originateError]:\x20%s',JSON['stringify'](_0x235dc9)));_0x429209[_0xed68('0xe2')]=0xe;_0x429209[_0xed68('0xa3')]=_0xed68('0x199');_0x429209[_0xed68('0xa5')]=moment()[_0xed68('0x70')](_0xed68('0xfd'));_0x429209['endtime']=_0x429209[_0xed68('0xa5')];_0x52d7ab[_0xed68('0xc8')](_0x429209)['catch'](loggerCatch(_0xed68('0x19a')));_0x52d7ab[_0xed68('0xc6')](_0x429209)[_0xed68('0xad')](loggerCatch(_0xed68('0x19a')))[_0xed68('0x1b')](function(){delete _0x52d7ab[_0xed68('0x126')][_0x2a31eb];return _0x5221d9(msgResponse(_0xed68('0x16f'),_0xed68('0x47'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xed68('0x2f')]=function(_0xc6a01c){var _0x447ba9=this['actions'][_0xc6a01c[_0xed68('0x127')]];if(_0x447ba9){delete this[_0xed68('0x126')][_0xc6a01c[_0xed68('0x127')]];_0x447ba9[_0xed68('0x115')]=moment()[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1a3288=_0x447ba9[_0xed68('0x52')]===_0xed68('0x72')?this['campaigns'][_0x447ba9['queue']]:this[_0xed68('0x1e')][_0x447ba9[_0xed68('0x19b')]()];if(!this[_0xed68('0xd4')](_0xc6a01c[_0xed68('0x19c')])){this[_0xed68('0xaf')](_0x1a3288);return this[_0xed68('0x19d')](_0x447ba9,_0x1a3288,_0xc6a01c)[_0xed68('0xad')](loggerCatch(_0xed68('0x19e')));}this[_0xed68('0xa7')][_0xc6a01c['uniqueid']]=_0x447ba9;}};Dialer['prototype'][_0xed68('0x19f')]=function(_0x5e32d9,_0x130eac,_0x247c7c){var _0x5eca69=new History(_0x130eac);if(_0x5eca69[_0xed68('0xef')]+_0x5eca69['countcongestionretry']+_0x5eca69[_0xed68('0xf1')]+_0x5eca69[_0xed68('0xf2')]+_0x5eca69[_0xed68('0xf3')]+_0x5eca69['countabandonedretry']+_0x5eca69[_0xed68('0xec')]+_0x5eca69[_0xed68('0xf5')]>=_0x247c7c[_0xed68('0x101')]-0x1){return!![];}switch(_0x5e32d9){case 0x3:if(_0x5eca69[_0xed68('0xf1')]>=_0x247c7c['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xed68('0xbd')]({'active':![],'countnoanswerretry':_0x5eca69[_0xed68('0xf1')]+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c['dialNoAnswerRetryFrequency'],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69['CampaignId']||undefined})['catch'](loggerCatch(_0xed68('0x1a0')));break;case 0x5:if(_0x5eca69['countbusyretry']>=_0x247c7c[_0xed68('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x5eca69['countbusyretry']+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c['dialBusyRetryFrequency'],'minutes')['format'](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69['VoiceQueueId']||undefined,'CampaignId':_0x5eca69['CampaignId']||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x1a2')));break;case 0x8:if(_0x5eca69[_0xed68('0xf0')]>=_0x247c7c[_0xed68('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x5eca69[_0xed68('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x247c7c[_0xed68('0x1a4')],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69['ListId'],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69['CampaignId']||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x1a5')));break;case 0x0:if(_0x5eca69[_0xed68('0xf2')]>=_0x247c7c['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xed68('0xbd')]({'active':![],'countnosuchnumberretry':_0x5eca69[_0xed68('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x247c7c['dialNoSuchNumberRetryFrequency'],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x1a6')));}break;case 0xa:if(_0x5eca69[_0xed68('0xf3')]>=_0x247c7c[_0xed68('0x119')]-0x1){return!![];}this[_0xed68('0xbd')]({'active':![],'countdropretry':_0x5eca69[_0xed68('0xf3')]+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c[_0xed68('0x11a')],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69['ListId'],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5eca69[_0xed68('0xf4')]>=_0x247c7c[_0xed68('0x122')]-0x1){return!![];}this[_0xed68('0xbd')]({'active':![],'countabandonedretry':_0x5eca69[_0xed68('0xf4')]+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c[_0xed68('0x123')],_0xed68('0x11b'))[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69['VoiceQueueId']||undefined,'CampaignId':_0x5eca69[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x124')));break;case 0x13:if(_0x5eca69[_0xed68('0xec')]>=_0x247c7c[_0xed68('0xf8')]-0x1){return!![];}this[_0xed68('0xbd')]({'active':![],'countmachineretry':_0x5eca69[_0xed68('0xec')]+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c[_0xed68('0xfc')],_0xed68('0x11b'))[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69[_0xed68('0xcf')],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69[_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0xff')));break;case 0x14:if(_0x5eca69['countagentrejectretry']>=_0x247c7c[_0xed68('0x1a7')]-0x1){return!![];}this[_0xed68('0xbd')]({'active':![],'countagentrejectretry':_0x5eca69[_0xed68('0xf5')]+=0x1,'scheduledat':moment()[_0xed68('0xfb')](_0x247c7c[_0xed68('0x1a8')],'minutes')[_0xed68('0x70')](_0xed68('0xfd')),'ContactId':_0x5eca69['ContactId'],'ListId':_0x5eca69[_0xed68('0xfe')],'VoiceQueueId':_0x5eca69[_0xed68('0x102')]||undefined,'CampaignId':_0x5eca69['CampaignId']||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x1a9')));break;default:return!![];}};Dialer[_0xed68('0x18')]['callProgressDetecting']=function(_0x585dd0,_0x1fae3d,_0x5c2f39){var _0x3d3493=this;var _0x35f404=new History(_0x585dd0);return new BPromise(function(_0x4a39e4,_0x46114b){if(_['isUndefined'](_0x1fae3d)&&typeof _0x1fae3d!=='object'){return _0x46114b(msgResponse(_0xed68('0x1aa'),_0xed68('0x149'),_0xed68('0x1ab')));}if(_[_0xed68('0x80')](_0x5c2f39)&&typeof _0x5c2f39!=='object'){return _0x46114b(msgResponse('[callProgressDetecting]',_0xed68('0x149'),_0xed68('0x1ac')));}switch(_0x5c2f39[_0xed68('0x10b')]){case'0':_0x1fae3d[_0xed68('0x62')]+=0x1;_0x35f404['state']=0x0;_0x35f404[_0xed68('0xa3')]=_0xed68('0x1ad');_0x35f404[_0xed68('0xf2')]+=0x1;_0x35f404[_0xed68('0xed')]+=0x1;ami[_0xed68('0x4b')](_0xed68('0x1ae'),ut[_0xed68('0xe6')](_0x585dd0,_0xed68('0x1af')));_0x3d3493[_0xed68('0xc8')](_0x35f404)['catch'](loggerCatch(_0xed68('0xee')));if(_0x3d3493[_0xed68('0x19f')](0x0,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xf2')]>=_0x1fae3d[_0xed68('0x1b0')]){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b1'));}else{_0x3d3493['stateGlobal'](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b1'));}}break;case'3':_0x1fae3d[_0xed68('0x61')]+=0x1;_0x35f404[_0xed68('0xe2')]=0x3;_0x35f404['statedesc']=_0xed68('0x1b2');_0x35f404['countnoanswerretry']+=0x1;_0x35f404['countglobal']+=0x1;ami['emit'](_0xed68('0x1b3'),ut['buildObj'](_0x585dd0,'noanswer'));_0x3d3493['createHistory'](_0x35f404)['catch'](loggerCatch(_0xed68('0x1b4')));if(_0x3d3493[_0xed68('0x19f')](0x3,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xf1')]>=_0x1fae3d['dialNoAnswerMaxRetry']){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b5'));}else{_0x3d3493[_0xed68('0xf6')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b5'));}}break;case'5':_0x1fae3d[_0xed68('0x5e')]+=0x1;_0x35f404[_0xed68('0xe2')]=0x5;_0x35f404[_0xed68('0xa3')]=_0xed68('0x1b6');_0x35f404[_0xed68('0xef')]+=0x1;_0x35f404[_0xed68('0xed')]+=0x1;ami[_0xed68('0x4b')](_0xed68('0x1b7'),ut[_0xed68('0xe6')](_0x585dd0,_0xed68('0x1b8')));_0x3d3493['createHistory'](_0x35f404)[_0xed68('0xad')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3d3493[_0xed68('0x19f')](0x5,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xef')]>=_0x1fae3d['dialBusyMaxRetry']){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b9'));}else{_0x3d3493[_0xed68('0xf6')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1b9'));}}break;case'8':_0x1fae3d[_0xed68('0x5f')]+=0x1;_0x35f404[_0xed68('0xe2')]=0x8;_0x35f404['statedesc']='Congestion';_0x35f404[_0xed68('0xf0')]+=0x1;_0x35f404[_0xed68('0xed')]+=0x1;ami[_0xed68('0x4b')](_0xed68('0x1ba'),ut['buildObj'](_0x585dd0,_0xed68('0x1bb')));_0x3d3493[_0xed68('0xc8')](_0x35f404)[_0xed68('0xad')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3d3493[_0xed68('0x19f')](0x8,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xf0')]>=_0x1fae3d[_0xed68('0x1a3')]){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1bc'));}else{_0x3d3493[_0xed68('0xf6')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1bc'));}}break;case'11':_0x1fae3d[_0xed68('0x1bd')]+=0x1;_0x35f404[_0xed68('0xe2')]=0xb;_0x35f404[_0xed68('0xa3')]=_0xed68('0x120');_0x35f404[_0xed68('0xf4')]+=0x1;_0x35f404['countglobal']+=0x1;_0x3d3493[_0xed68('0xc8')](_0x35f404)[_0xed68('0xad')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x3d3493[_0xed68('0x19f')](0xb,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xf4')]>=_0x1fae3d[_0xed68('0x122')]){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,'reason\x2011\x20abandoned');}else{_0x3d3493[_0xed68('0xf6')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1be'));}}break;case'20':_0x1fae3d[_0xed68('0x65')]+=0x1;_0x35f404[_0xed68('0xe2')]=0x14;_0x35f404['statedesc']=_0xed68('0x1bf');_0x35f404[_0xed68('0xf5')]+=0x1;_0x35f404[_0xed68('0xed')]+=0x1;ami[_0xed68('0x4b')](_0xed68('0x1c0'),ut[_0xed68('0xe6')](_0x585dd0,_0xed68('0x1c1')));_0x3d3493[_0xed68('0xc8')](_0x35f404)[_0xed68('0xad')](loggerCatch(_0xed68('0x1c2')));if(_0x3d3493['checkRetriveMax'](0x14,_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xf5')]>=_0x1fae3d['dialAgentRejectMaxRetry']){_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1c3'));}else{_0x3d3493['stateGlobal'](_0x35f404,_0x4a39e4,_0x46114b,_0xed68('0x1c3'));}}break;default:_0x1fae3d[_0xed68('0x66')]+=0x1;_0x35f404[_0xed68('0xe2')]=0xc;_0x35f404['statedesc']=_0x5c2f39[_0xed68('0x10b')];_0x3d3493[_0xed68('0xc8')](_0x35f404)[_0xed68('0xad')](loggerCatch(_0xed68('0x1c4')));if(_0x3d3493[_0xed68('0x19f')](_0x5c2f39[_0xed68('0x10b')],_0x585dd0,_0x1fae3d)){if(_0x35f404[_0xed68('0xef')]+_0x35f404['countcongestionretry']+_0x35f404[_0xed68('0xf1')]+_0x35f404[_0xed68('0xf2')]+_0x35f404[_0xed68('0xf3')]+_0x35f404[_0xed68('0xf4')]+_0x35f404[_0xed68('0xec')]+_0x35f404['countagentrejectretry']>=_0x1fae3d[_0xed68('0x101')]){_0x3d3493[_0xed68('0xf6')](_0x35f404,_0x4a39e4,_0x46114b,_0x5c2f39['reason']);}else{_0x3d3493[_0xed68('0xf9')](_0x35f404,_0x4a39e4,_0x46114b,_0x5c2f39[_0xed68('0x10b')]);}}}});};Dialer[_0xed68('0x18')][_0xed68('0xf6')]=function(_0x12aa30,_0x3d734a,_0x368951,_0x584e3b){var _0x1d40ce=new Final(_0x12aa30);_0x1d40ce[_0xed68('0xe2')]=0xf;_0x1d40ce[_0xed68('0xa3')]='Global';this[_0xed68('0xf9')](_0x1d40ce,_0x3d734a,_0x368951,_0x584e3b);};Dialer[_0xed68('0x18')]['createStateFinal']=function(_0x37aeb9,_0x40db4b,_0x3fed6a,_0x38d020){this[_0xed68('0xc6')](_0x37aeb9)[_0xed68('0xb5')](function(){return _0x40db4b(msgResponse(_0xed68('0x1aa'),_0xed68('0xd5'),_0x38d020));})[_0xed68('0xad')](function(){return _0x3fed6a(msgResponse(_0xed68('0x1c5'),_0xed68('0x149'),_0xed68('0x1c6')));});};Dialer[_0xed68('0x18')]['predictive']=function(_0x1146de){var _0x16a062=_0x1146de[_0xed68('0x1c7')]/0x64;var _0x4d8aa5=_0x1146de['outboundDropCallsDayTimeout']/(_0x1146de[_0xed68('0x116')]+_0x1146de[_0xed68('0x5c')]);var _0x49e0a3=Math['round'](_0x1146de[_0xed68('0x1c8')]*(_0x1146de[_0xed68('0x1c9')]/0x64));var _0x3312e6=Math['round'](_0x1146de['predictiveIntervalAvailable']*(_0x1146de[_0xed68('0x1ca')]/0x64));var _0x1bf91e=_0x1146de[_0xed68('0x1cb')]+_0x1146de[_0xed68('0x9c')];var _0x2ee3fa=Math['floor'](_0x1146de[_0xed68('0x6d')]*_0x1146de[_0xed68('0x86')]*_0x1146de['predictiveIntervalHitRate']*_0x1146de[_0xed68('0x1cc')]);if(_[_0xed68('0x80')](_0x1146de[_0xed68('0x25')])){if(!_[_0xed68('0x80')](_0x1146de['startPredictive'])){_0x1146de[_0xed68('0x24')]=undefined;loggerPredictive[_0xed68('0x8f')]('[startMethodPredictive][StartProgressive]',_0xed68('0x1cd'));}if(!_[_0xed68('0x80')](_0x1146de['handlePredictive'])){loggerPredictive[_0xed68('0x8f')]('[startMethodPredictive][StartProgressive]',_0xed68('0x1ce'));clearInterval(_0x1146de[_0xed68('0x8b')]);_0x1146de[_0xed68('0x8b')]=undefined;}_0x1146de[_0xed68('0x25')]=moment()[_0xed68('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xed68('0x75')](_0x1146de[_0xed68('0x3e')],_0xed68('0x1cf'),_0x1146de['startProgressive']);this[_0xed68('0x15e')](_0x1146de,0x1);}else if(ifInterval(_0x1146de[_0xed68('0x1d0')],_0x1146de['startProgressive'])){this['handlePower'](_0x1146de,0x1);loggerPredictiveCalls[_0xed68('0x75')](_0xed68('0x1d1'),_0x1146de[_0xed68('0x25')],_0x1146de[_0xed68('0x3e')]);_0x1146de[_0xed68('0x6d')]=0x0;_0x1146de['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x16a062<_0x4d8aa5&&_0x1146de[_0xed68('0x1d2')]===_0xed68('0x1d3')){freeVariablesPredictive(_0x1146de);loggerPredictive[_0xed68('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xed68('0x1d4'),_0x4d8aa5,_0xed68('0x25'),_0x1146de[_0xed68('0x3e')]);}else if(_0x2ee3fa<_0x1146de[_0xed68('0x1d5')]&&_0x1146de['dialPredictiveOptimization']===_0xed68('0x1d3')){freeVariablesPredictive(_0x1146de);loggerPredictive[_0xed68('0x75')](_0xed68('0x1d6'),_0xed68('0x1d7'),_0x2ee3fa,'Drop\x20in\x20this\x20interval',_0x1146de[_0xed68('0x1d5')],_0xed68('0x25'),_0x1146de[_0xed68('0x3e')]);}else if(!ifInterval(_0x1146de['dialPredictiveInterval'],_0x1146de[_0xed68('0x25')])&&_[_0xed68('0x80')](_0x1146de[_0xed68('0x24')])&&!_[_0xed68('0x80')](_0x1146de[_0xed68('0x25')])){_0x1146de['startPredictive']=moment()[_0xed68('0x70')](_0xed68('0xfd'));loggerPredictive['info'](_0x1146de[_0xed68('0x3e')],_0xed68('0x1d8'),_0x1146de[_0xed68('0x24')]);this[_0xed68('0xba')](_0x1146de['dialPredictiveInterval'])[_0xed68('0xb5')](this[_0xed68('0x1d9')](_0x1146de))[_0xed68('0xb5')](mergeDataErlangB(_0x1146de))[_0xed68('0xb5')](this['startMethodPredictive'](_0x1146de))[_0xed68('0xad')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1146de));}else if(!ifInterval(_0x1146de[_0xed68('0x1d0')],_0x1146de[_0xed68('0x24')])){_0x1146de[_0xed68('0x1d5')]=0x0;_0x1146de[_0xed68('0x24')]=moment()['format'](_0xed68('0xfd'));loggerPredictive[_0xed68('0x75')](_0x1146de[_0xed68('0x3e')],_0xed68('0x1da'),_0x1146de[_0xed68('0x24')]);clearInterval(_0x1146de[_0xed68('0x8b')]);_0x1146de['handlePredictive']=undefined;this[_0xed68('0xba')](_0x1146de[_0xed68('0x1d0')])[_0xed68('0xb5')](this['getDataPredictive'](_0x1146de))[_0xed68('0xb5')](mergeDataErlangB(_0x1146de))[_0xed68('0xb5')](this[_0xed68('0x1db')](_0x1146de))['catch'](loggerCatchPredictive(_0xed68('0x1dc'),_0x1146de));}else if(_0x1146de[_0xed68('0x1c8')]&&_0x1bf91e<_0x1146de[_0xed68('0x1c8')]-_0x3312e6){freeVariablesPredictive(_0x1146de);loggerPredictive[_0xed68('0x75')](_0x1146de[_0xed68('0x3e')],_0xed68('0x1dd'),_0x1bf91e,_0xed68('0x1de'),_0x1146de[_0xed68('0x1c8')],'-',_0x3312e6,'=',_0x1146de[_0xed68('0x1c8')]-_0x3312e6,')');}else if(_0x1146de[_0xed68('0x1c8')]&&_0x1bf91e>_0x1146de[_0xed68('0x1c8')]+_0x49e0a3){freeVariablesPredictive(_0x1146de);loggerPredictive[_0xed68('0x75')](_0x1146de[_0xed68('0x3e')],_0xed68('0x1dd'),_0x1bf91e,_0xed68('0x1df'),_0x1146de[_0xed68('0x1c8')],'+',_0x49e0a3,'=',_0x1146de[_0xed68('0x1c8')]+_0x49e0a3,')');}};Dialer['prototype'][_0xed68('0x1d9')]=function(_0x164f31){var _0x23a79e=this;return function(_0x532fb6){return new BPromise(function(_0x62c2be,_0x5a090c){_[_0xed68('0x12d')](_0x164f31,_0x532fb6[0x0]);if(checkGetDataPredictive(_0x532fb6[0x0])){var _0x10474a=_0x164f31['predictiveIntervalAvailable']=_0x164f31[_0xed68('0x9c')]+_0x164f31[_0xed68('0x1cb')];var _0x52a235=_0x164f31[_0xed68('0x1d0')]*0x3c;var _0x591e1b=_0x532fb6[0x0]['predictiveIntervalAvgTalktime']+_0x532fb6[0x0][_0xed68('0x7c')];var _0x4abca7=(_0x532fb6[0x0][_0xed68('0x67')]+_0x532fb6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x532fb6[0x0][_0xed68('0x69')])/_0x532fb6[0x0][_0xed68('0x6c')];_0x164f31[_0xed68('0x1e0')]=_0x4abca7>0x0?_0x4abca7:0x1;switch(_0x164f31[_0xed68('0x1d2')]){case _0xed68('0x1d3'):var _0xffaad3=_0x164f31[_0xed68('0x1c7')]/0x64;return _0x23a79e[_0xed68('0x1e1')](_0x10474a,_0x52a235,_0x591e1b,_0x4abca7,_0xffaad3)[_0xed68('0xb5')](function(_0x23159e){return _0x62c2be(_0x23159e);});case _0xed68('0x1e2'):var _0x23bd8e=_0x164f31['dialPredictiveOptimizationPercentage']/0x64;return _0x23a79e[_0xed68('0x1e3')](_0x10474a,_0x52a235,_0x591e1b,_0x4abca7,_0x23bd8e)[_0xed68('0xb5')](function(_0x1bb7e5){return _0x62c2be(_0x1bb7e5);});default:return _0x5a090c(msgResponse(_0xed68('0x1e4'),_0xed68('0x149'),_0xed68('0x1e5')));}}else{return _0x5a090c(msgResponse(_0xed68('0x1e4'),'Failure','check\x20failure'));}});};};Dialer[_0xed68('0x18')][_0xed68('0x1e6')]=function(_0x30eba2){var _0x5e1e99=this;return function(_0x3dd20e){return new BPromise(function(_0x4e9927,_0x404a41){_[_0xed68('0x12d')](_0x30eba2,_0x3dd20e[0x0]);if(checkGetDataPredictive(_0x3dd20e[0x0])){loggerPredictive[_0xed68('0x75')](JSON[_0xed68('0x48')](_0x3dd20e[0x0]));if(_0x30eba2[_0xed68('0x1d2')]===_0xed68('0x1d3')){return _0x5e1e99[_0xed68('0xc4')](_0x30eba2['id'])[_0xed68('0xb5')](function(_0x3bf2d8){var _0x38f043=_0x30eba2[_0xed68('0x4e')]-_0x3bf2d8[0x0][_0xed68('0x1e7')];var _0x6903e3=_0x30eba2[_0xed68('0x1d0')]*0x3c;var _0x583004=_0x3dd20e[0x0][_0xed68('0x68')]+_0x3dd20e[0x0][_0xed68('0x7c')];var _0x67ecc6=(_0x3dd20e[0x0][_0xed68('0x67')]+_0x3dd20e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3dd20e[0x0][_0xed68('0x69')])/_0x3dd20e[0x0][_0xed68('0x6c')];var _0x28072b=_0x30eba2[_0xed68('0x1c7')]/0x64;_0x30eba2[_0xed68('0x1e8')]=_0x3bf2d8[0x0][_0xed68('0x1e7')]||0x0;_0x30eba2[_0xed68('0x1e0')]=_0x67ecc6>0x0?_0x67ecc6:0x1;return _0x5e1e99[_0xed68('0x1e1')](_0x38f043,_0x6903e3,_0x583004,_0x67ecc6,_0x28072b);})[_0xed68('0xb5')](function(_0x42c844){return _0x4e9927(_0x42c844);})[_0xed68('0xad')](function(_0x2e5e60){return _0x404a41(msgResponse('[CatchErlangB]',_0xed68('0x149'),JSON[_0xed68('0x48')](_0x2e5e60)));});}if(_0x30eba2[_0xed68('0x1d2')]===_0xed68('0x1e2')){return _0x5e1e99[_0xed68('0xc4')](_0x30eba2['id'])[_0xed68('0xb5')](function(_0xacc9a5){var _0x3e7901=_0x30eba2[_0xed68('0x4e')]-_0xacc9a5[0x0][_0xed68('0x1e7')];var _0x3ce473=_0x30eba2[_0xed68('0x1d0')]*0x3c;var _0xc39fec=_0x3dd20e[0x0]['predictiveIntervalAvgTalktime']+_0x3dd20e[0x0][_0xed68('0x7c')];var _0x77d6bf=(_0x3dd20e[0x0][_0xed68('0x67')]+_0x3dd20e[0x0][_0xed68('0x6a')]+_0x3dd20e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3dd20e[0x0][_0xed68('0x6c')];var _0x209106=_0x30eba2['dialPredictiveOptimizationPercentage']/0x64;_0x30eba2[_0xed68('0x1e8')]=_0xacc9a5[0x0][_0xed68('0x1e7')]||0x0;_0x30eba2['predictiveIntervalHitRate']=_0x77d6bf>0x0?_0x77d6bf:0x1;return _0x5e1e99[_0xed68('0x1e3')](_0x3e7901,_0x3ce473,_0xc39fec,_0x77d6bf,_0x209106);})[_0xed68('0xb5')](function(_0x53abe9){return _0x4e9927(_0x53abe9);})[_0xed68('0xad')](function(_0x12ae13){return _0x404a41(msgResponse(_0xed68('0x1e9'),'Failure',JSON[_0xed68('0x48')](_0x12ae13)));});}}else{return _0x404a41(msgResponse(_0xed68('0x1e4'),_0xed68('0x149'),_0xed68('0x1ea')));}});};};Dialer[_0xed68('0x18')]['startMethodPredictive']=function(_0x5866c0){var _0x52b9f2=this;return function(){var _0x3adc10=0x0;var _0x2d1e5f=Math[_0xed68('0x1eb')](_0x5866c0[_0xed68('0x6e')]*0x3e8);if(_0x2d1e5f>0x0){_0x2d1e5f=_0x2d1e5f<0x64?0x64:_0x2d1e5f;loggerPredictive[_0xed68('0x75')](_0x5866c0[_0xed68('0x3e')],_0xed68('0x1ec'),_0x2d1e5f,_0xed68('0x49'));_0x5866c0[_0xed68('0x8b')]=setInterval(function(){_0x52b9f2['handlePredictive'](_0x5866c0);loggerPredictiveCalls['info'](_0xed68('0x1ed'),_0x3adc10+=0x1);},_0x2d1e5f);}else{loggerPredictive['info'](_0x5866c0['name'],_0xed68('0x1ee'));}};};Dialer[_0xed68('0x18')]['checkContactBlack']=function(_0xb7ec08,_0x364fb5){var _0x4c30f4=this;return function(_0x3fb4dc){if(_[_0xed68('0x45')](_0x3fb4dc)){if(_[_0xed68('0xab')](_0x364fb5[_0xed68('0xd0')])||!_0x364fb5['recallme']){if(_0xb7ec08[_0xed68('0x57')]===_0xed68('0x7')){_0xb7ec08[_0xed68('0x130')]=_[_0xed68('0x80')](_0xb7ec08[_0xed68('0x130')])?!![]:_0xb7ec08[_0xed68('0x130')];var _0x57825c=uuid['v4']();_0x4c30f4[_0xed68('0x126')][_0x57825c]=new Action(_0xb7ec08,_0x364fb5,_0x57825c);loggerBooked[_0xed68('0x75')](_0xed68('0x1ef'),_0x57825c,_0xed68('0x1f0'),JSON[_0xed68('0x48')](_0xb7ec08[_0xed68('0x130')]),_0xed68('0x1f1'),_0xb7ec08['name']);if(_0xb7ec08[_0xed68('0x130')]){_0xb7ec08[_0xed68('0x130')]=![];_0x4c30f4[_0xed68('0x27')][_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0xb0')]]=[];ami['Action']({'actionid':_0x57825c,'action':'queuestatus','queue':_0xb7ec08[_0xed68('0x3e')]})[_0xed68('0xad')](function(){_0x4c30f4[_0xed68('0xaf')](_0xb7ec08);_0x4c30f4[_0xed68('0xbd')]({'active':![],'ContactId':_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0xcf')],'ListId':_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0xfe')],'VoiceQueueId':_0x4c30f4['actions'][_0x57825c]['VoiceQueueId']||undefined,'CampaignId':_0x4c30f4['actions'][_0x57825c][_0xed68('0xd1')]||undefined})['catch'](loggerCatch(_0xed68('0x1f2')));delete _0x4c30f4['actions'][_0x57825c];});}else{loggerBooked[_0xed68('0x75')](_0xed68('0x1f3'),JSON[_0xed68('0x48')](_0xb7ec08[_0xed68('0x130')]),_0xed68('0x1f1'),_0xb7ec08[_0xed68('0x3e')]);_0x4c30f4['updateOriginated'](_0xb7ec08);_0x4c30f4['rescheduleContact']({'active':![],'ContactId':_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0xcf')],'ListId':_0x4c30f4[_0xed68('0x126')][_0x57825c]['ListId'],'VoiceQueueId':_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0x102')]||undefined,'CampaignId':_0x4c30f4[_0xed68('0x126')][_0x57825c][_0xed68('0xd1')]||undefined})[_0xed68('0xad')](loggerCatch(_0xed68('0x1f2')));delete _0x4c30f4['actions'][_0x57825c];}}else{return _0x4c30f4[_0xed68('0x1f4')](_0xb7ec08,_0x364fb5);}}else{if(getDiff(_0x364fb5['scheduledat'])<_0xb7ec08[_0xed68('0x1f5')]*0x3c){if(_0x364fb5[_0xed68('0x1f6')]&&!_0x364fb5[_0xed68('0x1f6')]['voicePause']){_0x4c30f4['preview'][_0xed68('0x132')](_0x364fb5['id'])[_0xed68('0x1b')](function(){_0x4c30f4[_0xed68('0xaf')](_0xb7ec08);});}else{_0x4c30f4[_0xed68('0xbf')]({'active':![]},_0x364fb5['id'],0x1)['finally'](function(){_0x4c30f4[_0xed68('0xaf')](_0xb7ec08);});}}else{_0xb7ec08[_0xed68('0x64')]+=0x1;_0x4c30f4[_0xed68('0xaf')](_0xb7ec08);if(_0xb7ec08['dialRecallInQueue']){_0x4c30f4[_0xed68('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x364fb5['ContactId'],'ListId':_0x364fb5['ListId'],'VoiceQueueId':_0x364fb5[_0xed68('0x102')]||undefined,'CampaignId':_0x364fb5[_0xed68('0xd1')]||undefined})['catch'](loggerCatch(_0xed68('0x1f7')));_0x4c30f4['createHistory'](createObjHistory(_0xb7ec08,_0x364fb5,_0xed68('0x1f8'),0x17,_0xed68('0x1f9')))[_0xed68('0xad')](loggerCatch(_0xed68('0x1fa')));}else{_0x4c30f4[_0xed68('0xdb')](createObjHistory(_0xb7ec08,_0x364fb5,'RECALLFAILEDTIMEOUT',0x16,_0xed68('0x1fb')),_0xed68('0x1fc'),_0xed68('0x1fd'));}}}}else{_0xb7ec08[_0xed68('0x5d')]+=0x1;_0x4c30f4[_0xed68('0xdb')](createObjHistory(_0xb7ec08,_0x364fb5,_0xed68('0x1fe'),0xd,_0xed68('0x1ff')),_0xed68('0x200'),_0xed68('0x201'));throw'inBlackList';}};};Dialer[_0xed68('0x18')][_0xed68('0x163')]=function(_0x315eee){var _0x6fbb7c=this;var _0x106d82=_0x315eee[_0xed68('0x202')]-_0x315eee[_0xed68('0x93')]-_0x315eee['temp'];emitCampaignSummary(_0x315eee);if(_0x106d82>0x0){if(_0x106d82>this[_0xed68('0x22')]){_0x106d82=this[_0xed68('0x22')];}_0x315eee[_0xed68('0xc2')]+=_0x106d82;this[_0xed68('0x203')](_0x315eee['id'],_0x106d82,_0x315eee['dialOrderByScheduledAt'],_0x315eee)[_0xed68('0xb5')](function(_0x4abeb2){_0x315eee[_0xed68('0xc2')]-=_0x106d82;_0x315eee[_0xed68('0xc2')]=_0x315eee[_0xed68('0xc2')]>0x0?_0x315eee[_0xed68('0xc2')]:0x0;if(!checkContactEmpty(_0x4abeb2)){_0x315eee[_0xed68('0x3d')]=_0xed68('0x99');logger[_0xed68('0x75')](_0xed68('0x204')+_0x315eee['name']);}else{_0x315eee[_0xed68('0x93')]+=_0x4abeb2[_0xed68('0x92')];_0x315eee[_0xed68('0x3d')]='RUNNING';for(var _0x4f3233=0x0;_0x4f3233<_0x4abeb2[_0xed68('0x92')];_0x4f3233+=0x1){_0x315eee['ivrTotalCallsDays']+=0x1;if(_[_0xed68('0xab')](_0x4abeb2[_0x4f3233])||_[_0xed68('0xab')](_0x4abeb2[_0x4f3233]['Contact'])||_[_0xed68('0xab')](_0x4abeb2[_0x4f3233][_0xed68('0x171')]['phone'])){_0x6fbb7c[_0xed68('0xcd')]('[actionOriginate]\x20',_0x315eee,_0x4abeb2[_0x4f3233]);}else{_0x6fbb7c[_0xed68('0xb9')](_[_0xed68('0x12e')](_0x4abeb2[_0x4f3233],[_0xed68('0xd1'),_0xed68('0x205')]))[_0xed68('0xb5')](_0x6fbb7c['checkContactBlack'](_0x315eee,_0x4abeb2[_0x4f3233]))['catch'](_0x6fbb7c['loggerHandler'](_0xed68('0x206'),_0x315eee));}}}})[_0xed68('0xad')](loggerGetContactDialer(_0xed68('0x207'),_0x315eee,_0x106d82));}};Dialer[_0xed68('0x18')][_0xed68('0x15e')]=function(_0x4cc7f4,_0x182f99){var _0x29912c=this;var _0x52cdce=[];var _0x384967=_0x182f99>=0x1?_0x182f99:0x1;if(_0x4cc7f4[_0xed68('0x57')]==='booked'){_0x384967=0x1;}var _0x4b7f48=Math['floor'](_0x4cc7f4['available']*_0x384967)-_0x4cc7f4[_0xed68('0x93')]-_0x4cc7f4[_0xed68('0xc2')];emitVoiceQueueSummary(_0x4cc7f4);if(_0x4cc7f4[_0xed68('0x208')]>0x0){var _0x3c6aab=_0x4cc7f4[_0xed68('0x208')]-_0x4cc7f4[_0xed68('0x93')]-_0x4cc7f4[_0xed68('0x9c')]-_0x4cc7f4['temp']-_0x4cc7f4['pTalking'];if(_0x4b7f48>_0x3c6aab){_0x4b7f48=_0x3c6aab;}}if(_0x4b7f48>0x0){if(_0x4cc7f4[_0xed68('0x57')]===_0xed68('0x7')){_0x4b7f48=0x1;}if(_0x4b7f48>this['maxNumberOriginate']){_0x4b7f48=this[_0xed68('0x22')];}_0x4cc7f4[_0xed68('0xc2')]+=_0x4b7f48;for(var _0x1e54b2 in this['agents']){if(typeof this[_0xed68('0x20')][_0x1e54b2]!==_0xed68('0xaa')){if(this[_0xed68('0x20')][_0x1e54b2][_0xed68('0xe2')]===_0xed68('0x209')&&this[_0xed68('0x20')][_0x1e54b2][_0xed68('0xd8')]===_0xed68('0xd9')){_0x52cdce['push'](this[_0xed68('0x20')][_0x1e54b2]['id']);}}}this['getContactDialer'](_0x4cc7f4['id'],_0x52cdce,_0x4b7f48,_0x4cc7f4[_0xed68('0x20a')],_0x4cc7f4)[_0xed68('0xb5')](function(_0xca7f05){_0x4cc7f4[_0xed68('0xc2')]-=_0x4b7f48;_0x4cc7f4[_0xed68('0xc2')]=_0x4cc7f4[_0xed68('0xc2')]>0x0?_0x4cc7f4['temp']:0x0;if(!checkContactEmpty(_0xca7f05)){_0x29912c[_0xed68('0xb3')](_0x4cc7f4)[_0xed68('0xb5')](sendMessageReschedule(_0x4cc7f4))['catch'](loggerCatch(_0xed68('0xb6')));}else{_0x4cc7f4['originated']+=_0xca7f05[_0xed68('0x92')];_0x4cc7f4[_0xed68('0x3d')]=_0x4cc7f4[_0xed68('0x57')]===_0xed68('0x7')?_0xed68('0x17a'):'RUNNING';for(var _0x4f1a18=0x0;_0x4f1a18<_0xca7f05[_0xed68('0x92')];_0x4f1a18+=0x1){if(_[_0xed68('0xab')](_0xca7f05[_0x4f1a18])||_[_0xed68('0xab')](_0xca7f05[_0x4f1a18][_0xed68('0x171')])||_[_0xed68('0xab')](_0xca7f05[_0x4f1a18][_0xed68('0x171')][_0xed68('0x172')])){_0x29912c[_0xed68('0xcd')]('[actionOriginate]\x20',_0x4cc7f4,_0xca7f05[_0x4f1a18]);}else{_0x29912c[_0xed68('0xb7')](_['pick'](_0xca7f05[_0x4f1a18],[_0xed68('0x102'),'Contact.phone']))['then'](_0x29912c['checkContactBlack'](_0x4cc7f4,_0xca7f05[_0x4f1a18]))[_0xed68('0xad')](_0x29912c['loggerHandler'](_0xed68('0x20b'),_0x4cc7f4));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x4cc7f4,_0x4b7f48));}};Dialer[_0xed68('0x18')][_0xed68('0x8b')]=function(_0x199135){if(_0x199135[_0xed68('0x208')]>0x0){var _0x510632=_0x199135[_0xed68('0x208')]-_0x199135[_0xed68('0x93')]-_0x199135[_0xed68('0x9c')];if(_0x510632>0x0){this['tryOriginatePredictive'](_0x199135);}else{loggerPredictiveCalls['info'](_0xed68('0x20c'));}}else{this[_0xed68('0x20d')](_0x199135);}};Dialer['prototype'][_0xed68('0x20d')]=function(_0x501fd0){var _0xa974c7=this;var _0x59a006=[];_0x501fd0['originated']+=0x1;for(var _0x33ef32 in this[_0xed68('0x20')]){if(typeof this[_0xed68('0x20')][_0x33ef32]!=='undefined'){if(this[_0xed68('0x20')][_0x33ef32]['state']===_0xed68('0x209')&&this[_0xed68('0x20')][_0x33ef32][_0xed68('0xd8')]==='reachable'){_0x59a006[_0xed68('0x12c')](this[_0xed68('0x20')][_0x33ef32]['id']);}}}this['getContactDialer'](_0x501fd0['id'],_0x59a006,0x1,_0x501fd0[_0xed68('0x20a')],_0x501fd0)[_0xed68('0xb5')](function(_0x3a5dcc){if(!checkContactEmpty(_0x3a5dcc)){checkContactLowerLimitOriginate(_0x501fd0,0x1,0x0);_0xa974c7[_0xed68('0xb3')](_0x501fd0)[_0xed68('0xb5')](sendMessageReschedule(_0x501fd0))[_0xed68('0xad')](loggerCatch(_0xed68('0xb6')));}else{_0x501fd0['message']='RUNNING';if(_[_0xed68('0xab')](_0x3a5dcc[0x0])||_[_0xed68('0xab')](_0x3a5dcc[0x0][_0xed68('0x171')])||_['isNil'](_0x3a5dcc[0x0][_0xed68('0x171')][_0xed68('0x172')])){_0xa974c7[_0xed68('0xcd')](_0xed68('0x20b'),_0x501fd0,_0x3a5dcc[0x0]);}else{_0xa974c7[_0xed68('0xb7')](_['pick'](_0x3a5dcc[0x0],['VoiceQueueId',_0xed68('0x205')]))[_0xed68('0xb5')](_0xa974c7[_0xed68('0x20e')](_0x501fd0,_0x3a5dcc[0x0]))[_0xed68('0xad')](_0xa974c7[_0xed68('0xcc')]('[actionOriginatePredictive]\x20',_0x501fd0));}}})[_0xed68('0xad')](loggerGetContactDialer(_0xed68('0x20f'),_0x501fd0,0x1));emitVoiceQueueSummary(_0x501fd0);};Dialer['prototype'][_0xed68('0x1e1')]=function(_0x164c80,_0x569dbe,_0x53cc79,_0x375320,_0x95e35c,_0x3f617c){loggerPredictive[_0xed68('0x75')](_0xed68('0x210'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x164c80);loggerPredictive[_0xed68('0x75')](_0xed68('0x211'),_0x569dbe);loggerPredictive[_0xed68('0x75')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53cc79);loggerPredictive[_0xed68('0x75')](_0xed68('0x212'),_0x375320);loggerPredictive['info'](_0xed68('0x213'),_0x95e35c);loggerPredictive[_0xed68('0x75')](_0xed68('0x7e'));return new BPromise(function(_0x1987b3,_0x33fe3e){if(_0x164c80<=0x0||isNaN(_0x164c80)){return _0x33fe3e(msgResponse(_0xed68('0x214'),'Error',_0xed68('0x215')+_0x164c80));}if(_0x53cc79<=0x0||isNaN(_0x53cc79)){return _0x33fe3e(msgResponse(_0xed68('0x214'),'Error',_0xed68('0x216')+_0x53cc79));}if(_0x375320<=0x0||isNaN(_0x375320)){return _0x33fe3e(msgResponse(_0xed68('0x214'),'Error',_0xed68('0x217')+_0x375320));}if(_0x569dbe<=0x0||isNaN(_0x569dbe)){return _0x33fe3e(msgResponse(_0xed68('0x214'),'Error',_0xed68('0x218')+_0x569dbe));}if(_0x95e35c<=0x0||isNaN(_0x95e35c)){return _0x33fe3e(msgResponse(_0xed68('0x214'),_0xed68('0x47'),'Amax\x20=\x20'+_0x95e35c));}_0x3f617c=_0x3f617c||0x0;var _0x31cd08=0x1/_0x53cc79;var _0x3d236d=0x0;var _0x4c2f8a=0x0;var _0x13ed54=0x0;var _0x90566b=0x0;for(var _0x131b53=0x0;_0x13ed54<_0x95e35c;_0x131b53+=0x1){_0x4c2f8a=_0x131b53/_0x569dbe;_0x3d236d=(_0x375320*_0x4c2f8a+_0x3f617c)/_0x31cd08;_0x13ed54=erlangb(_0x3d236d,_0x164c80);_0x90566b=_0x3d236d/_0x164c80*(0x1-erlangb(_0x3d236d,_0x164c80));}return _0x1987b3({'erlangCalls':_0x131b53,'erlangCallToSecond':_0x569dbe/_0x131b53,'erlangAbandonmentRate':_0x13ed54,'erlangBusyFactor':_0x90566b});});};Dialer[_0xed68('0x18')][_0xed68('0x1e3')]=function(_0x327aa8,_0x462577,_0x5766d0,_0x2dfa17,_0x2eb277,_0x56f7ba){loggerPredictive[_0xed68('0x75')](_0xed68('0x219'));loggerPredictive['info'](_0xed68('0x21a'),_0x327aa8);loggerPredictive[_0xed68('0x75')](_0xed68('0x211'),_0x462577);loggerPredictive['info'](_0xed68('0x21b'),_0x5766d0);loggerPredictive[_0xed68('0x75')](_0xed68('0x212'),_0x2dfa17);loggerPredictive['info'](_0xed68('0x21c'),_0x2eb277);loggerPredictive[_0xed68('0x75')](_0xed68('0x7e'));return new BPromise(function(_0x26670c,_0xdf98fd){if(_0x327aa8<=0x0||isNaN(_0x327aa8)){return _0xdf98fd(msgResponse(_0xed68('0x21d'),_0xed68('0x47'),_0xed68('0x215')+_0x327aa8));}if(_0x5766d0<=0x0||isNaN(_0x5766d0)){return _0xdf98fd(msgResponse('[busyFactor]',_0xed68('0x47'),_0xed68('0x216')+_0x5766d0));}if(_0x2dfa17<=0x0||isNaN(_0x2dfa17)){return _0xdf98fd(msgResponse('[busyFactor]',_0xed68('0x47'),_0xed68('0x217')+_0x2dfa17));}if(_0x462577<=0x0||isNaN(_0x462577)){return _0xdf98fd(msgResponse(_0xed68('0x21d'),'Error',_0xed68('0x218')+_0x462577));}if(_0x2eb277<=0x0||isNaN(_0x2eb277)){return _0xdf98fd(msgResponse(_0xed68('0x21d'),'Error','Umin\x20=\x20'+_0x2eb277));}_0x56f7ba=_0x56f7ba||0x0;var _0x1f980f=0x1/_0x5766d0;var _0x560c1f=0x0;var _0x5aaa7e=0x0;var _0x1b30c3=0x0;var _0x34420f=0x0;for(var _0x20bd58=0x0;_0x34420f<_0x2eb277;_0x20bd58+=0x1){_0x5aaa7e=_0x20bd58/_0x462577;_0x560c1f=(_0x2dfa17*_0x5aaa7e+_0x56f7ba)/_0x1f980f;_0x1b30c3=erlangb(_0x560c1f,_0x327aa8);_0x34420f=_0x560c1f/_0x327aa8*(0x1-erlangb(_0x560c1f,_0x327aa8));}return _0x26670c({'erlangCalls':_0x20bd58,'erlangCallToSecond':_0x462577/_0x20bd58,'erlangAbandonmentRate':_0x1b30c3,'erlangBusyFactor':_0x34420f});});};module['exports']=Dialer; \ No newline at end of file +var _0x5771=['custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','check\x20failure','floor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','queueStatusComplete','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','booked','dialLimitQueue','dialOrderByScheduledAt','RUNNING','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','predictive','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','milliseconds','diff','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','endtime','starttime','[uniqueid]','actions','[actions]','clearZombieChannels','isNil','Action','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','dialGlobalMaxRetry','reason19\x20machine....','CampaignId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','syncNewExten','actionid','locked','paused','stateinterface','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','interval','timezones','content','iftime\x20%s,%s','indexOf','true','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','callProgressDetecting','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x5771,0x6d));var _0x1577=function(_0x544210,_0x9e1b04){_0x544210=_0x544210-0x0;var _0x3e4b08=_0x5771[_0x544210];return _0x3e4b08;};'use strict';var util=require(_0x1577('0x0'));var _=require(_0x1577('0x1'));var BPromise=require(_0x1577('0x2'));var uuid=require(_0x1577('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x1577('0x4'));var Redis=require(_0x1577('0x5'));var ut=require('../preview/util/util');var config=require(_0x1577('0x6'));var logger=require(_0x1577('0x7'))('dialer');var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x1577('0x8'));var loggerPredictiveCalls=require(_0x1577('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x1577('0x7'))(_0x1577('0x9'));var ami=require('../ami');config[_0x1577('0xa')]=_[_0x1577('0xb')](config[_0x1577('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x1577('0xc'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x1577('0xd'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x1577('0xe'));var Action=require(_0x1577('0xf'));var History=require(_0x1577('0x10'));var Final=require(_0x1577('0x11'));var AgentComplete=require(_0x1577('0x12'));var QueueCallerAbandon=require(_0x1577('0x13'));var Hangup=require(_0x1577('0x14'));var ipAgi=process[_0x1577('0x15')][_0x1577('0x16')]||_0x1577('0x17');var strategy={'rrmemory':_0x1577('0x18'),'roundrobin':_0x1577('0x19')};var Sequence=function(){};Sequence[_0x1577('0x1a')][_0x1577('0x1b')]=function(_0x2dce1c){this[_0x1577('0x1c')]=this[_0x1577('0x1c')]?this['tail'][_0x1577('0x1d')](_0x2dce1c):_0x2dce1c();};function Dialer(_0x4bc7c9,_0x1c7286){this[_0x1577('0x1e')]=new Sequence();this['preview']=_0x1c7286;this[_0x1577('0x1f')]=_0x4bc7c9[_0x1577('0x1f')];this[_0x1577('0x20')]=_0x4bc7c9['campaigns'];this[_0x1577('0x21')]=_0x4bc7c9[_0x1577('0x21')];this['trunks']=_0x4bc7c9[_0x1577('0x22')];this[_0x1577('0x23')]=config[_0x1577('0x23')]||0x2;this['channels']={};this['actions']={};this[_0x1577('0x24')]={};this[_0x1577('0x25')]={};this[_0x1577('0x26')]={};this[_0x1577('0x27')]={};this[_0x1577('0x28')]={};this[_0x1577('0x29')]={};this[_0x1577('0x2a')]={};this[_0x1577('0x2b')]={};ami['on'](_0x1577('0x2c'),this['syncAgentConnect'][_0x1577('0x2d')](this));ami['on'](_0x1577('0x2e'),this['syncQueueCallerAbandon'][_0x1577('0x2d')](this));ami['on']('originateresponse',this[_0x1577('0x2f')][_0x1577('0x2d')](this));ami['on'](_0x1577('0x30'),this[_0x1577('0x31')][_0x1577('0x2d')](this));ami['on'](_0x1577('0x32'),this[_0x1577('0x9')][_0x1577('0x2d')](this));ami['on'](_0x1577('0x33'),this[_0x1577('0x34')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x1577('0x2d')](this));ami['on'](_0x1577('0x35'),this[_0x1577('0x36')][_0x1577('0x2d')](this));ami['on'](_0x1577('0x37'),this[_0x1577('0x38')][_0x1577('0x2d')](this));ami['on'](_0x1577('0x39'),this[_0x1577('0x3a')]['bind'](this));this[_0x1577('0x3b')]();this[_0x1577('0x3c')]();}function isNotNull(_0x5dc9e3){return _0x5dc9e3!==null&&!_[_0x1577('0x3d')](_0x5dc9e3);}function checkIsLoggedIn(_0x2bac0e,_0x24451b){return function(){if(_0x24451b<=0x0){_0x2bac0e[_0x1577('0x3e')]=_0x1577('0x3f');throw _0x2bac0e[_0x1577('0x40')]+_0x1577('0x41');}};}function isActive(_0x18e6d9){return _0x18e6d9;}function checkIsActive(_0x16ce67,_0x288674){return function(){if(!isActive(_0x288674)){_0x16ce67[_0x1577('0x3e')]='NOT_ACTIVE';throw _0x16ce67['name']+_0x1577('0x42');}};}function checkInterval(_0x1e5109){return function(){if(!isNotNull(_0x1e5109[_0x1577('0x43')])){_0x1e5109[_0x1577('0x3e')]=_0x1577('0x44');throw _0x1e5109['name']+_0x1577('0x45');}if(!isNotNull(_0x1e5109['Interval'][_0x1577('0x46')])){_0x1e5109[_0x1577('0x3e')]=_0x1577('0x44');throw _0x1e5109['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x1577('0x47')](_0x1e5109[_0x1577('0x43')][_0x1577('0x46')]))){_0x1e5109['message']=_0x1577('0x44');throw _0x1e5109[_0x1577('0x40')]+_0x1577('0x45');}};}function msgResponse(_0x3b9bf2,_0x3472a9,_0x58be45){return{'action':_0x3b9bf2,'response':_0x3472a9,'message':_0x58be45,'stack':_0x58be45};}function myreject(_0x17a160){return function(_0x3c6f71){return _0x17a160(msgResponse('[ifTime][Action]',_0x1577('0x48'),JSON['stringify'](_0x3c6f71)));};}function getSeconds(_0x20db25,_0x16bd0c){var _0x444f6c=moment(_0x20db25)['milliseconds'](0x0);var _0x2d76ba=moment(_0x16bd0c)[_0x1577('0x49')](0x0);return _0x444f6c[_0x1577('0x4a')](_0x2d76ba,'seconds');}function emit(_0x2c4f44,_0x3fe14d,_0x3a68f7){io['to'](_0x2c4f44)[_0x1577('0x4b')](_0x3fe14d,_0x3a68f7);}function emitVoiceQueueSummary(_0x4ffdfc){if(_0x4ffdfc[_0x1577('0x4c')]===_0x1577('0x4d')){var _0x1124b7={'id':_0x4ffdfc['id'],'name':_0x4ffdfc[_0x1577('0x40')],'strategy':_0x4ffdfc[_0x1577('0x4e')],'answered':_0x4ffdfc['answered'],'available':_0x4ffdfc[_0x1577('0x4f')],'loggedIn':_0x4ffdfc[_0x1577('0x50')],'pTalking':_0x4ffdfc[_0x1577('0x51')],'sumBillable':_0x4ffdfc[_0x1577('0x52')],'sumDuration':_0x4ffdfc[_0x1577('0x53')],'sumHoldTime':_0x4ffdfc[_0x1577('0x54')]||0x0,'talking':_0x4ffdfc[_0x1577('0x55')],'total':_0x4ffdfc[_0x1577('0x56')],'type':_0x4ffdfc[_0x1577('0x4c')],'unmanaged':_0x4ffdfc[_0x1577('0x57')],'abandoned':_0x4ffdfc[_0x1577('0x58')],'waiting':_0x4ffdfc[_0x1577('0x59')],'loggedInDb':_0x4ffdfc['loggedInDb'],'dialActive':_0x4ffdfc[_0x1577('0x5a')],'dialMethod':_0x4ffdfc[_0x1577('0x5b')],'dialOriginateCallerIdName':_0x4ffdfc[_0x1577('0x5c')],'dialOriginateCallerIdNumber':_0x4ffdfc[_0x1577('0x5d')],'dialOriginateTimeout':_0x4ffdfc['dialOriginateTimeout'],'dialPrefix':_0x4ffdfc[_0x1577('0x5e')],'outboundAnswerAgiCallsDay':_0x4ffdfc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4ffdfc[_0x1577('0x5f')],'outboundBlacklistCallsDay':_0x4ffdfc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4ffdfc[_0x1577('0x60')],'outboundCongestionCallsDay':_0x4ffdfc[_0x1577('0x61')],'outboundDropCallsDayACS':_0x4ffdfc[_0x1577('0x62')],'outboundDropCallsDayCallersExit':_0x4ffdfc[_0x1577('0x63')],'outboundDropCallsDayTimeout':_0x4ffdfc[_0x1577('0x64')],'outboundNoAnswerCallsDay':_0x4ffdfc['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4ffdfc[_0x1577('0x65')],'outboundOriginateFailureCallsDay':_0x4ffdfc['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4ffdfc[_0x1577('0x66')],'outboundRejectCallsDay':_0x4ffdfc[_0x1577('0x67')],'outboundUnknownCallsDay':_0x4ffdfc[_0x1577('0x68')],'predictiveIntervalAnsweredCalls':_0x4ffdfc[_0x1577('0x69')],'predictiveIntervalAvgHoldtime':_0x4ffdfc[_0x1577('0x6a')],'predictiveIntervalAvgTalktime':_0x4ffdfc[_0x1577('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x4ffdfc[_0x1577('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x4ffdfc[_0x1577('0x6d')],'predictiveIntervalErlangCalls':_0x4ffdfc[_0x1577('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x4ffdfc[_0x1577('0x6f')],'predictiveIntervalHitRate':_0x4ffdfc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4ffdfc[_0x1577('0x70')],'predictiveIntervalPauses':_0x4ffdfc[_0x1577('0x71')],'predictiveIntervalAvailable':_0x4ffdfc[_0x1577('0x72')],'predictiveIntervalTotalCalls':_0x4ffdfc[_0x1577('0x73')],'message':_0x4ffdfc[_0x1577('0x3e')],'originated':_0x4ffdfc[_0x1577('0x74')],'erlangCalls':_0x4ffdfc['erlangCalls'],'erlangCallToSecond':_0x4ffdfc[_0x1577('0x75')],'erlangAbandonmentRate':_0x4ffdfc[_0x1577('0x76')],'erlangBusyFactor':_0x4ffdfc[_0x1577('0x77')],'startPredictive':_0x4ffdfc[_0x1577('0x27')],'startProgressive':_0x4ffdfc[_0x1577('0x28')]};if(_0x4ffdfc[_0x1577('0x78')]){_0x1124b7[_0x1577('0x78')]={'id':_0x4ffdfc[_0x1577('0x78')]['id'],'name':_0x4ffdfc[_0x1577('0x78')][_0x1577('0x40')],'active':_0x4ffdfc['Trunk'][_0x1577('0x79')],'callerid':_0x4ffdfc[_0x1577('0x78')][_0x1577('0x7a')]};}if(_0x4ffdfc[_0x1577('0x43')]){_0x1124b7[_0x1577('0x43')]={'id':_0x4ffdfc['Interval']['id'],'name':_0x4ffdfc[_0x1577('0x43')]['name']};}var _0x399b20=md5(JSON[_0x1577('0x7b')](_0x1124b7));if(_0x4ffdfc[_0x1577('0x4')]!==_0x399b20){_0x4ffdfc['md5']=_0x399b20;emit(util[_0x1577('0x7c')](_0x1577('0x7d'),_0x1124b7[_0x1577('0x40')]),_0x1577('0x7e'),_0x1124b7);}}}function emitCampaignSummary(_0xa0a85f){if(_0xa0a85f['type']==='ivr'){emit(util['format'](_0x1577('0x7f'),_0xa0a85f[_0x1577('0x40')]),_0x1577('0x80'),_0xa0a85f);}}function checkGetDataPredictive(_0x336067){if(isNotNull(_0x336067)&&!_['isEmpty'](_0x336067)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x1577('0x81')](_0x1577('0x82'),_0x336067[_0x1577('0x73')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x83'),_0x336067[_0x1577('0x69')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x84'),_0x336067[_0x1577('0x6d')]);loggerPredictive['info'](_0x1577('0x85'),_0x336067[_0x1577('0x6c')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x86'),_0x336067[_0x1577('0x6a')]);loggerPredictive[_0x1577('0x81')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x336067[_0x1577('0x6b')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x87'));if(_0x336067[_0x1577('0x73')]>0x0){if(!_[_0x1577('0x3d')](_0x336067[_0x1577('0x6b')])&&_0x336067[_0x1577('0x6b')]>0x0){return!![];}loggerPredictive[_0x1577('0x81')](_0x1577('0x88'));if(!_[_0x1577('0x3d')](_0x336067[_0x1577('0x6a')])&&_0x336067[_0x1577('0x6a')]>0x0){return!![];}loggerPredictive[_0x1577('0x81')](_0x1577('0x89'));}else{loggerPredictive[_0x1577('0x81')](_0x1577('0x8a'));}}else{loggerPredictive[_0x1577('0x81')](_0x1577('0x8b'));}return![];}function mergeDataErlangB(_0x594b30){return function(_0x2750ad){loggerPredictive[_0x1577('0x81')](_0x1577('0x8c'));loggerPredictive[_0x1577('0x81')](_0x1577('0x8d'),_0x2750ad[_0x1577('0x8e')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x8f'),_0x2750ad[_0x1577('0x75')]);loggerPredictive[_0x1577('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2750ad[_0x1577('0x76')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x90'),_0x2750ad[_0x1577('0x77')]);loggerPredictive[_0x1577('0x81')](_0x1577('0x91'),_0x2750ad['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_['merge'](_0x594b30,_0x2750ad);};}function getDiff(_0x1e0b3a){var _0x34ddac=moment()[_0x1577('0x49')](0x0);var _0x4206d8=moment(_0x1e0b3a)[_0x1577('0x49')](0x0);return _0x34ddac[_0x1577('0x4a')](_0x4206d8,'seconds');}function ifInterval(_0x520f72,_0x27eaca){if(_['isUndefined'](_0x27eaca)){return![];}return getDiff(_0x27eaca)<_0x520f72*0x3c;}function freeVariablesPredictive(_0x343f54){if(isNotNull(_0x343f54)){if(!_[_0x1577('0x3d')](_0x343f54[_0x1577('0x28')])){_0x343f54[_0x1577('0x28')]=undefined;loggerPredictive[_0x1577('0x81')](_0x343f54[_0x1577('0x40')],_0x1577('0x92'));}if(!_['isUndefined'](_0x343f54['startPredictive'])){_0x343f54[_0x1577('0x27')]=undefined;loggerPredictive[_0x1577('0x81')](_0x343f54['name'],_0x1577('0x93'));}if(!_[_0x1577('0x3d')](_0x343f54[_0x1577('0x94')])){clearInterval(_0x343f54[_0x1577('0x94')]);_0x343f54['handlePredictive']=undefined;loggerPredictive[_0x1577('0x81')](_0x343f54['name'],_0x1577('0x95'));}}}function erlangb(_0x29513d,_0x2e265c){if(_0x2e265c===0x0){return 0x0;}var _0x7d2d16=0x1;for(var _0x398255=0x1;_0x398255<=_0x2e265c;_0x398255+=0x1){_0x7d2d16=0x1+_0x7d2d16*_0x398255/_0x29513d;}return 0x1/_0x7d2d16;}function isVoiceQueueOutbound(_0x499cb8){return _0x499cb8==='outbound';}function isNotPreview(_0xc85ac6){return _0xc85ac6!==_0x1577('0x96');}function isCampaignIvr(_0x1fe9e8){return _0x1fe9e8===_0x1577('0x97');}function getCallerId(_0x2c72d2,_0x366433,_0x25d7a4){if(!_['isUndefined'](_0x25d7a4)&&typeof _0x25d7a4===_0x1577('0x98')&&!_[_0x1577('0x47')](_0x25d7a4)){if(!_['isUndefined'](_0x366433)&&typeof _0x366433==='string'&&!_[_0x1577('0x47')](_0x366433)){return util[_0x1577('0x7c')]('\x22%s\x22\x20<%s>',_0x366433,_0x25d7a4);}return util[_0x1577('0x7c')](_0x1577('0x99'),_0x25d7a4,_0x25d7a4);}if(!_[_0x1577('0x3d')](_0x2c72d2)&&typeof _0x2c72d2==='string'&&!_[_0x1577('0x47')](_0x2c72d2)){return _0x2c72d2;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2feb8a,_0x5686e5){return function(_0x116167){freeVariablesPredictive(_0x5686e5);emitVoiceQueueSummary(_0x5686e5);emitCampaignSummary(_0x5686e5);loggerSyncQueueSummary[_0x1577('0x9a')](_0x2feb8a,util['inspect'](_0x116167,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x49dbb6,_0x326671){return function(_0x3cb3e2){loggerPredictive['error'](_0x326671[_0x1577('0x40')],_0x49dbb6);loggerPredictive[_0x1577('0x9a')](_0x3cb3e2[_0x1577('0x9b')]);freeVariablesPredictive(_0x326671);};}function loggerCatch(_0x3b7f06){return function(_0x554cfc){logger['error'](_0x3b7f06,util[_0x1577('0x9c')](_0x554cfc,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x38b14e){return _0x38b14e&&!_[_0x1577('0x3d')](_0x38b14e)&&_0x38b14e[_0x1577('0x9d')]>0x0;}function decremetOriginate(_0xdc1c1a){if(!_[_0x1577('0x3d')](_0xdc1c1a)&&_0xdc1c1a!==null){if(typeof _0xdc1c1a[_0x1577('0x74')]!==_0x1577('0x9e')){if(_0xdc1c1a['originated']>0x0){_0xdc1c1a[_0x1577('0x74')]-=0x1;}else{logger[_0x1577('0x9a')](_0x1577('0x9f'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4b1b86,_0x38f721,_0x15da63){if(_0x38f721>_0x15da63){for(var _0x29ae0d=0x0;_0x29ae0d<_0x38f721-_0x15da63;_0x29ae0d+=0x1){decremetOriginate(_0x4b1b86);}}}function loggerGetContactDialer(_0x22abb5,_0x11a231,_0x3e18b2){return function(_0x2c3d3a){checkContactLowerLimitOriginate(_0x11a231,_0x3e18b2,0x0);logger[_0x1577('0x9a')](_0x22abb5,util[_0x1577('0x9c')](_0x2c3d3a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x80cfb3){return function(_0x201a25){if(isNotNull(_0x201a25)&&isNotNull(_0x201a25[0x0])){if(_0x201a25[0x0][_0x1577('0xa0')]>0x0){_0x80cfb3[_0x1577('0x3e')]=_0x1577('0xa1');logger['info'](_0x1577('0xa2')+_0x80cfb3[_0x1577('0x40')],_0x201a25[0x0][_0x1577('0xa0')],_0x1577('0xa3'));}else{_0x80cfb3[_0x1577('0x3e')]=_0x1577('0xa4');logger[_0x1577('0x81')](_0x1577('0xa5')+_0x80cfb3[_0x1577('0x40')]);}}};}function notSendMessagesQueue(_0x341ef1){if(_0x341ef1[_0x1577('0xa6')]){freeVariablesPredictive(_0x341ef1);if(_0x341ef1['originated']===0x0&&_0x341ef1[_0x1577('0x55')]===0x0&&_0x341ef1[_0x1577('0x59')]===0x0&&(_0x341ef1['pTalking']||0x0)===0x0){_0x341ef1['sendMessageOneNotActive']=![];_0x341ef1[_0x1577('0x4f')]=0x0;_0x341ef1['message']=_0x1577('0xa7');loggerSyncQueueSummary[_0x1577('0x9a')](_0x1577('0xa8'),_0x341ef1[_0x1577('0x40')],_0x1577('0xa9'));}else{_0x341ef1['message']=_0x1577('0xaa');loggerSyncQueueSummary[_0x1577('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x341ef1[_0x1577('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x341ef1);}}function notSendMessagesCampaign(_0x3be079){if(_0x3be079[_0x1577('0xa6')]){if(_0x3be079[_0x1577('0x74')]===0x0){_0x3be079[_0x1577('0xa6')]=![];_0x3be079[_0x1577('0x3e')]=_0x1577('0xa7');loggerSyncQueueSummary[_0x1577('0x9a')](_0x1577('0xab'),_0x3be079['name'],'is\x20not\x20active');}else{_0x3be079[_0x1577('0x3e')]=_0x1577('0xaa');loggerSyncQueueSummary[_0x1577('0x9a')](_0x1577('0xab'),_0x3be079[_0x1577('0x40')],_0x1577('0xac'));}emitCampaignSummary(_0x3be079);}}function createObjHistory(_0x2ba0de,_0x5450b9,_0x50e1e6,_0x44e0ff,_0x220391){_0x2ba0de[_0x1577('0x3e')]=_0x50e1e6;var _0x512488=new Action(_0x2ba0de,_0x5450b9);var _0x3bc1ed=new History(_0x512488);_0x3bc1ed[_0x1577('0xad')]=_0x44e0ff;_0x3bc1ed['statedesc']=_0x220391;_0x3bc1ed[_0x1577('0xae')]=_0x512488[_0x1577('0xaf')];return _0x3bc1ed;}Dialer[_0x1577('0x1a')][_0x1577('0x3c')]=function(){var _0x5d19cf=this;setInterval(function(){_0x5d19cf['clearZombieChannels'](_0x5d19cf[_0x1577('0x25')],_0x1577('0xb0'));_0x5d19cf['clearZombieChannels'](_0x5d19cf[_0x1577('0xb1')],_0x1577('0xb2'));},0x32c8);};Dialer['prototype'][_0x1577('0xb3')]=function(_0x1d64c2,_0x3e7847){var _0x20ecad=this;for(var _0x380bca in _0x1d64c2){if(typeof _0x1d64c2[_0x380bca]!==_0x1577('0x9e')){this[_0x1577('0x1e')][_0x1577('0x1b')](function(){if(!_[_0x1577('0xb4')](_0x1d64c2[_0x380bca])){return ami[_0x1577('0xb5')]({'action':_0x1577('0xb6'),'channel':_0x1d64c2[_0x380bca][_0x1577('0xb7')]})['catch'](function(_0x374dde){if(_0x374dde[_0x1577('0x3e')]===_0x1577('0xb8')){setTimeout(function(){if(_0x1d64c2[_0x380bca]&&_0x1d64c2[_0x380bca]['type']!==_0x1577('0x97')){_0x20ecad['updateOriginated'](_0x20ecad[_0x1577('0x1f')][_0x1d64c2[_0x380bca][_0x1577('0xb9')]]);logger['error'](_0x1577('0xba'),_0x3e7847,_0x380bca,_0x1d64c2[_0x380bca][_0x1577('0xb9')]);delete _0x1d64c2[_0x380bca];}if(_0x1d64c2[_0x380bca]&&_0x1d64c2[_0x380bca][_0x1577('0x4c')]===_0x1577('0x97')){_0x20ecad[_0x1577('0xbb')](_0x20ecad[_0x1577('0x20')][_0x1d64c2[_0x380bca]['queue']]);logger[_0x1577('0x9a')]('[Dialer][checkChannel][ivr]',_0x3e7847,_0x380bca,_0x1d64c2[_0x380bca][_0x1577('0xb9')]);delete _0x1d64c2[_0x380bca];}},0x2328);}});}});}}};Dialer['prototype'][_0x1577('0xbc')]=function(_0x29be29){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopper[_0x1577('0xbc')](_0x29be29))[_0x1577('0xbf')](loggerCatch(_0x1577('0xc0')));};Dialer[_0x1577('0x1a')][_0x1577('0xc1')]=function(_0x3a91fe){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopperBlack[_0x1577('0xc1')](_0x3a91fe))[_0x1577('0xbf')](loggerCatch(_0x1577('0xc2')));};Dialer['prototype'][_0x1577('0xc3')]=function(_0x403a49){return BPromise[_0x1577('0xbd')]()['then'](cmHopperBlack[_0x1577('0xc3')](_0x403a49))[_0x1577('0xbf')](loggerCatch(_0x1577('0xc4')));};Dialer['prototype'][_0x1577('0xc5')]=function(_0x3fc57b){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopperHistory['avgHandleTime'](_0x3fc57b))[_0x1577('0xbf')](loggerCatch(_0x1577('0xc6')));};Dialer['prototype'][_0x1577('0xc7')]=function(_0x485fd7){return BPromise[_0x1577('0xbd')]()['then'](cmHopper['rescheduleContact'](_0x485fd7))[_0x1577('0xbf')](loggerCatch(_0x1577('0xc8')));};Dialer['prototype']['unlockContact']=function(_0x2f97c2,_0x526b4b,_0x5bdc2c){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopper[_0x1577('0xc9')](_0x2f97c2,_0x526b4b,_0x5bdc2c))[_0x1577('0xbf')](loggerCatch(_0x1577('0xca')));};Dialer[_0x1577('0x1a')][_0x1577('0xcb')]=function(_0xd6c94c,_0x57e0eb,_0xef048a,_0x5898db,_0x3ef055){return BPromise['resolve']()[_0x1577('0xbe')](cmHopper['getContactDialer'](_0xd6c94c,_0x57e0eb,_0xef048a,_0x5898db))['catch'](function(_0xd61d57){_0x3ef055[_0x1577('0xcc')]-=_0xef048a;_0x3ef055[_0x1577('0xcc')]=_0x3ef055[_0x1577('0xcc')]>0x0?_0x3ef055[_0x1577('0xcc')]:0x0;loggerCatch(_0x1577('0xcd'))(_0xd61d57);});};Dialer['prototype'][_0x1577('0xce')]=function(_0x1c8bd8,_0xd94609,_0x1a3088,_0x2b0063){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopper[_0x1577('0xce')](_0x1c8bd8,_0xd94609,_0x1a3088))[_0x1577('0xbf')](function(_0x3b69c4){_0x2b0063[_0x1577('0xcc')]-=_0xd94609;_0x2b0063[_0x1577('0xcc')]=_0x2b0063['temp']>0x0?_0x2b0063['temp']:0x0;loggerCatch(_0x1577('0xcf'))(_0x3b69c4);});};Dialer['prototype'][_0x1577('0xd0')]=function(_0x4cde66){return BPromise['resolve']()[_0x1577('0xbe')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4cde66))[_0x1577('0xbf')](loggerCatch(_0x1577('0xd1')));};Dialer['prototype'][_0x1577('0xd2')]=function(_0x5dcdc0){return BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](cmHopper[_0x1577('0xd2')](_0x5dcdc0))[_0x1577('0xbf')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x1577('0x1a')][_0x1577('0xd3')]=function(_0x5d6a9b){return BPromise['resolve']()[_0x1577('0xbe')](cmHopperHistory[_0x1577('0xd3')](_0x5d6a9b))[_0x1577('0xbf')](loggerCatch(_0x1577('0xd4')));};Dialer[_0x1577('0x1a')][_0x1577('0xbb')]=function(_0x53c356){if(!_[_0x1577('0x3d')](_0x53c356)&&_0x53c356!==null){if(typeof _0x53c356[_0x1577('0x74')]!=='undefined'){if(_0x53c356['originated']>0x0){_0x53c356[_0x1577('0x74')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1577('0x9a')](_0x1577('0xd5'));}};Dialer[_0x1577('0x1a')][_0x1577('0xd6')]=function(_0x117dd2,_0x5cbd74){var _0x4b08d2=this;return function(_0x572430){_0x4b08d2[_0x1577('0xbb')](_0x5cbd74);logger['error'](_0x117dd2,util[_0x1577('0x9c')](_0x572430,{'showHidden':![],'depth':null}));};};Dialer[_0x1577('0x1a')][_0x1577('0xd7')]=function(_0x4c771f,_0x283b5a,_0x4ef918){var _0x52d827={'state':0x19,'statedesc':_0x1577('0xd8')};this[_0x1577('0xbb')](_0x283b5a);this[_0x1577('0xd9')](_[_0x1577('0xda')](_0x52d827,_['pick'](_0x4ef918,[_0x1577('0xdb'),_0x1577('0xdc'),_0x1577('0xdd'),_0x1577('0xde'),'CampaignId'])),'[emptyContact][createHistory]',_0x1577('0xdf'));logger['error'](_0x4c771f);};Dialer[_0x1577('0x1a')][_0x1577('0xe0')]=function(_0x4151df){return _0x4151df===_0x1577('0xe1');};Dialer[_0x1577('0x1a')][_0x1577('0xe2')]=function(_0x387160){return!_[_0x1577('0x3d')](_0x387160)&&_0x387160&&!_['isUndefined'](_0x387160['name'])&&!_[_0x1577('0x3d')](_0x387160[_0x1577('0x79')])&&_0x387160['active']&&(this['trunks'][util[_0x1577('0x7c')]('SIP/%s',_0x387160['name'])]['status']===_0x1577('0xe3')||this[_0x1577('0x22')][util['format'](_0x1577('0xe4'),_0x387160[_0x1577('0x40')])][_0x1577('0xb6')]===_0x1577('0xe5'));};Dialer[_0x1577('0x1a')][_0x1577('0xd9')]=function(_0x146e77,_0x3785d8,_0x2bb30d){this['createHistory'](_0x146e77)[_0x1577('0xbf')](loggerCatch(_0x3785d8));this[_0x1577('0xd2')](_0x146e77)[_0x1577('0xbf')](loggerCatch(_0x2bb30d));};Dialer[_0x1577('0x1a')][_0x1577('0x36')]=function(_0xd0f21c){var _0x91c648=this[_0x1577('0x25')][_0xd0f21c[_0x1577('0xe6')]];var _0x13ebe1;if(!_[_0x1577('0xb4')](_0xd0f21c)&&!_[_0x1577('0xb4')](_0xd0f21c[_0x1577('0xe7')])&&!_['isNil'](_0xd0f21c[_0x1577('0xe7')][_0x1577('0xe8')])&&_0xd0f21c[_0x1577('0xe9')]==='xcally-motion-dialer'&&_0x91c648){if(_0x91c648[_0x1577('0x4c')]!=='ivr'&&this['voiceQueues'][_0x91c648['queue']][_0x1577('0xea')]&&_0xd0f21c[_0x1577('0xeb')]===_0x1577('0xec')){delete this[_0x1577('0x25')][_0xd0f21c[_0x1577('0xe6')]];this[_0x1577('0xbb')](this[_0x1577('0x1f')][_0x91c648['queue']]);this[_0x1577('0x1f')][_0x91c648[_0x1577('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0x1577('0x1f')][_0x91c648['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x13ebe1=new Hangup(_0x91c648,_0xd0f21c);_0x13ebe1[_0x1577('0xad')]=0x12;_0x13ebe1[_0x1577('0xed')]=_0x1577('0xee');_0x13ebe1['membername']=_0x1577('0xef');ami[_0x1577('0x4b')](_0x1577('0xf0'),ut['buildObj'](_0x13ebe1,_0x1577('0xf1')));this[_0x1577('0xd9')](_0x13ebe1,_0x1577('0xf2'),'[syncHangupInAMD]');}if(_0x91c648[_0x1577('0x4c')]!=='ivr'&&this[_0x1577('0x1f')][_0x91c648['queue']][_0x1577('0xea')]&&_0xd0f21c[_0x1577('0xeb')]===_0x1577('0xf3')){var _0x9ab3e1=this;return new BPromise(function(_0x3b4151,_0x56bdaa){delete _0x9ab3e1[_0x1577('0x25')][_0xd0f21c['uniqueid']];_0x9ab3e1[_0x1577('0xbb')](_0x9ab3e1[_0x1577('0x1f')][_0x91c648['queue']]);_0x9ab3e1[_0x1577('0x1f')][_0x91c648[_0x1577('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x9ab3e1['voiceQueues'][_0x91c648[_0x1577('0xb9')]][_0x1577('0xf4')]+=0x1;var _0x4d2635=_0x9ab3e1[_0x1577('0x1f')][_0x91c648[_0x1577('0xb9')]];var _0x356bf8=new Hangup(_0x91c648,_0xd0f21c);_0x356bf8[_0x1577('0xad')]=0x13;_0x356bf8[_0x1577('0xed')]=_0x1577('0xf5');_0x356bf8['membername']='AMD';_0x356bf8[_0x1577('0xf6')]+=0x1;_0x356bf8[_0x1577('0xf7')]+=0x1;_0x356bf8[_0x1577('0xf1')]=!![];ami['emit']('custom:amd',ut[_0x1577('0xf8')](_0x356bf8,_0x1577('0xf1')));_0x9ab3e1['createHistory'](_0x356bf8)[_0x1577('0xbf')](loggerCatch(_0x1577('0xf9')));if(_0x356bf8[_0x1577('0xfa')]+_0x356bf8['countcongestionretry']+_0x356bf8[_0x1577('0xfb')]+_0x356bf8[_0x1577('0xfc')]+_0x356bf8[_0x1577('0xfd')]+_0x356bf8[_0x1577('0xfe')]+_0x356bf8['countmachineretry']+_0x356bf8[_0x1577('0xff')]>=_0x4d2635['dialGlobalMaxRetry']){_0x9ab3e1[_0x1577('0x100')](_0x356bf8,_0x3b4151,_0x56bdaa,'reason19\x20machine....');}else{if(_0x356bf8[_0x1577('0xf6')]>=_0x4d2635[_0x1577('0x101')]){_0x9ab3e1[_0x1577('0x102')](_0x356bf8,_0x3b4151,_0x56bdaa,_0x1577('0x103'));}else{_0x9ab3e1['rescheduleContact']({'active':![],'countmachineretry':_0x356bf8['countmachineretry'],'scheduledat':moment()[_0x1577('0x104')](_0x4d2635[_0x1577('0x105')],_0x1577('0x106'))[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x356bf8['ContactId'],'ListId':_0x356bf8[_0x1577('0xdc')],'VoiceQueueId':_0x356bf8[_0x1577('0xde')]||undefined,'CampaignId':_0x356bf8['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x3b4151({'reschedule':0x1});}}});}if(_0x91c648[_0x1577('0x4c')]==='ivr'&&this[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]][_0x1577('0xea')]&&_0xd0f21c['value']===_0x1577('0xec')){delete this['uniqueId'][_0xd0f21c[_0x1577('0xe6')]];this[_0x1577('0xbb')](this[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]]);_0x13ebe1=new Hangup(_0x91c648,_0xd0f21c);_0x13ebe1['state']=0x12;_0x13ebe1[_0x1577('0xed')]=_0x1577('0xee');_0x13ebe1[_0x1577('0x108')]=_0x1577('0xef');ami['emit'](_0x1577('0xf0'),ut[_0x1577('0xf8')](_0x13ebe1,'amd'));this[_0x1577('0xd9')](_0x13ebe1,_0x1577('0x109'),_0x1577('0x10a'));}if(_0x91c648[_0x1577('0x4c')]==='ivr'&&this[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]][_0x1577('0xea')]&&_0xd0f21c[_0x1577('0xeb')]===_0x1577('0xf3')){var _0x9ab3e1=this;return new BPromise(function(_0x42098a,_0x4cc657){delete _0x9ab3e1[_0x1577('0x25')][_0xd0f21c['uniqueid']];_0x9ab3e1[_0x1577('0xbb')](_0x9ab3e1[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]]);_0x9ab3e1[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]][_0x1577('0x5f')]+=0x1;_0x9ab3e1[_0x1577('0x20')][_0x91c648[_0x1577('0xb9')]][_0x1577('0xf4')]+=0x1;var _0x1dccc4=_0x9ab3e1['campaigns'][_0x91c648[_0x1577('0xb9')]];var _0x412b8a=new Hangup(_0x91c648,_0xd0f21c);_0x412b8a[_0x1577('0xad')]=0x13;_0x412b8a[_0x1577('0xed')]=_0x1577('0xf5');_0x412b8a[_0x1577('0x108')]='AMD';_0x412b8a[_0x1577('0xf6')]+=0x1;_0x412b8a[_0x1577('0xf7')]+=0x1;_0x412b8a[_0x1577('0xf1')]=!![];ami['emit']('custom:amd',ut[_0x1577('0xf8')](_0x412b8a,'amd'));_0x9ab3e1['createHistory'](_0x412b8a)[_0x1577('0xbf')](loggerCatch(_0x1577('0xf9')));if(_0x412b8a['countbusyretry']+_0x412b8a[_0x1577('0x10b')]+_0x412b8a[_0x1577('0xfb')]+_0x412b8a[_0x1577('0xfc')]+_0x412b8a['countdropretry']+_0x412b8a['countabandonedretry']+_0x412b8a[_0x1577('0xf6')]+_0x412b8a[_0x1577('0xff')]>=_0x1dccc4[_0x1577('0x10c')]){_0x9ab3e1[_0x1577('0x100')](_0x412b8a,_0x42098a,_0x4cc657,_0x1577('0x10d'));}else{if(_0x412b8a[_0x1577('0xf6')]>=_0x1dccc4['dialMachineMaxRetry']){_0x9ab3e1[_0x1577('0x102')](_0x412b8a,_0x42098a,_0x4cc657,'reason\x2019\x20machine....');}else{_0x9ab3e1['rescheduleContact']({'active':![],'countmachineretry':_0x412b8a[_0x1577('0xf6')],'scheduledat':moment()[_0x1577('0x104')](_0x1dccc4[_0x1577('0x105')],_0x1577('0x106'))[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x412b8a[_0x1577('0xdb')],'ListId':_0x412b8a[_0x1577('0xdc')],'VoiceQueueId':_0x412b8a['VoiceQueueId']||undefined,'CampaignId':_0x412b8a[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x10f')));_0x42098a({'reschedule':0x1});}}});}}};Dialer[_0x1577('0x1a')][_0x1577('0x34')]=function(_0x2ecfdf){var _0x3a773c=this[_0x1577('0x25')][_0x2ecfdf[_0x1577('0xe6')]];var _0x4bee61=this;var _0x545da8;if(_0x3a773c&&_0x3a773c[_0x1577('0x4c')]===_0x1577('0x97')){delete this['uniqueId'][_0x2ecfdf[_0x1577('0xe6')]];this[_0x1577('0xbb')](this[_0x1577('0x20')][_0x3a773c[_0x1577('0xb9')]]);this[_0x1577('0x20')][_0x3a773c[_0x1577('0xb9')]][_0x1577('0x110')]+=0x1;_0x545da8=new Hangup(_0x3a773c,_0x2ecfdf);this[_0x1577('0xd3')](_0x545da8)[_0x1577('0xbf')](loggerCatch(_0x1577('0x111')));this[_0x1577('0xd2')](_0x545da8)[_0x1577('0xbf')](loggerCatch('[syncHangupIvr]'));}if(_0x3a773c&&_0x3a773c[_0x1577('0x4c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x3a773c[_0x1577('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x2ecfdf[_0x1577('0xe6')]];this['updateOriginated'](this['voiceQueues'][_0x3a773c[_0x1577('0xb9')]]);this[_0x1577('0x1f')][_0x3a773c['queue']][_0x1577('0x5f')]+=0x1;this['voiceQueues'][_0x3a773c['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x545da8=new Hangup(_0x3a773c,_0x2ecfdf);_0x545da8[_0x1577('0xad')]=0x10;_0x545da8['statedesc']='AnswerAGI';_0x545da8['membername']='AGI';this[_0x1577('0xd3')](_0x545da8)[_0x1577('0xbf')](loggerCatch(_0x1577('0x111')));this[_0x1577('0xd2')](_0x545da8)[_0x1577('0xbf')](loggerCatch(_0x1577('0x112')));}if(_0x3a773c&&_0x3a773c['type']!==_0x1577('0x97')&&!isNotNull(this[_0x1577('0x1f')][_0x3a773c[_0x1577('0xb9')]][_0x1577('0x113')])){delete this[_0x1577('0x25')][_0x2ecfdf['uniqueid']];this[_0x1577('0xbb')](this['voiceQueues'][_0x3a773c[_0x1577('0xb9')]]);this[_0x1577('0x1f')][_0x3a773c[_0x1577('0xb9')]][_0x1577('0x68')]+=0x1;_0x545da8=new Hangup(_0x3a773c,_0x2ecfdf);_0x545da8['state']=0xc;_0x545da8[_0x1577('0xed')]=_0x2ecfdf['cause-txt'];_0x545da8[_0x1577('0x108')]=_0x1577('0x114');this[_0x1577('0xd3')](_0x545da8)[_0x1577('0xbf')](loggerCatch(_0x1577('0x111')));this[_0x1577('0xd2')](_0x545da8)[_0x1577('0xbf')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x1577('0x1a')][_0x1577('0x31')]=function(_0x588094){var _0x268c5f=this['uniqueId'][_0x588094[_0x1577('0xe6')]];var _0x4a1f6c=this;if(this[_0x1577('0x1f')][_0x588094[_0x1577('0xb9')]]){if(_0x268c5f&&_0x268c5f[_0x1577('0x4c')]!==_0x1577('0x97')){delete this['uniqueId'][_0x588094['uniqueid']];this[_0x1577('0x1f')][_0x588094['queue']][_0x1577('0x5f')]+=0x1;var _0x38c5f5=new AgentComplete(_0x268c5f,_0x588094);if(_0x588094[_0x1577('0x115')]===_0x1577('0x116')){_0x38c5f5[_0x1577('0x117')]=this[_0x1577('0x1f')][_0x588094[_0x1577('0xb9')]][_0x1577('0x118')]&&this['voiceQueues'][_0x588094[_0x1577('0xb9')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x1577('0x107')):undefined;}this[_0x1577('0xd3')](_0x38c5f5)[_0x1577('0xbf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1577('0xd2')](_0x38c5f5)[_0x1577('0xbf')](loggerCatch(_0x1577('0x119')));}}};Dialer[_0x1577('0x1a')]['syncAgentConnect']=function(_0x24924c){if(this[_0x1577('0x1f')][_0x24924c[_0x1577('0xb9')]]){if(this[_0x1577('0x25')][_0x24924c['uniqueid']]&&this['uniqueId'][_0x24924c['uniqueid']][_0x1577('0x4c')]!==_0x1577('0x97')){this[_0x1577('0xbb')](this[_0x1577('0x1f')][_0x24924c[_0x1577('0xb9')]]);this[_0x1577('0x25')][_0x24924c[_0x1577('0xe6')]][_0x1577('0x11a')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));}}};Dialer[_0x1577('0x1a')][_0x1577('0x11b')]=function(_0x479fd2){this['createHistory'](_0x479fd2)[_0x1577('0xbf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1577('0xd2')](_0x479fd2)[_0x1577('0xbf')](loggerCatch(_0x1577('0x11c')));};Dialer[_0x1577('0x1a')]['syncQueueCallerAbandon']=function(_0x5bebdc){var _0x49560d=this[_0x1577('0x25')][_0x5bebdc['uniqueid']];var _0x486b69=this;if(this['voiceQueues'][_0x5bebdc[_0x1577('0xb9')]]){if(_0x49560d&&_0x49560d['type']!==_0x1577('0x97')){delete this[_0x1577('0x25')][_0x5bebdc['uniqueid']];this[_0x1577('0xbb')](this['voiceQueues'][_0x5bebdc[_0x1577('0xb9')]]);_0x49560d[_0x1577('0x11d')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));var _0x451d63=new QueueCallerAbandon(_0x49560d,_0x5bebdc);if(getSeconds(_0x49560d[_0x1577('0x11d')],_0x49560d[_0x1577('0x11e')])>=_0x49560d[_0x1577('0x11f')]){this[_0x1577('0x1f')][_0x5bebdc[_0x1577('0xb9')]][_0x1577('0x6d')]+=0x1;this[_0x1577('0x1f')][_0x5bebdc['queue']][_0x1577('0x64')]+=0x1;this[_0x1577('0x1f')][_0x5bebdc[_0x1577('0xb9')]][_0x1577('0x6f')]+=0x1;_0x451d63['state']=0xa;_0x451d63['statedesc']=_0x1577('0x120');_0x451d63['dropreason']=_0x1577('0x121');_0x451d63[_0x1577('0x117')]=this[_0x1577('0x1f')][_0x5bebdc[_0x1577('0xb9')]][_0x1577('0x118')]?moment()[_0x1577('0x7c')](_0x1577('0x107')):undefined;_0x451d63[_0x1577('0xfd')]+=0x1;_0x451d63['countglobal']+=0x1;if(_0x451d63[_0x1577('0xfd')]>=this[_0x1577('0x1f')][_0x5bebdc['queue']][_0x1577('0x122')]){this['queueCallerAbandonCreateState'](_0x451d63);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x451d63[_0x1577('0xfd')],'scheduledat':moment()[_0x1577('0x104')](this[_0x1577('0x1f')][_0x5bebdc[_0x1577('0xb9')]][_0x1577('0x123')],_0x1577('0x106'))[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x49560d['ContactId'],'ListId':_0x49560d[_0x1577('0xdc')],'VoiceQueueId':_0x49560d[_0x1577('0xde')]||undefined,'CampaignId':_0x49560d[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch('[rescheduleContact][Drop]'));var _0x2481d5=new History(_0x451d63);_0x2481d5[_0x1577('0xad')]=0xa;_0x2481d5[_0x1577('0xed')]=_0x1577('0x120');_0x2481d5[_0x1577('0xaf')]=moment()['format'](_0x1577('0x107'));_0x2481d5['endtime']=_0x2481d5[_0x1577('0xaf')];_0x2481d5[_0x1577('0x124')]=_0x451d63[_0x1577('0x124')];_0x2481d5['calleridnum']=_0x451d63[_0x1577('0x125')];this['createHistory'](_0x2481d5)[_0x1577('0xbf')](loggerCatch(_0x1577('0x126')));}}else{this[_0x1577('0x1f')][_0x5bebdc['queue']][_0x1577('0x6c')]+=0x1;this[_0x1577('0x1f')][_0x5bebdc['queue']][_0x1577('0x63')]+=0x1;_0x451d63[_0x1577('0xad')]=0xb;_0x451d63[_0x1577('0xed')]=_0x1577('0x127');_0x451d63[_0x1577('0x128')]='CALLEREXIT';_0x451d63[_0x1577('0xfe')]+=0x1;_0x451d63[_0x1577('0xf7')]+=0x1;if(_0x451d63[_0x1577('0xfe')]>=this['voiceQueues'][_0x5bebdc['queue']][_0x1577('0x129')]){this[_0x1577('0x11b')](_0x451d63);}else{this[_0x1577('0xc7')]({'active':![],'countabandonedretry':_0x451d63[_0x1577('0xfe')],'scheduledat':moment()[_0x1577('0x104')](this['voiceQueues'][_0x5bebdc['queue']][_0x1577('0x12a')],_0x1577('0x106'))[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x49560d[_0x1577('0xdb')],'ListId':_0x49560d[_0x1577('0xdc')],'VoiceQueueId':_0x49560d['VoiceQueueId']||undefined,'CampaignId':_0x49560d[_0x1577('0x10e')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2481d5=new History(_0x451d63);_0x2481d5['state']=0xb;_0x2481d5[_0x1577('0xed')]=_0x1577('0x127');_0x2481d5[_0x1577('0xaf')]=moment()[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2481d5[_0x1577('0xae')]=_0x2481d5[_0x1577('0xaf')];_0x2481d5[_0x1577('0x124')]=_0x451d63['calleridname'];_0x2481d5[_0x1577('0x125')]=_0x451d63['calleridnum'];this[_0x1577('0xd3')](_0x2481d5)[_0x1577('0xbf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0x1577('0x12b')]=function(_0x55b994){if(this[_0x1577('0xb1')][_0x55b994[_0x1577('0xe6')]]){this['actions'][_0x55b994[_0x1577('0xe6')]][_0x1577('0xb7')]=_0x55b994[_0x1577('0xb7')];}if(this['uniqueId'][_0x55b994[_0x1577('0xe6')]]){this[_0x1577('0x25')][_0x55b994['uniqueid']][_0x1577('0xb7')]=_0x55b994['channel'];}};Dialer[_0x1577('0x1a')]['syncQueueMember']=function(_0x497cd2){if(strategy[this[_0x1577('0x1f')][this[_0x1577('0xb1')][_0x497cd2['actionid']]['queue']][_0x1577('0x4e')]]===_0x1577('0x19')){if(this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]]&&_['isNil'](this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]][_0x1577('0x12d')])&&_0x497cd2[_0x1577('0xb6')]==='1'&&_0x497cd2[_0x1577('0x12e')]==='0'){if(this['agents'][_0x497cd2['stateinterface']]){if(!this[_0x1577('0x21')][_0x497cd2[_0x1577('0x12f')]][_0x1577('0x12d')]){this[_0x1577('0x21')][_0x497cd2[_0x1577('0x12f')]]['locked']=!![];this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]][_0x1577('0x12d')]=!![];this['actions'][_0x497cd2[_0x1577('0x12c')]][_0x1577('0x12f')]=_0x497cd2[_0x1577('0x12f')];}}}}else if((strategy[this[_0x1577('0x1f')][this['actions'][_0x497cd2['actionid']][_0x1577('0xb9')]][_0x1577('0x4e')]]||'rrmemory')===_0x1577('0x18')){if(this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]]){if(this[_0x1577('0x21')][_0x497cd2[_0x1577('0x12f')]]){this['actions'][_0x497cd2[_0x1577('0x12c')]][_0x1577('0x12f')]=_0x497cd2[_0x1577('0x12f')];if(_[_0x1577('0xb4')](this[_0x1577('0x2a')][this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]][_0x1577('0xb9')]])){this[_0x1577('0x2a')][this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]][_0x1577('0xb9')]]=[];}this[_0x1577('0x2a')][this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]]['queue']]['push'](_[_0x1577('0xda')](_['pick'](this[_0x1577('0xb1')][_0x497cd2[_0x1577('0x12c')]],[_0x1577('0x130'),_0x1577('0x12f')]),{'status':_0x497cd2[_0x1577('0xb6')],'paused':_0x497cd2[_0x1577('0x12e')]}));}}}};function unlockQueueStatus(_0x544e46,_0x37867d){setTimeout(function(){if(_[_0x1577('0x3d')](_0x544e46['queueStatusComplete'])){loggerBooked[_0x1577('0x9a')](_0x1577('0x131'),_0x37867d);}_0x544e46['queueStatusComplete']=!![];loggerBooked[_0x1577('0x81')](_0x1577('0x132'),_0x37867d,JSON[_0x1577('0x7b')](_['pick'](_0x544e46,[_0x1577('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x4a0407){var _0x155c6b=this;var _0x547b56=_0x155c6b['voiceQueues'][_0x155c6b[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]];if(strategy[this['voiceQueues'][this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]][_0x1577('0x4e')]]==='roundrobin'){if(this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]]&&this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]]['stateinterface']){this[_0x1577('0x96')][_0x1577('0x133')](this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0x130')],this[_0x1577('0xb1')][_0x4a0407['actionid']][_0x1577('0x12f')])[_0x1577('0xbf')](function(_0x463da1){logger[_0x1577('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x463da1,{'showHidden':![],'depth':null}));})['finally'](function(){_0x155c6b[_0x1577('0xbb')](_0x155c6b[_0x1577('0x1f')][_0x155c6b[_0x1577('0xb1')][_0x4a0407['actionid']][_0x1577('0xb9')]]);_0x155c6b[_0x1577('0x21')][_0x155c6b['actions'][_0x4a0407['actionid']][_0x1577('0x12f')]][_0x1577('0x12d')]=![];delete _0x155c6b[_0x1577('0xb1')][_0x4a0407['actionid']];unlockQueueStatus(_0x547b56);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x1577('0xb1')][_0x4a0407['actionid']][_0x1577('0xb9')]]);this[_0x1577('0xc7')]({'active':![],'ContactId':this[_0x1577('0xb1')][_0x4a0407['actionid']][_0x1577('0xdb')],'ListId':this['actions'][_0x4a0407['actionid']][_0x1577('0xdc')],'VoiceQueueId':this[_0x1577('0xb1')][_0x4a0407['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x134')));delete this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]];unlockQueueStatus(_0x547b56);}}else if((strategy[this['voiceQueues'][this[_0x1577('0xb1')][_0x4a0407['actionid']][_0x1577('0xb9')]][_0x1577('0x4e')]]||_0x1577('0x18'))==='rrmemory'){var _0x486439;if(this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]]&&!_[_0x1577('0x47')](this[_0x1577('0x2a')][this['actions'][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]])){if(this['queueBookedRR'][_0x155c6b[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]]){this[_0x1577('0x2b')][_0x155c6b['actions'][_0x4a0407['actionid']]['queue']]=this['queueBookedRR'][this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]]['queue']]?this[_0x1577('0x2b')][this['actions'][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]]:this[_0x1577('0x2a')][this['actions'][_0x4a0407['actionid']][_0x1577('0xb9')]]?this[_0x1577('0x2a')][this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]][_0x1577('0x135')]||0x0:0x0;}this[_0x1577('0x2a')][this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]][_0x1577('0xb9')]][_0x1577('0x135')]=this['queueBookedRR'][this[_0x1577('0xb1')][_0x4a0407[_0x1577('0x12c')]]['queue']];for(var _0x451fe8=0x0;_0x451fe8=0x0;})[_0x1577('0xbf')](myreject(_0x4d4d8c)));}}else{_0x40353f['push'](ami['Action']({'action':_0x1577('0x14f'),'command':util['format'](_0x1577('0x153'),_0x218c20,!_[_0x1577('0x3d')](config[_0x1577('0x151')][_0x2468da])?_0x2468da:'')})[_0x1577('0xbe')](function(_0x2fcafe){return _0x2fcafe[_0x1577('0x152')][_0x1577('0x154')](_0x1577('0x155'))>=0x0;})['catch'](myreject(_0x4d4d8c)));}BPromise['all'](_0x40353f)['then'](function(_0x298d96){var _0x40f039=_['some'](_0x298d96);if(_0x40f039){return _0x32a981(_0x40f039);}else{_0x19c9d5['message']=_0x1809dd?_0x1577('0x156'):_0x1577('0x157');return _0x4d4d8c(msgResponse(_0x1577('0x158'),'Failure',_0x1577('0x159')+_0x1809dd+'\x20'+_0x673bf0+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x218c20,{'showHidden':![],'depth':null})+_0x1577('0x15a')+_0x2468da));}})[_0x1577('0xbf')](function(_0x5558bd){return _0x4d4d8c(msgResponse(_0x1577('0x145'),'Failure',JSON[_0x1577('0x7b')](_0x5558bd)));});});};Dialer['prototype'][_0x1577('0x15b')]=function(_0x48a597){var _0x5a3612=this;return function(){switch(_0x48a597[_0x1577('0x5b')]){case _0x1577('0x15c'):freeVariablesPredictive(_0x48a597);_0x5a3612[_0x1577('0x15d')](_0x48a597,0x1);break;case'power':freeVariablesPredictive(_0x48a597);_0x5a3612['handlePower'](_0x48a597,_0x48a597[_0x1577('0x15e')]);break;case _0x1577('0x8'):_0x5a3612[_0x1577('0x8')](_0x48a597);break;case'booked':freeVariablesPredictive(_0x48a597);_0x5a3612[_0x1577('0x15d')](_0x48a597,0x1);break;default:freeVariablesPredictive(_0x48a597);logger[_0x1577('0x9a')]('Queue',_0x48a597[_0x1577('0x40')],_0x1577('0x15f'));}};};Dialer[_0x1577('0x1a')][_0x1577('0x160')]=function(_0x29fae5){var _0x4acc64=this;return function(){_0x4acc64[_0x1577('0x161')](_0x29fae5);};};Dialer[_0x1577('0x1a')][_0x1577('0x9')]=function(_0x346566){var _0x4f71d8=this;if(isNotPreview(_0x346566[_0x1577('0x5b')])){if(isVoiceQueueOutbound(_0x346566[_0x1577('0x4c')])&&isActive(_0x346566['dialActive'])){_0x346566['sendMessageOneNotActive']=!![];BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](checkIsLoggedIn(_0x346566,_0x346566[_0x1577('0x50')]))['then'](checkIsActive(_0x346566,_0x346566[_0x1577('0x5a')]))['then'](checkInterval(_0x346566))[_0x1577('0xbe')](_0x4f71d8[_0x1577('0x141')](_0x346566))['then'](_0x4f71d8[_0x1577('0x144')](_0x346566[_0x1577('0x162')],_0x346566[_0x1577('0x163')],_0x346566[_0x1577('0x40')],_0x346566))['then'](_0x4f71d8[_0x1577('0x146')](_0x346566[_0x1577('0x43')],_0x346566[_0x1577('0x163')],_0x346566[_0x1577('0x40')],_0x346566))[_0x1577('0xbe')](_0x4f71d8[_0x1577('0x15b')](_0x346566))[_0x1577('0xbf')](loggerCatchQueueSummary(_0x1577('0x164'),_0x346566));}else{notSendMessagesQueue(_0x346566);}}else{freeVariablesPredictive(_0x346566);}};Dialer['prototype']['syncCampaigns']=function(){var _0x4a1e7b=this;var _0x541071;for(var _0x31e715 in this[_0x1577('0x20')]){if(typeof this[_0x1577('0x20')][_0x31e715]!==_0x1577('0x9e')){_0x541071=this[_0x1577('0x20')][_0x31e715];if(isCampaignIvr(_0x541071['type'])&&isActive(_0x541071[_0x1577('0x79')])){_0x541071[_0x1577('0xa6')]=!![];BPromise[_0x1577('0xbd')]()[_0x1577('0xbe')](checkIsActive(_0x541071,_0x541071[_0x1577('0x79')]))['then'](checkInterval(_0x541071))['then'](_0x4a1e7b['checkIsTrunkReachable'](_0x541071))[_0x1577('0xbe')](_0x4a1e7b[_0x1577('0x144')](_0x541071[_0x1577('0x162')],_0x541071[_0x1577('0x163')],_0x541071['name'],_0x541071))[_0x1577('0xbe')](_0x4a1e7b['checkIfTimeIntervals'](_0x541071[_0x1577('0x43')],_0x541071[_0x1577('0x163')],_0x541071[_0x1577('0x40')],_0x541071))[_0x1577('0xbe')](_0x4a1e7b['launchHandleIvr'](_0x541071))[_0x1577('0xbf')](loggerCatchQueueSummary('[syncCampaigns]',_0x541071));}else{notSendMessagesCampaign(_0x541071);}}}};function getCallerIdRandom(_0x26b622,_0x5e7c41){var _0x4a3540;var _0x32edfc;var _0x2294e3;if(_0x5e7c41<=0x0){_0x5e7c41=0x1;}_0x4a3540=new RegExp(_0x1577('0x165')+_0x5e7c41+'}$');_0x32edfc=Math[_0x1577('0x166')](0xa,_0x5e7c41-0x1);_0x2294e3=Math['pow'](0xa,_0x5e7c41)-0x1;return util[_0x1577('0x7c')]('%s',_[_0x1577('0x167')](_0x26b622,_0x4a3540,_[_0x1577('0x168')](_0x32edfc,_0x2294e3)));}function extractCalleridName(_0x159984){var _0x7300ff=_0x159984[_0x1577('0x169')](/"(.*?)"/);return _0x7300ff?_0x7300ff[0x1]:_0x159984;}function extractCalleridNumber(_0x84f479){var _0x288919=_0x84f479['match'](/<(.*?)>/);return _0x288919?_0x288919[0x1]:_0x84f479;}Dialer[_0x1577('0x1a')][_0x1577('0x16a')]=function(_0x104cd8,_0x57e779){var _0x28a67a=this;var _0x2b160b=uuid['v4']();this[_0x1577('0xb1')][_0x2b160b]=new Action(_0x104cd8,_0x57e779,_0x2b160b);return new BPromise(function(_0x1fa218,_0x2c4769){if(_[_0x1577('0x3d')](_0x104cd8)&&typeof _0x104cd8!==_0x1577('0x16b')){return _0x2c4769(msgResponse(_0x1577('0x16c'),_0x1577('0x147'),_0x1577('0x16d')));}if(_[_0x1577('0x3d')](_0x57e779[_0x1577('0x16e')][_0x1577('0x16f')])||_0x57e779[_0x1577('0x16e')][_0x1577('0x16f')]===null){return _0x2c4769(msgResponse(_0x1577('0x16c'),'Failure',_0x1577('0x170')));}var _0x34a11a={'XMD-CALLERID':_0x28a67a['actions'][_0x2b160b][_0x1577('0x171')](),'XMD-AGI':_0x104cd8[_0x1577('0x113')]?util[_0x1577('0x7c')](_0x1577('0x172'),ipAgi,_0x104cd8[_0x1577('0x113')]):_0x1577('0x173'),'XMD-AGIAFTER':_0x104cd8[_0x1577('0x118')]?util['format'](_0x1577('0x172'),ipAgi,_0x104cd8[_0x1577('0x118')]):_0x1577('0x173'),'XMD-QUEUE':_0x104cd8[_0x1577('0x4c')]==='outbound'?util[_0x1577('0x7c')](_0x1577('0x174'),_0x104cd8[_0x1577('0x40')],_0x104cd8[_0x1577('0x175')]||'',_0x104cd8[_0x1577('0x176')]?'c':'',_0x104cd8['dialQueueTimeout']||0x3):_0x1577('0x173'),'XMD-CONTACTID':_0x57e779[_0x1577('0xdb')],'XMD-CDRTYPE':_0x1577('0x177'),'CALLERID(all)':_0x28a67a['actions'][_0x2b160b][_0x1577('0x171')](),'XMD-AMD':_0x104cd8[_0x1577('0xea')]?_0x1577('0x178'):_0x1577('0x173'),'XMD-DESTINATION':_0x1577('0x179')};if(_0x104cd8[_0x1577('0xea')]){_0x34a11a['XMD-AMDINITIALSILENCE']=_0x104cd8[_0x1577('0x17a')]||0x9c4;_0x34a11a[_0x1577('0x17b')]=_0x104cd8[_0x1577('0x17c')]||0x5dc;_0x34a11a[_0x1577('0x17d')]=_0x104cd8[_0x1577('0x17e')]||0x320;_0x34a11a[_0x1577('0x17f')]=_0x104cd8['dialAMDTotalAnalysisTime']||0x1388;_0x34a11a[_0x1577('0x180')]=_0x104cd8['dialAMDMinWordLength']||0x64;_0x34a11a[_0x1577('0x181')]=_0x104cd8[_0x1577('0x182')]||0x32;_0x34a11a['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x104cd8[_0x1577('0x183')]||0x3;_0x34a11a[_0x1577('0x184')]=_0x104cd8[_0x1577('0x185')]||0x100;_0x34a11a[_0x1577('0x186')]=_0x104cd8[_0x1577('0x187')]||0x1388;}if(_0x104cd8[_0x1577('0x4c')]===_0x1577('0x4d')){_0x34a11a[_0x1577('0x188')]=_0x57e779[_0x1577('0xde')];}else{_0x34a11a[_0x1577('0x189')]=_0x57e779['CampaignId'];}for(var _0x3ff771 in _0x57e779[_0x1577('0x16e')]){if(typeof _0x57e779[_0x1577('0x16e')][_0x3ff771]!=='undefined'){if(isNotNull(_0x57e779[_0x1577('0x16e')][_0x3ff771])&&_0x3ff771!=='id'&&_0x3ff771!==_0x1577('0x18a')&&_0x3ff771!==_0x1577('0x18b')&&_0x3ff771!=='updatedAt'){_0x34a11a[util['format'](_0x1577('0x18c'),_0x1577('0x18d'),_['toUpper'](_0x3ff771))]=_0x57e779['Contact'][_0x3ff771];}}}var _0x4561b3=_0x28a67a[_0x1577('0xe2')](_0x104cd8['Trunk'])?getCallerId(_0x104cd8[_0x1577('0x78')]['callerid'],_0x104cd8[_0x1577('0x5c')],_0x104cd8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x104cd8[_0x1577('0x5d')],_0x104cd8['dialRandomLastDigitCallerIdNumber']):_0x104cd8['dialOriginateCallerIdNumber']):getCallerId(_[_0x1577('0xb4')](_0x104cd8[_0x1577('0x142')])?_0x104cd8[_0x1577('0x78')][_0x1577('0x7a')]:_0x104cd8['TrunkBackup']['callerid'],_0x104cd8[_0x1577('0x5c')],_0x104cd8[_0x1577('0x18e')]>0x0?getCallerIdRandom(_0x104cd8[_0x1577('0x5d')],_0x104cd8['dialRandomLastDigitCallerIdNumber']):_0x104cd8[_0x1577('0x5d')]);if(_0x4561b3){_0x34a11a[_0x1577('0x18f')]=_0x28a67a[_0x1577('0xb1')][_0x2b160b][_0x1577('0x190')]=extractCalleridName(_0x4561b3);_0x34a11a[_0x1577('0x191')]=_0x28a67a['actions'][_0x2b160b]['originatecalleridnum']=extractCalleridNumber(_0x4561b3);}return ami[_0x1577('0xb5')]({'actionid':_0x2b160b,'action':'originate','channel':_0x28a67a[_0x1577('0xe2')](_0x104cd8[_0x1577('0x78')])?util['format'](_0x1577('0x192'),_0x104cd8['Trunk']['name'],isNotNull(_0x104cd8[_0x1577('0x5e')])?_0x104cd8[_0x1577('0x5e')]['trim']()||'':'',_0x104cd8[_0x1577('0x193')]>0x0?_0x57e779['Contact'][_0x1577('0x16f')][_0x1577('0x194')](_0x104cd8[_0x1577('0x193')]):_0x57e779[_0x1577('0x16e')][_0x1577('0x16f')]):util[_0x1577('0x7c')](_0x1577('0x192'),_['isNil'](_0x104cd8['TrunkBackup'])?_0x104cd8[_0x1577('0x78')][_0x1577('0x40')]:_0x104cd8[_0x1577('0x142')][_0x1577('0x40')],isNotNull(_0x104cd8[_0x1577('0x5e')])?_0x104cd8[_0x1577('0x5e')]['trim']()||'':'',_0x104cd8[_0x1577('0x193')]>0x0?_0x57e779['Contact'][_0x1577('0x16f')][_0x1577('0x194')](_0x104cd8['dialCutDigit']):_0x57e779[_0x1577('0x16e')]['phone']),'callerid':_0x4561b3,'Exten':_0x1577('0x179'),'Context':_0x1577('0x195'),'Priority':'1','variable':_0x34a11a,'timeout':(_0x104cd8[_0x1577('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2b160b})[_0x1577('0xbe')](function(_0x4e170b){return _0x1fa218(_0x4e170b);})[_0x1577('0xbf')](function(_0xe4d9ce){_0x104cd8[_0x1577('0x197')]+=0x1;var _0x43ff1c=new History(_0x28a67a[_0x1577('0xb1')][_0x2b160b]);logger['error'](util['format'](_0x1577('0x198'),JSON[_0x1577('0x7b')](_0xe4d9ce)));_0x43ff1c[_0x1577('0xad')]=0xe;_0x43ff1c[_0x1577('0xed')]=_0x1577('0x199');_0x43ff1c[_0x1577('0xaf')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));_0x43ff1c[_0x1577('0xae')]=_0x43ff1c[_0x1577('0xaf')];_0x28a67a[_0x1577('0xd3')](_0x43ff1c)[_0x1577('0xbf')](loggerCatch(_0x1577('0x19a')));_0x28a67a[_0x1577('0xd2')](_0x43ff1c)['catch'](loggerCatch(_0x1577('0x19a')))[_0x1577('0x1d')](function(){delete _0x28a67a[_0x1577('0xb1')][_0x2b160b];return _0x2c4769(msgResponse(_0x1577('0x16c'),_0x1577('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0x1577('0x1a')]['syncOriginateResponse']=function(_0x43ea84){var _0xab5872=this['actions'][_0x43ea84['actionid']];if(_0xab5872){delete this['actions'][_0x43ea84[_0x1577('0x12c')]];_0xab5872[_0x1577('0x11e')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));var _0x1c6865=_0xab5872['type']===_0x1577('0x97')?this[_0x1577('0x20')][_0xab5872[_0x1577('0xb9')]]:this[_0x1577('0x1f')][_0xab5872[_0x1577('0x19b')]()];if(!this[_0x1577('0xe0')](_0x43ea84['response'])){this[_0x1577('0xbb')](_0x1c6865);return this[_0x1577('0x19c')](_0xab5872,_0x1c6865,_0x43ea84)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x1577('0x25')][_0x43ea84[_0x1577('0xe6')]]=_0xab5872;}};Dialer[_0x1577('0x1a')][_0x1577('0x19d')]=function(_0x4f135a,_0x575fd1,_0x51d805){var _0x2a7642=new History(_0x575fd1);if(_0x2a7642['countbusyretry']+_0x2a7642[_0x1577('0x10b')]+_0x2a7642[_0x1577('0xfb')]+_0x2a7642[_0x1577('0xfc')]+_0x2a7642[_0x1577('0xfd')]+_0x2a7642[_0x1577('0xfe')]+_0x2a7642[_0x1577('0xf6')]+_0x2a7642['countagentrejectretry']>=_0x51d805[_0x1577('0x10c')]-0x1){return!![];}switch(_0x4f135a){case 0x3:if(_0x2a7642[_0x1577('0xfb')]>=_0x51d805['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x1577('0xc7')]({'active':![],'countnoanswerretry':_0x2a7642[_0x1577('0xfb')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805['dialNoAnswerRetryFrequency'],_0x1577('0x106'))[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642['VoiceQueueId']||undefined,'CampaignId':_0x2a7642[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x19e')));break;case 0x5:if(_0x2a7642['countbusyretry']>=_0x51d805[_0x1577('0x19f')]-0x1){return!![];}this[_0x1577('0xc7')]({'active':![],'countbusyretry':_0x2a7642['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x51d805[_0x1577('0x1a0')],_0x1577('0x106'))[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1a1')));break;case 0x8:if(_0x2a7642['countcongestionretry']>=_0x51d805['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2a7642[_0x1577('0x10b')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805[_0x1577('0x1a2')],_0x1577('0x106'))[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x2a7642['ContactId'],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642['CampaignId']||undefined})[_0x1577('0xbf')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2a7642[_0x1577('0xfc')]>=_0x51d805[_0x1577('0x1a3')]-0x1){return!![];}else{this[_0x1577('0xc7')]({'active':![],'countnosuchnumberretry':_0x2a7642[_0x1577('0xfc')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805[_0x1577('0x1a4')],_0x1577('0x106'))[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642[_0x1577('0x10e')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2a7642[_0x1577('0xfd')]>=_0x51d805[_0x1577('0x122')]-0x1){return!![];}this[_0x1577('0xc7')]({'active':![],'countdropretry':_0x2a7642[_0x1577('0xfd')]+=0x1,'scheduledat':moment()['add'](_0x51d805['dialDropRetryFrequency'],'minutes')[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642['VoiceQueueId']||undefined,'CampaignId':_0x2a7642['CampaignId']||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1a5')));break;case 0xb:if(_0x2a7642[_0x1577('0xfe')]>=_0x51d805[_0x1577('0x129')]-0x1){return!![];}this[_0x1577('0xc7')]({'active':![],'countabandonedretry':_0x2a7642[_0x1577('0xfe')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805[_0x1577('0x12a')],_0x1577('0x106'))[_0x1577('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1a6')));break;case 0x13:if(_0x2a7642['countmachineretry']>=_0x51d805[_0x1577('0x101')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x2a7642[_0x1577('0xf6')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805['dialMachineRetryFrequency'],_0x1577('0x106'))[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642['CampaignId']||undefined})['catch'](loggerCatch(_0x1577('0x10f')));break;case 0x14:if(_0x2a7642['countagentrejectretry']>=_0x51d805[_0x1577('0x1a7')]-0x1){return!![];}this[_0x1577('0xc7')]({'active':![],'countagentrejectretry':_0x2a7642[_0x1577('0xff')]+=0x1,'scheduledat':moment()[_0x1577('0x104')](_0x51d805[_0x1577('0x1a8')],'minutes')[_0x1577('0x7c')](_0x1577('0x107')),'ContactId':_0x2a7642[_0x1577('0xdb')],'ListId':_0x2a7642[_0x1577('0xdc')],'VoiceQueueId':_0x2a7642[_0x1577('0xde')]||undefined,'CampaignId':_0x2a7642[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1a9')));break;default:return!![];}};Dialer[_0x1577('0x1a')]['callProgressDetecting']=function(_0x13abc8,_0xd63bab,_0x159552){var _0xaf6ef8=this;var _0x2652dd=new History(_0x13abc8);return new BPromise(function(_0x1bd363,_0x5cb67a){if(_[_0x1577('0x3d')](_0xd63bab)&&typeof _0xd63bab!==_0x1577('0x16b')){return _0x5cb67a(msgResponse(_0x1577('0x1aa'),'Failure',_0x1577('0x1ab')));}if(_[_0x1577('0x3d')](_0x159552)&&typeof _0x159552!=='object'){return _0x5cb67a(msgResponse('[callProgressDetecting]',_0x1577('0x147'),_0x1577('0x1ac')));}switch(_0x159552[_0x1577('0x115')]){case'0':_0xd63bab['outboundNoSuchCallsDay']+=0x1;_0x2652dd[_0x1577('0xad')]=0x0;_0x2652dd[_0x1577('0xed')]=_0x1577('0x1ad');_0x2652dd['countnosuchnumberretry']+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;ami[_0x1577('0x4b')]('custom:agentnosuchnumber',ut[_0x1577('0xf8')](_0x13abc8,'nosuchnumber'));_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)[_0x1577('0xbf')](loggerCatch(_0x1577('0xf9')));if(_0xaf6ef8[_0x1577('0x19d')](0x0,_0x13abc8,_0xd63bab)){if(_0x2652dd['countnosuchnumberretry']>=_0xd63bab['dialNoSuchNumberMaxRetry']){_0xaf6ef8[_0x1577('0x102')](_0x2652dd,_0x1bd363,_0x5cb67a,'reason\x200\x20no\x20such\x20number....');}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1ae'));}}break;case'3':_0xd63bab[_0x1577('0x1af')]+=0x1;_0x2652dd['state']=0x3;_0x2652dd[_0x1577('0xed')]=_0x1577('0x1b0');_0x2652dd[_0x1577('0xfb')]+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;ami['emit'](_0x1577('0x1b1'),ut[_0x1577('0xf8')](_0x13abc8,_0x1577('0x1b2')));_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)[_0x1577('0xbf')](loggerCatch(_0x1577('0x1b3')));if(_0xaf6ef8['checkRetriveMax'](0x3,_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0xfb')]>=_0xd63bab[_0x1577('0x1b4')]){_0xaf6ef8['createStateFinal'](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1b5'));}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1b5'));}}break;case'5':_0xd63bab['outboundBusyCallsDay']+=0x1;_0x2652dd['state']=0x5;_0x2652dd[_0x1577('0xed')]=_0x1577('0x1b6');_0x2652dd[_0x1577('0xfa')]+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;ami[_0x1577('0x4b')](_0x1577('0x1b7'),ut[_0x1577('0xf8')](_0x13abc8,'busy'));_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)[_0x1577('0xbf')](loggerCatch(_0x1577('0x1b8')));if(_0xaf6ef8[_0x1577('0x19d')](0x5,_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0xfa')]>=_0xd63bab['dialBusyMaxRetry']){_0xaf6ef8[_0x1577('0x102')](_0x2652dd,_0x1bd363,_0x5cb67a,'reason\x205\x20busy');}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1b9'));}}break;case'8':_0xd63bab['outboundCongestionCallsDay']+=0x1;_0x2652dd['state']=0x8;_0x2652dd[_0x1577('0xed')]=_0x1577('0x1ba');_0x2652dd['countcongestionretry']+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;ami[_0x1577('0x4b')]('custom:agentcongestion',ut[_0x1577('0xf8')](_0x13abc8,_0x1577('0x1bb')));_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)[_0x1577('0xbf')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xaf6ef8[_0x1577('0x19d')](0x8,_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0x10b')]>=_0xd63bab['dialCongestionMaxRetry']){_0xaf6ef8[_0x1577('0x102')](_0x2652dd,_0x1bd363,_0x5cb67a,'reason\x208\x20congestion');}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,'reason\x208\x20congestion');}}break;case'11':_0xd63bab[_0x1577('0x1bc')]+=0x1;_0x2652dd[_0x1577('0xad')]=0xb;_0x2652dd[_0x1577('0xed')]='Abandoned';_0x2652dd['countabandonedretry']+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)['catch'](loggerCatch(_0x1577('0x1bd')));if(_0xaf6ef8['checkRetriveMax'](0xb,_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0xfe')]>=_0xd63bab[_0x1577('0x129')]){_0xaf6ef8['createStateFinal'](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1be'));}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1be'));}}break;case'20':_0xd63bab['outboundRejectCallsDay']+=0x1;_0x2652dd[_0x1577('0xad')]=0x14;_0x2652dd[_0x1577('0xed')]=_0x1577('0x1bf');_0x2652dd[_0x1577('0xff')]+=0x1;_0x2652dd[_0x1577('0xf7')]+=0x1;ami[_0x1577('0x4b')](_0x1577('0x1c0'),ut['buildObj'](_0x13abc8,'agentreject'));_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)[_0x1577('0xbf')](loggerCatch(_0x1577('0x1c1')));if(_0xaf6ef8[_0x1577('0x19d')](0x14,_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0xff')]>=_0xd63bab['dialAgentRejectMaxRetry']){_0xaf6ef8['createStateFinal'](_0x2652dd,_0x1bd363,_0x5cb67a,_0x1577('0x1c2'));}else{_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,'reason\x2020\x20agentreject');}}break;default:_0xd63bab[_0x1577('0x68')]+=0x1;_0x2652dd[_0x1577('0xad')]=0xc;_0x2652dd[_0x1577('0xed')]=_0x159552[_0x1577('0x115')];_0xaf6ef8[_0x1577('0xd3')](_0x2652dd)['catch'](loggerCatch(_0x1577('0x1c3')));if(_0xaf6ef8['checkRetriveMax'](_0x159552[_0x1577('0x115')],_0x13abc8,_0xd63bab)){if(_0x2652dd[_0x1577('0xfa')]+_0x2652dd[_0x1577('0x10b')]+_0x2652dd[_0x1577('0xfb')]+_0x2652dd['countnosuchnumberretry']+_0x2652dd[_0x1577('0xfd')]+_0x2652dd[_0x1577('0xfe')]+_0x2652dd['countmachineretry']+_0x2652dd[_0x1577('0xff')]>=_0xd63bab[_0x1577('0x10c')]){_0xaf6ef8[_0x1577('0x100')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x159552[_0x1577('0x115')]);}else{_0xaf6ef8[_0x1577('0x102')](_0x2652dd,_0x1bd363,_0x5cb67a,_0x159552[_0x1577('0x115')]);}}}});};Dialer[_0x1577('0x1a')][_0x1577('0x100')]=function(_0x6b4ea,_0x4c0679,_0x58fdae,_0x102e9c){var _0x40f92f=new Final(_0x6b4ea);_0x40f92f[_0x1577('0xad')]=0xf;_0x40f92f[_0x1577('0xed')]=_0x1577('0x1c4');this['createStateFinal'](_0x40f92f,_0x4c0679,_0x58fdae,_0x102e9c);};Dialer[_0x1577('0x1a')][_0x1577('0x102')]=function(_0x2847bb,_0x47294e,_0x5b2ef8,_0x744c98){this[_0x1577('0xd2')](_0x2847bb)[_0x1577('0xbe')](function(){return _0x47294e(msgResponse(_0x1577('0x1aa'),'Success',_0x744c98));})[_0x1577('0xbf')](function(){return _0x5b2ef8(msgResponse(_0x1577('0x1c5'),_0x1577('0x147'),_0x1577('0x1c6')));});};Dialer[_0x1577('0x1a')][_0x1577('0x8')]=function(_0x5e66ae){var _0x8fb2df=_0x5e66ae['dialPredictiveOptimizationPercentage']/0x64;var _0x407ecd=_0x5e66ae[_0x1577('0x64')]/(_0x5e66ae[_0x1577('0x64')]+_0x5e66ae[_0x1577('0x5f')]);var _0x1b2e91=Math[_0x1577('0x1c7')](_0x5e66ae[_0x1577('0x72')]*(_0x5e66ae[_0x1577('0x1c8')]/0x64));var _0x3dfe24=Math['round'](_0x5e66ae[_0x1577('0x72')]*(_0x5e66ae[_0x1577('0x1c9')]/0x64));var _0x725c92=_0x5e66ae[_0x1577('0x4f')]+_0x5e66ae['talking'];var _0xff8665=Math['floor'](_0x5e66ae[_0x1577('0x8e')]*_0x5e66ae[_0x1577('0x76')]*_0x5e66ae[_0x1577('0x1ca')]*_0x5e66ae[_0x1577('0x70')]);if(_[_0x1577('0x3d')](_0x5e66ae[_0x1577('0x28')])){if(!_[_0x1577('0x3d')](_0x5e66ae[_0x1577('0x27')])){_0x5e66ae['startPredictive']=undefined;loggerPredictive[_0x1577('0x9a')](_0x1577('0x1cb'),_0x1577('0x1cc'));}if(!_['isUndefined'](_0x5e66ae['handlePredictive'])){loggerPredictive[_0x1577('0x9a')](_0x1577('0x1cb'),_0x1577('0x1cd'));clearInterval(_0x5e66ae[_0x1577('0x94')]);_0x5e66ae[_0x1577('0x94')]=undefined;}_0x5e66ae[_0x1577('0x28')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));loggerPredictive[_0x1577('0x81')](_0x5e66ae['name'],_0x1577('0x1ce'),_0x5e66ae[_0x1577('0x28')]);this[_0x1577('0x15d')](_0x5e66ae,0x1);}else if(ifInterval(_0x5e66ae['dialPredictiveInterval'],_0x5e66ae[_0x1577('0x28')])){this['handlePower'](_0x5e66ae,0x1);loggerPredictiveCalls[_0x1577('0x81')](_0x1577('0x1cf'),_0x5e66ae[_0x1577('0x28')],_0x5e66ae[_0x1577('0x40')]);_0x5e66ae[_0x1577('0x8e')]=0x0;_0x5e66ae['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x8fb2df<_0x407ecd&&_0x5e66ae[_0x1577('0x1d0')]==='dropRate'){freeVariablesPredictive(_0x5e66ae);loggerPredictive[_0x1577('0x81')](_0x1577('0x1d1'),_0x1577('0x1d2'),_0x407ecd,_0x1577('0x28'),_0x5e66ae[_0x1577('0x40')]);}else if(_0xff8665<_0x5e66ae['predictiveIntervalErlangCallsDroppedCalls']&&_0x5e66ae[_0x1577('0x1d0')]===_0x1577('0x1d3')){freeVariablesPredictive(_0x5e66ae);loggerPredictive[_0x1577('0x81')](_0x1577('0x1d4'),_0x1577('0x1d5'),_0xff8665,_0x1577('0x1d6'),_0x5e66ae[_0x1577('0x6f')],'startProgressive',_0x5e66ae['name']);}else if(!ifInterval(_0x5e66ae[_0x1577('0x1d7')],_0x5e66ae[_0x1577('0x28')])&&_[_0x1577('0x3d')](_0x5e66ae[_0x1577('0x27')])&&!_[_0x1577('0x3d')](_0x5e66ae[_0x1577('0x28')])){_0x5e66ae[_0x1577('0x27')]=moment()[_0x1577('0x7c')](_0x1577('0x107'));loggerPredictive['info'](_0x5e66ae[_0x1577('0x40')],'started\x20in\x20predictive\x20at',_0x5e66ae[_0x1577('0x27')]);this[_0x1577('0xc5')](_0x5e66ae[_0x1577('0x1d7')])['then'](this[_0x1577('0x1d8')](_0x5e66ae))[_0x1577('0xbe')](mergeDataErlangB(_0x5e66ae))[_0x1577('0xbe')](this[_0x1577('0x1d9')](_0x5e66ae))[_0x1577('0xbf')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5e66ae));}else if(!ifInterval(_0x5e66ae[_0x1577('0x1d7')],_0x5e66ae[_0x1577('0x27')])){_0x5e66ae[_0x1577('0x6f')]=0x0;_0x5e66ae[_0x1577('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x1577('0x81')](_0x5e66ae['name'],_0x1577('0x1da'),_0x5e66ae[_0x1577('0x27')]);clearInterval(_0x5e66ae[_0x1577('0x94')]);_0x5e66ae[_0x1577('0x94')]=undefined;this[_0x1577('0xc5')](_0x5e66ae[_0x1577('0x1d7')])[_0x1577('0xbe')](this['getDataPredictive'](_0x5e66ae))[_0x1577('0xbe')](mergeDataErlangB(_0x5e66ae))['then'](this[_0x1577('0x1d9')](_0x5e66ae))[_0x1577('0xbf')](loggerCatchPredictive(_0x1577('0x1db'),_0x5e66ae));}else if(_0x5e66ae[_0x1577('0x72')]&&_0x725c92<_0x5e66ae[_0x1577('0x72')]-_0x3dfe24){freeVariablesPredictive(_0x5e66ae);loggerPredictive[_0x1577('0x81')](_0x5e66ae[_0x1577('0x40')],_0x1577('0x1dc'),_0x725c92,')\x20are\x20less\x20than\x20threshold\x20(',_0x5e66ae[_0x1577('0x72')],'-',_0x3dfe24,'=',_0x5e66ae[_0x1577('0x72')]-_0x3dfe24,')');}else if(_0x5e66ae['predictiveIntervalAvailable']&&_0x725c92>_0x5e66ae['predictiveIntervalAvailable']+_0x1b2e91){freeVariablesPredictive(_0x5e66ae);loggerPredictive[_0x1577('0x81')](_0x5e66ae[_0x1577('0x40')],_0x1577('0x1dc'),_0x725c92,_0x1577('0x1dd'),_0x5e66ae[_0x1577('0x72')],'+',_0x1b2e91,'=',_0x5e66ae[_0x1577('0x72')]+_0x1b2e91,')');}};Dialer[_0x1577('0x1a')][_0x1577('0x1d8')]=function(_0x394df6){var _0x1a755a=this;return function(_0x1ca7c8){return new BPromise(function(_0x56998c,_0x375a27){_[_0x1577('0xda')](_0x394df6,_0x1ca7c8[0x0]);if(checkGetDataPredictive(_0x1ca7c8[0x0])){var _0x401046=_0x394df6[_0x1577('0x72')]=_0x394df6[_0x1577('0x55')]+_0x394df6[_0x1577('0x4f')];var _0x3b8a8b=_0x394df6[_0x1577('0x1d7')]*0x3c;var _0x4a96f2=_0x1ca7c8[0x0][_0x1577('0x6b')]+_0x1ca7c8[0x0][_0x1577('0x6a')];var _0x4990fc=(_0x1ca7c8[0x0][_0x1577('0x69')]+_0x1ca7c8[0x0][_0x1577('0x6d')]+_0x1ca7c8[0x0][_0x1577('0x6c')])/_0x1ca7c8[0x0]['predictiveIntervalTotalCalls'];_0x394df6[_0x1577('0x1ca')]=_0x4990fc>0x0?_0x4990fc:0x1;switch(_0x394df6[_0x1577('0x1d0')]){case _0x1577('0x1d3'):var _0x65e16b=_0x394df6[_0x1577('0x1de')]/0x64;return _0x1a755a[_0x1577('0x1df')](_0x401046,_0x3b8a8b,_0x4a96f2,_0x4990fc,_0x65e16b)['then'](function(_0x5a4c02){return _0x56998c(_0x5a4c02);});case _0x1577('0x1e0'):var _0x105530=_0x394df6['dialPredictiveOptimizationPercentage']/0x64;return _0x1a755a['busyFactor'](_0x401046,_0x3b8a8b,_0x4a96f2,_0x4990fc,_0x105530)[_0x1577('0xbe')](function(_0x1e9a3e){return _0x56998c(_0x1e9a3e);});default:return _0x375a27(msgResponse(_0x1577('0x1e1'),_0x1577('0x147'),_0x1577('0x1e2')));}}else{return _0x375a27(msgResponse(_0x1577('0x1e1'),_0x1577('0x147'),'check\x20failure'));}});};};Dialer[_0x1577('0x1a')][_0x1577('0x1e3')]=function(_0x5ec0c3){var _0x461740=this;return function(_0x1eb1bf){return new BPromise(function(_0x2f2e81,_0x52ffe9){_[_0x1577('0xda')](_0x5ec0c3,_0x1eb1bf[0x0]);if(checkGetDataPredictive(_0x1eb1bf[0x0])){loggerPredictive['info'](JSON[_0x1577('0x7b')](_0x1eb1bf[0x0]));if(_0x5ec0c3['dialPredictiveOptimization']===_0x1577('0x1d3')){return _0x461740[_0x1577('0xd0')](_0x5ec0c3['id'])[_0x1577('0xbe')](function(_0x54cf5f){var _0x16365d=_0x5ec0c3['loggedIn']-_0x54cf5f[0x0]['outboundQueuePauses'];var _0x36b4bc=_0x5ec0c3['dialPredictiveInterval']*0x3c;var _0x4ddbcf=_0x1eb1bf[0x0][_0x1577('0x6b')]+_0x1eb1bf[0x0][_0x1577('0x6a')];var _0x5156be=(_0x1eb1bf[0x0][_0x1577('0x69')]+_0x1eb1bf[0x0][_0x1577('0x6d')]+_0x1eb1bf[0x0][_0x1577('0x6c')])/_0x1eb1bf[0x0]['predictiveIntervalTotalCalls'];var _0x1763c4=_0x5ec0c3[_0x1577('0x1de')]/0x64;_0x5ec0c3[_0x1577('0x71')]=_0x54cf5f[0x0][_0x1577('0x1e4')]||0x0;_0x5ec0c3[_0x1577('0x1ca')]=_0x5156be>0x0?_0x5156be:0x1;return _0x461740['abandonmentRate'](_0x16365d,_0x36b4bc,_0x4ddbcf,_0x5156be,_0x1763c4);})[_0x1577('0xbe')](function(_0x967a12){return _0x2f2e81(_0x967a12);})[_0x1577('0xbf')](function(_0x157af2){return _0x52ffe9(msgResponse(_0x1577('0x1e5'),_0x1577('0x147'),JSON[_0x1577('0x7b')](_0x157af2)));});}if(_0x5ec0c3['dialPredictiveOptimization']===_0x1577('0x1e0')){return _0x461740['getVoiceQueueRtPauses'](_0x5ec0c3['id'])[_0x1577('0xbe')](function(_0x2328ce){var _0x6cae4f=_0x5ec0c3[_0x1577('0x50')]-_0x2328ce[0x0][_0x1577('0x1e4')];var _0x91e9b5=_0x5ec0c3[_0x1577('0x1d7')]*0x3c;var _0x4d590e=_0x1eb1bf[0x0][_0x1577('0x6b')]+_0x1eb1bf[0x0][_0x1577('0x6a')];var _0x12f2a2=(_0x1eb1bf[0x0][_0x1577('0x69')]+_0x1eb1bf[0x0][_0x1577('0x6d')]+_0x1eb1bf[0x0][_0x1577('0x6c')])/_0x1eb1bf[0x0][_0x1577('0x73')];var _0x1d09ba=_0x5ec0c3[_0x1577('0x1de')]/0x64;_0x5ec0c3['predictiveIntervalPauses']=_0x2328ce[0x0][_0x1577('0x1e4')]||0x0;_0x5ec0c3[_0x1577('0x1ca')]=_0x12f2a2>0x0?_0x12f2a2:0x1;return _0x461740[_0x1577('0x1e6')](_0x6cae4f,_0x91e9b5,_0x4d590e,_0x12f2a2,_0x1d09ba);})[_0x1577('0xbe')](function(_0x195ea8){return _0x2f2e81(_0x195ea8);})['catch'](function(_0x2ce8b0){return _0x52ffe9(msgResponse(_0x1577('0x1e5'),'Failure',JSON[_0x1577('0x7b')](_0x2ce8b0)));});}}else{return _0x52ffe9(msgResponse(_0x1577('0x1e1'),_0x1577('0x147'),_0x1577('0x1e7')));}});};};Dialer[_0x1577('0x1a')][_0x1577('0x1d9')]=function(_0x3dbb0c){var _0x21cb86=this;return function(){var _0x218f04=0x0;var _0x62a422=Math[_0x1577('0x1e8')](_0x3dbb0c[_0x1577('0x75')]*0x3e8);if(_0x62a422>0x0){_0x62a422=_0x62a422<0x64?0x64:_0x62a422;loggerPredictive[_0x1577('0x81')](_0x3dbb0c['name'],_0x1577('0x1e9'),_0x62a422,_0x1577('0x49'));_0x3dbb0c[_0x1577('0x94')]=setInterval(function(){_0x21cb86[_0x1577('0x94')](_0x3dbb0c);loggerPredictiveCalls[_0x1577('0x81')]('[handlePredictive]',_0x218f04+=0x1);},_0x62a422);}else{loggerPredictive[_0x1577('0x81')](_0x3dbb0c['name'],_0x1577('0x1ea'));}};};Dialer['prototype'][_0x1577('0x1eb')]=function(_0x5b6773,_0x447727){var _0x38188e=this;return function(_0xe2cdb6){if(_['isEmpty'](_0xe2cdb6)){if(_[_0x1577('0xb4')](_0x447727[_0x1577('0xdd')])||!_0x447727['recallme']){if(_0x5b6773[_0x1577('0x5b')]==='booked'){_0x5b6773[_0x1577('0x1ec')]=_[_0x1577('0x3d')](_0x5b6773[_0x1577('0x1ec')])?!![]:_0x5b6773[_0x1577('0x1ec')];var _0x208ec5=uuid['v4']();_0x38188e[_0x1577('0xb1')][_0x208ec5]=new Action(_0x5b6773,_0x447727,_0x208ec5);loggerBooked[_0x1577('0x81')](_0x1577('0x1ed'),_0x208ec5,'queueStatusComplete:\x20',JSON[_0x1577('0x7b')](_0x5b6773[_0x1577('0x1ec')]),_0x1577('0x1ee'),_0x5b6773[_0x1577('0x40')]);if(_0x5b6773[_0x1577('0x1ec')]){_0x5b6773[_0x1577('0x1ec')]=![];_0x38188e['queueBooked'][_0x38188e['actions'][_0x208ec5][_0x1577('0xb9')]]=[];ami[_0x1577('0xb5')]({'actionid':_0x208ec5,'action':_0x1577('0x1ef'),'queue':_0x5b6773['name']})[_0x1577('0xbf')](function(){_0x38188e['updateOriginated'](_0x5b6773);_0x38188e[_0x1577('0xc7')]({'active':![],'ContactId':_0x38188e['actions'][_0x208ec5]['ContactId'],'ListId':_0x38188e['actions'][_0x208ec5][_0x1577('0xdc')],'VoiceQueueId':_0x38188e[_0x1577('0xb1')][_0x208ec5][_0x1577('0xde')]||undefined,'CampaignId':_0x38188e[_0x1577('0xb1')][_0x208ec5][_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1f0')));delete _0x38188e[_0x1577('0xb1')][_0x208ec5];});}else{loggerBooked[_0x1577('0x81')](_0x1577('0x1f1'),JSON[_0x1577('0x7b')](_0x5b6773[_0x1577('0x1ec')]),'Queue:\x20',_0x5b6773['name']);_0x38188e[_0x1577('0xbb')](_0x5b6773);_0x38188e[_0x1577('0xc7')]({'active':![],'ContactId':_0x38188e[_0x1577('0xb1')][_0x208ec5][_0x1577('0xdb')],'ListId':_0x38188e['actions'][_0x208ec5]['ListId'],'VoiceQueueId':_0x38188e[_0x1577('0xb1')][_0x208ec5][_0x1577('0xde')]||undefined,'CampaignId':_0x38188e[_0x1577('0xb1')][_0x208ec5][_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch(_0x1577('0x1f0')));delete _0x38188e['actions'][_0x208ec5];}}else{return _0x38188e[_0x1577('0x16a')](_0x5b6773,_0x447727);}}else{if(getDiff(_0x447727[_0x1577('0x1f2')])<_0x5b6773[_0x1577('0x1f3')]*0x3c){if(_0x447727[_0x1577('0x1f4')]&&!_0x447727[_0x1577('0x1f4')][_0x1577('0x1f5')]){_0x38188e[_0x1577('0x96')][_0x1577('0x133')](_0x447727['id'])[_0x1577('0x1d')](function(){_0x38188e[_0x1577('0xbb')](_0x5b6773);});}else{_0x38188e[_0x1577('0xc9')]({'active':![]},_0x447727['id'],0x1)[_0x1577('0x1d')](function(){_0x38188e[_0x1577('0xbb')](_0x5b6773);});}}else{_0x5b6773[_0x1577('0x66')]+=0x1;_0x38188e['updateOriginated'](_0x5b6773);if(_0x5b6773[_0x1577('0x1f6')]){_0x38188e[_0x1577('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x447727['ContactId'],'ListId':_0x447727[_0x1577('0xdc')],'VoiceQueueId':_0x447727[_0x1577('0xde')]||undefined,'CampaignId':_0x447727[_0x1577('0x10e')]||undefined})[_0x1577('0xbf')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x38188e[_0x1577('0xd3')](createObjHistory(_0x5b6773,_0x447727,_0x1577('0x1f7'),0x17,'RecallInQueue'))[_0x1577('0xbf')](loggerCatch(_0x1577('0x1f8')));}else{_0x38188e['saveInDb'](createObjHistory(_0x5b6773,_0x447727,_0x1577('0x1f9'),0x16,_0x1577('0x1fa')),_0x1577('0x1fb'),_0x1577('0x1fc'));}}}}else{_0x5b6773[_0x1577('0x1fd')]+=0x1;_0x38188e['saveInDb'](createObjHistory(_0x5b6773,_0x447727,_0x1577('0x1fe'),0xd,_0x1577('0x1ff')),_0x1577('0x200'),_0x1577('0x201'));throw'inBlackList';}};};Dialer[_0x1577('0x1a')][_0x1577('0x161')]=function(_0x4beca8){var _0x564f65=this;var _0x379094=_0x4beca8[_0x1577('0x202')]-_0x4beca8[_0x1577('0x74')]-_0x4beca8['temp'];emitCampaignSummary(_0x4beca8);if(_0x379094>0x0){if(_0x379094>this['maxNumberOriginate']){_0x379094=this['maxNumberOriginate'];}_0x4beca8[_0x1577('0xcc')]+=_0x379094;this[_0x1577('0xce')](_0x4beca8['id'],_0x379094,_0x4beca8['dialOrderByScheduledAt'],_0x4beca8)[_0x1577('0xbe')](function(_0x4329bb){_0x4beca8[_0x1577('0xcc')]-=_0x379094;_0x4beca8[_0x1577('0xcc')]=_0x4beca8[_0x1577('0xcc')]>0x0?_0x4beca8[_0x1577('0xcc')]:0x0;if(!checkContactEmpty(_0x4329bb)){_0x4beca8[_0x1577('0x3e')]=_0x1577('0xa4');logger[_0x1577('0x81')]('[getContactCampaign2][Empty]'+_0x4beca8[_0x1577('0x40')]);}else{_0x4beca8[_0x1577('0x74')]+=_0x4329bb[_0x1577('0x9d')];_0x4beca8[_0x1577('0x3e')]='RUNNING';for(var _0x3a0486=0x0;_0x3a0486<_0x4329bb['length'];_0x3a0486+=0x1){_0x4beca8['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4329bb[_0x3a0486])||_[_0x1577('0xb4')](_0x4329bb[_0x3a0486][_0x1577('0x16e')])||_[_0x1577('0xb4')](_0x4329bb[_0x3a0486][_0x1577('0x16e')][_0x1577('0x16f')])){_0x564f65[_0x1577('0xd7')](_0x1577('0x203'),_0x4beca8,_0x4329bb[_0x3a0486]);}else{_0x564f65[_0x1577('0xc3')](_[_0x1577('0x139')](_0x4329bb[_0x3a0486],['CampaignId',_0x1577('0x204')]))[_0x1577('0xbe')](_0x564f65[_0x1577('0x1eb')](_0x4beca8,_0x4329bb[_0x3a0486]))['catch'](_0x564f65[_0x1577('0xd6')](_0x1577('0x205'),_0x4beca8));}}}})[_0x1577('0xbf')](loggerGetContactDialer(_0x1577('0x206'),_0x4beca8,_0x379094));}};Dialer[_0x1577('0x1a')][_0x1577('0x15d')]=function(_0x29c03f,_0x2feca2){var _0x373779=this;var _0x19862e=[];var _0x4f3b67=_0x2feca2>=0x1?_0x2feca2:0x1;if(_0x29c03f[_0x1577('0x5b')]===_0x1577('0x207')){_0x4f3b67=0x1;}var _0x1348c2=Math['floor'](_0x29c03f[_0x1577('0x4f')]*_0x4f3b67)-_0x29c03f[_0x1577('0x74')]-_0x29c03f[_0x1577('0xcc')];emitVoiceQueueSummary(_0x29c03f);if(_0x29c03f[_0x1577('0x208')]>0x0){var _0x23b8d4=_0x29c03f['dialLimitQueue']-_0x29c03f[_0x1577('0x74')]-_0x29c03f[_0x1577('0x55')]-_0x29c03f[_0x1577('0xcc')]-_0x29c03f[_0x1577('0x51')];if(_0x1348c2>_0x23b8d4){_0x1348c2=_0x23b8d4;}}if(_0x1348c2>0x0){if(_0x29c03f[_0x1577('0x5b')]===_0x1577('0x207')){_0x1348c2=0x1;}if(_0x1348c2>this[_0x1577('0x23')]){_0x1348c2=this[_0x1577('0x23')];}_0x29c03f[_0x1577('0xcc')]+=_0x1348c2;for(var _0x41e079 in this[_0x1577('0x21')]){if(typeof this['agents'][_0x41e079]!=='undefined'){if(this[_0x1577('0x21')][_0x41e079][_0x1577('0xad')]==='not_inuse'&&this[_0x1577('0x21')][_0x41e079][_0x1577('0xb6')]===_0x1577('0xe3')){_0x19862e[_0x1577('0x14e')](this['agents'][_0x41e079]['id']);}}}this[_0x1577('0xcb')](_0x29c03f['id'],_0x19862e,_0x1348c2,_0x29c03f[_0x1577('0x209')],_0x29c03f)[_0x1577('0xbe')](function(_0x1a0642){_0x29c03f[_0x1577('0xcc')]-=_0x1348c2;_0x29c03f[_0x1577('0xcc')]=_0x29c03f[_0x1577('0xcc')]>0x0?_0x29c03f[_0x1577('0xcc')]:0x0;if(!checkContactEmpty(_0x1a0642)){_0x373779['countReScheduled'](_0x29c03f)['then'](sendMessageReschedule(_0x29c03f))['catch'](loggerCatch(_0x1577('0xc0')));}else{_0x29c03f['originated']+=_0x1a0642[_0x1577('0x9d')];_0x29c03f['message']=_0x29c03f[_0x1577('0x5b')]===_0x1577('0x207')?_0x1577('0x178'):_0x1577('0x20a');for(var _0x586abb=0x0;_0x586abb<_0x1a0642[_0x1577('0x9d')];_0x586abb+=0x1){if(_['isNil'](_0x1a0642[_0x586abb])||_[_0x1577('0xb4')](_0x1a0642[_0x586abb]['Contact'])||_[_0x1577('0xb4')](_0x1a0642[_0x586abb][_0x1577('0x16e')][_0x1577('0x16f')])){_0x373779['emptyContact']('[actionOriginate]\x20',_0x29c03f,_0x1a0642[_0x586abb]);}else{_0x373779['checkIsBlackList'](_['pick'](_0x1a0642[_0x586abb],[_0x1577('0xde'),_0x1577('0x204')]))[_0x1577('0xbe')](_0x373779['checkContactBlack'](_0x29c03f,_0x1a0642[_0x586abb]))[_0x1577('0xbf')](_0x373779[_0x1577('0xd6')](_0x1577('0x203'),_0x29c03f));}}}})[_0x1577('0xbf')](loggerGetContactDialer('[getContactDialer2]',_0x29c03f,_0x1348c2));}};Dialer['prototype']['handlePredictive']=function(_0x11d24f){if(_0x11d24f[_0x1577('0x208')]>0x0){var _0x3d4eab=_0x11d24f['dialLimitQueue']-_0x11d24f[_0x1577('0x74')]-_0x11d24f[_0x1577('0x55')];if(_0x3d4eab>0x0){this[_0x1577('0x20b')](_0x11d24f);}else{loggerPredictiveCalls[_0x1577('0x81')](_0x1577('0x20c'));}}else{this[_0x1577('0x20b')](_0x11d24f);}};Dialer[_0x1577('0x1a')][_0x1577('0x20b')]=function(_0x224510){var _0xf8dbb0=this;var _0xe1d982=[];_0x224510[_0x1577('0x74')]+=0x1;for(var _0x27f999 in this[_0x1577('0x21')]){if(typeof this['agents'][_0x27f999]!==_0x1577('0x9e')){if(this[_0x1577('0x21')][_0x27f999][_0x1577('0xad')]==='not_inuse'&&this[_0x1577('0x21')][_0x27f999][_0x1577('0xb6')]===_0x1577('0xe3')){_0xe1d982[_0x1577('0x14e')](this[_0x1577('0x21')][_0x27f999]['id']);}}}this['getContactDialer'](_0x224510['id'],_0xe1d982,0x1,_0x224510[_0x1577('0x209')],_0x224510)[_0x1577('0xbe')](function(_0x52bebc){if(!checkContactEmpty(_0x52bebc)){checkContactLowerLimitOriginate(_0x224510,0x1,0x0);_0xf8dbb0[_0x1577('0xbc')](_0x224510)[_0x1577('0xbe')](sendMessageReschedule(_0x224510))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x224510[_0x1577('0x3e')]='RUNNING';if(_[_0x1577('0xb4')](_0x52bebc[0x0])||_[_0x1577('0xb4')](_0x52bebc[0x0][_0x1577('0x16e')])||_[_0x1577('0xb4')](_0x52bebc[0x0][_0x1577('0x16e')][_0x1577('0x16f')])){_0xf8dbb0['emptyContact'](_0x1577('0x203'),_0x224510,_0x52bebc[0x0]);}else{_0xf8dbb0[_0x1577('0xc1')](_[_0x1577('0x139')](_0x52bebc[0x0],[_0x1577('0xde'),_0x1577('0x204')]))[_0x1577('0xbe')](_0xf8dbb0[_0x1577('0x1eb')](_0x224510,_0x52bebc[0x0]))[_0x1577('0xbf')](_0xf8dbb0[_0x1577('0xd6')](_0x1577('0x20d'),_0x224510));}}})[_0x1577('0xbf')](loggerGetContactDialer(_0x1577('0x20e'),_0x224510,0x1));emitVoiceQueueSummary(_0x224510);};Dialer[_0x1577('0x1a')][_0x1577('0x1df')]=function(_0xc19b18,_0x13629f,_0x27ed02,_0x20ff8a,_0xb0d45f,_0x5ca258){loggerPredictive['info'](_0x1577('0x20f'));loggerPredictive[_0x1577('0x81')](_0x1577('0x210'),_0xc19b18);loggerPredictive[_0x1577('0x81')](_0x1577('0x211'),_0x13629f);loggerPredictive[_0x1577('0x81')](_0x1577('0x212'),_0x27ed02);loggerPredictive[_0x1577('0x81')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x20ff8a);loggerPredictive[_0x1577('0x81')](_0x1577('0x213'),_0xb0d45f);loggerPredictive[_0x1577('0x81')](_0x1577('0x87'));return new BPromise(function(_0x3823d1,_0x3c4afa){if(_0xc19b18<=0x0||isNaN(_0xc19b18)){return _0x3c4afa(msgResponse(_0x1577('0x214'),_0x1577('0x48'),_0x1577('0x215')+_0xc19b18));}if(_0x27ed02<=0x0||isNaN(_0x27ed02)){return _0x3c4afa(msgResponse(_0x1577('0x214'),_0x1577('0x48'),'Ts\x20=\x20'+_0x27ed02));}if(_0x20ff8a<=0x0||isNaN(_0x20ff8a)){return _0x3c4afa(msgResponse(_0x1577('0x214'),_0x1577('0x48'),'p\x20=\x20'+_0x20ff8a));}if(_0x13629f<=0x0||isNaN(_0x13629f)){return _0x3c4afa(msgResponse(_0x1577('0x214'),'Error',_0x1577('0x216')+_0x13629f));}if(_0xb0d45f<=0x0||isNaN(_0xb0d45f)){return _0x3c4afa(msgResponse('[abandonmentRate]',_0x1577('0x48'),'Amax\x20=\x20'+_0xb0d45f));}_0x5ca258=_0x5ca258||0x0;var _0x515aef=0x1/_0x27ed02;var _0x2dfbb3=0x0;var _0x52bb4d=0x0;var _0x14d04a=0x0;var _0x3bb8ce=0x0;for(var _0x215a68=0x0;_0x14d04a<_0xb0d45f;_0x215a68+=0x1){_0x52bb4d=_0x215a68/_0x13629f;_0x2dfbb3=(_0x20ff8a*_0x52bb4d+_0x5ca258)/_0x515aef;_0x14d04a=erlangb(_0x2dfbb3,_0xc19b18);_0x3bb8ce=_0x2dfbb3/_0xc19b18*(0x1-erlangb(_0x2dfbb3,_0xc19b18));}return _0x3823d1({'erlangCalls':_0x215a68,'erlangCallToSecond':_0x13629f/_0x215a68,'erlangAbandonmentRate':_0x14d04a,'erlangBusyFactor':_0x3bb8ce});});};Dialer[_0x1577('0x1a')][_0x1577('0x1e6')]=function(_0x4920b8,_0x577bb6,_0x15feea,_0x2dac36,_0x45c6fd,_0xdc2ca5){loggerPredictive[_0x1577('0x81')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x1577('0x81')](_0x1577('0x210'),_0x4920b8);loggerPredictive[_0x1577('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x577bb6);loggerPredictive['info'](_0x1577('0x212'),_0x15feea);loggerPredictive['info'](_0x1577('0x217'),_0x2dac36);loggerPredictive[_0x1577('0x81')](_0x1577('0x218'),_0x45c6fd);loggerPredictive[_0x1577('0x81')]('---------------------------');return new BPromise(function(_0x2c6f4c,_0x5e47c0){if(_0x4920b8<=0x0||isNaN(_0x4920b8)){return _0x5e47c0(msgResponse('[busyFactor]',_0x1577('0x48'),'m\x20=\x20'+_0x4920b8));}if(_0x15feea<=0x0||isNaN(_0x15feea)){return _0x5e47c0(msgResponse(_0x1577('0x219'),'Error',_0x1577('0x21a')+_0x15feea));}if(_0x2dac36<=0x0||isNaN(_0x2dac36)){return _0x5e47c0(msgResponse('[busyFactor]',_0x1577('0x48'),_0x1577('0x21b')+_0x2dac36));}if(_0x577bb6<=0x0||isNaN(_0x577bb6)){return _0x5e47c0(msgResponse('[busyFactor]','Error','interval\x20=\x20'+_0x577bb6));}if(_0x45c6fd<=0x0||isNaN(_0x45c6fd)){return _0x5e47c0(msgResponse('[busyFactor]',_0x1577('0x48'),_0x1577('0x21c')+_0x45c6fd));}_0xdc2ca5=_0xdc2ca5||0x0;var _0x1cb3f0=0x1/_0x15feea;var _0x559428=0x0;var _0x279a32=0x0;var _0x58721b=0x0;var _0xd97a42=0x0;for(var _0x17e9f9=0x0;_0xd97a42<_0x45c6fd;_0x17e9f9+=0x1){_0x279a32=_0x17e9f9/_0x577bb6;_0x559428=(_0x2dac36*_0x279a32+_0xdc2ca5)/_0x1cb3f0;_0x58721b=erlangb(_0x559428,_0x4920b8);_0xd97a42=_0x559428/_0x4920b8*(0x1-erlangb(_0x559428,_0x4920b8));}return _0x2c6f4c({'erlangCalls':_0x17e9f9,'erlangCallToSecond':_0x577bb6/_0x17e9f9,'erlangAbandonmentRate':_0x58721b,'erlangBusyFactor':_0xd97a42});});};module[_0x1577('0x21d')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 4f1f3cc..bc86d28 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x179b=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x179b,0x171));var _0xb179=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x179b[_0xac151d];return _0x111dba;};'use strict';var util=require(_0xb179('0x0'));var _=require('lodash');var moment=require(_0xb179('0x1'));function getSeconds(_0x389664,_0x43fc39){var _0x1f1814=moment(_0x389664)[_0xb179('0x2')](0x0);var _0x240699=moment(_0x43fc39)[_0xb179('0x2')](0x0);return _0x1f1814[_0xb179('0x3')](_0x240699,_0xb179('0x4'));}function QueueCallerAbandon(_0x26adfc,_0x45fb5e){this[_0xb179('0x5')]=_0x26adfc[_0xb179('0x5')];this[_0xb179('0x6')]=_0x26adfc[_0xb179('0x6')];this[_0xb179('0x7')]=_0x26adfc[_0xb179('0x6')]===_0xb179('0x8')?'queue':_0x26adfc['type'];this[_0xb179('0x9')]=_0x26adfc['countbusyretry'];this[_0xb179('0xa')]=_0x26adfc[_0xb179('0xa')];this[_0xb179('0xb')]=_0x26adfc['countnoanswerretry'];this[_0xb179('0xc')]=_0x26adfc[_0xb179('0x9')]+_0x26adfc[_0xb179('0xa')]+_0x26adfc[_0xb179('0xb')]+_0x26adfc[_0xb179('0xd')]+_0x26adfc[_0xb179('0xe')]+_0x26adfc['countabandonedretry']+_0x26adfc[_0xb179('0xf')]+_0x26adfc[_0xb179('0x10')];this[_0xb179('0xd')]=_0x26adfc[_0xb179('0xd')];this[_0xb179('0xe')]=_0x26adfc[_0xb179('0xe')];this['countabandonedretry']=_0x26adfc['countabandonedretry'];this[_0xb179('0xf')]=_0x26adfc[_0xb179('0xf')];this[_0xb179('0x10')]=_0x26adfc[_0xb179('0x10')];this[_0xb179('0x11')]=_0x45fb5e[_0xb179('0x11')];this[_0xb179('0x12')]=_0x26adfc[_0xb179('0x13')];this[_0xb179('0x14')]=_0x26adfc['number'];this[_0xb179('0x15')]=_0x26adfc[_0xb179('0x15')];this[_0xb179('0x16')]=_0x26adfc[_0xb179('0x16')];this[_0xb179('0x17')]=_0x26adfc[_0xb179('0x17')];this['endtime']=this['droptime'];this[_0xb179('0x18')]=getSeconds(_0x26adfc[_0xb179('0x16')],_0x26adfc[_0xb179('0x15')]);this[_0xb179('0x19')]=getSeconds(this[_0xb179('0x17')],_0x26adfc[_0xb179('0x16')]);this['talktime']=0x0;this['queue']=_0x45fb5e[_0xb179('0x1a')];this[_0xb179('0x1b')]=_0x45fb5e[_0xb179('0x1c')];this[_0xb179('0x1d')]=_0x45fb5e[_0xb179('0x1d')];this[_0xb179('0x1e')]=_0x26adfc[_0xb179('0x1e')];this[_0xb179('0x1f')]=_0x26adfc[_0xb179('0x1f')];this[_0xb179('0x20')]=_0x26adfc['callbackat'];this[_0xb179('0x21')]=_0x26adfc[_0xb179('0x21')];this[_0xb179('0x22')]=_0x26adfc[_0xb179('0x22')];this[_0xb179('0x23')]=_0x26adfc['ListId'];this[_0xb179('0x24')]=_0x26adfc['UserId'];this['VoiceQueueId']=_0x26adfc[_0xb179('0x25')];this[_0xb179('0x26')]=_0x26adfc['CampaignId'];this[_0xb179('0x27')]=_0x26adfc[_0xb179('0x27')]||'';this[_0xb179('0x28')]=_0x26adfc[_0xb179('0x28')]||'';}module[_0xb179('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x12ef=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype'];(function(_0x337b64,_0x5d165a){var _0x420c16=function(_0x1e158b){while(--_0x1e158b){_0x337b64['push'](_0x337b64['shift']());}};_0x420c16(++_0x5d165a);}(_0x12ef,0x19d));var _0xf12e=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x12ef[_0x1073ad];return _0x528474;};'use strict';var util=require(_0xf12e('0x0'));var _=require(_0xf12e('0x1'));var moment=require('moment');function getSeconds(_0x5185c9,_0x4c58c3){var _0x5dab0a=moment(_0x5185c9)[_0xf12e('0x2')](0x0);var _0x7da708=moment(_0x4c58c3)[_0xf12e('0x2')](0x0);return _0x5dab0a['diff'](_0x7da708,_0xf12e('0x3'));}function QueueCallerAbandon(_0x2db5c7,_0x4ff3b7){this[_0xf12e('0x4')]=_0x2db5c7[_0xf12e('0x4')];this['type']=_0x2db5c7[_0xf12e('0x5')];this[_0xf12e('0x6')]=_0x2db5c7['type']===_0xf12e('0x7')?_0xf12e('0x8'):_0x2db5c7[_0xf12e('0x5')];this[_0xf12e('0x9')]=_0x2db5c7['countbusyretry'];this['countcongestionretry']=_0x2db5c7[_0xf12e('0xa')];this[_0xf12e('0xb')]=_0x2db5c7['countnoanswerretry'];this[_0xf12e('0xc')]=_0x2db5c7[_0xf12e('0x9')]+_0x2db5c7[_0xf12e('0xa')]+_0x2db5c7[_0xf12e('0xb')]+_0x2db5c7[_0xf12e('0xd')]+_0x2db5c7[_0xf12e('0xe')]+_0x2db5c7[_0xf12e('0xf')]+_0x2db5c7[_0xf12e('0x10')]+_0x2db5c7[_0xf12e('0x11')];this[_0xf12e('0xd')]=_0x2db5c7['countnosuchnumberretry'];this['countdropretry']=_0x2db5c7[_0xf12e('0xe')];this[_0xf12e('0xf')]=_0x2db5c7[_0xf12e('0xf')];this[_0xf12e('0x10')]=_0x2db5c7['countmachineretry'];this[_0xf12e('0x11')]=_0x2db5c7[_0xf12e('0x11')];this[_0xf12e('0x12')]=_0x4ff3b7['uniqueid'];this[_0xf12e('0x13')]=_0x2db5c7[_0xf12e('0x14')];this[_0xf12e('0x15')]=_0x2db5c7[_0xf12e('0x16')];this[_0xf12e('0x17')]=_0x2db5c7['starttime'];this[_0xf12e('0x18')]=_0x2db5c7['responsetime'];this[_0xf12e('0x19')]=_0x2db5c7['droptime'];this['endtime']=this[_0xf12e('0x19')];this[_0xf12e('0x1a')]=getSeconds(_0x2db5c7[_0xf12e('0x18')],_0x2db5c7[_0xf12e('0x17')]);this[_0xf12e('0x1b')]=getSeconds(this[_0xf12e('0x19')],_0x2db5c7[_0xf12e('0x18')]);this[_0xf12e('0x1c')]=0x0;this[_0xf12e('0x8')]=_0x4ff3b7[_0xf12e('0x8')];this['membername']=_0x4ff3b7['connectedlinename'];this[_0xf12e('0x1d')]=_0x4ff3b7['reason'];this['callback']=_0x2db5c7[_0xf12e('0x1e')];this[_0xf12e('0x1f')]=_0x2db5c7[_0xf12e('0x1f')];this['callbackat']=_0x2db5c7[_0xf12e('0x20')];this[_0xf12e('0x21')]=_0x2db5c7[_0xf12e('0x21')];this[_0xf12e('0x22')]=_0x2db5c7[_0xf12e('0x22')];this[_0xf12e('0x23')]=_0x2db5c7[_0xf12e('0x23')];this[_0xf12e('0x24')]=_0x2db5c7[_0xf12e('0x24')];this['VoiceQueueId']=_0x2db5c7[_0xf12e('0x25')];this[_0xf12e('0x26')]=_0x2db5c7[_0xf12e('0x26')];this[_0xf12e('0x27')]=_0x2db5c7[_0xf12e('0x27')]||'';this['originatecalleridname']=_0x2db5c7[_0xf12e('0x28')]||'';}module[_0xf12e('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d5c2899..378ff48 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x42267f,_0x5ed5cc){var _0x554313=function(_0x3a919c){while(--_0x3a919c){_0x42267f['push'](_0x42267f['shift']());}};_0x554313(++_0x5ed5cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x261d17,_0x115fe1){var _0x5a50da=function(_0x409fc0){while(--_0x409fc0){_0x261d17['push'](_0x261d17['shift']());}};_0x5a50da(++_0x115fe1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 93a9d00..be6f3b9 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','trunks','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','path','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider'];(function(_0x88fbf6,_0x3fa870){var _0x539185=function(_0x310d47){while(--_0x310d47){_0x88fbf6['push'](_0x88fbf6['shift']());}};_0x539185(++_0x3fa870);}(_0x6324,0x142));var _0x4632=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0x6324[_0x34022f];return _0x1bebdf;};'use strict';var util=require(_0x4632('0x0'));var _=require(_0x4632('0x1'));var BPromise=require(_0x4632('0x2'));var uuid=require(_0x4632('0x3'));var moment=require('moment');var path=require(_0x4632('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4632('0x5'));var logger=require('../../../config/logger')(_0x4632('0x6'));var ami=require('../ami');var rpcDb=require(_0x4632('0x7'));var Channel=require(_0x4632('0x8'));var ut=require(_0x4632('0x9'));var Action=require(_0x4632('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4632('0xb'));var faxMessage=require(_0x4632('0xc'));function Fax(_0x390a46){this['channels']={};this[_0x4632('0xd')]=_0x390a46[_0x4632('0xd')];this['trunks']=_0x390a46['trunks'];this[_0x4632('0xe')]={};ami['on'](_0x4632('0xf'),this[_0x4632('0x10')][_0x4632('0x11')](this));ami['on'](_0x4632('0x12'),this[_0x4632('0x13')][_0x4632('0x11')](this));ami['on'](_0x4632('0x14'),this['syncNewState'][_0x4632('0x11')](this));ami['on']('newexten',this[_0x4632('0x15')][_0x4632('0x11')](this));ami['on'](_0x4632('0x16'),this[_0x4632('0x17')]['bind'](this));ami['on'](_0x4632('0x18'),this[_0x4632('0x19')][_0x4632('0x11')](this));ami['on'](_0x4632('0x1a'),this[_0x4632('0x1b')]['bind'](this));ami['on']('originateresponse',this[_0x4632('0x1c')][_0x4632('0x11')](this));}Fax[_0x4632('0x1d')][_0x4632('0x10')]=function(_0x48fbb1){if(_0x48fbb1[_0x4632('0x1e')]===_0x4632('0x1f')){for(var _0x1a94c0 in this['faxAccounts']){if(this[_0x4632('0xd')][_0x4632('0x20')](_0x1a94c0)){if(_0x48fbb1['exten']===this['faxAccounts'][_0x1a94c0][_0x4632('0x21')]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]['id']=this[_0x4632('0xd')][_0x1a94c0]['id'];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xd')][_0x1a94c0][_0x4632('0x25')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}}}}if(this[_0x4632('0xe')][_0x48fbb1[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}};Fax[_0x4632('0x1d')][_0x4632('0x13')]=function(_0x2a0b11){if(this[_0x4632('0x22')][_0x2a0b11['uniqueid']]){for(var _0x57798a in _0x2a0b11[_0x4632('0x28')]){if(_0x2a0b11[_0x4632('0x28')][_0x4632('0x20')](_0x57798a)){this[_0x4632('0x22')][_0x2a0b11[_0x4632('0x23')]][_0x57798a]=_0x2a0b11[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')]['syncNewState']=function(_0x42d505){if(this[_0x4632('0x22')][_0x42d505['uniqueid']]){this[_0x4632('0x22')][_0x42d505['uniqueid']][_0x4632('0x2a')]=_0x42d505['channelstate'];this['channels'][_0x42d505[_0x4632('0x23')]][_0x4632('0x2b')]=_0x42d505[_0x4632('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x395f4e){if(this[_0x4632('0x22')][_0x395f4e['uniqueid']]){for(var _0x4aab76 in _0x395f4e[_0x4632('0x28')]){if(_0x395f4e[_0x4632('0x28')]['hasOwnProperty'](_0x4aab76)){this[_0x4632('0x22')][_0x395f4e[_0x4632('0x23')]][_0x4aab76]=_0x395f4e[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')][_0x4632('0x17')]=function(_0x47b2b5){if(this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]){this['channels'][_0x47b2b5['uniqueid']][_0x4632('0x2c')]=_0x47b2b5['operation'];this['channels'][_0x47b2b5[_0x4632('0x23')]]['status']=_0x47b2b5[_0x4632('0x2d')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]['localstationid']=_0x47b2b5[_0x4632('0x21')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]][_0x4632('0x2e')]=_0x47b2b5[_0x4632('0x2e')];logger['info'](_0x47b2b5['uniqueid'],_0x4632('0x2f'));}};Fax[_0x4632('0x1d')][_0x4632('0x19')]=function(_0x4f40af){var _0x5a3fb4=this;if(this['channels'][_0x4f40af[_0x4632('0x23')]]){var _0x393ef2=this['channels'][_0x4f40af[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x30')]=_0x4f40af[_0x4632('0x30')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x31')]=_0x4f40af[_0x4632('0x31')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x21')]=_0x4f40af['localstationid'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]]['resolution']=_0x4f40af[_0x4632('0x32')];this[_0x4632('0x22')][_0x4f40af['uniqueid']][_0x4632('0x33')]=_0x4f40af['transferrate'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x2e')]=_0x4f40af[_0x4632('0x2e')];this['channels'][_0x4f40af[_0x4632('0x23')]][_0x4632('0x34')]=_0x4f40af[_0x4632('0x34')];if(this[_0x4632('0x22')][_0x4f40af['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x4f40af[_0x4632('0x2e')],_0x4632('0x35'),function(_0x351cb1){logger['info'](_0x4f40af[_0x4632('0x23')],_0x4632('0x36'),_0x351cb1[_0x4632('0x37')]);attachment[_0x4632('0x38')]({'name':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')],'basename':path['parse'](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')]+_0x4632('0x3a'),'type':_0x4632('0x3b')})[_0x4632('0x3c')](function(_0x4d1d50){faxAccount['notify'](_0x393ef2,{'from':_0x4f40af[_0x4632('0x34')],'mapKey':_0x4632('0x6'),'body':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])['name']+_0x4632('0x3a'),'AttachmentId':_0x4d1d50['id']})[_0x4632('0x3d')](function(_0x1ef8e1){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],'\x20notify\x20',JSON[_0x4632('0x3f')](_0x1ef8e1));});})[_0x4632('0x3d')](function(_0x378665){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'),JSON[_0x4632('0x3f')](_0x378665));});});}logger[_0x4632('0x26')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'));}};Fax[_0x4632('0x1d')]['syncOriginateResponse']=function(_0xc3ffd0){if(this[_0x4632('0xe')][_0xc3ffd0[_0x4632('0x23')]]){_['merge'](this[_0x4632('0x22')][_0xc3ffd0[_0x4632('0x23')]],_[_0x4632('0x41')](_0xc3ffd0,[_0x4632('0x42'),_0x4632('0x43')]));}};function updateStatus(_0x70a4fd){if(_0x70a4fd[_0x4632('0x44')]){faxMessage[_0x4632('0x45')](_0x70a4fd[_0x4632('0x44')],{'failMessage':_0x4632('0x46')})['then'](function(_0x35afe5){ut[_0x4632('0x47')]('[Fax][Message][Error][Updated]',_0x35afe5);})[_0x4632('0x3d')](function(_0x3a21c6){ut[_0x4632('0x47')](_0x4632('0x48'),_0x3a21c6);});}else{ut[_0x4632('0x47')](_0x4632('0x49'));}}Fax[_0x4632('0x1d')][_0x4632('0x4a')]=function(_0x31b42d,_0x1b66e0,_0x3e66d8){var _0x2a50f7=this;var _0x3471b4={};if(_0x1b66e0){_0x3471b4={'read':_0x1b66e0};}else{_0x3471b4={'failMessage':_0x3e66d8};}if(this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')]){faxMessage[_0x4632('0x45')](this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')],_0x3471b4)[_0x4632('0x3c')](function(_0x36c824){ut['logger'](_0x4632('0x4b'),_0x36c824);})[_0x4632('0x3d')](function(_0x3ea966){ut[_0x4632('0x47')](_0x4632('0x4c'),_0x3ea966);})[_0x4632('0x4d')](function(){delete _0x2a50f7['channels'][_0x31b42d];delete _0x2a50f7[_0x4632('0xe')][_0x31b42d];});}else{ut[_0x4632('0x47')](_0x4632('0x4e'));delete this['channels'][_0x31b42d];delete this[_0x4632('0xe')][_0x31b42d];}};Fax[_0x4632('0x1d')]['syncHangup']=function(_0x17bc91){var _0x1aa4f0=this;if(this[_0x4632('0x22')][_0x17bc91['uniqueid']]){if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]['id']=this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xe')][_0x17bc91['uniqueid']][_0x4632('0x25')];}logger[_0x4632('0x26')](_0x17bc91['uniqueid'],this[_0x4632('0xe')][_0x17bc91['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x4632('0x4f'),JSON[_0x4632('0x3f')](this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]));if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){if(this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x50')]>0x0&&this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x16')]===_0x4632('0x51')){this[_0x4632('0x4a')](_0x17bc91['uniqueid'],!![]);}else{this['updateStatus'](_0x17bc91[_0x4632('0x23')],![],this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x52')]?_0x4632('0x53')+this[_0x4632('0x22')][_0x17bc91['uniqueid']][_0x4632('0x52')]:_0x4632('0x54'));}}}};Fax[_0x4632('0x1d')][_0x4632('0x55')]=function(_0x5d1994){var _0x529be1=this;return new BPromise(function(_0x28428f,_0x4c547c){_0x529be1[_0x4632('0x56')](_0x5d1994,_0x529be1[_0x4632('0xd')][_0x5d1994[_0x4632('0x57')]])[_0x4632('0x3c')](function(_0xc5515f){ut['logger'](_0x4632('0x58'),_0xc5515f);_0x28428f(ut[_0x4632('0x37')]('Fax\x20received'));})['catch'](function(_0x2a2cdb){ut[_0x4632('0x47')](_0x4632('0x59'),_0x2a2cdb);updateStatus(_0x5d1994);_0x4c547c(ut[_0x4632('0x37')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x10f7ab){var _0x5b37cc=this;return new BPromise(function(_0x3af9ec,_0x3595fa){var _0x390844=_0x5b37cc[_0x4632('0x5a')](_0x5b37cc[_0x4632('0xd')][_0x10f7ab[_0x4632('0x57')]][_0x4632('0x5b')],_0x10f7ab);if(_0x390844[_0x4632('0x5c')]){_0x3af9ec(ut[_0x4632('0x37')](_0x4632('0x5d')));}else{_0x3595fa(ut[_0x4632('0x37')](_0x390844[_0x4632('0x37')]));}});};function originate(_0x1c5c49,_0x3d5e65,_0x461700){return new BPromise(function(_0x1b2905,_0x550c4d){if(_0x461700){var _0x2b6d66=util[_0x4632('0x5e')](_0x4632('0x5f'),path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')],_0x1c5c49[_0x4632('0x4')]);gs[_0x4632('0x60')](_0x2b6d66)[_0x4632('0x3c')](function(){_0x1c5c49[_0x4632('0x4')]=util[_0x4632('0x5e')](_0x4632('0x61'),path[_0x4632('0x39')](_0x1c5c49['path'])[_0x4632('0x62')],path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')]);_0x3d5e65[_0x4632('0x63')]=_0x1c5c49[_0x4632('0x4')];ut['logger'](_0x4632('0x64'),'');ami[_0x4632('0x65')](ut['variablesAction'](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x458688){_0x1b2905(_0x458688);})[_0x4632('0x3d')](function(_0x182b19){_0x550c4d(_0x182b19);});})[_0x4632('0x3d')](function(_0x5a09b9){_0x550c4d(_0x5a09b9);});}else{ami[_0x4632('0x65')](ut[_0x4632('0x66')](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x505e2a){_0x1b2905(_0x505e2a);})[_0x4632('0x3d')](function(_0x400a95){_0x550c4d(_0x400a95);});}});}Fax[_0x4632('0x1d')][_0x4632('0x56')]=function(_0x365341,_0x3a3f3a){var _0x35ca5d=this;return new BPromise(function(_0x295b86,_0x48fb81){var _0x36de42=uuid['v4']();var _0x9603f5=ut[_0x4632('0x67')](_0x365341,_0x3a3f3a);_0x35ca5d['actions'][_0x36de42]=new Action(_0x36de42,_0x3a3f3a,_0x365341);var _0xfc48bd=_0x35ca5d[_0x4632('0xe')][_0x36de42];if(path['parse'](_0x365341['path'])[_0x4632('0x68')]===_0x4632('0x3a')){originate(_0xfc48bd,_0x9603f5,!![])['then'](function(_0x63d3e1){_0x295b86(_0x63d3e1);})[_0x4632('0x3d')](function(_0x2f1f22){_0x48fb81(_0x2f1f22);});}else{originate(_0xfc48bd,_0x9603f5,![])[_0x4632('0x3c')](function(_0x40b7c5){_0x295b86(_0x40b7c5);})[_0x4632('0x3d')](function(_0x43edfd){_0x48fb81(_0x43edfd);});}});};Fax[_0x4632('0x1d')]['isTrunkReachable']=function(_0x1604da){return!_[_0x4632('0x69')](_0x1604da)&&!_[_0x4632('0x69')](_0x1604da[_0x4632('0x25')])&&!_['isNil'](_0x1604da[_0x4632('0x6a')])&&_0x1604da[_0x4632('0x6a')]&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])])&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')])&&(this[_0x4632('0x6b')][util['format'](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6d')||this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6e'));};Fax[_0x4632('0x1d')][_0x4632('0x5a')]=function(_0x3ad5f0,_0x310c9c){if(!this['isTrunkReachable'](_0x3ad5f0)){ut[_0x4632('0x47')](_0x4632('0x6f'),_[_0x4632('0x69')](_0x3ad5f0)?'':_0x3ad5f0[_0x4632('0x25')]+_0x4632('0x70'));return{'isValid':![],'message':_0x4632('0x71')};}if(_[_0x4632('0x69')](_0x310c9c['fax'])){ut[_0x4632('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x72')};}if(_[_0x4632('0x69')](_0x310c9c[_0x4632('0x4')])){ut[_0x4632('0x47')](_0x4632('0x73'),JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x74')};}return{'isValid':!![],'message':_0x4632('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0xb10b=['status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','dir','XMF-PATH','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','syncNewchannel','bind','varset','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','prototype','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xb10b,0x12a));var _0xbb10=function(_0xe485c4,_0x3d0f36){_0xe485c4=_0xe485c4-0x0;var _0x24cb58=_0xb10b[_0xe485c4];return _0x24cb58;};'use strict';var util=require(_0xbb10('0x0'));var _=require('lodash');var BPromise=require(_0xbb10('0x1'));var uuid=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var path=require('path');var tiff2pdf=require(_0xbb10('0x4'));var gs=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var ami=require(_0xbb10('0x8'));var rpcDb=require(_0xbb10('0x9'));var Channel=require('./channel');var ut=require(_0xbb10('0xa'));var Action=require(_0xbb10('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xbb10('0xc'));var faxMessage=require(_0xbb10('0xd'));function Fax(_0x21370f){this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]=_0x21370f[_0xbb10('0xf')];this[_0xbb10('0x10')]=_0x21370f[_0xbb10('0x10')];this['actions']={};ami['on']('newchannel',this[_0xbb10('0x11')][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x13'),this['syncVarSet'][_0xbb10('0x12')](this));ami['on']('newstate',this[_0xbb10('0x14')][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x15'),this[_0xbb10('0x16')][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x17'),this['syncFaxStatus'][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x18'),this[_0xbb10('0x19')][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x1a'),this[_0xbb10('0x1b')][_0xbb10('0x12')](this));ami['on'](_0xbb10('0x1c'),this[_0xbb10('0x1d')][_0xbb10('0x12')](this));}Fax['prototype'][_0xbb10('0x11')]=function(_0x1145f1){if(_0x1145f1[_0xbb10('0x1e')]===_0xbb10('0x1f')){for(var _0x378da8 in this[_0xbb10('0xf')]){if(this[_0xbb10('0xf')][_0xbb10('0x20')](_0x378da8)){if(_0x1145f1[_0xbb10('0x21')]===this[_0xbb10('0xf')][_0x378da8]['localstationid']){this[_0xbb10('0xe')][_0x1145f1[_0xbb10('0x22')]]={};this[_0xbb10('0xe')][_0x1145f1[_0xbb10('0x22')]][_0xbb10('0x23')]=_0x1145f1[_0xbb10('0x23')];this['channels'][_0x1145f1[_0xbb10('0x22')]]['id']=this[_0xbb10('0xf')][_0x378da8]['id'];this['channels'][_0x1145f1['uniqueid']][_0xbb10('0x24')]=this[_0xbb10('0xf')][_0x378da8][_0xbb10('0x24')];logger[_0xbb10('0x25')](_0x1145f1[_0xbb10('0x22')],_0xbb10('0x26'));}}}}if(this[_0xbb10('0x27')][_0x1145f1[_0xbb10('0x22')]]){this[_0xbb10('0xe')][_0x1145f1[_0xbb10('0x22')]]={};this[_0xbb10('0xe')][_0x1145f1[_0xbb10('0x22')]]['channel']=_0x1145f1['channel'];logger['info'](_0x1145f1[_0xbb10('0x22')],_0xbb10('0x26'));}};Fax[_0xbb10('0x28')]['syncVarSet']=function(_0x2fdde9){if(this[_0xbb10('0xe')][_0x2fdde9[_0xbb10('0x22')]]){for(var _0x1d5e95 in _0x2fdde9[_0xbb10('0x29')]){if(_0x2fdde9[_0xbb10('0x29')][_0xbb10('0x20')](_0x1d5e95)){this['channels'][_0x2fdde9[_0xbb10('0x22')]][_0x1d5e95]=_0x2fdde9[_0xbb10('0x2a')];}}}};Fax[_0xbb10('0x28')][_0xbb10('0x14')]=function(_0x1d30aa){if(this[_0xbb10('0xe')][_0x1d30aa['uniqueid']]){this[_0xbb10('0xe')][_0x1d30aa['uniqueid']][_0xbb10('0x2b')]=_0x1d30aa['channelstate'];this[_0xbb10('0xe')][_0x1d30aa[_0xbb10('0x22')]][_0xbb10('0x2c')]=_0x1d30aa['channelstatedesc'];}};Fax['prototype'][_0xbb10('0x16')]=function(_0x34f65e){if(this['channels'][_0x34f65e[_0xbb10('0x22')]]){for(var _0x37dde7 in _0x34f65e[_0xbb10('0x29')]){if(_0x34f65e[_0xbb10('0x29')][_0xbb10('0x20')](_0x37dde7)){this[_0xbb10('0xe')][_0x34f65e[_0xbb10('0x22')]][_0x37dde7]=_0x34f65e['value'];}}}};Fax[_0xbb10('0x28')][_0xbb10('0x2d')]=function(_0x441d15){if(this[_0xbb10('0xe')][_0x441d15[_0xbb10('0x22')]]){this[_0xbb10('0xe')][_0x441d15[_0xbb10('0x22')]][_0xbb10('0x2e')]=_0x441d15[_0xbb10('0x2e')];this['channels'][_0x441d15[_0xbb10('0x22')]][_0xbb10('0x2f')]=_0x441d15[_0xbb10('0x2f')];this[_0xbb10('0xe')][_0x441d15['uniqueid']][_0xbb10('0x30')]=_0x441d15['localstationid'];this['channels'][_0x441d15[_0xbb10('0x22')]][_0xbb10('0x31')]=_0x441d15[_0xbb10('0x31')];logger[_0xbb10('0x25')](_0x441d15[_0xbb10('0x22')],_0xbb10('0x32'));}};Fax['prototype'][_0xbb10('0x19')]=function(_0x25d72f){var _0x52de31=this;if(this['channels'][_0x25d72f['uniqueid']]){var _0x31bee3=this[_0xbb10('0xe')][_0x25d72f[_0xbb10('0x22')]]['id'];this['channels'][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x33')]=_0x25d72f[_0xbb10('0x33')];this['channels'][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x34')]=_0x25d72f[_0xbb10('0x34')];this[_0xbb10('0xe')][_0x25d72f['uniqueid']][_0xbb10('0x30')]=_0x25d72f[_0xbb10('0x30')];this['channels'][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x35')]=_0x25d72f[_0xbb10('0x35')];this[_0xbb10('0xe')][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x36')]=_0x25d72f['transferrate'];this[_0xbb10('0xe')][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x31')]=_0x25d72f[_0xbb10('0x31')];this['channels'][_0x25d72f[_0xbb10('0x22')]][_0xbb10('0x37')]=_0x25d72f[_0xbb10('0x37')];if(this[_0xbb10('0xe')][_0x25d72f['uniqueid']][_0xbb10('0x34')]>0x0){tiff2pdf(_0x25d72f[_0xbb10('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x5d9a4f){logger[_0xbb10('0x25')](_0x25d72f['uniqueid'],_0xbb10('0x38'),_0x5d9a4f[_0xbb10('0x39')]);attachment['create']({'name':path[_0xbb10('0x3a')](_0x25d72f[_0xbb10('0x31')])[_0xbb10('0x24')],'basename':path['parse'](_0x25d72f[_0xbb10('0x31')])[_0xbb10('0x24')]+_0xbb10('0x3b'),'type':_0xbb10('0x3c')})[_0xbb10('0x3d')](function(_0x19f94d){faxAccount[_0xbb10('0x3e')](_0x31bee3,{'from':_0x25d72f[_0xbb10('0x37')],'mapKey':_0xbb10('0x7'),'body':path[_0xbb10('0x3a')](_0x25d72f[_0xbb10('0x31')])[_0xbb10('0x24')]+'.pdf','AttachmentId':_0x19f94d['id']})[_0xbb10('0x3f')](function(_0x41bbf8){logger['error'](_0x25d72f[_0xbb10('0x22')],_0xbb10('0x40'),JSON[_0xbb10('0x41')](_0x41bbf8));});})[_0xbb10('0x3f')](function(_0x41ea91){logger[_0xbb10('0x42')](_0x25d72f[_0xbb10('0x22')],'\x20receiveFax\x20',JSON['stringify'](_0x41ea91));});});}logger[_0xbb10('0x25')](_0x25d72f[_0xbb10('0x22')],_0xbb10('0x43'));}};Fax['prototype']['syncOriginateResponse']=function(_0x3cd6f3){if(this[_0xbb10('0x27')][_0x3cd6f3[_0xbb10('0x22')]]){_[_0xbb10('0x44')](this[_0xbb10('0xe')][_0x3cd6f3[_0xbb10('0x22')]],_[_0xbb10('0x45')](_0x3cd6f3,[_0xbb10('0x46'),_0xbb10('0x47')]));}};function updateStatus(_0x3d7e7e){if(_0x3d7e7e['AttachmentId']){faxMessage['update'](_0x3d7e7e[_0xbb10('0x48')],{'failMessage':_0xbb10('0x49')})[_0xbb10('0x3d')](function(_0xb014b0){ut[_0xbb10('0x4a')](_0xbb10('0x4b'),_0xb014b0);})[_0xbb10('0x3f')](function(_0x445870){ut[_0xbb10('0x4a')](_0xbb10('0x4c'),_0x445870);});}else{ut[_0xbb10('0x4a')](_0xbb10('0x4d'));}}Fax[_0xbb10('0x28')][_0xbb10('0x4e')]=function(_0x1d15f4,_0x547a7a,_0x124052){var _0x5bd44d=this;var _0x33d60a={};if(_0x547a7a){_0x33d60a={'read':_0x547a7a};}else{_0x33d60a={'failMessage':_0x124052};}if(this[_0xbb10('0x27')][_0x1d15f4][_0xbb10('0x48')]){faxMessage[_0xbb10('0x4f')](this[_0xbb10('0x27')][_0x1d15f4][_0xbb10('0x48')],_0x33d60a)[_0xbb10('0x3d')](function(_0x44eec1){ut[_0xbb10('0x4a')](_0xbb10('0x50'),_0x44eec1);})[_0xbb10('0x3f')](function(_0x1c2dce){ut[_0xbb10('0x4a')](_0xbb10('0x51'),_0x1c2dce);})[_0xbb10('0x52')](function(){delete _0x5bd44d['channels'][_0x1d15f4];delete _0x5bd44d[_0xbb10('0x27')][_0x1d15f4];});}else{ut[_0xbb10('0x4a')](_0xbb10('0x53'));delete this[_0xbb10('0xe')][_0x1d15f4];delete this[_0xbb10('0x27')][_0x1d15f4];}};Fax[_0xbb10('0x28')]['syncHangup']=function(_0x120bda){var _0x4731ce=this;if(this[_0xbb10('0xe')][_0x120bda[_0xbb10('0x22')]]){if(this[_0xbb10('0x27')][_0x120bda[_0xbb10('0x22')]]){this[_0xbb10('0xe')][_0x120bda[_0xbb10('0x22')]]['id']=this[_0xbb10('0x27')][_0x120bda[_0xbb10('0x22')]]['id'];this[_0xbb10('0xe')][_0x120bda[_0xbb10('0x22')]][_0xbb10('0x24')]=this['actions'][_0x120bda['uniqueid']][_0xbb10('0x24')];}logger[_0xbb10('0x25')](_0x120bda[_0xbb10('0x22')],this[_0xbb10('0x27')][_0x120bda['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xbb10('0x54'),JSON[_0xbb10('0x41')](this[_0xbb10('0xe')][_0x120bda[_0xbb10('0x22')]]));if(this[_0xbb10('0x27')][_0x120bda[_0xbb10('0x22')]]){if(this[_0xbb10('0xe')][_0x120bda['uniqueid']][_0xbb10('0x55')]>0x0&&this[_0xbb10('0xe')][_0x120bda['uniqueid']]['faxstatus']==='SUCCESS'){this[_0xbb10('0x4e')](_0x120bda[_0xbb10('0x22')],!![]);}else{this[_0xbb10('0x4e')](_0x120bda['uniqueid'],![],this['channels'][_0x120bda['uniqueid']][_0xbb10('0x56')]?_0xbb10('0x57')+this[_0xbb10('0xe')][_0x120bda['uniqueid']][_0xbb10('0x56')]:_0xbb10('0x58'));}}}};Fax['prototype']['send']=function(_0x27d7b9){var _0x308896=this;return new BPromise(function(_0xd77753,_0x237246){_0x308896['execOriginate'](_0x27d7b9,_0x308896[_0xbb10('0xf')][_0x27d7b9[_0xbb10('0x59')]])[_0xbb10('0x3d')](function(_0x5202d7){ut[_0xbb10('0x4a')](_0xbb10('0x5a'),_0x5202d7);_0xd77753(ut[_0xbb10('0x39')]('Fax\x20received'));})[_0xbb10('0x3f')](function(_0x31e85e){ut[_0xbb10('0x4a')](_0xbb10('0x5b'),_0x31e85e);updateStatus(_0x27d7b9);_0x237246(ut['message'](_0xbb10('0x5c')));});});};Fax[_0xbb10('0x28')][_0xbb10('0x5d')]=function(_0x2d0f4b){var _0x56b3a3=this;return new BPromise(function(_0x354ea7,_0x277fe7){var _0x2a166e=_0x56b3a3[_0xbb10('0x5e')](_0x56b3a3[_0xbb10('0xf')][_0x2d0f4b[_0xbb10('0x59')]][_0xbb10('0x5f')],_0x2d0f4b);if(_0x2a166e['isValid']){_0x354ea7(ut['message']('Trunk\x20Reachable'));}else{_0x277fe7(ut[_0xbb10('0x39')](_0x2a166e[_0xbb10('0x39')]));}});};function originate(_0x3eda96,_0x5c9afc,_0x5cd089){return new BPromise(function(_0x46f462,_0x1b11c0){if(_0x5cd089){var _0xd9e743=util[_0xbb10('0x60')](_0xbb10('0x61'),path[_0xbb10('0x3a')](_0x3eda96['path'])[_0xbb10('0x24')],_0x3eda96[_0xbb10('0x62')]);gs[_0xbb10('0x63')](_0xd9e743)[_0xbb10('0x3d')](function(){_0x3eda96[_0xbb10('0x62')]=util['format']('%s/%s.tif',path['parse'](_0x3eda96[_0xbb10('0x62')])[_0xbb10('0x64')],path[_0xbb10('0x3a')](_0x3eda96[_0xbb10('0x62')])[_0xbb10('0x24')]);_0x5c9afc[_0xbb10('0x65')]=_0x3eda96['path'];ut[_0xbb10('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x3eda96,_0x5c9afc))[_0xbb10('0x3d')](function(_0x13040d){_0x46f462(_0x13040d);})[_0xbb10('0x3f')](function(_0x108f99){_0x1b11c0(_0x108f99);});})['catch'](function(_0x122d38){_0x1b11c0(_0x122d38);});}else{ami['Action'](ut['variablesAction'](_0x3eda96,_0x5c9afc))[_0xbb10('0x3d')](function(_0xfe3db0){_0x46f462(_0xfe3db0);})[_0xbb10('0x3f')](function(_0x2bd2ab){_0x1b11c0(_0x2bd2ab);});}});}Fax[_0xbb10('0x28')]['execOriginate']=function(_0x2d52ea,_0x19fcec){var _0x2c6429=this;return new BPromise(function(_0x3f3d38,_0x43cdb7){var _0x27f42f=uuid['v4']();var _0x174395=ut['addVariables'](_0x2d52ea,_0x19fcec);_0x2c6429[_0xbb10('0x27')][_0x27f42f]=new Action(_0x27f42f,_0x19fcec,_0x2d52ea);var _0x1f648a=_0x2c6429[_0xbb10('0x27')][_0x27f42f];if(path[_0xbb10('0x3a')](_0x2d52ea[_0xbb10('0x62')])[_0xbb10('0x66')]===_0xbb10('0x3b')){originate(_0x1f648a,_0x174395,!![])[_0xbb10('0x3d')](function(_0x5a4429){_0x3f3d38(_0x5a4429);})[_0xbb10('0x3f')](function(_0x218690){_0x43cdb7(_0x218690);});}else{originate(_0x1f648a,_0x174395,![])[_0xbb10('0x3d')](function(_0x56416a){_0x3f3d38(_0x56416a);})['catch'](function(_0x4b923a){_0x43cdb7(_0x4b923a);});}});};Fax[_0xbb10('0x28')]['isTrunkReachable']=function(_0x4e3d6a){return!_[_0xbb10('0x67')](_0x4e3d6a)&&!_[_0xbb10('0x67')](_0x4e3d6a[_0xbb10('0x24')])&&!_[_0xbb10('0x67')](_0x4e3d6a[_0xbb10('0x68')])&&_0x4e3d6a[_0xbb10('0x68')]&&!_[_0xbb10('0x67')](this[_0xbb10('0x10')][util[_0xbb10('0x60')]('SIP/%s',_0x4e3d6a[_0xbb10('0x24')])])&&!_[_0xbb10('0x67')](this[_0xbb10('0x10')][util[_0xbb10('0x60')]('SIP/%s',_0x4e3d6a['name'])][_0xbb10('0x2f')])&&(this[_0xbb10('0x10')][util[_0xbb10('0x60')](_0xbb10('0x69'),_0x4e3d6a['name'])][_0xbb10('0x2f')]===_0xbb10('0x6a')||this[_0xbb10('0x10')][util[_0xbb10('0x60')](_0xbb10('0x69'),_0x4e3d6a['name'])]['status']===_0xbb10('0x6b'));};Fax[_0xbb10('0x28')][_0xbb10('0x5e')]=function(_0x5239da,_0x256b35){if(!this[_0xbb10('0x6c')](_0x5239da)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xbb10('0x67')](_0x5239da)?'':_0x5239da[_0xbb10('0x24')]+_0xbb10('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xbb10('0x67')](_0x256b35[_0xbb10('0x7')])){ut[_0xbb10('0x4a')](_0xbb10('0x6e'),JSON[_0xbb10('0x41')](_0x256b35));return{'isValid':![],'message':_0xbb10('0x6f')};}if(_[_0xbb10('0x67')](_0x256b35[_0xbb10('0x62')])){ut[_0xbb10('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xbb10('0x41')](_0x256b35));return{'isValid':![],'message':_0xbb10('0x70')};}return{'isValid':!![],'message':_0xbb10('0x71')};};module[_0xbb10('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 39fa44b..74c06b3 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b5a=['error','inspect','resolve','catch','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x7b5a,0xaf));var _0xa7b5=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x7b5a[_0xdc37a1];return _0x99b4fe;};'use strict';var util=require(_0xa7b5('0x0'));var BPromise=require(_0xa7b5('0x1'));var logger=require(_0xa7b5('0x2'))(_0xa7b5('0x3'));var _=require(_0xa7b5('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2aef6f){return function(_0x3bda5b){logger[_0xa7b5('0x5')](_0x2aef6f,util[_0xa7b5('0x6')](_0x3bda5b,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x10fc3a,_0x1c20e6){return BPromise[_0xa7b5('0x7')]()['then'](faxAccount['notify'](_0x10fc3a,_0x1c20e6))[_0xa7b5('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x9692=['then','[Notify]\x20','util','bluebird','preview','lodash','inspect','notify','resolve'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x9692,0x1c4));var _0x2969=function(_0x5f1d81,_0x1d8b7b){_0x5f1d81=_0x5f1d81-0x0;var _0x2c2080=_0x9692[_0x5f1d81];return _0x2c2080;};'use strict';var util=require(_0x2969('0x0'));var BPromise=require(_0x2969('0x1'));var logger=require('../../../config/logger')(_0x2969('0x2'));var _=require(_0x2969('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x23c1e5){return function(_0x241b00){logger['error'](_0x23c1e5,util[_0x2969('0x4')](_0x241b00,{'showHidden':![],'depth':null}));};}exports[_0x2969('0x5')]=function(_0x5084dc,_0x2eb869){return BPromise[_0x2969('0x6')]()[_0x2969('0x7')](faxAccount[_0x2969('0x5')](_0x5084dc,_0x2eb869))['catch'](loggerCatch(_0x2969('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 81b5852..7b3b5c7 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c63=['exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','child_process'];(function(_0x2fa93a,_0xf57adf){var _0x4c9ea8=function(_0x3fb542){while(--_0x3fb542){_0x2fa93a['push'](_0x2fa93a['shift']());}};_0x4c9ea8(++_0xf57adf);}(_0x6c63,0x152));var _0x36c6=function(_0x37a081,_0x27f070){_0x37a081=_0x37a081-0x0;var _0x2651d2=_0x6c63[_0x37a081];return _0x2651d2;};'use strict';var util=require(_0x36c6('0x0'));var logger=require(_0x36c6('0x1'))(_0x36c6('0x2'));var BPromise=require('bluebird');var exec=require(_0x36c6('0x3'))[_0x36c6('0x4')];exports[_0x36c6('0x5')]=function(_0x4a7701){return new BPromise(function(_0x3dfc45,_0x28cb67){exec(_0x4a7701,function(_0x2e9df8,_0x2a86fb,_0x16f47d){logger['info']('Exec\x20gs',_0x2a86fb);if(_0x2e9df8){logger[_0x36c6('0x6')](_0x36c6('0x7'),_0x36c6('0x8'),util['inspect'](_0x2e9df8,{'showHidden':![],'depth':null}),_0x2a86fb,_0x16f47d);_0x28cb67(_0x2e9df8);}_0x3dfc45(_0x2a86fb);});});}; \ No newline at end of file +var _0xbff0=['\x20Error\x20:','../../../../config/logger','bluebird','child_process','exec','info','Exec\x20gs'];(function(_0x57725a,_0x5d5aab){var _0x39d204=function(_0x3f1646){while(--_0x3f1646){_0x57725a['push'](_0x57725a['shift']());}};_0x39d204(++_0x5d5aab);}(_0xbff0,0x189));var _0x0bff=function(_0x4d24f5,_0x2b0651){_0x4d24f5=_0x4d24f5-0x0;var _0x517ae3=_0xbff0[_0x4d24f5];return _0x517ae3;};'use strict';var util=require('util');var logger=require(_0x0bff('0x0'))('fax');var BPromise=require(_0x0bff('0x1'));var exec=require(_0x0bff('0x2'))[_0x0bff('0x3')];exports['execute']=function(_0x55450b){return new BPromise(function(_0x472015,_0x4a03ef){exec(_0x55450b,function(_0x351f2c,_0x57ef5c,_0x6b3918){logger[_0x0bff('0x4')]('Exec\x20gs',_0x57ef5c);if(_0x351f2c){logger[_0x0bff('0x4')](_0x0bff('0x5'),_0x0bff('0x6'),util['inspect'](_0x351f2c,{'showHidden':![],'depth':null}),_0x57ef5c,_0x6b3918);_0x4a03ef(_0x351f2c);}_0x472015(_0x57ef5c);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index e8508fe..6de9224 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x847b=['format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x847b,0x16b));var _0xb847=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x847b[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xb847('0x0'));var _=require(_0xb847('0x1'));var moment=require('moment');var logger=require(_0xb847('0x2'))('fax');exports[_0xb847('0x3')]=function(_0x404dcd){return{'message':_0x404dcd};};exports[_0xb847('0x4')]=function(_0x47f721,_0x3f4329){logger[_0xb847('0x5')](_0x47f721,util[_0xb847('0x6')](_0x3f4329,{'showHidden':![],'depth':null}));};exports[_0xb847('0x7')]=function(_0x2ff89c,_0x2e04b3){var _0x41f23c={'XMF-ECM':_0x2e04b3[_0xb847('0x8')],'XMF-HEADERINFO':_0x2e04b3[_0xb847('0x9')],'XMF-MINRATE':_0x2e04b3[_0xb847('0xa')],'XMF-MAXRATE':_0x2e04b3[_0xb847('0xb')],'XMF-MODEM':util[_0xb847('0xc')](_0xb847('0xd'),_0x2e04b3[_0xb847('0xe')]),'XMF-GATEWAY':_0x2e04b3[_0xb847('0xf')],'XMF-FAXDETECT':_0x2e04b3[_0xb847('0x10')],'XMF-T38TIMEOUT':_0x2e04b3[_0xb847('0x11')],'XMF-LOCALSTATIONID':_0x2e04b3[_0xb847('0x12')],'XMF-PATH':_0x2ff89c[_0xb847('0x13')]};return _0x41f23c;};exports['variablesAction']=function(_0x45fc6c,_0x386417){return{'actionid':_0x45fc6c['uniqueid'],'action':_0xb847('0x14'),'channel':_0x45fc6c[_0xb847('0x15')],'Exten':_0xb847('0x16'),'Context':_0xb847('0x17'),'Priority':'1','callerid':util[_0xb847('0xc')](_0xb847('0x18'),_0x45fc6c[_0xb847('0x9')]?_0x45fc6c['headerinfo']:'',_0x45fc6c[_0xb847('0x12')]),'variable':_0x386417,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x45fc6c['uniqueid']};}; \ No newline at end of file +var _0xe895=['variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe895,0x1bb));var _0x5e89=function(_0x330b5a,_0x1cc7ac){_0x330b5a=_0x330b5a-0x0;var _0x44ebc2=_0xe895[_0x330b5a];return _0x44ebc2;};'use strict';var util=require(_0x5e89('0x0'));var _=require(_0x5e89('0x1'));var moment=require(_0x5e89('0x2'));var logger=require(_0x5e89('0x3'))(_0x5e89('0x4'));exports[_0x5e89('0x5')]=function(_0xb18b97){return{'message':_0xb18b97};};exports[_0x5e89('0x6')]=function(_0x21dd56,_0x14f8df){logger[_0x5e89('0x7')](_0x21dd56,util['inspect'](_0x14f8df,{'showHidden':![],'depth':null}));};exports[_0x5e89('0x8')]=function(_0x2e65c6,_0xa86dc8){var _0x57555c={'XMF-ECM':_0xa86dc8[_0x5e89('0x9')],'XMF-HEADERINFO':_0xa86dc8[_0x5e89('0xa')],'XMF-MINRATE':_0xa86dc8[_0x5e89('0xb')],'XMF-MAXRATE':_0xa86dc8['maxrate'],'XMF-MODEM':util[_0x5e89('0xc')](_0x5e89('0xd'),_0xa86dc8[_0x5e89('0xe')]),'XMF-GATEWAY':_0xa86dc8[_0x5e89('0xf')],'XMF-FAXDETECT':_0xa86dc8['faxdetect'],'XMF-T38TIMEOUT':_0xa86dc8[_0x5e89('0x10')],'XMF-LOCALSTATIONID':_0xa86dc8['localstationid'],'XMF-PATH':_0x2e65c6['path']};return _0x57555c;};exports[_0x5e89('0x11')]=function(_0x4976bf,_0x2ee011){return{'actionid':_0x4976bf[_0x5e89('0x12')],'action':_0x5e89('0x13'),'channel':_0x4976bf['channel'],'Exten':_0x5e89('0x14'),'Context':_0x5e89('0x15'),'Priority':'1','callerid':util[_0x5e89('0xc')](_0x5e89('0x16'),_0x4976bf[_0x5e89('0xa')]?_0x4976bf[_0x5e89('0xa')]:'',_0x4976bf['localstationid']),'variable':_0x2ee011,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4976bf[_0x5e89('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 504657b..fce8a2c 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba3f=['initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','sync','error','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts'];(function(_0x5922f7,_0x23885e){var _0x145529=function(_0x34bd66){while(--_0x34bd66){_0x5922f7['push'](_0x5922f7['shift']());}};_0x145529(++_0x23885e);}(_0xba3f,0x15d));var _0xfba3=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0xba3f[_0x20008a];return _0x5d0f1c;};'use strict';var BPromise=require('bluebird');var util=require(_0xfba3('0x0'));var moment=require(_0xfba3('0x1'));var server=require(_0xfba3('0x2'));var Realtime=require(_0xfba3('0x3'));var Report=require(_0xfba3('0x4'));var Acw=require('./acw');var Trigger=require(_0xfba3('0x5'));var Dialer=require(_0xfba3('0x6'));var Preview=require(_0xfba3('0x7'));var Fax=require(_0xfba3('0x8'));var user=require(_0xfba3('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xfba3('0xa'));var template=require(_0xfba3('0xb'));var cmHopperHistory=require(_0xfba3('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xfba3('0xd'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xfba3('0xe'));var sugarcrm=require(_0xfba3('0xf'));var freshdesk=require(_0xfba3('0x10'));var desk=require(_0xfba3('0x11'));var zoho=require(_0xfba3('0x12'));var vtiger=require(_0xfba3('0x13'));var freshsales=require(_0xfba3('0x14'));var servicenow=require(_0xfba3('0x15'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xfba3('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfba3('0x17')](_0xfba3('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfba3('0x17')](_0xfba3('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfba3('0x19')]()[_0xfba3('0x1a')](user[_0xfba3('0x1b')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x1c')]())[_0xfba3('0x1a')](user['getTelephones']())['then'](realtime[_0xfba3('0x1d')]())[_0xfba3('0x1a')](trunk['getTrunks']())[_0xfba3('0x1a')](realtime[_0xfba3('0x1e')]())[_0xfba3('0x1a')](voiceQueue[_0xfba3('0x1f')]())[_0xfba3('0x1a')](realtime['initVoiceQueues']())[_0xfba3('0x1a')](trigger[_0xfba3('0x20')]())['then'](realtime[_0xfba3('0x21')]())[_0xfba3('0x1a')](template['getTemplates']())[_0xfba3('0x1a')](realtime[_0xfba3('0x22')]())[_0xfba3('0x1a')](zendesk['getZendeskAccounts']())[_0xfba3('0x1a')](realtime[_0xfba3('0x23')]())[_0xfba3('0x1a')](salesforce[_0xfba3('0x24')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x25')]())[_0xfba3('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0xfba3('0x1a')](realtime[_0xfba3('0x26')]())['then'](freshdesk[_0xfba3('0x27')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x28')]())[_0xfba3('0x1a')](desk[_0xfba3('0x29')]())[_0xfba3('0x1a')](realtime['initDeskAccounts']())[_0xfba3('0x1a')](zoho['getZohoAccounts']())[_0xfba3('0x1a')](realtime[_0xfba3('0x2a')]())[_0xfba3('0x1a')](vtiger[_0xfba3('0x2b')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x2c')]())[_0xfba3('0x1a')](freshsales['getFreshsalesAccounts']())[_0xfba3('0x1a')](realtime[_0xfba3('0x2d')]())['then'](servicenow[_0xfba3('0x2e')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x2f')]())[_0xfba3('0x1a')](dynamics365[_0xfba3('0x30')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x31')]())['then'](campaign[_0xfba3('0x32')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x33')]())[_0xfba3('0x1a')](voiceExtension['getVoiceExtensions']())[_0xfba3('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0xfba3('0x34')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x35')]())[_0xfba3('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xfba3('0x1a')](voiceQueueReport[_0xfba3('0x36')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x37')]())[_0xfba3('0x1a')](cmHopperHistory[_0xfba3('0x38')]())[_0xfba3('0x1a')](realtime[_0xfba3('0x39')]())[_0xfba3('0x1a')](cmHopperHistory[_0xfba3('0x3a')]())['then'](realtime[_0xfba3('0x3b')]())[_0xfba3('0x1a')](voiceCallReport[_0xfba3('0x3c')]())['then'](realtime[_0xfba3('0x3d')]())[_0xfba3('0x3e')](function(_0x516453){logger['error'](_0xfba3('0x3f'),util[_0xfba3('0x40')](_0x516453,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xfba3('0x1a')](function(_0x2fa9d4){return initRealtime();})['then'](function(){return initParams();})[_0xfba3('0x1a')](function(){report[_0xfba3('0x41')]();setInterval(initRealtime,0x1388);})[_0xfba3('0x3e')](function(_0x2b0849){logger[_0xfba3('0x42')]('[index.js][main]',util[_0xfba3('0x40')](_0x2b0849,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xfe0a=['./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','[index.js][main]','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template'];(function(_0x59547f,_0x1fe1da){var _0x2448d4=function(_0x20ac5d){while(--_0x20ac5d){_0x59547f['push'](_0x59547f['shift']());}};_0x2448d4(++_0x1fe1da);}(_0xfe0a,0x1ec));var _0xafe0=function(_0x5e68f0,_0x181383){_0x5e68f0=_0x5e68f0-0x0;var _0x320008=_0xfe0a[_0x5e68f0];return _0x320008;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0xafe0('0x0'));var Realtime=require(_0xafe0('0x1'));var Report=require('./report');var Acw=require(_0xafe0('0x2'));var Trigger=require(_0xafe0('0x3'));var Dialer=require(_0xafe0('0x4'));var Preview=require(_0xafe0('0x5'));var Fax=require('./fax');var user=require(_0xafe0('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xafe0('0x7'));var voiceCallReport=require(_0xafe0('0x8'));var trunk=require(_0xafe0('0x9'));var trigger=require(_0xafe0('0xa'));var template=require(_0xafe0('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xafe0('0xc'));var voiceExtension=require(_0xafe0('0xd'));var faxAccount=require(_0xafe0('0xe'));var zendesk=require(_0xafe0('0xf'));var salesforce=require(_0xafe0('0x10'));var sugarcrm=require(_0xafe0('0x11'));var freshdesk=require(_0xafe0('0x12'));var desk=require(_0xafe0('0x13'));var zoho=require(_0xafe0('0x14'));var vtiger=require(_0xafe0('0x15'));var freshsales=require(_0xafe0('0x16'));var servicenow=require(_0xafe0('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xafe0('0x18'))(_0xafe0('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xafe0('0x1a')](_0xafe0('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xafe0('0x1a')](_0xafe0('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xafe0('0x1c')]()[_0xafe0('0x1d')](user[_0xafe0('0x1e')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x1f')]())[_0xafe0('0x1d')](user[_0xafe0('0x20')]())[_0xafe0('0x1d')](realtime['initTelephones']())[_0xafe0('0x1d')](trunk[_0xafe0('0x21')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x22')]())[_0xafe0('0x1d')](voiceQueue[_0xafe0('0x23')]())['then'](realtime[_0xafe0('0x24')]())[_0xafe0('0x1d')](trigger[_0xafe0('0x25')]())['then'](realtime['initTriggers']())[_0xafe0('0x1d')](template[_0xafe0('0x26')]())[_0xafe0('0x1d')](realtime['initTemplates']())[_0xafe0('0x1d')](zendesk[_0xafe0('0x27')]())['then'](realtime['initZendeskAccounts']())['then'](salesforce['getSalesforceAccounts']())[_0xafe0('0x1d')](realtime[_0xafe0('0x28')]())[_0xafe0('0x1d')](sugarcrm[_0xafe0('0x29')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x2a')]())['then'](freshdesk[_0xafe0('0x2b')]())[_0xafe0('0x1d')](realtime['initFreshdeskAccounts']())['then'](desk[_0xafe0('0x2c')]())['then'](realtime[_0xafe0('0x2d')]())[_0xafe0('0x1d')](zoho[_0xafe0('0x2e')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x2f')]())['then'](vtiger[_0xafe0('0x30')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x31')]())[_0xafe0('0x1d')](freshsales[_0xafe0('0x32')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x33')]())[_0xafe0('0x1d')](servicenow[_0xafe0('0x34')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x35')]())[_0xafe0('0x1d')](dynamics365[_0xafe0('0x36')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x37')]())[_0xafe0('0x1d')](campaign[_0xafe0('0x38')]())[_0xafe0('0x1d')](realtime['initCampaigns']())[_0xafe0('0x1d')](voiceExtension[_0xafe0('0x39')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x3a')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0xafe0('0x3b')]())[_0xafe0('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0xafe0('0x1c')]()[_0xafe0('0x1d')](voiceQueueReport[_0xafe0('0x3c')]())[_0xafe0('0x1d')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xafe0('0x3d')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x3e')]())['then'](cmHopperHistory[_0xafe0('0x3f')]())['then'](realtime['initCampaignHopperHistory']())[_0xafe0('0x1d')](voiceCallReport[_0xafe0('0x40')]())[_0xafe0('0x1d')](realtime[_0xafe0('0x41')]())[_0xafe0('0x42')](function(_0x1c66d4){logger[_0xafe0('0x43')]('[index.js][initParams]',util[_0xafe0('0x44')](_0x1c66d4,{'showHidden':![],'depth':null}));});}function main(){return server[_0xafe0('0x45')](realtime,preview,fax)[_0xafe0('0x1d')](function(_0x266cf2){return initRealtime();})[_0xafe0('0x1d')](function(){return initParams();})[_0xafe0('0x1d')](function(){report[_0xafe0('0x46')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2b849d){logger[_0xafe0('0x43')](_0xafe0('0x47'),util[_0xafe0('0x44')](_0x2b849d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 92ab5b7..daae950 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c62d5,_0x2e49a9){_0x4c62d5=_0x4c62d5-0x0;var _0x4f84fb=_0xedd9[_0x4c62d5];return _0x4f84fb;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0xc65ae2,_0x53119a){var _0x2432ea=function(_0x3f70f3){while(--_0x3f70f3){_0xc65ae2['push'](_0xc65ae2['shift']());}};_0x2432ea(++_0x53119a);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index dcc0029..c94d927 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bbf=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialGlobalInterval'];(function(_0x5ed423,_0x527c5c){var _0x34bdb7=function(_0x300242){while(--_0x300242){_0x5ed423['push'](_0x5ed423['shift']());}};_0x34bdb7(++_0x527c5c);}(_0x5bbf,0x194));var _0xf5bb=function(_0x19c106,_0x238007){_0x19c106=_0x19c106-0x0;var _0x3341d6=_0x5bbf[_0x19c106];return _0x3341d6;};'use strict';function Campaign(_0x1d90c7){this['id']=_0x1d90c7['id']||0x0;this[_0xf5bb('0x0')]=_0x1d90c7[_0xf5bb('0x0')]||'';this[_0xf5bb('0x1')]=_0x1d90c7[_0xf5bb('0x1')]||_0xf5bb('0x2');this[_0xf5bb('0x3')]=0x0;this[_0xf5bb('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xf5bb('0x5')]=0x0;this[_0xf5bb('0x6')]='';this[_0xf5bb('0x7')]=!![];this['active']=_0x1d90c7[_0xf5bb('0x8')];this['limitCalls']=_0x1d90c7['limitCalls'];this['dialTimezone']=_0x1d90c7['dialTimezone']||null;this['dialGlobalInterval']=_0x1d90c7[_0xf5bb('0x9')]?_0x1d90c7[_0xf5bb('0x9')]:null;this[_0xf5bb('0xa')]=_0x1d90c7[_0xf5bb('0xa')];this[_0xf5bb('0xb')]=_0x1d90c7[_0xf5bb('0xb')];this[_0xf5bb('0xc')]=_0x1d90c7[_0xf5bb('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x1d90c7[_0xf5bb('0xd')];this[_0xf5bb('0xe')]=_0x1d90c7[_0xf5bb('0xe')];this['dialBusyMaxRetry']=_0x1d90c7['dialBusyMaxRetry'];this[_0xf5bb('0xf')]=_0x1d90c7[_0xf5bb('0xf')];this[_0xf5bb('0x10')]=_0x1d90c7[_0xf5bb('0x10')];this[_0xf5bb('0x11')]=_0x1d90c7['dialNoAnswerRetryFrequency'];this[_0xf5bb('0x12')]=_0x1d90c7[_0xf5bb('0x12')];this[_0xf5bb('0x13')]=_0x1d90c7[_0xf5bb('0x13')]||0x3;this[_0xf5bb('0x14')]=_0x1d90c7[_0xf5bb('0x14')]||0x96;this['dialDropMaxRetry']=_0x1d90c7['dialDropMaxRetry']||0x3;this[_0xf5bb('0x15')]=_0x1d90c7[_0xf5bb('0x15')]||0x96;this[_0xf5bb('0x16')]=_0x1d90c7[_0xf5bb('0x16')]||0x3;this['dialAbandonedRetryFrequency']=_0x1d90c7[_0xf5bb('0x17')]||0x96;this['dialMachineMaxRetry']=_0x1d90c7['dialMachineMaxRetry']||0x3;this[_0xf5bb('0x18')]=_0x1d90c7[_0xf5bb('0x18')]||0x96;this[_0xf5bb('0x19')]=_0x1d90c7[_0xf5bb('0x19')]||0x3;this[_0xf5bb('0x1a')]=_0x1d90c7[_0xf5bb('0x1a')]||0x96;this['dialOrderByScheduledAt']=_0x1d90c7[_0xf5bb('0x1b')]||_0xf5bb('0x1c');this[_0xf5bb('0x1d')]=_0x1d90c7['dialPrefix']||undefined;this[_0xf5bb('0x1e')]=_0x1d90c7[_0xf5bb('0x1e')]||undefined;this['dialCutDigit']=_0x1d90c7[_0xf5bb('0x1f')]||undefined;this['TrunkBackup']=_0x1d90c7[_0xf5bb('0x20')]?_0x1d90c7[_0xf5bb('0x20')]:undefined;this[_0xf5bb('0x21')]=_0x1d90c7[_0xf5bb('0x21')]?_0x1d90c7['Trunk']:undefined;this['Interval']=_0x1d90c7['Interval']?_0x1d90c7[_0xf5bb('0x22')]:undefined;this[_0xf5bb('0x23')]=_0x1d90c7[_0xf5bb('0x23')]?_0x1d90c7['SquareProject']:undefined;this[_0xf5bb('0x24')]=_0x1d90c7[_0xf5bb('0x23')]?_0x1d90c7[_0xf5bb('0x23')][_0xf5bb('0x0')]:undefined;this['dialAMDActive']=_0x1d90c7['dialAMDActive']||![];this[_0xf5bb('0x25')]=_0x1d90c7[_0xf5bb('0x25')];this[_0xf5bb('0x26')]=_0x1d90c7[_0xf5bb('0x26')];this[_0xf5bb('0x27')]=_0x1d90c7[_0xf5bb('0x27')];this[_0xf5bb('0x28')]=_0x1d90c7[_0xf5bb('0x28')];this[_0xf5bb('0x29')]=_0x1d90c7[_0xf5bb('0x29')];this['dialAMDBetweenWordsSilence']=_0x1d90c7['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x1d90c7[_0xf5bb('0x2a')];this[_0xf5bb('0x2b')]=_0x1d90c7[_0xf5bb('0x2b')];this[_0xf5bb('0x2c')]=_0x1d90c7[_0xf5bb('0x2c')];}module[_0xf5bb('0x2d')]=Campaign; \ No newline at end of file +var _0xe283=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x454118,_0x28412c){var _0x2afa94=function(_0x405fcc){while(--_0x405fcc){_0x454118['push'](_0x454118['shift']());}};_0x2afa94(++_0x28412c);}(_0xe283,0x75));var _0x3e28=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xe283[_0x122e9b];return _0x22c247;};'use strict';function Campaign(_0x4c8fe0){this['id']=_0x4c8fe0['id']||0x0;this[_0x3e28('0x0')]=_0x4c8fe0[_0x3e28('0x0')]||'';this[_0x3e28('0x1')]=_0x4c8fe0[_0x3e28('0x1')]||'campaign';this[_0x3e28('0x2')]=0x0;this[_0x3e28('0x3')]=0x0;this[_0x3e28('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x3e28('0x5')]='';this[_0x3e28('0x6')]=!![];this[_0x3e28('0x7')]=_0x4c8fe0[_0x3e28('0x7')];this[_0x3e28('0x8')]=_0x4c8fe0[_0x3e28('0x8')];this[_0x3e28('0x9')]=_0x4c8fe0[_0x3e28('0x9')]||null;this[_0x3e28('0xa')]=_0x4c8fe0['dialGlobalInterval']?_0x4c8fe0[_0x3e28('0xa')]:null;this[_0x3e28('0xb')]=_0x4c8fe0[_0x3e28('0xb')];this[_0x3e28('0xc')]=_0x4c8fe0[_0x3e28('0xc')];this[_0x3e28('0xd')]=_0x4c8fe0['dialOriginateTimeout']||0x1e;this[_0x3e28('0xe')]=_0x4c8fe0[_0x3e28('0xe')];this['dialCongestionRetryFrequency']=_0x4c8fe0[_0x3e28('0xf')];this[_0x3e28('0x10')]=_0x4c8fe0[_0x3e28('0x10')];this[_0x3e28('0x11')]=_0x4c8fe0[_0x3e28('0x11')];this[_0x3e28('0x12')]=_0x4c8fe0[_0x3e28('0x12')];this[_0x3e28('0x13')]=_0x4c8fe0['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x4c8fe0['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x4c8fe0[_0x3e28('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4c8fe0[_0x3e28('0x15')]||0x96;this[_0x3e28('0x16')]=_0x4c8fe0['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4c8fe0[_0x3e28('0x17')]||0x96;this[_0x3e28('0x18')]=_0x4c8fe0[_0x3e28('0x18')]||0x3;this[_0x3e28('0x19')]=_0x4c8fe0['dialAbandonedRetryFrequency']||0x96;this[_0x3e28('0x1a')]=_0x4c8fe0[_0x3e28('0x1a')]||0x3;this[_0x3e28('0x1b')]=_0x4c8fe0[_0x3e28('0x1b')]||0x96;this[_0x3e28('0x1c')]=_0x4c8fe0[_0x3e28('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4c8fe0[_0x3e28('0x1d')]||0x96;this[_0x3e28('0x1e')]=_0x4c8fe0[_0x3e28('0x1e')]||_0x3e28('0x1f');this[_0x3e28('0x20')]=_0x4c8fe0[_0x3e28('0x20')]||undefined;this[_0x3e28('0x21')]=_0x4c8fe0['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x3e28('0x22')]=_0x4c8fe0[_0x3e28('0x22')]||undefined;this[_0x3e28('0x23')]=_0x4c8fe0[_0x3e28('0x23')]?_0x4c8fe0[_0x3e28('0x23')]:undefined;this[_0x3e28('0x24')]=_0x4c8fe0[_0x3e28('0x24')]?_0x4c8fe0[_0x3e28('0x24')]:undefined;this[_0x3e28('0x25')]=_0x4c8fe0['Interval']?_0x4c8fe0['Interval']:undefined;this[_0x3e28('0x26')]=_0x4c8fe0[_0x3e28('0x26')]?_0x4c8fe0[_0x3e28('0x26')]:undefined;this[_0x3e28('0x27')]=_0x4c8fe0['SquareProject']?_0x4c8fe0[_0x3e28('0x26')][_0x3e28('0x0')]:undefined;this[_0x3e28('0x28')]=_0x4c8fe0[_0x3e28('0x28')]||![];this[_0x3e28('0x29')]=_0x4c8fe0[_0x3e28('0x29')];this[_0x3e28('0x2a')]=_0x4c8fe0[_0x3e28('0x2a')];this[_0x3e28('0x2b')]=_0x4c8fe0[_0x3e28('0x2b')];this[_0x3e28('0x2c')]=_0x4c8fe0[_0x3e28('0x2c')];this[_0x3e28('0x2d')]=_0x4c8fe0['dialAMDMinWordLength'];this[_0x3e28('0x2e')]=_0x4c8fe0[_0x3e28('0x2e')];this[_0x3e28('0x2f')]=_0x4c8fe0['dialAMDMaximumNumberOfWords'];this[_0x3e28('0x30')]=_0x4c8fe0[_0x3e28('0x30')];this[_0x3e28('0x31')]=_0x4c8fe0['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 19ccf03..1f6bc18 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a7=['answertime','unmanaged','abandoned','holdtime','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid'];(function(_0x54c8c4,_0x347736){var _0x5668bb=function(_0x4ba3b9){while(--_0x4ba3b9){_0x54c8c4['push'](_0x54c8c4['shift']());}};_0x5668bb(++_0x347736);}(_0x02a7,0x1a6));var _0x702a=function(_0x121b8d,_0x291526){_0x121b8d=_0x121b8d-0x0;var _0x27de63=_0x02a7[_0x121b8d];return _0x27de63;};'use strict';function Channel(){this['starttime']=null;this[_0x702a('0x0')]='';this[_0x702a('0x1')]='';this[_0x702a('0x2')]=0x0;this[_0x702a('0x3')]='';this[_0x702a('0x4')]=undefined;this[_0x702a('0x5')]=undefined;this[_0x702a('0x6')]=0x0;this[_0x702a('0x7')]='';this[_0x702a('0x8')]=0x0;this[_0x702a('0x9')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x702a('0xa')]=null;this['endtime']=null;this[_0x702a('0xb')]=![];this[_0x702a('0xc')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x702a('0xd')]=0x0;this[_0x702a('0xe')]=null;this['tag']=null;this[_0x702a('0xf')]=null;this[_0x702a('0x10')]=![];this[_0x702a('0x11')]=null;this[_0x702a('0x12')]=null;this[_0x702a('0x13')]=[];this[_0x702a('0x14')]=undefined;this[_0x702a('0x15')]=undefined;this[_0x702a('0x16')]=undefined;this['mohtime']=0x0;}module[_0x702a('0x17')]=Channel; \ No newline at end of file +var _0x57fa=['tag','disposition','monitor','monitors','transfercalleridnum','transferconnectedlinenum','transferType','starttime','channel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','type'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57fa,0x127));var _0xa57f=function(_0x19be8c,_0x39ee83){_0x19be8c=_0x19be8c-0x0;var _0x4dd02c=_0x57fa[_0x19be8c];return _0x4dd02c;};'use strict';function Channel(){this[_0xa57f('0x0')]=null;this[_0xa57f('0x1')]='';this['destinationchannel']='';this[_0xa57f('0x2')]=0x0;this['calleridname']='';this[_0xa57f('0x3')]=undefined;this[_0xa57f('0x4')]=undefined;this[_0xa57f('0x5')]=0x0;this[_0xa57f('0x6')]='';this[_0xa57f('0x7')]=0x0;this[_0xa57f('0x8')]=0x0;this[_0xa57f('0x9')]=0x0;this['answered']=![];this['answertime']=null;this[_0xa57f('0xa')]=null;this['unmanaged']=![];this[_0xa57f('0xb')]=![];this[_0xa57f('0xc')]='';this[_0xa57f('0xd')]='';this[_0xa57f('0xe')]=0x0;this[_0xa57f('0xf')]=0x0;this['holdtime']=0x0;this[_0xa57f('0x10')]=null;this[_0xa57f('0x11')]=null;this[_0xa57f('0x12')]=null;this[_0xa57f('0x13')]=![];this['monitorFilename']=null;this['queue']=null;this[_0xa57f('0x14')]=[];this[_0xa57f('0x15')]=undefined;this[_0xa57f('0x16')]=undefined;this[_0xa57f('0x17')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c84a871..6f0e93f 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3df=['password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','name','username','remoteUri','authType'];(function(_0xda3749,_0x106d79){var _0x2848a0=function(_0xc6c69d){while(--_0xc6c69d){_0xda3749['push'](_0xda3749['shift']());}};_0x2848a0(++_0x106d79);}(_0xa3df,0x130));var _0xfa3d=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xa3df[_0x59162a];return _0x35e50d;};'use strict';function DeskAccount(_0x376138){this['id']=_0x376138['id']||0x0;this[_0xfa3d('0x0')]=_0x376138[_0xfa3d('0x0')]||'';this[_0xfa3d('0x1')]=_0x376138[_0xfa3d('0x1')]||'';this[_0xfa3d('0x2')]=_0x376138[_0xfa3d('0x2')]||'';this[_0xfa3d('0x3')]=_0x376138[_0xfa3d('0x3')]||'';this[_0xfa3d('0x4')]=_0x376138[_0xfa3d('0x4')]||'';this[_0xfa3d('0x5')]=_0x376138[_0xfa3d('0x5')]||'';this[_0xfa3d('0x6')]=_0x376138[_0xfa3d('0x6')]||'';this['token']=_0x376138[_0xfa3d('0x7')]||'';this[_0xfa3d('0x8')]=_0x376138[_0xfa3d('0x8')]||'';this['type']=_0x376138['type']||'';this[_0xfa3d('0x9')]=_0x376138[_0xfa3d('0x9')]||'';this[_0xfa3d('0xa')]=_0x376138[_0xfa3d('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xc4b9=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','remoteUri'];(function(_0xbee111,_0x341367){var _0x257802=function(_0x110e7c){while(--_0x110e7c){_0xbee111['push'](_0xbee111['shift']());}};_0x257802(++_0x341367);}(_0xc4b9,0x136));var _0x9c4b=function(_0x540fdb,_0x2d12bb){_0x540fdb=_0x540fdb-0x0;var _0x1ba875=_0xc4b9[_0x540fdb];return _0x1ba875;};'use strict';function DeskAccount(_0x4d3efd){this['id']=_0x4d3efd['id']||0x0;this[_0x9c4b('0x0')]=_0x4d3efd[_0x9c4b('0x0')]||'';this['username']=_0x4d3efd['username']||'';this[_0x9c4b('0x1')]=_0x4d3efd[_0x9c4b('0x1')]||'';this[_0x9c4b('0x2')]=_0x4d3efd[_0x9c4b('0x2')]||'';this[_0x9c4b('0x3')]=_0x4d3efd['password']||'';this[_0x9c4b('0x4')]=_0x4d3efd[_0x9c4b('0x4')]||'';this[_0x9c4b('0x5')]=_0x4d3efd['consumerSecret']||'';this['token']=_0x4d3efd[_0x9c4b('0x6')]||'';this[_0x9c4b('0x7')]=_0x4d3efd['tokenSecret']||'';this[_0x9c4b('0x8')]=_0x4d3efd[_0x9c4b('0x8')]||'';this[_0x9c4b('0x9')]=_0x4d3efd[_0x9c4b('0x9')]||'';this[_0x9c4b('0xa')]=_0x4d3efd[_0x9c4b('0xa')]||{};}module[_0x9c4b('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9d69be9..67275e2 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c81=['Configurations','exports','name','username','tenantId','clientId','clientSecret','serverUrl'];(function(_0x393b33,_0x159413){var _0x1ac5a4=function(_0x37e2b7){while(--_0x37e2b7){_0x393b33['push'](_0x393b33['shift']());}};_0x1ac5a4(++_0x159413);}(_0x3c81,0x102));var _0x13c8=function(_0x35ac5e,_0x2de433){_0x35ac5e=_0x35ac5e-0x0;var _0x240d60=_0x3c81[_0x35ac5e];return _0x240d60;};'use strict';function Dynamics365Account(_0x55010d){this['id']=_0x55010d['id']||0x0;this[_0x13c8('0x0')]=_0x55010d['name']||'';this[_0x13c8('0x1')]=_0x55010d[_0x13c8('0x1')]||'';this['password']=_0x55010d['password']||'';this['remoteUri']=_0x55010d['remoteUri']||'';this[_0x13c8('0x2')]=_0x55010d[_0x13c8('0x2')]||'';this[_0x13c8('0x3')]=_0x55010d[_0x13c8('0x3')]||'';this[_0x13c8('0x4')]=_0x55010d[_0x13c8('0x4')]||{};this[_0x13c8('0x5')]=_0x55010d['serverUrl']||'';this[_0x13c8('0x6')]=_0x55010d['Configurations']||{};}module[_0x13c8('0x7')]=Dynamics365Account; \ No newline at end of file +var _0x5c00=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x1009cc,_0x9bc3eb){var _0x2ea939=function(_0x3d2feb){while(--_0x3d2feb){_0x1009cc['push'](_0x1009cc['shift']());}};_0x2ea939(++_0x9bc3eb);}(_0x5c00,0x17e));var _0x05c0=function(_0x4cdba5,_0x5373a7){_0x4cdba5=_0x4cdba5-0x0;var _0x3be43d=_0x5c00[_0x4cdba5];return _0x3be43d;};'use strict';function Dynamics365Account(_0x29fe0e){this['id']=_0x29fe0e['id']||0x0;this[_0x05c0('0x0')]=_0x29fe0e[_0x05c0('0x0')]||'';this['username']=_0x29fe0e[_0x05c0('0x1')]||'';this['password']=_0x29fe0e[_0x05c0('0x2')]||'';this[_0x05c0('0x3')]=_0x29fe0e[_0x05c0('0x3')]||'';this[_0x05c0('0x4')]=_0x29fe0e['tenantId']||'';this[_0x05c0('0x5')]=_0x29fe0e[_0x05c0('0x5')]||'';this[_0x05c0('0x6')]=_0x29fe0e[_0x05c0('0x6')]||{};this['serverUrl']=_0x29fe0e[_0x05c0('0x7')]||'';this[_0x05c0('0x8')]=_0x29fe0e[_0x05c0('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 79269a8..10cb6ee 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb6=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate'];(function(_0x2d3816,_0x4260e9){var _0x491162=function(_0x587a6d){while(--_0x587a6d){_0x2d3816['push'](_0x2d3816['shift']());}};_0x491162(++_0x4260e9);}(_0x5eb6,0x1a3));var _0x65eb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5eb6[_0x19950b];return _0x3c6b41;};'use strict';function FaxAccount(_0x459e58){this['id']=_0x459e58['id']||0x0;this[_0x65eb('0x0')]=_0x459e58['name']||'';this['description']=_0x459e58[_0x65eb('0x1')];this[_0x65eb('0x2')]=_0x459e58[_0x65eb('0x2')];this[_0x65eb('0x3')]=_0x459e58['headerinfo'];this['localstationid']=_0x459e58['localstationid'];this[_0x65eb('0x4')]=_0x459e58[_0x65eb('0x4')]||0x960;this['maxrate']=_0x459e58[_0x65eb('0x5')]||0x3840;this[_0x65eb('0x6')]=_0x459e58[_0x65eb('0x6')]||_0x65eb('0x7');this['gateway']=_0x459e58[_0x65eb('0x8')]||'no';this[_0x65eb('0x9')]=_0x459e58[_0x65eb('0x9')]||'no';this[_0x65eb('0xa')]=_0x459e58['t38timeout']||0x1388;this[_0x65eb('0xb')]=_0x459e58[_0x65eb('0xb')]||_0x65eb('0xc');this[_0x65eb('0xd')]=_0x459e58[_0x65eb('0xd')]?_0x459e58[_0x65eb('0xd')]:undefined;this[_0x65eb('0xe')]=_0x459e58[_0x65eb('0xe')];this['key']=_0x459e58[_0x65eb('0xf')];}module[_0x65eb('0x10')]=FaxAccount; \ No newline at end of file +var _0xad18=['ecm','headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','description'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xad18,0xfb));var _0x8ad1=function(_0x107f6e,_0x3cbcae){_0x107f6e=_0x107f6e-0x0;var _0x2d5059=_0xad18[_0x107f6e];return _0x2d5059;};'use strict';function FaxAccount(_0x127b5e){this['id']=_0x127b5e['id']||0x0;this['name']=_0x127b5e['name']||'';this['description']=_0x127b5e[_0x8ad1('0x0')];this['ecm']=_0x127b5e[_0x8ad1('0x1')];this['headerinfo']=_0x127b5e[_0x8ad1('0x2')];this['localstationid']=_0x127b5e['localstationid'];this[_0x8ad1('0x3')]=_0x127b5e[_0x8ad1('0x3')]||0x960;this[_0x8ad1('0x4')]=_0x127b5e[_0x8ad1('0x4')]||0x3840;this[_0x8ad1('0x5')]=_0x127b5e[_0x8ad1('0x5')]||_0x8ad1('0x6');this[_0x8ad1('0x7')]=_0x127b5e['gateway']||'no';this[_0x8ad1('0x8')]=_0x127b5e[_0x8ad1('0x8')]||'no';this[_0x8ad1('0x9')]=_0x127b5e[_0x8ad1('0x9')]||0x1388;this[_0x8ad1('0xa')]=_0x127b5e[_0x8ad1('0xa')]||'SIP';this[_0x8ad1('0xb')]=_0x127b5e[_0x8ad1('0xb')]?_0x127b5e[_0x8ad1('0xb')]:undefined;this[_0x8ad1('0xc')]=_0x127b5e['ListId'];this[_0x8ad1('0xd')]=_0x127b5e[_0x8ad1('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 13408f2..9e68b56 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9fd=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x1af7a4,_0xfc6f27){var _0x1181fe=function(_0x3b88b8){while(--_0x3b88b8){_0x1af7a4['push'](_0x1af7a4['shift']());}};_0x1181fe(++_0xfc6f27);}(_0xf9fd,0xf0));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';function FreshdeskAccount(_0x4f8453){this['id']=_0x4f8453['id']||0x0;this[_0xdf9f('0x0')]=_0x4f8453[_0xdf9f('0x0')]||'';this[_0xdf9f('0x1')]=_0x4f8453[_0xdf9f('0x1')]||'';this['apiKey']=_0x4f8453[_0xdf9f('0x2')]||'';this[_0xdf9f('0x3')]=_0x4f8453[_0xdf9f('0x3')]||'';this[_0xdf9f('0x4')]=_0x4f8453['serverUrl']||'';this[_0xdf9f('0x5')]=_0x4f8453[_0xdf9f('0x5')]||{};}module[_0xdf9f('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x41af=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x41af,0xc8));var _0xf41a=function(_0x2e64a0,_0x4711b9){_0x2e64a0=_0x2e64a0-0x0;var _0x594398=_0x41af[_0x2e64a0];return _0x594398;};'use strict';function FreshdeskAccount(_0x1ebf92){this['id']=_0x1ebf92['id']||0x0;this[_0xf41a('0x0')]=_0x1ebf92['name']||'';this['username']=_0x1ebf92[_0xf41a('0x1')]||'';this[_0xf41a('0x2')]=_0x1ebf92[_0xf41a('0x3')]||'';this[_0xf41a('0x4')]=_0x1ebf92[_0xf41a('0x4')]||'';this[_0xf41a('0x5')]=_0x1ebf92['serverUrl']||'';this[_0xf41a('0x6')]=_0x1ebf92[_0xf41a('0x6')]||{};}module[_0xf41a('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index a68469d..8a1ce7a 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x535d=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x1d4917,_0xe18f66){var _0x4365c7=function(_0x337ecc){while(--_0x337ecc){_0x1d4917['push'](_0x1d4917['shift']());}};_0x4365c7(++_0xe18f66);}(_0x535d,0xe8));var _0xd535=function(_0x577dbb,_0x155d6a){_0x577dbb=_0x577dbb-0x0;var _0x25346d=_0x535d[_0x577dbb];return _0x25346d;};'use strict';function FreshsalesAccount(_0x28de83){this['id']=_0x28de83['id']||0x0;this[_0xd535('0x0')]=_0x28de83['name']||'';this[_0xd535('0x1')]=_0x28de83[_0xd535('0x1')]||'';this['apiKey']=_0x28de83['token']||'';this[_0xd535('0x2')]=_0x28de83[_0xd535('0x2')]||'';this[_0xd535('0x3')]=_0x28de83[_0xd535('0x3')]||'';this[_0xd535('0x4')]=_0x28de83[_0xd535('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x9c5a=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4846e1,_0x593a3d){_0x4846e1=_0x4846e1-0x0;var _0x3452ab=_0x9c5a[_0x4846e1];return _0x3452ab;};'use strict';function FreshsalesAccount(_0x4db732){this['id']=_0x4db732['id']||0x0;this[_0xa9c5('0x0')]=_0x4db732['name']||'';this[_0xa9c5('0x1')]=_0x4db732[_0xa9c5('0x1')]||'';this[_0xa9c5('0x2')]=_0x4db732[_0xa9c5('0x3')]||'';this['remoteUri']=_0x4db732[_0xa9c5('0x4')]||'';this[_0xa9c5('0x5')]=_0x4db732['serverUrl']||'';this[_0xa9c5('0x6')]=_0x4db732['Configurations']||{};}module[_0xa9c5('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8970990..3b1c552 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd728=['priority','holdtime','assigned','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten'];(function(_0xb69534,_0x228632){var _0x4a951b=function(_0x5a7630){while(--_0x5a7630){_0xb69534['push'](_0xb69534['shift']());}};_0x4a951b(++_0x228632);}(_0xd728,0x1c9));var _0x8d72=function(_0x28a537,_0x24f2e6){_0x28a537=_0x28a537-0x0;var _0x2b5742=_0xd728[_0x28a537];return _0x2b5742;};'use strict';function QueueReport(){this[_0x8d72('0x0')]=_0x8d72('0x1');this[_0x8d72('0x2')]='';this[_0x8d72('0x3')]='';this[_0x8d72('0x4')]='';this[_0x8d72('0x5')]='';this[_0x8d72('0x6')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this[_0x8d72('0x7')]=![];this[_0x8d72('0x8')]=null;this['queuecallercomplete']=![];this[_0x8d72('0x9')]=null;this[_0x8d72('0xa')]=![];this[_0x8d72('0xb')]=null;this[_0x8d72('0xc')]=0x1;this[_0x8d72('0xd')]='';this[_0x8d72('0xe')]='';this[_0x8d72('0xf')]='';this['accountcode']='';this[_0x8d72('0x10')]='';this[_0x8d72('0x11')]='';this[_0x8d72('0x12')]='';this[_0x8d72('0x13')]=0x0;this[_0x8d72('0x14')]=![];this['lastAssignedTo']='';this[_0x8d72('0x15')]=_0x8d72('0x16');this[_0x8d72('0x17')]=0x0;this[_0x8d72('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x7c0a=['position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','context','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x4e3f4a,_0x2177c7){var _0x2b5188=function(_0x5e3c44){while(--_0x5e3c44){_0x4e3f4a['push'](_0x4e3f4a['shift']());}};_0x2b5188(++_0x2177c7);}(_0x7c0a,0x161));var _0xa7c0=function(_0x5ad3b9,_0x12ee77){_0x5ad3b9=_0x5ad3b9-0x0;var _0x27a318=_0x7c0a[_0x5ad3b9];return _0x27a318;};'use strict';function QueueReport(){this['type']='inbound';this[_0xa7c0('0x0')]='';this['calleridnum']='';this[_0xa7c0('0x1')]='';this['queue']='';this[_0xa7c0('0x2')]=null;this[_0xa7c0('0x3')]=null;this[_0xa7c0('0x4')]=0x1;this[_0xa7c0('0x5')]=0x1;this[_0xa7c0('0x6')]=![];this['queuecallerabandonAt']=null;this[_0xa7c0('0x7')]=![];this[_0xa7c0('0x8')]=null;this[_0xa7c0('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xa7c0('0xa')]='';this[_0xa7c0('0xb')]='';this[_0xa7c0('0xc')]='';this['accountcode']='';this[_0xa7c0('0xd')]='';this['exten']='';this[_0xa7c0('0xe')]='';this[_0xa7c0('0xf')]=0x0;this['assigned']=![];this[_0xa7c0('0x10')]='';this[_0xa7c0('0x11')]=_0xa7c0('0x12');this[_0xa7c0('0x13')]=0x0;this[_0xa7c0('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4ebb181..2c12108 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ee9=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x51a800,_0x455419){var _0x1c6744=function(_0x11ba46){while(--_0x11ba46){_0x51a800['push'](_0x51a800['shift']());}};_0x1c6744(++_0x455419);}(_0x6ee9,0x9c));var _0x96ee=function(_0x3006e1,_0x50e7ed){_0x3006e1=_0x3006e1-0x0;var _0x2657fa=_0x6ee9[_0x3006e1];return _0x2657fa;};'use strict';function SalesforceAccount(_0x363413){this['id']=_0x363413['id']||0x0;this[_0x96ee('0x0')]=_0x363413[_0x96ee('0x0')]||'';this['username']=_0x363413[_0x96ee('0x1')]||'';this[_0x96ee('0x2')]=_0x363413[_0x96ee('0x2')]||'';this[_0x96ee('0x3')]=_0x363413[_0x96ee('0x3')]||'';this[_0x96ee('0x4')]=_0x363413[_0x96ee('0x4')]||'';this[_0x96ee('0x5')]=_0x363413[_0x96ee('0x5')]||'';this[_0x96ee('0x6')]=_0x363413[_0x96ee('0x6')]||'';this[_0x96ee('0x7')]=_0x363413[_0x96ee('0x7')]||_0x96ee('0x8');this[_0x96ee('0x9')]=_0x363413[_0x96ee('0x9')]||'';this[_0x96ee('0xa')]=_0x363413[_0x96ee('0xa')]||{};}module[_0x96ee('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x957a=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x49c66a,_0x4749df){var _0x59bcd5=function(_0x16132e){while(--_0x16132e){_0x49c66a['push'](_0x49c66a['shift']());}};_0x59bcd5(++_0x4749df);}(_0x957a,0x137));var _0xa957=function(_0x5749ce,_0x42a562){_0x5749ce=_0x5749ce-0x0;var _0x2b792a=_0x957a[_0x5749ce];return _0x2b792a;};'use strict';function SalesforceAccount(_0x4f68f1){this['id']=_0x4f68f1['id']||0x0;this[_0xa957('0x0')]=_0x4f68f1[_0xa957('0x0')]||'';this[_0xa957('0x1')]=_0x4f68f1[_0xa957('0x1')]||'';this['remoteUri']=_0x4f68f1[_0xa957('0x2')]||'';this[_0xa957('0x3')]=_0x4f68f1[_0xa957('0x3')]||'';this[_0xa957('0x4')]=_0x4f68f1[_0xa957('0x4')]||'';this[_0xa957('0x5')]=_0x4f68f1[_0xa957('0x5')]||'';this[_0xa957('0x6')]=_0x4f68f1[_0xa957('0x6')]||'';this[_0xa957('0x7')]=_0x4f68f1[_0xa957('0x7')]||'integrationTab';this['serverUrl']=_0x4f68f1[_0xa957('0x8')]||'';this[_0xa957('0x9')]=_0x4f68f1[_0xa957('0x9')]||{};}module[_0xa957('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 02a974c..501cb7e 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x349e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3680f3,_0x9ac3fe){var _0x546c15=function(_0x1c8382){while(--_0x1c8382){_0x3680f3['push'](_0x3680f3['shift']());}};_0x546c15(++_0x9ac3fe);}(_0x349e,0x6f));var _0xe349=function(_0x28f323,_0x13af44){_0x28f323=_0x28f323-0x0;var _0x4aec09=_0x349e[_0x28f323];return _0x4aec09;};'use strict';function ServicenowAccount(_0x54ebec){this['id']=_0x54ebec['id']||0x0;this[_0xe349('0x0')]=_0x54ebec[_0xe349('0x0')]||'';this['username']=_0x54ebec[_0xe349('0x1')]||'';this[_0xe349('0x2')]=_0x54ebec['password']||'';this[_0xe349('0x3')]=_0x54ebec[_0xe349('0x3')]||'';this['serverUrl']=_0x54ebec[_0xe349('0x4')]||'';this[_0xe349('0x5')]=_0x54ebec[_0xe349('0x5')]||{};}module[_0xe349('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x515d=['serverUrl','exports','name','username','password'];(function(_0x5dc4b1,_0x5510f8){var _0x9676bc=function(_0x11acae){while(--_0x11acae){_0x5dc4b1['push'](_0x5dc4b1['shift']());}};_0x9676bc(++_0x5510f8);}(_0x515d,0x1ce));var _0xd515=function(_0x3a54e0,_0x4796a9){_0x3a54e0=_0x3a54e0-0x0;var _0x1445d9=_0x515d[_0x3a54e0];return _0x1445d9;};'use strict';function ServicenowAccount(_0x5c71f8){this['id']=_0x5c71f8['id']||0x0;this[_0xd515('0x0')]=_0x5c71f8[_0xd515('0x0')]||'';this[_0xd515('0x1')]=_0x5c71f8[_0xd515('0x1')]||'';this[_0xd515('0x2')]=_0x5c71f8[_0xd515('0x2')]||'';this['remoteUri']=_0x5c71f8['remoteUri']||'';this[_0xd515('0x3')]=_0x5c71f8[_0xd515('0x3')]||'';this['Configurations']=_0x5c71f8['Configurations']||{};}module[_0xd515('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 71fa3f5..f6b53a8 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bb5=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x16d4b6,_0x527555){var _0xeeaf29=function(_0x272d27){while(--_0x272d27){_0x16d4b6['push'](_0x16d4b6['shift']());}};_0xeeaf29(++_0x527555);}(_0x4bb5,0xf1));var _0x54bb=function(_0xdc009f,_0x417c0c){_0xdc009f=_0xdc009f-0x0;var _0x4a6b30=_0x4bb5[_0xdc009f];return _0x4a6b30;};'use strict';function SugarcrmAccount(_0x4160fb){this['id']=_0x4160fb['id']||0x0;this[_0x54bb('0x0')]=_0x4160fb[_0x54bb('0x0')]||'';this[_0x54bb('0x1')]=_0x4160fb['username']||'';this[_0x54bb('0x2')]=_0x4160fb['password']||'';this[_0x54bb('0x3')]=_0x4160fb[_0x54bb('0x3')]||'';this[_0x54bb('0x4')]=_0x4160fb['serverUrl']||'';this['Configurations']=_0x4160fb['Configurations']||{};}module[_0x54bb('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x9377=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4d8742,_0xd8d845){var _0x59701d=function(_0x5ab85b){while(--_0x5ab85b){_0x4d8742['push'](_0x4d8742['shift']());}};_0x59701d(++_0xd8d845);}(_0x9377,0xc4));var _0x7937=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9377[_0x20a584];return _0x4b41a8;};'use strict';function SugarcrmAccount(_0x16b57b){this['id']=_0x16b57b['id']||0x0;this[_0x7937('0x0')]=_0x16b57b['name']||'';this[_0x7937('0x1')]=_0x16b57b[_0x7937('0x1')]||'';this[_0x7937('0x2')]=_0x16b57b[_0x7937('0x2')]||'';this[_0x7937('0x3')]=_0x16b57b[_0x7937('0x3')]||'';this[_0x7937('0x4')]=_0x16b57b[_0x7937('0x4')]||'';this[_0x7937('0x5')]=_0x16b57b['Configurations']||{};}module[_0x7937('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 32f6446..32b75ec 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6df1=['state','unknown','stateTime','address','exports','name','accountcode'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x6df1,0x1e8));var _0x16df=function(_0x2e7c96,_0x27804d){_0x2e7c96=_0x2e7c96-0x0;var _0x36008e=_0x6df1[_0x2e7c96];return _0x36008e;};'use strict';function Telephone(_0x51031f){this['id']=_0x51031f['id']||0x0;this[_0x16df('0x0')]=_0x51031f[_0x16df('0x0')]||'';this[_0x16df('0x1')]=_0x51031f[_0x16df('0x1')]||'';this[_0x16df('0x2')]=_0x16df('0x3');this[_0x16df('0x4')]=0x0;this['status']='unknown';this[_0x16df('0x5')]='';}module[_0x16df('0x6')]=Telephone; \ No newline at end of file +var _0x7c35=['unknown','stateTime','exports','name','accountcode','state'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x7c35,0x135));var _0x57c3=function(_0x8bdfb5,_0x4c66d0){_0x8bdfb5=_0x8bdfb5-0x0;var _0x48f892=_0x7c35[_0x8bdfb5];return _0x48f892;};'use strict';function Telephone(_0xfeb953){this['id']=_0xfeb953['id']||0x0;this[_0x57c3('0x0')]=_0xfeb953[_0x57c3('0x0')]||'';this[_0x57c3('0x1')]=_0xfeb953[_0x57c3('0x1')]||'';this[_0x57c3('0x2')]=_0x57c3('0x3');this[_0x57c3('0x4')]=0x0;this['status']=_0x57c3('0x3');this['address']='';}module[_0x57c3('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 23eba18..05c10fc 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4e544b,_0xa964f3){var _0x123418=function(_0x4e26d1){while(--_0x4e26d1){_0x4e544b['push'](_0x4e544b['shift']());}};_0x123418(++_0xa964f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x150874,_0x4c8797){var _0x3b7129=function(_0x570883){while(--_0x570883){_0x150874['push'](_0x150874['shift']());}};_0x3b7129(++_0x4c8797);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 6208a4e..0f8f22a 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2cd1b9,_0x3b5cdd){var _0x31dea6=function(_0x4f7012){while(--_0x4f7012){_0x2cd1b9['push'](_0x2cd1b9['shift']());}};_0x31dea6(++_0x3b5cdd);}(_0x2032,0xd9));var _0x2203=function(_0x1ccc5c,_0x2623e7){_0x1ccc5c=_0x1ccc5c-0x0;var _0x1dff90=_0x2032[_0x1ccc5c];return _0x1dff90;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x0b0e[_0x152fe3];return _0xc5bb39;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 9c8b4c6..ff5d0b2 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x909f=['split','host','port','registrationtime','address','defaultuser','exports','active','name','state','unknown','registry','indexOf'];(function(_0x382c31,_0x424dc2){var _0x12d3b2=function(_0x2d09bf){while(--_0x2d09bf){_0x382c31['push'](_0x382c31['shift']());}};_0x12d3b2(++_0x424dc2);}(_0x909f,0xf1));var _0xf909=function(_0x1809d1,_0x410d74){_0x1809d1=_0x1809d1-0x0;var _0x23f549=_0x909f[_0x1809d1];return _0x23f549;};'use strict';function Trunk(_0x4e6a4c){this['id']=_0x4e6a4c['id']||0x0;this[_0xf909('0x0')]=_0x4e6a4c[_0xf909('0x0')]||![];this[_0xf909('0x1')]=_0x4e6a4c[_0xf909('0x1')]||'';this[_0xf909('0x2')]=_0xf909('0x3');this['stateTime']=0x0;this['status']=_0xf909('0x3');this['registry']=_0x4e6a4c[_0xf909('0x4')]&&_0x4e6a4c[_0xf909('0x4')][_0xf909('0x5')](':')?_0x4e6a4c[_0xf909('0x4')][_0xf909('0x6')](':')[0x0]:'';this[_0xf909('0x7')]='';this[_0xf909('0x8')]='';this['domain']='';this['domainport']='';this['refresh']='';this['stateRegistry']=_0xf909('0x3');this[_0xf909('0x9')]='';this[_0xf909('0xa')]='';this[_0xf909('0xb')]=_0x4e6a4c[_0xf909('0xb')]||'';}module[_0xf909('0xc')]=Trunk; \ No newline at end of file +var _0xbfb6=['status','unknown','registry','split','port','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','state','stateTime'];(function(_0x4c6afa,_0x202536){var _0x483ad9=function(_0x38d024){while(--_0x38d024){_0x4c6afa['push'](_0x4c6afa['shift']());}};_0x483ad9(++_0x202536);}(_0xbfb6,0x15b));var _0x6bfb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfb6[_0x4565bf];return _0x5610ba;};'use strict';function Trunk(_0x52ac77){this['id']=_0x52ac77['id']||0x0;this[_0x6bfb('0x0')]=_0x52ac77['active']||![];this['name']=_0x52ac77['name']||'';this[_0x6bfb('0x1')]='unknown';this[_0x6bfb('0x2')]=0x0;this[_0x6bfb('0x3')]=_0x6bfb('0x4');this[_0x6bfb('0x5')]=_0x52ac77[_0x6bfb('0x5')]&&_0x52ac77[_0x6bfb('0x5')]['indexOf'](':')?_0x52ac77[_0x6bfb('0x5')][_0x6bfb('0x6')](':')[0x0]:'';this['host']='';this[_0x6bfb('0x7')]='';this['domain']='';this[_0x6bfb('0x8')]='';this[_0x6bfb('0x9')]='';this[_0x6bfb('0xa')]=_0x6bfb('0x4');this[_0x6bfb('0xb')]='';this['address']='';this[_0x6bfb('0xc')]=_0x52ac77['defaultuser']||'';}module[_0x6bfb('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5886ec4..060f852 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8a3=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x546c68,_0x5c0116){var _0x4a2389=function(_0x5aa205){while(--_0x5aa205){_0x546c68['push'](_0x546c68['shift']());}};_0x4a2389(++_0x5c0116);}(_0xd8a3,0xae));var _0x3d8a=function(_0x43d2fb,_0x537d8b){_0x43d2fb=_0x43d2fb-0x0;var _0x5beac0=_0xd8a3[_0x43d2fb];return _0x5beac0;};'use strict';function voiceExtension(_0x456d58){this['id']=_0x456d58['id']||0x0;this[_0x3d8a('0x0')]=_0x456d58[_0x3d8a('0x0')]||'';this['recordingFormat']=_0x456d58[_0x3d8a('0x1')]||'none';this[_0x3d8a('0x2')]=_0x456d58['mandatoryDisposition']||![];}module[_0x3d8a('0x3')]=voiceExtension; \ No newline at end of file +var _0xfee3=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x5723e9,_0x16c2f9){var _0x34ec64=function(_0x4276e6){while(--_0x4276e6){_0x5723e9['push'](_0x5723e9['shift']());}};_0x34ec64(++_0x16c2f9);}(_0xfee3,0x120));var _0x3fee=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xfee3[_0xdea41a];return _0x15d0d8;};'use strict';function voiceExtension(_0x502696){this['id']=_0x502696['id']||0x0;this[_0x3fee('0x0')]=_0x502696[_0x3fee('0x0')]||'';this['recordingFormat']=_0x502696[_0x3fee('0x1')]||'none';this[_0x3fee('0x2')]=_0x502696[_0x3fee('0x2')]||![];}module[_0x3fee('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 459190a..75361d2 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d22=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundAnswerAgiCallsDay'];(function(_0x54b840,_0x5a4068){var _0x3bcf42=function(_0x3bec44){while(--_0x3bec44){_0x54b840['push'](_0x54b840['shift']());}};_0x3bcf42(++_0x5a4068);}(_0x6d22,0x112));var _0x26d2=function(_0x3bdc0f,_0x4f0015){_0x3bdc0f=_0x3bdc0f-0x0;var _0xb5ec5b=_0x6d22[_0x3bdc0f];return _0xb5ec5b;};'use strict';var statusDesc=[_0x26d2('0x0'),_0x26d2('0x1'),_0x26d2('0x2'),_0x26d2('0x3'),_0x26d2('0x4'),'unavailable',_0x26d2('0x5'),_0x26d2('0x6'),_0x26d2('0x7')];var monitorFormat={'wav':_0x26d2('0x8'),'wav49':_0x26d2('0x9'),'gsm':_0x26d2('0xa')};var strategy={'rrmemory':_0x26d2('0xb'),'roundrobin':_0x26d2('0xc')};function VoiceQueue(_0x215327){this['id']=_0x215327['id']||0x0;this[_0x26d2('0xd')]=_0x215327[_0x26d2('0xd')]||'';this['monitor_format']=_0x215327[_0x26d2('0xe')]||'';this['type']=_0x215327[_0x26d2('0xf')]||'inbound';this[_0x26d2('0x10')]=0x0;this['talking']=0x0;this[_0x26d2('0x11')]=0x0;this[_0x26d2('0x12')]=0x0;this[_0x26d2('0x13')]=0x0;this[_0x26d2('0x14')]=0x0;this['sumBillable']=0x0;this[_0x26d2('0x15')]=0x0;this[_0x26d2('0x16')]=0x0;this[_0x26d2('0x17')]=0x0;this[_0x26d2('0x18')]=0x0;this[_0x26d2('0x19')]=_0x215327['acw']||![];this[_0x26d2('0x1a')]=_0x215327[_0x26d2('0x1a')]||0xa;this['autopause']=_0x215327[_0x26d2('0x1b')]||'no';this[_0x26d2('0x1c')]=!![];this[_0x26d2('0x1d')]='';this[_0x26d2('0x1e')]=0x0;this[_0x26d2('0x1f')]=0x0;this[_0x26d2('0x20')]=_0x215327['dialTimezone']||null;this[_0x26d2('0x21')]=_0x215327[_0x26d2('0x21')]?_0x215327[_0x26d2('0x21')]:null;this[_0x26d2('0x22')]=_0x215327['dialActive'];this['dialMethod']=_0x215327['dialMethod']||_0x26d2('0x23');this[_0x26d2('0x24')]=_0x215327[_0x26d2('0x24')]||0x0;this['dialLimitQueue']=_0x215327[_0x26d2('0x25')]||0x0;this[_0x26d2('0x26')]=_0x215327[_0x26d2('0x26')]||0x1;this[_0x26d2('0x27')]=_0x215327[_0x26d2('0x27')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x215327[_0x26d2('0x28')]||0.03;this['dialPredictiveInterval']=_0x215327[_0x26d2('0x29')]||0x258;this['dialOriginateCallerIdName']=_0x215327['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x215327[_0x26d2('0x2a')]||_0x26d2('0x2b');this['dialOriginateTimeout']=_0x215327[_0x26d2('0x2c')]||0x1e;this[_0x26d2('0x2d')]=_0x215327[_0x26d2('0x2d')]||_0x26d2('0x2e');this[_0x26d2('0x2f')]=_0x215327['dialQueueTimeout']||0x3;this[_0x26d2('0x30')]=_0x215327['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x215327['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x215327[_0x26d2('0x31')]||0x96;this[_0x26d2('0x32')]=_0x215327[_0x26d2('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x215327[_0x26d2('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x215327[_0x26d2('0x34')]||0x3;this[_0x26d2('0x35')]=_0x215327[_0x26d2('0x35')]||0x96;this[_0x26d2('0x36')]=_0x215327[_0x26d2('0x36')]||0x3;this[_0x26d2('0x37')]=_0x215327['dialNoSuchNumberRetryFrequency']||0x96;this[_0x26d2('0x38')]=_0x215327[_0x26d2('0x38')]||0x3;this['dialDropRetryFrequency']=_0x215327[_0x26d2('0x39')]||0x96;this[_0x26d2('0x3a')]=_0x215327[_0x26d2('0x3a')]||0x3;this[_0x26d2('0x3b')]=_0x215327[_0x26d2('0x3b')]||0x96;this[_0x26d2('0x3c')]=_0x215327[_0x26d2('0x3c')]||0x3;this[_0x26d2('0x3d')]=_0x215327[_0x26d2('0x3d')]||0x96;this['dialAgentRejectMaxRetry']=_0x215327['dialAgentRejectMaxRetry']||0x3;this[_0x26d2('0x3e')]=_0x215327[_0x26d2('0x3e')]||0x96;this[_0x26d2('0x3f')]=_0x215327[_0x26d2('0x3f')]||0x4;this[_0x26d2('0x40')]=_0x215327[_0x26d2('0x40')]?_0x215327['Trunk']:undefined;this[_0x26d2('0x41')]=_0x215327['TrunkBackup']?_0x215327[_0x26d2('0x41')]:undefined;this['dialPrefix']=_0x215327[_0x26d2('0x42')]||undefined;this[_0x26d2('0x43')]=_0x215327['Interval']?_0x215327[_0x26d2('0x43')]:undefined;this[_0x26d2('0x44')]=_0x215327[_0x26d2('0x44')]||_0x26d2('0x45');this[_0x26d2('0x46')]=_0x215327[_0x26d2('0x46')]||undefined;this['dialCutDigit']=_0x215327['dialCutDigit']||undefined;this[_0x26d2('0x47')]=strategy[_0x215327[_0x26d2('0x47')]]||_0x26d2('0xb');this[_0x26d2('0x48')]=!![];this['dialAMDActive']=_0x215327[_0x26d2('0x49')]||![];this[_0x26d2('0x4a')]=_0x215327[_0x26d2('0x4a')];this['dialAMDGreeting']=_0x215327['dialAMDGreeting'];this[_0x26d2('0x4b')]=_0x215327['dialAMDAfterGreetingSilence'];this[_0x26d2('0x4c')]=_0x215327[_0x26d2('0x4c')];this[_0x26d2('0x4d')]=_0x215327[_0x26d2('0x4d')];this[_0x26d2('0x4e')]=_0x215327[_0x26d2('0x4e')];this[_0x26d2('0x4f')]=_0x215327[_0x26d2('0x4f')];this['dialAMDSilenceThreshold']=_0x215327[_0x26d2('0x50')];this[_0x26d2('0x51')]=_0x215327['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x215327['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x26d2('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x26d2('0x53')]=0x0;this[_0x26d2('0x54')]=0x0;this[_0x26d2('0x55')]=0x0;this[_0x26d2('0x56')]=0x0;this[_0x26d2('0x57')]=0x0;this[_0x26d2('0x58')]=0x0;this[_0x26d2('0x59')]=0x0;this[_0x26d2('0x5a')]=0x0;this[_0x26d2('0x5b')]=0x0;this[_0x26d2('0x5c')]=0x0;this[_0x26d2('0x5d')]=0x0;this[_0x26d2('0x5e')]=undefined;this[_0x26d2('0x5f')]=undefined;this[_0x26d2('0x60')]=undefined;this[_0x26d2('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x26d2('0x62')]=0x0;this[_0x26d2('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x26d2('0x64')]=0x0;this[_0x26d2('0x65')]=0x0;this[_0x26d2('0x66')]=0x0;this[_0x26d2('0x67')]=0x0;this['predictiveIntervalMaxThreshold']=_0x215327[_0x26d2('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x215327['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x26d2('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x26d2('0x6a')]=0x0;this[_0x26d2('0x6b')]=0x0;this[_0x26d2('0x6c')]=0x0;this[_0x26d2('0x6d')]=0x0;this[_0x26d2('0x6e')]=_0x215327[_0x26d2('0x6e')]||0x1e;this['dialRecallInQueue']=_0x215327[_0x26d2('0x6f')]||![];this[_0x26d2('0x70')]=!!_0x215327['dialPreviewAutoRecallMe']||![];this[_0x26d2('0x71')]=_0x215327[_0x26d2('0x71')]||undefined;this[_0x26d2('0x72')]=_0x215327[_0x26d2('0x72')]||![];this[_0x26d2('0x73')]=_0x215327['dialAgiAfterHangupAgent']||![];this[_0x26d2('0xe')]=monitorFormat[_0x215327['monitor_format']]?monitorFormat[_0x215327['monitor_format']]:undefined;this[_0x26d2('0x74')]=_0x215327[_0x26d2('0x74')]||![];this[_0x26d2('0x75')]=_0x215327[_0x26d2('0x75')]?_0x215327[_0x26d2('0x75')]:undefined;}module[_0x26d2('0x76')]=VoiceQueue; \ No newline at end of file +var _0x7a48=['acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumBillable','abandoned','loggedIn','acw'];(function(_0x153da4,_0x440e40){var _0x59193a=function(_0x3c890b){while(--_0x3c890b){_0x153da4['push'](_0x153da4['shift']());}};_0x59193a(++_0x440e40);}(_0x7a48,0xcc));var _0x87a4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7a48[_0x2c91e9];return _0x13f0ff;};'use strict';var statusDesc=[_0x87a4('0x0'),_0x87a4('0x1'),_0x87a4('0x2'),_0x87a4('0x3'),'invalid','unavailable',_0x87a4('0x4'),_0x87a4('0x5'),_0x87a4('0x6')];var monitorFormat={'wav':'wav','wav49':_0x87a4('0x7'),'gsm':_0x87a4('0x8')};var strategy={'rrmemory':_0x87a4('0x9'),'roundrobin':_0x87a4('0xa')};function VoiceQueue(_0x1e1c7c){this['id']=_0x1e1c7c['id']||0x0;this['name']=_0x1e1c7c['name']||'';this[_0x87a4('0xb')]=_0x1e1c7c['monitor_format']||'';this[_0x87a4('0xc')]=_0x1e1c7c[_0x87a4('0xc')]||_0x87a4('0xd');this[_0x87a4('0xe')]=0x0;this['talking']=0x0;this[_0x87a4('0xf')]=0x0;this[_0x87a4('0x10')]=0x0;this[_0x87a4('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x87a4('0x12')]=0x0;this['unmanaged']=0x0;this[_0x87a4('0x13')]=0x0;this[_0x87a4('0x14')]=0x0;this['available']=0x0;this[_0x87a4('0x15')]=_0x1e1c7c['acw']||![];this[_0x87a4('0x16')]=_0x1e1c7c['acwTimeout']||0xa;this[_0x87a4('0x17')]=_0x1e1c7c['autopause']||'no';this[_0x87a4('0x18')]=!![];this[_0x87a4('0x19')]='';this[_0x87a4('0x1a')]=0x0;this[_0x87a4('0x1b')]=0x0;this[_0x87a4('0x1c')]=_0x1e1c7c['dialTimezone']||null;this[_0x87a4('0x1d')]=_0x1e1c7c['dialGlobalInterval']?_0x1e1c7c['dialGlobalInterval']:null;this[_0x87a4('0x1e')]=_0x1e1c7c[_0x87a4('0x1e')];this['dialMethod']=_0x1e1c7c[_0x87a4('0x1f')]||_0x87a4('0x20');this[_0x87a4('0x21')]=_0x1e1c7c['dialLimitChannel']||0x0;this[_0x87a4('0x22')]=_0x1e1c7c[_0x87a4('0x22')]||0x0;this[_0x87a4('0x23')]=_0x1e1c7c[_0x87a4('0x23')]||0x1;this['dialPredictiveOptimization']=_0x1e1c7c[_0x87a4('0x24')]||_0x87a4('0x25');this[_0x87a4('0x26')]=_0x1e1c7c[_0x87a4('0x26')]||0.03;this[_0x87a4('0x27')]=_0x1e1c7c['dialPredictiveInterval']||0x258;this[_0x87a4('0x28')]=_0x1e1c7c[_0x87a4('0x28')]||'anonymous';this[_0x87a4('0x29')]=_0x1e1c7c[_0x87a4('0x29')]||_0x87a4('0x2a');this[_0x87a4('0x2b')]=_0x1e1c7c[_0x87a4('0x2b')]||0x1e;this[_0x87a4('0x2c')]=_0x1e1c7c['dialQueueOptions']||'tTxX';this[_0x87a4('0x2d')]=_0x1e1c7c[_0x87a4('0x2d')]||0x3;this[_0x87a4('0x2e')]=_0x1e1c7c[_0x87a4('0x2e')]||undefined;this[_0x87a4('0x2f')]=_0x1e1c7c[_0x87a4('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x1e1c7c[_0x87a4('0x30')]||0x96;this['dialBusyMaxRetry']=_0x1e1c7c[_0x87a4('0x31')]||0x3;this[_0x87a4('0x32')]=_0x1e1c7c[_0x87a4('0x32')]||0x96;this[_0x87a4('0x33')]=_0x1e1c7c[_0x87a4('0x33')]||0x3;this[_0x87a4('0x34')]=_0x1e1c7c[_0x87a4('0x34')]||0x96;this[_0x87a4('0x35')]=_0x1e1c7c[_0x87a4('0x35')]||0x3;this[_0x87a4('0x36')]=_0x1e1c7c['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x1e1c7c['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x1e1c7c[_0x87a4('0x37')]||0x96;this[_0x87a4('0x38')]=_0x1e1c7c['dialAbandonedMaxRetry']||0x3;this[_0x87a4('0x39')]=_0x1e1c7c[_0x87a4('0x39')]||0x96;this['dialMachineMaxRetry']=_0x1e1c7c[_0x87a4('0x3a')]||0x3;this[_0x87a4('0x3b')]=_0x1e1c7c[_0x87a4('0x3b')]||0x96;this[_0x87a4('0x3c')]=_0x1e1c7c['dialAgentRejectMaxRetry']||0x3;this[_0x87a4('0x3d')]=_0x1e1c7c['dialAgentRejectRetryFrequency']||0x96;this[_0x87a4('0x3e')]=_0x1e1c7c[_0x87a4('0x3e')]||0x4;this['Trunk']=_0x1e1c7c[_0x87a4('0x3f')]?_0x1e1c7c[_0x87a4('0x3f')]:undefined;this[_0x87a4('0x40')]=_0x1e1c7c[_0x87a4('0x40')]?_0x1e1c7c[_0x87a4('0x40')]:undefined;this['dialPrefix']=_0x1e1c7c[_0x87a4('0x41')]||undefined;this[_0x87a4('0x42')]=_0x1e1c7c[_0x87a4('0x42')]?_0x1e1c7c['Interval']:undefined;this[_0x87a4('0x43')]=_0x1e1c7c[_0x87a4('0x43')]||_0x87a4('0x44');this[_0x87a4('0x45')]=_0x1e1c7c[_0x87a4('0x45')]||undefined;this[_0x87a4('0x46')]=_0x1e1c7c[_0x87a4('0x46')]||undefined;this[_0x87a4('0x47')]=strategy[_0x1e1c7c[_0x87a4('0x47')]]||_0x87a4('0x9');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x1e1c7c[_0x87a4('0x48')]||![];this[_0x87a4('0x49')]=_0x1e1c7c[_0x87a4('0x49')];this[_0x87a4('0x4a')]=_0x1e1c7c[_0x87a4('0x4a')];this['dialAMDAfterGreetingSilence']=_0x1e1c7c[_0x87a4('0x4b')];this[_0x87a4('0x4c')]=_0x1e1c7c['dialAMDTotalAnalysisTime'];this[_0x87a4('0x4d')]=_0x1e1c7c[_0x87a4('0x4d')];this[_0x87a4('0x4e')]=_0x1e1c7c['dialAMDBetweenWordsSilence'];this[_0x87a4('0x4f')]=_0x1e1c7c[_0x87a4('0x4f')];this[_0x87a4('0x50')]=_0x1e1c7c[_0x87a4('0x50')];this[_0x87a4('0x51')]=_0x1e1c7c[_0x87a4('0x51')];this['outboundRejectCallsDay']=0x0;this[_0x87a4('0x52')]=0x0;this[_0x87a4('0x53')]=_0x1e1c7c[_0x87a4('0x53')];this['outboundAnswerCallsDay']=0x0;this[_0x87a4('0x54')]=0x0;this[_0x87a4('0x55')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x87a4('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x87a4('0x57')]=0x0;this[_0x87a4('0x58')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x87a4('0x59')]=0x0;this[_0x87a4('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x87a4('0x5b')]=0x0;this[_0x87a4('0x5c')]=0x0;this['startProgressive']=undefined;this[_0x87a4('0x5d')]=undefined;this['handlePredictive']=undefined;this[_0x87a4('0x5e')]=1.05;this[_0x87a4('0x5f')]=0x0;this[_0x87a4('0x60')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x87a4('0x61')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x1e1c7c[_0x87a4('0x62')]||0x14;this[_0x87a4('0x63')]=_0x1e1c7c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x87a4('0x64')]=0x0;this[_0x87a4('0x65')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x87a4('0x66')]=0x0;this[_0x87a4('0x67')]=0x0;this[_0x87a4('0x68')]=_0x1e1c7c[_0x87a4('0x68')]||0x1e;this['dialRecallInQueue']=_0x1e1c7c[_0x87a4('0x69')]||![];this[_0x87a4('0x6a')]=!!_0x1e1c7c[_0x87a4('0x6a')]||![];this[_0x87a4('0x6b')]=_0x1e1c7c['dialQueueProject2']||undefined;this[_0x87a4('0x6c')]=_0x1e1c7c[_0x87a4('0x6c')]||![];this['dialAgiAfterHangupAgent']=_0x1e1c7c[_0x87a4('0x6d')]||![];this['monitor_format']=monitorFormat[_0x1e1c7c[_0x87a4('0xb')]]?monitorFormat[_0x1e1c7c['monitor_format']]:undefined;this[_0x87a4('0x6e')]=_0x1e1c7c[_0x87a4('0x6e')]||![];this[_0x87a4('0x6f')]=_0x1e1c7c[_0x87a4('0x6f')]?_0x1e1c7c['mandatoryDispositionPause']:undefined;}module[_0x87a4('0x70')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 264936a..50b1ade 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45eb=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5b4410,_0x3c531f){var _0x5518b2=function(_0x10fec5){while(--_0x10fec5){_0x5b4410['push'](_0x5b4410['shift']());}};_0x5518b2(++_0x3c531f);}(_0x45eb,0x10f));var _0xb45e=function(_0x26d326,_0x33b11f){_0x26d326=_0x26d326-0x0;var _0x3345f6=_0x45eb[_0x26d326];return _0x3345f6;};'use strict';function VtigerAccount(_0x2af3bb){this['id']=_0x2af3bb['id']||0x0;this[_0xb45e('0x0')]=_0x2af3bb[_0xb45e('0x0')]||'';this[_0xb45e('0x1')]=_0x2af3bb[_0xb45e('0x1')]||'';this['accessKey']=_0x2af3bb[_0xb45e('0x2')]||'';this[_0xb45e('0x3')]=_0x2af3bb[_0xb45e('0x3')]||'';this[_0xb45e('0x4')]=_0x2af3bb[_0xb45e('0x4')]||'';this[_0xb45e('0x5')]=_0x2af3bb['Configurations']||{};}module[_0xb45e('0x6')]=VtigerAccount; \ No newline at end of file +var _0xc5b0=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc5b0,0x173));var _0x0c5b=function(_0x47dc3b,_0x1f5ddd){_0x47dc3b=_0x47dc3b-0x0;var _0x47907e=_0xc5b0[_0x47dc3b];return _0x47907e;};'use strict';function VtigerAccount(_0x10d1d5){this['id']=_0x10d1d5['id']||0x0;this[_0x0c5b('0x0')]=_0x10d1d5[_0x0c5b('0x0')]||'';this['username']=_0x10d1d5[_0x0c5b('0x1')]||'';this[_0x0c5b('0x2')]=_0x10d1d5[_0x0c5b('0x2')]||'';this[_0x0c5b('0x3')]=_0x10d1d5[_0x0c5b('0x3')]||'';this[_0x0c5b('0x4')]=_0x10d1d5[_0x0c5b('0x4')]||'';this[_0x0c5b('0x5')]=_0x10d1d5[_0x0c5b('0x5')]||{};}module[_0x0c5b('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9aea46f..dcfcb69 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7506=['Configurations','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3bda63,_0x31773c){var _0x4f1017=function(_0x28124e){while(--_0x28124e){_0x3bda63['push'](_0x3bda63['shift']());}};_0x4f1017(++_0x31773c);}(_0x7506,0x1f0));var _0x6750=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7506[_0x465028];return _0xb783d4;};'use strict';function ZendeskAccount(_0x4161d1){this['id']=_0x4161d1['id']||0x0;this[_0x6750('0x0')]=_0x4161d1[_0x6750('0x0')]||'';this[_0x6750('0x1')]=_0x4161d1[_0x6750('0x1')]||'';this[_0x6750('0x2')]=_0x4161d1['password']||'';this[_0x6750('0x3')]=_0x4161d1[_0x6750('0x3')]||'';this[_0x6750('0x4')]=_0x4161d1[_0x6750('0x4')]||'';this[_0x6750('0x5')]=_0x4161d1[_0x6750('0x5')]||'';this['type']=_0x4161d1['type']||_0x6750('0x6');this[_0x6750('0x7')]=_0x4161d1['serverUrl']||'';this[_0x6750('0x8')]=_0x4161d1['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x4c7b=['username','password','token','remoteUri','authType','type','integrationTab','exports','name'];(function(_0x5bf703,_0x955742){var _0x5946d3=function(_0x40b129){while(--_0x40b129){_0x5bf703['push'](_0x5bf703['shift']());}};_0x5946d3(++_0x955742);}(_0x4c7b,0x18b));var _0xb4c7=function(_0x2ce484,_0x29b88f){_0x2ce484=_0x2ce484-0x0;var _0x101707=_0x4c7b[_0x2ce484];return _0x101707;};'use strict';function ZendeskAccount(_0x2c12b6){this['id']=_0x2c12b6['id']||0x0;this['name']=_0x2c12b6[_0xb4c7('0x0')]||'';this[_0xb4c7('0x1')]=_0x2c12b6[_0xb4c7('0x1')]||'';this[_0xb4c7('0x2')]=_0x2c12b6[_0xb4c7('0x2')]||'';this['token']=_0x2c12b6[_0xb4c7('0x3')]||'';this[_0xb4c7('0x4')]=_0x2c12b6[_0xb4c7('0x4')]||'';this[_0xb4c7('0x5')]=_0x2c12b6[_0xb4c7('0x5')]||'';this[_0xb4c7('0x6')]=_0x2c12b6['type']||_0xb4c7('0x7');this['serverUrl']=_0x2c12b6['serverUrl']||'';this['Configurations']=_0x2c12b6['Configurations']||{};}module[_0xb4c7('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 85e0e5d..3a353a2 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbed6=['host','zone','clientId','clientSecret','code','refreshToken','description'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbed6,0x7d));var _0x6bed=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xbed6[_0x2b10c6];return _0x3789d2;};'use strict';function ZohoAccount(_0x49632e){this['id']=_0x49632e['id']||0x0;this['name']=_0x49632e['name']||'';this['description']=_0x49632e[_0x6bed('0x0')]||'';this['host']=_0x49632e[_0x6bed('0x1')]||'';this[_0x6bed('0x2')]=_0x49632e[_0x6bed('0x2')]||'';this[_0x6bed('0x3')]=_0x49632e['clientId']||'';this[_0x6bed('0x4')]=_0x49632e[_0x6bed('0x4')]||'';this['serverUrl']=_0x49632e['serverUrl']||'';this[_0x6bed('0x5')]=_0x49632e['code']||'';this[_0x6bed('0x6')]=_0x49632e['refreshToken']||'';this['Configurations']=_0x49632e['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x7421=['name','description','host','zone','serverUrl','code','refreshToken'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7421,0x1dc));var _0x1742=function(_0xef0e5f,_0x4b665b){_0xef0e5f=_0xef0e5f-0x0;var _0x236228=_0x7421[_0xef0e5f];return _0x236228;};'use strict';function ZohoAccount(_0x456474){this['id']=_0x456474['id']||0x0;this[_0x1742('0x0')]=_0x456474[_0x1742('0x0')]||'';this[_0x1742('0x1')]=_0x456474[_0x1742('0x1')]||'';this[_0x1742('0x2')]=_0x456474[_0x1742('0x2')]||'';this[_0x1742('0x3')]=_0x456474['zone']||'';this['clientId']=_0x456474['clientId']||'';this['clientSecret']=_0x456474['clientSecret']||'';this['serverUrl']=_0x456474[_0x1742('0x4')]||'';this[_0x1742('0x5')]=_0x456474[_0x1742('0x5')]||'';this[_0x1742('0x6')]=_0x456474['refreshToken']||'';this['Configurations']=_0x456474['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 8a473ae..030a86a 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6281=['Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','membername','Agent','channelAgent','format','calleridname','phone'];(function(_0x4469e9,_0x482c3c){var _0x5809f8=function(_0x1f94bb){while(--_0x1f94bb){_0x4469e9['push'](_0x4469e9['shift']());}};_0x5809f8(++_0x482c3c);}(_0x6281,0x73));var _0x1628=function(_0x4839eb,_0x40fb9c){_0x4839eb=_0x4839eb-0x0;var _0x2f5908=_0x6281[_0x4839eb];return _0x2f5908;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x436a11,_0x2b12f9,_0x138e83){var _0x334955='';if(!_[_0x1628('0x0')](_0x2b12f9)&&_0x1628('0x1')===typeof _0x2b12f9){_0x334955+=_0x2b12f9;}if(!_[_0x1628('0x0')](_0x138e83)&&_0x1628('0x1')===typeof _0x138e83){_0x334955+='\x20'+_0x138e83;}if(_0x334955!==''){return _0x334955;}return _0x436a11;}function Action(_0x23fbf4,_0xf78bcf,_0x41d04b,_0x37169d,_0x21dcb4){this[_0x1628('0x2')]=_0x41d04b||undefined;this[_0x1628('0x3')]=_0x23fbf4['id'];this['queue']=_0xf78bcf[_0x1628('0x4')];this[_0x1628('0x5')]=_0xf78bcf[_0x1628('0x5')];this[_0x1628('0x6')]=_0x1628('0x7');this['dialAnswer']=![];this[_0x1628('0x8')]=_[_0x1628('0x0')](_0x23fbf4[_0x1628('0x9')])?undefined:_0x23fbf4['Agent']['name'];this[_0x1628('0xa')]=this[_0x1628('0x8')]?util[_0x1628('0xb')]('SIP/%s',this[_0x1628('0x8')]):_0x37169d||undefined;this[_0x1628('0xc')]=checkNameSurname(_0x23fbf4['Contact'][_0x1628('0xd')],_0x23fbf4[_0x1628('0xe')][_0x1628('0xf')],_0x23fbf4[_0x1628('0xe')][_0x1628('0x10')]);this[_0x1628('0x11')]=_0x23fbf4[_0x1628('0x11')]||![];this[_0x1628('0x12')]=_0x23fbf4['Contact'][_0x1628('0xd')];this['scheduledat']=_0x23fbf4[_0x1628('0x13')];this['countbusyretry']=_0x23fbf4[_0x1628('0x14')]||0x0;this['countcongestionretry']=_0x23fbf4['countcongestionretry']||0x0;this[_0x1628('0x15')]=_0x23fbf4[_0x1628('0x15')]||0x0;this[_0x1628('0x16')]=(_0x23fbf4[_0x1628('0x14')]||0x0)+(_0x23fbf4[_0x1628('0x17')]||0x0)+(_0x23fbf4[_0x1628('0x15')]||0x0)+(_0x23fbf4['countnosuchnumberretry']||0x0)+(_0x23fbf4[_0x1628('0x18')]||0x0)+(_0x23fbf4[_0x1628('0x19')]||0x0)+(_0x23fbf4['countmachineretry']||0x0)+(_0x23fbf4['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x23fbf4[_0x1628('0x1a')]||0x0;this[_0x1628('0x18')]=_0x23fbf4[_0x1628('0x18')]||0x0;this[_0x1628('0x19')]=_0x23fbf4[_0x1628('0x19')]||0x0;this[_0x1628('0x1b')]=_0x23fbf4[_0x1628('0x1b')]||0x0;this[_0x1628('0x1c')]=_0x23fbf4['countagentrejectretry']||0x0;this[_0x1628('0x1d')]=_0x23fbf4[_0x1628('0x1d')];this[_0x1628('0x1e')]=_0x23fbf4[_0x1628('0x1e')];this[_0x1628('0x1f')]=_0x23fbf4[_0x1628('0x1f')];this[_0x1628('0x20')]=_0x23fbf4['recallme'];this[_0x1628('0x21')]=_0x23fbf4[_0x1628('0x21')];this['ListId']=_0x23fbf4[_0x1628('0x22')];this['UserId']=_[_0x1628('0x0')](_0x23fbf4['Agent'])?_0x23fbf4[_0x1628('0x23')]:_0x23fbf4[_0x1628('0x9')]['id'];this['VoiceQueueId']=_0x23fbf4['VoiceQueueId'];this[_0x1628('0x24')]='';this[_0x1628('0x25')]='';}Action[_0x1628('0x26')][_0x1628('0x27')]=function(){return util[_0x1628('0xb')](_0x1628('0x28'),this[_0x1628('0xc')],this[_0x1628('0x29')]);};module[_0x1628('0x2a')]=Action; \ No newline at end of file +var _0xe830=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x5210a2,_0x4f5288){var _0x597bd9=function(_0x3cadb0){while(--_0x3cadb0){_0x5210a2['push'](_0x5210a2['shift']());}};_0x597bd9(++_0x4f5288);}(_0xe830,0x195));var _0x0e83=function(_0x30ec24,_0x174b12){_0x30ec24=_0x30ec24-0x0;var _0x593318=_0xe830[_0x30ec24];return _0x593318;};'use strict';var util=require(_0x0e83('0x0'));var _=require(_0x0e83('0x1'));var moment=require('moment');function checkNameSurname(_0x3bf672,_0x2876b3,_0x430e1b){var _0x5f5760='';if(!_[_0x0e83('0x2')](_0x2876b3)&&'string'===typeof _0x2876b3){_0x5f5760+=_0x2876b3;}if(!_['isNil'](_0x430e1b)&&_0x0e83('0x3')===typeof _0x430e1b){_0x5f5760+='\x20'+_0x430e1b;}if(_0x5f5760!==''){return _0x5f5760;}return _0x3bf672;}function Action(_0x38762d,_0x171ac9,_0x5a69c2,_0x1737d2,_0x382f48){this[_0x0e83('0x4')]=_0x5a69c2||undefined;this[_0x0e83('0x5')]=_0x38762d['id'];this[_0x0e83('0x6')]=_0x171ac9['name'];this['type']=_0x171ac9[_0x0e83('0x7')];this[_0x0e83('0x8')]='queue';this[_0x0e83('0x9')]=![];this[_0x0e83('0xa')]=_[_0x0e83('0x2')](_0x38762d[_0x0e83('0xb')])?undefined:_0x38762d[_0x0e83('0xb')]['name'];this[_0x0e83('0xc')]=this[_0x0e83('0xa')]?util[_0x0e83('0xd')]('SIP/%s',this[_0x0e83('0xa')]):_0x1737d2||undefined;this[_0x0e83('0xe')]=checkNameSurname(_0x38762d[_0x0e83('0xf')][_0x0e83('0x10')],_0x38762d[_0x0e83('0xf')]['firstName'],_0x38762d[_0x0e83('0xf')][_0x0e83('0x11')]);this[_0x0e83('0x12')]=_0x38762d['active']||![];this[_0x0e83('0x13')]=_0x38762d[_0x0e83('0xf')][_0x0e83('0x10')];this[_0x0e83('0x14')]=_0x38762d[_0x0e83('0x14')];this[_0x0e83('0x15')]=_0x38762d['countbusyretry']||0x0;this['countcongestionretry']=_0x38762d[_0x0e83('0x16')]||0x0;this[_0x0e83('0x17')]=_0x38762d[_0x0e83('0x17')]||0x0;this[_0x0e83('0x18')]=(_0x38762d[_0x0e83('0x15')]||0x0)+(_0x38762d['countcongestionretry']||0x0)+(_0x38762d[_0x0e83('0x17')]||0x0)+(_0x38762d['countnosuchnumberretry']||0x0)+(_0x38762d[_0x0e83('0x19')]||0x0)+(_0x38762d[_0x0e83('0x1a')]||0x0)+(_0x38762d[_0x0e83('0x1b')]||0x0)+(_0x38762d[_0x0e83('0x1c')]||0x0);this[_0x0e83('0x1d')]=_0x38762d[_0x0e83('0x1d')]||0x0;this[_0x0e83('0x19')]=_0x38762d['countdropretry']||0x0;this[_0x0e83('0x1a')]=_0x38762d['countabandonedretry']||0x0;this[_0x0e83('0x1b')]=_0x38762d[_0x0e83('0x1b')]||0x0;this[_0x0e83('0x1c')]=_0x38762d[_0x0e83('0x1c')]||0x0;this[_0x0e83('0x1e')]=_0x38762d[_0x0e83('0x1e')];this[_0x0e83('0x1f')]=_0x38762d[_0x0e83('0x1f')];this[_0x0e83('0x20')]=_0x38762d['callbackat'];this[_0x0e83('0x21')]=_0x38762d[_0x0e83('0x21')];this[_0x0e83('0x22')]=_0x38762d['ContactId'];this[_0x0e83('0x23')]=_0x38762d[_0x0e83('0x23')];this[_0x0e83('0x24')]=_['isNil'](_0x38762d['Agent'])?_0x38762d[_0x0e83('0x24')]:_0x38762d['Agent']['id'];this[_0x0e83('0x25')]=_0x38762d['VoiceQueueId'];this[_0x0e83('0x26')]='';this[_0x0e83('0x27')]='';}Action[_0x0e83('0x28')]['getCaller']=function(){return util['format'](_0x0e83('0x29'),this[_0x0e83('0xe')],this[_0x0e83('0x2a')]);};module[_0x0e83('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 946fe1f..632209d 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee14=['syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','enqueue','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','Action','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','Agent','voicePause','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','logger2','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','total','answered','decrementTalkink','[16]','Answer','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','\x20Queue','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','dialGlobalMaxRetry','[callProgressDetectingCustomer][logAgentReject]','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','execRun','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','channel','clone','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','error','inspect','transfertargetlinkedid','transfererlinkedid','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./action','./util/util','redis','defaults','localhost','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee14,0x13a));var _0x4ee1=function(_0x178219,_0x28a60d){_0x178219=_0x178219-0x0;var _0x2453db=_0xee14[_0x178219];return _0x2453db;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x4ee1('0x0'));var uuid=require(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var md5=require(_0x4ee1('0x3'));var Redis=require(_0x4ee1('0x4'));var config=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var loggerAction=require(_0x4ee1('0x6'))('actionPreview');var ami=require(_0x4ee1('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x4ee1('0x9'));var ut=require(_0x4ee1('0xa'));config[_0x4ee1('0xb')]=_[_0x4ee1('0xc')](config[_0x4ee1('0xb')],{'host':_0x4ee1('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4ee1('0xb')]));var Sequence=function(){};Sequence[_0x4ee1('0xe')]['enqueue']=function(_0x3fa61b){this[_0x4ee1('0xf')]=this[_0x4ee1('0xf')]?this[_0x4ee1('0xf')]['finally'](_0x3fa61b):_0x3fa61b();};function Preview(_0x1b3737){this[_0x4ee1('0x10')]=new Sequence();this[_0x4ee1('0x11')]=_0x1b3737[_0x4ee1('0x12')];this[_0x4ee1('0x13')]=_0x1b3737[_0x4ee1('0x13')];this['actions']={};this[_0x4ee1('0x14')]=_0x1b3737[_0x4ee1('0x14')];this[_0x4ee1('0x15')]=0x0;ami['on'](_0x4ee1('0x16'),this[_0x4ee1('0x17')][_0x4ee1('0x18')](this));ami['on'](_0x4ee1('0x19'),this[_0x4ee1('0x1a')][_0x4ee1('0x18')](this));ami['on']('hanguprequest',this[_0x4ee1('0x1b')][_0x4ee1('0x18')](this));ami['on'](_0x4ee1('0x1c'),this[_0x4ee1('0x1d')][_0x4ee1('0x18')](this));ami['on'](_0x4ee1('0x1e'),this[_0x4ee1('0x1f')][_0x4ee1('0x18')](this));ami['on'](_0x4ee1('0x20'),this[_0x4ee1('0x21')][_0x4ee1('0x18')](this));ami['on']('attendedtransfer',this[_0x4ee1('0x22')][_0x4ee1('0x18')](this));ami['on'](_0x4ee1('0x23'),this[_0x4ee1('0x24')][_0x4ee1('0x18')](this));this[_0x4ee1('0x25')](this['campaignsPreview']);}function emit(_0x8a631f,_0x333e96,_0x46611a){io['to'](_0x8a631f)[_0x4ee1('0x26')](_0x333e96,_0x46611a);}function emitCampaignPreview(_0x160a26){if(_0x160a26[_0x4ee1('0x27')]===_0x4ee1('0x28')){var _0x40fd98={'id':_0x160a26['id'],'name':_0x160a26[_0x4ee1('0x29')],'strategy':_0x160a26[_0x4ee1('0x2a')],'answered':_0x160a26['answered'],'available':_0x160a26['available'],'loggedIn':_0x160a26[_0x4ee1('0x2b')],'pTalking':_0x160a26[_0x4ee1('0x2c')],'sumBillable':_0x160a26[_0x4ee1('0x2d')],'sumDuration':_0x160a26[_0x4ee1('0x2e')],'sumHoldTime':_0x160a26[_0x4ee1('0x2f')]||0x0,'talking':_0x160a26[_0x4ee1('0x30')],'total':_0x160a26['total'],'type':_0x160a26['type'],'unmanaged':_0x160a26[_0x4ee1('0x31')],'abandoned':_0x160a26[_0x4ee1('0x32')],'waiting':_0x160a26['waiting'],'loggedInDb':_0x160a26[_0x4ee1('0x33')],'dialActive':_0x160a26[_0x4ee1('0x34')],'dialMethod':_0x160a26[_0x4ee1('0x35')],'dialOriginateCallerIdName':_0x160a26[_0x4ee1('0x36')],'dialOriginateCallerIdNumber':_0x160a26[_0x4ee1('0x37')],'dialOriginateTimeout':_0x160a26[_0x4ee1('0x38')],'dialPrefix':_0x160a26[_0x4ee1('0x39')],'outboundAnswerAgiCallsDay':_0x160a26['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x160a26[_0x4ee1('0x3a')],'outboundBlacklistCallsDay':_0x160a26['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x160a26[_0x4ee1('0x3b')],'outboundCongestionCallsDay':_0x160a26['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x160a26[_0x4ee1('0x3c')],'outboundDropCallsDayCallersExit':_0x160a26[_0x4ee1('0x3d')],'outboundDropCallsDayTimeout':_0x160a26[_0x4ee1('0x3e')],'outboundNoAnswerCallsDay':_0x160a26[_0x4ee1('0x3f')],'outboundNoSuchCallsDay':_0x160a26[_0x4ee1('0x40')],'outboundOriginateFailureCallsDay':_0x160a26['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x160a26[_0x4ee1('0x41')],'outboundRejectCallsDay':_0x160a26['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x160a26[_0x4ee1('0x42')],'outboundAbandonedCallsDay':_0x160a26[_0x4ee1('0x43')],'predictiveIntervalAnsweredCalls':_0x160a26[_0x4ee1('0x44')],'predictiveIntervalAvgHoldtime':_0x160a26[_0x4ee1('0x45')],'predictiveIntervalAvgTalktime':_0x160a26[_0x4ee1('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x160a26['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x160a26[_0x4ee1('0x47')],'predictiveIntervalErlangCalls':_0x160a26[_0x4ee1('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x160a26[_0x4ee1('0x49')],'predictiveIntervalHitRate':_0x160a26[_0x4ee1('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x160a26[_0x4ee1('0x4b')],'predictiveIntervalPauses':_0x160a26[_0x4ee1('0x4c')],'predictiveIntervalAvailable':_0x160a26['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x160a26['predictiveIntervalTotalCalls'],'message':_0x160a26[_0x4ee1('0x4d')],'originated':_0x160a26[_0x4ee1('0x4e')],'erlangCalls':_0x160a26[_0x4ee1('0x4f')],'erlangCallToSecond':_0x160a26['erlangCallToSecond'],'erlangAbandonmentRate':_0x160a26[_0x4ee1('0x50')],'erlangBusyFactor':_0x160a26[_0x4ee1('0x51')],'startPredictive':_0x160a26[_0x4ee1('0x52')],'startProgressive':_0x160a26[_0x4ee1('0x53')]};if(_0x160a26[_0x4ee1('0x54')]){_0x40fd98[_0x4ee1('0x54')]={'id':_0x160a26[_0x4ee1('0x54')]['id'],'name':_0x160a26[_0x4ee1('0x54')][_0x4ee1('0x29')],'active':_0x160a26[_0x4ee1('0x54')][_0x4ee1('0x55')],'callerid':_0x160a26[_0x4ee1('0x54')][_0x4ee1('0x56')]};}if(_0x160a26['Interval']){_0x40fd98[_0x4ee1('0x57')]={'id':_0x160a26[_0x4ee1('0x57')]['id'],'name':_0x160a26[_0x4ee1('0x57')]['name']};}var _0x4858f9=md5(JSON[_0x4ee1('0x58')](_0x40fd98));if(_0x160a26[_0x4ee1('0x3')]!==_0x4858f9){_0x160a26[_0x4ee1('0x3')]=_0x4858f9;emit(util[_0x4ee1('0x59')]('voice:queue:%s',_0x40fd98[_0x4ee1('0x29')]),_0x4ee1('0x5a'),_0x40fd98);}}}function emitVoiceQueueChannelRemove(_0x11721a){logger[_0x4ee1('0x5b')](_0x4ee1('0x5c'),JSON[_0x4ee1('0x58')](_0x11721a));emit(util[_0x4ee1('0x59')](_0x4ee1('0x5d'),_0x11721a['name']),_0x4ee1('0x5e'),_0x11721a);io[_0x4ee1('0x26')](_0x4ee1('0x5f'),_0x11721a);}function notSendMessagesQueue(_0x2950a9){if(_0x2950a9[_0x4ee1('0x60')]){if(_0x2950a9[_0x4ee1('0x4e')]===0x0&&_0x2950a9['pTalking']===0x0){_0x2950a9[_0x4ee1('0x60')]=![];_0x2950a9[_0x4ee1('0x61')]=0x0;_0x2950a9[_0x4ee1('0x62')]=0x0;_0x2950a9[_0x4ee1('0x4d')]=_0x4ee1('0x63');ut[_0x4ee1('0x64')](_0x4ee1('0x65'),_0x2950a9[_0x4ee1('0x29')]+_0x4ee1('0x66'));}else{_0x2950a9[_0x4ee1('0x4d')]=_0x4ee1('0x67');ut[_0x4ee1('0x64')](_0x4ee1('0x65'),_0x2950a9['name']+_0x4ee1('0x68'));}emitCampaignPreview(_0x2950a9);}}Preview[_0x4ee1('0xe')]['loopCampaigns']=function(){var _0x3c759f=this;setInterval(function(){_0x3c759f['syncCampaigns']();},0x7cf);};Preview[_0x4ee1('0xe')]['syncCampaigns']=function(){var _0x14c333=this[_0x4ee1('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x25d683 in _0x14c333){if(_0x14c333[_0x4ee1('0x69')](_0x25d683)&&(_0x14c333[_0x25d683][_0x4ee1('0x35')]===_0x4ee1('0x7')||_0x14c333[_0x25d683]['dialMethod']===_0x4ee1('0x6a'))&&_0x14c333[_0x25d683][_0x4ee1('0x27')]===_0x4ee1('0x28')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x4ee1('0x6b')]();}}if(_0x14c333[_0x4ee1('0x69')](_0x25d683)&&_0x14c333[_0x25d683][_0x4ee1('0x35')]===_0x4ee1('0x7')&&_0x14c333[_0x25d683][_0x4ee1('0x27')]==='outbound'){if(_0x14c333[_0x25d683]['dialActive']){this[_0x4ee1('0x6c')](_0x14c333[_0x25d683]);if(_0x14c333[_0x25d683][_0x4ee1('0x6d')])this[_0x4ee1('0x6e')](_0x14c333[_0x25d683]);}else{notSendMessagesQueue(_0x14c333[_0x25d683]);}}}};Preview[_0x4ee1('0xe')]['clearZombieChannel']=function(_0x3d6bf4){var _0x32cc34=this;this['sequence'][_0x4ee1('0x6f')](function(){if(!_[_0x4ee1('0x70')](_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4])){loggerAction[_0x4ee1('0x5b')](_0x4ee1('0x72'),_0x3d6bf4,_0x4ee1('0x73'),_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')],_0x4ee1('0x75'),JSON['stringify'](_0x32cc34['campaignsPreview'][_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]][_0x4ee1('0x4e')]),_0x4ee1('0x76'),JSON['stringify'](_0x32cc34[_0x4ee1('0x11')][_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]][_0x4ee1('0x2c')]),JSON[_0x4ee1('0x58')](_0x32cc34['actions'][_0x3d6bf4][_0x4ee1('0x77')]),JSON[_0x4ee1('0x58')](_[_0x4ee1('0x78')](_0x32cc34['actions'][_0x3d6bf4],[_0x4ee1('0x79'),'UserId',_0x4ee1('0x7a'),'ListId'])));return ami[_0x4ee1('0x7b')]({'action':'status','channel':_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4]['channel']})[_0x4ee1('0x7c')](function(_0x12e0f1){if(_0x12e0f1[_0x4ee1('0x4d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4]){ut[_0x4ee1('0x7d')](_0x32cc34[_0x4ee1('0x11')][_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]],_0x4ee1('0x7e'));if(_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4]['dialAnswer']===!![]){ut['decrementTalkink'](_0x32cc34[_0x4ee1('0x11')][_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]],_0x4ee1('0x7e'));ut[_0x4ee1('0x7f')](_0x4ee1('0x80')+_0x3d6bf4,_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]);}ut[_0x4ee1('0x7f')](_0x4ee1('0x81')+_0x3d6bf4,_0x32cc34[_0x4ee1('0x71')][_0x3d6bf4][_0x4ee1('0x74')]);delete _0x32cc34[_0x4ee1('0x71')][_0x3d6bf4];}},0x2328);}});}});};Preview['prototype'][_0x4ee1('0x6b')]=function(){var _0x547c6c=this;loggerAction[_0x4ee1('0x5b')](_0x4ee1('0x82'),_['size'](this[_0x4ee1('0x71')]));for(var _0x184e36 in this['actions']){if(_0x547c6c['actions'][_0x4ee1('0x69')](_0x184e36)){_0x547c6c['clearZombieChannel'](_0x184e36);}}};Preview[_0x4ee1('0xe')][_0x4ee1('0x6e')]=function(_0x59ba70){var _0x43489c=this;rpcDb[_0x4ee1('0x83')](_0x59ba70['id'],ut[_0x4ee1('0x84')](this[_0x4ee1('0x14')]))[_0x4ee1('0x85')](function(_0x433b9c){if(!_[_0x4ee1('0x70')](_0x433b9c)){for(var _0x5f5694=0x0;_0x5f5694<_0x433b9c['length'];_0x5f5694+=0x1){if(ut[_0x4ee1('0x86')](_0x433b9c[_0x5f5694][_0x4ee1('0x87')])<_0x59ba70['dialRecallMeTimeout']*0x3c){if(_0x433b9c[_0x5f5694][_0x4ee1('0x88')]&&!_0x433b9c[_0x5f5694][_0x4ee1('0x88')][_0x4ee1('0x89')]){_0x43489c['run'](_0x433b9c[_0x5f5694]['id'])[_0x4ee1('0x85')](ut['logger2'](_0x4ee1('0x8a')))['catch'](ut['logger2'](_0x4ee1('0x8a')));}else{rpcDb[_0x4ee1('0x8b')](_0x433b9c[_0x5f5694]['id']);}}else{var _0x290451=new Action(_0x433b9c[_0x5f5694],_0x59ba70);_0x290451[_0x4ee1('0x8c')]=moment()[_0x4ee1('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x59ba70[_0x4ee1('0x41')]+=0x1;ut[_0x4ee1('0x8d')](_0x290451,0x17,_0x4ee1('0x8e'));if(_0x59ba70['dialRecallInQueue']){rpcDb[_0x4ee1('0x8f')](ut[_0x4ee1('0x90')](_0x433b9c[_0x5f5694]));rpcDb[_0x4ee1('0x91')](_0x290451,_0x4ee1('0x92'));}else{ut[_0x4ee1('0x8d')](_0x290451,0x16,_0x4ee1('0x93'));rpcDb[_0x4ee1('0x91')](_0x290451,_0x4ee1('0x94'));rpcDb[_0x4ee1('0x95')](_0x290451,_0x4ee1('0x94'));}}}}})[_0x4ee1('0x7c')](ut[_0x4ee1('0x96')]('[getContactRecallMe]'));};Preview[_0x4ee1('0xe')]['setMessage']=function(_0x25cfc3){_0x25cfc3['sendMessageOneNotActive']=!![];if(ut[_0x4ee1('0x97')](_0x25cfc3[_0x4ee1('0x2b')])){_0x25cfc3[_0x4ee1('0x4d')]=_0x4ee1('0x98');}else if(!ut[_0x4ee1('0x99')](_0x25cfc3[_0x4ee1('0x34')])){_0x25cfc3[_0x4ee1('0x4d')]=_0x4ee1('0x63');}else if(!this[_0x4ee1('0x9a')](_0x25cfc3[_0x4ee1('0x54')])){if(!this[_0x4ee1('0x9a')](_0x25cfc3[_0x4ee1('0x9b')])){_0x25cfc3['message']=_0x4ee1('0x9c');}else{_0x25cfc3[_0x4ee1('0x4d')]=_0x4ee1('0x9d');}}else{_0x25cfc3['message']='ACTIVE';}emitCampaignPreview(_0x25cfc3);};Preview[_0x4ee1('0xe')][_0x4ee1('0x9e')]=function(_0x5ac164,_0x318e43,_0x431dfa){var _0x3f8f94=this;var _0x216925=this[_0x4ee1('0x71')][_0x318e43];var _0x1e6d5d=this[_0x4ee1('0x11')][_0x216925[_0x4ee1('0x74')]];var _0x28e11c;if(_0x1e6d5d){switch(_0x431dfa){case'1':_0x1e6d5d[_0x4ee1('0x40')]+=0x1;_0x216925['countnosuchnumberretry']+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut['logCustomer'](_0x216925,0x0,'NoSuchNumber');ami[_0x4ee1('0x26')](_0x4ee1('0xa1'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xa3')));rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xa4'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d['dialGlobalMaxRetry']){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,_0x4ee1('0xa6'));rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xa7'));}else{if(_0x216925[_0x4ee1('0xa8')]>=_0x1e6d5d['dialNoSuchNumberMaxRetry']){rpcDb[_0x4ee1('0x95')](_0x216925,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x4ee1('0xa9')](ut[_0x4ee1('0xaa')](_0x216925,'countnosuchnumberretry',_0x1e6d5d['dialNoSuchNumberRetryFrequency']),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}delete this['actions'][_0x5ac164[_0x4ee1('0xad')]];break;case'ANSWER':var _0x58dd6c=moment()[_0x4ee1('0x59')](_0x4ee1('0xae'));_0x216925[_0x4ee1('0xaf')]=_0x58dd6c;_0x216925[_0x4ee1('0xb0')]=_0x58dd6c;_0x216925[_0x4ee1('0x77')]=!![];_0x1e6d5d[_0x4ee1('0x2c')]+=0x1;logger['info'](_0x4ee1('0xb1'),_0x216925['uniqueid'],'\x20Queue',_0x1e6d5d[_0x4ee1('0x29')],_0x4ee1('0x76'),_0x1e6d5d[_0x4ee1('0x2c')]);ami[_0x4ee1('0x26')](_0x4ee1('0xb2'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xb3'),this[_0x4ee1('0x11')][_0x216925['queue']]));if(_0x1e6d5d[_0x4ee1('0xb4')]){ami[_0x4ee1('0x26')]('custom:agentConnectPreview',ut[_0x4ee1('0xb5')](_0x216925));}break;case'16':ami[_0x4ee1('0x26')](_0x4ee1('0xb6'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xb7'),this[_0x4ee1('0x11')][_0x216925[_0x4ee1('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x216925,_0x4ee1('0xb7')));_0x1e6d5d['outboundAnswerCallsDay']+=0x1;_0x1e6d5d[_0x4ee1('0xb8')]+=0x1;_0x1e6d5d[_0x4ee1('0xb9')]+=0x1;ut[_0x4ee1('0xba')](_0x1e6d5d,_0x4ee1('0xbb'));_0x216925['countglobal']=ut[_0x4ee1('0xa0')](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0x4,_0x4ee1('0xbc'));rpcDb['createCustomerHistory'](_0x216925,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x4ee1('0x95')](_0x216925,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x4ee1('0xbd')](_0x216925);_0x1e6d5d[_0x4ee1('0x2e')]+=_0x216925[_0x4ee1('0xbe')];_0x1e6d5d['sumBillable']+=_0x216925['talktime'];logger[_0x4ee1('0x5b')](_0x4ee1('0xbf'),_0x216925[_0x4ee1('0xc0')],_0x4ee1('0xc1'),_0x1e6d5d[_0x4ee1('0x29')],_0x4ee1('0x76'),_0x1e6d5d[_0x4ee1('0x2c')]);delete this['actions'][_0x5ac164['linkedid']];break;case'BUSY':_0x1e6d5d[_0x4ee1('0x3b')]+=0x1;_0x216925[_0x4ee1('0xc2')]+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut['logCustomer'](_0x216925,0x5,_0x4ee1('0xc3'));ami['emit'](_0x4ee1('0xc4'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xc5')));rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xc6'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d['dialGlobalMaxRetry']){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,_0x4ee1('0xa6'));rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xc7'));}else{if(_0x216925[_0x4ee1('0xc2')]>=_0x1e6d5d[_0x4ee1('0xc8')]){rpcDb[_0x4ee1('0x95')](_0x216925,_0x4ee1('0xc6'));}else{rpcDb[_0x4ee1('0xa9')](ut[_0x4ee1('0xaa')](_0x216925,_0x4ee1('0xc2'),_0x1e6d5d['dialBusyRetryFrequency']),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}break;case _0x4ee1('0xc9'):_0x1e6d5d[_0x4ee1('0x3f')]+=0x1;_0x216925[_0x4ee1('0xca')]+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0x3,_0x4ee1('0xcb'));ami[_0x4ee1('0x26')](_0x4ee1('0xcc'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xcd')));rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xce'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d['dialGlobalMaxRetry']){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,_0x4ee1('0xa6'));rpcDb['createCustomerFinal'](_0x28e11c,_0x4ee1('0xcf'));}else{if(_0x216925[_0x4ee1('0xca')]>=_0x1e6d5d['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x216925,_0x4ee1('0xce'));}else{rpcDb['rescheduleContact'](ut[_0x4ee1('0xaa')](_0x216925,_0x4ee1('0xca'),_0x1e6d5d['dialNoAnswerRetryFrequency']),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}break;case _0x4ee1('0xd0'):_0x1e6d5d[_0x4ee1('0xd1')]+=0x1;_0x216925['countcongestionretry']+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0x8,_0x4ee1('0xd2'));ami[_0x4ee1('0x26')](_0x4ee1('0xd3'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xd4')));rpcDb['createCustomerHistory'](_0x216925,_0x4ee1('0xd5'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d['dialGlobalMaxRetry']){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,'Global');rpcDb['createCustomerFinal'](_0x28e11c,_0x4ee1('0xd6'));}else{if(_0x216925[_0x4ee1('0xd7')]>=_0x1e6d5d[_0x4ee1('0xd8')]){rpcDb[_0x4ee1('0x95')](_0x216925,_0x4ee1('0xd5'));}else{rpcDb[_0x4ee1('0xa9')](ut['scheduledAt'](_0x216925,_0x4ee1('0xd7'),_0x1e6d5d[_0x4ee1('0xd9')]),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}break;case _0x4ee1('0xda'):_0x1e6d5d[_0x4ee1('0xdb')]+=0x1;_0x216925[_0x4ee1('0xdc')]+=0x1;_0x216925[_0x4ee1('0x9f')]=ut['totalGlobal'](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0x14,_0x4ee1('0xdd'));ami[_0x4ee1('0x26')](_0x4ee1('0xde'),ut[_0x4ee1('0xa2')](_0x216925,'agentreject'));rpcDb[_0x4ee1('0x91')](_0x216925,'[syncHangupRequest][logAgentReject]');if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d[_0x4ee1('0xdf')]){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0x14,_0x4ee1('0xdd'));rpcDb['createCustomerFinal'](_0x28e11c,_0x4ee1('0xe0'));}else{if(_0x216925[_0x4ee1('0xdc')]>=_0x1e6d5d['dialAgentRejectMaxRetry']){rpcDb[_0x4ee1('0x95')](_0x216925,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x4ee1('0xa9')](ut[_0x4ee1('0xaa')](_0x216925,'countagentrejectretry',_0x1e6d5d['dialAgentRejectRetryFrequency']),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}break;case'ABANDONED':_0x1e6d5d['outboundAbandonedCallsDay']+=0x1;_0x216925['countabandonedretry']+=0x1;_0x216925[_0x4ee1('0x9f')]=ut['totalGlobal'](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0xb,_0x4ee1('0xe1'));rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xe2'));if(ut['totalGlobal'](_0x216925)>=_0x1e6d5d[_0x4ee1('0xdf')]){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,'Global');rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xe2'));}else{if(_0x216925[_0x4ee1('0xe3')]>=_0x1e6d5d['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x216925,_0x4ee1('0xe2'));}else{rpcDb[_0x4ee1('0xa9')](ut[_0x4ee1('0xaa')](_0x216925,_0x4ee1('0xe4'),_0x1e6d5d[_0x4ee1('0xe5')]),_0x216925[_0x4ee1('0xab')],_0x216925[_0x4ee1('0xac')]);}}break;case'18':_0x1e6d5d[_0x4ee1('0x42')]+=0x1;_0x216925[_0x4ee1('0xe6')]+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0x12,_0x5ac164['cause-txt']||_0x5ac164[_0x4ee1('0xe7')]);ami[_0x4ee1('0x26')](_0x4ee1('0xe8'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xe9')));rpcDb[_0x4ee1('0x91')](_0x216925,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d['dialGlobalMaxRetry']){_0x28e11c=ut[_0x4ee1('0xa5')](_0x216925,0xf,'Global');rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xea'));}else{rpcDb[_0x4ee1('0x95')](_0x216925,_0x4ee1('0xea'));}delete this[_0x4ee1('0x71')][_0x5ac164[_0x4ee1('0xad')]];break;case'19':_0x1e6d5d[_0x4ee1('0x42')]+=0x1;_0x216925[_0x4ee1('0x9f')]=ut[_0x4ee1('0xa0')](_0x216925);ut['logCustomer'](_0x216925,0x13,_0x5ac164[_0x4ee1('0xeb')]||_0x5ac164[_0x4ee1('0xe7')]);ami['emit'](_0x4ee1('0xe8'),ut[_0x4ee1('0xa2')](_0x216925,_0x4ee1('0xe9')));rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xec'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d[_0x4ee1('0xdf')]){_0x28e11c=ut['cloneAction'](_0x216925,0xf,_0x4ee1('0xa6'));rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xec'));}else{rpcDb['createCustomerFinal'](_0x216925,_0x4ee1('0xec'));}delete this[_0x4ee1('0x71')][_0x5ac164[_0x4ee1('0xad')]];break;default:if(_0x216925['dialAnswer']){ut['decrementTalkink'](_0x1e6d5d,_0x4ee1('0xed'));ut['loggerError'](_0x4ee1('0xee')+_0x1e6d5d[_0x4ee1('0x29')],_0x5ac164);}_0x1e6d5d[_0x4ee1('0x42')]+=0x1;_0x216925['countglobal']=ut[_0x4ee1('0xa0')](_0x216925);ut[_0x4ee1('0x8d')](_0x216925,0xc,_0x5ac164[_0x4ee1('0xeb')]||_0x5ac164[_0x4ee1('0xe7')]);rpcDb[_0x4ee1('0x91')](_0x216925,_0x4ee1('0xef'));if(ut[_0x4ee1('0xa0')](_0x216925)>=_0x1e6d5d[_0x4ee1('0xdf')]){_0x28e11c=ut['cloneAction'](_0x216925,0xf,_0x4ee1('0xa6'));rpcDb[_0x4ee1('0x95')](_0x28e11c,_0x4ee1('0xf0'));}else{rpcDb[_0x4ee1('0x95')](_0x216925,_0x4ee1('0xf0'));}delete this[_0x4ee1('0x71')][_0x5ac164[_0x4ee1('0xad')]];}if(!(_0x216925['dialAnswer']&&_0x431dfa==='16')){ut[_0x4ee1('0x7d')](_0x1e6d5d,'[callProgressDetectingCustomer]');logger[_0x4ee1('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0x216925[_0x4ee1('0xc0')],_0x4ee1('0xc1'),_0x1e6d5d[_0x4ee1('0x29')],_0x4ee1('0x75'),_0x1e6d5d['originated']);}if(_0x431dfa!=='ANSWER'){delete this[_0x4ee1('0x71')][_0x5ac164[_0x4ee1('0xad')]];delete this['actions'][_0x5ac164[_0x4ee1('0xf1')]];}}};Preview[_0x4ee1('0xe')][_0x4ee1('0xf2')]=function(_0x51f937,_0x9ea41c,_0x2e2dad){if(_[_0x4ee1('0xf3')](_0x9ea41c)&&'object'!==typeof _0x9ea41c){return;}if(_[_0x4ee1('0xf3')](_0x2e2dad)&&'object'!==typeof _0x2e2dad){return;}switch(_0x2e2dad[_0x4ee1('0xf4')]){case'0':ut['logAgent'](_0x51f937,0x0,_0x4ee1('0xf5'));rpcDb[_0x4ee1('0xf6')](_0x51f937,_0x4ee1('0xf7'));break;case'3':ut[_0x4ee1('0xf8')](_0x51f937,0x3,_0x4ee1('0xcb'));rpcDb[_0x4ee1('0xf6')](_0x51f937,_0x4ee1('0xf9'));break;case'5':ut['logAgent'](_0x51f937,0x5,_0x4ee1('0xc3'));rpcDb[_0x4ee1('0xf6')](_0x51f937,_0x4ee1('0xfa'));break;case'8':ut[_0x4ee1('0xf8')](_0x51f937,0x8,_0x4ee1('0xd2'));rpcDb[_0x4ee1('0xf6')](_0x51f937,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x4ee1('0xf8')](_0x51f937,0x16,_0x4ee1('0xfb'));rpcDb['createAgentHistory'](_0x51f937,_0x4ee1('0xfc'));break;default:ut[_0x4ee1('0xf8')](_0x51f937,0xc,_0x2e2dad['reason']);rpcDb[_0x4ee1('0xf6')](_0x51f937,_0x4ee1('0xfd'));}ut[_0x4ee1('0x7d')](_0x9ea41c,_0x4ee1('0xfe'));logger[_0x4ee1('0x5b')](_0x4ee1('0xff'),_0x51f937[_0x4ee1('0xc0')],_0x4ee1('0xc1'),_0x9ea41c[_0x4ee1('0x29')],_0x4ee1('0x75'),_0x9ea41c[_0x4ee1('0x4e')]);delete this['actions'][_0x51f937[_0x4ee1('0xc0')]];};Preview[_0x4ee1('0xe')][_0x4ee1('0x100')]=function(_0x1fdf4c,_0x58da3b,_0x383e36,_0x38595b,_0x15374f){var _0x733d26=this;return new BPromise(function(_0x29d7e0,_0x205189){if(_[_0x4ee1('0x70')](_0x58da3b)||_[_0x4ee1('0x70')](_0x58da3b[_0x4ee1('0x101')])||_[_0x4ee1('0x70')](_0x58da3b['Contact'][_0x4ee1('0x102')])||_['isNil'](_0x58da3b[_0x4ee1('0x7a')])){_0x205189(ut[_0x4ee1('0x4d')](_0x4ee1('0x103'),_0x38595b,_0x15374f));return;}var _0x4acf94=uuid['v4']();var _0x2c97a0=_0x733d26[_0x4ee1('0x11')][_0x58da3b[_0x4ee1('0x73')][_0x4ee1('0x29')]];var _0x172b4e=_0x383e36?_0x733d26[_0x4ee1('0x14')][_0x383e36]['id']:undefined;_0x733d26[_0x4ee1('0x71')][_0x4acf94]=new Action(_0x58da3b,_0x2c97a0,_0x4acf94,_0x383e36,_0x172b4e);var _0x5d0972=_0x733d26['actions'][_0x4acf94];_0x5d0972[_0x4ee1('0xab')]=_0x38595b;_0x5d0972['activeContact']=_0x15374f;_0x5d0972[_0x4ee1('0x104')]=_0x383e36;if(_[_0x4ee1('0x105')](_0x1fdf4c)){_0x733d26[_0x4ee1('0x106')](_0x5d0972,_0x2c97a0,_0x58da3b,_0x383e36)[_0x4ee1('0x85')](function(_0x419be9){logger[_0x4ee1('0x5b')](_0x4ee1('0x107'),'Queue:\x20'+_0x5d0972[_0x4ee1('0x74')]+_0x4ee1('0x108')+_0x5d0972['idContact'],JSON['stringify'](_0x419be9));ami[_0x4ee1('0x26')](_0x4ee1('0x109'),ut[_0x4ee1('0xa2')](_0x5d0972,_0x4ee1('0x10a'),_0x733d26['campaignsPreview'][_0x5d0972[_0x4ee1('0x74')]]));_0x29d7e0(ut[_0x4ee1('0x4d')](_0x4ee1('0x10b')));})['catch'](function(_0x18d85d){ut[_0x4ee1('0x64')](_0x4ee1('0x10c'),_0x18d85d);_0x205189(ut[_0x4ee1('0x4d')](_0x4ee1('0x10d'),_0x38595b,_0x15374f));});}else{_0x2c97a0[_0x4ee1('0x10e')]+=0x1;ut[_0x4ee1('0x10f')](_0x5d0972);rpcDb[_0x4ee1('0x110')](_0x5d0972,_0x4ee1('0x111'));delete _0x733d26[_0x4ee1('0x71')][_0x4acf94];_0x205189(ut[_0x4ee1('0x4d')](_0x4ee1('0x112'),_0x38595b,_0x15374f));}});};Preview['prototype'][_0x4ee1('0x9a')]=function(_0x260fad){return!_[_0x4ee1('0x70')](_0x260fad)&&!_[_0x4ee1('0x70')](_0x260fad[_0x4ee1('0x29')])&&!_[_0x4ee1('0x70')](_0x260fad[_0x4ee1('0x55')])&&_0x260fad[_0x4ee1('0x55')]&&!_[_0x4ee1('0x70')](this[_0x4ee1('0x13')][util['format'](_0x4ee1('0x113'),_0x260fad[_0x4ee1('0x29')])])&&!_[_0x4ee1('0x70')](this['trunks'][util[_0x4ee1('0x59')]('SIP/%s',_0x260fad[_0x4ee1('0x29')])][_0x4ee1('0x114')])&&(this[_0x4ee1('0x13')][util[_0x4ee1('0x59')](_0x4ee1('0x113'),_0x260fad[_0x4ee1('0x29')])]['status']===_0x4ee1('0x115')||this[_0x4ee1('0x13')][util['format'](_0x4ee1('0x113'),_0x260fad[_0x4ee1('0x29')])][_0x4ee1('0x114')]===_0x4ee1('0x116'));};Preview[_0x4ee1('0xe')][_0x4ee1('0x117')]=function(_0x20e130,_0xe1f4bf){var _0x39c46e=this;return new BPromise(function(_0x428bf4,_0x4b3cbc){_0x39c46e[_0x4ee1('0x118')](_0x20e130,_0xe1f4bf)[_0x4ee1('0x85')](function(_0xb1ff45){_0x428bf4(_[_0x4ee1('0x78')](_0xb1ff45,[_0x4ee1('0x4d')]));})[_0x4ee1('0x7c')](function(_0x57154d){if(_0x57154d['unlock']){rpcDb[_0x4ee1('0x119')](_0x20e130);}if(_0x57154d[_0x4ee1('0x55')]){rpcDb['disableContact'](_0x20e130);}_0x4b3cbc(_[_0x4ee1('0x78')](_0x57154d,[_0x4ee1('0x4d')]));});});};Preview[_0x4ee1('0xe')][_0x4ee1('0x118')]=function(_0x59f710,_0x381b0b){var _0x350fa0=this;return new BPromise(function(_0x1921db,_0x35db5f){var _0x5c555d,_0x33d924;rpcDb[_0x4ee1('0x11a')](_0x59f710)[_0x4ee1('0x85')](function(_0x1e0872){if(!_[_0x4ee1('0x70')](_0x1e0872[0x0])){_0x33d924=_0x1e0872[0x0][_0x4ee1('0x11b')]?![]:!![];_0x5c555d=_0x1e0872[0x0][_0x4ee1('0x11b')]?!![]:![];_0x5c555d=_0x381b0b?!![]:_0x5c555d;}var _0x5805a3=_0x350fa0['validateContact'](_0x1e0872);if(_0x5805a3[_0x4ee1('0x11c')]){rpcDb[_0x4ee1('0x11d')](_['pick'](_0x1e0872[0x0],[_0x4ee1('0x7a'),_0x4ee1('0x11e')]))[_0x4ee1('0x85')](function(_0x2c1016){_0x350fa0['checkInBlack'](_0x2c1016,_0x1e0872[0x0],_0x381b0b,_0x33d924,_0x5c555d)[_0x4ee1('0x85')](function(_0x47c159){_0x1921db(_0x47c159);})[_0x4ee1('0x7c')](function(_0x5e74b2){_0x35db5f(_0x5e74b2);});})[_0x4ee1('0x7c')](function(_0x248c58){ut[_0x4ee1('0x64')](_0x4ee1('0x11f'),_0x248c58);_0x35db5f(ut[_0x4ee1('0x4d')](_0x4ee1('0x120'),_0x33d924,_0x5c555d));});}else{_0x35db5f(ut[_0x4ee1('0x4d')](_0x5805a3[_0x4ee1('0x4d')],_0x33d924,_0x5c555d));}})[_0x4ee1('0x7c')](function(_0x12f795){ut['logger'](_0x4ee1('0x121'),_0x12f795);_0x35db5f(ut['message'](_0x4ee1('0x120'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x3baee2){if(_[_0x4ee1('0x70')](_0x3baee2)||_[_0x4ee1('0x105')](_0x3baee2)||!_[_0x4ee1('0x70')](_0x3baee2[0x0][_0x4ee1('0x88')])&&_[_0x4ee1('0x70')](_0x3baee2[0x0][_0x4ee1('0x88')][_0x4ee1('0x29')])){ut[_0x4ee1('0x64')]('[Preview][validateContact][Empty\x20Contact]',_0x3baee2);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x31ce12=this['campaignsPreview'][_0x3baee2[0x0][_0x4ee1('0x73')][_0x4ee1('0x29')]];_0x31ce12[_0x4ee1('0x4d')]=_0x4ee1('0x9d');if(_[_0x4ee1('0x70')](_0x31ce12)){ut[_0x4ee1('0x64')](_0x4ee1('0x122'),_0x31ce12);return{'isValid':![],'message':_0x4ee1('0x123')};}if(!this[_0x4ee1('0x9a')](_0x31ce12[_0x4ee1('0x54')])){ut[_0x4ee1('0x64')](_0x4ee1('0x124'),_0x4ee1('0x125')+_0x31ce12[_0x4ee1('0x29')]+_0x4ee1('0x126'));if(!this['isTrunkReachable'](_0x31ce12[_0x4ee1('0x9b')])){ut[_0x4ee1('0x64')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x31ce12[_0x4ee1('0x29')]+_0x4ee1('0x127'));return{'isValid':![],'message':_0x4ee1('0x128')};}}if(!ut[_0x4ee1('0x99')](_0x31ce12['dialActive'])){ut[_0x4ee1('0x64')](_0x4ee1('0x129'),_0x31ce12['name']+_0x4ee1('0x12a'));return{'isValid':![],'message':_0x4ee1('0x125')+_0x31ce12['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x4ee1('0x12b')};};Preview['prototype'][_0x4ee1('0x106')]=function(_0x10c29f,_0x2b19d4,_0x13978a,_0x56b7cd){var _0xcb32a2=this;return new BPromise(function(_0x5d15ed,_0x27acc8){var _0x3047b9=_0x10c29f[_0x4ee1('0xc0')];var _0x512da2=_0xcb32a2[_0x4ee1('0x9a')](_0x2b19d4[_0x4ee1('0x54')])?util[_0x4ee1('0x59')](_0x4ee1('0x12c'),_0x2b19d4[_0x4ee1('0x54')][_0x4ee1('0x29')],_['isNil'](_0x2b19d4[_0x4ee1('0x39')])?'':_0x2b19d4[_0x4ee1('0x39')]['trim']()||'',_0x2b19d4[_0x4ee1('0x12d')]>0x0?_0x13978a[_0x4ee1('0x101')]['phone'][_0x4ee1('0x12e')](_0x2b19d4[_0x4ee1('0x12d')]):_0x13978a['Contact'][_0x4ee1('0x102')]):util['format'](_0x4ee1('0x12c'),_['isNil'](_0x2b19d4[_0x4ee1('0x9b')])?_0x2b19d4['Trunk']['name']:_0x2b19d4['TrunkBackup']['name'],_[_0x4ee1('0x70')](_0x2b19d4['dialPrefix'])?'':_0x2b19d4[_0x4ee1('0x39')][_0x4ee1('0x12f')]()||'',_0x2b19d4[_0x4ee1('0x12d')]>0x0?_0x13978a[_0x4ee1('0x101')][_0x4ee1('0x102')][_0x4ee1('0x12e')](_0x2b19d4[_0x4ee1('0x12d')]):_0x13978a[_0x4ee1('0x101')][_0x4ee1('0x102')]);var _0x43507a=_0xcb32a2[_0x4ee1('0x9a')](_0x2b19d4[_0x4ee1('0x54')])?ut[_0x4ee1('0x130')](_0x2b19d4[_0x4ee1('0x54')][_0x4ee1('0x56')],_0x2b19d4[_0x4ee1('0x36')],_0x2b19d4[_0x4ee1('0x131')]>0x0?ut[_0x4ee1('0x132')](_0x2b19d4[_0x4ee1('0x37')],_0x2b19d4[_0x4ee1('0x131')]):_0x2b19d4[_0x4ee1('0x37')]):ut[_0x4ee1('0x130')](_[_0x4ee1('0x70')](_0x2b19d4[_0x4ee1('0x9b')])?_0x2b19d4[_0x4ee1('0x54')][_0x4ee1('0x56')]:_0x2b19d4[_0x4ee1('0x9b')][_0x4ee1('0x56')],_0x2b19d4[_0x4ee1('0x36')],_0x2b19d4[_0x4ee1('0x131')]>0x0?ut['getCallerIdRandom'](_0x2b19d4['dialOriginateCallerIdNumber'],_0x2b19d4['dialRandomLastDigitCallerIdNumber']):_0x2b19d4[_0x4ee1('0x37')]);if(_0x43507a){_0x10c29f[_0x4ee1('0x133')]=ut[_0x4ee1('0x134')](_0x43507a);_0x10c29f['originatecalleridnum']=ut[_0x4ee1('0x135')](_0x43507a);}var _0x14139e=ut[_0x4ee1('0x136')](_0x2b19d4,_0x13978a,_0x512da2,_0x43507a,_0x3047b9,_0x10c29f);_[_0x4ee1('0x137')](_0x10c29f,ut[_0x4ee1('0x138')](_0x14139e));_0x10c29f[_0x4ee1('0x8c')]=moment()[_0x4ee1('0x59')](_0x4ee1('0xae'));ami[_0x4ee1('0x7b')](ut[_0x4ee1('0x139')](_0x10c29f,_0x2b19d4,_0x14139e,_0x10c29f['activeContact'],_0x56b7cd))[_0x4ee1('0x85')](function(_0x4d5868){_0x2b19d4[_0x4ee1('0x4e')]+=0x1;logger[_0x4ee1('0x5b')](_0x4ee1('0x13a'),_0x3047b9,_0x4ee1('0xc1'),_0x2b19d4['name'],_0x4ee1('0x75'),_0x2b19d4['originated']);_0x5d15ed(_0x4d5868);})[_0x4ee1('0x7c')](function(_0x1df16e){ut[_0x4ee1('0xf8')](_0x10c29f,0xe,_0x4ee1('0x13b'));rpcDb[_0x4ee1('0xf6')](_0x10c29f,'[originateFailure][logOriginateFailure]');_0x27acc8(_0x1df16e);});});};Preview[_0x4ee1('0xe')][_0x4ee1('0x1f')]=function(_0x6557c2){if(this[_0x4ee1('0x71')][_0x6557c2[_0x4ee1('0xad')]]){this[_0x4ee1('0x71')][_0x6557c2['linkedid']][_0x4ee1('0x13c')]=_0x6557c2['channel'];}};Preview[_0x4ee1('0xe')][_0x4ee1('0x17')]=function(_0x53c584){var _0x5a4829=this;var _0x580b17=this[_0x4ee1('0x71')][_0x53c584['actionid']];if(_0x580b17){if(_0x580b17['lookAgent']&&this[_0x4ee1('0x14')][_0x580b17[_0x4ee1('0x104')]]){ut['logLookAgent'](_0x580b17,this[_0x4ee1('0x14')][_0x580b17[_0x4ee1('0x104')]][_0x4ee1('0x29')],this['agents'][_0x580b17[_0x4ee1('0x104')]]['id']);}var _0x37b6c0=_[_0x4ee1('0x13d')](_0x580b17);_0x37b6c0[_0x4ee1('0xaf')]=moment()[_0x4ee1('0x59')](_0x4ee1('0xae'));var _0x10d099=_0x5a4829['campaignsPreview'][_0x580b17[_0x4ee1('0x74')]];if(ut[_0x4ee1('0x13e')](_0x53c584['response'])){if(_0x580b17['unlockAgent']){rpcDb['unlockContact'](_0x580b17[_0x4ee1('0x13f')]);}if(_0x580b17[_0x4ee1('0xac')]){rpcDb[_0x4ee1('0x8b')](_0x580b17['idContact']);}ami['emit'](_0x4ee1('0x140'),ut['buildObj'](_0x580b17,_0x4ee1('0x141'),this[_0x4ee1('0x11')][_0x580b17[_0x4ee1('0x74')]]));this['callProgressDetectingAgent'](_0x37b6c0,_0x10d099,_0x53c584);}else{_0x580b17[_0x4ee1('0x8c')]=moment()[_0x4ee1('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x4ee1('0xf8')](_0x37b6c0,0x4,_0x4ee1('0xbc'));rpcDb[_0x4ee1('0xf6')](_0x37b6c0,_0x4ee1('0x142'));}}};Preview[_0x4ee1('0xe')][_0x4ee1('0x1a')]=function(_0x2d4bcd){var _0x5e2e11=this;var _0x479ae9=this[_0x4ee1('0x71')][_0x2d4bcd['linkedid']];var _0x100e44;if(_0x479ae9){_0x100e44=this[_0x4ee1('0x11')][_0x479ae9[_0x4ee1('0x74')]];logger['info'](_0x4ee1('0x143'),_0x2d4bcd[_0x4ee1('0xad')],_0x4ee1('0xc1'),_0x100e44[_0x4ee1('0x29')],_0x4ee1('0x76'),_0x100e44['pTalking']);}if(this[_0x4ee1('0x71')][_0x2d4bcd['linkedid']]&&_0x2d4bcd[_0x4ee1('0xad')]!==_0x2d4bcd[_0x4ee1('0xc0')]){if(_0x2d4bcd['cause']==='16'&&this[_0x4ee1('0x71')][_0x2d4bcd[_0x4ee1('0xad')]][_0x4ee1('0x77')]){this[_0x4ee1('0x9e')](_0x2d4bcd,_0x2d4bcd['linkedid'],_0x2d4bcd[_0x4ee1('0x144')]);}else if(this[_0x4ee1('0x71')][_0x2d4bcd['linkedid']]['dialAnswer']){logger[_0x4ee1('0x5b')](_0x4ee1('0x145'),_0x2d4bcd[_0x4ee1('0xad')],_0x2d4bcd[_0x4ee1('0x144')],_0x4ee1('0xc1'),_0x100e44[_0x4ee1('0x29')],_0x4ee1('0x76'),_0x100e44[_0x4ee1('0x2c')]);this[_0x4ee1('0x9e')](_0x2d4bcd,_0x2d4bcd['linkedid'],_0x2d4bcd['cause']);}}else if(_0x479ae9&&_[_0x4ee1('0x70')](_0x479ae9[_0x4ee1('0x146')])&&_0x100e44[_0x4ee1('0x147')]&&_0x2d4bcd[_0x4ee1('0xad')]===_0x2d4bcd[_0x4ee1('0xc0')]&&_['isNil'](_0x2d4bcd['reason'])&&_0x2d4bcd[_0x4ee1('0x144')]==='16'&&_0x2d4bcd[_0x4ee1('0x148')]==='6'&&_[_0x4ee1('0xf3')](_0x479ae9[_0x4ee1('0x149')])){if(_0x479ae9[_0x4ee1('0xab')]){rpcDb[_0x4ee1('0x119')](_0x479ae9[_0x4ee1('0x13f')]);}if(_0x479ae9[_0x4ee1('0xac')]){rpcDb['disableContact'](_0x479ae9[_0x4ee1('0x13f')]);}_0x2d4bcd[_0x4ee1('0xf4')]='22';this[_0x4ee1('0xf2')](_0x479ae9,_0x100e44,_0x2d4bcd);}else if(_0x479ae9&&_0x479ae9[_0x4ee1('0x149')]){if(_0x2d4bcd['cause']==='16'&&this[_0x4ee1('0x71')][_0x2d4bcd[_0x4ee1('0xad')]][_0x4ee1('0x77')]){logger[_0x4ee1('0x5b')]('[syncHangup][talking][transfer]',_0x2d4bcd[_0x4ee1('0xad')],_0x2d4bcd[_0x4ee1('0x144')],'\x20Queue',_0x100e44[_0x4ee1('0x29')],'pTalking:\x20',_0x100e44['pTalking']);this[_0x4ee1('0x9e')](_0x2d4bcd,_0x2d4bcd['linkedid'],_0x2d4bcd[_0x4ee1('0x144')]);}else if(this[_0x4ee1('0x71')][_0x2d4bcd[_0x4ee1('0xad')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x2d4bcd[_0x4ee1('0xad')],_0x2d4bcd[_0x4ee1('0x144')],_0x4ee1('0xc1'),_0x100e44[_0x4ee1('0x29')],'pTalking:\x20',_0x100e44['pTalking']);this[_0x4ee1('0x9e')](_0x2d4bcd,_0x2d4bcd[_0x4ee1('0xad')],_0x2d4bcd[_0x4ee1('0x144')]);}}};Preview['prototype'][_0x4ee1('0x1d')]=function(_0x27afad){if(this[_0x4ee1('0x71')][_0x27afad[_0x4ee1('0xf1')]]&&_0x27afad[_0x4ee1('0xf1')]!==_0x27afad[_0x4ee1('0x14a')]){this[_0x4ee1('0x9e')](_0x27afad,_0x27afad[_0x4ee1('0xf1')],_0x27afad[_0x4ee1('0xe7')]);}};Preview['prototype'][_0x4ee1('0x1b')]=function(_0x50b3ac){if(this[_0x4ee1('0x71')][_0x50b3ac['linkedid']]&&_0x50b3ac[_0x4ee1('0xad')]!==_0x50b3ac[_0x4ee1('0xc0')]&&!this[_0x4ee1('0x71')][_0x50b3ac[_0x4ee1('0xad')]][_0x4ee1('0x77')]){if(_0x50b3ac[_0x4ee1('0x144')]==='1'){this[_0x4ee1('0x9e')](_0x50b3ac,_0x50b3ac[_0x4ee1('0xad')],_0x50b3ac[_0x4ee1('0x144')]);}}};Preview[_0x4ee1('0xe')][_0x4ee1('0x14b')]=function(_0x2a52d,_0x11afb1,_0x565e63){if(this['actions'][_0x2a52d]){if(_['isNil'](this[_0x4ee1('0x71')][_0x2a52d][_0x4ee1('0x14c')])){this[_0x4ee1('0x71')][_0x2a52d][_0x4ee1('0x14c')]={};}this[_0x4ee1('0x71')][_0x2a52d][_0x4ee1('0x14c')][_0x11afb1]=_0x565e63;}};Preview[_0x4ee1('0xe')]['syncVarSet']=function(_0x3cfa61){try{if(!_['isNil'](_0x3cfa61)){if(ut[_0x4ee1('0x14d')](_[_0x4ee1('0x14e')](_0x3cfa61[_0x4ee1('0x14f')])[0x0])){this[_0x4ee1('0x14b')](_0x3cfa61[_0x4ee1('0xc0')],_['keys'](_0x3cfa61[_0x4ee1('0x14f')])[0x0],_0x3cfa61['value']);}}}catch(_0x225ad4){logger[_0x4ee1('0x150')]('[syncVarSet][Preview]',util[_0x4ee1('0x151')](_0x225ad4,{'showHidden':![],'depth':null}));}};Preview[_0x4ee1('0xe')][_0x4ee1('0x22')]=function(_0x265391){if(_0x265391){if(this[_0x4ee1('0x71')][_0x265391[_0x4ee1('0x152')]]){this['actions'][_0x265391[_0x4ee1('0x152')]]['transfer']=!![];}}};Preview[_0x4ee1('0xe')]['syncBlindTransfer']=function(_0x5162dd){if(_0x5162dd){if(this[_0x4ee1('0x71')][_0x5162dd[_0x4ee1('0x153')]]){this['actions'][_0x5162dd[_0x4ee1('0x153')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x7fbe=['rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Congestion','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','isEmpty','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','Call\x20failed','SIP/%s','reachable','status','unmonitored','run','execRun','pick','unlock','unlockContact','disableContact','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','phone','dialPrefix','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','starttime','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','bind','dialend','syncDialEnd','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','sumBillable','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','prototype','clockClearZombieChannels','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','Queue','originated:\x20','queue','dialAnswer','UserId','VoiceQueueId','Action','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','hasOwnProperty','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry'];(function(_0x184a95,_0x500731){var _0x55eadf=function(_0x49fcd7){while(--_0x49fcd7){_0x184a95['push'](_0x184a95['shift']());}};_0x55eadf(++_0x500731);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x8cea57,_0x290172){_0x8cea57=_0x8cea57-0x0;var _0x25ce1d=_0x7fbe[_0x8cea57];return _0x25ce1d;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xe7fb('0x0'));var uuid=require(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var md5=require(_0xe7fb('0x3'));var Redis=require(_0xe7fb('0x4'));var config=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var loggerAction=require(_0xe7fb('0x6'))(_0xe7fb('0x8'));var ami=require(_0xe7fb('0x9'));var rpcDb=require(_0xe7fb('0xa'));var Action=require(_0xe7fb('0xb'));var ut=require(_0xe7fb('0xc'));config['redis']=_[_0xe7fb('0xd')](config[_0xe7fb('0xe')],{'host':_0xe7fb('0xf'),'port':0x18eb});var io=require(_0xe7fb('0x10'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xe7fb('0x11')]=function(_0x2f2ea0){this[_0xe7fb('0x12')]=this[_0xe7fb('0x12')]?this[_0xe7fb('0x12')][_0xe7fb('0x13')](_0x2f2ea0):_0x2f2ea0();};function Preview(_0x3e934b){this[_0xe7fb('0x14')]=new Sequence();this[_0xe7fb('0x15')]=_0x3e934b[_0xe7fb('0x16')];this[_0xe7fb('0x17')]=_0x3e934b[_0xe7fb('0x17')];this[_0xe7fb('0x18')]={};this[_0xe7fb('0x19')]=_0x3e934b[_0xe7fb('0x19')];this['clockClearZombieChannels']=0x0;ami['on'](_0xe7fb('0x1a'),this[_0xe7fb('0x1b')]['bind'](this));ami['on'](_0xe7fb('0x1c'),this[_0xe7fb('0x1d')]['bind'](this));ami['on'](_0xe7fb('0x1e'),this['syncHangupRequest'][_0xe7fb('0x1f')](this));ami['on'](_0xe7fb('0x20'),this[_0xe7fb('0x21')][_0xe7fb('0x1f')](this));ami['on']('newexten',this[_0xe7fb('0x22')]['bind'](this));ami['on'](_0xe7fb('0x23'),this['syncVarSet'][_0xe7fb('0x1f')](this));ami['on'](_0xe7fb('0x24'),this[_0xe7fb('0x25')][_0xe7fb('0x1f')](this));ami['on']('blindtransfer',this[_0xe7fb('0x26')]['bind'](this));this[_0xe7fb('0x27')](this['campaignsPreview']);}function emit(_0x15f7a4,_0x4ea664,_0xa5af01){io['to'](_0x15f7a4)[_0xe7fb('0x28')](_0x4ea664,_0xa5af01);}function emitCampaignPreview(_0x4a9994){if(_0x4a9994[_0xe7fb('0x29')]===_0xe7fb('0x2a')){var _0x3ae8f1={'id':_0x4a9994['id'],'name':_0x4a9994['name'],'strategy':_0x4a9994[_0xe7fb('0x2b')],'answered':_0x4a9994[_0xe7fb('0x2c')],'available':_0x4a9994['available'],'loggedIn':_0x4a9994['loggedIn'],'pTalking':_0x4a9994['pTalking'],'sumBillable':_0x4a9994[_0xe7fb('0x2d')],'sumDuration':_0x4a9994['sumDuration'],'sumHoldTime':_0x4a9994['sumHoldTime']||0x0,'talking':_0x4a9994[_0xe7fb('0x2e')],'total':_0x4a9994[_0xe7fb('0x2f')],'type':_0x4a9994[_0xe7fb('0x29')],'unmanaged':_0x4a9994['unmanaged'],'abandoned':_0x4a9994[_0xe7fb('0x30')],'waiting':_0x4a9994[_0xe7fb('0x31')],'loggedInDb':_0x4a9994[_0xe7fb('0x32')],'dialActive':_0x4a9994[_0xe7fb('0x33')],'dialMethod':_0x4a9994[_0xe7fb('0x34')],'dialOriginateCallerIdName':_0x4a9994[_0xe7fb('0x35')],'dialOriginateCallerIdNumber':_0x4a9994[_0xe7fb('0x36')],'dialOriginateTimeout':_0x4a9994['dialOriginateTimeout'],'dialPrefix':_0x4a9994['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4a9994[_0xe7fb('0x37')],'outboundAnswerCallsDay':_0x4a9994[_0xe7fb('0x38')],'outboundBlacklistCallsDay':_0x4a9994[_0xe7fb('0x39')],'outboundBusyCallsDay':_0x4a9994['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4a9994[_0xe7fb('0x3a')],'outboundDropCallsDayACS':_0x4a9994[_0xe7fb('0x3b')],'outboundDropCallsDayCallersExit':_0x4a9994[_0xe7fb('0x3c')],'outboundDropCallsDayTimeout':_0x4a9994[_0xe7fb('0x3d')],'outboundNoAnswerCallsDay':_0x4a9994[_0xe7fb('0x3e')],'outboundNoSuchCallsDay':_0x4a9994[_0xe7fb('0x3f')],'outboundOriginateFailureCallsDay':_0x4a9994[_0xe7fb('0x40')],'outboundReCallsDay':_0x4a9994[_0xe7fb('0x41')],'outboundRejectCallsDay':_0x4a9994['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4a9994[_0xe7fb('0x42')],'outboundAbandonedCallsDay':_0x4a9994[_0xe7fb('0x43')],'predictiveIntervalAnsweredCalls':_0x4a9994[_0xe7fb('0x44')],'predictiveIntervalAvgHoldtime':_0x4a9994['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4a9994['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4a9994[_0xe7fb('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x4a9994['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4a9994[_0xe7fb('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x4a9994[_0xe7fb('0x47')],'predictiveIntervalHitRate':_0x4a9994[_0xe7fb('0x48')],'predictiveIntervalMultiplicativeFactor':_0x4a9994[_0xe7fb('0x49')],'predictiveIntervalPauses':_0x4a9994['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4a9994[_0xe7fb('0x4a')],'predictiveIntervalTotalCalls':_0x4a9994[_0xe7fb('0x4b')],'message':_0x4a9994[_0xe7fb('0x4c')],'originated':_0x4a9994[_0xe7fb('0x4d')],'erlangCalls':_0x4a9994[_0xe7fb('0x4e')],'erlangCallToSecond':_0x4a9994['erlangCallToSecond'],'erlangAbandonmentRate':_0x4a9994[_0xe7fb('0x4f')],'erlangBusyFactor':_0x4a9994[_0xe7fb('0x50')],'startPredictive':_0x4a9994[_0xe7fb('0x51')],'startProgressive':_0x4a9994[_0xe7fb('0x52')]};if(_0x4a9994[_0xe7fb('0x53')]){_0x3ae8f1[_0xe7fb('0x53')]={'id':_0x4a9994[_0xe7fb('0x53')]['id'],'name':_0x4a9994[_0xe7fb('0x53')][_0xe7fb('0x54')],'active':_0x4a9994['Trunk'][_0xe7fb('0x55')],'callerid':_0x4a9994[_0xe7fb('0x53')][_0xe7fb('0x56')]};}if(_0x4a9994['Interval']){_0x3ae8f1[_0xe7fb('0x57')]={'id':_0x4a9994[_0xe7fb('0x57')]['id'],'name':_0x4a9994[_0xe7fb('0x57')][_0xe7fb('0x54')]};}var _0x402ca3=md5(JSON[_0xe7fb('0x58')](_0x3ae8f1));if(_0x4a9994[_0xe7fb('0x3')]!==_0x402ca3){_0x4a9994[_0xe7fb('0x3')]=_0x402ca3;emit(util[_0xe7fb('0x59')](_0xe7fb('0x5a'),_0x3ae8f1[_0xe7fb('0x54')]),_0xe7fb('0x5b'),_0x3ae8f1);}}}function emitVoiceQueueChannelRemove(_0x1544f2){logger[_0xe7fb('0x5c')](_0xe7fb('0x5d'),JSON[_0xe7fb('0x58')](_0x1544f2));emit(util[_0xe7fb('0x59')](_0xe7fb('0x5a'),_0x1544f2[_0xe7fb('0x54')]),'voice_queue_channel:remove',_0x1544f2);io[_0xe7fb('0x28')](_0xe7fb('0x5e'),_0x1544f2);}function notSendMessagesQueue(_0x3f3207){if(_0x3f3207[_0xe7fb('0x5f')]){if(_0x3f3207['originated']===0x0&&_0x3f3207[_0xe7fb('0x60')]===0x0){_0x3f3207[_0xe7fb('0x5f')]=![];_0x3f3207[_0xe7fb('0x61')]=0x0;_0x3f3207[_0xe7fb('0x62')]=0x0;_0x3f3207['message']=_0xe7fb('0x63');ut[_0xe7fb('0x64')](_0xe7fb('0x65'),_0x3f3207[_0xe7fb('0x54')]+_0xe7fb('0x66'));}else{_0x3f3207[_0xe7fb('0x4c')]='IS_DISACTIVED';ut[_0xe7fb('0x64')](_0xe7fb('0x65'),_0x3f3207[_0xe7fb('0x54')]+'\x20is\x20disactive');}emitCampaignPreview(_0x3f3207);}}Preview[_0xe7fb('0x67')][_0xe7fb('0x27')]=function(){var _0x5d42ac=this;setInterval(function(){_0x5d42ac['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x5e0153=this[_0xe7fb('0x15')];this[_0xe7fb('0x68')]+=0x1;for(var _0xed62e9 in _0x5e0153){if(_0x5e0153['hasOwnProperty'](_0xed62e9)&&(_0x5e0153[_0xed62e9][_0xe7fb('0x34')]==='preview'||_0x5e0153[_0xed62e9][_0xe7fb('0x34')]===_0xe7fb('0x69'))&&_0x5e0153[_0xed62e9]['type']===_0xe7fb('0x2a')){if(this[_0xe7fb('0x68')]>0x7){this[_0xe7fb('0x68')]=0x0;this[_0xe7fb('0x6a')]();}}if(_0x5e0153['hasOwnProperty'](_0xed62e9)&&_0x5e0153[_0xed62e9][_0xe7fb('0x34')]===_0xe7fb('0x7')&&_0x5e0153[_0xed62e9][_0xe7fb('0x29')]==='outbound'){if(_0x5e0153[_0xed62e9][_0xe7fb('0x33')]){this[_0xe7fb('0x6b')](_0x5e0153[_0xed62e9]);if(_0x5e0153[_0xed62e9][_0xe7fb('0x6c')])this[_0xe7fb('0x6d')](_0x5e0153[_0xed62e9]);}else{notSendMessagesQueue(_0x5e0153[_0xed62e9]);}}}};Preview[_0xe7fb('0x67')]['clearZombieChannel']=function(_0x2eb999){var _0x4df4aa=this;this[_0xe7fb('0x14')][_0xe7fb('0x11')](function(){if(!_[_0xe7fb('0x6e')](_0x4df4aa[_0xe7fb('0x18')][_0x2eb999])){loggerAction[_0xe7fb('0x5c')]('[clearZombieChannels][talking]',_0x2eb999,_0xe7fb('0x6f'),_0x4df4aa['actions'][_0x2eb999]['queue'],_0xe7fb('0x70'),JSON[_0xe7fb('0x58')](_0x4df4aa[_0xe7fb('0x15')][_0x4df4aa['actions'][_0x2eb999][_0xe7fb('0x71')]][_0xe7fb('0x4d')]),'pTalking:\x20',JSON['stringify'](_0x4df4aa[_0xe7fb('0x15')][_0x4df4aa[_0xe7fb('0x18')][_0x2eb999][_0xe7fb('0x71')]][_0xe7fb('0x60')]),JSON[_0xe7fb('0x58')](_0x4df4aa[_0xe7fb('0x18')][_0x2eb999][_0xe7fb('0x72')]),JSON[_0xe7fb('0x58')](_['pick'](_0x4df4aa[_0xe7fb('0x18')][_0x2eb999],['contactId',_0xe7fb('0x73'),_0xe7fb('0x74'),'ListId'])));return ami[_0xe7fb('0x75')]({'action':'status','channel':_0x4df4aa[_0xe7fb('0x18')][_0x2eb999]['channel']})[_0xe7fb('0x76')](function(_0x533e91){if(_0x533e91[_0xe7fb('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4df4aa[_0xe7fb('0x18')][_0x2eb999]){ut[_0xe7fb('0x77')](_0x4df4aa[_0xe7fb('0x15')][_0x4df4aa[_0xe7fb('0x18')][_0x2eb999][_0xe7fb('0x71')]],_0xe7fb('0x78'));if(_0x4df4aa[_0xe7fb('0x18')][_0x2eb999]['dialAnswer']===!![]){ut['decrementTalkink'](_0x4df4aa[_0xe7fb('0x15')][_0x4df4aa['actions'][_0x2eb999]['queue']],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x2eb999,_0x4df4aa[_0xe7fb('0x18')][_0x2eb999][_0xe7fb('0x71')]);}ut[_0xe7fb('0x79')](_0xe7fb('0x7a')+_0x2eb999,_0x4df4aa['actions'][_0x2eb999][_0xe7fb('0x71')]);delete _0x4df4aa[_0xe7fb('0x18')][_0x2eb999];}},0x2328);}});}});};Preview[_0xe7fb('0x67')]['clearZombieChannels']=function(){var _0x56c512=this;loggerAction[_0xe7fb('0x5c')](_0xe7fb('0x7b'),_[_0xe7fb('0x7c')](this['actions']));for(var _0x27f860 in this[_0xe7fb('0x18')]){if(_0x56c512[_0xe7fb('0x18')][_0xe7fb('0x7d')](_0x27f860)){_0x56c512['clearZombieChannel'](_0x27f860);}}};Preview['prototype'][_0xe7fb('0x6d')]=function(_0x3104c2){var _0x1f16b2=this;rpcDb[_0xe7fb('0x7e')](_0x3104c2['id'],ut[_0xe7fb('0x7f')](this['agents']))[_0xe7fb('0x80')](function(_0x349a2a){if(!_[_0xe7fb('0x6e')](_0x349a2a)){for(var _0x590d7a=0x0;_0x590d7a<_0x349a2a['length'];_0x590d7a+=0x1){if(ut[_0xe7fb('0x81')](_0x349a2a[_0x590d7a][_0xe7fb('0x82')])<_0x3104c2[_0xe7fb('0x83')]*0x3c){if(_0x349a2a[_0x590d7a][_0xe7fb('0x84')]&&!_0x349a2a[_0x590d7a][_0xe7fb('0x84')][_0xe7fb('0x85')]){_0x1f16b2['run'](_0x349a2a[_0x590d7a]['id'])[_0xe7fb('0x80')](ut[_0xe7fb('0x86')](_0xe7fb('0x87')))[_0xe7fb('0x76')](ut[_0xe7fb('0x86')](_0xe7fb('0x87')));}else{rpcDb['disableContact'](_0x349a2a[_0x590d7a]['id']);}}else{var _0x2e457c=new Action(_0x349a2a[_0x590d7a],_0x3104c2);_0x2e457c['starttime']=moment()[_0xe7fb('0x59')](_0xe7fb('0x88'));_0x3104c2[_0xe7fb('0x41')]+=0x1;ut[_0xe7fb('0x89')](_0x2e457c,0x17,'RecallInQueue');if(_0x3104c2['dialRecallInQueue']){rpcDb[_0xe7fb('0x8a')](ut[_0xe7fb('0x8b')](_0x349a2a[_0x590d7a]));rpcDb[_0xe7fb('0x8c')](_0x2e457c,_0xe7fb('0x8d'));}else{ut[_0xe7fb('0x89')](_0x2e457c,0x16,'RecallFailedTimeout');rpcDb[_0xe7fb('0x8c')](_0x2e457c,'[HistoryRecallClose]');rpcDb[_0xe7fb('0x8e')](_0x2e457c,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xe7fb('0x86')](_0xe7fb('0x8f')));};Preview[_0xe7fb('0x67')]['setMessage']=function(_0x475716){_0x475716[_0xe7fb('0x5f')]=!![];if(ut[_0xe7fb('0x90')](_0x475716[_0xe7fb('0x91')])){_0x475716[_0xe7fb('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xe7fb('0x92')](_0x475716[_0xe7fb('0x33')])){_0x475716['message']=_0xe7fb('0x63');}else if(!this[_0xe7fb('0x93')](_0x475716['Trunk'])){if(!this[_0xe7fb('0x93')](_0x475716['TrunkBackup'])){_0x475716[_0xe7fb('0x4c')]=_0xe7fb('0x94');}else{_0x475716[_0xe7fb('0x4c')]='ACTIVE';}}else{_0x475716[_0xe7fb('0x4c')]=_0xe7fb('0x95');}emitCampaignPreview(_0x475716);};Preview[_0xe7fb('0x67')][_0xe7fb('0x96')]=function(_0x35487f,_0x15ff86,_0xcdc72e){var _0x187040=this;var _0x4dac0f=this['actions'][_0x15ff86];var _0x3ebbd8=this[_0xe7fb('0x15')][_0x4dac0f[_0xe7fb('0x71')]];var _0x50c705;if(_0x3ebbd8){switch(_0xcdc72e){case'1':_0x3ebbd8['outboundNoSuchCallsDay']+=0x1;_0x4dac0f[_0xe7fb('0x97')]+=0x1;_0x4dac0f[_0xe7fb('0x98')]=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x0,_0xe7fb('0x9a'));ami[_0xe7fb('0x28')](_0xe7fb('0x9b'),ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0x9d')));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0x9e'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut['cloneAction'](_0x4dac0f,0xf,'Global');rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xa0'));}else{if(_0x4dac0f[_0xe7fb('0x97')]>=_0x3ebbd8[_0xe7fb('0xa1')]){rpcDb[_0xe7fb('0x8e')](_0x4dac0f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xe7fb('0xa2')](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0x97'),_0x3ebbd8[_0xe7fb('0xa4')]),_0x4dac0f[_0xe7fb('0xa5')],_0x4dac0f[_0xe7fb('0xa6')]);}}delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xa7')]];break;case _0xe7fb('0xa8'):var _0x51eaec=moment()[_0xe7fb('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dac0f[_0xe7fb('0xa9')]=_0x51eaec;_0x4dac0f[_0xe7fb('0xaa')]=_0x51eaec;_0x4dac0f[_0xe7fb('0x72')]=!![];_0x3ebbd8[_0xe7fb('0x60')]+=0x1;logger[_0xe7fb('0x5c')]('[syncHangup][talking][increment]',_0x4dac0f[_0xe7fb('0xab')],_0xe7fb('0xac'),_0x3ebbd8[_0xe7fb('0x54')],_0xe7fb('0xad'),_0x3ebbd8[_0xe7fb('0x60')]);ami[_0xe7fb('0x28')](_0xe7fb('0xae'),ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0xaf'),this[_0xe7fb('0x15')][_0x4dac0f[_0xe7fb('0x71')]]));if(_0x3ebbd8[_0xe7fb('0xb0')]){ami[_0xe7fb('0x28')](_0xe7fb('0xb1'),ut['buildAcw'](_0x4dac0f));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0xb2'),this[_0xe7fb('0x15')][_0x4dac0f[_0xe7fb('0x71')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4dac0f,_0xe7fb('0xb2')));_0x3ebbd8[_0xe7fb('0x38')]+=0x1;_0x3ebbd8[_0xe7fb('0x2f')]+=0x1;_0x3ebbd8[_0xe7fb('0x2c')]+=0x1;ut['decrementTalkink'](_0x3ebbd8,_0xe7fb('0xb3'));_0x4dac0f['countglobal']=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x4,_0xe7fb('0xb4'));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xb5'));rpcDb['createCustomerFinal'](_0x4dac0f,_0xe7fb('0xb6'));rpcDb['crateCustomerReportQueue'](_0x4dac0f);_0x3ebbd8[_0xe7fb('0xb7')]+=_0x4dac0f['talktime'];_0x3ebbd8[_0xe7fb('0x2d')]+=_0x4dac0f[_0xe7fb('0xb8')];logger['info'](_0xe7fb('0xb9'),_0x4dac0f[_0xe7fb('0xab')],_0xe7fb('0xac'),_0x3ebbd8[_0xe7fb('0x54')],'pTalking:\x20',_0x3ebbd8[_0xe7fb('0x60')]);delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xa7')]];break;case'BUSY':_0x3ebbd8[_0xe7fb('0xba')]+=0x1;_0x4dac0f['countbusyretry']+=0x1;_0x4dac0f['countglobal']=ut['totalGlobal'](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x5,_0xe7fb('0xbb'));ami['emit'](_0xe7fb('0xbc'),ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0xbd')));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xbe'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,_0xe7fb('0xc0'));rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xc1'));}else{if(_0x4dac0f[_0xe7fb('0xc2')]>=_0x3ebbd8[_0xe7fb('0xc3')]){rpcDb[_0xe7fb('0x8e')](_0x4dac0f,_0xe7fb('0xbe'));}else{rpcDb[_0xe7fb('0xa2')](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0xc2'),_0x3ebbd8[_0xe7fb('0xc4')]),_0x4dac0f[_0xe7fb('0xa5')],_0x4dac0f['activeContact']);}}break;case _0xe7fb('0xc5'):_0x3ebbd8[_0xe7fb('0x3e')]+=0x1;_0x4dac0f[_0xe7fb('0xc6')]+=0x1;_0x4dac0f[_0xe7fb('0x98')]=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x3,_0xe7fb('0xc7'));ami['emit']('custom:agentnoanswer',ut[_0xe7fb('0x9c')](_0x4dac0f,'noanswer'));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xc8'));if(ut['totalGlobal'](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,_0xe7fb('0xc0'));rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xc9'));}else{if(_0x4dac0f[_0xe7fb('0xc6')]>=_0x3ebbd8['dialNoAnswerMaxRetry']){rpcDb[_0xe7fb('0x8e')](_0x4dac0f,_0xe7fb('0xc8'));}else{rpcDb[_0xe7fb('0xa2')](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0xc6'),_0x3ebbd8[_0xe7fb('0xca')]),_0x4dac0f['unlockAgent'],_0x4dac0f['activeContact']);}}break;case'CONGESTION':_0x3ebbd8[_0xe7fb('0x3a')]+=0x1;_0x4dac0f[_0xe7fb('0xcb')]+=0x1;_0x4dac0f[_0xe7fb('0x98')]=ut['totalGlobal'](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x8,'Congestion');ami[_0xe7fb('0x28')](_0xe7fb('0xcc'),ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0xcd')));rpcDb['createCustomerHistory'](_0x4dac0f,_0xe7fb('0xce'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,_0xe7fb('0xc0'));rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xcf'));}else{if(_0x4dac0f[_0xe7fb('0xcb')]>=_0x3ebbd8['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x4dac0f,_0xe7fb('0xce'));}else{rpcDb['rescheduleContact'](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0xcb'),_0x3ebbd8[_0xe7fb('0xc4')]),_0x4dac0f[_0xe7fb('0xa5')],_0x4dac0f['activeContact']);}}break;case'CANCEL':_0x3ebbd8[_0xe7fb('0xd0')]+=0x1;_0x4dac0f[_0xe7fb('0xd1')]+=0x1;_0x4dac0f['countglobal']=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x14,_0xe7fb('0xd2'));ami[_0xe7fb('0x28')](_0xe7fb('0xd3'),ut[_0xe7fb('0x9c')](_0x4dac0f,'agentreject'));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xd4'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0x14,_0xe7fb('0xd2'));rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xd5'));}else{if(_0x4dac0f[_0xe7fb('0xd1')]>=_0x3ebbd8[_0xe7fb('0xd6')]){rpcDb[_0xe7fb('0x8e')](_0x4dac0f,_0xe7fb('0xd5'));}else{rpcDb[_0xe7fb('0xa2')](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0xd1'),_0x3ebbd8[_0xe7fb('0xd7')]),_0x4dac0f[_0xe7fb('0xa5')],_0x4dac0f[_0xe7fb('0xa6')]);}}break;case'ABANDONED':_0x3ebbd8[_0xe7fb('0x43')]+=0x1;_0x4dac0f[_0xe7fb('0xd8')]+=0x1;_0x4dac0f[_0xe7fb('0x98')]=ut[_0xe7fb('0x99')](_0x4dac0f);ut['logCustomer'](_0x4dac0f,0xb,_0xe7fb('0xd9'));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,'Global');rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xda'));}else{if(_0x4dac0f['countabandonedetry']>=_0x3ebbd8['dialAbandonedMaxRety']){rpcDb[_0xe7fb('0x8e')](_0x4dac0f,_0xe7fb('0xda'));}else{rpcDb[_0xe7fb('0xa2')](ut[_0xe7fb('0xa3')](_0x4dac0f,_0xe7fb('0xd8'),_0x3ebbd8[_0xe7fb('0xdb')]),_0x4dac0f['unlockAgent'],_0x4dac0f[_0xe7fb('0xa6')]);}}break;case'18':_0x3ebbd8[_0xe7fb('0x42')]+=0x1;_0x4dac0f[_0xe7fb('0xdc')]+=0x1;_0x4dac0f['countglobal']=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0x12,_0x35487f[_0xe7fb('0xdd')]||_0x35487f[_0xe7fb('0xde')]);ami['emit'](_0xe7fb('0xdf'),ut[_0xe7fb('0x9c')](_0x4dac0f,_0xe7fb('0xe0')));rpcDb['createCustomerHistory'](_0x4dac0f,_0xe7fb('0xe1'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8[_0xe7fb('0x9f')]){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,'Global');rpcDb[_0xe7fb('0x8e')](_0x50c705,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xe7fb('0x8e')](_0x4dac0f,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xa7')]];break;case'19':_0x3ebbd8['outboundUnknownCallsDay']+=0x1;_0x4dac0f['countglobal']=ut[_0xe7fb('0x99')](_0x4dac0f);ut['logCustomer'](_0x4dac0f,0x13,_0x35487f[_0xe7fb('0xdd')]||_0x35487f[_0xe7fb('0xde')]);ami[_0xe7fb('0x28')](_0xe7fb('0xdf'),ut['buildObj'](_0x4dac0f,_0xe7fb('0xe0')));rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xe2'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8['dialGlobalMaxRetry']){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,_0xe7fb('0xc0'));rpcDb[_0xe7fb('0x8e')](_0x50c705,_0xe7fb('0xe2'));}else{rpcDb[_0xe7fb('0x8e')](_0x4dac0f,'[callProgressDetectingCustomer][machine]');}delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xa7')]];break;default:if(_0x4dac0f[_0xe7fb('0x72')]){ut[_0xe7fb('0xe3')](_0x3ebbd8,_0xe7fb('0xe4'));ut[_0xe7fb('0x79')](_0xe7fb('0xe5')+_0x3ebbd8[_0xe7fb('0x54')],_0x35487f);}_0x3ebbd8[_0xe7fb('0x42')]+=0x1;_0x4dac0f['countglobal']=ut[_0xe7fb('0x99')](_0x4dac0f);ut[_0xe7fb('0x89')](_0x4dac0f,0xc,_0x35487f[_0xe7fb('0xdd')]||_0x35487f[_0xe7fb('0xde')]);rpcDb[_0xe7fb('0x8c')](_0x4dac0f,_0xe7fb('0xe6'));if(ut[_0xe7fb('0x99')](_0x4dac0f)>=_0x3ebbd8['dialGlobalMaxRetry']){_0x50c705=ut[_0xe7fb('0xbf')](_0x4dac0f,0xf,'Global');rpcDb[_0xe7fb('0x8e')](_0x50c705,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xe7fb('0x8e')](_0x4dac0f,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x35487f[_0xe7fb('0xa7')]];}if(!(_0x4dac0f[_0xe7fb('0x72')]&&_0xcdc72e==='16')){ut[_0xe7fb('0x77')](_0x3ebbd8,'[callProgressDetectingCustomer]');logger[_0xe7fb('0x5c')](_0xe7fb('0xe7'),_0x4dac0f[_0xe7fb('0xab')],_0xe7fb('0xac'),_0x3ebbd8[_0xe7fb('0x54')],_0xe7fb('0x70'),_0x3ebbd8['originated']);}if(_0xcdc72e!==_0xe7fb('0xa8')){delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xa7')]];delete this[_0xe7fb('0x18')][_0x35487f[_0xe7fb('0xe8')]];}}};Preview[_0xe7fb('0x67')][_0xe7fb('0xe9')]=function(_0x5b9568,_0xee7647,_0xf9bb70){if(_[_0xe7fb('0xea')](_0xee7647)&&_0xe7fb('0xeb')!==typeof _0xee7647){return;}if(_['isUndefined'](_0xf9bb70)&&_0xe7fb('0xeb')!==typeof _0xf9bb70){return;}switch(_0xf9bb70[_0xe7fb('0xec')]){case'0':ut[_0xe7fb('0xed')](_0x5b9568,0x0,_0xe7fb('0x9a'));rpcDb[_0xe7fb('0xee')](_0x5b9568,_0xe7fb('0xef'));break;case'3':ut[_0xe7fb('0xed')](_0x5b9568,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x5b9568,_0xe7fb('0xf0'));break;case'5':ut[_0xe7fb('0xed')](_0x5b9568,0x5,'Busy');rpcDb[_0xe7fb('0xee')](_0x5b9568,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe7fb('0xed')](_0x5b9568,0x8,_0xe7fb('0xf1'));rpcDb[_0xe7fb('0xee')](_0x5b9568,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x5b9568,0x16,_0xe7fb('0xf2'));rpcDb['createAgentHistory'](_0x5b9568,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xe7fb('0xed')](_0x5b9568,0xc,_0xf9bb70[_0xe7fb('0xec')]);rpcDb[_0xe7fb('0xee')](_0x5b9568,_0xe7fb('0xf3'));}ut[_0xe7fb('0x77')](_0xee7647,_0xe7fb('0xf4'));logger[_0xe7fb('0x5c')](_0xe7fb('0xf5'),_0x5b9568[_0xe7fb('0xab')],_0xe7fb('0xac'),_0xee7647[_0xe7fb('0x54')],_0xe7fb('0x70'),_0xee7647[_0xe7fb('0x4d')]);delete this[_0xe7fb('0x18')][_0x5b9568[_0xe7fb('0xab')]];};Preview[_0xe7fb('0x67')][_0xe7fb('0xf6')]=function(_0x249d6f,_0x8fe64,_0x48c4e0,_0x405c1b,_0x19ebe2){var _0x3406ed=this;return new BPromise(function(_0x1631cc,_0x50fd45){if(_[_0xe7fb('0x6e')](_0x8fe64)||_[_0xe7fb('0x6e')](_0x8fe64[_0xe7fb('0xf7')])||_[_0xe7fb('0x6e')](_0x8fe64[_0xe7fb('0xf7')]['phone'])||_['isNil'](_0x8fe64[_0xe7fb('0x74')])){_0x50fd45(ut['message']('Contact\x20is\x20undefined',_0x405c1b,_0x19ebe2));return;}var _0x5cf367=uuid['v4']();var _0x691e8a=_0x3406ed['campaignsPreview'][_0x8fe64['Queue']['name']];var _0x2ccf71=_0x48c4e0?_0x3406ed[_0xe7fb('0x19')][_0x48c4e0]['id']:undefined;_0x3406ed[_0xe7fb('0x18')][_0x5cf367]=new Action(_0x8fe64,_0x691e8a,_0x5cf367,_0x48c4e0,_0x2ccf71);var _0x1ea519=_0x3406ed[_0xe7fb('0x18')][_0x5cf367];_0x1ea519[_0xe7fb('0xa5')]=_0x405c1b;_0x1ea519['activeContact']=_0x19ebe2;_0x1ea519['lookAgent']=_0x48c4e0;if(_[_0xe7fb('0xf8')](_0x249d6f)){_0x3406ed['execCall'](_0x1ea519,_0x691e8a,_0x8fe64,_0x48c4e0)[_0xe7fb('0x80')](function(_0x19fa38){logger[_0xe7fb('0x5c')](_0xe7fb('0xf9'),_0xe7fb('0xfa')+_0x1ea519[_0xe7fb('0x71')]+'\x20IdHopper:\x20'+_0x1ea519['idContact'],JSON[_0xe7fb('0x58')](_0x19fa38));ami[_0xe7fb('0x28')](_0xe7fb('0xfb'),ut[_0xe7fb('0x9c')](_0x1ea519,_0xe7fb('0xfc'),_0x3406ed[_0xe7fb('0x15')][_0x1ea519['queue']]));_0x1631cc(ut[_0xe7fb('0x4c')](_0xe7fb('0xfd')));})[_0xe7fb('0x76')](function(_0x33d638){ut[_0xe7fb('0x64')]('[Preview][execCall][failure]',_0x33d638);_0x50fd45(ut[_0xe7fb('0x4c')](_0xe7fb('0xfe'),_0x405c1b,_0x19ebe2));});}else{_0x691e8a[_0xe7fb('0x39')]+=0x1;ut['logBlacklist'](_0x1ea519);rpcDb['createHistory'](_0x1ea519,'[Blacklist][error]');delete _0x3406ed[_0xe7fb('0x18')][_0x5cf367];_0x50fd45(ut['message']('Contact\x20in\x20black\x20List',_0x405c1b,_0x19ebe2));}});};Preview[_0xe7fb('0x67')]['isTrunkReachable']=function(_0x8a3659){return!_[_0xe7fb('0x6e')](_0x8a3659)&&!_[_0xe7fb('0x6e')](_0x8a3659[_0xe7fb('0x54')])&&!_[_0xe7fb('0x6e')](_0x8a3659[_0xe7fb('0x55')])&&_0x8a3659[_0xe7fb('0x55')]&&!_['isNil'](this[_0xe7fb('0x17')][util[_0xe7fb('0x59')]('SIP/%s',_0x8a3659[_0xe7fb('0x54')])])&&!_[_0xe7fb('0x6e')](this[_0xe7fb('0x17')][util[_0xe7fb('0x59')](_0xe7fb('0xff'),_0x8a3659[_0xe7fb('0x54')])]['status'])&&(this[_0xe7fb('0x17')][util[_0xe7fb('0x59')](_0xe7fb('0xff'),_0x8a3659[_0xe7fb('0x54')])]['status']===_0xe7fb('0x100')||this[_0xe7fb('0x17')][util[_0xe7fb('0x59')]('SIP/%s',_0x8a3659[_0xe7fb('0x54')])][_0xe7fb('0x101')]===_0xe7fb('0x102'));};Preview['prototype'][_0xe7fb('0x103')]=function(_0xabb003,_0x549714){var _0x2e92a2=this;return new BPromise(function(_0x1910c5,_0x534e74){_0x2e92a2[_0xe7fb('0x104')](_0xabb003,_0x549714)[_0xe7fb('0x80')](function(_0x1fc31b){_0x1910c5(_[_0xe7fb('0x105')](_0x1fc31b,[_0xe7fb('0x4c')]));})['catch'](function(_0x4faf4f){if(_0x4faf4f[_0xe7fb('0x106')]){rpcDb[_0xe7fb('0x107')](_0xabb003);}if(_0x4faf4f[_0xe7fb('0x55')]){rpcDb[_0xe7fb('0x108')](_0xabb003);}_0x534e74(_[_0xe7fb('0x105')](_0x4faf4f,['message']));});});};Preview[_0xe7fb('0x67')][_0xe7fb('0x104')]=function(_0x57da7b,_0x49864d){var _0x23724a=this;return new BPromise(function(_0x3198ec,_0xb939a6){var _0xfd5211,_0x25f19b;rpcDb['getContactPreview'](_0x57da7b)[_0xe7fb('0x80')](function(_0x157781){if(!_[_0xe7fb('0x6e')](_0x157781[0x0])){_0x25f19b=_0x157781[0x0]['recallme']?![]:!![];_0xfd5211=_0x157781[0x0][_0xe7fb('0x109')]?!![]:![];_0xfd5211=_0x49864d?!![]:_0xfd5211;}var _0x42fe35=_0x23724a['validateContact'](_0x157781);if(_0x42fe35[_0xe7fb('0x10a')]){rpcDb[_0xe7fb('0x10b')](_[_0xe7fb('0x105')](_0x157781[0x0],[_0xe7fb('0x74'),'Contact.phone']))['then'](function(_0x241ec7){_0x23724a[_0xe7fb('0xf6')](_0x241ec7,_0x157781[0x0],_0x49864d,_0x25f19b,_0xfd5211)[_0xe7fb('0x80')](function(_0x5b0851){_0x3198ec(_0x5b0851);})[_0xe7fb('0x76')](function(_0x45de5f){_0xb939a6(_0x45de5f);});})[_0xe7fb('0x76')](function(_0x49fb4b){ut[_0xe7fb('0x64')](_0xe7fb('0x10c'),_0x49fb4b);_0xb939a6(ut[_0xe7fb('0x4c')]('Call\x20unsuccessful',_0x25f19b,_0xfd5211));});}else{_0xb939a6(ut[_0xe7fb('0x4c')](_0x42fe35[_0xe7fb('0x4c')],_0x25f19b,_0xfd5211));}})[_0xe7fb('0x76')](function(_0x15c318){ut[_0xe7fb('0x64')](_0xe7fb('0x10d'),_0x15c318);_0xb939a6(ut[_0xe7fb('0x4c')](_0xe7fb('0x10e'),![],!![]));});});};Preview['prototype'][_0xe7fb('0x10f')]=function(_0xd91ac9){if(_['isNil'](_0xd91ac9)||_['isEmpty'](_0xd91ac9)||!_[_0xe7fb('0x6e')](_0xd91ac9[0x0][_0xe7fb('0x84')])&&_[_0xe7fb('0x6e')](_0xd91ac9[0x0][_0xe7fb('0x84')][_0xe7fb('0x54')])){ut[_0xe7fb('0x64')](_0xe7fb('0x110'),_0xd91ac9);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2b416d=this[_0xe7fb('0x15')][_0xd91ac9[0x0][_0xe7fb('0x6f')][_0xe7fb('0x54')]];_0x2b416d[_0xe7fb('0x4c')]=_0xe7fb('0x95');if(_[_0xe7fb('0x6e')](_0x2b416d)){ut['logger'](_0xe7fb('0x111'),_0x2b416d);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xe7fb('0x93')](_0x2b416d['Trunk'])){ut['logger'](_0xe7fb('0x112'),_0xe7fb('0x113')+_0x2b416d[_0xe7fb('0x54')]+_0xe7fb('0x114'));if(!this[_0xe7fb('0x93')](_0x2b416d[_0xe7fb('0x115')])){ut[_0xe7fb('0x64')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2b416d[_0xe7fb('0x54')]+_0xe7fb('0x116'));return{'isValid':![],'message':_0xe7fb('0x117')};}}if(!ut[_0xe7fb('0x92')](_0x2b416d[_0xe7fb('0x33')])){ut[_0xe7fb('0x64')](_0xe7fb('0x118'),_0x2b416d['name']+_0xe7fb('0x119'));return{'isValid':![],'message':_0xe7fb('0x113')+_0x2b416d[_0xe7fb('0x54')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xe7fb('0x11a')};};Preview['prototype']['execCall']=function(_0x4930c6,_0x1a3d44,_0x30763c,_0x534ace){var _0x222f15=this;return new BPromise(function(_0x31ba96,_0x4f5fd1){var _0x5111ac=_0x4930c6[_0xe7fb('0xab')];var _0x54cda5=_0x222f15[_0xe7fb('0x93')](_0x1a3d44['Trunk'])?util[_0xe7fb('0x59')](_0xe7fb('0x11b'),_0x1a3d44['Trunk']['name'],_[_0xe7fb('0x6e')](_0x1a3d44['dialPrefix'])?'':_0x1a3d44['dialPrefix']['trim']()||'',_0x1a3d44[_0xe7fb('0x11c')]>0x0?_0x30763c[_0xe7fb('0xf7')]['phone'][_0xe7fb('0x11d')](_0x1a3d44['dialCutDigit']):_0x30763c[_0xe7fb('0xf7')][_0xe7fb('0x11e')]):util[_0xe7fb('0x59')](_0xe7fb('0x11b'),_[_0xe7fb('0x6e')](_0x1a3d44[_0xe7fb('0x115')])?_0x1a3d44[_0xe7fb('0x53')][_0xe7fb('0x54')]:_0x1a3d44[_0xe7fb('0x115')][_0xe7fb('0x54')],_[_0xe7fb('0x6e')](_0x1a3d44[_0xe7fb('0x11f')])?'':_0x1a3d44[_0xe7fb('0x11f')]['trim']()||'',_0x1a3d44[_0xe7fb('0x11c')]>0x0?_0x30763c[_0xe7fb('0xf7')]['phone']['substring'](_0x1a3d44[_0xe7fb('0x11c')]):_0x30763c['Contact'][_0xe7fb('0x11e')]);var _0x1daccd=_0x222f15[_0xe7fb('0x93')](_0x1a3d44[_0xe7fb('0x53')])?ut[_0xe7fb('0x120')](_0x1a3d44['Trunk']['callerid'],_0x1a3d44[_0xe7fb('0x35')],_0x1a3d44[_0xe7fb('0x121')]>0x0?ut[_0xe7fb('0x122')](_0x1a3d44[_0xe7fb('0x36')],_0x1a3d44[_0xe7fb('0x121')]):_0x1a3d44['dialOriginateCallerIdNumber']):ut[_0xe7fb('0x120')](_['isNil'](_0x1a3d44[_0xe7fb('0x115')])?_0x1a3d44[_0xe7fb('0x53')]['callerid']:_0x1a3d44['TrunkBackup']['callerid'],_0x1a3d44[_0xe7fb('0x35')],_0x1a3d44[_0xe7fb('0x121')]>0x0?ut['getCallerIdRandom'](_0x1a3d44['dialOriginateCallerIdNumber'],_0x1a3d44[_0xe7fb('0x121')]):_0x1a3d44[_0xe7fb('0x36')]);if(_0x1daccd){_0x4930c6['originatecalleridname']=ut['extractCalleridName'](_0x1daccd);_0x4930c6[_0xe7fb('0x123')]=ut[_0xe7fb('0x124')](_0x1daccd);}var _0x4570f6=ut[_0xe7fb('0x125')](_0x1a3d44,_0x30763c,_0x54cda5,_0x1daccd,_0x5111ac,_0x4930c6);_['merge'](_0x4930c6,ut[_0xe7fb('0x126')](_0x4570f6));_0x4930c6[_0xe7fb('0x127')]=moment()[_0xe7fb('0x59')](_0xe7fb('0x88'));ami[_0xe7fb('0x75')](ut['variablesAction'](_0x4930c6,_0x1a3d44,_0x4570f6,_0x4930c6['activeContact'],_0x534ace))[_0xe7fb('0x80')](function(_0x3723a1){_0x1a3d44[_0xe7fb('0x4d')]+=0x1;logger[_0xe7fb('0x5c')](_0xe7fb('0x128'),_0x5111ac,'\x20Queue',_0x1a3d44[_0xe7fb('0x54')],'originated:\x20',_0x1a3d44['originated']);_0x31ba96(_0x3723a1);})[_0xe7fb('0x76')](function(_0xfa7f16){ut[_0xe7fb('0xed')](_0x4930c6,0xe,_0xe7fb('0x129'));rpcDb['createAgentHistory'](_0x4930c6,_0xe7fb('0x12a'));_0x4f5fd1(_0xfa7f16);});});};Preview['prototype']['syncNewExten']=function(_0x435788){if(this[_0xe7fb('0x18')][_0x435788[_0xe7fb('0xa7')]]){this[_0xe7fb('0x18')][_0x435788[_0xe7fb('0xa7')]]['channel']=_0x435788['channel'];}};Preview[_0xe7fb('0x67')]['syncOriginateResponse']=function(_0x4e987d){var _0x2741a9=this;var _0x5763dd=this['actions'][_0x4e987d[_0xe7fb('0x12b')]];if(_0x5763dd){if(_0x5763dd[_0xe7fb('0x12c')]&&this[_0xe7fb('0x19')][_0x5763dd[_0xe7fb('0x12c')]]){ut[_0xe7fb('0x12d')](_0x5763dd,this['agents'][_0x5763dd[_0xe7fb('0x12c')]]['name'],this['agents'][_0x5763dd[_0xe7fb('0x12c')]]['id']);}var _0x28274b=_[_0xe7fb('0x12e')](_0x5763dd);_0x28274b[_0xe7fb('0xa9')]=moment()[_0xe7fb('0x59')](_0xe7fb('0x88'));var _0x39cef5=_0x2741a9['campaignsPreview'][_0x5763dd['queue']];if(ut[_0xe7fb('0x12f')](_0x4e987d['response'])){if(_0x5763dd[_0xe7fb('0xa5')]){rpcDb['unlockContact'](_0x5763dd[_0xe7fb('0x130')]);}if(_0x5763dd['activeContact']){rpcDb[_0xe7fb('0x108')](_0x5763dd[_0xe7fb('0x130')]);}ami['emit'](_0xe7fb('0x131'),ut[_0xe7fb('0x9c')](_0x5763dd,_0xe7fb('0x132'),this[_0xe7fb('0x15')][_0x5763dd['queue']]));this[_0xe7fb('0xe9')](_0x28274b,_0x39cef5,_0x4e987d);}else{_0x5763dd[_0xe7fb('0x127')]=moment()[_0xe7fb('0x59')](_0xe7fb('0x88'));ut[_0xe7fb('0xed')](_0x28274b,0x4,'Answer');rpcDb[_0xe7fb('0xee')](_0x28274b,_0xe7fb('0x133'));}}};Preview[_0xe7fb('0x67')][_0xe7fb('0x1d')]=function(_0x713385){var _0x3f71f9=this;var _0x3c7b4f=this[_0xe7fb('0x18')][_0x713385[_0xe7fb('0xa7')]];var _0x3edf30;if(_0x3c7b4f){_0x3edf30=this[_0xe7fb('0x15')][_0x3c7b4f[_0xe7fb('0x71')]];logger[_0xe7fb('0x5c')](_0xe7fb('0x134'),_0x713385[_0xe7fb('0xa7')],'\x20Queue',_0x3edf30['name'],_0xe7fb('0xad'),_0x3edf30[_0xe7fb('0x60')]);}if(this[_0xe7fb('0x18')][_0x713385[_0xe7fb('0xa7')]]&&_0x713385[_0xe7fb('0xa7')]!==_0x713385[_0xe7fb('0xab')]){if(_0x713385[_0xe7fb('0x135')]==='16'&&this[_0xe7fb('0x18')][_0x713385['linkedid']][_0xe7fb('0x72')]){this[_0xe7fb('0x96')](_0x713385,_0x713385[_0xe7fb('0xa7')],_0x713385[_0xe7fb('0x135')]);}else if(this[_0xe7fb('0x18')][_0x713385[_0xe7fb('0xa7')]]['dialAnswer']){logger[_0xe7fb('0x5c')](_0xe7fb('0x136'),_0x713385['linkedid'],_0x713385[_0xe7fb('0x135')],'\x20Queue',_0x3edf30[_0xe7fb('0x54')],'pTalking:\x20',_0x3edf30[_0xe7fb('0x60')]);this[_0xe7fb('0x96')](_0x713385,_0x713385['linkedid'],_0x713385[_0xe7fb('0x135')]);}}else if(_0x3c7b4f&&_[_0xe7fb('0x6e')](_0x3c7b4f['statedesc'])&&_0x3edf30['dialQueueProject']&&_0x713385['linkedid']===_0x713385['uniqueid']&&_[_0xe7fb('0x6e')](_0x713385[_0xe7fb('0xec')])&&_0x713385[_0xe7fb('0x135')]==='16'&&_0x713385[_0xe7fb('0x137')]==='6'&&_[_0xe7fb('0xea')](_0x3c7b4f[_0xe7fb('0x138')])){if(_0x3c7b4f['unlockAgent']){rpcDb[_0xe7fb('0x107')](_0x3c7b4f[_0xe7fb('0x130')]);}if(_0x3c7b4f[_0xe7fb('0xa6')]){rpcDb['disableContact'](_0x3c7b4f[_0xe7fb('0x130')]);}_0x713385['reason']='22';this[_0xe7fb('0xe9')](_0x3c7b4f,_0x3edf30,_0x713385);}else if(_0x3c7b4f&&_0x3c7b4f['transfer']){if(_0x713385['cause']==='16'&&this[_0xe7fb('0x18')][_0x713385[_0xe7fb('0xa7')]][_0xe7fb('0x72')]){logger[_0xe7fb('0x5c')]('[syncHangup][talking][transfer]',_0x713385[_0xe7fb('0xa7')],_0x713385[_0xe7fb('0x135')],_0xe7fb('0xac'),_0x3edf30[_0xe7fb('0x54')],_0xe7fb('0xad'),_0x3edf30[_0xe7fb('0x60')]);this[_0xe7fb('0x96')](_0x713385,_0x713385[_0xe7fb('0xa7')],_0x713385[_0xe7fb('0x135')]);}else if(this[_0xe7fb('0x18')][_0x713385[_0xe7fb('0xa7')]][_0xe7fb('0x72')]){logger[_0xe7fb('0x5c')](_0xe7fb('0x136'),_0x713385[_0xe7fb('0xa7')],_0x713385[_0xe7fb('0x135')],_0xe7fb('0xac'),_0x3edf30['name'],_0xe7fb('0xad'),_0x3edf30[_0xe7fb('0x60')]);this['callProgressDetectingCustomer'](_0x713385,_0x713385[_0xe7fb('0xa7')],_0x713385[_0xe7fb('0x135')]);}}};Preview[_0xe7fb('0x67')]['syncDialEnd']=function(_0x1603b1){if(this[_0xe7fb('0x18')][_0x1603b1[_0xe7fb('0xe8')]]&&_0x1603b1[_0xe7fb('0xe8')]!==_0x1603b1[_0xe7fb('0x139')]){this[_0xe7fb('0x96')](_0x1603b1,_0x1603b1['destlinkedid'],_0x1603b1[_0xe7fb('0xde')]);}};Preview[_0xe7fb('0x67')][_0xe7fb('0x13a')]=function(_0x59baa5){if(this[_0xe7fb('0x18')][_0x59baa5[_0xe7fb('0xa7')]]&&_0x59baa5[_0xe7fb('0xa7')]!==_0x59baa5[_0xe7fb('0xab')]&&!this['actions'][_0x59baa5[_0xe7fb('0xa7')]][_0xe7fb('0x72')]){if(_0x59baa5[_0xe7fb('0x135')]==='1'){this[_0xe7fb('0x96')](_0x59baa5,_0x59baa5['linkedid'],_0x59baa5['cause']);}}};Preview[_0xe7fb('0x67')][_0xe7fb('0x13b')]=function(_0xe99f5c,_0x1e29fc,_0x4d0aa0){if(this['actions'][_0xe99f5c]){if(_[_0xe7fb('0x6e')](this['actions'][_0xe99f5c][_0xe7fb('0x13c')])){this['actions'][_0xe99f5c][_0xe7fb('0x13c')]={};}this[_0xe7fb('0x18')][_0xe99f5c][_0xe7fb('0x13c')][_0x1e29fc]=_0x4d0aa0;}};Preview[_0xe7fb('0x67')][_0xe7fb('0x13d')]=function(_0x1bf5cd){try{if(!_[_0xe7fb('0x6e')](_0x1bf5cd)){if(ut[_0xe7fb('0x13e')](_[_0xe7fb('0x13f')](_0x1bf5cd[_0xe7fb('0x140')])[0x0])){this[_0xe7fb('0x13b')](_0x1bf5cd[_0xe7fb('0xab')],_[_0xe7fb('0x13f')](_0x1bf5cd[_0xe7fb('0x140')])[0x0],_0x1bf5cd['value']);}}}catch(_0x23a49e){logger[_0xe7fb('0x141')](_0xe7fb('0x142'),util[_0xe7fb('0x143')](_0x23a49e,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x450ee2){if(_0x450ee2){if(this[_0xe7fb('0x18')][_0x450ee2[_0xe7fb('0x144')]]){this[_0xe7fb('0x18')][_0x450ee2['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xe7fb('0x67')][_0xe7fb('0x26')]=function(_0x588a20){if(_0x588a20){if(this[_0xe7fb('0x18')][_0x588a20[_0xe7fb('0x145')]]){this[_0xe7fb('0x18')][_0x588a20[_0xe7fb('0x145')]][_0xe7fb('0x138')]=!![];}}};module[_0xe7fb('0x146')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b666330..230d044 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc325=['getContactPreview','[getContactPreview]\x20','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x429c3e,_0x4c24c2){var _0x13dff1=function(_0x39bbf9){while(--_0x39bbf9){_0x429c3e['push'](_0x429c3e['shift']());}};_0x13dff1(++_0x4c24c2);}(_0xc325,0x181));var _0x5c32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc325[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x5c32('0x0'));var BPromise=require(_0x5c32('0x1'));var logger=require(_0x5c32('0x2'))('preview');var _=require(_0x5c32('0x3'));var cmHopper=require(_0x5c32('0x4'));var cmHopperFinal=require(_0x5c32('0x5'));var cmHopperHistory=require(_0x5c32('0x6'));var cmHopperBlack=require(_0x5c32('0x7'));var voiceQueueRt=require(_0x5c32('0x8'));var agentReportPreview=require(_0x5c32('0x9'));var voiceQueueReport=require(_0x5c32('0xa'));function loggerCatch(_0x1d76bc){return function(_0x5264fc){logger['error'](_0x1d76bc,util[_0x5c32('0xb')](_0x5264fc,{'showHidden':![],'depth':null}));};}function create(_0x3af6b1){return BPromise[_0x5c32('0xc')]()['then'](cmHopperHistory[_0x5c32('0xd')](_0x3af6b1))[_0x5c32('0xe')](loggerCatch(_0x5c32('0xf')));}function createAgent(_0x2059ff){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](agentReportPreview[_0x5c32('0xd')](_0x2059ff))[_0x5c32('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x55c30c){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x11')](_0x55c30c,!![]))['catch'](loggerCatch(_0x5c32('0x12')));}exports[_0x5c32('0x13')]=function(_0x5797f0){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopperBlack[_0x5c32('0x13')](_0x5797f0))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x14')));};exports[_0x5c32('0x15')]=function(_0x178369){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x15')](_0x178369))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x16')));};exports[_0x5c32('0xd')]=function(_0x1953ec,_0x19dbf9){create(_0x1953ec)[_0x5c32('0xe')](loggerCatch(_0x19dbf9));moveContact(_0x1953ec)['catch'](loggerCatch(_0x19dbf9));};exports['createAgentHistory']=function(_0x401e87,_0x72603a){createAgent(_0x401e87)[_0x5c32('0xe')](loggerCatch(_0x72603a));};exports[_0x5c32('0x17')]=function(_0x2211fc,_0x335af6){create(_0x2211fc)[_0x5c32('0xe')](loggerCatch(_0x335af6));};exports['createCustomerFinal']=function(_0x2a0273,_0x3f995a){moveContact(_0x2a0273)[_0x5c32('0xe')](loggerCatch(_0x3f995a));};exports['rescheduleContact']=function(_0x40ac51,_0xe48ca2,_0x3fd3ad){if(_0xe48ca2){_0x40ac51[_0x5c32('0x18')]=null;}if(_0x3fd3ad){_0x40ac51[_0x5c32('0x19')]=![];}return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x1a')](_0x40ac51))['catch'](loggerCatch(_0x5c32('0x1b')));};exports['countReScheduled']=function(_0x1cd063){return BPromise[_0x5c32('0xc')]()['then'](cmHopper[_0x5c32('0x1c')](_0x1cd063))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x1d')));};exports[_0x5c32('0x1e')]=function(_0x53ddab){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x1e')]({'UserId':null},_0x53ddab,0x1))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x1f')));};exports[_0x5c32('0x20')]=function(_0xbc77f1){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x1e')]({'active':![]},_0xbc77f1,0x1))['catch'](loggerCatch(_0x5c32('0x21')));};exports[_0x5c32('0x22')]=function(_0x6120db){var _0x4737ea={};_0x4737ea['type']=_0x6120db['type'];_0x4737ea[_0x5c32('0x23')]=_0x6120db[_0x5c32('0x23')];_0x4737ea['calleridnum']=_0x6120db[_0x5c32('0x24')];_0x4737ea[_0x5c32('0x25')]=_0x6120db[_0x5c32('0x25')];_0x4737ea[_0x5c32('0x26')]=_0x6120db[_0x5c32('0x26')];_0x4737ea[_0x5c32('0x27')]=_0x6120db[_0x5c32('0x28')];_0x4737ea[_0x5c32('0x29')]=_0x6120db['answertime'];_0x4737ea[_0x5c32('0x2a')]=0x1;_0x4737ea['queuecallercompleteAt']=_0x6120db['endtime'];_0x4737ea['connectedlinename']=_0x6120db[_0x5c32('0x2b')];_0x4737ea[_0x5c32('0x2c')]=_0x5c32('0x2d');_0x4737ea[_0x5c32('0x2e')]='xcally-motion-preview';_0x4737ea[_0x5c32('0x2f')]=0x0;_0x4737ea[_0x5c32('0x30')]=0x1;_0x4737ea[_0x5c32('0x31')]=_0x6120db[_0x5c32('0x2b')];_0x4737ea[_0x5c32('0x32')]=_0x5c32('0x33');return BPromise[_0x5c32('0xc')]()['then'](voiceQueueReport[_0x5c32('0x34')](_0x4737ea))['catch'](loggerCatch(_0x5c32('0x35')));};exports['getContactRecallMe']=function(_0x2e09f8,_0x2e59bb){return BPromise[_0x5c32('0xc')]()[_0x5c32('0x10')](cmHopper[_0x5c32('0x36')](_0x2e09f8,_0x2e59bb))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x37')));};exports[_0x5c32('0x38')]=function(_0x495c55){return BPromise[_0x5c32('0xc')]()['then'](cmHopper['rescheduleContact'](_0x495c55,!![],!![]))[_0x5c32('0xe')](loggerCatch(_0x5c32('0x39')));}; \ No newline at end of file +var _0xe506=['[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId'];(function(_0x3aaf1f,_0x5de2f8){var _0x185f71=function(_0x3e5866){while(--_0x3e5866){_0x3aaf1f['push'](_0x3aaf1f['shift']());}};_0x185f71(++_0x5de2f8);}(_0xe506,0x19d));var _0x6e50=function(_0x396ed4,_0x5f4574){_0x396ed4=_0x396ed4-0x0;var _0x3891a=_0xe506[_0x396ed4];return _0x3891a;};'use strict';var util=require(_0x6e50('0x0'));var BPromise=require(_0x6e50('0x1'));var logger=require(_0x6e50('0x2'))(_0x6e50('0x3'));var _=require(_0x6e50('0x4'));var cmHopper=require(_0x6e50('0x5'));var cmHopperFinal=require(_0x6e50('0x6'));var cmHopperHistory=require(_0x6e50('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x6e50('0x8'));var agentReportPreview=require(_0x6e50('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x34a461){return function(_0x88198a){logger[_0x6e50('0xa')](_0x34a461,util[_0x6e50('0xb')](_0x88198a,{'showHidden':![],'depth':null}));};}function create(_0x41910f){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopperHistory[_0x6e50('0xe')](_0x41910f))['catch'](loggerCatch(_0x6e50('0xf')));}function createAgent(_0x3a5754){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](agentReportPreview[_0x6e50('0xe')](_0x3a5754))['catch'](loggerCatch(_0x6e50('0xf')));}function moveContact(_0x427dd0){return BPromise[_0x6e50('0xc')]()['then'](cmHopper[_0x6e50('0x10')](_0x427dd0,!![]))[_0x6e50('0x11')](loggerCatch(_0x6e50('0x12')));}exports['checkIsBlackList']=function(_0x19a5b9){return BPromise['resolve']()[_0x6e50('0xd')](cmHopperBlack[_0x6e50('0x13')](_0x19a5b9))['catch'](loggerCatch(_0x6e50('0x14')));};exports[_0x6e50('0x15')]=function(_0x3387fe){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper[_0x6e50('0x15')](_0x3387fe))[_0x6e50('0x11')](loggerCatch('[getContactPreview]\x20'));};exports[_0x6e50('0xe')]=function(_0x57421e,_0x329367){create(_0x57421e)[_0x6e50('0x11')](loggerCatch(_0x329367));moveContact(_0x57421e)[_0x6e50('0x11')](loggerCatch(_0x329367));};exports[_0x6e50('0x16')]=function(_0x54cf5e,_0x176ae5){createAgent(_0x54cf5e)['catch'](loggerCatch(_0x176ae5));};exports[_0x6e50('0x17')]=function(_0x118da8,_0x1a71d4){create(_0x118da8)[_0x6e50('0x11')](loggerCatch(_0x1a71d4));};exports[_0x6e50('0x18')]=function(_0x5aa62e,_0x9bbeee){moveContact(_0x5aa62e)['catch'](loggerCatch(_0x9bbeee));};exports[_0x6e50('0x19')]=function(_0x164cd9,_0x120ecf,_0x169bee){if(_0x120ecf){_0x164cd9[_0x6e50('0x1a')]=null;}if(_0x169bee){_0x164cd9['active']=![];}return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper['rescheduleContact'](_0x164cd9))['catch'](loggerCatch(_0x6e50('0x1b')));};exports['countReScheduled']=function(_0x964a90){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper[_0x6e50('0x1c')](_0x964a90))[_0x6e50('0x11')](loggerCatch('[countReScheduled]\x20'));};exports[_0x6e50('0x1d')]=function(_0x266a3a){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper[_0x6e50('0x1d')]({'UserId':null},_0x266a3a,0x1))[_0x6e50('0x11')](loggerCatch(_0x6e50('0x1e')));};exports[_0x6e50('0x1f')]=function(_0x49ad93){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper[_0x6e50('0x1d')]({'active':![]},_0x49ad93,0x1))[_0x6e50('0x11')](loggerCatch(_0x6e50('0x20')));};exports['crateCustomerReportQueue']=function(_0x13bc44){var _0xda8580={};_0xda8580[_0x6e50('0x21')]=_0x13bc44[_0x6e50('0x21')];_0xda8580[_0x6e50('0x22')]=_0x13bc44[_0x6e50('0x22')];_0xda8580[_0x6e50('0x23')]=_0x13bc44[_0x6e50('0x23')];_0xda8580[_0x6e50('0x24')]=_0x13bc44['calleridname'];_0xda8580[_0x6e50('0x25')]=_0x13bc44['queue'];_0xda8580['queuecallerjoinAt']=_0x13bc44[_0x6e50('0x26')];_0xda8580[_0x6e50('0x27')]=_0x13bc44[_0x6e50('0x26')];_0xda8580['queuecallercomplete']=0x1;_0xda8580['queuecallercompleteAt']=_0x13bc44[_0x6e50('0x28')];_0xda8580['connectedlinename']=_0x13bc44[_0x6e50('0x29')];_0xda8580[_0x6e50('0x2a')]=_0x6e50('0x2b');_0xda8580[_0x6e50('0x2c')]=_0x6e50('0x2d');_0xda8580['holdtime']=0x0;_0xda8580[_0x6e50('0x2e')]=0x1;_0xda8580[_0x6e50('0x2f')]=_0x13bc44['membername'];_0xda8580[_0x6e50('0x30')]=_0x6e50('0x31');return BPromise['resolve']()[_0x6e50('0xd')](voiceQueueReport[_0x6e50('0x32')](_0xda8580))[_0x6e50('0x11')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x6e50('0x33')]=function(_0x1215c5,_0x12717b){return BPromise[_0x6e50('0xc')]()[_0x6e50('0xd')](cmHopper[_0x6e50('0x33')](_0x1215c5,_0x12717b))[_0x6e50('0x11')](loggerCatch(_0x6e50('0x34')));};exports[_0x6e50('0x35')]=function(_0x22e276){return BPromise['resolve']()['then'](cmHopper[_0x6e50('0x19')](_0x22e276,!![],!![]))[_0x6e50('0x11')](loggerCatch(_0x6e50('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 3b0268e..9e11f13 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6319=['calleridname','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','UserId','logCustomer','endtime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','channelAgent','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x6319,0xb6));var _0x9631=function(_0x54bd9c,_0xa2ff66){_0x54bd9c=_0x54bd9c-0x0;var _0x5d0af6=_0x6319[_0x54bd9c];return _0x5d0af6;};'use strict';var util=require('util');var _=require(_0x9631('0x0'));var moment=require(_0x9631('0x1'));var logger=require(_0x9631('0x2'))('preview');var ipAgi=process['env'][_0x9631('0x3')]||_0x9631('0x4');function getSeconds(_0x57bf20,_0x400ab6){var _0x58b1bc=moment(_0x57bf20)[_0x9631('0x5')](0x0);var _0x52be31=moment(_0x400ab6)[_0x9631('0x5')](0x0);return _0x58b1bc[_0x9631('0x6')](_0x52be31,_0x9631('0x7'));}exports[_0x9631('0x8')]=function(_0x255564){return function(_0x4b5ce6){logger[_0x9631('0x9')](_0x255564,util[_0x9631('0xa')](_0x4b5ce6,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xc37751,_0x3b7998){logger[_0x9631('0xb')](_0xc37751,util[_0x9631('0xa')](_0x3b7998,{'showHidden':![],'depth':null}));};exports[_0x9631('0xc')]=function(_0x1a729a,_0x4c4de3){logger[_0x9631('0x9')](_0x1a729a,util[_0x9631('0xa')](_0x4c4de3,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4e5556){return function(_0xf5d426){logger[_0x9631('0xb')](_0x4e5556,util[_0x9631('0xa')](_0xf5d426,{'showHidden':![],'depth':null}));};};exports[_0x9631('0xd')]=function(_0x99dec7,_0x379535,_0x3e5741){return{'message':_0x99dec7,'unlock':_0x379535,'active':_0x3e5741};};exports[_0x9631('0xe')]=function(_0x3ead90,_0x9ba03,_0xbf5f6a){if(!_[_0x9631('0xf')](_0xbf5f6a)&&_0x9631('0x10')===typeof _0xbf5f6a&&!_[_0x9631('0x11')](_0xbf5f6a)){if(!_[_0x9631('0xf')](_0x9ba03)&&_0x9631('0x10')===typeof _0x9ba03&&!_['isEmpty'](_0x9ba03)){return util[_0x9631('0x12')]('\x22%s\x22\x20<%s>',_0x9ba03,_0xbf5f6a);}return util[_0x9631('0x12')](_0x9631('0x13'),_0xbf5f6a,_0xbf5f6a);}if(!_['isUndefined'](_0x3ead90)&&'string'===typeof _0x3ead90&&!_[_0x9631('0x11')](_0x3ead90)){return _0x3ead90;}return _0x9631('0x14');};exports['isActive']=function(_0x15f889){if(_[_0x9631('0x15')](_0x15f889)){return![];}return _0x15f889;};exports[_0x9631('0x16')]=function(_0x55ec0b,_0x1292cb,_0x125368,_0x408e77,_0x51bb9f,_0x2b2b92){var _0x4f472c={'XMD-QUEUE':_0x1292cb['Queue']?_0x1292cb[_0x9631('0x17')]['name']:'','XMD-CALLERID':_0x408e77,'XMD-CALLERID-PREVIEW':_0x2b2b92?util[_0x9631('0x12')](_0x9631('0x13'),_0x2b2b92['calleridname'],_0x2b2b92[_0x9631('0x18')]):_0x408e77,'XMD-DIALID':_0x51bb9f,'XMD-CONTACTID':_0x1292cb[_0x9631('0x19')],'XMD-CDRTYPE':_0x9631('0x1a'),'CALLERID(all)':_0x408e77,'XMD-VOICEQUEUEID':_0x1292cb[_0x9631('0x1b')],'XMD-DIALCHANNEL':_0x125368,'XMD-DIALTIMEOUT':_0x55ec0b[_0x9631('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x9631('0x1d'),_0x55ec0b[_0x9631('0x1e')]?'g':'',_[_0x9631('0x11')](_0x55ec0b[_0x9631('0x1f')])?'':_0x9631('0x20')),'XMD-DIALURL':_0x55ec0b[_0x9631('0x21')]||'','XMD-AGI':_0x55ec0b[_0x9631('0x22')]?util[_0x9631('0x12')](_0x9631('0x23'),ipAgi,_0x55ec0b[_0x9631('0x22')]):_0x9631('0x24'),'XMD-AGIAFTER':_0x55ec0b[_0x9631('0x1e')]?util[_0x9631('0x12')](_0x9631('0x23'),ipAgi,_0x55ec0b['dialQueueProject2']):_0x9631('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2b2b92?_0x2b2b92[_0x9631('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x2b2b92?_0x2b2b92[_0x9631('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x9631('0x27')};if(!_['isEmpty'](_0x55ec0b['monitor_format'])){_0x4f472c[util[_0x9631('0x12')]('%s',_0x9631('0x28'))]=_0x55ec0b['monitor_format'];_0x4f472c[util['format']('%s',_0x9631('0x29'))]=_0x51bb9f;}if(_0x1292cb&&_0x1292cb['Contact']){for(var _0x40410b in _0x1292cb[_0x9631('0x2a')]){if(_0x1292cb[_0x9631('0x2a')][_0x9631('0x2b')](_0x40410b)){if(!_[_0x9631('0x15')](_0x1292cb[_0x9631('0x2a')][_0x40410b])&&_0x40410b!=='id'&&_0x40410b!==_0x9631('0x2c')&&_0x40410b!==_0x9631('0x2d')&&_0x40410b!==_0x9631('0x2e')){_0x4f472c[util[_0x9631('0x12')]('%s%s',_0x9631('0x2f'),_[_0x9631('0x30')](_0x40410b))]=_0x1292cb['Contact'][_0x40410b];}}}}return _0x4f472c;};exports[_0x9631('0x31')]=function(_0x3fc425){var _0x5871d3={};for(var _0x3a5640 in _0x3fc425){if(_0x3fc425['hasOwnProperty'](_0x3a5640)){_0x5871d3[util[_0x9631('0x12')]('%s',_[_0x9631('0x32')](_0x3a5640))]=_0x3fc425[_0x3a5640];}}return{'variables':_0x5871d3};};exports[_0x9631('0x33')]=function(_0x578a92,_0x20b90d){if(!_[_0x9631('0x15')](_0x578a92)){if(_0x578a92[_0x9631('0x2b')]('originated')){if(_0x578a92[_0x9631('0x34')]>0x0){_0x578a92['originated']-=0x1;}else{logger[_0x9631('0x9')](_0x9631('0x35'),_0x20b90d);}}}else{logger[_0x9631('0x9')](_0x9631('0x36'),_0x20b90d);}};exports['logBlacklist']=function(_0x37675b){var _0x28dc30=moment()['format'](_0x9631('0x37'));_0x37675b[_0x9631('0x38')]=0xd;_0x37675b[_0x9631('0x39')]=_0x9631('0x3a');_0x37675b[_0x9631('0x3b')]=_0x28dc30;_0x37675b[_0x9631('0x3c')]=_0x28dc30;_0x37675b['endtime']=_0x28dc30;};exports[_0x9631('0x3d')]=function(_0x37873a,_0x30ab4d,_0x289d20){var _0xaaab4a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37873a[_0x9631('0x38')]=_0x30ab4d;_0x37873a['statedesc']=_0x289d20;_0x37873a[_0x9631('0x3c')]=_0xaaab4a;_0x37873a[_0x9631('0x3e')]=getSeconds(_0x37873a[_0x9631('0x3c')],_0x37873a['starttime']);};exports[_0x9631('0x3f')]=function(_0xadb501,_0x34ef7b,_0x412b8e){_0xadb501['membername']=_0x34ef7b;_0xadb501[_0x9631('0x40')]=_0x412b8e;};exports[_0x9631('0x41')]=function(_0x4308,_0x56584e,_0x96f394){var _0x1e8e8e=moment()[_0x9631('0x12')](_0x9631('0x37'));_0x4308[_0x9631('0x38')]=_0x56584e;_0x4308[_0x9631('0x39')]=_0x96f394;_0x4308['responsetime']=_0x4308[_0x9631('0x3c')]?_0x4308[_0x9631('0x3c')]:_0x1e8e8e;_0x4308[_0x9631('0x42')]=_0x4308[_0x9631('0x42')]?_0x4308['endtime']:_0x1e8e8e;_0x4308[_0x9631('0x3e')]=getSeconds(_0x4308[_0x9631('0x3c')]||0x0,_0x4308['starttime']||0x0);_0x4308['talktime']=_0x4308[_0x9631('0x43')]?getSeconds(_0x4308[_0x9631('0x42')],_0x4308[_0x9631('0x43')]):0x0;};exports[_0x9631('0x44')]=function(_0x22a8f5){return _0x22a8f5===_0x9631('0x45');};exports[_0x9631('0x46')]=function(_0xd7d74,_0x3b8996,_0x360d3b,_0x501c27,_0x45d352){var _0x17213d=_0x501c27?_0x9631('0x47'):_0xd7d74['calleridname'];_0x17213d=_0x45d352?'BOOKED':_0x17213d;return{'actionid':_0xd7d74[_0x9631('0x48')],'action':_0x9631('0x49'),'channel':_0xd7d74['channelAgent'],'callerid':util[_0x9631('0x12')](_0x9631('0x13'),_0x17213d,_0xd7d74['calleridnum']),'Exten':_0x9631('0x4a'),'Context':_0x9631('0x4b'),'Priority':'1','variable':_0x360d3b,'timeout':(_0x3b8996[_0x9631('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd7d74[_0x9631('0x48')]};};exports[_0x9631('0x4d')]=function(_0x48c57a){return _0x48c57a[_0x9631('0x4e')]+_0x48c57a['countcongestionretry']+_0x48c57a[_0x9631('0x4f')]+_0x48c57a['countagentrejectretry']+_0x48c57a[_0x9631('0x50')];};exports['cloneAction']=function(_0x4382da){var _0x1cdc26=_['clone'](_0x4382da);_0x1cdc26[_0x9631('0x38')]=0xf;_0x1cdc26[_0x9631('0x39')]='Global';return _0x1cdc26;};exports[_0x9631('0x51')]=function(_0x42d93d,_0x56ae71,_0x1b8eb4){var _0x196c26={};_0x196c26[_0x56ae71]=_0x42d93d[_0x56ae71];_0x196c26[_0x9631('0x52')]=![];_0x196c26[_0x9631('0x53')]=moment()[_0x9631('0x54')](_0x1b8eb4,_0x9631('0x55'))['format'](_0x9631('0x37'));_0x196c26[_0x9631('0x19')]=_0x42d93d[_0x9631('0x19')];_0x196c26[_0x9631('0x56')]=_0x42d93d[_0x9631('0x56')];_0x196c26[_0x9631('0x1b')]=_0x42d93d[_0x9631('0x1b')]||undefined;return _0x196c26;};exports[_0x9631('0x57')]=function(_0x1f38c5,_0x2e2301){if(!_['isNil'](_0x1f38c5)){if(_0x1f38c5[_0x9631('0x58')]>0x0){_0x1f38c5['pTalking']-=0x1;}else{logger[_0x9631('0x9')](_0x2e2301,_0x9631('0x59'));}}else{logger[_0x9631('0x9')](_0x2e2301,_0x9631('0x5a'));}};exports[_0x9631('0x5b')]=function(_0x35aa78){if(_0x35aa78<=0x0){return!![];}return![];};exports[_0x9631('0x5c')]=function(_0x4f54c0,_0x326b64,_0x1afb9a){_0x4f54c0[_0x9631('0x5d')]=_0x326b64;_0x4f54c0[_0x9631('0x5e')]=_0x4f54c0[_0x9631('0x5f')];_0x4f54c0[_0x9631('0x60')]=_0x4f54c0['channelAgent'];_0x4f54c0[_0x9631('0x61')]=_0x9631('0x62');if(_0x1afb9a){_0x4f54c0[_0x9631('0x63')]=_0x1afb9a[_0x9631('0x63')];}return _0x4f54c0;};exports[_0x9631('0x64')]=function(_0x3c7d5c){var _0xe9c5b4={};_0xe9c5b4['queue']=_0x3c7d5c[_0x9631('0x5f')];_0xe9c5b4['interface']=_0x3c7d5c[_0x9631('0x65')];_0xe9c5b4[_0x9631('0x48')]=_0x3c7d5c['uniqueid'];return _0xe9c5b4;};exports['agentReadyId']=function(_0x44f2dc){var _0x186d67=[];for(var _0x38563d in _0x44f2dc){if(_0x44f2dc[_0x9631('0x2b')](_0x38563d)){if(!_[_0x9631('0x15')](_0x44f2dc[_0x38563d])&&_0x44f2dc[_0x38563d]['state']===_0x9631('0x66')&&_0x44f2dc[_0x38563d][_0x9631('0x67')]===_0x9631('0x68')){_0x186d67[_0x9631('0x69')](_0x44f2dc[_0x38563d]['id']);}}}return _0x186d67;};exports[_0x9631('0x6a')]=function(_0xda5772){var _0x34d9bf=moment()[_0x9631('0x5')](0x0);var _0x3fc6ce=moment(_0xda5772)[_0x9631('0x5')](0x0);return _0x34d9bf[_0x9631('0x6')](_0x3fc6ce,_0x9631('0x7'));};exports[_0x9631('0x6b')]=function(_0xeac2ad){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xeac2ad['ContactId'],'ListId':_0xeac2ad['ListId'],'VoiceQueueId':_0xeac2ad[_0x9631('0x1b')]||undefined,'CampaignId':_0xeac2ad[_0x9631('0x6c')]||undefined};};exports[_0x9631('0x6d')]=function(_0x5ce4dd){if(_0x5ce4dd===_0x9631('0x48')||_0x5ce4dd===_0x9631('0x6e')||_0x5ce4dd===_0x9631('0x5f')||_0x5ce4dd===_0x9631('0x6f')||_0x5ce4dd===_0x9631('0x70')||_0x5ce4dd==='dialAnswer'||_0x5ce4dd===_0x9631('0x71')||_0x5ce4dd==='channelAgent'||_0x5ce4dd===_0x9631('0x72')||_0x5ce4dd===_0x9631('0x52')||_0x5ce4dd===_0x9631('0x18')||_0x5ce4dd===_0x9631('0x53')||_0x5ce4dd===_0x9631('0x4e')||_0x5ce4dd===_0x9631('0x73')||_0x5ce4dd===_0x9631('0x4f')||_0x5ce4dd===_0x9631('0x74')||_0x5ce4dd===_0x9631('0x75')||_0x5ce4dd==='callbackuniqueid'||_0x5ce4dd===_0x9631('0x76')||_0x5ce4dd===_0x9631('0x77')||_0x5ce4dd===_0x9631('0x19')||_0x5ce4dd===_0x9631('0x56')||_0x5ce4dd==='UserId'||_0x5ce4dd==='VoiceQueueId'||_0x5ce4dd===_0x9631('0x78')||_0x5ce4dd===_0x9631('0x79')||_0x5ce4dd===_0x9631('0x7a')||_0x5ce4dd==='xmd-phone'||_0x5ce4dd===_0x9631('0x7b')||_0x5ce4dd===_0x9631('0x7c')||_0x5ce4dd==='xmd-dialtimeout'||_0x5ce4dd===_0x9631('0x7d')||_0x5ce4dd===_0x9631('0x7e')||_0x5ce4dd===_0x9631('0x7f')||_0x5ce4dd===_0x9631('0x80')||_0x5ce4dd===_0x9631('0x81')||_0x5ce4dd===_0x9631('0x82')||_0x5ce4dd===_0x9631('0x83')||_0x5ce4dd==='xmd-agi'||_0x5ce4dd===_0x9631('0x84')||_0x5ce4dd==='rtpaudioqosbridged'||_0x5ce4dd===_0x9631('0x85')||_0x5ce4dd==='rtpaudioqosjitterbridged'||_0x5ce4dd===_0x9631('0x86')||_0x5ce4dd===_0x9631('0x87')||_0x5ce4dd===_0x9631('0x88')||_0x5ce4dd==='rtpaudioqosrttbridged'||_0x5ce4dd==='rtpaudioqos'||_0x5ce4dd===_0x9631('0x89')||_0x5ce4dd===_0x9631('0x85')||_0x5ce4dd===_0x9631('0x8a')||_0x5ce4dd===_0x9631('0x86')||_0x5ce4dd==='rtpaudioqoslossbridged'||_0x5ce4dd==='rtpaudioqosrtt'||_0x5ce4dd===_0x9631('0x8b')||_0x5ce4dd===_0x9631('0x8c')||_0x5ce4dd===_0x9631('0x8d')||_0x5ce4dd==='state'||_0x5ce4dd===_0x9631('0x39')){return![];}return!![];};exports[_0x9631('0x8e')]=function(_0x293971,_0x2f9b49){var _0x2847e8,_0x42d2a3,_0x434d1f;if(_0x2f9b49<=0x0){_0x2f9b49=0x1;}_0x2847e8=new RegExp(_0x9631('0x8f')+_0x2f9b49+'}$');_0x42d2a3=Math[_0x9631('0x90')](0xa,_0x2f9b49-0x1);_0x434d1f=Math['pow'](0xa,_0x2f9b49)-0x1;return util[_0x9631('0x12')]('%s',_[_0x9631('0x91')](_0x293971,_0x2847e8,_['random'](_0x42d2a3,_0x434d1f)));};exports[_0x9631('0x92')]=function(_0x1c572c){var _0x35f035=_0x1c572c['match'](/"(.*?)"/);return _0x35f035?_0x35f035[0x1]:_0x1c572c;};exports[_0x9631('0x93')]=function(_0x3da2b4){var _0x261018=_0x3da2b4['match'](/<(.*?)>/);return _0x261018?_0x261018[0x1]:_0x3da2b4;}; \ No newline at end of file +var _0x28a7=['random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','dialer','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','logAgent','state','logLookAgent','membername','UserId','logCustomer','endtime','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','type','campaigntype','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','getCallerIdRandom','pow','replace'];(function(_0xfbbe6a,_0x3e8431){var _0x32c20c=function(_0x2ff3b2){while(--_0x2ff3b2){_0xfbbe6a['push'](_0xfbbe6a['shift']());}};_0x32c20c(++_0x3e8431);}(_0x28a7,0x1b3));var _0x728a=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x28a7[_0x5bd426];return _0x23a7eb;};'use strict';var util=require(_0x728a('0x0'));var _=require(_0x728a('0x1'));var moment=require(_0x728a('0x2'));var logger=require(_0x728a('0x3'))('preview');var ipAgi=process[_0x728a('0x4')][_0x728a('0x5')]||_0x728a('0x6');function getSeconds(_0x596fe9,_0xe2ea2c){var _0x4eaef4=moment(_0x596fe9)[_0x728a('0x7')](0x0);var _0x55bc0d=moment(_0xe2ea2c)[_0x728a('0x7')](0x0);return _0x4eaef4[_0x728a('0x8')](_0x55bc0d,_0x728a('0x9'));}exports[_0x728a('0xa')]=function(_0x381ba0){return function(_0x179d16){logger[_0x728a('0xb')](_0x381ba0,util[_0x728a('0xc')](_0x179d16,{'showHidden':![],'depth':null}));};};exports[_0x728a('0xd')]=function(_0x13e540,_0x56e674){logger[_0x728a('0xe')](_0x13e540,util[_0x728a('0xc')](_0x56e674,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x106299,_0x19e8fe){logger[_0x728a('0xb')](_0x106299,util[_0x728a('0xc')](_0x19e8fe,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x256447){return function(_0x2dd50c){logger[_0x728a('0xe')](_0x256447,util[_0x728a('0xc')](_0x2dd50c,{'showHidden':![],'depth':null}));};};exports[_0x728a('0xf')]=function(_0x4f1d7f,_0x1af335,_0x2482bd){return{'message':_0x4f1d7f,'unlock':_0x1af335,'active':_0x2482bd};};exports['getCallerId']=function(_0x2931c1,_0x4127b5,_0x69c04c){if(!_[_0x728a('0x10')](_0x69c04c)&&_0x728a('0x11')===typeof _0x69c04c&&!_[_0x728a('0x12')](_0x69c04c)){if(!_['isUndefined'](_0x4127b5)&&_0x728a('0x11')===typeof _0x4127b5&&!_[_0x728a('0x12')](_0x4127b5)){return util[_0x728a('0x13')](_0x728a('0x14'),_0x4127b5,_0x69c04c);}return util['format'](_0x728a('0x14'),_0x69c04c,_0x69c04c);}if(!_[_0x728a('0x10')](_0x2931c1)&&'string'===typeof _0x2931c1&&!_[_0x728a('0x12')](_0x2931c1)){return _0x2931c1;}return _0x728a('0x15');};exports[_0x728a('0x16')]=function(_0x3ba62a){if(_[_0x728a('0x17')](_0x3ba62a)){return![];}return _0x3ba62a;};exports['addVariables']=function(_0x17f04d,_0x1b0615,_0x1e066a,_0x59debe,_0x415779,_0x4565ff){var _0x1f3dfd={'XMD-QUEUE':_0x1b0615[_0x728a('0x18')]?_0x1b0615[_0x728a('0x18')][_0x728a('0x19')]:'','XMD-CALLERID':_0x59debe,'XMD-CALLERID-PREVIEW':_0x4565ff?util[_0x728a('0x13')]('\x22%s\x22\x20<%s>',_0x4565ff[_0x728a('0x1a')],_0x4565ff[_0x728a('0x1b')]):_0x59debe,'XMD-DIALID':_0x415779,'XMD-CONTACTID':_0x1b0615['ContactId'],'XMD-CDRTYPE':_0x728a('0x1c'),'CALLERID(all)':_0x59debe,'XMD-VOICEQUEUEID':_0x1b0615['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1e066a,'XMD-DIALTIMEOUT':_0x17f04d[_0x728a('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x728a('0x13')]('\x22rtTxX%s%s\x22',_0x17f04d[_0x728a('0x1e')]?'g':'',_['isEmpty'](_0x17f04d[_0x728a('0x1f')])?'':_0x728a('0x20')),'XMD-DIALURL':_0x17f04d[_0x728a('0x21')]||'','XMD-AGI':_0x17f04d[_0x728a('0x22')]?util[_0x728a('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x17f04d['dialQueueProject']):_0x728a('0x23'),'XMD-AGIAFTER':_0x17f04d[_0x728a('0x1e')]?util[_0x728a('0x13')](_0x728a('0x24'),ipAgi,_0x17f04d[_0x728a('0x1e')]):_0x728a('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x4565ff?_0x4565ff[_0x728a('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x4565ff?_0x4565ff[_0x728a('0x26')]:'','XMD-DESTINATION':_0x728a('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x17f04d[_0x728a('0x1f')])){_0x1f3dfd[util[_0x728a('0x13')]('%s',_0x728a('0x28'))]=_0x17f04d[_0x728a('0x1f')];_0x1f3dfd[util['format']('%s',_0x728a('0x29'))]=_0x415779;}if(_0x1b0615&&_0x1b0615[_0x728a('0x2a')]){for(var _0x1c5652 in _0x1b0615[_0x728a('0x2a')]){if(_0x1b0615['Contact'][_0x728a('0x2b')](_0x1c5652)){if(!_[_0x728a('0x17')](_0x1b0615[_0x728a('0x2a')][_0x1c5652])&&_0x1c5652!=='id'&&_0x1c5652!==_0x728a('0x2c')&&_0x1c5652!==_0x728a('0x2d')&&_0x1c5652!==_0x728a('0x2e')){_0x1f3dfd[util[_0x728a('0x13')](_0x728a('0x2f'),_0x728a('0x30'),_[_0x728a('0x31')](_0x1c5652))]=_0x1b0615[_0x728a('0x2a')][_0x1c5652];}}}}return _0x1f3dfd;};exports[_0x728a('0x32')]=function(_0x20131a){var _0xb807cb={};for(var _0x121314 in _0x20131a){if(_0x20131a['hasOwnProperty'](_0x121314)){_0xb807cb[util[_0x728a('0x13')]('%s',_[_0x728a('0x33')](_0x121314))]=_0x20131a[_0x121314];}}return{'variables':_0xb807cb};};exports[_0x728a('0x34')]=function(_0x4a3f17,_0x1caeac){if(!_[_0x728a('0x17')](_0x4a3f17)){if(_0x4a3f17[_0x728a('0x2b')](_0x728a('0x35'))){if(_0x4a3f17['originated']>0x0){_0x4a3f17[_0x728a('0x35')]-=0x1;}else{logger[_0x728a('0xb')](_0x728a('0x36'),_0x1caeac);}}}else{logger[_0x728a('0xb')](_0x728a('0x37'),_0x1caeac);}};exports['logBlacklist']=function(_0x554cce){var _0xc67c8b=moment()[_0x728a('0x13')](_0x728a('0x38'));_0x554cce['state']=0xd;_0x554cce[_0x728a('0x39')]='Blacklist';_0x554cce[_0x728a('0x3a')]=_0xc67c8b;_0x554cce[_0x728a('0x3b')]=_0xc67c8b;_0x554cce['endtime']=_0xc67c8b;};exports[_0x728a('0x3c')]=function(_0x428658,_0x58a69a,_0x31fcc4){var _0x49af33=moment()[_0x728a('0x13')](_0x728a('0x38'));_0x428658[_0x728a('0x3d')]=_0x58a69a;_0x428658[_0x728a('0x39')]=_0x31fcc4;_0x428658[_0x728a('0x3b')]=_0x49af33;_0x428658['ringtime']=getSeconds(_0x428658[_0x728a('0x3b')],_0x428658['starttime']);};exports[_0x728a('0x3e')]=function(_0xae4e1c,_0x2630fd,_0x51af10){_0xae4e1c[_0x728a('0x3f')]=_0x2630fd;_0xae4e1c[_0x728a('0x40')]=_0x51af10;};exports[_0x728a('0x41')]=function(_0x48ddf9,_0x4aeab6,_0x205c84){var _0x5d0467=moment()[_0x728a('0x13')](_0x728a('0x38'));_0x48ddf9[_0x728a('0x3d')]=_0x4aeab6;_0x48ddf9[_0x728a('0x39')]=_0x205c84;_0x48ddf9[_0x728a('0x3b')]=_0x48ddf9['responsetime']?_0x48ddf9['responsetime']:_0x5d0467;_0x48ddf9[_0x728a('0x42')]=_0x48ddf9[_0x728a('0x42')]?_0x48ddf9[_0x728a('0x42')]:_0x5d0467;_0x48ddf9[_0x728a('0x43')]=getSeconds(_0x48ddf9[_0x728a('0x3b')]||0x0,_0x48ddf9[_0x728a('0x3a')]||0x0);_0x48ddf9[_0x728a('0x44')]=_0x48ddf9[_0x728a('0x45')]?getSeconds(_0x48ddf9[_0x728a('0x42')],_0x48ddf9['answertime']):0x0;};exports[_0x728a('0x46')]=function(_0x1de6c8){return _0x1de6c8===_0x728a('0x47');};exports[_0x728a('0x48')]=function(_0x33cff9,_0x41cfdf,_0x1c3c4e,_0x15c617,_0x5bb70b){var _0x148fcf=_0x15c617?_0x728a('0x49'):_0x33cff9[_0x728a('0x1a')];_0x148fcf=_0x5bb70b?_0x728a('0x4a'):_0x148fcf;return{'actionid':_0x33cff9[_0x728a('0x4b')],'action':_0x728a('0x4c'),'channel':_0x33cff9[_0x728a('0x4d')],'callerid':util[_0x728a('0x13')](_0x728a('0x14'),_0x148fcf,_0x33cff9[_0x728a('0x1b')]),'Exten':_0x728a('0x27'),'Context':_0x728a('0x4e'),'Priority':'1','variable':_0x1c3c4e,'timeout':(_0x41cfdf['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x33cff9[_0x728a('0x4b')]};};exports[_0x728a('0x4f')]=function(_0x576b66){return _0x576b66[_0x728a('0x50')]+_0x576b66[_0x728a('0x51')]+_0x576b66[_0x728a('0x52')]+_0x576b66[_0x728a('0x53')]+_0x576b66[_0x728a('0x54')];};exports['cloneAction']=function(_0x30cc22){var _0x5d0ba2=_['clone'](_0x30cc22);_0x5d0ba2[_0x728a('0x3d')]=0xf;_0x5d0ba2[_0x728a('0x39')]=_0x728a('0x55');return _0x5d0ba2;};exports[_0x728a('0x56')]=function(_0x2140db,_0x638ce7,_0x1a820a){var _0x421758={};_0x421758[_0x638ce7]=_0x2140db[_0x638ce7];_0x421758[_0x728a('0x57')]=![];_0x421758[_0x728a('0x58')]=moment()[_0x728a('0x59')](_0x1a820a,_0x728a('0x5a'))['format'](_0x728a('0x38'));_0x421758[_0x728a('0x5b')]=_0x2140db['ContactId'];_0x421758[_0x728a('0x5c')]=_0x2140db[_0x728a('0x5c')];_0x421758[_0x728a('0x5d')]=_0x2140db[_0x728a('0x5d')]||undefined;return _0x421758;};exports[_0x728a('0x5e')]=function(_0x406574,_0xc82d98){if(!_['isNil'](_0x406574)){if(_0x406574[_0x728a('0x5f')]>0x0){_0x406574[_0x728a('0x5f')]-=0x1;}else{logger[_0x728a('0xb')](_0xc82d98,_0x728a('0x60'));}}else{logger[_0x728a('0xb')](_0xc82d98,_0x728a('0x61'));}};exports['IsNotLoggedIn']=function(_0x3c3983){if(_0x3c3983<=0x0){return!![];}return![];};exports[_0x728a('0x62')]=function(_0x22e28f,_0x4d6576,_0x4d39e1){_0x22e28f[_0x728a('0x63')]=_0x4d6576;_0x22e28f[_0x728a('0x19')]=_0x22e28f[_0x728a('0x64')];_0x22e28f[_0x728a('0x65')]=_0x22e28f[_0x728a('0x4d')];_0x22e28f[_0x728a('0x66')]='voice';if(_0x4d39e1){_0x22e28f[_0x728a('0x67')]=_0x4d39e1['mandatoryDisposition'];}return _0x22e28f;};exports[_0x728a('0x68')]=function(_0x132ba3){var _0x107947={};_0x107947[_0x728a('0x64')]=_0x132ba3[_0x728a('0x64')];_0x107947[_0x728a('0x65')]=_0x132ba3[_0x728a('0x4d')];_0x107947[_0x728a('0x4b')]=_0x132ba3[_0x728a('0x4b')];return _0x107947;};exports[_0x728a('0x69')]=function(_0x9b20b7){var _0x36988b=[];for(var _0xe0536b in _0x9b20b7){if(_0x9b20b7[_0x728a('0x2b')](_0xe0536b)){if(!_[_0x728a('0x17')](_0x9b20b7[_0xe0536b])&&_0x9b20b7[_0xe0536b][_0x728a('0x3d')]===_0x728a('0x6a')&&_0x9b20b7[_0xe0536b]['status']===_0x728a('0x6b')){_0x36988b[_0x728a('0x6c')](_0x9b20b7[_0xe0536b]['id']);}}}return _0x36988b;};exports[_0x728a('0x6d')]=function(_0x597893){var _0x2786f4=moment()[_0x728a('0x7')](0x0);var _0xf054d2=moment(_0x597893)[_0x728a('0x7')](0x0);return _0x2786f4[_0x728a('0x8')](_0xf054d2,_0x728a('0x9'));};exports[_0x728a('0x6e')]=function(_0x4581eb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4581eb[_0x728a('0x5b')],'ListId':_0x4581eb[_0x728a('0x5c')],'VoiceQueueId':_0x4581eb[_0x728a('0x5d')]||undefined,'CampaignId':_0x4581eb['CampaignId']||undefined};};exports['filterKey']=function(_0x1383ca){if(_0x1383ca===_0x728a('0x4b')||_0x1383ca==='idContact'||_0x1383ca===_0x728a('0x64')||_0x1383ca===_0x728a('0x6f')||_0x1383ca===_0x728a('0x70')||_0x1383ca==='dialAnswer'||_0x1383ca===_0x728a('0x3f')||_0x1383ca==='channelAgent'||_0x1383ca===_0x728a('0x1a')||_0x1383ca===_0x728a('0x57')||_0x1383ca===_0x728a('0x1b')||_0x1383ca==='scheduledat'||_0x1383ca===_0x728a('0x50')||_0x1383ca===_0x728a('0x51')||_0x1383ca===_0x728a('0x52')||_0x1383ca==='countglobal'||_0x1383ca===_0x728a('0x71')||_0x1383ca===_0x728a('0x72')||_0x1383ca===_0x728a('0x73')||_0x1383ca==='recallme'||_0x1383ca===_0x728a('0x5b')||_0x1383ca===_0x728a('0x5c')||_0x1383ca===_0x728a('0x40')||_0x1383ca===_0x728a('0x5d')||_0x1383ca===_0x728a('0x74')||_0x1383ca===_0x728a('0x75')||_0x1383ca===_0x728a('0x76')||_0x1383ca===_0x728a('0x77')||_0x1383ca===_0x728a('0x78')||_0x1383ca===_0x728a('0x79')||_0x1383ca===_0x728a('0x7a')||_0x1383ca===_0x728a('0x7b')||_0x1383ca==='xmd-dialid'||_0x1383ca===_0x728a('0x7c')||_0x1383ca===_0x728a('0x7d')||_0x1383ca===_0x728a('0x7e')||_0x1383ca===_0x728a('0x7f')||_0x1383ca===_0x728a('0x80')||_0x1383ca===_0x728a('0x81')||_0x1383ca===_0x728a('0x82')||_0x1383ca==='rtpaudioqosbridged'||_0x1383ca===_0x728a('0x83')||_0x1383ca===_0x728a('0x84')||_0x1383ca==='rtpaudioqosloss'||_0x1383ca===_0x728a('0x85')||_0x1383ca===_0x728a('0x86')||_0x1383ca===_0x728a('0x87')||_0x1383ca===_0x728a('0x82')||_0x1383ca===_0x728a('0x88')||_0x1383ca===_0x728a('0x83')||_0x1383ca===_0x728a('0x84')||_0x1383ca==='rtpaudioqosloss'||_0x1383ca===_0x728a('0x85')||_0x1383ca===_0x728a('0x86')||_0x1383ca==='rtpaudioqosrttbridged'||_0x1383ca===_0x728a('0x89')||_0x1383ca==='bridgepvtcallid'||_0x1383ca===_0x728a('0x3d')||_0x1383ca===_0x728a('0x39')){return![];}return!![];};exports[_0x728a('0x8a')]=function(_0x3d05e6,_0x2c764b){var _0x453a59,_0x46538e,_0x383b03;if(_0x2c764b<=0x0){_0x2c764b=0x1;}_0x453a59=new RegExp('\x5cw{0,'+_0x2c764b+'}$');_0x46538e=Math[_0x728a('0x8b')](0xa,_0x2c764b-0x1);_0x383b03=Math[_0x728a('0x8b')](0xa,_0x2c764b)-0x1;return util['format']('%s',_[_0x728a('0x8c')](_0x3d05e6,_0x453a59,_[_0x728a('0x8d')](_0x46538e,_0x383b03)));};exports[_0x728a('0x8e')]=function(_0x103f5e){var _0x223c89=_0x103f5e['match'](/"(.*?)"/);return _0x223c89?_0x223c89[0x1]:_0x103f5e;};exports['extractCalleridNumber']=function(_0x579200){var _0x1fbb80=_0x579200[_0x728a('0x8f')](/<(.*?)>/);return _0x1fbb80?_0x1fbb80[0x1]:_0x579200;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 32894c5..03406e6 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc064=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel'];(function(_0x242cc5,_0x452726){var _0x351ee1=function(_0x10ee40){while(--_0x10ee40){_0x242cc5['push'](_0x242cc5['shift']());}};_0x351ee1(++_0x452726);}(_0xc064,0xb7));var _0x4c06=function(_0x5d19b2,_0x507379){_0x5d19b2=_0x5d19b2-0x0;var _0x5db8c4=_0xc064[_0x5d19b2];return _0x5db8c4;};'use strict';exports[_0x4c06('0x0')]={'queue':{'type':_0x4c06('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x4c06('0x1'),'required':!![]},'penalty':{'type':_0x4c06('0x2'),'required':![]},'paused':{'type':_0x4c06('0x3'),'required':![]}};exports[_0x4c06('0x4')]={'queue':{'type':_0x4c06('0x1'),'required':!![]},'interface':{'type':_0x4c06('0x1'),'required':!![]}};exports[_0x4c06('0x5')]={'interface':{'type':_0x4c06('0x1'),'required':!![]},'paused':{'type':_0x4c06('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x4c06('0x1'),'required':![]}};exports[_0x4c06('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x4c06('0x7')]={'uniqueid':{'type':_0x4c06('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x4c06('0x1')},'mixmonitorid':{'type':_0x4c06('0x1')}};exports[_0x4c06('0x8')]={'uniqueid':{'type':_0x4c06('0x1'),'required':!![]}};exports[_0x4c06('0x9')]={'uniqueid':{'type':_0x4c06('0x1'),'required':!![]},'exten':{'type':_0x4c06('0x1'),'required':!![]},'context':{'type':_0x4c06('0x1')}}; \ No newline at end of file +var _0x29c6=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannelredirect'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x29c6,0xf8));var _0x629c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29c6[_0x20a584];return _0x4b41a8;};'use strict';exports[_0x629c('0x0')]={'queue':{'type':_0x629c('0x1'),'required':!![]},'interface':{'type':_0x629c('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x629c('0x2'),'required':![]},'paused':{'type':_0x629c('0x3'),'required':![]}};exports[_0x629c('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x629c('0x1'),'required':!![]}};exports[_0x629c('0x5')]={'interface':{'type':_0x629c('0x1'),'required':!![]},'paused':{'type':_0x629c('0x3')},'reason':{'type':'string','required':![]}};exports[_0x629c('0x6')]={'module':{'type':_0x629c('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x629c('0x1'),'required':!![]},'filename':{'type':_0x629c('0x1')},'format':{'type':_0x629c('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x629c('0x7')]={'uniqueid':{'type':_0x629c('0x1'),'required':!![]},'exten':{'type':_0x629c('0x1'),'required':!![]},'context':{'type':_0x629c('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 54357ca..94af261 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ac4=['format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','sumBillable','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','hasOwnProperty'];(function(_0x1644f2,_0x2884e8){var _0x1fcb31=function(_0x41773c){while(--_0x41773c){_0x1644f2['push'](_0x1644f2['shift']());}};_0x1fcb31(++_0x2884e8);}(_0x0ac4,0xb0));var _0x40ac=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x0ac4[_0x1d80be];return _0xf9a4f3;};'use strict';var BPromise=require(_0x40ac('0x0'));var util=require('util');var _=require(_0x40ac('0x1'));var moment=require(_0x40ac('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x40ac('0x3'));var Trunk=require(_0x40ac('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x40ac('0x5'));var Template=require(_0x40ac('0x6'));var Campaign=require(_0x40ac('0x7'));var VoiceExtension=require(_0x40ac('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x40ac('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x40ac('0xa'));var ZohoAccount=require(_0x40ac('0xb'));var DeskAccount=require(_0x40ac('0xc'));var VtigerAccount=require(_0x40ac('0xd'));var ServicenowAccount=require(_0x40ac('0xe'));var Dynamics365Account=require(_0x40ac('0xf'));var FreshsalesAccount=require(_0x40ac('0x10'));var FaxAccount=require(_0x40ac('0x11'));var Realtime=function(){this[_0x40ac('0x12')]={};this[_0x40ac('0x13')]={};this[_0x40ac('0x14')]={};this[_0x40ac('0x15')]={};this['triggers']={};this[_0x40ac('0x16')]={};this[_0x40ac('0x17')]={};this[_0x40ac('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x40ac('0x19')]={};this[_0x40ac('0x1a')]={};this['queueChannels']={};this[_0x40ac('0x1b')]={};this[_0x40ac('0x1c')]={};this['settings']={};this[_0x40ac('0x1d')]={};this[_0x40ac('0x1e')]={};this['sugarcrmAccounts']={};this[_0x40ac('0x1f')]={};this[_0x40ac('0x20')]={};this['deskAccounts']={};this[_0x40ac('0x21')]={};this[_0x40ac('0x22')]={};this['dynamics365Accounts']={};this[_0x40ac('0x23')]={};this[_0x40ac('0x24')]={};};function freeIsNotKey(_0x181898,_0xd84b17,_0x271fa1){var _0x3ea6b1=_['mapKeys'](_0x181898,function(_0x108d87,_0x5370a5){return _0x108d87[_0x271fa1];});for(var _0x2337f3 in _0xd84b17){if(_0xd84b17[_0x40ac('0x25')](_0x2337f3)){if(!_0x3ea6b1[_0x2337f3]){delete _0xd84b17[_0x2337f3];}}}}function freeIsNotKeySip(_0xf68dfe,_0x1d071f){var _0x1dc5cb=_['mapKeys'](_0xf68dfe,function(_0x24d852,_0xaa8dbe){return util[_0x40ac('0x26')](_0x40ac('0x27'),_0x24d852[_0x40ac('0x28')]);});for(var _0x15df6f in _0x1d071f){if(_0x1d071f[_0x40ac('0x25')](_0x15df6f)){if(!_0x1dc5cb[_0x15df6f]){delete _0x1d071f[_0x15df6f];}}}}function freeIsNotKeyAgent(_0x2c4005,_0x49958e){var _0x49200f=_['mapKeys'](_0x2c4005,function(_0x410c19,_0x455ea2){var _0x2bd24b=_[_0x40ac('0x29')](_0x410c19['interface'])?util[_0x40ac('0x26')]('SIP/%s',_0x410c19[_0x40ac('0x28')]):_0x410c19[_0x40ac('0x2a')];return _0x2bd24b;});for(var _0x4b9794 in _0x49958e){if(_0x49958e[_0x40ac('0x25')](_0x4b9794)){if(!_0x49200f[_0x4b9794]){delete _0x49958e[_0x4b9794];}}}}function clearVoiceCallReports(_0x46e432){_0x46e432[_0x40ac('0x2b')]=0x0;_0x46e432[_0x40ac('0x2c')]=0x0;_0x46e432[_0x40ac('0x2d')]=0x0;_0x46e432['sumDuration']=0x0;_0x46e432['sumBillable']=0x0;}function clearCampaigns(_0xd0aff){if(!_[_0x40ac('0x2e')](_0xd0aff)){for(var _0x4b57d5 in _0xd0aff){if(_0xd0aff[_0x40ac('0x25')](_0x4b57d5)){_0xd0aff[_0x4b57d5][_0x40ac('0x2f')]=0x0;_0xd0aff[_0x4b57d5][_0x40ac('0x30')]=0x0;}}}}function clearVoiceQueues(_0x290967){if(!_[_0x40ac('0x2e')](_0x290967)){for(var _0x398b40 in _0x290967){if(_0x290967[_0x40ac('0x25')](_0x398b40)){_0x290967[_0x398b40][_0x40ac('0x2b')]=0x0;_0x290967[_0x398b40][_0x40ac('0x2c')]=0x0;_0x290967[_0x398b40][_0x40ac('0x31')]=0x0;_0x290967[_0x398b40][_0x40ac('0x32')]=0x0;_0x290967[_0x398b40][_0x40ac('0x2d')]=0x0;_0x290967[_0x398b40][_0x40ac('0x33')]=0x0;_0x290967[_0x398b40]['sumBillable']=0x0;_0x290967[_0x398b40][_0x40ac('0x34')]=0x0;_0x290967[_0x398b40]['outboundNoAnswerCallsDay']=0x0;_0x290967[_0x398b40]['outboundBusyCallsDay']=0x0;_0x290967[_0x398b40][_0x40ac('0x35')]=0x0;_0x290967[_0x398b40][_0x40ac('0x36')]=0x0;_0x290967[_0x398b40][_0x40ac('0x37')]=0x0;_0x290967[_0x398b40][_0x40ac('0x38')]=0x0;_0x290967[_0x398b40]['outboundDropCallsDayCallersExit']=0x0;_0x290967[_0x398b40][_0x40ac('0x39')]=0x0;_0x290967[_0x398b40][_0x40ac('0x3a')]=0x0;_0x290967[_0x398b40][_0x40ac('0x3b')]=0x0;_0x290967[_0x398b40][_0x40ac('0x3c')]=0x0;_0x290967[_0x398b40]['outboundAnswerAgiCallsDay']=0x0;_0x290967[_0x398b40][_0x40ac('0x3d')]=0x0;_0x290967[_0x398b40]['queueStatusComplete']=!![];}}}}Realtime[_0x40ac('0x3e')][_0x40ac('0x3f')]=function(_0x2e9c0a,_0x548554){for(var _0x40249d in _0x548554){if(_0x2e9c0a[_0x40ac('0x25')](_0x40249d)){_0x2e9c0a[_0x40249d]=_0x548554[_0x40249d];}}};Realtime[_0x40ac('0x3e')][_0x40ac('0x40')]=function(){var _0xf5844a=this;return function(_0x24af21){if(_0x24af21){freeIsNotKeyAgent(_0x24af21,_0xf5844a['agents']);for(var _0xfa112c=0x0,_0x3527a7={},_0x3c7fab={};_0xfa112c<_0x24af21[_0x40ac('0x41')];_0xfa112c+=0x1){_0x3527a7=_0x24af21[_0xfa112c];var _0xe92342=_[_0x40ac('0x29')](_0x3527a7['interface'])?util['format'](_0x40ac('0x27'),_0x3527a7[_0x40ac('0x28')]):_0x3527a7[_0x40ac('0x2a')];if(_[_0x40ac('0x42')](_0xf5844a[_0x40ac('0x12')][_0xe92342])){_0xf5844a[_0x40ac('0x12')][_0xe92342]=new Agent(_0x3527a7);}else{_0xf5844a[_0x40ac('0x3f')](_0xf5844a[_0x40ac('0x12')][_0xe92342],_0x3527a7);}}}return _0xf5844a[_0x40ac('0x12')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x43')]=function(){var _0x7e4f26=this;return function(_0x1a73b4){if(_0x1a73b4){freeIsNotKeySip(_0x1a73b4,_0x7e4f26[_0x40ac('0x13')]);for(var _0x9232f9=0x0,_0x4f9ab6={},_0x20f9dc={};_0x9232f9<_0x1a73b4[_0x40ac('0x41')];_0x9232f9+=0x1){_0x4f9ab6=_0x1a73b4[_0x9232f9];if(_[_0x40ac('0x42')](_0x7e4f26[_0x40ac('0x13')][util[_0x40ac('0x26')](_0x40ac('0x27'),_0x4f9ab6[_0x40ac('0x28')])])){_0x7e4f26[_0x40ac('0x13')][util['format']('SIP/%s',_0x4f9ab6[_0x40ac('0x28')])]=new Telephone(_0x4f9ab6);}else{_0x7e4f26['mergeFromDatabase'](_0x7e4f26[_0x40ac('0x13')][util[_0x40ac('0x26')](_0x40ac('0x27'),_0x4f9ab6[_0x40ac('0x28')])],_0x4f9ab6);}}}return _0x7e4f26['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x333695=this;return function(_0x11c912){if(_0x11c912){freeIsNotKeySip(_0x11c912,_0x333695[_0x40ac('0x14')]);for(var _0x33c45e=0x0,_0x1e2260={},_0x5566c4={};_0x33c45e<_0x11c912['length'];_0x33c45e+=0x1){_0x1e2260=_0x11c912[_0x33c45e];if(_['isUndefined'](_0x333695[_0x40ac('0x14')][util['format'](_0x40ac('0x27'),_0x1e2260[_0x40ac('0x28')])])){_0x333695['trunks'][util[_0x40ac('0x26')](_0x40ac('0x27'),_0x1e2260['name'])]=new Trunk(_0x1e2260);}else{_0x333695[_0x40ac('0x3f')](_0x333695['trunks'][util['format'](_0x40ac('0x27'),_0x1e2260['name'])],_0x1e2260);}}}return _0x333695[_0x40ac('0x14')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x44')]=function(){var _0x1dbae4=this;return function(_0xbdc484){if(_0xbdc484){freeIsNotKey(_0xbdc484,_0x1dbae4[_0x40ac('0x15')],_0x40ac('0x28'));for(var _0x384031=0x0,_0x5add60={},_0x3d77dc={};_0x384031<_0xbdc484[_0x40ac('0x41')];_0x384031+=0x1){_0x5add60=_0xbdc484[_0x384031];if(_['isUndefined'](_0x1dbae4[_0x40ac('0x15')][_0x5add60[_0x40ac('0x28')]])){_0x1dbae4[_0x40ac('0x15')][_0x5add60[_0x40ac('0x28')]]=new VoiceQueue(_0x5add60);}else{_0x1dbae4[_0x40ac('0x3f')](_0x1dbae4[_0x40ac('0x15')][_0x5add60[_0x40ac('0x28')]],_0x5add60);}}}return _0x1dbae4[_0x40ac('0x15')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x45')]=function(){var _0x1b4b5d=this;return function(_0x23a844){if(_0x23a844){freeIsNotKey(_0x23a844,_0x1b4b5d[_0x40ac('0x46')],'id');for(var _0x14732c=0x0,_0x4c2b5d={},_0x7bdabe={};_0x14732c<_0x23a844['length'];_0x14732c+=0x1){_0x4c2b5d=_0x23a844[_0x14732c];if(_[_0x40ac('0x42')](_0x1b4b5d[_0x40ac('0x46')][_0x4c2b5d['id']])){_0x1b4b5d[_0x40ac('0x46')][_0x4c2b5d['id']]=new Trigger(_0x4c2b5d);}else{_0x1b4b5d[_0x40ac('0x3f')](_0x1b4b5d[_0x40ac('0x46')][_0x4c2b5d['id']],_0x4c2b5d);}}}return _0x1b4b5d[_0x40ac('0x46')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x47')]=function(){var _0x4726a0=this;return function(_0x5ae6b8){if(_0x5ae6b8){freeIsNotKey(_0x5ae6b8,_0x4726a0[_0x40ac('0x17')],'id');for(var _0xaf398a=0x0,_0x1d1cff={},_0x1291cc={};_0xaf398a<_0x5ae6b8[_0x40ac('0x41')];_0xaf398a+=0x1){_0x1d1cff=_0x5ae6b8[_0xaf398a];if(_[_0x40ac('0x42')](_0x4726a0[_0x40ac('0x17')][_0x1d1cff['id']])){_0x4726a0['templates'][_0x1d1cff['id']]=new Template(_0x1d1cff);}else{_0x4726a0[_0x40ac('0x3f')](_0x4726a0[_0x40ac('0x17')][_0x1d1cff['id']],_0x1d1cff);}}}return _0x4726a0['templates'];};};Realtime['prototype'][_0x40ac('0x48')]=function(){var _0x3e227d=this;return function(_0xaef2d0){if(_0xaef2d0){freeIsNotKey(_0xaef2d0,_0x3e227d[_0x40ac('0x1d')],'id');for(var _0x1faee4=0x0,_0x37b77c={},_0x5b44a5={};_0x1faee4<_0xaef2d0[_0x40ac('0x41')];_0x1faee4+=0x1){_0x37b77c=_0xaef2d0[_0x1faee4];if(_[_0x40ac('0x42')](_0x3e227d[_0x40ac('0x1d')][_0x37b77c['id']])){_0x3e227d[_0x40ac('0x1d')][_0x37b77c['id']]=new ZendeskAccount(_0x37b77c);}else{_0x3e227d[_0x40ac('0x3f')](_0x3e227d[_0x40ac('0x1d')][_0x37b77c['id']],_0x37b77c);}}}return _0x3e227d[_0x40ac('0x1d')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x49')]=function(){var _0x35b624=this;return function(_0xcc0ab3){if(_0xcc0ab3){freeIsNotKey(_0xcc0ab3,_0x35b624[_0x40ac('0x1e')],'id');for(var _0x5c5f29=0x0,_0x2d1341={},_0x369055={};_0x5c5f29<_0xcc0ab3[_0x40ac('0x41')];_0x5c5f29+=0x1){_0x2d1341=_0xcc0ab3[_0x5c5f29];if(_[_0x40ac('0x42')](_0x35b624[_0x40ac('0x1e')][_0x2d1341['id']])){_0x35b624['salesforceAccounts'][_0x2d1341['id']]=new SalesforceAccount(_0x2d1341);}else{_0x35b624[_0x40ac('0x3f')](_0x35b624[_0x40ac('0x1e')][_0x2d1341['id']],_0x2d1341);}}}return _0x35b624[_0x40ac('0x1e')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x81c48c=this;return function(_0x479255){if(_0x479255){freeIsNotKey(_0x479255,_0x81c48c['freshdeskAccounts'],'id');for(var _0x454321=0x0,_0x3a2bb1={},_0x2c891c={};_0x454321<_0x479255[_0x40ac('0x41')];_0x454321+=0x1){_0x3a2bb1=_0x479255[_0x454321];if(_[_0x40ac('0x42')](_0x81c48c[_0x40ac('0x1f')][_0x3a2bb1['id']])){_0x81c48c[_0x40ac('0x1f')][_0x3a2bb1['id']]=new FreshdeskAccount(_0x3a2bb1);}else{_0x81c48c[_0x40ac('0x3f')](_0x81c48c[_0x40ac('0x1f')][_0x3a2bb1['id']],_0x3a2bb1);}}}return _0x81c48c[_0x40ac('0x1f')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x4a')]=function(){var _0x3aa6fb=this;return function(_0x5b4ddb){if(_0x5b4ddb){freeIsNotKey(_0x5b4ddb,_0x3aa6fb[_0x40ac('0x20')],'id');for(var _0xf6e6bd=0x0,_0x4a3c28={},_0x5b31e3={};_0xf6e6bd<_0x5b4ddb['length'];_0xf6e6bd+=0x1){_0x4a3c28=_0x5b4ddb[_0xf6e6bd];if(_[_0x40ac('0x42')](_0x3aa6fb['zohoAccounts'][_0x4a3c28['id']])){_0x3aa6fb['zohoAccounts'][_0x4a3c28['id']]=new ZohoAccount(_0x4a3c28);}else{_0x3aa6fb[_0x40ac('0x3f')](_0x3aa6fb[_0x40ac('0x20')][_0x4a3c28['id']],_0x4a3c28);}}}return _0x3aa6fb[_0x40ac('0x20')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x4b')]=function(){var _0x19d7f0=this;return function(_0x419659){if(_0x419659){freeIsNotKey(_0x419659,_0x19d7f0[_0x40ac('0x4c')],'id');for(var _0x5e46c1=0x0,_0x2d32f9={},_0x1358e1={};_0x5e46c1<_0x419659[_0x40ac('0x41')];_0x5e46c1+=0x1){_0x2d32f9=_0x419659[_0x5e46c1];if(_[_0x40ac('0x42')](_0x19d7f0[_0x40ac('0x4c')][_0x2d32f9['id']])){_0x19d7f0[_0x40ac('0x4c')][_0x2d32f9['id']]=new DeskAccount(_0x2d32f9);}else{_0x19d7f0[_0x40ac('0x3f')](_0x19d7f0[_0x40ac('0x4c')][_0x2d32f9['id']],_0x2d32f9);}}}return _0x19d7f0[_0x40ac('0x4c')];};};Realtime[_0x40ac('0x3e')]['initSugarcrmAccounts']=function(){var _0x22ea9f=this;return function(_0x43e7a5){if(_0x43e7a5){freeIsNotKey(_0x43e7a5,_0x22ea9f[_0x40ac('0x4d')],'id');for(var _0x43f757=0x0,_0x1e3f14={},_0x4f33ff={};_0x43f757<_0x43e7a5[_0x40ac('0x41')];_0x43f757+=0x1){_0x1e3f14=_0x43e7a5[_0x43f757];if(_['isUndefined'](_0x22ea9f[_0x40ac('0x4d')][_0x1e3f14['id']])){_0x22ea9f[_0x40ac('0x4d')][_0x1e3f14['id']]=new SugarcrmAccount(_0x1e3f14);}else{_0x22ea9f['mergeFromDatabase'](_0x22ea9f[_0x40ac('0x4d')][_0x1e3f14['id']],_0x1e3f14);}}}return _0x22ea9f['sugarcrmAccounts'];};};Realtime[_0x40ac('0x3e')]['initVtigerAccounts']=function(){var _0x51d440=this;return function(_0x5d3b71){if(_0x5d3b71){freeIsNotKey(_0x5d3b71,_0x51d440['vtigerAccounts'],'id');for(var _0xcc9c3e=0x0,_0x3e02df={},_0x7377da={};_0xcc9c3e<_0x5d3b71[_0x40ac('0x41')];_0xcc9c3e+=0x1){_0x3e02df=_0x5d3b71[_0xcc9c3e];if(_[_0x40ac('0x42')](_0x51d440['vtigerAccounts'][_0x3e02df['id']])){_0x51d440[_0x40ac('0x21')][_0x3e02df['id']]=new VtigerAccount(_0x3e02df);}else{_0x51d440[_0x40ac('0x3f')](_0x51d440[_0x40ac('0x21')][_0x3e02df['id']],_0x3e02df);}}}return _0x51d440['vtigerAccounts'];};};Realtime['prototype'][_0x40ac('0x4e')]=function(){var _0x5c2327=this;return function(_0xd1a4ef){if(_0xd1a4ef){freeIsNotKey(_0xd1a4ef,_0x5c2327[_0x40ac('0x22')],'id');for(var _0x2df5a8=0x0,_0x41ee62={},_0x1d9afb={};_0x2df5a8<_0xd1a4ef[_0x40ac('0x41')];_0x2df5a8+=0x1){_0x41ee62=_0xd1a4ef[_0x2df5a8];if(_[_0x40ac('0x42')](_0x5c2327['servicenowAccounts'][_0x41ee62['id']])){_0x5c2327['servicenowAccounts'][_0x41ee62['id']]=new ServicenowAccount(_0x41ee62);}else{_0x5c2327[_0x40ac('0x3f')](_0x5c2327[_0x40ac('0x22')][_0x41ee62['id']],_0x41ee62);}}}return _0x5c2327[_0x40ac('0x22')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x4f')]=function(){var _0x1e7c2a=this;return function(_0xf088){if(_0xf088){freeIsNotKey(_0xf088,_0x1e7c2a[_0x40ac('0x50')],'id');for(var _0x39a21a=0x0,_0x355fcf={},_0x4de048={};_0x39a21a<_0xf088[_0x40ac('0x41')];_0x39a21a+=0x1){_0x355fcf=_0xf088[_0x39a21a];if(_[_0x40ac('0x42')](_0x1e7c2a[_0x40ac('0x50')][_0x355fcf['id']])){_0x1e7c2a[_0x40ac('0x50')][_0x355fcf['id']]=new Dynamics365Account(_0x355fcf);}else{_0x1e7c2a[_0x40ac('0x3f')](_0x1e7c2a['dynamics365Accounts'][_0x355fcf['id']],_0x355fcf);}}}return _0x1e7c2a[_0x40ac('0x50')];};};Realtime[_0x40ac('0x3e')]['initFreshsalesAccounts']=function(){var _0x4dbd59=this;return function(_0x2aad8d){if(_0x2aad8d){freeIsNotKey(_0x2aad8d,_0x4dbd59[_0x40ac('0x23')],'id');for(var _0x5a8543=0x0,_0x5cbf78={},_0x137451={};_0x5a8543<_0x2aad8d[_0x40ac('0x41')];_0x5a8543+=0x1){_0x5cbf78=_0x2aad8d[_0x5a8543];if(_[_0x40ac('0x42')](_0x4dbd59[_0x40ac('0x23')][_0x5cbf78['id']])){_0x4dbd59[_0x40ac('0x23')][_0x5cbf78['id']]=new FreshsalesAccount(_0x5cbf78);}else{_0x4dbd59[_0x40ac('0x3f')](_0x4dbd59[_0x40ac('0x23')][_0x5cbf78['id']],_0x5cbf78);}}}return _0x4dbd59[_0x40ac('0x23')];};};Realtime['prototype'][_0x40ac('0x51')]=function(){var _0x78de41=this;return function(_0xb3c75a){for(var _0x5deb29=0x0;_0x5deb29<_0xb3c75a[_0x40ac('0x41')];_0x5deb29+=0x1){_[_0x40ac('0x52')](_0x78de41[_0x40ac('0x15')][_0xb3c75a[_0x5deb29][_0x40ac('0x28')]],_0xb3c75a[_0x5deb29]);}return _0x78de41['voiceQueues'];};};Realtime['prototype'][_0x40ac('0x53')]=function(){var _0x2cd55d=this;return function(_0x3ae02a){clearVoiceQueues(_0x2cd55d['voiceQueues']);if(_0x3ae02a){_0x3ae02a=_[_0x40ac('0x54')](_0x3ae02a,_0x40ac('0x55'));for(var _0x39ec81 in _0x3ae02a){if(_0x3ae02a[_0x40ac('0x25')](_0x39ec81)){var _0x24af55={};for(var _0x1f4287=0x0;_0x1f4287<_0x3ae02a[_0x39ec81][_0x40ac('0x41')];_0x1f4287+=0x1){var _0x4c5050=_0x3ae02a[_0x39ec81][_0x1f4287]['queue'];if(_0x2cd55d[_0x40ac('0x15')][_0x4c5050]){if(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x56')]){_0x2cd55d[_0x40ac('0x15')][_0x4c5050][_0x40ac('0x31')]+=0x1;}if(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x57')]){_0x2cd55d[_0x40ac('0x15')][_0x4c5050][_0x40ac('0x32')]+=0x1;}_0x2cd55d[_0x40ac('0x15')][_0x4c5050]['sumHoldTime']+=moment(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x58')])['diff'](moment(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x59')]),_0x40ac('0x5a'))||0x0;if(_0x1f4287===_0x3ae02a[_0x39ec81]['length']-0x1){_0x2cd55d[_0x40ac('0x15')][_0x4c5050][_0x40ac('0x33')]+=moment(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x5b')]||_0x3ae02a[_0x39ec81][_0x1f4287]['queuecallerabandonAt']||_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x5c')])[_0x40ac('0x5d')](moment(_0x3ae02a[_0x39ec81][_0x1f4287]['queuecallerjoinAt']),_0x40ac('0x5a'))||0x0;_0x2cd55d[_0x40ac('0x15')][_0x4c5050]['total']+=0x1;if(_0x3ae02a[_0x39ec81][_0x1f4287][_0x40ac('0x5e')]){_0x2cd55d['voiceQueues'][_0x4c5050][_0x40ac('0x2c')]+=0x1;_0x2cd55d[_0x40ac('0x15')][_0x4c5050]['sumBillable']+=moment(_0x3ae02a[_0x39ec81][_0x1f4287]['queuecallercompleteAt'])[_0x40ac('0x5d')](moment(_0x3ae02a[_0x39ec81][_0x1f4287]['queuecallerleaveAt']),_0x40ac('0x5a'))||0x0;}}else{_0x2cd55d['voiceQueues'][_0x4c5050][_0x40ac('0x33')]+=_0x2cd55d[_0x40ac('0x15')][_0x4c5050][_0x40ac('0x2d')]||0x0;}}}}}}return _0x2cd55d[_0x40ac('0x15')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x5f')]=function(){var _0x4c1f0c=this;return function(_0x119f75){clearVoiceCallReports(_0x4c1f0c['outbound']);if(_0x119f75){for(var _0xfaf395=0x0;_0xfaf395<_0x119f75[_0x40ac('0x41')];_0xfaf395+=0x1){_0x4c1f0c['outbound'][_0x40ac('0x2b')]+=0x1;_0x4c1f0c[_0x40ac('0x18')][_0x40ac('0x33')]+=_0x119f75[_0xfaf395][_0x40ac('0x60')];if(_0x119f75[_0xfaf395]['disposition']===_0x40ac('0x61')){_0x4c1f0c[_0x40ac('0x18')][_0x40ac('0x2c')]+=0x1;_0x4c1f0c[_0x40ac('0x18')][_0x40ac('0x2d')]+=_0x119f75[_0xfaf395][_0x40ac('0x60')]-_0x119f75[_0xfaf395][_0x40ac('0x62')]||0x0;_0x4c1f0c[_0x40ac('0x18')][_0x40ac('0x63')]+=_0x119f75[_0xfaf395][_0x40ac('0x62')];}}}return _0x4c1f0c['outbound'];};};Realtime['prototype'][_0x40ac('0x64')]=function(){var _0x219dea=this;return function(_0x4984f4){if(_0x4984f4){freeIsNotKey(_0x4984f4,_0x219dea[_0x40ac('0x16')],'name');for(var _0x2b0d67=0x0,_0x50291a={};_0x2b0d67<_0x4984f4[_0x40ac('0x41')];_0x2b0d67+=0x1){_0x50291a=_0x4984f4[_0x2b0d67];if(_['isUndefined'](_0x219dea[_0x40ac('0x16')][_0x50291a[_0x40ac('0x28')]])){_0x219dea[_0x40ac('0x16')][_0x50291a['name']]=new Campaign(_0x50291a);}else{_0x219dea[_0x40ac('0x3f')](_0x219dea[_0x40ac('0x16')][_0x50291a['name']],_0x50291a);_0x219dea[_0x40ac('0x16')][_0x50291a[_0x40ac('0x28')]][_0x40ac('0x65')]=_0x50291a[_0x40ac('0x66')]?_0x50291a['SquareProject']['name']:undefined;}}}return _0x219dea['campaigns'];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x67')]=function(){var _0x2e9cd6=this;return function(_0x2b75c2){if(_0x2b75c2){freeIsNotKey(_0x2b75c2,_0x2e9cd6[_0x40ac('0x19')],'id');for(var _0x13d141=0x0,_0x17d8aa={};_0x13d141<_0x2b75c2[_0x40ac('0x41')];_0x13d141+=0x1){_0x17d8aa=_0x2b75c2[_0x13d141];if(_[_0x40ac('0x42')](_0x2e9cd6[_0x40ac('0x19')][_0x17d8aa['id']])){_0x2e9cd6[_0x40ac('0x19')][_0x17d8aa['id']]=new VoiceExtension(_0x17d8aa);}else{_0x2e9cd6['mergeFromDatabase'](_0x2e9cd6[_0x40ac('0x19')][_0x17d8aa['id']],_0x17d8aa);}}}return _0x2e9cd6[_0x40ac('0x19')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x68')]=function(){var _0x1c1f90=this;return function(_0x15a878){clearCampaigns(_0x1c1f90['campaigns']);for(var _0x430c6f=0x0;_0x430c6f<_0x15a878['length'];_0x430c6f+=0x1){_[_0x40ac('0x52')](_0x1c1f90[_0x40ac('0x16')][_0x15a878[_0x430c6f][_0x40ac('0x28')]],_0x15a878[_0x430c6f]);}return _0x1c1f90[_0x40ac('0x16')];};};Realtime[_0x40ac('0x3e')][_0x40ac('0x69')]=function(){var _0x399680=this;return function(_0x193009){if(_0x193009){freeIsNotKey(_0x193009,_0x399680[_0x40ac('0x24')],'id');for(var _0xe47bcb=0x0,_0x14664f={},_0x1e3e5d={};_0xe47bcb<_0x193009[_0x40ac('0x41')];_0xe47bcb+=0x1){_0x14664f=_0x193009[_0xe47bcb];if(_['isUndefined'](_0x399680[_0x40ac('0x24')][_0x14664f['id']])){_0x399680[_0x40ac('0x24')][_0x14664f['id']]=new FaxAccount(_0x14664f);}else{_0x399680['mergeFromDatabase'](_0x399680[_0x40ac('0x24')][_0x14664f['id']],_0x14664f);}}}return _0x399680[_0x40ac('0x24')];};};module[_0x40ac('0x6a')]=Realtime; \ No newline at end of file +var _0x3103=['queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','merge','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','format','interface','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','isNil','initTelephones','isUndefined','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff'];(function(_0x3d87d7,_0x470668){var _0x3823d8=function(_0x1ae3a3){while(--_0x1ae3a3){_0x3d87d7['push'](_0x3d87d7['shift']());}};_0x3823d8(++_0x470668);}(_0x3103,0xe3));var _0x3310=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x3103[_0x13ac10];return _0x28eda2;};'use strict';var BPromise=require('bluebird');var util=require(_0x3310('0x0'));var _=require(_0x3310('0x1'));var moment=require(_0x3310('0x2'));var Agent=require(_0x3310('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x3310('0x4'));var VoiceQueue=require(_0x3310('0x5'));var Trigger=require(_0x3310('0x6'));var Template=require(_0x3310('0x7'));var Campaign=require(_0x3310('0x8'));var VoiceExtension=require(_0x3310('0x9'));var ZendeskAccount=require(_0x3310('0xa'));var SalesforceAccount=require(_0x3310('0xb'));var FreshdeskAccount=require(_0x3310('0xc'));var SugarcrmAccount=require(_0x3310('0xd'));var ZohoAccount=require(_0x3310('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x3310('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x3310('0x10'));var Realtime=function(){this[_0x3310('0x11')]={};this[_0x3310('0x12')]={};this[_0x3310('0x13')]={};this[_0x3310('0x14')]={};this[_0x3310('0x15')]={};this[_0x3310('0x16')]={};this[_0x3310('0x17')]={};this[_0x3310('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3310('0x19')]={};this[_0x3310('0x1a')]={};this[_0x3310('0x1b')]={};this[_0x3310('0x1c')]={};this[_0x3310('0x1d')]={};this['settings']={};this['zendeskAccounts']={};this[_0x3310('0x1e')]={};this[_0x3310('0x1f')]={};this[_0x3310('0x20')]={};this[_0x3310('0x21')]={};this[_0x3310('0x22')]={};this[_0x3310('0x23')]={};this['servicenowAccounts']={};this[_0x3310('0x24')]={};this[_0x3310('0x25')]={};this[_0x3310('0x26')]={};};function freeIsNotKey(_0x22aee1,_0x70224a,_0x20864e){var _0xb32f31=_[_0x3310('0x27')](_0x22aee1,function(_0x5956d6,_0x22b86b){return _0x5956d6[_0x20864e];});for(var _0x309c7a in _0x70224a){if(_0x70224a[_0x3310('0x28')](_0x309c7a)){if(!_0xb32f31[_0x309c7a]){delete _0x70224a[_0x309c7a];}}}}function freeIsNotKeySip(_0x20d9c0,_0x31dca6){var _0x58b723=_['mapKeys'](_0x20d9c0,function(_0x57b71b,_0x16fce3){return util['format'](_0x3310('0x29'),_0x57b71b[_0x3310('0x2a')]);});for(var _0x57ea42 in _0x31dca6){if(_0x31dca6[_0x3310('0x28')](_0x57ea42)){if(!_0x58b723[_0x57ea42]){delete _0x31dca6[_0x57ea42];}}}}function freeIsNotKeyAgent(_0x348608,_0x6fecd3){var _0x4144aa=_[_0x3310('0x27')](_0x348608,function(_0x484dc3,_0x121e1c){var _0x486453=_['isNil'](_0x484dc3['interface'])?util[_0x3310('0x2b')](_0x3310('0x29'),_0x484dc3[_0x3310('0x2a')]):_0x484dc3[_0x3310('0x2c')];return _0x486453;});for(var _0x554295 in _0x6fecd3){if(_0x6fecd3['hasOwnProperty'](_0x554295)){if(!_0x4144aa[_0x554295]){delete _0x6fecd3[_0x554295];}}}}function clearVoiceCallReports(_0x43c131){_0x43c131[_0x3310('0x2d')]=0x0;_0x43c131[_0x3310('0x2e')]=0x0;_0x43c131[_0x3310('0x2f')]=0x0;_0x43c131[_0x3310('0x30')]=0x0;_0x43c131['sumBillable']=0x0;}function clearCampaigns(_0x50e853){if(!_['isEmpty'](_0x50e853)){for(var _0x48440d in _0x50e853){if(_0x50e853[_0x3310('0x28')](_0x48440d)){_0x50e853[_0x48440d][_0x3310('0x31')]=0x0;_0x50e853[_0x48440d][_0x3310('0x32')]=0x0;}}}}function clearVoiceQueues(_0x34edc8){if(!_['isEmpty'](_0x34edc8)){for(var _0x49b7d2 in _0x34edc8){if(_0x34edc8[_0x3310('0x28')](_0x49b7d2)){_0x34edc8[_0x49b7d2][_0x3310('0x2d')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x2e')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x33')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x34')]=0x0;_0x34edc8[_0x49b7d2]['sumHoldTime']=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x30')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x35')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x36')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x37')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x38')]=0x0;_0x34edc8[_0x49b7d2]['outboundCongestionCallsDay']=0x0;_0x34edc8[_0x49b7d2]['outboundNoSuchCallsDay']=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x39')]=0x0;_0x34edc8[_0x49b7d2]['outboundDropCallsDayTimeout']=0x0;_0x34edc8[_0x49b7d2]['outboundDropCallsDayCallersExit']=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x3a')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x3b')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x3c')]=0x0;_0x34edc8[_0x49b7d2]['outboundReCallsDay']=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x36')]=0x0;_0x34edc8[_0x49b7d2][_0x3310('0x3d')]=0x0;_0x34edc8[_0x49b7d2]['queueStatusComplete']=!![];}}}}Realtime[_0x3310('0x3e')][_0x3310('0x3f')]=function(_0x16022e,_0x1431b3){for(var _0xf74ed in _0x1431b3){if(_0x16022e[_0x3310('0x28')](_0xf74ed)){_0x16022e[_0xf74ed]=_0x1431b3[_0xf74ed];}}};Realtime['prototype']['initAgents']=function(){var _0x87cf49=this;return function(_0x3d07b4){if(_0x3d07b4){freeIsNotKeyAgent(_0x3d07b4,_0x87cf49[_0x3310('0x11')]);for(var _0x3de958=0x0,_0x175bd5={},_0x383875={};_0x3de958<_0x3d07b4[_0x3310('0x40')];_0x3de958+=0x1){_0x175bd5=_0x3d07b4[_0x3de958];var _0x56de53=_[_0x3310('0x41')](_0x175bd5[_0x3310('0x2c')])?util[_0x3310('0x2b')](_0x3310('0x29'),_0x175bd5[_0x3310('0x2a')]):_0x175bd5[_0x3310('0x2c')];if(_['isUndefined'](_0x87cf49[_0x3310('0x11')][_0x56de53])){_0x87cf49[_0x3310('0x11')][_0x56de53]=new Agent(_0x175bd5);}else{_0x87cf49['mergeFromDatabase'](_0x87cf49[_0x3310('0x11')][_0x56de53],_0x175bd5);}}}return _0x87cf49[_0x3310('0x11')];};};Realtime['prototype'][_0x3310('0x42')]=function(){var _0x275d02=this;return function(_0xd659c3){if(_0xd659c3){freeIsNotKeySip(_0xd659c3,_0x275d02[_0x3310('0x12')]);for(var _0x4368fd=0x0,_0x2669d7={},_0x5e3dd4={};_0x4368fd<_0xd659c3[_0x3310('0x40')];_0x4368fd+=0x1){_0x2669d7=_0xd659c3[_0x4368fd];if(_['isUndefined'](_0x275d02[_0x3310('0x12')][util[_0x3310('0x2b')](_0x3310('0x29'),_0x2669d7['name'])])){_0x275d02[_0x3310('0x12')][util['format'](_0x3310('0x29'),_0x2669d7[_0x3310('0x2a')])]=new Telephone(_0x2669d7);}else{_0x275d02['mergeFromDatabase'](_0x275d02['telephones'][util[_0x3310('0x2b')]('SIP/%s',_0x2669d7[_0x3310('0x2a')])],_0x2669d7);}}}return _0x275d02[_0x3310('0x12')];};};Realtime[_0x3310('0x3e')]['initTrunks']=function(){var _0x38fafb=this;return function(_0x354e35){if(_0x354e35){freeIsNotKeySip(_0x354e35,_0x38fafb[_0x3310('0x13')]);for(var _0x355786=0x0,_0x369c97={},_0x852243={};_0x355786<_0x354e35['length'];_0x355786+=0x1){_0x369c97=_0x354e35[_0x355786];if(_[_0x3310('0x43')](_0x38fafb[_0x3310('0x13')][util[_0x3310('0x2b')]('SIP/%s',_0x369c97[_0x3310('0x2a')])])){_0x38fafb[_0x3310('0x13')][util['format']('SIP/%s',_0x369c97['name'])]=new Trunk(_0x369c97);}else{_0x38fafb['mergeFromDatabase'](_0x38fafb[_0x3310('0x13')][util['format'](_0x3310('0x29'),_0x369c97[_0x3310('0x2a')])],_0x369c97);}}}return _0x38fafb[_0x3310('0x13')];};};Realtime[_0x3310('0x3e')][_0x3310('0x44')]=function(){var _0x456c11=this;return function(_0x5d4ef1){if(_0x5d4ef1){freeIsNotKey(_0x5d4ef1,_0x456c11['voiceQueues'],'name');for(var _0x4eb513=0x0,_0x3d7e8d={},_0x510e31={};_0x4eb513<_0x5d4ef1['length'];_0x4eb513+=0x1){_0x3d7e8d=_0x5d4ef1[_0x4eb513];if(_[_0x3310('0x43')](_0x456c11[_0x3310('0x14')][_0x3d7e8d[_0x3310('0x2a')]])){_0x456c11['voiceQueues'][_0x3d7e8d[_0x3310('0x2a')]]=new VoiceQueue(_0x3d7e8d);}else{_0x456c11[_0x3310('0x3f')](_0x456c11['voiceQueues'][_0x3d7e8d['name']],_0x3d7e8d);}}}return _0x456c11['voiceQueues'];};};Realtime[_0x3310('0x3e')][_0x3310('0x45')]=function(){var _0x45aef5=this;return function(_0x3396ee){if(_0x3396ee){freeIsNotKey(_0x3396ee,_0x45aef5['triggers'],'id');for(var _0x59b0c9=0x0,_0xb6a9e5={},_0x586d39={};_0x59b0c9<_0x3396ee['length'];_0x59b0c9+=0x1){_0xb6a9e5=_0x3396ee[_0x59b0c9];if(_[_0x3310('0x43')](_0x45aef5[_0x3310('0x15')][_0xb6a9e5['id']])){_0x45aef5['triggers'][_0xb6a9e5['id']]=new Trigger(_0xb6a9e5);}else{_0x45aef5[_0x3310('0x3f')](_0x45aef5['triggers'][_0xb6a9e5['id']],_0xb6a9e5);}}}return _0x45aef5['triggers'];};};Realtime[_0x3310('0x3e')][_0x3310('0x46')]=function(){var _0x12aa86=this;return function(_0x3042c2){if(_0x3042c2){freeIsNotKey(_0x3042c2,_0x12aa86['templates'],'id');for(var _0x436b8f=0x0,_0x3e5b8a={},_0x30d37a={};_0x436b8f<_0x3042c2['length'];_0x436b8f+=0x1){_0x3e5b8a=_0x3042c2[_0x436b8f];if(_[_0x3310('0x43')](_0x12aa86[_0x3310('0x17')][_0x3e5b8a['id']])){_0x12aa86[_0x3310('0x17')][_0x3e5b8a['id']]=new Template(_0x3e5b8a);}else{_0x12aa86[_0x3310('0x3f')](_0x12aa86[_0x3310('0x17')][_0x3e5b8a['id']],_0x3e5b8a);}}}return _0x12aa86['templates'];};};Realtime['prototype'][_0x3310('0x47')]=function(){var _0x4a9e7b=this;return function(_0x576cde){if(_0x576cde){freeIsNotKey(_0x576cde,_0x4a9e7b[_0x3310('0x48')],'id');for(var _0x520b7b=0x0,_0x32d430={},_0x126c49={};_0x520b7b<_0x576cde[_0x3310('0x40')];_0x520b7b+=0x1){_0x32d430=_0x576cde[_0x520b7b];if(_['isUndefined'](_0x4a9e7b[_0x3310('0x48')][_0x32d430['id']])){_0x4a9e7b['zendeskAccounts'][_0x32d430['id']]=new ZendeskAccount(_0x32d430);}else{_0x4a9e7b[_0x3310('0x3f')](_0x4a9e7b[_0x3310('0x48')][_0x32d430['id']],_0x32d430);}}}return _0x4a9e7b['zendeskAccounts'];};};Realtime[_0x3310('0x3e')][_0x3310('0x49')]=function(){var _0x2abe74=this;return function(_0x1d4f5f){if(_0x1d4f5f){freeIsNotKey(_0x1d4f5f,_0x2abe74['salesforceAccounts'],'id');for(var _0x541d0d=0x0,_0x5a204a={},_0x4100a1={};_0x541d0d<_0x1d4f5f[_0x3310('0x40')];_0x541d0d+=0x1){_0x5a204a=_0x1d4f5f[_0x541d0d];if(_[_0x3310('0x43')](_0x2abe74[_0x3310('0x1e')][_0x5a204a['id']])){_0x2abe74[_0x3310('0x1e')][_0x5a204a['id']]=new SalesforceAccount(_0x5a204a);}else{_0x2abe74['mergeFromDatabase'](_0x2abe74[_0x3310('0x1e')][_0x5a204a['id']],_0x5a204a);}}}return _0x2abe74[_0x3310('0x1e')];};};Realtime[_0x3310('0x3e')]['initFreshdeskAccounts']=function(){var _0x10f684=this;return function(_0x38a169){if(_0x38a169){freeIsNotKey(_0x38a169,_0x10f684['freshdeskAccounts'],'id');for(var _0x12bcb5=0x0,_0x5b1b56={},_0x5446cd={};_0x12bcb5<_0x38a169[_0x3310('0x40')];_0x12bcb5+=0x1){_0x5b1b56=_0x38a169[_0x12bcb5];if(_[_0x3310('0x43')](_0x10f684[_0x3310('0x20')][_0x5b1b56['id']])){_0x10f684[_0x3310('0x20')][_0x5b1b56['id']]=new FreshdeskAccount(_0x5b1b56);}else{_0x10f684[_0x3310('0x3f')](_0x10f684[_0x3310('0x20')][_0x5b1b56['id']],_0x5b1b56);}}}return _0x10f684[_0x3310('0x20')];};};Realtime[_0x3310('0x3e')][_0x3310('0x4a')]=function(){var _0x37bd96=this;return function(_0x47349e){if(_0x47349e){freeIsNotKey(_0x47349e,_0x37bd96[_0x3310('0x21')],'id');for(var _0xc731c6=0x0,_0x2d1b91={},_0x478238={};_0xc731c6<_0x47349e['length'];_0xc731c6+=0x1){_0x2d1b91=_0x47349e[_0xc731c6];if(_[_0x3310('0x43')](_0x37bd96[_0x3310('0x21')][_0x2d1b91['id']])){_0x37bd96[_0x3310('0x21')][_0x2d1b91['id']]=new ZohoAccount(_0x2d1b91);}else{_0x37bd96[_0x3310('0x3f')](_0x37bd96[_0x3310('0x21')][_0x2d1b91['id']],_0x2d1b91);}}}return _0x37bd96[_0x3310('0x21')];};};Realtime[_0x3310('0x3e')][_0x3310('0x4b')]=function(){var _0x15e89d=this;return function(_0x2ee0c8){if(_0x2ee0c8){freeIsNotKey(_0x2ee0c8,_0x15e89d['deskAccounts'],'id');for(var _0x5d8c88=0x0,_0x590ddb={},_0x207a9c={};_0x5d8c88<_0x2ee0c8['length'];_0x5d8c88+=0x1){_0x590ddb=_0x2ee0c8[_0x5d8c88];if(_[_0x3310('0x43')](_0x15e89d['deskAccounts'][_0x590ddb['id']])){_0x15e89d[_0x3310('0x22')][_0x590ddb['id']]=new DeskAccount(_0x590ddb);}else{_0x15e89d[_0x3310('0x3f')](_0x15e89d[_0x3310('0x22')][_0x590ddb['id']],_0x590ddb);}}}return _0x15e89d['deskAccounts'];};};Realtime[_0x3310('0x3e')][_0x3310('0x4c')]=function(){var _0x489b63=this;return function(_0x44937a){if(_0x44937a){freeIsNotKey(_0x44937a,_0x489b63['sugarcrmAccounts'],'id');for(var _0xb85734=0x0,_0x218e78={},_0x3505fa={};_0xb85734<_0x44937a[_0x3310('0x40')];_0xb85734+=0x1){_0x218e78=_0x44937a[_0xb85734];if(_['isUndefined'](_0x489b63['sugarcrmAccounts'][_0x218e78['id']])){_0x489b63[_0x3310('0x1f')][_0x218e78['id']]=new SugarcrmAccount(_0x218e78);}else{_0x489b63[_0x3310('0x3f')](_0x489b63['sugarcrmAccounts'][_0x218e78['id']],_0x218e78);}}}return _0x489b63['sugarcrmAccounts'];};};Realtime[_0x3310('0x3e')][_0x3310('0x4d')]=function(){var _0xc498d2=this;return function(_0x3e2edc){if(_0x3e2edc){freeIsNotKey(_0x3e2edc,_0xc498d2['vtigerAccounts'],'id');for(var _0x11a307=0x0,_0x4173e2={},_0x568e11={};_0x11a307<_0x3e2edc['length'];_0x11a307+=0x1){_0x4173e2=_0x3e2edc[_0x11a307];if(_[_0x3310('0x43')](_0xc498d2['vtigerAccounts'][_0x4173e2['id']])){_0xc498d2[_0x3310('0x23')][_0x4173e2['id']]=new VtigerAccount(_0x4173e2);}else{_0xc498d2[_0x3310('0x3f')](_0xc498d2[_0x3310('0x23')][_0x4173e2['id']],_0x4173e2);}}}return _0xc498d2[_0x3310('0x23')];};};Realtime['prototype'][_0x3310('0x4e')]=function(){var _0x5923ef=this;return function(_0x30fb12){if(_0x30fb12){freeIsNotKey(_0x30fb12,_0x5923ef[_0x3310('0x4f')],'id');for(var _0x41cb27=0x0,_0x42eb1e={},_0x3f98d8={};_0x41cb27<_0x30fb12[_0x3310('0x40')];_0x41cb27+=0x1){_0x42eb1e=_0x30fb12[_0x41cb27];if(_['isUndefined'](_0x5923ef[_0x3310('0x4f')][_0x42eb1e['id']])){_0x5923ef[_0x3310('0x4f')][_0x42eb1e['id']]=new ServicenowAccount(_0x42eb1e);}else{_0x5923ef[_0x3310('0x3f')](_0x5923ef[_0x3310('0x4f')][_0x42eb1e['id']],_0x42eb1e);}}}return _0x5923ef[_0x3310('0x4f')];};};Realtime[_0x3310('0x3e')][_0x3310('0x50')]=function(){var _0x52c337=this;return function(_0x5afc44){if(_0x5afc44){freeIsNotKey(_0x5afc44,_0x52c337['dynamics365Accounts'],'id');for(var _0x311437=0x0,_0x26fc4f={},_0x54acd8={};_0x311437<_0x5afc44[_0x3310('0x40')];_0x311437+=0x1){_0x26fc4f=_0x5afc44[_0x311437];if(_[_0x3310('0x43')](_0x52c337[_0x3310('0x24')][_0x26fc4f['id']])){_0x52c337[_0x3310('0x24')][_0x26fc4f['id']]=new Dynamics365Account(_0x26fc4f);}else{_0x52c337[_0x3310('0x3f')](_0x52c337[_0x3310('0x24')][_0x26fc4f['id']],_0x26fc4f);}}}return _0x52c337[_0x3310('0x24')];};};Realtime[_0x3310('0x3e')]['initFreshsalesAccounts']=function(){var _0x2a3f39=this;return function(_0x2a8ab7){if(_0x2a8ab7){freeIsNotKey(_0x2a8ab7,_0x2a3f39[_0x3310('0x25')],'id');for(var _0x3c72a4=0x0,_0x2e4214={},_0x2e2a3c={};_0x3c72a4<_0x2a8ab7[_0x3310('0x40')];_0x3c72a4+=0x1){_0x2e4214=_0x2a8ab7[_0x3c72a4];if(_[_0x3310('0x43')](_0x2a3f39['freshsalesAccounts'][_0x2e4214['id']])){_0x2a3f39[_0x3310('0x25')][_0x2e4214['id']]=new FreshsalesAccount(_0x2e4214);}else{_0x2a3f39[_0x3310('0x3f')](_0x2a3f39[_0x3310('0x25')][_0x2e4214['id']],_0x2e4214);}}}return _0x2a3f39['freshsalesAccounts'];};};Realtime['prototype'][_0x3310('0x51')]=function(){var _0x9e0ae9=this;return function(_0x51f280){for(var _0x258847=0x0;_0x258847<_0x51f280['length'];_0x258847+=0x1){_['merge'](_0x9e0ae9['voiceQueues'][_0x51f280[_0x258847][_0x3310('0x2a')]],_0x51f280[_0x258847]);}return _0x9e0ae9[_0x3310('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x12c390=this;return function(_0x20c5cd){clearVoiceQueues(_0x12c390[_0x3310('0x14')]);if(_0x20c5cd){_0x20c5cd=_['groupBy'](_0x20c5cd,_0x3310('0x52'));for(var _0xa604bc in _0x20c5cd){if(_0x20c5cd[_0x3310('0x28')](_0xa604bc)){var _0x3a5644={};for(var _0x3e81eb=0x0;_0x3e81eb<_0x20c5cd[_0xa604bc]['length'];_0x3e81eb+=0x1){var _0x41d919=_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x53')];if(_0x12c390[_0x3310('0x14')][_0x41d919]){if(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x54')]){_0x12c390[_0x3310('0x14')][_0x41d919]['unmanaged']+=0x1;}if(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x55')]){_0x12c390[_0x3310('0x14')][_0x41d919][_0x3310('0x34')]+=0x1;}_0x12c390[_0x3310('0x14')][_0x41d919][_0x3310('0x2f')]+=moment(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x56')])[_0x3310('0x57')](moment(_0x20c5cd[_0xa604bc][_0x3e81eb]['queuecallerjoinAt']),'seconds')||0x0;if(_0x3e81eb===_0x20c5cd[_0xa604bc][_0x3310('0x40')]-0x1){_0x12c390['voiceQueues'][_0x41d919][_0x3310('0x30')]+=moment(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x58')]||_0x20c5cd[_0xa604bc][_0x3e81eb]['queuecallerabandonAt']||_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x59')])[_0x3310('0x57')](moment(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x5a')]),_0x3310('0x5b'))||0x0;_0x12c390['voiceQueues'][_0x41d919][_0x3310('0x2d')]+=0x1;if(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x5c')]){_0x12c390[_0x3310('0x14')][_0x41d919][_0x3310('0x2e')]+=0x1;_0x12c390[_0x3310('0x14')][_0x41d919]['sumBillable']+=moment(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x58')])[_0x3310('0x57')](moment(_0x20c5cd[_0xa604bc][_0x3e81eb][_0x3310('0x56')]),_0x3310('0x5b'))||0x0;}}else{_0x12c390['voiceQueues'][_0x41d919]['sumDuration']+=_0x12c390[_0x3310('0x14')][_0x41d919][_0x3310('0x2f')]||0x0;}}}}}}return _0x12c390[_0x3310('0x14')];};};Realtime[_0x3310('0x3e')][_0x3310('0x5d')]=function(){var _0x46973b=this;return function(_0x224c29){clearVoiceCallReports(_0x46973b[_0x3310('0x18')]);if(_0x224c29){for(var _0x24c376=0x0;_0x24c376<_0x224c29[_0x3310('0x40')];_0x24c376+=0x1){_0x46973b[_0x3310('0x18')]['total']+=0x1;_0x46973b['outbound']['sumDuration']+=_0x224c29[_0x24c376][_0x3310('0x5e')];if(_0x224c29[_0x24c376][_0x3310('0x5f')]===_0x3310('0x60')){_0x46973b[_0x3310('0x18')][_0x3310('0x2e')]+=0x1;_0x46973b[_0x3310('0x18')][_0x3310('0x2f')]+=_0x224c29[_0x24c376][_0x3310('0x5e')]-_0x224c29[_0x24c376][_0x3310('0x61')]||0x0;_0x46973b[_0x3310('0x18')][_0x3310('0x35')]+=_0x224c29[_0x24c376][_0x3310('0x61')];}}}return _0x46973b['outbound'];};};Realtime['prototype'][_0x3310('0x62')]=function(){var _0x474e99=this;return function(_0x20146d){if(_0x20146d){freeIsNotKey(_0x20146d,_0x474e99[_0x3310('0x16')],_0x3310('0x2a'));for(var _0x34bb9a=0x0,_0x454198={};_0x34bb9a<_0x20146d[_0x3310('0x40')];_0x34bb9a+=0x1){_0x454198=_0x20146d[_0x34bb9a];if(_['isUndefined'](_0x474e99['campaigns'][_0x454198['name']])){_0x474e99[_0x3310('0x16')][_0x454198[_0x3310('0x2a')]]=new Campaign(_0x454198);}else{_0x474e99[_0x3310('0x3f')](_0x474e99[_0x3310('0x16')][_0x454198[_0x3310('0x2a')]],_0x454198);_0x474e99[_0x3310('0x16')][_0x454198[_0x3310('0x2a')]][_0x3310('0x63')]=_0x454198[_0x3310('0x64')]?_0x454198[_0x3310('0x64')]['name']:undefined;}}}return _0x474e99[_0x3310('0x16')];};};Realtime[_0x3310('0x3e')]['initVoiceExtensions']=function(){var _0x5bf229=this;return function(_0xe4ef09){if(_0xe4ef09){freeIsNotKey(_0xe4ef09,_0x5bf229[_0x3310('0x19')],'id');for(var _0x6dedd5=0x0,_0x55a767={};_0x6dedd5<_0xe4ef09[_0x3310('0x40')];_0x6dedd5+=0x1){_0x55a767=_0xe4ef09[_0x6dedd5];if(_['isUndefined'](_0x5bf229['voiceExtensions'][_0x55a767['id']])){_0x5bf229[_0x3310('0x19')][_0x55a767['id']]=new VoiceExtension(_0x55a767);}else{_0x5bf229[_0x3310('0x3f')](_0x5bf229['voiceExtensions'][_0x55a767['id']],_0x55a767);}}}return _0x5bf229[_0x3310('0x19')];};};Realtime[_0x3310('0x3e')][_0x3310('0x65')]=function(){var _0x5cd6f1=this;return function(_0x3122c0){clearCampaigns(_0x5cd6f1['campaigns']);for(var _0x974c3e=0x0;_0x974c3e<_0x3122c0[_0x3310('0x40')];_0x974c3e+=0x1){_[_0x3310('0x66')](_0x5cd6f1[_0x3310('0x16')][_0x3122c0[_0x974c3e][_0x3310('0x2a')]],_0x3122c0[_0x974c3e]);}return _0x5cd6f1['campaigns'];};};Realtime['prototype'][_0x3310('0x67')]=function(){var _0x2d0523=this;return function(_0x5298b5){if(_0x5298b5){freeIsNotKey(_0x5298b5,_0x2d0523[_0x3310('0x26')],'id');for(var _0x26fa55=0x0,_0xc3e40e={},_0x1f8d36={};_0x26fa55<_0x5298b5[_0x3310('0x40')];_0x26fa55+=0x1){_0xc3e40e=_0x5298b5[_0x26fa55];if(_[_0x3310('0x43')](_0x2d0523['faxAccounts'][_0xc3e40e['id']])){_0x2d0523[_0x3310('0x26')][_0xc3e40e['id']]=new FaxAccount(_0xc3e40e);}else{_0x2d0523[_0x3310('0x3f')](_0x2d0523[_0x3310('0x26')][_0xc3e40e['id']],_0xc3e40e);}}}return _0x2d0523['faxAccounts'];};};module[_0x3310('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 9958dee..ec51068 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x463a=['mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceDialReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','channel','split','getAgentByInternal','outbound','internal','exten','dialer','lastapplication','queue','context','from-voip-provider','destination','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','callerid','calleridpreview','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','voiceDialReport','startsWith','indexOf'];(function(_0x33a432,_0x1acced){var _0x45bd47=function(_0x215360){while(--_0x215360){_0x33a432['push'](_0x33a432['shift']());}};_0x45bd47(++_0x1acced);}(_0x463a,0x11d));var _0xa463=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x463a[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var moment=require(_0xa463('0x0'));var util=require(_0xa463('0x1'));var config=require(_0xa463('0x2'));var ami=require(_0xa463('0x3'));var RpcVoiceAgentReport=require(_0xa463('0x4'));var RpcVoiceCallReport=require(_0xa463('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xa463('0x6'));var RpcVoiceRecording=require(_0xa463('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa463('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xa463('0x9'));var UserReport=require('./userReport');function Report(_0x2e80da){this[_0xa463('0xa')]=_0x2e80da;this[_0xa463('0xb')]=_0x2e80da[_0xa463('0xb')];this['telephones']=_0x2e80da[_0xa463('0xc')];}Report['prototype'][_0xa463('0xd')]=function(_0x18d3f1){var _0x7969b9=new VoiceQueueReport(this[_0xa463('0xa')]);var _0x19414e=new VoiceAgentReport(this[_0xa463('0xa')]);var _0x1113c9=new VoiceDialReport(this[_0xa463('0xa')]);var _0x2dd211=new VoiceCallReport(this['realtime']);var _0x29f2f5=new UserReport(this[_0xa463('0xa')]);if(config[_0xa463('0xe')]&&config[_0xa463('0xe')]['disabled']){ami['on'](_0xa463('0xf'),this['voiceQueueReport'][_0xa463('0x10')](this));ami['on'](_0xa463('0x11'),this[_0xa463('0x12')][_0xa463('0x10')](this));ami['on'](_0xa463('0x13'),this['voiceAgentReport'][_0xa463('0x10')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0xa463('0x10')](this));ami['on'](_0xa463('0x14'),this[_0xa463('0x15')]['bind'](this));ami['on'](_0xa463('0x16'),this[_0xa463('0x17')][_0xa463('0x10')](this));}};Report[_0xa463('0x18')][_0xa463('0x19')]=function(_0x36cbc5){var _0x290607;_0x290607=_[_0xa463('0x1a')](this[_0xa463('0xb')],function(_0x4a959b){return _0x4a959b[_0xa463('0x1b')]==_0x36cbc5||_0x4a959b[_0xa463('0x1c')]==_0x36cbc5;});if(_[_0xa463('0x1d')](_0x290607)){var _0x363336=_[_0xa463('0x1a')](this['telephones'],function(_0x4b5d3e){return _0x4b5d3e[_0xa463('0x1b')]==_0x36cbc5||_0x4b5d3e[_0xa463('0x1c')]==_0x36cbc5;});if(_0x363336){_0x290607=_[_0xa463('0x1a')](this[_0xa463('0xb')],function(_0x15f6e8){return _0x15f6e8['interface']==util[_0xa463('0x1e')](_0xa463('0x1f'),_0x363336[_0xa463('0x1c')]);});}}return _0x290607;};Report[_0xa463('0x18')][_0xa463('0x20')]=function(_0x5bb2a1){for(var _0x24024f=0x0;_0x24024f<_0x5bb2a1[_0xa463('0x21')];_0x24024f+=0x1){var _0x551024=this[_0xa463('0x19')](_0x5bb2a1[_0x24024f][_0xa463('0x22')]);if(_0x551024){_0x5bb2a1[_0x24024f]['accountcode']=_0x551024['accountcode'];_0x5bb2a1[_0x24024f][_0xa463('0x23')]=!![];_0x5bb2a1[_0x24024f][_0xa463('0x24')]=_0x551024['name'];_0x5bb2a1[_0x24024f][_0xa463('0x25')]=_[_0xa463('0x1d')](_0x551024[_0xa463('0x25')])?util[_0xa463('0x1e')](_0xa463('0x1f'),_0x551024[_0xa463('0x1c')]):_0x551024['interface'];if(_0x5bb2a1[_0x24024f][_0xa463('0x26')]){_0x5bb2a1[_0x24024f][_0xa463('0x27')]=moment()[_0xa463('0x1e')](_0xa463('0x28'));}if(_0x5bb2a1[_0x24024f][_0xa463('0x29')]){_0x5bb2a1[_0x24024f][_0xa463('0x2a')]=moment()[_0xa463('0x1e')](_0xa463('0x28'));}RpcMemberReport[_0xa463('0x20')](_0x5bb2a1[_0x24024f]);}RpcVoiceQueueReport[_0xa463('0x2b')](_0x5bb2a1[_0x24024f]);}};function extractCalleridNumber(_0x2857af){var _0x22e22f=_0x2857af[_0xa463('0x2c')](/<(.*?)>/);return _0x22e22f?_0x22e22f[0x1]:_0x2857af;}Report[_0xa463('0x18')]['getAgentByInternal']=function(_0x21f8d9){for(var _0x52c1ac=0x0;_0x52c1ac',_0x311faa[_0xa463('0x43')],_0x311faa[_0xa463('0x3d')]);}if(RpcVoiceTransferReport[_0xa463('0x44')][_0x311faa['linkedid']]){var _0x1902b9=RpcVoiceTransferReport[_0xa463('0x44')][_0x311faa[_0xa463('0x45')]];_0x1902b9[_0xa463('0x46')]=_0x311faa[_0xa463('0x47')];RpcVoiceTransferReport['blindTransfer'](_0x1902b9);delete RpcVoiceTransferReport[_0xa463('0x44')][_0x311faa[_0xa463('0x45')]];}if(_[_0xa463('0x1d')](_0x311faa[_0xa463('0x48')])){_0x311faa[_0xa463('0x48')]=this['getCallType'](_0x311faa);}if(_[_0xa463('0x1d')](_0x311faa[_0xa463('0x49')])){var _0x5797e7=_0x311faa[_0xa463('0x2f')]['split']('-')[0x0];var _0x49409b=this[_0xa463('0xb')][_0x5797e7];if(!_0x49409b)_0x49409b=this[_0xa463('0x31')](_0x311faa[_0xa463('0x1b')]);if(_0x49409b){_0x311faa[_0xa463('0x49')]=_0x49409b['id'];_0x311faa[_0xa463('0x4a')]=_0x49409b[_0xa463('0x1c')];}}RpcVoiceCallReport[_0xa463('0x2b')](_0x311faa);if(_0x311faa[_0xa463('0x4b')]){for(var _0x1761eb=0x0;_0x1761eb<_0x311faa[_0xa463('0x4c')][_0xa463('0x21')];_0x1761eb+=0x1){_0x311faa[_0xa463('0x4d')]=_0x311faa[_0xa463('0x4c')][_0x1761eb]['filename'];_0x311faa[_0xa463('0x4e')]=_0x311faa[_0xa463('0x4c')][_0x1761eb]['createdAt'];if(_0x311faa[_0xa463('0x34')]=='xcally-motion-preview'){_0x311faa[_0xa463('0x3d')]=_0x311faa['connectedlinenum'];_0x311faa[_0xa463('0x43')]=_0x311faa[_0xa463('0x4f')];_0x311faa[_0xa463('0x22')]=_0x311faa[_0xa463('0x1b')];_0x311faa[_0xa463('0x4f')]=_0x311faa[_0xa463('0x4a')];_0x311faa[_0xa463('0x34')]=_0x311faa[_0xa463('0x3e')];}else if(_0x311faa['exten']==_0xa463('0x50')){_0x311faa[_0xa463('0x3d')]=_0x311faa[_0xa463('0x3a')];_0x311faa['exten']=_0x311faa[_0xa463('0x3e')];}RpcVoiceRecording[_0xa463('0x2b')](_0x311faa);}}};Report['prototype'][_0xa463('0x51')]=function(_0x10713f){if(_[_0xa463('0x52')](_0x10713f)){_0x10713f[_0xa463('0x53')](function(_0x5dbc9f){RpcVoiceAgentReport[_0xa463('0x2b')](_0x5dbc9f);});}else{RpcVoiceAgentReport['create'](_0x10713f);}};Report[_0xa463('0x18')][_0xa463('0x54')]=function(_0x15fde8){RpcVoiceDialReport[_0xa463('0x2b')](_0x15fde8);var _0x466316;var _0x39ca13;var _0x2d0d21=_0x15fde8[_0xa463('0x2f')];if(_[_0xa463('0x55')](_0x2d0d21,'Local')){_0x39ca13=_0x2d0d21['substring'](_0x2d0d21[_0xa463('0x56')]('/')+0x1,_0x2d0d21['indexOf']('@'));_0x466316=_[_0xa463('0x1a')](this[_0xa463('0xb')],function(_0x3c1bf3){return _0x3c1bf3[_0xa463('0x57')]==_0x39ca13||_0x3c1bf3[_0xa463('0x58')]==_0x39ca13||_0x3c1bf3[_0xa463('0x1b')]==_0x39ca13;});}else{_0x39ca13=_0x2d0d21[_0xa463('0x59')](_0x2d0d21[_0xa463('0x56')]('/')+0x1,_0x2d0d21[_0xa463('0x5a')]('-'));_0x466316=this[_0xa463('0x19')](_0x39ca13);}if(_0x466316){_0x15fde8[_0xa463('0x25')]=_[_0xa463('0x1d')](_0x466316[_0xa463('0x25')])?util[_0xa463('0x1e')]('SIP/%s',_0x466316[_0xa463('0x1c')]):_0x466316[_0xa463('0x25')];_0x15fde8[_0xa463('0x4a')]=_0x466316[_0xa463('0x1c')];_0x15fde8[_0xa463('0x1b')]=_0x466316['accountcode'];RpcMemberReport['voiceDialReport'](_0x15fde8);}};Report[_0xa463('0x18')]['blindTransfer']=function(_0x502743){RpcVoiceTransferReport[_0xa463('0x44')][_0x502743[_0xa463('0x5b')]]=_0x502743;};Report[_0xa463('0x18')][_0xa463('0x17')]=function(_0x38e085){RpcVoiceTransferReport[_0xa463('0x17')](_0x38e085);};module[_0xa463('0x5c')]=Report; \ No newline at end of file +var _0x7b42=['startsWith','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','accountcode','name','find','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','isNil','monitor','monitorFilename','monitors','createdAt','membername','xcally-motion-dialer','isArray','forEach'];(function(_0x29026c,_0x176feb){var _0x2aba2f=function(_0x40846a){while(--_0x40846a){_0x29026c['push'](_0x29026c['shift']());}};_0x2aba2f(++_0x176feb);}(_0x7b42,0xca));var _0x27b4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7b42[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x27b4('0x0'));var moment=require('moment');var util=require(_0x27b4('0x1'));var config=require(_0x27b4('0x2'));var ami=require(_0x27b4('0x3'));var RpcVoiceAgentReport=require(_0x27b4('0x4'));var RpcVoiceCallReport=require(_0x27b4('0x5'));var RpcVoiceDialReport=require(_0x27b4('0x6'));var RpcMemberReport=require(_0x27b4('0x7'));var RpcVoiceQueueReport=require(_0x27b4('0x8'));var RpcVoiceRecording=require(_0x27b4('0x9'));var RpcVoiceTransferReport=require(_0x27b4('0xa'));var VoiceQueueReport=require(_0x27b4('0xb'));var VoiceCallReport=require(_0x27b4('0xc'));var VoiceAgentReport=require(_0x27b4('0xd'));var VoiceDialReport=require(_0x27b4('0xe'));var UserReport=require(_0x27b4('0xf'));function Report(_0xf9effe){this[_0x27b4('0x10')]=_0xf9effe;this[_0x27b4('0x11')]=_0xf9effe['agents'];this[_0x27b4('0x12')]=_0xf9effe[_0x27b4('0x12')];}Report['prototype'][_0x27b4('0x13')]=function(_0x4728a2){var _0x5f3f2e=new VoiceQueueReport(this['realtime']);var _0xf84826=new VoiceAgentReport(this[_0x27b4('0x10')]);var _0x567cdd=new VoiceDialReport(this[_0x27b4('0x10')]);var _0x130379=new VoiceCallReport(this[_0x27b4('0x10')]);var _0x39361d=new UserReport(this[_0x27b4('0x10')]);if(config[_0x27b4('0x14')]&&config[_0x27b4('0x14')]['disabled']){ami['on'](_0x27b4('0x15'),this[_0x27b4('0x16')][_0x27b4('0x17')](this));ami['on']('custom:voiceCallReport',this[_0x27b4('0x18')][_0x27b4('0x17')](this));ami['on'](_0x27b4('0x19'),this['voiceAgentReport'][_0x27b4('0x17')](this));ami['on'](_0x27b4('0x1a'),this[_0x27b4('0x1b')][_0x27b4('0x17')](this));ami['on'](_0x27b4('0x1c'),this[_0x27b4('0x1d')]['bind'](this));ami['on'](_0x27b4('0x1e'),this['attendedTransfer'][_0x27b4('0x17')](this));}};Report[_0x27b4('0x1f')][_0x27b4('0x20')]=function(_0x557a68){var _0x54fa50;_0x54fa50=_['find'](this[_0x27b4('0x11')],function(_0x56ecfd){return _0x56ecfd[_0x27b4('0x21')]==_0x557a68||_0x56ecfd[_0x27b4('0x22')]==_0x557a68;});if(_['isNil'](_0x54fa50)){var _0x41135f=_['find'](this[_0x27b4('0x12')],function(_0x15cb21){return _0x15cb21[_0x27b4('0x21')]==_0x557a68||_0x15cb21[_0x27b4('0x22')]==_0x557a68;});if(_0x41135f){_0x54fa50=_[_0x27b4('0x23')](this[_0x27b4('0x11')],function(_0x17f4ef){return _0x17f4ef['interface']==util[_0x27b4('0x24')](_0x27b4('0x25'),_0x41135f['name']);});}}return _0x54fa50;};Report[_0x27b4('0x1f')][_0x27b4('0x16')]=function(_0x103910){for(var _0x498d23=0x0;_0x498d23<_0x103910[_0x27b4('0x26')];_0x498d23+=0x1){var _0x302d48=this['findAgent'](_0x103910[_0x498d23][_0x27b4('0x27')]);if(_0x302d48){_0x103910[_0x498d23][_0x27b4('0x21')]=_0x302d48[_0x27b4('0x21')];_0x103910[_0x498d23][_0x27b4('0x28')]=!![];_0x103910[_0x498d23][_0x27b4('0x29')]=_0x302d48[_0x27b4('0x22')];_0x103910[_0x498d23]['interface']=_['isNil'](_0x302d48[_0x27b4('0x2a')])?util[_0x27b4('0x24')]('SIP/%s',_0x302d48[_0x27b4('0x22')]):_0x302d48[_0x27b4('0x2a')];if(_0x103910[_0x498d23][_0x27b4('0x2b')]){_0x103910[_0x498d23][_0x27b4('0x2c')]=moment()[_0x27b4('0x24')](_0x27b4('0x2d'));}if(_0x103910[_0x498d23][_0x27b4('0x2e')]){_0x103910[_0x498d23][_0x27b4('0x2f')]=moment()['format'](_0x27b4('0x2d'));}RpcMemberReport[_0x27b4('0x16')](_0x103910[_0x498d23]);}RpcVoiceQueueReport[_0x27b4('0x30')](_0x103910[_0x498d23]);}};function extractCalleridNumber(_0x3d1ad2){var _0x537c57=_0x3d1ad2[_0x27b4('0x31')](/<(.*?)>/);return _0x537c57?_0x537c57[0x1]:_0x3d1ad2;}Report[_0x27b4('0x1f')][_0x27b4('0x32')]=function(_0x49e7cb){for(var _0x12b622=0x0;_0x12b6220x0?_0x582cb9:0x0;this[_0xdcbd('0x13')][_0xbe3372[_0xdcbd('0x69')]][_0xdcbd('0x31')]=this[_0xdcbd('0x13')][_0xbe3372[_0xdcbd('0x69')]][_0xdcbd('0x31')]>_[_0xdcbd('0x6f')](_0xbe3372[_0xdcbd('0x70')])?_[_0xdcbd('0x6f')](_0xbe3372['loggedin']):this[_0xdcbd('0x13')][_0xbe3372[_0xdcbd('0x69')]][_0xdcbd('0x31')];this[_0xdcbd('0x71')](this['voiceQueues'][_0xbe3372[_0xdcbd('0x69')]],_0xdcbd('0x17'));}logger[_0xdcbd('0x46')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xdcbd('0x3f')](this['voiceQueues'][_0xbe3372[_0xdcbd('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0xdcbd('0x72'),this[_0xdcbd('0x13')][_0xbe3372['queue']]);}}}catch(_0x311ca5){logger[_0xdcbd('0x3d')](_0xdcbd('0x73'),util[_0xdcbd('0x3f')](_0x311ca5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0x1b')]=function(_0x4d9b2a){logger[_0xdcbd('0x46')](_0xdcbd('0x74'),util[_0xdcbd('0x3f')](_0x4d9b2a,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0x1d')]=function(_0x357a1b){try{if(this[_0xdcbd('0x64')](_0x357a1b)){logger[_0xdcbd('0x46')]('[%s][voiceQueueReport][queuecallerjoin]',_0x357a1b[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x357a1b,{'showHidden':![],'depth':null}));if(_[_0xdcbd('0x75')](this[_0xdcbd('0xf')][_0x357a1b[_0xdcbd('0x49')]]))this[_0xdcbd('0xf')][_0x357a1b[_0xdcbd('0x49')]]=[];if(_[_0xdcbd('0x75')](this[_0xdcbd('0x11')][_0x357a1b['uniqueid']]))this[_0xdcbd('0x11')][_0x357a1b[_0xdcbd('0x49')]]={};var _0x197207=new QueueReport();_0x197207['name']=_0x357a1b[_0xdcbd('0x69')];_0x197207['type']=this[_0xdcbd('0x13')][_0x197207[_0xdcbd('0x4c')]]&&this[_0xdcbd('0x13')][_0x197207[_0xdcbd('0x4c')]][_0xdcbd('0x50')]?this[_0xdcbd('0x13')][_0x197207['name']]['type']||'inbound':_0xdcbd('0x51');_0x197207[_0xdcbd('0x69')]=_0x357a1b[_0xdcbd('0x69')];_0x197207['queuecallerjoinAt']=moment()[_0xdcbd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x197207[_0xdcbd('0x76')]=_0x357a1b[_0xdcbd('0x76')];_0x197207[_0xdcbd('0x77')]=_0x357a1b[_0xdcbd('0x77')];_0x197207[_0xdcbd('0x49')]=_0x357a1b['uniqueid'];_0x197207['routealias']=this[_0xdcbd('0x11')][_0x357a1b['uniqueid']]['routealias'];logger[_0xdcbd('0x6b')](_0xdcbd('0x78'),_0x197207[_0xdcbd('0x4c')],_0x197207[_0xdcbd('0x50')]);_[_0xdcbd('0x79')](_0x197207,_[_0xdcbd('0x7a')](_0x357a1b,_[_0xdcbd('0x7b')](_0x197207)));this['queueReports'][_0x357a1b[_0xdcbd('0x49')]][_0xdcbd('0x7c')](_0x197207);this[_0xdcbd('0x11')][_0x357a1b['uniqueid']]=_0x197207;this[_0xdcbd('0x45')](_0x197207,_0xdcbd('0x1c'));}}catch(_0x417bf8){logger[_0xdcbd('0x3d')](_0xdcbd('0x7d'),_0x357a1b[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x417bf8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')]['syncQueueCallerAbandon']=function(_0x884bc5){try{if(this[_0xdcbd('0x64')](_0x884bc5)){logger['debug'](_0xdcbd('0x7e'),_0x884bc5[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x884bc5,{'showHidden':![],'depth':null}));if(this[_0xdcbd('0xf')][_0x884bc5[_0xdcbd('0x49')]]){var _0x3fd1dd=_[_0xdcbd('0x7f')](this[_0xdcbd('0xf')][_0x884bc5[_0xdcbd('0x49')]]);_0x3fd1dd['queuecallercomplete']=![];_0x3fd1dd[_0xdcbd('0x80')]=null;_0x3fd1dd[_0xdcbd('0x81')]=_0x884bc5['holdtime'];_0x3fd1dd[_0xdcbd('0x82')]=_0x884bc5['originalposition'];_0x3fd1dd[_0xdcbd('0x1e')]=!![];_0x3fd1dd[_0xdcbd('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fd1dd[_0xdcbd('0x84')]=_0xdcbd('0x85');_0x3fd1dd[_0xdcbd('0x86')]=null;logger[_0xdcbd('0x6b')](_0xdcbd('0x87'),_0x3fd1dd[_0xdcbd('0x4c')],_0x3fd1dd[_0xdcbd('0x50')]);this[_0xdcbd('0x11')][_0x884bc5[_0xdcbd('0x49')]]=_0x3fd1dd;this['emitVoiceQueueChannelRemove'](_0x3fd1dd,'queuecallerabandon');}}}catch(_0x5682ee){logger[_0xdcbd('0x3d')](_0xdcbd('0x7e'),_0x884bc5[_0xdcbd('0x49')],util['inspect'](_0x5682ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0x88')]=function(_0x486867){try{if(this[_0xdcbd('0x64')](_0x486867)){logger[_0xdcbd('0x46')](_0xdcbd('0x89'),_0x486867['uniqueid'],util[_0xdcbd('0x3f')](_0x486867,{'showHidden':![],'depth':null}));if(this[_0xdcbd('0xf')][_0x486867[_0xdcbd('0x49')]]){var _0xef0742=_[_0xdcbd('0x7f')](this[_0xdcbd('0xf')][_0x486867[_0xdcbd('0x49')]]);_0xef0742[_0xdcbd('0x8a')]=moment()[_0xdcbd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0xef0742[_0xdcbd('0x8b')]=_0x486867[_0xdcbd('0x8b')];_0xef0742['connectedlinename']=_0x486867[_0xdcbd('0x8c')];logger[_0xdcbd('0x6b')](_0xdcbd('0x8d'),_0xef0742[_0xdcbd('0x4c')],_0xef0742[_0xdcbd('0x50')],_0x486867[_0xdcbd('0x8b')],_0x486867[_0xdcbd('0x8c')]);this[_0xdcbd('0x11')][_0x486867['uniqueid']]=_0xef0742;this[_0xdcbd('0x45')](_0xef0742,_0xdcbd('0x20'));}}}catch(_0x18be5e){logger[_0xdcbd('0x3d')](_0xdcbd('0x89'),_0x486867[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x18be5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x164ef9){try{if(this['isNotNull'](_0x164ef9)){logger[_0xdcbd('0x46')](_0xdcbd('0x8e'),_0x164ef9[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x164ef9,{'showHidden':![],'depth':null}));if(this[_0xdcbd('0xf')][_0x164ef9[_0xdcbd('0x49')]]){var _0x463d6f=_[_0xdcbd('0x7f')](this['queueReports'][_0x164ef9[_0xdcbd('0x49')]]);_0x463d6f['queuecallercomplete']=!![];_0x463d6f[_0xdcbd('0x84')]=_0xdcbd('0x8f');logger[_0xdcbd('0x6b')](_0xdcbd('0x90'),_0x463d6f[_0xdcbd('0x4c')],_0x463d6f[_0xdcbd('0x50')]);}}}catch(_0x31b784){logger[_0xdcbd('0x3d')](_0xdcbd('0x8e'),_0x164ef9[_0xdcbd('0x49')],util['inspect'](_0x31b784,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0x21')]=function(_0x41c9db){try{if(this[_0xdcbd('0x64')](_0x41c9db)){logger[_0xdcbd('0x46')](_0xdcbd('0x91'),_0x41c9db[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x41c9db,{'showHidden':![],'depth':null}));if(this[_0xdcbd('0xf')][_0x41c9db[_0xdcbd('0x49')]]){var _0x5af85e=_['last'](this['queueReports'][_0x41c9db[_0xdcbd('0x49')]]);_0x5af85e[_0xdcbd('0x1e')]=![];_0x5af85e[_0xdcbd('0x83')]=null;_0x5af85e[_0xdcbd('0x92')]=!![];_0x5af85e[_0xdcbd('0x86')]=_0x41c9db[_0xdcbd('0x93')];_0x5af85e[_0xdcbd('0x81')]=_0x41c9db['holdtime'];_0x5af85e['queuecallercomplete']=!![];_0x5af85e[_0xdcbd('0x94')]=![];_0x5af85e[_0xdcbd('0x95')]=null;if(!_0x5af85e[_0xdcbd('0x96')]){if(_0x41c9db[_0xdcbd('0x97')]==_0xdcbd('0x96')){_0x5af85e['queuecallerexitreason']=_0xdcbd('0x98');logger[_0xdcbd('0x6b')](_0xdcbd('0x99'),_0x5af85e[_0xdcbd('0x4c')],_0x5af85e[_0xdcbd('0x50')]);}else{if(_['startsWith'](_0x41c9db['channel'][_0xdcbd('0x9a')](),_0xdcbd('0x9b'))){if(this['queueReports'][_0x41c9db[_0xdcbd('0x9c')]]){var _0xd69d49=_[_0xdcbd('0x7f')](this[_0xdcbd('0xf')][_0x41c9db[_0xdcbd('0x9c')]]);_0xd69d49[_0xdcbd('0x9d')]=![];_0xd69d49[_0xdcbd('0x94')]=!![];_0xd69d49[_0xdcbd('0x95')]=moment(_0x5af85e[_0xdcbd('0x9e')])[_0xdcbd('0x9f')](_0x41c9db[_0xdcbd('0x81')],_0xdcbd('0xa0'))[_0xdcbd('0x4a')](_0xdcbd('0xa1'));_0xd69d49['queuecallerexitreason']=_0xdcbd('0xa2');_0xd69d49[_0xdcbd('0x96')]=!![];_0xd69d49[_0xdcbd('0xa3')]='FORWARD';_0xd69d49[_0xdcbd('0xa4')]=_0x41c9db[_0xdcbd('0xa5')];_0xd69d49[_0xdcbd('0xa6')]=_0x41c9db[_0xdcbd('0x49')];logger['info'](_0xdcbd('0xa7'),_0xd69d49['name'],_0xd69d49['type']);var _0x37c968=this[_0xdcbd('0xf')][_0x41c9db[_0xdcbd('0x9c')]];this[_0xdcbd('0xf')][_0x41c9db['linkedid']]=this[_0xdcbd('0xf')][_0x41c9db[_0xdcbd('0x49')]];this[_0xdcbd('0xf')][_0x41c9db[_0xdcbd('0x49')]]=_0x37c968;}}else{_0x5af85e[_0xdcbd('0x84')]=_0xdcbd('0xa8')+_0x41c9db[_0xdcbd('0x97')][_0xdcbd('0xa9')]();logger[_0xdcbd('0x6b')](_0xdcbd('0xaa'),_0x5af85e[_0xdcbd('0x4c')],_0x5af85e[_0xdcbd('0x50')],_0x5af85e[_0xdcbd('0x84')]);}}}this[_0xdcbd('0x11')][_0x41c9db[_0xdcbd('0x49')]]=_0x5af85e;this['emitVoiceQueueChannelRemove'](_0x5af85e,_0xdcbd('0xab'));}}}catch(_0x19d2ee){logger[_0xdcbd('0x3d')](_0xdcbd('0x91'),_0x41c9db[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x19d2ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0x24')]=function(_0x36ee72){try{if(this[_0xdcbd('0x64')](_0x36ee72)){logger['debug'](_0xdcbd('0xac'),_0x36ee72[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x36ee72,{'showHidden':![],'depth':null}));this[_0xdcbd('0xad')](_0x36ee72[_0xdcbd('0x49')],_[_0xdcbd('0x7b')](_0x36ee72[_0xdcbd('0xae')])[0x0],_0x36ee72['value']);if(this[_0xdcbd('0xf')][_0x36ee72[_0xdcbd('0x49')]]){var _0x3f1e38=_[_0xdcbd('0x7f')](this[_0xdcbd('0xf')][_0x36ee72['uniqueid']]);if(_0x3f1e38){if(this[_0xdcbd('0x64')](_0x36ee72[_0xdcbd('0xae')])&&this[_0xdcbd('0x64')](_0x36ee72['variable']['queuestatus'])){switch(_0x36ee72[_0xdcbd('0xaf')]){case'CONTINUE':_0x3f1e38[_0xdcbd('0x94')]=![];_0x3f1e38[_0xdcbd('0x95')]=null;break;case _0xdcbd('0xb0'):_0x3f1e38[_0xdcbd('0xb1')]=_0xdcbd('0xb2');_0x3f1e38[_0xdcbd('0x94')]=!![];_0x3f1e38[_0xdcbd('0x95')]=moment()[_0xdcbd('0x4a')](_0xdcbd('0xa1'));_0x3f1e38[_0xdcbd('0x8a')]=moment()[_0xdcbd('0x4a')](_0xdcbd('0xa1'));logger['debug'](_0xdcbd('0xb3'),_0x36ee72[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x3f1e38,{'showHidden':![],'depth':null}));ami[_0xdcbd('0x44')](_0xdcbd('0xb4'),_0x3f1e38);break;default:_0x3f1e38['queuecallerexit']=!![];_0x3f1e38[_0xdcbd('0x95')]=moment()[_0xdcbd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f1e38[_0xdcbd('0x8a')]=moment()[_0xdcbd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f1e38[_0xdcbd('0x1e')]=![];_0x3f1e38[_0xdcbd('0x83')]=null;_0x3f1e38[_0xdcbd('0x84')]=_0x36ee72[_0xdcbd('0xaf')];this['channels'][_0x36ee72[_0xdcbd('0x49')]]=_0x3f1e38;this[_0xdcbd('0x43')](_0x3f1e38,_0xdcbd('0x23'));}else if(this['isNotNull'](_0x36ee72[_0xdcbd('0xae')])&&this['isNotNull'](_0x36ee72['variable'][_0xdcbd('0xb5')])){if(!_0x3f1e38[_0xdcbd('0x1e')]){_0x3f1e38['queuecallerexit']=!![];_0x3f1e38[_0xdcbd('0x95')]=moment()[_0xdcbd('0x4a')](_0xdcbd('0xa1'));_0x3f1e38[_0xdcbd('0x84')]=_0xdcbd('0xb6');_0x3f1e38['queuecallerleaveAt']=moment()[_0xdcbd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdcbd('0x11')][_0x36ee72['uniqueid']]=_0x3f1e38;}}logger[_0xdcbd('0x6b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x36ee72[_0xdcbd('0x49')],_0x3f1e38[_0xdcbd('0x4c')],_0x3f1e38[_0xdcbd('0x50')],_[_0xdcbd('0x7b')](_0x36ee72[_0xdcbd('0xae')])[0x0],_0x36ee72[_0xdcbd('0xaf')]);_0x3f1e38['variables']=this[_0xdcbd('0x16')][_0x36ee72[_0xdcbd('0x49')]];}}}}catch(_0x388301){logger['error']('[%s][voiceQueueReport][varset]',_0x36ee72[_0xdcbd('0x49')],util[_0xdcbd('0x3f')](_0x388301,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdcbd('0xa')][_0xdcbd('0xad')]=function(_0x52bcd2,_0x36a96e,_0x26f92e){var _0x424989=[_0xdcbd('0xb7'),_0xdcbd('0xb8'),'rtpaudioqosjitter',_0xdcbd('0xb9'),_0xdcbd('0xba'),_0xdcbd('0xbb'),_0xdcbd('0xbc'),_0xdcbd('0xbd'),_0xdcbd('0xbe'),_0xdcbd('0xbf'),'bridgepeer',_0xdcbd('0xc0'),_0xdcbd('0xc1'),_0xdcbd('0xc2'),_0xdcbd('0xc3'),_0xdcbd('0xc4'),_0xdcbd('0x93'),_0xdcbd('0xc5'),_0xdcbd('0xc6')];if(!_[_0xdcbd('0x37')](_0x36a96e)&&!_[_0xdcbd('0xc7')](_0x424989,_0x36a96e)){if(_[_0xdcbd('0x75')](this[_0xdcbd('0x16')][_0x52bcd2])){this[_0xdcbd('0x16')][_0x52bcd2]={};}this[_0xdcbd('0x16')][_0x52bcd2][_0x36a96e]=_0x26f92e;}};VoiceQueueReport[_0xdcbd('0xa')]['syncHangup']=function(_0xbd6fa2){try{if(this[_0xdcbd('0x64')](_0xbd6fa2)){logger[_0xdcbd('0x46')]('[%s][voiceQueueReport][hangup]',_0xbd6fa2[_0xdcbd('0x49')],util['inspect'](_0xbd6fa2,{'showHidden':![],'depth':null}));if(this[_0xdcbd('0xf')][_0xbd6fa2[_0xdcbd('0x49')]]){for(var _0xe62ffb=0x0,_0x2059b1={};_0xe62ffb0x0?_0x1681a7:0x0;this['voiceQueues'][_0x5a7d79['queue']][_0x32b9('0x4e')]=this[_0x32b9('0x11')][_0x5a7d79[_0x32b9('0x5f')]][_0x32b9('0x4e')]>_[_0x32b9('0x65')](_0x5a7d79['loggedin'])?_[_0x32b9('0x65')](_0x5a7d79[_0x32b9('0x66')]):this['voiceQueues'][_0x5a7d79[_0x32b9('0x5f')]]['talking'];this[_0x32b9('0x49')](this[_0x32b9('0x11')][_0x5a7d79[_0x32b9('0x5f')]],_0x32b9('0x14'));}logger[_0x32b9('0x41')](_0x32b9('0x67'),util['inspect'](this[_0x32b9('0x11')][_0x5a7d79[_0x32b9('0x5f')]],{'showHidden':![],'depth':null}));ami[_0x32b9('0x3f')](_0x32b9('0x68'),this[_0x32b9('0x11')][_0x5a7d79[_0x32b9('0x5f')]]);}}}catch(_0x4088c2){logger['error'](_0x32b9('0x69'),util[_0x32b9('0x38')](_0x4088c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x32b9('0xa')]['syncQueueSummaryComplete']=function(_0x16c948){logger[_0x32b9('0x41')](_0x32b9('0x6a'),util[_0x32b9('0x38')](_0x16c948,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x32b9('0xa')]['syncQueueCallerJoin']=function(_0x5f5478){try{if(this['isNotNull'](_0x5f5478)){logger[_0x32b9('0x41')](_0x32b9('0x6b'),_0x5f5478[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x5f5478,{'showHidden':![],'depth':null}));if(_[_0x32b9('0x6c')](this['queueReports'][_0x5f5478[_0x32b9('0x42')]]))this[_0x32b9('0xd')][_0x5f5478[_0x32b9('0x42')]]=[];if(_[_0x32b9('0x6c')](this[_0x32b9('0xf')][_0x5f5478[_0x32b9('0x42')]]))this[_0x32b9('0xf')][_0x5f5478[_0x32b9('0x42')]]={};var _0x1544c5=new QueueReport();_0x1544c5['name']=_0x5f5478[_0x32b9('0x5f')];_0x1544c5[_0x32b9('0x4a')]=this[_0x32b9('0x11')][_0x1544c5[_0x32b9('0x45')]]&&this[_0x32b9('0x11')][_0x1544c5[_0x32b9('0x45')]][_0x32b9('0x4a')]?this[_0x32b9('0x11')][_0x1544c5['name']][_0x32b9('0x4a')]||_0x32b9('0x6d'):_0x32b9('0x6d');_0x1544c5[_0x32b9('0x5f')]=_0x5f5478[_0x32b9('0x5f')];_0x1544c5[_0x32b9('0x6e')]=moment()[_0x32b9('0x43')](_0x32b9('0x6f'));_0x1544c5[_0x32b9('0x70')]=_0x5f5478[_0x32b9('0x70')];_0x1544c5['count']=_0x5f5478[_0x32b9('0x71')];_0x1544c5[_0x32b9('0x42')]=_0x5f5478[_0x32b9('0x42')];_0x1544c5[_0x32b9('0x72')]=this[_0x32b9('0xf')][_0x5f5478[_0x32b9('0x42')]]['routealias'];logger[_0x32b9('0x61')](_0x32b9('0x73'),_0x1544c5[_0x32b9('0x45')],_0x1544c5[_0x32b9('0x4a')]);_['merge'](_0x1544c5,_['pick'](_0x5f5478,_[_0x32b9('0x74')](_0x1544c5)));this[_0x32b9('0xd')][_0x5f5478[_0x32b9('0x42')]]['push'](_0x1544c5);this['channels'][_0x5f5478[_0x32b9('0x42')]]=_0x1544c5;this[_0x32b9('0x40')](_0x1544c5,_0x32b9('0x18'));}}catch(_0x4c272a){logger[_0x32b9('0x36')](_0x32b9('0x6b'),_0x5f5478[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x4c272a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x32b9('0x75')]=function(_0x1795a5){try{if(this[_0x32b9('0x5e')](_0x1795a5)){logger[_0x32b9('0x41')](_0x32b9('0x76'),_0x1795a5['uniqueid'],util['inspect'](_0x1795a5,{'showHidden':![],'depth':null}));if(this[_0x32b9('0xd')][_0x1795a5[_0x32b9('0x42')]]){var _0x156ac8=_[_0x32b9('0x77')](this['queueReports'][_0x1795a5[_0x32b9('0x42')]]);_0x156ac8[_0x32b9('0x78')]=![];_0x156ac8['queuecallercompleteAt']=null;_0x156ac8[_0x32b9('0x79')]=_0x1795a5[_0x32b9('0x79')];_0x156ac8[_0x32b9('0x7a')]=_0x1795a5[_0x32b9('0x7a')];_0x156ac8[_0x32b9('0x7b')]=!![];_0x156ac8[_0x32b9('0x7c')]=moment()['format'](_0x32b9('0x6f'));_0x156ac8[_0x32b9('0x7d')]=_0x32b9('0x7e');_0x156ac8[_0x32b9('0x7f')]=null;logger[_0x32b9('0x61')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x156ac8[_0x32b9('0x45')],_0x156ac8[_0x32b9('0x4a')]);this[_0x32b9('0xf')][_0x1795a5[_0x32b9('0x42')]]=_0x156ac8;this['emitVoiceQueueChannelRemove'](_0x156ac8,_0x32b9('0x7b'));}}}catch(_0x357037){logger[_0x32b9('0x36')](_0x32b9('0x76'),_0x1795a5['uniqueid'],util[_0x32b9('0x38')](_0x357037,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x32b9('0x80')]=function(_0x47bcc5){try{if(this['isNotNull'](_0x47bcc5)){logger['debug'](_0x32b9('0x81'),_0x47bcc5['uniqueid'],util[_0x32b9('0x38')](_0x47bcc5,{'showHidden':![],'depth':null}));if(this[_0x32b9('0xd')][_0x47bcc5[_0x32b9('0x42')]]){var _0x2d1f26=_[_0x32b9('0x77')](this[_0x32b9('0xd')][_0x47bcc5[_0x32b9('0x42')]]);_0x2d1f26[_0x32b9('0x82')]=moment()['format'](_0x32b9('0x6f'));_0x2d1f26[_0x32b9('0x83')]=_0x47bcc5[_0x32b9('0x83')];_0x2d1f26[_0x32b9('0x84')]=_0x47bcc5[_0x32b9('0x84')];logger[_0x32b9('0x61')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2d1f26['name'],_0x2d1f26[_0x32b9('0x4a')],_0x47bcc5[_0x32b9('0x83')],_0x47bcc5['connectedlinename']);this[_0x32b9('0xf')][_0x47bcc5[_0x32b9('0x42')]]=_0x2d1f26;this['emitVoiceQueueChannelSave'](_0x2d1f26,'queuecallerleave');}}}catch(_0x161217){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x47bcc5[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x161217,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x32b9('0xa')]['syncAgentConnect']=function(_0x4c24b3){try{if(this[_0x32b9('0x5e')](_0x4c24b3)){logger[_0x32b9('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x4c24b3[_0x32b9('0x42')],util['inspect'](_0x4c24b3,{'showHidden':![],'depth':null}));if(this[_0x32b9('0xd')][_0x4c24b3[_0x32b9('0x42')]]){var _0x5b6d82=_[_0x32b9('0x77')](this[_0x32b9('0xd')][_0x4c24b3[_0x32b9('0x42')]]);_0x5b6d82[_0x32b9('0x78')]=!![];_0x5b6d82[_0x32b9('0x7d')]=_0x32b9('0x85');logger[_0x32b9('0x61')](_0x32b9('0x86'),_0x5b6d82[_0x32b9('0x45')],_0x5b6d82[_0x32b9('0x4a')]);}}}catch(_0x3b1ec3){logger[_0x32b9('0x36')](_0x32b9('0x87'),_0x4c24b3['uniqueid'],util[_0x32b9('0x38')](_0x3b1ec3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x32b9('0xa')]['syncAgentComplete']=function(_0x18412c){try{if(this[_0x32b9('0x5e')](_0x18412c)){logger[_0x32b9('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x18412c[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x18412c,{'showHidden':![],'depth':null}));if(this[_0x32b9('0xd')][_0x18412c[_0x32b9('0x42')]]){var _0x264f1f=_[_0x32b9('0x77')](this['queueReports'][_0x18412c['uniqueid']]);_0x264f1f[_0x32b9('0x7b')]=![];_0x264f1f[_0x32b9('0x7c')]=null;_0x264f1f[_0x32b9('0x88')]=!![];_0x264f1f['lastAssignedTo']=_0x18412c[_0x32b9('0x89')];_0x264f1f['holdtime']=_0x18412c[_0x32b9('0x79')];_0x264f1f[_0x32b9('0x78')]=!![];_0x264f1f[_0x32b9('0x8a')]=![];_0x264f1f[_0x32b9('0x8b')]=null;if(!_0x264f1f[_0x32b9('0x8c')]){if(_0x18412c[_0x32b9('0x8d')]==_0x32b9('0x8c')){_0x264f1f[_0x32b9('0x7d')]=_0x32b9('0x8e');logger[_0x32b9('0x61')](_0x32b9('0x8f'),_0x264f1f[_0x32b9('0x45')],_0x264f1f[_0x32b9('0x4a')]);}else{if(_[_0x32b9('0x90')](_0x18412c[_0x32b9('0x33')]['toLowerCase'](),'local/')){if(this[_0x32b9('0xd')][_0x18412c[_0x32b9('0x91')]]){var _0x11db63=_['last'](this['queueReports'][_0x18412c[_0x32b9('0x91')]]);_0x11db63[_0x32b9('0x78')]=![];_0x11db63[_0x32b9('0x8a')]=!![];_0x11db63[_0x32b9('0x8b')]=moment(_0x264f1f[_0x32b9('0x6e')])[_0x32b9('0x92')](_0x18412c[_0x32b9('0x79')],_0x32b9('0x93'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x11db63[_0x32b9('0x7d')]=_0x32b9('0x94');_0x11db63[_0x32b9('0x8c')]=!![];_0x11db63[_0x32b9('0x95')]='FORWARD';_0x11db63[_0x32b9('0x96')]=_0x18412c['destexten'];_0x11db63['transferuniqueid']=_0x18412c[_0x32b9('0x42')];logger[_0x32b9('0x61')](_0x32b9('0x97'),_0x11db63['name'],_0x11db63['type']);var _0x279691=this[_0x32b9('0xd')][_0x18412c['linkedid']];this[_0x32b9('0xd')][_0x18412c[_0x32b9('0x91')]]=this['queueReports'][_0x18412c[_0x32b9('0x42')]];this[_0x32b9('0xd')][_0x18412c[_0x32b9('0x42')]]=_0x279691;}}else{_0x264f1f[_0x32b9('0x7d')]=_0x32b9('0x98')+_0x18412c[_0x32b9('0x8d')][_0x32b9('0x99')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x264f1f[_0x32b9('0x45')],_0x264f1f[_0x32b9('0x4a')],_0x264f1f['queuecallerexitreason']);}}}this[_0x32b9('0xf')][_0x18412c['uniqueid']]=_0x264f1f;this[_0x32b9('0x3e')](_0x264f1f,_0x32b9('0x9a'));}}}catch(_0x3aa7a9){logger[_0x32b9('0x36')](_0x32b9('0x9b'),_0x18412c['uniqueid'],util[_0x32b9('0x38')](_0x3aa7a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x32b9('0x1e')]=function(_0x57e2d4){try{if(this[_0x32b9('0x5e')](_0x57e2d4)){logger[_0x32b9('0x41')](_0x32b9('0x9c'),_0x57e2d4[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x57e2d4,{'showHidden':![],'depth':null}));this[_0x32b9('0x9d')](_0x57e2d4[_0x32b9('0x42')],_[_0x32b9('0x74')](_0x57e2d4['variable'])[0x0],_0x57e2d4[_0x32b9('0x9e')]);if(this[_0x32b9('0xd')][_0x57e2d4[_0x32b9('0x42')]]){var _0x32ea00=_[_0x32b9('0x77')](this[_0x32b9('0xd')][_0x57e2d4[_0x32b9('0x42')]]);if(_0x32ea00){if(this['isNotNull'](_0x57e2d4[_0x32b9('0x9f')])&&this[_0x32b9('0x5e')](_0x57e2d4[_0x32b9('0x9f')][_0x32b9('0xa0')])){switch(_0x57e2d4[_0x32b9('0x9e')]){case _0x32b9('0xa1'):_0x32ea00[_0x32b9('0x8a')]=![];_0x32ea00[_0x32b9('0x8b')]=null;break;case'TIMEOUT':_0x32ea00[_0x32b9('0xa2')]=_0x32b9('0xa3');_0x32ea00[_0x32b9('0x8a')]=!![];_0x32ea00[_0x32b9('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32ea00[_0x32b9('0x82')]=moment()[_0x32b9('0x43')](_0x32b9('0x6f'));logger[_0x32b9('0x41')](_0x32b9('0xa4'),_0x57e2d4[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x32ea00,{'showHidden':![],'depth':null}));ami[_0x32b9('0x3f')]('custom:timeout',_0x32ea00);break;default:_0x32ea00[_0x32b9('0x8a')]=!![];_0x32ea00['queuecallerexitAt']=moment()[_0x32b9('0x43')](_0x32b9('0x6f'));_0x32ea00['queuecallerleaveAt']=moment()[_0x32b9('0x43')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32ea00[_0x32b9('0x7b')]=![];_0x32ea00['queuecallerabandonAt']=null;_0x32ea00[_0x32b9('0x7d')]=_0x57e2d4[_0x32b9('0x9e')];this[_0x32b9('0xf')][_0x57e2d4['uniqueid']]=_0x32ea00;this[_0x32b9('0x3e')](_0x32ea00,_0x32b9('0x1d'));}else if(this[_0x32b9('0x5e')](_0x57e2d4[_0x32b9('0x9f')])&&this[_0x32b9('0x5e')](_0x57e2d4[_0x32b9('0x9f')][_0x32b9('0xa5')])){if(!_0x32ea00[_0x32b9('0x7b')]){_0x32ea00[_0x32b9('0x8a')]=!![];_0x32ea00[_0x32b9('0x8b')]=moment()[_0x32b9('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x32ea00['queuecallerexitreason']=_0x32b9('0xa6');_0x32ea00[_0x32b9('0x82')]=moment()[_0x32b9('0x43')](_0x32b9('0x6f'));this['channels'][_0x57e2d4['uniqueid']]=_0x32ea00;}}logger[_0x32b9('0x61')](_0x32b9('0xa7'),_0x57e2d4[_0x32b9('0x42')],_0x32ea00['name'],_0x32ea00[_0x32b9('0x4a')],_['keys'](_0x57e2d4[_0x32b9('0x9f')])[0x0],_0x57e2d4[_0x32b9('0x9e')]);_0x32ea00[_0x32b9('0x39')]=this[_0x32b9('0x39')][_0x57e2d4[_0x32b9('0x42')]];}}}}catch(_0x515890){logger[_0x32b9('0x36')](_0x32b9('0x9c'),_0x57e2d4['uniqueid'],util['inspect'](_0x515890,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x32b9('0x9d')]=function(_0x4ebc43,_0x4c47ed,_0x4dc134){var _0x145ef7=[_0x32b9('0xa8'),'rtpaudioqosbridged',_0x32b9('0xa9'),_0x32b9('0xaa'),_0x32b9('0xab'),'rtpaudioqoslossbridged',_0x32b9('0xac'),_0x32b9('0xad'),_0x32b9('0xae'),'sipuri',_0x32b9('0xaf'),'bridgepvtcallid',_0x32b9('0xb0'),_0x32b9('0xb1'),_0x32b9('0xb2'),_0x32b9('0xb3'),_0x32b9('0x89'),'memberpenalty',_0x32b9('0xb4')];if(!_[_0x32b9('0x31')](_0x4c47ed)&&!_[_0x32b9('0xb5')](_0x145ef7,_0x4c47ed)){if(_['isUndefined'](this[_0x32b9('0x39')][_0x4ebc43])){this[_0x32b9('0x39')][_0x4ebc43]={};}this[_0x32b9('0x39')][_0x4ebc43][_0x4c47ed]=_0x4dc134;}};VoiceQueueReport[_0x32b9('0xa')][_0x32b9('0x20')]=function(_0x2ad795){try{if(this['isNotNull'](_0x2ad795)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x2ad795[_0x32b9('0x42')],util[_0x32b9('0x38')](_0x2ad795,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2ad795[_0x32b9('0x42')]]){for(var _0x47ae96=0x0,_0x19e6a1={};_0x47ae96=0x0?moment(_0x15e341[_0xa10d('0x13')])[_0xa10d('0x14')](_0x15e341[_0xa10d('0x12')],_0xa10d('0x9')):null,'data1':_0xa10d('0x15'),'data2':_0x15e341[_0xa10d('0xe')],'data3':_0x15e341['exten'],'data4':_0x15e341[_0xa10d('0x16')]||null,'role':_0xa10d('0xd'),'internal':_0x15e341[_0xa10d('0xe')]?_[_0xa10d('0xf')](_0x15e341['accountcode']):undefined,'uniqueid':_0x15e341['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x25a0=['queuecallerexitAt','Request','voice','lastAssignedTo','isNil','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','exten','queue','agent','toNumber','accountcode','CreateMemberReport','voiceDialReport','membername','interface','starttime','endtime','outbound','dialstring','uniqueid','moment','lodash','util','../client','voiceQueueReport'];(function(_0x268509,_0x196d93){var _0x5de441=function(_0x5ef235){while(--_0x5ef235){_0x268509['push'](_0x268509['shift']());}};_0x5de441(++_0x196d93);}(_0x25a0,0x19f));var _0x025a=function(_0x3e8b02,_0x489e5c){_0x3e8b02=_0x3e8b02-0x0;var _0x15516c=_0x25a0[_0x3e8b02];return _0x15516c;};'use strict';var moment=require(_0x025a('0x0'));var _=require(_0x025a('0x1'));var util=require(_0x025a('0x2'));var client=require(_0x025a('0x3'));exports[_0x025a('0x4')]=function(_0x5cef3f){var _0x413208=_0x5cef3f['queuecallercompleteAt']||_0x5cef3f[_0x025a('0x5')];return client[_0x025a('0x6')]('CreateMemberReport',{'body':{'channel':_0x025a('0x7'),'membername':_0x5cef3f[_0x025a('0x8')],'interface':_[_0x025a('0x9')](_0x5cef3f['interface'])?util[_0x025a('0xa')](_0x025a('0xb'),_0x5cef3f[_0x025a('0x8')]):_0x5cef3f['interface'],'type':_0x025a('0xc'),'enterAt':_0x5cef3f[_0x025a('0xd')],'exitAt':_0x413208,'duration':moment(_0x413208)['diff'](_0x5cef3f[_0x025a('0xd')],_0x025a('0xe')),'data1':_0x025a('0xf'),'data2':_0x5cef3f['calleridnum'],'data3':_0x5cef3f[_0x025a('0x10')],'data4':null,'data5':_0x5cef3f[_0x025a('0x11')],'role':_0x025a('0x12'),'internal':_0x5cef3f['accountcode']?_[_0x025a('0x13')](_0x5cef3f[_0x025a('0x14')]):undefined,'uniqueid':_0x5cef3f['uniqueid']},'log':_0x025a('0x15')});};exports[_0x025a('0x16')]=function(_0x22b04a){return client[_0x025a('0x6')](_0x025a('0x15'),{'body':{'channel':_0x025a('0x7'),'membername':_0x22b04a[_0x025a('0x17')],'interface':_0x22b04a[_0x025a('0x18')],'type':_0x025a('0xc'),'enterAt':_0x22b04a[_0x025a('0x19')],'exitAt':_0x22b04a[_0x025a('0x1a')],'duration':moment(_0x22b04a[_0x025a('0x1a')])['diff'](_0x22b04a[_0x025a('0x19')],'seconds')>=0x0?moment(_0x22b04a[_0x025a('0x1a')])['diff'](_0x22b04a[_0x025a('0x19')],'seconds'):null,'data1':_0x025a('0x1b'),'data2':_0x22b04a[_0x025a('0x14')],'data3':_0x22b04a['exten'],'data4':_0x22b04a[_0x025a('0x1c')]||null,'role':'agent','internal':_0x22b04a[_0x025a('0x14')]?_[_0x025a('0x13')](_0x22b04a[_0x025a('0x14')]):undefined,'uniqueid':_0x22b04a[_0x025a('0x1d')]},'log':_0x025a('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index aa4ba0c..60faf46 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21c9=['../client','getSettings'];(function(_0x59157f,_0x6abcbd){var _0x2664a0=function(_0x1ad258){while(--_0x1ad258){_0x59157f['push'](_0x59157f['shift']());}};_0x2664a0(++_0x6abcbd);}(_0x21c9,0x19e));var _0x921c=function(_0x4a9025,_0x31b85e){_0x4a9025=_0x4a9025-0x0;var _0x36986d=_0x21c9[_0x4a9025];return _0x36986d;};'use strict';var client=require(_0x921c('0x0'));exports[_0x921c('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file +var _0xd757=['ShowSetting','../client','getSettings','Request'];(function(_0x401e1b,_0x40541b){var _0x51ad69=function(_0x276f1f){while(--_0x276f1f){_0x401e1b['push'](_0x401e1b['shift']());}};_0x51ad69(++_0x40541b);}(_0xd757,0x1e5));var _0x7d75=function(_0x33b596,_0xfa5739){_0x33b596=_0x33b596-0x0;var _0x16f814=_0xd757[_0x33b596];return _0x16f814;};'use strict';var client=require(_0x7d75('0x0'));exports[_0x7d75('0x1')]=function(){return client[_0x7d75('0x2')](_0x7d75('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6aa8897..7d336ca 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fab=['Request','GetTemplate','name','html','getTemplates'];(function(_0x5ee6ad,_0xf6148a){var _0x41a778=function(_0x516322){while(--_0x516322){_0x5ee6ad['push'](_0x5ee6ad['shift']());}};_0x41a778(++_0xf6148a);}(_0x8fab,0x149));var _0xb8fa=function(_0x27838b,_0x4964a0){_0x27838b=_0x27838b-0x0;var _0x11b854=_0x8fab[_0x27838b];return _0x11b854;};'use strict';var client=require('../client');exports[_0xb8fa('0x0')]=function(_0x148e17){return function(_0x3f72fa){return client[_0xb8fa('0x1')](_0xb8fa('0x2'),{'options':{'raw':!![],'attributes':['id',_0xb8fa('0x3'),_0xb8fa('0x4')]},'log':_0xb8fa('0x2')});};}; \ No newline at end of file +var _0x69c4=['../client','getTemplates','Request'];(function(_0x53bfdb,_0x8ecab3){var _0x469b15=function(_0x27f761){while(--_0x27f761){_0x53bfdb['push'](_0x53bfdb['shift']());}};_0x469b15(++_0x8ecab3);}(_0x69c4,0x1d4));var _0x469c=function(_0x26188f,_0x18137e){_0x26188f=_0x26188f-0x0;var _0x5f0185=_0x69c4[_0x26188f];return _0x5f0185;};'use strict';var client=require(_0x469c('0x0'));exports[_0x469c('0x1')]=function(_0x1553ac){return function(_0x5bd2ed){return client[_0x469c('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e47fb88..952fd45 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f23=['operator','Action','Actions','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','value','Condition','AnyConditions','field'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6f23,0x180));var _0x36f2=function(_0x488845,_0x2ea172){_0x488845=_0x488845-0x0;var _0x3f424d=_0x6f23[_0x488845];return _0x3f424d;};'use strict';var client=require(_0x36f2('0x0'));exports[_0x36f2('0x1')]=function(_0x1bf7ad){return function(_0x2bb34f){return client[_0x36f2('0x2')](_0x36f2('0x3'),{'options':{'raw':![],'attributes':['id',_0x36f2('0x4'),_0x36f2('0x5'),_0x36f2('0x6')],'include':[{'model':'Condition','as':_0x36f2('0x7'),'attributes':['id','field','operator',_0x36f2('0x8')]},{'model':_0x36f2('0x9'),'as':_0x36f2('0xa'),'attributes':['id',_0x36f2('0xb'),_0x36f2('0xc'),_0x36f2('0x8')]},{'model':_0x36f2('0xd'),'as':_0x36f2('0xe'),'attributes':['id','action',_0x36f2('0xf'),_0x36f2('0x10'),_0x36f2('0x11'),_0x36f2('0x12'),_0x36f2('0x13'),_0x36f2('0x14'),_0x36f2('0x15')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xe504=['Condition','AnyConditions','Action','Actions','data1','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','field','operator'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe504,0x96));var _0x4e50=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe504[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x4e50('0x0'));exports[_0x4e50('0x1')]=function(_0x5ad6c4){return function(_0x12e160){return client[_0x4e50('0x2')](_0x4e50('0x3'),{'options':{'raw':![],'attributes':['id',_0x4e50('0x4'),_0x4e50('0x5'),_0x4e50('0x6')],'include':[{'model':'Condition','as':_0x4e50('0x7'),'attributes':['id',_0x4e50('0x8'),_0x4e50('0x9'),'value']},{'model':_0x4e50('0xa'),'as':_0x4e50('0xb'),'attributes':['id','field',_0x4e50('0x9'),'value']},{'model':_0x4e50('0xc'),'as':_0x4e50('0xd'),'attributes':['id','action',_0x4e50('0xe'),'data2',_0x4e50('0xf'),_0x4e50('0x10'),_0x4e50('0x11'),_0x4e50('0x12'),_0x4e50('0x13')]}]},'log':_0x4e50('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e4f5881..95bec23 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x394f=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x53ca03,_0x290fd2){var _0x5f32da=function(_0x4f3158){while(--_0x4f3158){_0x53ca03['push'](_0x53ca03['shift']());}};_0x5f32da(++_0x290fd2);}(_0x394f,0x8f));var _0xf394=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x394f[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xf394('0x0'));exports['getTrunks']=function(_0xc47346){return function(_0x44fd96){return client[_0xf394('0x1')](_0xf394('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf394('0x3'),_0xf394('0x4'),_0xf394('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x2cd4=['../client','Request','GetTrunk','name','registry','defaultuser'];(function(_0x1df644,_0x513cd7){var _0x236bdb=function(_0x43bc01){while(--_0x43bc01){_0x1df644['push'](_0x1df644['shift']());}};_0x236bdb(++_0x513cd7);}(_0x2cd4,0xd2));var _0x42cd=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x2cd4[_0x1abeb2];return _0x48da20;};'use strict';var client=require(_0x42cd('0x0'));exports['getTrunks']=function(_0x561f2a){return function(_0x286ee2){return client[_0x42cd('0x1')](_0x42cd('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x42cd('0x3'),_0x42cd('0x4'),_0x42cd('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5d86e16..ef8dd8e 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe706,0xa3));var _0x6e70=function(_0x4ee585,_0x3aa9fa){_0x4ee585=_0x4ee585-0x0;var _0x561c7a=_0xe706[_0x4ee585];return _0x561c7a;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe706,0xa3));var _0x6e70=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xe706[_0x581af1];return _0x54c22e;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 087fecd..a35a699 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa958=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x51a028,_0x40ef23){var _0x36d1ad=function(_0x5e6eb){while(--_0x5e6eb){_0x51a028['push'](_0x51a028['shift']());}};_0x36d1ad(++_0x40ef23);}(_0xa958,0x8c));var _0x8a95=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xa958[_0x5f1391];return _0x50ebe3;};'use strict';var client=require('../client');exports[_0x8a95('0x0')]=function(_0x467ff9){return client['Request'](_0x8a95('0x1'),{'body':_0x467ff9,'log':_0x8a95('0x1')});};exports[_0x8a95('0x2')]=function(_0x2f95a4,_0x32874f,_0x433b8f){return client[_0x8a95('0x3')]('UpdateVoiceAgentReport',{'body':_0x2f95a4,'options':{'where':{'uniqueid':_0x32874f,'interface':_0x433b8f,'agentcomplete':!![]}},'log':_0x8a95('0x4')});}; \ No newline at end of file +var _0xae69=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x1a3387,_0x4effcd){var _0xd90d91=function(_0x568193){while(--_0x568193){_0x1a3387['push'](_0x1a3387['shift']());}};_0xd90d91(++_0x4effcd);}(_0xae69,0x165));var _0x9ae6=function(_0x1033b7,_0x67654f){_0x1033b7=_0x1033b7-0x0;var _0x1011d2=_0xae69[_0x1033b7];return _0x1011d2;};'use strict';var client=require(_0x9ae6('0x0'));exports['create']=function(_0x22c4b6){return client[_0x9ae6('0x1')](_0x9ae6('0x2'),{'body':_0x22c4b6,'log':_0x9ae6('0x2')});};exports[_0x9ae6('0x3')]=function(_0x521f3f,_0x221631,_0x537580){return client[_0x9ae6('0x1')]('UpdateVoiceAgentReport',{'body':_0x521f3f,'options':{'where':{'uniqueid':_0x221631,'interface':_0x537580,'agentcomplete':!![]}},'log':_0x9ae6('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e059800..498c091 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2706=['moment','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','GetVoiceCallReports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2706,0x169));var _0x6270=function(_0x3f7d22,_0x488b04){_0x3f7d22=_0x3f7d22-0x0;var _0x3c7381=_0x2706[_0x3f7d22];return _0x3c7381;};'use strict';var moment=require(_0x6270('0x0'));var util=require('util');var _=require(_0x6270('0x1'));var client=require('../client');exports[_0x6270('0x2')]=function(_0x438e5b){return client[_0x6270('0x3')](_0x6270('0x4'),{'body':_[_0x6270('0x5')](_0x438e5b,{'source':_0x438e5b[_0x6270('0x6')],'destinationcontext':_0x438e5b[_0x6270('0x7')],'callerid':_0x438e5b[_0x6270('0x8')],'amaflags':_0x6270('0x9')}),'log':_0x6270('0x4')});};exports[_0x6270('0xa')]=function(){return function(){return client[_0x6270('0x3')](_0x6270('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6270('0xc')](_0x6270('0xd'))['format'](_0x6270('0xe')),moment()[_0x6270('0xf')]('day')[_0x6270('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x6270('0x11'),'disposition','duration','billableseconds']},'log':_0x6270('0x12')});};}; \ No newline at end of file +var _0x0935=['context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x3d4a01,_0x5ad845){var _0x468b2a=function(_0xe6d303){while(--_0xe6d303){_0x3d4a01['push'](_0x3d4a01['shift']());}};_0x468b2a(++_0x5ad845);}(_0x0935,0x12c));var _0x5093=function(_0x4df1fe,_0x118749){_0x4df1fe=_0x4df1fe-0x0;var _0x3a58b9=_0x0935[_0x4df1fe];return _0x3a58b9;};'use strict';var moment=require(_0x5093('0x0'));var util=require(_0x5093('0x1'));var _=require('lodash');var client=require(_0x5093('0x2'));exports[_0x5093('0x3')]=function(_0x33363f){return client[_0x5093('0x4')](_0x5093('0x5'),{'body':_[_0x5093('0x6')](_0x33363f,{'source':_0x33363f[_0x5093('0x7')],'destinationcontext':_0x33363f[_0x5093('0x8')],'callerid':_0x33363f[_0x5093('0x9')],'amaflags':_0x5093('0xa')}),'log':_0x5093('0x5')});};exports[_0x5093('0xb')]=function(){return function(){return client[_0x5093('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x5093('0xc')],'createdAt':{'$between':[moment()[_0x5093('0xd')]('day')['format'](_0x5093('0xe')),moment()[_0x5093('0xf')](_0x5093('0x10'))['format'](_0x5093('0xe'))]}},'attributes':[_0x5093('0x11'),_0x5093('0x12'),_0x5093('0x13'),_0x5093('0x14')]},'log':_0x5093('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c7c87c3..24e738c 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3789=['Request','CreateVoiceDialReport','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3789,0xcb));var _0x9378=function(_0x71c481,_0x6f0743){_0x71c481=_0x71c481-0x0;var _0x2b4948=_0x3789[_0x71c481];return _0x2b4948;};'use strict';var client=require(_0x9378('0x0'));exports['create']=function(_0x218e4d){return client[_0x9378('0x1')]('CreateVoiceDialReport',{'body':_0x218e4d,'log':_0x9378('0x2')});}; \ No newline at end of file +var _0xdd20=['create','Request','CreateVoiceDialReport','../client'];(function(_0x47ff7b,_0x387b2c){var _0x265c82=function(_0x25997a){while(--_0x25997a){_0x47ff7b['push'](_0x47ff7b['shift']());}};_0x265c82(++_0x387b2c);}(_0xdd20,0x1a7));var _0x0dd2=function(_0x20f50c,_0x1a5b26){_0x20f50c=_0x20f50c-0x0;var _0x56fa59=_0xdd20[_0x20f50c];return _0x56fa59;};'use strict';var client=require(_0x0dd2('0x0'));exports[_0x0dd2('0x1')]=function(_0x47c2fb){return client[_0x0dd2('0x2')]('CreateVoiceDialReport',{'body':_0x47c2fb,'log':_0x0dd2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2bdba97..e40b57d 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3d1=['exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x3b8b66,_0x3b9b6f){var _0x404ef3=function(_0x402b16){while(--_0x402b16){_0x3b8b66['push'](_0x3b8b66['shift']());}};_0x404ef3(++_0x3b9b6f);}(_0xd3d1,0x172));var _0x1d3d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd3d1[_0x1cc8fe];return _0x230054;};'use strict';var client=require(_0x1d3d('0x0'));exports[_0x1d3d('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x1d3d('0x2'),_0x1d3d('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1d3d('0x1')});};}; \ No newline at end of file +var _0x7794=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x7794,0x7b));var _0x4779=function(_0xc4c7d8,_0x5067e5){_0xc4c7d8=_0xc4c7d8-0x0;var _0x644ee8=_0x7794[_0xc4c7d8];return _0x644ee8;};'use strict';var client=require('../client');exports[_0x4779('0x0')]=function(){return function(){return client[_0x4779('0x1')](_0x4779('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4779('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4779('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e02a8f5..2379663 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc949=['getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval'];(function(_0x2605fa,_0x50be90){var _0x436ede=function(_0x412afe){while(--_0x412afe){_0x2605fa['push'](_0x2605fa['shift']());}};_0x436ede(++_0x50be90);}(_0xc949,0x181));var _0x9c94=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xc949[_0x3b5250];return _0xc844a1;};'use strict';var client=require(_0x9c94('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x9c94('0x1')](_0x9c94('0x2'),{'options':{'raw':![],'attributes':['id',_0x9c94('0x3'),_0x9c94('0x4'),'acwTimeout',_0x9c94('0x5'),_0x9c94('0x6'),'type',_0x9c94('0x7'),_0x9c94('0x8'),_0x9c94('0x9'),_0x9c94('0xa'),'dialPowerLevel',_0x9c94('0xb'),_0x9c94('0xc'),_0x9c94('0xd'),_0x9c94('0xe'),_0x9c94('0xf'),_0x9c94('0x10'),_0x9c94('0x11'),_0x9c94('0x12'),_0x9c94('0x13'),_0x9c94('0x14'),'dialCongestionRetryFrequency',_0x9c94('0x15'),_0x9c94('0x16'),_0x9c94('0x17'),_0x9c94('0x18'),_0x9c94('0x19'),_0x9c94('0x1a'),_0x9c94('0x1b'),_0x9c94('0x1c'),_0x9c94('0x1d'),_0x9c94('0x1e'),_0x9c94('0x1f'),_0x9c94('0x20'),_0x9c94('0x21'),_0x9c94('0x22'),'dialAMDMinWordLength',_0x9c94('0x23'),'dialAMDMaximumNumberOfWords',_0x9c94('0x24'),_0x9c94('0x25'),'timeout',_0x9c94('0x26'),'dialRecallInQueue','dialOrderByScheduledAt',_0x9c94('0x27'),'dialAgiAfterHangupClient',_0x9c94('0x28'),_0x9c94('0x6'),'strategy',_0x9c94('0x29'),_0x9c94('0x2a'),_0x9c94('0x2b'),_0x9c94('0x2c'),_0x9c94('0x2d'),_0x9c94('0x2e'),_0x9c94('0x2f'),'dialAbandonedRetryFrequency',_0x9c94('0x30'),_0x9c94('0x31'),'dialAgentRejectMaxRetry',_0x9c94('0x32'),_0x9c94('0x33'),_0x9c94('0x34'),_0x9c94('0x35'),_0x9c94('0x36')],'include':[{'model':_0x9c94('0x37'),'as':_0x9c94('0x37'),'attributes':['id',_0x9c94('0x3'),_0x9c94('0x38'),_0x9c94('0x39')]},{'model':_0x9c94('0x3a'),'as':_0x9c94('0x3b'),'attributes':['id',_0x9c94('0x3')]},{'model':_0x9c94('0x37'),'as':'TrunkBackup','attributes':['id',_0x9c94('0x3'),_0x9c94('0x38'),'active']},{'model':_0x9c94('0x3c'),'as':_0x9c94('0x3c'),'attributes':['id',_0x9c94('0x3')],'include':[{'model':_0x9c94('0x3c'),'as':_0x9c94('0x3d'),'attributes':['id','name',_0x9c94('0x3e')]}]}]},'log':_0x9c94('0x3f')});};}; \ No newline at end of file +var _0xc492=['dialOriginateTimeout','dialQueueTimeout','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','acw','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc492,0xd7));var _0x2c49=function(_0x23c08a,_0x445cb4){_0x23c08a=_0x23c08a-0x0;var _0x542e14=_0xc492[_0x23c08a];return _0x542e14;};'use strict';var client=require(_0x2c49('0x0'));exports[_0x2c49('0x1')]=function(){return function(){return client[_0x2c49('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x2c49('0x3'),'acwTimeout','autopause',_0x2c49('0x4'),_0x2c49('0x5'),'dialActive',_0x2c49('0x6'),'dialLimitChannel',_0x2c49('0x7'),_0x2c49('0x8'),'dialPredictiveOptimization',_0x2c49('0x9'),_0x2c49('0xa'),_0x2c49('0xb'),_0x2c49('0xc'),_0x2c49('0xd'),'dialQueueOptions',_0x2c49('0xe'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry',_0x2c49('0xf'),'dialNoAnswerMaxRetry',_0x2c49('0x10'),_0x2c49('0x11'),'dialTimezone',_0x2c49('0x12'),_0x2c49('0x13'),_0x2c49('0x14'),_0x2c49('0x15'),_0x2c49('0x16'),_0x2c49('0x17'),'dialAMDAfterGreetingSilence',_0x2c49('0x18'),_0x2c49('0x19'),_0x2c49('0x1a'),_0x2c49('0x1b'),_0x2c49('0x1c'),'dialAMDMaximumWordLength',_0x2c49('0x1d'),_0x2c49('0x1e'),_0x2c49('0x1f'),_0x2c49('0x20'),_0x2c49('0x21'),_0x2c49('0x22'),_0x2c49('0x23'),_0x2c49('0x4'),_0x2c49('0x24'),_0x2c49('0x25'),'dialCutDigit',_0x2c49('0x26'),_0x2c49('0x27'),_0x2c49('0x28'),_0x2c49('0x29'),'dialAbandonedMaxRetry',_0x2c49('0x2a'),'dialMachineMaxRetry',_0x2c49('0x2b'),_0x2c49('0x2c'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x2c49('0x2d'),_0x2c49('0x2e'),_0x2c49('0x2f')],'include':[{'model':_0x2c49('0x30'),'as':_0x2c49('0x30'),'attributes':['id',_0x2c49('0x31'),_0x2c49('0x32'),_0x2c49('0x33')]},{'model':_0x2c49('0x34'),'as':'mandatoryDispositionPause','attributes':['id',_0x2c49('0x31')]},{'model':_0x2c49('0x30'),'as':_0x2c49('0x35'),'attributes':['id',_0x2c49('0x31'),'callerid',_0x2c49('0x33')]},{'model':_0x2c49('0x36'),'as':_0x2c49('0x36'),'attributes':['id',_0x2c49('0x31')],'include':[{'model':'Interval','as':_0x2c49('0x37'),'attributes':['id',_0x2c49('0x31'),_0x2c49('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index b6b56c9..3c6efae 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x3ce68d,_0x52a108){var _0x2b8c33=function(_0x2a6a85){while(--_0x2a6a85){_0x3ce68d['push'](_0x3ce68d['shift']());}};_0x2b8c33(++_0x52a108);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2b623c,_0x1eca8f){var _0x1e8df7=function(_0x3c6062){while(--_0x3c6062){_0x2b623c['push'](_0x2b623c['shift']());}};_0x1e8df7(++_0x1eca8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 6e4d819..55136c6 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffeb=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x835f77,_0x2c40f3){var _0x52a279=function(_0x119977){while(--_0x119977){_0x835f77['push'](_0x835f77['shift']());}};_0x52a279(++_0x2c40f3);}(_0xffeb,0x1dc));var _0xbffe=function(_0x309e52,_0x26c91b){_0x309e52=_0x309e52-0x0;var _0x2797c6=_0xffeb[_0x309e52];return _0x2797c6;};'use strict';var client=require('../client');exports[_0xbffe('0x0')]=function(_0x4ecb85){return function(){return client[_0xbffe('0x1')](_0xbffe('0x2'),{'options':{'where':{'VoiceQueueId':_0x4ecb85,'paused':!![]},'raw':!![]},'log':_0xbffe('0x0')});};}; \ No newline at end of file +var _0x1d68=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x14b49e,_0x22075a){var _0xe75985=function(_0x380077){while(--_0x380077){_0x14b49e['push'](_0x14b49e['shift']());}};_0xe75985(++_0x22075a);}(_0x1d68,0x172));var _0x81d6=function(_0x5cf90e,_0x5df405){_0x5cf90e=_0x5cf90e-0x0;var _0xae958d=_0x1d68[_0x5cf90e];return _0xae958d;};'use strict';var client=require('../client');exports[_0x81d6('0x0')]=function(_0x511fe9){return function(){return client[_0x81d6('0x1')](_0x81d6('0x2'),{'options':{'where':{'VoiceQueueId':_0x511fe9,'paused':!![]},'raw':!![]},'log':_0x81d6('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 079db51..236cfd0 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x251f58,_0x1ffa21){var _0x101ac8=function(_0x1b7008){while(--_0x1b7008){_0x251f58['push'](_0x251f58['shift']());}};_0x101ac8(++_0x1ffa21);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4a3e82,_0x4a7039){var _0x502075=function(_0xeac00f){while(--_0xeac00f){_0x4a3e82['push'](_0x4a3e82['shift']());}};_0x502075(++_0x4a7039);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 4b18a99..049149d 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaec9=['transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransfererexten','attended','transfers','blindTransfer','Request','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x235344,_0x145bfe){var _0x5a7264=function(_0x3e07f2){while(--_0x3e07f2){_0x235344['push'](_0x235344['shift']());}};_0x5a7264(++_0x145bfe);}(_0xaec9,0x1c0));var _0x9aec=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0xaec9[_0x11309c];return _0x3fea9c;};'use strict';var client=require('../client');exports[_0x9aec('0x0')]={};exports[_0x9aec('0x1')]=function(_0xc34526){return client[_0x9aec('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xc34526[_0x9aec('0x3')],'transfererchannel':_0xc34526['transfererchannel'],'transferercalleridnum':_0xc34526[_0x9aec('0x4')],'transferercalleridname':_0xc34526[_0x9aec('0x5')],'transfererconnectedlinenum':_0xc34526['transfererconnectedlinenum'],'transfererconnectedlinename':_0xc34526[_0x9aec('0x6')],'transfereraccountcode':_0xc34526['transfereraccountcode'],'transferercontext':_0xc34526[_0x9aec('0x7')],'transfererexten':_0xc34526['transfererexten'],'transfererlinkedid':_0xc34526['transfererlinkedid'],'transfereechannel':_0xc34526[_0x9aec('0x8')],'transfereecalleridnum':_0xc34526[_0x9aec('0x9')],'transfereecalleridname':_0xc34526['transfereecalleridname'],'transfereeconnectedlinenum':_0xc34526[_0x9aec('0xa')],'transfereeconnectedlinename':_0xc34526[_0x9aec('0xb')],'transfereeaccountcode':_0xc34526[_0x9aec('0xc')],'transfereecontext':_0xc34526[_0x9aec('0xd')],'transfereeexten':_0xc34526['transfereeexten'],'transfereelinkedid':_0xc34526[_0x9aec('0xe')],'isexternal':_0xc34526[_0x9aec('0xf')],'context':_0xc34526[_0x9aec('0x10')],'extension':_0xc34526['extension'],'type':_0x9aec('0x11')},'log':_0x9aec('0x12')});};exports['attendedTransfer']=function(_0x5ae599){return client[_0x9aec('0x2')](_0x9aec('0x12'),{'body':{'result':_0x5ae599[_0x9aec('0x3')],'transfererchannel':_0x5ae599[_0x9aec('0x13')],'transferercalleridnum':_0x5ae599['origtransferercalleridnum'],'transferercalleridname':_0x5ae599['origtransferercalleridname'],'transfererconnectedlinenum':_0x5ae599[_0x9aec('0x14')],'transfererconnectedlinename':_0x5ae599[_0x9aec('0x15')],'transfereraccountcode':_0x5ae599[_0x9aec('0x16')],'transferercontext':_0x5ae599[_0x9aec('0x17')],'transfererexten':_0x5ae599[_0x9aec('0x18')],'transfererlinkedid':_0x5ae599['origtransfererlinkedid'],'transfereechannel':_0x5ae599['transfertargetchannel'],'transfereecalleridnum':_0x5ae599['transfertargetcalleridnum'],'transfereecalleridname':_0x5ae599[_0x9aec('0x19')],'transfereeconnectedlinenum':_0x5ae599[_0x9aec('0x1a')],'transfereeconnectedlinename':_0x5ae599[_0x9aec('0x1b')],'transfereeaccountcode':_0x5ae599[_0x9aec('0x1c')],'transfereecontext':_0x5ae599[_0x9aec('0x1d')],'transfereeexten':_0x5ae599[_0x9aec('0x1e')],'transfereelinkedid':_0x5ae599['transfertargetlinkedid'],'isexternal':_0x5ae599[_0x9aec('0xf')],'context':_0x5ae599['origtransferercontext'],'extension':_0x5ae599[_0x9aec('0x1f')],'type':_0x9aec('0x20')},'log':_0x9aec('0x12')});}; \ No newline at end of file +var _0x038f=['isexternal','origtransferercontext','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x038f,0x9f));var _0xf038=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x038f[_0x375492];return _0x18ba5b;};'use strict';var client=require(_0xf038('0x0'));exports[_0xf038('0x1')]={};exports[_0xf038('0x2')]=function(_0xa29d22){return client['Request'](_0xf038('0x3'),{'body':{'result':_0xa29d22[_0xf038('0x4')],'transfererchannel':_0xa29d22[_0xf038('0x5')],'transferercalleridnum':_0xa29d22['transferercalleridnum'],'transferercalleridname':_0xa29d22[_0xf038('0x6')],'transfererconnectedlinenum':_0xa29d22['transfererconnectedlinenum'],'transfererconnectedlinename':_0xa29d22[_0xf038('0x7')],'transfereraccountcode':_0xa29d22['transfereraccountcode'],'transferercontext':_0xa29d22[_0xf038('0x8')],'transfererexten':_0xa29d22[_0xf038('0x9')],'transfererlinkedid':_0xa29d22[_0xf038('0xa')],'transfereechannel':_0xa29d22[_0xf038('0xb')],'transfereecalleridnum':_0xa29d22[_0xf038('0xc')],'transfereecalleridname':_0xa29d22[_0xf038('0xd')],'transfereeconnectedlinenum':_0xa29d22[_0xf038('0xe')],'transfereeconnectedlinename':_0xa29d22['transfereeconnectedlinename'],'transfereeaccountcode':_0xa29d22[_0xf038('0xf')],'transfereecontext':_0xa29d22[_0xf038('0x10')],'transfereeexten':_0xa29d22['transfereeexten'],'transfereelinkedid':_0xa29d22[_0xf038('0x11')],'isexternal':_0xa29d22['isexternal'],'context':_0xa29d22['context'],'extension':_0xa29d22[_0xf038('0x12')],'type':_0xf038('0x13')},'log':_0xf038('0x3')});};exports[_0xf038('0x14')]=function(_0x2d3b3a){return client[_0xf038('0x15')](_0xf038('0x3'),{'body':{'result':_0x2d3b3a[_0xf038('0x4')],'transfererchannel':_0x2d3b3a[_0xf038('0x16')],'transferercalleridnum':_0x2d3b3a[_0xf038('0x17')],'transferercalleridname':_0x2d3b3a['origtransferercalleridname'],'transfererconnectedlinenum':_0x2d3b3a[_0xf038('0x18')],'transfererconnectedlinename':_0x2d3b3a[_0xf038('0x19')],'transfereraccountcode':_0x2d3b3a[_0xf038('0x1a')],'transferercontext':_0x2d3b3a[_0xf038('0x1b')],'transfererexten':_0x2d3b3a[_0xf038('0x1c')],'transfererlinkedid':_0x2d3b3a['origtransfererlinkedid'],'transfereechannel':_0x2d3b3a[_0xf038('0x1d')],'transfereecalleridnum':_0x2d3b3a['transfertargetcalleridnum'],'transfereecalleridname':_0x2d3b3a[_0xf038('0x1e')],'transfereeconnectedlinenum':_0x2d3b3a[_0xf038('0x1f')],'transfereeconnectedlinename':_0x2d3b3a[_0xf038('0x20')],'transfereeaccountcode':_0x2d3b3a[_0xf038('0x21')],'transfereecontext':_0x2d3b3a['transfertargetcontext'],'transfereeexten':_0x2d3b3a[_0xf038('0x22')],'transfereelinkedid':_0x2d3b3a[_0xf038('0x23')],'isexternal':_0x2d3b3a[_0xf038('0x24')],'context':_0x2d3b3a[_0xf038('0x25')],'extension':_0x2d3b3a['origtransfererexten'],'type':_0xf038('0x26')},'log':_0xf038('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 4f62cfb..f61db04 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0618=['callerid','Interval','length','find','omit','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','agents','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','../properties','../ami','listen','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join','Command','voiceQueues','hasOwnProperty','strategy','answered','available','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active'];(function(_0x4bc164,_0x20b42a){var _0xad8515=function(_0x5dce80){while(--_0x5dce80){_0x4bc164['push'](_0x4bc164['shift']());}};_0xad8515(++_0x20b42a);}(_0x0618,0x1c6));var _0x8061=function(_0x354e9e,_0x5e5dfa){_0x354e9e=_0x354e9e-0x0;var _0x2e388d=_0x0618[_0x354e9e];return _0x2e388d;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var jayson=require('jayson/promise');var schema=require(_0x8061('0x2'));var BPromise=require(_0x8061('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x8061('0x4'));var ami=require(_0x8061('0x5'));exports[_0x8061('0x6')]=function(_0x2683db,_0x22302b,_0x2c47b6){return new BPromise(function(_0x1cca7f,_0x9c161b){var _0x2c5e9d={'QueuePause':function(_0x3bb894){return new Promise(function(_0x7bfd18,_0x483d55){var _0x1a0cd0=util['format'](_0x8061('0x7'),_0x8061('0x8'),_0x3bb894[_0x8061('0x9')]);if(_0x2683db[_0x8061('0xa')]&&_0x2683db[_0x8061('0xa')][_0x1a0cd0]&&_0x2683db['timers'][_0x1a0cd0]['timer']){_0x2683db[_0x8061('0xa')][_0x1a0cd0][_0x8061('0xb')]();}if(_0x2683db['agents'][_0x1a0cd0]){_0x2683db['agents'][_0x1a0cd0][_0x8061('0xc')]({'statePause':_0x3bb894[_0x8061('0xd')]?!![]:![]});}_0x7bfd18({'code':0xc8,'message':_0x8061('0xe')});});},'Reload':function(_0x3537f0){var _0x16f047=this;return new Promise(function(_0x9b1ff1,_0x5c4417){if(ami['isConnected']()==![]){return _0x5c4417(_0x16f047[_0x8061('0xf')](0x1f4,[config[_0x8061('0x10')]['ip'],config[_0x8061('0x10')][_0x8061('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x3537f0=_[_0x8061('0x12')](_0x3537f0,_[_0x8061('0x13')](properties[_0x8061('0x14')]));_0x3537f0[_0x8061('0x15')]=_0x8061('0x16');return ami[_0x8061('0x17')](_0x3537f0)[_0x8061('0x18')](function(_0x322dae){_0x9b1ff1({'code':0xc8,'message':_0x322dae[_0x8061('0x19')]});})[_0x8061('0x1a')](function(_0x14230e){_0x5c4417(_0x16f047[_0x8061('0xf')](0x1f5,_0x14230e[_0x8061('0x19')]));});});},'Command':function(_0x58683d){var _0x4d254d=this;return new Promise(function(_0x32c9d3,_0x310c1c){if(ami[_0x8061('0x1b')]()==![]){return _0x310c1c(_0x4d254d['error'](0x1f4,[config['asterisk']['ip'],config[_0x8061('0x10')][_0x8061('0x11')],_0x8061('0x1c')][_0x8061('0x1d')]('\x20')));}_0x58683d=_['pick'](_0x58683d,'command');_0x58683d[_0x8061('0x15')]=_0x8061('0x1e');return ami['Action'](_0x58683d)['then'](function(_0x3dbaea){_0x32c9d3({'code':0xc8,'message':_0x3dbaea['content']});})['catch'](function(_0x37bff0){_0x310c1c(_0x4d254d[_0x8061('0xf')](0x1f5,_0x37bff0['message']));});});},'VoiceQueues':function(_0x55459f){return new Promise(function(_0x17dbff,_0x3f2765){var _0x4e0860=[];for(var _0x1b0ec7 in _0x2683db[_0x8061('0x1f')]){if(_0x2683db[_0x8061('0x1f')][_0x8061('0x20')](_0x1b0ec7)){var _0x5f0822=_0x2683db['voiceQueues'][_0x1b0ec7];var _0x1563a1={'id':_0x5f0822['id'],'name':_0x5f0822[_0x8061('0x9')],'strategy':_0x5f0822[_0x8061('0x21')],'answered':_0x5f0822[_0x8061('0x22')],'available':_0x5f0822[_0x8061('0x23')],'loggedIn':_0x5f0822['loggedIn'],'pTalking':_0x5f0822['pTalking'],'sumBillable':_0x5f0822['sumBillable'],'sumDuration':_0x5f0822['sumDuration'],'sumHoldTime':_0x5f0822[_0x8061('0x24')]||0x0,'talking':_0x5f0822[_0x8061('0x25')],'total':_0x5f0822[_0x8061('0x26')],'type':_0x5f0822[_0x8061('0x27')],'unmanaged':_0x5f0822[_0x8061('0x28')],'abandoned':_0x5f0822[_0x8061('0x29')],'waiting':_0x5f0822[_0x8061('0x2a')],'loggedInDb':_0x5f0822[_0x8061('0x2b')]};if(_0x5f0822[_0x8061('0x27')]===_0x8061('0x2c')){_0x1563a1['dialActive']=_0x5f0822['dialActive'];_0x1563a1[_0x8061('0x2d')]=_0x5f0822[_0x8061('0x2d')];_0x1563a1[_0x8061('0x2e')]=_0x5f0822[_0x8061('0x2e')];_0x1563a1[_0x8061('0x2f')]=_0x5f0822['dialOriginateCallerIdNumber'];_0x1563a1[_0x8061('0x30')]=_0x5f0822[_0x8061('0x30')];_0x1563a1['dialPrefix']=_0x5f0822['dialPrefix'];_0x1563a1[_0x8061('0x31')]=_0x5f0822[_0x8061('0x31')];_0x1563a1['outboundAnswerAgiCallsDay']=_0x5f0822[_0x8061('0x32')];_0x1563a1[_0x8061('0x33')]=_0x5f0822[_0x8061('0x33')];_0x1563a1[_0x8061('0x34')]=_0x5f0822[_0x8061('0x34')];_0x1563a1[_0x8061('0x35')]=_0x5f0822[_0x8061('0x35')];_0x1563a1[_0x8061('0x36')]=_0x5f0822[_0x8061('0x36')];_0x1563a1['outboundDropCallsDayACS']=_0x5f0822[_0x8061('0x37')];_0x1563a1[_0x8061('0x38')]=_0x5f0822[_0x8061('0x38')];_0x1563a1[_0x8061('0x39')]=_0x5f0822['outboundDropCallsDayTimeout'];_0x1563a1['outboundNoAnswerCallsDay']=_0x5f0822['outboundNoAnswerCallsDay'];_0x1563a1['outboundNoSuchCallsDay']=_0x5f0822['outboundNoSuchCallsDay'];_0x1563a1[_0x8061('0x3a')]=_0x5f0822['outboundOriginateFailureCallsDay'];_0x1563a1[_0x8061('0x3b')]=_0x5f0822[_0x8061('0x3b')];_0x1563a1[_0x8061('0x3c')]=_0x5f0822[_0x8061('0x3c')];_0x1563a1[_0x8061('0x3d')]=_0x5f0822['outboundUnknownCallsDay'];_0x1563a1[_0x8061('0x3e')]=_0x5f0822[_0x8061('0x3e')];_0x1563a1[_0x8061('0x3f')]=_0x5f0822[_0x8061('0x3f')];_0x1563a1[_0x8061('0x40')]=_0x5f0822[_0x8061('0x40')];_0x1563a1[_0x8061('0x41')]=_0x5f0822[_0x8061('0x41')];_0x1563a1[_0x8061('0x42')]=_0x5f0822[_0x8061('0x42')];_0x1563a1[_0x8061('0x43')]=_0x5f0822[_0x8061('0x43')];_0x1563a1['predictiveIntervalErlangCallsDroppedCalls']=_0x5f0822['predictiveIntervalErlangCallsDroppedCalls'];_0x1563a1[_0x8061('0x44')]=_0x5f0822['predictiveIntervalHitRate'];_0x1563a1[_0x8061('0x45')]=_0x5f0822['predictiveIntervalMultiplicativeFactor'];_0x1563a1['predictiveIntervalPauses']=_0x5f0822[_0x8061('0x46')];_0x1563a1[_0x8061('0x47')]=_0x5f0822[_0x8061('0x47')];_0x1563a1[_0x8061('0x48')]=_0x5f0822[_0x8061('0x48')];_0x1563a1[_0x8061('0x19')]=_0x5f0822[_0x8061('0x19')];_0x1563a1[_0x8061('0x49')]=_0x5f0822[_0x8061('0x49')];_0x1563a1[_0x8061('0x4a')]=_0x5f0822['erlangCalls'];_0x1563a1[_0x8061('0x4b')]=_0x5f0822[_0x8061('0x4b')];_0x1563a1[_0x8061('0x4c')]=_0x5f0822[_0x8061('0x4c')];_0x1563a1[_0x8061('0x4d')]=_0x5f0822['erlangBusyFactor'];_0x1563a1['startPredictive']=_0x5f0822[_0x8061('0x4e')];_0x1563a1[_0x8061('0x4f')]=_0x5f0822[_0x8061('0x4f')];}if(_0x5f0822[_0x8061('0x50')]){_0x1563a1[_0x8061('0x50')]={'id':_0x5f0822[_0x8061('0x50')]['id'],'name':_0x5f0822[_0x8061('0x50')]['name'],'active':_0x5f0822[_0x8061('0x50')][_0x8061('0x51')],'callerid':_0x5f0822[_0x8061('0x50')][_0x8061('0x52')]};}if(_0x5f0822[_0x8061('0x53')]){_0x1563a1[_0x8061('0x53')]={'id':_0x5f0822[_0x8061('0x53')]['id'],'name':_0x5f0822['Interval'][_0x8061('0x9')]};}_0x4e0860['push'](_0x1563a1);}}_0x17dbff({'count':_0x4e0860[_0x8061('0x54')],'rows':_0x4e0860});});},'UpdateVoiceQueue':function(_0xef7273){return new Promise(function(_0x394f3a,_0x53f760){var _0x528532=_[_0x8061('0x55')](_0x2683db[_0x8061('0x1f')],{'id':parseInt(_0xef7273['id'])});var _0x297f29=_[_0x8061('0x56')](_0xef7273,['id']);if(_0x528532){for(var _0x3a43d7 in _0x297f29){if(typeof _0x297f29[_0x3a43d7]!=='undefined'&&typeof _0x528532[_0x3a43d7]!=='undefined'){_0x528532[_0x3a43d7]=_0x297f29[_0x3a43d7];}}_0x394f3a(_0x528532);}else{_0x53f760();}});},'VoiceChannels':function(_0x46a2d7){return new Promise(function(_0x4a3e17,_0x35c611){var _0x393bc9=_['values'](_0x2683db[_0x8061('0x57')]);_0x4a3e17({'count':_0x393bc9[_0x8061('0x54')],'rows':_0x393bc9});});},'VoiceChannelMixMonitor':function(_0x3176f5){var _0x1208f1=this;return new Promise(function(_0x574d67,_0x1dac0a){if(ami[_0x8061('0x1b')]()==![]){return _0x1dac0a(_0x1208f1[_0x8061('0xf')](0x1f4,[config[_0x8061('0x10')]['ip'],config[_0x8061('0x10')][_0x8061('0x11')],_0x8061('0x1c')][_0x8061('0x1d')]('\x20')));}var _0x31eb60=schema(properties[_0x8061('0x58')])[_0x8061('0x2')](_0x3176f5);if(_0x31eb60[_0x8061('0x54')]>0x0){return _0x1dac0a(_0x1208f1[_0x8061('0xf')](0x1f4,_[_0x8061('0x59')](_0x31eb60,_0x8061('0x19'))[_0x8061('0x1d')](',\x20')));}var _0x35e5b5=_['find'](_0x2683db[_0x8061('0x57')],{'uniqueid':_0x3176f5[_0x8061('0x5a')]});if(_0x35e5b5&&_0x35e5b5[_0x8061('0x5b')]){var _0x2f481e=util['format'](_0x8061('0x5c'),_0x3176f5[_0x8061('0x5d')]||_0x3176f5[_0x8061('0x5a')],_0x3176f5[_0x8061('0x5e')]||_0x8061('0x5f'));return ami[_0x8061('0x17')]({'action':_0x8061('0x60'),'channel':_0x35e5b5[_0x8061('0x5b')],'file':_0x2f481e,'options':_0x8061('0x61')})[_0x8061('0x18')](function(_0x364274){var _0x13e58d=_['find'](_0x35e5b5[_0x8061('0x62')],{'filename':_0x8061('0x63')+_0x2f481e['toLowerCase']()});if(_[_0x8061('0x64')](_0x13e58d)){_0x35e5b5['monitors'][_0x8061('0x65')]({'filename':_0x8061('0x63')+_0x2f481e[_0x8061('0x66')](),'createdAt':moment()[_0x8061('0x5e')](_0x8061('0x67')),'mixmonitorid':_0x364274['mixmonitorid'],'status':'rec'});}else{_0x13e58d[_0x8061('0x68')]=_0x364274[_0x8061('0x68')];_0x13e58d[_0x8061('0x69')]='rec';}_0x574d67({'code':0xc8,'message':[_0x3176f5['uniqueid'],_0x8061('0x6a'),_0x364274[_0x8061('0x68')]][_0x8061('0x1d')]('\x20'),'mixmonitorid':_0x364274['mixmonitorid']});})[_0x8061('0x1a')](function(_0x35f9d0){_0x1dac0a(_0x1208f1['error'](0x1f5,[_0x3176f5[_0x8061('0x5a')],_0x35f9d0['message'][_0x8061('0x66')]()][_0x8061('0x1d')]('\x20')));});}else{return _0x1dac0a(_0x1208f1[_0x8061('0xf')](0x1f5,_0x8061('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x5c344c){var _0x2ea047=this;return new Promise(function(_0x32928f,_0x3d7bdd){if(ami[_0x8061('0x1b')]()==![]){return _0x3d7bdd(_0x2ea047[_0x8061('0xf')](0x1f4,[config[_0x8061('0x10')]['ip'],config['asterisk'][_0x8061('0x11')],_0x8061('0x1c')]['join']('\x20')));}var _0x53cb32=schema(properties[_0x8061('0x58')])[_0x8061('0x2')](_0x5c344c);if(_0x53cb32[_0x8061('0x54')]>0x0){return _0x3d7bdd(_0x2ea047[_0x8061('0xf')](0x1f4,_['map'](_0x53cb32,'message')['join'](',\x20')));}var _0x5c18ab=_[_0x8061('0x55')](_0x2683db[_0x8061('0x57')],{'uniqueid':_0x5c344c[_0x8061('0x5a')]});if(_0x5c18ab){return BPromise[_0x8061('0x6c')]()[_0x8061('0x18')](function(){if(_0x5c18ab[_0x8061('0x5b')]){return ami[_0x8061('0x17')]({'action':_0x8061('0x6d'),'channel':_0x5c18ab[_0x8061('0x5b')],'mixmonitorid':_0x5c344c[_0x8061('0x68')]})[_0x8061('0x1a')](function(_0x56eaff){});}})[_0x8061('0x18')](function(){if(_0x5c18ab[_0x8061('0x6e')]){return ami['Action']({'action':_0x8061('0x6d'),'channel':_0x5c18ab['destinationchannel'],'mixmonitorid':_0x5c344c[_0x8061('0x68')]})[_0x8061('0x1a')](function(_0x392acd){});}})[_0x8061('0x18')](function(_0x4ffc05){var _0x3e9373=_['find'](_0x5c18ab[_0x8061('0x62')],{'mixmonitorid':_0x5c344c['mixmonitorid']});if(_0x3e9373){_0x3e9373[_0x8061('0x69')]=_0x8061('0x6f');}})['then'](function(){var _0x42dbc3=util[_0x8061('0x5e')]('%s.%s',_0x5c344c['filename']||_0x5c344c[_0x8061('0x5a')],_0x5c344c[_0x8061('0x5e')]||_0x8061('0x5f'));var _0x537044=_[_0x8061('0x55')](_0x5c18ab[_0x8061('0x62')],{'filename':_0x8061('0x63')+_0x42dbc3[_0x8061('0x66')]()});if(_0x537044){_0x537044['status']=_0x8061('0x6f');}})['then'](function(){_0x32928f({'code':0xc8,'message':[_0x5c344c[_0x8061('0x5a')],'StopMixMonitor\x20Success'][_0x8061('0x1d')]('\x20')});})[_0x8061('0x1a')](function(_0x284624){_0x3d7bdd(_0x2ea047[_0x8061('0xf')](0x1f5,[_0x5c344c[_0x8061('0x5a')],_0x284624['message'][_0x8061('0x66')]()][_0x8061('0x1d')]('\x20')));});}else{return _0x3d7bdd(_0x2ea047['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x1d27f1){return new Promise(function(_0x54a8af,_0x572ac8){var _0x512c28=_[_0x8061('0x70')](_0x2683db[_0x8061('0x71')]);_0x54a8af({'count':_0x512c28[_0x8061('0x54')],'rows':_0x512c28});});},'VoiceQueuesChannel':function(_0x5d7e19){var _0x3b67af=this;return new Promise(function(_0x58f4dc,_0xd8cdac){var _0x23eebc=schema(properties[_0x8061('0x72')])['validate'](_0x5d7e19);if(_0x23eebc[_0x8061('0x54')]>0x0){return _0xd8cdac(_0x3b67af[_0x8061('0xf')](0x1f4,_[_0x8061('0x59')](_0x23eebc,_0x8061('0x19'))[_0x8061('0x1d')](',\x20')));}var _0x5589c3=_[_0x8061('0x55')](_0x2683db[_0x8061('0x71')],{'uniqueid':_0x5d7e19[_0x8061('0x5a')]});if(_0x5589c3){_0x58f4dc(_0x5589c3);}else{return _0xd8cdac(_0x3b67af[_0x8061('0xf')](0x1f5,_0x8061('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x50198d){var _0x309b49=this;return new Promise(function(_0x58a285,_0x59936d){if(ami['isConnected']()==![]){return _0x59936d(_0x309b49[_0x8061('0xf')](0x1f4,[config[_0x8061('0x10')]['ip'],config[_0x8061('0x10')][_0x8061('0x11')],_0x8061('0x1c')]['join']('\x20')));}var _0x2afe62=schema(properties[_0x8061('0x73')])['validate'](_0x50198d);if(_0x2afe62[_0x8061('0x54')]>0x0){return _0x59936d(_0x309b49[_0x8061('0xf')](0x1f4,_['map'](_0x2afe62,_0x8061('0x19'))['join'](',\x20')));}var _0x1e51c4=_[_0x8061('0x55')](_0x2683db['queueChannels'],{'uniqueid':_0x50198d['uniqueid']});if(_0x1e51c4&&_0x1e51c4['channel']){return ami[_0x8061('0x17')]({'action':'Hangup','channel':_0x1e51c4[_0x8061('0x5b')]})['then'](function(_0x7f363e){_0x58a285({'code':0xc8,'message':[_0x50198d[_0x8061('0x5a')],_0x7f363e[_0x8061('0x19')]['toLowerCase']()][_0x8061('0x1d')]('\x20')});})[_0x8061('0x1a')](function(_0x27fd19){_0x59936d(_0x309b49['error'](0x1f5,[_0x50198d[_0x8061('0x5a')],_0x27fd19[_0x8061('0x19')]['toLowerCase']()][_0x8061('0x1d')]('\x20')));});}else{return _0x59936d(_0x309b49[_0x8061('0xf')](0x1f5,_0x8061('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x8aaaed){var _0x1c7e8c=this;return new Promise(function(_0x1fe8fc,_0x2184b3){if(ami[_0x8061('0x1b')]()==![]){return _0x2184b3(_0x1c7e8c[_0x8061('0xf')](0x1f4,[config[_0x8061('0x10')]['ip'],config[_0x8061('0x10')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x2dfbac=schema(properties[_0x8061('0x74')])[_0x8061('0x2')](_0x8aaaed);if(_0x2dfbac[_0x8061('0x54')]>0x0){return _0x2184b3(_0x1c7e8c[_0x8061('0xf')](0x1f4,_[_0x8061('0x59')](_0x2dfbac,_0x8061('0x19'))[_0x8061('0x1d')](',\x20')));}var _0x57188a=_[_0x8061('0x55')](_0x2683db[_0x8061('0x71')],{'uniqueid':_0x8aaaed[_0x8061('0x5a')]});if(_0x57188a&&_0x57188a['channel']){return ami[_0x8061('0x17')]({'action':_0x8061('0x75'),'channel':_0x57188a[_0x8061('0x5b')],'exten':_0x8aaaed[_0x8061('0x76')],'context':_0x8aaaed[_0x8061('0x77')]||_0x57188a[_0x8061('0x77')],'priority':0x1})[_0x8061('0x18')](function(_0x3165ee){_0x1fe8fc({'code':0xc8,'message':[_0x8aaaed['uniqueid'],_0x3165ee[_0x8061('0x19')][_0x8061('0x66')]()][_0x8061('0x1d')]('\x20')});})[_0x8061('0x1a')](function(_0x5be20f){_0x2184b3(_0x1c7e8c['error'](0x1f5,[_0x8aaaed[_0x8061('0x5a')],_0x5be20f[_0x8061('0x19')][_0x8061('0x66')]()][_0x8061('0x1d')]('\x20')));});}else{return _0x2184b3(_0x1c7e8c[_0x8061('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ef38c){return new Promise(function(_0x3471fa,_0x2cd433){var _0x46655f=_[_0x8061('0x70')](_0x2683db[_0x8061('0x78')]);_0x3471fa({'count':_0x46655f[_0x8061('0x54')],'rows':_0x46655f});});},'Telephones':function(_0x1e1811){return new Promise(function(_0x252f5d,_0x3b82f6){var _0x5ccc68=_[_0x8061('0x70')](_0x2683db['telephones']);_0x252f5d({'count':_0x5ccc68[_0x8061('0x54')],'rows':_0x5ccc68});});},'Trunks':function(_0x167125){return new Promise(function(_0x404d45,_0x220df3){var _0x21436e=_[_0x8061('0x70')](_0x2683db[_0x8061('0x79')]);_0x404d45({'count':_0x21436e[_0x8061('0x54')],'rows':_0x21436e});});},'OutboundChannels':function(_0x463276){return new Promise(function(_0x3a4da3,_0x4c749e){var _0x3b94f5=_[_0x8061('0x70')](_0x2683db[_0x8061('0x7a')]);_0x3a4da3({'count':_0x3b94f5[_0x8061('0x54')],'rows':_0x3b94f5});});},'Outbound':function(_0x442bd0){return new Promise(function(_0x17a5bf,_0x398f08){_0x17a5bf(_0x2683db[_0x8061('0x2c')]);});},'Campaigns':function(_0x336666){return new Promise(function(_0xeac050,_0x11dac6){var _0x277aaa=_[_0x8061('0x70')](_0x2683db[_0x8061('0x7b')]);_0xeac050({'count':_0x277aaa[_0x8061('0x54')],'rows':_0x277aaa});});},'VoiceQueuesPreview':function(_0x44d753){var _0x3ef41d=this;return new Promise(function(_0x1bcd97,_0x21863b){_0x22302b[_0x8061('0x7c')](_0x44d753['id'])[_0x8061('0x18')](function(_0x595679){_0x1bcd97({'code':0xc8,'message':_0x595679[_0x8061('0x19')]});})[_0x8061('0x1a')](function(_0x326a75){_0x21863b(_0x3ef41d[_0x8061('0xf')](0x1f4,_0x326a75[_0x8061('0x19')]));});});},'EventManager':function(_0x170e46){var _0x5b3827=this;return new Promise(function(_0x809f1,_0x326c52){if(!_0x170e46[_0x8061('0x7d')]){return _0x326c52(_0x5b3827['error'](0x1f4,_0x8061('0x7e')));}ami[_0x8061('0x7f')]('custom:'+_0x170e46[_0x8061('0x7d')],_0x170e46[_0x8061('0x19')]);_0x809f1({'code':0xc8,'message':_0x170e46});});},'FaxAccounts':function(_0x3daec9){return new Promise(function(_0x1f1b5c,_0x10f447){var _0x3e9913=_[_0x8061('0x70')](_0x2683db['faxAccounts']);_0x1f1b5c({'count':_0x3e9913['length'],'rows':_0x3e9913});});},'SendFax':function(_0x2dc62d){var _0x4406c4=this;return new Promise(function(_0x482c7e,_0x3f73d1){_0x2c47b6['send'](_0x2dc62d)[_0x8061('0x18')](function(_0x3fe87b){_0x482c7e({'code':0xc8,'message':_0x3fe87b['message']});})[_0x8061('0x1a')](function(_0x4427fb){_0x3f73d1(_0x4406c4[_0x8061('0xf')](0x1f4,_0x4427fb['message']));});});},'CheckAfterSend':function(_0x28afd3){var _0x11ccb6=this;return new Promise(function(_0x471668,_0x3fe9f9){_0x2c47b6[_0x8061('0x80')](_0x28afd3)[_0x8061('0x18')](function(_0x3bbefb){_0x471668({'code':0xc8,'message':_0x3bbefb[_0x8061('0x19')]});})[_0x8061('0x1a')](function(_0x51acab){_0x3fe9f9(_0x11ccb6[_0x8061('0xf')](0x1f4,_0x51acab[_0x8061('0x19')]));});});}};var _0x3f4bd4=jayson[_0x8061('0x81')](_0x2c5e9d)[_0x8061('0x82')]();_0x3f4bd4['on'](_0x8061('0xf'),function(_0x465387){return _0x9c161b(_0x465387);});_0x3f4bd4[_0x8061('0x6')](0x232a,_0x8061('0x83'),function(){console['log'](_0x8061('0x84'),0x232a);return _0x1cca7f(_0x8061('0x85')+0x232a);});});}; \ No newline at end of file +var _0xa46e=['custom:','send','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../properties','listen','format','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','message','catch','Command','then','content','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','callerid','Interval','push','length','find','voiceQueues','omit','undefined','values','voicechannel','map','channels','uniqueid','%s.%s','filename','wav','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','Hangup','Redirect','exten','telephones','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa46e,0x8a));var _0xea46=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xa46e[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var jayson=require('jayson/promise');var schema=require(_0xea46('0x2'));var BPromise=require(_0xea46('0x3'));var moment=require(_0xea46('0x4'));var config=require('../../../config/environment');var properties=require(_0xea46('0x5'));var ami=require('../ami');exports[_0xea46('0x6')]=function(_0x47d633,_0x3599fc,_0x528404){return new BPromise(function(_0x10bee5,_0x3dc26f){var _0x5f1cd1={'QueuePause':function(_0x2d1b30){return new Promise(function(_0x42771a,_0xe7d428){var _0x3db7a2=util[_0xea46('0x7')]('%s/%s','SIP',_0x2d1b30['name']);if(_0x47d633[_0xea46('0x8')]&&_0x47d633[_0xea46('0x8')][_0x3db7a2]&&_0x47d633['timers'][_0x3db7a2][_0xea46('0x9')]){_0x47d633[_0xea46('0x8')][_0x3db7a2][_0xea46('0xa')]();}if(_0x47d633['agents'][_0x3db7a2]){_0x47d633[_0xea46('0xb')][_0x3db7a2][_0xea46('0xc')]({'statePause':_0x2d1b30['pause']?!![]:![]});}_0x42771a({'code':0xc8,'message':_0xea46('0xd')});});},'Reload':function(_0x1a4fe2){var _0x534aa3=this;return new Promise(function(_0x20955e,_0x4e4d3f){if(ami[_0xea46('0xe')]()==![]){return _0x4e4d3f(_0x534aa3[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}_0x1a4fe2=_[_0xea46('0x14')](_0x1a4fe2,_[_0xea46('0x15')](properties['module']));_0x1a4fe2[_0xea46('0x16')]=_0xea46('0x17');return ami[_0xea46('0x18')](_0x1a4fe2)['then'](function(_0x58b4da){_0x20955e({'code':0xc8,'message':_0x58b4da[_0xea46('0x19')]});})[_0xea46('0x1a')](function(_0x5cf5dd){_0x4e4d3f(_0x534aa3['error'](0x1f5,_0x5cf5dd[_0xea46('0x19')]));});});},'Command':function(_0x9b7d04){var _0x4ff93d=this;return new Promise(function(_0x40316b,_0x16ae38){if(ami[_0xea46('0xe')]()==![]){return _0x16ae38(_0x4ff93d[_0xea46('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xea46('0x10')]['username'],'ami\x20disconnected'][_0xea46('0x13')]('\x20')));}_0x9b7d04=_['pick'](_0x9b7d04,'command');_0x9b7d04['action']=_0xea46('0x1b');return ami[_0xea46('0x18')](_0x9b7d04)[_0xea46('0x1c')](function(_0x5beb44){_0x40316b({'code':0xc8,'message':_0x5beb44[_0xea46('0x1d')]});})['catch'](function(_0x12e688){_0x16ae38(_0x4ff93d[_0xea46('0xf')](0x1f5,_0x12e688['message']));});});},'VoiceQueues':function(_0xac33c3){return new Promise(function(_0x5480eb,_0x2b3a8f){var _0x114bf9=[];for(var _0xd4cf78 in _0x47d633['voiceQueues']){if(_0x47d633['voiceQueues'][_0xea46('0x1e')](_0xd4cf78)){var _0x38ac07=_0x47d633['voiceQueues'][_0xd4cf78];var _0x3b3928={'id':_0x38ac07['id'],'name':_0x38ac07['name'],'strategy':_0x38ac07[_0xea46('0x1f')],'answered':_0x38ac07['answered'],'available':_0x38ac07[_0xea46('0x20')],'loggedIn':_0x38ac07[_0xea46('0x21')],'pTalking':_0x38ac07[_0xea46('0x22')],'sumBillable':_0x38ac07[_0xea46('0x23')],'sumDuration':_0x38ac07[_0xea46('0x24')],'sumHoldTime':_0x38ac07[_0xea46('0x25')]||0x0,'talking':_0x38ac07['talking'],'total':_0x38ac07[_0xea46('0x26')],'type':_0x38ac07[_0xea46('0x27')],'unmanaged':_0x38ac07[_0xea46('0x28')],'abandoned':_0x38ac07['abandoned'],'waiting':_0x38ac07[_0xea46('0x29')],'loggedInDb':_0x38ac07[_0xea46('0x2a')]};if(_0x38ac07[_0xea46('0x27')]==='outbound'){_0x3b3928['dialActive']=_0x38ac07['dialActive'];_0x3b3928[_0xea46('0x2b')]=_0x38ac07[_0xea46('0x2b')];_0x3b3928[_0xea46('0x2c')]=_0x38ac07[_0xea46('0x2c')];_0x3b3928[_0xea46('0x2d')]=_0x38ac07[_0xea46('0x2d')];_0x3b3928[_0xea46('0x2e')]=_0x38ac07[_0xea46('0x2e')];_0x3b3928[_0xea46('0x2f')]=_0x38ac07[_0xea46('0x2f')];_0x3b3928[_0xea46('0x30')]=_0x38ac07['temp'];_0x3b3928[_0xea46('0x31')]=_0x38ac07[_0xea46('0x31')];_0x3b3928[_0xea46('0x32')]=_0x38ac07[_0xea46('0x32')];_0x3b3928[_0xea46('0x33')]=_0x38ac07[_0xea46('0x33')];_0x3b3928[_0xea46('0x34')]=_0x38ac07['outboundBusyCallsDay'];_0x3b3928[_0xea46('0x35')]=_0x38ac07[_0xea46('0x35')];_0x3b3928[_0xea46('0x36')]=_0x38ac07[_0xea46('0x36')];_0x3b3928[_0xea46('0x37')]=_0x38ac07['outboundDropCallsDayCallersExit'];_0x3b3928['outboundDropCallsDayTimeout']=_0x38ac07[_0xea46('0x38')];_0x3b3928[_0xea46('0x39')]=_0x38ac07['outboundNoAnswerCallsDay'];_0x3b3928[_0xea46('0x3a')]=_0x38ac07[_0xea46('0x3a')];_0x3b3928[_0xea46('0x3b')]=_0x38ac07[_0xea46('0x3b')];_0x3b3928['outboundReCallsDay']=_0x38ac07['outboundReCallsDay'];_0x3b3928[_0xea46('0x3c')]=_0x38ac07['outboundRejectCallsDay'];_0x3b3928[_0xea46('0x3d')]=_0x38ac07[_0xea46('0x3d')];_0x3b3928['predictiveIntervalAnsweredCalls']=_0x38ac07[_0xea46('0x3e')];_0x3b3928[_0xea46('0x3f')]=_0x38ac07['predictiveIntervalAvgHoldtime'];_0x3b3928[_0xea46('0x40')]=_0x38ac07[_0xea46('0x40')];_0x3b3928['predictiveIntervalDroppedCallsCallersExit']=_0x38ac07[_0xea46('0x41')];_0x3b3928[_0xea46('0x42')]=_0x38ac07[_0xea46('0x42')];_0x3b3928[_0xea46('0x43')]=_0x38ac07['predictiveIntervalErlangCalls'];_0x3b3928[_0xea46('0x44')]=_0x38ac07[_0xea46('0x44')];_0x3b3928[_0xea46('0x45')]=_0x38ac07[_0xea46('0x45')];_0x3b3928[_0xea46('0x46')]=_0x38ac07['predictiveIntervalMultiplicativeFactor'];_0x3b3928[_0xea46('0x47')]=_0x38ac07[_0xea46('0x47')];_0x3b3928['predictiveIntervalAvailable']=_0x38ac07[_0xea46('0x48')];_0x3b3928[_0xea46('0x49')]=_0x38ac07[_0xea46('0x49')];_0x3b3928[_0xea46('0x19')]=_0x38ac07['message'];_0x3b3928[_0xea46('0x4a')]=_0x38ac07[_0xea46('0x4a')];_0x3b3928[_0xea46('0x4b')]=_0x38ac07['erlangCalls'];_0x3b3928[_0xea46('0x4c')]=_0x38ac07[_0xea46('0x4c')];_0x3b3928[_0xea46('0x4d')]=_0x38ac07[_0xea46('0x4d')];_0x3b3928[_0xea46('0x4e')]=_0x38ac07[_0xea46('0x4e')];_0x3b3928[_0xea46('0x4f')]=_0x38ac07[_0xea46('0x4f')];_0x3b3928[_0xea46('0x50')]=_0x38ac07[_0xea46('0x50')];}if(_0x38ac07[_0xea46('0x51')]){_0x3b3928[_0xea46('0x51')]={'id':_0x38ac07[_0xea46('0x51')]['id'],'name':_0x38ac07[_0xea46('0x51')][_0xea46('0x52')],'active':_0x38ac07['Trunk']['active'],'callerid':_0x38ac07[_0xea46('0x51')][_0xea46('0x53')]};}if(_0x38ac07[_0xea46('0x54')]){_0x3b3928[_0xea46('0x54')]={'id':_0x38ac07['Interval']['id'],'name':_0x38ac07['Interval']['name']};}_0x114bf9[_0xea46('0x55')](_0x3b3928);}}_0x5480eb({'count':_0x114bf9[_0xea46('0x56')],'rows':_0x114bf9});});},'UpdateVoiceQueue':function(_0x53a4d9){return new Promise(function(_0x25a278,_0x29caf0){var _0x18039b=_[_0xea46('0x57')](_0x47d633[_0xea46('0x58')],{'id':parseInt(_0x53a4d9['id'])});var _0x5c5eed=_[_0xea46('0x59')](_0x53a4d9,['id']);if(_0x18039b){for(var _0x4bd3f2 in _0x5c5eed){if(typeof _0x5c5eed[_0x4bd3f2]!==_0xea46('0x5a')&&typeof _0x18039b[_0x4bd3f2]!==_0xea46('0x5a')){_0x18039b[_0x4bd3f2]=_0x5c5eed[_0x4bd3f2];}}_0x25a278(_0x18039b);}else{_0x29caf0();}});},'VoiceChannels':function(_0x45ee37){return new Promise(function(_0x875507,_0x9c26cf){var _0x1260d1=_[_0xea46('0x5b')](_0x47d633['channels']);_0x875507({'count':_0x1260d1[_0xea46('0x56')],'rows':_0x1260d1});});},'VoiceChannelMixMonitor':function(_0x1fa670){var _0x53215a=this;return new Promise(function(_0x2a1fca,_0x42e305){if(ami[_0xea46('0xe')]()==![]){return _0x42e305(_0x53215a['error'](0x1f4,[config['asterisk']['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x4641bf=schema(properties[_0xea46('0x5c')])[_0xea46('0x2')](_0x1fa670);if(_0x4641bf[_0xea46('0x56')]>0x0){return _0x42e305(_0x53215a[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x4641bf,'message')[_0xea46('0x13')](',\x20')));}var _0x5c8cc3=_[_0xea46('0x57')](_0x47d633[_0xea46('0x5e')],{'uniqueid':_0x1fa670[_0xea46('0x5f')]});if(_0x5c8cc3&&_0x5c8cc3['channel']){var _0x41feff=util[_0xea46('0x7')](_0xea46('0x60'),_0x1fa670[_0xea46('0x61')]||_0x1fa670['uniqueid'],_0x1fa670['format']||_0xea46('0x62'));return ami[_0xea46('0x18')]({'action':'MixMonitor','channel':_0x5c8cc3[_0xea46('0x63')],'file':_0x41feff,'options':'ai(mixmonitorid)'})[_0xea46('0x1c')](function(_0x3830fe){var _0x389e22=_[_0xea46('0x57')](_0x5c8cc3[_0xea46('0x64')],{'filename':_0xea46('0x65')+_0x41feff[_0xea46('0x66')]()});if(_['isNil'](_0x389e22)){_0x5c8cc3['monitors'][_0xea46('0x55')]({'filename':'/var/spool/asterisk/monitor/'+_0x41feff[_0xea46('0x66')](),'createdAt':moment()[_0xea46('0x7')](_0xea46('0x67')),'mixmonitorid':_0x3830fe['mixmonitorid'],'status':_0xea46('0x68')});}else{_0x389e22['mixmonitorid']=_0x3830fe[_0xea46('0x69')];_0x389e22[_0xea46('0x6a')]='rec';}_0x2a1fca({'code':0xc8,'message':[_0x1fa670['uniqueid'],_0xea46('0x6b'),_0x3830fe[_0xea46('0x69')]][_0xea46('0x13')]('\x20'),'mixmonitorid':_0x3830fe['mixmonitorid']});})[_0xea46('0x1a')](function(_0x5b4847){_0x42e305(_0x53215a[_0xea46('0xf')](0x1f5,[_0x1fa670['uniqueid'],_0x5b4847[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x42e305(_0x53215a[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x4c5beb){var _0x3af50c=this;return new Promise(function(_0x2659bd,_0x455bc2){if(ami['isConnected']()==![]){return _0x455bc2(_0x3af50c['error'](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')][_0xea46('0x11')],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x175a42=schema(properties[_0xea46('0x5c')])[_0xea46('0x2')](_0x4c5beb);if(_0x175a42[_0xea46('0x56')]>0x0){return _0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x175a42,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0x219776=_[_0xea46('0x57')](_0x47d633['channels'],{'uniqueid':_0x4c5beb[_0xea46('0x5f')]});if(_0x219776){return BPromise[_0xea46('0x6d')]()[_0xea46('0x1c')](function(){if(_0x219776[_0xea46('0x63')]){return ami['Action']({'action':_0xea46('0x6e'),'channel':_0x219776[_0xea46('0x63')],'mixmonitorid':_0x4c5beb['mixmonitorid']})[_0xea46('0x1a')](function(_0x419f86){});}})['then'](function(){if(_0x219776[_0xea46('0x6f')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x6e'),'channel':_0x219776['destinationchannel'],'mixmonitorid':_0x4c5beb[_0xea46('0x69')]})[_0xea46('0x1a')](function(_0x214b85){});}})['then'](function(_0x4cdb8a){var _0x587bd3=_[_0xea46('0x57')](_0x219776[_0xea46('0x64')],{'mixmonitorid':_0x4c5beb[_0xea46('0x69')]});if(_0x587bd3){_0x587bd3[_0xea46('0x6a')]=_0xea46('0x70');}})['then'](function(){var _0x6b69e7=util['format'](_0xea46('0x60'),_0x4c5beb[_0xea46('0x61')]||_0x4c5beb[_0xea46('0x5f')],_0x4c5beb['format']||'wav');var _0x2b8a8b=_[_0xea46('0x57')](_0x219776['monitors'],{'filename':_0xea46('0x65')+_0x6b69e7[_0xea46('0x66')]()});if(_0x2b8a8b){_0x2b8a8b[_0xea46('0x6a')]=_0xea46('0x70');}})[_0xea46('0x1c')](function(){_0x2659bd({'code':0xc8,'message':[_0x4c5beb['uniqueid'],_0xea46('0x71')][_0xea46('0x13')]('\x20')});})[_0xea46('0x1a')](function(_0x199d96){_0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f5,[_0x4c5beb[_0xea46('0x5f')],_0x199d96[_0xea46('0x19')][_0xea46('0x66')]()]['join']('\x20')));});}else{return _0x455bc2(_0x3af50c[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'VoiceQueuesChannels':function(_0x26e982){return new Promise(function(_0x7f99b2,_0x24cc2c){var _0x3d258e=_[_0xea46('0x5b')](_0x47d633['queueChannels']);_0x7f99b2({'count':_0x3d258e['length'],'rows':_0x3d258e});});},'VoiceQueuesChannel':function(_0x2bc9f6){var _0x1202c6=this;return new Promise(function(_0x123444,_0x3ba634){var _0x10e0e1=schema(properties[_0xea46('0x72')])[_0xea46('0x2')](_0x2bc9f6);if(_0x10e0e1[_0xea46('0x56')]>0x0){return _0x3ba634(_0x1202c6[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x10e0e1,_0xea46('0x19'))['join'](',\x20')));}var _0x204435=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x2bc9f6[_0xea46('0x5f')]});if(_0x204435){_0x123444(_0x204435);}else{return _0x3ba634(_0x1202c6['error'](0x1f5,_0xea46('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x34f8f9){var _0x31604c=this;return new Promise(function(_0x12f788,_0x5d26eb){if(ami[_0xea46('0xe')]()==![]){return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config[_0xea46('0x10')]['username'],_0xea46('0x12')][_0xea46('0x13')]('\x20')));}var _0x50253d=schema(properties['voicequeuechannelhangup'])[_0xea46('0x2')](_0x34f8f9);if(_0x50253d[_0xea46('0x56')]>0x0){return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x50253d,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0x1d5b31=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x34f8f9[_0xea46('0x5f')]});if(_0x1d5b31&&_0x1d5b31[_0xea46('0x63')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x74'),'channel':_0x1d5b31['channel']})[_0xea46('0x1c')](function(_0xa8bfed){_0x12f788({'code':0xc8,'message':[_0x34f8f9['uniqueid'],_0xa8bfed[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')});})[_0xea46('0x1a')](function(_0x4bba61){_0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f5,[_0x34f8f9['uniqueid'],_0x4bba61[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x5d26eb(_0x31604c[_0xea46('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x237779){var _0x4c6d71=this;return new Promise(function(_0x4017da,_0x3f6978){if(ami['isConnected']()==![]){return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f4,[config[_0xea46('0x10')]['ip'],config['asterisk'][_0xea46('0x11')],_0xea46('0x12')]['join']('\x20')));}var _0x5e7a2c=schema(properties['voicequeuechannelredirect'])['validate'](_0x237779);if(_0x5e7a2c[_0xea46('0x56')]>0x0){return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f4,_[_0xea46('0x5d')](_0x5e7a2c,_0xea46('0x19'))[_0xea46('0x13')](',\x20')));}var _0xe6c28b=_[_0xea46('0x57')](_0x47d633[_0xea46('0x73')],{'uniqueid':_0x237779['uniqueid']});if(_0xe6c28b&&_0xe6c28b[_0xea46('0x63')]){return ami[_0xea46('0x18')]({'action':_0xea46('0x75'),'channel':_0xe6c28b[_0xea46('0x63')],'exten':_0x237779[_0xea46('0x76')],'context':_0x237779['context']||_0xe6c28b['context'],'priority':0x1})[_0xea46('0x1c')](function(_0x7e3ea4){_0x4017da({'code':0xc8,'message':[_0x237779[_0xea46('0x5f')],_0x7e3ea4[_0xea46('0x19')][_0xea46('0x66')]()]['join']('\x20')});})[_0xea46('0x1a')](function(_0x1b2383){_0x3f6978(_0x4c6d71['error'](0x1f5,[_0x237779['uniqueid'],_0x1b2383[_0xea46('0x19')][_0xea46('0x66')]()][_0xea46('0x13')]('\x20')));});}else{return _0x3f6978(_0x4c6d71[_0xea46('0xf')](0x1f5,_0xea46('0x6c')));}});},'Agents':function(_0x478db1){return new Promise(function(_0x299a48,_0x4c75b5){var _0x391b01=_[_0xea46('0x5b')](_0x47d633[_0xea46('0xb')]);_0x299a48({'count':_0x391b01[_0xea46('0x56')],'rows':_0x391b01});});},'Telephones':function(_0x55e8fb){return new Promise(function(_0xab4bba,_0x35e967){var _0x23d13e=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x77')]);_0xab4bba({'count':_0x23d13e[_0xea46('0x56')],'rows':_0x23d13e});});},'Trunks':function(_0x46419a){return new Promise(function(_0x11641b,_0x2855f8){var _0x59b475=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x78')]);_0x11641b({'count':_0x59b475['length'],'rows':_0x59b475});});},'OutboundChannels':function(_0x5a8e1b){return new Promise(function(_0x237c32,_0x2fc069){var _0x1bbc4e=_['values'](_0x47d633[_0xea46('0x79')]);_0x237c32({'count':_0x1bbc4e[_0xea46('0x56')],'rows':_0x1bbc4e});});},'Outbound':function(_0x565a67){return new Promise(function(_0x5e477d,_0x2e96ad){_0x5e477d(_0x47d633[_0xea46('0x7a')]);});},'Campaigns':function(_0xdaeb0f){return new Promise(function(_0xde7410,_0x6af502){var _0x4799fe=_[_0xea46('0x5b')](_0x47d633[_0xea46('0x7b')]);_0xde7410({'count':_0x4799fe['length'],'rows':_0x4799fe});});},'VoiceQueuesPreview':function(_0x1bbc55){var _0x2e2679=this;return new Promise(function(_0x2f985a,_0x4e2c45){_0x3599fc[_0xea46('0x7c')](_0x1bbc55['id'])[_0xea46('0x1c')](function(_0x89c609){_0x2f985a({'code':0xc8,'message':_0x89c609[_0xea46('0x19')]});})['catch'](function(_0x394ae5){_0x4e2c45(_0x2e2679[_0xea46('0xf')](0x1f4,_0x394ae5[_0xea46('0x19')]));});});},'EventManager':function(_0x20c8a3){var _0x59698a=this;return new Promise(function(_0x1c934b,_0x5d2231){if(!_0x20c8a3[_0xea46('0x7d')]){return _0x5d2231(_0x59698a[_0xea46('0xf')](0x1f4,_0xea46('0x7e')));}ami[_0xea46('0x7f')](_0xea46('0x80')+_0x20c8a3[_0xea46('0x7d')],_0x20c8a3[_0xea46('0x19')]);_0x1c934b({'code':0xc8,'message':_0x20c8a3});});},'FaxAccounts':function(_0x4cd7dd){return new Promise(function(_0x33f5a3,_0x45a97d){var _0x857744=_[_0xea46('0x5b')](_0x47d633['faxAccounts']);_0x33f5a3({'count':_0x857744[_0xea46('0x56')],'rows':_0x857744});});},'SendFax':function(_0x4d0f53){var _0x20b4bf=this;return new Promise(function(_0x55bd35,_0x5d0b19){_0x528404[_0xea46('0x81')](_0x4d0f53)[_0xea46('0x1c')](function(_0x1d5e79){_0x55bd35({'code':0xc8,'message':_0x1d5e79[_0xea46('0x19')]});})[_0xea46('0x1a')](function(_0x4db97e){_0x5d0b19(_0x20b4bf[_0xea46('0xf')](0x1f4,_0x4db97e[_0xea46('0x19')]));});});},'CheckAfterSend':function(_0xe805bb){var _0x2ca531=this;return new Promise(function(_0xd8c75b,_0x2879bc){_0x528404['checkAfterSend'](_0xe805bb)[_0xea46('0x1c')](function(_0xd2bc4c){_0xd8c75b({'code':0xc8,'message':_0xd2bc4c['message']});})[_0xea46('0x1a')](function(_0x53abbb){_0x2879bc(_0x2ca531[_0xea46('0xf')](0x1f4,_0x53abbb[_0xea46('0x19')]));});});}};var _0x367f04=jayson[_0xea46('0x82')](_0x5f1cd1)[_0xea46('0x83')]();_0x367f04['on'](_0xea46('0xf'),function(_0x5e4e96){return _0x3dc26f(_0x5e4e96);});_0x367f04['listen'](0x232a,'127.0.0.1',function(){console['log'](_0xea46('0x84'),0x232a);return _0x10bee5('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index d870556..ac7cd6a 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['xmd-contactid','data3','split','$or','routeId','destcalleridnum','calleridnum','phone','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','trigger:%s','action','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data2','isNil','data5'];(function(_0x2e17ee,_0x2ca16d){var _0x3155ba=function(_0x3e2f01){while(--_0x3e2f01){_0x2e17ee['push'](_0x2e17ee['shift']());}};_0x3155ba(++_0x2ca16d);}(_0x6aa7,0x178));var _0x76aa=function(_0x314035,_0x57c646){_0x314035=_0x314035-0x0;var _0x581c7a=_0x6aa7[_0x314035];return _0x581c7a;};'use strict';var _=require(_0x76aa('0x0'));var BPromise=require('bluebird');var Redis=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var config=require(_0x76aa('0x3'));var logger=require(_0x76aa('0x4'))('trigger');var cmContactRpc=require(_0x76aa('0x5'));config[_0x76aa('0x6')]=_[_0x76aa('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x76aa('0x8'))(new Redis(config['redis']));function emit(_0x32dee5,_0x36d12b,_0xa9b695,_0x56d6bc,_0x3dae33){logger[_0x76aa('0x9')](_0x76aa('0xa'),_0x32dee5,_0x36d12b['id'],_0xa9b695,_0x56d6bc,JSON['stringify'](_0x3dae33));io['to'](_0xa9b695)[_0x76aa('0xb')](_0x56d6bc,_0x3dae33);}exports[_0x76aa('0xc')]=function(_0x41643a,_0x16cb50,_0x37f1ab,_0x128435){var _0x2c5075,_0x8dc35c;var _0xd6327={};var _0x17a417=Number(_0x37f1ab['data1']);var _0x112c39=_0x37f1ab['data2']?Boolean(Number(_0x37f1ab[_0x76aa('0xd')])):![];var _0x12dde0;var _0x3f8f6b=![];if(!_[_0x76aa('0xe')](_0x37f1ab[_0x76aa('0xf')])){if(_0x37f1ab['data5']=='1')_0x3f8f6b=!![];}if(!_0x3f8f6b){if(_0x128435['xmd-contactid']){_0xd6327['id']=_0x128435[_0x76aa('0x10')];}}if(!_0xd6327['id']){_0xd6327['ListId']=_0x17a417;_0x12dde0=_0x37f1ab[_0x76aa('0x11')]&&_0x37f1ab[_0x76aa('0x11')]!=='0'?_0x37f1ab['data3'][_0x76aa('0x12')](','):['phone'];_0xd6327[_0x76aa('0x13')]=_['map'](_0x12dde0,function(_0x1515e9){var _0x413cf6={};_0x413cf6[_0x1515e9]=_0x128435[_0x76aa('0x14')]?_0x128435[_0x76aa('0x15')]:_0x128435[_0x76aa('0x16')];return _0x413cf6;});}var _0x3ead3f=['id','firstName','lastName',_0x76aa('0x17'),_0x76aa('0x18'),_0x76aa('0x19'),_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d')];var _0x2eaf48=_[_0x76aa('0x1e')](_0x3ead3f,_0x12dde0);BPromise['resolve']()[_0x76aa('0x1f')](cmContactRpc[_0x76aa('0x20')]({'attributes':_0x2eaf48,'where':_0xd6327}))[_0x76aa('0x1f')](function(_0x5b3f55){_0x8dc35c=_0x5b3f55;if(!_[_0x76aa('0x21')](_0x8dc35c)){if(_0x8dc35c[_0x76aa('0x22')]===0x1){_0x2c5075=_0x8dc35c[0x0];logger[_0x76aa('0x9')](_0x76aa('0x23'),_0x128435[_0x76aa('0x24')],_0x16cb50['id'],_0x2c5075['id']);}else{logger[_0x76aa('0x9')](_0x76aa('0x25'),_0x128435[_0x76aa('0x24')],_0x16cb50['id'],_[_0x76aa('0x26')](_0x8dc35c,'id')[_0x76aa('0x27')](','));}return;}else{logger[_0x76aa('0x9')](_0x76aa('0x28'),_0x128435[_0x76aa('0x24')],_0x16cb50['id']);var _0x4ef9b0={'ListId':_0x17a417};var _0xb5e8a9=_0x37f1ab[_0x76aa('0x29')]&&_0x37f1ab[_0x76aa('0x29')]!=='0'?_0x37f1ab[_0x76aa('0x29')]:_0x76aa('0x17');if(_0x112c39){logger[_0x76aa('0x9')](_0x76aa('0x2a'),_0x128435[_0x76aa('0x24')],_0x16cb50['id']);_0x4ef9b0[_0xb5e8a9]=_[_0x76aa('0xe')](_0x128435[_0x76aa('0x14')])?_0x128435['calleridnum']:_0x128435[_0x76aa('0x15')];if(_['isNil'](_0x128435[_0x76aa('0x14')])){_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2c')]&&_0x128435[_0x76aa('0x2c')]!==_0x76aa('0x2d')?_0x128435[_0x76aa('0x2c')]:_0x76aa('0x2e');}else{_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2f')]&&_0x128435[_0x76aa('0x2f')]!==''?_0x128435[_0x76aa('0x2f')]:_0x76aa('0x2e');}return BPromise[_0x76aa('0x30')]()[_0x76aa('0x1f')](cmContactRpc[_0x76aa('0x31')](_0x4ef9b0))[_0x76aa('0x1f')](function(_0x35a705){_0x2c5075=_0x35a705;_0x8dc35c['push'](_0x35a705);if(_0x2c5075){logger[_0x76aa('0x9')](_0x76aa('0x32'),_0x128435['uniqueid'],_0x16cb50['id'],_0x2c5075['id']);}return;});}else{logger[_0x76aa('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x128435[_0x76aa('0x24')],_0x16cb50['id']);_0x4ef9b0[_0xb5e8a9]=_['isNil'](_0x128435[_0x76aa('0x14')])?_0x128435['calleridnum']:_0x128435['destcalleridnum'];if(_[_0x76aa('0xe')](_0x128435[_0x76aa('0x14')])){_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2c')]&&_0x128435['calleridname']!==''?_0x128435[_0x76aa('0x2c')]:_0x76aa('0x2e');}else{_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2f')]&&_0x128435[_0x76aa('0x2f')]!==''?_0x128435[_0x76aa('0x2f')]:'Unknown';}_0x2c5075=_0x4ef9b0;_0x8dc35c['push'](_0x4ef9b0);return;}}})[_0x76aa('0x1f')](function(){if(_0x41643a){emit(_0x128435[_0x76aa('0x24')],_0x16cb50,util[_0x76aa('0x33')](_0x76aa('0x34'),_0x41643a['name']),util[_0x76aa('0x33')](_0x76aa('0x35'),_0x37f1ab[_0x76aa('0x36')]['toLowerCase']()),{'evt':_[_0x76aa('0x37')](_0x128435,{'autoCreate':_0x112c39}),'contact':_0x2c5075===undefined?{}:_0x2c5075,'contacts':_0x8dc35c[_0x76aa('0x22')]===0x0?undefined:_0x8dc35c});}});}; \ No newline at end of file +var _0xe5b3=['ListId','data3','$or','map','routeId','calleridnum','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','destcalleridnum','firstName','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','format','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','emit','exec','data1','data2','isNil','xmd-contactid'];(function(_0x1c4f58,_0x105960){var _0x243fbf=function(_0x35bf6e){while(--_0x35bf6e){_0x1c4f58['push'](_0x1c4f58['shift']());}};_0x243fbf(++_0x105960);}(_0xe5b3,0x133));var _0x3e5b=function(_0x27f0ed,_0xa0a04a){_0x27f0ed=_0x27f0ed-0x0;var _0x575a02=_0xe5b3[_0x27f0ed];return _0x575a02;};'use strict';var _=require('lodash');var BPromise=require(_0x3e5b('0x0'));var Redis=require(_0x3e5b('0x1'));var util=require(_0x3e5b('0x2'));var config=require(_0x3e5b('0x3'));var logger=require(_0x3e5b('0x4'))(_0x3e5b('0x5'));var cmContactRpc=require(_0x3e5b('0x6'));config[_0x3e5b('0x7')]=_[_0x3e5b('0x8')](config[_0x3e5b('0x7')],{'host':_0x3e5b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3e5b('0x7')]));function emit(_0x5dcf55,_0x534e7d,_0x41d46f,_0x3901c2,_0x3c7c2e){logger[_0x3e5b('0xa')]('[CM][%s][%s]',_0x5dcf55,_0x534e7d['id'],_0x41d46f,_0x3901c2,JSON['stringify'](_0x3c7c2e));io['to'](_0x41d46f)[_0x3e5b('0xb')](_0x3901c2,_0x3c7c2e);}exports[_0x3e5b('0xc')]=function(_0x22fc1a,_0x17dee7,_0xeeaabc,_0x522e9e){var _0x3be027,_0x52efbd;var _0x468305={};var _0x382273=Number(_0xeeaabc[_0x3e5b('0xd')]);var _0x374068=_0xeeaabc[_0x3e5b('0xe')]?Boolean(Number(_0xeeaabc[_0x3e5b('0xe')])):![];var _0x405e70;var _0x560010=![];if(!_[_0x3e5b('0xf')](_0xeeaabc['data5'])){if(_0xeeaabc['data5']=='1')_0x560010=!![];}if(!_0x560010){if(_0x522e9e['xmd-contactid']){_0x468305['id']=_0x522e9e[_0x3e5b('0x10')];}}if(!_0x468305['id']){_0x468305[_0x3e5b('0x11')]=_0x382273;_0x405e70=_0xeeaabc[_0x3e5b('0x12')]&&_0xeeaabc['data3']!=='0'?_0xeeaabc[_0x3e5b('0x12')]['split'](','):['phone'];_0x468305[_0x3e5b('0x13')]=_[_0x3e5b('0x14')](_0x405e70,function(_0x5e2f83){var _0x3d58a4={};_0x3d58a4[_0x5e2f83]=_0x522e9e[_0x3e5b('0x15')]?_0x522e9e['destcalleridnum']:_0x522e9e[_0x3e5b('0x16')];return _0x3d58a4;});}var _0x3365dd=['id','firstName','lastName',_0x3e5b('0x17'),_0x3e5b('0x18'),_0x3e5b('0x19'),_0x3e5b('0x11'),_0x3e5b('0x1a'),_0x3e5b('0x1b'),_0x3e5b('0x1c')];var _0x21fc32=_[_0x3e5b('0x1d')](_0x3365dd,_0x405e70);BPromise[_0x3e5b('0x1e')]()[_0x3e5b('0x1f')](cmContactRpc[_0x3e5b('0x20')]({'attributes':_0x21fc32,'where':_0x468305}))[_0x3e5b('0x1f')](function(_0x402873){_0x52efbd=_0x402873;if(!_['isEmpty'](_0x52efbd)){if(_0x52efbd[_0x3e5b('0x21')]===0x1){_0x3be027=_0x52efbd[0x0];logger[_0x3e5b('0xa')](_0x3e5b('0x22'),_0x522e9e[_0x3e5b('0x23')],_0x17dee7['id'],_0x3be027['id']);}else{logger['info'](_0x3e5b('0x24'),_0x522e9e['uniqueid'],_0x17dee7['id'],_[_0x3e5b('0x14')](_0x52efbd,'id')[_0x3e5b('0x25')](','));}return;}else{logger['info'](_0x3e5b('0x26'),_0x522e9e[_0x3e5b('0x23')],_0x17dee7['id']);var _0x42d7e9={'ListId':_0x382273};var _0x3c8965=_0xeeaabc[_0x3e5b('0x27')]&&_0xeeaabc[_0x3e5b('0x27')]!=='0'?_0xeeaabc[_0x3e5b('0x27')]:_0x3e5b('0x17');if(_0x374068){logger['info'](_0x3e5b('0x28'),_0x522e9e['uniqueid'],_0x17dee7['id']);_0x42d7e9[_0x3c8965]=_[_0x3e5b('0xf')](_0x522e9e['routeId'])?_0x522e9e[_0x3e5b('0x16')]:_0x522e9e[_0x3e5b('0x29')];if(_[_0x3e5b('0xf')](_0x522e9e[_0x3e5b('0x15')])){_0x42d7e9[_0x3e5b('0x2a')]=_0x522e9e[_0x3e5b('0x2b')]&&_0x522e9e[_0x3e5b('0x2b')]!==_0x3e5b('0x2c')?_0x522e9e[_0x3e5b('0x2b')]:_0x3e5b('0x2d');}else{_0x42d7e9[_0x3e5b('0x2a')]=_0x522e9e['destcalleridname']&&_0x522e9e[_0x3e5b('0x2e')]!==_0x3e5b('0x2c')?_0x522e9e[_0x3e5b('0x2e')]:_0x3e5b('0x2d');}return BPromise[_0x3e5b('0x1e')]()[_0x3e5b('0x1f')](cmContactRpc[_0x3e5b('0x2f')](_0x42d7e9))['then'](function(_0x33f089){_0x3be027=_0x33f089;_0x52efbd['push'](_0x33f089);if(_0x3be027){logger['info'](_0x3e5b('0x30'),_0x522e9e[_0x3e5b('0x23')],_0x17dee7['id'],_0x3be027['id']);}return;});}else{logger['info'](_0x3e5b('0x31'),_0x522e9e[_0x3e5b('0x23')],_0x17dee7['id']);_0x42d7e9[_0x3c8965]=_[_0x3e5b('0xf')](_0x522e9e[_0x3e5b('0x15')])?_0x522e9e[_0x3e5b('0x16')]:_0x522e9e[_0x3e5b('0x29')];if(_[_0x3e5b('0xf')](_0x522e9e[_0x3e5b('0x15')])){_0x42d7e9[_0x3e5b('0x2a')]=_0x522e9e[_0x3e5b('0x2b')]&&_0x522e9e[_0x3e5b('0x2b')]!==_0x3e5b('0x2c')?_0x522e9e['calleridname']:_0x3e5b('0x2d');}else{_0x42d7e9[_0x3e5b('0x2a')]=_0x522e9e['destcalleridname']&&_0x522e9e['destcalleridname']!==_0x3e5b('0x2c')?_0x522e9e['destcalleridname']:_0x3e5b('0x2d');}_0x3be027=_0x42d7e9;_0x52efbd[_0x3e5b('0x32')](_0x42d7e9);return;}}})[_0x3e5b('0x1f')](function(){if(_0x22fc1a){emit(_0x522e9e[_0x3e5b('0x23')],_0x17dee7,util['format'](_0x3e5b('0x33'),_0x22fc1a['name']),util[_0x3e5b('0x34')]('trigger:%s',_0xeeaabc['action']['toLowerCase']()),{'evt':_[_0x3e5b('0x35')](_0x522e9e,{'autoCreate':_0x374068}),'contact':_0x3be027===undefined?{}:_0x3be027,'contacts':_0x52efbd[_0x3e5b('0x21')]===0x0?undefined:_0x52efbd});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index f3a404e..15d2712 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f66=['membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','prototype','info','stringify','clone','undefined','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','motionbar','data1','html','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','merge','jscripty','emit','name','trigger:%s','contactmanager','exec','integration','routeId','script','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue'];(function(_0x2e39bb,_0x11bfba){var _0x3d4e71=function(_0x3bfc02){while(--_0x3bfc02){_0x2e39bb['push'](_0x2e39bb['shift']());}};_0x3d4e71(++_0x11bfba);}(_0x8f66,0x180));var _0x68f6=function(_0x52a01f,_0x476c6a){_0x52a01f=_0x52a01f-0x0;var _0x37748f=_0x8f66[_0x52a01f];return _0x37748f;};'use strict';var util=require(_0x68f6('0x0'));var _=require(_0x68f6('0x1'));var url=require(_0x68f6('0x2'));var Mustache=require(_0x68f6('0x3'));var Redis=require(_0x68f6('0x4'));var urlforward=require(_0x68f6('0x5'));var integration=require(_0x68f6('0x6'));var cmContact=require(_0x68f6('0x7'));var script=require(_0x68f6('0x8'));var config=require('../../../config/environment');var logger=require(_0x68f6('0x9'))(_0x68f6('0xa'));var ami=require(_0x68f6('0xb'));config[_0x68f6('0xc')]=_[_0x68f6('0xd')](config['redis'],{'host':_0x68f6('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x2354b2,_0x17160d){return _0x2354b2==_0x17160d;},'not_equals':function(_0x32a6db,_0x5520b9){return _0x32a6db!=_0x5520b9;}};var barAndWebActions=[_0x68f6('0xf'),'url','winapp'];function Trigger(_0x5b344f){this[_0x68f6('0x10')]=_0x5b344f['triggers'];this[_0x68f6('0x11')]=_0x5b344f['agents'];this[_0x68f6('0x12')]=_0x5b344f[_0x68f6('0x12')];this[_0x68f6('0x13')]=_0x5b344f['templates'];this[_0x68f6('0x14')]=_0x5b344f[_0x68f6('0x14')];this[_0x68f6('0x15')]=_0x5b344f[_0x68f6('0x15')];this[_0x68f6('0x16')]=_0x5b344f['freshdeskAccounts'];this[_0x68f6('0x17')]=_0x5b344f['salesforceAccounts'];this[_0x68f6('0x18')]=_0x5b344f[_0x68f6('0x18')];this['zohoAccounts']=_0x5b344f['zohoAccounts'];this[_0x68f6('0x19')]=_0x5b344f[_0x68f6('0x19')];this[_0x68f6('0x1a')]=_0x5b344f[_0x68f6('0x1a')];this[_0x68f6('0x1b')]=_0x5b344f['servicenowAccounts'];this['dynamics365Accounts']=_0x5b344f[_0x68f6('0x1c')];this[_0x68f6('0x1d')]=_0x5b344f[_0x68f6('0x1d')];this[_0x68f6('0x1e')]={'zendesk':this[_0x68f6('0x15')],'salesforce':this[_0x68f6('0x17')],'freshdesk':this[_0x68f6('0x16')],'sugarcrm':this[_0x68f6('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0x68f6('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x68f6('0x1c')],'freshsales':this[_0x68f6('0x1d')],'servicenow':this['servicenowAccounts']};ami['on'](_0x68f6('0x1f'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x22'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x23'),this[_0x68f6('0x20')]['bind'](this));ami['on'](_0x68f6('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x68f6('0x25'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on']('custom:agentnoanswer',this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x26'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x27'),this['syncCustomEvent'][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x28'),this['syncCustomEvent'][_0x68f6('0x21')](this));ami['on']('custom:amd',this[_0x68f6('0x20')]['bind'](this));ami['on'](_0x68f6('0x29'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x2a'),this['syncCustomEvent'][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x2b'),this[_0x68f6('0x2c')]['bind'](this));ami['on']('custom:dialconnect',this[_0x68f6('0x2c')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x2d'),this[_0x68f6('0x2c')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x2e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x68f6('0x2f'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x30'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on']('custom:outgoingmessage',this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on'](_0x68f6('0x31'),this[_0x68f6('0x20')][_0x68f6('0x21')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent']['bind'](this));}Trigger[_0x68f6('0x32')]['emit']=function(_0xfcbde3,_0x1e1443,_0x289d95){logger[_0x68f6('0x33')](_0xfcbde3,_0x1e1443,JSON[_0x68f6('0x34')](_0x289d95));io['to'](_0xfcbde3)['emit'](_0x1e1443,_0x289d95);};Trigger['prototype']['syncCustomEvent']=function(_0x4d3d6f){var _0x58b4cd=_[_0x68f6('0x35')](_0x4d3d6f);if(typeof _0x58b4cd['motionChannel']===_0x68f6('0x36')){_0x58b4cd[_0x68f6('0x37')]='voice';}this[_0x68f6('0x38')](_0x58b4cd);};Trigger[_0x68f6('0x32')]['syncAgentDial']=function(_0x42e376){if(this['agents'][_0x42e376[_0x68f6('0x39')]]){this[_0x68f6('0x20')](_0x42e376);}};Trigger[_0x68f6('0x32')][_0x68f6('0x38')]=function(_0x238677){var _0xcbbda3;for(var _0x18be9a in this[_0x68f6('0x10')]){if(this[_0x68f6('0x10')][_0x68f6('0x3a')](_0x18be9a)){if(this[_0x68f6('0x10')][_0x18be9a][_0x68f6('0x3b')]){_0xcbbda3=this[_0x68f6('0x3c')](this[_0x68f6('0x10')][_0x18be9a],_0x238677);if(_0xcbbda3){_['merge'](_0x238677,_0x238677[_0x68f6('0x3d')]);for(var _0x1731a9=0x0,_0x4836c1,_0x30b90f,_0x4eeb87;_0x1731a90x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x354c16,_0x134509){_0x354c16=_0x354c16-0x0;var _0x2113a5=_0xe14b[_0x354c16];return _0x2113a5;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 9d86df9..40857b5 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe953=['value','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','calleridnum','/systemusers(','Bearer\x20','odata-entityid','substring','lastIndexOf','enduserId','message','toLowerCase','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','nothing','forEach','includes','string','picklist','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','remoteUri','username','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0'];(function(_0xe406e8,_0x2dbfd8){var _0x3f8fbe=function(_0x967a30){while(--_0x967a30){_0xe406e8['push'](_0xe406e8['shift']());}};_0x3f8fbe(++_0x2dbfd8);}(_0xe953,0x174));var _0x3e95=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xe953[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x3e95('0x0'));var BPromise=require(_0x3e95('0x1'));var rp=require(_0x3e95('0x2'));var util=require('util');var intUtil=require(_0x3e95('0x3'));var md5=require(_0x3e95('0x4'));var Redis=require(_0x3e95('0x5'));var logger=require('../../../../config/logger')(_0x3e95('0x6'));var config=require(_0x3e95('0x7'));config[_0x3e95('0x8')]=_[_0x3e95('0x9')](config[_0x3e95('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3e95('0xa'))(new Redis(config[_0x3e95('0x8')]));function getAuthToken(_0x5de875,_0x272edc,_0xd47b8b){var _0x14fb52={'method':_0x3e95('0xb'),'uri':_0x272edc,'form':{'client_id':_0x5de875['clientId'],'resource':_0x5de875[_0x3e95('0xc')],'username':_0x5de875[_0x3e95('0xd')],'password':_0x5de875[_0x3e95('0xe')],'grant_type':_0x3e95('0xe'),'client_secret':_0x5de875[_0x3e95('0xf')]},'json':!![]};return rp(_0x14fb52)['then'](function(_0x38ea85){return _0x38ea85[_0x3e95('0x10')];})[_0x3e95('0x11')](function(_0x28d645){logger['error']('['+[_0xd47b8b[_0x3e95('0x12')]()]+_0x3e95('0x13'));return _0x28d645['message'];});}function getUser(_0x386a39,_0x383bff,_0x29707a,_0x3e05a8,_0x271bab,_0x205a23){return new BPromise(function(_0xbdaa18,_0x2ae9dd){return getAuthToken(_0x383bff,_0x3e05a8,_0x205a23)[_0x3e95('0x14')](function(_0x444f5b){var _0x3f2535={'method':_0x3e95('0x15'),'uri':_0x271bab+_0x3e95('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x444f5b,'OData-Version':_0x3e95('0x17')},'json':!![]};return rp(_0x3f2535);})[_0x3e95('0x14')](function(_0x36f409){var _0x3b4142=_0x36f409[_0x3e95('0x18')];var _0x3e1a39=![];var _0x29a722=null;if(!_['isNil'](_0x29707a)){if(intUtil[_0x3e95('0x19')](_0x29707a[_0x3e95('0x1a')])){_0x386a39['userEmail']=_0x29707a[_0x3e95('0x1a')];for(_0x29a722=0x0;_0x29a722<_0x3b4142[_0x3e95('0x1b')];_0x29a722++){if(_0x3b4142[_0x29a722][_0x3e95('0x1c')]===_0x29707a[_0x3e95('0x1a')]&&!_0x3b4142[_0x29a722][_0x3e95('0x1d')]){_0x3e1a39=!![];logger[_0x3e95('0x1e')]('['+[_0x205a23[_0x3e95('0x12')]()]+_0x3e95('0x1f')+_0x3b4142[_0x29a722][_0x3e95('0x20')]+'!');_0x386a39[_0x3e95('0x21')]=_0x3b4142[_0x29a722][_0x3e95('0x20')];}}}}if(!_0x3e1a39){logger[_0x3e95('0x1e')]('['+[_0x205a23[_0x3e95('0x12')]()]+_0x3e95('0x22'));_0x386a39[_0x3e95('0x23')]=_0x383bff[_0x3e95('0xd')];for(_0x29a722=0x0;_0x29a722<_0x3b4142[_0x3e95('0x1b')];_0x29a722++){if(_0x3b4142[_0x29a722][_0x3e95('0x1c')]===_0x383bff[_0x3e95('0xd')]){_0x386a39['userId']=_0x3b4142[_0x29a722][_0x3e95('0x20')];}}}_0xbdaa18(_0x386a39);})[_0x3e95('0x11')](function(_0x3cd4b3){_0x2ae9dd(_0x3cd4b3['message']);});});}function createEndUser(_0x4d6c41,_0x565217,_0x57d4f4,_0x5ca464,_0x40ea72,_0xe46189){return new BPromise(function(_0x5a5ec0,_0x3a7940){return getAuthToken(_0x565217,_0x57d4f4,_0xe46189)[_0x3e95('0x14')](function(_0x11e690){var _0x1ed837=_0xe46189['toLowerCase']()===_0x3e95('0x24')?_0x40ea72['destcalleridnum']:_0x40ea72[_0x3e95('0x25')];var _0x476686={'method':_0x3e95('0xb'),'uri':_0x5ca464+'contacts','body':{'telephone1':_0x1ed837,'fullname':_0x1ed837,'firstname':_0x1ed837,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3e95('0x26')+_0x4d6c41[_0x3e95('0x21')]+')'},'headers':{'Authorization':_0x3e95('0x27')+_0x11e690,'OData-Version':_0x3e95('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x476686);})['then'](function(_0x1804be){var _0x52cbd4=_0x1804be['headers'][_0x3e95('0x28')];var _0x20b239=_0x52cbd4[_0x3e95('0x29')](_0x52cbd4['lastIndexOf']('(')+0x1,_0x52cbd4[_0x3e95('0x2a')](')'));_0x4d6c41[_0x3e95('0x2b')]=_0x20b239;_0x5a5ec0(_0x4d6c41);})[_0x3e95('0x11')](function(_0x31ba28){_0x3a7940(_0x31ba28[_0x3e95('0x2c')]);});});}function getEndUser(_0x5b6703,_0x4cc5e8,_0x4b2e95,_0x208267,_0x14ce44,_0x161b89,_0x3c9064){var _0x4f1693=_0x161b89[_0x3e95('0x2d')]()===_0x3e95('0x24')?_0x14ce44[_0x3e95('0x2e')]:_0x14ce44[_0x3e95('0x25')];return getAuthToken(_0x4cc5e8,_0x4b2e95,_0x161b89)[_0x3e95('0x14')](function(_0x54b0db){var _0x3851e5={'method':_0x3e95('0x15'),'uri':_0x208267+_0x3e95('0x2f')+_0x4f1693['replace']('+',_0x3e95('0x30'))+'\x27','headers':{'Authorization':_0x3e95('0x27')+_0x54b0db,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3851e5);})[_0x3e95('0x14')](function(_0x36ba8f){var _0x543aa5=![];if(!_0x36ba8f)return _0x543aa5;var _0x167f77=_0x36ba8f['value'];for(var _0x538652=0x0;_0x538652<_0x167f77[_0x3e95('0x1b')];_0x538652++){if(_0x167f77[_0x538652][_0x3e95('0x31')]===_0x4f1693){_0x543aa5=!![];_0x5b6703[_0x3e95('0x2b')]=_0x167f77[_0x538652][_0x3e95('0x32')];}}return _0x543aa5;})[_0x3e95('0x14')](function(_0x1c1327){if(_0x1c1327)return _0x5b6703;if(_0x3c9064===_0x3e95('0x33')){logger[_0x3e95('0x1e')]('['+[_0x161b89[_0x3e95('0x12')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5b6703;}return createEndUser(_0x5b6703,_0x4cc5e8,_0x4b2e95,_0x208267,_0x14ce44,_0x161b89)[_0x3e95('0x14')](function(_0x4342bc){logger[_0x3e95('0x1e')]('['+[_0x161b89[_0x3e95('0x12')]()]+']\x20Enduser\x20created!',_0x4342bc[_0x3e95('0x2b')]);return _0x4342bc;});});}function getCustomFields(_0x4865cf,_0x3a116e,_0x48ad52){var _0x3b0d24={};if(_0x4865cf[_0x3e95('0x1b')]>0x0){_[_0x3e95('0x34')](_0x4865cf,function(_0x431cbd){if(_[_0x3e95('0x35')]([_0x3e95('0x36'),_0x3e95('0x37')],_0x431cbd[_0x3e95('0x38')])&&_0x431cbd['nameField']&&!_0x431cbd[_0x3e95('0x39')]){var _0x173107=_0x431cbd[_0x3e95('0x3a')][_0x3e95('0x2d')]();var _0x9fcb81=_0x173107[_0x3e95('0x29')](0x0,_0x173107[_0x3e95('0x3b')]('_'));var _0x40644d=_0x173107[_0x3e95('0x29')](_0x173107[_0x3e95('0x3b')]('_')+0x1);if(_0x9fcb81===_0x48ad52){_0x3b0d24[_0x40644d]=_0x431cbd[_0x3e95('0x3c')];}}});}return _0x3b0d24;}function getTicket(_0x55443c,_0x4d98de,_0x5cb0ab,_0x55f410,_0x23fa90,_0x2ccbf6,_0xaf9143){return new BPromise(function(_0x32ce79,_0x3f7785){var _0x3d84eb;return getAuthToken(_0x4d98de,_0x5cb0ab,_0xaf9143)['then'](function(_0x4e943d){if(_0x2ccbf6[_0x3e95('0x3d')]===_0x3e95('0x3e')){_0x3d84eb={'method':'POST','uri':_0x55f410+_0x3e95('0x3f'),'body':Object[_0x3e95('0x40')]({},{'title':intUtil['getString'](_0x2ccbf6[_0x3e95('0x41')],_0x23fa90,'\x20'),'description':intUtil[_0x3e95('0x42')](_0x2ccbf6['Descriptions'],_0x23fa90,'\x0a'),'customerid_contact@odata.bind':_0x55443c['enduserId']?_0x3e95('0x43')+_0x55443c['enduserId']+')':undefined,'ownerid@odata.bind':_0x3e95('0x26')+_0x55443c[_0x3e95('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x2ccbf6[_0x3e95('0x44')],_0x23fa90,_0x2ccbf6[_0x3e95('0x3d')])),'headers':{'Authorization':_0x3e95('0x27')+_0x4e943d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2ccbf6[_0x3e95('0x3d')]===_0x3e95('0x45')){var _0x16fe34=_0x55443c['enduserId']?[{'partyid_systemuser@odata.bind':_0x3e95('0x26')+_0x55443c[_0x3e95('0x21')]+')','participationtypemask':_0x55443c[_0x3e95('0x46')]===_0x3e95('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x3e95('0x43')+_0x55443c[_0x3e95('0x2b')]+')','participationtypemask':_0x55443c[_0x3e95('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3e95('0x26')+_0x55443c[_0x3e95('0x21')]+')','participationtypemask':_0x55443c[_0x3e95('0x46')]===_0x3e95('0x47')?0x2:0x1}];_0x3d84eb={'method':'POST','uri':_0x55f410+_0x3e95('0x48'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x2ccbf6['Subjects'],_0x23fa90,'\x20'),'phonenumber':String(_0x23fa90['calleridnum']),'description':intUtil['getString'](_0x2ccbf6['Descriptions'],_0x23fa90,'\x0a'),'regardingobjectid_contact@odata.bind':_0x55443c['enduserId']?_0x3e95('0x43')+_0x55443c[_0x3e95('0x2b')]+')':undefined,'ownerid@odata.bind':_0x3e95('0x26')+_0x55443c[_0x3e95('0x21')]+')','directioncode':_0x55443c['callDirection']===_0x3e95('0x47')?![]:!![],'phonecall_activity_parties':_0x16fe34},getCustomFields(_0x2ccbf6[_0x3e95('0x44')],_0x23fa90,_0x2ccbf6['ticketType'])),'headers':{'Authorization':_0x3e95('0x27')+_0x4e943d,'OData-Version':_0x3e95('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d84eb);})[_0x3e95('0x14')](function(_0xeb687e){var _0x47c48a=_0xeb687e[_0x3e95('0x49')]['odata-entityid'];var _0x15b7ae=_0x47c48a[_0x3e95('0x29')](_0x47c48a['lastIndexOf']('(')+0x1,_0x47c48a[_0x3e95('0x2a')](')'));_0x55443c['ticketId']=_0x15b7ae;_0x32ce79(_0x55443c);})[_0x3e95('0x11')](function(_0x4cb7ae){_0x3f7785(_0x4cb7ae[_0x3e95('0x2c')]);});});}function emit(_0x65357d,_0x18e28d,_0x17ddcd,_0x2b4f9a){var _0x46ec1b={'uri':util[_0x3e95('0x4a')](_0x3e95('0x4b'),_0x65357d,_0x17ddcd,_0x2b4f9a)};io['to'](util[_0x3e95('0x4a')]('user:%s',_0x18e28d))[_0x3e95('0x4c')]('trigger:browser:url',_0x46ec1b);}exports['cs']=function(_0x346df2,_0x1ce413,_0x330c1d,_0x9e5554,_0x180ff0,_0x2e9032,_0x24e593,_0x5c7b9a){var _0x3d3c48={};_0x2e9032[_0x3e95('0xc')]=intUtil['stripTrailingSlash'](_0x2e9032[_0x3e95('0xc')]);_0x2e9032['serverUrl']=intUtil[_0x3e95('0x4d')](_0x2e9032[_0x3e95('0x4e')]);_0x3d3c48[_0x3e95('0x46')]=_0x5c7b9a===_0x3e95('0x47')||_0x5c7b9a===_0x3e95('0x4f')?'queue':_0x3e95('0x24');var _0x93c87d=util[_0x3e95('0x4a')](_0x3e95('0x50'),_0x2e9032[_0x3e95('0xc')]);var _0x3ab694=util[_0x3e95('0x4a')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2e9032[_0x3e95('0x51')]);var _0xdc1d3c=util[_0x3e95('0x4a')](_0x3e95('0x52'),_0x2e9032['serverUrl'],_0x1ce413[_0x3e95('0x53')],md5(_0x1ce413[_0x3e95('0x53')]));if(_0x180ff0&&_0x180ff0[_0x3e95('0x54')]){logger[_0x3e95('0x1e')](_0x3e95('0x55'),_0x3e95('0x56'));_0x1ce413[_0x3e95('0x57')]=_0xdc1d3c;}else if(_0x24e593&&_0x24e593[_0x3e95('0x58')]&&_0x24e593['recordingFormat']!==_0x3e95('0x59')){logger['info'](_0x3e95('0x5a'),_0x3e95('0x56'));_0x1ce413[_0x3e95('0x57')]=_0xdc1d3c;}else{_0x1ce413[_0x3e95('0x57')]='';}return getUser(_0x3d3c48,_0x2e9032,_0x9e5554,_0x3ab694,_0x93c87d,_0x5c7b9a)[_0x3e95('0x14')](function(_0x221f61){logger['info']('['+_0x5c7b9a['toUpperCase']()+_0x3e95('0x5b'),_0x221f61[_0x3e95('0x21')]);logger[_0x3e95('0x1e')]('['+_0x5c7b9a['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x221f61['userEmail']);return getEndUser(_0x221f61,_0x2e9032,_0x3ab694,_0x93c87d,_0x1ce413,_0x5c7b9a,_0x330c1d['moduleCreate']);})[_0x3e95('0x14')](function(_0x28605a){logger[_0x3e95('0x1e')]('['+_0x5c7b9a[_0x3e95('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x28605a[_0x3e95('0x2b')]);logger[_0x3e95('0x1e')]('['+_0x5c7b9a[_0x3e95('0x12')]()+_0x3e95('0x5c'),_0x1ce413[_0x3e95('0x25')]);return getTicket(_0x28605a,_0x2e9032,_0x3ab694,_0x93c87d,_0x1ce413,_0x330c1d,_0x5c7b9a);})[_0x3e95('0x14')](function(_0x399898){logger[_0x3e95('0x1e')](util['format']('['+_0x5c7b9a['toUpperCase']()+_0x3e95('0x5d'),_0x330c1d[_0x3e95('0x3d')],_0x399898['ticketId']));logger[_0x3e95('0x1e')](util[_0x3e95('0x4a')]('['+_0x5c7b9a[_0x3e95('0x12')]()+_0x3e95('0x5e'),_0x5c7b9a));if(_0x5c7b9a!==_0x3e95('0x4f')){logger['info']('['+_0x5c7b9a['toUpperCase']()+']',_0x3e95('0x5f'));emit(_0x2e9032[_0x3e95('0xc')],_0x9e5554[_0x3e95('0x60')],_0x330c1d[_0x3e95('0x3d')],_0x399898['ticketId']);}})[_0x3e95('0x11')](function(_0x1353d2){logger['error']('['+_0x5c7b9a['toUpperCase']()+_0x3e95('0x61'),util[_0x3e95('0x62')](_0x1353d2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe4f3=[']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name','error','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1','contactid','nothing',']\x20Enduser\x20created!','type','customField','idField','indexOf','ticketType','incidents','getString','Subjects','/contacts(','phonecall','callDirection','queue','phonecalls','assign','Descriptions','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!'];(function(_0x2bcdf4,_0x1a2f20){var _0x4a0f7a=function(_0x1e924f){while(--_0x1e924f){_0x2bcdf4['push'](_0x2bcdf4['shift']());}};_0x4a0f7a(++_0x1a2f20);}(_0xe4f3,0x64));var _0x3e4f=function(_0x182ed7,_0x28b7e1){_0x182ed7=_0x182ed7-0x0;var _0x53fb1f=_0xe4f3[_0x182ed7];return _0x53fb1f;};'use strict';var _=require(_0x3e4f('0x0'));var BPromise=require(_0x3e4f('0x1'));var rp=require(_0x3e4f('0x2'));var util=require(_0x3e4f('0x3'));var intUtil=require(_0x3e4f('0x4'));var md5=require(_0x3e4f('0x5'));var Redis=require(_0x3e4f('0x6'));var logger=require(_0x3e4f('0x7'))(_0x3e4f('0x8'));var config=require('../../../../config/environment');config[_0x3e4f('0x9')]=_[_0x3e4f('0xa')](config['redis'],{'host':_0x3e4f('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3e4f('0x9')]));function getAuthToken(_0x552aa7,_0x44af42,_0x9241c8){var _0x450b5a={'method':_0x3e4f('0xc'),'uri':_0x44af42,'form':{'client_id':_0x552aa7[_0x3e4f('0xd')],'resource':_0x552aa7[_0x3e4f('0xe')],'username':_0x552aa7[_0x3e4f('0xf')],'password':_0x552aa7[_0x3e4f('0x10')],'grant_type':_0x3e4f('0x10'),'client_secret':_0x552aa7[_0x3e4f('0x11')]},'json':!![]};return rp(_0x450b5a)[_0x3e4f('0x12')](function(_0x5fd73d){return _0x5fd73d[_0x3e4f('0x13')];})[_0x3e4f('0x14')](function(_0x47d0d7){logger['error']('['+[_0x9241c8[_0x3e4f('0x15')]()]+_0x3e4f('0x16'));return _0x47d0d7[_0x3e4f('0x17')];});}function getUser(_0x46c726,_0x31fcee,_0x161936,_0x5aae47,_0x1a5081,_0xf7d7f4){return new BPromise(function(_0x3e82dd,_0x29d689){return getAuthToken(_0x31fcee,_0x5aae47,_0xf7d7f4)[_0x3e4f('0x12')](function(_0x449ad9){var _0x4c7b28={'method':_0x3e4f('0x18'),'uri':_0x1a5081+_0x3e4f('0x19'),'headers':{'Authorization':_0x3e4f('0x1a')+_0x449ad9,'OData-Version':_0x3e4f('0x1b')},'json':!![]};return rp(_0x4c7b28);})[_0x3e4f('0x12')](function(_0x3d4fa0){var _0x555f53=_0x3d4fa0['value'];var _0x2539ef=![];var _0x139932=null;if(!_['isNil'](_0x161936)){if(intUtil[_0x3e4f('0x1c')](_0x161936[_0x3e4f('0x1d')])){_0x46c726[_0x3e4f('0x1e')]=_0x161936[_0x3e4f('0x1d')];for(_0x139932=0x0;_0x139932<_0x555f53[_0x3e4f('0x1f')];_0x139932++){if(_0x555f53[_0x139932][_0x3e4f('0x20')]===_0x161936[_0x3e4f('0x1d')]&&!_0x555f53[_0x139932][_0x3e4f('0x21')]){_0x2539ef=!![];logger[_0x3e4f('0x22')]('['+[_0xf7d7f4[_0x3e4f('0x15')]()]+']\x20Agent\x20found\x20'+_0x555f53[_0x139932][_0x3e4f('0x23')]+'!');_0x46c726[_0x3e4f('0x24')]=_0x555f53[_0x139932]['systemuserid'];}}}}if(!_0x2539ef){logger['info']('['+[_0xf7d7f4[_0x3e4f('0x15')]()]+_0x3e4f('0x25'));_0x46c726['userEmail']=_0x31fcee[_0x3e4f('0xf')];for(_0x139932=0x0;_0x139932<_0x555f53[_0x3e4f('0x1f')];_0x139932++){if(_0x555f53[_0x139932][_0x3e4f('0x20')]===_0x31fcee[_0x3e4f('0xf')]){_0x46c726[_0x3e4f('0x24')]=_0x555f53[_0x139932][_0x3e4f('0x23')];}}}_0x3e82dd(_0x46c726);})[_0x3e4f('0x14')](function(_0xfae6d2){_0x29d689(_0xfae6d2['message']);});});}function createEndUser(_0x192c1d,_0x20e284,_0x5598d5,_0x3458e5,_0x263a10,_0x225407){return new BPromise(function(_0x446f70,_0x4985ff){return getAuthToken(_0x20e284,_0x5598d5,_0x225407)[_0x3e4f('0x12')](function(_0x4e005a){var _0x1e566b=_0x225407[_0x3e4f('0x26')]()===_0x3e4f('0x27')?_0x263a10[_0x3e4f('0x28')]:_0x263a10[_0x3e4f('0x29')];var _0x235786={'method':'POST','uri':_0x3458e5+_0x3e4f('0x2a'),'body':{'telephone1':_0x1e566b,'fullname':_0x1e566b,'firstname':_0x1e566b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3e4f('0x2b')+_0x192c1d['userId']+')'},'headers':{'Authorization':_0x3e4f('0x1a')+_0x4e005a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x235786);})[_0x3e4f('0x12')](function(_0x17ace2){var _0x1aa06d=_0x17ace2[_0x3e4f('0x2c')][_0x3e4f('0x2d')];var _0x4babc6=_0x1aa06d[_0x3e4f('0x2e')](_0x1aa06d['lastIndexOf']('(')+0x1,_0x1aa06d[_0x3e4f('0x2f')](')'));_0x192c1d[_0x3e4f('0x30')]=_0x4babc6;_0x446f70(_0x192c1d);})['catch'](function(_0x1c8c1d){_0x4985ff(_0x1c8c1d[_0x3e4f('0x17')]);});});}function getEndUser(_0x4469d8,_0x2541c7,_0xe95fae,_0x38e858,_0x2b9619,_0x2f9e4a,_0x2a6171){var _0x50f4f1=_0x2f9e4a[_0x3e4f('0x26')]()==='outbound'?_0x2b9619[_0x3e4f('0x28')]:_0x2b9619[_0x3e4f('0x29')];return getAuthToken(_0x2541c7,_0xe95fae,_0x2f9e4a)[_0x3e4f('0x12')](function(_0x24ffce){var _0x5b3326={'method':_0x3e4f('0x18'),'uri':_0x38e858+_0x3e4f('0x31')+_0x50f4f1[_0x3e4f('0x32')]('+','%2b')+'\x27','headers':{'Authorization':_0x3e4f('0x1a')+_0x24ffce,'If-None-Match':null,'OData-Version':_0x3e4f('0x1b')},'json':!![]};return rp(_0x5b3326);})[_0x3e4f('0x12')](function(_0x224868){var _0x117d05=![];if(!_0x224868)return _0x117d05;var _0x2b415d=_0x224868[_0x3e4f('0x33')];for(var _0x5ef2e2=0x0;_0x5ef2e2<_0x2b415d[_0x3e4f('0x1f')];_0x5ef2e2++){if(_0x2b415d[_0x5ef2e2][_0x3e4f('0x34')]===_0x50f4f1){_0x117d05=!![];_0x4469d8['enduserId']=_0x2b415d[_0x5ef2e2][_0x3e4f('0x35')];}}return _0x117d05;})[_0x3e4f('0x12')](function(_0x4aef33){if(_0x4aef33)return _0x4469d8;if(_0x2a6171===_0x3e4f('0x36')){logger[_0x3e4f('0x22')]('['+[_0x2f9e4a[_0x3e4f('0x15')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x4469d8;}return createEndUser(_0x4469d8,_0x2541c7,_0xe95fae,_0x38e858,_0x2b9619,_0x2f9e4a)[_0x3e4f('0x12')](function(_0x37efb4){logger[_0x3e4f('0x22')]('['+[_0x2f9e4a['toUpperCase']()]+_0x3e4f('0x37'),_0x37efb4[_0x3e4f('0x30')]);return _0x37efb4;});});}function getCustomFields(_0x8c3d2d,_0x4b1812,_0xac3e7c){var _0x42337a={};if(_0x8c3d2d['length']>0x0){_['forEach'](_0x8c3d2d,function(_0x3c7dfe){if(_['includes'](['string','picklist'],_0x3c7dfe[_0x3e4f('0x38')])&&_0x3c7dfe['nameField']&&!_0x3c7dfe[_0x3e4f('0x39')]){var _0x121d5f=_0x3c7dfe[_0x3e4f('0x3a')][_0x3e4f('0x26')]();var _0x391c63=_0x121d5f[_0x3e4f('0x2e')](0x0,_0x121d5f[_0x3e4f('0x3b')]('_'));var _0x1b1ca8=_0x121d5f[_0x3e4f('0x2e')](_0x121d5f[_0x3e4f('0x3b')]('_')+0x1);if(_0x391c63===_0xac3e7c){_0x42337a[_0x1b1ca8]=_0x3c7dfe['content'];}}});}return _0x42337a;}function getTicket(_0x2468d6,_0x1d0561,_0x5b05a5,_0x51a1a3,_0x4ef8f4,_0x3300a2,_0x22529e){return new BPromise(function(_0x1d3f8f,_0x4ae775){var _0x241487;return getAuthToken(_0x1d0561,_0x5b05a5,_0x22529e)['then'](function(_0x3fe51c){if(_0x3300a2[_0x3e4f('0x3c')]==='incident'){_0x241487={'method':_0x3e4f('0xc'),'uri':_0x51a1a3+_0x3e4f('0x3d'),'body':Object['assign']({},{'title':intUtil[_0x3e4f('0x3e')](_0x3300a2[_0x3e4f('0x3f')],_0x4ef8f4,'\x20'),'description':intUtil[_0x3e4f('0x3e')](_0x3300a2['Descriptions'],_0x4ef8f4,'\x0a'),'customerid_contact@odata.bind':_0x2468d6[_0x3e4f('0x30')]?_0x3e4f('0x40')+_0x2468d6['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2468d6['userId']+')','caseorigincode':'1'},getCustomFields(_0x3300a2['Fields'],_0x4ef8f4,_0x3300a2['ticketType'])),'headers':{'Authorization':_0x3e4f('0x1a')+_0x3fe51c,'OData-Version':_0x3e4f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3300a2[_0x3e4f('0x3c')]===_0x3e4f('0x41')){var _0x18d64f=_0x2468d6[_0x3e4f('0x30')]?[{'partyid_systemuser@odata.bind':_0x3e4f('0x2b')+_0x2468d6[_0x3e4f('0x24')]+')','participationtypemask':_0x2468d6[_0x3e4f('0x42')]===_0x3e4f('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x3e4f('0x40')+_0x2468d6[_0x3e4f('0x30')]+')','participationtypemask':_0x2468d6['callDirection']===_0x3e4f('0x43')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3e4f('0x2b')+_0x2468d6['userId']+')','participationtypemask':_0x2468d6['callDirection']==='queue'?0x2:0x1}];_0x241487={'method':_0x3e4f('0xc'),'uri':_0x51a1a3+_0x3e4f('0x44'),'body':Object[_0x3e4f('0x45')]({},{'subject':intUtil['getString'](_0x3300a2[_0x3e4f('0x3f')],_0x4ef8f4,'\x20'),'phonenumber':String(_0x4ef8f4['calleridnum']),'description':intUtil[_0x3e4f('0x3e')](_0x3300a2[_0x3e4f('0x46')],_0x4ef8f4,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2468d6['enduserId']?'/contacts('+_0x2468d6[_0x3e4f('0x30')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2468d6[_0x3e4f('0x24')]+')','directioncode':_0x2468d6[_0x3e4f('0x42')]===_0x3e4f('0x43')?![]:!![],'phonecall_activity_parties':_0x18d64f},getCustomFields(_0x3300a2[_0x3e4f('0x47')],_0x4ef8f4,_0x3300a2[_0x3e4f('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x3fe51c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x241487);})[_0x3e4f('0x12')](function(_0xd2d2f){var _0x43d016=_0xd2d2f[_0x3e4f('0x2c')]['odata-entityid'];var _0x492a75=_0x43d016[_0x3e4f('0x2e')](_0x43d016['lastIndexOf']('(')+0x1,_0x43d016[_0x3e4f('0x2f')](')'));_0x2468d6[_0x3e4f('0x48')]=_0x492a75;_0x1d3f8f(_0x2468d6);})[_0x3e4f('0x14')](function(_0x4c6e55){_0x4ae775(_0x4c6e55[_0x3e4f('0x17')]);});});}function emit(_0x3cefb7,_0x130764,_0x2951ff,_0xbe3770){var _0x557c66={'uri':util[_0x3e4f('0x49')](_0x3e4f('0x4a'),_0x3cefb7,_0x2951ff,_0xbe3770)};io['to'](util[_0x3e4f('0x49')]('user:%s',_0x130764))['emit'](_0x3e4f('0x4b'),_0x557c66);}exports['cs']=function(_0x39c76b,_0x9baf17,_0x494379,_0x356f94,_0x58e72b,_0x559ec9,_0x3e6644,_0x125c26){var _0x4252c2={};_0x559ec9[_0x3e4f('0xe')]=intUtil['stripTrailingSlash'](_0x559ec9[_0x3e4f('0xe')]);_0x559ec9['serverUrl']=intUtil[_0x3e4f('0x4c')](_0x559ec9[_0x3e4f('0x4d')]);_0x4252c2[_0x3e4f('0x42')]=_0x125c26===_0x3e4f('0x43')||_0x125c26===_0x3e4f('0x4e')?'queue':_0x3e4f('0x27');var _0x4e02b7=util[_0x3e4f('0x49')](_0x3e4f('0x4f'),_0x559ec9['remoteUri']);var _0x5a29aa=util[_0x3e4f('0x49')](_0x3e4f('0x50'),_0x559ec9['tenantId']);var _0x46e498=util[_0x3e4f('0x49')](_0x3e4f('0x51'),_0x559ec9[_0x3e4f('0x4d')],_0x9baf17[_0x3e4f('0x52')],md5(_0x9baf17['uniqueid']));if(_0x58e72b&&_0x58e72b['monitor_format']){logger[_0x3e4f('0x22')](_0x3e4f('0x53'),'Recording\x20is\x20enabled!');_0x9baf17[_0x3e4f('0x54')]=_0x46e498;}else if(_0x3e6644&&_0x3e6644[_0x3e4f('0x55')]&&_0x3e6644[_0x3e4f('0x55')]!=='none'){logger[_0x3e4f('0x22')](_0x3e4f('0x56'),_0x3e4f('0x57'));_0x9baf17[_0x3e4f('0x54')]=_0x46e498;}else{_0x9baf17[_0x3e4f('0x54')]='';}return getUser(_0x4252c2,_0x559ec9,_0x356f94,_0x5a29aa,_0x4e02b7,_0x125c26)[_0x3e4f('0x12')](function(_0x3e84b7){logger['info']('['+_0x125c26[_0x3e4f('0x15')]()+']\x20The\x20User\x20ID\x20is:',_0x3e84b7[_0x3e4f('0x24')]);logger[_0x3e4f('0x22')]('['+_0x125c26['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x3e84b7['userEmail']);return getEndUser(_0x3e84b7,_0x559ec9,_0x5a29aa,_0x4e02b7,_0x9baf17,_0x125c26,_0x494379['moduleCreate']);})['then'](function(_0x3455c6){logger[_0x3e4f('0x22')]('['+_0x125c26[_0x3e4f('0x15')]()+_0x3e4f('0x58'),_0x3455c6[_0x3e4f('0x30')]);logger['info']('['+_0x125c26[_0x3e4f('0x15')]()+_0x3e4f('0x59'),_0x9baf17['calleridnum']);return getTicket(_0x3455c6,_0x559ec9,_0x5a29aa,_0x4e02b7,_0x9baf17,_0x494379,_0x125c26);})[_0x3e4f('0x12')](function(_0x248fd8){logger[_0x3e4f('0x22')](util['format']('['+_0x125c26[_0x3e4f('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x494379[_0x3e4f('0x3c')],_0x248fd8['ticketId']));logger[_0x3e4f('0x22')](util[_0x3e4f('0x49')]('['+_0x125c26[_0x3e4f('0x15')]()+_0x3e4f('0x5a'),_0x125c26));if(_0x125c26!=='unmanaged'){logger[_0x3e4f('0x22')]('['+_0x125c26['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x559ec9[_0x3e4f('0xe')],_0x356f94[_0x3e4f('0x5b')],_0x494379[_0x3e4f('0x3c')],_0x248fd8['ticketId']);}})[_0x3e4f('0x14')](function(_0x3dd854){logger[_0x3e4f('0x5c')]('['+_0x125c26[_0x3e4f('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x3e4f('0x5d')](_0x3dd854,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 84b0800..479f39f 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x499c=['contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','toString','debug','[HTTP]','GET','map','length','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','find'];(function(_0x43528e,_0x5dccd3){var _0x273515=function(_0x237378){while(--_0x237378){_0x43528e['push'](_0x43528e['shift']());}};_0x273515(++_0x5dccd3);}(_0x499c,0x9f));var _0xc499=function(_0x110cf1,_0x13f68d){_0x110cf1=_0x110cf1-0x0;var _0x4b3d2a=_0x499c[_0x110cf1];return _0x4b3d2a;};'use strict';var _=require(_0xc499('0x0'));var rp=require(_0xc499('0x1'));var md5=require(_0xc499('0x2'));var util=require(_0xc499('0x3'));var Redis=require(_0xc499('0x4'));var intUtil=require(_0xc499('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc499('0x6'))(_0xc499('0x7'));config[_0xc499('0x8')]=_['defaults'](config[_0xc499('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc499('0x9'))(new Redis(config[_0xc499('0x8')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x2c25ac,_0x8173e0,_0x3520a4){io['to'](_0x2c25ac)[_0xc499('0xa')](_0x8173e0,_0x3520a4);}function getTicket(_0x1e00f6,_0x27e728,_0x2fa7a6,_0x1f33ac,_0x421475){logger[_0xc499('0xb')](_0xc499('0xc'));var _0x5d045e=_['merge']({'responder_id':_0x27e728['id'],'requester_id':_0x2fa7a6['id'],'name':util[_0xc499('0xd')](_0xc499('0xe'),_0x421475['calleridname']),'phone':_0x421475[_0xc499('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc499('0x10')](_0x1f33ac[_0xc499('0x11')],_0x421475,'\x20'),'description':intUtil[_0xc499('0x10')](_0x1f33ac['Descriptions'],_0x421475,_0xc499('0x12')),'tags':getTags(_0x1f33ac[_0xc499('0x13')],_0xc499('0x14'))},getCustomFields(_0x1f33ac[_0xc499('0x15')],_0x421475));_0x5d045e[_0xc499('0x16')]=_[_0xc499('0x17')](_[_0xc499('0x18')](_0x5d045e['custom_fields'],'id'),_0xc499('0x19'));return request({'uri':util[_0xc499('0xd')](_0xc499('0x1a'),_0x1e00f6[_0xc499('0x1b')]),'method':'POST','body':_0x5d045e})[_0xc499('0x1c')](function(_0x2741c7){logger[_0xc499('0xb')](_0xc499('0x1d'));return _0x2741c7;});}function getUser(_0x26b10b,_0x2e8154){if(intUtil['validateEmail'](_0x2e8154)){return request({'uri':util[_0xc499('0xd')](_0xc499('0x1e'),_0x26b10b[_0xc499('0x1b')]),'qs':{'email':_0x2e8154}})['then'](function(_0x2253c9){if(_0x2253c9['length']){logger['info'](_0xc499('0x1f'));return _[_0xc499('0x20')](_0x2253c9,function(_0x966cfd){return _0x966cfd[_0xc499('0x21')][_0xc499('0x22')]===_0x2e8154;});}else{logger[_0xc499('0xb')](_0xc499('0x23'));return request({'uri':util[_0xc499('0xd')]('%s/api/v2/agents/me',_0x26b10b[_0xc499('0x1b')])})[_0xc499('0x1c')](function(_0x4469a8){logger['info']('Admin\x20account\x20selected.');return _0x4469a8;});}});}else{logger[_0xc499('0xb')](_0xc499('0x24'));return request({'uri':util[_0xc499('0xd')]('%s/api/v2/agents/me',_0x26b10b['remoteUri'])})[_0xc499('0x1c')](function(_0x598a46){logger[_0xc499('0xb')](_0xc499('0x25'));return _0x598a46;});}}function getEndUser(_0x23f3fe,_0x2cb5f3,_0xca5a8d){logger[_0xc499('0xb')](_0xc499('0x26'),_0xca5a8d);return request({'uri':util[_0xc499('0xd')](_0xc499('0x27'),_0x23f3fe[_0xc499('0x1b')]),'qs':{'phone':_0xca5a8d}})['then'](function(_0x10afe2){if(_0x10afe2['length']){logger[_0xc499('0xb')](_0xc499('0x28'));return _['find'](_0x10afe2,{'phone':_0xca5a8d});}else{logger[_0xc499('0xb')](_0xc499('0x29'));return request({'uri':util[_0xc499('0xd')](_0xc499('0x27'),_0x23f3fe[_0xc499('0x1b')]),'method':_0xc499('0x2a'),'body':{'name':_0x2cb5f3,'phone':_0xca5a8d}})['then'](function(_0x277f3a){logger[_0xc499('0xb')](_0xc499('0x2b'));return _0x277f3a;});}});}function getAuth(_0x554aca){return util['format'](_0xc499('0x2c'),new Buffer(_0x554aca['apiKey']+':X')[_0xc499('0x2d')]('base64'));}function request(_0x111fdc){logger[_0xc499('0x2e')](_0xc499('0x2f'),JSON['stringify'](_0x111fdc));return rp(_['defaults'](_0x111fdc,{'method':_0xc499('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x1ee408,_0x5633f6){var _0x13a666=[];if(_0x1ee408&&_0x1ee408['length']>0x0){_0x13a666=_[_0xc499('0x31')](_0x1ee408,_0x5633f6);}return _0x13a666;}function getCustomFields(_0x5d8395,_0x574605){var _0x1589e7=[];var _0x8273e4={'custom_fields':[]};if(_0x5d8395[_0xc499('0x32')]>0x0){_[_0xc499('0x33')](_0x5d8395,function(_0x403fe9){if(_[_0xc499('0x34')]([_0xc499('0x35'),_0xc499('0x36')],_0x403fe9[_0xc499('0x37')])&&_0x403fe9[_0xc499('0x38')]&&!_0x403fe9[_0xc499('0x39')]){_0x8273e4[_0x403fe9['nameField'][_0xc499('0x3a')]()]=_0x403fe9[_0xc499('0x3b')][_0xc499('0x2d')]();}else if(_[_0xc499('0x34')]([_0xc499('0x35'),_0xc499('0x36')],_0x403fe9[_0xc499('0x37')])&&_0x403fe9[_0xc499('0x3c')]&&_0x403fe9[_0xc499('0x39')]){_0x8273e4[_0xc499('0x16')][_0xc499('0x3d')]({'id':_0x403fe9['idField'],'value':_0x403fe9[_0xc499('0x3b')][_0xc499('0x2d')]()});}else if(_0x403fe9[_0xc499('0x37')]===_0xc499('0x3e')&&_0x403fe9[_0xc499('0x3f')]&&_0x403fe9[_0xc499('0x3c')]&&_0x403fe9['customField']){_0x574605[_0x403fe9[_0xc499('0x3f')]]&&_0x8273e4['custom_fields'][_0xc499('0x3d')]({'id':_0x403fe9['idField'],'value':_0x574605[_0x403fe9['variableName']][_0xc499('0x2d')]()});}else if(_0x403fe9[_0xc499('0x37')]===_0xc499('0x40')&&_0x403fe9[_0xc499('0x41')]&&_0x403fe9[_0xc499('0x41')][_0xc499('0x14')]&&_0x403fe9['idField']&&_0x403fe9['customField']){_0x574605[_0x403fe9[_0xc499('0x41')][_0xc499('0x14')][_0xc499('0x3a')]()]&&_0x8273e4[_0xc499('0x16')][_0xc499('0x3d')]({'id':_0x403fe9[_0xc499('0x3c')],'value':_0x574605[_0x403fe9[_0xc499('0x41')]['name'][_0xc499('0x3a')]()][_0xc499('0x2d')]()});}});}return _0x8273e4;}exports[_0xc499('0x42')]=function(_0x1df953,_0x1a7623,_0x1abcea,_0x5f011c,_0x1bb49c,_0x34066d){var _0x348aa1,_0x16862c;_0x34066d['remoteUri']=intUtil['stripTrailingSlash'](_0x34066d[_0xc499('0x1b')]);_0x34066d[_0xc499('0x43')]=intUtil[_0xc499('0x44')](_0x34066d[_0xc499('0x43')]);if(_0x1bb49c&&_0x1bb49c['monitor_format']){logger[_0xc499('0xb')](_0xc499('0x45'),_0xc499('0x46'));_0x1a7623[_0xc499('0x47')]=util[_0xc499('0xd')](_0xc499('0x48'),_0x34066d[_0xc499('0x43')],_0x1a7623[_0xc499('0x49')],md5(_0x1a7623['uniqueid']));}else{_0x1a7623[_0xc499('0x47')]='';}headers[_0xc499('0x4a')]=getAuth(_0x34066d);return getUser(_0x34066d,_0x5f011c[_0xc499('0x22')])[_0xc499('0x1c')](function(_0x50764f){_0x348aa1=_0x50764f;logger['info'](_0xc499('0x4b'),_0x348aa1['id']);return getEndUser(_0x34066d,_0x1a7623[_0xc499('0x4c')],_0x1a7623[_0xc499('0xf')]);})[_0xc499('0x1c')](function(_0xed4b9d){_0x16862c=_0xed4b9d;logger['info'](_0xc499('0x4d'),_0x16862c['id']);return getTicket(_0x34066d,_0x348aa1,_0x16862c,_0x1abcea,_0x1a7623);})['then'](function(_0x40a0b1){if(_0x40a0b1&&_0x40a0b1['id']){logger['info']('Ticket\x20created!');logger[_0xc499('0xb')](_0xc499('0x4e'),_0x40a0b1['id']);logger['info']('[QUEUE]',_0xc499('0x4f'));emit(util[_0xc499('0xd')](_0xc499('0x50'),_0x5f011c[_0xc499('0x14')]),_0xc499('0x51'),{'uri':util[_0xc499('0xd')](_0xc499('0x52'),_0x34066d[_0xc499('0x1b')],_0x40a0b1['id'])});}})[_0xc499('0x53')](function(_0x3f0056){logger[_0xc499('0x54')]('[QUEUE]',JSON[_0xc499('0x55')](_0x3f0056));});};exports[_0xc499('0x56')]=function(_0x313cfa,_0x1f68b6,_0x4d0b8b,_0x5ef643,_0x4a28c5,_0x453133,_0x6d3c1a){var _0xd7869e,_0xdeee6a;_0x453133[_0xc499('0x1b')]=intUtil['stripTrailingSlash'](_0x453133[_0xc499('0x1b')]);_0x453133[_0xc499('0x43')]=intUtil[_0xc499('0x44')](_0x453133[_0xc499('0x43')]);if(_0x6d3c1a&&_0x6d3c1a[_0xc499('0x57')]&&_0x6d3c1a[_0xc499('0x57')]!==_0xc499('0x58')){logger[_0xc499('0xb')](_0xc499('0x59'),_0xc499('0x46'));_0x1f68b6[_0xc499('0x47')]=util[_0xc499('0xd')](_0xc499('0x48'),_0x453133[_0xc499('0x43')],_0x1f68b6[_0xc499('0x49')],md5(_0x1f68b6['uniqueid']));}headers[_0xc499('0x4a')]=getAuth(_0x453133);return getUser(_0x453133,_0x5ef643[_0xc499('0x22')])[_0xc499('0x1c')](function(_0x352b9c){_0xd7869e=_0x352b9c;logger['info'](_0xc499('0x4b'),_0xd7869e['id']);return getEndUser(_0x453133,_0x1f68b6[_0xc499('0x5a')],_0x1f68b6[_0xc499('0x5b')]);})[_0xc499('0x1c')](function(_0xb34841){_0xdeee6a=_0xb34841;logger[_0xc499('0xb')](_0xc499('0x4d'),_0xdeee6a['id']);return getTicket(_0x453133,_0xd7869e,_0xdeee6a,_0x4d0b8b,_0x1f68b6);})[_0xc499('0x1c')](function(_0x396019){if(_0x396019&&_0x396019['id']){logger[_0xc499('0xb')](_0xc499('0x1d'));logger['info'](_0xc499('0x4e'),_0x396019['id']);logger['info']('[OUTBOUND]',_0xc499('0x4f'));emit(util[_0xc499('0xd')](_0xc499('0x50'),_0x5ef643['name']),'trigger:browser:url',{'uri':util[_0xc499('0xd')](_0xc499('0x52'),_0x453133[_0xc499('0x1b')],_0x396019['id'])});}})[_0xc499('0x53')](function(_0x413601){logger[_0xc499('0x54')](_0xc499('0x59'),JSON[_0xc499('0x55')](_0x413601));});};exports[_0xc499('0x5c')]=function(_0x555e88,_0x42c902,_0x398675,_0x5ad34d,_0x5552e5,_0x1e350a){var _0x499d74,_0x1ed9c5;_0x1e350a[_0xc499('0x1b')]=intUtil['stripTrailingSlash'](_0x1e350a[_0xc499('0x1b')]);_0x1e350a[_0xc499('0x43')]=intUtil['stripTrailingSlash'](_0x1e350a[_0xc499('0x43')]);if(_0x5552e5&&_0x5552e5[_0xc499('0x5d')]){logger[_0xc499('0xb')]('['+_0x42c902['lastevent'][_0xc499('0x5e')]()+']',_0xc499('0x46'));_0x42c902[_0xc499('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e350a[_0xc499('0x43')],_0x42c902[_0xc499('0x49')],md5(_0x42c902['uniqueid']));}else{_0x42c902['recordingURL']='';}headers[_0xc499('0x4a')]=getAuth(_0x1e350a);return getUser(_0x1e350a,'')[_0xc499('0x1c')](function(_0x21c385){_0x499d74=_0x21c385;logger[_0xc499('0xb')](_0xc499('0x4b'),_0x499d74['id']);return getEndUser(_0x1e350a,_0x42c902[_0xc499('0x4c')],_0x42c902[_0xc499('0xf')]);})['then'](function(_0x5cf15a){_0x1ed9c5=_0x5cf15a;logger[_0xc499('0xb')](_0xc499('0x4d'),_0x1ed9c5['id']);return getTicket(_0x1e350a,_0x499d74,_0x1ed9c5,_0x398675,_0x42c902);})[_0xc499('0x1c')](function(_0x416b16){if(_0x416b16){logger['info'](_0xc499('0x1d'));logger[_0xc499('0xb')](_0xc499('0x4e'),_0x416b16['id']);}})[_0xc499('0x53')](function(_0x4a782c){logger[_0xc499('0x54')]('['+_0x42c902[_0xc499('0x5f')][_0xc499('0x5e')]()+']',JSON[_0xc499('0x55')](_0x4a782c));});}; \ No newline at end of file +var _0x67cb=['%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','stringify','defaults','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','push','idField','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','recordingFormat','Recording\x20is\x20enabled!','Authorization','The\x20User\x20ID\x20is:','destcalleridname','Ticket\x20created!','[OUTBOUND]','error','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','name','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','then','info','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone'];(function(_0x5e4087,_0x3f7e8c){var _0x4d6adb=function(_0x103167){while(--_0x103167){_0x5e4087['push'](_0x5e4087['shift']());}};_0x4d6adb(++_0x3f7e8c);}(_0x67cb,0x147));var _0xb67c=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0x67cb[_0x566bdf];return _0x331215;};'use strict';var _=require(_0xb67c('0x0'));var rp=require(_0xb67c('0x1'));var md5=require(_0xb67c('0x2'));var util=require(_0xb67c('0x3'));var Redis=require(_0xb67c('0x4'));var intUtil=require('./util');var config=require(_0xb67c('0x5'));var logger=require(_0xb67c('0x6'))('freshdesk');config[_0xb67c('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb67c('0x7')]));var headers={'Content-Type':_0xb67c('0x8'),'Accept':'application/json'};function emit(_0x6188a8,_0x3463f5,_0x3b5eb3){io['to'](_0x6188a8)[_0xb67c('0x9')](_0x3463f5,_0x3b5eb3);}function getTicket(_0x11720a,_0x349d9a,_0x4fe02e,_0x2e8089,_0x45b367){logger['info'](_0xb67c('0xa'));var _0x1070e8=_[_0xb67c('0xb')]({'responder_id':_0x349d9a['id'],'requester_id':_0x4fe02e['id'],'name':util[_0xb67c('0xc')](_0xb67c('0xd'),_0x45b367[_0xb67c('0xe')]),'phone':_0x45b367['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb67c('0xf')](_0x2e8089['Subjects'],_0x45b367,'\x20'),'description':intUtil[_0xb67c('0xf')](_0x2e8089[_0xb67c('0x10')],_0x45b367,_0xb67c('0x11')),'tags':getTags(_0x2e8089['Tags'],_0xb67c('0x12'))},getCustomFields(_0x2e8089[_0xb67c('0x13')],_0x45b367));_0x1070e8['custom_fields']=_['mapValues'](_[_0xb67c('0x14')](_0x1070e8[_0xb67c('0x15')],'id'),_0xb67c('0x16'));return request({'uri':util[_0xb67c('0xc')](_0xb67c('0x17'),_0x11720a['remoteUri']),'method':'POST','body':_0x1070e8})[_0xb67c('0x18')](function(_0x245385){logger[_0xb67c('0x19')]('Ticket\x20created!');return _0x245385;});}function getUser(_0x57b911,_0x30536c){if(intUtil[_0xb67c('0x1a')](_0x30536c)){return request({'uri':util['format'](_0xb67c('0x1b'),_0x57b911[_0xb67c('0x1c')]),'qs':{'email':_0x30536c}})[_0xb67c('0x18')](function(_0x5906d7){if(_0x5906d7[_0xb67c('0x1d')]){logger[_0xb67c('0x19')](_0xb67c('0x1e'));return _[_0xb67c('0x1f')](_0x5906d7,function(_0x740ee5){return _0x740ee5[_0xb67c('0x20')]['email']===_0x30536c;});}else{logger[_0xb67c('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xb67c('0x21'),_0x57b911[_0xb67c('0x1c')])})[_0xb67c('0x18')](function(_0x5ca330){logger[_0xb67c('0x19')](_0xb67c('0x22'));return _0x5ca330;});}});}else{logger[_0xb67c('0x19')](_0xb67c('0x23'));return request({'uri':util['format'](_0xb67c('0x21'),_0x57b911[_0xb67c('0x1c')])})['then'](function(_0x49d6b4){logger[_0xb67c('0x19')](_0xb67c('0x22'));return _0x49d6b4;});}}function getEndUser(_0x9c3d5a,_0x4d27ad,_0x20551e){logger[_0xb67c('0x19')](_0xb67c('0x24'),_0x20551e);return request({'uri':util[_0xb67c('0xc')](_0xb67c('0x25'),_0x9c3d5a['remoteUri']),'qs':{'phone':_0x20551e}})[_0xb67c('0x18')](function(_0x543e92){if(_0x543e92['length']){logger['info'](_0xb67c('0x26'));return _[_0xb67c('0x1f')](_0x543e92,{'phone':_0x20551e});}else{logger['info'](_0xb67c('0x27'));return request({'uri':util[_0xb67c('0xc')](_0xb67c('0x25'),_0x9c3d5a[_0xb67c('0x1c')]),'method':_0xb67c('0x28'),'body':{'name':_0x4d27ad,'phone':_0x20551e}})['then'](function(_0x19b184){logger[_0xb67c('0x19')](_0xb67c('0x29'));return _0x19b184;});}});}function getAuth(_0xe5a4a7){return util[_0xb67c('0xc')](_0xb67c('0x2a'),new Buffer(_0xe5a4a7[_0xb67c('0x2b')]+':X')['toString'](_0xb67c('0x2c')));}function request(_0x19e35c){logger['debug'](_0xb67c('0x2d'),JSON[_0xb67c('0x2e')](_0x19e35c));return rp(_[_0xb67c('0x2f')](_0x19e35c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1b41d1,_0x475af0){var _0x2d92c5=[];if(_0x1b41d1&&_0x1b41d1[_0xb67c('0x1d')]>0x0){_0x2d92c5=_[_0xb67c('0x30')](_0x1b41d1,_0x475af0);}return _0x2d92c5;}function getCustomFields(_0x2cdfe3,_0x5431ce){var _0x19b960=[];var _0x5043ce={'custom_fields':[]};if(_0x2cdfe3[_0xb67c('0x1d')]>0x0){_['forEach'](_0x2cdfe3,function(_0x373523){if(_[_0xb67c('0x31')]([_0xb67c('0x32'),_0xb67c('0x33')],_0x373523[_0xb67c('0x34')])&&_0x373523[_0xb67c('0x35')]&&!_0x373523[_0xb67c('0x36')]){_0x5043ce[_0x373523[_0xb67c('0x35')][_0xb67c('0x37')]()]=_0x373523[_0xb67c('0x38')][_0xb67c('0x39')]();}else if(_['includes']([_0xb67c('0x32'),_0xb67c('0x33')],_0x373523[_0xb67c('0x34')])&&_0x373523['idField']&&_0x373523[_0xb67c('0x36')]){_0x5043ce[_0xb67c('0x15')][_0xb67c('0x3a')]({'id':_0x373523[_0xb67c('0x3b')],'value':_0x373523[_0xb67c('0x38')][_0xb67c('0x39')]()});}else if(_0x373523[_0xb67c('0x34')]===_0xb67c('0x3c')&&_0x373523[_0xb67c('0x3d')]&&_0x373523[_0xb67c('0x3b')]&&_0x373523['customField']){_0x5431ce[_0x373523['variableName']]&&_0x5043ce[_0xb67c('0x15')][_0xb67c('0x3a')]({'id':_0x373523[_0xb67c('0x3b')],'value':_0x5431ce[_0x373523[_0xb67c('0x3d')]][_0xb67c('0x39')]()});}else if(_0x373523[_0xb67c('0x34')]===_0xb67c('0x3e')&&_0x373523[_0xb67c('0x3f')]&&_0x373523[_0xb67c('0x3f')][_0xb67c('0x12')]&&_0x373523[_0xb67c('0x3b')]&&_0x373523[_0xb67c('0x36')]){_0x5431ce[_0x373523['Variable'][_0xb67c('0x12')][_0xb67c('0x37')]()]&&_0x5043ce[_0xb67c('0x15')]['push']({'id':_0x373523[_0xb67c('0x3b')],'value':_0x5431ce[_0x373523['Variable'][_0xb67c('0x12')]['toLowerCase']()]['toString']()});}});}return _0x5043ce;}exports[_0xb67c('0x40')]=function(_0x227be7,_0x4e35f6,_0x169bc8,_0x47101e,_0x30204e,_0x174439){var _0x590cff,_0x52cec6;_0x174439['remoteUri']=intUtil['stripTrailingSlash'](_0x174439[_0xb67c('0x1c')]);_0x174439[_0xb67c('0x41')]=intUtil['stripTrailingSlash'](_0x174439['serverUrl']);if(_0x30204e&&_0x30204e[_0xb67c('0x42')]){logger[_0xb67c('0x19')](_0xb67c('0x43'),'Recording\x20is\x20enabled!');_0x4e35f6[_0xb67c('0x44')]=util[_0xb67c('0xc')](_0xb67c('0x45'),_0x174439[_0xb67c('0x41')],_0x4e35f6[_0xb67c('0x46')],md5(_0x4e35f6[_0xb67c('0x46')]));}else{_0x4e35f6[_0xb67c('0x44')]='';}headers['Authorization']=getAuth(_0x174439);return getUser(_0x174439,_0x47101e[_0xb67c('0x47')])[_0xb67c('0x18')](function(_0x114af9){_0x590cff=_0x114af9;logger[_0xb67c('0x19')]('The\x20User\x20ID\x20is:',_0x590cff['id']);return getEndUser(_0x174439,_0x4e35f6['calleridname'],_0x4e35f6[_0xb67c('0x48')]);})[_0xb67c('0x18')](function(_0x25365f){_0x52cec6=_0x25365f;logger[_0xb67c('0x19')](_0xb67c('0x49'),_0x52cec6['id']);return getTicket(_0x174439,_0x590cff,_0x52cec6,_0x169bc8,_0x4e35f6);})[_0xb67c('0x18')](function(_0xb4caec){if(_0xb4caec&&_0xb4caec['id']){logger[_0xb67c('0x19')]('Ticket\x20created!');logger[_0xb67c('0x19')](_0xb67c('0x4a'),_0xb4caec['id']);logger[_0xb67c('0x19')]('[QUEUE]',_0xb67c('0x4b'));emit(util[_0xb67c('0xc')](_0xb67c('0x4c'),_0x47101e[_0xb67c('0x12')]),_0xb67c('0x4d'),{'uri':util[_0xb67c('0xc')]('%s/helpdesk/tickets/%d',_0x174439[_0xb67c('0x1c')],_0xb4caec['id'])});}})[_0xb67c('0x4e')](function(_0x4909ae){logger['error'](_0xb67c('0x43'),JSON[_0xb67c('0x2e')](_0x4909ae));});};exports[_0xb67c('0x4f')]=function(_0x29bce8,_0x358746,_0x46fe15,_0x2099f6,_0x56d093,_0x55fc05,_0x4c5cf8){var _0xa5941f,_0x107f7f;_0x55fc05[_0xb67c('0x1c')]=intUtil[_0xb67c('0x50')](_0x55fc05[_0xb67c('0x1c')]);_0x55fc05[_0xb67c('0x41')]=intUtil[_0xb67c('0x50')](_0x55fc05[_0xb67c('0x41')]);if(_0x4c5cf8&&_0x4c5cf8[_0xb67c('0x51')]&&_0x4c5cf8[_0xb67c('0x51')]!=='none'){logger[_0xb67c('0x19')]('[OUTBOUND]',_0xb67c('0x52'));_0x358746[_0xb67c('0x44')]=util[_0xb67c('0xc')](_0xb67c('0x45'),_0x55fc05[_0xb67c('0x41')],_0x358746[_0xb67c('0x46')],md5(_0x358746[_0xb67c('0x46')]));}headers[_0xb67c('0x53')]=getAuth(_0x55fc05);return getUser(_0x55fc05,_0x2099f6[_0xb67c('0x47')])[_0xb67c('0x18')](function(_0x234b31){_0xa5941f=_0x234b31;logger['info'](_0xb67c('0x54'),_0xa5941f['id']);return getEndUser(_0x55fc05,_0x358746[_0xb67c('0x55')],_0x358746['destcalleridnum']);})[_0xb67c('0x18')](function(_0x1d4a3d){_0x107f7f=_0x1d4a3d;logger[_0xb67c('0x19')](_0xb67c('0x49'),_0x107f7f['id']);return getTicket(_0x55fc05,_0xa5941f,_0x107f7f,_0x46fe15,_0x358746);})[_0xb67c('0x18')](function(_0x429da2){if(_0x429da2&&_0x429da2['id']){logger[_0xb67c('0x19')](_0xb67c('0x56'));logger[_0xb67c('0x19')](_0xb67c('0x4a'),_0x429da2['id']);logger[_0xb67c('0x19')](_0xb67c('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x2099f6['name']),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x55fc05['remoteUri'],_0x429da2['id'])});}})[_0xb67c('0x4e')](function(_0x3d787e){logger[_0xb67c('0x58')]('[OUTBOUND]',JSON[_0xb67c('0x2e')](_0x3d787e));});};exports['unmanaged']=function(_0x386944,_0x3683fb,_0x4cb6e5,_0x28418b,_0x2716ed,_0x4faff2){var _0xd39a80,_0x37e7f2;_0x4faff2['remoteUri']=intUtil[_0xb67c('0x50')](_0x4faff2[_0xb67c('0x1c')]);_0x4faff2[_0xb67c('0x41')]=intUtil[_0xb67c('0x50')](_0x4faff2[_0xb67c('0x41')]);if(_0x2716ed&&_0x2716ed[_0xb67c('0x42')]){logger['info']('['+_0x3683fb['lastevent'][_0xb67c('0x59')]()+']',_0xb67c('0x52'));_0x3683fb[_0xb67c('0x44')]=util['format'](_0xb67c('0x45'),_0x4faff2[_0xb67c('0x41')],_0x3683fb['uniqueid'],md5(_0x3683fb['uniqueid']));}else{_0x3683fb['recordingURL']='';}headers[_0xb67c('0x53')]=getAuth(_0x4faff2);return getUser(_0x4faff2,'')[_0xb67c('0x18')](function(_0x2a1d59){_0xd39a80=_0x2a1d59;logger[_0xb67c('0x19')](_0xb67c('0x54'),_0xd39a80['id']);return getEndUser(_0x4faff2,_0x3683fb[_0xb67c('0xe')],_0x3683fb[_0xb67c('0x48')]);})[_0xb67c('0x18')](function(_0x8ce6ca){_0x37e7f2=_0x8ce6ca;logger[_0xb67c('0x19')]('The\x20Enduser\x20ID\x20is:',_0x37e7f2['id']);return getTicket(_0x4faff2,_0xd39a80,_0x37e7f2,_0x4cb6e5,_0x3683fb);})[_0xb67c('0x18')](function(_0x2f9434){if(_0x2f9434){logger[_0xb67c('0x19')](_0xb67c('0x56'));logger[_0xb67c('0x19')](_0xb67c('0x4a'),_0x2f9434['id']);}})['catch'](function(_0x162c9e){logger[_0xb67c('0x58')]('['+_0x3683fb[_0xb67c('0x5a')]['toUpperCase']()+']',JSON['stringify'](_0x162c9e));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index a815013..ec2fc61 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ecf=['Displaying\x20task\x20in\x20a\x20new\x20tab...','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','then','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s'];(function(_0x286c17,_0x4aade4){var _0x416cf5=function(_0x193faf){while(--_0x193faf){_0x286c17['push'](_0x286c17['shift']());}};_0x416cf5(++_0x4aade4);}(_0x9ecf,0xf4));var _0xf9ec=function(_0x4b54fb,_0x2150e4){_0x4b54fb=_0x4b54fb-0x0;var _0x375eb4=_0x9ecf[_0x4b54fb];return _0x375eb4;};'use strict';var _=require(_0xf9ec('0x0'));var rp=require(_0xf9ec('0x1'));var md5=require('md5');var util=require(_0xf9ec('0x2'));var moment=require(_0xf9ec('0x3'));var Promise=require(_0xf9ec('0x4'));var Redis=require(_0xf9ec('0x5'));var intUtil=require('./util');var config=require(_0xf9ec('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0xf9ec('0x7')]=_[_0xf9ec('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf9ec('0x9'))(new Redis(config[_0xf9ec('0x7')]));function getAdminId(_0x28adc3,_0x3e77fd,_0x2fcc22,_0xd8d120){return new Promise(function(_0x315de3,_0x3ccf5c){var _0x4c51db=![];var _0x599215={'method':_0xf9ec('0xa'),'uri':_0xd8d120+_0xf9ec('0xb'),'json':!![]};_0x599215[_0xf9ec('0xc')]=_0x2fcc22;logger[_0xf9ec('0xd')](_0xf9ec('0xe'));return rp(_0x599215)['then'](function(_0x42a323){if(_0x42a323){var _0x16cd60=_0x42a323['users'];var _0x43a1d7=null;for(_0x43a1d7=0x0;_0x43a1d7<_0x16cd60['length'];_0x43a1d7++){if(_0x16cd60[_0x43a1d7][_0xf9ec('0xf')]===_0x28adc3['adminEmail']){_0x28adc3[_0xf9ec('0x10')]=_0x16cd60[_0x43a1d7]['id'];_0x4c51db=!![];}}if(_0x4c51db){logger[_0xf9ec('0xd')](_0xf9ec('0x11'),_0x28adc3[_0xf9ec('0x10')]);_0x315de3(_0x28adc3);}else{_0x3ccf5c({'statusCode':0x194,'message':_0xf9ec('0x12')});}}else{_0x3ccf5c({'statusCode':0x194,'message':_0xf9ec('0x12')});}})[_0xf9ec('0x13')](function(_0x234223){logger[_0xf9ec('0x14')]('['+[_0x3e77fd[_0xf9ec('0x15')]()]+']',_0x234223[_0xf9ec('0x16')]);_0x3ccf5c(_0x234223);});});}function getUser(_0x7183a5,_0x511c53,_0x1b0946){return function(_0x3b7316){return new Promise(function(_0x500cb6,_0x508aaf){var _0x47659={'method':_0xf9ec('0xa'),'uri':_0x1b0946+'/api/selector/owners','json':!![]};_0x47659[_0xf9ec('0xc')]=_0x511c53;logger[_0xf9ec('0xd')](_0xf9ec('0x17'));return rp(_0x47659)[_0xf9ec('0x18')](function(_0x3cd5d6){if(_0x3cd5d6){var _0x25cbf1=_0x3cd5d6[_0xf9ec('0x19')];var _0x52b0af=![];var _0x2b480e=null;if(_0x3b7316[_0xf9ec('0x1a')]!==null){logger['info'](_0xf9ec('0x1b'),_0x3b7316[_0xf9ec('0x1a')]);_0x3b7316[_0xf9ec('0x1c')]=_0x3b7316[_0xf9ec('0x1a')];for(_0x2b480e=0x0;_0x2b480e<_0x25cbf1[_0xf9ec('0x1d')];_0x2b480e++){if(_0x25cbf1[_0x2b480e][_0xf9ec('0xf')]===_0x3b7316[_0xf9ec('0x1a')]){_0x52b0af=!![];_0x3b7316[_0xf9ec('0x1e')]=_0x25cbf1[_0x2b480e]['id'];logger['info'](_0xf9ec('0x1f'),_0x3b7316[_0xf9ec('0x1e')]);}}}if(!_0x52b0af){logger['info'](_0xf9ec('0x20'));_0x3b7316[_0xf9ec('0x1c')]=_0x3b7316[_0xf9ec('0x21')];_0x3b7316['userId']=_0x3b7316[_0xf9ec('0x10')];_0x52b0af=!![];}if(_0x52b0af){_0x500cb6(_0x3b7316);}else{_0x508aaf({'statusCode':0x194,'message':_0xf9ec('0x12')});}}else{_0x508aaf({'statusCode':0x194,'message':_0xf9ec('0x12')});}})[_0xf9ec('0x13')](function(_0x46d334){logger[_0xf9ec('0x14')]('['+[_0x7183a5[_0xf9ec('0x15')]()]+']',_0x46d334[_0xf9ec('0x16')]);_0x508aaf(_0x46d334);});});};}function searchContact(_0x42daee,_0x29a068,_0x29ec72,_0x382cb5){return new Promise(function(_0x56a303,_0x2e502e){var _0x501aa1={'method':_0xf9ec('0xa'),'headers':_0x29a068,'uri':_0x42daee+'/api/lookup?q='+_0x382cb5+_0xf9ec('0x22')+_0x29ec72+_0xf9ec('0x23'),'json':!![]};rp(_0x501aa1)['then'](function(_0x27d656){var _0x4061d4=_[_0xf9ec('0x24')](_0x27d656[_0xf9ec('0x25')][_0xf9ec('0x25')],[_0x29ec72,_0x382cb5]);_0x56a303(_0x4061d4);})[_0xf9ec('0x13')](function(_0x55b35a){_0x2e502e(_0x55b35a);});});}function getEndUser(_0x23dc8d,_0x43e6ee,_0x1626ae){return function(_0x3df9a0){return new Promise(function(_0x2c3058,_0x1ed2e7){logger[_0xf9ec('0xd')](util[_0xf9ec('0x26')](_0xf9ec('0x27'),_0x3df9a0[_0xf9ec('0x28')]));searchContact(_0x1626ae,_0x43e6ee,_0xf9ec('0x29'),_0x3df9a0[_0xf9ec('0x28')])['then'](function(_0x458532){if(_0x458532){_0x3df9a0[_0xf9ec('0x2a')]=_0x458532['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x3df9a0['endUserId']);return _0x2c3058(_0x3df9a0);}searchContact(_0x1626ae,_0x43e6ee,'work_number',_0x3df9a0[_0xf9ec('0x28')])[_0xf9ec('0x18')](function(_0x386209){if(_0x386209){_0x3df9a0[_0xf9ec('0x2a')]=_0x386209['id'];logger[_0xf9ec('0xd')](_0xf9ec('0x2b'),_0x3df9a0[_0xf9ec('0x2a')]);return _0x2c3058(_0x3df9a0);}createEndUser(_0x3df9a0,_0x23dc8d,_0x43e6ee,_0x1626ae)[_0xf9ec('0x18')](function(_0x3ad6f7){logger[_0xf9ec('0xd')](_0xf9ec('0x2c'),_0x3ad6f7[_0xf9ec('0x2a')]);return _0x2c3058(_0x3ad6f7);});});})['catch'](function(_0x53a922){_0x1ed2e7(_0x53a922);});});};}function createEndUser(_0x630eae,_0xf9856a,_0x426717,_0x4d84c4){return new Promise(function(_0x414de8,_0x180108){var _0x4348d2=moment();var _0x316c63={'method':_0xf9ec('0x2d'),'uri':_0x4d84c4+_0xf9ec('0x2e'),'body':{'contact':{'last_name':_0x630eae[_0xf9ec('0x28')],'work_number':_0x630eae[_0xf9ec('0x28')],'mobile_number':_0x630eae[_0xf9ec('0x28')],'owner_id':_0x630eae[_0xf9ec('0x1e')],'created_at':_0x4348d2[_0xf9ec('0x26')](_0xf9ec('0x2f'))}},'json':!![]};_0x316c63[_0xf9ec('0xc')]=_0x426717;logger['info'](_0xf9ec('0x30'));return rp(_0x316c63)[_0xf9ec('0x18')](function(_0x26151c){_0x630eae[_0xf9ec('0x2a')]=_0x26151c[_0xf9ec('0x31')]['id'];_0x414de8(_0x630eae);})[_0xf9ec('0x13')](function(_0x32fee5){logger[_0xf9ec('0x14')]('['+[_0xf9856a['toUpperCase']()]+']',_0x32fee5[_0xf9ec('0x16')]);_0x180108(_0x32fee5[_0xf9ec('0x16')]);});});}function getTicket(_0x34a476,_0x2c452f,_0x159aa8,_0x92cfcf,_0x541f8a){return function(_0x4a8c1c){logger[_0xf9ec('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x30cc5c,_0x23a2ec){var _0x1b91e8=moment();var _0x54637c={'method':_0xf9ec('0x2d'),'uri':_0x159aa8+_0xf9ec('0x32'),'body':{'title':intUtil[_0xf9ec('0x33')](_0x92cfcf[_0xf9ec('0x34')],_0x541f8a,'\x20'),'description':intUtil['getString'](_0x92cfcf['Descriptions'],_0x541f8a,'\x0a'),'owner_id':_0x4a8c1c[_0xf9ec('0x1e')],'creater_id':_0x4a8c1c['adminId'],'targetable_id':_0x4a8c1c[_0xf9ec('0x2a')],'targetable_type':_0xf9ec('0x35'),'created_at':_0x1b91e8[_0xf9ec('0x26')](_0xf9ec('0x2f')),'due_date':_0x1b91e8[_0xf9ec('0x36')](0x1e,'m')[_0xf9ec('0x26')](_0xf9ec('0x2f'))},'json':!![]};_0x54637c[_0xf9ec('0xc')]=_0x2c452f;return rp(_0x54637c)[_0xf9ec('0x18')](function(_0x180ae5){_0x4a8c1c[_0xf9ec('0x37')]=_0x180ae5[_0xf9ec('0x38')]['id'];logger[_0xf9ec('0xd')](_0xf9ec('0x39'),_0x4a8c1c[_0xf9ec('0x37')]);_0x30cc5c(_0x4a8c1c);})[_0xf9ec('0x13')](function(_0xe4af7e){logger['error']('['+[_0x34a476[_0xf9ec('0x15')]()]+']',_0xe4af7e[_0xf9ec('0x16')]);_0x23a2ec(_0xe4af7e['message']);});});};}function emit(_0x2ae79c,_0x365a32,_0x4ba0b5){var _0x2fe0ba={'uri':_0x2ae79c+_0xf9ec('0x3a')+_0x4ba0b5};io['to'](util['format'](_0xf9ec('0x3b'),_0x365a32))[_0xf9ec('0x3c')](_0xf9ec('0x3d'),_0x2fe0ba);}exports['cs']=function(_0x212300,_0x5ec095,_0x45e2c8,_0x35c4d2,_0x32e723,_0x4669a5,_0x2c063d,_0x3094b5){var _0x2ae108={};var _0x179643={'Authorization':'Token\x20token='+_0x4669a5[_0xf9ec('0x3e')]};_0x4669a5[_0xf9ec('0x3f')]=intUtil[_0xf9ec('0x40')](_0x4669a5[_0xf9ec('0x3f')]);_0x4669a5['serverUrl']=intUtil[_0xf9ec('0x40')](_0x4669a5[_0xf9ec('0x41')]);var _0x82a8f6=_0x4669a5[_0xf9ec('0x3f')];_0x2ae108['adminEmail']=_0x4669a5[_0xf9ec('0x42')];_0x2ae108[_0xf9ec('0x28')]=_0x3094b5[_0xf9ec('0x43')]()==='outbound'?_0x5ec095['destcalleridnum']:_0x5ec095['calleridnum'];_0x2ae108[_0xf9ec('0x44')]=_0x3094b5===_0xf9ec('0x45')||_0x3094b5===_0xf9ec('0x46')?_0xf9ec('0x45'):'outbound';if(_0x35c4d2){_0x2ae108['agentEmail']=_0x35c4d2[_0xf9ec('0xf')];}var _0x1609f6=util['format'](_0xf9ec('0x47'),_0x4669a5['serverUrl'],_0x5ec095['uniqueid'],md5(_0x5ec095[_0xf9ec('0x48')]));if(_0x32e723&&_0x32e723[_0xf9ec('0x49')]){logger[_0xf9ec('0xd')](_0xf9ec('0x4a'),_0xf9ec('0x4b'));_0x5ec095[_0xf9ec('0x4c')]=_0x1609f6;}else if(_0x2c063d&&_0x2c063d[_0xf9ec('0x4d')]&&_0x2c063d[_0xf9ec('0x4d')]!=='none'){logger[_0xf9ec('0xd')](_0xf9ec('0x4e'),_0xf9ec('0x4b'));_0x5ec095[_0xf9ec('0x4c')]=_0x1609f6;}else{_0x5ec095[_0xf9ec('0x4c')]='';}return getAdminId(_0x2ae108,_0x3094b5,_0x179643,_0x82a8f6)[_0xf9ec('0x18')](getUser(_0x3094b5,_0x179643,_0x82a8f6))[_0xf9ec('0x18')](getEndUser(_0x3094b5,_0x179643,_0x82a8f6))[_0xf9ec('0x18')](getTicket(_0x3094b5,_0x179643,_0x82a8f6,_0x45e2c8,_0x5ec095))[_0xf9ec('0x18')](function(_0x44268e){logger['info'](util['format'](_0xf9ec('0x4f'),_0x44268e['ticketId']));if(_0x3094b5!==_0xf9ec('0x46')){logger[_0xf9ec('0xd')]('['+[_0x3094b5[_0xf9ec('0x15')]()]+']',_0xf9ec('0x50'));emit(_0x82a8f6,_0x35c4d2['name'],_0x44268e['endUserId']);}})[_0xf9ec('0x13')](function(_0x1f11cd){logger[_0xf9ec('0x14')]('['+[_0x3094b5[_0xf9ec('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x1f11cd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3533=['Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','format','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','destcalleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','info','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','adminEmail','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts'];(function(_0x5207da,_0x4a1dcd){var _0x26407c=function(_0x55511c){while(--_0x55511c){_0x5207da['push'](_0x5207da['shift']());}};_0x26407c(++_0x4a1dcd);}(_0x3533,0x171));var _0x3353=function(_0x2ee6cf,_0x2bd502){_0x2ee6cf=_0x2ee6cf-0x0;var _0x187d68=_0x3533[_0x2ee6cf];return _0x187d68;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x3353('0x0'));var util=require(_0x3353('0x1'));var moment=require(_0x3353('0x2'));var Promise=require(_0x3353('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3353('0x4'));var config=require(_0x3353('0x5'));var logger=require(_0x3353('0x6'))(_0x3353('0x7'));config[_0x3353('0x8')]=_['defaults'](config[_0x3353('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3353('0x9'))(new Redis(config[_0x3353('0x8')]));function getAdminId(_0x522720,_0x15f8a5,_0x1918e3,_0xcfa421){return new Promise(function(_0x43f8a5,_0x273076){var _0x20e57f=![];var _0x7cbc2c={'method':_0x3353('0xa'),'uri':_0xcfa421+_0x3353('0xb'),'json':!![]};_0x7cbc2c[_0x3353('0xc')]=_0x1918e3;logger['info'](_0x3353('0xd'));return rp(_0x7cbc2c)[_0x3353('0xe')](function(_0x3c67ad){if(_0x3c67ad){var _0x41e49c=_0x3c67ad['users'];var _0x30c1df=null;for(_0x30c1df=0x0;_0x30c1df<_0x41e49c['length'];_0x30c1df++){if(_0x41e49c[_0x30c1df][_0x3353('0xf')]===_0x522720['adminEmail']){_0x522720[_0x3353('0x10')]=_0x41e49c[_0x30c1df]['id'];_0x20e57f=!![];}}if(_0x20e57f){logger['info'](_0x3353('0x11'),_0x522720[_0x3353('0x10')]);_0x43f8a5(_0x522720);}else{_0x273076({'statusCode':0x194,'message':_0x3353('0x12')});}}else{_0x273076({'statusCode':0x194,'message':_0x3353('0x12')});}})[_0x3353('0x13')](function(_0x48cead){logger[_0x3353('0x14')]('['+[_0x15f8a5['toUpperCase']()]+']',_0x48cead[_0x3353('0x15')]);_0x273076(_0x48cead);});});}function getUser(_0x13df18,_0x32498b,_0x413473){return function(_0x257f6f){return new Promise(function(_0x2b94de,_0x3f098e){var _0x1c126b={'method':'GET','uri':_0x413473+_0x3353('0xb'),'json':!![]};_0x1c126b['headers']=_0x32498b;logger[_0x3353('0x16')]('Getting\x20user\x20list');return rp(_0x1c126b)['then'](function(_0x28a007){if(_0x28a007){var _0x438b91=_0x28a007[_0x3353('0x17')];var _0xd9c6db=![];var _0x20e828=null;if(_0x257f6f[_0x3353('0x18')]!==null){logger[_0x3353('0x16')](_0x3353('0x19'),_0x257f6f[_0x3353('0x18')]);_0x257f6f[_0x3353('0x1a')]=_0x257f6f[_0x3353('0x18')];for(_0x20e828=0x0;_0x20e828<_0x438b91['length'];_0x20e828++){if(_0x438b91[_0x20e828]['email']===_0x257f6f[_0x3353('0x18')]){_0xd9c6db=!![];_0x257f6f['userId']=_0x438b91[_0x20e828]['id'];logger['info'](_0x3353('0x1b'),_0x257f6f[_0x3353('0x1c')]);}}}if(!_0xd9c6db){logger[_0x3353('0x16')]('Admin\x20selected');_0x257f6f[_0x3353('0x1a')]=_0x257f6f[_0x3353('0x1d')];_0x257f6f[_0x3353('0x1c')]=_0x257f6f[_0x3353('0x10')];_0xd9c6db=!![];}if(_0xd9c6db){_0x2b94de(_0x257f6f);}else{_0x3f098e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3f098e({'statusCode':0x194,'message':_0x3353('0x12')});}})[_0x3353('0x13')](function(_0x4f34b0){logger[_0x3353('0x14')]('['+[_0x13df18[_0x3353('0x1e')]()]+']',_0x4f34b0[_0x3353('0x15')]);_0x3f098e(_0x4f34b0);});});};}function searchContact(_0x21937a,_0x435bf7,_0x403f80,_0x310b64){return new Promise(function(_0x63e81a,_0x4c066c){var _0x55f661={'method':'GET','headers':_0x435bf7,'uri':_0x21937a+_0x3353('0x1f')+_0x310b64+_0x3353('0x20')+_0x403f80+_0x3353('0x21'),'json':!![]};rp(_0x55f661)['then'](function(_0x2e8e5e){var _0x59b227=_[_0x3353('0x22')](_0x2e8e5e[_0x3353('0x23')][_0x3353('0x23')],[_0x403f80,_0x310b64]);_0x63e81a(_0x59b227);})[_0x3353('0x13')](function(_0x393d5a){_0x4c066c(_0x393d5a);});});}function getEndUser(_0xb6fd7b,_0x5708c4,_0x20b516){return function(_0x28958d){return new Promise(function(_0x59bb9e,_0x259018){logger[_0x3353('0x16')](util['format'](_0x3353('0x24'),_0x28958d['contactNumber']));searchContact(_0x20b516,_0x5708c4,_0x3353('0x25'),_0x28958d[_0x3353('0x26')])[_0x3353('0xe')](function(_0x25cb3a){if(_0x25cb3a){_0x28958d[_0x3353('0x27')]=_0x25cb3a['id'];logger['info'](_0x3353('0x28'),_0x28958d['endUserId']);return _0x59bb9e(_0x28958d);}searchContact(_0x20b516,_0x5708c4,_0x3353('0x29'),_0x28958d[_0x3353('0x26')])['then'](function(_0x5654d4){if(_0x5654d4){_0x28958d[_0x3353('0x27')]=_0x5654d4['id'];logger[_0x3353('0x16')](_0x3353('0x2a'),_0x28958d['endUserId']);return _0x59bb9e(_0x28958d);}createEndUser(_0x28958d,_0xb6fd7b,_0x5708c4,_0x20b516)['then'](function(_0x22f375){logger[_0x3353('0x16')](_0x3353('0x2b'),_0x22f375[_0x3353('0x27')]);return _0x59bb9e(_0x22f375);});});})['catch'](function(_0x56fb21){_0x259018(_0x56fb21);});});};}function createEndUser(_0x5b6aa6,_0x51c43a,_0x2fa0f1,_0x3ccbf5){return new Promise(function(_0x1f5580,_0x33b260){var _0x27149d=moment();var _0x176e3f={'method':_0x3353('0x2c'),'uri':_0x3ccbf5+_0x3353('0x2d'),'body':{'contact':{'last_name':_0x5b6aa6[_0x3353('0x26')],'work_number':_0x5b6aa6[_0x3353('0x26')],'mobile_number':_0x5b6aa6['contactNumber'],'owner_id':_0x5b6aa6['userId'],'created_at':_0x27149d['format'](_0x3353('0x2e'))}},'json':!![]};_0x176e3f[_0x3353('0xc')]=_0x2fa0f1;logger[_0x3353('0x16')](_0x3353('0x2f'));return rp(_0x176e3f)[_0x3353('0xe')](function(_0x5ae8e8){_0x5b6aa6['endUserId']=_0x5ae8e8[_0x3353('0x30')]['id'];_0x1f5580(_0x5b6aa6);})[_0x3353('0x13')](function(_0x4c8a1e){logger['error']('['+[_0x51c43a['toUpperCase']()]+']',_0x4c8a1e['message']);_0x33b260(_0x4c8a1e['message']);});});}function getTicket(_0x117986,_0x4e6df9,_0x554012,_0x1be039,_0x4fceaa){return function(_0x36133c){logger[_0x3353('0x16')](_0x3353('0x31'));return new Promise(function(_0x773ed,_0x2847ce){var _0x2580a3=moment();var _0x17b7a3={'method':_0x3353('0x2c'),'uri':_0x554012+_0x3353('0x32'),'body':{'title':intUtil['getString'](_0x1be039['Subjects'],_0x4fceaa,'\x20'),'description':intUtil[_0x3353('0x33')](_0x1be039[_0x3353('0x34')],_0x4fceaa,'\x0a'),'owner_id':_0x36133c[_0x3353('0x1c')],'creater_id':_0x36133c[_0x3353('0x10')],'targetable_id':_0x36133c[_0x3353('0x27')],'targetable_type':_0x3353('0x35'),'created_at':_0x2580a3[_0x3353('0x36')](_0x3353('0x2e')),'due_date':_0x2580a3['add'](0x1e,'m')[_0x3353('0x36')](_0x3353('0x2e'))},'json':!![]};_0x17b7a3[_0x3353('0xc')]=_0x4e6df9;return rp(_0x17b7a3)['then'](function(_0x3d3778){_0x36133c['ticketId']=_0x3d3778[_0x3353('0x37')]['id'];logger[_0x3353('0x16')](_0x3353('0x38'),_0x36133c[_0x3353('0x39')]);_0x773ed(_0x36133c);})[_0x3353('0x13')](function(_0x58bd59){logger[_0x3353('0x14')]('['+[_0x117986[_0x3353('0x1e')]()]+']',_0x58bd59[_0x3353('0x15')]);_0x2847ce(_0x58bd59[_0x3353('0x15')]);});});};}function emit(_0x2e238f,_0x39cbd3,_0x3e1620){var _0x927822={'uri':_0x2e238f+_0x3353('0x3a')+_0x3e1620};io['to'](util[_0x3353('0x36')]('user:%s',_0x39cbd3))[_0x3353('0x3b')](_0x3353('0x3c'),_0x927822);}exports['cs']=function(_0x334f5d,_0xcac4b5,_0x3168a5,_0xf4ba06,_0x21e186,_0x272f48,_0x50faa9,_0x522a86){var _0x41fd65={};var _0x4aa25d={'Authorization':_0x3353('0x3d')+_0x272f48['apiKey']};_0x272f48[_0x3353('0x3e')]=intUtil[_0x3353('0x3f')](_0x272f48[_0x3353('0x3e')]);_0x272f48[_0x3353('0x40')]=intUtil['stripTrailingSlash'](_0x272f48[_0x3353('0x40')]);var _0x1b4d4e=_0x272f48[_0x3353('0x3e')];_0x41fd65[_0x3353('0x1d')]=_0x272f48[_0x3353('0x41')];_0x41fd65[_0x3353('0x26')]=_0x522a86['toLowerCase']()==='outbound'?_0xcac4b5[_0x3353('0x42')]:_0xcac4b5['calleridnum'];_0x41fd65['callDirection']=_0x522a86==='queue'||_0x522a86==='unmanaged'?_0x3353('0x43'):_0x3353('0x44');if(_0xf4ba06){_0x41fd65['agentEmail']=_0xf4ba06[_0x3353('0xf')];}var _0x57182b=util[_0x3353('0x36')](_0x3353('0x45'),_0x272f48['serverUrl'],_0xcac4b5[_0x3353('0x46')],md5(_0xcac4b5['uniqueid']));if(_0x21e186&&_0x21e186[_0x3353('0x47')]){logger[_0x3353('0x16')](_0x3353('0x48'),_0x3353('0x49'));_0xcac4b5[_0x3353('0x4a')]=_0x57182b;}else if(_0x50faa9&&_0x50faa9[_0x3353('0x4b')]&&_0x50faa9['recordingFormat']!==_0x3353('0x4c')){logger[_0x3353('0x16')](_0x3353('0x4d'),'Recording\x20is\x20enabled!');_0xcac4b5[_0x3353('0x4a')]=_0x57182b;}else{_0xcac4b5['recordingURL']='';}return getAdminId(_0x41fd65,_0x522a86,_0x4aa25d,_0x1b4d4e)[_0x3353('0xe')](getUser(_0x522a86,_0x4aa25d,_0x1b4d4e))[_0x3353('0xe')](getEndUser(_0x522a86,_0x4aa25d,_0x1b4d4e))['then'](getTicket(_0x522a86,_0x4aa25d,_0x1b4d4e,_0x3168a5,_0xcac4b5))[_0x3353('0xe')](function(_0x4b4b74){logger[_0x3353('0x16')](util[_0x3353('0x36')](_0x3353('0x4e'),_0x4b4b74[_0x3353('0x39')]));if(_0x522a86!=='unmanaged'){logger[_0x3353('0x16')]('['+[_0x522a86[_0x3353('0x1e')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1b4d4e,_0xf4ba06['name'],_0x4b4b74[_0x3353('0x27')]);}})[_0x3353('0x13')](function(_0x15f308){logger[_0x3353('0x14')]('['+[_0x522a86[_0x3353('0x1e')]()]+_0x3353('0x4f'),util[_0x3353('0x50')](_0x15f308,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 137fcc2..d0e458d 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9698=['./zendesk','./salesforce','./sugarcrm','./zoho','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','vtiger','freshsales','servicenow','includes','toLowerCase','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','zendesk','desk','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util'];(function(_0x5756e5,_0xabaa88){var _0x16fed6=function(_0x30a084){while(--_0x30a084){_0x5756e5['push'](_0x5756e5['shift']());}};_0x16fed6(++_0xabaa88);}(_0x9698,0x170));var _0x8969=function(_0x216374,_0x30d7a1){_0x216374=_0x216374-0x0;var _0x52439c=_0x9698[_0x216374];return _0x52439c;};'use strict';var _=require(_0x8969('0x0'));var util=require(_0x8969('0x1'));var zendesk=require(_0x8969('0x2'));var salesforce=require(_0x8969('0x3'));var sugarcrm=require(_0x8969('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x8969('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x8969('0x6'));var dynamics365=require(_0x8969('0x7'));var freshsales=require(_0x8969('0x8'));var integrations=['zendesk',_0x8969('0x9'),_0x8969('0xa'),_0x8969('0xb'),_0x8969('0xc'),'desk',_0x8969('0xd'),'dynamics365',_0x8969('0xe'),_0x8969('0xf')];exports['exec']=function(_0x1a25ef,_0x34a311,_0xf4b538,_0x41e7de,_0x3b5e28,_0x1b42d5){if(_0xf4b538){if(_[_0x8969('0x10')](integrations,_0x1a25ef['data1'][_0x8969('0x11')]())){try{var _0x147bda=null;var _0x2059a2='';var _0x12121a=_0xf4b538[_0x1a25ef['data1'][_0x8969('0x11')]()];if(_0x12121a){var _0x18fd84=_0x12121a[_0x1a25ef[_0x8969('0x12')]];if(_0x18fd84){var _0x2b9e7f=_['find'](_0x18fd84['Configurations'],{'id':parseInt(_0x1a25ef[_0x8969('0x13')],0xa)});if(_0x2b9e7f){if(_0x41e7de){if(_0x3b5e28&&_0x34a311[_0x8969('0x14')]){_0x2059a2=_0x8969('0x14');}else if(_0x34a311[_0x8969('0x15')]){_0x2059a2=_0x8969('0x16');}else{console[_0x8969('0x17')](_0x8969('0x18'),_0x34a311);}}else{_0x2059a2=_0x8969('0x19');}switch(_0x1a25ef[_0x8969('0x1a')][_0x8969('0x11')]()){case _0x8969('0x1b'):zendesk[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0x9'):salesforce[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0xa'):sugarcrm[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0xb'):freshdesk[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case'zoho':zoho[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0x1c'):desk[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0xd'):vtiger[_0x2059a2](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5);break;case _0x8969('0xe'):freshsales['cs'](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5,_0x2059a2);break;case _0x8969('0xf'):servicenow['cs'](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5,_0x2059a2);break;case _0x8969('0x1d'):dynamics365['cs'](_0x1a25ef,_0x34a311,_0x2b9e7f,_0x41e7de,_0x3b5e28,_0x18fd84,_0x1b42d5,_0x2059a2);break;default:console[_0x8969('0x17')](_0x8969('0x1e'));}}else{_0x147bda=require(_0x8969('0x1f'))(_0x1a25ef['data1'][_0x8969('0x11')]());_0x147bda[_0x8969('0x20')](_0x8969('0x21'),util[_0x8969('0x22')](_0x8969('0x23'),_0x1a25ef['data1'][_0x8969('0x11')](),_0x1a25ef[_0x8969('0x13')]));}}else{_0x147bda=require(_0x8969('0x1f'))(_0x1a25ef['data1'][_0x8969('0x11')]());_0x147bda[_0x8969('0x20')](_0x8969('0x21'),util['format'](_0x8969('0x24'),_0x1a25ef[_0x8969('0x1a')][_0x8969('0x11')](),_0x1a25ef['data2']));}}else{}}catch(_0x143414){console[_0x8969('0x20')](_0x143414);}}}}; \ No newline at end of file +var _0x5acc=['format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','vtiger','../../../../config/logger','error','[EXEC]'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5acc,0x1ed));var _0xc5ac=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5acc[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc5ac('0x0'));var util=require(_0xc5ac('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xc5ac('0x2'));var freshdesk=require(_0xc5ac('0x3'));var zoho=require(_0xc5ac('0x4'));var desk=require('./desk');var vtiger=require(_0xc5ac('0x5'));var servicenow=require(_0xc5ac('0x6'));var dynamics365=require(_0xc5ac('0x7'));var freshsales=require('./freshsales');var integrations=[_0xc5ac('0x8'),'salesforce',_0xc5ac('0x9'),_0xc5ac('0xa'),_0xc5ac('0xb'),_0xc5ac('0xc'),'vtiger',_0xc5ac('0xd'),_0xc5ac('0xe'),_0xc5ac('0xf')];exports[_0xc5ac('0x10')]=function(_0x199978,_0x278577,_0x4965f6,_0x68bb4d,_0x2c7bd0,_0x594ac5){if(_0x4965f6){if(_['includes'](integrations,_0x199978[_0xc5ac('0x11')][_0xc5ac('0x12')]())){try{var _0x3ab6f2=null;var _0x1f57e2='';var _0x10ba28=_0x4965f6[_0x199978[_0xc5ac('0x11')][_0xc5ac('0x12')]()];if(_0x10ba28){var _0x14e8d1=_0x10ba28[_0x199978[_0xc5ac('0x13')]];if(_0x14e8d1){var _0x1b6b65=_[_0xc5ac('0x14')](_0x14e8d1['Configurations'],{'id':parseInt(_0x199978[_0xc5ac('0x15')],0xa)});if(_0x1b6b65){if(_0x68bb4d){if(_0x2c7bd0&&_0x278577['queue']){_0x1f57e2=_0xc5ac('0x16');}else if(_0x278577['routeId']){_0x1f57e2=_0xc5ac('0x17');}else{console[_0xc5ac('0x18')](_0xc5ac('0x19'),_0x278577);}}else{_0x1f57e2=_0xc5ac('0x1a');}switch(_0x199978['data1']['toLowerCase']()){case _0xc5ac('0x8'):zendesk[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case _0xc5ac('0x1b'):salesforce[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case _0xc5ac('0x9'):sugarcrm[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case'freshdesk':freshdesk[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case _0xc5ac('0xb'):zoho[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case'desk':desk[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case _0xc5ac('0x1c'):vtiger[_0x1f57e2](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5);break;case _0xc5ac('0xe'):freshsales['cs'](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5,_0x1f57e2);break;case _0xc5ac('0xf'):servicenow['cs'](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5,_0x1f57e2);break;case _0xc5ac('0xd'):dynamics365['cs'](_0x199978,_0x278577,_0x1b6b65,_0x68bb4d,_0x2c7bd0,_0x14e8d1,_0x594ac5,_0x1f57e2);break;default:console[_0xc5ac('0x18')]('unknown\x20integration');}}else{_0x3ab6f2=require(_0xc5ac('0x1d'))(_0x199978[_0xc5ac('0x11')][_0xc5ac('0x12')]());_0x3ab6f2[_0xc5ac('0x1e')](_0xc5ac('0x1f'),util[_0xc5ac('0x20')](_0xc5ac('0x21'),_0x199978[_0xc5ac('0x11')]['toLowerCase'](),_0x199978[_0xc5ac('0x15')]));}}else{_0x3ab6f2=require(_0xc5ac('0x1d'))(_0x199978['data1'][_0xc5ac('0x12')]());_0x3ab6f2[_0xc5ac('0x1e')]('[EXEC]',util[_0xc5ac('0x20')](_0xc5ac('0x22'),_0x199978[_0xc5ac('0x11')][_0xc5ac('0x12')](),_0x199978[_0xc5ac('0x13')]));}}else{}}catch(_0x189c97){console['error'](_0x189c97);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index e06dc99..5e63e10 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fe3=['redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','ContactId','AccountId','leadId','info','ticketType','create','isNil','sobject','find','execute','then','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Contact','Lead','length','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','upperFirst','forEach','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce'];(function(_0x10714f,_0xc7b2ed){var _0x4728d9=function(_0xe56cd3){while(--_0xe56cd3){_0x10714f['push'](_0x10714f['shift']());}};_0x4728d9(++_0xc7b2ed);}(_0x0fe3,0x16c));var _0x30fe=function(_0x5431f0,_0x35b145){_0x5431f0=_0x5431f0-0x0;var _0x16b8b2=_0x0fe3[_0x5431f0];return _0x16b8b2;};'use strict';var _=require(_0x30fe('0x0'));var rp=require(_0x30fe('0x1'));var moment=require(_0x30fe('0x2'));var BPromise=require(_0x30fe('0x3'));var md5=require(_0x30fe('0x4'));var jsforce=require(_0x30fe('0x5'));var util=require('util');var Redis=require(_0x30fe('0x6'));var intUtil=require(_0x30fe('0x7'));var config=require(_0x30fe('0x8'));var logger=require(_0x30fe('0x9'))(_0x30fe('0xa'));config[_0x30fe('0xb')]=_[_0x30fe('0xc')](config[_0x30fe('0xb')],{'host':_0x30fe('0xd'),'port':0x18eb});var io=require(_0x30fe('0xe'))(new Redis(config[_0x30fe('0xb')]));function emit(_0x213352,_0x3a3e39,_0x291b2d){io['to'](_0x213352)[_0x30fe('0xf')](_0x3a3e39,_0x291b2d);}function getTicket(_0x10a2c3,_0x627231,_0x29348c,_0x275597,_0x4a83b5,_0x400e8a,_0x254f6b,_0x5ebe6c){var _0x58578f=Object['assign']({},{'OwnerId':_0x627231['id'],'Subject':intUtil[_0x30fe('0x10')](_0x275597[_0x30fe('0x11')],_0x4a83b5,'\x20'),'Description':intUtil[_0x30fe('0x10')](_0x275597[_0x30fe('0x12')],_0x4a83b5,'\x0a')},getCustomFields(_0x400e8a,_0x4a83b5));if(_0x29348c){if(_0x275597['ticketType']===_0x30fe('0x13')){_0x58578f['ActivityDate']=moment[_0x30fe('0x14')]();_0x58578f[_0x30fe('0x15')]=![];_0x58578f[_0x30fe('0x16')]=![];if(_0x29348c[_0x30fe('0x17')]===_0x30fe('0x18')||_0x29348c[_0x30fe('0x17')]===_0x30fe('0x19')){_0x58578f[_0x30fe('0x1a')]=_0x29348c['id'];}else if(_0x29348c[_0x30fe('0x17')]===_0x30fe('0x1b')){_0x58578f['WhatId']=_0x29348c['id'];}}else if(_0x275597['ticketType']==='Case'){if(_0x29348c['endUserType']==='contact'){_0x58578f[_0x30fe('0x1c')]=_0x29348c['id'];}else if(_0x29348c['endUserType']===_0x30fe('0x1b')){_0x58578f[_0x30fe('0x1d')]=_0x29348c['id'];}else if(_0x29348c['endUserType']==='lead'&&_0x275597[_0x30fe('0x1e')]){_0x58578f[_0x275597[_0x30fe('0x1e')]]=_0x29348c['id'];}else{logger[_0x30fe('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x254f6b['sobject'](_0x275597[_0x30fe('0x20')])[_0x30fe('0x21')](_0x58578f);}function getUser(_0xb1009,_0x550ecb,_0x5f5772){if(!_[_0x30fe('0x22')](_0x550ecb)&&intUtil['validateEmail'](_0x550ecb)){var _0x35b9ae={'Email':_0x550ecb};var _0x1e5f79={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5f5772[_0x30fe('0x23')]('User')[_0x30fe('0x24')](_0x35b9ae,_0x1e5f79)[_0x30fe('0x25')]()[_0x30fe('0x26')](function(_0x4e0017){if(_0x4e0017['length']){var _0x431f5=_['find'](_0x4e0017,function(_0x402b3b){return _0x402b3b['Email']===_0x550ecb;});if(_0x431f5){logger['info']('Agent\x20%s\x20found.',_0x550ecb);return BPromise[_0x30fe('0x27')]({'id':_0x431f5['Id'],'name':_0x431f5[_0x30fe('0x28')]});}}else{logger[_0x30fe('0x1f')](_0x30fe('0x29'),_0x550ecb);return _0x5f5772[_0x30fe('0x2a')]()[_0x30fe('0x26')](function(_0x5ceec6){return BPromise[_0x30fe('0x27')]({'id':_0x5ceec6[_0x30fe('0x2b')],'name':_0x5ceec6[_0x30fe('0x2c')]});});}});}else{logger[_0x30fe('0x1f')](_0x30fe('0x29'),_0x550ecb);return _0x5f5772[_0x30fe('0x2a')]()[_0x30fe('0x26')](function(_0x55e881){return BPromise[_0x30fe('0x27')]({'id':_0x55e881[_0x30fe('0x2b')],'name':_0x55e881[_0x30fe('0x2c')]});});}}function getEndUser(_0x5d43b2,_0x2fce22,_0x5f3e48,_0x34dd09,_0x3e3b38){var _0x24253c={'$or':{'Phone':_0x34dd09}};var _0x948b03={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x30fe('0x27')]()[_0x30fe('0x26')](function(){logger[_0x30fe('0x1f')](_0x30fe('0x2d'),_0x34dd09,_0x2fce22[_0x30fe('0x2e')]);switch(_0x2fce22[_0x30fe('0x2e')]){case _0x30fe('0x2f'):var _0x326b90=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22['additionalSearchContact']){var _0x36aaf2={};_0x36aaf2[_0x2fce22[_0x30fe('0x31')]]=_0x34dd09;_[_0x30fe('0x32')](_0x326b90[_0x30fe('0x33')],_0x36aaf2);}return _0x3e3b38['sobject']('Contact')[_0x30fe('0x24')](_0x326b90,_0x948b03)[_0x30fe('0x25')]()[_0x30fe('0x26')](function(_0x2568ea){if(_0x2568ea&&_0x2568ea['length']){return _0x2568ea;}else{var _0x429dc1=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22['additionalSearchLead']){var _0x251c99={};_0x251c99[_0x2fce22[_0x30fe('0x34')]]=_0x34dd09;_['merge'](_0x429dc1[_0x30fe('0x33')],_0x251c99);}return _0x3e3b38[_0x30fe('0x23')]('Lead')[_0x30fe('0x24')](_0x429dc1,_0x948b03);}});case _0x30fe('0x35'):var _0x4d2587=_['cloneDeep'](_0x24253c);if(_0x2fce22[_0x30fe('0x36')]){var _0x36aaf2={};_0x36aaf2[_0x2fce22[_0x30fe('0x36')]]=_0x34dd09;_[_0x30fe('0x32')](_0x4d2587[_0x30fe('0x33')],_0x36aaf2);}return _0x3e3b38[_0x30fe('0x23')](_0x30fe('0x37'))[_0x30fe('0x24')](_0x4d2587,_0x948b03)['execute']()[_0x30fe('0x26')](function(_0x119b99){if(_0x119b99&&_0x119b99['length']){return _0x119b99;}else{var _0x515974=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22['additionalSearchContact']){var _0x1264f4={};_0x1264f4[_0x2fce22[_0x30fe('0x31')]]=_0x34dd09;_['merge'](_0x515974[_0x30fe('0x33')],_0x1264f4);}return _0x3e3b38[_0x30fe('0x23')](_0x30fe('0x38'))[_0x30fe('0x24')](_0x515974,_0x948b03)[_0x30fe('0x26')](function(_0x2af730){if(_0x2af730&&_0x2af730['length']){return _0x2af730;}else{var _0x3792fb=_['cloneDeep'](_0x24253c);if(_0x2fce22[_0x30fe('0x34')]){var _0x1522ce={};_0x1522ce[_0x2fce22[_0x30fe('0x34')]]=_0x34dd09;_[_0x30fe('0x32')](_0x3792fb[_0x30fe('0x33')],_0x1522ce);}return _0x3e3b38[_0x30fe('0x23')](_0x30fe('0x39'))[_0x30fe('0x24')](_0x3792fb,_0x948b03);}});}});case _0x30fe('0x18'):var _0x326b90=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22[_0x30fe('0x31')]){var _0x36aaf2={};_0x36aaf2[_0x2fce22[_0x30fe('0x31')]]=_0x34dd09;_[_0x30fe('0x32')](_0x326b90[_0x30fe('0x33')],_0x36aaf2);}return _0x3e3b38['sobject'](_0x30fe('0x38'))['find'](_0x326b90,_0x948b03)[_0x30fe('0x25')]();case _0x30fe('0x19'):var _0x44a91c=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22[_0x30fe('0x34')]){var _0x36aaf2={};_0x36aaf2[_0x2fce22[_0x30fe('0x34')]]=_0x34dd09;_[_0x30fe('0x32')](_0x44a91c[_0x30fe('0x33')],_0x36aaf2);}return _0x3e3b38[_0x30fe('0x23')]('Lead')[_0x30fe('0x24')](_0x44a91c,_0x948b03);case _0x30fe('0x1b'):var _0x4d2587=_[_0x30fe('0x30')](_0x24253c);if(_0x2fce22['additionalSearchAccount']){var _0x36aaf2={};_0x36aaf2[_0x2fce22[_0x30fe('0x36')]]=_0x34dd09;_[_0x30fe('0x32')](_0x4d2587[_0x30fe('0x33')],_0x36aaf2);}return _0x3e3b38[_0x30fe('0x23')](_0x30fe('0x37'))[_0x30fe('0x24')](_0x4d2587,_0x948b03);default:return null;}})[_0x30fe('0x26')](function(_0x3e48f4){if(_0x3e48f4&&_0x3e48f4[_0x30fe('0x3a')]){var _0x44a1bc=_['first'](_0x3e48f4);if(_0x44a1bc){return BPromise[_0x30fe('0x27')]({'id':_0x44a1bc['Id'],'name':_0x44a1bc[_0x30fe('0x28')],'phone':_0x44a1bc['Phone'],'endUserType':_0x44a1bc[_0x30fe('0x3b')][_0x30fe('0x3c')]['toLowerCase']()});}}})[_0x30fe('0x26')](function(_0xd4bef9){if(_0xd4bef9){logger[_0x30fe('0x1f')](_0x30fe('0x3d'),_0xd4bef9['endUserType'],_0x34dd09);return BPromise['resolve'](_0xd4bef9);}else{logger[_0x30fe('0x1f')](_0x30fe('0x3e'),_0x34dd09);var _0x4302d5={'Phone':_0x34dd09};if(_0x2fce22[_0x30fe('0x3f')]){if(_0x2fce22[_0x30fe('0x3f')]===_0x30fe('0x18')){logger['info'](_0x30fe('0x40'),_0x34dd09,_0x2fce22[_0x30fe('0x3f')]);_0x4302d5[_0x30fe('0x41')]=_0x5f3e48!==''?_0x5f3e48:util[_0x30fe('0x42')](_0x30fe('0x43'),_0x34dd09);}else if(_0x2fce22[_0x30fe('0x3f')]===_0x30fe('0x19')){logger[_0x30fe('0x1f')](_0x30fe('0x40'),_0x34dd09,_0x2fce22[_0x30fe('0x3f')]);_0x4302d5['LastName']=_0x5f3e48!==_0x30fe('0x44')?_0x5f3e48:util[_0x30fe('0x42')](_0x30fe('0x43'),_0x34dd09);_0x4302d5[_0x30fe('0x45')]=_0x30fe('0x46');}else if(_0x2fce22[_0x30fe('0x3f')]===_0x30fe('0x1b')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x34dd09,_0x2fce22['moduleCreate']);_0x4302d5[_0x30fe('0x28')]=_0x5f3e48!==_0x30fe('0x44')?_0x5f3e48:util[_0x30fe('0x42')](_0x30fe('0x43'),_0x34dd09);}else{return null;}}return _0x3e3b38[_0x30fe('0x23')](_[_0x30fe('0x47')](_0x2fce22['moduleCreate']))[_0x30fe('0x21')](_0x4302d5)[_0x30fe('0x26')](function(_0x2b68dc){return BPromise['resolve']({'id':_0x2b68dc['id'],'endUserType':_0x2fce22[_0x30fe('0x3f')]});});}});}function getCustomFields(_0x388ca8,_0x351b5f){var _0x337842={};if(_0x388ca8[_0x30fe('0x3a')]>0x0){_[_0x30fe('0x48')](_0x388ca8,function(_0x12bebe){if(_['includes'](['string','picklist'],_0x12bebe[_0x30fe('0x3c')])&&_0x12bebe[_0x30fe('0x49')]){_0x337842[_0x12bebe[_0x30fe('0x49')]]=_0x12bebe[_0x30fe('0x4a')][_0x30fe('0x4b')]();}else if(_0x12bebe[_0x30fe('0x3c')]===_0x30fe('0x4c')&&_0x12bebe[_0x30fe('0x4d')]&&_0x12bebe[_0x30fe('0x49')]){_0x351b5f[_0x12bebe[_0x30fe('0x4d')]]&&(_0x337842[_0x12bebe[_0x30fe('0x49')]]=_0x351b5f[_0x12bebe[_0x30fe('0x4d')]][_0x30fe('0x4b')]());}else if(_0x12bebe[_0x30fe('0x3c')]===_0x30fe('0x4e')&&_0x12bebe['Variable']&&_0x12bebe[_0x30fe('0x4f')][_0x30fe('0x50')]&&_0x12bebe[_0x30fe('0x49')]){_0x351b5f[_0x12bebe[_0x30fe('0x4f')][_0x30fe('0x50')][_0x30fe('0x51')]()]&&(_0x337842[_0x12bebe[_0x30fe('0x49')]]=_0x351b5f[_0x12bebe[_0x30fe('0x4f')][_0x30fe('0x50')][_0x30fe('0x51')]()]['toString']());}});}return _0x337842;}function getConnection(_0x3b28a9){var _0x4ed033=_0x3b28a9[_0x30fe('0x52')][_0x30fe('0x53')](_0x3b28a9[_0x30fe('0x54')]);var _0x189a67=new jsforce[(_0x30fe('0x55'))]({'oauth2':{'loginUrl':_0x3b28a9[_0x30fe('0x56')]||_0x30fe('0x57'),'clientId':_0x3b28a9[_0x30fe('0x58')],'clientSecret':_0x3b28a9['clientSecret']}});return _0x189a67[_0x30fe('0x59')](_0x3b28a9[_0x30fe('0x5a')],_0x4ed033)['then'](function(){logger['info'](_0x30fe('0x5b'));return _0x189a67;});}exports['queue']=function(_0x27cf6a,_0x1304a3,_0x2c3a91,_0x147bb0,_0x1c32be,_0x59ee87){var _0x517962,_0x4a6a8c,_0x292d3e,_0xd42905;_0x59ee87[_0x30fe('0x5c')]=intUtil[_0x30fe('0x5d')](_0x59ee87[_0x30fe('0x5c')]);_0x59ee87[_0x30fe('0x56')]=intUtil[_0x30fe('0x5d')](_0x59ee87[_0x30fe('0x56')]);if(_0x1c32be&&_0x1c32be[_0x30fe('0x5e')]){logger[_0x30fe('0x1f')]('[QUEUE]',_0x30fe('0x5f'));_0x1304a3[_0x30fe('0x60')]=util['format'](_0x30fe('0x61'),_0x59ee87[_0x30fe('0x5c')],_0x1304a3[_0x30fe('0x62')],md5(_0x1304a3[_0x30fe('0x62')]));}else{_0x1304a3['recordingURL']='';}return getConnection(_0x59ee87)[_0x30fe('0x26')](function(_0x18fb40){_0xd42905=_0x18fb40;return getUser(_0x59ee87,_0x147bb0[_0x30fe('0x63')],_0xd42905);})[_0x30fe('0x26')](function(_0x319eef){_0x517962=_0x319eef;return getEndUser(_0x59ee87,_0x2c3a91,_0x1304a3[_0x30fe('0x64')],_0x1304a3['calleridnum'],_0xd42905);})[_0x30fe('0x26')](function(_0x410425){_0x4a6a8c=_0x410425;return getTicket(_0x59ee87,_0x517962,_0x4a6a8c,_0x2c3a91,_0x1304a3,_0x2c3a91[_0x30fe('0x65')],_0xd42905,'queue');})[_0x30fe('0x26')](function(_0x84348f){_0x292d3e=_0x84348f;logger[_0x30fe('0x1f')](_0x30fe('0x66'),_0x292d3e['id']);logger[_0x30fe('0x1f')](_0x30fe('0x67'),_0x292d3e['id'],_0x147bb0[_0x30fe('0x50')],_0x59ee87[_0x30fe('0x3c')]);switch(_0x59ee87['type']){case _0x30fe('0x68'):emit(util[_0x30fe('0x42')]('user:%s',_0x147bb0['name']),_0x30fe('0x69'),{'recordId':_0x292d3e['id']});break;case _0x30fe('0x6a'):emit(util['format'](_0x30fe('0x6b'),_0x147bb0[_0x30fe('0x50')]),_0x30fe('0x6c'),{'uri':util[_0x30fe('0x42')](_0x30fe('0x6d'),_0xd42905[_0x30fe('0x6e')],_0x292d3e['id'])});break;default:logger[_0x30fe('0x6f')](_0x30fe('0x70'));}})[_0x30fe('0x71')](function(_0x2f5436){logger[_0x30fe('0x6f')](_0x30fe('0x72'),_0x2f5436);});};exports['outbound']=function(_0x4f34f4,_0x4187d6,_0x1e1c38,_0x527c46,_0x411070,_0x849932,_0x40d175){var _0x5c2bae,_0x199227,_0x183a17,_0x2808b4;_0x849932['serverUrl']=intUtil[_0x30fe('0x5d')](_0x849932[_0x30fe('0x5c')]);_0x849932[_0x30fe('0x56')]=intUtil[_0x30fe('0x5d')](_0x849932['remoteUri']);if(_0x40d175&&_0x40d175[_0x30fe('0x73')]&&_0x40d175[_0x30fe('0x73')]!=='none'){logger[_0x30fe('0x1f')](_0x30fe('0x74'),'Recording\x20is\x20enabled!');_0x4187d6[_0x30fe('0x60')]=util['format'](_0x30fe('0x61'),_0x849932[_0x30fe('0x5c')],_0x4187d6['uniqueid'],md5(_0x4187d6['uniqueid']));}return getConnection(_0x849932)[_0x30fe('0x26')](function(_0x370f00){_0x2808b4=_0x370f00;return getUser(_0x849932,_0x527c46[_0x30fe('0x63')],_0x2808b4);})['then'](function(_0xb473ec){_0x5c2bae=_0xb473ec;return getEndUser(_0x849932,_0x1e1c38,_0x4187d6[_0x30fe('0x75')],_0x4187d6[_0x30fe('0x76')],_0x2808b4);})['then'](function(_0x25eff2){_0x199227=_0x25eff2;return getTicket(_0x849932,_0x5c2bae,_0x199227,_0x1e1c38,_0x4187d6,_0x1e1c38[_0x30fe('0x65')],_0x2808b4,_0x30fe('0x77'));})[_0x30fe('0x26')](function(_0x1cfba4){_0x183a17=_0x1cfba4;logger[_0x30fe('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x183a17['id']);logger['info'](_0x30fe('0x78'),_0x183a17['id'],_0x527c46[_0x30fe('0x50')],_0x849932['type']);switch(_0x849932['type']){case _0x30fe('0x68'):emit(util[_0x30fe('0x42')]('user:%s',_0x527c46[_0x30fe('0x50')]),_0x30fe('0x69'),{'recordId':_0x183a17['id']});break;case _0x30fe('0x6a'):emit(util['format'](_0x30fe('0x6b'),_0x527c46[_0x30fe('0x50')]),_0x30fe('0x6c'),{'uri':util[_0x30fe('0x42')](_0x30fe('0x6d'),_0x2808b4[_0x30fe('0x6e')],_0x183a17['id'])});break;default:logger['error']('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x30fe('0x71')](function(_0x260c5f){logger['error'](_0x30fe('0x74'),_0x260c5f);});};exports[_0x30fe('0x79')]=function(_0x57866d,_0x435308,_0x3f3e58,_0x2f59de,_0x1e9229,_0x4095ed){var _0x4e14ae,_0x1143cc,_0x45d8f9,_0x458b04;_0x4095ed[_0x30fe('0x5c')]=intUtil[_0x30fe('0x5d')](_0x4095ed['serverUrl']);_0x4095ed[_0x30fe('0x56')]=intUtil[_0x30fe('0x5d')](_0x4095ed['remoteUri']);if(_0x1e9229&&_0x1e9229[_0x30fe('0x5e')]){logger['info']('['+_0x435308[_0x30fe('0x7a')][_0x30fe('0x7b')]()+']',_0x30fe('0x5f'));_0x435308[_0x30fe('0x60')]=util[_0x30fe('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4095ed[_0x30fe('0x5c')],_0x435308[_0x30fe('0x62')],md5(_0x435308[_0x30fe('0x62')]));}else{_0x435308['recordingURL']='';}return getConnection(_0x4095ed)[_0x30fe('0x26')](function(_0x3c9fa5){_0x458b04=_0x3c9fa5;if(!_[_0x30fe('0x22')](_0x2f59de)){return getUser(_0x4095ed,_0x2f59de[_0x30fe('0x50')],_0x458b04);}else{return getUser(_0x4095ed,null,_0x458b04);}})[_0x30fe('0x26')](function(_0x461a47){_0x4e14ae=_0x461a47;return getEndUser(_0x4095ed,_0x3f3e58,_0x435308[_0x30fe('0x64')],_0x435308['calleridnum'],_0x458b04);})[_0x30fe('0x26')](function(_0x522e10){_0x1143cc=_0x522e10;return getTicket(_0x4095ed,_0x4e14ae,_0x1143cc,_0x3f3e58,_0x435308,_0x3f3e58[_0x30fe('0x65')],_0x458b04);})[_0x30fe('0x26')](function(_0x532dd9){_0x45d8f9=_0x532dd9;logger[_0x30fe('0x1f')]('['+_0x435308[_0x30fe('0x7a')][_0x30fe('0x7b')]()+_0x30fe('0x7c'),_0x45d8f9['id']);logger['info']('['+_0x435308[_0x30fe('0x7a')][_0x30fe('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4095ed[_0x30fe('0x3c')]);})[_0x30fe('0x71')](function(_0x2c8fe5){logger['error']('['+_0x435308[_0x30fe('0x7a')][_0x30fe('0x7b')]()+']',_0x2c8fe5);});}; \ No newline at end of file +var _0xcec8=['[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Account','Lead','first','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','toLowerCase','name','password','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','%s/%s/e','instanceUrl','catch','error','recordingFormat','destcalleridname','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcec8,0x178));var _0x8cec=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xcec8[_0x27dba4];return _0x35ec9d;};'use strict';var _=require('lodash');var rp=require(_0x8cec('0x0'));var moment=require(_0x8cec('0x1'));var BPromise=require('bluebird');var md5=require(_0x8cec('0x2'));var jsforce=require(_0x8cec('0x3'));var util=require(_0x8cec('0x4'));var Redis=require('ioredis');var intUtil=require(_0x8cec('0x5'));var config=require(_0x8cec('0x6'));var logger=require(_0x8cec('0x7'))('salesforce');config[_0x8cec('0x8')]=_['defaults'](config['redis'],{'host':_0x8cec('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8cec('0x8')]));function emit(_0xaa213b,_0x408614,_0x29e3b1){io['to'](_0xaa213b)['emit'](_0x408614,_0x29e3b1);}function getTicket(_0x4ffb5b,_0x3d9be8,_0x1a8c4f,_0x44b875,_0x5f0ee6,_0x5357d2,_0x30177e,_0x456b64){var _0x51f6dd=Object[_0x8cec('0xa')]({},{'OwnerId':_0x3d9be8['id'],'Subject':intUtil[_0x8cec('0xb')](_0x44b875[_0x8cec('0xc')],_0x5f0ee6,'\x20'),'Description':intUtil['getString'](_0x44b875[_0x8cec('0xd')],_0x5f0ee6,'\x0a')},getCustomFields(_0x5357d2,_0x5f0ee6));if(_0x1a8c4f){if(_0x44b875['ticketType']===_0x8cec('0xe')){_0x51f6dd[_0x8cec('0xf')]=moment[_0x8cec('0x10')]();_0x51f6dd['IsReminderSet']=![];_0x51f6dd[_0x8cec('0x11')]=![];if(_0x1a8c4f[_0x8cec('0x12')]===_0x8cec('0x13')||_0x1a8c4f[_0x8cec('0x12')]===_0x8cec('0x14')){_0x51f6dd[_0x8cec('0x15')]=_0x1a8c4f['id'];}else if(_0x1a8c4f['endUserType']===_0x8cec('0x16')){_0x51f6dd['WhatId']=_0x1a8c4f['id'];}}else if(_0x44b875[_0x8cec('0x17')]===_0x8cec('0x18')){if(_0x1a8c4f['endUserType']===_0x8cec('0x13')){_0x51f6dd[_0x8cec('0x19')]=_0x1a8c4f['id'];}else if(_0x1a8c4f['endUserType']===_0x8cec('0x16')){_0x51f6dd[_0x8cec('0x1a')]=_0x1a8c4f['id'];}else if(_0x1a8c4f[_0x8cec('0x12')]==='lead'&&_0x44b875[_0x8cec('0x1b')]){_0x51f6dd[_0x44b875['leadId']]=_0x1a8c4f['id'];}else{logger[_0x8cec('0x1c')](_0x8cec('0x1d'));}}}return _0x30177e[_0x8cec('0x1e')](_0x44b875[_0x8cec('0x17')])[_0x8cec('0x1f')](_0x51f6dd);}function getUser(_0xd53e94,_0x2166b3,_0x10d219){if(!_[_0x8cec('0x20')](_0x2166b3)&&intUtil[_0x8cec('0x21')](_0x2166b3)){var _0x5c1f5e={'Email':_0x2166b3};var _0x18e640={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x10d219[_0x8cec('0x1e')](_0x8cec('0x22'))[_0x8cec('0x23')](_0x5c1f5e,_0x18e640)[_0x8cec('0x24')]()['then'](function(_0x26fa77){if(_0x26fa77[_0x8cec('0x25')]){var _0x8ad317=_[_0x8cec('0x23')](_0x26fa77,function(_0x21931f){return _0x21931f[_0x8cec('0x26')]===_0x2166b3;});if(_0x8ad317){logger['info'](_0x8cec('0x27'),_0x2166b3);return BPromise[_0x8cec('0x28')]({'id':_0x8ad317['Id'],'name':_0x8ad317[_0x8cec('0x29')]});}}else{logger[_0x8cec('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2166b3);return _0x10d219[_0x8cec('0x2a')]()[_0x8cec('0x2b')](function(_0xd08962){return BPromise[_0x8cec('0x28')]({'id':_0xd08962[_0x8cec('0x2c')],'name':_0xd08962['display_name']});});}});}else{logger['info'](_0x8cec('0x2d'),_0x2166b3);return _0x10d219[_0x8cec('0x2a')]()[_0x8cec('0x2b')](function(_0x3b2fb7){return BPromise[_0x8cec('0x28')]({'id':_0x3b2fb7['user_id'],'name':_0x3b2fb7['display_name']});});}}function getEndUser(_0x1af6ca,_0x2fb405,_0x5986a4,_0x219e9a,_0x5a3e90){var _0x55063c={'$or':{'Phone':_0x219e9a}};var _0x5dae49={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8cec('0x28')]()[_0x8cec('0x2b')](function(){logger[_0x8cec('0x1c')](_0x8cec('0x2e'),_0x219e9a,_0x2fb405['moduleSearch']);switch(_0x2fb405['moduleSearch']){case _0x8cec('0x2f'):var _0x32ea4f=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405[_0x8cec('0x31')]){var _0x5a676d={};_0x5a676d[_0x2fb405[_0x8cec('0x31')]]=_0x219e9a;_['merge'](_0x32ea4f[_0x8cec('0x32')],_0x5a676d);}return _0x5a3e90['sobject'](_0x8cec('0x33'))[_0x8cec('0x23')](_0x32ea4f,_0x5dae49)['execute']()[_0x8cec('0x2b')](function(_0x67cb3a){if(_0x67cb3a&&_0x67cb3a[_0x8cec('0x25')]){return _0x67cb3a;}else{var _0x4e770f=_['cloneDeep'](_0x55063c);if(_0x2fb405[_0x8cec('0x34')]){var _0x4fba8a={};_0x4fba8a[_0x2fb405[_0x8cec('0x34')]]=_0x219e9a;_[_0x8cec('0x35')](_0x4e770f[_0x8cec('0x32')],_0x4fba8a);}return _0x5a3e90['sobject']('Lead')['find'](_0x4e770f,_0x5dae49);}});case _0x8cec('0x36'):var _0x1c5805=_['cloneDeep'](_0x55063c);if(_0x2fb405[_0x8cec('0x37')]){var _0x5a676d={};_0x5a676d[_0x2fb405[_0x8cec('0x37')]]=_0x219e9a;_[_0x8cec('0x35')](_0x1c5805['$or'],_0x5a676d);}return _0x5a3e90[_0x8cec('0x1e')](_0x8cec('0x38'))['find'](_0x1c5805,_0x5dae49)[_0x8cec('0x24')]()[_0x8cec('0x2b')](function(_0x1bbb5b){if(_0x1bbb5b&&_0x1bbb5b[_0x8cec('0x25')]){return _0x1bbb5b;}else{var _0x1fc3af=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405['additionalSearchContact']){var _0x50af50={};_0x50af50[_0x2fb405[_0x8cec('0x31')]]=_0x219e9a;_['merge'](_0x1fc3af[_0x8cec('0x32')],_0x50af50);}return _0x5a3e90['sobject'](_0x8cec('0x33'))[_0x8cec('0x23')](_0x1fc3af,_0x5dae49)[_0x8cec('0x2b')](function(_0x1b2d2c){if(_0x1b2d2c&&_0x1b2d2c[_0x8cec('0x25')]){return _0x1b2d2c;}else{var _0x97c56e=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405['additionalSearchLead']){var _0x359314={};_0x359314[_0x2fb405[_0x8cec('0x34')]]=_0x219e9a;_['merge'](_0x97c56e[_0x8cec('0x32')],_0x359314);}return _0x5a3e90[_0x8cec('0x1e')](_0x8cec('0x39'))[_0x8cec('0x23')](_0x97c56e,_0x5dae49);}});}});case _0x8cec('0x13'):var _0x32ea4f=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405[_0x8cec('0x31')]){var _0x5a676d={};_0x5a676d[_0x2fb405[_0x8cec('0x31')]]=_0x219e9a;_[_0x8cec('0x35')](_0x32ea4f[_0x8cec('0x32')],_0x5a676d);}return _0x5a3e90[_0x8cec('0x1e')](_0x8cec('0x33'))[_0x8cec('0x23')](_0x32ea4f,_0x5dae49)['execute']();case'lead':var _0x1e1232=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405[_0x8cec('0x34')]){var _0x5a676d={};_0x5a676d[_0x2fb405[_0x8cec('0x34')]]=_0x219e9a;_['merge'](_0x1e1232['$or'],_0x5a676d);}return _0x5a3e90[_0x8cec('0x1e')](_0x8cec('0x39'))[_0x8cec('0x23')](_0x1e1232,_0x5dae49);case _0x8cec('0x16'):var _0x1c5805=_[_0x8cec('0x30')](_0x55063c);if(_0x2fb405[_0x8cec('0x37')]){var _0x5a676d={};_0x5a676d[_0x2fb405[_0x8cec('0x37')]]=_0x219e9a;_[_0x8cec('0x35')](_0x1c5805[_0x8cec('0x32')],_0x5a676d);}return _0x5a3e90[_0x8cec('0x1e')](_0x8cec('0x38'))[_0x8cec('0x23')](_0x1c5805,_0x5dae49);default:return null;}})[_0x8cec('0x2b')](function(_0x2bbdc9){if(_0x2bbdc9&&_0x2bbdc9[_0x8cec('0x25')]){var _0x180c38=_[_0x8cec('0x3a')](_0x2bbdc9);if(_0x180c38){return BPromise[_0x8cec('0x28')]({'id':_0x180c38['Id'],'name':_0x180c38['Name'],'phone':_0x180c38['Phone'],'endUserType':_0x180c38[_0x8cec('0x3b')]['type']['toLowerCase']()});}}})['then'](function(_0x4467a7){if(_0x4467a7){logger[_0x8cec('0x1c')](_0x8cec('0x3c'),_0x4467a7[_0x8cec('0x12')],_0x219e9a);return BPromise[_0x8cec('0x28')](_0x4467a7);}else{logger[_0x8cec('0x1c')](_0x8cec('0x3d'),_0x219e9a);var _0xf6eecf={'Phone':_0x219e9a};if(_0x2fb405['moduleCreate']){if(_0x2fb405[_0x8cec('0x3e')]===_0x8cec('0x13')){logger[_0x8cec('0x1c')](_0x8cec('0x3f'),_0x219e9a,_0x2fb405[_0x8cec('0x3e')]);_0xf6eecf['LastName']=_0x5986a4!==_0x8cec('0x40')?_0x5986a4:util[_0x8cec('0x41')](_0x8cec('0x42'),_0x219e9a);}else if(_0x2fb405['moduleCreate']===_0x8cec('0x14')){logger[_0x8cec('0x1c')](_0x8cec('0x3f'),_0x219e9a,_0x2fb405['moduleCreate']);_0xf6eecf[_0x8cec('0x43')]=_0x5986a4!==_0x8cec('0x40')?_0x5986a4:util['format'](_0x8cec('0x42'),_0x219e9a);_0xf6eecf[_0x8cec('0x44')]=_0x8cec('0x45');}else if(_0x2fb405[_0x8cec('0x3e')]===_0x8cec('0x16')){logger[_0x8cec('0x1c')](_0x8cec('0x3f'),_0x219e9a,_0x2fb405['moduleCreate']);_0xf6eecf[_0x8cec('0x29')]=_0x5986a4!==_0x8cec('0x40')?_0x5986a4:util[_0x8cec('0x41')](_0x8cec('0x42'),_0x219e9a);}else{return null;}}return _0x5a3e90['sobject'](_['upperFirst'](_0x2fb405['moduleCreate']))['create'](_0xf6eecf)[_0x8cec('0x2b')](function(_0xe55575){return BPromise[_0x8cec('0x28')]({'id':_0xe55575['id'],'endUserType':_0x2fb405[_0x8cec('0x3e')]});});}});}function getCustomFields(_0xbd8932,_0x392db1){var _0x209c08={};if(_0xbd8932[_0x8cec('0x25')]>0x0){_['forEach'](_0xbd8932,function(_0x178f6b){if(_[_0x8cec('0x46')]([_0x8cec('0x47'),_0x8cec('0x48')],_0x178f6b[_0x8cec('0x49')])&&_0x178f6b[_0x8cec('0x4a')]){_0x209c08[_0x178f6b[_0x8cec('0x4a')]]=_0x178f6b[_0x8cec('0x4b')][_0x8cec('0x4c')]();}else if(_0x178f6b[_0x8cec('0x49')]==='variable'&&_0x178f6b['variableName']&&_0x178f6b[_0x8cec('0x4a')]){_0x392db1[_0x178f6b['variableName']]&&(_0x209c08[_0x178f6b['idField']]=_0x392db1[_0x178f6b[_0x8cec('0x4d')]][_0x8cec('0x4c')]());}else if(_0x178f6b[_0x8cec('0x49')]===_0x8cec('0x4e')&&_0x178f6b[_0x8cec('0x4f')]&&_0x178f6b[_0x8cec('0x4f')]['name']&&_0x178f6b[_0x8cec('0x4a')]){_0x392db1[_0x178f6b[_0x8cec('0x4f')]['name'][_0x8cec('0x50')]()]&&(_0x209c08[_0x178f6b[_0x8cec('0x4a')]]=_0x392db1[_0x178f6b['Variable'][_0x8cec('0x51')][_0x8cec('0x50')]()]['toString']());}});}return _0x209c08;}function getConnection(_0x2b6071){var _0x384997=_0x2b6071[_0x8cec('0x52')]['concat'](_0x2b6071[_0x8cec('0x53')]);var _0x4c5609=new jsforce[(_0x8cec('0x54'))]({'oauth2':{'loginUrl':_0x2b6071[_0x8cec('0x55')]||'https://login.salesforce.com','clientId':_0x2b6071[_0x8cec('0x56')],'clientSecret':_0x2b6071[_0x8cec('0x57')]}});return _0x4c5609[_0x8cec('0x58')](_0x2b6071[_0x8cec('0x59')],_0x384997)[_0x8cec('0x2b')](function(){logger['info'](_0x8cec('0x5a'));return _0x4c5609;});}exports[_0x8cec('0x5b')]=function(_0x8965df,_0x142827,_0x2d1478,_0x583f89,_0x504337,_0x3229ef){var _0x31b38f,_0x5826c8,_0xbf7fa5,_0xe212e7;_0x3229ef[_0x8cec('0x5c')]=intUtil[_0x8cec('0x5d')](_0x3229ef['serverUrl']);_0x3229ef[_0x8cec('0x55')]=intUtil['stripTrailingSlash'](_0x3229ef[_0x8cec('0x55')]);if(_0x504337&&_0x504337['monitor_format']){logger[_0x8cec('0x1c')]('[QUEUE]',_0x8cec('0x5e'));_0x142827[_0x8cec('0x5f')]=util[_0x8cec('0x41')](_0x8cec('0x60'),_0x3229ef[_0x8cec('0x5c')],_0x142827[_0x8cec('0x61')],md5(_0x142827['uniqueid']));}else{_0x142827[_0x8cec('0x5f')]='';}return getConnection(_0x3229ef)[_0x8cec('0x2b')](function(_0x42a6c2){_0xe212e7=_0x42a6c2;return getUser(_0x3229ef,_0x583f89[_0x8cec('0x62')],_0xe212e7);})['then'](function(_0xf52b77){_0x31b38f=_0xf52b77;return getEndUser(_0x3229ef,_0x2d1478,_0x142827['calleridname'],_0x142827[_0x8cec('0x63')],_0xe212e7);})[_0x8cec('0x2b')](function(_0xf016ad){_0x5826c8=_0xf016ad;return getTicket(_0x3229ef,_0x31b38f,_0x5826c8,_0x2d1478,_0x142827,_0x2d1478[_0x8cec('0x64')],_0xe212e7,_0x8cec('0x5b'));})['then'](function(_0x45e9ae){_0xbf7fa5=_0x45e9ae;logger[_0x8cec('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0xbf7fa5['id']);logger['info'](_0x8cec('0x65'),_0xbf7fa5['id'],_0x583f89['name'],_0x3229ef[_0x8cec('0x49')]);switch(_0x3229ef['type']){case'integrationTab':emit(util['format'](_0x8cec('0x66'),_0x583f89[_0x8cec('0x51')]),_0x8cec('0x67'),{'recordId':_0xbf7fa5['id']});break;case'newTab':emit(util[_0x8cec('0x41')](_0x8cec('0x66'),_0x583f89[_0x8cec('0x51')]),'trigger:browser:url',{'uri':util[_0x8cec('0x41')](_0x8cec('0x68'),_0xe212e7[_0x8cec('0x69')],_0xbf7fa5['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8cec('0x6a')](function(_0x34fa77){logger[_0x8cec('0x6b')]('[QUEUE]',_0x34fa77);});};exports['outbound']=function(_0x28e56d,_0x1603e3,_0x128c86,_0x5c2b23,_0x437890,_0x50de54,_0x59fe57){var _0x4452f8,_0x294900,_0x252025,_0x4a3a1f;_0x50de54[_0x8cec('0x5c')]=intUtil[_0x8cec('0x5d')](_0x50de54[_0x8cec('0x5c')]);_0x50de54[_0x8cec('0x55')]=intUtil['stripTrailingSlash'](_0x50de54['remoteUri']);if(_0x59fe57&&_0x59fe57[_0x8cec('0x6c')]&&_0x59fe57['recordingFormat']!=='none'){logger[_0x8cec('0x1c')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1603e3['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x50de54['serverUrl'],_0x1603e3[_0x8cec('0x61')],md5(_0x1603e3['uniqueid']));}return getConnection(_0x50de54)[_0x8cec('0x2b')](function(_0x59fae1){_0x4a3a1f=_0x59fae1;return getUser(_0x50de54,_0x5c2b23[_0x8cec('0x62')],_0x4a3a1f);})['then'](function(_0x559e7f){_0x4452f8=_0x559e7f;return getEndUser(_0x50de54,_0x128c86,_0x1603e3[_0x8cec('0x6d')],_0x1603e3['destcalleridnum'],_0x4a3a1f);})[_0x8cec('0x2b')](function(_0x2e9cee){_0x294900=_0x2e9cee;return getTicket(_0x50de54,_0x4452f8,_0x294900,_0x128c86,_0x1603e3,_0x128c86['Fields'],_0x4a3a1f,_0x8cec('0x6e'));})['then'](function(_0x29fa77){_0x252025=_0x29fa77;logger[_0x8cec('0x1c')](_0x8cec('0x6f'),_0x252025['id']);logger[_0x8cec('0x1c')](_0x8cec('0x70'),_0x252025['id'],_0x5c2b23[_0x8cec('0x51')],_0x50de54[_0x8cec('0x49')]);switch(_0x50de54[_0x8cec('0x49')]){case _0x8cec('0x71'):emit(util['format'](_0x8cec('0x66'),_0x5c2b23[_0x8cec('0x51')]),_0x8cec('0x67'),{'recordId':_0x252025['id']});break;case'newTab':emit(util[_0x8cec('0x41')](_0x8cec('0x66'),_0x5c2b23[_0x8cec('0x51')]),'trigger:browser:url',{'uri':util[_0x8cec('0x41')](_0x8cec('0x68'),_0x4a3a1f[_0x8cec('0x69')],_0x252025['id'])});break;default:logger[_0x8cec('0x6b')]('[OUTBOUND]',_0x8cec('0x72'));}})[_0x8cec('0x6a')](function(_0x33640c){logger[_0x8cec('0x6b')]('[OUTBOUND]',_0x33640c);});};exports[_0x8cec('0x73')]=function(_0x33aafd,_0x4c7f44,_0x552bb3,_0x3935cc,_0x33fba5,_0x3a9f76){var _0x42f37a,_0x3ab45c,_0x4ee69e,_0x1a03be;_0x3a9f76[_0x8cec('0x5c')]=intUtil['stripTrailingSlash'](_0x3a9f76['serverUrl']);_0x3a9f76[_0x8cec('0x55')]=intUtil['stripTrailingSlash'](_0x3a9f76[_0x8cec('0x55')]);if(_0x33fba5&&_0x33fba5[_0x8cec('0x74')]){logger[_0x8cec('0x1c')]('['+_0x4c7f44[_0x8cec('0x75')][_0x8cec('0x76')]()+']',_0x8cec('0x5e'));_0x4c7f44[_0x8cec('0x5f')]=util[_0x8cec('0x41')](_0x8cec('0x60'),_0x3a9f76[_0x8cec('0x5c')],_0x4c7f44[_0x8cec('0x61')],md5(_0x4c7f44[_0x8cec('0x61')]));}else{_0x4c7f44[_0x8cec('0x5f')]='';}return getConnection(_0x3a9f76)[_0x8cec('0x2b')](function(_0x176b67){_0x1a03be=_0x176b67;if(!_[_0x8cec('0x20')](_0x3935cc)){return getUser(_0x3a9f76,_0x3935cc[_0x8cec('0x51')],_0x1a03be);}else{return getUser(_0x3a9f76,null,_0x1a03be);}})[_0x8cec('0x2b')](function(_0x31a98c){_0x42f37a=_0x31a98c;return getEndUser(_0x3a9f76,_0x552bb3,_0x4c7f44[_0x8cec('0x77')],_0x4c7f44['calleridnum'],_0x1a03be);})[_0x8cec('0x2b')](function(_0x1fc86a){_0x3ab45c=_0x1fc86a;return getTicket(_0x3a9f76,_0x42f37a,_0x3ab45c,_0x552bb3,_0x4c7f44,_0x552bb3[_0x8cec('0x64')],_0x1a03be);})[_0x8cec('0x2b')](function(_0x535fa9){_0x4ee69e=_0x535fa9;logger['info']('['+_0x4c7f44[_0x8cec('0x75')][_0x8cec('0x76')]()+_0x8cec('0x78'),_0x4ee69e['id']);logger[_0x8cec('0x1c')]('['+_0x4c7f44['lastevent']['toUpperCase']()+_0x8cec('0x79'),_0x3a9f76[_0x8cec('0x49')]);})[_0x8cec('0x6a')](function(_0x1d856b){logger[_0x8cec('0x6b')]('['+_0x4c7f44[_0x8cec('0x75')][_0x8cec('0x76')]()+']',_0x1d856b);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 01bc802..e8b832a 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0e4=['stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','type','nameField','customField','toLowerCase','content','includes','picklist','idField','variableName','toString','Variable','name','outbound','POST','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri'];(function(_0x5d0849,_0x40666b){var _0x1c5c26=function(_0x5832be){while(--_0x5832be){_0x5d0849['push'](_0x5d0849['shift']());}};_0x1c5c26(++_0x40666b);}(_0xa0e4,0x87));var _0x4a0e=function(_0x127728,_0x11c9c5){_0x127728=_0x127728-0x0;var _0x3b6cfe=_0xa0e4[_0x127728];return _0x3b6cfe;};'use strict';var _=require(_0x4a0e('0x0'));var Promise=require(_0x4a0e('0x1'));var rp=require(_0x4a0e('0x2'));var util=require(_0x4a0e('0x3'));var md5=require(_0x4a0e('0x4'));var Redis=require(_0x4a0e('0x5'));var intUtil=require(_0x4a0e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x4a0e('0x7'))(_0x4a0e('0x8'));config[_0x4a0e('0x9')]=_['defaults'](config[_0x4a0e('0x9')],{'host':_0x4a0e('0xa'),'port':0x18eb});var io=require(_0x4a0e('0xb'))(new Redis(config[_0x4a0e('0x9')]));function getAdminUser(_0x4b2234,_0xf43001,_0x2b9780,_0x235e53,_0x3f3eb8,_0xc7cee9){return new Promise(function(_0x46a38d,_0x33df9f){var _0x5b0751={'method':'GET','uri':_0x235e53+_0x4a0e('0xc')+'&'+_0x3f3eb8+'&'+_0xc7cee9,'auth':_0xf43001,'json':!![]};return rp(_0x5b0751)[_0x4a0e('0xd')](function(_0x358eb0){if(_0x358eb0[_0x4a0e('0xe')]['length']>0x0){_0x2b9780[_0x4a0e('0xf')]=_0x358eb0[_0x4a0e('0xe')][0x0][_0x4a0e('0x10')];}logger[_0x4a0e('0x11')]('['+[_0x4b2234[_0x4a0e('0x12')]()]+_0x4a0e('0x13'),_0x2b9780);_0x46a38d(_0x2b9780);})[_0x4a0e('0x14')](function(_0x11ae16){logger['error']('['+[_0x4b2234[_0x4a0e('0x12')]()]+']',_0x11ae16[_0x4a0e('0x15')]);_0x33df9f(_0x11ae16[_0x4a0e('0x15')]);});});}function getUser(_0x40f5cf,_0x106ceb,_0x2b6925,_0x4f9848,_0x567ae1){return function(_0x3f85fe){logger[_0x4a0e('0x11')]('['+[_0x40f5cf[_0x4a0e('0x12')]()]+_0x4a0e('0x16'),_0x3f85fe);return new Promise(function(_0x3d88b1,_0xf4230d){if(intUtil[_0x4a0e('0x17')](_0x3f85fe['userEmail'])){var _0x415727={'method':_0x4a0e('0x18'),'uri':_0x2b6925+_0x4a0e('0x19')+_0x3f85fe[_0x4a0e('0x1a')]+'&'+_0x4f9848+'&'+_0x567ae1,'auth':_0x106ceb,'json':!![]};logger['info']('['+[_0x40f5cf[_0x4a0e('0x12')]()]+_0x4a0e('0x1b'),_0x415727);return rp(_0x415727)[_0x4a0e('0xd')](function(_0x4b0f5c){logger[_0x4a0e('0x11')]('['+[_0x40f5cf[_0x4a0e('0x12')]()]+_0x4a0e('0x1c'),_0x4b0f5c);if(_0x4b0f5c[_0x4a0e('0xe')][_0x4a0e('0x1d')]>0x0&&String(_0x4b0f5c['result'][0x0]['active'])===_0x4a0e('0x1e')){_0x3f85fe[_0x4a0e('0x1f')]=_0x4b0f5c[_0x4a0e('0xe')][0x0][_0x4a0e('0x10')];}else{_0x3f85fe['userId']=_0x3f85fe[_0x4a0e('0xf')];_0x3f85fe[_0x4a0e('0x1a')]=_0x3f85fe['adminEmail'];}logger['info']('['+[_0x40f5cf[_0x4a0e('0x12')]()]+_0x4a0e('0x20'),_0x3f85fe);_0x3d88b1(_0x3f85fe);})[_0x4a0e('0x14')](function(_0x2c5143){logger['error']('['+[_0x40f5cf['toUpperCase']()]+']',_0x2c5143[_0x4a0e('0x15')]);_0xf4230d(_0x2c5143[_0x4a0e('0x15')]);});}else{logger[_0x4a0e('0x11')]('['+[_0x40f5cf[_0x4a0e('0x12')]()]+_0x4a0e('0x21'));_0x3f85fe[_0x4a0e('0x1f')]=_0x3f85fe[_0x4a0e('0xf')];_0x3f85fe[_0x4a0e('0x1a')]=_0x3f85fe[_0x4a0e('0x22')];_0x3d88b1(_0x3f85fe);}});};}function createEndUser(_0x5ea742,_0x23a338,_0x1b112d,_0x114bdf,_0x58b5f0){logger[_0x4a0e('0x11')]('['+[_0x5ea742['toUpperCase']()]+_0x4a0e('0x23'),_0x1b112d);return new Promise(function(_0x46bbc0,_0x26a33d){var _0xc12a43={'method':'POST','uri':_0x114bdf+_0x4a0e('0x24')+_0x58b5f0,'body':{'user_name':_0x1b112d[_0x4a0e('0x25')],'roles':_0x4a0e('0x26'),'first_name':_0x1b112d[_0x4a0e('0x25')],'active':'true','date_format':_0x4a0e('0x27'),'phone':_0x1b112d[_0x4a0e('0x25')]},'auth':_0x23a338,'json':!![]};return rp(_0xc12a43)[_0x4a0e('0xd')](function(_0x2b8e9f){logger['info']('['+[_0x5ea742[_0x4a0e('0x12')]()]+_0x4a0e('0x28'),_0x2b8e9f[_0x4a0e('0xe')]);_0x1b112d[_0x4a0e('0x29')]=_0x2b8e9f[_0x4a0e('0xe')][_0x4a0e('0x10')];_0x46bbc0(_0x1b112d);})[_0x4a0e('0x14')](function(_0x155860){logger[_0x4a0e('0x2a')]('['+[_0x5ea742[_0x4a0e('0x12')]()]+']',_0x155860['message']);_0x26a33d(_0x155860[_0x4a0e('0x15')]);});});}function getEndUser(_0x26d7d2,_0x51142c,_0x11b259,_0xdc293e,_0x5c7832){return function(_0x25f8bb){logger[_0x4a0e('0x11')]('['+[_0x26d7d2[_0x4a0e('0x12')]()]+_0x4a0e('0x2b'),_0x25f8bb);return new Promise(function(_0x547203,_0x4817d8){var _0x19de93={'method':_0x4a0e('0x18'),'uri':_0x11b259+_0x4a0e('0x2c')+_0x25f8bb[_0x4a0e('0x25')]+'&'+_0xdc293e+'&'+_0x5c7832,'auth':_0x51142c,'json':!![]};return rp(_0x19de93)['then'](function(_0x5be4db){if(_0x5be4db[_0x4a0e('0xe')]['length']>0x0){_0x25f8bb['endUserId']=_0x5be4db[_0x4a0e('0xe')][0x0][_0x4a0e('0x10')];logger[_0x4a0e('0x11')]('['+[_0x26d7d2[_0x4a0e('0x12')]()]+'],\x20getEndUser\x20crm',_0x25f8bb);_0x547203(_0x25f8bb);}else{return createEndUser(_0x26d7d2,_0x51142c,_0x25f8bb,_0x11b259,_0xdc293e)['then'](function(_0x4ee496){logger[_0x4a0e('0x11')]('['+[_0x26d7d2[_0x4a0e('0x12')]()]+_0x4a0e('0x2d'),_0x4ee496);_0x547203(_0x4ee496);});}})[_0x4a0e('0x14')](function(_0x164132){logger[_0x4a0e('0x2a')]('['+[_0x26d7d2[_0x4a0e('0x12')]()]+']',_0x164132['message']);_0x4817d8(_0x164132[_0x4a0e('0x15')]);});});};}function getCustomFields(_0xc7ace4,_0x34674a){var _0x58d066={};if(_0xc7ace4[_0x4a0e('0x1d')]>0x0){_[_0x4a0e('0x2e')](_0xc7ace4,function(_0x3588ea){if(_['includes']([_0x4a0e('0x2f'),'picklist'],_0x3588ea[_0x4a0e('0x30')])&&_0x3588ea[_0x4a0e('0x31')]&&!_0x3588ea[_0x4a0e('0x32')]){_0x58d066[_0x3588ea[_0x4a0e('0x31')][_0x4a0e('0x33')]()]=_0x3588ea[_0x4a0e('0x34')]['toString']();}else if(_[_0x4a0e('0x35')]([_0x4a0e('0x2f'),_0x4a0e('0x36')],_0x3588ea[_0x4a0e('0x30')])&&_0x3588ea[_0x4a0e('0x37')]&&_0x3588ea[_0x4a0e('0x32')]){_0x58d066[_0x3588ea[_0x4a0e('0x37')]['toLowerCase']()]=_0x3588ea[_0x4a0e('0x34')]['toString']();}else if(_0x3588ea[_0x4a0e('0x30')]==='variable'&&_0x3588ea[_0x4a0e('0x38')]&&_0x3588ea[_0x4a0e('0x37')]&&_0x3588ea['customField']){_0x58d066[_0x3588ea[_0x4a0e('0x37')][_0x4a0e('0x33')]()]=_0x34674a[_0x3588ea['variableName']][_0x4a0e('0x39')]();}else if(_0x3588ea[_0x4a0e('0x30')]==='customVariable'&&_0x3588ea[_0x4a0e('0x3a')]&&_0x3588ea['Variable'][_0x4a0e('0x3b')]&&_0x3588ea['idField']&&_0x3588ea[_0x4a0e('0x32')]){_0x58d066[_0x3588ea[_0x4a0e('0x37')]['toLowerCase']()]=_0x34674a[_0x3588ea[_0x4a0e('0x3a')][_0x4a0e('0x3b')]['toLowerCase']()][_0x4a0e('0x39')]();}});}return _0x58d066;}function getTicket(_0x4cf025,_0x2260cb,_0x422db6,_0x45e8f6,_0x103f20,_0x3df56b){return function(_0x5630d2){logger['info']('['+[_0x4cf025['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x5630d2);return new Promise(function(_0x5a919f,_0x2668f2){var _0x38bc95=_0x4cf025['toLowerCase']()===_0x4a0e('0x3c')?_0x5630d2[_0x4a0e('0x1f')]:_0x5630d2[_0x4a0e('0x29')];var _0x573817={'method':_0x4a0e('0x3d'),'uri':_0x422db6+_0x4a0e('0x3e')+'?'+_0x3df56b,'body':Object[_0x4a0e('0x3f')]({},{'active':_0x4a0e('0x1e'),'caller_id':_0x38bc95,'assigned_to':_0x5630d2[_0x4a0e('0x1f')],'short_description':intUtil[_0x4a0e('0x40')](_0x45e8f6[_0x4a0e('0x41')],_0x103f20,'\x20'),'description':intUtil[_0x4a0e('0x40')](_0x45e8f6[_0x4a0e('0x42')],_0x103f20,'\x0a')},getCustomFields(_0x45e8f6[_0x4a0e('0x43')],_0x103f20)),'auth':_0x2260cb,'json':!![]};return rp(_0x573817)[_0x4a0e('0xd')](function(_0x1996e7){logger['info']('['+[_0x4cf025['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x1996e7[_0x4a0e('0xe')]);_0x5630d2[_0x4a0e('0x44')]=_0x1996e7['result'][_0x4a0e('0x10')];_0x5630d2[_0x4a0e('0x45')]=_0x1996e7['result'][_0x4a0e('0x46')];logger[_0x4a0e('0x11')]('['+[_0x4cf025[_0x4a0e('0x12')]()]+_0x4a0e('0x47'),_0x5630d2);_0x5a919f(_0x5630d2);})[_0x4a0e('0x14')](function(_0x148c49){logger['error']('['+[_0x4cf025[_0x4a0e('0x12')]()]+']',_0x148c49[_0x4a0e('0x15')]);_0x2668f2(_0x148c49['message']);});});};}function createRemoteTag(_0x4183d2,_0x6fab04,_0x501466,_0x1107ba){return new Promise(function(_0x38be5a,_0x2a132f){var _0x107c46={'method':_0x4a0e('0x3d'),'uri':_0x501466+_0x4a0e('0x48')+'?'+_0x1107ba,'body':{'short_description':_0x4183d2,'global':!![],'active':!![],'name':_0x4183d2},'auth':_0x6fab04,'json':!![]};return rp(_0x107c46)[_0x4a0e('0xd')](function(_0xd35c47){var _0x331c07=_0xd35c47['result']['sys_id'];_0x38be5a(_0x331c07);});});}function getRemoteTag(_0x566660,_0x296c1b,_0x265fa6,_0x4866fa,_0x3f4520){return new Promise(function(_0x575576,_0x23c753){var _0x32dd56={'method':_0x4a0e('0x18'),'uri':_0x265fa6+_0x4a0e('0x48')+_0x4a0e('0x49')+_0x566660+'&'+_0x4866fa,'auth':_0x296c1b,'json':!![]};return rp(_0x32dd56)[_0x4a0e('0xd')](function(_0x12c2b6){if(_0x12c2b6[_0x4a0e('0xe')]['length']>0x0){var _0x1114e4=_0x12c2b6[_0x4a0e('0xe')][0x0][_0x4a0e('0x10')];_0x575576(_0x1114e4);}else{return createRemoteTag(_0x566660,_0x296c1b,_0x265fa6,_0x4866fa)[_0x4a0e('0xd')](function(_0x93b1f9){_0x575576(_0x93b1f9);});}});});}function assignTagToIncident(_0x394e54,_0xa89c9f,_0x1be3a2,_0x2dc0ab,_0x1e4e3b){return new Promise(function(_0x107e62,_0x583c7e){var _0x341125={'method':_0x4a0e('0x3d'),'uri':_0x1be3a2+_0x4a0e('0x4a')+'?'+_0x1e4e3b,'body':{'label':_0x394e54,'table':_0x4a0e('0x3e'),'id_type':_0x4a0e('0x4b'),'table_key':_0x2dc0ab[_0x4a0e('0x44')],'title':_0x4a0e('0x4c')+_0x2dc0ab[_0x4a0e('0x45')],'id_display':_0x2dc0ab[_0x4a0e('0x45')]},'auth':_0xa89c9f,'json':!![]};return rp(_0x341125)[_0x4a0e('0xd')](function(_0x17395a){_0x107e62();})[_0x4a0e('0x14')](function(){_0x107e62();});});}function manageTags(_0xde9820,_0x1cc4b6,_0x7e8ddd,_0x545efb,_0x3aa907,_0x240ca2,_0x3002be){return new Promise(function(_0x41a1e4,_0xd47bc0){var _0x242ef3=[];_0x1cc4b6[_0x4a0e('0x2e')](function(_0x1762b3){_0x242ef3[_0x4a0e('0x4d')](getRemoteTag(_0x1762b3,_0x7e8ddd,_0x545efb,_0x240ca2,_0x3002be));});return Promise[_0x4a0e('0x4e')](_0x242ef3)[_0x4a0e('0xd')](function(_0x37d413){if(_0x37d413[_0x4a0e('0x1d')]){logger['info']('['+[_0xde9820['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x37d413);var _0x3b90c6=[];_0x37d413[_0x4a0e('0x2e')](function(_0x4bd6fc){_0x3b90c6[_0x4a0e('0x4d')](assignTagToIncident(_0x4bd6fc,_0x7e8ddd,_0x545efb,_0x3aa907,_0x240ca2));});return Promise[_0x4a0e('0x4e')](_0x3b90c6)[_0x4a0e('0xd')](function(){_0x41a1e4();})[_0x4a0e('0x14')](function(){_0x41a1e4();});}else{_0x41a1e4();}});});}function getTags(_0x1e84f0,_0x1ecaa3,_0x3b22a8,_0x18e397,_0x22bb4e,_0x3c5c7b){return function(_0x311ca6){return new Promise(function(_0x436c41,_0x2ff2b5){var _0x403bd2=[];var _0x58041a=_0x18e397[_0x4a0e('0x4f')];if(_0x58041a&&_0x58041a[_0x4a0e('0x1d')]>0x0){_0x403bd2=_[_0x4a0e('0x50')](_0x58041a,_0x4a0e('0x3b'));}if(_0x403bd2[_0x4a0e('0x1d')]>0x0){return manageTags(_0x1e84f0,_0x403bd2,_0x1ecaa3,_0x3b22a8,_0x311ca6,_0x22bb4e,_0x3c5c7b)['then'](function(){_0x436c41(_0x311ca6);});}else{_0x436c41(_0x311ca6);}});};}function emit(_0x294fbb,_0x4bf7f2,_0x5a99aa){var _0x2e553b='%26sysparm_record_target%3Dincident'+_0x4a0e('0x51')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x4a0e('0x52');var _0xc96878={'uri':_0x294fbb+_0x4a0e('0x53')+_0x5a99aa+_0x2e553b};io['to'](util['format'](_0x4a0e('0x54'),_0x4bf7f2))[_0x4a0e('0x55')](_0x4a0e('0x56'),_0xc96878);}exports['cs']=function(_0x17acfa,_0x211eef,_0x145390,_0x456dd8,_0x44b9f0,_0x3beed0,_0x5738ec,_0x1c3f37){var _0x405f6e={};var _0x40baef={'user':_0x3beed0[_0x4a0e('0x57')],'pass':_0x3beed0['password']};var _0x1d4eea=_0x4a0e('0x58');var _0x1c8903=_0x4a0e('0x59');_0x3beed0[_0x4a0e('0x5a')]=intUtil[_0x4a0e('0x5b')](_0x3beed0[_0x4a0e('0x5a')]);_0x3beed0[_0x4a0e('0x5c')]=intUtil[_0x4a0e('0x5b')](_0x3beed0[_0x4a0e('0x5c')]);var _0x3f15ab=util[_0x4a0e('0x5d')](_0x4a0e('0x5e'),_0x3beed0[_0x4a0e('0x5a')]);_0x405f6e[_0x4a0e('0x1a')]=!_[_0x4a0e('0x5f')](_0x456dd8)?_0x456dd8[_0x4a0e('0x60')]:null;_0x405f6e[_0x4a0e('0x22')]=_0x3beed0[_0x4a0e('0x60')];_0x405f6e['endUserNumber']=_0x1c3f37['toLowerCase']()===_0x4a0e('0x3c')?_0x211eef[_0x4a0e('0x61')]:_0x211eef[_0x4a0e('0x62')];_0x405f6e[_0x4a0e('0x63')]=_0x1c3f37==='queue'||_0x1c3f37===_0x4a0e('0x64')?'queue':'outbound';var _0x31bc29=util[_0x4a0e('0x5d')](_0x4a0e('0x65'),_0x3beed0['serverUrl'],_0x211eef[_0x4a0e('0x66')],md5(_0x211eef[_0x4a0e('0x66')]));if(_0x44b9f0&&_0x44b9f0[_0x4a0e('0x67')]){logger[_0x4a0e('0x11')](_0x4a0e('0x68'),_0x4a0e('0x69'));_0x211eef[_0x4a0e('0x6a')]=_0x31bc29;}else if(_0x5738ec&&_0x5738ec['recordingFormat']&&_0x5738ec['recordingFormat']!==_0x4a0e('0x6b')){logger[_0x4a0e('0x11')](_0x4a0e('0x6c'),'Recording\x20is\x20enabled!');_0x211eef[_0x4a0e('0x6a')]=_0x31bc29;}else{_0x211eef[_0x4a0e('0x6a')]='';}return getAdminUser(_0x1c3f37,_0x40baef,_0x405f6e,_0x3f15ab,_0x1c8903,_0x1d4eea)['then'](getUser(_0x1c3f37,_0x40baef,_0x3f15ab,_0x1c8903,_0x1d4eea))[_0x4a0e('0xd')](getEndUser(_0x1c3f37,_0x40baef,_0x3f15ab,_0x1c8903,_0x1d4eea))[_0x4a0e('0xd')](getTicket(_0x1c3f37,_0x40baef,_0x3f15ab,_0x145390,_0x211eef,_0x1c8903))[_0x4a0e('0xd')](function(_0x53eb5c){logger[_0x4a0e('0x11')](util[_0x4a0e('0x5d')](_0x4a0e('0x6d'),_0x53eb5c[_0x4a0e('0x44')]));logger[_0x4a0e('0x11')](util['format'](_0x4a0e('0x6e'),_0x1c3f37));if(_0x1c3f37!==_0x4a0e('0x64')){logger[_0x4a0e('0x11')]('['+[_0x1c3f37[_0x4a0e('0x12')]()]+']',_0x4a0e('0x6f'));emit(_0x3beed0['remoteUri'],_0x456dd8[_0x4a0e('0x3b')],_0x53eb5c[_0x4a0e('0x44')]);}})[_0x4a0e('0x14')](function(_0x8a72e6){logger['error']('['+[_0x1c3f37['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x4a0e('0x70')](_0x8a72e6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa5e0=['label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','info','active','true','userId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','nameField','customField','content','toString','idField','variableName','Variable','name','toLowerCase','outbound','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D'];(function(_0x4105c4,_0x8f1a16){var _0x247abb=function(_0x56e567){while(--_0x56e567){_0x4105c4['push'](_0x4105c4['shift']());}};_0x247abb(++_0x8f1a16);}(_0xa5e0,0x91));var _0x0a5e=function(_0x5deb5f,_0x196be5){_0x5deb5f=_0x5deb5f-0x0;var _0xb1d347=_0xa5e0[_0x5deb5f];return _0xb1d347;};'use strict';var _=require(_0x0a5e('0x0'));var Promise=require(_0x0a5e('0x1'));var rp=require(_0x0a5e('0x2'));var util=require(_0x0a5e('0x3'));var md5=require(_0x0a5e('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x0a5e('0x5'));var logger=require(_0x0a5e('0x6'))(_0x0a5e('0x7'));config[_0x0a5e('0x8')]=_[_0x0a5e('0x9')](config[_0x0a5e('0x8')],{'host':_0x0a5e('0xa'),'port':0x18eb});var io=require(_0x0a5e('0xb'))(new Redis(config['redis']));function getAdminUser(_0x80d65f,_0x3d9fac,_0x172275,_0x45310c,_0x5bc9fb,_0x3c1d84){return new Promise(function(_0x1688c0,_0x2b40f7){var _0x50f197={'method':_0x0a5e('0xc'),'uri':_0x45310c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5bc9fb+'&'+_0x3c1d84,'auth':_0x3d9fac,'json':!![]};return rp(_0x50f197)[_0x0a5e('0xd')](function(_0x12fe6a){if(_0x12fe6a[_0x0a5e('0xe')][_0x0a5e('0xf')]>0x0){_0x172275[_0x0a5e('0x10')]=_0x12fe6a[_0x0a5e('0xe')][0x0][_0x0a5e('0x11')];}logger['info']('['+[_0x80d65f[_0x0a5e('0x12')]()]+_0x0a5e('0x13'),_0x172275);_0x1688c0(_0x172275);})[_0x0a5e('0x14')](function(_0x5de04b){logger[_0x0a5e('0x15')]('['+[_0x80d65f[_0x0a5e('0x12')]()]+']',_0x5de04b['message']);_0x2b40f7(_0x5de04b[_0x0a5e('0x16')]);});});}function getUser(_0xd719a3,_0xb8bb53,_0xafb5c5,_0x20aa8a,_0x41842b){return function(_0x2a63f9){logger['info']('['+[_0xd719a3['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x2a63f9);return new Promise(function(_0x1a1726,_0x2ddf03){if(intUtil[_0x0a5e('0x17')](_0x2a63f9['userEmail'])){var _0x16bddd={'method':_0x0a5e('0xc'),'uri':_0xafb5c5+'sys_user?sysparm_query=email%3D'+_0x2a63f9[_0x0a5e('0x18')]+'&'+_0x20aa8a+'&'+_0x41842b,'auth':_0xb8bb53,'json':!![]};logger[_0x0a5e('0x19')]('['+[_0xd719a3[_0x0a5e('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x16bddd);return rp(_0x16bddd)['then'](function(_0x44840c){logger['info']('['+[_0xd719a3[_0x0a5e('0x12')]()]+'],\x20getUser\x20entity',_0x44840c);if(_0x44840c[_0x0a5e('0xe')][_0x0a5e('0xf')]>0x0&&String(_0x44840c[_0x0a5e('0xe')][0x0][_0x0a5e('0x1a')])===_0x0a5e('0x1b')){_0x2a63f9['userId']=_0x44840c['result'][0x0]['sys_id'];}else{_0x2a63f9[_0x0a5e('0x1c')]=_0x2a63f9[_0x0a5e('0x10')];_0x2a63f9[_0x0a5e('0x18')]=_0x2a63f9['adminEmail'];}logger[_0x0a5e('0x19')]('['+[_0xd719a3[_0x0a5e('0x12')]()]+_0x0a5e('0x1d'),_0x2a63f9);_0x1a1726(_0x2a63f9);})[_0x0a5e('0x14')](function(_0x5889af){logger[_0x0a5e('0x15')]('['+[_0xd719a3[_0x0a5e('0x12')]()]+']',_0x5889af[_0x0a5e('0x16')]);_0x2ddf03(_0x5889af[_0x0a5e('0x16')]);});}else{logger[_0x0a5e('0x19')]('['+[_0xd719a3[_0x0a5e('0x12')]()]+']\x20using\x20admin\x20profile');_0x2a63f9[_0x0a5e('0x1c')]=_0x2a63f9[_0x0a5e('0x10')];_0x2a63f9[_0x0a5e('0x18')]=_0x2a63f9[_0x0a5e('0x1e')];_0x1a1726(_0x2a63f9);}});};}function createEndUser(_0x3a70e0,_0x5419db,_0x415f51,_0x540889,_0x3f3b94){logger['info']('['+[_0x3a70e0[_0x0a5e('0x12')]()]+_0x0a5e('0x1f'),_0x415f51);return new Promise(function(_0x4eeabd,_0x1aa6cf){var _0x2b36f1={'method':_0x0a5e('0x20'),'uri':_0x540889+'sys_user?'+_0x3f3b94,'body':{'user_name':_0x415f51[_0x0a5e('0x21')],'roles':_0x0a5e('0x22'),'first_name':_0x415f51[_0x0a5e('0x21')],'active':_0x0a5e('0x1b'),'date_format':_0x0a5e('0x23'),'phone':_0x415f51[_0x0a5e('0x21')]},'auth':_0x5419db,'json':!![]};return rp(_0x2b36f1)[_0x0a5e('0xd')](function(_0x4b2901){logger[_0x0a5e('0x19')]('['+[_0x3a70e0[_0x0a5e('0x12')]()]+_0x0a5e('0x24'),_0x4b2901['result']);_0x415f51[_0x0a5e('0x25')]=_0x4b2901[_0x0a5e('0xe')]['sys_id'];_0x4eeabd(_0x415f51);})[_0x0a5e('0x14')](function(_0x5aa512){logger[_0x0a5e('0x15')]('['+[_0x3a70e0[_0x0a5e('0x12')]()]+']',_0x5aa512[_0x0a5e('0x16')]);_0x1aa6cf(_0x5aa512['message']);});});}function getEndUser(_0x39ab83,_0x562c70,_0x326ada,_0x41738d,_0x15e43b){return function(_0x300bde){logger[_0x0a5e('0x19')]('['+[_0x39ab83[_0x0a5e('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x300bde);return new Promise(function(_0x3ffdc8,_0x5e30af){var _0x4f13a3={'method':_0x0a5e('0xc'),'uri':_0x326ada+_0x0a5e('0x26')+_0x300bde[_0x0a5e('0x21')]+'&'+_0x41738d+'&'+_0x15e43b,'auth':_0x562c70,'json':!![]};return rp(_0x4f13a3)['then'](function(_0x2660d2){if(_0x2660d2['result'][_0x0a5e('0xf')]>0x0){_0x300bde[_0x0a5e('0x25')]=_0x2660d2[_0x0a5e('0xe')][0x0][_0x0a5e('0x11')];logger['info']('['+[_0x39ab83[_0x0a5e('0x12')]()]+'],\x20getEndUser\x20crm',_0x300bde);_0x3ffdc8(_0x300bde);}else{return createEndUser(_0x39ab83,_0x562c70,_0x300bde,_0x326ada,_0x41738d)[_0x0a5e('0xd')](function(_0x23ce3d){logger['info']('['+[_0x39ab83['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x23ce3d);_0x3ffdc8(_0x23ce3d);});}})['catch'](function(_0xccdd78){logger[_0x0a5e('0x15')]('['+[_0x39ab83['toUpperCase']()]+']',_0xccdd78['message']);_0x5e30af(_0xccdd78[_0x0a5e('0x16')]);});});};}function getCustomFields(_0x43a5f3,_0x16d811){var _0x2d3b12={};if(_0x43a5f3[_0x0a5e('0xf')]>0x0){_[_0x0a5e('0x27')](_0x43a5f3,function(_0x2cc937){if(_[_0x0a5e('0x28')]([_0x0a5e('0x29'),_0x0a5e('0x2a')],_0x2cc937[_0x0a5e('0x2b')])&&_0x2cc937[_0x0a5e('0x2c')]&&!_0x2cc937[_0x0a5e('0x2d')]){_0x2d3b12[_0x2cc937['nameField']['toLowerCase']()]=_0x2cc937[_0x0a5e('0x2e')][_0x0a5e('0x2f')]();}else if(_[_0x0a5e('0x28')]([_0x0a5e('0x29'),_0x0a5e('0x2a')],_0x2cc937[_0x0a5e('0x2b')])&&_0x2cc937[_0x0a5e('0x30')]&&_0x2cc937[_0x0a5e('0x2d')]){_0x2d3b12[_0x2cc937[_0x0a5e('0x30')]['toLowerCase']()]=_0x2cc937[_0x0a5e('0x2e')]['toString']();}else if(_0x2cc937['type']==='variable'&&_0x2cc937['variableName']&&_0x2cc937[_0x0a5e('0x30')]&&_0x2cc937[_0x0a5e('0x2d')]){_0x2d3b12[_0x2cc937[_0x0a5e('0x30')]['toLowerCase']()]=_0x16d811[_0x2cc937[_0x0a5e('0x31')]]['toString']();}else if(_0x2cc937[_0x0a5e('0x2b')]==='customVariable'&&_0x2cc937[_0x0a5e('0x32')]&&_0x2cc937[_0x0a5e('0x32')][_0x0a5e('0x33')]&&_0x2cc937[_0x0a5e('0x30')]&&_0x2cc937[_0x0a5e('0x2d')]){_0x2d3b12[_0x2cc937[_0x0a5e('0x30')]['toLowerCase']()]=_0x16d811[_0x2cc937[_0x0a5e('0x32')][_0x0a5e('0x33')][_0x0a5e('0x34')]()]['toString']();}});}return _0x2d3b12;}function getTicket(_0x5b381b,_0x3796d3,_0x2a6cb9,_0x16fc7e,_0x1a2705,_0x19a4f0){return function(_0xf01311){logger[_0x0a5e('0x19')]('['+[_0x5b381b[_0x0a5e('0x12')]()]+']\x20getTicket\x20input\x20crm',_0xf01311);return new Promise(function(_0x4fad4f,_0x26a6e5){var _0x5b06f8=_0x5b381b[_0x0a5e('0x34')]()===_0x0a5e('0x35')?_0xf01311['userId']:_0xf01311[_0x0a5e('0x25')];var _0x739371={'method':'POST','uri':_0x2a6cb9+_0x0a5e('0x36')+'?'+_0x19a4f0,'body':Object[_0x0a5e('0x37')]({},{'active':_0x0a5e('0x1b'),'caller_id':_0x5b06f8,'assigned_to':_0xf01311[_0x0a5e('0x1c')],'short_description':intUtil[_0x0a5e('0x38')](_0x16fc7e[_0x0a5e('0x39')],_0x1a2705,'\x20'),'description':intUtil['getString'](_0x16fc7e[_0x0a5e('0x3a')],_0x1a2705,'\x0a')},getCustomFields(_0x16fc7e[_0x0a5e('0x3b')],_0x1a2705)),'auth':_0x3796d3,'json':!![]};return rp(_0x739371)[_0x0a5e('0xd')](function(_0x3beb4a){logger[_0x0a5e('0x19')]('['+[_0x5b381b[_0x0a5e('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x3beb4a[_0x0a5e('0xe')]);_0xf01311[_0x0a5e('0x3c')]=_0x3beb4a[_0x0a5e('0xe')]['sys_id'];_0xf01311[_0x0a5e('0x3d')]=_0x3beb4a[_0x0a5e('0xe')][_0x0a5e('0x3e')];logger[_0x0a5e('0x19')]('['+[_0x5b381b['toUpperCase']()]+']\x20getTicket\x20crm',_0xf01311);_0x4fad4f(_0xf01311);})[_0x0a5e('0x14')](function(_0x38a44e){logger[_0x0a5e('0x15')]('['+[_0x5b381b['toUpperCase']()]+']',_0x38a44e['message']);_0x26a6e5(_0x38a44e[_0x0a5e('0x16')]);});});};}function createRemoteTag(_0x365ff9,_0x55c89d,_0x354b79,_0x3366f4){return new Promise(function(_0xd15cb0,_0x26c0fb){var _0x58f9eb={'method':'POST','uri':_0x354b79+_0x0a5e('0x3f')+'?'+_0x3366f4,'body':{'short_description':_0x365ff9,'global':!![],'active':!![],'name':_0x365ff9},'auth':_0x55c89d,'json':!![]};return rp(_0x58f9eb)[_0x0a5e('0xd')](function(_0x6e04c9){var _0x55b533=_0x6e04c9['result'][_0x0a5e('0x11')];_0xd15cb0(_0x55b533);});});}function getRemoteTag(_0xa7a58f,_0x2a1635,_0x27d89b,_0xd13d8a,_0xa3a8a4){return new Promise(function(_0x174710,_0x3b456d){var _0x400ea9={'method':_0x0a5e('0xc'),'uri':_0x27d89b+_0x0a5e('0x3f')+_0x0a5e('0x40')+_0xa7a58f+'&'+_0xd13d8a,'auth':_0x2a1635,'json':!![]};return rp(_0x400ea9)[_0x0a5e('0xd')](function(_0x57dd79){if(_0x57dd79['result'][_0x0a5e('0xf')]>0x0){var _0x20dc16=_0x57dd79[_0x0a5e('0xe')][0x0]['sys_id'];_0x174710(_0x20dc16);}else{return createRemoteTag(_0xa7a58f,_0x2a1635,_0x27d89b,_0xd13d8a)[_0x0a5e('0xd')](function(_0x390d2e){_0x174710(_0x390d2e);});}});});}function assignTagToIncident(_0x2f0db6,_0x54d709,_0x84d3ca,_0xae9657,_0x375b47){return new Promise(function(_0x4ad2a9,_0x283949){var _0x341c6c={'method':'POST','uri':_0x84d3ca+_0x0a5e('0x41')+'?'+_0x375b47,'body':{'label':_0x2f0db6,'table':_0x0a5e('0x36'),'id_type':_0x0a5e('0x42'),'table_key':_0xae9657['ticketId'],'title':_0x0a5e('0x43')+_0xae9657[_0x0a5e('0x3d')],'id_display':_0xae9657['ticketNumber']},'auth':_0x54d709,'json':!![]};return rp(_0x341c6c)['then'](function(_0x3268ae){_0x4ad2a9();})[_0x0a5e('0x14')](function(){_0x4ad2a9();});});}function manageTags(_0xe5cfe1,_0xe983a4,_0x23753e,_0x3e80fe,_0x4648a2,_0x2c19b8,_0x51dc6e){return new Promise(function(_0x956150,_0x2fc5fd){var _0x1e839f=[];_0xe983a4[_0x0a5e('0x27')](function(_0x1db8b4){_0x1e839f[_0x0a5e('0x44')](getRemoteTag(_0x1db8b4,_0x23753e,_0x3e80fe,_0x2c19b8,_0x51dc6e));});return Promise[_0x0a5e('0x45')](_0x1e839f)[_0x0a5e('0xd')](function(_0x4d1223){if(_0x4d1223[_0x0a5e('0xf')]){logger[_0x0a5e('0x19')]('['+[_0xe5cfe1[_0x0a5e('0x12')]()]+_0x0a5e('0x46'),_0x4d1223);var _0x3a565b=[];_0x4d1223['forEach'](function(_0x3209a1){_0x3a565b[_0x0a5e('0x44')](assignTagToIncident(_0x3209a1,_0x23753e,_0x3e80fe,_0x4648a2,_0x2c19b8));});return Promise[_0x0a5e('0x45')](_0x3a565b)[_0x0a5e('0xd')](function(){_0x956150();})[_0x0a5e('0x14')](function(){_0x956150();});}else{_0x956150();}});});}function getTags(_0x249b6a,_0x395d73,_0x296f7b,_0x2b945e,_0x3c9ffb,_0x59cc52){return function(_0x355b0d){return new Promise(function(_0xe2488e,_0x1ae164){var _0x52e627=[];var _0x1bb53d=_0x2b945e[_0x0a5e('0x47')];if(_0x1bb53d&&_0x1bb53d[_0x0a5e('0xf')]>0x0){_0x52e627=_['map'](_0x1bb53d,'name');}if(_0x52e627[_0x0a5e('0xf')]>0x0){return manageTags(_0x249b6a,_0x52e627,_0x395d73,_0x296f7b,_0x355b0d,_0x3c9ffb,_0x59cc52)[_0x0a5e('0xd')](function(){_0xe2488e(_0x355b0d);});}else{_0xe2488e(_0x355b0d);}});};}function emit(_0x570725,_0x53022d,_0x30861c){var _0x423a84=_0x0a5e('0x48')+_0x0a5e('0x49')+_0x0a5e('0x4a')+_0x0a5e('0x4b');var _0x231cbf={'uri':_0x570725+_0x0a5e('0x4c')+_0x30861c+_0x423a84};io['to'](util[_0x0a5e('0x4d')](_0x0a5e('0x4e'),_0x53022d))[_0x0a5e('0x4f')]('trigger:browser:url',_0x231cbf);}exports['cs']=function(_0xbe375b,_0x4c33e4,_0x131e8d,_0x3b0acd,_0x3f33f4,_0x4fd9fc,_0x1ec7f0,_0x52899a){var _0x2d1e50={};var _0x5169db={'user':_0x4fd9fc[_0x0a5e('0x50')],'pass':_0x4fd9fc['password']};var _0x45ba7b=_0x0a5e('0x51');var _0x7389c1='sysparm_display_value=true';_0x4fd9fc[_0x0a5e('0x52')]=intUtil[_0x0a5e('0x53')](_0x4fd9fc[_0x0a5e('0x52')]);_0x4fd9fc[_0x0a5e('0x54')]=intUtil[_0x0a5e('0x53')](_0x4fd9fc['serverUrl']);var _0x4de751=util[_0x0a5e('0x4d')](_0x0a5e('0x55'),_0x4fd9fc[_0x0a5e('0x52')]);_0x2d1e50[_0x0a5e('0x18')]=!_[_0x0a5e('0x56')](_0x3b0acd)?_0x3b0acd[_0x0a5e('0x57')]:null;_0x2d1e50['adminEmail']=_0x4fd9fc[_0x0a5e('0x57')];_0x2d1e50[_0x0a5e('0x21')]=_0x52899a[_0x0a5e('0x34')]()===_0x0a5e('0x35')?_0x4c33e4[_0x0a5e('0x58')]:_0x4c33e4[_0x0a5e('0x59')];_0x2d1e50[_0x0a5e('0x5a')]=_0x52899a===_0x0a5e('0x5b')||_0x52899a===_0x0a5e('0x5c')?_0x0a5e('0x5b'):_0x0a5e('0x35');var _0x1c5153=util[_0x0a5e('0x4d')](_0x0a5e('0x5d'),_0x4fd9fc['serverUrl'],_0x4c33e4[_0x0a5e('0x5e')],md5(_0x4c33e4[_0x0a5e('0x5e')]));if(_0x3f33f4&&_0x3f33f4[_0x0a5e('0x5f')]){logger['info'](_0x0a5e('0x60'),_0x0a5e('0x61'));_0x4c33e4['recordingURL']=_0x1c5153;}else if(_0x1ec7f0&&_0x1ec7f0[_0x0a5e('0x62')]&&_0x1ec7f0[_0x0a5e('0x62')]!==_0x0a5e('0x63')){logger[_0x0a5e('0x19')]('[OUTBOUND]',_0x0a5e('0x61'));_0x4c33e4[_0x0a5e('0x64')]=_0x1c5153;}else{_0x4c33e4[_0x0a5e('0x64')]='';}return getAdminUser(_0x52899a,_0x5169db,_0x2d1e50,_0x4de751,_0x7389c1,_0x45ba7b)[_0x0a5e('0xd')](getUser(_0x52899a,_0x5169db,_0x4de751,_0x7389c1,_0x45ba7b))['then'](getEndUser(_0x52899a,_0x5169db,_0x4de751,_0x7389c1,_0x45ba7b))[_0x0a5e('0xd')](getTicket(_0x52899a,_0x5169db,_0x4de751,_0x131e8d,_0x4c33e4,_0x7389c1))[_0x0a5e('0xd')](function(_0x19ba2f){logger[_0x0a5e('0x19')](util['format'](_0x0a5e('0x65'),_0x19ba2f[_0x0a5e('0x3c')]));logger[_0x0a5e('0x19')](util[_0x0a5e('0x4d')](_0x0a5e('0x66'),_0x52899a));if(_0x52899a!==_0x0a5e('0x5c')){logger[_0x0a5e('0x19')]('['+[_0x52899a[_0x0a5e('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4fd9fc[_0x0a5e('0x52')],_0x3b0acd[_0x0a5e('0x33')],_0x19ba2f['ticketId']);}})[_0x0a5e('0x14')](function(_0x1ded27){logger['error']('['+[_0x52899a['toUpperCase']()]+_0x0a5e('0x67'),util[_0x0a5e('0x68')](_0x1ded27,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 2c137d9..d60478e 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4deb=['apiKey','toString','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','length','map','type','string','customField','toLowerCase','content','custom_fields','push','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','toUpperCase','The\x20Enduser\x20ID\x20is:','Fields','lastevent','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','emit','name','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_minutes','parent_id','parent_name','direction','forEach','variableName','idField','set_entry','JSON','stringify','format'];(function(_0x79ead,_0x49bf44){var _0x307998=function(_0x2ebd35){while(--_0x2ebd35){_0x79ead['push'](_0x79ead['shift']());}};_0x307998(++_0x49bf44);}(_0x4deb,0x1b4));var _0xb4de=function(_0x8d3262,_0x439e73){_0x8d3262=_0x8d3262-0x0;var _0x45561c=_0x4deb[_0x8d3262];return _0x45561c;};'use strict';var _=require(_0xb4de('0x0'));var rp=require(_0xb4de('0x1'));var BPromise=require(_0xb4de('0x2'));var md5=require(_0xb4de('0x3'));var util=require(_0xb4de('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb4de('0x5'));var logger=require(_0xb4de('0x6'))(_0xb4de('0x7'));config[_0xb4de('0x8')]=_[_0xb4de('0x9')](config[_0xb4de('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb4de('0x8')]));var def={'method':_0xb4de('0xa'),'json':!![]};function emit(_0x546fc9,_0x588e76,_0x4aa1bb){io['to'](_0x546fc9)[_0xb4de('0xb')](_0x588e76,_0x4aa1bb);}function getTicket(_0x44c08d,_0x3b11f5,_0x187df7,_0x5d4e1d,_0x4bd387,_0x27f5f6,_0x1596c6,_0x4fa23d){logger['info']('Creating\x20new\x20ticket...');var _0x3326ce=new Date();var _0x35f508=[{'name':_0xb4de('0xc'),'value':intUtil['getString'](_0x5d4e1d[_0xb4de('0xd')],_0x4bd387,'\x20')},{'name':_0xb4de('0xe'),'value':_0x3b11f5['id']},{'name':_0xb4de('0xf'),'value':_0x3b11f5['id']},{'name':_0xb4de('0x10'),'value':intUtil['getString'](_0x5d4e1d[_0xb4de('0x11')],_0x4bd387,'\x0a')},{'name':_0xb4de('0x12'),'value':_0x3326ce[_0xb4de('0x13')]()['slice'](0x0,0x13)[_0xb4de('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xb4de('0x15'),'value':'15'},{'name':_0xb4de('0x16'),'value':_0x187df7['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xb4de('0x17'),'value':_0x187df7[_0xb4de('0xc')]},{'name':_0xb4de('0x18'),'value':_0x4fa23d}];if(_0x27f5f6['length']){_[_0xb4de('0x19')](_0x27f5f6,function(_0x12011c){if(_0x4bd387[_0x12011c[_0xb4de('0x1a')]]){_0x35f508['push']({'name':_0x12011c[_0xb4de('0x1b')],'value':_0x4bd387[_0x12011c[_0xb4de('0x1a')]]});}});}return request({'form':{'method':_0xb4de('0x1c'),'input_type':_0xb4de('0x1d'),'response_type':_0xb4de('0x1d'),'rest_data':JSON[_0xb4de('0x1e')]({'session':_0x1596c6['id'],'module_name':'Calls','name_value_list':_0x35f508})}});}function getAuth(_0x3d66b9){return util[_0xb4de('0x1f')]('Basic\x20%s',new Buffer(_0x3d66b9[_0xb4de('0x20')]+':X')[_0xb4de('0x21')]('base64'));}function getServerInfo(_0x14e083){return request({'form':{'method':'get_server_info','input_type':_0xb4de('0x1d'),'response_type':_0xb4de('0x1d'),'rest_data':JSON[_0xb4de('0x1e')]({'session':_0x14e083['id']})}});}function getUser(_0x28ddff,_0x3bf566,_0x1984f3){if(!_[_0xb4de('0x22')](_0x3bf566)){logger[_0xb4de('0x23')](_0xb4de('0x24'),_0x3bf566);return request({'form':{'method':_0xb4de('0x25'),'input_type':'JSON','response_type':_0xb4de('0x1d'),'rest_data':JSON[_0xb4de('0x1e')]({'session':_0x1984f3['id'],'module_name':_0xb4de('0x26'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3bf566),'order_by':'','offset':'0','select_fields':['id',_0xb4de('0xc'),_0xb4de('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb4de('0x28')](function(_0x9f180c){if(_0x9f180c[_0xb4de('0x29')]['length']){var _0x569765=_['find'](_0x9f180c['entry_list'],function(_0x57bdba){return _0x57bdba[_0xb4de('0x2a')][_0xb4de('0x27')]['value']===_0x3bf566;});if(_0x569765){logger['info']('Agent\x20found!');return BPromise[_0xb4de('0x2b')]({'id':_0x569765[_0xb4de('0x2a')]['id'][_0xb4de('0x2c')],'name':_0x569765[_0xb4de('0x2a')]['name'][_0xb4de('0x2c')]});}}logger['info'](_0xb4de('0x2d'));return BPromise[_0xb4de('0x2b')]({'id':_0x1984f3[_0xb4de('0x2a')]['user_id'][_0xb4de('0x2c')],'name':_0x1984f3[_0xb4de('0x2a')][_0xb4de('0x27')][_0xb4de('0x2c')]});});}else{logger[_0xb4de('0x23')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb4de('0x2b')]({'id':_0x1984f3['name_value_list'][_0xb4de('0x2e')][_0xb4de('0x2c')],'name':_0x1984f3[_0xb4de('0x2a')][_0xb4de('0x27')][_0xb4de('0x2c')]});}}function getEndUser(_0x2ff862,_0x7f11ef,_0x4bebb6,_0x1e9a86){logger['info'](_0xb4de('0x2f'),_0x4bebb6);return request({'form':{'method':_0xb4de('0x25'),'input_type':_0xb4de('0x1d'),'response_type':_0xb4de('0x1d'),'rest_data':JSON[_0xb4de('0x1e')]({'session':_0x1e9a86['id'],'module_name':_0xb4de('0x30'),'query':util[_0xb4de('0x1f')](_0xb4de('0x31'),_0x4bebb6),'order_by':'','offset':'0','select_fields':['id',_0xb4de('0xc'),_0xb4de('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb4de('0x28')](function(_0x15fc78){if(_0x15fc78[_0xb4de('0x29')]['length']){var _0x1092ec=_['find'](_0x15fc78[_0xb4de('0x29')],function(_0x3e6c35){return _0x3e6c35[_0xb4de('0x2a')][_0xb4de('0x32')]['value']===_0x4bebb6;});if(_0x1092ec){logger[_0xb4de('0x23')](_0xb4de('0x33'));return BPromise['resolve']({'id':_0x1092ec[_0xb4de('0x2a')]['id'][_0xb4de('0x2c')],'name':_0x1092ec[_0xb4de('0x2a')][_0xb4de('0xc')][_0xb4de('0x2c')],'phone':_0x1092ec[_0xb4de('0x2a')][_0xb4de('0x32')]['value']});}}else{logger[_0xb4de('0x23')](_0xb4de('0x34'));return request({'form':{'method':'set_entry','input_type':_0xb4de('0x1d'),'response_type':'JSON','rest_data':JSON[_0xb4de('0x1e')]({'session':_0x1e9a86['id'],'module_name':_0xb4de('0x30'),'name_value_list':[{'name':_0xb4de('0x35'),'value':_0x7f11ef!==_0xb4de('0x36')?_0x7f11ef:util['format'](_0xb4de('0x37'),_0x4bebb6)},{'name':_0xb4de('0x32'),'value':_0x4bebb6}]})}})['then'](function(_0x2ad697){logger['info']('Enduser\x20created.');return BPromise[_0xb4de('0x2b')]({'id':_0x2ad697['id'],'name':_0x2ad697[_0xb4de('0x29')]['first_name'][_0xb4de('0x2c')],'phone':_0x2ad697['entry_list'][_0xb4de('0x32')][_0xb4de('0x2c')]});});}});}function request(_0x5e4852){logger[_0xb4de('0x38')](_0xb4de('0x39'),JSON[_0xb4de('0x1e')](_0x5e4852));return rp(_[_0xb4de('0x3a')](def,_0x5e4852));}function getTags(_0x9e5336,_0x4a9141){var _0xd2af23=[];if(_0x9e5336&&_0x9e5336[_0xb4de('0x3b')]>0x0){_0xd2af23=_[_0xb4de('0x3c')](_0x9e5336,_0x4a9141);}return _0xd2af23;}function getCustomFields(_0x52afa1,_0x4b0a31){var _0x31f9e0=[];var _0x15a760={'custom_fields':[]};if(_0x52afa1['length']>0x0){_[_0xb4de('0x19')](_0x52afa1,function(_0x3980b5){if(_0x3980b5[_0xb4de('0x3d')]===_0xb4de('0x3e')&&_0x3980b5['nameField']&&!_0x3980b5[_0xb4de('0x3f')]){_0x15a760[_0x3980b5['nameField'][_0xb4de('0x40')]()]=_0x3980b5[_0xb4de('0x41')]['toString']();}else if(_0x3980b5[_0xb4de('0x3d')]==='string'&&_0x3980b5[_0xb4de('0x1b')]&&_0x3980b5['customField']){_0x15a760[_0xb4de('0x42')][_0xb4de('0x43')]({'id':_0x3980b5[_0xb4de('0x1b')],'value':_0x3980b5['content'][_0xb4de('0x21')]()});}else if(_0x3980b5['type']===_0xb4de('0x44')&&_0x3980b5[_0xb4de('0x1a')]&&_0x3980b5[_0xb4de('0x1b')]&&_0x3980b5[_0xb4de('0x3f')]){_0x4b0a31[_0x3980b5['variableName']]&&_0x15a760['custom_fields'][_0xb4de('0x43')]({'id':_0x3980b5[_0xb4de('0x1b')],'value':_0x4b0a31[_0x3980b5[_0xb4de('0x1a')]][_0xb4de('0x21')]()});}else if(_0x3980b5[_0xb4de('0x3d')]==='customVariable'&&_0x3980b5['Variable']&&_0x3980b5['Variable']['name']&&_0x3980b5[_0xb4de('0x1b')]&&_0x3980b5[_0xb4de('0x3f')]){_0x4b0a31[_0x3980b5['Variable'][_0xb4de('0xc')]['toLowerCase']()]&&_0x15a760[_0xb4de('0x42')]['push']({'id':_0x3980b5[_0xb4de('0x1b')],'value':_0x4b0a31[_0x3980b5[_0xb4de('0x45')]['name'][_0xb4de('0x40')]()][_0xb4de('0x21')]()});}});}return _0x15a760;}function getConnection(_0x98f491){return request({'method':_0xb4de('0xa'),'form':{'method':_0xb4de('0x46'),'input_type':_0xb4de('0x1d'),'response_type':_0xb4de('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x98f491[_0xb4de('0x47')],'password':_0x98f491[_0xb4de('0x48')],'encryption':_0xb4de('0x49')},'application':_0xb4de('0x4a')})}})[_0xb4de('0x28')](function(_0x4ea26b){var _0x478ff8=_0x4ea26b;if(_0x478ff8['id']){def[_0xb4de('0x4b')]=_0x478ff8['id'];return BPromise['resolve'](_0x478ff8);}else{throw new Error(util[_0xb4de('0x1f')]('Account\x20%d\x20is\x20not\x20valid',_0x98f491['id']));}});}function setRelationship(_0x580f4a,_0x182da0,_0x19d4c4,_0x1bbf6b){return request({'form':{'method':_0xb4de('0x4c'),'input_type':'JSON','response_type':_0xb4de('0x1d'),'rest_data':JSON['stringify']({'session':_0x580f4a['id'],'module_name':_0xb4de('0x4d'),'module_id':_0x19d4c4['id'],'link_field_name':_0x1bbf6b,'related_ids':[_0x182da0['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb4de('0x4e')]=function(_0x10c9b2,_0x3c3c09,_0x104947,_0xfe8e75,_0x4e21c7,_0x7beeb6){var _0x42cf58,_0x358dfa,_0x42f9c1,_0x4d5cb7;_0x7beeb6[_0xb4de('0x4f')]=intUtil['stripTrailingSlash'](_0x7beeb6[_0xb4de('0x4f')]);_0x7beeb6[_0xb4de('0x50')]=intUtil[_0xb4de('0x51')](_0x7beeb6[_0xb4de('0x50')]);def[_0xb4de('0x52')]=util[_0xb4de('0x1f')](_0xb4de('0x53'),_0x7beeb6[_0xb4de('0x4f')]);if(_0x4e21c7&&_0x4e21c7[_0xb4de('0x54')]){logger[_0xb4de('0x23')](_0xb4de('0x55'),_0xb4de('0x56'));_0x3c3c09[_0xb4de('0x57')]=util[_0xb4de('0x1f')](_0xb4de('0x58'),_0x7beeb6[_0xb4de('0x50')],_0x3c3c09['uniqueid'],md5(_0x3c3c09['uniqueid']));}else{_0x3c3c09[_0xb4de('0x57')]='';}return getConnection(_0x7beeb6)[_0xb4de('0x28')](function(_0x5dc0da){_0x4d5cb7=_0x5dc0da;return getUser(_0x7beeb6,_0xfe8e75[_0xb4de('0xc')],_0x4d5cb7);})[_0xb4de('0x28')](function(_0x3f5619){_0x42cf58=_0x3f5619;logger[_0xb4de('0x23')](_0xb4de('0x59'),_0x42cf58['id']);return getEndUser(_0x7beeb6,_0x3c3c09[_0xb4de('0x5a')],_0x3c3c09[_0xb4de('0x5b')],_0x4d5cb7);})[_0xb4de('0x28')](function(_0x5a409c){_0x358dfa=_0x5a409c;logger[_0xb4de('0x23')]('The\x20Enduser\x20ID\x20is:',_0x358dfa['id']);return getTicket(_0x7beeb6,_0x42cf58,_0x358dfa,_0x104947,_0x3c3c09,_0x104947['Fields'],_0x4d5cb7,_0xb4de('0x5c'));})[_0xb4de('0x28')](function(_0x2841fd){_0x42f9c1=_0x2841fd;logger['info'](_0xb4de('0x5d'));logger[_0xb4de('0x23')](_0xb4de('0x5e'),_0x42f9c1['id']);return setRelationship(_0x4d5cb7,_0x42cf58,_0x42f9c1,'users');})['then'](function(){return setRelationship(_0x4d5cb7,_0x358dfa,_0x42f9c1,_0xb4de('0x5f'));})[_0xb4de('0x28')](function(){return getServerInfo(_0x4d5cb7);})['then'](function(_0x55c126){var _0x18a3b0=parseInt(_0x55c126[_0xb4de('0x60')][_0xb4de('0x61')](0x0));var _0xd2ff63=util[_0xb4de('0x1f')](_0xb4de('0x62'),_0x7beeb6[_0xb4de('0x4f')],_0x42f9c1['id']);if(_0x18a3b0>0x6){_0xd2ff63=util[_0xb4de('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x7beeb6['remoteUri'],_0x42f9c1['id']);}logger['info'](_0xb4de('0x55'),_0xb4de('0x63'));emit(util[_0xb4de('0x1f')](_0xb4de('0x64'),_0xfe8e75[_0xb4de('0xc')]),_0xb4de('0x65'),{'uri':_0xd2ff63});})[_0xb4de('0x66')](function(_0x5a0e84){logger['error'](_0xb4de('0x55'),JSON[_0xb4de('0x1e')](_0x5a0e84));});};exports[_0xb4de('0x67')]=function(_0x3e8679,_0x1fd2f3,_0x324ab8,_0x46c4ef,_0x482a11,_0xe8cd37,_0x507c87){var _0x274d15,_0x4c35ef,_0x5cc076,_0x23a2be;_0xe8cd37[_0xb4de('0x4f')]=intUtil[_0xb4de('0x51')](_0xe8cd37['remoteUri']);_0xe8cd37['serverUrl']=intUtil[_0xb4de('0x51')](_0xe8cd37['serverUrl']);def[_0xb4de('0x52')]=util[_0xb4de('0x1f')](_0xb4de('0x53'),_0xe8cd37[_0xb4de('0x4f')]);if(_0x507c87&&_0x507c87[_0xb4de('0x68')]&&_0x507c87['recordingFormat']!==_0xb4de('0x69')){logger['info'](_0xb4de('0x6a'),_0xb4de('0x56'));_0x1fd2f3['recordingURL']=util[_0xb4de('0x1f')](_0xb4de('0x58'),_0xe8cd37[_0xb4de('0x50')],_0x1fd2f3[_0xb4de('0x6b')],md5(_0x1fd2f3[_0xb4de('0x6b')]));}return getConnection(_0xe8cd37)[_0xb4de('0x28')](function(_0x57635b){_0x23a2be=_0x57635b;return getUser(_0xe8cd37,_0x46c4ef[_0xb4de('0xc')],_0x23a2be);})[_0xb4de('0x28')](function(_0x11e23c){_0x274d15=_0x11e23c;logger['info'](_0xb4de('0x59'),_0x274d15['id']);return getEndUser(_0xe8cd37,_0x1fd2f3[_0xb4de('0x6c')],_0x1fd2f3[_0xb4de('0x6d')],_0x23a2be);})[_0xb4de('0x28')](function(_0xeafb4f){_0x4c35ef=_0xeafb4f;logger[_0xb4de('0x23')]('The\x20Enduser\x20ID\x20is:',_0x4c35ef['id']);return getTicket(_0xe8cd37,_0x274d15,_0x4c35ef,_0x324ab8,_0x1fd2f3,_0x324ab8['Fields'],_0x23a2be,'Outbound');})[_0xb4de('0x28')](function(_0x288a96){_0x5cc076=_0x288a96;logger[_0xb4de('0x23')](_0xb4de('0x5d'));logger['info'](_0xb4de('0x5e'),_0x5cc076['id']);return setRelationship(_0x23a2be,_0x274d15,_0x5cc076,_0xb4de('0x6e'));})[_0xb4de('0x28')](function(){return setRelationship(_0x23a2be,_0x4c35ef,_0x5cc076,_0xb4de('0x5f'));})['then'](function(){return getServerInfo(_0x23a2be);})['then'](function(_0x29b71d){var _0x3a8ee1=parseInt(_0x29b71d['version'][_0xb4de('0x61')](0x0));var _0x41279b=util[_0xb4de('0x1f')](_0xb4de('0x62'),_0xe8cd37[_0xb4de('0x4f')],_0x5cc076['id']);if(_0x3a8ee1>0x6){_0x41279b=util['format'](_0xb4de('0x6f'),_0xe8cd37[_0xb4de('0x4f')],_0x5cc076['id']);}logger[_0xb4de('0x23')]('[OUTBOUND]',_0xb4de('0x63'));emit(util[_0xb4de('0x1f')]('user:%s',_0x46c4ef['name']),_0xb4de('0x65'),{'uri':_0x41279b});})['catch'](function(_0x2d5af9){logger[_0xb4de('0x70')](_0xb4de('0x6a'),JSON[_0xb4de('0x1e')](_0x2d5af9));});};exports['unmanaged']=function(_0x104512,_0x9211a3,_0x45119d,_0x50c038,_0x2fb6b4,_0x1e7d2d){var _0x199f4b,_0x5f4878,_0x1f4abb,_0x5185e4;_0x1e7d2d['remoteUri']=intUtil[_0xb4de('0x51')](_0x1e7d2d[_0xb4de('0x4f')]);_0x1e7d2d[_0xb4de('0x50')]=intUtil[_0xb4de('0x51')](_0x1e7d2d[_0xb4de('0x50')]);def['uri']=util[_0xb4de('0x1f')](_0xb4de('0x53'),_0x1e7d2d['remoteUri']);if(_0x2fb6b4&&_0x2fb6b4[_0xb4de('0x54')]){logger['info']('['+_0x9211a3['lastevent'][_0xb4de('0x71')]()+']',_0xb4de('0x56'));_0x9211a3[_0xb4de('0x57')]=util[_0xb4de('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e7d2d['serverUrl'],_0x9211a3[_0xb4de('0x6b')],md5(_0x9211a3['uniqueid']));}else{_0x9211a3[_0xb4de('0x57')]='';}return getConnection(_0x1e7d2d)[_0xb4de('0x28')](function(_0x57d234){_0x5185e4=_0x57d234;if(!_[_0xb4de('0x22')](_0x50c038)){return getUser(_0x1e7d2d,_0x50c038['name'],_0x5185e4);}else{return getUser(_0x1e7d2d,null,_0x5185e4);}})[_0xb4de('0x28')](function(_0x1df36a){_0x199f4b=_0x1df36a;logger[_0xb4de('0x23')]('The\x20User\x20ID\x20is:',_0x199f4b['id']);return getEndUser(_0x1e7d2d,_0x9211a3[_0xb4de('0x5a')],_0x9211a3['calleridnum'],_0x5185e4);})[_0xb4de('0x28')](function(_0x2ad76b){_0x5f4878=_0x2ad76b;logger[_0xb4de('0x23')](_0xb4de('0x72'),_0x5f4878['id']);return getTicket(_0x1e7d2d,_0x199f4b,_0x5f4878,_0x45119d,_0x9211a3,_0x45119d[_0xb4de('0x73')],_0x5185e4,_0xb4de('0x5c'));})[_0xb4de('0x28')](function(_0x4bb396){_0x1f4abb=_0x4bb396;logger[_0xb4de('0x23')](_0xb4de('0x5d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1f4abb['id']);return setRelationship(_0x5185e4,_0x199f4b,_0x1f4abb,_0xb4de('0x6e'));})[_0xb4de('0x28')](function(){return setRelationship(_0x5185e4,_0x5f4878,_0x1f4abb,_0xb4de('0x5f'));})[_0xb4de('0x28')](function(){return getServerInfo(_0x5185e4);})[_0xb4de('0x66')](function(_0x356214){logger[_0xb4de('0x70')]('['+_0x9211a3[_0xb4de('0x74')][_0xb4de('0x71')]()+']',JSON[_0xb4de('0x1e')](_0x356214));});}; \ No newline at end of file +var _0xfc5a=['unmanaged','toUpperCase','catch','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','info','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','','Caller\x20-\x20%s','Enduser\x20created.','merge','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','idField','customVariable','Variable','POST','login','username','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','remoteUri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','serverUrl','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','Outbound','users'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0xfc5a,0x79));var _0xafc5=function(_0x309be0,_0x5704f3){_0x309be0=_0x309be0-0x0;var _0x324e18=_0xfc5a[_0x309be0];return _0x324e18;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xafc5('0x0'));var md5=require(_0xafc5('0x1'));var util=require(_0xafc5('0x2'));var Redis=require(_0xafc5('0x3'));var intUtil=require(_0xafc5('0x4'));var config=require(_0xafc5('0x5'));var logger=require('../../../../config/logger')(_0xafc5('0x6'));config['redis']=_['defaults'](config[_0xafc5('0x7')],{'host':_0xafc5('0x8'),'port':0x18eb});var io=require(_0xafc5('0x9'))(new Redis(config[_0xafc5('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x3ce204,_0x17b979,_0x5acced){io['to'](_0x3ce204)[_0xafc5('0xa')](_0x17b979,_0x5acced);}function getTicket(_0x358369,_0x1246ff,_0xd6cc62,_0x1c0605,_0x26584b,_0x12cccb,_0x3da606,_0x5f1bd7){logger['info'](_0xafc5('0xb'));var _0x21c772=new Date();var _0x5336d4=[{'name':_0xafc5('0xc'),'value':intUtil[_0xafc5('0xd')](_0x1c0605[_0xafc5('0xe')],_0x26584b,'\x20')},{'name':_0xafc5('0xf'),'value':_0x1246ff['id']},{'name':'created_by','value':_0x1246ff['id']},{'name':_0xafc5('0x10'),'value':intUtil[_0xafc5('0xd')](_0x1c0605[_0xafc5('0x11')],_0x26584b,'\x0a')},{'name':'date_start','value':_0x21c772[_0xafc5('0x12')]()[_0xafc5('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0xafc5('0x14'),'value':'0'},{'name':_0xafc5('0x15'),'value':'15'},{'name':_0xafc5('0x16'),'value':_0xd6cc62['id']},{'name':_0xafc5('0x17'),'value':_0xafc5('0x18')},{'name':'parent_name','value':_0xd6cc62[_0xafc5('0xc')]},{'name':_0xafc5('0x19'),'value':_0x5f1bd7}];if(_0x12cccb[_0xafc5('0x1a')]){_[_0xafc5('0x1b')](_0x12cccb,function(_0x24e9b2){if(_0x26584b[_0x24e9b2[_0xafc5('0x1c')]]){_0x5336d4[_0xafc5('0x1d')]({'name':_0x24e9b2['idField'],'value':_0x26584b[_0x24e9b2['variableName']]});}});}return request({'form':{'method':_0xafc5('0x1e'),'input_type':_0xafc5('0x1f'),'response_type':_0xafc5('0x1f'),'rest_data':JSON[_0xafc5('0x20')]({'session':_0x3da606['id'],'module_name':_0xafc5('0x21'),'name_value_list':_0x5336d4})}});}function getAuth(_0x5cd802){return util[_0xafc5('0x22')](_0xafc5('0x23'),new Buffer(_0x5cd802[_0xafc5('0x24')]+':X')['toString']('base64'));}function getServerInfo(_0x503270){return request({'form':{'method':_0xafc5('0x25'),'input_type':_0xafc5('0x1f'),'response_type':_0xafc5('0x1f'),'rest_data':JSON['stringify']({'session':_0x503270['id']})}});}function getUser(_0x5e1d23,_0x3d600c,_0x280ea2){if(!_[_0xafc5('0x26')](_0x3d600c)){logger['info'](_0xafc5('0x27'),_0x3d600c);return request({'form':{'method':'get_entry_list','input_type':_0xafc5('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x280ea2['id'],'module_name':_0xafc5('0x28'),'query':util[_0xafc5('0x22')](_0xafc5('0x29'),_0x3d600c),'order_by':'','offset':'0','select_fields':['id',_0xafc5('0xc'),_0xafc5('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xafc5('0x2b')](function(_0x59c542){if(_0x59c542[_0xafc5('0x2c')][_0xafc5('0x1a')]){var _0x4e9259=_[_0xafc5('0x2d')](_0x59c542['entry_list'],function(_0x391a4e){return _0x391a4e[_0xafc5('0x2e')][_0xafc5('0x2a')][_0xafc5('0x2f')]===_0x3d600c;});if(_0x4e9259){logger['info'](_0xafc5('0x30'));return BPromise[_0xafc5('0x31')]({'id':_0x4e9259[_0xafc5('0x2e')]['id']['value'],'name':_0x4e9259[_0xafc5('0x2e')][_0xafc5('0xc')][_0xafc5('0x2f')]});}}logger['info'](_0xafc5('0x32'));return BPromise['resolve']({'id':_0x280ea2['name_value_list']['user_id'][_0xafc5('0x2f')],'name':_0x280ea2[_0xafc5('0x2e')][_0xafc5('0x2a')][_0xafc5('0x2f')]});});}else{logger[_0xafc5('0x33')](_0xafc5('0x34'));return BPromise['resolve']({'id':_0x280ea2[_0xafc5('0x2e')][_0xafc5('0x35')][_0xafc5('0x2f')],'name':_0x280ea2[_0xafc5('0x2e')][_0xafc5('0x2a')][_0xafc5('0x2f')]});}}function getEndUser(_0x5cb86c,_0x4cea51,_0x578028,_0x5e9b76){logger[_0xafc5('0x33')](_0xafc5('0x36'),_0x578028);return request({'form':{'method':'get_entry_list','input_type':_0xafc5('0x1f'),'response_type':'JSON','rest_data':JSON[_0xafc5('0x20')]({'session':_0x5e9b76['id'],'module_name':_0xafc5('0x18'),'query':util[_0xafc5('0x22')](_0xafc5('0x37'),_0x578028),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x122280){if(_0x122280['entry_list'][_0xafc5('0x1a')]){var _0x1e58ba=_['find'](_0x122280[_0xafc5('0x2c')],function(_0x27ee81){return _0x27ee81[_0xafc5('0x2e')][_0xafc5('0x38')][_0xafc5('0x2f')]===_0x578028;});if(_0x1e58ba){logger[_0xafc5('0x33')](_0xafc5('0x39'));return BPromise['resolve']({'id':_0x1e58ba[_0xafc5('0x2e')]['id'][_0xafc5('0x2f')],'name':_0x1e58ba['name_value_list'][_0xafc5('0xc')][_0xafc5('0x2f')],'phone':_0x1e58ba[_0xafc5('0x2e')][_0xafc5('0x38')]['value']});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xafc5('0x1e'),'input_type':'JSON','response_type':_0xafc5('0x1f'),'rest_data':JSON[_0xafc5('0x20')]({'session':_0x5e9b76['id'],'module_name':_0xafc5('0x18'),'name_value_list':[{'name':'first_name','value':_0x4cea51!==_0xafc5('0x3a')?_0x4cea51:util[_0xafc5('0x22')](_0xafc5('0x3b'),_0x578028)},{'name':_0xafc5('0x38'),'value':_0x578028}]})}})['then'](function(_0x2a44fc){logger[_0xafc5('0x33')](_0xafc5('0x3c'));return BPromise[_0xafc5('0x31')]({'id':_0x2a44fc['id'],'name':_0x2a44fc['entry_list']['first_name']['value'],'phone':_0x2a44fc[_0xafc5('0x2c')][_0xafc5('0x38')][_0xafc5('0x2f')]});});}});}function request(_0x3c360d){logger['debug']('[HTTP]',JSON[_0xafc5('0x20')](_0x3c360d));return rp(_[_0xafc5('0x3d')](def,_0x3c360d));}function getTags(_0x1e0d7a,_0x9399cd){var _0x14d2de=[];if(_0x1e0d7a&&_0x1e0d7a[_0xafc5('0x1a')]>0x0){_0x14d2de=_[_0xafc5('0x3e')](_0x1e0d7a,_0x9399cd);}return _0x14d2de;}function getCustomFields(_0xc480c9,_0x4c2bef){var _0x31e9cb=[];var _0xe49c2a={'custom_fields':[]};if(_0xc480c9[_0xafc5('0x1a')]>0x0){_[_0xafc5('0x1b')](_0xc480c9,function(_0x41d9a1){if(_0x41d9a1[_0xafc5('0x3f')]===_0xafc5('0x40')&&_0x41d9a1[_0xafc5('0x41')]&&!_0x41d9a1[_0xafc5('0x42')]){_0xe49c2a[_0x41d9a1[_0xafc5('0x41')][_0xafc5('0x43')]()]=_0x41d9a1[_0xafc5('0x44')][_0xafc5('0x45')]();}else if(_0x41d9a1[_0xafc5('0x3f')]==='string'&&_0x41d9a1['idField']&&_0x41d9a1[_0xafc5('0x42')]){_0xe49c2a[_0xafc5('0x46')][_0xafc5('0x1d')]({'id':_0x41d9a1[_0xafc5('0x47')],'value':_0x41d9a1['content'][_0xafc5('0x45')]()});}else if(_0x41d9a1[_0xafc5('0x3f')]==='variable'&&_0x41d9a1[_0xafc5('0x1c')]&&_0x41d9a1[_0xafc5('0x47')]&&_0x41d9a1['customField']){_0x4c2bef[_0x41d9a1[_0xafc5('0x1c')]]&&_0xe49c2a[_0xafc5('0x46')]['push']({'id':_0x41d9a1[_0xafc5('0x47')],'value':_0x4c2bef[_0x41d9a1[_0xafc5('0x1c')]][_0xafc5('0x45')]()});}else if(_0x41d9a1[_0xafc5('0x3f')]===_0xafc5('0x48')&&_0x41d9a1[_0xafc5('0x49')]&&_0x41d9a1['Variable']['name']&&_0x41d9a1[_0xafc5('0x47')]&&_0x41d9a1[_0xafc5('0x42')]){_0x4c2bef[_0x41d9a1[_0xafc5('0x49')][_0xafc5('0xc')]['toLowerCase']()]&&_0xe49c2a[_0xafc5('0x46')][_0xafc5('0x1d')]({'id':_0x41d9a1[_0xafc5('0x47')],'value':_0x4c2bef[_0x41d9a1[_0xafc5('0x49')][_0xafc5('0xc')][_0xafc5('0x43')]()][_0xafc5('0x45')]()});}});}return _0xe49c2a;}function getConnection(_0x17431e){return request({'method':_0xafc5('0x4a'),'form':{'method':_0xafc5('0x4b'),'input_type':_0xafc5('0x1f'),'response_type':_0xafc5('0x1f'),'rest_data':JSON[_0xafc5('0x20')]({'user_auth':{'user_name':_0x17431e[_0xafc5('0x4c')],'password':_0x17431e['password'],'encryption':'PLAIN'},'application':_0xafc5('0x4d')})}})[_0xafc5('0x2b')](function(_0x4ed079){var _0x4ae1b=_0x4ed079;if(_0x4ae1b['id']){def[_0xafc5('0x4e')]=_0x4ae1b['id'];return BPromise[_0xafc5('0x31')](_0x4ae1b);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x17431e['id']));}});}function setRelationship(_0x4e59cf,_0x128e31,_0x4e10be,_0x1e40af){return request({'form':{'method':_0xafc5('0x4f'),'input_type':_0xafc5('0x1f'),'response_type':_0xafc5('0x1f'),'rest_data':JSON[_0xafc5('0x20')]({'session':_0x4e59cf['id'],'module_name':_0xafc5('0x21'),'module_id':_0x4e10be['id'],'link_field_name':_0x1e40af,'related_ids':[_0x128e31['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x572d39,_0x14fe06,_0x50115d,_0x2d65cb,_0x3115f1,_0x212a94){var _0x44112d,_0x1b057a,_0x4b9a18,_0x523060;_0x212a94['remoteUri']=intUtil[_0xafc5('0x50')](_0x212a94[_0xafc5('0x51')]);_0x212a94['serverUrl']=intUtil['stripTrailingSlash'](_0x212a94['serverUrl']);def['uri']=util[_0xafc5('0x22')](_0xafc5('0x52'),_0x212a94[_0xafc5('0x51')]);if(_0x3115f1&&_0x3115f1[_0xafc5('0x53')]){logger[_0xafc5('0x33')](_0xafc5('0x54'),_0xafc5('0x55'));_0x14fe06['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x212a94[_0xafc5('0x56')],_0x14fe06['uniqueid'],md5(_0x14fe06[_0xafc5('0x57')]));}else{_0x14fe06[_0xafc5('0x58')]='';}return getConnection(_0x212a94)[_0xafc5('0x2b')](function(_0x3b9faf){_0x523060=_0x3b9faf;return getUser(_0x212a94,_0x2d65cb[_0xafc5('0xc')],_0x523060);})['then'](function(_0x370cb1){_0x44112d=_0x370cb1;logger[_0xafc5('0x33')]('The\x20User\x20ID\x20is:',_0x44112d['id']);return getEndUser(_0x212a94,_0x14fe06[_0xafc5('0x59')],_0x14fe06[_0xafc5('0x5a')],_0x523060);})[_0xafc5('0x2b')](function(_0x2ff067){_0x1b057a=_0x2ff067;logger[_0xafc5('0x33')](_0xafc5('0x5b'),_0x1b057a['id']);return getTicket(_0x212a94,_0x44112d,_0x1b057a,_0x50115d,_0x14fe06,_0x50115d[_0xafc5('0x5c')],_0x523060,_0xafc5('0x5d'));})[_0xafc5('0x2b')](function(_0x344580){_0x4b9a18=_0x344580;logger[_0xafc5('0x33')](_0xafc5('0x5e'));logger[_0xafc5('0x33')](_0xafc5('0x5f'),_0x4b9a18['id']);return setRelationship(_0x523060,_0x44112d,_0x4b9a18,'users');})[_0xafc5('0x2b')](function(){return setRelationship(_0x523060,_0x1b057a,_0x4b9a18,_0xafc5('0x60'));})[_0xafc5('0x2b')](function(){return getServerInfo(_0x523060);})[_0xafc5('0x2b')](function(_0x43c2ae){var _0x5c6ca2=parseInt(_0x43c2ae[_0xafc5('0x61')][_0xafc5('0x62')](0x0));var _0xed3832=util[_0xafc5('0x22')](_0xafc5('0x63'),_0x212a94[_0xafc5('0x51')],_0x4b9a18['id']);if(_0x5c6ca2>0x6){_0xed3832=util[_0xafc5('0x22')](_0xafc5('0x64'),_0x212a94[_0xafc5('0x51')],_0x4b9a18['id']);}logger[_0xafc5('0x33')](_0xafc5('0x54'),_0xafc5('0x65'));emit(util[_0xafc5('0x22')](_0xafc5('0x66'),_0x2d65cb[_0xafc5('0xc')]),_0xafc5('0x67'),{'uri':_0xed3832});})['catch'](function(_0x37b985){logger[_0xafc5('0x68')](_0xafc5('0x54'),JSON[_0xafc5('0x20')](_0x37b985));});};exports['outbound']=function(_0x143ba1,_0x5ab618,_0x3fda84,_0x3dc146,_0x28e2c4,_0x9731f7,_0x13c88e){var _0x4171b9,_0x1ecc2e,_0x9ebed2,_0x4b3973;_0x9731f7[_0xafc5('0x51')]=intUtil[_0xafc5('0x50')](_0x9731f7[_0xafc5('0x51')]);_0x9731f7['serverUrl']=intUtil[_0xafc5('0x50')](_0x9731f7['serverUrl']);def[_0xafc5('0x69')]=util[_0xafc5('0x22')](_0xafc5('0x52'),_0x9731f7[_0xafc5('0x51')]);if(_0x13c88e&&_0x13c88e[_0xafc5('0x6a')]&&_0x13c88e[_0xafc5('0x6a')]!==_0xafc5('0x6b')){logger['info'](_0xafc5('0x6c'),'Recording\x20is\x20enabled!');_0x5ab618[_0xafc5('0x58')]=util[_0xafc5('0x22')](_0xafc5('0x6d'),_0x9731f7[_0xafc5('0x56')],_0x5ab618[_0xafc5('0x57')],md5(_0x5ab618[_0xafc5('0x57')]));}return getConnection(_0x9731f7)[_0xafc5('0x2b')](function(_0x99823d){_0x4b3973=_0x99823d;return getUser(_0x9731f7,_0x3dc146['name'],_0x4b3973);})[_0xafc5('0x2b')](function(_0x2fb027){_0x4171b9=_0x2fb027;logger[_0xafc5('0x33')](_0xafc5('0x6e'),_0x4171b9['id']);return getEndUser(_0x9731f7,_0x5ab618['destcalleridname'],_0x5ab618['destcalleridnum'],_0x4b3973);})[_0xafc5('0x2b')](function(_0x1e0994){_0x1ecc2e=_0x1e0994;logger[_0xafc5('0x33')](_0xafc5('0x5b'),_0x1ecc2e['id']);return getTicket(_0x9731f7,_0x4171b9,_0x1ecc2e,_0x3fda84,_0x5ab618,_0x3fda84[_0xafc5('0x5c')],_0x4b3973,_0xafc5('0x6f'));})[_0xafc5('0x2b')](function(_0x5137cd){_0x9ebed2=_0x5137cd;logger[_0xafc5('0x33')](_0xafc5('0x5e'));logger[_0xafc5('0x33')](_0xafc5('0x5f'),_0x9ebed2['id']);return setRelationship(_0x4b3973,_0x4171b9,_0x9ebed2,_0xafc5('0x70'));})['then'](function(){return setRelationship(_0x4b3973,_0x1ecc2e,_0x9ebed2,'contacts');})[_0xafc5('0x2b')](function(){return getServerInfo(_0x4b3973);})[_0xafc5('0x2b')](function(_0x52d7f4){var _0x2a4b9f=parseInt(_0x52d7f4['version'][_0xafc5('0x62')](0x0));var _0x46ea03=util[_0xafc5('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x9731f7['remoteUri'],_0x9ebed2['id']);if(_0x2a4b9f>0x6){_0x46ea03=util[_0xafc5('0x22')](_0xafc5('0x64'),_0x9731f7[_0xafc5('0x51')],_0x9ebed2['id']);}logger[_0xafc5('0x33')](_0xafc5('0x6c'),_0xafc5('0x65'));emit(util[_0xafc5('0x22')](_0xafc5('0x66'),_0x3dc146[_0xafc5('0xc')]),'trigger:browser:url',{'uri':_0x46ea03});})['catch'](function(_0x5ee038){logger['error'](_0xafc5('0x6c'),JSON[_0xafc5('0x20')](_0x5ee038));});};exports[_0xafc5('0x71')]=function(_0x24e9d3,_0x35c58e,_0x126fd0,_0x3f02f4,_0x450f09,_0x4e3b6d){var _0x348f48,_0x89754b,_0x23e9f,_0x343349;_0x4e3b6d[_0xafc5('0x51')]=intUtil['stripTrailingSlash'](_0x4e3b6d[_0xafc5('0x51')]);_0x4e3b6d[_0xafc5('0x56')]=intUtil[_0xafc5('0x50')](_0x4e3b6d['serverUrl']);def['uri']=util[_0xafc5('0x22')](_0xafc5('0x52'),_0x4e3b6d['remoteUri']);if(_0x450f09&&_0x450f09[_0xafc5('0x53')]){logger[_0xafc5('0x33')]('['+_0x35c58e['lastevent'][_0xafc5('0x72')]()+']',_0xafc5('0x55'));_0x35c58e[_0xafc5('0x58')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e3b6d[_0xafc5('0x56')],_0x35c58e[_0xafc5('0x57')],md5(_0x35c58e[_0xafc5('0x57')]));}else{_0x35c58e['recordingURL']='';}return getConnection(_0x4e3b6d)[_0xafc5('0x2b')](function(_0xcffe37){_0x343349=_0xcffe37;if(!_[_0xafc5('0x26')](_0x3f02f4)){return getUser(_0x4e3b6d,_0x3f02f4[_0xafc5('0xc')],_0x343349);}else{return getUser(_0x4e3b6d,null,_0x343349);}})['then'](function(_0x498542){_0x348f48=_0x498542;logger[_0xafc5('0x33')](_0xafc5('0x6e'),_0x348f48['id']);return getEndUser(_0x4e3b6d,_0x35c58e[_0xafc5('0x59')],_0x35c58e[_0xafc5('0x5a')],_0x343349);})[_0xafc5('0x2b')](function(_0x7d2dce){_0x89754b=_0x7d2dce;logger[_0xafc5('0x33')](_0xafc5('0x5b'),_0x89754b['id']);return getTicket(_0x4e3b6d,_0x348f48,_0x89754b,_0x126fd0,_0x35c58e,_0x126fd0[_0xafc5('0x5c')],_0x343349,_0xafc5('0x5d'));})[_0xafc5('0x2b')](function(_0x834328){_0x23e9f=_0x834328;logger['info'](_0xafc5('0x5e'));logger['info'](_0xafc5('0x5f'),_0x23e9f['id']);return setRelationship(_0x343349,_0x348f48,_0x23e9f,_0xafc5('0x70'));})[_0xafc5('0x2b')](function(){return setRelationship(_0x343349,_0x89754b,_0x23e9f,_0xafc5('0x60'));})[_0xafc5('0x2b')](function(){return getServerInfo(_0x343349);})[_0xafc5('0x73')](function(_0x4f1136){logger[_0xafc5('0x68')]('['+_0x35c58e[_0xafc5('0x74')][_0xafc5('0x72')]()+']',JSON[_0xafc5('0x20')](_0x4f1136));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 9aa9672..8b63eda 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0c7=['length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','keyValue','keyType','key','format','keyContent','%s:\x20%s','toLowerCase','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString'];(function(_0x3fc60c,_0xc669aa){var _0x10e498=function(_0x1d95c3){while(--_0x1d95c3){_0x3fc60c['push'](_0x3fc60c['shift']());}};_0x10e498(++_0xc669aa);}(_0xd0c7,0x115));var _0x7d0c=function(_0x170dfe,_0x3ca507){_0x170dfe=_0x170dfe-0x0;var _0x5b32ce=_0xd0c7[_0x170dfe];return _0x5b32ce;};'use strict';var _=require(_0x7d0c('0x0'));var util=require(_0x7d0c('0x1'));exports[_0x7d0c('0x2')]=function(_0x28cde4,_0xf3384e,_0x1342ec){var _0xa8687=[];if(_0x28cde4[_0x7d0c('0x3')]>0x0){var _0x5b279d=_[_0x7d0c('0x4')](_0x28cde4,['id']);for(var _0xa6f2d6=0x0;_0xa6f2d6<_0x5b279d[_0x7d0c('0x3')];_0xa6f2d6++){var _0x1ed6e0=_0x5b279d[_0xa6f2d6];if(_0x1ed6e0[_0x7d0c('0x5')]===_0x7d0c('0x6')){_0xa8687[_0x7d0c('0x7')](_0x1ed6e0[_0x7d0c('0x8')]);}else if(_0x1ed6e0['type']===_0x7d0c('0x9')&&_0x1ed6e0[_0x7d0c('0xa')]){_0xf3384e[_0x1ed6e0[_0x7d0c('0xa')]]&&_0xa8687['push'](_0xf3384e[_0x1ed6e0[_0x7d0c('0xa')]][_0x7d0c('0xb')]());}else if(_0x1ed6e0['type']===_0x7d0c('0xc')&&_0x1ed6e0[_0x7d0c('0xd')]&&_0x1ed6e0[_0x7d0c('0xd')][_0x7d0c('0xe')]){_0xf3384e[_0x1ed6e0[_0x7d0c('0xd')][_0x7d0c('0xe')]['toLowerCase']()]&&_0xa8687[_0x7d0c('0x7')](_0xf3384e[_0x1ed6e0[_0x7d0c('0xd')][_0x7d0c('0xe')]['toLowerCase']()][_0x7d0c('0xb')]());}else if(_0x1ed6e0['type']===_0x7d0c('0xf')){if(_0x1ed6e0[_0x7d0c('0x10')]===_0x7d0c('0x6')&&_0x1ed6e0[_0x7d0c('0x11')]){_0xa8687[_0x7d0c('0x7')](util[_0x7d0c('0x12')]('%s:\x20%s',_0x1ed6e0[_0x7d0c('0x11')],_0x1ed6e0[_0x7d0c('0x13')]));}else if(_0x1ed6e0[_0x7d0c('0x10')]===_0x7d0c('0x9')&&_0x1ed6e0[_0x7d0c('0xa')]&&_0x1ed6e0[_0x7d0c('0x11')]){_0xf3384e[_0x1ed6e0[_0x7d0c('0xa')]]&&_0xa8687['push'](util[_0x7d0c('0x12')](_0x7d0c('0x14'),_0x1ed6e0[_0x7d0c('0x11')],_0xf3384e[_0x1ed6e0[_0x7d0c('0xa')]]));}else if(_0x1ed6e0['keyType']===_0x7d0c('0xc')&&_0x1ed6e0[_0x7d0c('0xd')]&&_0x1ed6e0[_0x7d0c('0xd')][_0x7d0c('0xe')]&&_0x1ed6e0[_0x7d0c('0x11')]){_0xf3384e[_0x1ed6e0[_0x7d0c('0xd')][_0x7d0c('0xe')]['toLowerCase']()]&&_0xa8687['push'](util['format'](_0x7d0c('0x14'),_0x1ed6e0[_0x7d0c('0x11')],_0xf3384e[_0x1ed6e0['Variable'][_0x7d0c('0xe')][_0x7d0c('0x15')]()]));}}}}return _0xa8687[_0x7d0c('0x16')](_0x1342ec);};exports[_0x7d0c('0x17')]=function(_0x3b8376){var _0x76dae1=_0x3b8376['slice'](-0x1);if(_0x76dae1==='/'){_0x3b8376=_0x3b8376[_0x7d0c('0x18')](0x0,_0x3b8376[_0x7d0c('0x19')](_0x76dae1));}return _0x3b8376;};exports['validateEmail']=function(_0x7afcc0){if(!_[_0x7d0c('0x1a')](_0x7afcc0)&&_0x7afcc0!==''){var _0x331029=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x331029[_0x7d0c('0x1b')](String(_0x7afcc0)[_0x7d0c('0x15')]());}else{return![];}}; \ No newline at end of file +var _0xe4f5=['type','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','customVariable','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','string','push','content'];(function(_0x40862b,_0x571dd7){var _0xae8224=function(_0xf2f31c){while(--_0xf2f31c){_0x40862b['push'](_0x40862b['shift']());}};_0xae8224(++_0x571dd7);}(_0xe4f5,0x173));var _0x5e4f=function(_0x4fb16f,_0x2e88e5){_0x4fb16f=_0x4fb16f-0x0;var _0x8877ef=_0xe4f5[_0x4fb16f];return _0x8877ef;};'use strict';var _=require(_0x5e4f('0x0'));var util=require(_0x5e4f('0x1'));exports['getString']=function(_0x3ee81f,_0x1965ca,_0x1b29dc){var _0x51ec3f=[];if(_0x3ee81f[_0x5e4f('0x2')]>0x0){var _0x346c79=_[_0x5e4f('0x3')](_0x3ee81f,['id']);for(var _0x54168c=0x0;_0x54168c<_0x346c79[_0x5e4f('0x2')];_0x54168c++){var _0x43a2c0=_0x346c79[_0x54168c];if(_0x43a2c0['type']===_0x5e4f('0x4')){_0x51ec3f[_0x5e4f('0x5')](_0x43a2c0[_0x5e4f('0x6')]);}else if(_0x43a2c0[_0x5e4f('0x7')]===_0x5e4f('0x8')&&_0x43a2c0[_0x5e4f('0x9')]){_0x1965ca[_0x43a2c0['variableName']]&&_0x51ec3f[_0x5e4f('0x5')](_0x1965ca[_0x43a2c0['variableName']][_0x5e4f('0xa')]());}else if(_0x43a2c0[_0x5e4f('0x7')]==='customVariable'&&_0x43a2c0[_0x5e4f('0xb')]&&_0x43a2c0[_0x5e4f('0xb')][_0x5e4f('0xc')]){_0x1965ca[_0x43a2c0[_0x5e4f('0xb')][_0x5e4f('0xc')][_0x5e4f('0xd')]()]&&_0x51ec3f[_0x5e4f('0x5')](_0x1965ca[_0x43a2c0[_0x5e4f('0xb')][_0x5e4f('0xc')]['toLowerCase']()]['toString']());}else if(_0x43a2c0[_0x5e4f('0x7')]===_0x5e4f('0xe')){if(_0x43a2c0[_0x5e4f('0xf')]===_0x5e4f('0x4')&&_0x43a2c0[_0x5e4f('0x10')]){_0x51ec3f[_0x5e4f('0x5')](util[_0x5e4f('0x11')](_0x5e4f('0x12'),_0x43a2c0[_0x5e4f('0x10')],_0x43a2c0['keyContent']));}else if(_0x43a2c0[_0x5e4f('0xf')]===_0x5e4f('0x8')&&_0x43a2c0[_0x5e4f('0x9')]&&_0x43a2c0[_0x5e4f('0x10')]){_0x1965ca[_0x43a2c0[_0x5e4f('0x9')]]&&_0x51ec3f['push'](util[_0x5e4f('0x11')](_0x5e4f('0x12'),_0x43a2c0[_0x5e4f('0x10')],_0x1965ca[_0x43a2c0['variableName']]));}else if(_0x43a2c0[_0x5e4f('0xf')]===_0x5e4f('0x13')&&_0x43a2c0[_0x5e4f('0xb')]&&_0x43a2c0[_0x5e4f('0xb')]['name']&&_0x43a2c0['key']){_0x1965ca[_0x43a2c0[_0x5e4f('0xb')][_0x5e4f('0xc')][_0x5e4f('0xd')]()]&&_0x51ec3f[_0x5e4f('0x5')](util[_0x5e4f('0x11')]('%s:\x20%s',_0x43a2c0[_0x5e4f('0x10')],_0x1965ca[_0x43a2c0[_0x5e4f('0xb')]['name'][_0x5e4f('0xd')]()]));}}}}return _0x51ec3f['join'](_0x1b29dc);};exports[_0x5e4f('0x14')]=function(_0x135364){var _0x2aad2a=_0x135364[_0x5e4f('0x15')](-0x1);if(_0x2aad2a==='/'){_0x135364=_0x135364[_0x5e4f('0x16')](0x0,_0x135364[_0x5e4f('0x17')](_0x2aad2a));}return _0x135364;};exports[_0x5e4f('0x18')]=function(_0x4d71b8){if(!_[_0x5e4f('0x19')](_0x4d71b8)&&_0x4d71b8!==''){var _0x4c7942=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x4c7942[_0x5e4f('0x1a')](String(_0x4d71b8)[_0x5e4f('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index cc42ff6..cb62be8 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 5a7bccf..ef86b9a 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec83=['%s/tickets.json','POST','Tags','name','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','remoteUri','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','map','includes','string','picklist','nameField','customField','toLowerCase','toString','type','idField','custom_fields','content','variable','push','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','The\x20User\x20ID\x20is:','[OUTBOUND]','replace','unmanaged','toUpperCase','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...'];(function(_0x19511a,_0x317137){var _0x2799ac=function(_0x33d104){while(--_0x33d104){_0x19511a['push'](_0x19511a['shift']());}};_0x2799ac(++_0x317137);}(_0xec83,0xd2));var _0x3ec8=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0xec83[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0x3ec8('0x0'));var rp=require(_0x3ec8('0x1'));var md5=require(_0x3ec8('0x2'));var util=require(_0x3ec8('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x3ec8('0x4'));var logger=require(_0x3ec8('0x5'))(_0x3ec8('0x6'));config['redis']=_[_0x3ec8('0x7')](config[_0x3ec8('0x8')],{'host':_0x3ec8('0x9'),'port':0x18eb});var io=require(_0x3ec8('0xa'))(new Redis(config['redis']));function emit(_0x3be6c9,_0x4ab1fe,_0xd90c5){io['to'](_0x3be6c9)[_0x3ec8('0xb')](_0x4ab1fe,_0xd90c5);}var headers={'Content-Type':_0x3ec8('0xc'),'Accept':'application/json'};function getTicket(_0x348886,_0xf92948,_0x307e9f,_0x11cede,_0x3073b5){logger['info'](_0x3ec8('0xd'));return request({'uri':util['format'](_0x3ec8('0xe'),_0x348886['remoteUri']),'method':_0x3ec8('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x307e9f['id'],'submitter_id':_0xf92948?_0xf92948['id']:undefined,'assignee_id':_0xf92948?_0xf92948['id']:undefined,'tags':getTags(_0x11cede[_0x3ec8('0x10')],_0x3ec8('0x11')),'subject':intUtil['getString'](_0x11cede['Subjects'],_0x3073b5,'\x20'),'description':intUtil[_0x3ec8('0x12')](_0x11cede[_0x3ec8('0x13')],_0x3073b5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3ec8('0x12')](_0x11cede['Descriptions'],_0x3073b5,'\x0a')}},getCustomFields(_0x11cede[_0x3ec8('0x14')],_0x3073b5))}})[_0x3ec8('0x15')](function(_0x251f60){logger[_0x3ec8('0x16')](_0x3ec8('0x17'));return _0x251f60[_0x3ec8('0x18')];});}function getUser(_0x391b2e,_0x2ec714){if(intUtil[_0x3ec8('0x19')](_0x2ec714)){logger[_0x3ec8('0x16')](_0x3ec8('0x1a'),_0x2ec714);return request({'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x1c'),_0x391b2e['remoteUri']),'qs':{'query':util[_0x3ec8('0x1b')](_0x3ec8('0x1d'),_0x2ec714)}})[_0x3ec8('0x15')](function(_0x4cdcb0){if(_0x4cdcb0[_0x3ec8('0x1e')]){logger['info'](_0x3ec8('0x1f'));return _[_0x3ec8('0x20')](_0x4cdcb0[_0x3ec8('0x21')],{'email':_0x2ec714,'role':_0x3ec8('0x22')});}else{logger[_0x3ec8('0x16')](_0x3ec8('0x23'));return request({'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x24'),_0x391b2e['remoteUri'])})[_0x3ec8('0x15')](function(_0x4b2756){logger[_0x3ec8('0x16')](_0x3ec8('0x25'));return _0x4b2756[_0x3ec8('0x26')];});}});}else{logger['info'](_0x3ec8('0x23'));return request({'uri':util['format'](_0x3ec8('0x24'),_0x391b2e[_0x3ec8('0x27')])})['then'](function(_0xd7af12){logger[_0x3ec8('0x16')]('Admin\x20account\x20selected.');return _0xd7af12[_0x3ec8('0x26')];});}}function getEndUser(_0x4f2bfd,_0x106038,_0x35dede){logger[_0x3ec8('0x16')](_0x3ec8('0x28'),_0x35dede);return request({'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x1c'),_0x4f2bfd[_0x3ec8('0x27')]),'qs':{'query':util['format'](_0x3ec8('0x29'),_0x35dede)}})[_0x3ec8('0x15')](function(_0x3c132a){var _0x58573d;if(_0x3c132a[_0x3ec8('0x21')][_0x3ec8('0x2a')]){_0x3c132a[_0x3ec8('0x21')]=_['filter'](_0x3c132a[_0x3ec8('0x21')],{'suspended':![],'role':_0x3ec8('0x2b')});if(_0x3c132a[_0x3ec8('0x21')][_0x3ec8('0x2a')]){_0x58573d=_['first'](_0x3c132a[_0x3ec8('0x21')]);}}if(_0x58573d){logger[_0x3ec8('0x16')](_0x3ec8('0x2c'));return _0x58573d;}else{logger[_0x3ec8('0x16')](_0x3ec8('0x2d'));return request({'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x2e'),_0x4f2bfd[_0x3ec8('0x27')]),'method':_0x3ec8('0xf'),'body':{'user':{'role':_0x3ec8('0x2b'),'name':util[_0x3ec8('0x1b')](_0x3ec8('0x2f'),_0x106038||_0x35dede),'phone':_0x35dede}}})[_0x3ec8('0x15')](function(_0x2b1447){logger['info'](_0x3ec8('0x30'));return _0x2b1447[_0x3ec8('0x26')];});}});}function getAuth(_0x208b1b){var _0x3fe68d;if(_0x208b1b['authType']===_0x3ec8('0x31')){_0x3fe68d=util[_0x3ec8('0x1b')](_0x3ec8('0x32'),_0x208b1b[_0x3ec8('0x33')],_0x208b1b[_0x3ec8('0x31')]);}else if(_0x208b1b[_0x3ec8('0x34')]===_0x3ec8('0x35')){_0x3fe68d=util[_0x3ec8('0x1b')](_0x3ec8('0x36'),_0x208b1b[_0x3ec8('0x33')],_0x208b1b[_0x3ec8('0x35')]);}return util[_0x3ec8('0x1b')](_0x3ec8('0x37'),new Buffer(_0x3fe68d)['toString'](_0x3ec8('0x38')));}function request(_0x256a05){logger[_0x3ec8('0x39')](_0x3ec8('0x3a'),JSON[_0x3ec8('0x3b')](_0x256a05));return rp(_[_0x3ec8('0x7')](_0x256a05,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3f59a9,_0x44f3f5){var _0x5238f4=[];if(_0x3f59a9&&_0x3f59a9[_0x3ec8('0x2a')]>0x0){_0x5238f4=_[_0x3ec8('0x3c')](_0x3f59a9,_0x44f3f5);}return _0x5238f4;}function getCustomFields(_0x582fd8,_0x5ea74a){var _0x5856bf=[];var _0x110ad5={'custom_fields':[]};if(_0x582fd8[_0x3ec8('0x2a')]>0x0){_['forEach'](_0x582fd8,function(_0x392401){if(_[_0x3ec8('0x3d')]([_0x3ec8('0x3e'),_0x3ec8('0x3f')],_0x392401['type'])&&_0x392401[_0x3ec8('0x40')]&&!_0x392401[_0x3ec8('0x41')]){_0x110ad5[_0x392401[_0x3ec8('0x40')][_0x3ec8('0x42')]()]=_0x392401['content'][_0x3ec8('0x43')]();}else if(_[_0x3ec8('0x3d')]([_0x3ec8('0x3e'),_0x3ec8('0x3f')],_0x392401[_0x3ec8('0x44')])&&_0x392401[_0x3ec8('0x45')]&&_0x392401[_0x3ec8('0x41')]){_0x110ad5[_0x3ec8('0x46')]['push']({'id':_0x392401[_0x3ec8('0x45')],'value':_0x392401[_0x3ec8('0x47')][_0x3ec8('0x43')]()});}else if(_0x392401[_0x3ec8('0x44')]===_0x3ec8('0x48')&&_0x392401['variableName']&&_0x392401[_0x3ec8('0x45')]&&_0x392401[_0x3ec8('0x41')]){_0x5ea74a[_0x392401['variableName']]&&_0x110ad5['custom_fields'][_0x3ec8('0x49')]({'id':_0x392401['idField'],'value':_0x5ea74a[_0x392401[_0x3ec8('0x4a')]][_0x3ec8('0x43')]()});}else if(_0x392401[_0x3ec8('0x44')]===_0x3ec8('0x4b')&&_0x392401['Variable']&&_0x392401[_0x3ec8('0x4c')][_0x3ec8('0x11')]&&_0x392401['idField']&&_0x392401[_0x3ec8('0x41')]){_0x5ea74a[_0x392401['Variable'][_0x3ec8('0x11')][_0x3ec8('0x42')]()]&&_0x110ad5['custom_fields'][_0x3ec8('0x49')]({'id':_0x392401[_0x3ec8('0x45')],'value':_0x5ea74a[_0x392401['Variable']['name'][_0x3ec8('0x42')]()][_0x3ec8('0x43')]()});}});}return _0x110ad5;}exports[_0x3ec8('0x4d')]=function(_0x10cfea,_0x50da72,_0x5527c4,_0x203995,_0x189684,_0x29ab88){var _0x29a380,_0xb67486;_0x29ab88[_0x3ec8('0x27')]=intUtil['stripTrailingSlash'](_0x29ab88[_0x3ec8('0x27')]);_0x29ab88[_0x3ec8('0x4e')]=intUtil[_0x3ec8('0x4f')](_0x29ab88['serverUrl']);if(_0x189684&&_0x189684[_0x3ec8('0x50')]){logger[_0x3ec8('0x16')](_0x3ec8('0x51'),_0x3ec8('0x52'));_0x50da72[_0x3ec8('0x53')]=util[_0x3ec8('0x1b')](_0x3ec8('0x54'),_0x29ab88[_0x3ec8('0x4e')],_0x50da72[_0x3ec8('0x55')],md5(_0x50da72[_0x3ec8('0x55')]));}else{_0x50da72[_0x3ec8('0x53')]='';}headers[_0x3ec8('0x56')]=getAuth(_0x29ab88);return getUser(_0x29ab88,_0x203995[_0x3ec8('0x57')])['then'](function(_0x2a9e5a){_0x29a380=_0x2a9e5a;logger['info']('The\x20User\x20ID\x20is:',_0x29a380['id']);return getEndUser(_0x29ab88,_0x50da72[_0x3ec8('0x58')],_0x50da72[_0x3ec8('0x59')]);})['then'](function(_0x429c7f){_0xb67486=_0x429c7f;logger['info'](_0x3ec8('0x5a'),_0xb67486['id']);return getTicket(_0x29ab88,_0x29a380,_0xb67486,_0x5527c4,_0x50da72);})[_0x3ec8('0x15')](function(_0x5ab91d){if(_0x5ab91d){logger['info'](_0x3ec8('0x5b'),_0x5ab91d['id']);switch(_0x29ab88['type']){case _0x3ec8('0x5c'):logger[_0x3ec8('0x16')]('[QUEUE]',_0x3ec8('0x5d'));return request({'uri':util['format'](_0x3ec8('0x5e'),_0x29ab88['remoteUri'],_0x29a380['id'],_0x5ab91d['id']),'method':_0x3ec8('0xf')});case _0x3ec8('0x5f'):logger['info'](_0x3ec8('0x51'),_0x3ec8('0x60'));emit(util[_0x3ec8('0x1b')](_0x3ec8('0x61'),_0x203995[_0x3ec8('0x11')]),_0x3ec8('0x62'),{'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x63'),_0x29ab88[_0x3ec8('0x27')]['replace'](_0x3ec8('0x64'),''),_0x5ab91d['id'])});break;default:logger[_0x3ec8('0x65')](_0x3ec8('0x51'),_0x3ec8('0x66'));}}})[_0x3ec8('0x67')](function(_0x5ccce5){logger[_0x3ec8('0x65')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x3ec8('0x68')](_0x5ccce5,{'showHidden':!![],'depth':null}));});};exports[_0x3ec8('0x69')]=function(_0x100016,_0x21e662,_0xd9d3b4,_0x110db9,_0x31dab7,_0x1c9919,_0x425345){var _0x46b3f8,_0xda3b7d;_0x1c9919[_0x3ec8('0x27')]=intUtil[_0x3ec8('0x4f')](_0x1c9919[_0x3ec8('0x27')]);_0x1c9919[_0x3ec8('0x4e')]=intUtil[_0x3ec8('0x4f')](_0x1c9919[_0x3ec8('0x4e')]);if(_0x425345&&_0x425345['recordingFormat']&&_0x425345[_0x3ec8('0x6a')]!=='none'){logger[_0x3ec8('0x16')]('[OUTBOUND]',_0x3ec8('0x52'));_0x21e662[_0x3ec8('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c9919[_0x3ec8('0x4e')],_0x21e662['uniqueid'],md5(_0x21e662[_0x3ec8('0x55')]));}headers[_0x3ec8('0x56')]=getAuth(_0x1c9919);return getUser(_0x1c9919,_0x110db9['email'])[_0x3ec8('0x15')](function(_0x518806){_0x46b3f8=_0x518806;logger['info'](_0x3ec8('0x6b'),_0x46b3f8['id']);return getEndUser(_0x1c9919,_0x21e662['destcalleridname'],_0x21e662['destcalleridnum']);})[_0x3ec8('0x15')](function(_0x373970){_0xda3b7d=_0x373970;logger[_0x3ec8('0x16')](_0x3ec8('0x5a'),_0xda3b7d['id']);return getTicket(_0x1c9919,_0x46b3f8,_0xda3b7d,_0xd9d3b4,_0x21e662);})[_0x3ec8('0x15')](function(_0x22c32d){if(_0x22c32d){logger[_0x3ec8('0x16')](_0x3ec8('0x5b'),_0x22c32d['id']);switch(_0x1c9919[_0x3ec8('0x44')]){case _0x3ec8('0x5c'):logger[_0x3ec8('0x16')](_0x3ec8('0x6c'),_0x3ec8('0x5d'));return request({'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x5e'),_0x1c9919['remoteUri'],_0x46b3f8['id'],_0x22c32d['id']),'method':'POST'});case _0x3ec8('0x5f'):logger[_0x3ec8('0x16')](_0x3ec8('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x110db9['name']),_0x3ec8('0x62'),{'uri':util[_0x3ec8('0x1b')](_0x3ec8('0x63'),_0x1c9919[_0x3ec8('0x27')][_0x3ec8('0x6d')](_0x3ec8('0x64'),''),_0x22c32d['id'])});break;default:logger[_0x3ec8('0x65')](_0x3ec8('0x6c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3ec8('0x67')](function(_0x3305e8){logger[_0x3ec8('0x65')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3305e8,{'showHidden':!![],'depth':null}));});};exports[_0x3ec8('0x6e')]=function(_0x46a838,_0x490abc,_0x2e9e9a,_0x567e77,_0x1dc7ca,_0x26b7e4){var _0x445459,_0x221d15;_0x26b7e4[_0x3ec8('0x27')]=intUtil[_0x3ec8('0x4f')](_0x26b7e4[_0x3ec8('0x27')]);_0x26b7e4[_0x3ec8('0x4e')]=intUtil[_0x3ec8('0x4f')](_0x26b7e4[_0x3ec8('0x4e')]);if(_0x1dc7ca&&_0x1dc7ca[_0x3ec8('0x50')]){logger[_0x3ec8('0x16')]('['+_0x490abc['lastevent'][_0x3ec8('0x6f')]()+']',_0x3ec8('0x52'));_0x490abc[_0x3ec8('0x53')]=util[_0x3ec8('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26b7e4[_0x3ec8('0x4e')],_0x490abc[_0x3ec8('0x55')],md5(_0x490abc[_0x3ec8('0x55')]));}else{_0x490abc['recordingURL']='';}headers[_0x3ec8('0x56')]=getAuth(_0x26b7e4);return getUser(_0x26b7e4)['then'](function(_0x309220){_0x445459=_0x309220;logger['info'](_0x3ec8('0x6b'),_0x445459['id']);return getEndUser(_0x26b7e4,_0x490abc[_0x3ec8('0x58')],_0x490abc['calleridnum']);})[_0x3ec8('0x15')](function(_0x463b6a){_0x221d15=_0x463b6a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x221d15['id']);return getTicket(_0x26b7e4,_0x445459,_0x221d15,_0x2e9e9a,_0x490abc);})[_0x3ec8('0x15')](function(_0x4bd111){if(_0x4bd111){logger[_0x3ec8('0x16')]('The\x20Ticket\x20ID\x20is:',_0x4bd111['id']);}})[_0x3ec8('0x67')](function(_0x36708c){logger[_0x3ec8('0x65')]('['+_0x490abc['lastevent'][_0x3ec8('0x6f')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x36708c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa392=['../../../../config/environment','../../../../config/logger','zendesk','defaults','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','count','find','results','remoteUri','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','custom_fields','push','variable','variableName','idField','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Authorization','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','catch','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis'];(function(_0x22ce9c,_0x447f62){var _0x5b4eed=function(_0x20444c){while(--_0x20444c){_0x22ce9c['push'](_0x22ce9c['shift']());}};_0x5b4eed(++_0x447f62);}(_0xa392,0x1c0));var _0x2a39=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa392[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x2a39('0x0'));var rp=require('request-promise');var md5=require(_0x2a39('0x1'));var util=require(_0x2a39('0x2'));var Redis=require(_0x2a39('0x3'));var intUtil=require('./util');var config=require(_0x2a39('0x4'));var logger=require(_0x2a39('0x5'))(_0x2a39('0x6'));config['redis']=_[_0x2a39('0x7')](config['redis'],{'host':_0x2a39('0x8'),'port':0x18eb});var io=require(_0x2a39('0x9'))(new Redis(config[_0x2a39('0xa')]));function emit(_0x1f1a08,_0x27f9f4,_0x576437){io['to'](_0x1f1a08)[_0x2a39('0xb')](_0x27f9f4,_0x576437);}var headers={'Content-Type':'application/json','Accept':_0x2a39('0xc')};function getTicket(_0xd1aa28,_0x5cd1aa,_0x5d7f0d,_0x16861e,_0xafcd96){logger[_0x2a39('0xd')](_0x2a39('0xe'));return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x10'),_0xd1aa28['remoteUri']),'method':_0x2a39('0x11'),'body':{'ticket':_[_0x2a39('0x12')]({'requester_id':_0x5d7f0d['id'],'submitter_id':_0x5cd1aa?_0x5cd1aa['id']:undefined,'assignee_id':_0x5cd1aa?_0x5cd1aa['id']:undefined,'tags':getTags(_0x16861e['Tags'],'name'),'subject':intUtil['getString'](_0x16861e[_0x2a39('0x13')],_0xafcd96,'\x20'),'description':intUtil[_0x2a39('0x14')](_0x16861e[_0x2a39('0x15')],_0xafcd96,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2a39('0x14')](_0x16861e[_0x2a39('0x15')],_0xafcd96,'\x0a')}},getCustomFields(_0x16861e[_0x2a39('0x16')],_0xafcd96))}})[_0x2a39('0x17')](function(_0x3e027c){logger[_0x2a39('0xd')](_0x2a39('0x18'));return _0x3e027c[_0x2a39('0x19')];});}function getUser(_0x51e6cf,_0x76325){if(intUtil[_0x2a39('0x1a')](_0x76325)){logger[_0x2a39('0xd')]('Getting\x20agent\x20with\x20email',_0x76325);return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x1b'),_0x51e6cf['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x76325)}})[_0x2a39('0x17')](function(_0x1960d1){if(_0x1960d1[_0x2a39('0x1c')]){logger[_0x2a39('0xd')]('Agent\x20found!');return _[_0x2a39('0x1d')](_0x1960d1[_0x2a39('0x1e')],{'email':_0x76325,'role':'agent'});}else{logger[_0x2a39('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x51e6cf[_0x2a39('0x1f')])})[_0x2a39('0x17')](function(_0x3466ed){logger[_0x2a39('0xd')]('Admin\x20account\x20selected.');return _0x3466ed[_0x2a39('0x20')];});}});}else{logger[_0x2a39('0xd')](_0x2a39('0x21'));return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x22'),_0x51e6cf[_0x2a39('0x1f')])})['then'](function(_0x2182e3){logger['info'](_0x2a39('0x23'));return _0x2182e3[_0x2a39('0x20')];});}}function getEndUser(_0x428978,_0x208cd3,_0x8fef98){logger[_0x2a39('0xd')](_0x2a39('0x24'),_0x8fef98);return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x1b'),_0x428978[_0x2a39('0x1f')]),'qs':{'query':util[_0x2a39('0xf')](_0x2a39('0x25'),_0x8fef98)}})[_0x2a39('0x17')](function(_0x199407){var _0x27940f;if(_0x199407[_0x2a39('0x1e')][_0x2a39('0x26')]){_0x199407[_0x2a39('0x1e')]=_[_0x2a39('0x27')](_0x199407[_0x2a39('0x1e')],{'suspended':![],'role':_0x2a39('0x28')});if(_0x199407['results'][_0x2a39('0x26')]){_0x27940f=_[_0x2a39('0x29')](_0x199407[_0x2a39('0x1e')]);}}if(_0x27940f){logger['info'](_0x2a39('0x2a'));return _0x27940f;}else{logger[_0x2a39('0xd')](_0x2a39('0x2b'));return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x2c'),_0x428978['remoteUri']),'method':_0x2a39('0x11'),'body':{'user':{'role':'end-user','name':util[_0x2a39('0xf')](_0x2a39('0x2d'),_0x208cd3||_0x8fef98),'phone':_0x8fef98}}})[_0x2a39('0x17')](function(_0x199910){logger[_0x2a39('0xd')](_0x2a39('0x2e'));return _0x199910['user'];});}});}function getAuth(_0x5574cf){var _0x556452;if(_0x5574cf['authType']===_0x2a39('0x2f')){_0x556452=util[_0x2a39('0xf')](_0x2a39('0x30'),_0x5574cf[_0x2a39('0x31')],_0x5574cf['password']);}else if(_0x5574cf['authType']===_0x2a39('0x32')){_0x556452=util[_0x2a39('0xf')](_0x2a39('0x33'),_0x5574cf[_0x2a39('0x31')],_0x5574cf['token']);}return util[_0x2a39('0xf')]('Basic\x20%s',new Buffer(_0x556452)[_0x2a39('0x34')](_0x2a39('0x35')));}function request(_0x4bd079){logger[_0x2a39('0x36')](_0x2a39('0x37'),JSON['stringify'](_0x4bd079));return rp(_[_0x2a39('0x7')](_0x4bd079,{'method':_0x2a39('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x39035f,_0x44da4e){var _0x244a7c=[];if(_0x39035f&&_0x39035f[_0x2a39('0x26')]>0x0){_0x244a7c=_[_0x2a39('0x39')](_0x39035f,_0x44da4e);}return _0x244a7c;}function getCustomFields(_0x8bbad6,_0x246a08){var _0x45d304=[];var _0xddf56b={'custom_fields':[]};if(_0x8bbad6[_0x2a39('0x26')]>0x0){_[_0x2a39('0x3a')](_0x8bbad6,function(_0x7c425c){if(_[_0x2a39('0x3b')]([_0x2a39('0x3c'),_0x2a39('0x3d')],_0x7c425c[_0x2a39('0x3e')])&&_0x7c425c[_0x2a39('0x3f')]&&!_0x7c425c[_0x2a39('0x40')]){_0xddf56b[_0x7c425c[_0x2a39('0x3f')]['toLowerCase']()]=_0x7c425c[_0x2a39('0x41')][_0x2a39('0x34')]();}else if(_['includes']([_0x2a39('0x3c'),_0x2a39('0x3d')],_0x7c425c[_0x2a39('0x3e')])&&_0x7c425c['idField']&&_0x7c425c[_0x2a39('0x40')]){_0xddf56b[_0x2a39('0x42')][_0x2a39('0x43')]({'id':_0x7c425c['idField'],'value':_0x7c425c[_0x2a39('0x41')]['toString']()});}else if(_0x7c425c[_0x2a39('0x3e')]===_0x2a39('0x44')&&_0x7c425c[_0x2a39('0x45')]&&_0x7c425c[_0x2a39('0x46')]&&_0x7c425c['customField']){_0x246a08[_0x7c425c['variableName']]&&_0xddf56b['custom_fields']['push']({'id':_0x7c425c[_0x2a39('0x46')],'value':_0x246a08[_0x7c425c[_0x2a39('0x45')]][_0x2a39('0x34')]()});}else if(_0x7c425c['type']===_0x2a39('0x47')&&_0x7c425c[_0x2a39('0x48')]&&_0x7c425c[_0x2a39('0x48')]['name']&&_0x7c425c[_0x2a39('0x46')]&&_0x7c425c[_0x2a39('0x40')]){_0x246a08[_0x7c425c[_0x2a39('0x48')][_0x2a39('0x49')]['toLowerCase']()]&&_0xddf56b[_0x2a39('0x42')][_0x2a39('0x43')]({'id':_0x7c425c[_0x2a39('0x46')],'value':_0x246a08[_0x7c425c[_0x2a39('0x48')][_0x2a39('0x49')][_0x2a39('0x4a')]()][_0x2a39('0x34')]()});}});}return _0xddf56b;}exports[_0x2a39('0x4b')]=function(_0x67bfee,_0x1d9611,_0xc55a05,_0x1cb0bd,_0x3c725d,_0x1b352f){var _0x522a0d,_0x1da672;_0x1b352f[_0x2a39('0x1f')]=intUtil[_0x2a39('0x4c')](_0x1b352f[_0x2a39('0x1f')]);_0x1b352f[_0x2a39('0x4d')]=intUtil[_0x2a39('0x4c')](_0x1b352f[_0x2a39('0x4d')]);if(_0x3c725d&&_0x3c725d['monitor_format']){logger['info'](_0x2a39('0x4e'),_0x2a39('0x4f'));_0x1d9611[_0x2a39('0x50')]=util[_0x2a39('0xf')](_0x2a39('0x51'),_0x1b352f['serverUrl'],_0x1d9611[_0x2a39('0x52')],md5(_0x1d9611[_0x2a39('0x52')]));}else{_0x1d9611[_0x2a39('0x50')]='';}headers['Authorization']=getAuth(_0x1b352f);return getUser(_0x1b352f,_0x1cb0bd[_0x2a39('0x53')])[_0x2a39('0x17')](function(_0x1254a3){_0x522a0d=_0x1254a3;logger[_0x2a39('0xd')](_0x2a39('0x54'),_0x522a0d['id']);return getEndUser(_0x1b352f,_0x1d9611[_0x2a39('0x55')],_0x1d9611[_0x2a39('0x56')]);})[_0x2a39('0x17')](function(_0x190748){_0x1da672=_0x190748;logger[_0x2a39('0xd')](_0x2a39('0x57'),_0x1da672['id']);return getTicket(_0x1b352f,_0x522a0d,_0x1da672,_0xc55a05,_0x1d9611);})[_0x2a39('0x17')](function(_0x10b3bf){if(_0x10b3bf){logger[_0x2a39('0xd')]('The\x20Ticket\x20ID\x20is:',_0x10b3bf['id']);switch(_0x1b352f['type']){case'integrationTab':logger['info'](_0x2a39('0x4e'),_0x2a39('0x58'));return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x59'),_0x1b352f[_0x2a39('0x1f')],_0x522a0d['id'],_0x10b3bf['id']),'method':'POST'});case'newTab':logger[_0x2a39('0xd')](_0x2a39('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2a39('0x5a'),_0x1cb0bd[_0x2a39('0x49')]),_0x2a39('0x5b'),{'uri':util['format'](_0x2a39('0x5c'),_0x1b352f[_0x2a39('0x1f')][_0x2a39('0x5d')](_0x2a39('0x5e'),''),_0x10b3bf['id'])});break;default:logger['error'](_0x2a39('0x4e'),_0x2a39('0x5f'));}}})['catch'](function(_0x2ed2ba){logger[_0x2a39('0x60')](_0x2a39('0x61'),util['inspect'](_0x2ed2ba,{'showHidden':!![],'depth':null}));});};exports[_0x2a39('0x62')]=function(_0x482c5a,_0x46d953,_0x5142df,_0x545139,_0x2ad7ba,_0x22c657,_0x48ab86){var _0x231a41,_0x550e19;_0x22c657['remoteUri']=intUtil[_0x2a39('0x4c')](_0x22c657[_0x2a39('0x1f')]);_0x22c657[_0x2a39('0x4d')]=intUtil[_0x2a39('0x4c')](_0x22c657['serverUrl']);if(_0x48ab86&&_0x48ab86[_0x2a39('0x63')]&&_0x48ab86[_0x2a39('0x63')]!=='none'){logger[_0x2a39('0xd')](_0x2a39('0x64'),_0x2a39('0x4f'));_0x46d953['recordingURL']=util['format'](_0x2a39('0x51'),_0x22c657[_0x2a39('0x4d')],_0x46d953['uniqueid'],md5(_0x46d953[_0x2a39('0x52')]));}headers[_0x2a39('0x65')]=getAuth(_0x22c657);return getUser(_0x22c657,_0x545139[_0x2a39('0x53')])[_0x2a39('0x17')](function(_0x43a033){_0x231a41=_0x43a033;logger[_0x2a39('0xd')](_0x2a39('0x54'),_0x231a41['id']);return getEndUser(_0x22c657,_0x46d953['destcalleridname'],_0x46d953['destcalleridnum']);})[_0x2a39('0x17')](function(_0x45ddb0){_0x550e19=_0x45ddb0;logger[_0x2a39('0xd')](_0x2a39('0x57'),_0x550e19['id']);return getTicket(_0x22c657,_0x231a41,_0x550e19,_0x5142df,_0x46d953);})[_0x2a39('0x17')](function(_0x1430ac){if(_0x1430ac){logger[_0x2a39('0xd')](_0x2a39('0x66'),_0x1430ac['id']);switch(_0x22c657[_0x2a39('0x3e')]){case _0x2a39('0x67'):logger[_0x2a39('0xd')](_0x2a39('0x64'),_0x2a39('0x58'));return request({'uri':util[_0x2a39('0xf')](_0x2a39('0x59'),_0x22c657[_0x2a39('0x1f')],_0x231a41['id'],_0x1430ac['id']),'method':_0x2a39('0x11')});case _0x2a39('0x68'):logger[_0x2a39('0xd')](_0x2a39('0x64'),_0x2a39('0x69'));emit(util[_0x2a39('0xf')](_0x2a39('0x5a'),_0x545139[_0x2a39('0x49')]),_0x2a39('0x5b'),{'uri':util[_0x2a39('0xf')]('%s/agent/tickets/%s',_0x22c657['remoteUri'][_0x2a39('0x5d')](_0x2a39('0x5e'),''),_0x1430ac['id'])});break;default:logger[_0x2a39('0x60')](_0x2a39('0x64'),_0x2a39('0x5f'));}}})['catch'](function(_0x16ceeb){logger[_0x2a39('0x60')](_0x2a39('0x6a'),util[_0x2a39('0x6b')](_0x16ceeb,{'showHidden':!![],'depth':null}));});};exports[_0x2a39('0x6c')]=function(_0x5ce92f,_0xf9b21e,_0x2c6355,_0x407691,_0x33a13b,_0x7de70){var _0x59af45,_0x211452;_0x7de70['remoteUri']=intUtil['stripTrailingSlash'](_0x7de70[_0x2a39('0x1f')]);_0x7de70[_0x2a39('0x4d')]=intUtil[_0x2a39('0x4c')](_0x7de70[_0x2a39('0x4d')]);if(_0x33a13b&&_0x33a13b['monitor_format']){logger['info']('['+_0xf9b21e[_0x2a39('0x6d')][_0x2a39('0x6e')]()+']',_0x2a39('0x4f'));_0xf9b21e['recordingURL']=util['format'](_0x2a39('0x51'),_0x7de70[_0x2a39('0x4d')],_0xf9b21e[_0x2a39('0x52')],md5(_0xf9b21e['uniqueid']));}else{_0xf9b21e[_0x2a39('0x50')]='';}headers[_0x2a39('0x65')]=getAuth(_0x7de70);return getUser(_0x7de70)[_0x2a39('0x17')](function(_0x1cf75c){_0x59af45=_0x1cf75c;logger[_0x2a39('0xd')](_0x2a39('0x54'),_0x59af45['id']);return getEndUser(_0x7de70,_0xf9b21e['calleridname'],_0xf9b21e['calleridnum']);})[_0x2a39('0x17')](function(_0x3e50ff){_0x211452=_0x3e50ff;logger['info'](_0x2a39('0x57'),_0x211452['id']);return getTicket(_0x7de70,_0x59af45,_0x211452,_0x2c6355,_0xf9b21e);})[_0x2a39('0x17')](function(_0x18f254){if(_0x18f254){logger['info'](_0x2a39('0x66'),_0x18f254['id']);}})[_0x2a39('0x6f')](function(_0x31d80b){logger[_0x2a39('0x60')]('['+_0xf9b21e[_0x2a39('0x6d')][_0x2a39('0x6e')]()+']'+_0x2a39('0x70'),util[_0x2a39('0x6b')](_0x31d80b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 969d4f8..333518c 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x613c=['Creating\x20new\x20call...','Owner','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','YYYY-MM-DDTHH:mm:ss','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','unmanaged','/api/voice/recordings/','zoho.eu','toUpperCase','lodash','request-promise','util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','/crm/v2/','startCase','moduleCreate','first_name','last_name','SUCCESS','data','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x613c,0xd9));var _0xc613=function(_0x49918e,_0x52288c){_0x49918e=_0x49918e-0x0;var _0x3b9b50=_0x613c[_0x49918e];return _0x3b9b50;};'use strict';var _=require(_0xc613('0x0'));var rp=require(_0xc613('0x1'));var md5=require('md5');var util=require(_0xc613('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xc613('0x3'));var BPromise=require(_0xc613('0x4'));var config=require(_0xc613('0x5'));var logger=require(_0xc613('0x6'))('zoho');config[_0xc613('0x7')]=_[_0xc613('0x8')](config[_0xc613('0x7')],{'host':_0xc613('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc613('0x7')]));function emit(_0x37f461,_0x521605,_0xe0730a){io['to'](_0x37f461)[_0xc613('0xa')](_0x521605,_0xe0730a);}function request(_0x16faab){logger['debug'](_0xc613('0xb'),JSON[_0xc613('0xc')](_0x16faab));return rp(_0x16faab);}function getCustomFields(_0x5ed3db,_0xb8705d){var _0x556b52={};if(_0x5ed3db[_0xc613('0xd')]>0x0){_[_0xc613('0xe')](_0x5ed3db,function(_0x42eaf8){if(_[_0xc613('0xf')]([_0xc613('0x10'),'picklist'],_0x42eaf8[_0xc613('0x11')])&&_0x42eaf8[_0xc613('0x12')]){_0x556b52[_0x42eaf8[_0xc613('0x12')]]=_0x42eaf8[_0xc613('0x13')][_0xc613('0x14')]();}else if(_0x42eaf8['type']==='variable'&&_0x42eaf8[_0xc613('0x15')]&&_0x42eaf8[_0xc613('0x12')]&&_0xb8705d[_0x42eaf8[_0xc613('0x15')]]){_0x556b52[_0x42eaf8[_0xc613('0x12')]]=_0xb8705d[_0x42eaf8[_0xc613('0x15')]][_0xc613('0x14')]();}else if(_0x42eaf8[_0xc613('0x11')]===_0xc613('0x16')&&_0x42eaf8[_0xc613('0x17')]&&_0x42eaf8['Variable'][_0xc613('0x18')]&&_0x42eaf8[_0xc613('0x12')]&&_0xb8705d[_0x42eaf8[_0xc613('0x17')][_0xc613('0x18')][_0xc613('0x19')]()]){_0x556b52[_0x42eaf8[_0xc613('0x12')]]=_0xb8705d[_0x42eaf8['Variable'][_0xc613('0x18')]['toLowerCase']()][_0xc613('0x14')]();}});}return _0x556b52;}function getName(_0xa2384){if(_0xa2384[_0xc613('0x1a')]('\x20')>0x0){var _0x117ccd=_0xa2384[_0xc613('0x1b')](/ (.+)/);if(_0x117ccd[0x1]){return _0x117ccd;}}return[_0xa2384,_0xa2384];}var accountsTokens={};function getAccessToken(_0x363d64){return new Promise(function(_0x51e830,_0x121425){if(!_[_0xc613('0x1c')](accountsTokens[_0x363d64['id']])&&!_[_0xc613('0x1c')](accountsTokens[_0x363d64['id']][_0xc613('0x1d')])){if(moment()[_0xc613('0x1e')](accountsTokens[_0x363d64['id']][_0xc613('0x1f')])){_0x51e830(accountsTokens[_0x363d64['id']]['access_token']);}}var _0x3a7b72;switch(_0x363d64[_0xc613('0x20')]){case'US':_0x3a7b72='https://accounts.zoho.com';break;case'AU':_0x3a7b72='https://accounts.zoho.com.au';break;case'EU':_0x3a7b72=_0xc613('0x21');break;case'IN':_0x3a7b72=_0xc613('0x22');break;case'CN':_0x3a7b72=_0xc613('0x23');break;default:_0x3a7b72=_0xc613('0x21');break;}var _0x24cd15={'method':_0xc613('0x24'),'uri':_0x3a7b72+_0xc613('0x25'),'qs':{'refresh_token':_0x363d64[_0xc613('0x26')],'client_id':_0x363d64[_0xc613('0x27')],'client_secret':_0x363d64[_0xc613('0x28')],'grant_type':_0xc613('0x29')},'json':!![]};return rp(_0x24cd15)[_0xc613('0x2a')](function(_0x56aa21){accountsTokens[_0x363d64['id']]={'access_token':_0x56aa21['access_token'],'expires_in':moment()['add'](_0x56aa21[_0xc613('0x1f')],_0xc613('0x2b'))};_0x51e830(_0x56aa21[_0xc613('0x1d')]);})['catch'](function(_0xe25999){logger[_0xc613('0x2c')](_0xc613('0x2d'),_0xe25999[_0xc613('0x2e')]);_0x121425(_0xe25999);});});}function getUser(_0x44d555,_0x5b6c10,_0x53e5c4,_0x5a7ebc){logger['info'](_0xc613('0x2f'));return request({'method':'GET','uri':util[_0xc613('0x30')](_0xc613('0x31'),_0x5b6c10),'qs':{'type':_0xc613('0x32')},'headers':{'Authorization':_0xc613('0x33')+_0x44d555},'json':!![]})['then'](function(_0xc34ac5){if(_0xc34ac5[_0xc613('0x34')]){var _0x311f24=-0x1;if(_[_0xc613('0x35')](_0xc34ac5[_0xc613('0x34')])){if(!_[_0xc613('0x1c')](_0x5a7ebc)){_0x311f24=_[_0xc613('0x36')](_0xc34ac5[_0xc613('0x34')],function(_0x5c4ff6){return _0x5c4ff6[_0xc613('0x37')]===_0x5a7ebc;});}if(_0x311f24>=0x0){logger[_0xc613('0x38')](_0xc613('0x39'));}else{logger[_0xc613('0x38')](_0xc613('0x3a'));_0x311f24=_['findIndex'](_0xc34ac5[_0xc613('0x34')],function(_0x81a1a0){return _0x81a1a0[_0xc613('0x3b')]['name']===_0xc613('0x3c');});}return _0xc34ac5['users'][_0x311f24];}else{if(_0xc34ac5[_0xc613('0x3d')][_0xc613('0x3b')][_0xc613('0x18')]===_0xc613('0x3c')){logger[_0xc613('0x38')](_0xc613('0x3a'));user=_0xc34ac5['user'];return user;}else{logger['error'](_0xc613('0x3e'),JSON[_0xc613('0xc')](_0xc34ac5));throw new Error(_0xc613('0x3f')+JSON[_0xc613('0xc')](_0xc34ac5));}}}else{logger['error'](_0xc613('0x3e'),JSON['stringify'](_0xc34ac5));throw new Error(_0xc613('0x3f')+JSON[_0xc613('0xc')](_0xc34ac5));}})[_0xc613('0x40')](function(_0x5f0424){console[_0xc613('0x2c')](_0x5f0424);});}function getZohoUser(_0x17a4f1,_0x503166){return new BPromise(function(_0x14944c,_0x3b63b2){request(_0x17a4f1)[_0xc613('0x2a')](function(_0x8d9db3){var _0x42a1e3=null;if(_0x8d9db3){_0x42a1e3=_0x8d9db3['data'][0x0];_0x42a1e3[_0xc613('0x41')]=_0x503166;}_0x14944c(_0x42a1e3);})['catch'](function(_0x419dcd){_0x3b63b2(_0x419dcd);});});}function createEndUser(_0xc7db99,_0x349e4d,_0x332bf9,_0x4239e6,_0x3f90c1,_0x1445c3){var _0x332bf9=getName(_0x332bf9);return request({'method':_0xc613('0x24'),'uri':'https://www.zohoapis.'+_0x349e4d+_0xc613('0x42')+_[_0xc613('0x43')](_0x1445c3[_0xc613('0x44')])+'s','body':{'data':[{'Last_Name':_0x332bf9[0x1],'First_Name':_0x332bf9[0x0],'Phone':_0x4239e6,'Owner':{'name':!_['isNil'](_0x3f90c1['role'][_0xc613('0x18')])?_0x3f90c1['role'][_0xc613('0x18')]:!_['isNil'](_0x3f90c1[_0xc613('0x45')])?_0x3f90c1[_0xc613('0x45')]+'\x20'+_0x3f90c1[_0xc613('0x46')]:_0x3f90c1['last_name'],'id':_0x3f90c1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xc7db99},'json':!![]})['then'](function(_0x3b72fe){if(_0x3b72fe&&_0x3b72fe['data'][0x0]['code']===_0xc613('0x47')){var _0x30f640=_0x3b72fe[_0xc613('0x48')][0x0][_0xc613('0x49')];_0x30f640[_0xc613('0x41')]=_[_0xc613('0x43')](_0x1445c3[_0xc613('0x44')])+'s';return _0x30f640;}logger[_0xc613('0x2c')](_0xc613('0x3e'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xc613('0x40')](function(_0x389133){console[_0xc613('0x4a')](_0xc613('0x4b'),_0x389133);});}function getEndUser(_0x2aca8c,_0x5876fb,_0x110e36,_0x40ed36,_0x2f790f,_0x38bd1f,_0x2d4f7e){var _0x10f4f3={'method':'GET','uri':'','headers':{'Authorization':_0xc613('0x33')+_0x2aca8c},'json':!![]};switch(_0x2d4f7e[_0xc613('0x4c')]){case _0xc613('0x4d'):_0x10f4f3['uri']=_0xc613('0x4e')+_0x5876fb+_0xc613('0x4f')+_0x2f790f+'))';return getZohoUser(_0x10f4f3,_0xc613('0x50'))[_0xc613('0x2a')](function(_0x17a96d){if(_0x17a96d)return _0x17a96d;_0x10f4f3[_0xc613('0x51')]=_0xc613('0x4e')+_0x5876fb+_0xc613('0x52')+_0x2f790f+'))';return getZohoUser(_0x10f4f3,_0xc613('0x53'))[_0xc613('0x2a')](function(_0x3edadb){if(_0x3edadb)return _0x3edadb;if(_0x2d4f7e[_0xc613('0x44')]!=_0xc613('0x54')){return createEndUser(_0x2aca8c,_0x5876fb,_0x40ed36,_0x2f790f,_0x38bd1f,_0x2d4f7e);}else{return{};}});});break;case _0xc613('0x55'):_0x10f4f3[_0xc613('0x51')]=_0xc613('0x4e')+_0x5876fb+_0xc613('0x4f')+_0x2f790f+'))';return getZohoUser(_0x10f4f3,'Contacts')['then'](function(_0x2b5020){if(_0x2b5020)return _0x2b5020;if(_0x2d4f7e[_0xc613('0x44')]!=_0xc613('0x54')){return createEndUser(_0x2aca8c,_0x5876fb,_0x40ed36,_0x2f790f,_0x38bd1f,_0x2d4f7e);}else{return{};}});break;case _0xc613('0x56'):_0x10f4f3[_0xc613('0x51')]=_0xc613('0x4e')+_0x5876fb+_0xc613('0x52')+_0x2f790f+'))';return getZohoUser(_0x10f4f3,_0xc613('0x53'))[_0xc613('0x2a')](function(_0x1373a5){if(_0x1373a5)return _0x1373a5;if(_0x2d4f7e[_0xc613('0x44')]!=_0xc613('0x54')){return createEndUser(_0x2aca8c,_0x5876fb,_0x40ed36,_0x2f790f,_0x38bd1f,_0x2d4f7e);}else{return{};}});break;}}function getCall(_0x8829b4,_0x40db57,_0x269539,_0x2bf44a,_0x3d07ca,_0x3a3982,_0x554117,_0x4451c1){logger[_0xc613('0x38')](_0xc613('0x57'));var _0x1ecda3={};_0x1ecda3[_0xc613('0x58')]={'name':!_['isNil'](_0x2bf44a['role'][_0xc613('0x18')])&&!_['isNil'](_0x2bf44a['profile']['name'])&&_0x2bf44a[_0xc613('0x3b')][_0xc613('0x18')]==='administrator'?_0x2bf44a['role'][_0xc613('0x18')]:!_[_0xc613('0x1c')](_0x2bf44a['first_name'])?_0x2bf44a[_0xc613('0x45')]+'\x20'+_0x2bf44a[_0xc613('0x46')]:_0x2bf44a['last_name'],'id':_0x2bf44a['id']};_0x1ecda3['Subject']=intUtil[_0xc613('0x59')](_0x3a3982['Subjects'],_0x554117,'\x20');_0x1ecda3[_0xc613('0x5a')]=intUtil[_0xc613('0x59')](_0x3a3982['Descriptions'],_0x554117,'\x0a');if(_0x3d07ca['enduserType']===_0xc613('0x50')){_0x1ecda3[_0xc613('0x5b')]={'name':!_['isNil'](_0x3d07ca[_0xc613('0x5c')])?_0x3d07ca[_0xc613('0x5c')]:!_['isNil'](_0x3d07ca['First_Name'])?_0x3d07ca[_0xc613('0x5d')]+'\x20'+_0x3d07ca[_0xc613('0x5e')]:_0x3d07ca[_0xc613('0x5e')],'id':_0x3d07ca['id']};}if(_0x3d07ca['enduserType']===_0xc613('0x53')){_0x1ecda3[_0xc613('0x5f')]={'name':!_[_0xc613('0x1c')](_0x3d07ca[_0xc613('0x5c')])?_0x3d07ca[_0xc613('0x5c')]:!_['isNil'](_0x3d07ca[_0xc613('0x5d')])?_0x3d07ca[_0xc613('0x5d')]+'\x20'+_0x3d07ca[_0xc613('0x5e')]:_0x3d07ca[_0xc613('0x5e')],'id':_0x3d07ca['id']};_0x1ecda3[_0xc613('0x60')]=_[_0xc613('0x43')](_0x3d07ca[_0xc613('0x41')]);}if(_0x554117[_0xc613('0x61')]){_0x1ecda3[_0xc613('0x62')]=moment['utc'](parseInt(_0x554117[_0xc613('0x61')])*0x3e8)[_0xc613('0x30')](_0xc613('0x63'));}else if(_0x554117[_0xc613('0x64')]&&_0x554117[_0xc613('0x65')]){_0x1ecda3[_0xc613('0x62')]=moment[_0xc613('0x66')](moment(_0x554117[_0xc613('0x65')],'YYYY-MM-DDTHH:mm:ss')[_0xc613('0x67')](moment(_0x554117[_0xc613('0x68')],'YYYY-MM-DDTHH:mm:ss')))[_0xc613('0x30')]('mm:ss');}switch(_0x554117[_0xc613('0x69')]){case _0xc613('0x6a'):_0x1ecda3['Call_Result']=_0xc613('0x6b');break;case _0xc613('0x6c'):case _0xc613('0x6d'):_0x1ecda3[_0xc613('0x6e')]='Answered';break;case _0xc613('0x6f'):_0x1ecda3[_0xc613('0x6e')]=_0xc613('0x70');break;case'abandoned':_0x1ecda3[_0xc613('0x6e')]=_0xc613('0x71');break;case'timeout':_0x1ecda3[_0xc613('0x6e')]=_0xc613('0x72');default:}_0x1ecda3[_0xc613('0x73')]=(_0x4451c1==='outbound'?moment(_0x554117[_0xc613('0x68')])[_0xc613('0x30')](_0xc613('0x74')):moment(_0x554117['agentcalledAt'])[_0xc613('0x30')](_0xc613('0x74')))||moment()[_0xc613('0x30')](_0xc613('0x74'));_0x1ecda3[_0xc613('0x75')]=_0x4451c1||_0xc613('0x76');_0x1ecda3=_[_0xc613('0x77')](_0x1ecda3,getCustomFields(_0x3a3982[_0xc613('0x78')],_0x554117));return request({'method':_0xc613('0x24'),'uri':_0xc613('0x4e')+_0x40db57+_0xc613('0x79'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x8829b4},'body':{'data':[_0x1ecda3]},'json':!![]})[_0xc613('0x2a')](function(_0x3d419c){if(_0x3d419c&&_0x3d419c[_0xc613('0x48')][0x0][_0xc613('0x7a')]===_0xc613('0x47')){logger[_0xc613('0x38')]('Call\x20created!');return{'id':_0x3d419c[_0xc613('0x48')][0x0]['details']['id']};}})[_0xc613('0x40')](function(_0x4053ea){logger[_0xc613('0x38')]('err',_0x4053ea['stack']);console[_0xc613('0x4a')]('err',_0x4053ea);});}exports[_0xc613('0x7b')]=function(_0x4c0da7,_0x286b50,_0x2bc9a6,_0xcf24e5,_0x47ac0c,_0x44e572){var _0x2bfdcb,_0x1b9a28,_0x54930e;_0x44e572[_0xc613('0x7c')]=intUtil[_0xc613('0x7d')](_0x44e572[_0xc613('0x7c')]);_0x44e572[_0xc613('0x7e')]=intUtil[_0xc613('0x7d')](_0x44e572[_0xc613('0x7e')]);if(_0x47ac0c&&_0x47ac0c[_0xc613('0x7f')]){logger['info'](_0xc613('0x80'),_0xc613('0x81'));_0x286b50[_0xc613('0x82')]=_0x44e572[_0xc613('0x7e')]+'/api/voice/recordings/'+_0x286b50[_0xc613('0x83')]+_0xc613('0x84')+md5(_0x286b50[_0xc613('0x83')]);}else{_0x286b50[_0xc613('0x82')]='';}var _0x4dacd8=_0x44e572[_0xc613('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x44e572)['then'](function(_0x429f0a){_0x54930e=_0x429f0a;return getUser(_0x54930e,_0x4dacd8,_0x44e572,_0xcf24e5[_0xc613('0x37')]);})['then'](function(_0x1a0728){_0x2bfdcb=_0x1a0728;logger['info'](_0xc613('0x85'),_0x2bfdcb['id']);return getEndUser(_0x54930e,_0x4dacd8,_0x44e572,_0x286b50[_0xc613('0x86')],_0x286b50[_0xc613('0x87')],_0x2bfdcb,_0x2bc9a6);})[_0xc613('0x2a')](function(_0x52ae51){_0x1b9a28=_0x52ae51;return getCall(_0x54930e,_0x4dacd8,_0x44e572,_0x2bfdcb,_0x1b9a28,_0x2bc9a6,_0x286b50,_0xc613('0x76'));})[_0xc613('0x2a')](function(_0x4c34e0){if(_0x4c34e0){logger[_0xc613('0x38')](_0xc613('0x88'),_0x4c34e0['id']);logger[_0xc613('0x38')](_0xc613('0x80'),_0xc613('0x89'));emit(util[_0xc613('0x30')](_0xc613('0x8a'),_0xcf24e5[_0xc613('0x18')]),_0xc613('0x8b'),{'uri':_0xc613('0x8c')+_0x44e572[_0xc613('0x7c')]+_0xc613('0x8d')+_0x4c34e0['id']});}})[_0xc613('0x40')](function(_0x16f1f3){logger[_0xc613('0x2c')](_0xc613('0x80'),JSON['stringify'](_0x16f1f3));});};exports[_0xc613('0x8e')]=function(_0x241baf,_0x4682f1,_0x54359c,_0x1eb44f,_0x3aae22,_0x49acf6,_0x444104){var _0x29d979,_0x56e1b5,_0x25f5f0;_0x49acf6[_0xc613('0x7c')]=intUtil[_0xc613('0x7d')](_0x49acf6[_0xc613('0x7c')]);_0x49acf6[_0xc613('0x7e')]=intUtil['stripTrailingSlash'](_0x49acf6[_0xc613('0x7e')]);if(_0x444104&&_0x444104[_0xc613('0x8f')]&&_0x444104[_0xc613('0x8f')]!=='none'){logger['info'](_0xc613('0x90'),'Recording\x20is\x20enabled!');_0x4682f1[_0xc613('0x82')]=_0x49acf6[_0xc613('0x7e')]+'/api/voice/recordings/'+_0x4682f1['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4682f1[_0xc613('0x83')]);}var _0x14f4c6=_0x49acf6[_0xc613('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x49acf6)[_0xc613('0x2a')](function(_0x4c3c6e){_0x25f5f0=_0x4c3c6e;return getUser(_0x25f5f0,_0x14f4c6,_0x49acf6,_0x1eb44f[_0xc613('0x37')]);})[_0xc613('0x2a')](function(_0x393f9b){_0x29d979=_0x393f9b;logger[_0xc613('0x38')](_0xc613('0x85'),_0x29d979['id']);return getEndUser(_0x25f5f0,_0x14f4c6,_0x49acf6,_0x4682f1[_0xc613('0x91')],_0x4682f1[_0xc613('0x92')],_0x29d979,_0x54359c);})['then'](function(_0x5ad4d7){_0x56e1b5=_0x5ad4d7;return getCall(_0x25f5f0,_0x14f4c6,_0x49acf6,_0x29d979,_0x56e1b5,_0x54359c,_0x4682f1,_0xc613('0x93'));})[_0xc613('0x2a')](function(_0x1b0a02){if(_0x1b0a02){logger['info'](_0xc613('0x88'),_0x1b0a02['id']);logger[_0xc613('0x38')](_0xc613('0x90'),_0xc613('0x89'));emit(util[_0xc613('0x30')](_0xc613('0x8a'),_0x1eb44f[_0xc613('0x18')]),_0xc613('0x8b'),{'uri':_0xc613('0x8c')+_0x49acf6[_0xc613('0x7c')]+_0xc613('0x8d')+_0x1b0a02['id']});}})[_0xc613('0x40')](function(_0x38e648){logger[_0xc613('0x2c')](_0xc613('0x90'),JSON[_0xc613('0xc')](_0x38e648));});};exports[_0xc613('0x94')]=function(_0x191f50,_0xd98490,_0xe31bb3,_0x59777c,_0x1ef223,_0x364b8f){var _0x5e9f99,_0x185c29,_0x46a552;_0x364b8f['host']=intUtil['stripTrailingSlash'](_0x364b8f[_0xc613('0x7c')]);_0x364b8f['serverUrl']=intUtil[_0xc613('0x7d')](_0x364b8f[_0xc613('0x7e')]);if(_0x1ef223&&_0x1ef223[_0xc613('0x7f')]){logger['info']('['+_0xd98490[_0xc613('0x69')]['toUpperCase']()+']',_0xc613('0x81'));_0xd98490[_0xc613('0x82')]=_0x364b8f[_0xc613('0x7e')]+_0xc613('0x95')+_0xd98490['uniqueid']+_0xc613('0x84')+md5(_0xd98490[_0xc613('0x83')]);}else{_0xd98490['recordingURL']='';}var _0x3179fd=_0x364b8f[_0xc613('0x7c')]===_0xc613('0x96')?'eu':'com';return getAccessToken(_0x364b8f)['then'](function(_0x23b115){_0x46a552=_0x23b115;return getUser(_0x46a552,_0x3179fd,_0x364b8f);})[_0xc613('0x2a')](function(_0x1f65cb){_0x5e9f99=_0x1f65cb;logger[_0xc613('0x38')]('The\x20User\x20ID\x20is:',_0x5e9f99['id']);return getEndUser(_0x46a552,_0x3179fd,_0x364b8f,_0xd98490['calleridname'],_0xd98490[_0xc613('0x87')],_0x5e9f99,_0xe31bb3);})[_0xc613('0x2a')](function(_0x1868b9){_0x185c29=_0x1868b9;return getCall(_0x46a552,_0x3179fd,_0x364b8f,_0x5e9f99,_0x185c29,_0xe31bb3,_0xd98490,_0xc613('0x76'));})[_0xc613('0x2a')](function(_0x3f1c81){if(_0x3f1c81){logger[_0xc613('0x38')](_0xc613('0x88'),_0x3f1c81['id']);}})['catch'](function(_0xbd5d54){logger[_0xc613('0x2c')]('['+_0xd98490[_0xc613('0x69')][_0xc613('0x97')]()+']',JSON[_0xc613('0xc')](_0xbd5d54));});}; \ No newline at end of file +var _0xa4ce=['idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','profile','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','Owner','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','connect','Call_Result','rejected','abandoned','Abandoned','Timeout','outbound','agentcalledAt','Inbound','code','Call\x20created!','err','stack','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridnum','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','emit','debug','stringify','forEach','includes','string','picklist','type'];(function(_0x12315c,_0x12aa7f){var _0x153f33=function(_0x40578a){while(--_0x40578a){_0x12315c['push'](_0x12315c['shift']());}};_0x153f33(++_0x12aa7f);}(_0xa4ce,0x193));var _0xea4c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa4ce[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xea4c('0x0'));var rp=require(_0xea4c('0x1'));var md5=require(_0xea4c('0x2'));var util=require(_0xea4c('0x3'));var intUtil=require(_0xea4c('0x4'));var moment=require(_0xea4c('0x5'));var Redis=require(_0xea4c('0x6'));var BPromise=require(_0xea4c('0x7'));var config=require(_0xea4c('0x8'));var logger=require(_0xea4c('0x9'))('zoho');config[_0xea4c('0xa')]=_['defaults'](config[_0xea4c('0xa')],{'host':_0xea4c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x763dbc,_0x4276a7,_0x2db05f){io['to'](_0x763dbc)[_0xea4c('0xc')](_0x4276a7,_0x2db05f);}function request(_0x10fddd){logger[_0xea4c('0xd')]('[HTTP]',JSON[_0xea4c('0xe')](_0x10fddd));return rp(_0x10fddd);}function getCustomFields(_0x1b7bd8,_0x40544b){var _0x42b4db={};if(_0x1b7bd8['length']>0x0){_[_0xea4c('0xf')](_0x1b7bd8,function(_0x4fa7dd){if(_[_0xea4c('0x10')]([_0xea4c('0x11'),_0xea4c('0x12')],_0x4fa7dd[_0xea4c('0x13')])&&_0x4fa7dd[_0xea4c('0x14')]){_0x42b4db[_0x4fa7dd[_0xea4c('0x14')]]=_0x4fa7dd[_0xea4c('0x15')][_0xea4c('0x16')]();}else if(_0x4fa7dd[_0xea4c('0x13')]===_0xea4c('0x17')&&_0x4fa7dd[_0xea4c('0x18')]&&_0x4fa7dd[_0xea4c('0x14')]&&_0x40544b[_0x4fa7dd[_0xea4c('0x18')]]){_0x42b4db[_0x4fa7dd[_0xea4c('0x14')]]=_0x40544b[_0x4fa7dd[_0xea4c('0x18')]][_0xea4c('0x16')]();}else if(_0x4fa7dd[_0xea4c('0x13')]===_0xea4c('0x19')&&_0x4fa7dd[_0xea4c('0x1a')]&&_0x4fa7dd[_0xea4c('0x1a')]['name']&&_0x4fa7dd[_0xea4c('0x14')]&&_0x40544b[_0x4fa7dd[_0xea4c('0x1a')][_0xea4c('0x1b')][_0xea4c('0x1c')]()]){_0x42b4db[_0x4fa7dd[_0xea4c('0x14')]]=_0x40544b[_0x4fa7dd['Variable'][_0xea4c('0x1b')][_0xea4c('0x1c')]()][_0xea4c('0x16')]();}});}return _0x42b4db;}function getName(_0xb123bd){if(_0xb123bd[_0xea4c('0x1d')]('\x20')>0x0){var _0x5029b5=_0xb123bd['split'](/ (.+)/);if(_0x5029b5[0x1]){return _0x5029b5;}}return[_0xb123bd,_0xb123bd];}var accountsTokens={};function getAccessToken(_0x25ecdc){return new Promise(function(_0x9d43c6,_0x115648){if(!_[_0xea4c('0x1e')](accountsTokens[_0x25ecdc['id']])&&!_[_0xea4c('0x1e')](accountsTokens[_0x25ecdc['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x25ecdc['id']][_0xea4c('0x1f')])){_0x9d43c6(accountsTokens[_0x25ecdc['id']][_0xea4c('0x20')]);}}var _0x3f54d1;switch(_0x25ecdc[_0xea4c('0x21')]){case'US':_0x3f54d1=_0xea4c('0x22');break;case'AU':_0x3f54d1=_0xea4c('0x23');break;case'EU':_0x3f54d1=_0xea4c('0x24');break;case'IN':_0x3f54d1=_0xea4c('0x25');break;case'CN':_0x3f54d1='https://accounts.zoho.com.cn';break;default:_0x3f54d1=_0xea4c('0x24');break;}var _0x181d85={'method':_0xea4c('0x26'),'uri':_0x3f54d1+_0xea4c('0x27'),'qs':{'refresh_token':_0x25ecdc['refreshToken'],'client_id':_0x25ecdc[_0xea4c('0x28')],'client_secret':_0x25ecdc['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x181d85)[_0xea4c('0x29')](function(_0x411d66){accountsTokens[_0x25ecdc['id']]={'access_token':_0x411d66['access_token'],'expires_in':moment()['add'](_0x411d66[_0xea4c('0x1f')],_0xea4c('0x2a'))};_0x9d43c6(_0x411d66[_0xea4c('0x20')]);})[_0xea4c('0x2b')](function(_0x3fe4d5){logger[_0xea4c('0x2c')](_0xea4c('0x2d'),_0x3fe4d5['stack']);_0x115648(_0x3fe4d5);});});}function getUser(_0x45dc48,_0x23bc3f,_0x1c79ef,_0xd0d108){logger[_0xea4c('0x2e')](_0xea4c('0x2f'));return request({'method':_0xea4c('0x30'),'uri':util[_0xea4c('0x31')](_0xea4c('0x32'),_0x23bc3f),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x45dc48},'json':!![]})[_0xea4c('0x29')](function(_0x13ac04){if(_0x13ac04[_0xea4c('0x33')]){var _0xaec73e=-0x1;if(_[_0xea4c('0x34')](_0x13ac04['users'])){if(!_[_0xea4c('0x1e')](_0xd0d108)){_0xaec73e=_[_0xea4c('0x35')](_0x13ac04[_0xea4c('0x33')],function(_0x5281ab){return _0x5281ab[_0xea4c('0x36')]===_0xd0d108;});}if(_0xaec73e>=0x0){logger['info'](_0xea4c('0x37'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0xaec73e=_[_0xea4c('0x35')](_0x13ac04[_0xea4c('0x33')],function(_0x3359fa){return _0x3359fa['profile'][_0xea4c('0x1b')]===_0xea4c('0x38');});}return _0x13ac04[_0xea4c('0x33')][_0xaec73e];}else{if(_0x13ac04['user'][_0xea4c('0x39')][_0xea4c('0x1b')]===_0xea4c('0x38')){logger[_0xea4c('0x2e')](_0xea4c('0x3a'));user=_0x13ac04[_0xea4c('0x3b')];return user;}else{logger['error'](_0xea4c('0x3c'),JSON[_0xea4c('0xe')](_0x13ac04));throw new Error(_0xea4c('0x3d')+JSON[_0xea4c('0xe')](_0x13ac04));}}}else{logger[_0xea4c('0x2c')](_0xea4c('0x3c'),JSON[_0xea4c('0xe')](_0x13ac04));throw new Error(_0xea4c('0x3d')+JSON[_0xea4c('0xe')](_0x13ac04));}})[_0xea4c('0x2b')](function(_0x5a800f){console[_0xea4c('0x2c')](_0x5a800f);});}function getZohoUser(_0x4f8259,_0x5dd998){return new BPromise(function(_0x7bd931,_0x40175d){request(_0x4f8259)['then'](function(_0x18d74b){var _0x4ba476=null;if(_0x18d74b){_0x4ba476=_0x18d74b[_0xea4c('0x3e')][0x0];_0x4ba476[_0xea4c('0x3f')]=_0x5dd998;}_0x7bd931(_0x4ba476);})[_0xea4c('0x2b')](function(_0x116183){_0x40175d(_0x116183);});});}function createEndUser(_0x3e5d5f,_0x3680ff,_0x46875b,_0x4ccffc,_0x4ecd59,_0x198978){var _0x46875b=getName(_0x46875b);return request({'method':'POST','uri':_0xea4c('0x40')+_0x3680ff+'/crm/v2/'+_[_0xea4c('0x41')](_0x198978[_0xea4c('0x42')])+'s','body':{'data':[{'Last_Name':_0x46875b[0x1],'First_Name':_0x46875b[0x0],'Phone':_0x4ccffc,'Owner':{'name':!_[_0xea4c('0x1e')](_0x4ecd59[_0xea4c('0x43')][_0xea4c('0x1b')])?_0x4ecd59[_0xea4c('0x43')]['name']:!_['isNil'](_0x4ecd59['first_name'])?_0x4ecd59[_0xea4c('0x44')]+'\x20'+_0x4ecd59['last_name']:_0x4ecd59[_0xea4c('0x45')],'id':_0x4ecd59['id']}}]},'headers':{'Authorization':_0xea4c('0x46')+_0x3e5d5f},'json':!![]})[_0xea4c('0x29')](function(_0x34ec7f){if(_0x34ec7f&&_0x34ec7f[_0xea4c('0x3e')][0x0]['code']===_0xea4c('0x47')){var _0x133dea=_0x34ec7f[_0xea4c('0x3e')][0x0][_0xea4c('0x48')];_0x133dea[_0xea4c('0x3f')]=_[_0xea4c('0x41')](_0x198978[_0xea4c('0x42')])+'s';return _0x133dea;}logger[_0xea4c('0x2c')](_0xea4c('0x3c'),JSON[_0xea4c('0xe')](data));throw new Error(_0xea4c('0x49')+JSON[_0xea4c('0xe')](data));})[_0xea4c('0x2b')](function(_0x582e2c){console['log'](_0xea4c('0x4a'),_0x582e2c);});}function getEndUser(_0x402d8c,_0x3e6295,_0x27cf50,_0x45519e,_0x5f25ae,_0x22efeb,_0x23d1c4){var _0x383c56={'method':'GET','uri':'','headers':{'Authorization':_0xea4c('0x46')+_0x402d8c},'json':!![]};switch(_0x23d1c4[_0xea4c('0x4b')]){case'contact_lead':_0x383c56[_0xea4c('0x4c')]=_0xea4c('0x40')+_0x3e6295+_0xea4c('0x4d')+_0x5f25ae+'))';return getZohoUser(_0x383c56,_0xea4c('0x4e'))[_0xea4c('0x29')](function(_0x44d886){if(_0x44d886)return _0x44d886;_0x383c56[_0xea4c('0x4c')]=_0xea4c('0x40')+_0x3e6295+_0xea4c('0x4f')+_0x5f25ae+'))';return getZohoUser(_0x383c56,_0xea4c('0x50'))[_0xea4c('0x29')](function(_0xc08eb3){if(_0xc08eb3)return _0xc08eb3;if(_0x23d1c4[_0xea4c('0x42')]!=_0xea4c('0x51')){return createEndUser(_0x402d8c,_0x3e6295,_0x45519e,_0x5f25ae,_0x22efeb,_0x23d1c4);}else{return{};}});});break;case _0xea4c('0x52'):_0x383c56[_0xea4c('0x4c')]=_0xea4c('0x40')+_0x3e6295+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5f25ae+'))';return getZohoUser(_0x383c56,_0xea4c('0x4e'))[_0xea4c('0x29')](function(_0x326f94){if(_0x326f94)return _0x326f94;if(_0x23d1c4[_0xea4c('0x42')]!=_0xea4c('0x51')){return createEndUser(_0x402d8c,_0x3e6295,_0x45519e,_0x5f25ae,_0x22efeb,_0x23d1c4);}else{return{};}});break;case'lead':_0x383c56[_0xea4c('0x4c')]='https://www.zohoapis.'+_0x3e6295+_0xea4c('0x4f')+_0x5f25ae+'))';return getZohoUser(_0x383c56,_0xea4c('0x50'))['then'](function(_0x51ae5c){if(_0x51ae5c)return _0x51ae5c;if(_0x23d1c4['moduleCreate']!='nothing'){return createEndUser(_0x402d8c,_0x3e6295,_0x45519e,_0x5f25ae,_0x22efeb,_0x23d1c4);}else{return{};}});break;}}function getCall(_0x4666eb,_0x2c20c6,_0x423a14,_0x42b92d,_0x1b39d2,_0x3f870d,_0x19bfe8,_0xe0e822){logger[_0xea4c('0x2e')](_0xea4c('0x53'));var _0x449357={};_0x449357[_0xea4c('0x54')]={'name':!_['isNil'](_0x42b92d[_0xea4c('0x43')][_0xea4c('0x1b')])&&!_['isNil'](_0x42b92d['profile'][_0xea4c('0x1b')])&&_0x42b92d[_0xea4c('0x39')][_0xea4c('0x1b')]==='administrator'?_0x42b92d['role'][_0xea4c('0x1b')]:!_[_0xea4c('0x1e')](_0x42b92d[_0xea4c('0x44')])?_0x42b92d[_0xea4c('0x44')]+'\x20'+_0x42b92d['last_name']:_0x42b92d[_0xea4c('0x45')],'id':_0x42b92d['id']};_0x449357[_0xea4c('0x55')]=intUtil[_0xea4c('0x56')](_0x3f870d['Subjects'],_0x19bfe8,'\x20');_0x449357[_0xea4c('0x57')]=intUtil[_0xea4c('0x56')](_0x3f870d['Descriptions'],_0x19bfe8,'\x0a');if(_0x1b39d2[_0xea4c('0x3f')]==='Contacts'){_0x449357[_0xea4c('0x58')]={'name':!_[_0xea4c('0x1e')](_0x1b39d2[_0xea4c('0x59')])?_0x1b39d2['Full_Name']:!_[_0xea4c('0x1e')](_0x1b39d2[_0xea4c('0x5a')])?_0x1b39d2[_0xea4c('0x5a')]+'\x20'+_0x1b39d2[_0xea4c('0x5b')]:_0x1b39d2[_0xea4c('0x5b')],'id':_0x1b39d2['id']};}if(_0x1b39d2['enduserType']===_0xea4c('0x50')){_0x449357[_0xea4c('0x5c')]={'name':!_[_0xea4c('0x1e')](_0x1b39d2[_0xea4c('0x59')])?_0x1b39d2[_0xea4c('0x59')]:!_[_0xea4c('0x1e')](_0x1b39d2[_0xea4c('0x5a')])?_0x1b39d2[_0xea4c('0x5a')]+'\x20'+_0x1b39d2[_0xea4c('0x5b')]:_0x1b39d2[_0xea4c('0x5b')],'id':_0x1b39d2['id']};_0x449357['$se_module']=_[_0xea4c('0x41')](_0x1b39d2[_0xea4c('0x3f')]);}if(_0x19bfe8[_0xea4c('0x5d')]){_0x449357[_0xea4c('0x5e')]=moment[_0xea4c('0x5f')](parseInt(_0x19bfe8[_0xea4c('0x5d')])*0x3e8)['format'](_0xea4c('0x60'));}else if(_0x19bfe8['answertime']&&_0x19bfe8['endtime']){_0x449357['Call_Duration']=moment[_0xea4c('0x5f')](moment(_0x19bfe8['endtime'],_0xea4c('0x61'))['diff'](moment(_0x19bfe8[_0xea4c('0x62')],'YYYY-MM-DDTHH:mm:ss')))[_0xea4c('0x31')](_0xea4c('0x60'));}switch(_0x19bfe8[_0xea4c('0x63')]){case _0xea4c('0x64'):_0x449357['Call_Result']='Called';break;case'complete':case _0xea4c('0x65'):_0x449357[_0xea4c('0x66')]='Answered';break;case _0xea4c('0x67'):_0x449357[_0xea4c('0x66')]='Rejected';break;case _0xea4c('0x68'):_0x449357[_0xea4c('0x66')]=_0xea4c('0x69');break;case'timeout':_0x449357[_0xea4c('0x66')]=_0xea4c('0x6a');default:}_0x449357['Call_Start_Time']=(_0xe0e822===_0xea4c('0x6b')?moment(_0x19bfe8['starttime'])[_0xea4c('0x31')](_0xea4c('0x61')):moment(_0x19bfe8[_0xea4c('0x6c')])[_0xea4c('0x31')](_0xea4c('0x61')))||moment()[_0xea4c('0x31')](_0xea4c('0x61'));_0x449357['Call_Type']=_0xe0e822||_0xea4c('0x6d');_0x449357=_['merge'](_0x449357,getCustomFields(_0x3f870d['Fields'],_0x19bfe8));return request({'method':'POST','uri':_0xea4c('0x40')+_0x2c20c6+'/crm/v2/Calls','headers':{'Authorization':_0xea4c('0x46')+_0x4666eb},'body':{'data':[_0x449357]},'json':!![]})['then'](function(_0x220c88){if(_0x220c88&&_0x220c88[_0xea4c('0x3e')][0x0][_0xea4c('0x6e')]===_0xea4c('0x47')){logger['info'](_0xea4c('0x6f'));return{'id':_0x220c88[_0xea4c('0x3e')][0x0][_0xea4c('0x48')]['id']};}})[_0xea4c('0x2b')](function(_0x4d39bb){logger[_0xea4c('0x2e')](_0xea4c('0x70'),_0x4d39bb[_0xea4c('0x71')]);console[_0xea4c('0x72')](_0xea4c('0x70'),_0x4d39bb);});}exports[_0xea4c('0x73')]=function(_0x2809b2,_0x4bd1c4,_0x163b00,_0x47572c,_0x518d45,_0x16802f){var _0x411f86,_0x159480,_0x3cfd3a;_0x16802f[_0xea4c('0x74')]=intUtil[_0xea4c('0x75')](_0x16802f[_0xea4c('0x74')]);_0x16802f[_0xea4c('0x76')]=intUtil[_0xea4c('0x75')](_0x16802f['serverUrl']);if(_0x518d45&&_0x518d45[_0xea4c('0x77')]){logger['info'](_0xea4c('0x78'),'Recording\x20is\x20enabled!');_0x4bd1c4['recordingURL']=_0x16802f['serverUrl']+_0xea4c('0x79')+_0x4bd1c4[_0xea4c('0x7a')]+_0xea4c('0x7b')+md5(_0x4bd1c4['uniqueid']);}else{_0x4bd1c4[_0xea4c('0x7c')]='';}var _0x2ad5c7=_0x16802f[_0xea4c('0x74')]===_0xea4c('0x7d')?'eu':_0xea4c('0x7e');return getAccessToken(_0x16802f)[_0xea4c('0x29')](function(_0x313884){_0x3cfd3a=_0x313884;return getUser(_0x3cfd3a,_0x2ad5c7,_0x16802f,_0x47572c[_0xea4c('0x36')]);})[_0xea4c('0x29')](function(_0x25f5bf){_0x411f86=_0x25f5bf;logger['info'](_0xea4c('0x7f'),_0x411f86['id']);return getEndUser(_0x3cfd3a,_0x2ad5c7,_0x16802f,_0x4bd1c4[_0xea4c('0x80')],_0x4bd1c4[_0xea4c('0x81')],_0x411f86,_0x163b00);})[_0xea4c('0x29')](function(_0x357033){_0x159480=_0x357033;return getCall(_0x3cfd3a,_0x2ad5c7,_0x16802f,_0x411f86,_0x159480,_0x163b00,_0x4bd1c4,'Inbound');})[_0xea4c('0x29')](function(_0x3ee362){if(_0x3ee362){logger[_0xea4c('0x2e')](_0xea4c('0x82'),_0x3ee362['id']);logger[_0xea4c('0x2e')](_0xea4c('0x78'),_0xea4c('0x83'));emit(util[_0xea4c('0x31')](_0xea4c('0x84'),_0x47572c['name']),_0xea4c('0x85'),{'uri':_0xea4c('0x86')+_0x16802f[_0xea4c('0x74')]+_0xea4c('0x87')+_0x3ee362['id']});}})['catch'](function(_0x39c618){logger[_0xea4c('0x2c')](_0xea4c('0x78'),JSON[_0xea4c('0xe')](_0x39c618));});};exports[_0xea4c('0x6b')]=function(_0x548c11,_0x16ac4a,_0x55fa1e,_0x424365,_0x3e1097,_0x4adc15,_0x2da57b){var _0x1f5077,_0x343ee4,_0x4dfa45;_0x4adc15[_0xea4c('0x74')]=intUtil['stripTrailingSlash'](_0x4adc15[_0xea4c('0x74')]);_0x4adc15[_0xea4c('0x76')]=intUtil[_0xea4c('0x75')](_0x4adc15[_0xea4c('0x76')]);if(_0x2da57b&&_0x2da57b[_0xea4c('0x88')]&&_0x2da57b[_0xea4c('0x88')]!=='none'){logger['info'](_0xea4c('0x89'),'Recording\x20is\x20enabled!');_0x16ac4a[_0xea4c('0x7c')]=_0x4adc15['serverUrl']+_0xea4c('0x79')+_0x16ac4a[_0xea4c('0x7a')]+_0xea4c('0x7b')+md5(_0x16ac4a[_0xea4c('0x7a')]);}var _0x500a70=_0x4adc15[_0xea4c('0x74')]===_0xea4c('0x7d')?'eu':_0xea4c('0x7e');return getAccessToken(_0x4adc15)['then'](function(_0x23f023){_0x4dfa45=_0x23f023;return getUser(_0x4dfa45,_0x500a70,_0x4adc15,_0x424365[_0xea4c('0x36')]);})[_0xea4c('0x29')](function(_0x2827a8){_0x1f5077=_0x2827a8;logger[_0xea4c('0x2e')](_0xea4c('0x7f'),_0x1f5077['id']);return getEndUser(_0x4dfa45,_0x500a70,_0x4adc15,_0x16ac4a['destcalleridname'],_0x16ac4a[_0xea4c('0x8a')],_0x1f5077,_0x55fa1e);})['then'](function(_0x5aa74b){_0x343ee4=_0x5aa74b;return getCall(_0x4dfa45,_0x500a70,_0x4adc15,_0x1f5077,_0x343ee4,_0x55fa1e,_0x16ac4a,'Outbound');})[_0xea4c('0x29')](function(_0x2294ba){if(_0x2294ba){logger['info'](_0xea4c('0x82'),_0x2294ba['id']);logger[_0xea4c('0x2e')](_0xea4c('0x89'),_0xea4c('0x83'));emit(util[_0xea4c('0x31')](_0xea4c('0x84'),_0x424365[_0xea4c('0x1b')]),_0xea4c('0x85'),{'uri':_0xea4c('0x86')+_0x4adc15[_0xea4c('0x74')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2294ba['id']});}})[_0xea4c('0x2b')](function(_0x3330f2){logger['error'](_0xea4c('0x89'),JSON['stringify'](_0x3330f2));});};exports[_0xea4c('0x8b')]=function(_0x84d9a7,_0x241cf0,_0x355358,_0x8a77a4,_0x3e40d3,_0x54b4ec){var _0xd0de19,_0x2c8b7c,_0x1f166e;_0x54b4ec[_0xea4c('0x74')]=intUtil[_0xea4c('0x75')](_0x54b4ec[_0xea4c('0x74')]);_0x54b4ec[_0xea4c('0x76')]=intUtil['stripTrailingSlash'](_0x54b4ec['serverUrl']);if(_0x3e40d3&&_0x3e40d3[_0xea4c('0x77')]){logger[_0xea4c('0x2e')]('['+_0x241cf0['lastevent'][_0xea4c('0x8c')]()+']','Recording\x20is\x20enabled!');_0x241cf0[_0xea4c('0x7c')]=_0x54b4ec[_0xea4c('0x76')]+'/api/voice/recordings/'+_0x241cf0[_0xea4c('0x7a')]+_0xea4c('0x7b')+md5(_0x241cf0['uniqueid']);}else{_0x241cf0[_0xea4c('0x7c')]='';}var _0x56b2e8=_0x54b4ec[_0xea4c('0x74')]===_0xea4c('0x7d')?'eu':_0xea4c('0x7e');return getAccessToken(_0x54b4ec)[_0xea4c('0x29')](function(_0x55e1a7){_0x1f166e=_0x55e1a7;return getUser(_0x1f166e,_0x56b2e8,_0x54b4ec);})[_0xea4c('0x29')](function(_0x210477){_0xd0de19=_0x210477;logger[_0xea4c('0x2e')](_0xea4c('0x7f'),_0xd0de19['id']);return getEndUser(_0x1f166e,_0x56b2e8,_0x54b4ec,_0x241cf0[_0xea4c('0x80')],_0x241cf0[_0xea4c('0x81')],_0xd0de19,_0x355358);})['then'](function(_0x2b1e47){_0x2c8b7c=_0x2b1e47;return getCall(_0x1f166e,_0x56b2e8,_0x54b4ec,_0xd0de19,_0x2c8b7c,_0x355358,_0x241cf0,'Inbound');})[_0xea4c('0x29')](function(_0x36fd9){if(_0x36fd9){logger[_0xea4c('0x2e')]('The\x20Call\x20ID\x20is:',_0x36fd9['id']);}})[_0xea4c('0x2b')](function(_0x161652){logger[_0xea4c('0x2c')]('['+_0x241cf0[_0xea4c('0x63')][_0xea4c('0x8c')]()+']',JSON[_0xea4c('0xe')](_0x161652));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index e64f3f8..c482cf3 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc7e=['error','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','data2','Script','data3','render'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbc7e,0x1b1));var _0xebc7=function(_0x30ee51,_0x2e1ee9){_0x30ee51=_0x30ee51-0x0;var _0x48da5a=_0xbc7e[_0x30ee51];return _0x48da5a;};'use strict';var util=require(_0xebc7('0x0'));var sh=require(_0xebc7('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xebc7('0x2'));exports['exec']=function(_0x52052f,_0x16ff0c){var _0x13d038=_0x52052f[_0xebc7('0x3')]?_0x52052f[_0xebc7('0x3')]:_0xebc7('0x4');var _0x48785d=_0x52052f[_0xebc7('0x5')]?Mustache[_0xebc7('0x6')](_0x52052f[_0xebc7('0x5')],_0x16ff0c):_0x16ff0c;sh['exec'](_0x48785d,function(_0x564edb,_0x299a73,_0x4063ec){if(_0x564edb!==0x0){logger[_0xebc7('0x7')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x13d038,_0x48785d,_0x564edb,_0x4063ec));}else{logger[_0xebc7('0x8')](util[_0xebc7('0x9')](_0xebc7('0xa'),_0x13d038,_0x48785d,_0x299a73));}});}; \ No newline at end of file +var _0xfc5e=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0xcaacc0,_0x501888){var _0x3af45b=function(_0xf401a6){while(--_0xf401a6){_0xcaacc0['push'](_0xcaacc0['shift']());}};_0x3af45b(++_0x501888);}(_0xfc5e,0x151));var _0xefc5=function(_0x513e0a,_0x4dcc95){_0x513e0a=_0x513e0a-0x0;var _0x394cef=_0xfc5e[_0x513e0a];return _0x394cef;};'use strict';var util=require(_0xefc5('0x0'));var sh=require(_0xefc5('0x1'));var Mustache=require('mustache');var logger=require(_0xefc5('0x2'))(_0xefc5('0x3'));exports[_0xefc5('0x4')]=function(_0x351946,_0x71f0b3){var _0x3a7b29=_0x351946[_0xefc5('0x5')]?_0x351946[_0xefc5('0x5')]:_0xefc5('0x6');var _0x193ff5=_0x351946[_0xefc5('0x7')]?Mustache[_0xefc5('0x8')](_0x351946[_0xefc5('0x7')],_0x71f0b3):_0x71f0b3;sh[_0xefc5('0x4')](_0x193ff5,function(_0x42c4f6,_0x3e3af3,_0x283a51){if(_0x42c4f6!==0x0){logger[_0xefc5('0x9')](util[_0xefc5('0xa')](_0xefc5('0xb'),_0x3a7b29,_0x193ff5,_0x42c4f6,_0x283a51));}else{logger[_0xefc5('0xc')](util[_0xefc5('0xa')](_0xefc5('0xd'),_0x3a7b29,_0x193ff5,_0x3e3af3));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 8fd4cec..ddce1d3 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec4=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','data5','headers','data6','stack','GET','DELETE','POST','PUT','data7','parse','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','object','stringify','statusCode'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xeec4,0x17a));var _0x4eec=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xeec4[_0x589aee];return _0x2f5ed4;};'use strict';var rp=require(_0x4eec('0x0'));var util=require('util');var _=require(_0x4eec('0x1'));var Mustache=require(_0x4eec('0x2'));var logger=require(_0x4eec('0x3'))(_0x4eec('0x4'));exports[_0x4eec('0x5')]=function(_0x55e17d,_0x27c019){var _0x1f4020,_0x3c1b09;var _0x46cb97={'method':_0x55e17d[_0x4eec('0x6')]['toUpperCase'](),'uri':Mustache[_0x4eec('0x7')](_0x55e17d[_0x4eec('0x8')],_0x27c019),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x55e17d[_0x4eec('0x9')])==='number'&&parseInt(_0x55e17d[_0x4eec('0x9')])>=0x1&&parseInt(_0x55e17d['data5'])<=0xa?parseInt(_0x55e17d[_0x4eec('0x9')])*0x3e8:0x5*0x3e8};try{_0x46cb97[_0x4eec('0xa')]=_0x55e17d[_0x4eec('0xb')]?JSON['parse'](Mustache[_0x4eec('0x7')](_0x55e17d[_0x4eec('0xb')],_0x27c019)):{};}catch(_0x896810){logger['error'](_0x896810[_0x4eec('0xc')]);}switch(_0x55e17d[_0x4eec('0x6')]['toUpperCase']()){case _0x4eec('0xd'):case _0x4eec('0xe'):_0x1f4020=null;_0x46cb97['qs']=_0x27c019;break;case _0x4eec('0xf'):case _0x4eec('0x10'):if(_0x55e17d[_0x4eec('0x11')]){try{_0x1f4020=JSON[_0x4eec('0x12')](Mustache[_0x4eec('0x7')](_0x55e17d[_0x4eec('0x11')],_0x27c019));_0x46cb97[_0x4eec('0x13')]=_0x1f4020;}catch(_0x55a01){logger[_0x4eec('0x14')](_0x55a01[_0x4eec('0xc')]);logger[_0x4eec('0x14')](_0x4eec('0x15'));}}else{_0x1f4020=_0x27c019;_0x46cb97[_0x4eec('0x13')]=_0x1f4020;}break;}logger[_0x4eec('0x16')](util[_0x4eec('0x17')](_0x4eec('0x18'),_0x55e17d[_0x4eec('0x6')],_0x55e17d['data2'],JSON['stringify'](_0x46cb97)));rp(_0x46cb97)['then'](function(_0x2e5e90){_0x1f4020=!_[_0x4eec('0x19')](_0x1f4020)?_0x4eec('0x1a')+_0x1f4020:'';_0x3c1b09=typeof _0x2e5e90['body']===_0x4eec('0x1b')?JSON[_0x4eec('0x1c')](_0x2e5e90[_0x4eec('0x13')]):_0x2e5e90[_0x4eec('0x13')];logger[_0x4eec('0x16')](util[_0x4eec('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x55e17d[_0x4eec('0x6')],_0x55e17d[_0x4eec('0x8')],_0x2e5e90[_0x4eec('0x1d')],_0x3c1b09));})[_0x4eec('0x1e')](function(_0x4dff7c){logger['error'](util[_0x4eec('0x17')](_0x4eec('0x1f'),_0x55e17d[_0x4eec('0x6')],_0x55e17d[_0x4eec('0x8')],_0x4dff7c[_0x4eec('0x1d')],_0x4dff7c[_0x4eec('0x20')],_0x4dff7c[_0x4eec('0x21')]));});}; \ No newline at end of file +var _0xb1f5=['headers','data6','parse','stack','GET','DELETE','PUT','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','data2','data5','number'];(function(_0x56004b,_0x28c97d){var _0xed04f0=function(_0x1ee6ff){while(--_0x1ee6ff){_0x56004b['push'](_0x56004b['shift']());}};_0xed04f0(++_0x28c97d);}(_0xb1f5,0x128));var _0x5b1f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb1f5[_0x19950b];return _0x3c6b41;};'use strict';var rp=require(_0x5b1f('0x0'));var util=require(_0x5b1f('0x1'));var _=require('lodash');var Mustache=require(_0x5b1f('0x2'));var logger=require('../../../../config/logger')(_0x5b1f('0x3'));exports[_0x5b1f('0x4')]=function(_0x4ff9de,_0x3f0a29){var _0x3448de,_0xeec046;var _0x11656a={'method':_0x4ff9de[_0x5b1f('0x5')][_0x5b1f('0x6')](),'uri':Mustache['render'](_0x4ff9de[_0x5b1f('0x7')],_0x3f0a29),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4ff9de[_0x5b1f('0x8')])===_0x5b1f('0x9')&&parseInt(_0x4ff9de['data5'])>=0x1&&parseInt(_0x4ff9de['data5'])<=0xa?parseInt(_0x4ff9de['data5'])*0x3e8:0x5*0x3e8};try{_0x11656a[_0x5b1f('0xa')]=_0x4ff9de[_0x5b1f('0xb')]?JSON[_0x5b1f('0xc')](Mustache['render'](_0x4ff9de[_0x5b1f('0xb')],_0x3f0a29)):{};}catch(_0x2a736a){logger['error'](_0x2a736a[_0x5b1f('0xd')]);}switch(_0x4ff9de[_0x5b1f('0x5')][_0x5b1f('0x6')]()){case _0x5b1f('0xe'):case _0x5b1f('0xf'):_0x3448de=null;_0x11656a['qs']=_0x3f0a29;break;case'POST':case _0x5b1f('0x10'):if(_0x4ff9de[_0x5b1f('0x11')]){try{_0x3448de=JSON[_0x5b1f('0xc')](Mustache['render'](_0x4ff9de[_0x5b1f('0x11')],_0x3f0a29));_0x11656a['body']=_0x3448de;}catch(_0x2a37b8){logger[_0x5b1f('0x12')](_0x2a37b8['stack']);logger[_0x5b1f('0x12')](_0x5b1f('0x13'));}}else{_0x3448de=_0x3f0a29;_0x11656a[_0x5b1f('0x14')]=_0x3448de;}break;}logger['info'](util[_0x5b1f('0x15')](_0x5b1f('0x16'),_0x4ff9de[_0x5b1f('0x5')],_0x4ff9de['data2'],JSON[_0x5b1f('0x17')](_0x11656a)));rp(_0x11656a)['then'](function(_0x4b3172){_0x3448de=!_[_0x5b1f('0x18')](_0x3448de)?_0x5b1f('0x19')+_0x3448de:'';_0xeec046=typeof _0x4b3172['body']===_0x5b1f('0x1a')?JSON['stringify'](_0x4b3172[_0x5b1f('0x14')]):_0x4b3172['body'];logger[_0x5b1f('0x1b')](util[_0x5b1f('0x15')](_0x5b1f('0x1c'),_0x4ff9de[_0x5b1f('0x5')],_0x4ff9de[_0x5b1f('0x7')],_0x4b3172['statusCode'],_0xeec046));})[_0x5b1f('0x1d')](function(_0x2ec0a5){logger[_0x5b1f('0x12')](util[_0x5b1f('0x15')](_0x5b1f('0x1e'),_0x4ff9de[_0x5b1f('0x5')],_0x4ff9de[_0x5b1f('0x7')],_0x2ec0a5[_0x5b1f('0x1f')],_0x2ec0a5[_0x5b1f('0x20')],_0x2ec0a5[_0x5b1f('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b70ec53..3dcd336 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13ee=['rpc','routing','error','message','result','catch','exports','../../config/logger','Request','request','then','debug'];(function(_0x27a9d5,_0x58083f){var _0x6b97de=function(_0x5e3fe8){while(--_0x5e3fe8){_0x27a9d5['push'](_0x27a9d5['shift']());}};_0x6b97de(++_0x58083f);}(_0x13ee,0x157));var _0xe13e=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x13ee[_0x35d8af];return _0x1d08b0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xe13e('0x0'))('routing');var client=jayson['client']['http']({'port':0x2329});client[_0xe13e('0x1')]=function(_0x4cd2e3,_0x59fd88){return new BPromise(function(_0x2e7097,_0x2bd881){return client[_0xe13e('0x2')](_0x4cd2e3,_0x59fd88)[_0xe13e('0x3')](function(_0x2f5f2b){logger[_0xe13e('0x4')](_0xe13e('0x5'),_0xe13e('0x6'),_0x4cd2e3,_0x59fd88,_0x2f5f2b);if(_0x2f5f2b[_0xe13e('0x7')]){logger['error'](_0xe13e('0x5'),_0xe13e('0x6'),_0x4cd2e3,_0x2f5f2b[_0xe13e('0x7')][_0xe13e('0x8')],_0x59fd88);return _0x2bd881(_0x2f5f2b[_0xe13e('0x7')][_0xe13e('0x8')]);}else{return _0x2e7097(_0x2f5f2b[_0xe13e('0x9')]);}})[_0xe13e('0xa')](function(_0x18308e){logger[_0xe13e('0x7')]('rpc',_0xe13e('0x6'),_0x4cd2e3,_0x18308e,_0x59fd88);return _0x2bd881(_0x18308e);});});};module[_0xe13e('0xb')]=client; \ No newline at end of file +var _0x5760=['message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then','debug','rpc','error'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5760,0x1c3));var _0x0576=function(_0xc2b9ae,_0x515445){_0xc2b9ae=_0xc2b9ae-0x0;var _0x31deda=_0x5760[_0xc2b9ae];return _0x31deda;};'use strict';var jayson=require(_0x0576('0x0'));var BPromise=require(_0x0576('0x1'));var logger=require(_0x0576('0x2'))(_0x0576('0x3'));var client=jayson[_0x0576('0x4')][_0x0576('0x5')]({'port':0x2329});client['Request']=function(_0x4677db,_0x1abcfe){return new BPromise(function(_0x5ede51,_0x2054ca){return client[_0x0576('0x6')](_0x4677db,_0x1abcfe)[_0x0576('0x7')](function(_0x2768d1){logger[_0x0576('0x8')](_0x0576('0x9'),_0x0576('0x3'),_0x4677db,_0x1abcfe,_0x2768d1);if(_0x2768d1['error']){logger[_0x0576('0xa')](_0x0576('0x9'),_0x0576('0x3'),_0x4677db,_0x2768d1[_0x0576('0xa')]['message'],_0x1abcfe);return _0x2054ca(_0x2768d1[_0x0576('0xa')][_0x0576('0xb')]);}else{return _0x5ede51(_0x2768d1[_0x0576('0xc')]);}})[_0x0576('0xd')](function(_0x185be2){logger['error'](_0x0576('0x9'),_0x0576('0x3'),_0x4677db,_0x185be2,_0x1abcfe);return _0x2054ca(_0x185be2);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 4fceede..cc07304 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1186=['mailAccounts','getSettings','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','initMailAccounts','then','refresh'];(function(_0x5da3db,_0x721915){var _0x30c7c4=function(_0x49ad61){while(--_0x49ad61){_0x5da3db['push'](_0x5da3db['shift']());}};_0x30c7c4(++_0x721915);}(_0x1186,0x75));var _0x6118=function(_0x29678e,_0x54be83){_0x29678e=_0x29678e-0x0;var _0x128c7c=_0x1186[_0x29678e];return _0x128c7c;};'use strict';var BPromise=require(_0x6118('0x0'));var server=require(_0x6118('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x6118('0x2'));var mailAccount=require(_0x6118('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6118('0x4')]()['then'](mailAccount[_0x6118('0x5')]())['then'](realtime[_0x6118('0x6')]())[_0x6118('0x7')](function(){email[_0x6118('0x8')](realtime[_0x6118('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x6118('0x7')](function(){return initRealtime();})[_0x6118('0x7')](function(){return setting[_0x6118('0xa')]();})['then'](function(_0x56f00d){return setInterval(initRealtime,_0x56f00d[_0x6118('0xb')]*0x3e8);})[_0x6118('0xc')](function(_0x30e232){console[_0x6118('0xd')](_0x30e232);});}main(); \ No newline at end of file +var _0x4cfa=['getSettings','loginMailFrequency','log','bluebird','./server','./realtime','./lib/email','./rpc/setting','resolve','then','getMailAccounts','refresh','mailAccounts','listen'];(function(_0x529c72,_0x2db84b){var _0x380e09=function(_0x3c130e){while(--_0x3c130e){_0x529c72['push'](_0x529c72['shift']());}};_0x380e09(++_0x2db84b);}(_0x4cfa,0xb9));var _0xa4cf=function(_0x71d604,_0x3edc06){_0x71d604=_0x71d604-0x0;var _0x1ae5a5=_0x4cfa[_0x71d604];return _0x1ae5a5;};'use strict';var BPromise=require(_0xa4cf('0x0'));var server=require(_0xa4cf('0x1'));var Realtime=require(_0xa4cf('0x2'));var EmailChannel=require(_0xa4cf('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xa4cf('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xa4cf('0x5')]()[_0xa4cf('0x6')](mailAccount[_0xa4cf('0x7')]())[_0xa4cf('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xa4cf('0x8')](realtime[_0xa4cf('0x9')]);return realtime;});}function main(){return server[_0xa4cf('0xa')](realtime,email)[_0xa4cf('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xa4cf('0xb')]();})[_0xa4cf('0x6')](function(_0x3e5ca4){return setInterval(initRealtime,_0x3e5ca4[_0xa4cf('0xc')]*0x3e8);})['catch'](function(_0x434beb){console[_0xa4cf('0xd')](_0x434beb);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4d34837..4e309ba 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c82=['defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','isNil','stringify','hasOwnProperty','imapAccounts','bind','end','error','handleImapError','handleImapBox','connected','name','messages','total','handleImapEmail','info','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verified','verify','exports','moment','md5','ioredis','../../../config/logger','email'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x5c82,0xc3));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x25c8('0x0'));var BPromise=require('bluebird');var md5=require(_0x25c8('0x1'));var Redis=require(_0x25c8('0x2'));var config=require('../../../config/environment');var logger=require(_0x25c8('0x3'))(_0x25c8('0x4'));config['redis']=_[_0x25c8('0x5')](config[_0x25c8('0x6')],{'host':_0x25c8('0x7'),'port':0x18eb});var io=require(_0x25c8('0x8'))(new Redis(config[_0x25c8('0x6')]));var EmailImap=require(_0x25c8('0x9'));var EmailSmtp=require(_0x25c8('0xa'));var mailAccount=require(_0x25c8('0xb'));var md5Accounts={};function EmailChannel(_0x4811a5){logger['info'](_0x25c8('0xc'));this[_0x25c8('0xd')]=_0x4811a5['mailAccounts'];this['imapAccounts']={};this[_0x25c8('0xe')]=new EmailSmtp();}EmailChannel[_0x25c8('0xf')][_0x25c8('0x10')]=function(_0xf3a9cd){var _0x140cf0=this['mailAccounts'][_0xf3a9cd];var _0x5b02e9={'id':_0x140cf0['id'],'name':_0x140cf0['name'],'key':_0x140cf0[_0x25c8('0x11')],'active':_0x140cf0[_0x25c8('0x12')],'Imap':{'status':_0x140cf0[_0x25c8('0x13')][_0x25c8('0x14')],'messageStatus':_0x140cf0[_0x25c8('0x13')][_0x25c8('0x15')],'total':_0x140cf0['Imap']['total']}};if(_[_0x25c8('0x16')](md5Accounts[_0xf3a9cd])){md5Accounts[_0xf3a9cd]={};}var _0x3a573e=md5(JSON[_0x25c8('0x17')](_0x5b02e9));if(md5Accounts[_0xf3a9cd][_0x25c8('0x1')]!==_0x3a573e){md5Accounts[_0xf3a9cd][_0x25c8('0x1')]=_0x3a573e;io['emit']('mailAccount:update',_0x5b02e9);}};EmailChannel[_0x25c8('0xf')]['refresh']=function(_0x3da400){for(var _0xd77556 in _0x3da400){if(_0x3da400[_0x25c8('0x18')](_0xd77556)){if(_0x3da400[_0xd77556]['Imap']&&_0x3da400[_0xd77556]['active']){var _0x4cd0c4=_0x3da400[_0xd77556][_0x25c8('0x13')];if(!this['imapAccounts'][_0x25c8('0x18')](_0x4cd0c4['id'])){this['imapAccounts'][_0x4cd0c4['id']]=new EmailImap(_0x4cd0c4,_0x3da400[_0xd77556]['email']);this[_0x25c8('0x19')][_0x4cd0c4['id']]['on']('box',this['handleImapBox'][_0x25c8('0x1a')](this,_0xd77556));this[_0x25c8('0x19')][_0x4cd0c4['id']]['on'](_0x25c8('0x4'),this['handleImapEmail'][_0x25c8('0x1a')](this,_0xd77556));this[_0x25c8('0x19')][_0x4cd0c4['id']]['on'](_0x25c8('0x1b'),this['handleImapEnd']['bind'](this,_0xd77556));this['imapAccounts'][_0x4cd0c4['id']]['on'](_0x25c8('0x1c'),this[_0x25c8('0x1d')][_0x25c8('0x1a')](this,_0xd77556));}}else{if(_[_0x25c8('0x16')](this['mailAccounts'][_0xd77556][_0x25c8('0x13')])){this[_0x25c8('0xd')][_0xd77556][_0x25c8('0x13')]={};}this['mailAccounts'][_0xd77556][_0x25c8('0x13')][_0x25c8('0x14')]='disabled';this['mailAccounts'][_0xd77556][_0x25c8('0x13')][_0x25c8('0x15')]='';this['emit'](_0xd77556);}}}};EmailChannel['prototype'][_0x25c8('0x1e')]=function(_0x217383,_0x1edd8d){if(this[_0x25c8('0xd')][_0x217383]){this['mailAccounts'][_0x217383][_0x25c8('0x13')]['status']=_0x25c8('0x1f');this[_0x25c8('0xd')][_0x217383][_0x25c8('0x13')][_0x25c8('0x15')]=_0x1edd8d[_0x25c8('0x20')];if(_0x1edd8d[_0x25c8('0x21')]){this['mailAccounts'][_0x217383][_0x25c8('0x13')]['total']=_0x1edd8d[_0x25c8('0x21')][_0x25c8('0x22')];}return this['emit'](_0x217383);}};EmailChannel['prototype'][_0x25c8('0x23')]=function(_0x11f8e3,_0x95c4ca){logger[_0x25c8('0x24')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x95c4ca['firstName'],_0x95c4ca[_0x25c8('0x25')],_0x95c4ca[_0x25c8('0x26')],_0x11f8e3);if(this[_0x25c8('0xd')][_0x11f8e3]){return mailAccount['notify'](_0x11f8e3,_0x95c4ca)[_0x25c8('0x27')](function(_0x3ed980){if(_0x3ed980){logger[_0x25c8('0x24')](_0x25c8('0x28'));}})[_0x25c8('0x29')](function(_0x38f165){logger['error'](_0x25c8('0x2a'),JSON[_0x25c8('0x17')](_0x38f165));});}};EmailChannel[_0x25c8('0xf')]['handleImapEnd']=function(_0x2d9edb){if(this[_0x25c8('0xd')][_0x2d9edb]&&this[_0x25c8('0xd')][_0x2d9edb][_0x25c8('0x13')]){if(this[_0x25c8('0x19')][this[_0x25c8('0xd')][_0x2d9edb][_0x25c8('0x13')]['id']]){delete this[_0x25c8('0x19')][this[_0x25c8('0xd')][_0x2d9edb][_0x25c8('0x13')]['id']];}this[_0x25c8('0xd')][_0x2d9edb]['Imap'][_0x25c8('0x2b')]=moment();this[_0x25c8('0x10')](_0x2d9edb);}};EmailChannel['prototype'][_0x25c8('0x1d')]=function(_0x55a6d7,_0x23a5bc){if(this[_0x25c8('0xd')][_0x55a6d7]){this['mailAccounts'][_0x55a6d7][_0x25c8('0x13')]['status']=_0x25c8('0x1c');this[_0x25c8('0xd')][_0x55a6d7]['Imap'][_0x25c8('0x15')]=_0x23a5bc;return this[_0x25c8('0x10')](_0x55a6d7);}};EmailChannel[_0x25c8('0xf')]['sendMail']=function(_0x4cf61d,_0x218d57){return this[_0x25c8('0xe')][_0x25c8('0x2c')](_0x4cf61d,_0x218d57);};EmailChannel[_0x25c8('0xf')][_0x25c8('0x2d')]=function(_0x6c4f1e){var _0x548cb2=this;if(this['mailAccounts'][_0x6c4f1e['id']]){if(_[_0x25c8('0x16')](this[_0x25c8('0xd')][_0x6c4f1e['id']][_0x25c8('0x2e')])){this[_0x25c8('0xd')][_0x6c4f1e['id']][_0x25c8('0x2e')]={};}this[_0x25c8('0xd')][_0x6c4f1e['id']][_0x25c8('0x2e')]['lastSync']=moment();return new BPromise(function(_0x6fe5da,_0x384fe0){return _0x548cb2['smtp']['verify'](_0x6c4f1e)[_0x25c8('0x27')](function(_0x5a8352){_0x548cb2['mailAccounts'][_0x6c4f1e['id']][_0x25c8('0x2e')][_0x25c8('0x14')]=_0x25c8('0x2f');_0x548cb2['mailAccounts'][_0x6c4f1e['id']][_0x25c8('0x2e')][_0x25c8('0x15')]='';_0x548cb2[_0x25c8('0x10')](_0x6c4f1e['id']);_0x6fe5da(_0x5a8352);})[_0x25c8('0x29')](function(_0x5f2994){_0x548cb2[_0x25c8('0xd')][_0x6c4f1e['id']]['Smtp'][_0x25c8('0x14')]=_0x25c8('0x1c');_0x548cb2['mailAccounts'][_0x6c4f1e['id']][_0x25c8('0x2e')][_0x25c8('0x15')]=_0x5f2994;_0x548cb2[_0x25c8('0x10')](_0x6c4f1e['id']);_0x384fe0(_0x5f2994);});});}return this[_0x25c8('0xe')][_0x25c8('0x30')](_0x6c4f1e);};module[_0x25c8('0x31')]=EmailChannel; \ No newline at end of file +var _0xae75=['catch','sendMail','send','verifySmtp','Smtp','lastSync','verify','then','verified','exports','lodash','bluebird','ioredis','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','refresh','imapAccounts','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','mailAccounts','connected','name','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','Mail\x20accepted\x20from\x20routing'];(function(_0x213794,_0x538066){var _0x1bd1c7=function(_0x5b6f4e){while(--_0x5b6f4e){_0x213794['push'](_0x213794['shift']());}};_0x1bd1c7(++_0x538066);}(_0xae75,0xa6));var _0x5ae7=function(_0xea620,_0x35ba9f){_0xea620=_0xea620-0x0;var _0x2dd06a=_0xae75[_0xea620];return _0x2dd06a;};'use strict';var _=require(_0x5ae7('0x0'));var moment=require('moment');var BPromise=require(_0x5ae7('0x1'));var md5=require('md5');var Redis=require(_0x5ae7('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5ae7('0x3'));config['redis']=_['defaults'](config[_0x5ae7('0x4')],{'host':_0x5ae7('0x5'),'port':0x18eb});var io=require(_0x5ae7('0x6'))(new Redis(config[_0x5ae7('0x4')]));var EmailImap=require(_0x5ae7('0x7'));var EmailSmtp=require(_0x5ae7('0x8'));var mailAccount=require(_0x5ae7('0x9'));var md5Accounts={};function EmailChannel(_0x4b8a6d){logger['info'](_0x5ae7('0xa'));this['mailAccounts']=_0x4b8a6d['mailAccounts'];this['imapAccounts']={};this[_0x5ae7('0xb')]=new EmailSmtp();}EmailChannel[_0x5ae7('0xc')][_0x5ae7('0xd')]=function(_0xf6e0a4){var _0x52fe65=this['mailAccounts'][_0xf6e0a4];var _0x417bcc={'id':_0x52fe65['id'],'name':_0x52fe65['name'],'key':_0x52fe65[_0x5ae7('0xe')],'active':_0x52fe65[_0x5ae7('0xf')],'Imap':{'status':_0x52fe65[_0x5ae7('0x10')][_0x5ae7('0x11')],'messageStatus':_0x52fe65[_0x5ae7('0x10')][_0x5ae7('0x12')],'total':_0x52fe65[_0x5ae7('0x10')][_0x5ae7('0x13')]}};if(_[_0x5ae7('0x14')](md5Accounts[_0xf6e0a4])){md5Accounts[_0xf6e0a4]={};}var _0x345925=md5(JSON[_0x5ae7('0x15')](_0x417bcc));if(md5Accounts[_0xf6e0a4]['md5']!==_0x345925){md5Accounts[_0xf6e0a4][_0x5ae7('0x16')]=_0x345925;io[_0x5ae7('0xd')]('mailAccount:update',_0x417bcc);}};EmailChannel['prototype'][_0x5ae7('0x17')]=function(_0x392b6c){for(var _0x25d7d4 in _0x392b6c){if(_0x392b6c['hasOwnProperty'](_0x25d7d4)){if(_0x392b6c[_0x25d7d4][_0x5ae7('0x10')]&&_0x392b6c[_0x25d7d4][_0x5ae7('0xf')]){var _0x1bf2b1=_0x392b6c[_0x25d7d4][_0x5ae7('0x10')];if(!this[_0x5ae7('0x18')]['hasOwnProperty'](_0x1bf2b1['id'])){this[_0x5ae7('0x18')][_0x1bf2b1['id']]=new EmailImap(_0x1bf2b1,_0x392b6c[_0x25d7d4][_0x5ae7('0x3')]);this['imapAccounts'][_0x1bf2b1['id']]['on'](_0x5ae7('0x19'),this[_0x5ae7('0x1a')]['bind'](this,_0x25d7d4));this[_0x5ae7('0x18')][_0x1bf2b1['id']]['on'](_0x5ae7('0x3'),this[_0x5ae7('0x1b')][_0x5ae7('0x1c')](this,_0x25d7d4));this[_0x5ae7('0x18')][_0x1bf2b1['id']]['on'](_0x5ae7('0x1d'),this[_0x5ae7('0x1e')]['bind'](this,_0x25d7d4));this[_0x5ae7('0x18')][_0x1bf2b1['id']]['on'](_0x5ae7('0x1f'),this[_0x5ae7('0x20')][_0x5ae7('0x1c')](this,_0x25d7d4));}}else{if(_[_0x5ae7('0x14')](this['mailAccounts'][_0x25d7d4]['Imap'])){this[_0x5ae7('0x21')][_0x25d7d4][_0x5ae7('0x10')]={};}this['mailAccounts'][_0x25d7d4][_0x5ae7('0x10')][_0x5ae7('0x11')]='disabled';this[_0x5ae7('0x21')][_0x25d7d4][_0x5ae7('0x10')][_0x5ae7('0x12')]='';this[_0x5ae7('0xd')](_0x25d7d4);}}}};EmailChannel[_0x5ae7('0xc')]['handleImapBox']=function(_0x1443cf,_0x1a7d8e){if(this[_0x5ae7('0x21')][_0x1443cf]){this[_0x5ae7('0x21')][_0x1443cf][_0x5ae7('0x10')]['status']=_0x5ae7('0x22');this[_0x5ae7('0x21')][_0x1443cf][_0x5ae7('0x10')]['messageStatus']=_0x1a7d8e[_0x5ae7('0x23')];if(_0x1a7d8e[_0x5ae7('0x24')]){this[_0x5ae7('0x21')][_0x1443cf][_0x5ae7('0x10')][_0x5ae7('0x13')]=_0x1a7d8e[_0x5ae7('0x24')][_0x5ae7('0x13')];}return this[_0x5ae7('0xd')](_0x1443cf);}};EmailChannel['prototype']['handleImapEmail']=function(_0x5f3c65,_0x83e20d){logger[_0x5ae7('0x25')](_0x5ae7('0x26'),_0x83e20d[_0x5ae7('0x27')],_0x83e20d['lastName'],_0x83e20d[_0x5ae7('0x28')],_0x5f3c65);if(this[_0x5ae7('0x21')][_0x5f3c65]){return mailAccount['notify'](_0x5f3c65,_0x83e20d)['then'](function(_0x4b2840){if(_0x4b2840){logger[_0x5ae7('0x25')](_0x5ae7('0x29'));}})[_0x5ae7('0x2a')](function(_0x1f16a7){logger[_0x5ae7('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5ae7('0x15')](_0x1f16a7));});}};EmailChannel['prototype'][_0x5ae7('0x1e')]=function(_0x1acb74){if(this['mailAccounts'][_0x1acb74]&&this[_0x5ae7('0x21')][_0x1acb74]['Imap']){if(this['imapAccounts'][this[_0x5ae7('0x21')][_0x1acb74]['Imap']['id']]){delete this[_0x5ae7('0x18')][this['mailAccounts'][_0x1acb74][_0x5ae7('0x10')]['id']];}this[_0x5ae7('0x21')][_0x1acb74][_0x5ae7('0x10')]['lastSync']=moment();this[_0x5ae7('0xd')](_0x1acb74);}};EmailChannel[_0x5ae7('0xc')][_0x5ae7('0x20')]=function(_0x3e09fb,_0x1de907){if(this['mailAccounts'][_0x3e09fb]){this[_0x5ae7('0x21')][_0x3e09fb][_0x5ae7('0x10')][_0x5ae7('0x11')]='error';this['mailAccounts'][_0x3e09fb]['Imap'][_0x5ae7('0x12')]=_0x1de907;return this[_0x5ae7('0xd')](_0x3e09fb);}};EmailChannel[_0x5ae7('0xc')][_0x5ae7('0x2b')]=function(_0x4e9788,_0x2489b2){return this[_0x5ae7('0xb')][_0x5ae7('0x2c')](_0x4e9788,_0x2489b2);};EmailChannel[_0x5ae7('0xc')][_0x5ae7('0x2d')]=function(_0x5322c7){var _0x46227d=this;if(this[_0x5ae7('0x21')][_0x5322c7['id']]){if(_[_0x5ae7('0x14')](this[_0x5ae7('0x21')][_0x5322c7['id']][_0x5ae7('0x2e')])){this[_0x5ae7('0x21')][_0x5322c7['id']][_0x5ae7('0x2e')]={};}this['mailAccounts'][_0x5322c7['id']][_0x5ae7('0x2e')][_0x5ae7('0x2f')]=moment();return new BPromise(function(_0x587ac4,_0x2f714d){return _0x46227d[_0x5ae7('0xb')][_0x5ae7('0x30')](_0x5322c7)[_0x5ae7('0x31')](function(_0x323136){_0x46227d[_0x5ae7('0x21')][_0x5322c7['id']]['Smtp']['status']=_0x5ae7('0x32');_0x46227d['mailAccounts'][_0x5322c7['id']][_0x5ae7('0x2e')][_0x5ae7('0x12')]='';_0x46227d['emit'](_0x5322c7['id']);_0x587ac4(_0x323136);})[_0x5ae7('0x2a')](function(_0x13756c){_0x46227d[_0x5ae7('0x21')][_0x5322c7['id']][_0x5ae7('0x2e')][_0x5ae7('0x11')]=_0x5ae7('0x1f');_0x46227d[_0x5ae7('0x21')][_0x5322c7['id']][_0x5ae7('0x2e')][_0x5ae7('0x12')]=_0x13756c;_0x46227d['emit'](_0x5322c7['id']);_0x2f714d(_0x13756c);});});}return this[_0x5ae7('0xb')][_0x5ae7('0x30')](_0x5322c7);};module[_0x5ae7('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b8cc5cb..b9efdd4 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b1b=['hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','INBOX','account','getAccount','once','bind','end','handleEnd','error','handleError','connect','inherits','prototype','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','email','anonymous@xcally.com','handleReady','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode'];(function(_0x30a5ef,_0x4c57e7){var _0xecf35d=function(_0x4d13da){while(--_0x4d13da){_0x30a5ef['push'](_0x30a5ef['shift']());}};_0xecf35d(++_0x4c57e7);}(_0x3b1b,0x139));var _0xb3b1=function(_0x5810ac,_0x402ef1){_0x5810ac=_0x5810ac-0x0;var _0x9bfec5=_0x3b1b[_0x5810ac];return _0x9bfec5;};'use strict';var fs=require('fs');var path=require(_0xb3b1('0x0'));var util=require(_0xb3b1('0x1'));var Imap=require(_0xb3b1('0x2'));var _=require('lodash');var rs=require(_0xb3b1('0x3'));var simpleParser=require(_0xb3b1('0x4'))['simpleParser'];var Iconv=require(_0xb3b1('0x5'))[_0xb3b1('0x6')];var EventEmitter=require(_0xb3b1('0x7'))[_0xb3b1('0x8')];var utils=require('./utils');var logger=require(_0xb3b1('0x9'))('email');function EmailImap(_0x28ebe5,_0x34d66d){this[_0xb3b1('0xa')]=_0xb3b1('0xb');this[_0xb3b1('0xc')]=this[_0xb3b1('0xd')](_0x28ebe5,_0x34d66d);this[_0xb3b1('0x2')]=new Imap(this[_0xb3b1('0xc')]);this[_0xb3b1('0x2')][_0xb3b1('0xe')]('ready',this['handleReady'][_0xb3b1('0xf')](this));this['imap'][_0xb3b1('0xe')](_0xb3b1('0x10'),this[_0xb3b1('0x11')][_0xb3b1('0xf')](this));this[_0xb3b1('0x2')]['on'](_0xb3b1('0x12'),this[_0xb3b1('0x13')][_0xb3b1('0xf')](this));this[_0xb3b1('0x2')][_0xb3b1('0x14')]();}util[_0xb3b1('0x15')](EmailImap,EventEmitter);EmailImap[_0xb3b1('0x16')][_0xb3b1('0xd')]=function(_0x3950db,_0x3be814){var _0x39bfcd={'connTimeout':_0x3950db['connTimeout']?_0x3950db['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3950db[_0xb3b1('0x17')]?_0x3950db['authTimeout']*0x3e8:0x1388};if(_[_0xb3b1('0x18')](_0x3950db[_0xb3b1('0x19')])){if(_0x3950db[_0xb3b1('0x1a')]){_0x39bfcd['user']=_0x3950db[_0xb3b1('0x1b')];_0x39bfcd[_0xb3b1('0x1c')]=_0x3950db['password'];}_0x39bfcd[_0xb3b1('0x1d')]=_0x3950db[_0xb3b1('0x1d')];_0x39bfcd['port']=_0x3950db[_0xb3b1('0x1e')]||0x3e1;if(_0x3950db[_0xb3b1('0x1f')]){_0x39bfcd[_0xb3b1('0x1f')]=!![];}else{_0x39bfcd[_0xb3b1('0x1f')]=![];_0x39bfcd[_0xb3b1('0x20')]=_0xb3b1('0x21');}}else{_0x39bfcd[_0xb3b1('0x1b')]=_0x3950db[_0xb3b1('0x1b')];_0x39bfcd[_0xb3b1('0x1c')]=_0x3950db[_0xb3b1('0x1c')];_0x39bfcd[_0xb3b1('0x1d')]=utils[_0xb3b1('0x22')](_0x3950db[_0xb3b1('0x19')]);_0x39bfcd[_0xb3b1('0x1e')]=0x3e1;_0x39bfcd[_0xb3b1('0x1f')]=!![];}_0x39bfcd[_0xb3b1('0x23')]=_0x3be814||_0x3950db[_0xb3b1('0x1b')]||_0xb3b1('0x24');return _0x39bfcd;};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x25')]=function(){this[_0xb3b1('0x2')]['openBox'](this[_0xb3b1('0xa')],![],this['handleOpenBox'][_0xb3b1('0xf')](this));};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x26')]=function(_0x232707,_0x520f6e){if(_0x232707){this[_0xb3b1('0x13')](_0x232707,!![]);}else{this[_0xb3b1('0x27')](_0xb3b1('0x28'),_0x520f6e);this[_0xb3b1('0x29')]();}};EmailImap[_0xb3b1('0x16')]['handleCloseBox']=function(_0x2247c8){if(_0x2247c8){this[_0xb3b1('0x13')](_0x2247c8,!![]);}else{this[_0xb3b1('0x2')][_0xb3b1('0x10')]();}};EmailImap['prototype'][_0xb3b1('0x29')]=function(){this['imap'][_0xb3b1('0x2a')]([_0xb3b1('0x2b')],this[_0xb3b1('0x2c')][_0xb3b1('0xf')](this));};EmailImap['prototype'][_0xb3b1('0x2c')]=function(_0xa9e2fa,_0x46ef16){if(_0xa9e2fa){this[_0xb3b1('0x13')](_0xa9e2fa,!![]);}else{if(_0x46ef16[_0xb3b1('0x2d')]){try{var _0x33b523=this['imap']['fetch'](_0x46ef16,{'bodies':'','markSeen':!![]});_0x33b523['on'](_0xb3b1('0x2e'),this[_0xb3b1('0x2f')]['bind'](this));_0x33b523[_0xb3b1('0xe')](_0xb3b1('0x12'),this[_0xb3b1('0x30')][_0xb3b1('0xf')](this));_0x33b523[_0xb3b1('0xe')](_0xb3b1('0x10'),this[_0xb3b1('0x31')][_0xb3b1('0xf')](this));}catch(_0xe08c8b){logger[_0xb3b1('0x12')](_0xe08c8b);}}else{this[_0xb3b1('0x2')][_0xb3b1('0x32')](!![],this[_0xb3b1('0x33')][_0xb3b1('0xf')](this));}}};EmailImap['prototype'][_0xb3b1('0x2f')]=function(_0x1d43e7,_0x3af7a0){_0x1d43e7['on']('body',this['handleMessageBody']['bind'](this));_0x1d43e7[_0xb3b1('0xe')](_0xb3b1('0x34'),this['handleMessageAttributes']['bind'](this));_0x1d43e7[_0xb3b1('0xe')](_0xb3b1('0x10'),this[_0xb3b1('0x35')][_0xb3b1('0xf')](this));};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x36')]=function(_0x3e4d37,_0x443bd6){simpleParser(_0x3e4d37,{'Iconv':Iconv},this[_0xb3b1('0x37')]['bind'](this));};EmailImap[_0xb3b1('0x16')]['handleMessageAttributes']=function(_0x3834cb){};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x35')]=function(){};EmailImap[_0xb3b1('0x16')]['handleSimpleParser']=function(_0x41e5d1,_0x35ab71){if(_0x41e5d1){logger[_0xb3b1('0x12')](_0x41e5d1);}else{var _0x2b1f55=this;utils[_0xb3b1('0x38')](this[_0xb3b1('0xc')],_0x35ab71,function(_0x144e3e){_0x2b1f55[_0xb3b1('0x27')](_0xb3b1('0x23'),_0x144e3e);});}};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x31')]=function(){this['imap']['closeBox'](!![],this[_0xb3b1('0x33')][_0xb3b1('0xf')](this));};EmailImap['prototype'][_0xb3b1('0x30')]=function(_0x594904){this[_0xb3b1('0x13')](_0x594904);this[_0xb3b1('0x2')][_0xb3b1('0x32')](!![],this[_0xb3b1('0x33')][_0xb3b1('0xf')](this));};EmailImap[_0xb3b1('0x16')][_0xb3b1('0x11')]=function(){this[_0xb3b1('0x27')](_0xb3b1('0x10'));};EmailImap['prototype'][_0xb3b1('0x13')]=function(_0x21d93e,_0x537fe6){logger[_0xb3b1('0x12')]('handleError',this[_0xb3b1('0xc')][_0xb3b1('0x23')],JSON[_0xb3b1('0x39')](_0x21d93e));var _0x39988b='';if(_0x21d93e){if(_0x21d93e[_0xb3b1('0x3a')]){_0x39988b=_0x21d93e['textCode'];}else{for(var _0x616875 in _0x21d93e){if(_0x21d93e[_0xb3b1('0x3b')](_0x616875)){_0x39988b+=_[_0xb3b1('0x3c')](_0x616875)+':\x20'+_0x21d93e[_0x616875]+'\x0a';}}}}if(_0x537fe6){this[_0xb3b1('0x2')][_0xb3b1('0x10')]();}else{this[_0xb3b1('0x27')]('error',_0x39988b);this[_0xb3b1('0x27')]('end');}};module[_0xb3b1('0x3d')]=EmailImap; \ No newline at end of file +var _0x1f71=['upperFirst','exports','path','lodash','mailparser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','tls','autotls','getHost','port','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','email','closeBox','textCode','hasOwnProperty'];(function(_0x5ad1a0,_0x3562ff){var _0x4478a4=function(_0x60b7b2){while(--_0x60b7b2){_0x5ad1a0['push'](_0x5ad1a0['shift']());}};_0x4478a4(++_0x3562ff);}(_0x1f71,0xfa));var _0x11f7=function(_0x4d83ad,_0x536cc4){_0x4d83ad=_0x4d83ad-0x0;var _0x52bc4d=_0x1f71[_0x4d83ad];return _0x52bc4d;};'use strict';var fs=require('fs');var path=require(_0x11f7('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0x11f7('0x1'));var rs=require('randomstring');var simpleParser=require(_0x11f7('0x2'))['simpleParser'];var Iconv=require(_0x11f7('0x3'))[_0x11f7('0x4')];var EventEmitter=require('events')[_0x11f7('0x5')];var utils=require(_0x11f7('0x6'));var logger=require(_0x11f7('0x7'))('email');function EmailImap(_0x1159e9,_0x8a345b){this[_0x11f7('0x8')]='INBOX';this[_0x11f7('0x9')]=this[_0x11f7('0xa')](_0x1159e9,_0x8a345b);this[_0x11f7('0xb')]=new Imap(this[_0x11f7('0x9')]);this[_0x11f7('0xb')][_0x11f7('0xc')](_0x11f7('0xd'),this[_0x11f7('0xe')][_0x11f7('0xf')](this));this[_0x11f7('0xb')][_0x11f7('0xc')](_0x11f7('0x10'),this[_0x11f7('0x11')][_0x11f7('0xf')](this));this[_0x11f7('0xb')]['on'](_0x11f7('0x12'),this['handleError'][_0x11f7('0xf')](this));this[_0x11f7('0xb')][_0x11f7('0x13')]();}util[_0x11f7('0x14')](EmailImap,EventEmitter);EmailImap[_0x11f7('0x15')][_0x11f7('0xa')]=function(_0x417295,_0xe2643c){var _0x21bf70={'connTimeout':_0x417295['connTimeout']?_0x417295[_0x11f7('0x16')]*0x3e8:0x2710,'authTimeout':_0x417295[_0x11f7('0x17')]?_0x417295[_0x11f7('0x17')]*0x3e8:0x1388};if(_[_0x11f7('0x18')](_0x417295[_0x11f7('0x19')])){if(_0x417295[_0x11f7('0x1a')]){_0x21bf70[_0x11f7('0x1b')]=_0x417295[_0x11f7('0x1b')];_0x21bf70[_0x11f7('0x1c')]=_0x417295[_0x11f7('0x1c')];}_0x21bf70[_0x11f7('0x1d')]=_0x417295[_0x11f7('0x1d')];_0x21bf70['port']=_0x417295['port']||0x3e1;if(_0x417295[_0x11f7('0x1e')]){_0x21bf70[_0x11f7('0x1e')]=!![];}else{_0x21bf70['tls']=![];_0x21bf70[_0x11f7('0x1f')]='required';}}else{_0x21bf70[_0x11f7('0x1b')]=_0x417295[_0x11f7('0x1b')];_0x21bf70[_0x11f7('0x1c')]=_0x417295[_0x11f7('0x1c')];_0x21bf70[_0x11f7('0x1d')]=utils[_0x11f7('0x20')](_0x417295[_0x11f7('0x19')]);_0x21bf70[_0x11f7('0x21')]=0x3e1;_0x21bf70[_0x11f7('0x1e')]=!![];}_0x21bf70['email']=_0xe2643c||_0x417295['user']||_0x11f7('0x22');return _0x21bf70;};EmailImap[_0x11f7('0x15')][_0x11f7('0xe')]=function(){this['imap'][_0x11f7('0x23')](this[_0x11f7('0x8')],![],this['handleOpenBox']['bind'](this));};EmailImap['prototype'][_0x11f7('0x24')]=function(_0x325ac7,_0x1734c4){if(_0x325ac7){this[_0x11f7('0x25')](_0x325ac7,!![]);}else{this[_0x11f7('0x26')](_0x11f7('0x27'),_0x1734c4);this['readUnseen']();}};EmailImap[_0x11f7('0x15')][_0x11f7('0x28')]=function(_0x121abb){if(_0x121abb){this['handleError'](_0x121abb,!![]);}else{this['imap'][_0x11f7('0x10')]();}};EmailImap[_0x11f7('0x15')][_0x11f7('0x29')]=function(){this['imap'][_0x11f7('0x2a')]([_0x11f7('0x2b')],this[_0x11f7('0x2c')][_0x11f7('0xf')](this));};EmailImap[_0x11f7('0x15')][_0x11f7('0x2c')]=function(_0x3fa103,_0x13d2c3){if(_0x3fa103){this['handleError'](_0x3fa103,!![]);}else{if(_0x13d2c3[_0x11f7('0x2d')]){try{var _0x3b57da=this[_0x11f7('0xb')][_0x11f7('0x2e')](_0x13d2c3,{'bodies':'','markSeen':!![]});_0x3b57da['on'](_0x11f7('0x2f'),this[_0x11f7('0x30')]['bind'](this));_0x3b57da[_0x11f7('0xc')](_0x11f7('0x12'),this[_0x11f7('0x31')][_0x11f7('0xf')](this));_0x3b57da['once'](_0x11f7('0x10'),this['handleFetchEnd'][_0x11f7('0xf')](this));}catch(_0x559554){logger[_0x11f7('0x12')](_0x559554);}}else{this[_0x11f7('0xb')]['closeBox'](!![],this['handleCloseBox'][_0x11f7('0xf')](this));}}};EmailImap[_0x11f7('0x15')][_0x11f7('0x30')]=function(_0x2d7540,_0x2b7cee){_0x2d7540['on'](_0x11f7('0x32'),this[_0x11f7('0x33')]['bind'](this));_0x2d7540['once'](_0x11f7('0x34'),this[_0x11f7('0x35')][_0x11f7('0xf')](this));_0x2d7540[_0x11f7('0xc')](_0x11f7('0x10'),this[_0x11f7('0x36')][_0x11f7('0xf')](this));};EmailImap[_0x11f7('0x15')][_0x11f7('0x33')]=function(_0x5b75ef,_0x4b52db){simpleParser(_0x5b75ef,{'Iconv':Iconv},this[_0x11f7('0x37')][_0x11f7('0xf')](this));};EmailImap[_0x11f7('0x15')][_0x11f7('0x35')]=function(_0x37c5ee){};EmailImap[_0x11f7('0x15')][_0x11f7('0x36')]=function(){};EmailImap[_0x11f7('0x15')][_0x11f7('0x37')]=function(_0x4e25dc,_0x4c168e){if(_0x4e25dc){logger['error'](_0x4e25dc);}else{var _0x2cda35=this;utils['parser'](this[_0x11f7('0x9')],_0x4c168e,function(_0x5ae834){_0x2cda35[_0x11f7('0x26')](_0x11f7('0x38'),_0x5ae834);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0x11f7('0x39')](!![],this[_0x11f7('0x28')][_0x11f7('0xf')](this));};EmailImap[_0x11f7('0x15')][_0x11f7('0x31')]=function(_0x2cf35e){this[_0x11f7('0x25')](_0x2cf35e);this[_0x11f7('0xb')][_0x11f7('0x39')](!![],this[_0x11f7('0x28')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x11f7('0x26')](_0x11f7('0x10'));};EmailImap[_0x11f7('0x15')][_0x11f7('0x25')]=function(_0x2c40de,_0x23ccac){logger[_0x11f7('0x12')](_0x11f7('0x25'),this[_0x11f7('0x9')][_0x11f7('0x38')],JSON['stringify'](_0x2c40de));var _0x17bf7a='';if(_0x2c40de){if(_0x2c40de[_0x11f7('0x3a')]){_0x17bf7a=_0x2c40de[_0x11f7('0x3a')];}else{for(var _0x57f4d1 in _0x2c40de){if(_0x2c40de[_0x11f7('0x3b')](_0x57f4d1)){_0x17bf7a+=_[_0x11f7('0x3c')](_0x57f4d1)+':\x20'+_0x2c40de[_0x57f4d1]+'\x0a';}}}}if(_0x23ccac){this['imap'][_0x11f7('0x10')]();}else{this[_0x11f7('0x26')](_0x11f7('0x12'),_0x17bf7a);this[_0x11f7('0x26')](_0x11f7('0x10'));}};module[_0x11f7('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 2c8cbbe..8576b61 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8de7=['use','compile','toString','verify','Not\x20verifired','exports','nodemailer','createTransport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8de7,0x9e));var _0x78de=function(_0x446def,_0x4736db){_0x446def=_0x446def-0x0;var _0x296a53=_0x8de7[_0x446def];return _0x296a53;};'use strict';var nodemailer=require(_0x78de('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x41ffdd,_0x4761b4){return new BPromise(function(_0x4ac233,_0x1693a7){var _0x5cb385=nodemailer[_0x78de('0x1')](_0x41ffdd);_0x5cb385[_0x78de('0x2')](_0x78de('0x3'),inlineBase64());_0x5cb385['sendMail'](_0x4761b4,function(_0x2a7a70,_0x586e35){if(_0x2a7a70){_0x1693a7(_0x2a7a70[_0x78de('0x4')]());}else{_0x4ac233(_0x586e35);}});});};EmailSmtp['prototype']['verify']=function(_0x16885b){return new BPromise(function(_0x1ca704,_0x412c98){var _0x14dd3c=nodemailer['createTransport'](_0x16885b);_0x14dd3c[_0x78de('0x5')](function(_0x361b52,_0x1ffb7e){if(_0x361b52){_0x412c98(_0x361b52['toString']());}else{if(_0x1ffb7e){_0x1ca704(_0x1ffb7e);}else{_0x412c98(_0x78de('0x6'));}}});});};module[_0x78de('0x7')]=EmailSmtp; \ No newline at end of file +var _0xa806=['toString','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','verify'];(function(_0x22ca63,_0xd263ec){var _0xadc6dc=function(_0x4cd069){while(--_0x4cd069){_0x22ca63['push'](_0x22ca63['shift']());}};_0xadc6dc(++_0xd263ec);}(_0xa806,0x134));var _0x6a80=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0xa806[_0x21b74b];return _0x518cc6;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x6a80('0x0'));var inlineBase64=require(_0x6a80('0x1'));function EmailSmtp(){}EmailSmtp[_0x6a80('0x2')][_0x6a80('0x3')]=function(_0x107269,_0x38f618){return new BPromise(function(_0xaa66dd,_0xce1eca){var _0x21a24b=nodemailer[_0x6a80('0x4')](_0x107269);_0x21a24b[_0x6a80('0x5')]('compile',inlineBase64());_0x21a24b['sendMail'](_0x38f618,function(_0x179cb1,_0x3a0396){if(_0x179cb1){_0xce1eca(_0x179cb1['toString']());}else{_0xaa66dd(_0x3a0396);}});});};EmailSmtp[_0x6a80('0x2')][_0x6a80('0x6')]=function(_0xfb9881){return new BPromise(function(_0x1bf432,_0x2611ac){var _0x4efb01=nodemailer[_0x6a80('0x4')](_0xfb9881);_0x4efb01[_0x6a80('0x6')](function(_0x17e16f,_0x3140c9){if(_0x17e16f){_0x2611ac(_0x17e16f[_0x6a80('0x7')]());}else{if(_0x3140c9){_0x1bf432(_0x3140c9);}else{_0x2611ac('Not\x20verifired');}}});});};module[_0x6a80('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c5109d8..bb159f1 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeaab=['imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','join','Anonymous','pop','isEmpty','html','includes','','body','Empty\x20message

','getHost','imap.gmail.com'];(function(_0x4f583c,_0x3b608d){var _0x53208a=function(_0x322e1a){while(--_0x322e1a){_0x4f583c['push'](_0x4f583c['shift']());}};_0x53208a(++_0x3b608d);}(_0xeaab,0xd9));var _0xbeaa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeaab[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbeaa('0x0'));var moment=require('moment');var random=require(_0xbeaa('0x1'));var fs=require('fs');var path=require(_0xbeaa('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xbeaa('0x3'))(_0xbeaa('0x4'));var config=require(_0xbeaa('0x5'));function getAddress(_0x3e9c3b){var _0x281a29=_[_0xbeaa('0x6')](_0x3e9c3b[_0xbeaa('0x7')]);return _0x281a29&&_0x281a29[_0xbeaa('0x8')]?_0x281a29[_0xbeaa('0x8')]:_0xbeaa('0x9')+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');}function getFirstName(_0x15a826){var _0xd2a868=_['head'](_0x15a826[_0xbeaa('0x7')]);if(_0xd2a868&&_0xd2a868[_0xbeaa('0xc')]){if(_0xd2a868[_0xbeaa('0xc')]==_0xd2a868[_0xbeaa('0x8')]){return _0xd2a868[_0xbeaa('0xc')][_0xbeaa('0xd')](0x0,_0xd2a868[_0xbeaa('0xc')]['indexOf']('@'));}var _0x18fd02=_0xd2a868['name'][_0xbeaa('0xe')](/\s+/);return _0x18fd02[_0xbeaa('0xf')]>0x1?_0x18fd02['slice'](0x0,-0x1)[_0xbeaa('0x10')]('\x20'):_0xd2a868['name'];}return _0xbeaa('0x11');}function getLastName(_0x17d717){var _0x5457e5=_[_0xbeaa('0x6')](_0x17d717[_0xbeaa('0x7')]);if(_0x5457e5&&_0x5457e5[_0xbeaa('0xc')]){var _0x6fee13=_0x5457e5[_0xbeaa('0xc')][_0xbeaa('0xe')](/\s+/);return _0x6fee13[_0xbeaa('0xf')]>0x1?_0x6fee13[_0xbeaa('0x12')]():'';}return'';}function getMails(_0x2ab806,_0x34271a){var _0x1b28a5='';for(var _0x1cc387=0x0;_0x1cc387<_0x34271a[_0xbeaa('0x7')][_0xbeaa('0xf')];_0x1cc387+=0x1){if(_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]!==_0x2ab806){if(!_[_0xbeaa('0x13')](_0x1b28a5)){_0x1b28a5+=',';}_0x1b28a5+=_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0xc')]||_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]||'';_0x1b28a5+='\x20<';_0x1b28a5+=_0x34271a['value'][_0x1cc387][_0xbeaa('0x8')]?_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]:'anonymous'+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');_0x1b28a5+='>';}}return _0x1b28a5;}function parseEmail(_0x3f2827,_0x3aa812,_0x3923fd){if(_0x3aa812[_0xbeaa('0x14')]){var _0x106621=/)<[^<]*)*<\/script>/gi;while(_0x106621['test'](_0x3aa812[_0xbeaa('0x14')])){_0x3aa812[_0xbeaa('0x14')]=_0x3aa812['html']['replace'](_0x106621,'');}if(_0x3aa812['html'][_0xbeaa('0x15')](_0xbeaa('0x16'))){var _0x8eb550=[];_0x3aa812[_0xbeaa('0x17')]['forEach'](_0x5a2540=>{_0x8eb550['push'](_0x5a2540[_0xbeaa('0x18')]);});var _0x441653=/]+>/g;var _0x63d68b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xa9a88e=_0x3aa812[_0xbeaa('0x14')]['replace'](_0x63d68b,_0xbeaa('0x19'));var _0x3a4386=_0xa9a88e[_0xbeaa('0x1a')](_0x441653,'_IMG');for(let _0x2f509e=0x0;_0x2f509e<_0x8eb550[_0xbeaa('0xf')];_0x2f509e++){var _0x233094=_0x3a4386['replace'](_0xbeaa('0x1b'),'\x20[Attachment:\x20'+_0x8eb550[_0x2f509e]+_0xbeaa('0x1c'));_0x3a4386=_0x233094;}_0x3aa812[_0xbeaa('0x14')]=_0x3a4386;}_0x3923fd[_0xbeaa('0x1d')]=_0x3aa812[_0xbeaa('0x14')];}else{_0x3923fd[_0xbeaa('0x1d')]=_0x3aa812['textAsHtml'];}if(_0x3923fd[_0xbeaa('0x1d')]){_0x3923fd[_0xbeaa('0x1d')]=_0x3923fd['body'][_0xbeaa('0x1a')](/0x0){var _0x3648e4=[_0xbeaa('0x2c'),_0xbeaa('0x2d'),'Precedence:\x20auto_reply'];for(var _0x586f50=0x0;_0x586f50<_0x3aa812[_0xbeaa('0x2b')][_0xbeaa('0xf')];_0x586f50++){var _0x5c8454=_['indexOf'](_0x3648e4,_0x3aa812[_0xbeaa('0x2b')][_0x586f50][_0xbeaa('0x2e')]);if(_0x5c8454>=0x0){_0x3923fd[_0xbeaa('0x2f')]=!![];}}}return _0x3923fd;}exports[_0xbeaa('0x30')]=function(_0x35ffda,_0x459680,_0x532491){var _0x133f51={'from':getAddress(_0x459680[_0xbeaa('0x31')]),'firstName':getFirstName(_0x459680[_0xbeaa('0x31')]),'lastName':getLastName(_0x459680['from']),'mapKey':_0xbeaa('0x4'),'message':{'from':getMails(_0x35ffda[_0xbeaa('0x4')],_0x459680[_0xbeaa('0x31')]),'to':_0x35ffda['email'],'cc':'','subject':_0x459680[_0xbeaa('0x32')]||'','messageId':_0x459680['messageId'],'inReplyTo':_0x459680[_0xbeaa('0x33')],'sentAt':moment(_0x459680[_0xbeaa('0x34')])[_0xbeaa('0x24')](_0xbeaa('0x35')),'attach':![],'attachments':[]}};if(!_0x459680[_0xbeaa('0x14')]&&!_0x459680[_0xbeaa('0x36')]){var _0x4d0164=_[_0xbeaa('0x37')](_0x459680['attachments'],{'contentType':_0xbeaa('0x38')});if(_0x4d0164[_0xbeaa('0xf')]){logger[_0xbeaa('0x39')](util['format'](_0xbeaa('0x3a'),_0x459680[_0xbeaa('0x3b')]));tnef['parseBuffer'](_[_0xbeaa('0x3c')](_0x4d0164)[_0xbeaa('0x28')],function(_0x47a81a,_0x68da63){if(_0x68da63){_0x459680[_0xbeaa('0x14')]=_0x68da63['BodyHTML']||'

Empty\x20message

';if(_0x68da63['Attachments']){for(var _0x348715=0x0;_0x348715<_0x68da63[_0xbeaa('0x3d')][_0xbeaa('0xf')];_0x348715++){var _0x8bbbd3=_0x68da63[_0xbeaa('0x3d')][_0x348715];_0x133f51[_0xbeaa('0x20')][_0xbeaa('0x17')][_0xbeaa('0x29')]({'filename':_0x8bbbd3[_0xbeaa('0x3e')],'content':Buffer[_0xbeaa('0x31')](_0x8bbbd3[_0xbeaa('0x3f')])});}}}_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));});}else{_0x459680[_0xbeaa('0x14')]=_0xbeaa('0x40');_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));}}else{_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));}};exports[_0xbeaa('0x41')]=function(_0x3f2ea9){switch(_0x3f2ea9){case'gmail':return _0xbeaa('0x42');case'yahoo':return _0xbeaa('0x43');case'hotmail':return'imap-mail.outlook.com';case _0xbeaa('0x44'):return _0xbeaa('0x45');}return _0xbeaa('0x46');}; \ No newline at end of file +var _0x78f4=['X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','../../../config/logger','../../../config/environment','value','address','anonymous','head','name','substring','indexOf','split','length','slice','Anonymous','pop','generate','@xcally.com','html','test','includes','attachments','forEach','push','filename','replace','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x45e1dd[_0x478f('0xf')](0x0,-0x1)['join']('\x20'):_0x50e96f[_0x478f('0xa')];}return _0x478f('0x10');}function getLastName(_0x93057a){var _0x4178c0=_[_0x478f('0x9')](_0x93057a[_0x478f('0x6')]);if(_0x4178c0&&_0x4178c0[_0x478f('0xa')]){var _0x18da1c=_0x4178c0['name'][_0x478f('0xd')](/\s+/);return _0x18da1c[_0x478f('0xe')]>0x1?_0x18da1c[_0x478f('0x11')]():'';}return'';}function getMails(_0x2f1266,_0x528142){var _0x10e21d='';for(var _0x4f2aeb=0x0;_0x4f2aeb<_0x528142[_0x478f('0x6')][_0x478f('0xe')];_0x4f2aeb+=0x1){if(_0x528142['value'][_0x4f2aeb][_0x478f('0x7')]!==_0x2f1266){if(!_['isEmpty'](_0x10e21d)){_0x10e21d+=',';}_0x10e21d+=_0x528142[_0x478f('0x6')][_0x4f2aeb][_0x478f('0xa')]||_0x528142[_0x478f('0x6')][_0x4f2aeb][_0x478f('0x7')]||'';_0x10e21d+='\x20<';_0x10e21d+=_0x528142[_0x478f('0x6')][_0x4f2aeb][_0x478f('0x7')]?_0x528142[_0x478f('0x6')][_0x4f2aeb][_0x478f('0x7')]:_0x478f('0x8')+random[_0x478f('0x12')](0x6)+_0x478f('0x13');_0x10e21d+='>';}}return _0x10e21d;}function parseEmail(_0x427a8a,_0x17729d,_0x4ad190){if(_0x17729d[_0x478f('0x14')]){var _0x32b512=/)<[^<]*)*<\/script>/gi;while(_0x32b512[_0x478f('0x15')](_0x17729d[_0x478f('0x14')])){_0x17729d[_0x478f('0x14')]=_0x17729d[_0x478f('0x14')]['replace'](_0x32b512,'');}if(_0x17729d['html'][_0x478f('0x16')]('{_0xedd0d9[_0x478f('0x19')](_0x44e0d0[_0x478f('0x1a')]);});var _0x4ced66=/]+>/g;var _0x5ecfd8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x65ef4=_0x17729d['html'][_0x478f('0x1b')](_0x5ecfd8,'_SRC');var _0x101952=_0x65ef4['replace'](_0x4ced66,_0x478f('0x1c'));for(let _0x29ecdb=0x0;_0x29ecdb<_0xedd0d9[_0x478f('0xe')];_0x29ecdb++){var _0x2d868e=_0x101952[_0x478f('0x1b')](_0x478f('0x1c'),_0x478f('0x1d')+_0xedd0d9[_0x29ecdb]+_0x478f('0x1e'));_0x101952=_0x2d868e;}_0x17729d[_0x478f('0x14')]=_0x101952;}_0x4ad190[_0x478f('0x1f')]=_0x17729d[_0x478f('0x14')];}else{_0x4ad190[_0x478f('0x1f')]=_0x17729d[_0x478f('0x20')];}if(_0x4ad190[_0x478f('0x1f')]){_0x4ad190[_0x478f('0x1f')]=_0x4ad190[_0x478f('0x1f')][_0x478f('0x1b')](/0x0){var _0x185413=['Auto-Submitted:\x20auto-replied',_0x478f('0x30'),_0x478f('0x31')];for(var _0x4acd94=0x0;_0x4acd94<_0x17729d['headerLines'][_0x478f('0xe')];_0x4acd94++){var _0x3b0a00=_[_0x478f('0xc')](_0x185413,_0x17729d[_0x478f('0x2f')][_0x4acd94][_0x478f('0x32')]);if(_0x3b0a00>=0x0){_0x4ad190['isAutoreply']=!![];}}}return _0x4ad190;}exports[_0x478f('0x33')]=function(_0x74793e,_0x348bae,_0x1697ad){var _0xc46353={'from':getAddress(_0x348bae[_0x478f('0x34')]),'firstName':getFirstName(_0x348bae['from']),'lastName':getLastName(_0x348bae['from']),'mapKey':_0x478f('0x26'),'message':{'from':getMails(_0x74793e[_0x478f('0x26')],_0x348bae[_0x478f('0x34')]),'to':_0x74793e[_0x478f('0x26')],'cc':'','subject':_0x348bae[_0x478f('0x35')]||'','messageId':_0x348bae['messageId'],'inReplyTo':_0x348bae['inReplyTo'],'sentAt':moment(_0x348bae['date'])[_0x478f('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x348bae[_0x478f('0x14')]&&!_0x348bae[_0x478f('0x20')]){var _0x18c9ea=_[_0x478f('0x36')](_0x348bae[_0x478f('0x17')],{'contentType':'application/ms-tnef'});if(_0x18c9ea[_0x478f('0xe')]){logger[_0x478f('0x37')](util[_0x478f('0x2a')](_0x478f('0x38'),_0x348bae['messageId']));tnef[_0x478f('0x39')](_[_0x478f('0x3a')](_0x18c9ea)[_0x478f('0x2d')],function(_0x4c6df3,_0x5c85e2){if(_0x5c85e2){_0x348bae[_0x478f('0x14')]=_0x5c85e2[_0x478f('0x3b')]||_0x478f('0x3c');if(_0x5c85e2[_0x478f('0x3d')]){for(var _0x3747f3=0x0;_0x3747f3<_0x5c85e2['Attachments']['length'];_0x3747f3++){var _0x23f695=_0x5c85e2[_0x478f('0x3d')][_0x3747f3];_0xc46353['message'][_0x478f('0x17')][_0x478f('0x19')]({'filename':_0x23f695[_0x478f('0x3e')],'content':Buffer[_0x478f('0x34')](_0x23f695[_0x478f('0x3f')])});}}}_0x1697ad(parseEmail(_0x74793e,_0x348bae,_0xc46353));});}else{_0x348bae[_0x478f('0x14')]=_0x478f('0x3c');_0x1697ad(parseEmail(_0x74793e,_0x348bae,_0xc46353));}}else{_0x1697ad(parseEmail(_0x74793e,_0x348bae,_0xc46353));}};exports[_0x478f('0x40')]=function(_0x249d01){switch(_0x249d01){case _0x478f('0x41'):return _0x478f('0x42');case _0x478f('0x43'):return'imap.mail.yahoo.com';case _0x478f('0x44'):return _0x478f('0x45');case'outlook365':return _0x478f('0x46');}return _0x478f('0x47');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b4825e9..9ca3172 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c30=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x7f49c1,_0x2ea6fb){var _0x391d9b=function(_0x3475dd){while(--_0x3475dd){_0x7f49c1['push'](_0x7f49c1['shift']());}};_0x391d9b(++_0x2ea6fb);}(_0x0c30,0x130));var _0x00c3=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x0c30[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x00c3('0x0'));function MailAccount(_0x28f8b2){this['id']=_0x28f8b2['id']||0x0;this[_0x00c3('0x1')]=_0x28f8b2[_0x00c3('0x1')]||_0x00c3('0x2');this[_0x00c3('0x3')]=_0x28f8b2['key']||_0x00c3('0x4');this[_0x00c3('0x5')]=_0x28f8b2[_0x00c3('0x5')]||![];this[_0x00c3('0x6')]=_0x28f8b2[_0x00c3('0x6')]||[];this[_0x00c3('0x7')]=_0x28f8b2[_0x00c3('0x7')]||[];}module[_0x00c3('0x8')]=MailAccount; \ No newline at end of file +var _0x9d03=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0x45d886,_0x694715){var _0x3c1904=function(_0x120ec1){while(--_0x120ec1){_0x45d886['push'](_0x45d886['shift']());}};_0x3c1904(++_0x694715);}(_0x9d03,0xcd));var _0x39d0=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9d03[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');function MailAccount(_0x1bc949){this['id']=_0x1bc949['id']||0x0;this[_0x39d0('0x0')]=_0x1bc949['name']||_0x39d0('0x1');this[_0x39d0('0x2')]=_0x1bc949[_0x39d0('0x2')]||_0x39d0('0x3');this[_0x39d0('0x4')]=_0x1bc949['active']||![];this['Imap']=_0x1bc949[_0x39d0('0x5')]||[];this['Smtp']=_0x1bc949[_0x39d0('0x6')]||[];}module[_0x39d0('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index cfab5ac..bb6a5fe 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5af=['hasOwnProperty','prototype','initMailAccounts','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x27141c,_0x25ff8d){var _0x5a9b58=function(_0x2b5d51){while(--_0x2b5d51){_0x27141c['push'](_0x27141c['shift']());}};_0x5a9b58(++_0x25ff8d);}(_0xf5af,0x1dc));var _0xff5a=function(_0xc323e9,_0x5b66ac){_0xc323e9=_0xc323e9-0x0;var _0x2fa4d7=_0xf5af[_0xc323e9];return _0x2fa4d7;};'use strict';var _=require(_0xff5a('0x0'));var MailAccount=require(_0xff5a('0x1'));var Realtime=function(){this[_0xff5a('0x2')]={};};function freeIsNotKey(_0x6ab690,_0x4e83e1,_0xf37892){var _0x1bc641=_[_0xff5a('0x3')](_0x6ab690,function(_0x37d783,_0x173584){return _0x37d783[_0xf37892];});for(var _0x4399ce in _0x4e83e1){if(_0x4e83e1[_0xff5a('0x4')](_0x4399ce)){if(!_0x1bc641[_0x4399ce]){delete _0x4e83e1[_0x4399ce];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x43bedf,_0x2e8c27){for(var _0x1661a8 in _0x2e8c27){if(_0x43bedf['hasOwnProperty'](_0x1661a8)){_0x43bedf[_0x1661a8]=_0x2e8c27[_0x1661a8];}}};Realtime[_0xff5a('0x5')][_0xff5a('0x6')]=function(){var _0x16a528=this;return function(_0x51080e){if(_0x51080e){freeIsNotKey(_0x51080e,_0x16a528[_0xff5a('0x2')],'id');for(var _0x165dcc=0x0,_0x1950c4={},_0x58bab5={};_0x165dcc<_0x51080e['length'];_0x165dcc+=0x1){_0x1950c4=_0x51080e[_0x165dcc];if(_['isUndefined'](_0x16a528[_0xff5a('0x2')][_0x1950c4['id']])){_0x16a528[_0xff5a('0x2')][_0x1950c4['id']]=new MailAccount(_0x1950c4);}else{_['merge'](_0x16a528['mailAccounts'][_0x1950c4['id']],_0x1950c4);}}}return _0x16a528[_0xff5a('0x2')];};};module[_0xff5a('0x7')]=Realtime; \ No newline at end of file +var _0x08de=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','exports','../model/mailAccount','mailAccounts'];(function(_0x2b5320,_0x4c0ad2){var _0x501d42=function(_0x15e178){while(--_0x15e178){_0x2b5320['push'](_0x2b5320['shift']());}};_0x501d42(++_0x4c0ad2);}(_0x08de,0x14e));var _0xe08d=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x08de[_0x687ddc];return _0x441991;};'use strict';var _=require('lodash');var MailAccount=require(_0xe08d('0x0'));var Realtime=function(){this[_0xe08d('0x1')]={};};function freeIsNotKey(_0x47f8e2,_0x558e5c,_0x34fcb3){var _0x1038a9=_[_0xe08d('0x2')](_0x47f8e2,function(_0x3538bd,_0x203a72){return _0x3538bd[_0x34fcb3];});for(var _0x5c3330 in _0x558e5c){if(_0x558e5c[_0xe08d('0x3')](_0x5c3330)){if(!_0x1038a9[_0x5c3330]){delete _0x558e5c[_0x5c3330];}}}}Realtime['prototype'][_0xe08d('0x4')]=function(_0x466f0d,_0x3b6b72){for(var _0x3e2534 in _0x3b6b72){if(_0x466f0d[_0xe08d('0x3')](_0x3e2534)){_0x466f0d[_0x3e2534]=_0x3b6b72[_0x3e2534];}}};Realtime[_0xe08d('0x5')]['initMailAccounts']=function(){var _0x18439e=this;return function(_0x5570cb){if(_0x5570cb){freeIsNotKey(_0x5570cb,_0x18439e['mailAccounts'],'id');for(var _0x1e84a6=0x0,_0x32cac3={},_0x35bc6c={};_0x1e84a6<_0x5570cb[_0xe08d('0x6')];_0x1e84a6+=0x1){_0x32cac3=_0x5570cb[_0x1e84a6];if(_['isUndefined'](_0x18439e[_0xe08d('0x1')][_0x32cac3['id']])){_0x18439e['mailAccounts'][_0x32cac3['id']]=new MailAccount(_0x32cac3);}else{_['merge'](_0x18439e[_0xe08d('0x1')][_0x32cac3['id']],_0x32cac3);}}}return _0x18439e[_0xe08d('0x1')];};};module[_0xe08d('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 3838987..114cb9c 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x633b=['TemplateId','MailServerIn','Imap','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','email','active','key','ListId'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x633b,0xd8));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xb633('0x0'));exports[_0xb633('0x1')]=function(){return function(){return client[_0xb633('0x2')](_0xb633('0x3'),{'options':{'attributes':['id',_0xb633('0x4'),'service',_0xb633('0x5'),_0xb633('0x6'),_0xb633('0x7'),_0xb633('0x8'),_0xb633('0x9')],'raw':![],'include':[{'model':_0xb633('0xa'),'as':_0xb633('0xb')},{'model':'MailServerOut','as':_0xb633('0xc')}]},'log':_0xb633('0xd')});};};exports['notify']=function(_0xc086ee,_0x2298cb){return client[_0xb633('0x2')](_0xb633('0xe'),{'account':{'id':_0xc086ee},'body':_0x2298cb,'log':_0xb633('0xe')});}; \ No newline at end of file +var _0x3af5=['getMailAccounts','GetMailAccount','name','active','TemplateId','MailServerIn','MailServerOut','getMailAccount','notify','Request','NotifyMailAccount','../client'];(function(_0x5ec8d0,_0x2a9de7){var _0x3f4487=function(_0x4de5af){while(--_0x4de5af){_0x5ec8d0['push'](_0x5ec8d0['shift']());}};_0x3f4487(++_0x2a9de7);}(_0x3af5,0x1d3));var _0x53af=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0x3af5[_0x453e2b];return _0x50f306;};'use strict';var client=require(_0x53af('0x0'));exports[_0x53af('0x1')]=function(){return function(){return client['Request'](_0x53af('0x2'),{'options':{'attributes':['id',_0x53af('0x3'),'service','email',_0x53af('0x4'),'key','ListId',_0x53af('0x5')],'raw':![],'include':[{'model':_0x53af('0x6'),'as':'Imap'},{'model':_0x53af('0x7'),'as':'Smtp'}]},'log':_0x53af('0x8')});};};exports[_0x53af('0x9')]=function(_0x2875ab,_0x22c0cb){return client[_0x53af('0xa')](_0x53af('0xb'),{'account':{'id':_0x2875ab},'body':_0x22c0cb,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 52fd968..a6bc91a 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a36=['ShowSetting','loginMailFrequency','GetSettings','Request'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x6a36,0x9f));var _0x66a3=function(_0x5073d4,_0x304570){_0x5073d4=_0x5073d4-0x0;var _0x3bfa9f=_0x6a36[_0x5073d4];return _0x3bfa9f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x66a3('0x0')](_0x66a3('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x66a3('0x2')]},'log':_0x66a3('0x3')});}; \ No newline at end of file +var _0x6ae6=['getSettings','Request','ShowSetting','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ae6,0xf7));var _0x66ae=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x6ae6[_0x2932cf];return _0x1711dd;};'use strict';var client=require(_0x66ae('0x0'));exports[_0x66ae('0x1')]=function(){return client[_0x66ae('0x2')](_0x66ae('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8a86392..bfa5632 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index e090788..f48720f 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x600f=['redis','defaults','default','../../config/socketio','../../config/express','listening','log','exports','lodash','express','sticky-session','../../config/environment','timeout','port','socket.io','websocket','polling'];(function(_0xafaec4,_0x357a04){var _0x262b0a=function(_0x265ed9){while(--_0x265ed9){_0xafaec4['push'](_0xafaec4['shift']());}};_0x262b0a(++_0x357a04);}(_0x600f,0xb2));var _0xf600=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x600f[_0xc8db6b];return _0x12cb81;};'use strict';var _=require(_0xf600('0x0'));var http=require('http');var express=require(_0xf600('0x1'));var sticky=require(_0xf600('0x2'));var Redis=require('ioredis');var config=require(_0xf600('0x3'));var app=express();var server=http['createServer'](app);server[_0xf600('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0xf600('0x5')])){var socketio=require(_0xf600('0x6'))(server,{'transports':[_0xf600('0x7'),_0xf600('0x8')]});config[_0xf600('0x9')]=_[_0xf600('0xa')](config[_0xf600('0x9')],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xf600('0x9')]),'subClient':new Redis(config[_0xf600('0x9')])}));require('../../config/triggers')[_0xf600('0xb')]();require(_0xf600('0xc'))[_0xf600('0xb')](socketio);require(_0xf600('0xd'))[_0xf600('0xb')](app);require('../../routes')[_0xf600('0xb')](app);}else{server['once'](_0xf600('0xe'),function(){console[_0xf600('0xf')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xf600('0x5')]);});}exports=module[_0xf600('0x10')]=app; \ No newline at end of file +var _0x1be8=['../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','redis','defaults','adapter','socket.io-redis'];(function(_0x4930da,_0x59c575){var _0x3d3e54=function(_0x40ce94){while(--_0x40ce94){_0x4930da['push'](_0x4930da['shift']());}};_0x3d3e54(++_0x59c575);}(_0x1be8,0x18a));var _0x81be=function(_0x4924ae,_0x1dd735){_0x4924ae=_0x4924ae-0x0;var _0x2238e4=_0x1be8[_0x4924ae];return _0x2238e4;};'use strict';var _=require(_0x81be('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x81be('0x1'));var Redis=require(_0x81be('0x2'));var config=require(_0x81be('0x3'));var app=express();var server=http[_0x81be('0x4')](app);server[_0x81be('0x5')]=0xdbba0;if(sticky[_0x81be('0x6')](server,config['port'])){var socketio=require(_0x81be('0x7'))(server,{'transports':[_0x81be('0x8'),_0x81be('0x9')]});config[_0x81be('0xa')]=_[_0x81be('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x81be('0xc')](require(_0x81be('0xd'))({'pubClient':new Redis(config[_0x81be('0xa')]),'subClient':new Redis(config[_0x81be('0xa')])}));require(_0x81be('0xe'))[_0x81be('0xf')]();require(_0x81be('0x10'))['default'](socketio);require(_0x81be('0x11'))[_0x81be('0xf')](app);require('../../routes')[_0x81be('0xf')](app);}else{server[_0x81be('0x12')](_0x81be('0x13'),function(){console[_0x81be('0x14')](_0x81be('0x15'),config[_0x81be('0x16')]);});}exports=module[_0x81be('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 26da73d..08d3334 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea67=['catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','rpc','message','error','result'];(function(_0x38c813,_0x348324){var _0x18ac98=function(_0x2ed4f8){while(--_0x2ed4f8){_0x38c813['push'](_0x38c813['shift']());}};_0x18ac98(++_0x348324);}(_0xea67,0xe2));var _0x7ea6=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0xea67[_0x377fb1];return _0x3248e9;};'use strict';var jayson=require(_0x7ea6('0x0'));var BPromise=require(_0x7ea6('0x1'));var logger=require(_0x7ea6('0x2'))(_0x7ea6('0x3'));var client=jayson[_0x7ea6('0x4')][_0x7ea6('0x5')]({'port':0x2329});client[_0x7ea6('0x6')]=function(_0x2a94f9,_0xd0378e){return new BPromise(function(_0x99b6fb,_0x5c3840){return client['request'](_0x2a94f9,_0xd0378e)[_0x7ea6('0x7')](function(_0x12b510){logger['debug'](_0x7ea6('0x8'),_0x7ea6('0x3'),_0x2a94f9,_0xd0378e,_0x12b510);if(_0x12b510['error']){logger['error'](_0x7ea6('0x8'),_0x7ea6('0x3'),_0x2a94f9,_0x12b510['error'][_0x7ea6('0x9')],_0xd0378e);return _0x5c3840(_0x12b510[_0x7ea6('0xa')]['message']);}else{return _0x99b6fb(_0x12b510[_0x7ea6('0xb')]);}})[_0x7ea6('0xc')](function(_0x10bb47){logger['error'](_0x7ea6('0x8'),_0x7ea6('0x3'),_0x2a94f9,_0x10bb47,_0xd0378e);return _0x5c3840(_0x10bb47);});});};module[_0x7ea6('0xd')]=client; \ No newline at end of file +var _0x2195=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','then','debug','rpc','routing','error','message','result'];(function(_0x49b5f9,_0x58aea7){var _0x1ecfcb=function(_0xd6820d){while(--_0xd6820d){_0x49b5f9['push'](_0x49b5f9['shift']());}};_0x1ecfcb(++_0x58aea7);}(_0x2195,0xaa));var _0x5219=function(_0x12237d,_0x544532){_0x12237d=_0x12237d-0x0;var _0x781a33=_0x2195[_0x12237d];return _0x781a33;};'use strict';var jayson=require(_0x5219('0x0'));var BPromise=require(_0x5219('0x1'));var logger=require(_0x5219('0x2'))('routing');var client=jayson[_0x5219('0x3')][_0x5219('0x4')]({'port':0x2329});client['Request']=function(_0x8beb97,_0x3c426b){return new BPromise(function(_0x224571,_0x2af3f3){return client['request'](_0x8beb97,_0x3c426b)[_0x5219('0x5')](function(_0x5200b6){logger[_0x5219('0x6')](_0x5219('0x7'),_0x5219('0x8'),_0x8beb97,_0x3c426b,_0x5200b6);if(_0x5200b6[_0x5219('0x9')]){logger[_0x5219('0x9')](_0x5219('0x7'),_0x5219('0x8'),_0x8beb97,_0x5200b6[_0x5219('0x9')][_0x5219('0xa')],_0x3c426b);return _0x2af3f3(_0x5200b6[_0x5219('0x9')][_0x5219('0xa')]);}else{return _0x224571(_0x5200b6[_0x5219('0xb')]);}})[_0x5219('0xc')](function(_0x417878){logger[_0x5219('0x9')](_0x5219('0x7'),_0x5219('0x8'),_0x8beb97,_0x417878,_0x3c426b);return _0x2af3f3(_0x417878);});});};module[_0x5219('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 3c93e60..1a00c2d 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ddc=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x170ac2,_0x368ae3){var _0x59bf67=function(_0x36bcd3){while(--_0x36bcd3){_0x170ac2['push'](_0x170ac2['shift']());}};_0x59bf67(++_0x368ae3);}(_0x6ddc,0x18f));var _0xc6dd=function(_0x2febb1,_0x35f127){_0x2febb1=_0x2febb1-0x0;var _0xba31e1=_0x6ddc[_0x2febb1];return _0xba31e1;};'use strict';var BPromise=require(_0xc6dd('0x0'));var server=require(_0xc6dd('0x1'));var Realtime=require(_0xc6dd('0x2'));var user=require(_0xc6dd('0x3'));var interval=require(_0xc6dd('0x4'));var openchannelQueue=require(_0xc6dd('0x5'));var chatQueue=require(_0xc6dd('0x6'));var smsQueue=require(_0xc6dd('0x7'));var mailQueue=require(_0xc6dd('0x8'));var faxQueue=require(_0xc6dd('0x9'));var whatsappQueue=require(_0xc6dd('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc6dd('0xb')]()['then'](user[_0xc6dd('0xc')]())[_0xc6dd('0xd')](realtime[_0xc6dd('0xe')]())[_0xc6dd('0xd')](interval[_0xc6dd('0xf')]())[_0xc6dd('0xd')](realtime[_0xc6dd('0x10')]())[_0xc6dd('0xd')](openchannelQueue[_0xc6dd('0x11')]())[_0xc6dd('0xd')](realtime[_0xc6dd('0x12')]())[_0xc6dd('0xd')](chatQueue[_0xc6dd('0x13')]())[_0xc6dd('0xd')](realtime['initChatQueues']())[_0xc6dd('0xd')](smsQueue['getSmsQueues']())['then'](realtime[_0xc6dd('0x14')]())['then'](mailQueue[_0xc6dd('0x15')]())[_0xc6dd('0xd')](realtime[_0xc6dd('0x16')]())['then'](faxQueue['getFaxQueues']())[_0xc6dd('0xd')](realtime[_0xc6dd('0x17')]())['then'](whatsappQueue[_0xc6dd('0x18')]())[_0xc6dd('0xd')](realtime[_0xc6dd('0x19')]())[_0xc6dd('0xd')](function(){return realtime;});}function main(){return server[_0xc6dd('0x1a')](realtime)[_0xc6dd('0xd')](function(_0x424e91){return initRealtime();})[_0xc6dd('0xd')](function(_0x4aa7ad){return setInterval(initRealtime,0x1388);})[_0xc6dd('0x1b')](function(_0x3d1d7c){console[_0xc6dd('0x1c')](_0x3d1d7c);});}main(); \ No newline at end of file +var _0x12c8=['./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','getWhatsappQueues','listen','catch','bluebird','./realtime','./rpc/user'];(function(_0x36eb42,_0x557596){var _0x304d3a=function(_0x57b7ab){while(--_0x57b7ab){_0x36eb42['push'](_0x36eb42['shift']());}};_0x304d3a(++_0x557596);}(_0x12c8,0x189));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x812c('0x0'));var server=require('./server');var Realtime=require(_0x812c('0x1'));var user=require(_0x812c('0x2'));var interval=require(_0x812c('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x812c('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x812c('0x5'));var whatsappQueue=require(_0x812c('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x812c('0x7')]()[_0x812c('0x8')](user[_0x812c('0x9')]())[_0x812c('0x8')](realtime[_0x812c('0xa')]())[_0x812c('0x8')](interval['getIntervals']())[_0x812c('0x8')](realtime[_0x812c('0xb')]())[_0x812c('0x8')](openchannelQueue[_0x812c('0xc')]())[_0x812c('0x8')](realtime[_0x812c('0xd')]())[_0x812c('0x8')](chatQueue[_0x812c('0xe')]())['then'](realtime[_0x812c('0xf')]())[_0x812c('0x8')](smsQueue[_0x812c('0x10')]())['then'](realtime[_0x812c('0x11')]())[_0x812c('0x8')](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())[_0x812c('0x8')](faxQueue[_0x812c('0x12')]())[_0x812c('0x8')](realtime['initFaxQueues']())[_0x812c('0x8')](whatsappQueue[_0x812c('0x13')]())['then'](realtime['initWhatsappQueues']())[_0x812c('0x8')](function(){return realtime;});}function main(){return server[_0x812c('0x14')](realtime)[_0x812c('0x8')](function(_0x56b891){return initRealtime();})[_0x812c('0x8')](function(_0x59cc43){return setInterval(initRealtime,0x1388);})[_0x812c('0x15')](function(_0x23f6c8){console['log'](_0x23f6c8);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 094ec9c..da8179b 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x1e4cdf,_0x1fc7af){var _0x2e66d2=function(_0x5ca192){while(--_0x5ca192){_0x1e4cdf['push'](_0x1e4cdf['shift']());}};_0x2e66d2(++_0x1fc7af);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x67d2b,_0xc3be07){var _0x23e7c1=function(_0x290c5e){while(--_0x290c5e){_0x67d2b['push'](_0x67d2b['shift']());}};_0x23e7c1(++_0xc3be07);}(_0x326f,0xd1));var _0xf326=function(_0x16f89a,_0x277847){_0x16f89a=_0x16f89a-0x0;var _0x5f2070=_0x326f[_0x16f89a];return _0x5f2070;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d8d2d35..986e779 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd496=['SendMail','bluebird','jayson/promise','client','http','then','error','message','result','catch'];(function(_0x2d4810,_0x436511){var _0x20fc15=function(_0x5e0a04){while(--_0x5e0a04){_0x2d4810['push'](_0x2d4810['shift']());}};_0x20fc15(++_0x436511);}(_0xd496,0x123));var _0x6d49=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xd496[_0x424a9a];return _0xa7831c;};'use strict';var BPromise=require(_0x6d49('0x0'));var jayson=require(_0x6d49('0x1'));var client=jayson[_0x6d49('0x2')][_0x6d49('0x3')]({'port':0x232b});function request(_0x559166,_0x12e8a4){return new BPromise(function(_0x5b5792,_0x462f67){return client['request'](_0x559166,_0x12e8a4)[_0x6d49('0x4')](function(_0x2f92ab){if(_0x2f92ab[_0x6d49('0x5')]){return _0x462f67(_0x2f92ab[_0x6d49('0x5')][_0x6d49('0x6')]);}else{return _0x5b5792(_0x2f92ab[_0x6d49('0x7')]);}})[_0x6d49('0x8')](function(_0x47d761){return _0x462f67(_0x47d761);});});}exports['sendMailMessage']=function(_0x4b9c1b,_0x278a99){return request(_0x6d49('0x9'),{'account':_0x4b9c1b,'message':_0x278a99});}; \ No newline at end of file +var _0x2379=['result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x15209a,_0x49e8da){var _0x20f3ef=function(_0x1f450a){while(--_0x1f450a){_0x15209a['push'](_0x15209a['shift']());}};_0x20f3ef(++_0x49e8da);}(_0x2379,0x92));var _0x9237=function(_0x175fc8,_0x3151ed){_0x175fc8=_0x175fc8-0x0;var _0x52cc16=_0x2379[_0x175fc8];return _0x52cc16;};'use strict';var BPromise=require(_0x9237('0x0'));var jayson=require(_0x9237('0x1'));var client=jayson[_0x9237('0x2')][_0x9237('0x3')]({'port':0x232b});function request(_0x39c657,_0x1876ac){return new BPromise(function(_0x39a4fc,_0x3b553e){return client[_0x9237('0x4')](_0x39c657,_0x1876ac)[_0x9237('0x5')](function(_0x297b16){if(_0x297b16[_0x9237('0x6')]){return _0x3b553e(_0x297b16[_0x9237('0x6')][_0x9237('0x7')]);}else{return _0x39a4fc(_0x297b16[_0x9237('0x8')]);}})['catch'](function(_0x2206ac){return _0x3b553e(_0x2206ac);});});}exports[_0x9237('0x9')]=function(_0x4e6ce9,_0x18d6a6){return request(_0x9237('0xa'),{'account':_0x4e6ce9,'message':_0x18d6a6});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index db30742..3656e9b 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf9d=['faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','fax','sms','length','StatusTime','toNumber','Status','chatStatus','mailStatusTime','mailCurrentCapacity','faxStatusTime','smsStatusTime','whatsappStatus','openchannelStatus','openchannelStatusTime','stringify','emit','moment','md5','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatus','mailCapacity'];(function(_0x88d8a3,_0x3c7638){var _0x198613=function(_0x147358){while(--_0x147358){_0x88d8a3['push'](_0x88d8a3['shift']());}};_0x198613(++_0x3c7638);}(_0xcf9d,0x1ae));var _0xdcf9=function(_0x5f6d55,_0x15ac2d){_0x5f6d55=_0x5f6d55-0x0;var _0x5af559=_0xcf9d[_0x5f6d55];return _0x5af559;};'use strict';var _=require('lodash');var moment=require(_0xdcf9('0x0'));var md5=require(_0xdcf9('0x1'));var Redis=require(_0xdcf9('0x2'));var config=require(_0xdcf9('0x3'));config[_0xdcf9('0x4')]=_[_0xdcf9('0x5')](config[_0xdcf9('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdcf9('0x4')]));function Agent(_0x14dfe6){this['id']=_0x14dfe6['id']||0x0;this['name']=_0x14dfe6[_0xdcf9('0x6')]||'';this['online']=_0x14dfe6[_0xdcf9('0x7')]||!![];this[_0xdcf9('0x8')]=_0x14dfe6['voicePause']||![];this['chatPause']=_0x14dfe6[_0xdcf9('0x9')]||![];this[_0xdcf9('0xa')]=_0x14dfe6['mailPause']||![];this[_0xdcf9('0xb')]=_0x14dfe6['faxPause']||![];this[_0xdcf9('0xc')]=_0x14dfe6[_0xdcf9('0xc')]||![];this[_0xdcf9('0xd')]=_0x14dfe6[_0xdcf9('0xd')]||![];this['chatStatus']=_0xdcf9('0xe');this['chatStatusTime']=0x0;this[_0xdcf9('0xf')]=_0x14dfe6[_0xdcf9('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xdcf9('0x10')]=_0xdcf9('0xe');this['mailStatusTime']=0x0;this[_0xdcf9('0x11')]=_0x14dfe6['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0xdcf9('0x12')]='unknown';this['faxStatusTime']=0x0;this[_0xdcf9('0x13')]=_0x14dfe6[_0xdcf9('0x13')]||0x0;this[_0xdcf9('0x14')]=0x0;this[_0xdcf9('0x15')]=_0xdcf9('0xe');this['smsStatusTime']=0x0;this[_0xdcf9('0x16')]=_0x14dfe6['smsCapacity']||0x0;this[_0xdcf9('0x17')]=0x0;this['whatsappStatus']=_0xdcf9('0xe');this[_0xdcf9('0x18')]=0x0;this[_0xdcf9('0x19')]=_0x14dfe6['whatsappCapacity']||0x0;this[_0xdcf9('0x1a')]=0x0;this['openchannelStatus']=_0xdcf9('0xe');this['openchannelStatusTime']=0x0;this[_0xdcf9('0x1b')]=_0x14dfe6[_0xdcf9('0x1b')]||0x0;this[_0xdcf9('0x1c')]=0x0;this[_0xdcf9('0x1d')]=![];this[_0xdcf9('0x1e')]=undefined;this[_0xdcf9('0x1')]='';this[_0xdcf9('0x1f')]();}Agent[_0xdcf9('0x20')][_0xdcf9('0x21')]=function(_0x5d6e36){if(this[_0x5d6e36+_0xdcf9('0x22')]>0x0){if(this[_0x5d6e36+_0xdcf9('0x23')]>0x0&&this[_0x5d6e36+'CurrentCapacity']>=this[_0x5d6e36+_0xdcf9('0x23')]){return _0xdcf9('0x24');}else{return _0xdcf9('0x25');}}else{return'idle';}};Agent[_0xdcf9('0x20')][_0xdcf9('0x1f')]=function(){var _0x281dc2=[_0xdcf9('0x26'),_0xdcf9('0x27'),'openchannel',_0xdcf9('0x28'),_0xdcf9('0x29'),'whatsapp'];for(var _0x2d5aec=0x0;_0x2d5aec<_0x281dc2[_0xdcf9('0x2a')];_0x2d5aec+=0x1){var _0x3dfbf7=this['getChannelStatus'](_0x281dc2[_0x2d5aec]);if(this[_0x281dc2[_0x2d5aec]+'Status']!==_0x3dfbf7){this[_0x281dc2[_0x2d5aec]+_0xdcf9('0x2b')]=_[_0xdcf9('0x2c')](moment()['format']('x'));}this[_0x281dc2[_0x2d5aec]+_0xdcf9('0x2d')]=_0x3dfbf7;}var _0x45ce59={'id':this['id'],'name':this[_0xdcf9('0x6')],'online':this['online'],'voicePause':this[_0xdcf9('0x8')],'chatPause':this[_0xdcf9('0x9')],'mailPause':this[_0xdcf9('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0xdcf9('0xb')],'openchannelPause':this[_0xdcf9('0xd')],'chatStatus':this[_0xdcf9('0x2e')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xdcf9('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xdcf9('0x10')],'mailStatusTime':this[_0xdcf9('0x2f')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xdcf9('0x30')],'faxStatus':this[_0xdcf9('0x12')],'faxStatusTime':this[_0xdcf9('0x31')],'faxCapacity':this[_0xdcf9('0x13')],'faxCurrentCapacity':this[_0xdcf9('0x14')],'smsStatus':this[_0xdcf9('0x15')],'smsStatusTime':this[_0xdcf9('0x32')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xdcf9('0x33')],'whatsappStatusTime':this[_0xdcf9('0x18')],'whatsappCapacity':this[_0xdcf9('0x19')],'whatsappCurrentCapacity':this[_0xdcf9('0x1a')],'openchannelStatus':this[_0xdcf9('0x34')],'openchannelStatusTime':this[_0xdcf9('0x35')],'openchannelCapacity':this[_0xdcf9('0x1b')],'openchannelCurrentCapacity':this[_0xdcf9('0x1c')],'busy':this[_0xdcf9('0x1d')],'busyQueue':this['busyQueue']};var _0x3beb8b=md5(JSON[_0xdcf9('0x36')](_0x45ce59));if(this[_0xdcf9('0x1')]!==_0x3beb8b){this[_0xdcf9('0x1')]=_0x3beb8b;io[_0xdcf9('0x37')]('user:save',_0x45ce59);}};module['exports']=Agent; \ No newline at end of file +var _0x742d=['unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','openchannel','fax','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','voicePause','mailPause','mailCurrentCapacity','faxCurrentCapacity','smsCapacity','busyQueue','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','name','online','chatPause','faxPause','smsPause','openchannelPause','chatStatus'];(function(_0x5c774b,_0x1f733c){var _0x1c8361=function(_0x24b6d1){while(--_0x24b6d1){_0x5c774b['push'](_0x5c774b['shift']());}};_0x1c8361(++_0x1f733c);}(_0x742d,0x66));var _0xd742=function(_0x52ac81,_0x11cb91){_0x52ac81=_0x52ac81-0x0;var _0x40b637=_0x742d[_0x52ac81];return _0x40b637;};'use strict';var _=require(_0xd742('0x0'));var moment=require(_0xd742('0x1'));var md5=require(_0xd742('0x2'));var Redis=require(_0xd742('0x3'));var config=require(_0xd742('0x4'));config[_0xd742('0x5')]=_['defaults'](config[_0xd742('0x5')],{'host':_0xd742('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x650c2c){this['id']=_0x650c2c['id']||0x0;this[_0xd742('0x7')]=_0x650c2c[_0xd742('0x7')]||'';this[_0xd742('0x8')]=_0x650c2c[_0xd742('0x8')]||!![];this['voicePause']=_0x650c2c['voicePause']||![];this[_0xd742('0x9')]=_0x650c2c[_0xd742('0x9')]||![];this['mailPause']=_0x650c2c['mailPause']||![];this[_0xd742('0xa')]=_0x650c2c['faxPause']||![];this[_0xd742('0xb')]=_0x650c2c[_0xd742('0xb')]||![];this[_0xd742('0xc')]=_0x650c2c[_0xd742('0xc')]||![];this[_0xd742('0xd')]=_0xd742('0xe');this[_0xd742('0xf')]=0x0;this[_0xd742('0x10')]=_0x650c2c[_0xd742('0x10')]||0x0;this[_0xd742('0x11')]=0x0;this[_0xd742('0x12')]=_0xd742('0xe');this[_0xd742('0x13')]=0x0;this[_0xd742('0x14')]=_0x650c2c[_0xd742('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xd742('0x15')]=_0xd742('0xe');this[_0xd742('0x16')]=0x0;this[_0xd742('0x17')]=_0x650c2c[_0xd742('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0xd742('0xe');this['smsStatusTime']=0x0;this['smsCapacity']=_0x650c2c['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xd742('0x18')]=_0xd742('0xe');this[_0xd742('0x19')]=0x0;this[_0xd742('0x1a')]=_0x650c2c[_0xd742('0x1a')]||0x0;this[_0xd742('0x1b')]=0x0;this[_0xd742('0x1c')]=_0xd742('0xe');this[_0xd742('0x1d')]=0x0;this[_0xd742('0x1e')]=_0x650c2c[_0xd742('0x1e')]||0x0;this[_0xd742('0x1f')]=0x0;this[_0xd742('0x20')]=![];this['busyQueue']=undefined;this[_0xd742('0x2')]='';this[_0xd742('0x21')]();}Agent['prototype']['getChannelStatus']=function(_0x11c19f){if(this[_0x11c19f+_0xd742('0x22')]>0x0){if(this[_0x11c19f+_0xd742('0x23')]>0x0&&this[_0x11c19f+_0xd742('0x22')]>=this[_0x11c19f+'Capacity']){return _0xd742('0x24');}else{return _0xd742('0x25');}}else{return'idle';}};Agent[_0xd742('0x26')]['updateRealtime']=function(){var _0xe08d1=[_0xd742('0x27'),'chat',_0xd742('0x28'),_0xd742('0x29'),'sms',_0xd742('0x2a')];for(var _0x2581e9=0x0;_0x2581e9<_0xe08d1[_0xd742('0x2b')];_0x2581e9+=0x1){var _0x40194f=this[_0xd742('0x2c')](_0xe08d1[_0x2581e9]);if(this[_0xe08d1[_0x2581e9]+_0xd742('0x2d')]!==_0x40194f){this[_0xe08d1[_0x2581e9]+_0xd742('0x2e')]=_[_0xd742('0x2f')](moment()['format']('x'));}this[_0xe08d1[_0x2581e9]+_0xd742('0x2d')]=_0x40194f;}var _0x340370={'id':this['id'],'name':this[_0xd742('0x7')],'online':this['online'],'voicePause':this[_0xd742('0x30')],'chatPause':this[_0xd742('0x9')],'mailPause':this[_0xd742('0x31')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xd742('0xd')],'chatStatusTime':this[_0xd742('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xd742('0x11')],'mailStatus':this[_0xd742('0x12')],'mailStatusTime':this[_0xd742('0x13')],'mailCapacity':this[_0xd742('0x14')],'mailCurrentCapacity':this[_0xd742('0x32')],'faxStatus':this[_0xd742('0x15')],'faxStatusTime':this[_0xd742('0x16')],'faxCapacity':this[_0xd742('0x17')],'faxCurrentCapacity':this[_0xd742('0x33')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xd742('0x34')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xd742('0x18')],'whatsappStatusTime':this[_0xd742('0x19')],'whatsappCapacity':this[_0xd742('0x1a')],'whatsappCurrentCapacity':this[_0xd742('0x1b')],'openchannelStatus':this[_0xd742('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xd742('0x1f')],'busy':this[_0xd742('0x20')],'busyQueue':this[_0xd742('0x35')]};var _0x46a9ab=md5(JSON[_0xd742('0x36')](_0x340370));if(this[_0xd742('0x2')]!==_0x46a9ab){this[_0xd742('0x2')]=_0x46a9ab;io[_0xd742('0x37')](_0xd742('0x38'),_0x340370);}};module[_0xd742('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8842af3..8d72644 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfdf=['chat_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcfdf,0x107));var _0xfcfd=function(_0x4e2617,_0x4ac049){_0x4e2617=_0x4e2617-0x0;var _0x488a1a=_0xcfdf[_0x4e2617];return _0x488a1a;};'use strict';var _=require(_0xfcfd('0x0'));var md5=require(_0xfcfd('0x1'));var util=require(_0xfcfd('0x2'));var Redis=require(_0xfcfd('0x3'));var config=require('../../../config/environment');config[_0xfcfd('0x4')]=_[_0xfcfd('0x5')](config[_0xfcfd('0x4')],{'host':_0xfcfd('0x6'),'port':0x18eb});var io=require(_0xfcfd('0x7'))(new Redis(config['redis']));function ChatQueue(_0x3088d3){this['id']=_0x3088d3['id']||0x0;this[_0xfcfd('0x8')]=_0x3088d3['name']||'';this[_0xfcfd('0x9')]=_0x3088d3[_0xfcfd('0x9')]||0xa;this[_0xfcfd('0xa')]=_0x3088d3[_0xfcfd('0xa')]||'beepall';this[_0xfcfd('0xb')]=_0x3088d3[_0xfcfd('0xb')];this[_0xfcfd('0xc')]={};this[_0xfcfd('0xd')]=0x0;this[_0xfcfd('0x1')]='';this[_0xfcfd('0xe')]();this[_0xfcfd('0xf')]();}ChatQueue['prototype'][_0xfcfd('0xe')]=function(){var _0x418ad0=this['mapAgentsId']['_rr'];this[_0xfcfd('0xc')]=_[_0xfcfd('0x10')](this[_0xfcfd('0xb')],'id');this[_0xfcfd('0xc')][_0xfcfd('0x11')]=_0x418ad0;};ChatQueue[_0xfcfd('0x12')][_0xfcfd('0xf')]=function(){this[_0xfcfd('0x13')]=0x0;this[_0xfcfd('0x14')]=0x0;for(var _0xcd9a45=0x0;_0xcd9a45=0x0?this['available']:0x0;var _0x418a7f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfcfd('0x13')],'name':this[_0xfcfd('0x8')],'paused':this[_0xfcfd('0x14')],'waiting':this['waiting']};var _0x30b13a=md5(JSON[_0xfcfd('0x19')](_0x418a7f));if(this['md5']!==_0x30b13a){this[_0xfcfd('0x1')]=_0x30b13a;io['to'](util['format'](_0xfcfd('0x1a'),_0x418a7f[_0xfcfd('0x8')]))['emit'](_0xfcfd('0x1b'),_0x418a7f);}};module[_0xfcfd('0x1c')]=ChatQueue; \ No newline at end of file +var _0x6575=['map','loggedIn','online','chatPause','paused','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0xc3e74b,_0x1c3983){var _0x5e1745=function(_0x1b043e){while(--_0x1b043e){_0xc3e74b['push'](_0xc3e74b['shift']());}};_0x5e1745(++_0x1c3983);}(_0x6575,0x184));var _0x5657=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x6575[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var md5=require(_0x5657('0x0'));var util=require(_0x5657('0x1'));var Redis=require('ioredis');var config=require(_0x5657('0x2'));config[_0x5657('0x3')]=_[_0x5657('0x4')](config[_0x5657('0x3')],{'host':_0x5657('0x5'),'port':0x18eb});var io=require(_0x5657('0x6'))(new Redis(config[_0x5657('0x3')]));function ChatQueue(_0x30f4f9){this['id']=_0x30f4f9['id']||0x0;this[_0x5657('0x7')]=_0x30f4f9[_0x5657('0x7')]||'';this[_0x5657('0x8')]=_0x30f4f9[_0x5657('0x8')]||0xa;this[_0x5657('0x9')]=_0x30f4f9[_0x5657('0x9')]||_0x5657('0xa');this[_0x5657('0xb')]=_0x30f4f9[_0x5657('0xb')];this[_0x5657('0xc')]={};this[_0x5657('0xd')]=0x0;this[_0x5657('0x0')]='';this[_0x5657('0xe')]();this[_0x5657('0xf')]();}ChatQueue[_0x5657('0x10')][_0x5657('0xe')]=function(){var _0x1d6f14=this[_0x5657('0xc')][_0x5657('0x11')];this['mapAgentsId']=_[_0x5657('0x12')](this[_0x5657('0xb')],'id');this['mapAgentsId'][_0x5657('0x11')]=_0x1d6f14;};ChatQueue[_0x5657('0x10')][_0x5657('0xf')]=function(){this[_0x5657('0x13')]=0x0;this['paused']=0x0;for(var _0x2f206e=0x0;_0x2f206e=0x0?this[_0x5657('0x17')]:0x0;var _0x504afc={'id':this['id'],'available':this[_0x5657('0x17')],'loggedIn':this[_0x5657('0x13')],'name':this[_0x5657('0x7')],'paused':this['paused'],'waiting':this[_0x5657('0xd')]};var _0x573ccb=md5(JSON[_0x5657('0x18')](_0x504afc));if(this[_0x5657('0x0')]!==_0x573ccb){this[_0x5657('0x0')]=_0x573ccb;io['to'](util[_0x5657('0x19')](_0x5657('0x1a'),_0x504afc[_0x5657('0x7')]))['emit'](_0x5657('0x1b'),_0x504afc);}};module[_0x5657('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8ea5561..fc6d0d5 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1ed=['online','loggedIn','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','lodash','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xe1ed,0x166));var _0xde1e=function(_0x1bd6dc,_0x5c9952){_0x1bd6dc=_0x1bd6dc-0x0;var _0x20c47c=_0xe1ed[_0x1bd6dc];return _0x20c47c;};'use strict';var _=require(_0xde1e('0x0'));var md5=require('md5');var util=require(_0xde1e('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xde1e('0x2')],{'host':_0xde1e('0x3'),'port':0x18eb});var io=require(_0xde1e('0x4'))(new Redis(config[_0xde1e('0x2')]));function FaxQueue(_0x5f0d20){this['id']=_0x5f0d20['id']||0x0;this[_0xde1e('0x5')]=_0x5f0d20[_0xde1e('0x5')]||'';this[_0xde1e('0x6')]=_0x5f0d20[_0xde1e('0x6')]||0xa;this[_0xde1e('0x7')]=_0x5f0d20['strategy']||_0xde1e('0x8');this['Agents']=_0x5f0d20[_0xde1e('0x9')];this[_0xde1e('0xa')]={};this[_0xde1e('0xb')]=0x0;this['md5']='';this[_0xde1e('0xc')]();this[_0xde1e('0xd')]();}FaxQueue[_0xde1e('0xe')]['updateRouting']=function(){var _0x4d4ad5=this[_0xde1e('0xa')][_0xde1e('0xf')];this[_0xde1e('0xa')]=_[_0xde1e('0x10')](this[_0xde1e('0x9')],'id');this[_0xde1e('0xa')][_0xde1e('0xf')]=_0x4d4ad5;};FaxQueue['prototype'][_0xde1e('0xd')]=function(){this['loggedIn']=0x0;this[_0xde1e('0x11')]=0x0;for(var _0x1109a5=0x0;_0x1109a5=0x0?this['available']:0x0;var _0x3a3598={'id':this['id'],'available':this[_0xde1e('0x16')],'loggedIn':this[_0xde1e('0x14')],'name':this[_0xde1e('0x5')],'paused':this[_0xde1e('0x11')],'waiting':this['waiting']};var _0x3d2d2a=md5(JSON[_0xde1e('0x17')](_0x3a3598));if(this[_0xde1e('0x18')]!==_0x3d2d2a){this[_0xde1e('0x18')]=_0x3d2d2a;io['to'](util[_0xde1e('0x19')](_0xde1e('0x1a'),_0x3a3598[_0xde1e('0x5')]))[_0xde1e('0x1b')](_0xde1e('0x1c'),_0x3a3598);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xf987=['map','updateRealtime','loggedIn','paused','Agents','length','online','faxPause','available','stringify','fax_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','name','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','prototype','_rr'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xf987,0xba));var _0x7f98=function(_0x3d6a6d,_0x136c99){_0x3d6a6d=_0x3d6a6d-0x0;var _0x55c48b=_0xf987[_0x3d6a6d];return _0x55c48b;};'use strict';var _=require(_0x7f98('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x7f98('0x1'));var config=require(_0x7f98('0x2'));config[_0x7f98('0x3')]=_[_0x7f98('0x4')](config[_0x7f98('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7f98('0x3')]));function FaxQueue(_0x550090){this['id']=_0x550090['id']||0x0;this['name']=_0x550090[_0x7f98('0x5')]||'';this['timeout']=_0x550090['timeout']||0xa;this[_0x7f98('0x6')]=_0x550090[_0x7f98('0x6')]||_0x7f98('0x7');this['Agents']=_0x550090['Agents'];this[_0x7f98('0x8')]={};this[_0x7f98('0x9')]=0x0;this[_0x7f98('0xa')]='';this[_0x7f98('0xb')]();this['updateRealtime']();}FaxQueue[_0x7f98('0xc')][_0x7f98('0xb')]=function(){var _0x3f6556=this[_0x7f98('0x8')][_0x7f98('0xd')];this[_0x7f98('0x8')]=_[_0x7f98('0xe')](this['Agents'],'id');this[_0x7f98('0x8')][_0x7f98('0xd')]=_0x3f6556;};FaxQueue[_0x7f98('0xc')][_0x7f98('0xf')]=function(){this[_0x7f98('0x10')]=0x0;this[_0x7f98('0x11')]=0x0;for(var _0x1a2abf=0x0;_0x1a2abf=0x0?this[_0x7f98('0x16')]:0x0;var _0x53ab65={'id':this['id'],'available':this[_0x7f98('0x16')],'loggedIn':this[_0x7f98('0x10')],'name':this['name'],'paused':this[_0x7f98('0x11')],'waiting':this[_0x7f98('0x9')]};var _0x3970ec=md5(JSON[_0x7f98('0x17')](_0x53ab65));if(this[_0x7f98('0xa')]!==_0x3970ec){this['md5']=_0x3970ec;io['to'](util['format']('fax:queue:%s',_0x53ab65[_0x7f98('0x5')]))['emit'](_0x7f98('0x18'),_0x53ab65);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index ea10f62..a729d11 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6673=['name','Intervals'];(function(_0x1cf49c,_0x51f875){var _0x437b40=function(_0x3fa88d){while(--_0x3fa88d){_0x1cf49c['push'](_0x1cf49c['shift']());}};_0x437b40(++_0x51f875);}(_0x6673,0x104));var _0x3667=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x6673[_0x55e08b];return _0xd1a7ff;};'use strict';function Interval(_0xf5199){this['id']=_0xf5199['id']||0x0;this[_0x3667('0x0')]=_0xf5199[_0x3667('0x0')]||'';this['Intervals']=_0xf5199[_0x3667('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x951f=['Intervals','exports','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x951f,0xfb));var _0xf951=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x951f[_0x4b7895];return _0x264180;};'use strict';function Interval(_0x5da0e7){this['id']=_0x5da0e7['id']||0x0;this[_0xf951('0x0')]=_0x5da0e7[_0xf951('0x0')]||'';this['Intervals']=_0x5da0e7[_0xf951('0x1')]||{};}module[_0xf951('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 243c1a8..59e873d 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d57=['map','paused','length','online','loggedIn','mailPause','available','waiting','stringify','format','emit','mail_queue:save','exports','md5','util','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d57,0xaf));var _0x72d5=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x2d57[_0x82140];return _0x2b15a6;};'use strict';var _=require('lodash');var md5=require(_0x72d5('0x0'));var util=require(_0x72d5('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x72d5('0x2')](config[_0x72d5('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x72d5('0x4'))(new Redis(config['redis']));function MailQueue(_0x45cf57){this['id']=_0x45cf57['id']||0x0;this[_0x72d5('0x5')]=_0x45cf57['name']||'';this['timeout']=_0x45cf57[_0x72d5('0x6')]||0xa;this[_0x72d5('0x7')]=_0x45cf57[_0x72d5('0x7')]||'beepall';this[_0x72d5('0x8')]=_0x45cf57[_0x72d5('0x8')];this[_0x72d5('0x9')]={};this['waiting']=0x0;this[_0x72d5('0x0')]='';this[_0x72d5('0xa')]();this[_0x72d5('0xb')]();}MailQueue[_0x72d5('0xc')][_0x72d5('0xa')]=function(){var _0xdf923f=this[_0x72d5('0x9')][_0x72d5('0xd')];this['mapAgentsId']=_[_0x72d5('0xe')](this['Agents'],'id');this[_0x72d5('0x9')][_0x72d5('0xd')]=_0xdf923f;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x72d5('0xf')]=0x0;for(var _0xcbaaed=0x0;_0xcbaaed=0x0?this['available']:0x0;var _0xe1fecc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x72d5('0x12')],'name':this['name'],'paused':this[_0x72d5('0xf')],'waiting':this[_0x72d5('0x15')]};var _0x5dc34b=md5(JSON[_0x72d5('0x16')](_0xe1fecc));if(this[_0x72d5('0x0')]!==_0x5dc34b){this[_0x72d5('0x0')]=_0x5dc34b;io['to'](util[_0x72d5('0x17')]('mail:queue:%s',_0xe1fecc[_0x72d5('0x5')]))[_0x72d5('0x18')](_0x72d5('0x19'),_0xe1fecc);}};module[_0x72d5('0x1a')]=MailQueue; \ No newline at end of file +var _0xa931=['../../../config/environment','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','name','stringify','format','mail_queue:save','lodash','md5','util','ioredis'];(function(_0x4ce3c3,_0x5ad480){var _0x2486cf=function(_0x567451){while(--_0x567451){_0x4ce3c3['push'](_0x4ce3c3['shift']());}};_0x2486cf(++_0x5ad480);}(_0xa931,0x1f4));var _0x1a93=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa931[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x1a93('0x0'));var md5=require(_0x1a93('0x1'));var util=require(_0x1a93('0x2'));var Redis=require(_0x1a93('0x3'));var config=require(_0x1a93('0x4'));config[_0x1a93('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1a93('0x6'))(new Redis(config[_0x1a93('0x5')]));function MailQueue(_0x35d0ee){this['id']=_0x35d0ee['id']||0x0;this['name']=_0x35d0ee['name']||'';this[_0x1a93('0x7')]=_0x35d0ee[_0x1a93('0x7')]||0xa;this['strategy']=_0x35d0ee[_0x1a93('0x8')]||_0x1a93('0x9');this[_0x1a93('0xa')]=_0x35d0ee[_0x1a93('0xa')];this[_0x1a93('0xb')]={};this[_0x1a93('0xc')]=0x0;this[_0x1a93('0x1')]='';this[_0x1a93('0xd')]();this[_0x1a93('0xe')]();}MailQueue[_0x1a93('0xf')][_0x1a93('0xd')]=function(){var _0x4bb5ff=this[_0x1a93('0xb')][_0x1a93('0x10')];this[_0x1a93('0xb')]=_[_0x1a93('0x11')](this[_0x1a93('0xa')],'id');this[_0x1a93('0xb')][_0x1a93('0x10')]=_0x4bb5ff;};MailQueue['prototype'][_0x1a93('0xe')]=function(){this[_0x1a93('0x12')]=0x0;this[_0x1a93('0x13')]=0x0;for(var _0x28a025=0x0;_0x28a025=0x0?this[_0x1a93('0x17')]:0x0;var _0x3c6475={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1a93('0x18')],'paused':this['paused'],'waiting':this[_0x1a93('0xc')]};var _0x23b174=md5(JSON[_0x1a93('0x19')](_0x3c6475));if(this[_0x1a93('0x1')]!==_0x23b174){this[_0x1a93('0x1')]=_0x23b174;io['to'](util[_0x1a93('0x1a')]('mail:queue:%s',_0x3c6475[_0x1a93('0x18')]))['emit'](_0x1a93('0x1b'),_0x3c6475);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7b24064..24252cc 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x2ef3,0xba));var _0x32ef=function(_0x150a52,_0x2fbf6a){_0x150a52=_0x150a52-0x0;var _0x34c5e7=_0x2ef3[_0x150a52];return _0x34c5e7;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x326f,0xd1));var _0xf326=function(_0x5682fb,_0x4a8584){_0x5682fb=_0x5682fb-0x0;var _0x2b6dc2=_0x326f[_0x5682fb];return _0x2b6dc2;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index b6c7666..4cf6798 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5712=['updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','waiting','stringify','sms:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting'];(function(_0x2a0d0c,_0x2d7056){var _0x407f14=function(_0x1306c2){while(--_0x1306c2){_0x2a0d0c['push'](_0x2a0d0c['shift']());}};_0x407f14(++_0x2d7056);}(_0x5712,0x140));var _0x2571=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5712[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2571('0x0'));var md5=require(_0x2571('0x1'));var util=require(_0x2571('0x2'));var Redis=require(_0x2571('0x3'));var config=require(_0x2571('0x4'));config[_0x2571('0x5')]=_[_0x2571('0x6')](config[_0x2571('0x5')],{'host':_0x2571('0x7'),'port':0x18eb});var io=require(_0x2571('0x8'))(new Redis(config['redis']));function SmsQueue(_0x49d593){this['id']=_0x49d593['id']||0x0;this[_0x2571('0x9')]=_0x49d593['name']||'';this[_0x2571('0xa')]=_0x49d593[_0x2571('0xa')]||0xa;this[_0x2571('0xb')]=_0x49d593[_0x2571('0xb')]||_0x2571('0xc');this[_0x2571('0xd')]=_0x49d593['Agents'];this[_0x2571('0xe')]={};this['waiting']=0x0;this[_0x2571('0x1')]='';this[_0x2571('0xf')]();this[_0x2571('0x10')]();}SmsQueue[_0x2571('0x11')][_0x2571('0xf')]=function(){var _0x366f74=this[_0x2571('0xe')][_0x2571('0x12')];this['mapAgentsId']=_['map'](this[_0x2571('0xd')],'id');this[_0x2571('0xe')][_0x2571('0x12')]=_0x366f74;};SmsQueue[_0x2571('0x11')][_0x2571('0x10')]=function(){this[_0x2571('0x13')]=0x0;this[_0x2571('0x14')]=0x0;for(var _0x130ab1=0x0;_0x130ab1=0x0?this[_0x2571('0x17')]:0x0;var _0x576222={'id':this['id'],'available':this[_0x2571('0x17')],'loggedIn':this[_0x2571('0x13')],'name':this['name'],'paused':this[_0x2571('0x14')],'waiting':this[_0x2571('0x18')]};var _0x2647b7=md5(JSON[_0x2571('0x19')](_0x576222));if(this[_0x2571('0x1')]!==_0x2647b7){this['md5']=_0x2647b7;io['to'](util['format'](_0x2571('0x1a'),_0x576222[_0x2571('0x9')]))['emit']('sms_queue:save',_0x576222);}};module[_0x2571('0x1b')]=SmsQueue; \ No newline at end of file +var _0x8ce3=['prototype','_rr','map','loggedIn','length','smsPause','paused','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime'];(function(_0x5e834c,_0x2fa3de){var _0x9d75f8=function(_0x58d090){while(--_0x58d090){_0x5e834c['push'](_0x5e834c['shift']());}};_0x9d75f8(++_0x2fa3de);}(_0x8ce3,0xc3));var _0x38ce=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x8ce3[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x38ce('0x0'));var md5=require(_0x38ce('0x1'));var util=require('util');var Redis=require(_0x38ce('0x2'));var config=require(_0x38ce('0x3'));config[_0x38ce('0x4')]=_[_0x38ce('0x5')](config[_0x38ce('0x4')],{'host':_0x38ce('0x6'),'port':0x18eb});var io=require(_0x38ce('0x7'))(new Redis(config[_0x38ce('0x4')]));function SmsQueue(_0x4bf360){this['id']=_0x4bf360['id']||0x0;this[_0x38ce('0x8')]=_0x4bf360[_0x38ce('0x8')]||'';this['timeout']=_0x4bf360[_0x38ce('0x9')]||0xa;this[_0x38ce('0xa')]=_0x4bf360[_0x38ce('0xa')]||'beepall';this[_0x38ce('0xb')]=_0x4bf360['Agents'];this[_0x38ce('0xc')]={};this['waiting']=0x0;this[_0x38ce('0x1')]='';this[_0x38ce('0xd')]();this[_0x38ce('0xe')]();}SmsQueue[_0x38ce('0xf')][_0x38ce('0xd')]=function(){var _0x3603fa=this[_0x38ce('0xc')][_0x38ce('0x10')];this[_0x38ce('0xc')]=_[_0x38ce('0x11')](this[_0x38ce('0xb')],'id');this[_0x38ce('0xc')][_0x38ce('0x10')]=_0x3603fa;};SmsQueue[_0x38ce('0xf')][_0x38ce('0xe')]=function(){this[_0x38ce('0x12')]=0x0;this['paused']=0x0;for(var _0x48ba7c=0x0;_0x48ba7c=0x0?this[_0x38ce('0x16')]:0x0;var _0x2efd6f={'id':this['id'],'available':this[_0x38ce('0x16')],'loggedIn':this[_0x38ce('0x12')],'name':this[_0x38ce('0x8')],'paused':this[_0x38ce('0x15')],'waiting':this[_0x38ce('0x17')]};var _0x518b04=md5(JSON[_0x38ce('0x18')](_0x2efd6f));if(this[_0x38ce('0x1')]!==_0x518b04){this[_0x38ce('0x1')]=_0x518b04;io['to'](util[_0x38ce('0x19')](_0x38ce('0x1a'),_0x2efd6f[_0x38ce('0x8')]))[_0x38ce('0x1b')](_0x38ce('0x1c'),_0x2efd6f);}};module[_0x38ce('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4734c86..edd5763 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fb9=['online','whatsappPause','available','format','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x3fb9,0x18d));var _0x93fb=function(_0x3dfa64,_0x50c771){_0x3dfa64=_0x3dfa64-0x0;var _0x485974=_0x3fb9[_0x3dfa64];return _0x485974;};'use strict';var _=require(_0x93fb('0x0'));var md5=require(_0x93fb('0x1'));var util=require(_0x93fb('0x2'));var Redis=require(_0x93fb('0x3'));var config=require(_0x93fb('0x4'));config[_0x93fb('0x5')]=_[_0x93fb('0x6')](config[_0x93fb('0x5')],{'host':_0x93fb('0x7'),'port':0x18eb});var io=require(_0x93fb('0x8'))(new Redis(config[_0x93fb('0x5')]));function WhatsappQueue(_0x33151b){this['id']=_0x33151b['id']||0x0;this[_0x93fb('0x9')]=_0x33151b[_0x93fb('0x9')]||'';this['timeout']=_0x33151b[_0x93fb('0xa')]||0xa;this[_0x93fb('0xb')]=_0x33151b[_0x93fb('0xb')]||_0x93fb('0xc');this['Agents']=_0x33151b[_0x93fb('0xd')];this['mapAgentsId']={};this[_0x93fb('0xe')]=0x0;this['md5']='';this[_0x93fb('0xf')]();this[_0x93fb('0x10')]();}WhatsappQueue[_0x93fb('0x11')][_0x93fb('0xf')]=function(){var _0x5e6fbf=this[_0x93fb('0x12')]['_rr'];this[_0x93fb('0x12')]=_['map'](this[_0x93fb('0xd')],'id');this[_0x93fb('0x12')][_0x93fb('0x13')]=_0x5e6fbf;};WhatsappQueue[_0x93fb('0x11')][_0x93fb('0x10')]=function(){this[_0x93fb('0x14')]=0x0;this[_0x93fb('0x15')]=0x0;for(var _0x36a22b=0x0;_0x36a22b=0x0?this[_0x93fb('0x19')]:0x0;var _0x2a8561={'id':this['id'],'available':this[_0x93fb('0x19')],'loggedIn':this[_0x93fb('0x14')],'name':this['name'],'paused':this[_0x93fb('0x15')],'waiting':this['waiting']};var _0x5269f7=md5(JSON['stringify'](_0x2a8561));if(this[_0x93fb('0x1')]!==_0x5269f7){this[_0x93fb('0x1')]=_0x5269f7;io['to'](util[_0x93fb('0x1a')]('whatsapp:queue:%s',_0x2a8561['name']))['emit']('whatsapp_queue:save',_0x2a8561);}};module[_0x93fb('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x889b=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','format','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x140752,_0x3cc756){var _0x24de5b=function(_0x55f963){while(--_0x55f963){_0x140752['push'](_0x140752['shift']());}};_0x24de5b(++_0x3cc756);}(_0x889b,0xa5));var _0xb889=function(_0x42e8a6,_0xc5c6f3){_0x42e8a6=_0x42e8a6-0x0;var _0xd1b0c5=_0x889b[_0x42e8a6];return _0xd1b0c5;};'use strict';var _=require(_0xb889('0x0'));var md5=require(_0xb889('0x1'));var util=require(_0xb889('0x2'));var Redis=require(_0xb889('0x3'));var config=require(_0xb889('0x4'));config['redis']=_[_0xb889('0x5')](config[_0xb889('0x6')],{'host':_0xb889('0x7'),'port':0x18eb});var io=require(_0xb889('0x8'))(new Redis(config[_0xb889('0x6')]));function WhatsappQueue(_0x4bb055){this['id']=_0x4bb055['id']||0x0;this[_0xb889('0x9')]=_0x4bb055[_0xb889('0x9')]||'';this[_0xb889('0xa')]=_0x4bb055['timeout']||0xa;this[_0xb889('0xb')]=_0x4bb055[_0xb889('0xb')]||_0xb889('0xc');this[_0xb889('0xd')]=_0x4bb055[_0xb889('0xd')];this[_0xb889('0xe')]={};this[_0xb889('0xf')]=0x0;this[_0xb889('0x1')]='';this[_0xb889('0x10')]();this[_0xb889('0x11')]();}WhatsappQueue[_0xb889('0x12')]['updateRouting']=function(){var _0x51ff32=this[_0xb889('0xe')][_0xb889('0x13')];this[_0xb889('0xe')]=_[_0xb889('0x14')](this[_0xb889('0xd')],'id');this[_0xb889('0xe')][_0xb889('0x13')]=_0x51ff32;};WhatsappQueue['prototype'][_0xb889('0x11')]=function(){this[_0xb889('0x15')]=0x0;this[_0xb889('0x16')]=0x0;for(var _0x5a3f50=0x0;_0x5a3f50=0x0?this[_0xb889('0x19')]:0x0;var _0xe13624={'id':this['id'],'available':this[_0xb889('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xb889('0x9')],'paused':this[_0xb889('0x16')],'waiting':this[_0xb889('0xf')]};var _0x502477=md5(JSON['stringify'](_0xe13624));if(this['md5']!==_0x502477){this['md5']=_0x502477;io['to'](util[_0xb889('0x1a')]('whatsapp:queue:%s',_0xe13624[_0xb889('0x9')]))[_0xb889('0x1b')](_0xb889('0x1c'),_0xe13624);}};module[_0xb889('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 757afdc..9f4a449 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2c290a,_0x671fa4){var _0x32e6b2=function(_0x12bb20){while(--_0x12bb20){_0x2c290a['push'](_0x2c290a['shift']());}};_0x32e6b2(++_0x671fa4);}(_0xb10b,0x12a));var _0xbb10=function(_0x31ed74,_0x96d0de){_0x31ed74=_0x31ed74-0x0;var _0x260f84=_0xb10b[_0x31ed74];return _0x260f84;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 29e2938..6e5a95f 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaea=['Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x2a9f3b,_0xc8c37c){var _0x34e17f=function(_0x100bc3){while(--_0x100bc3){_0x2a9f3b['push'](_0x2a9f3b['shift']());}};_0x34e17f(++_0xc8c37c);}(_0xcaea,0x147));var _0xacae=function(_0x476e38,_0x540e94){_0x476e38=_0x476e38-0x0;var _0x39e75c=_0xcaea[_0x476e38];return _0x39e75c;};'use strict';var client=require(_0xacae('0x0'));exports[_0xacae('0x1')]=function(_0x1d6648,_0x5a0dfe){return client[_0xacae('0x2')](_0xacae('0x3'),{'body':_0x5a0dfe,'options':{'where':{'id':_0x1d6648}},'log':'updateChatInteraction'});};exports[_0xacae('0x4')]=function(_0x1c7d60,_0x57ac8d){return client[_0xacae('0x2')](_0xacae('0x5'),{'body':_0x57ac8d,'options':{'where':{'id':_0x1c7d60}},'log':_0xacae('0x6')});}; \ No newline at end of file +var _0x493f=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x493f,0xd4));var _0xf493=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x493f[_0xfae23b];return _0x200640;};'use strict';var client=require(_0xf493('0x0'));exports[_0xf493('0x1')]=function(_0x120ff9,_0x4aa8fc){return client['Request'](_0xf493('0x2'),{'body':_0x4aa8fc,'options':{'where':{'id':_0x120ff9}},'log':_0xf493('0x3')});};exports[_0xf493('0x4')]=function(_0x83c3a,_0x2e7853){return client[_0xf493('0x5')](_0xf493('0x6'),{'body':_0x2e7853,'options':{'where':{'id':_0x83c3a}},'log':_0xf493('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index cc29118..be738f9 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a72=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0x2b3a70,_0x360fc3){var _0x40c6fd=function(_0x2eeaab){while(--_0x2eeaab){_0x2b3a70['push'](_0x2b3a70['shift']());}};_0x40c6fd(++_0x360fc3);}(_0x0a72,0xaf));var _0x20a7=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x0a72[_0x1c546c];return _0x2cc384;};'use strict';var client=require(_0x20a7('0x0'));exports['create']=function(_0x8744af){return client[_0x20a7('0x1')](_0x20a7('0x2'),{'body':_0x8744af,'log':_0x20a7('0x3')});}; \ No newline at end of file +var _0x44ee=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x57a711,_0x419635){var _0x3e4c01=function(_0xedabd1){while(--_0xedabd1){_0x57a711['push'](_0x57a711['shift']());}};_0x3e4c01(++_0x419635);}(_0x44ee,0x1b8));var _0xe44e=function(_0x4943a7,_0x298ffc){_0x4943a7=_0x4943a7-0x0;var _0x107ab6=_0x44ee[_0x4943a7];return _0x107ab6;};'use strict';var client=require(_0xe44e('0x0'));exports[_0xe44e('0x1')]=function(_0x55e0ca){return client[_0xe44e('0x2')](_0xe44e('0x3'),{'body':_0x55e0ca,'log':_0xe44e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 418f16d..af56e22 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16d8=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x515306,_0x9b3d5a){var _0x1f1c5b=function(_0x46a6db){while(--_0x46a6db){_0x515306['push'](_0x515306['shift']());}};_0x1f1c5b(++_0x9b3d5a);}(_0x16d8,0xa3));var _0x816d=function(_0x2936e6,_0x56d212){_0x2936e6=_0x2936e6-0x0;var _0x57acf1=_0x16d8[_0x2936e6];return _0x57acf1;};'use strict';var client=require('../client');exports[_0x816d('0x0')]=function(){return function(){return client[_0x816d('0x1')](_0x816d('0x2'),{'options':{'raw':![],'attributes':['id',_0x816d('0x3'),_0x816d('0x4'),_0x816d('0x5')],'include':[{'model':_0x816d('0x6'),'as':_0x816d('0x7'),'attributes':['id',_0x816d('0x3'),'online',_0x816d('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x50b9=['Request','name','timeout','strategy','User','Agents','online','chatPause','getChatQueues','../client'];(function(_0x3f5612,_0x5dbc19){var _0x1240ed=function(_0x2bc2e0){while(--_0x2bc2e0){_0x3f5612['push'](_0x3f5612['shift']());}};_0x1240ed(++_0x5dbc19);}(_0x50b9,0x171));var _0x950b=function(_0x2ffbce,_0x3b242d){_0x2ffbce=_0x2ffbce-0x0;var _0xd8005b=_0x50b9[_0x2ffbce];return _0xd8005b;};'use strict';var client=require(_0x950b('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x950b('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x950b('0x2'),_0x950b('0x3'),_0x950b('0x4')],'include':[{'model':_0x950b('0x5'),'as':_0x950b('0x6'),'attributes':['id',_0x950b('0x2'),_0x950b('0x7'),_0x950b('0x8')]}]},'log':_0x950b('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 677d372..99fc15a 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdb5=['update','Request','DESC','../client','create','CreateChatQueueReport'];(function(_0x402c81,_0x2b2752){var _0x3d8150=function(_0xb23749){while(--_0xb23749){_0x402c81['push'](_0x402c81['shift']());}};_0x3d8150(++_0x2b2752);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xfdb5[_0x5834bc];return _0x3e183a;};'use strict';var client=require(_0x5fdb('0x0'));exports[_0x5fdb('0x1')]=function(_0x18abfe){return client['Request'](_0x5fdb('0x2'),{'body':_0x18abfe,'log':_0x5fdb('0x2')});};exports[_0x5fdb('0x3')]=function(_0x49fd4d,_0x55124b){return client[_0x5fdb('0x4')]('UpdateChatQueueReport',{'body':_0x55124b,'options':{'where':{'uniqueid':_0x49fd4d},'order':[['id',_0x5fdb('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x53d5=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x1a81bf,_0x5f3058){var _0x36da14=function(_0xb11fed){while(--_0xb11fed){_0x1a81bf['push'](_0x1a81bf['shift']());}};_0x36da14(++_0x5f3058);}(_0x53d5,0x1cc));var _0x553d=function(_0x4a9a0c,_0x120b8a){_0x4a9a0c=_0x4a9a0c-0x0;var _0x316d25=_0x53d5[_0x4a9a0c];return _0x316d25;};'use strict';var client=require(_0x553d('0x0'));exports[_0x553d('0x1')]=function(_0x217b81){return client[_0x553d('0x2')](_0x553d('0x3'),{'body':_0x217b81,'log':_0x553d('0x3')});};exports[_0x553d('0x4')]=function(_0x55d785,_0xd5d2f7){return client[_0x553d('0x2')](_0x553d('0x5'),{'body':_0xd5d2f7,'options':{'where':{'uniqueid':_0x55d785},'order':[['id',_0x553d('0x6')]],'limit':0x1},'log':_0x553d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index cacfa52..7007d93 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x7a54,0x106));var _0x47a5=function(_0x501c6b,_0x237af0){_0x501c6b=_0x501c6b-0x0;var _0x5c0782=_0x7a54[_0x501c6b];return _0x5c0782;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x352c13,_0x1a91cb){var _0x5b48e8=function(_0x1afcc2){while(--_0x1afcc2){_0x352c13['push'](_0x352c13['shift']());}};_0x5b48e8(++_0x1a91cb);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 415fc72..6159799 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16bf=['createFaxMessage','../client','create','Request'];(function(_0x10bc64,_0x4a7155){var _0x40ae2=function(_0x357333){while(--_0x357333){_0x10bc64['push'](_0x10bc64['shift']());}};_0x40ae2(++_0x4a7155);}(_0x16bf,0x149));var _0xf16b=function(_0x12454f,_0x26be49){_0x12454f=_0x12454f-0x0;var _0x1e98a1=_0x16bf[_0x12454f];return _0x1e98a1;};'use strict';var client=require(_0xf16b('0x0'));exports[_0xf16b('0x1')]=function(_0x489301){return client[_0xf16b('0x2')]('CreateFaxMessage',{'body':_0x489301,'log':_0xf16b('0x3')});}; \ No newline at end of file +var _0x8bb0=['create','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bb0,0xfb));var _0x08bb=function(_0x361add,_0x2b9019){_0x361add=_0x361add-0x0;var _0x1c0842=_0x8bb0[_0x361add];return _0x1c0842;};'use strict';var client=require(_0x08bb('0x0'));exports[_0x08bb('0x1')]=function(_0x10fc9a){return client['Request']('CreateFaxMessage',{'body':_0x10fc9a,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6d72669..94e8ee7 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1997=['getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','Agents','online','faxPause'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x1997,0x14d));var _0x7199=function(_0x5c1692,_0x4e975c){_0x5c1692=_0x5c1692-0x0;var _0x55f113=_0x1997[_0x5c1692];return _0x55f113;};'use strict';var client=require('../client');exports[_0x7199('0x0')]=function(){return function(){return client[_0x7199('0x1')](_0x7199('0x2'),{'options':{'raw':![],'attributes':['id',_0x7199('0x3'),_0x7199('0x4'),_0x7199('0x5')],'include':[{'model':'User','as':_0x7199('0x6'),'attributes':['id',_0x7199('0x3'),_0x7199('0x7'),_0x7199('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xa0f9=['timeout','User','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x81d368,_0x399c21){var _0x10737d=function(_0x11d29e){while(--_0x11d29e){_0x81d368['push'](_0x81d368['shift']());}};_0x10737d(++_0x399c21);}(_0xa0f9,0xef));var _0x9a0f=function(_0x37464d,_0x29bf11){_0x37464d=_0x37464d-0x0;var _0x4e7573=_0xa0f9[_0x37464d];return _0x4e7573;};'use strict';var client=require(_0x9a0f('0x0'));exports[_0x9a0f('0x1')]=function(){return function(){return client['Request'](_0x9a0f('0x2'),{'options':{'raw':![],'attributes':['id',_0x9a0f('0x3'),_0x9a0f('0x4'),'strategy'],'include':[{'model':_0x9a0f('0x5'),'as':_0x9a0f('0x6'),'attributes':['id',_0x9a0f('0x3'),_0x9a0f('0x7'),_0x9a0f('0x8')]}]},'log':_0x9a0f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f9bae63..bf78995 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8363=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x4c3bf3,_0x1d41ea){var _0x354489=function(_0xe3166f){while(--_0xe3166f){_0x4c3bf3['push'](_0x4c3bf3['shift']());}};_0x354489(++_0x1d41ea);}(_0x8363,0x1f0));var _0x3836=function(_0x474176,_0x118d9c){_0x474176=_0x474176-0x0;var _0x19df6a=_0x8363[_0x474176];return _0x19df6a;};'use strict';var client=require(_0x3836('0x0'));exports[_0x3836('0x1')]=function(_0x4d58e0){return client[_0x3836('0x2')](_0x3836('0x3'),{'body':_0x4d58e0,'log':_0x3836('0x3')});};exports[_0x3836('0x4')]=function(_0x8301d0,_0xebd9d2){return client[_0x3836('0x2')](_0x3836('0x5'),{'body':_0xebd9d2,'options':{'where':{'uniqueid':_0x8301d0},'order':[['id',_0x3836('0x6')]],'limit':0x1},'log':_0x3836('0x5')});}; \ No newline at end of file +var _0x06b3=['create','Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x5b989e,_0x4e28f9){var _0x36f054=function(_0x4a0bd0){while(--_0x4a0bd0){_0x5b989e['push'](_0x5b989e['shift']());}};_0x36f054(++_0x4e28f9);}(_0x06b3,0x108));var _0x306b=function(_0x151503,_0x706e43){_0x151503=_0x151503-0x0;var _0x1ccd89=_0x06b3[_0x151503];return _0x1ccd89;};'use strict';var client=require('../client');exports[_0x306b('0x0')]=function(_0x1d1333){return client[_0x306b('0x1')](_0x306b('0x2'),{'body':_0x1d1333,'log':_0x306b('0x2')});};exports[_0x306b('0x3')]=function(_0xdb230c,_0x315d49){return client['Request']('UpdateFaxQueueReport',{'body':_0x315d49,'options':{'where':{'uniqueid':_0xdb230c},'order':[['id',_0x306b('0x4')]],'limit':0x1},'log':_0x306b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f06336c..af3cc51 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c6=['../client','getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x54f73e,_0x4946c1){var _0x5ed7cd=function(_0x4a93bb){while(--_0x4a93bb){_0x54f73e['push'](_0x54f73e['shift']());}};_0x5ed7cd(++_0x4946c1);}(_0xe6c6,0x140));var _0x6e6c=function(_0x409b4e,_0x4e8f5b){_0x409b4e=_0x409b4e-0x0;var _0x119007=_0xe6c6[_0x409b4e];return _0x119007;};'use strict';var client=require(_0x6e6c('0x0'));exports[_0x6e6c('0x1')]=function(){return function(){return client[_0x6e6c('0x2')](_0x6e6c('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x6e6c('0x4')],'include':[{'model':_0x6e6c('0x5'),'as':_0x6e6c('0x6'),'attributes':['id',_0x6e6c('0x4'),_0x6e6c('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xe7cd=['name','Interval','Intervals','../client','getIntervals','Request'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xe7cd,0xb1));var _0xde7c=function(_0x374038,_0x4ebb53){_0x374038=_0x374038-0x0;var _0x5eb952=_0xe7cd[_0x374038];return _0x5eb952;};'use strict';var client=require(_0xde7c('0x0'));exports[_0xde7c('0x1')]=function(){return function(){return client[_0xde7c('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xde7c('0x3')],'include':[{'model':_0xde7c('0x4'),'as':_0xde7c('0x5'),'attributes':['id',_0xde7c('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index daeafb5..92597a8 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x2a07,0x74));var _0x72a0=function(_0x5c3143,_0x12d54c){_0x5c3143=_0x5c3143-0x0;var _0x42708d=_0x2a07[_0x5c3143];return _0x42708d;};'use strict';var client=require(_0x72a0('0x0'));exports[_0x72a0('0x1')]=function(_0x3ed8a9,_0x437db4){return client[_0x72a0('0x2')]('UpdateMailInteraction',{'body':_0x437db4,'options':{'where':{'id':_0x3ed8a9}},'log':_0x72a0('0x3')});};exports[_0x72a0('0x4')]=function(_0x135982,_0x45b155){return client[_0x72a0('0x2')](_0x72a0('0x5'),{'body':_0x45b155,'options':{'where':{'id':_0x135982}},'log':_0x72a0('0x6')});}; \ No newline at end of file +var _0xfef3=['../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0xb37e10,_0x34a811){var _0x11e6f6=function(_0x2a88f0){while(--_0x2a88f0){_0xb37e10['push'](_0xb37e10['shift']());}};_0x11e6f6(++_0x34a811);}(_0xfef3,0x118));var _0x3fef=function(_0xc4577d,_0x44fb35){_0xc4577d=_0xc4577d-0x0;var _0xfb792e=_0xfef3[_0xc4577d];return _0xfb792e;};'use strict';var client=require(_0x3fef('0x0'));exports['update']=function(_0x3f2183,_0x494ae6){return client[_0x3fef('0x1')](_0x3fef('0x2'),{'body':_0x494ae6,'options':{'where':{'id':_0x3f2183}},'log':'updateMailInteraction'});};exports[_0x3fef('0x3')]=function(_0x3b71e5,_0x538f28){return client[_0x3fef('0x1')](_0x3fef('0x4'),{'body':_0x538f28,'options':{'where':{'id':_0x3b71e5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a071a2e..d3eaca5 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3ce=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x1e598c,_0x4c90a4){var _0x3c21e0=function(_0x3cc162){while(--_0x3cc162){_0x1e598c['push'](_0x1e598c['shift']());}};_0x3c21e0(++_0x4c90a4);}(_0xa3ce,0x80));var _0xea3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3ce[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xea3c('0x0')]=function(_0x4594f7){return client[_0xea3c('0x1')](_0xea3c('0x2'),{'body':_0x4594f7,'log':_0xea3c('0x3')});}; \ No newline at end of file +var _0x3faa=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x31e3e4,_0x5c795a){var _0x4ee39e=function(_0x21ee01){while(--_0x21ee01){_0x31e3e4['push'](_0x31e3e4['shift']());}};_0x4ee39e(++_0x5c795a);}(_0x3faa,0x81));var _0xa3fa=function(_0x7074b4,_0x4dc25f){_0x7074b4=_0x7074b4-0x0;var _0x5d3183=_0x3faa[_0x7074b4];return _0x5d3183;};'use strict';var client=require('../client');exports[_0xa3fa('0x0')]=function(_0x50e89e){return client[_0xa3fa('0x1')](_0xa3fa('0x2'),{'body':_0x50e89e,'log':_0xa3fa('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 8c4f42f..cc2d58f 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfa=['timeout','strategy','Agents','name','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x3f5f6b,_0x537a36){var _0x326a3c=function(_0x5d59b0){while(--_0x5d59b0){_0x3f5f6b['push'](_0x3f5f6b['shift']());}};_0x326a3c(++_0x537a36);}(_0x7dfa,0x147));var _0xa7df=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x7dfa[_0x1602ef];return _0x5870ee;};'use strict';var client=require(_0xa7df('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xa7df('0x1')](_0xa7df('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa7df('0x3'),_0xa7df('0x4')],'include':[{'model':'User','as':_0xa7df('0x5'),'attributes':['id',_0xa7df('0x6'),_0xa7df('0x7'),_0xa7df('0x8')]}]},'log':_0xa7df('0x9')});};}; \ No newline at end of file +var _0xafb3=['mailPause','../client','getMailQueues','GetMailQueue','name','timeout','User','Agents','online'];(function(_0x37e5b4,_0x4ddfd8){var _0x5e52e0=function(_0x5d8ec8){while(--_0x5d8ec8){_0x37e5b4['push'](_0x37e5b4['shift']());}};_0x5e52e0(++_0x4ddfd8);}(_0xafb3,0x121));var _0x3afb=function(_0x36a588,_0x1c4ccf){_0x36a588=_0x36a588-0x0;var _0x5de999=_0xafb3[_0x36a588];return _0x5de999;};'use strict';var client=require(_0x3afb('0x0'));exports[_0x3afb('0x1')]=function(){return function(){return client['Request'](_0x3afb('0x2'),{'options':{'raw':![],'attributes':['id',_0x3afb('0x3'),_0x3afb('0x4'),'strategy'],'include':[{'model':_0x3afb('0x5'),'as':_0x3afb('0x6'),'attributes':['id',_0x3afb('0x3'),_0x3afb('0x7'),_0x3afb('0x8')]}]},'log':_0x3afb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 90006be..6880770 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x779f=['Request','update','UpdateMailQueueReport','DESC'];(function(_0x33a48c,_0x1d6a6f){var _0x31354c=function(_0x673ebd){while(--_0x673ebd){_0x33a48c['push'](_0x33a48c['shift']());}};_0x31354c(++_0x1d6a6f);}(_0x779f,0x10c));var _0xf779=function(_0x395e4f,_0x462c15){_0x395e4f=_0x395e4f-0x0;var _0x20825c=_0x779f[_0x395e4f];return _0x20825c;};'use strict';var client=require('../client');exports['create']=function(_0x47dae7){return client[_0xf779('0x0')]('CreateMailQueueReport',{'body':_0x47dae7,'log':'CreateMailQueueReport'});};exports[_0xf779('0x1')]=function(_0x5a987a,_0x4100e4){return client[_0xf779('0x0')](_0xf779('0x2'),{'body':_0x4100e4,'options':{'where':{'uniqueid':_0x5a987a},'order':[['id',_0xf779('0x3')]],'limit':0x1},'log':_0xf779('0x2')});}; \ No newline at end of file +var _0x6f49=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x3561a3,_0x6c7446){var _0x3ff434=function(_0x31e753){while(--_0x31e753){_0x3561a3['push'](_0x3561a3['shift']());}};_0x3ff434(++_0x6c7446);}(_0x6f49,0x176));var _0x96f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f49[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x96f4('0x0'));exports[_0x96f4('0x1')]=function(_0x3824d0){return client[_0x96f4('0x2')](_0x96f4('0x3'),{'body':_0x3824d0,'log':'CreateMailQueueReport'});};exports['update']=function(_0x56407c,_0xbd6080){return client[_0x96f4('0x2')](_0x96f4('0x4'),{'body':_0xbd6080,'options':{'where':{'uniqueid':_0x56407c},'order':[['id',_0x96f4('0x5')]],'limit':0x1},'log':_0x96f4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2587847..03a129c 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f7a=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x4dbc6d,_0x27d3d5){var _0x50400d=function(_0x5364a8){while(--_0x5364a8){_0x4dbc6d['push'](_0x4dbc6d['shift']());}};_0x50400d(++_0x27d3d5);}(_0x6f7a,0x146));var _0xa6f7=function(_0x1e06b6,_0x197ac3){_0x1e06b6=_0x1e06b6-0x0;var _0x49c40a=_0x6f7a[_0x1e06b6];return _0x49c40a;};'use strict';var client=require(_0xa6f7('0x0'));exports[_0xa6f7('0x1')]=function(_0x1d0ac3,_0x41166e){return client['Request'](_0xa6f7('0x2'),{'body':_0x41166e,'options':{'where':{'id':_0x1d0ac3}},'log':_0xa6f7('0x3')});};exports[_0xa6f7('0x4')]=function(_0x486220,_0x16e313){return client[_0xa6f7('0x5')](_0xa6f7('0x6'),{'body':_0x16e313,'options':{'where':{'id':_0x486220}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xae8a=['UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x3ebc97,_0x299e53){var _0x72e417=function(_0x59d2f6){while(--_0x59d2f6){_0x3ebc97['push'](_0x3ebc97['shift']());}};_0x72e417(++_0x299e53);}(_0xae8a,0xb3));var _0xaae8=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xae8a[_0xc6be3a];return _0x56a310;};'use strict';var client=require(_0xaae8('0x0'));exports[_0xaae8('0x1')]=function(_0xe8a852,_0x3ed309){return client[_0xaae8('0x2')](_0xaae8('0x3'),{'body':_0x3ed309,'options':{'where':{'id':_0xe8a852}},'log':'updateOpenchannelInteraction'});};exports[_0xaae8('0x4')]=function(_0xde66e6,_0x5d6b85){return client[_0xaae8('0x2')](_0xaae8('0x5'),{'body':_0x5d6b85,'options':{'where':{'id':_0xde66e6}},'log':_0xaae8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b59a46a..58584f1 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30d7=['../client','createOpenchannelMessage'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x30d7,0x1ce));var _0x730d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30d7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x730d('0x0'));exports['create']=function(_0x5bf92b){return client['Request']('CreateOpenchannelMessage',{'body':_0x5bf92b,'log':_0x730d('0x1')});}; \ No newline at end of file +var _0x3523=['create','Request','createOpenchannelMessage','../client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3523,0x1eb));var _0x3352=function(_0x66dc1e,_0x20df9e){_0x66dc1e=_0x66dc1e-0x0;var _0x30a10f=_0x3523[_0x66dc1e];return _0x30a10f;};'use strict';var client=require(_0x3352('0x0'));exports[_0x3352('0x1')]=function(_0x2aa3e7){return client[_0x3352('0x2')]('CreateOpenchannelMessage',{'body':_0x2aa3e7,'log':_0x3352('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index bb5a4c3..1caa929 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x889b=['strategy','Agents','online','../client','Request','GetOpenchannelQueue','name','timeout'];(function(_0x4ee5d3,_0x432589){var _0x3a0562=function(_0x442e4a){while(--_0x442e4a){_0x4ee5d3['push'](_0x4ee5d3['shift']());}};_0x3a0562(++_0x432589);}(_0x889b,0xe3));var _0xb889=function(_0x56bb63,_0x3e165b){_0x56bb63=_0x56bb63-0x0;var _0x56a7ec=_0x889b[_0x56bb63];return _0x56a7ec;};'use strict';var client=require(_0xb889('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xb889('0x1')](_0xb889('0x2'),{'options':{'raw':![],'attributes':['id',_0xb889('0x3'),_0xb889('0x4'),_0xb889('0x5')],'include':[{'model':'User','as':_0xb889('0x6'),'attributes':['id','name',_0xb889('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x3b33=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','Agents','online','openchannelPause','../client'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x3b33,0xa9));var _0x33b3=function(_0x13e341,_0x7c3e61){_0x13e341=_0x13e341-0x0;var _0xbdd42f=_0x3b33[_0x13e341];return _0xbdd42f;};'use strict';var client=require(_0x33b3('0x0'));exports[_0x33b3('0x1')]=function(){return function(){return client[_0x33b3('0x2')](_0x33b3('0x3'),{'options':{'raw':![],'attributes':['id',_0x33b3('0x4'),'timeout',_0x33b3('0x5')],'include':[{'model':_0x33b3('0x6'),'as':_0x33b3('0x7'),'attributes':['id',_0x33b3('0x4'),_0x33b3('0x8'),_0x33b3('0x9')]}]},'log':_0x33b3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 22f8a73..199b4f7 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b96=['update','UpdateOpenchannelQueueReport','Request','CreateOpenchannelQueueReport'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x0b96,0xc2));var _0x60b9=function(_0x5c3429,_0x305dbc){_0x5c3429=_0x5c3429-0x0;var _0x3e8263=_0x0b96[_0x5c3429];return _0x3e8263;};'use strict';var client=require('../client');exports['create']=function(_0x110939){return client[_0x60b9('0x0')]('CreateOpenchannelQueueReport',{'body':_0x110939,'log':_0x60b9('0x1')});};exports[_0x60b9('0x2')]=function(_0x3a6ff9,_0x252d48){return client['Request'](_0x60b9('0x3'),{'body':_0x252d48,'options':{'where':{'uniqueid':_0x3a6ff9},'order':[['id','DESC']],'limit':0x1},'log':_0x60b9('0x3')});}; \ No newline at end of file +var _0x2a85=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a85,0x1be));var _0x52a8=function(_0x24681b,_0x31424e){_0x24681b=_0x24681b-0x0;var _0x10d992=_0x2a85[_0x24681b];return _0x10d992;};'use strict';var client=require(_0x52a8('0x0'));exports[_0x52a8('0x1')]=function(_0x2c6b01){return client[_0x52a8('0x2')]('CreateOpenchannelQueueReport',{'body':_0x2c6b01,'log':_0x52a8('0x3')});};exports[_0x52a8('0x4')]=function(_0x168d63,_0x3b2330){return client[_0x52a8('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x3b2330,'options':{'where':{'uniqueid':_0x168d63},'order':[['id',_0x52a8('0x5')]],'limit':0x1},'log':_0x52a8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index dc87d7d..e676b3a 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0b9=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x224ef7,_0x2d4a1c){var _0x1e52c5=function(_0x3df78c){while(--_0x3df78c){_0x224ef7['push'](_0x224ef7['shift']());}};_0x1e52c5(++_0x2d4a1c);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x21ac8a,_0x279f10){_0x21ac8a=_0x21ac8a-0x0;var _0x220ddd=_0xb0b9[_0x21ac8a];return _0x220ddd;};'use strict';var client=require(_0x9b0b('0x0'));exports['update']=function(_0x55227a,_0x1f310b){return client[_0x9b0b('0x1')](_0x9b0b('0x2'),{'body':_0x1f310b,'options':{'where':{'id':_0x55227a}},'log':_0x9b0b('0x3')});};exports[_0x9b0b('0x4')]=function(_0xeb15c0,_0x311e29){return client[_0x9b0b('0x1')](_0x9b0b('0x5'),{'body':_0x311e29,'options':{'where':{'id':_0xeb15c0}},'log':_0x9b0b('0x6')});}; \ No newline at end of file +var _0x2830=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x21c5ec,_0x360368){var _0x22238d=function(_0x2607f3){while(--_0x2607f3){_0x21c5ec['push'](_0x21c5ec['shift']());}};_0x22238d(++_0x360368);}(_0x2830,0x117));var _0x0283=function(_0x4b5787,_0x2c5aa2){_0x4b5787=_0x4b5787-0x0;var _0x827b80=_0x2830[_0x4b5787];return _0x827b80;};'use strict';var client=require(_0x0283('0x0'));exports[_0x0283('0x1')]=function(_0x4ee0cd,_0x3f6626){return client[_0x0283('0x2')](_0x0283('0x3'),{'body':_0x3f6626,'options':{'where':{'id':_0x4ee0cd}},'log':_0x0283('0x4')});};exports['addTags']=function(_0x414c89,_0x4aa050){return client[_0x0283('0x2')](_0x0283('0x5'),{'body':_0x4aa050,'options':{'where':{'id':_0x414c89}},'log':_0x0283('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 7e18062..958880d 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92bf=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x21b4eb,_0x3a7dd5){var _0x5dc305=function(_0x3b68c1){while(--_0x3b68c1){_0x21b4eb['push'](_0x21b4eb['shift']());}};_0x5dc305(++_0x3a7dd5);}(_0x92bf,0xca));var _0xf92b=function(_0x1a14ad,_0xea54a6){_0x1a14ad=_0x1a14ad-0x0;var _0x2640b5=_0x92bf[_0x1a14ad];return _0x2640b5;};'use strict';var client=require('../client');exports[_0xf92b('0x0')]=function(_0xddeb9b){return client[_0xf92b('0x1')](_0xf92b('0x2'),{'body':_0xddeb9b,'log':_0xf92b('0x3')});}; \ No newline at end of file +var _0xf8d4=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0xc62109,_0x1febc2){var _0x529a39=function(_0x5bc3ed){while(--_0x5bc3ed){_0xc62109['push'](_0xc62109['shift']());}};_0x529a39(++_0x1febc2);}(_0xf8d4,0xc8));var _0x4f8d=function(_0x371c68,_0x334b33){_0x371c68=_0x371c68-0x0;var _0x54ad91=_0xf8d4[_0x371c68];return _0x54ad91;};'use strict';var client=require(_0x4f8d('0x0'));exports[_0x4f8d('0x1')]=function(_0xcd4a23){return client[_0x4f8d('0x2')](_0x4f8d('0x3'),{'body':_0xcd4a23,'log':_0x4f8d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 1be5717..0ba06a3 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x1fe7a8,_0x186544){var _0x29e777=function(_0x33a97a){while(--_0x33a97a){_0x1fe7a8['push'](_0x1fe7a8['shift']());}};_0x29e777(++_0x186544);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x20181d,_0x4967f4){var _0x1fc5a2=function(_0x3e69dc){while(--_0x3e69dc){_0x20181d['push'](_0x20181d['shift']());}};_0x1fc5a2(++_0x4967f4);}(_0x70e0,0x17b));var _0x070e=function(_0x3fec50,_0x9143cd){_0x3fec50=_0x3fec50-0x0;var _0x24a418=_0x70e0[_0x3fec50];return _0x24a418;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c427000..aa85938 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x3bc231,_0x12dfd6){var _0x3c301c=function(_0x3a661b){while(--_0x3a661b){_0x3bc231['push'](_0x3bc231['shift']());}};_0x3c301c(++_0x12dfd6);}(_0x70e0,0x17b));var _0x070e=function(_0x58695d,_0x37ea7f){_0x58695d=_0x58695d-0x0;var _0x611ef=_0x70e0[_0x58695d];return _0x611ef;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x378752,_0x158b32){var _0xd5a262=function(_0x3c6f94){while(--_0x3c6f94){_0x378752['push'](_0x378752['shift']());}};_0xd5a262(++_0x158b32);}(_0x008c,0x188));var _0xc008=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x008c[_0x19a49f];return _0x5351ae;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6d43956..8265329 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x1649ed,_0x49d93e){var _0xdb17fe=function(_0x1cb3c6){while(--_0x1cb3c6){_0x1649ed['push'](_0x1649ed['shift']());}};_0xdb17fe(++_0x49d93e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x51803b,_0x5769ad){var _0x590576=function(_0x553ab0){while(--_0x553ab0){_0x51803b['push'](_0x51803b['shift']());}};_0x590576(++_0x5769ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 10c706e..1343892 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd991=['AddTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction','addTags'];(function(_0x4c0d3d,_0x57eaa8){var _0x7341c0=function(_0x491719){while(--_0x491719){_0x4c0d3d['push'](_0x4c0d3d['shift']());}};_0x7341c0(++_0x57eaa8);}(_0xd991,0x115));var _0x1d99=function(_0x391752,_0x2b436a){_0x391752=_0x391752-0x0;var _0x2b24d3=_0xd991[_0x391752];return _0x2b24d3;};'use strict';var client=require(_0x1d99('0x0'));exports[_0x1d99('0x1')]=function(_0x1ef5c1,_0x2095b5){return client[_0x1d99('0x2')]('UpdateWhatsappInteraction',{'body':_0x2095b5,'options':{'where':{'id':_0x1ef5c1}},'log':_0x1d99('0x3')});};exports[_0x1d99('0x4')]=function(_0xf03459,_0x1f6da3){return client[_0x1d99('0x2')](_0x1d99('0x5'),{'body':_0x1f6da3,'options':{'where':{'id':_0xf03459}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x2b29=['update','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x11b4b4,_0x263d3b){var _0x249e1a=function(_0x35ce76){while(--_0x35ce76){_0x11b4b4['push'](_0x11b4b4['shift']());}};_0x249e1a(++_0x263d3b);}(_0x2b29,0x163));var _0x92b2=function(_0x40d7da,_0x49eb15){_0x40d7da=_0x40d7da-0x0;var _0x43796f=_0x2b29[_0x40d7da];return _0x43796f;};'use strict';var client=require('../client');exports[_0x92b2('0x0')]=function(_0x2b2889,_0x28585a){return client[_0x92b2('0x1')]('UpdateWhatsappInteraction',{'body':_0x28585a,'options':{'where':{'id':_0x2b2889}},'log':_0x92b2('0x2')});};exports[_0x92b2('0x3')]=function(_0xbc7de4,_0x3963eb){return client[_0x92b2('0x1')](_0x92b2('0x4'),{'body':_0x3963eb,'options':{'where':{'id':_0xbc7de4}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 65e51d2..61699a6 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab90=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1e37a7,_0x417ce5){var _0x4956ca=function(_0x532ad1){while(--_0x532ad1){_0x1e37a7['push'](_0x1e37a7['shift']());}};_0x4956ca(++_0x417ce5);}(_0xab90,0x158));var _0x0ab9=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xab90[_0x819464];return _0x49dcc0;};'use strict';var client=require(_0x0ab9('0x0'));exports['create']=function(_0x27ea17){return client[_0x0ab9('0x1')](_0x0ab9('0x2'),{'body':_0x27ea17,'log':_0x0ab9('0x3')});}; \ No newline at end of file +var _0xd573=['createWhatsappMessage','../client'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0xd573,0x17b));var _0x3d57=function(_0x56aadb,_0x8afc24){_0x56aadb=_0x56aadb-0x0;var _0x4a752d=_0xd573[_0x56aadb];return _0x4a752d;};'use strict';var client=require(_0x3d57('0x0'));exports['create']=function(_0x1b2a4b){return client['Request']('CreateWhatsappMessage',{'body':_0x1b2a4b,'log':_0x3d57('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 71a047a..b58c659 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9959=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','online'];(function(_0x4f3dfb,_0x914ab8){var _0x3b26e5=function(_0x131969){while(--_0x131969){_0x4f3dfb['push'](_0x4f3dfb['shift']());}};_0x3b26e5(++_0x914ab8);}(_0x9959,0x136));var _0x9995=function(_0xe01a38,_0x2bac36){_0xe01a38=_0xe01a38-0x0;var _0x20bf91=_0x9959[_0xe01a38];return _0x20bf91;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x9995('0x0')](_0x9995('0x1'),{'options':{'raw':![],'attributes':['id',_0x9995('0x2'),'timeout',_0x9995('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x9995('0x2'),_0x9995('0x4'),_0x9995('0x5')]}]},'log':_0x9995('0x6')});};}; \ No newline at end of file +var _0x5cf4=['getWhatsappQueues','Request','strategy','Agents','name','online','whatsappPause','../client'];(function(_0x4b4375,_0x195849){var _0x9a86e8=function(_0x1b8eea){while(--_0x1b8eea){_0x4b4375['push'](_0x4b4375['shift']());}};_0x9a86e8(++_0x195849);}(_0x5cf4,0xc7));var _0x45cf=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x5cf4[_0xd09668];return _0x68726;};'use strict';var client=require(_0x45cf('0x0'));exports[_0x45cf('0x1')]=function(){return function(){return client[_0x45cf('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x45cf('0x3')],'include':[{'model':'User','as':_0x45cf('0x4'),'attributes':['id',_0x45cf('0x5'),_0x45cf('0x6'),_0x45cf('0x7')]}]},'log':_0x45cf('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index acc3151..ccdc074 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15e3=['update','UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport'];(function(_0x261df1,_0x36c808){var _0x47482f=function(_0x142e02){while(--_0x142e02){_0x261df1['push'](_0x261df1['shift']());}};_0x47482f(++_0x36c808);}(_0x15e3,0x14c));var _0x315e=function(_0x38ea9e,_0x2951fd){_0x38ea9e=_0x38ea9e-0x0;var _0x116587=_0x15e3[_0x38ea9e];return _0x116587;};'use strict';var client=require(_0x315e('0x0'));exports['create']=function(_0x3e4d08){return client[_0x315e('0x1')]('CreateWhatsappQueueReport',{'body':_0x3e4d08,'log':_0x315e('0x2')});};exports[_0x315e('0x3')]=function(_0x10bb00,_0x5c788c){return client[_0x315e('0x1')]('UpdateWhatsappQueueReport',{'body':_0x5c788c,'options':{'where':{'uniqueid':_0x10bb00},'order':[['id','DESC']],'limit':0x1},'log':_0x315e('0x4')});}; \ No newline at end of file +var _0x5fec=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fec,0x1d4));var _0xc5fe=function(_0x237044,_0x1b9fbf){_0x237044=_0x237044-0x0;var _0x10c818=_0x5fec[_0x237044];return _0x10c818;};'use strict';var client=require(_0xc5fe('0x0'));exports[_0xc5fe('0x1')]=function(_0x338bd3){return client[_0xc5fe('0x2')](_0xc5fe('0x3'),{'body':_0x338bd3,'log':_0xc5fe('0x3')});};exports[_0xc5fe('0x4')]=function(_0x5af32b,_0x1486d3){return client[_0xc5fe('0x2')](_0xc5fe('0x5'),{'body':_0x1486d3,'options':{'where':{'uniqueid':_0x5af32b},'order':[['id',_0xc5fe('0x6')]],'limit':0x1},'log':_0xc5fe('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 4aacc59..c35f4ba 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4601=['format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','stop','timeout','createQueue','atimeout'];(function(_0x261cf2,_0x2cdd20){var _0x25bfdd=function(_0x4b5a1f){while(--_0x4b5a1f){_0x261cf2['push'](_0x261cf2['shift']());}};_0x25bfdd(++_0x2cdd20);}(_0x4601,0x1c6));var _0x1460=function(_0x3a566f,_0x5c1c00){_0x3a566f=_0x3a566f-0x0;var _0x3f8a86=_0x4601[_0x3a566f];return _0x3f8a86;};'use strict';var schema=require(_0x1460('0x0'));var _=require(_0x1460('0x1'));var util=require(_0x1460('0x2'));var seqqueue=require(_0x1460('0x3'));var logger=require('../../../../config/logger')(_0x1460('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x1460('0x5'),'required':!![],'message':_0x1460('0x6')},'timeout':{'type':_0x1460('0x7'),'message':_0x1460('0x8')}});function writeLog(_0x169fd6,_0x1def21,_0x2e5a2c){return logger[_0x1460('0x9')](util['format'](_0x1460('0xa'),_0x169fd6,_0x1def21[_0x1460('0xb')],_0x2e5a2c));}function handleFindAgent(_0x243347){return function(_0x33a653){return _0x33a653['name'][_0x1460('0xc')]()===_0x243347[_0x1460('0xc')]();};}exports[_0x1460('0xd')]=function(_0xc6c89a,_0x462d57,_0x56d207,_0x5a273a){return function(_0x46f553){try{var _0x394883={'name':_0x462d57[0x0],'timeout':_0x462d57[0x1]};var _0x340c9f=queue[_0x1460('0x0')](_0x394883,{'typecast':!![]});if(_0x340c9f[_0x1460('0xe')]){logger[_0x1460('0xf')](_0x1460('0x10'),_0xc6c89a,_[_0x1460('0x11')](_0x340c9f,'message')['join'](',\x20'));_0x46f553[_0x1460('0x12')]();}else{var _0x464d01=_['find'](_0x56d207['agents'],handleFindAgent(_0x394883[_0x1460('0xb')]));if(_0x464d01){var _0x514971=(_0x394883[_0x1460('0x13')]||0xa)*0x3e8;var _0x4ccdc6,_0x4a19e4;var _0x2329a5=seqqueue[_0x1460('0x14')](_0x514971);_0x2329a5['id']=_0xc6c89a;_0x2329a5[_0x1460('0x15')]=_0x514971;_0x2329a5['channel']=_0x5a273a['channel'];writeLog(_0xc6c89a,_0x464d01,util[_0x1460('0x16')](_0x1460('0x17'),_0x514971));_0x56d207[_0x1460('0x18')][_0xc6c89a]['on']('end',function(){logger[_0x1460('0x9')](_0x1460('0x19'),_0xc6c89a);clearTimeout(_0x4a19e4);_0x4a19e4=undefined;_0x2329a5[_0x1460('0x1a')]();if(_0x56d207[_0x1460('0x18')][_0xc6c89a]){delete _0x56d207[_0x1460('0x18')][_0xc6c89a];}_0x46f553['stop']();});_0x56d207[_0x1460('0x18')][_0xc6c89a]['on']('complete',function(){if(_0x56d207[_0x1460('0x18')][_0xc6c89a]){delete _0x56d207[_0x1460('0x18')][_0xc6c89a];}});_0x4a19e4=setTimeout(function(){logger[_0x1460('0x9')](_0x1460('0x1b'),_0xc6c89a);clearTimeout(_0x4a19e4);_0x2329a5['close']();_0x46f553[_0x1460('0x1c')]();},_0x514971);strategy[_0x1460('0x1d')](_0x2329a5,_0x464d01,_0x56d207,_0x5a273a);}else{logger[_0x1460('0xf')](_0x1460('0x1e'),_0xc6c89a,_0x394883[_0x1460('0xb')]);_0x46f553[_0x1460('0x12')]();}}}catch(_0x141d41){console[_0x1460('0x1f')](_0x141d41);logger[_0x1460('0xf')](_0x1460('0x20'),_0xc6c89a,_0x141d41[_0x1460('0x21')]);_0x46f553[_0x1460('0x12')]();}};}; \ No newline at end of file +var _0x635e=['message','join','stop','find','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','string','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map'];(function(_0x35194d,_0x53151b){var _0x2f028b=function(_0x3a7f95){while(--_0x3a7f95){_0x35194d['push'](_0x35194d['shift']());}};_0x2f028b(++_0x53151b);}(_0x635e,0x1d9));var _0xe635=function(_0xcae9f7,_0x35664b){_0xcae9f7=_0xcae9f7-0x0;var _0x3eb562=_0x635e[_0xcae9f7];return _0x3eb562;};'use strict';var schema=require(_0xe635('0x0'));var _=require(_0xe635('0x1'));var util=require(_0xe635('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xe635('0x3'))(_0xe635('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xe635('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xe635('0x6'),'message':_0xe635('0x7')}});function writeLog(_0x4bde51,_0x50be7c,_0x1fdcfa){return logger[_0xe635('0x8')](util[_0xe635('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4bde51,_0x50be7c[_0xe635('0xa')],_0x1fdcfa));}function handleFindAgent(_0x2eddbe){return function(_0x2198b8){return _0x2198b8[_0xe635('0xa')][_0xe635('0xb')]()===_0x2eddbe[_0xe635('0xb')]();};}exports[_0xe635('0xc')]=function(_0xddc216,_0x3ce414,_0x4b1f4c,_0xae951b){return function(_0x2e4045){try{var _0x2538da={'name':_0x3ce414[0x0],'timeout':_0x3ce414[0x1]};var _0x360e7a=queue['validate'](_0x2538da,{'typecast':!![]});if(_0x360e7a[_0xe635('0xd')]){logger[_0xe635('0xe')](_0xe635('0xf'),_0xddc216,_[_0xe635('0x10')](_0x360e7a,_0xe635('0x11'))[_0xe635('0x12')](',\x20'));_0x2e4045[_0xe635('0x13')]();}else{var _0x26aac5=_[_0xe635('0x14')](_0x4b1f4c['agents'],handleFindAgent(_0x2538da[_0xe635('0xa')]));if(_0x26aac5){var _0x4ccf89=(_0x2538da[_0xe635('0x15')]||0xa)*0x3e8;var _0x373d9c,_0x1f6387;var _0x220e81=seqqueue[_0xe635('0x16')](_0x4ccf89);_0x220e81['id']=_0xddc216;_0x220e81[_0xe635('0x17')]=_0x4ccf89;_0x220e81[_0xe635('0x18')]=_0xae951b['channel'];writeLog(_0xddc216,_0x26aac5,util[_0xe635('0x9')](_0xe635('0x19'),_0x4ccf89));_0x4b1f4c[_0xe635('0x1a')][_0xddc216]['on'](_0xe635('0x1b'),function(){logger['info'](_0xe635('0x1c'),_0xddc216);clearTimeout(_0x1f6387);_0x1f6387=undefined;_0x220e81[_0xe635('0x1d')]();if(_0x4b1f4c[_0xe635('0x1a')][_0xddc216]){delete _0x4b1f4c[_0xe635('0x1a')][_0xddc216];}_0x2e4045['stop']();});_0x4b1f4c[_0xe635('0x1a')][_0xddc216]['on'](_0xe635('0x1e'),function(){if(_0x4b1f4c[_0xe635('0x1a')][_0xddc216]){delete _0x4b1f4c[_0xe635('0x1a')][_0xddc216];}});_0x1f6387=setTimeout(function(){logger[_0xe635('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0xddc216);clearTimeout(_0x1f6387);_0x220e81[_0xe635('0x1d')]();_0x2e4045['next']();},_0x4ccf89);strategy[_0xe635('0x1f')](_0x220e81,_0x26aac5,_0x4b1f4c,_0xae951b);}else{logger[_0xe635('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xddc216,_0x2538da[_0xe635('0xa')]);_0x2e4045[_0xe635('0x13')]();}}}catch(_0x39dd87){console[_0xe635('0x20')](_0x39dd87);logger['error'](_0xe635('0x21'),_0xddc216,_0x39dd87[_0xe635('0x22')]);_0x2e4045[_0xe635('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 00a6c20..55be03a 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b34=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','body','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerResponse','Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','info'];(function(_0x6b6adb,_0x297ddf){var _0x46b088=function(_0x44c24a){while(--_0x44c24a){_0x6b6adb['push'](_0x6b6adb['shift']());}};_0x46b088(++_0x297ddf);}(_0x9b34,0xfe));var _0x49b3=function(_0x5cb5d6,_0x5da132){_0x5cb5d6=_0x5cb5d6-0x0;var _0x40213f=_0x9b34[_0x5cb5d6];return _0x40213f;};'use strict';var _=require(_0x49b3('0x0'));var moment=require('moment');var AWS=require(_0x49b3('0x1'));var utils=require('./utils');var logger=require(_0x49b3('0x2'))(_0x49b3('0x3'));var rpc={'chatMessage':require(_0x49b3('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x49b3('0x5')),'faxMessage':require(_0x49b3('0x6')),'whatsappMessage':require(_0x49b3('0x7'))};exports['consequence']=function(_0x34d682,_0x178985){return function(_0x4fd937){try{if(!_['isNil'](this[_0x49b3('0x8')]['UserId'])){logger[_0x49b3('0x9')]('[%s][AMAZONLEX]\x20%s',_0x34d682,_0x49b3('0xa'));return _0x4fd937[_0x49b3('0xb')]();}var _0x457b41={'ContactId':this[_0x49b3('0xc')]['id'],'sentAt':moment()[_0x49b3('0xd')](_0x49b3('0xe')),'direction':_0x49b3('0xf')};if(this['channel']==='sms'||this[_0x49b3('0x10')]===_0x49b3('0x11')){_0x457b41[_0x49b3('0x12')]=this[_0x49b3('0x8')]['phone'];}var _0x3273bd=this[_0x49b3('0x10')];if(_0x3273bd==='chat'){_0x457b41['ChatWebsiteId']=this[_0x49b3('0x13')]['id'];}else{_0x457b41[_[_0x49b3('0x14')](_0x3273bd)+_0x49b3('0x15')]=this[_0x49b3('0x13')]['id'];}_0x457b41[_[_0x49b3('0x14')](_0x3273bd)+_0x49b3('0x16')]=this['interaction']['id'];if(this[_0x49b3('0x8')][_0x49b3('0x17')]){var _0xa74962=_0x178985[0x4];if(!_[_0x49b3('0x18')](_0xa74962)){_0x457b41['body']=utils[_0x49b3('0x19')](_0xa74962,this);return rpc[_0x3273bd+_0x49b3('0x1a')][_0x49b3('0x1b')](_0x457b41)[_0x49b3('0x1c')](function(_0xb2b55e){logger[_0x49b3('0x9')](_0x49b3('0x1d'),_0x34d682,_0x457b41[_0x49b3('0x1e')]);})['catch'](function(_0x203192){logger['error'](_0x49b3('0x1d'),_0x34d682,JSON[_0x49b3('0x1f')](_0x203192));})[_0x49b3('0x20')](function(){logger[_0x49b3('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x34d682);_0x4fd937[_0x49b3('0x21')]();});}else{logger[_0x49b3('0x9')](_0x49b3('0x22'),_0x34d682);_0x4fd937[_0x49b3('0x21')]();}}else{var _0x578701=this;var _0x5745f7=new AWS[(_0x49b3('0x23'))]({'accessKeyId':_0x178985[0x0],'secretAccessKey':_0x178985[0x1],'region':_0x178985[0x2]});var _0x272398={'botAlias':_0x49b3('0x24'),'botName':_0x178985[0x3],'inputText':this[_0x49b3('0x25')][_0x49b3('0x1e')],'userId':this[_0x49b3('0x10')]+':'+this[_0x49b3('0x8')]['id'][_0x49b3('0x26')]()};_0x5745f7[_0x49b3('0x27')](_0x272398,function(_0x5e286e,_0x24921f){if(_0x5e286e){logger[_0x49b3('0x28')](_0x49b3('0x1d'),_0x34d682,_0x5e286e['message']);_0x4fd937[_0x49b3('0xb')]();}else if(_0x24921f&&_0x24921f[_0x49b3('0x25')]){_0x578701['body'][_0x49b3('0x29')]=_0x24921f;_0x457b41['body']=_0x24921f[_0x49b3('0x25')];_0x457b41['providerName']=_0x49b3('0x29');_0x457b41[_0x49b3('0x2a')]=JSON[_0x49b3('0x1f')](_0x24921f);return rpc[_0x3273bd+_0x49b3('0x1a')]['create'](_0x457b41)[_0x49b3('0x1c')](function(_0x4faea1){logger[_0x49b3('0x9')](_0x49b3('0x1d'),_0x34d682,_0x457b41[_0x49b3('0x1e')]);if(_0x24921f['dialogState']==_0x49b3('0x2b')){_0x4fd937[_0x49b3('0xb')]();}else{_0x4fd937[_0x49b3('0x21')]();}})['catch'](function(_0xb629b3){logger[_0x49b3('0x28')](_0x49b3('0x1d'),_0x34d682,JSON['stringify'](_0xb629b3));_0x4fd937['next']();});}else{_0x4fd937[_0x49b3('0xb')]();}});}}catch(_0x34dbb6){logger[_0x49b3('0x28')](_0x49b3('0x1d'),_0x34d682,JSON['stringify'](_0x34dbb6));_0x4fd937['stop']();}};}; \ No newline at end of file +var _0x5fe6=['[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','toString','error','next','message','amazonlex','providerResponse','Message','Failed','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x5fe6,0xaf));var _0x65fe=function(_0x54cb29,_0x48c6ef){_0x54cb29=_0x54cb29-0x0;var _0x5919e3=_0x5fe6[_0x54cb29];return _0x5919e3;};'use strict';var _=require('lodash');var moment=require(_0x65fe('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x65fe('0x1'))(_0x65fe('0x2'));var rpc={'chatMessage':require(_0x65fe('0x3')),'openchannelMessage':require(_0x65fe('0x4')),'mailMessage':require(_0x65fe('0x5')),'smsMessage':require(_0x65fe('0x6')),'faxMessage':require(_0x65fe('0x7')),'whatsappMessage':require(_0x65fe('0x8'))};exports[_0x65fe('0x9')]=function(_0x5b6f61,_0x242e20){return function(_0xfd61f6){try{if(!_['isNil'](this[_0x65fe('0xa')][_0x65fe('0xb')])){logger[_0x65fe('0xc')](_0x65fe('0xd'),_0x5b6f61,_0x65fe('0xe'));return _0xfd61f6['next']();}var _0x18ae89={'ContactId':this['contact']['id'],'sentAt':moment()[_0x65fe('0xf')](_0x65fe('0x10')),'direction':_0x65fe('0x11')};if(this[_0x65fe('0x12')]===_0x65fe('0x13')||this[_0x65fe('0x12')]===_0x65fe('0x14')){_0x18ae89[_0x65fe('0x15')]=this[_0x65fe('0xa')][_0x65fe('0x15')];}var _0x5c88ef=this[_0x65fe('0x12')];if(_0x5c88ef===_0x65fe('0x16')){_0x18ae89[_0x65fe('0x17')]=this[_0x65fe('0x18')]['id'];}else{_0x18ae89[_[_0x65fe('0x19')](_0x5c88ef)+_0x65fe('0x1a')]=this[_0x65fe('0x18')]['id'];}_0x18ae89[_['upperFirst'](_0x5c88ef)+_0x65fe('0x1b')]=this[_0x65fe('0xa')]['id'];if(this[_0x65fe('0xa')][_0x65fe('0x1c')]){var _0x5e22f7=_0x242e20[0x4];if(!_[_0x65fe('0x1d')](_0x5e22f7)){_0x18ae89['body']=utils[_0x65fe('0x1e')](_0x5e22f7,this);return rpc[_0x5c88ef+'Message'][_0x65fe('0x1f')](_0x18ae89)[_0x65fe('0x20')](function(_0x41cb5f){logger['info'](_0x65fe('0xd'),_0x5b6f61,_0x18ae89[_0x65fe('0x21')]);})['catch'](function(_0x3a6f9d){logger['error']('[%s][AMAZONLEX]\x20%s',_0x5b6f61,JSON[_0x65fe('0x22')](_0x3a6f9d));})['finally'](function(){logger[_0x65fe('0xc')](_0x65fe('0x23'),_0x5b6f61);_0xfd61f6['stop']();});}else{logger[_0x65fe('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5b6f61);_0xfd61f6[_0x65fe('0x24')]();}}else{var _0x1f8523=this;var _0x1e59a3=new AWS[(_0x65fe('0x25'))]({'accessKeyId':_0x242e20[0x0],'secretAccessKey':_0x242e20[0x1],'region':_0x242e20[0x2]});var _0x385090={'botAlias':_0x65fe('0x26'),'botName':_0x242e20[0x3],'inputText':this['message'][_0x65fe('0x21')],'userId':this[_0x65fe('0x12')]+':'+this[_0x65fe('0xa')]['id'][_0x65fe('0x27')]()};_0x1e59a3['postText'](_0x385090,function(_0x276f38,_0xa93442){if(_0x276f38){logger[_0x65fe('0x28')](_0x65fe('0xd'),_0x5b6f61,_0x276f38['message']);_0xfd61f6[_0x65fe('0x29')]();}else if(_0xa93442&&_0xa93442[_0x65fe('0x2a')]){_0x1f8523[_0x65fe('0x21')][_0x65fe('0x2b')]=_0xa93442;_0x18ae89[_0x65fe('0x21')]=_0xa93442['message'];_0x18ae89['providerName']=_0x65fe('0x2b');_0x18ae89[_0x65fe('0x2c')]=JSON[_0x65fe('0x22')](_0xa93442);return rpc[_0x5c88ef+_0x65fe('0x2d')]['create'](_0x18ae89)[_0x65fe('0x20')](function(_0x571b83){logger[_0x65fe('0xc')](_0x65fe('0xd'),_0x5b6f61,_0x18ae89[_0x65fe('0x21')]);if(_0xa93442['dialogState']==_0x65fe('0x2e')){_0xfd61f6[_0x65fe('0x29')]();}else{_0xfd61f6[_0x65fe('0x24')]();}})['catch'](function(_0x4ded00){logger[_0x65fe('0x28')](_0x65fe('0xd'),_0x5b6f61,JSON[_0x65fe('0x22')](_0x4ded00));_0xfd61f6[_0x65fe('0x29')]();});}else{_0xfd61f6[_0x65fe('0x29')]();}});}}catch(_0x63f3b6){logger['error'](_0x65fe('0xd'),_0x5b6f61,JSON[_0x65fe('0x22')](_0x63f3b6));_0xfd61f6[_0x65fe('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 6795933..8de195b 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa88b=['Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','host','port','authentication','auth','user','pass','inReplyTo','messageId','html','','replace','','headers','auto_reply','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','startsWith','Re:'];(function(_0x423258,_0x2960d2){var _0x1ea61b=function(_0x4d4745){while(--_0x4d4745){_0x423258['push'](_0x423258['shift']());}};_0x1ea61b(++_0x2960d2);}(_0xa88b,0x1e2));var _0xba88=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0xa88b[_0x18e52b];return _0x3d3062;};'use strict';var _=require(_0xba88('0x0'));var moment=require(_0xba88('0x1'));var utils=require(_0xba88('0x2'));var logger=require(_0xba88('0x3'))(_0xba88('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xba88('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xba88('0x6')),'whatsappMessage':require(_0xba88('0x7')),'chatInteraction':require(_0xba88('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xba88('0x9')),'faxInteraction':require(_0xba88('0xa')),'whatsappInteraction':require(_0xba88('0xb'))};var mailRpc=require(_0xba88('0xc'));exports[_0xba88('0xd')]=function(_0x4ab1fb,_0x12cafe,_0x52f509,_0x53d426){return function(_0x13c551){try{var _0x199b91=this[_0xba88('0xe')];if(_0x199b91===_0xba88('0xf')&&_0x53d426[_0xba88('0x10')][_0xba88('0x11')]){logger[_0xba88('0x12')]('[%s][AUTOREPLY]\x20%s',_0x4ab1fb,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x13c551[_0xba88('0x13')]();}if(_0x12cafe[0x0]==='1'&&(_[_0xba88('0x14')](this[_0xba88('0x15')][_0xba88('0x16')])||!this[_0xba88('0x15')]['created'])){logger[_0xba88('0x12')](_0xba88('0x17'),_0x4ab1fb,'Autoreply\x20already\x20sent');return _0x13c551[_0xba88('0x13')]();}if(_0x12cafe[0x0]==='2'&&this['interaction'][_0xba88('0x18')]){logger['info'](_0xba88('0x19'),_0x4ab1fb,'One\x20Time\x20already\x20sent');return _0x13c551['next']();}var _0x406b1b={'ContactId':this[_0xba88('0x1a')]['id'],'sentAt':moment()[_0xba88('0x1b')](_0xba88('0x1c')),'direction':'out'};if(this['channel']===_0xba88('0xf')){_0x406b1b[_0xba88('0x10')]=utils[_0xba88('0x1d')](_0x12cafe[0x2],this);}else{_0x406b1b[_0xba88('0x10')]=utils['getMustacheRender'](_0x12cafe[0x1],this);}if(this[_0xba88('0x1e')]){_0x406b1b['to']=this[_0xba88('0x1e')][_0xba88('0x1f')]||'';if(this['channel']==='mail'&&_0x12cafe[0x1]==='1'){_0x406b1b['cc']=this[_0xba88('0x1e')]['cc']||'';}_0x406b1b[_0xba88('0x1f')]=this[_0xba88('0x1e')]['to']||'';_0x406b1b[_0xba88('0x20')]=this['message']['phone']||'';_0x406b1b['read']=!![];if(this['message'][_0xba88('0x21')]){_0x406b1b[_0xba88('0x21')]='';_0x406b1b['subject']+=_[_0xba88('0x22')](this[_0xba88('0x1e')]['subject'],_0xba88('0x23'))?'':_0xba88('0x24');_0x406b1b[_0xba88('0x21')]+=this[_0xba88('0x1e')]['subject'];}}if(this[_0xba88('0xe')]===_0xba88('0x25')){_0x406b1b[_0xba88('0x26')]=this[_0xba88('0x27')]['id'];}else{_0x406b1b[_['upperFirst'](this['channel'])+_0xba88('0x28')]=this[_0xba88('0x27')]['id'];}_0x406b1b[_[_0xba88('0x29')](this[_0xba88('0xe')])+_0xba88('0x2a')]=this[_0xba88('0x15')]['id'];var _0x57ec7a=this[_0xba88('0x15')];if(rpc[this[_0xba88('0xe')]+_0xba88('0x2b')]){if(this[_0xba88('0xe')]===_0xba88('0xf')){var _0x8ab419={'tls':{'rejectUnauthorized':![]}};if(this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x2d')]){_0x8ab419[_0xba88('0x2d')]=this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x2d')];}else{_0x8ab419[_0xba88('0x2e')]=this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x2e')];_0x8ab419[_0xba88('0x2f')]=this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x2f')];_0x8ab419['secure']=this['account'][_0xba88('0x2c')]['secure'];}if(this['account'][_0xba88('0x2c')][_0xba88('0x30')]){_0x8ab419[_0xba88('0x31')]={'user':this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x32')],'pass':this[_0xba88('0x27')][_0xba88('0x2c')][_0xba88('0x33')]};}_0x406b1b[_0xba88('0x34')]=this[_0xba88('0x1e')][_0xba88('0x35')];_0x406b1b[_0xba88('0x36')]=_0xba88('0x37')+_[_0xba88('0x38')](_0x406b1b['body'],_0xba88('0x39'),_0xba88('0x3a'))+_0xba88('0x3b');_0x406b1b[_0xba88('0x3c')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xba88('0x3d')};return mailRpc['sendMailMessage'](_0x8ab419,_0x406b1b)['then'](function(_0x225671){logger[_0xba88('0x12')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x4ab1fb);_0x406b1b[_0xba88('0x35')]=_0x225671['message'][_0xba88('0x35')];return rpc[_0x199b91+_0xba88('0x2b')][_0xba88('0x3e')](_0x406b1b);})['then'](function(_0x5abbc2){logger[_0xba88('0x12')](_0xba88('0x17'),_0x4ab1fb,JSON[_0xba88('0x3f')](_0x5abbc2));})[_0xba88('0x40')](function(_0x101c10){logger['error'](_0xba88('0x41'),_0x4ab1fb,JSON['stringify'](_0x101c10));})[_0xba88('0x42')](function(){Promise[_0xba88('0x43')]()[_0xba88('0x44')](function(){if(_0x12cafe[0x0]!=='2'||_0x57ec7a[_0xba88('0x18')])return;return rpc[_0x199b91+_0xba88('0x45')][_0xba88('0x46')](_0x57ec7a['id'],{'autoreplyExecuted':!![]})[_0xba88('0x44')](function(_0x3f625d){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4ab1fb,JSON[_0xba88('0x3f')](_0x3f625d));})['catch'](function(_0x407995){logger[_0xba88('0x47')](_0xba88('0x48'),_0x4ab1fb,JSON['stringify'](_0x407995));});})[_0xba88('0x44')](function(){_0x13c551[_0xba88('0x13')]();});});}else{return rpc[this['channel']+'Message'][_0xba88('0x3e')](_0x406b1b)[_0xba88('0x44')](function(_0x243102){logger[_0xba88('0x12')](_0xba88('0x17'),_0x4ab1fb,_0x406b1b[_0xba88('0x10')]);})['catch'](function(_0x3f193c){logger['error']('[%s][AUTOREPLY]\x20%s',_0x4ab1fb,JSON[_0xba88('0x3f')](_0x3f193c));})[_0xba88('0x42')](function(){Promise[_0xba88('0x43')]()['then'](function(){if(_0x12cafe[0x0]!=='2'||_0x57ec7a[_0xba88('0x18')])return;return rpc[_0x199b91+_0xba88('0x45')]['update'](_0x57ec7a['id'],{'autoreplyExecuted':!![]})[_0xba88('0x44')](function(_0x24f69c){logger[_0xba88('0x12')](_0xba88('0x19'),_0x4ab1fb,JSON[_0xba88('0x3f')](_0x24f69c));})[_0xba88('0x40')](function(_0x5c4176){logger[_0xba88('0x47')](_0xba88('0x48'),_0x4ab1fb,JSON[_0xba88('0x3f')](_0x5c4176));});})[_0xba88('0x44')](function(){_0x13c551['next']();});});}}}catch(_0x58b940){logger[_0xba88('0x47')](_0xba88('0x17'),_0x4ab1fb,JSON[_0xba88('0x3f')](_0x58b940));_0x13c551[_0xba88('0x49')]();}};}; \ No newline at end of file +var _0x88a0=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','phone','subject','startsWith','Re:','upperFirst','AccountId','InteractionId','Message','account','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x88a0,0xd7));var _0x088a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x88a0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var moment=require(_0x088a('0x0'));var utils=require('./utils');var logger=require(_0x088a('0x1'))(_0x088a('0x2'));var rpc={'chatMessage':require(_0x088a('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x088a('0x4')),'smsMessage':require(_0x088a('0x5')),'faxMessage':require(_0x088a('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x088a('0x7')),'openchannelInteraction':require(_0x088a('0x8')),'mailInteraction':require(_0x088a('0x9')),'smsInteraction':require(_0x088a('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x088a('0xb'))};var mailRpc=require(_0x088a('0xc'));exports[_0x088a('0xd')]=function(_0x1fb85d,_0x3a2b8a,_0x166d2e,_0x116e64){return function(_0x3d623f){try{var _0x195f8d=this[_0x088a('0xe')];if(_0x195f8d===_0x088a('0xf')&&_0x116e64['body'][_0x088a('0x10')]){logger[_0x088a('0x11')](_0x088a('0x12'),_0x1fb85d,_0x088a('0x13'));return _0x3d623f['next']();}if(_0x3a2b8a[0x0]==='1'&&(_[_0x088a('0x14')](this[_0x088a('0x15')][_0x088a('0x16')])||!this['interaction'][_0x088a('0x16')])){logger['info'](_0x088a('0x12'),_0x1fb85d,'Autoreply\x20already\x20sent');return _0x3d623f[_0x088a('0x17')]();}if(_0x3a2b8a[0x0]==='2'&&this[_0x088a('0x15')][_0x088a('0x18')]){logger[_0x088a('0x11')](_0x088a('0x19'),_0x1fb85d,'One\x20Time\x20already\x20sent');return _0x3d623f[_0x088a('0x17')]();}var _0x494a9a={'ContactId':this[_0x088a('0x1a')]['id'],'sentAt':moment()[_0x088a('0x1b')](_0x088a('0x1c')),'direction':_0x088a('0x1d')};if(this[_0x088a('0xe')]===_0x088a('0xf')){_0x494a9a[_0x088a('0x1e')]=utils['getMustacheRender'](_0x3a2b8a[0x2],this);}else{_0x494a9a[_0x088a('0x1e')]=utils[_0x088a('0x1f')](_0x3a2b8a[0x1],this);}if(this[_0x088a('0x20')]){_0x494a9a['to']=this[_0x088a('0x20')]['from']||'';if(this[_0x088a('0xe')]==='mail'&&_0x3a2b8a[0x1]==='1'){_0x494a9a['cc']=this[_0x088a('0x20')]['cc']||'';}_0x494a9a['from']=this[_0x088a('0x20')]['to']||'';_0x494a9a[_0x088a('0x21')]=this['message'][_0x088a('0x21')]||'';_0x494a9a['read']=!![];if(this['message'][_0x088a('0x22')]){_0x494a9a[_0x088a('0x22')]='';_0x494a9a['subject']+=_[_0x088a('0x23')](this[_0x088a('0x20')][_0x088a('0x22')],_0x088a('0x24'))?'':'Re:\x20';_0x494a9a['subject']+=this[_0x088a('0x20')]['subject'];}}if(this[_0x088a('0xe')]==='chat'){_0x494a9a['ChatWebsiteId']=this['account']['id'];}else{_0x494a9a[_[_0x088a('0x25')](this['channel'])+_0x088a('0x26')]=this['account']['id'];}_0x494a9a[_['upperFirst'](this[_0x088a('0xe')])+_0x088a('0x27')]=this[_0x088a('0x15')]['id'];var _0x5d362b=this[_0x088a('0x15')];if(rpc[this['channel']+_0x088a('0x28')]){if(this[_0x088a('0xe')]===_0x088a('0xf')){var _0x2ee7ce={'tls':{'rejectUnauthorized':![]}};if(this[_0x088a('0x29')][_0x088a('0x2a')]['service']){_0x2ee7ce['service']=this['account'][_0x088a('0x2a')][_0x088a('0x2b')];}else{_0x2ee7ce['host']=this[_0x088a('0x29')]['Smtp']['host'];_0x2ee7ce[_0x088a('0x2c')]=this['account'][_0x088a('0x2a')][_0x088a('0x2c')];_0x2ee7ce[_0x088a('0x2d')]=this['account'][_0x088a('0x2a')][_0x088a('0x2d')];}if(this[_0x088a('0x29')][_0x088a('0x2a')][_0x088a('0x2e')]){_0x2ee7ce[_0x088a('0x2f')]={'user':this[_0x088a('0x29')][_0x088a('0x2a')][_0x088a('0x30')],'pass':this[_0x088a('0x29')][_0x088a('0x2a')][_0x088a('0x31')]};}_0x494a9a[_0x088a('0x32')]=this['message'][_0x088a('0x33')];_0x494a9a[_0x088a('0x34')]=''+_['replace'](_0x494a9a['body'],_0x088a('0x35'),']+(>|$)/g,''),'priorityTrue':_0x212ad5[0x1],'priorityFalse':_0x212ad5[0x2]};var _0xb4b327=gotoif[_0x78d1('0x0')](_0x131c2c,{'typecast':!![]});if(_0xb4b327[_0x78d1('0xa')]){logger[_0x78d1('0xb')](_0x78d1('0xc'),_0x2d2642,_[_0x78d1('0xd')](_0xb4b327,_0x78d1('0xe'))['join'](',\x20'));_0x3d06c6[_0x78d1('0xf')]();}else{try{var _0x2dae2b=eval('('+_0x131c2c[_0x78d1('0x10')]+')');var _0x357d7b=_0x2dae2b?_0x131c2c[_0x78d1('0x11')]:_0x131c2c[_0x78d1('0x12')];logger[_0x78d1('0x13')](_0x78d1('0x14'),_0x2d2642,_0x131c2c[_0x78d1('0x10')],_0x2dae2b,_0x357d7b||_0x78d1('0x15'));if(_0x357d7b){var _0x1f4738=_['findIndex'](_0x3d06c6[_0x78d1('0x16')](),{'p':_0x357d7b});if(_0x1f4738>=0x0){logger[_0x78d1('0x13')](_0x78d1('0x17'),_0x2d2642,_0x357d7b||_0x78d1('0x15'),_0x1f4738);_0x3d06c6[_0x78d1('0x15')](_0x1f4738);}else{logger[_0x78d1('0x13')](_0x78d1('0x18'),_0x2d2642,_0x357d7b||'next');_0x3d06c6['stop']();}}else{_0x3d06c6[_0x78d1('0x15')]();}}catch(_0x5ece92){logger[_0x78d1('0xb')](_0x78d1('0x19'),_0x2d2642,_0x5ece92[_0x78d1('0xe')]);_0x3d06c6[_0x78d1('0xf')]();}}}catch(_0x5b9694){logger[_0x78d1('0xb')](_0x78d1('0xc'),_0x2d2642,JSON[_0x78d1('0x1a')](_0x5b9694));_0x3d06c6[_0x78d1('0xf')]();}};}; \ No newline at end of file +var _0xf1e2=['html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf1e2,0x195));var _0x2f1e=function(_0x3a2c37,_0xc875b5){_0x3a2c37=_0x3a2c37-0x0;var _0x1f6a5c=_0xf1e2[_0x3a2c37];return _0x1f6a5c;};'use strict';var schema=require(_0x2f1e('0x0'));var _=require('lodash');var htmlToText=require(_0x2f1e('0x1'));var utils=require(_0x2f1e('0x2'));var logger=require(_0x2f1e('0x3'))(_0x2f1e('0x4'));var gotoif=schema({'condition':{'type':_0x2f1e('0x5'),'required':!![],'message':_0x2f1e('0x6')},'priorityTrue':{'type':_0x2f1e('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x2f1e('0x7'),'message':_0x2f1e('0x8')}});exports[_0x2f1e('0x9')]=function(_0x21b909,_0x3cfcbe){return function(_0x34cd3c){try{var _0x1c2f61={'condition':htmlToText[_0x2f1e('0xa')](utils[_0x2f1e('0xb')](_0x3cfcbe[0x0],this),{'wordwrap':![]})[_0x2f1e('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3cfcbe[0x1],'priorityFalse':_0x3cfcbe[0x2]};var _0x74642=gotoif['validate'](_0x1c2f61,{'typecast':!![]});if(_0x74642['length']){logger[_0x2f1e('0xd')](_0x2f1e('0xe'),_0x21b909,_[_0x2f1e('0xf')](_0x74642,_0x2f1e('0x10'))[_0x2f1e('0x11')](',\x20'));_0x34cd3c[_0x2f1e('0x12')]();}else{try{var _0x2d131b=eval('('+_0x1c2f61[_0x2f1e('0x13')]+')');var _0x1ae131=_0x2d131b?_0x1c2f61[_0x2f1e('0x14')]:_0x1c2f61['priorityFalse'];logger['info'](_0x2f1e('0x15'),_0x21b909,_0x1c2f61[_0x2f1e('0x13')],_0x2d131b,_0x1ae131||'next');if(_0x1ae131){var _0x4456cf=_[_0x2f1e('0x16')](_0x34cd3c['rules'](),{'p':_0x1ae131});if(_0x4456cf>=0x0){logger[_0x2f1e('0x17')](_0x2f1e('0x18'),_0x21b909,_0x1ae131||'next',_0x4456cf);_0x34cd3c['next'](_0x4456cf);}else{logger[_0x2f1e('0x17')](_0x2f1e('0x19'),_0x21b909,_0x1ae131||_0x2f1e('0x1a'));_0x34cd3c['stop']();}}else{_0x34cd3c[_0x2f1e('0x1a')]();}}catch(_0x2808b4){logger[_0x2f1e('0xd')](_0x2f1e('0x1b'),_0x21b909,_0x2808b4[_0x2f1e('0x10')]);_0x34cd3c['stop']();}}}catch(_0x38ee26){logger['error'](_0x2f1e('0xe'),_0x21b909,JSON[_0x2f1e('0x1c')](_0x38ee26));_0x34cd3c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 75ad567..0631b37 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x625f=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','lodash','../../../../config/logger'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0x625f,0x13e));var _0xf625=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x625f[_0x565c49];return _0x20ca34;};'use strict';var schema=require('validate');var _=require(_0xf625('0x0'));var logger=require(_0xf625('0x1'))(_0xf625('0x2'));var gotop=schema({'priority':{'type':_0xf625('0x3'),'required':!![],'message':_0xf625('0x4')}});exports[_0xf625('0x5')]=function(_0x51114c,_0x57747f){return function(_0x1a7430){try{var _0x37d9bc={'priority':_0x57747f[0x0]};var _0x5da5c4=gotop['validate'](_0x37d9bc,{'typecast':!![]});if(_0x5da5c4[_0xf625('0x6')]){logger['error'](_0xf625('0x7'),_0x51114c,_[_0xf625('0x8')](_0x5da5c4,_0xf625('0x9'))[_0xf625('0xa')](',\x20'));_0x1a7430[_0xf625('0xb')]();}else{logger[_0xf625('0xc')](_0xf625('0xd'),_0x51114c,_0x37d9bc[_0xf625('0xe')]);if(_0x37d9bc[_0xf625('0xe')]){var _0x28836d=_[_0xf625('0xf')](_0x1a7430[_0xf625('0x10')](),{'p':_0x37d9bc[_0xf625('0xe')]});if(_0x28836d>=0x0){logger[_0xf625('0xc')](_0xf625('0x11'),_0x51114c,_0x37d9bc[_0xf625('0xe')]||_0xf625('0x12'),_0x28836d);_0x1a7430[_0xf625('0x12')](_0x28836d);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x51114c,_0x37d9bc[_0xf625('0xe')]||_0xf625('0x12'));_0x1a7430[_0xf625('0xb')]();}}else{_0x1a7430[_0xf625('0x12')]();}}}catch(_0x2ec783){logger['error'](_0xf625('0x7'),_0x51114c,JSON[_0xf625('0x13')](_0x2ec783));_0x1a7430[_0xf625('0xb')]();}};}; \ No newline at end of file +var _0x17ef=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x17ef,0x129));var _0xf17e=function(_0xc237d0,_0x55e352){_0xc237d0=_0xc237d0-0x0;var _0x10d408=_0x17ef[_0xc237d0];return _0x10d408;};'use strict';var schema=require(_0xf17e('0x0'));var _=require(_0xf17e('0x1'));var logger=require(_0xf17e('0x2'))(_0xf17e('0x3'));var gotop=schema({'priority':{'type':_0xf17e('0x4'),'required':!![],'message':_0xf17e('0x5')}});exports[_0xf17e('0x6')]=function(_0x17ef4d,_0x5b005d){return function(_0x563cf6){try{var _0x4fe6a1={'priority':_0x5b005d[0x0]};var _0xb0255d=gotop[_0xf17e('0x0')](_0x4fe6a1,{'typecast':!![]});if(_0xb0255d[_0xf17e('0x7')]){logger[_0xf17e('0x8')](_0xf17e('0x9'),_0x17ef4d,_[_0xf17e('0xa')](_0xb0255d,_0xf17e('0xb'))[_0xf17e('0xc')](',\x20'));_0x563cf6['stop']();}else{logger[_0xf17e('0xd')](_0xf17e('0xe'),_0x17ef4d,_0x4fe6a1['priority']);if(_0x4fe6a1[_0xf17e('0xf')]){var _0x1ad6cc=_[_0xf17e('0x10')](_0x563cf6[_0xf17e('0x11')](),{'p':_0x4fe6a1[_0xf17e('0xf')]});if(_0x1ad6cc>=0x0){logger[_0xf17e('0xd')](_0xf17e('0x12'),_0x17ef4d,_0x4fe6a1[_0xf17e('0xf')]||_0xf17e('0x13'),_0x1ad6cc);_0x563cf6['next'](_0x1ad6cc);}else{logger[_0xf17e('0xd')](_0xf17e('0x14'),_0x17ef4d,_0x4fe6a1['priority']||_0xf17e('0x13'));_0x563cf6[_0xf17e('0x15')]();}}else{_0x563cf6[_0xf17e('0x13')]();}}}catch(_0x2aa049){logger['error']('[%s][GOTOP]\x20%s',_0x17ef4d,JSON[_0xf17e('0x16')](_0x2aa049));_0x563cf6['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 9960868..ef291f9 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a59=['InteractionId','interaction','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x1b4c55,_0x4e948a){var _0x13ee86=function(_0x4390be){while(--_0x4390be){_0x1b4c55['push'](_0x1b4c55['shift']());}};_0x13ee86(++_0x4e948a);}(_0x6a59,0x1d6));var _0x96a5=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x6a59[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0x96a5('0x0'));var utils=require('./utils');var logger=require(_0x96a5('0x1'))(_0x96a5('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x96a5('0x3')),'mailMessage':require(_0x96a5('0x4')),'smsMessage':require(_0x96a5('0x5')),'faxMessage':require(_0x96a5('0x6')),'whatsappMessage':require(_0x96a5('0x7'))};exports[_0x96a5('0x8')]=function(_0x1ece7a,_0x503d4f){return function(_0xdc370e){try{var _0x400594={'body':utils['getMustacheRender'](_0x503d4f[0x0],this),'ContactId':this[_0x96a5('0x9')]['id']};if(this[_0x96a5('0xa')]===_0x96a5('0xb')){_0x400594[_0x96a5('0xc')]=this[_0x96a5('0xd')]['id'];}else{_0x400594[_[_0x96a5('0xe')](this[_0x96a5('0xa')])+_0x96a5('0xf')]=this[_0x96a5('0xd')]['id'];}_0x400594[_[_0x96a5('0xe')](this[_0x96a5('0xa')])+_0x96a5('0x10')]=this[_0x96a5('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x96a5('0xa')]+'Message'][_0x96a5('0x12')](_0x400594)[_0x96a5('0x13')](function(_0x24aa05){logger[_0x96a5('0x14')]('[%s][MESSAGE]\x20%s',_0x1ece7a,_0x400594['body']);_0xdc370e[_0x96a5('0x15')]();})[_0x96a5('0x16')](function(_0x8eeb4c){logger[_0x96a5('0x17')](_0x96a5('0x18'),_0x1ece7a,JSON[_0x96a5('0x19')](_0x8eeb4c));_0xdc370e[_0x96a5('0x1a')]();});}}catch(_0x3cf9f0){logger['error'](_0x96a5('0x18'),_0x1ece7a,JSON['stringify'](_0x3cf9f0));_0xdc370e[_0x96a5('0x1a')]();}};}; \ No newline at end of file +var _0x7d80=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stop','stringify'];(function(_0x4e2a12,_0x580621){var _0x40bccb=function(_0x52a2ef){while(--_0x52a2ef){_0x4e2a12['push'](_0x4e2a12['shift']());}};_0x40bccb(++_0x580621);}(_0x7d80,0x17a));var _0x07d8=function(_0x4426db,_0x38c774){_0x4426db=_0x4426db-0x0;var _0x4c46c9=_0x7d80[_0x4426db];return _0x4c46c9;};'use strict';var _=require('lodash');var utils=require(_0x07d8('0x0'));var logger=require(_0x07d8('0x1'))(_0x07d8('0x2'));var rpc={'chatMessage':require(_0x07d8('0x3')),'openchannelMessage':require(_0x07d8('0x4')),'mailMessage':require(_0x07d8('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x07d8('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x07d8('0x7')]=function(_0xb83132,_0x3e7308){return function(_0x53231b){try{var _0x5e9c64={'body':utils[_0x07d8('0x8')](_0x3e7308[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x5e9c64[_0x07d8('0x9')]=this[_0x07d8('0xa')]['id'];}else{_0x5e9c64[_['upperFirst'](this[_0x07d8('0xb')])+_0x07d8('0xc')]=this[_0x07d8('0xa')]['id'];}_0x5e9c64[_[_0x07d8('0xd')](this[_0x07d8('0xb')])+_0x07d8('0xe')]=this[_0x07d8('0xf')]['id'];if(rpc[this['channel']+_0x07d8('0x10')]){return rpc[this[_0x07d8('0xb')]+_0x07d8('0x10')][_0x07d8('0x11')](_0x5e9c64)[_0x07d8('0x12')](function(_0x14ee4c){logger[_0x07d8('0x13')]('[%s][MESSAGE]\x20%s',_0xb83132,_0x5e9c64[_0x07d8('0x14')]);_0x53231b[_0x07d8('0x15')]();})[_0x07d8('0x16')](function(_0x584765){logger[_0x07d8('0x17')](_0x07d8('0x18'),_0xb83132,JSON['stringify'](_0x584765));_0x53231b[_0x07d8('0x19')]();});}}catch(_0x1bd568){logger[_0x07d8('0x17')](_0x07d8('0x18'),_0xb83132,JSON[_0x07d8('0x1a')](_0x1bd568));_0x53231b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index b3e4bb6..20b87ec 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e11=['info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x278627,_0x24ea74){var _0x3fb102=function(_0x3d9f7a){while(--_0x3d9f7a){_0x278627['push'](_0x278627['shift']());}};_0x3fb102(++_0x24ea74);}(_0x7e11,0x19e));var _0x17e1=function(_0x5ab3d9,_0x5f2f01){_0x5ab3d9=_0x5ab3d9-0x0;var _0x3ad7a3=_0x7e11[_0x5ab3d9];return _0x3ad7a3;};'use strict';var utils=require(_0x17e1('0x0'));var logger=require(_0x17e1('0x1'))(_0x17e1('0x2'));exports[_0x17e1('0x3')]=function(_0x327b7f,_0x3fedc5){return function(_0x106d52){try{logger[_0x17e1('0x4')]('[%s][NOOP]\x20%s',_0x327b7f,utils[_0x17e1('0x5')](_0x3fedc5[0x0],this));_0x106d52[_0x17e1('0x6')]();}catch(_0x51610f){logger[_0x17e1('0x7')](_0x17e1('0x8'),_0x327b7f,JSON[_0x17e1('0x9')](_0x51610f));_0x106d52[_0x17e1('0xa')]();}};}; \ No newline at end of file +var _0xa967=['[%s][NOOP]\x20%s','error','stop','info'];(function(_0x391afb,_0x28e835){var _0x474ba9=function(_0x1dd154){while(--_0x1dd154){_0x391afb['push'](_0x391afb['shift']());}};_0x474ba9(++_0x28e835);}(_0xa967,0x1cf));var _0x7a96=function(_0x42c2f1,_0x379336){_0x42c2f1=_0x42c2f1-0x0;var _0x179cc8=_0xa967[_0x42c2f1];return _0x179cc8;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0x432ad6,_0x1a21c2){return function(_0x3a61f0){try{logger[_0x7a96('0x0')](_0x7a96('0x1'),_0x432ad6,utils['getMustacheRender'](_0x1a21c2[0x0],this));_0x3a61f0['next']();}catch(_0x1e853f){logger[_0x7a96('0x2')](_0x7a96('0x1'),_0x432ad6,JSON['stringify'](_0x1e853f));_0x3a61f0[_0x7a96('0x3')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d94b9d5..d4e09b9 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1295=['create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','defaults','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','upperFirst','InteractionId','interaction','message','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error'];(function(_0x27dd11,_0x2bcb79){var _0x317d91=function(_0x3947bd){while(--_0x3947bd){_0x27dd11['push'](_0x27dd11['shift']());}};_0x317d91(++_0x2bcb79);}(_0x1295,0x154));var _0x5129=function(_0x4ef22d,_0x4e64ee){_0x4ef22d=_0x4ef22d-0x0;var _0x249853=_0x1295[_0x4ef22d];return _0x249853;};'use strict';var schema=require(_0x5129('0x0'));var _=require(_0x5129('0x1'));var util=require(_0x5129('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x5129('0x3'));var Redis=require('ioredis');var config=require(_0x5129('0x4'));var logger=require(_0x5129('0x5'))(_0x5129('0x6'));var strategy=require('./strategy');config['redis']=_[_0x5129('0x7')](config[_0x5129('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x5129('0x9'))(new Redis(config[_0x5129('0x8')]));var attributes=['id',_0x5129('0xa'),_0x5129('0xb'),_0x5129('0xc'),_0x5129('0xd'),_0x5129('0xe')];function emit(_0x2065fa,_0x39cac0,_0x1b6514){io['to'](_0x2065fa)[_0x5129('0xf')](_0x39cac0,_0x1b6514);}function emitChannelQueueInteraction(_0x2aeee4,_0x5763e5,_0x4abe6d,_0x2a4880,_0x367b14,_0x43e5a9,_0x59b805,_0x36551a){var _0x3d4c70=_[_0x5129('0x10')](_0x4abe6d);_0x3d4c70[_0x5129('0xa')]=_0x36551a;_0x3d4c70[_0x5129('0xc')]=_0x5763e5;_0x3d4c70[_0x5129('0xb')]=_0x2a4880;_0x3d4c70['id']=_0x367b14;if(_0x43e5a9){_0x59b805[util[_0x5129('0x11')](_0x5129('0x12'),_0x2aeee4)][_0x367b14]=_[_0x5129('0x13')](_0x3d4c70,attributes);}else{delete _0x59b805[util['format'](_0x5129('0x12'),_0x2aeee4)][_0x367b14];}emit(util[_0x5129('0x11')](_0x5129('0x14'),_0x2aeee4,_0x5763e5),util[_0x5129('0x11')](_0x5129('0x15'),_0x2aeee4,_0x43e5a9?_0x5129('0x16'):_0x5129('0x17')),_['pick'](_0x3d4c70,attributes));}var rpc={'openchannelQueueReport':require(_0x5129('0x18')),'mailQueueReport':require(_0x5129('0x19')),'chatQueueReport':require(_0x5129('0x1a')),'smsQueueReport':require(_0x5129('0x1b')),'faxQueueReport':require(_0x5129('0x1c')),'whatsappQueueReport':require(_0x5129('0x1d'))};var queue=schema({'name':{'type':_0x5129('0x1e'),'required':!![],'message':_0x5129('0x1f')},'timeout':{'type':_0x5129('0x20'),'message':_0x5129('0x21')}});function startRouting(_0x4d20f8,_0x1b9ced,_0x36a9da,_0x516bed){if(_0x4d20f8&&_0x1b9ced&&_0x36a9da){_0x1b9ced[_0x5129('0x22')]+=0x1;var _0x1cf729={'uniqueid':_0x4d20f8,'from':_0x36a9da[_0x5129('0x23')]?_0x36a9da[_0x5129('0x23')][_0x5129('0xd')]:'','joinAt':moment()[_0x5129('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36a9da[_0x5129('0x24')]?_0x36a9da[_0x5129('0x24')]['id']:null,'ListId':_0x36a9da[_0x5129('0x25')]?_0x36a9da['list']['id']:null};_0x1cf729[_['upperFirst'](_0x36a9da[_0x5129('0x26')])+'QueueId']=_0x1b9ced['id']||null;_0x1cf729[_[_0x5129('0x27')](_0x36a9da[_0x5129('0x26')])+_0x5129('0x28')]=_0x36a9da[_0x5129('0x29')]?_0x36a9da[_0x5129('0x29')]['id']:null;_0x1cf729[_['upperFirst'](_0x36a9da[_0x5129('0x26')])+'MessageId']=_0x36a9da[_0x5129('0x2a')]?_0x36a9da[_0x5129('0x2a')]['id']:null;_0x1cf729[_[_0x5129('0x27')](_0x36a9da['channel'])+(_0x36a9da['channel']!=='chat'?'AccountId':_0x5129('0x2b'))]=_0x36a9da[_0x5129('0xb')]?_0x36a9da[_0x5129('0xb')]['id']:null;logger['info'](util['format'](_0x5129('0x2c'),_0x4d20f8,_0x1b9ced['name']));emitChannelQueueInteraction(_0x36a9da[_0x5129('0x26')],_0x1b9ced[_0x5129('0x2d')],_0x1cf729,_0x36a9da[_0x5129('0xb')][_0x5129('0x2d')],_0x36a9da['message']['id'],!![],_0x516bed,_0x1b9ced['id']);if(rpc[_0x36a9da[_0x5129('0x26')]+_0x5129('0x2e')]){return rpc[_0x36a9da[_0x5129('0x26')]+_0x5129('0x2e')][_0x5129('0x2f')](_0x1cf729)[_0x5129('0x30')](function(_0x427132){logger[_0x5129('0x31')](_0x5129('0x32'));});}}}function stopRouting(_0x1dbf7c,_0x5aab01,_0x25a4ca,_0x587f1c){if(_0x1dbf7c&&_0x5aab01){_0x5aab01[_0x5129('0x22')]-=0x1;var _0x325b5a={'leaveAt':moment()[_0x5129('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x5129('0x11')](_0x5129('0x33')),'reason':_0x5129('0x34')};logger[_0x5129('0x35')](util[_0x5129('0x11')](_0x5129('0x36'),_0x1dbf7c,_0x5aab01['name']));emitChannelQueueInteraction(_0x25a4ca[_0x5129('0x26')],_0x5aab01['name'],_0x25a4ca[_0x5129('0x23')],_0x25a4ca[_0x5129('0xb')][_0x5129('0x2d')],_0x25a4ca['message']['id'],![],_0x587f1c,_0x5aab01['id']);if(rpc[_0x25a4ca[_0x5129('0x26')]+_0x5129('0x2e')]){return rpc[_0x25a4ca['channel']+'QueueReport']['update'](_0x1dbf7c,_0x325b5a)[_0x5129('0x30')](function(_0x475524){logger['error'](_0x5129('0x37'));});}}}function endRouting(_0x40e48c,_0x1d32e9,_0x5c3f6b,_0x47443d){if(_0x40e48c&&_0x1d32e9){_0x1d32e9['waiting']-=0x1;var _0x3b6e94={'leaveAt':moment()[_0x5129('0x11')](_0x5129('0x33')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x5129('0x38')};logger[_0x5129('0x35')](util[_0x5129('0x11')](_0x5129('0x39'),_0x40e48c,_0x1d32e9[_0x5129('0x2d')]));emitChannelQueueInteraction(_0x5c3f6b[_0x5129('0x26')],_0x1d32e9[_0x5129('0x2d')],_0x5c3f6b[_0x5129('0x23')],_0x5c3f6b[_0x5129('0xb')][_0x5129('0x2d')],_0x5c3f6b[_0x5129('0x2a')]['id'],![],_0x47443d);if(rpc[_0x5c3f6b['channel']+_0x5129('0x2e')]){return rpc[_0x5c3f6b[_0x5129('0x26')]+_0x5129('0x2e')]['update'](_0x40e48c,_0x3b6e94)[_0x5129('0x30')](function(_0x460154){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0xe3904){return function(_0x32403b){return _0x32403b[_0x5129('0x2d')][_0x5129('0x3a')]()===_0xe3904[_0x5129('0x3a')]();};}exports[_0x5129('0x3b')]=function(_0x1e69d1,_0x1c77a8,_0x3ffa0c,_0x1ecfea){return function(_0x24b25d){try{var _0x4ecce9={'name':_0x1c77a8[0x0],'timeout':_0x1c77a8[0x1]};var _0x4606d7=queue[_0x5129('0x0')](_0x4ecce9,{'typecast':!![]});if(_0x4606d7[_0x5129('0x3c')]){logger[_0x5129('0x31')](_0x5129('0x3d'),_0x1e69d1,_[_0x5129('0x3e')](_0x4606d7,'message')[_0x5129('0x3f')](',\x20'));_0x24b25d[_0x5129('0x40')]();}else{var _0x274160=_['find'](_0x3ffa0c[_0x1ecfea['channel']+_0x5129('0x41')],handleFindQueue(_0x4ecce9['name']));if(_0x274160){startRouting(_0x1e69d1,_0x274160,_0x1ecfea,_0x3ffa0c);var _0x5f2fa5=(_0x274160[_0x5129('0x38')]||0xa)*0x3e8;var _0x57a102=(_0x4ecce9[_0x5129('0x38')]||0x14)*0x3e8;var _0x304053,_0x33bee8;if(_0x5f2fa5>_0x57a102){_0x57a102=_0x5f2fa5;}var _0x5f5952=seqqueue[_0x5129('0x42')](_0x5f2fa5);_0x5f5952['id']=_0x1e69d1;_0x5f5952[_0x5129('0x43')]=_0x5f2fa5;_0x5f5952[_0x5129('0x44')]=_0x57a102;_0x5f5952[_0x5129('0x26')]=_0x1ecfea[_0x5129('0x26')];_0x3ffa0c[_0x5129('0x45')][_0x1e69d1]['on']('end',function(){logger[_0x5129('0x35')](_0x5129('0x46'),_0x1e69d1);stopRouting(_0x1e69d1,_0x274160,_0x1ecfea,_0x3ffa0c);clearTimeout(_0x304053);_0x304053=undefined;_0x5f5952[_0x5129('0x47')](!![]);if(_0x3ffa0c[_0x5129('0x45')][_0x1e69d1]){delete _0x3ffa0c['rules'][_0x1e69d1];}_0x24b25d[_0x5129('0x40')]();});_0x3ffa0c[_0x5129('0x45')][_0x1e69d1]['on'](_0x5129('0x48'),function(){if(_0x3ffa0c['rules'][_0x1e69d1]){delete _0x3ffa0c[_0x5129('0x45')][_0x1e69d1];}});_0x304053=setTimeout(function(){logger[_0x5129('0x35')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x1e69d1);endRouting(_0x1e69d1,_0x274160,_0x1ecfea,_0x3ffa0c);clearTimeout(_0x304053);_0x5f5952[_0x5129('0x47')](!![]);_0x24b25d[_0x5129('0x49')]();},_0x57a102);switch(_0x274160[_0x5129('0x4a')]){case _0x5129('0x4b'):strategy[_0x5129('0x4b')](_0x5f5952,_0x274160,_0x3ffa0c,_0x1ecfea);break;default:strategy[_0x5129('0x4c')](_0x5f5952,_0x274160,_0x3ffa0c,_0x1ecfea);}}else{logger[_0x5129('0x31')](_0x5129('0x4d'),_0x1e69d1,_0x4ecce9[_0x5129('0x2d')]);_0x24b25d[_0x5129('0x40')]();}}}catch(_0x575c25){console['log'](_0x575c25);logger[_0x5129('0x31')](_0x5129('0x3d'),_0x1e69d1,_0x575c25['stack']);_0x24b25d[_0x5129('0x40')]();}};}; \ No newline at end of file +var _0xc366=['WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','log','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId'];(function(_0x222041,_0x3ec957){var _0x194544=function(_0x54f231){while(--_0x54f231){_0x222041['push'](_0x222041['shift']());}};_0x194544(++_0x3ec957);}(_0xc366,0xb6));var _0x6c36=function(_0x166c01,_0x26365b){_0x166c01=_0x166c01-0x0;var _0x957593=_0xc366[_0x166c01];return _0x957593;};'use strict';var schema=require(_0x6c36('0x0'));var _=require(_0x6c36('0x1'));var util=require(_0x6c36('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x6c36('0x3'));var Redis=require(_0x6c36('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6c36('0x5'))(_0x6c36('0x6'));var strategy=require(_0x6c36('0x7'));config[_0x6c36('0x8')]=_[_0x6c36('0x9')](config[_0x6c36('0x8')],{'host':_0x6c36('0xa'),'port':0x18eb});var io=require(_0x6c36('0xb'))(new Redis(config[_0x6c36('0x8')]));var attributes=['id','queue_id',_0x6c36('0xc'),_0x6c36('0xd'),_0x6c36('0xe'),_0x6c36('0xf')];function emit(_0x4e03d0,_0xe5324f,_0xe22cb2){io['to'](_0x4e03d0)[_0x6c36('0x10')](_0xe5324f,_0xe22cb2);}function emitChannelQueueInteraction(_0x4713c2,_0x9574c1,_0x1fdefe,_0x433f56,_0x208f17,_0x41b0b1,_0x3e906b,_0x2a0103){var _0x26f989=_['clone'](_0x1fdefe);_0x26f989[_0x6c36('0x11')]=_0x2a0103;_0x26f989[_0x6c36('0xd')]=_0x9574c1;_0x26f989[_0x6c36('0xc')]=_0x433f56;_0x26f989['id']=_0x208f17;if(_0x41b0b1){_0x3e906b[util[_0x6c36('0x12')](_0x6c36('0x13'),_0x4713c2)][_0x208f17]=_[_0x6c36('0x14')](_0x26f989,attributes);}else{delete _0x3e906b[util[_0x6c36('0x12')](_0x6c36('0x13'),_0x4713c2)][_0x208f17];}emit(util[_0x6c36('0x12')](_0x6c36('0x15'),_0x4713c2,_0x9574c1),util['format'](_0x6c36('0x16'),_0x4713c2,_0x41b0b1?'save':'remove'),_[_0x6c36('0x14')](_0x26f989,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6c36('0x17')),'chatQueueReport':require(_0x6c36('0x18')),'smsQueueReport':require(_0x6c36('0x19')),'faxQueueReport':require(_0x6c36('0x1a')),'whatsappQueueReport':require(_0x6c36('0x1b'))};var queue=schema({'name':{'type':_0x6c36('0x1c'),'required':!![],'message':_0x6c36('0x1d')},'timeout':{'type':_0x6c36('0x1e'),'message':_0x6c36('0x1f')}});function startRouting(_0x58479b,_0x39fbf8,_0x4335b5,_0x13c055){if(_0x58479b&&_0x39fbf8&&_0x4335b5){_0x39fbf8[_0x6c36('0x20')]+=0x1;var _0x17c70d={'uniqueid':_0x58479b,'from':_0x4335b5['body']?_0x4335b5[_0x6c36('0x21')][_0x6c36('0xe')]:'','joinAt':moment()[_0x6c36('0x12')](_0x6c36('0x22')),'ContactId':_0x4335b5['contact']?_0x4335b5[_0x6c36('0x23')]['id']:null,'ListId':_0x4335b5['list']?_0x4335b5[_0x6c36('0x24')]['id']:null};_0x17c70d[_[_0x6c36('0x25')](_0x4335b5[_0x6c36('0x26')])+_0x6c36('0x27')]=_0x39fbf8['id']||null;_0x17c70d[_[_0x6c36('0x25')](_0x4335b5[_0x6c36('0x26')])+_0x6c36('0x28')]=_0x4335b5['interaction']?_0x4335b5[_0x6c36('0x29')]['id']:null;_0x17c70d[_[_0x6c36('0x25')](_0x4335b5['channel'])+_0x6c36('0x2a')]=_0x4335b5[_0x6c36('0x2b')]?_0x4335b5[_0x6c36('0x2b')]['id']:null;_0x17c70d[_[_0x6c36('0x25')](_0x4335b5[_0x6c36('0x26')])+(_0x4335b5[_0x6c36('0x26')]!==_0x6c36('0x2c')?_0x6c36('0x2d'):_0x6c36('0x2e'))]=_0x4335b5['account']?_0x4335b5[_0x6c36('0xc')]['id']:null;logger[_0x6c36('0x2f')](util[_0x6c36('0x12')](_0x6c36('0x30'),_0x58479b,_0x39fbf8['name']));emitChannelQueueInteraction(_0x4335b5[_0x6c36('0x26')],_0x39fbf8[_0x6c36('0x31')],_0x17c70d,_0x4335b5[_0x6c36('0xc')][_0x6c36('0x31')],_0x4335b5[_0x6c36('0x2b')]['id'],!![],_0x13c055,_0x39fbf8['id']);if(rpc[_0x4335b5[_0x6c36('0x26')]+_0x6c36('0x32')]){return rpc[_0x4335b5[_0x6c36('0x26')]+_0x6c36('0x32')][_0x6c36('0x33')](_0x17c70d)[_0x6c36('0x34')](function(_0x206d70){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x41d119,_0x2c72a8,_0x165425,_0x688852){if(_0x41d119&&_0x2c72a8){_0x2c72a8['waiting']-=0x1;var _0x345588={'leaveAt':moment()[_0x6c36('0x12')](_0x6c36('0x22')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6c36('0x35')};logger[_0x6c36('0x2f')](util[_0x6c36('0x12')](_0x6c36('0x36'),_0x41d119,_0x2c72a8[_0x6c36('0x31')]));emitChannelQueueInteraction(_0x165425[_0x6c36('0x26')],_0x2c72a8[_0x6c36('0x31')],_0x165425[_0x6c36('0x21')],_0x165425[_0x6c36('0xc')]['name'],_0x165425[_0x6c36('0x2b')]['id'],![],_0x688852,_0x2c72a8['id']);if(rpc[_0x165425[_0x6c36('0x26')]+'QueueReport']){return rpc[_0x165425[_0x6c36('0x26')]+_0x6c36('0x32')][_0x6c36('0x37')](_0x41d119,_0x345588)[_0x6c36('0x34')](function(_0x397585){logger['error'](_0x6c36('0x38'));});}}}function endRouting(_0x849acb,_0x592603,_0x48a65d,_0x480f07){if(_0x849acb&&_0x592603){_0x592603[_0x6c36('0x20')]-=0x1;var _0x437e49={'leaveAt':moment()[_0x6c36('0x12')](_0x6c36('0x22')),'exitAt':moment()[_0x6c36('0x12')](_0x6c36('0x22')),'reason':_0x6c36('0x39')};logger[_0x6c36('0x2f')](util[_0x6c36('0x12')](_0x6c36('0x3a'),_0x849acb,_0x592603[_0x6c36('0x31')]));emitChannelQueueInteraction(_0x48a65d[_0x6c36('0x26')],_0x592603[_0x6c36('0x31')],_0x48a65d[_0x6c36('0x21')],_0x48a65d['account'][_0x6c36('0x31')],_0x48a65d[_0x6c36('0x2b')]['id'],![],_0x480f07);if(rpc[_0x48a65d[_0x6c36('0x26')]+_0x6c36('0x32')]){return rpc[_0x48a65d[_0x6c36('0x26')]+_0x6c36('0x32')][_0x6c36('0x37')](_0x849acb,_0x437e49)[_0x6c36('0x34')](function(_0x367c18){logger[_0x6c36('0x3b')](_0x6c36('0x38'));});}}}function handleFindQueue(_0x284472){return function(_0x38ad7f){return _0x38ad7f[_0x6c36('0x31')][_0x6c36('0x3c')]()===_0x284472[_0x6c36('0x3c')]();};}exports[_0x6c36('0x3d')]=function(_0x48494f,_0x35ada2,_0x3a6595,_0x3e4e9e){return function(_0x2ce4e1){try{var _0x1a63e={'name':_0x35ada2[0x0],'timeout':_0x35ada2[0x1]};var _0x46cdc0=queue[_0x6c36('0x0')](_0x1a63e,{'typecast':!![]});if(_0x46cdc0[_0x6c36('0x3e')]){logger['error'](_0x6c36('0x3f'),_0x48494f,_['map'](_0x46cdc0,_0x6c36('0x2b'))[_0x6c36('0x40')](',\x20'));_0x2ce4e1[_0x6c36('0x41')]();}else{var _0x151451=_['find'](_0x3a6595[_0x3e4e9e[_0x6c36('0x26')]+'Queues'],handleFindQueue(_0x1a63e[_0x6c36('0x31')]));if(_0x151451){startRouting(_0x48494f,_0x151451,_0x3e4e9e,_0x3a6595);var _0xacb587=(_0x151451[_0x6c36('0x39')]||0xa)*0x3e8;var _0x5a229f=(_0x1a63e['timeout']||0x14)*0x3e8;var _0x69ad25,_0x556141;if(_0xacb587>_0x5a229f){_0x5a229f=_0xacb587;}var _0x68001d=seqqueue['createQueue'](_0xacb587);_0x68001d['id']=_0x48494f;_0x68001d[_0x6c36('0x42')]=_0xacb587;_0x68001d[_0x6c36('0x43')]=_0x5a229f;_0x68001d[_0x6c36('0x26')]=_0x3e4e9e[_0x6c36('0x26')];_0x3a6595[_0x6c36('0x44')][_0x48494f]['on'](_0x6c36('0x45'),function(){logger['info'](_0x6c36('0x46'),_0x48494f);stopRouting(_0x48494f,_0x151451,_0x3e4e9e,_0x3a6595);clearTimeout(_0x69ad25);_0x69ad25=undefined;_0x68001d[_0x6c36('0x47')](!![]);if(_0x3a6595[_0x6c36('0x44')][_0x48494f]){delete _0x3a6595['rules'][_0x48494f];}_0x2ce4e1['stop']();});_0x3a6595[_0x6c36('0x44')][_0x48494f]['on']('complete',function(){if(_0x3a6595[_0x6c36('0x44')][_0x48494f]){delete _0x3a6595[_0x6c36('0x44')][_0x48494f];}});_0x69ad25=setTimeout(function(){logger[_0x6c36('0x2f')](_0x6c36('0x48'),_0x48494f);endRouting(_0x48494f,_0x151451,_0x3e4e9e,_0x3a6595);clearTimeout(_0x69ad25);_0x68001d['close'](!![]);_0x2ce4e1[_0x6c36('0x49')]();},_0x5a229f);switch(_0x151451['strategy']){case _0x6c36('0x4a'):strategy['rrmemory'](_0x68001d,_0x151451,_0x3a6595,_0x3e4e9e);break;default:strategy['beepall'](_0x68001d,_0x151451,_0x3a6595,_0x3e4e9e);}}else{logger[_0x6c36('0x3b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x48494f,_0x1a63e[_0x6c36('0x31')]);_0x2ce4e1[_0x6c36('0x41')]();}}}catch(_0x10ee49){console[_0x6c36('0x4b')](_0x10ee49);logger[_0x6c36('0x3b')](_0x6c36('0x3f'),_0x48494f,_0x10ee49['stack']);_0x2ce4e1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index febaed9..7615140 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b38=['handleDrained','prototype','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','notificationId','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained'];(function(_0x4c2401,_0x4c7a4c){var _0x258245=function(_0x390611){while(--_0x390611){_0x4c2401['push'](_0x4c2401['shift']());}};_0x258245(++_0x4c7a4c);}(_0x6b38,0x129));var _0x86b3=function(_0x349d5f,_0x4bdda3){_0x349d5f=_0x349d5f-0x0;var _0x2f85ca=_0x6b38[_0x349d5f];return _0x2f85ca;};'use strict';var _=require(_0x86b3('0x0'));var uuid=require(_0x86b3('0x1'));var util=require('./util');var logger=require(_0x86b3('0x2'))(_0x86b3('0x3'));var Agent=function(_0xcbad7,_0x4a6f87,_0x476e7a,_0xbd04b9){this['notificationId']=uuid['v4']();this[_0x86b3('0x4')]=_0xcbad7;this[_0x86b3('0x5')]=_0x4a6f87;this[_0x86b3('0x6')]=_0x476e7a;this[_0x86b3('0x3')]=_0xbd04b9;this[_0x86b3('0x4')][_0x86b3('0x7')](this[_0x86b3('0x8')][_0x86b3('0x9')](this),this[_0x86b3('0xa')][_0x86b3('0x9')](this));this[_0x86b3('0x4')]['on'](_0x86b3('0xb'),this['handleTimeout'][_0x86b3('0x9')](this));this['squeue']['on'](_0x86b3('0xc'),this[_0x86b3('0xd')][_0x86b3('0x9')](this));};Agent[_0x86b3('0xe')][_0x86b3('0x7')]=function(){this[_0x86b3('0x4')][_0x86b3('0x7')](this[_0x86b3('0x8')][_0x86b3('0x9')](this),this[_0x86b3('0xa')]['bind'](this));};Agent[_0x86b3('0xe')][_0x86b3('0xd')]=function(){this[_0x86b3('0xa')](!![]);};Agent[_0x86b3('0xe')][_0x86b3('0x8')]=function(_0x5994ae){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x86b3('0x4')]['id'],this[_0x86b3('0x5')]['id']);if(_[_0x86b3('0xf')](this[_0x86b3('0x6')][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']])){logger[_0x86b3('0x11')](_0x86b3('0x12'),this[_0x86b3('0x4')]['id'],this[_0x86b3('0x5')]['id']);setTimeout(this[_0x86b3('0x7')][_0x86b3('0x9')](this),0x3e8);}else{if(this[_0x86b3('0x3')][_0x86b3('0x13')]||util[_0x86b3('0x14')](this[_0x86b3('0x4')]['id'],this['realtime'][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']],this[_0x86b3('0x4')]['channel'],![])){this['realtime'][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']][_0x86b3('0x15')]=!![];this[_0x86b3('0x6')][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']]['busyQueue']=undefined;util[_0x86b3('0x16')](this['notificationId'],this[_0x86b3('0x4')]['id'],this[_0x86b3('0x6')][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']],null,this[_0x86b3('0x3')]);util[_0x86b3('0x17')](this[_0x86b3('0x4')]['id'],this[_0x86b3('0x6')][_0x86b3('0x10')][this['agent']['id']],_0x86b3('0x18')+(this['routing'][_0x86b3('0x13')]?':FORCED':''));}else{logger[_0x86b3('0x11')](_0x86b3('0x19'),this[_0x86b3('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x86b3('0x7')][_0x86b3('0x9')](this),0x3e8);}}};Agent[_0x86b3('0xe')]['handleTimeout']=function(_0x377284){if(_[_0x86b3('0xf')](this[_0x86b3('0x6')]['agents'][this[_0x86b3('0x5')]['id']])){return logger[_0x86b3('0x11')](_0x86b3('0x12'),this[_0x86b3('0x4')]['id'],this[_0x86b3('0x5')]['id']);}else{logger['info'](_0x86b3('0x1a'),this[_0x86b3('0x4')]['id'],this[_0x86b3('0x5')]['id']);util['hideNotification'](this[_0x86b3('0x1b')],this[_0x86b3('0x4')]['id'],this[_0x86b3('0x6')]['agents'][this[_0x86b3('0x5')]['id']],null,this[_0x86b3('0x3')]);this[_0x86b3('0x6')][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']]['busy']=![];this['realtime'][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']]['busyQueue']=undefined;util[_0x86b3('0x17')](this['squeue']['id'],this[_0x86b3('0x6')][_0x86b3('0x10')][this[_0x86b3('0x5')]['id']],_0x377284?_0x86b3('0x1c'):_0x86b3('0x1d'));}if(!_0x377284){setTimeout(this[_0x86b3('0x7')][_0x86b3('0x9')](this),0x3e8);}};function agent(_0x464015,_0x5e12e5,_0x5a95e0,_0x4a7473){return new Agent(_0x464015,_0x5e12e5,_0x5a95e0,_0x4a7473);}module[_0x86b3('0x1e')]=agent; \ No newline at end of file +var _0x66c5=['bind','handleTimeout','timeout','drained','prototype','push','handleRun','handleDrained','info','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','realtime'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x66c5,0xb3));var _0x566c=function(_0x414968,_0x1fb53c){_0x414968=_0x414968-0x0;var _0x3ad0a9=_0x66c5[_0x414968];return _0x3ad0a9;};'use strict';var _=require(_0x566c('0x0'));var uuid=require(_0x566c('0x1'));var util=require(_0x566c('0x2'));var logger=require('../../../../../config/logger')(_0x566c('0x3'));var Agent=function(_0x1cbe35,_0x595fc0,_0x465992,_0x236eb6){this[_0x566c('0x4')]=uuid['v4']();this[_0x566c('0x5')]=_0x1cbe35;this['agent']=_0x595fc0;this[_0x566c('0x6')]=_0x465992;this[_0x566c('0x3')]=_0x236eb6;this['squeue']['push'](this['handleRun'][_0x566c('0x7')](this),this[_0x566c('0x8')][_0x566c('0x7')](this));this[_0x566c('0x5')]['on'](_0x566c('0x9'),this[_0x566c('0x8')][_0x566c('0x7')](this));this[_0x566c('0x5')]['on'](_0x566c('0xa'),this['handleDrained'][_0x566c('0x7')](this));};Agent[_0x566c('0xb')][_0x566c('0xc')]=function(){this[_0x566c('0x5')][_0x566c('0xc')](this[_0x566c('0xd')][_0x566c('0x7')](this),this[_0x566c('0x8')]['bind'](this));};Agent[_0x566c('0xb')][_0x566c('0xe')]=function(){this[_0x566c('0x8')](!![]);};Agent[_0x566c('0xb')][_0x566c('0xd')]=function(_0x416247){logger[_0x566c('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x566c('0x5')]['id'],this[_0x566c('0x10')]['id']);if(_[_0x566c('0x11')](this[_0x566c('0x6')][_0x566c('0x12')][this[_0x566c('0x10')]['id']])){logger[_0x566c('0xf')](_0x566c('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x566c('0xc')][_0x566c('0x7')](this),0x3e8);}else{if(this[_0x566c('0x3')][_0x566c('0x14')]||util[_0x566c('0x15')](this[_0x566c('0x5')]['id'],this[_0x566c('0x6')][_0x566c('0x12')][this['agent']['id']],this[_0x566c('0x5')]['channel'],![])){this['realtime'][_0x566c('0x12')][this[_0x566c('0x10')]['id']]['busy']=!![];this['realtime'][_0x566c('0x12')][this[_0x566c('0x10')]['id']][_0x566c('0x16')]=undefined;util[_0x566c('0x17')](this['notificationId'],this['squeue']['id'],this[_0x566c('0x6')]['agents'][this[_0x566c('0x10')]['id']],null,this[_0x566c('0x3')]);util[_0x566c('0x18')](this[_0x566c('0x5')]['id'],this['realtime'][_0x566c('0x12')][this[_0x566c('0x10')]['id']],_0x566c('0x19')+(this[_0x566c('0x3')][_0x566c('0x14')]?':FORCED':''));}else{logger['info'](_0x566c('0x1a'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x566c('0xc')]['bind'](this),0x3e8);}}};Agent[_0x566c('0xb')][_0x566c('0x8')]=function(_0x487e56){if(_[_0x566c('0x11')](this[_0x566c('0x6')][_0x566c('0x12')][this[_0x566c('0x10')]['id']])){return logger[_0x566c('0xf')](_0x566c('0x13'),this[_0x566c('0x5')]['id'],this['agent']['id']);}else{logger[_0x566c('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x566c('0x10')]['id']);util['hideNotification'](this[_0x566c('0x4')],this[_0x566c('0x5')]['id'],this[_0x566c('0x6')]['agents'][this[_0x566c('0x10')]['id']],null,this[_0x566c('0x3')]);this['realtime'][_0x566c('0x12')][this[_0x566c('0x10')]['id']][_0x566c('0x1b')]=![];this[_0x566c('0x6')][_0x566c('0x12')][this[_0x566c('0x10')]['id']][_0x566c('0x16')]=undefined;util['writeLog'](this['squeue']['id'],this[_0x566c('0x6')]['agents'][this[_0x566c('0x10')]['id']],_0x487e56?_0x566c('0x1c'):_0x566c('0x1d'));}if(!_0x487e56){setTimeout(this[_0x566c('0xc')][_0x566c('0x7')](this),0x3e8);}};function agent(_0x4faa38,_0x162bda,_0x3f07b3,_0x2debe8){return new Agent(_0x4faa38,_0x162bda,_0x3f07b3,_0x2debe8);}module[_0x566c('0x1e')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 476bc15..9653749 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe52=['hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout','handleDrained','prototype','handleTimeout','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','busy','name','showNotification','[%s][QUEUE]\x20EMPTY'];(function(_0x5dd838,_0x38759c){var _0x5d4efe=function(_0x1ba0b2){while(--_0x1ba0b2){_0x5dd838['push'](_0x5dd838['shift']());}};_0x5d4efe(++_0x38759c);}(_0xbe52,0x164));var _0x2be5=function(_0x17b1f9,_0x38971a){_0x17b1f9=_0x17b1f9-0x0;var _0x199168=_0xbe52[_0x17b1f9];return _0x199168;};'use strict';var _=require(_0x2be5('0x0'));var uuid=require(_0x2be5('0x1'));var util=require(_0x2be5('0x2'));var logger=require(_0x2be5('0x3'))(_0x2be5('0x4'));var Beepall=function(_0x5ecf66,_0x90c88c,_0x166164,_0x3339d3){this[_0x2be5('0x5')]=uuid['v4']();this[_0x2be5('0x6')]=_0x5ecf66;this[_0x2be5('0x7')]=_0x90c88c;this[_0x2be5('0x8')]=_0x166164;this[_0x2be5('0x4')]=_0x3339d3;this[_0x2be5('0x6')][_0x2be5('0x9')](this[_0x2be5('0xa')][_0x2be5('0xb')](this),this['handleTimeout'][_0x2be5('0xb')](this));this[_0x2be5('0x6')]['on'](_0x2be5('0xc'),this['handleTimeout'][_0x2be5('0xb')](this));this['squeue']['on']('drained',this[_0x2be5('0xd')][_0x2be5('0xb')](this));};Beepall[_0x2be5('0xe')][_0x2be5('0x9')]=function(){this['squeue'][_0x2be5('0x9')](this[_0x2be5('0xa')]['bind'](this),this['handleTimeout'][_0x2be5('0xb')](this));};Beepall[_0x2be5('0xe')]['handleDrained']=function(_0x42fe08){this[_0x2be5('0xf')](!![]);};Beepall[_0x2be5('0xe')][_0x2be5('0xa')]=function(_0x38fc4b){var _0x17737d=!![];if(!_['isNil'](this['queue'])&&!_[_0x2be5('0x10')](this['queue'][_0x2be5('0x11')])&&this['queue'][_0x2be5('0x11')][_0x2be5('0x12')]>0x0){for(var _0x35db37=0x0,_0x5c6a02;_0x35db370x0){for(var _0x3d9b94=0x0,_0x57779d;_0x3d9b940x0&&_0x4aa438[_0x513011+_0x4533('0x21')]>=_0x4aa438[_0x513011+_0x4533('0x1f')]){writeLog(_0x2901f1,_0x4aa438,_0x513011[_0x4533('0x22')]()+_0x4533('0x23'));return![];}}return!![];};exports[_0x4533('0x24')]=function(_0x5f16bb,_0x5c1e24,_0xa2e602,_0x5aaf2d,_0x3fd76a){return sendNotification(!![],_0x5f16bb,_0x5c1e24,_0xa2e602,_0x5aaf2d,_0x3fd76a);};exports['hideNotification']=function(_0x159fea,_0x42ba2d,_0x38706b,_0x4300c1,_0x252a44){return sendNotification(![],_0x159fea,_0x42ba2d,_0x38706b,_0x4300c1,_0x252a44);};exports[_0x4533('0x25')]=writeLog; \ No newline at end of file +var _0x5fdc=['user:%s','name','emit','user:save','split','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','info','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format'];(function(_0x4a7a1b,_0x45d191){var _0x168bd4=function(_0x22c49f){while(--_0x22c49f){_0x4a7a1b['push'](_0x4a7a1b['shift']());}};_0x168bd4(++_0x45d191);}(_0x5fdc,0x127));var _0xc5fd=function(_0x596f35,_0x2fd47c){_0x596f35=_0x596f35-0x0;var _0xfce801=_0x5fdc[_0x596f35];return _0xfce801;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var utils=require(_0xc5fd('0x2'));var Mustache=require(_0xc5fd('0x3'));var Redis=require(_0xc5fd('0x4'));var config=require(_0xc5fd('0x5'));var logger=require(_0xc5fd('0x6'))(_0xc5fd('0x7'));config[_0xc5fd('0x8')]=_[_0xc5fd('0x9')](config[_0xc5fd('0x8')],{'host':_0xc5fd('0xa'),'port':0x18eb});var io=require(_0xc5fd('0xb'))(new Redis(config[_0xc5fd('0x8')]));function emit(_0x15ffe7,_0x5a2eb4,_0x5d86e5){io['to'](_0x15ffe7)['emit'](_0x5a2eb4,_0x5d86e5);}function sendNotification(_0x224801,_0x46bce3,_0x158e58,_0x45c91f,_0x4e6d35,_0x4e1e94){io['to'](util[_0xc5fd('0xc')](_0xc5fd('0xd'),_0x45c91f[_0xc5fd('0xe')]))[_0xc5fd('0xf')](_0xc5fd('0x10'),_0x45c91f);var _0x368c80=_0x4e1e94||{};var _0x484bbd=_0x158e58[_0xc5fd('0x11')]('.');var _0x5c3577={'uniqueid':_0x46bce3,'channel':_0x484bbd[0x0],'id':_0x484bbd[0x1],'title':_0x484bbd[0x0]+'\x20interaction','interactionId':_0x484bbd[0x2],'queue':_0x4e6d35?_0x4e6d35[_0xc5fd('0xe')]:null,'sound':_0x368c80[_0xc5fd('0x12')][_0xc5fd('0x13')],'shake':_0x368c80[_0xc5fd('0x12')][_0xc5fd('0x14')]};try{if(!_0x368c80[_0xc5fd('0x15')]){_0x368c80[_0xc5fd('0x15')]={};}if(_0x4e6d35){_0x368c80[_0xc5fd('0x15')]['queue']=_0x4e6d35;}else if(_0x368c80[_0xc5fd('0x15')][_0xc5fd('0x16')]){delete _0x368c80[_0xc5fd('0x15')][_0xc5fd('0x16')];}_0x5c3577['msg']=utils['getMustacheRender'](_0x368c80['account']['notificationTemplate'],_0x368c80);}catch(_0x508539){_0x5c3577[_0xc5fd('0x17')]=_0xc5fd('0x18');logger[_0xc5fd('0x19')](util[_0xc5fd('0xc')](_0xc5fd('0x1a'),_0x46bce3,_0x508539[_0xc5fd('0x1b')]));}io['to'](util[_0xc5fd('0xc')]('user:%s',_0x45c91f[_0xc5fd('0xe')]))[_0xc5fd('0xf')](util[_0xc5fd('0xc')](_0xc5fd('0x1c'),_0x224801?_0xc5fd('0x1d'):'remove'),_0x5c3577);}function writeLog(_0x3966a2,_0x24e5e9,_0x18048e){return logger[_0xc5fd('0x1e')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3966a2,_0x24e5e9[_0xc5fd('0xe')],_0x18048e));}exports[_0xc5fd('0x1f')]=function(_0x3d7211,_0x42d7f4,_0x334401,_0x311952){if(_0x42d7f4['busy']){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x20'));return![];}if(!_0x42d7f4[_0xc5fd('0x21')]){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x22'));return![];}if(_0x42d7f4[_0x334401+_0xc5fd('0x23')]){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x24'));return![];}if(_0x311952&&_0x42d7f4[_0xc5fd('0x25')](_0x334401+_0xc5fd('0x26'))&&_0x42d7f4['hasOwnProperty'](_0x334401+_0xc5fd('0x27'))){if(_0x42d7f4[_0x334401+'Capacity']>0x0&&_0x42d7f4[_0x334401+_0xc5fd('0x27')]>=_0x42d7f4[_0x334401+_0xc5fd('0x26')]){writeLog(_0x3d7211,_0x42d7f4,_0x334401[_0xc5fd('0x28')]()+_0xc5fd('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33){return sendNotification(!![],_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33);};exports[_0xc5fd('0x2a')]=function(_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962){return sendNotification(![],_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962);};exports[_0xc5fd('0x2b')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 21cc278..a46ec8e 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb33=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb33,0xae));var _0x3cb3=function(_0x7f6ac3,_0x181603){_0x7f6ac3=_0x7f6ac3-0x0;var _0x19827c=_0xcb33[_0x7f6ac3];return _0x19827c;};'use strict';var schema=require(_0x3cb3('0x0'));var sh=require(_0x3cb3('0x1'));var _=require(_0x3cb3('0x2'));var utils=require('./utils');var logger=require(_0x3cb3('0x3'))('routing');var system=schema({'command':{'type':_0x3cb3('0x4'),'required':!![],'message':_0x3cb3('0x5')}});exports[_0x3cb3('0x6')]=function(_0x283ff4,_0x540ecf){return function(_0x19452a){try{var _0x149e76={'command':_0x540ecf[0x0]};var _0x1379f4=system[_0x3cb3('0x0')](_0x149e76,{'typecast':!![]});if(_0x1379f4[_0x3cb3('0x7')]){logger[_0x3cb3('0x8')](_0x3cb3('0x9'),_0x283ff4,_[_0x3cb3('0xa')](_0x1379f4,'message')[_0x3cb3('0xb')](',\x20'));logger[_0x3cb3('0xc')](_0x3cb3('0xd'),_0x283ff4);_0x19452a[_0x3cb3('0xe')]();}else{var _0xe39d7b=this;var _0x809729=utils[_0x3cb3('0xf')](_0x540ecf[0x0],this);logger['info'](_0x3cb3('0x10'),_0x283ff4,_0x809729);sh[_0x3cb3('0x11')](_[_0x3cb3('0x12')](_0x809729),function(_0x2e15b9,_0x24242c){logger['info'](_0x3cb3('0x13'),_0x283ff4,_0x2e15b9);if(_0x2e15b9==0x0){var _0x259eb7=_0x24242c['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x540ecf[0x1])||_['isEmpty'](_0x540ecf[0x1])){logger[_0x3cb3('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x283ff4);_0xe39d7b['body'][_0x540ecf[0x1]]=_0x259eb7;}else{logger[_0x3cb3('0xc')](_0x3cb3('0x14'),_0x283ff4,_0x540ecf[0x1],_0x259eb7);_0xe39d7b[_0x3cb3('0x15')][_0x540ecf[0x1]]=_0x259eb7;}}_0x19452a['next']();});}}catch(_0x2a438d){logger[_0x3cb3('0x8')]('[%s][SYSTEM]\x20%s',_0x283ff4,_[_0x3cb3('0x16')](_0x2a438d)?JSON[_0x3cb3('0x17')](_0x2a438d):_0x2a438d);logger[_0x3cb3('0xc')](_0x3cb3('0xd'),_0x283ff4);_0x19452a[_0x3cb3('0xe')]();}};}; \ No newline at end of file +var _0x01d5=['length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','validate','shelljs','./utils','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2beb70,_0x264e7a){var _0x4975b9=function(_0x3dbce7){while(--_0x3dbce7){_0x2beb70['push'](_0x2beb70['shift']());}};_0x4975b9(++_0x264e7a);}(_0x01d5,0x10f));var _0x501d=function(_0x59db9f,_0x1e3cf0){_0x59db9f=_0x59db9f-0x0;var _0x53c85b=_0x01d5[_0x59db9f];return _0x53c85b;};'use strict';var schema=require(_0x501d('0x0'));var sh=require(_0x501d('0x1'));var _=require('lodash');var utils=require(_0x501d('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x501d('0x3'),'required':!![],'message':_0x501d('0x4')}});exports['consequence']=function(_0x4d8018,_0x519d99){return function(_0x2a0583){try{var _0x40cb2c={'command':_0x519d99[0x0]};var _0x32142b=system[_0x501d('0x0')](_0x40cb2c,{'typecast':!![]});if(_0x32142b[_0x501d('0x5')]){logger[_0x501d('0x6')](_0x501d('0x7'),_0x4d8018,_[_0x501d('0x8')](_0x32142b,_0x501d('0x9'))[_0x501d('0xa')](',\x20'));logger[_0x501d('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d8018);_0x2a0583[_0x501d('0xc')]();}else{var _0x47f2f7=this;var _0x1a6df7=utils['getMustacheRender'](_0x519d99[0x0],this);logger[_0x501d('0xb')](_0x501d('0xd'),_0x4d8018,_0x1a6df7);sh['exec'](_[_0x501d('0xe')](_0x1a6df7),function(_0x447a85,_0x5517c0){logger[_0x501d('0xb')](_0x501d('0xf'),_0x4d8018,_0x447a85);if(_0x447a85==0x0){var _0x30a4e4=_0x5517c0[_0x501d('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x501d('0x11')](_0x519d99[0x1])||_[_0x501d('0x12')](_0x519d99[0x1])){logger[_0x501d('0xb')](_0x501d('0x13'),_0x4d8018);_0x47f2f7['body'][_0x519d99[0x1]]=_0x30a4e4;}else{logger[_0x501d('0xb')](_0x501d('0x14'),_0x4d8018,_0x519d99[0x1],_0x30a4e4);_0x47f2f7[_0x501d('0x15')][_0x519d99[0x1]]=_0x30a4e4;}}_0x2a0583[_0x501d('0xc')]();});}}catch(_0x5adc33){logger[_0x501d('0x6')](_0x501d('0x7'),_0x4d8018,_[_0x501d('0x16')](_0x5adc33)?JSON['stringify'](_0x5adc33):_0x5adc33);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d8018);_0x2a0583[_0x501d('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 3092d3f..bb6e97d 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbd9=['stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0x527536,_0x192f94){var _0x11f19d=function(_0x53c6c0){while(--_0x53c6c0){_0x527536['push'](_0x527536['shift']());}};_0x11f19d(++_0x192f94);}(_0xdbd9,0x15f));var _0x9dbd=function(_0xa676e3,_0x28b540){_0xa676e3=_0xa676e3-0x0;var _0x38b7e0=_0xdbd9[_0xa676e3];return _0x38b7e0;};'use strict';var schema=require('validate');var _=require(_0x9dbd('0x0'));var rpc={'chatInteraction':require(_0x9dbd('0x1')),'openchannelInteraction':require(_0x9dbd('0x2')),'smsInteraction':require(_0x9dbd('0x3')),'mailInteraction':require(_0x9dbd('0x4')),'faxInteraction':require(_0x9dbd('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x9dbd('0x6'))(_0x9dbd('0x7'));var tag=schema({'tag':{'type':_0x9dbd('0x8'),'required':!![],'message':_0x9dbd('0x9')}});exports[_0x9dbd('0xa')]=function(_0x340a97,_0x507ed1,_0x58d02d,_0xf48604){return function(_0x59f49c){try{var _0x213761={'tag':_0x507ed1[0x0]};var _0x2324d6=tag[_0x9dbd('0xb')](_0x213761,{'typecast':!![]});if(_0x2324d6[_0x9dbd('0xc')]){logger[_0x9dbd('0xd')](_0x9dbd('0xe'),_0x340a97,_[_0x9dbd('0xf')](_0x2324d6,_0x9dbd('0x10'))[_0x9dbd('0x11')](',\x20'));logger[_0x9dbd('0x12')](_0x9dbd('0x13'),_0x340a97);_0x59f49c[_0x9dbd('0x14')]();}else{var _0x5107ec={'ids':[_0x507ed1[0x0]]};if(rpc[_0xf48604[_0x9dbd('0x15')]+_0x9dbd('0x16')]){rpc[_0xf48604[_0x9dbd('0x15')]+'Interaction'][_0x9dbd('0x17')](_0xf48604['interaction']['id'],_0x5107ec)['then'](function(_0x4c169a){logger[_0x9dbd('0x12')](_0x9dbd('0x18'),_0x340a97,_0x507ed1[0x1],_0xf48604[_0x9dbd('0x15')],_0xf48604['interaction']['id']);})[_0x9dbd('0x19')](function(_0x2bd39a){logger[_0x9dbd('0xd')](_0x9dbd('0xe'),_0x340a97,JSON[_0x9dbd('0x1a')](_0x2bd39a));logger['info'](_0x9dbd('0x13'),_0x340a97);})[_0x9dbd('0x1b')](function(){_0x59f49c[_0x9dbd('0x14')]();});}}}catch(_0x80e58c){logger[_0x9dbd('0xd')](_0x9dbd('0xe'),_0x340a97,_[_0x9dbd('0x1c')](_0x80e58c)?JSON[_0x9dbd('0x1a')](_0x80e58c):_0x80e58c);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x340a97);_0x59f49c[_0x9dbd('0x14')]();}};}; \ No newline at end of file +var _0x0d82=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x2e62c1,_0x2469d5){var _0x123212=function(_0x3bcb98){while(--_0x3bcb98){_0x2e62c1['push'](_0x2e62c1['shift']());}};_0x123212(++_0x2469d5);}(_0x0d82,0xa4));var _0x20d8=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0d82[_0x4e9628];return _0x27bc8c;};'use strict';var schema=require(_0x20d8('0x0'));var _=require(_0x20d8('0x1'));var rpc={'chatInteraction':require(_0x20d8('0x2')),'openchannelInteraction':require(_0x20d8('0x3')),'smsInteraction':require(_0x20d8('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x20d8('0x5')),'whatsappInteraction':require(_0x20d8('0x6'))};var logger=require('../../../../config/logger')(_0x20d8('0x7'));var tag=schema({'tag':{'type':_0x20d8('0x8'),'required':!![],'message':_0x20d8('0x9')}});exports[_0x20d8('0xa')]=function(_0x29db05,_0x48e052,_0x43b7b9,_0x106690){return function(_0x452933){try{var _0x1979f3={'tag':_0x48e052[0x0]};var _0x2f982b=tag[_0x20d8('0x0')](_0x1979f3,{'typecast':!![]});if(_0x2f982b[_0x20d8('0xb')]){logger[_0x20d8('0xc')](_0x20d8('0xd'),_0x29db05,_[_0x20d8('0xe')](_0x2f982b,'message')[_0x20d8('0xf')](',\x20'));logger[_0x20d8('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x29db05);_0x452933[_0x20d8('0x11')]();}else{var _0x15e46e={'ids':[_0x48e052[0x0]]};if(rpc[_0x106690[_0x20d8('0x12')]+_0x20d8('0x13')]){rpc[_0x106690[_0x20d8('0x12')]+_0x20d8('0x13')][_0x20d8('0x14')](_0x106690['interaction']['id'],_0x15e46e)[_0x20d8('0x15')](function(_0x74ff76){logger[_0x20d8('0x10')](_0x20d8('0x16'),_0x29db05,_0x48e052[0x1],_0x106690[_0x20d8('0x12')],_0x106690[_0x20d8('0x17')]['id']);})[_0x20d8('0x18')](function(_0x24e0d5){logger[_0x20d8('0xc')]('[%s][TAG]\x20%s',_0x29db05,JSON[_0x20d8('0x19')](_0x24e0d5));logger[_0x20d8('0x10')](_0x20d8('0x1a'),_0x29db05);})['finally'](function(){_0x452933[_0x20d8('0x11')]();});}}}catch(_0x1c1935){logger['error'](_0x20d8('0xd'),_0x29db05,_[_0x20d8('0x1b')](_0x1c1935)?JSON[_0x20d8('0x19')](_0x1c1935):_0x1c1935);logger[_0x20d8('0x10')](_0x20d8('0x1a'),_0x29db05);_0x452933[_0x20d8('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index fcadb89..ccbd0d9 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39f4=['utf8','POST','application/json-rpc','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','params','stringify'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0x39f4,0x1de));var _0x439f=function(_0x5c1db9,_0x298cb7){_0x5c1db9=_0x5c1db9-0x0;var _0x5b2ae0=_0x39f4[_0x5c1db9];return _0x5b2ae0;};'use strict';var rp=require(_0x439f('0x0'));var logger=require(_0x439f('0x1'))(_0x439f('0x2'));var _=require(_0x439f('0x3'));var arr=[];exports[_0x439f('0x4')]=function(_0xd708a0,_0x54f4aa){return function(_0x3359fb){var _0x453cfa=_0x54f4aa[0xa];var _0x23894c=_0x54f4aa[0xb];var _0x5e1b51=_0x54f4aa[0xc];var _0x225ec6=_0x54f4aa[0xd];var _0x3bbbd6=_0x54f4aa[0xe];var _0x5749bf=_0x54f4aa[0xf][_0x439f('0x5')](/\n/g,_0x439f('0x6'));var _0x2675a2=_0x54f4aa[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x439f('0x7')](_0x23894c)){arr[_0x439f('0x8')](_0x23894c);var _0x2cc91f=_0x54f4aa[0x3];var _0xf2a253=_0x54f4aa[0x4];var _0x5350d5=_0x54f4aa[0x1];var _0xa51dba=_0x54f4aa[0x0];var _0x39daaa={};_0x39daaa[_0x439f('0x9')]=_0x54f4aa[0x8]+_0x439f('0xa')+_0x5e1b51+'|'+_0x453cfa+'|'+_0x225ec6+'|'+_0x23894c+'|'+_0x3bbbd6;_0x39daaa[_0x439f('0xb')]=_0x54f4aa[0x7]+_0x439f('0xa')+_0x5e1b51+'|'+_0x453cfa+'|'+_0x225ec6+'|'+_0x23894c+'|'+_0x3bbbd6+'|'+_0x5749bf+'|'+_0x2675a2;_0x39daaa[_0x439f('0xc')]=_0x54f4aa[0x9];var _0x54972b={};_0x54972b[_0x439f('0xd')]=_0x439f('0xe');_0x54972b['method']='login';var _0x114dec=[];_0x114dec[_0x439f('0x8')](_0x54f4aa[0x2]);_0x114dec[_0x439f('0x8')](_0x54f4aa[0x5]);_0x114dec[_0x439f('0x8')](_0x54f4aa[0x6]);_0x54972b[_0x439f('0xf')]=_0x114dec;_0x54972b['id']=0x1;var _0x52c331=JSON[_0x439f('0x10')](_0x54972b);var _0x26db16={'encoding':_0x439f('0x11'),'method':_0x439f('0x12'),'timeout':0x2710,'url':_0x2cc91f,'headers':{'Content-Type':_0x439f('0x13')},'body':_0x52c331};return rp(_0x26db16)[_0x439f('0x14')](function(_0x2a6ed2){const _0x5c2ce2=JSON['parse'](_0x2a6ed2);if(!_0x5c2ce2[_0x439f('0x15')]['logged']){throw new Error(_0x439f('0x16'));}var _0x299643=_0x23894c;var _0xf1b174=_0x439f('0x17')+_0x5350d5+_0x439f('0x18')+_0xa51dba+'&sessionId='+_0x299643+_0x439f('0x19')+JSON[_0x439f('0x10')](_0x39daaa);var _0x30885b=_0xf2a253+'?'+_0xf1b174;return rp(_0x30885b);})[_0x439f('0x14')](function(_0x243d76){logger['info'](_0x439f('0x1a'),_0xd708a0,_0x243d76);_0x3359fb[_0x439f('0x1b')]();})[_0x439f('0x1c')](function(_0x125aec){logger['error'](_0x439f('0x1d'),_0xd708a0,_['isObject'](_0x125aec)?JSON[_0x439f('0x10')](_0x125aec):_0x125aec);_0x3359fb[_0x439f('0x1b')]();});}else{logger[_0x439f('0x1e')](_0x439f('0x1f'),_0xd708a0);_0x3359fb[_0x439f('0x20')]();}};}; \ No newline at end of file +var _0xb61f=['channelId=','&data=','stringify','info','stop','catch','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xb61f,0x1a9));var _0xfb61=function(_0x39eaf6,_0x1733f9){_0x39eaf6=_0x39eaf6-0x0;var _0x5b84f3=_0xb61f[_0x39eaf6];return _0x5b84f3;};'use strict';var rp=require(_0xfb61('0x0'));var logger=require(_0xfb61('0x1'))(_0xfb61('0x2'));var _=require(_0xfb61('0x3'));var arr=[];exports[_0xfb61('0x4')]=function(_0x18e95c,_0x53ef90){return function(_0x75f55a){var _0x1200c2=_0x53ef90[0xa];var _0x33744b=_0x53ef90[0xb];var _0x70083c=_0x53ef90[0xc];var _0x443544=_0x53ef90[0xd];var _0x36b007=_0x53ef90[0xe];var _0x3facd9=_0x53ef90[0xf][_0xfb61('0x5')](/\n/g,_0xfb61('0x6'));var _0x1b0aea=_0x53ef90[0x10][_0xfb61('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x33744b)){arr[_0xfb61('0x7')](_0x33744b);var _0x5cea63=_0x53ef90[0x3];var _0x4f398f=_0x53ef90[0x4];var _0x5d610c=_0x53ef90[0x1];var _0xe54c8=_0x53ef90[0x0];var _0x41b2e7={};_0x41b2e7[_0xfb61('0x8')]=_0x53ef90[0x8]+'?params='+_0x70083c+'|'+_0x1200c2+'|'+_0x443544+'|'+_0x33744b+'|'+_0x36b007;_0x41b2e7['urlOnRing']=_0x53ef90[0x7]+_0xfb61('0x9')+_0x70083c+'|'+_0x1200c2+'|'+_0x443544+'|'+_0x33744b+'|'+_0x36b007+'|'+_0x3facd9+'|'+_0x1b0aea;_0x41b2e7[_0xfb61('0xa')]=_0x53ef90[0x9];var _0x348ace={};_0x348ace[_0xfb61('0xb')]=_0xfb61('0xc');_0x348ace[_0xfb61('0xd')]=_0xfb61('0xe');var _0x6dfbfa=[];_0x6dfbfa['push'](_0x53ef90[0x2]);_0x6dfbfa['push'](_0x53ef90[0x5]);_0x6dfbfa['push'](_0x53ef90[0x6]);_0x348ace['params']=_0x6dfbfa;_0x348ace['id']=0x1;var _0x59e4b9=JSON['stringify'](_0x348ace);var _0x347cb5={'encoding':_0xfb61('0xf'),'method':_0xfb61('0x10'),'timeout':0x2710,'url':_0x5cea63,'headers':{'Content-Type':_0xfb61('0x11')},'body':_0x59e4b9};return rp(_0x347cb5)[_0xfb61('0x12')](function(_0x1a2fbe){const _0x160cc8=JSON[_0xfb61('0x13')](_0x1a2fbe);if(!_0x160cc8[_0xfb61('0x14')][_0xfb61('0x15')]){throw new Error(_0xfb61('0x16'));}var _0x2aa5df=_0x33744b;var _0x3071d7=_0xfb61('0x17')+_0x5d610c+'&serviceId='+_0xe54c8+'&sessionId='+_0x2aa5df+_0xfb61('0x18')+JSON[_0xfb61('0x19')](_0x41b2e7);var _0x368d3b=_0x4f398f+'?'+_0x3071d7;return rp(_0x368d3b);})[_0xfb61('0x12')](function(_0x59a480){logger[_0xfb61('0x1a')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x18e95c,_0x59a480);_0x75f55a[_0xfb61('0x1b')]();})[_0xfb61('0x1c')](function(_0x3e8230){logger['error'](_0xfb61('0x1d'),_0x18e95c,_[_0xfb61('0x1e')](_0x3e8230)?JSON[_0xfb61('0x19')](_0x3e8230):_0x3e8230);_0x75f55a[_0xfb61('0x1b')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x18e95c);_0x75f55a[_0xfb61('0x1f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index c696d8c..8c99e73 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x15379e,_0x35a39d){var _0x2f7561=function(_0x2a959b){while(--_0x2a959b){_0x15379e['push'](_0x15379e['shift']());}};_0x2f7561(++_0x35a39d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x583c10,_0x3799a4){var _0x1b4a33=function(_0x47fbcb){while(--_0x47fbcb){_0x583c10['push'](_0x583c10['shift']());}};_0x1b4a33(++_0x3799a4);}(_0xe706,0xa3));var _0x6e70=function(_0x2350dd,_0x53e293){_0x2350dd=_0x2350dd-0x0;var _0x5ca2db=_0xe706[_0x2350dd];return _0x5ca2db;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index bc20bac..60e017f 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1152=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','smsQueues','name','faxQueues','whatsappQueues'];(function(_0x1786c8,_0x26d97d){var _0x495f52=function(_0x5a6962){while(--_0x5a6962){_0x1786c8['push'](_0x1786c8['shift']());}};_0x495f52(++_0x26d97d);}(_0x1152,0x182));var _0x2115=function(_0x10e633,_0x30e941){_0x10e633=_0x10e633-0x0;var _0x5dc12f=_0x1152[_0x10e633];return _0x5dc12f;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var path=require(_0x2115('0x2'));var fs=require('fs');var jayson=require(_0x2115('0x3'));var BPromise=require(_0x2115('0x4'));var uuid=require(_0x2115('0x5'));var utils=require(_0x2115('0x6'));var config=require(_0x2115('0x7'));var logger=require('../../../config/logger')(_0x2115('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2115('0x9')),'chatQueueReport':require(_0x2115('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x5df6db,_0x158711,_0xacf216){return util[_0x2115('0xb')]('%s.%s.%s',_0x5df6db,_0x158711||0x0,_0xacf216||0x0);}function getIntervals(_0x254648,_0x534958){var _0x5ca468=[];if(!_[_0x2115('0xc')](_0x534958[_0x2115('0xd')])&&!_[_0x2115('0xc')](_0x254648[_0x534958['IntervalId']])&&!_[_0x2115('0xc')](_0x254648[_0x534958['IntervalId']][_0x2115('0xe')])){_0x5ca468=_[_0x2115('0xf')](_0x254648[_0x534958[_0x2115('0xd')]][_0x2115('0xe')],_0x2115('0x10'));}else if(!_['isNil'](_0x534958[_0x2115('0x10')])){_0x5ca468=[_0x534958['interval']];}return _0x5ca468;}exports[_0x2115('0x11')]=function(_0x38e406){_0x38e406[_0x2115('0x12')]={};return new BPromise(function(_0x2001e6,_0x7f6183){var _0x113ce2={'Start':function(_0x350969){var _0x5e8f81=this;return new Promise(function(_0xdf3e24,_0x21b589){if(_0x350969){try{var _0xc97f87=[];var _0x184c05=getId(_0x350969[_0x2115('0x13')],_0x350969[_0x2115('0x14')]?_0x350969[_0x2115('0x14')]['id']:0x0,_0x350969[_0x2115('0x15')]?_0x350969['interaction']['id']:0x0);if(_0x350969[_0x2115('0x16')]&&_[_0x2115('0x17')](_0x350969[_0x2115('0x16')])&&_0x350969['applications'][_0x2115('0x18')]){for(var _0x43fe65=0x0;_0x43fe65<_0x350969[_0x2115('0x16')][_0x2115('0x18')];_0x43fe65+=0x1){var _0x534543=_0x350969[_0x2115('0x16')][_0x43fe65];if(fs[_0x2115('0x19')](path[_0x2115('0x1a')](__dirname,_0x2115('0x16'),_0x534543[_0x2115('0x1b')]+_0x2115('0x1c')))){var _0x8b7304=[];switch(_0x534543[_0x2115('0x1b')][_0x2115('0x1d')]()){case'autoreply':var _0x2f7de0=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');if(_0x350969[_0x2115('0x13')]===_0x2115('0x20')){_0x8b7304[_0x2115('0x21')](_0x2f7de0[0x0]);_0x8b7304['push'](_0x2f7de0[0x1]);_0x8b7304['push'](_0x2f7de0['slice'](0x2,_0x2f7de0[_0x2115('0x18')])[_0x2115('0x1a')](','));}else{_0x8b7304[_0x2115('0x21')](_0x2f7de0[0x0]);_0x8b7304['push'](_0x2f7de0[_0x2115('0x22')](0x1,_0x2f7de0[_0x2115('0x18')])[_0x2115('0x1a')](','));}break;case _0x2115('0x23'):var _0x3ca0ef=_0x534543['appdata'][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x3ca0ef[0x0]);_0x8b7304['push'](_0x3ca0ef[0x1]);_0x8b7304[_0x2115('0x21')](_0x3ca0ef[_0x2115('0x22')](0x2,_0x3ca0ef[_0x2115('0x18')])[_0x2115('0x1a')](','));break;case'dialogflowv2':var _0x19c595=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x19c595[0x0]);_0x8b7304[_0x2115('0x21')](_0x19c595[0x1]);_0x8b7304[_0x2115('0x21')](_0x19c595[0x2]);_0x8b7304['push'](_0x19c595[0x3]);_0x8b7304['push'](_0x19c595[_0x2115('0x22')](0x4,_0x19c595[_0x2115('0x18')])[_0x2115('0x1a')](','));break;case _0x2115('0x24'):var _0x32bc0c=_0x534543['appdata'][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x0]);_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x1]);_0x8b7304['push'](_0x32bc0c[0x2]);_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x3]);_0x8b7304['push'](_0x32bc0c[_0x2115('0x22')](0x4,_0x32bc0c['length'])[_0x2115('0x1a')](','));break;case _0x2115('0x14'):_0x8b7304[_0x2115('0x21')](_0x534543['appdata']);break;case'tag':_0x8b7304[_0x2115('0x21')](_0x534543[_0x2115('0x25')]);_0x8b7304['push'](_0x534543[_0x2115('0x1e')]);break;case _0x2115('0x26'):var _0x27f9e5=utils[_0x2115('0x27')](_0x350969['account'][_0x2115('0x28')],_0x350969);var _0x41c9dc=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');_0x8b7304['push'](_0x41c9dc[0x0]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x1]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x2]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x3]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x4]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x5]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x6]);_0x8b7304['push'](_0x41c9dc[0x7]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x8]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x9]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0xa]);_0x8b7304[_0x2115('0x21')](_0x350969[_0x2115('0x15')]['id']);_0x8b7304[_0x2115('0x21')](_0x350969['message']['id']);_0x8b7304[_0x2115('0x21')](_0x534543['ChatWebsiteId']);_0x8b7304['push'](_0x350969[_0x2115('0x15')][_0x2115('0x29')]);_0x8b7304[_0x2115('0x21')](_0x350969[_0x2115('0x2a')][_0x2115('0x2a')]);_0x8b7304[_0x2115('0x21')](_0x27f9e5);break;default:_0x8b7304=_['isNil'](_0x534543[_0x2115('0x1e')])?[]:_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');}var _0x19c159={'id':util[_0x2115('0xb')](_0x2115('0x2b'),_0x184c05,_0x534543['id'],_0x534543[_0x2115('0x1b')]),'condition':require(_0x2115('0x2c'))[_0x2115('0x2d')](_0x184c05,getIntervals(_0x38e406[_0x2115('0x2e')],_0x534543),_0x38e406),'consequence':require('./applications/'+_0x534543['app'])[_0x2115('0x2f')](_0x184c05,_0x8b7304,_0x38e406,_0x350969),'p':_0x534543['priority']||0x0};logger[_0x2115('0x30')]('Push\x20new\x20rule',_0x19c159['id'],'on\x20interval',getIntervals(_0x38e406['intervals'],_0x534543)[_0x2115('0x1a')](_0x2115('0x31')));_0xc97f87[_0x2115('0x21')](_0x19c159);}else{logger[_0x2115('0x32')](_0x2115('0x33'),path['join'](__dirname,_0x2115('0x16'),_0x534543['app']+_0x2115('0x1c')));}}_0x38e406[_0x2115('0x12')][_0x184c05]=new RuleEngine(_0xc97f87);_0x38e406['rules'][_0x184c05][_0x2115('0x34')](_0x350969,function(_0x309f46){logger['info']('Applications\x20executed',JSON[_0x2115('0x35')](_0x309f46[_0x2115('0x36')]));if(_0x38e406['rules'][_0x184c05]){_0x38e406['rules'][_0x184c05][_0x2115('0x37')](_0x2115('0x38'));}});return _0xdf3e24({'code':0xc8,'message':_0x350969});}else{logger['info']('No\x20applications\x20to\x20execute');return _0xdf3e24({'code':0xc8,'message':_0x350969});}}catch(_0x346b32){logger[_0x2115('0x32')](_0x346b32[_0x2115('0x39')]);return _0x21b589(_0x5e8f81['error'](0x1f4,_0x346b32));}}return _0x21b589(_0x2115('0x3a'));});},'AcceptMessage':function(_0x48ca88){var _0xd003d0=this;return new Promise(function(_0xc61152,_0x3a0801){if(_0x48ca88[_0x2115('0x3b')]&&_0x48ca88[_0x2115('0x3b')]['id']){if(_0x38e406['agents'][_0x48ca88[_0x2115('0x3b')]['id']]){_0x38e406['agents'][_0x48ca88['agent']['id']][_0x2115('0x3c')]=![];_0x38e406[_0x2115('0x3d')][_0x48ca88['agent']['id']][_0x2115('0x3e')]=undefined;}}if(_0x48ca88[_0x2115('0x14')]&&_0x48ca88[_0x2115('0x14')]['id']){try{var _0x1dd6eb=getId(_0x48ca88[_0x2115('0x13')],_0x48ca88[_0x2115('0x14')]?_0x48ca88[_0x2115('0x14')]['id']:0x0,_0x48ca88[_0x2115('0x15')]?_0x48ca88[_0x2115('0x15')]['id']:0x0);if(_0x38e406['rules'][_0x1dd6eb]){_0x38e406[_0x2115('0x12')][_0x1dd6eb][_0x2115('0x37')](_0x2115('0x3f'));if(rpc[_0x48ca88['channel']+_0x2115('0x40')]){rpc[_0x48ca88['channel']+'QueueReport']['update'](_0x1dd6eb,{'UserId':_0x48ca88[_0x2115('0x14')][_0x2115('0x41')]})['catch'](function(_0x4c0e49){logger[_0x2115('0x32')](_0x2115('0x42'));});}}return _0xc61152({'code':0xc8,'message':_0x48ca88});}catch(_0x401f8f){logger[_0x2115('0x32')](_0x401f8f[_0x2115('0x39')]);return _0x3a0801(_0xd003d0[_0x2115('0x32')](0x1f4,_0x401f8f));}}logger[_0x2115('0x32')](_0x2115('0x43'));return _0x3a0801(_0xd003d0['error'](0x1f4,_0x2115('0x43')));});},'RejectMessage':function(_0x581295){var _0x51b575=this;return new Promise(function(_0xf5653f,_0x6de4e7){if(_0x581295[_0x2115('0x3b')]&&_0x581295[_0x2115('0x3b')]['id']){try{if(_0x38e406[_0x2115('0x3d')][_0x581295[_0x2115('0x3b')]['id']]){_0x38e406['agents'][_0x581295[_0x2115('0x3b')]['id']][_0x2115('0x3c')]=![];_0x38e406['agents'][_0x581295['agent']['id']][_0x2115('0x3e')]=undefined;}return _0xf5653f({'code':0xc8,'message':_0x581295});}catch(_0x29bd22){logger[_0x2115('0x32')](_0x29bd22[_0x2115('0x39')]);return _0x6de4e7(_0x51b575['error'](0x1f4,_0x29bd22));}}logger[_0x2115('0x32')](_0x2115('0x43'));return _0x6de4e7(_0x51b575[_0x2115('0x32')](0x1f4,_0x2115('0x43')));});},'AbandonInteraction':function(_0xedd07f){var _0x1bd210=this;return new Promise(function(_0x48cf39,_0xd1fe41){if(_0xedd07f[_0x2115('0x13')]&&_0xedd07f['interaction']&&_0xedd07f[_0x2115('0x15')]['id']){try{var _0x34f5f0=getId(_0xedd07f[_0x2115('0x13')],_0xedd07f['message']?_0xedd07f[_0x2115('0x14')]['id']:0x0,_0xedd07f['interaction']?_0xedd07f[_0x2115('0x15')]['id']:0x0);if(_0x38e406[_0x2115('0x12')][_0x34f5f0]){_0x38e406[_0x2115('0x12')][_0x34f5f0][_0x2115('0x37')](_0x2115('0x3f'));}return _0x48cf39({'code':0xc8,'message':_0xedd07f});}catch(_0x31a52a){logger['error'](_0x31a52a[_0x2115('0x39')]);return _0xd1fe41(_0x1bd210[_0x2115('0x32')](0x1f4,_0x31a52a));}}logger['error'](_0x2115('0x43'));return _0xd1fe41(_0x1bd210[_0x2115('0x32')](0x1f4,_0x2115('0x43')));});},'AgentCapacity':function(_0x58ed32){var _0x53ee95=this;return new Promise(function(_0x4f0c1d,_0x3d7106){if(_0x38e406['agents'][_0x2115('0x44')](_0x58ed32['id'])){for(var _0x208e4e in _0x58ed32[_0x2115('0x45')]){if(_0x58ed32['capacity'][_0x2115('0x44')](_0x208e4e)){if(_0x38e406['agents'][_0x58ed32['id']][_0x2115('0x44')](_0x208e4e+_0x2115('0x46'))){_0x38e406['agents'][_0x58ed32['id']][_0x208e4e+'CurrentCapacity']=parseInt(_0x58ed32[_0x2115('0x45')][_0x208e4e],0xa);}}}_0x38e406[_0x2115('0x3d')][_0x58ed32['id']]['updateRealtime']();return _0x4f0c1d({'code':0xc8,'message':_0x38e406[_0x2115('0x3d')][_0x58ed32['id']]});}else{return _0x3d7106(_0x53ee95['error'](0x1f4,_0x2115('0x47')));}});},'Agents':function(_0x422863){return new Promise(function(_0x4b2950,_0x2e9167){var _0x1eea52=_[_0x2115('0x48')](_0x38e406[_0x2115('0x3d')]);_0x4b2950({'count':_0x1eea52[_0x2115('0x18')],'rows':_0x1eea52});});},'ChatQueues':function(_0x23181c){return new Promise(function(_0x2cf476,_0x16bd79){var _0x2d2105=[];for(var _0x1be769 in _0x38e406[_0x2115('0x49')]){if(_0x38e406[_0x2115('0x49')][_0x2115('0x44')](_0x1be769)){var _0x84d526=_0x38e406[_0x2115('0x49')][_0x1be769];var _0x21baa7={'id':_0x84d526['id'],'available':_0x84d526[_0x2115('0x4a')],'loggedIn':_0x84d526[_0x2115('0x4b')],'name':_0x84d526['name'],'paused':_0x84d526[_0x2115('0x4c')],'waiting':_0x84d526[_0x2115('0x4d')]};_0x2d2105[_0x2115('0x21')](_0x21baa7);}}_0x2cf476({'count':_0x2d2105[_0x2115('0x18')],'rows':_0x2d2105});});},'MailQueues':function(_0x2ee9d1){return new Promise(function(_0x225389,_0x2b21c8){var _0x5ca331=[];for(var _0x96003b in _0x38e406[_0x2115('0x4e')]){if(_0x38e406[_0x2115('0x4e')]['hasOwnProperty'](_0x96003b)){var _0x2450f3=_0x38e406[_0x2115('0x4e')][_0x96003b];var _0x10a00d={'id':_0x2450f3['id'],'available':_0x2450f3[_0x2115('0x4a')],'loggedIn':_0x2450f3[_0x2115('0x4b')],'name':_0x2450f3['name'],'paused':_0x2450f3[_0x2115('0x4c')],'waiting':_0x2450f3['waiting']};_0x5ca331['push'](_0x10a00d);}}_0x225389({'count':_0x5ca331[_0x2115('0x18')],'rows':_0x5ca331});});},'OpenchannelQueues':function(_0x5826ae){return new Promise(function(_0x5d2e03,_0x509478){var _0x4f1ee3=[];for(var _0x145bf9 in _0x38e406['openchannelQueues']){if(_0x38e406[_0x2115('0x4f')]['hasOwnProperty'](_0x145bf9)){var _0x23c4cc=_0x38e406['openchannelQueues'][_0x145bf9];var _0x151894={'id':_0x23c4cc['id'],'available':_0x23c4cc['available'],'loggedIn':_0x23c4cc['loggedIn'],'name':_0x23c4cc['name'],'paused':_0x23c4cc[_0x2115('0x4c')],'waiting':_0x23c4cc[_0x2115('0x4d')]};_0x4f1ee3['push'](_0x151894);}}_0x5d2e03({'count':_0x4f1ee3[_0x2115('0x18')],'rows':_0x4f1ee3});});},'SmsQueues':function(_0x28e322){return new Promise(function(_0x185426,_0x464fa7){var _0x217383=[];for(var _0x45327e in _0x38e406[_0x2115('0x50')]){if(_0x38e406[_0x2115('0x50')][_0x2115('0x44')](_0x45327e)){var _0x85ea33=_0x38e406[_0x2115('0x50')][_0x45327e];var _0x34cdc3={'id':_0x85ea33['id'],'available':_0x85ea33[_0x2115('0x4a')],'loggedIn':_0x85ea33[_0x2115('0x4b')],'name':_0x85ea33[_0x2115('0x51')],'paused':_0x85ea33[_0x2115('0x4c')],'waiting':_0x85ea33['waiting']};_0x217383[_0x2115('0x21')](_0x34cdc3);}}_0x185426({'count':_0x217383['length'],'rows':_0x217383});});},'FaxQueues':function(_0x47edc3){return new Promise(function(_0x4d5934,_0x3c48b3){var _0x1a14ac=[];for(var _0x14e747 in _0x38e406['faxQueues']){if(_0x38e406[_0x2115('0x52')][_0x2115('0x44')](_0x14e747)){var _0x47a970=_0x38e406[_0x2115('0x52')][_0x14e747];var _0x10d172={'id':_0x47a970['id'],'available':_0x47a970[_0x2115('0x4a')],'loggedIn':_0x47a970[_0x2115('0x4b')],'name':_0x47a970[_0x2115('0x51')],'paused':_0x47a970[_0x2115('0x4c')],'waiting':_0x47a970[_0x2115('0x4d')]};_0x1a14ac[_0x2115('0x21')](_0x10d172);}}_0x4d5934({'count':_0x1a14ac[_0x2115('0x18')],'rows':_0x1a14ac});});},'WhatsappQueues':function(_0xae3f1){return new Promise(function(_0x3928e0,_0x387c2b){var _0x1eb0b9=[];for(var _0x4c9997 in _0x38e406[_0x2115('0x53')]){if(_0x38e406[_0x2115('0x53')][_0x2115('0x44')](_0x4c9997)){var _0x1b713e=_0x38e406['whatsappQueues'][_0x4c9997];var _0x249b9c={'id':_0x1b713e['id'],'available':_0x1b713e[_0x2115('0x4a')],'loggedIn':_0x1b713e[_0x2115('0x4b')],'name':_0x1b713e[_0x2115('0x51')],'paused':_0x1b713e[_0x2115('0x4c')],'waiting':_0x1b713e[_0x2115('0x4d')]};_0x1eb0b9[_0x2115('0x21')](_0x249b9c);}}_0x3928e0({'count':_0x1eb0b9[_0x2115('0x18')],'rows':_0x1eb0b9});});},'ChatQueuesWaitingInteractions':function(_0x85f3d9){return new Promise(function(_0x956842,_0xe87632){var _0x2f808c=_[_0x2115('0x48')](_0x38e406[_0x2115('0x54')]);_0x956842({'count':_0x2f808c[_0x2115('0x18')],'rows':_0x2f808c});});},'MailQueuesWaitingInteractions':function(_0x2f78a3){return new Promise(function(_0x354a73,_0x547733){var _0x20813c=_[_0x2115('0x48')](_0x38e406[_0x2115('0x55')]);_0x354a73({'count':_0x20813c[_0x2115('0x18')],'rows':_0x20813c});});},'OpenchannelQueuesWaitingInteractions':function(_0x3eb80c){return new Promise(function(_0x35e7fb,_0x22c00d){var _0x271fab=_[_0x2115('0x48')](_0x38e406[_0x2115('0x56')]);_0x35e7fb({'count':_0x271fab[_0x2115('0x18')],'rows':_0x271fab});});},'SmsQueuesWaitingInteractions':function(_0xdfc5da){return new Promise(function(_0x322a4e,_0x2e301d){var _0x4630ba=_[_0x2115('0x48')](_0x38e406[_0x2115('0x57')]);_0x322a4e({'count':_0x4630ba[_0x2115('0x18')],'rows':_0x4630ba});});},'FaxQueuesWaitingInteractions':function(_0x4ee2a4){return new Promise(function(_0x1f4e61,_0x2983c1){var _0x4b55d6=_[_0x2115('0x48')](_0x38e406[_0x2115('0x58')]);_0x1f4e61({'count':_0x4b55d6[_0x2115('0x18')],'rows':_0x4b55d6});});},'WhatsappQueuesWaitingInteractions':function(_0x19c929){return new Promise(function(_0x39632f,_0x25bbdd){var _0x4e380b=_[_0x2115('0x48')](_0x38e406['whatsappQueuesWaitingInteractions']);_0x39632f({'count':_0x4e380b[_0x2115('0x18')],'rows':_0x4e380b});});}};var _0x4705ff=jayson[_0x2115('0x59')](_0x113ce2)[_0x2115('0x5a')]();_0x4705ff['on']('error',function(_0xc5abd2){logger[_0x2115('0x32')](JSON['stringify'](_0xc5abd2));return _0x7f6183(_0xc5abd2);});_0x4705ff[_0x2115('0x11')](0x232c,_0x2115('0x5b'),function(){console[_0x2115('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2001e6(_0x2115('0x5d')+0x232c);});});}; \ No newline at end of file +var _0xcffe=['message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','split','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','matchPath','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch'];(function(_0x389baf,_0xf4fb49){var _0x3d3fdc=function(_0x594a7e){while(--_0x594a7e){_0x389baf['push'](_0x389baf['shift']());}};_0x3d3fdc(++_0xf4fb49);}(_0xcffe,0x1a1));var _0xecff=function(_0x465aa9,_0x1bf1c8){_0x465aa9=_0x465aa9-0x0;var _0x4104e4=_0xcffe[_0x465aa9];return _0x4104e4;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var path=require(_0xecff('0x2'));var fs=require('fs');var jayson=require(_0xecff('0x3'));var BPromise=require(_0xecff('0x4'));var uuid=require(_0xecff('0x5'));var utils=require(_0xecff('0x6'));var config=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xecff('0xa')),'smsQueueReport':require(_0xecff('0xb')),'faxQueueReport':require(_0xecff('0xc')),'whatsappQueueReport':require(_0xecff('0xd'))};var RuleEngine=require(_0xecff('0xe'));function getId(_0x298c19,_0x1f7386,_0x4d4458){return util[_0xecff('0xf')](_0xecff('0x10'),_0x298c19,_0x1f7386||0x0,_0x4d4458||0x0);}function getIntervals(_0x195b15,_0x20ab4f){var _0x698e40=[];if(!_['isNil'](_0x20ab4f[_0xecff('0x11')])&&!_[_0xecff('0x12')](_0x195b15[_0x20ab4f[_0xecff('0x11')]])&&!_[_0xecff('0x12')](_0x195b15[_0x20ab4f[_0xecff('0x11')]][_0xecff('0x13')])){_0x698e40=_[_0xecff('0x14')](_0x195b15[_0x20ab4f[_0xecff('0x11')]][_0xecff('0x13')],_0xecff('0x15'));}else if(!_[_0xecff('0x12')](_0x20ab4f[_0xecff('0x15')])){_0x698e40=[_0x20ab4f[_0xecff('0x15')]];}return _0x698e40;}exports[_0xecff('0x16')]=function(_0x5495f9){_0x5495f9['rules']={};return new BPromise(function(_0xa26f3d,_0x2e1d6f){var _0x558ecd={'Start':function(_0x35ce1f){var _0x362ed0=this;return new Promise(function(_0x3a7623,_0x596b09){if(_0x35ce1f){try{var _0x52b62f=[];var _0x24abef=getId(_0x35ce1f[_0xecff('0x17')],_0x35ce1f['message']?_0x35ce1f[_0xecff('0x18')]['id']:0x0,_0x35ce1f[_0xecff('0x19')]?_0x35ce1f[_0xecff('0x19')]['id']:0x0);if(_0x35ce1f[_0xecff('0x1a')]&&_[_0xecff('0x1b')](_0x35ce1f[_0xecff('0x1a')])&&_0x35ce1f['applications'][_0xecff('0x1c')]){for(var _0x422bd8=0x0;_0x422bd8<_0x35ce1f[_0xecff('0x1a')][_0xecff('0x1c')];_0x422bd8+=0x1){var _0x49d0e2=_0x35ce1f[_0xecff('0x1a')][_0x422bd8];if(fs[_0xecff('0x1d')](path[_0xecff('0x1e')](__dirname,_0xecff('0x1a'),_0x49d0e2[_0xecff('0x1f')]+_0xecff('0x20')))){var _0x494754=[];switch(_0x49d0e2[_0xecff('0x1f')]['toLowerCase']()){case'autoreply':var _0x2d16f1=_0x49d0e2['appdata'][_0xecff('0x21')](',');if(_0x35ce1f['channel']===_0xecff('0x22')){_0x494754['push'](_0x2d16f1[0x0]);_0x494754[_0xecff('0x23')](_0x2d16f1[0x1]);_0x494754[_0xecff('0x23')](_0x2d16f1['slice'](0x2,_0x2d16f1[_0xecff('0x1c')])[_0xecff('0x1e')](','));}else{_0x494754[_0xecff('0x23')](_0x2d16f1[0x0]);_0x494754[_0xecff('0x23')](_0x2d16f1[_0xecff('0x24')](0x1,_0x2d16f1['length'])['join'](','));}break;case _0xecff('0x25'):var _0x484415=_0x49d0e2[_0xecff('0x26')][_0xecff('0x21')](',');_0x494754[_0xecff('0x23')](_0x484415[0x0]);_0x494754[_0xecff('0x23')](_0x484415[0x1]);_0x494754['push'](_0x484415['slice'](0x2,_0x484415['length'])[_0xecff('0x1e')](','));break;case _0xecff('0x27'):var _0x230d04=_0x49d0e2[_0xecff('0x26')]['split'](',');_0x494754[_0xecff('0x23')](_0x230d04[0x0]);_0x494754[_0xecff('0x23')](_0x230d04[0x1]);_0x494754[_0xecff('0x23')](_0x230d04[0x2]);_0x494754['push'](_0x230d04[0x3]);_0x494754[_0xecff('0x23')](_0x230d04[_0xecff('0x24')](0x4,_0x230d04[_0xecff('0x1c')])[_0xecff('0x1e')](','));break;case'amazonlex':var _0x7e7a6c=_0x49d0e2[_0xecff('0x26')]['split'](',');_0x494754[_0xecff('0x23')](_0x7e7a6c[0x0]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x1]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x2]);_0x494754[_0xecff('0x23')](_0x7e7a6c[0x3]);_0x494754['push'](_0x7e7a6c[_0xecff('0x24')](0x4,_0x7e7a6c[_0xecff('0x1c')])[_0xecff('0x1e')](','));break;case'message':_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x26')]);break;case _0xecff('0x28'):_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x29')]);_0x494754[_0xecff('0x23')](_0x49d0e2['appdata']);break;case'tvox':var _0x4dd43c=utils[_0xecff('0x2a')](_0x35ce1f['account'][_0xecff('0x2b')],_0x35ce1f);var _0x21411b=_0x49d0e2['appdata'][_0xecff('0x21')](',');_0x494754[_0xecff('0x23')](_0x21411b[0x0]);_0x494754[_0xecff('0x23')](_0x21411b[0x1]);_0x494754['push'](_0x21411b[0x2]);_0x494754[_0xecff('0x23')](_0x21411b[0x3]);_0x494754[_0xecff('0x23')](_0x21411b[0x4]);_0x494754[_0xecff('0x23')](_0x21411b[0x5]);_0x494754['push'](_0x21411b[0x6]);_0x494754[_0xecff('0x23')](_0x21411b[0x7]);_0x494754[_0xecff('0x23')](_0x21411b[0x8]);_0x494754[_0xecff('0x23')](_0x21411b[0x9]);_0x494754[_0xecff('0x23')](_0x21411b[0xa]);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x19')]['id']);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x18')]['id']);_0x494754[_0xecff('0x23')](_0x49d0e2[_0xecff('0x2c')]);_0x494754[_0xecff('0x23')](_0x35ce1f['interaction'][_0xecff('0x2d')]);_0x494754[_0xecff('0x23')](_0x35ce1f[_0xecff('0x2e')][_0xecff('0x2e')]);_0x494754[_0xecff('0x23')](_0x4dd43c);break;default:_0x494754=_[_0xecff('0x12')](_0x49d0e2[_0xecff('0x26')])?[]:_0x49d0e2[_0xecff('0x26')]['split'](',');}var _0x28141f={'id':util['format'](_0xecff('0x2f'),_0x24abef,_0x49d0e2['id'],_0x49d0e2[_0xecff('0x1f')]),'condition':require(_0xecff('0x30'))[_0xecff('0x31')](_0x24abef,getIntervals(_0x5495f9[_0xecff('0x32')],_0x49d0e2),_0x5495f9),'consequence':require(_0xecff('0x33')+_0x49d0e2[_0xecff('0x1f')])['consequence'](_0x24abef,_0x494754,_0x5495f9,_0x35ce1f),'p':_0x49d0e2[_0xecff('0x34')]||0x0};logger[_0xecff('0x35')]('Push\x20new\x20rule',_0x28141f['id'],'on\x20interval',getIntervals(_0x5495f9[_0xecff('0x32')],_0x49d0e2)[_0xecff('0x1e')](_0xecff('0x36')));_0x52b62f[_0xecff('0x23')](_0x28141f);}else{logger[_0xecff('0x37')](_0xecff('0x38'),path['join'](__dirname,_0xecff('0x1a'),_0x49d0e2[_0xecff('0x1f')]+'.js'));}}_0x5495f9[_0xecff('0x39')][_0x24abef]=new RuleEngine(_0x52b62f);_0x5495f9[_0xecff('0x39')][_0x24abef][_0xecff('0x3a')](_0x35ce1f,function(_0x4402a0){logger[_0xecff('0x35')](_0xecff('0x3b'),JSON['stringify'](_0x4402a0[_0xecff('0x3c')]));if(_0x5495f9[_0xecff('0x39')][_0x24abef]){_0x5495f9[_0xecff('0x39')][_0x24abef]['emit'](_0xecff('0x3d'));}});return _0x3a7623({'code':0xc8,'message':_0x35ce1f});}else{logger[_0xecff('0x35')](_0xecff('0x3e'));return _0x3a7623({'code':0xc8,'message':_0x35ce1f});}}catch(_0x3c73ca){logger['error'](_0x3c73ca[_0xecff('0x3f')]);return _0x596b09(_0x362ed0[_0xecff('0x37')](0x1f4,_0x3c73ca));}}return _0x596b09('routing\x20is\x20empty');});},'AcceptMessage':function(_0x22869d){var _0x1d2ac3=this;return new Promise(function(_0x4ba9e3,_0x1ee5fc){if(_0x22869d['agent']&&_0x22869d[_0xecff('0x40')]['id']){if(_0x5495f9[_0xecff('0x41')][_0x22869d[_0xecff('0x40')]['id']]){_0x5495f9[_0xecff('0x41')][_0x22869d[_0xecff('0x40')]['id']][_0xecff('0x42')]=![];_0x5495f9['agents'][_0x22869d['agent']['id']][_0xecff('0x43')]=undefined;}}if(_0x22869d[_0xecff('0x18')]&&_0x22869d[_0xecff('0x18')]['id']){try{var _0x29ff01=getId(_0x22869d[_0xecff('0x17')],_0x22869d[_0xecff('0x18')]?_0x22869d[_0xecff('0x18')]['id']:0x0,_0x22869d[_0xecff('0x19')]?_0x22869d['interaction']['id']:0x0);if(_0x5495f9[_0xecff('0x39')][_0x29ff01]){_0x5495f9[_0xecff('0x39')][_0x29ff01]['emit'](_0xecff('0x44'));if(rpc[_0x22869d['channel']+_0xecff('0x45')]){rpc[_0x22869d[_0xecff('0x17')]+'QueueReport'][_0xecff('0x46')](_0x29ff01,{'UserId':_0x22869d[_0xecff('0x18')][_0xecff('0x47')]})[_0xecff('0x48')](function(_0x27cc00){logger['error']('error\x20update\x20queue\x20report');});}}return _0x4ba9e3({'code':0xc8,'message':_0x22869d});}catch(_0x198ad6){logger[_0xecff('0x37')](_0x198ad6[_0xecff('0x3f')]);return _0x1ee5fc(_0x1d2ac3[_0xecff('0x37')](0x1f4,_0x198ad6));}}logger[_0xecff('0x37')](_0xecff('0x49'));return _0x1ee5fc(_0x1d2ac3[_0xecff('0x37')](0x1f4,_0xecff('0x49')));});},'RejectMessage':function(_0x9b44d4){var _0x4f9060=this;return new Promise(function(_0x289659,_0x56fed4){if(_0x9b44d4[_0xecff('0x40')]&&_0x9b44d4[_0xecff('0x40')]['id']){try{if(_0x5495f9[_0xecff('0x41')][_0x9b44d4['agent']['id']]){_0x5495f9[_0xecff('0x41')][_0x9b44d4['agent']['id']][_0xecff('0x42')]=![];_0x5495f9['agents'][_0x9b44d4['agent']['id']][_0xecff('0x43')]=undefined;}return _0x289659({'code':0xc8,'message':_0x9b44d4});}catch(_0x5cd819){logger[_0xecff('0x37')](_0x5cd819[_0xecff('0x3f')]);return _0x56fed4(_0x4f9060['error'](0x1f4,_0x5cd819));}}logger[_0xecff('0x37')](_0xecff('0x49'));return _0x56fed4(_0x4f9060[_0xecff('0x37')](0x1f4,_0xecff('0x49')));});},'AbandonInteraction':function(_0x181760){var _0x162938=this;return new Promise(function(_0x74fc77,_0x574c40){if(_0x181760['channel']&&_0x181760[_0xecff('0x19')]&&_0x181760[_0xecff('0x19')]['id']){try{var _0x18ead4=getId(_0x181760[_0xecff('0x17')],_0x181760[_0xecff('0x18')]?_0x181760[_0xecff('0x18')]['id']:0x0,_0x181760[_0xecff('0x19')]?_0x181760[_0xecff('0x19')]['id']:0x0);if(_0x5495f9[_0xecff('0x39')][_0x18ead4]){_0x5495f9[_0xecff('0x39')][_0x18ead4][_0xecff('0x4a')](_0xecff('0x44'));}return _0x74fc77({'code':0xc8,'message':_0x181760});}catch(_0x3f8e22){logger[_0xecff('0x37')](_0x3f8e22['stack']);return _0x574c40(_0x162938['error'](0x1f4,_0x3f8e22));}}logger[_0xecff('0x37')]('message\x20is\x20empty');return _0x574c40(_0x162938['error'](0x1f4,_0xecff('0x49')));});},'AgentCapacity':function(_0x41efbc){var _0x371e6=this;return new Promise(function(_0x48a737,_0x161190){if(_0x5495f9[_0xecff('0x41')][_0xecff('0x4b')](_0x41efbc['id'])){for(var _0x56b445 in _0x41efbc[_0xecff('0x4c')]){if(_0x41efbc['capacity']['hasOwnProperty'](_0x56b445)){if(_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0xecff('0x4b')](_0x56b445+_0xecff('0x4d'))){_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0x56b445+_0xecff('0x4d')]=parseInt(_0x41efbc[_0xecff('0x4c')][_0x56b445],0xa);}}}_0x5495f9[_0xecff('0x41')][_0x41efbc['id']][_0xecff('0x4e')]();return _0x48a737({'code':0xc8,'message':_0x5495f9[_0xecff('0x41')][_0x41efbc['id']]});}else{return _0x161190(_0x371e6[_0xecff('0x37')](0x1f4,_0xecff('0x4f')));}});},'Agents':function(_0x3dcafd){return new Promise(function(_0x22e778,_0x3042c3){var _0x4d6265=_['values'](_0x5495f9[_0xecff('0x41')]);_0x22e778({'count':_0x4d6265[_0xecff('0x1c')],'rows':_0x4d6265});});},'ChatQueues':function(_0x4c0b1c){return new Promise(function(_0x15be2b,_0xe7f29a){var _0x59857d=[];for(var _0x148c69 in _0x5495f9[_0xecff('0x50')]){if(_0x5495f9[_0xecff('0x50')][_0xecff('0x4b')](_0x148c69)){var _0x20e8ab=_0x5495f9[_0xecff('0x50')][_0x148c69];var _0x485361={'id':_0x20e8ab['id'],'available':_0x20e8ab[_0xecff('0x51')],'loggedIn':_0x20e8ab[_0xecff('0x52')],'name':_0x20e8ab[_0xecff('0x53')],'paused':_0x20e8ab[_0xecff('0x54')],'waiting':_0x20e8ab[_0xecff('0x55')]};_0x59857d['push'](_0x485361);}}_0x15be2b({'count':_0x59857d[_0xecff('0x1c')],'rows':_0x59857d});});},'MailQueues':function(_0x4ca3c0){return new Promise(function(_0x6988b9,_0x3e54b8){var _0x5661b5=[];for(var _0x5988c2 in _0x5495f9['mailQueues']){if(_0x5495f9[_0xecff('0x56')][_0xecff('0x4b')](_0x5988c2)){var _0x1af54d=_0x5495f9['mailQueues'][_0x5988c2];var _0x2b79b3={'id':_0x1af54d['id'],'available':_0x1af54d['available'],'loggedIn':_0x1af54d[_0xecff('0x52')],'name':_0x1af54d[_0xecff('0x53')],'paused':_0x1af54d[_0xecff('0x54')],'waiting':_0x1af54d[_0xecff('0x55')]};_0x5661b5['push'](_0x2b79b3);}}_0x6988b9({'count':_0x5661b5[_0xecff('0x1c')],'rows':_0x5661b5});});},'OpenchannelQueues':function(_0x23aa75){return new Promise(function(_0xb3594f,_0x4dfd1d){var _0x5dd627=[];for(var _0x3aa2d8 in _0x5495f9[_0xecff('0x57')]){if(_0x5495f9['openchannelQueues'][_0xecff('0x4b')](_0x3aa2d8)){var _0x3756fe=_0x5495f9[_0xecff('0x57')][_0x3aa2d8];var _0xe7f2fb={'id':_0x3756fe['id'],'available':_0x3756fe[_0xecff('0x51')],'loggedIn':_0x3756fe['loggedIn'],'name':_0x3756fe['name'],'paused':_0x3756fe[_0xecff('0x54')],'waiting':_0x3756fe[_0xecff('0x55')]};_0x5dd627['push'](_0xe7f2fb);}}_0xb3594f({'count':_0x5dd627['length'],'rows':_0x5dd627});});},'SmsQueues':function(_0xd588df){return new Promise(function(_0x5d1635,_0x1b0ccd){var _0xac26eb=[];for(var _0x5155c1 in _0x5495f9[_0xecff('0x58')]){if(_0x5495f9[_0xecff('0x58')][_0xecff('0x4b')](_0x5155c1)){var _0x3f6444=_0x5495f9[_0xecff('0x58')][_0x5155c1];var _0x11648c={'id':_0x3f6444['id'],'available':_0x3f6444[_0xecff('0x51')],'loggedIn':_0x3f6444[_0xecff('0x52')],'name':_0x3f6444['name'],'paused':_0x3f6444[_0xecff('0x54')],'waiting':_0x3f6444['waiting']};_0xac26eb['push'](_0x11648c);}}_0x5d1635({'count':_0xac26eb[_0xecff('0x1c')],'rows':_0xac26eb});});},'FaxQueues':function(_0x5aa6c7){return new Promise(function(_0x4932ff,_0x3769ff){var _0x16669b=[];for(var _0x8fcddc in _0x5495f9[_0xecff('0x59')]){if(_0x5495f9[_0xecff('0x59')]['hasOwnProperty'](_0x8fcddc)){var _0x46e71c=_0x5495f9[_0xecff('0x59')][_0x8fcddc];var _0x147766={'id':_0x46e71c['id'],'available':_0x46e71c[_0xecff('0x51')],'loggedIn':_0x46e71c[_0xecff('0x52')],'name':_0x46e71c['name'],'paused':_0x46e71c[_0xecff('0x54')],'waiting':_0x46e71c[_0xecff('0x55')]};_0x16669b[_0xecff('0x23')](_0x147766);}}_0x4932ff({'count':_0x16669b[_0xecff('0x1c')],'rows':_0x16669b});});},'WhatsappQueues':function(_0x46ba08){return new Promise(function(_0x4e829b,_0x5a0cea){var _0x29ea01=[];for(var _0x5b6054 in _0x5495f9['whatsappQueues']){if(_0x5495f9[_0xecff('0x5a')]['hasOwnProperty'](_0x5b6054)){var _0xae0c00=_0x5495f9['whatsappQueues'][_0x5b6054];var _0x5ef856={'id':_0xae0c00['id'],'available':_0xae0c00['available'],'loggedIn':_0xae0c00['loggedIn'],'name':_0xae0c00[_0xecff('0x53')],'paused':_0xae0c00[_0xecff('0x54')],'waiting':_0xae0c00[_0xecff('0x55')]};_0x29ea01[_0xecff('0x23')](_0x5ef856);}}_0x4e829b({'count':_0x29ea01[_0xecff('0x1c')],'rows':_0x29ea01});});},'ChatQueuesWaitingInteractions':function(_0x391ea3){return new Promise(function(_0x1bbf7a,_0x385909){var _0x410d73=_[_0xecff('0x5b')](_0x5495f9['chatQueuesWaitingInteractions']);_0x1bbf7a({'count':_0x410d73[_0xecff('0x1c')],'rows':_0x410d73});});},'MailQueuesWaitingInteractions':function(_0x461dfb){return new Promise(function(_0x44e34a,_0x2d77a){var _0x2c07fb=_['values'](_0x5495f9[_0xecff('0x5c')]);_0x44e34a({'count':_0x2c07fb[_0xecff('0x1c')],'rows':_0x2c07fb});});},'OpenchannelQueuesWaitingInteractions':function(_0x19d449){return new Promise(function(_0x4f3e8c,_0xd9787d){var _0x4f2af6=_[_0xecff('0x5b')](_0x5495f9['openchannelQueuesWaitingInteractions']);_0x4f3e8c({'count':_0x4f2af6[_0xecff('0x1c')],'rows':_0x4f2af6});});},'SmsQueuesWaitingInteractions':function(_0x1fd6df){return new Promise(function(_0x2d934a,_0x198b36){var _0x2d3286=_['values'](_0x5495f9[_0xecff('0x5d')]);_0x2d934a({'count':_0x2d3286[_0xecff('0x1c')],'rows':_0x2d3286});});},'FaxQueuesWaitingInteractions':function(_0x537151){return new Promise(function(_0x49c50e,_0x4306f4){var _0x334310=_[_0xecff('0x5b')](_0x5495f9[_0xecff('0x5e')]);_0x49c50e({'count':_0x334310['length'],'rows':_0x334310});});},'WhatsappQueuesWaitingInteractions':function(_0x2eb5b4){return new Promise(function(_0x28e423,_0x581e15){var _0x3f8cd9=_['values'](_0x5495f9['whatsappQueuesWaitingInteractions']);_0x28e423({'count':_0x3f8cd9[_0xecff('0x1c')],'rows':_0x3f8cd9});});}};var _0x49cc1e=jayson[_0xecff('0x5f')](_0x558ecd)[_0xecff('0x60')]();_0x49cc1e['on'](_0xecff('0x37'),function(_0x8cb05f){logger[_0xecff('0x37')](JSON['stringify'](_0x8cb05f));return _0x2e1d6f(_0x8cb05f);});_0x49cc1e['listen'](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xa26f3d(_0xecff('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 545bae2..c06b9e0 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cc1=['all','some','join','when','stack','util','bluebird','lodash','../../../config/logger','routing','request','then','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s'];(function(_0x172298,_0x542449){var _0x44856d=function(_0xa648ba){while(--_0xa648ba){_0x172298['push'](_0x172298['shift']());}};_0x44856d(++_0x542449);}(_0x4cc1,0x1a5));var _0x14cc=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x4cc1[_0xd13a88];return _0x1c993c;};'use strict';var util=require(_0x14cc('0x0'));var BPromise=require(_0x14cc('0x1'));var jayson=require('jayson/promise');var _=require(_0x14cc('0x2'));var logger=require(_0x14cc('0x3'))(_0x14cc('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0x43ca71,_0x5237a4){return new BPromise(function(_0x5e0a6c,_0x2942bc){return client[_0x14cc('0x5')](_0x43ca71,_0x5237a4)[_0x14cc('0x6')](function(_0x23a0ea){if(_0x23a0ea[_0x14cc('0x7')]){return _0x2942bc(_0x23a0ea[_0x14cc('0x7')]['message']);}else{return _0x5e0a6c(_0x23a0ea['result']);}})[_0x14cc('0x8')](function(_0x367f92){return _0x2942bc(_0x367f92);});});}exports[_0x14cc('0x9')]=function(_0x5a4a98,_0x50fcac,_0x5a2453){return function(_0x75e675){if(_0x5a2453[_0x14cc('0xa')]&&!_0x5a2453[_0x14cc('0xa')][_0x5a4a98]){logger[_0x14cc('0xb')](_0x14cc('0xc'),_0x5a4a98);return _0x75e675[_0x14cc('0xd')]();}var _0x32e1ec=[];for(var _0xd40cf7=0x0;_0xd40cf7<_0x50fcac['length'];_0xd40cf7+=0x1){_0x32e1ec[_0x14cc('0xe')](request(_0x14cc('0xf'),{'command':util['format'](_0x14cc('0x10'),_0x50fcac[_0xd40cf7])})[_0x14cc('0x6')](function(_0x4051f9){return _0x4051f9&&_0x4051f9[_0x14cc('0x11')]&&_0x4051f9[_0x14cc('0x11')][_0x14cc('0x12')](_0x14cc('0x13'))>=0x0?!![]:![];})['catch'](function(_0x53966a){logger[_0x14cc('0x7')](_0x14cc('0x14'),_0x5a4a98,_0x50fcac[_0xd40cf7]);}));}BPromise[_0x14cc('0x15')](_0x32e1ec)[_0x14cc('0x6')](function(_0x1b505b){var _0x2c03f6=_[_0x14cc('0x16')](_0x1b505b);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x5a4a98,_0x50fcac[_0x14cc('0x17')]('\x20|\x20'),_0x2c03f6);_0x75e675[_0x14cc('0x18')](_0x2c03f6);})['catch'](function(_0x4abf56){console['log'](_0x4abf56);logger[_0x14cc('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x5a4a98,_0x50fcac[_0x14cc('0x17')]('\x20|\x20'),_0x4abf56[_0x14cc('0x19')]);_0x75e675[_0x14cc('0xd')]();});};}; \ No newline at end of file +var _0xe5de=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','Command','format','iftime\x20%s','indexOf','true','catch','all','[%s][INTERVAL]\x20%s\x20%s','when','log','stack','jayson/promise','../../../config/logger','routing','client','http','then','error','message'];(function(_0x50c30c,_0x33de49){var _0x2979c9=function(_0x110f43){while(--_0x110f43){_0x50c30c['push'](_0x50c30c['shift']());}};_0x2979c9(++_0x33de49);}(_0xe5de,0x100));var _0xee5d=function(_0x498650,_0x78a324){_0x498650=_0x498650-0x0;var _0x24b9a6=_0xe5de[_0x498650];return _0x24b9a6;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xee5d('0x0'));var _=require('lodash');var logger=require(_0xee5d('0x1'))(_0xee5d('0x2'));var client=jayson[_0xee5d('0x3')][_0xee5d('0x4')]({'port':0x232a});function request(_0x6cb400,_0x34d6e1){return new BPromise(function(_0x11eaf3,_0x5f3b3e){return client['request'](_0x6cb400,_0x34d6e1)[_0xee5d('0x5')](function(_0x348747){if(_0x348747['error']){return _0x5f3b3e(_0x348747[_0xee5d('0x6')][_0xee5d('0x7')]);}else{return _0x11eaf3(_0x348747['result']);}})['catch'](function(_0x465661){return _0x5f3b3e(_0x465661);});});}exports[_0xee5d('0x8')]=function(_0x30c46b,_0x27b4ea,_0x1b5404){return function(_0x166880){if(_0x1b5404['rules']&&!_0x1b5404[_0xee5d('0x9')][_0x30c46b]){logger[_0xee5d('0xa')](_0xee5d('0xb'),_0x30c46b);return _0x166880[_0xee5d('0xc')]();}var _0x228ea9=[];for(var _0x4ae0cc=0x0;_0x4ae0cc<_0x27b4ea['length'];_0x4ae0cc+=0x1){_0x228ea9['push'](request(_0xee5d('0xd'),{'command':util[_0xee5d('0xe')](_0xee5d('0xf'),_0x27b4ea[_0x4ae0cc])})['then'](function(_0x51b45c){return _0x51b45c&&_0x51b45c[_0xee5d('0x7')]&&_0x51b45c['message'][_0xee5d('0x10')](_0xee5d('0x11'))>=0x0?!![]:![];})[_0xee5d('0x12')](function(_0x5889d0){logger[_0xee5d('0x6')]('[%s][INTERVAL]\x20%s',_0x30c46b,_0x27b4ea[_0x4ae0cc]);}));}BPromise[_0xee5d('0x13')](_0x228ea9)[_0xee5d('0x5')](function(_0x279796){var _0x592abc=_['some'](_0x279796);logger[_0xee5d('0xa')](_0xee5d('0x14'),_0x30c46b,_0x27b4ea['join']('\x20|\x20'),_0x592abc);_0x166880[_0xee5d('0x15')](_0x592abc);})['catch'](function(_0x571ab8){console[_0xee5d('0x16')](_0x571ab8);logger['error'](_0xee5d('0x14'),_0x30c46b,_0x27b4ea['join']('\x20|\x20'),_0x571ab8[_0xee5d('0x17')]);_0x166880[_0xee5d('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2cd9d00..1360175 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5dd881,_0x550fbc){utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x4'),_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['interface'],_0x5dd881[_0x0a9e('0x9')],_0x5dd881[_0x0a9e('0xa')],_0x5dd881[_0x0a9e('0xb')]));if(_0x5dd881['queue']){utils['getVoiceQueueByName'](_0x5dd881[_0x0a9e('0x7')])['then'](function(_0x52cace){if(_0x52cace){_0x5dd881[_0x0a9e('0xc')]=_0x52cace[_0x0a9e('0xc')];_0x5dd881[_0x0a9e('0xd')]=_0x5dd881[_0x0a9e('0xe')]?_0x52cace[_0x0a9e('0xf')]:![];_0x5dd881[_0x0a9e('0x10')]=_0x5dd881['agentacw']?_0x52cace['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x5dd881);});}else{utils[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x5dd881);}if(_0x550fbc){delete transfers[_0x5dd881[_0x0a9e('0x5')]];}else{delete agents[_0x5dd881[_0x0a9e('0x13')]];}}exports[_0x0a9e('0x14')]=function(_0x69aeb7){try{utils['debug'](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x69aeb7);agents[_0x69aeb7[_0x0a9e('0x13')]]=_0x69aeb7;agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x17')]=utils['now']();agents[_0x69aeb7[_0x0a9e('0x13')]]['lastevent']=_0x0a9e('0x18');agents[_0x69aeb7['destuniqueid']][_0x0a9e('0xa')]=null;agents[_0x69aeb7[_0x0a9e('0x13')]]['connectedlinename']=null;utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x19'),_0x69aeb7[_0x0a9e('0x5')],agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x69aeb7[_0x0a9e('0x13')]));}catch(_0x2eb11f){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x2eb11f);}};exports[_0x0a9e('0x1b')]=function(_0x105080){try{if(!_['isNil'](agents[_0x105080[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format'](_0x0a9e('0x1d'),_0x105080['uniqueid']),_0x105080);utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x1e'),_0x105080[_0x0a9e('0x5')],agents[_0x105080[_0x0a9e('0x13')]]['membername'],_0x105080[_0x0a9e('0x13')]));agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1b')]=!![];agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();agents[_0x105080[_0x0a9e('0x13')]]['lastevent']='timeout';agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x21')]=_0x0a9e('0x22');agents[_0x105080[_0x0a9e('0x13')]]['holdtime']=_0x105080[_0x0a9e('0x23')]?parseInt(_0x105080['ringtime'])/0x3e8:0x0;agents[_0x105080[_0x0a9e('0x13')]]['talktime']=0x0;unanswered[_0x0a9e('0x24')](_0x105080[_0x0a9e('0x13')]);}}catch(_0x25fba9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x1d'),_0x105080[_0x0a9e('0x5')]),_0x25fba9);}};exports[_0x0a9e('0x25')]=function(_0x5a101a){try{_[_0x0a9e('0x26')](agents,function(_0x468813,_0x2b1f27){if(_0x468813[_0x0a9e('0x5')]==_0x5a101a['uniqueid']&&!_[_0x0a9e('0x27')](unanswered,_0x468813[_0x0a9e('0x13')])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a[_0x0a9e('0x5')]),_0x5a101a);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x29'),_0x5a101a['uniqueid'],_0x468813[_0x0a9e('0x8')],_0x468813['destuniqueid']));_0x468813[_0x0a9e('0x1b')]=!![];_0x468813[_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();_0x468813[_0x0a9e('0xb')]=_0x0a9e('0x2a');_0x468813['reason']=_0x0a9e('0x2a');_0x468813[_0x0a9e('0x2b')]=_0x5a101a[_0x0a9e('0x2b')];_0x468813[_0x0a9e('0x2c')]=0x0;writeDB(_0x468813);}});}catch(_0x2b45ea){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a['uniqueid']),_0x2b45ea);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(agents[_0x5e7238[_0x0a9e('0x13')]]){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238['uniqueid']),_0x5e7238);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x2f'),_0x5e7238[_0x0a9e('0x5')],agents[_0x5e7238['destuniqueid']]['membername'],_0x5e7238[_0x0a9e('0x13')]));agents[_0x5e7238['destuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0xa')]=_0x5e7238['connectedlinenum'];agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0x31')]=_0x5e7238[_0x0a9e('0x31')];agents[_0x5e7238['destuniqueid']][_0x0a9e('0x2b')]=_0x5e7238[_0x0a9e('0x23')];agents[_0x5e7238[_0x0a9e('0x13')]]['lastevent']='connect';_[_0x0a9e('0x26')](agents,function(_0x40d766,_0x5adda1){if(_0x40d766[_0x0a9e('0x13')]!=_0x5e7238[_0x0a9e('0x13')]&&_0x40d766[_0x0a9e('0x5')]==_0x5e7238[_0x0a9e('0x5')]){_0x40d766['talktime']=0x0;_0x40d766['holdtime']=_0x5e7238[_0x0a9e('0x23')];_0x40d766[_0x0a9e('0x1b')]=!![];_0x40d766['agentringnoanswerAt']=utils[_0x0a9e('0x20')]();_0x40d766[_0x0a9e('0xb')]=_0x0a9e('0x32');_0x40d766['reason']=_0x0a9e('0x32');_0x40d766[_0x0a9e('0x33')]=_0x5e7238[_0x0a9e('0x13')];_0x40d766[_0x0a9e('0x34')]=_0x5e7238[_0x0a9e('0x8')];writeDB(_0x40d766);}});}}catch(_0xeaa5e5){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238[_0x0a9e('0x5')]),_0xeaa5e5);}};exports[_0x0a9e('0xe')]=function(_0x148007){try{if(!_[_0x0a9e('0x35')](agents[_0x148007[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x148007[_0x0a9e('0x5')]),_0x148007);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x36'),_0x148007[_0x0a9e('0x5')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x148007[_0x0a9e('0x13')]));agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0xe')]=!![];agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')]=utils['now']();agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x30')]);agents[_0x148007[_0x0a9e('0x13')]]['reason']=_0x148007[_0x0a9e('0x21')];agents[_0x148007['destuniqueid']][_0x0a9e('0xb')]=_0x0a9e('0x39');writeDB(agents[_0x148007[_0x0a9e('0x13')]]);}}catch(_0x562fb4){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x3a'),_0x148007[_0x0a9e('0x5')]),_0x562fb4);}};exports[_0x0a9e('0x3b')]=function(_0x37be73){try{if(!_[_0x0a9e('0x35')](agents[_0x37be73['transfereruniqueid']])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x37be73);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x3d'),_0x37be73[_0x0a9e('0x5')],agents[_0x37be73[_0x0a9e('0x3e')]]['membername'],agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x5')]));agents[_0x37be73['transfereruniqueid']]['transfer']=!![];agents[_0x37be73['transfereruniqueid']][_0x0a9e('0x3f')]=_0x0a9e('0x40');agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x41')]=_0x37be73[_0x0a9e('0x42')];agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x43')]=agents[_0x37be73[_0x0a9e('0x3e')]]['uniqueid'];}}catch(_0x4b1b9f){utils['error'](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x4b1b9f);}};exports['attendedtransfer']=function(_0x2b69d9){try{utils[_0x0a9e('0x1c')](util['format']('[%s][agents][attendedtransfer]',_0x2b69d9[_0x0a9e('0x44')]),_0x2b69d9);if(_0x2b69d9['origtransfereruniqueid']==_0x2b69d9[_0x0a9e('0x45')]){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x46')]])){utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x46')]]['membername']));agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x47')]=!![];agents[_0x2b69d9[_0x0a9e('0x46')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x41')]=_0x2b69d9['origtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x46')]]['transferuniqueid']=_0x2b69d9['origtransfereruniqueid'];}if(_0x2b69d9['transfereeuniqueid']&&agents[_0x2b69d9[_0x0a9e('0x49')]]){agents[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9[_0x0a9e('0x49')]]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x49')]]);transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x9')];transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x4c')];transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x17')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x2;}}else if(_0x2b69d9['secondtransfereruniqueid']==_0x2b69d9['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x44')]])){utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x4d'),_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x8')]));agents[_0x2b69d9[_0x0a9e('0x44')]]['transfer']=!![];agents[_0x2b69d9[_0x0a9e('0x44')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x41')]=_0x2b69d9['secondtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x43')]=_0x2b69d9[_0x0a9e('0x46')];}if(_0x2b69d9[_0x0a9e('0x4e')]&&agents[_0x2b69d9['transfertargetuniqueid']]){agents[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9['transfertargetuniqueid']]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x4e')]]);transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridnum'];transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridname'];transfers[_0x2b69d9[_0x0a9e('0x4e')]]['agentcalledAt']=utils['now']();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x2;}}}catch(_0x54a37d){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x4f'),_0x2b69d9[_0x0a9e('0x44')]),_0x54a37d);}};exports[_0x0a9e('0x50')]=function(_0x2b8192){try{utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x51'),_0x2b8192[_0x0a9e('0x5')]),_0x2b8192);if(agents[_0x2b8192['uniqueid']]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]===_0x0a9e('0x22')){if(_0x2b8192['cause']==='21'){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]='rejected';agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]=_0x0a9e('0x52');}utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b8192['uniqueid'],agents[_0x2b8192['uniqueid']][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);var _0xeef20=unanswered[_0x0a9e('0x53')](_0x2b8192['uniqueid']);if(_0xeef20>-0x1){unanswered[_0x0a9e('0x54')](_0xeef20,0x1);}}if(transfers[_0x2b8192[_0x0a9e('0x5')]]){transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcomplete']=!![];transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcompleteAt']=utils[_0x0a9e('0x20')]();transfers[_0x2b8192[_0x0a9e('0x5')]]['talktime']=utils[_0x0a9e('0x38')](transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')],transfers[_0x2b8192[_0x0a9e('0x5')]]['agentconnectAt']);transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]=_0x0a9e('0x55');transfers[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x56'),_0x2b8192['uniqueid'],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(transfers[_0x2b8192[_0x0a9e('0x5')]],!![]);}if(agents[_0x2b8192[_0x0a9e('0x5')]]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xe')]=!![];agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')]=utils['now']();agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x2b8192['uniqueid']][_0x0a9e('0x37')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]);agents[_0x2b8192[_0x0a9e('0x5')]]['reason']=agents[_0x2b8192['uniqueid']][_0x0a9e('0x47')]?_0x0a9e('0x47'):'agent';agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x56'),_0x2b8192[_0x0a9e('0x5')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);}}catch(_0x3ca9b9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')]('[%s][agents][hangup]',_0x2b8192[_0x0a9e('0x5')]),_0x3ca9b9);}}; \ No newline at end of file +var _0xea28=['agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid'];(function(_0x268e69,_0x47acca){var _0x59e3e6=function(_0x50b284){while(--_0x50b284){_0x268e69['push'](_0x268e69['shift']());}};_0x59e3e6(++_0x47acca);}(_0xea28,0x13a));var _0x8ea2=function(_0x2f4613,_0x1b1fb1){_0x2f4613=_0x2f4613-0x0;var _0x11dc6e=_0xea28[_0x2f4613];return _0x11dc6e;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var utils=require(_0x8ea2('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26155f,_0x459c4e){utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x5'),_0x26155f['uniqueid'],_0x26155f[_0x8ea2('0x6')],_0x26155f[_0x8ea2('0x7')],_0x26155f[_0x8ea2('0x8')],_0x26155f['interface'],_0x26155f[_0x8ea2('0x9')],_0x26155f[_0x8ea2('0xa')],_0x26155f[_0x8ea2('0xb')]));if(_0x26155f[_0x8ea2('0x7')]){utils[_0x8ea2('0xc')](_0x26155f[_0x8ea2('0x7')])[_0x8ea2('0xd')](function(_0x320750){if(_0x320750){_0x26155f[_0x8ea2('0xe')]=_0x320750[_0x8ea2('0xe')];_0x26155f[_0x8ea2('0xf')]=_0x26155f[_0x8ea2('0x10')]?_0x320750['acw']:![];_0x26155f['acwtime']=_0x26155f[_0x8ea2('0xf')]?_0x320750[_0x8ea2('0x11')]:0x0;}utils[_0x8ea2('0x12')]('CreateVoiceAgentReport',_0x26155f);});}else{utils[_0x8ea2('0x12')](_0x8ea2('0x13'),_0x26155f);}if(_0x459c4e){delete transfers[_0x26155f[_0x8ea2('0x14')]];}else{delete agents[_0x26155f[_0x8ea2('0x15')]];}}exports[_0x8ea2('0x16')]=function(_0x5e662e){try{utils[_0x8ea2('0x17')](util['format']('[%s][agents][agentcalled]',_0x5e662e[_0x8ea2('0x14')]),_0x5e662e);agents[_0x5e662e[_0x8ea2('0x15')]]=_0x5e662e;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x1a');agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xa')]=null;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=null;utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x1c'),_0x5e662e[_0x8ea2('0x14')],agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x5e662e[_0x8ea2('0x15')]));}catch(_0x233a40){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')]('[%s][agents][agentcalled]',_0x5e662e['uniqueid']),_0x233a40);}};exports[_0x8ea2('0x1e')]=function(_0x248c18){try{if(!_[_0x8ea2('0x1f')](agents[_0x248c18['destuniqueid']])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][agentringnoanswer]',_0x248c18[_0x8ea2('0x14')]),_0x248c18);utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x20'),_0x248c18[_0x8ea2('0x14')],agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x248c18[_0x8ea2('0x15')]));agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswer']=!![];agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswerAt']=utils[_0x8ea2('0x19')]();agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0xb')]='timeout';agents[_0x248c18['destuniqueid']][_0x8ea2('0x21')]='timeout';agents[_0x248c18[_0x8ea2('0x15')]]['holdtime']=_0x248c18[_0x8ea2('0x22')]?parseInt(_0x248c18[_0x8ea2('0x22')])/0x3e8:0x0;agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x23')]=0x0;unanswered['push'](_0x248c18['destuniqueid']);}}catch(_0xacaa6c){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x24'),_0x248c18[_0x8ea2('0x14')]),_0xacaa6c);}};exports[_0x8ea2('0x25')]=function(_0x307c74){try{_[_0x8ea2('0x26')](agents,function(_0x32e225,_0x316707){if(_0x32e225[_0x8ea2('0x14')]==_0x307c74[_0x8ea2('0x14')]&&!_['includes'](unanswered,_0x32e225['destuniqueid'])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][queuecallerabandon]',_0x307c74['uniqueid']),_0x307c74);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x27'),_0x307c74[_0x8ea2('0x14')],_0x32e225['membername'],_0x32e225[_0x8ea2('0x15')]));_0x32e225[_0x8ea2('0x1e')]=!![];_0x32e225[_0x8ea2('0x28')]=utils['now']();_0x32e225['lastevent']='abandoned';_0x32e225[_0x8ea2('0x21')]=_0x8ea2('0x29');_0x32e225[_0x8ea2('0x2a')]=_0x307c74['holdtime'];_0x32e225[_0x8ea2('0x23')]=0x0;writeDB(_0x32e225);}});}catch(_0x391b08){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x2b'),_0x307c74[_0x8ea2('0x14')]),_0x391b08);}};exports[_0x8ea2('0x2c')]=function(_0x1fc76a){try{if(agents[_0x1fc76a['destuniqueid']]){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x1fc76a);utils['info'](util[_0x8ea2('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1fc76a[_0x8ea2('0x14')],agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x1fc76a[_0x8ea2('0x15')]));agents[_0x1fc76a['destuniqueid']][_0x8ea2('0x2e')]=utils['now']();agents[_0x1fc76a['destuniqueid']][_0x8ea2('0xa')]=_0x1fc76a['connectedlinenum'];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=_0x1fc76a[_0x8ea2('0x1b')];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x2a')]=_0x1fc76a['ringtime'];agents[_0x1fc76a[_0x8ea2('0x15')]]['lastevent']=_0x8ea2('0x2f');_[_0x8ea2('0x26')](agents,function(_0x6d0e0c,_0x3995ff){if(_0x6d0e0c['destuniqueid']!=_0x1fc76a[_0x8ea2('0x15')]&&_0x6d0e0c['uniqueid']==_0x1fc76a[_0x8ea2('0x14')]){_0x6d0e0c['talktime']=0x0;_0x6d0e0c[_0x8ea2('0x2a')]=_0x1fc76a[_0x8ea2('0x22')];_0x6d0e0c[_0x8ea2('0x1e')]=!![];_0x6d0e0c[_0x8ea2('0x28')]=utils[_0x8ea2('0x19')]();_0x6d0e0c[_0x8ea2('0xb')]=_0x8ea2('0x30');_0x6d0e0c['reason']='answered_elsewhere';_0x6d0e0c[_0x8ea2('0x31')]=_0x1fc76a['destuniqueid'];_0x6d0e0c['answeredelsewheremembername']=_0x1fc76a['membername'];writeDB(_0x6d0e0c);}});}}catch(_0x3cbc09){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x3cbc09);}};exports[_0x8ea2('0x10')]=function(_0x989d9b){try{if(!_[_0x8ea2('0x1f')](agents[_0x989d9b[_0x8ea2('0x15')]])){utils[_0x8ea2('0x17')](util['format'](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x989d9b);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x33'),_0x989d9b[_0x8ea2('0x14')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x989d9b[_0x8ea2('0x15')]));agents[_0x989d9b['destuniqueid']][_0x8ea2('0x10')]=!![];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')]=utils['now']();agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x2e')]);agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x21')]=_0x989d9b[_0x8ea2('0x21')];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x36');writeDB(agents[_0x989d9b[_0x8ea2('0x15')]]);}}catch(_0x5c1212){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x5c1212);}};exports[_0x8ea2('0x37')]=function(_0x1daa25){try{if(!_[_0x8ea2('0x1f')](agents[_0x1daa25[_0x8ea2('0x38')]])){utils['debug'](util[_0x8ea2('0x4')](_0x8ea2('0x39'),_0x1daa25[_0x8ea2('0x14')]),_0x1daa25);utils['info'](util['format'](_0x8ea2('0x3a'),_0x1daa25[_0x8ea2('0x14')],agents[_0x1daa25[_0x8ea2('0x38')]]['membername'],agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')]));agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3b')]=!![];agents[_0x1daa25[_0x8ea2('0x38')]]['transfertype']='blind';agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3c')]=_0x1daa25[_0x8ea2('0x3d')];agents[_0x1daa25['transfereruniqueid']][_0x8ea2('0x3e')]=agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')];}}catch(_0x54c9d7){utils['error'](util['format']('[%s][agents][blindtransfer]',_0x1daa25['uniqueid']),_0x54c9d7);}};exports[_0x8ea2('0x3f')]=function(_0x3020ad){try{utils['debug'](util['format'](_0x8ea2('0x40'),_0x3020ad[_0x8ea2('0x41')]),_0x3020ad);if(_0x3020ad[_0x8ea2('0x41')]==_0x3020ad['origtransfererlinkedid']){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad[_0x8ea2('0x42')]])){utils['info'](util[_0x8ea2('0x4')](_0x8ea2('0x43'),_0x3020ad[_0x8ea2('0x41')],agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x8')]));agents[_0x3020ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x44')]=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x46')];agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3e')]=_0x3020ad['origtransfereruniqueid'];}if(_0x3020ad['transfereeuniqueid']&&agents[_0x3020ad['transfereeuniqueid']]){agents[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x47')]]=_[_0x8ea2('0x49')](agents[_0x3020ad['transfereeuniqueid']]);transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x9')]=agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x9')];transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x4a')];transfers[_0x3020ad['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfereeuniqueid']][_0x8ea2('0x48')]=0x2;}}else if(_0x3020ad[_0x8ea2('0x42')]==_0x3020ad[_0x8ea2('0x4b')]){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad['origtransfereruniqueid']])){utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x43'),_0x3020ad['origtransfereruniqueid'],agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x8')]));agents[_0x3020ad['origtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad[_0x8ea2('0x41')]]['transfertype']=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x4c')];agents[_0x3020ad['origtransfereruniqueid']][_0x8ea2('0x3e')]=_0x3020ad[_0x8ea2('0x42')];}if(_0x3020ad[_0x8ea2('0x4d')]&&agents[_0x3020ad[_0x8ea2('0x4d')]]){agents[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x4d')]]=_[_0x8ea2('0x49')](agents[_0x3020ad[_0x8ea2('0x4d')]]);transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x9')]=agents[_0x3020ad[_0x8ea2('0x41')]]['calleridnum'];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x4a')];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfertargetuniqueid']][_0x8ea2('0x48')]=0x2;}}}catch(_0x383027){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x40'),_0x3020ad['origtransfereruniqueid']),_0x383027);}};exports['hangup']=function(_0x5d4d9e){try{utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x5d4d9e);if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e[_0x8ea2('0x14')]]['reason']===_0x8ea2('0x4f')){if(_0x5d4d9e[_0x8ea2('0x50')]==='21'){agents[_0x5d4d9e['uniqueid']]['reason']=_0x8ea2('0x51');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x51');}utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e['uniqueid'],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);var _0x115d5f=unanswered['indexOf'](_0x5d4d9e[_0x8ea2('0x14')]);if(_0x115d5f>-0x1){unanswered['splice'](_0x115d5f,0x1);}}if(transfers[_0x5d4d9e['uniqueid']]){transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x10')]=!![];transfers[_0x5d4d9e['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x5d4d9e[_0x8ea2('0x14')]]['talktime']=utils['diffTime'](transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x2e')]);transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')]=_0x8ea2('0x53');transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e[_0x8ea2('0x14')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(transfers[_0x5d4d9e['uniqueid']],!![]);}if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x2e')]){agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x10')]=!![];agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentcompleteAt']=utils[_0x8ea2('0x19')]();agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentconnectAt']);agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x21')]=agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x3b')]?_0x8ea2('0x3b'):_0x8ea2('0x53');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5d4d9e[_0x8ea2('0x14')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);}}catch(_0x4b4d64){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x4b4d64);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 92c2820..50f7088 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6455=['_attended','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','execif','gotoif','[%s][calls][newexten]','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','error','format','newstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield'];(function(_0x3186ae,_0x5d615c){var _0x247818=function(_0x33e528){while(--_0x33e528){_0x3186ae['push'](_0x3186ae['shift']());}};_0x247818(++_0x5d615c);}(_0x6455,0x97));var _0x5645=function(_0x15b3cd,_0x30e16e){_0x15b3cd=_0x15b3cd-0x0;var _0x4dc5d2=_0x6455[_0x15b3cd];return _0x4dc5d2;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var utils=require(_0x5645('0x1'));var transfers=require(_0x5645('0x2'));var dispositions=[_0x5645('0x3'),_0x5645('0x4'),_0x5645('0x4'),_0x5645('0x3'),'NO\x20ANSWER',_0x5645('0x3'),_0x5645('0x5'),_0x5645('0x6'),_0x5645('0x4'),_0x5645('0x4'),_0x5645('0x4')];var channels={};function writeDB(_0xa14a06){var _0x278d86;if(transfers['blinds'][_0xa14a06['uniqueid']]){_0x278d86=_0xa14a06[_0x5645('0x7')];_0xa14a06[_0x5645('0x7')]=transfers[_0x5645('0x8')][_0xa14a06[_0x5645('0x7')]][_0x5645('0x9')];}utils[_0x5645('0xa')](util['format'](_0x5645('0xb'),_0xa14a06[_0x5645('0x7')],_0xa14a06[_0x5645('0xc')],_0xa14a06[_0x5645('0xd')],_0xa14a06['membername'],_0xa14a06[_0x5645('0xe')],_0xa14a06['calleridnum'],_0xa14a06[_0x5645('0xf')],_0xa14a06[_0x5645('0x10')]));if(_0xa14a06[_0x5645('0x11')]){utils[_0x5645('0x12')](_0xa14a06[_0x5645('0x11')])[_0x5645('0x13')](function(_0x45cbe8){if(_0x45cbe8){_0xa14a06[_0x5645('0x14')]=_0x45cbe8['id'];}utils['request'](_0x5645('0x15'),_0xa14a06);});}else{utils[_0x5645('0x16')](_0x5645('0x15'),_0xa14a06);}if(channels[_0xa14a06['uniqueid']]){delete channels[_0xa14a06['uniqueid']];}else if(_0x278d86&&channels[_0x278d86]){if(!transfers[_0x5645('0x8')][_0x278d86][_0x5645('0x17')])delete transfers['blinds'][_0x278d86];delete channels[_0x278d86];}}exports[_0x5645('0x18')]=function(_0x3fe599){try{utils[_0x5645('0x19')](util['format'](_0x5645('0x1a'),_0x3fe599[_0x5645('0x7')]),_0x3fe599);if(_0x3fe599[_0x5645('0x7')]==_0x3fe599[_0x5645('0x1b')]&&_0x3fe599['channel']!=_0x5645('0x1c')){utils['info'](util['format'](_0x5645('0x1d'),_0x3fe599[_0x5645('0x7')],_0x3fe599[_0x5645('0x1e')],_0x3fe599['exten']));channels[_0x3fe599[_0x5645('0x7')]]={'uniqueid':_0x3fe599['uniqueid'],'accountcode':_0x3fe599[_0x5645('0x11')],'source':_0x3fe599['calleridnum'],'destination':_0x3fe599['exten'],'destinationcontext':_0x3fe599[_0x5645('0x1e')],'channel':_0x3fe599['channel'],'starttime':utils[_0x5645('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5645('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x18680f){utils[_0x5645('0x20')](util[_0x5645('0x21')]('[%s][calls][newchannel]',_0x3fe599[_0x5645('0x7')]),_0x18680f);}};exports[_0x5645('0x22')]=function(_0x3f6929){try{utils[_0x5645('0x19')](util['format']('[%s][calls][newstate]',_0x3f6929['uniqueid']),_0x3f6929);if(!_['isNil'](channels[_0x3f6929[_0x5645('0x7')]])&&_0x3f6929['channelstate']==0x6){utils['info'](util[_0x5645('0x21')](_0x5645('0x23'),_0x3f6929[_0x5645('0x7')],_0x3f6929[_0x5645('0x1e')],_0x3f6929[_0x5645('0xc')]));if(_[_0x5645('0x24')](channels[_0x3f6929[_0x5645('0x7')]][_0x5645('0x25')])){channels[_0x3f6929[_0x5645('0x7')]][_0x5645('0x25')]=utils[_0x5645('0x1f')]();}}else if(!_[_0x5645('0x24')](channels[_0x3f6929[_0x5645('0x1b')]])&&_0x3f6929[_0x5645('0x26')]==0x6&&_0x3f6929['context']!=_0x5645('0x27')){utils['info'](util[_0x5645('0x21')](_0x5645('0x28'),_0x3f6929[_0x5645('0x7')],_0x3f6929[_0x5645('0x1b')],_0x3f6929[_0x5645('0x1e')],_0x3f6929[_0x5645('0xc')]));channels[_0x3f6929['linkedid']]['accountcode']=_0x3f6929[_0x5645('0x11')];channels[_0x3f6929[_0x5645('0x1b')]][_0x5645('0x29')]=_0x3f6929[_0x5645('0xc')];if(_[_0x5645('0x24')](channels[_0x3f6929[_0x5645('0x1b')]][_0x5645('0x2a')])){channels[_0x3f6929[_0x5645('0x1b')]][_0x5645('0x2a')]=utils[_0x5645('0x1f')]();}channels[_0x3f6929[_0x5645('0x1b')]]['disposition']=dispositions[_['toNumber'](_0x3f6929[_0x5645('0x26')])]||'ANSWERED';}}catch(_0x245316){utils['error'](util[_0x5645('0x21')]('[%s][calls][newstate]',_0x3f6929[_0x5645('0x7')]),_0x245316);}};exports[_0x5645('0x2b')]=function(_0x3d6c49){try{if(!_[_0x5645('0x24')](channels[_0x3d6c49[_0x5645('0x7')]])){utils[_0x5645('0x19')](util['format'](_0x5645('0x2c'),_0x3d6c49[_0x5645('0x7')]),_0x3d6c49);if(_[_0x5645('0x24')](channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x2d')])){channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x2d')]=_0x3d6c49[_0x5645('0x2e')]+'\x20<'+_0x3d6c49['calleridnum']+'>';}utils[_0x5645('0xa')](util['format'](_0x5645('0x2f'),_0x3d6c49[_0x5645('0x7')],channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x2d')],_0x3d6c49[_0x5645('0x30')]));channels[_0x3d6c49['uniqueid']][_0x5645('0x31')]=utils[_0x5645('0x1f')]();channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x32')]=utils[_0x5645('0x33')](channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x31')],channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x34')]);channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x35')]=channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x2a')]?utils[_0x5645('0x33')](channels[_0x3d6c49[_0x5645('0x7')]][_0x5645('0x31')],channels[_0x3d6c49['uniqueid']][_0x5645('0x2a')]):0x0;writeDB(channels[_0x3d6c49[_0x5645('0x7')]]);}}catch(_0x488a72){utils[_0x5645('0x20')](util[_0x5645('0x21')]('[%s][calls][hangup]',_0x3d6c49[_0x5645('0x7')]),_0x488a72);}};exports[_0x5645('0x36')]=function(_0x36074a){try{if(!_[_0x5645('0x24')](channels[_0x36074a[_0x5645('0x37')]])){utils[_0x5645('0x19')](util[_0x5645('0x21')]('[%s][calls][attendedtransfer]',_0x36074a['origtransfereruniqueid']),_0x36074a);if(channels[_0x36074a[_0x5645('0x37')]][_0x5645('0xc')]==_0x36074a[_0x5645('0x38')]){utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x39'),_0x36074a[_0x5645('0x3a')],_0x36074a[_0x5645('0x37')],_0x36074a[_0x5645('0x3b')]));channels[_0x36074a[_0x5645('0x37')]][_0x5645('0x29')]=_0x36074a[_0x5645('0x3b')];channels[_0x36074a[_0x5645('0x37')]][_0x5645('0x3c')]=_0x5645('0x3d');}else if(channels[_0x36074a[_0x5645('0x37')]][_0x5645('0xc')]=_0x36074a['transfertargetchannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x36074a[_0x5645('0x3a')],_0x36074a[_0x5645('0x37')],_0x36074a[_0x5645('0x3e')]));channels[_0x36074a[_0x5645('0x37')]][_0x5645('0x29')]=_0x36074a['origtransfererchannel'];channels[_0x36074a[_0x5645('0x37')]][_0x5645('0x3c')]=_0x5645('0x3d');}}}catch(_0x407dd1){utils[_0x5645('0x20')](util['format'](_0x5645('0x3f'),_0x36074a[_0x5645('0x3a')]),_0x407dd1);}};exports[_0x5645('0x40')]=function(_0x68598e){try{if(!_[_0x5645('0x24')](channels[_0x68598e[_0x5645('0x7')]])){utils[_0x5645('0x19')](util[_0x5645('0x21')]('[%s][calls][musiconholdstart]',_0x68598e['uniqueid']),_0x68598e);channels[_0x68598e[_0x5645('0x7')]][_0x5645('0x41')]=utils['now']();utils['info'](util[_0x5645('0x21')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x68598e[_0x5645('0x7')],channels[_0x68598e[_0x5645('0x7')]][_0x5645('0x41')]));}}catch(_0x3e282d){utils[_0x5645('0x20')](util['format'](_0x5645('0x42'),_0x68598e['uniqueid']),_0x3e282d);}};exports['musiconholdstop']=function(_0x234e24){try{if(!_[_0x5645('0x24')](channels[_0x234e24[_0x5645('0x7')]])){utils[_0x5645('0x19')](util[_0x5645('0x21')](_0x5645('0x43'),_0x234e24[_0x5645('0x7')]),_0x234e24);if(!_[_0x5645('0x24')](channels[_0x234e24[_0x5645('0x7')]][_0x5645('0x41')])){channels[_0x234e24[_0x5645('0x7')]][_0x5645('0x44')]+=utils['diffTime'](utils['now'](),channels[_0x234e24[_0x5645('0x7')]][_0x5645('0x41')]);utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x45'),_0x234e24['uniqueid'],channels[_0x234e24[_0x5645('0x7')]][_0x5645('0x44')]));delete channels[_0x234e24['uniqueid']][_0x5645('0x41')];}}}catch(_0x12a577){utils[_0x5645('0x20')](util[_0x5645('0x21')](_0x5645('0x43'),_0x234e24['uniqueid']),_0x12a577);}};exports[_0x5645('0x46')]=function(_0xd1f0b){try{if(!_[_0x5645('0x24')](channels[_0xd1f0b[_0x5645('0x7')]])){utils['debug'](util[_0x5645('0x21')](_0x5645('0x47'),_0xd1f0b[_0x5645('0x7')]),_0xd1f0b);if(!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x49')])){utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x4a'),_0xd1f0b['uniqueid'],_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b[_0x5645('0x7')]]['source']=_0xd1f0b['value'];}if(!_[_0x5645('0x24')](_0xd1f0b['variable'][_0x5645('0x4c')])){utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x4d'),_0xd1f0b[_0x5645('0x7')],_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b[_0x5645('0x7')]]['destination']=_0xd1f0b[_0x5645('0x4b')];channels[_0xd1f0b[_0x5645('0x7')]][_0x5645('0x2d')]='\x22'+_0xd1f0b[_0x5645('0x4b')]+_0x5645('0x4e')+_0xd1f0b[_0x5645('0x4b')]+'>';}if(!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')]['xmd-callerid-preview'])||!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x4f')])){utils[_0x5645('0xa')](util['format'](_0x5645('0x50'),_0xd1f0b[_0x5645('0x7')],!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x51')])?_0x5645('0x51'):_0x5645('0x4f'),_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b['uniqueid']][_0x5645('0x2d')]=_0xd1f0b[_0x5645('0x4b')];}if(!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x52')])||!_[_0x5645('0x24')](_0xd1f0b['variable'][_0x5645('0x53')])){utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x50'),_0xd1f0b['uniqueid'],!_['isNil'](_0xd1f0b[_0x5645('0x48')][_0x5645('0x52')])?_0x5645('0x52'):'xmcs-queue',_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b[_0x5645('0x7')]][_0x5645('0x54')]=_0x5645('0x55');channels[_0xd1f0b[_0x5645('0x7')]][_0x5645('0x56')]=_0xd1f0b[_0x5645('0x4b')];channels[_0xd1f0b[_0x5645('0x7')]]['queue']=!![];}if(!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x57')])){utils[_0x5645('0xa')](util[_0x5645('0x21')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xd1f0b['uniqueid'],_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b['uniqueid']]['ContactId']=_0xd1f0b['value'];}if(!_[_0x5645('0x24')](_0xd1f0b[_0x5645('0x48')][_0x5645('0x58')])){utils[_0x5645('0xa')](util[_0x5645('0x21')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xd1f0b[_0x5645('0x7')],_0xd1f0b['value']));channels[_0xd1f0b[_0x5645('0x7')]]['type']=_0xd1f0b[_0x5645('0x4b')];}if(!_['isNil'](_0xd1f0b['variable'][_0x5645('0x59')])){utils['info'](util[_0x5645('0x21')](_0x5645('0x5a'),_0xd1f0b[_0x5645('0x7')],_0xd1f0b['value']));channels[_0xd1f0b[_0x5645('0x7')]][_0x5645('0x5b')]=_0xd1f0b['value'];}if(!_['isNil'](_0xd1f0b['variable']['sipcallid'])){utils[_0x5645('0xa')](util[_0x5645('0x21')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xd1f0b[_0x5645('0x7')],_0xd1f0b[_0x5645('0x4b')]));channels[_0xd1f0b[_0x5645('0x7')]][_0x5645('0x5c')]=_0xd1f0b[_0x5645('0x4b')];}}}catch(_0x17194e){utils[_0x5645('0x20')](util[_0x5645('0x21')](_0x5645('0x47'),_0xd1f0b[_0x5645('0x7')]),_0x17194e);}};exports['newexten']=function(_0x27d126){try{if(!_['isNil'](channels[_0x27d126[_0x5645('0x7')]])){utils['debug'](util[_0x5645('0x21')]('[%s][calls][newexten]',_0x27d126[_0x5645('0x7')]),_0x27d126);utils[_0x5645('0xa')](util[_0x5645('0x21')](_0x5645('0x5d'),_0x27d126[_0x5645('0x7')],_0x27d126[_0x5645('0x5e')],_0x27d126[_0x5645('0x5f')]));if(_0x27d126[_0x5645('0x5e')][_0x5645('0x60')]()==_0x5645('0x61')&&_[_0x5645('0x62')](_0x27d126[_0x5645('0x5f')][_0x5645('0x60')](),_0x5645('0x63'))){var _0x577a3a=_0x27d126[_0x5645('0x5f')][_0x5645('0x64')]('=');var _0x338e77=_0x577a3a[0x0]['substring'](_0x577a3a[0x0]['lastIndexOf']('(')+0x1,_0x577a3a[0x0][_0x5645('0x65')](')'));var _0x57d7d2=_0x577a3a[0x1];channels[_0x27d126['uniqueid']][_0x338e77]=_0x57d7d2;}if(!_[_0x5645('0x66')]([_0x5645('0x2b'),'noop',_0x5645('0x67'),_0x5645('0x61'),_0x5645('0x68')],_0x27d126[_0x5645('0x5e')][_0x5645('0x60')]())){channels[_0x27d126[_0x5645('0x7')]][_0x5645('0x54')]=_0x27d126[_0x5645('0x5e')];channels[_0x27d126[_0x5645('0x7')]][_0x5645('0x56')]=_0x27d126[_0x5645('0x5f')];}}}catch(_0x101e9a){utils['error'](util[_0x5645('0x21')](_0x5645('0x69'),_0x27d126['uniqueid']),_0x101e9a);}}; \ No newline at end of file +var _0xc7bd=['source','variable','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','toLowerCase','cdr','appdata','lastIndexOf','noop','execif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc7bd,0x86));var _0xdc7b=function(_0x472559,_0x4279b4){_0x472559=_0x472559-0x0;var _0x598a5c=_0xc7bd[_0x472559];return _0x598a5c;};'use strict';var _=require('lodash');var util=require(_0xdc7b('0x0'));var utils=require(_0xdc7b('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0xdc7b('0x2'),'FAILED',_0xdc7b('0x3'),'NO\x20ANSWER',_0xdc7b('0x2'),_0xdc7b('0x2'),_0xdc7b('0x4'),_0xdc7b('0x5'),_0xdc7b('0x3'),_0xdc7b('0x3'),_0xdc7b('0x3')];var channels={};function writeDB(_0x5c81b2){var _0x4061c4;if(transfers[_0xdc7b('0x6')][_0x5c81b2[_0xdc7b('0x7')]]){_0x4061c4=_0x5c81b2['uniqueid'];_0x5c81b2['uniqueid']=transfers[_0xdc7b('0x6')][_0x5c81b2[_0xdc7b('0x7')]][_0xdc7b('0x8')];}utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')](_0xdc7b('0xb'),_0x5c81b2['uniqueid'],_0x5c81b2[_0xdc7b('0xc')],_0x5c81b2[_0xdc7b('0xd')],_0x5c81b2[_0xdc7b('0xe')],_0x5c81b2[_0xdc7b('0xf')],_0x5c81b2[_0xdc7b('0x10')],_0x5c81b2[_0xdc7b('0x11')],_0x5c81b2['lastevent']));if(_0x5c81b2[_0xdc7b('0x12')]){utils[_0xdc7b('0x13')](_0x5c81b2['accountcode'])[_0xdc7b('0x14')](function(_0x5eb8d9){if(_0x5eb8d9){_0x5c81b2[_0xdc7b('0x15')]=_0x5eb8d9['id'];}utils[_0xdc7b('0x16')](_0xdc7b('0x17'),_0x5c81b2);});}else{utils[_0xdc7b('0x16')]('CreateVoiceCallReport',_0x5c81b2);}if(channels[_0x5c81b2[_0xdc7b('0x7')]]){delete channels[_0x5c81b2[_0xdc7b('0x7')]];}else if(_0x4061c4&&channels[_0x4061c4]){if(!transfers['blinds'][_0x4061c4][_0xdc7b('0x18')])delete transfers[_0xdc7b('0x6')][_0x4061c4];delete channels[_0x4061c4];}}exports[_0xdc7b('0x19')]=function(_0x2ed99d){try{utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x1b'),_0x2ed99d[_0xdc7b('0x7')]),_0x2ed99d);if(_0x2ed99d['uniqueid']==_0x2ed99d[_0xdc7b('0x1c')]&&_0x2ed99d['channel']!=_0xdc7b('0x1d')){utils['info'](util[_0xdc7b('0xa')](_0xdc7b('0x1e'),_0x2ed99d[_0xdc7b('0x7')],_0x2ed99d[_0xdc7b('0x1f')],_0x2ed99d[_0xdc7b('0x20')]));channels[_0x2ed99d['uniqueid']]={'uniqueid':_0x2ed99d['uniqueid'],'accountcode':_0x2ed99d['accountcode'],'source':_0x2ed99d[_0xdc7b('0x10')],'destination':_0x2ed99d[_0xdc7b('0x20')],'destinationcontext':_0x2ed99d['context'],'channel':_0x2ed99d[_0xdc7b('0xc')],'starttime':utils[_0xdc7b('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdc7b('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x3c1783){utils['error'](util[_0xdc7b('0xa')](_0xdc7b('0x1b'),_0x2ed99d[_0xdc7b('0x7')]),_0x3c1783);}};exports[_0xdc7b('0x22')]=function(_0x1ce512){try{utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x23'),_0x1ce512[_0xdc7b('0x7')]),_0x1ce512);if(!_['isNil'](channels[_0x1ce512[_0xdc7b('0x7')]])&&_0x1ce512[_0xdc7b('0x24')]==0x6){utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1ce512[_0xdc7b('0x7')],_0x1ce512['context'],_0x1ce512[_0xdc7b('0xc')]));if(_[_0xdc7b('0x25')](channels[_0x1ce512[_0xdc7b('0x7')]]['systemanswertime'])){channels[_0x1ce512[_0xdc7b('0x7')]][_0xdc7b('0x26')]=utils[_0xdc7b('0x21')]();}}else if(!_[_0xdc7b('0x25')](channels[_0x1ce512[_0xdc7b('0x1c')]])&&_0x1ce512['channelstate']==0x6&&_0x1ce512[_0xdc7b('0x1f')]!=_0xdc7b('0x27')){utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1ce512[_0xdc7b('0x7')],_0x1ce512[_0xdc7b('0x1c')],_0x1ce512[_0xdc7b('0x1f')],_0x1ce512[_0xdc7b('0xc')]));channels[_0x1ce512['linkedid']][_0xdc7b('0x12')]=_0x1ce512[_0xdc7b('0x12')];channels[_0x1ce512[_0xdc7b('0x1c')]][_0xdc7b('0x28')]=_0x1ce512[_0xdc7b('0xc')];if(_['isNil'](channels[_0x1ce512[_0xdc7b('0x1c')]]['answertime'])){channels[_0x1ce512[_0xdc7b('0x1c')]][_0xdc7b('0x29')]=utils[_0xdc7b('0x21')]();}channels[_0x1ce512['linkedid']][_0xdc7b('0x2a')]=dispositions[_[_0xdc7b('0x2b')](_0x1ce512[_0xdc7b('0x24')])]||'ANSWERED';}}catch(_0x1fe37e){utils[_0xdc7b('0x2c')](util['format'](_0xdc7b('0x23'),_0x1ce512['uniqueid']),_0x1fe37e);}};exports[_0xdc7b('0x2d')]=function(_0x251129){try{if(!_['isNil'](channels[_0x251129[_0xdc7b('0x7')]])){utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x2e'),_0x251129[_0xdc7b('0x7')]),_0x251129);if(_[_0xdc7b('0x25')](channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x2f')])){channels[_0x251129['uniqueid']][_0xdc7b('0x2f')]=_0x251129[_0xdc7b('0x30')]+'\x20<'+_0x251129[_0xdc7b('0x10')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x251129[_0xdc7b('0x7')],channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x2f')],_0x251129[_0xdc7b('0x31')]));channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x32')]=utils[_0xdc7b('0x21')]();channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x33')]=utils[_0xdc7b('0x34')](channels[_0x251129['uniqueid']][_0xdc7b('0x32')],channels[_0x251129[_0xdc7b('0x7')]]['starttime']);channels[_0x251129['uniqueid']][_0xdc7b('0x35')]=channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x29')]?utils[_0xdc7b('0x34')](channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x32')],channels[_0x251129[_0xdc7b('0x7')]][_0xdc7b('0x29')]):0x0;writeDB(channels[_0x251129[_0xdc7b('0x7')]]);}}catch(_0x1cce95){utils['error'](util[_0xdc7b('0xa')](_0xdc7b('0x2e'),_0x251129[_0xdc7b('0x7')]),_0x1cce95);}};exports['attendedtransfer']=function(_0x168035){try{if(!_[_0xdc7b('0x25')](channels[_0x168035[_0xdc7b('0x36')]])){utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x37'),_0x168035[_0xdc7b('0x38')]),_0x168035);if(channels[_0x168035[_0xdc7b('0x36')]][_0xdc7b('0xc')]==_0x168035[_0xdc7b('0x39')]){utils['info'](util[_0xdc7b('0xa')](_0xdc7b('0x3a'),_0x168035[_0xdc7b('0x38')],_0x168035[_0xdc7b('0x36')],_0x168035[_0xdc7b('0x3b')]));channels[_0x168035['localtwolinkedid']][_0xdc7b('0x28')]=_0x168035[_0xdc7b('0x3b')];channels[_0x168035[_0xdc7b('0x36')]]['userfield']=_0xdc7b('0x3c');}else if(channels[_0x168035[_0xdc7b('0x36')]][_0xdc7b('0xc')]=_0x168035[_0xdc7b('0x3d')]){utils['info'](util['format'](_0xdc7b('0x3a'),_0x168035['origtransfereruniqueid'],_0x168035['localtwolinkedid'],_0x168035[_0xdc7b('0x3e')]));channels[_0x168035[_0xdc7b('0x36')]][_0xdc7b('0x28')]=_0x168035[_0xdc7b('0x3e')];channels[_0x168035[_0xdc7b('0x36')]][_0xdc7b('0x3f')]='_attended';}}}catch(_0x5f2349){utils[_0xdc7b('0x2c')](util[_0xdc7b('0xa')](_0xdc7b('0x37'),_0x168035[_0xdc7b('0x38')]),_0x5f2349);}};exports[_0xdc7b('0x40')]=function(_0x45713c){try{if(!_[_0xdc7b('0x25')](channels[_0x45713c[_0xdc7b('0x7')]])){utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x41'),_0x45713c['uniqueid']),_0x45713c);channels[_0x45713c[_0xdc7b('0x7')]][_0xdc7b('0x42')]=utils['now']();utils['info'](util[_0xdc7b('0xa')](_0xdc7b('0x43'),_0x45713c[_0xdc7b('0x7')],channels[_0x45713c[_0xdc7b('0x7')]][_0xdc7b('0x42')]));}}catch(_0x3f2508){utils[_0xdc7b('0x2c')](util[_0xdc7b('0xa')]('[%s][calls][musiconholdstart]',_0x45713c['uniqueid']),_0x3f2508);}};exports[_0xdc7b('0x44')]=function(_0xa1ce25){try{if(!_[_0xdc7b('0x25')](channels[_0xa1ce25['uniqueid']])){utils['debug'](util[_0xdc7b('0xa')](_0xdc7b('0x45'),_0xa1ce25['uniqueid']),_0xa1ce25);if(!_[_0xdc7b('0x25')](channels[_0xa1ce25[_0xdc7b('0x7')]]['musiconholdstartAt'])){channels[_0xa1ce25[_0xdc7b('0x7')]][_0xdc7b('0x46')]+=utils[_0xdc7b('0x34')](utils[_0xdc7b('0x21')](),channels[_0xa1ce25['uniqueid']][_0xdc7b('0x42')]);utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')](_0xdc7b('0x47'),_0xa1ce25[_0xdc7b('0x7')],channels[_0xa1ce25[_0xdc7b('0x7')]][_0xdc7b('0x46')]));delete channels[_0xa1ce25[_0xdc7b('0x7')]]['musiconholdstartAt'];}}}catch(_0x178202){utils[_0xdc7b('0x2c')](util[_0xdc7b('0xa')](_0xdc7b('0x45'),_0xa1ce25[_0xdc7b('0x7')]),_0x178202);}};exports['varset']=function(_0xfdb787){try{if(!_[_0xdc7b('0x25')](channels[_0xfdb787[_0xdc7b('0x7')]])){utils[_0xdc7b('0x1a')](util[_0xdc7b('0xa')](_0xdc7b('0x48'),_0xfdb787[_0xdc7b('0x7')]),_0xfdb787);if(!_[_0xdc7b('0x25')](_0xfdb787['variable'][_0xdc7b('0x49')])){utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')](_0xdc7b('0x4a'),_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x4c')]=_0xfdb787[_0xdc7b('0x4b')];}if(!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x4e')])){utils['info'](util[_0xdc7b('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787['uniqueid']][_0xdc7b('0x4f')]=_0xfdb787[_0xdc7b('0x4b')];channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x2f')]='\x22'+_0xfdb787[_0xdc7b('0x4b')]+_0xdc7b('0x50')+_0xfdb787[_0xdc7b('0x4b')]+'>';}if(!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x51')])||!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')]['xmd-callerid'])){utils['info'](util[_0xdc7b('0xa')](_0xdc7b('0x52'),_0xfdb787['uniqueid'],!_['isNil'](_0xfdb787['variable'][_0xdc7b('0x51')])?_0xdc7b('0x51'):'xmd-callerid',_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x2f')]=_0xfdb787[_0xdc7b('0x4b')];}if(!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x53')])||!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x54')])){utils[_0xdc7b('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xfdb787[_0xdc7b('0x7')],!_['isNil'](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x53')])?'xmd-queue':_0xdc7b('0x54'),_0xfdb787['value']));channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x55')]='Queue';channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x56')]=_0xfdb787[_0xdc7b('0x4b')];channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0xd')]=!![];}if(!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')]['xmd-contactid'])){utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787['uniqueid']][_0xdc7b('0x57')]=_0xfdb787[_0xdc7b('0x4b')];}if(!_['isNil'](_0xfdb787[_0xdc7b('0x4d')]['xmd-cdrtype'])){utils['info'](util[_0xdc7b('0xa')](_0xdc7b('0x58'),_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787[_0xdc7b('0x7')]]['type']=_0xfdb787[_0xdc7b('0x4b')];}if(!_['isNil'](_0xfdb787['variable'][_0xdc7b('0x59')])){utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')](_0xdc7b('0x5a'),_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787[_0xdc7b('0x7')]][_0xdc7b('0x5b')]=_0xfdb787[_0xdc7b('0x4b')];}if(!_[_0xdc7b('0x25')](_0xfdb787[_0xdc7b('0x4d')][_0xdc7b('0x5c')])){utils[_0xdc7b('0x9')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xfdb787[_0xdc7b('0x7')],_0xfdb787[_0xdc7b('0x4b')]));channels[_0xfdb787['uniqueid']][_0xdc7b('0x5c')]=_0xfdb787['value'];}}}catch(_0x2519e3){utils[_0xdc7b('0x2c')](util[_0xdc7b('0xa')](_0xdc7b('0x48'),_0xfdb787[_0xdc7b('0x7')]),_0x2519e3);}};exports[_0xdc7b('0x5d')]=function(_0x3ecdc4){try{if(!_[_0xdc7b('0x25')](channels[_0x3ecdc4[_0xdc7b('0x7')]])){utils[_0xdc7b('0x1a')](util['format'](_0xdc7b('0x5e'),_0x3ecdc4['uniqueid']),_0x3ecdc4);utils[_0xdc7b('0x9')](util[_0xdc7b('0xa')](_0xdc7b('0x5f'),_0x3ecdc4[_0xdc7b('0x7')],_0x3ecdc4[_0xdc7b('0x60')],_0x3ecdc4['appdata']));if(_0x3ecdc4[_0xdc7b('0x60')]['toLowerCase']()==_0xdc7b('0x61')&&_[_0xdc7b('0x62')](_0x3ecdc4['appdata'][_0xdc7b('0x63')](),_0xdc7b('0x64'))){var _0x589f6f=_0x3ecdc4[_0xdc7b('0x65')]['split']('=');var _0x3e3410=_0x589f6f[0x0]['substring'](_0x589f6f[0x0][_0xdc7b('0x66')]('(')+0x1,_0x589f6f[0x0][_0xdc7b('0x66')](')'));var _0x34ad85=_0x589f6f[0x1];channels[_0x3ecdc4[_0xdc7b('0x7')]][_0x3e3410]=_0x34ad85;}if(!_['includes']([_0xdc7b('0x2d'),_0xdc7b('0x67'),_0xdc7b('0x68'),_0xdc7b('0x61'),'gotoif'],_0x3ecdc4[_0xdc7b('0x60')][_0xdc7b('0x63')]())){channels[_0x3ecdc4['uniqueid']][_0xdc7b('0x55')]=_0x3ecdc4[_0xdc7b('0x60')];channels[_0x3ecdc4['uniqueid']][_0xdc7b('0x56')]=_0x3ecdc4[_0xdc7b('0x65')];}}}catch(_0x2244cb){utils['error'](util[_0xdc7b('0xa')]('[%s][calls][newexten]',_0x3ecdc4[_0xdc7b('0x7')]),_0x2244cb);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6d92e78..21b57db 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd039=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','./utils'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0xd039,0x1e9));var _0x9d03=function(_0x2a65f2,_0x2f5d77){_0x2a65f2=_0x2a65f2-0x0;var _0x110f5b=_0xd039[_0x2a65f2];return _0x110f5b;};'use strict';var utils=require(_0x9d03('0x0'));exports[_0x9d03('0x1')]=function(){utils[_0x9d03('0x2')](_0x9d03('0x3'));};exports[_0x9d03('0x4')]=function(){utils[_0x9d03('0x2')](_0x9d03('0x5'));};exports[_0x9d03('0x6')]=function(){utils[_0x9d03('0x2')](_0x9d03('0x7'));};exports['error']=function(_0x570ec6){utils[_0x9d03('0x8')]('[core]\x20error',_0x570ec6);};exports[_0x9d03('0x9')]=function(){utils[_0x9d03('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x7f7f4c){}; \ No newline at end of file +var _0x7ae3=['close','managerevent','./utils','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x168890,_0x11f7ab){var _0x418f8d=function(_0x18596b){while(--_0x18596b){_0x168890['push'](_0x168890['shift']());}};_0x418f8d(++_0x11f7ab);}(_0x7ae3,0x14a));var _0x37ae=function(_0x2e908b,_0x48503a){_0x2e908b=_0x2e908b-0x0;var _0x1b3b0d=_0x7ae3[_0x2e908b];return _0x1b3b0d;};'use strict';var utils=require(_0x37ae('0x0'));exports['connect']=function(){utils[_0x37ae('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x37ae('0x1')](_0x37ae('0x2'));};exports['fullybooted']=function(){utils[_0x37ae('0x1')](_0x37ae('0x3'));};exports[_0x37ae('0x4')]=function(_0xbcae96){utils[_0x37ae('0x4')](_0x37ae('0x5'),_0xbcae96);};exports[_0x37ae('0x6')]=function(){utils['info']('[core]\x20close');};exports[_0x37ae('0x7')]=function(_0x40a429){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 061a448..a5e55eb 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3b2=['[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','answertime','connect','hangup','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','varset'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0xa3b2,0x170));var _0x2a3b=function(_0x5ce850,_0x28bfe5){_0x5ce850=_0x5ce850-0x0;var _0x12753a=_0xa3b2[_0x5ce850];return _0x12753a;};'use strict';var _=require(_0x2a3b('0x0'));var util=require(_0x2a3b('0x1'));var utils=require(_0x2a3b('0x2'));var dials={};function writeDB(_0x48cc2a){utils[_0x2a3b('0x3')](util[_0x2a3b('0x4')](_0x2a3b('0x5'),_0x48cc2a[_0x2a3b('0x6')],_0x48cc2a[_0x2a3b('0x7')],_0x48cc2a['dialstring'],_0x48cc2a[_0x2a3b('0x8')],_0x48cc2a[_0x2a3b('0x9')],_0x48cc2a[_0x2a3b('0xa')]));utils[_0x2a3b('0xb')](_0x2a3b('0xc'),_0x48cc2a);delete dials[_0x48cc2a[_0x2a3b('0x6')]];}exports['newexten']=function(_0x5d84f1){try{utils[_0x2a3b('0xd')](util['format'](_0x2a3b('0xe'),_0x5d84f1['uniqueid']),_0x5d84f1);utils['info'](util[_0x2a3b('0x4')](_0x2a3b('0xf'),_0x5d84f1[_0x2a3b('0x6')],_0x5d84f1[_0x2a3b('0x10')],_0x5d84f1[_0x2a3b('0x11')]));if(_0x5d84f1[_0x2a3b('0x10')][_0x2a3b('0x12')]()==_0x2a3b('0x13')&&_['startsWith'](_0x5d84f1[_0x2a3b('0x11')][_0x2a3b('0x12')](),_0x2a3b('0x14'))){var _0x1f4fe0=_0x5d84f1[_0x2a3b('0x11')][_0x2a3b('0x15')]('=');dials[_0x5d84f1[_0x2a3b('0x6')]]={'routeId':_0x1f4fe0[0x1]};}}catch(_0x16f63d){utils[_0x2a3b('0x16')](util[_0x2a3b('0x4')](_0x2a3b('0xe'),_0x5d84f1[_0x2a3b('0x6')]),_0x16f63d);}};exports[_0x2a3b('0x17')]=function(_0x3be2ac){try{utils[_0x2a3b('0xd')](util[_0x2a3b('0x4')](_0x2a3b('0x18'),_0x3be2ac[_0x2a3b('0x6')]),_0x3be2ac);if(!_[_0x2a3b('0x19')](_0x3be2ac[_0x2a3b('0x1a')][_0x2a3b('0x1b')])){utils[_0x2a3b('0x3')](util[_0x2a3b('0x4')](_0x2a3b('0x1c'),_0x3be2ac[_0x2a3b('0x6')],_0x3be2ac[_0x2a3b('0x1d')]));dials[_0x3be2ac[_0x2a3b('0x6')]]={'routeId':_0x3be2ac[_0x2a3b('0x1d')]};}}catch(_0x5536f2){utils[_0x2a3b('0x16')](util[_0x2a3b('0x4')](_0x2a3b('0x18'),_0x3be2ac[_0x2a3b('0x6')]),_0x5536f2);}};exports[_0x2a3b('0x1e')]=function(_0x14cefd){try{if(!_[_0x2a3b('0x19')](dials[_0x14cefd[_0x2a3b('0x6')]])){utils[_0x2a3b('0xd')](util[_0x2a3b('0x4')](_0x2a3b('0x1f'),_0x14cefd['uniqueid']),_0x14cefd);dials[_0x14cefd[_0x2a3b('0x6')]]=_[_0x2a3b('0x20')](dials[_0x14cefd[_0x2a3b('0x6')]],_0x14cefd);dials[_0x14cefd[_0x2a3b('0x6')]][_0x2a3b('0x21')]=utils[_0x2a3b('0x22')]();dials[_0x14cefd[_0x2a3b('0x6')]][_0x2a3b('0x23')]='called';utils[_0x2a3b('0x3')](util[_0x2a3b('0x4')](_0x2a3b('0x24'),_0x14cefd[_0x2a3b('0x6')],dials[_0x14cefd['uniqueid']]['starttime']));}}catch(_0x490eb8){utils['error'](util[_0x2a3b('0x4')](_0x2a3b('0x1f'),_0x14cefd[_0x2a3b('0x6')]),_0x490eb8);}};exports['dialend']=function(_0x1aa309){try{if(!_[_0x2a3b('0x19')](dials[_0x1aa309[_0x2a3b('0x6')]])){utils[_0x2a3b('0xd')](util[_0x2a3b('0x4')](_0x2a3b('0x25'),_0x1aa309[_0x2a3b('0x6')]),_0x1aa309);dials[_0x1aa309[_0x2a3b('0x6')]][_0x2a3b('0xa')]=_0x1aa309[_0x2a3b('0xa')];if(_0x1aa309[_0x2a3b('0xa')]=='ANSWER'){dials[_0x1aa309[_0x2a3b('0x6')]]=_[_0x2a3b('0x20')](dials[_0x1aa309[_0x2a3b('0x6')]],_0x1aa309);dials[_0x1aa309[_0x2a3b('0x6')]][_0x2a3b('0x26')]=utils[_0x2a3b('0x22')]();dials[_0x1aa309[_0x2a3b('0x6')]]['lastevent']=_0x2a3b('0x27');utils[_0x2a3b('0x3')](util[_0x2a3b('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1aa309[_0x2a3b('0x6')],_0x1aa309[_0x2a3b('0xa')],dials[_0x1aa309[_0x2a3b('0x6')]]['answertime']));}else{utils[_0x2a3b('0x3')](util[_0x2a3b('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x1aa309[_0x2a3b('0x6')],_0x1aa309['dialstatus']));}}}catch(_0x2f80ec){utils[_0x2a3b('0x16')](util[_0x2a3b('0x4')](_0x2a3b('0x25'),_0x1aa309[_0x2a3b('0x6')]),_0x2f80ec);}};exports[_0x2a3b('0x28')]=function(_0xc49a81){try{if(!_['isNil'](dials[_0xc49a81[_0x2a3b('0x6')]])){utils['debug'](util['format']('[%s][dials][hangup]',_0xc49a81['uniqueid']),_0xc49a81);utils['info'](util[_0x2a3b('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xc49a81['uniqueid'],_0xc49a81[_0x2a3b('0x8')],_0xc49a81[_0x2a3b('0x29')],_0xc49a81[_0x2a3b('0x2a')]));dials[_0xc49a81[_0x2a3b('0x6')]]=_[_0x2a3b('0x20')](dials[_0xc49a81[_0x2a3b('0x6')]],{'endtime':utils[_0x2a3b('0x22')](),'lastevent':'complete'});dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x2b')]=utils[_0x2a3b('0x2c')](dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x2d')],dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x21')]);dials[_0xc49a81['uniqueid']][_0x2a3b('0x2e')]=utils[_0x2a3b('0x2c')](dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x26')]||dials[_0xc49a81[_0x2a3b('0x6')]]['endtime'],dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x21')]);dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x2f')]=dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x26')]?utils[_0x2a3b('0x2c')](dials[_0xc49a81[_0x2a3b('0x6')]][_0x2a3b('0x2d')],dials[_0xc49a81['uniqueid']]['answertime']):0x0;writeDB(dials[_0xc49a81['uniqueid']]);}}catch(_0x4803dc){utils[_0x2a3b('0x16')](util[_0x2a3b('0x4')](_0x2a3b('0x30'),_0xc49a81[_0x2a3b('0x6')]),_0x4803dc);}}; \ No newline at end of file +var _0xb3b8=['calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','now','lastevent','called','starttime','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','holdtime','billableseconds','endtime','lodash','util','./utils','info','format','uniqueid','dialstring'];(function(_0x20313e,_0x21f2a0){var _0x52a0a0=function(_0x238764){while(--_0x238764){_0x20313e['push'](_0x20313e['shift']());}};_0x52a0a0(++_0x21f2a0);}(_0xb3b8,0x165));var _0x8b3b=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0xb3b8[_0x173f10];return _0x53142d;};'use strict';var _=require(_0x8b3b('0x0'));var util=require(_0x8b3b('0x1'));var utils=require(_0x8b3b('0x2'));var dials={};function writeDB(_0x46e71d){utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x46e71d[_0x8b3b('0x5')],_0x46e71d['channel'],_0x46e71d[_0x8b3b('0x6')],_0x46e71d[_0x8b3b('0x7')],_0x46e71d[_0x8b3b('0x8')],_0x46e71d[_0x8b3b('0x9')]));utils[_0x8b3b('0xa')](_0x8b3b('0xb'),_0x46e71d);delete dials[_0x46e71d[_0x8b3b('0x5')]];}exports[_0x8b3b('0xc')]=function(_0x399e76){try{utils[_0x8b3b('0xd')](util[_0x8b3b('0x4')](_0x8b3b('0xe'),_0x399e76[_0x8b3b('0x5')]),_0x399e76);utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')](_0x8b3b('0xf'),_0x399e76['uniqueid'],_0x399e76[_0x8b3b('0x10')],_0x399e76[_0x8b3b('0x11')]));if(_0x399e76[_0x8b3b('0x10')][_0x8b3b('0x12')]()=='set'&&_[_0x8b3b('0x13')](_0x399e76['appdata'][_0x8b3b('0x12')](),_0x8b3b('0x14'))){var _0x61e5ec=_0x399e76[_0x8b3b('0x11')][_0x8b3b('0x15')]('=');dials[_0x399e76[_0x8b3b('0x5')]]={'routeId':_0x61e5ec[0x1]};}}catch(_0x71a5fe){utils[_0x8b3b('0x16')](util[_0x8b3b('0x4')](_0x8b3b('0xe'),_0x399e76['uniqueid']),_0x71a5fe);}};exports[_0x8b3b('0x17')]=function(_0xc80ead){try{utils['debug'](util[_0x8b3b('0x4')](_0x8b3b('0x18'),_0xc80ead[_0x8b3b('0x5')]),_0xc80ead);if(!_['isNil'](_0xc80ead[_0x8b3b('0x19')]['outboundrouteid'])){utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')](_0x8b3b('0x1a'),_0xc80ead[_0x8b3b('0x5')],_0xc80ead[_0x8b3b('0x1b')]));dials[_0xc80ead[_0x8b3b('0x5')]]={'routeId':_0xc80ead[_0x8b3b('0x1b')]};}}catch(_0xe3621d){utils[_0x8b3b('0x16')](util[_0x8b3b('0x4')]('[%s][dials][varset]',_0xc80ead['uniqueid']),_0xe3621d);}};exports[_0x8b3b('0x1c')]=function(_0x1046f1){try{if(!_[_0x8b3b('0x1d')](dials[_0x1046f1[_0x8b3b('0x5')]])){utils[_0x8b3b('0xd')](util[_0x8b3b('0x4')](_0x8b3b('0x1e'),_0x1046f1[_0x8b3b('0x5')]),_0x1046f1);dials[_0x1046f1[_0x8b3b('0x5')]]=_['assign'](dials[_0x1046f1[_0x8b3b('0x5')]],_0x1046f1);dials[_0x1046f1[_0x8b3b('0x5')]]['starttime']=utils[_0x8b3b('0x1f')]();dials[_0x1046f1[_0x8b3b('0x5')]][_0x8b3b('0x20')]=_0x8b3b('0x21');utils['info'](util[_0x8b3b('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1046f1[_0x8b3b('0x5')],dials[_0x1046f1['uniqueid']][_0x8b3b('0x22')]));}}catch(_0x5c6b04){utils[_0x8b3b('0x16')](util[_0x8b3b('0x4')]('[%s][dials][dialbegin]',_0x1046f1[_0x8b3b('0x5')]),_0x5c6b04);}};exports[_0x8b3b('0x23')]=function(_0x10a0e5){try{if(!_[_0x8b3b('0x1d')](dials[_0x10a0e5['uniqueid']])){utils[_0x8b3b('0xd')](util[_0x8b3b('0x4')](_0x8b3b('0x24'),_0x10a0e5[_0x8b3b('0x5')]),_0x10a0e5);dials[_0x10a0e5[_0x8b3b('0x5')]][_0x8b3b('0x9')]=_0x10a0e5[_0x8b3b('0x9')];if(_0x10a0e5[_0x8b3b('0x9')]==_0x8b3b('0x25')){dials[_0x10a0e5[_0x8b3b('0x5')]]=_[_0x8b3b('0x26')](dials[_0x10a0e5[_0x8b3b('0x5')]],_0x10a0e5);dials[_0x10a0e5[_0x8b3b('0x5')]][_0x8b3b('0x27')]=utils[_0x8b3b('0x1f')]();dials[_0x10a0e5['uniqueid']]['lastevent']=_0x8b3b('0x28');utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')](_0x8b3b('0x29'),_0x10a0e5[_0x8b3b('0x5')],_0x10a0e5[_0x8b3b('0x9')],dials[_0x10a0e5[_0x8b3b('0x5')]][_0x8b3b('0x27')]));}else{utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x10a0e5[_0x8b3b('0x5')],_0x10a0e5[_0x8b3b('0x9')]));}}}catch(_0x149a3d){utils[_0x8b3b('0x16')](util[_0x8b3b('0x4')](_0x8b3b('0x24'),_0x10a0e5[_0x8b3b('0x5')]),_0x149a3d);}};exports[_0x8b3b('0x2a')]=function(_0x5bbdad){try{if(!_[_0x8b3b('0x1d')](dials[_0x5bbdad['uniqueid']])){utils[_0x8b3b('0xd')](util['format'](_0x8b3b('0x2b'),_0x5bbdad['uniqueid']),_0x5bbdad);utils[_0x8b3b('0x3')](util[_0x8b3b('0x4')](_0x8b3b('0x2c'),_0x5bbdad[_0x8b3b('0x5')],_0x5bbdad[_0x8b3b('0x7')],_0x5bbdad[_0x8b3b('0x2d')],_0x5bbdad['cause-txt']));dials[_0x5bbdad['uniqueid']]=_[_0x8b3b('0x26')](dials[_0x5bbdad['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x8b3b('0x2e')});dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x2f')]=utils[_0x8b3b('0x30')](dials[_0x5bbdad['uniqueid']]['endtime'],dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x22')]);dials[_0x5bbdad['uniqueid']][_0x8b3b('0x31')]=utils[_0x8b3b('0x30')](dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x27')]||dials[_0x5bbdad[_0x8b3b('0x5')]]['endtime'],dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x22')]);dials[_0x5bbdad['uniqueid']][_0x8b3b('0x32')]=dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x27')]?utils['diffTime'](dials[_0x5bbdad[_0x8b3b('0x5')]][_0x8b3b('0x33')],dials[_0x5bbdad['uniqueid']]['answertime']):0x0;writeDB(dials[_0x5bbdad[_0x8b3b('0x5')]]);}}catch(_0x42b9ca){utils[_0x8b3b('0x16')](util[_0x8b3b('0x4')](_0x8b3b('0x2b'),_0x5bbdad['uniqueid']),_0x42b9ca);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0957fc7..5313c0a 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f0e=['[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','asterisk-manager','util','asterisk','port','password','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','device'];(function(_0x4a1ddd,_0x32c6df){var _0x36b346=function(_0x56ff31){while(--_0x56ff31){_0x4a1ddd['push'](_0x4a1ddd['shift']());}};_0x36b346(++_0x32c6df);}(_0x3f0e,0x131));var _0xe3f0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x3f0e[_0x465028];return _0xb783d4;};var AsteriskManager=require(_0xe3f0('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xe3f0('0x1'));var ami=new AsteriskManager(config[_0xe3f0('0x2')][_0xe3f0('0x3')],config['asterisk']['ip'],config[_0xe3f0('0x2')]['username'],config[_0xe3f0('0x2')][_0xe3f0('0x4')],!![]);ami['keepConnected']();if(config[_0xe3f0('0x5')]&&config[_0xe3f0('0x5')][_0xe3f0('0x6')]){utils[_0xe3f0('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0xe3f0('0x8'));var calls=require(_0xe3f0('0x9'));var queues=require(_0xe3f0('0xa'));var recordings=require(_0xe3f0('0xb'));var members=require(_0xe3f0('0xc'));var dials=require(_0xe3f0('0xd'));var transfers=require(_0xe3f0('0xe'));var core=require(_0xe3f0('0xf'));ami['on'](_0xe3f0('0x10'),core[_0xe3f0('0x10')]);ami['on'](_0xe3f0('0x11'),core[_0xe3f0('0x11')]);ami['on'](_0xe3f0('0x12'),core[_0xe3f0('0x12')]);ami['on'](_0xe3f0('0x13'),core[_0xe3f0('0x13')]);ami['on'](_0xe3f0('0x14'),core[_0xe3f0('0x14')]);ami['on'](_0xe3f0('0x15'),core[_0xe3f0('0x15')]);ami['on'](_0xe3f0('0x16'),function(_0x3258f8){try{utils['debug'](util[_0xe3f0('0x17')]('[%s][index][devicestatechange]',_0x3258f8[_0xe3f0('0x18')]),_0x3258f8);members[_0xe3f0('0x16')](_0x3258f8);}catch(_0x56932c){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x19'),_0x3258f8['device']),_0x56932c);}});ami['on'](_0xe3f0('0x1a'),function(_0x592809){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x1c'),_0x592809[_0xe3f0('0x1d')]),_0x592809);agents['agentcalled'](_0x592809);}catch(_0x40f274){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x1c'),_0x592809[_0xe3f0('0x1d')]),_0x40f274);}});ami['on'](_0xe3f0('0x1e'),function(_0x28e2fb){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x1f'),_0x28e2fb[_0xe3f0('0x1d')]),_0x28e2fb);agents['agentringnoanswer'](_0x28e2fb);}catch(_0x2c0c6b){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')]('[%s][index][agentringnoanswer]',_0x28e2fb[_0xe3f0('0x1d')]),_0x2c0c6b);}});ami['on'](_0xe3f0('0x20'),function(_0x2e48de){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x21'),_0x2e48de['uniqueid']),_0x2e48de);agents[_0xe3f0('0x20')](_0x2e48de);queues[_0xe3f0('0x20')](_0x2e48de);}catch(_0x599d8f){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x21'),_0x2e48de[_0xe3f0('0x1d')]),_0x599d8f);}});ami['on'](_0xe3f0('0x22'),function(_0x57cbf8){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x23'),_0x57cbf8[_0xe3f0('0x1d')]),_0x57cbf8);agents[_0xe3f0('0x22')](_0x57cbf8);queues[_0xe3f0('0x22')](_0x57cbf8);members[_0xe3f0('0x22')](_0x57cbf8);}catch(_0x3172c6){utils[_0xe3f0('0x13')](util['format'](_0xe3f0('0x23'),_0x57cbf8['uniqueid']),_0x3172c6);}});ami['on']('queuecallerabandon',function(_0xf12de7){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x24'),_0xf12de7['uniqueid']),_0xf12de7);agents[_0xe3f0('0x25')](_0xf12de7);queues[_0xe3f0('0x25')](_0xf12de7);}catch(_0xab0ece){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x24'),_0xf12de7['uniqueid']),_0xab0ece);}});ami['on']('queuecallerjoin',function(_0x2827af){try{utils[_0xe3f0('0x1b')](util['format']('[%s][index][queuecallerjoin]',_0x2827af[_0xe3f0('0x1d')]),_0x2827af);queues['queuecallerjoin'](_0x2827af);recordings[_0xe3f0('0x26')](_0x2827af);}catch(_0x302c02){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x27'),_0x2827af[_0xe3f0('0x1d')]),_0x302c02);}});ami['on']('queuecallerleave',function(_0x502675){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')]('[%s][index][queuecallerleave]',_0x502675[_0xe3f0('0x1d')]),_0x502675);queues[_0xe3f0('0x28')](_0x502675);}catch(_0x15178e){utils['error'](util[_0xe3f0('0x17')](_0xe3f0('0x29'),_0x502675[_0xe3f0('0x1d')]),_0x15178e);}});ami['on'](_0xe3f0('0x2a'),function(_0x1642a0){try{utils[_0xe3f0('0x1b')](util['format']('[%s][index][musiconholdstart]',_0x1642a0['uniqueid']),_0x1642a0);queues['musiconholdstart'](_0x1642a0);calls[_0xe3f0('0x2a')](_0x1642a0);}catch(_0x54cc0c){utils['error'](util['format'](_0xe3f0('0x2b'),_0x1642a0['uniqueid']),_0x54cc0c);}});ami['on'](_0xe3f0('0x2c'),function(_0xb92ee0){try{utils['debug'](util['format'](_0xe3f0('0x2d'),_0xb92ee0[_0xe3f0('0x1d')]),_0xb92ee0);queues[_0xe3f0('0x2c')](_0xb92ee0);calls['musiconholdstop'](_0xb92ee0);}catch(_0x4ece97){utils[_0xe3f0('0x13')](util['format'](_0xe3f0('0x2d'),_0xb92ee0[_0xe3f0('0x1d')]),_0x4ece97);}});ami['on'](_0xe3f0('0x2e'),function(_0x3a93aa){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x2f'),_0x3a93aa[_0xe3f0('0x1d')]),_0x3a93aa);calls[_0xe3f0('0x2e')](_0x3a93aa);recordings[_0xe3f0('0x2e')](_0x3a93aa);}catch(_0xe3caf9){utils['error'](util['format']('[%s][index][newstate]',_0x3a93aa[_0xe3f0('0x1d')]),_0xe3caf9);}});ami['on']('hangup',function(_0x137043){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x30'),_0x137043[_0xe3f0('0x1d')]),_0x137043);calls[_0xe3f0('0x31')](_0x137043);recordings[_0xe3f0('0x31')](_0x137043);dials[_0xe3f0('0x31')](_0x137043);agents[_0xe3f0('0x31')](_0x137043);queues[_0xe3f0('0x31')](_0x137043);}catch(_0x1bc573){utils[_0xe3f0('0x13')](util['format']('[%s][index][hangup]',_0x137043[_0xe3f0('0x1d')]),_0x1bc573);}});ami['on']('cdr',function(_0x500d48){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x32'),_0x500d48[_0xe3f0('0x1d')]),_0x500d48);members[_0xe3f0('0x33')](_0x500d48);}catch(_0x147eef){utils['error'](util[_0xe3f0('0x17')]('[%s][index][cdr]',_0x500d48[_0xe3f0('0x1d')]),_0x147eef);}});ami['on'](_0xe3f0('0x34'),function(_0x19932a){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')]('[%s][index][blindtransfer]',_0x19932a['uniqueid']),_0x19932a);queues['blindtransfer'](_0x19932a);agents[_0xe3f0('0x34')](_0x19932a);transfers['blindtransfer'](_0x19932a);recordings[_0xe3f0('0x34')](_0x19932a);}catch(_0x56c59b){utils['error'](util[_0xe3f0('0x17')]('[%s][index][blindtransfer]',_0x19932a[_0xe3f0('0x1d')]),_0x56c59b);}});ami['on']('attendedtransfer',function(_0x4ef282){try{utils[_0xe3f0('0x1b')](util['format'](_0xe3f0('0x35'),_0x4ef282['origtransfereruniqueid']),_0x4ef282);queues[_0xe3f0('0x36')](_0x4ef282);transfers[_0xe3f0('0x36')](_0x4ef282);agents[_0xe3f0('0x36')](_0x4ef282);calls[_0xe3f0('0x36')](_0x4ef282);}catch(_0x455306){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x35'),_0x4ef282[_0xe3f0('0x37')]),_0x455306);}});ami['on']('varset',function(_0x5f3273){try{utils['debug'](util[_0xe3f0('0x17')](_0xe3f0('0x38'),_0x5f3273['uniqueid']),_0x5f3273);queues[_0xe3f0('0x39')](_0x5f3273);recordings[_0xe3f0('0x39')](_0x5f3273);calls[_0xe3f0('0x39')](_0x5f3273);dials['varset'](_0x5f3273);}catch(_0x1bc357){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x38'),_0x5f3273[_0xe3f0('0x1d')]),_0x1bc357);}});ami['on']('newexten',function(_0x40b6d1){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x3a'),_0x40b6d1[_0xe3f0('0x1d')]),_0x40b6d1);calls[_0xe3f0('0x3b')](_0x40b6d1);recordings[_0xe3f0('0x3b')](_0x40b6d1);dials[_0xe3f0('0x3b')](_0x40b6d1);}catch(_0x35e332){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x3a'),_0x40b6d1[_0xe3f0('0x1d')]),_0x35e332);}});ami['on']('newchannel',function(_0x2431c8){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x3c'),_0x2431c8[_0xe3f0('0x1d')]),_0x2431c8);calls[_0xe3f0('0x3d')](_0x2431c8);recordings['newchannel'](_0x2431c8);}catch(_0x406991){utils['error'](util['format']('[%s][index][newchannel]',_0x2431c8[_0xe3f0('0x1d')]),_0x406991);}});ami['on'](_0xe3f0('0x3e'),function(_0x377ee5){try{utils[_0xe3f0('0x1b')](util[_0xe3f0('0x17')](_0xe3f0('0x3f'),_0x377ee5[_0xe3f0('0x1d')]),_0x377ee5);dials['dialbegin'](_0x377ee5);}catch(_0x3dec6a){utils[_0xe3f0('0x13')](util[_0xe3f0('0x17')](_0xe3f0('0x40'),_0x377ee5[_0xe3f0('0x1d')]),_0x3dec6a);}});ami['on'](_0xe3f0('0x41'),function(_0x30baf6){try{utils['debug'](util[_0xe3f0('0x17')]('[%s][index][dialend]',_0x30baf6[_0xe3f0('0x1d')]),_0x30baf6);dials['dialend'](_0x30baf6);}catch(_0x5149af){utils['error'](util[_0xe3f0('0x17')]('[%s][index][dialend]',_0x30baf6[_0xe3f0('0x1d')]),_0x5149af);}});} \ No newline at end of file +var _0x6109=['newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','debug','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]'];(function(_0x5a69b5,_0x167340){var _0x33a7fe=function(_0x5dd843){while(--_0x5dd843){_0x5a69b5['push'](_0x5a69b5['shift']());}};_0x33a7fe(++_0x167340);}(_0x6109,0xd7));var _0x9610=function(_0x157203,_0xe8f7d8){_0x157203=_0x157203-0x0;var _0x23a5c2=_0x6109[_0x157203];return _0x23a5c2;};var AsteriskManager=require('asterisk-manager');var config=require(_0x9610('0x0'));var utils=require(_0x9610('0x1'));var util=require(_0x9610('0x2'));var ami=new AsteriskManager(config[_0x9610('0x3')][_0x9610('0x4')],config[_0x9610('0x3')]['ip'],config['asterisk']['username'],config[_0x9610('0x3')][_0x9610('0x5')],!![]);ami[_0x9610('0x6')]();if(config[_0x9610('0x7')]&&config[_0x9610('0x7')][_0x9610('0x8')]){utils[_0x9610('0x9')](_0x9610('0xa'));}else{var agents=require(_0x9610('0xb'));var calls=require(_0x9610('0xc'));var queues=require(_0x9610('0xd'));var recordings=require(_0x9610('0xe'));var members=require('./members.controller');var dials=require(_0x9610('0xf'));var transfers=require(_0x9610('0x10'));var core=require(_0x9610('0x11'));ami['on'](_0x9610('0x12'),core[_0x9610('0x12')]);ami['on'](_0x9610('0x13'),core[_0x9610('0x13')]);ami['on'](_0x9610('0x14'),core['fullybooted']);ami['on'](_0x9610('0x15'),core[_0x9610('0x15')]);ami['on'](_0x9610('0x16'),core[_0x9610('0x16')]);ami['on'](_0x9610('0x17'),core[_0x9610('0x17')]);ami['on'](_0x9610('0x18'),function(_0x262504){try{utils['debug'](util[_0x9610('0x19')](_0x9610('0x1a'),_0x262504['device']),_0x262504);members['devicestatechange'](_0x262504);}catch(_0x36e44f){utils['error'](util[_0x9610('0x19')]('[%s][index][devicestatechange]',_0x262504[_0x9610('0x1b')]),_0x36e44f);}});ami['on'](_0x9610('0x1c'),function(_0x5dd526){try{utils['debug'](util[_0x9610('0x19')](_0x9610('0x1d'),_0x5dd526[_0x9610('0x1e')]),_0x5dd526);agents['agentcalled'](_0x5dd526);}catch(_0x5e4e71){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x1d'),_0x5dd526[_0x9610('0x1e')]),_0x5e4e71);}});ami['on']('agentringnoanswer',function(_0x37e6c1){try{utils['debug'](util[_0x9610('0x19')]('[%s][index][agentringnoanswer]',_0x37e6c1['uniqueid']),_0x37e6c1);agents[_0x9610('0x1f')](_0x37e6c1);}catch(_0x5f2a7a){utils[_0x9610('0x15')](util['format'](_0x9610('0x20'),_0x37e6c1[_0x9610('0x1e')]),_0x5f2a7a);}});ami['on']('agentconnect',function(_0x238ef1){try{utils[_0x9610('0x21')](util['format'](_0x9610('0x22'),_0x238ef1[_0x9610('0x1e')]),_0x238ef1);agents[_0x9610('0x23')](_0x238ef1);queues['agentconnect'](_0x238ef1);}catch(_0x153109){utils['error'](util[_0x9610('0x19')](_0x9610('0x22'),_0x238ef1[_0x9610('0x1e')]),_0x153109);}});ami['on']('agentcomplete',function(_0x136ea7){try{utils['debug'](util[_0x9610('0x19')]('[%s][index][agentcomplete]',_0x136ea7[_0x9610('0x1e')]),_0x136ea7);agents[_0x9610('0x24')](_0x136ea7);queues[_0x9610('0x24')](_0x136ea7);members[_0x9610('0x24')](_0x136ea7);}catch(_0x1bad73){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x25'),_0x136ea7[_0x9610('0x1e')]),_0x1bad73);}});ami['on']('queuecallerabandon',function(_0x46c7a2){try{utils[_0x9610('0x21')](util['format']('[%s][index][queuecallerabandon]',_0x46c7a2['uniqueid']),_0x46c7a2);agents[_0x9610('0x26')](_0x46c7a2);queues['queuecallerabandon'](_0x46c7a2);}catch(_0x20b0ba){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x27'),_0x46c7a2[_0x9610('0x1e')]),_0x20b0ba);}});ami['on'](_0x9610('0x28'),function(_0x2bc071){try{utils['debug'](util['format'](_0x9610('0x29'),_0x2bc071['uniqueid']),_0x2bc071);queues[_0x9610('0x28')](_0x2bc071);recordings[_0x9610('0x28')](_0x2bc071);}catch(_0x41a5f6){utils[_0x9610('0x15')](util[_0x9610('0x19')]('[%s][index][queuecallerjoin]',_0x2bc071[_0x9610('0x1e')]),_0x41a5f6);}});ami['on']('queuecallerleave',function(_0x430c56){try{utils['debug'](util[_0x9610('0x19')](_0x9610('0x2a'),_0x430c56[_0x9610('0x1e')]),_0x430c56);queues[_0x9610('0x2b')](_0x430c56);}catch(_0x199761){utils[_0x9610('0x15')](util[_0x9610('0x19')]('[%s][index][queuecallerleave]',_0x430c56[_0x9610('0x1e')]),_0x199761);}});ami['on'](_0x9610('0x2c'),function(_0x56b30e){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x2d'),_0x56b30e[_0x9610('0x1e')]),_0x56b30e);queues[_0x9610('0x2c')](_0x56b30e);calls[_0x9610('0x2c')](_0x56b30e);}catch(_0x506229){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x2d'),_0x56b30e['uniqueid']),_0x506229);}});ami['on']('musiconholdstop',function(_0x4bde9e){try{utils[_0x9610('0x21')](util[_0x9610('0x19')]('[%s][index][musiconholdstop]',_0x4bde9e[_0x9610('0x1e')]),_0x4bde9e);queues[_0x9610('0x2e')](_0x4bde9e);calls[_0x9610('0x2e')](_0x4bde9e);}catch(_0x2b94f5){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x2f'),_0x4bde9e['uniqueid']),_0x2b94f5);}});ami['on']('newstate',function(_0x37c39e){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x30'),_0x37c39e[_0x9610('0x1e')]),_0x37c39e);calls[_0x9610('0x31')](_0x37c39e);recordings['newstate'](_0x37c39e);}catch(_0x14e3ef){utils[_0x9610('0x15')](util['format'](_0x9610('0x30'),_0x37c39e[_0x9610('0x1e')]),_0x14e3ef);}});ami['on']('hangup',function(_0x22d648){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x32'),_0x22d648[_0x9610('0x1e')]),_0x22d648);calls[_0x9610('0x33')](_0x22d648);recordings[_0x9610('0x33')](_0x22d648);dials[_0x9610('0x33')](_0x22d648);agents[_0x9610('0x33')](_0x22d648);queues['hangup'](_0x22d648);}catch(_0x3cad5f){utils[_0x9610('0x15')](util[_0x9610('0x19')]('[%s][index][hangup]',_0x22d648[_0x9610('0x1e')]),_0x3cad5f);}});ami['on'](_0x9610('0x34'),function(_0x148367){try{utils['debug'](util[_0x9610('0x19')]('[%s][index][cdr]',_0x148367[_0x9610('0x1e')]),_0x148367);members[_0x9610('0x34')](_0x148367);}catch(_0x1e6453){utils[_0x9610('0x15')](util['format'](_0x9610('0x35'),_0x148367[_0x9610('0x1e')]),_0x1e6453);}});ami['on']('blindtransfer',function(_0x33877e){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x36'),_0x33877e[_0x9610('0x1e')]),_0x33877e);queues[_0x9610('0x37')](_0x33877e);agents[_0x9610('0x37')](_0x33877e);transfers[_0x9610('0x37')](_0x33877e);recordings['blindtransfer'](_0x33877e);}catch(_0x41db44){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x36'),_0x33877e[_0x9610('0x1e')]),_0x41db44);}});ami['on'](_0x9610('0x38'),function(_0x19ebcc){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x39'),_0x19ebcc[_0x9610('0x3a')]),_0x19ebcc);queues['attendedtransfer'](_0x19ebcc);transfers[_0x9610('0x38')](_0x19ebcc);agents[_0x9610('0x38')](_0x19ebcc);calls[_0x9610('0x38')](_0x19ebcc);}catch(_0x257f02){utils[_0x9610('0x15')](util[_0x9610('0x19')]('[%s][index][attendedtransfer]',_0x19ebcc[_0x9610('0x3a')]),_0x257f02);}});ami['on'](_0x9610('0x3b'),function(_0x598524){try{utils[_0x9610('0x21')](util['format']('[%s][index][varset]',_0x598524[_0x9610('0x1e')]),_0x598524);queues[_0x9610('0x3b')](_0x598524);recordings['varset'](_0x598524);calls[_0x9610('0x3b')](_0x598524);dials[_0x9610('0x3b')](_0x598524);}catch(_0xba00d3){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x3c'),_0x598524[_0x9610('0x1e')]),_0xba00d3);}});ami['on'](_0x9610('0x3d'),function(_0x1c44e5){try{utils[_0x9610('0x21')](util[_0x9610('0x19')](_0x9610('0x3e'),_0x1c44e5[_0x9610('0x1e')]),_0x1c44e5);calls[_0x9610('0x3d')](_0x1c44e5);recordings['newexten'](_0x1c44e5);dials[_0x9610('0x3d')](_0x1c44e5);}catch(_0x3f3581){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x3e'),_0x1c44e5[_0x9610('0x1e')]),_0x3f3581);}});ami['on']('newchannel',function(_0x303ad5){try{utils['debug'](util[_0x9610('0x19')](_0x9610('0x3f'),_0x303ad5[_0x9610('0x1e')]),_0x303ad5);calls[_0x9610('0x40')](_0x303ad5);recordings[_0x9610('0x40')](_0x303ad5);}catch(_0x286a90){utils[_0x9610('0x15')](util[_0x9610('0x19')]('[%s][index][newchannel]',_0x303ad5[_0x9610('0x1e')]),_0x286a90);}});ami['on']('dialbegin',function(_0x20126a){try{utils['debug'](util['format'](_0x9610('0x41'),_0x20126a['uniqueid']),_0x20126a);dials['dialbegin'](_0x20126a);}catch(_0x5f2cc3){utils[_0x9610('0x15')](util['format'](_0x9610('0x42'),_0x20126a[_0x9610('0x1e')]),_0x5f2cc3);}});ami['on'](_0x9610('0x43'),function(_0x8b05c5){try{utils[_0x9610('0x21')](util['format']('[%s][index][dialend]',_0x8b05c5[_0x9610('0x1e')]),_0x8b05c5);dials[_0x9610('0x43')](_0x8b05c5);}catch(_0x1bdbe2){utils[_0x9610('0x15')](util[_0x9610('0x19')](_0x9610('0x44'),_0x8b05c5['uniqueid']),_0x1bdbe2);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b123116..df1ad2d 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c48=['uniqueid','interface','channel','data2','membername','type','then','name','request','CreateMemberReport','split','internal','catch','error','[%s][members][writeDB]','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','voice','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9c48,0xb1));var _0x89c4=function(_0x3d1c32,_0x1fcf95){_0x3d1c32=_0x3d1c32-0x0;var _0x1fd510=_0x9c48[_0x3d1c32];return _0x1fd510;};'use strict';var _=require(_0x89c4('0x0'));var util=require('util');var utils=require(_0x89c4('0x1'));var members={};var exclude=[_0x89c4('0x2'),_0x89c4('0x3')];function writeDB(_0x14260c){utils[_0x89c4('0x4')](util[_0x89c4('0x5')](_0x89c4('0x6'),_0x14260c[_0x89c4('0x7')],_0x14260c[_0x89c4('0x8')],_0x14260c[_0x89c4('0x9')],_0x14260c[_0x89c4('0xa')],_0x14260c[_0x89c4('0xb')],_0x14260c[_0x89c4('0xc')]));if(_0x14260c[_0x89c4('0x8')]){utils['getUserByInterface'](_0x14260c[_0x89c4('0x8')])[_0x89c4('0xd')](function(_0x9fe61e){if(_0x9fe61e){_0x14260c[_0x89c4('0xb')]=_0x9fe61e[_0x89c4('0xe')];_0x14260c['internal']=_0x9fe61e['internal'];utils[_0x89c4('0xf')](_0x89c4('0x10'),_0x14260c);}else{utils['getUserByName'](_0x14260c['interface'][_0x89c4('0x11')]('/')[0x1])[_0x89c4('0xd')](function(_0x3331f1){if(_0x3331f1){_0x14260c['membername']=_0x3331f1[_0x89c4('0xe')];_0x14260c[_0x89c4('0x12')]=_0x3331f1['internal'];utils[_0x89c4('0xf')]('CreateMemberReport',_0x14260c);}});}})[_0x89c4('0x13')](function(_0x3856d4){utils[_0x89c4('0x14')](util[_0x89c4('0x5')](_0x89c4('0x15'),_0x14260c['uniqueid']),_0x3856d4);});}delete members[_0x14260c[_0x89c4('0x8')]];}function startsWith(_0x3ad1ba,_0x3e47a2){return _['some'](_0x3ad1ba,function(_0x6f9159){return _['startsWith'](_0x3e47a2,_0x6f9159);});}exports[_0x89c4('0x16')]=function(_0x15d638){try{utils[_0x89c4('0x17')](util[_0x89c4('0x5')](_0x89c4('0x18'),members[_0x15d638[_0x89c4('0x19')]]?members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x7')]:_0x15d638[_0x89c4('0x19')]),_0x15d638);utils['info'](util[_0x89c4('0x5')](_0x89c4('0x1a'),members[_0x15d638['device']]?members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x7')]:_0x15d638['device'],_0x15d638['state'],_0x15d638[_0x89c4('0x19')]));switch(_0x15d638['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x15d638['device'])){members[_0x15d638[_0x89c4('0x19')]]={'channel':_0x89c4('0x1b'),'interface':_0x15d638[_0x89c4('0x19')],'type':'TALKING','enterAt':utils[_0x89c4('0x1c')](),'role':_0x89c4('0x1d')};}break;case'NOT_INUSE':if(!_[_0x89c4('0x1e')](members[_0x15d638[_0x89c4('0x19')]])){members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x1f')]=utils[_0x89c4('0x1c')]();members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x20')]=utils[_0x89c4('0x21')](members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x1f')],members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x22')]);if(members[_0x15d638[_0x89c4('0x19')]][_0x89c4('0x7')]){writeDB(members[_0x15d638[_0x89c4('0x19')]]);}}break;default:break;}}catch(_0x35f1a7){utils['error'](util[_0x89c4('0x5')](_0x89c4('0x18'),members[_0x15d638[_0x89c4('0x19')]]?members[_0x15d638['device']]['uniqueid']:_0x15d638['device']),_0x35f1a7);}};exports[_0x89c4('0x23')]=function(_0x34a0af){try{if(!_[_0x89c4('0x1e')](members[_0x34a0af[_0x89c4('0x8')]])){utils[_0x89c4('0x17')](util[_0x89c4('0x5')](_0x89c4('0x24'),_0x34a0af[_0x89c4('0x7')]),_0x34a0af);utils[_0x89c4('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x34a0af['uniqueid'],_0x34a0af[_0x89c4('0x8')],_0x34a0af['queue']));members[_0x34a0af[_0x89c4('0x8')]]=_['assign'](members[_0x34a0af[_0x89c4('0x8')]],{'data4':_0x34a0af[_0x89c4('0x25')],'uniqueid':_0x34a0af['uniqueid']});}}catch(_0x42cba1){utils[_0x89c4('0x14')](util[_0x89c4('0x5')](_0x89c4('0x24'),_0x34a0af['uniqueid']),_0x42cba1);}};exports['cdr']=function(_0x5e427d){try{utils[_0x89c4('0x17')](util[_0x89c4('0x5')]('[%s][members][cdr]',_0x5e427d[_0x89c4('0x7')]),_0x5e427d);if(_0x5e427d[_0x89c4('0x9')]){var _0xad55d0=_0x5e427d[_0x89c4('0x9')]['split']('-')[0x0];if(!_['isNil'](members[_0xad55d0])){members[_0xad55d0]=_[_0x89c4('0x26')](members[_0xad55d0],{'data1':members[_0xad55d0]['data1']||_0x5e427d[_0x89c4('0xc')],'data2':members[_0xad55d0][_0x89c4('0xa')]||_0x5e427d[_0x89c4('0x27')],'data3':members[_0xad55d0][_0x89c4('0x28')]||_0x5e427d[_0x89c4('0x29')],'uniqueid':members[_0xad55d0][_0x89c4('0x7')]||_0x5e427d['uniqueid']});utils[_0x89c4('0x4')](util[_0x89c4('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5e427d[_0x89c4('0x7')],members[_0xad55d0][_0x89c4('0x2a')],members[_0xad55d0][_0x89c4('0xa')],members[_0xad55d0]['data3']));if(members[_0xad55d0][_0x89c4('0x1f')]){writeDB(members[_0xad55d0]);}}}if(_0x5e427d['destinationchannel']){var _0x5830ec=_0x5e427d[_0x89c4('0x2b')]['split']('-')[0x0];if(!_[_0x89c4('0x1e')](members[_0x5830ec])){members[_0x5830ec]=_[_0x89c4('0x26')](members[_0x5830ec],{'data1':members[_0x5830ec][_0x89c4('0x2a')]||_0x5e427d[_0x89c4('0xc')],'data2':members[_0x5830ec][_0x89c4('0xa')]||_0x5e427d[_0x89c4('0x27')],'data3':members[_0x5830ec][_0x89c4('0x28')]||_0x5e427d[_0x89c4('0x29')],'uniqueid':members[_0x5830ec][_0x89c4('0x7')]||_0x5e427d['uniqueid']});utils[_0x89c4('0x4')](util[_0x89c4('0x5')](_0x89c4('0x2c'),_0x5e427d[_0x89c4('0x7')],members[_0x5830ec][_0x89c4('0x2a')],members[_0x5830ec][_0x89c4('0xa')],members[_0x5830ec][_0x89c4('0x28')]));if(members[_0x5830ec]['exitAt']){writeDB(members[_0x5830ec]);}}}}catch(_0x328930){utils['error'](util[_0x89c4('0x5')](_0x89c4('0x2d'),_0x5e427d[_0x89c4('0x7')]),_0x328930);}}; \ No newline at end of file +var _0x3667=['type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','queue','assign','cdr','[%s][members][cdr]','data1'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var utils=require(_0x7366('0x2'));var members={};var exclude=[_0x7366('0x3'),_0x7366('0x4')];function writeDB(_0x5d1072){utils[_0x7366('0x5')](util[_0x7366('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5d1072[_0x7366('0x7')],_0x5d1072[_0x7366('0x8')],_0x5d1072[_0x7366('0x9')],_0x5d1072[_0x7366('0xa')],_0x5d1072[_0x7366('0xb')],_0x5d1072['type']));if(_0x5d1072[_0x7366('0x8')]){utils[_0x7366('0xc')](_0x5d1072[_0x7366('0x8')])[_0x7366('0xd')](function(_0x171fe2){if(_0x171fe2){_0x5d1072[_0x7366('0xb')]=_0x171fe2[_0x7366('0xe')];_0x5d1072[_0x7366('0xf')]=_0x171fe2[_0x7366('0xf')];utils[_0x7366('0x10')](_0x7366('0x11'),_0x5d1072);}else{utils[_0x7366('0x12')](_0x5d1072[_0x7366('0x8')][_0x7366('0x13')]('/')[0x1])[_0x7366('0xd')](function(_0xbcd488){if(_0xbcd488){_0x5d1072[_0x7366('0xb')]=_0xbcd488[_0x7366('0xe')];_0x5d1072[_0x7366('0xf')]=_0xbcd488[_0x7366('0xf')];utils[_0x7366('0x10')](_0x7366('0x11'),_0x5d1072);}});}})[_0x7366('0x14')](function(_0x44d163){utils[_0x7366('0x15')](util[_0x7366('0x6')](_0x7366('0x16'),_0x5d1072[_0x7366('0x7')]),_0x44d163);});}delete members[_0x5d1072['interface']];}function startsWith(_0x23e763,_0x308752){return _[_0x7366('0x17')](_0x23e763,function(_0x2c0422){return _[_0x7366('0x18')](_0x308752,_0x2c0422);});}exports[_0x7366('0x19')]=function(_0x2bc2af){try{utils[_0x7366('0x1a')](util[_0x7366('0x6')](_0x7366('0x1b'),members[_0x2bc2af[_0x7366('0x1c')]]?members[_0x2bc2af['device']][_0x7366('0x7')]:_0x2bc2af['device']),_0x2bc2af);utils[_0x7366('0x5')](util[_0x7366('0x6')](_0x7366('0x1d'),members[_0x2bc2af['device']]?members[_0x2bc2af[_0x7366('0x1c')]][_0x7366('0x7')]:_0x2bc2af[_0x7366('0x1c')],_0x2bc2af['state'],_0x2bc2af[_0x7366('0x1c')]));switch(_0x2bc2af[_0x7366('0x1e')]){case'INUSE':case _0x7366('0x1f'):if(!startsWith(exclude,_0x2bc2af[_0x7366('0x1c')])){members[_0x2bc2af[_0x7366('0x1c')]]={'channel':_0x7366('0x20'),'interface':_0x2bc2af[_0x7366('0x1c')],'type':_0x7366('0x21'),'enterAt':utils[_0x7366('0x22')](),'role':_0x7366('0x23')};}break;case _0x7366('0x24'):if(!_[_0x7366('0x25')](members[_0x2bc2af[_0x7366('0x1c')]])){members[_0x2bc2af[_0x7366('0x1c')]][_0x7366('0x26')]=utils['now']();members[_0x2bc2af[_0x7366('0x1c')]]['duration']=utils[_0x7366('0x27')](members[_0x2bc2af['device']]['exitAt'],members[_0x2bc2af[_0x7366('0x1c')]]['enterAt']);if(members[_0x2bc2af[_0x7366('0x1c')]]['uniqueid']){writeDB(members[_0x2bc2af[_0x7366('0x1c')]]);}}break;default:break;}}catch(_0x191177){utils['error'](util[_0x7366('0x6')]('[%s][members][devicestatechange]',members[_0x2bc2af[_0x7366('0x1c')]]?members[_0x2bc2af[_0x7366('0x1c')]]['uniqueid']:_0x2bc2af[_0x7366('0x1c')]),_0x191177);}};exports['agentcomplete']=function(_0xc58ac7){try{if(!_[_0x7366('0x25')](members[_0xc58ac7[_0x7366('0x8')]])){utils[_0x7366('0x1a')](util[_0x7366('0x6')]('[%s][members][agentcomplete]',_0xc58ac7[_0x7366('0x7')]),_0xc58ac7);utils[_0x7366('0x5')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0xc58ac7['uniqueid'],_0xc58ac7['interface'],_0xc58ac7[_0x7366('0x28')]));members[_0xc58ac7[_0x7366('0x8')]]=_[_0x7366('0x29')](members[_0xc58ac7[_0x7366('0x8')]],{'data4':_0xc58ac7['queue'],'uniqueid':_0xc58ac7[_0x7366('0x7')]});}}catch(_0x2abf10){utils[_0x7366('0x15')](util[_0x7366('0x6')]('[%s][members][agentcomplete]',_0xc58ac7[_0x7366('0x7')]),_0x2abf10);}};exports[_0x7366('0x2a')]=function(_0x53938d){try{utils[_0x7366('0x1a')](util[_0x7366('0x6')](_0x7366('0x2b'),_0x53938d[_0x7366('0x7')]),_0x53938d);if(_0x53938d[_0x7366('0x9')]){var _0x101d2a=_0x53938d[_0x7366('0x9')][_0x7366('0x13')]('-')[0x0];if(!_[_0x7366('0x25')](members[_0x101d2a])){members[_0x101d2a]=_['assign'](members[_0x101d2a],{'data1':members[_0x101d2a][_0x7366('0x2c')]||_0x53938d[_0x7366('0x2d')],'data2':members[_0x101d2a]['data2']||_0x53938d[_0x7366('0x2e')],'data3':members[_0x101d2a][_0x7366('0x2f')]||_0x53938d[_0x7366('0x30')],'uniqueid':members[_0x101d2a]['uniqueid']||_0x53938d[_0x7366('0x7')]});utils['info'](util[_0x7366('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x53938d['uniqueid'],members[_0x101d2a][_0x7366('0x2c')],members[_0x101d2a]['data2'],members[_0x101d2a][_0x7366('0x2f')]));if(members[_0x101d2a][_0x7366('0x26')]){writeDB(members[_0x101d2a]);}}}if(_0x53938d['destinationchannel']){var _0x3dabfe=_0x53938d['destinationchannel'][_0x7366('0x13')]('-')[0x0];if(!_[_0x7366('0x25')](members[_0x3dabfe])){members[_0x3dabfe]=_[_0x7366('0x29')](members[_0x3dabfe],{'data1':members[_0x3dabfe][_0x7366('0x2c')]||_0x53938d['type'],'data2':members[_0x3dabfe][_0x7366('0xa')]||_0x53938d[_0x7366('0x2e')],'data3':members[_0x3dabfe][_0x7366('0x2f')]||_0x53938d['destination'],'uniqueid':members[_0x3dabfe][_0x7366('0x7')]||_0x53938d[_0x7366('0x7')]});utils[_0x7366('0x5')](util[_0x7366('0x6')](_0x7366('0x31'),_0x53938d[_0x7366('0x7')],members[_0x3dabfe][_0x7366('0x2c')],members[_0x3dabfe]['data2'],members[_0x3dabfe]['data3']));if(members[_0x3dabfe][_0x7366('0x26')]){writeDB(members[_0x3dabfe]);}}}}catch(_0xbe381d){utils['error'](util[_0x7366('0x6')](_0x7366('0x2b'),_0x53938d['uniqueid']),_0xbe381d);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index b26fcce..eefef0f 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1b2=['transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertype','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND'];(function(_0x546a88,_0x48d512){var _0x60ec43=function(_0x39d2e8){while(--_0x39d2e8){_0x546a88['push'](_0x546a88['shift']());}};_0x60ec43(++_0x48d512);}(_0xb1b2,0xed));var _0x2b1b=function(_0x3056cd,_0x7255ec){_0x3056cd=_0x3056cd-0x0;var _0x5767a6=_0xb1b2[_0x3056cd];return _0x5767a6;};'use strict';var _=require(_0x2b1b('0x0'));var util=require('util');var utils=require(_0x2b1b('0x1'));var queues={};function writeDB(_0x1ba4e2){utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x4'),_0x1ba4e2[_0x2b1b('0x5')],_0x1ba4e2[_0x2b1b('0x6')],_0x1ba4e2[_0x2b1b('0x7')],_0x1ba4e2[_0x2b1b('0x8')],_0x1ba4e2[_0x2b1b('0x9')],_0x1ba4e2[_0x2b1b('0xa')],_0x1ba4e2[_0x2b1b('0xb')]));if(_0x1ba4e2['queue']){utils['getVoiceQueueByName'](_0x1ba4e2['queue'])[_0x2b1b('0xc')](function(_0x2fef16){if(_0x2fef16){_0x1ba4e2['type']=_0x2fef16[_0x2b1b('0xd')];}utils[_0x2b1b('0xe')](_0x2b1b('0xf'),_0x1ba4e2);});}else{utils[_0x2b1b('0xe')](_0x2b1b('0xf'),_0x1ba4e2);}if(_0x1ba4e2[_0x2b1b('0x10')]){delete queues[_0x1ba4e2['transfereduniqueid']];}else{delete queues[_0x1ba4e2[_0x2b1b('0x5')]];}}exports[_0x2b1b('0x11')]=function(_0x1f29b2){try{utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')]('[%s][queues][queuecallerjoin]',_0x1f29b2[_0x2b1b('0x5')]),_0x1f29b2);utils[_0x2b1b('0x2')](util['format'](_0x2b1b('0x13'),_0x1f29b2['uniqueid'],_0x1f29b2['queue'],_0x1f29b2[_0x2b1b('0x14')]));queues[_0x1f29b2['uniqueid']]=_['assign'](_0x1f29b2,{'originalposition':_0x1f29b2['position'],'queuecallerjoinAt':utils[_0x2b1b('0x15')](),'mohtime':0x0});}catch(_0x35dddf){utils[_0x2b1b('0x16')](util[_0x2b1b('0x3')](_0x2b1b('0x17'),_0x1f29b2['uniqueid']),_0x35dddf);}};exports['hangup']=function(_0x1d5f77){try{if(!_[_0x2b1b('0x18')](queues[_0x1d5f77[_0x2b1b('0x5')]])){utils['debug'](util[_0x2b1b('0x3')]('[%s][queues][hangup]',_0x1d5f77[_0x2b1b('0x5')]),_0x1d5f77);if(queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x19')]){if(!queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x1a')]&&!queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x1b')]){queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x1c')]=!![];queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x1d')]=utils[_0x2b1b('0x15')]();queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0xb')]=_0x2b1b('0x1e');}utils['info'](util[_0x2b1b('0x3')](_0x2b1b('0x1f'),_0x1d5f77[_0x2b1b('0x5')],queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x20')],queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0xb')]));writeDB(queues[_0x1d5f77[_0x2b1b('0x5')]]);}else if(queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x10')]){utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x21'),_0x1d5f77[_0x2b1b('0x5')],queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x20')],queues[_0x1d5f77['uniqueid']][_0x2b1b('0x10')]));queues[queues[_0x1d5f77[_0x2b1b('0x5')]][_0x2b1b('0x10')]]=queues[_0x1d5f77[_0x2b1b('0x5')]];queues[queues[_0x1d5f77['uniqueid']]['transfereduniqueid']][_0x2b1b('0x22')]=0x2;delete queues[_0x1d5f77['uniqueid']];}}}catch(_0x1646b5){utils[_0x2b1b('0x16')](util[_0x2b1b('0x3')]('[%s][queues][hangup]',_0x1d5f77[_0x2b1b('0x5')]),_0x1646b5);}};exports[_0x2b1b('0x23')]=function(_0x353e8b){try{utils['debug'](util[_0x2b1b('0x3')](_0x2b1b('0x24'),_0x353e8b['uniqueid']),_0x353e8b);if(!_[_0x2b1b('0x18')](_0x353e8b[_0x2b1b('0x25')][_0x2b1b('0x26')])&&_0x353e8b[_0x2b1b('0x27')][_0x2b1b('0x28')]()!==_0x2b1b('0x29')){if(!_[_0x2b1b('0x18')](queues[_0x353e8b['uniqueid']])){queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x1a')]=![];queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x2a')]=null;queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x1b')]=!![];queues[_0x353e8b['uniqueid']][_0x2b1b('0x2b')]=utils[_0x2b1b('0x15')]();queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0xb')]=_0x353e8b[_0x2b1b('0x27')][_0x2b1b('0x28')]();utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x2c'),_0x353e8b[_0x2b1b('0x5')],queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x20')],_0x353e8b[_0x2b1b('0x27')],queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0xb')]));writeDB(queues[_0x353e8b[_0x2b1b('0x5')]]);}}else if(!_[_0x2b1b('0x18')](_0x353e8b[_0x2b1b('0x25')]['queueposition'])){if(!_[_0x2b1b('0x18')](queues[_0x353e8b[_0x2b1b('0x5')]])&&!queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x1a')]){queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x1a')]=![];queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x2a')]=null;queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x1b')]=!![];queues[_0x353e8b['uniqueid']][_0x2b1b('0x2b')]=utils['now']();queues[_0x353e8b[_0x2b1b('0x5')]]['queuecallerexitreason']=_0x2b1b('0x2d');utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x2e'),_0x353e8b[_0x2b1b('0x5')],queues[_0x353e8b[_0x2b1b('0x5')]][_0x2b1b('0x20')],_0x353e8b[_0x2b1b('0x27')],queues[_0x353e8b['uniqueid']][_0x2b1b('0xb')]));}}}catch(_0x4127cc){utils[_0x2b1b('0x16')](util['format'](_0x2b1b('0x24'),_0x353e8b[_0x2b1b('0x5')]),_0x4127cc);}};exports[_0x2b1b('0x1a')]=function(_0x5a33ca){try{if(!_['isNil'](queues[_0x5a33ca[_0x2b1b('0x5')]])){utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')](_0x2b1b('0x2f'),_0x5a33ca[_0x2b1b('0x5')]),_0x5a33ca);queues[_0x5a33ca['uniqueid']]['queuecallerexit']=![];queues[_0x5a33ca['uniqueid']]['queuecallerexitAt']=null;queues[_0x5a33ca['uniqueid']][_0x2b1b('0x1a')]=!![];queues[_0x5a33ca[_0x2b1b('0x5')]][_0x2b1b('0x2a')]=utils['now']();queues[_0x5a33ca[_0x2b1b('0x5')]][_0x2b1b('0xb')]='ABANDONED';utils['info'](util[_0x2b1b('0x3')](_0x2b1b('0x30'),_0x5a33ca[_0x2b1b('0x5')],queues[_0x5a33ca['uniqueid']][_0x2b1b('0x20')],queues[_0x5a33ca['uniqueid']][_0x2b1b('0xb')]));}}catch(_0xb2c7ef){utils[_0x2b1b('0x16')](util['format'](_0x2b1b('0x2f'),_0x5a33ca['uniqueid']),_0xb2c7ef);}};exports[_0x2b1b('0x31')]=function(_0x31f465){try{if(!_[_0x2b1b('0x18')](queues[_0x31f465[_0x2b1b('0x5')]])){utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')](_0x2b1b('0x32'),_0x31f465['uniqueid']),_0x31f465);utils['info'](util[_0x2b1b('0x3')](_0x2b1b('0x33'),_0x31f465[_0x2b1b('0x5')],queues[_0x31f465['uniqueid']][_0x2b1b('0x20')],_0x31f465[_0x2b1b('0x34')],_0x31f465[_0x2b1b('0x35')]));queues[_0x31f465[_0x2b1b('0x5')]][_0x2b1b('0x31')]=!![];queues[_0x31f465[_0x2b1b('0x5')]][_0x2b1b('0x19')]=utils[_0x2b1b('0x15')]();queues[_0x31f465['uniqueid']][_0x2b1b('0x36')]=utils['diffTime'](queues[_0x31f465['uniqueid']]['queuecallerleaveAt'],queues[_0x31f465[_0x2b1b('0x5')]][_0x2b1b('0x37')]);queues[_0x31f465['uniqueid']]['position']=_0x31f465[_0x2b1b('0x14')];queues[_0x31f465[_0x2b1b('0x5')]][_0x2b1b('0x38')]=_0x31f465[_0x2b1b('0x38')];queues[_0x31f465[_0x2b1b('0x5')]][_0x2b1b('0x34')]=_0x31f465[_0x2b1b('0x34')];queues[_0x31f465[_0x2b1b('0x5')]]['connectedlinename']=_0x31f465['connectedlinename'];}}catch(_0x12529b){utils['error'](util[_0x2b1b('0x3')](_0x2b1b('0x32'),_0x31f465[_0x2b1b('0x5')]),_0x12529b);}};exports[_0x2b1b('0x39')]=function(_0x53c30d){try{if(!_[_0x2b1b('0x18')](queues[_0x53c30d['uniqueid']])){utils['debug'](util['format'](_0x2b1b('0x3a'),_0x53c30d[_0x2b1b('0x5')]),_0x53c30d);utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x3b'),_0x53c30d['uniqueid'],queues[_0x53c30d[_0x2b1b('0x5')]][_0x2b1b('0x20')],_0x53c30d[_0x2b1b('0x3c')],_0x53c30d['destaccountcode']));queues[_0x53c30d[_0x2b1b('0x5')]]['queuecallerabandon']=![];queues[_0x53c30d['uniqueid']][_0x2b1b('0x1a')]=![];queues[_0x53c30d[_0x2b1b('0x5')]][_0x2b1b('0x2a')]=null;queues[_0x53c30d[_0x2b1b('0x5')]]['queuecallerexit']=![];queues[_0x53c30d[_0x2b1b('0x5')]][_0x2b1b('0xb')]=null;queues[_0x53c30d['uniqueid']][_0x2b1b('0x2b')]=null;queues[_0x53c30d['uniqueid']][_0x2b1b('0x3d')]=!![];queues[_0x53c30d[_0x2b1b('0x5')]][_0x2b1b('0xa')]=_0x53c30d[_0x2b1b('0x3e')];queues[_0x53c30d['uniqueid']][_0x2b1b('0x8')]=_0x53c30d[_0x2b1b('0x3c')];}}catch(_0x5c5798){utils['error'](util[_0x2b1b('0x3')](_0x2b1b('0x3a'),_0x53c30d[_0x2b1b('0x5')]),_0x5c5798);}};exports[_0x2b1b('0x3f')]=function(_0x32ca65){try{if(!_['isNil'](queues[_0x32ca65['uniqueid']])){if(queues[_0x32ca65[_0x2b1b('0x5')]]['queuecallerleaveAt']){utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')](_0x2b1b('0x40'),_0x32ca65['uniqueid']),_0x32ca65);queues[_0x32ca65['uniqueid']][_0x2b1b('0x1a')]=![];queues[_0x32ca65[_0x2b1b('0x5')]]['queuecallerabandon']=![];queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x2a')]=null;queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x1b')]=![];queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x2b')]=null;queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x3d')]=!![];queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x8')]=_0x32ca65['membername'];queues[_0x32ca65[_0x2b1b('0x5')]]['queuecallercomplete']=!![];queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0x1d')]=utils[_0x2b1b('0x15')]();if(_0x32ca65[_0x2b1b('0x41')]==_0x2b1b('0x42')){if(!queues[_0x32ca65[_0x2b1b('0x5')]]['transfer']){queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0xb')]=_0x2b1b('0x43');}}else{queues[_0x32ca65[_0x2b1b('0x5')]][_0x2b1b('0xb')]=_0x2b1b('0x44')+_0x32ca65['reason'][_0x2b1b('0x28')]();}utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x45'),_0x32ca65[_0x2b1b('0x5')],queues[_0x32ca65['uniqueid']]['name'],_0x32ca65['membername'],queues[_0x32ca65['uniqueid']][_0x2b1b('0xb')]));writeDB(queues[_0x32ca65[_0x2b1b('0x5')]]);}}}catch(_0x286e96){utils[_0x2b1b('0x16')](util[_0x2b1b('0x3')](_0x2b1b('0x40'),_0x32ca65[_0x2b1b('0x5')]),_0x286e96);}};exports['blindtransfer']=function(_0x28d0a1){try{if(!_['isNil'](queues[_0x28d0a1[_0x2b1b('0x46')]])){utils['debug'](util[_0x2b1b('0x3')]('[%s][queues][blindtransfer]',_0x28d0a1['uniqueid']),_0x28d0a1);queues[_0x28d0a1[_0x2b1b('0x46')]][_0x2b1b('0x42')]=!![];queues[_0x28d0a1[_0x2b1b('0x46')]]['transfertype']=_0x2b1b('0x47');queues[_0x28d0a1[_0x2b1b('0x46')]][_0x2b1b('0x48')]=_0x28d0a1['extension'];queues[_0x28d0a1[_0x2b1b('0x46')]][_0x2b1b('0x49')]=_0x28d0a1['transfereeuniqueid'];queues[_0x28d0a1[_0x2b1b('0x46')]]['queuecallerexitreason']=_0x2b1b('0x4a');utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x4b'),_0x28d0a1[_0x2b1b('0x5')],queues[_0x28d0a1[_0x2b1b('0x46')]][_0x2b1b('0x20')],_0x28d0a1[_0x2b1b('0x46')],_0x28d0a1['extension']));}}catch(_0x476bfd){utils[_0x2b1b('0x16')](util[_0x2b1b('0x3')]('[%s][queues][blindtransfer]',_0x28d0a1[_0x2b1b('0x5')]),_0x476bfd);}};exports[_0x2b1b('0x4c')]=function(_0x47ed5f){try{utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')]('[%s][queues][attendedtransfer]',_0x47ed5f[_0x2b1b('0x4d')]),_0x47ed5f);if(_0x47ed5f[_0x2b1b('0x4d')]==_0x47ed5f['origtransfererlinkedid']){if(!_[_0x2b1b('0x18')](queues[_0x47ed5f[_0x2b1b('0x4e')]])){utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x4f'),_0x47ed5f['origtransfereruniqueid'],queues[_0x47ed5f['secondtransfererlinkedid']][_0x2b1b('0x20')],_0x47ed5f['origtransfererexten']));queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0x42')]=!![];queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0x50')]='ATTENDED';queues[_0x47ed5f[_0x2b1b('0x4e')]]['transferexten']=_0x47ed5f['origtransfererexten'];queues[_0x47ed5f['secondtransfererlinkedid']][_0x2b1b('0x49')]=_0x47ed5f[_0x2b1b('0x4d')];queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0xb')]=_0x2b1b('0x51');}if(!_[_0x2b1b('0x18')](queues[_0x47ed5f[_0x2b1b('0x52')]])){if(_0x47ed5f[_0x2b1b('0x53')]&&queues[_0x47ed5f[_0x2b1b('0x53')]]){queues[_0x47ed5f['transfereelinkedid']][_0x2b1b('0x22')]=0x1;queues[_0x47ed5f[_0x2b1b('0x46')]]=_[_0x2b1b('0x54')](queues[_0x47ed5f[_0x2b1b('0x53')]]);queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x10')]=_0x47ed5f['transfertargetuniqueid'];queues[_0x47ed5f[_0x2b1b('0x46')]]['queuecallerenterreason']=0x2;queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x9')]=queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0x9')];queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x55')]=queues[_0x47ed5f[_0x2b1b('0x4e')]]['calleridname'];queues[_0x47ed5f['transfereeuniqueid']][_0x2b1b('0x37')]=utils[_0x2b1b('0x15')]();queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x19')]=utils[_0x2b1b('0x15')]();queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x36')]=0x0;queues[_0x47ed5f[_0x2b1b('0x46')]]['mohtime']=0x0;utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x47ed5f[_0x2b1b('0x4d')],queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x20')],queues[_0x47ed5f['transfereeuniqueid']]['calleridnum'],queues[_0x47ed5f[_0x2b1b('0x46')]][_0x2b1b('0x55')]));}else{utils['info'](util[_0x2b1b('0x3')](_0x2b1b('0x56'),_0x47ed5f[_0x2b1b('0x4d')],queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x20')],_0x47ed5f[_0x2b1b('0x4e')]));queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x10')]=_0x47ed5f[_0x2b1b('0x4e')];}}}else if(_0x47ed5f['secondtransfereruniqueid']==_0x47ed5f['secondtransfererlinkedid']){if(!_[_0x2b1b('0x18')](queues[_0x47ed5f[_0x2b1b('0x52')]])){utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x57'),_0x47ed5f[_0x2b1b('0x4d')],queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x20')],_0x47ed5f[_0x2b1b('0x58')],_0x47ed5f[_0x2b1b('0x59')]));queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x42')]=!![];queues[_0x47ed5f[_0x2b1b('0x52')]]['transfertype']=_0x2b1b('0x5a');queues[_0x47ed5f[_0x2b1b('0x52')]]['transferexten']=_0x47ed5f[_0x2b1b('0x59')];queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x49')]=_0x47ed5f[_0x2b1b('0x58')];queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0xb')]=_0x2b1b('0x51');}if(!_['isNil'](queues[_0x47ed5f[_0x2b1b('0x4e')]])){if(_0x47ed5f[_0x2b1b('0x5b')]&&queues[_0x47ed5f[_0x2b1b('0x5b')]]){queues[_0x47ed5f[_0x2b1b('0x5b')]][_0x2b1b('0x22')]=0x1;queues[_0x47ed5f['transfertargetuniqueid']]=_[_0x2b1b('0x54')](queues[_0x47ed5f[_0x2b1b('0x5b')]]);queues[_0x47ed5f[_0x2b1b('0x5c')]][_0x2b1b('0x10')]=_0x47ed5f[_0x2b1b('0x5c')];queues[_0x47ed5f[_0x2b1b('0x5c')]]['queuecallerenterreason']=0x2;queues[_0x47ed5f[_0x2b1b('0x5c')]][_0x2b1b('0x9')]=queues[_0x47ed5f[_0x2b1b('0x52')]]['calleridnum'];queues[_0x47ed5f[_0x2b1b('0x5c')]]['calleridname']=queues[_0x47ed5f[_0x2b1b('0x52')]][_0x2b1b('0x55')];queues[_0x47ed5f['transfertargetuniqueid']][_0x2b1b('0x37')]=utils['now']();queues[_0x47ed5f['transfertargetuniqueid']][_0x2b1b('0x19')]=utils[_0x2b1b('0x15')]();queues[_0x47ed5f[_0x2b1b('0x5c')]][_0x2b1b('0x36')]=0x0;queues[_0x47ed5f['transfertargetuniqueid']][_0x2b1b('0x5d')]=0x0;utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x47ed5f[_0x2b1b('0x4d')],queues[_0x47ed5f[_0x2b1b('0x5c')]]['name'],queues[_0x47ed5f[_0x2b1b('0x5c')]]['transfereduniqueid'],queues[_0x47ed5f[_0x2b1b('0x5c')]][_0x2b1b('0x9')],queues[_0x47ed5f['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util[_0x2b1b('0x3')](_0x2b1b('0x56'),_0x47ed5f[_0x2b1b('0x4d')],queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0x20')],_0x47ed5f[_0x2b1b('0x52')]));queues[_0x47ed5f[_0x2b1b('0x4e')]][_0x2b1b('0x10')]=_0x47ed5f[_0x2b1b('0x52')];}}}}catch(_0x558745){utils[_0x2b1b('0x16')](util['format'](_0x2b1b('0x5e'),_0x47ed5f[_0x2b1b('0x4d')]),_0x558745);}};exports[_0x2b1b('0x5f')]=function(_0xdbd179){try{if(!_[_0x2b1b('0x18')](queues[_0xdbd179['uniqueid']])){utils[_0x2b1b('0x12')](util['format'](_0x2b1b('0x60'),_0xdbd179[_0x2b1b('0x5')]),_0xdbd179);queues[_0xdbd179[_0x2b1b('0x5')]][_0x2b1b('0x61')]=utils[_0x2b1b('0x15')]();utils[_0x2b1b('0x2')](util[_0x2b1b('0x3')](_0x2b1b('0x62'),_0xdbd179[_0x2b1b('0x5')],queues[_0xdbd179[_0x2b1b('0x5')]][_0x2b1b('0x20')],queues[_0xdbd179[_0x2b1b('0x5')]][_0x2b1b('0x61')]));}}catch(_0x2ab177){utils[_0x2b1b('0x16')](util[_0x2b1b('0x3')](_0x2b1b('0x60'),_0xdbd179[_0x2b1b('0x5')]),_0x2ab177);}};exports[_0x2b1b('0x63')]=function(_0x25c3aa){try{if(!_['isNil'](queues[_0x25c3aa[_0x2b1b('0x5')]])){if(!_[_0x2b1b('0x18')](queues[_0x25c3aa[_0x2b1b('0x5')]]['musiconholdstartAt'])){utils[_0x2b1b('0x12')](util[_0x2b1b('0x3')](_0x2b1b('0x64'),_0x25c3aa[_0x2b1b('0x5')]),_0x25c3aa);queues[_0x25c3aa[_0x2b1b('0x5')]][_0x2b1b('0x5d')]+=utils[_0x2b1b('0x65')](utils[_0x2b1b('0x15')](),queues[_0x25c3aa['uniqueid']][_0x2b1b('0x61')]);utils['info'](util['format'](_0x2b1b('0x66'),_0x25c3aa['uniqueid'],queues[_0x25c3aa[_0x2b1b('0x5')]]['name'],queues[_0x25c3aa[_0x2b1b('0x5')]][_0x2b1b('0x5d')]));delete queues[_0x25c3aa['uniqueid']][_0x2b1b('0x61')];}}}catch(_0x5e903c){utils[_0x2b1b('0x16')](util['format'](_0x2b1b('0x64'),_0x25c3aa[_0x2b1b('0x5')]),_0x5e903c);}}; \ No newline at end of file +var _0xad2b=['assigned','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transferexten','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','accountcode','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','format','info','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','name','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]'];(function(_0x414ff1,_0xf0462b){var _0x29c53f=function(_0x1dab72){while(--_0x1dab72){_0x414ff1['push'](_0x414ff1['shift']());}};_0x29c53f(++_0xf0462b);}(_0xad2b,0x91));var _0xbad2=function(_0x1e2565,_0x59c3ef){_0x1e2565=_0x1e2565-0x0;var _0x8b242e=_0xad2b[_0x1e2565];return _0x8b242e;};'use strict';var _=require(_0xbad2('0x0'));var util=require('util');var utils=require(_0xbad2('0x1'));var queues={};function writeDB(_0x4de6f6){utils['info'](util['format'](_0xbad2('0x2'),_0x4de6f6['uniqueid'],_0x4de6f6[_0xbad2('0x3')],_0x4de6f6[_0xbad2('0x4')],_0x4de6f6['lastAssignedTo'],_0x4de6f6[_0xbad2('0x5')],_0x4de6f6[_0xbad2('0x6')],_0x4de6f6['queuecallerexitreason']));if(_0x4de6f6[_0xbad2('0x4')]){utils['getVoiceQueueByName'](_0x4de6f6[_0xbad2('0x4')])[_0xbad2('0x7')](function(_0x547893){if(_0x547893){_0x4de6f6[_0xbad2('0x8')]=_0x547893['type'];}utils[_0xbad2('0x9')](_0xbad2('0xa'),_0x4de6f6);});}else{utils['request'](_0xbad2('0xa'),_0x4de6f6);}if(_0x4de6f6[_0xbad2('0xb')]){delete queues[_0x4de6f6[_0xbad2('0xb')]];}else{delete queues[_0x4de6f6[_0xbad2('0xc')]];}}exports[_0xbad2('0xd')]=function(_0x438f67){try{utils[_0xbad2('0xe')](util[_0xbad2('0xf')]('[%s][queues][queuecallerjoin]',_0x438f67[_0xbad2('0xc')]),_0x438f67);utils[_0xbad2('0x10')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x438f67['uniqueid'],_0x438f67[_0xbad2('0x4')],_0x438f67[_0xbad2('0x11')]));queues[_0x438f67[_0xbad2('0xc')]]=_[_0xbad2('0x12')](_0x438f67,{'originalposition':_0x438f67[_0xbad2('0x11')],'queuecallerjoinAt':utils[_0xbad2('0x13')](),'mohtime':0x0});}catch(_0x44b368){utils[_0xbad2('0x14')](util['format'](_0xbad2('0x15'),_0x438f67['uniqueid']),_0x44b368);}};exports[_0xbad2('0x16')]=function(_0x118aaa){try{if(!_[_0xbad2('0x17')](queues[_0x118aaa[_0xbad2('0xc')]])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x18'),_0x118aaa['uniqueid']),_0x118aaa);if(queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0x19')]){if(!queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0x1a')]&&!queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0x1b')]){queues[_0x118aaa[_0xbad2('0xc')]]['queuecallercomplete']=!![];queues[_0x118aaa['uniqueid']]['queuecallercompleteAt']=utils[_0xbad2('0x13')]();queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0x1c')]=_0xbad2('0x1d');}utils[_0xbad2('0x10')](util[_0xbad2('0xf')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x118aaa['uniqueid'],queues[_0x118aaa['uniqueid']]['name'],queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0x1c')]));writeDB(queues[_0x118aaa['uniqueid']]);}else if(queues[_0x118aaa['uniqueid']][_0xbad2('0xb')]){utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x1e'),_0x118aaa[_0xbad2('0xc')],queues[_0x118aaa[_0xbad2('0xc')]]['name'],queues[_0x118aaa[_0xbad2('0xc')]]['transfereduniqueid']));queues[queues[_0x118aaa[_0xbad2('0xc')]]['transfereduniqueid']]=queues[_0x118aaa[_0xbad2('0xc')]];queues[queues[_0x118aaa[_0xbad2('0xc')]][_0xbad2('0xb')]][_0xbad2('0x1f')]=0x2;delete queues[_0x118aaa['uniqueid']];}}}catch(_0x37f8ee){utils[_0xbad2('0x14')](util[_0xbad2('0xf')](_0xbad2('0x18'),_0x118aaa['uniqueid']),_0x37f8ee);}};exports['varset']=function(_0x5c5323){try{utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x20'),_0x5c5323['uniqueid']),_0x5c5323);if(!_[_0xbad2('0x17')](_0x5c5323[_0xbad2('0x21')][_0xbad2('0x22')])&&_0x5c5323[_0xbad2('0x23')][_0xbad2('0x24')]()!==_0xbad2('0x25')){if(!_[_0xbad2('0x17')](queues[_0x5c5323[_0xbad2('0xc')]])){queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1a')]=![];queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x26')]=null;queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1b')]=!![];queues[_0x5c5323['uniqueid']][_0xbad2('0x27')]=utils[_0xbad2('0x13')]();queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1c')]=_0x5c5323['value'][_0xbad2('0x24')]();utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x28'),_0x5c5323[_0xbad2('0xc')],queues[_0x5c5323[_0xbad2('0xc')]]['name'],_0x5c5323['value'],queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1c')]));writeDB(queues[_0x5c5323[_0xbad2('0xc')]]);}}else if(!_[_0xbad2('0x17')](_0x5c5323[_0xbad2('0x21')][_0xbad2('0x29')])){if(!_['isNil'](queues[_0x5c5323[_0xbad2('0xc')]])&&!queues[_0x5c5323['uniqueid']][_0xbad2('0x1a')]){queues[_0x5c5323['uniqueid']][_0xbad2('0x1a')]=![];queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x26')]=null;queues[_0x5c5323[_0xbad2('0xc')]]['queuecallerexit']=!![];queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x27')]=utils[_0xbad2('0x13')]();queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1c')]=_0xbad2('0x2a');utils['info'](util[_0xbad2('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5c5323[_0xbad2('0xc')],queues[_0x5c5323['uniqueid']]['name'],_0x5c5323[_0xbad2('0x23')],queues[_0x5c5323[_0xbad2('0xc')]][_0xbad2('0x1c')]));}}}catch(_0x52a76b){utils['error'](util[_0xbad2('0xf')](_0xbad2('0x20'),_0x5c5323[_0xbad2('0xc')]),_0x52a76b);}};exports[_0xbad2('0x1a')]=function(_0x5bba2b){try{if(!_[_0xbad2('0x17')](queues[_0x5bba2b[_0xbad2('0xc')]])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')]('[%s][queues][queuecallerabandon]',_0x5bba2b[_0xbad2('0xc')]),_0x5bba2b);queues[_0x5bba2b[_0xbad2('0xc')]]['queuecallerexit']=![];queues[_0x5bba2b['uniqueid']][_0xbad2('0x27')]=null;queues[_0x5bba2b['uniqueid']][_0xbad2('0x1a')]=!![];queues[_0x5bba2b[_0xbad2('0xc')]][_0xbad2('0x26')]=utils[_0xbad2('0x13')]();queues[_0x5bba2b['uniqueid']]['queuecallerexitreason']=_0xbad2('0x2b');utils[_0xbad2('0x10')](util['format'](_0xbad2('0x2c'),_0x5bba2b[_0xbad2('0xc')],queues[_0x5bba2b[_0xbad2('0xc')]]['name'],queues[_0x5bba2b[_0xbad2('0xc')]][_0xbad2('0x1c')]));}}catch(_0x38be14){utils['error'](util[_0xbad2('0xf')](_0xbad2('0x2d'),_0x5bba2b[_0xbad2('0xc')]),_0x38be14);}};exports[_0xbad2('0x2e')]=function(_0x279398){try{if(!_[_0xbad2('0x17')](queues[_0x279398[_0xbad2('0xc')]])){utils['debug'](util[_0xbad2('0xf')](_0xbad2('0x2f'),_0x279398[_0xbad2('0xc')]),_0x279398);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x279398[_0xbad2('0xc')],queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x30')],_0x279398[_0xbad2('0x31')],_0x279398['connectedlinename']));queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x2e')]=!![];queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x19')]=utils[_0xbad2('0x13')]();queues[_0x279398['uniqueid']][_0xbad2('0x32')]=utils[_0xbad2('0x33')](queues[_0x279398['uniqueid']][_0xbad2('0x19')],queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x34')]);queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x11')]=_0x279398[_0xbad2('0x11')];queues[_0x279398[_0xbad2('0xc')]]['count']=_0x279398[_0xbad2('0x35')];queues[_0x279398[_0xbad2('0xc')]]['connectedlinenum']=_0x279398[_0xbad2('0x31')];queues[_0x279398[_0xbad2('0xc')]][_0xbad2('0x36')]=_0x279398[_0xbad2('0x36')];}}catch(_0x4e2476){utils[_0xbad2('0x14')](util[_0xbad2('0xf')](_0xbad2('0x2f'),_0x279398[_0xbad2('0xc')]),_0x4e2476);}};exports[_0xbad2('0x37')]=function(_0x47730c){try{if(!_[_0xbad2('0x17')](queues[_0x47730c['uniqueid']])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x38'),_0x47730c['uniqueid']),_0x47730c);utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x39'),_0x47730c[_0xbad2('0xc')],queues[_0x47730c[_0xbad2('0xc')]][_0xbad2('0x30')],_0x47730c[_0xbad2('0x3a')],_0x47730c['destaccountcode']));queues[_0x47730c['uniqueid']][_0xbad2('0x1a')]=![];queues[_0x47730c[_0xbad2('0xc')]]['queuecallerabandon']=![];queues[_0x47730c[_0xbad2('0xc')]]['queuecallerabandonAt']=null;queues[_0x47730c[_0xbad2('0xc')]]['queuecallerexit']=![];queues[_0x47730c['uniqueid']][_0xbad2('0x1c')]=null;queues[_0x47730c['uniqueid']]['queuecallerexitAt']=null;queues[_0x47730c[_0xbad2('0xc')]]['assigned']=!![];queues[_0x47730c[_0xbad2('0xc')]][_0xbad2('0x6')]=_0x47730c[_0xbad2('0x3b')];queues[_0x47730c[_0xbad2('0xc')]][_0xbad2('0x3c')]=_0x47730c[_0xbad2('0x3a')];}}catch(_0x43ccda){utils[_0xbad2('0x14')](util[_0xbad2('0xf')](_0xbad2('0x38'),_0x47730c[_0xbad2('0xc')]),_0x43ccda);}};exports[_0xbad2('0x3d')]=function(_0x51118e){try{if(!_['isNil'](queues[_0x51118e[_0xbad2('0xc')]])){if(queues[_0x51118e[_0xbad2('0xc')]]['queuecallerleaveAt']){utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x3e'),_0x51118e[_0xbad2('0xc')]),_0x51118e);queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x1a')]=![];queues[_0x51118e[_0xbad2('0xc')]]['queuecallerabandon']=![];queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x26')]=null;queues[_0x51118e['uniqueid']][_0xbad2('0x1b')]=![];queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x27')]=null;queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x3f')]=!![];queues[_0x51118e['uniqueid']][_0xbad2('0x3c')]=_0x51118e['membername'];queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x40')]=!![];queues[_0x51118e[_0xbad2('0xc')]]['queuecallercompleteAt']=utils[_0xbad2('0x13')]();if(_0x51118e[_0xbad2('0x41')]==_0xbad2('0x42')){if(!queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x42')]){queues[_0x51118e['uniqueid']][_0xbad2('0x1c')]=_0xbad2('0x43');}}else{queues[_0x51118e['uniqueid']][_0xbad2('0x1c')]=_0xbad2('0x44')+_0x51118e[_0xbad2('0x41')][_0xbad2('0x24')]();}utils['info'](util[_0xbad2('0xf')](_0xbad2('0x45'),_0x51118e[_0xbad2('0xc')],queues[_0x51118e[_0xbad2('0xc')]][_0xbad2('0x30')],_0x51118e['membername'],queues[_0x51118e[_0xbad2('0xc')]]['queuecallerexitreason']));writeDB(queues[_0x51118e['uniqueid']]);}}}catch(_0x271d40){utils[_0xbad2('0x14')](util[_0xbad2('0xf')](_0xbad2('0x3e'),_0x51118e['uniqueid']),_0x271d40);}};exports[_0xbad2('0x46')]=function(_0x43ce7a){try{if(!_[_0xbad2('0x17')](queues[_0x43ce7a[_0xbad2('0x47')]])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x48'),_0x43ce7a[_0xbad2('0xc')]),_0x43ce7a);queues[_0x43ce7a[_0xbad2('0x47')]][_0xbad2('0x42')]=!![];queues[_0x43ce7a['transfereeuniqueid']][_0xbad2('0x49')]=_0xbad2('0x4a');queues[_0x43ce7a[_0xbad2('0x47')]]['transferexten']=_0x43ce7a[_0xbad2('0x4b')];queues[_0x43ce7a['transfereeuniqueid']]['transferuniqueid']=_0x43ce7a[_0xbad2('0x47')];queues[_0x43ce7a[_0xbad2('0x47')]]['queuecallerexitreason']=_0xbad2('0x4c');utils[_0xbad2('0x10')](util[_0xbad2('0xf')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x43ce7a[_0xbad2('0xc')],queues[_0x43ce7a['transfereeuniqueid']][_0xbad2('0x30')],_0x43ce7a[_0xbad2('0x47')],_0x43ce7a[_0xbad2('0x4b')]));}}catch(_0x11a442){utils['error'](util['format'](_0xbad2('0x48'),_0x43ce7a[_0xbad2('0xc')]),_0x11a442);}};exports['attendedtransfer']=function(_0x111f90){try{utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x4d'),_0x111f90[_0xbad2('0x4e')]),_0x111f90);if(_0x111f90[_0xbad2('0x4e')]==_0x111f90[_0xbad2('0x4f')]){if(!_[_0xbad2('0x17')](queues[_0x111f90[_0xbad2('0x50')]])){utils[_0xbad2('0x10')](util['format'](_0xbad2('0x51'),_0x111f90[_0xbad2('0x4e')],queues[_0x111f90[_0xbad2('0x50')]][_0xbad2('0x30')],_0x111f90['origtransfererexten']));queues[_0x111f90[_0xbad2('0x50')]][_0xbad2('0x42')]=!![];queues[_0x111f90[_0xbad2('0x50')]]['transfertype']=_0xbad2('0x52');queues[_0x111f90['secondtransfererlinkedid']][_0xbad2('0x53')]=_0x111f90[_0xbad2('0x54')];queues[_0x111f90['secondtransfererlinkedid']][_0xbad2('0x55')]=_0x111f90[_0xbad2('0x4e')];queues[_0x111f90[_0xbad2('0x50')]][_0xbad2('0x1c')]=_0xbad2('0x56');}if(!_[_0xbad2('0x17')](queues[_0x111f90['origtransfererlinkedid']])){if(_0x111f90[_0xbad2('0x57')]&&queues[_0x111f90[_0xbad2('0x57')]]){queues[_0x111f90[_0xbad2('0x57')]][_0xbad2('0x1f')]=0x1;queues[_0x111f90[_0xbad2('0x47')]]=_['clone'](queues[_0x111f90['transfereelinkedid']]);queues[_0x111f90['transfereeuniqueid']]['transfereduniqueid']=_0x111f90[_0xbad2('0x58')];queues[_0x111f90['transfereeuniqueid']][_0xbad2('0x1f')]=0x2;queues[_0x111f90[_0xbad2('0x47')]]['calleridnum']=queues[_0x111f90['secondtransfererlinkedid']][_0xbad2('0x5')];queues[_0x111f90[_0xbad2('0x47')]]['calleridname']=queues[_0x111f90[_0xbad2('0x50')]][_0xbad2('0x59')];queues[_0x111f90['transfereeuniqueid']][_0xbad2('0x34')]=utils[_0xbad2('0x13')]();queues[_0x111f90['transfereeuniqueid']][_0xbad2('0x19')]=utils[_0xbad2('0x13')]();queues[_0x111f90[_0xbad2('0x47')]][_0xbad2('0x32')]=0x0;queues[_0x111f90['transfereeuniqueid']]['mohtime']=0x0;utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x5a'),_0x111f90['origtransfereruniqueid'],queues[_0x111f90[_0xbad2('0x47')]]['name'],queues[_0x111f90[_0xbad2('0x47')]][_0xbad2('0x5')],queues[_0x111f90[_0xbad2('0x47')]][_0xbad2('0x59')]));}else{utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x5b'),_0x111f90[_0xbad2('0x4e')],queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x30')],_0x111f90['secondtransfererlinkedid']));queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0xb')]=_0x111f90[_0xbad2('0x50')];}}}else if(_0x111f90['secondtransfereruniqueid']==_0x111f90[_0xbad2('0x50')]){if(!_[_0xbad2('0x17')](queues[_0x111f90['origtransfererlinkedid']])){utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x5c'),_0x111f90['origtransfereruniqueid'],queues[_0x111f90[_0xbad2('0x4f')]]['name'],_0x111f90[_0xbad2('0x5d')],_0x111f90[_0xbad2('0x5e')]));queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x42')]=!![];queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x49')]='ATTENDED';queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x53')]=_0x111f90['secondtransfererexten'];queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x55')]=_0x111f90['secondtransfereruniqueid'];queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0xbad2('0x17')](queues[_0x111f90[_0xbad2('0x50')]])){if(_0x111f90[_0xbad2('0x5f')]&&queues[_0x111f90[_0xbad2('0x5f')]]){queues[_0x111f90[_0xbad2('0x5f')]][_0xbad2('0x1f')]=0x1;queues[_0x111f90[_0xbad2('0x58')]]=_['clone'](queues[_0x111f90[_0xbad2('0x5f')]]);queues[_0x111f90[_0xbad2('0x58')]]['transfereduniqueid']=_0x111f90[_0xbad2('0x58')];queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x1f')]=0x2;queues[_0x111f90[_0xbad2('0x58')]]['calleridnum']=queues[_0x111f90[_0xbad2('0x4f')]][_0xbad2('0x5')];queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x59')]=queues[_0x111f90['origtransfererlinkedid']][_0xbad2('0x59')];queues[_0x111f90[_0xbad2('0x58')]]['queuecallerjoinAt']=utils[_0xbad2('0x13')]();queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x19')]=utils[_0xbad2('0x13')]();queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x32')]=0x0;queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x60')]=0x0;utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x61'),_0x111f90[_0xbad2('0x4e')],queues[_0x111f90['transfertargetuniqueid']][_0xbad2('0x30')],queues[_0x111f90['transfertargetuniqueid']][_0xbad2('0xb')],queues[_0x111f90['transfertargetuniqueid']]['calleridnum'],queues[_0x111f90[_0xbad2('0x58')]][_0xbad2('0x59')]));}else{utils[_0xbad2('0x10')](util[_0xbad2('0xf')](_0xbad2('0x5b'),_0x111f90[_0xbad2('0x4e')],queues[_0x111f90['secondtransfererlinkedid']][_0xbad2('0x30')],_0x111f90[_0xbad2('0x4f')]));queues[_0x111f90[_0xbad2('0x50')]][_0xbad2('0xb')]=_0x111f90[_0xbad2('0x4f')];}}}}catch(_0x2141ab){utils['error'](util[_0xbad2('0xf')]('[%s][queues][attendedtransfer]',_0x111f90[_0xbad2('0x4e')]),_0x2141ab);}};exports[_0xbad2('0x62')]=function(_0x2cff72){try{if(!_['isNil'](queues[_0x2cff72[_0xbad2('0xc')]])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')](_0xbad2('0x63'),_0x2cff72[_0xbad2('0xc')]),_0x2cff72);queues[_0x2cff72[_0xbad2('0xc')]][_0xbad2('0x64')]=utils[_0xbad2('0x13')]();utils[_0xbad2('0x10')](util['format'](_0xbad2('0x65'),_0x2cff72[_0xbad2('0xc')],queues[_0x2cff72[_0xbad2('0xc')]][_0xbad2('0x30')],queues[_0x2cff72[_0xbad2('0xc')]][_0xbad2('0x64')]));}}catch(_0x4a45eb){utils['error'](util[_0xbad2('0xf')]('[%s][queues][musiconholdstart]',_0x2cff72['uniqueid']),_0x4a45eb);}};exports[_0xbad2('0x66')]=function(_0x21e76c){try{if(!_['isNil'](queues[_0x21e76c['uniqueid']])){if(!_[_0xbad2('0x17')](queues[_0x21e76c[_0xbad2('0xc')]][_0xbad2('0x64')])){utils[_0xbad2('0xe')](util[_0xbad2('0xf')]('[%s][queues][musiconholdstop]',_0x21e76c[_0xbad2('0xc')]),_0x21e76c);queues[_0x21e76c[_0xbad2('0xc')]][_0xbad2('0x60')]+=utils[_0xbad2('0x33')](utils[_0xbad2('0x13')](),queues[_0x21e76c[_0xbad2('0xc')]][_0xbad2('0x64')]);utils[_0xbad2('0x10')](util['format'](_0xbad2('0x67'),_0x21e76c[_0xbad2('0xc')],queues[_0x21e76c['uniqueid']][_0xbad2('0x30')],queues[_0x21e76c[_0xbad2('0xc')]][_0xbad2('0x60')]));delete queues[_0x21e76c[_0xbad2('0xc')]]['musiconholdstartAt'];}}}catch(_0x1f1937){utils[_0xbad2('0x14')](util[_0xbad2('0xf')]('[%s][queues][musiconholdstop]',_0x21e76c['uniqueid']),_0x1f1937);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 3b26fe7..083c67f 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4442=['connectedlinenum','connectedlinename','type','forEach','error','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','UserId','request','CreateVoiceRecording','debug','format','context','exten','channel','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x4442,0x143));var _0x2444=function(_0x3a7ed0,_0x557dcf){_0x3a7ed0=_0x3a7ed0-0x0;var _0x1333c1=_0x4442[_0x3a7ed0];return _0x1333c1;};'use strict';var _=require(_0x2444('0x0'));var util=require(_0x2444('0x1'));var utils=require(_0x2444('0x2'));var transfers=require(_0x2444('0x3'));var recordings={};function writeDB(_0x160e98){var _0x2c17d2;utils[_0x2444('0x4')](util['format'](_0x2444('0x5'),_0x160e98[_0x2444('0x6')]));if(transfers[_0x2444('0x7')][_0x160e98[_0x2444('0x6')]]){_0x2c17d2=_0x160e98[_0x2444('0x6')];_0x160e98[_0x2444('0x6')]=transfers[_0x2444('0x7')][_0x160e98['uniqueid']][_0x2444('0x8')];}if(_0x160e98[_0x2444('0x9')]){utils[_0x2444('0xa')](_0x160e98[_0x2444('0x9')])['then'](function(_0x5c014f){if(_0x5c014f){_0x160e98[_0x2444('0xb')]=_0x5c014f['name'];_0x160e98[_0x2444('0xc')]=_0x5c014f['id'];}utils[_0x2444('0xd')]('CreateVoiceRecording',_0x160e98);});}else{utils[_0x2444('0xd')](_0x2444('0xe'),_0x160e98);}if(_0x2c17d2)delete transfers[_0x2444('0x7')][_0x2c17d2];}exports['newchannel']=function(_0x31df00){try{utils[_0x2444('0xf')](util['format']('[%s][recordings][newchannel]',_0x31df00[_0x2444('0x6')]),_0x31df00);if(_0x31df00['uniqueid']==_0x31df00['linkedid']){utils['info'](util[_0x2444('0x10')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x31df00[_0x2444('0x6')],_0x31df00[_0x2444('0x11')],_0x31df00[_0x2444('0x12')]));recordings[_0x31df00['uniqueid']]={'uniqueid':_0x31df00['uniqueid'],'accountcode':_0x31df00[_0x2444('0x9')],'exten':_0x31df00[_0x2444('0x12')],'context':_0x31df00['context'],'channel':_0x31df00[_0x2444('0x13')],'monitors':[]};}}catch(_0x1a05e4){utils['error'](util['format'](_0x2444('0x14'),_0x31df00[_0x2444('0x6')]),_0x1a05e4);}};exports[_0x2444('0x15')]=function(_0x2a4325){try{utils[_0x2444('0xf')](util[_0x2444('0x10')](_0x2444('0x16'),_0x2a4325[_0x2444('0x6')]),_0x2a4325);if(!_[_0x2444('0x17')](recordings[_0x2a4325[_0x2444('0x6')]])&&_0x2a4325[_0x2444('0x18')]==0x6){utils[_0x2444('0x4')](util[_0x2444('0x10')](_0x2444('0x19'),_0x2a4325['uniqueid'],_0x2a4325['context'],_0x2a4325[_0x2444('0x13')]));}else if(!_['isNil'](recordings[_0x2a4325[_0x2444('0x1a')]])&&_0x2a4325[_0x2444('0x18')]==0x6&&_0x2a4325[_0x2444('0x11')]!=_0x2444('0x1b')){utils[_0x2444('0x4')](util['format'](_0x2444('0x1c'),_0x2a4325[_0x2444('0x6')],_0x2a4325[_0x2444('0x1a')],_0x2a4325[_0x2444('0x11')],_0x2a4325[_0x2444('0x13')]));recordings[_0x2a4325[_0x2444('0x1a')]][_0x2444('0x9')]=_0x2a4325[_0x2444('0x9')];}}catch(_0x364000){utils['error'](util[_0x2444('0x10')](_0x2444('0x16'),_0x2a4325[_0x2444('0x6')]),_0x364000);}};exports[_0x2444('0x1d')]=function(_0x2b4acf){try{if(!_['isNil'](_0x2b4acf[_0x2444('0x1e')])&&!_[_0x2444('0x17')](_0x2b4acf['variable'][_0x2444('0x1f')])){utils[_0x2444('0xf')](util[_0x2444('0x10')]('[%s][recordings][varset]',_0x2b4acf[_0x2444('0x6')]),_0x2b4acf);utils['info'](util[_0x2444('0x10')](_0x2444('0x20'),_0x2b4acf[_0x2444('0x6')],_0x2b4acf['variable'],_0x2b4acf[_0x2444('0x21')]));if(_[_0x2444('0x22')](_0x2b4acf[_0x2444('0x21')],_0x2444('0x23'))){_0x2b4acf['value']=_0x2b4acf['value'][_0x2444('0x24')]('.wav49',_0x2444('0x25'));}if(recordings[_0x2b4acf[_0x2444('0x1a')]]){var _0x253274=_[_0x2444('0x26')](recordings[_0x2b4acf[_0x2444('0x1a')]][_0x2444('0x27')],{'value':_0x2b4acf['value']});if(_['isNil'](_0x253274)){recordings[_0x2b4acf[_0x2444('0x1a')]][_0x2444('0x27')][_0x2444('0x28')]({'value':_0x2b4acf[_0x2444('0x21')]});}}}}catch(_0x5057ae){utils['error'](util['format'](_0x2444('0x29'),_0x2b4acf[_0x2444('0x6')]),_0x5057ae);}};exports[_0x2444('0x2a')]=function(_0x12fe2e){try{if(!_[_0x2444('0x17')](recordings[_0x12fe2e['uniqueid']])){utils['debug'](util[_0x2444('0x10')](_0x2444('0x2b'),_0x12fe2e[_0x2444('0x6')]),_0x12fe2e);utils[_0x2444('0x4')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x12fe2e[_0x2444('0x6')],_0x12fe2e[_0x2444('0x2c')],_0x12fe2e[_0x2444('0x2d')],_0x12fe2e[_0x2444('0x2e')]));recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x2c')]=_0x12fe2e['calleridnum'];recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x2d')]=_0x12fe2e[_0x2444('0x2d')];recordings[_0x12fe2e[_0x2444('0x6')]]['connectedlinenum']=_0x12fe2e[_0x2444('0x2f')];recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x30')]=_0x12fe2e[_0x2444('0x30')];if(recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x31')]=='outbound'&&recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x9')]){recordings[_0x12fe2e['uniqueid']][_0x2444('0x2f')]=recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x9')];recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x30')]='';}recordings[_0x12fe2e[_0x2444('0x6')]][_0x2444('0x27')][_0x2444('0x32')](function(_0x168c27){var _0x2cffec=_['clone'](recordings[_0x12fe2e[_0x2444('0x6')]]);_0x2cffec[_0x2444('0x21')]=_0x168c27[_0x2444('0x21')];writeDB(_0x2cffec);});delete recordings[_0x12fe2e[_0x2444('0x6')]];}}catch(_0x7845b1){utils[_0x2444('0x33')](util[_0x2444('0x10')]('[%s][recordings][hangup]',_0x12fe2e[_0x2444('0x6')]),_0x7845b1);}};exports[_0x2444('0x34')]=function(_0x3445a3){try{if(!_['isNil'](recordings[_0x3445a3['uniqueid']])){utils['debug'](util[_0x2444('0x10')]('[%s][recordings][newexten]',_0x3445a3[_0x2444('0x6')]),_0x3445a3);utils[_0x2444('0x4')](util[_0x2444('0x10')](_0x2444('0x35'),_0x3445a3['uniqueid'],_0x3445a3['application'],_0x3445a3[_0x2444('0x36')]));if(_0x3445a3['application'][_0x2444('0x37')]()==_0x2444('0x38')&&_[_0x2444('0x39')](_0x3445a3[_0x2444('0x36')][_0x2444('0x37')](),_0x2444('0x3a'))){var _0x4c989a=_0x3445a3[_0x2444('0x36')][_0x2444('0x3b')]('=');var _0x34f33e=_0x4c989a[0x0][_0x2444('0x3c')](_0x4c989a[0x0][_0x2444('0x3d')]('(')+0x1,_0x4c989a[0x0][_0x2444('0x3d')](')'));var _0x115a35=_0x4c989a[0x1];recordings[_0x3445a3[_0x2444('0x6')]][_0x34f33e]=_0x115a35;}}}catch(_0xb31f91){utils[_0x2444('0x33')](util['format'](_0x2444('0x3e'),_0x3445a3['uniqueid']),_0xb31f91);}};exports[_0x2444('0x3f')]=function(_0x4d4cd0){try{if(!_[_0x2444('0x17')](recordings[_0x4d4cd0[_0x2444('0x6')]])){utils[_0x2444('0xf')](util[_0x2444('0x10')]('[%s][recordings][queuecallerjoin]',_0x4d4cd0[_0x2444('0x6')]),_0x4d4cd0);utils['info'](util['format'](_0x2444('0x40'),_0x4d4cd0[_0x2444('0x6')],_0x4d4cd0[_0x2444('0x41')]));recordings[_0x4d4cd0['uniqueid']]['queue']=_0x4d4cd0[_0x2444('0x41')];}}catch(_0x34bf83){utils[_0x2444('0x33')](util[_0x2444('0x10')]('[%s][recordings][queuecallerjoin]',_0x4d4cd0[_0x2444('0x6')]),_0x34bf83);}};exports[_0x2444('0x42')]=function(_0x345cbf){try{utils['debug'](util[_0x2444('0x10')]('[%s][recordings][blindtransfer]',_0x345cbf['uniqueid']),_0x345cbf);utils['info'](util[_0x2444('0x10')](_0x2444('0x43'),_0x345cbf[_0x2444('0x6')],_0x345cbf[_0x2444('0x44')],_0x345cbf['transferercalleridname'],_0x345cbf[_0x2444('0x45')],_0x345cbf[_0x2444('0x46')]));if(recordings[_0x345cbf['transfereruniqueid']]&&transfers['blinds'][_0x345cbf['transfereruniqueid']]){transfers[_0x2444('0x7')][_0x345cbf[_0x2444('0x47')]][_0x2444('0x48')]=!![];}}catch(_0xafff5b){utils[_0x2444('0x33')](util[_0x2444('0x10')](_0x2444('0x49'),_0x345cbf[_0x2444('0x6')]),_0xafff5b);}}; \ No newline at end of file +var _0x6096=['blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','context','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]'];(function(_0x28258a,_0x22f398){var _0x4e968e=function(_0xda8c73){while(--_0xda8c73){_0x28258a['push'](_0x28258a['shift']());}};_0x4e968e(++_0x22f398);}(_0x6096,0x184));var _0x6609=function(_0x2925c6,_0xe06998){_0x2925c6=_0x2925c6-0x0;var _0x1c1b7e=_0x6096[_0x2925c6];return _0x1c1b7e;};'use strict';var _=require(_0x6609('0x0'));var util=require(_0x6609('0x1'));var utils=require(_0x6609('0x2'));var transfers=require(_0x6609('0x3'));var recordings={};function writeDB(_0x43d2cc){var _0xb0715f;utils[_0x6609('0x4')](util['format']('[%s][recordings][writeDB]',_0x43d2cc['uniqueid']));if(transfers[_0x6609('0x5')][_0x43d2cc['uniqueid']]){_0xb0715f=_0x43d2cc[_0x6609('0x6')];_0x43d2cc[_0x6609('0x6')]=transfers['blinds'][_0x43d2cc[_0x6609('0x6')]][_0x6609('0x7')];}if(_0x43d2cc[_0x6609('0x8')]){utils[_0x6609('0x9')](_0x43d2cc[_0x6609('0x8')])[_0x6609('0xa')](function(_0x4053ae){if(_0x4053ae){_0x43d2cc[_0x6609('0xb')]=_0x4053ae[_0x6609('0xc')];_0x43d2cc[_0x6609('0xd')]=_0x4053ae['id'];}utils[_0x6609('0xe')](_0x6609('0xf'),_0x43d2cc);});}else{utils[_0x6609('0xe')](_0x6609('0xf'),_0x43d2cc);}if(_0xb0715f)delete transfers['blinds'][_0xb0715f];}exports[_0x6609('0x10')]=function(_0x34812f){try{utils['debug'](util[_0x6609('0x11')](_0x6609('0x12'),_0x34812f['uniqueid']),_0x34812f);if(_0x34812f[_0x6609('0x6')]==_0x34812f[_0x6609('0x13')]){utils[_0x6609('0x4')](util[_0x6609('0x11')](_0x6609('0x14'),_0x34812f[_0x6609('0x6')],_0x34812f['context'],_0x34812f[_0x6609('0x15')]));recordings[_0x34812f[_0x6609('0x6')]]={'uniqueid':_0x34812f[_0x6609('0x6')],'accountcode':_0x34812f[_0x6609('0x8')],'exten':_0x34812f[_0x6609('0x15')],'context':_0x34812f['context'],'channel':_0x34812f[_0x6609('0x16')],'monitors':[]};}}catch(_0x29340c){utils[_0x6609('0x17')](util[_0x6609('0x11')](_0x6609('0x12'),_0x34812f[_0x6609('0x6')]),_0x29340c);}};exports[_0x6609('0x18')]=function(_0x3d9f58){try{utils[_0x6609('0x19')](util[_0x6609('0x11')](_0x6609('0x1a'),_0x3d9f58['uniqueid']),_0x3d9f58);if(!_[_0x6609('0x1b')](recordings[_0x3d9f58['uniqueid']])&&_0x3d9f58[_0x6609('0x1c')]==0x6){utils['info'](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3d9f58[_0x6609('0x6')],_0x3d9f58[_0x6609('0x1d')],_0x3d9f58[_0x6609('0x16')]));}else if(!_[_0x6609('0x1b')](recordings[_0x3d9f58[_0x6609('0x13')]])&&_0x3d9f58['channelstate']==0x6&&_0x3d9f58['context']!=_0x6609('0x1e')){utils['info'](util[_0x6609('0x11')](_0x6609('0x1f'),_0x3d9f58[_0x6609('0x6')],_0x3d9f58[_0x6609('0x13')],_0x3d9f58[_0x6609('0x1d')],_0x3d9f58[_0x6609('0x16')]));recordings[_0x3d9f58[_0x6609('0x13')]][_0x6609('0x8')]=_0x3d9f58[_0x6609('0x8')];}}catch(_0x7203ec){utils['error'](util[_0x6609('0x11')]('[%s][recordings][newstate]',_0x3d9f58[_0x6609('0x6')]),_0x7203ec);}};exports[_0x6609('0x20')]=function(_0x18c459){try{if(!_[_0x6609('0x1b')](_0x18c459[_0x6609('0x21')])&&!_['isNil'](_0x18c459[_0x6609('0x21')][_0x6609('0x22')])){utils[_0x6609('0x19')](util[_0x6609('0x11')]('[%s][recordings][varset]',_0x18c459[_0x6609('0x6')]),_0x18c459);utils[_0x6609('0x4')](util[_0x6609('0x11')](_0x6609('0x23'),_0x18c459[_0x6609('0x6')],_0x18c459[_0x6609('0x21')],_0x18c459[_0x6609('0x24')]));if(_[_0x6609('0x25')](_0x18c459[_0x6609('0x24')],_0x6609('0x26'))){_0x18c459['value']=_0x18c459[_0x6609('0x24')][_0x6609('0x27')]('.wav49','.WAV');}if(recordings[_0x18c459['linkedid']]){var _0x44d454=_[_0x6609('0x28')](recordings[_0x18c459[_0x6609('0x13')]][_0x6609('0x29')],{'value':_0x18c459[_0x6609('0x24')]});if(_['isNil'](_0x44d454)){recordings[_0x18c459['linkedid']][_0x6609('0x29')][_0x6609('0x2a')]({'value':_0x18c459[_0x6609('0x24')]});}}}}catch(_0x1de68e){utils[_0x6609('0x17')](util[_0x6609('0x11')](_0x6609('0x2b'),_0x18c459[_0x6609('0x6')]),_0x1de68e);}};exports[_0x6609('0x2c')]=function(_0x52c0ea){try{if(!_[_0x6609('0x1b')](recordings[_0x52c0ea['uniqueid']])){utils[_0x6609('0x19')](util[_0x6609('0x11')](_0x6609('0x2d'),_0x52c0ea[_0x6609('0x6')]),_0x52c0ea);utils[_0x6609('0x4')](util[_0x6609('0x11')](_0x6609('0x2e'),_0x52c0ea[_0x6609('0x6')],_0x52c0ea['calleridnum'],_0x52c0ea[_0x6609('0x2f')],_0x52c0ea[_0x6609('0x30')]));recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x31')]=_0x52c0ea[_0x6609('0x31')];recordings[_0x52c0ea['uniqueid']][_0x6609('0x2f')]=_0x52c0ea['calleridname'];recordings[_0x52c0ea['uniqueid']][_0x6609('0x32')]=_0x52c0ea[_0x6609('0x32')];recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x33')]=_0x52c0ea[_0x6609('0x33')];if(recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x34')]==_0x6609('0x35')&&recordings[_0x52c0ea[_0x6609('0x6')]]['accountcode']){recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x32')]=recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x8')];recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x33')]='';}recordings[_0x52c0ea[_0x6609('0x6')]][_0x6609('0x29')][_0x6609('0x36')](function(_0x4a2639){var _0x50dcaa=_['clone'](recordings[_0x52c0ea[_0x6609('0x6')]]);_0x50dcaa[_0x6609('0x24')]=_0x4a2639['value'];writeDB(_0x50dcaa);});delete recordings[_0x52c0ea[_0x6609('0x6')]];}}catch(_0x34084c){utils[_0x6609('0x17')](util['format'](_0x6609('0x2d'),_0x52c0ea['uniqueid']),_0x34084c);}};exports[_0x6609('0x37')]=function(_0x18b6a2){try{if(!_[_0x6609('0x1b')](recordings[_0x18b6a2[_0x6609('0x6')]])){utils[_0x6609('0x19')](util[_0x6609('0x11')]('[%s][recordings][newexten]',_0x18b6a2[_0x6609('0x6')]),_0x18b6a2);utils['info'](util['format'](_0x6609('0x38'),_0x18b6a2[_0x6609('0x6')],_0x18b6a2['application'],_0x18b6a2[_0x6609('0x39')]));if(_0x18b6a2['application']['toLowerCase']()==_0x6609('0x3a')&&_['startsWith'](_0x18b6a2[_0x6609('0x39')][_0x6609('0x3b')](),_0x6609('0x3c'))){var _0x325170=_0x18b6a2[_0x6609('0x39')][_0x6609('0x3d')]('=');var _0x236861=_0x325170[0x0][_0x6609('0x3e')](_0x325170[0x0][_0x6609('0x3f')]('(')+0x1,_0x325170[0x0][_0x6609('0x3f')](')'));var _0x47b922=_0x325170[0x1];recordings[_0x18b6a2['uniqueid']][_0x236861]=_0x47b922;}}}catch(_0x2f7f52){utils[_0x6609('0x17')](util[_0x6609('0x11')](_0x6609('0x40'),_0x18b6a2[_0x6609('0x6')]),_0x2f7f52);}};exports[_0x6609('0x41')]=function(_0x27a8c2){try{if(!_[_0x6609('0x1b')](recordings[_0x27a8c2[_0x6609('0x6')]])){utils[_0x6609('0x19')](util['format']('[%s][recordings][queuecallerjoin]',_0x27a8c2[_0x6609('0x6')]),_0x27a8c2);utils[_0x6609('0x4')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x27a8c2[_0x6609('0x6')],_0x27a8c2[_0x6609('0x42')]));recordings[_0x27a8c2['uniqueid']][_0x6609('0x42')]=_0x27a8c2[_0x6609('0x42')];}}catch(_0x9adf){utils[_0x6609('0x17')](util[_0x6609('0x11')](_0x6609('0x43'),_0x27a8c2['uniqueid']),_0x9adf);}};exports[_0x6609('0x44')]=function(_0x48c30f){try{utils[_0x6609('0x19')](util[_0x6609('0x11')](_0x6609('0x45'),_0x48c30f[_0x6609('0x6')]),_0x48c30f);utils[_0x6609('0x4')](util['format'](_0x6609('0x46'),_0x48c30f[_0x6609('0x6')],_0x48c30f['transferercalleridnum'],_0x48c30f[_0x6609('0x47')],_0x48c30f[_0x6609('0x48')],_0x48c30f[_0x6609('0x49')]));if(recordings[_0x48c30f[_0x6609('0x4a')]]&&transfers[_0x6609('0x5')][_0x48c30f[_0x6609('0x4a')]]){transfers[_0x6609('0x5')][_0x48c30f['transfereruniqueid']][_0x6609('0x4b')]=!![];}}catch(_0x68ad91){utils['error'](util[_0x6609('0x11')]('[%s][recordings][blindtransfer]',_0x48c30f['uniqueid']),_0x68ad91);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f92ab9d..62a61dc 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2105=['[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','error','lodash','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds'];(function(_0x3b3017,_0x531959){var _0xd8fd8d=function(_0x537d8f){while(--_0x537d8f){_0x3b3017['push'](_0x3b3017['shift']());}};_0xd8fd8d(++_0x531959);}(_0x2105,0x125));var _0x5210=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x2105[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x5210('0x0'));var util=require('util');var utils=require(_0x5210('0x1'));function writeDB(_0x33d6a0){utils[_0x5210('0x2')](util[_0x5210('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x33d6a0[_0x5210('0x4')]===_0x5210('0x5')?_0x33d6a0[_0x5210('0x6')]:_0x33d6a0[_0x5210('0x7')],_0x33d6a0[_0x5210('0x4')]));utils[_0x5210('0x8')](_0x5210('0x9'),_0x33d6a0);}exports['blinds']={};exports[_0x5210('0xa')]=function(_0x24f410){try{utils[_0x5210('0xb')](util[_0x5210('0x3')](_0x5210('0xc'),_0x24f410['uniqueid']),_0x24f410);utils[_0x5210('0x2')](util[_0x5210('0x3')](_0x5210('0xd'),_0x24f410[_0x5210('0x7')],_0x24f410[_0x5210('0xe')],_0x24f410['transferercalleridname'],_0x24f410[_0x5210('0xf')],_0x24f410[_0x5210('0x10')]));_0x24f410[_0x5210('0x4')]=_0x5210('0x11');exports[_0x5210('0x12')][_0x24f410['transfereruniqueid']]=_0x24f410;writeDB(_0x24f410);}catch(_0x1cdcfb){utils['error'](util[_0x5210('0x3')]('[%s][transfers][blindtransfer]',_0x24f410[_0x5210('0x7')]),_0x1cdcfb);}};exports['attendedtransfer']=function(_0x19afc4){try{utils[_0x5210('0xb')](util[_0x5210('0x3')](_0x5210('0x13'),_0x19afc4[_0x5210('0x6')]),_0x19afc4);utils[_0x5210('0x2')](util['format'](_0x5210('0x14'),_0x19afc4[_0x5210('0x6')],_0x19afc4[_0x5210('0x15')],_0x19afc4[_0x5210('0x16')],_0x19afc4[_0x5210('0x17')],_0x19afc4['transfertargetcalleridname']));_0x19afc4=_[_0x5210('0x18')](_0x19afc4,{'transfererchannel':_0x19afc4['origtransfererchannel'],'transferercalleridnum':_0x19afc4['origtransferercalleridnum'],'transferercalleridname':_0x19afc4[_0x5210('0x16')],'transfererconnectedlinenum':_0x19afc4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x19afc4[_0x5210('0x19')],'transfereraccountcode':_0x19afc4[_0x5210('0x1a')],'transferercontext':_0x19afc4[_0x5210('0x1b')],'transfererexten':_0x19afc4[_0x5210('0x1c')],'transfererlinkedid':_0x19afc4['origtransfererlinkedid'],'context':_0x19afc4[_0x5210('0x1d')],'extension':_0x19afc4[_0x5210('0x1e')],'type':_0x5210('0x5')});if(_[_0x5210('0x1f')](_0x19afc4['transfereechannel'])){_0x19afc4=_[_0x5210('0x18')](_0x19afc4,{'transfereechannel':_0x19afc4[_0x5210('0x20')],'transfereecalleridnum':_0x19afc4[_0x5210('0x17')],'transfereecalleridname':_0x19afc4[_0x5210('0x21')],'transfereeconnectedlinenum':_0x19afc4[_0x5210('0x22')],'transfereeconnectedlinename':_0x19afc4[_0x5210('0x23')],'transfereeaccountcode':_0x19afc4[_0x5210('0x24')],'transfereecontext':_0x19afc4[_0x5210('0x25')],'transfereeexten':_0x19afc4['transfertargetexten'],'transfereelinkedid':_0x19afc4['transfertargetlinkedid']});}writeDB(_0x19afc4);}catch(_0x3b777d){utils[_0x5210('0x26')](util[_0x5210('0x3')](_0x5210('0x13'),_0x19afc4[_0x5210('0x6')]),_0x3b777d);}}; \ No newline at end of file +var _0x2f55=['secondtransfererexten','origtransfererexten','isNil','assign','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x2f55,0xc7));var _0x52f5=function(_0x23fcf7,_0x492315){_0x23fcf7=_0x23fcf7-0x0;var _0x120a25=_0x2f55[_0x23fcf7];return _0x120a25;};'use strict';var _=require('lodash');var util=require(_0x52f5('0x0'));var utils=require('./utils');function writeDB(_0x49b079){utils[_0x52f5('0x1')](util[_0x52f5('0x2')](_0x52f5('0x3'),_0x49b079[_0x52f5('0x4')]===_0x52f5('0x5')?_0x49b079[_0x52f5('0x6')]:_0x49b079['uniqueid'],_0x49b079[_0x52f5('0x4')]));utils['request'](_0x52f5('0x7'),_0x49b079);}exports[_0x52f5('0x8')]={};exports[_0x52f5('0x9')]=function(_0x3941a0){try{utils['debug'](util['format'](_0x52f5('0xa'),_0x3941a0['uniqueid']),_0x3941a0);utils['info'](util[_0x52f5('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3941a0[_0x52f5('0xb')],_0x3941a0[_0x52f5('0xc')],_0x3941a0[_0x52f5('0xd')],_0x3941a0[_0x52f5('0xe')],_0x3941a0[_0x52f5('0xf')]));_0x3941a0[_0x52f5('0x4')]='blind';exports[_0x52f5('0x8')][_0x3941a0[_0x52f5('0x10')]]=_0x3941a0;writeDB(_0x3941a0);}catch(_0x45cd35){utils[_0x52f5('0x11')](util[_0x52f5('0x2')](_0x52f5('0xa'),_0x3941a0[_0x52f5('0xb')]),_0x45cd35);}};exports[_0x52f5('0x12')]=function(_0x394b6a){try{utils[_0x52f5('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0x394b6a['origtransfereruniqueid']),_0x394b6a);utils['info'](util[_0x52f5('0x2')](_0x52f5('0x14'),_0x394b6a['origtransfereruniqueid'],_0x394b6a[_0x52f5('0x15')],_0x394b6a[_0x52f5('0x16')],_0x394b6a[_0x52f5('0x17')],_0x394b6a[_0x52f5('0x18')]));_0x394b6a=_['assign'](_0x394b6a,{'transfererchannel':_0x394b6a['origtransfererchannel'],'transferercalleridnum':_0x394b6a['origtransferercalleridnum'],'transferercalleridname':_0x394b6a['origtransferercalleridname'],'transfererconnectedlinenum':_0x394b6a[_0x52f5('0x19')],'transfererconnectedlinename':_0x394b6a[_0x52f5('0x1a')],'transfereraccountcode':_0x394b6a[_0x52f5('0x1b')],'transferercontext':_0x394b6a[_0x52f5('0x1c')],'transfererexten':_0x394b6a[_0x52f5('0x1d')],'transfererlinkedid':_0x394b6a['origtransfererlinkedid'],'context':_0x394b6a['origtransferercontext'],'extension':_0x394b6a[_0x52f5('0x1e')],'type':_0x52f5('0x5')});if(_[_0x52f5('0x1f')](_0x394b6a['transfereechannel'])){_0x394b6a=_[_0x52f5('0x20')](_0x394b6a,{'transfereechannel':_0x394b6a['transfertargetchannel'],'transfereecalleridnum':_0x394b6a[_0x52f5('0x17')],'transfereecalleridname':_0x394b6a[_0x52f5('0x18')],'transfereeconnectedlinenum':_0x394b6a[_0x52f5('0x21')],'transfereeconnectedlinename':_0x394b6a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x394b6a['transfertargetaccountcode'],'transfereecontext':_0x394b6a[_0x52f5('0x22')],'transfereeexten':_0x394b6a[_0x52f5('0x23')],'transfereelinkedid':_0x394b6a[_0x52f5('0x24')]});}writeDB(_0x394b6a);}catch(_0x478606){utils[_0x52f5('0x11')](util[_0x52f5('0x2')](_0x52f5('0x25'),_0x394b6a['origtransfereruniqueid']),_0x478606);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c1006ca..c071961 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd911=['[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','sumTime','isAfter','isBefore','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name'];(function(_0x5c0032,_0x5e118a){var _0x285939=function(_0x555465){while(--_0x555465){_0x5c0032['push'](_0x5c0032['shift']());}};_0x285939(++_0x5e118a);}(_0xd911,0x1df));var _0x1d91=function(_0xb58bc2,_0x3fff5f){_0xb58bc2=_0xb58bc2-0x0;var _0x3902d6=_0xd911[_0xb58bc2];return _0x3902d6;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x1d91('0x0'));var util=require('util');var client=jayson[_0x1d91('0x1')][_0x1d91('0x2')]({'port':0x2329});var logger=require(_0x1d91('0x3'))(_0x1d91('0x4'));exports[_0x1d91('0x5')]=function(_0xec340,_0x24d681){logger[_0x1d91('0x5')](_0xec340,_0x24d681?util[_0x1d91('0x6')](_0x24d681,{'showHidden':![],'depth':null}):'');};exports[_0x1d91('0x7')]=function(_0x56908c,_0x237ede){logger[_0x1d91('0x7')](_0x56908c,_0x237ede?util[_0x1d91('0x6')](_0x237ede,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1c336d,_0x22b8ea){logger[_0x1d91('0x8')](_0x1c336d,_0x22b8ea?util['inspect'](_0x22b8ea,{'showHidden':![],'depth':null}):'');};exports[_0x1d91('0x9')]=function(_0x406765,_0x364c1e){return client[_0x1d91('0x9')](_0x406765,{'body':_0x364c1e})[_0x1d91('0xa')](function(_0x12d1a2){logger['debug']('[utils][request]\x20name:%s',_0x406765,_0x12d1a2?util[_0x1d91('0x6')](_0x12d1a2,{'showHidden':![],'depth':null}):'');})[_0x1d91('0xb')](function(_0x5dc335){logger['error'](_0x1d91('0xc'),_0x406765,_0x5dc335?util[_0x1d91('0x6')](_0x5dc335,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3d9c48){return client[_0x1d91('0x9')](_0x1d91('0xd'),{'options':{'raw':!![],'attributes':['id',_0x1d91('0xe'),_0x1d91('0xf'),'interface'],'where':_0x3d9c48,'limit':0x1}})['then'](function(_0x280aef){logger['debug'](_0x1d91('0x10'),JSON[_0x1d91('0x11')](_0x3d9c48),_0x280aef?util[_0x1d91('0x6')](_0x280aef,{'showHidden':![],'depth':null}):'');return _0x280aef[_0x1d91('0x12')][_0x1d91('0x13')]?_0x280aef[_0x1d91('0x12')][0x0]:null;});}exports[_0x1d91('0x14')]=function(_0x2770c8){return new BPromise(function(_0x3c53fb,_0x2b3946){if(_0x2770c8){return getUser({'internal':_0x2770c8})[_0x1d91('0xa')](function(_0x1dd1aa){logger['info'](_0x1d91('0x15'),_0x2770c8,_0x1dd1aa?'found':_0x1d91('0x16'));return _0x3c53fb(_0x1dd1aa);})[_0x1d91('0xb')](function(_0x548b22){logger['error'](_0x1d91('0x17'),_0x548b22?util['inspect'](_0x548b22,{'showHidden':![],'depth':null}):'');return _0x3c53fb(null);});}return _0x3c53fb(null);});};exports[_0x1d91('0x18')]=function(_0x362fb6){return new BPromise(function(_0x1140a4,_0x5f58ec){if(_0x362fb6){return getUser({'interface':_0x362fb6})[_0x1d91('0xa')](function(_0xd37820){logger[_0x1d91('0x5')](_0x1d91('0x19'),_0x362fb6,_0xd37820?'found':'notfound');return _0x1140a4(_0xd37820);})['catch'](function(_0x17d60e){logger[_0x1d91('0x8')](_0x1d91('0x1a'),_0x17d60e?util['inspect'](_0x17d60e,{'showHidden':![],'depth':null}):'');return _0x1140a4(null);});}return _0x1140a4(null);});};exports['getUserByName']=function(_0x57b9b0){return new BPromise(function(_0x25c026,_0x404fa1){if(_0x57b9b0){return getUser({'name':_0x57b9b0})['then'](function(_0x57bb2c){logger[_0x1d91('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x57b9b0,_0x57bb2c?_0x1d91('0x1b'):_0x1d91('0x16'));return _0x25c026(_0x57bb2c);})[_0x1d91('0xb')](function(_0x4ef30a){logger[_0x1d91('0x8')](_0x1d91('0x1c'),_0x4ef30a?util['inspect'](_0x4ef30a,{'showHidden':![],'depth':null}):'');return _0x25c026(null);});}return _0x25c026(null);});};exports[_0x1d91('0x1d')]=function(_0x3a649b){return new BPromise(function(_0x1f1d58,_0x1a2f48){if(_0x3a649b){return client['request'](_0x1d91('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x1d91('0xf'),_0x1d91('0x1f'),'acw',_0x1d91('0x20')],'where':{'name':_0x3a649b},'limit':0x1}})[_0x1d91('0xa')](function(_0x6e8961){logger[_0x1d91('0x7')](_0x1d91('0x21'),_0x3a649b,_0x6e8961?util[_0x1d91('0x6')](_0x6e8961,{'showHidden':![],'depth':null}):'');logger[_0x1d91('0x5')](_0x1d91('0x22'),_0x3a649b,_0x6e8961?_0x1d91('0x1b'):'notfound');return _0x1f1d58(_0x6e8961['result']['length']?_0x6e8961[_0x1d91('0x12')][0x0]:null);})[_0x1d91('0xb')](function(_0x4d654a){logger['error'](_0x1d91('0x23'),_0x4d654a?util[_0x1d91('0x6')](_0x4d654a,{'showHidden':![],'depth':null}):'');return _0x1f1d58(null);});}return _0x1f1d58(null);});};exports[_0x1d91('0x24')]=function(_0x1b4323,_0x2efd6f){return moment(_0x1b4323)['add'](_0x2efd6f,'seconds')[_0x1d91('0x25')](_0x1d91('0x26'));};exports[_0x1d91('0x27')]=function(_0x38a753,_0x421648){return moment(_0x38a753)['subtract'](_0x421648,_0x1d91('0x28'))[_0x1d91('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1d91('0x29')]=function(_0x38b74e,_0x8ccd79){return moment(_0x38b74e)['diff'](moment(_0x8ccd79),_0x1d91('0x28'));};exports[_0x1d91('0x2a')]=function(_0x347d40,_0x5aa85c){return parseInt(_0x347d40,0xa)+parseInt(_0x5aa85c,0xa);};exports['now']=function(){return moment()[_0x1d91('0x25')](_0x1d91('0x26'));};exports['isAfter']=function(_0x4bd0c1,_0x4533a8){if(_0x4533a8){return moment(_0x4bd0c1)[_0x1d91('0x2b')](_0x4533a8);}return!![];};exports[_0x1d91('0x2c')]=function(_0x47581a,_0x4af3e9){if(_0x4af3e9){return moment(_0x47581a)[_0x1d91('0x2c')](_0x4af3e9);}else if(_0x47581a){return!![];}return![];}; \ No newline at end of file +var _0x0348=['inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','util','client','../../config/logger','xdr','info'];(function(_0xe69467,_0x515880){var _0x13eff9=function(_0x5d75cd){while(--_0x5d75cd){_0xe69467['push'](_0xe69467['shift']());}};_0x13eff9(++_0x515880);}(_0x0348,0x1e9));var _0x8034=function(_0x1ec479,_0x54d127){_0x1ec479=_0x1ec479-0x0;var _0x43ca09=_0x0348[_0x1ec479];return _0x43ca09;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x8034('0x0'));var moment=require('moment');var util=require(_0x8034('0x1'));var client=jayson[_0x8034('0x2')]['http']({'port':0x2329});var logger=require(_0x8034('0x3'))(_0x8034('0x4'));exports[_0x8034('0x5')]=function(_0x18f41e,_0x1500ae){logger[_0x8034('0x5')](_0x18f41e,_0x1500ae?util[_0x8034('0x6')](_0x1500ae,{'showHidden':![],'depth':null}):'');};exports[_0x8034('0x7')]=function(_0x5dfb10,_0x317fac){logger[_0x8034('0x7')](_0x5dfb10,_0x317fac?util[_0x8034('0x6')](_0x317fac,{'showHidden':![],'depth':null}):'');};exports[_0x8034('0x8')]=function(_0x326344,_0x3d430d){logger[_0x8034('0x8')](_0x326344,_0x3d430d?util[_0x8034('0x6')](_0x3d430d,{'showHidden':![],'depth':null}):'');};exports[_0x8034('0x9')]=function(_0x1fe237,_0xf665e1){return client[_0x8034('0x9')](_0x1fe237,{'body':_0xf665e1})['then'](function(_0x35039c){logger['debug'](_0x8034('0xa'),_0x1fe237,_0x35039c?util['inspect'](_0x35039c,{'showHidden':![],'depth':null}):'');})[_0x8034('0xb')](function(_0x58f47e){logger['error'](_0x8034('0xa'),_0x1fe237,_0x58f47e?util[_0x8034('0x6')](_0x58f47e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4235a8){return client['request'](_0x8034('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x8034('0xd'),'interface'],'where':_0x4235a8,'limit':0x1}})[_0x8034('0xe')](function(_0x370827){logger[_0x8034('0x7')](_0x8034('0xf'),JSON['stringify'](_0x4235a8),_0x370827?util['inspect'](_0x370827,{'showHidden':![],'depth':null}):'');return _0x370827[_0x8034('0x10')][_0x8034('0x11')]?_0x370827[_0x8034('0x10')][0x0]:null;});}exports[_0x8034('0x12')]=function(_0x37aea0){return new BPromise(function(_0x9889fa,_0x136dc1){if(_0x37aea0){return getUser({'internal':_0x37aea0})['then'](function(_0x1d92f0){logger[_0x8034('0x5')](_0x8034('0x13'),_0x37aea0,_0x1d92f0?_0x8034('0x14'):'notfound');return _0x9889fa(_0x1d92f0);})[_0x8034('0xb')](function(_0x2e14b6){logger[_0x8034('0x8')](_0x8034('0x15'),_0x2e14b6?util['inspect'](_0x2e14b6,{'showHidden':![],'depth':null}):'');return _0x9889fa(null);});}return _0x9889fa(null);});};exports[_0x8034('0x16')]=function(_0x54c972){return new BPromise(function(_0x3a2dde,_0x3bb1a6){if(_0x54c972){return getUser({'interface':_0x54c972})[_0x8034('0xe')](function(_0x2a9cd7){logger[_0x8034('0x5')](_0x8034('0x17'),_0x54c972,_0x2a9cd7?'found':'notfound');return _0x3a2dde(_0x2a9cd7);})[_0x8034('0xb')](function(_0x11afc2){logger['error']('[utils][getUserByInterface]',_0x11afc2?util[_0x8034('0x6')](_0x11afc2,{'showHidden':![],'depth':null}):'');return _0x3a2dde(null);});}return _0x3a2dde(null);});};exports[_0x8034('0x18')]=function(_0xe80f91){return new BPromise(function(_0x3a8c29,_0x54564d){if(_0xe80f91){return getUser({'name':_0xe80f91})[_0x8034('0xe')](function(_0x930fab){logger['info'](_0x8034('0x19'),_0xe80f91,_0x930fab?_0x8034('0x14'):_0x8034('0x1a'));return _0x3a8c29(_0x930fab);})['catch'](function(_0x309f67){logger['error'](_0x8034('0x1b'),_0x309f67?util['inspect'](_0x309f67,{'showHidden':![],'depth':null}):'');return _0x3a8c29(null);});}return _0x3a8c29(null);});};exports[_0x8034('0x1c')]=function(_0x570837){return new BPromise(function(_0x46ec4b,_0x7dfb5f){if(_0x570837){return client['request'](_0x8034('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x8034('0xd'),'type',_0x8034('0x1e'),_0x8034('0x1f')],'where':{'name':_0x570837},'limit':0x1}})[_0x8034('0xe')](function(_0x258be2){logger[_0x8034('0x7')](_0x8034('0x20'),_0x570837,_0x258be2?util[_0x8034('0x6')](_0x258be2,{'showHidden':![],'depth':null}):'');logger[_0x8034('0x5')](_0x8034('0x21'),_0x570837,_0x258be2?_0x8034('0x14'):_0x8034('0x1a'));return _0x46ec4b(_0x258be2[_0x8034('0x10')][_0x8034('0x11')]?_0x258be2[_0x8034('0x10')][0x0]:null);})[_0x8034('0xb')](function(_0x3caf97){logger[_0x8034('0x8')](_0x8034('0x22'),_0x3caf97?util[_0x8034('0x6')](_0x3caf97,{'showHidden':![],'depth':null}):'');return _0x46ec4b(null);});}return _0x46ec4b(null);});};exports[_0x8034('0x23')]=function(_0x4830fa,_0x2482ba){return moment(_0x4830fa)['add'](_0x2482ba,_0x8034('0x24'))[_0x8034('0x25')](_0x8034('0x26'));};exports['subtractTime']=function(_0x281313,_0x2b6eff){return moment(_0x281313)[_0x8034('0x27')](_0x2b6eff,_0x8034('0x24'))[_0x8034('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8034('0x28')]=function(_0x5808c8,_0x54d124){return moment(_0x5808c8)[_0x8034('0x29')](moment(_0x54d124),'seconds');};exports[_0x8034('0x2a')]=function(_0x41d1ae,_0x3f1490){return parseInt(_0x41d1ae,0xa)+parseInt(_0x3f1490,0xa);};exports['now']=function(){return moment()[_0x8034('0x25')](_0x8034('0x26'));};exports['isAfter']=function(_0x15dafb,_0x3b5227){if(_0x3b5227){return moment(_0x15dafb)[_0x8034('0x2b')](_0x3b5227);}return!![];};exports[_0x8034('0x2c')]=function(_0x46679a,_0x234723){if(_0x234723){return moment(_0x46679a)[_0x8034('0x2c')](_0x234723);}else if(_0x46679a){return!![];}return![];}; \ No newline at end of file